From 660dba72e9a44ab28cbf7cd8598cd26c72f91e43 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 3 Dec 2021 16:08:19 +0100 Subject: [PATCH 001/545] Updated to 95.0 --- .gitignore | 2 ++ firefox.spec | 9 ++++--- pgo.patch | 69 +++++++++++++++++++++++++++------------------------- sources | 4 +-- 4 files changed, 46 insertions(+), 38 deletions(-) diff --git a/.gitignore b/.gitignore index 75510b1..6138c83 100644 --- a/.gitignore +++ b/.gitignore @@ -481,3 +481,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-94.0-20211031.tar.xz /firefox-94.0.2.source.tar.xz /firefox-langpacks-94.0.2-20211125.tar.xz +/firefox-95.0.source.tar.xz +/firefox-langpacks-95.0-20211203.tar.xz diff --git a/firefox.spec b/firefox.spec index 51bf73c..865699d 100644 --- a/firefox.spec +++ b/firefox.spec @@ -162,13 +162,13 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox -Version: 94.0.2 +Version: 95.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20211125.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20211203.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -457,7 +457,7 @@ This package contains results of tests executed during build. %patch49 -p1 -b .build-arm-libaom %patch53 -p1 -b .firefox-gcc-build %patch54 -p1 -b .1669639 -%patch55 -p1 -b .testing +#%patch55 -p1 -b .testing %patch57 -p1 -b .ffvpx-with-vapi #%patch61 -p1 -b .glibc-dynstack @@ -1052,6 +1052,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Fri Dec 3 2021 Martin Stransky - 95.0-1 +- Updated to 95.0 + * Fri Nov 19 2021 Martin Stransky - 94.0-2 - Added fix for mozbz#1739924 / rhbz#2020981. diff --git a/pgo.patch b/pgo.patch index 13a445b..bd92d1f 100644 --- a/pgo.patch +++ b/pgo.patch @@ -1,26 +1,29 @@ -diff -up firefox-88.0/build/moz.configure/lto-pgo.configure.pgo firefox-88.0/build/moz.configure/lto-pgo.configure ---- firefox-88.0/build/moz.configure/lto-pgo.configure.pgo 2021-04-15 21:44:26.000000000 +0200 -+++ firefox-88.0/build/moz.configure/lto-pgo.configure 2021-04-19 13:45:00.240696430 +0200 -@@ -240,13 +240,13 @@ def lto( - cflags.append("-flto") - ldflags.append("-flto") - else: -- cflags.append("-flto=thin") -- ldflags.append("-flto=thin") -+ cflags.append("-flto") -+ ldflags.append("-flto") - elif c_compiler.type == "clang-cl": - if len(value) and value[0].lower() == "full": - cflags.append("-flto") - else: -- cflags.append("-flto=thin") -+ cflags.append("-flto") - # With clang-cl, -flto can only be used with -c or -fuse-ld=lld. - # AC_TRY_LINKs during configure don't have -c, so pass -fuse-ld=lld. - cflags.append("-fuse-ld=lld") -diff -up firefox-88.0/build/pgo/profileserver.py.pgo firefox-88.0/build/pgo/profileserver.py ---- firefox-88.0/build/pgo/profileserver.py.pgo 2021-04-15 21:44:26.000000000 +0200 -+++ firefox-88.0/build/pgo/profileserver.py 2021-04-19 13:45:00.240696430 +0200 +diff -up firefox-95.0/build/moz.configure/lto-pgo.configure.pgo firefox-95.0/build/moz.configure/lto-pgo.configure +--- firefox-95.0/build/moz.configure/lto-pgo.configure.pgo 2021-12-03 16:04:48.441167077 +0100 ++++ firefox-95.0/build/moz.configure/lto-pgo.configure 2021-12-03 16:06:19.129415806 +0100 +@@ -248,8 +248,8 @@ def lto( + cflags.append("-flto") + ldflags.append("-flto") + else: +- cflags.append("-flto=thin") +- ldflags.append("-flto=thin") ++ cflags.append("-flto") ++ ldflags.append("-flto") + + if target.os == "Android" and value == "cross": + # Work around https://github.com/rust-lang/rust/issues/90088 +@@ -265,7 +265,7 @@ def lto( + if value == "full": + cflags.append("-flto") + else: +- cflags.append("-flto=thin") ++ cflags.append("-flto") + # With clang-cl, -flto can only be used with -c or -fuse-ld=lld. + # AC_TRY_LINKs during configure don't have -c, so pass -fuse-ld=lld. + cflags.append("-fuse-ld=lld") +diff -up firefox-95.0/build/pgo/profileserver.py.pgo firefox-95.0/build/pgo/profileserver.py +--- firefox-95.0/build/pgo/profileserver.py.pgo 2021-11-29 15:01:10.000000000 +0100 ++++ firefox-95.0/build/pgo/profileserver.py 2021-12-03 16:04:48.441167077 +0100 @@ -11,7 +11,7 @@ import glob import subprocess @@ -67,9 +70,9 @@ diff -up firefox-88.0/build/pgo/profileserver.py.pgo firefox-88.0/build/pgo/prof llvm_profdata = env.get("LLVM_PROFDATA") if llvm_profdata: profraw_files = glob.glob("*.profraw") -diff -up firefox-88.0/build/unix/mozconfig.unix.pgo firefox-88.0/build/unix/mozconfig.unix ---- firefox-88.0/build/unix/mozconfig.unix.pgo 2021-04-15 21:44:26.000000000 +0200 -+++ firefox-88.0/build/unix/mozconfig.unix 2021-04-19 13:45:00.240696430 +0200 +diff -up firefox-95.0/build/unix/mozconfig.unix.pgo firefox-95.0/build/unix/mozconfig.unix +--- firefox-95.0/build/unix/mozconfig.unix.pgo 2021-11-29 15:01:10.000000000 +0100 ++++ firefox-95.0/build/unix/mozconfig.unix 2021-12-03 16:04:48.441167077 +0100 @@ -4,6 +4,15 @@ if [ -n "$FORCE_GCC" ]; then CC="$MOZ_FETCHES_DIR/gcc/bin/gcc" CXX="$MOZ_FETCHES_DIR/gcc/bin/g++" @@ -86,19 +89,19 @@ diff -up firefox-88.0/build/unix/mozconfig.unix.pgo firefox-88.0/build/unix/mozc # We want to make sure we use binutils and other binaries in the tooltool # package. mk_add_options "export PATH=$MOZ_FETCHES_DIR/gcc/bin:$PATH" -diff -up firefox-88.0/extensions/spellcheck/src/moz.build.pgo firefox-88.0/extensions/spellcheck/src/moz.build ---- firefox-88.0/extensions/spellcheck/src/moz.build.pgo 2021-04-15 21:44:28.000000000 +0200 -+++ firefox-88.0/extensions/spellcheck/src/moz.build 2021-04-19 13:45:00.240696430 +0200 +diff -up firefox-95.0/extensions/spellcheck/src/moz.build.pgo firefox-95.0/extensions/spellcheck/src/moz.build +--- firefox-95.0/extensions/spellcheck/src/moz.build.pgo 2021-11-29 15:01:12.000000000 +0100 ++++ firefox-95.0/extensions/spellcheck/src/moz.build 2021-12-03 16:04:48.441167077 +0100 @@ -31,3 +31,5 @@ EXPORTS.mozilla += [ if CONFIG["CC_TYPE"] in ("clang", "gcc"): CXXFLAGS += ["-Wno-error=shadow"] + +CXXFLAGS += ['-fno-devirtualize'] -diff -up firefox-88.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-88.0/toolkit/components/terminator/nsTerminator.cpp ---- firefox-88.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2021-04-19 13:45:00.240696430 +0200 -+++ firefox-88.0/toolkit/components/terminator/nsTerminator.cpp 2021-04-19 13:46:01.144530790 +0200 -@@ -456,6 +456,11 @@ void nsTerminator::StartWatchdog() { +diff -up firefox-95.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-95.0/toolkit/components/terminator/nsTerminator.cpp +--- firefox-95.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2021-11-29 15:01:30.000000000 +0100 ++++ firefox-95.0/toolkit/components/terminator/nsTerminator.cpp 2021-12-03 16:04:48.442167068 +0100 +@@ -466,6 +466,11 @@ void nsTerminator::StartWatchdog() { } #endif diff --git a/sources b/sources index 11f8c27..4b2f60b 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = b9ab1498be90ecf60822df7021f8812f124550d97f8cd687c69d3ab56fc5fb714bfe88c78c978a1794d211724909a9a5cad6a4b483fa05f762909c45d5075520 SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (firefox-94.0.2.source.tar.xz) = 00ce4f6be711e1f309828e030163e61bbd9fe3364a8e852e644177c93832078877dea1a516719b106a52c0d8462193ed52c1d3cc7ae34ea021eb1dd0f5b685e2 -SHA512 (firefox-langpacks-94.0.2-20211125.tar.xz) = 14421acd21a9faeb7543467d015a00db1b945e5be7db9ced9edcd7480177a4bf9273225463aa18f62c0217f33ff6984e63dff574f68ee3603a5d10215a1ecd50 +SHA512 (firefox-95.0.source.tar.xz) = 350672a2cd99195c67dafc0e71c6eaf1e23e85a5fe92775697119a054f17c34a736035e23d7f2bb404b544f0f144efef3843cfc293596a6e61d1ea36efc3a724 +SHA512 (firefox-langpacks-95.0-20211203.tar.xz) = 86b1aa8744a7f658c3c610a4950a444cd9369c0b1434655f2235664f18a2c2ceeae91154b73dcffb8d75aa996dcd864a5c83c39075a79215c844daf7d4996b4c From 4cb1381d80a94c9a41ded1a022276e1f664b1755 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 6 Dec 2021 13:12:31 +0100 Subject: [PATCH 002/545] build fixes --- build-python.patch | 12 ++++++++++++ firefox-mozconfig | 1 + firefox.spec | 6 ++++-- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 build-python.patch diff --git a/build-python.patch b/build-python.patch new file mode 100644 index 0000000..eae8e18 --- /dev/null +++ b/build-python.patch @@ -0,0 +1,12 @@ +diff -up firefox-95.0/build/mach_virtualenv_packages.txt.pytpatch firefox-95.0/build/mach_virtualenv_packages.txt +--- firefox-95.0/build/mach_virtualenv_packages.txt.pytpatch 2021-12-06 07:52:44.829038010 +0100 ++++ firefox-95.0/build/mach_virtualenv_packages.txt 2021-12-06 07:53:56.676269562 +0100 +@@ -1,7 +1,7 @@ + packages.txt:build/common_virtualenv_packages.txt + # glean-sdk may not be installable if a wheel isn't available + # and it has to be built from source. +-pypi-optional:glean-sdk==40.0.0:telemetry will not be collected ++pypi-optional:glean-sdk>=40.0.0,<=42.2.0:telemetry will not be collected + # Mach gracefully handles the case where `psutil` is unavailable. + # We aren't (yet) able to pin packages in automation, so we have to + # support down to the oldest locally-installed version (5.4.2). diff --git a/firefox-mozconfig b/firefox-mozconfig index 103bf15..90dfccf 100644 --- a/firefox-mozconfig +++ b/firefox-mozconfig @@ -16,6 +16,7 @@ ac_add_options --with-system-fdk-aac ac_add_options --enable-js-shell ac_add_options --with-unsigned-addon-scopes=app,system ac_add_options --without-sysroot +ac_add_options --without-wasm-sandboxed-libraries export BUILD_OFFICIAL=1 export MOZILLA_OFFICIAL=1 diff --git a/firefox.spec b/firefox.spec index 865699d..18d91b1 100644 --- a/firefox.spec +++ b/firefox.spec @@ -126,7 +126,7 @@ ExcludeArch: aarch64 %if %{?system_nss} %global nspr_version 4.26 %global nspr_build_version %{nspr_version} -%global nss_version 3.70 +%global nss_version 3.73 %global nss_build_version %{nss_version} %endif @@ -218,6 +218,7 @@ Patch54: mozilla-1669639.patch Patch55: firefox-testing.patch Patch57: firefox-disable-ffvpx-with-vapi.patch Patch61: firefox-glibc-dynstack.patch +Patch62: build-python.patch # Test patches # Generate without context by @@ -460,6 +461,7 @@ This package contains results of tests executed during build. #%patch55 -p1 -b .testing %patch57 -p1 -b .ffvpx-with-vapi #%patch61 -p1 -b .glibc-dynstack +%patch62 -p1 -b .build-python # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -482,7 +484,7 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 -%patch420 -p1 -b .mochitest-wayland-workaround +#%patch420 -p1 -b .mochitest-wayland-workaround # PGO patches %if %{build_with_pgo} From 68f9ad4d6ab0398f2b9b719fd23f219b6788faf0 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 9 Dec 2021 22:00:55 +0100 Subject: [PATCH 003/545] Updated symbolic icon (rhbz#2028939) --- firefox-symbolic.svg | 65 ++------------------------------------------ firefox.spec | 5 +++- 2 files changed, 6 insertions(+), 64 deletions(-) diff --git a/firefox-symbolic.svg b/firefox-symbolic.svg index 2078eea..8ecd135 100644 --- a/firefox-symbolic.svg +++ b/firefox-symbolic.svg @@ -1,64 +1,3 @@ - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - - Gnome Symbolic Icon Theme - + + diff --git a/firefox.spec b/firefox.spec index 18d91b1..ff296ff 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 95.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1054,6 +1054,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Thu Dec 9 2021 Martin Stransky - 95.0-2 +- Updated symbolic icon (rhbz#2028939) + * Fri Dec 3 2021 Martin Stransky - 95.0-1 - Updated to 95.0 From 4bdababddf1573b8669f418e4776aed4241702cb Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 20 Dec 2021 12:46:02 +0100 Subject: [PATCH 004/545] Updated to 95.0.2 / Enabled Wayland on KDE by default --- .gitignore | 2 ++ firefox.sh.in | 6 +++--- firefox.spec | 8 ++++++-- sources | 4 ++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 6138c83..4494daf 100644 --- a/.gitignore +++ b/.gitignore @@ -483,3 +483,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-94.0.2-20211125.tar.xz /firefox-95.0.source.tar.xz /firefox-langpacks-95.0-20211203.tar.xz +/firefox-95.0.2.source.tar.xz +/firefox-langpacks-95.0.2-20211220.tar.xz diff --git a/firefox.sh.in b/firefox.sh.in index fb7f463..76df06b 100644 --- a/firefox.sh.in +++ b/firefox.sh.in @@ -76,9 +76,9 @@ if ! [ $MOZ_DISABLE_WAYLAND ] && [ "$WAYLAND_DISPLAY" ]; then fi ## Enable Wayland on KDE/Sway ## -# if [ "$XDG_SESSION_TYPE" == "wayland" ]; then -# export MOZ_ENABLE_WAYLAND=1 -# fi + if [ "$XDG_SESSION_TYPE" == "wayland" ]; then + export MOZ_ENABLE_WAYLAND=1 + fi fi ## diff --git a/firefox.spec b/firefox.spec index ff296ff..7aa4281 100644 --- a/firefox.spec +++ b/firefox.spec @@ -162,13 +162,13 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox -Version: 95.0 +Version: 95.0.2 Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20211203.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20211220.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1054,6 +1054,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Thu Dec 20 2021 Martin Stransky - 95.0.2-1 +- Updated to 95.0.2 +- Enabled Wayland on KDE by default + * Thu Dec 9 2021 Martin Stransky - 95.0-2 - Updated symbolic icon (rhbz#2028939) diff --git a/sources b/sources index 4b2f60b..626c03c 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = b9ab1498be90ecf60822df7021f8812f124550d97f8cd687c69d3ab56fc5fb714bfe88c78c978a1794d211724909a9a5cad6a4b483fa05f762909c45d5075520 SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (firefox-95.0.source.tar.xz) = 350672a2cd99195c67dafc0e71c6eaf1e23e85a5fe92775697119a054f17c34a736035e23d7f2bb404b544f0f144efef3843cfc293596a6e61d1ea36efc3a724 -SHA512 (firefox-langpacks-95.0-20211203.tar.xz) = 86b1aa8744a7f658c3c610a4950a444cd9369c0b1434655f2235664f18a2c2ceeae91154b73dcffb8d75aa996dcd864a5c83c39075a79215c844daf7d4996b4c +SHA512 (firefox-95.0.2.source.tar.xz) = 1b9eb91d72a6975b4d2558a7c5de0e008095398b9862498623656ab6d8056e3cffc12263f58aa07feeddc91ccfb512aa4b582dfeadb142d548d96c3d50204196 +SHA512 (firefox-langpacks-95.0.2-20211220.tar.xz) = 28adb48311b7e3ab8acfd54dfa68a2f58344d7e73353ef71f8f02d608a23471e62c318accd4c0157478edd300c449af758ca93be0f8891160ba26f8888afdd9d From c70ece2f35b818e29348e27b209ccd7843592b7c Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 20 Dec 2021 12:57:28 +0100 Subject: [PATCH 005/545] changelog fix --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 7aa4281..64ffaa3 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1054,7 +1054,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog -* Thu Dec 20 2021 Martin Stransky - 95.0.2-1 +* Mon Dec 20 2021 Martin Stransky - 95.0.2-1 - Updated to 95.0.2 - Enabled Wayland on KDE by default From caf7474858049ea4371362ad3ef6ebdc76c73f62 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 22 Dec 2021 13:08:56 +0100 Subject: [PATCH 006/545] Added Fedora 36 build fix (mzbz#1745560) --- firefox.spec | 7 ++++++- mozilla-1745560.patch | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 mozilla-1745560.patch diff --git a/firefox.spec b/firefox.spec index 64ffaa3..42b28a7 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 95.0.2 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -219,6 +219,7 @@ Patch55: firefox-testing.patch Patch57: firefox-disable-ffvpx-with-vapi.patch Patch61: firefox-glibc-dynstack.patch Patch62: build-python.patch +Patch63: mozilla-1745560.patch # Test patches # Generate without context by @@ -462,6 +463,7 @@ This package contains results of tests executed during build. %patch57 -p1 -b .ffvpx-with-vapi #%patch61 -p1 -b .glibc-dynstack %patch62 -p1 -b .build-python +%patch63 -p1 -b .1745560 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -1054,6 +1056,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Wed Dec 22 2021 Martin Stransky - 95.0.2-3 +- Added Fedora 36 build fix (mzbz#1745560) + * Mon Dec 20 2021 Martin Stransky - 95.0.2-1 - Updated to 95.0.2 - Enabled Wayland on KDE by default diff --git a/mozilla-1745560.patch b/mozilla-1745560.patch new file mode 100644 index 0000000..891dfeb --- /dev/null +++ b/mozilla-1745560.patch @@ -0,0 +1,15 @@ +diff --git a/widget/gtk/mozwayland/mozwayland.c b/widget/gtk/mozwayland/mozwayland.c +--- a/widget/gtk/mozwayland/mozwayland.c ++++ b/widget/gtk/mozwayland/mozwayland.c +@@ -200,3 +200,10 @@ + + MOZ_EXPORT void wl_list_insert_list(struct wl_list* list, + struct wl_list* other) {} ++ ++MOZ_EXPORT struct wl_proxy* wl_proxy_marshal_flags( ++ struct wl_proxy* proxy, uint32_t opcode, ++ const struct wl_interface* interface, uint32_t version, uint32_t flags, ++ ...) { ++ return NULL; ++} + From 951280922dcb144f6ecf59d79f66ff4bbe88b421 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 23 Dec 2021 11:57:55 +0100 Subject: [PATCH 007/545] Added fix fox mozbz#1744896 (VSync) --- firefox.spec | 7 ++++++- mozilla-1744896.patch | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 mozilla-1744896.patch diff --git a/firefox.spec b/firefox.spec index 42b28a7..1646bbc 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 95.0.2 -Release: 3%{?pre_tag}%{?dist} +Release: 4%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -245,6 +245,7 @@ Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch Patch420: mochitest-wayland-workaround.patch +Patch421: mozilla-1744896.patch # PGO/LTO patches Patch600: pgo.patch @@ -487,6 +488,7 @@ This package contains results of tests executed during build. %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 #%patch420 -p1 -b .mochitest-wayland-workaround +%patch421 -p1 -b .1744896 # PGO patches %if %{build_with_pgo} @@ -1056,6 +1058,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Thu Dec 23 2021 Martin Stransky - 95.0.2-4 +- Added fix fox mozbz#1744896 (VSync) + * Wed Dec 22 2021 Martin Stransky - 95.0.2-3 - Added Fedora 36 build fix (mzbz#1745560) diff --git a/mozilla-1744896.patch b/mozilla-1744896.patch new file mode 100644 index 0000000..b3f343e --- /dev/null +++ b/mozilla-1744896.patch @@ -0,0 +1,42 @@ +diff -up firefox-95.0.2/widget/gtk/nsWindow.cpp.1744896 firefox-95.0.2/widget/gtk/nsWindow.cpp +--- firefox-95.0.2/widget/gtk/nsWindow.cpp.1744896 2021-12-23 11:54:31.522539340 +0100 ++++ firefox-95.0.2/widget/gtk/nsWindow.cpp 2021-12-23 11:55:56.070270174 +0100 +@@ -5765,6 +5765,17 @@ nsresult nsWindow::Create(nsIWidget* aPa + } + } + #endif ++#ifdef MOZ_WAYLAND ++ // Initialize the window specific VsyncSource early in order to avoid races ++ // with BrowserParent::UpdateVsyncParentVsyncSource(). ++ // Only use for toplevel windows for now, see bug 1619246. ++ if (GdkIsWaylandDisplay() && ++ StaticPrefs::widget_wayland_vsync_enabled_AtStartup() && ++ mWindowType == eWindowType_toplevel) { ++ mWaylandVsyncSource = new WaylandVsyncSource(); ++ MOZ_RELEASE_ASSERT(mWaylandVsyncSource); ++ } ++#endif + + // We create input contexts for all containers, except for + // toplevel popup windows +@@ -6077,19 +6088,12 @@ void nsWindow::ResumeCompositorFromCompo + + void nsWindow::WaylandStartVsync() { + #ifdef MOZ_WAYLAND +- // only use for toplevel windows for now - see bug 1619246 +- if (!GdkIsWaylandDisplay() || +- !StaticPrefs::widget_wayland_vsync_enabled_AtStartup() || +- mWindowType != eWindowType_toplevel) { ++ if (!mWaylandVsyncSource) { + return; + } + + LOG("nsWindow::WaylandStartVsync() [%p]\n", (void*)this); + +- if (!mWaylandVsyncSource) { +- mWaylandVsyncSource = new WaylandVsyncSource(); +- } +- + WaylandVsyncSource::WaylandDisplay& display = + static_cast( + mWaylandVsyncSource->GetGlobalDisplay()); From ad9300d2e70940b2f63e9a66ef293f343502776d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sat, 8 Jan 2022 20:32:30 +0100 Subject: [PATCH 008/545] Rebuilt for https://fedoraproject.org/wiki/Changes/LIBFFI34 --- firefox.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 1646bbc..c068073 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 95.0.2 -Release: 4%{?pre_tag}%{?dist} +Release: 5%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1058,6 +1058,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Sat Jan 08 2022 Miro Hrončok - 95.0.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Changes/LIBFFI34 + * Thu Dec 23 2021 Martin Stransky - 95.0.2-4 - Added fix fox mozbz#1744896 (VSync) From 9956bb1eafb6bf3ea0f56a3376530d423b1a1dd8 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 11 Jan 2022 19:47:58 +0100 Subject: [PATCH 009/545] Update to Firefox 96 --- .gitignore | 2 + D132929.diff | 18 +++ D133209.diff | 197 +++++++++++++++++++++++++++++ D133485.diff | 31 +++++ D133634.diff | 119 +++++++++++++++++ D133885.diff | 33 +++++ D134141.diff | 12 ++ firefox.spec | 30 +++-- mochitest-wayland-workaround.patch | 61 --------- mozilla-1744896.patch | 42 ------ mozilla-1745560.patch | 15 --- pgo.patch | 38 +++--- sources | 4 +- 13 files changed, 454 insertions(+), 148 deletions(-) create mode 100644 D132929.diff create mode 100644 D133209.diff create mode 100644 D133485.diff create mode 100644 D133634.diff create mode 100644 D133885.diff create mode 100644 D134141.diff delete mode 100644 mochitest-wayland-workaround.patch delete mode 100644 mozilla-1744896.patch delete mode 100644 mozilla-1745560.patch diff --git a/.gitignore b/.gitignore index 4494daf..afb0f27 100644 --- a/.gitignore +++ b/.gitignore @@ -485,3 +485,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-95.0-20211203.tar.xz /firefox-95.0.2.source.tar.xz /firefox-langpacks-95.0.2-20211220.tar.xz +/firefox-96.0.source.tar.xz +/firefox-langpacks-96.0-20220111.tar.xz diff --git a/D132929.diff b/D132929.diff new file mode 100644 index 0000000..0a61842 --- /dev/null +++ b/D132929.diff @@ -0,0 +1,18 @@ +diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp +--- a/widget/gtk/nsWindow.cpp ++++ b/widget/gtk/nsWindow.cpp +@@ -2946,7 +2946,12 @@ + uint32_t timestamp = GDK_CURRENT_TIME; + + nsGTKToolkit* GTKToolkit = nsGTKToolkit::GetToolkit(); +- if (GTKToolkit) timestamp = GTKToolkit->GetFocusTimestamp(); ++ if (GTKToolkit) { ++ timestamp = GTKToolkit->GetFocusTimestamp(); ++ } ++ if (!timestamp) { ++ timestamp = GetLastUserInputTime(); ++ } + + LOG(" requesting toplevel activation [%p]\n", (void*)toplevelWindow); + gtk_window_present_with_time(GTK_WINDOW(toplevelWindow->mShell), + diff --git a/D133209.diff b/D133209.diff new file mode 100644 index 0000000..81908f9 --- /dev/null +++ b/D133209.diff @@ -0,0 +1,197 @@ +diff --git a/widget/gtk/nsGtkKeyUtils.h b/widget/gtk/nsGtkKeyUtils.h +--- a/widget/gtk/nsGtkKeyUtils.h ++++ b/widget/gtk/nsGtkKeyUtils.h +@@ -202,6 +202,22 @@ + * from xkb_keymap. We call that from Wayland backend routines. + */ + static void SetModifierMasks(xkb_keymap* aKeymap); ++ ++ /** ++ * Wayland global focus handlers ++ */ ++ static void SetFocusIn(wl_surface* aFocusSurface, uint32_t aFocusSerial); ++ static void SetFocusOut(wl_surface* aFocusSurface); ++ static void GetFocusInfo(wl_surface** aFocusSurface, uint32_t* aFocusSerial); ++ ++ static void SetSeat(wl_seat* aSeat); ++ static wl_seat* GetSeat(); ++ ++ /** ++ * EnsureInstance() is provided on Wayland to register Wayland callbacks ++ * early. ++ */ ++ static void EnsureInstance(); + #endif + + /** +@@ -467,6 +483,12 @@ + void SetModifierMask(xkb_keymap* aKeymap, ModifierIndex aModifierIndex, + const char* aModifierName); + #endif ++ ++#ifdef MOZ_WAYLAND ++ wl_seat* mSeat = nullptr; ++ wl_surface* mFocusSurface = nullptr; ++ uint32_t mFocusSerial = 0; ++#endif + }; + + } // namespace widget +diff --git a/widget/gtk/nsGtkKeyUtils.cpp b/widget/gtk/nsGtkKeyUtils.cpp +--- a/widget/gtk/nsGtkKeyUtils.cpp ++++ b/widget/gtk/nsGtkKeyUtils.cpp +@@ -331,6 +331,10 @@ + return sInstance; + } + ++#ifdef MOZ_WAYLAND ++void KeymapWrapper::EnsureInstance() { (void)GetInstance(); } ++#endif ++ + /* static */ + void KeymapWrapper::Shutdown() { + if (sInstance) { +@@ -720,10 +724,15 @@ + + static void keyboard_handle_enter(void* data, struct wl_keyboard* keyboard, + uint32_t serial, struct wl_surface* surface, +- struct wl_array* keys) {} ++ struct wl_array* keys) { ++ KeymapWrapper::SetFocusIn(surface, serial); ++} ++ + static void keyboard_handle_leave(void* data, struct wl_keyboard* keyboard, + uint32_t serial, struct wl_surface* surface) { ++ KeymapWrapper::SetFocusOut(surface); + } ++ + static void keyboard_handle_key(void* data, struct wl_keyboard* keyboard, + uint32_t serial, uint32_t time, uint32_t key, + uint32_t state) {} +@@ -760,6 +769,7 @@ + if (strcmp(interface, "wl_seat") == 0) { + auto* seat = + WaylandRegistryBind(registry, id, &wl_seat_interface, 1); ++ KeymapWrapper::SetSeat(seat); + wl_seat_add_listener(seat, &seat_listener, data); + } + } +@@ -2411,5 +2421,40 @@ + altLatinCharCodes.mShiftedCharCode)); + } + ++#ifdef MOZ_WAYLAND ++void KeymapWrapper::SetFocusIn(wl_surface* aFocusSurface, ++ uint32_t aFocusSerial) { ++ KeymapWrapper* keymapWrapper = KeymapWrapper::GetInstance(); ++ keymapWrapper->mFocusSurface = aFocusSurface; ++ keymapWrapper->mFocusSerial = aFocusSerial; ++} ++ ++void KeymapWrapper::SetFocusOut(wl_surface* aFocusSurface) { ++ KeymapWrapper* keymapWrapper = KeymapWrapper::GetInstance(); ++ if (aFocusSurface == keymapWrapper->mFocusSurface) { ++ keymapWrapper->mFocusSurface = nullptr; ++ keymapWrapper->mFocusSerial = 0; ++ } ++} ++ ++void KeymapWrapper::GetFocusInfo(wl_surface** aFocusSurface, ++ uint32_t* aFocusSerial) { ++ KeymapWrapper* keymapWrapper = KeymapWrapper::GetInstance(); ++ *aFocusSurface = keymapWrapper->mFocusSurface; ++ *aFocusSerial = keymapWrapper->mFocusSerial; ++} ++ ++void KeymapWrapper::SetSeat(wl_seat* aSeat) { ++ KeymapWrapper* keymapWrapper = KeymapWrapper::GetInstance(); ++ keymapWrapper->mSeat = aSeat; ++} ++ ++wl_seat* KeymapWrapper::GetSeat() { ++ KeymapWrapper* keymapWrapper = KeymapWrapper::GetInstance(); ++ return keymapWrapper->mSeat; ++} ++ ++#endif ++ + } // namespace widget + } // namespace mozilla +diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp +--- a/widget/gtk/nsWindow.cpp ++++ b/widget/gtk/nsWindow.cpp +@@ -2862,8 +2862,7 @@ + }; + + void nsWindow::RequestFocusWaylandWindow(RefPtr aWindow) { +- LOG("nsWindow::RequestWindowFocusWayland(%p) gFocusWindow [%p]", +- (void*)aWindow, gFocusWindow); ++ LOG("nsWindow::RequestWindowFocusWayland(%p)", (void*)aWindow); + + RefPtr display = WaylandDisplayGet(); + xdg_activation_v1* xdg_activation = display->GetXdgActivation(); +@@ -2872,17 +2871,11 @@ + return; + } + +- // We use xdg-activation protocol to transfer focus from gFocusWindow to +- // aWindow. Quit if no window is focused. +- if (gFocusWindow != this) { +- LOG(" there isn't any focused window to transfer focus from, quit."); +- return; +- } +- +- wl_surface* surface = +- mGdkWindow ? gdk_wayland_window_get_wl_surface(mGdkWindow) : nullptr; +- if (!surface) { +- LOG(" requesting window is hidden/unmapped, quit."); ++ wl_surface* focusSurface; ++ uint32_t focusSerial; ++ KeymapWrapper::GetFocusInfo(&focusSurface, &focusSerial); ++ if (!focusSurface) { ++ LOG(" We're missing focused window, quit."); + return; + } + +@@ -2894,9 +2887,9 @@ + // callback. + xdg_activation_token_v1_add_listener(aWindow->mXdgToken, &token_listener, + do_AddRef(aWindow).take()); +- xdg_activation_token_v1_set_serial(aWindow->mXdgToken, GetLastUserInputTime(), +- display->GetSeat()); +- xdg_activation_token_v1_set_surface(aWindow->mXdgToken, surface); ++ xdg_activation_token_v1_set_serial(aWindow->mXdgToken, focusSerial, ++ KeymapWrapper::GetSeat()); ++ xdg_activation_token_v1_set_surface(aWindow->mXdgToken, focusSurface); + xdg_activation_token_v1_commit(aWindow->mXdgToken); + } + #endif +@@ -2959,11 +2952,7 @@ + + #ifdef MOZ_WAYLAND + if (GdkIsWaylandDisplay()) { +- if (gFocusWindow) { +- gFocusWindow->RequestFocusWaylandWindow(toplevelWindow); +- } else { +- LOG(" RequestFocusWaylandWindow(): we're missing focused window!"); +- } ++ RequestFocusWaylandWindow(toplevelWindow); + } + #endif + if (GTKToolkit) GTKToolkit->SetFocusTimestamp(0); +@@ -5359,6 +5348,14 @@ + a11y::PreInit(); + #endif + ++#ifdef MOZ_WAYLAND ++ // Ensure that KeymapWrapper is created on Wayland as we need it for ++ // keyboard focus tracking. ++ if (GdkIsWaylandDisplay()) { ++ KeymapWrapper::EnsureInstance(); ++ } ++#endif ++ + // Ensure that the toolkit is created. + nsGTKToolkit::GetToolkit(); + + diff --git a/D133485.diff b/D133485.diff new file mode 100644 index 0000000..6785c55 --- /dev/null +++ b/D133485.diff @@ -0,0 +1,31 @@ +diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp +--- a/widget/gtk/nsWindow.cpp ++++ b/widget/gtk/nsWindow.cpp +@@ -2879,6 +2879,10 @@ + return; + } + ++ LOG(" requesting xdg-activation token, surface ID %d serial %d seat ID %d", ++ wl_proxy_get_id((struct wl_proxy*)focusSurface), focusSerial, ++ wl_proxy_get_id((struct wl_proxy*)KeymapWrapper::GetSeat())); ++ + // Store activation token at activated window for further release. + g_clear_pointer(&aWindow->mXdgToken, xdg_activation_token_v1_destroy); + aWindow->mXdgToken = xdg_activation_v1_get_activation_token(xdg_activation); +@@ -2941,6 +2945,7 @@ + nsGTKToolkit* GTKToolkit = nsGTKToolkit::GetToolkit(); + if (GTKToolkit) { + timestamp = GTKToolkit->GetFocusTimestamp(); ++ GTKToolkit->SetFocusTimestamp(0); + } + if (!timestamp) { + timestamp = GetLastUserInputTime(); +@@ -2955,7 +2960,6 @@ + RequestFocusWaylandWindow(toplevelWindow); + } + #endif +- if (GTKToolkit) GTKToolkit->SetFocusTimestamp(0); + } + return; + } + diff --git a/D133634.diff b/D133634.diff new file mode 100644 index 0000000..3c9d642 --- /dev/null +++ b/D133634.diff @@ -0,0 +1,119 @@ +diff --git a/widget/gtk/nsGtkKeyUtils.cpp b/widget/gtk/nsGtkKeyUtils.cpp +--- a/widget/gtk/nsGtkKeyUtils.cpp ++++ b/widget/gtk/nsGtkKeyUtils.cpp +@@ -2424,17 +2424,23 @@ + #ifdef MOZ_WAYLAND + void KeymapWrapper::SetFocusIn(wl_surface* aFocusSurface, + uint32_t aFocusSerial) { ++ LOGW("KeymapWrapper::SetFocusIn() surface %p ID %d serial %d", aFocusSurface, ++ aFocusSurface ? wl_proxy_get_id((struct wl_proxy*)aFocusSurface) : 0, ++ aFocusSerial); ++ + KeymapWrapper* keymapWrapper = KeymapWrapper::GetInstance(); + keymapWrapper->mFocusSurface = aFocusSurface; + keymapWrapper->mFocusSerial = aFocusSerial; + } + ++// aFocusSurface can be null in case that focused surface is already destroyed. + void KeymapWrapper::SetFocusOut(wl_surface* aFocusSurface) { + KeymapWrapper* keymapWrapper = KeymapWrapper::GetInstance(); +- if (aFocusSurface == keymapWrapper->mFocusSurface) { +- keymapWrapper->mFocusSurface = nullptr; +- keymapWrapper->mFocusSerial = 0; +- } ++ LOGW("KeymapWrapper::SetFocusOut surface %p ID %d", aFocusSurface, ++ aFocusSurface ? wl_proxy_get_id((struct wl_proxy*)aFocusSurface) : 0); ++ ++ keymapWrapper->mFocusSurface = nullptr; ++ keymapWrapper->mFocusSerial = 0; + } + + void KeymapWrapper::GetFocusInfo(wl_surface** aFocusSurface, +@@ -2453,7 +2459,6 @@ + KeymapWrapper* keymapWrapper = KeymapWrapper::GetInstance(); + return keymapWrapper->mSeat; + } +- + #endif + + } // namespace widget +diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h +--- a/widget/gtk/nsWindow.h ++++ b/widget/gtk/nsWindow.h +@@ -386,8 +386,7 @@ + + #ifdef MOZ_WAYLAND + // Use xdg-activation protocol to transfer focus from gFocusWindow to aWindow. +- // RequestFocusWaylandWindow needs to be called on focused window only. +- void RequestFocusWaylandWindow(RefPtr aWindow); ++ static void RequestFocusWaylandWindow(RefPtr aWindow); + void FocusWaylandWindow(const char* aTokenID); + + bool GetCSDDecorationOffset(int* aDx, int* aDy); +diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp +--- a/widget/gtk/nsWindow.cpp ++++ b/widget/gtk/nsWindow.cpp +@@ -2845,6 +2845,9 @@ + return; + } + ++ LOG(" requesting xdg-activation, surface ID %d", ++ wl_proxy_get_id((struct wl_proxy*)surface)); ++ + xdg_activation_v1* xdg_activation = WaylandDisplayGet()->GetXdgActivation(); + xdg_activation_v1_activate(xdg_activation, aTokenID, surface); + } +@@ -2862,12 +2865,17 @@ + }; + + void nsWindow::RequestFocusWaylandWindow(RefPtr aWindow) { +- LOG("nsWindow::RequestWindowFocusWayland(%p)", (void*)aWindow); ++ LOGW("nsWindow::RequestFocusWaylandWindow(%p) gFocusWindow %p", ++ (void*)aWindow, gFocusWindow); ++ ++ if (!gFocusWindow) { ++ LOGW(" missing gFocusWindow, quit."); ++ } + + RefPtr display = WaylandDisplayGet(); + xdg_activation_v1* xdg_activation = display->GetXdgActivation(); + if (!xdg_activation) { +- LOG(" xdg-activation is missing, quit."); ++ LOGW(" xdg-activation is missing, quit."); + return; + } + +@@ -2875,13 +2883,25 @@ + uint32_t focusSerial; + KeymapWrapper::GetFocusInfo(&focusSurface, &focusSerial); + if (!focusSurface) { +- LOG(" We're missing focused window, quit."); +- return; +- } +- +- LOG(" requesting xdg-activation token, surface ID %d serial %d seat ID %d", +- wl_proxy_get_id((struct wl_proxy*)focusSurface), focusSerial, +- wl_proxy_get_id((struct wl_proxy*)KeymapWrapper::GetSeat())); ++ LOGW(" We're missing focused window, quit."); ++ return; ++ } ++ ++ GdkWindow* gdkWindow = gtk_widget_get_window(gFocusWindow->mShell); ++ wl_surface* surface = ++ gdkWindow ? gdk_wayland_window_get_wl_surface(gdkWindow) : nullptr; ++ if (focusSurface != surface) { ++ LOGW(" focused surface %p and gFocusWindow surface %p don't match, quit.", ++ focusSurface, surface); ++ return; ++ } ++ ++ LOGW( ++ " requesting xdg-activation token, surface %p ID %d serial %d seat ID " ++ "%d", ++ focusSurface, ++ focusSurface ? wl_proxy_get_id((struct wl_proxy*)focusSurface) : 0, ++ focusSerial, wl_proxy_get_id((struct wl_proxy*)KeymapWrapper::GetSeat())); + + // Store activation token at activated window for further release. + g_clear_pointer(&aWindow->mXdgToken, xdg_activation_token_v1_destroy); + diff --git a/D133885.diff b/D133885.diff new file mode 100644 index 0000000..246fc2a --- /dev/null +++ b/D133885.diff @@ -0,0 +1,33 @@ +diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp +--- a/widget/gtk/nsWindow.cpp ++++ b/widget/gtk/nsWindow.cpp +@@ -2868,7 +2868,7 @@ + LOGW("nsWindow::RequestFocusWaylandWindow(%p) gFocusWindow %p", + (void*)aWindow, gFocusWindow); + +- if (!gFocusWindow) { ++ if (!gFocusWindow || gFocusWindow->IsDestroyed()) { + LOGW(" missing gFocusWindow, quit."); + } + +@@ -2883,13 +2883,16 @@ + uint32_t focusSerial; + KeymapWrapper::GetFocusInfo(&focusSurface, &focusSerial); + if (!focusSurface) { +- LOGW(" We're missing focused window, quit."); ++ LOGW(" We're missing KeymapWrapper focused window, quit."); + return; + } + + GdkWindow* gdkWindow = gtk_widget_get_window(gFocusWindow->mShell); +- wl_surface* surface = +- gdkWindow ? gdk_wayland_window_get_wl_surface(gdkWindow) : nullptr; ++ if (!gdkWindow) { ++ LOGW(" gFocusWindow is not mapped, quit."); ++ return; ++ } ++ wl_surface* surface = gdk_wayland_window_get_wl_surface(gdkWindow); + if (focusSurface != surface) { + LOGW(" focused surface %p and gFocusWindow surface %p don't match, quit.", + focusSurface, surface); + diff --git a/D134141.diff b/D134141.diff new file mode 100644 index 0000000..ef0b9fb --- /dev/null +++ b/D134141.diff @@ -0,0 +1,12 @@ +diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp +--- a/widget/gtk/nsWindow.cpp ++++ b/widget/gtk/nsWindow.cpp +@@ -2870,6 +2870,7 @@ + + if (!gFocusWindow || gFocusWindow->IsDestroyed()) { + LOGW(" missing gFocusWindow, quit."); ++ return; + } + + RefPtr display = WaylandDisplayGet(); + diff --git a/firefox.spec b/firefox.spec index 1646bbc..947286b 100644 --- a/firefox.spec +++ b/firefox.spec @@ -162,13 +162,13 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox -Version: 95.0.2 -Release: 4%{?pre_tag}%{?dist} +Version: 96.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20211220.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220111.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -219,7 +219,6 @@ Patch55: firefox-testing.patch Patch57: firefox-disable-ffvpx-with-vapi.patch Patch61: firefox-glibc-dynstack.patch Patch62: build-python.patch -Patch63: mozilla-1745560.patch # Test patches # Generate without context by @@ -244,8 +243,13 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch -Patch420: mochitest-wayland-workaround.patch -Patch421: mozilla-1744896.patch +# xdg-activation backports from 97.0 +Patch421: D132929.diff +Patch422: D133209.diff +Patch423: D133485.diff +Patch424: D133634.diff +Patch425: D133885.diff +Patch426: D134141.diff # PGO/LTO patches Patch600: pgo.patch @@ -464,7 +468,6 @@ This package contains results of tests executed during build. %patch57 -p1 -b .ffvpx-with-vapi #%patch61 -p1 -b .glibc-dynstack %patch62 -p1 -b .build-python -%patch63 -p1 -b .1745560 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -487,8 +490,14 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 -#%patch420 -p1 -b .mochitest-wayland-workaround -%patch421 -p1 -b .1744896 + +# xdg-activation backports from 97.0 +%patch421 -p1 -b .D132929 +%patch422 -p1 -b .D133209 +%patch423 -p1 -b .D133485 +%patch424 -p1 -b .D133634 +%patch425 -p1 -b .D133885 +%patch426 -p1 -b .D134141 # PGO patches %if %{build_with_pgo} @@ -1058,6 +1067,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue Jan 11 2022 Martin Stransky - 96.0-1 +- Updated to 96.0 + * Thu Dec 23 2021 Martin Stransky - 95.0.2-4 - Added fix fox mozbz#1744896 (VSync) diff --git a/mochitest-wayland-workaround.patch b/mochitest-wayland-workaround.patch deleted file mode 100644 index 7a69061..0000000 --- a/mochitest-wayland-workaround.patch +++ /dev/null @@ -1,61 +0,0 @@ -diff -up firefox-89.0/dom/base/test/browser_multiple_popups.js.mochitest-wayland-workaround firefox-89.0/dom/base/test/browser_multiple_popups.js ---- firefox-89.0/dom/base/test/browser_multiple_popups.js.mochitest-wayland-workaround 2021-05-27 22:29:44.000000000 +0200 -+++ firefox-89.0/dom/base/test/browser_multiple_popups.js 2021-06-01 10:02:59.648432325 +0200 -@@ -265,6 +265,7 @@ add_task(async _ => { - info("All opened from chrome."); - await withTestPage(2, { chrome: true }, async function(browser) { - await BrowserTestUtils.synthesizeMouseAtCenter("#openPopups", {}, browser); -+ await BrowserTestUtils.synthesizeMouseAtCenter("#openPopups", {}, browser); - }); - }); - -diff -up firefox-89.0/dom/ipc/BrowserChild.cpp.mochitest-wayland-workaround firefox-89.0/dom/ipc/BrowserChild.cpp ---- firefox-89.0/dom/ipc/BrowserChild.cpp.mochitest-wayland-workaround 2021-05-27 22:29:44.000000000 +0200 -+++ firefox-89.0/dom/ipc/BrowserChild.cpp 2021-06-01 10:02:59.649432346 +0200 -@@ -457,7 +457,7 @@ nsresult BrowserChild::Init(mozIDOMWindo - } - mPuppetWidget->InfallibleCreate(nullptr, - nullptr, // no parents -- LayoutDeviceIntRect(0, 0, 0, 0), -+ LayoutDeviceIntRect(0, 0, 1000, 1000), - nullptr); // HandleWidgetEvent - - mWebBrowser = nsWebBrowser::Create(this, mPuppetWidget, mBrowsingContext, -diff -up firefox-89.0/toolkit/components/browser/nsWebBrowser.cpp.mochitest-wayland-workaround firefox-89.0/toolkit/components/browser/nsWebBrowser.cpp ---- firefox-89.0/toolkit/components/browser/nsWebBrowser.cpp.mochitest-wayland-workaround 2021-05-27 22:29:54.000000000 +0200 -+++ firefox-89.0/toolkit/components/browser/nsWebBrowser.cpp 2021-06-01 10:02:59.649432346 +0200 -@@ -150,7 +150,8 @@ already_AddRefed nsWebBrow - // handler that always gets called (even for subframes) for any bubbling - // event. - -- nsresult rv = docShell->InitWindow(nullptr, docShellParentWidget, 0, 0, 0, 0); -+ nsresult rv = -+ docShell->InitWindow(nullptr, docShellParentWidget, 0, 0, 1000, 1000); - if (NS_WARN_IF(NS_FAILED(rv))) { - return nullptr; - } -diff -up firefox-89.0/widget/gtk/nsWindow.cpp.mochitest-wayland-workaround firefox-89.0/widget/gtk/nsWindow.cpp ---- firefox-89.0/widget/gtk/nsWindow.cpp.mochitest-wayland-workaround 2021-06-01 10:02:59.644432243 +0200 -+++ firefox-89.0/widget/gtk/nsWindow.cpp 2021-06-01 10:04:28.715262874 +0200 -@@ -7962,6 +7973,8 @@ nsresult nsWindow::SynthesizeNativeMouse - nsIObserver* aObserver) { - AutoObserverNotifier notifier(aObserver, "mouseevent"); - -+ LOG(("nsWindow::SynthesizeNativeMouseEvent [%p]\n", (void*)this)); -+ - if (!mGdkWindow) { - return NS_OK; - } -@@ -7976,6 +7989,12 @@ nsresult nsWindow::SynthesizeNativeMouse - switch (aNativeMessage) { - case NativeMouseMessage::ButtonDown: - case NativeMouseMessage::ButtonUp: { -+ if (aNativeMessage == NativeMouseMessage::ButtonDown) { -+ LOG((" NativeMouseMessage::ButtonDown()\n")); -+ } else { -+ LOG((" NativeMouseMessage::ButtonUp()\n")); -+ } -+ - GdkEvent event; - memset(&event, 0, sizeof(GdkEvent)); - event.type = aNativeMessage == NativeMouseMessage::ButtonDown diff --git a/mozilla-1744896.patch b/mozilla-1744896.patch deleted file mode 100644 index b3f343e..0000000 --- a/mozilla-1744896.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff -up firefox-95.0.2/widget/gtk/nsWindow.cpp.1744896 firefox-95.0.2/widget/gtk/nsWindow.cpp ---- firefox-95.0.2/widget/gtk/nsWindow.cpp.1744896 2021-12-23 11:54:31.522539340 +0100 -+++ firefox-95.0.2/widget/gtk/nsWindow.cpp 2021-12-23 11:55:56.070270174 +0100 -@@ -5765,6 +5765,17 @@ nsresult nsWindow::Create(nsIWidget* aPa - } - } - #endif -+#ifdef MOZ_WAYLAND -+ // Initialize the window specific VsyncSource early in order to avoid races -+ // with BrowserParent::UpdateVsyncParentVsyncSource(). -+ // Only use for toplevel windows for now, see bug 1619246. -+ if (GdkIsWaylandDisplay() && -+ StaticPrefs::widget_wayland_vsync_enabled_AtStartup() && -+ mWindowType == eWindowType_toplevel) { -+ mWaylandVsyncSource = new WaylandVsyncSource(); -+ MOZ_RELEASE_ASSERT(mWaylandVsyncSource); -+ } -+#endif - - // We create input contexts for all containers, except for - // toplevel popup windows -@@ -6077,19 +6088,12 @@ void nsWindow::ResumeCompositorFromCompo - - void nsWindow::WaylandStartVsync() { - #ifdef MOZ_WAYLAND -- // only use for toplevel windows for now - see bug 1619246 -- if (!GdkIsWaylandDisplay() || -- !StaticPrefs::widget_wayland_vsync_enabled_AtStartup() || -- mWindowType != eWindowType_toplevel) { -+ if (!mWaylandVsyncSource) { - return; - } - - LOG("nsWindow::WaylandStartVsync() [%p]\n", (void*)this); - -- if (!mWaylandVsyncSource) { -- mWaylandVsyncSource = new WaylandVsyncSource(); -- } -- - WaylandVsyncSource::WaylandDisplay& display = - static_cast( - mWaylandVsyncSource->GetGlobalDisplay()); diff --git a/mozilla-1745560.patch b/mozilla-1745560.patch deleted file mode 100644 index 891dfeb..0000000 --- a/mozilla-1745560.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/widget/gtk/mozwayland/mozwayland.c b/widget/gtk/mozwayland/mozwayland.c ---- a/widget/gtk/mozwayland/mozwayland.c -+++ b/widget/gtk/mozwayland/mozwayland.c -@@ -200,3 +200,10 @@ - - MOZ_EXPORT void wl_list_insert_list(struct wl_list* list, - struct wl_list* other) {} -+ -+MOZ_EXPORT struct wl_proxy* wl_proxy_marshal_flags( -+ struct wl_proxy* proxy, uint32_t opcode, -+ const struct wl_interface* interface, uint32_t version, uint32_t flags, -+ ...) { -+ return NULL; -+} - diff --git a/pgo.patch b/pgo.patch index bd92d1f..e7e715b 100644 --- a/pgo.patch +++ b/pgo.patch @@ -1,6 +1,6 @@ -diff -up firefox-95.0/build/moz.configure/lto-pgo.configure.pgo firefox-95.0/build/moz.configure/lto-pgo.configure ---- firefox-95.0/build/moz.configure/lto-pgo.configure.pgo 2021-12-03 16:04:48.441167077 +0100 -+++ firefox-95.0/build/moz.configure/lto-pgo.configure 2021-12-03 16:06:19.129415806 +0100 +diff -up firefox-96.0/build/moz.configure/lto-pgo.configure.pgo firefox-96.0/build/moz.configure/lto-pgo.configure +--- firefox-96.0/build/moz.configure/lto-pgo.configure.pgo 2022-01-06 19:32:35.000000000 +0100 ++++ firefox-96.0/build/moz.configure/lto-pgo.configure 2022-01-11 15:43:02.193378698 +0100 @@ -248,8 +248,8 @@ def lto( cflags.append("-flto") ldflags.append("-flto") @@ -21,9 +21,9 @@ diff -up firefox-95.0/build/moz.configure/lto-pgo.configure.pgo firefox-95.0/bui # With clang-cl, -flto can only be used with -c or -fuse-ld=lld. # AC_TRY_LINKs during configure don't have -c, so pass -fuse-ld=lld. cflags.append("-fuse-ld=lld") -diff -up firefox-95.0/build/pgo/profileserver.py.pgo firefox-95.0/build/pgo/profileserver.py ---- firefox-95.0/build/pgo/profileserver.py.pgo 2021-11-29 15:01:10.000000000 +0100 -+++ firefox-95.0/build/pgo/profileserver.py 2021-12-03 16:04:48.441167077 +0100 +diff -up firefox-96.0/build/pgo/profileserver.py.pgo firefox-96.0/build/pgo/profileserver.py +--- firefox-96.0/build/pgo/profileserver.py.pgo 2022-01-06 16:56:23.000000000 +0100 ++++ firefox-96.0/build/pgo/profileserver.py 2022-01-11 15:43:02.193378698 +0100 @@ -11,7 +11,7 @@ import glob import subprocess @@ -70,9 +70,9 @@ diff -up firefox-95.0/build/pgo/profileserver.py.pgo firefox-95.0/build/pgo/prof llvm_profdata = env.get("LLVM_PROFDATA") if llvm_profdata: profraw_files = glob.glob("*.profraw") -diff -up firefox-95.0/build/unix/mozconfig.unix.pgo firefox-95.0/build/unix/mozconfig.unix ---- firefox-95.0/build/unix/mozconfig.unix.pgo 2021-11-29 15:01:10.000000000 +0100 -+++ firefox-95.0/build/unix/mozconfig.unix 2021-12-03 16:04:48.441167077 +0100 +diff -up firefox-96.0/build/unix/mozconfig.unix.pgo firefox-96.0/build/unix/mozconfig.unix +--- firefox-96.0/build/unix/mozconfig.unix.pgo 2022-01-06 16:56:24.000000000 +0100 ++++ firefox-96.0/build/unix/mozconfig.unix 2022-01-11 15:43:02.193378698 +0100 @@ -4,6 +4,15 @@ if [ -n "$FORCE_GCC" ]; then CC="$MOZ_FETCHES_DIR/gcc/bin/gcc" CXX="$MOZ_FETCHES_DIR/gcc/bin/g++" @@ -89,18 +89,18 @@ diff -up firefox-95.0/build/unix/mozconfig.unix.pgo firefox-95.0/build/unix/mozc # We want to make sure we use binutils and other binaries in the tooltool # package. mk_add_options "export PATH=$MOZ_FETCHES_DIR/gcc/bin:$PATH" -diff -up firefox-95.0/extensions/spellcheck/src/moz.build.pgo firefox-95.0/extensions/spellcheck/src/moz.build ---- firefox-95.0/extensions/spellcheck/src/moz.build.pgo 2021-11-29 15:01:12.000000000 +0100 -+++ firefox-95.0/extensions/spellcheck/src/moz.build 2021-12-03 16:04:48.441167077 +0100 -@@ -31,3 +31,5 @@ EXPORTS.mozilla += [ - - if CONFIG["CC_TYPE"] in ("clang", "gcc"): - CXXFLAGS += ["-Wno-error=shadow"] +diff -up firefox-96.0/extensions/spellcheck/src/moz.build.pgo firefox-96.0/extensions/spellcheck/src/moz.build +--- firefox-96.0/extensions/spellcheck/src/moz.build.pgo 2022-01-11 15:43:02.193378698 +0100 ++++ firefox-96.0/extensions/spellcheck/src/moz.build 2022-01-11 15:49:52.929362701 +0100 +@@ -28,3 +28,5 @@ EXPORTS.mozilla += [ + "mozInlineSpellChecker.h", + "mozSpellChecker.h", + ] + +CXXFLAGS += ['-fno-devirtualize'] -diff -up firefox-95.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-95.0/toolkit/components/terminator/nsTerminator.cpp ---- firefox-95.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2021-11-29 15:01:30.000000000 +0100 -+++ firefox-95.0/toolkit/components/terminator/nsTerminator.cpp 2021-12-03 16:04:48.442167068 +0100 +diff -up firefox-96.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-96.0/toolkit/components/terminator/nsTerminator.cpp +--- firefox-96.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2022-01-06 16:58:15.000000000 +0100 ++++ firefox-96.0/toolkit/components/terminator/nsTerminator.cpp 2022-01-11 15:43:02.193378698 +0100 @@ -466,6 +466,11 @@ void nsTerminator::StartWatchdog() { } #endif diff --git a/sources b/sources index 626c03c..65620be 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = b9ab1498be90ecf60822df7021f8812f124550d97f8cd687c69d3ab56fc5fb714bfe88c78c978a1794d211724909a9a5cad6a4b483fa05f762909c45d5075520 SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (firefox-95.0.2.source.tar.xz) = 1b9eb91d72a6975b4d2558a7c5de0e008095398b9862498623656ab6d8056e3cffc12263f58aa07feeddc91ccfb512aa4b582dfeadb142d548d96c3d50204196 -SHA512 (firefox-langpacks-95.0.2-20211220.tar.xz) = 28adb48311b7e3ab8acfd54dfa68a2f58344d7e73353ef71f8f02d608a23471e62c318accd4c0157478edd300c449af758ca93be0f8891160ba26f8888afdd9d +SHA512 (firefox-96.0.source.tar.xz) = 39f553474537eb4e521f4182e38f0ddff039fa6b40b939d461937d2cef27f7182097b478f08f90d64fdcbe9c063e78f14f6863a8a82a16207ec7a1d3fdfda4ff +SHA512 (firefox-langpacks-96.0-20220111.tar.xz) = 116e80badb7ba9077138371789fe017350f5ab0473a6130a356d05fb7205eedefc77076d56ee9f4feb7db3cf84456b8b182936185ef77723115ea9559f044f33 From b3b37bff8a95d360965f7cdaf8e1864b3a649bea Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 18 Jan 2022 14:02:21 +0100 Subject: [PATCH 010/545] Update to 96.0.1 --- .gitignore | 2 + build-python-glean.patch | 1763 ++++++++++++++++++++++++++++++++++++++ firefox-testing.patch | 38 +- firefox.spec | 31 +- sources | 4 +- 5 files changed, 1798 insertions(+), 40 deletions(-) create mode 100644 build-python-glean.patch diff --git a/.gitignore b/.gitignore index afb0f27..ee9699d 100644 --- a/.gitignore +++ b/.gitignore @@ -487,3 +487,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-95.0.2-20211220.tar.xz /firefox-96.0.source.tar.xz /firefox-langpacks-96.0-20220111.tar.xz +/firefox-langpacks-96.0.1-20220118.tar.xz +/firefox-96.0.1.source.tar.xz diff --git a/build-python-glean.patch b/build-python-glean.patch new file mode 100644 index 0000000..1da2987 --- /dev/null +++ b/build-python-glean.patch @@ -0,0 +1,1763 @@ +diff --git a/Cargo.lock b/Cargo.lock +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -1994,9 +1994,9 @@ + + [[package]] + name = "glean" +-version = "42.1.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "af977f3ee276d391cbf940639a5b95378c2b0031d5624c019142d286be4a1a21" ++version = "42.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "34d40d192d10509d941937248fe4594d47617abf34496686c809cfdb31ae8506" + dependencies = [ + "chrono", + "crossbeam-channel", +@@ -2014,9 +2014,9 @@ + + [[package]] + name = "glean-core" +-version = "42.1.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "f50f24e5e7c2abef542a9cb67f7367538db56f54fcae0fae8d3a1e0ac63470a3" ++version = "42.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "349ebbb162d58911547b48e5fbf90d45854e3e1ba03332f41b80a6611867c013" + dependencies = [ + "bincode", + "chrono", +@@ -2034,9 +2034,9 @@ + + [[package]] + name = "glean-ffi" +-version = "42.1.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "26738a3a19d212595c76a765b3e29fc9a0e1c5e7d15a8352ac94ec8536b65cd5" ++version = "42.3.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "9e29c3f0b9dbde127254f375499df382d5fa9c3c2b33bfcb393485876fe79fb2" + dependencies = [ + "android_logger", + "env_logger", +diff --git a/build.gradle b/build.gradle +--- a/build.gradle ++++ b/build.gradle +@@ -36,7 +36,7 @@ + topsrcdir = gradle.mozconfig.topsrcdir + topobjdir = gradle.mozconfig.topobjdir + +- gleanVersion = "42.1.0" ++ gleanVersion = "42.3.0" + if (gleanVersion != getRustVersionFor("glean")) { + throw new StopExecutionException("Mismatched Glean version, expected: ${gleanVersion}," + + " found ${getRustVersionFor("glean")}") +diff --git a/build/mach_virtualenv_packages.txt b/build/mach_virtualenv_packages.txt +--- a/build/mach_virtualenv_packages.txt ++++ b/build/mach_virtualenv_packages.txt +@@ -1,7 +1,7 @@ + packages.txt:build/common_virtualenv_packages.txt + # glean-sdk may not be installable if a wheel isn't available + # and it has to be built from source. +-pypi-optional:glean-sdk==40.0.0:telemetry will not be collected ++pypi-optional:glean-sdk==42.3.0:telemetry will not be collected + # Mach gracefully handles the case where `psutil` is unavailable. + # We aren't (yet) able to pin packages in automation, so we have to + # support down to the oldest locally-installed version (5.4.2). +diff --git a/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/RECORD b/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/RECORD +deleted file mode 100644 +--- a/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/RECORD ++++ /dev/null +@@ -1,35 +0,0 @@ +-glean_parser/__init__.py,sha256=kaoYIRhwZiOE1d8TniW1SHSlEivLBXZQJJ3eiDcamvQ,538 +-glean_parser/__main__.py,sha256=FGU4ETmwkPLtzUYOkqmAGElkDKFS98Q-WoXnpAFJH5M,6137 +-glean_parser/coverage.py,sha256=2IwC4XMDtDamMkBFoYilmqJzW4gyypq65YVCur8SNas,4405 +-glean_parser/csharp.py,sha256=tOrwOLjJCnfie0GvhWvg0Q3fnP4VFQM_4GRaaAqUh4I,5242 +-glean_parser/data_review.py,sha256=ZwzL5SD-rC37OHDI9dCq7Z6-NUwARlRgBRb-kRsFGzA,4762 +-glean_parser/javascript.py,sha256=U4QaG5DXfmpqEQoScyNSuoTCUJ-5CYts8jyC3o2bWZs,7849 +-glean_parser/kotlin.py,sha256=204c61dRCCmnPRtPHzoCtLBwraG2Xs3_AF5HKbBuziI,11105 +-glean_parser/lint.py,sha256=jwD0yZ99RZIrmzEBeC3BB9CPPBHcGHmn-oyUjoqNNyI,14470 +-glean_parser/markdown.py,sha256=0auYAmzIrX0kqmQyq9DKkRRvTE66yAYdrU-YMgLhrpw,8996 +-glean_parser/metrics.py,sha256=jUO4XwatfM4sJGVPcyfbUNb5aW4i9kVYp49OEBASvoM,11350 +-glean_parser/parser.py,sha256=sO0kfhicG7xZOfYwNOt0rueBEVgK-YO9M6hVUqQKFP8,13286 +-glean_parser/pings.py,sha256=_mrY0idUGMODEMG3fCMRgO8_B9CnXko_FbrOcUnezV0,2667 +-glean_parser/swift.py,sha256=3pkl6u3JaQrT8Oz0HONoiq46DUdHCEUDcn_lmZXoCVM,6408 +-glean_parser/translate.py,sha256=lnPT3wyzD_YO4Yj6qFAHkP8OZlvVymwK-06QgulnlIs,7394 +-glean_parser/util.py,sha256=B7vX7fdmnP-L_yxiFk5csuN5yTOOJXTVR_zJoW13Snc,13701 +-glean_parser/validate_ping.py,sha256=0TNvILH6dtzJDys3W8Kqorw6kk03me73OCUDtpoHcXU,2118 +-glean_parser/schemas/metrics.1-0-0.schema.yaml,sha256=cND3cvi6iBfPUVmtfIBQfGJV9AALpbvN7nu8E33_J-o,19566 +-glean_parser/schemas/metrics.2-0-0.schema.yaml,sha256=IHDSGcfcl9EstXXb7vn_d9x1wtjD_ANJn6ufpCiqBWY,20248 +-glean_parser/schemas/pings.1-0-0.schema.yaml,sha256=hwCnsKpEysmrmVp-QHGBArEkVY3vaU1rVsxlTwhAzws,4315 +-glean_parser/schemas/pings.2-0-0.schema.yaml,sha256=xUNDwflVSmTcsZL_46uoAbBKROiIPFQRSBt12qiRMt4,3971 +-glean_parser/templates/csharp.jinja2,sha256=tPj09JzgSK0YyNb53WkL8WFTA7fcVXyiJ7V-bARnfM0,4354 +-glean_parser/templates/javascript.jinja2,sha256=osiIk9cZusDNDjW-ojwOGQulXkxPINmbgNOJx-h5iG8,1825 +-glean_parser/templates/kotlin.buildinfo.jinja2,sha256=z9tPgvmNnf8E8gpx7FAWh35oXad8Dlv_UrpqN9CXetY,780 +-glean_parser/templates/kotlin.geckoview.jinja2,sha256=K0c1BeKSXDVbshC3gpWALCQFp2JtsoqWhGyN1ScPhC0,5077 +-glean_parser/templates/kotlin.jinja2,sha256=fsFXKI_fKwj5AEO4odJ5sRvoC5geW59_DhU6GATaA90,4475 +-glean_parser/templates/markdown.jinja2,sha256=tOMN62xEGA1p8QoMKnpCVXUiK_jI5GwLuvCnuOROy8c,3381 +-glean_parser/templates/qmldir.jinja2,sha256=m6IGsp-tgTiOfQ7VN8XW6GqX0gJqJkt3B6Pkaul6FVo,156 +-glean_parser/templates/swift.jinja2,sha256=McprjDExS3Ao62_eTvEwl-ZHNIbYDOJe05gv1nd4trM,4791 +-glean_parser-3.6.0.dist-info/AUTHORS.md,sha256=jBsSsn3EpmpLejgHMhzU1XTFwkCARqYeUs9iGLNgwkQ,432 +-glean_parser-3.6.0.dist-info/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725 +-glean_parser-3.6.0.dist-info/METADATA,sha256=eQfxIRqcsGKQFWnaKB1WQ-XVUcu2cuO71ytkBf8MyGA,20755 +-glean_parser-3.6.0.dist-info/WHEEL,sha256=OqRkF0eY5GHssMorFjlbTIq072vpHpF60fIQA6lS9xA,92 +-glean_parser-3.6.0.dist-info/entry_points.txt,sha256=s-clJTIqp-PpJD-n3AnIQZFkTafIrzsTbAPX9vNY018,69 +-glean_parser-3.6.0.dist-info/top_level.txt,sha256=q7T3duD-9tYZFyDry6Wv2LcdMsK2jGnzdDFhxWcT2Z8,13 +-glean_parser-3.6.0.dist-info/RECORD,, +diff --git a/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/AUTHORS.md b/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/AUTHORS.md +rename from third_party/python/glean_parser/glean_parser-3.6.0.dist-info/AUTHORS.md +rename to third_party/python/glean_parser/glean_parser-4.3.1.dist-info/AUTHORS.md +diff --git a/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/LICENSE b/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/LICENSE +rename from third_party/python/glean_parser/glean_parser-3.6.0.dist-info/LICENSE +rename to third_party/python/glean_parser/glean_parser-4.3.1.dist-info/LICENSE +diff --git a/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/METADATA b/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/METADATA +rename from third_party/python/glean_parser/glean_parser-3.6.0.dist-info/METADATA +rename to third_party/python/glean_parser/glean_parser-4.3.1.dist-info/METADATA +--- a/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/METADATA ++++ b/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/METADATA +@@ -1,6 +1,6 @@ + Metadata-Version: 2.1 + Name: glean-parser +-Version: 3.6.0 ++Version: 4.3.1 + Summary: Parser tools for Mozilla's Glean telemetry + Home-page: https://github.com/mozilla/glean_parser + Author: Michael Droettboom +@@ -16,12 +16,13 @@ + Classifier: Programming Language :: Python :: 3.7 + Classifier: Programming Language :: Python :: 3.8 + Classifier: Programming Language :: Python :: 3.9 ++Classifier: Programming Language :: Python :: 3.10 + Description-Content-Type: text/markdown + Requires-Dist: appdirs (>=1.4) + Requires-Dist: Click (>=7) + Requires-Dist: diskcache (>=4) + Requires-Dist: Jinja2 (>=2.10.1) +-Requires-Dist: jsonschema (<4,>=3.0.2) ++Requires-Dist: jsonschema (>=3.0.2) + Requires-Dist: PyYAML (>=5.3.1) + Requires-Dist: yamllint (>=1.18.0) + Requires-Dist: iso8601 (>=0.1.10) ; python_version <= "3.6" +@@ -84,6 +85,42 @@ + + ## Unreleased + ++## 4.3.1 ++ ++- BUGFIX: Skip tags for code generation ([#409](https://github.com/mozilla/glean_parser/pull/409)) ++ ++## 4.3.0 ++ ++- Support tags in glean parser ([bug 1734011](https://bugzilla.mozilla.org/show_bug.cgi?id=1734011)) ++ ++## 4.2.0 ++ ++- Improve the schema validation error messages. They will no longer include `OrderedDict(...)` on Python 3.7 and later ([bug 1733395](https://bugzilla.mozilla.org/show_bug.cgi?id=1733395)) ++- Officially support Python 3.10 ++ ++## 4.1.1 (2021-09-28) ++ ++- Update private import paths on Javascript / Typescript templates. ([bug 1702468](https://bugzilla.mozilla.org/show_bug.cgi?id=1702468)) ++ ++## 4.1.0 (2021-09-16) ++ ++- Add support for Node.js platform on Javascript / Typescript templates. ([bug 1728982](https://bugzilla.mozilla.org/show_bug.cgi?id=1728982)) ++ ++## 4.0.0 (2021-08-20) ++ ++- Add support for Text metric type ([#374](https://github.com/mozilla/glean_parser/pull/374)) ++- Reserve the `default` ping name. It can't be used as a ping name, but it can be used in `send_in_pings` ([#376](https://github.com/mozilla/glean_parser/pull/376)) ++ ++## 3.8.0 (2021-08-18) ++ ++- Expose ping reasons enum on JavaScript / TypeScript templates. ([bug 1719136](https://bugzilla.mozilla.org/show_bug.cgi?id=1719136)) ++- Define an interface with the allowed extras for each event on the TypeScript template. ([bug 1693487](https://bugzilla.mozilla.org/show_bug.cgi?id=1693487)) ++ ++## 3.7.0 (2021-07-13) ++ ++- New lint: Check for redundant words in ping names ([#355](https://github.com/mozilla/glean_parser/pull/355)) ++- Add support for URL metric type ([#361](https://github.com/mozilla/glean_parser/pull/361)) ++ + ## 3.6.0 (2021-06-11) + + - Add a command `data-review` to generate a skeleton Data Review Request for all metrics matching a supplied bug number. ([bug 1704541](https://bugzilla.mozilla.org/show_bug.cgi?id=1704541)) +@@ -99,9 +136,9 @@ + + ## 3.4.0 (2021-05-28) + +-- Add missing import for Kotlin code ([#339](https://github.com/mozilla/glean_parser/pull/341)) +-- Use a plain Kotlin type in the generated interface implementation ([#339](https://github.com/mozilla/glean_parser/pull/341)) +-- Generate additional generics for event metrics ([#339](https://github.com/mozilla/glean_parser/pull/341)) ++- Add missing import for Kotlin code ([#339](https://github.com/mozilla/glean_parser/pull/339)) ++- Use a plain Kotlin type in the generated interface implementation ([#339](https://github.com/mozilla/glean_parser/pull/339)) ++- Generate additional generics for event metrics ([#339](https://github.com/mozilla/glean_parser/pull/339)) + - For Kotlin skip generating `GleanBuildInfo.kt` when requested (with `with_buildinfo=false`) ([#341](https://github.com/mozilla/glean_parser/pull/341)) + + ## 3.3.2 (2021-05-18) +diff --git a/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/RECORD b/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/RECORD +new file mode 100644 +--- /dev/null ++++ b/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/RECORD +@@ -0,0 +1,37 @@ ++glean_parser/__init__.py,sha256=kaoYIRhwZiOE1d8TniW1SHSlEivLBXZQJJ3eiDcamvQ,538 ++glean_parser/__main__.py,sha256=1lA0kuQkEIMZSnG8xYha5dASadwEHI5-MeHmuNqyViA,6509 ++glean_parser/coverage.py,sha256=2IwC4XMDtDamMkBFoYilmqJzW4gyypq65YVCur8SNas,4405 ++glean_parser/csharp.py,sha256=tOrwOLjJCnfie0GvhWvg0Q3fnP4VFQM_4GRaaAqUh4I,5242 ++glean_parser/data_review.py,sha256=TA87mbyUQeDOB1T344gfsXePScBEZ9TdyWLy5TJCpHU,4765 ++glean_parser/javascript.py,sha256=e2hslgxRB56aS2_JVOkatKexrblcz6-XqsDnGuw0MPQ,8150 ++glean_parser/kotlin.py,sha256=INVHy3yC2xwm9ZFL9atr99C4DDsOwvRKnCiaJcLql_o,11192 ++glean_parser/lint.py,sha256=CM9OMH-sIxuErvfQktbWkeKIIVzG28pPxqMGO1Espok,17018 ++glean_parser/markdown.py,sha256=0auYAmzIrX0kqmQyq9DKkRRvTE66yAYdrU-YMgLhrpw,8996 ++glean_parser/metrics.py,sha256=Z0gkVMHH-u4eCu_bpsu5JKm9gumZhCz1Jq-xSmHjo8k,11621 ++glean_parser/parser.py,sha256=vIGJGOz0S4cAIdlzeEoiBbmoEgxLKvGdSStVHt8LvX8,15463 ++glean_parser/pings.py,sha256=6XakkO9jnQc2oojLQJvTCMwF7w-BEm6rR54tunCb38o,2805 ++glean_parser/swift.py,sha256=FWOp1Qr8U4xQvOfcu23FttCc4Nc8P7PkJTqm-V7bC4Y,6437 ++glean_parser/tags.py,sha256=bemKYvcbMO4JrghiNSe-A4BNNDtx_FlUPkgrPPJy84Y,1391 ++glean_parser/translate.py,sha256=ZyWEEp1bQO2-cneiC-YvbCuTUEra-xgp33X6dkvtgUY,7476 ++glean_parser/util.py,sha256=gsP8MqfgEs0sDKbz4sV2CfvmDT6MP73dOdNcmOx_K9k,14160 ++glean_parser/validate_ping.py,sha256=0TNvILH6dtzJDys3W8Kqorw6kk03me73OCUDtpoHcXU,2118 ++glean_parser/schemas/metrics.1-0-0.schema.yaml,sha256=cND3cvi6iBfPUVmtfIBQfGJV9AALpbvN7nu8E33_J-o,19566 ++glean_parser/schemas/metrics.2-0-0.schema.yaml,sha256=asAWdpMUkUWDT0sTN26ivoLey50ggGxLUN4aW6OcQpY,22138 ++glean_parser/schemas/pings.1-0-0.schema.yaml,sha256=hwCnsKpEysmrmVp-QHGBArEkVY3vaU1rVsxlTwhAzws,4315 ++glean_parser/schemas/pings.2-0-0.schema.yaml,sha256=rD1s-rfz1xC9biHyLfBCnsoQxVYHwpe_S05awfe2xDA,4363 ++glean_parser/schemas/tags.1-0-0.schema.yaml,sha256=OGXIJlvvVW1vaqB_NVZnwKeZ-sLlfH57vjBSHbj6DNI,1231 ++glean_parser/templates/csharp.jinja2,sha256=tPj09JzgSK0YyNb53WkL8WFTA7fcVXyiJ7V-bARnfM0,4354 ++glean_parser/templates/javascript.jinja2,sha256=Qiv0lxsqVABzdME1MRsmezwtwn8_hHdH9S_v8fJAh-E,2647 ++glean_parser/templates/kotlin.buildinfo.jinja2,sha256=z9tPgvmNnf8E8gpx7FAWh35oXad8Dlv_UrpqN9CXetY,780 ++glean_parser/templates/kotlin.geckoview.jinja2,sha256=K0c1BeKSXDVbshC3gpWALCQFp2JtsoqWhGyN1ScPhC0,5077 ++glean_parser/templates/kotlin.jinja2,sha256=fsFXKI_fKwj5AEO4odJ5sRvoC5geW59_DhU6GATaA90,4475 ++glean_parser/templates/markdown.jinja2,sha256=tOMN62xEGA1p8QoMKnpCVXUiK_jI5GwLuvCnuOROy8c,3381 ++glean_parser/templates/qmldir.jinja2,sha256=m6IGsp-tgTiOfQ7VN8XW6GqX0gJqJkt3B6Pkaul6FVo,156 ++glean_parser/templates/swift.jinja2,sha256=McprjDExS3Ao62_eTvEwl-ZHNIbYDOJe05gv1nd4trM,4791 ++glean_parser-4.3.1.dist-info/AUTHORS.md,sha256=jBsSsn3EpmpLejgHMhzU1XTFwkCARqYeUs9iGLNgwkQ,432 ++glean_parser-4.3.1.dist-info/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725 ++glean_parser-4.3.1.dist-info/METADATA,sha256=WO52mRW8bTLNVllJhXFPdPETSWm74sEm1o7QLJPJF4g,22416 ++glean_parser-4.3.1.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92 ++glean_parser-4.3.1.dist-info/entry_points.txt,sha256=s-clJTIqp-PpJD-n3AnIQZFkTafIrzsTbAPX9vNY018,69 ++glean_parser-4.3.1.dist-info/top_level.txt,sha256=q7T3duD-9tYZFyDry6Wv2LcdMsK2jGnzdDFhxWcT2Z8,13 ++glean_parser-4.3.1.dist-info/RECORD,, +diff --git a/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/WHEEL b/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/WHEEL +rename from third_party/python/glean_parser/glean_parser-3.6.0.dist-info/WHEEL +rename to third_party/python/glean_parser/glean_parser-4.3.1.dist-info/WHEEL +--- a/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/WHEEL ++++ b/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/WHEEL +@@ -1,5 +1,5 @@ + Wheel-Version: 1.0 +-Generator: bdist_wheel (0.36.2) ++Generator: bdist_wheel (0.37.0) + Root-Is-Purelib: true + Tag: py3-none-any + +diff --git a/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/entry_points.txt b/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/entry_points.txt +rename from third_party/python/glean_parser/glean_parser-3.6.0.dist-info/entry_points.txt +rename to third_party/python/glean_parser/glean_parser-4.3.1.dist-info/entry_points.txt +diff --git a/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/top_level.txt b/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/top_level.txt +rename from third_party/python/glean_parser/glean_parser-3.6.0.dist-info/top_level.txt +rename to third_party/python/glean_parser/glean_parser-4.3.1.dist-info/top_level.txt +diff --git a/third_party/python/glean_parser/glean_parser/__main__.py b/third_party/python/glean_parser/glean_parser/__main__.py +--- a/third_party/python/glean_parser/glean_parser/__main__.py ++++ b/third_party/python/glean_parser/glean_parser/__main__.py +@@ -63,7 +63,14 @@ + is_flag=True, + help=("Do not treat missing input files as an error."), + ) +-def translate(input, format, output, option, allow_reserved, allow_missing_files): ++@click.option( ++ "--require-tags", ++ is_flag=True, ++ help=("Require tags to be specified for metrics and pings."), ++) ++def translate( ++ input, format, output, option, allow_reserved, allow_missing_files, require_tags ++): + """ + Translate metrics.yaml and pings.yaml files to other formats. + """ +@@ -81,6 +88,7 @@ + { + "allow_reserved": allow_reserved, + "allow_missing_files": allow_missing_files, ++ "require_tags": require_tags, + }, + ) + ) +@@ -130,7 +138,12 @@ + is_flag=True, + help=("Do not treat missing input files as an error."), + ) +-def glinter(input, allow_reserved, allow_missing_files): ++@click.option( ++ "--require-tags", ++ is_flag=True, ++ help=("Require tags to be specified for metrics and pings."), ++) ++def glinter(input, allow_reserved, allow_missing_files, require_tags): + """ + Runs a linter over the metrics. + """ +@@ -140,6 +153,7 @@ + { + "allow_reserved": allow_reserved, + "allow_missing_files": allow_missing_files, ++ "require_tags": require_tags, + }, + ) + ) +diff --git a/third_party/python/glean_parser/glean_parser/data_review.py b/third_party/python/glean_parser/glean_parser/data_review.py +--- a/third_party/python/glean_parser/glean_parser/data_review.py ++++ b/third_party/python/glean_parser/glean_parser/data_review.py +@@ -135,7 +135,7 @@ + + TODO: Fill this in. + +-11. Where do you intend to share the results of your analys ++11. Where do you intend to share the results of your analysis? + + TODO: Fill this in. + +diff --git a/third_party/python/glean_parser/glean_parser/javascript.py b/third_party/python/glean_parser/glean_parser/javascript.py +--- a/third_party/python/glean_parser/glean_parser/javascript.py ++++ b/third_party/python/glean_parser/glean_parser/javascript.py +@@ -11,7 +11,7 @@ + import enum + import json + from pathlib import Path +-from typing import Any, Dict, List, Optional, Union, Callable # noqa ++from typing import Any, Dict, Optional, Callable + + from . import metrics + from . import util +@@ -44,7 +44,7 @@ + def class_name_factory(platform: str) -> Callable[[str], str]: + """ + Returns a function that receives an obj_type and +- returns the correct class name for that time in the current platform. ++ returns the correct class name for that type in the current platform. + """ + + def class_name(obj_type: str) -> str: +@@ -63,6 +63,16 @@ + return class_name + + ++def extra_type_name(extra_type: str) -> str: ++ """ ++ Returns the equivalent TypeScript type to an extra type. ++ """ ++ if extra_type == "quantity": ++ return "number" ++ ++ return extra_type ++ ++ + def import_path(obj_type: str) -> str: + """ + Returns the import path of the given object inside the @mozilla/glean package. +@@ -113,9 +123,10 @@ + options = {} + + platform = options.get("platform", "webext") +- if platform not in ["qt", "webext"]: ++ accepted_platforms = ["qt", "webext", "node"] ++ if platform not in accepted_platforms: + raise ValueError( +- f"Unknown platform: {platform}. Accepted platforms are qt and webext." ++ f"Unknown platform: {platform}. Accepted platforms are: {accepted_platforms}." # noqa + ) + version = options.get("version") + if platform == "qt" and version is None: +@@ -127,6 +138,7 @@ + "javascript.jinja2", + filters=( + ("class_name", class_name_factory(platform)), ++ ("extra_type_name", extra_type_name), + ("import_path", import_path), + ("js", javascript_datatypes_filter), + ("args", args), +diff --git a/third_party/python/glean_parser/glean_parser/kotlin.py b/third_party/python/glean_parser/glean_parser/kotlin.py +--- a/third_party/python/glean_parser/glean_parser/kotlin.py ++++ b/third_party/python/glean_parser/glean_parser/kotlin.py +@@ -16,7 +16,9 @@ + + from . import metrics + from . import pings ++from . import tags + from . import util ++from .util import DictWrapper + + + def kotlin_datatypes_filter(value: util.JSONType) -> str: +@@ -176,9 +178,7 @@ + # }, + # "other-type": {} + # } +- gecko_metrics: OrderedDict[ +- str, OrderedDict[str, List[Dict[str, str]]] +- ] = OrderedDict() ++ gecko_metrics: Dict[str, Dict[str, List[Dict[str, str]]]] = DictWrapper() + + # Define scalar-like types. + SCALAR_LIKE_TYPES = ["boolean", "string", "quantity"] +@@ -188,8 +188,10 @@ + # Glean SDK and GeckoView. See bug 1566356 for more context. + for metric in category_val.values(): + # This is not a Gecko metric, skip it. +- if isinstance(metric, pings.Ping) or not getattr( +- metric, "gecko_datapoint", False ++ if ( ++ isinstance(metric, pings.Ping) ++ or isinstance(metric, tags.Tag) ++ or not getattr(metric, "gecko_datapoint", False) + ): + continue + +diff --git a/third_party/python/glean_parser/glean_parser/lint.py b/third_party/python/glean_parser/glean_parser/lint.py +--- a/third_party/python/glean_parser/glean_parser/lint.py ++++ b/third_party/python/glean_parser/glean_parser/lint.py +@@ -23,6 +23,7 @@ + from . import metrics + from . import parser + from . import pings ++from . import tags + from . import util + + +@@ -42,7 +43,7 @@ + """ + Helper function to split words on either `.` or `_`. + """ +- return re.split("[._]", name) ++ return re.split("[._-]", name) + + + def _english_list(items: List[str]) -> str: +@@ -234,6 +235,16 @@ + yield f"Ping '{ping}' seems misspelled. Did you mean '{builtin}'?" + + ++def check_tags_required( ++ metric_or_ping: Union[metrics.Metric, pings.Ping], parser_config: Dict[str, Any] ++) -> LintGenerator: ++ ++ if parser_config.get("require_tags", False) and not len( ++ metric_or_ping.metadata.get("tags", []) ++ ): ++ yield "Tags are required but no tags specified" ++ ++ + def check_user_lifetime_expiration( + metric: metrics.Metric, parser_config: Dict[str, Any] + ) -> LintGenerator: +@@ -262,6 +273,28 @@ + yield ("Metric has expired. Please consider removing it.") + + ++def check_redundant_ping( ++ pings: pings.Ping, parser_config: Dict[str, Any] ++) -> LintGenerator: ++ """ ++ Check if the pings contains 'ping' as the prefix or suffix, or 'ping' or 'custom' ++ """ ++ ping_words = _split_words(pings.name) ++ ++ if len(ping_words) != 0: ++ ping_first_word = ping_words[0] ++ ping_last_word = ping_words[-1] ++ ++ if ping_first_word == "ping": ++ yield ("The prefix 'ping' is redundant.") ++ elif ping_last_word == "ping": ++ yield ("The suffix 'ping' is redundant.") ++ elif "ping" in ping_words: ++ yield ("The word 'ping' is redundant.") ++ elif "custom" in ping_words: ++ yield ("The word 'custom' is redundant.") ++ ++ + # The checks that operate on an entire category of metrics: + # {NAME: (function, is_error)} + CATEGORY_CHECKS: Dict[ +@@ -281,6 +314,7 @@ + "BUG_NUMBER": (check_bug_number, CheckType.error), + "BASELINE_PING": (check_valid_in_baseline, CheckType.error), + "MISSPELLED_PING": (check_misspelled_pings, CheckType.error), ++ "TAGS_REQUIRED": (check_tags_required, CheckType.error), + "EXPIRATION_DATE_TOO_FAR": (check_expired_date, CheckType.warning), + "USER_LIFETIME_EXPIRATION": (check_user_lifetime_expiration, CheckType.warning), + "EXPIRED": (check_expired_metric, CheckType.warning), +@@ -293,6 +327,8 @@ + str, Tuple[Callable[[pings.Ping, dict], LintGenerator], CheckType] + ] = { + "BUG_NUMBER": (check_bug_number, CheckType.error), ++ "TAGS_REQUIRED": (check_tags_required, CheckType.error), ++ "REDUNDANT_PING": (check_redundant_ping, CheckType.error), + } + + +@@ -310,10 +346,32 @@ + ) + + ++def _lint_item_tags( ++ item_name: str, ++ item_type: str, ++ item_tag_names: List[str], ++ valid_tag_names: List[str], ++) -> List[GlinterNit]: ++ invalid_tags = [tag for tag in item_tag_names if tag not in valid_tag_names] ++ return ( ++ [ ++ GlinterNit( ++ "INVALID_TAGS", ++ item_name, ++ f"Invalid tags specified in {item_type}: {', '.join(invalid_tags)}", ++ CheckType.error, ++ ) ++ ] ++ if len(invalid_tags) ++ else [] ++ ) ++ ++ + def _lint_pings( +- category: Dict[str, Union[metrics.Metric, pings.Ping]], ++ category: Dict[str, Union[metrics.Metric, pings.Ping, tags.Tag]], + parser_config: Dict[str, Any], +-): ++ valid_tag_names: List[str], ++) -> List[GlinterNit]: + nits: List[GlinterNit] = [] + + for (ping_name, ping) in sorted(list(category.items())): +@@ -331,7 +389,14 @@ + ) + for msg in new_nits + ) +- ++ nits.extend( ++ _lint_item_tags( ++ ping_name, ++ "ping", ++ ping.metadata.get("tags", []), ++ valid_tag_names, ++ ) ++ ) + return nits + + +@@ -351,12 +416,17 @@ + parser_config = {} + + nits: List[GlinterNit] = [] ++ valid_tag_names = [tag for tag in objs.get("tags", [])] + for (category_name, category) in sorted(list(objs.items())): + if category_name == "pings": +- nits.extend(_lint_pings(category, parser_config)) ++ nits.extend(_lint_pings(category, parser_config, valid_tag_names)) + continue + +- # Make sure the category has only Metrics, not Pings ++ if category_name == "tags": ++ # currently we have no linting for tags ++ continue ++ ++ # Make sure the category has only Metrics, not Pings or Tags + category_metrics = dict( + (name, metric) + for (name, metric) in category.items() +@@ -388,6 +458,16 @@ + for msg in new_nits + ) + ++ # also check that tags for metric are valid ++ nits.extend( ++ _lint_item_tags( ++ ".".join([metric.category, metric.name]), ++ "metric", ++ metric.metadata.get("tags", []), ++ valid_tag_names, ++ ) ++ ) ++ + if len(nits): + print("Sorry, Glean found some glinter nits:", file=file) + for nit in nits: +diff --git a/third_party/python/glean_parser/glean_parser/metrics.py b/third_party/python/glean_parser/glean_parser/metrics.py +--- a/third_party/python/glean_parser/glean_parser/metrics.py ++++ b/third_party/python/glean_parser/glean_parser/metrics.py +@@ -13,6 +13,7 @@ + + + from . import pings ++from . import tags + from . import util + + +@@ -47,6 +48,7 @@ + description: str, + notification_emails: List[str], + expires: Any, ++ metadata: Optional[Dict] = None, + data_reviews: Optional[List[str]] = None, + version: int = 0, + disabled: bool = False, +@@ -71,6 +73,9 @@ + self.description = description + self.notification_emails = notification_emails + self.expires = expires ++ if metadata is None: ++ metadata = {} ++ self.metadata = metadata + if data_reviews is None: + data_reviews = [] + self.data_reviews = data_reviews +@@ -312,7 +317,8 @@ + def allowed_extra_keys_with_types(self): + # Sort keys so that output is deterministic + return sorted( +- [(k, v["type"]) for (k, v) in self.extra_keys.items()], key=lambda x: x[0] ++ [(k, v.get("type", "string")) for (k, v) in self.extra_keys.items()], ++ key=lambda x: x[0], + ) + + @property +@@ -338,6 +344,10 @@ + typename = "uuid" + + ++class Url(Metric): ++ typename = "url" ++ ++ + class Jwe(Metric): + typename = "jwe" + +@@ -391,4 +401,8 @@ + super().__init__(*args, **kwargs) + + +-ObjectTree = Dict[str, Dict[str, Union[Metric, pings.Ping]]] ++class Text(Metric): ++ typename = "text" ++ ++ ++ObjectTree = Dict[str, Dict[str, Union[Metric, pings.Ping, tags.Tag]]] +diff --git a/third_party/python/glean_parser/glean_parser/parser.py b/third_party/python/glean_parser/glean_parser/parser.py +--- a/third_party/python/glean_parser/glean_parser/parser.py ++++ b/third_party/python/glean_parser/glean_parser/parser.py +@@ -8,7 +8,6 @@ + Code for parsing metrics.yaml files. + """ + +-from collections import OrderedDict + import functools + from pathlib import Path + import textwrap +@@ -19,7 +18,9 @@ + + from .metrics import Metric, ObjectTree + from .pings import Ping, RESERVED_PING_NAMES ++from .tags import Tag + from . import util ++from .util import DictWrapper + + + ROOT_DIR = Path(__file__).parent +@@ -27,6 +28,7 @@ + + METRICS_ID = "moz://mozilla.org/schemas/glean/metrics/2-0-0" + PINGS_ID = "moz://mozilla.org/schemas/glean/pings/2-0-0" ++TAGS_ID = "moz://mozilla.org/schemas/glean/tags/1-0-0" + + + def _update_validator(validator): +@@ -90,7 +92,7 @@ + except IndexError: + filetype = None + +- if filetype not in ("metrics", "pings"): ++ if filetype not in ("metrics", "pings", "tags"): + filetype = None + + for error in validate(content, filepath): +@@ -207,7 +209,7 @@ + "Glean internal use.", + ) + continue +- all_objects.setdefault(category_key, OrderedDict()) ++ all_objects.setdefault(category_key, DictWrapper()) + + if not isinstance(category_val, dict): + raise TypeError(f"Invalid content for {category_key}") +@@ -222,6 +224,7 @@ + filepath, + f"On instance {category_key}.{metric_key}", + str(e), ++ metric_val.defined_in["line"], + ) + metric_obj = None + else: +@@ -234,14 +237,15 @@ + f"On instance {category_key}.{metric_key}", + 'Only internal metrics may specify "all-pings" ' + 'in "send_in_pings"', ++ metric_val.defined_in["line"], + ) + metric_obj = None + + if metric_obj is not None: + metric_obj.no_lint = list(set(metric_obj.no_lint + global_no_lint)) + +- if isinstance(filepath, Path): +- metric_obj.defined_in["filepath"] = str(filepath) ++ if isinstance(filepath, Path): ++ metric_obj.defined_in["filepath"] = str(filepath) + + already_seen = sources.get((category_key, metric_key)) + if already_seen is not None: +@@ -253,6 +257,7 @@ + f"Duplicate metric name '{category_key}.{metric_key}' " + f"already defined in '{already_seen}'" + ), ++ metric_obj.defined_in["line"], + ) + else: + all_objects[category_key][metric_key] = metric_obj +@@ -319,6 +324,58 @@ + sources[ping_key] = filepath + + ++def _instantiate_tags( ++ all_objects: ObjectTree, ++ sources: Dict[Any, Path], ++ content: Dict[str, util.JSONType], ++ filepath: Path, ++ config: Dict[str, Any], ++) -> Generator[str, None, None]: ++ """ ++ Load a list of tags.yaml files, convert the JSON information into Tag ++ objects. ++ """ ++ global_no_lint = content.get("no_lint", []) ++ assert isinstance(global_no_lint, list) ++ ++ for tag_key, tag_val in content.items(): ++ if tag_key.startswith("$"): ++ continue ++ if tag_key == "no_lint": ++ continue ++ if not isinstance(tag_val, dict): ++ raise TypeError(f"Invalid content for tag {tag_key}") ++ tag_val["name"] = tag_key ++ try: ++ tag_obj = Tag( ++ defined_in=getattr(tag_val, "defined_in", None), ++ _validated=True, ++ **tag_val, ++ ) ++ except Exception as e: ++ yield util.format_error(filepath, f"On instance '{tag_key}'", str(e)) ++ continue ++ ++ if tag_obj is not None: ++ tag_obj.no_lint = list(set(tag_obj.no_lint + global_no_lint)) ++ ++ if isinstance(filepath, Path) and tag_obj.defined_in is not None: ++ tag_obj.defined_in["filepath"] = str(filepath) ++ ++ already_seen = sources.get(tag_key) ++ if already_seen is not None: ++ # We've seen this tag name already ++ yield util.format_error( ++ filepath, ++ "", ++ f"Duplicate tag name '{tag_key}' " ++ f"already defined in '{already_seen}'", ++ ) ++ else: ++ all_objects.setdefault("tags", {})[tag_key] = tag_obj ++ sources[tag_key] = filepath ++ ++ + def _preprocess_objects(objs: ObjectTree, config: Dict[str, Any]) -> ObjectTree: + """ + Preprocess the object tree to better set defaults. +@@ -348,7 +405,7 @@ + ) -> Generator[str, None, ObjectTree]: + """ + Parse one or more metrics.yaml and/or pings.yaml files, returning a tree of +- `metrics.Metric` and `pings.Ping` instances. ++ `metrics.Metric`, `pings.Ping`, and `tags.Tag` instances. + + The result is a generator over any errors. If there are no errors, the + actual metrics can be obtained from `result.value`. For example:: +@@ -360,11 +417,11 @@ + + The result value is a dictionary of category names to categories, where + each category is a dictionary from metric name to `metrics.Metric` +- instances. There is also the special category `pings` containing all +- of the `pings.Ping` instances. ++ instances. There are also the special categories `pings` and `tags` ++ containing all of the `pings.Ping` and `tags.Tag` instances, respectively. + +- :param filepaths: list of Path objects to metrics.yaml and/or pings.yaml +- files ++ :param filepaths: list of Path objects to metrics.yaml, pings.yaml, and/or ++ tags.yaml files + :param config: A dictionary of options that change parsing behavior. + Supported keys are: + +@@ -379,7 +436,7 @@ + if config is None: + config = {} + +- all_objects: ObjectTree = OrderedDict() ++ all_objects: ObjectTree = DictWrapper() + sources: Dict[Any, Path] = {} + filepaths = util.ensure_list(filepaths) + for filepath in filepaths: +@@ -392,5 +449,8 @@ + yield from _instantiate_pings( + all_objects, sources, content, filepath, config + ) +- ++ elif filetype == "tags": ++ yield from _instantiate_tags( ++ all_objects, sources, content, filepath, config ++ ) + return _preprocess_objects(all_objects, config) +diff --git a/third_party/python/glean_parser/glean_parser/pings.py b/third_party/python/glean_parser/glean_parser/pings.py +--- a/third_party/python/glean_parser/glean_parser/pings.py ++++ b/third_party/python/glean_parser/glean_parser/pings.py +@@ -14,7 +14,7 @@ + from . import util + + +-RESERVED_PING_NAMES = ["baseline", "metrics", "events", "deletion-request"] ++RESERVED_PING_NAMES = ["baseline", "metrics", "events", "deletion-request", "default"] + + + class Ping: +@@ -24,6 +24,7 @@ + description: str, + bugs: List[str], + notification_emails: List[str], ++ metadata: Optional[Dict] = None, + data_reviews: Optional[List[str]] = None, + include_client_id: bool = False, + send_if_empty: bool = False, +@@ -40,6 +41,9 @@ + + self.bugs = bugs + self.notification_emails = notification_emails ++ if metadata is None: ++ metadata = {} ++ self.metadata = metadata + if data_reviews is None: + data_reviews = [] + self.data_reviews = data_reviews +@@ -53,7 +57,7 @@ + no_lint = [] + self.no_lint = no_lint + +- # _validated indicates whether this metric has already been jsonschema ++ # _validated indicates whether this ping has already been jsonschema + # validated (but not any of the Python-level validation). + if not _validated: + data: Dict[str, util.JSONType] = { +diff --git a/third_party/python/glean_parser/glean_parser/schemas/metrics.2-0-0.schema.yaml b/third_party/python/glean_parser/glean_parser/schemas/metrics.2-0-0.schema.yaml +--- a/third_party/python/glean_parser/glean_parser/schemas/metrics.2-0-0.schema.yaml ++++ b/third_party/python/glean_parser/glean_parser/schemas/metrics.2-0-0.schema.yaml +@@ -94,6 +94,8 @@ + + - `uuid`: Record a UUID v4. + ++ - `url`: Record a valid URL string. ++ + - `memory_distribution`: A histogram for recording memory usage + values. Additional properties: `memory_unit`. + +@@ -115,6 +117,8 @@ + + `labeled_boolean`, `labeled_string`, `labeled_counter`. + ++ - `text`: Record long text data. ++ + type: string + enum: + - event +@@ -129,11 +133,13 @@ + - memory_distribution + - datetime + - uuid ++ - url + - jwe + - labeled_boolean + - labeled_string + - labeled_counter + - rate ++ - text + + description: + title: Description +@@ -147,6 +153,22 @@ + syntax](https://www.markdownguide.org/basic-syntax/). + type: string + ++ metadata: ++ title: Metadata ++ description: | ++ Additional metadata about this metric. Currently limited to a list of ++ tags. ++ type: object ++ properties: ++ tags: ++ title: Tags ++ description: Which tags are specified for this metric. ++ type: array ++ items: ++ type: string ++ maxLength: 80 ++ default: {} ++ + lifetime: + title: Lifetime + description: | +@@ -513,6 +535,9 @@ + - not: + description: "'pings' is reserved as a category name." + const: pings ++ - not: ++ description: "'tags' is reserved as a category name." ++ const: tags + - enum: ['$schema'] + + properties: +@@ -622,3 +647,41 @@ + description: | + `denominator_metric` is only allowed for `rate`. + maxLength: 0 ++ - ++ if: ++ properties: ++ type: ++ const: text ++ then: ++ properties: ++ lifetime: ++ description: > ++ Text metrics must have ping or application lifetime. ++ enum: ++ - ping ++ - application ++ ++ data_sensitivity: ++ description: > ++ Text metrics require Category 3 (`web_activity`) ++ or Category 4 (`highly_sensitive`). ++ type: array ++ items: ++ enum: ++ - web_activity ++ - highly_sensitive ++ ++ send_in_pings: ++ description: | ++ Text metrics can only be sent in custom pings. ++ Built-in pings are not allowed. ++ type: array ++ items: ++ allOf: ++ - $ref: "#/definitions/kebab_case" ++ - not: ++ description: > ++ Text metrics can only be sent in custom pings. ++ Built-in pings are not allowed." ++ pattern: ++ "^(metrics|baseline|events|deletion-request|default|glean_.*)$" +diff --git a/third_party/python/glean_parser/glean_parser/schemas/pings.2-0-0.schema.yaml b/third_party/python/glean_parser/glean_parser/schemas/pings.2-0-0.schema.yaml +--- a/third_party/python/glean_parser/glean_parser/schemas/pings.2-0-0.schema.yaml ++++ b/third_party/python/glean_parser/glean_parser/schemas/pings.2-0-0.schema.yaml +@@ -62,6 +62,22 @@ + syntax](https://www.markdownguide.org/basic-syntax/). + type: string + ++ metadata: ++ title: Metadata ++ description: | ++ Additional metadata about this ping. Currently limited to a list of ++ tags. ++ type: object ++ properties: ++ tags: ++ title: Tags ++ description: Which tags are specified for this ping. ++ type: array ++ items: ++ type: string ++ maxLength: 80 ++ default: {} ++ + include_client_id: + title: Include client id + description: | +diff --git a/third_party/python/glean_parser/glean_parser/schemas/tags.1-0-0.schema.yaml b/third_party/python/glean_parser/glean_parser/schemas/tags.1-0-0.schema.yaml +new file mode 100644 +--- /dev/null ++++ b/third_party/python/glean_parser/glean_parser/schemas/tags.1-0-0.schema.yaml +@@ -0,0 +1,51 @@ ++# This Source Code Form is subject to the terms of the Mozilla Public ++# License, v. 2.0. If a copy of the MPL was not distributed with this ++# file, You can obtain one at http://mozilla.org/MPL/2.0/. ++ ++--- ++$schema: http://json-schema.org/draft-07/schema# ++title: Tags ++description: | ++ Schema for the tags.yaml files for Mozilla's Glean telemetry SDK. ++ ++ The top-level of the `tags.yaml` file has a key defining the name of each ++ tag. The values contain metadata about that tag (currently just a ++ description). ++ ++$id: moz://mozilla.org/schemas/glean/tags/1-0-0 ++ ++type: object ++ ++propertyNames: ++ type: string ++ maxLength: 80 ++ ++properties: ++ $schema: ++ type: string ++ format: url ++ ++ no_lint: ++ title: Lint checks to skip globally ++ description: | ++ This parameter lists any lint checks to skip for this whole file. ++ type: array ++ items: ++ type: string ++ ++additionalProperties: ++ type: object ++ properties: ++ description: ++ title: Description ++ description: | ++ **Required.** ++ ++ A textual description of this tag. ++ ++ Descriptions may contain [markdown ++ syntax](https://www.markdownguide.org/basic-syntax/). ++ type: string ++ required: ++ - description ++ additionalProperties: false +diff --git a/third_party/python/glean_parser/glean_parser/swift.py b/third_party/python/glean_parser/glean_parser/swift.py +--- a/third_party/python/glean_parser/glean_parser/swift.py ++++ b/third_party/python/glean_parser/glean_parser/swift.py +@@ -15,6 +15,7 @@ + + from . import metrics + from . import pings ++from . import tags + from . import util + + # An (imcomplete) list of reserved keywords in Swift. +@@ -139,7 +140,7 @@ + """ + + name: str +- objs: Dict[str, Union[metrics.Metric, pings.Ping]] ++ objs: Dict[str, Union[metrics.Metric, pings.Ping, tags.Tag]] + contains_pings: bool + + +diff --git a/third_party/python/glean_parser/glean_parser/tags.py b/third_party/python/glean_parser/glean_parser/tags.py +new file mode 100644 +--- /dev/null ++++ b/third_party/python/glean_parser/glean_parser/tags.py +@@ -0,0 +1,49 @@ ++from typing import Dict, List, Optional ++from . import util ++ ++ ++class Tag: ++ def __init__( ++ self, ++ name: str, ++ description: str, ++ defined_in: Optional[Dict] = None, ++ no_lint: Optional[List[str]] = None, ++ _validated: bool = False, ++ ): ++ # Avoid cyclical import ++ from . import parser ++ ++ self.name = name ++ self.description = description ++ self.defined_in = defined_in ++ if no_lint is None: ++ no_lint = [] ++ self.no_lint = no_lint ++ ++ # _validated indicates whether this tag has already been jsonschema ++ # validated (but not any of the Python-level validation). ++ if not _validated: ++ data: Dict[str, util.JSONType] = { ++ "$schema": parser.TAGS_ID, ++ self.name: self._serialize_input(), ++ } ++ for error in parser.validate(data): ++ raise ValueError(error) ++ ++ @property ++ def type(self) -> str: ++ return "tag" ++ ++ def _serialize_input(self) -> Dict[str, util.JSONType]: ++ d = self.serialize() ++ modified_dict = util.remove_output_params(d, "defined_in") ++ return modified_dict ++ ++ def serialize(self) -> Dict[str, util.JSONType]: ++ """ ++ Serialize the tag back to JSON object model. ++ """ ++ d = self.__dict__.copy() ++ del d["name"] ++ return d +diff --git a/third_party/python/glean_parser/glean_parser/templates/javascript.jinja2 b/third_party/python/glean_parser/glean_parser/templates/javascript.jinja2 +--- a/third_party/python/glean_parser/glean_parser/templates/javascript.jinja2 ++++ b/third_party/python/glean_parser/glean_parser/templates/javascript.jinja2 +@@ -1,7 +1,11 @@ + {# The final Javascript/Typescript code is autogenerated, but this + Jinja2 template is not. Please file bugs! #} + {% macro obj_declaration(obj) %} +-new {{ obj.type|class_name }}({ ++new {{ obj.type|class_name }}{% if obj.extra_keys and lang == "typescript" %}<{ ++ {% for name, type in obj.allowed_extra_keys_with_types %} ++ {{ name }}?: {{ type|extra_type_name }}, ++ {% endfor %} ++}>{% endif %}({ + {% for arg_name in (obj.type|args).common if obj[arg_name] is defined %} + {{ arg_name|camelize }}: {{ obj[arg_name]|js }}, + {% endfor %} +@@ -20,14 +24,15 @@ + + {% if platform != "qt" %} + {% if has_labeled_metrics %} +-import LabeledMetricType from "@mozilla/glean/{{ platform }}/private/metrics/labeled"; ++import LabeledMetricType from "@mozilla/glean/private/metrics/labeled"; + {% endif %} + {% for type in types %} +-import {{ type|class_name }} from "@mozilla/glean/{{ platform }}/private/{{ type|import_path }}"; ++import {{ type|class_name }} from "@mozilla/glean/private/{{ type|import_path }}"; + {% endfor %} + {% else %} + .import org.mozilla.Glean {{ version }} as Glean + {% endif %} ++ + {% for obj in objs.values() %} + /** + * {{ obj.description|wordwrap() | replace("\n", "\n * ") }} +@@ -40,4 +45,29 @@ + {% if platform != "qt" %}export {% endif %}const {{ obj.name|camelize }} = {{ obj_declaration(obj) }}; + {% endif %} + ++{% if obj|attr("_generate_enums") %} ++{% for name, suffix in obj["_generate_enums"] %} ++{% if obj|attr(name)|length and name == "reason_codes" %} ++/** ++ * Reason codes for `{{ obj.identifier() }}`. ++ * ++ * @readonly ++ * @enum {string} ++ */ ++{% if lang == "typescript" %} ++export enum {{ obj.name|Camelize }}{{ name|Camelize }} { ++ {% for key in obj|attr(name) %} ++ {{ key|Camelize }} = "{{ key }}", ++ {% endfor %} ++} ++{% else %} ++{% if platform != "qt" %}export {% endif %}const {{ obj.name|Camelize }}{{ name|Camelize }} = { ++ {% for key in obj|attr(name) %} ++ "{{ key|Camelize }}": "{{ key }}", ++ {% endfor %} ++} ++{% endif %} ++{% endif %} + {% endfor %} ++{% endif %} ++{% endfor %} +diff --git a/third_party/python/glean_parser/glean_parser/translate.py b/third_party/python/glean_parser/glean_parser/translate.py +--- a/third_party/python/glean_parser/glean_parser/translate.py ++++ b/third_party/python/glean_parser/glean_parser/translate.py +@@ -148,6 +148,9 @@ + if parser_config.get("allow_reserved"): + options["allow_reserved"] = True + ++ # We don't render tags anywhere yet. ++ all_objects.value.pop("tags", None) ++ + # Write everything out to a temporary directory, and then move it to the + # real directory, for transactional integrity. + with tempfile.TemporaryDirectory() as tempdir: +diff --git a/third_party/python/glean_parser/glean_parser/util.py b/third_party/python/glean_parser/glean_parser/util.py +--- a/third_party/python/glean_parser/glean_parser/util.py ++++ b/third_party/python/glean_parser/glean_parser/util.py +@@ -11,7 +11,7 @@ + from pathlib import Path + import sys + import textwrap +-from typing import Any, Callable, Iterable, Sequence, Tuple, Union ++from typing import Any, Callable, Iterable, Sequence, Tuple, Union, Optional + import urllib.request + + import appdirs # type: ignore +@@ -39,6 +39,20 @@ + # https://stackoverflow.com/questions/34667108/ignore-dates-and-times-while-parsing-yaml + + ++# A wrapper around OrderedDict for Python < 3.7 (where dict ordering is not ++# maintained by default), and regular dict everywhere else. ++if sys.version_info < (3, 7): ++ ++ class DictWrapper(OrderedDict): ++ pass ++ ++ ++else: ++ ++ class DictWrapper(dict): ++ pass ++ ++ + class _NoDatesSafeLoader(yaml.SafeLoader): + @classmethod + def remove_implicit_resolver(cls, tag_to_remove): +@@ -77,7 +91,7 @@ + + def _construct_mapping_adding_line(loader, node): + loader.flatten_mapping(node) +- mapping = OrderedDict(loader.construct_pairs(node)) ++ mapping = DictWrapper(loader.construct_pairs(node)) + mapping.defined_in = {"line": node.start_mark.line} + return mapping + +@@ -96,7 +110,7 @@ + yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, data.items() + ) + +- OrderedDumper.add_representer(OrderedDict, _dict_representer) ++ OrderedDumper.add_representer(DictWrapper, _dict_representer) + return yaml.dump(data, Dumper=OrderedDumper, **kwargs) + + +@@ -112,7 +126,7 @@ + """ + # If in py.test, support bits of literal JSON/YAML content + if TESTING_MODE and isinstance(path, dict): +- return path ++ return yaml_load(yaml.dump(path)) + + if path.suffix == ".json": + with path.open("r", encoding="utf-8") as fd: +@@ -313,12 +327,19 @@ + + description = error.schema.get("description") + if description: +- parts.extend(["", "Documentation for this node:", _utils.indent(description)]) ++ parts.extend( ++ ["", "Documentation for this node:", textwrap.indent(description, " ")] ++ ) + + return "\n".join(parts) + + +-def format_error(filepath: Union[str, Path], header: str, content: str) -> str: ++def format_error( ++ filepath: Union[str, Path], ++ header: str, ++ content: str, ++ lineno: Optional[int] = None, ++) -> str: + """ + Format a jsonshema validation error. + """ +@@ -326,10 +347,12 @@ + filepath = filepath.resolve() + else: + filepath = "" ++ if lineno: ++ filepath = f"{filepath}:{lineno}" + if header: +- return f"{filepath}: {header}\n{_utils.indent(content)}" ++ return f"{filepath}: {header}\n{textwrap.indent(content, ' ')}" + else: +- return f"{filepath}:\n{_utils.indent(content)}" ++ return f"{filepath}:\n{textwrap.indent(content, ' ')}" + + + def parse_expires(expires: str) -> datetime.date: +diff --git a/third_party/python/requirements.in b/third_party/python/requirements.in +--- a/third_party/python/requirements.in ++++ b/third_party/python/requirements.in +@@ -15,7 +15,7 @@ + esprima==4.0.1 + fluent.migrate==0.11 + fluent.syntax==0.18.1 +-glean_parser==3.6.0 ++glean_parser==4.3.1 + jsmin==2.1.0 + json-e==2.7.0 + mozilla-version==0.3.4 +diff --git a/third_party/python/requirements.txt b/third_party/python/requirements.txt +--- a/third_party/python/requirements.txt ++++ b/third_party/python/requirements.txt +@@ -162,9 +162,9 @@ + # -r requirements-mach-vendor-python.in + # compare-locales + # fluent.migrate +-glean_parser==3.6.0 \ +- --hash=sha256:1da46764d93ec563eb93235bd477814444742d1ee6b5231dc6684cebf46a6057 \ +- --hash=sha256:655a2038ec0be5364f351f592d5476fe7b028ebb0d9fd75f07c6c54287859552 ++glean_parser==4.3.1 \ ++ --hash=sha256:a8924a3a4aca7fba35dc69d93031993d6481c6ec9cd43362c068eb3e18ea43e8 \ ++ --hash=sha256:c194aba35a57ff9d139527c5321ef526599794994e355bad4c314bd3ab64c3eb + # via -r requirements-mach-vendor-python.in + idna-ssl==1.1.0 \ + --hash=sha256:a933e3bb13da54383f9e8f35dc4f9cb9eb9b3b78c6b36f311254d6d0d92c6c7c +diff --git a/third_party/rust/glean-core/.cargo-checksum.json b/third_party/rust/glean-core/.cargo-checksum.json +--- a/third_party/rust/glean-core/.cargo-checksum.json ++++ b/third_party/rust/glean-core/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{"Cargo.lock":"160efaf0386c8c6b321d94b4d24ea0993603a921e342c43934aca1912f65d62e","Cargo.toml":"028150cbc9ce890ea9186c1903d18809476a27a66f4211c65884995ad5044ae8","LICENSE":"1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5","README.md":"026495898699b54608eb4ec16074ffafc57920d80ccb59961c501a1ea28c9985","examples/sample.rs":"05469332ffa58c661628eb2f260dfd59085c371b0ef0f8b6e9cb77c230b9bb04","src/common_metric_data.rs":"0ce52740ab6d880df5127336ced68be30da568cd2a94301dc16d4e3f527134c9","src/coverage.rs":"49613fd310bd24d779472720975fbe6c97ec370a95eb55f10afa43f67539c942","src/database/mod.rs":"458e3c8af2af5345e02dea32b36f7521d4428c2ea65c225337008af56d00c6f6","src/debug.rs":"53b19f5a1ba8b35ab1ce78332cb2e8283b2068c9068d71c3be1f58bd8af792c3","src/error.rs":"97172a791efdf8b791a04ae7961085fbef4391b313ff3ffb24e9381f2901fccc","src/error_recording.rs":"42af60683cb30eba821b955fe156ce43a114c0f6f3f3b5b84566659398137671","src/event_database/mod.rs":"95d665a039236ede25dd479b19f0ddc32c0dd79cef2fbcc2ef3bab1540680276","src/histogram/exponential.rs":"389d48bab03f7229445ee4d4c8a4c49f6b43303f658dc954da75142f3c040dc6","src/histogram/functional.rs":"1a63a305b48bcef7bc38136b40d916df4bb8f098dc602514ada54a9b091f6951","src/histogram/linear.rs":"5642c8983c3c1ce9b69c6ac99133c8ed5e67abe2398c5dbcf67e69d66880f4ca","src/histogram/mod.rs":"11e5d3b6440a33a3e5544d0e03ffd69fa2fdcabe603ad75e0327f3ed548e8ce3","src/internal_metrics.rs":"5626effec67bf0f9ee12609b77cf04741eac1827123039999d4adb28a3cc5976","src/internal_pings.rs":"5ed4669b6f09d660401f44c8279e0a5fea0262e48de40e85595bd25dc70b05f3","src/lib.rs":"49f36f867e0412d514fdddee9c40d71e020dbc27fe0efebe6808d9a16872b986","src/lib_unit_tests.rs":"17b0eaad81f946ddef89ee076f4d138e427638ee7536be128b30d4e7280dcf7b","src/macros.rs":"3f3fc8c36dd05b7528b66b27e95b6494505a7a1f48abd013218de23ada6b5a43","src/metrics/boolean.rs":"49e2f5be78055f61543db1d4d57cc06064a812a8f45c9d0e753df8325edc9041","src/metrics/counter.rs":"e3e2a195b597ea1559991b992f44a8a5f291b592a5c6946e93e01066f276efbb","src/metrics/custom_distribution.rs":"7ea1c54802e15bb490fdc8b396998ec474bfca2f135902a4028a9530fbb5dd98","src/metrics/datetime.rs":"75f0b7c41301eb881decff363947510a6cc1a9d2203357be32d1ee169c22ff4c","src/metrics/denominator.rs":"511e4123779a6d9159bb0911069f7dcb979899a0fae0d200da854685b59d3348","src/metrics/event.rs":"d6e4a52dbde7fbd44c21df567508c35acf046e08c6ea593bbb65fa25223a2b40","src/metrics/experiment.rs":"3f3ede015bb63fd5f71fc6a90421b25d8002faf71c0766b27bf59b5ae8b8d0da","src/metrics/jwe.rs":"8e1c2e204c285a428cf58f0e7d7ee0662294208b6b48706658a6f44cf412575a","src/metrics/labeled.rs":"c8ef8419447cc0f659eacfd685f6db806e38588bf4792ab97f468b9b23f644d8","src/metrics/memory_distribution.rs":"c2d75dfe9f67a21087b36af64816e703e6b56551b970fac642552116af97f2b5","src/metrics/memory_unit.rs":"d7a678e5242febd021283b30c0099a9e62729944816a3f17d2d91e2808bc0570","src/metrics/mod.rs":"069b6790de4abcaeb8ec06797a1e85344baff6b86844508b2d75d67eb00dc5d5","src/metrics/ping.rs":"b9d344cbfdbe8aff99a83423bd0af465a7228b503f92fe912ddac24904f4eca9","src/metrics/quantity.rs":"2eb6e34f7b0a292df26cddb4295bca7b82557320eff157bf854822c4a7fccb7e","src/metrics/rate.rs":"ba297a593d340568ee1f8061a6ba4f8970220ab2a83c7af290393538c6dd9bc4","src/metrics/string.rs":"8b47de25d4354c9ccf71a5558b287241a4d80c5832ac82e280543bb800996f54","src/metrics/string_list.rs":"c956616cfd1d0fce3c2e61f0b054235f455db2295d128f08b3db2ddcdd11bdbe","src/metrics/time_unit.rs":"9bb3f6c03b1d385008b254f36ed35daf22f9a6fa2d18e007c9b70aac767cde50","src/metrics/timespan.rs":"1252babc991f8c79cbd5027f3a332c28eb63fb0a956d19a18c670ab4f2e60ba3","src/metrics/timing_distribution.rs":"b885514ef2e84c970403f85bcdb09a24abf9822dbd78129fba9d37de388520a8","src/metrics/url.rs":"b83b1de16d2397fa31e52855ccc024a050c0b429af8ffb3ff1519b68b923241d","src/metrics/uuid.rs":"ebe5560fcc76b230d304172f0ab69dc3f5e41924dad8aa30090bd38b103d0ade","src/ping/mod.rs":"0d164c2ec2822658d571356f3d00f24410f9c1e63f31101fc5d0fb20a014ee1b","src/scheduler.rs":"829846308ae9ed558fbaa62e8134ec90571803673d304c8ce370de7117e1cc76","src/storage/mod.rs":"58fc22abaa2c3643a15992ea02c664909a8d6446e5a259044b4780895b2faf10","src/system.rs":"2e2a7436075bd1a34c118202a4d18e58236947696ce3d824e97d9c06ddf0c171","src/traits/boolean.rs":"f17f16f379b777e435e38e810e25336a919f4aeeefb1b4e7cf7749c0ef173fd9","src/traits/counter.rs":"631208036059d498a4485c74c2a80c24a5f13bffeb1053bdf5cce06af0e9d361","src/traits/custom_distribution.rs":"1b3ffda6e857bfa8ad5be412e88f3d9706ededf5a86407364ae19a81f06ef798","src/traits/datetime.rs":"2f4b9e64161c15c912b6a915045dd9840f76229d144a4d1542c54eb4f3b3406b","src/traits/event.rs":"ce9a9395748734b241f35b31c4cddf0ce6a8eca6d700aaeea427b0ae29ce507d","src/traits/jwe.rs":"80cdc61e6d99d7c05139c9d05288290c731b1be61afcbd4a4c415973665ea194","src/traits/labeled.rs":"7f3281fc0a1a745238e7e260463f397dfa61717408fe9d260dc9767d9c659e52","src/traits/memory_distribution.rs":"0b72ffde68eb97f01a57afbc5c6109565ec9435561984d34696622bf5a57d559","src/traits/mod.rs":"88cec83fcff8dfab768953b901ee95fed186f7540afdc9606407aff71f1919df","src/traits/numerator.rs":"9690a1b4487521565bd488e9a938aa66f93045c63f0f0ee6e864e0341395659b","src/traits/ping.rs":"8831c106c03afeb458b0b028fa1ce61f056ebf8e82bc0a171a1bff255d920748","src/traits/quantity.rs":"087d7a4b58f0eb7c766a0202dcf38a52d172ce4edf626211ffe5d94ed02ae754","src/traits/rate.rs":"9d0da25895d4c43cdece43dd57e515ab2fb907e8c9a239807976e3d9197d2955","src/traits/string.rs":"48e5623c7db59b8e6454fbc7fb6e2395f808c9a0fa721d7c07b72abb171eb1ad","src/traits/string_list.rs":"5d5773d5a130323dd82ca95f4ecdccdd6b237afe2eadf8655363bd6b7e8508c1","src/traits/timespan.rs":"29251233847c5cdd200a61472132c62ded27fe2c13835b09424384bf144d82db","src/traits/timing_distribution.rs":"5e619d445e6ef3f19ca69bcdfe02d19b150c5a46855d195703b6d2f55e538636","src/traits/url.rs":"a01331623af4fa8af6e71becffff60060832bef5e48a15df6dc23b41225f689e","src/traits/uuid.rs":"bd78515611ba406d8b1bda35a9fe30c317512a9afcea7c5dece8fced7d410a92","src/upload/directory.rs":"571cfee0347b40b239d0d946625de6265bbea4f433c8316da715ded8f590aca1","src/upload/mod.rs":"34bcb67a5980e2c8b5145553b83e130ed4db40dab6d5c53bc9978469e6b93223","src/upload/policy.rs":"c250957a37783e74af8002cd80ba06ef9780a389fb0f61b8b665b79688f0a360","src/upload/request.rs":"7939e77bde4b55263446c3660b6831bafa27308bc983a51e1679321e962f372f","src/upload/result.rs":"d73454e81f185e4e28c887f7b496bffad7baac74c8f1b719885f940f909a530d","src/util.rs":"a89e21f0f4fe14a5a1a5369a0f2c20d1184816ccfe2b5b1599d3779660772f27","tests/boolean.rs":"9f4830f3b5f5ab6768060917deb1f546324a4744b8ed893197e31a0aed092947","tests/common/mod.rs":"28c77637c5e75a6a57c0aeb4b082de1b5d8015d507b557ca365aa5adbf208af8","tests/counter.rs":"39a2cd40335c164b3e7407f5505bbf571d7e4a71f032d476a7939f7dd1af90d0","tests/custom_distribution.rs":"596575504ad4eab2765b5b88245dcc92dc68e83d04c93deb4b27692c142c0b94","tests/datetime.rs":"4b4ab629a0f0ae789416b67f0efdfe1142fdb18f9d3a0b5182d8d840e4a6655c","tests/event.rs":"cb78dfc0a2315253da8ef6663b81979dd5b0638bb6c31456f16ce4e9bb50c67a","tests/jwe.rs":"dc8a73d1e1925ac49061e8bb5c8de01230aa364942a22470e37aa88965b0eaba","tests/labeled.rs":"cedd548bd8089dfa316cfdfaa1985fb5cd1294e6ba5956b6012c3f01975e8de9","tests/memory_distribution.rs":"0c03d0a491150f508dc12ecac7e5db70043f3a7de2f90cc6b3509aba90549821","tests/metrics.rs":"0560e0645321628015610bbf1a90c0adbb12ad42e5a068399073572120377cbb","tests/ping.rs":"a15c619b2d3c70c3cb669d02b959109bcf231440bdcfe3cac7508a3e310cd181","tests/ping_maker.rs":"aa7921c9dcea278003c719136eeea9b711d0be12bf736cc9a79b70b69cf6109f","tests/quantity.rs":"2543f0f57085d27b0bc0c25c24c17a7e376ac673cf9265a3a9dec202920679c5","tests/storage.rs":"d8d50aba92e17a3053fd80788f5fbbcc8f82293c11c19b58e2de6c4ee45f71ff","tests/string.rs":"9c3e21bfa3ad0b75373f8f5addb8ac023ac5336ac9f969e92b89ea6fda675fdd","tests/string_list.rs":"2b83710b949bea4bd0f6b2029069887f3ea87312b00091e5aa3c7bda0fb9073c","tests/timespan.rs":"bb61e4cfb843b3f387378409ee1a88ef4b8f32b2181af686baacee262b8bca2b","tests/timing_distribution.rs":"23f48e26cc4a9646c77a395fe724fa1c337caa69ea5c358056057cb1bbf4c7e6","tests/uuid.rs":"cf0df9e330344c6e00cd51faaf21dc74c5e47f892b525e0f83623c92a6378be8"},"package":"f50f24e5e7c2abef542a9cb67f7367538db56f54fcae0fae8d3a1e0ac63470a3"} +\ No newline at end of file ++{"files":{"Cargo.lock":"4648d6743263ca9feb905d5f706ad214e8d691c865df5ba1c6844faf962db150","Cargo.toml":"5413e453d11bb3bc682e18334640e24d8d2e3cc80192bec297544277e0bb5cab","LICENSE":"1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5","README.md":"026495898699b54608eb4ec16074ffafc57920d80ccb59961c501a1ea28c9985","examples/sample.rs":"05469332ffa58c661628eb2f260dfd59085c371b0ef0f8b6e9cb77c230b9bb04","src/common_metric_data.rs":"0ce52740ab6d880df5127336ced68be30da568cd2a94301dc16d4e3f527134c9","src/coverage.rs":"49613fd310bd24d779472720975fbe6c97ec370a95eb55f10afa43f67539c942","src/database/mod.rs":"458e3c8af2af5345e02dea32b36f7521d4428c2ea65c225337008af56d00c6f6","src/debug.rs":"90158cc5d488ba67b60d06647e54e59a1d7bdeb906087e4fe4cfab4373c1cc6c","src/error.rs":"97172a791efdf8b791a04ae7961085fbef4391b313ff3ffb24e9381f2901fccc","src/error_recording.rs":"42af60683cb30eba821b955fe156ce43a114c0f6f3f3b5b84566659398137671","src/event_database/mod.rs":"95d665a039236ede25dd479b19f0ddc32c0dd79cef2fbcc2ef3bab1540680276","src/histogram/exponential.rs":"389d48bab03f7229445ee4d4c8a4c49f6b43303f658dc954da75142f3c040dc6","src/histogram/functional.rs":"1a63a305b48bcef7bc38136b40d916df4bb8f098dc602514ada54a9b091f6951","src/histogram/linear.rs":"5642c8983c3c1ce9b69c6ac99133c8ed5e67abe2398c5dbcf67e69d66880f4ca","src/histogram/mod.rs":"11e5d3b6440a33a3e5544d0e03ffd69fa2fdcabe603ad75e0327f3ed548e8ce3","src/internal_metrics.rs":"5626effec67bf0f9ee12609b77cf04741eac1827123039999d4adb28a3cc5976","src/internal_pings.rs":"5ed4669b6f09d660401f44c8279e0a5fea0262e48de40e85595bd25dc70b05f3","src/lib.rs":"49f36f867e0412d514fdddee9c40d71e020dbc27fe0efebe6808d9a16872b986","src/lib_unit_tests.rs":"17b0eaad81f946ddef89ee076f4d138e427638ee7536be128b30d4e7280dcf7b","src/macros.rs":"3f3fc8c36dd05b7528b66b27e95b6494505a7a1f48abd013218de23ada6b5a43","src/metrics/boolean.rs":"49e2f5be78055f61543db1d4d57cc06064a812a8f45c9d0e753df8325edc9041","src/metrics/counter.rs":"e3e2a195b597ea1559991b992f44a8a5f291b592a5c6946e93e01066f276efbb","src/metrics/custom_distribution.rs":"7ea1c54802e15bb490fdc8b396998ec474bfca2f135902a4028a9530fbb5dd98","src/metrics/datetime.rs":"75f0b7c41301eb881decff363947510a6cc1a9d2203357be32d1ee169c22ff4c","src/metrics/denominator.rs":"511e4123779a6d9159bb0911069f7dcb979899a0fae0d200da854685b59d3348","src/metrics/event.rs":"d6e4a52dbde7fbd44c21df567508c35acf046e08c6ea593bbb65fa25223a2b40","src/metrics/experiment.rs":"3f3ede015bb63fd5f71fc6a90421b25d8002faf71c0766b27bf59b5ae8b8d0da","src/metrics/jwe.rs":"8e1c2e204c285a428cf58f0e7d7ee0662294208b6b48706658a6f44cf412575a","src/metrics/labeled.rs":"e77459b593b2b6b375a1dacb1c9192fb47dcb5a294935c2c30aeea8e6f5432cd","src/metrics/memory_distribution.rs":"c2d75dfe9f67a21087b36af64816e703e6b56551b970fac642552116af97f2b5","src/metrics/memory_unit.rs":"d7a678e5242febd021283b30c0099a9e62729944816a3f17d2d91e2808bc0570","src/metrics/mod.rs":"069b6790de4abcaeb8ec06797a1e85344baff6b86844508b2d75d67eb00dc5d5","src/metrics/ping.rs":"b9d344cbfdbe8aff99a83423bd0af465a7228b503f92fe912ddac24904f4eca9","src/metrics/quantity.rs":"2eb6e34f7b0a292df26cddb4295bca7b82557320eff157bf854822c4a7fccb7e","src/metrics/rate.rs":"ba297a593d340568ee1f8061a6ba4f8970220ab2a83c7af290393538c6dd9bc4","src/metrics/string.rs":"8b47de25d4354c9ccf71a5558b287241a4d80c5832ac82e280543bb800996f54","src/metrics/string_list.rs":"c956616cfd1d0fce3c2e61f0b054235f455db2295d128f08b3db2ddcdd11bdbe","src/metrics/time_unit.rs":"9bb3f6c03b1d385008b254f36ed35daf22f9a6fa2d18e007c9b70aac767cde50","src/metrics/timespan.rs":"1252babc991f8c79cbd5027f3a332c28eb63fb0a956d19a18c670ab4f2e60ba3","src/metrics/timing_distribution.rs":"b885514ef2e84c970403f85bcdb09a24abf9822dbd78129fba9d37de388520a8","src/metrics/url.rs":"b83b1de16d2397fa31e52855ccc024a050c0b429af8ffb3ff1519b68b923241d","src/metrics/uuid.rs":"ebe5560fcc76b230d304172f0ab69dc3f5e41924dad8aa30090bd38b103d0ade","src/ping/mod.rs":"0d164c2ec2822658d571356f3d00f24410f9c1e63f31101fc5d0fb20a014ee1b","src/scheduler.rs":"829846308ae9ed558fbaa62e8134ec90571803673d304c8ce370de7117e1cc76","src/storage/mod.rs":"265e0ff9f3b769f6167afd6e498760c0505fe8431f52fb84f377b20b2b15670e","src/system.rs":"2e2a7436075bd1a34c118202a4d18e58236947696ce3d824e97d9c06ddf0c171","src/traits/boolean.rs":"f17f16f379b777e435e38e810e25336a919f4aeeefb1b4e7cf7749c0ef173fd9","src/traits/counter.rs":"631208036059d498a4485c74c2a80c24a5f13bffeb1053bdf5cce06af0e9d361","src/traits/custom_distribution.rs":"1b3ffda6e857bfa8ad5be412e88f3d9706ededf5a86407364ae19a81f06ef798","src/traits/datetime.rs":"2f4b9e64161c15c912b6a915045dd9840f76229d144a4d1542c54eb4f3b3406b","src/traits/event.rs":"ce9a9395748734b241f35b31c4cddf0ce6a8eca6d700aaeea427b0ae29ce507d","src/traits/jwe.rs":"80cdc61e6d99d7c05139c9d05288290c731b1be61afcbd4a4c415973665ea194","src/traits/labeled.rs":"7f3281fc0a1a745238e7e260463f397dfa61717408fe9d260dc9767d9c659e52","src/traits/memory_distribution.rs":"0b72ffde68eb97f01a57afbc5c6109565ec9435561984d34696622bf5a57d559","src/traits/mod.rs":"88cec83fcff8dfab768953b901ee95fed186f7540afdc9606407aff71f1919df","src/traits/numerator.rs":"9690a1b4487521565bd488e9a938aa66f93045c63f0f0ee6e864e0341395659b","src/traits/ping.rs":"8831c106c03afeb458b0b028fa1ce61f056ebf8e82bc0a171a1bff255d920748","src/traits/quantity.rs":"087d7a4b58f0eb7c766a0202dcf38a52d172ce4edf626211ffe5d94ed02ae754","src/traits/rate.rs":"9d0da25895d4c43cdece43dd57e515ab2fb907e8c9a239807976e3d9197d2955","src/traits/string.rs":"48e5623c7db59b8e6454fbc7fb6e2395f808c9a0fa721d7c07b72abb171eb1ad","src/traits/string_list.rs":"5d5773d5a130323dd82ca95f4ecdccdd6b237afe2eadf8655363bd6b7e8508c1","src/traits/timespan.rs":"29251233847c5cdd200a61472132c62ded27fe2c13835b09424384bf144d82db","src/traits/timing_distribution.rs":"5e619d445e6ef3f19ca69bcdfe02d19b150c5a46855d195703b6d2f55e538636","src/traits/url.rs":"a01331623af4fa8af6e71becffff60060832bef5e48a15df6dc23b41225f689e","src/traits/uuid.rs":"bd78515611ba406d8b1bda35a9fe30c317512a9afcea7c5dece8fced7d410a92","src/upload/directory.rs":"571cfee0347b40b239d0d946625de6265bbea4f433c8316da715ded8f590aca1","src/upload/mod.rs":"34bcb67a5980e2c8b5145553b83e130ed4db40dab6d5c53bc9978469e6b93223","src/upload/policy.rs":"c250957a37783e74af8002cd80ba06ef9780a389fb0f61b8b665b79688f0a360","src/upload/request.rs":"7939e77bde4b55263446c3660b6831bafa27308bc983a51e1679321e962f372f","src/upload/result.rs":"d73454e81f185e4e28c887f7b496bffad7baac74c8f1b719885f940f909a530d","src/util.rs":"a89e21f0f4fe14a5a1a5369a0f2c20d1184816ccfe2b5b1599d3779660772f27","tests/boolean.rs":"9f4830f3b5f5ab6768060917deb1f546324a4744b8ed893197e31a0aed092947","tests/common/mod.rs":"28c77637c5e75a6a57c0aeb4b082de1b5d8015d507b557ca365aa5adbf208af8","tests/counter.rs":"39a2cd40335c164b3e7407f5505bbf571d7e4a71f032d476a7939f7dd1af90d0","tests/custom_distribution.rs":"596575504ad4eab2765b5b88245dcc92dc68e83d04c93deb4b27692c142c0b94","tests/datetime.rs":"4b4ab629a0f0ae789416b67f0efdfe1142fdb18f9d3a0b5182d8d840e4a6655c","tests/event.rs":"cb78dfc0a2315253da8ef6663b81979dd5b0638bb6c31456f16ce4e9bb50c67a","tests/jwe.rs":"dc8a73d1e1925ac49061e8bb5c8de01230aa364942a22470e37aa88965b0eaba","tests/labeled.rs":"cedd548bd8089dfa316cfdfaa1985fb5cd1294e6ba5956b6012c3f01975e8de9","tests/memory_distribution.rs":"0c03d0a491150f508dc12ecac7e5db70043f3a7de2f90cc6b3509aba90549821","tests/metrics.rs":"0560e0645321628015610bbf1a90c0adbb12ad42e5a068399073572120377cbb","tests/ping.rs":"a15c619b2d3c70c3cb669d02b959109bcf231440bdcfe3cac7508a3e310cd181","tests/ping_maker.rs":"aa7921c9dcea278003c719136eeea9b711d0be12bf736cc9a79b70b69cf6109f","tests/quantity.rs":"2543f0f57085d27b0bc0c25c24c17a7e376ac673cf9265a3a9dec202920679c5","tests/storage.rs":"d8d50aba92e17a3053fd80788f5fbbcc8f82293c11c19b58e2de6c4ee45f71ff","tests/string.rs":"9c3e21bfa3ad0b75373f8f5addb8ac023ac5336ac9f969e92b89ea6fda675fdd","tests/string_list.rs":"2b83710b949bea4bd0f6b2029069887f3ea87312b00091e5aa3c7bda0fb9073c","tests/timespan.rs":"bb61e4cfb843b3f387378409ee1a88ef4b8f32b2181af686baacee262b8bca2b","tests/timing_distribution.rs":"23f48e26cc4a9646c77a395fe724fa1c337caa69ea5c358056057cb1bbf4c7e6","tests/uuid.rs":"cf0df9e330344c6e00cd51faaf21dc74c5e47f892b525e0f83623c92a6378be8"},"package":"349ebbb162d58911547b48e5fbf90d45854e3e1ba03332f41b80a6611867c013"} +\ No newline at end of file +diff --git a/third_party/rust/glean-core/Cargo.lock b/third_party/rust/glean-core/Cargo.lock +--- a/third_party/rust/glean-core/Cargo.lock ++++ b/third_party/rust/glean-core/Cargo.lock +@@ -54,9 +54,9 @@ + + [[package]] + name = "cc" +-version = "1.0.71" ++version = "1.0.72" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" ++checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" + + [[package]] + name = "cfg-if" +@@ -80,9 +80,9 @@ + + [[package]] + name = "crc32fast" +-version = "1.2.1" ++version = "1.3.0" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" ++checksum = "738c290dfaea84fc1ca15ad9c168d083b05a714e1efddd8edaab678dc28d2836" + dependencies = [ + "cfg-if", + ] +@@ -154,7 +154,7 @@ + + [[package]] + name = "glean-core" +-version = "42.1.0" ++version = "42.3.0" + dependencies = [ + "bincode", + "chrono", +@@ -208,9 +208,9 @@ + + [[package]] + name = "iso8601" +-version = "0.4.0" ++version = "0.4.1" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "cee08a007a59a8adfc96f69738ddf59e374888dfd84b49c4b916543067644d58" ++checksum = "0a59a3f2be6271b2a844cd0dd13bf8ccc88a9540482d872c7ce58ab1c4db9fab" + dependencies = [ + "nom", + ] +@@ -229,9 +229,9 @@ + + [[package]] + name = "libc" +-version = "0.2.104" ++version = "0.2.109" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "7b2f96d100e1cf1929e7719b7edb3b90ab5298072638fccd77be9ce942ecdfce" ++checksum = "f98a04dce437184842841303488f70d0188c5f51437d2a834dc097eafa909a01" + + [[package]] + name = "lmdb-rkv" +@@ -278,6 +278,12 @@ + checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" + + [[package]] ++name = "minimal-lexical" ++version = "0.2.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" ++ ++[[package]] + name = "miniz_oxide" + version = "0.4.4" + source = "registry+https://github.com/rust-lang/crates.io-index" +@@ -289,11 +295,12 @@ + + [[package]] + name = "nom" +-version = "5.1.2" ++version = "7.1.0" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" ++checksum = "1b1d11e1ef389c76fe5b81bcaf2ea32cf88b62bc494e19f493d0b30e7a930109" + dependencies = [ + "memchr", ++ "minimal-lexical", + "version_check", + ] + +@@ -358,15 +365,15 @@ + + [[package]] + name = "pkg-config" +-version = "0.3.20" ++version = "0.3.23" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "7c9b1041b4387893b91ee6746cddfc28516aff326a3519fb2adf820932c5e6cb" ++checksum = "d1a3ea4f0dd7f1f3e512cf97bf100819aa547f36a6eccac8dbaae839eb92363e" + + [[package]] + name = "ppv-lite86" +-version = "0.2.14" ++version = "0.2.15" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "c3ca011bd0129ff4ae15cd04c4eef202cadf6c51c21e47aba319b4e0501db741" ++checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" + + [[package]] + name = "proc-macro-hack" +@@ -376,9 +383,9 @@ + + [[package]] + name = "proc-macro2" +-version = "1.0.30" ++version = "1.0.33" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "edc3358ebc67bc8b7fa0c007f945b0b18226f78437d61bec735a9eb96b61ee70" ++checksum = "fb37d2df5df740e582f28f8560cf425f52bb267d872fe58358eadb554909f07a" + dependencies = [ + "unicode-xid", + ] +@@ -475,9 +482,9 @@ + + [[package]] + name = "ryu" +-version = "1.0.5" ++version = "1.0.6" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" ++checksum = "3c9613b5a66ab9ba26415184cfc41156594925a9cf3a2057e57f31ff145f6568" + + [[package]] + name = "serde" +@@ -501,9 +508,9 @@ + + [[package]] + name = "serde_json" +-version = "1.0.68" ++version = "1.0.72" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" ++checksum = "d0ffa0837f2dfa6fb90868c2b5468cad482e175f7dad97e7421951e663f2b527" + dependencies = [ + "itoa", + "ryu", +@@ -512,9 +519,9 @@ + + [[package]] + name = "syn" +-version = "1.0.80" ++version = "1.0.82" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194" ++checksum = "8daf5dd0bb60cbd4137b1b587d2fc0ae729bc07cf01cd70b36a1ed5ade3b9d59" + dependencies = [ + "proc-macro2", + "quote", +@@ -576,9 +583,9 @@ + + [[package]] + name = "tinyvec" +-version = "1.5.0" ++version = "1.5.1" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "f83b2a3d4d9091d0abd7eba4dc2710b1718583bd4d8992e2190720ea38f391f7" ++checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" + dependencies = [ + "tinyvec_macros", + ] +diff --git a/third_party/rust/glean-core/Cargo.toml b/third_party/rust/glean-core/Cargo.toml +--- a/third_party/rust/glean-core/Cargo.toml ++++ b/third_party/rust/glean-core/Cargo.toml +@@ -12,7 +12,7 @@ + [package] + edition = "2018" + name = "glean-core" +-version = "42.1.0" ++version = "42.3.0" + authors = ["Jan-Erik Rediger ", "The Glean Team "] + include = ["/README.md", "/LICENSE", "/src", "/examples", "/tests", "/Cargo.toml"] + description = "A modern Telemetry library" +@@ -21,7 +21,7 @@ + license = "MPL-2.0" + repository = "https://github.com/mozilla/glean" + [package.metadata.glean] +-glean-parser = "4.2.0" ++glean-parser = "4.3.1" + [dependencies.bincode] + version = "1.2.1" + +diff --git a/third_party/rust/glean-core/src/debug.rs b/third_party/rust/glean-core/src/debug.rs +--- a/third_party/rust/glean-core/src/debug.rs ++++ b/third_party/rust/glean-core/src/debug.rs +@@ -234,7 +234,7 @@ + return false; + } + +- tags.iter().all(|x| validate_tag(x)) ++ tags.iter().all(validate_tag) + } + + #[cfg(test)] +diff --git a/third_party/rust/glean-core/src/metrics/labeled.rs b/third_party/rust/glean-core/src/metrics/labeled.rs +--- a/third_party/rust/glean-core/src/metrics/labeled.rs ++++ b/third_party/rust/glean-core/src/metrics/labeled.rs +@@ -182,8 +182,7 @@ + + /// Strips the label off of a complete identifier + pub fn strip_label(identifier: &str) -> &str { +- // safe unwrap, first field of a split always valid +- identifier.splitn(2, '/').next().unwrap() ++ identifier.split_once('/').map_or(identifier, |s| s.0) + } + + /// Validates a dynamic label, changing it to `OTHER_LABEL` if it's invalid. +diff --git a/third_party/rust/glean-core/src/storage/mod.rs b/third_party/rust/glean-core/src/storage/mod.rs +--- a/third_party/rust/glean-core/src/storage/mod.rs ++++ b/third_party/rust/glean-core/src/storage/mod.rs +@@ -203,7 +203,7 @@ + let mut snapshotter = |metric_id: &[u8], metric: &Metric| { + let metric_id = String::from_utf8_lossy(metric_id).into_owned(); + if metric_id.ends_with("#experiment") { +- let name = metric_id.splitn(2, '#').next().unwrap(); // safe unwrap, first field of a split always valid ++ let (name, _) = metric_id.split_once('#').unwrap(); // safe unwrap, we ensured there's a `#` in the string + snapshot.insert(name.to_string(), metric.as_json()); + } + }; +diff --git a/third_party/rust/glean-ffi/.cargo-checksum.json b/third_party/rust/glean-ffi/.cargo-checksum.json +--- a/third_party/rust/glean-ffi/.cargo-checksum.json ++++ b/third_party/rust/glean-ffi/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"36b60da27ddb5d5cdada09162dff4c147caa0edf9406eb23b44e1730e8ac2372","LICENSE":"1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5","README.md":"bfe00cc2501c9b15d5bc463c6db30ebbf8d7b5d6c555cf3827ae529fc9e7d6cc","cbindgen.toml":"ac25d1bc2ab7d6afaf25cfa0d35233f93b01f7129088cdd1fa89b9d987a8c564","glean.h":"bbe571147f9fee34f7deac1057c541f00523317328e591446d4c96bbe84c99eb","src/boolean.rs":"0d1d59d0c13cdb63592a9513f2abcf3d1a8260d6523cc7d1af40cfcb4c75572a","src/byte_buffer.rs":"eeb6df25da7b393517f0c993e1e99a0acbccd7678b1127ce0e471d0e53a4bb45","src/counter.rs":"4d8f41285e4a9dbfa2733cdf937905006b475c0af7a501df73fde4ca77818e82","src/custom_distribution.rs":"b0b3b23289e413e7d150e8dae8217e6bd409cbbab68abb127f146041bcbfaf45","src/datetime.rs":"a5c1c993605b1a8ff044d88de4f4a385aff1a781cb8cb45573b90882da801fae","src/event.rs":"ef6dd4f0493ae223e4f7091d5779e46b33ea9864c2a4e5953811a7d9e8884c32","src/fd_logger.rs":"0f8197bb086f49413cca30a72bae029f663842fc3b78ceef6d0854a070b1cdfd","src/ffi_string_ext.rs":"389ae94dcdace1f56ca2c87207e865edda6d42da45733f1027e0a4dcfa86c492","src/from_raw.rs":"b17515a58d7e303ee746ea54c1c1c6d0523dc4de0bd8157dfaba2a610da637bb","src/handlemap_ext.rs":"3b1b088a2de197a0c3eaae0f2f0915d53602f51c13d27f48297f52cd885d5abc","src/jwe.rs":"72adff64900ca16d6527e8d6a436ac2ba85f738d6e92e33f3d71df32b485d0c3","src/labeled.rs":"9cc706511961dbe62350d62b39e9b2c3a9c9e9f53d5577274e273c0f826cd8c3","src/lib.rs":"b5bee8a36a3d0e32eaa01caad0ca57f8649b61b0f99cd3df1f697c27ec9fc47a","src/macros.rs":"e11614edb156552617354d7f6120c8e60ffeb6632ebc19d2b7c6c3e88523b01b","src/memory_distribution.rs":"08ef15e340f2e7ab2f4f83cd8e883c864d4affb94458e80198c106393bfb6bd8","src/ping_type.rs":"6401bcf4342ec1e4ba3782e2b67b3320aa96c9eddc03fc3c75ecc54e2f08a619","src/quantity.rs":"f72781ea642b5f7e363e9fecaded143d1afd772575603763543f1df3448ec337","src/string.rs":"199a238f3524eb36643d82b63df5c7f013adedb6af80632a2675f8562f34e692","src/string_list.rs":"12e2fbbdc08a1b8da1885fb14acd59ab27c8b598a24dc15a4eaca16636540a54","src/timespan.rs":"b7ac51dbfd5169d8c688c3fd2db51e38b6173c925ca14d7b0e8353f225b30a50","src/timing_distribution.rs":"4b5962729fb0b4c9ebf65a5fc5af105357652fcc282c6f8840f328452ba86ac6","src/upload.rs":"320c6e97df0a87040d2a269765401cd67da50f0a226c95a9a314f22452116f7c","src/url.rs":"2dfaf006cd4024ee07eb37dc312201b027d774f6c9881e556774cc09077a6290","src/uuid.rs":"c9ea7225fac53b55a8aeef39cd33470228c0a178185aa74b8fa652657994e404","src/weak.rs":"0199f4ef38d667f0b9f8ef3c5505ff15cd6e911bc83c27e7e9954fdffe1be0bb"},"package":"26738a3a19d212595c76a765b3e29fc9a0e1c5e7d15a8352ac94ec8536b65cd5"} +\ No newline at end of file ++{"files":{"Cargo.toml":"2592f1c0a12f24250790a516f0c194543afa412205dab039dcbb9c5faba5e00e","LICENSE":"1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5","README.md":"bfe00cc2501c9b15d5bc463c6db30ebbf8d7b5d6c555cf3827ae529fc9e7d6cc","cbindgen.toml":"ac25d1bc2ab7d6afaf25cfa0d35233f93b01f7129088cdd1fa89b9d987a8c564","glean.h":"bbe571147f9fee34f7deac1057c541f00523317328e591446d4c96bbe84c99eb","src/boolean.rs":"0d1d59d0c13cdb63592a9513f2abcf3d1a8260d6523cc7d1af40cfcb4c75572a","src/byte_buffer.rs":"eeb6df25da7b393517f0c993e1e99a0acbccd7678b1127ce0e471d0e53a4bb45","src/counter.rs":"4d8f41285e4a9dbfa2733cdf937905006b475c0af7a501df73fde4ca77818e82","src/custom_distribution.rs":"b0b3b23289e413e7d150e8dae8217e6bd409cbbab68abb127f146041bcbfaf45","src/datetime.rs":"a5c1c993605b1a8ff044d88de4f4a385aff1a781cb8cb45573b90882da801fae","src/event.rs":"ef6dd4f0493ae223e4f7091d5779e46b33ea9864c2a4e5953811a7d9e8884c32","src/fd_logger.rs":"0f8197bb086f49413cca30a72bae029f663842fc3b78ceef6d0854a070b1cdfd","src/ffi_string_ext.rs":"389ae94dcdace1f56ca2c87207e865edda6d42da45733f1027e0a4dcfa86c492","src/from_raw.rs":"b17515a58d7e303ee746ea54c1c1c6d0523dc4de0bd8157dfaba2a610da637bb","src/handlemap_ext.rs":"3b1b088a2de197a0c3eaae0f2f0915d53602f51c13d27f48297f52cd885d5abc","src/jwe.rs":"72adff64900ca16d6527e8d6a436ac2ba85f738d6e92e33f3d71df32b485d0c3","src/labeled.rs":"9cc706511961dbe62350d62b39e9b2c3a9c9e9f53d5577274e273c0f826cd8c3","src/lib.rs":"b5bee8a36a3d0e32eaa01caad0ca57f8649b61b0f99cd3df1f697c27ec9fc47a","src/macros.rs":"e11614edb156552617354d7f6120c8e60ffeb6632ebc19d2b7c6c3e88523b01b","src/memory_distribution.rs":"08ef15e340f2e7ab2f4f83cd8e883c864d4affb94458e80198c106393bfb6bd8","src/ping_type.rs":"6401bcf4342ec1e4ba3782e2b67b3320aa96c9eddc03fc3c75ecc54e2f08a619","src/quantity.rs":"f72781ea642b5f7e363e9fecaded143d1afd772575603763543f1df3448ec337","src/string.rs":"199a238f3524eb36643d82b63df5c7f013adedb6af80632a2675f8562f34e692","src/string_list.rs":"12e2fbbdc08a1b8da1885fb14acd59ab27c8b598a24dc15a4eaca16636540a54","src/timespan.rs":"b7ac51dbfd5169d8c688c3fd2db51e38b6173c925ca14d7b0e8353f225b30a50","src/timing_distribution.rs":"4b5962729fb0b4c9ebf65a5fc5af105357652fcc282c6f8840f328452ba86ac6","src/upload.rs":"320c6e97df0a87040d2a269765401cd67da50f0a226c95a9a314f22452116f7c","src/url.rs":"2dfaf006cd4024ee07eb37dc312201b027d774f6c9881e556774cc09077a6290","src/uuid.rs":"c9ea7225fac53b55a8aeef39cd33470228c0a178185aa74b8fa652657994e404","src/weak.rs":"0199f4ef38d667f0b9f8ef3c5505ff15cd6e911bc83c27e7e9954fdffe1be0bb"},"package":"9e29c3f0b9dbde127254f375499df382d5fa9c3c2b33bfcb393485876fe79fb2"} +\ No newline at end of file +diff --git a/third_party/rust/glean-ffi/Cargo.toml b/third_party/rust/glean-ffi/Cargo.toml +--- a/third_party/rust/glean-ffi/Cargo.toml ++++ b/third_party/rust/glean-ffi/Cargo.toml +@@ -12,7 +12,7 @@ + [package] + edition = "2018" + name = "glean-ffi" +-version = "42.1.0" ++version = "42.3.0" + authors = ["Jan-Erik Rediger ", "The Glean Team "] + include = ["/README.md", "/LICENSE", "/src", "/tests", "/Cargo.toml", "/cbindgen.toml", "/glean.h"] + description = "FFI layer for Glean, a modern Telemetry library" +@@ -28,7 +28,7 @@ + version = "0.4.0" + + [dependencies.glean-core] +-version = "42.1.0" ++version = "42.3.0" + + [dependencies.log] + version = "0.4.8" +diff --git a/third_party/rust/glean/.cargo-checksum.json b/third_party/rust/glean/.cargo-checksum.json +--- a/third_party/rust/glean/.cargo-checksum.json ++++ b/third_party/rust/glean/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"c2a549ca03146a345f13ce7e8dd498f9532bab9e0ef90669d257479a81b98fe9","LICENSE":"1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5","README.md":"fd9e0ca6907917ea6bec5de05e15dd21d20fae1cb7f3250467bb20231a8e1065","src/common_test.rs":"bd7ab2f6384bea8971f97ba68b11c946899303891bc534898f7aabbf27f9008a","src/configuration.rs":"4acbedba16d45f6404ccedde86e8aa33eea8c1b9554210cb69c79ff2ec9040c9","src/core_metrics.rs":"0593192ec0fa1b4d267411cdfb75c70f78578083eca91f6e09cd08346de32264","src/dispatcher/global.rs":"460ccfec311163b469c54f63f4cb41e057b93421ccb7675e435c2994d478cd4b","src/dispatcher/mod.rs":"9f59e466fbbcc3e1bdc42659822a2a2c4b8250456858ee885e53b16458f4a47e","src/glean_metrics.rs":"151b6e5acc12436c33c75e2e0a18f9769179d3c7fdc60a22fa02afb76feaf00f","src/lib.rs":"f663c617f655e0b24dfc8bcb77659a209e8d2440c71ff2477f8b2d2b520fff17","src/net/http_uploader.rs":"9e8c1837ca0d3f6ea165ec936ab054173c4fe95a958710176c33b4d4d1d98beb","src/net/mod.rs":"284bcf182156c52ea25fa33bcc48d80b4970ee3c187a4ea3a06602cc34c710bf","src/pings.rs":"2dfccd84848e1933aa4f6a7a707c58ec794c8f73ef2d93ea4d4df71d4e6abc31","src/private/boolean.rs":"eeadc0529e2c69a930479f208746799b064b27facab8306c1c10c650e83fb63c","src/private/counter.rs":"0bc8a2d0df72e47b7365ff80bfc16427a5da701fd0adadeedbcce13cebcd79ce","src/private/custom_distribution.rs":"6d1271fb91e9d51a8dcf5eb9d540b3757ebe9cc998b196943ed8c729f62afc67","src/private/datetime.rs":"cb8f26f74d318e2118d6ae1b15972557eb205d4d8b24795fb0d08fdea2bc3f56","src/private/denominator.rs":"95332737f3ac80346f4811440a2141cd427692819bd04d5d3ac7374299dc20b0","src/private/event.rs":"b674ceb85351b7989bd25ed4f5d98c5c9b31e2a03f13b054a8c0dbef54190e49","src/private/labeled.rs":"2cd90d132954ee3ada43ff1ad538072ba43eece7a53ed89811a2a7b43a4819f1","src/private/memory_distribution.rs":"8b78a0e33601081d76639445c8b4875a4fe7c3aded720bb43afdabe86e0fd6ee","src/private/mod.rs":"63368b123fecb6de210ec634b8d387799b4b9dd960016335ebc3c6851e81628f","src/private/numerator.rs":"334ac2ad3d8dd7b9f02f1ca5391b683d50fbc8c6728a12882a68bb067604c800","src/private/ping.rs":"915fc42994e0929656daee5511946ac1f56fe0d4d704e97e13795771d9890180","src/private/quantity.rs":"528675cd388010b89e6ac23c9152701c78d32c2dcd0b5e9abf1a50a52ee818a5","src/private/rate.rs":"7ddfdb3d5f2d1887b378caa3769ade92ea0fbd193f6e760f5f383c8b3e9f3aff","src/private/recorded_experiment_data.rs":"66b2601902a2dc2b7a283717c21ce754de94fcca30d12e0398195c8ad49c90af","src/private/string.rs":"c85ded40b1409793ae5b78da692bc2e708f8d55defb76ec5f515096d32f206c9","src/private/string_list.rs":"472ad79fba4b9bcde0ff5b3e05fd8e0aaa3d1d2941fc181faf2ceb90f1d518bd","src/private/timespan.rs":"19ed08aa5103b685a3a0b9f06f2c60250d55f3c8f36337f8c7bdbb2dfdb92786","src/private/timing_distribution.rs":"ee7fa0c3d5427e371b5413373cb1f5841ac10df9b7ca08316ef724e7ad3591d9","src/private/url.rs":"223de8a025e2f749255103402eecb5582961c2b5af7492e294362a0e8f55c414","src/private/uuid.rs":"2b69ddaf3978aaa31c625c0f3eb948c44369744334aacc6b5a2b217268d244a7","src/system.rs":"ff23a5b94f52dab484342dfed702412bc29ab1bbfd5af326033d8e07e7b9075f","src/test.rs":"0cbe4f51fa01b1ca04e4b726e8eb729c3504086bc6b0d644e2114a5a4473165a","tests/common/mod.rs":"4837df2e771929cc077e6fb9a9239645e8e0f7bc6c9f409b71c4d147edf334fc","tests/init_fails.rs":"1e832fe454962ddb1155d546bb71b6395aa9936f848ff0fbe88affaaab7dfae3","tests/never_init.rs":"1f33b8ce7ca3514b57b48cc16d98408974c85cf8aa7d13257ffc2ad878ebb295","tests/no_time_to_init.rs":"4d61e4196d8eef23f3bcb24b59bd0b0379c1f2cb50f03434a53996ab097bfb17","tests/overflowing_preinit.rs":"81ff97745789fd5f58f86364488c011b4503648f1366b12e26755edc54323150","tests/persist_ping_lifetime.rs":"adfab91baf978f464e265eae828fcc03aa6eef83422d3918ffb680b2c2ec859e","tests/persist_ping_lifetime_nopanic.rs":"92f4739b21c0d46cb368eafea43bfb822d8dee96412d5f4fc32e01636f0cf244","tests/schema.rs":"621caef0cc7f98c79740422835485fea2343ca105d0d9a7eec6ded9cfad6232c","tests/simple.rs":"2f58d3ff90005231f2febd21f66ee41d06302618408ea990b446510449c3444f"},"package":"af977f3ee276d391cbf940639a5b95378c2b0031d5624c019142d286be4a1a21"} +\ No newline at end of file ++{"files":{"Cargo.toml":"8f777d1de11f0143f451977e300df83a66fef432819f377c2378710791fdec53","LICENSE":"1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5","README.md":"fd9e0ca6907917ea6bec5de05e15dd21d20fae1cb7f3250467bb20231a8e1065","src/common_test.rs":"bd7ab2f6384bea8971f97ba68b11c946899303891bc534898f7aabbf27f9008a","src/configuration.rs":"4acbedba16d45f6404ccedde86e8aa33eea8c1b9554210cb69c79ff2ec9040c9","src/core_metrics.rs":"0593192ec0fa1b4d267411cdfb75c70f78578083eca91f6e09cd08346de32264","src/dispatcher/global.rs":"460ccfec311163b469c54f63f4cb41e057b93421ccb7675e435c2994d478cd4b","src/dispatcher/mod.rs":"9f59e466fbbcc3e1bdc42659822a2a2c4b8250456858ee885e53b16458f4a47e","src/glean_metrics.rs":"d376e4f40ec620ce31667451a78adc1146213016e100c0d457505ec240ab31bf","src/lib.rs":"5ecf8102426bbfbd941a7e19bb79a65485a90d9842783a1940c42ebdec61e183","src/net/http_uploader.rs":"9e8c1837ca0d3f6ea165ec936ab054173c4fe95a958710176c33b4d4d1d98beb","src/net/mod.rs":"284bcf182156c52ea25fa33bcc48d80b4970ee3c187a4ea3a06602cc34c710bf","src/pings.rs":"02a3ddb4e77d2033fb5a8fc9bbec09ad5500691e0bd2a1db334805cba88670fd","src/private/boolean.rs":"eeadc0529e2c69a930479f208746799b064b27facab8306c1c10c650e83fb63c","src/private/counter.rs":"0bc8a2d0df72e47b7365ff80bfc16427a5da701fd0adadeedbcce13cebcd79ce","src/private/custom_distribution.rs":"6d1271fb91e9d51a8dcf5eb9d540b3757ebe9cc998b196943ed8c729f62afc67","src/private/datetime.rs":"cb8f26f74d318e2118d6ae1b15972557eb205d4d8b24795fb0d08fdea2bc3f56","src/private/denominator.rs":"95332737f3ac80346f4811440a2141cd427692819bd04d5d3ac7374299dc20b0","src/private/event.rs":"b674ceb85351b7989bd25ed4f5d98c5c9b31e2a03f13b054a8c0dbef54190e49","src/private/labeled.rs":"2cd90d132954ee3ada43ff1ad538072ba43eece7a53ed89811a2a7b43a4819f1","src/private/memory_distribution.rs":"8b78a0e33601081d76639445c8b4875a4fe7c3aded720bb43afdabe86e0fd6ee","src/private/mod.rs":"63368b123fecb6de210ec634b8d387799b4b9dd960016335ebc3c6851e81628f","src/private/numerator.rs":"334ac2ad3d8dd7b9f02f1ca5391b683d50fbc8c6728a12882a68bb067604c800","src/private/ping.rs":"915fc42994e0929656daee5511946ac1f56fe0d4d704e97e13795771d9890180","src/private/quantity.rs":"528675cd388010b89e6ac23c9152701c78d32c2dcd0b5e9abf1a50a52ee818a5","src/private/rate.rs":"7ddfdb3d5f2d1887b378caa3769ade92ea0fbd193f6e760f5f383c8b3e9f3aff","src/private/recorded_experiment_data.rs":"66b2601902a2dc2b7a283717c21ce754de94fcca30d12e0398195c8ad49c90af","src/private/string.rs":"c85ded40b1409793ae5b78da692bc2e708f8d55defb76ec5f515096d32f206c9","src/private/string_list.rs":"472ad79fba4b9bcde0ff5b3e05fd8e0aaa3d1d2941fc181faf2ceb90f1d518bd","src/private/timespan.rs":"19ed08aa5103b685a3a0b9f06f2c60250d55f3c8f36337f8c7bdbb2dfdb92786","src/private/timing_distribution.rs":"ee7fa0c3d5427e371b5413373cb1f5841ac10df9b7ca08316ef724e7ad3591d9","src/private/url.rs":"223de8a025e2f749255103402eecb5582961c2b5af7492e294362a0e8f55c414","src/private/uuid.rs":"2b69ddaf3978aaa31c625c0f3eb948c44369744334aacc6b5a2b217268d244a7","src/system.rs":"ff23a5b94f52dab484342dfed702412bc29ab1bbfd5af326033d8e07e7b9075f","src/test.rs":"0cbe4f51fa01b1ca04e4b726e8eb729c3504086bc6b0d644e2114a5a4473165a","tests/common/mod.rs":"4837df2e771929cc077e6fb9a9239645e8e0f7bc6c9f409b71c4d147edf334fc","tests/init_fails.rs":"1e832fe454962ddb1155d546bb71b6395aa9936f848ff0fbe88affaaab7dfae3","tests/never_init.rs":"1f33b8ce7ca3514b57b48cc16d98408974c85cf8aa7d13257ffc2ad878ebb295","tests/no_time_to_init.rs":"4d61e4196d8eef23f3bcb24b59bd0b0379c1f2cb50f03434a53996ab097bfb17","tests/overflowing_preinit.rs":"be7e9a7984162da33f17a5edae29e1e07e5d0b27e8830f7f32bb238a7e788638","tests/persist_ping_lifetime.rs":"adfab91baf978f464e265eae828fcc03aa6eef83422d3918ffb680b2c2ec859e","tests/persist_ping_lifetime_nopanic.rs":"92f4739b21c0d46cb368eafea43bfb822d8dee96412d5f4fc32e01636f0cf244","tests/schema.rs":"621caef0cc7f98c79740422835485fea2343ca105d0d9a7eec6ded9cfad6232c","tests/simple.rs":"2f58d3ff90005231f2febd21f66ee41d06302618408ea990b446510449c3444f"},"package":"34d40d192d10509d941937248fe4594d47617abf34496686c809cfdb31ae8506"} +\ No newline at end of file +diff --git a/third_party/rust/glean/Cargo.toml b/third_party/rust/glean/Cargo.toml +--- a/third_party/rust/glean/Cargo.toml ++++ b/third_party/rust/glean/Cargo.toml +@@ -12,7 +12,7 @@ + [package] + edition = "2018" + name = "glean" +-version = "42.1.0" ++version = "42.3.0" + authors = ["Jan-Erik Rediger ", "The Glean Team "] + include = ["/README.md", "/LICENSE", "/src", "/tests", "/Cargo.toml"] + description = "Glean SDK Rust language bindings" +@@ -28,7 +28,7 @@ + version = "0.5" + + [dependencies.glean-core] +-version = "42.1.0" ++version = "42.3.0" + + [dependencies.inherent] + version = "0.1.4" +diff --git a/third_party/rust/glean/src/glean_metrics.rs b/third_party/rust/glean/src/glean_metrics.rs +--- a/third_party/rust/glean/src/glean_metrics.rs ++++ b/third_party/rust/glean/src/glean_metrics.rs +@@ -17,8 +17,8 @@ + #[allow(non_upper_case_globals)] + pub static preinit_tasks_overflow: Lazy = Lazy::new(|| { + CounterMetric::new(CommonMetricData { +- name: "glean.error".into(), +- category: "preinit_tasks_overflow".into(), ++ category: "glean.error".into(), ++ name: "preinit_tasks_overflow".into(), + send_in_pings: vec!["metrics".into()], + lifetime: Lifetime::Ping, + disabled: false, +diff --git a/third_party/rust/glean/src/lib.rs b/third_party/rust/glean/src/lib.rs +--- a/third_party/rust/glean/src/lib.rs ++++ b/third_party/rust/glean/src/lib.rs +@@ -566,7 +566,7 @@ + return false; + } + +- glean.submit_ping_by_name(ping, reason.as_deref()) ++ glean.submit_ping_by_name(ping, reason) + }); + + if submitted_ping { +diff --git a/third_party/rust/glean/src/pings.rs b/third_party/rust/glean/src/pings.rs +--- a/third_party/rust/glean/src/pings.rs ++++ b/third_party/rust/glean/src/pings.rs +@@ -44,7 +44,7 @@ + #[allow(non_upper_case_globals)] + pub static events: Lazy = Lazy::new(|| { + PingType::new( +- "metrics", ++ "events", + true, + false, + vec![ +diff --git a/third_party/rust/glean/tests/overflowing_preinit.rs b/third_party/rust/glean/tests/overflowing_preinit.rs +--- a/third_party/rust/glean/tests/overflowing_preinit.rs ++++ b/third_party/rust/glean/tests/overflowing_preinit.rs +@@ -37,8 +37,8 @@ + #[allow(non_upper_case_globals)] + pub static preinit_tasks_overflow: Lazy = Lazy::new(|| { + CounterMetric::new(CommonMetricData { +- name: "glean.error".into(), +- category: "preinit_tasks_overflow".into(), ++ category: "glean.error".into(), ++ name: "preinit_tasks_overflow".into(), + send_in_pings: vec!["metrics".into()], + lifetime: Lifetime::Ping, + disabled: false, +diff --git a/toolkit/components/glean/Cargo.toml b/toolkit/components/glean/Cargo.toml +--- a/toolkit/components/glean/Cargo.toml ++++ b/toolkit/components/glean/Cargo.toml +@@ -6,7 +6,7 @@ + license = "MPL-2.0" + + [dependencies] +-glean = { version = "42.1.0", features = ["rkv-safe-mode"] } ++glean = { version = "42.3.0", features = ["rkv-safe-mode"] } + # In theory we only need this for `target_os = "android"` builds. + # Cargo has the ability to do that with `[target.'cfg(target_os = "android")'.dependencies]`. + # However that seems to confuse `cbindgen` quite a lot; +@@ -15,7 +15,7 @@ + # So for now we unconditionally depend on it, but in the code we only `extern crate` it on Android builds. + # While `glean-ffi` is still built (I think it is), + # it's not linked into the final library. +-glean-ffi = "42.1.0" ++glean-ffi = "42.3.0" + log = "0.4" + nserror = { path = "../../../xpcom/rust/nserror" } + nsstring = { path = "../../../xpcom/rust/nsstring" } +diff --git a/toolkit/components/glean/api/Cargo.toml b/toolkit/components/glean/api/Cargo.toml +--- a/toolkit/components/glean/api/Cargo.toml ++++ b/toolkit/components/glean/api/Cargo.toml +@@ -8,7 +8,7 @@ + [dependencies] + bincode = "1.0" + chrono = "0.4.10" +-glean = "42.1.0" ++glean = "42.3.0" + inherent = "0.1.4" + log = "0.4" + nsstring = { path = "../../../../xpcom/rust/nsstring", optional = true } +diff --git a/toolkit/components/glean/docs/dev/updating_parser.md b/toolkit/components/glean/docs/dev/updating_parser.md +--- a/toolkit/components/glean/docs/dev/updating_parser.md ++++ b/toolkit/components/glean/docs/dev/updating_parser.md +@@ -5,14 +5,13 @@ + + [glean-parser]: https://pypi.org/project/glean-parser/ + +-To update the in-tree glean-parser run ++To update the in-tree glean-parser change the version in `third_party/python/requirements.in`, ++then run + + ``` +-./mach vendor python glean_parser==M.m.p ++./mach vendor python + ``` + +-where `M.m.p` is the version number, e.g. 1.28.0. +- + ```eval_rst + .. note:: + +diff --git a/toolkit/components/glean/docs/dev/updating_sdk.md b/toolkit/components/glean/docs/dev/updating_sdk.md +--- a/toolkit/components/glean/docs/dev/updating_sdk.md ++++ b/toolkit/components/glean/docs/dev/updating_sdk.md +@@ -12,6 +12,7 @@ + 2. Run `mach vendor rust`. + This fetches all dependencies and adds them to `third_pary/rust`. + 3. Update the version of `gleanVersion` in `build.gradle` to the same version. ++4. Update the version of `glean-sdk` in `build/mach_virtualenv_packages.txt`. + + ## Version mismatches of Rust dependencies + +diff --git a/toolkit/components/glean/tests/test_pings.yaml b/toolkit/components/glean/tests/test_pings.yaml +--- a/toolkit/components/glean/tests/test_pings.yaml ++++ b/toolkit/components/glean/tests/test_pings.yaml +@@ -23,6 +23,8 @@ + notification_emails: + - chutten@mozilla.com + - glean-team@mozilla.com ++ no_lint: ++ - REDUNDANT_PING + + test-ping: + description: | +@@ -36,3 +38,5 @@ + notification_emails: + - chutten@mozilla.com + - glean-team@mozilla.com ++ no_lint: ++ - REDUNDANT_PING + diff --git a/firefox-testing.patch b/firefox-testing.patch index 1a9ee13..d380b48 100644 --- a/firefox-testing.patch +++ b/firefox-testing.patch @@ -1,6 +1,6 @@ -diff -up firefox-91.0/docshell/base/crashtests/crashtests.list.testing firefox-91.0/docshell/base/crashtests/crashtests.list ---- firefox-91.0/docshell/base/crashtests/crashtests.list.testing 2021-08-04 20:02:32.000000000 +0200 -+++ firefox-91.0/docshell/base/crashtests/crashtests.list 2021-08-10 10:38:40.885587687 +0200 +diff -up firefox-96.0.1/docshell/base/crashtests/crashtests.list.testing firefox-96.0.1/docshell/base/crashtests/crashtests.list +--- firefox-96.0.1/docshell/base/crashtests/crashtests.list.testing 2022-01-13 20:26:02.000000000 +0100 ++++ firefox-96.0.1/docshell/base/crashtests/crashtests.list 2022-01-18 10:42:02.642971427 +0100 @@ -13,7 +13,6 @@ load 614499-1.html load 678872-1.html skip-if(Android) pref(dom.disable_open_during_load,false) load 914521.html # Android bug 1584562 @@ -9,9 +9,9 @@ diff -up firefox-91.0/docshell/base/crashtests/crashtests.list.testing firefox-9 load 1341657.html load 1584467.html load 1614211-1.html -diff -up firefox-91.0/dom/media/tests/crashtests/crashtests.list.testing firefox-91.0/dom/media/tests/crashtests/crashtests.list ---- firefox-91.0/dom/media/tests/crashtests/crashtests.list.testing 2021-08-04 20:02:33.000000000 +0200 -+++ firefox-91.0/dom/media/tests/crashtests/crashtests.list 2021-08-10 10:38:40.885587687 +0200 +diff -up firefox-96.0.1/dom/media/tests/crashtests/crashtests.list.testing firefox-96.0.1/dom/media/tests/crashtests/crashtests.list +--- firefox-96.0.1/dom/media/tests/crashtests/crashtests.list.testing 2022-01-13 20:26:03.000000000 +0100 ++++ firefox-96.0.1/dom/media/tests/crashtests/crashtests.list 2022-01-18 10:42:02.642971427 +0100 @@ -25,7 +25,6 @@ asserts-if(Android,0-1) pref(browser.lin load 1443212.html asserts-if(Android,0-2) load 1453030.html @@ -20,10 +20,10 @@ diff -up firefox-91.0/dom/media/tests/crashtests/crashtests.list.testing firefox load 1505957.html load 1509442.html load 1511130.html -diff -up firefox-91.0/testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py.testing firefox-91.0/testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py ---- firefox-91.0/testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py.testing 2021-08-04 20:03:19.000000000 +0200 -+++ firefox-91.0/testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py 2021-08-10 10:38:40.885587687 +0200 -@@ -75,15 +75,7 @@ class TestMarionette(MarionetteTestCase) +diff -up firefox-96.0.1/testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py.testing firefox-96.0.1/testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py +--- firefox-96.0.1/testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py.testing 2022-01-13 20:26:09.000000000 +0100 ++++ firefox-96.0.1/testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py 2022-01-18 10:42:02.642971427 +0100 +@@ -98,15 +98,7 @@ class TestMarionette(MarionetteTestCase) def test_application_update_disabled(self): # Updates of the application should always be disabled by default @@ -40,9 +40,9 @@ diff -up firefox-91.0/testing/marionette/harness/marionette_harness/tests/unit/t self.assertFalse(update_allowed) -diff -up firefox-91.0/testing/tools/websocketprocessbridge/websocketprocessbridge_requirements_3.txt.testing firefox-91.0/testing/tools/websocketprocessbridge/websocketprocessbridge_requirements_3.txt ---- firefox-91.0/testing/tools/websocketprocessbridge/websocketprocessbridge_requirements_3.txt.testing 2021-08-10 10:38:40.885587687 +0200 -+++ firefox-91.0/testing/tools/websocketprocessbridge/websocketprocessbridge_requirements_3.txt 2021-08-10 10:46:55.136291780 +0200 +diff -up firefox-96.0.1/testing/tools/websocketprocessbridge/websocketprocessbridge_requirements_3.txt.testing firefox-96.0.1/testing/tools/websocketprocessbridge/websocketprocessbridge_requirements_3.txt +--- firefox-96.0.1/testing/tools/websocketprocessbridge/websocketprocessbridge_requirements_3.txt.testing 2022-01-13 23:26:17.000000000 +0100 ++++ firefox-96.0.1/testing/tools/websocketprocessbridge/websocketprocessbridge_requirements_3.txt 2022-01-18 10:42:02.642971427 +0100 @@ -1,6 +1,7 @@ # This file is the websocketprocess requirements.txt used with python 3. @@ -51,18 +51,18 @@ diff -up firefox-91.0/testing/tools/websocketprocessbridge/websocketprocessbridg vcversioner==2.16.0.0 twisted>=18.7.0 -diff -up firefox-91.0/toolkit/crashreporter/test/unit/xpcshell.ini.testing firefox-91.0/toolkit/crashreporter/test/unit/xpcshell.ini ---- firefox-91.0/toolkit/crashreporter/test/unit/xpcshell.ini.testing 2021-08-04 20:04:05.000000000 +0200 -+++ firefox-91.0/toolkit/crashreporter/test/unit/xpcshell.ini 2021-08-10 10:38:40.885587687 +0200 -@@ -41,7 +41,6 @@ skip-if = (os != 'win' && os != 'linux') +diff -up firefox-96.0.1/toolkit/crashreporter/test/unit/xpcshell.ini.testing firefox-96.0.1/toolkit/crashreporter/test/unit/xpcshell.ini +--- firefox-96.0.1/toolkit/crashreporter/test/unit/xpcshell.ini.testing 2022-01-13 23:26:17.000000000 +0100 ++++ firefox-96.0.1/toolkit/crashreporter/test/unit/xpcshell.ini 2022-01-18 10:58:40.574277255 +0100 +@@ -37,7 +37,6 @@ skip-if = (os != 'win' && os != 'linux') [test_crash_AsyncShutdown.js] [test_event_files.js] -[test_crash_terminator.js] [test_crash_backgroundtask_moz_crash.js] - -@@ -121,4 +120,3 @@ head = head_crashreporter.js head_win64c + skip-if = os == 'win' +@@ -123,4 +122,3 @@ head = head_crashreporter.js head_win64c skip-if = !(os == 'win' && bits == 64 && processor == 'x86_64') reason = Windows test specific to the x86-64 architecture support-files = test_crash_win64cfi_not_a_pe.exe diff --git a/firefox.spec b/firefox.spec index 13e2d95..3f9e5fb 100644 --- a/firefox.spec +++ b/firefox.spec @@ -162,13 +162,13 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox -Version: 96.0 +Version: 96.0.1 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220111.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220118.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -219,6 +219,7 @@ Patch55: firefox-testing.patch Patch57: firefox-disable-ffvpx-with-vapi.patch Patch61: firefox-glibc-dynstack.patch Patch62: build-python.patch +Patch63: build-python-glean.patch # Test patches # Generate without context by @@ -458,21 +459,19 @@ This package contains results of tests executed during build. %endif %patch3 -p1 -b .arm %patch44 -p1 -b .build-arm-libopus -#%patch46 -p1 -b .nss-version %patch47 -p1 -b .fedora-shebang -#%patch48 -p1 -b .build-arm-wasm %patch49 -p1 -b .build-arm-libaom %patch53 -p1 -b .firefox-gcc-build %patch54 -p1 -b .1669639 -#%patch55 -p1 -b .testing +%patch55 -p1 -b .testing %patch57 -p1 -b .ffvpx-with-vapi -#%patch61 -p1 -b .glibc-dynstack -%patch62 -p1 -b .build-python +%patch63 -p1 -b .build-python-glean.patch +#%patch62 -p1 -b .build-python # Test patches -#%patch100 -p1 -b .firefox-tests-xpcshell +%patch100 -p1 -b .firefox-tests-xpcshell #%patch101 -p1 -b .firefox-tests-reftest -#%patch102 -p1 -b .firefox-tests-xpcshell-freeze +%patch102 -p1 -b .firefox-tests-xpcshell-freeze # Fedora patches %patch215 -p1 -b .addons @@ -598,8 +597,6 @@ echo 'export NODEJS="%{_buildrootdir}/bin/node-stdout-nonblocking-wrapper"' >> . # Remove executable bit to make brp-mangle-shebangs happy. chmod -x third_party/rust/itertools/src/lib.rs -#chmod a-x third_party/rust/gfx-backend-vulkan/src/*.rs -#chmod a-x third_party/rust/gfx-hal/src/*.rs chmod a-x third_party/rust/ash/src/extensions/ext/*.rs chmod a-x third_party/rust/ash/src/extensions/khr/*.rs chmod a-x third_party/rust/ash/src/extensions/nv/*.rs @@ -628,13 +625,6 @@ export PATH=`pwd`/.cargo/bin:$PATH cd - %endif -#echo "Generate big endian version of config/external/icu/data/icudt67l.dat" -#%if 0%{?big_endian} -# icupkg -tb config/external/icu/data/icudt67l.dat config/external/icu/data/icudt67b.dat -# ls -l config/external/icu/data -# rm -f config/external/icu/data/icudt*l.dat -#%endif - mkdir %{_buildrootdir}/bin || : cp %{SOURCE32} %{_buildrootdir}/bin || : @@ -745,7 +735,7 @@ MOZ_SMP_FLAGS=-j1 echo "mk_add_options MOZ_MAKE_FLAGS=\"$MOZ_SMP_FLAGS\"" >> .mozconfig echo "mk_add_options MOZ_SERVICES_SYNC=1" >> .mozconfig echo "export STRIP=/bin/true" >> .mozconfig -export MACH_USE_SYSTEM_PYTHON=1 +#export MACH_USE_SYSTEM_PYTHON=1 %if %{launch_wayland_compositor} cp %{SOURCE45} . @@ -1067,6 +1057,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue Jan 18 2022 Martin Stransky - 96.0.1-1 +- Updated to 96.0.1 + * Tue Jan 11 2022 Martin Stransky - 96.0-1 - Updated to 96.0 diff --git a/sources b/sources index 65620be..219d9b6 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = b9ab1498be90ecf60822df7021f8812f124550d97f8cd687c69d3ab56fc5fb714bfe88c78c978a1794d211724909a9a5cad6a4b483fa05f762909c45d5075520 SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (firefox-96.0.source.tar.xz) = 39f553474537eb4e521f4182e38f0ddff039fa6b40b939d461937d2cef27f7182097b478f08f90d64fdcbe9c063e78f14f6863a8a82a16207ec7a1d3fdfda4ff -SHA512 (firefox-langpacks-96.0-20220111.tar.xz) = 116e80badb7ba9077138371789fe017350f5ab0473a6130a356d05fb7205eedefc77076d56ee9f4feb7db3cf84456b8b182936185ef77723115ea9559f044f33 +SHA512 (firefox-langpacks-96.0.1-20220118.tar.xz) = 8726a5e62f0fe7f827d286c8ed4fa707e1d6614391107f63bb0a47322e63d086edd3790297e92421e09edb316f87b1fec3a78f3b52a87f702307f40dfc261277 +SHA512 (firefox-96.0.1.source.tar.xz) = c0d2ccf9ca930def63dcb9dc269e47f60fd4bbbdcbc01463df0c30e11109a543e310fb36f2334d17b90cb9c96b8dcdd97d0e2d6c589a779de5e4f197c052f9a5 From d36bfd1a15ba88686b797a670c977729ebe9a618 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jan 2022 03:01:31 +0000 Subject: [PATCH 011/545] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- firefox.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 3f9e5fb..884c89f 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 96.0.1 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1057,6 +1057,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Thu Jan 20 2022 Fedora Release Engineering - 96.0.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Tue Jan 18 2022 Martin Stransky - 96.0.1-1 - Updated to 96.0.1 From e1f5156d0b5a875f1e5780c2e856f9ed4d82f27d Mon Sep 17 00:00:00 2001 From: Parag Nemade Date: Tue, 25 Jan 2022 14:27:39 +0530 Subject: [PATCH 012/545] Update hunspell-dir path F36 Change https://fedoraproject.org/wiki/Changes/Hunspell_dictionary_dir_change Signed-off-by: Parag Nemade --- firefox.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index 884c89f..85490f5 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 96.0.1 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -898,7 +898,7 @@ create_default_langpack "zh-TW" "zh" # Use the system hunspell dictionaries %{__rm} -rf %{buildroot}%{mozappdir}/dictionaries -ln -s %{_datadir}/myspell %{buildroot}%{mozappdir}/dictionaries +ln -s %{_datadir}/hunspell %{buildroot}%{mozappdir}/dictionaries %if 0%{?run_firefox_tests} %{__mkdir_p} %{buildroot}/%{version}-%{release}/test_results @@ -1057,6 +1057,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue Jan 25 2022 Parag Nemade - 96.0.1-3 +- Update hunspell-dir path + F36 Change https://fedoraproject.org/wiki/Changes/Hunspell_dictionary_dir_change + * Thu Jan 20 2022 Fedora Release Engineering - 96.0.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From 95a88fb6162d584812ac16f0301cdad63b57e159 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Tue, 25 Jan 2022 10:46:15 +0100 Subject: [PATCH 013/545] Use myspell directory for older fedoras --- firefox.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/firefox.spec b/firefox.spec index 85490f5..08a577b 100644 --- a/firefox.spec +++ b/firefox.spec @@ -898,7 +898,11 @@ create_default_langpack "zh-TW" "zh" # Use the system hunspell dictionaries %{__rm} -rf %{buildroot}%{mozappdir}/dictionaries +%if 0%{?fedora} > 35 ln -s %{_datadir}/hunspell %{buildroot}%{mozappdir}/dictionaries +%else +ln -s %{_datadir}/myspell %{buildroot}%{mozappdir}/dictionaries +%endif %if 0%{?run_firefox_tests} %{__mkdir_p} %{buildroot}/%{version}-%{release}/test_results From be5c6d4f085be8aafcea95a2a64594b92d475996 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 31 Jan 2022 14:17:03 +0100 Subject: [PATCH 014/545] Updated to 93.0.3 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index ee9699d..b09031a 100644 --- a/.gitignore +++ b/.gitignore @@ -489,3 +489,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-96.0-20220111.tar.xz /firefox-langpacks-96.0.1-20220118.tar.xz /firefox-96.0.1.source.tar.xz +/firefox-96.0.3.source.tar.xz +/firefox-langpacks-96.0.3-20220131.tar.xz diff --git a/firefox.spec b/firefox.spec index 08a577b..85206db 100644 --- a/firefox.spec +++ b/firefox.spec @@ -162,13 +162,13 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox -Version: 96.0.1 -Release: 3%{?pre_tag}%{?dist} +Version: 96.0.3 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220118.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220131.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1061,6 +1061,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Mon Jan 31 2022 Martin Stransky - 96.0.3-1 +- Updated to 96.0.3 + * Tue Jan 25 2022 Parag Nemade - 96.0.1-3 - Update hunspell-dir path F36 Change https://fedoraproject.org/wiki/Changes/Hunspell_dictionary_dir_change diff --git a/sources b/sources index 219d9b6..733c1d2 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = b9ab1498be90ecf60822df7021f8812f124550d97f8cd687c69d3ab56fc5fb714bfe88c78c978a1794d211724909a9a5cad6a4b483fa05f762909c45d5075520 SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (firefox-langpacks-96.0.1-20220118.tar.xz) = 8726a5e62f0fe7f827d286c8ed4fa707e1d6614391107f63bb0a47322e63d086edd3790297e92421e09edb316f87b1fec3a78f3b52a87f702307f40dfc261277 -SHA512 (firefox-96.0.1.source.tar.xz) = c0d2ccf9ca930def63dcb9dc269e47f60fd4bbbdcbc01463df0c30e11109a543e310fb36f2334d17b90cb9c96b8dcdd97d0e2d6c589a779de5e4f197c052f9a5 +SHA512 (firefox-96.0.3.source.tar.xz) = 3dd5fbc96e369d5f4fb3eca778c2bd3e2313d089f867de9fac3556810a797e9b5629ef1b8840fb2f22a18df7de95ea1993eee052f691d861a555cea544b05966 +SHA512 (firefox-langpacks-96.0.3-20220131.tar.xz) = 2c44690ed3ba6a0ba0ccb621598f8d6c619308b9a24cc6b39317603450e33b356b73d5c6ec41a34765c749067f7cd3c842ff0688b9d921377284671dc008de8a From 16e6b6b266d702b31b982c136a365f5f92c9cc1b Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 8 Feb 2022 12:42:36 +0100 Subject: [PATCH 015/545] -m --- .gitignore | 2 + D132929.diff | 18 - D133209.diff | 197 ---- D133485.diff | 31 - D133634.diff | 119 --- D133885.diff | 33 - D134141.diff | 12 - build-arm-wasm.patch | 21 - build-disable-elfhack.patch | 10 +- build-python-glean.patch | 1763 ----------------------------------- firefox.spec | 31 +- mozilla-1667096.patch | 42 +- mozilla-1753402.patch | 12 + sources | 4 +- 14 files changed, 51 insertions(+), 2244 deletions(-) delete mode 100644 D132929.diff delete mode 100644 D133209.diff delete mode 100644 D133485.diff delete mode 100644 D133634.diff delete mode 100644 D133885.diff delete mode 100644 D134141.diff delete mode 100644 build-arm-wasm.patch delete mode 100644 build-python-glean.patch create mode 100644 mozilla-1753402.patch diff --git a/.gitignore b/.gitignore index b09031a..9a0d014 100644 --- a/.gitignore +++ b/.gitignore @@ -491,3 +491,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-96.0.1.source.tar.xz /firefox-96.0.3.source.tar.xz /firefox-langpacks-96.0.3-20220131.tar.xz +/firefox-97.0.source.tar.xz +/firefox-langpacks-97.0-20220208.tar.xz diff --git a/D132929.diff b/D132929.diff deleted file mode 100644 index 0a61842..0000000 --- a/D132929.diff +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp ---- a/widget/gtk/nsWindow.cpp -+++ b/widget/gtk/nsWindow.cpp -@@ -2946,7 +2946,12 @@ - uint32_t timestamp = GDK_CURRENT_TIME; - - nsGTKToolkit* GTKToolkit = nsGTKToolkit::GetToolkit(); -- if (GTKToolkit) timestamp = GTKToolkit->GetFocusTimestamp(); -+ if (GTKToolkit) { -+ timestamp = GTKToolkit->GetFocusTimestamp(); -+ } -+ if (!timestamp) { -+ timestamp = GetLastUserInputTime(); -+ } - - LOG(" requesting toplevel activation [%p]\n", (void*)toplevelWindow); - gtk_window_present_with_time(GTK_WINDOW(toplevelWindow->mShell), - diff --git a/D133209.diff b/D133209.diff deleted file mode 100644 index 81908f9..0000000 --- a/D133209.diff +++ /dev/null @@ -1,197 +0,0 @@ -diff --git a/widget/gtk/nsGtkKeyUtils.h b/widget/gtk/nsGtkKeyUtils.h ---- a/widget/gtk/nsGtkKeyUtils.h -+++ b/widget/gtk/nsGtkKeyUtils.h -@@ -202,6 +202,22 @@ - * from xkb_keymap. We call that from Wayland backend routines. - */ - static void SetModifierMasks(xkb_keymap* aKeymap); -+ -+ /** -+ * Wayland global focus handlers -+ */ -+ static void SetFocusIn(wl_surface* aFocusSurface, uint32_t aFocusSerial); -+ static void SetFocusOut(wl_surface* aFocusSurface); -+ static void GetFocusInfo(wl_surface** aFocusSurface, uint32_t* aFocusSerial); -+ -+ static void SetSeat(wl_seat* aSeat); -+ static wl_seat* GetSeat(); -+ -+ /** -+ * EnsureInstance() is provided on Wayland to register Wayland callbacks -+ * early. -+ */ -+ static void EnsureInstance(); - #endif - - /** -@@ -467,6 +483,12 @@ - void SetModifierMask(xkb_keymap* aKeymap, ModifierIndex aModifierIndex, - const char* aModifierName); - #endif -+ -+#ifdef MOZ_WAYLAND -+ wl_seat* mSeat = nullptr; -+ wl_surface* mFocusSurface = nullptr; -+ uint32_t mFocusSerial = 0; -+#endif - }; - - } // namespace widget -diff --git a/widget/gtk/nsGtkKeyUtils.cpp b/widget/gtk/nsGtkKeyUtils.cpp ---- a/widget/gtk/nsGtkKeyUtils.cpp -+++ b/widget/gtk/nsGtkKeyUtils.cpp -@@ -331,6 +331,10 @@ - return sInstance; - } - -+#ifdef MOZ_WAYLAND -+void KeymapWrapper::EnsureInstance() { (void)GetInstance(); } -+#endif -+ - /* static */ - void KeymapWrapper::Shutdown() { - if (sInstance) { -@@ -720,10 +724,15 @@ - - static void keyboard_handle_enter(void* data, struct wl_keyboard* keyboard, - uint32_t serial, struct wl_surface* surface, -- struct wl_array* keys) {} -+ struct wl_array* keys) { -+ KeymapWrapper::SetFocusIn(surface, serial); -+} -+ - static void keyboard_handle_leave(void* data, struct wl_keyboard* keyboard, - uint32_t serial, struct wl_surface* surface) { -+ KeymapWrapper::SetFocusOut(surface); - } -+ - static void keyboard_handle_key(void* data, struct wl_keyboard* keyboard, - uint32_t serial, uint32_t time, uint32_t key, - uint32_t state) {} -@@ -760,6 +769,7 @@ - if (strcmp(interface, "wl_seat") == 0) { - auto* seat = - WaylandRegistryBind(registry, id, &wl_seat_interface, 1); -+ KeymapWrapper::SetSeat(seat); - wl_seat_add_listener(seat, &seat_listener, data); - } - } -@@ -2411,5 +2421,40 @@ - altLatinCharCodes.mShiftedCharCode)); - } - -+#ifdef MOZ_WAYLAND -+void KeymapWrapper::SetFocusIn(wl_surface* aFocusSurface, -+ uint32_t aFocusSerial) { -+ KeymapWrapper* keymapWrapper = KeymapWrapper::GetInstance(); -+ keymapWrapper->mFocusSurface = aFocusSurface; -+ keymapWrapper->mFocusSerial = aFocusSerial; -+} -+ -+void KeymapWrapper::SetFocusOut(wl_surface* aFocusSurface) { -+ KeymapWrapper* keymapWrapper = KeymapWrapper::GetInstance(); -+ if (aFocusSurface == keymapWrapper->mFocusSurface) { -+ keymapWrapper->mFocusSurface = nullptr; -+ keymapWrapper->mFocusSerial = 0; -+ } -+} -+ -+void KeymapWrapper::GetFocusInfo(wl_surface** aFocusSurface, -+ uint32_t* aFocusSerial) { -+ KeymapWrapper* keymapWrapper = KeymapWrapper::GetInstance(); -+ *aFocusSurface = keymapWrapper->mFocusSurface; -+ *aFocusSerial = keymapWrapper->mFocusSerial; -+} -+ -+void KeymapWrapper::SetSeat(wl_seat* aSeat) { -+ KeymapWrapper* keymapWrapper = KeymapWrapper::GetInstance(); -+ keymapWrapper->mSeat = aSeat; -+} -+ -+wl_seat* KeymapWrapper::GetSeat() { -+ KeymapWrapper* keymapWrapper = KeymapWrapper::GetInstance(); -+ return keymapWrapper->mSeat; -+} -+ -+#endif -+ - } // namespace widget - } // namespace mozilla -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp ---- a/widget/gtk/nsWindow.cpp -+++ b/widget/gtk/nsWindow.cpp -@@ -2862,8 +2862,7 @@ - }; - - void nsWindow::RequestFocusWaylandWindow(RefPtr aWindow) { -- LOG("nsWindow::RequestWindowFocusWayland(%p) gFocusWindow [%p]", -- (void*)aWindow, gFocusWindow); -+ LOG("nsWindow::RequestWindowFocusWayland(%p)", (void*)aWindow); - - RefPtr display = WaylandDisplayGet(); - xdg_activation_v1* xdg_activation = display->GetXdgActivation(); -@@ -2872,17 +2871,11 @@ - return; - } - -- // We use xdg-activation protocol to transfer focus from gFocusWindow to -- // aWindow. Quit if no window is focused. -- if (gFocusWindow != this) { -- LOG(" there isn't any focused window to transfer focus from, quit."); -- return; -- } -- -- wl_surface* surface = -- mGdkWindow ? gdk_wayland_window_get_wl_surface(mGdkWindow) : nullptr; -- if (!surface) { -- LOG(" requesting window is hidden/unmapped, quit."); -+ wl_surface* focusSurface; -+ uint32_t focusSerial; -+ KeymapWrapper::GetFocusInfo(&focusSurface, &focusSerial); -+ if (!focusSurface) { -+ LOG(" We're missing focused window, quit."); - return; - } - -@@ -2894,9 +2887,9 @@ - // callback. - xdg_activation_token_v1_add_listener(aWindow->mXdgToken, &token_listener, - do_AddRef(aWindow).take()); -- xdg_activation_token_v1_set_serial(aWindow->mXdgToken, GetLastUserInputTime(), -- display->GetSeat()); -- xdg_activation_token_v1_set_surface(aWindow->mXdgToken, surface); -+ xdg_activation_token_v1_set_serial(aWindow->mXdgToken, focusSerial, -+ KeymapWrapper::GetSeat()); -+ xdg_activation_token_v1_set_surface(aWindow->mXdgToken, focusSurface); - xdg_activation_token_v1_commit(aWindow->mXdgToken); - } - #endif -@@ -2959,11 +2952,7 @@ - - #ifdef MOZ_WAYLAND - if (GdkIsWaylandDisplay()) { -- if (gFocusWindow) { -- gFocusWindow->RequestFocusWaylandWindow(toplevelWindow); -- } else { -- LOG(" RequestFocusWaylandWindow(): we're missing focused window!"); -- } -+ RequestFocusWaylandWindow(toplevelWindow); - } - #endif - if (GTKToolkit) GTKToolkit->SetFocusTimestamp(0); -@@ -5359,6 +5348,14 @@ - a11y::PreInit(); - #endif - -+#ifdef MOZ_WAYLAND -+ // Ensure that KeymapWrapper is created on Wayland as we need it for -+ // keyboard focus tracking. -+ if (GdkIsWaylandDisplay()) { -+ KeymapWrapper::EnsureInstance(); -+ } -+#endif -+ - // Ensure that the toolkit is created. - nsGTKToolkit::GetToolkit(); - - diff --git a/D133485.diff b/D133485.diff deleted file mode 100644 index 6785c55..0000000 --- a/D133485.diff +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp ---- a/widget/gtk/nsWindow.cpp -+++ b/widget/gtk/nsWindow.cpp -@@ -2879,6 +2879,10 @@ - return; - } - -+ LOG(" requesting xdg-activation token, surface ID %d serial %d seat ID %d", -+ wl_proxy_get_id((struct wl_proxy*)focusSurface), focusSerial, -+ wl_proxy_get_id((struct wl_proxy*)KeymapWrapper::GetSeat())); -+ - // Store activation token at activated window for further release. - g_clear_pointer(&aWindow->mXdgToken, xdg_activation_token_v1_destroy); - aWindow->mXdgToken = xdg_activation_v1_get_activation_token(xdg_activation); -@@ -2941,6 +2945,7 @@ - nsGTKToolkit* GTKToolkit = nsGTKToolkit::GetToolkit(); - if (GTKToolkit) { - timestamp = GTKToolkit->GetFocusTimestamp(); -+ GTKToolkit->SetFocusTimestamp(0); - } - if (!timestamp) { - timestamp = GetLastUserInputTime(); -@@ -2955,7 +2960,6 @@ - RequestFocusWaylandWindow(toplevelWindow); - } - #endif -- if (GTKToolkit) GTKToolkit->SetFocusTimestamp(0); - } - return; - } - diff --git a/D133634.diff b/D133634.diff deleted file mode 100644 index 3c9d642..0000000 --- a/D133634.diff +++ /dev/null @@ -1,119 +0,0 @@ -diff --git a/widget/gtk/nsGtkKeyUtils.cpp b/widget/gtk/nsGtkKeyUtils.cpp ---- a/widget/gtk/nsGtkKeyUtils.cpp -+++ b/widget/gtk/nsGtkKeyUtils.cpp -@@ -2424,17 +2424,23 @@ - #ifdef MOZ_WAYLAND - void KeymapWrapper::SetFocusIn(wl_surface* aFocusSurface, - uint32_t aFocusSerial) { -+ LOGW("KeymapWrapper::SetFocusIn() surface %p ID %d serial %d", aFocusSurface, -+ aFocusSurface ? wl_proxy_get_id((struct wl_proxy*)aFocusSurface) : 0, -+ aFocusSerial); -+ - KeymapWrapper* keymapWrapper = KeymapWrapper::GetInstance(); - keymapWrapper->mFocusSurface = aFocusSurface; - keymapWrapper->mFocusSerial = aFocusSerial; - } - -+// aFocusSurface can be null in case that focused surface is already destroyed. - void KeymapWrapper::SetFocusOut(wl_surface* aFocusSurface) { - KeymapWrapper* keymapWrapper = KeymapWrapper::GetInstance(); -- if (aFocusSurface == keymapWrapper->mFocusSurface) { -- keymapWrapper->mFocusSurface = nullptr; -- keymapWrapper->mFocusSerial = 0; -- } -+ LOGW("KeymapWrapper::SetFocusOut surface %p ID %d", aFocusSurface, -+ aFocusSurface ? wl_proxy_get_id((struct wl_proxy*)aFocusSurface) : 0); -+ -+ keymapWrapper->mFocusSurface = nullptr; -+ keymapWrapper->mFocusSerial = 0; - } - - void KeymapWrapper::GetFocusInfo(wl_surface** aFocusSurface, -@@ -2453,7 +2459,6 @@ - KeymapWrapper* keymapWrapper = KeymapWrapper::GetInstance(); - return keymapWrapper->mSeat; - } -- - #endif - - } // namespace widget -diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h ---- a/widget/gtk/nsWindow.h -+++ b/widget/gtk/nsWindow.h -@@ -386,8 +386,7 @@ - - #ifdef MOZ_WAYLAND - // Use xdg-activation protocol to transfer focus from gFocusWindow to aWindow. -- // RequestFocusWaylandWindow needs to be called on focused window only. -- void RequestFocusWaylandWindow(RefPtr aWindow); -+ static void RequestFocusWaylandWindow(RefPtr aWindow); - void FocusWaylandWindow(const char* aTokenID); - - bool GetCSDDecorationOffset(int* aDx, int* aDy); -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp ---- a/widget/gtk/nsWindow.cpp -+++ b/widget/gtk/nsWindow.cpp -@@ -2845,6 +2845,9 @@ - return; - } - -+ LOG(" requesting xdg-activation, surface ID %d", -+ wl_proxy_get_id((struct wl_proxy*)surface)); -+ - xdg_activation_v1* xdg_activation = WaylandDisplayGet()->GetXdgActivation(); - xdg_activation_v1_activate(xdg_activation, aTokenID, surface); - } -@@ -2862,12 +2865,17 @@ - }; - - void nsWindow::RequestFocusWaylandWindow(RefPtr aWindow) { -- LOG("nsWindow::RequestWindowFocusWayland(%p)", (void*)aWindow); -+ LOGW("nsWindow::RequestFocusWaylandWindow(%p) gFocusWindow %p", -+ (void*)aWindow, gFocusWindow); -+ -+ if (!gFocusWindow) { -+ LOGW(" missing gFocusWindow, quit."); -+ } - - RefPtr display = WaylandDisplayGet(); - xdg_activation_v1* xdg_activation = display->GetXdgActivation(); - if (!xdg_activation) { -- LOG(" xdg-activation is missing, quit."); -+ LOGW(" xdg-activation is missing, quit."); - return; - } - -@@ -2875,13 +2883,25 @@ - uint32_t focusSerial; - KeymapWrapper::GetFocusInfo(&focusSurface, &focusSerial); - if (!focusSurface) { -- LOG(" We're missing focused window, quit."); -- return; -- } -- -- LOG(" requesting xdg-activation token, surface ID %d serial %d seat ID %d", -- wl_proxy_get_id((struct wl_proxy*)focusSurface), focusSerial, -- wl_proxy_get_id((struct wl_proxy*)KeymapWrapper::GetSeat())); -+ LOGW(" We're missing focused window, quit."); -+ return; -+ } -+ -+ GdkWindow* gdkWindow = gtk_widget_get_window(gFocusWindow->mShell); -+ wl_surface* surface = -+ gdkWindow ? gdk_wayland_window_get_wl_surface(gdkWindow) : nullptr; -+ if (focusSurface != surface) { -+ LOGW(" focused surface %p and gFocusWindow surface %p don't match, quit.", -+ focusSurface, surface); -+ return; -+ } -+ -+ LOGW( -+ " requesting xdg-activation token, surface %p ID %d serial %d seat ID " -+ "%d", -+ focusSurface, -+ focusSurface ? wl_proxy_get_id((struct wl_proxy*)focusSurface) : 0, -+ focusSerial, wl_proxy_get_id((struct wl_proxy*)KeymapWrapper::GetSeat())); - - // Store activation token at activated window for further release. - g_clear_pointer(&aWindow->mXdgToken, xdg_activation_token_v1_destroy); - diff --git a/D133885.diff b/D133885.diff deleted file mode 100644 index 246fc2a..0000000 --- a/D133885.diff +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp ---- a/widget/gtk/nsWindow.cpp -+++ b/widget/gtk/nsWindow.cpp -@@ -2868,7 +2868,7 @@ - LOGW("nsWindow::RequestFocusWaylandWindow(%p) gFocusWindow %p", - (void*)aWindow, gFocusWindow); - -- if (!gFocusWindow) { -+ if (!gFocusWindow || gFocusWindow->IsDestroyed()) { - LOGW(" missing gFocusWindow, quit."); - } - -@@ -2883,13 +2883,16 @@ - uint32_t focusSerial; - KeymapWrapper::GetFocusInfo(&focusSurface, &focusSerial); - if (!focusSurface) { -- LOGW(" We're missing focused window, quit."); -+ LOGW(" We're missing KeymapWrapper focused window, quit."); - return; - } - - GdkWindow* gdkWindow = gtk_widget_get_window(gFocusWindow->mShell); -- wl_surface* surface = -- gdkWindow ? gdk_wayland_window_get_wl_surface(gdkWindow) : nullptr; -+ if (!gdkWindow) { -+ LOGW(" gFocusWindow is not mapped, quit."); -+ return; -+ } -+ wl_surface* surface = gdk_wayland_window_get_wl_surface(gdkWindow); - if (focusSurface != surface) { - LOGW(" focused surface %p and gFocusWindow surface %p don't match, quit.", - focusSurface, surface); - diff --git a/D134141.diff b/D134141.diff deleted file mode 100644 index ef0b9fb..0000000 --- a/D134141.diff +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp ---- a/widget/gtk/nsWindow.cpp -+++ b/widget/gtk/nsWindow.cpp -@@ -2870,6 +2870,7 @@ - - if (!gFocusWindow || gFocusWindow->IsDestroyed()) { - LOGW(" missing gFocusWindow, quit."); -+ return; - } - - RefPtr display = WaylandDisplayGet(); - diff --git a/build-arm-wasm.patch b/build-arm-wasm.patch deleted file mode 100644 index bd841ab..0000000 --- a/build-arm-wasm.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up firefox-72.0.2/js/src/wasm/WasmSignalHandlers.cpp.old firefox-72.0.2/js/src/wasm/WasmSignalHandlers.cpp ---- firefox-72.0.2/js/src/wasm/WasmSignalHandlers.cpp.old 2020-01-17 23:34:41.000000000 +0200 -+++ firefox-72.0.2/js/src/wasm/WasmSignalHandlers.cpp 2020-02-02 08:07:54.670341986 +0200 -@@ -249,7 +249,16 @@ using mozilla::DebugOnly; - #endif - - #ifdef WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS --# include -+struct user_vfp { -+ unsigned long long fpregs[32]; -+ unsigned long fpscr; -+}; -+ -+struct user_vfp_exc { -+ unsigned long fpexc; -+ unsigned long fpinst; -+ unsigned long fpinst2; -+}; - #endif - - #if defined(ANDROID) diff --git a/build-disable-elfhack.patch b/build-disable-elfhack.patch index faaf669..04d49f2 100644 --- a/build-disable-elfhack.patch +++ b/build-disable-elfhack.patch @@ -1,7 +1,7 @@ -diff -up firefox-84.0/toolkit/moz.configure.disable-elfhack firefox-84.0/toolkit/moz.configure ---- firefox-84.0/toolkit/moz.configure.disable-elfhack 2020-12-10 12:37:30.727243266 +0100 -+++ firefox-84.0/toolkit/moz.configure 2020-12-10 12:39:42.771967894 +0100 -@@ -1280,7 +1280,7 @@ with only_when("--enable-compile-environ +diff -up firefox-97.0/toolkit/moz.configure.disable-elfhack firefox-97.0/toolkit/moz.configure +--- firefox-97.0/toolkit/moz.configure.disable-elfhack 2022-02-08 09:58:47.518047952 +0100 ++++ firefox-97.0/toolkit/moz.configure 2022-02-08 10:17:49.552945956 +0100 +@@ -1273,7 +1273,7 @@ with only_when("--enable-compile-environ help="{Enable|Disable} elf hacks", ) @@ -9,4 +9,4 @@ diff -up firefox-84.0/toolkit/moz.configure.disable-elfhack firefox-84.0/toolkit + set_config("USE_ELF_HACK", depends_if("--enable-elf-hack")(lambda _: False)) - @depends(check_build_environment) + @depends(build_environment) diff --git a/build-python-glean.patch b/build-python-glean.patch deleted file mode 100644 index 1da2987..0000000 --- a/build-python-glean.patch +++ /dev/null @@ -1,1763 +0,0 @@ -diff --git a/Cargo.lock b/Cargo.lock ---- a/Cargo.lock -+++ b/Cargo.lock -@@ -1994,9 +1994,9 @@ - - [[package]] - name = "glean" --version = "42.1.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "af977f3ee276d391cbf940639a5b95378c2b0031d5624c019142d286be4a1a21" -+version = "42.3.0" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "34d40d192d10509d941937248fe4594d47617abf34496686c809cfdb31ae8506" - dependencies = [ - "chrono", - "crossbeam-channel", -@@ -2014,9 +2014,9 @@ - - [[package]] - name = "glean-core" --version = "42.1.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "f50f24e5e7c2abef542a9cb67f7367538db56f54fcae0fae8d3a1e0ac63470a3" -+version = "42.3.0" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "349ebbb162d58911547b48e5fbf90d45854e3e1ba03332f41b80a6611867c013" - dependencies = [ - "bincode", - "chrono", -@@ -2034,9 +2034,9 @@ - - [[package]] - name = "glean-ffi" --version = "42.1.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "26738a3a19d212595c76a765b3e29fc9a0e1c5e7d15a8352ac94ec8536b65cd5" -+version = "42.3.0" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "9e29c3f0b9dbde127254f375499df382d5fa9c3c2b33bfcb393485876fe79fb2" - dependencies = [ - "android_logger", - "env_logger", -diff --git a/build.gradle b/build.gradle ---- a/build.gradle -+++ b/build.gradle -@@ -36,7 +36,7 @@ - topsrcdir = gradle.mozconfig.topsrcdir - topobjdir = gradle.mozconfig.topobjdir - -- gleanVersion = "42.1.0" -+ gleanVersion = "42.3.0" - if (gleanVersion != getRustVersionFor("glean")) { - throw new StopExecutionException("Mismatched Glean version, expected: ${gleanVersion}," + - " found ${getRustVersionFor("glean")}") -diff --git a/build/mach_virtualenv_packages.txt b/build/mach_virtualenv_packages.txt ---- a/build/mach_virtualenv_packages.txt -+++ b/build/mach_virtualenv_packages.txt -@@ -1,7 +1,7 @@ - packages.txt:build/common_virtualenv_packages.txt - # glean-sdk may not be installable if a wheel isn't available - # and it has to be built from source. --pypi-optional:glean-sdk==40.0.0:telemetry will not be collected -+pypi-optional:glean-sdk==42.3.0:telemetry will not be collected - # Mach gracefully handles the case where `psutil` is unavailable. - # We aren't (yet) able to pin packages in automation, so we have to - # support down to the oldest locally-installed version (5.4.2). -diff --git a/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/RECORD b/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/RECORD -deleted file mode 100644 ---- a/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/RECORD -+++ /dev/null -@@ -1,35 +0,0 @@ --glean_parser/__init__.py,sha256=kaoYIRhwZiOE1d8TniW1SHSlEivLBXZQJJ3eiDcamvQ,538 --glean_parser/__main__.py,sha256=FGU4ETmwkPLtzUYOkqmAGElkDKFS98Q-WoXnpAFJH5M,6137 --glean_parser/coverage.py,sha256=2IwC4XMDtDamMkBFoYilmqJzW4gyypq65YVCur8SNas,4405 --glean_parser/csharp.py,sha256=tOrwOLjJCnfie0GvhWvg0Q3fnP4VFQM_4GRaaAqUh4I,5242 --glean_parser/data_review.py,sha256=ZwzL5SD-rC37OHDI9dCq7Z6-NUwARlRgBRb-kRsFGzA,4762 --glean_parser/javascript.py,sha256=U4QaG5DXfmpqEQoScyNSuoTCUJ-5CYts8jyC3o2bWZs,7849 --glean_parser/kotlin.py,sha256=204c61dRCCmnPRtPHzoCtLBwraG2Xs3_AF5HKbBuziI,11105 --glean_parser/lint.py,sha256=jwD0yZ99RZIrmzEBeC3BB9CPPBHcGHmn-oyUjoqNNyI,14470 --glean_parser/markdown.py,sha256=0auYAmzIrX0kqmQyq9DKkRRvTE66yAYdrU-YMgLhrpw,8996 --glean_parser/metrics.py,sha256=jUO4XwatfM4sJGVPcyfbUNb5aW4i9kVYp49OEBASvoM,11350 --glean_parser/parser.py,sha256=sO0kfhicG7xZOfYwNOt0rueBEVgK-YO9M6hVUqQKFP8,13286 --glean_parser/pings.py,sha256=_mrY0idUGMODEMG3fCMRgO8_B9CnXko_FbrOcUnezV0,2667 --glean_parser/swift.py,sha256=3pkl6u3JaQrT8Oz0HONoiq46DUdHCEUDcn_lmZXoCVM,6408 --glean_parser/translate.py,sha256=lnPT3wyzD_YO4Yj6qFAHkP8OZlvVymwK-06QgulnlIs,7394 --glean_parser/util.py,sha256=B7vX7fdmnP-L_yxiFk5csuN5yTOOJXTVR_zJoW13Snc,13701 --glean_parser/validate_ping.py,sha256=0TNvILH6dtzJDys3W8Kqorw6kk03me73OCUDtpoHcXU,2118 --glean_parser/schemas/metrics.1-0-0.schema.yaml,sha256=cND3cvi6iBfPUVmtfIBQfGJV9AALpbvN7nu8E33_J-o,19566 --glean_parser/schemas/metrics.2-0-0.schema.yaml,sha256=IHDSGcfcl9EstXXb7vn_d9x1wtjD_ANJn6ufpCiqBWY,20248 --glean_parser/schemas/pings.1-0-0.schema.yaml,sha256=hwCnsKpEysmrmVp-QHGBArEkVY3vaU1rVsxlTwhAzws,4315 --glean_parser/schemas/pings.2-0-0.schema.yaml,sha256=xUNDwflVSmTcsZL_46uoAbBKROiIPFQRSBt12qiRMt4,3971 --glean_parser/templates/csharp.jinja2,sha256=tPj09JzgSK0YyNb53WkL8WFTA7fcVXyiJ7V-bARnfM0,4354 --glean_parser/templates/javascript.jinja2,sha256=osiIk9cZusDNDjW-ojwOGQulXkxPINmbgNOJx-h5iG8,1825 --glean_parser/templates/kotlin.buildinfo.jinja2,sha256=z9tPgvmNnf8E8gpx7FAWh35oXad8Dlv_UrpqN9CXetY,780 --glean_parser/templates/kotlin.geckoview.jinja2,sha256=K0c1BeKSXDVbshC3gpWALCQFp2JtsoqWhGyN1ScPhC0,5077 --glean_parser/templates/kotlin.jinja2,sha256=fsFXKI_fKwj5AEO4odJ5sRvoC5geW59_DhU6GATaA90,4475 --glean_parser/templates/markdown.jinja2,sha256=tOMN62xEGA1p8QoMKnpCVXUiK_jI5GwLuvCnuOROy8c,3381 --glean_parser/templates/qmldir.jinja2,sha256=m6IGsp-tgTiOfQ7VN8XW6GqX0gJqJkt3B6Pkaul6FVo,156 --glean_parser/templates/swift.jinja2,sha256=McprjDExS3Ao62_eTvEwl-ZHNIbYDOJe05gv1nd4trM,4791 --glean_parser-3.6.0.dist-info/AUTHORS.md,sha256=jBsSsn3EpmpLejgHMhzU1XTFwkCARqYeUs9iGLNgwkQ,432 --glean_parser-3.6.0.dist-info/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725 --glean_parser-3.6.0.dist-info/METADATA,sha256=eQfxIRqcsGKQFWnaKB1WQ-XVUcu2cuO71ytkBf8MyGA,20755 --glean_parser-3.6.0.dist-info/WHEEL,sha256=OqRkF0eY5GHssMorFjlbTIq072vpHpF60fIQA6lS9xA,92 --glean_parser-3.6.0.dist-info/entry_points.txt,sha256=s-clJTIqp-PpJD-n3AnIQZFkTafIrzsTbAPX9vNY018,69 --glean_parser-3.6.0.dist-info/top_level.txt,sha256=q7T3duD-9tYZFyDry6Wv2LcdMsK2jGnzdDFhxWcT2Z8,13 --glean_parser-3.6.0.dist-info/RECORD,, -diff --git a/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/AUTHORS.md b/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/AUTHORS.md -rename from third_party/python/glean_parser/glean_parser-3.6.0.dist-info/AUTHORS.md -rename to third_party/python/glean_parser/glean_parser-4.3.1.dist-info/AUTHORS.md -diff --git a/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/LICENSE b/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/LICENSE -rename from third_party/python/glean_parser/glean_parser-3.6.0.dist-info/LICENSE -rename to third_party/python/glean_parser/glean_parser-4.3.1.dist-info/LICENSE -diff --git a/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/METADATA b/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/METADATA -rename from third_party/python/glean_parser/glean_parser-3.6.0.dist-info/METADATA -rename to third_party/python/glean_parser/glean_parser-4.3.1.dist-info/METADATA ---- a/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/METADATA -+++ b/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/METADATA -@@ -1,6 +1,6 @@ - Metadata-Version: 2.1 - Name: glean-parser --Version: 3.6.0 -+Version: 4.3.1 - Summary: Parser tools for Mozilla's Glean telemetry - Home-page: https://github.com/mozilla/glean_parser - Author: Michael Droettboom -@@ -16,12 +16,13 @@ - Classifier: Programming Language :: Python :: 3.7 - Classifier: Programming Language :: Python :: 3.8 - Classifier: Programming Language :: Python :: 3.9 -+Classifier: Programming Language :: Python :: 3.10 - Description-Content-Type: text/markdown - Requires-Dist: appdirs (>=1.4) - Requires-Dist: Click (>=7) - Requires-Dist: diskcache (>=4) - Requires-Dist: Jinja2 (>=2.10.1) --Requires-Dist: jsonschema (<4,>=3.0.2) -+Requires-Dist: jsonschema (>=3.0.2) - Requires-Dist: PyYAML (>=5.3.1) - Requires-Dist: yamllint (>=1.18.0) - Requires-Dist: iso8601 (>=0.1.10) ; python_version <= "3.6" -@@ -84,6 +85,42 @@ - - ## Unreleased - -+## 4.3.1 -+ -+- BUGFIX: Skip tags for code generation ([#409](https://github.com/mozilla/glean_parser/pull/409)) -+ -+## 4.3.0 -+ -+- Support tags in glean parser ([bug 1734011](https://bugzilla.mozilla.org/show_bug.cgi?id=1734011)) -+ -+## 4.2.0 -+ -+- Improve the schema validation error messages. They will no longer include `OrderedDict(...)` on Python 3.7 and later ([bug 1733395](https://bugzilla.mozilla.org/show_bug.cgi?id=1733395)) -+- Officially support Python 3.10 -+ -+## 4.1.1 (2021-09-28) -+ -+- Update private import paths on Javascript / Typescript templates. ([bug 1702468](https://bugzilla.mozilla.org/show_bug.cgi?id=1702468)) -+ -+## 4.1.0 (2021-09-16) -+ -+- Add support for Node.js platform on Javascript / Typescript templates. ([bug 1728982](https://bugzilla.mozilla.org/show_bug.cgi?id=1728982)) -+ -+## 4.0.0 (2021-08-20) -+ -+- Add support for Text metric type ([#374](https://github.com/mozilla/glean_parser/pull/374)) -+- Reserve the `default` ping name. It can't be used as a ping name, but it can be used in `send_in_pings` ([#376](https://github.com/mozilla/glean_parser/pull/376)) -+ -+## 3.8.0 (2021-08-18) -+ -+- Expose ping reasons enum on JavaScript / TypeScript templates. ([bug 1719136](https://bugzilla.mozilla.org/show_bug.cgi?id=1719136)) -+- Define an interface with the allowed extras for each event on the TypeScript template. ([bug 1693487](https://bugzilla.mozilla.org/show_bug.cgi?id=1693487)) -+ -+## 3.7.0 (2021-07-13) -+ -+- New lint: Check for redundant words in ping names ([#355](https://github.com/mozilla/glean_parser/pull/355)) -+- Add support for URL metric type ([#361](https://github.com/mozilla/glean_parser/pull/361)) -+ - ## 3.6.0 (2021-06-11) - - - Add a command `data-review` to generate a skeleton Data Review Request for all metrics matching a supplied bug number. ([bug 1704541](https://bugzilla.mozilla.org/show_bug.cgi?id=1704541)) -@@ -99,9 +136,9 @@ - - ## 3.4.0 (2021-05-28) - --- Add missing import for Kotlin code ([#339](https://github.com/mozilla/glean_parser/pull/341)) --- Use a plain Kotlin type in the generated interface implementation ([#339](https://github.com/mozilla/glean_parser/pull/341)) --- Generate additional generics for event metrics ([#339](https://github.com/mozilla/glean_parser/pull/341)) -+- Add missing import for Kotlin code ([#339](https://github.com/mozilla/glean_parser/pull/339)) -+- Use a plain Kotlin type in the generated interface implementation ([#339](https://github.com/mozilla/glean_parser/pull/339)) -+- Generate additional generics for event metrics ([#339](https://github.com/mozilla/glean_parser/pull/339)) - - For Kotlin skip generating `GleanBuildInfo.kt` when requested (with `with_buildinfo=false`) ([#341](https://github.com/mozilla/glean_parser/pull/341)) - - ## 3.3.2 (2021-05-18) -diff --git a/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/RECORD b/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/RECORD -new file mode 100644 ---- /dev/null -+++ b/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/RECORD -@@ -0,0 +1,37 @@ -+glean_parser/__init__.py,sha256=kaoYIRhwZiOE1d8TniW1SHSlEivLBXZQJJ3eiDcamvQ,538 -+glean_parser/__main__.py,sha256=1lA0kuQkEIMZSnG8xYha5dASadwEHI5-MeHmuNqyViA,6509 -+glean_parser/coverage.py,sha256=2IwC4XMDtDamMkBFoYilmqJzW4gyypq65YVCur8SNas,4405 -+glean_parser/csharp.py,sha256=tOrwOLjJCnfie0GvhWvg0Q3fnP4VFQM_4GRaaAqUh4I,5242 -+glean_parser/data_review.py,sha256=TA87mbyUQeDOB1T344gfsXePScBEZ9TdyWLy5TJCpHU,4765 -+glean_parser/javascript.py,sha256=e2hslgxRB56aS2_JVOkatKexrblcz6-XqsDnGuw0MPQ,8150 -+glean_parser/kotlin.py,sha256=INVHy3yC2xwm9ZFL9atr99C4DDsOwvRKnCiaJcLql_o,11192 -+glean_parser/lint.py,sha256=CM9OMH-sIxuErvfQktbWkeKIIVzG28pPxqMGO1Espok,17018 -+glean_parser/markdown.py,sha256=0auYAmzIrX0kqmQyq9DKkRRvTE66yAYdrU-YMgLhrpw,8996 -+glean_parser/metrics.py,sha256=Z0gkVMHH-u4eCu_bpsu5JKm9gumZhCz1Jq-xSmHjo8k,11621 -+glean_parser/parser.py,sha256=vIGJGOz0S4cAIdlzeEoiBbmoEgxLKvGdSStVHt8LvX8,15463 -+glean_parser/pings.py,sha256=6XakkO9jnQc2oojLQJvTCMwF7w-BEm6rR54tunCb38o,2805 -+glean_parser/swift.py,sha256=FWOp1Qr8U4xQvOfcu23FttCc4Nc8P7PkJTqm-V7bC4Y,6437 -+glean_parser/tags.py,sha256=bemKYvcbMO4JrghiNSe-A4BNNDtx_FlUPkgrPPJy84Y,1391 -+glean_parser/translate.py,sha256=ZyWEEp1bQO2-cneiC-YvbCuTUEra-xgp33X6dkvtgUY,7476 -+glean_parser/util.py,sha256=gsP8MqfgEs0sDKbz4sV2CfvmDT6MP73dOdNcmOx_K9k,14160 -+glean_parser/validate_ping.py,sha256=0TNvILH6dtzJDys3W8Kqorw6kk03me73OCUDtpoHcXU,2118 -+glean_parser/schemas/metrics.1-0-0.schema.yaml,sha256=cND3cvi6iBfPUVmtfIBQfGJV9AALpbvN7nu8E33_J-o,19566 -+glean_parser/schemas/metrics.2-0-0.schema.yaml,sha256=asAWdpMUkUWDT0sTN26ivoLey50ggGxLUN4aW6OcQpY,22138 -+glean_parser/schemas/pings.1-0-0.schema.yaml,sha256=hwCnsKpEysmrmVp-QHGBArEkVY3vaU1rVsxlTwhAzws,4315 -+glean_parser/schemas/pings.2-0-0.schema.yaml,sha256=rD1s-rfz1xC9biHyLfBCnsoQxVYHwpe_S05awfe2xDA,4363 -+glean_parser/schemas/tags.1-0-0.schema.yaml,sha256=OGXIJlvvVW1vaqB_NVZnwKeZ-sLlfH57vjBSHbj6DNI,1231 -+glean_parser/templates/csharp.jinja2,sha256=tPj09JzgSK0YyNb53WkL8WFTA7fcVXyiJ7V-bARnfM0,4354 -+glean_parser/templates/javascript.jinja2,sha256=Qiv0lxsqVABzdME1MRsmezwtwn8_hHdH9S_v8fJAh-E,2647 -+glean_parser/templates/kotlin.buildinfo.jinja2,sha256=z9tPgvmNnf8E8gpx7FAWh35oXad8Dlv_UrpqN9CXetY,780 -+glean_parser/templates/kotlin.geckoview.jinja2,sha256=K0c1BeKSXDVbshC3gpWALCQFp2JtsoqWhGyN1ScPhC0,5077 -+glean_parser/templates/kotlin.jinja2,sha256=fsFXKI_fKwj5AEO4odJ5sRvoC5geW59_DhU6GATaA90,4475 -+glean_parser/templates/markdown.jinja2,sha256=tOMN62xEGA1p8QoMKnpCVXUiK_jI5GwLuvCnuOROy8c,3381 -+glean_parser/templates/qmldir.jinja2,sha256=m6IGsp-tgTiOfQ7VN8XW6GqX0gJqJkt3B6Pkaul6FVo,156 -+glean_parser/templates/swift.jinja2,sha256=McprjDExS3Ao62_eTvEwl-ZHNIbYDOJe05gv1nd4trM,4791 -+glean_parser-4.3.1.dist-info/AUTHORS.md,sha256=jBsSsn3EpmpLejgHMhzU1XTFwkCARqYeUs9iGLNgwkQ,432 -+glean_parser-4.3.1.dist-info/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725 -+glean_parser-4.3.1.dist-info/METADATA,sha256=WO52mRW8bTLNVllJhXFPdPETSWm74sEm1o7QLJPJF4g,22416 -+glean_parser-4.3.1.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92 -+glean_parser-4.3.1.dist-info/entry_points.txt,sha256=s-clJTIqp-PpJD-n3AnIQZFkTafIrzsTbAPX9vNY018,69 -+glean_parser-4.3.1.dist-info/top_level.txt,sha256=q7T3duD-9tYZFyDry6Wv2LcdMsK2jGnzdDFhxWcT2Z8,13 -+glean_parser-4.3.1.dist-info/RECORD,, -diff --git a/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/WHEEL b/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/WHEEL -rename from third_party/python/glean_parser/glean_parser-3.6.0.dist-info/WHEEL -rename to third_party/python/glean_parser/glean_parser-4.3.1.dist-info/WHEEL ---- a/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/WHEEL -+++ b/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/WHEEL -@@ -1,5 +1,5 @@ - Wheel-Version: 1.0 --Generator: bdist_wheel (0.36.2) -+Generator: bdist_wheel (0.37.0) - Root-Is-Purelib: true - Tag: py3-none-any - -diff --git a/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/entry_points.txt b/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/entry_points.txt -rename from third_party/python/glean_parser/glean_parser-3.6.0.dist-info/entry_points.txt -rename to third_party/python/glean_parser/glean_parser-4.3.1.dist-info/entry_points.txt -diff --git a/third_party/python/glean_parser/glean_parser-3.6.0.dist-info/top_level.txt b/third_party/python/glean_parser/glean_parser-4.3.1.dist-info/top_level.txt -rename from third_party/python/glean_parser/glean_parser-3.6.0.dist-info/top_level.txt -rename to third_party/python/glean_parser/glean_parser-4.3.1.dist-info/top_level.txt -diff --git a/third_party/python/glean_parser/glean_parser/__main__.py b/third_party/python/glean_parser/glean_parser/__main__.py ---- a/third_party/python/glean_parser/glean_parser/__main__.py -+++ b/third_party/python/glean_parser/glean_parser/__main__.py -@@ -63,7 +63,14 @@ - is_flag=True, - help=("Do not treat missing input files as an error."), - ) --def translate(input, format, output, option, allow_reserved, allow_missing_files): -+@click.option( -+ "--require-tags", -+ is_flag=True, -+ help=("Require tags to be specified for metrics and pings."), -+) -+def translate( -+ input, format, output, option, allow_reserved, allow_missing_files, require_tags -+): - """ - Translate metrics.yaml and pings.yaml files to other formats. - """ -@@ -81,6 +88,7 @@ - { - "allow_reserved": allow_reserved, - "allow_missing_files": allow_missing_files, -+ "require_tags": require_tags, - }, - ) - ) -@@ -130,7 +138,12 @@ - is_flag=True, - help=("Do not treat missing input files as an error."), - ) --def glinter(input, allow_reserved, allow_missing_files): -+@click.option( -+ "--require-tags", -+ is_flag=True, -+ help=("Require tags to be specified for metrics and pings."), -+) -+def glinter(input, allow_reserved, allow_missing_files, require_tags): - """ - Runs a linter over the metrics. - """ -@@ -140,6 +153,7 @@ - { - "allow_reserved": allow_reserved, - "allow_missing_files": allow_missing_files, -+ "require_tags": require_tags, - }, - ) - ) -diff --git a/third_party/python/glean_parser/glean_parser/data_review.py b/third_party/python/glean_parser/glean_parser/data_review.py ---- a/third_party/python/glean_parser/glean_parser/data_review.py -+++ b/third_party/python/glean_parser/glean_parser/data_review.py -@@ -135,7 +135,7 @@ - - TODO: Fill this in. - --11. Where do you intend to share the results of your analys -+11. Where do you intend to share the results of your analysis? - - TODO: Fill this in. - -diff --git a/third_party/python/glean_parser/glean_parser/javascript.py b/third_party/python/glean_parser/glean_parser/javascript.py ---- a/third_party/python/glean_parser/glean_parser/javascript.py -+++ b/third_party/python/glean_parser/glean_parser/javascript.py -@@ -11,7 +11,7 @@ - import enum - import json - from pathlib import Path --from typing import Any, Dict, List, Optional, Union, Callable # noqa -+from typing import Any, Dict, Optional, Callable - - from . import metrics - from . import util -@@ -44,7 +44,7 @@ - def class_name_factory(platform: str) -> Callable[[str], str]: - """ - Returns a function that receives an obj_type and -- returns the correct class name for that time in the current platform. -+ returns the correct class name for that type in the current platform. - """ - - def class_name(obj_type: str) -> str: -@@ -63,6 +63,16 @@ - return class_name - - -+def extra_type_name(extra_type: str) -> str: -+ """ -+ Returns the equivalent TypeScript type to an extra type. -+ """ -+ if extra_type == "quantity": -+ return "number" -+ -+ return extra_type -+ -+ - def import_path(obj_type: str) -> str: - """ - Returns the import path of the given object inside the @mozilla/glean package. -@@ -113,9 +123,10 @@ - options = {} - - platform = options.get("platform", "webext") -- if platform not in ["qt", "webext"]: -+ accepted_platforms = ["qt", "webext", "node"] -+ if platform not in accepted_platforms: - raise ValueError( -- f"Unknown platform: {platform}. Accepted platforms are qt and webext." -+ f"Unknown platform: {platform}. Accepted platforms are: {accepted_platforms}." # noqa - ) - version = options.get("version") - if platform == "qt" and version is None: -@@ -127,6 +138,7 @@ - "javascript.jinja2", - filters=( - ("class_name", class_name_factory(platform)), -+ ("extra_type_name", extra_type_name), - ("import_path", import_path), - ("js", javascript_datatypes_filter), - ("args", args), -diff --git a/third_party/python/glean_parser/glean_parser/kotlin.py b/third_party/python/glean_parser/glean_parser/kotlin.py ---- a/third_party/python/glean_parser/glean_parser/kotlin.py -+++ b/third_party/python/glean_parser/glean_parser/kotlin.py -@@ -16,7 +16,9 @@ - - from . import metrics - from . import pings -+from . import tags - from . import util -+from .util import DictWrapper - - - def kotlin_datatypes_filter(value: util.JSONType) -> str: -@@ -176,9 +178,7 @@ - # }, - # "other-type": {} - # } -- gecko_metrics: OrderedDict[ -- str, OrderedDict[str, List[Dict[str, str]]] -- ] = OrderedDict() -+ gecko_metrics: Dict[str, Dict[str, List[Dict[str, str]]]] = DictWrapper() - - # Define scalar-like types. - SCALAR_LIKE_TYPES = ["boolean", "string", "quantity"] -@@ -188,8 +188,10 @@ - # Glean SDK and GeckoView. See bug 1566356 for more context. - for metric in category_val.values(): - # This is not a Gecko metric, skip it. -- if isinstance(metric, pings.Ping) or not getattr( -- metric, "gecko_datapoint", False -+ if ( -+ isinstance(metric, pings.Ping) -+ or isinstance(metric, tags.Tag) -+ or not getattr(metric, "gecko_datapoint", False) - ): - continue - -diff --git a/third_party/python/glean_parser/glean_parser/lint.py b/third_party/python/glean_parser/glean_parser/lint.py ---- a/third_party/python/glean_parser/glean_parser/lint.py -+++ b/third_party/python/glean_parser/glean_parser/lint.py -@@ -23,6 +23,7 @@ - from . import metrics - from . import parser - from . import pings -+from . import tags - from . import util - - -@@ -42,7 +43,7 @@ - """ - Helper function to split words on either `.` or `_`. - """ -- return re.split("[._]", name) -+ return re.split("[._-]", name) - - - def _english_list(items: List[str]) -> str: -@@ -234,6 +235,16 @@ - yield f"Ping '{ping}' seems misspelled. Did you mean '{builtin}'?" - - -+def check_tags_required( -+ metric_or_ping: Union[metrics.Metric, pings.Ping], parser_config: Dict[str, Any] -+) -> LintGenerator: -+ -+ if parser_config.get("require_tags", False) and not len( -+ metric_or_ping.metadata.get("tags", []) -+ ): -+ yield "Tags are required but no tags specified" -+ -+ - def check_user_lifetime_expiration( - metric: metrics.Metric, parser_config: Dict[str, Any] - ) -> LintGenerator: -@@ -262,6 +273,28 @@ - yield ("Metric has expired. Please consider removing it.") - - -+def check_redundant_ping( -+ pings: pings.Ping, parser_config: Dict[str, Any] -+) -> LintGenerator: -+ """ -+ Check if the pings contains 'ping' as the prefix or suffix, or 'ping' or 'custom' -+ """ -+ ping_words = _split_words(pings.name) -+ -+ if len(ping_words) != 0: -+ ping_first_word = ping_words[0] -+ ping_last_word = ping_words[-1] -+ -+ if ping_first_word == "ping": -+ yield ("The prefix 'ping' is redundant.") -+ elif ping_last_word == "ping": -+ yield ("The suffix 'ping' is redundant.") -+ elif "ping" in ping_words: -+ yield ("The word 'ping' is redundant.") -+ elif "custom" in ping_words: -+ yield ("The word 'custom' is redundant.") -+ -+ - # The checks that operate on an entire category of metrics: - # {NAME: (function, is_error)} - CATEGORY_CHECKS: Dict[ -@@ -281,6 +314,7 @@ - "BUG_NUMBER": (check_bug_number, CheckType.error), - "BASELINE_PING": (check_valid_in_baseline, CheckType.error), - "MISSPELLED_PING": (check_misspelled_pings, CheckType.error), -+ "TAGS_REQUIRED": (check_tags_required, CheckType.error), - "EXPIRATION_DATE_TOO_FAR": (check_expired_date, CheckType.warning), - "USER_LIFETIME_EXPIRATION": (check_user_lifetime_expiration, CheckType.warning), - "EXPIRED": (check_expired_metric, CheckType.warning), -@@ -293,6 +327,8 @@ - str, Tuple[Callable[[pings.Ping, dict], LintGenerator], CheckType] - ] = { - "BUG_NUMBER": (check_bug_number, CheckType.error), -+ "TAGS_REQUIRED": (check_tags_required, CheckType.error), -+ "REDUNDANT_PING": (check_redundant_ping, CheckType.error), - } - - -@@ -310,10 +346,32 @@ - ) - - -+def _lint_item_tags( -+ item_name: str, -+ item_type: str, -+ item_tag_names: List[str], -+ valid_tag_names: List[str], -+) -> List[GlinterNit]: -+ invalid_tags = [tag for tag in item_tag_names if tag not in valid_tag_names] -+ return ( -+ [ -+ GlinterNit( -+ "INVALID_TAGS", -+ item_name, -+ f"Invalid tags specified in {item_type}: {', '.join(invalid_tags)}", -+ CheckType.error, -+ ) -+ ] -+ if len(invalid_tags) -+ else [] -+ ) -+ -+ - def _lint_pings( -- category: Dict[str, Union[metrics.Metric, pings.Ping]], -+ category: Dict[str, Union[metrics.Metric, pings.Ping, tags.Tag]], - parser_config: Dict[str, Any], --): -+ valid_tag_names: List[str], -+) -> List[GlinterNit]: - nits: List[GlinterNit] = [] - - for (ping_name, ping) in sorted(list(category.items())): -@@ -331,7 +389,14 @@ - ) - for msg in new_nits - ) -- -+ nits.extend( -+ _lint_item_tags( -+ ping_name, -+ "ping", -+ ping.metadata.get("tags", []), -+ valid_tag_names, -+ ) -+ ) - return nits - - -@@ -351,12 +416,17 @@ - parser_config = {} - - nits: List[GlinterNit] = [] -+ valid_tag_names = [tag for tag in objs.get("tags", [])] - for (category_name, category) in sorted(list(objs.items())): - if category_name == "pings": -- nits.extend(_lint_pings(category, parser_config)) -+ nits.extend(_lint_pings(category, parser_config, valid_tag_names)) - continue - -- # Make sure the category has only Metrics, not Pings -+ if category_name == "tags": -+ # currently we have no linting for tags -+ continue -+ -+ # Make sure the category has only Metrics, not Pings or Tags - category_metrics = dict( - (name, metric) - for (name, metric) in category.items() -@@ -388,6 +458,16 @@ - for msg in new_nits - ) - -+ # also check that tags for metric are valid -+ nits.extend( -+ _lint_item_tags( -+ ".".join([metric.category, metric.name]), -+ "metric", -+ metric.metadata.get("tags", []), -+ valid_tag_names, -+ ) -+ ) -+ - if len(nits): - print("Sorry, Glean found some glinter nits:", file=file) - for nit in nits: -diff --git a/third_party/python/glean_parser/glean_parser/metrics.py b/third_party/python/glean_parser/glean_parser/metrics.py ---- a/third_party/python/glean_parser/glean_parser/metrics.py -+++ b/third_party/python/glean_parser/glean_parser/metrics.py -@@ -13,6 +13,7 @@ - - - from . import pings -+from . import tags - from . import util - - -@@ -47,6 +48,7 @@ - description: str, - notification_emails: List[str], - expires: Any, -+ metadata: Optional[Dict] = None, - data_reviews: Optional[List[str]] = None, - version: int = 0, - disabled: bool = False, -@@ -71,6 +73,9 @@ - self.description = description - self.notification_emails = notification_emails - self.expires = expires -+ if metadata is None: -+ metadata = {} -+ self.metadata = metadata - if data_reviews is None: - data_reviews = [] - self.data_reviews = data_reviews -@@ -312,7 +317,8 @@ - def allowed_extra_keys_with_types(self): - # Sort keys so that output is deterministic - return sorted( -- [(k, v["type"]) for (k, v) in self.extra_keys.items()], key=lambda x: x[0] -+ [(k, v.get("type", "string")) for (k, v) in self.extra_keys.items()], -+ key=lambda x: x[0], - ) - - @property -@@ -338,6 +344,10 @@ - typename = "uuid" - - -+class Url(Metric): -+ typename = "url" -+ -+ - class Jwe(Metric): - typename = "jwe" - -@@ -391,4 +401,8 @@ - super().__init__(*args, **kwargs) - - --ObjectTree = Dict[str, Dict[str, Union[Metric, pings.Ping]]] -+class Text(Metric): -+ typename = "text" -+ -+ -+ObjectTree = Dict[str, Dict[str, Union[Metric, pings.Ping, tags.Tag]]] -diff --git a/third_party/python/glean_parser/glean_parser/parser.py b/third_party/python/glean_parser/glean_parser/parser.py ---- a/third_party/python/glean_parser/glean_parser/parser.py -+++ b/third_party/python/glean_parser/glean_parser/parser.py -@@ -8,7 +8,6 @@ - Code for parsing metrics.yaml files. - """ - --from collections import OrderedDict - import functools - from pathlib import Path - import textwrap -@@ -19,7 +18,9 @@ - - from .metrics import Metric, ObjectTree - from .pings import Ping, RESERVED_PING_NAMES -+from .tags import Tag - from . import util -+from .util import DictWrapper - - - ROOT_DIR = Path(__file__).parent -@@ -27,6 +28,7 @@ - - METRICS_ID = "moz://mozilla.org/schemas/glean/metrics/2-0-0" - PINGS_ID = "moz://mozilla.org/schemas/glean/pings/2-0-0" -+TAGS_ID = "moz://mozilla.org/schemas/glean/tags/1-0-0" - - - def _update_validator(validator): -@@ -90,7 +92,7 @@ - except IndexError: - filetype = None - -- if filetype not in ("metrics", "pings"): -+ if filetype not in ("metrics", "pings", "tags"): - filetype = None - - for error in validate(content, filepath): -@@ -207,7 +209,7 @@ - "Glean internal use.", - ) - continue -- all_objects.setdefault(category_key, OrderedDict()) -+ all_objects.setdefault(category_key, DictWrapper()) - - if not isinstance(category_val, dict): - raise TypeError(f"Invalid content for {category_key}") -@@ -222,6 +224,7 @@ - filepath, - f"On instance {category_key}.{metric_key}", - str(e), -+ metric_val.defined_in["line"], - ) - metric_obj = None - else: -@@ -234,14 +237,15 @@ - f"On instance {category_key}.{metric_key}", - 'Only internal metrics may specify "all-pings" ' - 'in "send_in_pings"', -+ metric_val.defined_in["line"], - ) - metric_obj = None - - if metric_obj is not None: - metric_obj.no_lint = list(set(metric_obj.no_lint + global_no_lint)) - -- if isinstance(filepath, Path): -- metric_obj.defined_in["filepath"] = str(filepath) -+ if isinstance(filepath, Path): -+ metric_obj.defined_in["filepath"] = str(filepath) - - already_seen = sources.get((category_key, metric_key)) - if already_seen is not None: -@@ -253,6 +257,7 @@ - f"Duplicate metric name '{category_key}.{metric_key}' " - f"already defined in '{already_seen}'" - ), -+ metric_obj.defined_in["line"], - ) - else: - all_objects[category_key][metric_key] = metric_obj -@@ -319,6 +324,58 @@ - sources[ping_key] = filepath - - -+def _instantiate_tags( -+ all_objects: ObjectTree, -+ sources: Dict[Any, Path], -+ content: Dict[str, util.JSONType], -+ filepath: Path, -+ config: Dict[str, Any], -+) -> Generator[str, None, None]: -+ """ -+ Load a list of tags.yaml files, convert the JSON information into Tag -+ objects. -+ """ -+ global_no_lint = content.get("no_lint", []) -+ assert isinstance(global_no_lint, list) -+ -+ for tag_key, tag_val in content.items(): -+ if tag_key.startswith("$"): -+ continue -+ if tag_key == "no_lint": -+ continue -+ if not isinstance(tag_val, dict): -+ raise TypeError(f"Invalid content for tag {tag_key}") -+ tag_val["name"] = tag_key -+ try: -+ tag_obj = Tag( -+ defined_in=getattr(tag_val, "defined_in", None), -+ _validated=True, -+ **tag_val, -+ ) -+ except Exception as e: -+ yield util.format_error(filepath, f"On instance '{tag_key}'", str(e)) -+ continue -+ -+ if tag_obj is not None: -+ tag_obj.no_lint = list(set(tag_obj.no_lint + global_no_lint)) -+ -+ if isinstance(filepath, Path) and tag_obj.defined_in is not None: -+ tag_obj.defined_in["filepath"] = str(filepath) -+ -+ already_seen = sources.get(tag_key) -+ if already_seen is not None: -+ # We've seen this tag name already -+ yield util.format_error( -+ filepath, -+ "", -+ f"Duplicate tag name '{tag_key}' " -+ f"already defined in '{already_seen}'", -+ ) -+ else: -+ all_objects.setdefault("tags", {})[tag_key] = tag_obj -+ sources[tag_key] = filepath -+ -+ - def _preprocess_objects(objs: ObjectTree, config: Dict[str, Any]) -> ObjectTree: - """ - Preprocess the object tree to better set defaults. -@@ -348,7 +405,7 @@ - ) -> Generator[str, None, ObjectTree]: - """ - Parse one or more metrics.yaml and/or pings.yaml files, returning a tree of -- `metrics.Metric` and `pings.Ping` instances. -+ `metrics.Metric`, `pings.Ping`, and `tags.Tag` instances. - - The result is a generator over any errors. If there are no errors, the - actual metrics can be obtained from `result.value`. For example:: -@@ -360,11 +417,11 @@ - - The result value is a dictionary of category names to categories, where - each category is a dictionary from metric name to `metrics.Metric` -- instances. There is also the special category `pings` containing all -- of the `pings.Ping` instances. -+ instances. There are also the special categories `pings` and `tags` -+ containing all of the `pings.Ping` and `tags.Tag` instances, respectively. - -- :param filepaths: list of Path objects to metrics.yaml and/or pings.yaml -- files -+ :param filepaths: list of Path objects to metrics.yaml, pings.yaml, and/or -+ tags.yaml files - :param config: A dictionary of options that change parsing behavior. - Supported keys are: - -@@ -379,7 +436,7 @@ - if config is None: - config = {} - -- all_objects: ObjectTree = OrderedDict() -+ all_objects: ObjectTree = DictWrapper() - sources: Dict[Any, Path] = {} - filepaths = util.ensure_list(filepaths) - for filepath in filepaths: -@@ -392,5 +449,8 @@ - yield from _instantiate_pings( - all_objects, sources, content, filepath, config - ) -- -+ elif filetype == "tags": -+ yield from _instantiate_tags( -+ all_objects, sources, content, filepath, config -+ ) - return _preprocess_objects(all_objects, config) -diff --git a/third_party/python/glean_parser/glean_parser/pings.py b/third_party/python/glean_parser/glean_parser/pings.py ---- a/third_party/python/glean_parser/glean_parser/pings.py -+++ b/third_party/python/glean_parser/glean_parser/pings.py -@@ -14,7 +14,7 @@ - from . import util - - --RESERVED_PING_NAMES = ["baseline", "metrics", "events", "deletion-request"] -+RESERVED_PING_NAMES = ["baseline", "metrics", "events", "deletion-request", "default"] - - - class Ping: -@@ -24,6 +24,7 @@ - description: str, - bugs: List[str], - notification_emails: List[str], -+ metadata: Optional[Dict] = None, - data_reviews: Optional[List[str]] = None, - include_client_id: bool = False, - send_if_empty: bool = False, -@@ -40,6 +41,9 @@ - - self.bugs = bugs - self.notification_emails = notification_emails -+ if metadata is None: -+ metadata = {} -+ self.metadata = metadata - if data_reviews is None: - data_reviews = [] - self.data_reviews = data_reviews -@@ -53,7 +57,7 @@ - no_lint = [] - self.no_lint = no_lint - -- # _validated indicates whether this metric has already been jsonschema -+ # _validated indicates whether this ping has already been jsonschema - # validated (but not any of the Python-level validation). - if not _validated: - data: Dict[str, util.JSONType] = { -diff --git a/third_party/python/glean_parser/glean_parser/schemas/metrics.2-0-0.schema.yaml b/third_party/python/glean_parser/glean_parser/schemas/metrics.2-0-0.schema.yaml ---- a/third_party/python/glean_parser/glean_parser/schemas/metrics.2-0-0.schema.yaml -+++ b/third_party/python/glean_parser/glean_parser/schemas/metrics.2-0-0.schema.yaml -@@ -94,6 +94,8 @@ - - - `uuid`: Record a UUID v4. - -+ - `url`: Record a valid URL string. -+ - - `memory_distribution`: A histogram for recording memory usage - values. Additional properties: `memory_unit`. - -@@ -115,6 +117,8 @@ - - `labeled_boolean`, `labeled_string`, `labeled_counter`. - -+ - `text`: Record long text data. -+ - type: string - enum: - - event -@@ -129,11 +133,13 @@ - - memory_distribution - - datetime - - uuid -+ - url - - jwe - - labeled_boolean - - labeled_string - - labeled_counter - - rate -+ - text - - description: - title: Description -@@ -147,6 +153,22 @@ - syntax](https://www.markdownguide.org/basic-syntax/). - type: string - -+ metadata: -+ title: Metadata -+ description: | -+ Additional metadata about this metric. Currently limited to a list of -+ tags. -+ type: object -+ properties: -+ tags: -+ title: Tags -+ description: Which tags are specified for this metric. -+ type: array -+ items: -+ type: string -+ maxLength: 80 -+ default: {} -+ - lifetime: - title: Lifetime - description: | -@@ -513,6 +535,9 @@ - - not: - description: "'pings' is reserved as a category name." - const: pings -+ - not: -+ description: "'tags' is reserved as a category name." -+ const: tags - - enum: ['$schema'] - - properties: -@@ -622,3 +647,41 @@ - description: | - `denominator_metric` is only allowed for `rate`. - maxLength: 0 -+ - -+ if: -+ properties: -+ type: -+ const: text -+ then: -+ properties: -+ lifetime: -+ description: > -+ Text metrics must have ping or application lifetime. -+ enum: -+ - ping -+ - application -+ -+ data_sensitivity: -+ description: > -+ Text metrics require Category 3 (`web_activity`) -+ or Category 4 (`highly_sensitive`). -+ type: array -+ items: -+ enum: -+ - web_activity -+ - highly_sensitive -+ -+ send_in_pings: -+ description: | -+ Text metrics can only be sent in custom pings. -+ Built-in pings are not allowed. -+ type: array -+ items: -+ allOf: -+ - $ref: "#/definitions/kebab_case" -+ - not: -+ description: > -+ Text metrics can only be sent in custom pings. -+ Built-in pings are not allowed." -+ pattern: -+ "^(metrics|baseline|events|deletion-request|default|glean_.*)$" -diff --git a/third_party/python/glean_parser/glean_parser/schemas/pings.2-0-0.schema.yaml b/third_party/python/glean_parser/glean_parser/schemas/pings.2-0-0.schema.yaml ---- a/third_party/python/glean_parser/glean_parser/schemas/pings.2-0-0.schema.yaml -+++ b/third_party/python/glean_parser/glean_parser/schemas/pings.2-0-0.schema.yaml -@@ -62,6 +62,22 @@ - syntax](https://www.markdownguide.org/basic-syntax/). - type: string - -+ metadata: -+ title: Metadata -+ description: | -+ Additional metadata about this ping. Currently limited to a list of -+ tags. -+ type: object -+ properties: -+ tags: -+ title: Tags -+ description: Which tags are specified for this ping. -+ type: array -+ items: -+ type: string -+ maxLength: 80 -+ default: {} -+ - include_client_id: - title: Include client id - description: | -diff --git a/third_party/python/glean_parser/glean_parser/schemas/tags.1-0-0.schema.yaml b/third_party/python/glean_parser/glean_parser/schemas/tags.1-0-0.schema.yaml -new file mode 100644 ---- /dev/null -+++ b/third_party/python/glean_parser/glean_parser/schemas/tags.1-0-0.schema.yaml -@@ -0,0 +1,51 @@ -+# This Source Code Form is subject to the terms of the Mozilla Public -+# License, v. 2.0. If a copy of the MPL was not distributed with this -+# file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ -+--- -+$schema: http://json-schema.org/draft-07/schema# -+title: Tags -+description: | -+ Schema for the tags.yaml files for Mozilla's Glean telemetry SDK. -+ -+ The top-level of the `tags.yaml` file has a key defining the name of each -+ tag. The values contain metadata about that tag (currently just a -+ description). -+ -+$id: moz://mozilla.org/schemas/glean/tags/1-0-0 -+ -+type: object -+ -+propertyNames: -+ type: string -+ maxLength: 80 -+ -+properties: -+ $schema: -+ type: string -+ format: url -+ -+ no_lint: -+ title: Lint checks to skip globally -+ description: | -+ This parameter lists any lint checks to skip for this whole file. -+ type: array -+ items: -+ type: string -+ -+additionalProperties: -+ type: object -+ properties: -+ description: -+ title: Description -+ description: | -+ **Required.** -+ -+ A textual description of this tag. -+ -+ Descriptions may contain [markdown -+ syntax](https://www.markdownguide.org/basic-syntax/). -+ type: string -+ required: -+ - description -+ additionalProperties: false -diff --git a/third_party/python/glean_parser/glean_parser/swift.py b/third_party/python/glean_parser/glean_parser/swift.py ---- a/third_party/python/glean_parser/glean_parser/swift.py -+++ b/third_party/python/glean_parser/glean_parser/swift.py -@@ -15,6 +15,7 @@ - - from . import metrics - from . import pings -+from . import tags - from . import util - - # An (imcomplete) list of reserved keywords in Swift. -@@ -139,7 +140,7 @@ - """ - - name: str -- objs: Dict[str, Union[metrics.Metric, pings.Ping]] -+ objs: Dict[str, Union[metrics.Metric, pings.Ping, tags.Tag]] - contains_pings: bool - - -diff --git a/third_party/python/glean_parser/glean_parser/tags.py b/third_party/python/glean_parser/glean_parser/tags.py -new file mode 100644 ---- /dev/null -+++ b/third_party/python/glean_parser/glean_parser/tags.py -@@ -0,0 +1,49 @@ -+from typing import Dict, List, Optional -+from . import util -+ -+ -+class Tag: -+ def __init__( -+ self, -+ name: str, -+ description: str, -+ defined_in: Optional[Dict] = None, -+ no_lint: Optional[List[str]] = None, -+ _validated: bool = False, -+ ): -+ # Avoid cyclical import -+ from . import parser -+ -+ self.name = name -+ self.description = description -+ self.defined_in = defined_in -+ if no_lint is None: -+ no_lint = [] -+ self.no_lint = no_lint -+ -+ # _validated indicates whether this tag has already been jsonschema -+ # validated (but not any of the Python-level validation). -+ if not _validated: -+ data: Dict[str, util.JSONType] = { -+ "$schema": parser.TAGS_ID, -+ self.name: self._serialize_input(), -+ } -+ for error in parser.validate(data): -+ raise ValueError(error) -+ -+ @property -+ def type(self) -> str: -+ return "tag" -+ -+ def _serialize_input(self) -> Dict[str, util.JSONType]: -+ d = self.serialize() -+ modified_dict = util.remove_output_params(d, "defined_in") -+ return modified_dict -+ -+ def serialize(self) -> Dict[str, util.JSONType]: -+ """ -+ Serialize the tag back to JSON object model. -+ """ -+ d = self.__dict__.copy() -+ del d["name"] -+ return d -diff --git a/third_party/python/glean_parser/glean_parser/templates/javascript.jinja2 b/third_party/python/glean_parser/glean_parser/templates/javascript.jinja2 ---- a/third_party/python/glean_parser/glean_parser/templates/javascript.jinja2 -+++ b/third_party/python/glean_parser/glean_parser/templates/javascript.jinja2 -@@ -1,7 +1,11 @@ - {# The final Javascript/Typescript code is autogenerated, but this - Jinja2 template is not. Please file bugs! #} - {% macro obj_declaration(obj) %} --new {{ obj.type|class_name }}({ -+new {{ obj.type|class_name }}{% if obj.extra_keys and lang == "typescript" %}<{ -+ {% for name, type in obj.allowed_extra_keys_with_types %} -+ {{ name }}?: {{ type|extra_type_name }}, -+ {% endfor %} -+}>{% endif %}({ - {% for arg_name in (obj.type|args).common if obj[arg_name] is defined %} - {{ arg_name|camelize }}: {{ obj[arg_name]|js }}, - {% endfor %} -@@ -20,14 +24,15 @@ - - {% if platform != "qt" %} - {% if has_labeled_metrics %} --import LabeledMetricType from "@mozilla/glean/{{ platform }}/private/metrics/labeled"; -+import LabeledMetricType from "@mozilla/glean/private/metrics/labeled"; - {% endif %} - {% for type in types %} --import {{ type|class_name }} from "@mozilla/glean/{{ platform }}/private/{{ type|import_path }}"; -+import {{ type|class_name }} from "@mozilla/glean/private/{{ type|import_path }}"; - {% endfor %} - {% else %} - .import org.mozilla.Glean {{ version }} as Glean - {% endif %} -+ - {% for obj in objs.values() %} - /** - * {{ obj.description|wordwrap() | replace("\n", "\n * ") }} -@@ -40,4 +45,29 @@ - {% if platform != "qt" %}export {% endif %}const {{ obj.name|camelize }} = {{ obj_declaration(obj) }}; - {% endif %} - -+{% if obj|attr("_generate_enums") %} -+{% for name, suffix in obj["_generate_enums"] %} -+{% if obj|attr(name)|length and name == "reason_codes" %} -+/** -+ * Reason codes for `{{ obj.identifier() }}`. -+ * -+ * @readonly -+ * @enum {string} -+ */ -+{% if lang == "typescript" %} -+export enum {{ obj.name|Camelize }}{{ name|Camelize }} { -+ {% for key in obj|attr(name) %} -+ {{ key|Camelize }} = "{{ key }}", -+ {% endfor %} -+} -+{% else %} -+{% if platform != "qt" %}export {% endif %}const {{ obj.name|Camelize }}{{ name|Camelize }} = { -+ {% for key in obj|attr(name) %} -+ "{{ key|Camelize }}": "{{ key }}", -+ {% endfor %} -+} -+{% endif %} -+{% endif %} - {% endfor %} -+{% endif %} -+{% endfor %} -diff --git a/third_party/python/glean_parser/glean_parser/translate.py b/third_party/python/glean_parser/glean_parser/translate.py ---- a/third_party/python/glean_parser/glean_parser/translate.py -+++ b/third_party/python/glean_parser/glean_parser/translate.py -@@ -148,6 +148,9 @@ - if parser_config.get("allow_reserved"): - options["allow_reserved"] = True - -+ # We don't render tags anywhere yet. -+ all_objects.value.pop("tags", None) -+ - # Write everything out to a temporary directory, and then move it to the - # real directory, for transactional integrity. - with tempfile.TemporaryDirectory() as tempdir: -diff --git a/third_party/python/glean_parser/glean_parser/util.py b/third_party/python/glean_parser/glean_parser/util.py ---- a/third_party/python/glean_parser/glean_parser/util.py -+++ b/third_party/python/glean_parser/glean_parser/util.py -@@ -11,7 +11,7 @@ - from pathlib import Path - import sys - import textwrap --from typing import Any, Callable, Iterable, Sequence, Tuple, Union -+from typing import Any, Callable, Iterable, Sequence, Tuple, Union, Optional - import urllib.request - - import appdirs # type: ignore -@@ -39,6 +39,20 @@ - # https://stackoverflow.com/questions/34667108/ignore-dates-and-times-while-parsing-yaml - - -+# A wrapper around OrderedDict for Python < 3.7 (where dict ordering is not -+# maintained by default), and regular dict everywhere else. -+if sys.version_info < (3, 7): -+ -+ class DictWrapper(OrderedDict): -+ pass -+ -+ -+else: -+ -+ class DictWrapper(dict): -+ pass -+ -+ - class _NoDatesSafeLoader(yaml.SafeLoader): - @classmethod - def remove_implicit_resolver(cls, tag_to_remove): -@@ -77,7 +91,7 @@ - - def _construct_mapping_adding_line(loader, node): - loader.flatten_mapping(node) -- mapping = OrderedDict(loader.construct_pairs(node)) -+ mapping = DictWrapper(loader.construct_pairs(node)) - mapping.defined_in = {"line": node.start_mark.line} - return mapping - -@@ -96,7 +110,7 @@ - yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, data.items() - ) - -- OrderedDumper.add_representer(OrderedDict, _dict_representer) -+ OrderedDumper.add_representer(DictWrapper, _dict_representer) - return yaml.dump(data, Dumper=OrderedDumper, **kwargs) - - -@@ -112,7 +126,7 @@ - """ - # If in py.test, support bits of literal JSON/YAML content - if TESTING_MODE and isinstance(path, dict): -- return path -+ return yaml_load(yaml.dump(path)) - - if path.suffix == ".json": - with path.open("r", encoding="utf-8") as fd: -@@ -313,12 +327,19 @@ - - description = error.schema.get("description") - if description: -- parts.extend(["", "Documentation for this node:", _utils.indent(description)]) -+ parts.extend( -+ ["", "Documentation for this node:", textwrap.indent(description, " ")] -+ ) - - return "\n".join(parts) - - --def format_error(filepath: Union[str, Path], header: str, content: str) -> str: -+def format_error( -+ filepath: Union[str, Path], -+ header: str, -+ content: str, -+ lineno: Optional[int] = None, -+) -> str: - """ - Format a jsonshema validation error. - """ -@@ -326,10 +347,12 @@ - filepath = filepath.resolve() - else: - filepath = "" -+ if lineno: -+ filepath = f"{filepath}:{lineno}" - if header: -- return f"{filepath}: {header}\n{_utils.indent(content)}" -+ return f"{filepath}: {header}\n{textwrap.indent(content, ' ')}" - else: -- return f"{filepath}:\n{_utils.indent(content)}" -+ return f"{filepath}:\n{textwrap.indent(content, ' ')}" - - - def parse_expires(expires: str) -> datetime.date: -diff --git a/third_party/python/requirements.in b/third_party/python/requirements.in ---- a/third_party/python/requirements.in -+++ b/third_party/python/requirements.in -@@ -15,7 +15,7 @@ - esprima==4.0.1 - fluent.migrate==0.11 - fluent.syntax==0.18.1 --glean_parser==3.6.0 -+glean_parser==4.3.1 - jsmin==2.1.0 - json-e==2.7.0 - mozilla-version==0.3.4 -diff --git a/third_party/python/requirements.txt b/third_party/python/requirements.txt ---- a/third_party/python/requirements.txt -+++ b/third_party/python/requirements.txt -@@ -162,9 +162,9 @@ - # -r requirements-mach-vendor-python.in - # compare-locales - # fluent.migrate --glean_parser==3.6.0 \ -- --hash=sha256:1da46764d93ec563eb93235bd477814444742d1ee6b5231dc6684cebf46a6057 \ -- --hash=sha256:655a2038ec0be5364f351f592d5476fe7b028ebb0d9fd75f07c6c54287859552 -+glean_parser==4.3.1 \ -+ --hash=sha256:a8924a3a4aca7fba35dc69d93031993d6481c6ec9cd43362c068eb3e18ea43e8 \ -+ --hash=sha256:c194aba35a57ff9d139527c5321ef526599794994e355bad4c314bd3ab64c3eb - # via -r requirements-mach-vendor-python.in - idna-ssl==1.1.0 \ - --hash=sha256:a933e3bb13da54383f9e8f35dc4f9cb9eb9b3b78c6b36f311254d6d0d92c6c7c -diff --git a/third_party/rust/glean-core/.cargo-checksum.json b/third_party/rust/glean-core/.cargo-checksum.json ---- a/third_party/rust/glean-core/.cargo-checksum.json -+++ b/third_party/rust/glean-core/.cargo-checksum.json -@@ -1 +1 @@ --{"files":{"Cargo.lock":"160efaf0386c8c6b321d94b4d24ea0993603a921e342c43934aca1912f65d62e","Cargo.toml":"028150cbc9ce890ea9186c1903d18809476a27a66f4211c65884995ad5044ae8","LICENSE":"1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5","README.md":"026495898699b54608eb4ec16074ffafc57920d80ccb59961c501a1ea28c9985","examples/sample.rs":"05469332ffa58c661628eb2f260dfd59085c371b0ef0f8b6e9cb77c230b9bb04","src/common_metric_data.rs":"0ce52740ab6d880df5127336ced68be30da568cd2a94301dc16d4e3f527134c9","src/coverage.rs":"49613fd310bd24d779472720975fbe6c97ec370a95eb55f10afa43f67539c942","src/database/mod.rs":"458e3c8af2af5345e02dea32b36f7521d4428c2ea65c225337008af56d00c6f6","src/debug.rs":"53b19f5a1ba8b35ab1ce78332cb2e8283b2068c9068d71c3be1f58bd8af792c3","src/error.rs":"97172a791efdf8b791a04ae7961085fbef4391b313ff3ffb24e9381f2901fccc","src/error_recording.rs":"42af60683cb30eba821b955fe156ce43a114c0f6f3f3b5b84566659398137671","src/event_database/mod.rs":"95d665a039236ede25dd479b19f0ddc32c0dd79cef2fbcc2ef3bab1540680276","src/histogram/exponential.rs":"389d48bab03f7229445ee4d4c8a4c49f6b43303f658dc954da75142f3c040dc6","src/histogram/functional.rs":"1a63a305b48bcef7bc38136b40d916df4bb8f098dc602514ada54a9b091f6951","src/histogram/linear.rs":"5642c8983c3c1ce9b69c6ac99133c8ed5e67abe2398c5dbcf67e69d66880f4ca","src/histogram/mod.rs":"11e5d3b6440a33a3e5544d0e03ffd69fa2fdcabe603ad75e0327f3ed548e8ce3","src/internal_metrics.rs":"5626effec67bf0f9ee12609b77cf04741eac1827123039999d4adb28a3cc5976","src/internal_pings.rs":"5ed4669b6f09d660401f44c8279e0a5fea0262e48de40e85595bd25dc70b05f3","src/lib.rs":"49f36f867e0412d514fdddee9c40d71e020dbc27fe0efebe6808d9a16872b986","src/lib_unit_tests.rs":"17b0eaad81f946ddef89ee076f4d138e427638ee7536be128b30d4e7280dcf7b","src/macros.rs":"3f3fc8c36dd05b7528b66b27e95b6494505a7a1f48abd013218de23ada6b5a43","src/metrics/boolean.rs":"49e2f5be78055f61543db1d4d57cc06064a812a8f45c9d0e753df8325edc9041","src/metrics/counter.rs":"e3e2a195b597ea1559991b992f44a8a5f291b592a5c6946e93e01066f276efbb","src/metrics/custom_distribution.rs":"7ea1c54802e15bb490fdc8b396998ec474bfca2f135902a4028a9530fbb5dd98","src/metrics/datetime.rs":"75f0b7c41301eb881decff363947510a6cc1a9d2203357be32d1ee169c22ff4c","src/metrics/denominator.rs":"511e4123779a6d9159bb0911069f7dcb979899a0fae0d200da854685b59d3348","src/metrics/event.rs":"d6e4a52dbde7fbd44c21df567508c35acf046e08c6ea593bbb65fa25223a2b40","src/metrics/experiment.rs":"3f3ede015bb63fd5f71fc6a90421b25d8002faf71c0766b27bf59b5ae8b8d0da","src/metrics/jwe.rs":"8e1c2e204c285a428cf58f0e7d7ee0662294208b6b48706658a6f44cf412575a","src/metrics/labeled.rs":"c8ef8419447cc0f659eacfd685f6db806e38588bf4792ab97f468b9b23f644d8","src/metrics/memory_distribution.rs":"c2d75dfe9f67a21087b36af64816e703e6b56551b970fac642552116af97f2b5","src/metrics/memory_unit.rs":"d7a678e5242febd021283b30c0099a9e62729944816a3f17d2d91e2808bc0570","src/metrics/mod.rs":"069b6790de4abcaeb8ec06797a1e85344baff6b86844508b2d75d67eb00dc5d5","src/metrics/ping.rs":"b9d344cbfdbe8aff99a83423bd0af465a7228b503f92fe912ddac24904f4eca9","src/metrics/quantity.rs":"2eb6e34f7b0a292df26cddb4295bca7b82557320eff157bf854822c4a7fccb7e","src/metrics/rate.rs":"ba297a593d340568ee1f8061a6ba4f8970220ab2a83c7af290393538c6dd9bc4","src/metrics/string.rs":"8b47de25d4354c9ccf71a5558b287241a4d80c5832ac82e280543bb800996f54","src/metrics/string_list.rs":"c956616cfd1d0fce3c2e61f0b054235f455db2295d128f08b3db2ddcdd11bdbe","src/metrics/time_unit.rs":"9bb3f6c03b1d385008b254f36ed35daf22f9a6fa2d18e007c9b70aac767cde50","src/metrics/timespan.rs":"1252babc991f8c79cbd5027f3a332c28eb63fb0a956d19a18c670ab4f2e60ba3","src/metrics/timing_distribution.rs":"b885514ef2e84c970403f85bcdb09a24abf9822dbd78129fba9d37de388520a8","src/metrics/url.rs":"b83b1de16d2397fa31e52855ccc024a050c0b429af8ffb3ff1519b68b923241d","src/metrics/uuid.rs":"ebe5560fcc76b230d304172f0ab69dc3f5e41924dad8aa30090bd38b103d0ade","src/ping/mod.rs":"0d164c2ec2822658d571356f3d00f24410f9c1e63f31101fc5d0fb20a014ee1b","src/scheduler.rs":"829846308ae9ed558fbaa62e8134ec90571803673d304c8ce370de7117e1cc76","src/storage/mod.rs":"58fc22abaa2c3643a15992ea02c664909a8d6446e5a259044b4780895b2faf10","src/system.rs":"2e2a7436075bd1a34c118202a4d18e58236947696ce3d824e97d9c06ddf0c171","src/traits/boolean.rs":"f17f16f379b777e435e38e810e25336a919f4aeeefb1b4e7cf7749c0ef173fd9","src/traits/counter.rs":"631208036059d498a4485c74c2a80c24a5f13bffeb1053bdf5cce06af0e9d361","src/traits/custom_distribution.rs":"1b3ffda6e857bfa8ad5be412e88f3d9706ededf5a86407364ae19a81f06ef798","src/traits/datetime.rs":"2f4b9e64161c15c912b6a915045dd9840f76229d144a4d1542c54eb4f3b3406b","src/traits/event.rs":"ce9a9395748734b241f35b31c4cddf0ce6a8eca6d700aaeea427b0ae29ce507d","src/traits/jwe.rs":"80cdc61e6d99d7c05139c9d05288290c731b1be61afcbd4a4c415973665ea194","src/traits/labeled.rs":"7f3281fc0a1a745238e7e260463f397dfa61717408fe9d260dc9767d9c659e52","src/traits/memory_distribution.rs":"0b72ffde68eb97f01a57afbc5c6109565ec9435561984d34696622bf5a57d559","src/traits/mod.rs":"88cec83fcff8dfab768953b901ee95fed186f7540afdc9606407aff71f1919df","src/traits/numerator.rs":"9690a1b4487521565bd488e9a938aa66f93045c63f0f0ee6e864e0341395659b","src/traits/ping.rs":"8831c106c03afeb458b0b028fa1ce61f056ebf8e82bc0a171a1bff255d920748","src/traits/quantity.rs":"087d7a4b58f0eb7c766a0202dcf38a52d172ce4edf626211ffe5d94ed02ae754","src/traits/rate.rs":"9d0da25895d4c43cdece43dd57e515ab2fb907e8c9a239807976e3d9197d2955","src/traits/string.rs":"48e5623c7db59b8e6454fbc7fb6e2395f808c9a0fa721d7c07b72abb171eb1ad","src/traits/string_list.rs":"5d5773d5a130323dd82ca95f4ecdccdd6b237afe2eadf8655363bd6b7e8508c1","src/traits/timespan.rs":"29251233847c5cdd200a61472132c62ded27fe2c13835b09424384bf144d82db","src/traits/timing_distribution.rs":"5e619d445e6ef3f19ca69bcdfe02d19b150c5a46855d195703b6d2f55e538636","src/traits/url.rs":"a01331623af4fa8af6e71becffff60060832bef5e48a15df6dc23b41225f689e","src/traits/uuid.rs":"bd78515611ba406d8b1bda35a9fe30c317512a9afcea7c5dece8fced7d410a92","src/upload/directory.rs":"571cfee0347b40b239d0d946625de6265bbea4f433c8316da715ded8f590aca1","src/upload/mod.rs":"34bcb67a5980e2c8b5145553b83e130ed4db40dab6d5c53bc9978469e6b93223","src/upload/policy.rs":"c250957a37783e74af8002cd80ba06ef9780a389fb0f61b8b665b79688f0a360","src/upload/request.rs":"7939e77bde4b55263446c3660b6831bafa27308bc983a51e1679321e962f372f","src/upload/result.rs":"d73454e81f185e4e28c887f7b496bffad7baac74c8f1b719885f940f909a530d","src/util.rs":"a89e21f0f4fe14a5a1a5369a0f2c20d1184816ccfe2b5b1599d3779660772f27","tests/boolean.rs":"9f4830f3b5f5ab6768060917deb1f546324a4744b8ed893197e31a0aed092947","tests/common/mod.rs":"28c77637c5e75a6a57c0aeb4b082de1b5d8015d507b557ca365aa5adbf208af8","tests/counter.rs":"39a2cd40335c164b3e7407f5505bbf571d7e4a71f032d476a7939f7dd1af90d0","tests/custom_distribution.rs":"596575504ad4eab2765b5b88245dcc92dc68e83d04c93deb4b27692c142c0b94","tests/datetime.rs":"4b4ab629a0f0ae789416b67f0efdfe1142fdb18f9d3a0b5182d8d840e4a6655c","tests/event.rs":"cb78dfc0a2315253da8ef6663b81979dd5b0638bb6c31456f16ce4e9bb50c67a","tests/jwe.rs":"dc8a73d1e1925ac49061e8bb5c8de01230aa364942a22470e37aa88965b0eaba","tests/labeled.rs":"cedd548bd8089dfa316cfdfaa1985fb5cd1294e6ba5956b6012c3f01975e8de9","tests/memory_distribution.rs":"0c03d0a491150f508dc12ecac7e5db70043f3a7de2f90cc6b3509aba90549821","tests/metrics.rs":"0560e0645321628015610bbf1a90c0adbb12ad42e5a068399073572120377cbb","tests/ping.rs":"a15c619b2d3c70c3cb669d02b959109bcf231440bdcfe3cac7508a3e310cd181","tests/ping_maker.rs":"aa7921c9dcea278003c719136eeea9b711d0be12bf736cc9a79b70b69cf6109f","tests/quantity.rs":"2543f0f57085d27b0bc0c25c24c17a7e376ac673cf9265a3a9dec202920679c5","tests/storage.rs":"d8d50aba92e17a3053fd80788f5fbbcc8f82293c11c19b58e2de6c4ee45f71ff","tests/string.rs":"9c3e21bfa3ad0b75373f8f5addb8ac023ac5336ac9f969e92b89ea6fda675fdd","tests/string_list.rs":"2b83710b949bea4bd0f6b2029069887f3ea87312b00091e5aa3c7bda0fb9073c","tests/timespan.rs":"bb61e4cfb843b3f387378409ee1a88ef4b8f32b2181af686baacee262b8bca2b","tests/timing_distribution.rs":"23f48e26cc4a9646c77a395fe724fa1c337caa69ea5c358056057cb1bbf4c7e6","tests/uuid.rs":"cf0df9e330344c6e00cd51faaf21dc74c5e47f892b525e0f83623c92a6378be8"},"package":"f50f24e5e7c2abef542a9cb67f7367538db56f54fcae0fae8d3a1e0ac63470a3"} -\ No newline at end of file -+{"files":{"Cargo.lock":"4648d6743263ca9feb905d5f706ad214e8d691c865df5ba1c6844faf962db150","Cargo.toml":"5413e453d11bb3bc682e18334640e24d8d2e3cc80192bec297544277e0bb5cab","LICENSE":"1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5","README.md":"026495898699b54608eb4ec16074ffafc57920d80ccb59961c501a1ea28c9985","examples/sample.rs":"05469332ffa58c661628eb2f260dfd59085c371b0ef0f8b6e9cb77c230b9bb04","src/common_metric_data.rs":"0ce52740ab6d880df5127336ced68be30da568cd2a94301dc16d4e3f527134c9","src/coverage.rs":"49613fd310bd24d779472720975fbe6c97ec370a95eb55f10afa43f67539c942","src/database/mod.rs":"458e3c8af2af5345e02dea32b36f7521d4428c2ea65c225337008af56d00c6f6","src/debug.rs":"90158cc5d488ba67b60d06647e54e59a1d7bdeb906087e4fe4cfab4373c1cc6c","src/error.rs":"97172a791efdf8b791a04ae7961085fbef4391b313ff3ffb24e9381f2901fccc","src/error_recording.rs":"42af60683cb30eba821b955fe156ce43a114c0f6f3f3b5b84566659398137671","src/event_database/mod.rs":"95d665a039236ede25dd479b19f0ddc32c0dd79cef2fbcc2ef3bab1540680276","src/histogram/exponential.rs":"389d48bab03f7229445ee4d4c8a4c49f6b43303f658dc954da75142f3c040dc6","src/histogram/functional.rs":"1a63a305b48bcef7bc38136b40d916df4bb8f098dc602514ada54a9b091f6951","src/histogram/linear.rs":"5642c8983c3c1ce9b69c6ac99133c8ed5e67abe2398c5dbcf67e69d66880f4ca","src/histogram/mod.rs":"11e5d3b6440a33a3e5544d0e03ffd69fa2fdcabe603ad75e0327f3ed548e8ce3","src/internal_metrics.rs":"5626effec67bf0f9ee12609b77cf04741eac1827123039999d4adb28a3cc5976","src/internal_pings.rs":"5ed4669b6f09d660401f44c8279e0a5fea0262e48de40e85595bd25dc70b05f3","src/lib.rs":"49f36f867e0412d514fdddee9c40d71e020dbc27fe0efebe6808d9a16872b986","src/lib_unit_tests.rs":"17b0eaad81f946ddef89ee076f4d138e427638ee7536be128b30d4e7280dcf7b","src/macros.rs":"3f3fc8c36dd05b7528b66b27e95b6494505a7a1f48abd013218de23ada6b5a43","src/metrics/boolean.rs":"49e2f5be78055f61543db1d4d57cc06064a812a8f45c9d0e753df8325edc9041","src/metrics/counter.rs":"e3e2a195b597ea1559991b992f44a8a5f291b592a5c6946e93e01066f276efbb","src/metrics/custom_distribution.rs":"7ea1c54802e15bb490fdc8b396998ec474bfca2f135902a4028a9530fbb5dd98","src/metrics/datetime.rs":"75f0b7c41301eb881decff363947510a6cc1a9d2203357be32d1ee169c22ff4c","src/metrics/denominator.rs":"511e4123779a6d9159bb0911069f7dcb979899a0fae0d200da854685b59d3348","src/metrics/event.rs":"d6e4a52dbde7fbd44c21df567508c35acf046e08c6ea593bbb65fa25223a2b40","src/metrics/experiment.rs":"3f3ede015bb63fd5f71fc6a90421b25d8002faf71c0766b27bf59b5ae8b8d0da","src/metrics/jwe.rs":"8e1c2e204c285a428cf58f0e7d7ee0662294208b6b48706658a6f44cf412575a","src/metrics/labeled.rs":"e77459b593b2b6b375a1dacb1c9192fb47dcb5a294935c2c30aeea8e6f5432cd","src/metrics/memory_distribution.rs":"c2d75dfe9f67a21087b36af64816e703e6b56551b970fac642552116af97f2b5","src/metrics/memory_unit.rs":"d7a678e5242febd021283b30c0099a9e62729944816a3f17d2d91e2808bc0570","src/metrics/mod.rs":"069b6790de4abcaeb8ec06797a1e85344baff6b86844508b2d75d67eb00dc5d5","src/metrics/ping.rs":"b9d344cbfdbe8aff99a83423bd0af465a7228b503f92fe912ddac24904f4eca9","src/metrics/quantity.rs":"2eb6e34f7b0a292df26cddb4295bca7b82557320eff157bf854822c4a7fccb7e","src/metrics/rate.rs":"ba297a593d340568ee1f8061a6ba4f8970220ab2a83c7af290393538c6dd9bc4","src/metrics/string.rs":"8b47de25d4354c9ccf71a5558b287241a4d80c5832ac82e280543bb800996f54","src/metrics/string_list.rs":"c956616cfd1d0fce3c2e61f0b054235f455db2295d128f08b3db2ddcdd11bdbe","src/metrics/time_unit.rs":"9bb3f6c03b1d385008b254f36ed35daf22f9a6fa2d18e007c9b70aac767cde50","src/metrics/timespan.rs":"1252babc991f8c79cbd5027f3a332c28eb63fb0a956d19a18c670ab4f2e60ba3","src/metrics/timing_distribution.rs":"b885514ef2e84c970403f85bcdb09a24abf9822dbd78129fba9d37de388520a8","src/metrics/url.rs":"b83b1de16d2397fa31e52855ccc024a050c0b429af8ffb3ff1519b68b923241d","src/metrics/uuid.rs":"ebe5560fcc76b230d304172f0ab69dc3f5e41924dad8aa30090bd38b103d0ade","src/ping/mod.rs":"0d164c2ec2822658d571356f3d00f24410f9c1e63f31101fc5d0fb20a014ee1b","src/scheduler.rs":"829846308ae9ed558fbaa62e8134ec90571803673d304c8ce370de7117e1cc76","src/storage/mod.rs":"265e0ff9f3b769f6167afd6e498760c0505fe8431f52fb84f377b20b2b15670e","src/system.rs":"2e2a7436075bd1a34c118202a4d18e58236947696ce3d824e97d9c06ddf0c171","src/traits/boolean.rs":"f17f16f379b777e435e38e810e25336a919f4aeeefb1b4e7cf7749c0ef173fd9","src/traits/counter.rs":"631208036059d498a4485c74c2a80c24a5f13bffeb1053bdf5cce06af0e9d361","src/traits/custom_distribution.rs":"1b3ffda6e857bfa8ad5be412e88f3d9706ededf5a86407364ae19a81f06ef798","src/traits/datetime.rs":"2f4b9e64161c15c912b6a915045dd9840f76229d144a4d1542c54eb4f3b3406b","src/traits/event.rs":"ce9a9395748734b241f35b31c4cddf0ce6a8eca6d700aaeea427b0ae29ce507d","src/traits/jwe.rs":"80cdc61e6d99d7c05139c9d05288290c731b1be61afcbd4a4c415973665ea194","src/traits/labeled.rs":"7f3281fc0a1a745238e7e260463f397dfa61717408fe9d260dc9767d9c659e52","src/traits/memory_distribution.rs":"0b72ffde68eb97f01a57afbc5c6109565ec9435561984d34696622bf5a57d559","src/traits/mod.rs":"88cec83fcff8dfab768953b901ee95fed186f7540afdc9606407aff71f1919df","src/traits/numerator.rs":"9690a1b4487521565bd488e9a938aa66f93045c63f0f0ee6e864e0341395659b","src/traits/ping.rs":"8831c106c03afeb458b0b028fa1ce61f056ebf8e82bc0a171a1bff255d920748","src/traits/quantity.rs":"087d7a4b58f0eb7c766a0202dcf38a52d172ce4edf626211ffe5d94ed02ae754","src/traits/rate.rs":"9d0da25895d4c43cdece43dd57e515ab2fb907e8c9a239807976e3d9197d2955","src/traits/string.rs":"48e5623c7db59b8e6454fbc7fb6e2395f808c9a0fa721d7c07b72abb171eb1ad","src/traits/string_list.rs":"5d5773d5a130323dd82ca95f4ecdccdd6b237afe2eadf8655363bd6b7e8508c1","src/traits/timespan.rs":"29251233847c5cdd200a61472132c62ded27fe2c13835b09424384bf144d82db","src/traits/timing_distribution.rs":"5e619d445e6ef3f19ca69bcdfe02d19b150c5a46855d195703b6d2f55e538636","src/traits/url.rs":"a01331623af4fa8af6e71becffff60060832bef5e48a15df6dc23b41225f689e","src/traits/uuid.rs":"bd78515611ba406d8b1bda35a9fe30c317512a9afcea7c5dece8fced7d410a92","src/upload/directory.rs":"571cfee0347b40b239d0d946625de6265bbea4f433c8316da715ded8f590aca1","src/upload/mod.rs":"34bcb67a5980e2c8b5145553b83e130ed4db40dab6d5c53bc9978469e6b93223","src/upload/policy.rs":"c250957a37783e74af8002cd80ba06ef9780a389fb0f61b8b665b79688f0a360","src/upload/request.rs":"7939e77bde4b55263446c3660b6831bafa27308bc983a51e1679321e962f372f","src/upload/result.rs":"d73454e81f185e4e28c887f7b496bffad7baac74c8f1b719885f940f909a530d","src/util.rs":"a89e21f0f4fe14a5a1a5369a0f2c20d1184816ccfe2b5b1599d3779660772f27","tests/boolean.rs":"9f4830f3b5f5ab6768060917deb1f546324a4744b8ed893197e31a0aed092947","tests/common/mod.rs":"28c77637c5e75a6a57c0aeb4b082de1b5d8015d507b557ca365aa5adbf208af8","tests/counter.rs":"39a2cd40335c164b3e7407f5505bbf571d7e4a71f032d476a7939f7dd1af90d0","tests/custom_distribution.rs":"596575504ad4eab2765b5b88245dcc92dc68e83d04c93deb4b27692c142c0b94","tests/datetime.rs":"4b4ab629a0f0ae789416b67f0efdfe1142fdb18f9d3a0b5182d8d840e4a6655c","tests/event.rs":"cb78dfc0a2315253da8ef6663b81979dd5b0638bb6c31456f16ce4e9bb50c67a","tests/jwe.rs":"dc8a73d1e1925ac49061e8bb5c8de01230aa364942a22470e37aa88965b0eaba","tests/labeled.rs":"cedd548bd8089dfa316cfdfaa1985fb5cd1294e6ba5956b6012c3f01975e8de9","tests/memory_distribution.rs":"0c03d0a491150f508dc12ecac7e5db70043f3a7de2f90cc6b3509aba90549821","tests/metrics.rs":"0560e0645321628015610bbf1a90c0adbb12ad42e5a068399073572120377cbb","tests/ping.rs":"a15c619b2d3c70c3cb669d02b959109bcf231440bdcfe3cac7508a3e310cd181","tests/ping_maker.rs":"aa7921c9dcea278003c719136eeea9b711d0be12bf736cc9a79b70b69cf6109f","tests/quantity.rs":"2543f0f57085d27b0bc0c25c24c17a7e376ac673cf9265a3a9dec202920679c5","tests/storage.rs":"d8d50aba92e17a3053fd80788f5fbbcc8f82293c11c19b58e2de6c4ee45f71ff","tests/string.rs":"9c3e21bfa3ad0b75373f8f5addb8ac023ac5336ac9f969e92b89ea6fda675fdd","tests/string_list.rs":"2b83710b949bea4bd0f6b2029069887f3ea87312b00091e5aa3c7bda0fb9073c","tests/timespan.rs":"bb61e4cfb843b3f387378409ee1a88ef4b8f32b2181af686baacee262b8bca2b","tests/timing_distribution.rs":"23f48e26cc4a9646c77a395fe724fa1c337caa69ea5c358056057cb1bbf4c7e6","tests/uuid.rs":"cf0df9e330344c6e00cd51faaf21dc74c5e47f892b525e0f83623c92a6378be8"},"package":"349ebbb162d58911547b48e5fbf90d45854e3e1ba03332f41b80a6611867c013"} -\ No newline at end of file -diff --git a/third_party/rust/glean-core/Cargo.lock b/third_party/rust/glean-core/Cargo.lock ---- a/third_party/rust/glean-core/Cargo.lock -+++ b/third_party/rust/glean-core/Cargo.lock -@@ -54,9 +54,9 @@ - - [[package]] - name = "cc" --version = "1.0.71" -+version = "1.0.72" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" -+checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" - - [[package]] - name = "cfg-if" -@@ -80,9 +80,9 @@ - - [[package]] - name = "crc32fast" --version = "1.2.1" -+version = "1.3.0" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" -+checksum = "738c290dfaea84fc1ca15ad9c168d083b05a714e1efddd8edaab678dc28d2836" - dependencies = [ - "cfg-if", - ] -@@ -154,7 +154,7 @@ - - [[package]] - name = "glean-core" --version = "42.1.0" -+version = "42.3.0" - dependencies = [ - "bincode", - "chrono", -@@ -208,9 +208,9 @@ - - [[package]] - name = "iso8601" --version = "0.4.0" -+version = "0.4.1" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "cee08a007a59a8adfc96f69738ddf59e374888dfd84b49c4b916543067644d58" -+checksum = "0a59a3f2be6271b2a844cd0dd13bf8ccc88a9540482d872c7ce58ab1c4db9fab" - dependencies = [ - "nom", - ] -@@ -229,9 +229,9 @@ - - [[package]] - name = "libc" --version = "0.2.104" -+version = "0.2.109" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "7b2f96d100e1cf1929e7719b7edb3b90ab5298072638fccd77be9ce942ecdfce" -+checksum = "f98a04dce437184842841303488f70d0188c5f51437d2a834dc097eafa909a01" - - [[package]] - name = "lmdb-rkv" -@@ -278,6 +278,12 @@ - checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" - - [[package]] -+name = "minimal-lexical" -+version = "0.2.1" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -+ -+[[package]] - name = "miniz_oxide" - version = "0.4.4" - source = "registry+https://github.com/rust-lang/crates.io-index" -@@ -289,11 +295,12 @@ - - [[package]] - name = "nom" --version = "5.1.2" -+version = "7.1.0" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" -+checksum = "1b1d11e1ef389c76fe5b81bcaf2ea32cf88b62bc494e19f493d0b30e7a930109" - dependencies = [ - "memchr", -+ "minimal-lexical", - "version_check", - ] - -@@ -358,15 +365,15 @@ - - [[package]] - name = "pkg-config" --version = "0.3.20" -+version = "0.3.23" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "7c9b1041b4387893b91ee6746cddfc28516aff326a3519fb2adf820932c5e6cb" -+checksum = "d1a3ea4f0dd7f1f3e512cf97bf100819aa547f36a6eccac8dbaae839eb92363e" - - [[package]] - name = "ppv-lite86" --version = "0.2.14" -+version = "0.2.15" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "c3ca011bd0129ff4ae15cd04c4eef202cadf6c51c21e47aba319b4e0501db741" -+checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" - - [[package]] - name = "proc-macro-hack" -@@ -376,9 +383,9 @@ - - [[package]] - name = "proc-macro2" --version = "1.0.30" -+version = "1.0.33" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "edc3358ebc67bc8b7fa0c007f945b0b18226f78437d61bec735a9eb96b61ee70" -+checksum = "fb37d2df5df740e582f28f8560cf425f52bb267d872fe58358eadb554909f07a" - dependencies = [ - "unicode-xid", - ] -@@ -475,9 +482,9 @@ - - [[package]] - name = "ryu" --version = "1.0.5" -+version = "1.0.6" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" -+checksum = "3c9613b5a66ab9ba26415184cfc41156594925a9cf3a2057e57f31ff145f6568" - - [[package]] - name = "serde" -@@ -501,9 +508,9 @@ - - [[package]] - name = "serde_json" --version = "1.0.68" -+version = "1.0.72" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" -+checksum = "d0ffa0837f2dfa6fb90868c2b5468cad482e175f7dad97e7421951e663f2b527" - dependencies = [ - "itoa", - "ryu", -@@ -512,9 +519,9 @@ - - [[package]] - name = "syn" --version = "1.0.80" -+version = "1.0.82" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194" -+checksum = "8daf5dd0bb60cbd4137b1b587d2fc0ae729bc07cf01cd70b36a1ed5ade3b9d59" - dependencies = [ - "proc-macro2", - "quote", -@@ -576,9 +583,9 @@ - - [[package]] - name = "tinyvec" --version = "1.5.0" -+version = "1.5.1" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "f83b2a3d4d9091d0abd7eba4dc2710b1718583bd4d8992e2190720ea38f391f7" -+checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" - dependencies = [ - "tinyvec_macros", - ] -diff --git a/third_party/rust/glean-core/Cargo.toml b/third_party/rust/glean-core/Cargo.toml ---- a/third_party/rust/glean-core/Cargo.toml -+++ b/third_party/rust/glean-core/Cargo.toml -@@ -12,7 +12,7 @@ - [package] - edition = "2018" - name = "glean-core" --version = "42.1.0" -+version = "42.3.0" - authors = ["Jan-Erik Rediger ", "The Glean Team "] - include = ["/README.md", "/LICENSE", "/src", "/examples", "/tests", "/Cargo.toml"] - description = "A modern Telemetry library" -@@ -21,7 +21,7 @@ - license = "MPL-2.0" - repository = "https://github.com/mozilla/glean" - [package.metadata.glean] --glean-parser = "4.2.0" -+glean-parser = "4.3.1" - [dependencies.bincode] - version = "1.2.1" - -diff --git a/third_party/rust/glean-core/src/debug.rs b/third_party/rust/glean-core/src/debug.rs ---- a/third_party/rust/glean-core/src/debug.rs -+++ b/third_party/rust/glean-core/src/debug.rs -@@ -234,7 +234,7 @@ - return false; - } - -- tags.iter().all(|x| validate_tag(x)) -+ tags.iter().all(validate_tag) - } - - #[cfg(test)] -diff --git a/third_party/rust/glean-core/src/metrics/labeled.rs b/third_party/rust/glean-core/src/metrics/labeled.rs ---- a/third_party/rust/glean-core/src/metrics/labeled.rs -+++ b/third_party/rust/glean-core/src/metrics/labeled.rs -@@ -182,8 +182,7 @@ - - /// Strips the label off of a complete identifier - pub fn strip_label(identifier: &str) -> &str { -- // safe unwrap, first field of a split always valid -- identifier.splitn(2, '/').next().unwrap() -+ identifier.split_once('/').map_or(identifier, |s| s.0) - } - - /// Validates a dynamic label, changing it to `OTHER_LABEL` if it's invalid. -diff --git a/third_party/rust/glean-core/src/storage/mod.rs b/third_party/rust/glean-core/src/storage/mod.rs ---- a/third_party/rust/glean-core/src/storage/mod.rs -+++ b/third_party/rust/glean-core/src/storage/mod.rs -@@ -203,7 +203,7 @@ - let mut snapshotter = |metric_id: &[u8], metric: &Metric| { - let metric_id = String::from_utf8_lossy(metric_id).into_owned(); - if metric_id.ends_with("#experiment") { -- let name = metric_id.splitn(2, '#').next().unwrap(); // safe unwrap, first field of a split always valid -+ let (name, _) = metric_id.split_once('#').unwrap(); // safe unwrap, we ensured there's a `#` in the string - snapshot.insert(name.to_string(), metric.as_json()); - } - }; -diff --git a/third_party/rust/glean-ffi/.cargo-checksum.json b/third_party/rust/glean-ffi/.cargo-checksum.json ---- a/third_party/rust/glean-ffi/.cargo-checksum.json -+++ b/third_party/rust/glean-ffi/.cargo-checksum.json -@@ -1 +1 @@ --{"files":{"Cargo.toml":"36b60da27ddb5d5cdada09162dff4c147caa0edf9406eb23b44e1730e8ac2372","LICENSE":"1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5","README.md":"bfe00cc2501c9b15d5bc463c6db30ebbf8d7b5d6c555cf3827ae529fc9e7d6cc","cbindgen.toml":"ac25d1bc2ab7d6afaf25cfa0d35233f93b01f7129088cdd1fa89b9d987a8c564","glean.h":"bbe571147f9fee34f7deac1057c541f00523317328e591446d4c96bbe84c99eb","src/boolean.rs":"0d1d59d0c13cdb63592a9513f2abcf3d1a8260d6523cc7d1af40cfcb4c75572a","src/byte_buffer.rs":"eeb6df25da7b393517f0c993e1e99a0acbccd7678b1127ce0e471d0e53a4bb45","src/counter.rs":"4d8f41285e4a9dbfa2733cdf937905006b475c0af7a501df73fde4ca77818e82","src/custom_distribution.rs":"b0b3b23289e413e7d150e8dae8217e6bd409cbbab68abb127f146041bcbfaf45","src/datetime.rs":"a5c1c993605b1a8ff044d88de4f4a385aff1a781cb8cb45573b90882da801fae","src/event.rs":"ef6dd4f0493ae223e4f7091d5779e46b33ea9864c2a4e5953811a7d9e8884c32","src/fd_logger.rs":"0f8197bb086f49413cca30a72bae029f663842fc3b78ceef6d0854a070b1cdfd","src/ffi_string_ext.rs":"389ae94dcdace1f56ca2c87207e865edda6d42da45733f1027e0a4dcfa86c492","src/from_raw.rs":"b17515a58d7e303ee746ea54c1c1c6d0523dc4de0bd8157dfaba2a610da637bb","src/handlemap_ext.rs":"3b1b088a2de197a0c3eaae0f2f0915d53602f51c13d27f48297f52cd885d5abc","src/jwe.rs":"72adff64900ca16d6527e8d6a436ac2ba85f738d6e92e33f3d71df32b485d0c3","src/labeled.rs":"9cc706511961dbe62350d62b39e9b2c3a9c9e9f53d5577274e273c0f826cd8c3","src/lib.rs":"b5bee8a36a3d0e32eaa01caad0ca57f8649b61b0f99cd3df1f697c27ec9fc47a","src/macros.rs":"e11614edb156552617354d7f6120c8e60ffeb6632ebc19d2b7c6c3e88523b01b","src/memory_distribution.rs":"08ef15e340f2e7ab2f4f83cd8e883c864d4affb94458e80198c106393bfb6bd8","src/ping_type.rs":"6401bcf4342ec1e4ba3782e2b67b3320aa96c9eddc03fc3c75ecc54e2f08a619","src/quantity.rs":"f72781ea642b5f7e363e9fecaded143d1afd772575603763543f1df3448ec337","src/string.rs":"199a238f3524eb36643d82b63df5c7f013adedb6af80632a2675f8562f34e692","src/string_list.rs":"12e2fbbdc08a1b8da1885fb14acd59ab27c8b598a24dc15a4eaca16636540a54","src/timespan.rs":"b7ac51dbfd5169d8c688c3fd2db51e38b6173c925ca14d7b0e8353f225b30a50","src/timing_distribution.rs":"4b5962729fb0b4c9ebf65a5fc5af105357652fcc282c6f8840f328452ba86ac6","src/upload.rs":"320c6e97df0a87040d2a269765401cd67da50f0a226c95a9a314f22452116f7c","src/url.rs":"2dfaf006cd4024ee07eb37dc312201b027d774f6c9881e556774cc09077a6290","src/uuid.rs":"c9ea7225fac53b55a8aeef39cd33470228c0a178185aa74b8fa652657994e404","src/weak.rs":"0199f4ef38d667f0b9f8ef3c5505ff15cd6e911bc83c27e7e9954fdffe1be0bb"},"package":"26738a3a19d212595c76a765b3e29fc9a0e1c5e7d15a8352ac94ec8536b65cd5"} -\ No newline at end of file -+{"files":{"Cargo.toml":"2592f1c0a12f24250790a516f0c194543afa412205dab039dcbb9c5faba5e00e","LICENSE":"1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5","README.md":"bfe00cc2501c9b15d5bc463c6db30ebbf8d7b5d6c555cf3827ae529fc9e7d6cc","cbindgen.toml":"ac25d1bc2ab7d6afaf25cfa0d35233f93b01f7129088cdd1fa89b9d987a8c564","glean.h":"bbe571147f9fee34f7deac1057c541f00523317328e591446d4c96bbe84c99eb","src/boolean.rs":"0d1d59d0c13cdb63592a9513f2abcf3d1a8260d6523cc7d1af40cfcb4c75572a","src/byte_buffer.rs":"eeb6df25da7b393517f0c993e1e99a0acbccd7678b1127ce0e471d0e53a4bb45","src/counter.rs":"4d8f41285e4a9dbfa2733cdf937905006b475c0af7a501df73fde4ca77818e82","src/custom_distribution.rs":"b0b3b23289e413e7d150e8dae8217e6bd409cbbab68abb127f146041bcbfaf45","src/datetime.rs":"a5c1c993605b1a8ff044d88de4f4a385aff1a781cb8cb45573b90882da801fae","src/event.rs":"ef6dd4f0493ae223e4f7091d5779e46b33ea9864c2a4e5953811a7d9e8884c32","src/fd_logger.rs":"0f8197bb086f49413cca30a72bae029f663842fc3b78ceef6d0854a070b1cdfd","src/ffi_string_ext.rs":"389ae94dcdace1f56ca2c87207e865edda6d42da45733f1027e0a4dcfa86c492","src/from_raw.rs":"b17515a58d7e303ee746ea54c1c1c6d0523dc4de0bd8157dfaba2a610da637bb","src/handlemap_ext.rs":"3b1b088a2de197a0c3eaae0f2f0915d53602f51c13d27f48297f52cd885d5abc","src/jwe.rs":"72adff64900ca16d6527e8d6a436ac2ba85f738d6e92e33f3d71df32b485d0c3","src/labeled.rs":"9cc706511961dbe62350d62b39e9b2c3a9c9e9f53d5577274e273c0f826cd8c3","src/lib.rs":"b5bee8a36a3d0e32eaa01caad0ca57f8649b61b0f99cd3df1f697c27ec9fc47a","src/macros.rs":"e11614edb156552617354d7f6120c8e60ffeb6632ebc19d2b7c6c3e88523b01b","src/memory_distribution.rs":"08ef15e340f2e7ab2f4f83cd8e883c864d4affb94458e80198c106393bfb6bd8","src/ping_type.rs":"6401bcf4342ec1e4ba3782e2b67b3320aa96c9eddc03fc3c75ecc54e2f08a619","src/quantity.rs":"f72781ea642b5f7e363e9fecaded143d1afd772575603763543f1df3448ec337","src/string.rs":"199a238f3524eb36643d82b63df5c7f013adedb6af80632a2675f8562f34e692","src/string_list.rs":"12e2fbbdc08a1b8da1885fb14acd59ab27c8b598a24dc15a4eaca16636540a54","src/timespan.rs":"b7ac51dbfd5169d8c688c3fd2db51e38b6173c925ca14d7b0e8353f225b30a50","src/timing_distribution.rs":"4b5962729fb0b4c9ebf65a5fc5af105357652fcc282c6f8840f328452ba86ac6","src/upload.rs":"320c6e97df0a87040d2a269765401cd67da50f0a226c95a9a314f22452116f7c","src/url.rs":"2dfaf006cd4024ee07eb37dc312201b027d774f6c9881e556774cc09077a6290","src/uuid.rs":"c9ea7225fac53b55a8aeef39cd33470228c0a178185aa74b8fa652657994e404","src/weak.rs":"0199f4ef38d667f0b9f8ef3c5505ff15cd6e911bc83c27e7e9954fdffe1be0bb"},"package":"9e29c3f0b9dbde127254f375499df382d5fa9c3c2b33bfcb393485876fe79fb2"} -\ No newline at end of file -diff --git a/third_party/rust/glean-ffi/Cargo.toml b/third_party/rust/glean-ffi/Cargo.toml ---- a/third_party/rust/glean-ffi/Cargo.toml -+++ b/third_party/rust/glean-ffi/Cargo.toml -@@ -12,7 +12,7 @@ - [package] - edition = "2018" - name = "glean-ffi" --version = "42.1.0" -+version = "42.3.0" - authors = ["Jan-Erik Rediger ", "The Glean Team "] - include = ["/README.md", "/LICENSE", "/src", "/tests", "/Cargo.toml", "/cbindgen.toml", "/glean.h"] - description = "FFI layer for Glean, a modern Telemetry library" -@@ -28,7 +28,7 @@ - version = "0.4.0" - - [dependencies.glean-core] --version = "42.1.0" -+version = "42.3.0" - - [dependencies.log] - version = "0.4.8" -diff --git a/third_party/rust/glean/.cargo-checksum.json b/third_party/rust/glean/.cargo-checksum.json ---- a/third_party/rust/glean/.cargo-checksum.json -+++ b/third_party/rust/glean/.cargo-checksum.json -@@ -1 +1 @@ --{"files":{"Cargo.toml":"c2a549ca03146a345f13ce7e8dd498f9532bab9e0ef90669d257479a81b98fe9","LICENSE":"1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5","README.md":"fd9e0ca6907917ea6bec5de05e15dd21d20fae1cb7f3250467bb20231a8e1065","src/common_test.rs":"bd7ab2f6384bea8971f97ba68b11c946899303891bc534898f7aabbf27f9008a","src/configuration.rs":"4acbedba16d45f6404ccedde86e8aa33eea8c1b9554210cb69c79ff2ec9040c9","src/core_metrics.rs":"0593192ec0fa1b4d267411cdfb75c70f78578083eca91f6e09cd08346de32264","src/dispatcher/global.rs":"460ccfec311163b469c54f63f4cb41e057b93421ccb7675e435c2994d478cd4b","src/dispatcher/mod.rs":"9f59e466fbbcc3e1bdc42659822a2a2c4b8250456858ee885e53b16458f4a47e","src/glean_metrics.rs":"151b6e5acc12436c33c75e2e0a18f9769179d3c7fdc60a22fa02afb76feaf00f","src/lib.rs":"f663c617f655e0b24dfc8bcb77659a209e8d2440c71ff2477f8b2d2b520fff17","src/net/http_uploader.rs":"9e8c1837ca0d3f6ea165ec936ab054173c4fe95a958710176c33b4d4d1d98beb","src/net/mod.rs":"284bcf182156c52ea25fa33bcc48d80b4970ee3c187a4ea3a06602cc34c710bf","src/pings.rs":"2dfccd84848e1933aa4f6a7a707c58ec794c8f73ef2d93ea4d4df71d4e6abc31","src/private/boolean.rs":"eeadc0529e2c69a930479f208746799b064b27facab8306c1c10c650e83fb63c","src/private/counter.rs":"0bc8a2d0df72e47b7365ff80bfc16427a5da701fd0adadeedbcce13cebcd79ce","src/private/custom_distribution.rs":"6d1271fb91e9d51a8dcf5eb9d540b3757ebe9cc998b196943ed8c729f62afc67","src/private/datetime.rs":"cb8f26f74d318e2118d6ae1b15972557eb205d4d8b24795fb0d08fdea2bc3f56","src/private/denominator.rs":"95332737f3ac80346f4811440a2141cd427692819bd04d5d3ac7374299dc20b0","src/private/event.rs":"b674ceb85351b7989bd25ed4f5d98c5c9b31e2a03f13b054a8c0dbef54190e49","src/private/labeled.rs":"2cd90d132954ee3ada43ff1ad538072ba43eece7a53ed89811a2a7b43a4819f1","src/private/memory_distribution.rs":"8b78a0e33601081d76639445c8b4875a4fe7c3aded720bb43afdabe86e0fd6ee","src/private/mod.rs":"63368b123fecb6de210ec634b8d387799b4b9dd960016335ebc3c6851e81628f","src/private/numerator.rs":"334ac2ad3d8dd7b9f02f1ca5391b683d50fbc8c6728a12882a68bb067604c800","src/private/ping.rs":"915fc42994e0929656daee5511946ac1f56fe0d4d704e97e13795771d9890180","src/private/quantity.rs":"528675cd388010b89e6ac23c9152701c78d32c2dcd0b5e9abf1a50a52ee818a5","src/private/rate.rs":"7ddfdb3d5f2d1887b378caa3769ade92ea0fbd193f6e760f5f383c8b3e9f3aff","src/private/recorded_experiment_data.rs":"66b2601902a2dc2b7a283717c21ce754de94fcca30d12e0398195c8ad49c90af","src/private/string.rs":"c85ded40b1409793ae5b78da692bc2e708f8d55defb76ec5f515096d32f206c9","src/private/string_list.rs":"472ad79fba4b9bcde0ff5b3e05fd8e0aaa3d1d2941fc181faf2ceb90f1d518bd","src/private/timespan.rs":"19ed08aa5103b685a3a0b9f06f2c60250d55f3c8f36337f8c7bdbb2dfdb92786","src/private/timing_distribution.rs":"ee7fa0c3d5427e371b5413373cb1f5841ac10df9b7ca08316ef724e7ad3591d9","src/private/url.rs":"223de8a025e2f749255103402eecb5582961c2b5af7492e294362a0e8f55c414","src/private/uuid.rs":"2b69ddaf3978aaa31c625c0f3eb948c44369744334aacc6b5a2b217268d244a7","src/system.rs":"ff23a5b94f52dab484342dfed702412bc29ab1bbfd5af326033d8e07e7b9075f","src/test.rs":"0cbe4f51fa01b1ca04e4b726e8eb729c3504086bc6b0d644e2114a5a4473165a","tests/common/mod.rs":"4837df2e771929cc077e6fb9a9239645e8e0f7bc6c9f409b71c4d147edf334fc","tests/init_fails.rs":"1e832fe454962ddb1155d546bb71b6395aa9936f848ff0fbe88affaaab7dfae3","tests/never_init.rs":"1f33b8ce7ca3514b57b48cc16d98408974c85cf8aa7d13257ffc2ad878ebb295","tests/no_time_to_init.rs":"4d61e4196d8eef23f3bcb24b59bd0b0379c1f2cb50f03434a53996ab097bfb17","tests/overflowing_preinit.rs":"81ff97745789fd5f58f86364488c011b4503648f1366b12e26755edc54323150","tests/persist_ping_lifetime.rs":"adfab91baf978f464e265eae828fcc03aa6eef83422d3918ffb680b2c2ec859e","tests/persist_ping_lifetime_nopanic.rs":"92f4739b21c0d46cb368eafea43bfb822d8dee96412d5f4fc32e01636f0cf244","tests/schema.rs":"621caef0cc7f98c79740422835485fea2343ca105d0d9a7eec6ded9cfad6232c","tests/simple.rs":"2f58d3ff90005231f2febd21f66ee41d06302618408ea990b446510449c3444f"},"package":"af977f3ee276d391cbf940639a5b95378c2b0031d5624c019142d286be4a1a21"} -\ No newline at end of file -+{"files":{"Cargo.toml":"8f777d1de11f0143f451977e300df83a66fef432819f377c2378710791fdec53","LICENSE":"1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5","README.md":"fd9e0ca6907917ea6bec5de05e15dd21d20fae1cb7f3250467bb20231a8e1065","src/common_test.rs":"bd7ab2f6384bea8971f97ba68b11c946899303891bc534898f7aabbf27f9008a","src/configuration.rs":"4acbedba16d45f6404ccedde86e8aa33eea8c1b9554210cb69c79ff2ec9040c9","src/core_metrics.rs":"0593192ec0fa1b4d267411cdfb75c70f78578083eca91f6e09cd08346de32264","src/dispatcher/global.rs":"460ccfec311163b469c54f63f4cb41e057b93421ccb7675e435c2994d478cd4b","src/dispatcher/mod.rs":"9f59e466fbbcc3e1bdc42659822a2a2c4b8250456858ee885e53b16458f4a47e","src/glean_metrics.rs":"d376e4f40ec620ce31667451a78adc1146213016e100c0d457505ec240ab31bf","src/lib.rs":"5ecf8102426bbfbd941a7e19bb79a65485a90d9842783a1940c42ebdec61e183","src/net/http_uploader.rs":"9e8c1837ca0d3f6ea165ec936ab054173c4fe95a958710176c33b4d4d1d98beb","src/net/mod.rs":"284bcf182156c52ea25fa33bcc48d80b4970ee3c187a4ea3a06602cc34c710bf","src/pings.rs":"02a3ddb4e77d2033fb5a8fc9bbec09ad5500691e0bd2a1db334805cba88670fd","src/private/boolean.rs":"eeadc0529e2c69a930479f208746799b064b27facab8306c1c10c650e83fb63c","src/private/counter.rs":"0bc8a2d0df72e47b7365ff80bfc16427a5da701fd0adadeedbcce13cebcd79ce","src/private/custom_distribution.rs":"6d1271fb91e9d51a8dcf5eb9d540b3757ebe9cc998b196943ed8c729f62afc67","src/private/datetime.rs":"cb8f26f74d318e2118d6ae1b15972557eb205d4d8b24795fb0d08fdea2bc3f56","src/private/denominator.rs":"95332737f3ac80346f4811440a2141cd427692819bd04d5d3ac7374299dc20b0","src/private/event.rs":"b674ceb85351b7989bd25ed4f5d98c5c9b31e2a03f13b054a8c0dbef54190e49","src/private/labeled.rs":"2cd90d132954ee3ada43ff1ad538072ba43eece7a53ed89811a2a7b43a4819f1","src/private/memory_distribution.rs":"8b78a0e33601081d76639445c8b4875a4fe7c3aded720bb43afdabe86e0fd6ee","src/private/mod.rs":"63368b123fecb6de210ec634b8d387799b4b9dd960016335ebc3c6851e81628f","src/private/numerator.rs":"334ac2ad3d8dd7b9f02f1ca5391b683d50fbc8c6728a12882a68bb067604c800","src/private/ping.rs":"915fc42994e0929656daee5511946ac1f56fe0d4d704e97e13795771d9890180","src/private/quantity.rs":"528675cd388010b89e6ac23c9152701c78d32c2dcd0b5e9abf1a50a52ee818a5","src/private/rate.rs":"7ddfdb3d5f2d1887b378caa3769ade92ea0fbd193f6e760f5f383c8b3e9f3aff","src/private/recorded_experiment_data.rs":"66b2601902a2dc2b7a283717c21ce754de94fcca30d12e0398195c8ad49c90af","src/private/string.rs":"c85ded40b1409793ae5b78da692bc2e708f8d55defb76ec5f515096d32f206c9","src/private/string_list.rs":"472ad79fba4b9bcde0ff5b3e05fd8e0aaa3d1d2941fc181faf2ceb90f1d518bd","src/private/timespan.rs":"19ed08aa5103b685a3a0b9f06f2c60250d55f3c8f36337f8c7bdbb2dfdb92786","src/private/timing_distribution.rs":"ee7fa0c3d5427e371b5413373cb1f5841ac10df9b7ca08316ef724e7ad3591d9","src/private/url.rs":"223de8a025e2f749255103402eecb5582961c2b5af7492e294362a0e8f55c414","src/private/uuid.rs":"2b69ddaf3978aaa31c625c0f3eb948c44369744334aacc6b5a2b217268d244a7","src/system.rs":"ff23a5b94f52dab484342dfed702412bc29ab1bbfd5af326033d8e07e7b9075f","src/test.rs":"0cbe4f51fa01b1ca04e4b726e8eb729c3504086bc6b0d644e2114a5a4473165a","tests/common/mod.rs":"4837df2e771929cc077e6fb9a9239645e8e0f7bc6c9f409b71c4d147edf334fc","tests/init_fails.rs":"1e832fe454962ddb1155d546bb71b6395aa9936f848ff0fbe88affaaab7dfae3","tests/never_init.rs":"1f33b8ce7ca3514b57b48cc16d98408974c85cf8aa7d13257ffc2ad878ebb295","tests/no_time_to_init.rs":"4d61e4196d8eef23f3bcb24b59bd0b0379c1f2cb50f03434a53996ab097bfb17","tests/overflowing_preinit.rs":"be7e9a7984162da33f17a5edae29e1e07e5d0b27e8830f7f32bb238a7e788638","tests/persist_ping_lifetime.rs":"adfab91baf978f464e265eae828fcc03aa6eef83422d3918ffb680b2c2ec859e","tests/persist_ping_lifetime_nopanic.rs":"92f4739b21c0d46cb368eafea43bfb822d8dee96412d5f4fc32e01636f0cf244","tests/schema.rs":"621caef0cc7f98c79740422835485fea2343ca105d0d9a7eec6ded9cfad6232c","tests/simple.rs":"2f58d3ff90005231f2febd21f66ee41d06302618408ea990b446510449c3444f"},"package":"34d40d192d10509d941937248fe4594d47617abf34496686c809cfdb31ae8506"} -\ No newline at end of file -diff --git a/third_party/rust/glean/Cargo.toml b/third_party/rust/glean/Cargo.toml ---- a/third_party/rust/glean/Cargo.toml -+++ b/third_party/rust/glean/Cargo.toml -@@ -12,7 +12,7 @@ - [package] - edition = "2018" - name = "glean" --version = "42.1.0" -+version = "42.3.0" - authors = ["Jan-Erik Rediger ", "The Glean Team "] - include = ["/README.md", "/LICENSE", "/src", "/tests", "/Cargo.toml"] - description = "Glean SDK Rust language bindings" -@@ -28,7 +28,7 @@ - version = "0.5" - - [dependencies.glean-core] --version = "42.1.0" -+version = "42.3.0" - - [dependencies.inherent] - version = "0.1.4" -diff --git a/third_party/rust/glean/src/glean_metrics.rs b/third_party/rust/glean/src/glean_metrics.rs ---- a/third_party/rust/glean/src/glean_metrics.rs -+++ b/third_party/rust/glean/src/glean_metrics.rs -@@ -17,8 +17,8 @@ - #[allow(non_upper_case_globals)] - pub static preinit_tasks_overflow: Lazy = Lazy::new(|| { - CounterMetric::new(CommonMetricData { -- name: "glean.error".into(), -- category: "preinit_tasks_overflow".into(), -+ category: "glean.error".into(), -+ name: "preinit_tasks_overflow".into(), - send_in_pings: vec!["metrics".into()], - lifetime: Lifetime::Ping, - disabled: false, -diff --git a/third_party/rust/glean/src/lib.rs b/third_party/rust/glean/src/lib.rs ---- a/third_party/rust/glean/src/lib.rs -+++ b/third_party/rust/glean/src/lib.rs -@@ -566,7 +566,7 @@ - return false; - } - -- glean.submit_ping_by_name(ping, reason.as_deref()) -+ glean.submit_ping_by_name(ping, reason) - }); - - if submitted_ping { -diff --git a/third_party/rust/glean/src/pings.rs b/third_party/rust/glean/src/pings.rs ---- a/third_party/rust/glean/src/pings.rs -+++ b/third_party/rust/glean/src/pings.rs -@@ -44,7 +44,7 @@ - #[allow(non_upper_case_globals)] - pub static events: Lazy = Lazy::new(|| { - PingType::new( -- "metrics", -+ "events", - true, - false, - vec![ -diff --git a/third_party/rust/glean/tests/overflowing_preinit.rs b/third_party/rust/glean/tests/overflowing_preinit.rs ---- a/third_party/rust/glean/tests/overflowing_preinit.rs -+++ b/third_party/rust/glean/tests/overflowing_preinit.rs -@@ -37,8 +37,8 @@ - #[allow(non_upper_case_globals)] - pub static preinit_tasks_overflow: Lazy = Lazy::new(|| { - CounterMetric::new(CommonMetricData { -- name: "glean.error".into(), -- category: "preinit_tasks_overflow".into(), -+ category: "glean.error".into(), -+ name: "preinit_tasks_overflow".into(), - send_in_pings: vec!["metrics".into()], - lifetime: Lifetime::Ping, - disabled: false, -diff --git a/toolkit/components/glean/Cargo.toml b/toolkit/components/glean/Cargo.toml ---- a/toolkit/components/glean/Cargo.toml -+++ b/toolkit/components/glean/Cargo.toml -@@ -6,7 +6,7 @@ - license = "MPL-2.0" - - [dependencies] --glean = { version = "42.1.0", features = ["rkv-safe-mode"] } -+glean = { version = "42.3.0", features = ["rkv-safe-mode"] } - # In theory we only need this for `target_os = "android"` builds. - # Cargo has the ability to do that with `[target.'cfg(target_os = "android")'.dependencies]`. - # However that seems to confuse `cbindgen` quite a lot; -@@ -15,7 +15,7 @@ - # So for now we unconditionally depend on it, but in the code we only `extern crate` it on Android builds. - # While `glean-ffi` is still built (I think it is), - # it's not linked into the final library. --glean-ffi = "42.1.0" -+glean-ffi = "42.3.0" - log = "0.4" - nserror = { path = "../../../xpcom/rust/nserror" } - nsstring = { path = "../../../xpcom/rust/nsstring" } -diff --git a/toolkit/components/glean/api/Cargo.toml b/toolkit/components/glean/api/Cargo.toml ---- a/toolkit/components/glean/api/Cargo.toml -+++ b/toolkit/components/glean/api/Cargo.toml -@@ -8,7 +8,7 @@ - [dependencies] - bincode = "1.0" - chrono = "0.4.10" --glean = "42.1.0" -+glean = "42.3.0" - inherent = "0.1.4" - log = "0.4" - nsstring = { path = "../../../../xpcom/rust/nsstring", optional = true } -diff --git a/toolkit/components/glean/docs/dev/updating_parser.md b/toolkit/components/glean/docs/dev/updating_parser.md ---- a/toolkit/components/glean/docs/dev/updating_parser.md -+++ b/toolkit/components/glean/docs/dev/updating_parser.md -@@ -5,14 +5,13 @@ - - [glean-parser]: https://pypi.org/project/glean-parser/ - --To update the in-tree glean-parser run -+To update the in-tree glean-parser change the version in `third_party/python/requirements.in`, -+then run - - ``` --./mach vendor python glean_parser==M.m.p -+./mach vendor python - ``` - --where `M.m.p` is the version number, e.g. 1.28.0. -- - ```eval_rst - .. note:: - -diff --git a/toolkit/components/glean/docs/dev/updating_sdk.md b/toolkit/components/glean/docs/dev/updating_sdk.md ---- a/toolkit/components/glean/docs/dev/updating_sdk.md -+++ b/toolkit/components/glean/docs/dev/updating_sdk.md -@@ -12,6 +12,7 @@ - 2. Run `mach vendor rust`. - This fetches all dependencies and adds them to `third_pary/rust`. - 3. Update the version of `gleanVersion` in `build.gradle` to the same version. -+4. Update the version of `glean-sdk` in `build/mach_virtualenv_packages.txt`. - - ## Version mismatches of Rust dependencies - -diff --git a/toolkit/components/glean/tests/test_pings.yaml b/toolkit/components/glean/tests/test_pings.yaml ---- a/toolkit/components/glean/tests/test_pings.yaml -+++ b/toolkit/components/glean/tests/test_pings.yaml -@@ -23,6 +23,8 @@ - notification_emails: - - chutten@mozilla.com - - glean-team@mozilla.com -+ no_lint: -+ - REDUNDANT_PING - - test-ping: - description: | -@@ -36,3 +38,5 @@ - notification_emails: - - chutten@mozilla.com - - glean-team@mozilla.com -+ no_lint: -+ - REDUNDANT_PING - diff --git a/firefox.spec b/firefox.spec index 85206db..7dadbf1 100644 --- a/firefox.spec +++ b/firefox.spec @@ -126,7 +126,7 @@ ExcludeArch: aarch64 %if %{?system_nss} %global nspr_version 4.26 %global nspr_build_version %{nspr_version} -%global nss_version 3.73 +%global nss_version 3.74 %global nss_build_version %{nss_version} %endif @@ -162,13 +162,13 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox -Version: 96.0.3 +Version: 97.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220131.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220208.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -210,16 +210,14 @@ Patch41: build-disable-elfhack.patch Patch44: build-arm-libopus.patch Patch46: firefox-nss-version.patch Patch47: fedora-shebang-build.patch -#Patch48: build-arm-wasm.patch Patch49: build-arm-libaom.patch Patch53: firefox-gcc-build.patch -# This should be fixed in Firefox 83 Patch54: mozilla-1669639.patch Patch55: firefox-testing.patch Patch57: firefox-disable-ffvpx-with-vapi.patch Patch61: firefox-glibc-dynstack.patch Patch62: build-python.patch -Patch63: build-python-glean.patch +Patch64: mozilla-1753402.patch # Test patches # Generate without context by @@ -244,13 +242,6 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch -# xdg-activation backports from 97.0 -Patch421: D132929.diff -Patch422: D133209.diff -Patch423: D133485.diff -Patch424: D133634.diff -Patch425: D133885.diff -Patch426: D134141.diff # PGO/LTO patches Patch600: pgo.patch @@ -465,8 +456,7 @@ This package contains results of tests executed during build. %patch54 -p1 -b .1669639 %patch55 -p1 -b .testing %patch57 -p1 -b .ffvpx-with-vapi -%patch63 -p1 -b .build-python-glean.patch -#%patch62 -p1 -b .build-python +%patch64 -p1 -b .1753402 # Test patches %patch100 -p1 -b .firefox-tests-xpcshell @@ -490,14 +480,6 @@ This package contains results of tests executed during build. %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 -# xdg-activation backports from 97.0 -%patch421 -p1 -b .D132929 -%patch422 -p1 -b .D133209 -%patch423 -p1 -b .D133485 -%patch424 -p1 -b .D133634 -%patch425 -p1 -b .D133885 -%patch426 -p1 -b .D134141 - # PGO patches %if %{build_with_pgo} %if !%{build_with_clang} @@ -1061,6 +1043,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue Feb 8 2022 Martin Stransky - 97.0-1 +- Updated to 97.0 + * Mon Jan 31 2022 Martin Stransky - 96.0.3-1 - Updated to 96.0.3 diff --git a/mozilla-1667096.patch b/mozilla-1667096.patch index ba87fbe..8a82677 100644 --- a/mozilla-1667096.patch +++ b/mozilla-1667096.patch @@ -1,18 +1,19 @@ -diff -up firefox-94.0/media/ffvpx/libavcodec/codec_list.c.1667096 firefox-94.0/media/ffvpx/libavcodec/codec_list.c ---- firefox-94.0/media/ffvpx/libavcodec/codec_list.c.1667096 2021-10-28 20:03:38.000000000 +0200 -+++ firefox-94.0/media/ffvpx/libavcodec/codec_list.c 2021-11-01 11:02:50.898723802 +0100 -@@ -11,4 +11,8 @@ static const AVCodec * const codec_list[ +diff -up firefox-97.0/media/ffvpx/libavcodec/codec_list.c.1667096 firefox-97.0/media/ffvpx/libavcodec/codec_list.c +--- firefox-97.0/media/ffvpx/libavcodec/codec_list.c.1667096 2022-02-08 10:21:17.151809054 +0100 ++++ firefox-97.0/media/ffvpx/libavcodec/codec_list.c 2022-02-08 10:25:11.374078784 +0100 +@@ -11,6 +11,9 @@ static const AVCodec * const codec_list[ #if CONFIG_MP3_DECODER &ff_mp3_decoder, #endif +#ifdef CONFIG_LIBFDK_AAC + &ff_libfdk_aac_decoder, +#endif -+ - NULL }; -diff -up firefox-94.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-94.0/media/ffvpx/libavcodec/libfdk-aacdec.c ---- firefox-94.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 2021-11-01 11:02:50.899723835 +0100 -+++ firefox-94.0/media/ffvpx/libavcodec/libfdk-aacdec.c 2021-11-01 11:02:50.899723835 +0100 + #if CONFIG_AV1_DECODER + &ff_av1_decoder, + #endif +diff -up firefox-97.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-97.0/media/ffvpx/libavcodec/libfdk-aacdec.c +--- firefox-97.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 2022-02-08 10:21:17.151809054 +0100 ++++ firefox-97.0/media/ffvpx/libavcodec/libfdk-aacdec.c 2022-02-08 10:21:17.151809054 +0100 @@ -0,0 +1,409 @@ +/* + * AAC decoder wrapper @@ -423,10 +424,10 @@ diff -up firefox-94.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-94. + FF_CODEC_CAP_INIT_CLEANUP, + .wrapper_name = "libfdk", +}; -diff -up firefox-94.0/media/ffvpx/libavcodec/moz.build.1667096 firefox-94.0/media/ffvpx/libavcodec/moz.build ---- firefox-94.0/media/ffvpx/libavcodec/moz.build.1667096 2021-10-28 20:03:43.000000000 +0200 -+++ firefox-94.0/media/ffvpx/libavcodec/moz.build 2021-11-01 11:02:50.899723835 +0100 -@@ -104,6 +104,12 @@ if not CONFIG['MOZ_FFVPX_AUDIOONLY']: +diff -up firefox-97.0/media/ffvpx/libavcodec/moz.build.1667096 firefox-97.0/media/ffvpx/libavcodec/moz.build +--- firefox-97.0/media/ffvpx/libavcodec/moz.build.1667096 2022-02-02 22:01:47.000000000 +0100 ++++ firefox-97.0/media/ffvpx/libavcodec/moz.build 2022-02-08 10:21:17.151809054 +0100 +@@ -111,6 +111,12 @@ if not CONFIG['MOZ_FFVPX_AUDIOONLY']: ] USE_LIBS += ['mozva'] @@ -439,14 +440,15 @@ diff -up firefox-94.0/media/ffvpx/libavcodec/moz.build.1667096 firefox-94.0/medi if CONFIG['MOZ_LIBAV_FFT']: SOURCES += [ 'avfft.c', -diff -up firefox-94.0/toolkit/moz.configure.1667096 firefox-94.0/toolkit/moz.configure ---- firefox-94.0/toolkit/moz.configure.1667096 2021-11-01 11:02:50.899723835 +0100 -+++ firefox-94.0/toolkit/moz.configure 2021-11-01 11:04:28.545873853 +0100 -@@ -1878,6 +1878,14 @@ with only_when(compile_environment): - & jpeg_arm_neon_vld1q_u8_x4, - ) +diff -up firefox-97.0/toolkit/moz.configure.1667096 firefox-97.0/toolkit/moz.configure +--- firefox-97.0/toolkit/moz.configure.1667096 2022-02-08 10:21:17.152809035 +0100 ++++ firefox-97.0/toolkit/moz.configure 2022-02-08 10:24:31.734885827 +0100 +@@ -1969,6 +1969,15 @@ with only_when(compile_environment): -+# fdk aac support + set_config("MOZ_SYSTEM_PNG", True, when="--with-system-png") + ++# FDK AAC support ++# ============================================================== +option('--with-system-fdk-aac', + help='Use system libfdk-aac (located with pkgconfig)') + diff --git a/mozilla-1753402.patch b/mozilla-1753402.patch new file mode 100644 index 0000000..e53e73b --- /dev/null +++ b/mozilla-1753402.patch @@ -0,0 +1,12 @@ +diff --git a/tools/profiler/rust-api/build.rs b/tools/profiler/rust-api/build.rs +--- a/tools/profiler/rust-api/build.rs ++++ b/tools/profiler/rust-api/build.rs +@@ -61,6 +61,7 @@ + let mut builder = Builder::default() + .enable_cxx_namespaces() + .with_codegen_config(CodegenConfig::TYPES | CodegenConfig::VARS | CodegenConfig::FUNCTIONS) ++ .disable_untagged_union() + .size_t_is_usize(true); + + for dir in SEARCH_PATHS.iter() { + diff --git a/sources b/sources index 733c1d2..9e974d6 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = b9ab1498be90ecf60822df7021f8812f124550d97f8cd687c69d3ab56fc5fb714bfe88c78c978a1794d211724909a9a5cad6a4b483fa05f762909c45d5075520 SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (firefox-96.0.3.source.tar.xz) = 3dd5fbc96e369d5f4fb3eca778c2bd3e2313d089f867de9fac3556810a797e9b5629ef1b8840fb2f22a18df7de95ea1993eee052f691d861a555cea544b05966 -SHA512 (firefox-langpacks-96.0.3-20220131.tar.xz) = 2c44690ed3ba6a0ba0ccb621598f8d6c619308b9a24cc6b39317603450e33b356b73d5c6ec41a34765c749067f7cd3c842ff0688b9d921377284671dc008de8a +SHA512 (firefox-97.0.source.tar.xz) = a913695a42cb06ee9bda2a20e65cc573e40ca93e9f75b7ee0a43ebd1935b371e7e80d5fc8d5f126ad0712ab848635a8624bbeed43807e5c179537aa32c884186 +SHA512 (firefox-langpacks-97.0-20220208.tar.xz) = 40c15f6c30566268fbc9c148d70f48bbf9f029b5d13c263e8e97917c96823d6bda552b1fd18e3f778117187c7fe44da0343dfd228bf66648a259e13cb1f94f28 From aa082530eb26093c301372e34f2aeee265d5c550 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 9 Feb 2022 15:31:15 +0100 Subject: [PATCH 016/545] Added alsa build req --- firefox.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/firefox.spec b/firefox.spec index 7dadbf1..18ae213 100644 --- a/firefox.spec +++ b/firefox.spec @@ -270,6 +270,7 @@ BuildRequires: pkgconfig(libstartup-notification-1.0) BuildRequires: pkgconfig(libnotify) >= %{libnotify_version} BuildRequires: pkgconfig(dri) BuildRequires: pkgconfig(libcurl) +BuildRequires: pkgconfig(alsa) BuildRequires: dbus-glib-devel %if %{?system_libvpx} BuildRequires: libvpx-devel >= %{libvpx_version} From 6d9b08e92bd775a96d0455e8aafa350592f3d315 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 17 Feb 2022 08:00:10 +0100 Subject: [PATCH 017/545] updated preferences --- firefox-redhat-default-prefs.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/firefox-redhat-default-prefs.js b/firefox-redhat-default-prefs.js index 89afe2c..1c0be99 100644 --- a/firefox-redhat-default-prefs.js +++ b/firefox-redhat-default-prefs.js @@ -2,7 +2,6 @@ pref("app.update.auto", false); pref("app.update.enabled", false); pref("app.update.autoInstallEnabled", false); pref("general.smoothScroll", true); -pref("intl.locale.matchOS", true); pref("intl.locale.requested", ""); pref("toolkit.storage.synchronous", 0); pref("toolkit.networkmanager.disable", false); @@ -18,7 +17,6 @@ pref("ui.SpellCheckerUnderlineStyle", 1); pref("startup.homepage_override_url", ""); pref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=https://start.fedoraproject.org/"); pref("browser.newtabpage.pinned", '[{"url":"https://start.fedoraproject.org/","title":"Fedora Project - Start Page"}]'); -pref("geo.wifi.uri", "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%"); pref("media.gmp-gmpopenh264.provider.enabled",false); pref("media.gmp-gmpopenh264.autoupdate",false); pref("media.gmp-gmpopenh264.enabled",false); @@ -26,7 +24,6 @@ pref("media.gmp.decoder.enabled", true); pref("plugins.notifyMissingFlash", false); /* See https://bugzilla.redhat.com/show_bug.cgi?id=1226489 */ pref("browser.display.use_system_colors", false); -pref("layers.use-image-offscreen-surfaces", false); /* Allow sending credetials to all https:// sites */ pref("network.negotiate-auth.trusted-uris", "https://"); pref("spellchecker.dictionary_path","/usr/share/myspell"); @@ -34,4 +31,6 @@ pref("spellchecker.dictionary_path","/usr/share/myspell"); pref("network.trr.mode", 5); /* Enable per-user policy dir, see mozbz#1583466 */ pref("browser.policies.perUserDir", true); -pref("browser.gnome-search-provider.enabled",true); \ No newline at end of file +pref("browser.gnome-search-provider.enabled",true); +/* Enable ffvpx playback for WebRTC */ +pref("media.navigator.mediadatadecoder_vpx_enabled", true); From af44b86020e0e51e4e42f7036c0b62c107aa4454 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 18 Feb 2022 10:02:34 +0100 Subject: [PATCH 018/545] Updated to 97.0.1 / GCC 12 build fixes --- .gitignore | 2 ++ D139022.diff | 34 +++++++++++++++++++ D139078.diff | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++ D139088.diff | 13 ++++++++ firefox.spec | 19 ++++++++--- sources | 4 +-- 6 files changed, 160 insertions(+), 6 deletions(-) create mode 100644 D139022.diff create mode 100644 D139078.diff create mode 100644 D139088.diff diff --git a/.gitignore b/.gitignore index 9a0d014..e0a7956 100644 --- a/.gitignore +++ b/.gitignore @@ -493,3 +493,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-96.0.3-20220131.tar.xz /firefox-97.0.source.tar.xz /firefox-langpacks-97.0-20220208.tar.xz +/firefox-97.0.1.source.tar.xz +/firefox-langpacks-97.0.1-20220218.tar.xz diff --git a/D139022.diff b/D139022.diff new file mode 100644 index 0000000..9d18162 --- /dev/null +++ b/D139022.diff @@ -0,0 +1,34 @@ +diff --git a/dom/animation/TimingParams.h b/dom/animation/TimingParams.h +--- a/dom/animation/TimingParams.h ++++ b/dom/animation/TimingParams.h +@@ -31,22 +31,19 @@ + struct TimingParams { + constexpr TimingParams() = default; + +- constexpr TimingParams(float aDuration, float aDelay, float aIterationCount, +- dom::PlaybackDirection aDirection, +- dom::FillMode aFillMode) ++ TimingParams(float aDuration, float aDelay, float aIterationCount, ++ dom::PlaybackDirection aDirection, dom::FillMode aFillMode) + : mIterations(aIterationCount), mDirection(aDirection), mFill(aFillMode) { + mDuration.emplace(StickyTimeDuration::FromMilliseconds(aDuration)); + mDelay = TimeDuration::FromMilliseconds(aDelay); + Update(); + } + +- constexpr TimingParams(const TimeDuration& aDuration, +- const TimeDuration& aDelay, +- const TimeDuration& aEndDelay, float aIterations, +- float aIterationStart, +- dom::PlaybackDirection aDirection, +- dom::FillMode aFillMode, +- Maybe&& aFunction) ++ TimingParams(const TimeDuration& aDuration, const TimeDuration& aDelay, ++ const TimeDuration& aEndDelay, float aIterations, ++ float aIterationStart, dom::PlaybackDirection aDirection, ++ dom::FillMode aFillMode, ++ Maybe&& aFunction) + : mDelay(aDelay), + mEndDelay(aEndDelay), + mIterations(aIterations), + diff --git a/D139078.diff b/D139078.diff new file mode 100644 index 0000000..8198e1a --- /dev/null +++ b/D139078.diff @@ -0,0 +1,94 @@ +diff --git a/gfx/wr/swgl/src/glsl.h b/gfx/wr/swgl/src/glsl.h +--- a/gfx/wr/swgl/src/glsl.h ++++ b/gfx/wr/swgl/src/glsl.h +@@ -2301,20 +2301,12 @@ + const vec2& operator[](int index) const { return data[index]; } + mat2() = default; + +- IMPLICIT mat2(Float a) { +- data[0] = vec2(a); +- data[1] = vec2(a); +- } ++ IMPLICIT constexpr mat2(Float a) : data{vec2(a), vec2(a)} {} + +- mat2(vec2 a, vec2 b) { +- data[0] = a; +- data[1] = b; +- } ++ constexpr mat2(vec2 a, vec2 b) : data{a, b} {} + IMPLICIT mat2(const mat4& mat); +- IMPLICIT constexpr mat2(mat2_scalar s) { +- data[0] = vec2(s.data[0]); +- data[1] = vec2(s.data[1]); +- } ++ IMPLICIT constexpr mat2(mat2_scalar s) ++ : data{vec2(s.data[0]), vec2(s.data[1])} {} + + friend vec2 operator*(mat2 m, vec2 v) { + vec2 u; +@@ -2404,30 +2396,19 @@ + vec3& operator[](int index) { return data[index]; } + const vec3& operator[](int index) const { return data[index]; } + mat3() = default; +- mat3(vec3 a, vec3 b, vec3 c) { +- data[0] = a; +- data[1] = b; +- data[2] = c; +- } ++ constexpr mat3(vec3 a, vec3 b, vec3 c) : data{a, b, c} {} + +- IMPLICIT constexpr mat3(mat3_scalar s) { +- data[0] = vec3(s.data[0]); +- data[1] = vec3(s.data[1]); +- data[2] = vec3(s.data[2]); +- } +- constexpr mat3(mat3_scalar s0, mat3_scalar s1, mat3_scalar s2, +- mat3_scalar s3) { +- data[0] = vec3(s0.data[0], s1.data[0], s2.data[0], s3.data[0]); +- data[1] = vec3(s0.data[1], s1.data[1], s2.data[1], s3.data[1]); +- data[2] = vec3(s0.data[2], s1.data[2], s2.data[2], s3.data[2]); +- } ++ IMPLICIT constexpr mat3(mat3_scalar s) ++ : data{vec3(s.data[0]), vec3(s.data[1]), vec3(s.data[2])} {} ++ ++ constexpr mat3(mat3_scalar s0, mat3_scalar s1, mat3_scalar s2, mat3_scalar s3) ++ : data{vec3(s0.data[0], s1.data[0], s2.data[0], s3.data[0]), ++ vec3(s0.data[1], s1.data[1], s2.data[1], s3.data[1]), ++ vec3(s0.data[2], s1.data[2], s2.data[2], s3.data[2])} {} + + constexpr mat3(Float d1, Float d2, Float d3, Float d4, Float d5, Float d6, +- Float d7, Float d8, Float d9) { +- data[0] = vec3(d1, d2, d3); +- data[1] = vec3(d4, d5, d6); +- data[2] = vec3(d7, d8, d9); +- } ++ Float d7, Float d8, Float d9) ++ : data{vec3(d1, d2, d3), vec3(d4, d5, d6), vec3(d7, d8, d9)} {} + + IMPLICIT mat3(const mat4& mat); + +@@ -2597,19 +2578,11 @@ + vec4 data[4]; + + mat4() = default; +- IMPLICIT constexpr mat4(mat4_scalar s) { +- data[0] = vec4(s.data[0]); +- data[1] = vec4(s.data[1]); +- data[2] = vec4(s.data[2]); +- data[3] = vec4(s.data[3]); +- } ++ IMPLICIT constexpr mat4(mat4_scalar s) ++ : data{vec4(s.data[0]), vec4(s.data[1]), vec4(s.data[2]), ++ vec4(s.data[3])} {} + +- mat4(vec4 a, vec4 b, vec4 c, vec4 d) { +- data[0] = a; +- data[1] = b; +- data[2] = c; +- data[3] = d; +- } ++ constexpr mat4(vec4 a, vec4 b, vec4 c, vec4 d) : data{a, b, c, d} {} + + vec4& operator[](int index) { return data[index]; } + const vec4& operator[](int index) const { return data[index]; } + diff --git a/D139088.diff b/D139088.diff new file mode 100644 index 0000000..91e9967 --- /dev/null +++ b/D139088.diff @@ -0,0 +1,13 @@ +diff --git a/gfx/wr/swgl/src/gl.cc b/gfx/wr/swgl/src/gl.cc +--- a/gfx/wr/swgl/src/gl.cc ++++ b/gfx/wr/swgl/src/gl.cc +@@ -82,7 +82,7 @@ + + #define FALLTHROUGH [[fallthrough]] + +-#ifdef MOZILLA_CLIENT ++#if defined(MOZILLA_CLIENT) && defined(MOZ_CLANG_PLUGIN) + # define IMPLICIT __attribute__((annotate("moz_implicit"))) + #else + # define IMPLICIT + diff --git a/firefox.spec b/firefox.spec index 18ae213..37bc621 100644 --- a/firefox.spec +++ b/firefox.spec @@ -162,13 +162,13 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox -Version: 97.0 +Version: 97.0.1 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220208.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220218.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -217,7 +217,11 @@ Patch55: firefox-testing.patch Patch57: firefox-disable-ffvpx-with-vapi.patch Patch61: firefox-glibc-dynstack.patch Patch62: build-python.patch -Patch64: mozilla-1753402.patch +#Patch64: mozilla-1753402.patch +# GCC12 build fixes +Patch65: D139022.diff +Patch66: D139078.diff +Patch67: D139088.diff # Test patches # Generate without context by @@ -457,7 +461,10 @@ This package contains results of tests executed during build. %patch54 -p1 -b .1669639 %patch55 -p1 -b .testing %patch57 -p1 -b .ffvpx-with-vapi -%patch64 -p1 -b .1753402 +#%patch64 -p1 -b .1753402 +%patch65 -p1 -b .D139022 +%patch66 -p1 -b .D139078 +%patch67 -p1 -b .D139088 # Test patches %patch100 -p1 -b .firefox-tests-xpcshell @@ -1044,6 +1051,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Fri Feb 18 2022 Martin Stransky - 97.0.1-1 +- Updated to 97.0.1 +- GCC 12 build fixes + * Tue Feb 8 2022 Martin Stransky - 97.0-1 - Updated to 97.0 diff --git a/sources b/sources index 9e974d6..d90aa63 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = b9ab1498be90ecf60822df7021f8812f124550d97f8cd687c69d3ab56fc5fb714bfe88c78c978a1794d211724909a9a5cad6a4b483fa05f762909c45d5075520 SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (firefox-97.0.source.tar.xz) = a913695a42cb06ee9bda2a20e65cc573e40ca93e9f75b7ee0a43ebd1935b371e7e80d5fc8d5f126ad0712ab848635a8624bbeed43807e5c179537aa32c884186 -SHA512 (firefox-langpacks-97.0-20220208.tar.xz) = 40c15f6c30566268fbc9c148d70f48bbf9f029b5d13c263e8e97917c96823d6bda552b1fd18e3f778117187c7fe44da0343dfd228bf66648a259e13cb1f94f28 +SHA512 (firefox-97.0.1.source.tar.xz) = 8620aace77167593aab5acd230860eb3e67eeddc49c0aad0491b5dc20bd0ddb6089dbb8975aed241426f57b2ad772238b04d03b95390175f580cbd80bb6d5f6c +SHA512 (firefox-langpacks-97.0.1-20220218.tar.xz) = bb191d08d5bf8b1d375667a019f33a35cc62ce416415ae1213ce392c112b54efde13d0ad2e1d4d7e84943ff1d20249c5970ec0e648067231b28ef13b9fa85306 From ecd56d6e3ab4bf198bd8f1b737e78bc10cae116d Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Tue, 22 Feb 2022 10:01:04 +0100 Subject: [PATCH 019/545] Backport WebRTC changes to PipeWire/Wayland screen sharing support --- firefox.spec | 10 +- libwebrtc-screen-cast-sync.patch | 9928 ++++++++++++++++++++++++++++++ 2 files changed, 9937 insertions(+), 1 deletion(-) create mode 100644 libwebrtc-screen-cast-sync.patch diff --git a/firefox.spec b/firefox.spec index 37bc621..4ed71c2 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 97.0.1 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -251,6 +251,9 @@ Patch415: mozilla-1670333.patch Patch600: pgo.patch Patch602: mozilla-1516803.patch +# Backported WebRTC changes for PipeWire/Wayland screen sharing support +Patch1000: libwebrtc-screen-cast-sync.patch + %if %{?system_nss} BuildRequires: pkgconfig(nspr) >= %{nspr_version} BuildRequires: pkgconfig(nss) >= %{nss_version} @@ -496,6 +499,8 @@ This package contains results of tests executed during build. %endif %endif +%patch1000 -p1 -b .libwebrtc-screen-cast-sync + %{__rm} -f .mozconfig %{__cp} %{SOURCE10} .mozconfig echo "ac_add_options --enable-default-toolkit=cairo-gtk3-wayland" >> .mozconfig @@ -1051,6 +1056,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Mon Feb 21 2022 Jan Grulich - 97.0.1-2 +- Backport WebRTC changes to PipeWire/Wayland screen sharing support + * Fri Feb 18 2022 Martin Stransky - 97.0.1-1 - Updated to 97.0.1 - GCC 12 build fixes diff --git a/libwebrtc-screen-cast-sync.patch b/libwebrtc-screen-cast-sync.patch new file mode 100644 index 0000000..da909ee --- /dev/null +++ b/libwebrtc-screen-cast-sync.patch @@ -0,0 +1,9928 @@ +From e0e925da71abb97a60d02716b18faa19a29fada6 Mon Sep 17 00:00:00 2001 +From: Jan Grulich +Date: Mon, 21 Feb 2022 15:34:52 +0100 +Subject: WebRTC - screen cast sync + + +diff --git a/dom/media/webrtc/third_party_build/moz.build b/dom/media/webrtc/third_party_build/moz.build +index e4c7ba7..a42f913 100644 +--- a/dom/media/webrtc/third_party_build/moz.build ++++ b/dom/media/webrtc/third_party_build/moz.build +@@ -63,6 +63,8 @@ webrtc_non_unified_sources = [ + + if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": + DIRS += ["../../../../third_party/pipewire/libpipewire"] ++ DIRS += ["../../../../third_party/drm/libdrm"] ++ DIRS += ["../../../../third_party/gbm/libgbm"] + + GN_DIRS += ["../../../../third_party/libwebrtc"] + +diff --git a/third_party/drm/README b/third_party/drm/README +new file mode 100644 +index 0000000..f68ed10 +--- /dev/null ++++ b/third_party/drm/README +@@ -0,0 +1,4 @@ ++Libdrm is a drm library wrapper needed to build and run Firefox with ++Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/drm). ++ ++libdrm directory stores headers of libdrm needed for build only. +diff --git a/third_party/drm/drm/drm.h b/third_party/drm/drm/drm.h +new file mode 100644 +index 0000000..5e54c3a +--- /dev/null ++++ b/third_party/drm/drm/drm.h +@@ -0,0 +1,1193 @@ ++/* ++ * Header for the Direct Rendering Manager ++ * ++ * Author: Rickard E. (Rik) Faith ++ * ++ * Acknowledgments: ++ * Dec 1999, Richard Henderson , move to generic cmpxchg. ++ */ ++ ++/* ++ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. ++ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. ++ * All rights reserved. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++#ifndef _DRM_H_ ++#define _DRM_H_ ++ ++#if defined(__linux__) ++ ++#include ++#include ++typedef unsigned int drm_handle_t; ++ ++#else /* One of the BSDs */ ++ ++#include ++#include ++#include ++typedef int8_t __s8; ++typedef uint8_t __u8; ++typedef int16_t __s16; ++typedef uint16_t __u16; ++typedef int32_t __s32; ++typedef uint32_t __u32; ++typedef int64_t __s64; ++typedef uint64_t __u64; ++typedef size_t __kernel_size_t; ++typedef unsigned long drm_handle_t; ++ ++#endif ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */ ++#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */ ++#define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */ ++#define DRM_RAM_PERCENT 10 /**< How much system ram can we lock? */ ++ ++#define _DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */ ++#define _DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */ ++#define _DRM_LOCK_IS_HELD(lock) ((lock) & _DRM_LOCK_HELD) ++#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT) ++#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) ++ ++typedef unsigned int drm_context_t; ++typedef unsigned int drm_drawable_t; ++typedef unsigned int drm_magic_t; ++ ++/* ++ * Cliprect. ++ * ++ * \warning: If you change this structure, make sure you change ++ * XF86DRIClipRectRec in the server as well ++ * ++ * \note KW: Actually it's illegal to change either for ++ * backwards-compatibility reasons. ++ */ ++struct drm_clip_rect { ++ unsigned short x1; ++ unsigned short y1; ++ unsigned short x2; ++ unsigned short y2; ++}; ++ ++/* ++ * Drawable information. ++ */ ++struct drm_drawable_info { ++ unsigned int num_rects; ++ struct drm_clip_rect *rects; ++}; ++ ++/* ++ * Texture region, ++ */ ++struct drm_tex_region { ++ unsigned char next; ++ unsigned char prev; ++ unsigned char in_use; ++ unsigned char padding; ++ unsigned int age; ++}; ++ ++/* ++ * Hardware lock. ++ * ++ * The lock structure is a simple cache-line aligned integer. To avoid ++ * processor bus contention on a multiprocessor system, there should not be any ++ * other data stored in the same cache line. ++ */ ++struct drm_hw_lock { ++ __volatile__ unsigned int lock; /**< lock variable */ ++ char padding[60]; /**< Pad to cache line */ ++}; ++ ++/* ++ * DRM_IOCTL_VERSION ioctl argument type. ++ * ++ * \sa drmGetVersion(). ++ */ ++struct drm_version { ++ int version_major; /**< Major version */ ++ int version_minor; /**< Minor version */ ++ int version_patchlevel; /**< Patch level */ ++ __kernel_size_t name_len; /**< Length of name buffer */ ++ char *name; /**< Name of driver */ ++ __kernel_size_t date_len; /**< Length of date buffer */ ++ char *date; /**< User-space buffer to hold date */ ++ __kernel_size_t desc_len; /**< Length of desc buffer */ ++ char *desc; /**< User-space buffer to hold desc */ ++}; ++ ++/* ++ * DRM_IOCTL_GET_UNIQUE ioctl argument type. ++ * ++ * \sa drmGetBusid() and drmSetBusId(). ++ */ ++struct drm_unique { ++ __kernel_size_t unique_len; /**< Length of unique */ ++ char *unique; /**< Unique name for driver instantiation */ ++}; ++ ++struct drm_list { ++ int count; /**< Length of user-space structures */ ++ struct drm_version *version; ++}; ++ ++struct drm_block { ++ int unused; ++}; ++ ++/* ++ * DRM_IOCTL_CONTROL ioctl argument type. ++ * ++ * \sa drmCtlInstHandler() and drmCtlUninstHandler(). ++ */ ++struct drm_control { ++ enum { ++ DRM_ADD_COMMAND, ++ DRM_RM_COMMAND, ++ DRM_INST_HANDLER, ++ DRM_UNINST_HANDLER ++ } func; ++ int irq; ++}; ++ ++/* ++ * Type of memory to map. ++ */ ++enum drm_map_type { ++ _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */ ++ _DRM_REGISTERS = 1, /**< no caching, no core dump */ ++ _DRM_SHM = 2, /**< shared, cached */ ++ _DRM_AGP = 3, /**< AGP/GART */ ++ _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */ ++ _DRM_CONSISTENT = 5 /**< Consistent memory for PCI DMA */ ++}; ++ ++/* ++ * Memory mapping flags. ++ */ ++enum drm_map_flags { ++ _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */ ++ _DRM_READ_ONLY = 0x02, ++ _DRM_LOCKED = 0x04, /**< shared, cached, locked */ ++ _DRM_KERNEL = 0x08, /**< kernel requires access */ ++ _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */ ++ _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */ ++ _DRM_REMOVABLE = 0x40, /**< Removable mapping */ ++ _DRM_DRIVER = 0x80 /**< Managed by driver */ ++}; ++ ++struct drm_ctx_priv_map { ++ unsigned int ctx_id; /**< Context requesting private mapping */ ++ void *handle; /**< Handle of map */ ++}; ++ ++/* ++ * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls ++ * argument type. ++ * ++ * \sa drmAddMap(). ++ */ ++struct drm_map { ++ unsigned long offset; /**< Requested physical address (0 for SAREA)*/ ++ unsigned long size; /**< Requested physical size (bytes) */ ++ enum drm_map_type type; /**< Type of memory to map */ ++ enum drm_map_flags flags; /**< Flags */ ++ void *handle; /**< User-space: "Handle" to pass to mmap() */ ++ /**< Kernel-space: kernel-virtual address */ ++ int mtrr; /**< MTRR slot used */ ++ /* Private data */ ++}; ++ ++/* ++ * DRM_IOCTL_GET_CLIENT ioctl argument type. ++ */ ++struct drm_client { ++ int idx; /**< Which client desired? */ ++ int auth; /**< Is client authenticated? */ ++ unsigned long pid; /**< Process ID */ ++ unsigned long uid; /**< User ID */ ++ unsigned long magic; /**< Magic */ ++ unsigned long iocs; /**< Ioctl count */ ++}; ++ ++enum drm_stat_type { ++ _DRM_STAT_LOCK, ++ _DRM_STAT_OPENS, ++ _DRM_STAT_CLOSES, ++ _DRM_STAT_IOCTLS, ++ _DRM_STAT_LOCKS, ++ _DRM_STAT_UNLOCKS, ++ _DRM_STAT_VALUE, /**< Generic value */ ++ _DRM_STAT_BYTE, /**< Generic byte counter (1024bytes/K) */ ++ _DRM_STAT_COUNT, /**< Generic non-byte counter (1000/k) */ ++ ++ _DRM_STAT_IRQ, /**< IRQ */ ++ _DRM_STAT_PRIMARY, /**< Primary DMA bytes */ ++ _DRM_STAT_SECONDARY, /**< Secondary DMA bytes */ ++ _DRM_STAT_DMA, /**< DMA */ ++ _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */ ++ _DRM_STAT_MISSED /**< Missed DMA opportunity */ ++ /* Add to the *END* of the list */ ++}; ++ ++/* ++ * DRM_IOCTL_GET_STATS ioctl argument type. ++ */ ++struct drm_stats { ++ unsigned long count; ++ struct { ++ unsigned long value; ++ enum drm_stat_type type; ++ } data[15]; ++}; ++ ++/* ++ * Hardware locking flags. ++ */ ++enum drm_lock_flags { ++ _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */ ++ _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */ ++ _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */ ++ _DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */ ++ /* These *HALT* flags aren't supported yet ++ -- they will be used to support the ++ full-screen DGA-like mode. */ ++ _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */ ++ _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ ++}; ++ ++/* ++ * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type. ++ * ++ * \sa drmGetLock() and drmUnlock(). ++ */ ++struct drm_lock { ++ int context; ++ enum drm_lock_flags flags; ++}; ++ ++/* ++ * DMA flags ++ * ++ * \warning ++ * These values \e must match xf86drm.h. ++ * ++ * \sa drm_dma. ++ */ ++enum drm_dma_flags { ++ /* Flags for DMA buffer dispatch */ ++ _DRM_DMA_BLOCK = 0x01, /**< ++ * Block until buffer dispatched. ++ * ++ * \note The buffer may not yet have ++ * been processed by the hardware -- ++ * getting a hardware lock with the ++ * hardware quiescent will ensure ++ * that the buffer has been ++ * processed. ++ */ ++ _DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */ ++ _DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */ ++ ++ /* Flags for DMA buffer request */ ++ _DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */ ++ _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */ ++ _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ ++}; ++ ++/* ++ * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type. ++ * ++ * \sa drmAddBufs(). ++ */ ++struct drm_buf_desc { ++ int count; /**< Number of buffers of this size */ ++ int size; /**< Size in bytes */ ++ int low_mark; /**< Low water mark */ ++ int high_mark; /**< High water mark */ ++ enum { ++ _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */ ++ _DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */ ++ _DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */ ++ _DRM_FB_BUFFER = 0x08, /**< Buffer is in frame buffer */ ++ _DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */ ++ } flags; ++ unsigned long agp_start; /**< ++ * Start address of where the AGP buffers are ++ * in the AGP aperture ++ */ ++}; ++ ++/* ++ * DRM_IOCTL_INFO_BUFS ioctl argument type. ++ */ ++struct drm_buf_info { ++ int count; /**< Entries in list */ ++ struct drm_buf_desc *list; ++}; ++ ++/* ++ * DRM_IOCTL_FREE_BUFS ioctl argument type. ++ */ ++struct drm_buf_free { ++ int count; ++ int *list; ++}; ++ ++/* ++ * Buffer information ++ * ++ * \sa drm_buf_map. ++ */ ++struct drm_buf_pub { ++ int idx; /**< Index into the master buffer list */ ++ int total; /**< Buffer size */ ++ int used; /**< Amount of buffer in use (for DMA) */ ++ void *address; /**< Address of buffer */ ++}; ++ ++/* ++ * DRM_IOCTL_MAP_BUFS ioctl argument type. ++ */ ++struct drm_buf_map { ++ int count; /**< Length of the buffer list */ ++#ifdef __cplusplus ++ void *virt; ++#else ++ void *virtual; /**< Mmap'd area in user-virtual */ ++#endif ++ struct drm_buf_pub *list; /**< Buffer information */ ++}; ++ ++/* ++ * DRM_IOCTL_DMA ioctl argument type. ++ * ++ * Indices here refer to the offset into the buffer list in drm_buf_get. ++ * ++ * \sa drmDMA(). ++ */ ++struct drm_dma { ++ int context; /**< Context handle */ ++ int send_count; /**< Number of buffers to send */ ++ int *send_indices; /**< List of handles to buffers */ ++ int *send_sizes; /**< Lengths of data to send */ ++ enum drm_dma_flags flags; /**< Flags */ ++ int request_count; /**< Number of buffers requested */ ++ int request_size; /**< Desired size for buffers */ ++ int *request_indices; /**< Buffer information */ ++ int *request_sizes; ++ int granted_count; /**< Number of buffers granted */ ++}; ++ ++enum drm_ctx_flags { ++ _DRM_CONTEXT_PRESERVED = 0x01, ++ _DRM_CONTEXT_2DONLY = 0x02 ++}; ++ ++/* ++ * DRM_IOCTL_ADD_CTX ioctl argument type. ++ * ++ * \sa drmCreateContext() and drmDestroyContext(). ++ */ ++struct drm_ctx { ++ drm_context_t handle; ++ enum drm_ctx_flags flags; ++}; ++ ++/* ++ * DRM_IOCTL_RES_CTX ioctl argument type. ++ */ ++struct drm_ctx_res { ++ int count; ++ struct drm_ctx *contexts; ++}; ++ ++/* ++ * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type. ++ */ ++struct drm_draw { ++ drm_drawable_t handle; ++}; ++ ++/* ++ * DRM_IOCTL_UPDATE_DRAW ioctl argument type. ++ */ ++typedef enum { ++ DRM_DRAWABLE_CLIPRECTS ++} drm_drawable_info_type_t; ++ ++struct drm_update_draw { ++ drm_drawable_t handle; ++ unsigned int type; ++ unsigned int num; ++ unsigned long long data; ++}; ++ ++/* ++ * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type. ++ */ ++struct drm_auth { ++ drm_magic_t magic; ++}; ++ ++/* ++ * DRM_IOCTL_IRQ_BUSID ioctl argument type. ++ * ++ * \sa drmGetInterruptFromBusID(). ++ */ ++struct drm_irq_busid { ++ int irq; /**< IRQ number */ ++ int busnum; /**< bus number */ ++ int devnum; /**< device number */ ++ int funcnum; /**< function number */ ++}; ++ ++enum drm_vblank_seq_type { ++ _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ ++ _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ ++ /* bits 1-6 are reserved for high crtcs */ ++ _DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e, ++ _DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */ ++ _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ ++ _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ ++ _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ ++ _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking, unsupported */ ++}; ++#define _DRM_VBLANK_HIGH_CRTC_SHIFT 1 ++ ++#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE) ++#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \ ++ _DRM_VBLANK_SECONDARY | _DRM_VBLANK_NEXTONMISS) ++ ++struct drm_wait_vblank_request { ++ enum drm_vblank_seq_type type; ++ unsigned int sequence; ++ unsigned long signal; ++}; ++ ++struct drm_wait_vblank_reply { ++ enum drm_vblank_seq_type type; ++ unsigned int sequence; ++ long tval_sec; ++ long tval_usec; ++}; ++ ++/* ++ * DRM_IOCTL_WAIT_VBLANK ioctl argument type. ++ * ++ * \sa drmWaitVBlank(). ++ */ ++union drm_wait_vblank { ++ struct drm_wait_vblank_request request; ++ struct drm_wait_vblank_reply reply; ++}; ++ ++#define _DRM_PRE_MODESET 1 ++#define _DRM_POST_MODESET 2 ++ ++/* ++ * DRM_IOCTL_MODESET_CTL ioctl argument type ++ * ++ * \sa drmModesetCtl(). ++ */ ++struct drm_modeset_ctl { ++ __u32 crtc; ++ __u32 cmd; ++}; ++ ++/* ++ * DRM_IOCTL_AGP_ENABLE ioctl argument type. ++ * ++ * \sa drmAgpEnable(). ++ */ ++struct drm_agp_mode { ++ unsigned long mode; /**< AGP mode */ ++}; ++ ++/* ++ * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type. ++ * ++ * \sa drmAgpAlloc() and drmAgpFree(). ++ */ ++struct drm_agp_buffer { ++ unsigned long size; /**< In bytes -- will round to page boundary */ ++ unsigned long handle; /**< Used for binding / unbinding */ ++ unsigned long type; /**< Type of memory to allocate */ ++ unsigned long physical; /**< Physical used by i810 */ ++}; ++ ++/* ++ * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type. ++ * ++ * \sa drmAgpBind() and drmAgpUnbind(). ++ */ ++struct drm_agp_binding { ++ unsigned long handle; /**< From drm_agp_buffer */ ++ unsigned long offset; /**< In bytes -- will round to page boundary */ ++}; ++ ++/* ++ * DRM_IOCTL_AGP_INFO ioctl argument type. ++ * ++ * \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(), ++ * drmAgpBase(), drmAgpSize(), drmAgpMemoryUsed(), drmAgpMemoryAvail(), ++ * drmAgpVendorId() and drmAgpDeviceId(). ++ */ ++struct drm_agp_info { ++ int agp_version_major; ++ int agp_version_minor; ++ unsigned long mode; ++ unsigned long aperture_base; /* physical address */ ++ unsigned long aperture_size; /* bytes */ ++ unsigned long memory_allowed; /* bytes */ ++ unsigned long memory_used; ++ ++ /* PCI information */ ++ unsigned short id_vendor; ++ unsigned short id_device; ++}; ++ ++/* ++ * DRM_IOCTL_SG_ALLOC ioctl argument type. ++ */ ++struct drm_scatter_gather { ++ unsigned long size; /**< In bytes -- will round to page boundary */ ++ unsigned long handle; /**< Used for mapping / unmapping */ ++}; ++ ++/* ++ * DRM_IOCTL_SET_VERSION ioctl argument type. ++ */ ++struct drm_set_version { ++ int drm_di_major; ++ int drm_di_minor; ++ int drm_dd_major; ++ int drm_dd_minor; ++}; ++ ++/* DRM_IOCTL_GEM_CLOSE ioctl argument type */ ++struct drm_gem_close { ++ /** Handle of the object to be closed. */ ++ __u32 handle; ++ __u32 pad; ++}; ++ ++/* DRM_IOCTL_GEM_FLINK ioctl argument type */ ++struct drm_gem_flink { ++ /** Handle for the object being named */ ++ __u32 handle; ++ ++ /** Returned global name */ ++ __u32 name; ++}; ++ ++/* DRM_IOCTL_GEM_OPEN ioctl argument type */ ++struct drm_gem_open { ++ /** Name of object being opened */ ++ __u32 name; ++ ++ /** Returned handle for the object */ ++ __u32 handle; ++ ++ /** Returned size of the object */ ++ __u64 size; ++}; ++ ++/** ++ * DRM_CAP_DUMB_BUFFER ++ * ++ * If set to 1, the driver supports creating dumb buffers via the ++ * &DRM_IOCTL_MODE_CREATE_DUMB ioctl. ++ */ ++#define DRM_CAP_DUMB_BUFFER 0x1 ++/** ++ * DRM_CAP_VBLANK_HIGH_CRTC ++ * ++ * If set to 1, the kernel supports specifying a :ref:`CRTC index` ++ * in the high bits of &drm_wait_vblank_request.type. ++ * ++ * Starting kernel version 2.6.39, this capability is always set to 1. ++ */ ++#define DRM_CAP_VBLANK_HIGH_CRTC 0x2 ++/** ++ * DRM_CAP_DUMB_PREFERRED_DEPTH ++ * ++ * The preferred bit depth for dumb buffers. ++ * ++ * The bit depth is the number of bits used to indicate the color of a single ++ * pixel excluding any padding. This is different from the number of bits per ++ * pixel. For instance, XRGB8888 has a bit depth of 24 but has 32 bits per ++ * pixel. ++ * ++ * Note that this preference only applies to dumb buffers, it's irrelevant for ++ * other types of buffers. ++ */ ++#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3 ++/** ++ * DRM_CAP_DUMB_PREFER_SHADOW ++ * ++ * If set to 1, the driver prefers userspace to render to a shadow buffer ++ * instead of directly rendering to a dumb buffer. For best speed, userspace ++ * should do streaming ordered memory copies into the dumb buffer and never ++ * read from it. ++ * ++ * Note that this preference only applies to dumb buffers, it's irrelevant for ++ * other types of buffers. ++ */ ++#define DRM_CAP_DUMB_PREFER_SHADOW 0x4 ++/** ++ * DRM_CAP_PRIME ++ * ++ * Bitfield of supported PRIME sharing capabilities. See &DRM_PRIME_CAP_IMPORT ++ * and &DRM_PRIME_CAP_EXPORT. ++ * ++ * PRIME buffers are exposed as dma-buf file descriptors. See ++ * Documentation/gpu/drm-mm.rst, section "PRIME Buffer Sharing". ++ */ ++#define DRM_CAP_PRIME 0x5 ++/** ++ * DRM_PRIME_CAP_IMPORT ++ * ++ * If this bit is set in &DRM_CAP_PRIME, the driver supports importing PRIME ++ * buffers via the &DRM_IOCTL_PRIME_FD_TO_HANDLE ioctl. ++ */ ++#define DRM_PRIME_CAP_IMPORT 0x1 ++/** ++ * DRM_PRIME_CAP_EXPORT ++ * ++ * If this bit is set in &DRM_CAP_PRIME, the driver supports exporting PRIME ++ * buffers via the &DRM_IOCTL_PRIME_HANDLE_TO_FD ioctl. ++ */ ++#define DRM_PRIME_CAP_EXPORT 0x2 ++/** ++ * DRM_CAP_TIMESTAMP_MONOTONIC ++ * ++ * If set to 0, the kernel will report timestamps with ``CLOCK_REALTIME`` in ++ * struct drm_event_vblank. If set to 1, the kernel will report timestamps with ++ * ``CLOCK_MONOTONIC``. See ``clock_gettime(2)`` for the definition of these ++ * clocks. ++ * ++ * Starting from kernel version 2.6.39, the default value for this capability ++ * is 1. Starting kernel version 4.15, this capability is always set to 1. ++ */ ++#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 ++/** ++ * DRM_CAP_ASYNC_PAGE_FLIP ++ * ++ * If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC. ++ */ ++#define DRM_CAP_ASYNC_PAGE_FLIP 0x7 ++/** ++ * DRM_CAP_CURSOR_WIDTH ++ * ++ * The ``CURSOR_WIDTH`` and ``CURSOR_HEIGHT`` capabilities return a valid ++ * width x height combination for the hardware cursor. The intention is that a ++ * hardware agnostic userspace can query a cursor plane size to use. ++ * ++ * Note that the cross-driver contract is to merely return a valid size; ++ * drivers are free to attach another meaning on top, eg. i915 returns the ++ * maximum plane size. ++ */ ++#define DRM_CAP_CURSOR_WIDTH 0x8 ++/** ++ * DRM_CAP_CURSOR_HEIGHT ++ * ++ * See &DRM_CAP_CURSOR_WIDTH. ++ */ ++#define DRM_CAP_CURSOR_HEIGHT 0x9 ++/** ++ * DRM_CAP_ADDFB2_MODIFIERS ++ * ++ * If set to 1, the driver supports supplying modifiers in the ++ * &DRM_IOCTL_MODE_ADDFB2 ioctl. ++ */ ++#define DRM_CAP_ADDFB2_MODIFIERS 0x10 ++/** ++ * DRM_CAP_PAGE_FLIP_TARGET ++ * ++ * If set to 1, the driver supports the &DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE and ++ * &DRM_MODE_PAGE_FLIP_TARGET_RELATIVE flags in ++ * &drm_mode_crtc_page_flip_target.flags for the &DRM_IOCTL_MODE_PAGE_FLIP ++ * ioctl. ++ */ ++#define DRM_CAP_PAGE_FLIP_TARGET 0x11 ++/** ++ * DRM_CAP_CRTC_IN_VBLANK_EVENT ++ * ++ * If set to 1, the kernel supports reporting the CRTC ID in ++ * &drm_event_vblank.crtc_id for the &DRM_EVENT_VBLANK and ++ * &DRM_EVENT_FLIP_COMPLETE events. ++ * ++ * Starting kernel version 4.12, this capability is always set to 1. ++ */ ++#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12 ++/** ++ * DRM_CAP_SYNCOBJ ++ * ++ * If set to 1, the driver supports sync objects. See ++ * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects". ++ */ ++#define DRM_CAP_SYNCOBJ 0x13 ++/** ++ * DRM_CAP_SYNCOBJ_TIMELINE ++ * ++ * If set to 1, the driver supports timeline operations on sync objects. See ++ * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects". ++ */ ++#define DRM_CAP_SYNCOBJ_TIMELINE 0x14 ++ ++/* DRM_IOCTL_GET_CAP ioctl argument type */ ++struct drm_get_cap { ++ __u64 capability; ++ __u64 value; ++}; ++ ++/** ++ * DRM_CLIENT_CAP_STEREO_3D ++ * ++ * If set to 1, the DRM core will expose the stereo 3D capabilities of the ++ * monitor by advertising the supported 3D layouts in the flags of struct ++ * drm_mode_modeinfo. See ``DRM_MODE_FLAG_3D_*``. ++ * ++ * This capability is always supported for all drivers starting from kernel ++ * version 3.13. ++ */ ++#define DRM_CLIENT_CAP_STEREO_3D 1 ++ ++/** ++ * DRM_CLIENT_CAP_UNIVERSAL_PLANES ++ * ++ * If set to 1, the DRM core will expose all planes (overlay, primary, and ++ * cursor) to userspace. ++ * ++ * This capability has been introduced in kernel version 3.15. Starting from ++ * kernel version 3.17, this capability is always supported for all drivers. ++ */ ++#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2 ++ ++/** ++ * DRM_CLIENT_CAP_ATOMIC ++ * ++ * If set to 1, the DRM core will expose atomic properties to userspace. This ++ * implicitly enables &DRM_CLIENT_CAP_UNIVERSAL_PLANES and ++ * &DRM_CLIENT_CAP_ASPECT_RATIO. ++ * ++ * If the driver doesn't support atomic mode-setting, enabling this capability ++ * will fail with -EOPNOTSUPP. ++ * ++ * This capability has been introduced in kernel version 4.0. Starting from ++ * kernel version 4.2, this capability is always supported for atomic-capable ++ * drivers. ++ */ ++#define DRM_CLIENT_CAP_ATOMIC 3 ++ ++/** ++ * DRM_CLIENT_CAP_ASPECT_RATIO ++ * ++ * If set to 1, the DRM core will provide aspect ratio information in modes. ++ * See ``DRM_MODE_FLAG_PIC_AR_*``. ++ * ++ * This capability is always supported for all drivers starting from kernel ++ * version 4.18. ++ */ ++#define DRM_CLIENT_CAP_ASPECT_RATIO 4 ++ ++/** ++ * DRM_CLIENT_CAP_WRITEBACK_CONNECTORS ++ * ++ * If set to 1, the DRM core will expose special connectors to be used for ++ * writing back to memory the scene setup in the commit. The client must enable ++ * &DRM_CLIENT_CAP_ATOMIC first. ++ * ++ * This capability is always supported for atomic-capable drivers starting from ++ * kernel version 4.19. ++ */ ++#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5 ++ ++/* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ ++struct drm_set_client_cap { ++ __u64 capability; ++ __u64 value; ++}; ++ ++#define DRM_RDWR O_RDWR ++#define DRM_CLOEXEC O_CLOEXEC ++struct drm_prime_handle { ++ __u32 handle; ++ ++ /** Flags.. only applicable for handle->fd */ ++ __u32 flags; ++ ++ /** Returned dmabuf file descriptor */ ++ __s32 fd; ++}; ++ ++struct drm_syncobj_create { ++ __u32 handle; ++#define DRM_SYNCOBJ_CREATE_SIGNALED (1 << 0) ++ __u32 flags; ++}; ++ ++struct drm_syncobj_destroy { ++ __u32 handle; ++ __u32 pad; ++}; ++ ++#define DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE (1 << 0) ++#define DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_EXPORT_SYNC_FILE (1 << 0) ++struct drm_syncobj_handle { ++ __u32 handle; ++ __u32 flags; ++ ++ __s32 fd; ++ __u32 pad; ++}; ++ ++struct drm_syncobj_transfer { ++ __u32 src_handle; ++ __u32 dst_handle; ++ __u64 src_point; ++ __u64 dst_point; ++ __u32 flags; ++ __u32 pad; ++}; ++ ++#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0) ++#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1) ++#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE (1 << 2) /* wait for time point to become available */ ++struct drm_syncobj_wait { ++ __u64 handles; ++ /* absolute timeout */ ++ __s64 timeout_nsec; ++ __u32 count_handles; ++ __u32 flags; ++ __u32 first_signaled; /* only valid when not waiting all */ ++ __u32 pad; ++}; ++ ++struct drm_syncobj_timeline_wait { ++ __u64 handles; ++ /* wait on specific timeline point for every handles*/ ++ __u64 points; ++ /* absolute timeout */ ++ __s64 timeout_nsec; ++ __u32 count_handles; ++ __u32 flags; ++ __u32 first_signaled; /* only valid when not waiting all */ ++ __u32 pad; ++}; ++ ++ ++struct drm_syncobj_array { ++ __u64 handles; ++ __u32 count_handles; ++ __u32 pad; ++}; ++ ++#define DRM_SYNCOBJ_QUERY_FLAGS_LAST_SUBMITTED (1 << 0) /* last available point on timeline syncobj */ ++struct drm_syncobj_timeline_array { ++ __u64 handles; ++ __u64 points; ++ __u32 count_handles; ++ __u32 flags; ++}; ++ ++ ++/* Query current scanout sequence number */ ++struct drm_crtc_get_sequence { ++ __u32 crtc_id; /* requested crtc_id */ ++ __u32 active; /* return: crtc output is active */ ++ __u64 sequence; /* return: most recent vblank sequence */ ++ __s64 sequence_ns; /* return: most recent time of first pixel out */ ++}; ++ ++/* Queue event to be delivered at specified sequence. Time stamp marks ++ * when the first pixel of the refresh cycle leaves the display engine ++ * for the display ++ */ ++#define DRM_CRTC_SEQUENCE_RELATIVE 0x00000001 /* sequence is relative to current */ ++#define DRM_CRTC_SEQUENCE_NEXT_ON_MISS 0x00000002 /* Use next sequence if we've missed */ ++ ++struct drm_crtc_queue_sequence { ++ __u32 crtc_id; ++ __u32 flags; ++ __u64 sequence; /* on input, target sequence. on output, actual sequence */ ++ __u64 user_data; /* user data passed to event */ ++}; ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#include "drm_mode.h" ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++#define DRM_IOCTL_BASE 'd' ++#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr) ++#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type) ++#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type) ++#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type) ++ ++#define DRM_IOCTL_VERSION DRM_IOWR(0x00, struct drm_version) ++#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, struct drm_unique) ++#define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, struct drm_auth) ++#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, struct drm_irq_busid) ++#define DRM_IOCTL_GET_MAP DRM_IOWR(0x04, struct drm_map) ++#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client) ++#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats) ++#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version) ++#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl) ++#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close) ++#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink) ++#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open) ++#define DRM_IOCTL_GET_CAP DRM_IOWR(0x0c, struct drm_get_cap) ++#define DRM_IOCTL_SET_CLIENT_CAP DRM_IOW( 0x0d, struct drm_set_client_cap) ++ ++#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique) ++#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth) ++#define DRM_IOCTL_BLOCK DRM_IOWR(0x12, struct drm_block) ++#define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, struct drm_block) ++#define DRM_IOCTL_CONTROL DRM_IOW( 0x14, struct drm_control) ++#define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, struct drm_map) ++#define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, struct drm_buf_desc) ++#define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, struct drm_buf_desc) ++#define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, struct drm_buf_info) ++#define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, struct drm_buf_map) ++#define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, struct drm_buf_free) ++ ++#define DRM_IOCTL_RM_MAP DRM_IOW( 0x1b, struct drm_map) ++ ++#define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, struct drm_ctx_priv_map) ++#define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, struct drm_ctx_priv_map) ++ ++#define DRM_IOCTL_SET_MASTER DRM_IO(0x1e) ++#define DRM_IOCTL_DROP_MASTER DRM_IO(0x1f) ++ ++#define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, struct drm_ctx) ++#define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, struct drm_ctx) ++#define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, struct drm_ctx) ++#define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, struct drm_ctx) ++#define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, struct drm_ctx) ++#define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, struct drm_ctx) ++#define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, struct drm_ctx_res) ++#define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, struct drm_draw) ++#define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, struct drm_draw) ++#define DRM_IOCTL_DMA DRM_IOWR(0x29, struct drm_dma) ++#define DRM_IOCTL_LOCK DRM_IOW( 0x2a, struct drm_lock) ++#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock) ++#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock) ++ ++#define DRM_IOCTL_PRIME_HANDLE_TO_FD DRM_IOWR(0x2d, struct drm_prime_handle) ++#define DRM_IOCTL_PRIME_FD_TO_HANDLE DRM_IOWR(0x2e, struct drm_prime_handle) ++ ++#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30) ++#define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31) ++#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode) ++#define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, struct drm_agp_info) ++#define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, struct drm_agp_buffer) ++#define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, struct drm_agp_buffer) ++#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding) ++#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding) ++ ++#define DRM_IOCTL_SG_ALLOC DRM_IOWR(0x38, struct drm_scatter_gather) ++#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather) ++ ++#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank) ++ ++#define DRM_IOCTL_CRTC_GET_SEQUENCE DRM_IOWR(0x3b, struct drm_crtc_get_sequence) ++#define DRM_IOCTL_CRTC_QUEUE_SEQUENCE DRM_IOWR(0x3c, struct drm_crtc_queue_sequence) ++ ++#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw) ++ ++#define DRM_IOCTL_MODE_GETRESOURCES DRM_IOWR(0xA0, struct drm_mode_card_res) ++#define DRM_IOCTL_MODE_GETCRTC DRM_IOWR(0xA1, struct drm_mode_crtc) ++#define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA2, struct drm_mode_crtc) ++#define DRM_IOCTL_MODE_CURSOR DRM_IOWR(0xA3, struct drm_mode_cursor) ++#define DRM_IOCTL_MODE_GETGAMMA DRM_IOWR(0xA4, struct drm_mode_crtc_lut) ++#define DRM_IOCTL_MODE_SETGAMMA DRM_IOWR(0xA5, struct drm_mode_crtc_lut) ++#define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xA6, struct drm_mode_get_encoder) ++#define DRM_IOCTL_MODE_GETCONNECTOR DRM_IOWR(0xA7, struct drm_mode_get_connector) ++#define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA8, struct drm_mode_mode_cmd) /* deprecated (never worked) */ ++#define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd) /* deprecated (never worked) */ ++ ++#define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAA, struct drm_mode_get_property) ++#define DRM_IOCTL_MODE_SETPROPERTY DRM_IOWR(0xAB, struct drm_mode_connector_set_property) ++#define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, struct drm_mode_get_blob) ++#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd) ++#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd) ++/** ++ * DRM_IOCTL_MODE_RMFB - Remove a framebuffer. ++ * ++ * This removes a framebuffer previously added via ADDFB/ADDFB2. The IOCTL ++ * argument is a framebuffer object ID. ++ * ++ * Warning: removing a framebuffer currently in-use on an enabled plane will ++ * disable that plane. The CRTC the plane is linked to may also be disabled ++ * (depending on driver capabilities). ++ */ ++#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int) ++#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip) ++#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd) ++ ++#define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb) ++#define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, struct drm_mode_map_dumb) ++#define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, struct drm_mode_destroy_dumb) ++#define DRM_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xB5, struct drm_mode_get_plane_res) ++#define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane) ++#define DRM_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct drm_mode_set_plane) ++#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2) ++#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties) ++#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property) ++#define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2) ++#define DRM_IOCTL_MODE_ATOMIC DRM_IOWR(0xBC, struct drm_mode_atomic) ++#define DRM_IOCTL_MODE_CREATEPROPBLOB DRM_IOWR(0xBD, struct drm_mode_create_blob) ++#define DRM_IOCTL_MODE_DESTROYPROPBLOB DRM_IOWR(0xBE, struct drm_mode_destroy_blob) ++ ++#define DRM_IOCTL_SYNCOBJ_CREATE DRM_IOWR(0xBF, struct drm_syncobj_create) ++#define DRM_IOCTL_SYNCOBJ_DESTROY DRM_IOWR(0xC0, struct drm_syncobj_destroy) ++#define DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD DRM_IOWR(0xC1, struct drm_syncobj_handle) ++#define DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE DRM_IOWR(0xC2, struct drm_syncobj_handle) ++#define DRM_IOCTL_SYNCOBJ_WAIT DRM_IOWR(0xC3, struct drm_syncobj_wait) ++#define DRM_IOCTL_SYNCOBJ_RESET DRM_IOWR(0xC4, struct drm_syncobj_array) ++#define DRM_IOCTL_SYNCOBJ_SIGNAL DRM_IOWR(0xC5, struct drm_syncobj_array) ++ ++#define DRM_IOCTL_MODE_CREATE_LEASE DRM_IOWR(0xC6, struct drm_mode_create_lease) ++#define DRM_IOCTL_MODE_LIST_LESSEES DRM_IOWR(0xC7, struct drm_mode_list_lessees) ++#define DRM_IOCTL_MODE_GET_LEASE DRM_IOWR(0xC8, struct drm_mode_get_lease) ++#define DRM_IOCTL_MODE_REVOKE_LEASE DRM_IOWR(0xC9, struct drm_mode_revoke_lease) ++ ++#define DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT DRM_IOWR(0xCA, struct drm_syncobj_timeline_wait) ++#define DRM_IOCTL_SYNCOBJ_QUERY DRM_IOWR(0xCB, struct drm_syncobj_timeline_array) ++#define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer) ++#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct drm_syncobj_timeline_array) ++ ++#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2) ++ ++/* ++ * Device specific ioctls should only be in their respective headers ++ * The device specific ioctl range is from 0x40 to 0x9f. ++ * Generic IOCTLS restart at 0xA0. ++ * ++ * \sa drmCommandNone(), drmCommandRead(), drmCommandWrite(), and ++ * drmCommandReadWrite(). ++ */ ++#define DRM_COMMAND_BASE 0x40 ++#define DRM_COMMAND_END 0xA0 ++ ++/* ++ * Header for events written back to userspace on the drm fd. The ++ * type defines the type of event, the length specifies the total ++ * length of the event (including the header), and user_data is ++ * typically a 64 bit value passed with the ioctl that triggered the ++ * event. A read on the drm fd will always only return complete ++ * events, that is, if for example the read buffer is 100 bytes, and ++ * there are two 64 byte events pending, only one will be returned. ++ * ++ * Event types 0 - 0x7fffffff are generic drm events, 0x80000000 and ++ * up are chipset specific. ++ */ ++struct drm_event { ++ __u32 type; ++ __u32 length; ++}; ++ ++#define DRM_EVENT_VBLANK 0x01 ++#define DRM_EVENT_FLIP_COMPLETE 0x02 ++#define DRM_EVENT_CRTC_SEQUENCE 0x03 ++ ++struct drm_event_vblank { ++ struct drm_event base; ++ __u64 user_data; ++ __u32 tv_sec; ++ __u32 tv_usec; ++ __u32 sequence; ++ __u32 crtc_id; /* 0 on older kernels that do not support this */ ++}; ++ ++/* Event delivered at sequence. Time stamp marks when the first pixel ++ * of the refresh cycle leaves the display engine for the display ++ */ ++struct drm_event_crtc_sequence { ++ struct drm_event base; ++ __u64 user_data; ++ __s64 time_ns; ++ __u64 sequence; ++}; ++ ++/* typedef area */ ++typedef struct drm_clip_rect drm_clip_rect_t; ++typedef struct drm_drawable_info drm_drawable_info_t; ++typedef struct drm_tex_region drm_tex_region_t; ++typedef struct drm_hw_lock drm_hw_lock_t; ++typedef struct drm_version drm_version_t; ++typedef struct drm_unique drm_unique_t; ++typedef struct drm_list drm_list_t; ++typedef struct drm_block drm_block_t; ++typedef struct drm_control drm_control_t; ++typedef enum drm_map_type drm_map_type_t; ++typedef enum drm_map_flags drm_map_flags_t; ++typedef struct drm_ctx_priv_map drm_ctx_priv_map_t; ++typedef struct drm_map drm_map_t; ++typedef struct drm_client drm_client_t; ++typedef enum drm_stat_type drm_stat_type_t; ++typedef struct drm_stats drm_stats_t; ++typedef enum drm_lock_flags drm_lock_flags_t; ++typedef struct drm_lock drm_lock_t; ++typedef enum drm_dma_flags drm_dma_flags_t; ++typedef struct drm_buf_desc drm_buf_desc_t; ++typedef struct drm_buf_info drm_buf_info_t; ++typedef struct drm_buf_free drm_buf_free_t; ++typedef struct drm_buf_pub drm_buf_pub_t; ++typedef struct drm_buf_map drm_buf_map_t; ++typedef struct drm_dma drm_dma_t; ++typedef union drm_wait_vblank drm_wait_vblank_t; ++typedef struct drm_agp_mode drm_agp_mode_t; ++typedef enum drm_ctx_flags drm_ctx_flags_t; ++typedef struct drm_ctx drm_ctx_t; ++typedef struct drm_ctx_res drm_ctx_res_t; ++typedef struct drm_draw drm_draw_t; ++typedef struct drm_update_draw drm_update_draw_t; ++typedef struct drm_auth drm_auth_t; ++typedef struct drm_irq_busid drm_irq_busid_t; ++typedef enum drm_vblank_seq_type drm_vblank_seq_type_t; ++ ++typedef struct drm_agp_buffer drm_agp_buffer_t; ++typedef struct drm_agp_binding drm_agp_binding_t; ++typedef struct drm_agp_info drm_agp_info_t; ++typedef struct drm_scatter_gather drm_scatter_gather_t; ++typedef struct drm_set_version drm_set_version_t; ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif +diff --git a/third_party/drm/drm/drm_fourcc.h b/third_party/drm/drm/drm_fourcc.h +new file mode 100644 +index 0000000..4ececa8 +--- /dev/null ++++ b/third_party/drm/drm/drm_fourcc.h +@@ -0,0 +1,1377 @@ ++/* ++ * Copyright 2011 Intel Corporation ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++#ifndef DRM_FOURCC_H ++#define DRM_FOURCC_H ++ ++#include "drm.h" ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++/** ++ * DOC: overview ++ * ++ * In the DRM subsystem, framebuffer pixel formats are described using the ++ * fourcc codes defined in `include/uapi/drm/drm_fourcc.h`. In addition to the ++ * fourcc code, a Format Modifier may optionally be provided, in order to ++ * further describe the buffer's format - for example tiling or compression. ++ * ++ * Format Modifiers ++ * ---------------- ++ * ++ * Format modifiers are used in conjunction with a fourcc code, forming a ++ * unique fourcc:modifier pair. This format:modifier pair must fully define the ++ * format and data layout of the buffer, and should be the only way to describe ++ * that particular buffer. ++ * ++ * Having multiple fourcc:modifier pairs which describe the same layout should ++ * be avoided, as such aliases run the risk of different drivers exposing ++ * different names for the same data format, forcing userspace to understand ++ * that they are aliases. ++ * ++ * Format modifiers may change any property of the buffer, including the number ++ * of planes and/or the required allocation size. Format modifiers are ++ * vendor-namespaced, and as such the relationship between a fourcc code and a ++ * modifier is specific to the modifer being used. For example, some modifiers ++ * may preserve meaning - such as number of planes - from the fourcc code, ++ * whereas others may not. ++ * ++ * Modifiers must uniquely encode buffer layout. In other words, a buffer must ++ * match only a single modifier. A modifier must not be a subset of layouts of ++ * another modifier. For instance, it's incorrect to encode pitch alignment in ++ * a modifier: a buffer may match a 64-pixel aligned modifier and a 32-pixel ++ * aligned modifier. That said, modifiers can have implicit minimal ++ * requirements. ++ * ++ * For modifiers where the combination of fourcc code and modifier can alias, ++ * a canonical pair needs to be defined and used by all drivers. Preferred ++ * combinations are also encouraged where all combinations might lead to ++ * confusion and unnecessarily reduced interoperability. An example for the ++ * latter is AFBC, where the ABGR layouts are preferred over ARGB layouts. ++ * ++ * There are two kinds of modifier users: ++ * ++ * - Kernel and user-space drivers: for drivers it's important that modifiers ++ * don't alias, otherwise two drivers might support the same format but use ++ * different aliases, preventing them from sharing buffers in an efficient ++ * format. ++ * - Higher-level programs interfacing with KMS/GBM/EGL/Vulkan/etc: these users ++ * see modifiers as opaque tokens they can check for equality and intersect. ++ * These users musn't need to know to reason about the modifier value ++ * (i.e. they are not expected to extract information out of the modifier). ++ * ++ * Vendors should document their modifier usage in as much detail as ++ * possible, to ensure maximum compatibility across devices, drivers and ++ * applications. ++ * ++ * The authoritative list of format modifier codes is found in ++ * `include/uapi/drm/drm_fourcc.h` ++ */ ++ ++#define fourcc_code(a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \ ++ ((__u32)(c) << 16) | ((__u32)(d) << 24)) ++ ++#define DRM_FORMAT_BIG_ENDIAN (1U<<31) /* format is big endian instead of little endian */ ++ ++/* Reserve 0 for the invalid format specifier */ ++#define DRM_FORMAT_INVALID 0 ++ ++/* color index */ ++#define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ') /* [7:0] C */ ++ ++/* 8 bpp Red */ ++#define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ') /* [7:0] R */ ++ ++/* 10 bpp Red */ ++#define DRM_FORMAT_R10 fourcc_code('R', '1', '0', ' ') /* [15:0] x:R 6:10 little endian */ ++ ++/* 12 bpp Red */ ++#define DRM_FORMAT_R12 fourcc_code('R', '1', '2', ' ') /* [15:0] x:R 4:12 little endian */ ++ ++/* 16 bpp Red */ ++#define DRM_FORMAT_R16 fourcc_code('R', '1', '6', ' ') /* [15:0] R little endian */ ++ ++/* 16 bpp RG */ ++#define DRM_FORMAT_RG88 fourcc_code('R', 'G', '8', '8') /* [15:0] R:G 8:8 little endian */ ++#define DRM_FORMAT_GR88 fourcc_code('G', 'R', '8', '8') /* [15:0] G:R 8:8 little endian */ ++ ++/* 32 bpp RG */ ++#define DRM_FORMAT_RG1616 fourcc_code('R', 'G', '3', '2') /* [31:0] R:G 16:16 little endian */ ++#define DRM_FORMAT_GR1616 fourcc_code('G', 'R', '3', '2') /* [31:0] G:R 16:16 little endian */ ++ ++/* 8 bpp RGB */ ++#define DRM_FORMAT_RGB332 fourcc_code('R', 'G', 'B', '8') /* [7:0] R:G:B 3:3:2 */ ++#define DRM_FORMAT_BGR233 fourcc_code('B', 'G', 'R', '8') /* [7:0] B:G:R 2:3:3 */ ++ ++/* 16 bpp RGB */ ++#define DRM_FORMAT_XRGB4444 fourcc_code('X', 'R', '1', '2') /* [15:0] x:R:G:B 4:4:4:4 little endian */ ++#define DRM_FORMAT_XBGR4444 fourcc_code('X', 'B', '1', '2') /* [15:0] x:B:G:R 4:4:4:4 little endian */ ++#define DRM_FORMAT_RGBX4444 fourcc_code('R', 'X', '1', '2') /* [15:0] R:G:B:x 4:4:4:4 little endian */ ++#define DRM_FORMAT_BGRX4444 fourcc_code('B', 'X', '1', '2') /* [15:0] B:G:R:x 4:4:4:4 little endian */ ++ ++#define DRM_FORMAT_ARGB4444 fourcc_code('A', 'R', '1', '2') /* [15:0] A:R:G:B 4:4:4:4 little endian */ ++#define DRM_FORMAT_ABGR4444 fourcc_code('A', 'B', '1', '2') /* [15:0] A:B:G:R 4:4:4:4 little endian */ ++#define DRM_FORMAT_RGBA4444 fourcc_code('R', 'A', '1', '2') /* [15:0] R:G:B:A 4:4:4:4 little endian */ ++#define DRM_FORMAT_BGRA4444 fourcc_code('B', 'A', '1', '2') /* [15:0] B:G:R:A 4:4:4:4 little endian */ ++ ++#define DRM_FORMAT_XRGB1555 fourcc_code('X', 'R', '1', '5') /* [15:0] x:R:G:B 1:5:5:5 little endian */ ++#define DRM_FORMAT_XBGR1555 fourcc_code('X', 'B', '1', '5') /* [15:0] x:B:G:R 1:5:5:5 little endian */ ++#define DRM_FORMAT_RGBX5551 fourcc_code('R', 'X', '1', '5') /* [15:0] R:G:B:x 5:5:5:1 little endian */ ++#define DRM_FORMAT_BGRX5551 fourcc_code('B', 'X', '1', '5') /* [15:0] B:G:R:x 5:5:5:1 little endian */ ++ ++#define DRM_FORMAT_ARGB1555 fourcc_code('A', 'R', '1', '5') /* [15:0] A:R:G:B 1:5:5:5 little endian */ ++#define DRM_FORMAT_ABGR1555 fourcc_code('A', 'B', '1', '5') /* [15:0] A:B:G:R 1:5:5:5 little endian */ ++#define DRM_FORMAT_RGBA5551 fourcc_code('R', 'A', '1', '5') /* [15:0] R:G:B:A 5:5:5:1 little endian */ ++#define DRM_FORMAT_BGRA5551 fourcc_code('B', 'A', '1', '5') /* [15:0] B:G:R:A 5:5:5:1 little endian */ ++ ++#define DRM_FORMAT_RGB565 fourcc_code('R', 'G', '1', '6') /* [15:0] R:G:B 5:6:5 little endian */ ++#define DRM_FORMAT_BGR565 fourcc_code('B', 'G', '1', '6') /* [15:0] B:G:R 5:6:5 little endian */ ++ ++/* 24 bpp RGB */ ++#define DRM_FORMAT_RGB888 fourcc_code('R', 'G', '2', '4') /* [23:0] R:G:B little endian */ ++#define DRM_FORMAT_BGR888 fourcc_code('B', 'G', '2', '4') /* [23:0] B:G:R little endian */ ++ ++/* 32 bpp RGB */ ++#define DRM_FORMAT_XRGB8888 fourcc_code('X', 'R', '2', '4') /* [31:0] x:R:G:B 8:8:8:8 little endian */ ++#define DRM_FORMAT_XBGR8888 fourcc_code('X', 'B', '2', '4') /* [31:0] x:B:G:R 8:8:8:8 little endian */ ++#define DRM_FORMAT_RGBX8888 fourcc_code('R', 'X', '2', '4') /* [31:0] R:G:B:x 8:8:8:8 little endian */ ++#define DRM_FORMAT_BGRX8888 fourcc_code('B', 'X', '2', '4') /* [31:0] B:G:R:x 8:8:8:8 little endian */ ++ ++#define DRM_FORMAT_ARGB8888 fourcc_code('A', 'R', '2', '4') /* [31:0] A:R:G:B 8:8:8:8 little endian */ ++#define DRM_FORMAT_ABGR8888 fourcc_code('A', 'B', '2', '4') /* [31:0] A:B:G:R 8:8:8:8 little endian */ ++#define DRM_FORMAT_RGBA8888 fourcc_code('R', 'A', '2', '4') /* [31:0] R:G:B:A 8:8:8:8 little endian */ ++#define DRM_FORMAT_BGRA8888 fourcc_code('B', 'A', '2', '4') /* [31:0] B:G:R:A 8:8:8:8 little endian */ ++ ++#define DRM_FORMAT_XRGB2101010 fourcc_code('X', 'R', '3', '0') /* [31:0] x:R:G:B 2:10:10:10 little endian */ ++#define DRM_FORMAT_XBGR2101010 fourcc_code('X', 'B', '3', '0') /* [31:0] x:B:G:R 2:10:10:10 little endian */ ++#define DRM_FORMAT_RGBX1010102 fourcc_code('R', 'X', '3', '0') /* [31:0] R:G:B:x 10:10:10:2 little endian */ ++#define DRM_FORMAT_BGRX1010102 fourcc_code('B', 'X', '3', '0') /* [31:0] B:G:R:x 10:10:10:2 little endian */ ++ ++#define DRM_FORMAT_ARGB2101010 fourcc_code('A', 'R', '3', '0') /* [31:0] A:R:G:B 2:10:10:10 little endian */ ++#define DRM_FORMAT_ABGR2101010 fourcc_code('A', 'B', '3', '0') /* [31:0] A:B:G:R 2:10:10:10 little endian */ ++#define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */ ++#define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */ ++ ++/* 64 bpp RGB */ ++#define DRM_FORMAT_XRGB16161616 fourcc_code('X', 'R', '4', '8') /* [63:0] x:R:G:B 16:16:16:16 little endian */ ++#define DRM_FORMAT_XBGR16161616 fourcc_code('X', 'B', '4', '8') /* [63:0] x:B:G:R 16:16:16:16 little endian */ ++ ++#define DRM_FORMAT_ARGB16161616 fourcc_code('A', 'R', '4', '8') /* [63:0] A:R:G:B 16:16:16:16 little endian */ ++#define DRM_FORMAT_ABGR16161616 fourcc_code('A', 'B', '4', '8') /* [63:0] A:B:G:R 16:16:16:16 little endian */ ++ ++/* ++ * Floating point 64bpp RGB ++ * IEEE 754-2008 binary16 half-precision float ++ * [15:0] sign:exponent:mantissa 1:5:10 ++ */ ++#define DRM_FORMAT_XRGB16161616F fourcc_code('X', 'R', '4', 'H') /* [63:0] x:R:G:B 16:16:16:16 little endian */ ++#define DRM_FORMAT_XBGR16161616F fourcc_code('X', 'B', '4', 'H') /* [63:0] x:B:G:R 16:16:16:16 little endian */ ++ ++#define DRM_FORMAT_ARGB16161616F fourcc_code('A', 'R', '4', 'H') /* [63:0] A:R:G:B 16:16:16:16 little endian */ ++#define DRM_FORMAT_ABGR16161616F fourcc_code('A', 'B', '4', 'H') /* [63:0] A:B:G:R 16:16:16:16 little endian */ ++ ++/* ++ * RGBA format with 10-bit components packed in 64-bit per pixel, with 6 bits ++ * of unused padding per component: ++ */ ++#define DRM_FORMAT_AXBXGXRX106106106106 fourcc_code('A', 'B', '1', '0') /* [63:0] A:x:B:x:G:x:R:x 10:6:10:6:10:6:10:6 little endian */ ++ ++/* packed YCbCr */ ++#define DRM_FORMAT_YUYV fourcc_code('Y', 'U', 'Y', 'V') /* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */ ++#define DRM_FORMAT_YVYU fourcc_code('Y', 'V', 'Y', 'U') /* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */ ++#define DRM_FORMAT_UYVY fourcc_code('U', 'Y', 'V', 'Y') /* [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian */ ++#define DRM_FORMAT_VYUY fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */ ++ ++#define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */ ++#define DRM_FORMAT_XYUV8888 fourcc_code('X', 'Y', 'U', 'V') /* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */ ++#define DRM_FORMAT_VUY888 fourcc_code('V', 'U', '2', '4') /* [23:0] Cr:Cb:Y 8:8:8 little endian */ ++#define DRM_FORMAT_VUY101010 fourcc_code('V', 'U', '3', '0') /* Y followed by U then V, 10:10:10. Non-linear modifier only */ ++ ++/* ++ * packed Y2xx indicate for each component, xx valid data occupy msb ++ * 16-xx padding occupy lsb ++ */ ++#define DRM_FORMAT_Y210 fourcc_code('Y', '2', '1', '0') /* [63:0] Cr0:0:Y1:0:Cb0:0:Y0:0 10:6:10:6:10:6:10:6 little endian per 2 Y pixels */ ++#define DRM_FORMAT_Y212 fourcc_code('Y', '2', '1', '2') /* [63:0] Cr0:0:Y1:0:Cb0:0:Y0:0 12:4:12:4:12:4:12:4 little endian per 2 Y pixels */ ++#define DRM_FORMAT_Y216 fourcc_code('Y', '2', '1', '6') /* [63:0] Cr0:Y1:Cb0:Y0 16:16:16:16 little endian per 2 Y pixels */ ++ ++/* ++ * packed Y4xx indicate for each component, xx valid data occupy msb ++ * 16-xx padding occupy lsb except Y410 ++ */ ++#define DRM_FORMAT_Y410 fourcc_code('Y', '4', '1', '0') /* [31:0] A:Cr:Y:Cb 2:10:10:10 little endian */ ++#define DRM_FORMAT_Y412 fourcc_code('Y', '4', '1', '2') /* [63:0] A:0:Cr:0:Y:0:Cb:0 12:4:12:4:12:4:12:4 little endian */ ++#define DRM_FORMAT_Y416 fourcc_code('Y', '4', '1', '6') /* [63:0] A:Cr:Y:Cb 16:16:16:16 little endian */ ++ ++#define DRM_FORMAT_XVYU2101010 fourcc_code('X', 'V', '3', '0') /* [31:0] X:Cr:Y:Cb 2:10:10:10 little endian */ ++#define DRM_FORMAT_XVYU12_16161616 fourcc_code('X', 'V', '3', '6') /* [63:0] X:0:Cr:0:Y:0:Cb:0 12:4:12:4:12:4:12:4 little endian */ ++#define DRM_FORMAT_XVYU16161616 fourcc_code('X', 'V', '4', '8') /* [63:0] X:Cr:Y:Cb 16:16:16:16 little endian */ ++ ++/* ++ * packed YCbCr420 2x2 tiled formats ++ * first 64 bits will contain Y,Cb,Cr components for a 2x2 tile ++ */ ++/* [63:0] A3:A2:Y3:0:Cr0:0:Y2:0:A1:A0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian */ ++#define DRM_FORMAT_Y0L0 fourcc_code('Y', '0', 'L', '0') ++/* [63:0] X3:X2:Y3:0:Cr0:0:Y2:0:X1:X0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian */ ++#define DRM_FORMAT_X0L0 fourcc_code('X', '0', 'L', '0') ++ ++/* [63:0] A3:A2:Y3:Cr0:Y2:A1:A0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian */ ++#define DRM_FORMAT_Y0L2 fourcc_code('Y', '0', 'L', '2') ++/* [63:0] X3:X2:Y3:Cr0:Y2:X1:X0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian */ ++#define DRM_FORMAT_X0L2 fourcc_code('X', '0', 'L', '2') ++ ++/* ++ * 1-plane YUV 4:2:0 ++ * In these formats, the component ordering is specified (Y, followed by U ++ * then V), but the exact Linear layout is undefined. ++ * These formats can only be used with a non-Linear modifier. ++ */ ++#define DRM_FORMAT_YUV420_8BIT fourcc_code('Y', 'U', '0', '8') ++#define DRM_FORMAT_YUV420_10BIT fourcc_code('Y', 'U', '1', '0') ++ ++/* ++ * 2 plane RGB + A ++ * index 0 = RGB plane, same format as the corresponding non _A8 format has ++ * index 1 = A plane, [7:0] A ++ */ ++#define DRM_FORMAT_XRGB8888_A8 fourcc_code('X', 'R', 'A', '8') ++#define DRM_FORMAT_XBGR8888_A8 fourcc_code('X', 'B', 'A', '8') ++#define DRM_FORMAT_RGBX8888_A8 fourcc_code('R', 'X', 'A', '8') ++#define DRM_FORMAT_BGRX8888_A8 fourcc_code('B', 'X', 'A', '8') ++#define DRM_FORMAT_RGB888_A8 fourcc_code('R', '8', 'A', '8') ++#define DRM_FORMAT_BGR888_A8 fourcc_code('B', '8', 'A', '8') ++#define DRM_FORMAT_RGB565_A8 fourcc_code('R', '5', 'A', '8') ++#define DRM_FORMAT_BGR565_A8 fourcc_code('B', '5', 'A', '8') ++ ++/* ++ * 2 plane YCbCr ++ * index 0 = Y plane, [7:0] Y ++ * index 1 = Cr:Cb plane, [15:0] Cr:Cb little endian ++ * or ++ * index 1 = Cb:Cr plane, [15:0] Cb:Cr little endian ++ */ ++#define DRM_FORMAT_NV12 fourcc_code('N', 'V', '1', '2') /* 2x2 subsampled Cr:Cb plane */ ++#define DRM_FORMAT_NV21 fourcc_code('N', 'V', '2', '1') /* 2x2 subsampled Cb:Cr plane */ ++#define DRM_FORMAT_NV16 fourcc_code('N', 'V', '1', '6') /* 2x1 subsampled Cr:Cb plane */ ++#define DRM_FORMAT_NV61 fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */ ++#define DRM_FORMAT_NV24 fourcc_code('N', 'V', '2', '4') /* non-subsampled Cr:Cb plane */ ++#define DRM_FORMAT_NV42 fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */ ++/* ++ * 2 plane YCbCr ++ * index 0 = Y plane, [39:0] Y3:Y2:Y1:Y0 little endian ++ * index 1 = Cr:Cb plane, [39:0] Cr1:Cb1:Cr0:Cb0 little endian ++ */ ++#define DRM_FORMAT_NV15 fourcc_code('N', 'V', '1', '5') /* 2x2 subsampled Cr:Cb plane */ ++ ++/* ++ * 2 plane YCbCr MSB aligned ++ * index 0 = Y plane, [15:0] Y:x [10:6] little endian ++ * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [10:6:10:6] little endian ++ */ ++#define DRM_FORMAT_P210 fourcc_code('P', '2', '1', '0') /* 2x1 subsampled Cr:Cb plane, 10 bit per channel */ ++ ++/* ++ * 2 plane YCbCr MSB aligned ++ * index 0 = Y plane, [15:0] Y:x [10:6] little endian ++ * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [10:6:10:6] little endian ++ */ ++#define DRM_FORMAT_P010 fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cr:Cb plane 10 bits per channel */ ++ ++/* ++ * 2 plane YCbCr MSB aligned ++ * index 0 = Y plane, [15:0] Y:x [12:4] little endian ++ * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [12:4:12:4] little endian ++ */ ++#define DRM_FORMAT_P012 fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cr:Cb plane 12 bits per channel */ ++ ++/* ++ * 2 plane YCbCr MSB aligned ++ * index 0 = Y plane, [15:0] Y little endian ++ * index 1 = Cr:Cb plane, [31:0] Cr:Cb [16:16] little endian ++ */ ++#define DRM_FORMAT_P016 fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cr:Cb plane 16 bits per channel */ ++ ++/* 3 plane non-subsampled (444) YCbCr ++ * 16 bits per component, but only 10 bits are used and 6 bits are padded ++ * index 0: Y plane, [15:0] Y:x [10:6] little endian ++ * index 1: Cb plane, [15:0] Cb:x [10:6] little endian ++ * index 2: Cr plane, [15:0] Cr:x [10:6] little endian ++ */ ++#define DRM_FORMAT_Q410 fourcc_code('Q', '4', '1', '0') ++ ++/* 3 plane non-subsampled (444) YCrCb ++ * 16 bits per component, but only 10 bits are used and 6 bits are padded ++ * index 0: Y plane, [15:0] Y:x [10:6] little endian ++ * index 1: Cr plane, [15:0] Cr:x [10:6] little endian ++ * index 2: Cb plane, [15:0] Cb:x [10:6] little endian ++ */ ++#define DRM_FORMAT_Q401 fourcc_code('Q', '4', '0', '1') ++ ++/* ++ * 3 plane YCbCr ++ * index 0: Y plane, [7:0] Y ++ * index 1: Cb plane, [7:0] Cb ++ * index 2: Cr plane, [7:0] Cr ++ * or ++ * index 1: Cr plane, [7:0] Cr ++ * index 2: Cb plane, [7:0] Cb ++ */ ++#define DRM_FORMAT_YUV410 fourcc_code('Y', 'U', 'V', '9') /* 4x4 subsampled Cb (1) and Cr (2) planes */ ++#define DRM_FORMAT_YVU410 fourcc_code('Y', 'V', 'U', '9') /* 4x4 subsampled Cr (1) and Cb (2) planes */ ++#define DRM_FORMAT_YUV411 fourcc_code('Y', 'U', '1', '1') /* 4x1 subsampled Cb (1) and Cr (2) planes */ ++#define DRM_FORMAT_YVU411 fourcc_code('Y', 'V', '1', '1') /* 4x1 subsampled Cr (1) and Cb (2) planes */ ++#define DRM_FORMAT_YUV420 fourcc_code('Y', 'U', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes */ ++#define DRM_FORMAT_YVU420 fourcc_code('Y', 'V', '1', '2') /* 2x2 subsampled Cr (1) and Cb (2) planes */ ++#define DRM_FORMAT_YUV422 fourcc_code('Y', 'U', '1', '6') /* 2x1 subsampled Cb (1) and Cr (2) planes */ ++#define DRM_FORMAT_YVU422 fourcc_code('Y', 'V', '1', '6') /* 2x1 subsampled Cr (1) and Cb (2) planes */ ++#define DRM_FORMAT_YUV444 fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */ ++#define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */ ++ ++ ++/* ++ * Format Modifiers: ++ * ++ * Format modifiers describe, typically, a re-ordering or modification ++ * of the data in a plane of an FB. This can be used to express tiled/ ++ * swizzled formats, or compression, or a combination of the two. ++ * ++ * The upper 8 bits of the format modifier are a vendor-id as assigned ++ * below. The lower 56 bits are assigned as vendor sees fit. ++ */ ++ ++/* Vendor Ids: */ ++#define DRM_FORMAT_MOD_VENDOR_NONE 0 ++#define DRM_FORMAT_MOD_VENDOR_INTEL 0x01 ++#define DRM_FORMAT_MOD_VENDOR_AMD 0x02 ++#define DRM_FORMAT_MOD_VENDOR_NVIDIA 0x03 ++#define DRM_FORMAT_MOD_VENDOR_SAMSUNG 0x04 ++#define DRM_FORMAT_MOD_VENDOR_QCOM 0x05 ++#define DRM_FORMAT_MOD_VENDOR_VIVANTE 0x06 ++#define DRM_FORMAT_MOD_VENDOR_BROADCOM 0x07 ++#define DRM_FORMAT_MOD_VENDOR_ARM 0x08 ++#define DRM_FORMAT_MOD_VENDOR_ALLWINNER 0x09 ++#define DRM_FORMAT_MOD_VENDOR_AMLOGIC 0x0a ++ ++/* add more to the end as needed */ ++ ++#define DRM_FORMAT_RESERVED ((1ULL << 56) - 1) ++ ++#define fourcc_mod_get_vendor(modifier) \ ++ (((modifier) >> 56) & 0xff) ++ ++#define fourcc_mod_is_vendor(modifier, vendor) \ ++ (fourcc_mod_get_vendor(modifier) == DRM_FORMAT_MOD_VENDOR_## vendor) ++ ++#define fourcc_mod_code(vendor, val) \ ++ ((((__u64)DRM_FORMAT_MOD_VENDOR_## vendor) << 56) | ((val) & 0x00ffffffffffffffULL)) ++ ++/* ++ * Format Modifier tokens: ++ * ++ * When adding a new token please document the layout with a code comment, ++ * similar to the fourcc codes above. drm_fourcc.h is considered the ++ * authoritative source for all of these. ++ * ++ * Generic modifier names: ++ * ++ * DRM_FORMAT_MOD_GENERIC_* definitions are used to provide vendor-neutral names ++ * for layouts which are common across multiple vendors. To preserve ++ * compatibility, in cases where a vendor-specific definition already exists and ++ * a generic name for it is desired, the common name is a purely symbolic alias ++ * and must use the same numerical value as the original definition. ++ * ++ * Note that generic names should only be used for modifiers which describe ++ * generic layouts (such as pixel re-ordering), which may have ++ * independently-developed support across multiple vendors. ++ * ++ * In future cases where a generic layout is identified before merging with a ++ * vendor-specific modifier, a new 'GENERIC' vendor or modifier using vendor ++ * 'NONE' could be considered. This should only be for obvious, exceptional ++ * cases to avoid polluting the 'GENERIC' namespace with modifiers which only ++ * apply to a single vendor. ++ * ++ * Generic names should not be used for cases where multiple hardware vendors ++ * have implementations of the same standardised compression scheme (such as ++ * AFBC). In those cases, all implementations should use the same format ++ * modifier(s), reflecting the vendor of the standard. ++ */ ++ ++#define DRM_FORMAT_MOD_GENERIC_16_16_TILE DRM_FORMAT_MOD_SAMSUNG_16_16_TILE ++ ++/* ++ * Invalid Modifier ++ * ++ * This modifier can be used as a sentinel to terminate the format modifiers ++ * list, or to initialize a variable with an invalid modifier. It might also be ++ * used to report an error back to userspace for certain APIs. ++ */ ++#define DRM_FORMAT_MOD_INVALID fourcc_mod_code(NONE, DRM_FORMAT_RESERVED) ++ ++/* ++ * Linear Layout ++ * ++ * Just plain linear layout. Note that this is different from no specifying any ++ * modifier (e.g. not setting DRM_MODE_FB_MODIFIERS in the DRM_ADDFB2 ioctl), ++ * which tells the driver to also take driver-internal information into account ++ * and so might actually result in a tiled framebuffer. ++ */ ++#define DRM_FORMAT_MOD_LINEAR fourcc_mod_code(NONE, 0) ++ ++/* ++ * Deprecated: use DRM_FORMAT_MOD_LINEAR instead ++ * ++ * The "none" format modifier doesn't actually mean that the modifier is ++ * implicit, instead it means that the layout is linear. Whether modifiers are ++ * used is out-of-band information carried in an API-specific way (e.g. in a ++ * flag for drm_mode_fb_cmd2). ++ */ ++#define DRM_FORMAT_MOD_NONE 0 ++ ++/* Intel framebuffer modifiers */ ++ ++/* ++ * Intel X-tiling layout ++ * ++ * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb) ++ * in row-major layout. Within the tile bytes are laid out row-major, with ++ * a platform-dependent stride. On top of that the memory can apply ++ * platform-depending swizzling of some higher address bits into bit6. ++ * ++ * Note that this layout is only accurate on intel gen 8+ or valleyview chipsets. ++ * On earlier platforms the is highly platforms specific and not useful for ++ * cross-driver sharing. It exists since on a given platform it does uniquely ++ * identify the layout in a simple way for i915-specific userspace, which ++ * facilitated conversion of userspace to modifiers. Additionally the exact ++ * format on some really old platforms is not known. ++ */ ++#define I915_FORMAT_MOD_X_TILED fourcc_mod_code(INTEL, 1) ++ ++/* ++ * Intel Y-tiling layout ++ * ++ * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb) ++ * in row-major layout. Within the tile bytes are laid out in OWORD (16 bytes) ++ * chunks column-major, with a platform-dependent height. On top of that the ++ * memory can apply platform-depending swizzling of some higher address bits ++ * into bit6. ++ * ++ * Note that this layout is only accurate on intel gen 8+ or valleyview chipsets. ++ * On earlier platforms the is highly platforms specific and not useful for ++ * cross-driver sharing. It exists since on a given platform it does uniquely ++ * identify the layout in a simple way for i915-specific userspace, which ++ * facilitated conversion of userspace to modifiers. Additionally the exact ++ * format on some really old platforms is not known. ++ */ ++#define I915_FORMAT_MOD_Y_TILED fourcc_mod_code(INTEL, 2) ++ ++/* ++ * Intel Yf-tiling layout ++ * ++ * This is a tiled layout using 4Kb tiles in row-major layout. ++ * Within the tile pixels are laid out in 16 256 byte units / sub-tiles which ++ * are arranged in four groups (two wide, two high) with column-major layout. ++ * Each group therefore consits out of four 256 byte units, which are also laid ++ * out as 2x2 column-major. ++ * 256 byte units are made out of four 64 byte blocks of pixels, producing ++ * either a square block or a 2:1 unit. ++ * 64 byte blocks of pixels contain four pixel rows of 16 bytes, where the width ++ * in pixel depends on the pixel depth. ++ */ ++#define I915_FORMAT_MOD_Yf_TILED fourcc_mod_code(INTEL, 3) ++ ++/* ++ * Intel color control surface (CCS) for render compression ++ * ++ * The framebuffer format must be one of the 8:8:8:8 RGB formats. ++ * The main surface will be plane index 0 and must be Y/Yf-tiled, ++ * the CCS will be plane index 1. ++ * ++ * Each CCS tile matches a 1024x512 pixel area of the main surface. ++ * To match certain aspects of the 3D hardware the CCS is ++ * considered to be made up of normal 128Bx32 Y tiles, Thus ++ * the CCS pitch must be specified in multiples of 128 bytes. ++ * ++ * In reality the CCS tile appears to be a 64Bx64 Y tile, composed ++ * of QWORD (8 bytes) chunks instead of OWORD (16 bytes) chunks. ++ * But that fact is not relevant unless the memory is accessed ++ * directly. ++ */ ++#define I915_FORMAT_MOD_Y_TILED_CCS fourcc_mod_code(INTEL, 4) ++#define I915_FORMAT_MOD_Yf_TILED_CCS fourcc_mod_code(INTEL, 5) ++ ++/* ++ * Intel color control surfaces (CCS) for Gen-12 render compression. ++ * ++ * The main surface is Y-tiled and at plane index 0, the CCS is linear and ++ * at index 1. A 64B CCS cache line corresponds to an area of 4x1 tiles in ++ * main surface. In other words, 4 bits in CCS map to a main surface cache ++ * line pair. The main surface pitch is required to be a multiple of four ++ * Y-tile widths. ++ */ ++#define I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS fourcc_mod_code(INTEL, 6) ++ ++/* ++ * Intel color control surfaces (CCS) for Gen-12 media compression ++ * ++ * The main surface is Y-tiled and at plane index 0, the CCS is linear and ++ * at index 1. A 64B CCS cache line corresponds to an area of 4x1 tiles in ++ * main surface. In other words, 4 bits in CCS map to a main surface cache ++ * line pair. The main surface pitch is required to be a multiple of four ++ * Y-tile widths. For semi-planar formats like NV12, CCS planes follow the ++ * Y and UV planes i.e., planes 0 and 1 are used for Y and UV surfaces, ++ * planes 2 and 3 for the respective CCS. ++ */ ++#define I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS fourcc_mod_code(INTEL, 7) ++ ++/* ++ * Intel Color Control Surface with Clear Color (CCS) for Gen-12 render ++ * compression. ++ * ++ * The main surface is Y-tiled and is at plane index 0 whereas CCS is linear ++ * and at index 1. The clear color is stored at index 2, and the pitch should ++ * be ignored. The clear color structure is 256 bits. The first 128 bits ++ * represents Raw Clear Color Red, Green, Blue and Alpha color each represented ++ * by 32 bits. The raw clear color is consumed by the 3d engine and generates ++ * the converted clear color of size 64 bits. The first 32 bits store the Lower ++ * Converted Clear Color value and the next 32 bits store the Higher Converted ++ * Clear Color value when applicable. The Converted Clear Color values are ++ * consumed by the DE. The last 64 bits are used to store Color Discard Enable ++ * and Depth Clear Value Valid which are ignored by the DE. A CCS cache line ++ * corresponds to an area of 4x1 tiles in the main surface. The main surface ++ * pitch is required to be a multiple of 4 tile widths. ++ */ ++#define I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC fourcc_mod_code(INTEL, 8) ++ ++/* ++ * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks ++ * ++ * Macroblocks are laid in a Z-shape, and each pixel data is following the ++ * standard NV12 style. ++ * As for NV12, an image is the result of two frame buffers: one for Y, ++ * one for the interleaved Cb/Cr components (1/2 the height of the Y buffer). ++ * Alignment requirements are (for each buffer): ++ * - multiple of 128 pixels for the width ++ * - multiple of 32 pixels for the height ++ * ++ * For more information: see https://linuxtv.org/downloads/v4l-dvb-apis/re32.html ++ */ ++#define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1) ++ ++/* ++ * Tiled, 16 (pixels) x 16 (lines) - sized macroblocks ++ * ++ * This is a simple tiled layout using tiles of 16x16 pixels in a row-major ++ * layout. For YCbCr formats Cb/Cr components are taken in such a way that ++ * they correspond to their 16x16 luma block. ++ */ ++#define DRM_FORMAT_MOD_SAMSUNG_16_16_TILE fourcc_mod_code(SAMSUNG, 2) ++ ++/* ++ * Qualcomm Compressed Format ++ * ++ * Refers to a compressed variant of the base format that is compressed. ++ * Implementation may be platform and base-format specific. ++ * ++ * Each macrotile consists of m x n (mostly 4 x 4) tiles. ++ * Pixel data pitch/stride is aligned with macrotile width. ++ * Pixel data height is aligned with macrotile height. ++ * Entire pixel data buffer is aligned with 4k(bytes). ++ */ ++#define DRM_FORMAT_MOD_QCOM_COMPRESSED fourcc_mod_code(QCOM, 1) ++ ++/* Vivante framebuffer modifiers */ ++ ++/* ++ * Vivante 4x4 tiling layout ++ * ++ * This is a simple tiled layout using tiles of 4x4 pixels in a row-major ++ * layout. ++ */ ++#define DRM_FORMAT_MOD_VIVANTE_TILED fourcc_mod_code(VIVANTE, 1) ++ ++/* ++ * Vivante 64x64 super-tiling layout ++ * ++ * This is a tiled layout using 64x64 pixel super-tiles, where each super-tile ++ * contains 8x4 groups of 2x4 tiles of 4x4 pixels (like above) each, all in row- ++ * major layout. ++ * ++ * For more information: see ++ * https://github.com/etnaviv/etna_viv/blob/master/doc/hardware.md#texture-tiling ++ */ ++#define DRM_FORMAT_MOD_VIVANTE_SUPER_TILED fourcc_mod_code(VIVANTE, 2) ++ ++/* ++ * Vivante 4x4 tiling layout for dual-pipe ++ * ++ * Same as the 4x4 tiling layout, except every second 4x4 pixel tile starts at a ++ * different base address. Offsets from the base addresses are therefore halved ++ * compared to the non-split tiled layout. ++ */ ++#define DRM_FORMAT_MOD_VIVANTE_SPLIT_TILED fourcc_mod_code(VIVANTE, 3) ++ ++/* ++ * Vivante 64x64 super-tiling layout for dual-pipe ++ * ++ * Same as the 64x64 super-tiling layout, except every second 4x4 pixel tile ++ * starts at a different base address. Offsets from the base addresses are ++ * therefore halved compared to the non-split super-tiled layout. ++ */ ++#define DRM_FORMAT_MOD_VIVANTE_SPLIT_SUPER_TILED fourcc_mod_code(VIVANTE, 4) ++ ++/* NVIDIA frame buffer modifiers */ ++ ++/* ++ * Tegra Tiled Layout, used by Tegra 2, 3 and 4. ++ * ++ * Pixels are arranged in simple tiles of 16 x 16 bytes. ++ */ ++#define DRM_FORMAT_MOD_NVIDIA_TEGRA_TILED fourcc_mod_code(NVIDIA, 1) ++ ++/* ++ * Generalized Block Linear layout, used by desktop GPUs starting with NV50/G80, ++ * and Tegra GPUs starting with Tegra K1. ++ * ++ * Pixels are arranged in Groups of Bytes (GOBs). GOB size and layout varies ++ * based on the architecture generation. GOBs themselves are then arranged in ++ * 3D blocks, with the block dimensions (in terms of GOBs) always being a power ++ * of two, and hence expressible as their log2 equivalent (E.g., "2" represents ++ * a block depth or height of "4"). ++ * ++ * Chapter 20 "Pixel Memory Formats" of the Tegra X1 TRM describes this format ++ * in full detail. ++ * ++ * Macro ++ * Bits Param Description ++ * ---- ----- ----------------------------------------------------------------- ++ * ++ * 3:0 h log2(height) of each block, in GOBs. Placed here for ++ * compatibility with the existing ++ * DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK()-based modifiers. ++ * ++ * 4:4 - Must be 1, to indicate block-linear layout. Necessary for ++ * compatibility with the existing ++ * DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK()-based modifiers. ++ * ++ * 8:5 - Reserved (To support 3D-surfaces with variable log2(depth) block ++ * size). Must be zero. ++ * ++ * Note there is no log2(width) parameter. Some portions of the ++ * hardware support a block width of two gobs, but it is impractical ++ * to use due to lack of support elsewhere, and has no known ++ * benefits. ++ * ++ * 11:9 - Reserved (To support 2D-array textures with variable array stride ++ * in blocks, specified via log2(tile width in blocks)). Must be ++ * zero. ++ * ++ * 19:12 k Page Kind. This value directly maps to a field in the page ++ * tables of all GPUs >= NV50. It affects the exact layout of bits ++ * in memory and can be derived from the tuple ++ * ++ * (format, GPU model, compression type, samples per pixel) ++ * ++ * Where compression type is defined below. If GPU model were ++ * implied by the format modifier, format, or memory buffer, page ++ * kind would not need to be included in the modifier itself, but ++ * since the modifier should define the layout of the associated ++ * memory buffer independent from any device or other context, it ++ * must be included here. ++ * ++ * 21:20 g GOB Height and Page Kind Generation. The height of a GOB changed ++ * starting with Fermi GPUs. Additionally, the mapping between page ++ * kind and bit layout has changed at various points. ++ * ++ * 0 = Gob Height 8, Fermi - Volta, Tegra K1+ Page Kind mapping ++ * 1 = Gob Height 4, G80 - GT2XX Page Kind mapping ++ * 2 = Gob Height 8, Turing+ Page Kind mapping ++ * 3 = Reserved for future use. ++ * ++ * 22:22 s Sector layout. On Tegra GPUs prior to Xavier, there is a further ++ * bit remapping step that occurs at an even lower level than the ++ * page kind and block linear swizzles. This causes the layout of ++ * surfaces mapped in those SOC's GPUs to be incompatible with the ++ * equivalent mapping on other GPUs in the same system. ++ * ++ * 0 = Tegra K1 - Tegra Parker/TX2 Layout. ++ * 1 = Desktop GPU and Tegra Xavier+ Layout ++ * ++ * 25:23 c Lossless Framebuffer Compression type. ++ * ++ * 0 = none ++ * 1 = ROP/3D, layout 1, exact compression format implied by Page ++ * Kind field ++ * 2 = ROP/3D, layout 2, exact compression format implied by Page ++ * Kind field ++ * 3 = CDE horizontal ++ * 4 = CDE vertical ++ * 5 = Reserved for future use ++ * 6 = Reserved for future use ++ * 7 = Reserved for future use ++ * ++ * 55:25 - Reserved for future use. Must be zero. ++ */ ++#define DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(c, s, g, k, h) \ ++ fourcc_mod_code(NVIDIA, (0x10 | \ ++ ((h) & 0xf) | \ ++ (((k) & 0xff) << 12) | \ ++ (((g) & 0x3) << 20) | \ ++ (((s) & 0x1) << 22) | \ ++ (((c) & 0x7) << 23))) ++ ++/* To grandfather in prior block linear format modifiers to the above layout, ++ * the page kind "0", which corresponds to "pitch/linear" and hence is unusable ++ * with block-linear layouts, is remapped within drivers to the value 0xfe, ++ * which corresponds to the "generic" kind used for simple single-sample ++ * uncompressed color formats on Fermi - Volta GPUs. ++ */ ++static __inline__ __u64 ++drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier) ++{ ++ if (!(modifier & 0x10) || (modifier & (0xff << 12))) ++ return modifier; ++ else ++ return modifier | (0xfe << 12); ++} ++ ++/* ++ * 16Bx2 Block Linear layout, used by Tegra K1 and later ++ * ++ * Pixels are arranged in 64x8 Groups Of Bytes (GOBs). GOBs are then stacked ++ * vertically by a power of 2 (1 to 32 GOBs) to form a block. ++ * ++ * Within a GOB, data is ordered as 16B x 2 lines sectors laid in Z-shape. ++ * ++ * Parameter 'v' is the log2 encoding of the number of GOBs stacked vertically. ++ * Valid values are: ++ * ++ * 0 == ONE_GOB ++ * 1 == TWO_GOBS ++ * 2 == FOUR_GOBS ++ * 3 == EIGHT_GOBS ++ * 4 == SIXTEEN_GOBS ++ * 5 == THIRTYTWO_GOBS ++ * ++ * Chapter 20 "Pixel Memory Formats" of the Tegra X1 TRM describes this format ++ * in full detail. ++ */ ++#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(v) \ ++ DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 0, 0, 0, (v)) ++ ++#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_ONE_GOB \ ++ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(0) ++#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_TWO_GOB \ ++ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(1) ++#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_FOUR_GOB \ ++ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(2) ++#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_EIGHT_GOB \ ++ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(3) ++#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_SIXTEEN_GOB \ ++ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(4) ++#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_THIRTYTWO_GOB \ ++ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(5) ++ ++/* ++ * Some Broadcom modifiers take parameters, for example the number of ++ * vertical lines in the image. Reserve the lower 32 bits for modifier ++ * type, and the next 24 bits for parameters. Top 8 bits are the ++ * vendor code. ++ */ ++#define __fourcc_mod_broadcom_param_shift 8 ++#define __fourcc_mod_broadcom_param_bits 48 ++#define fourcc_mod_broadcom_code(val, params) \ ++ fourcc_mod_code(BROADCOM, ((((__u64)params) << __fourcc_mod_broadcom_param_shift) | val)) ++#define fourcc_mod_broadcom_param(m) \ ++ ((int)(((m) >> __fourcc_mod_broadcom_param_shift) & \ ++ ((1ULL << __fourcc_mod_broadcom_param_bits) - 1))) ++#define fourcc_mod_broadcom_mod(m) \ ++ ((m) & ~(((1ULL << __fourcc_mod_broadcom_param_bits) - 1) << \ ++ __fourcc_mod_broadcom_param_shift)) ++ ++/* ++ * Broadcom VC4 "T" format ++ * ++ * This is the primary layout that the V3D GPU can texture from (it ++ * can't do linear). The T format has: ++ * ++ * - 64b utiles of pixels in a raster-order grid according to cpp. It's 4x4 ++ * pixels at 32 bit depth. ++ * ++ * - 1k subtiles made of a 4x4 raster-order grid of 64b utiles (so usually ++ * 16x16 pixels). ++ * ++ * - 4k tiles made of a 2x2 grid of 1k subtiles (so usually 32x32 pixels). On ++ * even 4k tile rows, they're arranged as (BL, TL, TR, BR), and on odd rows ++ * they're (TR, BR, BL, TL), where bottom left is start of memory. ++ * ++ * - an image made of 4k tiles in rows either left-to-right (even rows of 4k ++ * tiles) or right-to-left (odd rows of 4k tiles). ++ */ ++#define DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED fourcc_mod_code(BROADCOM, 1) ++ ++/* ++ * Broadcom SAND format ++ * ++ * This is the native format that the H.264 codec block uses. For VC4 ++ * HVS, it is only valid for H.264 (NV12/21) and RGBA modes. ++ * ++ * The image can be considered to be split into columns, and the ++ * columns are placed consecutively into memory. The width of those ++ * columns can be either 32, 64, 128, or 256 pixels, but in practice ++ * only 128 pixel columns are used. ++ * ++ * The pitch between the start of each column is set to optimally ++ * switch between SDRAM banks. This is passed as the number of lines ++ * of column width in the modifier (we can't use the stride value due ++ * to various core checks that look at it , so you should set the ++ * stride to width*cpp). ++ * ++ * Note that the column height for this format modifier is the same ++ * for all of the planes, assuming that each column contains both Y ++ * and UV. Some SAND-using hardware stores UV in a separate tiled ++ * image from Y to reduce the column height, which is not supported ++ * with these modifiers. ++ */ ++ ++#define DRM_FORMAT_MOD_BROADCOM_SAND32_COL_HEIGHT(v) \ ++ fourcc_mod_broadcom_code(2, v) ++#define DRM_FORMAT_MOD_BROADCOM_SAND64_COL_HEIGHT(v) \ ++ fourcc_mod_broadcom_code(3, v) ++#define DRM_FORMAT_MOD_BROADCOM_SAND128_COL_HEIGHT(v) \ ++ fourcc_mod_broadcom_code(4, v) ++#define DRM_FORMAT_MOD_BROADCOM_SAND256_COL_HEIGHT(v) \ ++ fourcc_mod_broadcom_code(5, v) ++ ++#define DRM_FORMAT_MOD_BROADCOM_SAND32 \ ++ DRM_FORMAT_MOD_BROADCOM_SAND32_COL_HEIGHT(0) ++#define DRM_FORMAT_MOD_BROADCOM_SAND64 \ ++ DRM_FORMAT_MOD_BROADCOM_SAND64_COL_HEIGHT(0) ++#define DRM_FORMAT_MOD_BROADCOM_SAND128 \ ++ DRM_FORMAT_MOD_BROADCOM_SAND128_COL_HEIGHT(0) ++#define DRM_FORMAT_MOD_BROADCOM_SAND256 \ ++ DRM_FORMAT_MOD_BROADCOM_SAND256_COL_HEIGHT(0) ++ ++/* Broadcom UIF format ++ * ++ * This is the common format for the current Broadcom multimedia ++ * blocks, including V3D 3.x and newer, newer video codecs, and ++ * displays. ++ * ++ * The image consists of utiles (64b blocks), UIF blocks (2x2 utiles), ++ * and macroblocks (4x4 UIF blocks). Those 4x4 UIF block groups are ++ * stored in columns, with padding between the columns to ensure that ++ * moving from one column to the next doesn't hit the same SDRAM page ++ * bank. ++ * ++ * To calculate the padding, it is assumed that each hardware block ++ * and the software driving it knows the platform's SDRAM page size, ++ * number of banks, and XOR address, and that it's identical between ++ * all blocks using the format. This tiling modifier will use XOR as ++ * necessary to reduce the padding. If a hardware block can't do XOR, ++ * the assumption is that a no-XOR tiling modifier will be created. ++ */ ++#define DRM_FORMAT_MOD_BROADCOM_UIF fourcc_mod_code(BROADCOM, 6) ++ ++/* ++ * Arm Framebuffer Compression (AFBC) modifiers ++ * ++ * AFBC is a proprietary lossless image compression protocol and format. ++ * It provides fine-grained random access and minimizes the amount of data ++ * transferred between IP blocks. ++ * ++ * AFBC has several features which may be supported and/or used, which are ++ * represented using bits in the modifier. Not all combinations are valid, ++ * and different devices or use-cases may support different combinations. ++ * ++ * Further information on the use of AFBC modifiers can be found in ++ * Documentation/gpu/afbc.rst ++ */ ++ ++/* ++ * The top 4 bits (out of the 56 bits alloted for specifying vendor specific ++ * modifiers) denote the category for modifiers. Currently we have three ++ * categories of modifiers ie AFBC, MISC and AFRC. We can have a maximum of ++ * sixteen different categories. ++ */ ++#define DRM_FORMAT_MOD_ARM_CODE(__type, __val) \ ++ fourcc_mod_code(ARM, ((__u64)(__type) << 52) | ((__val) & 0x000fffffffffffffULL)) ++ ++#define DRM_FORMAT_MOD_ARM_TYPE_AFBC 0x00 ++#define DRM_FORMAT_MOD_ARM_TYPE_MISC 0x01 ++ ++#define DRM_FORMAT_MOD_ARM_AFBC(__afbc_mode) \ ++ DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_AFBC, __afbc_mode) ++ ++/* ++ * AFBC superblock size ++ * ++ * Indicates the superblock size(s) used for the AFBC buffer. The buffer ++ * size (in pixels) must be aligned to a multiple of the superblock size. ++ * Four lowest significant bits(LSBs) are reserved for block size. ++ * ++ * Where one superblock size is specified, it applies to all planes of the ++ * buffer (e.g. 16x16, 32x8). When multiple superblock sizes are specified, ++ * the first applies to the Luma plane and the second applies to the Chroma ++ * plane(s). e.g. (32x8_64x4 means 32x8 Luma, with 64x4 Chroma). ++ * Multiple superblock sizes are only valid for multi-plane YCbCr formats. ++ */ ++#define AFBC_FORMAT_MOD_BLOCK_SIZE_MASK 0xf ++#define AFBC_FORMAT_MOD_BLOCK_SIZE_16x16 (1ULL) ++#define AFBC_FORMAT_MOD_BLOCK_SIZE_32x8 (2ULL) ++#define AFBC_FORMAT_MOD_BLOCK_SIZE_64x4 (3ULL) ++#define AFBC_FORMAT_MOD_BLOCK_SIZE_32x8_64x4 (4ULL) ++ ++/* ++ * AFBC lossless colorspace transform ++ * ++ * Indicates that the buffer makes use of the AFBC lossless colorspace ++ * transform. ++ */ ++#define AFBC_FORMAT_MOD_YTR (1ULL << 4) ++ ++/* ++ * AFBC block-split ++ * ++ * Indicates that the payload of each superblock is split. The second ++ * half of the payload is positioned at a predefined offset from the start ++ * of the superblock payload. ++ */ ++#define AFBC_FORMAT_MOD_SPLIT (1ULL << 5) ++ ++/* ++ * AFBC sparse layout ++ * ++ * This flag indicates that the payload of each superblock must be stored at a ++ * predefined position relative to the other superblocks in the same AFBC ++ * buffer. This order is the same order used by the header buffer. In this mode ++ * each superblock is given the same amount of space as an uncompressed ++ * superblock of the particular format would require, rounding up to the next ++ * multiple of 128 bytes in size. ++ */ ++#define AFBC_FORMAT_MOD_SPARSE (1ULL << 6) ++ ++/* ++ * AFBC copy-block restrict ++ * ++ * Buffers with this flag must obey the copy-block restriction. The restriction ++ * is such that there are no copy-blocks referring across the border of 8x8 ++ * blocks. For the subsampled data the 8x8 limitation is also subsampled. ++ */ ++#define AFBC_FORMAT_MOD_CBR (1ULL << 7) ++ ++/* ++ * AFBC tiled layout ++ * ++ * The tiled layout groups superblocks in 8x8 or 4x4 tiles, where all ++ * superblocks inside a tile are stored together in memory. 8x8 tiles are used ++ * for pixel formats up to and including 32 bpp while 4x4 tiles are used for ++ * larger bpp formats. The order between the tiles is scan line. ++ * When the tiled layout is used, the buffer size (in pixels) must be aligned ++ * to the tile size. ++ */ ++#define AFBC_FORMAT_MOD_TILED (1ULL << 8) ++ ++/* ++ * AFBC solid color blocks ++ * ++ * Indicates that the buffer makes use of solid-color blocks, whereby bandwidth ++ * can be reduced if a whole superblock is a single color. ++ */ ++#define AFBC_FORMAT_MOD_SC (1ULL << 9) ++ ++/* ++ * AFBC double-buffer ++ * ++ * Indicates that the buffer is allocated in a layout safe for front-buffer ++ * rendering. ++ */ ++#define AFBC_FORMAT_MOD_DB (1ULL << 10) ++ ++/* ++ * AFBC buffer content hints ++ * ++ * Indicates that the buffer includes per-superblock content hints. ++ */ ++#define AFBC_FORMAT_MOD_BCH (1ULL << 11) ++ ++/* AFBC uncompressed storage mode ++ * ++ * Indicates that the buffer is using AFBC uncompressed storage mode. ++ * In this mode all superblock payloads in the buffer use the uncompressed ++ * storage mode, which is usually only used for data which cannot be compressed. ++ * The buffer layout is the same as for AFBC buffers without USM set, this only ++ * affects the storage mode of the individual superblocks. Note that even a ++ * buffer without USM set may use uncompressed storage mode for some or all ++ * superblocks, USM just guarantees it for all. ++ */ ++#define AFBC_FORMAT_MOD_USM (1ULL << 12) ++ ++/* ++ * Arm Fixed-Rate Compression (AFRC) modifiers ++ * ++ * AFRC is a proprietary fixed rate image compression protocol and format, ++ * designed to provide guaranteed bandwidth and memory footprint ++ * reductions in graphics and media use-cases. ++ * ++ * AFRC buffers consist of one or more planes, with the same components ++ * and meaning as an uncompressed buffer using the same pixel format. ++ * ++ * Within each plane, the pixel/luma/chroma values are grouped into ++ * "coding unit" blocks which are individually compressed to a ++ * fixed size (in bytes). All coding units within a given plane of a buffer ++ * store the same number of values, and have the same compressed size. ++ * ++ * The coding unit size is configurable, allowing different rates of compression. ++ * ++ * The start of each AFRC buffer plane must be aligned to an alignment granule which ++ * depends on the coding unit size. ++ * ++ * Coding Unit Size Plane Alignment ++ * ---------------- --------------- ++ * 16 bytes 1024 bytes ++ * 24 bytes 512 bytes ++ * 32 bytes 2048 bytes ++ * ++ * Coding units are grouped into paging tiles. AFRC buffer dimensions must be aligned ++ * to a multiple of the paging tile dimensions. ++ * The dimensions of each paging tile depend on whether the buffer is optimised for ++ * scanline (SCAN layout) or rotated (ROT layout) access. ++ * ++ * Layout Paging Tile Width Paging Tile Height ++ * ------ ----------------- ------------------ ++ * SCAN 16 coding units 4 coding units ++ * ROT 8 coding units 8 coding units ++ * ++ * The dimensions of each coding unit depend on the number of components ++ * in the compressed plane and whether the buffer is optimised for ++ * scanline (SCAN layout) or rotated (ROT layout) access. ++ * ++ * Number of Components in Plane Layout Coding Unit Width Coding Unit Height ++ * ----------------------------- --------- ----------------- ------------------ ++ * 1 SCAN 16 samples 4 samples ++ * Example: 16x4 luma samples in a 'Y' plane ++ * 16x4 chroma 'V' values, in the 'V' plane of a fully-planar YUV buffer ++ * ----------------------------- --------- ----------------- ------------------ ++ * 1 ROT 8 samples 8 samples ++ * Example: 8x8 luma samples in a 'Y' plane ++ * 8x8 chroma 'V' values, in the 'V' plane of a fully-planar YUV buffer ++ * ----------------------------- --------- ----------------- ------------------ ++ * 2 DONT CARE 8 samples 4 samples ++ * Example: 8x4 chroma pairs in the 'UV' plane of a semi-planar YUV buffer ++ * ----------------------------- --------- ----------------- ------------------ ++ * 3 DONT CARE 4 samples 4 samples ++ * Example: 4x4 pixels in an RGB buffer without alpha ++ * ----------------------------- --------- ----------------- ------------------ ++ * 4 DONT CARE 4 samples 4 samples ++ * Example: 4x4 pixels in an RGB buffer with alpha ++ */ ++ ++#define DRM_FORMAT_MOD_ARM_TYPE_AFRC 0x02 ++ ++#define DRM_FORMAT_MOD_ARM_AFRC(__afrc_mode) \ ++ DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_AFRC, __afrc_mode) ++ ++/* ++ * AFRC coding unit size modifier. ++ * ++ * Indicates the number of bytes used to store each compressed coding unit for ++ * one or more planes in an AFRC encoded buffer. The coding unit size for chrominance ++ * is the same for both Cb and Cr, which may be stored in separate planes. ++ * ++ * AFRC_FORMAT_MOD_CU_SIZE_P0 indicates the number of bytes used to store ++ * each compressed coding unit in the first plane of the buffer. For RGBA buffers ++ * this is the only plane, while for semi-planar and fully-planar YUV buffers, ++ * this corresponds to the luma plane. ++ * ++ * AFRC_FORMAT_MOD_CU_SIZE_P12 indicates the number of bytes used to store ++ * each compressed coding unit in the second and third planes in the buffer. ++ * For semi-planar and fully-planar YUV buffers, this corresponds to the chroma plane(s). ++ * ++ * For single-plane buffers, AFRC_FORMAT_MOD_CU_SIZE_P0 must be specified ++ * and AFRC_FORMAT_MOD_CU_SIZE_P12 must be zero. ++ * For semi-planar and fully-planar buffers, both AFRC_FORMAT_MOD_CU_SIZE_P0 and ++ * AFRC_FORMAT_MOD_CU_SIZE_P12 must be specified. ++ */ ++#define AFRC_FORMAT_MOD_CU_SIZE_MASK 0xf ++#define AFRC_FORMAT_MOD_CU_SIZE_16 (1ULL) ++#define AFRC_FORMAT_MOD_CU_SIZE_24 (2ULL) ++#define AFRC_FORMAT_MOD_CU_SIZE_32 (3ULL) ++ ++#define AFRC_FORMAT_MOD_CU_SIZE_P0(__afrc_cu_size) (__afrc_cu_size) ++#define AFRC_FORMAT_MOD_CU_SIZE_P12(__afrc_cu_size) ((__afrc_cu_size) << 4) ++ ++/* ++ * AFRC scanline memory layout. ++ * ++ * Indicates if the buffer uses the scanline-optimised layout ++ * for an AFRC encoded buffer, otherwise, it uses the rotation-optimised layout. ++ * The memory layout is the same for all planes. ++ */ ++#define AFRC_FORMAT_MOD_LAYOUT_SCAN (1ULL << 8) ++ ++/* ++ * Arm 16x16 Block U-Interleaved modifier ++ * ++ * This is used by Arm Mali Utgard and Midgard GPUs. It divides the image ++ * into 16x16 pixel blocks. Blocks are stored linearly in order, but pixels ++ * in the block are reordered. ++ */ ++#define DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED \ ++ DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_MISC, 1ULL) ++ ++/* ++ * Allwinner tiled modifier ++ * ++ * This tiling mode is implemented by the VPU found on all Allwinner platforms, ++ * codenamed sunxi. It is associated with a YUV format that uses either 2 or 3 ++ * planes. ++ * ++ * With this tiling, the luminance samples are disposed in tiles representing ++ * 32x32 pixels and the chrominance samples in tiles representing 32x64 pixels. ++ * The pixel order in each tile is linear and the tiles are disposed linearly, ++ * both in row-major order. ++ */ ++#define DRM_FORMAT_MOD_ALLWINNER_TILED fourcc_mod_code(ALLWINNER, 1) ++ ++/* ++ * Amlogic Video Framebuffer Compression modifiers ++ * ++ * Amlogic uses a proprietary lossless image compression protocol and format ++ * for their hardware video codec accelerators, either video decoders or ++ * video input encoders. ++ * ++ * It considerably reduces memory bandwidth while writing and reading ++ * frames in memory. ++ * ++ * The underlying storage is considered to be 3 components, 8bit or 10-bit ++ * per component YCbCr 420, single plane : ++ * - DRM_FORMAT_YUV420_8BIT ++ * - DRM_FORMAT_YUV420_10BIT ++ * ++ * The first 8 bits of the mode defines the layout, then the following 8 bits ++ * defines the options changing the layout. ++ * ++ * Not all combinations are valid, and different SoCs may support different ++ * combinations of layout and options. ++ */ ++#define __fourcc_mod_amlogic_layout_mask 0xff ++#define __fourcc_mod_amlogic_options_shift 8 ++#define __fourcc_mod_amlogic_options_mask 0xff ++ ++#define DRM_FORMAT_MOD_AMLOGIC_FBC(__layout, __options) \ ++ fourcc_mod_code(AMLOGIC, \ ++ ((__layout) & __fourcc_mod_amlogic_layout_mask) | \ ++ (((__options) & __fourcc_mod_amlogic_options_mask) \ ++ << __fourcc_mod_amlogic_options_shift)) ++ ++/* Amlogic FBC Layouts */ ++ ++/* ++ * Amlogic FBC Basic Layout ++ * ++ * The basic layout is composed of: ++ * - a body content organized in 64x32 superblocks with 4096 bytes per ++ * superblock in default mode. ++ * - a 32 bytes per 128x64 header block ++ * ++ * This layout is transferrable between Amlogic SoCs supporting this modifier. ++ */ ++#define AMLOGIC_FBC_LAYOUT_BASIC (1ULL) ++ ++/* ++ * Amlogic FBC Scatter Memory layout ++ * ++ * Indicates the header contains IOMMU references to the compressed ++ * frames content to optimize memory access and layout. ++ * ++ * In this mode, only the header memory address is needed, thus the ++ * content memory organization is tied to the current producer ++ * execution and cannot be saved/dumped neither transferrable between ++ * Amlogic SoCs supporting this modifier. ++ * ++ * Due to the nature of the layout, these buffers are not expected to ++ * be accessible by the user-space clients, but only accessible by the ++ * hardware producers and consumers. ++ * ++ * The user-space clients should expect a failure while trying to mmap ++ * the DMA-BUF handle returned by the producer. ++ */ ++#define AMLOGIC_FBC_LAYOUT_SCATTER (2ULL) ++ ++/* Amlogic FBC Layout Options Bit Mask */ ++ ++/* ++ * Amlogic FBC Memory Saving mode ++ * ++ * Indicates the storage is packed when pixel size is multiple of word ++ * boudaries, i.e. 8bit should be stored in this mode to save allocation ++ * memory. ++ * ++ * This mode reduces body layout to 3072 bytes per 64x32 superblock with ++ * the basic layout and 3200 bytes per 64x32 superblock combined with ++ * the scatter layout. ++ */ ++#define AMLOGIC_FBC_OPTION_MEM_SAVING (1ULL << 0) ++ ++/* ++ * AMD modifiers ++ * ++ * Memory layout: ++ * ++ * without DCC: ++ * - main surface ++ * ++ * with DCC & without DCC_RETILE: ++ * - main surface in plane 0 ++ * - DCC surface in plane 1 (RB-aligned, pipe-aligned if DCC_PIPE_ALIGN is set) ++ * ++ * with DCC & DCC_RETILE: ++ * - main surface in plane 0 ++ * - displayable DCC surface in plane 1 (not RB-aligned & not pipe-aligned) ++ * - pipe-aligned DCC surface in plane 2 (RB-aligned & pipe-aligned) ++ * ++ * For multi-plane formats the above surfaces get merged into one plane for ++ * each format plane, based on the required alignment only. ++ * ++ * Bits Parameter Notes ++ * ----- ------------------------ --------------------------------------------- ++ * ++ * 7:0 TILE_VERSION Values are AMD_FMT_MOD_TILE_VER_* ++ * 12:8 TILE Values are AMD_FMT_MOD_TILE__* ++ * 13 DCC ++ * 14 DCC_RETILE ++ * 15 DCC_PIPE_ALIGN ++ * 16 DCC_INDEPENDENT_64B ++ * 17 DCC_INDEPENDENT_128B ++ * 19:18 DCC_MAX_COMPRESSED_BLOCK Values are AMD_FMT_MOD_DCC_BLOCK_* ++ * 20 DCC_CONSTANT_ENCODE ++ * 23:21 PIPE_XOR_BITS Only for some chips ++ * 26:24 BANK_XOR_BITS Only for some chips ++ * 29:27 PACKERS Only for some chips ++ * 32:30 RB Only for some chips ++ * 35:33 PIPE Only for some chips ++ * 55:36 - Reserved for future use, must be zero ++ */ ++#define AMD_FMT_MOD fourcc_mod_code(AMD, 0) ++ ++#define IS_AMD_FMT_MOD(val) (((val) >> 56) == DRM_FORMAT_MOD_VENDOR_AMD) ++ ++/* Reserve 0 for GFX8 and older */ ++#define AMD_FMT_MOD_TILE_VER_GFX9 1 ++#define AMD_FMT_MOD_TILE_VER_GFX10 2 ++#define AMD_FMT_MOD_TILE_VER_GFX10_RBPLUS 3 ++ ++/* ++ * 64K_S is the same for GFX9/GFX10/GFX10_RBPLUS and hence has GFX9 as canonical ++ * version. ++ */ ++#define AMD_FMT_MOD_TILE_GFX9_64K_S 9 ++ ++/* ++ * 64K_D for non-32 bpp is the same for GFX9/GFX10/GFX10_RBPLUS and hence has ++ * GFX9 as canonical version. ++ */ ++#define AMD_FMT_MOD_TILE_GFX9_64K_D 10 ++#define AMD_FMT_MOD_TILE_GFX9_64K_S_X 25 ++#define AMD_FMT_MOD_TILE_GFX9_64K_D_X 26 ++#define AMD_FMT_MOD_TILE_GFX9_64K_R_X 27 ++ ++#define AMD_FMT_MOD_DCC_BLOCK_64B 0 ++#define AMD_FMT_MOD_DCC_BLOCK_128B 1 ++#define AMD_FMT_MOD_DCC_BLOCK_256B 2 ++ ++#define AMD_FMT_MOD_TILE_VERSION_SHIFT 0 ++#define AMD_FMT_MOD_TILE_VERSION_MASK 0xFF ++#define AMD_FMT_MOD_TILE_SHIFT 8 ++#define AMD_FMT_MOD_TILE_MASK 0x1F ++ ++/* Whether DCC compression is enabled. */ ++#define AMD_FMT_MOD_DCC_SHIFT 13 ++#define AMD_FMT_MOD_DCC_MASK 0x1 ++ ++/* ++ * Whether to include two DCC surfaces, one which is rb & pipe aligned, and ++ * one which is not-aligned. ++ */ ++#define AMD_FMT_MOD_DCC_RETILE_SHIFT 14 ++#define AMD_FMT_MOD_DCC_RETILE_MASK 0x1 ++ ++/* Only set if DCC_RETILE = false */ ++#define AMD_FMT_MOD_DCC_PIPE_ALIGN_SHIFT 15 ++#define AMD_FMT_MOD_DCC_PIPE_ALIGN_MASK 0x1 ++ ++#define AMD_FMT_MOD_DCC_INDEPENDENT_64B_SHIFT 16 ++#define AMD_FMT_MOD_DCC_INDEPENDENT_64B_MASK 0x1 ++#define AMD_FMT_MOD_DCC_INDEPENDENT_128B_SHIFT 17 ++#define AMD_FMT_MOD_DCC_INDEPENDENT_128B_MASK 0x1 ++#define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_SHIFT 18 ++#define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_MASK 0x3 ++ ++/* ++ * DCC supports embedding some clear colors directly in the DCC surface. ++ * However, on older GPUs the rendering HW ignores the embedded clear color ++ * and prefers the driver provided color. This necessitates doing a fastclear ++ * eliminate operation before a process transfers control. ++ * ++ * If this bit is set that means the fastclear eliminate is not needed for these ++ * embeddable colors. ++ */ ++#define AMD_FMT_MOD_DCC_CONSTANT_ENCODE_SHIFT 20 ++#define AMD_FMT_MOD_DCC_CONSTANT_ENCODE_MASK 0x1 ++ ++/* ++ * The below fields are for accounting for per GPU differences. These are only ++ * relevant for GFX9 and later and if the tile field is *_X/_T. ++ * ++ * PIPE_XOR_BITS = always needed ++ * BANK_XOR_BITS = only for TILE_VER_GFX9 ++ * PACKERS = only for TILE_VER_GFX10_RBPLUS ++ * RB = only for TILE_VER_GFX9 & DCC ++ * PIPE = only for TILE_VER_GFX9 & DCC & (DCC_RETILE | DCC_PIPE_ALIGN) ++ */ ++#define AMD_FMT_MOD_PIPE_XOR_BITS_SHIFT 21 ++#define AMD_FMT_MOD_PIPE_XOR_BITS_MASK 0x7 ++#define AMD_FMT_MOD_BANK_XOR_BITS_SHIFT 24 ++#define AMD_FMT_MOD_BANK_XOR_BITS_MASK 0x7 ++#define AMD_FMT_MOD_PACKERS_SHIFT 27 ++#define AMD_FMT_MOD_PACKERS_MASK 0x7 ++#define AMD_FMT_MOD_RB_SHIFT 30 ++#define AMD_FMT_MOD_RB_MASK 0x7 ++#define AMD_FMT_MOD_PIPE_SHIFT 33 ++#define AMD_FMT_MOD_PIPE_MASK 0x7 ++ ++#define AMD_FMT_MOD_SET(field, value) \ ++ ((uint64_t)(value) << AMD_FMT_MOD_##field##_SHIFT) ++#define AMD_FMT_MOD_GET(field, value) \ ++ (((value) >> AMD_FMT_MOD_##field##_SHIFT) & AMD_FMT_MOD_##field##_MASK) ++#define AMD_FMT_MOD_CLEAR(field) \ ++ (~((uint64_t)AMD_FMT_MOD_##field##_MASK << AMD_FMT_MOD_##field##_SHIFT)) ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif /* DRM_FOURCC_H */ +diff --git a/third_party/drm/drm/drm_mode.h b/third_party/drm/drm/drm_mode.h +new file mode 100644 +index 0000000..e1e3516 +--- /dev/null ++++ b/third_party/drm/drm/drm_mode.h +@@ -0,0 +1,1217 @@ ++/* ++ * Copyright (c) 2007 Dave Airlie ++ * Copyright (c) 2007 Jakob Bornecrantz ++ * Copyright (c) 2008 Red Hat Inc. ++ * Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA ++ * Copyright (c) 2007-2008 Intel Corporation ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included in ++ * all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS ++ * IN THE SOFTWARE. ++ */ ++ ++#ifndef _DRM_MODE_H ++#define _DRM_MODE_H ++ ++#include "drm.h" ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++/** ++ * DOC: overview ++ * ++ * DRM exposes many UAPI and structure definition to have a consistent ++ * and standardized interface with user. ++ * Userspace can refer to these structure definitions and UAPI formats ++ * to communicate to driver ++ */ ++ ++#define DRM_CONNECTOR_NAME_LEN 32 ++#define DRM_DISPLAY_MODE_LEN 32 ++#define DRM_PROP_NAME_LEN 32 ++ ++#define DRM_MODE_TYPE_BUILTIN (1<<0) /* deprecated */ ++#define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN) /* deprecated */ ++#define DRM_MODE_TYPE_CRTC_C ((1<<2) | DRM_MODE_TYPE_BUILTIN) /* deprecated */ ++#define DRM_MODE_TYPE_PREFERRED (1<<3) ++#define DRM_MODE_TYPE_DEFAULT (1<<4) /* deprecated */ ++#define DRM_MODE_TYPE_USERDEF (1<<5) ++#define DRM_MODE_TYPE_DRIVER (1<<6) ++ ++#define DRM_MODE_TYPE_ALL (DRM_MODE_TYPE_PREFERRED | \ ++ DRM_MODE_TYPE_USERDEF | \ ++ DRM_MODE_TYPE_DRIVER) ++ ++/* Video mode flags */ ++/* bit compatible with the xrandr RR_ definitions (bits 0-13) ++ * ++ * ABI warning: Existing userspace really expects ++ * the mode flags to match the xrandr definitions. Any ++ * changes that don't match the xrandr definitions will ++ * likely need a new client cap or some other mechanism ++ * to avoid breaking existing userspace. This includes ++ * allocating new flags in the previously unused bits! ++ */ ++#define DRM_MODE_FLAG_PHSYNC (1<<0) ++#define DRM_MODE_FLAG_NHSYNC (1<<1) ++#define DRM_MODE_FLAG_PVSYNC (1<<2) ++#define DRM_MODE_FLAG_NVSYNC (1<<3) ++#define DRM_MODE_FLAG_INTERLACE (1<<4) ++#define DRM_MODE_FLAG_DBLSCAN (1<<5) ++#define DRM_MODE_FLAG_CSYNC (1<<6) ++#define DRM_MODE_FLAG_PCSYNC (1<<7) ++#define DRM_MODE_FLAG_NCSYNC (1<<8) ++#define DRM_MODE_FLAG_HSKEW (1<<9) /* hskew provided */ ++#define DRM_MODE_FLAG_BCAST (1<<10) /* deprecated */ ++#define DRM_MODE_FLAG_PIXMUX (1<<11) /* deprecated */ ++#define DRM_MODE_FLAG_DBLCLK (1<<12) ++#define DRM_MODE_FLAG_CLKDIV2 (1<<13) ++ /* ++ * When adding a new stereo mode don't forget to adjust DRM_MODE_FLAGS_3D_MAX ++ * (define not exposed to user space). ++ */ ++#define DRM_MODE_FLAG_3D_MASK (0x1f<<14) ++#define DRM_MODE_FLAG_3D_NONE (0<<14) ++#define DRM_MODE_FLAG_3D_FRAME_PACKING (1<<14) ++#define DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE (2<<14) ++#define DRM_MODE_FLAG_3D_LINE_ALTERNATIVE (3<<14) ++#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL (4<<14) ++#define DRM_MODE_FLAG_3D_L_DEPTH (5<<14) ++#define DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH (6<<14) ++#define DRM_MODE_FLAG_3D_TOP_AND_BOTTOM (7<<14) ++#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF (8<<14) ++ ++/* Picture aspect ratio options */ ++#define DRM_MODE_PICTURE_ASPECT_NONE 0 ++#define DRM_MODE_PICTURE_ASPECT_4_3 1 ++#define DRM_MODE_PICTURE_ASPECT_16_9 2 ++#define DRM_MODE_PICTURE_ASPECT_64_27 3 ++#define DRM_MODE_PICTURE_ASPECT_256_135 4 ++ ++/* Content type options */ ++#define DRM_MODE_CONTENT_TYPE_NO_DATA 0 ++#define DRM_MODE_CONTENT_TYPE_GRAPHICS 1 ++#define DRM_MODE_CONTENT_TYPE_PHOTO 2 ++#define DRM_MODE_CONTENT_TYPE_CINEMA 3 ++#define DRM_MODE_CONTENT_TYPE_GAME 4 ++ ++/* Aspect ratio flag bitmask (4 bits 22:19) */ ++#define DRM_MODE_FLAG_PIC_AR_MASK (0x0F<<19) ++#define DRM_MODE_FLAG_PIC_AR_NONE \ ++ (DRM_MODE_PICTURE_ASPECT_NONE<<19) ++#define DRM_MODE_FLAG_PIC_AR_4_3 \ ++ (DRM_MODE_PICTURE_ASPECT_4_3<<19) ++#define DRM_MODE_FLAG_PIC_AR_16_9 \ ++ (DRM_MODE_PICTURE_ASPECT_16_9<<19) ++#define DRM_MODE_FLAG_PIC_AR_64_27 \ ++ (DRM_MODE_PICTURE_ASPECT_64_27<<19) ++#define DRM_MODE_FLAG_PIC_AR_256_135 \ ++ (DRM_MODE_PICTURE_ASPECT_256_135<<19) ++ ++#define DRM_MODE_FLAG_ALL (DRM_MODE_FLAG_PHSYNC | \ ++ DRM_MODE_FLAG_NHSYNC | \ ++ DRM_MODE_FLAG_PVSYNC | \ ++ DRM_MODE_FLAG_NVSYNC | \ ++ DRM_MODE_FLAG_INTERLACE | \ ++ DRM_MODE_FLAG_DBLSCAN | \ ++ DRM_MODE_FLAG_CSYNC | \ ++ DRM_MODE_FLAG_PCSYNC | \ ++ DRM_MODE_FLAG_NCSYNC | \ ++ DRM_MODE_FLAG_HSKEW | \ ++ DRM_MODE_FLAG_DBLCLK | \ ++ DRM_MODE_FLAG_CLKDIV2 | \ ++ DRM_MODE_FLAG_3D_MASK) ++ ++/* DPMS flags */ ++/* bit compatible with the xorg definitions. */ ++#define DRM_MODE_DPMS_ON 0 ++#define DRM_MODE_DPMS_STANDBY 1 ++#define DRM_MODE_DPMS_SUSPEND 2 ++#define DRM_MODE_DPMS_OFF 3 ++ ++/* Scaling mode options */ ++#define DRM_MODE_SCALE_NONE 0 /* Unmodified timing (display or ++ software can still scale) */ ++#define DRM_MODE_SCALE_FULLSCREEN 1 /* Full screen, ignore aspect */ ++#define DRM_MODE_SCALE_CENTER 2 /* Centered, no scaling */ ++#define DRM_MODE_SCALE_ASPECT 3 /* Full screen, preserve aspect */ ++ ++/* Dithering mode options */ ++#define DRM_MODE_DITHERING_OFF 0 ++#define DRM_MODE_DITHERING_ON 1 ++#define DRM_MODE_DITHERING_AUTO 2 ++ ++/* Dirty info options */ ++#define DRM_MODE_DIRTY_OFF 0 ++#define DRM_MODE_DIRTY_ON 1 ++#define DRM_MODE_DIRTY_ANNOTATE 2 ++ ++/* Link Status options */ ++#define DRM_MODE_LINK_STATUS_GOOD 0 ++#define DRM_MODE_LINK_STATUS_BAD 1 ++ ++/* ++ * DRM_MODE_ROTATE_ ++ * ++ * Signals that a drm plane is been rotated degrees in counter ++ * clockwise direction. ++ * ++ * This define is provided as a convenience, looking up the property id ++ * using the name->prop id lookup is the preferred method. ++ */ ++#define DRM_MODE_ROTATE_0 (1<<0) ++#define DRM_MODE_ROTATE_90 (1<<1) ++#define DRM_MODE_ROTATE_180 (1<<2) ++#define DRM_MODE_ROTATE_270 (1<<3) ++ ++/* ++ * DRM_MODE_ROTATE_MASK ++ * ++ * Bitmask used to look for drm plane rotations. ++ */ ++#define DRM_MODE_ROTATE_MASK (\ ++ DRM_MODE_ROTATE_0 | \ ++ DRM_MODE_ROTATE_90 | \ ++ DRM_MODE_ROTATE_180 | \ ++ DRM_MODE_ROTATE_270) ++ ++/* ++ * DRM_MODE_REFLECT_ ++ * ++ * Signals that the contents of a drm plane is reflected along the axis, ++ * in the same way as mirroring. ++ * See kerneldoc chapter "Plane Composition Properties" for more details. ++ * ++ * This define is provided as a convenience, looking up the property id ++ * using the name->prop id lookup is the preferred method. ++ */ ++#define DRM_MODE_REFLECT_X (1<<4) ++#define DRM_MODE_REFLECT_Y (1<<5) ++ ++/* ++ * DRM_MODE_REFLECT_MASK ++ * ++ * Bitmask used to look for drm plane reflections. ++ */ ++#define DRM_MODE_REFLECT_MASK (\ ++ DRM_MODE_REFLECT_X | \ ++ DRM_MODE_REFLECT_Y) ++ ++/* Content Protection Flags */ ++#define DRM_MODE_CONTENT_PROTECTION_UNDESIRED 0 ++#define DRM_MODE_CONTENT_PROTECTION_DESIRED 1 ++#define DRM_MODE_CONTENT_PROTECTION_ENABLED 2 ++ ++/** ++ * struct drm_mode_modeinfo - Display mode information. ++ * @clock: pixel clock in kHz ++ * @hdisplay: horizontal display size ++ * @hsync_start: horizontal sync start ++ * @hsync_end: horizontal sync end ++ * @htotal: horizontal total size ++ * @hskew: horizontal skew ++ * @vdisplay: vertical display size ++ * @vsync_start: vertical sync start ++ * @vsync_end: vertical sync end ++ * @vtotal: vertical total size ++ * @vscan: vertical scan ++ * @vrefresh: approximate vertical refresh rate in Hz ++ * @flags: bitmask of misc. flags, see DRM_MODE_FLAG_* defines ++ * @type: bitmask of type flags, see DRM_MODE_TYPE_* defines ++ * @name: string describing the mode resolution ++ * ++ * This is the user-space API display mode information structure. For the ++ * kernel version see struct drm_display_mode. ++ */ ++struct drm_mode_modeinfo { ++ __u32 clock; ++ __u16 hdisplay; ++ __u16 hsync_start; ++ __u16 hsync_end; ++ __u16 htotal; ++ __u16 hskew; ++ __u16 vdisplay; ++ __u16 vsync_start; ++ __u16 vsync_end; ++ __u16 vtotal; ++ __u16 vscan; ++ ++ __u32 vrefresh; ++ ++ __u32 flags; ++ __u32 type; ++ char name[DRM_DISPLAY_MODE_LEN]; ++}; ++ ++struct drm_mode_card_res { ++ __u64 fb_id_ptr; ++ __u64 crtc_id_ptr; ++ __u64 connector_id_ptr; ++ __u64 encoder_id_ptr; ++ __u32 count_fbs; ++ __u32 count_crtcs; ++ __u32 count_connectors; ++ __u32 count_encoders; ++ __u32 min_width; ++ __u32 max_width; ++ __u32 min_height; ++ __u32 max_height; ++}; ++ ++struct drm_mode_crtc { ++ __u64 set_connectors_ptr; ++ __u32 count_connectors; ++ ++ __u32 crtc_id; /**< Id */ ++ __u32 fb_id; /**< Id of framebuffer */ ++ ++ __u32 x; /**< x Position on the framebuffer */ ++ __u32 y; /**< y Position on the framebuffer */ ++ ++ __u32 gamma_size; ++ __u32 mode_valid; ++ struct drm_mode_modeinfo mode; ++}; ++ ++#define DRM_MODE_PRESENT_TOP_FIELD (1<<0) ++#define DRM_MODE_PRESENT_BOTTOM_FIELD (1<<1) ++ ++/* Planes blend with or override other bits on the CRTC */ ++struct drm_mode_set_plane { ++ __u32 plane_id; ++ __u32 crtc_id; ++ __u32 fb_id; /* fb object contains surface format type */ ++ __u32 flags; /* see above flags */ ++ ++ /* Signed dest location allows it to be partially off screen */ ++ __s32 crtc_x; ++ __s32 crtc_y; ++ __u32 crtc_w; ++ __u32 crtc_h; ++ ++ /* Source values are 16.16 fixed point */ ++ __u32 src_x; ++ __u32 src_y; ++ __u32 src_h; ++ __u32 src_w; ++}; ++ ++/** ++ * struct drm_mode_get_plane - Get plane metadata. ++ * ++ * Userspace can perform a GETPLANE ioctl to retrieve information about a ++ * plane. ++ * ++ * To retrieve the number of formats supported, set @count_format_types to zero ++ * and call the ioctl. @count_format_types will be updated with the value. ++ * ++ * To retrieve these formats, allocate an array with the memory needed to store ++ * @count_format_types formats. Point @format_type_ptr to this array and call ++ * the ioctl again (with @count_format_types still set to the value returned in ++ * the first ioctl call). ++ */ ++struct drm_mode_get_plane { ++ /** ++ * @plane_id: Object ID of the plane whose information should be ++ * retrieved. Set by caller. ++ */ ++ __u32 plane_id; ++ ++ /** @crtc_id: Object ID of the current CRTC. */ ++ __u32 crtc_id; ++ /** @fb_id: Object ID of the current fb. */ ++ __u32 fb_id; ++ ++ /** ++ * @possible_crtcs: Bitmask of CRTC's compatible with the plane. CRTC's ++ * are created and they receive an index, which corresponds to their ++ * position in the bitmask. Bit N corresponds to ++ * :ref:`CRTC index` N. ++ */ ++ __u32 possible_crtcs; ++ /** @gamma_size: Never used. */ ++ __u32 gamma_size; ++ ++ /** @count_format_types: Number of formats. */ ++ __u32 count_format_types; ++ /** ++ * @format_type_ptr: Pointer to ``__u32`` array of formats that are ++ * supported by the plane. These formats do not require modifiers. ++ */ ++ __u64 format_type_ptr; ++}; ++ ++struct drm_mode_get_plane_res { ++ __u64 plane_id_ptr; ++ __u32 count_planes; ++}; ++ ++#define DRM_MODE_ENCODER_NONE 0 ++#define DRM_MODE_ENCODER_DAC 1 ++#define DRM_MODE_ENCODER_TMDS 2 ++#define DRM_MODE_ENCODER_LVDS 3 ++#define DRM_MODE_ENCODER_TVDAC 4 ++#define DRM_MODE_ENCODER_VIRTUAL 5 ++#define DRM_MODE_ENCODER_DSI 6 ++#define DRM_MODE_ENCODER_DPMST 7 ++#define DRM_MODE_ENCODER_DPI 8 ++ ++struct drm_mode_get_encoder { ++ __u32 encoder_id; ++ __u32 encoder_type; ++ ++ __u32 crtc_id; /**< Id of crtc */ ++ ++ __u32 possible_crtcs; ++ __u32 possible_clones; ++}; ++ ++/* This is for connectors with multiple signal types. */ ++/* Try to match DRM_MODE_CONNECTOR_X as closely as possible. */ ++enum drm_mode_subconnector { ++ DRM_MODE_SUBCONNECTOR_Automatic = 0, /* DVI-I, TV */ ++ DRM_MODE_SUBCONNECTOR_Unknown = 0, /* DVI-I, TV, DP */ ++ DRM_MODE_SUBCONNECTOR_VGA = 1, /* DP */ ++ DRM_MODE_SUBCONNECTOR_DVID = 3, /* DVI-I DP */ ++ DRM_MODE_SUBCONNECTOR_DVIA = 4, /* DVI-I */ ++ DRM_MODE_SUBCONNECTOR_Composite = 5, /* TV */ ++ DRM_MODE_SUBCONNECTOR_SVIDEO = 6, /* TV */ ++ DRM_MODE_SUBCONNECTOR_Component = 8, /* TV */ ++ DRM_MODE_SUBCONNECTOR_SCART = 9, /* TV */ ++ DRM_MODE_SUBCONNECTOR_DisplayPort = 10, /* DP */ ++ DRM_MODE_SUBCONNECTOR_HDMIA = 11, /* DP */ ++ DRM_MODE_SUBCONNECTOR_Native = 15, /* DP */ ++ DRM_MODE_SUBCONNECTOR_Wireless = 18, /* DP */ ++}; ++ ++#define DRM_MODE_CONNECTOR_Unknown 0 ++#define DRM_MODE_CONNECTOR_VGA 1 ++#define DRM_MODE_CONNECTOR_DVII 2 ++#define DRM_MODE_CONNECTOR_DVID 3 ++#define DRM_MODE_CONNECTOR_DVIA 4 ++#define DRM_MODE_CONNECTOR_Composite 5 ++#define DRM_MODE_CONNECTOR_SVIDEO 6 ++#define DRM_MODE_CONNECTOR_LVDS 7 ++#define DRM_MODE_CONNECTOR_Component 8 ++#define DRM_MODE_CONNECTOR_9PinDIN 9 ++#define DRM_MODE_CONNECTOR_DisplayPort 10 ++#define DRM_MODE_CONNECTOR_HDMIA 11 ++#define DRM_MODE_CONNECTOR_HDMIB 12 ++#define DRM_MODE_CONNECTOR_TV 13 ++#define DRM_MODE_CONNECTOR_eDP 14 ++#define DRM_MODE_CONNECTOR_VIRTUAL 15 ++#define DRM_MODE_CONNECTOR_DSI 16 ++#define DRM_MODE_CONNECTOR_DPI 17 ++#define DRM_MODE_CONNECTOR_WRITEBACK 18 ++#define DRM_MODE_CONNECTOR_SPI 19 ++#define DRM_MODE_CONNECTOR_USB 20 ++ ++/** ++ * struct drm_mode_get_connector - Get connector metadata. ++ * ++ * User-space can perform a GETCONNECTOR ioctl to retrieve information about a ++ * connector. User-space is expected to retrieve encoders, modes and properties ++ * by performing this ioctl at least twice: the first time to retrieve the ++ * number of elements, the second time to retrieve the elements themselves. ++ * ++ * To retrieve the number of elements, set @count_props and @count_encoders to ++ * zero, set @count_modes to 1, and set @modes_ptr to a temporary struct ++ * drm_mode_modeinfo element. ++ * ++ * To retrieve the elements, allocate arrays for @encoders_ptr, @modes_ptr, ++ * @props_ptr and @prop_values_ptr, then set @count_modes, @count_props and ++ * @count_encoders to their capacity. ++ * ++ * Performing the ioctl only twice may be racy: the number of elements may have ++ * changed with a hotplug event in-between the two ioctls. User-space is ++ * expected to retry the last ioctl until the number of elements stabilizes. ++ * The kernel won't fill any array which doesn't have the expected length. ++ * ++ * **Force-probing a connector** ++ * ++ * If the @count_modes field is set to zero and the DRM client is the current ++ * DRM master, the kernel will perform a forced probe on the connector to ++ * refresh the connector status, modes and EDID. A forced-probe can be slow, ++ * might cause flickering and the ioctl will block. ++ * ++ * User-space needs to force-probe connectors to ensure their metadata is ++ * up-to-date at startup and after receiving a hot-plug event. User-space ++ * may perform a forced-probe when the user explicitly requests it. User-space ++ * shouldn't perform a forced-probe in other situations. ++ */ ++struct drm_mode_get_connector { ++ /** @encoders_ptr: Pointer to ``__u32`` array of object IDs. */ ++ __u64 encoders_ptr; ++ /** @modes_ptr: Pointer to struct drm_mode_modeinfo array. */ ++ __u64 modes_ptr; ++ /** @props_ptr: Pointer to ``__u32`` array of property IDs. */ ++ __u64 props_ptr; ++ /** @prop_values_ptr: Pointer to ``__u64`` array of property values. */ ++ __u64 prop_values_ptr; ++ ++ /** @count_modes: Number of modes. */ ++ __u32 count_modes; ++ /** @count_props: Number of properties. */ ++ __u32 count_props; ++ /** @count_encoders: Number of encoders. */ ++ __u32 count_encoders; ++ ++ /** @encoder_id: Object ID of the current encoder. */ ++ __u32 encoder_id; ++ /** @connector_id: Object ID of the connector. */ ++ __u32 connector_id; ++ /** ++ * @connector_type: Type of the connector. ++ * ++ * See DRM_MODE_CONNECTOR_* defines. ++ */ ++ __u32 connector_type; ++ /** ++ * @connector_type_id: Type-specific connector number. ++ * ++ * This is not an object ID. This is a per-type connector number. Each ++ * (type, type_id) combination is unique across all connectors of a DRM ++ * device. ++ */ ++ __u32 connector_type_id; ++ ++ /** ++ * @connection: Status of the connector. ++ * ++ * See enum drm_connector_status. ++ */ ++ __u32 connection; ++ /** @mm_width: Width of the connected sink in millimeters. */ ++ __u32 mm_width; ++ /** @mm_height: Height of the connected sink in millimeters. */ ++ __u32 mm_height; ++ /** ++ * @subpixel: Subpixel order of the connected sink. ++ * ++ * See enum subpixel_order. ++ */ ++ __u32 subpixel; ++ ++ /** @pad: Padding, must be zero. */ ++ __u32 pad; ++}; ++ ++#define DRM_MODE_PROP_PENDING (1<<0) /* deprecated, do not use */ ++#define DRM_MODE_PROP_RANGE (1<<1) ++#define DRM_MODE_PROP_IMMUTABLE (1<<2) ++#define DRM_MODE_PROP_ENUM (1<<3) /* enumerated type with text strings */ ++#define DRM_MODE_PROP_BLOB (1<<4) ++#define DRM_MODE_PROP_BITMASK (1<<5) /* bitmask of enumerated types */ ++ ++/* non-extended types: legacy bitmask, one bit per type: */ ++#define DRM_MODE_PROP_LEGACY_TYPE ( \ ++ DRM_MODE_PROP_RANGE | \ ++ DRM_MODE_PROP_ENUM | \ ++ DRM_MODE_PROP_BLOB | \ ++ DRM_MODE_PROP_BITMASK) ++ ++/* extended-types: rather than continue to consume a bit per type, ++ * grab a chunk of the bits to use as integer type id. ++ */ ++#define DRM_MODE_PROP_EXTENDED_TYPE 0x0000ffc0 ++#define DRM_MODE_PROP_TYPE(n) ((n) << 6) ++#define DRM_MODE_PROP_OBJECT DRM_MODE_PROP_TYPE(1) ++#define DRM_MODE_PROP_SIGNED_RANGE DRM_MODE_PROP_TYPE(2) ++ ++/* the PROP_ATOMIC flag is used to hide properties from userspace that ++ * is not aware of atomic properties. This is mostly to work around ++ * older userspace (DDX drivers) that read/write each prop they find, ++ * witout being aware that this could be triggering a lengthy modeset. ++ */ ++#define DRM_MODE_PROP_ATOMIC 0x80000000 ++ ++/** ++ * struct drm_mode_property_enum - Description for an enum/bitfield entry. ++ * @value: numeric value for this enum entry. ++ * @name: symbolic name for this enum entry. ++ * ++ * See struct drm_property_enum for details. ++ */ ++struct drm_mode_property_enum { ++ __u64 value; ++ char name[DRM_PROP_NAME_LEN]; ++}; ++ ++/** ++ * struct drm_mode_get_property - Get property metadata. ++ * ++ * User-space can perform a GETPROPERTY ioctl to retrieve information about a ++ * property. The same property may be attached to multiple objects, see ++ * "Modeset Base Object Abstraction". ++ * ++ * The meaning of the @values_ptr field changes depending on the property type. ++ * See &drm_property.flags for more details. ++ * ++ * The @enum_blob_ptr and @count_enum_blobs fields are only meaningful when the ++ * property has the type &DRM_MODE_PROP_ENUM or &DRM_MODE_PROP_BITMASK. For ++ * backwards compatibility, the kernel will always set @count_enum_blobs to ++ * zero when the property has the type &DRM_MODE_PROP_BLOB. User-space must ++ * ignore these two fields if the property has a different type. ++ * ++ * User-space is expected to retrieve values and enums by performing this ioctl ++ * at least twice: the first time to retrieve the number of elements, the ++ * second time to retrieve the elements themselves. ++ * ++ * To retrieve the number of elements, set @count_values and @count_enum_blobs ++ * to zero, then call the ioctl. @count_values will be updated with the number ++ * of elements. If the property has the type &DRM_MODE_PROP_ENUM or ++ * &DRM_MODE_PROP_BITMASK, @count_enum_blobs will be updated as well. ++ * ++ * To retrieve the elements themselves, allocate an array for @values_ptr and ++ * set @count_values to its capacity. If the property has the type ++ * &DRM_MODE_PROP_ENUM or &DRM_MODE_PROP_BITMASK, allocate an array for ++ * @enum_blob_ptr and set @count_enum_blobs to its capacity. Calling the ioctl ++ * again will fill the arrays. ++ */ ++struct drm_mode_get_property { ++ /** @values_ptr: Pointer to a ``__u64`` array. */ ++ __u64 values_ptr; ++ /** @enum_blob_ptr: Pointer to a struct drm_mode_property_enum array. */ ++ __u64 enum_blob_ptr; ++ ++ /** ++ * @prop_id: Object ID of the property which should be retrieved. Set ++ * by the caller. ++ */ ++ __u32 prop_id; ++ /** ++ * @flags: ``DRM_MODE_PROP_*`` bitfield. See &drm_property.flags for ++ * a definition of the flags. ++ */ ++ __u32 flags; ++ /** ++ * @name: Symbolic property name. User-space should use this field to ++ * recognize properties. ++ */ ++ char name[DRM_PROP_NAME_LEN]; ++ ++ /** @count_values: Number of elements in @values_ptr. */ ++ __u32 count_values; ++ /** @count_enum_blobs: Number of elements in @enum_blob_ptr. */ ++ __u32 count_enum_blobs; ++}; ++ ++struct drm_mode_connector_set_property { ++ __u64 value; ++ __u32 prop_id; ++ __u32 connector_id; ++}; ++ ++#define DRM_MODE_OBJECT_CRTC 0xcccccccc ++#define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0 ++#define DRM_MODE_OBJECT_ENCODER 0xe0e0e0e0 ++#define DRM_MODE_OBJECT_MODE 0xdededede ++#define DRM_MODE_OBJECT_PROPERTY 0xb0b0b0b0 ++#define DRM_MODE_OBJECT_FB 0xfbfbfbfb ++#define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb ++#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee ++#define DRM_MODE_OBJECT_ANY 0 ++ ++struct drm_mode_obj_get_properties { ++ __u64 props_ptr; ++ __u64 prop_values_ptr; ++ __u32 count_props; ++ __u32 obj_id; ++ __u32 obj_type; ++}; ++ ++struct drm_mode_obj_set_property { ++ __u64 value; ++ __u32 prop_id; ++ __u32 obj_id; ++ __u32 obj_type; ++}; ++ ++struct drm_mode_get_blob { ++ __u32 blob_id; ++ __u32 length; ++ __u64 data; ++}; ++ ++struct drm_mode_fb_cmd { ++ __u32 fb_id; ++ __u32 width; ++ __u32 height; ++ __u32 pitch; ++ __u32 bpp; ++ __u32 depth; ++ /* driver specific handle */ ++ __u32 handle; ++}; ++ ++#define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */ ++#define DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifer[] */ ++ ++struct drm_mode_fb_cmd2 { ++ __u32 fb_id; ++ __u32 width; ++ __u32 height; ++ __u32 pixel_format; /* fourcc code from drm_fourcc.h */ ++ __u32 flags; /* see above flags */ ++ ++ /* ++ * In case of planar formats, this ioctl allows up to 4 ++ * buffer objects with offsets and pitches per plane. ++ * The pitch and offset order is dictated by the fourcc, ++ * e.g. NV12 (https://fourcc.org/yuv.php#NV12) is described as: ++ * ++ * YUV 4:2:0 image with a plane of 8 bit Y samples ++ * followed by an interleaved U/V plane containing ++ * 8 bit 2x2 subsampled colour difference samples. ++ * ++ * So it would consist of Y as offsets[0] and UV as ++ * offsets[1]. Note that offsets[0] will generally ++ * be 0 (but this is not required). ++ * ++ * To accommodate tiled, compressed, etc formats, a ++ * modifier can be specified. The default value of zero ++ * indicates "native" format as specified by the fourcc. ++ * Vendor specific modifier token. Note that even though ++ * it looks like we have a modifier per-plane, we in fact ++ * do not. The modifier for each plane must be identical. ++ * Thus all combinations of different data layouts for ++ * multi plane formats must be enumerated as separate ++ * modifiers. ++ */ ++ __u32 handles[4]; ++ __u32 pitches[4]; /* pitch for each plane */ ++ __u32 offsets[4]; /* offset of each plane */ ++ __u64 modifier[4]; /* ie, tiling, compress */ ++}; ++ ++#define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01 ++#define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02 ++#define DRM_MODE_FB_DIRTY_FLAGS 0x03 ++ ++#define DRM_MODE_FB_DIRTY_MAX_CLIPS 256 ++ ++/* ++ * Mark a region of a framebuffer as dirty. ++ * ++ * Some hardware does not automatically update display contents ++ * as a hardware or software draw to a framebuffer. This ioctl ++ * allows userspace to tell the kernel and the hardware what ++ * regions of the framebuffer have changed. ++ * ++ * The kernel or hardware is free to update more then just the ++ * region specified by the clip rects. The kernel or hardware ++ * may also delay and/or coalesce several calls to dirty into a ++ * single update. ++ * ++ * Userspace may annotate the updates, the annotates are a ++ * promise made by the caller that the change is either a copy ++ * of pixels or a fill of a single color in the region specified. ++ * ++ * If the DRM_MODE_FB_DIRTY_ANNOTATE_COPY flag is given then ++ * the number of updated regions are half of num_clips given, ++ * where the clip rects are paired in src and dst. The width and ++ * height of each one of the pairs must match. ++ * ++ * If the DRM_MODE_FB_DIRTY_ANNOTATE_FILL flag is given the caller ++ * promises that the region specified of the clip rects is filled ++ * completely with a single color as given in the color argument. ++ */ ++ ++struct drm_mode_fb_dirty_cmd { ++ __u32 fb_id; ++ __u32 flags; ++ __u32 color; ++ __u32 num_clips; ++ __u64 clips_ptr; ++}; ++ ++struct drm_mode_mode_cmd { ++ __u32 connector_id; ++ struct drm_mode_modeinfo mode; ++}; ++ ++#define DRM_MODE_CURSOR_BO 0x01 ++#define DRM_MODE_CURSOR_MOVE 0x02 ++#define DRM_MODE_CURSOR_FLAGS 0x03 ++ ++/* ++ * depending on the value in flags different members are used. ++ * ++ * CURSOR_BO uses ++ * crtc_id ++ * width ++ * height ++ * handle - if 0 turns the cursor off ++ * ++ * CURSOR_MOVE uses ++ * crtc_id ++ * x ++ * y ++ */ ++struct drm_mode_cursor { ++ __u32 flags; ++ __u32 crtc_id; ++ __s32 x; ++ __s32 y; ++ __u32 width; ++ __u32 height; ++ /* driver specific handle */ ++ __u32 handle; ++}; ++ ++struct drm_mode_cursor2 { ++ __u32 flags; ++ __u32 crtc_id; ++ __s32 x; ++ __s32 y; ++ __u32 width; ++ __u32 height; ++ /* driver specific handle */ ++ __u32 handle; ++ __s32 hot_x; ++ __s32 hot_y; ++}; ++ ++struct drm_mode_crtc_lut { ++ __u32 crtc_id; ++ __u32 gamma_size; ++ ++ /* pointers to arrays */ ++ __u64 red; ++ __u64 green; ++ __u64 blue; ++}; ++ ++struct drm_color_ctm { ++ /* ++ * Conversion matrix in S31.32 sign-magnitude ++ * (not two's complement!) format. ++ */ ++ __u64 matrix[9]; ++}; ++ ++struct drm_color_lut { ++ /* ++ * Values are mapped linearly to 0.0 - 1.0 range, with 0x0 == 0.0 and ++ * 0xffff == 1.0. ++ */ ++ __u16 red; ++ __u16 green; ++ __u16 blue; ++ __u16 reserved; ++}; ++ ++/** ++ * struct hdr_metadata_infoframe - HDR Metadata Infoframe Data. ++ * ++ * HDR Metadata Infoframe as per CTA 861.G spec. This is expected ++ * to match exactly with the spec. ++ * ++ * Userspace is expected to pass the metadata information as per ++ * the format described in this structure. ++ */ ++struct hdr_metadata_infoframe { ++ /** ++ * @eotf: Electro-Optical Transfer Function (EOTF) ++ * used in the stream. ++ */ ++ __u8 eotf; ++ /** ++ * @metadata_type: Static_Metadata_Descriptor_ID. ++ */ ++ __u8 metadata_type; ++ /** ++ * @display_primaries: Color Primaries of the Data. ++ * These are coded as unsigned 16-bit values in units of ++ * 0.00002, where 0x0000 represents zero and 0xC350 ++ * represents 1.0000. ++ * @display_primaries.x: X cordinate of color primary. ++ * @display_primaries.y: Y cordinate of color primary. ++ */ ++ struct { ++ __u16 x, y; ++ } display_primaries[3]; ++ /** ++ * @white_point: White Point of Colorspace Data. ++ * These are coded as unsigned 16-bit values in units of ++ * 0.00002, where 0x0000 represents zero and 0xC350 ++ * represents 1.0000. ++ * @white_point.x: X cordinate of whitepoint of color primary. ++ * @white_point.y: Y cordinate of whitepoint of color primary. ++ */ ++ struct { ++ __u16 x, y; ++ } white_point; ++ /** ++ * @max_display_mastering_luminance: Max Mastering Display Luminance. ++ * This value is coded as an unsigned 16-bit value in units of 1 cd/m2, ++ * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2. ++ */ ++ __u16 max_display_mastering_luminance; ++ /** ++ * @min_display_mastering_luminance: Min Mastering Display Luminance. ++ * This value is coded as an unsigned 16-bit value in units of ++ * 0.0001 cd/m2, where 0x0001 represents 0.0001 cd/m2 and 0xFFFF ++ * represents 6.5535 cd/m2. ++ */ ++ __u16 min_display_mastering_luminance; ++ /** ++ * @max_cll: Max Content Light Level. ++ * This value is coded as an unsigned 16-bit value in units of 1 cd/m2, ++ * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2. ++ */ ++ __u16 max_cll; ++ /** ++ * @max_fall: Max Frame Average Light Level. ++ * This value is coded as an unsigned 16-bit value in units of 1 cd/m2, ++ * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2. ++ */ ++ __u16 max_fall; ++}; ++ ++/** ++ * struct hdr_output_metadata - HDR output metadata ++ * ++ * Metadata Information to be passed from userspace ++ */ ++struct hdr_output_metadata { ++ /** ++ * @metadata_type: Static_Metadata_Descriptor_ID. ++ */ ++ __u32 metadata_type; ++ /** ++ * @hdmi_metadata_type1: HDR Metadata Infoframe. ++ */ ++ union { ++ struct hdr_metadata_infoframe hdmi_metadata_type1; ++ }; ++}; ++ ++#define DRM_MODE_PAGE_FLIP_EVENT 0x01 ++#define DRM_MODE_PAGE_FLIP_ASYNC 0x02 ++#define DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE 0x4 ++#define DRM_MODE_PAGE_FLIP_TARGET_RELATIVE 0x8 ++#define DRM_MODE_PAGE_FLIP_TARGET (DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE | \ ++ DRM_MODE_PAGE_FLIP_TARGET_RELATIVE) ++#define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT | \ ++ DRM_MODE_PAGE_FLIP_ASYNC | \ ++ DRM_MODE_PAGE_FLIP_TARGET) ++ ++/* ++ * Request a page flip on the specified crtc. ++ * ++ * This ioctl will ask KMS to schedule a page flip for the specified ++ * crtc. Once any pending rendering targeting the specified fb (as of ++ * ioctl time) has completed, the crtc will be reprogrammed to display ++ * that fb after the next vertical refresh. The ioctl returns ++ * immediately, but subsequent rendering to the current fb will block ++ * in the execbuffer ioctl until the page flip happens. If a page ++ * flip is already pending as the ioctl is called, EBUSY will be ++ * returned. ++ * ++ * Flag DRM_MODE_PAGE_FLIP_EVENT requests that drm sends back a vblank ++ * event (see drm.h: struct drm_event_vblank) when the page flip is ++ * done. The user_data field passed in with this ioctl will be ++ * returned as the user_data field in the vblank event struct. ++ * ++ * Flag DRM_MODE_PAGE_FLIP_ASYNC requests that the flip happen ++ * 'as soon as possible', meaning that it not delay waiting for vblank. ++ * This may cause tearing on the screen. ++ * ++ * The reserved field must be zero. ++ */ ++ ++struct drm_mode_crtc_page_flip { ++ __u32 crtc_id; ++ __u32 fb_id; ++ __u32 flags; ++ __u32 reserved; ++ __u64 user_data; ++}; ++ ++/* ++ * Request a page flip on the specified crtc. ++ * ++ * Same as struct drm_mode_crtc_page_flip, but supports new flags and ++ * re-purposes the reserved field: ++ * ++ * The sequence field must be zero unless either of the ++ * DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags is specified. When ++ * the ABSOLUTE flag is specified, the sequence field denotes the absolute ++ * vblank sequence when the flip should take effect. When the RELATIVE ++ * flag is specified, the sequence field denotes the relative (to the ++ * current one when the ioctl is called) vblank sequence when the flip ++ * should take effect. NOTE: DRM_IOCTL_WAIT_VBLANK must still be used to ++ * make sure the vblank sequence before the target one has passed before ++ * calling this ioctl. The purpose of the ++ * DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags is merely to clarify ++ * the target for when code dealing with a page flip runs during a ++ * vertical blank period. ++ */ ++ ++struct drm_mode_crtc_page_flip_target { ++ __u32 crtc_id; ++ __u32 fb_id; ++ __u32 flags; ++ __u32 sequence; ++ __u64 user_data; ++}; ++ ++/* create a dumb scanout buffer */ ++struct drm_mode_create_dumb { ++ __u32 height; ++ __u32 width; ++ __u32 bpp; ++ __u32 flags; ++ /* handle, pitch, size will be returned */ ++ __u32 handle; ++ __u32 pitch; ++ __u64 size; ++}; ++ ++/* set up for mmap of a dumb scanout buffer */ ++struct drm_mode_map_dumb { ++ /** Handle for the object being mapped. */ ++ __u32 handle; ++ __u32 pad; ++ /** ++ * Fake offset to use for subsequent mmap call ++ * ++ * This is a fixed-size type for 32/64 compatibility. ++ */ ++ __u64 offset; ++}; ++ ++struct drm_mode_destroy_dumb { ++ __u32 handle; ++}; ++ ++/* page-flip flags are valid, plus: */ ++#define DRM_MODE_ATOMIC_TEST_ONLY 0x0100 ++#define DRM_MODE_ATOMIC_NONBLOCK 0x0200 ++#define DRM_MODE_ATOMIC_ALLOW_MODESET 0x0400 ++ ++#define DRM_MODE_ATOMIC_FLAGS (\ ++ DRM_MODE_PAGE_FLIP_EVENT |\ ++ DRM_MODE_PAGE_FLIP_ASYNC |\ ++ DRM_MODE_ATOMIC_TEST_ONLY |\ ++ DRM_MODE_ATOMIC_NONBLOCK |\ ++ DRM_MODE_ATOMIC_ALLOW_MODESET) ++ ++struct drm_mode_atomic { ++ __u32 flags; ++ __u32 count_objs; ++ __u64 objs_ptr; ++ __u64 count_props_ptr; ++ __u64 props_ptr; ++ __u64 prop_values_ptr; ++ __u64 reserved; ++ __u64 user_data; ++}; ++ ++struct drm_format_modifier_blob { ++#define FORMAT_BLOB_CURRENT 1 ++ /* Version of this blob format */ ++ __u32 version; ++ ++ /* Flags */ ++ __u32 flags; ++ ++ /* Number of fourcc formats supported */ ++ __u32 count_formats; ++ ++ /* Where in this blob the formats exist (in bytes) */ ++ __u32 formats_offset; ++ ++ /* Number of drm_format_modifiers */ ++ __u32 count_modifiers; ++ ++ /* Where in this blob the modifiers exist (in bytes) */ ++ __u32 modifiers_offset; ++ ++ /* __u32 formats[] */ ++ /* struct drm_format_modifier modifiers[] */ ++}; ++ ++struct drm_format_modifier { ++ /* Bitmask of formats in get_plane format list this info applies to. The ++ * offset allows a sliding window of which 64 formats (bits). ++ * ++ * Some examples: ++ * In today's world with < 65 formats, and formats 0, and 2 are ++ * supported ++ * 0x0000000000000005 ++ * ^-offset = 0, formats = 5 ++ * ++ * If the number formats grew to 128, and formats 98-102 are ++ * supported with the modifier: ++ * ++ * 0x0000007c00000000 0000000000000000 ++ * ^ ++ * |__offset = 64, formats = 0x7c00000000 ++ * ++ */ ++ __u64 formats; ++ __u32 offset; ++ __u32 pad; ++ ++ /* The modifier that applies to the >get_plane format list bitmask. */ ++ __u64 modifier; ++}; ++ ++/** ++ * struct drm_mode_create_blob - Create New blob property ++ * ++ * Create a new 'blob' data property, copying length bytes from data pointer, ++ * and returning new blob ID. ++ */ ++struct drm_mode_create_blob { ++ /** @data: Pointer to data to copy. */ ++ __u64 data; ++ /** @length: Length of data to copy. */ ++ __u32 length; ++ /** @blob_id: Return: new property ID. */ ++ __u32 blob_id; ++}; ++ ++/** ++ * struct drm_mode_destroy_blob - Destroy user blob ++ * @blob_id: blob_id to destroy ++ * ++ * Destroy a user-created blob property. ++ * ++ * User-space can release blobs as soon as they do not need to refer to them by ++ * their blob object ID. For instance, if you are using a MODE_ID blob in an ++ * atomic commit and you will not make another commit re-using the same ID, you ++ * can destroy the blob as soon as the commit has been issued, without waiting ++ * for it to complete. ++ */ ++struct drm_mode_destroy_blob { ++ __u32 blob_id; ++}; ++ ++/** ++ * struct drm_mode_create_lease - Create lease ++ * ++ * Lease mode resources, creating another drm_master. ++ * ++ * The @object_ids array must reference at least one CRTC, one connector and ++ * one plane if &DRM_CLIENT_CAP_UNIVERSAL_PLANES is enabled. Alternatively, ++ * the lease can be completely empty. ++ */ ++struct drm_mode_create_lease { ++ /** @object_ids: Pointer to array of object ids (__u32) */ ++ __u64 object_ids; ++ /** @object_count: Number of object ids */ ++ __u32 object_count; ++ /** @flags: flags for new FD (O_CLOEXEC, etc) */ ++ __u32 flags; ++ ++ /** @lessee_id: Return: unique identifier for lessee. */ ++ __u32 lessee_id; ++ /** @fd: Return: file descriptor to new drm_master file */ ++ __u32 fd; ++}; ++ ++/** ++ * struct drm_mode_list_lessees - List lessees ++ * ++ * List lesses from a drm_master. ++ */ ++struct drm_mode_list_lessees { ++ /** ++ * @count_lessees: Number of lessees. ++ * ++ * On input, provides length of the array. ++ * On output, provides total number. No ++ * more than the input number will be written ++ * back, so two calls can be used to get ++ * the size and then the data. ++ */ ++ __u32 count_lessees; ++ /** @pad: Padding. */ ++ __u32 pad; ++ ++ /** ++ * @lessees_ptr: Pointer to lessees. ++ * ++ * Pointer to __u64 array of lessee ids ++ */ ++ __u64 lessees_ptr; ++}; ++ ++/** ++ * struct drm_mode_get_lease - Get Lease ++ * ++ * Get leased objects. ++ */ ++struct drm_mode_get_lease { ++ /** ++ * @count_objects: Number of leased objects. ++ * ++ * On input, provides length of the array. ++ * On output, provides total number. No ++ * more than the input number will be written ++ * back, so two calls can be used to get ++ * the size and then the data. ++ */ ++ __u32 count_objects; ++ /** @pad: Padding. */ ++ __u32 pad; ++ ++ /** ++ * @objects_ptr: Pointer to objects. ++ * ++ * Pointer to __u32 array of object ids. ++ */ ++ __u64 objects_ptr; ++}; ++ ++/** ++ * struct drm_mode_revoke_lease - Revoke lease ++ */ ++struct drm_mode_revoke_lease { ++ /** @lessee_id: Unique ID of lessee */ ++ __u32 lessee_id; ++}; ++ ++/** ++ * struct drm_mode_rect - Two dimensional rectangle. ++ * @x1: Horizontal starting coordinate (inclusive). ++ * @y1: Vertical starting coordinate (inclusive). ++ * @x2: Horizontal ending coordinate (exclusive). ++ * @y2: Vertical ending coordinate (exclusive). ++ * ++ * With drm subsystem using struct drm_rect to manage rectangular area this ++ * export it to user-space. ++ * ++ * Currently used by drm_mode_atomic blob property FB_DAMAGE_CLIPS. ++ */ ++struct drm_mode_rect { ++ __s32 x1; ++ __s32 y1; ++ __s32 x2; ++ __s32 y2; ++}; ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif +diff --git a/third_party/drm/drm/xf86drm.h b/third_party/drm/drm/xf86drm.h +new file mode 100644 +index 0000000..58d66f1 +--- /dev/null ++++ b/third_party/drm/drm/xf86drm.h +@@ -0,0 +1,966 @@ ++/** ++ * \file xf86drm.h ++ * OS-independent header for DRM user-level library interface. ++ * ++ * \author Rickard E. (Rik) Faith ++ */ ++ ++/* ++ * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas. ++ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. ++ * All Rights Reserved. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++ * DEALINGS IN THE SOFTWARE. ++ * ++ */ ++ ++#ifndef _XF86DRM_H_ ++#define _XF86DRM_H_ ++ ++#include ++#include ++#include ++#include ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++#ifndef DRM_MAX_MINOR ++#define DRM_MAX_MINOR 16 ++#endif ++ ++#if defined(__linux__) ++ ++#define DRM_IOCTL_NR(n) _IOC_NR(n) ++#define DRM_IOC_VOID _IOC_NONE ++#define DRM_IOC_READ _IOC_READ ++#define DRM_IOC_WRITE _IOC_WRITE ++#define DRM_IOC_READWRITE _IOC_READ|_IOC_WRITE ++#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size) ++ ++#else /* One of the *BSDs */ ++ ++#include ++#define DRM_IOCTL_NR(n) ((n) & 0xff) ++#define DRM_IOC_VOID IOC_VOID ++#define DRM_IOC_READ IOC_OUT ++#define DRM_IOC_WRITE IOC_IN ++#define DRM_IOC_READWRITE IOC_INOUT ++#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size) ++ ++#endif ++ ++ /* Defaults, if nothing set in xf86config */ ++#define DRM_DEV_UID 0 ++#define DRM_DEV_GID 0 ++/* Default /dev/dri directory permissions 0755 */ ++#define DRM_DEV_DIRMODE \ ++ (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) ++#define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) ++ ++#ifdef __OpenBSD__ ++#define DRM_DIR_NAME "/dev" ++#define DRM_PRIMARY_MINOR_NAME "drm" ++#define DRM_CONTROL_MINOR_NAME "drmC" ++#define DRM_RENDER_MINOR_NAME "drmR" ++#else ++#define DRM_DIR_NAME "/dev/dri" ++#define DRM_PRIMARY_MINOR_NAME "card" ++#define DRM_CONTROL_MINOR_NAME "controlD" ++#define DRM_RENDER_MINOR_NAME "renderD" ++#define DRM_PROC_NAME "/proc/dri/" /* For backward Linux compatibility */ ++#endif ++ ++#define DRM_DEV_NAME "%s/" DRM_PRIMARY_MINOR_NAME "%d" ++#define DRM_CONTROL_DEV_NAME "%s/" DRM_CONTROL_MINOR_NAME "%d" ++#define DRM_RENDER_DEV_NAME "%s/" DRM_RENDER_MINOR_NAME "%d" ++ ++#define DRM_NODE_NAME_MAX \ ++ (sizeof(DRM_DIR_NAME) + 1 /* slash */ \ ++ + MAX3(sizeof(DRM_PRIMARY_MINOR_NAME), \ ++ sizeof(DRM_CONTROL_MINOR_NAME), \ ++ sizeof(DRM_RENDER_MINOR_NAME)) \ ++ + sizeof("144") /* highest possible node number */ \ ++ + 1) /* NULL-terminator */ ++ ++#define DRM_ERR_NO_DEVICE (-1001) ++#define DRM_ERR_NO_ACCESS (-1002) ++#define DRM_ERR_NOT_ROOT (-1003) ++#define DRM_ERR_INVALID (-1004) ++#define DRM_ERR_NO_FD (-1005) ++ ++#define DRM_AGP_NO_HANDLE 0 ++ ++typedef unsigned int drmSize, *drmSizePtr; /**< For mapped regions */ ++typedef void *drmAddress, **drmAddressPtr; /**< For mapped regions */ ++ ++#if (__GNUC__ >= 3) ++#define DRM_PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a))) ++#else ++#define DRM_PRINTFLIKE(f, a) ++#endif ++ ++typedef struct _drmServerInfo { ++ int (*debug_print)(const char *format, va_list ap) DRM_PRINTFLIKE(1,0); ++ int (*load_module)(const char *name); ++ void (*get_perms)(gid_t *, mode_t *); ++} drmServerInfo, *drmServerInfoPtr; ++ ++typedef struct drmHashEntry { ++ int fd; ++ void (*f)(int, void *, void *); ++ void *tagTable; ++} drmHashEntry; ++ ++extern int drmIoctl(int fd, unsigned long request, void *arg); ++extern void *drmGetHashTable(void); ++extern drmHashEntry *drmGetEntry(int fd); ++ ++/** ++ * Driver version information. ++ * ++ * \sa drmGetVersion() and drmSetVersion(). ++ */ ++typedef struct _drmVersion { ++ int version_major; /**< Major version */ ++ int version_minor; /**< Minor version */ ++ int version_patchlevel; /**< Patch level */ ++ int name_len; /**< Length of name buffer */ ++ char *name; /**< Name of driver */ ++ int date_len; /**< Length of date buffer */ ++ char *date; /**< User-space buffer to hold date */ ++ int desc_len; /**< Length of desc buffer */ ++ char *desc; /**< User-space buffer to hold desc */ ++} drmVersion, *drmVersionPtr; ++ ++typedef struct _drmStats { ++ unsigned long count; /**< Number of data */ ++ struct { ++ unsigned long value; /**< Value from kernel */ ++ const char *long_format; /**< Suggested format for long_name */ ++ const char *long_name; /**< Long name for value */ ++ const char *rate_format; /**< Suggested format for rate_name */ ++ const char *rate_name; /**< Short name for value per second */ ++ int isvalue; /**< True if value (vs. counter) */ ++ const char *mult_names; /**< Multiplier names (e.g., "KGM") */ ++ int mult; /**< Multiplier value (e.g., 1024) */ ++ int verbose; /**< Suggest only in verbose output */ ++ } data[15]; ++} drmStatsT; ++ ++ ++ /* All of these enums *MUST* match with the ++ kernel implementation -- so do *NOT* ++ change them! (The drmlib implementation ++ will just copy the flags instead of ++ translating them.) */ ++typedef enum { ++ DRM_FRAME_BUFFER = 0, /**< WC, no caching, no core dump */ ++ DRM_REGISTERS = 1, /**< no caching, no core dump */ ++ DRM_SHM = 2, /**< shared, cached */ ++ DRM_AGP = 3, /**< AGP/GART */ ++ DRM_SCATTER_GATHER = 4, /**< PCI scatter/gather */ ++ DRM_CONSISTENT = 5 /**< PCI consistent */ ++} drmMapType; ++ ++typedef enum { ++ DRM_RESTRICTED = 0x0001, /**< Cannot be mapped to client-virtual */ ++ DRM_READ_ONLY = 0x0002, /**< Read-only in client-virtual */ ++ DRM_LOCKED = 0x0004, /**< Physical pages locked */ ++ DRM_KERNEL = 0x0008, /**< Kernel requires access */ ++ DRM_WRITE_COMBINING = 0x0010, /**< Use write-combining, if available */ ++ DRM_CONTAINS_LOCK = 0x0020, /**< SHM page that contains lock */ ++ DRM_REMOVABLE = 0x0040 /**< Removable mapping */ ++} drmMapFlags; ++ ++/** ++ * \warning These values *MUST* match drm.h ++ */ ++typedef enum { ++ /** \name Flags for DMA buffer dispatch */ ++ /*@{*/ ++ DRM_DMA_BLOCK = 0x01, /**< ++ * Block until buffer dispatched. ++ * ++ * \note the buffer may not yet have been ++ * processed by the hardware -- getting a ++ * hardware lock with the hardware quiescent ++ * will ensure that the buffer has been ++ * processed. ++ */ ++ DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */ ++ DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */ ++ /*@}*/ ++ ++ /** \name Flags for DMA buffer request */ ++ /*@{*/ ++ DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */ ++ DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */ ++ DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ ++ /*@}*/ ++} drmDMAFlags; ++ ++typedef enum { ++ DRM_PAGE_ALIGN = 0x01, ++ DRM_AGP_BUFFER = 0x02, ++ DRM_SG_BUFFER = 0x04, ++ DRM_FB_BUFFER = 0x08, ++ DRM_PCI_BUFFER_RO = 0x10 ++} drmBufDescFlags; ++ ++typedef enum { ++ DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */ ++ DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */ ++ DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */ ++ DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */ ++ /* These *HALT* flags aren't supported yet ++ -- they will be used to support the ++ full-screen DGA-like mode. */ ++ DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */ ++ DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ ++} drmLockFlags; ++ ++typedef enum { ++ DRM_CONTEXT_PRESERVED = 0x01, /**< This context is preserved and ++ never swapped. */ ++ DRM_CONTEXT_2DONLY = 0x02 /**< This context is for 2D rendering only. */ ++} drm_context_tFlags, *drm_context_tFlagsPtr; ++ ++typedef struct _drmBufDesc { ++ int count; /**< Number of buffers of this size */ ++ int size; /**< Size in bytes */ ++ int low_mark; /**< Low water mark */ ++ int high_mark; /**< High water mark */ ++} drmBufDesc, *drmBufDescPtr; ++ ++typedef struct _drmBufInfo { ++ int count; /**< Number of buffers described in list */ ++ drmBufDescPtr list; /**< List of buffer descriptions */ ++} drmBufInfo, *drmBufInfoPtr; ++ ++typedef struct _drmBuf { ++ int idx; /**< Index into the master buffer list */ ++ int total; /**< Buffer size */ ++ int used; /**< Amount of buffer in use (for DMA) */ ++ drmAddress address; /**< Address */ ++} drmBuf, *drmBufPtr; ++ ++/** ++ * Buffer mapping information. ++ * ++ * Used by drmMapBufs() and drmUnmapBufs() to store information about the ++ * mapped buffers. ++ */ ++typedef struct _drmBufMap { ++ int count; /**< Number of buffers mapped */ ++ drmBufPtr list; /**< Buffers */ ++} drmBufMap, *drmBufMapPtr; ++ ++typedef struct _drmLock { ++ volatile unsigned int lock; ++ char padding[60]; ++ /* This is big enough for most current (and future?) architectures: ++ DEC Alpha: 32 bytes ++ Intel Merced: ? ++ Intel P5/PPro/PII/PIII: 32 bytes ++ Intel StrongARM: 32 bytes ++ Intel i386/i486: 16 bytes ++ MIPS: 32 bytes (?) ++ Motorola 68k: 16 bytes ++ Motorola PowerPC: 32 bytes ++ Sun SPARC: 32 bytes ++ */ ++} drmLock, *drmLockPtr; ++ ++/** ++ * Indices here refer to the offset into ++ * list in drmBufInfo ++ */ ++typedef struct _drmDMAReq { ++ drm_context_t context; /**< Context handle */ ++ int send_count; /**< Number of buffers to send */ ++ int *send_list; /**< List of handles to buffers */ ++ int *send_sizes; /**< Lengths of data to send, in bytes */ ++ drmDMAFlags flags; /**< Flags */ ++ int request_count; /**< Number of buffers requested */ ++ int request_size; /**< Desired size of buffers requested */ ++ int *request_list; /**< Buffer information */ ++ int *request_sizes; /**< Minimum acceptable sizes */ ++ int granted_count; /**< Number of buffers granted at this size */ ++} drmDMAReq, *drmDMAReqPtr; ++ ++typedef struct _drmRegion { ++ drm_handle_t handle; ++ unsigned int offset; ++ drmSize size; ++ drmAddress map; ++} drmRegion, *drmRegionPtr; ++ ++typedef struct _drmTextureRegion { ++ unsigned char next; ++ unsigned char prev; ++ unsigned char in_use; ++ unsigned char padding; /**< Explicitly pad this out */ ++ unsigned int age; ++} drmTextureRegion, *drmTextureRegionPtr; ++ ++ ++typedef enum { ++ DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ ++ DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ ++ /* bits 1-6 are reserved for high crtcs */ ++ DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e, ++ DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */ ++ DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ ++ DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ ++ DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ ++ DRM_VBLANK_SIGNAL = 0x40000000 /* Send signal instead of blocking */ ++} drmVBlankSeqType; ++#define DRM_VBLANK_HIGH_CRTC_SHIFT 1 ++ ++typedef struct _drmVBlankReq { ++ drmVBlankSeqType type; ++ unsigned int sequence; ++ unsigned long signal; ++} drmVBlankReq, *drmVBlankReqPtr; ++ ++typedef struct _drmVBlankReply { ++ drmVBlankSeqType type; ++ unsigned int sequence; ++ long tval_sec; ++ long tval_usec; ++} drmVBlankReply, *drmVBlankReplyPtr; ++ ++typedef union _drmVBlank { ++ drmVBlankReq request; ++ drmVBlankReply reply; ++} drmVBlank, *drmVBlankPtr; ++ ++typedef struct _drmSetVersion { ++ int drm_di_major; ++ int drm_di_minor; ++ int drm_dd_major; ++ int drm_dd_minor; ++} drmSetVersion, *drmSetVersionPtr; ++ ++#define __drm_dummy_lock(lock) (*(__volatile__ unsigned int *)lock) ++ ++#define DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */ ++#define DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */ ++ ++#if defined(__GNUC__) && (__GNUC__ >= 2) ++# if defined(__i386) || defined(__AMD64__) || defined(__x86_64__) || defined(__amd64__) ++ /* Reflect changes here to drmP.h */ ++#define DRM_CAS(lock,old,new,__ret) \ ++ do { \ ++ int __dummy; /* Can't mark eax as clobbered */ \ ++ __asm__ __volatile__( \ ++ "lock ; cmpxchg %4,%1\n\t" \ ++ "setnz %0" \ ++ : "=d" (__ret), \ ++ "=m" (__drm_dummy_lock(lock)), \ ++ "=a" (__dummy) \ ++ : "2" (old), \ ++ "r" (new)); \ ++ } while (0) ++ ++#elif defined(__alpha__) ++ ++#define DRM_CAS(lock, old, new, ret) \ ++ do { \ ++ int tmp, old32; \ ++ __asm__ __volatile__( \ ++ " addl $31, %5, %3\n" \ ++ "1: ldl_l %0, %2\n" \ ++ " cmpeq %0, %3, %1\n" \ ++ " beq %1, 2f\n" \ ++ " mov %4, %0\n" \ ++ " stl_c %0, %2\n" \ ++ " beq %0, 3f\n" \ ++ " mb\n" \ ++ "2: cmpeq %1, 0, %1\n" \ ++ ".subsection 2\n" \ ++ "3: br 1b\n" \ ++ ".previous" \ ++ : "=&r"(tmp), "=&r"(ret), \ ++ "=m"(__drm_dummy_lock(lock)), \ ++ "=&r"(old32) \ ++ : "r"(new), "r"(old) \ ++ : "memory"); \ ++ } while (0) ++ ++#elif defined(__sparc__) ++ ++#define DRM_CAS(lock,old,new,__ret) \ ++do { register unsigned int __old __asm("o0"); \ ++ register unsigned int __new __asm("o1"); \ ++ register volatile unsigned int *__lock __asm("o2"); \ ++ __old = old; \ ++ __new = new; \ ++ __lock = (volatile unsigned int *)lock; \ ++ __asm__ __volatile__( \ ++ /*"cas [%2], %3, %0"*/ \ ++ ".word 0xd3e29008\n\t" \ ++ /*"membar #StoreStore | #StoreLoad"*/ \ ++ ".word 0x8143e00a" \ ++ : "=&r" (__new) \ ++ : "0" (__new), \ ++ "r" (__lock), \ ++ "r" (__old) \ ++ : "memory"); \ ++ __ret = (__new != __old); \ ++} while(0) ++ ++#elif defined(__ia64__) ++ ++#ifdef __INTEL_COMPILER ++/* this currently generates bad code (missing stop bits)... */ ++#include ++ ++#define DRM_CAS(lock,old,new,__ret) \ ++ do { \ ++ unsigned long __result, __old = (old) & 0xffffffff; \ ++ __mf(); \ ++ __result = _InterlockedCompareExchange_acq(&__drm_dummy_lock(lock), (new), __old);\ ++ __ret = (__result) != (__old); \ ++/* __ret = (__sync_val_compare_and_swap(&__drm_dummy_lock(lock), \ ++ (old), (new)) \ ++ != (old)); */\ ++ } while (0) ++ ++#else ++#define DRM_CAS(lock,old,new,__ret) \ ++ do { \ ++ unsigned int __result, __old = (old); \ ++ __asm__ __volatile__( \ ++ "mf\n" \ ++ "mov ar.ccv=%2\n" \ ++ ";;\n" \ ++ "cmpxchg4.acq %0=%1,%3,ar.ccv" \ ++ : "=r" (__result), "=m" (__drm_dummy_lock(lock)) \ ++ : "r" ((unsigned long)__old), "r" (new) \ ++ : "memory"); \ ++ __ret = (__result) != (__old); \ ++ } while (0) ++ ++#endif ++ ++#elif defined(__powerpc__) ++ ++#define DRM_CAS(lock,old,new,__ret) \ ++ do { \ ++ __asm__ __volatile__( \ ++ "sync;" \ ++ "0: lwarx %0,0,%1;" \ ++ " xor. %0,%3,%0;" \ ++ " bne 1f;" \ ++ " stwcx. %2,0,%1;" \ ++ " bne- 0b;" \ ++ "1: " \ ++ "sync;" \ ++ : "=&r"(__ret) \ ++ : "r"(lock), "r"(new), "r"(old) \ ++ : "cr0", "memory"); \ ++ } while (0) ++ ++# elif defined (__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \ ++ || defined (__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \ ++ || defined (__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) \ ++ || defined (__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \ ++ || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \ ++ || defined(__ARM_ARCH_7EM__) ++ /* excluding ARMv4/ARMv5 and lower (lacking ldrex/strex support) */ ++ #undef DRM_DEV_MODE ++ #define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) ++ ++ #define DRM_CAS(lock,old,new,__ret) \ ++ do { \ ++ __asm__ __volatile__ ( \ ++ "1: ldrex %0, [%1]\n" \ ++ " teq %0, %2\n" \ ++ " ite eq\n" \ ++ " strexeq %0, %3, [%1]\n" \ ++ " movne %0, #1\n" \ ++ : "=&r" (__ret) \ ++ : "r" (lock), "r" (old), "r" (new) \ ++ : "cc","memory"); \ ++ } while (0) ++ ++#endif /* architecture */ ++#endif /* __GNUC__ >= 2 */ ++ ++#ifndef DRM_CAS ++#define DRM_CAS(lock,old,new,ret) do { ret=1; } while (0) /* FAST LOCK FAILS */ ++#endif ++ ++#if defined(__alpha__) ++#define DRM_CAS_RESULT(_result) long _result ++#elif defined(__powerpc__) ++#define DRM_CAS_RESULT(_result) int _result ++#else ++#define DRM_CAS_RESULT(_result) char _result ++#endif ++ ++#define DRM_LIGHT_LOCK(fd,lock,context) \ ++ do { \ ++ DRM_CAS_RESULT(__ret); \ ++ DRM_CAS(lock,context,DRM_LOCK_HELD|context,__ret); \ ++ if (__ret) drmGetLock(fd,context,0); \ ++ } while(0) ++ ++ /* This one counts fast locks -- for ++ benchmarking only. */ ++#define DRM_LIGHT_LOCK_COUNT(fd,lock,context,count) \ ++ do { \ ++ DRM_CAS_RESULT(__ret); \ ++ DRM_CAS(lock,context,DRM_LOCK_HELD|context,__ret); \ ++ if (__ret) drmGetLock(fd,context,0); \ ++ else ++count; \ ++ } while(0) ++ ++#define DRM_LOCK(fd,lock,context,flags) \ ++ do { \ ++ if (flags) drmGetLock(fd,context,flags); \ ++ else DRM_LIGHT_LOCK(fd,lock,context); \ ++ } while(0) ++ ++#define DRM_UNLOCK(fd,lock,context) \ ++ do { \ ++ DRM_CAS_RESULT(__ret); \ ++ DRM_CAS(lock,DRM_LOCK_HELD|context,context,__ret); \ ++ if (__ret) drmUnlock(fd,context); \ ++ } while(0) ++ ++ /* Simple spin locks */ ++#define DRM_SPINLOCK(spin,val) \ ++ do { \ ++ DRM_CAS_RESULT(__ret); \ ++ do { \ ++ DRM_CAS(spin,0,val,__ret); \ ++ if (__ret) while ((spin)->lock); \ ++ } while (__ret); \ ++ } while(0) ++ ++#define DRM_SPINLOCK_TAKE(spin,val) \ ++ do { \ ++ DRM_CAS_RESULT(__ret); \ ++ int cur; \ ++ do { \ ++ cur = (*spin).lock; \ ++ DRM_CAS(spin,cur,val,__ret); \ ++ } while (__ret); \ ++ } while(0) ++ ++#define DRM_SPINLOCK_COUNT(spin,val,count,__ret) \ ++ do { \ ++ int __i; \ ++ __ret = 1; \ ++ for (__i = 0; __ret && __i < count; __i++) { \ ++ DRM_CAS(spin,0,val,__ret); \ ++ if (__ret) for (;__i < count && (spin)->lock; __i++); \ ++ } \ ++ } while(0) ++ ++#define DRM_SPINUNLOCK(spin,val) \ ++ do { \ ++ DRM_CAS_RESULT(__ret); \ ++ if ((*spin).lock == val) { /* else server stole lock */ \ ++ do { \ ++ DRM_CAS(spin,val,0,__ret); \ ++ } while (__ret); \ ++ } \ ++ } while(0) ++ ++ ++ ++/* General user-level programmer's API: unprivileged */ ++extern int drmAvailable(void); ++extern int drmOpen(const char *name, const char *busid); ++ ++#define DRM_NODE_PRIMARY 0 ++#define DRM_NODE_CONTROL 1 ++#define DRM_NODE_RENDER 2 ++#define DRM_NODE_MAX 3 ++ ++extern int drmOpenWithType(const char *name, const char *busid, ++ int type); ++ ++extern int drmOpenControl(int minor); ++extern int drmOpenRender(int minor); ++extern int drmClose(int fd); ++extern drmVersionPtr drmGetVersion(int fd); ++extern drmVersionPtr drmGetLibVersion(int fd); ++extern int drmGetCap(int fd, uint64_t capability, uint64_t *value); ++extern void drmFreeVersion(drmVersionPtr); ++extern int drmGetMagic(int fd, drm_magic_t * magic); ++extern char *drmGetBusid(int fd); ++extern int drmGetInterruptFromBusID(int fd, int busnum, int devnum, ++ int funcnum); ++extern int drmGetMap(int fd, int idx, drm_handle_t *offset, ++ drmSize *size, drmMapType *type, ++ drmMapFlags *flags, drm_handle_t *handle, ++ int *mtrr); ++extern int drmGetClient(int fd, int idx, int *auth, int *pid, ++ int *uid, unsigned long *magic, ++ unsigned long *iocs); ++extern int drmGetStats(int fd, drmStatsT *stats); ++extern int drmSetInterfaceVersion(int fd, drmSetVersion *version); ++extern int drmCommandNone(int fd, unsigned long drmCommandIndex); ++extern int drmCommandRead(int fd, unsigned long drmCommandIndex, ++ void *data, unsigned long size); ++extern int drmCommandWrite(int fd, unsigned long drmCommandIndex, ++ void *data, unsigned long size); ++extern int drmCommandWriteRead(int fd, unsigned long drmCommandIndex, ++ void *data, unsigned long size); ++ ++/* General user-level programmer's API: X server (root) only */ ++extern void drmFreeBusid(const char *busid); ++extern int drmSetBusid(int fd, const char *busid); ++extern int drmAuthMagic(int fd, drm_magic_t magic); ++extern int drmAddMap(int fd, ++ drm_handle_t offset, ++ drmSize size, ++ drmMapType type, ++ drmMapFlags flags, ++ drm_handle_t * handle); ++extern int drmRmMap(int fd, drm_handle_t handle); ++extern int drmAddContextPrivateMapping(int fd, drm_context_t ctx_id, ++ drm_handle_t handle); ++ ++extern int drmAddBufs(int fd, int count, int size, ++ drmBufDescFlags flags, ++ int agp_offset); ++extern int drmMarkBufs(int fd, double low, double high); ++extern int drmCreateContext(int fd, drm_context_t * handle); ++extern int drmSetContextFlags(int fd, drm_context_t context, ++ drm_context_tFlags flags); ++extern int drmGetContextFlags(int fd, drm_context_t context, ++ drm_context_tFlagsPtr flags); ++extern int drmAddContextTag(int fd, drm_context_t context, void *tag); ++extern int drmDelContextTag(int fd, drm_context_t context); ++extern void *drmGetContextTag(int fd, drm_context_t context); ++extern drm_context_t * drmGetReservedContextList(int fd, int *count); ++extern void drmFreeReservedContextList(drm_context_t *); ++extern int drmSwitchToContext(int fd, drm_context_t context); ++extern int drmDestroyContext(int fd, drm_context_t handle); ++extern int drmCreateDrawable(int fd, drm_drawable_t * handle); ++extern int drmDestroyDrawable(int fd, drm_drawable_t handle); ++extern int drmUpdateDrawableInfo(int fd, drm_drawable_t handle, ++ drm_drawable_info_type_t type, ++ unsigned int num, void *data); ++extern int drmCtlInstHandler(int fd, int irq); ++extern int drmCtlUninstHandler(int fd); ++extern int drmSetClientCap(int fd, uint64_t capability, ++ uint64_t value); ++ ++extern int drmCrtcGetSequence(int fd, uint32_t crtcId, ++ uint64_t *sequence, uint64_t *ns); ++extern int drmCrtcQueueSequence(int fd, uint32_t crtcId, ++ uint32_t flags, uint64_t sequence, ++ uint64_t *sequence_queued, ++ uint64_t user_data); ++/* General user-level programmer's API: authenticated client and/or X */ ++extern int drmMap(int fd, ++ drm_handle_t handle, ++ drmSize size, ++ drmAddressPtr address); ++extern int drmUnmap(drmAddress address, drmSize size); ++extern drmBufInfoPtr drmGetBufInfo(int fd); ++extern drmBufMapPtr drmMapBufs(int fd); ++extern int drmUnmapBufs(drmBufMapPtr bufs); ++extern int drmDMA(int fd, drmDMAReqPtr request); ++extern int drmFreeBufs(int fd, int count, int *list); ++extern int drmGetLock(int fd, ++ drm_context_t context, ++ drmLockFlags flags); ++extern int drmUnlock(int fd, drm_context_t context); ++extern int drmFinish(int fd, int context, drmLockFlags flags); ++extern int drmGetContextPrivateMapping(int fd, drm_context_t ctx_id, ++ drm_handle_t * handle); ++ ++/* AGP/GART support: X server (root) only */ ++extern int drmAgpAcquire(int fd); ++extern int drmAgpRelease(int fd); ++extern int drmAgpEnable(int fd, unsigned long mode); ++extern int drmAgpAlloc(int fd, unsigned long size, ++ unsigned long type, unsigned long *address, ++ drm_handle_t *handle); ++extern int drmAgpFree(int fd, drm_handle_t handle); ++extern int drmAgpBind(int fd, drm_handle_t handle, ++ unsigned long offset); ++extern int drmAgpUnbind(int fd, drm_handle_t handle); ++ ++/* AGP/GART info: authenticated client and/or X */ ++extern int drmAgpVersionMajor(int fd); ++extern int drmAgpVersionMinor(int fd); ++extern unsigned long drmAgpGetMode(int fd); ++extern unsigned long drmAgpBase(int fd); /* Physical location */ ++extern unsigned long drmAgpSize(int fd); /* Bytes */ ++extern unsigned long drmAgpMemoryUsed(int fd); ++extern unsigned long drmAgpMemoryAvail(int fd); ++extern unsigned int drmAgpVendorId(int fd); ++extern unsigned int drmAgpDeviceId(int fd); ++ ++/* PCI scatter/gather support: X server (root) only */ ++extern int drmScatterGatherAlloc(int fd, unsigned long size, ++ drm_handle_t *handle); ++extern int drmScatterGatherFree(int fd, drm_handle_t handle); ++ ++extern int drmWaitVBlank(int fd, drmVBlankPtr vbl); ++ ++/* Support routines */ ++extern void drmSetServerInfo(drmServerInfoPtr info); ++extern int drmError(int err, const char *label); ++extern void *drmMalloc(int size); ++extern void drmFree(void *pt); ++ ++/* Hash table routines */ ++extern void *drmHashCreate(void); ++extern int drmHashDestroy(void *t); ++extern int drmHashLookup(void *t, unsigned long key, void **value); ++extern int drmHashInsert(void *t, unsigned long key, void *value); ++extern int drmHashDelete(void *t, unsigned long key); ++extern int drmHashFirst(void *t, unsigned long *key, void **value); ++extern int drmHashNext(void *t, unsigned long *key, void **value); ++ ++/* PRNG routines */ ++extern void *drmRandomCreate(unsigned long seed); ++extern int drmRandomDestroy(void *state); ++extern unsigned long drmRandom(void *state); ++extern double drmRandomDouble(void *state); ++ ++/* Skip list routines */ ++ ++extern void *drmSLCreate(void); ++extern int drmSLDestroy(void *l); ++extern int drmSLLookup(void *l, unsigned long key, void **value); ++extern int drmSLInsert(void *l, unsigned long key, void *value); ++extern int drmSLDelete(void *l, unsigned long key); ++extern int drmSLNext(void *l, unsigned long *key, void **value); ++extern int drmSLFirst(void *l, unsigned long *key, void **value); ++extern void drmSLDump(void *l); ++extern int drmSLLookupNeighbors(void *l, unsigned long key, ++ unsigned long *prev_key, void **prev_value, ++ unsigned long *next_key, void **next_value); ++ ++extern int drmOpenOnce(void *unused, const char *BusID, int *newlyopened); ++extern int drmOpenOnceWithType(const char *BusID, int *newlyopened, int type); ++extern void drmCloseOnce(int fd); ++extern void drmMsg(const char *format, ...) DRM_PRINTFLIKE(1, 2); ++ ++extern int drmSetMaster(int fd); ++extern int drmDropMaster(int fd); ++extern int drmIsMaster(int fd); ++ ++#define DRM_EVENT_CONTEXT_VERSION 4 ++ ++typedef struct _drmEventContext { ++ ++ /* This struct is versioned so we can add more pointers if we ++ * add more events. */ ++ int version; ++ ++ void (*vblank_handler)(int fd, ++ unsigned int sequence, ++ unsigned int tv_sec, ++ unsigned int tv_usec, ++ void *user_data); ++ ++ void (*page_flip_handler)(int fd, ++ unsigned int sequence, ++ unsigned int tv_sec, ++ unsigned int tv_usec, ++ void *user_data); ++ ++ void (*page_flip_handler2)(int fd, ++ unsigned int sequence, ++ unsigned int tv_sec, ++ unsigned int tv_usec, ++ unsigned int crtc_id, ++ void *user_data); ++ ++ void (*sequence_handler)(int fd, ++ uint64_t sequence, ++ uint64_t ns, ++ uint64_t user_data); ++} drmEventContext, *drmEventContextPtr; ++ ++extern int drmHandleEvent(int fd, drmEventContextPtr evctx); ++ ++extern char *drmGetDeviceNameFromFd(int fd); ++ ++/* Improved version of drmGetDeviceNameFromFd which attributes for any type of ++ * device/node - card, control or renderD. ++ */ ++extern char *drmGetDeviceNameFromFd2(int fd); ++extern int drmGetNodeTypeFromFd(int fd); ++ ++/* Convert between GEM handles and DMA-BUF file descriptors. ++ * ++ * Warning: since GEM handles are not reference-counted and are unique per ++ * DRM file description, the caller is expected to perform its own reference ++ * counting. drmPrimeFDToHandle is guaranteed to return the same handle for ++ * different FDs if they reference the same underlying buffer object. This ++ * could even be a buffer object originally created on the same DRM FD. ++ * ++ * When sharing a DRM FD with an API such as EGL or GBM, the caller must not ++ * use drmPrimeHandleToFD nor drmPrimeFDToHandle. A single user-space ++ * reference-counting implementation is necessary to avoid double-closing GEM ++ * handles. ++ * ++ * Two processes can't share the same DRM FD and both use it to create or ++ * import GEM handles, even when using a single user-space reference-counting ++ * implementation like GBM, because GBM doesn't share its state between ++ * processes. ++ */ ++extern int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags, int *prime_fd); ++extern int drmPrimeFDToHandle(int fd, int prime_fd, uint32_t *handle); ++ ++extern int drmCloseBufferHandle(int fd, uint32_t handle); ++ ++extern char *drmGetPrimaryDeviceNameFromFd(int fd); ++extern char *drmGetRenderDeviceNameFromFd(int fd); ++ ++#define DRM_BUS_PCI 0 ++#define DRM_BUS_USB 1 ++#define DRM_BUS_PLATFORM 2 ++#define DRM_BUS_HOST1X 3 ++ ++typedef struct _drmPciBusInfo { ++ uint16_t domain; ++ uint8_t bus; ++ uint8_t dev; ++ uint8_t func; ++} drmPciBusInfo, *drmPciBusInfoPtr; ++ ++typedef struct _drmPciDeviceInfo { ++ uint16_t vendor_id; ++ uint16_t device_id; ++ uint16_t subvendor_id; ++ uint16_t subdevice_id; ++ uint8_t revision_id; ++} drmPciDeviceInfo, *drmPciDeviceInfoPtr; ++ ++typedef struct _drmUsbBusInfo { ++ uint8_t bus; ++ uint8_t dev; ++} drmUsbBusInfo, *drmUsbBusInfoPtr; ++ ++typedef struct _drmUsbDeviceInfo { ++ uint16_t vendor; ++ uint16_t product; ++} drmUsbDeviceInfo, *drmUsbDeviceInfoPtr; ++ ++#define DRM_PLATFORM_DEVICE_NAME_LEN 512 ++ ++typedef struct _drmPlatformBusInfo { ++ char fullname[DRM_PLATFORM_DEVICE_NAME_LEN]; ++} drmPlatformBusInfo, *drmPlatformBusInfoPtr; ++ ++typedef struct _drmPlatformDeviceInfo { ++ char **compatible; /* NULL terminated list of compatible strings */ ++} drmPlatformDeviceInfo, *drmPlatformDeviceInfoPtr; ++ ++#define DRM_HOST1X_DEVICE_NAME_LEN 512 ++ ++typedef struct _drmHost1xBusInfo { ++ char fullname[DRM_HOST1X_DEVICE_NAME_LEN]; ++} drmHost1xBusInfo, *drmHost1xBusInfoPtr; ++ ++typedef struct _drmHost1xDeviceInfo { ++ char **compatible; /* NULL terminated list of compatible strings */ ++} drmHost1xDeviceInfo, *drmHost1xDeviceInfoPtr; ++ ++typedef struct _drmDevice { ++ char **nodes; /* DRM_NODE_MAX sized array */ ++ int available_nodes; /* DRM_NODE_* bitmask */ ++ int bustype; ++ union { ++ drmPciBusInfoPtr pci; ++ drmUsbBusInfoPtr usb; ++ drmPlatformBusInfoPtr platform; ++ drmHost1xBusInfoPtr host1x; ++ } businfo; ++ union { ++ drmPciDeviceInfoPtr pci; ++ drmUsbDeviceInfoPtr usb; ++ drmPlatformDeviceInfoPtr platform; ++ drmHost1xDeviceInfoPtr host1x; ++ } deviceinfo; ++} drmDevice, *drmDevicePtr; ++ ++extern int drmGetDevice(int fd, drmDevicePtr *device); ++extern void drmFreeDevice(drmDevicePtr *device); ++ ++extern int drmGetDevices(drmDevicePtr devices[], int max_devices); ++extern void drmFreeDevices(drmDevicePtr devices[], int count); ++ ++#define DRM_DEVICE_GET_PCI_REVISION (1 << 0) ++extern int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr *device); ++extern int drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices); ++ ++extern int drmGetDeviceFromDevId(dev_t dev_id, uint32_t flags, drmDevicePtr *device); ++ ++extern int drmDevicesEqual(drmDevicePtr a, drmDevicePtr b); ++ ++extern int drmSyncobjCreate(int fd, uint32_t flags, uint32_t *handle); ++extern int drmSyncobjDestroy(int fd, uint32_t handle); ++extern int drmSyncobjHandleToFD(int fd, uint32_t handle, int *obj_fd); ++extern int drmSyncobjFDToHandle(int fd, int obj_fd, uint32_t *handle); ++ ++extern int drmSyncobjImportSyncFile(int fd, uint32_t handle, int sync_file_fd); ++extern int drmSyncobjExportSyncFile(int fd, uint32_t handle, int *sync_file_fd); ++extern int drmSyncobjWait(int fd, uint32_t *handles, unsigned num_handles, ++ int64_t timeout_nsec, unsigned flags, ++ uint32_t *first_signaled); ++extern int drmSyncobjReset(int fd, const uint32_t *handles, uint32_t handle_count); ++extern int drmSyncobjSignal(int fd, const uint32_t *handles, uint32_t handle_count); ++extern int drmSyncobjTimelineSignal(int fd, const uint32_t *handles, ++ uint64_t *points, uint32_t handle_count); ++extern int drmSyncobjTimelineWait(int fd, uint32_t *handles, uint64_t *points, ++ unsigned num_handles, ++ int64_t timeout_nsec, unsigned flags, ++ uint32_t *first_signaled); ++extern int drmSyncobjQuery(int fd, uint32_t *handles, uint64_t *points, ++ uint32_t handle_count); ++extern int drmSyncobjQuery2(int fd, uint32_t *handles, uint64_t *points, ++ uint32_t handle_count, uint32_t flags); ++extern int drmSyncobjTransfer(int fd, ++ uint32_t dst_handle, uint64_t dst_point, ++ uint32_t src_handle, uint64_t src_point, ++ uint32_t flags); ++ ++extern char * ++drmGetFormatModifierVendor(uint64_t modifier); ++ ++extern char * ++drmGetFormatModifierName(uint64_t modifier); ++ ++#ifndef fourcc_mod_get_vendor ++#define fourcc_mod_get_vendor(modifier) \ ++ (((modifier) >> 56) & 0xff) ++#endif ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif +diff --git a/third_party/drm/libdrm/moz.build b/third_party/drm/libdrm/moz.build +new file mode 100644 +index 0000000..3b37b91 +--- /dev/null ++++ b/third_party/drm/libdrm/moz.build +@@ -0,0 +1,16 @@ ++# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- ++# vim: set filetype=python: ++# This Source Code Form is subject to the terms of the Mozilla Public ++# License, v. 2.0. If a copy of the MPL was not distributed with this ++# file, You can obtain one at http://mozilla.org/MPL/2.0/. ++ ++SOURCES += [ ++ 'mozdrm.cpp', ++] ++ ++if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": ++ CXXFLAGS += CONFIG['MOZ_GTK3_CFLAGS'] ++ ++LOCAL_INCLUDES += ['/third_party/drm'] ++ ++FINAL_LIBRARY = 'xul' +diff --git a/third_party/drm/libdrm/mozdrm.cpp b/third_party/drm/libdrm/mozdrm.cpp +new file mode 100644 +index 0000000..b2fb59b +--- /dev/null ++++ b/third_party/drm/libdrm/mozdrm.cpp +@@ -0,0 +1,66 @@ ++/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* vim:expandtab:shiftwidth=4:tabstop=4: ++ */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#include "mozilla/Types.h" ++#include "prlink.h" ++ ++#include ++ ++#define GET_FUNC(func, lib) \ ++ func##_fn = \ ++ (decltype(func##_fn))PR_FindFunctionSymbol(lib, #func) \ ++ ++#define IS_FUNC_LOADED(func) \ ++ (func != nullptr) \ ++ ++static int (*drmGetDevices2_fn)(uint32_t flags, drmDevicePtr devices[], int max_devices); ++static void (*drmFreeDevices_fn)(drmDevicePtr devices[], int count); ++ ++bool IsDRMLibraryLoaded() { ++ static bool isLoaded = ++ (IS_FUNC_LOADED(drmGetDevices2_fn) && ++ IS_FUNC_LOADED(drmFreeDevices_fn)); ++ ++ return isLoaded; ++} ++ ++bool LoadDRMLibrary() { ++ static PRLibrary* drmLib = nullptr; ++ static bool drmInitialized = false; ++ ++ //TODO Thread safe ++ if (!drmInitialized) { ++ drmInitialized = true; ++ drmLib = PR_LoadLibrary("libdrm.so.2"); ++ if (!drmLib) { ++ return false; ++ } ++ ++ GET_FUNC(drmGetDevices2, drmLib); ++ GET_FUNC(drmFreeDevices, drmLib); ++ } ++ ++ return IsDRMLibraryLoaded(); ++} ++ ++int ++drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices) ++{ ++ if (!LoadDRMLibrary()) { ++ return 0; ++ } ++ return drmGetDevices2_fn(flags, devices, max_devices); ++} ++ ++void ++drmFreeDevices(drmDevicePtr devices[], int count) ++{ ++ if (!LoadDRMLibrary()) { ++ return; ++ } ++ return drmFreeDevices_fn(devices, count); ++} +diff --git a/third_party/gbm/README b/third_party/gbm/README +new file mode 100644 +index 0000000..4b6e2e8 +--- /dev/null ++++ b/third_party/gbm/README +@@ -0,0 +1,4 @@ ++Libgbm is a gbm library wrapper needed to build and run Firefox with ++Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/gbm). ++ ++libgbm directory stores headers of libgbm needed for build only. +diff --git a/third_party/gbm/gbm/gbm.h b/third_party/gbm/gbm/gbm.h +new file mode 100644 +index 0000000..a963ed7 +--- /dev/null ++++ b/third_party/gbm/gbm/gbm.h +@@ -0,0 +1,452 @@ ++/* ++ * Copyright © 2011 Intel Corporation ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ++ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++ * DEALINGS IN THE SOFTWARE. ++ * ++ * Authors: ++ * Benjamin Franzke ++ */ ++ ++#ifndef _GBM_H_ ++#define _GBM_H_ ++ ++#define __GBM__ 1 ++ ++#include ++#include ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ ++/** ++ * \file gbm.h ++ * \brief Generic Buffer Manager ++ */ ++ ++struct gbm_device; ++struct gbm_bo; ++struct gbm_surface; ++ ++/** ++ * \mainpage The Generic Buffer Manager ++ * ++ * This module provides an abstraction that the caller can use to request a ++ * buffer from the underlying memory management system for the platform. ++ * ++ * This allows the creation of portable code whilst still allowing access to ++ * the underlying memory manager. ++ */ ++ ++/** ++ * Abstraction representing the handle to a buffer allocated by the ++ * manager ++ */ ++union gbm_bo_handle { ++ void *ptr; ++ int32_t s32; ++ uint32_t u32; ++ int64_t s64; ++ uint64_t u64; ++}; ++ ++/** Format of the allocated buffer */ ++enum gbm_bo_format { ++ /** RGB with 8 bits per channel in a 32 bit value */ ++ GBM_BO_FORMAT_XRGB8888, ++ /** ARGB with 8 bits per channel in a 32 bit value */ ++ GBM_BO_FORMAT_ARGB8888 ++}; ++ ++ ++/** ++ * The FourCC format codes are taken from the drm_fourcc.h definition, and ++ * re-namespaced. New GBM formats must not be added, unless they are ++ * identical ports from drm_fourcc. ++ */ ++#define __gbm_fourcc_code(a,b,c,d) ((uint32_t)(a) | ((uint32_t)(b) << 8) | \ ++ ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24)) ++ ++#define GBM_FORMAT_BIG_ENDIAN (1<<31) /* format is big endian instead of little endian */ ++ ++/* color index */ ++#define GBM_FORMAT_C8 __gbm_fourcc_code('C', '8', ' ', ' ') /* [7:0] C */ ++ ++/* 8 bpp Red */ ++#define GBM_FORMAT_R8 __gbm_fourcc_code('R', '8', ' ', ' ') /* [7:0] R */ ++ ++/* 16 bpp Red */ ++#define GBM_FORMAT_R16 __gbm_fourcc_code('R', '1', '6', ' ') /* [15:0] R little endian */ ++ ++/* 16 bpp RG */ ++#define GBM_FORMAT_GR88 __gbm_fourcc_code('G', 'R', '8', '8') /* [15:0] G:R 8:8 little endian */ ++ ++/* 8 bpp RGB */ ++#define GBM_FORMAT_RGB332 __gbm_fourcc_code('R', 'G', 'B', '8') /* [7:0] R:G:B 3:3:2 */ ++#define GBM_FORMAT_BGR233 __gbm_fourcc_code('B', 'G', 'R', '8') /* [7:0] B:G:R 2:3:3 */ ++ ++/* 16 bpp RGB */ ++#define GBM_FORMAT_XRGB4444 __gbm_fourcc_code('X', 'R', '1', '2') /* [15:0] x:R:G:B 4:4:4:4 little endian */ ++#define GBM_FORMAT_XBGR4444 __gbm_fourcc_code('X', 'B', '1', '2') /* [15:0] x:B:G:R 4:4:4:4 little endian */ ++#define GBM_FORMAT_RGBX4444 __gbm_fourcc_code('R', 'X', '1', '2') /* [15:0] R:G:B:x 4:4:4:4 little endian */ ++#define GBM_FORMAT_BGRX4444 __gbm_fourcc_code('B', 'X', '1', '2') /* [15:0] B:G:R:x 4:4:4:4 little endian */ ++ ++#define GBM_FORMAT_ARGB4444 __gbm_fourcc_code('A', 'R', '1', '2') /* [15:0] A:R:G:B 4:4:4:4 little endian */ ++#define GBM_FORMAT_ABGR4444 __gbm_fourcc_code('A', 'B', '1', '2') /* [15:0] A:B:G:R 4:4:4:4 little endian */ ++#define GBM_FORMAT_RGBA4444 __gbm_fourcc_code('R', 'A', '1', '2') /* [15:0] R:G:B:A 4:4:4:4 little endian */ ++#define GBM_FORMAT_BGRA4444 __gbm_fourcc_code('B', 'A', '1', '2') /* [15:0] B:G:R:A 4:4:4:4 little endian */ ++ ++#define GBM_FORMAT_XRGB1555 __gbm_fourcc_code('X', 'R', '1', '5') /* [15:0] x:R:G:B 1:5:5:5 little endian */ ++#define GBM_FORMAT_XBGR1555 __gbm_fourcc_code('X', 'B', '1', '5') /* [15:0] x:B:G:R 1:5:5:5 little endian */ ++#define GBM_FORMAT_RGBX5551 __gbm_fourcc_code('R', 'X', '1', '5') /* [15:0] R:G:B:x 5:5:5:1 little endian */ ++#define GBM_FORMAT_BGRX5551 __gbm_fourcc_code('B', 'X', '1', '5') /* [15:0] B:G:R:x 5:5:5:1 little endian */ ++ ++#define GBM_FORMAT_ARGB1555 __gbm_fourcc_code('A', 'R', '1', '5') /* [15:0] A:R:G:B 1:5:5:5 little endian */ ++#define GBM_FORMAT_ABGR1555 __gbm_fourcc_code('A', 'B', '1', '5') /* [15:0] A:B:G:R 1:5:5:5 little endian */ ++#define GBM_FORMAT_RGBA5551 __gbm_fourcc_code('R', 'A', '1', '5') /* [15:0] R:G:B:A 5:5:5:1 little endian */ ++#define GBM_FORMAT_BGRA5551 __gbm_fourcc_code('B', 'A', '1', '5') /* [15:0] B:G:R:A 5:5:5:1 little endian */ ++ ++#define GBM_FORMAT_RGB565 __gbm_fourcc_code('R', 'G', '1', '6') /* [15:0] R:G:B 5:6:5 little endian */ ++#define GBM_FORMAT_BGR565 __gbm_fourcc_code('B', 'G', '1', '6') /* [15:0] B:G:R 5:6:5 little endian */ ++ ++/* 24 bpp RGB */ ++#define GBM_FORMAT_RGB888 __gbm_fourcc_code('R', 'G', '2', '4') /* [23:0] R:G:B little endian */ ++#define GBM_FORMAT_BGR888 __gbm_fourcc_code('B', 'G', '2', '4') /* [23:0] B:G:R little endian */ ++ ++/* 32 bpp RGB */ ++#define GBM_FORMAT_XRGB8888 __gbm_fourcc_code('X', 'R', '2', '4') /* [31:0] x:R:G:B 8:8:8:8 little endian */ ++#define GBM_FORMAT_XBGR8888 __gbm_fourcc_code('X', 'B', '2', '4') /* [31:0] x:B:G:R 8:8:8:8 little endian */ ++#define GBM_FORMAT_RGBX8888 __gbm_fourcc_code('R', 'X', '2', '4') /* [31:0] R:G:B:x 8:8:8:8 little endian */ ++#define GBM_FORMAT_BGRX8888 __gbm_fourcc_code('B', 'X', '2', '4') /* [31:0] B:G:R:x 8:8:8:8 little endian */ ++ ++#define GBM_FORMAT_ARGB8888 __gbm_fourcc_code('A', 'R', '2', '4') /* [31:0] A:R:G:B 8:8:8:8 little endian */ ++#define GBM_FORMAT_ABGR8888 __gbm_fourcc_code('A', 'B', '2', '4') /* [31:0] A:B:G:R 8:8:8:8 little endian */ ++#define GBM_FORMAT_RGBA8888 __gbm_fourcc_code('R', 'A', '2', '4') /* [31:0] R:G:B:A 8:8:8:8 little endian */ ++#define GBM_FORMAT_BGRA8888 __gbm_fourcc_code('B', 'A', '2', '4') /* [31:0] B:G:R:A 8:8:8:8 little endian */ ++ ++#define GBM_FORMAT_XRGB2101010 __gbm_fourcc_code('X', 'R', '3', '0') /* [31:0] x:R:G:B 2:10:10:10 little endian */ ++#define GBM_FORMAT_XBGR2101010 __gbm_fourcc_code('X', 'B', '3', '0') /* [31:0] x:B:G:R 2:10:10:10 little endian */ ++#define GBM_FORMAT_RGBX1010102 __gbm_fourcc_code('R', 'X', '3', '0') /* [31:0] R:G:B:x 10:10:10:2 little endian */ ++#define GBM_FORMAT_BGRX1010102 __gbm_fourcc_code('B', 'X', '3', '0') /* [31:0] B:G:R:x 10:10:10:2 little endian */ ++ ++#define GBM_FORMAT_ARGB2101010 __gbm_fourcc_code('A', 'R', '3', '0') /* [31:0] A:R:G:B 2:10:10:10 little endian */ ++#define GBM_FORMAT_ABGR2101010 __gbm_fourcc_code('A', 'B', '3', '0') /* [31:0] A:B:G:R 2:10:10:10 little endian */ ++#define GBM_FORMAT_RGBA1010102 __gbm_fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */ ++#define GBM_FORMAT_BGRA1010102 __gbm_fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */ ++ ++/* ++ * Floating point 64bpp RGB ++ * IEEE 754-2008 binary16 half-precision float ++ * [15:0] sign:exponent:mantissa 1:5:10 ++ */ ++#define GBM_FORMAT_XBGR16161616F __gbm_fourcc_code('X', 'B', '4', 'H') /* [63:0] x:B:G:R 16:16:16:16 little endian */ ++ ++#define GBM_FORMAT_ABGR16161616F __gbm_fourcc_code('A', 'B', '4', 'H') /* [63:0] A:B:G:R 16:16:16:16 little endian */ ++ ++/* packed YCbCr */ ++#define GBM_FORMAT_YUYV __gbm_fourcc_code('Y', 'U', 'Y', 'V') /* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */ ++#define GBM_FORMAT_YVYU __gbm_fourcc_code('Y', 'V', 'Y', 'U') /* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */ ++#define GBM_FORMAT_UYVY __gbm_fourcc_code('U', 'Y', 'V', 'Y') /* [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian */ ++#define GBM_FORMAT_VYUY __gbm_fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */ ++ ++#define GBM_FORMAT_AYUV __gbm_fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */ ++ ++/* ++ * 2 plane YCbCr ++ * index 0 = Y plane, [7:0] Y ++ * index 1 = Cr:Cb plane, [15:0] Cr:Cb little endian ++ * or ++ * index 1 = Cb:Cr plane, [15:0] Cb:Cr little endian ++ */ ++#define GBM_FORMAT_NV12 __gbm_fourcc_code('N', 'V', '1', '2') /* 2x2 subsampled Cr:Cb plane */ ++#define GBM_FORMAT_NV21 __gbm_fourcc_code('N', 'V', '2', '1') /* 2x2 subsampled Cb:Cr plane */ ++#define GBM_FORMAT_NV16 __gbm_fourcc_code('N', 'V', '1', '6') /* 2x1 subsampled Cr:Cb plane */ ++#define GBM_FORMAT_NV61 __gbm_fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */ ++ ++/* ++ * 3 plane YCbCr ++ * index 0: Y plane, [7:0] Y ++ * index 1: Cb plane, [7:0] Cb ++ * index 2: Cr plane, [7:0] Cr ++ * or ++ * index 1: Cr plane, [7:0] Cr ++ * index 2: Cb plane, [7:0] Cb ++ */ ++#define GBM_FORMAT_YUV410 __gbm_fourcc_code('Y', 'U', 'V', '9') /* 4x4 subsampled Cb (1) and Cr (2) planes */ ++#define GBM_FORMAT_YVU410 __gbm_fourcc_code('Y', 'V', 'U', '9') /* 4x4 subsampled Cr (1) and Cb (2) planes */ ++#define GBM_FORMAT_YUV411 __gbm_fourcc_code('Y', 'U', '1', '1') /* 4x1 subsampled Cb (1) and Cr (2) planes */ ++#define GBM_FORMAT_YVU411 __gbm_fourcc_code('Y', 'V', '1', '1') /* 4x1 subsampled Cr (1) and Cb (2) planes */ ++#define GBM_FORMAT_YUV420 __gbm_fourcc_code('Y', 'U', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes */ ++#define GBM_FORMAT_YVU420 __gbm_fourcc_code('Y', 'V', '1', '2') /* 2x2 subsampled Cr (1) and Cb (2) planes */ ++#define GBM_FORMAT_YUV422 __gbm_fourcc_code('Y', 'U', '1', '6') /* 2x1 subsampled Cb (1) and Cr (2) planes */ ++#define GBM_FORMAT_YVU422 __gbm_fourcc_code('Y', 'V', '1', '6') /* 2x1 subsampled Cr (1) and Cb (2) planes */ ++#define GBM_FORMAT_YUV444 __gbm_fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */ ++#define GBM_FORMAT_YVU444 __gbm_fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */ ++ ++struct gbm_format_name_desc { ++ char name[5]; ++}; ++ ++/** ++ * Flags to indicate the intended use for the buffer - these are passed into ++ * gbm_bo_create(). The caller must set the union of all the flags that are ++ * appropriate ++ * ++ * \sa Use gbm_device_is_format_supported() to check if the combination of format ++ * and use flags are supported ++ */ ++enum gbm_bo_flags { ++ /** ++ * Buffer is going to be presented to the screen using an API such as KMS ++ */ ++ GBM_BO_USE_SCANOUT = (1 << 0), ++ /** ++ * Buffer is going to be used as cursor ++ */ ++ GBM_BO_USE_CURSOR = (1 << 1), ++ /** ++ * Deprecated ++ */ ++ GBM_BO_USE_CURSOR_64X64 = GBM_BO_USE_CURSOR, ++ /** ++ * Buffer is to be used for rendering - for example it is going to be used ++ * as the storage for a color buffer ++ */ ++ GBM_BO_USE_RENDERING = (1 << 2), ++ /** ++ * Buffer can be used for gbm_bo_write. This is guaranteed to work ++ * with GBM_BO_USE_CURSOR, but may not work for other combinations. ++ */ ++ GBM_BO_USE_WRITE = (1 << 3), ++ /** ++ * Buffer is linear, i.e. not tiled. ++ */ ++ GBM_BO_USE_LINEAR = (1 << 4), ++ /** ++ * Buffer is protected, i.e. encrypted and not readable by CPU or any ++ * other non-secure / non-trusted components nor by non-trusted OpenGL, ++ * OpenCL, and Vulkan applications. ++ */ ++ GBM_BO_USE_PROTECTED = (1 << 5), ++}; ++ ++int ++gbm_device_get_fd(struct gbm_device *gbm); ++ ++const char * ++gbm_device_get_backend_name(struct gbm_device *gbm); ++ ++int ++gbm_device_is_format_supported(struct gbm_device *gbm, ++ uint32_t format, uint32_t flags); ++ ++int ++gbm_device_get_format_modifier_plane_count(struct gbm_device *gbm, ++ uint32_t format, ++ uint64_t modifier); ++ ++void ++gbm_device_destroy(struct gbm_device *gbm); ++ ++struct gbm_device * ++gbm_create_device(int fd); ++ ++struct gbm_bo * ++gbm_bo_create(struct gbm_device *gbm, ++ uint32_t width, uint32_t height, ++ uint32_t format, uint32_t flags); ++ ++struct gbm_bo * ++gbm_bo_create_with_modifiers(struct gbm_device *gbm, ++ uint32_t width, uint32_t height, ++ uint32_t format, ++ const uint64_t *modifiers, ++ const unsigned int count); ++ ++struct gbm_bo * ++gbm_bo_create_with_modifiers2(struct gbm_device *gbm, ++ uint32_t width, uint32_t height, ++ uint32_t format, ++ const uint64_t *modifiers, ++ const unsigned int count, ++ uint32_t flags); ++ ++#define GBM_BO_IMPORT_WL_BUFFER 0x5501 ++#define GBM_BO_IMPORT_EGL_IMAGE 0x5502 ++#define GBM_BO_IMPORT_FD 0x5503 ++#define GBM_BO_IMPORT_FD_MODIFIER 0x5504 ++ ++struct gbm_import_fd_data { ++ int fd; ++ uint32_t width; ++ uint32_t height; ++ uint32_t stride; ++ uint32_t format; ++}; ++ ++#define GBM_MAX_PLANES 4 ++ ++struct gbm_import_fd_modifier_data { ++ uint32_t width; ++ uint32_t height; ++ uint32_t format; ++ uint32_t num_fds; ++ int fds[GBM_MAX_PLANES]; ++ int strides[GBM_MAX_PLANES]; ++ int offsets[GBM_MAX_PLANES]; ++ uint64_t modifier; ++}; ++ ++struct gbm_bo * ++gbm_bo_import(struct gbm_device *gbm, uint32_t type, ++ void *buffer, uint32_t flags); ++ ++/** ++ * Flags to indicate the type of mapping for the buffer - these are ++ * passed into gbm_bo_map(). The caller must set the union of all the ++ * flags that are appropriate. ++ * ++ * These flags are independent of the GBM_BO_USE_* creation flags. However, ++ * mapping the buffer may require copying to/from a staging buffer. ++ * ++ * See also: pipe_map_flags ++ */ ++enum gbm_bo_transfer_flags { ++ /** ++ * Buffer contents read back (or accessed directly) at transfer ++ * create time. ++ */ ++ GBM_BO_TRANSFER_READ = (1 << 0), ++ /** ++ * Buffer contents will be written back at unmap time ++ * (or modified as a result of being accessed directly). ++ */ ++ GBM_BO_TRANSFER_WRITE = (1 << 1), ++ /** ++ * Read/modify/write ++ */ ++ GBM_BO_TRANSFER_READ_WRITE = (GBM_BO_TRANSFER_READ | GBM_BO_TRANSFER_WRITE), ++}; ++ ++void * ++gbm_bo_map(struct gbm_bo *bo, ++ uint32_t x, uint32_t y, uint32_t width, uint32_t height, ++ uint32_t flags, uint32_t *stride, void **map_data); ++ ++void ++gbm_bo_unmap(struct gbm_bo *bo, void *map_data); ++ ++uint32_t ++gbm_bo_get_width(struct gbm_bo *bo); ++ ++uint32_t ++gbm_bo_get_height(struct gbm_bo *bo); ++ ++uint32_t ++gbm_bo_get_stride(struct gbm_bo *bo); ++ ++uint32_t ++gbm_bo_get_stride_for_plane(struct gbm_bo *bo, int plane); ++ ++uint32_t ++gbm_bo_get_format(struct gbm_bo *bo); ++ ++uint32_t ++gbm_bo_get_bpp(struct gbm_bo *bo); ++ ++uint32_t ++gbm_bo_get_offset(struct gbm_bo *bo, int plane); ++ ++struct gbm_device * ++gbm_bo_get_device(struct gbm_bo *bo); ++ ++union gbm_bo_handle ++gbm_bo_get_handle(struct gbm_bo *bo); ++ ++int ++gbm_bo_get_fd(struct gbm_bo *bo); ++ ++uint64_t ++gbm_bo_get_modifier(struct gbm_bo *bo); ++ ++int ++gbm_bo_get_plane_count(struct gbm_bo *bo); ++ ++union gbm_bo_handle ++gbm_bo_get_handle_for_plane(struct gbm_bo *bo, int plane); ++ ++int ++gbm_bo_get_fd_for_plane(struct gbm_bo *bo, int plane); ++ ++int ++gbm_bo_write(struct gbm_bo *bo, const void *buf, size_t count); ++ ++void ++gbm_bo_set_user_data(struct gbm_bo *bo, void *data, ++ void (*destroy_user_data)(struct gbm_bo *, void *)); ++ ++void * ++gbm_bo_get_user_data(struct gbm_bo *bo); ++ ++void ++gbm_bo_destroy(struct gbm_bo *bo); ++ ++struct gbm_surface * ++gbm_surface_create(struct gbm_device *gbm, ++ uint32_t width, uint32_t height, ++ uint32_t format, uint32_t flags); ++ ++struct gbm_surface * ++gbm_surface_create_with_modifiers(struct gbm_device *gbm, ++ uint32_t width, uint32_t height, ++ uint32_t format, ++ const uint64_t *modifiers, ++ const unsigned int count); ++ ++struct gbm_surface * ++gbm_surface_create_with_modifiers2(struct gbm_device *gbm, ++ uint32_t width, uint32_t height, ++ uint32_t format, ++ const uint64_t *modifiers, ++ const unsigned int count, ++ uint32_t flags); ++ ++struct gbm_bo * ++gbm_surface_lock_front_buffer(struct gbm_surface *surface); ++ ++void ++gbm_surface_release_buffer(struct gbm_surface *surface, struct gbm_bo *bo); ++ ++int ++gbm_surface_has_free_buffers(struct gbm_surface *surface); ++ ++void ++gbm_surface_destroy(struct gbm_surface *surface); ++ ++char * ++gbm_format_get_name(uint32_t gbm_format, struct gbm_format_name_desc *desc); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff --git a/third_party/gbm/libgbm/moz.build b/third_party/gbm/libgbm/moz.build +new file mode 100644 +index 0000000..0953d2f +--- /dev/null ++++ b/third_party/gbm/libgbm/moz.build +@@ -0,0 +1,16 @@ ++# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- ++# vim: set filetype=python: ++# This Source Code Form is subject to the terms of the Mozilla Public ++# License, v. 2.0. If a copy of the MPL was not distributed with this ++# file, You can obtain one at http://mozilla.org/MPL/2.0/. ++ ++SOURCES += [ ++ 'mozgbm.cpp', ++] ++ ++if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": ++ CXXFLAGS += CONFIG['MOZ_GTK3_CFLAGS'] ++ ++LOCAL_INCLUDES += ['/third_party/gbm'] ++ ++FINAL_LIBRARY = 'xul' +diff --git a/third_party/gbm/libgbm/mozgbm.cpp b/third_party/gbm/libgbm/mozgbm.cpp +new file mode 100644 +index 0000000..bc024a1 +--- /dev/null ++++ b/third_party/gbm/libgbm/mozgbm.cpp +@@ -0,0 +1,66 @@ ++/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* vim:expandtab:shiftwidth=4:tabstop=4: ++ */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#include "mozilla/Types.h" ++#include "prlink.h" ++ ++#include ++ ++#define GET_FUNC(func, lib) \ ++ func##_fn = \ ++ (decltype(func##_fn))PR_FindFunctionSymbol(lib, #func) \ ++ ++#define IS_FUNC_LOADED(func) \ ++ (func != nullptr) \ ++ ++static struct gbm_device * (*gbm_create_device_fn)(int fd); ++static void (*gbm_device_destroy_fn)(struct gbm_device* gbm); ++ ++bool IsGBMLibraryLoaded() { ++ static bool isLoaded = ++ (IS_FUNC_LOADED(gbm_create_device_fn) && ++ IS_FUNC_LOADED(gbm_device_destroy_fn)); ++ ++ return isLoaded; ++} ++ ++bool LoadGBMLibrary() { ++ static PRLibrary* gbmLib = nullptr; ++ static bool gbmInitialized = false; ++ ++ //TODO Thread safe ++ if (!gbmInitialized) { ++ gbmInitialized = true; ++ gbmLib = PR_LoadLibrary("libgbm.so.1"); ++ if (!gbmLib) { ++ return false; ++ } ++ ++ GET_FUNC(gbm_create_device, gbmLib); ++ GET_FUNC(gbm_device_destroy, gbmLib); ++ } ++ ++ return IsGBMLibraryLoaded(); ++} ++ ++struct gbm_device * ++gbm_create_device(int fd) ++{ ++ if (!LoadGBMLibrary()) { ++ return nullptr; ++ } ++ return gbm_create_device_fn(fd); ++} ++ ++void ++gbm_device_destroy(struct gbm_device* gbm) ++{ ++ if (!LoadGBMLibrary()) { ++ return; ++ } ++ return gbm_device_destroy_fn(gbm); ++} +diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build +index a5cf923..99cabbf 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build ++++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build +@@ -77,6 +77,8 @@ if CONFIG["OS_TARGET"] == "Darwin": + LOCAL_INCLUDES += [ + "/media/libyuv/libyuv/include/", + "/media/libyuv/libyuv/include/", ++ "/third_party/drm/", ++ "/third_party/gbm/", + "/third_party/pipewire/" + ] + +@@ -108,7 +110,8 @@ if CONFIG["OS_TARGET"] == "Linux": + LOCAL_INCLUDES += [ + "/media/libyuv/libyuv/include/", + "/media/libyuv/libyuv/include/", +- "/third_party/pipewire/", ++ "/third_party/drm/", ++ "/third_party/gbm/", + "/third_party/pipewire/" + ] + +@@ -126,15 +129,18 @@ if CONFIG["OS_TARGET"] == "Linux": + ] + + SOURCES += [ +- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" ++ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" + ] + + UNIFIED_SOURCES += [ + "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc", +- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_x11.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/shared_x_display.cc", +- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_x11.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/window_finder_x11.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/window_list_utils.cc", +@@ -162,6 +168,8 @@ if CONFIG["OS_TARGET"] == "OpenBSD": + + LOCAL_INCLUDES += [ + "/media/libyuv/libyuv/include/", ++ "/third_party/drm/", ++ "/third_party/gbm/", + "/third_party/pipewire/" + ] + +@@ -177,15 +185,18 @@ if CONFIG["OS_TARGET"] == "OpenBSD": + ] + + SOURCES += [ +- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" ++ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" + ] + + UNIFIED_SOURCES += [ + "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc", +- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_x11.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/shared_x_display.cc", +- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_x11.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/window_finder_x11.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/window_list_utils.cc", +@@ -227,6 +238,7 @@ if CONFIG["OS_TARGET"] == "WINNT": + LOCAL_INCLUDES += [ + "/media/libyuv/libyuv/include/", + "/media/libyuv/libyuv/include/", ++ "/third_party/drm/" + "/third_party/pipewire/" + ] + +diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc +index c89896d..c8ef822 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc +@@ -14,6 +14,9 @@ + #elif defined(WEBRTC_WIN) + #include "modules/desktop_capture/win/full_screen_win_application_handler.h" + #endif ++#if defined(WEBRTC_USE_PIPEWIRE) ++#include "modules/desktop_capture/linux/shared_screencast_stream.h" ++#endif + + namespace webrtc { + +@@ -35,6 +38,9 @@ DesktopCaptureOptions DesktopCaptureOptions::CreateDefault() { + #if defined(WEBRTC_USE_X11) + result.set_x_display(SharedXDisplay::CreateDefault()); + #endif ++#if defined(WEBRTC_USE_PIPEWIRE) ++ result.set_screencast_stream(SharedScreenCastStream::CreateDefault()); ++#endif + #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) + result.set_configuration_monitor(new DesktopConfigurationMonitor()); + result.set_full_screen_window_detector( +diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h +index ee0dd3a..ac56c8c 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h ++++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h +@@ -17,6 +17,10 @@ + #include "modules/desktop_capture/linux/shared_x_display.h" + #endif + ++#if defined(WEBRTC_USE_PIPEWIRE) ++#include "modules/desktop_capture/linux/shared_screencast_stream.h" ++#endif ++ + #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) + #include "modules/desktop_capture/mac/desktop_configuration_monitor.h" + #endif +@@ -149,13 +153,26 @@ class RTC_EXPORT DesktopCaptureOptions { + #if defined(WEBRTC_USE_PIPEWIRE) + bool allow_pipewire() const { return allow_pipewire_; } + void set_allow_pipewire(bool allow) { allow_pipewire_ = allow; } ++ ++ const rtc::scoped_refptr& screencast_stream() const { ++ return screencast_stream_; ++ } ++ void set_screencast_stream( ++ rtc::scoped_refptr stream) { ++ screencast_stream_ = stream; ++ } + #endif + + private: + #if defined(WEBRTC_USE_X11) + rtc::scoped_refptr x_display_; + #endif +- ++#if defined(WEBRTC_USE_PIPEWIRE) ++ // An instance of shared PipeWire ScreenCast stream we share between ++ // BaseCapturerPipeWire and MouseCursorMonitorPipeWire as cursor information ++ // is sent together with screen content. ++ rtc::scoped_refptr screencast_stream_; ++#endif + #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) + rtc::scoped_refptr configuration_monitor_; + bool allow_iosurface_ = false; +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc +index 2fd3b1a..e4685fc 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc +@@ -10,937 +10,67 @@ + + #include "modules/desktop_capture/linux/base_capturer_pipewire.h" + +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-#include "absl/memory/memory.h" + #include "modules/desktop_capture/desktop_capture_options.h" + #include "modules/desktop_capture/desktop_capturer.h" + #include "rtc_base/checks.h" + #include "rtc_base/logging.h" + +-#if defined(WEBRTC_DLOPEN_PIPEWIRE) +-#include "modules/desktop_capture/linux/pipewire_stubs.h" +- +-using modules_desktop_capture_linux::InitializeStubs; +-using modules_desktop_capture_linux::kModulePipewire; +-using modules_desktop_capture_linux::StubPathMap; +-#endif // defined(WEBRTC_DLOPEN_PIPEWIRE) +- + namespace webrtc { + +-const char kDesktopBusName[] = "org.freedesktop.portal.Desktop"; +-const char kDesktopObjectPath[] = "/org/freedesktop/portal/desktop"; +-const char kDesktopRequestObjectPath[] = +- "/org/freedesktop/portal/desktop/request"; +-const char kSessionInterfaceName[] = "org.freedesktop.portal.Session"; +-const char kRequestInterfaceName[] = "org.freedesktop.portal.Request"; +-const char kScreenCastInterfaceName[] = "org.freedesktop.portal.ScreenCast"; +- +-const int kBytesPerPixel = 4; +- +-#if defined(WEBRTC_DLOPEN_PIPEWIRE) +-const char kPipeWireLib[] = "libpipewire-0.2.so.1"; +-#endif +- +-// static +-struct dma_buf_sync { +- uint64_t flags; +-}; +-#define DMA_BUF_SYNC_READ (1 << 0) +-#define DMA_BUF_SYNC_START (0 << 2) +-#define DMA_BUF_SYNC_END (1 << 2) +-#define DMA_BUF_BASE 'b' +-#define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync) +- +-static void SyncDmaBuf(int fd, uint64_t start_or_end) { +- struct dma_buf_sync sync = { 0 }; +- +- sync.flags = start_or_end | DMA_BUF_SYNC_READ; +- +- while(true) { +- int ret; +- ret = ioctl (fd, DMA_BUF_IOCTL_SYNC, &sync); +- if (ret == -1 && errno == EINTR) { +- continue; +- } else if (ret == -1) { +- RTC_LOG(LS_ERROR) << "Failed to synchronize DMA buffer: " << g_strerror(errno); +- break; +- } else { +- break; +- } +- } +-} +- +-// static +-void BaseCapturerPipeWire::OnCoreError(void *data, +- uint32_t id, +- int seq, +- int res, +- const char *message) { +- RTC_LOG(LS_ERROR) << "core error: " << message; +-} +- +-// static +-void BaseCapturerPipeWire::OnStreamStateChanged(void* data, +- pw_stream_state old_state, +- pw_stream_state state, +- const char* error_message) { +- BaseCapturerPipeWire* that = static_cast(data); +- RTC_DCHECK(that); +- +- switch (state) { +- case PW_STREAM_STATE_ERROR: +- RTC_LOG(LS_ERROR) << "PipeWire stream state error: " << error_message; +- break; +- case PW_STREAM_STATE_PAUSED: +- case PW_STREAM_STATE_STREAMING: +- case PW_STREAM_STATE_UNCONNECTED: +- case PW_STREAM_STATE_CONNECTING: +- break; +- } ++BaseCapturerPipeWire::BaseCapturerPipeWire(const DesktopCaptureOptions& options) ++ : options_(options) { ++ screencast_portal_ = std::make_unique( ++ ScreenCastPortal::CaptureSourceType::kAnyScreenContent, this); + } + +-// static +-void BaseCapturerPipeWire::OnStreamParamChanged(void *data, uint32_t id, +- const struct spa_pod *format) { +- BaseCapturerPipeWire* that = static_cast(data); +- RTC_DCHECK(that); +- +- RTC_LOG(LS_INFO) << "PipeWire stream param changed."; +- +- if (!format || id != SPA_PARAM_Format) { +- return; +- } +- +- spa_format_video_raw_parse(format, &that->spa_video_format_); +- +- auto width = that->spa_video_format_.size.width; +- auto height = that->spa_video_format_.size.height; +- // In order to be able to build in the non unified environment kBytesPerPixel +- // must be fully qualified, see Bug 1725145 +- auto stride = SPA_ROUND_UP_N(width * BasicDesktopFrame::kBytesPerPixel, 4); +- auto size = height * stride; +- +- that->desktop_size_ = DesktopSize(width, height); +- +- uint8_t buffer[1024] = {}; +- auto builder = spa_pod_builder{buffer, sizeof(buffer)}; +- +- // Setup buffers and meta header for new format. +- const struct spa_pod* params[3]; +- params[0] = reinterpret_cast(spa_pod_builder_add_object(&builder, +- SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers, +- SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int((1<(spa_pod_builder_add_object(&builder, +- SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, +- SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header), +- SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_header)))); +- params[2] = reinterpret_cast(spa_pod_builder_add_object(&builder, +- SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, +- SPA_PARAM_META_type, SPA_POD_Id (SPA_META_VideoCrop), +- SPA_PARAM_META_size, SPA_POD_Int (sizeof(struct spa_meta_region)))); +- pw_stream_update_params(that->pw_stream_, params, 3); +-} +- +-// static +-void BaseCapturerPipeWire::OnStreamProcess(void* data) { +- BaseCapturerPipeWire* that = static_cast(data); +- RTC_DCHECK(that); +- +- struct pw_buffer *next_buffer; +- struct pw_buffer *buffer = nullptr; ++BaseCapturerPipeWire::~BaseCapturerPipeWire() {} + +- next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); +- while (next_buffer) { +- buffer = next_buffer; +- next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); +- +- if (next_buffer) { +- pw_stream_queue_buffer (that->pw_stream_, buffer); +- } +- } +- +- if (!buffer) { +- return; ++void BaseCapturerPipeWire::OnScreenCastRequestResult( ++ ScreenCastPortal::RequestResponse result, ++ uint32_t stream_node_id, ++ int fd) { ++ if (result != ScreenCastPortal::RequestResponse::kSuccess || ++ !options_.screencast_stream()->StartScreenCastStream(stream_node_id, ++ fd)) { ++ capturer_failed_ = true; ++ RTC_LOG(LS_ERROR) << "ScreenCastPortal failed: " ++ << static_cast(result); + } +- +- that->HandleBuffer(buffer); +- +- pw_stream_queue_buffer(that->pw_stream_, buffer); + } + +-BaseCapturerPipeWire::BaseCapturerPipeWire(CaptureSourceType source_type) +- : capture_source_type_(source_type) {} +- +-BaseCapturerPipeWire::~BaseCapturerPipeWire() { +- if (pw_main_loop_) { +- pw_thread_loop_stop(pw_main_loop_); +- } +- +- if (pw_stream_) { +- pw_stream_destroy(pw_stream_); +- } +- +- if (pw_core_) { +- pw_core_disconnect(pw_core_); +- } +- +- if (pw_context_) { +- pw_context_destroy(pw_context_); +- } +- +- if (pw_main_loop_) { +- pw_thread_loop_destroy(pw_main_loop_); ++void BaseCapturerPipeWire::OnScreenCastSessionClosed() { ++ if (!capturer_failed_) { ++ options_.screencast_stream()->StopScreenCastStream(); + } +- +- if (start_request_signal_id_) { +- g_dbus_connection_signal_unsubscribe(connection_, start_request_signal_id_); +- } +- if (sources_request_signal_id_) { +- g_dbus_connection_signal_unsubscribe(connection_, +- sources_request_signal_id_); +- } +- if (session_request_signal_id_) { +- g_dbus_connection_signal_unsubscribe(connection_, +- session_request_signal_id_); +- } +- +- if (session_handle_) { +- GDBusMessage* message = g_dbus_message_new_method_call( +- kDesktopBusName, session_handle_, kSessionInterfaceName, "Close"); +- if (message) { +- GError* error = nullptr; +- g_dbus_connection_send_message(connection_, message, +- G_DBUS_SEND_MESSAGE_FLAGS_NONE, +- /*out_serial=*/nullptr, &error); +- if (error) { +- RTC_LOG(LS_ERROR) << "Failed to close the session: " << error->message; +- g_error_free(error); +- } +- g_object_unref(message); +- } +- } +- +- g_free(start_handle_); +- g_free(sources_handle_); +- g_free(session_handle_); +- g_free(portal_handle_); +- +- if (cancellable_) { +- g_cancellable_cancel(cancellable_); +- g_object_unref(cancellable_); +- cancellable_ = nullptr; +- } +- +- if (proxy_) { +- g_object_unref(proxy_); +- proxy_ = nullptr; +- } +- +- if (pw_fd_ != -1) { +- close(pw_fd_); +- } +-} +- +-void BaseCapturerPipeWire::InitPortal() { +- cancellable_ = g_cancellable_new(); +- g_dbus_proxy_new_for_bus( +- G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, /*info=*/nullptr, +- kDesktopBusName, kDesktopObjectPath, kScreenCastInterfaceName, +- cancellable_, +- reinterpret_cast(OnProxyRequested), this); +-} +- +-void BaseCapturerPipeWire::InitPipeWire() { +-#if defined(WEBRTC_DLOPEN_PIPEWIRE) +- StubPathMap paths; +- +- // Check if the PipeWire library is available. +- paths[kModulePipewire].push_back(kPipeWireLib); +- if (!InitializeStubs(paths)) { +- RTC_LOG(LS_ERROR) << "Failed to load the PipeWire library and symbols."; +- portal_init_failed_ = true; +- return; +- } +-#endif // defined(WEBRTC_DLOPEN_PIPEWIRE) +- +- pw_init(/*argc=*/nullptr, /*argc=*/nullptr); +- +- pw_main_loop_ = pw_thread_loop_new("pipewire-main-loop", nullptr); +- pw_context_ = pw_context_new(pw_thread_loop_get_loop(pw_main_loop_), nullptr, 0); +- if (!pw_context_) { +- RTC_LOG(LS_ERROR) << "Failed to create PipeWire context"; +- return; +- } +- +- pw_core_ = pw_context_connect_fd(pw_context_, pw_fd_, nullptr, 0); +- if (!pw_core_) { +- RTC_LOG(LS_ERROR) << "Failed to connect PipeWire context"; +- return; +- } +- +- // Initialize event handlers, remote end and stream-related. +- pw_core_events_.version = PW_VERSION_CORE_EVENTS; +- pw_core_events_.error = &OnCoreError; +- +- pw_stream_events_.version = PW_VERSION_STREAM_EVENTS; +- pw_stream_events_.state_changed = &OnStreamStateChanged; +- pw_stream_events_.param_changed = &OnStreamParamChanged; +- pw_stream_events_.process = &OnStreamProcess; +- +- pw_core_add_listener(pw_core_, &spa_core_listener_, &pw_core_events_, this); +- +- pw_stream_ = CreateReceivingStream(); +- if (!pw_stream_) { +- RTC_LOG(LS_ERROR) << "Failed to create PipeWire stream"; +- return; +- } +- +- if (pw_thread_loop_start(pw_main_loop_) < 0) { +- RTC_LOG(LS_ERROR) << "Failed to start main PipeWire loop"; +- portal_init_failed_ = true; +- } +- +- RTC_LOG(LS_INFO) << "PipeWire remote opened."; +-} +- +-pw_stream* BaseCapturerPipeWire::CreateReceivingStream() { +- spa_rectangle pwMinScreenBounds = spa_rectangle{1, 1}; +- spa_rectangle pwMaxScreenBounds = spa_rectangle{UINT32_MAX, UINT32_MAX}; +- +- auto stream = pw_stream_new(pw_core_, "webrtc-pipewire-stream", nullptr); +- +- if (!stream) { +- RTC_LOG(LS_ERROR) << "Could not create receiving stream."; +- return nullptr; +- } +- +- uint8_t buffer[1024] = {}; +- const spa_pod* params[2]; +- spa_pod_builder builder = SPA_POD_BUILDER_INIT(buffer, sizeof (buffer)); +- +- params[0] = reinterpret_cast(spa_pod_builder_add_object(&builder, +- SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, +- SPA_FORMAT_mediaType, SPA_POD_Id(SPA_MEDIA_TYPE_video), +- SPA_FORMAT_mediaSubtype, SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw), +- SPA_FORMAT_VIDEO_format, SPA_POD_CHOICE_ENUM_Id(5, SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_RGBx, SPA_VIDEO_FORMAT_RGBA, +- SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_BGRA), +- SPA_FORMAT_VIDEO_size, SPA_POD_CHOICE_RANGE_Rectangle(&pwMinScreenBounds, +- &pwMinScreenBounds, +- &pwMaxScreenBounds), +- 0)); +- pw_stream_add_listener(stream, &spa_stream_listener_, &pw_stream_events_, this); +- +- if (pw_stream_connect(stream, PW_DIRECTION_INPUT, pw_stream_node_id_, +- PW_STREAM_FLAG_AUTOCONNECT, params, 1) != 0) { +- RTC_LOG(LS_ERROR) << "Could not connect receiving stream."; +- portal_init_failed_ = true; +- } +- +- return stream; +-} +- +-static void SpaBufferUnmap(unsigned char *map, int map_size, bool IsDMABuf, int fd) { +- if (map) { +- if (IsDMABuf) { +- SyncDmaBuf(fd, DMA_BUF_SYNC_END); +- } +- munmap(map, map_size); +- } +-} +- +-void BaseCapturerPipeWire::HandleBuffer(pw_buffer* buffer) { +- spa_buffer* spaBuffer = buffer->buffer; +- uint8_t *map = nullptr; +- uint8_t* src = nullptr; +- +- if (spaBuffer->datas[0].chunk->size == 0) { +- RTC_LOG(LS_ERROR) << "Failed to get video stream: Zero size."; +- return; +- } +- +- switch (spaBuffer->datas[0].type) { +- case SPA_DATA_MemFd: +- case SPA_DATA_DmaBuf: +- map = static_cast(mmap( +- nullptr, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, +- PROT_READ, MAP_PRIVATE, spaBuffer->datas[0].fd, 0)); +- if (map == MAP_FAILED) { +- RTC_LOG(LS_ERROR) << "Failed to mmap memory: " << std::strerror(errno); +- return; +- } +- if (spaBuffer->datas[0].type == SPA_DATA_DmaBuf) { +- SyncDmaBuf(spaBuffer->datas[0].fd, DMA_BUF_SYNC_START); +- } +- src = SPA_MEMBER(map, spaBuffer->datas[0].mapoffset, uint8_t); +- break; +- case SPA_DATA_MemPtr: +- map = nullptr; +- src = static_cast(spaBuffer->datas[0].data); +- break; +- default: +- return; +- } +- +- if (!src) { +- RTC_LOG(LS_ERROR) << "Failed to get video stream: Wrong data after mmap()"; +- SpaBufferUnmap(map, +- spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, +- spaBuffer->datas[0].type == SPA_DATA_DmaBuf, spaBuffer->datas[0].fd); +- return; +- } +- +- struct spa_meta_region* video_metadata = +- static_cast( +- spa_buffer_find_meta_data(spaBuffer, SPA_META_VideoCrop, sizeof(*video_metadata))); +- +- // Video size from metada is bigger than an actual video stream size. +- // The metadata are wrong or we should up-scale te video...in both cases +- // just quit now. +- if (video_metadata && +- (video_metadata->region.size.width > (uint32_t)desktop_size_.width() || +- video_metadata->region.size.height > (uint32_t)desktop_size_.height())) { +- RTC_LOG(LS_ERROR) << "Stream metadata sizes are wrong!"; +- SpaBufferUnmap(map, +- spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, +- spaBuffer->datas[0].type == SPA_DATA_DmaBuf, spaBuffer->datas[0].fd); +- return; +- } +- +- // Use video metada when video size from metadata is set and smaller than +- // video stream size, so we need to adjust it. +- video_metadata_use_ = (video_metadata && +- video_metadata->region.size.width != 0 && +- video_metadata->region.size.height != 0 && +- (video_metadata->region.size.width < (uint32_t)desktop_size_.width() || +- video_metadata->region.size.height < (uint32_t)desktop_size_.height())); +- +- DesktopSize video_size_prev = video_size_; +- if (video_metadata_use_) { +- video_size_ = DesktopSize(video_metadata->region.size.width, +- video_metadata->region.size.height); +- } else { +- video_size_ = desktop_size_; +- } +- +- webrtc::MutexLock lock(¤t_frame_lock_); +- if (!current_frame_ || !video_size_.equals(video_size_prev)) { +- current_frame_ = +- std::make_unique +- (video_size_.width() * video_size_.height() * BasicDesktopFrame::kBytesPerPixel); +- } +- +- const int32_t dstStride = video_size_.width() * BasicDesktopFrame::kBytesPerPixel; +- const int32_t srcStride = spaBuffer->datas[0].chunk->stride; +- +- // Adjust source content based on metadata video position +- if (video_metadata_use_ && +- (video_metadata->region.position.y + video_size_.height() <= desktop_size_.height())) { +- src += srcStride * video_metadata->region.position.y; +- } +- const int xOffset = +- video_metadata_use_ && +- (video_metadata->region.position.x + video_size_.width() <= desktop_size_.width()) +- ? video_metadata->region.position.x * BasicDesktopFrame::kBytesPerPixel +- : 0; +- +- uint8_t* dst = current_frame_.get(); +- for (int i = 0; i < video_size_.height(); ++i) { +- // Adjust source content based on crop video position if needed +- src += xOffset; +- std::memcpy(dst, src, dstStride); +- // If both sides decided to go with the RGBx format we need to convert it to +- // BGRx to match color format expected by WebRTC. +- if (spa_video_format_.format == SPA_VIDEO_FORMAT_RGBx || +- spa_video_format_.format == SPA_VIDEO_FORMAT_RGBA) { +- ConvertRGBxToBGRx(dst, dstStride); +- } +- src += srcStride - xOffset; +- dst += dstStride; +- } +- +- SpaBufferUnmap(map, +- spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, +- spaBuffer->datas[0].type == SPA_DATA_DmaBuf, spaBuffer->datas[0].fd); +-} +- +-void BaseCapturerPipeWire::ConvertRGBxToBGRx(uint8_t* frame, uint32_t size) { +- // Change color format for KDE KWin which uses RGBx and not BGRx +- for (uint32_t i = 0; i < size; i += 4) { +- uint8_t tempR = frame[i]; +- uint8_t tempB = frame[i + 2]; +- frame[i] = tempB; +- frame[i + 2] = tempR; +- } +-} +- +-guint BaseCapturerPipeWire::SetupRequestResponseSignal( +- const gchar* object_path, +- GDBusSignalCallback callback) { +- return g_dbus_connection_signal_subscribe( +- connection_, kDesktopBusName, kRequestInterfaceName, "Response", +- object_path, /*arg0=*/nullptr, G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE, +- callback, this, /*user_data_free_func=*/nullptr); +-} +- +-// static +-void BaseCapturerPipeWire::OnProxyRequested(GObject* /*object*/, +- GAsyncResult* result, +- gpointer user_data) { +- BaseCapturerPipeWire* that = static_cast(user_data); +- RTC_DCHECK(that); +- +- GError* error = nullptr; +- GDBusProxy *proxy = g_dbus_proxy_new_finish(result, &error); +- if (!proxy) { +- if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) +- return; +- RTC_LOG(LS_ERROR) << "Failed to create a proxy for the screen cast portal: " +- << error->message; +- g_error_free(error); +- that->portal_init_failed_ = true; +- return; +- } +- that->proxy_ = proxy; +- that->connection_ = g_dbus_proxy_get_connection(that->proxy_); +- +- RTC_LOG(LS_INFO) << "Created proxy for the screen cast portal."; +- that->SessionRequest(); +-} +- +-// static +-gchar* BaseCapturerPipeWire::PrepareSignalHandle(GDBusConnection* connection, +- const gchar* token) { +- gchar* sender = g_strdup(g_dbus_connection_get_unique_name(connection) + 1); +- for (int i = 0; sender[i]; i++) { +- if (sender[i] == '.') { +- sender[i] = '_'; +- } +- } +- +- gchar* handle = g_strconcat(kDesktopRequestObjectPath, "/", sender, "/", +- token, /*end of varargs*/ nullptr); +- g_free(sender); +- +- return handle; +-} +- +-void BaseCapturerPipeWire::SessionRequest() { +- GVariantBuilder builder; +- gchar* variant_string; +- +- g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); +- variant_string = +- g_strdup_printf("webrtc_session%d", g_random_int_range(0, G_MAXINT)); +- g_variant_builder_add(&builder, "{sv}", "session_handle_token", +- g_variant_new_string(variant_string)); +- g_free(variant_string); +- variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); +- g_variant_builder_add(&builder, "{sv}", "handle_token", +- g_variant_new_string(variant_string)); +- +- portal_handle_ = PrepareSignalHandle(connection_, variant_string); +- session_request_signal_id_ = SetupRequestResponseSignal( +- portal_handle_, OnSessionRequestResponseSignal); +- g_free(variant_string); +- +- RTC_LOG(LS_INFO) << "Screen cast session requested."; +- g_dbus_proxy_call( +- proxy_, "CreateSession", g_variant_new("(a{sv})", &builder), +- G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, +- reinterpret_cast(OnSessionRequested), this); +-} +- +-// static +-void BaseCapturerPipeWire::OnSessionRequested(GDBusProxy *proxy, +- GAsyncResult* result, +- gpointer user_data) { +- BaseCapturerPipeWire* that = static_cast(user_data); +- RTC_DCHECK(that); +- +- GError* error = nullptr; +- GVariant* variant = g_dbus_proxy_call_finish(proxy, result, &error); +- if (!variant) { +- if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) +- return; +- RTC_LOG(LS_ERROR) << "Failed to create a screen cast session: " +- << error->message; +- g_error_free(error); +- that->portal_init_failed_ = true; +- return; +- } +- RTC_LOG(LS_INFO) << "Initializing the screen cast session."; +- +- gchar* handle = nullptr; +- g_variant_get_child(variant, 0, "o", &handle); +- g_variant_unref(variant); +- if (!handle) { +- RTC_LOG(LS_ERROR) << "Failed to initialize the screen cast session."; +- if (that->session_request_signal_id_) { +- g_dbus_connection_signal_unsubscribe(that->connection_, +- that->session_request_signal_id_); +- that->session_request_signal_id_ = 0; +- } +- that->portal_init_failed_ = true; +- return; +- } +- +- g_free(handle); +- +- RTC_LOG(LS_INFO) << "Subscribing to the screen cast session."; +-} +- +-// static +-void BaseCapturerPipeWire::OnSessionRequestResponseSignal( +- GDBusConnection* connection, +- const gchar* sender_name, +- const gchar* object_path, +- const gchar* interface_name, +- const gchar* signal_name, +- GVariant* parameters, +- gpointer user_data) { +- BaseCapturerPipeWire* that = static_cast(user_data); +- RTC_DCHECK(that); +- +- RTC_LOG(LS_INFO) +- << "Received response for the screen cast session subscription."; +- +- guint32 portal_response; +- GVariant* response_data; +- g_variant_get(parameters, "(u@a{sv})", &portal_response, &response_data); +- +- GVariant* session_handle = +- g_variant_lookup_value(response_data, "session_handle", NULL); +- that->session_handle_ = g_variant_dup_string(session_handle, NULL); +- +- g_variant_unref(session_handle); +- g_variant_unref(response_data); +- +- if (!that->session_handle_ || portal_response) { +- RTC_LOG(LS_ERROR) +- << "Failed to request the screen cast session subscription."; +- that->portal_init_failed_ = true; +- return; +- } +- +- that->SourcesRequest(); +-} +- +-void BaseCapturerPipeWire::SourcesRequest() { +- GVariantBuilder builder; +- gchar* variant_string; +- +- g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); +- // We want to record monitor content. +- g_variant_builder_add(&builder, "{sv}", "types", +- g_variant_new_uint32(capture_source_type_)); +- // We don't want to allow selection of multiple sources. +- g_variant_builder_add(&builder, "{sv}", "multiple", +- g_variant_new_boolean(false)); +- variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); +- g_variant_builder_add(&builder, "{sv}", "handle_token", +- g_variant_new_string(variant_string)); +- +- sources_handle_ = PrepareSignalHandle(connection_, variant_string); +- sources_request_signal_id_ = SetupRequestResponseSignal( +- sources_handle_, OnSourcesRequestResponseSignal); +- g_free(variant_string); +- +- RTC_LOG(LS_INFO) << "Requesting sources from the screen cast session."; +- g_dbus_proxy_call( +- proxy_, "SelectSources", +- g_variant_new("(oa{sv})", session_handle_, &builder), +- G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, +- reinterpret_cast(OnSourcesRequested), this); +-} +- +-// static +-void BaseCapturerPipeWire::OnSourcesRequested(GDBusProxy *proxy, +- GAsyncResult* result, +- gpointer user_data) { +- BaseCapturerPipeWire* that = static_cast(user_data); +- RTC_DCHECK(that); +- +- GError* error = nullptr; +- GVariant* variant = g_dbus_proxy_call_finish(proxy, result, &error); +- if (!variant) { +- if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) +- return; +- RTC_LOG(LS_ERROR) << "Failed to request the sources: " << error->message; +- g_error_free(error); +- that->portal_init_failed_ = true; +- return; +- } +- +- RTC_LOG(LS_INFO) << "Sources requested from the screen cast session."; +- +- gchar* handle = nullptr; +- g_variant_get_child(variant, 0, "o", &handle); +- g_variant_unref(variant); +- if (!handle) { +- RTC_LOG(LS_ERROR) << "Failed to initialize the screen cast session."; +- if (that->sources_request_signal_id_) { +- g_dbus_connection_signal_unsubscribe(that->connection_, +- that->sources_request_signal_id_); +- that->sources_request_signal_id_ = 0; +- } +- that->portal_init_failed_ = true; +- return; +- } +- +- g_free(handle); +- +- RTC_LOG(LS_INFO) << "Subscribed to sources signal."; +-} +- +-// static +-void BaseCapturerPipeWire::OnSourcesRequestResponseSignal( +- GDBusConnection* connection, +- const gchar* sender_name, +- const gchar* object_path, +- const gchar* interface_name, +- const gchar* signal_name, +- GVariant* parameters, +- gpointer user_data) { +- BaseCapturerPipeWire* that = static_cast(user_data); +- RTC_DCHECK(that); +- +- RTC_LOG(LS_INFO) << "Received sources signal from session."; +- +- guint32 portal_response; +- g_variant_get(parameters, "(u@a{sv})", &portal_response, nullptr); +- if (portal_response) { +- RTC_LOG(LS_ERROR) +- << "Failed to select sources for the screen cast session."; +- that->portal_init_failed_ = true; +- return; +- } +- +- that->StartRequest(); +-} +- +-void BaseCapturerPipeWire::StartRequest() { +- GVariantBuilder builder; +- gchar* variant_string; +- +- g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); +- variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); +- g_variant_builder_add(&builder, "{sv}", "handle_token", +- g_variant_new_string(variant_string)); +- +- start_handle_ = PrepareSignalHandle(connection_, variant_string); +- start_request_signal_id_ = +- SetupRequestResponseSignal(start_handle_, OnStartRequestResponseSignal); +- g_free(variant_string); +- +- // "Identifier for the application window", this is Wayland, so not "x11:...". +- const gchar parent_window[] = ""; +- +- RTC_LOG(LS_INFO) << "Starting the screen cast session."; +- g_dbus_proxy_call( +- proxy_, "Start", +- g_variant_new("(osa{sv})", session_handle_, parent_window, &builder), +- G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, +- reinterpret_cast(OnStartRequested), this); +-} +- +-// static +-void BaseCapturerPipeWire::OnStartRequested(GDBusProxy *proxy, +- GAsyncResult* result, +- gpointer user_data) { +- BaseCapturerPipeWire* that = static_cast(user_data); +- RTC_DCHECK(that); +- +- GError* error = nullptr; +- GVariant* variant = g_dbus_proxy_call_finish(proxy, result, &error); +- if (!variant) { +- if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) +- return; +- RTC_LOG(LS_ERROR) << "Failed to start the screen cast session: " +- << error->message; +- g_error_free(error); +- that->portal_init_failed_ = true; +- return; +- } +- +- RTC_LOG(LS_INFO) << "Initializing the start of the screen cast session."; +- +- gchar* handle = nullptr; +- g_variant_get_child(variant, 0, "o", &handle); +- g_variant_unref(variant); +- if (!handle) { +- RTC_LOG(LS_ERROR) +- << "Failed to initialize the start of the screen cast session."; +- if (that->start_request_signal_id_) { +- g_dbus_connection_signal_unsubscribe(that->connection_, +- that->start_request_signal_id_); +- that->start_request_signal_id_ = 0; +- } +- that->portal_init_failed_ = true; +- return; +- } +- +- g_free(handle); +- +- RTC_LOG(LS_INFO) << "Subscribed to the start signal."; +-} +- +-// static +-void BaseCapturerPipeWire::OnStartRequestResponseSignal( +- GDBusConnection* connection, +- const gchar* sender_name, +- const gchar* object_path, +- const gchar* interface_name, +- const gchar* signal_name, +- GVariant* parameters, +- gpointer user_data) { +- BaseCapturerPipeWire* that = static_cast(user_data); +- RTC_DCHECK(that); +- +- RTC_LOG(LS_INFO) << "Start signal received."; +- guint32 portal_response; +- GVariant* response_data; +- GVariantIter* iter = nullptr; +- g_variant_get(parameters, "(u@a{sv})", &portal_response, &response_data); +- if (portal_response || !response_data) { +- RTC_LOG(LS_ERROR) << "Failed to start the screen cast session."; +- that->portal_init_failed_ = true; +- return; +- } +- +- // Array of PipeWire streams. See +- // https://github.com/flatpak/xdg-desktop-portal/blob/master/data/org.freedesktop.portal.ScreenCast.xml +- // documentation for . +- if (g_variant_lookup(response_data, "streams", "a(ua{sv})", &iter)) { +- GVariant* variant; +- +- while (g_variant_iter_next(iter, "@(ua{sv})", &variant)) { +- guint32 stream_id; +- GVariant* options; +- +- g_variant_get(variant, "(u@a{sv})", &stream_id, &options); +- RTC_DCHECK(options != nullptr); +- +- that->pw_stream_node_id_ = stream_id; +- g_variant_unref(options); +- g_variant_unref(variant); +- } +- } +- g_variant_iter_free(iter); +- g_variant_unref(response_data); +- +- that->OpenPipeWireRemote(); +-} +- +-void BaseCapturerPipeWire::OpenPipeWireRemote() { +- GVariantBuilder builder; +- g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); +- +- RTC_LOG(LS_INFO) << "Opening the PipeWire remote."; +- +- g_dbus_proxy_call_with_unix_fd_list( +- proxy_, "OpenPipeWireRemote", +- g_variant_new("(oa{sv})", session_handle_, &builder), +- G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, /*fd_list=*/nullptr, +- cancellable_, +- reinterpret_cast(OnOpenPipeWireRemoteRequested), +- this); +-} +- +-// static +-void BaseCapturerPipeWire::OnOpenPipeWireRemoteRequested( +- GDBusProxy *proxy, +- GAsyncResult* result, +- gpointer user_data) { +- BaseCapturerPipeWire* that = static_cast(user_data); +- RTC_DCHECK(that); +- +- GError* error = nullptr; +- GUnixFDList* outlist = nullptr; +- GVariant* variant = g_dbus_proxy_call_with_unix_fd_list_finish( +- proxy, &outlist, result, &error); +- if (!variant) { +- if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) +- return; +- RTC_LOG(LS_ERROR) << "Failed to open the PipeWire remote: " +- << error->message; +- g_error_free(error); +- that->portal_init_failed_ = true; +- return; +- } +- +- gint32 index; +- g_variant_get(variant, "(h)", &index); +- +- if ((that->pw_fd_ = g_unix_fd_list_get(outlist, index, &error)) == -1) { +- RTC_LOG(LS_ERROR) << "Failed to get file descriptor from the list: " +- << error->message; +- g_error_free(error); +- g_variant_unref(variant); +- that->portal_init_failed_ = true; +- return; +- } +- +- g_variant_unref(variant); +- g_object_unref(outlist); +- +- that->InitPipeWire(); + } + + void BaseCapturerPipeWire::Start(Callback* callback) { + RTC_DCHECK(!callback_); + RTC_DCHECK(callback); + +- InitPortal(); +- + callback_ = callback; ++ ++ screencast_portal_->Start(); + } + + void BaseCapturerPipeWire::CaptureFrame() { +- if (portal_init_failed_) { ++ if (capturer_failed_) { + callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); + return; + } + +- webrtc::MutexLock lock(¤t_frame_lock_); +- if (!current_frame_) { +- callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); +- return; +- } +- +- DesktopSize frame_size = desktop_size_; +- if (video_metadata_use_) { +- frame_size = video_size_; +- } ++ std::unique_ptr frame = ++ options_.screencast_stream()->CaptureFrame(); + +- std::unique_ptr result(new BasicDesktopFrame(frame_size)); +- result->CopyPixelsFrom( +- current_frame_.get(), (frame_size.width() * BasicDesktopFrame::kBytesPerPixel), +- DesktopRect::MakeWH(frame_size.width(), frame_size.height())); +- if (!result) { ++ if (!frame || !frame->data()) { + callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); + return; + } + +- // TODO(julien.isorce): http://crbug.com/945468. Set the icc profile on the +- // frame, see ScreenCapturerX11::CaptureFrame. ++ // TODO(julien.isorce): http://crbug.com/945468. Set the icc profile on ++ // the frame, see ScreenCapturerX11::CaptureFrame. + +- callback_->OnCaptureResult(Result::SUCCESS, std::move(result)); ++ callback_->OnCaptureResult(Result::SUCCESS, std::move(frame)); + } + + // Keep in sync with defines at browser/actors/WebRTCParent.jsm +@@ -953,31 +83,13 @@ void BaseCapturerPipeWire::CaptureFrame() { + #define PIPEWIRE_NAME "####_PIPEWIRE_PORTAL_####" + + bool BaseCapturerPipeWire::GetSourceList(SourceList* sources) { ++ RTC_DCHECK(sources->size() == 0); + sources->push_back({PIPEWIRE_ID, 0, PIPEWIRE_NAME}); + return true; + } + + bool BaseCapturerPipeWire::SelectSource(SourceId id) { +- // Screen selection is handled by the xdg-desktop-portal. + return id == PIPEWIRE_ID; + } + +-// static +-std::unique_ptr +-BaseCapturerPipeWire::CreateRawScreenCapturer( +- const DesktopCaptureOptions& options) { +- std::unique_ptr capturer = +- std::make_unique(BaseCapturerPipeWire::CaptureSourceType::kAny); +- return std::move(capturer);} +- +-// static +-std::unique_ptr +-BaseCapturerPipeWire::CreateRawWindowCapturer( +- const DesktopCaptureOptions& options) { +- +- std::unique_ptr capturer = +- std::make_unique(BaseCapturerPipeWire::CaptureSourceType::kAny); +- return std::move(capturer); +-} +- + } // namespace webrtc +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h +index af8e20c..5db09e0 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h +@@ -11,160 +11,39 @@ + #ifndef MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ + #define MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ + +-#include +-#define typeof __typeof__ +-#include +-#include +- + #include "modules/desktop_capture/desktop_capture_options.h" + #include "modules/desktop_capture/desktop_capturer.h" +-#include "rtc_base/synchronization/mutex.h" ++#include "modules/desktop_capture/linux/screencast_portal.h" ++#include "modules/desktop_capture/linux/shared_screencast_stream.h" + + namespace webrtc { + +-class BaseCapturerPipeWire : public DesktopCapturer { ++class BaseCapturerPipeWire : public DesktopCapturer, ++ public ScreenCastPortal::PortalNotifier { + public: +- enum CaptureSourceType : uint32_t { +- kScreen = 0b01, +- kWindow = 0b10, +- kAny = 0b11 +- }; +- +- explicit BaseCapturerPipeWire(CaptureSourceType source_type); ++ BaseCapturerPipeWire(const DesktopCaptureOptions& options); + ~BaseCapturerPipeWire() override; + ++ BaseCapturerPipeWire(const BaseCapturerPipeWire&) = delete; ++ BaseCapturerPipeWire& operator=(const BaseCapturerPipeWire&) = delete; ++ + // DesktopCapturer interface. + void Start(Callback* delegate) override; + void CaptureFrame() override; + bool GetSourceList(SourceList* sources) override; + bool SelectSource(SourceId id) override; + +- static std::unique_ptr CreateRawScreenCapturer( +- const DesktopCaptureOptions& options); +- +- static std::unique_ptr CreateRawWindowCapturer( +- const DesktopCaptureOptions& options); ++ // ScreenCastPortal::PortalNotifier interface. ++ void OnScreenCastRequestResult(ScreenCastPortal::RequestResponse result, ++ uint32_t stream_node_id, ++ int fd) override; ++ void OnScreenCastSessionClosed() override; + + private: +- // PipeWire types --> +- pw_context* pw_context_ = nullptr; +- pw_core* pw_core_ = nullptr; +- pw_stream* pw_stream_ = nullptr; +- pw_thread_loop* pw_main_loop_ = nullptr; +- +- spa_hook spa_core_listener_ = {}; +- spa_hook spa_stream_listener_ = {}; +- +- pw_core_events pw_core_events_ = {}; +- pw_stream_events pw_stream_events_ = {}; +- +- struct spa_video_info_raw spa_video_format_; +- +- guint32 pw_stream_node_id_ = 0; +- gint32 pw_fd_ = -1; +- +- CaptureSourceType capture_source_type_ = +- BaseCapturerPipeWire::CaptureSourceType::kAny; +- +- // <-- end of PipeWire types +- +- GDBusConnection* connection_ = nullptr; +- GDBusProxy* proxy_ = nullptr; +- GCancellable *cancellable_ = nullptr; +- gchar* portal_handle_ = nullptr; +- gchar* session_handle_ = nullptr; +- gchar* sources_handle_ = nullptr; +- gchar* start_handle_ = nullptr; +- guint session_request_signal_id_ = 0; +- guint sources_request_signal_id_ = 0; +- guint start_request_signal_id_ = 0; +- +- bool video_metadata_use_ = false; +- DesktopSize video_size_; +- DesktopSize desktop_size_ = {}; + DesktopCaptureOptions options_ = {}; +- +- webrtc::Mutex current_frame_lock_; +- std::unique_ptr current_frame_; + Callback* callback_ = nullptr; +- +- bool portal_init_failed_ = false; +- +- void InitPortal(); +- void InitPipeWire(); +- +- pw_stream* CreateReceivingStream(); +- void HandleBuffer(pw_buffer* buffer); +- +- void ConvertRGBxToBGRx(uint8_t* frame, uint32_t size); +- +- static void OnCoreError(void *data, +- uint32_t id, +- int seq, +- int res, +- const char *message); +- static void OnStreamParamChanged(void *data, +- uint32_t id, +- const struct spa_pod *format); +- static void OnStreamStateChanged(void* data, +- pw_stream_state old_state, +- pw_stream_state state, +- const char* error_message); +- static void OnStreamProcess(void* data); +- static void OnNewBuffer(void* data, uint32_t id); +- +- guint SetupRequestResponseSignal(const gchar* object_path, +- GDBusSignalCallback callback); +- +- static void OnProxyRequested(GObject* object, +- GAsyncResult* result, +- gpointer user_data); +- +- static gchar* PrepareSignalHandle(GDBusConnection* connection, +- const gchar* token); +- +- void SessionRequest(); +- static void OnSessionRequested(GDBusProxy *proxy, +- GAsyncResult* result, +- gpointer user_data); +- static void OnSessionRequestResponseSignal(GDBusConnection* connection, +- const gchar* sender_name, +- const gchar* object_path, +- const gchar* interface_name, +- const gchar* signal_name, +- GVariant* parameters, +- gpointer user_data); +- +- void SourcesRequest(); +- static void OnSourcesRequested(GDBusProxy *proxy, +- GAsyncResult* result, +- gpointer user_data); +- static void OnSourcesRequestResponseSignal(GDBusConnection* connection, +- const gchar* sender_name, +- const gchar* object_path, +- const gchar* interface_name, +- const gchar* signal_name, +- GVariant* parameters, +- gpointer user_data); +- +- void StartRequest(); +- static void OnStartRequested(GDBusProxy *proxy, +- GAsyncResult* result, +- gpointer user_data); +- static void OnStartRequestResponseSignal(GDBusConnection* connection, +- const gchar* sender_name, +- const gchar* object_path, +- const gchar* interface_name, +- const gchar* signal_name, +- GVariant* parameters, +- gpointer user_data); +- +- void OpenPipeWireRemote(); +- static void OnOpenPipeWireRemoteRequested(GDBusProxy *proxy, +- GAsyncResult* result, +- gpointer user_data); +- +- RTC_DISALLOW_COPY_AND_ASSIGN(BaseCapturerPipeWire); ++ bool capturer_failed_ = false; ++ std::unique_ptr screencast_portal_; + }; + + } // namespace webrtc +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs b/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs +new file mode 100644 +index 0000000..226979f +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs +@@ -0,0 +1,11 @@ ++// Copyright 2021 The WebRTC project authors. All rights reserved. ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++//------------------------------------------------ ++// Functions from DRM used in capturer code. ++//-------- ++ ++// xf86drm.h ++int drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices); ++void drmFreeDevices(drmDevicePtr devices[], int count); +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc +new file mode 100644 +index 0000000..de63c2a +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc +@@ -0,0 +1,695 @@ ++/* ++ * Copyright 2021 The WebRTC project authors. All Rights Reserved. ++ * ++ * Use of this source code is governed by a BSD-style license ++ * that can be found in the LICENSE file in the root of the source ++ * tree. An additional intellectual property rights grant can be found ++ * in the file PATENTS. All contributing project authors may ++ * be found in the AUTHORS file in the root of the source tree. ++ */ ++ ++#include "modules/desktop_capture/linux/egl_dmabuf.h" ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "absl/memory/memory.h" ++#include "absl/types/optional.h" ++#include "rtc_base/checks.h" ++#include "rtc_base/logging.h" ++#include "rtc_base/sanitizer.h" ++#include "rtc_base/string_encode.h" ++ ++namespace webrtc { ++ ++// EGL ++typedef EGLBoolean (*eglBindAPI_func)(EGLenum api); ++typedef EGLContext (*eglCreateContext_func)(EGLDisplay dpy, ++ EGLConfig config, ++ EGLContext share_context, ++ const EGLint* attrib_list); ++typedef EGLBoolean (*eglDestroyContext_func)(EGLDisplay display, ++ EGLContext context); ++typedef EGLBoolean (*eglTerminate_func)(EGLDisplay display); ++typedef EGLImageKHR (*eglCreateImageKHR_func)(EGLDisplay dpy, ++ EGLContext ctx, ++ EGLenum target, ++ EGLClientBuffer buffer, ++ const EGLint* attrib_list); ++typedef EGLBoolean (*eglDestroyImageKHR_func)(EGLDisplay dpy, ++ EGLImageKHR image); ++typedef EGLint (*eglGetError_func)(void); ++typedef void* (*eglGetProcAddress_func)(const char*); ++typedef EGLDisplay (*eglGetPlatformDisplayEXT_func)(EGLenum platform, ++ void* native_display, ++ const EGLint* attrib_list); ++typedef EGLDisplay (*eglGetPlatformDisplay_func)(EGLenum platform, ++ void* native_display, ++ const EGLAttrib* attrib_list); ++ ++typedef EGLBoolean (*eglInitialize_func)(EGLDisplay dpy, ++ EGLint* major, ++ EGLint* minor); ++typedef EGLBoolean (*eglMakeCurrent_func)(EGLDisplay dpy, ++ EGLSurface draw, ++ EGLSurface read, ++ EGLContext ctx); ++typedef EGLBoolean (*eglQueryDmaBufFormatsEXT_func)(EGLDisplay dpy, ++ EGLint max_formats, ++ EGLint* formats, ++ EGLint* num_formats); ++typedef EGLBoolean (*eglQueryDmaBufModifiersEXT_func)(EGLDisplay dpy, ++ EGLint format, ++ EGLint max_modifiers, ++ EGLuint64KHR* modifiers, ++ EGLBoolean* external_only, ++ EGLint* num_modifiers); ++typedef const char* (*eglQueryString_func)(EGLDisplay dpy, EGLint name); ++typedef void (*glEGLImageTargetTexture2DOES_func)(GLenum target, ++ GLeglImageOES image); ++ ++// This doesn't follow naming conventions in WebRTC, where the naming ++// should look like e.g. egl_bind_api instead of EglBindAPI, however ++// we named them according to the exported functions they map to for ++// consistency. ++eglBindAPI_func EglBindAPI = nullptr; ++eglCreateContext_func EglCreateContext = nullptr; ++eglDestroyContext_func EglDestroyContext = nullptr; ++eglTerminate_func EglTerminate = nullptr; ++eglCreateImageKHR_func EglCreateImageKHR = nullptr; ++eglDestroyImageKHR_func EglDestroyImageKHR = nullptr; ++eglGetError_func EglGetError = nullptr; ++eglGetProcAddress_func EglGetProcAddress = nullptr; ++eglGetPlatformDisplayEXT_func EglGetPlatformDisplayEXT = nullptr; ++eglGetPlatformDisplay_func EglGetPlatformDisplay = nullptr; ++eglInitialize_func EglInitialize = nullptr; ++eglMakeCurrent_func EglMakeCurrent = nullptr; ++eglQueryDmaBufFormatsEXT_func EglQueryDmaBufFormatsEXT = nullptr; ++eglQueryDmaBufModifiersEXT_func EglQueryDmaBufModifiersEXT = nullptr; ++eglQueryString_func EglQueryString = nullptr; ++glEGLImageTargetTexture2DOES_func GlEGLImageTargetTexture2DOES = nullptr; ++ ++// GL ++typedef void (*glBindTexture_func)(GLenum target, GLuint texture); ++typedef void (*glDeleteTextures_func)(GLsizei n, const GLuint* textures); ++typedef void (*glGenTextures_func)(GLsizei n, GLuint* textures); ++typedef GLenum (*glGetError_func)(void); ++typedef const GLubyte* (*glGetString_func)(GLenum name); ++typedef void (*glGetTexImage_func)(GLenum target, ++ GLint level, ++ GLenum format, ++ GLenum type, ++ void* pixels); ++typedef void (*glTexParameteri_func)(GLenum target, GLenum pname, GLint param); ++typedef void* (*glXGetProcAddressARB_func)(const char*); ++ ++// This doesn't follow naming conventions in WebRTC, where the naming ++// should look like e.g. egl_bind_api instead of EglBindAPI, however ++// we named them according to the exported functions they map to for ++// consistency. ++glBindTexture_func GlBindTexture = nullptr; ++glDeleteTextures_func GlDeleteTextures = nullptr; ++glGenTextures_func GlGenTextures = nullptr; ++glGetError_func GlGetError = nullptr; ++glGetString_func GlGetString = nullptr; ++glGetTexImage_func GlGetTexImage = nullptr; ++glTexParameteri_func GlTexParameteri = nullptr; ++glXGetProcAddressARB_func GlXGetProcAddressARB = nullptr; ++ ++static const std::string FormatGLError(GLenum err) { ++ switch (err) { ++ case GL_NO_ERROR: ++ return "GL_NO_ERROR"; ++ case GL_INVALID_ENUM: ++ return "GL_INVALID_ENUM"; ++ case GL_INVALID_VALUE: ++ return "GL_INVALID_VALUE"; ++ case GL_INVALID_OPERATION: ++ return "GL_INVALID_OPERATION"; ++ case GL_STACK_OVERFLOW: ++ return "GL_STACK_OVERFLOW"; ++ case GL_STACK_UNDERFLOW: ++ return "GL_STACK_UNDERFLOW"; ++ case GL_OUT_OF_MEMORY: ++ return "GL_OUT_OF_MEMORY"; ++ default: ++ return "GL error code: " + std::to_string(err); ++ } ++} ++ ++static const std::string FormatEGLError(EGLint err) { ++ switch (err) { ++ case EGL_NOT_INITIALIZED: ++ return "EGL_NOT_INITIALIZED"; ++ case EGL_BAD_ACCESS: ++ return "EGL_BAD_ACCESS"; ++ case EGL_BAD_ALLOC: ++ return "EGL_BAD_ALLOC"; ++ case EGL_BAD_ATTRIBUTE: ++ return "EGL_BAD_ATTRIBUTE"; ++ case EGL_BAD_CONTEXT: ++ return "EGL_BAD_CONTEXT"; ++ case EGL_BAD_CONFIG: ++ return "EGL_BAD_CONFIG"; ++ case EGL_BAD_CURRENT_SURFACE: ++ return "EGL_BAD_CURRENT_SURFACE"; ++ case EGL_BAD_DISPLAY: ++ return "EGL_BAD_DISPLAY"; ++ case EGL_BAD_SURFACE: ++ return "EGL_BAD_SURFACE"; ++ case EGL_BAD_MATCH: ++ return "EGL_BAD_MATCH"; ++ case EGL_BAD_PARAMETER: ++ return "EGL_BAD_PARAMETER"; ++ case EGL_BAD_NATIVE_PIXMAP: ++ return "EGL_BAD_NATIVE_PIXMAP"; ++ case EGL_BAD_NATIVE_WINDOW: ++ return "EGL_BAD_NATIVE_WINDOW"; ++ case EGL_CONTEXT_LOST: ++ return "EGL_CONTEXT_LOST"; ++ default: ++ return "EGL error code: " + std::to_string(err); ++ } ++} ++ ++static uint32_t SpaPixelFormatToDrmFormat(uint32_t spa_format) { ++ switch (spa_format) { ++ case SPA_VIDEO_FORMAT_RGBA: ++ return DRM_FORMAT_ABGR8888; ++ case SPA_VIDEO_FORMAT_RGBx: ++ return DRM_FORMAT_XBGR8888; ++ case SPA_VIDEO_FORMAT_BGRA: ++ return DRM_FORMAT_ARGB8888; ++ case SPA_VIDEO_FORMAT_BGRx: ++ return DRM_FORMAT_XRGB8888; ++ default: ++ return DRM_FORMAT_INVALID; ++ } ++} ++ ++static void CloseLibrary(void* library) { ++ if (library) { ++ dlclose(library); ++ library = nullptr; ++ } ++} ++ ++static void* g_lib_egl = nullptr; ++ ++static bool OpenEGL() { ++ g_lib_egl = dlopen("libEGL.so.1", RTLD_NOW | RTLD_GLOBAL); ++ if (g_lib_egl) { ++ EglGetProcAddress = ++ (eglGetProcAddress_func)dlsym(g_lib_egl, "eglGetProcAddress"); ++ return EglGetProcAddress; ++ } ++ ++ return false; ++} ++ ++static bool LoadEGL() { ++ if (OpenEGL()) { ++ EglBindAPI = (eglBindAPI_func)EglGetProcAddress("eglBindAPI"); ++ EglCreateContext = ++ (eglCreateContext_func)EglGetProcAddress("eglCreateContext"); ++ EglDestroyContext = ++ (eglDestroyContext_func)EglGetProcAddress("eglDestroyContext"); ++ EglTerminate = (eglTerminate_func)EglGetProcAddress("eglTerminate"); ++ EglCreateImageKHR = ++ (eglCreateImageKHR_func)EglGetProcAddress("eglCreateImageKHR"); ++ EglDestroyImageKHR = ++ (eglDestroyImageKHR_func)EglGetProcAddress("eglDestroyImageKHR"); ++ EglGetError = (eglGetError_func)EglGetProcAddress("eglGetError"); ++ EglGetPlatformDisplayEXT = (eglGetPlatformDisplayEXT_func)EglGetProcAddress( ++ "eglGetPlatformDisplayEXT"); ++ EglGetPlatformDisplay = ++ (eglGetPlatformDisplay_func)EglGetProcAddress("eglGetPlatformDisplay"); ++ EglInitialize = (eglInitialize_func)EglGetProcAddress("eglInitialize"); ++ EglMakeCurrent = (eglMakeCurrent_func)EglGetProcAddress("eglMakeCurrent"); ++ EglQueryString = (eglQueryString_func)EglGetProcAddress("eglQueryString"); ++ GlEGLImageTargetTexture2DOES = ++ (glEGLImageTargetTexture2DOES_func)EglGetProcAddress( ++ "glEGLImageTargetTexture2DOES"); ++ ++ return EglBindAPI && EglCreateContext && EglCreateImageKHR && ++ EglTerminate && EglDestroyContext && EglDestroyImageKHR && ++ EglGetError && EglGetPlatformDisplayEXT && EglGetPlatformDisplay && ++ EglInitialize && EglMakeCurrent && EglQueryString && ++ GlEGLImageTargetTexture2DOES; ++ } ++ ++ return false; ++} ++ ++static void* g_lib_gl = nullptr; ++ ++static bool OpenGL() { ++ std::vector names = {"libGL.so.1", "libGL.so"}; ++ for (const std::string& name : names) { ++ g_lib_gl = dlopen(name.c_str(), RTLD_NOW | RTLD_GLOBAL); ++ if (g_lib_gl) { ++ GlXGetProcAddressARB = ++ (glXGetProcAddressARB_func)dlsym(g_lib_gl, "glXGetProcAddressARB"); ++ return GlXGetProcAddressARB; ++ } ++ } ++ ++ return false; ++} ++ ++static bool LoadGL() { ++ if (OpenGL()) { ++ GlGetString = (glGetString_func)GlXGetProcAddressARB("glGetString"); ++ if (!GlGetString) { ++ return false; ++ } ++ ++ GlBindTexture = (glBindTexture_func)GlXGetProcAddressARB("glBindTexture"); ++ GlDeleteTextures = ++ (glDeleteTextures_func)GlXGetProcAddressARB("glDeleteTextures"); ++ GlGenTextures = (glGenTextures_func)GlXGetProcAddressARB("glGenTextures"); ++ GlGetError = (glGetError_func)GlXGetProcAddressARB("glGetError"); ++ GlGetTexImage = (glGetTexImage_func)GlXGetProcAddressARB("glGetTexImage"); ++ GlTexParameteri = ++ (glTexParameteri_func)GlXGetProcAddressARB("glTexParameteri"); ++ ++ return GlBindTexture && GlDeleteTextures && GlGenTextures && GlGetError && ++ GlGetTexImage && GlTexParameteri; ++ } ++ ++ return false; ++} ++ ++EglDmaBuf::EglDmaBuf() { ++ if (!LoadEGL()) { ++ RTC_LOG(LS_ERROR) << "Unable to load EGL entry functions."; ++ CloseLibrary(g_lib_egl); ++ return; ++ } ++ ++ if (!LoadGL()) { ++ RTC_LOG(LS_ERROR) << "Failed to load OpenGL entry functions."; ++ CloseLibrary(g_lib_gl); ++ return; ++ } ++ ++ if (!GetClientExtensions(EGL_NO_DISPLAY, EGL_EXTENSIONS)) { ++ return; ++ } ++ ++ bool has_platform_base_ext = false; ++ bool has_platform_gbm_ext = false; ++ bool has_khr_platform_gbm_ext = false; ++ ++ for (const auto& extension : egl_.extensions) { ++ if (extension == "EGL_EXT_platform_base") { ++ has_platform_base_ext = true; ++ continue; ++ } else if (extension == "EGL_MESA_platform_gbm") { ++ has_platform_gbm_ext = true; ++ continue; ++ } else if (extension == "EGL_KHR_platform_gbm") { ++ has_khr_platform_gbm_ext = true; ++ continue; ++ } ++ } ++ ++ if (!has_platform_base_ext || !has_platform_gbm_ext || ++ !has_khr_platform_gbm_ext) { ++ RTC_LOG(LS_ERROR) << "One of required EGL extensions is missing"; ++ return; ++ } ++ ++ egl_.display = EglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_KHR, ++ (void*)EGL_DEFAULT_DISPLAY, nullptr); ++ ++ if (egl_.display == EGL_NO_DISPLAY) { ++ RTC_LOG(LS_ERROR) << "Failed to obtain default EGL display: " ++ << FormatEGLError(EglGetError()) << "\n" ++ << "Defaulting to using first available render node"; ++ absl::optional render_node = GetRenderNode(); ++ if (!render_node) { ++ return; ++ } ++ ++ drm_fd_ = open(render_node->c_str(), O_RDWR); ++ ++ if (drm_fd_ < 0) { ++ RTC_LOG(LS_ERROR) << "Failed to open drm render node: " ++ << strerror(errno); ++ return; ++ } ++ ++ gbm_device_ = gbm_create_device(drm_fd_); ++ ++ if (!gbm_device_) { ++ RTC_LOG(LS_ERROR) << "Cannot create GBM device: " << strerror(errno); ++ close(drm_fd_); ++ return; ++ } ++ ++ // Use eglGetPlatformDisplayEXT() to get the display pointer ++ // if the implementation supports it. ++ egl_.display = ++ EglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_KHR, gbm_device_, nullptr); ++ } ++ ++ if (egl_.display == EGL_NO_DISPLAY) { ++ RTC_LOG(LS_ERROR) << "Error during obtaining EGL display: " ++ << FormatEGLError(EglGetError()); ++ return; ++ } ++ ++ EGLint major, minor; ++ if (EglInitialize(egl_.display, &major, &minor) == EGL_FALSE) { ++ RTC_LOG(LS_ERROR) << "Error during eglInitialize: " ++ << FormatEGLError(EglGetError()); ++ return; ++ } ++ ++ if (EglBindAPI(EGL_OPENGL_API) == EGL_FALSE) { ++ RTC_LOG(LS_ERROR) << "bind OpenGL API failed"; ++ return; ++ } ++ ++ egl_.context = ++ EglCreateContext(egl_.display, nullptr, EGL_NO_CONTEXT, nullptr); ++ ++ if (egl_.context == EGL_NO_CONTEXT) { ++ RTC_LOG(LS_ERROR) << "Couldn't create EGL context: " ++ << FormatGLError(EglGetError()); ++ return; ++ } ++ ++ if (!GetClientExtensions(egl_.display, EGL_EXTENSIONS)) { ++ return; ++ } ++ ++ bool has_image_dma_buf_import_modifiers_ext = false; ++ ++ for (const auto& extension : egl_.extensions) { ++ if (extension == "EGL_EXT_image_dma_buf_import") { ++ has_image_dma_buf_import_ext_ = true; ++ continue; ++ } else if (extension == "EGL_EXT_image_dma_buf_import_modifiers") { ++ has_image_dma_buf_import_modifiers_ext = true; ++ continue; ++ } ++ } ++ ++ if (has_image_dma_buf_import_ext_ && has_image_dma_buf_import_modifiers_ext) { ++ EglQueryDmaBufFormatsEXT = (eglQueryDmaBufFormatsEXT_func)EglGetProcAddress( ++ "eglQueryDmaBufFormatsEXT"); ++ EglQueryDmaBufModifiersEXT = ++ (eglQueryDmaBufModifiersEXT_func)EglGetProcAddress( ++ "eglQueryDmaBufModifiersEXT"); ++ } ++ ++ RTC_LOG(LS_INFO) << "Egl initialization succeeded"; ++ egl_initialized_ = true; ++} ++ ++EglDmaBuf::~EglDmaBuf() { ++ if (gbm_device_) { ++ gbm_device_destroy(gbm_device_); ++ close(drm_fd_); ++ } ++ ++ if (egl_.context != EGL_NO_CONTEXT) { ++ EglDestroyContext(egl_.display, egl_.context); ++ } ++ ++ if (egl_.display != EGL_NO_DISPLAY) { ++ EglTerminate(egl_.display); ++ } ++ ++ // BUG: crbug.com/1290566 ++ // Closing libEGL.so.1 when using NVidia drivers causes a crash ++ // when EglGetPlatformDisplayEXT() is used, at least this one is enough ++ // to be called to make it crash. ++ // It also looks that libepoxy and glad don't dlclose it either ++ // CloseLibrary(g_lib_egl); ++ // CloseLibrary(g_lib_gl); ++} ++ ++bool EglDmaBuf::GetClientExtensions(EGLDisplay dpy, EGLint name) { ++ // Get the list of client extensions ++ const char* client_extensions_cstring = EglQueryString(dpy, name); ++ if (!client_extensions_cstring) { ++ // If eglQueryString() returned NULL, the implementation doesn't support ++ // EGL_EXT_client_extensions. Expect an EGL_BAD_DISPLAY error. ++ RTC_LOG(LS_ERROR) << "No client extensions defined! " ++ << FormatEGLError(EglGetError()); ++ return false; ++ } ++ ++ std::vector client_extensions; ++ rtc::split(client_extensions_cstring, ' ', ++ &client_extensions); ++ for (const auto& extension : client_extensions) { ++ egl_.extensions.push_back(extension); ++ } ++ ++ return true; ++} ++ ++std::unique_ptr EglDmaBuf::ImageFromDmaBuf( ++ const DesktopSize& size, ++ uint32_t format, ++ const std::vector& plane_datas, ++ uint64_t modifier) { ++ std::unique_ptr src; ++ ++ if (!egl_initialized_) { ++ return src; ++ } ++ ++ if (plane_datas.size() <= 0) { ++ RTC_LOG(LS_ERROR) << "Failed to process buffer: invalid number of planes"; ++ return src; ++ } ++ ++ EGLint attribs[47]; ++ int atti = 0; ++ ++ attribs[atti++] = EGL_WIDTH; ++ attribs[atti++] = static_cast(size.width()); ++ attribs[atti++] = EGL_HEIGHT; ++ attribs[atti++] = static_cast(size.height()); ++ attribs[atti++] = EGL_LINUX_DRM_FOURCC_EXT; ++ attribs[atti++] = SpaPixelFormatToDrmFormat(format); ++ ++ if (plane_datas.size() > 0) { ++ attribs[atti++] = EGL_DMA_BUF_PLANE0_FD_EXT; ++ attribs[atti++] = plane_datas[0].fd; ++ attribs[atti++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT; ++ attribs[atti++] = plane_datas[0].offset; ++ attribs[atti++] = EGL_DMA_BUF_PLANE0_PITCH_EXT; ++ attribs[atti++] = plane_datas[0].stride; ++ ++ if (modifier != DRM_FORMAT_MOD_INVALID) { ++ attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT; ++ attribs[atti++] = modifier & 0xFFFFFFFF; ++ attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT; ++ attribs[atti++] = modifier >> 32; ++ } ++ } ++ ++ if (plane_datas.size() > 1) { ++ attribs[atti++] = EGL_DMA_BUF_PLANE1_FD_EXT; ++ attribs[atti++] = plane_datas[1].fd; ++ attribs[atti++] = EGL_DMA_BUF_PLANE1_OFFSET_EXT; ++ attribs[atti++] = plane_datas[1].offset; ++ attribs[atti++] = EGL_DMA_BUF_PLANE1_PITCH_EXT; ++ attribs[atti++] = plane_datas[1].stride; ++ ++ if (modifier != DRM_FORMAT_MOD_INVALID) { ++ attribs[atti++] = EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT; ++ attribs[atti++] = modifier & 0xFFFFFFFF; ++ attribs[atti++] = EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT; ++ attribs[atti++] = modifier >> 32; ++ } ++ } ++ ++ if (plane_datas.size() > 2) { ++ attribs[atti++] = EGL_DMA_BUF_PLANE2_FD_EXT; ++ attribs[atti++] = plane_datas[2].fd; ++ attribs[atti++] = EGL_DMA_BUF_PLANE2_OFFSET_EXT; ++ attribs[atti++] = plane_datas[2].offset; ++ attribs[atti++] = EGL_DMA_BUF_PLANE2_PITCH_EXT; ++ attribs[atti++] = plane_datas[2].stride; ++ ++ if (modifier != DRM_FORMAT_MOD_INVALID) { ++ attribs[atti++] = EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT; ++ attribs[atti++] = modifier & 0xFFFFFFFF; ++ attribs[atti++] = EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT; ++ attribs[atti++] = modifier >> 32; ++ } ++ } ++ ++ if (plane_datas.size() > 3) { ++ attribs[atti++] = EGL_DMA_BUF_PLANE3_FD_EXT; ++ attribs[atti++] = plane_datas[3].fd; ++ attribs[atti++] = EGL_DMA_BUF_PLANE3_OFFSET_EXT; ++ attribs[atti++] = plane_datas[3].offset; ++ attribs[atti++] = EGL_DMA_BUF_PLANE3_PITCH_EXT; ++ attribs[atti++] = plane_datas[3].stride; ++ ++ if (modifier != DRM_FORMAT_MOD_INVALID) { ++ attribs[atti++] = EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT; ++ attribs[atti++] = modifier & 0xFFFFFFFF; ++ attribs[atti++] = EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT; ++ attribs[atti++] = modifier >> 32; ++ } ++ } ++ ++ attribs[atti++] = EGL_NONE; ++ ++ // bind context to render thread ++ EglMakeCurrent(egl_.display, EGL_NO_SURFACE, EGL_NO_SURFACE, egl_.context); ++ ++ // create EGL image from attribute list ++ EGLImageKHR image = EglCreateImageKHR( ++ egl_.display, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, nullptr, attribs); ++ ++ if (image == EGL_NO_IMAGE) { ++ RTC_LOG(LS_ERROR) << "Failed to record frame: Error creating EGLImage - " ++ << FormatEGLError(EglGetError()); ++ return src; ++ } ++ ++ // create GL 2D texture for framebuffer ++ GLuint texture; ++ GlGenTextures(1, &texture); ++ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); ++ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); ++ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); ++ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); ++ GlBindTexture(GL_TEXTURE_2D, texture); ++ GlEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image); ++ ++ src = std::make_unique(plane_datas[0].stride * size.height()); ++ ++ GLenum gl_format = GL_BGRA; ++ switch (format) { ++ case SPA_VIDEO_FORMAT_RGBx: ++ gl_format = GL_RGBA; ++ break; ++ case SPA_VIDEO_FORMAT_RGBA: ++ gl_format = GL_RGBA; ++ break; ++ case SPA_VIDEO_FORMAT_BGRx: ++ gl_format = GL_BGRA; ++ break; ++ default: ++ gl_format = GL_BGRA; ++ break; ++ } ++ GlGetTexImage(GL_TEXTURE_2D, 0, gl_format, GL_UNSIGNED_BYTE, src.get()); ++ ++ if (GlGetError()) { ++ RTC_LOG(LS_ERROR) << "Failed to get image from DMA buffer."; ++ return src; ++ } ++ ++ GlDeleteTextures(1, &texture); ++ EglDestroyImageKHR(egl_.display, image); ++ ++ return src; ++} ++ ++std::vector EglDmaBuf::QueryDmaBufModifiers(uint32_t format) { ++ if (!egl_initialized_) { ++ return {}; ++ } ++ ++ // Explicit modifiers not supported, return just DRM_FORMAT_MOD_INVALID as we ++ // can still use modifier-less DMA-BUFs if we have required extension ++ if (EglQueryDmaBufFormatsEXT == nullptr || ++ EglQueryDmaBufModifiersEXT == nullptr) { ++ return has_image_dma_buf_import_ext_ ++ ? std::vector{DRM_FORMAT_MOD_INVALID} ++ : std::vector{}; ++ } ++ ++ uint32_t drm_format = SpaPixelFormatToDrmFormat(format); ++ // Should never happen as it's us who controls the list of supported formats ++ RTC_DCHECK(drm_format != DRM_FORMAT_INVALID); ++ ++ EGLint count = 0; ++ EGLBoolean success = ++ EglQueryDmaBufFormatsEXT(egl_.display, 0, nullptr, &count); ++ ++ if (!success || !count) { ++ RTC_LOG(LS_ERROR) << "Failed to query DMA-BUF formats."; ++ return {DRM_FORMAT_MOD_INVALID}; ++ } ++ ++ std::vector formats(count); ++ if (!EglQueryDmaBufFormatsEXT(egl_.display, count, ++ reinterpret_cast(formats.data()), ++ &count)) { ++ RTC_LOG(LS_ERROR) << "Failed to query DMA-BUF formats."; ++ return {DRM_FORMAT_MOD_INVALID}; ++ } ++ ++ if (std::find(formats.begin(), formats.end(), drm_format) == formats.end()) { ++ RTC_LOG(LS_ERROR) << "Format " << drm_format ++ << " not supported for modifiers."; ++ return {DRM_FORMAT_MOD_INVALID}; ++ } ++ ++ success = EglQueryDmaBufModifiersEXT(egl_.display, drm_format, 0, nullptr, ++ nullptr, &count); ++ ++ if (!success || !count) { ++ RTC_LOG(LS_ERROR) << "Failed to query DMA-BUF modifiers."; ++ return {DRM_FORMAT_MOD_INVALID}; ++ } ++ ++ std::vector modifiers(count); ++ if (!EglQueryDmaBufModifiersEXT(egl_.display, drm_format, count, ++ modifiers.data(), nullptr, &count)) { ++ RTC_LOG(LS_ERROR) << "Failed to query DMA-BUF modifiers."; ++ } ++ ++ // Support modifier-less buffers ++ modifiers.push_back(DRM_FORMAT_MOD_INVALID); ++ return modifiers; ++} ++ ++absl::optional EglDmaBuf::GetRenderNode() { ++ int max_devices = drmGetDevices2(0, nullptr, 0); ++ if (max_devices <= 0) { ++ RTC_LOG(LS_ERROR) << "drmGetDevices2() has not found any devices (errno=" ++ << -max_devices << ")"; ++ return absl::nullopt; ++ } ++ ++ std::vector devices(max_devices); ++ int ret = drmGetDevices2(0, devices.data(), max_devices); ++ if (ret < 0) { ++ RTC_LOG(LS_ERROR) << "drmGetDevices2() returned an error " << ret; ++ return absl::nullopt; ++ } ++ ++ std::string render_node; ++ ++ for (const drmDevicePtr& device : devices) { ++ if (device->available_nodes & (1 << DRM_NODE_RENDER)) { ++ render_node = device->nodes[DRM_NODE_RENDER]; ++ break; ++ } ++ } ++ ++ drmFreeDevices(devices.data(), ret); ++ return render_node; ++} ++ ++} // namespace webrtc +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h +new file mode 100644 +index 0000000..b755d8b +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h +@@ -0,0 +1,68 @@ ++/* ++ * Copyright 2021 The WebRTC project authors. All Rights Reserved. ++ * ++ * Use of this source code is governed by a BSD-style license ++ * that can be found in the LICENSE file in the root of the source ++ * tree. An additional intellectual property rights grant can be found ++ * in the file PATENTS. All contributing project authors may ++ * be found in the AUTHORS file in the root of the source tree. ++ */ ++ ++#ifndef MODULES_DESKTOP_CAPTURE_LINUX_EGL_DMABUF_H_ ++#define MODULES_DESKTOP_CAPTURE_LINUX_EGL_DMABUF_H_ ++ ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include "absl/types/optional.h" ++#include "modules/desktop_capture/desktop_geometry.h" ++ ++namespace webrtc { ++ ++class EglDmaBuf { ++ public: ++ struct EGLStruct { ++ std::vector extensions; ++ EGLDisplay display = EGL_NO_DISPLAY; ++ EGLContext context = EGL_NO_CONTEXT; ++ }; ++ ++ struct PlaneData { ++ int32_t fd; ++ uint32_t stride; ++ uint32_t offset; ++ }; ++ ++ EglDmaBuf(); ++ ~EglDmaBuf(); ++ ++ std::unique_ptr ImageFromDmaBuf( ++ const DesktopSize& size, ++ uint32_t format, ++ const std::vector& plane_datas, ++ uint64_t modifiers); ++ std::vector QueryDmaBufModifiers(uint32_t format); ++ ++ bool IsEglInitialized() const { return egl_initialized_; } ++ ++ private: ++ bool GetClientExtensions(EGLDisplay dpy, EGLint name); ++ ++ bool egl_initialized_ = false; ++ bool has_image_dma_buf_import_ext_ = false; ++ int32_t drm_fd_ = -1; // for GBM buffer mmap ++ gbm_device* gbm_device_ = nullptr; // for passed GBM buffer retrieval ++ ++ EGLStruct egl_; ++ ++ absl::optional GetRenderNode(); ++}; ++ ++} // namespace webrtc ++ ++#endif // MODULES_DESKTOP_CAPTURE_LINUX_EGL_DMABUF_H_ +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc +new file mode 100644 +index 0000000..09dea24 +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc +@@ -0,0 +1,56 @@ ++/* ++ * Copyright (c) 2022 The WebRTC project authors. All Rights Reserved. ++ * ++ * Use of this source code is governed by a BSD-style license ++ * that can be found in the LICENSE file in the root of the source ++ * tree. An additional intellectual property rights grant can be found ++ * in the file PATENTS. All contributing project authors may ++ * be found in the AUTHORS file in the root of the source tree. ++ */ ++ ++#include "modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h" ++ ++#include ++ ++#include "modules/desktop_capture/desktop_capture_options.h" ++#include "modules/desktop_capture/desktop_capturer.h" ++#include "rtc_base/checks.h" ++#include "rtc_base/logging.h" ++ ++namespace webrtc { ++ ++MouseCursorMonitorPipeWire::MouseCursorMonitorPipeWire( ++ const DesktopCaptureOptions& options) ++ : options_(options) { ++} ++ ++MouseCursorMonitorPipeWire::~MouseCursorMonitorPipeWire() {} ++ ++void MouseCursorMonitorPipeWire::Init(Callback* callback, Mode mode) { ++ RTC_DCHECK(!callback_); ++ RTC_DCHECK(callback); ++ ++ callback_ = callback; ++ mode_ = mode; ++} ++ ++void MouseCursorMonitorPipeWire::Capture() { ++ RTC_DCHECK(callback_); ++ ++ std::unique_ptr mouse_cursor = ++ options_.screencast_stream()->CaptureCursor(); ++ ++ if (mouse_cursor && mouse_cursor->image()->data()) { ++ callback_->OnMouseCursor(mouse_cursor.release()); ++ } ++ ++ if (mode_ == SHAPE_AND_POSITION) { ++ absl::optional mouse_cursor_position = ++ options_.screencast_stream()->CaptureCursorPosition(); ++ if (mouse_cursor_position) { ++ callback_->OnMouseCursorPosition(mouse_cursor_position.value()); ++ } ++ } ++} ++ ++} // namespace webrtc +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h +new file mode 100644 +index 0000000..9b9ccf7 +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h +@@ -0,0 +1,41 @@ ++/* ++ * Copyright 2022 The WebRTC project authors. All Rights Reserved. ++ * ++ * Use of this source code is governed by a BSD-style license ++ * that can be found in the LICENSE file in the root of the source ++ * tree. An additional intellectual property rights grant can be found ++ * in the file PATENTS. All contributing project authors may ++ * be found in the AUTHORS file in the root of the source tree. ++ */ ++ ++#ifndef MODULES_DESKTOP_CAPTURE_LINUX_MOUSE_CURSOR_MONITOR_PIPEWIRE_H_ ++#define MODULES_DESKTOP_CAPTURE_LINUX_MOUSE_CURSOR_MONITOR_PIPEWIRE_H_ ++ ++#include ++ ++#include "api/scoped_refptr.h" ++#include "modules/desktop_capture/desktop_capture_options.h" ++#include "modules/desktop_capture/desktop_capture_types.h" ++#include "modules/desktop_capture/linux/shared_screencast_stream.h" ++#include "modules/desktop_capture/mouse_cursor.h" ++#include "modules/desktop_capture/mouse_cursor_monitor.h" ++ ++namespace webrtc { ++ ++class MouseCursorMonitorPipeWire : public MouseCursorMonitor { ++ public: ++ explicit MouseCursorMonitorPipeWire(const DesktopCaptureOptions& options); ++ ~MouseCursorMonitorPipeWire() override; ++ ++ // MouseCursorMonitor: ++ void Init(Callback* callback, Mode mode) override; ++ void Capture() override; ++ ++ DesktopCaptureOptions options_; ++ Callback* callback_ = nullptr; ++ Mode mode_ = SHAPE_AND_POSITION; ++}; ++ ++} // namespace webrtc ++ ++#endif // MODULES_DESKTOP_CAPTURE_LINUX_MOUSE_CURSOR_MONITOR_PIPEWIRE_H_ +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs +index 3e21e9d..06a97b8 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs +@@ -7,38 +7,44 @@ + //------------------------------------------------ + + // core.h +-void pw_core_destroy(pw_core *core); +-pw_type *pw_core_get_type(pw_core *core); +-pw_core * pw_core_new(pw_loop *main_loop, pw_properties *props); ++int pw_core_disconnect(pw_core *core); + + // loop.h + void pw_loop_destroy(pw_loop *loop); +-pw_loop * pw_loop_new(pw_properties *properties); ++pw_loop * pw_loop_new(const spa_dict *props); ++ + + // pipewire.h + void pw_init(int *argc, char **argv[]); ++const char* pw_get_library_version(); + + // properties.h + pw_properties * pw_properties_new_string(const char *args); + +-// remote.h +-void pw_remote_add_listener(pw_remote *remote, spa_hook *listener, const pw_remote_events *events, void *data); +-int pw_remote_connect_fd(pw_remote *remote, int fd); +-void pw_remote_destroy(pw_remote *remote); +-pw_remote * pw_remote_new(pw_core *core, pw_properties *properties, size_t user_data_size); +- + // stream.h + void pw_stream_add_listener(pw_stream *stream, spa_hook *listener, const pw_stream_events *events, void *data); +-int pw_stream_connect(pw_stream *stream, enum pw_direction direction, const char *port_path, enum pw_stream_flags flags, const spa_pod **params, uint32_t n_params); ++int pw_stream_connect(pw_stream *stream, enum pw_direction direction, uint32_t target_id, enum pw_stream_flags flags, const spa_pod **params, uint32_t n_params); ++int pw_stream_disconnect(pw_stream *stream); + pw_buffer *pw_stream_dequeue_buffer(pw_stream *stream); + void pw_stream_destroy(pw_stream *stream); +-void pw_stream_finish_format(pw_stream *stream, int res, const spa_pod **params, uint32_t n_params); +-pw_stream * pw_stream_new(pw_remote *remote, const char *name, pw_properties *props); ++pw_stream * pw_stream_new(pw_core *core, const char *name, pw_properties *props); + int pw_stream_queue_buffer(pw_stream *stream, pw_buffer *buffer); + int pw_stream_set_active(pw_stream *stream, bool active); ++int pw_stream_update_params(pw_stream *stream, const spa_pod **params, uint32_t n_params); + + // thread-loop.h + void pw_thread_loop_destroy(pw_thread_loop *loop); +-pw_thread_loop * pw_thread_loop_new(pw_loop *loop, const char *name); ++pw_thread_loop * pw_thread_loop_new(const char *name, const spa_dict *props); + int pw_thread_loop_start(pw_thread_loop *loop); + void pw_thread_loop_stop(pw_thread_loop *loop); ++void pw_thread_loop_lock(pw_thread_loop *loop); ++void pw_thread_loop_unlock(pw_thread_loop *loop); ++pw_loop * pw_thread_loop_get_loop(pw_thread_loop *loop); ++void pw_thread_loop_signal(pw_thread_loop *loop, bool wait_for_accept); ++void pw_thread_loop_wait(pw_thread_loop *loop); ++ ++// context.h ++void pw_context_destroy(pw_context *context); ++pw_context *pw_context_new(pw_loop *main_loop, pw_properties *props, size_t user_data_size); ++pw_core * pw_context_connect(pw_context *context, pw_properties *properties, size_t user_data_size); ++pw_core * pw_context_connect_fd(pw_context *context, int fd, pw_properties *properties, size_t user_data_size); +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment +index 9d7dbd2..06ae18d 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment +@@ -5,4 +5,5 @@ extern "C" { + + #include + ++#include + } +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc +new file mode 100644 +index 0000000..51ca57a +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc +@@ -0,0 +1,57 @@ ++/* ++ * Copyright 2022 The WebRTC project authors. All Rights Reserved. ++ * ++ * Use of this source code is governed by a BSD-style license ++ * that can be found in the LICENSE file in the root of the source ++ * tree. An additional intellectual property rights grant can be found ++ * in the file PATENTS. All contributing project authors may ++ * be found in the AUTHORS file in the root of the source tree. ++ */ ++ ++#include "modules/desktop_capture/linux/scoped_glib.h" ++ ++namespace webrtc { ++ ++template <> ++Scoped::~Scoped() { ++ if (ptr_) { ++ g_error_free(ptr_); ++ } ++} ++ ++template <> ++Scoped::~Scoped() { ++ if (ptr_) { ++ g_free(ptr_); ++ } ++} ++ ++template <> ++Scoped::~Scoped() { ++ if (ptr_) { ++ g_variant_unref(ptr_); ++ } ++} ++ ++template <> ++Scoped::~Scoped() { ++ if (ptr_) { ++ g_variant_iter_free(ptr_); ++ } ++} ++ ++template <> ++Scoped::~Scoped() { ++ if (ptr_) { ++ g_object_unref(ptr_); ++ } ++} ++ ++template <> ++Scoped::~Scoped() { ++ if (ptr_) { ++ g_object_unref(ptr_); ++ } ++} ++ ++} // namespace webrtc +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h +new file mode 100644 +index 0000000..bf77855 +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h +@@ -0,0 +1,65 @@ ++/* ++ * Copyright 2022 The WebRTC project authors. All Rights Reserved. ++ * ++ * Use of this source code is governed by a BSD-style license ++ * that can be found in the LICENSE file in the root of the source ++ * tree. An additional intellectual property rights grant can be found ++ * in the file PATENTS. All contributing project authors may ++ * be found in the AUTHORS file in the root of the source tree. ++ */ ++ ++#ifndef MODULES_DESKTOP_CAPTURE_LINUX_SCOPED_GLIB_H_ ++#define MODULES_DESKTOP_CAPTURE_LINUX_SCOPED_GLIB_H_ ++ ++#include ++ ++#include "rtc_base/checks.h" ++ ++namespace webrtc { ++ ++template ++class Scoped { ++ public: ++ Scoped() {} ++ explicit Scoped(T* val) { ptr_ = val; } ++ ~Scoped() { RTC_DCHECK_NOTREACHED(); } ++ ++ T* operator->() const { return ptr_; } ++ ++ explicit operator bool() const { return ptr_ != nullptr; } ++ ++ bool operator!() const { return ptr_ == nullptr; } ++ ++ T* get() const { return ptr_; } ++ ++ T** receive() { ++ RTC_CHECK(!ptr_); ++ return &ptr_; ++ } ++ ++ Scoped& operator=(T* val) { ++ RTC_DCHECK(val); ++ ptr_ = val; ++ return *this; ++ } ++ ++ protected: ++ T* ptr_ = nullptr; ++}; ++ ++template <> ++Scoped::~Scoped(); ++template <> ++Scoped::~Scoped(); ++template <> ++Scoped::~Scoped(); ++template <> ++Scoped::~Scoped(); ++template <> ++Scoped::~Scoped(); ++template <> ++Scoped::~Scoped(); ++ ++} // namespace webrtc ++ ++#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCOPED_GLIB_H_ +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc +deleted file mode 100644 +index 3813d69..0000000 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc ++++ /dev/null +@@ -1,28 +0,0 @@ +-/* +- * Copyright 2018 The WebRTC project authors. All Rights Reserved. +- * +- * Use of this source code is governed by a BSD-style license +- * that can be found in the LICENSE file in the root of the source +- * tree. An additional intellectual property rights grant can be found +- * in the file PATENTS. All contributing project authors may +- * be found in the AUTHORS file in the root of the source tree. +- */ +- +-#include "modules/desktop_capture/linux/screen_capturer_pipewire.h" +- +-#include +- +-namespace webrtc { +- +-ScreenCapturerPipeWire::ScreenCapturerPipeWire() +- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kScreen) {} +-ScreenCapturerPipeWire::~ScreenCapturerPipeWire() {} +- +-// static +-std::unique_ptr +-ScreenCapturerPipeWire::CreateRawScreenCapturer( +- const DesktopCaptureOptions& options) { +- return std::make_unique(); +-} +- +-} // namespace webrtc +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h +deleted file mode 100644 +index 66dcd68..0000000 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h ++++ /dev/null +@@ -1,33 +0,0 @@ +-/* +- * Copyright 2018 The WebRTC project authors. All Rights Reserved. +- * +- * Use of this source code is governed by a BSD-style license +- * that can be found in the LICENSE file in the root of the source +- * tree. An additional intellectual property rights grant can be found +- * in the file PATENTS. All contributing project authors may +- * be found in the AUTHORS file in the root of the source tree. +- */ +- +-#ifndef MODULES_DESKTOP_CAPTURE_LINUX_SCREEN_CAPTURER_PIPEWIRE_H_ +-#define MODULES_DESKTOP_CAPTURE_LINUX_SCREEN_CAPTURER_PIPEWIRE_H_ +- +-#include +- +-#include "modules/desktop_capture/linux/base_capturer_pipewire.h" +- +-namespace webrtc { +- +-class ScreenCapturerPipeWire : public BaseCapturerPipeWire { +- public: +- ScreenCapturerPipeWire(); +- ~ScreenCapturerPipeWire() override; +- +- static std::unique_ptr CreateRawScreenCapturer( +- const DesktopCaptureOptions& options); +- +- RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerPipeWire); +-}; +- +-} // namespace webrtc +- +-#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCREEN_CAPTURER_PIPEWIRE_H_ +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc +new file mode 100644 +index 0000000..306e984 +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc +@@ -0,0 +1,532 @@ ++/* ++ * Copyright 2022 The WebRTC project authors. All Rights Reserved. ++ * ++ * Use of this source code is governed by a BSD-style license ++ * that can be found in the LICENSE file in the root of the source ++ * tree. An additional intellectual property rights grant can be found ++ * in the file PATENTS. All contributing project authors may ++ * be found in the AUTHORS file in the root of the source tree. ++ */ ++ ++#include "modules/desktop_capture/linux/screencast_portal.h" ++ ++#include ++#include ++ ++#include "modules/desktop_capture/linux/scoped_glib.h" ++#include "rtc_base/checks.h" ++#include "rtc_base/logging.h" ++ ++namespace webrtc { ++ ++const char kDesktopBusName[] = "org.freedesktop.portal.Desktop"; ++const char kDesktopObjectPath[] = "/org/freedesktop/portal/desktop"; ++const char kDesktopRequestObjectPath[] = ++ "/org/freedesktop/portal/desktop/request"; ++const char kSessionInterfaceName[] = "org.freedesktop.portal.Session"; ++const char kRequestInterfaceName[] = "org.freedesktop.portal.Request"; ++const char kScreenCastInterfaceName[] = "org.freedesktop.portal.ScreenCast"; ++ ++ScreenCastPortal::ScreenCastPortal(CaptureSourceType source_type, ++ PortalNotifier* notifier) ++ : notifier_(notifier), capture_source_type_(source_type) {} ++ ++ScreenCastPortal::~ScreenCastPortal() { ++ if (start_request_signal_id_) { ++ g_dbus_connection_signal_unsubscribe(connection_, start_request_signal_id_); ++ } ++ if (sources_request_signal_id_) { ++ g_dbus_connection_signal_unsubscribe(connection_, ++ sources_request_signal_id_); ++ } ++ if (session_request_signal_id_) { ++ g_dbus_connection_signal_unsubscribe(connection_, ++ session_request_signal_id_); ++ } ++ ++ if (!session_handle_.empty()) { ++ Scoped message( ++ g_dbus_message_new_method_call(kDesktopBusName, session_handle_.c_str(), ++ kSessionInterfaceName, "Close")); ++ if (message.get()) { ++ Scoped error; ++ g_dbus_connection_send_message(connection_, message.get(), ++ G_DBUS_SEND_MESSAGE_FLAGS_NONE, ++ /*out_serial=*/nullptr, error.receive()); ++ if (error.get()) { ++ RTC_LOG(LS_ERROR) << "Failed to close the session: " << error->message; ++ } ++ } ++ } ++ ++ if (cancellable_) { ++ g_cancellable_cancel(cancellable_); ++ g_object_unref(cancellable_); ++ cancellable_ = nullptr; ++ } ++ ++ if (proxy_) { ++ g_object_unref(proxy_); ++ proxy_ = nullptr; ++ } ++ ++ if (pw_fd_ != -1) { ++ close(pw_fd_); ++ } ++} ++ ++void ScreenCastPortal::Start() { ++ cancellable_ = g_cancellable_new(); ++ g_dbus_proxy_new_for_bus( ++ G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, /*info=*/nullptr, ++ kDesktopBusName, kDesktopObjectPath, kScreenCastInterfaceName, ++ cancellable_, reinterpret_cast(OnProxyRequested), ++ this); ++} ++ ++void ScreenCastPortal::PortalFailed(RequestResponse result) { ++ notifier_->OnScreenCastRequestResult(result, pw_stream_node_id_, pw_fd_); ++} ++ ++uint32_t ScreenCastPortal::SetupRequestResponseSignal( ++ const char* object_path, ++ GDBusSignalCallback callback) { ++ return g_dbus_connection_signal_subscribe( ++ connection_, kDesktopBusName, kRequestInterfaceName, "Response", ++ object_path, /*arg0=*/nullptr, G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE, ++ callback, this, /*user_data_free_func=*/nullptr); ++} ++ ++// static ++void ScreenCastPortal::OnProxyRequested(GObject* /*object*/, ++ GAsyncResult* result, ++ gpointer user_data) { ++ ScreenCastPortal* that = static_cast(user_data); ++ RTC_DCHECK(that); ++ ++ Scoped error; ++ GDBusProxy* proxy = g_dbus_proxy_new_finish(result, error.receive()); ++ if (!proxy) { ++ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) ++ return; ++ RTC_LOG(LS_ERROR) << "Failed to create a proxy for the screen cast portal: " ++ << error->message; ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ that->proxy_ = proxy; ++ that->connection_ = g_dbus_proxy_get_connection(that->proxy_); ++ ++ RTC_LOG(LS_INFO) << "Created proxy for the screen cast portal."; ++ ++ that->SessionRequest(); ++} ++ ++// static ++std::string ScreenCastPortal::PrepareSignalHandle(GDBusConnection* connection, ++ const char* token) { ++ Scoped sender( ++ g_strdup(g_dbus_connection_get_unique_name(connection) + 1)); ++ for (int i = 0; sender.get()[i]; ++i) { ++ if (sender.get()[i] == '.') { ++ sender.get()[i] = '_'; ++ } ++ } ++ ++ const char* handle = g_strconcat(kDesktopRequestObjectPath, "/", sender.get(), ++ "/", token, /*end of varargs*/ nullptr); ++ ++ return handle; ++} ++ ++void ScreenCastPortal::SessionRequest() { ++ GVariantBuilder builder; ++ Scoped variant_string; ++ ++ g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); ++ variant_string = ++ g_strdup_printf("webrtc_session%d", g_random_int_range(0, G_MAXINT)); ++ g_variant_builder_add(&builder, "{sv}", "session_handle_token", ++ g_variant_new_string(variant_string.get())); ++ variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); ++ g_variant_builder_add(&builder, "{sv}", "handle_token", ++ g_variant_new_string(variant_string.get())); ++ ++ portal_handle_ = PrepareSignalHandle(connection_, variant_string.get()); ++ session_request_signal_id_ = SetupRequestResponseSignal( ++ portal_handle_.c_str(), OnSessionRequestResponseSignal); ++ ++ RTC_LOG(LS_INFO) << "Screen cast session requested."; ++ g_dbus_proxy_call(proxy_, "CreateSession", g_variant_new("(a{sv})", &builder), ++ G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, ++ reinterpret_cast(OnSessionRequested), ++ this); ++} ++ ++// static ++void ScreenCastPortal::OnSessionRequested(GDBusProxy* proxy, ++ GAsyncResult* result, ++ gpointer user_data) { ++ ScreenCastPortal* that = static_cast(user_data); ++ RTC_DCHECK(that); ++ ++ Scoped error; ++ Scoped variant( ++ g_dbus_proxy_call_finish(proxy, result, error.receive())); ++ if (!variant) { ++ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) ++ return; ++ RTC_LOG(LS_ERROR) << "Failed to create a screen cast session: " ++ << error->message; ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ RTC_LOG(LS_INFO) << "Initializing the screen cast session."; ++ ++ Scoped handle; ++ g_variant_get_child(variant.get(), 0, "o", &handle); ++ if (!handle) { ++ RTC_LOG(LS_ERROR) << "Failed to initialize the screen cast session."; ++ if (that->session_request_signal_id_) { ++ g_dbus_connection_signal_unsubscribe(that->connection_, ++ that->session_request_signal_id_); ++ that->session_request_signal_id_ = 0; ++ } ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ ++ RTC_LOG(LS_INFO) << "Subscribing to the screen cast session."; ++} ++ ++// static ++void ScreenCastPortal::OnSessionRequestResponseSignal( ++ GDBusConnection* connection, ++ const char* sender_name, ++ const char* object_path, ++ const char* interface_name, ++ const char* signal_name, ++ GVariant* parameters, ++ gpointer user_data) { ++ ScreenCastPortal* that = static_cast(user_data); ++ RTC_DCHECK(that); ++ ++ RTC_LOG(LS_INFO) ++ << "Received response for the screen cast session subscription."; ++ ++ uint32_t portal_response; ++ Scoped response_data; ++ g_variant_get(parameters, "(u@a{sv})", &portal_response, ++ response_data.receive()); ++ Scoped session_handle( ++ g_variant_lookup_value(response_data.get(), "session_handle", nullptr)); ++ that->session_handle_ = g_variant_dup_string(session_handle.get(), nullptr); ++ ++ if (that->session_handle_.empty() || portal_response) { ++ RTC_LOG(LS_ERROR) ++ << "Failed to request the screen cast session subscription."; ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ ++ that->session_closed_signal_id_ = g_dbus_connection_signal_subscribe( ++ that->connection_, kDesktopBusName, kSessionInterfaceName, "Closed", ++ that->session_handle_.c_str(), /*arg0=*/nullptr, G_DBUS_SIGNAL_FLAGS_NONE, ++ OnSessionClosedSignal, that, /*user_data_free_func=*/nullptr); ++ ++ that->SourcesRequest(); ++} ++ ++// static ++void ScreenCastPortal::OnSessionClosedSignal(GDBusConnection* connection, ++ const char* sender_name, ++ const char* object_path, ++ const char* interface_name, ++ const char* signal_name, ++ GVariant* parameters, ++ gpointer user_data) { ++ ScreenCastPortal* that = static_cast(user_data); ++ RTC_DCHECK(that); ++ ++ RTC_LOG(LS_INFO) << "Received closed signal from session."; ++ ++ that->notifier_->OnScreenCastSessionClosed(); ++ ++ // Unsubscribe from the signal and free the session handle to avoid calling ++ // Session::Close from the destructor since it's already closed ++ g_dbus_connection_signal_unsubscribe(that->connection_, ++ that->session_closed_signal_id_); ++} ++ ++void ScreenCastPortal::SourcesRequest() { ++ GVariantBuilder builder; ++ Scoped variant_string; ++ ++ g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); ++ // We want to record monitor content. ++ g_variant_builder_add( ++ &builder, "{sv}", "types", ++ g_variant_new_uint32(static_cast(capture_source_type_))); ++ // We don't want to allow selection of multiple sources. ++ g_variant_builder_add(&builder, "{sv}", "multiple", ++ g_variant_new_boolean(false)); ++ ++ Scoped variant( ++ g_dbus_proxy_get_cached_property(proxy_, "AvailableCursorModes")); ++ if (variant.get()) { ++ uint32_t modes = 0; ++ g_variant_get(variant.get(), "u", &modes); ++ // Make request only if this mode is advertised by the portal ++ // implementation. ++ if (modes & static_cast(cursor_mode_)) { ++ g_variant_builder_add( ++ &builder, "{sv}", "cursor_mode", ++ g_variant_new_uint32(static_cast(cursor_mode_))); ++ } ++ } ++ ++ variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); ++ g_variant_builder_add(&builder, "{sv}", "handle_token", ++ g_variant_new_string(variant_string.get())); ++ ++ sources_handle_ = PrepareSignalHandle(connection_, variant_string.get()); ++ sources_request_signal_id_ = SetupRequestResponseSignal( ++ sources_handle_.c_str(), OnSourcesRequestResponseSignal); ++ ++ RTC_LOG(LS_INFO) << "Requesting sources from the screen cast session."; ++ g_dbus_proxy_call( ++ proxy_, "SelectSources", ++ g_variant_new("(oa{sv})", session_handle_.c_str(), &builder), ++ G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, ++ reinterpret_cast(OnSourcesRequested), this); ++} ++ ++// static ++void ScreenCastPortal::OnSourcesRequested(GDBusProxy* proxy, ++ GAsyncResult* result, ++ gpointer user_data) { ++ ScreenCastPortal* that = static_cast(user_data); ++ RTC_DCHECK(that); ++ ++ Scoped error; ++ Scoped variant( ++ g_dbus_proxy_call_finish(proxy, result, error.receive())); ++ if (!variant) { ++ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) ++ return; ++ RTC_LOG(LS_ERROR) << "Failed to request the sources: " << error->message; ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ ++ RTC_LOG(LS_INFO) << "Sources requested from the screen cast session."; ++ ++ Scoped handle; ++ g_variant_get_child(variant.get(), 0, "o", handle.receive()); ++ if (!handle) { ++ RTC_LOG(LS_ERROR) << "Failed to initialize the screen cast session."; ++ if (that->sources_request_signal_id_) { ++ g_dbus_connection_signal_unsubscribe(that->connection_, ++ that->sources_request_signal_id_); ++ that->sources_request_signal_id_ = 0; ++ } ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ ++ RTC_LOG(LS_INFO) << "Subscribed to sources signal."; ++} ++ ++// static ++void ScreenCastPortal::OnSourcesRequestResponseSignal( ++ GDBusConnection* connection, ++ const char* sender_name, ++ const char* object_path, ++ const char* interface_name, ++ const char* signal_name, ++ GVariant* parameters, ++ gpointer user_data) { ++ ScreenCastPortal* that = static_cast(user_data); ++ RTC_DCHECK(that); ++ ++ RTC_LOG(LS_INFO) << "Received sources signal from session."; ++ ++ uint32_t portal_response; ++ g_variant_get(parameters, "(u@a{sv})", &portal_response, nullptr); ++ if (portal_response) { ++ RTC_LOG(LS_ERROR) ++ << "Failed to select sources for the screen cast session."; ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ ++ that->StartRequest(); ++} ++ ++void ScreenCastPortal::StartRequest() { ++ GVariantBuilder builder; ++ Scoped variant_string; ++ ++ g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); ++ variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); ++ g_variant_builder_add(&builder, "{sv}", "handle_token", ++ g_variant_new_string(variant_string.get())); ++ ++ start_handle_ = PrepareSignalHandle(connection_, variant_string.get()); ++ start_request_signal_id_ = SetupRequestResponseSignal( ++ start_handle_.c_str(), OnStartRequestResponseSignal); ++ ++ // "Identifier for the application window", this is Wayland, so not "x11:...". ++ const char parent_window[] = ""; ++ ++ RTC_LOG(LS_INFO) << "Starting the screen cast session."; ++ g_dbus_proxy_call(proxy_, "Start", ++ g_variant_new("(osa{sv})", session_handle_.c_str(), ++ parent_window, &builder), ++ G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, ++ reinterpret_cast(OnStartRequested), ++ this); ++} ++ ++// static ++void ScreenCastPortal::OnStartRequested(GDBusProxy* proxy, ++ GAsyncResult* result, ++ gpointer user_data) { ++ ScreenCastPortal* that = static_cast(user_data); ++ RTC_DCHECK(that); ++ ++ Scoped error; ++ Scoped variant( ++ g_dbus_proxy_call_finish(proxy, result, error.receive())); ++ if (!variant) { ++ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) ++ return; ++ RTC_LOG(LS_ERROR) << "Failed to start the screen cast session: " ++ << error->message; ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ ++ RTC_LOG(LS_INFO) << "Initializing the start of the screen cast session."; ++ ++ Scoped handle; ++ g_variant_get_child(variant.get(), 0, "o", handle.receive()); ++ if (!handle) { ++ RTC_LOG(LS_ERROR) ++ << "Failed to initialize the start of the screen cast session."; ++ if (that->start_request_signal_id_) { ++ g_dbus_connection_signal_unsubscribe(that->connection_, ++ that->start_request_signal_id_); ++ that->start_request_signal_id_ = 0; ++ } ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ ++ RTC_LOG(LS_INFO) << "Subscribed to the start signal."; ++} ++ ++// static ++void ScreenCastPortal::OnStartRequestResponseSignal(GDBusConnection* connection, ++ const char* sender_name, ++ const char* object_path, ++ const char* interface_name, ++ const char* signal_name, ++ GVariant* parameters, ++ gpointer user_data) { ++ ScreenCastPortal* that = static_cast(user_data); ++ RTC_DCHECK(that); ++ ++ RTC_LOG(LS_INFO) << "Start signal received."; ++ uint32_t portal_response; ++ Scoped response_data; ++ Scoped iter; ++ g_variant_get(parameters, "(u@a{sv})", &portal_response, ++ response_data.receive()); ++ if (portal_response || !response_data) { ++ RTC_LOG(LS_ERROR) << "Failed to start the screen cast session."; ++ that->PortalFailed(static_cast(portal_response)); ++ return; ++ } ++ ++ // Array of PipeWire streams. See ++ // https://github.com/flatpak/xdg-desktop-portal/blob/master/data/org.freedesktop.portal.ScreenCast.xml ++ // documentation for . ++ if (g_variant_lookup(response_data.get(), "streams", "a(ua{sv})", ++ iter.receive())) { ++ Scoped variant; ++ ++ while (g_variant_iter_next(iter.get(), "@(ua{sv})", variant.receive())) { ++ uint32_t stream_id; ++ uint32_t type; ++ Scoped options; ++ ++ g_variant_get(variant.get(), "(u@a{sv})", &stream_id, options.receive()); ++ RTC_DCHECK(options.get()); ++ ++ if (g_variant_lookup(options.get(), "source_type", "u", &type)) { ++ that->capture_source_type_ = ++ static_cast(type); ++ } ++ ++ that->pw_stream_node_id_ = stream_id; ++ ++ break; ++ } ++ } ++ ++ that->OpenPipeWireRemote(); ++} ++ ++void ScreenCastPortal::OpenPipeWireRemote() { ++ GVariantBuilder builder; ++ g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); ++ ++ RTC_LOG(LS_INFO) << "Opening the PipeWire remote."; ++ ++ g_dbus_proxy_call_with_unix_fd_list( ++ proxy_, "OpenPipeWireRemote", ++ g_variant_new("(oa{sv})", session_handle_.c_str(), &builder), ++ G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, /*fd_list=*/nullptr, cancellable_, ++ reinterpret_cast(OnOpenPipeWireRemoteRequested), ++ this); ++} ++ ++// static ++void ScreenCastPortal::OnOpenPipeWireRemoteRequested(GDBusProxy* proxy, ++ GAsyncResult* result, ++ gpointer user_data) { ++ ScreenCastPortal* that = static_cast(user_data); ++ RTC_DCHECK(that); ++ ++ Scoped error; ++ Scoped outlist; ++ Scoped variant(g_dbus_proxy_call_with_unix_fd_list_finish( ++ proxy, outlist.receive(), result, error.receive())); ++ if (!variant) { ++ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) ++ return; ++ RTC_LOG(LS_ERROR) << "Failed to open the PipeWire remote: " ++ << error->message; ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ ++ int32_t index; ++ g_variant_get(variant.get(), "(h)", &index); ++ ++ that->pw_fd_ = g_unix_fd_list_get(outlist.get(), index, error.receive()); ++ ++ if (that->pw_fd_ == -1) { ++ RTC_LOG(LS_ERROR) << "Failed to get file descriptor from the list: " ++ << error->message; ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ ++ that->notifier_->OnScreenCastRequestResult( ++ ScreenCastPortal::RequestResponse::kSuccess, that->pw_stream_node_id_, ++ that->pw_fd_); ++} ++ ++} // namespace webrtc +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h +new file mode 100644 +index 0000000..7da218e +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h +@@ -0,0 +1,169 @@ ++/* ++ * Copyright 2022 The WebRTC project authors. All Rights Reserved. ++ * ++ * Use of this source code is governed by a BSD-style license ++ * that can be found in the LICENSE file in the root of the source ++ * tree. An additional intellectual property rights grant can be found ++ * in the file PATENTS. All contributing project authors may ++ * be found in the AUTHORS file in the root of the source tree. ++ */ ++ ++#ifndef MODULES_DESKTOP_CAPTURE_LINUX_SCREENCAST_PORTAL_H_ ++#define MODULES_DESKTOP_CAPTURE_LINUX_SCREENCAST_PORTAL_H_ ++ ++#include ++ ++#include ++ ++#include "absl/types/optional.h" ++ ++namespace webrtc { ++ ++class ScreenCastPortal { ++ public: ++ // Values are set based on source type property in ++ // xdg-desktop-portal/screencast ++ // https://github.com/flatpak/xdg-desktop-portal/blob/master/data/org.freedesktop.portal.ScreenCast.xml ++ enum class CaptureSourceType : uint32_t { ++ kScreen = 0b01, ++ kWindow = 0b10, ++ kAnyScreenContent = kScreen | kWindow ++ }; ++ ++ // Values are set based on cursor mode property in ++ // xdg-desktop-portal/screencast ++ // https://github.com/flatpak/xdg-desktop-portal/blob/master/data/org.freedesktop.portal.ScreenCast.xml ++ enum class CursorMode : uint32_t { ++ // Mouse cursor will not be included in any form ++ kHidden = 0b01, ++ // Mouse cursor will be part of the screen content ++ kEmbedded = 0b10, ++ // Mouse cursor information will be send separately in form of metadata ++ kMetadata = 0b100 ++ }; ++ ++ // Interface that must be implemented by the ScreenCastPortal consumers. ++ enum class RequestResponse { ++ // Success, the request is carried out. ++ kSuccess, ++ // The user cancelled the interaction. ++ kUserCancelled, ++ // The user interaction was ended in some other way. ++ kError, ++ ++ kMaxValue = kError ++ }; ++ ++ class PortalNotifier { ++ public: ++ virtual void OnScreenCastRequestResult(RequestResponse result, ++ uint32_t stream_node_id, ++ int fd) = 0; ++ virtual void OnScreenCastSessionClosed() = 0; ++ ++ protected: ++ PortalNotifier() = default; ++ virtual ~PortalNotifier() = default; ++ }; ++ ++ explicit ScreenCastPortal(CaptureSourceType source_type, ++ PortalNotifier* notifier); ++ ~ScreenCastPortal(); ++ ++ // Initialize ScreenCastPortal with series of DBus calls where we try to ++ // obtain all the required information, like PipeWire file descriptor and ++ // PipeWire stream node ID. ++ // ++ // The observer will return whether the communication with xdg-desktop-portal ++ // was successful and only then you will be able to get all the required ++ // information in order to continue working with PipeWire. ++ void Start(); ++ ++ private: ++ PortalNotifier* notifier_; ++ ++ // A PipeWire stream ID of stream we will be connecting to ++ uint32_t pw_stream_node_id_ = 0; ++ // A file descriptor of PipeWire socket ++ int pw_fd_ = -1; ++ ++ CaptureSourceType capture_source_type_ = ++ ScreenCastPortal::CaptureSourceType::kScreen; ++ ++ CursorMode cursor_mode_ = ScreenCastPortal::CursorMode::kMetadata; ++ ++ GDBusConnection* connection_ = nullptr; ++ GDBusProxy* proxy_ = nullptr; ++ GCancellable* cancellable_ = nullptr; ++ std::string portal_handle_; ++ std::string session_handle_; ++ std::string sources_handle_; ++ std::string start_handle_; ++ guint session_request_signal_id_ = 0; ++ guint sources_request_signal_id_ = 0; ++ guint start_request_signal_id_ = 0; ++ guint session_closed_signal_id_ = 0; ++ ++ void PortalFailed(RequestResponse result); ++ ++ uint32_t SetupRequestResponseSignal(const char* object_path, ++ GDBusSignalCallback callback); ++ ++ static void OnProxyRequested(GObject* object, ++ GAsyncResult* result, ++ gpointer user_data); ++ ++ static std::string PrepareSignalHandle(GDBusConnection* connection, ++ const char* token); ++ ++ void SessionRequest(); ++ static void OnSessionRequested(GDBusProxy* proxy, ++ GAsyncResult* result, ++ gpointer user_data); ++ static void OnSessionRequestResponseSignal(GDBusConnection* connection, ++ const char* sender_name, ++ const char* object_path, ++ const char* interface_name, ++ const char* signal_name, ++ GVariant* parameters, ++ gpointer user_data); ++ static void OnSessionClosedSignal(GDBusConnection* connection, ++ const char* sender_name, ++ const char* object_path, ++ const char* interface_name, ++ const char* signal_name, ++ GVariant* parameters, ++ gpointer user_data); ++ void SourcesRequest(); ++ static void OnSourcesRequested(GDBusProxy* proxy, ++ GAsyncResult* result, ++ gpointer user_data); ++ static void OnSourcesRequestResponseSignal(GDBusConnection* connection, ++ const char* sender_name, ++ const char* object_path, ++ const char* interface_name, ++ const char* signal_name, ++ GVariant* parameters, ++ gpointer user_data); ++ ++ void StartRequest(); ++ static void OnStartRequested(GDBusProxy* proxy, ++ GAsyncResult* result, ++ gpointer user_data); ++ static void OnStartRequestResponseSignal(GDBusConnection* connection, ++ const char* sender_name, ++ const char* object_path, ++ const char* interface_name, ++ const char* signal_name, ++ GVariant* parameters, ++ gpointer user_data); ++ ++ void OpenPipeWireRemote(); ++ static void OnOpenPipeWireRemoteRequested(GDBusProxy* proxy, ++ GAsyncResult* result, ++ gpointer user_data); ++}; ++ ++} // namespace webrtc ++ ++#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCREENCAST_PORTAL_H_ +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc +new file mode 100644 +index 0000000..c6ba661 +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc +@@ -0,0 +1,872 @@ ++/* ++ * Copyright 2022 The WebRTC project authors. All Rights Reserved. ++ * ++ * Use of this source code is governed by a BSD-style license ++ * that can be found in the LICENSE file in the root of the source ++ * tree. An additional intellectual property rights grant can be found ++ * in the file PATENTS. All contributing project authors may ++ * be found in the AUTHORS file in the root of the source tree. ++ */ ++ ++#include "modules/desktop_capture/linux/shared_screencast_stream.h" ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include "absl/memory/memory.h" ++#include "modules/desktop_capture/linux/egl_dmabuf.h" ++#include "modules/desktop_capture/screen_capture_frame_queue.h" ++#include "rtc_base/checks.h" ++#include "rtc_base/logging.h" ++#include "rtc_base/sanitizer.h" ++#include "rtc_base/string_encode.h" ++#include "rtc_base/string_to_number.h" ++#include "rtc_base/synchronization/mutex.h" ++ ++#if defined(WEBRTC_DLOPEN_PIPEWIRE) ++#include "modules/desktop_capture/linux/pipewire_stubs.h" ++using modules_desktop_capture_linux_wayland::InitializeStubs; ++using modules_desktop_capture_linux_wayland::kModuleDrm; ++using modules_desktop_capture_linux_wayland::kModulePipewire; ++using modules_desktop_capture_linux_wayland::StubPathMap; ++#endif // defined(WEBRTC_DLOPEN_PIPEWIRE) ++ ++namespace webrtc { ++ ++const int kBytesPerPixel = 4; ++ ++#if defined(WEBRTC_DLOPEN_PIPEWIRE) ++const char kPipeWireLib[] = "libpipewire-0.3.so.0"; ++const char kDrmLib[] = "libdrm.so.2"; ++#endif ++ ++#if !PW_CHECK_VERSION(0, 3, 29) ++#define SPA_POD_PROP_FLAG_MANDATORY (1u << 3) ++#endif ++#if !PW_CHECK_VERSION(0, 3, 33) ++#define SPA_POD_PROP_FLAG_DONT_FIXATE (1u << 4) ++#endif ++ ++constexpr int kCursorBpp = 4; ++constexpr int CursorMetaSize(int w, int h) { ++ return (sizeof(struct spa_meta_cursor) + sizeof(struct spa_meta_bitmap) + ++ w * h * kCursorBpp); ++} ++ ++struct PipeWireVersion { ++ int major = 0; ++ int minor = 0; ++ int micro = 0; ++}; ++ ++constexpr PipeWireVersion kDmaBufMinVersion = {0, 3, 24}; ++constexpr PipeWireVersion kDmaBufModifierMinVersion = {0, 3, 33}; ++constexpr PipeWireVersion kDropSingleModifierMinVersion = {0, 3, 40}; ++ ++PipeWireVersion ParsePipeWireVersion(const char* version) { ++ std::vector parsed_version; ++ rtc::split(version, '.', &parsed_version); ++ ++ if (parsed_version.size() != 3) { ++ return {}; ++ } ++ ++ absl::optional major = rtc::StringToNumber(parsed_version.at(0)); ++ absl::optional minor = rtc::StringToNumber(parsed_version.at(1)); ++ absl::optional micro = rtc::StringToNumber(parsed_version.at(2)); ++ ++ // Return invalid version if we failed to parse it ++ if (!major || !minor || !micro) { ++ return {0, 0, 0}; ++ } ++ ++ return {major.value(), micro.value(), micro.value()}; ++} ++ ++spa_pod* BuildFormat(spa_pod_builder* builder, ++ uint32_t format, ++ const std::vector& modifiers) { ++ bool first = true; ++ spa_pod_frame frames[2]; ++ spa_rectangle pw_min_screen_bounds = spa_rectangle{1, 1}; ++ spa_rectangle pw_max_screen_bounds = spa_rectangle{UINT32_MAX, UINT32_MAX}; ++ ++ spa_pod_builder_push_object(builder, &frames[0], SPA_TYPE_OBJECT_Format, ++ SPA_PARAM_EnumFormat); ++ spa_pod_builder_add(builder, SPA_FORMAT_mediaType, ++ SPA_POD_Id(SPA_MEDIA_TYPE_video), 0); ++ spa_pod_builder_add(builder, SPA_FORMAT_mediaSubtype, ++ SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw), 0); ++ spa_pod_builder_add(builder, SPA_FORMAT_VIDEO_format, SPA_POD_Id(format), 0); ++ ++ if (modifiers.size()) { ++ if (modifiers.size() == 1 && modifiers[0] == DRM_FORMAT_MOD_INVALID) { ++ spa_pod_builder_prop(builder, SPA_FORMAT_VIDEO_modifier, ++ SPA_POD_PROP_FLAG_MANDATORY); ++ spa_pod_builder_long(builder, modifiers[0]); ++ } else { ++ spa_pod_builder_prop( ++ builder, SPA_FORMAT_VIDEO_modifier, ++ SPA_POD_PROP_FLAG_MANDATORY | SPA_POD_PROP_FLAG_DONT_FIXATE); ++ spa_pod_builder_push_choice(builder, &frames[1], SPA_CHOICE_Enum, 0); ++ ++ // modifiers from the array ++ for (int64_t val : modifiers) { ++ spa_pod_builder_long(builder, val); ++ // Add the first modifier twice as the very first value is the default ++ // option ++ if (first) { ++ spa_pod_builder_long(builder, val); ++ first = false; ++ } ++ } ++ spa_pod_builder_pop(builder, &frames[1]); ++ } ++ } ++ ++ spa_pod_builder_add( ++ builder, SPA_FORMAT_VIDEO_size, ++ SPA_POD_CHOICE_RANGE_Rectangle( ++ &pw_min_screen_bounds, &pw_min_screen_bounds, &pw_max_screen_bounds), ++ 0); ++ ++ return static_cast(spa_pod_builder_pop(builder, &frames[0])); ++} ++ ++class PipeWireThreadLoopLock { ++ public: ++ explicit PipeWireThreadLoopLock(pw_thread_loop* loop) : loop_(loop) { ++ pw_thread_loop_lock(loop_); ++ } ++ ~PipeWireThreadLoopLock() { pw_thread_loop_unlock(loop_); } ++ ++ private: ++ pw_thread_loop* const loop_; ++}; ++ ++class ScopedBuf { ++ public: ++ ScopedBuf() {} ++ ScopedBuf(uint8_t* map, int map_size, int fd) ++ : map_(map), map_size_(map_size), fd_(fd) {} ++ ~ScopedBuf() { ++ if (map_ != MAP_FAILED) { ++ munmap(map_, map_size_); ++ } ++ } ++ ++ explicit operator bool() { return map_ != MAP_FAILED; } ++ ++ void initialize(uint8_t* map, int map_size, int fd) { ++ map_ = map; ++ map_size_ = map_size; ++ fd_ = fd; ++ } ++ ++ uint8_t* get() { return map_; } ++ ++ protected: ++ uint8_t* map_ = static_cast(MAP_FAILED); ++ int map_size_; ++ int fd_; ++}; ++ ++class SharedScreenCastStreamPrivate { ++ public: ++ SharedScreenCastStreamPrivate(); ++ ~SharedScreenCastStreamPrivate(); ++ ++ bool StartScreenCastStream(uint32_t stream_node_id, int fd); ++ void StopScreenCastStream(); ++ std::unique_ptr CaptureFrame(); ++ std::unique_ptr CaptureCursor(); ++ DesktopVector CaptureCursorPosition(); ++ ++ private: ++ uint32_t pw_stream_node_id_ = 0; ++ int pw_fd_ = -1; ++ ++ DesktopSize desktop_size_ = {}; ++ DesktopSize video_size_; ++ ++ webrtc::Mutex queue_lock_; ++ ScreenCaptureFrameQueue queue_ ++ RTC_GUARDED_BY(&queue_lock_); ++ std::unique_ptr mouse_cursor_; ++ DesktopVector mouse_cursor_position_ = DesktopVector(-1, -1); ++ ++ int64_t modifier_; ++ std::unique_ptr egl_dmabuf_; ++ // List of modifiers we query as supported by the graphics card/driver ++ std::vector modifiers_; ++ ++ // PipeWire types ++ struct pw_context* pw_context_ = nullptr; ++ struct pw_core* pw_core_ = nullptr; ++ struct pw_stream* pw_stream_ = nullptr; ++ struct pw_thread_loop* pw_main_loop_ = nullptr; ++ struct spa_source* renegotiate_ = nullptr; ++ ++ spa_hook spa_core_listener_; ++ spa_hook spa_stream_listener_; ++ ++ // A number used to verify all previous methods and the resulting ++ // events have been handled. ++ int server_version_sync_ = 0; ++ // Version of the running PipeWire server we communicate with ++ PipeWireVersion pw_server_version_; ++ // Version of the library used to run our code ++ PipeWireVersion pw_client_version_; ++ ++ // event handlers ++ pw_core_events pw_core_events_ = {}; ++ pw_stream_events pw_stream_events_ = {}; ++ ++ struct spa_video_info_raw spa_video_format_; ++ ++ void ProcessBuffer(pw_buffer* buffer); ++ void ConvertRGBxToBGRx(uint8_t* frame, uint32_t size); ++ ++ // PipeWire callbacks ++ static void OnCoreError(void* data, ++ uint32_t id, ++ int seq, ++ int res, ++ const char* message); ++ static void OnCoreDone(void* user_data, uint32_t id, int seq); ++ static void OnCoreInfo(void* user_data, const pw_core_info* info); ++ static void OnStreamParamChanged(void* data, ++ uint32_t id, ++ const struct spa_pod* format); ++ static void OnStreamStateChanged(void* data, ++ pw_stream_state old_state, ++ pw_stream_state state, ++ const char* error_message); ++ static void OnStreamProcess(void* data); ++ // This will be invoked in case we fail to process DMA-BUF PW buffer using ++ // negotiated stream parameters (modifier). We will drop the modifier we ++ // failed to use and try to use a different one or fallback to shared memory ++ // buffers. ++ static void OnRenegotiateFormat(void* data, uint64_t); ++}; ++ ++bool operator>=(const PipeWireVersion& current_pw_version, ++ const PipeWireVersion& required_pw_version) { ++ if (!current_pw_version.major && !current_pw_version.minor && ++ !current_pw_version.micro) { ++ return false; ++ } ++ ++ return std::tie(current_pw_version.major, current_pw_version.minor, ++ current_pw_version.micro) >= ++ std::tie(required_pw_version.major, required_pw_version.minor, ++ required_pw_version.micro); ++} ++ ++bool operator<=(const PipeWireVersion& current_pw_version, ++ const PipeWireVersion& required_pw_version) { ++ if (!current_pw_version.major && !current_pw_version.minor && ++ !current_pw_version.micro) { ++ return false; ++ } ++ ++ return std::tie(current_pw_version.major, current_pw_version.minor, ++ current_pw_version.micro) <= ++ std::tie(required_pw_version.major, required_pw_version.minor, ++ required_pw_version.micro); ++} ++ ++void SharedScreenCastStreamPrivate::OnCoreError(void* data, ++ uint32_t id, ++ int seq, ++ int res, ++ const char* message) { ++ SharedScreenCastStreamPrivate* that = ++ static_cast(data); ++ RTC_DCHECK(that); ++ ++ RTC_LOG(LS_ERROR) << "PipeWire remote error: " << message; ++} ++ ++void SharedScreenCastStreamPrivate::OnCoreInfo(void* data, ++ const pw_core_info* info) { ++ SharedScreenCastStreamPrivate* stream = ++ static_cast(data); ++ RTC_DCHECK(stream); ++ ++ stream->pw_server_version_ = ParsePipeWireVersion(info->version); ++} ++ ++void SharedScreenCastStreamPrivate::OnCoreDone(void* data, ++ uint32_t id, ++ int seq) { ++ const SharedScreenCastStreamPrivate* stream = ++ static_cast(data); ++ RTC_DCHECK(stream); ++ ++ if (id == PW_ID_CORE && stream->server_version_sync_ == seq) { ++ pw_thread_loop_signal(stream->pw_main_loop_, false); ++ } ++} ++ ++// static ++void SharedScreenCastStreamPrivate::OnStreamStateChanged( ++ void* data, ++ pw_stream_state old_state, ++ pw_stream_state state, ++ const char* error_message) { ++ SharedScreenCastStreamPrivate* that = ++ static_cast(data); ++ RTC_DCHECK(that); ++ ++ switch (state) { ++ case PW_STREAM_STATE_ERROR: ++ RTC_LOG(LS_ERROR) << "PipeWire stream state error: " << error_message; ++ break; ++ case PW_STREAM_STATE_PAUSED: ++ case PW_STREAM_STATE_STREAMING: ++ case PW_STREAM_STATE_UNCONNECTED: ++ case PW_STREAM_STATE_CONNECTING: ++ break; ++ } ++} ++ ++// static ++void SharedScreenCastStreamPrivate::OnStreamParamChanged( ++ void* data, ++ uint32_t id, ++ const struct spa_pod* format) { ++ SharedScreenCastStreamPrivate* that = ++ static_cast(data); ++ RTC_DCHECK(that); ++ ++ RTC_LOG(LS_INFO) << "PipeWire stream format changed."; ++ if (!format || id != SPA_PARAM_Format) { ++ return; ++ } ++ ++ spa_format_video_raw_parse(format, &that->spa_video_format_); ++ ++ auto width = that->spa_video_format_.size.width; ++ auto height = that->spa_video_format_.size.height; ++ auto stride = SPA_ROUND_UP_N(width * kBytesPerPixel, 4); ++ auto size = height * stride; ++ ++ that->desktop_size_ = DesktopSize(width, height); ++ ++ uint8_t buffer[1024] = {}; ++ auto builder = spa_pod_builder{buffer, sizeof(buffer)}; ++ ++ // Setup buffers and meta header for new format. ++ ++ // When SPA_FORMAT_VIDEO_modifier is present we can use DMA-BUFs as ++ // the server announces support for it. ++ // See https://github.com/PipeWire/pipewire/blob/master/doc/dma-buf.dox ++ const bool has_modifier = ++ spa_pod_find_prop(format, nullptr, SPA_FORMAT_VIDEO_modifier); ++ that->modifier_ = ++ has_modifier ? that->spa_video_format_.modifier : DRM_FORMAT_MOD_INVALID; ++ std::vector params; ++ const int buffer_types = ++ has_modifier || (that->pw_server_version_ >= kDmaBufMinVersion) ++ ? (1 << SPA_DATA_DmaBuf) | (1 << SPA_DATA_MemFd) | ++ (1 << SPA_DATA_MemPtr) ++ : (1 << SPA_DATA_MemFd) | (1 << SPA_DATA_MemPtr); ++ ++ params.push_back(reinterpret_cast(spa_pod_builder_add_object( ++ &builder, SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers, ++ SPA_PARAM_BUFFERS_size, SPA_POD_Int(size), SPA_PARAM_BUFFERS_stride, ++ SPA_POD_Int(stride), SPA_PARAM_BUFFERS_buffers, ++ SPA_POD_CHOICE_RANGE_Int(8, 1, 32), SPA_PARAM_BUFFERS_dataType, ++ SPA_POD_CHOICE_FLAGS_Int(buffer_types)))); ++ params.push_back(reinterpret_cast(spa_pod_builder_add_object( ++ &builder, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, ++ SPA_POD_Id(SPA_META_Header), SPA_PARAM_META_size, ++ SPA_POD_Int(sizeof(struct spa_meta_header))))); ++ params.push_back(reinterpret_cast(spa_pod_builder_add_object( ++ &builder, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, ++ SPA_POD_Id(SPA_META_VideoCrop), SPA_PARAM_META_size, ++ SPA_POD_Int(sizeof(struct spa_meta_region))))); ++ params.push_back(reinterpret_cast(spa_pod_builder_add_object( ++ &builder, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, ++ SPA_POD_Id(SPA_META_Cursor), SPA_PARAM_META_size, ++ SPA_POD_CHOICE_RANGE_Int(CursorMetaSize(64, 64), CursorMetaSize(1, 1), ++ CursorMetaSize(384, 384))))); ++ params.push_back(reinterpret_cast(spa_pod_builder_add_object( ++ &builder, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, ++ SPA_POD_Id(SPA_META_VideoDamage), SPA_PARAM_META_size, ++ SPA_POD_CHOICE_RANGE_Int(sizeof(struct spa_meta_region) * 16, ++ sizeof(struct spa_meta_region) * 1, ++ sizeof(struct spa_meta_region) * 16)))); ++ ++ pw_stream_update_params(that->pw_stream_, params.data(), params.size()); ++} ++ ++// static ++void SharedScreenCastStreamPrivate::OnStreamProcess(void* data) { ++ SharedScreenCastStreamPrivate* that = ++ static_cast(data); ++ RTC_DCHECK(that); ++ ++ struct pw_buffer* next_buffer; ++ struct pw_buffer* buffer = nullptr; ++ ++ next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); ++ while (next_buffer) { ++ buffer = next_buffer; ++ next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); ++ ++ if (next_buffer) { ++ pw_stream_queue_buffer(that->pw_stream_, buffer); ++ } ++ } ++ ++ if (!buffer) { ++ return; ++ } ++ ++ that->ProcessBuffer(buffer); ++ ++ pw_stream_queue_buffer(that->pw_stream_, buffer); ++} ++ ++void SharedScreenCastStreamPrivate::OnRenegotiateFormat(void* data, uint64_t) { ++ SharedScreenCastStreamPrivate* that = ++ static_cast(data); ++ RTC_DCHECK(that); ++ ++ { ++ PipeWireThreadLoopLock thread_loop_lock(that->pw_main_loop_); ++ ++ uint8_t buffer[2048] = {}; ++ ++ spa_pod_builder builder = spa_pod_builder{buffer, sizeof(buffer)}; ++ ++ std::vector params; ++ ++ for (uint32_t format : {SPA_VIDEO_FORMAT_BGRA, SPA_VIDEO_FORMAT_RGBA, ++ SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_RGBx}) { ++ if (!that->modifiers_.empty()) { ++ params.push_back(BuildFormat(&builder, format, that->modifiers_)); ++ } ++ params.push_back(BuildFormat(&builder, format, /*modifiers=*/{})); ++ } ++ ++ pw_stream_update_params(that->pw_stream_, params.data(), params.size()); ++ } ++} ++ ++SharedScreenCastStreamPrivate::SharedScreenCastStreamPrivate() {} ++ ++SharedScreenCastStreamPrivate::~SharedScreenCastStreamPrivate() { ++ if (pw_main_loop_) { ++ pw_thread_loop_stop(pw_main_loop_); ++ } ++ ++ if (pw_stream_) { ++ pw_stream_destroy(pw_stream_); ++ } ++ ++ if (pw_core_) { ++ pw_core_disconnect(pw_core_); ++ } ++ ++ if (pw_context_) { ++ pw_context_destroy(pw_context_); ++ } ++ ++ if (pw_main_loop_) { ++ pw_thread_loop_destroy(pw_main_loop_); ++ } ++} ++ ++bool SharedScreenCastStreamPrivate::StartScreenCastStream( ++ uint32_t stream_node_id, ++ int fd) { ++#if defined(WEBRTC_DLOPEN_PIPEWIRE) ++ StubPathMap paths; ++ ++ // Check if the PipeWire and DRM libraries are available. ++ paths[kModulePipewire].push_back(kPipeWireLib); ++ paths[kModuleDrm].push_back(kDrmLib); ++ ++ if (!InitializeStubs(paths)) { ++ RTC_LOG(LS_ERROR) ++ << "One of following libraries is missing on your system:\n" ++ << " - PipeWire (" << kPipeWireLib << ")\n" ++ << " - drm (" << kDrmLib << ")"; ++ return false; ++ } ++#endif // defined(WEBRTC_DLOPEN_PIPEWIRE) ++ egl_dmabuf_ = std::make_unique(); ++ ++ pw_stream_node_id_ = stream_node_id; ++ pw_fd_ = fd; ++ ++ pw_init(/*argc=*/nullptr, /*argc=*/nullptr); ++ ++ pw_main_loop_ = pw_thread_loop_new("pipewire-main-loop", nullptr); ++ ++ pw_context_ = ++ pw_context_new(pw_thread_loop_get_loop(pw_main_loop_), nullptr, 0); ++ if (!pw_context_) { ++ RTC_LOG(LS_ERROR) << "Failed to create PipeWire context"; ++ return false; ++ } ++ ++ if (pw_thread_loop_start(pw_main_loop_) < 0) { ++ RTC_LOG(LS_ERROR) << "Failed to start main PipeWire loop"; ++ return false; ++ } ++ ++ pw_client_version_ = ParsePipeWireVersion(pw_get_library_version()); ++ ++ // Initialize event handlers, remote end and stream-related. ++ pw_core_events_.version = PW_VERSION_CORE_EVENTS; ++ pw_core_events_.info = &OnCoreInfo; ++ pw_core_events_.done = &OnCoreDone; ++ pw_core_events_.error = &OnCoreError; ++ ++ pw_stream_events_.version = PW_VERSION_STREAM_EVENTS; ++ pw_stream_events_.state_changed = &OnStreamStateChanged; ++ pw_stream_events_.param_changed = &OnStreamParamChanged; ++ pw_stream_events_.process = &OnStreamProcess; ++ ++ { ++ PipeWireThreadLoopLock thread_loop_lock(pw_main_loop_); ++ ++ pw_core_ = pw_context_connect_fd(pw_context_, pw_fd_, nullptr, 0); ++ if (!pw_core_) { ++ RTC_LOG(LS_ERROR) << "Failed to connect PipeWire context"; ++ return false; ++ } ++ ++ pw_core_add_listener(pw_core_, &spa_core_listener_, &pw_core_events_, this); ++ ++ // Add an event that can be later invoked by pw_loop_signal_event() ++ renegotiate_ = pw_loop_add_event(pw_thread_loop_get_loop(pw_main_loop_), ++ OnRenegotiateFormat, this); ++ ++ server_version_sync_ = ++ pw_core_sync(pw_core_, PW_ID_CORE, server_version_sync_); ++ ++ pw_thread_loop_wait(pw_main_loop_); ++ ++ pw_properties* reuseProps = ++ pw_properties_new_string("pipewire.client.reuse=1"); ++ pw_stream_ = pw_stream_new(pw_core_, "webrtc-consume-stream", reuseProps); ++ ++ if (!pw_stream_) { ++ RTC_LOG(LS_ERROR) << "Failed to create PipeWire stream"; ++ return false; ++ } ++ ++ pw_stream_add_listener(pw_stream_, &spa_stream_listener_, ++ &pw_stream_events_, this); ++ uint8_t buffer[2048] = {}; ++ ++ spa_pod_builder builder = spa_pod_builder{buffer, sizeof(buffer)}; ++ ++ std::vector params; ++ const bool has_required_pw_client_version = ++ pw_client_version_ >= kDmaBufModifierMinVersion; ++ const bool has_required_pw_server_version = ++ pw_server_version_ >= kDmaBufModifierMinVersion; ++ for (uint32_t format : {SPA_VIDEO_FORMAT_BGRA, SPA_VIDEO_FORMAT_RGBA, ++ SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_RGBx}) { ++ // Modifiers can be used with PipeWire >= 0.3.33 ++ if (has_required_pw_client_version && has_required_pw_server_version) { ++ modifiers_ = egl_dmabuf_->QueryDmaBufModifiers(format); ++ ++ if (!modifiers_.empty()) { ++ params.push_back(BuildFormat(&builder, format, modifiers_)); ++ } ++ } ++ ++ params.push_back(BuildFormat(&builder, format, /*modifiers=*/{})); ++ } ++ ++ if (pw_stream_connect(pw_stream_, PW_DIRECTION_INPUT, pw_stream_node_id_, ++ PW_STREAM_FLAG_AUTOCONNECT, params.data(), ++ params.size()) != 0) { ++ RTC_LOG(LS_ERROR) << "Could not connect receiving stream."; ++ return false; ++ } ++ ++ RTC_LOG(LS_INFO) << "PipeWire remote opened."; ++ } ++ return true; ++} ++ ++void SharedScreenCastStreamPrivate::StopScreenCastStream() { ++ if (pw_stream_) { ++ pw_stream_disconnect(pw_stream_); ++ } ++} ++ ++std::unique_ptr SharedScreenCastStreamPrivate::CaptureFrame() { ++ webrtc::MutexLock lock(&queue_lock_); ++ ++ if (!queue_.current_frame()) { ++ return std::unique_ptr{}; ++ } ++ ++ std::unique_ptr frame = queue_.current_frame()->Share(); ++ return std::move(frame); ++} ++ ++std::unique_ptr SharedScreenCastStreamPrivate::CaptureCursor() { ++ if (!mouse_cursor_) { ++ return nullptr; ++ } ++ ++ return std::move(mouse_cursor_); ++} ++ ++DesktopVector SharedScreenCastStreamPrivate::CaptureCursorPosition() { ++ return mouse_cursor_position_; ++} ++ ++void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { ++ spa_buffer* spa_buffer = buffer->buffer; ++ ScopedBuf map; ++ std::unique_ptr src_unique_ptr; ++ uint8_t* src = nullptr; ++ ++ // Try to update the mouse cursor first, because it can be the only ++ // information carried by the buffer ++ { ++ const struct spa_meta_cursor* cursor = ++ static_cast(spa_buffer_find_meta_data( ++ spa_buffer, SPA_META_Cursor, sizeof(*cursor))); ++ if (spa_meta_cursor_is_valid(cursor)) { ++ struct spa_meta_bitmap* bitmap = nullptr; ++ ++ if (cursor->bitmap_offset) ++ bitmap = ++ SPA_MEMBER(cursor, cursor->bitmap_offset, struct spa_meta_bitmap); ++ ++ if (bitmap && bitmap->size.width > 0 && bitmap->size.height > 0) { ++ const uint8_t* bitmap_data = ++ SPA_MEMBER(bitmap, bitmap->offset, uint8_t); ++ BasicDesktopFrame* mouse_frame = new BasicDesktopFrame( ++ DesktopSize(bitmap->size.width, bitmap->size.height)); ++ mouse_frame->CopyPixelsFrom( ++ bitmap_data, bitmap->stride, ++ DesktopRect::MakeWH(bitmap->size.width, bitmap->size.height)); ++ mouse_cursor_ = std::make_unique( ++ mouse_frame, DesktopVector(cursor->hotspot.x, cursor->hotspot.y)); ++ } ++ mouse_cursor_position_.set(cursor->position.x, cursor->position.y); ++ } ++ } ++ ++ if (spa_buffer->datas[0].chunk->size == 0) { ++ return; ++ } ++ ++ if (spa_buffer->datas[0].type == SPA_DATA_MemFd) { ++ map.initialize( ++ static_cast( ++ mmap(nullptr, ++ spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset, ++ PROT_READ, MAP_PRIVATE, spa_buffer->datas[0].fd, 0)), ++ spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset, ++ spa_buffer->datas[0].fd); ++ ++ if (!map) { ++ RTC_LOG(LS_ERROR) << "Failed to mmap the memory: " ++ << std::strerror(errno); ++ return; ++ } ++ ++ src = SPA_MEMBER(map.get(), spa_buffer->datas[0].mapoffset, uint8_t); ++ } else if (spa_buffer->datas[0].type == SPA_DATA_DmaBuf) { ++ const uint n_planes = spa_buffer->n_datas; ++ ++ if (!n_planes) { ++ return; ++ } ++ ++ std::vector plane_datas; ++ for (uint32_t i = 0; i < n_planes; ++i) { ++ EglDmaBuf::PlaneData data = { ++ static_cast(spa_buffer->datas[i].fd), ++ static_cast(spa_buffer->datas[i].chunk->stride), ++ static_cast(spa_buffer->datas[i].chunk->offset)}; ++ plane_datas.push_back(data); ++ } ++ ++ src_unique_ptr = egl_dmabuf_->ImageFromDmaBuf( ++ desktop_size_, spa_video_format_.format, plane_datas, modifier_); ++ if (src_unique_ptr) { ++ src = src_unique_ptr.get(); ++ } else { ++ RTC_LOG(LS_ERROR) << "Dropping DMA-BUF modifier: " << modifier_ ++ << " and trying to renegotiate stream parameters"; ++ ++ if (pw_client_version_ >= kDropSingleModifierMinVersion) { ++ modifiers_.erase( ++ std::remove(modifiers_.begin(), modifiers_.end(), modifier_), ++ modifiers_.end()); ++ } else { ++ modifiers_.clear(); ++ } ++ ++ pw_loop_signal_event(pw_thread_loop_get_loop(pw_main_loop_), ++ renegotiate_); ++ return; ++ } ++ } else if (spa_buffer->datas[0].type == SPA_DATA_MemPtr) { ++ src = static_cast(spa_buffer->datas[0].data); ++ } ++ ++ if (!src) { ++ return; ++ } ++ struct spa_meta_region* video_metadata = ++ static_cast(spa_buffer_find_meta_data( ++ spa_buffer, SPA_META_VideoCrop, sizeof(*video_metadata))); ++ ++ // Video size from metadata is bigger than an actual video stream size. ++ // The metadata are wrong or we should up-scale the video...in both cases ++ // just quit now. ++ if (video_metadata && (video_metadata->region.size.width > ++ static_cast(desktop_size_.width()) || ++ video_metadata->region.size.height > ++ static_cast(desktop_size_.height()))) { ++ RTC_LOG(LS_ERROR) << "Stream metadata sizes are wrong!"; ++ return; ++ } ++ ++ // Use video metadata when video size from metadata is set and smaller than ++ // video stream size, so we need to adjust it. ++ bool video_metadata_use = false; ++ const struct spa_rectangle* video_metadata_size = ++ video_metadata ? &video_metadata->region.size : nullptr; ++ ++ if (video_metadata_size && video_metadata_size->width != 0 && ++ video_metadata_size->height != 0 && ++ (static_cast(video_metadata_size->width) < desktop_size_.width() || ++ static_cast(video_metadata_size->height) < ++ desktop_size_.height())) { ++ video_metadata_use = true; ++ } ++ ++ if (video_metadata_use) { ++ video_size_ = ++ DesktopSize(video_metadata_size->width, video_metadata_size->height); ++ } else { ++ video_size_ = desktop_size_; ++ } ++ ++ uint32_t y_offset = video_metadata_use && (video_metadata->region.position.y + ++ video_size_.height() <= ++ desktop_size_.height()) ++ ? video_metadata->region.position.y ++ : 0; ++ uint32_t x_offset = video_metadata_use && (video_metadata->region.position.x + ++ video_size_.width() <= ++ desktop_size_.width()) ++ ? video_metadata->region.position.x ++ : 0; ++ ++ uint8_t* updated_src = src + (spa_buffer->datas[0].chunk->stride * y_offset) + ++ (kBytesPerPixel * x_offset); ++ ++ webrtc::MutexLock lock(&queue_lock_); ++ ++ // Move to the next frame if the current one is being used and shared ++ if (queue_.current_frame() && queue_.current_frame()->IsShared()) { ++ queue_.MoveToNextFrame(); ++ if (queue_.current_frame() && queue_.current_frame()->IsShared()) { ++ RTC_LOG(LS_WARNING) ++ << "Failed to process PipeWire buffer: no available frame"; ++ return; ++ } ++ } ++ ++ if (!queue_.current_frame() || ++ !queue_.current_frame()->size().equals(video_size_)) { ++ std::unique_ptr frame(new BasicDesktopFrame( ++ DesktopSize(video_size_.width(), video_size_.height()))); ++ queue_.ReplaceCurrentFrame(SharedDesktopFrame::Wrap(std::move(frame))); ++ } ++ ++ queue_.current_frame()->CopyPixelsFrom( ++ updated_src, ++ (spa_buffer->datas[0].chunk->stride - (kBytesPerPixel * x_offset)), ++ DesktopRect::MakeWH(video_size_.width(), video_size_.height())); ++ ++ if (spa_video_format_.format == SPA_VIDEO_FORMAT_RGBx || ++ spa_video_format_.format == SPA_VIDEO_FORMAT_RGBA) { ++ uint8_t* tmp_src = queue_.current_frame()->data(); ++ for (int i = 0; i < video_size_.height(); ++i) { ++ // If both sides decided to go with the RGBx format we need to convert ++ // it to BGRx to match color format expected by WebRTC. ++ ConvertRGBxToBGRx(tmp_src, queue_.current_frame()->stride()); ++ tmp_src += queue_.current_frame()->stride(); ++ } ++ } ++} ++ ++void SharedScreenCastStreamPrivate::ConvertRGBxToBGRx(uint8_t* frame, ++ uint32_t size) { ++ for (uint32_t i = 0; i < size; i += 4) { ++ uint8_t tempR = frame[i]; ++ uint8_t tempB = frame[i + 2]; ++ frame[i] = tempB; ++ frame[i + 2] = tempR; ++ } ++} ++ ++SharedScreenCastStream::SharedScreenCastStream() ++ : private_(std::make_unique()) {} ++ ++SharedScreenCastStream::~SharedScreenCastStream() {} ++ ++rtc::scoped_refptr ++SharedScreenCastStream::CreateDefault() { ++ // Explicit new, to access non-public constructor. ++ return rtc::scoped_refptr(new SharedScreenCastStream()); ++} ++ ++bool SharedScreenCastStream::StartScreenCastStream(uint32_t stream_node_id, ++ int fd) { ++ return private_->StartScreenCastStream(stream_node_id, fd); ++} ++ ++void SharedScreenCastStream::StopScreenCastStream() { ++ private_->StopScreenCastStream(); ++} ++ ++std::unique_ptr SharedScreenCastStream::CaptureFrame() { ++ return private_->CaptureFrame(); ++} ++ ++std::unique_ptr SharedScreenCastStream::CaptureCursor() { ++ return private_->CaptureCursor(); ++} ++ ++absl::optional SharedScreenCastStream::CaptureCursorPosition() { ++ DesktopVector position = private_->CaptureCursorPosition(); ++ ++ // Consider only (x >= 0 and y >= 0) a valid position ++ if (position.x() < 0 || position.y() < 0) { ++ return absl::nullopt; ++ } ++ ++ return position; ++} ++ ++} // namespace webrtc +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h +new file mode 100644 +index 0000000..72411e5 +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h +@@ -0,0 +1,71 @@ ++/* ++ * Copyright 2022 The WebRTC project authors. All Rights Reserved. ++ * ++ * Use of this source code is governed by a BSD-style license ++ * that can be found in the LICENSE file in the root of the source ++ * tree. An additional intellectual property rights grant can be found ++ * in the file PATENTS. All contributing project authors may ++ * be found in the AUTHORS file in the root of the source tree. ++ */ ++ ++#ifndef MODULES_DESKTOP_CAPTURE_LINUX_SHARED_SCREENCAST_STREAM_H_ ++#define MODULES_DESKTOP_CAPTURE_LINUX_SHARED_SCREENCAST_STREAM_H_ ++ ++#include ++ ++#include "absl/types/optional.h" ++#include "api/ref_counted_base.h" ++#include "api/scoped_refptr.h" ++#include "modules/desktop_capture/desktop_frame.h" ++#include "modules/desktop_capture/mouse_cursor.h" ++#include "rtc_base/system/rtc_export.h" ++ ++namespace webrtc { ++ ++class SharedScreenCastStreamPrivate; ++ ++class RTC_EXPORT SharedScreenCastStream ++ : public rtc::RefCountedBase { ++ public: ++ static rtc::scoped_refptr CreateDefault(); ++ ++ bool StartScreenCastStream(uint32_t stream_node_id, int fd); ++ void StopScreenCastStream(); ++ ++ // Below functions return the most recent information we get from a ++ // PipeWire buffer on each Process() callback. This assumes that we ++ // managed to successfuly connect to a PipeWire stream provided by the ++ // compositor (based on stream parameters). The cursor data are obtained ++ // from spa_meta_cursor stream metadata and therefore the cursor is not ++ // part of actual screen/window frame. ++ ++ // Returns the most recent screen/window frame we obtained from PipeWire ++ // buffer. Will return an empty frame in case we didn't manage to get a frame ++ // from PipeWire buffer. ++ std::unique_ptr CaptureFrame(); ++ ++ // Returns the most recent mouse cursor image. Will return an nullptr cursor ++ // in case we didn't manage to get a cursor from PipeWire buffer. NOTE: the ++ // cursor image might not be updated on every cursor location change, but ++ // actually only when its shape changes. ++ std::unique_ptr CaptureCursor(); ++ ++ // Returns the most recent mouse cursor position. Will not return a value in ++ // case we didn't manage to get it from PipeWire buffer. ++ absl::optional CaptureCursorPosition(); ++ ++ ~SharedScreenCastStream(); ++ ++ protected: ++ SharedScreenCastStream(); ++ ++ private: ++ SharedScreenCastStream(const SharedScreenCastStream&) = delete; ++ SharedScreenCastStream& operator=(const SharedScreenCastStream&) = delete; ++ ++ std::unique_ptr private_; ++}; ++ ++} // namespace webrtc ++ ++#endif // MODULES_DESKTOP_CAPTURE_LINUX_SHARED_SCREENCAST_STREAM_H_ +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc +deleted file mode 100644 +index c43a1f1..0000000 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc ++++ /dev/null +@@ -1,28 +0,0 @@ +-/* +- * Copyright 2018 The WebRTC project authors. All Rights Reserved. +- * +- * Use of this source code is governed by a BSD-style license +- * that can be found in the LICENSE file in the root of the source +- * tree. An additional intellectual property rights grant can be found +- * in the file PATENTS. All contributing project authors may +- * be found in the AUTHORS file in the root of the source tree. +- */ +- +-#include "modules/desktop_capture/linux/window_capturer_pipewire.h" +- +-#include +- +-namespace webrtc { +- +-WindowCapturerPipeWire::WindowCapturerPipeWire() +- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kWindow) {} +-WindowCapturerPipeWire::~WindowCapturerPipeWire() {} +- +-// static +-std::unique_ptr +-WindowCapturerPipeWire::CreateRawWindowCapturer( +- const DesktopCaptureOptions& options) { +- return std::make_unique(); +-} +- +-} // namespace webrtc +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h +deleted file mode 100644 +index 7f184ef..0000000 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h ++++ /dev/null +@@ -1,33 +0,0 @@ +-/* +- * Copyright 2018 The WebRTC project authors. All Rights Reserved. +- * +- * Use of this source code is governed by a BSD-style license +- * that can be found in the LICENSE file in the root of the source +- * tree. An additional intellectual property rights grant can be found +- * in the file PATENTS. All contributing project authors may +- * be found in the AUTHORS file in the root of the source tree. +- */ +- +-#ifndef MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_CAPTURER_PIPEWIRE_H_ +-#define MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_CAPTURER_PIPEWIRE_H_ +- +-#include +- +-#include "modules/desktop_capture/linux/base_capturer_pipewire.h" +- +-namespace webrtc { +- +-class WindowCapturerPipeWire : public BaseCapturerPipeWire { +- public: +- WindowCapturerPipeWire(); +- ~WindowCapturerPipeWire() override; +- +- static std::unique_ptr CreateRawWindowCapturer( +- const DesktopCaptureOptions& options); +- +- RTC_DISALLOW_COPY_AND_ASSIGN(WindowCapturerPipeWire); +-}; +- +-} // namespace webrtc +- +-#endif // MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_CAPTURER_PIPEWIRE_H_ +diff --git a/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc b/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc +index e569f6e..3bb51e8 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc +@@ -17,6 +17,10 @@ + #include "modules/desktop_capture/linux/mouse_cursor_monitor_x11.h" + #endif // defined(WEBRTC_USE_X11) + ++#if defined(WEBRTC_USE_PIPEWIRE) ++#include "modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h" ++#endif // defined(WEBRTC_USE_PIPEWIRE) ++ + namespace webrtc { + + // static +@@ -44,6 +48,13 @@ MouseCursorMonitor* MouseCursorMonitor::CreateForScreen( + // static + std::unique_ptr MouseCursorMonitor::Create( + const DesktopCaptureOptions& options) { ++#if defined(WEBRTC_USE_PIPEWIRE) ++ if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland() && ++ options.screencast_stream()) { ++ return std::make_unique(options); ++ } ++#endif // defined(WEBRTC_USE_PIPEWIRE) ++ + #if defined(WEBRTC_USE_X11) + return MouseCursorMonitorX11::Create(options); + #else +diff --git a/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc b/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc +index 57a2002..b44ae35 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc +@@ -14,7 +14,7 @@ + #include "modules/desktop_capture/desktop_capturer.h" + + #if defined(WEBRTC_USE_PIPEWIRE) +-#include "modules/desktop_capture/linux/screen_capturer_pipewire.h" ++#include "modules/desktop_capture/linux/base_capturer_pipewire.h" + #endif // defined(WEBRTC_USE_PIPEWIRE) + + #if defined(WEBRTC_USE_X11) +@@ -28,7 +28,7 @@ std::unique_ptr DesktopCapturer::CreateRawScreenCapturer( + const DesktopCaptureOptions& options) { + #if defined(WEBRTC_USE_PIPEWIRE) + if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { +- return BaseCapturerPipeWire::CreateRawScreenCapturer(options); ++ return std::make_unique(options); + } + #endif // defined(WEBRTC_USE_PIPEWIRE) + +diff --git a/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc b/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc +index ed03ba0..3bc6577 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc +@@ -14,7 +14,7 @@ + #include "modules/desktop_capture/desktop_capturer.h" + + #if defined(WEBRTC_USE_PIPEWIRE) +-#include "modules/desktop_capture/linux/window_capturer_pipewire.h" ++#include "modules/desktop_capture/linux/base_capturer_pipewire.h" + #endif // defined(WEBRTC_USE_PIPEWIRE) + + #if defined(WEBRTC_USE_X11) +@@ -28,7 +28,7 @@ std::unique_ptr DesktopCapturer::CreateRawWindowCapturer( + const DesktopCaptureOptions& options) { + #if defined(WEBRTC_USE_PIPEWIRE) + if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { +- return BaseCapturerPipeWire::CreateRawWindowCapturer(options); ++ return std::make_unique(options); + } + #endif // defined(WEBRTC_USE_PIPEWIRE) + +diff --git a/third_party/moz.build b/third_party/moz.build +index 1941c11..f804531 100644 +--- a/third_party/moz.build ++++ b/third_party/moz.build +@@ -49,6 +49,12 @@ with Files("libwebrtc/**"): + with Files("pipewire/**"): + BUG_COMPONENT = ("Core", "WebRTC") + ++with Files("drm/**"): ++ BUG_COMPONENT = ("Core", "WebRTC") ++ ++with Files("gbm/**"): ++ BUG_COMPONENT = ("Core", "WebRTC") ++ + with Files('rlbox_wasm2c_sandbox/**'): + BUG_COMPONENT = ('Firefox Build System', 'General') + +diff --git a/third_party/pipewire/libpipewire/mozpipewire.cpp b/third_party/pipewire/libpipewire/mozpipewire.cpp +index 1ecfc31..fbeeb8e 100644 +--- a/third_party/pipewire/libpipewire/mozpipewire.cpp ++++ b/third_party/pipewire/libpipewire/mozpipewire.cpp +@@ -69,11 +69,13 @@ static int (*pw_stream_connect_fn)(struct pw_stream *stream, + enum pw_stream_flags flags, + const struct spa_pod **params, + uint32_t n_params); ++static int (*pw_stream_disconnect_fn)(struct pw_stream *stream); + static struct pw_buffer* (*pw_stream_dequeue_buffer_fn)(struct pw_stream *stream); + static void (*pw_stream_destroy_fn)(struct pw_stream *stream); + static struct pw_stream* (*pw_stream_new_fn)(struct pw_core *core, + const char *name, + struct pw_properties *props); ++ + static int (*pw_stream_queue_buffer_fn)(struct pw_stream *stream, + struct pw_buffer *buffer); + static int (*pw_stream_update_params_fn)(struct pw_stream *stream, +@@ -87,7 +89,10 @@ static int (*pw_thread_loop_start_fn)(struct pw_thread_loop *loop); + static void (*pw_thread_loop_stop_fn)(struct pw_thread_loop *loop); + static void (*pw_thread_loop_lock_fn)(struct pw_thread_loop *loop); + static void (*pw_thread_loop_unlock_fn)(struct pw_thread_loop *loop); ++static void (*pw_thread_loop_wait_fn)(struct pw_thread_loop *loop); ++static void (*pw_thread_loop_signal_fn)(struct pw_thread_loop *loop, bool wait_for_accept); + static struct pw_properties* (*pw_properties_new_string_fn)(const char *str); ++static const char* (*pw_get_library_version_fn)(); + + bool IsPwLibraryLoaded() { + static bool isLoaded = +@@ -99,6 +104,7 @@ bool IsPwLibraryLoaded() { + IS_FUNC_LOADED(pw_init_fn) && + IS_FUNC_LOADED(pw_stream_add_listener_fn) && + IS_FUNC_LOADED(pw_stream_connect_fn) && ++ IS_FUNC_LOADED(pw_stream_disconnect_fn) && + IS_FUNC_LOADED(pw_stream_dequeue_buffer_fn) && + IS_FUNC_LOADED(pw_stream_destroy_fn) && + IS_FUNC_LOADED(pw_stream_new_fn) && +@@ -111,7 +117,10 @@ bool IsPwLibraryLoaded() { + IS_FUNC_LOADED(pw_thread_loop_stop_fn) && + IS_FUNC_LOADED(pw_thread_loop_lock_fn) && + IS_FUNC_LOADED(pw_thread_loop_unlock_fn) && +- IS_FUNC_LOADED(pw_properties_new_string_fn)); ++ IS_FUNC_LOADED(pw_thread_loop_signal_fn) && ++ IS_FUNC_LOADED(pw_thread_loop_wait_fn) && ++ IS_FUNC_LOADED(pw_properties_new_string_fn) && ++ IS_FUNC_LOADED(pw_get_library_version_fn)); + + return isLoaded; + } +@@ -136,6 +145,7 @@ bool LoadPWLibrary() { + GET_FUNC(pw_init, pwLib); + GET_FUNC(pw_stream_add_listener, pwLib); + GET_FUNC(pw_stream_connect, pwLib); ++ GET_FUNC(pw_stream_disconnect, pwLib); + GET_FUNC(pw_stream_dequeue_buffer, pwLib); + GET_FUNC(pw_stream_destroy, pwLib); + GET_FUNC(pw_stream_new, pwLib); +@@ -148,7 +158,10 @@ bool LoadPWLibrary() { + GET_FUNC(pw_thread_loop_stop, pwLib); + GET_FUNC(pw_thread_loop_lock, pwLib); + GET_FUNC(pw_thread_loop_unlock, pwLib); ++ GET_FUNC(pw_thread_loop_signal, pwLib); ++ GET_FUNC(pw_thread_loop_wait, pwLib); + GET_FUNC(pw_properties_new_string, pwLib); ++ GET_FUNC(pw_get_library_version, pwLib); + } + + return IsPwLibraryLoaded(); +@@ -242,6 +255,15 @@ pw_stream_connect(struct pw_stream *stream, + params, n_params); + } + ++int ++pw_stream_disconnect(struct pw_stream *stream) ++{ ++ if (!LoadPWLibrary()) { ++ return 0; ++ } ++ return pw_stream_disconnect_fn(stream); ++} ++ + struct pw_buffer * + pw_stream_dequeue_buffer(struct pw_stream *stream) + { +@@ -356,6 +378,23 @@ pw_thread_loop_unlock(struct pw_thread_loop *loop) + return pw_thread_loop_unlock_fn(loop); + } + ++void ++pw_thread_loop_signal(struct pw_thread_loop *loop, bool wait_for_accept) ++{ ++ if (!LoadPWLibrary()) { ++ return; ++ } ++ return pw_thread_loop_signal_fn(loop, wait_for_accept); ++} ++ ++void ++pw_thread_loop_wait(struct pw_thread_loop *loop) ++{ ++ if (!LoadPWLibrary()) { ++ return; ++ } ++ return pw_thread_loop_wait_fn(loop); ++} + + struct pw_properties * + pw_properties_new_string(const char *str) +@@ -366,3 +405,12 @@ pw_properties_new_string(const char *str) + return pw_properties_new_string_fn(str); + } + ++const char* ++pw_get_library_version() ++{ ++ if (!LoadPWLibrary()) { ++ return nullptr; ++ } ++ return pw_get_library_version_fn(); ++} ++ From e07951b09b0838bb0ae8531c7c7419e04c711cf0 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 1 Mar 2022 12:33:16 +0100 Subject: [PATCH 020/545] Updated to 98.0 --- .gitignore | 2 ++ firefox.spec | 11 +++++++---- mozilla-1667096.patch | 42 +++++++++++++++++++++--------------------- sources | 4 ++-- 4 files changed, 32 insertions(+), 27 deletions(-) diff --git a/.gitignore b/.gitignore index e0a7956..8fd6453 100644 --- a/.gitignore +++ b/.gitignore @@ -495,3 +495,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-97.0-20220208.tar.xz /firefox-97.0.1.source.tar.xz /firefox-langpacks-97.0.1-20220218.tar.xz +/firefox-98.0.source.tar.xz +/firefox-langpacks-98.0-20220301.tar.xz diff --git a/firefox.spec b/firefox.spec index 37bc621..bbfc8a3 100644 --- a/firefox.spec +++ b/firefox.spec @@ -162,13 +162,13 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox -Version: 97.0.1 +Version: 98.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220218.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220301.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -459,7 +459,7 @@ This package contains results of tests executed during build. %patch49 -p1 -b .build-arm-libaom %patch53 -p1 -b .firefox-gcc-build %patch54 -p1 -b .1669639 -%patch55 -p1 -b .testing +#%patch55 -p1 -b .testing %patch57 -p1 -b .ffvpx-with-vapi #%patch64 -p1 -b .1753402 %patch65 -p1 -b .D139022 @@ -467,7 +467,7 @@ This package contains results of tests executed during build. %patch67 -p1 -b .D139088 # Test patches -%patch100 -p1 -b .firefox-tests-xpcshell +#%patch100 -p1 -b .firefox-tests-xpcshell #%patch101 -p1 -b .firefox-tests-reftest %patch102 -p1 -b .firefox-tests-xpcshell-freeze @@ -1051,6 +1051,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue Mar 1 2022 Martin Stransky - 98.0-1 +- Updated to 98.0 + * Fri Feb 18 2022 Martin Stransky - 97.0.1-1 - Updated to 97.0.1 - GCC 12 build fixes diff --git a/mozilla-1667096.patch b/mozilla-1667096.patch index 8a82677..d2f2bf7 100644 --- a/mozilla-1667096.patch +++ b/mozilla-1667096.patch @@ -1,6 +1,6 @@ -diff -up firefox-97.0/media/ffvpx/libavcodec/codec_list.c.1667096 firefox-97.0/media/ffvpx/libavcodec/codec_list.c ---- firefox-97.0/media/ffvpx/libavcodec/codec_list.c.1667096 2022-02-08 10:21:17.151809054 +0100 -+++ firefox-97.0/media/ffvpx/libavcodec/codec_list.c 2022-02-08 10:25:11.374078784 +0100 +diff -up firefox-98.0/media/ffvpx/libavcodec/codec_list.c.1667096 firefox-98.0/media/ffvpx/libavcodec/codec_list.c +--- firefox-98.0/media/ffvpx/libavcodec/codec_list.c.1667096 2022-03-01 11:15:54.962398882 +0100 ++++ firefox-98.0/media/ffvpx/libavcodec/codec_list.c 2022-03-01 11:17:46.605000755 +0100 @@ -11,6 +11,9 @@ static const AVCodec * const codec_list[ #if CONFIG_MP3_DECODER &ff_mp3_decoder, @@ -8,12 +8,12 @@ diff -up firefox-97.0/media/ffvpx/libavcodec/codec_list.c.1667096 firefox-97.0/m +#ifdef CONFIG_LIBFDK_AAC + &ff_libfdk_aac_decoder, +#endif - #if CONFIG_AV1_DECODER - &ff_av1_decoder, + #if CONFIG_LIBDAV1D + &ff_libdav1d_decoder, #endif -diff -up firefox-97.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-97.0/media/ffvpx/libavcodec/libfdk-aacdec.c ---- firefox-97.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 2022-02-08 10:21:17.151809054 +0100 -+++ firefox-97.0/media/ffvpx/libavcodec/libfdk-aacdec.c 2022-02-08 10:21:17.151809054 +0100 +diff -up firefox-98.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-98.0/media/ffvpx/libavcodec/libfdk-aacdec.c +--- firefox-98.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 2022-03-01 11:15:54.963398914 +0100 ++++ firefox-98.0/media/ffvpx/libavcodec/libfdk-aacdec.c 2022-03-01 11:15:54.963398914 +0100 @@ -0,0 +1,409 @@ +/* + * AAC decoder wrapper @@ -424,12 +424,12 @@ diff -up firefox-97.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-97. + FF_CODEC_CAP_INIT_CLEANUP, + .wrapper_name = "libfdk", +}; -diff -up firefox-97.0/media/ffvpx/libavcodec/moz.build.1667096 firefox-97.0/media/ffvpx/libavcodec/moz.build ---- firefox-97.0/media/ffvpx/libavcodec/moz.build.1667096 2022-02-02 22:01:47.000000000 +0100 -+++ firefox-97.0/media/ffvpx/libavcodec/moz.build 2022-02-08 10:21:17.151809054 +0100 -@@ -111,6 +111,12 @@ if not CONFIG['MOZ_FFVPX_AUDIOONLY']: - ] - USE_LIBS += ['mozva'] +diff -up firefox-98.0/media/ffvpx/libavcodec/moz.build.1667096 firefox-98.0/media/ffvpx/libavcodec/moz.build +--- firefox-98.0/media/ffvpx/libavcodec/moz.build.1667096 2022-03-01 11:15:54.963398914 +0100 ++++ firefox-98.0/media/ffvpx/libavcodec/moz.build 2022-03-01 11:18:00.646453768 +0100 +@@ -123,6 +123,12 @@ if CONFIG['MOZ_LIBAV_FFT']: + 'avfft.c', + ] +if CONFIG['MOZ_FDK_AAC']: + SOURCES += [ @@ -437,13 +437,13 @@ diff -up firefox-97.0/media/ffvpx/libavcodec/moz.build.1667096 firefox-97.0/medi + ] + OS_LIBS += CONFIG['MOZ_FDK_AAC_LIBS'] + - if CONFIG['MOZ_LIBAV_FFT']: - SOURCES += [ - 'avfft.c', -diff -up firefox-97.0/toolkit/moz.configure.1667096 firefox-97.0/toolkit/moz.configure ---- firefox-97.0/toolkit/moz.configure.1667096 2022-02-08 10:21:17.152809035 +0100 -+++ firefox-97.0/toolkit/moz.configure 2022-02-08 10:24:31.734885827 +0100 -@@ -1969,6 +1969,15 @@ with only_when(compile_environment): + SYMBOLS_FILE = 'avcodec.symbols' + NoVisibilityFlags() + +diff -up firefox-98.0/toolkit/moz.configure.1667096 firefox-98.0/toolkit/moz.configure +--- firefox-98.0/toolkit/moz.configure.1667096 2022-03-01 11:15:54.881396269 +0100 ++++ firefox-98.0/toolkit/moz.configure 2022-03-01 11:15:54.963398914 +0100 +@@ -1950,6 +1950,15 @@ with only_when(compile_environment): set_config("MOZ_SYSTEM_PNG", True, when="--with-system-png") diff --git a/sources b/sources index d90aa63..3b484cc 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = b9ab1498be90ecf60822df7021f8812f124550d97f8cd687c69d3ab56fc5fb714bfe88c78c978a1794d211724909a9a5cad6a4b483fa05f762909c45d5075520 SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (firefox-97.0.1.source.tar.xz) = 8620aace77167593aab5acd230860eb3e67eeddc49c0aad0491b5dc20bd0ddb6089dbb8975aed241426f57b2ad772238b04d03b95390175f580cbd80bb6d5f6c -SHA512 (firefox-langpacks-97.0.1-20220218.tar.xz) = bb191d08d5bf8b1d375667a019f33a35cc62ce416415ae1213ce392c112b54efde13d0ad2e1d4d7e84943ff1d20249c5970ec0e648067231b28ef13b9fa85306 +SHA512 (firefox-98.0.source.tar.xz) = e4728316d919cad2c7b9bfc08cd6fa651c0706e14dba1629382ef1e8d723ebf22c6a892f23928ee05d98b9eadfa1c3e3fd803077c64919786c176c5e8d87863a +SHA512 (firefox-langpacks-98.0-20220301.tar.xz) = 54cc19003903da31bdc485eaf208e35759a390c71bb96a10757cbe10fbc65a1524a8d33c071589ee3f949508df66ced7115c0e4203e17bd672672fe303b4a5ee From e7fac329e3eedc1a6d61d69d0f3ccdb9888126ac Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 2 Mar 2022 10:51:06 +0100 Subject: [PATCH 021/545] i686 build fixes --- D139703.diff | 222 +++++++++++++++++++++++++++++++++++++++++++++++++++ D139704.diff | 21 +++++ firefox.spec | 4 + 3 files changed, 247 insertions(+) create mode 100644 D139703.diff create mode 100644 D139704.diff diff --git a/D139703.diff b/D139703.diff new file mode 100644 index 0000000..4c929fd --- /dev/null +++ b/D139703.diff @@ -0,0 +1,222 @@ +diff --git a/js/src/jit/GenerateAtomicOperations.py b/js/src/jit/GenerateAtomicOperations.py +--- a/js/src/jit/GenerateAtomicOperations.py ++++ b/js/src/jit/GenerateAtomicOperations.py +@@ -10,6 +10,7 @@ + + is_64bit = "JS_64BIT" in buildconfig.defines + cpu_arch = buildconfig.substs["CPU_ARCH"] ++is_gcc = buildconfig.substs["CC_TYPE"] == "gcc" + + + def fmt_insn(s): +@@ -19,21 +20,21 @@ + def gen_seqcst(fun_name): + if cpu_arch in ("x86", "x86_64"): + return r""" +- inline void %(fun_name)s() { ++ INLINE_ATTR void %(fun_name)s() { + asm volatile ("mfence\n\t" ::: "memory"); + }""" % { + "fun_name": fun_name, + } + if cpu_arch == "aarch64": + return r""" +- inline void %(fun_name)s() { ++ INLINE_ATTR void %(fun_name)s() { + asm volatile ("dmb ish\n\t" ::: "memory"); + }""" % { + "fun_name": fun_name, + } + if cpu_arch == "arm": + return r""" +- inline void %(fun_name)s() { ++ INLINE_ATTR void %(fun_name)s() { + asm volatile ("dmb sy\n\t" ::: "memory"); + }""" % { + "fun_name": fun_name, +@@ -63,7 +64,7 @@ + if barrier: + insns += fmt_insn("mfence") + return """ +- inline %(cpp_type)s %(fun_name)s(const %(cpp_type)s* arg) { ++ INLINE_ATTR %(cpp_type)s %(fun_name)s(const %(cpp_type)s* arg) { + %(cpp_type)s res; + asm volatile (%(insns)s + : [res] "=r" (res) +@@ -91,7 +92,7 @@ + if barrier: + insns += fmt_insn("dmb ish") + return """ +- inline %(cpp_type)s %(fun_name)s(const %(cpp_type)s* arg) { ++ INLINE_ATTR %(cpp_type)s %(fun_name)s(const %(cpp_type)s* arg) { + %(cpp_type)s res; + asm volatile (%(insns)s + : [res] "=r" (res) +@@ -117,7 +118,7 @@ + if barrier: + insns += fmt_insn("dmb sy") + return """ +- inline %(cpp_type)s %(fun_name)s(const %(cpp_type)s* arg) { ++ INLINE_ATTR %(cpp_type)s %(fun_name)s(const %(cpp_type)s* arg) { + %(cpp_type)s res; + asm volatile (%(insns)s + : [res] "=r" (res) +@@ -154,7 +155,7 @@ + if barrier: + insns += fmt_insn("mfence") + return """ +- inline void %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { ++ INLINE_ATTR void %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { + asm volatile (%(insns)s + : + : [addr] "r" (addr), [val] "r"(val) +@@ -180,7 +181,7 @@ + if barrier: + insns += fmt_insn("dmb ish") + return """ +- inline void %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { ++ INLINE_ATTR void %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { + asm volatile (%(insns)s + : + : [addr] "r" (addr), [val] "r"(val) +@@ -204,7 +205,7 @@ + if barrier: + insns += fmt_insn("dmb sy") + return """ +- inline void %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { ++ INLINE_ATTR void %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { + asm volatile (%(insns)s + : + : [addr] "r" (addr), [val] "r"(val) +@@ -235,7 +236,7 @@ + assert size == 64 + insns += fmt_insn("xchgq %[val], (%[addr])") + return """ +- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { ++ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { + asm volatile (%(insns)s + : [val] "+r" (val) + : [addr] "r" (addr) +@@ -266,7 +267,7 @@ + insns += fmt_insn("cbnz %w[scratch], 0b") + insns += fmt_insn("dmb ish") + return """ +- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { ++ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { + %(cpp_type)s res; + uint32_t scratch; + asm volatile (%(insns)s +@@ -297,7 +298,7 @@ + insns += fmt_insn("beq 0b") + insns += fmt_insn("dmb sy") + return """ +- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { ++ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { + %(cpp_type)s res; + uint32_t scratch; + asm volatile (%(insns)s +@@ -321,7 +322,7 @@ + # Use a +A constraint to load `oldval` into EDX:EAX as input/output. + # `newval` is loaded into ECX:EBX. + return r""" +- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, ++ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, + %(cpp_type)s oldval, + %(cpp_type)s newval) { + asm volatile ("lock; cmpxchg8b (%%[addr])\n\t" +@@ -337,7 +338,7 @@ + } + if cpu_arch == "arm" and size == 64: + return r""" +- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, ++ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, + %(cpp_type)s oldval, + %(cpp_type)s newval) { + uint32_t oldval0 = oldval & 0xffff'ffff; +@@ -380,7 +381,7 @@ + assert size == 64 + insns += fmt_insn("lock; cmpxchgq %[newval], (%[addr])") + return """ +- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, ++ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, + %(cpp_type)s oldval, + %(cpp_type)s newval) { + asm volatile (%(insns)s +@@ -425,7 +426,7 @@ + insns += fmt_insn("cbnz %w[scratch], 0b") + insns += fmt_insn("1: dmb ish") + return """ +- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, ++ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, + %(cpp_type)s oldval, + %(cpp_type)s newval) { + %(cpp_type)s res, scratch; +@@ -466,7 +467,7 @@ + insns += fmt_insn("beq 0b") + insns += fmt_insn("1: dmb sy") + return """ +- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, ++ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, + %(cpp_type)s oldval, + %(cpp_type)s newval) { + %(cpp_type)s res, scratch; +@@ -501,7 +502,7 @@ + assert size == 64 + insns += fmt_insn("lock; xaddq %[val], (%[addr])") + return """ +- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { ++ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { + asm volatile (%(insns)s + : [val] "+&r" (val) + : [addr] "r" (addr) +@@ -539,7 +540,7 @@ + insns = insns.replace("OP", op) + insns += fmt_insn("jnz 0b") + return """ +- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { ++ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { + %(cpp_type)s res, scratch; + asm volatile (%(insns)s + : [res] "=&a" (res), [scratch] "=&r" (scratch) +@@ -581,7 +582,7 @@ + insns += fmt_insn("cbnz %w[scratch2], 0b") + insns += fmt_insn("dmb ish") + return """ +- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { ++ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { + %(cpp_type)s res; + uintptr_t scratch1, scratch2; + asm volatile (%(insns)s +@@ -621,7 +622,7 @@ + insns += fmt_insn("beq 0b") + insns += fmt_insn("dmb sy") + return """ +- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { ++ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { + %(cpp_type)s res; + uintptr_t scratch1, scratch2; + asm volatile (%(insns)s +@@ -681,7 +682,7 @@ + offset -= 1 + + return """ +- inline void %(fun_name)s(uint8_t* dst, const uint8_t* src) { ++ INLINE_ATTR void %(fun_name)s(uint8_t* dst, const uint8_t* src) { + %(cpp_type)s* dst_ = reinterpret_cast<%(cpp_type)s*>(dst); + const %(cpp_type)s* src_ = reinterpret_cast(src); + %(cpp_type)s scratch; +@@ -853,6 +854,13 @@ + "constexpr size_t JS_GENERATED_ATOMICS_WORDSIZE = " + str(wordsize) + ";\n" + ) + ++ # Work around a GCC issue on 32-bit x86 by adding MOZ_NEVER_INLINE. ++ # See bug 1756347. ++ if is_gcc and cpu_arch == "x86": ++ contents = contents.replace("INLINE_ATTR", "MOZ_NEVER_INLINE inline") ++ else: ++ contents = contents.replace("INLINE_ATTR", "inline") ++ + c_out.write( + HEADER_TEMPLATE + % { + diff --git a/D139704.diff b/D139704.diff new file mode 100644 index 0000000..ab1ea42 --- /dev/null +++ b/D139704.diff @@ -0,0 +1,21 @@ +diff --git a/js/src/jit/GenerateAtomicOperations.py b/js/src/jit/GenerateAtomicOperations.py +--- a/js/src/jit/GenerateAtomicOperations.py ++++ b/js/src/jit/GenerateAtomicOperations.py +@@ -666,12 +666,12 @@ + insns += fmt_insn("str %x[scratch], [%x[dst], OFFSET]") + elif cpu_arch == "arm": + if size == 1: +- insns += fmt_insn("ldrb %[scratch], [%[src], OFFSET]") +- insns += fmt_insn("strb %[scratch], [%[dst], OFFSET]") ++ insns += fmt_insn("ldrb %[scratch], [%[src], #OFFSET]") ++ insns += fmt_insn("strb %[scratch], [%[dst], #OFFSET]") + else: + assert size == 4 +- insns += fmt_insn("ldr %[scratch], [%[src], OFFSET]") +- insns += fmt_insn("str %[scratch], [%[dst], OFFSET]") ++ insns += fmt_insn("ldr %[scratch], [%[src], #OFFSET]") ++ insns += fmt_insn("str %[scratch], [%[dst], #OFFSET]") + else: + raise Exception("Unexpected arch") + insns = insns.replace("OFFSET", str(offset * size)) + diff --git a/firefox.spec b/firefox.spec index ec27bab..185cc37 100644 --- a/firefox.spec +++ b/firefox.spec @@ -222,6 +222,8 @@ Patch62: build-python.patch Patch65: D139022.diff Patch66: D139078.diff Patch67: D139088.diff +Patch68: D139703.diff +Patch69: D139704.diff # Test patches # Generate without context by @@ -468,6 +470,8 @@ This package contains results of tests executed during build. %patch65 -p1 -b .D139022 %patch66 -p1 -b .D139078 %patch67 -p1 -b .D139088 +%patch68 -p1 -b .D139703 +%patch69 -p1 -b .D139704 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell From 34e2f4991c214dd61237a14f2a39f3d2bd819cc5 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 2 Mar 2022 15:58:15 +0100 Subject: [PATCH 022/545] Added support for ffmpeg 5.0, spec tweaks --- firefox.spec | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/firefox.spec b/firefox.spec index 185cc37..4720289 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 98.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -248,6 +248,11 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch +# ffmpeg50 +Patch500: D139696.diff +Patch501: D139697.diff +Patch502: D139698.diff +Patch503: D139699.diff # PGO/LTO patches Patch600: pgo.patch @@ -495,6 +500,12 @@ This package contains results of tests executed during build. %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 +# ffmpeg50 +%patch500 -p1 -b .D139696 +%patch501 -p1 -b .D139697 +%patch502 -p1 -b .D139698 +%patch503 -p1 -b .D139699 + # PGO patches %if %{build_with_pgo} %if !%{build_with_clang} @@ -744,12 +755,12 @@ cp %{SOURCE45} . %if %{build_with_pgo} %if %{test_on_wayland} env | grep "WAYLAND" -MOZ_ENABLE_WAYLAND=1 ./mach build -v 2>&1 | cat - +MOZ_ENABLE_WAYLAND=1 ./mach build -v 2>&1 | cat - || exit 1 %else -xvfb-run ./mach build -v 2>&1 | cat - +xvfb-run ./mach build -v 2>&1 | cat - || exit 1 %endif %else -./mach build -v 2>&1 | cat - +./mach build -v 2>&1 | cat - || exit 1 %endif #--------------------------------------------------------------------- @@ -1060,6 +1071,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Wed Mar 2 2022 Martin Stransky - 98.0-2 +- Added support for ffmpeg 5.0 +- Spec tweaks + * Tue Mar 1 2022 Martin Stransky - 98.0-1 - Updated to 98.0 From 12e554d703b6e7e1fb8a797ab8d30b13bf80bd1e Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 4 Mar 2022 11:59:22 +0100 Subject: [PATCH 023/545] Added missing files, updated to build2 --- .gitignore | 1 + D139696.diff | 13808 +++++++++++++++++++++++++++++++++++++++++++++++++ D139697.diff | 27 + D139698.diff | 191 + D139699.diff | 127 + firefox.spec | 1 + sources | 4 +- 7 files changed, 14157 insertions(+), 2 deletions(-) create mode 100644 D139696.diff create mode 100644 D139697.diff create mode 100644 D139698.diff create mode 100644 D139699.diff diff --git a/.gitignore b/.gitignore index 8fd6453..507a98a 100644 --- a/.gitignore +++ b/.gitignore @@ -497,3 +497,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-97.0.1-20220218.tar.xz /firefox-98.0.source.tar.xz /firefox-langpacks-98.0-20220301.tar.xz +/firefox-langpacks-98.0-20220304.tar.xz diff --git a/D139696.diff b/D139696.diff new file mode 100644 index 0000000..432a9c6 --- /dev/null +++ b/D139696.diff @@ -0,0 +1,13808 @@ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/COPYING.LGPLv2.1 b/dom/media/platforms/ffmpeg/ffmpeg59/include/COPYING.LGPLv2.1 +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/COPYING.LGPLv2.1 +@@ -0,0 +1,504 @@ ++ GNU LESSER GENERAL PUBLIC LICENSE ++ Version 2.1, February 1999 ++ ++ Copyright (C) 1991, 1999 Free Software Foundation, Inc. ++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ Everyone is permitted to copy and distribute verbatim copies ++ of this license document, but changing it is not allowed. ++ ++[This is the first released version of the Lesser GPL. It also counts ++ as the successor of the GNU Library Public License, version 2, hence ++ the version number 2.1.] ++ ++ Preamble ++ ++ The licenses for most software are designed to take away your ++freedom to share and change it. By contrast, the GNU General Public ++Licenses are intended to guarantee your freedom to share and change ++free software--to make sure the software is free for all its users. ++ ++ This license, the Lesser General Public License, applies to some ++specially designated software packages--typically libraries--of the ++Free Software Foundation and other authors who decide to use it. You ++can use it too, but we suggest you first think carefully about whether ++this license or the ordinary General Public License is the better ++strategy to use in any particular case, based on the explanations below. ++ ++ When we speak of free software, we are referring to freedom of use, ++not price. Our General Public Licenses are designed to make sure that ++you have the freedom to distribute copies of free software (and charge ++for this service if you wish); that you receive source code or can get ++it if you want it; that you can change the software and use pieces of ++it in new free programs; and that you are informed that you can do ++these things. ++ ++ To protect your rights, we need to make restrictions that forbid ++distributors to deny you these rights or to ask you to surrender these ++rights. These restrictions translate to certain responsibilities for ++you if you distribute copies of the library or if you modify it. ++ ++ For example, if you distribute copies of the library, whether gratis ++or for a fee, you must give the recipients all the rights that we gave ++you. You must make sure that they, too, receive or can get the source ++code. If you link other code with the library, you must provide ++complete object files to the recipients, so that they can relink them ++with the library after making changes to the library and recompiling ++it. And you must show them these terms so they know their rights. ++ ++ We protect your rights with a two-step method: (1) we copyright the ++library, and (2) we offer you this license, which gives you legal ++permission to copy, distribute and/or modify the library. ++ ++ To protect each distributor, we want to make it very clear that ++there is no warranty for the free library. Also, if the library is ++modified by someone else and passed on, the recipients should know ++that what they have is not the original version, so that the original ++author's reputation will not be affected by problems that might be ++introduced by others. ++ ++ Finally, software patents pose a constant threat to the existence of ++any free program. We wish to make sure that a company cannot ++effectively restrict the users of a free program by obtaining a ++restrictive license from a patent holder. Therefore, we insist that ++any patent license obtained for a version of the library must be ++consistent with the full freedom of use specified in this license. ++ ++ Most GNU software, including some libraries, is covered by the ++ordinary GNU General Public License. This license, the GNU Lesser ++General Public License, applies to certain designated libraries, and ++is quite different from the ordinary General Public License. We use ++this license for certain libraries in order to permit linking those ++libraries into non-free programs. ++ ++ When a program is linked with a library, whether statically or using ++a shared library, the combination of the two is legally speaking a ++combined work, a derivative of the original library. The ordinary ++General Public License therefore permits such linking only if the ++entire combination fits its criteria of freedom. The Lesser General ++Public License permits more lax criteria for linking other code with ++the library. ++ ++ We call this license the "Lesser" General Public License because it ++does Less to protect the user's freedom than the ordinary General ++Public License. It also provides other free software developers Less ++of an advantage over competing non-free programs. These disadvantages ++are the reason we use the ordinary General Public License for many ++libraries. However, the Lesser license provides advantages in certain ++special circumstances. ++ ++ For example, on rare occasions, there may be a special need to ++encourage the widest possible use of a certain library, so that it becomes ++a de-facto standard. To achieve this, non-free programs must be ++allowed to use the library. A more frequent case is that a free ++library does the same job as widely used non-free libraries. In this ++case, there is little to gain by limiting the free library to free ++software only, so we use the Lesser General Public License. ++ ++ In other cases, permission to use a particular library in non-free ++programs enables a greater number of people to use a large body of ++free software. For example, permission to use the GNU C Library in ++non-free programs enables many more people to use the whole GNU ++operating system, as well as its variant, the GNU/Linux operating ++system. ++ ++ Although the Lesser General Public License is Less protective of the ++users' freedom, it does ensure that the user of a program that is ++linked with the Library has the freedom and the wherewithal to run ++that program using a modified version of the Library. ++ ++ The precise terms and conditions for copying, distribution and ++modification follow. Pay close attention to the difference between a ++"work based on the library" and a "work that uses the library". The ++former contains code derived from the library, whereas the latter must ++be combined with the library in order to run. ++ ++ GNU LESSER GENERAL PUBLIC LICENSE ++ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION ++ ++ 0. This License Agreement applies to any software library or other ++program which contains a notice placed by the copyright holder or ++other authorized party saying it may be distributed under the terms of ++this Lesser General Public License (also called "this License"). ++Each licensee is addressed as "you". ++ ++ A "library" means a collection of software functions and/or data ++prepared so as to be conveniently linked with application programs ++(which use some of those functions and data) to form executables. ++ ++ The "Library", below, refers to any such software library or work ++which has been distributed under these terms. A "work based on the ++Library" means either the Library or any derivative work under ++copyright law: that is to say, a work containing the Library or a ++portion of it, either verbatim or with modifications and/or translated ++straightforwardly into another language. (Hereinafter, translation is ++included without limitation in the term "modification".) ++ ++ "Source code" for a work means the preferred form of the work for ++making modifications to it. For a library, complete source code means ++all the source code for all modules it contains, plus any associated ++interface definition files, plus the scripts used to control compilation ++and installation of the library. ++ ++ Activities other than copying, distribution and modification are not ++covered by this License; they are outside its scope. The act of ++running a program using the Library is not restricted, and output from ++such a program is covered only if its contents constitute a work based ++on the Library (independent of the use of the Library in a tool for ++writing it). Whether that is true depends on what the Library does ++and what the program that uses the Library does. ++ ++ 1. You may copy and distribute verbatim copies of the Library's ++complete source code as you receive it, in any medium, provided that ++you conspicuously and appropriately publish on each copy an ++appropriate copyright notice and disclaimer of warranty; keep intact ++all the notices that refer to this License and to the absence of any ++warranty; and distribute a copy of this License along with the ++Library. ++ ++ You may charge a fee for the physical act of transferring a copy, ++and you may at your option offer warranty protection in exchange for a ++fee. ++ ++ 2. You may modify your copy or copies of the Library or any portion ++of it, thus forming a work based on the Library, and copy and ++distribute such modifications or work under the terms of Section 1 ++above, provided that you also meet all of these conditions: ++ ++ a) The modified work must itself be a software library. ++ ++ b) You must cause the files modified to carry prominent notices ++ stating that you changed the files and the date of any change. ++ ++ c) You must cause the whole of the work to be licensed at no ++ charge to all third parties under the terms of this License. ++ ++ d) If a facility in the modified Library refers to a function or a ++ table of data to be supplied by an application program that uses ++ the facility, other than as an argument passed when the facility ++ is invoked, then you must make a good faith effort to ensure that, ++ in the event an application does not supply such function or ++ table, the facility still operates, and performs whatever part of ++ its purpose remains meaningful. ++ ++ (For example, a function in a library to compute square roots has ++ a purpose that is entirely well-defined independent of the ++ application. Therefore, Subsection 2d requires that any ++ application-supplied function or table used by this function must ++ be optional: if the application does not supply it, the square ++ root function must still compute square roots.) ++ ++These requirements apply to the modified work as a whole. If ++identifiable sections of that work are not derived from the Library, ++and can be reasonably considered independent and separate works in ++themselves, then this License, and its terms, do not apply to those ++sections when you distribute them as separate works. But when you ++distribute the same sections as part of a whole which is a work based ++on the Library, the distribution of the whole must be on the terms of ++this License, whose permissions for other licensees extend to the ++entire whole, and thus to each and every part regardless of who wrote ++it. ++ ++Thus, it is not the intent of this section to claim rights or contest ++your rights to work written entirely by you; rather, the intent is to ++exercise the right to control the distribution of derivative or ++collective works based on the Library. ++ ++In addition, mere aggregation of another work not based on the Library ++with the Library (or with a work based on the Library) on a volume of ++a storage or distribution medium does not bring the other work under ++the scope of this License. ++ ++ 3. You may opt to apply the terms of the ordinary GNU General Public ++License instead of this License to a given copy of the Library. To do ++this, you must alter all the notices that refer to this License, so ++that they refer to the ordinary GNU General Public License, version 2, ++instead of to this License. (If a newer version than version 2 of the ++ordinary GNU General Public License has appeared, then you can specify ++that version instead if you wish.) Do not make any other change in ++these notices. ++ ++ Once this change is made in a given copy, it is irreversible for ++that copy, so the ordinary GNU General Public License applies to all ++subsequent copies and derivative works made from that copy. ++ ++ This option is useful when you wish to copy part of the code of ++the Library into a program that is not a library. ++ ++ 4. You may copy and distribute the Library (or a portion or ++derivative of it, under Section 2) in object code or executable form ++under the terms of Sections 1 and 2 above provided that you accompany ++it with the complete corresponding machine-readable source code, which ++must be distributed under the terms of Sections 1 and 2 above on a ++medium customarily used for software interchange. ++ ++ If distribution of object code is made by offering access to copy ++from a designated place, then offering equivalent access to copy the ++source code from the same place satisfies the requirement to ++distribute the source code, even though third parties are not ++compelled to copy the source along with the object code. ++ ++ 5. A program that contains no derivative of any portion of the ++Library, but is designed to work with the Library by being compiled or ++linked with it, is called a "work that uses the Library". Such a ++work, in isolation, is not a derivative work of the Library, and ++therefore falls outside the scope of this License. ++ ++ However, linking a "work that uses the Library" with the Library ++creates an executable that is a derivative of the Library (because it ++contains portions of the Library), rather than a "work that uses the ++library". The executable is therefore covered by this License. ++Section 6 states terms for distribution of such executables. ++ ++ When a "work that uses the Library" uses material from a header file ++that is part of the Library, the object code for the work may be a ++derivative work of the Library even though the source code is not. ++Whether this is true is especially significant if the work can be ++linked without the Library, or if the work is itself a library. The ++threshold for this to be true is not precisely defined by law. ++ ++ If such an object file uses only numerical parameters, data ++structure layouts and accessors, and small macros and small inline ++functions (ten lines or less in length), then the use of the object ++file is unrestricted, regardless of whether it is legally a derivative ++work. (Executables containing this object code plus portions of the ++Library will still fall under Section 6.) ++ ++ Otherwise, if the work is a derivative of the Library, you may ++distribute the object code for the work under the terms of Section 6. ++Any executables containing that work also fall under Section 6, ++whether or not they are linked directly with the Library itself. ++ ++ 6. As an exception to the Sections above, you may also combine or ++link a "work that uses the Library" with the Library to produce a ++work containing portions of the Library, and distribute that work ++under terms of your choice, provided that the terms permit ++modification of the work for the customer's own use and reverse ++engineering for debugging such modifications. ++ ++ You must give prominent notice with each copy of the work that the ++Library is used in it and that the Library and its use are covered by ++this License. You must supply a copy of this License. If the work ++during execution displays copyright notices, you must include the ++copyright notice for the Library among them, as well as a reference ++directing the user to the copy of this License. Also, you must do one ++of these things: ++ ++ a) Accompany the work with the complete corresponding ++ machine-readable source code for the Library including whatever ++ changes were used in the work (which must be distributed under ++ Sections 1 and 2 above); and, if the work is an executable linked ++ with the Library, with the complete machine-readable "work that ++ uses the Library", as object code and/or source code, so that the ++ user can modify the Library and then relink to produce a modified ++ executable containing the modified Library. (It is understood ++ that the user who changes the contents of definitions files in the ++ Library will not necessarily be able to recompile the application ++ to use the modified definitions.) ++ ++ b) Use a suitable shared library mechanism for linking with the ++ Library. A suitable mechanism is one that (1) uses at run time a ++ copy of the library already present on the user's computer system, ++ rather than copying library functions into the executable, and (2) ++ will operate properly with a modified version of the library, if ++ the user installs one, as long as the modified version is ++ interface-compatible with the version that the work was made with. ++ ++ c) Accompany the work with a written offer, valid for at ++ least three years, to give the same user the materials ++ specified in Subsection 6a, above, for a charge no more ++ than the cost of performing this distribution. ++ ++ d) If distribution of the work is made by offering access to copy ++ from a designated place, offer equivalent access to copy the above ++ specified materials from the same place. ++ ++ e) Verify that the user has already received a copy of these ++ materials or that you have already sent this user a copy. ++ ++ For an executable, the required form of the "work that uses the ++Library" must include any data and utility programs needed for ++reproducing the executable from it. However, as a special exception, ++the materials to be distributed need not include anything that is ++normally distributed (in either source or binary form) with the major ++components (compiler, kernel, and so on) of the operating system on ++which the executable runs, unless that component itself accompanies ++the executable. ++ ++ It may happen that this requirement contradicts the license ++restrictions of other proprietary libraries that do not normally ++accompany the operating system. Such a contradiction means you cannot ++use both them and the Library together in an executable that you ++distribute. ++ ++ 7. You may place library facilities that are a work based on the ++Library side-by-side in a single library together with other library ++facilities not covered by this License, and distribute such a combined ++library, provided that the separate distribution of the work based on ++the Library and of the other library facilities is otherwise ++permitted, and provided that you do these two things: ++ ++ a) Accompany the combined library with a copy of the same work ++ based on the Library, uncombined with any other library ++ facilities. This must be distributed under the terms of the ++ Sections above. ++ ++ b) Give prominent notice with the combined library of the fact ++ that part of it is a work based on the Library, and explaining ++ where to find the accompanying uncombined form of the same work. ++ ++ 8. You may not copy, modify, sublicense, link with, or distribute ++the Library except as expressly provided under this License. Any ++attempt otherwise to copy, modify, sublicense, link with, or ++distribute the Library is void, and will automatically terminate your ++rights under this License. However, parties who have received copies, ++or rights, from you under this License will not have their licenses ++terminated so long as such parties remain in full compliance. ++ ++ 9. You are not required to accept this License, since you have not ++signed it. However, nothing else grants you permission to modify or ++distribute the Library or its derivative works. These actions are ++prohibited by law if you do not accept this License. Therefore, by ++modifying or distributing the Library (or any work based on the ++Library), you indicate your acceptance of this License to do so, and ++all its terms and conditions for copying, distributing or modifying ++the Library or works based on it. ++ ++ 10. Each time you redistribute the Library (or any work based on the ++Library), the recipient automatically receives a license from the ++original licensor to copy, distribute, link with or modify the Library ++subject to these terms and conditions. You may not impose any further ++restrictions on the recipients' exercise of the rights granted herein. ++You are not responsible for enforcing compliance by third parties with ++this License. ++ ++ 11. If, as a consequence of a court judgment or allegation of patent ++infringement or for any other reason (not limited to patent issues), ++conditions are imposed on you (whether by court order, agreement or ++otherwise) that contradict the conditions of this License, they do not ++excuse you from the conditions of this License. If you cannot ++distribute so as to satisfy simultaneously your obligations under this ++License and any other pertinent obligations, then as a consequence you ++may not distribute the Library at all. For example, if a patent ++license would not permit royalty-free redistribution of the Library by ++all those who receive copies directly or indirectly through you, then ++the only way you could satisfy both it and this License would be to ++refrain entirely from distribution of the Library. ++ ++If any portion of this section is held invalid or unenforceable under any ++particular circumstance, the balance of the section is intended to apply, ++and the section as a whole is intended to apply in other circumstances. ++ ++It is not the purpose of this section to induce you to infringe any ++patents or other property right claims or to contest validity of any ++such claims; this section has the sole purpose of protecting the ++integrity of the free software distribution system which is ++implemented by public license practices. Many people have made ++generous contributions to the wide range of software distributed ++through that system in reliance on consistent application of that ++system; it is up to the author/donor to decide if he or she is willing ++to distribute software through any other system and a licensee cannot ++impose that choice. ++ ++This section is intended to make thoroughly clear what is believed to ++be a consequence of the rest of this License. ++ ++ 12. If the distribution and/or use of the Library is restricted in ++certain countries either by patents or by copyrighted interfaces, the ++original copyright holder who places the Library under this License may add ++an explicit geographical distribution limitation excluding those countries, ++so that distribution is permitted only in or among countries not thus ++excluded. In such case, this License incorporates the limitation as if ++written in the body of this License. ++ ++ 13. The Free Software Foundation may publish revised and/or new ++versions of the Lesser General Public License from time to time. ++Such new versions will be similar in spirit to the present version, ++but may differ in detail to address new problems or concerns. ++ ++Each version is given a distinguishing version number. If the Library ++specifies a version number of this License which applies to it and ++"any later version", you have the option of following the terms and ++conditions either of that version or of any later version published by ++the Free Software Foundation. If the Library does not specify a ++license version number, you may choose any version ever published by ++the Free Software Foundation. ++ ++ 14. If you wish to incorporate parts of the Library into other free ++programs whose distribution conditions are incompatible with these, ++write to the author to ask for permission. For software which is ++copyrighted by the Free Software Foundation, write to the Free ++Software Foundation; we sometimes make exceptions for this. Our ++decision will be guided by the two goals of preserving the free status ++of all derivatives of our free software and of promoting the sharing ++and reuse of software generally. ++ ++ NO WARRANTY ++ ++ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO ++WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. ++EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR ++OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY ++KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE ++IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE ++LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME ++THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. ++ ++ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN ++WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY ++AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU ++FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR ++CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE ++LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING ++RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A ++FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF ++SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH ++DAMAGES. ++ ++ END OF TERMS AND CONDITIONS ++ ++ How to Apply These Terms to Your New Libraries ++ ++ If you develop a new library, and you want it to be of the greatest ++possible use to the public, we recommend making it free software that ++everyone can redistribute and change. You can do so by permitting ++redistribution under these terms (or, alternatively, under the terms of the ++ordinary General Public License). ++ ++ To apply these terms, attach the following notices to the library. It is ++safest to attach them to the start of each source file to most effectively ++convey the exclusion of warranty; and each file should have at least the ++"copyright" line and a pointer to where the full notice is found. ++ ++ ++ Copyright (C) ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ ++Also add information on how to contact you by electronic and paper mail. ++ ++You should also get your employer (if you work as a programmer) or your ++school, if any, to sign a "copyright disclaimer" for the library, if ++necessary. Here is a sample; alter the names: ++ ++ Yoyodyne, Inc., hereby disclaims all copyright interest in the ++ library `Frob' (a library for tweaking knobs) written by James Random Hacker. ++ ++ , 1 April 1990 ++ Ty Coon, President of Vice ++ ++That's all there is to it! ++ ++ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/avcodec.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/avcodec.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/avcodec.h +@@ -0,0 +1,3204 @@ ++/* ++ * copyright (c) 2001 Fabrice Bellard ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifndef AVCODEC_AVCODEC_H ++#define AVCODEC_AVCODEC_H ++ ++/** ++ * @file ++ * @ingroup libavc ++ * Libavcodec external API header ++ */ ++ ++#include "libavutil/samplefmt.h" ++#include "libavutil/attributes.h" ++#include "libavutil/avutil.h" ++#include "libavutil/buffer.h" ++#include "libavutil/dict.h" ++#include "libavutil/frame.h" ++#include "libavutil/log.h" ++#include "libavutil/pixfmt.h" ++#include "libavutil/rational.h" ++ ++#include "codec.h" ++#include "codec_desc.h" ++#include "codec_par.h" ++#include "codec_id.h" ++#include "defs.h" ++#include "packet.h" ++#include "version.h" ++ ++/** ++ * @defgroup libavc libavcodec ++ * Encoding/Decoding Library ++ * ++ * @{ ++ * ++ * @defgroup lavc_decoding Decoding ++ * @{ ++ * @} ++ * ++ * @defgroup lavc_encoding Encoding ++ * @{ ++ * @} ++ * ++ * @defgroup lavc_codec Codecs ++ * @{ ++ * @defgroup lavc_codec_native Native Codecs ++ * @{ ++ * @} ++ * @defgroup lavc_codec_wrappers External library wrappers ++ * @{ ++ * @} ++ * @defgroup lavc_codec_hwaccel Hardware Accelerators bridge ++ * @{ ++ * @} ++ * @} ++ * @defgroup lavc_internal Internal ++ * @{ ++ * @} ++ * @} ++ */ ++ ++/** ++ * @ingroup libavc ++ * @defgroup lavc_encdec send/receive encoding and decoding API overview ++ * @{ ++ * ++ * The avcodec_send_packet()/avcodec_receive_frame()/avcodec_send_frame()/ ++ * avcodec_receive_packet() functions provide an encode/decode API, which ++ * decouples input and output. ++ * ++ * The API is very similar for encoding/decoding and audio/video, and works as ++ * follows: ++ * - Set up and open the AVCodecContext as usual. ++ * - Send valid input: ++ * - For decoding, call avcodec_send_packet() to give the decoder raw ++ * compressed data in an AVPacket. ++ * - For encoding, call avcodec_send_frame() to give the encoder an AVFrame ++ * containing uncompressed audio or video. ++ * ++ * In both cases, it is recommended that AVPackets and AVFrames are ++ * refcounted, or libavcodec might have to copy the input data. (libavformat ++ * always returns refcounted AVPackets, and av_frame_get_buffer() allocates ++ * refcounted AVFrames.) ++ * - Receive output in a loop. Periodically call one of the avcodec_receive_*() ++ * functions and process their output: ++ * - For decoding, call avcodec_receive_frame(). On success, it will return ++ * an AVFrame containing uncompressed audio or video data. ++ * - For encoding, call avcodec_receive_packet(). On success, it will return ++ * an AVPacket with a compressed frame. ++ * ++ * Repeat this call until it returns AVERROR(EAGAIN) or an error. The ++ * AVERROR(EAGAIN) return value means that new input data is required to ++ * return new output. In this case, continue with sending input. For each ++ * input frame/packet, the codec will typically return 1 output frame/packet, ++ * but it can also be 0 or more than 1. ++ * ++ * At the beginning of decoding or encoding, the codec might accept multiple ++ * input frames/packets without returning a frame, until its internal buffers ++ * are filled. This situation is handled transparently if you follow the steps ++ * outlined above. ++ * ++ * In theory, sending input can result in EAGAIN - this should happen only if ++ * not all output was received. You can use this to structure alternative decode ++ * or encode loops other than the one suggested above. For example, you could ++ * try sending new input on each iteration, and try to receive output if that ++ * returns EAGAIN. ++ * ++ * End of stream situations. These require "flushing" (aka draining) the codec, ++ * as the codec might buffer multiple frames or packets internally for ++ * performance or out of necessity (consider B-frames). ++ * This is handled as follows: ++ * - Instead of valid input, send NULL to the avcodec_send_packet() (decoding) ++ * or avcodec_send_frame() (encoding) functions. This will enter draining ++ * mode. ++ * - Call avcodec_receive_frame() (decoding) or avcodec_receive_packet() ++ * (encoding) in a loop until AVERROR_EOF is returned. The functions will ++ * not return AVERROR(EAGAIN), unless you forgot to enter draining mode. ++ * - Before decoding can be resumed again, the codec has to be reset with ++ * avcodec_flush_buffers(). ++ * ++ * Using the API as outlined above is highly recommended. But it is also ++ * possible to call functions outside of this rigid schema. For example, you can ++ * call avcodec_send_packet() repeatedly without calling ++ * avcodec_receive_frame(). In this case, avcodec_send_packet() will succeed ++ * until the codec's internal buffer has been filled up (which is typically of ++ * size 1 per output frame, after initial input), and then reject input with ++ * AVERROR(EAGAIN). Once it starts rejecting input, you have no choice but to ++ * read at least some output. ++ * ++ * Not all codecs will follow a rigid and predictable dataflow; the only ++ * guarantee is that an AVERROR(EAGAIN) return value on a send/receive call on ++ * one end implies that a receive/send call on the other end will succeed, or ++ * at least will not fail with AVERROR(EAGAIN). In general, no codec will ++ * permit unlimited buffering of input or output. ++ * ++ * A codec is not allowed to return AVERROR(EAGAIN) for both sending and ++ * receiving. This would be an invalid state, which could put the codec user ++ * into an endless loop. The API has no concept of time either: it cannot happen ++ * that trying to do avcodec_send_packet() results in AVERROR(EAGAIN), but a ++ * repeated call 1 second later accepts the packet (with no other receive/flush ++ * API calls involved). The API is a strict state machine, and the passage of ++ * time is not supposed to influence it. Some timing-dependent behavior might ++ * still be deemed acceptable in certain cases. But it must never result in both ++ * send/receive returning EAGAIN at the same time at any point. It must also ++ * absolutely be avoided that the current state is "unstable" and can ++ * "flip-flop" between the send/receive APIs allowing progress. For example, ++ * it's not allowed that the codec randomly decides that it actually wants to ++ * consume a packet now instead of returning a frame, after it just returned ++ * AVERROR(EAGAIN) on an avcodec_send_packet() call. ++ * @} ++ */ ++ ++/** ++ * @defgroup lavc_core Core functions/structures. ++ * @ingroup libavc ++ * ++ * Basic definitions, functions for querying libavcodec capabilities, ++ * allocating core structures, etc. ++ * @{ ++ */ ++ ++/** ++ * @ingroup lavc_encoding ++ * minimum encoding buffer size ++ * Used to avoid some checks during header writing. ++ */ ++#define AV_INPUT_BUFFER_MIN_SIZE 16384 ++ ++/** ++ * @ingroup lavc_encoding ++ */ ++typedef struct RcOverride { ++ int start_frame; ++ int end_frame; ++ int qscale; // If this is 0 then quality_factor will be used instead. ++ float quality_factor; ++} RcOverride; ++ ++/* encoding support ++ These flags can be passed in AVCodecContext.flags before initialization. ++ Note: Not everything is supported yet. ++*/ ++ ++/** ++ * Allow decoders to produce frames with data planes that are not aligned ++ * to CPU requirements (e.g. due to cropping). ++ */ ++#define AV_CODEC_FLAG_UNALIGNED (1 << 0) ++/** ++ * Use fixed qscale. ++ */ ++#define AV_CODEC_FLAG_QSCALE (1 << 1) ++/** ++ * 4 MV per MB allowed / advanced prediction for H.263. ++ */ ++#define AV_CODEC_FLAG_4MV (1 << 2) ++/** ++ * Output even those frames that might be corrupted. ++ */ ++#define AV_CODEC_FLAG_OUTPUT_CORRUPT (1 << 3) ++/** ++ * Use qpel MC. ++ */ ++#define AV_CODEC_FLAG_QPEL (1 << 4) ++/** ++ * Don't output frames whose parameters differ from first ++ * decoded frame in stream. ++ */ ++#define AV_CODEC_FLAG_DROPCHANGED (1 << 5) ++/** ++ * Use internal 2pass ratecontrol in first pass mode. ++ */ ++#define AV_CODEC_FLAG_PASS1 (1 << 9) ++/** ++ * Use internal 2pass ratecontrol in second pass mode. ++ */ ++#define AV_CODEC_FLAG_PASS2 (1 << 10) ++/** ++ * loop filter. ++ */ ++#define AV_CODEC_FLAG_LOOP_FILTER (1 << 11) ++/** ++ * Only decode/encode grayscale. ++ */ ++#define AV_CODEC_FLAG_GRAY (1 << 13) ++/** ++ * error[?] variables will be set during encoding. ++ */ ++#define AV_CODEC_FLAG_PSNR (1 << 15) ++#if FF_API_FLAG_TRUNCATED ++/** ++ * Input bitstream might be truncated at a random location ++ * instead of only at frame boundaries. ++ * ++ * @deprecated use codec parsers for packetizing input ++ */ ++# define AV_CODEC_FLAG_TRUNCATED (1 << 16) ++#endif ++/** ++ * Use interlaced DCT. ++ */ ++#define AV_CODEC_FLAG_INTERLACED_DCT (1 << 18) ++/** ++ * Force low delay. ++ */ ++#define AV_CODEC_FLAG_LOW_DELAY (1 << 19) ++/** ++ * Place global headers in extradata instead of every keyframe. ++ */ ++#define AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22) ++/** ++ * Use only bitexact stuff (except (I)DCT). ++ */ ++#define AV_CODEC_FLAG_BITEXACT (1 << 23) ++/* Fx : Flag for H.263+ extra options */ ++/** ++ * H.263 advanced intra coding / MPEG-4 AC prediction ++ */ ++#define AV_CODEC_FLAG_AC_PRED (1 << 24) ++/** ++ * interlaced motion estimation ++ */ ++#define AV_CODEC_FLAG_INTERLACED_ME (1 << 29) ++#define AV_CODEC_FLAG_CLOSED_GOP (1U << 31) ++ ++/** ++ * Allow non spec compliant speedup tricks. ++ */ ++#define AV_CODEC_FLAG2_FAST (1 << 0) ++/** ++ * Skip bitstream encoding. ++ */ ++#define AV_CODEC_FLAG2_NO_OUTPUT (1 << 2) ++/** ++ * Place global headers at every keyframe instead of in extradata. ++ */ ++#define AV_CODEC_FLAG2_LOCAL_HEADER (1 << 3) ++ ++/** ++ * timecode is in drop frame format. DEPRECATED!!!! ++ */ ++#define AV_CODEC_FLAG2_DROP_FRAME_TIMECODE (1 << 13) ++ ++/** ++ * Input bitstream might be truncated at a packet boundaries ++ * instead of only at frame boundaries. ++ */ ++#define AV_CODEC_FLAG2_CHUNKS (1 << 15) ++/** ++ * Discard cropping information from SPS. ++ */ ++#define AV_CODEC_FLAG2_IGNORE_CROP (1 << 16) ++ ++/** ++ * Show all frames before the first keyframe ++ */ ++#define AV_CODEC_FLAG2_SHOW_ALL (1 << 22) ++/** ++ * Export motion vectors through frame side data ++ */ ++#define AV_CODEC_FLAG2_EXPORT_MVS (1 << 28) ++/** ++ * Do not skip samples and export skip information as frame side data ++ */ ++#define AV_CODEC_FLAG2_SKIP_MANUAL (1 << 29) ++/** ++ * Do not reset ASS ReadOrder field on flush (subtitles decoding) ++ */ ++#define AV_CODEC_FLAG2_RO_FLUSH_NOOP (1 << 30) ++ ++/* Unsupported options : ++ * Syntax Arithmetic coding (SAC) ++ * Reference Picture Selection ++ * Independent Segment Decoding */ ++/* /Fx */ ++/* codec capabilities */ ++ ++/* Exported side data. ++ These flags can be passed in AVCodecContext.export_side_data before ++ initialization. ++*/ ++/** ++ * Export motion vectors through frame side data ++ */ ++#define AV_CODEC_EXPORT_DATA_MVS (1 << 0) ++/** ++ * Export encoder Producer Reference Time through packet side data ++ */ ++#define AV_CODEC_EXPORT_DATA_PRFT (1 << 1) ++/** ++ * Decoding only. ++ * Export the AVVideoEncParams structure through frame side data. ++ */ ++#define AV_CODEC_EXPORT_DATA_VIDEO_ENC_PARAMS (1 << 2) ++/** ++ * Decoding only. ++ * Do not apply film grain, export it instead. ++ */ ++#define AV_CODEC_EXPORT_DATA_FILM_GRAIN (1 << 3) ++ ++/** ++ * The decoder will keep a reference to the frame and may reuse it later. ++ */ ++#define AV_GET_BUFFER_FLAG_REF (1 << 0) ++ ++/** ++ * The encoder will keep a reference to the packet and may reuse it later. ++ */ ++#define AV_GET_ENCODE_BUFFER_FLAG_REF (1 << 0) ++ ++struct AVCodecInternal; ++ ++/** ++ * main external API structure. ++ * New fields can be added to the end with minor version bumps. ++ * Removal, reordering and changes to existing fields require a major ++ * version bump. ++ * You can use AVOptions (av_opt* / av_set/get*()) to access these fields from ++ * user applications. The name string for AVOptions options matches the ++ * associated command line parameter name and can be found in ++ * libavcodec/options_table.h The AVOption/command line parameter names differ ++ * in some cases from the C structure field names for historic reasons or ++ * brevity. sizeof(AVCodecContext) must not be used outside libav*. ++ */ ++typedef struct AVCodecContext { ++ /** ++ * information on struct for av_log ++ * - set by avcodec_alloc_context3 ++ */ ++ const AVClass* av_class; ++ int log_level_offset; ++ ++ enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */ ++ const struct AVCodec* codec; ++ enum AVCodecID codec_id; /* see AV_CODEC_ID_xxx */ ++ ++ /** ++ * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). ++ * This is used to work around some encoder bugs. ++ * A demuxer should set this to what is stored in the field used to identify ++ * the codec. If there are multiple such fields in a container then the ++ * demuxer should choose the one which maximizes the information about the ++ * used codec. If the codec tag field in a container is larger than 32 bits ++ * then the demuxer should remap the longer ID to 32 bits with a table or ++ * other structure. Alternatively a new extra_codec_tag + size could be added ++ * but for this a clear advantage must be demonstrated first. ++ * - encoding: Set by user, if not then the default based on codec_id will be ++ * used. ++ * - decoding: Set by user, will be converted to uppercase by libavcodec ++ * during init. ++ */ ++ unsigned int codec_tag; ++ ++ void* priv_data; ++ ++ /** ++ * Private context used for internal data. ++ * ++ * Unlike priv_data, this is not codec-specific. It is used in general ++ * libavcodec functions. ++ */ ++ struct AVCodecInternal* internal; ++ ++ /** ++ * Private data of the user, can be used to carry app specific stuff. ++ * - encoding: Set by user. ++ * - decoding: Set by user. ++ */ ++ void* opaque; ++ ++ /** ++ * the average bitrate ++ * - encoding: Set by user; unused for constant quantizer encoding. ++ * - decoding: Set by user, may be overwritten by libavcodec ++ * if this info is available in the stream ++ */ ++ int64_t bit_rate; ++ ++ /** ++ * number of bits the bitstream is allowed to diverge from the reference. ++ * the reference can be CBR (for CBR pass1) or VBR (for pass2) ++ * - encoding: Set by user; unused for constant quantizer encoding. ++ * - decoding: unused ++ */ ++ int bit_rate_tolerance; ++ ++ /** ++ * Global quality for codecs which cannot change it per frame. ++ * This should be proportional to MPEG-1/2/4 qscale. ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int global_quality; ++ ++ /** ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int compression_level; ++#define FF_COMPRESSION_DEFAULT -1 ++ ++ /** ++ * AV_CODEC_FLAG_*. ++ * - encoding: Set by user. ++ * - decoding: Set by user. ++ */ ++ int flags; ++ ++ /** ++ * AV_CODEC_FLAG2_* ++ * - encoding: Set by user. ++ * - decoding: Set by user. ++ */ ++ int flags2; ++ ++ /** ++ * some codecs need / can use extradata like Huffman tables. ++ * MJPEG: Huffman tables ++ * rv10: additional flags ++ * MPEG-4: global headers (they can be in the bitstream or here) ++ * The allocated memory should be AV_INPUT_BUFFER_PADDING_SIZE bytes larger ++ * than extradata_size to avoid problems if it is read with the bitstream ++ * reader. The bytewise contents of extradata must not depend on the ++ * architecture or CPU endianness. Must be allocated with the av_malloc() ++ * family of functions. ++ * - encoding: Set/allocated/freed by libavcodec. ++ * - decoding: Set/allocated/freed by user. ++ */ ++ uint8_t* extradata; ++ int extradata_size; ++ ++ /** ++ * This is the fundamental unit of time (in seconds) in terms ++ * of which frame timestamps are represented. For fixed-fps content, ++ * timebase should be 1/framerate and timestamp increments should be ++ * identically 1. ++ * This often, but not always is the inverse of the frame rate or field rate ++ * for video. 1/time_base is not the average frame rate if the frame rate is ++ * not constant. ++ * ++ * Like containers, elementary streams also can store timestamps, 1/time_base ++ * is the unit in which these timestamps are specified. ++ * As example of such codec time base see ISO/IEC 14496-2:2001(E) ++ * vop_time_increment_resolution and fixed_vop_rate ++ * (fixed_vop_rate == 0 implies that it is different from the framerate) ++ * ++ * - encoding: MUST be set by user. ++ * - decoding: the use of this field for decoding is deprecated. ++ * Use framerate instead. ++ */ ++ AVRational time_base; ++ ++ /** ++ * For some codecs, the time base is closer to the field rate than the frame ++ * rate. Most notably, H.264 and MPEG-2 specify time_base as half of frame ++ * duration if no telecine is used ... ++ * ++ * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it ++ * to 2. ++ */ ++ int ticks_per_frame; ++ ++ /** ++ * Codec delay. ++ * ++ * Encoding: Number of frames delay there will be from the encoder input to ++ * the decoder output. (we assume the decoder matches the spec) ++ * Decoding: Number of frames delay in addition to what a standard decoder ++ * as specified in the spec would produce. ++ * ++ * Video: ++ * Number of frames the decoded output will be delayed relative to the ++ * encoded input. ++ * ++ * Audio: ++ * For encoding, this field is unused (see initial_padding). ++ * ++ * For decoding, this is the number of samples the decoder needs to ++ * output before the decoder's output is valid. When seeking, you should ++ * start decoding this many samples prior to your desired seek point. ++ * ++ * - encoding: Set by libavcodec. ++ * - decoding: Set by libavcodec. ++ */ ++ int delay; ++ ++ /* video only */ ++ /** ++ * picture width / height. ++ * ++ * @note Those fields may not match the values of the last ++ * AVFrame output by avcodec_receive_frame() due frame ++ * reordering. ++ * ++ * - encoding: MUST be set by user. ++ * - decoding: May be set by the user before opening the decoder if known e.g. ++ * from the container. Some decoders will require the dimensions ++ * to be set by the caller. During decoding, the decoder may ++ * overwrite those values as required while parsing the data. ++ */ ++ int width, height; ++ ++ /** ++ * Bitstream width / height, may be different from width/height e.g. when ++ * the decoded frame is cropped before being output or lowres is enabled. ++ * ++ * @note Those field may not match the value of the last ++ * AVFrame output by avcodec_receive_frame() due frame ++ * reordering. ++ * ++ * - encoding: unused ++ * - decoding: May be set by the user before opening the decoder if known ++ * e.g. from the container. During decoding, the decoder may ++ * overwrite those values as required while parsing the data. ++ */ ++ int coded_width, coded_height; ++ ++ /** ++ * the number of pictures in a group of pictures, or 0 for intra_only ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int gop_size; ++ ++ /** ++ * Pixel format, see AV_PIX_FMT_xxx. ++ * May be set by the demuxer if known from headers. ++ * May be overridden by the decoder if it knows better. ++ * ++ * @note This field may not match the value of the last ++ * AVFrame output by avcodec_receive_frame() due frame ++ * reordering. ++ * ++ * - encoding: Set by user. ++ * - decoding: Set by user if known, overridden by libavcodec while ++ * parsing the data. ++ */ ++ enum AVPixelFormat pix_fmt; ++ ++ /** ++ * If non NULL, 'draw_horiz_band' is called by the libavcodec ++ * decoder to draw a horizontal band. It improves cache usage. Not ++ * all codecs can do that. You must check the codec capabilities ++ * beforehand. ++ * When multithreading is used, it may be called from multiple threads ++ * at the same time; threads might draw different parts of the same AVFrame, ++ * or multiple AVFrames, and there is no guarantee that slices will be drawn ++ * in order. ++ * The function is also used by hardware acceleration APIs. ++ * It is called at least once during frame decoding to pass ++ * the data needed for hardware render. ++ * In that mode instead of pixel data, AVFrame points to ++ * a structure specific to the acceleration API. The application ++ * reads the structure and can change some fields to indicate progress ++ * or mark state. ++ * - encoding: unused ++ * - decoding: Set by user. ++ * @param height the height of the slice ++ * @param y the y position of the slice ++ * @param type 1->top field, 2->bottom field, 3->frame ++ * @param offset offset into the AVFrame.data from which the slice should be ++ * read ++ */ ++ void (*draw_horiz_band)(struct AVCodecContext* s, const AVFrame* src, ++ int offset[AV_NUM_DATA_POINTERS], int y, int type, ++ int height); ++ ++ /** ++ * Callback to negotiate the pixel format. Decoding only, may be set by the ++ * caller before avcodec_open2(). ++ * ++ * Called by some decoders to select the pixel format that will be used for ++ * the output frames. This is mainly used to set up hardware acceleration, ++ * then the provided format list contains the corresponding hwaccel pixel ++ * formats alongside the "software" one. The software pixel format may also ++ * be retrieved from \ref sw_pix_fmt. ++ * ++ * This callback will be called when the coded frame properties (such as ++ * resolution, pixel format, etc.) change and more than one output format is ++ * supported for those new properties. If a hardware pixel format is chosen ++ * and initialization for it fails, the callback may be called again ++ * immediately. ++ * ++ * This callback may be called from different threads if the decoder is ++ * multi-threaded, but not from more than one thread simultaneously. ++ * ++ * @param fmt list of formats which may be used in the current ++ * configuration, terminated by AV_PIX_FMT_NONE. ++ * @warning Behavior is undefined if the callback returns a value other ++ * than one of the formats in fmt or AV_PIX_FMT_NONE. ++ * @return the chosen format or AV_PIX_FMT_NONE ++ */ ++ enum AVPixelFormat (*get_format)(struct AVCodecContext* s, ++ const enum AVPixelFormat* fmt); ++ ++ /** ++ * maximum number of B-frames between non-B-frames ++ * Note: The output will be delayed by max_b_frames+1 relative to the input. ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int max_b_frames; ++ ++ /** ++ * qscale factor between IP and B-frames ++ * If > 0 then the last P-frame quantizer will be used (q= ++ * lastp_q*factor+offset). If < 0 then normal ratecontrol will be done (q= ++ * -normal_q*factor+offset). ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ float b_quant_factor; ++ ++ /** ++ * qscale offset between IP and B-frames ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ float b_quant_offset; ++ ++ /** ++ * Size of the frame reordering buffer in the decoder. ++ * For MPEG-2 it is 1 IPB or 0 low delay IP. ++ * - encoding: Set by libavcodec. ++ * - decoding: Set by libavcodec. ++ */ ++ int has_b_frames; ++ ++ /** ++ * qscale factor between P- and I-frames ++ * If > 0 then the last P-frame quantizer will be used (q = lastp_q * factor + ++ * offset). If < 0 then normal ratecontrol will be done (q= ++ * -normal_q*factor+offset). ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ float i_quant_factor; ++ ++ /** ++ * qscale offset between P and I-frames ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ float i_quant_offset; ++ ++ /** ++ * luminance masking (0-> disabled) ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ float lumi_masking; ++ ++ /** ++ * temporary complexity masking (0-> disabled) ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ float temporal_cplx_masking; ++ ++ /** ++ * spatial complexity masking (0-> disabled) ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ float spatial_cplx_masking; ++ ++ /** ++ * p block masking (0-> disabled) ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ float p_masking; ++ ++ /** ++ * darkness masking (0-> disabled) ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ float dark_masking; ++ ++ /** ++ * slice count ++ * - encoding: Set by libavcodec. ++ * - decoding: Set by user (or 0). ++ */ ++ int slice_count; ++ ++ /** ++ * slice offsets in the frame in bytes ++ * - encoding: Set/allocated by libavcodec. ++ * - decoding: Set/allocated by user (or NULL). ++ */ ++ int* slice_offset; ++ ++ /** ++ * sample aspect ratio (0 if unknown) ++ * That is the width of a pixel divided by the height of the pixel. ++ * Numerator and denominator must be relatively prime and smaller than 256 for ++ * some video standards. ++ * - encoding: Set by user. ++ * - decoding: Set by libavcodec. ++ */ ++ AVRational sample_aspect_ratio; ++ ++ /** ++ * motion estimation comparison function ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int me_cmp; ++ /** ++ * subpixel motion estimation comparison function ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int me_sub_cmp; ++ /** ++ * macroblock comparison function (not supported yet) ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int mb_cmp; ++ /** ++ * interlaced DCT comparison function ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int ildct_cmp; ++#define FF_CMP_SAD 0 ++#define FF_CMP_SSE 1 ++#define FF_CMP_SATD 2 ++#define FF_CMP_DCT 3 ++#define FF_CMP_PSNR 4 ++#define FF_CMP_BIT 5 ++#define FF_CMP_RD 6 ++#define FF_CMP_ZERO 7 ++#define FF_CMP_VSAD 8 ++#define FF_CMP_VSSE 9 ++#define FF_CMP_NSSE 10 ++#define FF_CMP_W53 11 ++#define FF_CMP_W97 12 ++#define FF_CMP_DCTMAX 13 ++#define FF_CMP_DCT264 14 ++#define FF_CMP_MEDIAN_SAD 15 ++#define FF_CMP_CHROMA 256 ++ ++ /** ++ * ME diamond size & shape ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int dia_size; ++ ++ /** ++ * amount of previous MV predictors (2a+1 x 2a+1 square) ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int last_predictor_count; ++ ++ /** ++ * motion estimation prepass comparison function ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int me_pre_cmp; ++ ++ /** ++ * ME prepass diamond size & shape ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int pre_dia_size; ++ ++ /** ++ * subpel ME quality ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int me_subpel_quality; ++ ++ /** ++ * maximum motion estimation search range in subpel units ++ * If 0 then no limit. ++ * ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int me_range; ++ ++ /** ++ * slice flags ++ * - encoding: unused ++ * - decoding: Set by user. ++ */ ++ int slice_flags; ++#define SLICE_FLAG_CODED_ORDER \ ++ 0x0001 ///< draw_horiz_band() is called in coded order instead of display ++#define SLICE_FLAG_ALLOW_FIELD \ ++ 0x0002 ///< allow draw_horiz_band() with field slices (MPEG-2 field pics) ++#define SLICE_FLAG_ALLOW_PLANE \ ++ 0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1) ++ ++ /** ++ * macroblock decision mode ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int mb_decision; ++#define FF_MB_DECISION_SIMPLE 0 ///< uses mb_cmp ++#define FF_MB_DECISION_BITS 1 ///< chooses the one which needs the fewest bits ++#define FF_MB_DECISION_RD 2 ///< rate distortion ++ ++ /** ++ * custom intra quantization matrix ++ * Must be allocated with the av_malloc() family of functions, and will be ++ * freed in avcodec_free_context(). ++ * - encoding: Set/allocated by user, freed by libavcodec. Can be NULL. ++ * - decoding: Set/allocated/freed by libavcodec. ++ */ ++ uint16_t* intra_matrix; ++ ++ /** ++ * custom inter quantization matrix ++ * Must be allocated with the av_malloc() family of functions, and will be ++ * freed in avcodec_free_context(). ++ * - encoding: Set/allocated by user, freed by libavcodec. Can be NULL. ++ * - decoding: Set/allocated/freed by libavcodec. ++ */ ++ uint16_t* inter_matrix; ++ ++ /** ++ * precision of the intra DC coefficient - 8 ++ * - encoding: Set by user. ++ * - decoding: Set by libavcodec ++ */ ++ int intra_dc_precision; ++ ++ /** ++ * Number of macroblock rows at the top which are skipped. ++ * - encoding: unused ++ * - decoding: Set by user. ++ */ ++ int skip_top; ++ ++ /** ++ * Number of macroblock rows at the bottom which are skipped. ++ * - encoding: unused ++ * - decoding: Set by user. ++ */ ++ int skip_bottom; ++ ++ /** ++ * minimum MB Lagrange multiplier ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int mb_lmin; ++ ++ /** ++ * maximum MB Lagrange multiplier ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int mb_lmax; ++ ++ /** ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int bidir_refine; ++ ++ /** ++ * minimum GOP size ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int keyint_min; ++ ++ /** ++ * number of reference frames ++ * - encoding: Set by user. ++ * - decoding: Set by lavc. ++ */ ++ int refs; ++ ++ /** ++ * Note: Value depends upon the compare function used for fullpel ME. ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int mv0_threshold; ++ ++ /** ++ * Chromaticity coordinates of the source primaries. ++ * - encoding: Set by user ++ * - decoding: Set by libavcodec ++ */ ++ enum AVColorPrimaries color_primaries; ++ ++ /** ++ * Color Transfer Characteristic. ++ * - encoding: Set by user ++ * - decoding: Set by libavcodec ++ */ ++ enum AVColorTransferCharacteristic color_trc; ++ ++ /** ++ * YUV colorspace type. ++ * - encoding: Set by user ++ * - decoding: Set by libavcodec ++ */ ++ enum AVColorSpace colorspace; ++ ++ /** ++ * MPEG vs JPEG YUV range. ++ * - encoding: Set by user ++ * - decoding: Set by libavcodec ++ */ ++ enum AVColorRange color_range; ++ ++ /** ++ * This defines the location of chroma samples. ++ * - encoding: Set by user ++ * - decoding: Set by libavcodec ++ */ ++ enum AVChromaLocation chroma_sample_location; ++ ++ /** ++ * Number of slices. ++ * Indicates number of picture subdivisions. Used for parallelized ++ * decoding. ++ * - encoding: Set by user ++ * - decoding: unused ++ */ ++ int slices; ++ ++ /** Field order ++ * - encoding: set by libavcodec ++ * - decoding: Set by user. ++ */ ++ enum AVFieldOrder field_order; ++ ++ /* audio only */ ++ int sample_rate; ///< samples per second ++ int channels; ///< number of audio channels ++ ++ /** ++ * audio sample format ++ * - encoding: Set by user. ++ * - decoding: Set by libavcodec. ++ */ ++ enum AVSampleFormat sample_fmt; ///< sample format ++ ++ /* The following data should not be initialized. */ ++ /** ++ * Number of samples per channel in an audio frame. ++ * ++ * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame ++ * except the last must contain exactly frame_size samples per channel. ++ * May be 0 when the codec has AV_CODEC_CAP_VARIABLE_FRAME_SIZE set, then ++ * the frame size is not restricted. ++ * - decoding: may be set by some decoders to indicate constant frame size ++ */ ++ int frame_size; ++ ++ /** ++ * Frame counter, set by libavcodec. ++ * ++ * - decoding: total number of frames returned from the decoder so far. ++ * - encoding: total number of frames passed to the encoder so far. ++ * ++ * @note the counter is not incremented if encoding/decoding resulted in ++ * an error. ++ */ ++ int frame_number; ++ ++ /** ++ * number of bytes per packet if constant and known or 0 ++ * Used by some WAV based audio codecs. ++ */ ++ int block_align; ++ ++ /** ++ * Audio cutoff bandwidth (0 means "automatic") ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int cutoff; ++ ++ /** ++ * Audio channel layout. ++ * - encoding: set by user. ++ * - decoding: set by user, may be overwritten by libavcodec. ++ */ ++ uint64_t channel_layout; ++ ++ /** ++ * Request decoder to use this channel layout if it can (0 for default) ++ * - encoding: unused ++ * - decoding: Set by user. ++ */ ++ uint64_t request_channel_layout; ++ ++ /** ++ * Type of service that the audio stream conveys. ++ * - encoding: Set by user. ++ * - decoding: Set by libavcodec. ++ */ ++ enum AVAudioServiceType audio_service_type; ++ ++ /** ++ * desired sample format ++ * - encoding: Not used. ++ * - decoding: Set by user. ++ * Decoder will decode to this format if it can. ++ */ ++ enum AVSampleFormat request_sample_fmt; ++ ++ /** ++ * This callback is called at the beginning of each frame to get data ++ * buffer(s) for it. There may be one contiguous buffer for all the data or ++ * there may be a buffer per each data plane or anything in between. What ++ * this means is, you may set however many entries in buf[] you feel ++ * necessary. Each buffer must be reference-counted using the AVBuffer API ++ * (see description of buf[] below). ++ * ++ * The following fields will be set in the frame before this callback is ++ * called: ++ * - format ++ * - width, height (video only) ++ * - sample_rate, channel_layout, nb_samples (audio only) ++ * Their values may differ from the corresponding values in ++ * AVCodecContext. This callback must use the frame values, not the codec ++ * context values, to calculate the required buffer size. ++ * ++ * This callback must fill the following fields in the frame: ++ * - data[] ++ * - linesize[] ++ * - extended_data: ++ * * if the data is planar audio with more than 8 channels, then this ++ * callback must allocate and fill extended_data to contain all pointers ++ * to all data planes. data[] must hold as many pointers as it can. ++ * extended_data must be allocated with av_malloc() and will be freed in ++ * av_frame_unref(). ++ * * otherwise extended_data must point to data ++ * - buf[] must contain one or more pointers to AVBufferRef structures. Each ++ * of the frame's data and extended_data pointers must be contained in these. ++ * That is, one AVBufferRef for each allocated chunk of memory, not ++ * necessarily one AVBufferRef per data[] entry. See: av_buffer_create(), ++ * av_buffer_alloc(), and av_buffer_ref(). ++ * - extended_buf and nb_extended_buf must be allocated with av_malloc() by ++ * this callback and filled with the extra buffers if there are more ++ * buffers than buf[] can hold. extended_buf will be freed in ++ * av_frame_unref(). ++ * ++ * If AV_CODEC_CAP_DR1 is not set then get_buffer2() must call ++ * avcodec_default_get_buffer2() instead of providing buffers allocated by ++ * some other means. ++ * ++ * Each data plane must be aligned to the maximum required by the target ++ * CPU. ++ * ++ * @see avcodec_default_get_buffer2() ++ * ++ * Video: ++ * ++ * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused ++ * (read and/or written to if it is writable) later by libavcodec. ++ * ++ * avcodec_align_dimensions2() should be used to find the required width and ++ * height, as they normally need to be rounded up to the next multiple of 16. ++ * ++ * Some decoders do not support linesizes changing between frames. ++ * ++ * If frame multithreading is used, this callback may be called from a ++ * different thread, but not from more than one at once. Does not need to be ++ * reentrant. ++ * ++ * @see avcodec_align_dimensions2() ++ * ++ * Audio: ++ * ++ * Decoders request a buffer of a particular size by setting ++ * AVFrame.nb_samples prior to calling get_buffer2(). The decoder may, ++ * however, utilize only part of the buffer by setting AVFrame.nb_samples ++ * to a smaller value in the output frame. ++ * ++ * As a convenience, av_samples_get_buffer_size() and ++ * av_samples_fill_arrays() in libavutil may be used by custom get_buffer2() ++ * functions to find the required data size and to fill data pointers and ++ * linesize. In AVFrame.linesize, only linesize[0] may be set for audio ++ * since all planes must be the same size. ++ * ++ * @see av_samples_get_buffer_size(), av_samples_fill_arrays() ++ * ++ * - encoding: unused ++ * - decoding: Set by libavcodec, user can override. ++ */ ++ int (*get_buffer2)(struct AVCodecContext* s, AVFrame* frame, int flags); ++ ++ /* - encoding parameters */ ++ float qcompress; ///< amount of qscale change between easy & hard scenes ++ ///< (0.0-1.0) ++ float qblur; ///< amount of qscale smoothing over time (0.0-1.0) ++ ++ /** ++ * minimum quantizer ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int qmin; ++ ++ /** ++ * maximum quantizer ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int qmax; ++ ++ /** ++ * maximum quantizer difference between frames ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int max_qdiff; ++ ++ /** ++ * decoder bitstream buffer size ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int rc_buffer_size; ++ ++ /** ++ * ratecontrol override, see RcOverride ++ * - encoding: Allocated/set/freed by user. ++ * - decoding: unused ++ */ ++ int rc_override_count; ++ RcOverride* rc_override; ++ ++ /** ++ * maximum bitrate ++ * - encoding: Set by user. ++ * - decoding: Set by user, may be overwritten by libavcodec. ++ */ ++ int64_t rc_max_rate; ++ ++ /** ++ * minimum bitrate ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int64_t rc_min_rate; ++ ++ /** ++ * Ratecontrol attempt to use, at maximum, of what can be used without ++ * an underflow. ++ * - encoding: Set by user. ++ * - decoding: unused. ++ */ ++ float rc_max_available_vbv_use; ++ ++ /** ++ * Ratecontrol attempt to use, at least, times the amount needed to ++ * prevent a vbv overflow. ++ * - encoding: Set by user. ++ * - decoding: unused. ++ */ ++ float rc_min_vbv_overflow_use; ++ ++ /** ++ * Number of bits which should be loaded into the rc buffer before decoding ++ * starts. ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int rc_initial_buffer_occupancy; ++ ++ /** ++ * trellis RD quantization ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int trellis; ++ ++ /** ++ * pass1 encoding statistics output buffer ++ * - encoding: Set by libavcodec. ++ * - decoding: unused ++ */ ++ char* stats_out; ++ ++ /** ++ * pass2 encoding statistics input buffer ++ * Concatenated stuff from stats_out of pass1 should be placed here. ++ * - encoding: Allocated/set/freed by user. ++ * - decoding: unused ++ */ ++ char* stats_in; ++ ++ /** ++ * Work around bugs in encoders which sometimes cannot be detected ++ * automatically. ++ * - encoding: Set by user ++ * - decoding: Set by user ++ */ ++ int workaround_bugs; ++#define FF_BUG_AUTODETECT 1 ///< autodetection ++#define FF_BUG_XVID_ILACE 4 ++#define FF_BUG_UMP4 8 ++#define FF_BUG_NO_PADDING 16 ++#define FF_BUG_AMV 32 ++#define FF_BUG_QPEL_CHROMA 64 ++#define FF_BUG_STD_QPEL 128 ++#define FF_BUG_QPEL_CHROMA2 256 ++#define FF_BUG_DIRECT_BLOCKSIZE 512 ++#define FF_BUG_EDGE 1024 ++#define FF_BUG_HPEL_CHROMA 2048 ++#define FF_BUG_DC_CLIP 4096 ++#define FF_BUG_MS \ ++ 8192 ///< Work around various bugs in Microsoft's broken decoders. ++#define FF_BUG_TRUNCATED 16384 ++#define FF_BUG_IEDGE 32768 ++ ++ /** ++ * strictly follow the standard (MPEG-4, ...). ++ * - encoding: Set by user. ++ * - decoding: Set by user. ++ * Setting this to STRICT or higher means the encoder and decoder will ++ * generally do stupid things, whereas setting it to unofficial or lower ++ * will mean the encoder might produce output that is not supported by all ++ * spec-compliant decoders. Decoders don't differentiate between normal, ++ * unofficial and experimental (that is, they always try to decode things ++ * when they can) unless they are explicitly asked to behave stupidly ++ * (=strictly conform to the specs) ++ */ ++ int strict_std_compliance; ++#define FF_COMPLIANCE_VERY_STRICT \ ++ 2 ///< Strictly conform to an older more strict version of the spec or ++ ///< reference software. ++#define FF_COMPLIANCE_STRICT \ ++ 1 ///< Strictly conform to all the things in the spec no matter what ++ ///< consequences. ++#define FF_COMPLIANCE_NORMAL 0 ++#define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions ++#define FF_COMPLIANCE_EXPERIMENTAL \ ++ -2 ///< Allow nonstandardized experimental things. ++ ++ /** ++ * error concealment flags ++ * - encoding: unused ++ * - decoding: Set by user. ++ */ ++ int error_concealment; ++#define FF_EC_GUESS_MVS 1 ++#define FF_EC_DEBLOCK 2 ++#define FF_EC_FAVOR_INTER 256 ++ ++ /** ++ * debug ++ * - encoding: Set by user. ++ * - decoding: Set by user. ++ */ ++ int debug; ++#define FF_DEBUG_PICT_INFO 1 ++#define FF_DEBUG_RC 2 ++#define FF_DEBUG_BITSTREAM 4 ++#define FF_DEBUG_MB_TYPE 8 ++#define FF_DEBUG_QP 16 ++#define FF_DEBUG_DCT_COEFF 0x00000040 ++#define FF_DEBUG_SKIP 0x00000080 ++#define FF_DEBUG_STARTCODE 0x00000100 ++#define FF_DEBUG_ER 0x00000400 ++#define FF_DEBUG_MMCO 0x00000800 ++#define FF_DEBUG_BUGS 0x00001000 ++#define FF_DEBUG_BUFFERS 0x00008000 ++#define FF_DEBUG_THREADS 0x00010000 ++#define FF_DEBUG_GREEN_MD 0x00800000 ++#define FF_DEBUG_NOMC 0x01000000 ++ ++ /** ++ * Error recognition; may misdetect some more or less valid parts as errors. ++ * - encoding: Set by user. ++ * - decoding: Set by user. ++ */ ++ int err_recognition; ++ ++/** ++ * Verify checksums embedded in the bitstream (could be of either encoded or ++ * decoded data, depending on the codec) and print an error message on mismatch. ++ * If AV_EF_EXPLODE is also set, a mismatching checksum will result in the ++ * decoder returning an error. ++ */ ++#define AV_EF_CRCCHECK (1 << 0) ++#define AV_EF_BITSTREAM (1 << 1) ///< detect bitstream specification deviations ++#define AV_EF_BUFFER (1 << 2) ///< detect improper bitstream length ++#define AV_EF_EXPLODE (1 << 3) ///< abort decoding on minor error detection ++ ++#define AV_EF_IGNORE_ERR (1 << 15) ///< ignore errors and continue ++#define AV_EF_CAREFUL \ ++ (1 << 16) ///< consider things that violate the spec, are fast to calculate ++ ///< and have not been seen in the wild as errors ++#define AV_EF_COMPLIANT \ ++ (1 << 17) ///< consider all spec non compliances as errors ++#define AV_EF_AGGRESSIVE \ ++ (1 << 18) ///< consider things that a sane encoder should not do as an error ++ ++ /** ++ * opaque 64-bit number (generally a PTS) that will be reordered and ++ * output in AVFrame.reordered_opaque ++ * - encoding: Set by libavcodec to the reordered_opaque of the input ++ * frame corresponding to the last returned packet. Only ++ * supported by encoders with the ++ * AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE capability. ++ * - decoding: Set by user. ++ */ ++ int64_t reordered_opaque; ++ ++ /** ++ * Hardware accelerator in use ++ * - encoding: unused. ++ * - decoding: Set by libavcodec ++ */ ++ const struct AVHWAccel* hwaccel; ++ ++ /** ++ * Hardware accelerator context. ++ * For some hardware accelerators, a global context needs to be ++ * provided by the user. In that case, this holds display-dependent ++ * data FFmpeg cannot instantiate itself. Please refer to the ++ * FFmpeg HW accelerator documentation to know how to fill this. ++ * - encoding: unused ++ * - decoding: Set by user ++ */ ++ void* hwaccel_context; ++ ++ /** ++ * error ++ * - encoding: Set by libavcodec if flags & AV_CODEC_FLAG_PSNR. ++ * - decoding: unused ++ */ ++ uint64_t error[AV_NUM_DATA_POINTERS]; ++ ++ /** ++ * DCT algorithm, see FF_DCT_* below ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int dct_algo; ++#define FF_DCT_AUTO 0 ++#define FF_DCT_FASTINT 1 ++#define FF_DCT_INT 2 ++#define FF_DCT_MMX 3 ++#define FF_DCT_ALTIVEC 5 ++#define FF_DCT_FAAN 6 ++ ++ /** ++ * IDCT algorithm, see FF_IDCT_* below. ++ * - encoding: Set by user. ++ * - decoding: Set by user. ++ */ ++ int idct_algo; ++#define FF_IDCT_AUTO 0 ++#define FF_IDCT_INT 1 ++#define FF_IDCT_SIMPLE 2 ++#define FF_IDCT_SIMPLEMMX 3 ++#define FF_IDCT_ARM 7 ++#define FF_IDCT_ALTIVEC 8 ++#define FF_IDCT_SIMPLEARM 10 ++#define FF_IDCT_XVID 14 ++#define FF_IDCT_SIMPLEARMV5TE 16 ++#define FF_IDCT_SIMPLEARMV6 17 ++#define FF_IDCT_FAAN 20 ++#define FF_IDCT_SIMPLENEON 22 ++#define FF_IDCT_NONE \ ++ 24 /* Used by XvMC to extract IDCT coefficients with FF_IDCT_PERM_NONE */ ++#define FF_IDCT_SIMPLEAUTO 128 ++ ++ /** ++ * bits per sample/pixel from the demuxer (needed for huffyuv). ++ * - encoding: Set by libavcodec. ++ * - decoding: Set by user. ++ */ ++ int bits_per_coded_sample; ++ ++ /** ++ * Bits per sample/pixel of internal libavcodec pixel/sample format. ++ * - encoding: set by user. ++ * - decoding: set by libavcodec. ++ */ ++ int bits_per_raw_sample; ++ ++ /** ++ * low resolution decoding, 1-> 1/2 size, 2->1/4 size ++ * - encoding: unused ++ * - decoding: Set by user. ++ */ ++ int lowres; ++ ++ /** ++ * thread count ++ * is used to decide how many independent tasks should be passed to execute() ++ * - encoding: Set by user. ++ * - decoding: Set by user. ++ */ ++ int thread_count; ++ ++ /** ++ * Which multithreading methods to use. ++ * Use of FF_THREAD_FRAME will increase decoding delay by one frame per ++ * thread, so clients which cannot provide future frames should not use it. ++ * ++ * - encoding: Set by user, otherwise the default is used. ++ * - decoding: Set by user, otherwise the default is used. ++ */ ++ int thread_type; ++#define FF_THREAD_FRAME 1 ///< Decode more than one frame at once ++#define FF_THREAD_SLICE \ ++ 2 ///< Decode more than one part of a single frame at once ++ ++ /** ++ * Which multithreading methods are in use by the codec. ++ * - encoding: Set by libavcodec. ++ * - decoding: Set by libavcodec. ++ */ ++ int active_thread_type; ++ ++#if FF_API_THREAD_SAFE_CALLBACKS ++ /** ++ * Set by the client if its custom get_buffer() callback can be called ++ * synchronously from another thread, which allows faster multithreaded ++ * decoding. draw_horiz_band() will be called from other threads regardless of ++ * this setting. Ignored if the default get_buffer() is used. ++ * - encoding: Set by user. ++ * - decoding: Set by user. ++ * ++ * @deprecated the custom get_buffer2() callback should always be ++ * thread-safe. Thread-unsafe get_buffer2() implementations will be ++ * invalid starting with LIBAVCODEC_VERSION_MAJOR=60; in other words, ++ * libavcodec will behave as if this field was always set to 1. ++ * Callers that want to be forward compatible with future libavcodec ++ * versions should wrap access to this field in ++ * #if LIBAVCODEC_VERSION_MAJOR < 60 ++ */ ++ attribute_deprecated int thread_safe_callbacks; ++#endif ++ ++ /** ++ * The codec may call this to execute several independent things. ++ * It will return only after finishing all tasks. ++ * The user may replace this with some multithreaded implementation, ++ * the default implementation will execute the parts serially. ++ * @param count the number of things to execute ++ * - encoding: Set by libavcodec, user can override. ++ * - decoding: Set by libavcodec, user can override. ++ */ ++ int (*execute)(struct AVCodecContext* c, ++ int (*func)(struct AVCodecContext* c2, void* arg), void* arg2, ++ int* ret, int count, int size); ++ ++ /** ++ * The codec may call this to execute several independent things. ++ * It will return only after finishing all tasks. ++ * The user may replace this with some multithreaded implementation, ++ * the default implementation will execute the parts serially. ++ * Also see avcodec_thread_init and e.g. the --enable-pthread configure ++ * option. ++ * @param c context passed also to func ++ * @param count the number of things to execute ++ * @param arg2 argument passed unchanged to func ++ * @param ret return values of executed functions, must have space for "count" ++ * values. May be NULL. ++ * @param func function that will be called count times, with jobnr from 0 to ++ * count-1. threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS ++ * and so that no two instances of func executing at the same time will have ++ * the same threadnr. ++ * @return always 0 currently, but code should handle a future improvement ++ * where when any call to func returns < 0 no further calls to func may be ++ * done and < 0 is returned. ++ * - encoding: Set by libavcodec, user can override. ++ * - decoding: Set by libavcodec, user can override. ++ */ ++ int (*execute2)(struct AVCodecContext* c, ++ int (*func)(struct AVCodecContext* c2, void* arg, int jobnr, ++ int threadnr), ++ void* arg2, int* ret, int count); ++ ++ /** ++ * noise vs. sse weight for the nsse comparison function ++ * - encoding: Set by user. ++ * - decoding: unused ++ */ ++ int nsse_weight; ++ ++ /** ++ * profile ++ * - encoding: Set by user. ++ * - decoding: Set by libavcodec. ++ */ ++ int profile; ++#define FF_PROFILE_UNKNOWN -99 ++#define FF_PROFILE_RESERVED -100 ++ ++#define FF_PROFILE_AAC_MAIN 0 ++#define FF_PROFILE_AAC_LOW 1 ++#define FF_PROFILE_AAC_SSR 2 ++#define FF_PROFILE_AAC_LTP 3 ++#define FF_PROFILE_AAC_HE 4 ++#define FF_PROFILE_AAC_HE_V2 28 ++#define FF_PROFILE_AAC_LD 22 ++#define FF_PROFILE_AAC_ELD 38 ++#define FF_PROFILE_MPEG2_AAC_LOW 128 ++#define FF_PROFILE_MPEG2_AAC_HE 131 ++ ++#define FF_PROFILE_DNXHD 0 ++#define FF_PROFILE_DNXHR_LB 1 ++#define FF_PROFILE_DNXHR_SQ 2 ++#define FF_PROFILE_DNXHR_HQ 3 ++#define FF_PROFILE_DNXHR_HQX 4 ++#define FF_PROFILE_DNXHR_444 5 ++ ++#define FF_PROFILE_DTS 20 ++#define FF_PROFILE_DTS_ES 30 ++#define FF_PROFILE_DTS_96_24 40 ++#define FF_PROFILE_DTS_HD_HRA 50 ++#define FF_PROFILE_DTS_HD_MA 60 ++#define FF_PROFILE_DTS_EXPRESS 70 ++ ++#define FF_PROFILE_MPEG2_422 0 ++#define FF_PROFILE_MPEG2_HIGH 1 ++#define FF_PROFILE_MPEG2_SS 2 ++#define FF_PROFILE_MPEG2_SNR_SCALABLE 3 ++#define FF_PROFILE_MPEG2_MAIN 4 ++#define FF_PROFILE_MPEG2_SIMPLE 5 ++ ++#define FF_PROFILE_H264_CONSTRAINED (1 << 9) // 8+1; constraint_set1_flag ++#define FF_PROFILE_H264_INTRA (1 << 11) // 8+3; constraint_set3_flag ++ ++#define FF_PROFILE_H264_BASELINE 66 ++#define FF_PROFILE_H264_CONSTRAINED_BASELINE (66 | FF_PROFILE_H264_CONSTRAINED) ++#define FF_PROFILE_H264_MAIN 77 ++#define FF_PROFILE_H264_EXTENDED 88 ++#define FF_PROFILE_H264_HIGH 100 ++#define FF_PROFILE_H264_HIGH_10 110 ++#define FF_PROFILE_H264_HIGH_10_INTRA (110 | FF_PROFILE_H264_INTRA) ++#define FF_PROFILE_H264_MULTIVIEW_HIGH 118 ++#define FF_PROFILE_H264_HIGH_422 122 ++#define FF_PROFILE_H264_HIGH_422_INTRA (122 | FF_PROFILE_H264_INTRA) ++#define FF_PROFILE_H264_STEREO_HIGH 128 ++#define FF_PROFILE_H264_HIGH_444 144 ++#define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244 ++#define FF_PROFILE_H264_HIGH_444_INTRA (244 | FF_PROFILE_H264_INTRA) ++#define FF_PROFILE_H264_CAVLC_444 44 ++ ++#define FF_PROFILE_VC1_SIMPLE 0 ++#define FF_PROFILE_VC1_MAIN 1 ++#define FF_PROFILE_VC1_COMPLEX 2 ++#define FF_PROFILE_VC1_ADVANCED 3 ++ ++#define FF_PROFILE_MPEG4_SIMPLE 0 ++#define FF_PROFILE_MPEG4_SIMPLE_SCALABLE 1 ++#define FF_PROFILE_MPEG4_CORE 2 ++#define FF_PROFILE_MPEG4_MAIN 3 ++#define FF_PROFILE_MPEG4_N_BIT 4 ++#define FF_PROFILE_MPEG4_SCALABLE_TEXTURE 5 ++#define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6 ++#define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7 ++#define FF_PROFILE_MPEG4_HYBRID 8 ++#define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME 9 ++#define FF_PROFILE_MPEG4_CORE_SCALABLE 10 ++#define FF_PROFILE_MPEG4_ADVANCED_CODING 11 ++#define FF_PROFILE_MPEG4_ADVANCED_CORE 12 ++#define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13 ++#define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14 ++#define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15 ++ ++#define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 1 ++#define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 2 ++#define FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 32768 ++#define FF_PROFILE_JPEG2000_DCINEMA_2K 3 ++#define FF_PROFILE_JPEG2000_DCINEMA_4K 4 ++ ++#define FF_PROFILE_VP9_0 0 ++#define FF_PROFILE_VP9_1 1 ++#define FF_PROFILE_VP9_2 2 ++#define FF_PROFILE_VP9_3 3 ++ ++#define FF_PROFILE_HEVC_MAIN 1 ++#define FF_PROFILE_HEVC_MAIN_10 2 ++#define FF_PROFILE_HEVC_MAIN_STILL_PICTURE 3 ++#define FF_PROFILE_HEVC_REXT 4 ++ ++#define FF_PROFILE_VVC_MAIN_10 1 ++#define FF_PROFILE_VVC_MAIN_10_444 33 ++ ++#define FF_PROFILE_AV1_MAIN 0 ++#define FF_PROFILE_AV1_HIGH 1 ++#define FF_PROFILE_AV1_PROFESSIONAL 2 ++ ++#define FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT 0xc0 ++#define FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT 0xc1 ++#define FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT 0xc2 ++#define FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS 0xc3 ++#define FF_PROFILE_MJPEG_JPEG_LS 0xf7 ++ ++#define FF_PROFILE_SBC_MSBC 1 ++ ++#define FF_PROFILE_PRORES_PROXY 0 ++#define FF_PROFILE_PRORES_LT 1 ++#define FF_PROFILE_PRORES_STANDARD 2 ++#define FF_PROFILE_PRORES_HQ 3 ++#define FF_PROFILE_PRORES_4444 4 ++#define FF_PROFILE_PRORES_XQ 5 ++ ++#define FF_PROFILE_ARIB_PROFILE_A 0 ++#define FF_PROFILE_ARIB_PROFILE_C 1 ++ ++#define FF_PROFILE_KLVA_SYNC 0 ++#define FF_PROFILE_KLVA_ASYNC 1 ++ ++ /** ++ * level ++ * - encoding: Set by user. ++ * - decoding: Set by libavcodec. ++ */ ++ int level; ++#define FF_LEVEL_UNKNOWN -99 ++ ++ /** ++ * Skip loop filtering for selected frames. ++ * - encoding: unused ++ * - decoding: Set by user. ++ */ ++ enum AVDiscard skip_loop_filter; ++ ++ /** ++ * Skip IDCT/dequantization for selected frames. ++ * - encoding: unused ++ * - decoding: Set by user. ++ */ ++ enum AVDiscard skip_idct; ++ ++ /** ++ * Skip decoding for selected frames. ++ * - encoding: unused ++ * - decoding: Set by user. ++ */ ++ enum AVDiscard skip_frame; ++ ++ /** ++ * Header containing style information for text subtitles. ++ * For SUBTITLE_ASS subtitle type, it should contain the whole ASS ++ * [Script Info] and [V4+ Styles] section, plus the [Events] line and ++ * the Format line following. It shouldn't include any Dialogue line. ++ * - encoding: Set/allocated/freed by user (before avcodec_open2()) ++ * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) ++ */ ++ uint8_t* subtitle_header; ++ int subtitle_header_size; ++ ++ /** ++ * Audio only. The number of "priming" samples (padding) inserted by the ++ * encoder at the beginning of the audio. I.e. this number of leading ++ * decoded samples must be discarded by the caller to get the original audio ++ * without leading padding. ++ * ++ * - decoding: unused ++ * - encoding: Set by libavcodec. The timestamps on the output packets are ++ * adjusted by the encoder so that they always refer to the ++ * first sample of the data actually contained in the packet, ++ * including any added padding. E.g. if the timebase is ++ * 1/samplerate and the timestamp of the first input sample is ++ * 0, the timestamp of the first output packet will be ++ * -initial_padding. ++ */ ++ int initial_padding; ++ ++ /** ++ * - decoding: For codecs that store a framerate value in the compressed ++ * bitstream, the decoder may export it here. { 0, 1} when ++ * unknown. ++ * - encoding: May be used to signal the framerate of CFR content to an ++ * encoder. ++ */ ++ AVRational framerate; ++ ++ /** ++ * Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx. ++ * - encoding: unused. ++ * - decoding: Set by libavcodec before calling get_format() ++ */ ++ enum AVPixelFormat sw_pix_fmt; ++ ++ /** ++ * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. ++ * - encoding unused. ++ * - decoding set by user. ++ */ ++ AVRational pkt_timebase; ++ ++ /** ++ * AVCodecDescriptor ++ * - encoding: unused. ++ * - decoding: set by libavcodec. ++ */ ++ const AVCodecDescriptor* codec_descriptor; ++ ++ /** ++ * Current statistics for PTS correction. ++ * - decoding: maintained and used by libavcodec, not intended to be used by ++ * user apps ++ * - encoding: unused ++ */ ++ int64_t ++ pts_correction_num_faulty_pts; /// Number of incorrect PTS values so far ++ int64_t ++ pts_correction_num_faulty_dts; /// Number of incorrect DTS values so far ++ int64_t pts_correction_last_pts; /// PTS of the last frame ++ int64_t pts_correction_last_dts; /// DTS of the last frame ++ ++ /** ++ * Character encoding of the input subtitles file. ++ * - decoding: set by user ++ * - encoding: unused ++ */ ++ char* sub_charenc; ++ ++ /** ++ * Subtitles character encoding mode. Formats or codecs might be adjusting ++ * this setting (if they are doing the conversion themselves for instance). ++ * - decoding: set by libavcodec ++ * - encoding: unused ++ */ ++ int sub_charenc_mode; ++#define FF_SUB_CHARENC_MODE_DO_NOTHING \ ++ -1 ///< do nothing (demuxer outputs a stream supposed to be already in UTF-8, ++ ///< or the codec is bitmap for instance) ++#define FF_SUB_CHARENC_MODE_AUTOMATIC \ ++ 0 ///< libavcodec will select the mode itself ++#define FF_SUB_CHARENC_MODE_PRE_DECODER \ ++ 1 ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the ++ ///< decoder, requires iconv ++#define FF_SUB_CHARENC_MODE_IGNORE \ ++ 2 ///< neither convert the subtitles, nor check them for valid UTF-8 ++ ++ /** ++ * Skip processing alpha if supported by codec. ++ * Note that if the format uses pre-multiplied alpha (common with VP6, ++ * and recommended due to better video quality/compression) ++ * the image will look as if alpha-blended onto a black background. ++ * However for formats that do not use pre-multiplied alpha ++ * there might be serious artefacts (though e.g. libswscale currently ++ * assumes pre-multiplied alpha anyway). ++ * ++ * - decoding: set by user ++ * - encoding: unused ++ */ ++ int skip_alpha; ++ ++ /** ++ * Number of samples to skip after a discontinuity ++ * - decoding: unused ++ * - encoding: set by libavcodec ++ */ ++ int seek_preroll; ++ ++#if FF_API_DEBUG_MV ++ /** ++ * @deprecated unused ++ */ ++ attribute_deprecated int debug_mv; ++# define FF_DEBUG_VIS_MV_P_FOR \ ++ 0x00000001 // visualize forward predicted MVs of P frames ++# define FF_DEBUG_VIS_MV_B_FOR \ ++ 0x00000002 // visualize forward predicted MVs of B frames ++# define FF_DEBUG_VIS_MV_B_BACK \ ++ 0x00000004 // visualize backward predicted MVs of B frames ++#endif ++ ++ /** ++ * custom intra quantization matrix ++ * - encoding: Set by user, can be NULL. ++ * - decoding: unused. ++ */ ++ uint16_t* chroma_intra_matrix; ++ ++ /** ++ * dump format separator. ++ * can be ", " or "\n " or anything else ++ * - encoding: Set by user. ++ * - decoding: Set by user. ++ */ ++ uint8_t* dump_separator; ++ ++ /** ++ * ',' separated list of allowed decoders. ++ * If NULL then all are allowed ++ * - encoding: unused ++ * - decoding: set by user ++ */ ++ char* codec_whitelist; ++ ++ /** ++ * Properties of the stream that gets decoded ++ * - encoding: unused ++ * - decoding: set by libavcodec ++ */ ++ unsigned properties; ++#define FF_CODEC_PROPERTY_LOSSLESS 0x00000001 ++#define FF_CODEC_PROPERTY_CLOSED_CAPTIONS 0x00000002 ++#define FF_CODEC_PROPERTY_FILM_GRAIN 0x00000004 ++ ++ /** ++ * Additional data associated with the entire coded stream. ++ * ++ * - decoding: unused ++ * - encoding: may be set by libavcodec after avcodec_open2(). ++ */ ++ AVPacketSideData* coded_side_data; ++ int nb_coded_side_data; ++ ++ /** ++ * A reference to the AVHWFramesContext describing the input (for encoding) ++ * or output (decoding) frames. The reference is set by the caller and ++ * afterwards owned (and freed) by libavcodec - it should never be read by ++ * the caller after being set. ++ * ++ * - decoding: This field should be set by the caller from the get_format() ++ * callback. The previous reference (if any) will always be ++ * unreffed by libavcodec before the get_format() call. ++ * ++ * If the default get_buffer2() is used with a hwaccel pixel ++ * format, then this AVHWFramesContext will be used for ++ * allocating the frame buffers. ++ * ++ * - encoding: For hardware encoders configured to use a hwaccel pixel ++ * format, this field should be set by the caller to a reference ++ * to the AVHWFramesContext describing input frames. ++ * AVHWFramesContext.format must be equal to ++ * AVCodecContext.pix_fmt. ++ * ++ * This field should be set before avcodec_open2() is called. ++ */ ++ AVBufferRef* hw_frames_ctx; ++ ++#if FF_API_SUB_TEXT_FORMAT ++ /** ++ * @deprecated unused ++ */ ++ attribute_deprecated int sub_text_format; ++# define FF_SUB_TEXT_FMT_ASS 0 ++#endif ++ ++ /** ++ * Audio only. The amount of padding (in samples) appended by the encoder to ++ * the end of the audio. I.e. this number of decoded samples must be ++ * discarded by the caller from the end of the stream to get the original ++ * audio without any trailing padding. ++ * ++ * - decoding: unused ++ * - encoding: unused ++ */ ++ int trailing_padding; ++ ++ /** ++ * The number of pixels per image to maximally accept. ++ * ++ * - decoding: set by user ++ * - encoding: set by user ++ */ ++ int64_t max_pixels; ++ ++ /** ++ * A reference to the AVHWDeviceContext describing the device which will ++ * be used by a hardware encoder/decoder. The reference is set by the ++ * caller and afterwards owned (and freed) by libavcodec. ++ * ++ * This should be used if either the codec device does not require ++ * hardware frames or any that are used are to be allocated internally by ++ * libavcodec. If the user wishes to supply any of the frames used as ++ * encoder input or decoder output then hw_frames_ctx should be used ++ * instead. When hw_frames_ctx is set in get_format() for a decoder, this ++ * field will be ignored while decoding the associated stream segment, but ++ * may again be used on a following one after another get_format() call. ++ * ++ * For both encoders and decoders this field should be set before ++ * avcodec_open2() is called and must not be written to thereafter. ++ * ++ * Note that some decoders may require this field to be set initially in ++ * order to support hw_frames_ctx at all - in that case, all frames ++ * contexts used must be created on the same device. ++ */ ++ AVBufferRef* hw_device_ctx; ++ ++ /** ++ * Bit set of AV_HWACCEL_FLAG_* flags, which affect hardware accelerated ++ * decoding (if active). ++ * - encoding: unused ++ * - decoding: Set by user (either before avcodec_open2(), or in the ++ * AVCodecContext.get_format callback) ++ */ ++ int hwaccel_flags; ++ ++ /** ++ * Video decoding only. Certain video codecs support cropping, meaning that ++ * only a sub-rectangle of the decoded frame is intended for display. This ++ * option controls how cropping is handled by libavcodec. ++ * ++ * When set to 1 (the default), libavcodec will apply cropping internally. ++ * I.e. it will modify the output frame width/height fields and offset the ++ * data pointers (only by as much as possible while preserving alignment, or ++ * by the full amount if the AV_CODEC_FLAG_UNALIGNED flag is set) so that ++ * the frames output by the decoder refer only to the cropped area. The ++ * crop_* fields of the output frames will be zero. ++ * ++ * When set to 0, the width/height fields of the output frames will be set ++ * to the coded dimensions and the crop_* fields will describe the cropping ++ * rectangle. Applying the cropping is left to the caller. ++ * ++ * @warning When hardware acceleration with opaque output frames is used, ++ * libavcodec is unable to apply cropping from the top/left border. ++ * ++ * @note when this option is set to zero, the width/height fields of the ++ * AVCodecContext and output AVFrames have different meanings. The codec ++ * context fields store display dimensions (with the coded dimensions in ++ * coded_width/height), while the frame fields store the coded dimensions ++ * (with the display dimensions being determined by the crop_* fields). ++ */ ++ int apply_cropping; ++ ++ /* ++ * Video decoding only. Sets the number of extra hardware frames which ++ * the decoder will allocate for use by the caller. This must be set ++ * before avcodec_open2() is called. ++ * ++ * Some hardware decoders require all frames that they will use for ++ * output to be defined in advance before decoding starts. For such ++ * decoders, the hardware frame pool must therefore be of a fixed size. ++ * The extra frames set here are on top of any number that the decoder ++ * needs internally in order to operate normally (for example, frames ++ * used as reference pictures). ++ */ ++ int extra_hw_frames; ++ ++ /** ++ * The percentage of damaged samples to discard a frame. ++ * ++ * - decoding: set by user ++ * - encoding: unused ++ */ ++ int discard_damaged_percentage; ++ ++ /** ++ * The number of samples per frame to maximally accept. ++ * ++ * - decoding: set by user ++ * - encoding: set by user ++ */ ++ int64_t max_samples; ++ ++ /** ++ * Bit set of AV_CODEC_EXPORT_DATA_* flags, which affects the kind of ++ * metadata exported in frame, packet, or coded stream side data by ++ * decoders and encoders. ++ * ++ * - decoding: set by user ++ * - encoding: set by user ++ */ ++ int export_side_data; ++ ++ /** ++ * This callback is called at the beginning of each packet to get a data ++ * buffer for it. ++ * ++ * The following field will be set in the packet before this callback is ++ * called: ++ * - size ++ * This callback must use the above value to calculate the required buffer ++ * size, which must padded by at least AV_INPUT_BUFFER_PADDING_SIZE bytes. ++ * ++ * In some specific cases, the encoder may not use the entire buffer allocated ++ * by this callback. This will be reflected in the size value in the packet ++ * once returned by avcodec_receive_packet(). ++ * ++ * This callback must fill the following fields in the packet: ++ * - data: alignment requirements for AVPacket apply, if any. Some ++ * architectures and encoders may benefit from having aligned data. ++ * - buf: must contain a pointer to an AVBufferRef structure. The packet's ++ * data pointer must be contained in it. See: av_buffer_create(), ++ * av_buffer_alloc(), and av_buffer_ref(). ++ * ++ * If AV_CODEC_CAP_DR1 is not set then get_encode_buffer() must call ++ * avcodec_default_get_encode_buffer() instead of providing a buffer allocated ++ * by some other means. ++ * ++ * The flags field may contain a combination of AV_GET_ENCODE_BUFFER_FLAG_ ++ * flags. They may be used for example to hint what use the buffer may get ++ * after being created. Implementations of this callback may ignore flags they ++ * don't understand. If AV_GET_ENCODE_BUFFER_FLAG_REF is set in flags then the ++ * packet may be reused (read and/or written to if it is writable) later by ++ * libavcodec. ++ * ++ * This callback must be thread-safe, as when frame threading is used, it may ++ * be called from multiple threads simultaneously. ++ * ++ * @see avcodec_default_get_encode_buffer() ++ * ++ * - encoding: Set by libavcodec, user can override. ++ * - decoding: unused ++ */ ++ int (*get_encode_buffer)(struct AVCodecContext* s, AVPacket* pkt, int flags); ++} AVCodecContext; ++ ++struct MpegEncContext; ++ ++/** ++ * @defgroup lavc_hwaccel AVHWAccel ++ * ++ * @note Nothing in this structure should be accessed by the user. At some ++ * point in future it will not be externally visible at all. ++ * ++ * @{ ++ */ ++typedef struct AVHWAccel { ++ /** ++ * Name of the hardware accelerated codec. ++ * The name is globally unique among encoders and among decoders (but an ++ * encoder and a decoder can share the same name). ++ */ ++ const char* name; ++ ++ /** ++ * Type of codec implemented by the hardware accelerator. ++ * ++ * See AVMEDIA_TYPE_xxx ++ */ ++ enum AVMediaType type; ++ ++ /** ++ * Codec implemented by the hardware accelerator. ++ * ++ * See AV_CODEC_ID_xxx ++ */ ++ enum AVCodecID id; ++ ++ /** ++ * Supported pixel format. ++ * ++ * Only hardware accelerated formats are supported here. ++ */ ++ enum AVPixelFormat pix_fmt; ++ ++ /** ++ * Hardware accelerated codec capabilities. ++ * see AV_HWACCEL_CODEC_CAP_* ++ */ ++ int capabilities; ++ ++ /***************************************************************** ++ * No fields below this line are part of the public API. They ++ * may not be used outside of libavcodec and can be changed and ++ * removed at will. ++ * New public fields should be added right above. ++ ***************************************************************** ++ */ ++ ++ /** ++ * Allocate a custom buffer ++ */ ++ int (*alloc_frame)(AVCodecContext* avctx, AVFrame* frame); ++ ++ /** ++ * Called at the beginning of each frame or field picture. ++ * ++ * Meaningful frame information (codec specific) is guaranteed to ++ * be parsed at this point. This function is mandatory. ++ * ++ * Note that buf can be NULL along with buf_size set to 0. ++ * Otherwise, this means the whole frame is available at this point. ++ * ++ * @param avctx the codec context ++ * @param buf the frame data buffer base ++ * @param buf_size the size of the frame in bytes ++ * @return zero if successful, a negative value otherwise ++ */ ++ int (*start_frame)(AVCodecContext* avctx, const uint8_t* buf, ++ uint32_t buf_size); ++ ++ /** ++ * Callback for parameter data (SPS/PPS/VPS etc). ++ * ++ * Useful for hardware decoders which keep persistent state about the ++ * video parameters, and need to receive any changes to update that state. ++ * ++ * @param avctx the codec context ++ * @param type the nal unit type ++ * @param buf the nal unit data buffer ++ * @param buf_size the size of the nal unit in bytes ++ * @return zero if successful, a negative value otherwise ++ */ ++ int (*decode_params)(AVCodecContext* avctx, int type, const uint8_t* buf, ++ uint32_t buf_size); ++ ++ /** ++ * Callback for each slice. ++ * ++ * Meaningful slice information (codec specific) is guaranteed to ++ * be parsed at this point. This function is mandatory. ++ * The only exception is XvMC, that works on MB level. ++ * ++ * @param avctx the codec context ++ * @param buf the slice data buffer base ++ * @param buf_size the size of the slice in bytes ++ * @return zero if successful, a negative value otherwise ++ */ ++ int (*decode_slice)(AVCodecContext* avctx, const uint8_t* buf, ++ uint32_t buf_size); ++ ++ /** ++ * Called at the end of each frame or field picture. ++ * ++ * The whole picture is parsed at this point and can now be sent ++ * to the hardware accelerator. This function is mandatory. ++ * ++ * @param avctx the codec context ++ * @return zero if successful, a negative value otherwise ++ */ ++ int (*end_frame)(AVCodecContext* avctx); ++ ++ /** ++ * Size of per-frame hardware accelerator private data. ++ * ++ * Private data is allocated with av_mallocz() before ++ * AVCodecContext.get_buffer() and deallocated after ++ * AVCodecContext.release_buffer(). ++ */ ++ int frame_priv_data_size; ++ ++ /** ++ * Called for every Macroblock in a slice. ++ * ++ * XvMC uses it to replace the ff_mpv_reconstruct_mb(). ++ * Instead of decoding to raw picture, MB parameters are ++ * stored in an array provided by the video driver. ++ * ++ * @param s the mpeg context ++ */ ++ void (*decode_mb)(struct MpegEncContext* s); ++ ++ /** ++ * Initialize the hwaccel private data. ++ * ++ * This will be called from ff_get_format(), after hwaccel and ++ * hwaccel_context are set and the hwaccel private data in AVCodecInternal ++ * is allocated. ++ */ ++ int (*init)(AVCodecContext* avctx); ++ ++ /** ++ * Uninitialize the hwaccel private data. ++ * ++ * This will be called from get_format() or avcodec_close(), after hwaccel ++ * and hwaccel_context are already uninitialized. ++ */ ++ int (*uninit)(AVCodecContext* avctx); ++ ++ /** ++ * Size of the private data to allocate in ++ * AVCodecInternal.hwaccel_priv_data. ++ */ ++ int priv_data_size; ++ ++ /** ++ * Internal hwaccel capabilities. ++ */ ++ int caps_internal; ++ ++ /** ++ * Fill the given hw_frames context with current codec parameters. Called ++ * from get_format. Refer to avcodec_get_hw_frames_parameters() for ++ * details. ++ * ++ * This CAN be called before AVHWAccel.init is called, and you must assume ++ * that avctx->hwaccel_priv_data is invalid. ++ */ ++ int (*frame_params)(AVCodecContext* avctx, AVBufferRef* hw_frames_ctx); ++} AVHWAccel; ++ ++/** ++ * HWAccel is experimental and is thus avoided in favor of non experimental ++ * codecs ++ */ ++#define AV_HWACCEL_CODEC_CAP_EXPERIMENTAL 0x0200 ++ ++/** ++ * Hardware acceleration should be used for decoding even if the codec level ++ * used is unknown or higher than the maximum supported level reported by the ++ * hardware driver. ++ * ++ * It's generally a good idea to pass this flag unless you have a specific ++ * reason not to, as hardware tends to under-report supported levels. ++ */ ++#define AV_HWACCEL_FLAG_IGNORE_LEVEL (1 << 0) ++ ++/** ++ * Hardware acceleration can output YUV pixel formats with a different chroma ++ * sampling than 4:2:0 and/or other than 8 bits per component. ++ */ ++#define AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH (1 << 1) ++ ++/** ++ * Hardware acceleration should still be attempted for decoding when the ++ * codec profile does not match the reported capabilities of the hardware. ++ * ++ * For example, this can be used to try to decode baseline profile H.264 ++ * streams in hardware - it will often succeed, because many streams marked ++ * as baseline profile actually conform to constrained baseline profile. ++ * ++ * @warning If the stream is actually not supported then the behaviour is ++ * undefined, and may include returning entirely incorrect output ++ * while indicating success. ++ */ ++#define AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH (1 << 2) ++ ++/** ++ * @} ++ */ ++ ++enum AVSubtitleType { ++ SUBTITLE_NONE, ++ ++ SUBTITLE_BITMAP, ///< A bitmap, pict will be set ++ ++ /** ++ * Plain text, the text field must be set by the decoder and is ++ * authoritative. ass and pict fields may contain approximations. ++ */ ++ SUBTITLE_TEXT, ++ ++ /** ++ * Formatted text, the ass field must be set by the decoder and is ++ * authoritative. pict and text fields may contain approximations. ++ */ ++ SUBTITLE_ASS, ++}; ++ ++#define AV_SUBTITLE_FLAG_FORCED 0x00000001 ++ ++typedef struct AVSubtitleRect { ++ int x; ///< top left corner of pict, undefined when pict is not set ++ int y; ///< top left corner of pict, undefined when pict is not set ++ int w; ///< width of pict, undefined when pict is not set ++ int h; ///< height of pict, undefined when pict is not set ++ int nb_colors; ///< number of colors in pict, undefined when pict is not set ++ ++ /** ++ * data+linesize for the bitmap of this subtitle. ++ * Can be set for text/ass as well once they are rendered. ++ */ ++ uint8_t* data[4]; ++ int linesize[4]; ++ ++ enum AVSubtitleType type; ++ ++ char* text; ///< 0 terminated plain UTF-8 text ++ ++ /** ++ * 0 terminated ASS/SSA compatible event line. ++ * The presentation of this is unaffected by the other values in this ++ * struct. ++ */ ++ char* ass; ++ ++ int flags; ++} AVSubtitleRect; ++ ++typedef struct AVSubtitle { ++ uint16_t format; /* 0 = graphics */ ++ uint32_t start_display_time; /* relative to packet pts, in ms */ ++ uint32_t end_display_time; /* relative to packet pts, in ms */ ++ unsigned num_rects; ++ AVSubtitleRect** rects; ++ int64_t pts; ///< Same as packet pts, in AV_TIME_BASE ++} AVSubtitle; ++ ++/** ++ * Return the LIBAVCODEC_VERSION_INT constant. ++ */ ++unsigned avcodec_version(void); ++ ++/** ++ * Return the libavcodec build-time configuration. ++ */ ++const char* avcodec_configuration(void); ++ ++/** ++ * Return the libavcodec license. ++ */ ++const char* avcodec_license(void); ++ ++/** ++ * Allocate an AVCodecContext and set its fields to default values. The ++ * resulting struct should be freed with avcodec_free_context(). ++ * ++ * @param codec if non-NULL, allocate private data and initialize defaults ++ * for the given codec. It is illegal to then call avcodec_open2() ++ * with a different codec. ++ * If NULL, then the codec-specific defaults won't be initialized, ++ * which may result in suboptimal default settings (this is ++ * important mainly for encoders, e.g. libx264). ++ * ++ * @return An AVCodecContext filled with default values or NULL on failure. ++ */ ++AVCodecContext* avcodec_alloc_context3(const AVCodec* codec); ++ ++/** ++ * Free the codec context and everything associated with it and write NULL to ++ * the provided pointer. ++ */ ++void avcodec_free_context(AVCodecContext** avctx); ++ ++/** ++ * Get the AVClass for AVCodecContext. It can be used in combination with ++ * AV_OPT_SEARCH_FAKE_OBJ for examining options. ++ * ++ * @see av_opt_find(). ++ */ ++const AVClass* avcodec_get_class(void); ++ ++#if FF_API_GET_FRAME_CLASS ++/** ++ * @deprecated This function should not be used. ++ */ ++attribute_deprecated const AVClass* avcodec_get_frame_class(void); ++#endif ++ ++/** ++ * Get the AVClass for AVSubtitleRect. It can be used in combination with ++ * AV_OPT_SEARCH_FAKE_OBJ for examining options. ++ * ++ * @see av_opt_find(). ++ */ ++const AVClass* avcodec_get_subtitle_rect_class(void); ++ ++/** ++ * Fill the parameters struct based on the values from the supplied codec ++ * context. Any allocated fields in par are freed and replaced with duplicates ++ * of the corresponding fields in codec. ++ * ++ * @return >= 0 on success, a negative AVERROR code on failure ++ */ ++int avcodec_parameters_from_context(AVCodecParameters* par, ++ const AVCodecContext* codec); ++ ++/** ++ * Fill the codec context based on the values from the supplied codec ++ * parameters. Any allocated fields in codec that have a corresponding field in ++ * par are freed and replaced with duplicates of the corresponding field in par. ++ * Fields in codec that do not have a counterpart in par are not touched. ++ * ++ * @return >= 0 on success, a negative AVERROR code on failure. ++ */ ++int avcodec_parameters_to_context(AVCodecContext* codec, ++ const AVCodecParameters* par); ++ ++/** ++ * Initialize the AVCodecContext to use the given AVCodec. Prior to using this ++ * function the context has to be allocated with avcodec_alloc_context3(). ++ * ++ * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), ++ * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for ++ * retrieving a codec. ++ * ++ * @warning This function is not thread safe! ++ * ++ * @note Always call this function before using decoding routines (such as ++ * @ref avcodec_receive_frame()). ++ * ++ * @code ++ * av_dict_set(&opts, "b", "2.5M", 0); ++ * codec = avcodec_find_decoder(AV_CODEC_ID_H264); ++ * if (!codec) ++ * exit(1); ++ * ++ * context = avcodec_alloc_context3(codec); ++ * ++ * if (avcodec_open2(context, codec, opts) < 0) ++ * exit(1); ++ * @endcode ++ * ++ * @param avctx The context to initialize. ++ * @param codec The codec to open this context for. If a non-NULL codec has been ++ * previously passed to avcodec_alloc_context3() or ++ * for this context, then this parameter MUST be either NULL or ++ * equal to the previously passed codec. ++ * @param options A dictionary filled with AVCodecContext and codec-private ++ * options. On return this object will be filled with options that were not ++ * found. ++ * ++ * @return zero on success, a negative value on error ++ * @see avcodec_alloc_context3(), avcodec_find_decoder(), ++ * avcodec_find_encoder(), av_dict_set(), av_opt_find(). ++ */ ++int avcodec_open2(AVCodecContext* avctx, const AVCodec* codec, ++ AVDictionary** options); ++ ++/** ++ * Close a given AVCodecContext and free all the data associated with it ++ * (but not the AVCodecContext itself). ++ * ++ * Calling this function on an AVCodecContext that hasn't been opened will free ++ * the codec-specific data allocated in avcodec_alloc_context3() with a non-NULL ++ * codec. Subsequent calls will do nothing. ++ * ++ * @note Do not use this function. Use avcodec_free_context() to destroy a ++ * codec context (either open or closed). Opening and closing a codec context ++ * multiple times is not supported anymore -- use multiple codec contexts ++ * instead. ++ */ ++int avcodec_close(AVCodecContext* avctx); ++ ++/** ++ * Free all allocated data in the given subtitle struct. ++ * ++ * @param sub AVSubtitle to free. ++ */ ++void avsubtitle_free(AVSubtitle* sub); ++ ++/** ++ * @} ++ */ ++ ++/** ++ * @addtogroup lavc_decoding ++ * @{ ++ */ ++ ++/** ++ * The default callback for AVCodecContext.get_buffer2(). It is made public so ++ * it can be called by custom get_buffer2() implementations for decoders without ++ * AV_CODEC_CAP_DR1 set. ++ */ ++int avcodec_default_get_buffer2(AVCodecContext* s, AVFrame* frame, int flags); ++ ++/** ++ * The default callback for AVCodecContext.get_encode_buffer(). It is made ++ * public so it can be called by custom get_encode_buffer() implementations for ++ * encoders without AV_CODEC_CAP_DR1 set. ++ */ ++int avcodec_default_get_encode_buffer(AVCodecContext* s, AVPacket* pkt, ++ int flags); ++ ++/** ++ * Modify width and height values so that they will result in a memory ++ * buffer that is acceptable for the codec if you do not use any horizontal ++ * padding. ++ * ++ * May only be used if a codec with AV_CODEC_CAP_DR1 has been opened. ++ */ ++void avcodec_align_dimensions(AVCodecContext* s, int* width, int* height); ++ ++/** ++ * Modify width and height values so that they will result in a memory ++ * buffer that is acceptable for the codec if you also ensure that all ++ * line sizes are a multiple of the respective linesize_align[i]. ++ * ++ * May only be used if a codec with AV_CODEC_CAP_DR1 has been opened. ++ */ ++void avcodec_align_dimensions2(AVCodecContext* s, int* width, int* height, ++ int linesize_align[AV_NUM_DATA_POINTERS]); ++ ++/** ++ * Converts AVChromaLocation to swscale x/y chroma position. ++ * ++ * The positions represent the chroma (0,0) position in a coordinates system ++ * with luma (0,0) representing the origin and luma(1,1) representing 256,256 ++ * ++ * @param xpos horizontal chroma sample position ++ * @param ypos vertical chroma sample position ++ */ ++int avcodec_enum_to_chroma_pos(int* xpos, int* ypos, enum AVChromaLocation pos); ++ ++/** ++ * Converts swscale x/y chroma position to AVChromaLocation. ++ * ++ * The positions represent the chroma (0,0) position in a coordinates system ++ * with luma (0,0) representing the origin and luma(1,1) representing 256,256 ++ * ++ * @param xpos horizontal chroma sample position ++ * @param ypos vertical chroma sample position ++ */ ++enum AVChromaLocation avcodec_chroma_pos_to_enum(int xpos, int ypos); ++ ++/** ++ * Decode a subtitle message. ++ * Return a negative value on error, otherwise return the number of bytes used. ++ * If no subtitle could be decompressed, got_sub_ptr is zero. ++ * Otherwise, the subtitle is stored in *sub. ++ * Note that AV_CODEC_CAP_DR1 is not available for subtitle codecs. This is for ++ * simplicity, because the performance difference is expected to be negligible ++ * and reusing a get_buffer written for video codecs would probably perform ++ * badly due to a potentially very different allocation pattern. ++ * ++ * Some decoders (those marked with AV_CODEC_CAP_DELAY) have a delay between ++ * input and output. This means that for some packets they will not immediately ++ * produce decoded output and need to be flushed at the end of decoding to get ++ * all the decoded data. Flushing is done by calling this function with packets ++ * with avpkt->data set to NULL and avpkt->size set to 0 until it stops ++ * returning subtitles. It is safe to flush even those decoders that are not ++ * marked with AV_CODEC_CAP_DELAY, then no subtitles will be returned. ++ * ++ * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() ++ * before packets may be fed to the decoder. ++ * ++ * @param avctx the codec context ++ * @param[out] sub The preallocated AVSubtitle in which the decoded subtitle ++ * will be stored, must be freed with avsubtitle_free if *got_sub_ptr is set. ++ * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, ++ * otherwise, it is nonzero. ++ * @param[in] avpkt The input AVPacket containing the input buffer. ++ */ ++int avcodec_decode_subtitle2(AVCodecContext* avctx, AVSubtitle* sub, ++ int* got_sub_ptr, AVPacket* avpkt); ++ ++/** ++ * Supply raw packet data as input to a decoder. ++ * ++ * Internally, this call will copy relevant AVCodecContext fields, which can ++ * influence decoding per-packet, and apply them when the packet is actually ++ * decoded. (For example AVCodecContext.skip_frame, which might direct the ++ * decoder to drop the frame contained by the packet sent with this function.) ++ * ++ * @warning The input buffer, avpkt->data must be AV_INPUT_BUFFER_PADDING_SIZE ++ * larger than the actual read bytes because some optimized bitstream ++ * readers read 32 or 64 bits at once and could read over the end. ++ * ++ * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() ++ * before packets may be fed to the decoder. ++ * ++ * @param avctx codec context ++ * @param[in] avpkt The input AVPacket. Usually, this will be a single video ++ * frame, or several complete audio frames. ++ * Ownership of the packet remains with the caller, and the ++ * decoder will not write to the packet. The decoder may create ++ * a reference to the packet data (or copy it if the packet is ++ * not reference-counted). ++ * Unlike with older APIs, the packet is always fully consumed, ++ * and if it contains multiple frames (e.g. some audio codecs), ++ * will require you to call avcodec_receive_frame() multiple ++ * times afterwards before you can send a new packet. ++ * It can be NULL (or an AVPacket with data set to NULL and ++ * size set to 0); in this case, it is considered a flush ++ * packet, which signals the end of the stream. Sending the ++ * first flush packet will return success. Subsequent ones are ++ * unnecessary and will return AVERROR_EOF. If the decoder ++ * still has frames buffered, it will return them after sending ++ * a flush packet. ++ * ++ * @return 0 on success, otherwise negative error code: ++ * AVERROR(EAGAIN): input is not accepted in the current state - user ++ * must read output with avcodec_receive_frame() (once ++ * all output is read, the packet should be resent, and ++ * the call will not fail with EAGAIN). ++ * AVERROR_EOF: the decoder has been flushed, and no new packets can ++ * be sent to it (also returned if more than 1 flush ++ * packet is sent) ++ * AVERROR(EINVAL): codec not opened, it is an encoder, or requires flush ++ * AVERROR(ENOMEM): failed to add packet to internal queue, or similar ++ * other errors: legitimate decoding errors ++ */ ++int avcodec_send_packet(AVCodecContext* avctx, const AVPacket* avpkt); ++ ++/** ++ * Return decoded output data from a decoder. ++ * ++ * @param avctx codec context ++ * @param frame This will be set to a reference-counted video or audio ++ * frame (depending on the decoder type) allocated by the ++ * decoder. Note that the function will always call ++ * av_frame_unref(frame) before doing anything else. ++ * ++ * @return ++ * 0: success, a frame was returned ++ * AVERROR(EAGAIN): output is not available in this state - user must try ++ * to send new input ++ * AVERROR_EOF: the decoder has been fully flushed, and there will be ++ * no more output frames ++ * AVERROR(EINVAL): codec not opened, or it is an encoder ++ * AVERROR_INPUT_CHANGED: current decoded frame has changed parameters ++ * with respect to first decoded frame. Applicable ++ * when flag AV_CODEC_FLAG_DROPCHANGED is set. ++ * other negative values: legitimate decoding errors ++ */ ++int avcodec_receive_frame(AVCodecContext* avctx, AVFrame* frame); ++ ++/** ++ * Supply a raw video or audio frame to the encoder. Use ++ * avcodec_receive_packet() to retrieve buffered output packets. ++ * ++ * @param avctx codec context ++ * @param[in] frame AVFrame containing the raw audio or video frame to be ++ * encoded. Ownership of the frame remains with the caller, and the encoder will ++ * not write to the frame. The encoder may create a reference to the frame data ++ * (or copy it if the frame is not reference-counted). It can be NULL, in which ++ * case it is considered a flush packet. This signals the end of the stream. If ++ * the encoder still has packets buffered, it will return them after this call. ++ * Once flushing mode has been entered, additional flush packets are ignored, ++ * and sending frames will return AVERROR_EOF. ++ * ++ * For audio: ++ * If AV_CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame ++ * can have any number of samples. ++ * If it is not set, frame->nb_samples must be equal to ++ * avctx->frame_size for all frames except the last. ++ * The final frame may be smaller than avctx->frame_size. ++ * @return 0 on success, otherwise negative error code: ++ * AVERROR(EAGAIN): input is not accepted in the current state - user ++ * must read output with avcodec_receive_packet() (once ++ * all output is read, the packet should be resent, and ++ * the call will not fail with EAGAIN). ++ * AVERROR_EOF: the encoder has been flushed, and no new frames can ++ * be sent to it ++ * AVERROR(EINVAL): codec not opened, it is a decoder, or requires flush ++ * AVERROR(ENOMEM): failed to add packet to internal queue, or similar ++ * other errors: legitimate encoding errors ++ */ ++int avcodec_send_frame(AVCodecContext* avctx, const AVFrame* frame); ++ ++/** ++ * Read encoded data from the encoder. ++ * ++ * @param avctx codec context ++ * @param avpkt This will be set to a reference-counted packet allocated by the ++ * encoder. Note that the function will always call ++ * av_packet_unref(avpkt) before doing anything else. ++ * @return 0 on success, otherwise negative error code: ++ * AVERROR(EAGAIN): output is not available in the current state - user ++ * must try to send input ++ * AVERROR_EOF: the encoder has been fully flushed, and there will be ++ * no more output packets ++ * AVERROR(EINVAL): codec not opened, or it is a decoder ++ * other errors: legitimate encoding errors ++ */ ++int avcodec_receive_packet(AVCodecContext* avctx, AVPacket* avpkt); ++ ++/** ++ * Create and return a AVHWFramesContext with values adequate for hardware ++ * decoding. This is meant to get called from the get_format callback, and is ++ * a helper for preparing a AVHWFramesContext for AVCodecContext.hw_frames_ctx. ++ * This API is for decoding with certain hardware acceleration modes/APIs only. ++ * ++ * The returned AVHWFramesContext is not initialized. The caller must do this ++ * with av_hwframe_ctx_init(). ++ * ++ * Calling this function is not a requirement, but makes it simpler to avoid ++ * codec or hardware API specific details when manually allocating frames. ++ * ++ * Alternatively to this, an API user can set AVCodecContext.hw_device_ctx, ++ * which sets up AVCodecContext.hw_frames_ctx fully automatically, and makes ++ * it unnecessary to call this function or having to care about ++ * AVHWFramesContext initialization at all. ++ * ++ * There are a number of requirements for calling this function: ++ * ++ * - It must be called from get_format with the same avctx parameter that was ++ * passed to get_format. Calling it outside of get_format is not allowed, and ++ * can trigger undefined behavior. ++ * - The function is not always supported (see description of return values). ++ * Even if this function returns successfully, hwaccel initialization could ++ * fail later. (The degree to which implementations check whether the stream ++ * is actually supported varies. Some do this check only after the user's ++ * get_format callback returns.) ++ * - The hw_pix_fmt must be one of the choices suggested by get_format. If the ++ * user decides to use a AVHWFramesContext prepared with this API function, ++ * the user must return the same hw_pix_fmt from get_format. ++ * - The device_ref passed to this function must support the given hw_pix_fmt. ++ * - After calling this API function, it is the user's responsibility to ++ * initialize the AVHWFramesContext (returned by the out_frames_ref ++ * parameter), and to set AVCodecContext.hw_frames_ctx to it. If done, this must ++ * be done before returning from get_format (this is implied by the normal ++ * AVCodecContext.hw_frames_ctx API rules). ++ * - The AVHWFramesContext parameters may change every time time get_format is ++ * called. Also, AVCodecContext.hw_frames_ctx is reset before get_format. So ++ * you are inherently required to go through this process again on every ++ * get_format call. ++ * - It is perfectly possible to call this function without actually using ++ * the resulting AVHWFramesContext. One use-case might be trying to reuse a ++ * previously initialized AVHWFramesContext, and calling this API function ++ * only to test whether the required frame parameters have changed. ++ * - Fields that use dynamically allocated values of any kind must not be set ++ * by the user unless setting them is explicitly allowed by the documentation. ++ * If the user sets AVHWFramesContext.free and AVHWFramesContext.user_opaque, ++ * the new free callback must call the potentially set previous free callback. ++ * This API call may set any dynamically allocated fields, including the free ++ * callback. ++ * ++ * The function will set at least the following fields on AVHWFramesContext ++ * (potentially more, depending on hwaccel API): ++ * ++ * - All fields set by av_hwframe_ctx_alloc(). ++ * - Set the format field to hw_pix_fmt. ++ * - Set the sw_format field to the most suited and most versatile format. (An ++ * implication is that this will prefer generic formats over opaque formats ++ * with arbitrary restrictions, if possible.) ++ * - Set the width/height fields to the coded frame size, rounded up to the ++ * API-specific minimum alignment. ++ * - Only _if_ the hwaccel requires a pre-allocated pool: set the ++ * initial_pool_size field to the number of maximum reference surfaces possible ++ * with the codec, plus 1 surface for the user to work (meaning the user can ++ * safely reference at most 1 decoded surface at a time), plus additional ++ * buffering introduced by frame threading. If the hwaccel does not require ++ * pre-allocation, the field is left to 0, and the decoder will allocate new ++ * surfaces on demand during decoding. ++ * - Possibly AVHWFramesContext.hwctx fields, depending on the underlying ++ * hardware API. ++ * ++ * Essentially, out_frames_ref returns the same as av_hwframe_ctx_alloc(), but ++ * with basic frame parameters set. ++ * ++ * The function is stateless, and does not change the AVCodecContext or the ++ * device_ref AVHWDeviceContext. ++ * ++ * @param avctx The context which is currently calling get_format, and which ++ * implicitly contains all state needed for filling the returned ++ * AVHWFramesContext properly. ++ * @param device_ref A reference to the AVHWDeviceContext describing the device ++ * which will be used by the hardware decoder. ++ * @param hw_pix_fmt The hwaccel format you are going to return from get_format. ++ * @param out_frames_ref On success, set to a reference to an _uninitialized_ ++ * AVHWFramesContext, created from the given device_ref. ++ * Fields will be set to values required for decoding. ++ * Not changed if an error is returned. ++ * @return zero on success, a negative value on error. The following error codes ++ * have special semantics: ++ * AVERROR(ENOENT): the decoder does not support this functionality. Setup ++ * is always manual, or it is a decoder which does not ++ * support setting AVCodecContext.hw_frames_ctx at all, ++ * or it is a software format. ++ * AVERROR(EINVAL): it is known that hardware decoding is not supported for ++ * this configuration, or the device_ref is not supported ++ * for the hwaccel referenced by hw_pix_fmt. ++ */ ++int avcodec_get_hw_frames_parameters(AVCodecContext* avctx, ++ AVBufferRef* device_ref, ++ enum AVPixelFormat hw_pix_fmt, ++ AVBufferRef** out_frames_ref); ++ ++/** ++ * @defgroup lavc_parsing Frame parsing ++ * @{ ++ */ ++ ++enum AVPictureStructure { ++ AV_PICTURE_STRUCTURE_UNKNOWN, //< unknown ++ AV_PICTURE_STRUCTURE_TOP_FIELD, //< coded as top field ++ AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field ++ AV_PICTURE_STRUCTURE_FRAME, //< coded as frame ++}; ++ ++typedef struct AVCodecParserContext { ++ void* priv_data; ++ const struct AVCodecParser* parser; ++ int64_t frame_offset; /* offset of the current frame */ ++ int64_t cur_offset; /* current offset ++ (incremented by each av_parser_parse()) */ ++ int64_t next_frame_offset; /* offset of the next frame */ ++ /* video info */ ++ int pict_type; /* XXX: Put it back in AVCodecContext. */ ++ /** ++ * This field is used for proper frame duration computation in lavf. ++ * It signals, how much longer the frame duration of the current frame ++ * is compared to normal frame duration. ++ * ++ * frame_duration = (1 + repeat_pict) * time_base ++ * ++ * It is used by codecs like H.264 to display telecined material. ++ */ ++ int repeat_pict; /* XXX: Put it back in AVCodecContext. */ ++ int64_t pts; /* pts of the current frame */ ++ int64_t dts; /* dts of the current frame */ ++ ++ /* private data */ ++ int64_t last_pts; ++ int64_t last_dts; ++ int fetch_timestamp; ++ ++#define AV_PARSER_PTS_NB 4 ++ int cur_frame_start_index; ++ int64_t cur_frame_offset[AV_PARSER_PTS_NB]; ++ int64_t cur_frame_pts[AV_PARSER_PTS_NB]; ++ int64_t cur_frame_dts[AV_PARSER_PTS_NB]; ++ ++ int flags; ++#define PARSER_FLAG_COMPLETE_FRAMES 0x0001 ++#define PARSER_FLAG_ONCE 0x0002 ++/// Set if the parser has a valid file offset ++#define PARSER_FLAG_FETCHED_OFFSET 0x0004 ++#define PARSER_FLAG_USE_CODEC_TS 0x1000 ++ ++ int64_t offset; ///< byte offset from starting packet start ++ int64_t cur_frame_end[AV_PARSER_PTS_NB]; ++ ++ /** ++ * Set by parser to 1 for key frames and 0 for non-key frames. ++ * It is initialized to -1, so if the parser doesn't set this flag, ++ * old-style fallback using AV_PICTURE_TYPE_I picture type as key frames ++ * will be used. ++ */ ++ int key_frame; ++ ++ // Timestamp generation support: ++ /** ++ * Synchronization point for start of timestamp generation. ++ * ++ * Set to >0 for sync point, 0 for no sync point and <0 for undefined ++ * (default). ++ * ++ * For example, this corresponds to presence of H.264 buffering period ++ * SEI message. ++ */ ++ int dts_sync_point; ++ ++ /** ++ * Offset of the current timestamp against last timestamp sync point in ++ * units of AVCodecContext.time_base. ++ * ++ * Set to INT_MIN when dts_sync_point unused. Otherwise, it must ++ * contain a valid timestamp offset. ++ * ++ * Note that the timestamp of sync point has usually a nonzero ++ * dts_ref_dts_delta, which refers to the previous sync point. Offset of ++ * the next frame after timestamp sync point will be usually 1. ++ * ++ * For example, this corresponds to H.264 cpb_removal_delay. ++ */ ++ int dts_ref_dts_delta; ++ ++ /** ++ * Presentation delay of current frame in units of AVCodecContext.time_base. ++ * ++ * Set to INT_MIN when dts_sync_point unused. Otherwise, it must ++ * contain valid non-negative timestamp delta (presentation time of a frame ++ * must not lie in the past). ++ * ++ * This delay represents the difference between decoding and presentation ++ * time of the frame. ++ * ++ * For example, this corresponds to H.264 dpb_output_delay. ++ */ ++ int pts_dts_delta; ++ ++ /** ++ * Position of the packet in file. ++ * ++ * Analogous to cur_frame_pts/dts ++ */ ++ int64_t cur_frame_pos[AV_PARSER_PTS_NB]; ++ ++ /** ++ * Byte position of currently parsed frame in stream. ++ */ ++ int64_t pos; ++ ++ /** ++ * Previous frame byte position. ++ */ ++ int64_t last_pos; ++ ++ /** ++ * Duration of the current frame. ++ * For audio, this is in units of 1 / AVCodecContext.sample_rate. ++ * For all other types, this is in units of AVCodecContext.time_base. ++ */ ++ int duration; ++ ++ enum AVFieldOrder field_order; ++ ++ /** ++ * Indicate whether a picture is coded as a frame, top field or bottom field. ++ * ++ * For example, H.264 field_pic_flag equal to 0 corresponds to ++ * AV_PICTURE_STRUCTURE_FRAME. An H.264 picture with field_pic_flag ++ * equal to 1 and bottom_field_flag equal to 0 corresponds to ++ * AV_PICTURE_STRUCTURE_TOP_FIELD. ++ */ ++ enum AVPictureStructure picture_structure; ++ ++ /** ++ * Picture number incremented in presentation or output order. ++ * This field may be reinitialized at the first picture of a new sequence. ++ * ++ * For example, this corresponds to H.264 PicOrderCnt. ++ */ ++ int output_picture_number; ++ ++ /** ++ * Dimensions of the decoded video intended for presentation. ++ */ ++ int width; ++ int height; ++ ++ /** ++ * Dimensions of the coded video. ++ */ ++ int coded_width; ++ int coded_height; ++ ++ /** ++ * The format of the coded data, corresponds to enum AVPixelFormat for video ++ * and for enum AVSampleFormat for audio. ++ * ++ * Note that a decoder can have considerable freedom in how exactly it ++ * decodes the data, so the format reported here might be different from the ++ * one returned by a decoder. ++ */ ++ int format; ++} AVCodecParserContext; ++ ++typedef struct AVCodecParser { ++ int codec_ids[7]; /* several codec IDs are permitted */ ++ int priv_data_size; ++ int (*parser_init)(AVCodecParserContext* s); ++ /* This callback never returns an error, a negative value means that ++ * the frame start was in a previous packet. */ ++ int (*parser_parse)(AVCodecParserContext* s, AVCodecContext* avctx, ++ const uint8_t** poutbuf, int* poutbuf_size, ++ const uint8_t* buf, int buf_size); ++ void (*parser_close)(AVCodecParserContext* s); ++ int (*split)(AVCodecContext* avctx, const uint8_t* buf, int buf_size); ++} AVCodecParser; ++ ++/** ++ * Iterate over all registered codec parsers. ++ * ++ * @param opaque a pointer where libavcodec will store the iteration state. Must ++ * point to NULL to start the iteration. ++ * ++ * @return the next registered codec parser or NULL when the iteration is ++ * finished ++ */ ++const AVCodecParser* av_parser_iterate(void** opaque); ++ ++AVCodecParserContext* av_parser_init(int codec_id); ++ ++/** ++ * Parse a packet. ++ * ++ * @param s parser context. ++ * @param avctx codec context. ++ * @param poutbuf set to pointer to parsed buffer or NULL if not yet ++ finished. ++ * @param poutbuf_size set to size of parsed buffer or zero if not yet ++ finished. ++ * @param buf input buffer. ++ * @param buf_size buffer size in bytes without the padding. I.e. the full ++ buffer size is assumed to be buf_size + AV_INPUT_BUFFER_PADDING_SIZE. To signal ++ EOF, this should be 0 (so that the last frame can be output). ++ * @param pts input presentation timestamp. ++ * @param dts input decoding timestamp. ++ * @param pos input byte position in stream. ++ * @return the number of bytes of the input bitstream used. ++ * ++ * Example: ++ * @code ++ * while(in_len){ ++ * len = av_parser_parse2(myparser, AVCodecContext, &data, &size, ++ * in_data, in_len, ++ * pts, dts, pos); ++ * in_data += len; ++ * in_len -= len; ++ * ++ * if(size) ++ * decode_frame(data, size); ++ * } ++ * @endcode ++ */ ++int av_parser_parse2(AVCodecParserContext* s, AVCodecContext* avctx, ++ uint8_t** poutbuf, int* poutbuf_size, const uint8_t* buf, ++ int buf_size, int64_t pts, int64_t dts, int64_t pos); ++ ++void av_parser_close(AVCodecParserContext* s); ++ ++/** ++ * @} ++ * @} ++ */ ++ ++/** ++ * @addtogroup lavc_encoding ++ * @{ ++ */ ++ ++int avcodec_encode_subtitle(AVCodecContext* avctx, uint8_t* buf, int buf_size, ++ const AVSubtitle* sub); ++ ++/** ++ * @} ++ */ ++ ++/** ++ * @defgroup lavc_misc Utility functions ++ * @ingroup libavc ++ * ++ * Miscellaneous utility functions related to both encoding and decoding ++ * (or neither). ++ * @{ ++ */ ++ ++/** ++ * @defgroup lavc_misc_pixfmt Pixel formats ++ * ++ * Functions for working with pixel formats. ++ * @{ ++ */ ++ ++/** ++ * Return a value representing the fourCC code associated to the ++ * pixel format pix_fmt, or 0 if no associated fourCC code can be ++ * found. ++ */ ++unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat pix_fmt); ++ ++/** ++ * Find the best pixel format to convert to given a certain source pixel ++ * format. When converting from one pixel format to another, information loss ++ * may occur. For example, when converting from RGB24 to GRAY, the color ++ * information will be lost. Similarly, other losses occur when converting from ++ * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches ++ * which of the given pixel formats should be used to suffer the least amount of ++ * loss. The pixel formats from which it chooses one, are determined by the ++ * pix_fmt_list parameter. ++ * ++ * ++ * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to ++ * choose from ++ * @param[in] src_pix_fmt source pixel format ++ * @param[in] has_alpha Whether the source pixel format alpha channel is used. ++ * @param[out] loss_ptr Combination of flags informing you what kind of losses ++ * will occur. ++ * @return The best pixel format to convert to or -1 if none was found. ++ */ ++enum AVPixelFormat avcodec_find_best_pix_fmt_of_list( ++ const enum AVPixelFormat* pix_fmt_list, enum AVPixelFormat src_pix_fmt, ++ int has_alpha, int* loss_ptr); ++ ++enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext* s, ++ const enum AVPixelFormat* fmt); ++ ++/** ++ * @} ++ */ ++ ++void avcodec_string(char* buf, int buf_size, AVCodecContext* enc, int encode); ++ ++int avcodec_default_execute(AVCodecContext* c, ++ int (*func)(AVCodecContext* c2, void* arg2), ++ void* arg, int* ret, int count, int size); ++int avcodec_default_execute2(AVCodecContext* c, ++ int (*func)(AVCodecContext* c2, void* arg2, int, ++ int), ++ void* arg, int* ret, int count); ++// FIXME func typedef ++ ++/** ++ * Fill AVFrame audio data and linesize pointers. ++ * ++ * The buffer buf must be a preallocated buffer with a size big enough ++ * to contain the specified samples amount. The filled AVFrame data ++ * pointers will point to this buffer. ++ * ++ * AVFrame extended_data channel pointers are allocated if necessary for ++ * planar audio. ++ * ++ * @param frame the AVFrame ++ * frame->nb_samples must be set prior to calling the ++ * function. This function fills in frame->data, ++ * frame->extended_data, frame->linesize[0]. ++ * @param nb_channels channel count ++ * @param sample_fmt sample format ++ * @param buf buffer to use for frame data ++ * @param buf_size size of buffer ++ * @param align plane size sample alignment (0 = default) ++ * @return >=0 on success, negative error code on failure ++ * @todo return the size in bytes required to store the samples in ++ * case of success, at the next libavutil bump ++ */ ++int avcodec_fill_audio_frame(AVFrame* frame, int nb_channels, ++ enum AVSampleFormat sample_fmt, const uint8_t* buf, ++ int buf_size, int align); ++ ++/** ++ * Reset the internal codec state / flush internal buffers. Should be called ++ * e.g. when seeking or when switching to a different stream. ++ * ++ * @note for decoders, this function just releases any references the decoder ++ * might keep internally, but the caller's references remain valid. ++ * ++ * @note for encoders, this function will only do something if the encoder ++ * declares support for AV_CODEC_CAP_ENCODER_FLUSH. When called, the encoder ++ * will drain any remaining packets, and can then be re-used for a different ++ * stream (as opposed to sending a null frame which will leave the encoder ++ * in a permanent EOF state after draining). This can be desirable if the ++ * cost of tearing down and replacing the encoder instance is high. ++ */ ++void avcodec_flush_buffers(AVCodecContext* avctx); ++ ++/** ++ * Return audio frame duration. ++ * ++ * @param avctx codec context ++ * @param frame_bytes size of the frame, or 0 if unknown ++ * @return frame duration, in samples, if known. 0 if not able to ++ * determine. ++ */ ++int av_get_audio_frame_duration(AVCodecContext* avctx, int frame_bytes); ++ ++/* memory */ ++ ++/** ++ * Same behaviour av_fast_malloc but the buffer has additional ++ * AV_INPUT_BUFFER_PADDING_SIZE at the end which will always be 0. ++ * ++ * In addition the whole buffer will initially and after resizes ++ * be 0-initialized so that no uninitialized data will ever appear. ++ */ ++void av_fast_padded_malloc(void* ptr, unsigned int* size, size_t min_size); ++ ++/** ++ * Same behaviour av_fast_padded_malloc except that buffer will always ++ * be 0-initialized after call. ++ */ ++void av_fast_padded_mallocz(void* ptr, unsigned int* size, size_t min_size); ++ ++/** ++ * @return a positive value if s is open (i.e. avcodec_open2() was called on it ++ * with no corresponding avcodec_close()), 0 otherwise. ++ */ ++int avcodec_is_open(AVCodecContext* s); ++ ++/** ++ * @} ++ */ ++ ++#endif /* AVCODEC_AVCODEC_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/avfft.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/avfft.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/avfft.h +@@ -0,0 +1,119 @@ ++/* ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifndef AVCODEC_AVFFT_H ++#define AVCODEC_AVFFT_H ++ ++/** ++ * @file ++ * @ingroup lavc_fft ++ * FFT functions ++ */ ++ ++/** ++ * @defgroup lavc_fft FFT functions ++ * @ingroup lavc_misc ++ * ++ * @{ ++ */ ++ ++typedef float FFTSample; ++ ++typedef struct FFTComplex { ++ FFTSample re, im; ++} FFTComplex; ++ ++typedef struct FFTContext FFTContext; ++ ++/** ++ * Set up a complex FFT. ++ * @param nbits log2 of the length of the input array ++ * @param inverse if 0 perform the forward transform, if 1 perform the ++ * inverse ++ */ ++FFTContext* av_fft_init(int nbits, int inverse); ++ ++/** ++ * Do the permutation needed BEFORE calling ff_fft_calc(). ++ */ ++void av_fft_permute(FFTContext* s, FFTComplex* z); ++ ++/** ++ * Do a complex FFT with the parameters defined in av_fft_init(). The ++ * input data must be permuted before. No 1.0/sqrt(n) normalization is done. ++ */ ++void av_fft_calc(FFTContext* s, FFTComplex* z); ++ ++void av_fft_end(FFTContext* s); ++ ++FFTContext* av_mdct_init(int nbits, int inverse, double scale); ++void av_imdct_calc(FFTContext* s, FFTSample* output, const FFTSample* input); ++void av_imdct_half(FFTContext* s, FFTSample* output, const FFTSample* input); ++void av_mdct_calc(FFTContext* s, FFTSample* output, const FFTSample* input); ++void av_mdct_end(FFTContext* s); ++ ++/* Real Discrete Fourier Transform */ ++ ++enum RDFTransformType { ++ DFT_R2C, ++ IDFT_C2R, ++ IDFT_R2C, ++ DFT_C2R, ++}; ++ ++typedef struct RDFTContext RDFTContext; ++ ++/** ++ * Set up a real FFT. ++ * @param nbits log2 of the length of the input array ++ * @param trans the type of transform ++ */ ++RDFTContext* av_rdft_init(int nbits, enum RDFTransformType trans); ++void av_rdft_calc(RDFTContext* s, FFTSample* data); ++void av_rdft_end(RDFTContext* s); ++ ++/* Discrete Cosine Transform */ ++ ++typedef struct DCTContext DCTContext; ++ ++enum DCTTransformType { ++ DCT_II = 0, ++ DCT_III, ++ DCT_I, ++ DST_I, ++}; ++ ++/** ++ * Set up DCT. ++ * ++ * @param nbits size of the input array: ++ * (1 << nbits) for DCT-II, DCT-III and DST-I ++ * (1 << nbits) + 1 for DCT-I ++ * @param type the type of transform ++ * ++ * @note the first element of the input of DST-I is ignored ++ */ ++DCTContext* av_dct_init(int nbits, enum DCTTransformType type); ++void av_dct_calc(DCTContext* s, FFTSample* data); ++void av_dct_end(DCTContext* s); ++ ++/** ++ * @} ++ */ ++ ++#endif /* AVCODEC_AVFFT_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/bsf.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/bsf.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/bsf.h +@@ -0,0 +1,320 @@ ++/* ++ * Bitstream filters public API ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifndef AVCODEC_BSF_H ++#define AVCODEC_BSF_H ++ ++#include "libavutil/dict.h" ++#include "libavutil/log.h" ++#include "libavutil/rational.h" ++ ++#include "codec_id.h" ++#include "codec_par.h" ++#include "packet.h" ++ ++/** ++ * @addtogroup lavc_core ++ * @{ ++ */ ++ ++/** ++ * The bitstream filter state. ++ * ++ * This struct must be allocated with av_bsf_alloc() and freed with ++ * av_bsf_free(). ++ * ++ * The fields in the struct will only be changed (by the caller or by the ++ * filter) as described in their documentation, and are to be considered ++ * immutable otherwise. ++ */ ++typedef struct AVBSFContext { ++ /** ++ * A class for logging and AVOptions ++ */ ++ const AVClass* av_class; ++ ++ /** ++ * The bitstream filter this context is an instance of. ++ */ ++ const struct AVBitStreamFilter* filter; ++ ++ /** ++ * Opaque filter-specific private data. If filter->priv_class is non-NULL, ++ * this is an AVOptions-enabled struct. ++ */ ++ void* priv_data; ++ ++ /** ++ * Parameters of the input stream. This field is allocated in ++ * av_bsf_alloc(), it needs to be filled by the caller before ++ * av_bsf_init(). ++ */ ++ AVCodecParameters* par_in; ++ ++ /** ++ * Parameters of the output stream. This field is allocated in ++ * av_bsf_alloc(), it is set by the filter in av_bsf_init(). ++ */ ++ AVCodecParameters* par_out; ++ ++ /** ++ * The timebase used for the timestamps of the input packets. Set by the ++ * caller before av_bsf_init(). ++ */ ++ AVRational time_base_in; ++ ++ /** ++ * The timebase used for the timestamps of the output packets. Set by the ++ * filter in av_bsf_init(). ++ */ ++ AVRational time_base_out; ++} AVBSFContext; ++ ++typedef struct AVBitStreamFilter { ++ const char* name; ++ ++ /** ++ * A list of codec ids supported by the filter, terminated by ++ * AV_CODEC_ID_NONE. ++ * May be NULL, in that case the bitstream filter works with any codec id. ++ */ ++ const enum AVCodecID* codec_ids; ++ ++ /** ++ * A class for the private data, used to declare bitstream filter private ++ * AVOptions. This field is NULL for bitstream filters that do not declare ++ * any options. ++ * ++ * If this field is non-NULL, the first member of the filter private data ++ * must be a pointer to AVClass, which will be set by libavcodec generic ++ * code to this class. ++ */ ++ const AVClass* priv_class; ++ ++ /***************************************************************** ++ * No fields below this line are part of the public API. They ++ * may not be used outside of libavcodec and can be changed and ++ * removed at will. ++ * New public fields should be added right above. ++ ***************************************************************** ++ */ ++ ++ int priv_data_size; ++ int (*init)(AVBSFContext* ctx); ++ int (*filter)(AVBSFContext* ctx, AVPacket* pkt); ++ void (*close)(AVBSFContext* ctx); ++ void (*flush)(AVBSFContext* ctx); ++} AVBitStreamFilter; ++ ++/** ++ * @return a bitstream filter with the specified name or NULL if no such ++ * bitstream filter exists. ++ */ ++const AVBitStreamFilter* av_bsf_get_by_name(const char* name); ++ ++/** ++ * Iterate over all registered bitstream filters. ++ * ++ * @param opaque a pointer where libavcodec will store the iteration state. Must ++ * point to NULL to start the iteration. ++ * ++ * @return the next registered bitstream filter or NULL when the iteration is ++ * finished ++ */ ++const AVBitStreamFilter* av_bsf_iterate(void** opaque); ++ ++/** ++ * Allocate a context for a given bitstream filter. The caller must fill in the ++ * context parameters as described in the documentation and then call ++ * av_bsf_init() before sending any data to the filter. ++ * ++ * @param filter the filter for which to allocate an instance. ++ * @param ctx a pointer into which the pointer to the newly-allocated context ++ * will be written. It must be freed with av_bsf_free() after the ++ * filtering is done. ++ * ++ * @return 0 on success, a negative AVERROR code on failure ++ */ ++int av_bsf_alloc(const AVBitStreamFilter* filter, AVBSFContext** ctx); ++ ++/** ++ * Prepare the filter for use, after all the parameters and options have been ++ * set. ++ */ ++int av_bsf_init(AVBSFContext* ctx); ++ ++/** ++ * Submit a packet for filtering. ++ * ++ * After sending each packet, the filter must be completely drained by calling ++ * av_bsf_receive_packet() repeatedly until it returns AVERROR(EAGAIN) or ++ * AVERROR_EOF. ++ * ++ * @param pkt the packet to filter. The bitstream filter will take ownership of ++ * the packet and reset the contents of pkt. pkt is not touched if an error ++ * occurs. If pkt is empty (i.e. NULL, or pkt->data is NULL and ++ * pkt->side_data_elems zero), it signals the end of the stream (i.e. no more ++ * non-empty packets will be sent; sending more empty packets does nothing) and ++ * will cause the filter to output any packets it may have buffered internally. ++ * ++ * @return 0 on success. AVERROR(EAGAIN) if packets need to be retrieved from ++ * the filter (using av_bsf_receive_packet()) before new input can be consumed. ++ * Another negative AVERROR value if an error occurs. ++ */ ++int av_bsf_send_packet(AVBSFContext* ctx, AVPacket* pkt); ++ ++/** ++ * Retrieve a filtered packet. ++ * ++ * @param[out] pkt this struct will be filled with the contents of the filtered ++ * packet. It is owned by the caller and must be freed using ++ * av_packet_unref() when it is no longer needed. ++ * This parameter should be "clean" (i.e. freshly allocated ++ * with av_packet_alloc() or unreffed with av_packet_unref()) ++ * when this function is called. If this function returns ++ * successfully, the contents of pkt will be completely ++ * overwritten by the returned data. On failure, pkt is not ++ * touched. ++ * ++ * @return 0 on success. AVERROR(EAGAIN) if more packets need to be sent to the ++ * filter (using av_bsf_send_packet()) to get more output. AVERROR_EOF if there ++ * will be no further output from the filter. Another negative AVERROR value if ++ * an error occurs. ++ * ++ * @note one input packet may result in several output packets, so after sending ++ * a packet with av_bsf_send_packet(), this function needs to be called ++ * repeatedly until it stops returning 0. It is also possible for a filter to ++ * output fewer packets than were sent to it, so this function may return ++ * AVERROR(EAGAIN) immediately after a successful av_bsf_send_packet() call. ++ */ ++int av_bsf_receive_packet(AVBSFContext* ctx, AVPacket* pkt); ++ ++/** ++ * Reset the internal bitstream filter state. Should be called e.g. when ++ * seeking. ++ */ ++void av_bsf_flush(AVBSFContext* ctx); ++ ++/** ++ * Free a bitstream filter context and everything associated with it; write NULL ++ * into the supplied pointer. ++ */ ++void av_bsf_free(AVBSFContext** ctx); ++ ++/** ++ * Get the AVClass for AVBSFContext. It can be used in combination with ++ * AV_OPT_SEARCH_FAKE_OBJ for examining options. ++ * ++ * @see av_opt_find(). ++ */ ++const AVClass* av_bsf_get_class(void); ++ ++/** ++ * Structure for chain/list of bitstream filters. ++ * Empty list can be allocated by av_bsf_list_alloc(). ++ */ ++typedef struct AVBSFList AVBSFList; ++ ++/** ++ * Allocate empty list of bitstream filters. ++ * The list must be later freed by av_bsf_list_free() ++ * or finalized by av_bsf_list_finalize(). ++ * ++ * @return Pointer to @ref AVBSFList on success, NULL in case of failure ++ */ ++AVBSFList* av_bsf_list_alloc(void); ++ ++/** ++ * Free list of bitstream filters. ++ * ++ * @param lst Pointer to pointer returned by av_bsf_list_alloc() ++ */ ++void av_bsf_list_free(AVBSFList** lst); ++ ++/** ++ * Append bitstream filter to the list of bitstream filters. ++ * ++ * @param lst List to append to ++ * @param bsf Filter context to be appended ++ * ++ * @return >=0 on success, negative AVERROR in case of failure ++ */ ++int av_bsf_list_append(AVBSFList* lst, AVBSFContext* bsf); ++ ++/** ++ * Construct new bitstream filter context given it's name and options ++ * and append it to the list of bitstream filters. ++ * ++ * @param lst List to append to ++ * @param bsf_name Name of the bitstream filter ++ * @param options Options for the bitstream filter, can be set to NULL ++ * ++ * @return >=0 on success, negative AVERROR in case of failure ++ */ ++int av_bsf_list_append2(AVBSFList* lst, const char* bsf_name, ++ AVDictionary** options); ++/** ++ * Finalize list of bitstream filters. ++ * ++ * This function will transform @ref AVBSFList to single @ref AVBSFContext, ++ * so the whole chain of bitstream filters can be treated as single filter ++ * freshly allocated by av_bsf_alloc(). ++ * If the call is successful, @ref AVBSFList structure is freed and lst ++ * will be set to NULL. In case of failure, caller is responsible for ++ * freeing the structure by av_bsf_list_free() ++ * ++ * @param lst Filter list structure to be transformed ++ * @param[out] bsf Pointer to be set to newly created @ref AVBSFContext ++ * structure representing the chain of bitstream filters ++ * ++ * @return >=0 on success, negative AVERROR in case of failure ++ */ ++int av_bsf_list_finalize(AVBSFList** lst, AVBSFContext** bsf); ++ ++/** ++ * Parse string describing list of bitstream filters and create single ++ * @ref AVBSFContext describing the whole chain of bitstream filters. ++ * Resulting @ref AVBSFContext can be treated as any other @ref AVBSFContext ++ * freshly allocated by av_bsf_alloc(). ++ * ++ * @param str String describing chain of bitstream filters in format ++ * `bsf1[=opt1=val1:opt2=val2][,bsf2]` ++ * @param[out] bsf Pointer to be set to newly created @ref AVBSFContext ++ * structure representing the chain of bitstream filters ++ * ++ * @return >=0 on success, negative AVERROR in case of failure ++ */ ++int av_bsf_list_parse_str(const char* str, AVBSFContext** bsf); ++ ++/** ++ * Get null/pass-through bitstream filter. ++ * ++ * @param[out] bsf Pointer to be set to new instance of pass-through bitstream ++ * filter ++ * ++ * @return ++ */ ++int av_bsf_get_null_filter(AVBSFContext** bsf); ++ ++/** ++ * @} ++ */ ++ ++#endif // AVCODEC_BSF_H +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec.h +@@ -0,0 +1,513 @@ ++/* ++ * AVCodec public API ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifndef AVCODEC_CODEC_H ++#define AVCODEC_CODEC_H ++ ++#include ++ ++#include "libavutil/avutil.h" ++#include "libavutil/hwcontext.h" ++#include "libavutil/log.h" ++#include "libavutil/pixfmt.h" ++#include "libavutil/rational.h" ++#include "libavutil/samplefmt.h" ++ ++#include "libavcodec/codec_id.h" ++#include "libavcodec/version.h" ++ ++/** ++ * @addtogroup lavc_core ++ * @{ ++ */ ++ ++/** ++ * Decoder can use draw_horiz_band callback. ++ */ ++#define AV_CODEC_CAP_DRAW_HORIZ_BAND (1 << 0) ++/** ++ * Codec uses get_buffer() or get_encode_buffer() for allocating buffers and ++ * supports custom allocators. ++ * If not set, it might not use get_buffer() or get_encode_buffer() at all, or ++ * use operations that assume the buffer was allocated by ++ * avcodec_default_get_buffer2 or avcodec_default_get_encode_buffer. ++ */ ++#define AV_CODEC_CAP_DR1 (1 << 1) ++#if FF_API_FLAG_TRUNCATED ++/** ++ * @deprecated Use parsers to always send proper frames. ++ */ ++# define AV_CODEC_CAP_TRUNCATED (1 << 3) ++#endif ++/** ++ * Encoder or decoder requires flushing with NULL input at the end in order to ++ * give the complete and correct output. ++ * ++ * NOTE: If this flag is not set, the codec is guaranteed to never be fed with ++ * with NULL data. The user can still send NULL data to the public encode ++ * or decode function, but libavcodec will not pass it along to the codec ++ * unless this flag is set. ++ * ++ * Decoders: ++ * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, ++ * avpkt->size=0 at the end to get the delayed data until the decoder no longer ++ * returns frames. ++ * ++ * Encoders: ++ * The encoder needs to be fed with NULL data at the end of encoding until the ++ * encoder no longer returns data. ++ * ++ * NOTE: For encoders implementing the AVCodec.encode2() function, setting this ++ * flag also means that the encoder must set the pts and duration for ++ * each output packet. If this flag is not set, the pts and duration will ++ * be determined by libavcodec from the input frame. ++ */ ++#define AV_CODEC_CAP_DELAY (1 << 5) ++/** ++ * Codec can be fed a final frame with a smaller size. ++ * This can be used to prevent truncation of the last audio samples. ++ */ ++#define AV_CODEC_CAP_SMALL_LAST_FRAME (1 << 6) ++ ++/** ++ * Codec can output multiple frames per AVPacket ++ * Normally demuxers return one frame at a time, demuxers which do not do ++ * are connected to a parser to split what they return into proper frames. ++ * This flag is reserved to the very rare category of codecs which have a ++ * bitstream that cannot be split into frames without timeconsuming ++ * operations like full decoding. Demuxers carrying such bitstreams thus ++ * may return multiple frames in a packet. This has many disadvantages like ++ * prohibiting stream copy in many cases thus it should only be considered ++ * as a last resort. ++ */ ++#define AV_CODEC_CAP_SUBFRAMES (1 << 8) ++/** ++ * Codec is experimental and is thus avoided in favor of non experimental ++ * encoders ++ */ ++#define AV_CODEC_CAP_EXPERIMENTAL (1 << 9) ++/** ++ * Codec should fill in channel configuration and samplerate instead of ++ * container ++ */ ++#define AV_CODEC_CAP_CHANNEL_CONF (1 << 10) ++/** ++ * Codec supports frame-level multithreading. ++ */ ++#define AV_CODEC_CAP_FRAME_THREADS (1 << 12) ++/** ++ * Codec supports slice-based (or partition-based) multithreading. ++ */ ++#define AV_CODEC_CAP_SLICE_THREADS (1 << 13) ++/** ++ * Codec supports changed parameters at any point. ++ */ ++#define AV_CODEC_CAP_PARAM_CHANGE (1 << 14) ++/** ++ * Codec supports multithreading through a method other than slice- or ++ * frame-level multithreading. Typically this marks wrappers around ++ * multithreading-capable external libraries. ++ */ ++#define AV_CODEC_CAP_OTHER_THREADS (1 << 15) ++#if FF_API_AUTO_THREADS ++# define AV_CODEC_CAP_AUTO_THREADS AV_CODEC_CAP_OTHER_THREADS ++#endif ++/** ++ * Audio encoder supports receiving a different number of samples in each call. ++ */ ++#define AV_CODEC_CAP_VARIABLE_FRAME_SIZE (1 << 16) ++/** ++ * Decoder is not a preferred choice for probing. ++ * This indicates that the decoder is not a good choice for probing. ++ * It could for example be an expensive to spin up hardware decoder, ++ * or it could simply not provide a lot of useful information about ++ * the stream. ++ * A decoder marked with this flag should only be used as last resort ++ * choice for probing. ++ */ ++#define AV_CODEC_CAP_AVOID_PROBING (1 << 17) ++ ++#if FF_API_UNUSED_CODEC_CAPS ++/** ++ * Deprecated and unused. Use AVCodecDescriptor.props instead ++ */ ++# define AV_CODEC_CAP_INTRA_ONLY 0x40000000 ++/** ++ * Deprecated and unused. Use AVCodecDescriptor.props instead ++ */ ++# define AV_CODEC_CAP_LOSSLESS 0x80000000 ++#endif ++ ++/** ++ * Codec is backed by a hardware implementation. Typically used to ++ * identify a non-hwaccel hardware decoder. For information about hwaccels, use ++ * avcodec_get_hw_config() instead. ++ */ ++#define AV_CODEC_CAP_HARDWARE (1 << 18) ++ ++/** ++ * Codec is potentially backed by a hardware implementation, but not ++ * necessarily. This is used instead of AV_CODEC_CAP_HARDWARE, if the ++ * implementation provides some sort of internal fallback. ++ */ ++#define AV_CODEC_CAP_HYBRID (1 << 19) ++ ++/** ++ * This codec takes the reordered_opaque field from input AVFrames ++ * and returns it in the corresponding field in AVCodecContext after ++ * encoding. ++ */ ++#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE (1 << 20) ++ ++/** ++ * This encoder can be flushed using avcodec_flush_buffers(). If this flag is ++ * not set, the encoder must be closed and reopened to ensure that no frames ++ * remain pending. ++ */ ++#define AV_CODEC_CAP_ENCODER_FLUSH (1 << 21) ++ ++/** ++ * AVProfile. ++ */ ++typedef struct AVProfile { ++ int profile; ++ const char* name; ///< short name for the profile ++} AVProfile; ++ ++typedef struct AVCodecDefault AVCodecDefault; ++ ++struct AVCodecContext; ++struct AVSubtitle; ++struct AVPacket; ++ ++/** ++ * AVCodec. ++ */ ++typedef struct AVCodec { ++ /** ++ * Name of the codec implementation. ++ * The name is globally unique among encoders and among decoders (but an ++ * encoder and a decoder can share the same name). ++ * This is the primary way to find a codec from the user perspective. ++ */ ++ const char* name; ++ /** ++ * Descriptive name for the codec, meant to be more human readable than name. ++ * You should use the NULL_IF_CONFIG_SMALL() macro to define it. ++ */ ++ const char* long_name; ++ enum AVMediaType type; ++ enum AVCodecID id; ++ /** ++ * Codec capabilities. ++ * see AV_CODEC_CAP_* ++ */ ++ int capabilities; ++ uint8_t max_lowres; ///< maximum value for lowres supported by the decoder ++ const AVRational* ++ supported_framerates; ///< array of supported framerates, or NULL if any, ++ ///< array is terminated by {0,0} ++ const enum AVPixelFormat* ++ pix_fmts; ///< array of supported pixel formats, or NULL if unknown, ++ ///< array is terminated by -1 ++ const int* ++ supported_samplerates; ///< array of supported audio samplerates, or NULL ++ ///< if unknown, array is terminated by 0 ++ const enum AVSampleFormat* ++ sample_fmts; ///< array of supported sample formats, or NULL if unknown, ++ ///< array is terminated by -1 ++ const uint64_t* ++ channel_layouts; ///< array of support channel layouts, or NULL if ++ ///< unknown. array is terminated by 0 ++ const AVClass* priv_class; ///< AVClass for the private context ++ const AVProfile* ++ profiles; ///< array of recognized profiles, or NULL if unknown, array is ++ ///< terminated by {FF_PROFILE_UNKNOWN} ++ ++ /** ++ * Group name of the codec implementation. ++ * This is a short symbolic name of the wrapper backing this codec. A ++ * wrapper uses some kind of external implementation for the codec, such ++ * as an external library, or a codec implementation provided by the OS or ++ * the hardware. ++ * If this field is NULL, this is a builtin, libavcodec native codec. ++ * If non-NULL, this will be the suffix in AVCodec.name in most cases ++ * (usually AVCodec.name will be of the form "_"). ++ */ ++ const char* wrapper_name; ++ ++ /***************************************************************** ++ * No fields below this line are part of the public API. They ++ * may not be used outside of libavcodec and can be changed and ++ * removed at will. ++ * New public fields should be added right above. ++ ***************************************************************** ++ */ ++ /** ++ * Internal codec capabilities. ++ * See FF_CODEC_CAP_* in internal.h ++ */ ++ int caps_internal; ++ ++ int priv_data_size; ++ /** ++ * @name Frame-level threading support functions ++ * @{ ++ */ ++ /** ++ * Copy necessary context variables from a previous thread context to the ++ * current one. If not defined, the next thread will start automatically; ++ * otherwise, the codec must call ff_thread_finish_setup(). ++ * ++ * dst and src will (rarely) point to the same context, in which case memcpy ++ * should be skipped. ++ */ ++ int (*update_thread_context)(struct AVCodecContext* dst, ++ const struct AVCodecContext* src); ++ ++ /** ++ * Copy variables back to the user-facing context ++ */ ++ int (*update_thread_context_for_user)(struct AVCodecContext* dst, ++ const struct AVCodecContext* src); ++ /** @} */ ++ ++ /** ++ * Private codec-specific defaults. ++ */ ++ const AVCodecDefault* defaults; ++ ++ /** ++ * Initialize codec static data, called from av_codec_iterate(). ++ * ++ * This is not intended for time consuming operations as it is ++ * run for every codec regardless of that codec being used. ++ */ ++ void (*init_static_data)(struct AVCodec* codec); ++ ++ int (*init)(struct AVCodecContext*); ++ int (*encode_sub)(struct AVCodecContext*, uint8_t* buf, int buf_size, ++ const struct AVSubtitle* sub); ++ /** ++ * Encode data to an AVPacket. ++ * ++ * @param avctx codec context ++ * @param avpkt output AVPacket ++ * @param[in] frame AVFrame containing the raw data to be encoded ++ * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a ++ * non-empty packet was returned in avpkt. ++ * @return 0 on success, negative error code on failure ++ */ ++ int (*encode2)(struct AVCodecContext* avctx, struct AVPacket* avpkt, ++ const struct AVFrame* frame, int* got_packet_ptr); ++ /** ++ * Decode picture or subtitle data. ++ * ++ * @param avctx codec context ++ * @param outdata codec type dependent output struct ++ * @param[out] got_frame_ptr decoder sets to 0 or 1 to indicate that a ++ * non-empty frame or subtitle was returned in ++ * outdata. ++ * @param[in] avpkt AVPacket containing the data to be decoded ++ * @return amount of bytes read from the packet on success, negative error ++ * code on failure ++ */ ++ int (*decode)(struct AVCodecContext* avctx, void* outdata, int* got_frame_ptr, ++ struct AVPacket* avpkt); ++ int (*close)(struct AVCodecContext*); ++ /** ++ * Encode API with decoupled frame/packet dataflow. This function is called ++ * to get one output packet. It should call ff_encode_get_frame() to obtain ++ * input data. ++ */ ++ int (*receive_packet)(struct AVCodecContext* avctx, struct AVPacket* avpkt); ++ ++ /** ++ * Decode API with decoupled packet/frame dataflow. This function is called ++ * to get one output frame. It should call ff_decode_get_packet() to obtain ++ * input data. ++ */ ++ int (*receive_frame)(struct AVCodecContext* avctx, struct AVFrame* frame); ++ /** ++ * Flush buffers. ++ * Will be called when seeking ++ */ ++ void (*flush)(struct AVCodecContext*); ++ ++ /** ++ * Decoding only, a comma-separated list of bitstream filters to apply to ++ * packets before decoding. ++ */ ++ const char* bsfs; ++ ++ /** ++ * Array of pointers to hardware configurations supported by the codec, ++ * or NULL if no hardware supported. The array is terminated by a NULL ++ * pointer. ++ * ++ * The user can only access this field via avcodec_get_hw_config(). ++ */ ++ const struct AVCodecHWConfigInternal* const* hw_configs; ++ ++ /** ++ * List of supported codec_tags, terminated by FF_CODEC_TAGS_END. ++ */ ++ const uint32_t* codec_tags; ++} AVCodec; ++ ++/** ++ * Iterate over all registered codecs. ++ * ++ * @param opaque a pointer where libavcodec will store the iteration state. Must ++ * point to NULL to start the iteration. ++ * ++ * @return the next registered codec or NULL when the iteration is ++ * finished ++ */ ++const AVCodec* av_codec_iterate(void** opaque); ++ ++/** ++ * Find a registered decoder with a matching codec ID. ++ * ++ * @param id AVCodecID of the requested decoder ++ * @return A decoder if one was found, NULL otherwise. ++ */ ++const AVCodec* avcodec_find_decoder(enum AVCodecID id); ++ ++/** ++ * Find a registered decoder with the specified name. ++ * ++ * @param name name of the requested decoder ++ * @return A decoder if one was found, NULL otherwise. ++ */ ++const AVCodec* avcodec_find_decoder_by_name(const char* name); ++ ++/** ++ * Find a registered encoder with a matching codec ID. ++ * ++ * @param id AVCodecID of the requested encoder ++ * @return An encoder if one was found, NULL otherwise. ++ */ ++const AVCodec* avcodec_find_encoder(enum AVCodecID id); ++ ++/** ++ * Find a registered encoder with the specified name. ++ * ++ * @param name name of the requested encoder ++ * @return An encoder if one was found, NULL otherwise. ++ */ ++const AVCodec* avcodec_find_encoder_by_name(const char* name); ++/** ++ * @return a non-zero number if codec is an encoder, zero otherwise ++ */ ++int av_codec_is_encoder(const AVCodec* codec); ++ ++/** ++ * @return a non-zero number if codec is a decoder, zero otherwise ++ */ ++int av_codec_is_decoder(const AVCodec* codec); ++ ++/** ++ * Return a name for the specified profile, if available. ++ * ++ * @param codec the codec that is searched for the given profile ++ * @param profile the profile value for which a name is requested ++ * @return A name for the profile if found, NULL otherwise. ++ */ ++const char* av_get_profile_name(const AVCodec* codec, int profile); ++ ++enum { ++ /** ++ * The codec supports this format via the hw_device_ctx interface. ++ * ++ * When selecting this format, AVCodecContext.hw_device_ctx should ++ * have been set to a device of the specified type before calling ++ * avcodec_open2(). ++ */ ++ AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX = 0x01, ++ /** ++ * The codec supports this format via the hw_frames_ctx interface. ++ * ++ * When selecting this format for a decoder, ++ * AVCodecContext.hw_frames_ctx should be set to a suitable frames ++ * context inside the get_format() callback. The frames context ++ * must have been created on a device of the specified type. ++ * ++ * When selecting this format for an encoder, ++ * AVCodecContext.hw_frames_ctx should be set to the context which ++ * will be used for the input frames before calling avcodec_open2(). ++ */ ++ AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX = 0x02, ++ /** ++ * The codec supports this format by some internal method. ++ * ++ * This format can be selected without any additional configuration - ++ * no device or frames context is required. ++ */ ++ AV_CODEC_HW_CONFIG_METHOD_INTERNAL = 0x04, ++ /** ++ * The codec supports this format by some ad-hoc method. ++ * ++ * Additional settings and/or function calls are required. See the ++ * codec-specific documentation for details. (Methods requiring ++ * this sort of configuration are deprecated and others should be ++ * used in preference.) ++ */ ++ AV_CODEC_HW_CONFIG_METHOD_AD_HOC = 0x08, ++}; ++ ++typedef struct AVCodecHWConfig { ++ /** ++ * For decoders, a hardware pixel format which that decoder may be ++ * able to decode to if suitable hardware is available. ++ * ++ * For encoders, a pixel format which the encoder may be able to ++ * accept. If set to AV_PIX_FMT_NONE, this applies to all pixel ++ * formats supported by the codec. ++ */ ++ enum AVPixelFormat pix_fmt; ++ /** ++ * Bit set of AV_CODEC_HW_CONFIG_METHOD_* flags, describing the possible ++ * setup methods which can be used with this configuration. ++ */ ++ int methods; ++ /** ++ * The device type associated with the configuration. ++ * ++ * Must be set for AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX and ++ * AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX, otherwise unused. ++ */ ++ enum AVHWDeviceType device_type; ++} AVCodecHWConfig; ++ ++/** ++ * Retrieve supported hardware configurations for a codec. ++ * ++ * Values of index from zero to some maximum return the indexed configuration ++ * descriptor; all other values return NULL. If the codec does not support ++ * any hardware configurations then it will always return NULL. ++ */ ++const AVCodecHWConfig* avcodec_get_hw_config(const AVCodec* codec, int index); ++ ++/** ++ * @} ++ */ ++ ++#endif /* AVCODEC_CODEC_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec_desc.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec_desc.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec_desc.h +@@ -0,0 +1,128 @@ ++/* ++ * Codec descriptors public API ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifndef AVCODEC_CODEC_DESC_H ++#define AVCODEC_CODEC_DESC_H ++ ++#include "libavutil/avutil.h" ++ ++#include "codec_id.h" ++ ++/** ++ * @addtogroup lavc_core ++ * @{ ++ */ ++ ++/** ++ * This struct describes the properties of a single codec described by an ++ * AVCodecID. ++ * @see avcodec_descriptor_get() ++ */ ++typedef struct AVCodecDescriptor { ++ enum AVCodecID id; ++ enum AVMediaType type; ++ /** ++ * Name of the codec described by this descriptor. It is non-empty and ++ * unique for each codec descriptor. It should contain alphanumeric ++ * characters and '_' only. ++ */ ++ const char* name; ++ /** ++ * A more descriptive name for this codec. May be NULL. ++ */ ++ const char* long_name; ++ /** ++ * Codec properties, a combination of AV_CODEC_PROP_* flags. ++ */ ++ int props; ++ /** ++ * MIME type(s) associated with the codec. ++ * May be NULL; if not, a NULL-terminated array of MIME types. ++ * The first item is always non-NULL and is the preferred MIME type. ++ */ ++ const char* const* mime_types; ++ /** ++ * If non-NULL, an array of profiles recognized for this codec. ++ * Terminated with FF_PROFILE_UNKNOWN. ++ */ ++ const struct AVProfile* profiles; ++} AVCodecDescriptor; ++ ++/** ++ * Codec uses only intra compression. ++ * Video and audio codecs only. ++ */ ++#define AV_CODEC_PROP_INTRA_ONLY (1 << 0) ++/** ++ * Codec supports lossy compression. Audio and video codecs only. ++ * @note a codec may support both lossy and lossless ++ * compression modes ++ */ ++#define AV_CODEC_PROP_LOSSY (1 << 1) ++/** ++ * Codec supports lossless compression. Audio and video codecs only. ++ */ ++#define AV_CODEC_PROP_LOSSLESS (1 << 2) ++/** ++ * Codec supports frame reordering. That is, the coded order (the order in which ++ * the encoded packets are output by the encoders / stored / input to the ++ * decoders) may be different from the presentation order of the corresponding ++ * frames. ++ * ++ * For codecs that do not have this property set, PTS and DTS should always be ++ * equal. ++ */ ++#define AV_CODEC_PROP_REORDER (1 << 3) ++/** ++ * Subtitle codec is bitmap based ++ * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field. ++ */ ++#define AV_CODEC_PROP_BITMAP_SUB (1 << 16) ++/** ++ * Subtitle codec is text based. ++ * Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field. ++ */ ++#define AV_CODEC_PROP_TEXT_SUB (1 << 17) ++ ++/** ++ * @return descriptor for given codec ID or NULL if no descriptor exists. ++ */ ++const AVCodecDescriptor* avcodec_descriptor_get(enum AVCodecID id); ++ ++/** ++ * Iterate over all codec descriptors known to libavcodec. ++ * ++ * @param prev previous descriptor. NULL to get the first descriptor. ++ * ++ * @return next descriptor or NULL after the last descriptor ++ */ ++const AVCodecDescriptor* avcodec_descriptor_next(const AVCodecDescriptor* prev); ++ ++/** ++ * @return codec descriptor with the given name or NULL if no such descriptor ++ * exists. ++ */ ++const AVCodecDescriptor* avcodec_descriptor_get_by_name(const char* name); ++ ++/** ++ * @} ++ */ ++ ++#endif // AVCODEC_CODEC_DESC_H +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec_id.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec_id.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec_id.h +@@ -0,0 +1,637 @@ ++/* ++ * Codec IDs ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifndef AVCODEC_CODEC_ID_H ++#define AVCODEC_CODEC_ID_H ++ ++#include "libavutil/avutil.h" ++#include "libavutil/samplefmt.h" ++ ++/** ++ * @addtogroup lavc_core ++ * @{ ++ */ ++ ++/** ++ * Identify the syntax and semantics of the bitstream. ++ * The principle is roughly: ++ * Two decoders with the same ID can decode the same streams. ++ * Two encoders with the same ID can encode compatible streams. ++ * There may be slight deviations from the principle due to implementation ++ * details. ++ * ++ * If you add a codec ID to this list, add it so that ++ * 1. no value of an existing codec ID changes (that would break ABI), ++ * 2. it is as close as possible to similar codecs ++ * ++ * After adding new codec IDs, do not forget to add an entry to the codec ++ * descriptor list and bump libavcodec minor version. ++ */ ++enum AVCodecID { ++ AV_CODEC_ID_NONE, ++ ++ /* video codecs */ ++ AV_CODEC_ID_MPEG1VIDEO, ++ AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding ++ AV_CODEC_ID_H261, ++ AV_CODEC_ID_H263, ++ AV_CODEC_ID_RV10, ++ AV_CODEC_ID_RV20, ++ AV_CODEC_ID_MJPEG, ++ AV_CODEC_ID_MJPEGB, ++ AV_CODEC_ID_LJPEG, ++ AV_CODEC_ID_SP5X, ++ AV_CODEC_ID_JPEGLS, ++ AV_CODEC_ID_MPEG4, ++ AV_CODEC_ID_RAWVIDEO, ++ AV_CODEC_ID_MSMPEG4V1, ++ AV_CODEC_ID_MSMPEG4V2, ++ AV_CODEC_ID_MSMPEG4V3, ++ AV_CODEC_ID_WMV1, ++ AV_CODEC_ID_WMV2, ++ AV_CODEC_ID_H263P, ++ AV_CODEC_ID_H263I, ++ AV_CODEC_ID_FLV1, ++ AV_CODEC_ID_SVQ1, ++ AV_CODEC_ID_SVQ3, ++ AV_CODEC_ID_DVVIDEO, ++ AV_CODEC_ID_HUFFYUV, ++ AV_CODEC_ID_CYUV, ++ AV_CODEC_ID_H264, ++ AV_CODEC_ID_INDEO3, ++ AV_CODEC_ID_VP3, ++ AV_CODEC_ID_THEORA, ++ AV_CODEC_ID_ASV1, ++ AV_CODEC_ID_ASV2, ++ AV_CODEC_ID_FFV1, ++ AV_CODEC_ID_4XM, ++ AV_CODEC_ID_VCR1, ++ AV_CODEC_ID_CLJR, ++ AV_CODEC_ID_MDEC, ++ AV_CODEC_ID_ROQ, ++ AV_CODEC_ID_INTERPLAY_VIDEO, ++ AV_CODEC_ID_XAN_WC3, ++ AV_CODEC_ID_XAN_WC4, ++ AV_CODEC_ID_RPZA, ++ AV_CODEC_ID_CINEPAK, ++ AV_CODEC_ID_WS_VQA, ++ AV_CODEC_ID_MSRLE, ++ AV_CODEC_ID_MSVIDEO1, ++ AV_CODEC_ID_IDCIN, ++ AV_CODEC_ID_8BPS, ++ AV_CODEC_ID_SMC, ++ AV_CODEC_ID_FLIC, ++ AV_CODEC_ID_TRUEMOTION1, ++ AV_CODEC_ID_VMDVIDEO, ++ AV_CODEC_ID_MSZH, ++ AV_CODEC_ID_ZLIB, ++ AV_CODEC_ID_QTRLE, ++ AV_CODEC_ID_TSCC, ++ AV_CODEC_ID_ULTI, ++ AV_CODEC_ID_QDRAW, ++ AV_CODEC_ID_VIXL, ++ AV_CODEC_ID_QPEG, ++ AV_CODEC_ID_PNG, ++ AV_CODEC_ID_PPM, ++ AV_CODEC_ID_PBM, ++ AV_CODEC_ID_PGM, ++ AV_CODEC_ID_PGMYUV, ++ AV_CODEC_ID_PAM, ++ AV_CODEC_ID_FFVHUFF, ++ AV_CODEC_ID_RV30, ++ AV_CODEC_ID_RV40, ++ AV_CODEC_ID_VC1, ++ AV_CODEC_ID_WMV3, ++ AV_CODEC_ID_LOCO, ++ AV_CODEC_ID_WNV1, ++ AV_CODEC_ID_AASC, ++ AV_CODEC_ID_INDEO2, ++ AV_CODEC_ID_FRAPS, ++ AV_CODEC_ID_TRUEMOTION2, ++ AV_CODEC_ID_BMP, ++ AV_CODEC_ID_CSCD, ++ AV_CODEC_ID_MMVIDEO, ++ AV_CODEC_ID_ZMBV, ++ AV_CODEC_ID_AVS, ++ AV_CODEC_ID_SMACKVIDEO, ++ AV_CODEC_ID_NUV, ++ AV_CODEC_ID_KMVC, ++ AV_CODEC_ID_FLASHSV, ++ AV_CODEC_ID_CAVS, ++ AV_CODEC_ID_JPEG2000, ++ AV_CODEC_ID_VMNC, ++ AV_CODEC_ID_VP5, ++ AV_CODEC_ID_VP6, ++ AV_CODEC_ID_VP6F, ++ AV_CODEC_ID_TARGA, ++ AV_CODEC_ID_DSICINVIDEO, ++ AV_CODEC_ID_TIERTEXSEQVIDEO, ++ AV_CODEC_ID_TIFF, ++ AV_CODEC_ID_GIF, ++ AV_CODEC_ID_DXA, ++ AV_CODEC_ID_DNXHD, ++ AV_CODEC_ID_THP, ++ AV_CODEC_ID_SGI, ++ AV_CODEC_ID_C93, ++ AV_CODEC_ID_BETHSOFTVID, ++ AV_CODEC_ID_PTX, ++ AV_CODEC_ID_TXD, ++ AV_CODEC_ID_VP6A, ++ AV_CODEC_ID_AMV, ++ AV_CODEC_ID_VB, ++ AV_CODEC_ID_PCX, ++ AV_CODEC_ID_SUNRAST, ++ AV_CODEC_ID_INDEO4, ++ AV_CODEC_ID_INDEO5, ++ AV_CODEC_ID_MIMIC, ++ AV_CODEC_ID_RL2, ++ AV_CODEC_ID_ESCAPE124, ++ AV_CODEC_ID_DIRAC, ++ AV_CODEC_ID_BFI, ++ AV_CODEC_ID_CMV, ++ AV_CODEC_ID_MOTIONPIXELS, ++ AV_CODEC_ID_TGV, ++ AV_CODEC_ID_TGQ, ++ AV_CODEC_ID_TQI, ++ AV_CODEC_ID_AURA, ++ AV_CODEC_ID_AURA2, ++ AV_CODEC_ID_V210X, ++ AV_CODEC_ID_TMV, ++ AV_CODEC_ID_V210, ++ AV_CODEC_ID_DPX, ++ AV_CODEC_ID_MAD, ++ AV_CODEC_ID_FRWU, ++ AV_CODEC_ID_FLASHSV2, ++ AV_CODEC_ID_CDGRAPHICS, ++ AV_CODEC_ID_R210, ++ AV_CODEC_ID_ANM, ++ AV_CODEC_ID_BINKVIDEO, ++ AV_CODEC_ID_IFF_ILBM, ++#define AV_CODEC_ID_IFF_BYTERUN1 AV_CODEC_ID_IFF_ILBM ++ AV_CODEC_ID_KGV1, ++ AV_CODEC_ID_YOP, ++ AV_CODEC_ID_VP8, ++ AV_CODEC_ID_PICTOR, ++ AV_CODEC_ID_ANSI, ++ AV_CODEC_ID_A64_MULTI, ++ AV_CODEC_ID_A64_MULTI5, ++ AV_CODEC_ID_R10K, ++ AV_CODEC_ID_MXPEG, ++ AV_CODEC_ID_LAGARITH, ++ AV_CODEC_ID_PRORES, ++ AV_CODEC_ID_JV, ++ AV_CODEC_ID_DFA, ++ AV_CODEC_ID_WMV3IMAGE, ++ AV_CODEC_ID_VC1IMAGE, ++ AV_CODEC_ID_UTVIDEO, ++ AV_CODEC_ID_BMV_VIDEO, ++ AV_CODEC_ID_VBLE, ++ AV_CODEC_ID_DXTORY, ++ AV_CODEC_ID_V410, ++ AV_CODEC_ID_XWD, ++ AV_CODEC_ID_CDXL, ++ AV_CODEC_ID_XBM, ++ AV_CODEC_ID_ZEROCODEC, ++ AV_CODEC_ID_MSS1, ++ AV_CODEC_ID_MSA1, ++ AV_CODEC_ID_TSCC2, ++ AV_CODEC_ID_MTS2, ++ AV_CODEC_ID_CLLC, ++ AV_CODEC_ID_MSS2, ++ AV_CODEC_ID_VP9, ++ AV_CODEC_ID_AIC, ++ AV_CODEC_ID_ESCAPE130, ++ AV_CODEC_ID_G2M, ++ AV_CODEC_ID_WEBP, ++ AV_CODEC_ID_HNM4_VIDEO, ++ AV_CODEC_ID_HEVC, ++#define AV_CODEC_ID_H265 AV_CODEC_ID_HEVC ++ AV_CODEC_ID_FIC, ++ AV_CODEC_ID_ALIAS_PIX, ++ AV_CODEC_ID_BRENDER_PIX, ++ AV_CODEC_ID_PAF_VIDEO, ++ AV_CODEC_ID_EXR, ++ AV_CODEC_ID_VP7, ++ AV_CODEC_ID_SANM, ++ AV_CODEC_ID_SGIRLE, ++ AV_CODEC_ID_MVC1, ++ AV_CODEC_ID_MVC2, ++ AV_CODEC_ID_HQX, ++ AV_CODEC_ID_TDSC, ++ AV_CODEC_ID_HQ_HQA, ++ AV_CODEC_ID_HAP, ++ AV_CODEC_ID_DDS, ++ AV_CODEC_ID_DXV, ++ AV_CODEC_ID_SCREENPRESSO, ++ AV_CODEC_ID_RSCC, ++ AV_CODEC_ID_AVS2, ++ AV_CODEC_ID_PGX, ++ AV_CODEC_ID_AVS3, ++ AV_CODEC_ID_MSP2, ++ AV_CODEC_ID_VVC, ++#define AV_CODEC_ID_H266 AV_CODEC_ID_VVC ++ AV_CODEC_ID_Y41P, ++ AV_CODEC_ID_AVRP, ++ AV_CODEC_ID_012V, ++ AV_CODEC_ID_AVUI, ++ AV_CODEC_ID_AYUV, ++ AV_CODEC_ID_TARGA_Y216, ++ AV_CODEC_ID_V308, ++ AV_CODEC_ID_V408, ++ AV_CODEC_ID_YUV4, ++ AV_CODEC_ID_AVRN, ++ AV_CODEC_ID_CPIA, ++ AV_CODEC_ID_XFACE, ++ AV_CODEC_ID_SNOW, ++ AV_CODEC_ID_SMVJPEG, ++ AV_CODEC_ID_APNG, ++ AV_CODEC_ID_DAALA, ++ AV_CODEC_ID_CFHD, ++ AV_CODEC_ID_TRUEMOTION2RT, ++ AV_CODEC_ID_M101, ++ AV_CODEC_ID_MAGICYUV, ++ AV_CODEC_ID_SHEERVIDEO, ++ AV_CODEC_ID_YLC, ++ AV_CODEC_ID_PSD, ++ AV_CODEC_ID_PIXLET, ++ AV_CODEC_ID_SPEEDHQ, ++ AV_CODEC_ID_FMVC, ++ AV_CODEC_ID_SCPR, ++ AV_CODEC_ID_CLEARVIDEO, ++ AV_CODEC_ID_XPM, ++ AV_CODEC_ID_AV1, ++ AV_CODEC_ID_BITPACKED, ++ AV_CODEC_ID_MSCC, ++ AV_CODEC_ID_SRGC, ++ AV_CODEC_ID_SVG, ++ AV_CODEC_ID_GDV, ++ AV_CODEC_ID_FITS, ++ AV_CODEC_ID_IMM4, ++ AV_CODEC_ID_PROSUMER, ++ AV_CODEC_ID_MWSC, ++ AV_CODEC_ID_WCMV, ++ AV_CODEC_ID_RASC, ++ AV_CODEC_ID_HYMT, ++ AV_CODEC_ID_ARBC, ++ AV_CODEC_ID_AGM, ++ AV_CODEC_ID_LSCR, ++ AV_CODEC_ID_VP4, ++ AV_CODEC_ID_IMM5, ++ AV_CODEC_ID_MVDV, ++ AV_CODEC_ID_MVHA, ++ AV_CODEC_ID_CDTOONS, ++ AV_CODEC_ID_MV30, ++ AV_CODEC_ID_NOTCHLC, ++ AV_CODEC_ID_PFM, ++ AV_CODEC_ID_MOBICLIP, ++ AV_CODEC_ID_PHOTOCD, ++ AV_CODEC_ID_IPU, ++ AV_CODEC_ID_ARGO, ++ AV_CODEC_ID_CRI, ++ AV_CODEC_ID_SIMBIOSIS_IMX, ++ AV_CODEC_ID_SGA_VIDEO, ++ AV_CODEC_ID_GEM, ++ ++ /* various PCM "codecs" */ ++ AV_CODEC_ID_FIRST_AUDIO = ++ 0x10000, ///< A dummy id pointing at the start of audio codecs ++ AV_CODEC_ID_PCM_S16LE = 0x10000, ++ AV_CODEC_ID_PCM_S16BE, ++ AV_CODEC_ID_PCM_U16LE, ++ AV_CODEC_ID_PCM_U16BE, ++ AV_CODEC_ID_PCM_S8, ++ AV_CODEC_ID_PCM_U8, ++ AV_CODEC_ID_PCM_MULAW, ++ AV_CODEC_ID_PCM_ALAW, ++ AV_CODEC_ID_PCM_S32LE, ++ AV_CODEC_ID_PCM_S32BE, ++ AV_CODEC_ID_PCM_U32LE, ++ AV_CODEC_ID_PCM_U32BE, ++ AV_CODEC_ID_PCM_S24LE, ++ AV_CODEC_ID_PCM_S24BE, ++ AV_CODEC_ID_PCM_U24LE, ++ AV_CODEC_ID_PCM_U24BE, ++ AV_CODEC_ID_PCM_S24DAUD, ++ AV_CODEC_ID_PCM_ZORK, ++ AV_CODEC_ID_PCM_S16LE_PLANAR, ++ AV_CODEC_ID_PCM_DVD, ++ AV_CODEC_ID_PCM_F32BE, ++ AV_CODEC_ID_PCM_F32LE, ++ AV_CODEC_ID_PCM_F64BE, ++ AV_CODEC_ID_PCM_F64LE, ++ AV_CODEC_ID_PCM_BLURAY, ++ AV_CODEC_ID_PCM_LXF, ++ AV_CODEC_ID_S302M, ++ AV_CODEC_ID_PCM_S8_PLANAR, ++ AV_CODEC_ID_PCM_S24LE_PLANAR, ++ AV_CODEC_ID_PCM_S32LE_PLANAR, ++ AV_CODEC_ID_PCM_S16BE_PLANAR, ++ AV_CODEC_ID_PCM_S64LE, ++ AV_CODEC_ID_PCM_S64BE, ++ AV_CODEC_ID_PCM_F16LE, ++ AV_CODEC_ID_PCM_F24LE, ++ AV_CODEC_ID_PCM_VIDC, ++ AV_CODEC_ID_PCM_SGA, ++ ++ /* various ADPCM codecs */ ++ AV_CODEC_ID_ADPCM_IMA_QT = 0x11000, ++ AV_CODEC_ID_ADPCM_IMA_WAV, ++ AV_CODEC_ID_ADPCM_IMA_DK3, ++ AV_CODEC_ID_ADPCM_IMA_DK4, ++ AV_CODEC_ID_ADPCM_IMA_WS, ++ AV_CODEC_ID_ADPCM_IMA_SMJPEG, ++ AV_CODEC_ID_ADPCM_MS, ++ AV_CODEC_ID_ADPCM_4XM, ++ AV_CODEC_ID_ADPCM_XA, ++ AV_CODEC_ID_ADPCM_ADX, ++ AV_CODEC_ID_ADPCM_EA, ++ AV_CODEC_ID_ADPCM_G726, ++ AV_CODEC_ID_ADPCM_CT, ++ AV_CODEC_ID_ADPCM_SWF, ++ AV_CODEC_ID_ADPCM_YAMAHA, ++ AV_CODEC_ID_ADPCM_SBPRO_4, ++ AV_CODEC_ID_ADPCM_SBPRO_3, ++ AV_CODEC_ID_ADPCM_SBPRO_2, ++ AV_CODEC_ID_ADPCM_THP, ++ AV_CODEC_ID_ADPCM_IMA_AMV, ++ AV_CODEC_ID_ADPCM_EA_R1, ++ AV_CODEC_ID_ADPCM_EA_R3, ++ AV_CODEC_ID_ADPCM_EA_R2, ++ AV_CODEC_ID_ADPCM_IMA_EA_SEAD, ++ AV_CODEC_ID_ADPCM_IMA_EA_EACS, ++ AV_CODEC_ID_ADPCM_EA_XAS, ++ AV_CODEC_ID_ADPCM_EA_MAXIS_XA, ++ AV_CODEC_ID_ADPCM_IMA_ISS, ++ AV_CODEC_ID_ADPCM_G722, ++ AV_CODEC_ID_ADPCM_IMA_APC, ++ AV_CODEC_ID_ADPCM_VIMA, ++ AV_CODEC_ID_ADPCM_AFC, ++ AV_CODEC_ID_ADPCM_IMA_OKI, ++ AV_CODEC_ID_ADPCM_DTK, ++ AV_CODEC_ID_ADPCM_IMA_RAD, ++ AV_CODEC_ID_ADPCM_G726LE, ++ AV_CODEC_ID_ADPCM_THP_LE, ++ AV_CODEC_ID_ADPCM_PSX, ++ AV_CODEC_ID_ADPCM_AICA, ++ AV_CODEC_ID_ADPCM_IMA_DAT4, ++ AV_CODEC_ID_ADPCM_MTAF, ++ AV_CODEC_ID_ADPCM_AGM, ++ AV_CODEC_ID_ADPCM_ARGO, ++ AV_CODEC_ID_ADPCM_IMA_SSI, ++ AV_CODEC_ID_ADPCM_ZORK, ++ AV_CODEC_ID_ADPCM_IMA_APM, ++ AV_CODEC_ID_ADPCM_IMA_ALP, ++ AV_CODEC_ID_ADPCM_IMA_MTF, ++ AV_CODEC_ID_ADPCM_IMA_CUNNING, ++ AV_CODEC_ID_ADPCM_IMA_MOFLEX, ++ AV_CODEC_ID_ADPCM_IMA_ACORN, ++ ++ /* AMR */ ++ AV_CODEC_ID_AMR_NB = 0x12000, ++ AV_CODEC_ID_AMR_WB, ++ ++ /* RealAudio codecs*/ ++ AV_CODEC_ID_RA_144 = 0x13000, ++ AV_CODEC_ID_RA_288, ++ ++ /* various DPCM codecs */ ++ AV_CODEC_ID_ROQ_DPCM = 0x14000, ++ AV_CODEC_ID_INTERPLAY_DPCM, ++ AV_CODEC_ID_XAN_DPCM, ++ AV_CODEC_ID_SOL_DPCM, ++ AV_CODEC_ID_SDX2_DPCM, ++ AV_CODEC_ID_GREMLIN_DPCM, ++ AV_CODEC_ID_DERF_DPCM, ++ ++ /* audio codecs */ ++ AV_CODEC_ID_MP2 = 0x15000, ++ AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 ++ AV_CODEC_ID_AAC, ++ AV_CODEC_ID_AC3, ++ AV_CODEC_ID_DTS, ++ AV_CODEC_ID_VORBIS, ++ AV_CODEC_ID_DVAUDIO, ++ AV_CODEC_ID_WMAV1, ++ AV_CODEC_ID_WMAV2, ++ AV_CODEC_ID_MACE3, ++ AV_CODEC_ID_MACE6, ++ AV_CODEC_ID_VMDAUDIO, ++ AV_CODEC_ID_FLAC, ++ AV_CODEC_ID_MP3ADU, ++ AV_CODEC_ID_MP3ON4, ++ AV_CODEC_ID_SHORTEN, ++ AV_CODEC_ID_ALAC, ++ AV_CODEC_ID_WESTWOOD_SND1, ++ AV_CODEC_ID_GSM, ///< as in Berlin toast format ++ AV_CODEC_ID_QDM2, ++ AV_CODEC_ID_COOK, ++ AV_CODEC_ID_TRUESPEECH, ++ AV_CODEC_ID_TTA, ++ AV_CODEC_ID_SMACKAUDIO, ++ AV_CODEC_ID_QCELP, ++ AV_CODEC_ID_WAVPACK, ++ AV_CODEC_ID_DSICINAUDIO, ++ AV_CODEC_ID_IMC, ++ AV_CODEC_ID_MUSEPACK7, ++ AV_CODEC_ID_MLP, ++ AV_CODEC_ID_GSM_MS, /* as found in WAV */ ++ AV_CODEC_ID_ATRAC3, ++ AV_CODEC_ID_APE, ++ AV_CODEC_ID_NELLYMOSER, ++ AV_CODEC_ID_MUSEPACK8, ++ AV_CODEC_ID_SPEEX, ++ AV_CODEC_ID_WMAVOICE, ++ AV_CODEC_ID_WMAPRO, ++ AV_CODEC_ID_WMALOSSLESS, ++ AV_CODEC_ID_ATRAC3P, ++ AV_CODEC_ID_EAC3, ++ AV_CODEC_ID_SIPR, ++ AV_CODEC_ID_MP1, ++ AV_CODEC_ID_TWINVQ, ++ AV_CODEC_ID_TRUEHD, ++ AV_CODEC_ID_MP4ALS, ++ AV_CODEC_ID_ATRAC1, ++ AV_CODEC_ID_BINKAUDIO_RDFT, ++ AV_CODEC_ID_BINKAUDIO_DCT, ++ AV_CODEC_ID_AAC_LATM, ++ AV_CODEC_ID_QDMC, ++ AV_CODEC_ID_CELT, ++ AV_CODEC_ID_G723_1, ++ AV_CODEC_ID_G729, ++ AV_CODEC_ID_8SVX_EXP, ++ AV_CODEC_ID_8SVX_FIB, ++ AV_CODEC_ID_BMV_AUDIO, ++ AV_CODEC_ID_RALF, ++ AV_CODEC_ID_IAC, ++ AV_CODEC_ID_ILBC, ++ AV_CODEC_ID_OPUS, ++ AV_CODEC_ID_COMFORT_NOISE, ++ AV_CODEC_ID_TAK, ++ AV_CODEC_ID_METASOUND, ++ AV_CODEC_ID_PAF_AUDIO, ++ AV_CODEC_ID_ON2AVC, ++ AV_CODEC_ID_DSS_SP, ++ AV_CODEC_ID_CODEC2, ++ AV_CODEC_ID_FFWAVESYNTH, ++ AV_CODEC_ID_SONIC, ++ AV_CODEC_ID_SONIC_LS, ++ AV_CODEC_ID_EVRC, ++ AV_CODEC_ID_SMV, ++ AV_CODEC_ID_DSD_LSBF, ++ AV_CODEC_ID_DSD_MSBF, ++ AV_CODEC_ID_DSD_LSBF_PLANAR, ++ AV_CODEC_ID_DSD_MSBF_PLANAR, ++ AV_CODEC_ID_4GV, ++ AV_CODEC_ID_INTERPLAY_ACM, ++ AV_CODEC_ID_XMA1, ++ AV_CODEC_ID_XMA2, ++ AV_CODEC_ID_DST, ++ AV_CODEC_ID_ATRAC3AL, ++ AV_CODEC_ID_ATRAC3PAL, ++ AV_CODEC_ID_DOLBY_E, ++ AV_CODEC_ID_APTX, ++ AV_CODEC_ID_APTX_HD, ++ AV_CODEC_ID_SBC, ++ AV_CODEC_ID_ATRAC9, ++ AV_CODEC_ID_HCOM, ++ AV_CODEC_ID_ACELP_KELVIN, ++ AV_CODEC_ID_MPEGH_3D_AUDIO, ++ AV_CODEC_ID_SIREN, ++ AV_CODEC_ID_HCA, ++ AV_CODEC_ID_FASTAUDIO, ++ AV_CODEC_ID_MSNSIREN, ++ ++ /* subtitle codecs */ ++ AV_CODEC_ID_FIRST_SUBTITLE = ++ 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. ++ AV_CODEC_ID_DVD_SUBTITLE = 0x17000, ++ AV_CODEC_ID_DVB_SUBTITLE, ++ AV_CODEC_ID_TEXT, ///< raw UTF-8 text ++ AV_CODEC_ID_XSUB, ++ AV_CODEC_ID_SSA, ++ AV_CODEC_ID_MOV_TEXT, ++ AV_CODEC_ID_HDMV_PGS_SUBTITLE, ++ AV_CODEC_ID_DVB_TELETEXT, ++ AV_CODEC_ID_SRT, ++ AV_CODEC_ID_MICRODVD, ++ AV_CODEC_ID_EIA_608, ++ AV_CODEC_ID_JACOSUB, ++ AV_CODEC_ID_SAMI, ++ AV_CODEC_ID_REALTEXT, ++ AV_CODEC_ID_STL, ++ AV_CODEC_ID_SUBVIEWER1, ++ AV_CODEC_ID_SUBVIEWER, ++ AV_CODEC_ID_SUBRIP, ++ AV_CODEC_ID_WEBVTT, ++ AV_CODEC_ID_MPL2, ++ AV_CODEC_ID_VPLAYER, ++ AV_CODEC_ID_PJS, ++ AV_CODEC_ID_ASS, ++ AV_CODEC_ID_HDMV_TEXT_SUBTITLE, ++ AV_CODEC_ID_TTML, ++ AV_CODEC_ID_ARIB_CAPTION, ++ ++ /* other specific kind of codecs (generally used for attachments) */ ++ AV_CODEC_ID_FIRST_UNKNOWN = ++ 0x18000, ///< A dummy ID pointing at the start of various fake codecs. ++ AV_CODEC_ID_TTF = 0x18000, ++ ++ AV_CODEC_ID_SCTE_35, ///< Contain timestamp estimated through PCR of program ++ ///< stream. ++ AV_CODEC_ID_EPG, ++ AV_CODEC_ID_BINTEXT, ++ AV_CODEC_ID_XBIN, ++ AV_CODEC_ID_IDF, ++ AV_CODEC_ID_OTF, ++ AV_CODEC_ID_SMPTE_KLV, ++ AV_CODEC_ID_DVD_NAV, ++ AV_CODEC_ID_TIMED_ID3, ++ AV_CODEC_ID_BIN_DATA, ++ ++ AV_CODEC_ID_PROBE = ++ 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf ++ ///< should attempt to identify it ++ ++ AV_CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS ++ * stream (only used by libavformat) */ ++ AV_CODEC_ID_MPEG4SYSTEMS = ++ 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems ++ * stream (only used by libavformat) */ ++ AV_CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing ++ ///< only metadata information. ++ AV_CODEC_ID_WRAPPED_AVFRAME = ++ 0x21001, ///< Passthrough codec, AVFrames wrapped in AVPacket ++}; ++ ++/** ++ * Get the type of the given codec. ++ */ ++enum AVMediaType avcodec_get_type(enum AVCodecID codec_id); ++ ++/** ++ * Get the name of a codec. ++ * @return a static string identifying the codec; never NULL ++ */ ++const char* avcodec_get_name(enum AVCodecID id); ++ ++/** ++ * Return codec bits per sample. ++ * ++ * @param[in] codec_id the codec ++ * @return Number of bits per sample or zero if unknown for the given codec. ++ */ ++int av_get_bits_per_sample(enum AVCodecID codec_id); ++ ++/** ++ * Return codec bits per sample. ++ * Only return non-zero if the bits per sample is exactly correct, not an ++ * approximation. ++ * ++ * @param[in] codec_id the codec ++ * @return Number of bits per sample or zero if unknown for the given codec. ++ */ ++int av_get_exact_bits_per_sample(enum AVCodecID codec_id); ++ ++/** ++ * Return a name for the specified profile, if available. ++ * ++ * @param codec_id the ID of the codec to which the requested profile belongs ++ * @param profile the profile value for which a name is requested ++ * @return A name for the profile if found, NULL otherwise. ++ * ++ * @note unlike av_get_profile_name(), which searches a list of profiles ++ * supported by a specific decoder or encoder implementation, this ++ * function searches the list of profiles from the AVCodecDescriptor ++ */ ++const char* avcodec_profile_name(enum AVCodecID codec_id, int profile); ++ ++/** ++ * Return the PCM codec associated with a sample format. ++ * @param be endianness, 0 for little, 1 for big, ++ * -1 (or anything else) for native ++ * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE ++ */ ++enum AVCodecID av_get_pcm_codec(enum AVSampleFormat fmt, int be); ++ ++/** ++ * @} ++ */ ++ ++#endif // AVCODEC_CODEC_ID_H +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec_par.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec_par.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec_par.h +@@ -0,0 +1,236 @@ ++/* ++ * Codec parameters public API ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifndef AVCODEC_CODEC_PAR_H ++#define AVCODEC_CODEC_PAR_H ++ ++#include ++ ++#include "libavutil/avutil.h" ++#include "libavutil/rational.h" ++#include "libavutil/pixfmt.h" ++ ++#include "codec_id.h" ++ ++/** ++ * @addtogroup lavc_core ++ */ ++ ++enum AVFieldOrder { ++ AV_FIELD_UNKNOWN, ++ AV_FIELD_PROGRESSIVE, ++ AV_FIELD_TT, //< Top coded_first, top displayed first ++ AV_FIELD_BB, //< Bottom coded first, bottom displayed first ++ AV_FIELD_TB, //< Top coded first, bottom displayed first ++ AV_FIELD_BT, //< Bottom coded first, top displayed first ++}; ++ ++/** ++ * This struct describes the properties of an encoded stream. ++ * ++ * sizeof(AVCodecParameters) is not a part of the public ABI, this struct must ++ * be allocated with avcodec_parameters_alloc() and freed with ++ * avcodec_parameters_free(). ++ */ ++typedef struct AVCodecParameters { ++ /** ++ * General type of the encoded data. ++ */ ++ enum AVMediaType codec_type; ++ /** ++ * Specific type of the encoded data (the codec used). ++ */ ++ enum AVCodecID codec_id; ++ /** ++ * Additional information about the codec (corresponds to the AVI FOURCC). ++ */ ++ uint32_t codec_tag; ++ ++ /** ++ * Extra binary data needed for initializing the decoder, codec-dependent. ++ * ++ * Must be allocated with av_malloc() and will be freed by ++ * avcodec_parameters_free(). The allocated size of extradata must be at ++ * least extradata_size + AV_INPUT_BUFFER_PADDING_SIZE, with the padding ++ * bytes zeroed. ++ */ ++ uint8_t* extradata; ++ /** ++ * Size of the extradata content in bytes. ++ */ ++ int extradata_size; ++ ++ /** ++ * - video: the pixel format, the value corresponds to enum AVPixelFormat. ++ * - audio: the sample format, the value corresponds to enum AVSampleFormat. ++ */ ++ int format; ++ ++ /** ++ * The average bitrate of the encoded data (in bits per second). ++ */ ++ int64_t bit_rate; ++ ++ /** ++ * The number of bits per sample in the codedwords. ++ * ++ * This is basically the bitrate per sample. It is mandatory for a bunch of ++ * formats to actually decode them. It's the number of bits for one sample in ++ * the actual coded bitstream. ++ * ++ * This could be for example 4 for ADPCM ++ * For PCM formats this matches bits_per_raw_sample ++ * Can be 0 ++ */ ++ int bits_per_coded_sample; ++ ++ /** ++ * This is the number of valid bits in each output sample. If the ++ * sample format has more bits, the least significant bits are additional ++ * padding bits, which are always 0. Use right shifts to reduce the sample ++ * to its actual size. For example, audio formats with 24 bit samples will ++ * have bits_per_raw_sample set to 24, and format set to AV_SAMPLE_FMT_S32. ++ * To get the original sample use "(int32_t)sample >> 8"." ++ * ++ * For ADPCM this might be 12 or 16 or similar ++ * Can be 0 ++ */ ++ int bits_per_raw_sample; ++ ++ /** ++ * Codec-specific bitstream restrictions that the stream conforms to. ++ */ ++ int profile; ++ int level; ++ ++ /** ++ * Video only. The dimensions of the video frame in pixels. ++ */ ++ int width; ++ int height; ++ ++ /** ++ * Video only. The aspect ratio (width / height) which a single pixel ++ * should have when displayed. ++ * ++ * When the aspect ratio is unknown / undefined, the numerator should be ++ * set to 0 (the denominator may have any value). ++ */ ++ AVRational sample_aspect_ratio; ++ ++ /** ++ * Video only. The order of the fields in interlaced video. ++ */ ++ enum AVFieldOrder field_order; ++ ++ /** ++ * Video only. Additional colorspace characteristics. ++ */ ++ enum AVColorRange color_range; ++ enum AVColorPrimaries color_primaries; ++ enum AVColorTransferCharacteristic color_trc; ++ enum AVColorSpace color_space; ++ enum AVChromaLocation chroma_location; ++ ++ /** ++ * Video only. Number of delayed frames. ++ */ ++ int video_delay; ++ ++ /** ++ * Audio only. The channel layout bitmask. May be 0 if the channel layout is ++ * unknown or unspecified, otherwise the number of bits set must be equal to ++ * the channels field. ++ */ ++ uint64_t channel_layout; ++ /** ++ * Audio only. The number of audio channels. ++ */ ++ int channels; ++ /** ++ * Audio only. The number of audio samples per second. ++ */ ++ int sample_rate; ++ /** ++ * Audio only. The number of bytes per coded audio frame, required by some ++ * formats. ++ * ++ * Corresponds to nBlockAlign in WAVEFORMATEX. ++ */ ++ int block_align; ++ /** ++ * Audio only. Audio frame size, if known. Required by some formats to be ++ * static. ++ */ ++ int frame_size; ++ ++ /** ++ * Audio only. The amount of padding (in samples) inserted by the encoder at ++ * the beginning of the audio. I.e. this number of leading decoded samples ++ * must be discarded by the caller to get the original audio without leading ++ * padding. ++ */ ++ int initial_padding; ++ /** ++ * Audio only. The amount of padding (in samples) appended by the encoder to ++ * the end of the audio. I.e. this number of decoded samples must be ++ * discarded by the caller from the end of the stream to get the original ++ * audio without any trailing padding. ++ */ ++ int trailing_padding; ++ /** ++ * Audio only. Number of samples to skip after a discontinuity. ++ */ ++ int seek_preroll; ++} AVCodecParameters; ++ ++/** ++ * Allocate a new AVCodecParameters and set its fields to default values ++ * (unknown/invalid/0). The returned struct must be freed with ++ * avcodec_parameters_free(). ++ */ ++AVCodecParameters* avcodec_parameters_alloc(void); ++ ++/** ++ * Free an AVCodecParameters instance and everything associated with it and ++ * write NULL to the supplied pointer. ++ */ ++void avcodec_parameters_free(AVCodecParameters** par); ++ ++/** ++ * Copy the contents of src to dst. Any allocated fields in dst are freed and ++ * replaced with newly allocated duplicates of the corresponding fields in src. ++ * ++ * @return >= 0 on success, a negative AVERROR code on failure. ++ */ ++int avcodec_parameters_copy(AVCodecParameters* dst, ++ const AVCodecParameters* src); ++ ++/** ++ * This function is the same as av_get_audio_frame_duration(), except it works ++ * with AVCodecParameters instead of an AVCodecContext. ++ */ ++int av_get_audio_frame_duration2(AVCodecParameters* par, int frame_bytes); ++ ++/** ++ * @} ++ */ ++ ++#endif // AVCODEC_CODEC_PAR_H +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/defs.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/defs.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/defs.h +@@ -0,0 +1,171 @@ ++/* ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifndef AVCODEC_DEFS_H ++#define AVCODEC_DEFS_H ++ ++/** ++ * @file ++ * @ingroup libavc ++ * Misc types and constants that do not belong anywhere else. ++ */ ++ ++#include ++#include ++ ++/** ++ * @ingroup lavc_decoding ++ * Required number of additionally allocated bytes at the end of the input ++ * bitstream for decoding. This is mainly needed because some optimized ++ * bitstream readers read 32 or 64 bit at once and could read over the end.
++ * Note: If the first 23 bits of the additional bytes are not 0, then damaged ++ * MPEG bitstreams could cause overread and segfault. ++ */ ++#define AV_INPUT_BUFFER_PADDING_SIZE 64 ++ ++/** ++ * @ingroup lavc_decoding ++ */ ++enum AVDiscard { ++ /* We leave some space between them for extensions (drop some ++ * keyframes for intra-only or drop just some bidir frames). */ ++ AVDISCARD_NONE = -16, ///< discard nothing ++ AVDISCARD_DEFAULT = ++ 0, ///< discard useless packets like 0 size packets in avi ++ AVDISCARD_NONREF = 8, ///< discard all non reference ++ AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames ++ AVDISCARD_NONINTRA = 24, ///< discard all non intra frames ++ AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes ++ AVDISCARD_ALL = 48, ///< discard all ++}; ++ ++enum AVAudioServiceType { ++ AV_AUDIO_SERVICE_TYPE_MAIN = 0, ++ AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, ++ AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, ++ AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, ++ AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, ++ AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, ++ AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, ++ AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, ++ AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, ++ AV_AUDIO_SERVICE_TYPE_NB, ///< Not part of ABI ++}; ++ ++/** ++ * Pan Scan area. ++ * This specifies the area which should be displayed. ++ * Note there may be multiple such areas for one frame. ++ */ ++typedef struct AVPanScan { ++ /** ++ * id ++ * - encoding: Set by user. ++ * - decoding: Set by libavcodec. ++ */ ++ int id; ++ ++ /** ++ * width and height in 1/16 pel ++ * - encoding: Set by user. ++ * - decoding: Set by libavcodec. ++ */ ++ int width; ++ int height; ++ ++ /** ++ * position of the top left corner in 1/16 pel for up to 3 fields/frames ++ * - encoding: Set by user. ++ * - decoding: Set by libavcodec. ++ */ ++ int16_t position[3][2]; ++} AVPanScan; ++ ++/** ++ * This structure describes the bitrate properties of an encoded bitstream. It ++ * roughly corresponds to a subset the VBV parameters for MPEG-2 or HRD ++ * parameters for H.264/HEVC. ++ */ ++typedef struct AVCPBProperties { ++ /** ++ * Maximum bitrate of the stream, in bits per second. ++ * Zero if unknown or unspecified. ++ */ ++ int64_t max_bitrate; ++ /** ++ * Minimum bitrate of the stream, in bits per second. ++ * Zero if unknown or unspecified. ++ */ ++ int64_t min_bitrate; ++ /** ++ * Average bitrate of the stream, in bits per second. ++ * Zero if unknown or unspecified. ++ */ ++ int64_t avg_bitrate; ++ ++ /** ++ * The size of the buffer to which the ratecontrol is applied, in bits. ++ * Zero if unknown or unspecified. ++ */ ++ int64_t buffer_size; ++ ++ /** ++ * The delay between the time the packet this structure is associated with ++ * is received and the time when it should be decoded, in periods of a 27MHz ++ * clock. ++ * ++ * UINT64_MAX when unknown or unspecified. ++ */ ++ uint64_t vbv_delay; ++} AVCPBProperties; ++ ++/** ++ * Allocate a CPB properties structure and initialize its fields to default ++ * values. ++ * ++ * @param size if non-NULL, the size of the allocated struct will be written ++ * here. This is useful for embedding it in side data. ++ * ++ * @return the newly allocated struct or NULL on failure ++ */ ++AVCPBProperties* av_cpb_properties_alloc(size_t* size); ++ ++/** ++ * This structure supplies correlation between a packet timestamp and a wall ++ * clock production time. The definition follows the Producer Reference Time ++ * ('prft') as defined in ISO/IEC 14496-12 ++ */ ++typedef struct AVProducerReferenceTime { ++ /** ++ * A UTC timestamp, in microseconds, since Unix epoch (e.g, av_gettime()). ++ */ ++ int64_t wallclock; ++ int flags; ++} AVProducerReferenceTime; ++ ++/** ++ * Encode extradata length to a buffer. Used by xiph codecs. ++ * ++ * @param s buffer to write to; must be at least (v/255+1) bytes long ++ * @param v size of extradata in bytes ++ * @return number of bytes written to the buffer. ++ */ ++unsigned int av_xiphlacing(unsigned char* s, unsigned int v); ++ ++#endif // AVCODEC_DEFS_H +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/packet.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/packet.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/packet.h +@@ -0,0 +1,724 @@ ++/* ++ * AVPacket public API ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifndef AVCODEC_PACKET_H ++#define AVCODEC_PACKET_H ++ ++#include ++#include ++ ++#include "libavutil/attributes.h" ++#include "libavutil/buffer.h" ++#include "libavutil/dict.h" ++#include "libavutil/rational.h" ++ ++#include "libavcodec/version.h" ++ ++/** ++ * @defgroup lavc_packet AVPacket ++ * ++ * Types and functions for working with AVPacket. ++ * @{ ++ */ ++enum AVPacketSideDataType { ++ /** ++ * An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE ++ * bytes worth of palette. This side data signals that a new palette is ++ * present. ++ */ ++ AV_PKT_DATA_PALETTE, ++ ++ /** ++ * The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format ++ * that the extradata buffer was changed and the receiving side should ++ * act upon it appropriately. The new extradata is embedded in the side ++ * data buffer and should be immediately used for processing the current ++ * frame or packet. ++ */ ++ AV_PKT_DATA_NEW_EXTRADATA, ++ ++ /** ++ * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: ++ * @code ++ * u32le param_flags ++ * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) ++ * s32le channel_count ++ * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) ++ * u64le channel_layout ++ * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) ++ * s32le sample_rate ++ * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) ++ * s32le width ++ * s32le height ++ * @endcode ++ */ ++ AV_PKT_DATA_PARAM_CHANGE, ++ ++ /** ++ * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of ++ * structures with info about macroblocks relevant to splitting the ++ * packet into smaller packets on macroblock edges (e.g. as for RFC 2190). ++ * That is, it does not necessarily contain info about all macroblocks, ++ * as long as the distance between macroblocks in the info is smaller ++ * than the target payload size. ++ * Each MB info structure is 12 bytes, and is laid out as follows: ++ * @code ++ * u32le bit offset from the start of the packet ++ * u8 current quantizer at the start of the macroblock ++ * u8 GOB number ++ * u16le macroblock address within the GOB ++ * u8 horizontal MV predictor ++ * u8 vertical MV predictor ++ * u8 horizontal MV predictor for block number 3 ++ * u8 vertical MV predictor for block number 3 ++ * @endcode ++ */ ++ AV_PKT_DATA_H263_MB_INFO, ++ ++ /** ++ * This side data should be associated with an audio stream and contains ++ * ReplayGain information in form of the AVReplayGain struct. ++ */ ++ AV_PKT_DATA_REPLAYGAIN, ++ ++ /** ++ * This side data contains a 3x3 transformation matrix describing an affine ++ * transformation that needs to be applied to the decoded video frames for ++ * correct presentation. ++ * ++ * See libavutil/display.h for a detailed description of the data. ++ */ ++ AV_PKT_DATA_DISPLAYMATRIX, ++ ++ /** ++ * This side data should be associated with a video stream and contains ++ * Stereoscopic 3D information in form of the AVStereo3D struct. ++ */ ++ AV_PKT_DATA_STEREO3D, ++ ++ /** ++ * This side data should be associated with an audio stream and corresponds ++ * to enum AVAudioServiceType. ++ */ ++ AV_PKT_DATA_AUDIO_SERVICE_TYPE, ++ ++ /** ++ * This side data contains quality related information from the encoder. ++ * @code ++ * u32le quality factor of the compressed frame. Allowed range is between 1 ++ * (good) and FF_LAMBDA_MAX (bad). u8 picture type u8 error count u16 ++ * reserved u64le[error count] sum of squared differences between encoder in ++ * and output ++ * @endcode ++ */ ++ AV_PKT_DATA_QUALITY_STATS, ++ ++ /** ++ * This side data contains an integer value representing the stream index ++ * of a "fallback" track. A fallback track indicates an alternate ++ * track to use when the current track can not be decoded for some reason. ++ * e.g. no decoder available for codec. ++ */ ++ AV_PKT_DATA_FALLBACK_TRACK, ++ ++ /** ++ * This side data corresponds to the AVCPBProperties struct. ++ */ ++ AV_PKT_DATA_CPB_PROPERTIES, ++ ++ /** ++ * Recommmends skipping the specified number of samples ++ * @code ++ * u32le number of samples to skip from start of this packet ++ * u32le number of samples to skip from end of this packet ++ * u8 reason for start skip ++ * u8 reason for end skip (0=padding silence, 1=convergence) ++ * @endcode ++ */ ++ AV_PKT_DATA_SKIP_SAMPLES, ++ ++ /** ++ * An AV_PKT_DATA_JP_DUALMONO side data packet indicates that ++ * the packet may contain "dual mono" audio specific to Japanese DTV ++ * and if it is true, recommends only the selected channel to be used. ++ * @code ++ * u8 selected channels (0=mail/left, 1=sub/right, 2=both) ++ * @endcode ++ */ ++ AV_PKT_DATA_JP_DUALMONO, ++ ++ /** ++ * A list of zero terminated key/value strings. There is no end marker for ++ * the list, so it is required to rely on the side data size to stop. ++ */ ++ AV_PKT_DATA_STRINGS_METADATA, ++ ++ /** ++ * Subtitle event position ++ * @code ++ * u32le x1 ++ * u32le y1 ++ * u32le x2 ++ * u32le y2 ++ * @endcode ++ */ ++ AV_PKT_DATA_SUBTITLE_POSITION, ++ ++ /** ++ * Data found in BlockAdditional element of matroska container. There is ++ * no end marker for the data, so it is required to rely on the side data ++ * size to recognize the end. 8 byte id (as found in BlockAddId) followed ++ * by data. ++ */ ++ AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, ++ ++ /** ++ * The optional first identifier line of a WebVTT cue. ++ */ ++ AV_PKT_DATA_WEBVTT_IDENTIFIER, ++ ++ /** ++ * The optional settings (rendering instructions) that immediately ++ * follow the timestamp specifier of a WebVTT cue. ++ */ ++ AV_PKT_DATA_WEBVTT_SETTINGS, ++ ++ /** ++ * A list of zero terminated key/value strings. There is no end marker for ++ * the list, so it is required to rely on the side data size to stop. This ++ * side data includes updated metadata which appeared in the stream. ++ */ ++ AV_PKT_DATA_METADATA_UPDATE, ++ ++ /** ++ * MPEGTS stream ID as uint8_t, this is required to pass the stream ID ++ * information from the demuxer to the corresponding muxer. ++ */ ++ AV_PKT_DATA_MPEGTS_STREAM_ID, ++ ++ /** ++ * Mastering display metadata (based on SMPTE-2086:2014). This metadata ++ * should be associated with a video stream and contains data in the form ++ * of the AVMasteringDisplayMetadata struct. ++ */ ++ AV_PKT_DATA_MASTERING_DISPLAY_METADATA, ++ ++ /** ++ * This side data should be associated with a video stream and corresponds ++ * to the AVSphericalMapping structure. ++ */ ++ AV_PKT_DATA_SPHERICAL, ++ ++ /** ++ * Content light level (based on CTA-861.3). This metadata should be ++ * associated with a video stream and contains data in the form of the ++ * AVContentLightMetadata struct. ++ */ ++ AV_PKT_DATA_CONTENT_LIGHT_LEVEL, ++ ++ /** ++ * ATSC A53 Part 4 Closed Captions. This metadata should be associated with ++ * a video stream. A53 CC bitstream is stored as uint8_t in ++ * AVPacketSideData.data. The number of bytes of CC data is ++ * AVPacketSideData.size. ++ */ ++ AV_PKT_DATA_A53_CC, ++ ++ /** ++ * This side data is encryption initialization data. ++ * The format is not part of ABI, use av_encryption_init_info_* methods to ++ * access. ++ */ ++ AV_PKT_DATA_ENCRYPTION_INIT_INFO, ++ ++ /** ++ * This side data contains encryption info for how to decrypt the packet. ++ * The format is not part of ABI, use av_encryption_info_* methods to access. ++ */ ++ AV_PKT_DATA_ENCRYPTION_INFO, ++ ++ /** ++ * Active Format Description data consisting of a single byte as specified ++ * in ETSI TS 101 154 using AVActiveFormatDescription enum. ++ */ ++ AV_PKT_DATA_AFD, ++ ++ /** ++ * Producer Reference Time data corresponding to the AVProducerReferenceTime ++ * struct, usually exported by some encoders (on demand through the prft flag ++ * set in the AVCodecContext export_side_data field). ++ */ ++ AV_PKT_DATA_PRFT, ++ ++ /** ++ * ICC profile data consisting of an opaque octet buffer following the ++ * format described by ISO 15076-1. ++ */ ++ AV_PKT_DATA_ICC_PROFILE, ++ ++ /** ++ * DOVI configuration ++ * ref: ++ * dolby-vision-bitstreams-within-the-iso-base-media-file-format-v2.1.2, ++ * section 2.2 ++ * dolby-vision-bitstreams-in-mpeg-2-transport-stream-multiplex-v1.2, ++ * section 3.3 Tags are stored in struct AVDOVIDecoderConfigurationRecord. ++ */ ++ AV_PKT_DATA_DOVI_CONF, ++ ++ /** ++ * Timecode which conforms to SMPTE ST 12-1:2014. The data is an array of 4 ++ * uint32_t where the first uint32_t describes how many (1-3) of the other ++ * timecodes are used. The timecode format is described in the documentation ++ * of av_timecode_get_smpte_from_framenum() function in libavutil/timecode.h. ++ */ ++ AV_PKT_DATA_S12M_TIMECODE, ++ ++ /** ++ * HDR10+ dynamic metadata associated with a video frame. The metadata is in ++ * the form of the AVDynamicHDRPlus struct and contains ++ * information for color volume transform - application 4 of ++ * SMPTE 2094-40:2016 standard. ++ */ ++ AV_PKT_DATA_DYNAMIC_HDR10_PLUS, ++ ++ /** ++ * The number of side data types. ++ * This is not part of the public API/ABI in the sense that it may ++ * change when new side data types are added. ++ * This must stay the last enum value. ++ * If its value becomes huge, some code using it ++ * needs to be updated as it assumes it to be smaller than other limits. ++ */ ++ AV_PKT_DATA_NB ++}; ++ ++#define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS // DEPRECATED ++ ++typedef struct AVPacketSideData { ++ uint8_t* data; ++ size_t size; ++ enum AVPacketSideDataType type; ++} AVPacketSideData; ++ ++/** ++ * This structure stores compressed data. It is typically exported by demuxers ++ * and then passed as input to decoders, or received as output from encoders and ++ * then passed to muxers. ++ * ++ * For video, it should typically contain one compressed frame. For audio it may ++ * contain several compressed frames. Encoders are allowed to output empty ++ * packets, with no compressed data, containing only side data ++ * (e.g. to update some stream parameters at the end of encoding). ++ * ++ * The semantics of data ownership depends on the buf field. ++ * If it is set, the packet data is dynamically allocated and is ++ * valid indefinitely until a call to av_packet_unref() reduces the ++ * reference count to 0. ++ * ++ * If the buf field is not set av_packet_ref() would make a copy instead ++ * of increasing the reference count. ++ * ++ * The side data is always allocated with av_malloc(), copied by ++ * av_packet_ref() and freed by av_packet_unref(). ++ * ++ * sizeof(AVPacket) being a part of the public ABI is deprecated. once ++ * av_init_packet() is removed, new packets will only be able to be allocated ++ * with av_packet_alloc(), and new fields may be added to the end of the struct ++ * with a minor bump. ++ * ++ * @see av_packet_alloc ++ * @see av_packet_ref ++ * @see av_packet_unref ++ */ ++typedef struct AVPacket { ++ /** ++ * A reference to the reference-counted buffer where the packet data is ++ * stored. ++ * May be NULL, then the packet data is not reference-counted. ++ */ ++ AVBufferRef* buf; ++ /** ++ * Presentation timestamp in AVStream->time_base units; the time at which ++ * the decompressed packet will be presented to the user. ++ * Can be AV_NOPTS_VALUE if it is not stored in the file. ++ * pts MUST be larger or equal to dts as presentation cannot happen before ++ * decompression, unless one wants to view hex dumps. Some formats misuse ++ * the terms dts and pts/cts to mean something different. Such timestamps ++ * must be converted to true pts/dts before they are stored in AVPacket. ++ */ ++ int64_t pts; ++ /** ++ * Decompression timestamp in AVStream->time_base units; the time at which ++ * the packet is decompressed. ++ * Can be AV_NOPTS_VALUE if it is not stored in the file. ++ */ ++ int64_t dts; ++ uint8_t* data; ++ int size; ++ int stream_index; ++ /** ++ * A combination of AV_PKT_FLAG values ++ */ ++ int flags; ++ /** ++ * Additional packet data that can be provided by the container. ++ * Packet can contain several types of side information. ++ */ ++ AVPacketSideData* side_data; ++ int side_data_elems; ++ ++ /** ++ * Duration of this packet in AVStream->time_base units, 0 if unknown. ++ * Equals next_pts - this_pts in presentation order. ++ */ ++ int64_t duration; ++ ++ int64_t pos; ///< byte position in stream, -1 if unknown ++ ++ /** ++ * for some private data of the user ++ */ ++ void* opaque; ++ ++ /** ++ * AVBufferRef for free use by the API user. FFmpeg will never check the ++ * contents of the buffer ref. FFmpeg calls av_buffer_unref() on it when ++ * the packet is unreferenced. av_packet_copy_props() calls create a new ++ * reference with av_buffer_ref() for the target packet's opaque_ref field. ++ * ++ * This is unrelated to the opaque field, although it serves a similar ++ * purpose. ++ */ ++ AVBufferRef* opaque_ref; ++ ++ /** ++ * Time base of the packet's timestamps. ++ * In the future, this field may be set on packets output by encoders or ++ * demuxers, but its value will be by default ignored on input to decoders ++ * or muxers. ++ */ ++ AVRational time_base; ++} AVPacket; ++ ++#if FF_API_INIT_PACKET ++attribute_deprecated typedef struct AVPacketList { ++ AVPacket pkt; ++ struct AVPacketList* next; ++} AVPacketList; ++#endif ++ ++#define AV_PKT_FLAG_KEY 0x0001 ///< The packet contains a keyframe ++#define AV_PKT_FLAG_CORRUPT 0x0002 ///< The packet content is corrupted ++/** ++ * Flag is used to discard packets which are required to maintain valid ++ * decoder state but are not required for output and should be dropped ++ * after decoding. ++ **/ ++#define AV_PKT_FLAG_DISCARD 0x0004 ++/** ++ * The packet comes from a trusted source. ++ * ++ * Otherwise-unsafe constructs such as arbitrary pointers to data ++ * outside the packet may be followed. ++ */ ++#define AV_PKT_FLAG_TRUSTED 0x0008 ++/** ++ * Flag is used to indicate packets that contain frames that can ++ * be discarded by the decoder. I.e. Non-reference frames. ++ */ ++#define AV_PKT_FLAG_DISPOSABLE 0x0010 ++ ++enum AVSideDataParamChangeFlags { ++ AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001, ++ AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002, ++ AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004, ++ AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008, ++}; ++ ++/** ++ * Allocate an AVPacket and set its fields to default values. The resulting ++ * struct must be freed using av_packet_free(). ++ * ++ * @return An AVPacket filled with default values or NULL on failure. ++ * ++ * @note this only allocates the AVPacket itself, not the data buffers. Those ++ * must be allocated through other means such as av_new_packet. ++ * ++ * @see av_new_packet ++ */ ++AVPacket* av_packet_alloc(void); ++ ++/** ++ * Create a new packet that references the same data as src. ++ * ++ * This is a shortcut for av_packet_alloc()+av_packet_ref(). ++ * ++ * @return newly created AVPacket on success, NULL on error. ++ * ++ * @see av_packet_alloc ++ * @see av_packet_ref ++ */ ++AVPacket* av_packet_clone(const AVPacket* src); ++ ++/** ++ * Free the packet, if the packet is reference counted, it will be ++ * unreferenced first. ++ * ++ * @param pkt packet to be freed. The pointer will be set to NULL. ++ * @note passing NULL is a no-op. ++ */ ++void av_packet_free(AVPacket** pkt); ++ ++#if FF_API_INIT_PACKET ++/** ++ * Initialize optional fields of a packet with default values. ++ * ++ * Note, this does not touch the data and size members, which have to be ++ * initialized separately. ++ * ++ * @param pkt packet ++ * ++ * @see av_packet_alloc ++ * @see av_packet_unref ++ * ++ * @deprecated This function is deprecated. Once it's removed, ++ sizeof(AVPacket) will not be a part of the ABI anymore. ++ */ ++attribute_deprecated void av_init_packet(AVPacket* pkt); ++#endif ++ ++/** ++ * Allocate the payload of a packet and initialize its fields with ++ * default values. ++ * ++ * @param pkt packet ++ * @param size wanted payload size ++ * @return 0 if OK, AVERROR_xxx otherwise ++ */ ++int av_new_packet(AVPacket* pkt, int size); ++ ++/** ++ * Reduce packet size, correctly zeroing padding ++ * ++ * @param pkt packet ++ * @param size new size ++ */ ++void av_shrink_packet(AVPacket* pkt, int size); ++ ++/** ++ * Increase packet size, correctly zeroing padding ++ * ++ * @param pkt packet ++ * @param grow_by number of bytes by which to increase the size of the packet ++ */ ++int av_grow_packet(AVPacket* pkt, int grow_by); ++ ++/** ++ * Initialize a reference-counted packet from av_malloc()ed data. ++ * ++ * @param pkt packet to be initialized. This function will set the data, size, ++ * and buf fields, all others are left untouched. ++ * @param data Data allocated by av_malloc() to be used as packet data. If this ++ * function returns successfully, the data is owned by the underlying ++ * AVBuffer. The caller may not access the data through other means. ++ * @param size size of data in bytes, without the padding. I.e. the full buffer ++ * size is assumed to be size + AV_INPUT_BUFFER_PADDING_SIZE. ++ * ++ * @return 0 on success, a negative AVERROR on error ++ */ ++int av_packet_from_data(AVPacket* pkt, uint8_t* data, int size); ++ ++/** ++ * Allocate new information of a packet. ++ * ++ * @param pkt packet ++ * @param type side information type ++ * @param size side information size ++ * @return pointer to fresh allocated data or NULL otherwise ++ */ ++uint8_t* av_packet_new_side_data(AVPacket* pkt, enum AVPacketSideDataType type, ++ size_t size); ++ ++/** ++ * Wrap an existing array as a packet side data. ++ * ++ * @param pkt packet ++ * @param type side information type ++ * @param data the side data array. It must be allocated with the av_malloc() ++ * family of functions. The ownership of the data is transferred to ++ * pkt. ++ * @param size side information size ++ * @return a non-negative number on success, a negative AVERROR code on ++ * failure. On failure, the packet is unchanged and the data remains ++ * owned by the caller. ++ */ ++int av_packet_add_side_data(AVPacket* pkt, enum AVPacketSideDataType type, ++ uint8_t* data, size_t size); ++ ++/** ++ * Shrink the already allocated side data buffer ++ * ++ * @param pkt packet ++ * @param type side information type ++ * @param size new side information size ++ * @return 0 on success, < 0 on failure ++ */ ++int av_packet_shrink_side_data(AVPacket* pkt, enum AVPacketSideDataType type, ++ size_t size); ++ ++/** ++ * Get side information from packet. ++ * ++ * @param pkt packet ++ * @param type desired side information type ++ * @param size If supplied, *size will be set to the size of the side data ++ * or to zero if the desired side data is not present. ++ * @return pointer to data if present or NULL otherwise ++ */ ++uint8_t* av_packet_get_side_data(const AVPacket* pkt, ++ enum AVPacketSideDataType type, size_t* size); ++ ++const char* av_packet_side_data_name(enum AVPacketSideDataType type); ++ ++/** ++ * Pack a dictionary for use in side_data. ++ * ++ * @param dict The dictionary to pack. ++ * @param size pointer to store the size of the returned data ++ * @return pointer to data if successful, NULL otherwise ++ */ ++uint8_t* av_packet_pack_dictionary(AVDictionary* dict, size_t* size); ++/** ++ * Unpack a dictionary from side_data. ++ * ++ * @param data data from side_data ++ * @param size size of the data ++ * @param dict the metadata storage dictionary ++ * @return 0 on success, < 0 on failure ++ */ ++int av_packet_unpack_dictionary(const uint8_t* data, size_t size, ++ AVDictionary** dict); ++ ++/** ++ * Convenience function to free all the side data stored. ++ * All the other fields stay untouched. ++ * ++ * @param pkt packet ++ */ ++void av_packet_free_side_data(AVPacket* pkt); ++ ++/** ++ * Setup a new reference to the data described by a given packet ++ * ++ * If src is reference-counted, setup dst as a new reference to the ++ * buffer in src. Otherwise allocate a new buffer in dst and copy the ++ * data from src into it. ++ * ++ * All the other fields are copied from src. ++ * ++ * @see av_packet_unref ++ * ++ * @param dst Destination packet. Will be completely overwritten. ++ * @param src Source packet ++ * ++ * @return 0 on success, a negative AVERROR on error. On error, dst ++ * will be blank (as if returned by av_packet_alloc()). ++ */ ++int av_packet_ref(AVPacket* dst, const AVPacket* src); ++ ++/** ++ * Wipe the packet. ++ * ++ * Unreference the buffer referenced by the packet and reset the ++ * remaining packet fields to their default values. ++ * ++ * @param pkt The packet to be unreferenced. ++ */ ++void av_packet_unref(AVPacket* pkt); ++ ++/** ++ * Move every field in src to dst and reset src. ++ * ++ * @see av_packet_unref ++ * ++ * @param src Source packet, will be reset ++ * @param dst Destination packet ++ */ ++void av_packet_move_ref(AVPacket* dst, AVPacket* src); ++ ++/** ++ * Copy only "properties" fields from src to dst. ++ * ++ * Properties for the purpose of this function are all the fields ++ * beside those related to the packet data (buf, data, size) ++ * ++ * @param dst Destination packet ++ * @param src Source packet ++ * ++ * @return 0 on success AVERROR on failure. ++ */ ++int av_packet_copy_props(AVPacket* dst, const AVPacket* src); ++ ++/** ++ * Ensure the data described by a given packet is reference counted. ++ * ++ * @note This function does not ensure that the reference will be writable. ++ * Use av_packet_make_writable instead for that purpose. ++ * ++ * @see av_packet_ref ++ * @see av_packet_make_writable ++ * ++ * @param pkt packet whose data should be made reference counted. ++ * ++ * @return 0 on success, a negative AVERROR on error. On failure, the ++ * packet is unchanged. ++ */ ++int av_packet_make_refcounted(AVPacket* pkt); ++ ++/** ++ * Create a writable reference for the data described by a given packet, ++ * avoiding data copy if possible. ++ * ++ * @param pkt Packet whose data should be made writable. ++ * ++ * @return 0 on success, a negative AVERROR on failure. On failure, the ++ * packet is unchanged. ++ */ ++int av_packet_make_writable(AVPacket* pkt); ++ ++/** ++ * Convert valid timing fields (timestamps / durations) in a packet from one ++ * timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be ++ * ignored. ++ * ++ * @param pkt packet on which the conversion will be performed ++ * @param tb_src source timebase, in which the timing fields in pkt are ++ * expressed ++ * @param tb_dst destination timebase, to which the timing fields will be ++ * converted ++ */ ++void av_packet_rescale_ts(AVPacket* pkt, AVRational tb_src, AVRational tb_dst); ++ ++/** ++ * @} ++ */ ++ ++#endif // AVCODEC_PACKET_H +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/vdpau.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/vdpau.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/vdpau.h +@@ -0,0 +1,156 @@ ++/* ++ * The Video Decode and Presentation API for UNIX (VDPAU) is used for ++ * hardware-accelerated decoding of MPEG-1/2, H.264 and VC-1. ++ * ++ * Copyright (C) 2008 NVIDIA ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifndef AVCODEC_VDPAU_H ++#define AVCODEC_VDPAU_H ++ ++/** ++ * @file ++ * @ingroup lavc_codec_hwaccel_vdpau ++ * Public libavcodec VDPAU header. ++ */ ++ ++/** ++ * @defgroup lavc_codec_hwaccel_vdpau VDPAU Decoder and Renderer ++ * @ingroup lavc_codec_hwaccel ++ * ++ * VDPAU hardware acceleration has two modules ++ * - VDPAU decoding ++ * - VDPAU presentation ++ * ++ * The VDPAU decoding module parses all headers using FFmpeg ++ * parsing mechanisms and uses VDPAU for the actual decoding. ++ * ++ * As per the current implementation, the actual decoding ++ * and rendering (API calls) are done as part of the VDPAU ++ * presentation (vo_vdpau.c) module. ++ * ++ * @{ ++ */ ++ ++#include ++ ++#include "libavutil/avconfig.h" ++#include "libavutil/attributes.h" ++ ++#include "avcodec.h" ++ ++struct AVCodecContext; ++struct AVFrame; ++ ++typedef int (*AVVDPAU_Render2)(struct AVCodecContext*, struct AVFrame*, ++ const VdpPictureInfo*, uint32_t, ++ const VdpBitstreamBuffer*); ++ ++/** ++ * This structure is used to share data between the libavcodec library and ++ * the client video application. ++ * The user shall allocate the structure via the av_alloc_vdpau_hwaccel ++ * function and make it available as ++ * AVCodecContext.hwaccel_context. Members can be set by the user once ++ * during initialization or through each AVCodecContext.get_buffer() ++ * function call. In any case, they must be valid prior to calling ++ * decoding functions. ++ * ++ * The size of this structure is not a part of the public ABI and must not ++ * be used outside of libavcodec. Use av_vdpau_alloc_context() to allocate an ++ * AVVDPAUContext. ++ */ ++typedef struct AVVDPAUContext { ++ /** ++ * VDPAU decoder handle ++ * ++ * Set by user. ++ */ ++ VdpDecoder decoder; ++ ++ /** ++ * VDPAU decoder render callback ++ * ++ * Set by the user. ++ */ ++ VdpDecoderRender* render; ++ ++ AVVDPAU_Render2 render2; ++} AVVDPAUContext; ++ ++/** ++ * @brief allocation function for AVVDPAUContext ++ * ++ * Allows extending the struct without breaking API/ABI ++ */ ++AVVDPAUContext* av_alloc_vdpaucontext(void); ++ ++AVVDPAU_Render2 av_vdpau_hwaccel_get_render2(const AVVDPAUContext*); ++void av_vdpau_hwaccel_set_render2(AVVDPAUContext*, AVVDPAU_Render2); ++ ++/** ++ * Associate a VDPAU device with a codec context for hardware acceleration. ++ * This function is meant to be called from the get_format() codec callback, ++ * or earlier. It can also be called after avcodec_flush_buffers() to change ++ * the underlying VDPAU device mid-stream (e.g. to recover from non-transparent ++ * display preemption). ++ * ++ * @note get_format() must return AV_PIX_FMT_VDPAU if this function completes ++ * successfully. ++ * ++ * @param avctx decoding context whose get_format() callback is invoked ++ * @param device VDPAU device handle to use for hardware acceleration ++ * @param get_proc_address VDPAU device driver ++ * @param flags zero of more OR'd AV_HWACCEL_FLAG_* flags ++ * ++ * @return 0 on success, an AVERROR code on failure. ++ */ ++int av_vdpau_bind_context(AVCodecContext* avctx, VdpDevice device, ++ VdpGetProcAddress* get_proc_address, unsigned flags); ++ ++/** ++ * Gets the parameters to create an adequate VDPAU video surface for the codec ++ * context using VDPAU hardware decoding acceleration. ++ * ++ * @note Behavior is undefined if the context was not successfully bound to a ++ * VDPAU device using av_vdpau_bind_context(). ++ * ++ * @param avctx the codec context being used for decoding the stream ++ * @param type storage space for the VDPAU video surface chroma type ++ * (or NULL to ignore) ++ * @param width storage space for the VDPAU video surface pixel width ++ * (or NULL to ignore) ++ * @param height storage space for the VDPAU video surface pixel height ++ * (or NULL to ignore) ++ * ++ * @return 0 on success, a negative AVERROR code on failure. ++ */ ++int av_vdpau_get_surface_parameters(AVCodecContext* avctx, VdpChromaType* type, ++ uint32_t* width, uint32_t* height); ++ ++/** ++ * Allocate an AVVDPAUContext. ++ * ++ * @return Newly-allocated AVVDPAUContext or NULL on failure. ++ */ ++AVVDPAUContext* av_vdpau_alloc_context(void); ++ ++/* @}*/ ++ ++#endif /* AVCODEC_VDPAU_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/version.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/version.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/version.h +@@ -0,0 +1,67 @@ ++/* ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifndef AVCODEC_VERSION_H ++#define AVCODEC_VERSION_H ++ ++/** ++ * @file ++ * @ingroup libavc ++ * Libavcodec version macros. ++ */ ++ ++#include "libavutil/version.h" ++ ++#define LIBAVCODEC_VERSION_MAJOR 59 ++#define LIBAVCODEC_VERSION_MINOR 18 ++#define LIBAVCODEC_VERSION_MICRO 100 ++ ++#define LIBAVCODEC_VERSION_INT \ ++ AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, LIBAVCODEC_VERSION_MINOR, \ ++ LIBAVCODEC_VERSION_MICRO) ++#define LIBAVCODEC_VERSION \ ++ AV_VERSION(LIBAVCODEC_VERSION_MAJOR, LIBAVCODEC_VERSION_MINOR, \ ++ LIBAVCODEC_VERSION_MICRO) ++#define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT ++ ++#define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION) ++ ++/** ++ * FF_API_* defines may be placed below to indicate public API that will be ++ * dropped at a future version bump. The defines themselves are not part of ++ * the public API and may change, break or disappear at any time. ++ * ++ * @note, when bumping the major version it is recommended to manually ++ * disable each FF_API_* in its own commit instead of disabling them all ++ * at once through the bump. This improves the git bisect-ability of the change. ++ */ ++ ++#define FF_API_OPENH264_SLICE_MODE (LIBAVCODEC_VERSION_MAJOR < 60) ++#define FF_API_OPENH264_CABAC (LIBAVCODEC_VERSION_MAJOR < 60) ++#define FF_API_UNUSED_CODEC_CAPS (LIBAVCODEC_VERSION_MAJOR < 60) ++#define FF_API_THREAD_SAFE_CALLBACKS (LIBAVCODEC_VERSION_MAJOR < 60) ++#define FF_API_DEBUG_MV (LIBAVCODEC_VERSION_MAJOR < 60) ++#define FF_API_GET_FRAME_CLASS (LIBAVCODEC_VERSION_MAJOR < 60) ++#define FF_API_AUTO_THREADS (LIBAVCODEC_VERSION_MAJOR < 60) ++#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 60) ++#define FF_API_AVCTX_TIMEBASE (LIBAVCODEC_VERSION_MAJOR < 60) ++#define FF_API_MPEGVIDEO_OPTS (LIBAVCODEC_VERSION_MAJOR < 60) ++#define FF_API_FLAG_TRUNCATED (LIBAVCODEC_VERSION_MAJOR < 60) ++#define FF_API_SUB_TEXT_FORMAT (LIBAVCODEC_VERSION_MAJOR < 60) ++ ++#endif /* AVCODEC_VERSION_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/attributes.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/attributes.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/attributes.h +@@ -0,0 +1,173 @@ ++/* ++ * copyright (c) 2006 Michael Niedermayer ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++/** ++ * @file ++ * Macro definitions for various function/variable attributes ++ */ ++ ++#ifndef AVUTIL_ATTRIBUTES_H ++#define AVUTIL_ATTRIBUTES_H ++ ++#ifdef __GNUC__ ++# define AV_GCC_VERSION_AT_LEAST(x, y) \ ++ (__GNUC__ > (x) || __GNUC__ == (x) && __GNUC_MINOR__ >= (y)) ++# define AV_GCC_VERSION_AT_MOST(x, y) \ ++ (__GNUC__ < (x) || __GNUC__ == (x) && __GNUC_MINOR__ <= (y)) ++#else ++# define AV_GCC_VERSION_AT_LEAST(x, y) 0 ++# define AV_GCC_VERSION_AT_MOST(x, y) 0 ++#endif ++ ++#ifdef __has_builtin ++# define AV_HAS_BUILTIN(x) __has_builtin(x) ++#else ++# define AV_HAS_BUILTIN(x) 0 ++#endif ++ ++#ifndef av_always_inline ++# if AV_GCC_VERSION_AT_LEAST(3, 1) ++# define av_always_inline __attribute__((always_inline)) inline ++# elif defined(_MSC_VER) ++# define av_always_inline __forceinline ++# else ++# define av_always_inline inline ++# endif ++#endif ++ ++#ifndef av_extern_inline ++# if defined(__ICL) && __ICL >= 1210 || defined(__GNUC_STDC_INLINE__) ++# define av_extern_inline extern inline ++# else ++# define av_extern_inline inline ++# endif ++#endif ++ ++#if AV_GCC_VERSION_AT_LEAST(3, 4) ++# define av_warn_unused_result __attribute__((warn_unused_result)) ++#else ++# define av_warn_unused_result ++#endif ++ ++#if AV_GCC_VERSION_AT_LEAST(3, 1) ++# define av_noinline __attribute__((noinline)) ++#elif defined(_MSC_VER) ++# define av_noinline __declspec(noinline) ++#else ++# define av_noinline ++#endif ++ ++#if AV_GCC_VERSION_AT_LEAST(3, 1) || defined(__clang__) ++# define av_pure __attribute__((pure)) ++#else ++# define av_pure ++#endif ++ ++#if AV_GCC_VERSION_AT_LEAST(2, 6) || defined(__clang__) ++# define av_const __attribute__((const)) ++#else ++# define av_const ++#endif ++ ++#if AV_GCC_VERSION_AT_LEAST(4, 3) || defined(__clang__) ++# define av_cold __attribute__((cold)) ++#else ++# define av_cold ++#endif ++ ++#if AV_GCC_VERSION_AT_LEAST(4, 1) && !defined(__llvm__) ++# define av_flatten __attribute__((flatten)) ++#else ++# define av_flatten ++#endif ++ ++#if AV_GCC_VERSION_AT_LEAST(3, 1) ++# define attribute_deprecated __attribute__((deprecated)) ++#elif defined(_MSC_VER) ++# define attribute_deprecated __declspec(deprecated) ++#else ++# define attribute_deprecated ++#endif ++ ++/** ++ * Disable warnings about deprecated features ++ * This is useful for sections of code kept for backward compatibility and ++ * scheduled for removal. ++ */ ++#ifndef AV_NOWARN_DEPRECATED ++# if AV_GCC_VERSION_AT_LEAST(4, 6) ++# define AV_NOWARN_DEPRECATED(code) \ ++ _Pragma("GCC diagnostic push") \ ++ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \ ++ code _Pragma("GCC diagnostic pop") ++# elif defined(_MSC_VER) ++# define AV_NOWARN_DEPRECATED(code) \ ++ __pragma(warning(push)) __pragma(warning(disable : 4996)) code; \ ++ __pragma(warning(pop)) ++# else ++# define AV_NOWARN_DEPRECATED(code) code ++# endif ++#endif ++ ++#if defined(__GNUC__) || defined(__clang__) ++# define av_unused __attribute__((unused)) ++#else ++# define av_unused ++#endif ++ ++/** ++ * Mark a variable as used and prevent the compiler from optimizing it ++ * away. This is useful for variables accessed only from inline ++ * assembler without the compiler being aware. ++ */ ++#if AV_GCC_VERSION_AT_LEAST(3, 1) || defined(__clang__) ++# define av_used __attribute__((used)) ++#else ++# define av_used ++#endif ++ ++#if AV_GCC_VERSION_AT_LEAST(3, 3) || defined(__clang__) ++# define av_alias __attribute__((may_alias)) ++#else ++# define av_alias ++#endif ++ ++#if (defined(__GNUC__) || defined(__clang__)) && !defined(__INTEL_COMPILER) ++# define av_uninit(x) x = x ++#else ++# define av_uninit(x) x ++#endif ++ ++#if defined(__GNUC__) || defined(__clang__) ++# define av_builtin_constant_p __builtin_constant_p ++# define av_printf_format(fmtpos, attrpos) \ ++ __attribute__((__format__(__printf__, fmtpos, attrpos))) ++#else ++# define av_builtin_constant_p(x) 0 ++# define av_printf_format(fmtpos, attrpos) ++#endif ++ ++#if AV_GCC_VERSION_AT_LEAST(2, 5) || defined(__clang__) ++# define av_noreturn __attribute__((noreturn)) ++#else ++# define av_noreturn ++#endif ++ ++#endif /* AVUTIL_ATTRIBUTES_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/avconfig.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/avconfig.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/avconfig.h +@@ -0,0 +1,6 @@ ++/* Generated by ffmpeg configure */ ++#ifndef AVUTIL_AVCONFIG_H ++#define AVUTIL_AVCONFIG_H ++#define AV_HAVE_BIGENDIAN 0 ++#define AV_HAVE_FAST_UNALIGNED 1 ++#endif /* AVUTIL_AVCONFIG_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/avutil.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/avutil.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/avutil.h +@@ -0,0 +1,366 @@ ++/* ++ * copyright (c) 2006 Michael Niedermayer ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifndef AVUTIL_AVUTIL_H ++#define AVUTIL_AVUTIL_H ++ ++/** ++ * @file ++ * @ingroup lavu ++ * Convenience header that includes @ref lavu "libavutil"'s core. ++ */ ++ ++/** ++ * @mainpage ++ * ++ * @section ffmpeg_intro Introduction ++ * ++ * This document describes the usage of the different libraries ++ * provided by FFmpeg. ++ * ++ * @li @ref libavc "libavcodec" encoding/decoding library ++ * @li @ref lavfi "libavfilter" graph-based frame editing library ++ * @li @ref libavf "libavformat" I/O and muxing/demuxing library ++ * @li @ref lavd "libavdevice" special devices muxing/demuxing library ++ * @li @ref lavu "libavutil" common utility library ++ * @li @ref lswr "libswresample" audio resampling, format conversion and mixing ++ * @li @ref lpp "libpostproc" post processing library ++ * @li @ref libsws "libswscale" color conversion and scaling library ++ * ++ * @section ffmpeg_versioning Versioning and compatibility ++ * ++ * Each of the FFmpeg libraries contains a version.h header, which defines a ++ * major, minor and micro version number with the ++ * LIBRARYNAME_VERSION_{MAJOR,MINOR,MICRO} macros. The major version ++ * number is incremented with backward incompatible changes - e.g. removing ++ * parts of the public API, reordering public struct members, etc. The minor ++ * version number is incremented for backward compatible API changes or major ++ * new features - e.g. adding a new public function or a new decoder. The micro ++ * version number is incremented for smaller changes that a calling program ++ * might still want to check for - e.g. changing behavior in a previously ++ * unspecified situation. ++ * ++ * FFmpeg guarantees backward API and ABI compatibility for each library as long ++ * as its major version number is unchanged. This means that no public symbols ++ * will be removed or renamed. Types and names of the public struct members and ++ * values of public macros and enums will remain the same (unless they were ++ * explicitly declared as not part of the public API). Documented behavior will ++ * not change. ++ * ++ * In other words, any correct program that works with a given FFmpeg snapshot ++ * should work just as well without any changes with any later snapshot with the ++ * same major versions. This applies to both rebuilding the program against new ++ * FFmpeg versions or to replacing the dynamic FFmpeg libraries that a program ++ * links against. ++ * ++ * However, new public symbols may be added and new members may be appended to ++ * public structs whose size is not part of public ABI (most public structs in ++ * FFmpeg). New macros and enum values may be added. Behavior in undocumented ++ * situations may change slightly (and be documented). All those are accompanied ++ * by an entry in doc/APIchanges and incrementing either the minor or micro ++ * version number. ++ */ ++ ++/** ++ * @defgroup lavu libavutil ++ * Common code shared across all FFmpeg libraries. ++ * ++ * @note ++ * libavutil is designed to be modular. In most cases, in order to use the ++ * functions provided by one component of libavutil you must explicitly include ++ * the specific header containing that feature. If you are only using ++ * media-related components, you could simply include libavutil/avutil.h, which ++ * brings in most of the "core" components. ++ * ++ * @{ ++ * ++ * @defgroup lavu_crypto Crypto and Hashing ++ * ++ * @{ ++ * @} ++ * ++ * @defgroup lavu_math Mathematics ++ * @{ ++ * ++ * @} ++ * ++ * @defgroup lavu_string String Manipulation ++ * ++ * @{ ++ * ++ * @} ++ * ++ * @defgroup lavu_mem Memory Management ++ * ++ * @{ ++ * ++ * @} ++ * ++ * @defgroup lavu_data Data Structures ++ * @{ ++ * ++ * @} ++ * ++ * @defgroup lavu_video Video related ++ * ++ * @{ ++ * ++ * @} ++ * ++ * @defgroup lavu_audio Audio related ++ * ++ * @{ ++ * ++ * @} ++ * ++ * @defgroup lavu_error Error Codes ++ * ++ * @{ ++ * ++ * @} ++ * ++ * @defgroup lavu_log Logging Facility ++ * ++ * @{ ++ * ++ * @} ++ * ++ * @defgroup lavu_misc Other ++ * ++ * @{ ++ * ++ * @defgroup preproc_misc Preprocessor String Macros ++ * ++ * @{ ++ * ++ * @} ++ * ++ * @defgroup version_utils Library Version Macros ++ * ++ * @{ ++ * ++ * @} ++ */ ++ ++/** ++ * @addtogroup lavu_ver ++ * @{ ++ */ ++ ++/** ++ * Return the LIBAVUTIL_VERSION_INT constant. ++ */ ++unsigned avutil_version(void); ++ ++/** ++ * Return an informative version string. This usually is the actual release ++ * version number or a git commit description. This string has no fixed format ++ * and can change any time. It should never be parsed by code. ++ */ ++const char* av_version_info(void); ++ ++/** ++ * Return the libavutil build-time configuration. ++ */ ++const char* avutil_configuration(void); ++ ++/** ++ * Return the libavutil license. ++ */ ++const char* avutil_license(void); ++ ++/** ++ * @} ++ */ ++ ++/** ++ * @addtogroup lavu_media Media Type ++ * @brief Media Type ++ */ ++ ++enum AVMediaType { ++ AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA ++ AVMEDIA_TYPE_VIDEO, ++ AVMEDIA_TYPE_AUDIO, ++ AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous ++ AVMEDIA_TYPE_SUBTITLE, ++ AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse ++ AVMEDIA_TYPE_NB ++}; ++ ++/** ++ * Return a string describing the media_type enum, NULL if media_type ++ * is unknown. ++ */ ++const char* av_get_media_type_string(enum AVMediaType media_type); ++ ++/** ++ * @defgroup lavu_const Constants ++ * @{ ++ * ++ * @defgroup lavu_enc Encoding specific ++ * ++ * @note those definition should move to avcodec ++ * @{ ++ */ ++ ++#define FF_LAMBDA_SHIFT 7 ++#define FF_LAMBDA_SCALE (1 << FF_LAMBDA_SHIFT) ++#define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda ++#define FF_LAMBDA_MAX (256 * 128 - 1) ++ ++#define FF_QUALITY_SCALE FF_LAMBDA_SCALE // FIXME maybe remove ++ ++/** ++ * @} ++ * @defgroup lavu_time Timestamp specific ++ * ++ * FFmpeg internal timebase and timestamp definitions ++ * ++ * @{ ++ */ ++ ++/** ++ * @brief Undefined timestamp value ++ * ++ * Usually reported by demuxer that work on containers that do not provide ++ * either pts or dts. ++ */ ++ ++#define AV_NOPTS_VALUE ((int64_t)UINT64_C(0x8000000000000000)) ++ ++/** ++ * Internal time base represented as integer ++ */ ++ ++#define AV_TIME_BASE 1000000 ++ ++/** ++ * Internal time base represented as fractional value ++ */ ++ ++#define AV_TIME_BASE_Q \ ++ (AVRational) { 1, AV_TIME_BASE } ++ ++/** ++ * @} ++ * @} ++ * @defgroup lavu_picture Image related ++ * ++ * AVPicture types, pixel formats and basic image planes manipulation. ++ * ++ * @{ ++ */ ++ ++enum AVPictureType { ++ AV_PICTURE_TYPE_NONE = 0, ///< Undefined ++ AV_PICTURE_TYPE_I, ///< Intra ++ AV_PICTURE_TYPE_P, ///< Predicted ++ AV_PICTURE_TYPE_B, ///< Bi-dir predicted ++ AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG-4 ++ AV_PICTURE_TYPE_SI, ///< Switching Intra ++ AV_PICTURE_TYPE_SP, ///< Switching Predicted ++ AV_PICTURE_TYPE_BI, ///< BI type ++}; ++ ++/** ++ * Return a single letter to describe the given picture type ++ * pict_type. ++ * ++ * @param[in] pict_type the picture type @return a single character ++ * representing the picture type, '?' if pict_type is unknown ++ */ ++char av_get_picture_type_char(enum AVPictureType pict_type); ++ ++/** ++ * @} ++ */ ++ ++#include "common.h" ++#include "error.h" ++#include "rational.h" ++#include "version.h" ++#include "macros.h" ++#include "mathematics.h" ++#include "log.h" ++#include "pixfmt.h" ++ ++/** ++ * Return x default pointer in case p is NULL. ++ */ ++static inline void* av_x_if_null(const void* p, const void* x) { ++ return (void*)(intptr_t)(p ? p : x); ++} ++ ++/** ++ * Compute the length of an integer list. ++ * ++ * @param elsize size in bytes of each list element (only 1, 2, 4 or 8) ++ * @param term list terminator (usually 0 or -1) ++ * @param list pointer to the list ++ * @return length of the list, in elements, not counting the terminator ++ */ ++unsigned av_int_list_length_for_size(unsigned elsize, const void* list, ++ uint64_t term) av_pure; ++ ++/** ++ * Compute the length of an integer list. ++ * ++ * @param term list terminator (usually 0 or -1) ++ * @param list pointer to the list ++ * @return length of the list, in elements, not counting the terminator ++ */ ++#define av_int_list_length(list, term) \ ++ av_int_list_length_for_size(sizeof(*(list)), list, term) ++ ++/** ++ * Open a file using a UTF-8 filename. ++ * The API of this function matches POSIX fopen(), errors are returned through ++ * errno. ++ */ ++FILE* av_fopen_utf8(const char* path, const char* mode); ++ ++/** ++ * Return the fractional representation of the internal time base. ++ */ ++AVRational av_get_time_base_q(void); ++ ++#define AV_FOURCC_MAX_STRING_SIZE 32 ++ ++#define av_fourcc2str(fourcc) \ ++ av_fourcc_make_string((char[AV_FOURCC_MAX_STRING_SIZE]){0}, fourcc) ++ ++/** ++ * Fill the provided buffer with a string containing a FourCC (four-character ++ * code) representation. ++ * ++ * @param buf a buffer with size in bytes of at least ++ * AV_FOURCC_MAX_STRING_SIZE ++ * @param fourcc the fourcc to represent ++ * @return the buffer in input ++ */ ++char* av_fourcc_make_string(char* buf, uint32_t fourcc); ++ ++/** ++ * @} ++ * @} ++ */ ++ ++#endif /* AVUTIL_AVUTIL_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/buffer.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/buffer.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/buffer.h +@@ -0,0 +1,324 @@ ++/* ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++/** ++ * @file ++ * @ingroup lavu_buffer ++ * refcounted data buffer API ++ */ ++ ++#ifndef AVUTIL_BUFFER_H ++#define AVUTIL_BUFFER_H ++ ++#include ++#include ++ ++/** ++ * @defgroup lavu_buffer AVBuffer ++ * @ingroup lavu_data ++ * ++ * @{ ++ * AVBuffer is an API for reference-counted data buffers. ++ * ++ * There are two core objects in this API -- AVBuffer and AVBufferRef. AVBuffer ++ * represents the data buffer itself; it is opaque and not meant to be accessed ++ * by the caller directly, but only through AVBufferRef. However, the caller may ++ * e.g. compare two AVBuffer pointers to check whether two different references ++ * are describing the same data buffer. AVBufferRef represents a single ++ * reference to an AVBuffer and it is the object that may be manipulated by the ++ * caller directly. ++ * ++ * There are two functions provided for creating a new AVBuffer with a single ++ * reference -- av_buffer_alloc() to just allocate a new buffer, and ++ * av_buffer_create() to wrap an existing array in an AVBuffer. From an existing ++ * reference, additional references may be created with av_buffer_ref(). ++ * Use av_buffer_unref() to free a reference (this will automatically free the ++ * data once all the references are freed). ++ * ++ * The convention throughout this API and the rest of FFmpeg is such that the ++ * buffer is considered writable if there exists only one reference to it (and ++ * it has not been marked as read-only). The av_buffer_is_writable() function is ++ * provided to check whether this is true and av_buffer_make_writable() will ++ * automatically create a new writable buffer when necessary. ++ * Of course nothing prevents the calling code from violating this convention, ++ * however that is safe only when all the existing references are under its ++ * control. ++ * ++ * @note Referencing and unreferencing the buffers is thread-safe and thus ++ * may be done from multiple threads simultaneously without any need for ++ * additional locking. ++ * ++ * @note Two different references to the same buffer can point to different ++ * parts of the buffer (i.e. their AVBufferRef.data will not be equal). ++ */ ++ ++/** ++ * A reference counted buffer type. It is opaque and is meant to be used through ++ * references (AVBufferRef). ++ */ ++typedef struct AVBuffer AVBuffer; ++ ++/** ++ * A reference to a data buffer. ++ * ++ * The size of this struct is not a part of the public ABI and it is not meant ++ * to be allocated directly. ++ */ ++typedef struct AVBufferRef { ++ AVBuffer* buffer; ++ ++ /** ++ * The data buffer. It is considered writable if and only if ++ * this is the only reference to the buffer, in which case ++ * av_buffer_is_writable() returns 1. ++ */ ++ uint8_t* data; ++ /** ++ * Size of data in bytes. ++ */ ++ size_t size; ++} AVBufferRef; ++ ++/** ++ * Allocate an AVBuffer of the given size using av_malloc(). ++ * ++ * @return an AVBufferRef of given size or NULL when out of memory ++ */ ++AVBufferRef* av_buffer_alloc(size_t size); ++ ++/** ++ * Same as av_buffer_alloc(), except the returned buffer will be initialized ++ * to zero. ++ */ ++AVBufferRef* av_buffer_allocz(size_t size); ++ ++/** ++ * Always treat the buffer as read-only, even when it has only one ++ * reference. ++ */ ++#define AV_BUFFER_FLAG_READONLY (1 << 0) ++ ++/** ++ * Create an AVBuffer from an existing array. ++ * ++ * If this function is successful, data is owned by the AVBuffer. The caller may ++ * only access data through the returned AVBufferRef and references derived from ++ * it. ++ * If this function fails, data is left untouched. ++ * @param data data array ++ * @param size size of data in bytes ++ * @param free a callback for freeing this buffer's data ++ * @param opaque parameter to be got for processing or passed to free ++ * @param flags a combination of AV_BUFFER_FLAG_* ++ * ++ * @return an AVBufferRef referring to data on success, NULL on failure. ++ */ ++AVBufferRef* av_buffer_create(uint8_t* data, size_t size, ++ void (*free)(void* opaque, uint8_t* data), ++ void* opaque, int flags); ++ ++/** ++ * Default free callback, which calls av_free() on the buffer data. ++ * This function is meant to be passed to av_buffer_create(), not called ++ * directly. ++ */ ++void av_buffer_default_free(void* opaque, uint8_t* data); ++ ++/** ++ * Create a new reference to an AVBuffer. ++ * ++ * @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on ++ * failure. ++ */ ++AVBufferRef* av_buffer_ref(const AVBufferRef* buf); ++ ++/** ++ * Free a given reference and automatically free the buffer if there are no more ++ * references to it. ++ * ++ * @param buf the reference to be freed. The pointer is set to NULL on return. ++ */ ++void av_buffer_unref(AVBufferRef** buf); ++ ++/** ++ * @return 1 if the caller may write to the data referred to by buf (which is ++ * true if and only if buf is the only reference to the underlying AVBuffer). ++ * Return 0 otherwise. ++ * A positive answer is valid until av_buffer_ref() is called on buf. ++ */ ++int av_buffer_is_writable(const AVBufferRef* buf); ++ ++/** ++ * @return the opaque parameter set by av_buffer_create. ++ */ ++void* av_buffer_get_opaque(const AVBufferRef* buf); ++ ++int av_buffer_get_ref_count(const AVBufferRef* buf); ++ ++/** ++ * Create a writable reference from a given buffer reference, avoiding data copy ++ * if possible. ++ * ++ * @param buf buffer reference to make writable. On success, buf is either left ++ * untouched, or it is unreferenced and a new writable AVBufferRef is ++ * written in its place. On failure, buf is left untouched. ++ * @return 0 on success, a negative AVERROR on failure. ++ */ ++int av_buffer_make_writable(AVBufferRef** buf); ++ ++/** ++ * Reallocate a given buffer. ++ * ++ * @param buf a buffer reference to reallocate. On success, buf will be ++ * unreferenced and a new reference with the required size will be ++ * written in its place. On failure buf will be left untouched. *buf ++ * may be NULL, then a new buffer is allocated. ++ * @param size required new buffer size. ++ * @return 0 on success, a negative AVERROR on failure. ++ * ++ * @note the buffer is actually reallocated with av_realloc() only if it was ++ * initially allocated through av_buffer_realloc(NULL) and there is only one ++ * reference to it (i.e. the one passed to this function). In all other cases ++ * a new buffer is allocated and the data is copied. ++ */ ++int av_buffer_realloc(AVBufferRef** buf, size_t size); ++ ++/** ++ * Ensure dst refers to the same data as src. ++ * ++ * When *dst is already equivalent to src, do nothing. Otherwise unreference dst ++ * and replace it with a new reference to src. ++ * ++ * @param dst Pointer to either a valid buffer reference or NULL. On success, ++ * this will point to a buffer reference equivalent to src. On ++ * failure, dst will be left untouched. ++ * @param src A buffer reference to replace dst with. May be NULL, then this ++ * function is equivalent to av_buffer_unref(dst). ++ * @return 0 on success ++ * AVERROR(ENOMEM) on memory allocation failure. ++ */ ++int av_buffer_replace(AVBufferRef** dst, const AVBufferRef* src); ++ ++/** ++ * @} ++ */ ++ ++/** ++ * @defgroup lavu_bufferpool AVBufferPool ++ * @ingroup lavu_data ++ * ++ * @{ ++ * AVBufferPool is an API for a lock-free thread-safe pool of AVBuffers. ++ * ++ * Frequently allocating and freeing large buffers may be slow. AVBufferPool is ++ * meant to solve this in cases when the caller needs a set of buffers of the ++ * same size (the most obvious use case being buffers for raw video or audio ++ * frames). ++ * ++ * At the beginning, the user must call av_buffer_pool_init() to create the ++ * buffer pool. Then whenever a buffer is needed, call av_buffer_pool_get() to ++ * get a reference to a new buffer, similar to av_buffer_alloc(). This new ++ * reference works in all aspects the same way as the one created by ++ * av_buffer_alloc(). However, when the last reference to this buffer is ++ * unreferenced, it is returned to the pool instead of being freed and will be ++ * reused for subsequent av_buffer_pool_get() calls. ++ * ++ * When the caller is done with the pool and no longer needs to allocate any new ++ * buffers, av_buffer_pool_uninit() must be called to mark the pool as freeable. ++ * Once all the buffers are released, it will automatically be freed. ++ * ++ * Allocating and releasing buffers with this API is thread-safe as long as ++ * either the default alloc callback is used, or the user-supplied one is ++ * thread-safe. ++ */ ++ ++/** ++ * The buffer pool. This structure is opaque and not meant to be accessed ++ * directly. It is allocated with av_buffer_pool_init() and freed with ++ * av_buffer_pool_uninit(). ++ */ ++typedef struct AVBufferPool AVBufferPool; ++ ++/** ++ * Allocate and initialize a buffer pool. ++ * ++ * @param size size of each buffer in this pool ++ * @param alloc a function that will be used to allocate new buffers when the ++ * pool is empty. May be NULL, then the default allocator will be used ++ * (av_buffer_alloc()). ++ * @return newly created buffer pool on success, NULL on error. ++ */ ++AVBufferPool* av_buffer_pool_init(size_t size, ++ AVBufferRef* (*alloc)(size_t size)); ++ ++/** ++ * Allocate and initialize a buffer pool with a more complex allocator. ++ * ++ * @param size size of each buffer in this pool ++ * @param opaque arbitrary user data used by the allocator ++ * @param alloc a function that will be used to allocate new buffers when the ++ * pool is empty. May be NULL, then the default allocator will be ++ * used (av_buffer_alloc()). ++ * @param pool_free a function that will be called immediately before the pool ++ * is freed. I.e. after av_buffer_pool_uninit() is called ++ * by the caller and all the frames are returned to the pool ++ * and freed. It is intended to uninitialize the user opaque ++ * data. May be NULL. ++ * @return newly created buffer pool on success, NULL on error. ++ */ ++AVBufferPool* av_buffer_pool_init2(size_t size, void* opaque, ++ AVBufferRef* (*alloc)(void* opaque, ++ size_t size), ++ void (*pool_free)(void* opaque)); ++ ++/** ++ * Mark the pool as being available for freeing. It will actually be freed only ++ * once all the allocated buffers associated with the pool are released. Thus it ++ * is safe to call this function while some of the allocated buffers are still ++ * in use. ++ * ++ * @param pool pointer to the pool to be freed. It will be set to NULL. ++ */ ++void av_buffer_pool_uninit(AVBufferPool** pool); ++ ++/** ++ * Allocate a new AVBuffer, reusing an old buffer from the pool when available. ++ * This function may be called simultaneously from multiple threads. ++ * ++ * @return a reference to the new buffer on success, NULL on error. ++ */ ++AVBufferRef* av_buffer_pool_get(AVBufferPool* pool); ++ ++/** ++ * Query the original opaque parameter of an allocated buffer in the pool. ++ * ++ * @param ref a buffer reference to a buffer returned by av_buffer_pool_get. ++ * @return the opaque parameter set by the buffer allocator function of the ++ * buffer pool. ++ * ++ * @note the opaque parameter of ref is used by the buffer pool implementation, ++ * therefore you have to use this function to access the original opaque ++ * parameter of an allocated buffer. ++ */ ++void* av_buffer_pool_buffer_get_opaque(const AVBufferRef* ref); ++ ++/** ++ * @} ++ */ ++ ++#endif /* AVUTIL_BUFFER_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/channel_layout.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/channel_layout.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/channel_layout.h +@@ -0,0 +1,270 @@ ++/* ++ * Copyright (c) 2006 Michael Niedermayer ++ * Copyright (c) 2008 Peter Ross ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifndef AVUTIL_CHANNEL_LAYOUT_H ++#define AVUTIL_CHANNEL_LAYOUT_H ++ ++#include ++ ++/** ++ * @file ++ * audio channel layout utility functions ++ */ ++ ++/** ++ * @addtogroup lavu_audio ++ * @{ ++ */ ++ ++/** ++ * @defgroup channel_masks Audio channel masks ++ * ++ * A channel layout is a 64-bits integer with a bit set for every channel. ++ * The number of bits set must be equal to the number of channels. ++ * The value 0 means that the channel layout is not known. ++ * @note this data structure is not powerful enough to handle channels ++ * combinations that have the same channel multiple times, such as ++ * dual-mono. ++ * ++ * @{ ++ */ ++#define AV_CH_FRONT_LEFT 0x00000001 ++#define AV_CH_FRONT_RIGHT 0x00000002 ++#define AV_CH_FRONT_CENTER 0x00000004 ++#define AV_CH_LOW_FREQUENCY 0x00000008 ++#define AV_CH_BACK_LEFT 0x00000010 ++#define AV_CH_BACK_RIGHT 0x00000020 ++#define AV_CH_FRONT_LEFT_OF_CENTER 0x00000040 ++#define AV_CH_FRONT_RIGHT_OF_CENTER 0x00000080 ++#define AV_CH_BACK_CENTER 0x00000100 ++#define AV_CH_SIDE_LEFT 0x00000200 ++#define AV_CH_SIDE_RIGHT 0x00000400 ++#define AV_CH_TOP_CENTER 0x00000800 ++#define AV_CH_TOP_FRONT_LEFT 0x00001000 ++#define AV_CH_TOP_FRONT_CENTER 0x00002000 ++#define AV_CH_TOP_FRONT_RIGHT 0x00004000 ++#define AV_CH_TOP_BACK_LEFT 0x00008000 ++#define AV_CH_TOP_BACK_CENTER 0x00010000 ++#define AV_CH_TOP_BACK_RIGHT 0x00020000 ++#define AV_CH_STEREO_LEFT 0x20000000 ///< Stereo downmix. ++#define AV_CH_STEREO_RIGHT 0x40000000 ///< See AV_CH_STEREO_LEFT. ++#define AV_CH_WIDE_LEFT 0x0000000080000000ULL ++#define AV_CH_WIDE_RIGHT 0x0000000100000000ULL ++#define AV_CH_SURROUND_DIRECT_LEFT 0x0000000200000000ULL ++#define AV_CH_SURROUND_DIRECT_RIGHT 0x0000000400000000ULL ++#define AV_CH_LOW_FREQUENCY_2 0x0000000800000000ULL ++#define AV_CH_TOP_SIDE_LEFT 0x0000001000000000ULL ++#define AV_CH_TOP_SIDE_RIGHT 0x0000002000000000ULL ++#define AV_CH_BOTTOM_FRONT_CENTER 0x0000004000000000ULL ++#define AV_CH_BOTTOM_FRONT_LEFT 0x0000008000000000ULL ++#define AV_CH_BOTTOM_FRONT_RIGHT 0x0000010000000000ULL ++ ++/** Channel mask value used for AVCodecContext.request_channel_layout ++ to indicate that the user requests the channel order of the decoder output ++ to be the native codec channel order. */ ++#define AV_CH_LAYOUT_NATIVE 0x8000000000000000ULL ++ ++/** ++ * @} ++ * @defgroup channel_mask_c Audio channel layouts ++ * @{ ++ * */ ++#define AV_CH_LAYOUT_MONO (AV_CH_FRONT_CENTER) ++#define AV_CH_LAYOUT_STEREO (AV_CH_FRONT_LEFT | AV_CH_FRONT_RIGHT) ++#define AV_CH_LAYOUT_2POINT1 (AV_CH_LAYOUT_STEREO | AV_CH_LOW_FREQUENCY) ++#define AV_CH_LAYOUT_2_1 (AV_CH_LAYOUT_STEREO | AV_CH_BACK_CENTER) ++#define AV_CH_LAYOUT_SURROUND (AV_CH_LAYOUT_STEREO | AV_CH_FRONT_CENTER) ++#define AV_CH_LAYOUT_3POINT1 (AV_CH_LAYOUT_SURROUND | AV_CH_LOW_FREQUENCY) ++#define AV_CH_LAYOUT_4POINT0 (AV_CH_LAYOUT_SURROUND | AV_CH_BACK_CENTER) ++#define AV_CH_LAYOUT_4POINT1 (AV_CH_LAYOUT_4POINT0 | AV_CH_LOW_FREQUENCY) ++#define AV_CH_LAYOUT_2_2 \ ++ (AV_CH_LAYOUT_STEREO | AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT) ++#define AV_CH_LAYOUT_QUAD \ ++ (AV_CH_LAYOUT_STEREO | AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT) ++#define AV_CH_LAYOUT_5POINT0 \ ++ (AV_CH_LAYOUT_SURROUND | AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT) ++#define AV_CH_LAYOUT_5POINT1 (AV_CH_LAYOUT_5POINT0 | AV_CH_LOW_FREQUENCY) ++#define AV_CH_LAYOUT_5POINT0_BACK \ ++ (AV_CH_LAYOUT_SURROUND | AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT) ++#define AV_CH_LAYOUT_5POINT1_BACK \ ++ (AV_CH_LAYOUT_5POINT0_BACK | AV_CH_LOW_FREQUENCY) ++#define AV_CH_LAYOUT_6POINT0 (AV_CH_LAYOUT_5POINT0 | AV_CH_BACK_CENTER) ++#define AV_CH_LAYOUT_6POINT0_FRONT \ ++ (AV_CH_LAYOUT_2_2 | AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER) ++#define AV_CH_LAYOUT_HEXAGONAL (AV_CH_LAYOUT_5POINT0_BACK | AV_CH_BACK_CENTER) ++#define AV_CH_LAYOUT_6POINT1 (AV_CH_LAYOUT_5POINT1 | AV_CH_BACK_CENTER) ++#define AV_CH_LAYOUT_6POINT1_BACK \ ++ (AV_CH_LAYOUT_5POINT1_BACK | AV_CH_BACK_CENTER) ++#define AV_CH_LAYOUT_6POINT1_FRONT \ ++ (AV_CH_LAYOUT_6POINT0_FRONT | AV_CH_LOW_FREQUENCY) ++#define AV_CH_LAYOUT_7POINT0 \ ++ (AV_CH_LAYOUT_5POINT0 | AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT) ++#define AV_CH_LAYOUT_7POINT0_FRONT \ ++ (AV_CH_LAYOUT_5POINT0 | AV_CH_FRONT_LEFT_OF_CENTER | \ ++ AV_CH_FRONT_RIGHT_OF_CENTER) ++#define AV_CH_LAYOUT_7POINT1 \ ++ (AV_CH_LAYOUT_5POINT1 | AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT) ++#define AV_CH_LAYOUT_7POINT1_WIDE \ ++ (AV_CH_LAYOUT_5POINT1 | AV_CH_FRONT_LEFT_OF_CENTER | \ ++ AV_CH_FRONT_RIGHT_OF_CENTER) ++#define AV_CH_LAYOUT_7POINT1_WIDE_BACK \ ++ (AV_CH_LAYOUT_5POINT1_BACK | AV_CH_FRONT_LEFT_OF_CENTER | \ ++ AV_CH_FRONT_RIGHT_OF_CENTER) ++#define AV_CH_LAYOUT_OCTAGONAL \ ++ (AV_CH_LAYOUT_5POINT0 | AV_CH_BACK_LEFT | AV_CH_BACK_CENTER | \ ++ AV_CH_BACK_RIGHT) ++#define AV_CH_LAYOUT_HEXADECAGONAL \ ++ (AV_CH_LAYOUT_OCTAGONAL | AV_CH_WIDE_LEFT | AV_CH_WIDE_RIGHT | \ ++ AV_CH_TOP_BACK_LEFT | AV_CH_TOP_BACK_RIGHT | AV_CH_TOP_BACK_CENTER | \ ++ AV_CH_TOP_FRONT_CENTER | AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT) ++#define AV_CH_LAYOUT_STEREO_DOWNMIX (AV_CH_STEREO_LEFT | AV_CH_STEREO_RIGHT) ++#define AV_CH_LAYOUT_22POINT2 \ ++ (AV_CH_LAYOUT_5POINT1_BACK | AV_CH_FRONT_LEFT_OF_CENTER | \ ++ AV_CH_FRONT_RIGHT_OF_CENTER | AV_CH_BACK_CENTER | AV_CH_LOW_FREQUENCY_2 | \ ++ AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT | AV_CH_TOP_FRONT_LEFT | \ ++ AV_CH_TOP_FRONT_RIGHT | AV_CH_TOP_FRONT_CENTER | AV_CH_TOP_CENTER | \ ++ AV_CH_TOP_BACK_LEFT | AV_CH_TOP_BACK_RIGHT | AV_CH_TOP_SIDE_LEFT | \ ++ AV_CH_TOP_SIDE_RIGHT | AV_CH_TOP_BACK_CENTER | AV_CH_BOTTOM_FRONT_CENTER | \ ++ AV_CH_BOTTOM_FRONT_LEFT | AV_CH_BOTTOM_FRONT_RIGHT) ++ ++enum AVMatrixEncoding { ++ AV_MATRIX_ENCODING_NONE, ++ AV_MATRIX_ENCODING_DOLBY, ++ AV_MATRIX_ENCODING_DPLII, ++ AV_MATRIX_ENCODING_DPLIIX, ++ AV_MATRIX_ENCODING_DPLIIZ, ++ AV_MATRIX_ENCODING_DOLBYEX, ++ AV_MATRIX_ENCODING_DOLBYHEADPHONE, ++ AV_MATRIX_ENCODING_NB ++}; ++ ++/** ++ * Return a channel layout id that matches name, or 0 if no match is found. ++ * ++ * name can be one or several of the following notations, ++ * separated by '+' or '|': ++ * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, ++ * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); ++ * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, ++ * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); ++ * - a number of channels, in decimal, followed by 'c', yielding ++ * the default channel layout for that number of channels (@see ++ * av_get_default_channel_layout); ++ * - a channel layout mask, in hexadecimal starting with "0x" (see the ++ * AV_CH_* macros). ++ * ++ * Example: "stereo+FC" = "2c+FC" = "2c+1c" = "0x7" ++ */ ++uint64_t av_get_channel_layout(const char* name); ++ ++/** ++ * Return a channel layout and the number of channels based on the specified ++ * name. ++ * ++ * This function is similar to (@see av_get_channel_layout), but can also parse ++ * unknown channel layout specifications. ++ * ++ * @param[in] name channel layout specification string ++ * @param[out] channel_layout parsed channel layout (0 if unknown) ++ * @param[out] nb_channels number of channels ++ * ++ * @return 0 on success, AVERROR(EINVAL) if the parsing fails. ++ */ ++int av_get_extended_channel_layout(const char* name, uint64_t* channel_layout, ++ int* nb_channels); ++ ++/** ++ * Return a description of a channel layout. ++ * If nb_channels is <= 0, it is guessed from the channel_layout. ++ * ++ * @param buf put here the string containing the channel layout ++ * @param buf_size size in bytes of the buffer ++ */ ++void av_get_channel_layout_string(char* buf, int buf_size, int nb_channels, ++ uint64_t channel_layout); ++ ++struct AVBPrint; ++/** ++ * Append a description of a channel layout to a bprint buffer. ++ */ ++void av_bprint_channel_layout(struct AVBPrint* bp, int nb_channels, ++ uint64_t channel_layout); ++ ++/** ++ * Return the number of channels in the channel layout. ++ */ ++int av_get_channel_layout_nb_channels(uint64_t channel_layout); ++ ++/** ++ * Return default channel layout for a given number of channels. ++ */ ++int64_t av_get_default_channel_layout(int nb_channels); ++ ++/** ++ * Get the index of a channel in channel_layout. ++ * ++ * @param channel a channel layout describing exactly one channel which must be ++ * present in channel_layout. ++ * ++ * @return index of channel in channel_layout on success, a negative AVERROR ++ * on error. ++ */ ++int av_get_channel_layout_channel_index(uint64_t channel_layout, ++ uint64_t channel); ++ ++/** ++ * Get the channel with the given index in channel_layout. ++ */ ++uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index); ++ ++/** ++ * Get the name of a given channel. ++ * ++ * @return channel name on success, NULL on error. ++ */ ++const char* av_get_channel_name(uint64_t channel); ++ ++/** ++ * Get the description of a given channel. ++ * ++ * @param channel a channel layout with a single channel ++ * @return channel description on success, NULL on error ++ */ ++const char* av_get_channel_description(uint64_t channel); ++ ++/** ++ * Get the value and name of a standard channel layout. ++ * ++ * @param[in] index index in an internal list, starting at 0 ++ * @param[out] layout channel layout mask ++ * @param[out] name name of the layout ++ * @return 0 if the layout exists, ++ * <0 if index is beyond the limits ++ */ ++int av_get_standard_channel_layout(unsigned index, uint64_t* layout, ++ const char** name); ++ ++/** ++ * @} ++ * @} ++ */ ++ ++#endif /* AVUTIL_CHANNEL_LAYOUT_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/common.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/common.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/common.h +@@ -0,0 +1,590 @@ ++/* ++ * copyright (c) 2006 Michael Niedermayer ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++/** ++ * @file ++ * common internal and external API header ++ */ ++ ++#ifndef AVUTIL_COMMON_H ++#define AVUTIL_COMMON_H ++ ++#if defined(__cplusplus) && !defined(__STDC_CONSTANT_MACROS) && \ ++ !defined(UINT64_C) ++# error missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "attributes.h" ++#include "macros.h" ++#include "version.h" ++ ++// rounded division & shift ++#define RSHIFT(a, b) \ ++ ((a) > 0 ? ((a) + ((1 << (b)) >> 1)) >> (b) \ ++ : ((a) + ((1 << (b)) >> 1) - 1) >> (b)) ++/* assume b>0 */ ++#define ROUNDED_DIV(a, b) \ ++ (((a) >= 0 ? (a) + ((b) >> 1) : (a) - ((b) >> 1)) / (b)) ++/* Fast a/(1<=0 and b>=0 */ ++#define AV_CEIL_RSHIFT(a, b) \ ++ (!av_builtin_constant_p(b) ? -((-(a)) >> (b)) : ((a) + (1 << (b)) - 1) >> (b)) ++/* Backwards compat. */ ++#define FF_CEIL_RSHIFT AV_CEIL_RSHIFT ++ ++#define FFUDIV(a, b) (((a) > 0 ? (a) : (a) - (b) + 1) / (b)) ++#define FFUMOD(a, b) ((a) - (b)*FFUDIV(a, b)) ++ ++/** ++ * Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as ++ * they are not representable as absolute values of their type. This is the same ++ * as with *abs() ++ * @see FFNABS() ++ */ ++#define FFABS(a) ((a) >= 0 ? (a) : (-(a))) ++#define FFSIGN(a) ((a) > 0 ? 1 : -1) ++ ++/** ++ * Negative Absolute value. ++ * this works for all integers of all types. ++ * As with many macros, this evaluates its argument twice, it thus must not have ++ * a sideeffect, that is FFNABS(x++) has undefined behavior. ++ */ ++#define FFNABS(a) ((a) <= 0 ? (a) : (-(a))) ++ ++/** ++ * Unsigned Absolute value. ++ * This takes the absolute value of a signed int and returns it as a unsigned. ++ * This also works with INT_MIN which would otherwise not be representable ++ * As with many macros, this evaluates its argument twice. ++ */ ++#define FFABSU(a) ((a) <= 0 ? -(unsigned)(a) : (unsigned)(a)) ++#define FFABS64U(a) ((a) <= 0 ? -(uint64_t)(a) : (uint64_t)(a)) ++ ++/* misc math functions */ ++ ++#ifdef HAVE_AV_CONFIG_H ++# include "config.h" ++# include "intmath.h" ++#endif ++ ++#ifndef av_ceil_log2 ++# define av_ceil_log2 av_ceil_log2_c ++#endif ++#ifndef av_clip ++# define av_clip av_clip_c ++#endif ++#ifndef av_clip64 ++# define av_clip64 av_clip64_c ++#endif ++#ifndef av_clip_uint8 ++# define av_clip_uint8 av_clip_uint8_c ++#endif ++#ifndef av_clip_int8 ++# define av_clip_int8 av_clip_int8_c ++#endif ++#ifndef av_clip_uint16 ++# define av_clip_uint16 av_clip_uint16_c ++#endif ++#ifndef av_clip_int16 ++# define av_clip_int16 av_clip_int16_c ++#endif ++#ifndef av_clipl_int32 ++# define av_clipl_int32 av_clipl_int32_c ++#endif ++#ifndef av_clip_intp2 ++# define av_clip_intp2 av_clip_intp2_c ++#endif ++#ifndef av_clip_uintp2 ++# define av_clip_uintp2 av_clip_uintp2_c ++#endif ++#ifndef av_mod_uintp2 ++# define av_mod_uintp2 av_mod_uintp2_c ++#endif ++#ifndef av_sat_add32 ++# define av_sat_add32 av_sat_add32_c ++#endif ++#ifndef av_sat_dadd32 ++# define av_sat_dadd32 av_sat_dadd32_c ++#endif ++#ifndef av_sat_sub32 ++# define av_sat_sub32 av_sat_sub32_c ++#endif ++#ifndef av_sat_dsub32 ++# define av_sat_dsub32 av_sat_dsub32_c ++#endif ++#ifndef av_sat_add64 ++# define av_sat_add64 av_sat_add64_c ++#endif ++#ifndef av_sat_sub64 ++# define av_sat_sub64 av_sat_sub64_c ++#endif ++#ifndef av_clipf ++# define av_clipf av_clipf_c ++#endif ++#ifndef av_clipd ++# define av_clipd av_clipd_c ++#endif ++#ifndef av_popcount ++# define av_popcount av_popcount_c ++#endif ++#ifndef av_popcount64 ++# define av_popcount64 av_popcount64_c ++#endif ++#ifndef av_parity ++# define av_parity av_parity_c ++#endif ++ ++#ifndef av_log2 ++av_const int av_log2(unsigned v); ++#endif ++ ++#ifndef av_log2_16bit ++av_const int av_log2_16bit(unsigned v); ++#endif ++ ++/** ++ * Clip a signed integer value into the amin-amax range. ++ * @param a value to clip ++ * @param amin minimum value of the clip range ++ * @param amax maximum value of the clip range ++ * @return clipped value ++ */ ++static av_always_inline av_const int av_clip_c(int a, int amin, int amax) { ++#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2 ++ if (amin > amax) abort(); ++#endif ++ if (a < amin) ++ return amin; ++ else if (a > amax) ++ return amax; ++ else ++ return a; ++} ++ ++/** ++ * Clip a signed 64bit integer value into the amin-amax range. ++ * @param a value to clip ++ * @param amin minimum value of the clip range ++ * @param amax maximum value of the clip range ++ * @return clipped value ++ */ ++static av_always_inline av_const int64_t av_clip64_c(int64_t a, int64_t amin, ++ int64_t amax) { ++#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2 ++ if (amin > amax) abort(); ++#endif ++ if (a < amin) ++ return amin; ++ else if (a > amax) ++ return amax; ++ else ++ return a; ++} ++ ++/** ++ * Clip a signed integer value into the 0-255 range. ++ * @param a value to clip ++ * @return clipped value ++ */ ++static av_always_inline av_const uint8_t av_clip_uint8_c(int a) { ++ if (a & (~0xFF)) ++ return (~a) >> 31; ++ else ++ return a; ++} ++ ++/** ++ * Clip a signed integer value into the -128,127 range. ++ * @param a value to clip ++ * @return clipped value ++ */ ++static av_always_inline av_const int8_t av_clip_int8_c(int a) { ++ if ((a + 0x80U) & ~0xFF) ++ return (a >> 31) ^ 0x7F; ++ else ++ return a; ++} ++ ++/** ++ * Clip a signed integer value into the 0-65535 range. ++ * @param a value to clip ++ * @return clipped value ++ */ ++static av_always_inline av_const uint16_t av_clip_uint16_c(int a) { ++ if (a & (~0xFFFF)) ++ return (~a) >> 31; ++ else ++ return a; ++} ++ ++/** ++ * Clip a signed integer value into the -32768,32767 range. ++ * @param a value to clip ++ * @return clipped value ++ */ ++static av_always_inline av_const int16_t av_clip_int16_c(int a) { ++ if ((a + 0x8000U) & ~0xFFFF) ++ return (a >> 31) ^ 0x7FFF; ++ else ++ return a; ++} ++ ++/** ++ * Clip a signed 64-bit integer value into the -2147483648,2147483647 range. ++ * @param a value to clip ++ * @return clipped value ++ */ ++static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a) { ++ if ((a + 0x80000000u) & ~UINT64_C(0xFFFFFFFF)) ++ return (int32_t)((a >> 63) ^ 0x7FFFFFFF); ++ else ++ return (int32_t)a; ++} ++ ++/** ++ * Clip a signed integer into the -(2^p),(2^p-1) range. ++ * @param a value to clip ++ * @param p bit position to clip at ++ * @return clipped value ++ */ ++static av_always_inline av_const int av_clip_intp2_c(int a, int p) { ++ if (((unsigned)a + (1 << p)) & ~((2 << p) - 1)) ++ return (a >> 31) ^ ((1 << p) - 1); ++ else ++ return a; ++} ++ ++/** ++ * Clip a signed integer to an unsigned power of two range. ++ * @param a value to clip ++ * @param p bit position to clip at ++ * @return clipped value ++ */ ++static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p) { ++ if (a & ~((1 << p) - 1)) ++ return (~a) >> 31 & ((1 << p) - 1); ++ else ++ return a; ++} ++ ++/** ++ * Clear high bits from an unsigned integer starting with specific bit position ++ * @param a value to clip ++ * @param p bit position to clip at ++ * @return clipped value ++ */ ++static av_always_inline av_const unsigned av_mod_uintp2_c(unsigned a, ++ unsigned p) { ++ return a & ((1U << p) - 1); ++} ++ ++/** ++ * Add two signed 32-bit values with saturation. ++ * ++ * @param a one value ++ * @param b another value ++ * @return sum with signed saturation ++ */ ++static av_always_inline int av_sat_add32_c(int a, int b) { ++ return av_clipl_int32((int64_t)a + b); ++} ++ ++/** ++ * Add a doubled value to another value with saturation at both stages. ++ * ++ * @param a first value ++ * @param b value doubled and added to a ++ * @return sum sat(a + sat(2*b)) with signed saturation ++ */ ++static av_always_inline int av_sat_dadd32_c(int a, int b) { ++ return av_sat_add32(a, av_sat_add32(b, b)); ++} ++ ++/** ++ * Subtract two signed 32-bit values with saturation. ++ * ++ * @param a one value ++ * @param b another value ++ * @return difference with signed saturation ++ */ ++static av_always_inline int av_sat_sub32_c(int a, int b) { ++ return av_clipl_int32((int64_t)a - b); ++} ++ ++/** ++ * Subtract a doubled value from another value with saturation at both stages. ++ * ++ * @param a first value ++ * @param b value doubled and subtracted from a ++ * @return difference sat(a - sat(2*b)) with signed saturation ++ */ ++static av_always_inline int av_sat_dsub32_c(int a, int b) { ++ return av_sat_sub32(a, av_sat_add32(b, b)); ++} ++ ++/** ++ * Add two signed 64-bit values with saturation. ++ * ++ * @param a one value ++ * @param b another value ++ * @return sum with signed saturation ++ */ ++static av_always_inline int64_t av_sat_add64_c(int64_t a, int64_t b) { ++#if (!defined(__INTEL_COMPILER) && AV_GCC_VERSION_AT_LEAST(5, 1)) || \ ++ AV_HAS_BUILTIN(__builtin_add_overflow) ++ int64_t tmp; ++ return !__builtin_add_overflow(a, b, &tmp) ++ ? tmp ++ : (tmp < 0 ? INT64_MAX : INT64_MIN); ++#else ++ int64_t s = a + (uint64_t)b; ++ if ((int64_t)(a ^ b | ~s ^ b) >= 0) return INT64_MAX ^ (b >> 63); ++ return s; ++#endif ++} ++ ++/** ++ * Subtract two signed 64-bit values with saturation. ++ * ++ * @param a one value ++ * @param b another value ++ * @return difference with signed saturation ++ */ ++static av_always_inline int64_t av_sat_sub64_c(int64_t a, int64_t b) { ++#if (!defined(__INTEL_COMPILER) && AV_GCC_VERSION_AT_LEAST(5, 1)) || \ ++ AV_HAS_BUILTIN(__builtin_sub_overflow) ++ int64_t tmp; ++ return !__builtin_sub_overflow(a, b, &tmp) ++ ? tmp ++ : (tmp < 0 ? INT64_MAX : INT64_MIN); ++#else ++ if (b <= 0 && a >= INT64_MAX + b) return INT64_MAX; ++ if (b >= 0 && a <= INT64_MIN + b) return INT64_MIN; ++ return a - b; ++#endif ++} ++ ++/** ++ * Clip a float value into the amin-amax range. ++ * If a is nan or -inf amin will be returned. ++ * If a is +inf amax will be returned. ++ * @param a value to clip ++ * @param amin minimum value of the clip range ++ * @param amax maximum value of the clip range ++ * @return clipped value ++ */ ++static av_always_inline av_const float av_clipf_c(float a, float amin, ++ float amax) { ++#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2 ++ if (amin > amax) abort(); ++#endif ++ return FFMIN(FFMAX(a, amin), amax); ++} ++ ++/** ++ * Clip a double value into the amin-amax range. ++ * If a is nan or -inf amin will be returned. ++ * If a is +inf amax will be returned. ++ * @param a value to clip ++ * @param amin minimum value of the clip range ++ * @param amax maximum value of the clip range ++ * @return clipped value ++ */ ++static av_always_inline av_const double av_clipd_c(double a, double amin, ++ double amax) { ++#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2 ++ if (amin > amax) abort(); ++#endif ++ return FFMIN(FFMAX(a, amin), amax); ++} ++ ++/** Compute ceil(log2(x)). ++ * @param x value used to compute ceil(log2(x)) ++ * @return computed ceiling of log2(x) ++ */ ++static av_always_inline av_const int av_ceil_log2_c(int x) { ++ return av_log2((x - 1U) << 1); ++} ++ ++/** ++ * Count number of bits set to one in x ++ * @param x value to count bits of ++ * @return the number of bits set to one in x ++ */ ++static av_always_inline av_const int av_popcount_c(uint32_t x) { ++ x -= (x >> 1) & 0x55555555; ++ x = (x & 0x33333333) + ((x >> 2) & 0x33333333); ++ x = (x + (x >> 4)) & 0x0F0F0F0F; ++ x += x >> 8; ++ return (x + (x >> 16)) & 0x3F; ++} ++ ++/** ++ * Count number of bits set to one in x ++ * @param x value to count bits of ++ * @return the number of bits set to one in x ++ */ ++static av_always_inline av_const int av_popcount64_c(uint64_t x) { ++ return av_popcount((uint32_t)x) + av_popcount((uint32_t)(x >> 32)); ++} ++ ++static av_always_inline av_const int av_parity_c(uint32_t v) { ++ return av_popcount(v) & 1; ++} ++ ++/** ++ * Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form. ++ * ++ * @param val Output value, must be an lvalue of type uint32_t. ++ * @param GET_BYTE Expression reading one byte from the input. ++ * Evaluated up to 7 times (4 for the currently ++ * assigned Unicode range). With a memory buffer ++ * input, this could be *ptr++, or if you want to make sure ++ * that *ptr stops at the end of a NULL terminated string then ++ * *ptr ? *ptr++ : 0 ++ * @param ERROR Expression to be evaluated on invalid input, ++ * typically a goto statement. ++ * ++ * @warning ERROR should not contain a loop control statement which ++ * could interact with the internal while loop, and should force an ++ * exit from the macro code (e.g. through a goto or a return) in order ++ * to prevent undefined results. ++ */ ++#define GET_UTF8(val, GET_BYTE, ERROR) \ ++ val = (GET_BYTE); \ ++ { \ ++ uint32_t top = (val & 128) >> 1; \ ++ if ((val & 0xc0) == 0x80 || val >= 0xFE) { \ ++ ERROR \ ++ } \ ++ while (val & top) { \ ++ unsigned int tmp = (GET_BYTE)-128; \ ++ if (tmp >> 6) { \ ++ ERROR \ ++ } \ ++ val = (val << 6) + tmp; \ ++ top <<= 5; \ ++ } \ ++ val &= (top << 1) - 1; \ ++ } ++ ++/** ++ * Convert a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form. ++ * ++ * @param val Output value, must be an lvalue of type uint32_t. ++ * @param GET_16BIT Expression returning two bytes of UTF-16 data converted ++ * to native byte order. Evaluated one or two times. ++ * @param ERROR Expression to be evaluated on invalid input, ++ * typically a goto statement. ++ */ ++#define GET_UTF16(val, GET_16BIT, ERROR) \ ++ val = (GET_16BIT); \ ++ { \ ++ unsigned int hi = val - 0xD800; \ ++ if (hi < 0x800) { \ ++ val = (GET_16BIT)-0xDC00; \ ++ if (val > 0x3FFU || hi > 0x3FFU) { \ ++ ERROR \ ++ } \ ++ val += (hi << 10) + 0x10000; \ ++ } \ ++ } ++ ++/** ++ * @def PUT_UTF8(val, tmp, PUT_BYTE) ++ * Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes ++ * long). ++ * @param val is an input-only argument and should be of type uint32_t. It holds ++ * a UCS-4 encoded Unicode character that is to be converted to UTF-8. If ++ * val is given as a function it is executed only once. ++ * @param tmp is a temporary variable and should be of type uint8_t. It ++ * represents an intermediate value during conversion that is to be ++ * output by PUT_BYTE. ++ * @param PUT_BYTE writes the converted UTF-8 bytes to any proper destination. ++ * It could be a function or a statement, and uses tmp as the input byte. ++ * For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be ++ * executed up to 4 times for values in the valid UTF-8 range and up to ++ * 7 times in the general case, depending on the length of the converted ++ * Unicode character. ++ */ ++#define PUT_UTF8(val, tmp, PUT_BYTE) \ ++ { \ ++ int bytes, shift; \ ++ uint32_t in = val; \ ++ if (in < 0x80) { \ ++ tmp = in; \ ++ PUT_BYTE \ ++ } else { \ ++ bytes = (av_log2(in) + 4) / 5; \ ++ shift = (bytes - 1) * 6; \ ++ tmp = (256 - (256 >> bytes)) | (in >> shift); \ ++ PUT_BYTE \ ++ while (shift >= 6) { \ ++ shift -= 6; \ ++ tmp = 0x80 | ((in >> shift) & 0x3f); \ ++ PUT_BYTE \ ++ } \ ++ } \ ++ } ++ ++/** ++ * @def PUT_UTF16(val, tmp, PUT_16BIT) ++ * Convert a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes). ++ * @param val is an input-only argument and should be of type uint32_t. It holds ++ * a UCS-4 encoded Unicode character that is to be converted to UTF-16. If ++ * val is given as a function it is executed only once. ++ * @param tmp is a temporary variable and should be of type uint16_t. It ++ * represents an intermediate value during conversion that is to be ++ * output by PUT_16BIT. ++ * @param PUT_16BIT writes the converted UTF-16 data to any proper destination ++ * in desired endianness. It could be a function or a statement, and uses tmp ++ * as the input byte. For example, PUT_BYTE could be "*output++ = tmp;" ++ * PUT_BYTE will be executed 1 or 2 times depending on input character. ++ */ ++#define PUT_UTF16(val, tmp, PUT_16BIT) \ ++ { \ ++ uint32_t in = val; \ ++ if (in < 0x10000) { \ ++ tmp = in; \ ++ PUT_16BIT \ ++ } else { \ ++ tmp = 0xD800 | ((in - 0x10000) >> 10); \ ++ PUT_16BIT \ ++ tmp = 0xDC00 | ((in - 0x10000) & 0x3FF); \ ++ PUT_16BIT \ ++ } \ ++ } ++ ++#include "mem.h" ++ ++#ifdef HAVE_AV_CONFIG_H ++# include "internal.h" ++#endif /* HAVE_AV_CONFIG_H */ ++ ++#endif /* AVUTIL_COMMON_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/cpu.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/cpu.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/cpu.h +@@ -0,0 +1,138 @@ ++/* ++ * Copyright (c) 2000, 2001, 2002 Fabrice Bellard ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifndef AVUTIL_CPU_H ++#define AVUTIL_CPU_H ++ ++#include ++ ++#define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */ ++ ++/* lower 16 bits - CPU features */ ++#define AV_CPU_FLAG_MMX 0x0001 ///< standard MMX ++#define AV_CPU_FLAG_MMXEXT 0x0002 ///< SSE integer functions or AMD MMX ext ++#define AV_CPU_FLAG_MMX2 0x0002 ///< SSE integer functions or AMD MMX ext ++#define AV_CPU_FLAG_3DNOW 0x0004 ///< AMD 3DNOW ++#define AV_CPU_FLAG_SSE 0x0008 ///< SSE functions ++#define AV_CPU_FLAG_SSE2 0x0010 ///< PIV SSE2 functions ++#define AV_CPU_FLAG_SSE2SLOW \ ++ 0x40000000 ///< SSE2 supported, but usually not faster ++ ///< than regular MMX/SSE (e.g. Core1) ++#define AV_CPU_FLAG_3DNOWEXT 0x0020 ///< AMD 3DNowExt ++#define AV_CPU_FLAG_SSE3 0x0040 ///< Prescott SSE3 functions ++#define AV_CPU_FLAG_SSE3SLOW \ ++ 0x20000000 ///< SSE3 supported, but usually not faster ++ ///< than regular MMX/SSE (e.g. Core1) ++#define AV_CPU_FLAG_SSSE3 0x0080 ///< Conroe SSSE3 functions ++#define AV_CPU_FLAG_SSSE3SLOW \ ++ 0x4000000 ///< SSSE3 supported, but usually not faster ++#define AV_CPU_FLAG_ATOM \ ++ 0x10000000 ///< Atom processor, some SSSE3 instructions are slower ++#define AV_CPU_FLAG_SSE4 0x0100 ///< Penryn SSE4.1 functions ++#define AV_CPU_FLAG_SSE42 0x0200 ///< Nehalem SSE4.2 functions ++#define AV_CPU_FLAG_AESNI 0x80000 ///< Advanced Encryption Standard functions ++#define AV_CPU_FLAG_AVX \ ++ 0x4000 ///< AVX functions: requires OS support even if YMM registers aren't ++ ///< used ++#define AV_CPU_FLAG_AVXSLOW \ ++ 0x8000000 ///< AVX supported, but slow when using YMM registers (e.g. ++ ///< Bulldozer) ++#define AV_CPU_FLAG_XOP 0x0400 ///< Bulldozer XOP functions ++#define AV_CPU_FLAG_FMA4 0x0800 ///< Bulldozer FMA4 functions ++#define AV_CPU_FLAG_CMOV 0x1000 ///< supports cmov instruction ++#define AV_CPU_FLAG_AVX2 \ ++ 0x8000 ///< AVX2 functions: requires OS support even if YMM registers aren't ++ ///< used ++#define AV_CPU_FLAG_FMA3 0x10000 ///< Haswell FMA3 functions ++#define AV_CPU_FLAG_BMI1 0x20000 ///< Bit Manipulation Instruction Set 1 ++#define AV_CPU_FLAG_BMI2 0x40000 ///< Bit Manipulation Instruction Set 2 ++#define AV_CPU_FLAG_AVX512 \ ++ 0x100000 ///< AVX-512 functions: requires OS support even if YMM/ZMM ++ ///< registers aren't used ++#define AV_CPU_FLAG_SLOW_GATHER 0x2000000 ///< CPU has slow gathers. ++ ++#define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard ++#define AV_CPU_FLAG_VSX 0x0002 ///< ISA 2.06 ++#define AV_CPU_FLAG_POWER8 0x0004 ///< ISA 2.07 ++ ++#define AV_CPU_FLAG_ARMV5TE (1 << 0) ++#define AV_CPU_FLAG_ARMV6 (1 << 1) ++#define AV_CPU_FLAG_ARMV6T2 (1 << 2) ++#define AV_CPU_FLAG_VFP (1 << 3) ++#define AV_CPU_FLAG_VFPV3 (1 << 4) ++#define AV_CPU_FLAG_NEON (1 << 5) ++#define AV_CPU_FLAG_ARMV8 (1 << 6) ++#define AV_CPU_FLAG_VFP_VM \ ++ (1 << 7) ///< VFPv2 vector mode, deprecated in ARMv7-A and unavailable in ++ ///< various CPUs implementations ++#define AV_CPU_FLAG_SETEND (1 << 16) ++ ++#define AV_CPU_FLAG_MMI (1 << 0) ++#define AV_CPU_FLAG_MSA (1 << 1) ++ ++// Loongarch SIMD extension. ++#define AV_CPU_FLAG_LSX (1 << 0) ++#define AV_CPU_FLAG_LASX (1 << 1) ++ ++/** ++ * Return the flags which specify extensions supported by the CPU. ++ * The returned value is affected by av_force_cpu_flags() if that was used ++ * before. So av_get_cpu_flags() can easily be used in an application to ++ * detect the enabled cpu flags. ++ */ ++int av_get_cpu_flags(void); ++ ++/** ++ * Disables cpu detection and forces the specified flags. ++ * -1 is a special case that disables forcing of specific flags. ++ */ ++void av_force_cpu_flags(int flags); ++ ++/** ++ * Parse CPU caps from a string and update the given AV_CPU_* flags based on ++ * that. ++ * ++ * @return negative on error. ++ */ ++int av_parse_cpu_caps(unsigned* flags, const char* s); ++ ++/** ++ * @return the number of logical CPU cores present. ++ */ ++int av_cpu_count(void); ++ ++/** ++ * Overrides cpu count detection and forces the specified count. ++ * Count < 1 disables forcing of specific count. ++ */ ++void av_cpu_force_count(int count); ++ ++/** ++ * Get the maximum data alignment that may be required by FFmpeg. ++ * ++ * Note that this is affected by the build configuration and the CPU flags mask, ++ * so e.g. if the CPU supports AVX, but libavutil has been built with ++ * --disable-avx or the AV_CPU_FLAG_AVX flag has been disabled through ++ * av_set_cpu_flags_mask(), then this function will behave as if AVX is not ++ * present. ++ */ ++size_t av_cpu_max_align(void); ++ ++#endif /* AVUTIL_CPU_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/dict.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/dict.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/dict.h +@@ -0,0 +1,215 @@ ++/* ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++/** ++ * @file ++ * Public dictionary API. ++ * @deprecated ++ * AVDictionary is provided for compatibility with libav. It is both in ++ * implementation as well as API inefficient. It does not scale and is ++ * extremely slow with large dictionaries. ++ * It is recommended that new code uses our tree container from tree.c/h ++ * where applicable, which uses AVL trees to achieve O(log n) performance. ++ */ ++ ++#ifndef AVUTIL_DICT_H ++#define AVUTIL_DICT_H ++ ++#include ++ ++/** ++ * @addtogroup lavu_dict AVDictionary ++ * @ingroup lavu_data ++ * ++ * @brief Simple key:value store ++ * ++ * @{ ++ * Dictionaries are used for storing key:value pairs. To create ++ * an AVDictionary, simply pass an address of a NULL pointer to ++ * av_dict_set(). NULL can be used as an empty dictionary wherever ++ * a pointer to an AVDictionary is required. ++ * Use av_dict_get() to retrieve an entry or iterate over all ++ * entries and finally av_dict_free() to free the dictionary ++ * and all its contents. ++ * ++ @code ++ AVDictionary *d = NULL; // "create" an empty dictionary ++ AVDictionaryEntry *t = NULL; ++ ++ av_dict_set(&d, "foo", "bar", 0); // add an entry ++ ++ char *k = av_strdup("key"); // if your strings are already allocated, ++ char *v = av_strdup("value"); // you can avoid copying them like this ++ av_dict_set(&d, k, v, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL); ++ ++ while (t = av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX)) { ++ <....> // iterate over all entries in d ++ } ++ av_dict_free(&d); ++ @endcode ++ */ ++ ++#define AV_DICT_MATCH_CASE \ ++ 1 /**< Only get an entry with exact-case key match. Only relevant in \ ++ av_dict_get(). */ ++#define AV_DICT_IGNORE_SUFFIX \ ++ 2 /**< Return first entry in a dictionary whose first part corresponds to \ ++ the search key, ignoring the suffix of the found key string. Only \ ++ relevant in av_dict_get(). */ ++#define AV_DICT_DONT_STRDUP_KEY \ ++ 4 /**< Take ownership of a key that's been \ ++ allocated with av_malloc() or another memory allocation function. */ ++#define AV_DICT_DONT_STRDUP_VAL \ ++ 8 /**< Take ownership of a value that's been \ ++ allocated with av_malloc() or another memory allocation function. */ ++#define AV_DICT_DONT_OVERWRITE 16 ///< Don't overwrite existing entries. ++#define AV_DICT_APPEND \ ++ 32 /**< If the entry already exists, append to it. Note that no \ ++ delimiter is added, the strings are simply concatenated. */ ++#define AV_DICT_MULTIKEY \ ++ 64 /**< Allow to store several equal keys in the dictionary */ ++ ++typedef struct AVDictionaryEntry { ++ char* key; ++ char* value; ++} AVDictionaryEntry; ++ ++typedef struct AVDictionary AVDictionary; ++ ++/** ++ * Get a dictionary entry with matching key. ++ * ++ * The returned entry key or value must not be changed, or it will ++ * cause undefined behavior. ++ * ++ * To iterate through all the dictionary entries, you can set the matching key ++ * to the null string "" and set the AV_DICT_IGNORE_SUFFIX flag. ++ * ++ * @param prev Set to the previous matching element to find the next. ++ * If set to NULL the first matching element is returned. ++ * @param key matching key ++ * @param flags a collection of AV_DICT_* flags controlling how the entry is ++ * retrieved ++ * @return found entry or NULL in case no matching entry was found in the ++ * dictionary ++ */ ++AVDictionaryEntry* av_dict_get(const AVDictionary* m, const char* key, ++ const AVDictionaryEntry* prev, int flags); ++ ++/** ++ * Get number of entries in dictionary. ++ * ++ * @param m dictionary ++ * @return number of entries in dictionary ++ */ ++int av_dict_count(const AVDictionary* m); ++ ++/** ++ * Set the given entry in *pm, overwriting an existing entry. ++ * ++ * Note: If AV_DICT_DONT_STRDUP_KEY or AV_DICT_DONT_STRDUP_VAL is set, ++ * these arguments will be freed on error. ++ * ++ * Warning: Adding a new entry to a dictionary invalidates all existing entries ++ * previously returned with av_dict_get. ++ * ++ * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL ++ * a dictionary struct is allocated and put in *pm. ++ * @param key entry key to add to *pm (will either be av_strduped or added as a ++ * new key depending on flags) ++ * @param value entry value to add to *pm (will be av_strduped or added as a new ++ * key depending on flags). Passing a NULL value will cause an existing entry to ++ * be deleted. ++ * @return >= 0 on success otherwise an error code <0 ++ */ ++int av_dict_set(AVDictionary** pm, const char* key, const char* value, ++ int flags); ++ ++/** ++ * Convenience wrapper for av_dict_set that converts the value to a string ++ * and stores it. ++ * ++ * Note: If AV_DICT_DONT_STRDUP_KEY is set, key will be freed on error. ++ */ ++int av_dict_set_int(AVDictionary** pm, const char* key, int64_t value, ++ int flags); ++ ++/** ++ * Parse the key/value pairs list and add the parsed entries to a dictionary. ++ * ++ * In case of failure, all the successfully set entries are stored in ++ * *pm. You may need to manually free the created dictionary. ++ * ++ * @param key_val_sep a 0-terminated list of characters used to separate ++ * key from value ++ * @param pairs_sep a 0-terminated list of characters used to separate ++ * two pairs from each other ++ * @param flags flags to use when adding to dictionary. ++ * AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL ++ * are ignored since the key/value tokens will always ++ * be duplicated. ++ * @return 0 on success, negative AVERROR code on failure ++ */ ++int av_dict_parse_string(AVDictionary** pm, const char* str, ++ const char* key_val_sep, const char* pairs_sep, ++ int flags); ++ ++/** ++ * Copy entries from one AVDictionary struct into another. ++ * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, ++ * this function will allocate a struct for you and put it in *dst ++ * @param src pointer to source AVDictionary struct ++ * @param flags flags to use when setting entries in *dst ++ * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag ++ * @return 0 on success, negative AVERROR code on failure. If dst was allocated ++ * by this function, callers should free the associated memory. ++ */ ++int av_dict_copy(AVDictionary** dst, const AVDictionary* src, int flags); ++ ++/** ++ * Free all the memory allocated for an AVDictionary struct ++ * and all keys and values. ++ */ ++void av_dict_free(AVDictionary** m); ++ ++/** ++ * Get dictionary entries as a string. ++ * ++ * Create a string containing dictionary's entries. ++ * Such string may be passed back to av_dict_parse_string(). ++ * @note String is escaped with backslashes ('\'). ++ * ++ * @param[in] m dictionary ++ * @param[out] buffer Pointer to buffer that will be allocated with ++ * string containg entries. Buffer must be freed by the caller when is no longer ++ * needed. ++ * @param[in] key_val_sep character used to separate key from value ++ * @param[in] pairs_sep character used to separate two pairs from each ++ * other ++ * @return >= 0 on success, negative on error ++ * @warning Separators cannot be neither '\\' nor '\0'. They also cannot be the ++ * same. ++ */ ++int av_dict_get_string(const AVDictionary* m, char** buffer, ++ const char key_val_sep, const char pairs_sep); ++ ++/** ++ * @} ++ */ ++ ++#endif /* AVUTIL_DICT_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/error.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/error.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/error.h +@@ -0,0 +1,158 @@ ++/* ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++/** ++ * @file ++ * error code definitions ++ */ ++ ++#ifndef AVUTIL_ERROR_H ++#define AVUTIL_ERROR_H ++ ++#include ++#include ++ ++#include "macros.h" ++ ++/** ++ * @addtogroup lavu_error ++ * ++ * @{ ++ */ ++ ++/* error handling */ ++#if EDOM > 0 ++# define AVERROR(e) \ ++ (-(e)) ///< Returns a negative error code from a POSIX error code, to ++ ///< return from library functions. ++# define AVUNERROR(e) \ ++ (-(e)) ///< Returns a POSIX error code from a library function error return ++ ///< value. ++#else ++/* Some platforms have E* and errno already negated. */ ++# define AVERROR(e) (e) ++# define AVUNERROR(e) (e) ++#endif ++ ++#define FFERRTAG(a, b, c, d) (-(int)MKTAG(a, b, c, d)) ++ ++#define AVERROR_BSF_NOT_FOUND \ ++ FFERRTAG(0xF8, 'B', 'S', 'F') ///< Bitstream filter not found ++#define AVERROR_BUG \ ++ FFERRTAG('B', 'U', 'G', '!') ///< Internal bug, also see AVERROR_BUG2 ++#define AVERROR_BUFFER_TOO_SMALL \ ++ FFERRTAG('B', 'U', 'F', 'S') ///< Buffer too small ++#define AVERROR_DECODER_NOT_FOUND \ ++ FFERRTAG(0xF8, 'D', 'E', 'C') ///< Decoder not found ++#define AVERROR_DEMUXER_NOT_FOUND \ ++ FFERRTAG(0xF8, 'D', 'E', 'M') ///< Demuxer not found ++#define AVERROR_ENCODER_NOT_FOUND \ ++ FFERRTAG(0xF8, 'E', 'N', 'C') ///< Encoder not found ++#define AVERROR_EOF FFERRTAG('E', 'O', 'F', ' ') ///< End of file ++#define AVERROR_EXIT \ ++ FFERRTAG('E', 'X', 'I', 'T') ///< Immediate exit was requested; the called ++ ///< function should not be restarted ++#define AVERROR_EXTERNAL \ ++ FFERRTAG('E', 'X', 'T', ' ') ///< Generic error in an external library ++#define AVERROR_FILTER_NOT_FOUND \ ++ FFERRTAG(0xF8, 'F', 'I', 'L') ///< Filter not found ++#define AVERROR_INVALIDDATA \ ++ FFERRTAG('I', 'N', 'D', 'A') ///< Invalid data found when processing input ++#define AVERROR_MUXER_NOT_FOUND \ ++ FFERRTAG(0xF8, 'M', 'U', 'X') ///< Muxer not found ++#define AVERROR_OPTION_NOT_FOUND \ ++ FFERRTAG(0xF8, 'O', 'P', 'T') ///< Option not found ++#define AVERROR_PATCHWELCOME \ ++ FFERRTAG('P', 'A', 'W', \ ++ 'E') ///< Not yet implemented in FFmpeg, patches welcome ++#define AVERROR_PROTOCOL_NOT_FOUND \ ++ FFERRTAG(0xF8, 'P', 'R', 'O') ///< Protocol not found ++ ++#define AVERROR_STREAM_NOT_FOUND \ ++ FFERRTAG(0xF8, 'S', 'T', 'R') ///< Stream not found ++/** ++ * This is semantically identical to AVERROR_BUG ++ * it has been introduced in Libav after our AVERROR_BUG and with a modified ++ * value. ++ */ ++#define AVERROR_BUG2 FFERRTAG('B', 'U', 'G', ' ') ++#define AVERROR_UNKNOWN \ ++ FFERRTAG('U', 'N', 'K', \ ++ 'N') ///< Unknown error, typically from an external library ++#define AVERROR_EXPERIMENTAL \ ++ (-0x2bb2afa8) ///< Requested feature is flagged experimental. Set ++ ///< strict_std_compliance if you really want to use it. ++#define AVERROR_INPUT_CHANGED \ ++ (-0x636e6701) ///< Input changed between calls. Reconfiguration is required. ++ ///< (can be OR-ed with AVERROR_OUTPUT_CHANGED) ++#define AVERROR_OUTPUT_CHANGED \ ++ (-0x636e6702) ///< Output changed between calls. Reconfiguration is required. ++ ///< (can be OR-ed with AVERROR_INPUT_CHANGED) ++/* HTTP & RTSP errors */ ++#define AVERROR_HTTP_BAD_REQUEST FFERRTAG(0xF8, '4', '0', '0') ++#define AVERROR_HTTP_UNAUTHORIZED FFERRTAG(0xF8, '4', '0', '1') ++#define AVERROR_HTTP_FORBIDDEN FFERRTAG(0xF8, '4', '0', '3') ++#define AVERROR_HTTP_NOT_FOUND FFERRTAG(0xF8, '4', '0', '4') ++#define AVERROR_HTTP_OTHER_4XX FFERRTAG(0xF8, '4', 'X', 'X') ++#define AVERROR_HTTP_SERVER_ERROR FFERRTAG(0xF8, '5', 'X', 'X') ++ ++#define AV_ERROR_MAX_STRING_SIZE 64 ++ ++/** ++ * Put a description of the AVERROR code errnum in errbuf. ++ * In case of failure the global variable errno is set to indicate the ++ * error. Even in case of failure av_strerror() will print a generic ++ * error message indicating the errnum provided to errbuf. ++ * ++ * @param errnum error code to describe ++ * @param errbuf buffer to which description is written ++ * @param errbuf_size the size in bytes of errbuf ++ * @return 0 on success, a negative value if a description for errnum ++ * cannot be found ++ */ ++int av_strerror(int errnum, char* errbuf, size_t errbuf_size); ++ ++/** ++ * Fill the provided buffer with a string containing an error string ++ * corresponding to the AVERROR code errnum. ++ * ++ * @param errbuf a buffer ++ * @param errbuf_size size in bytes of errbuf ++ * @param errnum error code to describe ++ * @return the buffer in input, filled with the error description ++ * @see av_strerror() ++ */ ++static inline char* av_make_error_string(char* errbuf, size_t errbuf_size, ++ int errnum) { ++ av_strerror(errnum, errbuf, errbuf_size); ++ return errbuf; ++} ++ ++/** ++ * Convenience macro, the return value should be used only directly in ++ * function arguments but never stand-alone. ++ */ ++#define av_err2str(errnum) \ ++ av_make_error_string((char[AV_ERROR_MAX_STRING_SIZE]){0}, \ ++ AV_ERROR_MAX_STRING_SIZE, errnum) ++ ++/** ++ * @} ++ */ ++ ++#endif /* AVUTIL_ERROR_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/frame.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/frame.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/frame.h +@@ -0,0 +1,927 @@ ++/* ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++/** ++ * @file ++ * @ingroup lavu_frame ++ * reference-counted frame API ++ */ ++ ++#ifndef AVUTIL_FRAME_H ++#define AVUTIL_FRAME_H ++ ++#include ++#include ++ ++#include "avutil.h" ++#include "buffer.h" ++#include "dict.h" ++#include "rational.h" ++#include "samplefmt.h" ++#include "pixfmt.h" ++#include "version.h" ++ ++/** ++ * @defgroup lavu_frame AVFrame ++ * @ingroup lavu_data ++ * ++ * @{ ++ * AVFrame is an abstraction for reference-counted raw multimedia data. ++ */ ++ ++enum AVFrameSideDataType { ++ /** ++ * The data is the AVPanScan struct defined in libavcodec. ++ */ ++ AV_FRAME_DATA_PANSCAN, ++ /** ++ * ATSC A53 Part 4 Closed Captions. ++ * A53 CC bitstream is stored as uint8_t in AVFrameSideData.data. ++ * The number of bytes of CC data is AVFrameSideData.size. ++ */ ++ AV_FRAME_DATA_A53_CC, ++ /** ++ * Stereoscopic 3d metadata. ++ * The data is the AVStereo3D struct defined in libavutil/stereo3d.h. ++ */ ++ AV_FRAME_DATA_STEREO3D, ++ /** ++ * The data is the AVMatrixEncoding enum defined in ++ * libavutil/channel_layout.h. ++ */ ++ AV_FRAME_DATA_MATRIXENCODING, ++ /** ++ * Metadata relevant to a downmix procedure. ++ * The data is the AVDownmixInfo struct defined in libavutil/downmix_info.h. ++ */ ++ AV_FRAME_DATA_DOWNMIX_INFO, ++ /** ++ * ReplayGain information in the form of the AVReplayGain struct. ++ */ ++ AV_FRAME_DATA_REPLAYGAIN, ++ /** ++ * This side data contains a 3x3 transformation matrix describing an affine ++ * transformation that needs to be applied to the frame for correct ++ * presentation. ++ * ++ * See libavutil/display.h for a detailed description of the data. ++ */ ++ AV_FRAME_DATA_DISPLAYMATRIX, ++ /** ++ * Active Format Description data consisting of a single byte as specified ++ * in ETSI TS 101 154 using AVActiveFormatDescription enum. ++ */ ++ AV_FRAME_DATA_AFD, ++ /** ++ * Motion vectors exported by some codecs (on demand through the export_mvs ++ * flag set in the libavcodec AVCodecContext flags2 option). ++ * The data is the AVMotionVector struct defined in ++ * libavutil/motion_vector.h. ++ */ ++ AV_FRAME_DATA_MOTION_VECTORS, ++ /** ++ * Recommmends skipping the specified number of samples. This is exported ++ * only if the "skip_manual" AVOption is set in libavcodec. ++ * This has the same format as AV_PKT_DATA_SKIP_SAMPLES. ++ * @code ++ * u32le number of samples to skip from start of this packet ++ * u32le number of samples to skip from end of this packet ++ * u8 reason for start skip ++ * u8 reason for end skip (0=padding silence, 1=convergence) ++ * @endcode ++ */ ++ AV_FRAME_DATA_SKIP_SAMPLES, ++ /** ++ * This side data must be associated with an audio frame and corresponds to ++ * enum AVAudioServiceType defined in avcodec.h. ++ */ ++ AV_FRAME_DATA_AUDIO_SERVICE_TYPE, ++ /** ++ * Mastering display metadata associated with a video frame. The payload is ++ * an AVMasteringDisplayMetadata type and contains information about the ++ * mastering display color volume. ++ */ ++ AV_FRAME_DATA_MASTERING_DISPLAY_METADATA, ++ /** ++ * The GOP timecode in 25 bit timecode format. Data format is 64-bit integer. ++ * This is set on the first frame of a GOP that has a temporal reference of 0. ++ */ ++ AV_FRAME_DATA_GOP_TIMECODE, ++ ++ /** ++ * The data represents the AVSphericalMapping structure defined in ++ * libavutil/spherical.h. ++ */ ++ AV_FRAME_DATA_SPHERICAL, ++ ++ /** ++ * Content light level (based on CTA-861.3). This payload contains data in ++ * the form of the AVContentLightMetadata struct. ++ */ ++ AV_FRAME_DATA_CONTENT_LIGHT_LEVEL, ++ ++ /** ++ * The data contains an ICC profile as an opaque octet buffer following the ++ * format described by ISO 15076-1 with an optional name defined in the ++ * metadata key entry "name". ++ */ ++ AV_FRAME_DATA_ICC_PROFILE, ++ ++ /** ++ * Timecode which conforms to SMPTE ST 12-1. The data is an array of 4 ++ * uint32_t where the first uint32_t describes how many (1-3) of the other ++ * timecodes are used. The timecode format is described in the documentation ++ * of av_timecode_get_smpte_from_framenum() function in libavutil/timecode.h. ++ */ ++ AV_FRAME_DATA_S12M_TIMECODE, ++ ++ /** ++ * HDR dynamic metadata associated with a video frame. The payload is ++ * an AVDynamicHDRPlus type and contains information for color ++ * volume transform - application 4 of SMPTE 2094-40:2016 standard. ++ */ ++ AV_FRAME_DATA_DYNAMIC_HDR_PLUS, ++ ++ /** ++ * Regions Of Interest, the data is an array of AVRegionOfInterest type, the ++ * number of array element is implied by AVFrameSideData.size / ++ * AVRegionOfInterest.self_size. ++ */ ++ AV_FRAME_DATA_REGIONS_OF_INTEREST, ++ ++ /** ++ * Encoding parameters for a video frame, as described by AVVideoEncParams. ++ */ ++ AV_FRAME_DATA_VIDEO_ENC_PARAMS, ++ ++ /** ++ * User data unregistered metadata associated with a video frame. ++ * This is the H.26[45] UDU SEI message, and shouldn't be used for any other ++ * purpose The data is stored as uint8_t in AVFrameSideData.data which is 16 ++ * bytes of uuid_iso_iec_11578 followed by AVFrameSideData.size - 16 bytes of ++ * user_data_payload_byte. ++ */ ++ AV_FRAME_DATA_SEI_UNREGISTERED, ++ ++ /** ++ * Film grain parameters for a frame, described by AVFilmGrainParams. ++ * Must be present for every frame which should have film grain applied. ++ */ ++ AV_FRAME_DATA_FILM_GRAIN_PARAMS, ++ ++ /** ++ * Bounding boxes for object detection and classification, ++ * as described by AVDetectionBBoxHeader. ++ */ ++ AV_FRAME_DATA_DETECTION_BBOXES, ++ ++ /** ++ * Dolby Vision RPU raw data, suitable for passing to x265 ++ * or other libraries. Array of uint8_t, with NAL emulation ++ * bytes intact. ++ */ ++ AV_FRAME_DATA_DOVI_RPU_BUFFER, ++ ++ /** ++ * Parsed Dolby Vision metadata, suitable for passing to a software ++ * implementation. The payload is the AVDOVIMetadata struct defined in ++ * libavutil/dovi_meta.h. ++ */ ++ AV_FRAME_DATA_DOVI_METADATA, ++}; ++ ++enum AVActiveFormatDescription { ++ AV_AFD_SAME = 8, ++ AV_AFD_4_3 = 9, ++ AV_AFD_16_9 = 10, ++ AV_AFD_14_9 = 11, ++ AV_AFD_4_3_SP_14_9 = 13, ++ AV_AFD_16_9_SP_14_9 = 14, ++ AV_AFD_SP_4_3 = 15, ++}; ++ ++/** ++ * Structure to hold side data for an AVFrame. ++ * ++ * sizeof(AVFrameSideData) is not a part of the public ABI, so new fields may be ++ * added to the end with a minor bump. ++ */ ++typedef struct AVFrameSideData { ++ enum AVFrameSideDataType type; ++ uint8_t* data; ++ size_t size; ++ AVDictionary* metadata; ++ AVBufferRef* buf; ++} AVFrameSideData; ++ ++/** ++ * Structure describing a single Region Of Interest. ++ * ++ * When multiple regions are defined in a single side-data block, they ++ * should be ordered from most to least important - some encoders are only ++ * capable of supporting a limited number of distinct regions, so will have ++ * to truncate the list. ++ * ++ * When overlapping regions are defined, the first region containing a given ++ * area of the frame applies. ++ */ ++typedef struct AVRegionOfInterest { ++ /** ++ * Must be set to the size of this data structure (that is, ++ * sizeof(AVRegionOfInterest)). ++ */ ++ uint32_t self_size; ++ /** ++ * Distance in pixels from the top edge of the frame to the top and ++ * bottom edges and from the left edge of the frame to the left and ++ * right edges of the rectangle defining this region of interest. ++ * ++ * The constraints on a region are encoder dependent, so the region ++ * actually affected may be slightly larger for alignment or other ++ * reasons. ++ */ ++ int top; ++ int bottom; ++ int left; ++ int right; ++ /** ++ * Quantisation offset. ++ * ++ * Must be in the range -1 to +1. A value of zero indicates no quality ++ * change. A negative value asks for better quality (less quantisation), ++ * while a positive value asks for worse quality (greater quantisation). ++ * ++ * The range is calibrated so that the extreme values indicate the ++ * largest possible offset - if the rest of the frame is encoded with the ++ * worst possible quality, an offset of -1 indicates that this region ++ * should be encoded with the best possible quality anyway. Intermediate ++ * values are then interpolated in some codec-dependent way. ++ * ++ * For example, in 10-bit H.264 the quantisation parameter varies between ++ * -12 and 51. A typical qoffset value of -1/10 therefore indicates that ++ * this region should be encoded with a QP around one-tenth of the full ++ * range better than the rest of the frame. So, if most of the frame ++ * were to be encoded with a QP of around 30, this region would get a QP ++ * of around 24 (an offset of approximately -1/10 * (51 - -12) = -6.3). ++ * An extreme value of -1 would indicate that this region should be ++ * encoded with the best possible quality regardless of the treatment of ++ * the rest of the frame - that is, should be encoded at a QP of -12. ++ */ ++ AVRational qoffset; ++} AVRegionOfInterest; ++ ++/** ++ * This structure describes decoded (raw) audio or video data. ++ * ++ * AVFrame must be allocated using av_frame_alloc(). Note that this only ++ * allocates the AVFrame itself, the buffers for the data must be managed ++ * through other means (see below). ++ * AVFrame must be freed with av_frame_free(). ++ * ++ * AVFrame is typically allocated once and then reused multiple times to hold ++ * different data (e.g. a single AVFrame to hold frames received from a ++ * decoder). In such a case, av_frame_unref() will free any references held by ++ * the frame and reset it to its original clean state before it ++ * is reused again. ++ * ++ * The data described by an AVFrame is usually reference counted through the ++ * AVBuffer API. The underlying buffer references are stored in AVFrame.buf / ++ * AVFrame.extended_buf. An AVFrame is considered to be reference counted if at ++ * least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case, ++ * every single data plane must be contained in one of the buffers in ++ * AVFrame.buf or AVFrame.extended_buf. ++ * There may be a single buffer for all the data, or one separate buffer for ++ * each plane, or anything in between. ++ * ++ * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added ++ * to the end with a minor bump. ++ * ++ * Fields can be accessed through AVOptions, the name string used, matches the ++ * C structure field name for fields accessible through AVOptions. The AVClass ++ * for AVFrame can be obtained from avcodec_get_frame_class() ++ */ ++typedef struct AVFrame { ++#define AV_NUM_DATA_POINTERS 8 ++ /** ++ * pointer to the picture/channel planes. ++ * This might be different from the first allocated byte. For video, ++ * it could even point to the end of the image data. ++ * ++ * All pointers in data and extended_data must point into one of the ++ * AVBufferRef in buf or extended_buf. ++ * ++ * Some decoders access areas outside 0,0 - width,height, please ++ * see avcodec_align_dimensions2(). Some filters and swscale can read ++ * up to 16 bytes beyond the planes, if these filters are to be used, ++ * then 16 extra bytes must be allocated. ++ * ++ * NOTE: Pointers not needed by the format MUST be set to NULL. ++ * ++ * @attention In case of video, the data[] pointers can point to the ++ * end of image data in order to reverse line order, when used in ++ * combination with negative values in the linesize[] array. ++ */ ++ uint8_t* data[AV_NUM_DATA_POINTERS]; ++ ++ /** ++ * For video, a positive or negative value, which is typically indicating ++ * the size in bytes of each picture line, but it can also be: ++ * - the negative byte size of lines for vertical flipping ++ * (with data[n] pointing to the end of the data ++ * - a positive or negative multiple of the byte size as for accessing ++ * even and odd fields of a frame (possibly flipped) ++ * ++ * For audio, only linesize[0] may be set. For planar audio, each channel ++ * plane must be the same size. ++ * ++ * For video the linesizes should be multiples of the CPUs alignment ++ * preference, this is 16 or 32 for modern desktop CPUs. ++ * Some code requires such alignment other code can be slower without ++ * correct alignment, for yet other it makes no difference. ++ * ++ * @note The linesize may be larger than the size of usable data -- there ++ * may be extra padding present for performance reasons. ++ * ++ * @attention In case of video, line size values can be negative to achieve ++ * a vertically inverted iteration over image lines. ++ */ ++ int linesize[AV_NUM_DATA_POINTERS]; ++ ++ /** ++ * pointers to the data planes/channels. ++ * ++ * For video, this should simply point to data[]. ++ * ++ * For planar audio, each channel has a separate data pointer, and ++ * linesize[0] contains the size of each channel buffer. ++ * For packed audio, there is just one data pointer, and linesize[0] ++ * contains the total size of the buffer for all channels. ++ * ++ * Note: Both data and extended_data should always be set in a valid frame, ++ * but for planar audio with more channels that can fit in data, ++ * extended_data must be used in order to access all channels. ++ */ ++ uint8_t** extended_data; ++ ++ /** ++ * @name Video dimensions ++ * Video frames only. The coded dimensions (in pixels) of the video frame, ++ * i.e. the size of the rectangle that contains some well-defined values. ++ * ++ * @note The part of the frame intended for display/presentation is further ++ * restricted by the @ref cropping "Cropping rectangle". ++ * @{ ++ */ ++ int width, height; ++ /** ++ * @} ++ */ ++ ++ /** ++ * number of audio samples (per channel) described by this frame ++ */ ++ int nb_samples; ++ ++ /** ++ * format of the frame, -1 if unknown or unset ++ * Values correspond to enum AVPixelFormat for video frames, ++ * enum AVSampleFormat for audio) ++ */ ++ int format; ++ ++ /** ++ * 1 -> keyframe, 0-> not ++ */ ++ int key_frame; ++ ++ /** ++ * Picture type of the frame. ++ */ ++ enum AVPictureType pict_type; ++ ++ /** ++ * Sample aspect ratio for the video frame, 0/1 if unknown/unspecified. ++ */ ++ AVRational sample_aspect_ratio; ++ ++ /** ++ * Presentation timestamp in time_base units (time when frame should be shown ++ * to user). ++ */ ++ int64_t pts; ++ ++ /** ++ * DTS copied from the AVPacket that triggered returning this frame. (if frame ++ * threading isn't used) This is also the Presentation time of this AVFrame ++ * calculated from only AVPacket.dts values without pts values. ++ */ ++ int64_t pkt_dts; ++ ++ /** ++ * Time base for the timestamps in this frame. ++ * In the future, this field may be set on frames output by decoders or ++ * filters, but its value will be by default ignored on input to encoders ++ * or filters. ++ */ ++ AVRational time_base; ++ ++ /** ++ * picture number in bitstream order ++ */ ++ int coded_picture_number; ++ /** ++ * picture number in display order ++ */ ++ int display_picture_number; ++ ++ /** ++ * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) ++ */ ++ int quality; ++ ++ /** ++ * for some private data of the user ++ */ ++ void* opaque; ++ ++ /** ++ * When decoding, this signals how much the picture must be delayed. ++ * extra_delay = repeat_pict / (2*fps) ++ */ ++ int repeat_pict; ++ ++ /** ++ * The content of the picture is interlaced. ++ */ ++ int interlaced_frame; ++ ++ /** ++ * If the content is interlaced, is top field displayed first. ++ */ ++ int top_field_first; ++ ++ /** ++ * Tell user application that palette has changed from previous frame. ++ */ ++ int palette_has_changed; ++ ++ /** ++ * reordered opaque 64 bits (generally an integer or a double precision float ++ * PTS but can be anything). ++ * The user sets AVCodecContext.reordered_opaque to represent the input at ++ * that time, ++ * the decoder reorders values as needed and sets AVFrame.reordered_opaque ++ * to exactly one of the values provided by the user through ++ * AVCodecContext.reordered_opaque ++ */ ++ int64_t reordered_opaque; ++ ++ /** ++ * Sample rate of the audio data. ++ */ ++ int sample_rate; ++ ++ /** ++ * Channel layout of the audio data. ++ */ ++ uint64_t channel_layout; ++ ++ /** ++ * AVBuffer references backing the data for this frame. All the pointers in ++ * data and extended_data must point inside one of the buffers in buf or ++ * extended_buf. This array must be filled contiguously -- if buf[i] is ++ * non-NULL then buf[j] must also be non-NULL for all j < i. ++ * ++ * There may be at most one AVBuffer per data plane, so for video this array ++ * always contains all the references. For planar audio with more than ++ * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in ++ * this array. Then the extra AVBufferRef pointers are stored in the ++ * extended_buf array. ++ */ ++ AVBufferRef* buf[AV_NUM_DATA_POINTERS]; ++ ++ /** ++ * For planar audio which requires more than AV_NUM_DATA_POINTERS ++ * AVBufferRef pointers, this array will hold all the references which ++ * cannot fit into AVFrame.buf. ++ * ++ * Note that this is different from AVFrame.extended_data, which always ++ * contains all the pointers. This array only contains the extra pointers, ++ * which cannot fit into AVFrame.buf. ++ * ++ * This array is always allocated using av_malloc() by whoever constructs ++ * the frame. It is freed in av_frame_unref(). ++ */ ++ AVBufferRef** extended_buf; ++ /** ++ * Number of elements in extended_buf. ++ */ ++ int nb_extended_buf; ++ ++ AVFrameSideData** side_data; ++ int nb_side_data; ++ ++/** ++ * @defgroup lavu_frame_flags AV_FRAME_FLAGS ++ * @ingroup lavu_frame ++ * Flags describing additional frame properties. ++ * ++ * @{ ++ */ ++ ++/** ++ * The frame data may be corrupted, e.g. due to decoding errors. ++ */ ++#define AV_FRAME_FLAG_CORRUPT (1 << 0) ++/** ++ * A flag to mark the frames which need to be decoded, but shouldn't be output. ++ */ ++#define AV_FRAME_FLAG_DISCARD (1 << 2) ++ /** ++ * @} ++ */ ++ ++ /** ++ * Frame flags, a combination of @ref lavu_frame_flags ++ */ ++ int flags; ++ ++ /** ++ * MPEG vs JPEG YUV range. ++ * - encoding: Set by user ++ * - decoding: Set by libavcodec ++ */ ++ enum AVColorRange color_range; ++ ++ enum AVColorPrimaries color_primaries; ++ ++ enum AVColorTransferCharacteristic color_trc; ++ ++ /** ++ * YUV colorspace type. ++ * - encoding: Set by user ++ * - decoding: Set by libavcodec ++ */ ++ enum AVColorSpace colorspace; ++ ++ enum AVChromaLocation chroma_location; ++ ++ /** ++ * frame timestamp estimated using various heuristics, in stream time base ++ * - encoding: unused ++ * - decoding: set by libavcodec, read by user. ++ */ ++ int64_t best_effort_timestamp; ++ ++ /** ++ * reordered pos from the last AVPacket that has been input into the decoder ++ * - encoding: unused ++ * - decoding: Read by user. ++ */ ++ int64_t pkt_pos; ++ ++ /** ++ * duration of the corresponding packet, expressed in ++ * AVStream->time_base units, 0 if unknown. ++ * - encoding: unused ++ * - decoding: Read by user. ++ */ ++ int64_t pkt_duration; ++ ++ /** ++ * metadata. ++ * - encoding: Set by user. ++ * - decoding: Set by libavcodec. ++ */ ++ AVDictionary* metadata; ++ ++ /** ++ * decode error flags of the frame, set to a combination of ++ * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there ++ * were errors during the decoding. ++ * - encoding: unused ++ * - decoding: set by libavcodec, read by user. ++ */ ++ int decode_error_flags; ++#define FF_DECODE_ERROR_INVALID_BITSTREAM 1 ++#define FF_DECODE_ERROR_MISSING_REFERENCE 2 ++#define FF_DECODE_ERROR_CONCEALMENT_ACTIVE 4 ++#define FF_DECODE_ERROR_DECODE_SLICES 8 ++ ++ /** ++ * number of audio channels, only used for audio. ++ * - encoding: unused ++ * - decoding: Read by user. ++ */ ++ int channels; ++ ++ /** ++ * size of the corresponding packet containing the compressed ++ * frame. ++ * It is set to a negative value if unknown. ++ * - encoding: unused ++ * - decoding: set by libavcodec, read by user. ++ */ ++ int pkt_size; ++ ++ /** ++ * For hwaccel-format frames, this should be a reference to the ++ * AVHWFramesContext describing the frame. ++ */ ++ AVBufferRef* hw_frames_ctx; ++ ++ /** ++ * AVBufferRef for free use by the API user. FFmpeg will never check the ++ * contents of the buffer ref. FFmpeg calls av_buffer_unref() on it when ++ * the frame is unreferenced. av_frame_copy_props() calls create a new ++ * reference with av_buffer_ref() for the target frame's opaque_ref field. ++ * ++ * This is unrelated to the opaque field, although it serves a similar ++ * purpose. ++ */ ++ AVBufferRef* opaque_ref; ++ ++ /** ++ * @anchor cropping ++ * @name Cropping ++ * Video frames only. The number of pixels to discard from the the ++ * top/bottom/left/right border of the frame to obtain the sub-rectangle of ++ * the frame intended for presentation. ++ * @{ ++ */ ++ size_t crop_top; ++ size_t crop_bottom; ++ size_t crop_left; ++ size_t crop_right; ++ /** ++ * @} ++ */ ++ ++ /** ++ * AVBufferRef for internal use by a single libav* library. ++ * Must not be used to transfer data between libraries. ++ * Has to be NULL when ownership of the frame leaves the respective library. ++ * ++ * Code outside the FFmpeg libs should never check or change the contents of ++ * the buffer ref. ++ * ++ * FFmpeg calls av_buffer_unref() on it when the frame is unreferenced. ++ * av_frame_copy_props() calls create a new reference with av_buffer_ref() ++ * for the target frame's private_ref field. ++ */ ++ AVBufferRef* private_ref; ++} AVFrame; ++ ++#if FF_API_COLORSPACE_NAME ++/** ++ * Get the name of a colorspace. ++ * @return a static string identifying the colorspace; can be NULL. ++ * @deprecated use av_color_space_name() ++ */ ++attribute_deprecated const char* av_get_colorspace_name(enum AVColorSpace val); ++#endif ++/** ++ * Allocate an AVFrame and set its fields to default values. The resulting ++ * struct must be freed using av_frame_free(). ++ * ++ * @return An AVFrame filled with default values or NULL on failure. ++ * ++ * @note this only allocates the AVFrame itself, not the data buffers. Those ++ * must be allocated through other means, e.g. with av_frame_get_buffer() or ++ * manually. ++ */ ++AVFrame* av_frame_alloc(void); ++ ++/** ++ * Free the frame and any dynamically allocated objects in it, ++ * e.g. extended_data. If the frame is reference counted, it will be ++ * unreferenced first. ++ * ++ * @param frame frame to be freed. The pointer will be set to NULL. ++ */ ++void av_frame_free(AVFrame** frame); ++ ++/** ++ * Set up a new reference to the data described by the source frame. ++ * ++ * Copy frame properties from src to dst and create a new reference for each ++ * AVBufferRef from src. ++ * ++ * If src is not reference counted, new buffers are allocated and the data is ++ * copied. ++ * ++ * @warning: dst MUST have been either unreferenced with av_frame_unref(dst), ++ * or newly allocated with av_frame_alloc() before calling this ++ * function, or undefined behavior will occur. ++ * ++ * @return 0 on success, a negative AVERROR on error ++ */ ++int av_frame_ref(AVFrame* dst, const AVFrame* src); ++ ++/** ++ * Create a new frame that references the same data as src. ++ * ++ * This is a shortcut for av_frame_alloc()+av_frame_ref(). ++ * ++ * @return newly created AVFrame on success, NULL on error. ++ */ ++AVFrame* av_frame_clone(const AVFrame* src); ++ ++/** ++ * Unreference all the buffers referenced by frame and reset the frame fields. ++ */ ++void av_frame_unref(AVFrame* frame); ++ ++/** ++ * Move everything contained in src to dst and reset src. ++ * ++ * @warning: dst is not unreferenced, but directly overwritten without reading ++ * or deallocating its contents. Call av_frame_unref(dst) manually ++ * before calling this function to ensure that no memory is leaked. ++ */ ++void av_frame_move_ref(AVFrame* dst, AVFrame* src); ++ ++/** ++ * Allocate new buffer(s) for audio or video data. ++ * ++ * The following fields must be set on frame before calling this function: ++ * - format (pixel format for video, sample format for audio) ++ * - width and height for video ++ * - nb_samples and channel_layout for audio ++ * ++ * This function will fill AVFrame.data and AVFrame.buf arrays and, if ++ * necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf. ++ * For planar formats, one buffer will be allocated for each plane. ++ * ++ * @warning: if frame already has been allocated, calling this function will ++ * leak memory. In addition, undefined behavior can occur in certain ++ * cases. ++ * ++ * @param frame frame in which to store the new buffers. ++ * @param align Required buffer size alignment. If equal to 0, alignment will be ++ * chosen automatically for the current CPU. It is highly ++ * recommended to pass 0 here unless you know what you are doing. ++ * ++ * @return 0 on success, a negative AVERROR on error. ++ */ ++int av_frame_get_buffer(AVFrame* frame, int align); ++ ++/** ++ * Check if the frame data is writable. ++ * ++ * @return A positive value if the frame data is writable (which is true if and ++ * only if each of the underlying buffers has only one reference, namely the one ++ * stored in this frame). Return 0 otherwise. ++ * ++ * If 1 is returned the answer is valid until av_buffer_ref() is called on any ++ * of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly). ++ * ++ * @see av_frame_make_writable(), av_buffer_is_writable() ++ */ ++int av_frame_is_writable(AVFrame* frame); ++ ++/** ++ * Ensure that the frame data is writable, avoiding data copy if possible. ++ * ++ * Do nothing if the frame is writable, allocate new buffers and copy the data ++ * if it is not. ++ * ++ * @return 0 on success, a negative AVERROR on error. ++ * ++ * @see av_frame_is_writable(), av_buffer_is_writable(), ++ * av_buffer_make_writable() ++ */ ++int av_frame_make_writable(AVFrame* frame); ++ ++/** ++ * Copy the frame data from src to dst. ++ * ++ * This function does not allocate anything, dst must be already initialized and ++ * allocated with the same parameters as src. ++ * ++ * This function only copies the frame data (i.e. the contents of the data / ++ * extended data arrays), not any other properties. ++ * ++ * @return >= 0 on success, a negative AVERROR on error. ++ */ ++int av_frame_copy(AVFrame* dst, const AVFrame* src); ++ ++/** ++ * Copy only "metadata" fields from src to dst. ++ * ++ * Metadata for the purpose of this function are those fields that do not affect ++ * the data layout in the buffers. E.g. pts, sample rate (for audio) or sample ++ * aspect ratio (for video), but not width/height or channel layout. ++ * Side data is also copied. ++ */ ++int av_frame_copy_props(AVFrame* dst, const AVFrame* src); ++ ++/** ++ * Get the buffer reference a given data plane is stored in. ++ * ++ * @param plane index of the data plane of interest in frame->extended_data. ++ * ++ * @return the buffer reference that contains the plane or NULL if the input ++ * frame is not valid. ++ */ ++AVBufferRef* av_frame_get_plane_buffer(AVFrame* frame, int plane); ++ ++/** ++ * Add a new side data to a frame. ++ * ++ * @param frame a frame to which the side data should be added ++ * @param type type of the added side data ++ * @param size size of the side data ++ * ++ * @return newly added side data on success, NULL on error ++ */ ++AVFrameSideData* av_frame_new_side_data(AVFrame* frame, ++ enum AVFrameSideDataType type, ++ size_t size); ++ ++/** ++ * Add a new side data to a frame from an existing AVBufferRef ++ * ++ * @param frame a frame to which the side data should be added ++ * @param type the type of the added side data ++ * @param buf an AVBufferRef to add as side data. The ownership of ++ * the reference is transferred to the frame. ++ * ++ * @return newly added side data on success, NULL on error. On failure ++ * the frame is unchanged and the AVBufferRef remains owned by ++ * the caller. ++ */ ++AVFrameSideData* av_frame_new_side_data_from_buf(AVFrame* frame, ++ enum AVFrameSideDataType type, ++ AVBufferRef* buf); ++ ++/** ++ * @return a pointer to the side data of a given type on success, NULL if there ++ * is no side data with such type in this frame. ++ */ ++AVFrameSideData* av_frame_get_side_data(const AVFrame* frame, ++ enum AVFrameSideDataType type); ++ ++/** ++ * Remove and free all side data instances of the given type. ++ */ ++void av_frame_remove_side_data(AVFrame* frame, enum AVFrameSideDataType type); ++ ++/** ++ * Flags for frame cropping. ++ */ ++enum { ++ /** ++ * Apply the maximum possible cropping, even if it requires setting the ++ * AVFrame.data[] entries to unaligned pointers. Passing unaligned data ++ * to FFmpeg API is generally not allowed, and causes undefined behavior ++ * (such as crashes). You can pass unaligned data only to FFmpeg APIs that ++ * are explicitly documented to accept it. Use this flag only if you ++ * absolutely know what you are doing. ++ */ ++ AV_FRAME_CROP_UNALIGNED = 1 << 0, ++}; ++ ++/** ++ * Crop the given video AVFrame according to its crop_left/crop_top/crop_right/ ++ * crop_bottom fields. If cropping is successful, the function will adjust the ++ * data pointers and the width/height fields, and set the crop fields to 0. ++ * ++ * In all cases, the cropping boundaries will be rounded to the inherent ++ * alignment of the pixel format. In some cases, such as for opaque hwaccel ++ * formats, the left/top cropping is ignored. The crop fields are set to 0 even ++ * if the cropping was rounded or ignored. ++ * ++ * @param frame the frame which should be cropped ++ * @param flags Some combination of AV_FRAME_CROP_* flags, or 0. ++ * ++ * @return >= 0 on success, a negative AVERROR on error. If the cropping fields ++ * were invalid, AVERROR(ERANGE) is returned, and nothing is changed. ++ */ ++int av_frame_apply_cropping(AVFrame* frame, int flags); ++ ++/** ++ * @return a string identifying the side data type ++ */ ++const char* av_frame_side_data_name(enum AVFrameSideDataType type); ++ ++/** ++ * @} ++ */ ++ ++#endif /* AVUTIL_FRAME_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/hwcontext.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/hwcontext.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/hwcontext.h +@@ -0,0 +1,601 @@ ++/* ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifndef AVUTIL_HWCONTEXT_H ++#define AVUTIL_HWCONTEXT_H ++ ++#include "buffer.h" ++#include "frame.h" ++#include "log.h" ++#include "pixfmt.h" ++ ++enum AVHWDeviceType { ++ AV_HWDEVICE_TYPE_NONE, ++ AV_HWDEVICE_TYPE_VDPAU, ++ AV_HWDEVICE_TYPE_CUDA, ++ AV_HWDEVICE_TYPE_VAAPI, ++ AV_HWDEVICE_TYPE_DXVA2, ++ AV_HWDEVICE_TYPE_QSV, ++ AV_HWDEVICE_TYPE_VIDEOTOOLBOX, ++ AV_HWDEVICE_TYPE_D3D11VA, ++ AV_HWDEVICE_TYPE_DRM, ++ AV_HWDEVICE_TYPE_OPENCL, ++ AV_HWDEVICE_TYPE_MEDIACODEC, ++ AV_HWDEVICE_TYPE_VULKAN, ++}; ++ ++typedef struct AVHWDeviceInternal AVHWDeviceInternal; ++ ++/** ++ * This struct aggregates all the (hardware/vendor-specific) "high-level" state, ++ * i.e. state that is not tied to a concrete processing configuration. ++ * E.g., in an API that supports hardware-accelerated encoding and decoding, ++ * this struct will (if possible) wrap the state that is common to both encoding ++ * and decoding and from which specific instances of encoders or decoders can be ++ * derived. ++ * ++ * This struct is reference-counted with the AVBuffer mechanism. The ++ * av_hwdevice_ctx_alloc() constructor yields a reference, whose data field ++ * points to the actual AVHWDeviceContext. Further objects derived from ++ * AVHWDeviceContext (such as AVHWFramesContext, describing a frame pool with ++ * specific properties) will hold an internal reference to it. After all the ++ * references are released, the AVHWDeviceContext itself will be freed, ++ * optionally invoking a user-specified callback for uninitializing the hardware ++ * state. ++ */ ++typedef struct AVHWDeviceContext { ++ /** ++ * A class for logging. Set by av_hwdevice_ctx_alloc(). ++ */ ++ const AVClass* av_class; ++ ++ /** ++ * Private data used internally by libavutil. Must not be accessed in any ++ * way by the caller. ++ */ ++ AVHWDeviceInternal* internal; ++ ++ /** ++ * This field identifies the underlying API used for hardware access. ++ * ++ * This field is set when this struct is allocated and never changed ++ * afterwards. ++ */ ++ enum AVHWDeviceType type; ++ ++ /** ++ * The format-specific data, allocated and freed by libavutil along with ++ * this context. ++ * ++ * Should be cast by the user to the format-specific context defined in the ++ * corresponding header (hwcontext_*.h) and filled as described in the ++ * documentation before calling av_hwdevice_ctx_init(). ++ * ++ * After calling av_hwdevice_ctx_init() this struct should not be modified ++ * by the caller. ++ */ ++ void* hwctx; ++ ++ /** ++ * This field may be set by the caller before calling av_hwdevice_ctx_init(). ++ * ++ * If non-NULL, this callback will be called when the last reference to ++ * this context is unreferenced, immediately before it is freed. ++ * ++ * @note when other objects (e.g an AVHWFramesContext) are derived from this ++ * struct, this callback will be invoked after all such child objects ++ * are fully uninitialized and their respective destructors invoked. ++ */ ++ void (*free)(struct AVHWDeviceContext* ctx); ++ ++ /** ++ * Arbitrary user data, to be used e.g. by the free() callback. ++ */ ++ void* user_opaque; ++} AVHWDeviceContext; ++ ++typedef struct AVHWFramesInternal AVHWFramesInternal; ++ ++/** ++ * This struct describes a set or pool of "hardware" frames (i.e. those with ++ * data not located in normal system memory). All the frames in the pool are ++ * assumed to be allocated in the same way and interchangeable. ++ * ++ * This struct is reference-counted with the AVBuffer mechanism and tied to a ++ * given AVHWDeviceContext instance. The av_hwframe_ctx_alloc() constructor ++ * yields a reference, whose data field points to the actual AVHWFramesContext ++ * struct. ++ */ ++typedef struct AVHWFramesContext { ++ /** ++ * A class for logging. ++ */ ++ const AVClass* av_class; ++ ++ /** ++ * Private data used internally by libavutil. Must not be accessed in any ++ * way by the caller. ++ */ ++ AVHWFramesInternal* internal; ++ ++ /** ++ * A reference to the parent AVHWDeviceContext. This reference is owned and ++ * managed by the enclosing AVHWFramesContext, but the caller may derive ++ * additional references from it. ++ */ ++ AVBufferRef* device_ref; ++ ++ /** ++ * The parent AVHWDeviceContext. This is simply a pointer to ++ * device_ref->data provided for convenience. ++ * ++ * Set by libavutil in av_hwframe_ctx_init(). ++ */ ++ AVHWDeviceContext* device_ctx; ++ ++ /** ++ * The format-specific data, allocated and freed automatically along with ++ * this context. ++ * ++ * Should be cast by the user to the format-specific context defined in the ++ * corresponding header (hwframe_*.h) and filled as described in the ++ * documentation before calling av_hwframe_ctx_init(). ++ * ++ * After any frames using this context are created, the contents of this ++ * struct should not be modified by the caller. ++ */ ++ void* hwctx; ++ ++ /** ++ * This field may be set by the caller before calling av_hwframe_ctx_init(). ++ * ++ * If non-NULL, this callback will be called when the last reference to ++ * this context is unreferenced, immediately before it is freed. ++ */ ++ void (*free)(struct AVHWFramesContext* ctx); ++ ++ /** ++ * Arbitrary user data, to be used e.g. by the free() callback. ++ */ ++ void* user_opaque; ++ ++ /** ++ * A pool from which the frames are allocated by av_hwframe_get_buffer(). ++ * This field may be set by the caller before calling av_hwframe_ctx_init(). ++ * The buffers returned by calling av_buffer_pool_get() on this pool must ++ * have the properties described in the documentation in the corresponding hw ++ * type's header (hwcontext_*.h). The pool will be freed strictly before ++ * this struct's free() callback is invoked. ++ * ++ * This field may be NULL, then libavutil will attempt to allocate a pool ++ * internally. Note that certain device types enforce pools allocated at ++ * fixed size (frame count), which cannot be extended dynamically. In such a ++ * case, initial_pool_size must be set appropriately. ++ */ ++ AVBufferPool* pool; ++ ++ /** ++ * Initial size of the frame pool. If a device type does not support ++ * dynamically resizing the pool, then this is also the maximum pool size. ++ * ++ * May be set by the caller before calling av_hwframe_ctx_init(). Must be ++ * set if pool is NULL and the device type does not support dynamic pools. ++ */ ++ int initial_pool_size; ++ ++ /** ++ * The pixel format identifying the underlying HW surface type. ++ * ++ * Must be a hwaccel format, i.e. the corresponding descriptor must have the ++ * AV_PIX_FMT_FLAG_HWACCEL flag set. ++ * ++ * Must be set by the user before calling av_hwframe_ctx_init(). ++ */ ++ enum AVPixelFormat format; ++ ++ /** ++ * The pixel format identifying the actual data layout of the hardware ++ * frames. ++ * ++ * Must be set by the caller before calling av_hwframe_ctx_init(). ++ * ++ * @note when the underlying API does not provide the exact data layout, but ++ * only the colorspace/bit depth, this field should be set to the fully ++ * planar version of that format (e.g. for 8-bit 420 YUV it should be ++ * AV_PIX_FMT_YUV420P, not AV_PIX_FMT_NV12 or anything else). ++ */ ++ enum AVPixelFormat sw_format; ++ ++ /** ++ * The allocated dimensions of the frames in this pool. ++ * ++ * Must be set by the user before calling av_hwframe_ctx_init(). ++ */ ++ int width, height; ++} AVHWFramesContext; ++ ++/** ++ * Look up an AVHWDeviceType by name. ++ * ++ * @param name String name of the device type (case-insensitive). ++ * @return The type from enum AVHWDeviceType, or AV_HWDEVICE_TYPE_NONE if ++ * not found. ++ */ ++enum AVHWDeviceType av_hwdevice_find_type_by_name(const char* name); ++ ++/** Get the string name of an AVHWDeviceType. ++ * ++ * @param type Type from enum AVHWDeviceType. ++ * @return Pointer to a static string containing the name, or NULL if the type ++ * is not valid. ++ */ ++const char* av_hwdevice_get_type_name(enum AVHWDeviceType type); ++ ++/** ++ * Iterate over supported device types. ++ * ++ * @param type AV_HWDEVICE_TYPE_NONE initially, then the previous type ++ * returned by this function in subsequent iterations. ++ * @return The next usable device type from enum AVHWDeviceType, or ++ * AV_HWDEVICE_TYPE_NONE if there are no more. ++ */ ++enum AVHWDeviceType av_hwdevice_iterate_types(enum AVHWDeviceType prev); ++ ++/** ++ * Allocate an AVHWDeviceContext for a given hardware type. ++ * ++ * @param type the type of the hardware device to allocate. ++ * @return a reference to the newly created AVHWDeviceContext on success or NULL ++ * on failure. ++ */ ++AVBufferRef* av_hwdevice_ctx_alloc(enum AVHWDeviceType type); ++ ++/** ++ * Finalize the device context before use. This function must be called after ++ * the context is filled with all the required information and before it is ++ * used in any way. ++ * ++ * @param ref a reference to the AVHWDeviceContext ++ * @return 0 on success, a negative AVERROR code on failure ++ */ ++int av_hwdevice_ctx_init(AVBufferRef* ref); ++ ++/** ++ * Open a device of the specified type and create an AVHWDeviceContext for it. ++ * ++ * This is a convenience function intended to cover the simple cases. Callers ++ * who need to fine-tune device creation/management should open the device ++ * manually and then wrap it in an AVHWDeviceContext using ++ * av_hwdevice_ctx_alloc()/av_hwdevice_ctx_init(). ++ * ++ * The returned context is already initialized and ready for use, the caller ++ * should not call av_hwdevice_ctx_init() on it. The user_opaque/free fields of ++ * the created AVHWDeviceContext are set by this function and should not be ++ * touched by the caller. ++ * ++ * @param device_ctx On success, a reference to the newly-created device context ++ * will be written here. The reference is owned by the caller ++ * and must be released with av_buffer_unref() when no longer ++ * needed. On failure, NULL will be written to this pointer. ++ * @param type The type of the device to create. ++ * @param device A type-specific string identifying the device to open. ++ * @param opts A dictionary of additional (type-specific) options to use in ++ * opening the device. The dictionary remains owned by the caller. ++ * @param flags currently unused ++ * ++ * @return 0 on success, a negative AVERROR code on failure. ++ */ ++int av_hwdevice_ctx_create(AVBufferRef** device_ctx, enum AVHWDeviceType type, ++ const char* device, AVDictionary* opts, int flags); ++ ++/** ++ * Create a new device of the specified type from an existing device. ++ * ++ * If the source device is a device of the target type or was originally ++ * derived from such a device (possibly through one or more intermediate ++ * devices of other types), then this will return a reference to the ++ * existing device of the same type as is requested. ++ * ++ * Otherwise, it will attempt to derive a new device from the given source ++ * device. If direct derivation to the new type is not implemented, it will ++ * attempt the same derivation from each ancestor of the source device in ++ * turn looking for an implemented derivation method. ++ * ++ * @param dst_ctx On success, a reference to the newly-created ++ * AVHWDeviceContext. ++ * @param type The type of the new device to create. ++ * @param src_ctx A reference to an existing AVHWDeviceContext which will be ++ * used to create the new device. ++ * @param flags Currently unused; should be set to zero. ++ * @return Zero on success, a negative AVERROR code on failure. ++ */ ++int av_hwdevice_ctx_create_derived(AVBufferRef** dst_ctx, ++ enum AVHWDeviceType type, ++ AVBufferRef* src_ctx, int flags); ++ ++/** ++ * Create a new device of the specified type from an existing device. ++ * ++ * This function performs the same action as av_hwdevice_ctx_create_derived, ++ * however, it is able to set options for the new device to be derived. ++ * ++ * @param dst_ctx On success, a reference to the newly-created ++ * AVHWDeviceContext. ++ * @param type The type of the new device to create. ++ * @param src_ctx A reference to an existing AVHWDeviceContext which will be ++ * used to create the new device. ++ * @param options Options for the new device to create, same format as in ++ * av_hwdevice_ctx_create. ++ * @param flags Currently unused; should be set to zero. ++ * @return Zero on success, a negative AVERROR code on failure. ++ */ ++int av_hwdevice_ctx_create_derived_opts(AVBufferRef** dst_ctx, ++ enum AVHWDeviceType type, ++ AVBufferRef* src_ctx, ++ AVDictionary* options, int flags); ++ ++/** ++ * Allocate an AVHWFramesContext tied to a given device context. ++ * ++ * @param device_ctx a reference to a AVHWDeviceContext. This function will make ++ * a new reference for internal use, the one passed to the ++ * function remains owned by the caller. ++ * @return a reference to the newly created AVHWFramesContext on success or NULL ++ * on failure. ++ */ ++AVBufferRef* av_hwframe_ctx_alloc(AVBufferRef* device_ctx); ++ ++/** ++ * Finalize the context before use. This function must be called after the ++ * context is filled with all the required information and before it is attached ++ * to any frames. ++ * ++ * @param ref a reference to the AVHWFramesContext ++ * @return 0 on success, a negative AVERROR code on failure ++ */ ++int av_hwframe_ctx_init(AVBufferRef* ref); ++ ++/** ++ * Allocate a new frame attached to the given AVHWFramesContext. ++ * ++ * @param hwframe_ctx a reference to an AVHWFramesContext ++ * @param frame an empty (freshly allocated or unreffed) frame to be filled with ++ * newly allocated buffers. ++ * @param flags currently unused, should be set to zero ++ * @return 0 on success, a negative AVERROR code on failure ++ */ ++int av_hwframe_get_buffer(AVBufferRef* hwframe_ctx, AVFrame* frame, int flags); ++ ++/** ++ * Copy data to or from a hw surface. At least one of dst/src must have an ++ * AVHWFramesContext attached. ++ * ++ * If src has an AVHWFramesContext attached, then the format of dst (if set) ++ * must use one of the formats returned by av_hwframe_transfer_get_formats(src, ++ * AV_HWFRAME_TRANSFER_DIRECTION_FROM). ++ * If dst has an AVHWFramesContext attached, then the format of src must use one ++ * of the formats returned by av_hwframe_transfer_get_formats(dst, ++ * AV_HWFRAME_TRANSFER_DIRECTION_TO) ++ * ++ * dst may be "clean" (i.e. with data/buf pointers unset), in which case the ++ * data buffers will be allocated by this function using av_frame_get_buffer(). ++ * If dst->format is set, then this format will be used, otherwise (when ++ * dst->format is AV_PIX_FMT_NONE) the first acceptable format will be chosen. ++ * ++ * The two frames must have matching allocated dimensions (i.e. equal to ++ * AVHWFramesContext.width/height), since not all device types support ++ * transferring a sub-rectangle of the whole surface. The display dimensions ++ * (i.e. AVFrame.width/height) may be smaller than the allocated dimensions, but ++ * also have to be equal for both frames. When the display dimensions are ++ * smaller than the allocated dimensions, the content of the padding in the ++ * destination frame is unspecified. ++ * ++ * @param dst the destination frame. dst is not touched on failure. ++ * @param src the source frame. ++ * @param flags currently unused, should be set to zero ++ * @return 0 on success, a negative AVERROR error code on failure. ++ */ ++int av_hwframe_transfer_data(AVFrame* dst, const AVFrame* src, int flags); ++ ++enum AVHWFrameTransferDirection { ++ /** ++ * Transfer the data from the queried hw frame. ++ */ ++ AV_HWFRAME_TRANSFER_DIRECTION_FROM, ++ ++ /** ++ * Transfer the data to the queried hw frame. ++ */ ++ AV_HWFRAME_TRANSFER_DIRECTION_TO, ++}; ++ ++/** ++ * Get a list of possible source or target formats usable in ++ * av_hwframe_transfer_data(). ++ * ++ * @param hwframe_ctx the frame context to obtain the information for ++ * @param dir the direction of the transfer ++ * @param formats the pointer to the output format list will be written here. ++ * The list is terminated with AV_PIX_FMT_NONE and must be freed ++ * by the caller when no longer needed using av_free(). ++ * If this function returns successfully, the format list will ++ * have at least one item (not counting the terminator). ++ * On failure, the contents of this pointer are unspecified. ++ * @param flags currently unused, should be set to zero ++ * @return 0 on success, a negative AVERROR code on failure. ++ */ ++int av_hwframe_transfer_get_formats(AVBufferRef* hwframe_ctx, ++ enum AVHWFrameTransferDirection dir, ++ enum AVPixelFormat** formats, int flags); ++ ++/** ++ * This struct describes the constraints on hardware frames attached to ++ * a given device with a hardware-specific configuration. This is returned ++ * by av_hwdevice_get_hwframe_constraints() and must be freed by ++ * av_hwframe_constraints_free() after use. ++ */ ++typedef struct AVHWFramesConstraints { ++ /** ++ * A list of possible values for format in the hw_frames_ctx, ++ * terminated by AV_PIX_FMT_NONE. This member will always be filled. ++ */ ++ enum AVPixelFormat* valid_hw_formats; ++ ++ /** ++ * A list of possible values for sw_format in the hw_frames_ctx, ++ * terminated by AV_PIX_FMT_NONE. Can be NULL if this information is ++ * not known. ++ */ ++ enum AVPixelFormat* valid_sw_formats; ++ ++ /** ++ * The minimum size of frames in this hw_frames_ctx. ++ * (Zero if not known.) ++ */ ++ int min_width; ++ int min_height; ++ ++ /** ++ * The maximum size of frames in this hw_frames_ctx. ++ * (INT_MAX if not known / no limit.) ++ */ ++ int max_width; ++ int max_height; ++} AVHWFramesConstraints; ++ ++/** ++ * Allocate a HW-specific configuration structure for a given HW device. ++ * After use, the user must free all members as required by the specific ++ * hardware structure being used, then free the structure itself with ++ * av_free(). ++ * ++ * @param device_ctx a reference to the associated AVHWDeviceContext. ++ * @return The newly created HW-specific configuration structure on ++ * success or NULL on failure. ++ */ ++void* av_hwdevice_hwconfig_alloc(AVBufferRef* device_ctx); ++ ++/** ++ * Get the constraints on HW frames given a device and the HW-specific ++ * configuration to be used with that device. If no HW-specific ++ * configuration is provided, returns the maximum possible capabilities ++ * of the device. ++ * ++ * @param ref a reference to the associated AVHWDeviceContext. ++ * @param hwconfig a filled HW-specific configuration structure, or NULL ++ * to return the maximum possible capabilities of the device. ++ * @return AVHWFramesConstraints structure describing the constraints ++ * on the device, or NULL if not available. ++ */ ++AVHWFramesConstraints* av_hwdevice_get_hwframe_constraints( ++ AVBufferRef* ref, const void* hwconfig); ++ ++/** ++ * Free an AVHWFrameConstraints structure. ++ * ++ * @param constraints The (filled or unfilled) AVHWFrameConstraints structure. ++ */ ++void av_hwframe_constraints_free(AVHWFramesConstraints** constraints); ++ ++/** ++ * Flags to apply to frame mappings. ++ */ ++enum { ++ /** ++ * The mapping must be readable. ++ */ ++ AV_HWFRAME_MAP_READ = 1 << 0, ++ /** ++ * The mapping must be writeable. ++ */ ++ AV_HWFRAME_MAP_WRITE = 1 << 1, ++ /** ++ * The mapped frame will be overwritten completely in subsequent ++ * operations, so the current frame data need not be loaded. Any values ++ * which are not overwritten are unspecified. ++ */ ++ AV_HWFRAME_MAP_OVERWRITE = 1 << 2, ++ /** ++ * The mapping must be direct. That is, there must not be any copying in ++ * the map or unmap steps. Note that performance of direct mappings may ++ * be much lower than normal memory. ++ */ ++ AV_HWFRAME_MAP_DIRECT = 1 << 3, ++}; ++ ++/** ++ * Map a hardware frame. ++ * ++ * This has a number of different possible effects, depending on the format ++ * and origin of the src and dst frames. On input, src should be a usable ++ * frame with valid buffers and dst should be blank (typically as just created ++ * by av_frame_alloc()). src should have an associated hwframe context, and ++ * dst may optionally have a format and associated hwframe context. ++ * ++ * If src was created by mapping a frame from the hwframe context of dst, ++ * then this function undoes the mapping - dst is replaced by a reference to ++ * the frame that src was originally mapped from. ++ * ++ * If both src and dst have an associated hwframe context, then this function ++ * attempts to map the src frame from its hardware context to that of dst and ++ * then fill dst with appropriate data to be usable there. This will only be ++ * possible if the hwframe contexts and associated devices are compatible - ++ * given compatible devices, av_hwframe_ctx_create_derived() can be used to ++ * create a hwframe context for dst in which mapping should be possible. ++ * ++ * If src has a hwframe context but dst does not, then the src frame is ++ * mapped to normal memory and should thereafter be usable as a normal frame. ++ * If the format is set on dst, then the mapping will attempt to create dst ++ * with that format and fail if it is not possible. If format is unset (is ++ * AV_PIX_FMT_NONE) then dst will be mapped with whatever the most appropriate ++ * format to use is (probably the sw_format of the src hwframe context). ++ * ++ * A return value of AVERROR(ENOSYS) indicates that the mapping is not ++ * possible with the given arguments and hwframe setup, while other return ++ * values indicate that it failed somehow. ++ * ++ * @param dst Destination frame, to contain the mapping. ++ * @param src Source frame, to be mapped. ++ * @param flags Some combination of AV_HWFRAME_MAP_* flags. ++ * @return Zero on success, negative AVERROR code on failure. ++ */ ++int av_hwframe_map(AVFrame* dst, const AVFrame* src, int flags); ++ ++/** ++ * Create and initialise an AVHWFramesContext as a mapping of another existing ++ * AVHWFramesContext on a different device. ++ * ++ * av_hwframe_ctx_init() should not be called after this. ++ * ++ * @param derived_frame_ctx On success, a reference to the newly created ++ * AVHWFramesContext. ++ * @param derived_device_ctx A reference to the device to create the new ++ * AVHWFramesContext on. ++ * @param source_frame_ctx A reference to an existing AVHWFramesContext ++ * which will be mapped to the derived context. ++ * @param flags Some combination of AV_HWFRAME_MAP_* flags, defining the ++ * mapping parameters to apply to frames which are allocated ++ * in the derived device. ++ * @return Zero on success, negative AVERROR code on failure. ++ */ ++int av_hwframe_ctx_create_derived(AVBufferRef** derived_frame_ctx, ++ enum AVPixelFormat format, ++ AVBufferRef* derived_device_ctx, ++ AVBufferRef* source_frame_ctx, int flags); ++ ++#endif /* AVUTIL_HWCONTEXT_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/hwcontext_vaapi.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/hwcontext_vaapi.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/hwcontext_vaapi.h +@@ -0,0 +1,117 @@ ++/* ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifndef AVUTIL_HWCONTEXT_VAAPI_H ++#define AVUTIL_HWCONTEXT_VAAPI_H ++ ++#include ++ ++/** ++ * @file ++ * API-specific header for AV_HWDEVICE_TYPE_VAAPI. ++ * ++ * Dynamic frame pools are supported, but note that any pool used as a render ++ * target is required to be of fixed size in order to be be usable as an ++ * argument to vaCreateContext(). ++ * ++ * For user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs ++ * with the data pointer set to a VASurfaceID. ++ */ ++ ++enum { ++ /** ++ * The quirks field has been set by the user and should not be detected ++ * automatically by av_hwdevice_ctx_init(). ++ */ ++ AV_VAAPI_DRIVER_QUIRK_USER_SET = (1 << 0), ++ /** ++ * The driver does not destroy parameter buffers when they are used by ++ * vaRenderPicture(). Additional code will be required to destroy them ++ * separately afterwards. ++ */ ++ AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS = (1 << 1), ++ ++ /** ++ * The driver does not support the VASurfaceAttribMemoryType attribute, ++ * so the surface allocation code will not try to use it. ++ */ ++ AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE = (1 << 2), ++ ++ /** ++ * The driver does not support surface attributes at all. ++ * The surface allocation code will never pass them to surface allocation, ++ * and the results of the vaQuerySurfaceAttributes() call will be faked. ++ */ ++ AV_VAAPI_DRIVER_QUIRK_SURFACE_ATTRIBUTES = (1 << 3), ++}; ++ ++/** ++ * VAAPI connection details. ++ * ++ * Allocated as AVHWDeviceContext.hwctx ++ */ ++typedef struct AVVAAPIDeviceContext { ++ /** ++ * The VADisplay handle, to be filled by the user. ++ */ ++ VADisplay display; ++ /** ++ * Driver quirks to apply - this is filled by av_hwdevice_ctx_init(), ++ * with reference to a table of known drivers, unless the ++ * AV_VAAPI_DRIVER_QUIRK_USER_SET bit is already present. The user ++ * may need to refer to this field when performing any later ++ * operations using VAAPI with the same VADisplay. ++ */ ++ unsigned int driver_quirks; ++} AVVAAPIDeviceContext; ++ ++/** ++ * VAAPI-specific data associated with a frame pool. ++ * ++ * Allocated as AVHWFramesContext.hwctx. ++ */ ++typedef struct AVVAAPIFramesContext { ++ /** ++ * Set by the user to apply surface attributes to all surfaces in ++ * the frame pool. If null, default settings are used. ++ */ ++ VASurfaceAttrib* attributes; ++ int nb_attributes; ++ /** ++ * The surfaces IDs of all surfaces in the pool after creation. ++ * Only valid if AVHWFramesContext.initial_pool_size was positive. ++ * These are intended to be used as the render_targets arguments to ++ * vaCreateContext(). ++ */ ++ VASurfaceID* surface_ids; ++ int nb_surfaces; ++} AVVAAPIFramesContext; ++ ++/** ++ * VAAPI hardware pipeline configuration details. ++ * ++ * Allocated with av_hwdevice_hwconfig_alloc(). ++ */ ++typedef struct AVVAAPIHWConfig { ++ /** ++ * ID of a VAAPI pipeline configuration. ++ */ ++ VAConfigID config_id; ++} AVVAAPIHWConfig; ++ ++#endif /* AVUTIL_HWCONTEXT_VAAPI_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/intfloat.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/intfloat.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/intfloat.h +@@ -0,0 +1,73 @@ ++/* ++ * Copyright (c) 2011 Mans Rullgard ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifndef AVUTIL_INTFLOAT_H ++#define AVUTIL_INTFLOAT_H ++ ++#include ++#include "attributes.h" ++ ++union av_intfloat32 { ++ uint32_t i; ++ float f; ++}; ++ ++union av_intfloat64 { ++ uint64_t i; ++ double f; ++}; ++ ++/** ++ * Reinterpret a 32-bit integer as a float. ++ */ ++static av_always_inline float av_int2float(uint32_t i) { ++ union av_intfloat32 v; ++ v.i = i; ++ return v.f; ++} ++ ++/** ++ * Reinterpret a float as a 32-bit integer. ++ */ ++static av_always_inline uint32_t av_float2int(float f) { ++ union av_intfloat32 v; ++ v.f = f; ++ return v.i; ++} ++ ++/** ++ * Reinterpret a 64-bit integer as a double. ++ */ ++static av_always_inline double av_int2double(uint64_t i) { ++ union av_intfloat64 v; ++ v.i = i; ++ return v.f; ++} ++ ++/** ++ * Reinterpret a double as a 64-bit integer. ++ */ ++static av_always_inline uint64_t av_double2int(double f) { ++ union av_intfloat64 v; ++ v.f = f; ++ return v.i; ++} ++ ++#endif /* AVUTIL_INTFLOAT_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/log.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/log.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/log.h +@@ -0,0 +1,388 @@ ++/* ++ * copyright (c) 2006 Michael Niedermayer ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifndef AVUTIL_LOG_H ++#define AVUTIL_LOG_H ++ ++#include ++#include "avutil.h" ++#include "attributes.h" ++ ++typedef enum { ++ AV_CLASS_CATEGORY_NA = 0, ++ AV_CLASS_CATEGORY_INPUT, ++ AV_CLASS_CATEGORY_OUTPUT, ++ AV_CLASS_CATEGORY_MUXER, ++ AV_CLASS_CATEGORY_DEMUXER, ++ AV_CLASS_CATEGORY_ENCODER, ++ AV_CLASS_CATEGORY_DECODER, ++ AV_CLASS_CATEGORY_FILTER, ++ AV_CLASS_CATEGORY_BITSTREAM_FILTER, ++ AV_CLASS_CATEGORY_SWSCALER, ++ AV_CLASS_CATEGORY_SWRESAMPLER, ++ AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT = 40, ++ AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT, ++ AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT, ++ AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT, ++ AV_CLASS_CATEGORY_DEVICE_OUTPUT, ++ AV_CLASS_CATEGORY_DEVICE_INPUT, ++ AV_CLASS_CATEGORY_NB ///< not part of ABI/API ++} AVClassCategory; ++ ++#define AV_IS_INPUT_DEVICE(category) \ ++ (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT) || \ ++ ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT) || \ ++ ((category) == AV_CLASS_CATEGORY_DEVICE_INPUT)) ++ ++#define AV_IS_OUTPUT_DEVICE(category) \ ++ (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT) || \ ++ ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT) || \ ++ ((category) == AV_CLASS_CATEGORY_DEVICE_OUTPUT)) ++ ++struct AVOptionRanges; ++ ++/** ++ * Describe the class of an AVClass context structure. That is an ++ * arbitrary struct of which the first field is a pointer to an ++ * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). ++ */ ++typedef struct AVClass { ++ /** ++ * The name of the class; usually it is the same name as the ++ * context structure type to which the AVClass is associated. ++ */ ++ const char* class_name; ++ ++ /** ++ * A pointer to a function which returns the name of a context ++ * instance ctx associated with the class. ++ */ ++ const char* (*item_name)(void* ctx); ++ ++ /** ++ * a pointer to the first option specified in the class if any or NULL ++ * ++ * @see av_set_default_options() ++ */ ++ const struct AVOption* option; ++ ++ /** ++ * LIBAVUTIL_VERSION with which this structure was created. ++ * This is used to allow fields to be added without requiring major ++ * version bumps everywhere. ++ */ ++ ++ int version; ++ ++ /** ++ * Offset in the structure where log_level_offset is stored. ++ * 0 means there is no such variable ++ */ ++ int log_level_offset_offset; ++ ++ /** ++ * Offset in the structure where a pointer to the parent context for ++ * logging is stored. For example a decoder could pass its AVCodecContext ++ * to eval as such a parent context, which an av_log() implementation ++ * could then leverage to display the parent context. ++ * The offset can be NULL. ++ */ ++ int parent_log_context_offset; ++ ++ /** ++ * Category used for visualization (like color) ++ * This is only set if the category is equal for all objects using this class. ++ * available since version (51 << 16 | 56 << 8 | 100) ++ */ ++ AVClassCategory category; ++ ++ /** ++ * Callback to return the category. ++ * available since version (51 << 16 | 59 << 8 | 100) ++ */ ++ AVClassCategory (*get_category)(void* ctx); ++ ++ /** ++ * Callback to return the supported/allowed ranges. ++ * available since version (52.12) ++ */ ++ int (*query_ranges)(struct AVOptionRanges**, void* obj, const char* key, ++ int flags); ++ ++ /** ++ * Return next AVOptions-enabled child or NULL ++ */ ++ void* (*child_next)(void* obj, void* prev); ++ ++ /** ++ * Iterate over the AVClasses corresponding to potential AVOptions-enabled ++ * children. ++ * ++ * @param iter pointer to opaque iteration state. The caller must initialize ++ * *iter to NULL before the first call. ++ * @return AVClass for the next AVOptions-enabled child or NULL if there are ++ * no more such children. ++ * ++ * @note The difference between child_next and this is that child_next ++ * iterates over _already existing_ objects, while child_class_iterate ++ * iterates over _all possible_ children. ++ */ ++ const struct AVClass* (*child_class_iterate)(void** iter); ++} AVClass; ++ ++/** ++ * @addtogroup lavu_log ++ * ++ * @{ ++ * ++ * @defgroup lavu_log_constants Logging Constants ++ * ++ * @{ ++ */ ++ ++/** ++ * Print no output. ++ */ ++#define AV_LOG_QUIET -8 ++ ++/** ++ * Something went really wrong and we will crash now. ++ */ ++#define AV_LOG_PANIC 0 ++ ++/** ++ * Something went wrong and recovery is not possible. ++ * For example, no header was found for a format which depends ++ * on headers or an illegal combination of parameters is used. ++ */ ++#define AV_LOG_FATAL 8 ++ ++/** ++ * Something went wrong and cannot losslessly be recovered. ++ * However, not all future data is affected. ++ */ ++#define AV_LOG_ERROR 16 ++ ++/** ++ * Something somehow does not look correct. This may or may not ++ * lead to problems. An example would be the use of '-vstrict -2'. ++ */ ++#define AV_LOG_WARNING 24 ++ ++/** ++ * Standard information. ++ */ ++#define AV_LOG_INFO 32 ++ ++/** ++ * Detailed information. ++ */ ++#define AV_LOG_VERBOSE 40 ++ ++/** ++ * Stuff which is only useful for libav* developers. ++ */ ++#define AV_LOG_DEBUG 48 ++ ++/** ++ * Extremely verbose debugging, useful for libav* development. ++ */ ++#define AV_LOG_TRACE 56 ++ ++#define AV_LOG_MAX_OFFSET (AV_LOG_TRACE - AV_LOG_QUIET) ++ ++/** ++ * @} ++ */ ++ ++/** ++ * Sets additional colors for extended debugging sessions. ++ * @code ++ av_log(ctx, AV_LOG_DEBUG|AV_LOG_C(134), "Message in purple\n"); ++ @endcode ++ * Requires 256color terminal support. Uses outside debugging is not ++ * recommended. ++ */ ++#define AV_LOG_C(x) ((x) << 8) ++ ++/** ++ * Send the specified message to the log if the level is less than or equal ++ * to the current av_log_level. By default, all logging messages are sent to ++ * stderr. This behavior can be altered by setting a different logging callback ++ * function. ++ * @see av_log_set_callback ++ * ++ * @param avcl A pointer to an arbitrary struct of which the first field is a ++ * pointer to an AVClass struct or NULL if general log. ++ * @param level The importance level of the message expressed using a @ref ++ * lavu_log_constants "Logging Constant". ++ * @param fmt The format string (printf-compatible) that specifies how ++ * subsequent arguments are converted to output. ++ */ ++void av_log(void* avcl, int level, const char* fmt, ...) av_printf_format(3, 4); ++ ++/** ++ * Send the specified message to the log once with the initial_level and then ++ * with the subsequent_level. By default, all logging messages are sent to ++ * stderr. This behavior can be altered by setting a different logging callback ++ * function. ++ * @see av_log ++ * ++ * @param avcl A pointer to an arbitrary struct of which the first field is a ++ * pointer to an AVClass struct or NULL if general log. ++ * @param initial_level importance level of the message expressed using a @ref ++ * lavu_log_constants "Logging Constant" for the first occurance. ++ * @param subsequent_level importance level of the message expressed using a ++ * @ref lavu_log_constants "Logging Constant" after the first occurance. ++ * @param fmt The format string (printf-compatible) that specifies how ++ * subsequent arguments are converted to output. ++ * @param state a variable to keep trak of if a message has already been printed ++ * this must be initialized to 0 before the first use. The same state ++ * must not be accessed by 2 Threads simultaneously. ++ */ ++void av_log_once(void* avcl, int initial_level, int subsequent_level, ++ int* state, const char* fmt, ...) av_printf_format(5, 6); ++ ++/** ++ * Send the specified message to the log if the level is less than or equal ++ * to the current av_log_level. By default, all logging messages are sent to ++ * stderr. This behavior can be altered by setting a different logging callback ++ * function. ++ * @see av_log_set_callback ++ * ++ * @param avcl A pointer to an arbitrary struct of which the first field is a ++ * pointer to an AVClass struct. ++ * @param level The importance level of the message expressed using a @ref ++ * lavu_log_constants "Logging Constant". ++ * @param fmt The format string (printf-compatible) that specifies how ++ * subsequent arguments are converted to output. ++ * @param vl The arguments referenced by the format string. ++ */ ++void av_vlog(void* avcl, int level, const char* fmt, va_list vl); ++ ++/** ++ * Get the current log level ++ * ++ * @see lavu_log_constants ++ * ++ * @return Current log level ++ */ ++int av_log_get_level(void); ++ ++/** ++ * Set the log level ++ * ++ * @see lavu_log_constants ++ * ++ * @param level Logging level ++ */ ++void av_log_set_level(int level); ++ ++/** ++ * Set the logging callback ++ * ++ * @note The callback must be thread safe, even if the application does not use ++ * threads itself as some codecs are multithreaded. ++ * ++ * @see av_log_default_callback ++ * ++ * @param callback A logging function with a compatible signature. ++ */ ++void av_log_set_callback(void (*callback)(void*, int, const char*, va_list)); ++ ++/** ++ * Default logging callback ++ * ++ * It prints the message to stderr, optionally colorizing it. ++ * ++ * @param avcl A pointer to an arbitrary struct of which the first field is a ++ * pointer to an AVClass struct. ++ * @param level The importance level of the message expressed using a @ref ++ * lavu_log_constants "Logging Constant". ++ * @param fmt The format string (printf-compatible) that specifies how ++ * subsequent arguments are converted to output. ++ * @param vl The arguments referenced by the format string. ++ */ ++void av_log_default_callback(void* avcl, int level, const char* fmt, ++ va_list vl); ++ ++/** ++ * Return the context name ++ * ++ * @param ctx The AVClass context ++ * ++ * @return The AVClass class_name ++ */ ++const char* av_default_item_name(void* ctx); ++AVClassCategory av_default_get_category(void* ptr); ++ ++/** ++ * Format a line of log the same way as the default callback. ++ * @param line buffer to receive the formatted line ++ * @param line_size size of the buffer ++ * @param print_prefix used to store whether the prefix must be printed; ++ * must point to a persistent integer initially set to 1 ++ */ ++void av_log_format_line(void* ptr, int level, const char* fmt, va_list vl, ++ char* line, int line_size, int* print_prefix); ++ ++/** ++ * Format a line of log the same way as the default callback. ++ * @param line buffer to receive the formatted line; ++ * may be NULL if line_size is 0 ++ * @param line_size size of the buffer; at most line_size-1 characters will ++ * be written to the buffer, plus one null terminator ++ * @param print_prefix used to store whether the prefix must be printed; ++ * must point to a persistent integer initially set to 1 ++ * @return Returns a negative value if an error occurred, otherwise returns ++ * the number of characters that would have been written for a ++ * sufficiently large buffer, not including the terminating null ++ * character. If the return value is not less than line_size, it means ++ * that the log message was truncated to fit the buffer. ++ */ ++int av_log_format_line2(void* ptr, int level, const char* fmt, va_list vl, ++ char* line, int line_size, int* print_prefix); ++ ++/** ++ * Skip repeated messages, this requires the user app to use av_log() instead of ++ * (f)printf as the 2 would otherwise interfere and lead to ++ * "Last message repeated x times" messages below (f)printf messages with some ++ * bad luck. ++ * Also to receive the last, "last repeated" line if any, the user app must ++ * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end ++ */ ++#define AV_LOG_SKIP_REPEATED 1 ++ ++/** ++ * Include the log severity in messages originating from codecs. ++ * ++ * Results in messages such as: ++ * [rawvideo @ 0xDEADBEEF] [error] encode did not produce valid pts ++ */ ++#define AV_LOG_PRINT_LEVEL 2 ++ ++void av_log_set_flags(int arg); ++int av_log_get_flags(void); ++ ++/** ++ * @} ++ */ ++ ++#endif /* AVUTIL_LOG_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/macros.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/macros.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/macros.h +@@ -0,0 +1,87 @@ ++/* ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++/** ++ * @file ++ * @ingroup lavu ++ * Utility Preprocessor macros ++ */ ++ ++#ifndef AVUTIL_MACROS_H ++#define AVUTIL_MACROS_H ++ ++#include "libavutil/avconfig.h" ++ ++#if AV_HAVE_BIGENDIAN ++# define AV_NE(be, le) (be) ++#else ++# define AV_NE(be, le) (le) ++#endif ++ ++/** ++ * Comparator. ++ * For two numerical expressions x and y, gives 1 if x > y, -1 if x < y, and 0 ++ * if x == y. This is useful for instance in a qsort comparator callback. ++ * Furthermore, compilers are able to optimize this to branchless code, and ++ * there is no risk of overflow with signed types. ++ * As with many macros, this evaluates its argument multiple times, it thus ++ * must not have a side-effect. ++ */ ++#define FFDIFFSIGN(x, y) (((x) > (y)) - ((x) < (y))) ++ ++#define FFMAX(a, b) ((a) > (b) ? (a) : (b)) ++#define FFMAX3(a, b, c) FFMAX(FFMAX(a, b), c) ++#define FFMIN(a, b) ((a) > (b) ? (b) : (a)) ++#define FFMIN3(a, b, c) FFMIN(FFMIN(a, b), c) ++ ++#define FFSWAP(type, a, b) \ ++ do { \ ++ type SWAP_tmp = b; \ ++ b = a; \ ++ a = SWAP_tmp; \ ++ } while (0) ++#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0])) ++ ++#define MKTAG(a, b, c, d) \ ++ ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24)) ++#define MKBETAG(a, b, c, d) \ ++ ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24)) ++ ++/** ++ * @addtogroup preproc_misc Preprocessor String Macros ++ * ++ * String manipulation macros ++ * ++ * @{ ++ */ ++ ++#define AV_STRINGIFY(s) AV_TOSTRING(s) ++#define AV_TOSTRING(s) #s ++ ++#define AV_GLUE(a, b) a##b ++#define AV_JOIN(a, b) AV_GLUE(a, b) ++ ++/** ++ * @} ++ */ ++ ++#define AV_PRAGMA(s) _Pragma(#s) ++ ++#define FFALIGN(x, a) (((x) + (a)-1) & ~((a)-1)) ++ ++#endif /* AVUTIL_MACROS_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/mathematics.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/mathematics.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/mathematics.h +@@ -0,0 +1,247 @@ ++/* ++ * copyright (c) 2005-2012 Michael Niedermayer ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++/** ++ * @file ++ * @addtogroup lavu_math ++ * Mathematical utilities for working with timestamp and time base. ++ */ ++ ++#ifndef AVUTIL_MATHEMATICS_H ++#define AVUTIL_MATHEMATICS_H ++ ++#include ++#include ++#include "attributes.h" ++#include "rational.h" ++#include "intfloat.h" ++ ++#ifndef M_E ++# define M_E 2.7182818284590452354 /* e */ ++#endif ++#ifndef M_LN2 ++# define M_LN2 0.69314718055994530942 /* log_e 2 */ ++#endif ++#ifndef M_LN10 ++# define M_LN10 2.30258509299404568402 /* log_e 10 */ ++#endif ++#ifndef M_LOG2_10 ++# define M_LOG2_10 3.32192809488736234787 /* log_2 10 */ ++#endif ++#ifndef M_PHI ++# define M_PHI 1.61803398874989484820 /* phi / golden ratio */ ++#endif ++#ifndef M_PI ++# define M_PI 3.14159265358979323846 /* pi */ ++#endif ++#ifndef M_PI_2 ++# define M_PI_2 1.57079632679489661923 /* pi/2 */ ++#endif ++#ifndef M_SQRT1_2 ++# define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ ++#endif ++#ifndef M_SQRT2 ++# define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ ++#endif ++#ifndef NAN ++# define NAN av_int2float(0x7fc00000) ++#endif ++#ifndef INFINITY ++# define INFINITY av_int2float(0x7f800000) ++#endif ++ ++/** ++ * @addtogroup lavu_math ++ * ++ * @{ ++ */ ++ ++/** ++ * Rounding methods. ++ */ ++enum AVRounding { ++ AV_ROUND_ZERO = 0, ///< Round toward zero. ++ AV_ROUND_INF = 1, ///< Round away from zero. ++ AV_ROUND_DOWN = 2, ///< Round toward -infinity. ++ AV_ROUND_UP = 3, ///< Round toward +infinity. ++ AV_ROUND_NEAR_INF = ++ 5, ///< Round to nearest and halfway cases away from zero. ++ /** ++ * Flag telling rescaling functions to pass `INT64_MIN`/`MAX` through ++ * unchanged, avoiding special cases for #AV_NOPTS_VALUE. ++ * ++ * Unlike other values of the enumeration AVRounding, this value is a ++ * bitmask that must be used in conjunction with another value of the ++ * enumeration through a bitwise OR, in order to set behavior for normal ++ * cases. ++ * ++ * @code{.c} ++ * av_rescale_rnd(3, 1, 2, AV_ROUND_UP | AV_ROUND_PASS_MINMAX); ++ * // Rescaling 3: ++ * // Calculating 3 * 1 / 2 ++ * // 3 / 2 is rounded up to 2 ++ * // => 2 ++ * ++ * av_rescale_rnd(AV_NOPTS_VALUE, 1, 2, AV_ROUND_UP | AV_ROUND_PASS_MINMAX); ++ * // Rescaling AV_NOPTS_VALUE: ++ * // AV_NOPTS_VALUE == INT64_MIN ++ * // AV_NOPTS_VALUE is passed through ++ * // => AV_NOPTS_VALUE ++ * @endcode ++ */ ++ AV_ROUND_PASS_MINMAX = 8192, ++}; ++ ++/** ++ * Compute the greatest common divisor of two integer operands. ++ * ++ * @param a,b Operands ++ * @return GCD of a and b up to sign; if a >= 0 and b >= 0, return value is >= ++ * 0; if a == 0 and b == 0, returns 0. ++ */ ++int64_t av_const av_gcd(int64_t a, int64_t b); ++ ++/** ++ * Rescale a 64-bit integer with rounding to nearest. ++ * ++ * The operation is mathematically equivalent to `a * b / c`, but writing that ++ * directly can overflow. ++ * ++ * This function is equivalent to av_rescale_rnd() with #AV_ROUND_NEAR_INF. ++ * ++ * @see av_rescale_rnd(), av_rescale_q(), av_rescale_q_rnd() ++ */ ++int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const; ++ ++/** ++ * Rescale a 64-bit integer with specified rounding. ++ * ++ * The operation is mathematically equivalent to `a * b / c`, but writing that ++ * directly can overflow, and does not support different rounding methods. ++ * If the result is not representable then INT64_MIN is returned. ++ * ++ * @see av_rescale(), av_rescale_q(), av_rescale_q_rnd() ++ */ ++int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, ++ enum AVRounding rnd) av_const; ++ ++/** ++ * Rescale a 64-bit integer by 2 rational numbers. ++ * ++ * The operation is mathematically equivalent to `a * bq / cq`. ++ * ++ * This function is equivalent to av_rescale_q_rnd() with #AV_ROUND_NEAR_INF. ++ * ++ * @see av_rescale(), av_rescale_rnd(), av_rescale_q_rnd() ++ */ ++int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const; ++ ++/** ++ * Rescale a 64-bit integer by 2 rational numbers with specified rounding. ++ * ++ * The operation is mathematically equivalent to `a * bq / cq`. ++ * ++ * @see av_rescale(), av_rescale_rnd(), av_rescale_q() ++ */ ++int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq, ++ enum AVRounding rnd) av_const; ++ ++/** ++ * Compare two timestamps each in its own time base. ++ * ++ * @return One of the following values: ++ * - -1 if `ts_a` is before `ts_b` ++ * - 1 if `ts_a` is after `ts_b` ++ * - 0 if they represent the same position ++ * ++ * @warning ++ * The result of the function is undefined if one of the timestamps is outside ++ * the `int64_t` range when represented in the other's timebase. ++ */ ++int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b); ++ ++/** ++ * Compare the remainders of two integer operands divided by a common divisor. ++ * ++ * In other words, compare the least significant `log2(mod)` bits of integers ++ * `a` and `b`. ++ * ++ * @code{.c} ++ * av_compare_mod(0x11, 0x02, 0x10) < 0 // since 0x11 % 0x10 (0x1) < 0x02 % ++ * 0x10 (0x2) av_compare_mod(0x11, 0x02, 0x20) > 0 // since 0x11 % 0x20 (0x11) ++ * > 0x02 % 0x20 (0x02) ++ * @endcode ++ * ++ * @param a,b Operands ++ * @param mod Divisor; must be a power of 2 ++ * @return ++ * - a negative value if `a % mod < b % mod` ++ * - a positive value if `a % mod > b % mod` ++ * - zero if `a % mod == b % mod` ++ */ ++int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod); ++ ++/** ++ * Rescale a timestamp while preserving known durations. ++ * ++ * This function is designed to be called per audio packet to scale the input ++ * timestamp to a different time base. Compared to a simple av_rescale_q() ++ * call, this function is robust against possible inconsistent frame durations. ++ * ++ * The `last` parameter is a state variable that must be preserved for all ++ * subsequent calls for the same stream. For the first call, `*last` should be ++ * initialized to #AV_NOPTS_VALUE. ++ * ++ * @param[in] in_tb Input time base ++ * @param[in] in_ts Input timestamp ++ * @param[in] fs_tb Duration time base; typically this is finer-grained ++ * (greater) than `in_tb` and `out_tb` ++ * @param[in] duration Duration till the next call to this function (i.e. ++ * duration of the current packet/frame) ++ * @param[in,out] last Pointer to a timestamp expressed in terms of ++ * `fs_tb`, acting as a state variable ++ * @param[in] out_tb Output timebase ++ * @return Timestamp expressed in terms of `out_tb` ++ * ++ * @note In the context of this function, "duration" is in term of samples, not ++ * seconds. ++ */ ++int64_t av_rescale_delta(AVRational in_tb, int64_t in_ts, AVRational fs_tb, ++ int duration, int64_t* last, AVRational out_tb); ++ ++/** ++ * Add a value to a timestamp. ++ * ++ * This function guarantees that when the same value is repeatly added that ++ * no accumulation of rounding errors occurs. ++ * ++ * @param[in] ts Input timestamp ++ * @param[in] ts_tb Input timestamp time base ++ * @param[in] inc Value to be added ++ * @param[in] inc_tb Time base of `inc` ++ */ ++int64_t av_add_stable(AVRational ts_tb, int64_t ts, AVRational inc_tb, ++ int64_t inc); ++ ++/** ++ * @} ++ */ ++ ++#endif /* AVUTIL_MATHEMATICS_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/mem.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/mem.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/mem.h +@@ -0,0 +1,708 @@ ++/* ++ * copyright (c) 2006 Michael Niedermayer ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++/** ++ * @file ++ * @ingroup lavu_mem ++ * Memory handling functions ++ */ ++ ++#ifndef AVUTIL_MEM_H ++#define AVUTIL_MEM_H ++ ++#include ++#include ++ ++#include "attributes.h" ++#include "avutil.h" ++#include "version.h" ++ ++/** ++ * @addtogroup lavu_mem ++ * Utilities for manipulating memory. ++ * ++ * FFmpeg has several applications of memory that are not required of a typical ++ * program. For example, the computing-heavy components like video decoding and ++ * encoding can be sped up significantly through the use of aligned memory. ++ * ++ * However, for each of FFmpeg's applications of memory, there might not be a ++ * recognized or standardized API for that specific use. Memory alignment, for ++ * instance, varies wildly depending on operating systems, architectures, and ++ * compilers. Hence, this component of @ref libavutil is created to make ++ * dealing with memory consistently possible on all platforms. ++ * ++ * @{ ++ */ ++ ++#if FF_API_DECLARE_ALIGNED ++/** ++ * ++ * @defgroup lavu_mem_macros Alignment Macros ++ * Helper macros for declaring aligned variables. ++ * @{ ++ */ ++ ++/** ++ * @def DECLARE_ALIGNED(n,t,v) ++ * Declare a variable that is aligned in memory. ++ * ++ * @code{.c} ++ * DECLARE_ALIGNED(16, uint16_t, aligned_int) = 42; ++ * DECLARE_ALIGNED(32, uint8_t, aligned_array)[128]; ++ * ++ * // The default-alignment equivalent would be ++ * uint16_t aligned_int = 42; ++ * uint8_t aligned_array[128]; ++ * @endcode ++ * ++ * @param n Minimum alignment in bytes ++ * @param t Type of the variable (or array element) ++ * @param v Name of the variable ++ */ ++ ++/** ++ * @def DECLARE_ASM_ALIGNED(n,t,v) ++ * Declare an aligned variable appropriate for use in inline assembly code. ++ * ++ * @code{.c} ++ * DECLARE_ASM_ALIGNED(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008); ++ * @endcode ++ * ++ * @param n Minimum alignment in bytes ++ * @param t Type of the variable (or array element) ++ * @param v Name of the variable ++ */ ++ ++/** ++ * @def DECLARE_ASM_CONST(n,t,v) ++ * Declare a static constant aligned variable appropriate for use in inline ++ * assembly code. ++ * ++ * @code{.c} ++ * DECLARE_ASM_CONST(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008); ++ * @endcode ++ * ++ * @param n Minimum alignment in bytes ++ * @param t Type of the variable (or array element) ++ * @param v Name of the variable ++ */ ++ ++# if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || \ ++ defined(__SUNPRO_C) ++# define DECLARE_ALIGNED(n, t, v) t __attribute__((aligned(n))) v ++# define DECLARE_ASM_ALIGNED(n, t, v) t __attribute__((aligned(n))) v ++# define DECLARE_ASM_CONST(n, t, v) const t __attribute__((aligned(n))) v ++# elif defined(__DJGPP__) ++# define DECLARE_ALIGNED(n, t, v) t __attribute__((aligned(FFMIN(n, 16)))) v ++# define DECLARE_ASM_ALIGNED(n, t, v) \ ++ t av_used __attribute__((aligned(FFMIN(n, 16)))) v ++# define DECLARE_ASM_CONST(n, t, v) \ ++ static const t av_used __attribute__((aligned(FFMIN(n, 16)))) v ++# elif defined(__GNUC__) || defined(__clang__) ++# define DECLARE_ALIGNED(n, t, v) t __attribute__((aligned(n))) v ++# define DECLARE_ASM_ALIGNED(n, t, v) t av_used __attribute__((aligned(n))) v ++# define DECLARE_ASM_CONST(n, t, v) \ ++ static const t av_used __attribute__((aligned(n))) v ++# elif defined(_MSC_VER) ++# define DECLARE_ALIGNED(n, t, v) __declspec(align(n)) t v ++# define DECLARE_ASM_ALIGNED(n, t, v) __declspec(align(n)) t v ++# define DECLARE_ASM_CONST(n, t, v) __declspec(align(n)) static const t v ++# else ++# define DECLARE_ALIGNED(n, t, v) t v ++# define DECLARE_ASM_ALIGNED(n, t, v) t v ++# define DECLARE_ASM_CONST(n, t, v) static const t v ++# endif ++ ++/** ++ * @} ++ */ ++#endif ++ ++/** ++ * @defgroup lavu_mem_attrs Function Attributes ++ * Function attributes applicable to memory handling functions. ++ * ++ * These function attributes can help compilers emit more useful warnings, or ++ * generate better code. ++ * @{ ++ */ ++ ++/** ++ * @def av_malloc_attrib ++ * Function attribute denoting a malloc-like function. ++ * ++ * @see Function ++ * attribute `malloc` in GCC's documentation ++ */ ++ ++#if AV_GCC_VERSION_AT_LEAST(3, 1) ++# define av_malloc_attrib __attribute__((__malloc__)) ++#else ++# define av_malloc_attrib ++#endif ++ ++/** ++ * @def av_alloc_size(...) ++ * Function attribute used on a function that allocates memory, whose size is ++ * given by the specified parameter(s). ++ * ++ * @code{.c} ++ * void *av_malloc(size_t size) av_alloc_size(1); ++ * void *av_calloc(size_t nmemb, size_t size) av_alloc_size(1, 2); ++ * @endcode ++ * ++ * @param ... One or two parameter indexes, separated by a comma ++ * ++ * @see Function ++ * attribute `alloc_size` in GCC's documentation ++ */ ++ ++#if AV_GCC_VERSION_AT_LEAST(4, 3) ++# define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__))) ++#else ++# define av_alloc_size(...) ++#endif ++ ++/** ++ * @} ++ */ ++ ++/** ++ * @defgroup lavu_mem_funcs Heap Management ++ * Functions responsible for allocating, freeing, and copying memory. ++ * ++ * All memory allocation functions have a built-in upper limit of `INT_MAX` ++ * bytes. This may be changed with av_max_alloc(), although exercise extreme ++ * caution when doing so. ++ * ++ * @{ ++ */ ++ ++/** ++ * Allocate a memory block with alignment suitable for all memory accesses ++ * (including vectors if available on the CPU). ++ * ++ * @param size Size in bytes for the memory block to be allocated ++ * @return Pointer to the allocated block, or `NULL` if the block cannot ++ * be allocated ++ * @see av_mallocz() ++ */ ++void* av_malloc(size_t size) av_malloc_attrib av_alloc_size(1); ++ ++/** ++ * Allocate a memory block with alignment suitable for all memory accesses ++ * (including vectors if available on the CPU) and zero all the bytes of the ++ * block. ++ * ++ * @param size Size in bytes for the memory block to be allocated ++ * @return Pointer to the allocated block, or `NULL` if it cannot be allocated ++ * @see av_malloc() ++ */ ++void* av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1); ++ ++/** ++ * Allocate a memory block for an array with av_malloc(). ++ * ++ * The allocated memory will have size `size * nmemb` bytes. ++ * ++ * @param nmemb Number of element ++ * @param size Size of a single element ++ * @return Pointer to the allocated block, or `NULL` if the block cannot ++ * be allocated ++ * @see av_malloc() ++ */ ++av_alloc_size(1, 2) void* av_malloc_array(size_t nmemb, size_t size); ++ ++/** ++ * Allocate a memory block for an array with av_mallocz(). ++ * ++ * The allocated memory will have size `size * nmemb` bytes. ++ * ++ * @param nmemb Number of elements ++ * @param size Size of the single element ++ * @return Pointer to the allocated block, or `NULL` if the block cannot ++ * be allocated ++ * ++ * @see av_mallocz() ++ * @see av_malloc_array() ++ */ ++void* av_calloc(size_t nmemb, size_t size) av_malloc_attrib av_alloc_size(1, 2); ++ ++#if FF_API_AV_MALLOCZ_ARRAY ++/** ++ * @deprecated use av_calloc() ++ */ ++attribute_deprecated void* av_mallocz_array(size_t nmemb, ++ size_t size) av_malloc_attrib ++ av_alloc_size(1, 2); ++#endif ++ ++/** ++ * Allocate, reallocate, or free a block of memory. ++ * ++ * If `ptr` is `NULL` and `size` > 0, allocate a new block. If `size` is ++ * zero, free the memory block pointed to by `ptr`. Otherwise, expand or ++ * shrink that block of memory according to `size`. ++ * ++ * @param ptr Pointer to a memory block already allocated with ++ * av_realloc() or `NULL` ++ * @param size Size in bytes of the memory block to be allocated or ++ * reallocated ++ * ++ * @return Pointer to a newly-reallocated block or `NULL` if the block ++ * cannot be reallocated or the function is used to free the memory ++ * block ++ * ++ * @warning Unlike av_malloc(), the returned pointer is not guaranteed to be ++ * correctly aligned. ++ * @see av_fast_realloc() ++ * @see av_reallocp() ++ */ ++void* av_realloc(void* ptr, size_t size) av_alloc_size(2); ++ ++/** ++ * Allocate, reallocate, or free a block of memory through a pointer to a ++ * pointer. ++ * ++ * If `*ptr` is `NULL` and `size` > 0, allocate a new block. If `size` is ++ * zero, free the memory block pointed to by `*ptr`. Otherwise, expand or ++ * shrink that block of memory according to `size`. ++ * ++ * @param[in,out] ptr Pointer to a pointer to a memory block already allocated ++ * with av_realloc(), or a pointer to `NULL`. The pointer ++ * is updated on success, or freed on failure. ++ * @param[in] size Size in bytes for the memory block to be allocated or ++ * reallocated ++ * ++ * @return Zero on success, an AVERROR error code on failure ++ * ++ * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be ++ * correctly aligned. ++ */ ++av_warn_unused_result int av_reallocp(void* ptr, size_t size); ++ ++/** ++ * Allocate, reallocate, or free a block of memory. ++ * ++ * This function does the same thing as av_realloc(), except: ++ * - It takes two size arguments and allocates `nelem * elsize` bytes, ++ * after checking the result of the multiplication for integer overflow. ++ * - It frees the input block in case of failure, thus avoiding the memory ++ * leak with the classic ++ * @code{.c} ++ * buf = realloc(buf); ++ * if (!buf) ++ * return -1; ++ * @endcode ++ * pattern. ++ */ ++void* av_realloc_f(void* ptr, size_t nelem, size_t elsize); ++ ++/** ++ * Allocate, reallocate, or free an array. ++ * ++ * If `ptr` is `NULL` and `nmemb` > 0, allocate a new block. If ++ * `nmemb` is zero, free the memory block pointed to by `ptr`. ++ * ++ * @param ptr Pointer to a memory block already allocated with ++ * av_realloc() or `NULL` ++ * @param nmemb Number of elements in the array ++ * @param size Size of the single element of the array ++ * ++ * @return Pointer to a newly-reallocated block or NULL if the block ++ * cannot be reallocated or the function is used to free the memory ++ * block ++ * ++ * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be ++ * correctly aligned. ++ * @see av_reallocp_array() ++ */ ++av_alloc_size(2, 3) void* av_realloc_array(void* ptr, size_t nmemb, ++ size_t size); ++ ++/** ++ * Allocate, reallocate, or free an array through a pointer to a pointer. ++ * ++ * If `*ptr` is `NULL` and `nmemb` > 0, allocate a new block. If `nmemb` is ++ * zero, free the memory block pointed to by `*ptr`. ++ * ++ * @param[in,out] ptr Pointer to a pointer to a memory block already ++ * allocated with av_realloc(), or a pointer to `NULL`. ++ * The pointer is updated on success, or freed on failure. ++ * @param[in] nmemb Number of elements ++ * @param[in] size Size of the single element ++ * ++ * @return Zero on success, an AVERROR error code on failure ++ * ++ * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be ++ * correctly aligned. ++ */ ++int av_reallocp_array(void* ptr, size_t nmemb, size_t size); ++ ++/** ++ * Reallocate the given buffer if it is not large enough, otherwise do nothing. ++ * ++ * If the given buffer is `NULL`, then a new uninitialized buffer is allocated. ++ * ++ * If the given buffer is not large enough, and reallocation fails, `NULL` is ++ * returned and `*size` is set to 0, but the original buffer is not changed or ++ * freed. ++ * ++ * A typical use pattern follows: ++ * ++ * @code{.c} ++ * uint8_t *buf = ...; ++ * uint8_t *new_buf = av_fast_realloc(buf, ¤t_size, size_needed); ++ * if (!new_buf) { ++ * // Allocation failed; clean up original buffer ++ * av_freep(&buf); ++ * return AVERROR(ENOMEM); ++ * } ++ * @endcode ++ * ++ * @param[in,out] ptr Already allocated buffer, or `NULL` ++ * @param[in,out] size Pointer to the size of buffer `ptr`. `*size` is ++ * updated to the new allocated size, in particular 0 ++ * in case of failure. ++ * @param[in] min_size Desired minimal size of buffer `ptr` ++ * @return `ptr` if the buffer is large enough, a pointer to newly reallocated ++ * buffer if the buffer was not large enough, or `NULL` in case of ++ * error ++ * @see av_realloc() ++ * @see av_fast_malloc() ++ */ ++void* av_fast_realloc(void* ptr, unsigned int* size, size_t min_size); ++ ++/** ++ * Allocate a buffer, reusing the given one if large enough. ++ * ++ * Contrary to av_fast_realloc(), the current buffer contents might not be ++ * preserved and on error the old buffer is freed, thus no special handling to ++ * avoid memleaks is necessary. ++ * ++ * `*ptr` is allowed to be `NULL`, in which case allocation always happens if ++ * `size_needed` is greater than 0. ++ * ++ * @code{.c} ++ * uint8_t *buf = ...; ++ * av_fast_malloc(&buf, ¤t_size, size_needed); ++ * if (!buf) { ++ * // Allocation failed; buf already freed ++ * return AVERROR(ENOMEM); ++ * } ++ * @endcode ++ * ++ * @param[in,out] ptr Pointer to pointer to an already allocated buffer. ++ * `*ptr` will be overwritten with pointer to new ++ * buffer on success or `NULL` on failure ++ * @param[in,out] size Pointer to the size of buffer `*ptr`. `*size` is ++ * updated to the new allocated size, in particular 0 ++ * in case of failure. ++ * @param[in] min_size Desired minimal size of buffer `*ptr` ++ * @see av_realloc() ++ * @see av_fast_mallocz() ++ */ ++void av_fast_malloc(void* ptr, unsigned int* size, size_t min_size); ++ ++/** ++ * Allocate and clear a buffer, reusing the given one if large enough. ++ * ++ * Like av_fast_malloc(), but all newly allocated space is initially cleared. ++ * Reused buffer is not cleared. ++ * ++ * `*ptr` is allowed to be `NULL`, in which case allocation always happens if ++ * `size_needed` is greater than 0. ++ * ++ * @param[in,out] ptr Pointer to pointer to an already allocated buffer. ++ * `*ptr` will be overwritten with pointer to new ++ * buffer on success or `NULL` on failure ++ * @param[in,out] size Pointer to the size of buffer `*ptr`. `*size` is ++ * updated to the new allocated size, in particular 0 ++ * in case of failure. ++ * @param[in] min_size Desired minimal size of buffer `*ptr` ++ * @see av_fast_malloc() ++ */ ++void av_fast_mallocz(void* ptr, unsigned int* size, size_t min_size); ++ ++/** ++ * Free a memory block which has been allocated with a function of av_malloc() ++ * or av_realloc() family. ++ * ++ * @param ptr Pointer to the memory block which should be freed. ++ * ++ * @note `ptr = NULL` is explicitly allowed. ++ * @note It is recommended that you use av_freep() instead, to prevent leaving ++ * behind dangling pointers. ++ * @see av_freep() ++ */ ++void av_free(void* ptr); ++ ++/** ++ * Free a memory block which has been allocated with a function of av_malloc() ++ * or av_realloc() family, and set the pointer pointing to it to `NULL`. ++ * ++ * @code{.c} ++ * uint8_t *buf = av_malloc(16); ++ * av_free(buf); ++ * // buf now contains a dangling pointer to freed memory, and accidental ++ * // dereference of buf will result in a use-after-free, which may be a ++ * // security risk. ++ * ++ * uint8_t *buf = av_malloc(16); ++ * av_freep(&buf); ++ * // buf is now NULL, and accidental dereference will only result in a ++ * // NULL-pointer dereference. ++ * @endcode ++ * ++ * @param ptr Pointer to the pointer to the memory block which should be freed ++ * @note `*ptr = NULL` is safe and leads to no action. ++ * @see av_free() ++ */ ++void av_freep(void* ptr); ++ ++/** ++ * Duplicate a string. ++ * ++ * @param s String to be duplicated ++ * @return Pointer to a newly-allocated string containing a ++ * copy of `s` or `NULL` if the string cannot be allocated ++ * @see av_strndup() ++ */ ++char* av_strdup(const char* s) av_malloc_attrib; ++ ++/** ++ * Duplicate a substring of a string. ++ * ++ * @param s String to be duplicated ++ * @param len Maximum length of the resulting string (not counting the ++ * terminating byte) ++ * @return Pointer to a newly-allocated string containing a ++ * substring of `s` or `NULL` if the string cannot be allocated ++ */ ++char* av_strndup(const char* s, size_t len) av_malloc_attrib; ++ ++/** ++ * Duplicate a buffer with av_malloc(). ++ * ++ * @param p Buffer to be duplicated ++ * @param size Size in bytes of the buffer copied ++ * @return Pointer to a newly allocated buffer containing a ++ * copy of `p` or `NULL` if the buffer cannot be allocated ++ */ ++void* av_memdup(const void* p, size_t size); ++ ++/** ++ * Overlapping memcpy() implementation. ++ * ++ * @param dst Destination buffer ++ * @param back Number of bytes back to start copying (i.e. the initial size of ++ * the overlapping window); must be > 0 ++ * @param cnt Number of bytes to copy; must be >= 0 ++ * ++ * @note `cnt > back` is valid, this will copy the bytes we just copied, ++ * thus creating a repeating pattern with a period length of `back`. ++ */ ++void av_memcpy_backptr(uint8_t* dst, int back, int cnt); ++ ++/** ++ * @} ++ */ ++ ++/** ++ * @defgroup lavu_mem_dynarray Dynamic Array ++ * ++ * Utilities to make an array grow when needed. ++ * ++ * Sometimes, the programmer would want to have an array that can grow when ++ * needed. The libavutil dynamic array utilities fill that need. ++ * ++ * libavutil supports two systems of appending elements onto a dynamically ++ * allocated array, the first one storing the pointer to the value in the ++ * array, and the second storing the value directly. In both systems, the ++ * caller is responsible for maintaining a variable containing the length of ++ * the array, as well as freeing of the array after use. ++ * ++ * The first system stores pointers to values in a block of dynamically ++ * allocated memory. Since only pointers are stored, the function does not need ++ * to know the size of the type. Both av_dynarray_add() and ++ * av_dynarray_add_nofree() implement this system. ++ * ++ * @code ++ * type **array = NULL; //< an array of pointers to values ++ * int nb = 0; //< a variable to keep track of the length of the array ++ * ++ * type to_be_added = ...; ++ * type to_be_added2 = ...; ++ * ++ * av_dynarray_add(&array, &nb, &to_be_added); ++ * if (nb == 0) ++ * return AVERROR(ENOMEM); ++ * ++ * av_dynarray_add(&array, &nb, &to_be_added2); ++ * if (nb == 0) ++ * return AVERROR(ENOMEM); ++ * ++ * // Now: ++ * // nb == 2 ++ * // &to_be_added == array[0] ++ * // &to_be_added2 == array[1] ++ * ++ * av_freep(&array); ++ * @endcode ++ * ++ * The second system stores the value directly in a block of memory. As a ++ * result, the function has to know the size of the type. av_dynarray2_add() ++ * implements this mechanism. ++ * ++ * @code ++ * type *array = NULL; //< an array of values ++ * int nb = 0; //< a variable to keep track of the length of the array ++ * ++ * type to_be_added = ...; ++ * type to_be_added2 = ...; ++ * ++ * type *addr = av_dynarray2_add((void **)&array, &nb, sizeof(*array), NULL); ++ * if (!addr) ++ * return AVERROR(ENOMEM); ++ * memcpy(addr, &to_be_added, sizeof(to_be_added)); ++ * ++ * // Shortcut of the above. ++ * type *addr = av_dynarray2_add((void **)&array, &nb, sizeof(*array), ++ * (const void *)&to_be_added2); ++ * if (!addr) ++ * return AVERROR(ENOMEM); ++ * ++ * // Now: ++ * // nb == 2 ++ * // to_be_added == array[0] ++ * // to_be_added2 == array[1] ++ * ++ * av_freep(&array); ++ * @endcode ++ * ++ * @{ ++ */ ++ ++/** ++ * Add the pointer to an element to a dynamic array. ++ * ++ * The array to grow is supposed to be an array of pointers to ++ * structures, and the element to add must be a pointer to an already ++ * allocated structure. ++ * ++ * The array is reallocated when its size reaches powers of 2. ++ * Therefore, the amortized cost of adding an element is constant. ++ * ++ * In case of success, the pointer to the array is updated in order to ++ * point to the new grown array, and the number pointed to by `nb_ptr` ++ * is incremented. ++ * In case of failure, the array is freed, `*tab_ptr` is set to `NULL` and ++ * `*nb_ptr` is set to 0. ++ * ++ * @param[in,out] tab_ptr Pointer to the array to grow ++ * @param[in,out] nb_ptr Pointer to the number of elements in the array ++ * @param[in] elem Element to add ++ * @see av_dynarray_add_nofree(), av_dynarray2_add() ++ */ ++void av_dynarray_add(void* tab_ptr, int* nb_ptr, void* elem); ++ ++/** ++ * Add an element to a dynamic array. ++ * ++ * Function has the same functionality as av_dynarray_add(), ++ * but it doesn't free memory on fails. It returns error code ++ * instead and leave current buffer untouched. ++ * ++ * @return >=0 on success, negative otherwise ++ * @see av_dynarray_add(), av_dynarray2_add() ++ */ ++av_warn_unused_result int av_dynarray_add_nofree(void* tab_ptr, int* nb_ptr, ++ void* elem); ++ ++/** ++ * Add an element of size `elem_size` to a dynamic array. ++ * ++ * The array is reallocated when its number of elements reaches powers of 2. ++ * Therefore, the amortized cost of adding an element is constant. ++ * ++ * In case of success, the pointer to the array is updated in order to ++ * point to the new grown array, and the number pointed to by `nb_ptr` ++ * is incremented. ++ * In case of failure, the array is freed, `*tab_ptr` is set to `NULL` and ++ * `*nb_ptr` is set to 0. ++ * ++ * @param[in,out] tab_ptr Pointer to the array to grow ++ * @param[in,out] nb_ptr Pointer to the number of elements in the array ++ * @param[in] elem_size Size in bytes of an element in the array ++ * @param[in] elem_data Pointer to the data of the element to add. If ++ * `NULL`, the space of the newly added element is ++ * allocated but left uninitialized. ++ * ++ * @return Pointer to the data of the element to copy in the newly allocated ++ * space ++ * @see av_dynarray_add(), av_dynarray_add_nofree() ++ */ ++void* av_dynarray2_add(void** tab_ptr, int* nb_ptr, size_t elem_size, ++ const uint8_t* elem_data); ++ ++/** ++ * @} ++ */ ++ ++/** ++ * @defgroup lavu_mem_misc Miscellaneous Functions ++ * ++ * Other functions related to memory allocation. ++ * ++ * @{ ++ */ ++ ++/** ++ * Multiply two `size_t` values checking for overflow. ++ * ++ * @param[in] a,b Operands of multiplication ++ * @param[out] r Pointer to the result of the operation ++ * @return 0 on success, AVERROR(EINVAL) on overflow ++ */ ++int av_size_mult(size_t a, size_t b, size_t* r); ++ ++/** ++ * Set the maximum size that may be allocated in one block. ++ * ++ * The value specified with this function is effective for all libavutil's @ref ++ * lavu_mem_funcs "heap management functions." ++ * ++ * By default, the max value is defined as `INT_MAX`. ++ * ++ * @param max Value to be set as the new maximum size ++ * ++ * @warning Exercise extreme caution when using this function. Don't touch ++ * this if you do not understand the full consequence of doing so. ++ */ ++void av_max_alloc(size_t max); ++ ++/** ++ * @} ++ * @} ++ */ ++ ++#endif /* AVUTIL_MEM_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/pixfmt.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/pixfmt.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/pixfmt.h +@@ -0,0 +1,808 @@ ++/* ++ * copyright (c) 2006 Michael Niedermayer ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifndef AVUTIL_PIXFMT_H ++#define AVUTIL_PIXFMT_H ++ ++/** ++ * @file ++ * pixel format definitions ++ */ ++ ++#include "libavutil/avconfig.h" ++#include "version.h" ++ ++#define AVPALETTE_SIZE 1024 ++#define AVPALETTE_COUNT 256 ++ ++/** ++ * Pixel format. ++ * ++ * @note ++ * AV_PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA ++ * color is put together as: ++ * (A << 24) | (R << 16) | (G << 8) | B ++ * This is stored as BGRA on little-endian CPU architectures and ARGB on ++ * big-endian CPUs. ++ * ++ * @note ++ * If the resolution is not a multiple of the chroma subsampling factor ++ * then the chroma plane resolution must be rounded up. ++ * ++ * @par ++ * When the pixel format is palettized RGB32 (AV_PIX_FMT_PAL8), the palettized ++ * image data is stored in AVFrame.data[0]. The palette is transported in ++ * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is ++ * formatted the same as in AV_PIX_FMT_RGB32 described above (i.e., it is ++ * also endian-specific). Note also that the individual RGB32 palette ++ * components stored in AVFrame.data[1] should be in the range 0..255. ++ * This is important as many custom PAL8 video codecs that were designed ++ * to run on the IBM VGA graphics adapter use 6-bit palette components. ++ * ++ * @par ++ * For all the 8 bits per pixel formats, an RGB32 palette is in data[1] like ++ * for pal8. This palette is filled in automatically by the function ++ * allocating the picture. ++ */ ++enum AVPixelFormat { ++ AV_PIX_FMT_NONE = -1, ++ AV_PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y ++ ///< samples) ++ AV_PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr ++ AV_PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... ++ AV_PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... ++ AV_PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y ++ ///< samples) ++ AV_PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y ++ ///< samples) ++ AV_PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y ++ ///< samples) ++ AV_PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y ++ ///< samples) ++ AV_PIX_FMT_GRAY8, ///< Y , 8bpp ++ AV_PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, ++ ///< in each byte pixels are ordered from the ++ ///< msb to the lsb ++ AV_PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, ++ ///< in each byte pixels are ordered from the ++ ///< msb to the lsb ++ AV_PIX_FMT_PAL8, ///< 8 bits with AV_PIX_FMT_RGB32 palette ++ AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), ++ ///< deprecated in favor of AV_PIX_FMT_YUV420P and ++ ///< setting color_range ++ AV_PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), ++ ///< deprecated in favor of AV_PIX_FMT_YUV422P and ++ ///< setting color_range ++ AV_PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), ++ ///< deprecated in favor of AV_PIX_FMT_YUV444P and ++ ///< setting color_range ++ AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 ++ AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 ++ AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) ++ AV_PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), ++ ///< a byte contains two pixels, the first pixel in the byte ++ ///< is the one composed by the 4 msb bits ++ AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) ++ AV_PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) ++ AV_PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), ++ ///< a byte contains two pixels, the first pixel in the byte ++ ///< is the one composed by the 4 msb bits ++ AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) ++ AV_PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for ++ ///< the UV components, which are interleaved (first byte U ++ ///< and the following byte V) ++ AV_PIX_FMT_NV21, ///< as above, but U and V bytes are swapped ++ ++ AV_PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... ++ AV_PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... ++ AV_PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... ++ AV_PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... ++ ++ AV_PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian ++ AV_PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian ++ AV_PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y ++ ///< samples) ++ AV_PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in ++ ///< favor of AV_PIX_FMT_YUV440P and setting color_range ++ AV_PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 ++ ///< Y & A samples) ++ AV_PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the ++ ///< 2-byte value for each R/G/B component is stored as ++ ///< big-endian ++ AV_PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the ++ ///< 2-byte value for each R/G/B component is stored as ++ ///< little-endian ++ ++ AV_PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), ++ ///< big-endian ++ AV_PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), ++ ///< little-endian ++ AV_PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), ++ ///< big-endian , X=unused/undefined ++ AV_PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), ++ ///< little-endian, X=unused/undefined ++ ++ AV_PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), ++ ///< big-endian ++ AV_PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), ++ ///< little-endian ++ AV_PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), ++ ///< big-endian , X=unused/undefined ++ AV_PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), ++ ///< little-endian, X=unused/undefined ++ ++ /** ++ * Hardware acceleration through VA-API, data[3] contains a ++ * VASurfaceID. ++ */ ++ AV_PIX_FMT_VAAPI, ++ ++ AV_PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per ++ ///< 2x2 Y samples), little-endian ++ AV_PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per ++ ///< 2x2 Y samples), big-endian ++ AV_PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per ++ ///< 2x1 Y samples), little-endian ++ AV_PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per ++ ///< 2x1 Y samples), big-endian ++ AV_PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per ++ ///< 1x1 Y samples), little-endian ++ AV_PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per ++ ///< 1x1 Y samples), big-endian ++ AV_PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] ++ ///< contains a LPDIRECT3DSURFACE9 pointer ++ ++ AV_PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), ++ ///< little-endian, X=unused/undefined ++ AV_PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), ++ ///< big-endian, X=unused/undefined ++ AV_PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), ++ ///< little-endian, X=unused/undefined ++ AV_PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), ++ ///< big-endian, X=unused/undefined ++ AV_PIX_FMT_YA8, ///< 8 bits gray, 8 bits alpha ++ ++ AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 ++ AV_PIX_FMT_GRAY8A = AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 ++ ++ AV_PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the ++ ///< 2-byte value for each R/G/B component is stored as ++ ///< big-endian ++ AV_PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the ++ ///< 2-byte value for each R/G/B component is stored as ++ ///< little-endian ++ ++ /** ++ * The following 12 formats have the disadvantage of needing 1 format for each ++ * bit depth. Notice that each 9/10 bits sample is stored in 16 bits with ++ * extra padding. If you want to support multiple bit depths, then using ++ * AV_PIX_FMT_YUV420P16* with the bpp stored separately is better. ++ */ ++ AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per ++ ///< 2x2 Y samples), big-endian ++ AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per ++ ///< 2x2 Y samples), little-endian ++ AV_PIX_FMT_YUV420P10BE, ///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per ++ ///< 2x2 Y samples), big-endian ++ AV_PIX_FMT_YUV420P10LE, ///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per ++ ///< 2x2 Y samples), little-endian ++ AV_PIX_FMT_YUV422P10BE, ///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per ++ ///< 2x1 Y samples), big-endian ++ AV_PIX_FMT_YUV422P10LE, ///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per ++ ///< 2x1 Y samples), little-endian ++ AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per ++ ///< 1x1 Y samples), big-endian ++ AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per ++ ///< 1x1 Y samples), little-endian ++ AV_PIX_FMT_YUV444P10BE, ///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per ++ ///< 1x1 Y samples), big-endian ++ AV_PIX_FMT_YUV444P10LE, ///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per ++ ///< 1x1 Y samples), little-endian ++ AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per ++ ///< 2x1 Y samples), big-endian ++ AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per ++ ///< 2x1 Y samples), little-endian ++ AV_PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp ++ AV_PIX_FMT_GBR24P = AV_PIX_FMT_GBRP, // alias for #AV_PIX_FMT_GBRP ++ AV_PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big-endian ++ AV_PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little-endian ++ AV_PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big-endian ++ AV_PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little-endian ++ AV_PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big-endian ++ AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little-endian ++ AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y ++ ///< & A samples) ++ AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y ++ ///< & A samples) ++ AV_PIX_FMT_YUVA420P9BE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per ++ ///< 2x2 Y & A samples), big-endian ++ AV_PIX_FMT_YUVA420P9LE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per ++ ///< 2x2 Y & A samples), little-endian ++ AV_PIX_FMT_YUVA422P9BE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per ++ ///< 2x1 Y & A samples), big-endian ++ AV_PIX_FMT_YUVA422P9LE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per ++ ///< 2x1 Y & A samples), little-endian ++ AV_PIX_FMT_YUVA444P9BE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per ++ ///< 1x1 Y & A samples), big-endian ++ AV_PIX_FMT_YUVA444P9LE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per ++ ///< 1x1 Y & A samples), little-endian ++ AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per ++ ///< 2x2 Y & A samples, big-endian) ++ AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per ++ ///< 2x2 Y & A samples, little-endian) ++ AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per ++ ///< 2x1 Y & A samples, big-endian) ++ AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per ++ ///< 2x1 Y & A samples, little-endian) ++ AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per ++ ///< 1x1 Y & A samples, big-endian) ++ AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per ++ ///< 1x1 Y & A samples, little-endian) ++ AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per ++ ///< 2x2 Y & A samples, big-endian) ++ AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per ++ ///< 2x2 Y & A samples, little-endian) ++ AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per ++ ///< 2x1 Y & A samples, big-endian) ++ AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per ++ ///< 2x1 Y & A samples, little-endian) ++ AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per ++ ///< 1x1 Y & A samples, big-endian) ++ AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per ++ ///< 1x1 Y & A samples, little-endian) ++ ++ AV_PIX_FMT_VDPAU, ///< HW acceleration through VDPAU, Picture.data[3] ++ ///< contains a VdpVideoSurface ++ ++ AV_PIX_FMT_XYZ12LE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), ++ ///< the 2-byte value for each X/Y/Z is stored as ++ ///< little-endian, the 4 lower bits are set to 0 ++ AV_PIX_FMT_XYZ12BE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), ++ ///< the 2-byte value for each X/Y/Z is stored as ++ ///< big-endian, the 4 lower bits are set to 0 ++ AV_PIX_FMT_NV16, ///< interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample ++ ///< per 2x1 Y samples) ++ AV_PIX_FMT_NV20LE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb ++ ///< sample per 2x1 Y samples), little-endian ++ AV_PIX_FMT_NV20BE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb ++ ///< sample per 2x1 Y samples), big-endian ++ ++ AV_PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, ++ ///< the 2-byte value for each R/G/B/A component is ++ ///< stored as big-endian ++ AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, ++ ///< the 2-byte value for each R/G/B/A component is ++ ///< stored as little-endian ++ AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, ++ ///< the 2-byte value for each R/G/B/A component is ++ ///< stored as big-endian ++ AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, ++ ///< the 2-byte value for each R/G/B/A component is ++ ///< stored as little-endian ++ ++ AV_PIX_FMT_YVYU422, ///< packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb ++ ++ AV_PIX_FMT_YA16BE, ///< 16 bits gray, 16 bits alpha (big-endian) ++ AV_PIX_FMT_YA16LE, ///< 16 bits gray, 16 bits alpha (little-endian) ++ ++ AV_PIX_FMT_GBRAP, ///< planar GBRA 4:4:4:4 32bpp ++ AV_PIX_FMT_GBRAP16BE, ///< planar GBRA 4:4:4:4 64bpp, big-endian ++ AV_PIX_FMT_GBRAP16LE, ///< planar GBRA 4:4:4:4 64bpp, little-endian ++ /** ++ * HW acceleration through QSV, data[3] contains a pointer to the ++ * mfxFrameSurface1 structure. ++ */ ++ AV_PIX_FMT_QSV, ++ /** ++ * HW acceleration though MMAL, data[3] contains a pointer to the ++ * MMAL_BUFFER_HEADER_T structure. ++ */ ++ AV_PIX_FMT_MMAL, ++ ++ AV_PIX_FMT_D3D11VA_VLD, ///< HW decoding through Direct3D11 via old API, ++ ///< Picture.data[3] contains a ++ ///< ID3D11VideoDecoderOutputView pointer ++ ++ /** ++ * HW acceleration through CUDA. data[i] contain CUdeviceptr pointers ++ * exactly as for system memory frames. ++ */ ++ AV_PIX_FMT_CUDA, ++ ++ AV_PIX_FMT_0RGB, ///< packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined ++ AV_PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined ++ AV_PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined ++ AV_PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined ++ ++ AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per ++ ///< 2x2 Y samples), big-endian ++ AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per ++ ///< 2x2 Y samples), little-endian ++ AV_PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per ++ ///< 2x2 Y samples), big-endian ++ AV_PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per ++ ///< 2x2 Y samples), little-endian ++ AV_PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per ++ ///< 2x1 Y samples), big-endian ++ AV_PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per ++ ///< 2x1 Y samples), little-endian ++ AV_PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per ++ ///< 2x1 Y samples), big-endian ++ AV_PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per ++ ///< 2x1 Y samples), little-endian ++ AV_PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per ++ ///< 1x1 Y samples), big-endian ++ AV_PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per ++ ///< 1x1 Y samples), little-endian ++ AV_PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per ++ ///< 1x1 Y samples), big-endian ++ AV_PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per ++ ///< 1x1 Y samples), little-endian ++ AV_PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big-endian ++ AV_PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little-endian ++ AV_PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big-endian ++ AV_PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little-endian ++ AV_PIX_FMT_YUVJ411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 ++ ///< Y samples) full scale (JPEG), deprecated in favor ++ ///< of AV_PIX_FMT_YUV411P and setting color_range ++ ++ AV_PIX_FMT_BAYER_BGGR8, ///< bayer, BGBG..(odd line), GRGR..(even line), ++ ///< 8-bit samples ++ AV_PIX_FMT_BAYER_RGGB8, ///< bayer, RGRG..(odd line), GBGB..(even line), ++ ///< 8-bit samples ++ AV_PIX_FMT_BAYER_GBRG8, ///< bayer, GBGB..(odd line), RGRG..(even line), ++ ///< 8-bit samples ++ AV_PIX_FMT_BAYER_GRBG8, ///< bayer, GRGR..(odd line), BGBG..(even line), ++ ///< 8-bit samples ++ AV_PIX_FMT_BAYER_BGGR16LE, ///< bayer, BGBG..(odd line), GRGR..(even line), ++ ///< 16-bit samples, little-endian ++ AV_PIX_FMT_BAYER_BGGR16BE, ///< bayer, BGBG..(odd line), GRGR..(even line), ++ ///< 16-bit samples, big-endian ++ AV_PIX_FMT_BAYER_RGGB16LE, ///< bayer, RGRG..(odd line), GBGB..(even line), ++ ///< 16-bit samples, little-endian ++ AV_PIX_FMT_BAYER_RGGB16BE, ///< bayer, RGRG..(odd line), GBGB..(even line), ++ ///< 16-bit samples, big-endian ++ AV_PIX_FMT_BAYER_GBRG16LE, ///< bayer, GBGB..(odd line), RGRG..(even line), ++ ///< 16-bit samples, little-endian ++ AV_PIX_FMT_BAYER_GBRG16BE, ///< bayer, GBGB..(odd line), RGRG..(even line), ++ ///< 16-bit samples, big-endian ++ AV_PIX_FMT_BAYER_GRBG16LE, ///< bayer, GRGR..(odd line), BGBG..(even line), ++ ///< 16-bit samples, little-endian ++ AV_PIX_FMT_BAYER_GRBG16BE, ///< bayer, GRGR..(odd line), BGBG..(even line), ++ ///< 16-bit samples, big-endian ++ ++ AV_PIX_FMT_XVMC, ///< XVideo Motion Acceleration via common packet passing ++ ++ AV_PIX_FMT_YUV440P10LE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per ++ ///< 1x2 Y samples), little-endian ++ AV_PIX_FMT_YUV440P10BE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per ++ ///< 1x2 Y samples), big-endian ++ AV_PIX_FMT_YUV440P12LE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per ++ ///< 1x2 Y samples), little-endian ++ AV_PIX_FMT_YUV440P12BE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per ++ ///< 1x2 Y samples), big-endian ++ AV_PIX_FMT_AYUV64LE, ///< packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y ++ ///< & A samples), little-endian ++ AV_PIX_FMT_AYUV64BE, ///< packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y ++ ///< & A samples), big-endian ++ ++ AV_PIX_FMT_VIDEOTOOLBOX, ///< hardware decoding through Videotoolbox ++ ++ AV_PIX_FMT_P010LE, ///< like NV12, with 10bpp per component, data in the high ++ ///< bits, zeros in the low bits, little-endian ++ AV_PIX_FMT_P010BE, ///< like NV12, with 10bpp per component, data in the high ++ ///< bits, zeros in the low bits, big-endian ++ ++ AV_PIX_FMT_GBRAP12BE, ///< planar GBR 4:4:4:4 48bpp, big-endian ++ AV_PIX_FMT_GBRAP12LE, ///< planar GBR 4:4:4:4 48bpp, little-endian ++ ++ AV_PIX_FMT_GBRAP10BE, ///< planar GBR 4:4:4:4 40bpp, big-endian ++ AV_PIX_FMT_GBRAP10LE, ///< planar GBR 4:4:4:4 40bpp, little-endian ++ ++ AV_PIX_FMT_MEDIACODEC, ///< hardware decoding through MediaCodec ++ ++ AV_PIX_FMT_GRAY12BE, ///< Y , 12bpp, big-endian ++ AV_PIX_FMT_GRAY12LE, ///< Y , 12bpp, little-endian ++ AV_PIX_FMT_GRAY10BE, ///< Y , 10bpp, big-endian ++ AV_PIX_FMT_GRAY10LE, ///< Y , 10bpp, little-endian ++ ++ AV_PIX_FMT_P016LE, ///< like NV12, with 16bpp per component, little-endian ++ AV_PIX_FMT_P016BE, ///< like NV12, with 16bpp per component, big-endian ++ ++ /** ++ * Hardware surfaces for Direct3D11. ++ * ++ * This is preferred over the legacy AV_PIX_FMT_D3D11VA_VLD. The new D3D11 ++ * hwaccel API and filtering support AV_PIX_FMT_D3D11 only. ++ * ++ * data[0] contains a ID3D11Texture2D pointer, and data[1] contains the ++ * texture array index of the frame as intptr_t if the ID3D11Texture2D is ++ * an array texture (or always 0 if it's a normal texture). ++ */ ++ AV_PIX_FMT_D3D11, ++ ++ AV_PIX_FMT_GRAY9BE, ///< Y , 9bpp, big-endian ++ AV_PIX_FMT_GRAY9LE, ///< Y , 9bpp, little-endian ++ ++ AV_PIX_FMT_GBRPF32BE, ///< IEEE-754 single precision planar GBR 4:4:4, 96bpp, ++ ///< big-endian ++ AV_PIX_FMT_GBRPF32LE, ///< IEEE-754 single precision planar GBR 4:4:4, 96bpp, ++ ///< little-endian ++ AV_PIX_FMT_GBRAPF32BE, ///< IEEE-754 single precision planar GBRA 4:4:4:4, ++ ///< 128bpp, big-endian ++ AV_PIX_FMT_GBRAPF32LE, ///< IEEE-754 single precision planar GBRA 4:4:4:4, ++ ///< 128bpp, little-endian ++ ++ /** ++ * DRM-managed buffers exposed through PRIME buffer sharing. ++ * ++ * data[0] points to an AVDRMFrameDescriptor. ++ */ ++ AV_PIX_FMT_DRM_PRIME, ++ /** ++ * Hardware surfaces for OpenCL. ++ * ++ * data[i] contain 2D image objects (typed in C as cl_mem, used ++ * in OpenCL as image2d_t) for each plane of the surface. ++ */ ++ AV_PIX_FMT_OPENCL, ++ ++ AV_PIX_FMT_GRAY14BE, ///< Y , 14bpp, big-endian ++ AV_PIX_FMT_GRAY14LE, ///< Y , 14bpp, little-endian ++ ++ AV_PIX_FMT_GRAYF32BE, ///< IEEE-754 single precision Y, 32bpp, big-endian ++ AV_PIX_FMT_GRAYF32LE, ///< IEEE-754 single precision Y, 32bpp, little-endian ++ ++ AV_PIX_FMT_YUVA422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per ++ ///< 2x1 Y samples), 12b alpha, big-endian ++ AV_PIX_FMT_YUVA422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per ++ ///< 2x1 Y samples), 12b alpha, little-endian ++ AV_PIX_FMT_YUVA444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per ++ ///< 1x1 Y samples), 12b alpha, big-endian ++ AV_PIX_FMT_YUVA444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per ++ ///< 1x1 Y samples), 12b alpha, little-endian ++ ++ AV_PIX_FMT_NV24, ///< planar YUV 4:4:4, 24bpp, 1 plane for Y and 1 plane for ++ ///< the UV components, which are interleaved (first byte U ++ ///< and the following byte V) ++ AV_PIX_FMT_NV42, ///< as above, but U and V bytes are swapped ++ ++ /** ++ * Vulkan hardware images. ++ * ++ * data[0] points to an AVVkFrame ++ */ ++ AV_PIX_FMT_VULKAN, ++ ++ AV_PIX_FMT_Y210BE, ///< packed YUV 4:2:2 like YUYV422, 20bpp, data in the ++ ///< high bits, big-endian ++ AV_PIX_FMT_Y210LE, ///< packed YUV 4:2:2 like YUYV422, 20bpp, data in the ++ ///< high bits, little-endian ++ ++ AV_PIX_FMT_X2RGB10LE, ///< packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G ++ ///< 10B(lsb), little-endian, X=unused/undefined ++ AV_PIX_FMT_X2RGB10BE, ///< packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G ++ ///< 10B(lsb), big-endian, X=unused/undefined ++ AV_PIX_FMT_X2BGR10LE, ///< packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G ++ ///< 10R(lsb), little-endian, X=unused/undefined ++ AV_PIX_FMT_X2BGR10BE, ///< packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G ++ ///< 10R(lsb), big-endian, X=unused/undefined ++ ++ AV_PIX_FMT_P210BE, ///< interleaved chroma YUV 4:2:2, 20bpp, data in the high ++ ///< bits, big-endian ++ AV_PIX_FMT_P210LE, ///< interleaved chroma YUV 4:2:2, 20bpp, data in the high ++ ///< bits, little-endian ++ ++ AV_PIX_FMT_P410BE, ///< interleaved chroma YUV 4:4:4, 30bpp, data in the high ++ ///< bits, big-endian ++ AV_PIX_FMT_P410LE, ///< interleaved chroma YUV 4:4:4, 30bpp, data in the high ++ ///< bits, little-endian ++ ++ AV_PIX_FMT_P216BE, ///< interleaved chroma YUV 4:2:2, 32bpp, big-endian ++ AV_PIX_FMT_P216LE, ///< interleaved chroma YUV 4:2:2, 32bpp, liddle-endian ++ ++ AV_PIX_FMT_P416BE, ///< interleaved chroma YUV 4:4:4, 48bpp, big-endian ++ AV_PIX_FMT_P416LE, ///< interleaved chroma YUV 4:4:4, 48bpp, little-endian ++ ++ AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to ++ ///< link with shared libav* because the number of formats ++ ///< might differ between versions ++}; ++ ++#if AV_HAVE_BIGENDIAN ++# define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##be ++#else ++# define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##le ++#endif ++ ++#define AV_PIX_FMT_RGB32 AV_PIX_FMT_NE(ARGB, BGRA) ++#define AV_PIX_FMT_RGB32_1 AV_PIX_FMT_NE(RGBA, ABGR) ++#define AV_PIX_FMT_BGR32 AV_PIX_FMT_NE(ABGR, RGBA) ++#define AV_PIX_FMT_BGR32_1 AV_PIX_FMT_NE(BGRA, ARGB) ++#define AV_PIX_FMT_0RGB32 AV_PIX_FMT_NE(0RGB, BGR0) ++#define AV_PIX_FMT_0BGR32 AV_PIX_FMT_NE(0BGR, RGB0) ++ ++#define AV_PIX_FMT_GRAY9 AV_PIX_FMT_NE(GRAY9BE, GRAY9LE) ++#define AV_PIX_FMT_GRAY10 AV_PIX_FMT_NE(GRAY10BE, GRAY10LE) ++#define AV_PIX_FMT_GRAY12 AV_PIX_FMT_NE(GRAY12BE, GRAY12LE) ++#define AV_PIX_FMT_GRAY14 AV_PIX_FMT_NE(GRAY14BE, GRAY14LE) ++#define AV_PIX_FMT_GRAY16 AV_PIX_FMT_NE(GRAY16BE, GRAY16LE) ++#define AV_PIX_FMT_YA16 AV_PIX_FMT_NE(YA16BE, YA16LE) ++#define AV_PIX_FMT_RGB48 AV_PIX_FMT_NE(RGB48BE, RGB48LE) ++#define AV_PIX_FMT_RGB565 AV_PIX_FMT_NE(RGB565BE, RGB565LE) ++#define AV_PIX_FMT_RGB555 AV_PIX_FMT_NE(RGB555BE, RGB555LE) ++#define AV_PIX_FMT_RGB444 AV_PIX_FMT_NE(RGB444BE, RGB444LE) ++#define AV_PIX_FMT_RGBA64 AV_PIX_FMT_NE(RGBA64BE, RGBA64LE) ++#define AV_PIX_FMT_BGR48 AV_PIX_FMT_NE(BGR48BE, BGR48LE) ++#define AV_PIX_FMT_BGR565 AV_PIX_FMT_NE(BGR565BE, BGR565LE) ++#define AV_PIX_FMT_BGR555 AV_PIX_FMT_NE(BGR555BE, BGR555LE) ++#define AV_PIX_FMT_BGR444 AV_PIX_FMT_NE(BGR444BE, BGR444LE) ++#define AV_PIX_FMT_BGRA64 AV_PIX_FMT_NE(BGRA64BE, BGRA64LE) ++ ++#define AV_PIX_FMT_YUV420P9 AV_PIX_FMT_NE(YUV420P9BE, YUV420P9LE) ++#define AV_PIX_FMT_YUV422P9 AV_PIX_FMT_NE(YUV422P9BE, YUV422P9LE) ++#define AV_PIX_FMT_YUV444P9 AV_PIX_FMT_NE(YUV444P9BE, YUV444P9LE) ++#define AV_PIX_FMT_YUV420P10 AV_PIX_FMT_NE(YUV420P10BE, YUV420P10LE) ++#define AV_PIX_FMT_YUV422P10 AV_PIX_FMT_NE(YUV422P10BE, YUV422P10LE) ++#define AV_PIX_FMT_YUV440P10 AV_PIX_FMT_NE(YUV440P10BE, YUV440P10LE) ++#define AV_PIX_FMT_YUV444P10 AV_PIX_FMT_NE(YUV444P10BE, YUV444P10LE) ++#define AV_PIX_FMT_YUV420P12 AV_PIX_FMT_NE(YUV420P12BE, YUV420P12LE) ++#define AV_PIX_FMT_YUV422P12 AV_PIX_FMT_NE(YUV422P12BE, YUV422P12LE) ++#define AV_PIX_FMT_YUV440P12 AV_PIX_FMT_NE(YUV440P12BE, YUV440P12LE) ++#define AV_PIX_FMT_YUV444P12 AV_PIX_FMT_NE(YUV444P12BE, YUV444P12LE) ++#define AV_PIX_FMT_YUV420P14 AV_PIX_FMT_NE(YUV420P14BE, YUV420P14LE) ++#define AV_PIX_FMT_YUV422P14 AV_PIX_FMT_NE(YUV422P14BE, YUV422P14LE) ++#define AV_PIX_FMT_YUV444P14 AV_PIX_FMT_NE(YUV444P14BE, YUV444P14LE) ++#define AV_PIX_FMT_YUV420P16 AV_PIX_FMT_NE(YUV420P16BE, YUV420P16LE) ++#define AV_PIX_FMT_YUV422P16 AV_PIX_FMT_NE(YUV422P16BE, YUV422P16LE) ++#define AV_PIX_FMT_YUV444P16 AV_PIX_FMT_NE(YUV444P16BE, YUV444P16LE) ++ ++#define AV_PIX_FMT_GBRP9 AV_PIX_FMT_NE(GBRP9BE, GBRP9LE) ++#define AV_PIX_FMT_GBRP10 AV_PIX_FMT_NE(GBRP10BE, GBRP10LE) ++#define AV_PIX_FMT_GBRP12 AV_PIX_FMT_NE(GBRP12BE, GBRP12LE) ++#define AV_PIX_FMT_GBRP14 AV_PIX_FMT_NE(GBRP14BE, GBRP14LE) ++#define AV_PIX_FMT_GBRP16 AV_PIX_FMT_NE(GBRP16BE, GBRP16LE) ++#define AV_PIX_FMT_GBRAP10 AV_PIX_FMT_NE(GBRAP10BE, GBRAP10LE) ++#define AV_PIX_FMT_GBRAP12 AV_PIX_FMT_NE(GBRAP12BE, GBRAP12LE) ++#define AV_PIX_FMT_GBRAP16 AV_PIX_FMT_NE(GBRAP16BE, GBRAP16LE) ++ ++#define AV_PIX_FMT_BAYER_BGGR16 AV_PIX_FMT_NE(BAYER_BGGR16BE, BAYER_BGGR16LE) ++#define AV_PIX_FMT_BAYER_RGGB16 AV_PIX_FMT_NE(BAYER_RGGB16BE, BAYER_RGGB16LE) ++#define AV_PIX_FMT_BAYER_GBRG16 AV_PIX_FMT_NE(BAYER_GBRG16BE, BAYER_GBRG16LE) ++#define AV_PIX_FMT_BAYER_GRBG16 AV_PIX_FMT_NE(BAYER_GRBG16BE, BAYER_GRBG16LE) ++ ++#define AV_PIX_FMT_GBRPF32 AV_PIX_FMT_NE(GBRPF32BE, GBRPF32LE) ++#define AV_PIX_FMT_GBRAPF32 AV_PIX_FMT_NE(GBRAPF32BE, GBRAPF32LE) ++ ++#define AV_PIX_FMT_GRAYF32 AV_PIX_FMT_NE(GRAYF32BE, GRAYF32LE) ++ ++#define AV_PIX_FMT_YUVA420P9 AV_PIX_FMT_NE(YUVA420P9BE, YUVA420P9LE) ++#define AV_PIX_FMT_YUVA422P9 AV_PIX_FMT_NE(YUVA422P9BE, YUVA422P9LE) ++#define AV_PIX_FMT_YUVA444P9 AV_PIX_FMT_NE(YUVA444P9BE, YUVA444P9LE) ++#define AV_PIX_FMT_YUVA420P10 AV_PIX_FMT_NE(YUVA420P10BE, YUVA420P10LE) ++#define AV_PIX_FMT_YUVA422P10 AV_PIX_FMT_NE(YUVA422P10BE, YUVA422P10LE) ++#define AV_PIX_FMT_YUVA444P10 AV_PIX_FMT_NE(YUVA444P10BE, YUVA444P10LE) ++#define AV_PIX_FMT_YUVA422P12 AV_PIX_FMT_NE(YUVA422P12BE, YUVA422P12LE) ++#define AV_PIX_FMT_YUVA444P12 AV_PIX_FMT_NE(YUVA444P12BE, YUVA444P12LE) ++#define AV_PIX_FMT_YUVA420P16 AV_PIX_FMT_NE(YUVA420P16BE, YUVA420P16LE) ++#define AV_PIX_FMT_YUVA422P16 AV_PIX_FMT_NE(YUVA422P16BE, YUVA422P16LE) ++#define AV_PIX_FMT_YUVA444P16 AV_PIX_FMT_NE(YUVA444P16BE, YUVA444P16LE) ++ ++#define AV_PIX_FMT_XYZ12 AV_PIX_FMT_NE(XYZ12BE, XYZ12LE) ++#define AV_PIX_FMT_NV20 AV_PIX_FMT_NE(NV20BE, NV20LE) ++#define AV_PIX_FMT_AYUV64 AV_PIX_FMT_NE(AYUV64BE, AYUV64LE) ++#define AV_PIX_FMT_P010 AV_PIX_FMT_NE(P010BE, P010LE) ++#define AV_PIX_FMT_P016 AV_PIX_FMT_NE(P016BE, P016LE) ++ ++#define AV_PIX_FMT_Y210 AV_PIX_FMT_NE(Y210BE, Y210LE) ++#define AV_PIX_FMT_X2RGB10 AV_PIX_FMT_NE(X2RGB10BE, X2RGB10LE) ++#define AV_PIX_FMT_X2BGR10 AV_PIX_FMT_NE(X2BGR10BE, X2BGR10LE) ++ ++#define AV_PIX_FMT_P210 AV_PIX_FMT_NE(P210BE, P210LE) ++#define AV_PIX_FMT_P410 AV_PIX_FMT_NE(P410BE, P410LE) ++#define AV_PIX_FMT_P216 AV_PIX_FMT_NE(P216BE, P216LE) ++#define AV_PIX_FMT_P416 AV_PIX_FMT_NE(P416BE, P416LE) ++ ++/** ++ * Chromaticity coordinates of the source primaries. ++ * These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.1 and ++ * ITU-T H.273. ++ */ ++enum AVColorPrimaries { ++ AVCOL_PRI_RESERVED0 = 0, ++ AVCOL_PRI_BT709 = ++ 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B ++ AVCOL_PRI_UNSPECIFIED = 2, ++ AVCOL_PRI_RESERVED = 3, ++ AVCOL_PRI_BT470M = ++ 4, ///< also FCC Title 47 Code of Federal Regulations 73.682 (a)(20) ++ ++ AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R ++ ///< BT1700 625 PAL & SECAM ++ AVCOL_PRI_SMPTE170M = ++ 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC ++ AVCOL_PRI_SMPTE240M = ++ 7, ///< identical to above, also called "SMPTE C" even though it uses D65 ++ AVCOL_PRI_FILM = 8, ///< colour filters using Illuminant C ++ AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 ++ AVCOL_PRI_SMPTE428 = 10, ///< SMPTE ST 428-1 (CIE 1931 XYZ) ++ AVCOL_PRI_SMPTEST428_1 = AVCOL_PRI_SMPTE428, ++ AVCOL_PRI_SMPTE431 = 11, ///< SMPTE ST 431-2 (2011) / DCI P3 ++ AVCOL_PRI_SMPTE432 = 12, ///< SMPTE ST 432-1 (2010) / P3 D65 / Display P3 ++ AVCOL_PRI_EBU3213 = 22, ///< EBU Tech. 3213-E (nothing there) / one of JEDEC ++ ///< P22 group phosphors ++ AVCOL_PRI_JEDEC_P22 = AVCOL_PRI_EBU3213, ++ AVCOL_PRI_NB ///< Not part of ABI ++}; ++ ++/** ++ * Color Transfer Characteristic. ++ * These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.2. ++ */ ++enum AVColorTransferCharacteristic { ++ AVCOL_TRC_RESERVED0 = 0, ++ AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 ++ AVCOL_TRC_UNSPECIFIED = 2, ++ AVCOL_TRC_RESERVED = 3, ++ AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM ++ AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG ++ AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 ++ ///< 525 or 625 / ITU-R BT1700 NTSC ++ AVCOL_TRC_SMPTE240M = 7, ++ AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" ++ AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" ++ AVCOL_TRC_LOG_SQRT = ++ 10, ///< "Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)" ++ AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 ++ AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut ++ AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) ++ AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10-bit system ++ AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12-bit system ++ AVCOL_TRC_SMPTE2084 = ++ 16, ///< SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems ++ AVCOL_TRC_SMPTEST2084 = AVCOL_TRC_SMPTE2084, ++ AVCOL_TRC_SMPTE428 = 17, ///< SMPTE ST 428-1 ++ AVCOL_TRC_SMPTEST428_1 = AVCOL_TRC_SMPTE428, ++ AVCOL_TRC_ARIB_STD_B67 = 18, ///< ARIB STD-B67, known as "Hybrid log-gamma" ++ AVCOL_TRC_NB ///< Not part of ABI ++}; ++ ++/** ++ * YUV colorspace type. ++ * These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.3. ++ */ ++enum AVColorSpace { ++ AVCOL_SPC_RGB = 0, ///< order of coefficients is actually GBR, also IEC ++ ///< 61966-2-1 (sRGB), YZX and ST 428-1 ++ AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / ++ ///< derived in SMPTE RP 177 Annex B ++ AVCOL_SPC_UNSPECIFIED = 2, ++ AVCOL_SPC_RESERVED = ++ 3, ///< reserved for future use by ITU-T and ISO/IEC just like 15-255 are ++ AVCOL_SPC_FCC = ++ 4, ///< FCC Title 47 Code of Federal Regulations 73.682 (a)(20) ++ AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R ++ ///< BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 ++ AVCOL_SPC_SMPTE170M = ++ 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / ++ ///< functionally identical to above ++ AVCOL_SPC_SMPTE240M = ++ 7, ///< derived from 170M primaries and D65 white point, 170M is derived ++ ///< from BT470 System M's primaries ++ AVCOL_SPC_YCGCO = ++ 8, ///< used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 ++ AVCOL_SPC_YCOCG = AVCOL_SPC_YCGCO, ++ AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system ++ AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system ++ AVCOL_SPC_SMPTE2085 = 11, ///< SMPTE 2085, Y'D'zD'x ++ AVCOL_SPC_CHROMA_DERIVED_NCL = ++ 12, ///< Chromaticity-derived non-constant luminance system ++ AVCOL_SPC_CHROMA_DERIVED_CL = ++ 13, ///< Chromaticity-derived constant luminance system ++ AVCOL_SPC_ICTCP = 14, ///< ITU-R BT.2100-0, ICtCp ++ AVCOL_SPC_NB ///< Not part of ABI ++}; ++ ++/** ++ * Visual content value range. ++ * ++ * These values are based on definitions that can be found in multiple ++ * specifications, such as ITU-T BT.709 (3.4 - Quantization of RGB, luminance ++ * and colour-difference signals), ITU-T BT.2020 (Table 5 - Digital ++ * Representation) as well as ITU-T BT.2100 (Table 9 - Digital 10- and 12-bit ++ * integer representation). At the time of writing, the BT.2100 one is ++ * recommended, as it also defines the full range representation. ++ * ++ * Common definitions: ++ * - For RGB and luma planes such as Y in YCbCr and I in ICtCp, ++ * 'E' is the original value in range of 0.0 to 1.0. ++ * - For chroma planes such as Cb,Cr and Ct,Cp, 'E' is the original ++ * value in range of -0.5 to 0.5. ++ * - 'n' is the output bit depth. ++ * - For additional definitions such as rounding and clipping to valid n ++ * bit unsigned integer range, please refer to BT.2100 (Table 9). ++ */ ++enum AVColorRange { ++ AVCOL_RANGE_UNSPECIFIED = 0, ++ ++ /** ++ * Narrow or limited range content. ++ * ++ * - For luma planes: ++ * ++ * (219 * E + 16) * 2^(n-8) ++ * ++ * F.ex. the range of 16-235 for 8 bits ++ * ++ * - For chroma planes: ++ * ++ * (224 * E + 128) * 2^(n-8) ++ * ++ * F.ex. the range of 16-240 for 8 bits ++ */ ++ AVCOL_RANGE_MPEG = 1, ++ ++ /** ++ * Full range content. ++ * ++ * - For RGB and luma planes: ++ * ++ * (2^n - 1) * E ++ * ++ * F.ex. the range of 0-255 for 8 bits ++ * ++ * - For chroma planes: ++ * ++ * (2^n - 1) * E + 2^(n - 1) ++ * ++ * F.ex. the range of 1-255 for 8 bits ++ */ ++ AVCOL_RANGE_JPEG = 2, ++ AVCOL_RANGE_NB ///< Not part of ABI ++}; ++ ++/** ++ * Location of chroma samples. ++ * ++ * Illustration showing the location of the first (top left) chroma sample of ++ *the image, the left shows only luma, the right shows the location of the ++ *chroma sample, the 2 could be imagined to overlay each other but are drawn ++ *separately due to limitations of ASCII ++ * ++ * 1st 2nd 1st 2nd horizontal luma sample positions ++ * v v v v ++ * ______ ______ ++ *1st luma line > |X X ... |3 4 X ... X are luma samples, ++ * | |1 2 1-6 are possible chroma positions ++ *2nd luma line > |X X ... |5 6 X ... 0 is undefined/unknown position ++ */ ++enum AVChromaLocation { ++ AVCHROMA_LOC_UNSPECIFIED = 0, ++ AVCHROMA_LOC_LEFT = 1, ///< MPEG-2/4 4:2:0, H.264 default for 4:2:0 ++ AVCHROMA_LOC_CENTER = 2, ///< MPEG-1 4:2:0, JPEG 4:2:0, H.263 4:2:0 ++ AVCHROMA_LOC_TOPLEFT = ++ 3, ///< ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2 ++ AVCHROMA_LOC_TOP = 4, ++ AVCHROMA_LOC_BOTTOMLEFT = 5, ++ AVCHROMA_LOC_BOTTOM = 6, ++ AVCHROMA_LOC_NB ///< Not part of ABI ++}; ++ ++#endif /* AVUTIL_PIXFMT_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/rational.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/rational.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/rational.h +@@ -0,0 +1,221 @@ ++/* ++ * rational numbers ++ * Copyright (c) 2003 Michael Niedermayer ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++/** ++ * @file ++ * @ingroup lavu_math_rational ++ * Utilties for rational number calculation. ++ * @author Michael Niedermayer ++ */ ++ ++#ifndef AVUTIL_RATIONAL_H ++#define AVUTIL_RATIONAL_H ++ ++#include ++#include ++#include "attributes.h" ++ ++/** ++ * @defgroup lavu_math_rational AVRational ++ * @ingroup lavu_math ++ * Rational number calculation. ++ * ++ * While rational numbers can be expressed as floating-point numbers, the ++ * conversion process is a lossy one, so are floating-point operations. On the ++ * other hand, the nature of FFmpeg demands highly accurate calculation of ++ * timestamps. This set of rational number utilities serves as a generic ++ * interface for manipulating rational numbers as pairs of numerators and ++ * denominators. ++ * ++ * Many of the functions that operate on AVRational's have the suffix `_q`, in ++ * reference to the mathematical symbol "ℚ" (Q) which denotes the set of all ++ * rational numbers. ++ * ++ * @{ ++ */ ++ ++/** ++ * Rational number (pair of numerator and denominator). ++ */ ++typedef struct AVRational { ++ int num; ///< Numerator ++ int den; ///< Denominator ++} AVRational; ++ ++/** ++ * Create an AVRational. ++ * ++ * Useful for compilers that do not support compound literals. ++ * ++ * @note The return value is not reduced. ++ * @see av_reduce() ++ */ ++static inline AVRational av_make_q(int num, int den) { ++ AVRational r = {num, den}; ++ return r; ++} ++ ++/** ++ * Compare two rationals. ++ * ++ * @param a First rational ++ * @param b Second rational ++ * ++ * @return One of the following values: ++ * - 0 if `a == b` ++ * - 1 if `a > b` ++ * - -1 if `a < b` ++ * - `INT_MIN` if one of the values is of the form `0 / 0` ++ */ ++static inline int av_cmp_q(AVRational a, AVRational b) { ++ const int64_t tmp = a.num * (int64_t)b.den - b.num * (int64_t)a.den; ++ ++ if (tmp) ++ return (int)((tmp ^ a.den ^ b.den) >> 63) | 1; ++ else if (b.den && a.den) ++ return 0; ++ else if (a.num && b.num) ++ return (a.num >> 31) - (b.num >> 31); ++ else ++ return INT_MIN; ++} ++ ++/** ++ * Convert an AVRational to a `double`. ++ * @param a AVRational to convert ++ * @return `a` in floating-point form ++ * @see av_d2q() ++ */ ++static inline double av_q2d(AVRational a) { return a.num / (double)a.den; } ++ ++/** ++ * Reduce a fraction. ++ * ++ * This is useful for framerate calculations. ++ * ++ * @param[out] dst_num Destination numerator ++ * @param[out] dst_den Destination denominator ++ * @param[in] num Source numerator ++ * @param[in] den Source denominator ++ * @param[in] max Maximum allowed values for `dst_num` & `dst_den` ++ * @return 1 if the operation is exact, 0 otherwise ++ */ ++int av_reduce(int* dst_num, int* dst_den, int64_t num, int64_t den, ++ int64_t max); ++ ++/** ++ * Multiply two rationals. ++ * @param b First rational ++ * @param c Second rational ++ * @return b*c ++ */ ++AVRational av_mul_q(AVRational b, AVRational c) av_const; ++ ++/** ++ * Divide one rational by another. ++ * @param b First rational ++ * @param c Second rational ++ * @return b/c ++ */ ++AVRational av_div_q(AVRational b, AVRational c) av_const; ++ ++/** ++ * Add two rationals. ++ * @param b First rational ++ * @param c Second rational ++ * @return b+c ++ */ ++AVRational av_add_q(AVRational b, AVRational c) av_const; ++ ++/** ++ * Subtract one rational from another. ++ * @param b First rational ++ * @param c Second rational ++ * @return b-c ++ */ ++AVRational av_sub_q(AVRational b, AVRational c) av_const; ++ ++/** ++ * Invert a rational. ++ * @param q value ++ * @return 1 / q ++ */ ++static av_always_inline AVRational av_inv_q(AVRational q) { ++ AVRational r = {q.den, q.num}; ++ return r; ++} ++ ++/** ++ * Convert a double precision floating point number to a rational. ++ * ++ * In case of infinity, the returned value is expressed as `{1, 0}` or ++ * `{-1, 0}` depending on the sign. ++ * ++ * @param d `double` to convert ++ * @param max Maximum allowed numerator and denominator ++ * @return `d` in AVRational form ++ * @see av_q2d() ++ */ ++AVRational av_d2q(double d, int max) av_const; ++ ++/** ++ * Find which of the two rationals is closer to another rational. ++ * ++ * @param q Rational to be compared against ++ * @param q1,q2 Rationals to be tested ++ * @return One of the following values: ++ * - 1 if `q1` is nearer to `q` than `q2` ++ * - -1 if `q2` is nearer to `q` than `q1` ++ * - 0 if they have the same distance ++ */ ++int av_nearer_q(AVRational q, AVRational q1, AVRational q2); ++ ++/** ++ * Find the value in a list of rationals nearest a given reference rational. ++ * ++ * @param q Reference rational ++ * @param q_list Array of rationals terminated by `{0, 0}` ++ * @return Index of the nearest value found in the array ++ */ ++int av_find_nearest_q_idx(AVRational q, const AVRational* q_list); ++ ++/** ++ * Convert an AVRational to a IEEE 32-bit `float` expressed in fixed-point ++ * format. ++ * ++ * @param q Rational to be converted ++ * @return Equivalent floating-point value, expressed as an unsigned 32-bit ++ * integer. ++ * @note The returned value is platform-indepedant. ++ */ ++uint32_t av_q2intfloat(AVRational q); ++ ++/** ++ * Return the best rational so that a and b are multiple of it. ++ * If the resulting denominator is larger than max_den, return def. ++ */ ++AVRational av_gcd_q(AVRational a, AVRational b, int max_den, AVRational def); ++ ++/** ++ * @} ++ */ ++ ++#endif /* AVUTIL_RATIONAL_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/samplefmt.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/samplefmt.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/samplefmt.h +@@ -0,0 +1,276 @@ ++/* ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifndef AVUTIL_SAMPLEFMT_H ++#define AVUTIL_SAMPLEFMT_H ++ ++#include ++ ++#include "avutil.h" ++#include "attributes.h" ++ ++/** ++ * @addtogroup lavu_audio ++ * @{ ++ * ++ * @defgroup lavu_sampfmts Audio sample formats ++ * ++ * Audio sample format enumeration and related convenience functions. ++ * @{ ++ */ ++ ++/** ++ * Audio sample formats ++ * ++ * - The data described by the sample format is always in native-endian order. ++ * Sample values can be expressed by native C types, hence the lack of a ++ * signed 24-bit sample format even though it is a common raw audio data format. ++ * ++ * - The floating-point formats are based on full volume being in the range ++ * [-1.0, 1.0]. Any values outside this range are beyond full volume level. ++ * ++ * - The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg ++ * (such as AVFrame in libavcodec) is as follows: ++ * ++ * @par ++ * For planar sample formats, each audio channel is in a separate data plane, ++ * and linesize is the buffer size, in bytes, for a single plane. All data ++ * planes must be the same size. For packed sample formats, only the first data ++ * plane is used, and samples for each channel are interleaved. In this case, ++ * linesize is the buffer size, in bytes, for the 1 plane. ++ * ++ */ ++enum AVSampleFormat { ++ AV_SAMPLE_FMT_NONE = -1, ++ AV_SAMPLE_FMT_U8, ///< unsigned 8 bits ++ AV_SAMPLE_FMT_S16, ///< signed 16 bits ++ AV_SAMPLE_FMT_S32, ///< signed 32 bits ++ AV_SAMPLE_FMT_FLT, ///< float ++ AV_SAMPLE_FMT_DBL, ///< double ++ ++ AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar ++ AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar ++ AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar ++ AV_SAMPLE_FMT_FLTP, ///< float, planar ++ AV_SAMPLE_FMT_DBLP, ///< double, planar ++ AV_SAMPLE_FMT_S64, ///< signed 64 bits ++ AV_SAMPLE_FMT_S64P, ///< signed 64 bits, planar ++ ++ AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking ++ ///< dynamically ++}; ++ ++/** ++ * Return the name of sample_fmt, or NULL if sample_fmt is not ++ * recognized. ++ */ ++const char* av_get_sample_fmt_name(enum AVSampleFormat sample_fmt); ++ ++/** ++ * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE ++ * on error. ++ */ ++enum AVSampleFormat av_get_sample_fmt(const char* name); ++ ++/** ++ * Return the planar<->packed alternative form of the given sample format, or ++ * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the ++ * requested planar/packed format, the format returned is the same as the ++ * input. ++ */ ++enum AVSampleFormat av_get_alt_sample_fmt(enum AVSampleFormat sample_fmt, ++ int planar); ++ ++/** ++ * Get the packed alternative form of the given sample format. ++ * ++ * If the passed sample_fmt is already in packed format, the format returned is ++ * the same as the input. ++ * ++ * @return the packed alternative form of the given sample format or ++ AV_SAMPLE_FMT_NONE on error. ++ */ ++enum AVSampleFormat av_get_packed_sample_fmt(enum AVSampleFormat sample_fmt); ++ ++/** ++ * Get the planar alternative form of the given sample format. ++ * ++ * If the passed sample_fmt is already in planar format, the format returned is ++ * the same as the input. ++ * ++ * @return the planar alternative form of the given sample format or ++ AV_SAMPLE_FMT_NONE on error. ++ */ ++enum AVSampleFormat av_get_planar_sample_fmt(enum AVSampleFormat sample_fmt); ++ ++/** ++ * Generate a string corresponding to the sample format with ++ * sample_fmt, or a header if sample_fmt is negative. ++ * ++ * @param buf the buffer where to write the string ++ * @param buf_size the size of buf ++ * @param sample_fmt the number of the sample format to print the ++ * corresponding info string, or a negative value to print the ++ * corresponding header. ++ * @return the pointer to the filled buffer or NULL if sample_fmt is ++ * unknown or in case of other errors ++ */ ++char* av_get_sample_fmt_string(char* buf, int buf_size, ++ enum AVSampleFormat sample_fmt); ++ ++/** ++ * Return number of bytes per sample. ++ * ++ * @param sample_fmt the sample format ++ * @return number of bytes per sample or zero if unknown for the given ++ * sample format ++ */ ++int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt); ++ ++/** ++ * Check if the sample format is planar. ++ * ++ * @param sample_fmt the sample format to inspect ++ * @return 1 if the sample format is planar, 0 if it is interleaved ++ */ ++int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt); ++ ++/** ++ * Get the required buffer size for the given audio parameters. ++ * ++ * @param[out] linesize calculated linesize, may be NULL ++ * @param nb_channels the number of channels ++ * @param nb_samples the number of samples in a single channel ++ * @param sample_fmt the sample format ++ * @param align buffer size alignment (0 = default, 1 = no alignment) ++ * @return required buffer size, or negative error code on failure ++ */ ++int av_samples_get_buffer_size(int* linesize, int nb_channels, int nb_samples, ++ enum AVSampleFormat sample_fmt, int align); ++ ++/** ++ * @} ++ * ++ * @defgroup lavu_sampmanip Samples manipulation ++ * ++ * Functions that manipulate audio samples ++ * @{ ++ */ ++ ++/** ++ * Fill plane data pointers and linesize for samples with sample ++ * format sample_fmt. ++ * ++ * The audio_data array is filled with the pointers to the samples data planes: ++ * for planar, set the start point of each channel's data within the buffer, ++ * for packed, set the start point of the entire buffer only. ++ * ++ * The value pointed to by linesize is set to the aligned size of each ++ * channel's data buffer for planar layout, or to the aligned size of the ++ * buffer for all channels for packed layout. ++ * ++ * The buffer in buf must be big enough to contain all the samples ++ * (use av_samples_get_buffer_size() to compute its minimum size), ++ * otherwise the audio_data pointers will point to invalid data. ++ * ++ * @see enum AVSampleFormat ++ * The documentation for AVSampleFormat describes the data layout. ++ * ++ * @param[out] audio_data array to be filled with the pointer for each channel ++ * @param[out] linesize calculated linesize, may be NULL ++ * @param buf the pointer to a buffer containing the samples ++ * @param nb_channels the number of channels ++ * @param nb_samples the number of samples in a single channel ++ * @param sample_fmt the sample format ++ * @param align buffer size alignment (0 = default, 1 = no alignment) ++ * @return minimum size in bytes required for the buffer on ++ * success, or a negative error code on failure ++ */ ++int av_samples_fill_arrays(uint8_t** audio_data, int* linesize, ++ const uint8_t* buf, int nb_channels, int nb_samples, ++ enum AVSampleFormat sample_fmt, int align); ++ ++/** ++ * Allocate a samples buffer for nb_samples samples, and fill data pointers and ++ * linesize accordingly. ++ * The allocated samples buffer can be freed by using av_freep(&audio_data[0]) ++ * Allocated data will be initialized to silence. ++ * ++ * @see enum AVSampleFormat ++ * The documentation for AVSampleFormat describes the data layout. ++ * ++ * @param[out] audio_data array to be filled with the pointer for each channel ++ * @param[out] linesize aligned size for audio buffer(s), may be NULL ++ * @param nb_channels number of audio channels ++ * @param nb_samples number of samples per channel ++ * @param align buffer size alignment (0 = default, 1 = no alignment) ++ * @return >=0 on success or a negative error code on failure ++ * @todo return the size of the allocated buffer in case of success at the next ++ * bump ++ * @see av_samples_fill_arrays() ++ * @see av_samples_alloc_array_and_samples() ++ */ ++int av_samples_alloc(uint8_t** audio_data, int* linesize, int nb_channels, ++ int nb_samples, enum AVSampleFormat sample_fmt, int align); ++ ++/** ++ * Allocate a data pointers array, samples buffer for nb_samples ++ * samples, and fill data pointers and linesize accordingly. ++ * ++ * This is the same as av_samples_alloc(), but also allocates the data ++ * pointers array. ++ * ++ * @see av_samples_alloc() ++ */ ++int av_samples_alloc_array_and_samples(uint8_t*** audio_data, int* linesize, ++ int nb_channels, int nb_samples, ++ enum AVSampleFormat sample_fmt, ++ int align); ++ ++/** ++ * Copy samples from src to dst. ++ * ++ * @param dst destination array of pointers to data planes ++ * @param src source array of pointers to data planes ++ * @param dst_offset offset in samples at which the data will be written to dst ++ * @param src_offset offset in samples at which the data will be read from src ++ * @param nb_samples number of samples to be copied ++ * @param nb_channels number of audio channels ++ * @param sample_fmt audio sample format ++ */ ++int av_samples_copy(uint8_t** dst, uint8_t* const* src, int dst_offset, ++ int src_offset, int nb_samples, int nb_channels, ++ enum AVSampleFormat sample_fmt); ++ ++/** ++ * Fill an audio buffer with silence. ++ * ++ * @param audio_data array of pointers to data planes ++ * @param offset offset in samples at which to start filling ++ * @param nb_samples number of samples to fill ++ * @param nb_channels number of audio channels ++ * @param sample_fmt audio sample format ++ */ ++int av_samples_set_silence(uint8_t** audio_data, int offset, int nb_samples, ++ int nb_channels, enum AVSampleFormat sample_fmt); ++ ++/** ++ * @} ++ * @} ++ */ ++#endif /* AVUTIL_SAMPLEFMT_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/version.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/version.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/version.h +@@ -0,0 +1,118 @@ ++/* ++ * copyright (c) 2003 Fabrice Bellard ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++/** ++ * @file ++ * @ingroup lavu ++ * Libavutil version macros ++ */ ++ ++#ifndef AVUTIL_VERSION_H ++#define AVUTIL_VERSION_H ++ ++#include "macros.h" ++ ++/** ++ * @addtogroup version_utils ++ * ++ * Useful to check and match library version in order to maintain ++ * backward compatibility. ++ * ++ * The FFmpeg libraries follow a versioning sheme very similar to ++ * Semantic Versioning (http://semver.org/) ++ * The difference is that the component called PATCH is called MICRO in FFmpeg ++ * and its value is reset to 100 instead of 0 to keep it above or equal to 100. ++ * Also we do not increase MICRO for every bugfix or change in git master. ++ * ++ * Prior to FFmpeg 3.2 point releases did not change any lib version number to ++ * avoid aliassing different git master checkouts. ++ * Starting with FFmpeg 3.2, the released library versions will occupy ++ * a separate MAJOR.MINOR that is not used on the master development branch. ++ * That is if we branch a release of master 55.10.123 we will bump to 55.11.100 ++ * for the release and master will continue at 55.12.100 after it. Each new ++ * point release will then bump the MICRO improving the usefulness of the lib ++ * versions. ++ * ++ * @{ ++ */ ++ ++#define AV_VERSION_INT(a, b, c) ((a) << 16 | (b) << 8 | (c)) ++#define AV_VERSION_DOT(a, b, c) a##.##b##.##c ++#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c) ++ ++/** ++ * Extract version components from the full ::AV_VERSION_INT int as returned ++ * by functions like ::avformat_version() and ::avcodec_version() ++ */ ++#define AV_VERSION_MAJOR(a) ((a) >> 16) ++#define AV_VERSION_MINOR(a) (((a)&0x00FF00) >> 8) ++#define AV_VERSION_MICRO(a) ((a)&0xFF) ++ ++/** ++ * @} ++ */ ++ ++/** ++ * @defgroup lavu_ver Version and Build diagnostics ++ * ++ * Macros and function useful to check at compiletime and at runtime ++ * which version of libavutil is in use. ++ * ++ * @{ ++ */ ++ ++#define LIBAVUTIL_VERSION_MAJOR 57 ++#define LIBAVUTIL_VERSION_MINOR 17 ++#define LIBAVUTIL_VERSION_MICRO 100 ++ ++#define LIBAVUTIL_VERSION_INT \ ++ AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, LIBAVUTIL_VERSION_MINOR, \ ++ LIBAVUTIL_VERSION_MICRO) ++#define LIBAVUTIL_VERSION \ ++ AV_VERSION(LIBAVUTIL_VERSION_MAJOR, LIBAVUTIL_VERSION_MINOR, \ ++ LIBAVUTIL_VERSION_MICRO) ++#define LIBAVUTIL_BUILD LIBAVUTIL_VERSION_INT ++ ++#define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION) ++ ++/** ++ * @defgroup lavu_depr_guards Deprecation Guards ++ * FF_API_* defines may be placed below to indicate public API that will be ++ * dropped at a future version bump. The defines themselves are not part of ++ * the public API and may change, break or disappear at any time. ++ * ++ * @note, when bumping the major version it is recommended to manually ++ * disable each FF_API_* in its own commit instead of disabling them all ++ * at once through the bump. This improves the git bisect-ability of the change. ++ * ++ * @{ ++ */ ++ ++#define FF_API_D2STR (LIBAVUTIL_VERSION_MAJOR < 58) ++#define FF_API_DECLARE_ALIGNED (LIBAVUTIL_VERSION_MAJOR < 58) ++#define FF_API_COLORSPACE_NAME (LIBAVUTIL_VERSION_MAJOR < 58) ++#define FF_API_AV_MALLOCZ_ARRAY (LIBAVUTIL_VERSION_MAJOR < 58) ++ ++/** ++ * @} ++ * @} ++ */ ++ ++#endif /* AVUTIL_VERSION_H */ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/moz.build b/dom/media/platforms/ffmpeg/ffmpeg59/moz.build +new file mode 100644 +--- /dev/null ++++ b/dom/media/platforms/ffmpeg/ffmpeg59/moz.build +@@ -0,0 +1,36 @@ ++# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- ++# vim: set filetype=python: ++# This Source Code Form is subject to the terms of the Mozilla Public ++# License, v. 2.0. If a copy of the MPL was not distributed with this ++# file, You can obtain one at http://mozilla.org/MPL/2.0/. ++ ++UNIFIED_SOURCES += [ ++ '../FFmpegAudioDecoder.cpp', ++ '../FFmpegDataDecoder.cpp', ++ '../FFmpegDecoderModule.cpp', ++ '../FFmpegVideoDecoder.cpp', ++] ++LOCAL_INCLUDES += [ ++ '..', ++ '/media/mozva', ++ 'include', ++] ++ ++if CONFIG['CC_TYPE'] in ('clang', 'gcc'): ++ CXXFLAGS += [ '-Wno-deprecated-declarations' ] ++if CONFIG['CC_TYPE'] == 'clang': ++ CXXFLAGS += [ ++ '-Wno-unknown-attributes', ++ ] ++if CONFIG['CC_TYPE'] == 'gcc': ++ CXXFLAGS += [ ++ '-Wno-attributes', ++ ] ++if CONFIG['MOZ_WAYLAND']: ++ CXXFLAGS += CONFIG['MOZ_GTK3_CFLAGS'] ++ DEFINES['MOZ_WAYLAND_USE_VAAPI'] = 1 ++ USE_LIBS += ['mozva'] ++ ++include("/ipc/chromium/chromium-config.mozbuild") ++ ++FINAL_LIBRARY = 'xul' +diff --git a/dom/media/platforms/ffmpeg/moz.build b/dom/media/platforms/ffmpeg/moz.build +--- a/dom/media/platforms/ffmpeg/moz.build ++++ b/dom/media/platforms/ffmpeg/moz.build +@@ -14,6 +14,7 @@ + "libav55", + "ffmpeg57", + "ffmpeg58", ++ "ffmpeg59", + ] + + UNIFIED_SOURCES += [ + diff --git a/D139697.diff b/D139697.diff new file mode 100644 index 0000000..2b9dc32 --- /dev/null +++ b/D139697.diff @@ -0,0 +1,27 @@ +diff --git a/dom/media/platforms/ffmpeg/ffmpeg58/moz.build b/dom/media/platforms/ffmpeg/ffmpeg58/moz.build +--- a/dom/media/platforms/ffmpeg/ffmpeg58/moz.build ++++ b/dom/media/platforms/ffmpeg/ffmpeg58/moz.build +@@ -29,9 +29,6 @@ + if CONFIG['MOZ_WAYLAND']: + CXXFLAGS += CONFIG['MOZ_GTK3_CFLAGS'] + DEFINES['MOZ_WAYLAND_USE_VAAPI'] = 1 +- UNIFIED_SOURCES += [ +- '../FFmpegVideoFramePool.cpp', +- ] + USE_LIBS += ['mozva'] + + include("/ipc/chromium/chromium-config.mozbuild") +diff --git a/dom/media/platforms/ffmpeg/ffvpx/moz.build b/dom/media/platforms/ffmpeg/ffvpx/moz.build +--- a/dom/media/platforms/ffmpeg/ffvpx/moz.build ++++ b/dom/media/platforms/ffmpeg/ffvpx/moz.build +@@ -41,6 +41,9 @@ + CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"] + DEFINES["MOZ_WAYLAND_USE_VAAPI"] = 1 + USE_LIBS += ["mozva"] ++ UNIFIED_SOURCES += [ ++ "../FFmpegVideoFramePool.cpp", ++ ] + + include("/ipc/chromium/chromium-config.mozbuild") + + diff --git a/D139698.diff b/D139698.diff new file mode 100644 index 0000000..7bf7af9 --- /dev/null +++ b/D139698.diff @@ -0,0 +1,191 @@ +diff --git a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp +--- a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp ++++ b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp +@@ -64,14 +64,16 @@ + AV_FUNC_56 = 1 << 3, + AV_FUNC_57 = 1 << 4, + AV_FUNC_58 = 1 << 5, ++ AV_FUNC_59 = 1 << 6, + AV_FUNC_AVUTIL_53 = AV_FUNC_53 | AV_FUNC_AVUTIL_MASK, + AV_FUNC_AVUTIL_54 = AV_FUNC_54 | AV_FUNC_AVUTIL_MASK, + AV_FUNC_AVUTIL_55 = AV_FUNC_55 | AV_FUNC_AVUTIL_MASK, + AV_FUNC_AVUTIL_56 = AV_FUNC_56 | AV_FUNC_AVUTIL_MASK, + AV_FUNC_AVUTIL_57 = AV_FUNC_57 | AV_FUNC_AVUTIL_MASK, + AV_FUNC_AVUTIL_58 = AV_FUNC_58 | AV_FUNC_AVUTIL_MASK, ++ AV_FUNC_AVUTIL_59 = AV_FUNC_59 | AV_FUNC_AVUTIL_MASK, + AV_FUNC_AVCODEC_ALL = AV_FUNC_53 | AV_FUNC_54 | AV_FUNC_55 | AV_FUNC_56 | +- AV_FUNC_57 | AV_FUNC_58, ++ AV_FUNC_57 | AV_FUNC_58 | AV_FUNC_59, + AV_FUNC_AVUTIL_ALL = AV_FUNC_AVCODEC_ALL | AV_FUNC_AVUTIL_MASK + }; + +@@ -94,6 +96,9 @@ + case 58: + version = AV_FUNC_58; + break; ++ case 59: ++ version = AV_FUNC_59; ++ break; + default: + FFMPEG_LOG("Unknown avcodec version"); + Unlink(); +@@ -128,15 +133,19 @@ + : LinkResult::MissingLibAVFunction; \ + } + +- AV_FUNC(av_lockmgr_register, AV_FUNC_AVCODEC_ALL) ++ AV_FUNC(av_lockmgr_register, AV_FUNC_53 | AV_FUNC_54 | AV_FUNC_55 | ++ AV_FUNC_56 | AV_FUNC_57 | AV_FUNC_58) + AV_FUNC(avcodec_alloc_context3, AV_FUNC_AVCODEC_ALL) + AV_FUNC(avcodec_close, AV_FUNC_AVCODEC_ALL) +- AV_FUNC(avcodec_decode_audio4, AV_FUNC_AVCODEC_ALL) +- AV_FUNC(avcodec_decode_video2, AV_FUNC_AVCODEC_ALL) ++ AV_FUNC(avcodec_decode_audio4, AV_FUNC_53 | AV_FUNC_54 | AV_FUNC_55 | ++ AV_FUNC_56 | AV_FUNC_57 | AV_FUNC_58) ++ AV_FUNC(avcodec_decode_video2, AV_FUNC_53 | AV_FUNC_54 | AV_FUNC_55 | ++ AV_FUNC_56 | AV_FUNC_57 | AV_FUNC_58) + AV_FUNC(avcodec_find_decoder, AV_FUNC_AVCODEC_ALL) + AV_FUNC(avcodec_flush_buffers, AV_FUNC_AVCODEC_ALL) + AV_FUNC(avcodec_open2, AV_FUNC_AVCODEC_ALL) +- AV_FUNC(avcodec_register_all, AV_FUNC_AVCODEC_ALL) ++ AV_FUNC(avcodec_register_all, AV_FUNC_53 | AV_FUNC_54 | AV_FUNC_55 | ++ AV_FUNC_56 | AV_FUNC_57 | AV_FUNC_58) + AV_FUNC(av_init_packet, AV_FUNC_AVCODEC_ALL) + AV_FUNC(av_parser_init, AV_FUNC_AVCODEC_ALL) + AV_FUNC(av_parser_close, AV_FUNC_AVCODEC_ALL) +@@ -145,49 +154,56 @@ + AV_FUNC(avcodec_alloc_frame, (AV_FUNC_53 | AV_FUNC_54)) + AV_FUNC(avcodec_get_frame_defaults, (AV_FUNC_53 | AV_FUNC_54)) + AV_FUNC(avcodec_free_frame, AV_FUNC_54) +- AV_FUNC(avcodec_send_packet, AV_FUNC_58) +- AV_FUNC(avcodec_receive_frame, AV_FUNC_58) ++ AV_FUNC(avcodec_send_packet, AV_FUNC_58 | AV_FUNC_59) ++ AV_FUNC(avcodec_receive_frame, AV_FUNC_58 | AV_FUNC_59) + AV_FUNC(avcodec_default_get_buffer2, +- (AV_FUNC_55 | AV_FUNC_56 | AV_FUNC_57 | AV_FUNC_58)) ++ (AV_FUNC_55 | AV_FUNC_56 | AV_FUNC_57 | AV_FUNC_58 | AV_FUNC_59)) + AV_FUNC_OPTION(av_rdft_init, AV_FUNC_AVCODEC_ALL) + AV_FUNC_OPTION(av_rdft_calc, AV_FUNC_AVCODEC_ALL) + AV_FUNC_OPTION(av_rdft_end, AV_FUNC_AVCODEC_ALL) + AV_FUNC(av_log_set_level, AV_FUNC_AVUTIL_ALL) + AV_FUNC(av_malloc, AV_FUNC_AVUTIL_ALL) + AV_FUNC(av_freep, AV_FUNC_AVUTIL_ALL) +- AV_FUNC(av_frame_alloc, (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 | +- AV_FUNC_AVUTIL_57 | AV_FUNC_AVUTIL_58)) +- AV_FUNC(av_frame_free, (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 | +- AV_FUNC_AVUTIL_57 | AV_FUNC_AVUTIL_58)) +- AV_FUNC(av_frame_unref, (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 | +- AV_FUNC_AVUTIL_57 | AV_FUNC_AVUTIL_58)) ++ AV_FUNC(av_frame_alloc, ++ (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 | AV_FUNC_AVUTIL_57 | ++ AV_FUNC_AVUTIL_58 | AV_FUNC_AVUTIL_59)) ++ AV_FUNC(av_frame_free, ++ (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 | AV_FUNC_AVUTIL_57 | ++ AV_FUNC_AVUTIL_58 | AV_FUNC_AVUTIL_59)) ++ AV_FUNC(av_frame_unref, ++ (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 | AV_FUNC_AVUTIL_57 | ++ AV_FUNC_AVUTIL_58 | AV_FUNC_AVUTIL_59)) + AV_FUNC(av_image_check_size, AV_FUNC_AVUTIL_ALL) + AV_FUNC(av_image_get_buffer_size, AV_FUNC_AVUTIL_ALL) +- AV_FUNC_OPTION(av_buffer_get_opaque, +- (AV_FUNC_AVUTIL_56 | AV_FUNC_AVUTIL_57 | AV_FUNC_AVUTIL_58)) +- AV_FUNC(av_buffer_create, (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 | +- AV_FUNC_AVUTIL_57 | AV_FUNC_AVUTIL_58)) ++ AV_FUNC_OPTION(av_buffer_get_opaque, (AV_FUNC_AVUTIL_56 | AV_FUNC_AVUTIL_57 | ++ AV_FUNC_AVUTIL_58 | AV_FUNC_AVUTIL_59)) ++ AV_FUNC(av_buffer_create, ++ (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 | AV_FUNC_AVUTIL_57 | ++ AV_FUNC_AVUTIL_58 | AV_FUNC_AVUTIL_59)) + AV_FUNC_OPTION(av_frame_get_colorspace, AV_FUNC_AVUTIL_ALL) + AV_FUNC_OPTION(av_frame_get_color_range, AV_FUNC_AVUTIL_ALL) + + #ifdef MOZ_WAYLAND +- AV_FUNC_OPTION_SILENT(avcodec_get_hw_config, AV_FUNC_58) +- AV_FUNC_OPTION_SILENT(av_codec_iterate, AV_FUNC_58) +- AV_FUNC_OPTION_SILENT(av_codec_is_decoder, AV_FUNC_58) +- AV_FUNC_OPTION_SILENT(av_hwdevice_ctx_init, AV_FUNC_58) +- AV_FUNC_OPTION_SILENT(av_hwdevice_ctx_alloc, AV_FUNC_58) +- AV_FUNC_OPTION_SILENT(av_hwdevice_hwconfig_alloc, AV_FUNC_58) +- AV_FUNC_OPTION_SILENT(av_hwdevice_get_hwframe_constraints, AV_FUNC_58) +- AV_FUNC_OPTION_SILENT(av_hwframe_constraints_free, AV_FUNC_58) +- AV_FUNC_OPTION_SILENT(av_buffer_ref, AV_FUNC_AVUTIL_58) +- AV_FUNC_OPTION_SILENT(av_buffer_unref, AV_FUNC_AVUTIL_58) +- AV_FUNC_OPTION_SILENT(av_hwframe_transfer_get_formats, AV_FUNC_58) +- AV_FUNC_OPTION_SILENT(av_hwdevice_ctx_create_derived, AV_FUNC_58) +- AV_FUNC_OPTION_SILENT(av_hwframe_ctx_alloc, AV_FUNC_58) +- AV_FUNC_OPTION_SILENT(av_dict_set, AV_FUNC_58) +- AV_FUNC_OPTION_SILENT(av_dict_free, AV_FUNC_58) +- AV_FUNC_OPTION_SILENT(avcodec_get_name, AV_FUNC_58) +- AV_FUNC_OPTION_SILENT(av_get_pix_fmt_string, AV_FUNC_AVUTIL_58) ++ AV_FUNC_OPTION_SILENT(avcodec_get_hw_config, AV_FUNC_58 | AV_FUNC_59) ++ AV_FUNC_OPTION_SILENT(av_codec_iterate, AV_FUNC_58 | AV_FUNC_59) ++ AV_FUNC_OPTION_SILENT(av_codec_is_decoder, AV_FUNC_58 | AV_FUNC_59) ++ AV_FUNC_OPTION_SILENT(av_hwdevice_ctx_init, AV_FUNC_58 | AV_FUNC_59) ++ AV_FUNC_OPTION_SILENT(av_hwdevice_ctx_alloc, AV_FUNC_58 | AV_FUNC_59) ++ AV_FUNC_OPTION_SILENT(av_hwdevice_hwconfig_alloc, AV_FUNC_58 | AV_FUNC_59) ++ AV_FUNC_OPTION_SILENT(av_hwdevice_get_hwframe_constraints, ++ AV_FUNC_58 | AV_FUNC_59) ++ AV_FUNC_OPTION_SILENT(av_hwframe_constraints_free, AV_FUNC_58 | AV_FUNC_59) ++ AV_FUNC_OPTION_SILENT(av_buffer_ref, AV_FUNC_AVUTIL_58 | AV_FUNC_59) ++ AV_FUNC_OPTION_SILENT(av_buffer_unref, AV_FUNC_AVUTIL_58 | AV_FUNC_59) ++ AV_FUNC_OPTION_SILENT(av_hwframe_transfer_get_formats, ++ AV_FUNC_58 | AV_FUNC_59) ++ AV_FUNC_OPTION_SILENT(av_hwdevice_ctx_create_derived, AV_FUNC_58 | AV_FUNC_59) ++ AV_FUNC_OPTION_SILENT(av_hwframe_ctx_alloc, AV_FUNC_58 | AV_FUNC_59) ++ AV_FUNC_OPTION_SILENT(av_dict_set, AV_FUNC_58 | AV_FUNC_59) ++ AV_FUNC_OPTION_SILENT(av_dict_free, AV_FUNC_58 | AV_FUNC_59) ++ AV_FUNC_OPTION_SILENT(avcodec_get_name, AV_FUNC_58 | AV_FUNC_59) ++ AV_FUNC_OPTION_SILENT(av_get_pix_fmt_string, ++ AV_FUNC_AVUTIL_58 | AV_FUNC_AVUTIL_59) + #endif + #undef AV_FUNC + #undef AV_FUNC_OPTION +@@ -219,7 +235,9 @@ + # undef VAD_FUNC_OPTION_SILENT + #endif + +- avcodec_register_all(); ++ if (avcodec_register_all) { ++ avcodec_register_all(); ++ } + if (MOZ_LOG_TEST(sPDMLog, LogLevel::Debug)) { + av_log_set_level(AV_LOG_DEBUG); + } else if (MOZ_LOG_TEST(sPDMLog, LogLevel::Info)) { +diff --git a/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp b/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp +--- a/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp ++++ b/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp +@@ -27,6 +27,7 @@ + static const char* sLibs[] = { + // clang-format off + #if defined(XP_DARWIN) ++ "libavcodec.59.dylib", + "libavcodec.58.dylib", + "libavcodec.57.dylib", + "libavcodec.56.dylib", +@@ -34,6 +35,7 @@ + "libavcodec.54.dylib", + "libavcodec.53.dylib", + #else ++ "libavcodec.so.59", + "libavcodec.so.58", + "libavcodec-ffmpeg.so.58", + "libavcodec-ffmpeg.so.57", +@@ -76,7 +78,6 @@ + sLinkStatusLibraryName = lib; + return true; + case FFmpegLibWrapper::LinkResult::NoProvidedLib: +- MOZ_ASSERT_UNREACHABLE("Incorrectly-setup sLibAV"); + break; + case FFmpegLibWrapper::LinkResult::NoAVCodecVersion: + if (sLinkStatus > LinkStatus_INVALID_CANDIDATE) { +@@ -152,6 +153,9 @@ + case 58: + module = FFmpegDecoderModule<58>::Create(&sLibAV); + break; ++ case 59: ++ module = FFmpegDecoderModule<59>::Create(&sLibAV); ++ break; + default: + module = nullptr; + } + diff --git a/D139699.diff b/D139699.diff new file mode 100644 index 0000000..a4be4c5 --- /dev/null +++ b/D139699.diff @@ -0,0 +1,127 @@ +diff --git a/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.cpp +--- a/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.cpp ++++ b/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.cpp +@@ -206,15 +206,49 @@ + media::TimeUnit pts = aSample->mTime; + + while (packet.size > 0) { +- int decoded; +- int bytesConsumed = ++ int decoded = false; ++ int bytesConsumed = -1; ++#if LIBAVCODEC_VERSION_MAJOR < 59 ++ bytesConsumed = + mLib->avcodec_decode_audio4(mCodecContext, mFrame, &decoded, &packet); +- + if (bytesConsumed < 0) { + NS_WARNING("FFmpeg audio decoder error."); + return MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, + RESULT_DETAIL("FFmpeg audio error:%d", bytesConsumed)); + } ++#else ++# define AVERROR_OK 0 ++ ++ int ret = mLib->avcodec_receive_frame(mCodecContext, mFrame); ++ switch (ret) { ++ case AVERROR_OK: ++ decoded = true; ++ break; ++ case AVERROR(EAGAIN): ++ break; ++ case int(AVERROR_EOF): { ++ FFMPEG_LOG(" End of stream."); ++ return MediaResult(NS_ERROR_DOM_MEDIA_END_OF_STREAM, ++ RESULT_DETAIL("End of stream")); ++ } ++ } ++ ret = mLib->avcodec_send_packet(mCodecContext, &packet); ++ switch (ret) { ++ case AVERROR_OK: ++ bytesConsumed = packet.size; ++ break; ++ case AVERROR(EAGAIN): ++ break; ++ case int(AVERROR_EOF): ++ FFMPEG_LOG(" End of stream."); ++ return MediaResult(NS_ERROR_DOM_MEDIA_END_OF_STREAM, ++ RESULT_DETAIL("End of stream")); ++ default: ++ NS_WARNING("FFmpeg audio decoder error."); ++ return MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, ++ RESULT_DETAIL("FFmpeg audio error")); ++ } ++#endif + + if (decoded) { + if (mFrame->format != AV_SAMPLE_FMT_FLT && +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 +@@ -39,6 +39,9 @@ + # define AV_PIX_FMT_YUV444P10LE PIX_FMT_YUV444P10LE + # define AV_PIX_FMT_NONE PIX_FMT_NONE + #endif ++#if LIBAVCODEC_VERSION_MAJOR > 58 ++# define AV_PIX_FMT_VAAPI_VLD AV_PIX_FMT_VAAPI ++#endif + #include "mozilla/PodOperations.h" + #include "mozilla/StaticPrefs_media.h" + #include "mozilla/TaskQueue.h" +@@ -766,6 +769,14 @@ + } + #endif + ++static int64_t GetFramePts(AVFrame* aFrame) { ++#if LIBAVCODEC_VERSION_MAJOR > 58 ++ return aFrame->pts; ++#else ++ return aFrame->pkt_pts; ++#endif ++} ++ + MediaResult FFmpegVideoDecoder::DoDecode( + MediaRawData* aSample, uint8_t* aData, int aSize, bool* aGotFrame, + MediaDataDecoder::DecodedData& aResults) { +@@ -831,7 +842,7 @@ + MediaResult rv; + # ifdef MOZ_WAYLAND_USE_VAAPI + if (IsHardwareAccelerated()) { +- rv = CreateImageVAAPI(mFrame->pkt_pos, mFrame->pkt_pts, ++ rv = CreateImageVAAPI(mFrame->pkt_pos, GetFramePts(mFrame), + mFrame->pkt_duration, aResults); + // If VA-API playback failed, just quit. Decoder is going to be restarted + // without VA-API. +@@ -844,8 +855,8 @@ + } else + # endif + { +- rv = CreateImage(mFrame->pkt_pos, mFrame->pkt_pts, mFrame->pkt_duration, +- aResults); ++ rv = CreateImage(mFrame->pkt_pos, GetFramePts(mFrame), ++ mFrame->pkt_duration, aResults); + } + if (NS_FAILED(rv)) { + return rv; +@@ -879,9 +890,9 @@ + "DoDecodeFrame:decode_video: rv=%d decoded=%d " + "(Input: pts(%" PRId64 ") dts(%" PRId64 ") Output: pts(%" PRId64 + ") " +- "opaque(%" PRId64 ") pkt_pts(%" PRId64 ") pkt_dts(%" PRId64 "))", ++ "opaque(%" PRId64 ") pts(%" PRId64 ") pkt_dts(%" PRId64 "))", + bytesConsumed, decoded, packet.pts, packet.dts, mFrame->pts, +- mFrame->reordered_opaque, mFrame->pkt_pts, mFrame->pkt_dts); ++ mFrame->reordered_opaque, mFrame->pts, mFrame->pkt_dts); + + if (bytesConsumed < 0) { + return MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, +@@ -896,7 +907,8 @@ + } + + // If we've decoded a frame then we need to output it +- int64_t pts = mPtsContext.GuessCorrectPts(mFrame->pkt_pts, mFrame->pkt_dts); ++ int64_t pts = ++ mPtsContext.GuessCorrectPts(GetFramePts(mFrame), mFrame->pkt_dts); + // Retrieve duration from dts. + // We use the first entry found matching this dts (this is done to + // handle damaged file with multiple frames with the same dts) + diff --git a/firefox.spec b/firefox.spec index 4720289..7c54108 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1074,6 +1074,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : * Wed Mar 2 2022 Martin Stransky - 98.0-2 - Added support for ffmpeg 5.0 - Spec tweaks +- Updated to Build 2 * Tue Mar 1 2022 Martin Stransky - 98.0-1 - Updated to 98.0 diff --git a/sources b/sources index 3b484cc..ef2b8c9 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = b9ab1498be90ecf60822df7021f8812f124550d97f8cd687c69d3ab56fc5fb714bfe88c78c978a1794d211724909a9a5cad6a4b483fa05f762909c45d5075520 SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (firefox-98.0.source.tar.xz) = e4728316d919cad2c7b9bfc08cd6fa651c0706e14dba1629382ef1e8d723ebf22c6a892f23928ee05d98b9eadfa1c3e3fd803077c64919786c176c5e8d87863a -SHA512 (firefox-langpacks-98.0-20220301.tar.xz) = 54cc19003903da31bdc485eaf208e35759a390c71bb96a10757cbe10fbc65a1524a8d33c071589ee3f949508df66ced7115c0e4203e17bd672672fe303b4a5ee +SHA512 (firefox-98.0.source.tar.xz) = 119005c92b579897c4a9c5b2b9f88ab1e77ad41d05fc8058d3378865f8538870789e5a9bd1066bcbe1662bde1501d9fe8c97c277e2985506f6d5586b6cea4ff2 +SHA512 (firefox-langpacks-98.0-20220304.tar.xz) = d736ebdf11848b812073e342906aae86368cf2aa248ad34af98c11bb47cec6820ed805d9ffac81d195dba9e93a348ece50cc54740b4750b7ff32392cdcac028a From b9596148e42fec01e7dcd8177e2f3a206134bb08 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 4 Mar 2022 12:11:14 +0100 Subject: [PATCH 024/545] Added fix for gcc12 build errors --- 0001-GLIBCXX-fix-for-GCC-12.patch | 44 +++++++++++++++++++++++++++++++ firefox.spec | 2 ++ 2 files changed, 46 insertions(+) create mode 100644 0001-GLIBCXX-fix-for-GCC-12.patch diff --git a/0001-GLIBCXX-fix-for-GCC-12.patch b/0001-GLIBCXX-fix-for-GCC-12.patch new file mode 100644 index 0000000..37d6f50 --- /dev/null +++ b/0001-GLIBCXX-fix-for-GCC-12.patch @@ -0,0 +1,44 @@ +From efd5bc0715e5477318be95a76811cda0a89e8289 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= +Date: Fri, 4 Mar 2022 12:00:26 +0100 +Subject: [PATCH] GLIBCXX fix for GCC 12? + +--- + build/unix/stdc++compat/stdc++compat.cpp | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/build/unix/stdc++compat/stdc++compat.cpp b/build/unix/stdc++compat/stdc++compat.cpp +index 0180f6bcfa998..8d7a542ff11f0 100644 +--- a/build/unix/stdc++compat/stdc++compat.cpp ++++ b/build/unix/stdc++compat/stdc++compat.cpp +@@ -24,6 +24,7 @@ + GLIBCXX_3.4.27 is from gcc 10 + GLIBCXX_3.4.28 is from gcc 10 + GLIBCXX_3.4.29 is from gcc 11 ++ GLIBCXX_3.4.30 is from gcc 12 + + This file adds the necessary compatibility tricks to avoid symbols with + version GLIBCXX_3.4.20 and bigger, keeping binary compatibility with +@@ -69,6 +70,19 @@ void __attribute__((weak)) __throw_bad_array_new_length() { MOZ_CRASH(); } + } // namespace std + #endif + ++#if _GLIBCXX_RELEASE >= 12 ++namespace std { ++ ++/* This avoids the GLIBCXX_3.4.30 symbol version. */ ++void __attribute__((weak)) ++__glibcxx_assert_fail(const char* __file, int __line, const char* __function, ++ const char* __condition) { ++ MOZ_CRASH(); ++} ++ ++} // namespace std ++#endif ++ + /* While we generally don't build with exceptions, we have some host tools + * that do use them. libstdc++ from GCC 5.0 added exception constructors with + * char const* argument. Older versions only have a constructor with +-- +2.35.1 + diff --git a/firefox.spec b/firefox.spec index 7c54108..7ef1065 100644 --- a/firefox.spec +++ b/firefox.spec @@ -224,6 +224,7 @@ Patch66: D139078.diff Patch67: D139088.diff Patch68: D139703.diff Patch69: D139704.diff +Patch70: 0001-GLIBCXX-fix-for-GCC-12.patch # Test patches # Generate without context by @@ -477,6 +478,7 @@ This package contains results of tests executed during build. %patch67 -p1 -b .D139088 %patch68 -p1 -b .D139703 %patch69 -p1 -b .D139704 +%patch70 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell From bd5a45a42f3754b61e6b7b39157b8d5583893bdd Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 4 Mar 2022 12:38:37 +0100 Subject: [PATCH 025/545] spec fixes --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 7ef1065..7d94341 100644 --- a/firefox.spec +++ b/firefox.spec @@ -168,7 +168,7 @@ URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220301.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220304.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig From 70d0fd995c6bc1b8be583467ebe795bc67c0d992 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Sat, 5 Mar 2022 08:51:40 +0100 Subject: [PATCH 026/545] ppc64le temp build fix --- firefox.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/firefox.spec b/firefox.spec index 7d94341..156c30e 100644 --- a/firefox.spec +++ b/firefox.spec @@ -503,10 +503,12 @@ This package contains results of tests executed during build. %patch415 -p1 -b .1670333 # ffmpeg50 +%ifnarch ppc64le %patch500 -p1 -b .D139696 %patch501 -p1 -b .D139697 %patch502 -p1 -b .D139698 %patch503 -p1 -b .D139699 +%endif # PGO patches %if %{build_with_pgo} From a3c8768d1fde2661c5e8bbb37da8412e33d249de Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Sat, 5 Mar 2022 09:04:16 +0100 Subject: [PATCH 027/545] Updated to Build 3 --- .gitignore | 1 + firefox.spec | 4 ++-- sources | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 507a98a..4366d6c 100644 --- a/.gitignore +++ b/.gitignore @@ -498,3 +498,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-98.0.source.tar.xz /firefox-langpacks-98.0-20220301.tar.xz /firefox-langpacks-98.0-20220304.tar.xz +/firefox-langpacks-98.0-20220305.tar.xz diff --git a/firefox.spec b/firefox.spec index 156c30e..cacc4dc 100644 --- a/firefox.spec +++ b/firefox.spec @@ -168,7 +168,7 @@ URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220304.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220305.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1078,7 +1078,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : * Wed Mar 2 2022 Martin Stransky - 98.0-2 - Added support for ffmpeg 5.0 - Spec tweaks -- Updated to Build 2 +- Updated to Build 3 * Tue Mar 1 2022 Martin Stransky - 98.0-1 - Updated to 98.0 diff --git a/sources b/sources index ef2b8c9..b1e82e0 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = b9ab1498be90ecf60822df7021f8812f124550d97f8cd687c69d3ab56fc5fb714bfe88c78c978a1794d211724909a9a5cad6a4b483fa05f762909c45d5075520 SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (firefox-98.0.source.tar.xz) = 119005c92b579897c4a9c5b2b9f88ab1e77ad41d05fc8058d3378865f8538870789e5a9bd1066bcbe1662bde1501d9fe8c97c277e2985506f6d5586b6cea4ff2 -SHA512 (firefox-langpacks-98.0-20220304.tar.xz) = d736ebdf11848b812073e342906aae86368cf2aa248ad34af98c11bb47cec6820ed805d9ffac81d195dba9e93a348ece50cc54740b4750b7ff32392cdcac028a +SHA512 (firefox-langpacks-98.0-20220305.tar.xz) = b25aa9d4aadf4e7b2d03faa6d33ff7fac61d3f62e3308204e929789c2a19006fcfa589f9cc90c308298d59d8a6419f3d44b3720f5de3d13efbc3f6acdf5219b3 +SHA512 (firefox-98.0.source.tar.xz) = 5b9186dd2a5dee5f2d2a2ce156fc06e2073cf71a70891a294cf3358218592f19ec3413d33b68d6f38e3cc5f940213e590a188e2b6efc39f416e90a55f89bfd9b From 97fc0b9c63f0ddffa59c395a0f175666ae5029cc Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 16 Mar 2022 10:36:47 +0100 Subject: [PATCH 028/545] Added a workaround for rhbz#2063961 --- 0001-GLIBCXX-fix-for-GCC-12.patch | 44 - crossbeam-downgrade-rhbz2063961.patch | 5110 +++++++++++++++++++++++++ firefox.spec | 11 +- 3 files changed, 5118 insertions(+), 47 deletions(-) delete mode 100644 0001-GLIBCXX-fix-for-GCC-12.patch create mode 100644 crossbeam-downgrade-rhbz2063961.patch diff --git a/0001-GLIBCXX-fix-for-GCC-12.patch b/0001-GLIBCXX-fix-for-GCC-12.patch deleted file mode 100644 index 37d6f50..0000000 --- a/0001-GLIBCXX-fix-for-GCC-12.patch +++ /dev/null @@ -1,44 +0,0 @@ -From efd5bc0715e5477318be95a76811cda0a89e8289 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= -Date: Fri, 4 Mar 2022 12:00:26 +0100 -Subject: [PATCH] GLIBCXX fix for GCC 12? - ---- - build/unix/stdc++compat/stdc++compat.cpp | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -diff --git a/build/unix/stdc++compat/stdc++compat.cpp b/build/unix/stdc++compat/stdc++compat.cpp -index 0180f6bcfa998..8d7a542ff11f0 100644 ---- a/build/unix/stdc++compat/stdc++compat.cpp -+++ b/build/unix/stdc++compat/stdc++compat.cpp -@@ -24,6 +24,7 @@ - GLIBCXX_3.4.27 is from gcc 10 - GLIBCXX_3.4.28 is from gcc 10 - GLIBCXX_3.4.29 is from gcc 11 -+ GLIBCXX_3.4.30 is from gcc 12 - - This file adds the necessary compatibility tricks to avoid symbols with - version GLIBCXX_3.4.20 and bigger, keeping binary compatibility with -@@ -69,6 +70,19 @@ void __attribute__((weak)) __throw_bad_array_new_length() { MOZ_CRASH(); } - } // namespace std - #endif - -+#if _GLIBCXX_RELEASE >= 12 -+namespace std { -+ -+/* This avoids the GLIBCXX_3.4.30 symbol version. */ -+void __attribute__((weak)) -+__glibcxx_assert_fail(const char* __file, int __line, const char* __function, -+ const char* __condition) { -+ MOZ_CRASH(); -+} -+ -+} // namespace std -+#endif -+ - /* While we generally don't build with exceptions, we have some host tools - * that do use them. libstdc++ from GCC 5.0 added exception constructors with - * char const* argument. Older versions only have a constructor with --- -2.35.1 - diff --git a/crossbeam-downgrade-rhbz2063961.patch b/crossbeam-downgrade-rhbz2063961.patch new file mode 100644 index 0000000..428c3ec --- /dev/null +++ b/crossbeam-downgrade-rhbz2063961.patch @@ -0,0 +1,5110 @@ +diff -up firefox-98.0/Cargo.lock.crossbeam-downgrade-rhbz2063961 firefox-98.0/Cargo.lock +--- firefox-98.0/Cargo.lock.crossbeam-downgrade-rhbz2063961 2022-03-05 01:15:33.000000000 +0100 ++++ firefox-98.0/Cargo.lock 2022-03-16 09:35:09.020396771 +0100 +@@ -65,9 +65,9 @@ dependencies = [ + + [[package]] + name = "anyhow" +-version = "1.0.52" ++version = "1.0.51" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "84450d0b4a8bd1ba4144ce8ce718fbc5d071358b1e5384bace6536b3d1f2d5b3" ++checksum = "8b26702f315f53b6071259e15dd9d64528213b44d61de1ec926eca7715d62203" + + [[package]] + name = "app_services_logger" +@@ -148,9 +148,9 @@ source = "git+https://github.com/smol-rs + + [[package]] + name = "async-trait" +-version = "0.1.52" ++version = "0.1.51" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3" ++checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e" + dependencies = [ + "proc-macro2", + "quote", +@@ -443,9 +443,9 @@ dependencies = [ + + [[package]] + name = "bitreader" +-version = "0.3.5" ++version = "0.3.4" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "bd5bf8a17cdc06d475689f9e9226f4b5bf5610e93cf5c3010a518fe6fb0d97f5" ++checksum = "9178181a7d44239c6c8eaafa8688558a2ab5fa04b8855381f2681e9591fb941b" + dependencies = [ + "cfg-if 1.0.0", + ] +@@ -482,7 +482,7 @@ version = "0.1.0" + dependencies = [ + "bits_client", + "comedy", +- "crossbeam-utils 0.8.6", ++ "crossbeam-utils 0.8.5", + "libc", + "log", + "moz_task", +@@ -493,9 +493,9 @@ dependencies = [ + + [[package]] + name = "blake2b_simd" +-version = "0.5.11" ++version = "0.5.9" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" ++checksum = "b83b7baab1e671718d78204225800d6b170e648188ac7dc992e9d6bddf87d0c0" + dependencies = [ + "arrayref", + "arrayvec 0.5.2", +@@ -553,16 +553,16 @@ version = "0.1.2" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "b8e3ff9db740167616e528c509b3618046fc05d337f8f3182d300f4aa977d2bb" + dependencies = [ +- "crossbeam-utils 0.8.6", ++ "crossbeam-utils 0.8.5", + "jobserver", + "num_cpus", + ] + + [[package]] + name = "bumpalo" +-version = "3.9.1" ++version = "3.8.0" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" ++checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" + + [[package]] + name = "byte-tools" +@@ -600,9 +600,9 @@ checksum = "c4872d67bab6358e59559027aa3b + + [[package]] + name = "cache-padded" +-version = "1.2.0" ++version = "1.1.1" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" ++checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" + + [[package]] + name = "cascade_bloom_filter" +@@ -628,7 +628,7 @@ version = "0.0.1" + dependencies = [ + "base64 0.10.1", + "byteorder", +- "crossbeam-utils 0.8.6", ++ "crossbeam-utils 0.8.5", + "cstr", + "log", + "malloc_size_of_derive", +@@ -977,12 +977,12 @@ dependencies = [ + + [[package]] + name = "crossbeam-channel" +-version = "0.5.2" ++version = "0.5.1" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" ++checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" + dependencies = [ + "cfg-if 1.0.0", +- "crossbeam-utils 0.8.6", ++ "crossbeam-utils 0.8.5", + ] + + [[package]] +@@ -1003,8 +1003,8 @@ source = "registry+https://github.com/ru + checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" + dependencies = [ + "cfg-if 1.0.0", +- "crossbeam-epoch 0.9.6", +- "crossbeam-utils 0.8.6", ++ "crossbeam-epoch 0.9.5", ++ "crossbeam-utils 0.8.5", + ] + + [[package]] +@@ -1024,12 +1024,12 @@ dependencies = [ + + [[package]] + name = "crossbeam-epoch" +-version = "0.9.6" ++version = "0.9.5" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "97242a70df9b89a65d0b6df3c4bf5b9ce03c5b7309019777fbde37e7537f8762" ++checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" + dependencies = [ + "cfg-if 1.0.0", +- "crossbeam-utils 0.8.6", ++ "crossbeam-utils 0.8.5", + "lazy_static", + "memoffset 0.6.5", + "scopeguard", +@@ -1067,9 +1067,9 @@ dependencies = [ + + [[package]] + name = "crossbeam-utils" +-version = "0.8.6" ++version = "0.8.5" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" ++checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" + dependencies = [ + "cfg-if 1.0.0", + "lazy_static", +@@ -2728,7 +2728,7 @@ name = "kvstore" + version = "0.1.0" + dependencies = [ + "atomic_refcell", +- "crossbeam-utils 0.8.6", ++ "crossbeam-utils 0.8.5", + "cstr", + "lazy_static", + "libc", +@@ -4216,7 +4216,7 @@ checksum = "d78120e2c850279833f1dd3582f7 + dependencies = [ + "crossbeam-channel", + "crossbeam-deque 0.8.1", +- "crossbeam-utils 0.8.6", ++ "crossbeam-utils 0.8.5", + "lazy_static", + "num_cpus", + ] +@@ -4400,7 +4400,7 @@ dependencies = [ + "base64 0.13.0", + "blake2b_simd", + "constant_time_eq", +- "crossbeam-utils 0.8.6", ++ "crossbeam-utils 0.8.5", + ] + + [[package]] +@@ -6020,7 +6020,7 @@ dependencies = [ + name = "xulstore" + version = "0.1.0" + dependencies = [ +- "crossbeam-utils 0.8.6", ++ "crossbeam-utils 0.8.5", + "cstr", + "libc", + "log", +diff -up firefox-98.0/third_party/rust/anyhow/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/anyhow/.cargo-checksum.json +--- firefox-98.0/third_party/rust/anyhow/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:40.000000000 +0100 ++++ firefox-98.0/third_party/rust/anyhow/.cargo-checksum.json 2022-03-16 09:33:31.989159760 +0100 +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"ce2fb7f23073f4f0bd58bae44baab86fa6c3d3595f32d28b410ec52394b3f64c","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"f6bffe3676b128afe14aaf91c972d69c37f2e5afe4e02b99a974f7b7393f4cda","build.rs":"b6ee548cb30aba0a4a7ff92379478fcf94ef246b892da8e2134ee2d9575bf08c","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/backtrace.rs":"5a60bd1fe1717c044c7ab34c062ce6651c0cb08596a5878e391c2755ecac07f9","src/chain.rs":"6edefc5f3c7d69683095862e54e3bb56faba5b3387bf2eeaed429da090007a0a","src/context.rs":"559478ae785ce913523aa21358cc1561ef4b0b95c5c87675a77890364c0162fe","src/ensure.rs":"98b2f4a7923e06cf6558b0a15f39a7c7ff3d36711e217475c6a93690cd58b7a1","src/error.rs":"33a0f6c49d2c5d08b8d027aa930be75ece822331d6e6b28db74520ea69587cbc","src/fmt.rs":"c2d4aad6ce20625a70a7c091e3087b6a2c19a4a87c7a12edb4c98978307245ea","src/kind.rs":"b21b15dbee77d50abe88684a9571b39659076465dd4b1956f366af8fdd26e95a","src/lib.rs":"330286a28b4d4da255db38bc267da17fb03f2333ea26684f82124973ffcaea43","src/macros.rs":"5a735a3fa919de58729be54976678c0a386e8e9af947987f17fd988c531974c7","src/ptr.rs":"f4e28bc9feba1e84160ca9d185008a51b5d72e168e6546f3e942f4258c361e19","src/wrapper.rs":"1229beca67dbd95ca77c9ecce282272acc55276c267c58cb73a75388b4693dda","tests/common/mod.rs":"f9088c2d7afafa64ff730b629272045b776bfafc2f5957508242da630635f2e1","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/drop/mod.rs":"08c3e553c1cc0d2dbd936fc45f4b5b1105057186affd6865e8d261e05f0f0646","tests/test_autotrait.rs":"981e792db353be2f14c7a1cabe43b5f1329c168cb7679077cc2be786a0920d48","tests/test_backtrace.rs":"0e50edbb33b6bd07ba89ff3db72fb7c688ba2a4371fccdbbb20309ab02948b6a","tests/test_boxed.rs":"6b26db0e2eb72afe9af7352ea820837aab90f8d486294616dd5dc34c1b94038c","tests/test_chain.rs":"d5e90e3eba58abc60d241d3aade39e0b8d4006d9a14f3cf015d3d925160b5812","tests/test_context.rs":"8409c53b328562c11e822bd6c3cd17e0d4d50b9bbb8fc3617333fd77303a6a33","tests/test_convert.rs":"7e7a8b4772a427a911014ac4d1083f9519000e786177f898808980dd9bdfde61","tests/test_downcast.rs":"ce8438cb58a1b7f3599740c261f6ef05855127ccde20c83c82db15eaf51c57ad","tests/test_ensure.rs":"f8bc5174219da947e6292891864f35307d5c400fd5690f51d574edaa5e39b8a4","tests/test_ffi.rs":"d0cb4c1d6d9154090982dee72ae3ebe05a5981f976058c3250f1c9da5a45edef","tests/test_fmt.rs":"17572596f257aac9aa2ec4620e292ca6a954128b94772bb948399fab53832e70","tests/test_macros.rs":"3f808b3050fc2b18c5b9058fe71b6b464d70e3658ff9b1daa379cd58c6874296","tests/test_repr.rs":"dbb9b04ddbe1ab31eb5331ea69f05bb3a147299da2275a3d4dcc92947b5591b9","tests/test_source.rs":"b80723cf635a4f8c4df21891b34bfab9ed2b2aa407e7a2f826d24e334cd5f88e","tests/ui/chained-comparison.rs":"6504b03d95b5acc232a7f4defc9f343b2be6733bf475fa0992e8e6545b912bd4","tests/ui/chained-comparison.stderr":"7f1d0a8c251b0ede2d30b3087ec157fc660945c97a642c4a5acf5a14ec58de34","tests/ui/empty-ensure.rs":"ab5bf37c846a0d689f26ce9257a27228411ed64154f9c950f1602d88a355d94b","tests/ui/empty-ensure.stderr":"0fa39de3edadb86382d8cd147c2640771e080338be2f4b067650258e3150f181","tests/ui/no-impl.rs":"fab6cbf2f6ea510b86f567dfb3b7c31250a9fd71ae5d110dbb9188be569ec593","tests/ui/no-impl.stderr":"9d2d9cdf441f1c4a0ccbc4a7433013166425b98cd8dd8738381e8fd070c1aed9","tests/ui/temporary-value.rs":"4dcc96271b2403e6372cf4cfc813445e5ce4365fc6e156b6bc38274098499a70","tests/ui/temporary-value.stderr":"64e448b6759cf51d41b1360307a638452bbe53ffa706f93e4a503b712d7b89a8","tests/ui/wrong-interpolation.rs":"9c44d4674c2dccd27b9dedd03341346ec02d993b41793ee89b5755202e7e367e","tests/ui/wrong-interpolation.stderr":"301e60e2eb9401782c7dc0b3580613a4cb2aafd4cc8065734a630a62e1161aa5"},"package":"84450d0b4a8bd1ba4144ce8ce718fbc5d071358b1e5384bace6536b3d1f2d5b3"} +\ No newline at end of file ++{"files":{"Cargo.toml":"5e3414ce23940106f95102f85e643cb5bed5e8ed9027557963c728d5f46d5586","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"f6bffe3676b128afe14aaf91c972d69c37f2e5afe4e02b99a974f7b7393f4cda","build.rs":"b6ee548cb30aba0a4a7ff92379478fcf94ef246b892da8e2134ee2d9575bf08c","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/backtrace.rs":"a1a52f9874f0aa1382fb404f029c6fa88e53afe38fb2417877d5711f1f2b90c9","src/chain.rs":"6edefc5f3c7d69683095862e54e3bb56faba5b3387bf2eeaed429da090007a0a","src/context.rs":"559478ae785ce913523aa21358cc1561ef4b0b95c5c87675a77890364c0162fe","src/ensure.rs":"98b2f4a7923e06cf6558b0a15f39a7c7ff3d36711e217475c6a93690cd58b7a1","src/error.rs":"33a0f6c49d2c5d08b8d027aa930be75ece822331d6e6b28db74520ea69587cbc","src/fmt.rs":"c2d4aad6ce20625a70a7c091e3087b6a2c19a4a87c7a12edb4c98978307245ea","src/kind.rs":"b21b15dbee77d50abe88684a9571b39659076465dd4b1956f366af8fdd26e95a","src/lib.rs":"f39d4684ce6ce473b585d2f9bc8b7a355cf28e5b5c936431d8072ac5c4fe94fd","src/macros.rs":"5a735a3fa919de58729be54976678c0a386e8e9af947987f17fd988c531974c7","src/ptr.rs":"f4e28bc9feba1e84160ca9d185008a51b5d72e168e6546f3e942f4258c361e19","src/wrapper.rs":"1229beca67dbd95ca77c9ecce282272acc55276c267c58cb73a75388b4693dda","tests/common/mod.rs":"f9088c2d7afafa64ff730b629272045b776bfafc2f5957508242da630635f2e1","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/drop/mod.rs":"382956f4bd3dcd1f6036efb8f11193595a7c60e0a5dbf5f2da149f1f25183abf","tests/test_autotrait.rs":"981e792db353be2f14c7a1cabe43b5f1329c168cb7679077cc2be786a0920d48","tests/test_backtrace.rs":"0e50edbb33b6bd07ba89ff3db72fb7c688ba2a4371fccdbbb20309ab02948b6a","tests/test_boxed.rs":"6b26db0e2eb72afe9af7352ea820837aab90f8d486294616dd5dc34c1b94038c","tests/test_chain.rs":"d5e90e3eba58abc60d241d3aade39e0b8d4006d9a14f3cf015d3d925160b5812","tests/test_context.rs":"8409c53b328562c11e822bd6c3cd17e0d4d50b9bbb8fc3617333fd77303a6a33","tests/test_convert.rs":"7e7a8b4772a427a911014ac4d1083f9519000e786177f898808980dd9bdfde61","tests/test_downcast.rs":"ce8438cb58a1b7f3599740c261f6ef05855127ccde20c83c82db15eaf51c57ad","tests/test_ensure.rs":"45331ef18c4c69acf4b80f5f55d2cefb55cc82f00e854b81d54c3df36a639003","tests/test_ffi.rs":"d0cb4c1d6d9154090982dee72ae3ebe05a5981f976058c3250f1c9da5a45edef","tests/test_fmt.rs":"17572596f257aac9aa2ec4620e292ca6a954128b94772bb948399fab53832e70","tests/test_macros.rs":"3f808b3050fc2b18c5b9058fe71b6b464d70e3658ff9b1daa379cd58c6874296","tests/test_repr.rs":"dbb9b04ddbe1ab31eb5331ea69f05bb3a147299da2275a3d4dcc92947b5591b9","tests/test_source.rs":"b80723cf635a4f8c4df21891b34bfab9ed2b2aa407e7a2f826d24e334cd5f88e","tests/ui/chained-comparison.rs":"6504b03d95b5acc232a7f4defc9f343b2be6733bf475fa0992e8e6545b912bd4","tests/ui/chained-comparison.stderr":"7f1d0a8c251b0ede2d30b3087ec157fc660945c97a642c4a5acf5a14ec58de34","tests/ui/empty-ensure.rs":"ab5bf37c846a0d689f26ce9257a27228411ed64154f9c950f1602d88a355d94b","tests/ui/empty-ensure.stderr":"0fa39de3edadb86382d8cd147c2640771e080338be2f4b067650258e3150f181","tests/ui/no-impl.rs":"fab6cbf2f6ea510b86f567dfb3b7c31250a9fd71ae5d110dbb9188be569ec593","tests/ui/no-impl.stderr":"9d2d9cdf441f1c4a0ccbc4a7433013166425b98cd8dd8738381e8fd070c1aed9","tests/ui/temporary-value.rs":"4dcc96271b2403e6372cf4cfc813445e5ce4365fc6e156b6bc38274098499a70","tests/ui/temporary-value.stderr":"64e448b6759cf51d41b1360307a638452bbe53ffa706f93e4a503b712d7b89a8","tests/ui/wrong-interpolation.rs":"9c44d4674c2dccd27b9dedd03341346ec02d993b41793ee89b5755202e7e367e","tests/ui/wrong-interpolation.stderr":"301e60e2eb9401782c7dc0b3580613a4cb2aafd4cc8065734a630a62e1161aa5"},"package":"8b26702f315f53b6071259e15dd9d64528213b44d61de1ec926eca7715d62203"} +\ No newline at end of file +diff -up firefox-98.0/third_party/rust/anyhow/Cargo.toml.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/anyhow/Cargo.toml +--- firefox-98.0/third_party/rust/anyhow/Cargo.toml.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/anyhow/Cargo.toml 2022-03-16 09:33:31.989159760 +0100 +@@ -13,7 +13,7 @@ + edition = "2018" + rust-version = "1.38" + name = "anyhow" +-version = "1.0.52" ++version = "1.0.51" + authors = ["David Tolnay "] + description = "Flexible concrete Error type built on std::error::Error" + documentation = "https://docs.rs/anyhow" +@@ -32,7 +32,7 @@ version = "0.3" + default-features = false + + [dev-dependencies.rustversion] +-version = "1.0.6" ++version = "1.0" + + [dev-dependencies.syn] + version = "1.0" +diff -up firefox-98.0/third_party/rust/anyhow/src/backtrace.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/anyhow/src/backtrace.rs +--- firefox-98.0/third_party/rust/anyhow/src/backtrace.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/anyhow/src/backtrace.rs 2022-03-16 09:33:31.989159760 +0100 +@@ -182,7 +182,7 @@ mod capture { + impl Backtrace { + fn enabled() -> bool { + static ENABLED: AtomicUsize = AtomicUsize::new(0); +- match ENABLED.load(Ordering::Relaxed) { ++ match ENABLED.load(Ordering::SeqCst) { + 0 => {} + 1 => return false, + _ => return true, +@@ -194,7 +194,7 @@ mod capture { + None => false, + }, + }; +- ENABLED.store(enabled as usize + 1, Ordering::Relaxed); ++ ENABLED.store(enabled as usize + 1, Ordering::SeqCst); + enabled + } + +diff -up firefox-98.0/third_party/rust/anyhow/src/lib.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/anyhow/src/lib.rs +--- firefox-98.0/third_party/rust/anyhow/src/lib.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/anyhow/src/lib.rs 2022-03-16 09:33:31.989159760 +0100 +@@ -210,7 +210,7 @@ + //! will require an explicit `.map_err(Error::msg)` when working with a + //! non-Anyhow error type inside a function that returns Anyhow's error type. + +-#![doc(html_root_url = "https://docs.rs/anyhow/1.0.52")] ++#![doc(html_root_url = "https://docs.rs/anyhow/1.0.51")] + #![cfg_attr(backtrace, feature(backtrace))] + #![cfg_attr(doc_cfg, feature(doc_cfg))] + #![cfg_attr(not(feature = "std"), no_std)] +@@ -225,7 +225,6 @@ + clippy::needless_doctest_main, + clippy::new_ret_no_self, + clippy::redundant_else, +- clippy::return_self_not_must_use, + clippy::unused_self, + clippy::used_underscore_binding, + clippy::wildcard_imports, +diff -up firefox-98.0/third_party/rust/anyhow/tests/drop/mod.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/anyhow/tests/drop/mod.rs +--- firefox-98.0/third_party/rust/anyhow/tests/drop/mod.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/anyhow/tests/drop/mod.rs 2022-03-16 09:33:31.989159760 +0100 +@@ -2,7 +2,8 @@ + + use std::error::Error as StdError; + use std::fmt::{self, Display}; +-use std::sync::atomic::{AtomicBool, Ordering}; ++use std::sync::atomic::AtomicBool; ++use std::sync::atomic::Ordering::SeqCst; + use std::sync::Arc; + + #[derive(Debug)] +@@ -18,7 +19,7 @@ impl Flag { + } + + pub fn get(&self) -> bool { +- self.atomic.load(Ordering::Relaxed) ++ self.atomic.load(SeqCst) + } + } + +@@ -47,7 +48,7 @@ impl Display for DetectDrop { + + impl Drop for DetectDrop { + fn drop(&mut self) { +- let already_dropped = self.has_dropped.atomic.swap(true, Ordering::Relaxed); ++ let already_dropped = self.has_dropped.atomic.swap(true, SeqCst); + assert!(!already_dropped); + } + } +diff -up firefox-98.0/third_party/rust/anyhow/tests/test_ensure.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/anyhow/tests/test_ensure.rs +--- firefox-98.0/third_party/rust/anyhow/tests/test_ensure.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/anyhow/tests/test_ensure.rs 2022-03-16 09:33:31.990159794 +0100 +@@ -5,7 +5,6 @@ + clippy::items_after_statements, + clippy::let_and_return, + clippy::let_underscore_drop, +- clippy::logic_bug, + clippy::match_bool, + clippy::never_loop, + clippy::redundant_closure_call, +@@ -46,15 +45,13 @@ impl Trait for T {} + fn assert_err(result: impl FnOnce() -> Result, expected: &'static str) { + let actual = result().unwrap_err().to_string(); + +- // In general different rustc versions will format the interpolated lhs and +- // rhs $:expr fragment with insignificant differences in whitespace or +- // punctuation, so we check the message in full against nightly and do just +- // a cursory test on older toolchains. +- if rustversion::cfg!(nightly) && !cfg!(miri) { +- assert_eq!(actual, expected); +- } else { +- assert_eq!(actual.contains(" vs "), expected.contains(" vs ")); ++ let mut accepted_alternatives = expected.split('\n'); ++ let expected = accepted_alternatives.next_back().unwrap(); ++ if accepted_alternatives.any(|alternative| actual == alternative) { ++ return; + } ++ ++ assert_eq!(actual, expected); + } + + #[test] +@@ -101,7 +98,7 @@ fn test_low_precedence_binary_operator() + let test = || Ok(ensure!(while false == true && false {} < ())); + assert_err( + test, +- "Condition failed: `while false == true && false {} < ()` (() vs ())", ++ "Condition failed: `while false == true && false { } < ()` (() vs ())", + ); + } + +@@ -148,41 +145,41 @@ fn test_unary() { + fn test_if() { + #[rustfmt::skip] + let test = || Ok(ensure!(if false {}.t(1) == 2)); +- assert_err(test, "Condition failed: `if false {}.t(1) == 2` (1 vs 2)"); ++ assert_err(test, "Condition failed: `if false { }.t(1) == 2` (1 vs 2)"); + + #[rustfmt::skip] + let test = || Ok(ensure!(if false {} else {}.t(1) == 2)); + assert_err( + test, +- "Condition failed: `if false {} else {}.t(1) == 2` (1 vs 2)", ++ "Condition failed: `if false { } else { }.t(1) == 2` (1 vs 2)", + ); + + #[rustfmt::skip] + let test = || Ok(ensure!(if false {} else if false {}.t(1) == 2)); + assert_err( + test, +- "Condition failed: `if false {} else if false {}.t(1) == 2` (1 vs 2)", ++ "Condition failed: `if false { } else if false { }.t(1) == 2` (1 vs 2)", + ); + + #[rustfmt::skip] + let test = || Ok(ensure!(if let 1 = 2 {}.t(1) == 2)); + assert_err( + test, +- "Condition failed: `if let 1 = 2 {}.t(1) == 2` (1 vs 2)", ++ "Condition failed: `if let 1 = 2 { }.t(1) == 2` (1 vs 2)", + ); + + #[rustfmt::skip] + let test = || Ok(ensure!(if let 1 | 2 = 2 {}.t(1) == 2)); + assert_err( + test, +- "Condition failed: `if let 1 | 2 = 2 {}.t(1) == 2` (1 vs 2)", ++ "Condition failed: `if let 1 | 2 = 2 { }.t(1) == 2` (1 vs 2)", + ); + + #[rustfmt::skip] + let test = || Ok(ensure!(if let | 1 | 2 = 2 {}.t(1) == 2)); + assert_err( + test, +- "Condition failed: `if let 1 | 2 = 2 {}.t(1) == 2` (1 vs 2)", ++ "Condition failed: `if let 1 | 2 = 2 { }.t(1) == 2` (1 vs 2)", + ); + } + +@@ -192,49 +189,53 @@ fn test_loop() { + let test = || Ok(ensure!(1 + loop { break 1 } == 1)); + assert_err( + test, +- "Condition failed: `1 + loop { break 1 } == 1` (2 vs 1)", ++ // 1.54 puts a double space after loop ++ "Condition failed: `1 + loop { break 1 } == 1` (2 vs 1)\n\ ++ Condition failed: `1 + loop { break 1 } == 1` (2 vs 1)", + ); + + #[rustfmt::skip] + let test = || Ok(ensure!(1 + 'a: loop { break 'a 1 } == 1)); + assert_err( + test, +- "Condition failed: `1 + 'a: loop { break 'a 1 } == 1` (2 vs 1)", ++ // 1.54 puts a double space after loop ++ "Condition failed: `1 + 'a: loop { break 'a 1 } == 1` (2 vs 1)\n\ ++ Condition failed: `1 + 'a: loop { break 'a 1 } == 1` (2 vs 1)", + ); + + #[rustfmt::skip] + let test = || Ok(ensure!(while false {}.t(1) == 2)); + assert_err( + test, +- "Condition failed: `while false {}.t(1) == 2` (1 vs 2)", ++ "Condition failed: `while false { }.t(1) == 2` (1 vs 2)", + ); + + #[rustfmt::skip] + let test = || Ok(ensure!(while let None = Some(1) {}.t(1) == 2)); + assert_err( + test, +- "Condition failed: `while let None = Some(1) {}.t(1) == 2` (1 vs 2)", ++ "Condition failed: `while let None = Some(1) { }.t(1) == 2` (1 vs 2)", + ); + + #[rustfmt::skip] + let test = || Ok(ensure!(for _x in iter::once(0) {}.t(1) == 2)); + assert_err( + test, +- "Condition failed: `for _x in iter::once(0) {}.t(1) == 2` (1 vs 2)", ++ "Condition failed: `for _x in iter::once(0) { }.t(1) == 2` (1 vs 2)", + ); + + #[rustfmt::skip] + let test = || Ok(ensure!(for | _x in iter::once(0) {}.t(1) == 2)); + assert_err( + test, +- "Condition failed: `for _x in iter::once(0) {}.t(1) == 2` (1 vs 2)", ++ "Condition failed: `for _x in iter::once(0) { }.t(1) == 2` (1 vs 2)", + ); + + #[rustfmt::skip] + let test = || Ok(ensure!(for true | false in iter::empty() {}.t(1) == 2)); + assert_err( + test, +- "Condition failed: `for true | false in iter::empty() {}.t(1) == 2` (1 vs 2)", ++ "Condition failed: `for true | false in iter::empty() { }.t(1) == 2` (1 vs 2)", + ); + } + +@@ -263,13 +264,13 @@ fn test_atom() { + let test = || Ok(ensure!(S + async { 1 } == true)); + assert_err( + test, +- "Condition failed: `S + async { 1 } == true` (false vs true)", ++ "Condition failed: `S + async { 1 } == true` (false vs true)", + ); + + let test = || Ok(ensure!(S + async move { 1 } == true)); + assert_err( + test, +- "Condition failed: `S + async move { 1 } == true` (false vs true)", ++ "Condition failed: `S + async move { 1 } == true` (false vs true)", + ); + + let x = &1; +@@ -380,7 +381,7 @@ fn test_macro() { + let test = || Ok(ensure!(stringify! {} != "")); + assert_err( + test, +- "Condition failed: `stringify! {} != \"\"` (\"\" vs \"\")", ++ "Condition failed: `stringify! { } != \"\"` (\"\" vs \"\")", + ); + } + +@@ -528,7 +529,7 @@ fn test_as() { + let test = || Ok(ensure!(f as for<'a> fn() as usize * 0 != 0)); + assert_err( + test, +- "Condition failed: `f as for<'a>fn() as usize * 0 != 0` (0 vs 0)", // FIXME ++ "Condition failed: `f as for<'a>fn() as usize * 0 != 0` (0 vs 0)", + ); + + let test = || Ok(ensure!(f as unsafe fn() as usize * 0 != 0)); +@@ -613,7 +614,7 @@ fn test_pat() { + let test = || Ok(ensure!(if let -1..=1 = 0 { 0 } else { 1 } == 1)); + assert_err( + test, +- "Condition failed: `if let -1 ..=1 = 0 { 0 } else { 1 } == 1` (0 vs 1)", // FIXME ++ "Condition failed: `if let -1 ..=1 = 0 { 0 } else { 1 } == 1` (0 vs 1)", + ); + + let test = || Ok(ensure!(if let &0 = &0 { 0 } else { 1 } == 1)); +@@ -656,13 +657,13 @@ fn test_pat() { + let test = || Ok(ensure!(if let P:: {} = p { 0 } else { 1 } == 1)); + assert_err( + test, +- "Condition failed: `if let P:: { } = p { 0 } else { 1 } == 1` (0 vs 1)", // FIXME ++ "Condition failed: `if let P:: { } = p { 0 } else { 1 } == 1` (0 vs 1)", + ); + + let test = || Ok(ensure!(if let ::std::marker::PhantomData = p {} != ())); + assert_err( + test, +- "Condition failed: `if let ::std::marker::PhantomData = p {} != ()` (() vs ())", ++ "Condition failed: `if let ::std::marker::PhantomData = p { } != ()` (() vs ())", + ); + + let test = || Ok(ensure!(if let ::V = 0 { 0 } else { 1 } == 1)); +@@ -674,7 +675,7 @@ fn test_pat() { + let test = || Ok(ensure!(for _ in iter::once(()) {} != ())); + assert_err( + test, +- "Condition failed: `for _ in iter::once(()) {} != ()` (() vs ())", ++ "Condition failed: `for _ in iter::once(()) { } != ()` (() vs ())", + ); + + let test = || Ok(ensure!(if let stringify!(x) = "x" { 0 } else { 1 } == 1)); +diff -up firefox-98.0/third_party/rust/async-trait/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/.cargo-checksum.json +--- firefox-98.0/third_party/rust/async-trait/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/async-trait/.cargo-checksum.json 2022-03-16 09:33:31.990159794 +0100 +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"9168c83306a2940b86790578d9d72c23d70bad572bf67ad3def2c8265bd0c270","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"b733a7cddbdc409fcd5fb8eff5fe1d5692b6d1e0364568366a69bb1dd68e232c","build.rs":"e2ca6b6c6f18d5d47cb662083856d1399946bc41a272b30231c31ae8317a3ed0","src/args.rs":"6eed5497db91752b3aae597943c39e769f60406b37055304e69e4699f1f87b15","src/expand.rs":"f1002235c33fc292e6784937c2c64d6e7ba105147b9a82126c830d09b86c1059","src/lib.rs":"51cd49b85c0a7662ef32f30631f1f6a2ce448f18e951725b9d13227b5a596d3e","src/lifetime.rs":"4b94740e2847ef8df128a25d264f0a1bc1d1723ea107fc53849322b98f1e6927","src/parse.rs":"cd9032fe2c6dcf41050b3a59b9fb98eb9700a29bbe2fa011ee2854014c1666b7","src/receiver.rs":"31f5ff929bb6ac061ca3f44d4efac1ca0c60273d54ef8f8f92234a69829dc88d","tests/compiletest.rs":"0a52a44786aea1c299c695bf948b2ed2081e4cc344e5c2cadceab4eb03d0010d","tests/executor/mod.rs":"3cf48614288715f625514a73ae642f649c2635a402a3ad90278bbee116a7234c","tests/test.rs":"df12d6551ce0a8e3416f83fe92686ab2a22fb0a5dadb45499f531c8822c63c3e","tests/ui/bare-trait-object.rs":"4546e8bd6682de11920fa4c768295fed61954484ef0550dfadbc5677b77f29a5","tests/ui/bare-trait-object.stderr":"1df5569f4615620172affeaa86da629623f32a0bb15f790a10c0837bd9da27e6","tests/ui/delimiter-span.rs":"97edf38c804d5e0d4cef6f040dee113d78ff76b08bf8c49586b803caa3ce7f40","tests/ui/delimiter-span.stderr":"0f70f0bda0e86a43e6d6f6980f1ef8a1989c3e32db593bd60f920025a25728d5","tests/ui/lifetime-span.rs":"263de0b98abd0772fe9dc73ced1a71a3b85efb90d2b208226fe35ab9378c5e5a","tests/ui/lifetime-span.stderr":"21ce55872b2a6d57077ada797a5c3ae78a3d218570605a7509951b45afa212b3","tests/ui/missing-async-in-impl.rs":"5a5538d08d11c145211a92af0d8973eee8b21f33b90adda85430805bd3dbbc83","tests/ui/missing-async-in-impl.stderr":"2916bc8a51e25f4dd18eaf433b916d533943eac2c1afbee64e9a89e7b928040d","tests/ui/missing-async-in-trait.rs":"dc67241593f270233ba885df92e59164126416e68d49d8d62edc251666b5db6e","tests/ui/missing-async-in-trait.stderr":"67e66e7b19358830deff3ba01f5d701a9ae05c4e6fa9c081c49c1c75efbb7ade","tests/ui/missing-body.rs":"d06c0da8c6044e7c790b924136f167e2edc0d0d3fa01f23521f3f08ca605929b","tests/ui/missing-body.stderr":"e5ee994398bf8294324d61df02467a4229f68f4113bf5acc004851c03d66ec6a","tests/ui/must-use.rs":"75090c7df984df0996464337f60371d198bd0caf3f9f44b10d1e131f15fd4fca","tests/ui/must-use.stderr":"cd7bf2fe9023021837b2b3e8cc164ffc18900b01cf704c68cde91edd07d65dc8","tests/ui/self-span.rs":"67ddde05907d7014bfb3f2c63d427b1d72d6c4369a9108a4335dac6bee5832b2","tests/ui/self-span.stderr":"7865153d1e41ecdfa64b197901e3bda57bcda0c486bbcf11dc6e9837ceb40b29","tests/ui/send-not-implemented.rs":"affbbe8bc9c3501d3db3a024e06daa9d076f1d142dba290c7aa1ea119daebd19","tests/ui/send-not-implemented.stderr":"01e6800bcabca87306c72269e38d1eac53ef1e8ad9951a9be052b97aff16364d","tests/ui/unreachable.rs":"be0aa7cc129fe42a1fbd85e36b3f08c6a2bd16c90ed2e33fc4c50e40ce085bcd","tests/ui/unreachable.stderr":"73beb71cb74076f2cb45485271de31658cf59f4143e62daa34b9f2a8980ddfcd","tests/ui/unsupported-self.rs":"f7855bc39dab1fd2f533fb2e873a27c3757dcb9fb57001e4b19f58d3dda36d01","tests/ui/unsupported-self.stderr":"64fc5d45cb51330f0a1e85e69a28b69ddda12a109aa6a8ba3eaee1ac58d93b5f"},"package":"061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3"} +\ No newline at end of file ++{"files":{"Cargo.toml":"fda2e0dc95a93f95edaa7dfdf9b7323593214c1b9e165789cd8b8e6057349ecb","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"b733a7cddbdc409fcd5fb8eff5fe1d5692b6d1e0364568366a69bb1dd68e232c","build.rs":"e2ca6b6c6f18d5d47cb662083856d1399946bc41a272b30231c31ae8317a3ed0","src/args.rs":"6eed5497db91752b3aae597943c39e769f60406b37055304e69e4699f1f87b15","src/expand.rs":"231d1e732f295949939583df7169f49f950317679e7415ee6b5d38b8414f8b7b","src/lib.rs":"51cd49b85c0a7662ef32f30631f1f6a2ce448f18e951725b9d13227b5a596d3e","src/lifetime.rs":"4b94740e2847ef8df128a25d264f0a1bc1d1723ea107fc53849322b98f1e6927","src/parse.rs":"cd9032fe2c6dcf41050b3a59b9fb98eb9700a29bbe2fa011ee2854014c1666b7","src/receiver.rs":"31f5ff929bb6ac061ca3f44d4efac1ca0c60273d54ef8f8f92234a69829dc88d","tests/compiletest.rs":"0a52a44786aea1c299c695bf948b2ed2081e4cc344e5c2cadceab4eb03d0010d","tests/executor/mod.rs":"3cf48614288715f625514a73ae642f649c2635a402a3ad90278bbee116a7234c","tests/test.rs":"8a60ea2181287bfd42bcc73df1d157398f202f60991ec91eb906029e3a1ae88b","tests/ui/bare-trait-object.rs":"4546e8bd6682de11920fa4c768295fed61954484ef0550dfadbc5677b77f29a5","tests/ui/bare-trait-object.stderr":"fd6f80e2cae790f6370c537eaabedb17e9ff06c2b1f056d3d7071ed7f021f831","tests/ui/delimiter-span.rs":"97edf38c804d5e0d4cef6f040dee113d78ff76b08bf8c49586b803caa3ce7f40","tests/ui/delimiter-span.stderr":"f3c32ae57ead984ac985641bd07f50a894b572d6b8b8269556cf606f34d05101","tests/ui/lifetime-span.rs":"263de0b98abd0772fe9dc73ced1a71a3b85efb90d2b208226fe35ab9378c5e5a","tests/ui/lifetime-span.stderr":"1e1cbcbbfded1da0a252666f2077d806d11e16fccea825c7d58805c1d88a9d58","tests/ui/missing-body.rs":"d06c0da8c6044e7c790b924136f167e2edc0d0d3fa01f23521f3f08ca605929b","tests/ui/missing-body.stderr":"636a03cc42933b59d73032ce6cea862e33c16efb9c7fe7f27749247998bc9f23","tests/ui/must-use.rs":"75090c7df984df0996464337f60371d198bd0caf3f9f44b10d1e131f15fd4fca","tests/ui/must-use.stderr":"e6cb190e02f0226df6444065aaca3051f7db8ae599bba18a685155c52bb799b6","tests/ui/self-span.rs":"67ddde05907d7014bfb3f2c63d427b1d72d6c4369a9108a4335dac6bee5832b2","tests/ui/self-span.stderr":"590ba1db336f57133b66b83a576afa6f96f2201147b9c90eea4bdc84b966b19c","tests/ui/send-not-implemented.rs":"affbbe8bc9c3501d3db3a024e06daa9d076f1d142dba290c7aa1ea119daebd19","tests/ui/send-not-implemented.stderr":"63ed733b35b71f29ff0e863d287049e831dd0923978d16f5679ebd4d9d1c6d69","tests/ui/unreachable.rs":"7905c3fd0115753d18d64e12c39f42f3abec7a41b02572ea009c7d93f6d7751d","tests/ui/unreachable.stderr":"1fe3a63e44a99c62c489e1994176f03c2218bf382439bc20f1f12d368fe1558a","tests/ui/unsupported-self.rs":"f7855bc39dab1fd2f533fb2e873a27c3757dcb9fb57001e4b19f58d3dda36d01","tests/ui/unsupported-self.stderr":"be1893e21e626f0f76d16799bf27ad12df304384245462515e1fa63f06a83d80"},"package":"44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e"} +\ No newline at end of file +diff -up firefox-98.0/third_party/rust/async-trait/Cargo.toml.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/Cargo.toml +--- firefox-98.0/third_party/rust/async-trait/Cargo.toml.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/async-trait/Cargo.toml 2022-03-16 09:33:31.990159794 +0100 +@@ -11,9 +11,8 @@ + + [package] + edition = "2018" +-rust-version = "1.39" + name = "async-trait" +-version = "0.1.52" ++version = "0.1.51" + authors = ["David Tolnay "] + description = "Type erasure for async trait methods" + documentation = "https://docs.rs/async-trait" +@@ -48,5 +47,5 @@ version = "0.1.14" + version = "0.1.14" + + [dev-dependencies.trybuild] +-version = "1.0.49" ++version = "1.0.19" + features = ["diff"] +diff -up firefox-98.0/third_party/rust/async-trait/src/expand.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/src/expand.rs +--- firefox-98.0/third_party/rust/async-trait/src/expand.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/async-trait/src/expand.rs 2022-03-16 09:33:31.990159794 +0100 +@@ -125,8 +125,6 @@ fn lint_suppress_with_body() -> Attribut + parse_quote! { + #[allow( + clippy::let_unit_value, +- clippy::no_effect_underscore_binding, +- clippy::shadow_same, + clippy::type_complexity, + clippy::type_repetition_in_bounds, + clippy::used_underscore_binding +diff -up firefox-98.0/third_party/rust/async-trait/tests/test.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/test.rs +--- firefox-98.0/third_party/rust/async-trait/tests/test.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/async-trait/tests/test.rs 2022-03-16 09:33:31.990159794 +0100 +@@ -6,7 +6,6 @@ + clippy::let_underscore_drop, + clippy::let_unit_value, + clippy::missing_panics_doc, +- clippy::missing_safety_doc, + clippy::needless_return, + clippy::trivially_copy_pass_by_ref, + clippy::unused_async +@@ -1377,15 +1376,3 @@ pub mod issue169 { + + pub fn test(_t: &dyn Trait) {} + } +- +-// https://github.com/dtolnay/async-trait/issues/183 +-pub mod issue183 { +- #![deny(clippy::shadow_same)] +- +- use async_trait::async_trait; +- +- #[async_trait] +- trait Foo { +- async fn foo(_n: i32) {} +- } +-} +diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/bare-trait-object.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/bare-trait-object.stderr +--- firefox-98.0/third_party/rust/async-trait/tests/ui/bare-trait-object.stderr.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/async-trait/tests/ui/bare-trait-object.stderr 2022-03-16 09:33:31.990159794 +0100 +@@ -1,13 +1,13 @@ + error: trait objects without an explicit `dyn` are deprecated +- --> tests/ui/bare-trait-object.rs:11:16 ++ --> $DIR/bare-trait-object.rs:11:16 + | + 11 | impl Trait for Send + Sync { + | ^^^^^^^^^^^ help: use `dyn`: `dyn Send + Sync` + | + note: the lint level is defined here +- --> tests/ui/bare-trait-object.rs:1:9 ++ --> $DIR/bare-trait-object.rs:1:9 + | + 1 | #![deny(bare_trait_objects)] + | ^^^^^^^^^^^^^^^^^^ + = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! +- = note: for more information, see ++ = note: for more information, see issue #80165 +diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/delimiter-span.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/delimiter-span.stderr +--- firefox-98.0/third_party/rust/async-trait/tests/ui/delimiter-span.stderr.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/async-trait/tests/ui/delimiter-span.stderr 2022-03-16 09:33:31.990159794 +0100 +@@ -1,5 +1,5 @@ + error: no rules expected the token `{` +- --> tests/ui/delimiter-span.rs:17:16 ++ --> $DIR/delimiter-span.rs:17:16 + | + 3 | macro_rules! picky { + | ------------------ when calling this macro +@@ -8,7 +8,7 @@ error: no rules expected the token `{` + | ^ no rules expected this token in macro call + + error: no rules expected the token `{` +- --> tests/ui/delimiter-span.rs:18:16 ++ --> $DIR/delimiter-span.rs:18:16 + | + 3 | macro_rules! picky { + | ------------------ when calling this macro +diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/lifetime-span.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/lifetime-span.stderr +--- firefox-98.0/third_party/rust/async-trait/tests/ui/lifetime-span.stderr.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/async-trait/tests/ui/lifetime-span.stderr 2022-03-16 09:33:31.990159794 +0100 +@@ -1,5 +1,5 @@ + error[E0726]: implicit elided lifetime not allowed here +- --> tests/ui/lifetime-span.rs:12:6 ++ --> $DIR/lifetime-span.rs:12:6 + | + 12 | impl Trait for A { + | ^^^^^- help: indicate the anonymous lifetime: `<'_>` +@@ -7,7 +7,7 @@ error[E0726]: implicit elided lifetime n + = note: assuming a `'static` lifetime... + + error[E0107]: this trait takes 0 lifetime arguments but 1 lifetime argument was supplied +- --> tests/ui/lifetime-span.rs:32:10 ++ --> $DIR/lifetime-span.rs:32:10 + | + 32 | impl<'r> Trait2<'r> for B { + | ^^^^^^---- help: remove these generics +@@ -15,13 +15,13 @@ error[E0107]: this trait takes 0 lifetim + | expected 0 lifetime arguments + | + note: trait defined here, with 0 lifetime parameters +- --> tests/ui/lifetime-span.rs:22:11 ++ --> $DIR/lifetime-span.rs:22:11 + | + 22 | pub trait Trait2 { + | ^^^^^^ + + error[E0195]: lifetime parameters or bounds on method `method` do not match the trait declaration +- --> tests/ui/lifetime-span.rs:13:14 ++ --> $DIR/lifetime-span.rs:13:14 + | + 8 | async fn method(&'r self); + | ---------------- lifetimes in impl do not match this method in trait +@@ -30,7 +30,7 @@ error[E0195]: lifetime parameters or bou + | ^^^^^^^^^^^^^ lifetimes do not match method in trait + + error[E0195]: lifetime parameters or bounds on method `method` do not match the trait declaration +- --> tests/ui/lifetime-span.rs:18:14 ++ --> $DIR/lifetime-span.rs:18:14 + | + 8 | async fn method(&'r self); + | ---------------- lifetimes in impl do not match this method in trait +@@ -39,7 +39,7 @@ error[E0195]: lifetime parameters or bou + | ^^^^^^^^^^^^^ lifetimes do not match method in trait + + error[E0195]: lifetime parameters or bounds on method `method` do not match the trait declaration +- --> tests/ui/lifetime-span.rs:33:14 ++ --> $DIR/lifetime-span.rs:33:14 + | + 23 | async fn method<'r>(&'r self); + | ---- lifetimes in impl do not match this method in trait +diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/missing-async-in-impl.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/missing-async-in-impl.stderr +diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/missing-async-in-trait.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/missing-async-in-trait.stderr +diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/missing-body.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/missing-body.stderr +--- firefox-98.0/third_party/rust/async-trait/tests/ui/missing-body.stderr.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/async-trait/tests/ui/missing-body.stderr 2022-03-16 09:33:31.990159794 +0100 +@@ -1,5 +1,5 @@ + error: associated function in `impl` without body +- --> tests/ui/missing-body.rs:12:5 ++ --> $DIR/missing-body.rs:12:5 + | + 12 | async fn f(&self); + | ^^^^^^^^^^^^^^^^^- +diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/must-use.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/must-use.stderr +--- firefox-98.0/third_party/rust/async-trait/tests/ui/must-use.stderr.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/async-trait/tests/ui/must-use.stderr 2022-03-16 09:33:31.991159827 +0100 +@@ -1,11 +1,11 @@ + error: unused return value of `Interface::f` that must be used +- --> tests/ui/must-use.rs:18:5 ++ --> $DIR/must-use.rs:18:5 + | + 18 | Thing.f(); + | ^^^^^^^^^^ + | + note: the lint level is defined here +- --> tests/ui/must-use.rs:1:9 ++ --> $DIR/must-use.rs:1:9 + | + 1 | #![deny(unused_must_use)] + | ^^^^^^^^^^^^^^^ +diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/self-span.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/self-span.stderr +--- firefox-98.0/third_party/rust/async-trait/tests/ui/self-span.stderr.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/async-trait/tests/ui/self-span.stderr 2022-03-16 09:33:31.991159827 +0100 +@@ -1,5 +1,5 @@ + error[E0308]: mismatched types +- --> tests/ui/self-span.rs:17:21 ++ --> $DIR/self-span.rs:17:21 + | + 17 | let _: () = self; + | -- ^^^^ expected `()`, found struct `S` +@@ -7,13 +7,13 @@ error[E0308]: mismatched types + | expected due to this + + error: the `Self` constructor can only be used with tuple or unit structs +- --> tests/ui/self-span.rs:18:23 ++ --> $DIR/self-span.rs:18:23 + | + 18 | let _: Self = Self; + | ^^^^ help: use curly brackets: `Self { /* fields */ }` + + error[E0308]: mismatched types +- --> tests/ui/self-span.rs:25:21 ++ --> $DIR/self-span.rs:25:21 + | + 25 | let _: () = self; + | -- ^^^^ expected `()`, found enum `E` +@@ -21,7 +21,7 @@ error[E0308]: mismatched types + | expected due to this + + error[E0533]: expected unit struct, unit variant or constant, found struct variant `Self::V` +- --> tests/ui/self-span.rs:26:23 ++ --> $DIR/self-span.rs:26:23 + | + 26 | let _: Self = Self::V; + | ^^^^^^^ +diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/send-not-implemented.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/send-not-implemented.stderr +--- firefox-98.0/third_party/rust/async-trait/tests/ui/send-not-implemented.stderr.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/async-trait/tests/ui/send-not-implemented.stderr 2022-03-16 09:33:31.991159827 +0100 +@@ -1,5 +1,5 @@ + error: future cannot be sent between threads safely +- --> tests/ui/send-not-implemented.rs:8:26 ++ --> $DIR/send-not-implemented.rs:8:26 + | + 8 | async fn test(&self) { + | __________________________^ +@@ -9,9 +9,9 @@ error: future cannot be sent between thr + 12 | | } + | |_____^ future created by async block is not `Send` + | +- = help: within `impl Future`, the trait `Send` is not implemented for `MutexGuard<'_, ()>` ++ = help: within `impl Future`, the trait `Send` is not implemented for `MutexGuard<'_, ()>` + note: future is not `Send` as this value is used across an await +- --> tests/ui/send-not-implemented.rs:11:9 ++ --> $DIR/send-not-implemented.rs:11:9 + | + 10 | let _guard = mutex.lock().unwrap(); + | ------ has type `MutexGuard<'_, ()>` which is not `Send` +@@ -22,7 +22,7 @@ note: future is not `Send` as this value + = note: required for the cast to the object type `dyn Future + Send` + + error: future cannot be sent between threads safely +- --> tests/ui/send-not-implemented.rs:14:38 ++ --> $DIR/send-not-implemented.rs:14:38 + | + 14 | async fn test_ret(&self) -> bool { + | ______________________________________^ +@@ -33,9 +33,9 @@ error: future cannot be sent between thr + 19 | | } + | |_____^ future created by async block is not `Send` + | +- = help: within `impl Future`, the trait `Send` is not implemented for `MutexGuard<'_, ()>` ++ = help: within `impl Future`, the trait `Send` is not implemented for `MutexGuard<'_, ()>` + note: future is not `Send` as this value is used across an await +- --> tests/ui/send-not-implemented.rs:17:9 ++ --> $DIR/send-not-implemented.rs:17:9 + | + 16 | let _guard = mutex.lock().unwrap(); + | ------ has type `MutexGuard<'_, ()>` which is not `Send` +diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/unreachable.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/unreachable.rs +--- firefox-98.0/third_party/rust/async-trait/tests/ui/unreachable.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/async-trait/tests/ui/unreachable.rs 2022-03-16 09:33:31.991159827 +0100 +@@ -12,8 +12,8 @@ pub trait Trait { + #[async_trait] + pub trait TraitFoo { + async fn f() { +- let _y = unimplemented!(); +- let _z = _y; ++ let y = unimplemented!(); ++ let z = y; + } + } + +diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/unreachable.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/unreachable.stderr +--- firefox-98.0/third_party/rust/async-trait/tests/ui/unreachable.stderr.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/async-trait/tests/ui/unreachable.stderr 2022-03-16 09:33:31.991159827 +0100 +@@ -1,13 +1,13 @@ + error: unreachable statement +- --> tests/ui/unreachable.rs:16:9 ++ --> $DIR/unreachable.rs:16:9 + | +-15 | let _y = unimplemented!(); +- | ---------------- any code following this expression is unreachable +-16 | let _z = _y; +- | ^^^^^^^^^^^^ unreachable statement ++15 | let y = unimplemented!(); ++ | ---------------- any code following this expression is unreachable ++16 | let z = y; ++ | ^^^^^^^^^^ unreachable statement + | + note: the lint level is defined here +- --> tests/ui/unreachable.rs:1:9 ++ --> $DIR/unreachable.rs:1:9 + | + 1 | #![deny(warnings)] + | ^^^^^^^^ +diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/unsupported-self.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/unsupported-self.rs +diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/unsupported-self.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/unsupported-self.stderr +--- firefox-98.0/third_party/rust/async-trait/tests/ui/unsupported-self.stderr.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/async-trait/tests/ui/unsupported-self.stderr 2022-03-16 09:33:31.991159827 +0100 +@@ -1,5 +1,5 @@ + error: the `Self` constructor can only be used with tuple or unit structs +- --> tests/ui/unsupported-self.rs:11:17 ++ --> $DIR/unsupported-self.rs:11:17 + | + 11 | let _ = Self; + | ^^^^ +diff -up firefox-98.0/third_party/rust/bitreader/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bitreader/.cargo-checksum.json +--- firefox-98.0/third_party/rust/bitreader/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/bitreader/.cargo-checksum.json 2022-03-16 09:33:31.991159827 +0100 +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"28a1d4b7f04f3989f856789ec569d890a91b9dfdc8775ff8cbd4e0c1b2f8f9f2","LICENSE-APACHE":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30","LICENSE-MIT":"8583712ee2b062ff3d4d6d3e16f19ff0f92bc3a0a4beeec11a81ef00146fbd4f","README.md":"28986de2e8d457e76ae3303d80094697e6ef4ad8da06a4a3178bb1b52bff63d5","src/lib.rs":"250d841ee01b90209c6c4ad304969de145287c6c6588850b95e6f843ec4dd579","src/tests.rs":"5e62c77cfa155fd8affa8ff3c7ea688d80bce6f4956f9956582775ae3adca1a6"},"package":"bd5bf8a17cdc06d475689f9e9226f4b5bf5610e93cf5c3010a518fe6fb0d97f5"} +\ No newline at end of file ++{"files":{"Cargo.toml":"1da2771067c7bb47f182c75624cec456ef99daf6882314633a2a68aefc2616ad","LICENSE-APACHE":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30","LICENSE-MIT":"8583712ee2b062ff3d4d6d3e16f19ff0f92bc3a0a4beeec11a81ef00146fbd4f","README.md":"28986de2e8d457e76ae3303d80094697e6ef4ad8da06a4a3178bb1b52bff63d5","src/lib.rs":"6dcb62a9279ecad8cdcfe37f383282089753e28adc0f2785ca73d50040bc89e7","src/tests.rs":"f67d17aa8faed5e3838322de9b98bb0cdc58d35fe5870e3f5c65ef1ef788966e"},"package":"9178181a7d44239c6c8eaafa8688558a2ab5fa04b8855381f2681e9591fb941b"} +\ No newline at end of file +diff -up firefox-98.0/third_party/rust/bitreader/Cargo.toml.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bitreader/Cargo.toml +--- firefox-98.0/third_party/rust/bitreader/Cargo.toml.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/bitreader/Cargo.toml 2022-03-16 09:33:31.991159827 +0100 +@@ -3,15 +3,16 @@ + # When uploading crates to the registry Cargo will automatically + # "normalize" Cargo.toml files for maximal compatibility + # with all versions of Cargo and also rewrite `path` dependencies +-# to registry (e.g., crates.io) dependencies. ++# to registry (e.g., crates.io) dependencies + # +-# If you are reading this file be aware that the original Cargo.toml +-# will likely look very different (and much more reasonable). +-# See Cargo.toml.orig for the original contents. ++# If you believe there's an error in this file please file an ++# issue against the rust-lang/cargo repository. If you're ++# editing this file be aware that the upstream Cargo.toml ++# will likely look very different (and much more reasonable) + + [package] + name = "bitreader" +-version = "0.3.5" ++version = "0.3.4" + authors = ["Ilkka Rauta "] + description = "BitReader helps reading individual bits from a slice of bytes.\n\nYou can read \"unusual\" numbers of bits from the byte slice, for example 13 bits\nat once. The reader internally keeps track of position within the buffer.\n" + homepage = "https://github.com/irauta/bitreader" +diff -up firefox-98.0/third_party/rust/bitreader/src/lib.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bitreader/src/lib.rs +--- firefox-98.0/third_party/rust/bitreader/src/lib.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/bitreader/src/lib.rs 2022-03-16 09:37:01.761157888 +0100 +@@ -50,7 +50,6 @@ + cfg_if::cfg_if!{ + if #[cfg(feature = "std")] { + extern crate std; +- use std::cmp::min; + use std::prelude::v1::*; + use std::fmt; + use std::error::Error; +@@ -58,7 +57,6 @@ cfg_if::cfg_if!{ + } else { + use core::result; + use core::fmt; +- use core::cmp::min; + } + } + +@@ -71,9 +69,6 @@ pub struct BitReader<'a> { + /// Position from the start of the slice, counted as bits instead of bytes + position: u64, + relative_offset: u64, +- +- /// Length this reader is allowed to read from the slice, counted as bits instead of bytes. +- length: u64, + } + + impl<'a> BitReader<'a> { +@@ -84,7 +79,6 @@ impl<'a> BitReader<'a> { + bytes: bytes, + position: 0, + relative_offset: 0, +- length: bytes.len() as u64 * 8, + } + } + +@@ -115,45 +109,6 @@ impl<'a> BitReader<'a> { + bytes: self.bytes, + position: self.position, + relative_offset: self.position, +- length: self.length - self.position, +- } +- } +- +- /// Returns a copy of current BitReader, with the difference that its position() returns +- /// positions relative to the position of the original BitReader at the construction time, and +- /// will not allow reading more than len bits. After construction, both readers are otherwise +- // completely independent, except of course for sharing the same source data. +- /// +- /// ``` +- /// use bitreader::BitReader; +- /// use bitreader::BitReaderError; +- /// +- /// let bytes = &[0b11110000, 0b00001111]; +- /// let mut original = BitReader::new(bytes); +- /// assert_eq!(original.read_u8(4).unwrap(), 0b1111); +- /// assert_eq!(original.position(), 4); +- /// +- /// let mut relative = original.relative_reader_atmost(8); +- /// assert_eq!(relative.position(), 0); +- /// +- /// assert_eq!(original.read_u8(8).unwrap(), 0); +- /// assert_eq!(relative.read_u8(8).unwrap(), 0); +- /// +- /// assert_eq!(original.position(), 12); +- /// assert_eq!(relative.position(), 8); +- /// +- /// assert_eq!(relative.read_u8(8).unwrap_err(), BitReaderError::NotEnoughData{ +- /// position: 8, +- /// length: 8, +- /// requested: 8 +- /// }); +- /// ``` +- pub fn relative_reader_atmost(&self, len: u64) -> BitReader<'a> { +- BitReader { +- bytes: self.bytes, +- position: self.position, +- relative_offset: self.position, +- length: min(self.length - self.position, len), + } + } + +@@ -175,9 +130,9 @@ impl<'a> BitReader<'a> { + let requested = output_bytes.len() as u64 * 8; + if requested > self.remaining() { + Err(BitReaderError::NotEnoughData { +- position: self.position(), +- length: self.length, +- requested, ++ position: self.position, ++ length: (self.bytes.len() * 8) as u64, ++ requested: requested, + }) + } else { + for byte in output_bytes.iter_mut() { +@@ -266,10 +221,10 @@ impl<'a> BitReader<'a> { + /// Skip arbitrary number of bits. However, you can skip at most to the end of the byte slice. + pub fn skip(&mut self, bit_count: u64) -> Result<()> { + let end_position = self.position + bit_count; +- if end_position > (self.relative_offset + self.length) { ++ if end_position > self.bytes.len() as u64 * 8 { + return Err(BitReaderError::NotEnoughData { +- position: self.position(), +- length: self.length, ++ position: self.position, ++ length: (self.bytes.len() * 8) as u64, + requested: bit_count, + }); + } +@@ -284,7 +239,8 @@ impl<'a> BitReader<'a> { + + /// Returns the number of bits not yet read from the underlying slice. + pub fn remaining(&self) -> u64 { +- self.length - self.position ++ let total_bits = self.bytes.len() as u64 * 8; ++ total_bits - self.position + } + + /// Helper to make sure the "bit cursor" is exactly at the beginning of a byte, or at specific +@@ -335,10 +291,10 @@ impl<'a> BitReader<'a> { + } + let start_position = self.position; + let end_position = self.position + bit_count as u64; +- if end_position > (self.relative_offset + self.length) { ++ if end_position > self.bytes.len() as u64 * 8 { + return Err(BitReaderError::NotEnoughData { +- position: self.position(), +- length: self.length, ++ position: self.position, ++ length: (self.bytes.len() * 8) as u64, + requested: bit_count as u64, + }); + } +@@ -366,13 +322,8 @@ pub type Result = result::Result __m256i { +- _mm256_or_si256(_mm256_srli_epi64(x, 32), _mm256_slli_epi64(x, 64 - 32)) ++ _mm256_shuffle_epi32(x, _MM_SHUFFLE!(2, 3, 0, 1)) + } + + #[inline(always)] + unsafe fn rot24(x: __m256i) -> __m256i { +- _mm256_or_si256(_mm256_srli_epi64(x, 24), _mm256_slli_epi64(x, 64 - 24)) ++ let rotate24 = _mm256_setr_epi8( ++ 3, 4, 5, 6, 7, 0, 1, 2, 11, 12, 13, 14, 15, 8, 9, 10, 3, 4, 5, 6, 7, 0, 1, 2, 11, 12, 13, ++ 14, 15, 8, 9, 10, ++ ); ++ _mm256_shuffle_epi8(x, rotate24) + } + + #[inline(always)] + unsafe fn rot16(x: __m256i) -> __m256i { +- _mm256_or_si256(_mm256_srli_epi64(x, 16), _mm256_slli_epi64(x, 64 - 16)) ++ let rotate16 = _mm256_setr_epi8( ++ 2, 3, 4, 5, 6, 7, 0, 1, 10, 11, 12, 13, 14, 15, 8, 9, 2, 3, 4, 5, 6, 7, 0, 1, 10, 11, 12, ++ 13, 14, 15, 8, 9, ++ ); ++ _mm256_shuffle_epi8(x, rotate16) + } + + #[inline(always)] + unsafe fn rot63(x: __m256i) -> __m256i { +- _mm256_or_si256(_mm256_srli_epi64(x, 63), _mm256_slli_epi64(x, 64 - 63)) ++ _mm256_or_si256(_mm256_srli_epi64(x, 63), add(x, x)) + } + + #[inline(always)] +diff -up firefox-98.0/third_party/rust/blake2b_simd/src/lib.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/blake2b_simd/src/lib.rs +--- firefox-98.0/third_party/rust/blake2b_simd/src/lib.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/blake2b_simd/src/lib.rs 2022-03-16 09:33:31.991159827 +0100 +@@ -1,4 +1,4 @@ +-//! [![GitHub](https://img.shields.io/github/tag/oconnor663/blake2_simd.svg?label=GitHub)](https://github.com/oconnor663/blake2_simd) [![crates.io](https://img.shields.io/crates/v/blake2b_simd.svg)](https://crates.io/crates/blake2b_simd) [![Actions Status](https://github.com/oconnor663/blake2_simd/workflows/tests/badge.svg)](https://github.com/oconnor663/blake2_simd/actions) ++//! [![GitHub](https://img.shields.io/github/tag/oconnor663/blake2_simd.svg?label=GitHub)](https://github.com/oconnor663/blake2_simd) [![crates.io](https://img.shields.io/crates/v/blake2b_simd.svg)](https://crates.io/crates/blake2b_simd) [![Build Status](https://travis-ci.org/oconnor663/blake2_simd.svg?branch=master)](https://travis-ci.org/oconnor663/blake2_simd) + //! + //! An implementation of the BLAKE2b and BLAKE2bp hash functions. See also + //! [`blake2s_simd`](https://docs.rs/blake2s_simd). +diff -up firefox-98.0/third_party/rust/blake2b_simd/src/portable.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/blake2b_simd/src/portable.rs +--- firefox-98.0/third_party/rust/blake2b_simd/src/portable.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/blake2b_simd/src/portable.rs 2022-03-16 09:33:31.991159827 +0100 +@@ -23,9 +23,7 @@ fn g(v: &mut [Word; 16], a: usize, b: us + v[b] = (v[b] ^ v[c]).rotate_right(63); + } + +-// This is too much inlining for some small chips like ARM Cortex-M0, so the +-// uninline_portable feature is provided to disable it. +-#[cfg_attr(not(feature = "uninline_portable"), inline(always))] ++#[inline(always)] + fn round(r: usize, m: &[Word; 16], v: &mut [Word; 16]) { + // Select the message schedule based on the round. + let s = SIGMA[r]; +diff -up firefox-98.0/third_party/rust/blake2b_simd/src/sse41.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/blake2b_simd/src/sse41.rs +--- firefox-98.0/third_party/rust/blake2b_simd/src/sse41.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/blake2b_simd/src/sse41.rs 2022-03-16 09:33:31.991159827 +0100 +@@ -70,33 +70,26 @@ macro_rules! _MM_SHUFFLE { + }; + } + +-// These rotations are the "simple version". For the "complicated version", see +-// https://github.com/sneves/blake2-avx2/blob/b3723921f668df09ece52dcd225a36d4a4eea1d9/blake2b-common.h#L43-L46. +-// For a discussion of the tradeoffs, see +-// https://github.com/sneves/blake2-avx2/pull/5. In short: +-// - Due to an LLVM bug (https://bugs.llvm.org/show_bug.cgi?id=44379), this +-// version performs better on recent x86 chips. +-// - LLVM is able to optimize this version to AVX-512 rotation instructions +-// when those are enabled. +- + #[inline(always)] + unsafe fn rot32(x: __m128i) -> __m128i { +- _mm_or_si128(_mm_srli_epi64(x, 32), _mm_slli_epi64(x, 64 - 32)) ++ _mm_shuffle_epi32(x, _MM_SHUFFLE!(2, 3, 0, 1)) + } + + #[inline(always)] + unsafe fn rot24(x: __m128i) -> __m128i { +- _mm_or_si128(_mm_srli_epi64(x, 24), _mm_slli_epi64(x, 64 - 24)) ++ let rotate24 = _mm_setr_epi8(3, 4, 5, 6, 7, 0, 1, 2, 11, 12, 13, 14, 15, 8, 9, 10); ++ _mm_shuffle_epi8(x, rotate24) + } + + #[inline(always)] + unsafe fn rot16(x: __m128i) -> __m128i { +- _mm_or_si128(_mm_srli_epi64(x, 16), _mm_slli_epi64(x, 64 - 16)) ++ let rotate16 = _mm_setr_epi8(2, 3, 4, 5, 6, 7, 0, 1, 10, 11, 12, 13, 14, 15, 8, 9); ++ _mm_shuffle_epi8(x, rotate16) + } + + #[inline(always)] + unsafe fn rot63(x: __m128i) -> __m128i { +- _mm_or_si128(_mm_srli_epi64(x, 63), _mm_slli_epi64(x, 64 - 63)) ++ _mm_or_si128(_mm_srli_epi64(x, 63), add(x, x)) + } + + #[inline(always)] +diff -up firefox-98.0/third_party/rust/bumpalo/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bumpalo/.cargo-checksum.json +--- firefox-98.0/third_party/rust/bumpalo/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/bumpalo/.cargo-checksum.json 2022-03-16 09:33:31.992159860 +0100 +@@ -1 +1 @@ +-{"files":{"CHANGELOG.md":"31820be449d15a59a3fd124c89c5c5108bd8934fbd1c11d8d31cca3f9b082aee","Cargo.toml":"9a34d33f35a8271f6fed49f54b096ed9dcf80dd899f60205cf58962529abb4b9","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"65f94e99ddaf4f5d1782a6dae23f35d4293a9a01444a13135a6887017d353cee","README.md":"9a3b4407bab9fdf0f4a2acf5c2d3876f4c78fd25f1b8159462f07343a234fc8e","src/alloc.rs":"ab0f23fa11c26efdd8f0596ebdf0e3faa75d097881fb59639b0fb23340c106bc","src/boxed.rs":"a0dcc1b5691e4a445f35fe84be46a938515dfdca1651396b880682547ae91292","src/collections/collect_in.rs":"243799901b950687d6e78220958cfb3484faefefafd5892e03d1564617842812","src/collections/mod.rs":"0fa36a7a5f2b5916b8e3bf4e2804e87c5f7716c87c719a9ab465d377e6272170","src/collections/raw_vec.rs":"11395868cfd0802fab3fe43417751a5755abb516136923e6d8fdbc2f0ff49d19","src/collections/str/lossy.rs":"c5d62b16e01071e2a574ae41ef6693ad12f1e6c786c5d38f7a13ebd6cb23c088","src/collections/str/mod.rs":"d82a8bd417fbf52a589d89a16ea2a0ac4f6ac920c3976ab1f5b6ac0c8493c4f2","src/collections/string.rs":"d4e6c74d7431fa2548ac10290afef6bcdefbf110c6343f0c0244306c11370b8c","src/collections/vec.rs":"d8d997589a7449f14cdd21fb85583f6c94eb0d3ea2c832d3c4c570e92a0a5cdd","src/lib.rs":"835cbcfa2ac45d9d8d40a13258922419027f60c9481e2cbc1b22690edea2f481"},"package":"a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899"} +\ No newline at end of file ++{"files":{"CHANGELOG.md":"fb807cac318c99faa6fe40bcb6ddefd867c2048b9f2badd813281ddc808191b8","Cargo.toml":"74ed9ce9af6ed0be99c388989ab7e919ca1272fdd7e8a0d223506c790a74f1d5","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"65f94e99ddaf4f5d1782a6dae23f35d4293a9a01444a13135a6887017d353cee","README.md":"84d13918b74c4175683118042305b0a4ff90333da9abf214bcf46d9b546ae319","README.tpl":"ec385000e14590a306855e7893daed0168102f33166bdc1e5cf5fa5599dac03f","src/alloc.rs":"ab0f23fa11c26efdd8f0596ebdf0e3faa75d097881fb59639b0fb23340c106bc","src/boxed.rs":"d18d363677a97a73225cb5c5b90e6187f7b5aae93979a41e40417fdd5a3f9975","src/collections/collect_in.rs":"243799901b950687d6e78220958cfb3484faefefafd5892e03d1564617842812","src/collections/mod.rs":"0fa36a7a5f2b5916b8e3bf4e2804e87c5f7716c87c719a9ab465d377e6272170","src/collections/raw_vec.rs":"11395868cfd0802fab3fe43417751a5755abb516136923e6d8fdbc2f0ff49d19","src/collections/str/lossy.rs":"c5d62b16e01071e2a574ae41ef6693ad12f1e6c786c5d38f7a13ebd6cb23c088","src/collections/str/mod.rs":"d82a8bd417fbf52a589d89a16ea2a0ac4f6ac920c3976ab1f5b6ac0c8493c4f2","src/collections/string.rs":"d4e6c74d7431fa2548ac10290afef6bcdefbf110c6343f0c0244306c11370b8c","src/collections/vec.rs":"8f445224c914c7a4f532636798f2b6ac254e650aa58aa57bd61aee1003d7f6af","src/lib.rs":"05bee63bd4bbfcf09a31b6511b5ec3f56ea1e973d079b398ff15d77be9a13d4a"},"package":"8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c"} +\ No newline at end of file +diff -up firefox-98.0/third_party/rust/bumpalo/Cargo.toml.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bumpalo/Cargo.toml +--- firefox-98.0/third_party/rust/bumpalo/Cargo.toml.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/bumpalo/Cargo.toml 2022-03-16 09:33:31.992159860 +0100 +@@ -12,7 +12,7 @@ + [package] + edition = "2018" + name = "bumpalo" +-version = "3.9.1" ++version = "3.8.0" + authors = ["Nick Fitzgerald "] + exclude = ["/.github/*", "/benches", "/tests", "valgrind.supp", "bumpalo.png"] + description = "A fast bump allocation arena for Rust." +diff -up firefox-98.0/third_party/rust/bumpalo/CHANGELOG.md.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bumpalo/CHANGELOG.md +--- firefox-98.0/third_party/rust/bumpalo/CHANGELOG.md.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/bumpalo/CHANGELOG.md 2022-03-16 09:33:31.992159860 +0100 +@@ -28,30 +28,6 @@ Released YYYY-MM-DD. + + -------------------------------------------------------------------------------- + +-## 3.9.1 +- +-Released 2022-01-06. +- +-### Fixed +- +-* Fixed link to logo in docs and README.md +- +--------------------------------------------------------------------------------- +- +-## 3.9.0 +- +-Released 2022-01-05. +- +-### Changed +- +-* The minimum supported Rust version (MSRV) has been raised to Rust 1.54.0. +- +-* `bumpalo::collections::Vec` implements relevant traits for all arrays of +- any size `N` via const generics. Previously, it was just arrays up to length +- 32. Similar for `bumpalo::boxed::Box<[T; N]>`. +- +--------------------------------------------------------------------------------- +- + ## 3.8.0 + + Released 2021-10-19. +diff -up firefox-98.0/third_party/rust/bumpalo/README.md.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bumpalo/README.md +--- firefox-98.0/third_party/rust/bumpalo/README.md.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/bumpalo/README.md 2022-03-16 09:33:31.992159860 +0100 +@@ -1,5 +1,6 @@ + # `bumpalo` + ++ + **A fast bump allocation arena for Rust.** + + [![](https://docs.rs/bumpalo/badge.svg)](https://docs.rs/bumpalo/) +@@ -7,7 +8,7 @@ + [![](https://img.shields.io/crates/d/bumpalo.svg)](https://crates.io/crates/bumpalo) + [![Build Status](https://github.com/fitzgen/bumpalo/workflows/Rust/badge.svg)](https://github.com/fitzgen/bumpalo/actions?query=workflow%3ARust) + +-![](https://github.com/fitzgen/bumpalo/raw/main/bumpalo.png) ++![](https://github.com/fitzgen/bumpalo/raw/master/bumpalo.png) + + ### Bump Allocation + +@@ -32,12 +33,11 @@ pointer back to the start of the arena's + deallocation *extremely* fast, but allocated objects' `Drop` implementations are + not invoked. + +-> **However:** [`bumpalo::boxed::Box`][box] can be used to wrap ++> **However:** [`bumpalo::boxed::Box`][crate::boxed::Box] can be used to wrap + > `T` values allocated in the `Bump` arena, and calls `T`'s `Drop` + > implementation when the `Box` wrapper goes out of scope. This is similar to + > how [`std::boxed::Box`] works, except without deallocating its backing memory. + +-[box]: https://docs.rs/bumpalo/latest/bumpalo/boxed/struct.Box.html + [`std::boxed::Box`]: https://doc.rust-lang.org/std/boxed/struct.Box.html + + ### What happens when the memory chunk is full? +@@ -80,22 +80,19 @@ collection types are modified to allocat + arenas. + + ```rust +-#[cfg(feature = "collections")] +-{ +- use bumpalo::{Bump, collections::Vec}; +- +- // Create a new bump arena. +- let bump = Bump::new(); +- +- // Create a vector of integers whose storage is backed by the bump arena. The +- // vector cannot outlive its backing arena, and this property is enforced with +- // Rust's lifetime rules. +- let mut v = Vec::new_in(&bump); +- +- // Push a bunch of integers onto `v`! +- for i in 0..100 { +- v.push(i); +- } ++use bumpalo::{Bump, collections::Vec}; ++ ++// Create a new bump arena. ++let bump = Bump::new(); ++ ++// Create a vector of integers whose storage is backed by the bump arena. The ++// vector cannot outlive its backing arena, and this property is enforced with ++// Rust's lifetime rules. ++let mut v = Vec::new_in(&bump); ++ ++// Push a bunch of integers onto `v`! ++for i in 0..100 { ++ v.push(i); + } + ``` + +@@ -117,36 +114,33 @@ can use this to work around the fact tha + in its space itself. + + ```rust +-#[cfg(feature = "boxed")] +-{ +- use bumpalo::{Bump, boxed::Box}; +- use std::sync::atomic::{AtomicUsize, Ordering}; +- +- static NUM_DROPPED: AtomicUsize = AtomicUsize::new(0); +- +- struct CountDrops; +- +- impl Drop for CountDrops { +- fn drop(&mut self) { +- NUM_DROPPED.fetch_add(1, Ordering::SeqCst); +- } ++use bumpalo::{Bump, boxed::Box}; ++use std::sync::atomic::{AtomicUsize, Ordering}; ++ ++static NUM_DROPPED: AtomicUsize = AtomicUsize::new(0); ++ ++struct CountDrops; ++ ++impl Drop for CountDrops { ++ fn drop(&mut self) { ++ NUM_DROPPED.fetch_add(1, Ordering::SeqCst); + } ++} + +- // Create a new bump arena. +- let bump = Bump::new(); ++// Create a new bump arena. ++let bump = Bump::new(); + +- // Create a `CountDrops` inside the bump arena. +- let mut c = Box::new_in(CountDrops, &bump); ++// Create a `CountDrops` inside the bump arena. ++let mut c = Box::new_in(CountDrops, &bump); + +- // No `CountDrops` have been dropped yet. +- assert_eq!(NUM_DROPPED.load(Ordering::SeqCst), 0); ++// No `CountDrops` have been dropped yet. ++assert_eq!(NUM_DROPPED.load(Ordering::SeqCst), 0); + +- // Drop our `Box`. +- drop(c); ++// Drop our `Box`. ++drop(c); + +- // Its `Drop` implementation was run, and so `NUM_DROPS` has been incremented. +- assert_eq!(NUM_DROPPED.load(Ordering::SeqCst), 1); +-} ++// Its `Drop` implementation was run, and so `NUM_DROPS` has been incremented. ++assert_eq!(NUM_DROPPED.load(Ordering::SeqCst), 1); + ``` + + ### `#![no_std]` Support +@@ -180,14 +174,14 @@ bumpalo = { version = "3.4.0", features + + Next, enable the `allocator_api` nightly Rust feature in your `src/lib.rs` or `src/main.rs`: + +-```rust,ignore ++```rust + #![feature(allocator_api)] + ``` + + Finally, use `std` collections with `Bump`, so that their internal heap + allocations are made within the given bump arena: + +-```rust,ignore ++```rust + #![feature(allocator_api)] + use bumpalo::Bump; + +@@ -203,8 +197,9 @@ v.push(2); + + #### Minimum Supported Rust Version (MSRV) + +-This crate is guaranteed to compile on stable Rust **1.54** and up. It might +-compile with older versions but that may change in any new patch release. ++This crate is guaranteed to compile on stable Rust 1.44 and up. It might compile ++with older versions but that may change in any new patch release. + + We reserve the right to increment the MSRV on minor releases, however we will strive + to only do it deliberately and for good reasons. ++ +diff -up firefox-98.0/third_party/rust/bumpalo/README.tpl.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bumpalo/README.tpl +--- firefox-98.0/third_party/rust/bumpalo/README.tpl.crossbeam-downgrade-rhbz2063961 2022-03-16 09:33:31.992159860 +0100 ++++ firefox-98.0/third_party/rust/bumpalo/README.tpl 2022-03-16 09:33:31.992159860 +0100 +@@ -0,0 +1,3 @@ ++# `{{crate}}` ++ ++{{readme}} +diff -up firefox-98.0/third_party/rust/bumpalo/src/boxed.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bumpalo/src/boxed.rs +--- firefox-98.0/third_party/rust/bumpalo/src/boxed.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/bumpalo/src/boxed.rs 2022-03-16 09:33:31.992159860 +0100 +@@ -647,25 +647,39 @@ impl<'a, F: ?Sized + Future + Unpin> Fut + } + } + +-/// This impl replaces unsize coercion. +-impl<'a, T, const N: usize> From> for Box<'a, [T]> { +- fn from(mut arr: Box<'a, [T; N]>) -> Box<'a, [T]> { +- let ptr = core::ptr::slice_from_raw_parts_mut(arr.as_mut_ptr(), N); +- mem::forget(arr); +- unsafe { Box::from_raw(ptr) } ++macro_rules! array_impls { ++ ($($N: expr)+) => { ++ $( ++ /// This impl replaces unsize coercion. ++ impl<'a, T> From> for Box<'a, [T]> { ++ fn from(mut arr: Box<'a, [T; $N]>) -> Box<'a, [T]> { ++ let ptr = core::ptr::slice_from_raw_parts_mut(arr.as_mut_ptr(), $N); ++ mem::forget(arr); ++ unsafe { Box::from_raw(ptr) } ++ } ++ } ++ ++ ++ /// This impl replaces unsize coercion. ++ impl<'a, T> TryFrom> for Box<'a, [T; $N]> { ++ type Error = Box<'a, [T]>; ++ fn try_from(mut slice: Box<'a, [T]>) -> Result, Box<'a, [T]>> { ++ if slice.len() == $N { ++ let ptr = slice.as_mut_ptr() as *mut [T; $N]; ++ mem::forget(slice); ++ Ok(unsafe { Box::from_raw(ptr) }) ++ } else { ++ Err(slice) ++ } ++ } ++ } ++ )+ + } + } + +-/// This impl replaces unsize coercion. +-impl<'a, T, const N: usize> TryFrom> for Box<'a, [T; N]> { +- type Error = Box<'a, [T]>; +- fn try_from(mut slice: Box<'a, [T]>) -> Result, Box<'a, [T]>> { +- if slice.len() == N { +- let ptr = slice.as_mut_ptr() as *mut [T; N]; +- mem::forget(slice); +- Ok(unsafe { Box::from_raw(ptr) }) +- } else { +- Err(slice) +- } +- } ++array_impls! { ++ 0 1 2 3 4 5 6 7 8 9 ++ 10 11 12 13 14 15 16 17 18 19 ++ 20 21 22 23 24 25 26 27 28 29 ++ 30 31 32 + } +diff -up firefox-98.0/third_party/rust/bumpalo/src/collections/vec.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bumpalo/src/collections/vec.rs +--- firefox-98.0/third_party/rust/bumpalo/src/collections/vec.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/bumpalo/src/collections/vec.rs 2022-03-16 09:33:31.992159860 +0100 +@@ -1983,23 +1983,26 @@ __impl_slice_eq1! { Vec<'a, A>, &'b [B] + __impl_slice_eq1! { Vec<'a, A>, &'b mut [B] } + // __impl_slice_eq1! { Cow<'a, [A]>, Vec<'b, B>, Clone } + +-macro_rules! __impl_slice_eq1_array { +- ($Lhs: ty, $Rhs: ty) => { +- impl<'a, 'b, A, B, const N: usize> PartialEq<$Rhs> for $Lhs +- where +- A: PartialEq, +- { +- #[inline] +- fn eq(&self, other: &$Rhs) -> bool { +- self[..] == other[..] +- } +- } +- }; +-} +- +-__impl_slice_eq1_array! { Vec<'a, A>, [B; N] } +-__impl_slice_eq1_array! { Vec<'a, A>, &'b [B; N] } +-__impl_slice_eq1_array! { Vec<'a, A>, &'b mut [B; N] } ++macro_rules! array_impls { ++ ($($N: expr)+) => { ++ $( ++ // NOTE: some less important impls are omitted to reduce code bloat ++ __impl_slice_eq1! { Vec<'a, A>, [B; $N] } ++ __impl_slice_eq1! { Vec<'a, A>, &'b [B; $N] } ++ // __impl_slice_eq1! { Vec, &'b mut [B; $N] } ++ // __impl_slice_eq1! { Cow<'a, [A]>, [B; $N], Clone } ++ // __impl_slice_eq1! { Cow<'a, [A]>, &'b [B; $N], Clone } ++ // __impl_slice_eq1! { Cow<'a, [A]>, &'b mut [B; $N], Clone } ++ )+ ++ } ++} ++ ++array_impls! { ++ 0 1 2 3 4 5 6 7 8 9 ++ 10 11 12 13 14 15 16 17 18 19 ++ 20 21 22 23 24 25 26 27 28 29 ++ 30 31 32 ++} + + /// Implements comparison of vectors, lexicographically. + impl<'bump, T: 'bump + PartialOrd> PartialOrd for Vec<'bump, T> { +@@ -2070,18 +2073,6 @@ impl<'bump, T: 'bump> BorrowMut<[T]> for + } + } + +-impl<'bump, T> Drop for Vec<'bump, T> { +- fn drop(&mut self) { +- unsafe { +- // use drop for [T] +- // use a raw slice to refer to the elements of the vector as weakest necessary type; +- // could avoid questions of validity in certain cases +- ptr::drop_in_place(ptr::slice_from_raw_parts_mut(self.as_mut_ptr(), self.len)) +- } +- // RawVec handles deallocation +- } +-} +- + //////////////////////////////////////////////////////////////////////////////// + // Clone-on-write + //////////////////////////////////////////////////////////////////////////////// +diff -up firefox-98.0/third_party/rust/bumpalo/src/lib.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bumpalo/src/lib.rs +--- firefox-98.0/third_party/rust/bumpalo/src/lib.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/bumpalo/src/lib.rs 2022-03-16 09:33:31.992159860 +0100 +@@ -1,4 +1,222 @@ +-#![doc = include_str!("../README.md")] ++/*! ++ ++**A fast bump allocation arena for Rust.** ++ ++[![](https://docs.rs/bumpalo/badge.svg)](https://docs.rs/bumpalo/) ++[![](https://img.shields.io/crates/v/bumpalo.svg)](https://crates.io/crates/bumpalo) ++[![](https://img.shields.io/crates/d/bumpalo.svg)](https://crates.io/crates/bumpalo) ++[![Build Status](https://github.com/fitzgen/bumpalo/workflows/Rust/badge.svg)](https://github.com/fitzgen/bumpalo/actions?query=workflow%3ARust) ++ ++![](https://github.com/fitzgen/bumpalo/raw/master/bumpalo.png) ++ ++## Bump Allocation ++ ++Bump allocation is a fast, but limited approach to allocation. We have a chunk ++of memory, and we maintain a pointer within that memory. Whenever we allocate an ++object, we do a quick test that we have enough capacity left in our chunk to ++allocate the object and then update the pointer by the object's size. *That's ++it!* ++ ++The disadvantage of bump allocation is that there is no general way to ++deallocate individual objects or reclaim the memory region for a ++no-longer-in-use object. ++ ++These trade offs make bump allocation well-suited for *phase-oriented* ++allocations. That is, a group of objects that will all be allocated during the ++same program phase, used, and then can all be deallocated together as a group. ++ ++## Deallocation en Masse, but No `Drop` ++ ++To deallocate all the objects in the arena at once, we can simply reset the bump ++pointer back to the start of the arena's memory chunk. This makes mass ++deallocation *extremely* fast, but allocated objects' `Drop` implementations are ++not invoked. ++ ++> **However:** [`bumpalo::boxed::Box`][crate::boxed::Box] can be used to wrap ++> `T` values allocated in the `Bump` arena, and calls `T`'s `Drop` ++> implementation when the `Box` wrapper goes out of scope. This is similar to ++> how [`std::boxed::Box`] works, except without deallocating its backing memory. ++ ++[`std::boxed::Box`]: https://doc.rust-lang.org/std/boxed/struct.Box.html ++ ++## What happens when the memory chunk is full? ++ ++This implementation will allocate a new memory chunk from the global allocator ++and then start bump allocating into this new memory chunk. ++ ++## Example ++ ++``` ++use bumpalo::Bump; ++use std::u64; ++ ++struct Doggo { ++ cuteness: u64, ++ age: u8, ++ scritches_required: bool, ++} ++ ++// Create a new arena to bump allocate into. ++let bump = Bump::new(); ++ ++// Allocate values into the arena. ++let scooter = bump.alloc(Doggo { ++ cuteness: u64::max_value(), ++ age: 8, ++ scritches_required: true, ++}); ++ ++// Exclusive, mutable references to the just-allocated value are returned. ++assert!(scooter.scritches_required); ++scooter.age += 1; ++``` ++ ++## Collections ++ ++When the `"collections"` cargo feature is enabled, a fork of some of the `std` ++library's collections are available in the `collections` module. These ++collection types are modified to allocate their space inside `bumpalo::Bump` ++arenas. ++ ++```rust ++# #[cfg(feature = "collections")] ++# { ++use bumpalo::{Bump, collections::Vec}; ++ ++// Create a new bump arena. ++let bump = Bump::new(); ++ ++// Create a vector of integers whose storage is backed by the bump arena. The ++// vector cannot outlive its backing arena, and this property is enforced with ++// Rust's lifetime rules. ++let mut v = Vec::new_in(&bump); ++ ++// Push a bunch of integers onto `v`! ++for i in 0..100 { ++ v.push(i); ++} ++# } ++``` ++ ++Eventually [all `std` collection types will be parameterized by an ++allocator](https://github.com/rust-lang/rust/issues/42774) and we can remove ++this `collections` module and use the `std` versions. ++ ++For unstable, nightly-only support for custom allocators in `std`, see the ++`allocator_api` section below. ++ ++## `bumpalo::boxed::Box` ++ ++When the `"boxed"` cargo feature is enabled, a fork of `std::boxed::Box` library ++is available in the `boxed` module. This `Box` type is modified to allocate its ++space inside `bumpalo::Bump` arenas. ++ ++**A `Box` runs `T`'s drop implementation when the `Box` is dropped.** You ++can use this to work around the fact that `Bump` does not drop values allocated ++in its space itself. ++ ++```rust ++# #[cfg(feature = "boxed")] ++# { ++use bumpalo::{Bump, boxed::Box}; ++use std::sync::atomic::{AtomicUsize, Ordering}; ++ ++static NUM_DROPPED: AtomicUsize = AtomicUsize::new(0); ++ ++struct CountDrops; ++ ++impl Drop for CountDrops { ++ fn drop(&mut self) { ++ NUM_DROPPED.fetch_add(1, Ordering::SeqCst); ++ } ++} ++ ++// Create a new bump arena. ++let bump = Bump::new(); ++ ++// Create a `CountDrops` inside the bump arena. ++let mut c = Box::new_in(CountDrops, &bump); ++ ++// No `CountDrops` have been dropped yet. ++assert_eq!(NUM_DROPPED.load(Ordering::SeqCst), 0); ++ ++// Drop our `Box`. ++drop(c); ++ ++// Its `Drop` implementation was run, and so `NUM_DROPS` has been incremented. ++assert_eq!(NUM_DROPPED.load(Ordering::SeqCst), 1); ++# } ++``` ++ ++## `#![no_std]` Support ++ ++Bumpalo is a `no_std` crate. It depends only on the `alloc` and `core` crates. ++ ++## Thread support ++ ++The `Bump` is `!Sync`, which makes it hard to use in certain situations around threads ‒ for ++example in `rayon`. ++ ++The [`bumpalo-herd`](https://crates.io/crates/bumpalo-herd) crate provides a pool of `Bump` ++allocators for use in such situations. ++ ++## Nightly Rust `feature(allocator_api)` Support ++ ++The unstable, nightly-only Rust `allocator_api` feature defines an `Allocator` ++trait and exposes custom allocators for `std` types. Bumpalo has a matching ++`allocator_api` cargo feature to enable implementing `Allocator` and using ++`Bump` with `std` collections. Note that, as `feature(allocator_api)` is ++unstable and only in nightly Rust, Bumpalo's matching `allocator_api` cargo ++feature should be considered unstable, and will not follow the semver ++conventions that the rest of the crate does. ++ ++First, enable the `allocator_api` feature in your `Cargo.toml`: ++ ++```toml ++[dependencies] ++bumpalo = { version = "3.4.0", features = ["allocator_api"] } ++``` ++ ++Next, enable the `allocator_api` nightly Rust feature in your `src/lib.rs` or `src/main.rs`: ++ ++```rust ++# #[cfg(feature = "allocator_api")] ++# { ++#![feature(allocator_api)] ++# } ++``` ++ ++Finally, use `std` collections with `Bump`, so that their internal heap ++allocations are made within the given bump arena: ++ ++``` ++# #![cfg_attr(feature = "allocator_api", feature(allocator_api))] ++# #[cfg(feature = "allocator_api")] ++# { ++#![feature(allocator_api)] ++use bumpalo::Bump; ++ ++// Create a new bump arena. ++let bump = Bump::new(); ++ ++// Create a `Vec` whose elements are allocated within the bump arena. ++let mut v = Vec::new_in(&bump); ++v.push(0); ++v.push(1); ++v.push(2); ++# } ++``` ++ ++### Minimum Supported Rust Version (MSRV) ++ ++This crate is guaranteed to compile on stable Rust 1.44 and up. It might compile ++with older versions but that may change in any new patch release. ++ ++We reserve the right to increment the MSRV on minor releases, however we will strive ++to only do it deliberately and for good reasons. ++ ++ */ ++ + #![deny(missing_debug_implementations)] + #![deny(missing_docs)] + #![no_std] +@@ -202,7 +420,7 @@ impl Display for AllocOrInit + /// + /// Even when optimizations are on, these functions do not **guarantee** that + /// the value is constructed on the heap. To the best of our knowledge no such +-/// guarantee can be made in stable Rust as of 1.51. ++/// guarantee can be made in stable Rust as of 1.44. + /// + /// ### Fallible Initialization: The `_try_with` Method Suffix + /// +diff -up firefox-98.0/third_party/rust/cache-padded/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/cache-padded/.cargo-checksum.json +--- firefox-98.0/third_party/rust/cache-padded/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/cache-padded/.cargo-checksum.json 2022-03-16 09:33:31.992159860 +0100 +@@ -1 +1 @@ +-{"files":{"CHANGELOG.md":"01efe9c9a75e5a305dac0e12676ed451f746049a825aa86acef0d8ee90742f71","Cargo.toml":"ea55c73cacac2dcc3bdcb2c657e057d9b73214e76f8654799236b13c853e97bd","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"61d450a57f8699dfc1c39e3bb69236f7d10f31f4503b03aa8b2b37b2448b8b69","src/lib.rs":"4bcb45fe37cdca78ba0e403d9e531102c521ad42e9ffd2ecbb154b4509864978","tests/padding.rs":"120cc65d1fcebbdb0ed8b0c287680ede2483e3ab040746e1a3616ffb39d8f414"},"package":"c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c"} +\ No newline at end of file ++{"files":{"CHANGELOG.md":"50d6fbb00aa801cffefd2ecbbb43bba8686925658b3bf5e304b5af735f90bf08","Cargo.toml":"7ff90cd0fd3bc7449b8f55dea7de4d7d51f7c11948119512a274369733a94321","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"106c91d873d7c2681ca6264195737d7f2ea73f91cc74dd4c200f3fe9c5ea4907","src/lib.rs":"d2b1a7280c5cb8c1e946a5839862a1496749c445851f7ed196debf8386a4e646","tests/padding.rs":"120cc65d1fcebbdb0ed8b0c287680ede2483e3ab040746e1a3616ffb39d8f414"},"package":"631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba"} +\ No newline at end of file +diff -up firefox-98.0/third_party/rust/cache-padded/Cargo.toml.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/cache-padded/Cargo.toml +--- firefox-98.0/third_party/rust/cache-padded/Cargo.toml.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/cache-padded/Cargo.toml 2022-03-16 09:33:31.992159860 +0100 +@@ -3,20 +3,23 @@ + # When uploading crates to the registry Cargo will automatically + # "normalize" Cargo.toml files for maximal compatibility + # with all versions of Cargo and also rewrite `path` dependencies +-# to registry (e.g., crates.io) dependencies. ++# to registry (e.g., crates.io) dependencies + # +-# If you are reading this file be aware that the original Cargo.toml +-# will likely look very different (and much more reasonable). +-# See Cargo.toml.orig for the original contents. ++# If you believe there's an error in this file please file an ++# issue against the rust-lang/cargo repository. If you're ++# editing this file be aware that the upstream Cargo.toml ++# will likely look very different (and much more reasonable) + + [package] + edition = "2018" + name = "cache-padded" +-version = "1.2.0" ++version = "1.1.1" + authors = ["Stjepan Glavina "] + description = "Prevent false sharing by padding and aligning to the length of a cache line" +-homepage = "https://github.com/smol-rs/cache-padded" ++homepage = "https://github.com/stjepang/cache-padded" ++documentation = "https://docs.rs/cache-padded" ++readme = "README.md" + keywords = ["cache", "padding", "lock-free", "atomic"] + categories = ["concurrency", "no-std"] + license = "Apache-2.0 OR MIT" +-repository = "https://github.com/smol-rs/cache-padded" ++repository = "https://github.com/stjepang/cache-padded" +diff -up firefox-98.0/third_party/rust/cache-padded/CHANGELOG.md.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/cache-padded/CHANGELOG.md +--- firefox-98.0/third_party/rust/cache-padded/CHANGELOG.md.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/cache-padded/CHANGELOG.md 2022-03-16 09:33:31.992159860 +0100 +@@ -1,7 +1,3 @@ +-# Version 1.2.0 +- +-- Improve implementation of `CachePadded`. +- + # Version 1.1.1 + + - Forbid unsafe code. +diff -up firefox-98.0/third_party/rust/cache-padded/README.md.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/cache-padded/README.md +--- firefox-98.0/third_party/rust/cache-padded/README.md.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/cache-padded/README.md 2022-03-16 09:33:31.992159860 +0100 +@@ -1,9 +1,9 @@ + # cache-padded + +-[![Build](https://github.com/smol-rs/cache-padded/workflows/Build%20and%20test/badge.svg)]( +-https://github.com/smol-rs/cache-padded/actions) +-[![License](https://img.shields.io/badge/license-Apache--2.0_OR_MIT-blue.svg)]( +-https://github.com/smol-rs/cache-padded) ++[![Build](https://github.com/stjepang/cache-padded/workflows/Build%20and%20test/badge.svg)]( ++https://github.com/stjepang/cache-padded/actions) ++[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)]( ++https://github.com/stjepang/cache-padded) + [![Cargo](https://img.shields.io/crates/v/cache-padded.svg)]( + https://crates.io/crates/cache-padded) + [![Documentation](https://docs.rs/cache-padded/badge.svg)]( +diff -up firefox-98.0/third_party/rust/cache-padded/src/lib.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/cache-padded/src/lib.rs +--- firefox-98.0/third_party/rust/cache-padded/src/lib.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/cache-padded/src/lib.rs 2022-03-16 09:33:31.993159893 +0100 +@@ -1,7 +1,7 @@ + //! Prevent false sharing by padding and aligning to the length of a cache line. + //! + //! In concurrent programming, sometimes it is desirable to make sure commonly accessed shared data +-//! is not all placed into the same cache line. Updating an atomic value invalidates the whole cache ++//! is not all placed into the same cache line. Updating an atomic value invalides the whole cache + //! line it belongs to, which makes the next access to the same cache line slower for other CPU + //! cores. Use [`CachePadded`] to ensure updating one piece of data doesn't invalidate other cached + //! data. +@@ -10,9 +10,8 @@ + //! + //! Cache lines are assumed to be N bytes long, depending on the architecture: + //! +-//! * On x86-64, aarch64, and powerpc64, N = 128. +-//! * On arm, mips, mips64, and riscv64, N = 32. +-//! * On s390x, N = 256. ++//! * On x86-64 and aarch64, N = 128. ++//! * On all others, N = 64. + //! + //! Note that N is just a reasonable guess and is not guaranteed to match the actual cache line + //! length of the machine the program is running on. +@@ -68,63 +67,14 @@ use core::ops::{Deref, DerefMut}; + // - https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-optimization-manual.pdf + // - https://github.com/facebook/folly/blob/1b5288e6eea6df074758f877c849b6e73bbb9fbb/folly/lang/Align.h#L107 + // +-// ARM's big.LITTLE architecture has asymmetric cores and "big" cores have 128-byte cache line size. ++// ARM's big.LITTLE architecture has asymmetric cores and "big" cores have 128-byte cache lines. + // + // Sources: + // - https://www.mono-project.com/news/2016/09/12/arm64-icache/ + // +-// powerpc64 has 128-byte cache line size. +-// +-// Sources: +-// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_ppc64x.go#L9 +-#[cfg_attr( +- any( +- target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "powerpc64", +- ), +- repr(align(128)) +-)] +-// arm, mips, mips64, and riscv64 have 32-byte cache line size. +-// +-// Sources: +-// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_arm.go#L7 +-// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_mips.go#L7 +-// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_mipsle.go#L7 +-// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_mips64x.go#L9 +-// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_riscv64.go#L7 +-#[cfg_attr( +- any( +- target_arch = "arm", +- target_arch = "mips", +- target_arch = "mips64", +- target_arch = "riscv64", +- ), +- repr(align(32)) +-)] +-// s390x has 256-byte cache line size. +-// +-// Sources: +-// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_s390x.go#L7 +-#[cfg_attr(target_arch = "s390x", repr(align(256)))] +-// x86 and wasm have 64-byte cache line size. +-// +-// Sources: +-// - https://github.com/golang/go/blob/dda2991c2ea0c5914714469c4defc2562a907230/src/internal/cpu/cpu_x86.go#L9 +-// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_wasm.go#L7 +-// +-// All others are assumed to have 64-byte cache line size. ++#[cfg_attr(any(target_arch = "x86_64", target_arch = "aarch64"), repr(align(128)))] + #[cfg_attr( +- not(any( +- target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "powerpc64", +- target_arch = "arm", +- target_arch = "mips", +- target_arch = "mips64", +- target_arch = "riscv64", +- target_arch = "s390x", +- )), ++ not(any(target_arch = "x86_64", target_arch = "aarch64")), + repr(align(64)) + )] + #[derive(Clone, Copy, Default, Hash, PartialEq, Eq)] +diff -up firefox-98.0/third_party/rust/crossbeam-channel/benches/crossbeam.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/benches/crossbeam.rs +--- firefox-98.0/third_party/rust/crossbeam-channel/benches/crossbeam.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/benches/crossbeam.rs 2022-03-16 09:33:31.993159893 +0100 +@@ -13,7 +13,7 @@ mod unbounded { + + #[bench] + fn create(b: &mut Bencher) { +- b.iter(unbounded::); ++ b.iter(|| unbounded::()); + } + + #[bench] +diff -up firefox-98.0/third_party/rust/crossbeam-channel/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/.cargo-checksum.json +--- firefox-98.0/third_party/rust/crossbeam-channel/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/.cargo-checksum.json 2022-03-16 09:33:31.993159893 +0100 +@@ -1 +1 @@ +-{"files":{"CHANGELOG.md":"e70d1a5fa6697a8b24e193e3934975317df12279c167b90fcb9616291792197c","Cargo.lock":"0f4e59f28bdd52c4781d102fc7d1f16d1ea417aaec0a4846432444a4019b2537","Cargo.toml":"c8334f658b699a1a0e25d997d752a9493a627f9ddcb7aab739c7319ea583882f","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"5734ed989dfca1f625b40281ee9f4530f91b2411ec01cb748223e7eb87e201ab","LICENSE-THIRD-PARTY":"b16db96b93b1d7cf7bea533f572091ec6bca3234fbe0a83038be772ff391a44c","README.md":"415a71d4978cfd338a6ae1f1b41284652eccd277a815542c304647dc437a8274","benches/crossbeam.rs":"96cb1abd23cac3ef8a7174a802e94609926b555bb02c9658c78723d433f1dd92","examples/fibonacci.rs":"4e88fa40048cdc31e9c7bb60347d46f92543d7ddf39cab3b52bfe44affdb6a02","examples/matching.rs":"63c250e164607a7a9f643d46f107bb5da846d49e89cf9069909562d20e530f71","examples/stopwatch.rs":"d02121258f08d56f1eb7997e19bcb9bacb6836cfa0abbba90a9e59d8a50ae5cf","src/channel.rs":"a9baaad2f414c38cd324a60ac9375ca58462ce6662217683648e9b66cec43a8c","src/context.rs":"ff4d39639ddf16aaab582d4a5f3d10ef2c71afe1abbf4e60f3d9d2ddbd72c230","src/counter.rs":"c49a9f44587888850edeb62f7c8ecd1acecb39c836834254ff3ac934c478440a","src/err.rs":"fdbde7279a1e74973e5c7d3e835a97836229a357fe465c0ba1a37f2a012d1bef","src/flavors/array.rs":"853c2ad068f912cfb49877bcd41e241f34b25026b709bf0629523f19952e3adc","src/flavors/at.rs":"65bf870b3ddb14738256706b0276f2656ad1fe9cd8eb91737489868edd088e92","src/flavors/list.rs":"50dbe59616c39b5aa184470023ce0cfb1cb0dbd92e1577375d299446981527c0","src/flavors/mod.rs":"3d9d43bc38b0adb18c96c995c2bd3421d8e33ab6c30b20c3c467d21d48e485dc","src/flavors/never.rs":"0e7921922d00c711552fb063c63c78192fa6ddc0762fb81c1713b847495ec39a","src/flavors/tick.rs":"38a479b9f4a72a5ccb9c407a1e7b44d36b6ad0f4e214e39266b12b9564c803dc","src/flavors/zero.rs":"012a53f56b86df22ce49866da95e5f457fb99a18a098f0f64779c6d1cdd7092f","src/lib.rs":"3a65706d4124844ffc4c8cb1f8cc779631ec94f449f85cbb68364ad3619404f1","src/select.rs":"66eb10a6cbdf8dd0869f2a7cac9992fdaee36c9e2a01d708d39d7c794572935b","src/select_macro.rs":"96bc9acb9a22588a4e733b0ab0761ad2be9a6b3e03744e8fc9c6de9ae433b696","src/utils.rs":"746fe315d6cfc832e3dda35e5055c0fd5c99907f1303b2ea7eacc4e37c8527e1","src/waker.rs":"591ee70bf62ccad5aa2fac7b92d444183b02790a79c024f016c78de2396d08a3","tests/after.rs":"0154a8e152880db17a20514ecdd49dabc361d3629858d119b9746b5e932c780c","tests/array.rs":"e5f25e8991863a9a86d61a66be646d04feae527f35b1697fd215b97af4383736","tests/golang.rs":"dc85669c9c4e902b1bb263d00f5cb6f9ecb6d42b19fe53425b55ce97c887da49","tests/iter.rs":"25dc02135bbae9d47a30f9047661648e66bdc134e40ba78bc2fbacbb8b3819bc","tests/list.rs":"de865ef097f3bcb35c1c814554e6108fed43b3dbb1533c8bbcf8688cceb6b6ab","tests/mpsc.rs":"401aa3c6923815058881ddce98070df68ebab283913c89c007436bb8af7ca0ea","tests/never.rs":"ee40c4fc4dd5af4983fae8de6927f52b81174d222c162f745b26c4a6c7108e4f","tests/ready.rs":"d349702f123925a0781b48d677e6dcf64fc5d1fc788a7bf1e151a3d57e81871c","tests/same_channel.rs":"2bab761443671e841e1b2476bd8082d75533a2f6be7946f5dbcee67cdc82dccb","tests/select.rs":"d20259a45f387cbce80c2c876ae81ea3883f36ea01c5151c159d58c362f6ba07","tests/select_macro.rs":"d3af2dc98e0dd03dc4ffab464b8ccb2f8b7504e8bb830948a04c015b92f0b296","tests/thread_locals.rs":"a1ce59e2aff69161621c0cb215eb6ea238088c06a31a8507a74cf179fd5a4299","tests/tick.rs":"5f697bd14c48505d932e82065b5302ef668e1cc19cac18e8ac22e0c83c221c1d","tests/zero.rs":"afbd838001d4196daddf17133e60ccea31529cc48ee01e245ac0d6366d1e30b9"},"package":"e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa"} +\ No newline at end of file ++{"files":{"CHANGELOG.md":"74ac49b84461217698d4430f81b1cdcba0595bc4e57216ffc52b8296ac44cd41","Cargo.lock":"7956079bcac40cc40c894f0260266365ecdb1c01c48636ae4c4080977603e7b8","Cargo.toml":"6a7acaffaa30dab2b5ea1f5ab86b20bc97370314ed03472288745b3b969786dc","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"5734ed989dfca1f625b40281ee9f4530f91b2411ec01cb748223e7eb87e201ab","LICENSE-THIRD-PARTY":"b16db96b93b1d7cf7bea533f572091ec6bca3234fbe0a83038be772ff391a44c","README.md":"415a71d4978cfd338a6ae1f1b41284652eccd277a815542c304647dc437a8274","benches/crossbeam.rs":"f5720508d3458f2451271b9887f7557823304bd38288c928b0d6aa1f459865e5","examples/fibonacci.rs":"6a26ecd74c7493d2c93f4280c0804afc19adc612b77b3d9fea433119ff472a44","examples/matching.rs":"63c250e164607a7a9f643d46f107bb5da846d49e89cf9069909562d20e530f71","examples/stopwatch.rs":"f9a00477b41823199e4af06bddeb0c6cfd22e272340eec1b98b333fc59ee6a1f","src/channel.rs":"a9baaad2f414c38cd324a60ac9375ca58462ce6662217683648e9b66cec43a8c","src/context.rs":"ad24cabfc50dd5e6ae84aa46a0246da12da1f1a6fa19043244ad25136075c6ca","src/counter.rs":"c49a9f44587888850edeb62f7c8ecd1acecb39c836834254ff3ac934c478440a","src/err.rs":"fdbde7279a1e74973e5c7d3e835a97836229a357fe465c0ba1a37f2a012d1bef","src/flavors/array.rs":"c125146771265058ac320226456b1e21667e93649531a3d20157f71cd715881d","src/flavors/at.rs":"65bf870b3ddb14738256706b0276f2656ad1fe9cd8eb91737489868edd088e92","src/flavors/list.rs":"50dbe59616c39b5aa184470023ce0cfb1cb0dbd92e1577375d299446981527c0","src/flavors/mod.rs":"3d9d43bc38b0adb18c96c995c2bd3421d8e33ab6c30b20c3c467d21d48e485dc","src/flavors/never.rs":"0e7921922d00c711552fb063c63c78192fa6ddc0762fb81c1713b847495ec39a","src/flavors/tick.rs":"38a479b9f4a72a5ccb9c407a1e7b44d36b6ad0f4e214e39266b12b9564c803dc","src/flavors/zero.rs":"1bda0c5483b04d53f36f9f4a6fe6f87b69f698068771e637e224c09400c6ce83","src/lib.rs":"3a65706d4124844ffc4c8cb1f8cc779631ec94f449f85cbb68364ad3619404f1","src/select.rs":"4eb4b1988c5dffff3e3d2138d14a1b86613bf62b78c45a5c70f65aaee92c11bb","src/select_macro.rs":"96bc9acb9a22588a4e733b0ab0761ad2be9a6b3e03744e8fc9c6de9ae433b696","src/utils.rs":"746fe315d6cfc832e3dda35e5055c0fd5c99907f1303b2ea7eacc4e37c8527e1","src/waker.rs":"9058cc441d467539c439ef88f0be1a187bf122d26fc116ce3e3a0265a693761f","tests/after.rs":"324c7d773f72bef62d150171f74ba7b7ac1b06f6030b3d4d2b1a35d211956b21","tests/array.rs":"574bff53aff0b0a8c365bf3f9ad77bb64675df9e6e0714be9c16eeeeac22e4d5","tests/golang.rs":"ec03806945fecd381cfce0634e2d776741423589c92e1bd4d8a431ac20f5d2d0","tests/iter.rs":"7563dc7fdf4c63e31dd74ee3fedecdd3aed490f7ef599b98f6f75f929cf79edb","tests/list.rs":"cc2971e69fd7f6a94b5463c9d4e9079df7955b37552e16dd66f4c6e65db60d96","tests/mpsc.rs":"0c4c6b056f5cec77ca19eca45f99b083632700a4b67133e88071a1d22a61d6fe","tests/never.rs":"665441a9fb004f7cd44047619637ebe6766cf2faf58e68e6481397bbfc682e11","tests/ready.rs":"eae3d7f16e817e63f3a6ceda062fece3de5e11c7a9631b32b02f23396a9d59c1","tests/same_channel.rs":"2bab761443671e841e1b2476bd8082d75533a2f6be7946f5dbcee67cdc82dccb","tests/select.rs":"3603f450b23f5e0d1e4014a167a9b23ab149b5f418c8b89636f1c02c90501569","tests/select_macro.rs":"00dd7963f79b96abf30851fdab29e86c8424b502a8a7d34abf4bc1714f493ecf","tests/thread_locals.rs":"3611db5502e6af0a8d15187d09fd195381819795544208b946e9f99b04579a81","tests/tick.rs":"dc4a7d3c8dd888ce135fe8a8c67f5dc8b5ab0c3fa57a48459f96d51fa0f1e6d5","tests/zero.rs":"0ff0587cc74569bfe389e0c619217799a960a0dfc5e6354603c88e6eea1b79a1"},"package":"06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4"} +\ No newline at end of file +diff -up firefox-98.0/third_party/rust/crossbeam-channel/Cargo.lock.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/Cargo.lock +--- firefox-98.0/third_party/rust/crossbeam-channel/Cargo.lock.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/Cargo.lock 2022-03-16 09:33:31.993159893 +0100 +@@ -3,6 +3,12 @@ + version = 3 + + [[package]] ++name = "autocfg" ++version = "1.0.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" ++ ++[[package]] + name = "cfg-if" + version = "1.0.0" + source = "registry+https://github.com/rust-lang/crates.io-index" +@@ -10,7 +16,7 @@ checksum = "baf1de4339761588bc0619e3cbc0 + + [[package]] + name = "crossbeam-channel" +-version = "0.5.2" ++version = "0.5.1" + dependencies = [ + "cfg-if", + "crossbeam-utils", +@@ -21,19 +27,20 @@ dependencies = [ + + [[package]] + name = "crossbeam-utils" +-version = "0.8.6" ++version = "0.8.3" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" ++checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49" + dependencies = [ ++ "autocfg", + "cfg-if", + "lazy_static", + ] + + [[package]] + name = "getrandom" +-version = "0.2.3" ++version = "0.2.2" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" ++checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" + dependencies = [ + "cfg-if", + "libc", +@@ -42,9 +49,9 @@ dependencies = [ + + [[package]] + name = "hermit-abi" +-version = "0.1.19" ++version = "0.1.18" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" ++checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" + dependencies = [ + "libc", + ] +@@ -57,15 +64,15 @@ checksum = "e2abad23fbc42b3700f2f279844d + + [[package]] + name = "libc" +-version = "0.2.112" ++version = "0.2.93" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125" ++checksum = "9385f66bf6105b241aa65a61cb923ef20efc665cb9f9bb50ac2f0c4b7f378d41" + + [[package]] + name = "num_cpus" +-version = "1.13.1" ++version = "1.13.0" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" ++checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" + dependencies = [ + "hermit-abi", + "libc", +@@ -73,15 +80,15 @@ dependencies = [ + + [[package]] + name = "ppv-lite86" +-version = "0.2.16" ++version = "0.2.10" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" ++checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + + [[package]] + name = "rand" +-version = "0.8.4" ++version = "0.8.3" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" ++checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" + dependencies = [ + "libc", + "rand_chacha", +@@ -91,9 +98,9 @@ dependencies = [ + + [[package]] + name = "rand_chacha" +-version = "0.3.1" ++version = "0.3.0" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" ++checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" + dependencies = [ + "ppv-lite86", + "rand_core", +@@ -101,27 +108,27 @@ dependencies = [ + + [[package]] + name = "rand_core" +-version = "0.6.3" ++version = "0.6.2" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" ++checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" + dependencies = [ + "getrandom", + ] + + [[package]] + name = "rand_hc" +-version = "0.3.1" ++version = "0.3.0" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" ++checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" + dependencies = [ + "rand_core", + ] + + [[package]] + name = "signal-hook" +-version = "0.3.13" ++version = "0.3.8" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "647c97df271007dcea485bb74ffdb57f2e683f1306c854f468a0c244badabf2d" ++checksum = "ef33d6d0cd06e0840fba9985aab098c147e67e05cee14d412d3345ed14ff30ac" + dependencies = [ + "libc", + "signal-hook-registry", +@@ -129,9 +136,9 @@ dependencies = [ + + [[package]] + name = "signal-hook-registry" +-version = "1.4.0" ++version = "1.3.0" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" ++checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" + dependencies = [ + "libc", + ] +diff -up firefox-98.0/third_party/rust/crossbeam-channel/Cargo.toml.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/Cargo.toml +--- firefox-98.0/third_party/rust/crossbeam-channel/Cargo.toml.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/Cargo.toml 2022-03-16 09:33:31.993159893 +0100 +@@ -3,19 +3,21 @@ + # When uploading crates to the registry Cargo will automatically + # "normalize" Cargo.toml files for maximal compatibility + # with all versions of Cargo and also rewrite `path` dependencies +-# to registry (e.g., crates.io) dependencies. ++# to registry (e.g., crates.io) dependencies + # +-# If you are reading this file be aware that the original Cargo.toml +-# will likely look very different (and much more reasonable). +-# See Cargo.toml.orig for the original contents. ++# If you believe there's an error in this file please file an ++# issue against the rust-lang/cargo repository. If you're ++# editing this file be aware that the upstream Cargo.toml ++# will likely look very different (and much more reasonable) + + [package] + edition = "2018" +-rust-version = "1.36" + name = "crossbeam-channel" +-version = "0.5.2" ++version = "0.5.1" ++authors = ["The Crossbeam Project Developers"] + description = "Multi-producer multi-consumer channels for message passing" + homepage = "https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-channel" ++documentation = "https://docs.rs/crossbeam-channel" + keywords = ["channel", "mpmc", "select", "golang", "message"] + categories = ["algorithms", "concurrency", "data-structures"] + license = "MIT OR Apache-2.0" +diff -up firefox-98.0/third_party/rust/crossbeam-channel/CHANGELOG.md.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/CHANGELOG.md +--- firefox-98.0/third_party/rust/crossbeam-channel/CHANGELOG.md.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/CHANGELOG.md 2022-03-16 09:33:31.993159893 +0100 +@@ -1,7 +1,3 @@ +-# Version 0.5.2 +- +-- Fix stacked borrows violations. (#763, #764) +- + # Version 0.5.1 + + - Fix memory leak in unbounded channel. (#669) +diff -up firefox-98.0/third_party/rust/crossbeam-channel/examples/fibonacci.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/examples/fibonacci.rs +--- firefox-98.0/third_party/rust/crossbeam-channel/examples/fibonacci.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/examples/fibonacci.rs 2022-03-16 09:33:31.993159893 +0100 +@@ -10,7 +10,7 @@ fn fibonacci(sender: Sender) { + while sender.send(x).is_ok() { + let tmp = x; + x = y; +- y += tmp; ++ y = tmp + y; + } + } + +diff -up firefox-98.0/third_party/rust/crossbeam-channel/examples/stopwatch.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/examples/stopwatch.rs +--- firefox-98.0/third_party/rust/crossbeam-channel/examples/stopwatch.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/examples/stopwatch.rs 2022-03-16 09:33:31.993159893 +0100 +@@ -33,7 +33,11 @@ fn main() { + + // Prints the elapsed time. + fn show(dur: Duration) { +- println!("Elapsed: {}.{:03} sec", dur.as_secs(), dur.subsec_millis()); ++ println!( ++ "Elapsed: {}.{:03} sec", ++ dur.as_secs(), ++ dur.subsec_nanos() / 1_000_000 ++ ); + } + + let start = Instant::now(); +diff -up firefox-98.0/third_party/rust/crossbeam-channel/src/context.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/src/context.rs +--- firefox-98.0/third_party/rust/crossbeam-channel/src/context.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/src/context.rs 2022-03-16 09:33:31.993159893 +0100 +@@ -1,8 +1,7 @@ + //! Thread-local context used in select. + + use std::cell::Cell; +-use std::ptr; +-use std::sync::atomic::{AtomicPtr, AtomicUsize, Ordering}; ++use std::sync::atomic::{AtomicUsize, Ordering}; + use std::sync::Arc; + use std::thread::{self, Thread, ThreadId}; + use std::time::Instant; +@@ -12,7 +11,6 @@ use crossbeam_utils::Backoff; + use crate::select::Selected; + + /// Thread-local context used in select. +-// This is a private API that is used by the select macro. + #[derive(Debug, Clone)] + pub struct Context { + inner: Arc, +@@ -25,7 +23,7 @@ struct Inner { + select: AtomicUsize, + + /// A slot into which another thread may store a pointer to its `Packet`. +- packet: AtomicPtr<()>, ++ packet: AtomicUsize, + + /// Thread handle. + thread: Thread, +@@ -47,7 +45,7 @@ impl Context { + } + + let mut f = Some(f); +- let mut f = |cx: &Context| -> R { ++ let mut f = move |cx: &Context| -> R { + let f = f.take().unwrap(); + f(cx) + }; +@@ -71,7 +69,7 @@ impl Context { + Context { + inner: Arc::new(Inner { + select: AtomicUsize::new(Selected::Waiting.into()), +- packet: AtomicPtr::new(ptr::null_mut()), ++ packet: AtomicUsize::new(0), + thread: thread::current(), + thread_id: thread::current().id(), + }), +@@ -84,7 +82,7 @@ impl Context { + self.inner + .select + .store(Selected::Waiting.into(), Ordering::Release); +- self.inner.packet.store(ptr::null_mut(), Ordering::Release); ++ self.inner.packet.store(0, Ordering::Release); + } + + /// Attempts to select an operation. +@@ -114,19 +112,19 @@ impl Context { + /// + /// This method must be called after `try_select` succeeds and there is a packet to provide. + #[inline] +- pub fn store_packet(&self, packet: *mut ()) { +- if !packet.is_null() { ++ pub fn store_packet(&self, packet: usize) { ++ if packet != 0 { + self.inner.packet.store(packet, Ordering::Release); + } + } + + /// Waits until a packet is provided and returns it. + #[inline] +- pub fn wait_packet(&self) -> *mut () { ++ pub fn wait_packet(&self) -> usize { + let backoff = Backoff::new(); + loop { + let packet = self.inner.packet.load(Ordering::Acquire); +- if !packet.is_null() { ++ if packet != 0 { + return packet; + } + backoff.snooze(); +diff -up firefox-98.0/third_party/rust/crossbeam-channel/src/flavors/array.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/src/flavors/array.rs +--- firefox-98.0/third_party/rust/crossbeam-channel/src/flavors/array.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/src/flavors/array.rs 2022-03-16 09:33:31.993159893 +0100 +@@ -10,7 +10,7 @@ + + use std::cell::UnsafeCell; + use std::marker::PhantomData; +-use std::mem::MaybeUninit; ++use std::mem::{self, MaybeUninit}; + use std::ptr; + use std::sync::atomic::{self, AtomicUsize, Ordering}; + use std::time::Instant; +@@ -110,7 +110,7 @@ impl Channel { + // Allocate a buffer of `cap` slots initialized + // with stamps. + let buffer = { +- let boxed: Box<[Slot]> = (0..cap) ++ let mut boxed: Box<[Slot]> = (0..cap) + .map(|i| { + // Set the stamp to `{ lap: 0, mark: 0, index: i }`. + Slot { +@@ -119,7 +119,9 @@ impl Channel { + } + }) + .collect(); +- Box::into_raw(boxed) as *mut Slot ++ let ptr = boxed.as_mut_ptr(); ++ mem::forget(boxed); ++ ptr + }; + + Channel { +diff -up firefox-98.0/third_party/rust/crossbeam-channel/src/flavors/zero.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/src/flavors/zero.rs +--- firefox-98.0/third_party/rust/crossbeam-channel/src/flavors/zero.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/src/flavors/zero.rs 2022-03-16 09:33:31.993159893 +0100 +@@ -6,7 +6,6 @@ use std::cell::UnsafeCell; + use std::marker::PhantomData; + use std::sync::atomic::{AtomicBool, Ordering}; + use std::time::Instant; +-use std::{fmt, ptr}; + + use crossbeam_utils::Backoff; + +@@ -17,19 +16,7 @@ use crate::utils::Spinlock; + use crate::waker::Waker; + + /// A pointer to a packet. +-pub struct ZeroToken(*mut ()); +- +-impl Default for ZeroToken { +- fn default() -> Self { +- Self(ptr::null_mut()) +- } +-} +- +-impl fmt::Debug for ZeroToken { +- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { +- fmt::Debug::fmt(&(self.0 as usize), f) +- } +-} ++pub(crate) type ZeroToken = usize; + + /// A slot for passing one message from a sender to a receiver. + struct Packet { +@@ -130,10 +117,10 @@ impl Channel { + + // If there's a waiting receiver, pair up with it. + if let Some(operation) = inner.receivers.try_select() { +- token.zero.0 = operation.packet; ++ token.zero = operation.packet; + true + } else if inner.is_disconnected { +- token.zero.0 = ptr::null_mut(); ++ token.zero = 0; + true + } else { + false +@@ -143,11 +130,11 @@ impl Channel { + /// Writes a message into the packet. + pub(crate) unsafe fn write(&self, token: &mut Token, msg: T) -> Result<(), T> { + // If there is no packet, the channel is disconnected. +- if token.zero.0.is_null() { ++ if token.zero == 0 { + return Err(msg); + } + +- let packet = &*(token.zero.0 as *const Packet); ++ let packet = &*(token.zero as *const Packet); + packet.msg.get().write(Some(msg)); + packet.ready.store(true, Ordering::Release); + Ok(()) +@@ -159,10 +146,10 @@ impl Channel { + + // If there's a waiting sender, pair up with it. + if let Some(operation) = inner.senders.try_select() { +- token.zero.0 = operation.packet; ++ token.zero = operation.packet; + true + } else if inner.is_disconnected { +- token.zero.0 = ptr::null_mut(); ++ token.zero = 0; + true + } else { + false +@@ -172,11 +159,11 @@ impl Channel { + /// Reads a message from the packet. + pub(crate) unsafe fn read(&self, token: &mut Token) -> Result { + // If there is no packet, the channel is disconnected. +- if token.zero.0.is_null() { ++ if token.zero == 0 { + return Err(()); + } + +- let packet = &*(token.zero.0 as *const Packet); ++ let packet = &*(token.zero as *const Packet); + + if packet.on_stack { + // The message has been in the packet from the beginning, so there is no need to wait +@@ -190,7 +177,7 @@ impl Channel { + // heap-allocated packet. + packet.wait_ready(); + let msg = packet.msg.get().replace(None).unwrap(); +- drop(Box::from_raw(token.zero.0 as *mut Packet)); ++ drop(Box::from_raw(packet as *const Packet as *mut Packet)); + Ok(msg) + } + } +@@ -202,7 +189,7 @@ impl Channel { + + // If there's a waiting receiver, pair up with it. + if let Some(operation) = inner.receivers.try_select() { +- token.zero.0 = operation.packet; ++ token.zero = operation.packet; + drop(inner); + unsafe { + self.write(token, msg).ok().unwrap(); +@@ -226,7 +213,7 @@ impl Channel { + + // If there's a waiting receiver, pair up with it. + if let Some(operation) = inner.receivers.try_select() { +- token.zero.0 = operation.packet; ++ token.zero = operation.packet; + drop(inner); + unsafe { + self.write(token, msg).ok().unwrap(); +@@ -241,10 +228,10 @@ impl Channel { + Context::with(|cx| { + // Prepare for blocking until a receiver wakes us up. + let oper = Operation::hook(token); +- let mut packet = Packet::::message_on_stack(msg); ++ let packet = Packet::::message_on_stack(msg); + inner + .senders +- .register_with_packet(oper, &mut packet as *mut Packet as *mut (), cx); ++ .register_with_packet(oper, &packet as *const Packet as usize, cx); + inner.receivers.notify(); + drop(inner); + +@@ -279,7 +266,7 @@ impl Channel { + + // If there's a waiting sender, pair up with it. + if let Some(operation) = inner.senders.try_select() { +- token.zero.0 = operation.packet; ++ token.zero = operation.packet; + drop(inner); + unsafe { self.read(token).map_err(|_| TryRecvError::Disconnected) } + } else if inner.is_disconnected { +@@ -296,7 +283,7 @@ impl Channel { + + // If there's a waiting sender, pair up with it. + if let Some(operation) = inner.senders.try_select() { +- token.zero.0 = operation.packet; ++ token.zero = operation.packet; + drop(inner); + unsafe { + return self.read(token).map_err(|_| RecvTimeoutError::Disconnected); +@@ -310,12 +297,10 @@ impl Channel { + Context::with(|cx| { + // Prepare for blocking until a sender wakes us up. + let oper = Operation::hook(token); +- let mut packet = Packet::::empty_on_stack(); +- inner.receivers.register_with_packet( +- oper, +- &mut packet as *mut Packet as *mut (), +- cx, +- ); ++ let packet = Packet::::empty_on_stack(); ++ inner ++ .receivers ++ .register_with_packet(oper, &packet as *const Packet as usize, cx); + inner.senders.notify(); + drop(inner); + +@@ -400,7 +385,7 @@ impl SelectHandle for Receiver<'_, T> + let mut inner = self.0.inner.lock(); + inner + .receivers +- .register_with_packet(oper, packet as *mut (), cx); ++ .register_with_packet(oper, packet as usize, cx); + inner.senders.notify(); + inner.senders.can_select() || inner.is_disconnected + } +@@ -414,7 +399,7 @@ impl SelectHandle for Receiver<'_, T> + } + + fn accept(&self, token: &mut Token, cx: &Context) -> bool { +- token.zero.0 = cx.wait_packet(); ++ token.zero = cx.wait_packet(); + true + } + +@@ -450,7 +435,7 @@ impl SelectHandle for Sender<'_, T> { + let mut inner = self.0.inner.lock(); + inner + .senders +- .register_with_packet(oper, packet as *mut (), cx); ++ .register_with_packet(oper, packet as usize, cx); + inner.receivers.notify(); + inner.receivers.can_select() || inner.is_disconnected + } +@@ -464,7 +449,7 @@ impl SelectHandle for Sender<'_, T> { + } + + fn accept(&self, token: &mut Token, cx: &Context) -> bool { +- token.zero.0 = cx.wait_packet(); ++ token.zero = cx.wait_packet(); + true + } + +diff -up firefox-98.0/third_party/rust/crossbeam-channel/src/select.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/src/select.rs +--- firefox-98.0/third_party/rust/crossbeam-channel/src/select.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/src/select.rs 2022-03-16 09:33:31.993159893 +0100 +@@ -19,7 +19,6 @@ use crate::utils; + /// `read` or `write`. + /// + /// Each field contains data associated with a specific channel flavor. +-// This is a private API that is used by the select macro. + #[derive(Debug, Default)] + pub struct Token { + pub at: flavors::at::AtToken, +@@ -94,7 +93,6 @@ impl Into for Selected { + /// + /// This is a handle that assists select in executing an operation, registration, deciding on the + /// appropriate deadline for blocking, etc. +-// This is a private API (exposed inside crossbeam_channel::internal module) that is used by the select macro. + pub trait SelectHandle { + /// Attempts to select an operation and returns `true` on success. + fn try_select(&self, token: &mut Token) -> bool; +@@ -444,7 +442,6 @@ fn run_ready( + } + + /// Attempts to select one of the operations without blocking. +-// This is a private API (exposed inside crossbeam_channel::internal module) that is used by the select macro. + #[inline] + pub fn try_select<'a>( + handles: &mut [(&'a dyn SelectHandle, usize, *const u8)], +@@ -461,7 +458,6 @@ pub fn try_select<'a>( + } + + /// Blocks until one of the operations becomes ready and selects it. +-// This is a private API (exposed inside crossbeam_channel::internal module) that is used by the select macro. + #[inline] + pub fn select<'a>( + handles: &mut [(&'a dyn SelectHandle, usize, *const u8)], +@@ -480,7 +476,6 @@ pub fn select<'a>( + } + + /// Blocks for a limited time until one of the operations becomes ready and selects it. +-// This is a private API (exposed inside crossbeam_channel::internal module) that is used by the select macro. + #[inline] + pub fn select_timeout<'a>( + handles: &mut [(&'a dyn SelectHandle, usize, *const u8)], +diff -up firefox-98.0/third_party/rust/crossbeam-channel/src/waker.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/src/waker.rs +--- firefox-98.0/third_party/rust/crossbeam-channel/src/waker.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/src/waker.rs 2022-03-16 09:33:31.993159893 +0100 +@@ -1,6 +1,5 @@ + //! Waking mechanism for threads blocked on channel operations. + +-use std::ptr; + use std::sync::atomic::{AtomicBool, Ordering}; + use std::thread::{self, ThreadId}; + +@@ -14,7 +13,7 @@ pub(crate) struct Entry { + pub(crate) oper: Operation, + + /// Optional packet. +- pub(crate) packet: *mut (), ++ pub(crate) packet: usize, + + /// Context associated with the thread owning this operation. + pub(crate) cx: Context, +@@ -45,12 +44,12 @@ impl Waker { + /// Registers a select operation. + #[inline] + pub(crate) fn register(&mut self, oper: Operation, cx: &Context) { +- self.register_with_packet(oper, ptr::null_mut(), cx); ++ self.register_with_packet(oper, 0, cx); + } + + /// Registers a select operation and a packet. + #[inline] +- pub(crate) fn register_with_packet(&mut self, oper: Operation, packet: *mut (), cx: &Context) { ++ pub(crate) fn register_with_packet(&mut self, oper: Operation, packet: usize, cx: &Context) { + self.selectors.push(Entry { + oper, + packet, +@@ -77,26 +76,34 @@ impl Waker { + /// Attempts to find another thread's entry, select the operation, and wake it up. + #[inline] + pub(crate) fn try_select(&mut self) -> Option { +- self.selectors +- .iter() +- .position(|selector| { ++ let mut entry = None; ++ ++ if !self.selectors.is_empty() { ++ let thread_id = current_thread_id(); ++ ++ for i in 0..self.selectors.len() { + // Does the entry belong to a different thread? +- selector.cx.thread_id() != current_thread_id() +- && selector // Try selecting this operation. +- .cx +- .try_select(Selected::Operation(selector.oper)) +- .is_ok() +- && { ++ if self.selectors[i].cx.thread_id() != thread_id { ++ // Try selecting this operation. ++ let sel = Selected::Operation(self.selectors[i].oper); ++ let res = self.selectors[i].cx.try_select(sel); ++ ++ if res.is_ok() { + // Provide the packet. +- selector.cx.store_packet(selector.packet); ++ self.selectors[i].cx.store_packet(self.selectors[i].packet); + // Wake the thread up. +- selector.cx.unpark(); +- true ++ self.selectors[i].cx.unpark(); ++ ++ // Remove the entry from the queue to keep it clean and improve ++ // performance. ++ entry = Some(self.selectors.remove(i)); ++ break; + } +- }) +- // Remove the entry from the queue to keep it clean and improve +- // performance. +- .map(|pos| self.selectors.remove(pos)) ++ } ++ } ++ } ++ ++ entry + } + + /// Returns `true` if there is an entry which can be selected by the current thread. +@@ -118,7 +125,7 @@ impl Waker { + pub(crate) fn watch(&mut self, oper: Operation, cx: &Context) { + self.observers.push(Entry { + oper, +- packet: ptr::null_mut(), ++ packet: 0, + cx: cx.clone(), + }); + } +@@ -262,7 +269,7 @@ impl SyncWaker { + impl Drop for SyncWaker { + #[inline] + fn drop(&mut self) { +- debug_assert!(self.is_empty.load(Ordering::SeqCst)); ++ debug_assert_eq!(self.is_empty.load(Ordering::SeqCst), true); + } + } + +diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/after.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/after.rs +--- firefox-98.0/third_party/rust/crossbeam-channel/tests/after.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/tests/after.rs 2022-03-16 09:33:31.993159893 +0100 +@@ -1,7 +1,5 @@ + //! Tests for the after channel flavor. + +-#![cfg(not(miri))] // TODO: many assertions failed due to Miri is slow +- + use std::sync::atomic::AtomicUsize; + use std::sync::atomic::Ordering; + use std::thread; +@@ -58,20 +56,20 @@ fn len_empty_full() { + let r = after(ms(50)); + + assert_eq!(r.len(), 0); +- assert!(r.is_empty()); +- assert!(!r.is_full()); ++ assert_eq!(r.is_empty(), true); ++ assert_eq!(r.is_full(), false); + + thread::sleep(ms(100)); + + assert_eq!(r.len(), 1); +- assert!(!r.is_empty()); +- assert!(r.is_full()); ++ assert_eq!(r.is_empty(), false); ++ assert_eq!(r.is_full(), true); + + r.try_recv().unwrap(); + + assert_eq!(r.len(), 0); +- assert!(r.is_empty()); +- assert!(!r.is_full()); ++ assert_eq!(r.is_empty(), true); ++ assert_eq!(r.is_full(), false); + } + + #[test] +@@ -213,7 +211,7 @@ fn select() { + break; + } + i => { +- oper.recv(v[i]).unwrap(); ++ oper.recv(&v[i]).unwrap(); + hits.fetch_add(1, Ordering::SeqCst); + } + } +diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/array.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/array.rs +--- firefox-98.0/third_party/rust/crossbeam-channel/tests/array.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/tests/array.rs 2022-03-16 09:33:31.994159927 +0100 +@@ -1,7 +1,5 @@ + //! Tests for the array channel flavor. + +-#![cfg(not(miri))] // TODO: many assertions failed due to Miri is slow +- + use std::any::Any; + use std::sync::atomic::AtomicUsize; + use std::sync::atomic::Ordering; +@@ -45,38 +43,38 @@ fn len_empty_full() { + let (s, r) = bounded(2); + + assert_eq!(s.len(), 0); +- assert!(s.is_empty()); +- assert!(!s.is_full()); ++ assert_eq!(s.is_empty(), true); ++ assert_eq!(s.is_full(), false); + assert_eq!(r.len(), 0); +- assert!(r.is_empty()); +- assert!(!r.is_full()); ++ assert_eq!(r.is_empty(), true); ++ assert_eq!(r.is_full(), false); + + s.send(()).unwrap(); + + assert_eq!(s.len(), 1); +- assert!(!s.is_empty()); +- assert!(!s.is_full()); ++ assert_eq!(s.is_empty(), false); ++ assert_eq!(s.is_full(), false); + assert_eq!(r.len(), 1); +- assert!(!r.is_empty()); +- assert!(!r.is_full()); ++ assert_eq!(r.is_empty(), false); ++ assert_eq!(r.is_full(), false); + + s.send(()).unwrap(); + + assert_eq!(s.len(), 2); +- assert!(!s.is_empty()); +- assert!(s.is_full()); ++ assert_eq!(s.is_empty(), false); ++ assert_eq!(s.is_full(), true); + assert_eq!(r.len(), 2); +- assert!(!r.is_empty()); +- assert!(r.is_full()); ++ assert_eq!(r.is_empty(), false); ++ assert_eq!(r.is_full(), true); + + r.recv().unwrap(); + + assert_eq!(s.len(), 1); +- assert!(!s.is_empty()); +- assert!(!s.is_full()); ++ assert_eq!(s.is_empty(), false); ++ assert_eq!(s.is_full(), false); + assert_eq!(r.len(), 1); +- assert!(!r.is_empty()); +- assert!(!r.is_full()); ++ assert_eq!(r.is_empty(), false); ++ assert_eq!(r.is_full(), false); + } + + #[test] +diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/golang.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/golang.rs +--- firefox-98.0/third_party/rust/crossbeam-channel/tests/golang.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:40.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/tests/golang.rs 2022-03-16 09:33:31.994159927 +0100 +@@ -9,8 +9,6 @@ + //! - https://golang.org/LICENSE + //! - https://golang.org/PATENTS + +-#![allow(clippy::mutex_atomic, clippy::redundant_clone)] +- + use std::alloc::{GlobalAlloc, Layout, System}; + use std::any::Any; + use std::cell::Cell; +@@ -178,7 +176,7 @@ unsafe impl GlobalAlloc for Counter { + if !ret.is_null() { + ALLOCATED.fetch_add(layout.size(), SeqCst); + } +- ret ++ return ret; + } + + unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { +@@ -234,9 +232,6 @@ macro_rules! go { + mod doubleselect { + use super::*; + +- #[cfg(miri)] +- const ITERATIONS: i32 = 100; +- #[cfg(not(miri))] + const ITERATIONS: i32 = 10_000; + + fn sender(n: i32, c1: Chan, c2: Chan, c3: Chan, c4: Chan) { +@@ -696,11 +691,6 @@ mod select { + mod select2 { + use super::*; + +- #[cfg(miri)] +- const N: i32 = 1000; +- #[cfg(not(miri))] +- const N: i32 = 100000; +- + #[test] + fn main() { + fn sender(c: &Chan, n: i32) { +@@ -712,7 +702,9 @@ mod select2 { + fn receiver(c: &Chan, dummy: &Chan, n: i32) { + for _ in 0..n { + select! { +- recv(c.rx()) -> _ => {} ++ recv(c.rx()) -> _ => { ++ () ++ } + recv(dummy.rx()) -> _ => { + panic!("dummy"); + } +@@ -725,18 +717,15 @@ mod select2 { + + ALLOCATED.store(0, SeqCst); + +- go!(c, sender(&c, N)); +- receiver(&c, &dummy, N); ++ go!(c, sender(&c, 100000)); ++ receiver(&c, &dummy, 100000); + + let alloc = ALLOCATED.load(SeqCst); + +- go!(c, sender(&c, N)); +- receiver(&c, &dummy, N); ++ go!(c, sender(&c, 100000)); ++ receiver(&c, &dummy, 100000); + +- assert!( +- !(ALLOCATED.load(SeqCst) > alloc +- && (ALLOCATED.load(SeqCst) - alloc) > (N as usize + 10000)) +- ) ++ assert!(!(ALLOCATED.load(SeqCst) > alloc && (ALLOCATED.load(SeqCst) - alloc) > 110000)) + } + } + +@@ -924,9 +913,6 @@ mod chan_test { + + #[test] + fn test_chan() { +- #[cfg(miri)] +- const N: i32 = 20; +- #[cfg(not(miri))] + const N: i32 = 200; + + for cap in 0..N { +@@ -1066,9 +1052,6 @@ mod chan_test { + + #[test] + fn test_nonblock_recv_race() { +- #[cfg(miri)] +- const N: usize = 100; +- #[cfg(not(miri))] + const N: usize = 1000; + + for _ in 0..N { +@@ -1090,9 +1073,6 @@ mod chan_test { + + #[test] + fn test_nonblock_select_race() { +- #[cfg(miri)] +- const N: usize = 100; +- #[cfg(not(miri))] + const N: usize = 1000; + + let done = make::(1); +@@ -1126,9 +1106,6 @@ mod chan_test { + + #[test] + fn test_nonblock_select_race2() { +- #[cfg(miri)] +- const N: usize = 100; +- #[cfg(not(miri))] + const N: usize = 1000; + + let done = make::(1); +@@ -1165,11 +1142,6 @@ mod chan_test { + // Ensure that send/recv on the same chan in select + // does not crash nor deadlock. + +- #[cfg(miri)] +- const N: usize = 100; +- #[cfg(not(miri))] +- const N: usize = 1000; +- + for &cap in &[0, 10] { + let wg = WaitGroup::new(); + wg.add(2); +@@ -1179,7 +1151,7 @@ mod chan_test { + let p = p; + go!(wg, p, c, { + defer! { wg.done() } +- for i in 0..N { ++ for i in 0..1000 { + if p == 0 || i % 2 == 0 { + select! { + send(c.tx(), p) -> _ => {} +@@ -1208,11 +1180,6 @@ mod chan_test { + + #[test] + fn test_select_stress() { +- #[cfg(miri)] +- const N: usize = 100; +- #[cfg(not(miri))] +- const N: usize = 10000; +- + let c = vec![ + make::(0), + make::(0), +@@ -1220,6 +1187,8 @@ mod chan_test { + make::(3), + ]; + ++ const N: usize = 10000; ++ + // There are 4 goroutines that send N values on each of the chans, + // + 4 goroutines that receive N values on each of the chans, + // + 1 goroutine that sends N values on each of the chans in a single select, +@@ -1317,9 +1286,6 @@ mod chan_test { + + #[test] + fn test_select_fairness() { +- #[cfg(miri)] +- const TRIALS: usize = 100; +- #[cfg(not(miri))] + const TRIALS: usize = 10000; + + let c1 = make::(TRIALS + 1); +@@ -1403,9 +1369,6 @@ mod chan_test { + + #[test] + fn test_pseudo_random_send() { +- #[cfg(miri)] +- const N: usize = 20; +- #[cfg(not(miri))] + const N: usize = 100; + + for cap in 0..N { +@@ -1449,9 +1412,6 @@ mod chan_test { + #[test] + fn test_multi_consumer() { + const NWORK: usize = 23; +- #[cfg(miri)] +- const NITER: usize = 100; +- #[cfg(not(miri))] + const NITER: usize = 271828; + + let pn = [2, 3, 7, 11, 13, 17, 19, 23, 27, 31]; +@@ -1550,9 +1510,6 @@ mod chan1 { + use super::*; + + // sent messages +- #[cfg(miri)] +- const N: usize = 100; +- #[cfg(not(miri))] + const N: usize = 1000; + // receiving "goroutines" + const M: usize = 10; +diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/iter.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/iter.rs +--- firefox-98.0/third_party/rust/crossbeam-channel/tests/iter.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:40.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/tests/iter.rs 2022-03-16 09:33:31.994159927 +0100 +@@ -93,7 +93,7 @@ fn recv_into_iter_owned() { + + assert_eq!(iter.next().unwrap(), 1); + assert_eq!(iter.next().unwrap(), 2); +- assert!(iter.next().is_none()); ++ assert_eq!(iter.next().is_none(), true); + } + + #[test] +@@ -106,5 +106,5 @@ fn recv_into_iter_borrowed() { + let mut iter = (&r).into_iter(); + assert_eq!(iter.next().unwrap(), 1); + assert_eq!(iter.next().unwrap(), 2); +- assert!(iter.next().is_none()); ++ assert_eq!(iter.next().is_none(), true); + } +diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/list.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/list.rs +--- firefox-98.0/third_party/rust/crossbeam-channel/tests/list.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/tests/list.rs 2022-03-16 09:33:31.994159927 +0100 +@@ -41,29 +41,29 @@ fn len_empty_full() { + let (s, r) = unbounded(); + + assert_eq!(s.len(), 0); +- assert!(s.is_empty()); +- assert!(!s.is_full()); ++ assert_eq!(s.is_empty(), true); ++ assert_eq!(s.is_full(), false); + assert_eq!(r.len(), 0); +- assert!(r.is_empty()); +- assert!(!r.is_full()); ++ assert_eq!(r.is_empty(), true); ++ assert_eq!(r.is_full(), false); + + s.send(()).unwrap(); + + assert_eq!(s.len(), 1); +- assert!(!s.is_empty()); +- assert!(!s.is_full()); ++ assert_eq!(s.is_empty(), false); ++ assert_eq!(s.is_full(), false); + assert_eq!(r.len(), 1); +- assert!(!r.is_empty()); +- assert!(!r.is_full()); ++ assert_eq!(r.is_empty(), false); ++ assert_eq!(r.is_full(), false); + + r.recv().unwrap(); + + assert_eq!(s.len(), 0); +- assert!(s.is_empty()); +- assert!(!s.is_full()); ++ assert_eq!(s.is_empty(), true); ++ assert_eq!(s.is_full(), false); + assert_eq!(r.len(), 0); +- assert!(r.is_empty()); +- assert!(!r.is_full()); ++ assert_eq!(r.is_empty(), true); ++ assert_eq!(r.is_full(), false); + } + + #[test] +@@ -239,9 +239,6 @@ fn disconnect_wakes_receiver() { + + #[test] + fn spsc() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 100_000; + + let (s, r) = unbounded(); +@@ -264,9 +261,6 @@ fn spsc() { + + #[test] + fn mpmc() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 25_000; + const THREADS: usize = 4; + +@@ -301,9 +295,6 @@ fn mpmc() { + + #[test] + fn stress_oneshot() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + for _ in 0..COUNT { +@@ -319,9 +310,6 @@ fn stress_oneshot() { + + #[test] + fn stress_iter() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 100_000; + + let (request_s, request_r) = unbounded(); +@@ -383,11 +371,8 @@ fn stress_timeout_two_threads() { + .unwrap(); + } + +-#[cfg_attr(miri, ignore)] // Miri is too slow + #[test] + fn drops() { +- const RUNS: usize = 100; +- + static DROPS: AtomicUsize = AtomicUsize::new(0); + + #[derive(Debug, PartialEq)] +@@ -401,7 +386,7 @@ fn drops() { + + let mut rng = thread_rng(); + +- for _ in 0..RUNS { ++ for _ in 0..100 { + let steps = rng.gen_range(0..10_000); + let additional = rng.gen_range(0..1000); + +@@ -436,9 +421,6 @@ fn drops() { + + #[test] + fn linearizable() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 25_000; + const THREADS: usize = 4; + +@@ -459,9 +441,6 @@ fn linearizable() { + + #[test] + fn fairness() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + let (s1, r1) = unbounded::<()>(); +@@ -484,9 +463,6 @@ fn fairness() { + + #[test] + fn fairness_duplicates() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + let (s, r) = unbounded(); +@@ -520,9 +496,6 @@ fn recv_in_send() { + + #[test] + fn channel_through_channel() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 1000; + + type T = Box; +diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/mpsc.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/mpsc.rs +--- firefox-98.0/third_party/rust/crossbeam-channel/tests/mpsc.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/tests/mpsc.rs 2022-03-16 09:33:31.994159927 +0100 +@@ -20,12 +20,6 @@ + //! - https://github.com/rust-lang/rust/blob/master/COPYRIGHT + //! - https://www.rust-lang.org/en-US/legal.html + +-#![allow( +- clippy::drop_copy, +- clippy::match_single_binding, +- clippy::redundant_clone +-)] +- + use std::sync::mpsc::{RecvError, RecvTimeoutError, TryRecvError}; + use std::sync::mpsc::{SendError, TrySendError}; + use std::thread::JoinHandle; +@@ -182,7 +176,7 @@ macro_rules! select { + ) => ({ + cc::crossbeam_channel_internal! { + $( +- $meth(($rx).inner) -> res => { ++ recv(($rx).inner) -> res => { + let $name = res.map_err(|_| ::std::sync::mpsc::RecvError); + $code + } +@@ -320,18 +314,13 @@ mod channel_tests { + + #[test] + fn stress() { +- #[cfg(miri)] +- const COUNT: usize = 500; +- #[cfg(not(miri))] +- const COUNT: usize = 10000; +- + let (tx, rx) = channel::(); + let t = thread::spawn(move || { +- for _ in 0..COUNT { ++ for _ in 0..10000 { + tx.send(1).unwrap(); + } + }); +- for _ in 0..COUNT { ++ for _ in 0..10000 { + assert_eq!(rx.recv().unwrap(), 1); + } + t.join().ok().unwrap(); +@@ -339,9 +328,6 @@ mod channel_tests { + + #[test] + fn stress_shared() { +- #[cfg(miri)] +- const AMT: u32 = 500; +- #[cfg(not(miri))] + const AMT: u32 = 10000; + const NTHREADS: u32 = 8; + let (tx, rx) = channel::(); +@@ -350,7 +336,10 @@ mod channel_tests { + for _ in 0..AMT * NTHREADS { + assert_eq!(rx.recv().unwrap(), 1); + } +- assert!(rx.try_recv().is_err()); ++ match rx.try_recv() { ++ Ok(..) => panic!(), ++ _ => {} ++ } + }); + + let mut ts = Vec::with_capacity(NTHREADS as usize); +@@ -746,17 +735,12 @@ mod channel_tests { + + #[test] + fn recv_a_lot() { +- #[cfg(miri)] +- const N: usize = 100; +- #[cfg(not(miri))] +- const N: usize = 10000; +- + // Regression test that we don't run out of stack in scheduler context + let (tx, rx) = channel(); +- for _ in 0..N { ++ for _ in 0..10000 { + tx.send(()).unwrap(); + } +- for _ in 0..N { ++ for _ in 0..10000 { + rx.recv().unwrap(); + } + } +@@ -896,7 +880,7 @@ mod channel_tests { + }; + assert_eq!(iter.next().unwrap(), 1); + assert_eq!(iter.next().unwrap(), 2); +- assert!(iter.next().is_none()); ++ assert_eq!(iter.next().is_none(), true); + } + + #[test] +@@ -908,7 +892,7 @@ mod channel_tests { + let mut iter = (&rx).into_iter(); + assert_eq!(iter.next().unwrap(), 1); + assert_eq!(iter.next().unwrap(), 2); +- assert!(iter.next().is_none()); ++ assert_eq!(iter.next().is_none(), true); + } + + #[test] +@@ -1095,18 +1079,13 @@ mod sync_channel_tests { + + #[test] + fn stress() { +- #[cfg(miri)] +- const N: usize = 100; +- #[cfg(not(miri))] +- const N: usize = 10000; +- + let (tx, rx) = sync_channel::(0); + let t = thread::spawn(move || { +- for _ in 0..N { ++ for _ in 0..10000 { + tx.send(1).unwrap(); + } + }); +- for _ in 0..N { ++ for _ in 0..10000 { + assert_eq!(rx.recv().unwrap(), 1); + } + t.join().unwrap(); +@@ -1114,15 +1093,10 @@ mod sync_channel_tests { + + #[test] + fn stress_recv_timeout_two_threads() { +- #[cfg(miri)] +- const N: usize = 100; +- #[cfg(not(miri))] +- const N: usize = 10000; +- + let (tx, rx) = sync_channel::(0); + + let t = thread::spawn(move || { +- for _ in 0..N { ++ for _ in 0..10000 { + tx.send(1).unwrap(); + } + }); +@@ -1139,15 +1113,12 @@ mod sync_channel_tests { + } + } + +- assert_eq!(recv_count, N); ++ assert_eq!(recv_count, 10000); + t.join().unwrap(); + } + + #[test] + fn stress_recv_timeout_shared() { +- #[cfg(miri)] +- const AMT: u32 = 100; +- #[cfg(not(miri))] + const AMT: u32 = 1000; + const NTHREADS: u32 = 8; + let (tx, rx) = sync_channel::(0); +@@ -1194,9 +1165,6 @@ mod sync_channel_tests { + + #[test] + fn stress_shared() { +- #[cfg(miri)] +- const AMT: u32 = 100; +- #[cfg(not(miri))] + const AMT: u32 = 1000; + const NTHREADS: u32 = 8; + let (tx, rx) = sync_channel::(0); +@@ -1206,7 +1174,10 @@ mod sync_channel_tests { + for _ in 0..AMT * NTHREADS { + assert_eq!(rx.recv().unwrap(), 1); + } +- assert!(rx.try_recv().is_err()); ++ match rx.try_recv() { ++ Ok(..) => panic!(), ++ _ => {} ++ } + dtx.send(()).unwrap(); + }); + +@@ -1478,17 +1449,12 @@ mod sync_channel_tests { + + #[test] + fn recv_a_lot() { +- #[cfg(miri)] +- const N: usize = 100; +- #[cfg(not(miri))] +- const N: usize = 10000; +- + // Regression test that we don't run out of stack in scheduler context +- let (tx, rx) = sync_channel(N); +- for _ in 0..N { ++ let (tx, rx) = sync_channel(10000); ++ for _ in 0..10000 { + tx.send(()).unwrap(); + } +- for _ in 0..N { ++ for _ in 0..10000 { + rx.recv().unwrap(); + } + } +@@ -1826,11 +1792,7 @@ mod select_tests { + + #[test] + fn stress() { +- #[cfg(miri)] +- const AMT: i32 = 100; +- #[cfg(not(miri))] + const AMT: i32 = 10000; +- + let (tx1, rx1) = channel::(); + let (tx2, rx2) = channel::(); + let (tx3, rx3) = channel::<()>(); +diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/never.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/never.rs +--- firefox-98.0/third_party/rust/crossbeam-channel/tests/never.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/tests/never.rs 2022-03-16 09:33:31.994159927 +0100 +@@ -65,8 +65,8 @@ fn capacity() { + fn len_empty_full() { + let r = never::(); + assert_eq!(r.len(), 0); +- assert!(r.is_empty()); +- assert!(r.is_full()); ++ assert_eq!(r.is_empty(), true); ++ assert_eq!(r.is_full(), true); + } + + #[test] +diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/ready.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/ready.rs +--- firefox-98.0/third_party/rust/crossbeam-channel/tests/ready.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/tests/ready.rs 2022-03-16 09:33:31.994159927 +0100 +@@ -1,7 +1,5 @@ + //! Tests for channel readiness using the `Select` struct. + +-#![allow(clippy::drop_copy)] +- + use std::any::Any; + use std::cell::Cell; + use std::thread; +@@ -492,9 +490,6 @@ fn nesting() { + + #[test] + fn stress_recv() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + let (s1, r1) = unbounded(); +@@ -532,9 +527,6 @@ fn stress_recv() { + + #[test] + fn stress_send() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + let (s1, r1) = bounded(0); +@@ -569,9 +561,6 @@ fn stress_send() { + + #[test] + fn stress_mixed() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + let (s1, r1) = bounded(0); +@@ -677,9 +666,6 @@ fn send_recv_same_channel() { + + #[test] + fn channel_through_channel() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 1000; + + type T = Box; +@@ -736,9 +722,6 @@ fn channel_through_channel() { + + #[test] + fn fairness1() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + let (s1, r1) = bounded::<()>(COUNT); +@@ -784,9 +767,6 @@ fn fairness1() { + + #[test] + fn fairness2() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 100_000; + + let (s1, r1) = unbounded::<()>(); +diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/select_macro.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/select_macro.rs +--- firefox-98.0/third_party/rust/crossbeam-channel/tests/select_macro.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/tests/select_macro.rs 2022-03-16 09:33:31.994159927 +0100 +@@ -1,7 +1,6 @@ + //! Tests for the `select!` macro. + + #![forbid(unsafe_code)] // select! is safe. +-#![allow(clippy::drop_copy, clippy::match_single_binding)] + + use std::any::Any; + use std::cell::Cell; +@@ -284,7 +283,6 @@ fn both_ready() { + .unwrap(); + } + +-#[cfg_attr(miri, ignore)] // Miri is too slow + #[test] + fn loop_try() { + const RUNS: usize = 20; +@@ -487,9 +485,6 @@ fn panic_receiver() { + + #[test] + fn stress_recv() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + let (s1, r1) = unbounded(); +@@ -523,9 +518,6 @@ fn stress_recv() { + + #[test] + fn stress_send() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + let (s1, r1) = bounded(0); +@@ -556,9 +548,6 @@ fn stress_send() { + + #[test] + fn stress_mixed() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + let (s1, r1) = bounded(0); +@@ -692,9 +681,6 @@ fn matching_with_leftover() { + + #[test] + fn channel_through_channel() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 1000; + + type T = Box; +@@ -740,9 +726,6 @@ fn channel_through_channel() { + + #[test] + fn linearizable_default() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 100_000; + + for step in 0..2 { +@@ -787,9 +770,6 @@ fn linearizable_default() { + + #[test] + fn linearizable_timeout() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 100_000; + + for step in 0..2 { +@@ -834,9 +814,6 @@ fn linearizable_timeout() { + + #[test] + fn fairness1() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + let (s1, r1) = bounded::<()>(COUNT); +@@ -861,9 +838,6 @@ fn fairness1() { + + #[test] + fn fairness2() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + let (s1, r1) = unbounded::<()>(); +@@ -901,9 +875,6 @@ fn fairness2() { + + #[test] + fn fairness_recv() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + let (s1, r1) = bounded::<()>(COUNT); +@@ -926,9 +897,6 @@ fn fairness_recv() { + + #[test] + fn fairness_send() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + let (s1, _r1) = bounded::<()>(COUNT); +@@ -944,7 +912,6 @@ fn fairness_send() { + assert!(hits.iter().all(|x| *x >= COUNT / 4)); + } + +-#[allow(clippy::or_fun_call)] // This is intentional. + #[test] + fn references() { + let (s, r) = unbounded::(); +@@ -991,7 +958,6 @@ fn case_blocks() { + drop(s); + } + +-#[allow(clippy::redundant_closure_call)] // This is intentional. + #[test] + fn move_handles() { + let (s, r) = unbounded::(); +diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/select.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/select.rs +--- firefox-98.0/third_party/rust/crossbeam-channel/tests/select.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/tests/select.rs 2022-03-16 09:33:31.994159927 +0100 +@@ -1,7 +1,5 @@ + //! Tests for channel selection using the `Select` struct. + +-#![allow(clippy::drop_copy)] +- + use std::any::Any; + use std::cell::Cell; + use std::thread; +@@ -408,7 +406,6 @@ fn both_ready() { + .unwrap(); + } + +-#[cfg_attr(miri, ignore)] // Miri is too slow + #[test] + fn loop_try() { + const RUNS: usize = 20; +@@ -693,9 +690,6 @@ fn nesting() { + + #[test] + fn stress_recv() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + let (s1, r1) = unbounded(); +@@ -734,9 +728,6 @@ fn stress_recv() { + + #[test] + fn stress_send() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + let (s1, r1) = bounded(0); +@@ -772,9 +763,6 @@ fn stress_send() { + + #[test] + fn stress_mixed() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + let (s1, r1) = bounded(0); +@@ -907,12 +895,12 @@ fn matching() { + for i in 0..THREADS { + scope.spawn(move |_| { + let mut sel = Select::new(); +- let oper1 = sel.recv(r); +- let oper2 = sel.send(s); ++ let oper1 = sel.recv(&r); ++ let oper2 = sel.send(&s); + let oper = sel.select(); + match oper.index() { +- ix if ix == oper1 => assert_ne!(oper.recv(r), Ok(i)), +- ix if ix == oper2 => assert!(oper.send(s, i).is_ok()), ++ ix if ix == oper1 => assert_ne!(oper.recv(&r), Ok(i)), ++ ix if ix == oper2 => assert!(oper.send(&s, i).is_ok()), + _ => unreachable!(), + } + }); +@@ -933,12 +921,12 @@ fn matching_with_leftover() { + for i in 0..THREADS { + scope.spawn(move |_| { + let mut sel = Select::new(); +- let oper1 = sel.recv(r); +- let oper2 = sel.send(s); ++ let oper1 = sel.recv(&r); ++ let oper2 = sel.send(&s); + let oper = sel.select(); + match oper.index() { +- ix if ix == oper1 => assert_ne!(oper.recv(r), Ok(i)), +- ix if ix == oper2 => assert!(oper.send(s, i).is_ok()), ++ ix if ix == oper1 => assert_ne!(oper.recv(&r), Ok(i)), ++ ix if ix == oper2 => assert!(oper.send(&s, i).is_ok()), + _ => unreachable!(), + } + }); +@@ -952,9 +940,6 @@ fn matching_with_leftover() { + + #[test] + fn channel_through_channel() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 1000; + + type T = Box; +@@ -1013,9 +998,6 @@ fn channel_through_channel() { + + #[test] + fn linearizable_try() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 100_000; + + for step in 0..2 { +@@ -1068,9 +1050,6 @@ fn linearizable_try() { + + #[test] + fn linearizable_timeout() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 100_000; + + for step in 0..2 { +@@ -1123,9 +1102,6 @@ fn linearizable_timeout() { + + #[test] + fn fairness1() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + let (s1, r1) = bounded::<()>(COUNT); +@@ -1172,9 +1148,6 @@ fn fairness1() { + + #[test] + fn fairness2() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + let (s1, r1) = unbounded::<()>(); +@@ -1239,8 +1212,8 @@ fn sync_and_clone() { + let (s, r) = &bounded::(0); + + let mut sel = Select::new(); +- let oper1 = sel.recv(r); +- let oper2 = sel.send(s); ++ let oper1 = sel.recv(&r); ++ let oper2 = sel.send(&s); + let sel = &sel; + + scope(|scope| { +@@ -1249,8 +1222,8 @@ fn sync_and_clone() { + let mut sel = sel.clone(); + let oper = sel.select(); + match oper.index() { +- ix if ix == oper1 => assert_ne!(oper.recv(r), Ok(i)), +- ix if ix == oper2 => assert!(oper.send(s, i).is_ok()), ++ ix if ix == oper1 => assert_ne!(oper.recv(&r), Ok(i)), ++ ix if ix == oper2 => assert!(oper.send(&s, i).is_ok()), + _ => unreachable!(), + } + }); +@@ -1268,8 +1241,8 @@ fn send_and_clone() { + let (s, r) = &bounded::(0); + + let mut sel = Select::new(); +- let oper1 = sel.recv(r); +- let oper2 = sel.send(s); ++ let oper1 = sel.recv(&r); ++ let oper2 = sel.send(&s); + + scope(|scope| { + for i in 0..THREADS { +@@ -1277,8 +1250,8 @@ fn send_and_clone() { + scope.spawn(move |_| { + let oper = sel.select(); + match oper.index() { +- ix if ix == oper1 => assert_ne!(oper.recv(r), Ok(i)), +- ix if ix == oper2 => assert!(oper.send(s, i).is_ok()), ++ ix if ix == oper1 => assert_ne!(oper.recv(&r), Ok(i)), ++ ix if ix == oper2 => assert!(oper.send(&s, i).is_ok()), + _ => unreachable!(), + } + }); +@@ -1291,9 +1264,6 @@ fn send_and_clone() { + + #[test] + fn reuse() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + let (s1, r1) = bounded(0); +diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/thread_locals.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/thread_locals.rs +--- firefox-98.0/third_party/rust/crossbeam-channel/tests/thread_locals.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:40.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/tests/thread_locals.rs 2022-03-16 09:33:31.995159961 +0100 +@@ -1,7 +1,5 @@ + //! Tests that make sure accessing thread-locals while exiting the thread doesn't cause panics. + +-#![cfg(not(miri))] // error: abnormal termination: the evaluated program aborted execution +- + use std::thread; + use std::time::Duration; + +diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/tick.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/tick.rs +--- firefox-98.0/third_party/rust/crossbeam-channel/tests/tick.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/tests/tick.rs 2022-03-16 09:33:31.995159961 +0100 +@@ -1,7 +1,5 @@ + //! Tests for the tick channel flavor. + +-#![cfg(not(miri))] // TODO: many assertions failed due to Miri is slow +- + use std::sync::atomic::AtomicUsize; + use std::sync::atomic::Ordering; + use std::thread; +@@ -80,20 +78,20 @@ fn len_empty_full() { + let r = tick(ms(50)); + + assert_eq!(r.len(), 0); +- assert!(r.is_empty()); +- assert!(!r.is_full()); ++ assert_eq!(r.is_empty(), true); ++ assert_eq!(r.is_full(), false); + + thread::sleep(ms(100)); + + assert_eq!(r.len(), 1); +- assert!(!r.is_empty()); +- assert!(r.is_full()); ++ assert_eq!(r.is_empty(), false); ++ assert_eq!(r.is_full(), true); + + r.try_recv().unwrap(); + + assert_eq!(r.len(), 0); +- assert!(r.is_empty()); +- assert!(!r.is_full()); ++ assert_eq!(r.is_empty(), true); ++ assert_eq!(r.is_full(), false); + } + + #[test] +diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/zero.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/zero.rs +--- firefox-98.0/third_party/rust/crossbeam-channel/tests/zero.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-channel/tests/zero.rs 2022-03-16 09:33:31.995159961 +0100 +@@ -35,11 +35,11 @@ fn len_empty_full() { + let (s, r) = bounded(0); + + assert_eq!(s.len(), 0); +- assert!(s.is_empty()); +- assert!(s.is_full()); ++ assert_eq!(s.is_empty(), true); ++ assert_eq!(s.is_full(), true); + assert_eq!(r.len(), 0); +- assert!(r.is_empty()); +- assert!(r.is_full()); ++ assert_eq!(r.is_empty(), true); ++ assert_eq!(r.is_full(), true); + + scope(|scope| { + scope.spawn(|_| s.send(0).unwrap()); +@@ -48,11 +48,11 @@ fn len_empty_full() { + .unwrap(); + + assert_eq!(s.len(), 0); +- assert!(s.is_empty()); +- assert!(s.is_full()); ++ assert_eq!(s.is_empty(), true); ++ assert_eq!(s.is_full(), true); + assert_eq!(r.len(), 0); +- assert!(r.is_empty()); +- assert!(r.is_full()); ++ assert_eq!(r.is_empty(), true); ++ assert_eq!(r.is_full(), true); + } + + #[test] +@@ -187,9 +187,6 @@ fn send_timeout() { + + #[test] + fn len() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 25_000; + + let (s, r) = bounded(0); +@@ -252,9 +249,6 @@ fn disconnect_wakes_receiver() { + + #[test] + fn spsc() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 100_000; + + let (s, r) = bounded(0); +@@ -277,9 +271,6 @@ fn spsc() { + + #[test] + fn mpmc() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 25_000; + const THREADS: usize = 4; + +@@ -312,9 +303,6 @@ fn mpmc() { + + #[test] + fn stress_oneshot() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + for _ in 0..COUNT { +@@ -328,7 +316,6 @@ fn stress_oneshot() { + } + } + +-#[cfg_attr(miri, ignore)] // Miri is too slow + #[test] + fn stress_iter() { + const COUNT: usize = 1000; +@@ -396,11 +383,8 @@ fn stress_timeout_two_threads() { + .unwrap(); + } + +-#[cfg_attr(miri, ignore)] // Miri is too slow + #[test] + fn drops() { +- const RUNS: usize = 100; +- + static DROPS: AtomicUsize = AtomicUsize::new(0); + + #[derive(Debug, PartialEq)] +@@ -414,7 +398,7 @@ fn drops() { + + let mut rng = thread_rng(); + +- for _ in 0..RUNS { ++ for _ in 0..100 { + let steps = rng.gen_range(0..3_000); + + DROPS.store(0, Ordering::SeqCst); +@@ -444,9 +428,6 @@ fn drops() { + + #[test] + fn fairness() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + let (s1, r1) = bounded::<()>(0); +@@ -478,9 +459,6 @@ fn fairness() { + + #[test] + fn fairness_duplicates() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 10_000; + + let (s, r) = bounded::<()>(0); +@@ -539,9 +517,6 @@ fn recv_in_send() { + + #[test] + fn channel_through_channel() { +- #[cfg(miri)] +- const COUNT: usize = 100; +- #[cfg(not(miri))] + const COUNT: usize = 1000; + + type T = Box; +diff -up firefox-98.0/third_party/rust/crossbeam-epoch/benches/pin.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/benches/pin.rs +--- firefox-98.0/third_party/rust/crossbeam-epoch/benches/pin.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-epoch/benches/pin.rs 2022-03-16 09:33:31.995159961 +0100 +@@ -8,7 +8,7 @@ use test::Bencher; + + #[bench] + fn single_pin(b: &mut Bencher) { +- b.iter(epoch::pin); ++ b.iter(|| epoch::pin()); + } + + #[bench] +diff -up firefox-98.0/third_party/rust/crossbeam-epoch/build.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/build.rs +--- firefox-98.0/third_party/rust/crossbeam-epoch/build.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-epoch/build.rs 2022-03-16 09:33:31.995159961 +0100 +@@ -4,19 +4,9 @@ use std::env; + + include!("no_atomic.rs"); + +-// The rustc-cfg listed below are considered public API, but it is *unstable* +-// and outside of the normal semver guarantees: +-// +-// - `crossbeam_no_atomic_cas` +-// Assume the target does *not* support atomic CAS operations. +-// This is usually detected automatically by the build script, but you may +-// need to enable it manually when building for custom targets or using +-// non-cargo build systems that don't run the build script. +-// +-// With the exceptions mentioned above, the rustc-cfg strings below are +-// *not* public API. Please let us know by opening a GitHub issue if your build +-// environment requires some way to enable these cfgs other than by executing +-// our build script. ++// The rustc-cfg strings below are *not* public API. Please let us know by ++// opening a GitHub issue if your build environment requires some way to enable ++// these cfgs other than by executing our build script. + fn main() { + let target = match env::var("TARGET") { + Ok(target) => target, +diff -up firefox-98.0/third_party/rust/crossbeam-epoch/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/.cargo-checksum.json +--- firefox-98.0/third_party/rust/crossbeam-epoch/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-epoch/.cargo-checksum.json 2022-03-16 09:33:31.995159961 +0100 +@@ -1 +1 @@ +-{"files":{"CHANGELOG.md":"7f3c7198f2e33ba93bb8270e1c1e8dc6d70c343987acd9d0706e3632cbb9e0ad","Cargo.lock":"10e3899295e7e8ce93d3f0b597efbec844bdda40f78ae717f5995341d41ee937","Cargo.toml":"d7e7ab87ca4a4e8cc4ae9644e1537eedc46473ff5f89399b4733c4bdf59058db","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"5734ed989dfca1f625b40281ee9f4530f91b2411ec01cb748223e7eb87e201ab","README.md":"f946b25082979595d3851d90c4e76424be921a779e88e982f8455d44d46057ec","benches/defer.rs":"c330b704d96b2ad1aed29f72c37a99da534adef8cb06a3976d5f93bf567abb20","benches/flush.rs":"0389ac6c473632f0e93c962f223404cc360257f6699b4ec90b9b3be16bb6d74f","benches/pin.rs":"2f649a5153745c7930efdb32a52f9dc522f7b8cf548a251c5e2c82ee25dc3fff","build.rs":"58a36da8f9ca3a9206d31a0d6e7548f200fe8746ebca5edca48679b0d29a8043","examples/sanitize.rs":"a39d1635fa61e643e59192d7a63becc97ff81f03c1f4e03d38cedefb1525026a","no_atomic.rs":"3529c0833bcd1e09a352d3bd1696d3666850c9b09fe2111bf1a783ec16a5f467","src/atomic.rs":"63843b5ecd51b3fc98336247abe8efa824d826f142e40a761636e530d06f3b41","src/collector.rs":"e2d9780d8707e49360b3c33f2f829f29f70e6929307e65e23449b8ba6def6358","src/default.rs":"e1449bd6e61d7c19e9cbdf183f81c67c3487775fcc55572947874ca535d3d54f","src/deferred.rs":"ea532517c8ca22010ed9a624b059471c8a57b25e7925f6a5dfb391be7646a1fa","src/epoch.rs":"d31e66d8fe62299928e25867336d96391b26a4fe890a1cae0885dfcf36d6835b","src/guard.rs":"55c56ca1b2fbc067ae21108f0f7de4be91e5b41df2492055b635ed436782dd52","src/internal.rs":"67a6811b8c58e1152fd1dc17e389884025a0d99d79ab03dee26efcd0d6896690","src/lib.rs":"bcaa7c8dc9f9eb1ef6f56b4c0705db348d00b21325b6c0c1544cd7aec0613dc9","src/sync/list.rs":"10aa4c59845ab9ff1d8bcb6f594b70bbe23c320fa7a2b125fdf85df88b9d61e2","src/sync/mod.rs":"cbc6334460d73761c3dea7f99ed2ccbf267d5da3bc76c812e94f85c9f4565c6a","src/sync/queue.rs":"06173b2255677d0d39178ceb49876fda2878f491e907c595eb65643dbb43c9ba","tests/loom.rs":"db772f4478966de6ec98774ca4093171dc942da635822a0d2d3257d31188cb9b"},"package":"97242a70df9b89a65d0b6df3c4bf5b9ce03c5b7309019777fbde37e7537f8762"} +\ No newline at end of file ++{"files":{"CHANGELOG.md":"40b65a13f12e97a24c838fe2254a3563a5fe00922053ef7256ed4752876614fa","Cargo.lock":"35b1db42b892c01e72ff1f99fc7767e5e47208d083203866337f6f2f7d0738eb","Cargo.toml":"eab75399db818408fd4f45a91919b08e050e56547014816683a269270e292055","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"5734ed989dfca1f625b40281ee9f4530f91b2411ec01cb748223e7eb87e201ab","README.md":"f946b25082979595d3851d90c4e76424be921a779e88e982f8455d44d46057ec","benches/defer.rs":"c330b704d96b2ad1aed29f72c37a99da534adef8cb06a3976d5f93bf567abb20","benches/flush.rs":"0389ac6c473632f0e93c962f223404cc360257f6699b4ec90b9b3be16bb6d74f","benches/pin.rs":"80f9e65ba04a2ddec7a330172d0b0fbc698e20c221b3d8cdc70cc42e3b9099d1","build.rs":"c8684300062c73e96eae8877d03e145ee95e0cd99d4d933696caa582c08e2416","examples/sanitize.rs":"a39d1635fa61e643e59192d7a63becc97ff81f03c1f4e03d38cedefb1525026a","no_atomic.rs":"a2621c1b029c614fb0ab8e3f5cda2e839df88d90d26133181c1b901965f7eec4","src/atomic.rs":"631d3062e3c30d8e505fda3a7e2c68a88abf7617881035d6131c39cb8fdddce0","src/collector.rs":"7d636f3f96fafd033298d1c2ab126205438a46deb84895d8e28bea9eef67798a","src/default.rs":"e1449bd6e61d7c19e9cbdf183f81c67c3487775fcc55572947874ca535d3d54f","src/deferred.rs":"1ee67bd3200d3891076aac8cfc9767abdddc194602f2084d11455484096005ea","src/epoch.rs":"d31e66d8fe62299928e25867336d96391b26a4fe890a1cae0885dfcf36d6835b","src/guard.rs":"55c56ca1b2fbc067ae21108f0f7de4be91e5b41df2492055b635ed436782dd52","src/internal.rs":"f3f8131819b2a4ec4d1a6d392c734688324f3ae708bac6745e88f2930657eba1","src/lib.rs":"bcaa7c8dc9f9eb1ef6f56b4c0705db348d00b21325b6c0c1544cd7aec0613dc9","src/sync/list.rs":"10aa4c59845ab9ff1d8bcb6f594b70bbe23c320fa7a2b125fdf85df88b9d61e2","src/sync/mod.rs":"cbc6334460d73761c3dea7f99ed2ccbf267d5da3bc76c812e94f85c9f4565c6a","src/sync/queue.rs":"262e0d8f343e97df9e2a738461e4255e339710e81c479e484f9efe517ae47135","tests/loom.rs":"db772f4478966de6ec98774ca4093171dc942da635822a0d2d3257d31188cb9b"},"package":"4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd"} +\ No newline at end of file +diff -up firefox-98.0/third_party/rust/crossbeam-epoch/Cargo.lock.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/Cargo.lock +--- firefox-98.0/third_party/rust/crossbeam-epoch/Cargo.lock.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-epoch/Cargo.lock 2022-03-16 09:33:31.995159961 +0100 +@@ -3,15 +3,6 @@ + version = 3 + + [[package]] +-name = "ansi_term" +-version = "0.12.1" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +-dependencies = [ +- "winapi", +-] +- +-[[package]] + name = "autocfg" + version = "1.0.1" + source = "registry+https://github.com/rust-lang/crates.io-index" +@@ -19,9 +10,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffe + + [[package]] + name = "cc" +-version = "1.0.72" ++version = "1.0.68" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" ++checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" + + [[package]] + name = "cfg-if" +@@ -31,13 +22,13 @@ checksum = "baf1de4339761588bc0619e3cbc0 + + [[package]] + name = "const_fn" +-version = "0.4.9" ++version = "0.4.8" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" ++checksum = "f92cfa0fd5690b3cf8c1ef2cabbd9b7ef22fa53cf5e1f92b05103f6d5d1cf6e7" + + [[package]] + name = "crossbeam-epoch" +-version = "0.9.6" ++version = "0.9.5" + dependencies = [ + "cfg-if", + "const_fn", +@@ -51,9 +42,9 @@ dependencies = [ + + [[package]] + name = "crossbeam-utils" +-version = "0.8.6" ++version = "0.8.5" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" ++checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" + dependencies = [ + "cfg-if", + "lazy_static", +@@ -92,9 +83,9 @@ checksum = "e2abad23fbc42b3700f2f279844d + + [[package]] + name = "libc" +-version = "0.2.112" ++version = "0.2.95" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125" ++checksum = "789da6d93f1b866ffe175afc5322a4d76c038605a1c3319bb57b06967ca98a36" + + [[package]] + name = "log" +@@ -107,76 +98,35 @@ dependencies = [ + + [[package]] + name = "loom" +-version = "0.5.4" ++version = "0.5.0" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "edc5c7d328e32cc4954e8e01193d7f0ef5ab257b5090b70a964e099a36034309" ++checksum = "7aa5348dc45fa5f2419b6dd4ea20345e6b01b1fcc9d176a322eada1ac3f382ba" + dependencies = [ + "cfg-if", + "generator", + "scoped-tls", +- "tracing", +- "tracing-subscriber", +-] +- +-[[package]] +-name = "matchers" +-version = "0.1.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +-dependencies = [ +- "regex-automata", + ] + + [[package]] + name = "memoffset" +-version = "0.6.5" ++version = "0.6.4" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" ++checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" + dependencies = [ + "autocfg", + ] + + [[package]] +-name = "once_cell" +-version = "1.9.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" +- +-[[package]] +-name = "pin-project-lite" +-version = "0.2.8" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" +- +-[[package]] + name = "ppv-lite86" +-version = "0.2.16" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +- +-[[package]] +-name = "proc-macro2" +-version = "1.0.36" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +-dependencies = [ +- "unicode-xid", +-] +- +-[[package]] +-name = "quote" +-version = "1.0.14" ++version = "0.2.10" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "47aa80447ce4daf1717500037052af176af5d38cc3e571d9ec1c7353fc10c87d" +-dependencies = [ +- "proc-macro2", +-] ++checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + + [[package]] + name = "rand" +-version = "0.8.4" ++version = "0.8.3" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" ++checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" + dependencies = [ + "libc", + "rand_chacha", +@@ -186,9 +136,9 @@ dependencies = [ + + [[package]] + name = "rand_chacha" +-version = "0.3.1" ++version = "0.3.0" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" ++checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" + dependencies = [ + "ppv-lite86", + "rand_core", +@@ -196,51 +146,27 @@ dependencies = [ + + [[package]] + name = "rand_core" +-version = "0.6.3" ++version = "0.6.2" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" ++checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" + dependencies = [ + "getrandom", + ] + + [[package]] + name = "rand_hc" +-version = "0.3.1" ++version = "0.3.0" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" ++checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" + dependencies = [ + "rand_core", + ] + + [[package]] +-name = "regex" +-version = "1.5.4" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +-dependencies = [ +- "regex-syntax", +-] +- +-[[package]] +-name = "regex-automata" +-version = "0.1.10" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +-dependencies = [ +- "regex-syntax", +-] +- +-[[package]] +-name = "regex-syntax" +-version = "0.6.25" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +- +-[[package]] + name = "rustversion" +-version = "1.0.6" ++version = "1.0.5" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" ++checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" + + [[package]] + name = "scoped-tls" +@@ -255,108 +181,6 @@ source = "registry+https://github.com/ru + checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + + [[package]] +-name = "sharded-slab" +-version = "0.1.4" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +-dependencies = [ +- "lazy_static", +-] +- +-[[package]] +-name = "smallvec" +-version = "1.7.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" +- +-[[package]] +-name = "syn" +-version = "1.0.85" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "a684ac3dcd8913827e18cd09a68384ee66c1de24157e3c556c9ab16d85695fb7" +-dependencies = [ +- "proc-macro2", +- "quote", +- "unicode-xid", +-] +- +-[[package]] +-name = "thread_local" +-version = "1.1.3" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" +-dependencies = [ +- "once_cell", +-] +- +-[[package]] +-name = "tracing" +-version = "0.1.29" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" +-dependencies = [ +- "cfg-if", +- "pin-project-lite", +- "tracing-attributes", +- "tracing-core", +-] +- +-[[package]] +-name = "tracing-attributes" +-version = "0.1.18" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" +-dependencies = [ +- "proc-macro2", +- "quote", +- "syn", +-] +- +-[[package]] +-name = "tracing-core" +-version = "0.1.21" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" +-dependencies = [ +- "lazy_static", +-] +- +-[[package]] +-name = "tracing-log" +-version = "0.1.2" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" +-dependencies = [ +- "lazy_static", +- "log", +- "tracing-core", +-] +- +-[[package]] +-name = "tracing-subscriber" +-version = "0.3.5" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "5d81bfa81424cc98cb034b837c985b7a290f592e5b4322f353f94a0ab0f9f594" +-dependencies = [ +- "ansi_term", +- "lazy_static", +- "matchers", +- "regex", +- "sharded-slab", +- "smallvec", +- "thread_local", +- "tracing", +- "tracing-core", +- "tracing-log", +-] +- +-[[package]] +-name = "unicode-xid" +-version = "0.2.2" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +- +-[[package]] + name = "wasi" + version = "0.10.2+wasi-snapshot-preview1" + source = "registry+https://github.com/rust-lang/crates.io-index" +diff -up firefox-98.0/third_party/rust/crossbeam-epoch/Cargo.toml.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/Cargo.toml +--- firefox-98.0/third_party/rust/crossbeam-epoch/Cargo.toml.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-epoch/Cargo.toml 2022-03-16 09:33:31.995159961 +0100 +@@ -3,19 +3,21 @@ + # When uploading crates to the registry Cargo will automatically + # "normalize" Cargo.toml files for maximal compatibility + # with all versions of Cargo and also rewrite `path` dependencies +-# to registry (e.g., crates.io) dependencies. ++# to registry (e.g., crates.io) dependencies + # +-# If you are reading this file be aware that the original Cargo.toml +-# will likely look very different (and much more reasonable). +-# See Cargo.toml.orig for the original contents. ++# If you believe there's an error in this file please file an ++# issue against the rust-lang/cargo repository. If you're ++# editing this file be aware that the upstream Cargo.toml ++# will likely look very different (and much more reasonable) + + [package] + edition = "2018" +-rust-version = "1.36" + name = "crossbeam-epoch" +-version = "0.9.6" ++version = "0.9.5" ++authors = ["The Crossbeam Project Developers"] + description = "Epoch-based garbage collection" + homepage = "https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-epoch" ++documentation = "https://docs.rs/crossbeam-epoch" + keywords = ["lock-free", "rcu", "atomic", "garbage"] + categories = ["concurrency", "memory-management", "no-std"] + license = "MIT OR Apache-2.0" +diff -up firefox-98.0/third_party/rust/crossbeam-epoch/CHANGELOG.md.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/CHANGELOG.md +--- firefox-98.0/third_party/rust/crossbeam-epoch/CHANGELOG.md.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-epoch/CHANGELOG.md 2022-03-16 09:33:31.995159961 +0100 +@@ -1,16 +1,12 @@ +-# Version 0.9.6 +- +-- Add `Atomic::fetch_update`. (#706) +- + # Version 0.9.5 + +-- Fix UB in `Pointable` impl of `[MaybeUninit]`. (#694) +-- Support targets that do not have atomic CAS on stable Rust. (#698) +-- Fix breakage with nightly feature due to rust-lang/rust#84510. (#692) ++- Fix UB in `Pointable` impl of `[MaybeUninit]` (#694) ++- Support targets that do not have atomic CAS on stable Rust (#698) ++- Fix breakage with nightly feature due to rust-lang/rust#84510 (#692) + + # Version 0.9.4 + +-- Fix UB in `<[MaybeUninit] as Pointable>::init` when global allocator failed allocation. (#690) ++- Fix UB in `<[MaybeUninit] as Pointable>::init` when global allocator failed allocation (#690) + - Bump `loom` dependency to version 0.5. (#686) + + # Version 0.9.3 +diff -up firefox-98.0/third_party/rust/crossbeam-epoch/no_atomic.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/no_atomic.rs +--- firefox-98.0/third_party/rust/crossbeam-epoch/no_atomic.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-epoch/no_atomic.rs 2022-03-16 09:33:31.995159961 +0100 +@@ -3,8 +3,6 @@ + + const NO_ATOMIC_CAS: &[&str] = &[ + "avr-unknown-gnu-atmega328", +- "bpfeb-unknown-none", +- "bpfel-unknown-none", + "msp430-none-elf", + "riscv32i-unknown-none-elf", + "riscv32imc-unknown-none-elf", +@@ -23,7 +21,6 @@ const NO_ATOMIC_64: &[&str] = &[ + "armv7r-none-eabi", + "armv7r-none-eabihf", + "hexagon-unknown-linux-musl", +- "m68k-unknown-linux-gnu", + "mips-unknown-linux-gnu", + "mips-unknown-linux-musl", + "mips-unknown-linux-uclibc", +@@ -33,7 +30,6 @@ const NO_ATOMIC_64: &[&str] = &[ + "mipsel-unknown-none", + "mipsisa32r6-unknown-linux-gnu", + "mipsisa32r6el-unknown-linux-gnu", +- "powerpc-unknown-freebsd", + "powerpc-unknown-linux-gnu", + "powerpc-unknown-linux-gnuspe", + "powerpc-unknown-linux-musl", +@@ -44,14 +40,12 @@ const NO_ATOMIC_64: &[&str] = &[ + "riscv32gc-unknown-linux-gnu", + "riscv32gc-unknown-linux-musl", + "riscv32imac-unknown-none-elf", +- "riscv32imc-esp-espidf", + "thumbv7em-none-eabi", + "thumbv7em-none-eabihf", + "thumbv7m-none-eabi", + "thumbv8m.base-none-eabi", + "thumbv8m.main-none-eabi", + "thumbv8m.main-none-eabihf", +- "armv6k-nintendo-3ds", + "mipsel-sony-psp", + "thumbv4t-none-eabi", + "thumbv6m-none-eabi", +diff -up firefox-98.0/third_party/rust/crossbeam-epoch/src/atomic.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/src/atomic.rs +--- firefox-98.0/third_party/rust/crossbeam-epoch/src/atomic.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-epoch/src/atomic.rs 2022-03-16 09:33:31.995159961 +0100 +@@ -562,65 +562,6 @@ impl Atomic { + }) + } + +- /// Fetches the pointer, and then applies a function to it that returns a new value. +- /// Returns a `Result` of `Ok(previous_value)` if the function returned `Some`, else `Err(_)`. +- /// +- /// Note that the given function may be called multiple times if the value has been changed by +- /// other threads in the meantime, as long as the function returns `Some(_)`, but the function +- /// will have been applied only once to the stored value. +- /// +- /// `fetch_update` takes two [`Ordering`] arguments to describe the memory +- /// ordering of this operation. The first describes the required ordering for +- /// when the operation finally succeeds while the second describes the +- /// required ordering for loads. These correspond to the success and failure +- /// orderings of [`Atomic::compare_exchange`] respectively. +- /// +- /// Using [`Acquire`] as success ordering makes the store part of this +- /// operation [`Relaxed`], and using [`Release`] makes the final successful +- /// load [`Relaxed`]. The (failed) load ordering can only be [`SeqCst`], +- /// [`Acquire`] or [`Relaxed`] and must be equivalent to or weaker than the +- /// success ordering. +- /// +- /// [`Relaxed`]: Ordering::Relaxed +- /// [`Acquire`]: Ordering::Acquire +- /// [`Release`]: Ordering::Release +- /// [`SeqCst`]: Ordering::SeqCst +- /// +- /// # Examples +- /// +- /// ``` +- /// use crossbeam_epoch::{self as epoch, Atomic}; +- /// use std::sync::atomic::Ordering::SeqCst; +- /// +- /// let a = Atomic::new(1234); +- /// let guard = &epoch::pin(); +- /// +- /// let res1 = a.fetch_update(SeqCst, SeqCst, guard, |x| Some(x.with_tag(1))); +- /// assert!(res1.is_ok()); +- /// +- /// let res2 = a.fetch_update(SeqCst, SeqCst, guard, |x| None); +- /// assert!(res2.is_err()); +- /// ``` +- pub fn fetch_update<'g, F>( +- &self, +- set_order: Ordering, +- fail_order: Ordering, +- guard: &'g Guard, +- mut func: F, +- ) -> Result, Shared<'g, T>> +- where +- F: FnMut(Shared<'g, T>) -> Option>, +- { +- let mut prev = self.load(fail_order, guard); +- while let Some(next) = func(prev) { +- match self.compare_exchange_weak(prev, next, set_order, fail_order, guard) { +- Ok(shared) => return Ok(shared), +- Err(next_prev) => prev = next_prev.current, +- } +- } +- Err(prev) +- } +- + /// Stores the pointer `new` (either `Shared` or `Owned`) into the atomic pointer if the current + /// value is the same as `current`. The tag is also taken into account, so two pointers to the + /// same object, but with different tags, will not be considered equal. +diff -up firefox-98.0/third_party/rust/crossbeam-epoch/src/collector.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/src/collector.rs +--- firefox-98.0/third_party/rust/crossbeam-epoch/src/collector.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:40.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-epoch/src/collector.rs 2022-03-16 09:33:31.995159961 +0100 +@@ -178,18 +178,13 @@ mod tests { + + #[test] + fn pin_holds_advance() { +- #[cfg(miri)] +- const N: usize = 500; +- #[cfg(not(miri))] +- const N: usize = 500_000; +- + let collector = Collector::new(); + + thread::scope(|scope| { + for _ in 0..NUM_THREADS { + scope.spawn(|_| { + let handle = collector.register(); +- for _ in 0..N { ++ for _ in 0..500_000 { + let guard = &handle.pin(); + + let before = collector.global.epoch.load(Ordering::Relaxed); +@@ -207,9 +202,6 @@ mod tests { + #[cfg(not(crossbeam_sanitize))] // TODO: assertions failed due to `cfg(crossbeam_sanitize)` reduce `internal::MAX_OBJECTS` + #[test] + fn incremental() { +- #[cfg(miri)] +- const COUNT: usize = 500; +- #[cfg(not(miri))] + const COUNT: usize = 100_000; + static DESTROYS: AtomicUsize = AtomicUsize::new(0); + +@@ -238,16 +230,12 @@ mod tests { + let guard = &handle.pin(); + collector.global.collect(guard); + } +- assert!(DESTROYS.load(Ordering::Relaxed) == COUNT); ++ assert!(DESTROYS.load(Ordering::Relaxed) == 100_000); + } + + #[test] + fn buffering() { + const COUNT: usize = 10; +- #[cfg(miri)] +- const N: usize = 500; +- #[cfg(not(miri))] +- const N: usize = 100_000; + static DESTROYS: AtomicUsize = AtomicUsize::new(0); + + let collector = Collector::new(); +@@ -264,7 +252,7 @@ mod tests { + } + } + +- for _ in 0..N { ++ for _ in 0..100_000 { + collector.global.collect(&handle.pin()); + } + assert!(DESTROYS.load(Ordering::Relaxed) < COUNT); +@@ -280,9 +268,6 @@ mod tests { + + #[test] + fn count_drops() { +- #[cfg(miri)] +- const COUNT: usize = 500; +- #[cfg(not(miri))] + const COUNT: usize = 100_000; + static DROPS: AtomicUsize = AtomicUsize::new(0); + +@@ -316,9 +301,6 @@ mod tests { + + #[test] + fn count_destroy() { +- #[cfg(miri)] +- const COUNT: usize = 500; +- #[cfg(not(miri))] + const COUNT: usize = 100_000; + static DESTROYS: AtomicUsize = AtomicUsize::new(0); + +@@ -385,9 +367,6 @@ mod tests { + + #[test] + fn destroy_array() { +- #[cfg(miri)] +- const COUNT: usize = 500; +- #[cfg(not(miri))] + const COUNT: usize = 100_000; + static DESTROYS: AtomicUsize = AtomicUsize::new(0); + +@@ -423,9 +402,6 @@ mod tests { + #[test] + fn stress() { + const THREADS: usize = 8; +- #[cfg(miri)] +- const COUNT: usize = 500; +- #[cfg(not(miri))] + const COUNT: usize = 100_000; + static DROPS: AtomicUsize = AtomicUsize::new(0); + +diff -up firefox-98.0/third_party/rust/crossbeam-epoch/src/deferred.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/src/deferred.rs +--- firefox-98.0/third_party/rust/crossbeam-epoch/src/deferred.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-epoch/src/deferred.rs 2022-03-16 09:33:31.995159961 +0100 +@@ -81,8 +81,6 @@ impl Deferred { + + #[cfg(all(test, not(crossbeam_loom)))] + mod tests { +- #![allow(clippy::drop_copy)] +- + use super::Deferred; + use std::cell::Cell; + +diff -up firefox-98.0/third_party/rust/crossbeam-epoch/src/internal.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/src/internal.rs +--- firefox-98.0/third_party/rust/crossbeam-epoch/src/internal.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-epoch/src/internal.rs 2022-03-16 09:33:31.995159961 +0100 +@@ -101,7 +101,7 @@ impl Bag { + + /// Seals the bag with the given epoch. + fn seal(self, epoch: Epoch) -> SealedBag { +- SealedBag { epoch, _bag: self } ++ SealedBag { epoch, bag: self } + } + } + +@@ -216,7 +216,7 @@ fn no_op_func() {} + #[derive(Default, Debug)] + struct SealedBag { + epoch: Epoch, +- _bag: Bag, ++ bag: Bag, + } + + /// It is safe to share `SealedBag` because `is_expired` only inspects the epoch. +@@ -311,7 +311,7 @@ impl Global { + // TODO(stjepang): `Local`s are stored in a linked list because linked lists are fairly + // easy to implement in a lock-free manner. However, traversal can be slow due to cache + // misses and data dependencies. We should experiment with other data structures as well. +- for local in self.locals.iter(guard) { ++ for local in self.locals.iter(&guard) { + match local { + Err(IterError::Stalled) => { + // A concurrent thread stalled this iteration. That thread might also try to +diff -up firefox-98.0/third_party/rust/crossbeam-epoch/src/sync/queue.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/src/sync/queue.rs +--- firefox-98.0/third_party/rust/crossbeam-epoch/src/sync/queue.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:40.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-epoch/src/sync/queue.rs 2022-03-16 09:33:31.996159993 +0100 +@@ -259,9 +259,6 @@ mod test { + } + } + +- #[cfg(miri)] +- const CONC_COUNT: i64 = 1000; +- #[cfg(not(miri))] + const CONC_COUNT: i64 = 1000000; + + #[test] +@@ -425,8 +422,8 @@ mod test { + + let mut vl2 = vl.clone(); + let mut vr2 = vr.clone(); +- vl2.sort_unstable(); +- vr2.sort_unstable(); ++ vl2.sort(); ++ vr2.sort(); + + assert_eq!(vl, vl2); + assert_eq!(vr, vr2); +diff -up firefox-98.0/third_party/rust/crossbeam-utils/build.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-utils/build.rs +--- firefox-98.0/third_party/rust/crossbeam-utils/build.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-utils/build.rs 2022-03-16 09:33:31.996159993 +0100 +@@ -4,31 +4,9 @@ use std::env; + + include!("no_atomic.rs"); + +-// The rustc-cfg listed below are considered public API, but it is *unstable* +-// and outside of the normal semver guarantees: +-// +-// - `crossbeam_no_atomic_cas` +-// Assume the target does *not* support atomic CAS operations. +-// This is usually detected automatically by the build script, but you may +-// need to enable it manually when building for custom targets or using +-// non-cargo build systems that don't run the build script. +-// +-// - `crossbeam_no_atomic` +-// Assume the target does *not* support any atomic operations. +-// This is usually detected automatically by the build script, but you may +-// need to enable it manually when building for custom targets or using +-// non-cargo build systems that don't run the build script. +-// +-// - `crossbeam_no_atomic_64` +-// Assume the target does *not* support AtomicU64/AtomicI64. +-// This is usually detected automatically by the build script, but you may +-// need to enable it manually when building for custom targets or using +-// non-cargo build systems that don't run the build script. +-// +-// With the exceptions mentioned above, the rustc-cfg strings below are +-// *not* public API. Please let us know by opening a GitHub issue if your build +-// environment requires some way to enable these cfgs other than by executing +-// our build script. ++// The rustc-cfg strings below are *not* public API. Please let us know by ++// opening a GitHub issue if your build environment requires some way to enable ++// these cfgs other than by executing our build script. + fn main() { + let target = match env::var("TARGET") { + Ok(target) => target, +diff -up firefox-98.0/third_party/rust/crossbeam-utils/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-utils/.cargo-checksum.json +--- firefox-98.0/third_party/rust/crossbeam-utils/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-utils/.cargo-checksum.json 2022-03-16 09:33:31.996159993 +0100 +@@ -1 +1 @@ +-{"files":{"CHANGELOG.md":"097eb3484f4f13471dfe6879ce61450cc60d4453aecb924f38a8f0e4af593cdd","Cargo.toml":"2734493ab832f12a4f849c333d2dd11760c6ce614b88355da21118f77acdcd70","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"5734ed989dfca1f625b40281ee9f4530f91b2411ec01cb748223e7eb87e201ab","README.md":"dfa9fbed47c344c134a63c84b7c0e4651baeac1554b7b3266d0e38643743fc33","benches/atomic_cell.rs":"c927eb3cd1e5ecc4b91adbc3bde98af15ffab4086190792ba64d5cde0e24df3d","build.rs":"39cf39e855e52559c8f68880a02b3e2778ae2d8f089650af1b3e34a85898aed7","no_atomic.rs":"3529c0833bcd1e09a352d3bd1696d3666850c9b09fe2111bf1a783ec16a5f467","src/atomic/atomic_cell.rs":"9d0785073f506b75c110270947f6a8367ead7faaf29c507d4ede37125310cff6","src/atomic/consume.rs":"7a7736fcd64f6473dfea7653559ffc5e1a2a234df43835f8aa8734862145ac15","src/atomic/mod.rs":"7f6afd5bd0da1f7b51765ab04da4e5f683588ac2d23506e61bf7007bb1e61ba2","src/atomic/seq_lock.rs":"27182e6b87a9db73c5f6831759f8625f9fcdec3c2828204c444aef04f427735a","src/atomic/seq_lock_wide.rs":"9888dd03116bb89ca36d4ab8d5a0b5032107a2983a7eb8024454263b09080088","src/backoff.rs":"7cc7754e15f69b52e92a70d4f49d1bc274693455a0933a2d7eb0605806566af3","src/cache_padded.rs":"6a512698115ad0d5a5b163dbd7a83247e1f1c146c4a30f3fc74b952e3b767b59","src/lib.rs":"6f1bcf157abe06ad8458a53e865bf8efab9fad4a9424790147cee8fefb3795d8","src/sync/mod.rs":"59986f559a8f170a4b3247ab2eea2460b09809d87c8110ed88e4e7103d3519dc","src/sync/parker.rs":"3f997f5b41fec286ccedcf3d36f801d741387badb574820b8e3456117ecd9154","src/sync/sharded_lock.rs":"14be659744918d0b27db24c56b41c618b0f0484b6761da46561023d96c4c120f","src/sync/wait_group.rs":"32e946a7581c55f8aa9904527b92b177c538fa0cf7cbcfa1d1f25990582cb6ea","src/thread.rs":"6a7676fd4e50af63aec6f655121a10cd6e8c704f4677125388186ba58dc5842d","tests/atomic_cell.rs":"ba2e34ed1e27f0d0d4f1bb8a5feb4eb8131f756adb27a719de52c26ee7b86b9c","tests/cache_padded.rs":"1bfaff8354c8184e1ee1f902881ca9400b60effb273b0d3f752801a483d2b66d","tests/parker.rs":"6def4721287d9d70b1cfd63ebb34e1c83fbb3376edbad2bc8aac6ef69dd99d20","tests/sharded_lock.rs":"eb6c5b59f007e0d290dd0f58758e8ccb5cacd38af34e3341368ced815f0c41be","tests/thread.rs":"9a7d7d3028c552fd834c68598b04a1cc252a816bc20ab62cec060d6cd09cab10","tests/wait_group.rs":"ad8f0cdfed31f9594a2e0737234d418f8b924d784a4db8d7e469deab8c95f5f8"},"package":"cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120"} +\ No newline at end of file ++{"files":{"CHANGELOG.md":"5242f1740c65509c465c9a36326d344722facff5f5e58dd064f7b77806b83a46","Cargo.toml":"ac35a7b8ccb16f1ab256951576537aa4179a316c068929c2acef89e0adc12319","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"5734ed989dfca1f625b40281ee9f4530f91b2411ec01cb748223e7eb87e201ab","README.md":"dfa9fbed47c344c134a63c84b7c0e4651baeac1554b7b3266d0e38643743fc33","benches/atomic_cell.rs":"c927eb3cd1e5ecc4b91adbc3bde98af15ffab4086190792ba64d5cde0e24df3d","build.rs":"68cfc4be02429834a19411fba29cb1cb52c841f03ac8104d1bae59a8b2184f9c","no_atomic.rs":"a2621c1b029c614fb0ab8e3f5cda2e839df88d90d26133181c1b901965f7eec4","src/atomic/atomic_cell.rs":"1a3a1e073340317b5ce7a94e29c6a87db89ff7e00da6b92cb3c0339364c3b084","src/atomic/consume.rs":"7a7736fcd64f6473dfea7653559ffc5e1a2a234df43835f8aa8734862145ac15","src/atomic/mod.rs":"7f6afd5bd0da1f7b51765ab04da4e5f683588ac2d23506e61bf7007bb1e61ba2","src/atomic/seq_lock.rs":"27182e6b87a9db73c5f6831759f8625f9fcdec3c2828204c444aef04f427735a","src/atomic/seq_lock_wide.rs":"9888dd03116bb89ca36d4ab8d5a0b5032107a2983a7eb8024454263b09080088","src/backoff.rs":"7cc7754e15f69b52e92a70d4f49d1bc274693455a0933a2d7eb0605806566af3","src/cache_padded.rs":"6a512698115ad0d5a5b163dbd7a83247e1f1c146c4a30f3fc74b952e3b767b59","src/lib.rs":"6f1bcf157abe06ad8458a53e865bf8efab9fad4a9424790147cee8fefb3795d8","src/sync/mod.rs":"59986f559a8f170a4b3247ab2eea2460b09809d87c8110ed88e4e7103d3519dc","src/sync/parker.rs":"ba8f75bff31b8be9275808e8f393e71cc682dfc1109ceccb12f69a3700cff5be","src/sync/sharded_lock.rs":"14be659744918d0b27db24c56b41c618b0f0484b6761da46561023d96c4c120f","src/sync/wait_group.rs":"32e946a7581c55f8aa9904527b92b177c538fa0cf7cbcfa1d1f25990582cb6ea","src/thread.rs":"0eb5ec1d3c1b40600d88eb70539d14276e32307f5bed2b679f50f6a20777a01e","tests/atomic_cell.rs":"6c9453384ecbbe76f8b97b62f022d478d3a76b4eae1e960f49790970f5d52158","tests/cache_padded.rs":"1bfaff8354c8184e1ee1f902881ca9400b60effb273b0d3f752801a483d2b66d","tests/parker.rs":"6def4721287d9d70b1cfd63ebb34e1c83fbb3376edbad2bc8aac6ef69dd99d20","tests/sharded_lock.rs":"726025ce6351fb56ed629d5a56bdf6e833b7afc5dedfa08de0b056c726b6c26d","tests/thread.rs":"9a7d7d3028c552fd834c68598b04a1cc252a816bc20ab62cec060d6cd09cab10","tests/wait_group.rs":"ad8f0cdfed31f9594a2e0737234d418f8b924d784a4db8d7e469deab8c95f5f8"},"package":"d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db"} +\ No newline at end of file +diff -up firefox-98.0/third_party/rust/crossbeam-utils/Cargo.toml.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-utils/Cargo.toml +--- firefox-98.0/third_party/rust/crossbeam-utils/Cargo.toml.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-utils/Cargo.toml 2022-03-16 09:33:31.996159993 +0100 +@@ -3,19 +3,21 @@ + # When uploading crates to the registry Cargo will automatically + # "normalize" Cargo.toml files for maximal compatibility + # with all versions of Cargo and also rewrite `path` dependencies +-# to registry (e.g., crates.io) dependencies. ++# to registry (e.g., crates.io) dependencies + # +-# If you are reading this file be aware that the original Cargo.toml +-# will likely look very different (and much more reasonable). +-# See Cargo.toml.orig for the original contents. ++# If you believe there's an error in this file please file an ++# issue against the rust-lang/cargo repository. If you're ++# editing this file be aware that the upstream Cargo.toml ++# will likely look very different (and much more reasonable) + + [package] + edition = "2018" +-rust-version = "1.36" + name = "crossbeam-utils" +-version = "0.8.6" ++version = "0.8.5" ++authors = ["The Crossbeam Project Developers"] + description = "Utilities for concurrent programming" + homepage = "https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-utils" ++documentation = "https://docs.rs/crossbeam-utils" + keywords = ["scoped", "thread", "atomic", "cache"] + categories = ["algorithms", "concurrency", "data-structures", "no-std"] + license = "MIT OR Apache-2.0" +@@ -29,9 +31,6 @@ optional = true + [dev-dependencies.rand] + version = "0.8" + +-[dev-dependencies.rustversion] +-version = "1" +- + [features] + default = ["std"] + nightly = [] +diff -up firefox-98.0/third_party/rust/crossbeam-utils/CHANGELOG.md.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-utils/CHANGELOG.md +--- firefox-98.0/third_party/rust/crossbeam-utils/CHANGELOG.md.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-utils/CHANGELOG.md 2022-03-16 09:33:31.996159993 +0100 +@@ -1,12 +1,7 @@ +-# Version 0.8.6 +- +-- Re-add `AtomicCell<{i,u}64>::{fetch_add,fetch_sub,fetch_and,fetch_or,fetch_xor}` that were accidentally removed in 0.8.0 on targets that do not support `Atomic{I,U}64`. (#767) +-- Re-add `AtomicCell<{i,u}128>::{fetch_add,fetch_sub,fetch_and,fetch_or,fetch_xor}` that were accidentally removed in 0.8.0. (#767) +- + # Version 0.8.5 + +-- Add `AtomicCell::fetch_update`. (#704) +-- Support targets that do not have atomic CAS on stable Rust. (#698) ++- Add `AtomicCell::fetch_update` (#704) ++- Support targets that do not have atomic CAS on stable Rust (#698) + + # Version 0.8.4 + +diff -up firefox-98.0/third_party/rust/crossbeam-utils/no_atomic.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-utils/no_atomic.rs +--- firefox-98.0/third_party/rust/crossbeam-utils/no_atomic.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-utils/no_atomic.rs 2022-03-16 09:33:31.996159993 +0100 +@@ -3,8 +3,6 @@ + + const NO_ATOMIC_CAS: &[&str] = &[ + "avr-unknown-gnu-atmega328", +- "bpfeb-unknown-none", +- "bpfel-unknown-none", + "msp430-none-elf", + "riscv32i-unknown-none-elf", + "riscv32imc-unknown-none-elf", +@@ -23,7 +21,6 @@ const NO_ATOMIC_64: &[&str] = &[ + "armv7r-none-eabi", + "armv7r-none-eabihf", + "hexagon-unknown-linux-musl", +- "m68k-unknown-linux-gnu", + "mips-unknown-linux-gnu", + "mips-unknown-linux-musl", + "mips-unknown-linux-uclibc", +@@ -33,7 +30,6 @@ const NO_ATOMIC_64: &[&str] = &[ + "mipsel-unknown-none", + "mipsisa32r6-unknown-linux-gnu", + "mipsisa32r6el-unknown-linux-gnu", +- "powerpc-unknown-freebsd", + "powerpc-unknown-linux-gnu", + "powerpc-unknown-linux-gnuspe", + "powerpc-unknown-linux-musl", +@@ -44,14 +40,12 @@ const NO_ATOMIC_64: &[&str] = &[ + "riscv32gc-unknown-linux-gnu", + "riscv32gc-unknown-linux-musl", + "riscv32imac-unknown-none-elf", +- "riscv32imc-esp-espidf", + "thumbv7em-none-eabi", + "thumbv7em-none-eabihf", + "thumbv7m-none-eabi", + "thumbv8m.base-none-eabi", + "thumbv8m.main-none-eabi", + "thumbv8m.main-none-eabihf", +- "armv6k-nintendo-3ds", + "mipsel-sony-psp", + "thumbv4t-none-eabi", + "thumbv6m-none-eabi", +diff -up firefox-98.0/third_party/rust/crossbeam-utils/src/atomic/atomic_cell.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-utils/src/atomic/atomic_cell.rs +--- firefox-98.0/third_party/rust/crossbeam-utils/src/atomic/atomic_cell.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-utils/src/atomic/atomic_cell.rs 2022-03-16 09:33:31.996159993 +0100 +@@ -295,7 +295,7 @@ impl AtomicCell { + } + + macro_rules! impl_arithmetic { +- ($t:ty, fallback, $example:tt) => { ++ ($t:ty, $example:tt) => { + impl AtomicCell<$t> { + /// Increments the current value by `val` and returns the previous value. + /// +@@ -313,13 +313,10 @@ macro_rules! impl_arithmetic { + /// ``` + #[inline] + pub fn fetch_add(&self, val: $t) -> $t { +- #[cfg(crossbeam_loom)] +- { +- let _ = val; +- unimplemented!("loom does not support non-atomic atomic ops"); +- } +- #[cfg(not(crossbeam_loom))] +- { ++ if can_transmute::<$t, atomic::AtomicUsize>() { ++ let a = unsafe { &*(self.value.get() as *const atomic::AtomicUsize) }; ++ a.fetch_add(val as usize, Ordering::AcqRel) as $t ++ } else { + let _guard = lock(self.value.get() as usize).write(); + let value = unsafe { &mut *(self.value.get()) }; + let old = *value; +@@ -344,13 +341,10 @@ macro_rules! impl_arithmetic { + /// ``` + #[inline] + pub fn fetch_sub(&self, val: $t) -> $t { +- #[cfg(crossbeam_loom)] +- { +- let _ = val; +- unimplemented!("loom does not support non-atomic atomic ops"); +- } +- #[cfg(not(crossbeam_loom))] +- { ++ if can_transmute::<$t, atomic::AtomicUsize>() { ++ let a = unsafe { &*(self.value.get() as *const atomic::AtomicUsize) }; ++ a.fetch_sub(val as usize, Ordering::AcqRel) as $t ++ } else { + let _guard = lock(self.value.get() as usize).write(); + let value = unsafe { &mut *(self.value.get()) }; + let old = *value; +@@ -373,13 +367,10 @@ macro_rules! impl_arithmetic { + /// ``` + #[inline] + pub fn fetch_and(&self, val: $t) -> $t { +- #[cfg(crossbeam_loom)] +- { +- let _ = val; +- unimplemented!("loom does not support non-atomic atomic ops"); +- } +- #[cfg(not(crossbeam_loom))] +- { ++ if can_transmute::<$t, atomic::AtomicUsize>() { ++ let a = unsafe { &*(self.value.get() as *const atomic::AtomicUsize) }; ++ a.fetch_and(val as usize, Ordering::AcqRel) as $t ++ } else { + let _guard = lock(self.value.get() as usize).write(); + let value = unsafe { &mut *(self.value.get()) }; + let old = *value; +@@ -402,13 +393,10 @@ macro_rules! impl_arithmetic { + /// ``` + #[inline] + pub fn fetch_or(&self, val: $t) -> $t { +- #[cfg(crossbeam_loom)] +- { +- let _ = val; +- unimplemented!("loom does not support non-atomic atomic ops"); +- } +- #[cfg(not(crossbeam_loom))] +- { ++ if can_transmute::<$t, atomic::AtomicUsize>() { ++ let a = unsafe { &*(self.value.get() as *const atomic::AtomicUsize) }; ++ a.fetch_or(val as usize, Ordering::AcqRel) as $t ++ } else { + let _guard = lock(self.value.get() as usize).write(); + let value = unsafe { &mut *(self.value.get()) }; + let old = *value; +@@ -431,13 +419,10 @@ macro_rules! impl_arithmetic { + /// ``` + #[inline] + pub fn fetch_xor(&self, val: $t) -> $t { +- #[cfg(crossbeam_loom)] +- { +- let _ = val; +- unimplemented!("loom does not support non-atomic atomic ops"); +- } +- #[cfg(not(crossbeam_loom))] +- { ++ if can_transmute::<$t, atomic::AtomicUsize>() { ++ let a = unsafe { &*(self.value.get() as *const atomic::AtomicUsize) }; ++ a.fetch_xor(val as usize, Ordering::AcqRel) as $t ++ } else { + let _guard = lock(self.value.get() as usize).write(); + let value = unsafe { &mut *(self.value.get()) }; + let old = *value; +@@ -556,15 +541,9 @@ impl_arithmetic!(i32, atomic::AtomicI32, + impl_arithmetic!(u64, atomic::AtomicU64, "let a = AtomicCell::new(7u64);"); + #[cfg(not(crossbeam_no_atomic_64))] + impl_arithmetic!(i64, atomic::AtomicI64, "let a = AtomicCell::new(7i64);"); +-#[cfg(crossbeam_no_atomic_64)] +-impl_arithmetic!(u64, fallback, "let a = AtomicCell::new(7u64);"); +-#[cfg(crossbeam_no_atomic_64)] +-impl_arithmetic!(i64, fallback, "let a = AtomicCell::new(7i64);"); + // TODO: AtomicU128 is unstable + // impl_arithmetic!(u128, atomic::AtomicU128, "let a = AtomicCell::new(7u128);"); + // impl_arithmetic!(i128, atomic::AtomicI128, "let a = AtomicCell::new(7i128);"); +-impl_arithmetic!(u128, fallback, "let a = AtomicCell::new(7u128);"); +-impl_arithmetic!(i128, fallback, "let a = AtomicCell::new(7i128);"); + + impl_arithmetic!( + usize, +@@ -704,13 +683,105 @@ fn lock(addr: usize) -> &'static SeqLock + // stored at addresses that are multiples of 3. It'd be too bad if `LEN` was divisible by 3. + // In order to protect from such cases, we simply choose a large prime number for `LEN`. + const LEN: usize = 97; +- #[allow(clippy::declare_interior_mutable_const)] +- const L: SeqLock = SeqLock::new(); ++ + static LOCKS: [SeqLock; LEN] = [ +- L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, +- L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, +- L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, +- L, L, L, L, L, L, L, ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), ++ SeqLock::new(), + ]; + + // If the modulus is a constant number, the compiler will use crazy math to transform this into +@@ -762,6 +833,7 @@ macro_rules! atomic { + ($t:ty, $a:ident, $atomic_op:expr, $fallback_op:expr) => { + loop { + atomic!(@check, $t, AtomicUnit, $a, $atomic_op); ++ atomic!(@check, $t, atomic::AtomicUsize, $a, $atomic_op); + + atomic!(@check, $t, atomic::AtomicU8, $a, $atomic_op); + atomic!(@check, $t, atomic::AtomicU16, $a, $atomic_op); +@@ -783,6 +855,7 @@ macro_rules! atomic { + const fn atomic_is_lock_free() -> bool { + // HACK(taiki-e): This is equivalent to `atomic! { T, _a, true, false }`, but can be used in const fn even in Rust 1.36. + let is_lock_free = can_transmute::() ++ | can_transmute::() + | can_transmute::() + | can_transmute::() + | can_transmute::(); +diff -up firefox-98.0/third_party/rust/crossbeam-utils/src/sync/parker.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-utils/src/sync/parker.rs +--- firefox-98.0/third_party/rust/crossbeam-utils/src/sync/parker.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-utils/src/sync/parker.rs 2022-03-16 09:33:31.996159993 +0100 +@@ -175,7 +175,6 @@ impl Parker { + /// + /// let p = Parker::new(); + /// let raw = Parker::into_raw(p); +- /// # let _ = unsafe { Parker::from_raw(raw) }; + /// ``` + pub fn into_raw(this: Parker) -> *const () { + Unparker::into_raw(this.unparker) +@@ -259,7 +258,6 @@ impl Unparker { + /// let p = Parker::new(); + /// let u = p.unparker().clone(); + /// let raw = Unparker::into_raw(u); +- /// # let _ = unsafe { Unparker::from_raw(raw) }; + /// ``` + pub fn into_raw(this: Unparker) -> *const () { + Arc::into_raw(this.inner) as *const () +diff -up firefox-98.0/third_party/rust/crossbeam-utils/src/thread.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-utils/src/thread.rs +--- firefox-98.0/third_party/rust/crossbeam-utils/src/thread.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:40.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-utils/src/thread.rs 2022-03-16 09:33:31.996159993 +0100 +@@ -446,7 +446,7 @@ impl<'scope, 'env> ScopedThreadBuilder<' + unsafe { mem::transmute(closure) }; + + // Finally, spawn the closure. +- self.builder.spawn(closure)? ++ self.builder.spawn(move || closure())? + }; + + let thread = handle.thread().clone(); +diff -up firefox-98.0/third_party/rust/crossbeam-utils/tests/atomic_cell.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-utils/tests/atomic_cell.rs +--- firefox-98.0/third_party/rust/crossbeam-utils/tests/atomic_cell.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-utils/tests/atomic_cell.rs 2022-03-16 09:33:31.996159993 +0100 +@@ -264,22 +264,3 @@ fn const_atomic_cell_new() { + CELL.store(1); + assert_eq!(CELL.load(), 1); + } +- +-// https://github.com/crossbeam-rs/crossbeam/issues/748 +-#[cfg_attr(miri, ignore)] // TODO +-#[rustversion::since(1.37)] // #[repr(align(N))] requires Rust 1.37 +-#[test] +-fn issue_748() { +- #[allow(dead_code)] +- #[repr(align(8))] +- #[derive(Debug, Clone, Copy, PartialEq, Eq)] +- enum Test { +- Field(u32), +- FieldLess, +- } +- +- assert_eq!(mem::size_of::(), 8); +- assert!(AtomicCell::::is_lock_free()); +- let x = AtomicCell::new(Test::FieldLess); +- assert_eq!(x.load(), Test::FieldLess); +-} +diff -up firefox-98.0/third_party/rust/crossbeam-utils/tests/sharded_lock.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-utils/tests/sharded_lock.rs +--- firefox-98.0/third_party/rust/crossbeam-utils/tests/sharded_lock.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 ++++ firefox-98.0/third_party/rust/crossbeam-utils/tests/sharded_lock.rs 2022-03-16 09:33:31.996159993 +0100 +@@ -21,9 +21,6 @@ fn smoke() { + #[test] + fn frob() { + const N: u32 = 10; +- #[cfg(miri)] +- const M: usize = 100; +- #[cfg(not(miri))] + const M: usize = 1000; + + let r = Arc::new(ShardedLock::new(())); diff --git a/firefox.spec b/firefox.spec index cacc4dc..a57c36c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 98.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -224,7 +224,7 @@ Patch66: D139078.diff Patch67: D139088.diff Patch68: D139703.diff Patch69: D139704.diff -Patch70: 0001-GLIBCXX-fix-for-GCC-12.patch +Patch70: crossbeam-downgrade-rhbz2063961.patch # Test patches # Generate without context by @@ -478,7 +478,9 @@ This package contains results of tests executed during build. %patch67 -p1 -b .D139088 %patch68 -p1 -b .D139703 %patch69 -p1 -b .D139704 -%patch70 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 +%ifarch aarch64 +%patch70 -p1 -b .crossbeam-downgrade-rhbz2063961 +%endif # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -1075,6 +1077,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Wed Mar 15 2022 Martin Stransky - 98.0-3 +- Added a workaround for rhbz#2063961 + * Wed Mar 2 2022 Martin Stransky - 98.0-2 - Added support for ffmpeg 5.0 - Spec tweaks From b939827f7726f1347111747a039a00a9b6fb62db Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 16 Mar 2022 10:45:43 +0100 Subject: [PATCH 029/545] updated changelog --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index a57c36c..956a134 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1077,7 +1077,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog -* Wed Mar 15 2022 Martin Stransky - 98.0-3 +* Wed Mar 16 2022 Martin Stransky - 98.0-3 - Added a workaround for rhbz#2063961 * Wed Mar 2 2022 Martin Stransky - 98.0-2 From 32ae24f618bf1d681cc45e6d93ff69f75a4b6d58 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 16 Mar 2022 13:31:58 +0100 Subject: [PATCH 030/545] Added 0001-GLIBCXX-fix-for-GCC-12.patch back due to gcc failure --- 0001-GLIBCXX-fix-for-GCC-12.patch | 44 +++++++++++++++++++++++++++++++ firefox.spec | 2 ++ 2 files changed, 46 insertions(+) create mode 100644 0001-GLIBCXX-fix-for-GCC-12.patch diff --git a/0001-GLIBCXX-fix-for-GCC-12.patch b/0001-GLIBCXX-fix-for-GCC-12.patch new file mode 100644 index 0000000..37d6f50 --- /dev/null +++ b/0001-GLIBCXX-fix-for-GCC-12.patch @@ -0,0 +1,44 @@ +From efd5bc0715e5477318be95a76811cda0a89e8289 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= +Date: Fri, 4 Mar 2022 12:00:26 +0100 +Subject: [PATCH] GLIBCXX fix for GCC 12? + +--- + build/unix/stdc++compat/stdc++compat.cpp | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/build/unix/stdc++compat/stdc++compat.cpp b/build/unix/stdc++compat/stdc++compat.cpp +index 0180f6bcfa998..8d7a542ff11f0 100644 +--- a/build/unix/stdc++compat/stdc++compat.cpp ++++ b/build/unix/stdc++compat/stdc++compat.cpp +@@ -24,6 +24,7 @@ + GLIBCXX_3.4.27 is from gcc 10 + GLIBCXX_3.4.28 is from gcc 10 + GLIBCXX_3.4.29 is from gcc 11 ++ GLIBCXX_3.4.30 is from gcc 12 + + This file adds the necessary compatibility tricks to avoid symbols with + version GLIBCXX_3.4.20 and bigger, keeping binary compatibility with +@@ -69,6 +70,19 @@ void __attribute__((weak)) __throw_bad_array_new_length() { MOZ_CRASH(); } + } // namespace std + #endif + ++#if _GLIBCXX_RELEASE >= 12 ++namespace std { ++ ++/* This avoids the GLIBCXX_3.4.30 symbol version. */ ++void __attribute__((weak)) ++__glibcxx_assert_fail(const char* __file, int __line, const char* __function, ++ const char* __condition) { ++ MOZ_CRASH(); ++} ++ ++} // namespace std ++#endif ++ + /* While we generally don't build with exceptions, we have some host tools + * that do use them. libstdc++ from GCC 5.0 added exception constructors with + * char const* argument. Older versions only have a constructor with +-- +2.35.1 + diff --git a/firefox.spec b/firefox.spec index 956a134..6e03434 100644 --- a/firefox.spec +++ b/firefox.spec @@ -225,6 +225,7 @@ Patch67: D139088.diff Patch68: D139703.diff Patch69: D139704.diff Patch70: crossbeam-downgrade-rhbz2063961.patch +Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch # Test patches # Generate without context by @@ -481,6 +482,7 @@ This package contains results of tests executed during build. %ifarch aarch64 %patch70 -p1 -b .crossbeam-downgrade-rhbz2063961 %endif +%patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell From 70203c58f508d6875b4b39172ffeb88122a1d3c6 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Wed, 30 Mar 2022 12:14:50 +0200 Subject: [PATCH 031/545] Wayland screensharing: avoid potential crash when cursor metadata are not set --- firefox.spec | 5 ++++- libwebrtc-screen-cast-sync.patch | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index 6e03434..0cc6727 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 98.0 -Release: 3%{?pre_tag}%{?dist} +Release: 4%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1079,6 +1079,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Wed Mar 30 2022 Jan Grulich - 98.0-4 +- Wayland screensharing: avoid potential crash when cursor metadata are not set + * Wed Mar 16 2022 Martin Stransky - 98.0-3 - Added a workaround for rhbz#2063961 diff --git a/libwebrtc-screen-cast-sync.patch b/libwebrtc-screen-cast-sync.patch index da909ee..09bfd0f 100644 --- a/libwebrtc-screen-cast-sync.patch +++ b/libwebrtc-screen-cast-sync.patch @@ -9344,7 +9344,7 @@ index 0000000..c6ba661 + const struct spa_meta_cursor* cursor = + static_cast(spa_buffer_find_meta_data( + spa_buffer, SPA_META_Cursor, sizeof(*cursor))); -+ if (spa_meta_cursor_is_valid(cursor)) { ++ if (cursor && spa_meta_cursor_is_valid(cursor)) { + struct spa_meta_bitmap* bitmap = nullptr; + + if (cursor->bitmap_offset) From 73ee25f87e0e2f5ae145d42cdab4a63251adabf4 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 31 Mar 2022 12:17:27 +0200 Subject: [PATCH 032/545] Updated to 98.0.2 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 4366d6c..c32b695 100644 --- a/.gitignore +++ b/.gitignore @@ -499,3 +499,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-98.0-20220301.tar.xz /firefox-langpacks-98.0-20220304.tar.xz /firefox-langpacks-98.0-20220305.tar.xz +/firefox-98.0.2.source.tar.xz +/firefox-langpacks-98.0.2-20220331.tar.xz diff --git a/firefox.spec b/firefox.spec index 0cc6727..abb7a07 100644 --- a/firefox.spec +++ b/firefox.spec @@ -162,13 +162,13 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox -Version: 98.0 -Release: 4%{?pre_tag}%{?dist} +Version: 98.0.2 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220305.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220331.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1079,6 +1079,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Thu Mar 31 2022 Martin Stransky - 98.0.2-1 +- Updated to 98.0.2 + * Wed Mar 30 2022 Jan Grulich - 98.0-4 - Wayland screensharing: avoid potential crash when cursor metadata are not set diff --git a/sources b/sources index b1e82e0..67b7300 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = b9ab1498be90ecf60822df7021f8812f124550d97f8cd687c69d3ab56fc5fb714bfe88c78c978a1794d211724909a9a5cad6a4b483fa05f762909c45d5075520 SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (firefox-langpacks-98.0-20220305.tar.xz) = b25aa9d4aadf4e7b2d03faa6d33ff7fac61d3f62e3308204e929789c2a19006fcfa589f9cc90c308298d59d8a6419f3d44b3720f5de3d13efbc3f6acdf5219b3 -SHA512 (firefox-98.0.source.tar.xz) = 5b9186dd2a5dee5f2d2a2ce156fc06e2073cf71a70891a294cf3358218592f19ec3413d33b68d6f38e3cc5f940213e590a188e2b6efc39f416e90a55f89bfd9b +SHA512 (firefox-98.0.2.source.tar.xz) = b567b53fcdc08491063d535545f558ea56ec5be02ca540661de116986245b79f509e0103cea5661faf9f4b3d30b67758ebdb4b30401e260ee27cbb300203f36e +SHA512 (firefox-langpacks-98.0.2-20220331.tar.xz) = eba580d5dcef421f2a4e3be62a2fdf0788328cc065ae8019062e5d524f5d49b15709892e5846b9fa63148278983c8e627ad85d8a4656502c9f6543474bb94bc6 From f14b87008a0ff12b5558a2d80117f2375407ca19 Mon Sep 17 00:00:00 2001 From: Florian Schneidereit Date: Thu, 31 Mar 2022 14:32:44 +0000 Subject: [PATCH 033/545] Update firefox.desktop Added German localization for profile-manager-window desktop action --- firefox.desktop | 1 + 1 file changed, 1 insertion(+) diff --git a/firefox.desktop b/firefox.desktop index 35c2c48..6e51fb3 100644 --- a/firefox.desktop +++ b/firefox.desktop @@ -271,4 +271,5 @@ Exec=firefox --private-window %u [Desktop Action profile-manager-window] Name=Open the Profile Manager Name[cs]=Správa profilů +Name[de]=Profilverwaltung öffnen Exec=firefox --ProfileManager From 35a5afbafa9e3f85b82856171e9da0670e91d5ab Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 6 Apr 2022 10:36:00 +0200 Subject: [PATCH 034/545] Updated to 99.0 --- .gitignore | 2 + D139022.diff | 34 - D139078.diff | 94 - D139088.diff | 13 - D139696.diff | 13808 ------------------------ D139697.diff | 27 - D139698.diff | 191 - D139699.diff | 127 - D139703.diff | 222 - D139704.diff | 21 - D142257.diff | 313 + firefox-disable-ffvpx-with-vapi.patch | 77 - firefox.spec | 38 +- mozilla-1670333.patch | 38 +- pgo.patch | 38 +- sources | 4 +- 16 files changed, 359 insertions(+), 14688 deletions(-) delete mode 100644 D139022.diff delete mode 100644 D139078.diff delete mode 100644 D139088.diff delete mode 100644 D139696.diff delete mode 100644 D139697.diff delete mode 100644 D139698.diff delete mode 100644 D139699.diff delete mode 100644 D139703.diff delete mode 100644 D139704.diff create mode 100644 D142257.diff delete mode 100644 firefox-disable-ffvpx-with-vapi.patch diff --git a/.gitignore b/.gitignore index c32b695..85b9eb6 100644 --- a/.gitignore +++ b/.gitignore @@ -501,3 +501,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-98.0-20220305.tar.xz /firefox-98.0.2.source.tar.xz /firefox-langpacks-98.0.2-20220331.tar.xz +/firefox-99.0.source.tar.xz +/firefox-langpacks-99.0-20220331.tar.xz diff --git a/D139022.diff b/D139022.diff deleted file mode 100644 index 9d18162..0000000 --- a/D139022.diff +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/dom/animation/TimingParams.h b/dom/animation/TimingParams.h ---- a/dom/animation/TimingParams.h -+++ b/dom/animation/TimingParams.h -@@ -31,22 +31,19 @@ - struct TimingParams { - constexpr TimingParams() = default; - -- constexpr TimingParams(float aDuration, float aDelay, float aIterationCount, -- dom::PlaybackDirection aDirection, -- dom::FillMode aFillMode) -+ TimingParams(float aDuration, float aDelay, float aIterationCount, -+ dom::PlaybackDirection aDirection, dom::FillMode aFillMode) - : mIterations(aIterationCount), mDirection(aDirection), mFill(aFillMode) { - mDuration.emplace(StickyTimeDuration::FromMilliseconds(aDuration)); - mDelay = TimeDuration::FromMilliseconds(aDelay); - Update(); - } - -- constexpr TimingParams(const TimeDuration& aDuration, -- const TimeDuration& aDelay, -- const TimeDuration& aEndDelay, float aIterations, -- float aIterationStart, -- dom::PlaybackDirection aDirection, -- dom::FillMode aFillMode, -- Maybe&& aFunction) -+ TimingParams(const TimeDuration& aDuration, const TimeDuration& aDelay, -+ const TimeDuration& aEndDelay, float aIterations, -+ float aIterationStart, dom::PlaybackDirection aDirection, -+ dom::FillMode aFillMode, -+ Maybe&& aFunction) - : mDelay(aDelay), - mEndDelay(aEndDelay), - mIterations(aIterations), - diff --git a/D139078.diff b/D139078.diff deleted file mode 100644 index 8198e1a..0000000 --- a/D139078.diff +++ /dev/null @@ -1,94 +0,0 @@ -diff --git a/gfx/wr/swgl/src/glsl.h b/gfx/wr/swgl/src/glsl.h ---- a/gfx/wr/swgl/src/glsl.h -+++ b/gfx/wr/swgl/src/glsl.h -@@ -2301,20 +2301,12 @@ - const vec2& operator[](int index) const { return data[index]; } - mat2() = default; - -- IMPLICIT mat2(Float a) { -- data[0] = vec2(a); -- data[1] = vec2(a); -- } -+ IMPLICIT constexpr mat2(Float a) : data{vec2(a), vec2(a)} {} - -- mat2(vec2 a, vec2 b) { -- data[0] = a; -- data[1] = b; -- } -+ constexpr mat2(vec2 a, vec2 b) : data{a, b} {} - IMPLICIT mat2(const mat4& mat); -- IMPLICIT constexpr mat2(mat2_scalar s) { -- data[0] = vec2(s.data[0]); -- data[1] = vec2(s.data[1]); -- } -+ IMPLICIT constexpr mat2(mat2_scalar s) -+ : data{vec2(s.data[0]), vec2(s.data[1])} {} - - friend vec2 operator*(mat2 m, vec2 v) { - vec2 u; -@@ -2404,30 +2396,19 @@ - vec3& operator[](int index) { return data[index]; } - const vec3& operator[](int index) const { return data[index]; } - mat3() = default; -- mat3(vec3 a, vec3 b, vec3 c) { -- data[0] = a; -- data[1] = b; -- data[2] = c; -- } -+ constexpr mat3(vec3 a, vec3 b, vec3 c) : data{a, b, c} {} - -- IMPLICIT constexpr mat3(mat3_scalar s) { -- data[0] = vec3(s.data[0]); -- data[1] = vec3(s.data[1]); -- data[2] = vec3(s.data[2]); -- } -- constexpr mat3(mat3_scalar s0, mat3_scalar s1, mat3_scalar s2, -- mat3_scalar s3) { -- data[0] = vec3(s0.data[0], s1.data[0], s2.data[0], s3.data[0]); -- data[1] = vec3(s0.data[1], s1.data[1], s2.data[1], s3.data[1]); -- data[2] = vec3(s0.data[2], s1.data[2], s2.data[2], s3.data[2]); -- } -+ IMPLICIT constexpr mat3(mat3_scalar s) -+ : data{vec3(s.data[0]), vec3(s.data[1]), vec3(s.data[2])} {} -+ -+ constexpr mat3(mat3_scalar s0, mat3_scalar s1, mat3_scalar s2, mat3_scalar s3) -+ : data{vec3(s0.data[0], s1.data[0], s2.data[0], s3.data[0]), -+ vec3(s0.data[1], s1.data[1], s2.data[1], s3.data[1]), -+ vec3(s0.data[2], s1.data[2], s2.data[2], s3.data[2])} {} - - constexpr mat3(Float d1, Float d2, Float d3, Float d4, Float d5, Float d6, -- Float d7, Float d8, Float d9) { -- data[0] = vec3(d1, d2, d3); -- data[1] = vec3(d4, d5, d6); -- data[2] = vec3(d7, d8, d9); -- } -+ Float d7, Float d8, Float d9) -+ : data{vec3(d1, d2, d3), vec3(d4, d5, d6), vec3(d7, d8, d9)} {} - - IMPLICIT mat3(const mat4& mat); - -@@ -2597,19 +2578,11 @@ - vec4 data[4]; - - mat4() = default; -- IMPLICIT constexpr mat4(mat4_scalar s) { -- data[0] = vec4(s.data[0]); -- data[1] = vec4(s.data[1]); -- data[2] = vec4(s.data[2]); -- data[3] = vec4(s.data[3]); -- } -+ IMPLICIT constexpr mat4(mat4_scalar s) -+ : data{vec4(s.data[0]), vec4(s.data[1]), vec4(s.data[2]), -+ vec4(s.data[3])} {} - -- mat4(vec4 a, vec4 b, vec4 c, vec4 d) { -- data[0] = a; -- data[1] = b; -- data[2] = c; -- data[3] = d; -- } -+ constexpr mat4(vec4 a, vec4 b, vec4 c, vec4 d) : data{a, b, c, d} {} - - vec4& operator[](int index) { return data[index]; } - const vec4& operator[](int index) const { return data[index]; } - diff --git a/D139088.diff b/D139088.diff deleted file mode 100644 index 91e9967..0000000 --- a/D139088.diff +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/gfx/wr/swgl/src/gl.cc b/gfx/wr/swgl/src/gl.cc ---- a/gfx/wr/swgl/src/gl.cc -+++ b/gfx/wr/swgl/src/gl.cc -@@ -82,7 +82,7 @@ - - #define FALLTHROUGH [[fallthrough]] - --#ifdef MOZILLA_CLIENT -+#if defined(MOZILLA_CLIENT) && defined(MOZ_CLANG_PLUGIN) - # define IMPLICIT __attribute__((annotate("moz_implicit"))) - #else - # define IMPLICIT - diff --git a/D139696.diff b/D139696.diff deleted file mode 100644 index 432a9c6..0000000 --- a/D139696.diff +++ /dev/null @@ -1,13808 +0,0 @@ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/COPYING.LGPLv2.1 b/dom/media/platforms/ffmpeg/ffmpeg59/include/COPYING.LGPLv2.1 -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/COPYING.LGPLv2.1 -@@ -0,0 +1,504 @@ -+ GNU LESSER GENERAL PUBLIC LICENSE -+ Version 2.1, February 1999 -+ -+ Copyright (C) 1991, 1999 Free Software Foundation, Inc. -+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ Everyone is permitted to copy and distribute verbatim copies -+ of this license document, but changing it is not allowed. -+ -+[This is the first released version of the Lesser GPL. It also counts -+ as the successor of the GNU Library Public License, version 2, hence -+ the version number 2.1.] -+ -+ Preamble -+ -+ The licenses for most software are designed to take away your -+freedom to share and change it. By contrast, the GNU General Public -+Licenses are intended to guarantee your freedom to share and change -+free software--to make sure the software is free for all its users. -+ -+ This license, the Lesser General Public License, applies to some -+specially designated software packages--typically libraries--of the -+Free Software Foundation and other authors who decide to use it. You -+can use it too, but we suggest you first think carefully about whether -+this license or the ordinary General Public License is the better -+strategy to use in any particular case, based on the explanations below. -+ -+ When we speak of free software, we are referring to freedom of use, -+not price. Our General Public Licenses are designed to make sure that -+you have the freedom to distribute copies of free software (and charge -+for this service if you wish); that you receive source code or can get -+it if you want it; that you can change the software and use pieces of -+it in new free programs; and that you are informed that you can do -+these things. -+ -+ To protect your rights, we need to make restrictions that forbid -+distributors to deny you these rights or to ask you to surrender these -+rights. These restrictions translate to certain responsibilities for -+you if you distribute copies of the library or if you modify it. -+ -+ For example, if you distribute copies of the library, whether gratis -+or for a fee, you must give the recipients all the rights that we gave -+you. You must make sure that they, too, receive or can get the source -+code. If you link other code with the library, you must provide -+complete object files to the recipients, so that they can relink them -+with the library after making changes to the library and recompiling -+it. And you must show them these terms so they know their rights. -+ -+ We protect your rights with a two-step method: (1) we copyright the -+library, and (2) we offer you this license, which gives you legal -+permission to copy, distribute and/or modify the library. -+ -+ To protect each distributor, we want to make it very clear that -+there is no warranty for the free library. Also, if the library is -+modified by someone else and passed on, the recipients should know -+that what they have is not the original version, so that the original -+author's reputation will not be affected by problems that might be -+introduced by others. -+ -+ Finally, software patents pose a constant threat to the existence of -+any free program. We wish to make sure that a company cannot -+effectively restrict the users of a free program by obtaining a -+restrictive license from a patent holder. Therefore, we insist that -+any patent license obtained for a version of the library must be -+consistent with the full freedom of use specified in this license. -+ -+ Most GNU software, including some libraries, is covered by the -+ordinary GNU General Public License. This license, the GNU Lesser -+General Public License, applies to certain designated libraries, and -+is quite different from the ordinary General Public License. We use -+this license for certain libraries in order to permit linking those -+libraries into non-free programs. -+ -+ When a program is linked with a library, whether statically or using -+a shared library, the combination of the two is legally speaking a -+combined work, a derivative of the original library. The ordinary -+General Public License therefore permits such linking only if the -+entire combination fits its criteria of freedom. The Lesser General -+Public License permits more lax criteria for linking other code with -+the library. -+ -+ We call this license the "Lesser" General Public License because it -+does Less to protect the user's freedom than the ordinary General -+Public License. It also provides other free software developers Less -+of an advantage over competing non-free programs. These disadvantages -+are the reason we use the ordinary General Public License for many -+libraries. However, the Lesser license provides advantages in certain -+special circumstances. -+ -+ For example, on rare occasions, there may be a special need to -+encourage the widest possible use of a certain library, so that it becomes -+a de-facto standard. To achieve this, non-free programs must be -+allowed to use the library. A more frequent case is that a free -+library does the same job as widely used non-free libraries. In this -+case, there is little to gain by limiting the free library to free -+software only, so we use the Lesser General Public License. -+ -+ In other cases, permission to use a particular library in non-free -+programs enables a greater number of people to use a large body of -+free software. For example, permission to use the GNU C Library in -+non-free programs enables many more people to use the whole GNU -+operating system, as well as its variant, the GNU/Linux operating -+system. -+ -+ Although the Lesser General Public License is Less protective of the -+users' freedom, it does ensure that the user of a program that is -+linked with the Library has the freedom and the wherewithal to run -+that program using a modified version of the Library. -+ -+ The precise terms and conditions for copying, distribution and -+modification follow. Pay close attention to the difference between a -+"work based on the library" and a "work that uses the library". The -+former contains code derived from the library, whereas the latter must -+be combined with the library in order to run. -+ -+ GNU LESSER GENERAL PUBLIC LICENSE -+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -+ -+ 0. This License Agreement applies to any software library or other -+program which contains a notice placed by the copyright holder or -+other authorized party saying it may be distributed under the terms of -+this Lesser General Public License (also called "this License"). -+Each licensee is addressed as "you". -+ -+ A "library" means a collection of software functions and/or data -+prepared so as to be conveniently linked with application programs -+(which use some of those functions and data) to form executables. -+ -+ The "Library", below, refers to any such software library or work -+which has been distributed under these terms. A "work based on the -+Library" means either the Library or any derivative work under -+copyright law: that is to say, a work containing the Library or a -+portion of it, either verbatim or with modifications and/or translated -+straightforwardly into another language. (Hereinafter, translation is -+included without limitation in the term "modification".) -+ -+ "Source code" for a work means the preferred form of the work for -+making modifications to it. For a library, complete source code means -+all the source code for all modules it contains, plus any associated -+interface definition files, plus the scripts used to control compilation -+and installation of the library. -+ -+ Activities other than copying, distribution and modification are not -+covered by this License; they are outside its scope. The act of -+running a program using the Library is not restricted, and output from -+such a program is covered only if its contents constitute a work based -+on the Library (independent of the use of the Library in a tool for -+writing it). Whether that is true depends on what the Library does -+and what the program that uses the Library does. -+ -+ 1. You may copy and distribute verbatim copies of the Library's -+complete source code as you receive it, in any medium, provided that -+you conspicuously and appropriately publish on each copy an -+appropriate copyright notice and disclaimer of warranty; keep intact -+all the notices that refer to this License and to the absence of any -+warranty; and distribute a copy of this License along with the -+Library. -+ -+ You may charge a fee for the physical act of transferring a copy, -+and you may at your option offer warranty protection in exchange for a -+fee. -+ -+ 2. You may modify your copy or copies of the Library or any portion -+of it, thus forming a work based on the Library, and copy and -+distribute such modifications or work under the terms of Section 1 -+above, provided that you also meet all of these conditions: -+ -+ a) The modified work must itself be a software library. -+ -+ b) You must cause the files modified to carry prominent notices -+ stating that you changed the files and the date of any change. -+ -+ c) You must cause the whole of the work to be licensed at no -+ charge to all third parties under the terms of this License. -+ -+ d) If a facility in the modified Library refers to a function or a -+ table of data to be supplied by an application program that uses -+ the facility, other than as an argument passed when the facility -+ is invoked, then you must make a good faith effort to ensure that, -+ in the event an application does not supply such function or -+ table, the facility still operates, and performs whatever part of -+ its purpose remains meaningful. -+ -+ (For example, a function in a library to compute square roots has -+ a purpose that is entirely well-defined independent of the -+ application. Therefore, Subsection 2d requires that any -+ application-supplied function or table used by this function must -+ be optional: if the application does not supply it, the square -+ root function must still compute square roots.) -+ -+These requirements apply to the modified work as a whole. If -+identifiable sections of that work are not derived from the Library, -+and can be reasonably considered independent and separate works in -+themselves, then this License, and its terms, do not apply to those -+sections when you distribute them as separate works. But when you -+distribute the same sections as part of a whole which is a work based -+on the Library, the distribution of the whole must be on the terms of -+this License, whose permissions for other licensees extend to the -+entire whole, and thus to each and every part regardless of who wrote -+it. -+ -+Thus, it is not the intent of this section to claim rights or contest -+your rights to work written entirely by you; rather, the intent is to -+exercise the right to control the distribution of derivative or -+collective works based on the Library. -+ -+In addition, mere aggregation of another work not based on the Library -+with the Library (or with a work based on the Library) on a volume of -+a storage or distribution medium does not bring the other work under -+the scope of this License. -+ -+ 3. You may opt to apply the terms of the ordinary GNU General Public -+License instead of this License to a given copy of the Library. To do -+this, you must alter all the notices that refer to this License, so -+that they refer to the ordinary GNU General Public License, version 2, -+instead of to this License. (If a newer version than version 2 of the -+ordinary GNU General Public License has appeared, then you can specify -+that version instead if you wish.) Do not make any other change in -+these notices. -+ -+ Once this change is made in a given copy, it is irreversible for -+that copy, so the ordinary GNU General Public License applies to all -+subsequent copies and derivative works made from that copy. -+ -+ This option is useful when you wish to copy part of the code of -+the Library into a program that is not a library. -+ -+ 4. You may copy and distribute the Library (or a portion or -+derivative of it, under Section 2) in object code or executable form -+under the terms of Sections 1 and 2 above provided that you accompany -+it with the complete corresponding machine-readable source code, which -+must be distributed under the terms of Sections 1 and 2 above on a -+medium customarily used for software interchange. -+ -+ If distribution of object code is made by offering access to copy -+from a designated place, then offering equivalent access to copy the -+source code from the same place satisfies the requirement to -+distribute the source code, even though third parties are not -+compelled to copy the source along with the object code. -+ -+ 5. A program that contains no derivative of any portion of the -+Library, but is designed to work with the Library by being compiled or -+linked with it, is called a "work that uses the Library". Such a -+work, in isolation, is not a derivative work of the Library, and -+therefore falls outside the scope of this License. -+ -+ However, linking a "work that uses the Library" with the Library -+creates an executable that is a derivative of the Library (because it -+contains portions of the Library), rather than a "work that uses the -+library". The executable is therefore covered by this License. -+Section 6 states terms for distribution of such executables. -+ -+ When a "work that uses the Library" uses material from a header file -+that is part of the Library, the object code for the work may be a -+derivative work of the Library even though the source code is not. -+Whether this is true is especially significant if the work can be -+linked without the Library, or if the work is itself a library. The -+threshold for this to be true is not precisely defined by law. -+ -+ If such an object file uses only numerical parameters, data -+structure layouts and accessors, and small macros and small inline -+functions (ten lines or less in length), then the use of the object -+file is unrestricted, regardless of whether it is legally a derivative -+work. (Executables containing this object code plus portions of the -+Library will still fall under Section 6.) -+ -+ Otherwise, if the work is a derivative of the Library, you may -+distribute the object code for the work under the terms of Section 6. -+Any executables containing that work also fall under Section 6, -+whether or not they are linked directly with the Library itself. -+ -+ 6. As an exception to the Sections above, you may also combine or -+link a "work that uses the Library" with the Library to produce a -+work containing portions of the Library, and distribute that work -+under terms of your choice, provided that the terms permit -+modification of the work for the customer's own use and reverse -+engineering for debugging such modifications. -+ -+ You must give prominent notice with each copy of the work that the -+Library is used in it and that the Library and its use are covered by -+this License. You must supply a copy of this License. If the work -+during execution displays copyright notices, you must include the -+copyright notice for the Library among them, as well as a reference -+directing the user to the copy of this License. Also, you must do one -+of these things: -+ -+ a) Accompany the work with the complete corresponding -+ machine-readable source code for the Library including whatever -+ changes were used in the work (which must be distributed under -+ Sections 1 and 2 above); and, if the work is an executable linked -+ with the Library, with the complete machine-readable "work that -+ uses the Library", as object code and/or source code, so that the -+ user can modify the Library and then relink to produce a modified -+ executable containing the modified Library. (It is understood -+ that the user who changes the contents of definitions files in the -+ Library will not necessarily be able to recompile the application -+ to use the modified definitions.) -+ -+ b) Use a suitable shared library mechanism for linking with the -+ Library. A suitable mechanism is one that (1) uses at run time a -+ copy of the library already present on the user's computer system, -+ rather than copying library functions into the executable, and (2) -+ will operate properly with a modified version of the library, if -+ the user installs one, as long as the modified version is -+ interface-compatible with the version that the work was made with. -+ -+ c) Accompany the work with a written offer, valid for at -+ least three years, to give the same user the materials -+ specified in Subsection 6a, above, for a charge no more -+ than the cost of performing this distribution. -+ -+ d) If distribution of the work is made by offering access to copy -+ from a designated place, offer equivalent access to copy the above -+ specified materials from the same place. -+ -+ e) Verify that the user has already received a copy of these -+ materials or that you have already sent this user a copy. -+ -+ For an executable, the required form of the "work that uses the -+Library" must include any data and utility programs needed for -+reproducing the executable from it. However, as a special exception, -+the materials to be distributed need not include anything that is -+normally distributed (in either source or binary form) with the major -+components (compiler, kernel, and so on) of the operating system on -+which the executable runs, unless that component itself accompanies -+the executable. -+ -+ It may happen that this requirement contradicts the license -+restrictions of other proprietary libraries that do not normally -+accompany the operating system. Such a contradiction means you cannot -+use both them and the Library together in an executable that you -+distribute. -+ -+ 7. You may place library facilities that are a work based on the -+Library side-by-side in a single library together with other library -+facilities not covered by this License, and distribute such a combined -+library, provided that the separate distribution of the work based on -+the Library and of the other library facilities is otherwise -+permitted, and provided that you do these two things: -+ -+ a) Accompany the combined library with a copy of the same work -+ based on the Library, uncombined with any other library -+ facilities. This must be distributed under the terms of the -+ Sections above. -+ -+ b) Give prominent notice with the combined library of the fact -+ that part of it is a work based on the Library, and explaining -+ where to find the accompanying uncombined form of the same work. -+ -+ 8. You may not copy, modify, sublicense, link with, or distribute -+the Library except as expressly provided under this License. Any -+attempt otherwise to copy, modify, sublicense, link with, or -+distribute the Library is void, and will automatically terminate your -+rights under this License. However, parties who have received copies, -+or rights, from you under this License will not have their licenses -+terminated so long as such parties remain in full compliance. -+ -+ 9. You are not required to accept this License, since you have not -+signed it. However, nothing else grants you permission to modify or -+distribute the Library or its derivative works. These actions are -+prohibited by law if you do not accept this License. Therefore, by -+modifying or distributing the Library (or any work based on the -+Library), you indicate your acceptance of this License to do so, and -+all its terms and conditions for copying, distributing or modifying -+the Library or works based on it. -+ -+ 10. Each time you redistribute the Library (or any work based on the -+Library), the recipient automatically receives a license from the -+original licensor to copy, distribute, link with or modify the Library -+subject to these terms and conditions. You may not impose any further -+restrictions on the recipients' exercise of the rights granted herein. -+You are not responsible for enforcing compliance by third parties with -+this License. -+ -+ 11. If, as a consequence of a court judgment or allegation of patent -+infringement or for any other reason (not limited to patent issues), -+conditions are imposed on you (whether by court order, agreement or -+otherwise) that contradict the conditions of this License, they do not -+excuse you from the conditions of this License. If you cannot -+distribute so as to satisfy simultaneously your obligations under this -+License and any other pertinent obligations, then as a consequence you -+may not distribute the Library at all. For example, if a patent -+license would not permit royalty-free redistribution of the Library by -+all those who receive copies directly or indirectly through you, then -+the only way you could satisfy both it and this License would be to -+refrain entirely from distribution of the Library. -+ -+If any portion of this section is held invalid or unenforceable under any -+particular circumstance, the balance of the section is intended to apply, -+and the section as a whole is intended to apply in other circumstances. -+ -+It is not the purpose of this section to induce you to infringe any -+patents or other property right claims or to contest validity of any -+such claims; this section has the sole purpose of protecting the -+integrity of the free software distribution system which is -+implemented by public license practices. Many people have made -+generous contributions to the wide range of software distributed -+through that system in reliance on consistent application of that -+system; it is up to the author/donor to decide if he or she is willing -+to distribute software through any other system and a licensee cannot -+impose that choice. -+ -+This section is intended to make thoroughly clear what is believed to -+be a consequence of the rest of this License. -+ -+ 12. If the distribution and/or use of the Library is restricted in -+certain countries either by patents or by copyrighted interfaces, the -+original copyright holder who places the Library under this License may add -+an explicit geographical distribution limitation excluding those countries, -+so that distribution is permitted only in or among countries not thus -+excluded. In such case, this License incorporates the limitation as if -+written in the body of this License. -+ -+ 13. The Free Software Foundation may publish revised and/or new -+versions of the Lesser General Public License from time to time. -+Such new versions will be similar in spirit to the present version, -+but may differ in detail to address new problems or concerns. -+ -+Each version is given a distinguishing version number. If the Library -+specifies a version number of this License which applies to it and -+"any later version", you have the option of following the terms and -+conditions either of that version or of any later version published by -+the Free Software Foundation. If the Library does not specify a -+license version number, you may choose any version ever published by -+the Free Software Foundation. -+ -+ 14. If you wish to incorporate parts of the Library into other free -+programs whose distribution conditions are incompatible with these, -+write to the author to ask for permission. For software which is -+copyrighted by the Free Software Foundation, write to the Free -+Software Foundation; we sometimes make exceptions for this. Our -+decision will be guided by the two goals of preserving the free status -+of all derivatives of our free software and of promoting the sharing -+and reuse of software generally. -+ -+ NO WARRANTY -+ -+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. -+ -+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -+DAMAGES. -+ -+ END OF TERMS AND CONDITIONS -+ -+ How to Apply These Terms to Your New Libraries -+ -+ If you develop a new library, and you want it to be of the greatest -+possible use to the public, we recommend making it free software that -+everyone can redistribute and change. You can do so by permitting -+redistribution under these terms (or, alternatively, under the terms of the -+ordinary General Public License). -+ -+ To apply these terms, attach the following notices to the library. It is -+safest to attach them to the start of each source file to most effectively -+convey the exclusion of warranty; and each file should have at least the -+"copyright" line and a pointer to where the full notice is found. -+ -+ -+ Copyright (C) -+ -+ This library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ This library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with this library; if not, write to the Free Software -+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ -+Also add information on how to contact you by electronic and paper mail. -+ -+You should also get your employer (if you work as a programmer) or your -+school, if any, to sign a "copyright disclaimer" for the library, if -+necessary. Here is a sample; alter the names: -+ -+ Yoyodyne, Inc., hereby disclaims all copyright interest in the -+ library `Frob' (a library for tweaking knobs) written by James Random Hacker. -+ -+ , 1 April 1990 -+ Ty Coon, President of Vice -+ -+That's all there is to it! -+ -+ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/avcodec.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/avcodec.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/avcodec.h -@@ -0,0 +1,3204 @@ -+/* -+ * copyright (c) 2001 Fabrice Bellard -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef AVCODEC_AVCODEC_H -+#define AVCODEC_AVCODEC_H -+ -+/** -+ * @file -+ * @ingroup libavc -+ * Libavcodec external API header -+ */ -+ -+#include "libavutil/samplefmt.h" -+#include "libavutil/attributes.h" -+#include "libavutil/avutil.h" -+#include "libavutil/buffer.h" -+#include "libavutil/dict.h" -+#include "libavutil/frame.h" -+#include "libavutil/log.h" -+#include "libavutil/pixfmt.h" -+#include "libavutil/rational.h" -+ -+#include "codec.h" -+#include "codec_desc.h" -+#include "codec_par.h" -+#include "codec_id.h" -+#include "defs.h" -+#include "packet.h" -+#include "version.h" -+ -+/** -+ * @defgroup libavc libavcodec -+ * Encoding/Decoding Library -+ * -+ * @{ -+ * -+ * @defgroup lavc_decoding Decoding -+ * @{ -+ * @} -+ * -+ * @defgroup lavc_encoding Encoding -+ * @{ -+ * @} -+ * -+ * @defgroup lavc_codec Codecs -+ * @{ -+ * @defgroup lavc_codec_native Native Codecs -+ * @{ -+ * @} -+ * @defgroup lavc_codec_wrappers External library wrappers -+ * @{ -+ * @} -+ * @defgroup lavc_codec_hwaccel Hardware Accelerators bridge -+ * @{ -+ * @} -+ * @} -+ * @defgroup lavc_internal Internal -+ * @{ -+ * @} -+ * @} -+ */ -+ -+/** -+ * @ingroup libavc -+ * @defgroup lavc_encdec send/receive encoding and decoding API overview -+ * @{ -+ * -+ * The avcodec_send_packet()/avcodec_receive_frame()/avcodec_send_frame()/ -+ * avcodec_receive_packet() functions provide an encode/decode API, which -+ * decouples input and output. -+ * -+ * The API is very similar for encoding/decoding and audio/video, and works as -+ * follows: -+ * - Set up and open the AVCodecContext as usual. -+ * - Send valid input: -+ * - For decoding, call avcodec_send_packet() to give the decoder raw -+ * compressed data in an AVPacket. -+ * - For encoding, call avcodec_send_frame() to give the encoder an AVFrame -+ * containing uncompressed audio or video. -+ * -+ * In both cases, it is recommended that AVPackets and AVFrames are -+ * refcounted, or libavcodec might have to copy the input data. (libavformat -+ * always returns refcounted AVPackets, and av_frame_get_buffer() allocates -+ * refcounted AVFrames.) -+ * - Receive output in a loop. Periodically call one of the avcodec_receive_*() -+ * functions and process their output: -+ * - For decoding, call avcodec_receive_frame(). On success, it will return -+ * an AVFrame containing uncompressed audio or video data. -+ * - For encoding, call avcodec_receive_packet(). On success, it will return -+ * an AVPacket with a compressed frame. -+ * -+ * Repeat this call until it returns AVERROR(EAGAIN) or an error. The -+ * AVERROR(EAGAIN) return value means that new input data is required to -+ * return new output. In this case, continue with sending input. For each -+ * input frame/packet, the codec will typically return 1 output frame/packet, -+ * but it can also be 0 or more than 1. -+ * -+ * At the beginning of decoding or encoding, the codec might accept multiple -+ * input frames/packets without returning a frame, until its internal buffers -+ * are filled. This situation is handled transparently if you follow the steps -+ * outlined above. -+ * -+ * In theory, sending input can result in EAGAIN - this should happen only if -+ * not all output was received. You can use this to structure alternative decode -+ * or encode loops other than the one suggested above. For example, you could -+ * try sending new input on each iteration, and try to receive output if that -+ * returns EAGAIN. -+ * -+ * End of stream situations. These require "flushing" (aka draining) the codec, -+ * as the codec might buffer multiple frames or packets internally for -+ * performance or out of necessity (consider B-frames). -+ * This is handled as follows: -+ * - Instead of valid input, send NULL to the avcodec_send_packet() (decoding) -+ * or avcodec_send_frame() (encoding) functions. This will enter draining -+ * mode. -+ * - Call avcodec_receive_frame() (decoding) or avcodec_receive_packet() -+ * (encoding) in a loop until AVERROR_EOF is returned. The functions will -+ * not return AVERROR(EAGAIN), unless you forgot to enter draining mode. -+ * - Before decoding can be resumed again, the codec has to be reset with -+ * avcodec_flush_buffers(). -+ * -+ * Using the API as outlined above is highly recommended. But it is also -+ * possible to call functions outside of this rigid schema. For example, you can -+ * call avcodec_send_packet() repeatedly without calling -+ * avcodec_receive_frame(). In this case, avcodec_send_packet() will succeed -+ * until the codec's internal buffer has been filled up (which is typically of -+ * size 1 per output frame, after initial input), and then reject input with -+ * AVERROR(EAGAIN). Once it starts rejecting input, you have no choice but to -+ * read at least some output. -+ * -+ * Not all codecs will follow a rigid and predictable dataflow; the only -+ * guarantee is that an AVERROR(EAGAIN) return value on a send/receive call on -+ * one end implies that a receive/send call on the other end will succeed, or -+ * at least will not fail with AVERROR(EAGAIN). In general, no codec will -+ * permit unlimited buffering of input or output. -+ * -+ * A codec is not allowed to return AVERROR(EAGAIN) for both sending and -+ * receiving. This would be an invalid state, which could put the codec user -+ * into an endless loop. The API has no concept of time either: it cannot happen -+ * that trying to do avcodec_send_packet() results in AVERROR(EAGAIN), but a -+ * repeated call 1 second later accepts the packet (with no other receive/flush -+ * API calls involved). The API is a strict state machine, and the passage of -+ * time is not supposed to influence it. Some timing-dependent behavior might -+ * still be deemed acceptable in certain cases. But it must never result in both -+ * send/receive returning EAGAIN at the same time at any point. It must also -+ * absolutely be avoided that the current state is "unstable" and can -+ * "flip-flop" between the send/receive APIs allowing progress. For example, -+ * it's not allowed that the codec randomly decides that it actually wants to -+ * consume a packet now instead of returning a frame, after it just returned -+ * AVERROR(EAGAIN) on an avcodec_send_packet() call. -+ * @} -+ */ -+ -+/** -+ * @defgroup lavc_core Core functions/structures. -+ * @ingroup libavc -+ * -+ * Basic definitions, functions for querying libavcodec capabilities, -+ * allocating core structures, etc. -+ * @{ -+ */ -+ -+/** -+ * @ingroup lavc_encoding -+ * minimum encoding buffer size -+ * Used to avoid some checks during header writing. -+ */ -+#define AV_INPUT_BUFFER_MIN_SIZE 16384 -+ -+/** -+ * @ingroup lavc_encoding -+ */ -+typedef struct RcOverride { -+ int start_frame; -+ int end_frame; -+ int qscale; // If this is 0 then quality_factor will be used instead. -+ float quality_factor; -+} RcOverride; -+ -+/* encoding support -+ These flags can be passed in AVCodecContext.flags before initialization. -+ Note: Not everything is supported yet. -+*/ -+ -+/** -+ * Allow decoders to produce frames with data planes that are not aligned -+ * to CPU requirements (e.g. due to cropping). -+ */ -+#define AV_CODEC_FLAG_UNALIGNED (1 << 0) -+/** -+ * Use fixed qscale. -+ */ -+#define AV_CODEC_FLAG_QSCALE (1 << 1) -+/** -+ * 4 MV per MB allowed / advanced prediction for H.263. -+ */ -+#define AV_CODEC_FLAG_4MV (1 << 2) -+/** -+ * Output even those frames that might be corrupted. -+ */ -+#define AV_CODEC_FLAG_OUTPUT_CORRUPT (1 << 3) -+/** -+ * Use qpel MC. -+ */ -+#define AV_CODEC_FLAG_QPEL (1 << 4) -+/** -+ * Don't output frames whose parameters differ from first -+ * decoded frame in stream. -+ */ -+#define AV_CODEC_FLAG_DROPCHANGED (1 << 5) -+/** -+ * Use internal 2pass ratecontrol in first pass mode. -+ */ -+#define AV_CODEC_FLAG_PASS1 (1 << 9) -+/** -+ * Use internal 2pass ratecontrol in second pass mode. -+ */ -+#define AV_CODEC_FLAG_PASS2 (1 << 10) -+/** -+ * loop filter. -+ */ -+#define AV_CODEC_FLAG_LOOP_FILTER (1 << 11) -+/** -+ * Only decode/encode grayscale. -+ */ -+#define AV_CODEC_FLAG_GRAY (1 << 13) -+/** -+ * error[?] variables will be set during encoding. -+ */ -+#define AV_CODEC_FLAG_PSNR (1 << 15) -+#if FF_API_FLAG_TRUNCATED -+/** -+ * Input bitstream might be truncated at a random location -+ * instead of only at frame boundaries. -+ * -+ * @deprecated use codec parsers for packetizing input -+ */ -+# define AV_CODEC_FLAG_TRUNCATED (1 << 16) -+#endif -+/** -+ * Use interlaced DCT. -+ */ -+#define AV_CODEC_FLAG_INTERLACED_DCT (1 << 18) -+/** -+ * Force low delay. -+ */ -+#define AV_CODEC_FLAG_LOW_DELAY (1 << 19) -+/** -+ * Place global headers in extradata instead of every keyframe. -+ */ -+#define AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22) -+/** -+ * Use only bitexact stuff (except (I)DCT). -+ */ -+#define AV_CODEC_FLAG_BITEXACT (1 << 23) -+/* Fx : Flag for H.263+ extra options */ -+/** -+ * H.263 advanced intra coding / MPEG-4 AC prediction -+ */ -+#define AV_CODEC_FLAG_AC_PRED (1 << 24) -+/** -+ * interlaced motion estimation -+ */ -+#define AV_CODEC_FLAG_INTERLACED_ME (1 << 29) -+#define AV_CODEC_FLAG_CLOSED_GOP (1U << 31) -+ -+/** -+ * Allow non spec compliant speedup tricks. -+ */ -+#define AV_CODEC_FLAG2_FAST (1 << 0) -+/** -+ * Skip bitstream encoding. -+ */ -+#define AV_CODEC_FLAG2_NO_OUTPUT (1 << 2) -+/** -+ * Place global headers at every keyframe instead of in extradata. -+ */ -+#define AV_CODEC_FLAG2_LOCAL_HEADER (1 << 3) -+ -+/** -+ * timecode is in drop frame format. DEPRECATED!!!! -+ */ -+#define AV_CODEC_FLAG2_DROP_FRAME_TIMECODE (1 << 13) -+ -+/** -+ * Input bitstream might be truncated at a packet boundaries -+ * instead of only at frame boundaries. -+ */ -+#define AV_CODEC_FLAG2_CHUNKS (1 << 15) -+/** -+ * Discard cropping information from SPS. -+ */ -+#define AV_CODEC_FLAG2_IGNORE_CROP (1 << 16) -+ -+/** -+ * Show all frames before the first keyframe -+ */ -+#define AV_CODEC_FLAG2_SHOW_ALL (1 << 22) -+/** -+ * Export motion vectors through frame side data -+ */ -+#define AV_CODEC_FLAG2_EXPORT_MVS (1 << 28) -+/** -+ * Do not skip samples and export skip information as frame side data -+ */ -+#define AV_CODEC_FLAG2_SKIP_MANUAL (1 << 29) -+/** -+ * Do not reset ASS ReadOrder field on flush (subtitles decoding) -+ */ -+#define AV_CODEC_FLAG2_RO_FLUSH_NOOP (1 << 30) -+ -+/* Unsupported options : -+ * Syntax Arithmetic coding (SAC) -+ * Reference Picture Selection -+ * Independent Segment Decoding */ -+/* /Fx */ -+/* codec capabilities */ -+ -+/* Exported side data. -+ These flags can be passed in AVCodecContext.export_side_data before -+ initialization. -+*/ -+/** -+ * Export motion vectors through frame side data -+ */ -+#define AV_CODEC_EXPORT_DATA_MVS (1 << 0) -+/** -+ * Export encoder Producer Reference Time through packet side data -+ */ -+#define AV_CODEC_EXPORT_DATA_PRFT (1 << 1) -+/** -+ * Decoding only. -+ * Export the AVVideoEncParams structure through frame side data. -+ */ -+#define AV_CODEC_EXPORT_DATA_VIDEO_ENC_PARAMS (1 << 2) -+/** -+ * Decoding only. -+ * Do not apply film grain, export it instead. -+ */ -+#define AV_CODEC_EXPORT_DATA_FILM_GRAIN (1 << 3) -+ -+/** -+ * The decoder will keep a reference to the frame and may reuse it later. -+ */ -+#define AV_GET_BUFFER_FLAG_REF (1 << 0) -+ -+/** -+ * The encoder will keep a reference to the packet and may reuse it later. -+ */ -+#define AV_GET_ENCODE_BUFFER_FLAG_REF (1 << 0) -+ -+struct AVCodecInternal; -+ -+/** -+ * main external API structure. -+ * New fields can be added to the end with minor version bumps. -+ * Removal, reordering and changes to existing fields require a major -+ * version bump. -+ * You can use AVOptions (av_opt* / av_set/get*()) to access these fields from -+ * user applications. The name string for AVOptions options matches the -+ * associated command line parameter name and can be found in -+ * libavcodec/options_table.h The AVOption/command line parameter names differ -+ * in some cases from the C structure field names for historic reasons or -+ * brevity. sizeof(AVCodecContext) must not be used outside libav*. -+ */ -+typedef struct AVCodecContext { -+ /** -+ * information on struct for av_log -+ * - set by avcodec_alloc_context3 -+ */ -+ const AVClass* av_class; -+ int log_level_offset; -+ -+ enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */ -+ const struct AVCodec* codec; -+ enum AVCodecID codec_id; /* see AV_CODEC_ID_xxx */ -+ -+ /** -+ * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). -+ * This is used to work around some encoder bugs. -+ * A demuxer should set this to what is stored in the field used to identify -+ * the codec. If there are multiple such fields in a container then the -+ * demuxer should choose the one which maximizes the information about the -+ * used codec. If the codec tag field in a container is larger than 32 bits -+ * then the demuxer should remap the longer ID to 32 bits with a table or -+ * other structure. Alternatively a new extra_codec_tag + size could be added -+ * but for this a clear advantage must be demonstrated first. -+ * - encoding: Set by user, if not then the default based on codec_id will be -+ * used. -+ * - decoding: Set by user, will be converted to uppercase by libavcodec -+ * during init. -+ */ -+ unsigned int codec_tag; -+ -+ void* priv_data; -+ -+ /** -+ * Private context used for internal data. -+ * -+ * Unlike priv_data, this is not codec-specific. It is used in general -+ * libavcodec functions. -+ */ -+ struct AVCodecInternal* internal; -+ -+ /** -+ * Private data of the user, can be used to carry app specific stuff. -+ * - encoding: Set by user. -+ * - decoding: Set by user. -+ */ -+ void* opaque; -+ -+ /** -+ * the average bitrate -+ * - encoding: Set by user; unused for constant quantizer encoding. -+ * - decoding: Set by user, may be overwritten by libavcodec -+ * if this info is available in the stream -+ */ -+ int64_t bit_rate; -+ -+ /** -+ * number of bits the bitstream is allowed to diverge from the reference. -+ * the reference can be CBR (for CBR pass1) or VBR (for pass2) -+ * - encoding: Set by user; unused for constant quantizer encoding. -+ * - decoding: unused -+ */ -+ int bit_rate_tolerance; -+ -+ /** -+ * Global quality for codecs which cannot change it per frame. -+ * This should be proportional to MPEG-1/2/4 qscale. -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int global_quality; -+ -+ /** -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int compression_level; -+#define FF_COMPRESSION_DEFAULT -1 -+ -+ /** -+ * AV_CODEC_FLAG_*. -+ * - encoding: Set by user. -+ * - decoding: Set by user. -+ */ -+ int flags; -+ -+ /** -+ * AV_CODEC_FLAG2_* -+ * - encoding: Set by user. -+ * - decoding: Set by user. -+ */ -+ int flags2; -+ -+ /** -+ * some codecs need / can use extradata like Huffman tables. -+ * MJPEG: Huffman tables -+ * rv10: additional flags -+ * MPEG-4: global headers (they can be in the bitstream or here) -+ * The allocated memory should be AV_INPUT_BUFFER_PADDING_SIZE bytes larger -+ * than extradata_size to avoid problems if it is read with the bitstream -+ * reader. The bytewise contents of extradata must not depend on the -+ * architecture or CPU endianness. Must be allocated with the av_malloc() -+ * family of functions. -+ * - encoding: Set/allocated/freed by libavcodec. -+ * - decoding: Set/allocated/freed by user. -+ */ -+ uint8_t* extradata; -+ int extradata_size; -+ -+ /** -+ * This is the fundamental unit of time (in seconds) in terms -+ * of which frame timestamps are represented. For fixed-fps content, -+ * timebase should be 1/framerate and timestamp increments should be -+ * identically 1. -+ * This often, but not always is the inverse of the frame rate or field rate -+ * for video. 1/time_base is not the average frame rate if the frame rate is -+ * not constant. -+ * -+ * Like containers, elementary streams also can store timestamps, 1/time_base -+ * is the unit in which these timestamps are specified. -+ * As example of such codec time base see ISO/IEC 14496-2:2001(E) -+ * vop_time_increment_resolution and fixed_vop_rate -+ * (fixed_vop_rate == 0 implies that it is different from the framerate) -+ * -+ * - encoding: MUST be set by user. -+ * - decoding: the use of this field for decoding is deprecated. -+ * Use framerate instead. -+ */ -+ AVRational time_base; -+ -+ /** -+ * For some codecs, the time base is closer to the field rate than the frame -+ * rate. Most notably, H.264 and MPEG-2 specify time_base as half of frame -+ * duration if no telecine is used ... -+ * -+ * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it -+ * to 2. -+ */ -+ int ticks_per_frame; -+ -+ /** -+ * Codec delay. -+ * -+ * Encoding: Number of frames delay there will be from the encoder input to -+ * the decoder output. (we assume the decoder matches the spec) -+ * Decoding: Number of frames delay in addition to what a standard decoder -+ * as specified in the spec would produce. -+ * -+ * Video: -+ * Number of frames the decoded output will be delayed relative to the -+ * encoded input. -+ * -+ * Audio: -+ * For encoding, this field is unused (see initial_padding). -+ * -+ * For decoding, this is the number of samples the decoder needs to -+ * output before the decoder's output is valid. When seeking, you should -+ * start decoding this many samples prior to your desired seek point. -+ * -+ * - encoding: Set by libavcodec. -+ * - decoding: Set by libavcodec. -+ */ -+ int delay; -+ -+ /* video only */ -+ /** -+ * picture width / height. -+ * -+ * @note Those fields may not match the values of the last -+ * AVFrame output by avcodec_receive_frame() due frame -+ * reordering. -+ * -+ * - encoding: MUST be set by user. -+ * - decoding: May be set by the user before opening the decoder if known e.g. -+ * from the container. Some decoders will require the dimensions -+ * to be set by the caller. During decoding, the decoder may -+ * overwrite those values as required while parsing the data. -+ */ -+ int width, height; -+ -+ /** -+ * Bitstream width / height, may be different from width/height e.g. when -+ * the decoded frame is cropped before being output or lowres is enabled. -+ * -+ * @note Those field may not match the value of the last -+ * AVFrame output by avcodec_receive_frame() due frame -+ * reordering. -+ * -+ * - encoding: unused -+ * - decoding: May be set by the user before opening the decoder if known -+ * e.g. from the container. During decoding, the decoder may -+ * overwrite those values as required while parsing the data. -+ */ -+ int coded_width, coded_height; -+ -+ /** -+ * the number of pictures in a group of pictures, or 0 for intra_only -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int gop_size; -+ -+ /** -+ * Pixel format, see AV_PIX_FMT_xxx. -+ * May be set by the demuxer if known from headers. -+ * May be overridden by the decoder if it knows better. -+ * -+ * @note This field may not match the value of the last -+ * AVFrame output by avcodec_receive_frame() due frame -+ * reordering. -+ * -+ * - encoding: Set by user. -+ * - decoding: Set by user if known, overridden by libavcodec while -+ * parsing the data. -+ */ -+ enum AVPixelFormat pix_fmt; -+ -+ /** -+ * If non NULL, 'draw_horiz_band' is called by the libavcodec -+ * decoder to draw a horizontal band. It improves cache usage. Not -+ * all codecs can do that. You must check the codec capabilities -+ * beforehand. -+ * When multithreading is used, it may be called from multiple threads -+ * at the same time; threads might draw different parts of the same AVFrame, -+ * or multiple AVFrames, and there is no guarantee that slices will be drawn -+ * in order. -+ * The function is also used by hardware acceleration APIs. -+ * It is called at least once during frame decoding to pass -+ * the data needed for hardware render. -+ * In that mode instead of pixel data, AVFrame points to -+ * a structure specific to the acceleration API. The application -+ * reads the structure and can change some fields to indicate progress -+ * or mark state. -+ * - encoding: unused -+ * - decoding: Set by user. -+ * @param height the height of the slice -+ * @param y the y position of the slice -+ * @param type 1->top field, 2->bottom field, 3->frame -+ * @param offset offset into the AVFrame.data from which the slice should be -+ * read -+ */ -+ void (*draw_horiz_band)(struct AVCodecContext* s, const AVFrame* src, -+ int offset[AV_NUM_DATA_POINTERS], int y, int type, -+ int height); -+ -+ /** -+ * Callback to negotiate the pixel format. Decoding only, may be set by the -+ * caller before avcodec_open2(). -+ * -+ * Called by some decoders to select the pixel format that will be used for -+ * the output frames. This is mainly used to set up hardware acceleration, -+ * then the provided format list contains the corresponding hwaccel pixel -+ * formats alongside the "software" one. The software pixel format may also -+ * be retrieved from \ref sw_pix_fmt. -+ * -+ * This callback will be called when the coded frame properties (such as -+ * resolution, pixel format, etc.) change and more than one output format is -+ * supported for those new properties. If a hardware pixel format is chosen -+ * and initialization for it fails, the callback may be called again -+ * immediately. -+ * -+ * This callback may be called from different threads if the decoder is -+ * multi-threaded, but not from more than one thread simultaneously. -+ * -+ * @param fmt list of formats which may be used in the current -+ * configuration, terminated by AV_PIX_FMT_NONE. -+ * @warning Behavior is undefined if the callback returns a value other -+ * than one of the formats in fmt or AV_PIX_FMT_NONE. -+ * @return the chosen format or AV_PIX_FMT_NONE -+ */ -+ enum AVPixelFormat (*get_format)(struct AVCodecContext* s, -+ const enum AVPixelFormat* fmt); -+ -+ /** -+ * maximum number of B-frames between non-B-frames -+ * Note: The output will be delayed by max_b_frames+1 relative to the input. -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int max_b_frames; -+ -+ /** -+ * qscale factor between IP and B-frames -+ * If > 0 then the last P-frame quantizer will be used (q= -+ * lastp_q*factor+offset). If < 0 then normal ratecontrol will be done (q= -+ * -normal_q*factor+offset). -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ float b_quant_factor; -+ -+ /** -+ * qscale offset between IP and B-frames -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ float b_quant_offset; -+ -+ /** -+ * Size of the frame reordering buffer in the decoder. -+ * For MPEG-2 it is 1 IPB or 0 low delay IP. -+ * - encoding: Set by libavcodec. -+ * - decoding: Set by libavcodec. -+ */ -+ int has_b_frames; -+ -+ /** -+ * qscale factor between P- and I-frames -+ * If > 0 then the last P-frame quantizer will be used (q = lastp_q * factor + -+ * offset). If < 0 then normal ratecontrol will be done (q= -+ * -normal_q*factor+offset). -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ float i_quant_factor; -+ -+ /** -+ * qscale offset between P and I-frames -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ float i_quant_offset; -+ -+ /** -+ * luminance masking (0-> disabled) -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ float lumi_masking; -+ -+ /** -+ * temporary complexity masking (0-> disabled) -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ float temporal_cplx_masking; -+ -+ /** -+ * spatial complexity masking (0-> disabled) -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ float spatial_cplx_masking; -+ -+ /** -+ * p block masking (0-> disabled) -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ float p_masking; -+ -+ /** -+ * darkness masking (0-> disabled) -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ float dark_masking; -+ -+ /** -+ * slice count -+ * - encoding: Set by libavcodec. -+ * - decoding: Set by user (or 0). -+ */ -+ int slice_count; -+ -+ /** -+ * slice offsets in the frame in bytes -+ * - encoding: Set/allocated by libavcodec. -+ * - decoding: Set/allocated by user (or NULL). -+ */ -+ int* slice_offset; -+ -+ /** -+ * sample aspect ratio (0 if unknown) -+ * That is the width of a pixel divided by the height of the pixel. -+ * Numerator and denominator must be relatively prime and smaller than 256 for -+ * some video standards. -+ * - encoding: Set by user. -+ * - decoding: Set by libavcodec. -+ */ -+ AVRational sample_aspect_ratio; -+ -+ /** -+ * motion estimation comparison function -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int me_cmp; -+ /** -+ * subpixel motion estimation comparison function -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int me_sub_cmp; -+ /** -+ * macroblock comparison function (not supported yet) -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int mb_cmp; -+ /** -+ * interlaced DCT comparison function -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int ildct_cmp; -+#define FF_CMP_SAD 0 -+#define FF_CMP_SSE 1 -+#define FF_CMP_SATD 2 -+#define FF_CMP_DCT 3 -+#define FF_CMP_PSNR 4 -+#define FF_CMP_BIT 5 -+#define FF_CMP_RD 6 -+#define FF_CMP_ZERO 7 -+#define FF_CMP_VSAD 8 -+#define FF_CMP_VSSE 9 -+#define FF_CMP_NSSE 10 -+#define FF_CMP_W53 11 -+#define FF_CMP_W97 12 -+#define FF_CMP_DCTMAX 13 -+#define FF_CMP_DCT264 14 -+#define FF_CMP_MEDIAN_SAD 15 -+#define FF_CMP_CHROMA 256 -+ -+ /** -+ * ME diamond size & shape -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int dia_size; -+ -+ /** -+ * amount of previous MV predictors (2a+1 x 2a+1 square) -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int last_predictor_count; -+ -+ /** -+ * motion estimation prepass comparison function -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int me_pre_cmp; -+ -+ /** -+ * ME prepass diamond size & shape -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int pre_dia_size; -+ -+ /** -+ * subpel ME quality -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int me_subpel_quality; -+ -+ /** -+ * maximum motion estimation search range in subpel units -+ * If 0 then no limit. -+ * -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int me_range; -+ -+ /** -+ * slice flags -+ * - encoding: unused -+ * - decoding: Set by user. -+ */ -+ int slice_flags; -+#define SLICE_FLAG_CODED_ORDER \ -+ 0x0001 ///< draw_horiz_band() is called in coded order instead of display -+#define SLICE_FLAG_ALLOW_FIELD \ -+ 0x0002 ///< allow draw_horiz_band() with field slices (MPEG-2 field pics) -+#define SLICE_FLAG_ALLOW_PLANE \ -+ 0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1) -+ -+ /** -+ * macroblock decision mode -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int mb_decision; -+#define FF_MB_DECISION_SIMPLE 0 ///< uses mb_cmp -+#define FF_MB_DECISION_BITS 1 ///< chooses the one which needs the fewest bits -+#define FF_MB_DECISION_RD 2 ///< rate distortion -+ -+ /** -+ * custom intra quantization matrix -+ * Must be allocated with the av_malloc() family of functions, and will be -+ * freed in avcodec_free_context(). -+ * - encoding: Set/allocated by user, freed by libavcodec. Can be NULL. -+ * - decoding: Set/allocated/freed by libavcodec. -+ */ -+ uint16_t* intra_matrix; -+ -+ /** -+ * custom inter quantization matrix -+ * Must be allocated with the av_malloc() family of functions, and will be -+ * freed in avcodec_free_context(). -+ * - encoding: Set/allocated by user, freed by libavcodec. Can be NULL. -+ * - decoding: Set/allocated/freed by libavcodec. -+ */ -+ uint16_t* inter_matrix; -+ -+ /** -+ * precision of the intra DC coefficient - 8 -+ * - encoding: Set by user. -+ * - decoding: Set by libavcodec -+ */ -+ int intra_dc_precision; -+ -+ /** -+ * Number of macroblock rows at the top which are skipped. -+ * - encoding: unused -+ * - decoding: Set by user. -+ */ -+ int skip_top; -+ -+ /** -+ * Number of macroblock rows at the bottom which are skipped. -+ * - encoding: unused -+ * - decoding: Set by user. -+ */ -+ int skip_bottom; -+ -+ /** -+ * minimum MB Lagrange multiplier -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int mb_lmin; -+ -+ /** -+ * maximum MB Lagrange multiplier -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int mb_lmax; -+ -+ /** -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int bidir_refine; -+ -+ /** -+ * minimum GOP size -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int keyint_min; -+ -+ /** -+ * number of reference frames -+ * - encoding: Set by user. -+ * - decoding: Set by lavc. -+ */ -+ int refs; -+ -+ /** -+ * Note: Value depends upon the compare function used for fullpel ME. -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int mv0_threshold; -+ -+ /** -+ * Chromaticity coordinates of the source primaries. -+ * - encoding: Set by user -+ * - decoding: Set by libavcodec -+ */ -+ enum AVColorPrimaries color_primaries; -+ -+ /** -+ * Color Transfer Characteristic. -+ * - encoding: Set by user -+ * - decoding: Set by libavcodec -+ */ -+ enum AVColorTransferCharacteristic color_trc; -+ -+ /** -+ * YUV colorspace type. -+ * - encoding: Set by user -+ * - decoding: Set by libavcodec -+ */ -+ enum AVColorSpace colorspace; -+ -+ /** -+ * MPEG vs JPEG YUV range. -+ * - encoding: Set by user -+ * - decoding: Set by libavcodec -+ */ -+ enum AVColorRange color_range; -+ -+ /** -+ * This defines the location of chroma samples. -+ * - encoding: Set by user -+ * - decoding: Set by libavcodec -+ */ -+ enum AVChromaLocation chroma_sample_location; -+ -+ /** -+ * Number of slices. -+ * Indicates number of picture subdivisions. Used for parallelized -+ * decoding. -+ * - encoding: Set by user -+ * - decoding: unused -+ */ -+ int slices; -+ -+ /** Field order -+ * - encoding: set by libavcodec -+ * - decoding: Set by user. -+ */ -+ enum AVFieldOrder field_order; -+ -+ /* audio only */ -+ int sample_rate; ///< samples per second -+ int channels; ///< number of audio channels -+ -+ /** -+ * audio sample format -+ * - encoding: Set by user. -+ * - decoding: Set by libavcodec. -+ */ -+ enum AVSampleFormat sample_fmt; ///< sample format -+ -+ /* The following data should not be initialized. */ -+ /** -+ * Number of samples per channel in an audio frame. -+ * -+ * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame -+ * except the last must contain exactly frame_size samples per channel. -+ * May be 0 when the codec has AV_CODEC_CAP_VARIABLE_FRAME_SIZE set, then -+ * the frame size is not restricted. -+ * - decoding: may be set by some decoders to indicate constant frame size -+ */ -+ int frame_size; -+ -+ /** -+ * Frame counter, set by libavcodec. -+ * -+ * - decoding: total number of frames returned from the decoder so far. -+ * - encoding: total number of frames passed to the encoder so far. -+ * -+ * @note the counter is not incremented if encoding/decoding resulted in -+ * an error. -+ */ -+ int frame_number; -+ -+ /** -+ * number of bytes per packet if constant and known or 0 -+ * Used by some WAV based audio codecs. -+ */ -+ int block_align; -+ -+ /** -+ * Audio cutoff bandwidth (0 means "automatic") -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int cutoff; -+ -+ /** -+ * Audio channel layout. -+ * - encoding: set by user. -+ * - decoding: set by user, may be overwritten by libavcodec. -+ */ -+ uint64_t channel_layout; -+ -+ /** -+ * Request decoder to use this channel layout if it can (0 for default) -+ * - encoding: unused -+ * - decoding: Set by user. -+ */ -+ uint64_t request_channel_layout; -+ -+ /** -+ * Type of service that the audio stream conveys. -+ * - encoding: Set by user. -+ * - decoding: Set by libavcodec. -+ */ -+ enum AVAudioServiceType audio_service_type; -+ -+ /** -+ * desired sample format -+ * - encoding: Not used. -+ * - decoding: Set by user. -+ * Decoder will decode to this format if it can. -+ */ -+ enum AVSampleFormat request_sample_fmt; -+ -+ /** -+ * This callback is called at the beginning of each frame to get data -+ * buffer(s) for it. There may be one contiguous buffer for all the data or -+ * there may be a buffer per each data plane or anything in between. What -+ * this means is, you may set however many entries in buf[] you feel -+ * necessary. Each buffer must be reference-counted using the AVBuffer API -+ * (see description of buf[] below). -+ * -+ * The following fields will be set in the frame before this callback is -+ * called: -+ * - format -+ * - width, height (video only) -+ * - sample_rate, channel_layout, nb_samples (audio only) -+ * Their values may differ from the corresponding values in -+ * AVCodecContext. This callback must use the frame values, not the codec -+ * context values, to calculate the required buffer size. -+ * -+ * This callback must fill the following fields in the frame: -+ * - data[] -+ * - linesize[] -+ * - extended_data: -+ * * if the data is planar audio with more than 8 channels, then this -+ * callback must allocate and fill extended_data to contain all pointers -+ * to all data planes. data[] must hold as many pointers as it can. -+ * extended_data must be allocated with av_malloc() and will be freed in -+ * av_frame_unref(). -+ * * otherwise extended_data must point to data -+ * - buf[] must contain one or more pointers to AVBufferRef structures. Each -+ * of the frame's data and extended_data pointers must be contained in these. -+ * That is, one AVBufferRef for each allocated chunk of memory, not -+ * necessarily one AVBufferRef per data[] entry. See: av_buffer_create(), -+ * av_buffer_alloc(), and av_buffer_ref(). -+ * - extended_buf and nb_extended_buf must be allocated with av_malloc() by -+ * this callback and filled with the extra buffers if there are more -+ * buffers than buf[] can hold. extended_buf will be freed in -+ * av_frame_unref(). -+ * -+ * If AV_CODEC_CAP_DR1 is not set then get_buffer2() must call -+ * avcodec_default_get_buffer2() instead of providing buffers allocated by -+ * some other means. -+ * -+ * Each data plane must be aligned to the maximum required by the target -+ * CPU. -+ * -+ * @see avcodec_default_get_buffer2() -+ * -+ * Video: -+ * -+ * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused -+ * (read and/or written to if it is writable) later by libavcodec. -+ * -+ * avcodec_align_dimensions2() should be used to find the required width and -+ * height, as they normally need to be rounded up to the next multiple of 16. -+ * -+ * Some decoders do not support linesizes changing between frames. -+ * -+ * If frame multithreading is used, this callback may be called from a -+ * different thread, but not from more than one at once. Does not need to be -+ * reentrant. -+ * -+ * @see avcodec_align_dimensions2() -+ * -+ * Audio: -+ * -+ * Decoders request a buffer of a particular size by setting -+ * AVFrame.nb_samples prior to calling get_buffer2(). The decoder may, -+ * however, utilize only part of the buffer by setting AVFrame.nb_samples -+ * to a smaller value in the output frame. -+ * -+ * As a convenience, av_samples_get_buffer_size() and -+ * av_samples_fill_arrays() in libavutil may be used by custom get_buffer2() -+ * functions to find the required data size and to fill data pointers and -+ * linesize. In AVFrame.linesize, only linesize[0] may be set for audio -+ * since all planes must be the same size. -+ * -+ * @see av_samples_get_buffer_size(), av_samples_fill_arrays() -+ * -+ * - encoding: unused -+ * - decoding: Set by libavcodec, user can override. -+ */ -+ int (*get_buffer2)(struct AVCodecContext* s, AVFrame* frame, int flags); -+ -+ /* - encoding parameters */ -+ float qcompress; ///< amount of qscale change between easy & hard scenes -+ ///< (0.0-1.0) -+ float qblur; ///< amount of qscale smoothing over time (0.0-1.0) -+ -+ /** -+ * minimum quantizer -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int qmin; -+ -+ /** -+ * maximum quantizer -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int qmax; -+ -+ /** -+ * maximum quantizer difference between frames -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int max_qdiff; -+ -+ /** -+ * decoder bitstream buffer size -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int rc_buffer_size; -+ -+ /** -+ * ratecontrol override, see RcOverride -+ * - encoding: Allocated/set/freed by user. -+ * - decoding: unused -+ */ -+ int rc_override_count; -+ RcOverride* rc_override; -+ -+ /** -+ * maximum bitrate -+ * - encoding: Set by user. -+ * - decoding: Set by user, may be overwritten by libavcodec. -+ */ -+ int64_t rc_max_rate; -+ -+ /** -+ * minimum bitrate -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int64_t rc_min_rate; -+ -+ /** -+ * Ratecontrol attempt to use, at maximum, of what can be used without -+ * an underflow. -+ * - encoding: Set by user. -+ * - decoding: unused. -+ */ -+ float rc_max_available_vbv_use; -+ -+ /** -+ * Ratecontrol attempt to use, at least, times the amount needed to -+ * prevent a vbv overflow. -+ * - encoding: Set by user. -+ * - decoding: unused. -+ */ -+ float rc_min_vbv_overflow_use; -+ -+ /** -+ * Number of bits which should be loaded into the rc buffer before decoding -+ * starts. -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int rc_initial_buffer_occupancy; -+ -+ /** -+ * trellis RD quantization -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int trellis; -+ -+ /** -+ * pass1 encoding statistics output buffer -+ * - encoding: Set by libavcodec. -+ * - decoding: unused -+ */ -+ char* stats_out; -+ -+ /** -+ * pass2 encoding statistics input buffer -+ * Concatenated stuff from stats_out of pass1 should be placed here. -+ * - encoding: Allocated/set/freed by user. -+ * - decoding: unused -+ */ -+ char* stats_in; -+ -+ /** -+ * Work around bugs in encoders which sometimes cannot be detected -+ * automatically. -+ * - encoding: Set by user -+ * - decoding: Set by user -+ */ -+ int workaround_bugs; -+#define FF_BUG_AUTODETECT 1 ///< autodetection -+#define FF_BUG_XVID_ILACE 4 -+#define FF_BUG_UMP4 8 -+#define FF_BUG_NO_PADDING 16 -+#define FF_BUG_AMV 32 -+#define FF_BUG_QPEL_CHROMA 64 -+#define FF_BUG_STD_QPEL 128 -+#define FF_BUG_QPEL_CHROMA2 256 -+#define FF_BUG_DIRECT_BLOCKSIZE 512 -+#define FF_BUG_EDGE 1024 -+#define FF_BUG_HPEL_CHROMA 2048 -+#define FF_BUG_DC_CLIP 4096 -+#define FF_BUG_MS \ -+ 8192 ///< Work around various bugs in Microsoft's broken decoders. -+#define FF_BUG_TRUNCATED 16384 -+#define FF_BUG_IEDGE 32768 -+ -+ /** -+ * strictly follow the standard (MPEG-4, ...). -+ * - encoding: Set by user. -+ * - decoding: Set by user. -+ * Setting this to STRICT or higher means the encoder and decoder will -+ * generally do stupid things, whereas setting it to unofficial or lower -+ * will mean the encoder might produce output that is not supported by all -+ * spec-compliant decoders. Decoders don't differentiate between normal, -+ * unofficial and experimental (that is, they always try to decode things -+ * when they can) unless they are explicitly asked to behave stupidly -+ * (=strictly conform to the specs) -+ */ -+ int strict_std_compliance; -+#define FF_COMPLIANCE_VERY_STRICT \ -+ 2 ///< Strictly conform to an older more strict version of the spec or -+ ///< reference software. -+#define FF_COMPLIANCE_STRICT \ -+ 1 ///< Strictly conform to all the things in the spec no matter what -+ ///< consequences. -+#define FF_COMPLIANCE_NORMAL 0 -+#define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions -+#define FF_COMPLIANCE_EXPERIMENTAL \ -+ -2 ///< Allow nonstandardized experimental things. -+ -+ /** -+ * error concealment flags -+ * - encoding: unused -+ * - decoding: Set by user. -+ */ -+ int error_concealment; -+#define FF_EC_GUESS_MVS 1 -+#define FF_EC_DEBLOCK 2 -+#define FF_EC_FAVOR_INTER 256 -+ -+ /** -+ * debug -+ * - encoding: Set by user. -+ * - decoding: Set by user. -+ */ -+ int debug; -+#define FF_DEBUG_PICT_INFO 1 -+#define FF_DEBUG_RC 2 -+#define FF_DEBUG_BITSTREAM 4 -+#define FF_DEBUG_MB_TYPE 8 -+#define FF_DEBUG_QP 16 -+#define FF_DEBUG_DCT_COEFF 0x00000040 -+#define FF_DEBUG_SKIP 0x00000080 -+#define FF_DEBUG_STARTCODE 0x00000100 -+#define FF_DEBUG_ER 0x00000400 -+#define FF_DEBUG_MMCO 0x00000800 -+#define FF_DEBUG_BUGS 0x00001000 -+#define FF_DEBUG_BUFFERS 0x00008000 -+#define FF_DEBUG_THREADS 0x00010000 -+#define FF_DEBUG_GREEN_MD 0x00800000 -+#define FF_DEBUG_NOMC 0x01000000 -+ -+ /** -+ * Error recognition; may misdetect some more or less valid parts as errors. -+ * - encoding: Set by user. -+ * - decoding: Set by user. -+ */ -+ int err_recognition; -+ -+/** -+ * Verify checksums embedded in the bitstream (could be of either encoded or -+ * decoded data, depending on the codec) and print an error message on mismatch. -+ * If AV_EF_EXPLODE is also set, a mismatching checksum will result in the -+ * decoder returning an error. -+ */ -+#define AV_EF_CRCCHECK (1 << 0) -+#define AV_EF_BITSTREAM (1 << 1) ///< detect bitstream specification deviations -+#define AV_EF_BUFFER (1 << 2) ///< detect improper bitstream length -+#define AV_EF_EXPLODE (1 << 3) ///< abort decoding on minor error detection -+ -+#define AV_EF_IGNORE_ERR (1 << 15) ///< ignore errors and continue -+#define AV_EF_CAREFUL \ -+ (1 << 16) ///< consider things that violate the spec, are fast to calculate -+ ///< and have not been seen in the wild as errors -+#define AV_EF_COMPLIANT \ -+ (1 << 17) ///< consider all spec non compliances as errors -+#define AV_EF_AGGRESSIVE \ -+ (1 << 18) ///< consider things that a sane encoder should not do as an error -+ -+ /** -+ * opaque 64-bit number (generally a PTS) that will be reordered and -+ * output in AVFrame.reordered_opaque -+ * - encoding: Set by libavcodec to the reordered_opaque of the input -+ * frame corresponding to the last returned packet. Only -+ * supported by encoders with the -+ * AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE capability. -+ * - decoding: Set by user. -+ */ -+ int64_t reordered_opaque; -+ -+ /** -+ * Hardware accelerator in use -+ * - encoding: unused. -+ * - decoding: Set by libavcodec -+ */ -+ const struct AVHWAccel* hwaccel; -+ -+ /** -+ * Hardware accelerator context. -+ * For some hardware accelerators, a global context needs to be -+ * provided by the user. In that case, this holds display-dependent -+ * data FFmpeg cannot instantiate itself. Please refer to the -+ * FFmpeg HW accelerator documentation to know how to fill this. -+ * - encoding: unused -+ * - decoding: Set by user -+ */ -+ void* hwaccel_context; -+ -+ /** -+ * error -+ * - encoding: Set by libavcodec if flags & AV_CODEC_FLAG_PSNR. -+ * - decoding: unused -+ */ -+ uint64_t error[AV_NUM_DATA_POINTERS]; -+ -+ /** -+ * DCT algorithm, see FF_DCT_* below -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int dct_algo; -+#define FF_DCT_AUTO 0 -+#define FF_DCT_FASTINT 1 -+#define FF_DCT_INT 2 -+#define FF_DCT_MMX 3 -+#define FF_DCT_ALTIVEC 5 -+#define FF_DCT_FAAN 6 -+ -+ /** -+ * IDCT algorithm, see FF_IDCT_* below. -+ * - encoding: Set by user. -+ * - decoding: Set by user. -+ */ -+ int idct_algo; -+#define FF_IDCT_AUTO 0 -+#define FF_IDCT_INT 1 -+#define FF_IDCT_SIMPLE 2 -+#define FF_IDCT_SIMPLEMMX 3 -+#define FF_IDCT_ARM 7 -+#define FF_IDCT_ALTIVEC 8 -+#define FF_IDCT_SIMPLEARM 10 -+#define FF_IDCT_XVID 14 -+#define FF_IDCT_SIMPLEARMV5TE 16 -+#define FF_IDCT_SIMPLEARMV6 17 -+#define FF_IDCT_FAAN 20 -+#define FF_IDCT_SIMPLENEON 22 -+#define FF_IDCT_NONE \ -+ 24 /* Used by XvMC to extract IDCT coefficients with FF_IDCT_PERM_NONE */ -+#define FF_IDCT_SIMPLEAUTO 128 -+ -+ /** -+ * bits per sample/pixel from the demuxer (needed for huffyuv). -+ * - encoding: Set by libavcodec. -+ * - decoding: Set by user. -+ */ -+ int bits_per_coded_sample; -+ -+ /** -+ * Bits per sample/pixel of internal libavcodec pixel/sample format. -+ * - encoding: set by user. -+ * - decoding: set by libavcodec. -+ */ -+ int bits_per_raw_sample; -+ -+ /** -+ * low resolution decoding, 1-> 1/2 size, 2->1/4 size -+ * - encoding: unused -+ * - decoding: Set by user. -+ */ -+ int lowres; -+ -+ /** -+ * thread count -+ * is used to decide how many independent tasks should be passed to execute() -+ * - encoding: Set by user. -+ * - decoding: Set by user. -+ */ -+ int thread_count; -+ -+ /** -+ * Which multithreading methods to use. -+ * Use of FF_THREAD_FRAME will increase decoding delay by one frame per -+ * thread, so clients which cannot provide future frames should not use it. -+ * -+ * - encoding: Set by user, otherwise the default is used. -+ * - decoding: Set by user, otherwise the default is used. -+ */ -+ int thread_type; -+#define FF_THREAD_FRAME 1 ///< Decode more than one frame at once -+#define FF_THREAD_SLICE \ -+ 2 ///< Decode more than one part of a single frame at once -+ -+ /** -+ * Which multithreading methods are in use by the codec. -+ * - encoding: Set by libavcodec. -+ * - decoding: Set by libavcodec. -+ */ -+ int active_thread_type; -+ -+#if FF_API_THREAD_SAFE_CALLBACKS -+ /** -+ * Set by the client if its custom get_buffer() callback can be called -+ * synchronously from another thread, which allows faster multithreaded -+ * decoding. draw_horiz_band() will be called from other threads regardless of -+ * this setting. Ignored if the default get_buffer() is used. -+ * - encoding: Set by user. -+ * - decoding: Set by user. -+ * -+ * @deprecated the custom get_buffer2() callback should always be -+ * thread-safe. Thread-unsafe get_buffer2() implementations will be -+ * invalid starting with LIBAVCODEC_VERSION_MAJOR=60; in other words, -+ * libavcodec will behave as if this field was always set to 1. -+ * Callers that want to be forward compatible with future libavcodec -+ * versions should wrap access to this field in -+ * #if LIBAVCODEC_VERSION_MAJOR < 60 -+ */ -+ attribute_deprecated int thread_safe_callbacks; -+#endif -+ -+ /** -+ * The codec may call this to execute several independent things. -+ * It will return only after finishing all tasks. -+ * The user may replace this with some multithreaded implementation, -+ * the default implementation will execute the parts serially. -+ * @param count the number of things to execute -+ * - encoding: Set by libavcodec, user can override. -+ * - decoding: Set by libavcodec, user can override. -+ */ -+ int (*execute)(struct AVCodecContext* c, -+ int (*func)(struct AVCodecContext* c2, void* arg), void* arg2, -+ int* ret, int count, int size); -+ -+ /** -+ * The codec may call this to execute several independent things. -+ * It will return only after finishing all tasks. -+ * The user may replace this with some multithreaded implementation, -+ * the default implementation will execute the parts serially. -+ * Also see avcodec_thread_init and e.g. the --enable-pthread configure -+ * option. -+ * @param c context passed also to func -+ * @param count the number of things to execute -+ * @param arg2 argument passed unchanged to func -+ * @param ret return values of executed functions, must have space for "count" -+ * values. May be NULL. -+ * @param func function that will be called count times, with jobnr from 0 to -+ * count-1. threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS -+ * and so that no two instances of func executing at the same time will have -+ * the same threadnr. -+ * @return always 0 currently, but code should handle a future improvement -+ * where when any call to func returns < 0 no further calls to func may be -+ * done and < 0 is returned. -+ * - encoding: Set by libavcodec, user can override. -+ * - decoding: Set by libavcodec, user can override. -+ */ -+ int (*execute2)(struct AVCodecContext* c, -+ int (*func)(struct AVCodecContext* c2, void* arg, int jobnr, -+ int threadnr), -+ void* arg2, int* ret, int count); -+ -+ /** -+ * noise vs. sse weight for the nsse comparison function -+ * - encoding: Set by user. -+ * - decoding: unused -+ */ -+ int nsse_weight; -+ -+ /** -+ * profile -+ * - encoding: Set by user. -+ * - decoding: Set by libavcodec. -+ */ -+ int profile; -+#define FF_PROFILE_UNKNOWN -99 -+#define FF_PROFILE_RESERVED -100 -+ -+#define FF_PROFILE_AAC_MAIN 0 -+#define FF_PROFILE_AAC_LOW 1 -+#define FF_PROFILE_AAC_SSR 2 -+#define FF_PROFILE_AAC_LTP 3 -+#define FF_PROFILE_AAC_HE 4 -+#define FF_PROFILE_AAC_HE_V2 28 -+#define FF_PROFILE_AAC_LD 22 -+#define FF_PROFILE_AAC_ELD 38 -+#define FF_PROFILE_MPEG2_AAC_LOW 128 -+#define FF_PROFILE_MPEG2_AAC_HE 131 -+ -+#define FF_PROFILE_DNXHD 0 -+#define FF_PROFILE_DNXHR_LB 1 -+#define FF_PROFILE_DNXHR_SQ 2 -+#define FF_PROFILE_DNXHR_HQ 3 -+#define FF_PROFILE_DNXHR_HQX 4 -+#define FF_PROFILE_DNXHR_444 5 -+ -+#define FF_PROFILE_DTS 20 -+#define FF_PROFILE_DTS_ES 30 -+#define FF_PROFILE_DTS_96_24 40 -+#define FF_PROFILE_DTS_HD_HRA 50 -+#define FF_PROFILE_DTS_HD_MA 60 -+#define FF_PROFILE_DTS_EXPRESS 70 -+ -+#define FF_PROFILE_MPEG2_422 0 -+#define FF_PROFILE_MPEG2_HIGH 1 -+#define FF_PROFILE_MPEG2_SS 2 -+#define FF_PROFILE_MPEG2_SNR_SCALABLE 3 -+#define FF_PROFILE_MPEG2_MAIN 4 -+#define FF_PROFILE_MPEG2_SIMPLE 5 -+ -+#define FF_PROFILE_H264_CONSTRAINED (1 << 9) // 8+1; constraint_set1_flag -+#define FF_PROFILE_H264_INTRA (1 << 11) // 8+3; constraint_set3_flag -+ -+#define FF_PROFILE_H264_BASELINE 66 -+#define FF_PROFILE_H264_CONSTRAINED_BASELINE (66 | FF_PROFILE_H264_CONSTRAINED) -+#define FF_PROFILE_H264_MAIN 77 -+#define FF_PROFILE_H264_EXTENDED 88 -+#define FF_PROFILE_H264_HIGH 100 -+#define FF_PROFILE_H264_HIGH_10 110 -+#define FF_PROFILE_H264_HIGH_10_INTRA (110 | FF_PROFILE_H264_INTRA) -+#define FF_PROFILE_H264_MULTIVIEW_HIGH 118 -+#define FF_PROFILE_H264_HIGH_422 122 -+#define FF_PROFILE_H264_HIGH_422_INTRA (122 | FF_PROFILE_H264_INTRA) -+#define FF_PROFILE_H264_STEREO_HIGH 128 -+#define FF_PROFILE_H264_HIGH_444 144 -+#define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244 -+#define FF_PROFILE_H264_HIGH_444_INTRA (244 | FF_PROFILE_H264_INTRA) -+#define FF_PROFILE_H264_CAVLC_444 44 -+ -+#define FF_PROFILE_VC1_SIMPLE 0 -+#define FF_PROFILE_VC1_MAIN 1 -+#define FF_PROFILE_VC1_COMPLEX 2 -+#define FF_PROFILE_VC1_ADVANCED 3 -+ -+#define FF_PROFILE_MPEG4_SIMPLE 0 -+#define FF_PROFILE_MPEG4_SIMPLE_SCALABLE 1 -+#define FF_PROFILE_MPEG4_CORE 2 -+#define FF_PROFILE_MPEG4_MAIN 3 -+#define FF_PROFILE_MPEG4_N_BIT 4 -+#define FF_PROFILE_MPEG4_SCALABLE_TEXTURE 5 -+#define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6 -+#define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7 -+#define FF_PROFILE_MPEG4_HYBRID 8 -+#define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME 9 -+#define FF_PROFILE_MPEG4_CORE_SCALABLE 10 -+#define FF_PROFILE_MPEG4_ADVANCED_CODING 11 -+#define FF_PROFILE_MPEG4_ADVANCED_CORE 12 -+#define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13 -+#define FF_PROFILE_MPEG4_SIMPLE_STUDIO 14 -+#define FF_PROFILE_MPEG4_ADVANCED_SIMPLE 15 -+ -+#define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 1 -+#define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 2 -+#define FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 32768 -+#define FF_PROFILE_JPEG2000_DCINEMA_2K 3 -+#define FF_PROFILE_JPEG2000_DCINEMA_4K 4 -+ -+#define FF_PROFILE_VP9_0 0 -+#define FF_PROFILE_VP9_1 1 -+#define FF_PROFILE_VP9_2 2 -+#define FF_PROFILE_VP9_3 3 -+ -+#define FF_PROFILE_HEVC_MAIN 1 -+#define FF_PROFILE_HEVC_MAIN_10 2 -+#define FF_PROFILE_HEVC_MAIN_STILL_PICTURE 3 -+#define FF_PROFILE_HEVC_REXT 4 -+ -+#define FF_PROFILE_VVC_MAIN_10 1 -+#define FF_PROFILE_VVC_MAIN_10_444 33 -+ -+#define FF_PROFILE_AV1_MAIN 0 -+#define FF_PROFILE_AV1_HIGH 1 -+#define FF_PROFILE_AV1_PROFESSIONAL 2 -+ -+#define FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT 0xc0 -+#define FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT 0xc1 -+#define FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT 0xc2 -+#define FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS 0xc3 -+#define FF_PROFILE_MJPEG_JPEG_LS 0xf7 -+ -+#define FF_PROFILE_SBC_MSBC 1 -+ -+#define FF_PROFILE_PRORES_PROXY 0 -+#define FF_PROFILE_PRORES_LT 1 -+#define FF_PROFILE_PRORES_STANDARD 2 -+#define FF_PROFILE_PRORES_HQ 3 -+#define FF_PROFILE_PRORES_4444 4 -+#define FF_PROFILE_PRORES_XQ 5 -+ -+#define FF_PROFILE_ARIB_PROFILE_A 0 -+#define FF_PROFILE_ARIB_PROFILE_C 1 -+ -+#define FF_PROFILE_KLVA_SYNC 0 -+#define FF_PROFILE_KLVA_ASYNC 1 -+ -+ /** -+ * level -+ * - encoding: Set by user. -+ * - decoding: Set by libavcodec. -+ */ -+ int level; -+#define FF_LEVEL_UNKNOWN -99 -+ -+ /** -+ * Skip loop filtering for selected frames. -+ * - encoding: unused -+ * - decoding: Set by user. -+ */ -+ enum AVDiscard skip_loop_filter; -+ -+ /** -+ * Skip IDCT/dequantization for selected frames. -+ * - encoding: unused -+ * - decoding: Set by user. -+ */ -+ enum AVDiscard skip_idct; -+ -+ /** -+ * Skip decoding for selected frames. -+ * - encoding: unused -+ * - decoding: Set by user. -+ */ -+ enum AVDiscard skip_frame; -+ -+ /** -+ * Header containing style information for text subtitles. -+ * For SUBTITLE_ASS subtitle type, it should contain the whole ASS -+ * [Script Info] and [V4+ Styles] section, plus the [Events] line and -+ * the Format line following. It shouldn't include any Dialogue line. -+ * - encoding: Set/allocated/freed by user (before avcodec_open2()) -+ * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) -+ */ -+ uint8_t* subtitle_header; -+ int subtitle_header_size; -+ -+ /** -+ * Audio only. The number of "priming" samples (padding) inserted by the -+ * encoder at the beginning of the audio. I.e. this number of leading -+ * decoded samples must be discarded by the caller to get the original audio -+ * without leading padding. -+ * -+ * - decoding: unused -+ * - encoding: Set by libavcodec. The timestamps on the output packets are -+ * adjusted by the encoder so that they always refer to the -+ * first sample of the data actually contained in the packet, -+ * including any added padding. E.g. if the timebase is -+ * 1/samplerate and the timestamp of the first input sample is -+ * 0, the timestamp of the first output packet will be -+ * -initial_padding. -+ */ -+ int initial_padding; -+ -+ /** -+ * - decoding: For codecs that store a framerate value in the compressed -+ * bitstream, the decoder may export it here. { 0, 1} when -+ * unknown. -+ * - encoding: May be used to signal the framerate of CFR content to an -+ * encoder. -+ */ -+ AVRational framerate; -+ -+ /** -+ * Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx. -+ * - encoding: unused. -+ * - decoding: Set by libavcodec before calling get_format() -+ */ -+ enum AVPixelFormat sw_pix_fmt; -+ -+ /** -+ * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. -+ * - encoding unused. -+ * - decoding set by user. -+ */ -+ AVRational pkt_timebase; -+ -+ /** -+ * AVCodecDescriptor -+ * - encoding: unused. -+ * - decoding: set by libavcodec. -+ */ -+ const AVCodecDescriptor* codec_descriptor; -+ -+ /** -+ * Current statistics for PTS correction. -+ * - decoding: maintained and used by libavcodec, not intended to be used by -+ * user apps -+ * - encoding: unused -+ */ -+ int64_t -+ pts_correction_num_faulty_pts; /// Number of incorrect PTS values so far -+ int64_t -+ pts_correction_num_faulty_dts; /// Number of incorrect DTS values so far -+ int64_t pts_correction_last_pts; /// PTS of the last frame -+ int64_t pts_correction_last_dts; /// DTS of the last frame -+ -+ /** -+ * Character encoding of the input subtitles file. -+ * - decoding: set by user -+ * - encoding: unused -+ */ -+ char* sub_charenc; -+ -+ /** -+ * Subtitles character encoding mode. Formats or codecs might be adjusting -+ * this setting (if they are doing the conversion themselves for instance). -+ * - decoding: set by libavcodec -+ * - encoding: unused -+ */ -+ int sub_charenc_mode; -+#define FF_SUB_CHARENC_MODE_DO_NOTHING \ -+ -1 ///< do nothing (demuxer outputs a stream supposed to be already in UTF-8, -+ ///< or the codec is bitmap for instance) -+#define FF_SUB_CHARENC_MODE_AUTOMATIC \ -+ 0 ///< libavcodec will select the mode itself -+#define FF_SUB_CHARENC_MODE_PRE_DECODER \ -+ 1 ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the -+ ///< decoder, requires iconv -+#define FF_SUB_CHARENC_MODE_IGNORE \ -+ 2 ///< neither convert the subtitles, nor check them for valid UTF-8 -+ -+ /** -+ * Skip processing alpha if supported by codec. -+ * Note that if the format uses pre-multiplied alpha (common with VP6, -+ * and recommended due to better video quality/compression) -+ * the image will look as if alpha-blended onto a black background. -+ * However for formats that do not use pre-multiplied alpha -+ * there might be serious artefacts (though e.g. libswscale currently -+ * assumes pre-multiplied alpha anyway). -+ * -+ * - decoding: set by user -+ * - encoding: unused -+ */ -+ int skip_alpha; -+ -+ /** -+ * Number of samples to skip after a discontinuity -+ * - decoding: unused -+ * - encoding: set by libavcodec -+ */ -+ int seek_preroll; -+ -+#if FF_API_DEBUG_MV -+ /** -+ * @deprecated unused -+ */ -+ attribute_deprecated int debug_mv; -+# define FF_DEBUG_VIS_MV_P_FOR \ -+ 0x00000001 // visualize forward predicted MVs of P frames -+# define FF_DEBUG_VIS_MV_B_FOR \ -+ 0x00000002 // visualize forward predicted MVs of B frames -+# define FF_DEBUG_VIS_MV_B_BACK \ -+ 0x00000004 // visualize backward predicted MVs of B frames -+#endif -+ -+ /** -+ * custom intra quantization matrix -+ * - encoding: Set by user, can be NULL. -+ * - decoding: unused. -+ */ -+ uint16_t* chroma_intra_matrix; -+ -+ /** -+ * dump format separator. -+ * can be ", " or "\n " or anything else -+ * - encoding: Set by user. -+ * - decoding: Set by user. -+ */ -+ uint8_t* dump_separator; -+ -+ /** -+ * ',' separated list of allowed decoders. -+ * If NULL then all are allowed -+ * - encoding: unused -+ * - decoding: set by user -+ */ -+ char* codec_whitelist; -+ -+ /** -+ * Properties of the stream that gets decoded -+ * - encoding: unused -+ * - decoding: set by libavcodec -+ */ -+ unsigned properties; -+#define FF_CODEC_PROPERTY_LOSSLESS 0x00000001 -+#define FF_CODEC_PROPERTY_CLOSED_CAPTIONS 0x00000002 -+#define FF_CODEC_PROPERTY_FILM_GRAIN 0x00000004 -+ -+ /** -+ * Additional data associated with the entire coded stream. -+ * -+ * - decoding: unused -+ * - encoding: may be set by libavcodec after avcodec_open2(). -+ */ -+ AVPacketSideData* coded_side_data; -+ int nb_coded_side_data; -+ -+ /** -+ * A reference to the AVHWFramesContext describing the input (for encoding) -+ * or output (decoding) frames. The reference is set by the caller and -+ * afterwards owned (and freed) by libavcodec - it should never be read by -+ * the caller after being set. -+ * -+ * - decoding: This field should be set by the caller from the get_format() -+ * callback. The previous reference (if any) will always be -+ * unreffed by libavcodec before the get_format() call. -+ * -+ * If the default get_buffer2() is used with a hwaccel pixel -+ * format, then this AVHWFramesContext will be used for -+ * allocating the frame buffers. -+ * -+ * - encoding: For hardware encoders configured to use a hwaccel pixel -+ * format, this field should be set by the caller to a reference -+ * to the AVHWFramesContext describing input frames. -+ * AVHWFramesContext.format must be equal to -+ * AVCodecContext.pix_fmt. -+ * -+ * This field should be set before avcodec_open2() is called. -+ */ -+ AVBufferRef* hw_frames_ctx; -+ -+#if FF_API_SUB_TEXT_FORMAT -+ /** -+ * @deprecated unused -+ */ -+ attribute_deprecated int sub_text_format; -+# define FF_SUB_TEXT_FMT_ASS 0 -+#endif -+ -+ /** -+ * Audio only. The amount of padding (in samples) appended by the encoder to -+ * the end of the audio. I.e. this number of decoded samples must be -+ * discarded by the caller from the end of the stream to get the original -+ * audio without any trailing padding. -+ * -+ * - decoding: unused -+ * - encoding: unused -+ */ -+ int trailing_padding; -+ -+ /** -+ * The number of pixels per image to maximally accept. -+ * -+ * - decoding: set by user -+ * - encoding: set by user -+ */ -+ int64_t max_pixels; -+ -+ /** -+ * A reference to the AVHWDeviceContext describing the device which will -+ * be used by a hardware encoder/decoder. The reference is set by the -+ * caller and afterwards owned (and freed) by libavcodec. -+ * -+ * This should be used if either the codec device does not require -+ * hardware frames or any that are used are to be allocated internally by -+ * libavcodec. If the user wishes to supply any of the frames used as -+ * encoder input or decoder output then hw_frames_ctx should be used -+ * instead. When hw_frames_ctx is set in get_format() for a decoder, this -+ * field will be ignored while decoding the associated stream segment, but -+ * may again be used on a following one after another get_format() call. -+ * -+ * For both encoders and decoders this field should be set before -+ * avcodec_open2() is called and must not be written to thereafter. -+ * -+ * Note that some decoders may require this field to be set initially in -+ * order to support hw_frames_ctx at all - in that case, all frames -+ * contexts used must be created on the same device. -+ */ -+ AVBufferRef* hw_device_ctx; -+ -+ /** -+ * Bit set of AV_HWACCEL_FLAG_* flags, which affect hardware accelerated -+ * decoding (if active). -+ * - encoding: unused -+ * - decoding: Set by user (either before avcodec_open2(), or in the -+ * AVCodecContext.get_format callback) -+ */ -+ int hwaccel_flags; -+ -+ /** -+ * Video decoding only. Certain video codecs support cropping, meaning that -+ * only a sub-rectangle of the decoded frame is intended for display. This -+ * option controls how cropping is handled by libavcodec. -+ * -+ * When set to 1 (the default), libavcodec will apply cropping internally. -+ * I.e. it will modify the output frame width/height fields and offset the -+ * data pointers (only by as much as possible while preserving alignment, or -+ * by the full amount if the AV_CODEC_FLAG_UNALIGNED flag is set) so that -+ * the frames output by the decoder refer only to the cropped area. The -+ * crop_* fields of the output frames will be zero. -+ * -+ * When set to 0, the width/height fields of the output frames will be set -+ * to the coded dimensions and the crop_* fields will describe the cropping -+ * rectangle. Applying the cropping is left to the caller. -+ * -+ * @warning When hardware acceleration with opaque output frames is used, -+ * libavcodec is unable to apply cropping from the top/left border. -+ * -+ * @note when this option is set to zero, the width/height fields of the -+ * AVCodecContext and output AVFrames have different meanings. The codec -+ * context fields store display dimensions (with the coded dimensions in -+ * coded_width/height), while the frame fields store the coded dimensions -+ * (with the display dimensions being determined by the crop_* fields). -+ */ -+ int apply_cropping; -+ -+ /* -+ * Video decoding only. Sets the number of extra hardware frames which -+ * the decoder will allocate for use by the caller. This must be set -+ * before avcodec_open2() is called. -+ * -+ * Some hardware decoders require all frames that they will use for -+ * output to be defined in advance before decoding starts. For such -+ * decoders, the hardware frame pool must therefore be of a fixed size. -+ * The extra frames set here are on top of any number that the decoder -+ * needs internally in order to operate normally (for example, frames -+ * used as reference pictures). -+ */ -+ int extra_hw_frames; -+ -+ /** -+ * The percentage of damaged samples to discard a frame. -+ * -+ * - decoding: set by user -+ * - encoding: unused -+ */ -+ int discard_damaged_percentage; -+ -+ /** -+ * The number of samples per frame to maximally accept. -+ * -+ * - decoding: set by user -+ * - encoding: set by user -+ */ -+ int64_t max_samples; -+ -+ /** -+ * Bit set of AV_CODEC_EXPORT_DATA_* flags, which affects the kind of -+ * metadata exported in frame, packet, or coded stream side data by -+ * decoders and encoders. -+ * -+ * - decoding: set by user -+ * - encoding: set by user -+ */ -+ int export_side_data; -+ -+ /** -+ * This callback is called at the beginning of each packet to get a data -+ * buffer for it. -+ * -+ * The following field will be set in the packet before this callback is -+ * called: -+ * - size -+ * This callback must use the above value to calculate the required buffer -+ * size, which must padded by at least AV_INPUT_BUFFER_PADDING_SIZE bytes. -+ * -+ * In some specific cases, the encoder may not use the entire buffer allocated -+ * by this callback. This will be reflected in the size value in the packet -+ * once returned by avcodec_receive_packet(). -+ * -+ * This callback must fill the following fields in the packet: -+ * - data: alignment requirements for AVPacket apply, if any. Some -+ * architectures and encoders may benefit from having aligned data. -+ * - buf: must contain a pointer to an AVBufferRef structure. The packet's -+ * data pointer must be contained in it. See: av_buffer_create(), -+ * av_buffer_alloc(), and av_buffer_ref(). -+ * -+ * If AV_CODEC_CAP_DR1 is not set then get_encode_buffer() must call -+ * avcodec_default_get_encode_buffer() instead of providing a buffer allocated -+ * by some other means. -+ * -+ * The flags field may contain a combination of AV_GET_ENCODE_BUFFER_FLAG_ -+ * flags. They may be used for example to hint what use the buffer may get -+ * after being created. Implementations of this callback may ignore flags they -+ * don't understand. If AV_GET_ENCODE_BUFFER_FLAG_REF is set in flags then the -+ * packet may be reused (read and/or written to if it is writable) later by -+ * libavcodec. -+ * -+ * This callback must be thread-safe, as when frame threading is used, it may -+ * be called from multiple threads simultaneously. -+ * -+ * @see avcodec_default_get_encode_buffer() -+ * -+ * - encoding: Set by libavcodec, user can override. -+ * - decoding: unused -+ */ -+ int (*get_encode_buffer)(struct AVCodecContext* s, AVPacket* pkt, int flags); -+} AVCodecContext; -+ -+struct MpegEncContext; -+ -+/** -+ * @defgroup lavc_hwaccel AVHWAccel -+ * -+ * @note Nothing in this structure should be accessed by the user. At some -+ * point in future it will not be externally visible at all. -+ * -+ * @{ -+ */ -+typedef struct AVHWAccel { -+ /** -+ * Name of the hardware accelerated codec. -+ * The name is globally unique among encoders and among decoders (but an -+ * encoder and a decoder can share the same name). -+ */ -+ const char* name; -+ -+ /** -+ * Type of codec implemented by the hardware accelerator. -+ * -+ * See AVMEDIA_TYPE_xxx -+ */ -+ enum AVMediaType type; -+ -+ /** -+ * Codec implemented by the hardware accelerator. -+ * -+ * See AV_CODEC_ID_xxx -+ */ -+ enum AVCodecID id; -+ -+ /** -+ * Supported pixel format. -+ * -+ * Only hardware accelerated formats are supported here. -+ */ -+ enum AVPixelFormat pix_fmt; -+ -+ /** -+ * Hardware accelerated codec capabilities. -+ * see AV_HWACCEL_CODEC_CAP_* -+ */ -+ int capabilities; -+ -+ /***************************************************************** -+ * No fields below this line are part of the public API. They -+ * may not be used outside of libavcodec and can be changed and -+ * removed at will. -+ * New public fields should be added right above. -+ ***************************************************************** -+ */ -+ -+ /** -+ * Allocate a custom buffer -+ */ -+ int (*alloc_frame)(AVCodecContext* avctx, AVFrame* frame); -+ -+ /** -+ * Called at the beginning of each frame or field picture. -+ * -+ * Meaningful frame information (codec specific) is guaranteed to -+ * be parsed at this point. This function is mandatory. -+ * -+ * Note that buf can be NULL along with buf_size set to 0. -+ * Otherwise, this means the whole frame is available at this point. -+ * -+ * @param avctx the codec context -+ * @param buf the frame data buffer base -+ * @param buf_size the size of the frame in bytes -+ * @return zero if successful, a negative value otherwise -+ */ -+ int (*start_frame)(AVCodecContext* avctx, const uint8_t* buf, -+ uint32_t buf_size); -+ -+ /** -+ * Callback for parameter data (SPS/PPS/VPS etc). -+ * -+ * Useful for hardware decoders which keep persistent state about the -+ * video parameters, and need to receive any changes to update that state. -+ * -+ * @param avctx the codec context -+ * @param type the nal unit type -+ * @param buf the nal unit data buffer -+ * @param buf_size the size of the nal unit in bytes -+ * @return zero if successful, a negative value otherwise -+ */ -+ int (*decode_params)(AVCodecContext* avctx, int type, const uint8_t* buf, -+ uint32_t buf_size); -+ -+ /** -+ * Callback for each slice. -+ * -+ * Meaningful slice information (codec specific) is guaranteed to -+ * be parsed at this point. This function is mandatory. -+ * The only exception is XvMC, that works on MB level. -+ * -+ * @param avctx the codec context -+ * @param buf the slice data buffer base -+ * @param buf_size the size of the slice in bytes -+ * @return zero if successful, a negative value otherwise -+ */ -+ int (*decode_slice)(AVCodecContext* avctx, const uint8_t* buf, -+ uint32_t buf_size); -+ -+ /** -+ * Called at the end of each frame or field picture. -+ * -+ * The whole picture is parsed at this point and can now be sent -+ * to the hardware accelerator. This function is mandatory. -+ * -+ * @param avctx the codec context -+ * @return zero if successful, a negative value otherwise -+ */ -+ int (*end_frame)(AVCodecContext* avctx); -+ -+ /** -+ * Size of per-frame hardware accelerator private data. -+ * -+ * Private data is allocated with av_mallocz() before -+ * AVCodecContext.get_buffer() and deallocated after -+ * AVCodecContext.release_buffer(). -+ */ -+ int frame_priv_data_size; -+ -+ /** -+ * Called for every Macroblock in a slice. -+ * -+ * XvMC uses it to replace the ff_mpv_reconstruct_mb(). -+ * Instead of decoding to raw picture, MB parameters are -+ * stored in an array provided by the video driver. -+ * -+ * @param s the mpeg context -+ */ -+ void (*decode_mb)(struct MpegEncContext* s); -+ -+ /** -+ * Initialize the hwaccel private data. -+ * -+ * This will be called from ff_get_format(), after hwaccel and -+ * hwaccel_context are set and the hwaccel private data in AVCodecInternal -+ * is allocated. -+ */ -+ int (*init)(AVCodecContext* avctx); -+ -+ /** -+ * Uninitialize the hwaccel private data. -+ * -+ * This will be called from get_format() or avcodec_close(), after hwaccel -+ * and hwaccel_context are already uninitialized. -+ */ -+ int (*uninit)(AVCodecContext* avctx); -+ -+ /** -+ * Size of the private data to allocate in -+ * AVCodecInternal.hwaccel_priv_data. -+ */ -+ int priv_data_size; -+ -+ /** -+ * Internal hwaccel capabilities. -+ */ -+ int caps_internal; -+ -+ /** -+ * Fill the given hw_frames context with current codec parameters. Called -+ * from get_format. Refer to avcodec_get_hw_frames_parameters() for -+ * details. -+ * -+ * This CAN be called before AVHWAccel.init is called, and you must assume -+ * that avctx->hwaccel_priv_data is invalid. -+ */ -+ int (*frame_params)(AVCodecContext* avctx, AVBufferRef* hw_frames_ctx); -+} AVHWAccel; -+ -+/** -+ * HWAccel is experimental and is thus avoided in favor of non experimental -+ * codecs -+ */ -+#define AV_HWACCEL_CODEC_CAP_EXPERIMENTAL 0x0200 -+ -+/** -+ * Hardware acceleration should be used for decoding even if the codec level -+ * used is unknown or higher than the maximum supported level reported by the -+ * hardware driver. -+ * -+ * It's generally a good idea to pass this flag unless you have a specific -+ * reason not to, as hardware tends to under-report supported levels. -+ */ -+#define AV_HWACCEL_FLAG_IGNORE_LEVEL (1 << 0) -+ -+/** -+ * Hardware acceleration can output YUV pixel formats with a different chroma -+ * sampling than 4:2:0 and/or other than 8 bits per component. -+ */ -+#define AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH (1 << 1) -+ -+/** -+ * Hardware acceleration should still be attempted for decoding when the -+ * codec profile does not match the reported capabilities of the hardware. -+ * -+ * For example, this can be used to try to decode baseline profile H.264 -+ * streams in hardware - it will often succeed, because many streams marked -+ * as baseline profile actually conform to constrained baseline profile. -+ * -+ * @warning If the stream is actually not supported then the behaviour is -+ * undefined, and may include returning entirely incorrect output -+ * while indicating success. -+ */ -+#define AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH (1 << 2) -+ -+/** -+ * @} -+ */ -+ -+enum AVSubtitleType { -+ SUBTITLE_NONE, -+ -+ SUBTITLE_BITMAP, ///< A bitmap, pict will be set -+ -+ /** -+ * Plain text, the text field must be set by the decoder and is -+ * authoritative. ass and pict fields may contain approximations. -+ */ -+ SUBTITLE_TEXT, -+ -+ /** -+ * Formatted text, the ass field must be set by the decoder and is -+ * authoritative. pict and text fields may contain approximations. -+ */ -+ SUBTITLE_ASS, -+}; -+ -+#define AV_SUBTITLE_FLAG_FORCED 0x00000001 -+ -+typedef struct AVSubtitleRect { -+ int x; ///< top left corner of pict, undefined when pict is not set -+ int y; ///< top left corner of pict, undefined when pict is not set -+ int w; ///< width of pict, undefined when pict is not set -+ int h; ///< height of pict, undefined when pict is not set -+ int nb_colors; ///< number of colors in pict, undefined when pict is not set -+ -+ /** -+ * data+linesize for the bitmap of this subtitle. -+ * Can be set for text/ass as well once they are rendered. -+ */ -+ uint8_t* data[4]; -+ int linesize[4]; -+ -+ enum AVSubtitleType type; -+ -+ char* text; ///< 0 terminated plain UTF-8 text -+ -+ /** -+ * 0 terminated ASS/SSA compatible event line. -+ * The presentation of this is unaffected by the other values in this -+ * struct. -+ */ -+ char* ass; -+ -+ int flags; -+} AVSubtitleRect; -+ -+typedef struct AVSubtitle { -+ uint16_t format; /* 0 = graphics */ -+ uint32_t start_display_time; /* relative to packet pts, in ms */ -+ uint32_t end_display_time; /* relative to packet pts, in ms */ -+ unsigned num_rects; -+ AVSubtitleRect** rects; -+ int64_t pts; ///< Same as packet pts, in AV_TIME_BASE -+} AVSubtitle; -+ -+/** -+ * Return the LIBAVCODEC_VERSION_INT constant. -+ */ -+unsigned avcodec_version(void); -+ -+/** -+ * Return the libavcodec build-time configuration. -+ */ -+const char* avcodec_configuration(void); -+ -+/** -+ * Return the libavcodec license. -+ */ -+const char* avcodec_license(void); -+ -+/** -+ * Allocate an AVCodecContext and set its fields to default values. The -+ * resulting struct should be freed with avcodec_free_context(). -+ * -+ * @param codec if non-NULL, allocate private data and initialize defaults -+ * for the given codec. It is illegal to then call avcodec_open2() -+ * with a different codec. -+ * If NULL, then the codec-specific defaults won't be initialized, -+ * which may result in suboptimal default settings (this is -+ * important mainly for encoders, e.g. libx264). -+ * -+ * @return An AVCodecContext filled with default values or NULL on failure. -+ */ -+AVCodecContext* avcodec_alloc_context3(const AVCodec* codec); -+ -+/** -+ * Free the codec context and everything associated with it and write NULL to -+ * the provided pointer. -+ */ -+void avcodec_free_context(AVCodecContext** avctx); -+ -+/** -+ * Get the AVClass for AVCodecContext. It can be used in combination with -+ * AV_OPT_SEARCH_FAKE_OBJ for examining options. -+ * -+ * @see av_opt_find(). -+ */ -+const AVClass* avcodec_get_class(void); -+ -+#if FF_API_GET_FRAME_CLASS -+/** -+ * @deprecated This function should not be used. -+ */ -+attribute_deprecated const AVClass* avcodec_get_frame_class(void); -+#endif -+ -+/** -+ * Get the AVClass for AVSubtitleRect. It can be used in combination with -+ * AV_OPT_SEARCH_FAKE_OBJ for examining options. -+ * -+ * @see av_opt_find(). -+ */ -+const AVClass* avcodec_get_subtitle_rect_class(void); -+ -+/** -+ * Fill the parameters struct based on the values from the supplied codec -+ * context. Any allocated fields in par are freed and replaced with duplicates -+ * of the corresponding fields in codec. -+ * -+ * @return >= 0 on success, a negative AVERROR code on failure -+ */ -+int avcodec_parameters_from_context(AVCodecParameters* par, -+ const AVCodecContext* codec); -+ -+/** -+ * Fill the codec context based on the values from the supplied codec -+ * parameters. Any allocated fields in codec that have a corresponding field in -+ * par are freed and replaced with duplicates of the corresponding field in par. -+ * Fields in codec that do not have a counterpart in par are not touched. -+ * -+ * @return >= 0 on success, a negative AVERROR code on failure. -+ */ -+int avcodec_parameters_to_context(AVCodecContext* codec, -+ const AVCodecParameters* par); -+ -+/** -+ * Initialize the AVCodecContext to use the given AVCodec. Prior to using this -+ * function the context has to be allocated with avcodec_alloc_context3(). -+ * -+ * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), -+ * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for -+ * retrieving a codec. -+ * -+ * @warning This function is not thread safe! -+ * -+ * @note Always call this function before using decoding routines (such as -+ * @ref avcodec_receive_frame()). -+ * -+ * @code -+ * av_dict_set(&opts, "b", "2.5M", 0); -+ * codec = avcodec_find_decoder(AV_CODEC_ID_H264); -+ * if (!codec) -+ * exit(1); -+ * -+ * context = avcodec_alloc_context3(codec); -+ * -+ * if (avcodec_open2(context, codec, opts) < 0) -+ * exit(1); -+ * @endcode -+ * -+ * @param avctx The context to initialize. -+ * @param codec The codec to open this context for. If a non-NULL codec has been -+ * previously passed to avcodec_alloc_context3() or -+ * for this context, then this parameter MUST be either NULL or -+ * equal to the previously passed codec. -+ * @param options A dictionary filled with AVCodecContext and codec-private -+ * options. On return this object will be filled with options that were not -+ * found. -+ * -+ * @return zero on success, a negative value on error -+ * @see avcodec_alloc_context3(), avcodec_find_decoder(), -+ * avcodec_find_encoder(), av_dict_set(), av_opt_find(). -+ */ -+int avcodec_open2(AVCodecContext* avctx, const AVCodec* codec, -+ AVDictionary** options); -+ -+/** -+ * Close a given AVCodecContext and free all the data associated with it -+ * (but not the AVCodecContext itself). -+ * -+ * Calling this function on an AVCodecContext that hasn't been opened will free -+ * the codec-specific data allocated in avcodec_alloc_context3() with a non-NULL -+ * codec. Subsequent calls will do nothing. -+ * -+ * @note Do not use this function. Use avcodec_free_context() to destroy a -+ * codec context (either open or closed). Opening and closing a codec context -+ * multiple times is not supported anymore -- use multiple codec contexts -+ * instead. -+ */ -+int avcodec_close(AVCodecContext* avctx); -+ -+/** -+ * Free all allocated data in the given subtitle struct. -+ * -+ * @param sub AVSubtitle to free. -+ */ -+void avsubtitle_free(AVSubtitle* sub); -+ -+/** -+ * @} -+ */ -+ -+/** -+ * @addtogroup lavc_decoding -+ * @{ -+ */ -+ -+/** -+ * The default callback for AVCodecContext.get_buffer2(). It is made public so -+ * it can be called by custom get_buffer2() implementations for decoders without -+ * AV_CODEC_CAP_DR1 set. -+ */ -+int avcodec_default_get_buffer2(AVCodecContext* s, AVFrame* frame, int flags); -+ -+/** -+ * The default callback for AVCodecContext.get_encode_buffer(). It is made -+ * public so it can be called by custom get_encode_buffer() implementations for -+ * encoders without AV_CODEC_CAP_DR1 set. -+ */ -+int avcodec_default_get_encode_buffer(AVCodecContext* s, AVPacket* pkt, -+ int flags); -+ -+/** -+ * Modify width and height values so that they will result in a memory -+ * buffer that is acceptable for the codec if you do not use any horizontal -+ * padding. -+ * -+ * May only be used if a codec with AV_CODEC_CAP_DR1 has been opened. -+ */ -+void avcodec_align_dimensions(AVCodecContext* s, int* width, int* height); -+ -+/** -+ * Modify width and height values so that they will result in a memory -+ * buffer that is acceptable for the codec if you also ensure that all -+ * line sizes are a multiple of the respective linesize_align[i]. -+ * -+ * May only be used if a codec with AV_CODEC_CAP_DR1 has been opened. -+ */ -+void avcodec_align_dimensions2(AVCodecContext* s, int* width, int* height, -+ int linesize_align[AV_NUM_DATA_POINTERS]); -+ -+/** -+ * Converts AVChromaLocation to swscale x/y chroma position. -+ * -+ * The positions represent the chroma (0,0) position in a coordinates system -+ * with luma (0,0) representing the origin and luma(1,1) representing 256,256 -+ * -+ * @param xpos horizontal chroma sample position -+ * @param ypos vertical chroma sample position -+ */ -+int avcodec_enum_to_chroma_pos(int* xpos, int* ypos, enum AVChromaLocation pos); -+ -+/** -+ * Converts swscale x/y chroma position to AVChromaLocation. -+ * -+ * The positions represent the chroma (0,0) position in a coordinates system -+ * with luma (0,0) representing the origin and luma(1,1) representing 256,256 -+ * -+ * @param xpos horizontal chroma sample position -+ * @param ypos vertical chroma sample position -+ */ -+enum AVChromaLocation avcodec_chroma_pos_to_enum(int xpos, int ypos); -+ -+/** -+ * Decode a subtitle message. -+ * Return a negative value on error, otherwise return the number of bytes used. -+ * If no subtitle could be decompressed, got_sub_ptr is zero. -+ * Otherwise, the subtitle is stored in *sub. -+ * Note that AV_CODEC_CAP_DR1 is not available for subtitle codecs. This is for -+ * simplicity, because the performance difference is expected to be negligible -+ * and reusing a get_buffer written for video codecs would probably perform -+ * badly due to a potentially very different allocation pattern. -+ * -+ * Some decoders (those marked with AV_CODEC_CAP_DELAY) have a delay between -+ * input and output. This means that for some packets they will not immediately -+ * produce decoded output and need to be flushed at the end of decoding to get -+ * all the decoded data. Flushing is done by calling this function with packets -+ * with avpkt->data set to NULL and avpkt->size set to 0 until it stops -+ * returning subtitles. It is safe to flush even those decoders that are not -+ * marked with AV_CODEC_CAP_DELAY, then no subtitles will be returned. -+ * -+ * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() -+ * before packets may be fed to the decoder. -+ * -+ * @param avctx the codec context -+ * @param[out] sub The preallocated AVSubtitle in which the decoded subtitle -+ * will be stored, must be freed with avsubtitle_free if *got_sub_ptr is set. -+ * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, -+ * otherwise, it is nonzero. -+ * @param[in] avpkt The input AVPacket containing the input buffer. -+ */ -+int avcodec_decode_subtitle2(AVCodecContext* avctx, AVSubtitle* sub, -+ int* got_sub_ptr, AVPacket* avpkt); -+ -+/** -+ * Supply raw packet data as input to a decoder. -+ * -+ * Internally, this call will copy relevant AVCodecContext fields, which can -+ * influence decoding per-packet, and apply them when the packet is actually -+ * decoded. (For example AVCodecContext.skip_frame, which might direct the -+ * decoder to drop the frame contained by the packet sent with this function.) -+ * -+ * @warning The input buffer, avpkt->data must be AV_INPUT_BUFFER_PADDING_SIZE -+ * larger than the actual read bytes because some optimized bitstream -+ * readers read 32 or 64 bits at once and could read over the end. -+ * -+ * @note The AVCodecContext MUST have been opened with @ref avcodec_open2() -+ * before packets may be fed to the decoder. -+ * -+ * @param avctx codec context -+ * @param[in] avpkt The input AVPacket. Usually, this will be a single video -+ * frame, or several complete audio frames. -+ * Ownership of the packet remains with the caller, and the -+ * decoder will not write to the packet. The decoder may create -+ * a reference to the packet data (or copy it if the packet is -+ * not reference-counted). -+ * Unlike with older APIs, the packet is always fully consumed, -+ * and if it contains multiple frames (e.g. some audio codecs), -+ * will require you to call avcodec_receive_frame() multiple -+ * times afterwards before you can send a new packet. -+ * It can be NULL (or an AVPacket with data set to NULL and -+ * size set to 0); in this case, it is considered a flush -+ * packet, which signals the end of the stream. Sending the -+ * first flush packet will return success. Subsequent ones are -+ * unnecessary and will return AVERROR_EOF. If the decoder -+ * still has frames buffered, it will return them after sending -+ * a flush packet. -+ * -+ * @return 0 on success, otherwise negative error code: -+ * AVERROR(EAGAIN): input is not accepted in the current state - user -+ * must read output with avcodec_receive_frame() (once -+ * all output is read, the packet should be resent, and -+ * the call will not fail with EAGAIN). -+ * AVERROR_EOF: the decoder has been flushed, and no new packets can -+ * be sent to it (also returned if more than 1 flush -+ * packet is sent) -+ * AVERROR(EINVAL): codec not opened, it is an encoder, or requires flush -+ * AVERROR(ENOMEM): failed to add packet to internal queue, or similar -+ * other errors: legitimate decoding errors -+ */ -+int avcodec_send_packet(AVCodecContext* avctx, const AVPacket* avpkt); -+ -+/** -+ * Return decoded output data from a decoder. -+ * -+ * @param avctx codec context -+ * @param frame This will be set to a reference-counted video or audio -+ * frame (depending on the decoder type) allocated by the -+ * decoder. Note that the function will always call -+ * av_frame_unref(frame) before doing anything else. -+ * -+ * @return -+ * 0: success, a frame was returned -+ * AVERROR(EAGAIN): output is not available in this state - user must try -+ * to send new input -+ * AVERROR_EOF: the decoder has been fully flushed, and there will be -+ * no more output frames -+ * AVERROR(EINVAL): codec not opened, or it is an encoder -+ * AVERROR_INPUT_CHANGED: current decoded frame has changed parameters -+ * with respect to first decoded frame. Applicable -+ * when flag AV_CODEC_FLAG_DROPCHANGED is set. -+ * other negative values: legitimate decoding errors -+ */ -+int avcodec_receive_frame(AVCodecContext* avctx, AVFrame* frame); -+ -+/** -+ * Supply a raw video or audio frame to the encoder. Use -+ * avcodec_receive_packet() to retrieve buffered output packets. -+ * -+ * @param avctx codec context -+ * @param[in] frame AVFrame containing the raw audio or video frame to be -+ * encoded. Ownership of the frame remains with the caller, and the encoder will -+ * not write to the frame. The encoder may create a reference to the frame data -+ * (or copy it if the frame is not reference-counted). It can be NULL, in which -+ * case it is considered a flush packet. This signals the end of the stream. If -+ * the encoder still has packets buffered, it will return them after this call. -+ * Once flushing mode has been entered, additional flush packets are ignored, -+ * and sending frames will return AVERROR_EOF. -+ * -+ * For audio: -+ * If AV_CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame -+ * can have any number of samples. -+ * If it is not set, frame->nb_samples must be equal to -+ * avctx->frame_size for all frames except the last. -+ * The final frame may be smaller than avctx->frame_size. -+ * @return 0 on success, otherwise negative error code: -+ * AVERROR(EAGAIN): input is not accepted in the current state - user -+ * must read output with avcodec_receive_packet() (once -+ * all output is read, the packet should be resent, and -+ * the call will not fail with EAGAIN). -+ * AVERROR_EOF: the encoder has been flushed, and no new frames can -+ * be sent to it -+ * AVERROR(EINVAL): codec not opened, it is a decoder, or requires flush -+ * AVERROR(ENOMEM): failed to add packet to internal queue, or similar -+ * other errors: legitimate encoding errors -+ */ -+int avcodec_send_frame(AVCodecContext* avctx, const AVFrame* frame); -+ -+/** -+ * Read encoded data from the encoder. -+ * -+ * @param avctx codec context -+ * @param avpkt This will be set to a reference-counted packet allocated by the -+ * encoder. Note that the function will always call -+ * av_packet_unref(avpkt) before doing anything else. -+ * @return 0 on success, otherwise negative error code: -+ * AVERROR(EAGAIN): output is not available in the current state - user -+ * must try to send input -+ * AVERROR_EOF: the encoder has been fully flushed, and there will be -+ * no more output packets -+ * AVERROR(EINVAL): codec not opened, or it is a decoder -+ * other errors: legitimate encoding errors -+ */ -+int avcodec_receive_packet(AVCodecContext* avctx, AVPacket* avpkt); -+ -+/** -+ * Create and return a AVHWFramesContext with values adequate for hardware -+ * decoding. This is meant to get called from the get_format callback, and is -+ * a helper for preparing a AVHWFramesContext for AVCodecContext.hw_frames_ctx. -+ * This API is for decoding with certain hardware acceleration modes/APIs only. -+ * -+ * The returned AVHWFramesContext is not initialized. The caller must do this -+ * with av_hwframe_ctx_init(). -+ * -+ * Calling this function is not a requirement, but makes it simpler to avoid -+ * codec or hardware API specific details when manually allocating frames. -+ * -+ * Alternatively to this, an API user can set AVCodecContext.hw_device_ctx, -+ * which sets up AVCodecContext.hw_frames_ctx fully automatically, and makes -+ * it unnecessary to call this function or having to care about -+ * AVHWFramesContext initialization at all. -+ * -+ * There are a number of requirements for calling this function: -+ * -+ * - It must be called from get_format with the same avctx parameter that was -+ * passed to get_format. Calling it outside of get_format is not allowed, and -+ * can trigger undefined behavior. -+ * - The function is not always supported (see description of return values). -+ * Even if this function returns successfully, hwaccel initialization could -+ * fail later. (The degree to which implementations check whether the stream -+ * is actually supported varies. Some do this check only after the user's -+ * get_format callback returns.) -+ * - The hw_pix_fmt must be one of the choices suggested by get_format. If the -+ * user decides to use a AVHWFramesContext prepared with this API function, -+ * the user must return the same hw_pix_fmt from get_format. -+ * - The device_ref passed to this function must support the given hw_pix_fmt. -+ * - After calling this API function, it is the user's responsibility to -+ * initialize the AVHWFramesContext (returned by the out_frames_ref -+ * parameter), and to set AVCodecContext.hw_frames_ctx to it. If done, this must -+ * be done before returning from get_format (this is implied by the normal -+ * AVCodecContext.hw_frames_ctx API rules). -+ * - The AVHWFramesContext parameters may change every time time get_format is -+ * called. Also, AVCodecContext.hw_frames_ctx is reset before get_format. So -+ * you are inherently required to go through this process again on every -+ * get_format call. -+ * - It is perfectly possible to call this function without actually using -+ * the resulting AVHWFramesContext. One use-case might be trying to reuse a -+ * previously initialized AVHWFramesContext, and calling this API function -+ * only to test whether the required frame parameters have changed. -+ * - Fields that use dynamically allocated values of any kind must not be set -+ * by the user unless setting them is explicitly allowed by the documentation. -+ * If the user sets AVHWFramesContext.free and AVHWFramesContext.user_opaque, -+ * the new free callback must call the potentially set previous free callback. -+ * This API call may set any dynamically allocated fields, including the free -+ * callback. -+ * -+ * The function will set at least the following fields on AVHWFramesContext -+ * (potentially more, depending on hwaccel API): -+ * -+ * - All fields set by av_hwframe_ctx_alloc(). -+ * - Set the format field to hw_pix_fmt. -+ * - Set the sw_format field to the most suited and most versatile format. (An -+ * implication is that this will prefer generic formats over opaque formats -+ * with arbitrary restrictions, if possible.) -+ * - Set the width/height fields to the coded frame size, rounded up to the -+ * API-specific minimum alignment. -+ * - Only _if_ the hwaccel requires a pre-allocated pool: set the -+ * initial_pool_size field to the number of maximum reference surfaces possible -+ * with the codec, plus 1 surface for the user to work (meaning the user can -+ * safely reference at most 1 decoded surface at a time), plus additional -+ * buffering introduced by frame threading. If the hwaccel does not require -+ * pre-allocation, the field is left to 0, and the decoder will allocate new -+ * surfaces on demand during decoding. -+ * - Possibly AVHWFramesContext.hwctx fields, depending on the underlying -+ * hardware API. -+ * -+ * Essentially, out_frames_ref returns the same as av_hwframe_ctx_alloc(), but -+ * with basic frame parameters set. -+ * -+ * The function is stateless, and does not change the AVCodecContext or the -+ * device_ref AVHWDeviceContext. -+ * -+ * @param avctx The context which is currently calling get_format, and which -+ * implicitly contains all state needed for filling the returned -+ * AVHWFramesContext properly. -+ * @param device_ref A reference to the AVHWDeviceContext describing the device -+ * which will be used by the hardware decoder. -+ * @param hw_pix_fmt The hwaccel format you are going to return from get_format. -+ * @param out_frames_ref On success, set to a reference to an _uninitialized_ -+ * AVHWFramesContext, created from the given device_ref. -+ * Fields will be set to values required for decoding. -+ * Not changed if an error is returned. -+ * @return zero on success, a negative value on error. The following error codes -+ * have special semantics: -+ * AVERROR(ENOENT): the decoder does not support this functionality. Setup -+ * is always manual, or it is a decoder which does not -+ * support setting AVCodecContext.hw_frames_ctx at all, -+ * or it is a software format. -+ * AVERROR(EINVAL): it is known that hardware decoding is not supported for -+ * this configuration, or the device_ref is not supported -+ * for the hwaccel referenced by hw_pix_fmt. -+ */ -+int avcodec_get_hw_frames_parameters(AVCodecContext* avctx, -+ AVBufferRef* device_ref, -+ enum AVPixelFormat hw_pix_fmt, -+ AVBufferRef** out_frames_ref); -+ -+/** -+ * @defgroup lavc_parsing Frame parsing -+ * @{ -+ */ -+ -+enum AVPictureStructure { -+ AV_PICTURE_STRUCTURE_UNKNOWN, //< unknown -+ AV_PICTURE_STRUCTURE_TOP_FIELD, //< coded as top field -+ AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field -+ AV_PICTURE_STRUCTURE_FRAME, //< coded as frame -+}; -+ -+typedef struct AVCodecParserContext { -+ void* priv_data; -+ const struct AVCodecParser* parser; -+ int64_t frame_offset; /* offset of the current frame */ -+ int64_t cur_offset; /* current offset -+ (incremented by each av_parser_parse()) */ -+ int64_t next_frame_offset; /* offset of the next frame */ -+ /* video info */ -+ int pict_type; /* XXX: Put it back in AVCodecContext. */ -+ /** -+ * This field is used for proper frame duration computation in lavf. -+ * It signals, how much longer the frame duration of the current frame -+ * is compared to normal frame duration. -+ * -+ * frame_duration = (1 + repeat_pict) * time_base -+ * -+ * It is used by codecs like H.264 to display telecined material. -+ */ -+ int repeat_pict; /* XXX: Put it back in AVCodecContext. */ -+ int64_t pts; /* pts of the current frame */ -+ int64_t dts; /* dts of the current frame */ -+ -+ /* private data */ -+ int64_t last_pts; -+ int64_t last_dts; -+ int fetch_timestamp; -+ -+#define AV_PARSER_PTS_NB 4 -+ int cur_frame_start_index; -+ int64_t cur_frame_offset[AV_PARSER_PTS_NB]; -+ int64_t cur_frame_pts[AV_PARSER_PTS_NB]; -+ int64_t cur_frame_dts[AV_PARSER_PTS_NB]; -+ -+ int flags; -+#define PARSER_FLAG_COMPLETE_FRAMES 0x0001 -+#define PARSER_FLAG_ONCE 0x0002 -+/// Set if the parser has a valid file offset -+#define PARSER_FLAG_FETCHED_OFFSET 0x0004 -+#define PARSER_FLAG_USE_CODEC_TS 0x1000 -+ -+ int64_t offset; ///< byte offset from starting packet start -+ int64_t cur_frame_end[AV_PARSER_PTS_NB]; -+ -+ /** -+ * Set by parser to 1 for key frames and 0 for non-key frames. -+ * It is initialized to -1, so if the parser doesn't set this flag, -+ * old-style fallback using AV_PICTURE_TYPE_I picture type as key frames -+ * will be used. -+ */ -+ int key_frame; -+ -+ // Timestamp generation support: -+ /** -+ * Synchronization point for start of timestamp generation. -+ * -+ * Set to >0 for sync point, 0 for no sync point and <0 for undefined -+ * (default). -+ * -+ * For example, this corresponds to presence of H.264 buffering period -+ * SEI message. -+ */ -+ int dts_sync_point; -+ -+ /** -+ * Offset of the current timestamp against last timestamp sync point in -+ * units of AVCodecContext.time_base. -+ * -+ * Set to INT_MIN when dts_sync_point unused. Otherwise, it must -+ * contain a valid timestamp offset. -+ * -+ * Note that the timestamp of sync point has usually a nonzero -+ * dts_ref_dts_delta, which refers to the previous sync point. Offset of -+ * the next frame after timestamp sync point will be usually 1. -+ * -+ * For example, this corresponds to H.264 cpb_removal_delay. -+ */ -+ int dts_ref_dts_delta; -+ -+ /** -+ * Presentation delay of current frame in units of AVCodecContext.time_base. -+ * -+ * Set to INT_MIN when dts_sync_point unused. Otherwise, it must -+ * contain valid non-negative timestamp delta (presentation time of a frame -+ * must not lie in the past). -+ * -+ * This delay represents the difference between decoding and presentation -+ * time of the frame. -+ * -+ * For example, this corresponds to H.264 dpb_output_delay. -+ */ -+ int pts_dts_delta; -+ -+ /** -+ * Position of the packet in file. -+ * -+ * Analogous to cur_frame_pts/dts -+ */ -+ int64_t cur_frame_pos[AV_PARSER_PTS_NB]; -+ -+ /** -+ * Byte position of currently parsed frame in stream. -+ */ -+ int64_t pos; -+ -+ /** -+ * Previous frame byte position. -+ */ -+ int64_t last_pos; -+ -+ /** -+ * Duration of the current frame. -+ * For audio, this is in units of 1 / AVCodecContext.sample_rate. -+ * For all other types, this is in units of AVCodecContext.time_base. -+ */ -+ int duration; -+ -+ enum AVFieldOrder field_order; -+ -+ /** -+ * Indicate whether a picture is coded as a frame, top field or bottom field. -+ * -+ * For example, H.264 field_pic_flag equal to 0 corresponds to -+ * AV_PICTURE_STRUCTURE_FRAME. An H.264 picture with field_pic_flag -+ * equal to 1 and bottom_field_flag equal to 0 corresponds to -+ * AV_PICTURE_STRUCTURE_TOP_FIELD. -+ */ -+ enum AVPictureStructure picture_structure; -+ -+ /** -+ * Picture number incremented in presentation or output order. -+ * This field may be reinitialized at the first picture of a new sequence. -+ * -+ * For example, this corresponds to H.264 PicOrderCnt. -+ */ -+ int output_picture_number; -+ -+ /** -+ * Dimensions of the decoded video intended for presentation. -+ */ -+ int width; -+ int height; -+ -+ /** -+ * Dimensions of the coded video. -+ */ -+ int coded_width; -+ int coded_height; -+ -+ /** -+ * The format of the coded data, corresponds to enum AVPixelFormat for video -+ * and for enum AVSampleFormat for audio. -+ * -+ * Note that a decoder can have considerable freedom in how exactly it -+ * decodes the data, so the format reported here might be different from the -+ * one returned by a decoder. -+ */ -+ int format; -+} AVCodecParserContext; -+ -+typedef struct AVCodecParser { -+ int codec_ids[7]; /* several codec IDs are permitted */ -+ int priv_data_size; -+ int (*parser_init)(AVCodecParserContext* s); -+ /* This callback never returns an error, a negative value means that -+ * the frame start was in a previous packet. */ -+ int (*parser_parse)(AVCodecParserContext* s, AVCodecContext* avctx, -+ const uint8_t** poutbuf, int* poutbuf_size, -+ const uint8_t* buf, int buf_size); -+ void (*parser_close)(AVCodecParserContext* s); -+ int (*split)(AVCodecContext* avctx, const uint8_t* buf, int buf_size); -+} AVCodecParser; -+ -+/** -+ * Iterate over all registered codec parsers. -+ * -+ * @param opaque a pointer where libavcodec will store the iteration state. Must -+ * point to NULL to start the iteration. -+ * -+ * @return the next registered codec parser or NULL when the iteration is -+ * finished -+ */ -+const AVCodecParser* av_parser_iterate(void** opaque); -+ -+AVCodecParserContext* av_parser_init(int codec_id); -+ -+/** -+ * Parse a packet. -+ * -+ * @param s parser context. -+ * @param avctx codec context. -+ * @param poutbuf set to pointer to parsed buffer or NULL if not yet -+ finished. -+ * @param poutbuf_size set to size of parsed buffer or zero if not yet -+ finished. -+ * @param buf input buffer. -+ * @param buf_size buffer size in bytes without the padding. I.e. the full -+ buffer size is assumed to be buf_size + AV_INPUT_BUFFER_PADDING_SIZE. To signal -+ EOF, this should be 0 (so that the last frame can be output). -+ * @param pts input presentation timestamp. -+ * @param dts input decoding timestamp. -+ * @param pos input byte position in stream. -+ * @return the number of bytes of the input bitstream used. -+ * -+ * Example: -+ * @code -+ * while(in_len){ -+ * len = av_parser_parse2(myparser, AVCodecContext, &data, &size, -+ * in_data, in_len, -+ * pts, dts, pos); -+ * in_data += len; -+ * in_len -= len; -+ * -+ * if(size) -+ * decode_frame(data, size); -+ * } -+ * @endcode -+ */ -+int av_parser_parse2(AVCodecParserContext* s, AVCodecContext* avctx, -+ uint8_t** poutbuf, int* poutbuf_size, const uint8_t* buf, -+ int buf_size, int64_t pts, int64_t dts, int64_t pos); -+ -+void av_parser_close(AVCodecParserContext* s); -+ -+/** -+ * @} -+ * @} -+ */ -+ -+/** -+ * @addtogroup lavc_encoding -+ * @{ -+ */ -+ -+int avcodec_encode_subtitle(AVCodecContext* avctx, uint8_t* buf, int buf_size, -+ const AVSubtitle* sub); -+ -+/** -+ * @} -+ */ -+ -+/** -+ * @defgroup lavc_misc Utility functions -+ * @ingroup libavc -+ * -+ * Miscellaneous utility functions related to both encoding and decoding -+ * (or neither). -+ * @{ -+ */ -+ -+/** -+ * @defgroup lavc_misc_pixfmt Pixel formats -+ * -+ * Functions for working with pixel formats. -+ * @{ -+ */ -+ -+/** -+ * Return a value representing the fourCC code associated to the -+ * pixel format pix_fmt, or 0 if no associated fourCC code can be -+ * found. -+ */ -+unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat pix_fmt); -+ -+/** -+ * Find the best pixel format to convert to given a certain source pixel -+ * format. When converting from one pixel format to another, information loss -+ * may occur. For example, when converting from RGB24 to GRAY, the color -+ * information will be lost. Similarly, other losses occur when converting from -+ * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches -+ * which of the given pixel formats should be used to suffer the least amount of -+ * loss. The pixel formats from which it chooses one, are determined by the -+ * pix_fmt_list parameter. -+ * -+ * -+ * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to -+ * choose from -+ * @param[in] src_pix_fmt source pixel format -+ * @param[in] has_alpha Whether the source pixel format alpha channel is used. -+ * @param[out] loss_ptr Combination of flags informing you what kind of losses -+ * will occur. -+ * @return The best pixel format to convert to or -1 if none was found. -+ */ -+enum AVPixelFormat avcodec_find_best_pix_fmt_of_list( -+ const enum AVPixelFormat* pix_fmt_list, enum AVPixelFormat src_pix_fmt, -+ int has_alpha, int* loss_ptr); -+ -+enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext* s, -+ const enum AVPixelFormat* fmt); -+ -+/** -+ * @} -+ */ -+ -+void avcodec_string(char* buf, int buf_size, AVCodecContext* enc, int encode); -+ -+int avcodec_default_execute(AVCodecContext* c, -+ int (*func)(AVCodecContext* c2, void* arg2), -+ void* arg, int* ret, int count, int size); -+int avcodec_default_execute2(AVCodecContext* c, -+ int (*func)(AVCodecContext* c2, void* arg2, int, -+ int), -+ void* arg, int* ret, int count); -+// FIXME func typedef -+ -+/** -+ * Fill AVFrame audio data and linesize pointers. -+ * -+ * The buffer buf must be a preallocated buffer with a size big enough -+ * to contain the specified samples amount. The filled AVFrame data -+ * pointers will point to this buffer. -+ * -+ * AVFrame extended_data channel pointers are allocated if necessary for -+ * planar audio. -+ * -+ * @param frame the AVFrame -+ * frame->nb_samples must be set prior to calling the -+ * function. This function fills in frame->data, -+ * frame->extended_data, frame->linesize[0]. -+ * @param nb_channels channel count -+ * @param sample_fmt sample format -+ * @param buf buffer to use for frame data -+ * @param buf_size size of buffer -+ * @param align plane size sample alignment (0 = default) -+ * @return >=0 on success, negative error code on failure -+ * @todo return the size in bytes required to store the samples in -+ * case of success, at the next libavutil bump -+ */ -+int avcodec_fill_audio_frame(AVFrame* frame, int nb_channels, -+ enum AVSampleFormat sample_fmt, const uint8_t* buf, -+ int buf_size, int align); -+ -+/** -+ * Reset the internal codec state / flush internal buffers. Should be called -+ * e.g. when seeking or when switching to a different stream. -+ * -+ * @note for decoders, this function just releases any references the decoder -+ * might keep internally, but the caller's references remain valid. -+ * -+ * @note for encoders, this function will only do something if the encoder -+ * declares support for AV_CODEC_CAP_ENCODER_FLUSH. When called, the encoder -+ * will drain any remaining packets, and can then be re-used for a different -+ * stream (as opposed to sending a null frame which will leave the encoder -+ * in a permanent EOF state after draining). This can be desirable if the -+ * cost of tearing down and replacing the encoder instance is high. -+ */ -+void avcodec_flush_buffers(AVCodecContext* avctx); -+ -+/** -+ * Return audio frame duration. -+ * -+ * @param avctx codec context -+ * @param frame_bytes size of the frame, or 0 if unknown -+ * @return frame duration, in samples, if known. 0 if not able to -+ * determine. -+ */ -+int av_get_audio_frame_duration(AVCodecContext* avctx, int frame_bytes); -+ -+/* memory */ -+ -+/** -+ * Same behaviour av_fast_malloc but the buffer has additional -+ * AV_INPUT_BUFFER_PADDING_SIZE at the end which will always be 0. -+ * -+ * In addition the whole buffer will initially and after resizes -+ * be 0-initialized so that no uninitialized data will ever appear. -+ */ -+void av_fast_padded_malloc(void* ptr, unsigned int* size, size_t min_size); -+ -+/** -+ * Same behaviour av_fast_padded_malloc except that buffer will always -+ * be 0-initialized after call. -+ */ -+void av_fast_padded_mallocz(void* ptr, unsigned int* size, size_t min_size); -+ -+/** -+ * @return a positive value if s is open (i.e. avcodec_open2() was called on it -+ * with no corresponding avcodec_close()), 0 otherwise. -+ */ -+int avcodec_is_open(AVCodecContext* s); -+ -+/** -+ * @} -+ */ -+ -+#endif /* AVCODEC_AVCODEC_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/avfft.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/avfft.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/avfft.h -@@ -0,0 +1,119 @@ -+/* -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef AVCODEC_AVFFT_H -+#define AVCODEC_AVFFT_H -+ -+/** -+ * @file -+ * @ingroup lavc_fft -+ * FFT functions -+ */ -+ -+/** -+ * @defgroup lavc_fft FFT functions -+ * @ingroup lavc_misc -+ * -+ * @{ -+ */ -+ -+typedef float FFTSample; -+ -+typedef struct FFTComplex { -+ FFTSample re, im; -+} FFTComplex; -+ -+typedef struct FFTContext FFTContext; -+ -+/** -+ * Set up a complex FFT. -+ * @param nbits log2 of the length of the input array -+ * @param inverse if 0 perform the forward transform, if 1 perform the -+ * inverse -+ */ -+FFTContext* av_fft_init(int nbits, int inverse); -+ -+/** -+ * Do the permutation needed BEFORE calling ff_fft_calc(). -+ */ -+void av_fft_permute(FFTContext* s, FFTComplex* z); -+ -+/** -+ * Do a complex FFT with the parameters defined in av_fft_init(). The -+ * input data must be permuted before. No 1.0/sqrt(n) normalization is done. -+ */ -+void av_fft_calc(FFTContext* s, FFTComplex* z); -+ -+void av_fft_end(FFTContext* s); -+ -+FFTContext* av_mdct_init(int nbits, int inverse, double scale); -+void av_imdct_calc(FFTContext* s, FFTSample* output, const FFTSample* input); -+void av_imdct_half(FFTContext* s, FFTSample* output, const FFTSample* input); -+void av_mdct_calc(FFTContext* s, FFTSample* output, const FFTSample* input); -+void av_mdct_end(FFTContext* s); -+ -+/* Real Discrete Fourier Transform */ -+ -+enum RDFTransformType { -+ DFT_R2C, -+ IDFT_C2R, -+ IDFT_R2C, -+ DFT_C2R, -+}; -+ -+typedef struct RDFTContext RDFTContext; -+ -+/** -+ * Set up a real FFT. -+ * @param nbits log2 of the length of the input array -+ * @param trans the type of transform -+ */ -+RDFTContext* av_rdft_init(int nbits, enum RDFTransformType trans); -+void av_rdft_calc(RDFTContext* s, FFTSample* data); -+void av_rdft_end(RDFTContext* s); -+ -+/* Discrete Cosine Transform */ -+ -+typedef struct DCTContext DCTContext; -+ -+enum DCTTransformType { -+ DCT_II = 0, -+ DCT_III, -+ DCT_I, -+ DST_I, -+}; -+ -+/** -+ * Set up DCT. -+ * -+ * @param nbits size of the input array: -+ * (1 << nbits) for DCT-II, DCT-III and DST-I -+ * (1 << nbits) + 1 for DCT-I -+ * @param type the type of transform -+ * -+ * @note the first element of the input of DST-I is ignored -+ */ -+DCTContext* av_dct_init(int nbits, enum DCTTransformType type); -+void av_dct_calc(DCTContext* s, FFTSample* data); -+void av_dct_end(DCTContext* s); -+ -+/** -+ * @} -+ */ -+ -+#endif /* AVCODEC_AVFFT_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/bsf.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/bsf.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/bsf.h -@@ -0,0 +1,320 @@ -+/* -+ * Bitstream filters public API -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef AVCODEC_BSF_H -+#define AVCODEC_BSF_H -+ -+#include "libavutil/dict.h" -+#include "libavutil/log.h" -+#include "libavutil/rational.h" -+ -+#include "codec_id.h" -+#include "codec_par.h" -+#include "packet.h" -+ -+/** -+ * @addtogroup lavc_core -+ * @{ -+ */ -+ -+/** -+ * The bitstream filter state. -+ * -+ * This struct must be allocated with av_bsf_alloc() and freed with -+ * av_bsf_free(). -+ * -+ * The fields in the struct will only be changed (by the caller or by the -+ * filter) as described in their documentation, and are to be considered -+ * immutable otherwise. -+ */ -+typedef struct AVBSFContext { -+ /** -+ * A class for logging and AVOptions -+ */ -+ const AVClass* av_class; -+ -+ /** -+ * The bitstream filter this context is an instance of. -+ */ -+ const struct AVBitStreamFilter* filter; -+ -+ /** -+ * Opaque filter-specific private data. If filter->priv_class is non-NULL, -+ * this is an AVOptions-enabled struct. -+ */ -+ void* priv_data; -+ -+ /** -+ * Parameters of the input stream. This field is allocated in -+ * av_bsf_alloc(), it needs to be filled by the caller before -+ * av_bsf_init(). -+ */ -+ AVCodecParameters* par_in; -+ -+ /** -+ * Parameters of the output stream. This field is allocated in -+ * av_bsf_alloc(), it is set by the filter in av_bsf_init(). -+ */ -+ AVCodecParameters* par_out; -+ -+ /** -+ * The timebase used for the timestamps of the input packets. Set by the -+ * caller before av_bsf_init(). -+ */ -+ AVRational time_base_in; -+ -+ /** -+ * The timebase used for the timestamps of the output packets. Set by the -+ * filter in av_bsf_init(). -+ */ -+ AVRational time_base_out; -+} AVBSFContext; -+ -+typedef struct AVBitStreamFilter { -+ const char* name; -+ -+ /** -+ * A list of codec ids supported by the filter, terminated by -+ * AV_CODEC_ID_NONE. -+ * May be NULL, in that case the bitstream filter works with any codec id. -+ */ -+ const enum AVCodecID* codec_ids; -+ -+ /** -+ * A class for the private data, used to declare bitstream filter private -+ * AVOptions. This field is NULL for bitstream filters that do not declare -+ * any options. -+ * -+ * If this field is non-NULL, the first member of the filter private data -+ * must be a pointer to AVClass, which will be set by libavcodec generic -+ * code to this class. -+ */ -+ const AVClass* priv_class; -+ -+ /***************************************************************** -+ * No fields below this line are part of the public API. They -+ * may not be used outside of libavcodec and can be changed and -+ * removed at will. -+ * New public fields should be added right above. -+ ***************************************************************** -+ */ -+ -+ int priv_data_size; -+ int (*init)(AVBSFContext* ctx); -+ int (*filter)(AVBSFContext* ctx, AVPacket* pkt); -+ void (*close)(AVBSFContext* ctx); -+ void (*flush)(AVBSFContext* ctx); -+} AVBitStreamFilter; -+ -+/** -+ * @return a bitstream filter with the specified name or NULL if no such -+ * bitstream filter exists. -+ */ -+const AVBitStreamFilter* av_bsf_get_by_name(const char* name); -+ -+/** -+ * Iterate over all registered bitstream filters. -+ * -+ * @param opaque a pointer where libavcodec will store the iteration state. Must -+ * point to NULL to start the iteration. -+ * -+ * @return the next registered bitstream filter or NULL when the iteration is -+ * finished -+ */ -+const AVBitStreamFilter* av_bsf_iterate(void** opaque); -+ -+/** -+ * Allocate a context for a given bitstream filter. The caller must fill in the -+ * context parameters as described in the documentation and then call -+ * av_bsf_init() before sending any data to the filter. -+ * -+ * @param filter the filter for which to allocate an instance. -+ * @param ctx a pointer into which the pointer to the newly-allocated context -+ * will be written. It must be freed with av_bsf_free() after the -+ * filtering is done. -+ * -+ * @return 0 on success, a negative AVERROR code on failure -+ */ -+int av_bsf_alloc(const AVBitStreamFilter* filter, AVBSFContext** ctx); -+ -+/** -+ * Prepare the filter for use, after all the parameters and options have been -+ * set. -+ */ -+int av_bsf_init(AVBSFContext* ctx); -+ -+/** -+ * Submit a packet for filtering. -+ * -+ * After sending each packet, the filter must be completely drained by calling -+ * av_bsf_receive_packet() repeatedly until it returns AVERROR(EAGAIN) or -+ * AVERROR_EOF. -+ * -+ * @param pkt the packet to filter. The bitstream filter will take ownership of -+ * the packet and reset the contents of pkt. pkt is not touched if an error -+ * occurs. If pkt is empty (i.e. NULL, or pkt->data is NULL and -+ * pkt->side_data_elems zero), it signals the end of the stream (i.e. no more -+ * non-empty packets will be sent; sending more empty packets does nothing) and -+ * will cause the filter to output any packets it may have buffered internally. -+ * -+ * @return 0 on success. AVERROR(EAGAIN) if packets need to be retrieved from -+ * the filter (using av_bsf_receive_packet()) before new input can be consumed. -+ * Another negative AVERROR value if an error occurs. -+ */ -+int av_bsf_send_packet(AVBSFContext* ctx, AVPacket* pkt); -+ -+/** -+ * Retrieve a filtered packet. -+ * -+ * @param[out] pkt this struct will be filled with the contents of the filtered -+ * packet. It is owned by the caller and must be freed using -+ * av_packet_unref() when it is no longer needed. -+ * This parameter should be "clean" (i.e. freshly allocated -+ * with av_packet_alloc() or unreffed with av_packet_unref()) -+ * when this function is called. If this function returns -+ * successfully, the contents of pkt will be completely -+ * overwritten by the returned data. On failure, pkt is not -+ * touched. -+ * -+ * @return 0 on success. AVERROR(EAGAIN) if more packets need to be sent to the -+ * filter (using av_bsf_send_packet()) to get more output. AVERROR_EOF if there -+ * will be no further output from the filter. Another negative AVERROR value if -+ * an error occurs. -+ * -+ * @note one input packet may result in several output packets, so after sending -+ * a packet with av_bsf_send_packet(), this function needs to be called -+ * repeatedly until it stops returning 0. It is also possible for a filter to -+ * output fewer packets than were sent to it, so this function may return -+ * AVERROR(EAGAIN) immediately after a successful av_bsf_send_packet() call. -+ */ -+int av_bsf_receive_packet(AVBSFContext* ctx, AVPacket* pkt); -+ -+/** -+ * Reset the internal bitstream filter state. Should be called e.g. when -+ * seeking. -+ */ -+void av_bsf_flush(AVBSFContext* ctx); -+ -+/** -+ * Free a bitstream filter context and everything associated with it; write NULL -+ * into the supplied pointer. -+ */ -+void av_bsf_free(AVBSFContext** ctx); -+ -+/** -+ * Get the AVClass for AVBSFContext. It can be used in combination with -+ * AV_OPT_SEARCH_FAKE_OBJ for examining options. -+ * -+ * @see av_opt_find(). -+ */ -+const AVClass* av_bsf_get_class(void); -+ -+/** -+ * Structure for chain/list of bitstream filters. -+ * Empty list can be allocated by av_bsf_list_alloc(). -+ */ -+typedef struct AVBSFList AVBSFList; -+ -+/** -+ * Allocate empty list of bitstream filters. -+ * The list must be later freed by av_bsf_list_free() -+ * or finalized by av_bsf_list_finalize(). -+ * -+ * @return Pointer to @ref AVBSFList on success, NULL in case of failure -+ */ -+AVBSFList* av_bsf_list_alloc(void); -+ -+/** -+ * Free list of bitstream filters. -+ * -+ * @param lst Pointer to pointer returned by av_bsf_list_alloc() -+ */ -+void av_bsf_list_free(AVBSFList** lst); -+ -+/** -+ * Append bitstream filter to the list of bitstream filters. -+ * -+ * @param lst List to append to -+ * @param bsf Filter context to be appended -+ * -+ * @return >=0 on success, negative AVERROR in case of failure -+ */ -+int av_bsf_list_append(AVBSFList* lst, AVBSFContext* bsf); -+ -+/** -+ * Construct new bitstream filter context given it's name and options -+ * and append it to the list of bitstream filters. -+ * -+ * @param lst List to append to -+ * @param bsf_name Name of the bitstream filter -+ * @param options Options for the bitstream filter, can be set to NULL -+ * -+ * @return >=0 on success, negative AVERROR in case of failure -+ */ -+int av_bsf_list_append2(AVBSFList* lst, const char* bsf_name, -+ AVDictionary** options); -+/** -+ * Finalize list of bitstream filters. -+ * -+ * This function will transform @ref AVBSFList to single @ref AVBSFContext, -+ * so the whole chain of bitstream filters can be treated as single filter -+ * freshly allocated by av_bsf_alloc(). -+ * If the call is successful, @ref AVBSFList structure is freed and lst -+ * will be set to NULL. In case of failure, caller is responsible for -+ * freeing the structure by av_bsf_list_free() -+ * -+ * @param lst Filter list structure to be transformed -+ * @param[out] bsf Pointer to be set to newly created @ref AVBSFContext -+ * structure representing the chain of bitstream filters -+ * -+ * @return >=0 on success, negative AVERROR in case of failure -+ */ -+int av_bsf_list_finalize(AVBSFList** lst, AVBSFContext** bsf); -+ -+/** -+ * Parse string describing list of bitstream filters and create single -+ * @ref AVBSFContext describing the whole chain of bitstream filters. -+ * Resulting @ref AVBSFContext can be treated as any other @ref AVBSFContext -+ * freshly allocated by av_bsf_alloc(). -+ * -+ * @param str String describing chain of bitstream filters in format -+ * `bsf1[=opt1=val1:opt2=val2][,bsf2]` -+ * @param[out] bsf Pointer to be set to newly created @ref AVBSFContext -+ * structure representing the chain of bitstream filters -+ * -+ * @return >=0 on success, negative AVERROR in case of failure -+ */ -+int av_bsf_list_parse_str(const char* str, AVBSFContext** bsf); -+ -+/** -+ * Get null/pass-through bitstream filter. -+ * -+ * @param[out] bsf Pointer to be set to new instance of pass-through bitstream -+ * filter -+ * -+ * @return -+ */ -+int av_bsf_get_null_filter(AVBSFContext** bsf); -+ -+/** -+ * @} -+ */ -+ -+#endif // AVCODEC_BSF_H -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec.h -@@ -0,0 +1,513 @@ -+/* -+ * AVCodec public API -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef AVCODEC_CODEC_H -+#define AVCODEC_CODEC_H -+ -+#include -+ -+#include "libavutil/avutil.h" -+#include "libavutil/hwcontext.h" -+#include "libavutil/log.h" -+#include "libavutil/pixfmt.h" -+#include "libavutil/rational.h" -+#include "libavutil/samplefmt.h" -+ -+#include "libavcodec/codec_id.h" -+#include "libavcodec/version.h" -+ -+/** -+ * @addtogroup lavc_core -+ * @{ -+ */ -+ -+/** -+ * Decoder can use draw_horiz_band callback. -+ */ -+#define AV_CODEC_CAP_DRAW_HORIZ_BAND (1 << 0) -+/** -+ * Codec uses get_buffer() or get_encode_buffer() for allocating buffers and -+ * supports custom allocators. -+ * If not set, it might not use get_buffer() or get_encode_buffer() at all, or -+ * use operations that assume the buffer was allocated by -+ * avcodec_default_get_buffer2 or avcodec_default_get_encode_buffer. -+ */ -+#define AV_CODEC_CAP_DR1 (1 << 1) -+#if FF_API_FLAG_TRUNCATED -+/** -+ * @deprecated Use parsers to always send proper frames. -+ */ -+# define AV_CODEC_CAP_TRUNCATED (1 << 3) -+#endif -+/** -+ * Encoder or decoder requires flushing with NULL input at the end in order to -+ * give the complete and correct output. -+ * -+ * NOTE: If this flag is not set, the codec is guaranteed to never be fed with -+ * with NULL data. The user can still send NULL data to the public encode -+ * or decode function, but libavcodec will not pass it along to the codec -+ * unless this flag is set. -+ * -+ * Decoders: -+ * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL, -+ * avpkt->size=0 at the end to get the delayed data until the decoder no longer -+ * returns frames. -+ * -+ * Encoders: -+ * The encoder needs to be fed with NULL data at the end of encoding until the -+ * encoder no longer returns data. -+ * -+ * NOTE: For encoders implementing the AVCodec.encode2() function, setting this -+ * flag also means that the encoder must set the pts and duration for -+ * each output packet. If this flag is not set, the pts and duration will -+ * be determined by libavcodec from the input frame. -+ */ -+#define AV_CODEC_CAP_DELAY (1 << 5) -+/** -+ * Codec can be fed a final frame with a smaller size. -+ * This can be used to prevent truncation of the last audio samples. -+ */ -+#define AV_CODEC_CAP_SMALL_LAST_FRAME (1 << 6) -+ -+/** -+ * Codec can output multiple frames per AVPacket -+ * Normally demuxers return one frame at a time, demuxers which do not do -+ * are connected to a parser to split what they return into proper frames. -+ * This flag is reserved to the very rare category of codecs which have a -+ * bitstream that cannot be split into frames without timeconsuming -+ * operations like full decoding. Demuxers carrying such bitstreams thus -+ * may return multiple frames in a packet. This has many disadvantages like -+ * prohibiting stream copy in many cases thus it should only be considered -+ * as a last resort. -+ */ -+#define AV_CODEC_CAP_SUBFRAMES (1 << 8) -+/** -+ * Codec is experimental and is thus avoided in favor of non experimental -+ * encoders -+ */ -+#define AV_CODEC_CAP_EXPERIMENTAL (1 << 9) -+/** -+ * Codec should fill in channel configuration and samplerate instead of -+ * container -+ */ -+#define AV_CODEC_CAP_CHANNEL_CONF (1 << 10) -+/** -+ * Codec supports frame-level multithreading. -+ */ -+#define AV_CODEC_CAP_FRAME_THREADS (1 << 12) -+/** -+ * Codec supports slice-based (or partition-based) multithreading. -+ */ -+#define AV_CODEC_CAP_SLICE_THREADS (1 << 13) -+/** -+ * Codec supports changed parameters at any point. -+ */ -+#define AV_CODEC_CAP_PARAM_CHANGE (1 << 14) -+/** -+ * Codec supports multithreading through a method other than slice- or -+ * frame-level multithreading. Typically this marks wrappers around -+ * multithreading-capable external libraries. -+ */ -+#define AV_CODEC_CAP_OTHER_THREADS (1 << 15) -+#if FF_API_AUTO_THREADS -+# define AV_CODEC_CAP_AUTO_THREADS AV_CODEC_CAP_OTHER_THREADS -+#endif -+/** -+ * Audio encoder supports receiving a different number of samples in each call. -+ */ -+#define AV_CODEC_CAP_VARIABLE_FRAME_SIZE (1 << 16) -+/** -+ * Decoder is not a preferred choice for probing. -+ * This indicates that the decoder is not a good choice for probing. -+ * It could for example be an expensive to spin up hardware decoder, -+ * or it could simply not provide a lot of useful information about -+ * the stream. -+ * A decoder marked with this flag should only be used as last resort -+ * choice for probing. -+ */ -+#define AV_CODEC_CAP_AVOID_PROBING (1 << 17) -+ -+#if FF_API_UNUSED_CODEC_CAPS -+/** -+ * Deprecated and unused. Use AVCodecDescriptor.props instead -+ */ -+# define AV_CODEC_CAP_INTRA_ONLY 0x40000000 -+/** -+ * Deprecated and unused. Use AVCodecDescriptor.props instead -+ */ -+# define AV_CODEC_CAP_LOSSLESS 0x80000000 -+#endif -+ -+/** -+ * Codec is backed by a hardware implementation. Typically used to -+ * identify a non-hwaccel hardware decoder. For information about hwaccels, use -+ * avcodec_get_hw_config() instead. -+ */ -+#define AV_CODEC_CAP_HARDWARE (1 << 18) -+ -+/** -+ * Codec is potentially backed by a hardware implementation, but not -+ * necessarily. This is used instead of AV_CODEC_CAP_HARDWARE, if the -+ * implementation provides some sort of internal fallback. -+ */ -+#define AV_CODEC_CAP_HYBRID (1 << 19) -+ -+/** -+ * This codec takes the reordered_opaque field from input AVFrames -+ * and returns it in the corresponding field in AVCodecContext after -+ * encoding. -+ */ -+#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE (1 << 20) -+ -+/** -+ * This encoder can be flushed using avcodec_flush_buffers(). If this flag is -+ * not set, the encoder must be closed and reopened to ensure that no frames -+ * remain pending. -+ */ -+#define AV_CODEC_CAP_ENCODER_FLUSH (1 << 21) -+ -+/** -+ * AVProfile. -+ */ -+typedef struct AVProfile { -+ int profile; -+ const char* name; ///< short name for the profile -+} AVProfile; -+ -+typedef struct AVCodecDefault AVCodecDefault; -+ -+struct AVCodecContext; -+struct AVSubtitle; -+struct AVPacket; -+ -+/** -+ * AVCodec. -+ */ -+typedef struct AVCodec { -+ /** -+ * Name of the codec implementation. -+ * The name is globally unique among encoders and among decoders (but an -+ * encoder and a decoder can share the same name). -+ * This is the primary way to find a codec from the user perspective. -+ */ -+ const char* name; -+ /** -+ * Descriptive name for the codec, meant to be more human readable than name. -+ * You should use the NULL_IF_CONFIG_SMALL() macro to define it. -+ */ -+ const char* long_name; -+ enum AVMediaType type; -+ enum AVCodecID id; -+ /** -+ * Codec capabilities. -+ * see AV_CODEC_CAP_* -+ */ -+ int capabilities; -+ uint8_t max_lowres; ///< maximum value for lowres supported by the decoder -+ const AVRational* -+ supported_framerates; ///< array of supported framerates, or NULL if any, -+ ///< array is terminated by {0,0} -+ const enum AVPixelFormat* -+ pix_fmts; ///< array of supported pixel formats, or NULL if unknown, -+ ///< array is terminated by -1 -+ const int* -+ supported_samplerates; ///< array of supported audio samplerates, or NULL -+ ///< if unknown, array is terminated by 0 -+ const enum AVSampleFormat* -+ sample_fmts; ///< array of supported sample formats, or NULL if unknown, -+ ///< array is terminated by -1 -+ const uint64_t* -+ channel_layouts; ///< array of support channel layouts, or NULL if -+ ///< unknown. array is terminated by 0 -+ const AVClass* priv_class; ///< AVClass for the private context -+ const AVProfile* -+ profiles; ///< array of recognized profiles, or NULL if unknown, array is -+ ///< terminated by {FF_PROFILE_UNKNOWN} -+ -+ /** -+ * Group name of the codec implementation. -+ * This is a short symbolic name of the wrapper backing this codec. A -+ * wrapper uses some kind of external implementation for the codec, such -+ * as an external library, or a codec implementation provided by the OS or -+ * the hardware. -+ * If this field is NULL, this is a builtin, libavcodec native codec. -+ * If non-NULL, this will be the suffix in AVCodec.name in most cases -+ * (usually AVCodec.name will be of the form "_"). -+ */ -+ const char* wrapper_name; -+ -+ /***************************************************************** -+ * No fields below this line are part of the public API. They -+ * may not be used outside of libavcodec and can be changed and -+ * removed at will. -+ * New public fields should be added right above. -+ ***************************************************************** -+ */ -+ /** -+ * Internal codec capabilities. -+ * See FF_CODEC_CAP_* in internal.h -+ */ -+ int caps_internal; -+ -+ int priv_data_size; -+ /** -+ * @name Frame-level threading support functions -+ * @{ -+ */ -+ /** -+ * Copy necessary context variables from a previous thread context to the -+ * current one. If not defined, the next thread will start automatically; -+ * otherwise, the codec must call ff_thread_finish_setup(). -+ * -+ * dst and src will (rarely) point to the same context, in which case memcpy -+ * should be skipped. -+ */ -+ int (*update_thread_context)(struct AVCodecContext* dst, -+ const struct AVCodecContext* src); -+ -+ /** -+ * Copy variables back to the user-facing context -+ */ -+ int (*update_thread_context_for_user)(struct AVCodecContext* dst, -+ const struct AVCodecContext* src); -+ /** @} */ -+ -+ /** -+ * Private codec-specific defaults. -+ */ -+ const AVCodecDefault* defaults; -+ -+ /** -+ * Initialize codec static data, called from av_codec_iterate(). -+ * -+ * This is not intended for time consuming operations as it is -+ * run for every codec regardless of that codec being used. -+ */ -+ void (*init_static_data)(struct AVCodec* codec); -+ -+ int (*init)(struct AVCodecContext*); -+ int (*encode_sub)(struct AVCodecContext*, uint8_t* buf, int buf_size, -+ const struct AVSubtitle* sub); -+ /** -+ * Encode data to an AVPacket. -+ * -+ * @param avctx codec context -+ * @param avpkt output AVPacket -+ * @param[in] frame AVFrame containing the raw data to be encoded -+ * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a -+ * non-empty packet was returned in avpkt. -+ * @return 0 on success, negative error code on failure -+ */ -+ int (*encode2)(struct AVCodecContext* avctx, struct AVPacket* avpkt, -+ const struct AVFrame* frame, int* got_packet_ptr); -+ /** -+ * Decode picture or subtitle data. -+ * -+ * @param avctx codec context -+ * @param outdata codec type dependent output struct -+ * @param[out] got_frame_ptr decoder sets to 0 or 1 to indicate that a -+ * non-empty frame or subtitle was returned in -+ * outdata. -+ * @param[in] avpkt AVPacket containing the data to be decoded -+ * @return amount of bytes read from the packet on success, negative error -+ * code on failure -+ */ -+ int (*decode)(struct AVCodecContext* avctx, void* outdata, int* got_frame_ptr, -+ struct AVPacket* avpkt); -+ int (*close)(struct AVCodecContext*); -+ /** -+ * Encode API with decoupled frame/packet dataflow. This function is called -+ * to get one output packet. It should call ff_encode_get_frame() to obtain -+ * input data. -+ */ -+ int (*receive_packet)(struct AVCodecContext* avctx, struct AVPacket* avpkt); -+ -+ /** -+ * Decode API with decoupled packet/frame dataflow. This function is called -+ * to get one output frame. It should call ff_decode_get_packet() to obtain -+ * input data. -+ */ -+ int (*receive_frame)(struct AVCodecContext* avctx, struct AVFrame* frame); -+ /** -+ * Flush buffers. -+ * Will be called when seeking -+ */ -+ void (*flush)(struct AVCodecContext*); -+ -+ /** -+ * Decoding only, a comma-separated list of bitstream filters to apply to -+ * packets before decoding. -+ */ -+ const char* bsfs; -+ -+ /** -+ * Array of pointers to hardware configurations supported by the codec, -+ * or NULL if no hardware supported. The array is terminated by a NULL -+ * pointer. -+ * -+ * The user can only access this field via avcodec_get_hw_config(). -+ */ -+ const struct AVCodecHWConfigInternal* const* hw_configs; -+ -+ /** -+ * List of supported codec_tags, terminated by FF_CODEC_TAGS_END. -+ */ -+ const uint32_t* codec_tags; -+} AVCodec; -+ -+/** -+ * Iterate over all registered codecs. -+ * -+ * @param opaque a pointer where libavcodec will store the iteration state. Must -+ * point to NULL to start the iteration. -+ * -+ * @return the next registered codec or NULL when the iteration is -+ * finished -+ */ -+const AVCodec* av_codec_iterate(void** opaque); -+ -+/** -+ * Find a registered decoder with a matching codec ID. -+ * -+ * @param id AVCodecID of the requested decoder -+ * @return A decoder if one was found, NULL otherwise. -+ */ -+const AVCodec* avcodec_find_decoder(enum AVCodecID id); -+ -+/** -+ * Find a registered decoder with the specified name. -+ * -+ * @param name name of the requested decoder -+ * @return A decoder if one was found, NULL otherwise. -+ */ -+const AVCodec* avcodec_find_decoder_by_name(const char* name); -+ -+/** -+ * Find a registered encoder with a matching codec ID. -+ * -+ * @param id AVCodecID of the requested encoder -+ * @return An encoder if one was found, NULL otherwise. -+ */ -+const AVCodec* avcodec_find_encoder(enum AVCodecID id); -+ -+/** -+ * Find a registered encoder with the specified name. -+ * -+ * @param name name of the requested encoder -+ * @return An encoder if one was found, NULL otherwise. -+ */ -+const AVCodec* avcodec_find_encoder_by_name(const char* name); -+/** -+ * @return a non-zero number if codec is an encoder, zero otherwise -+ */ -+int av_codec_is_encoder(const AVCodec* codec); -+ -+/** -+ * @return a non-zero number if codec is a decoder, zero otherwise -+ */ -+int av_codec_is_decoder(const AVCodec* codec); -+ -+/** -+ * Return a name for the specified profile, if available. -+ * -+ * @param codec the codec that is searched for the given profile -+ * @param profile the profile value for which a name is requested -+ * @return A name for the profile if found, NULL otherwise. -+ */ -+const char* av_get_profile_name(const AVCodec* codec, int profile); -+ -+enum { -+ /** -+ * The codec supports this format via the hw_device_ctx interface. -+ * -+ * When selecting this format, AVCodecContext.hw_device_ctx should -+ * have been set to a device of the specified type before calling -+ * avcodec_open2(). -+ */ -+ AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX = 0x01, -+ /** -+ * The codec supports this format via the hw_frames_ctx interface. -+ * -+ * When selecting this format for a decoder, -+ * AVCodecContext.hw_frames_ctx should be set to a suitable frames -+ * context inside the get_format() callback. The frames context -+ * must have been created on a device of the specified type. -+ * -+ * When selecting this format for an encoder, -+ * AVCodecContext.hw_frames_ctx should be set to the context which -+ * will be used for the input frames before calling avcodec_open2(). -+ */ -+ AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX = 0x02, -+ /** -+ * The codec supports this format by some internal method. -+ * -+ * This format can be selected without any additional configuration - -+ * no device or frames context is required. -+ */ -+ AV_CODEC_HW_CONFIG_METHOD_INTERNAL = 0x04, -+ /** -+ * The codec supports this format by some ad-hoc method. -+ * -+ * Additional settings and/or function calls are required. See the -+ * codec-specific documentation for details. (Methods requiring -+ * this sort of configuration are deprecated and others should be -+ * used in preference.) -+ */ -+ AV_CODEC_HW_CONFIG_METHOD_AD_HOC = 0x08, -+}; -+ -+typedef struct AVCodecHWConfig { -+ /** -+ * For decoders, a hardware pixel format which that decoder may be -+ * able to decode to if suitable hardware is available. -+ * -+ * For encoders, a pixel format which the encoder may be able to -+ * accept. If set to AV_PIX_FMT_NONE, this applies to all pixel -+ * formats supported by the codec. -+ */ -+ enum AVPixelFormat pix_fmt; -+ /** -+ * Bit set of AV_CODEC_HW_CONFIG_METHOD_* flags, describing the possible -+ * setup methods which can be used with this configuration. -+ */ -+ int methods; -+ /** -+ * The device type associated with the configuration. -+ * -+ * Must be set for AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX and -+ * AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX, otherwise unused. -+ */ -+ enum AVHWDeviceType device_type; -+} AVCodecHWConfig; -+ -+/** -+ * Retrieve supported hardware configurations for a codec. -+ * -+ * Values of index from zero to some maximum return the indexed configuration -+ * descriptor; all other values return NULL. If the codec does not support -+ * any hardware configurations then it will always return NULL. -+ */ -+const AVCodecHWConfig* avcodec_get_hw_config(const AVCodec* codec, int index); -+ -+/** -+ * @} -+ */ -+ -+#endif /* AVCODEC_CODEC_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec_desc.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec_desc.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec_desc.h -@@ -0,0 +1,128 @@ -+/* -+ * Codec descriptors public API -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef AVCODEC_CODEC_DESC_H -+#define AVCODEC_CODEC_DESC_H -+ -+#include "libavutil/avutil.h" -+ -+#include "codec_id.h" -+ -+/** -+ * @addtogroup lavc_core -+ * @{ -+ */ -+ -+/** -+ * This struct describes the properties of a single codec described by an -+ * AVCodecID. -+ * @see avcodec_descriptor_get() -+ */ -+typedef struct AVCodecDescriptor { -+ enum AVCodecID id; -+ enum AVMediaType type; -+ /** -+ * Name of the codec described by this descriptor. It is non-empty and -+ * unique for each codec descriptor. It should contain alphanumeric -+ * characters and '_' only. -+ */ -+ const char* name; -+ /** -+ * A more descriptive name for this codec. May be NULL. -+ */ -+ const char* long_name; -+ /** -+ * Codec properties, a combination of AV_CODEC_PROP_* flags. -+ */ -+ int props; -+ /** -+ * MIME type(s) associated with the codec. -+ * May be NULL; if not, a NULL-terminated array of MIME types. -+ * The first item is always non-NULL and is the preferred MIME type. -+ */ -+ const char* const* mime_types; -+ /** -+ * If non-NULL, an array of profiles recognized for this codec. -+ * Terminated with FF_PROFILE_UNKNOWN. -+ */ -+ const struct AVProfile* profiles; -+} AVCodecDescriptor; -+ -+/** -+ * Codec uses only intra compression. -+ * Video and audio codecs only. -+ */ -+#define AV_CODEC_PROP_INTRA_ONLY (1 << 0) -+/** -+ * Codec supports lossy compression. Audio and video codecs only. -+ * @note a codec may support both lossy and lossless -+ * compression modes -+ */ -+#define AV_CODEC_PROP_LOSSY (1 << 1) -+/** -+ * Codec supports lossless compression. Audio and video codecs only. -+ */ -+#define AV_CODEC_PROP_LOSSLESS (1 << 2) -+/** -+ * Codec supports frame reordering. That is, the coded order (the order in which -+ * the encoded packets are output by the encoders / stored / input to the -+ * decoders) may be different from the presentation order of the corresponding -+ * frames. -+ * -+ * For codecs that do not have this property set, PTS and DTS should always be -+ * equal. -+ */ -+#define AV_CODEC_PROP_REORDER (1 << 3) -+/** -+ * Subtitle codec is bitmap based -+ * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field. -+ */ -+#define AV_CODEC_PROP_BITMAP_SUB (1 << 16) -+/** -+ * Subtitle codec is text based. -+ * Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field. -+ */ -+#define AV_CODEC_PROP_TEXT_SUB (1 << 17) -+ -+/** -+ * @return descriptor for given codec ID or NULL if no descriptor exists. -+ */ -+const AVCodecDescriptor* avcodec_descriptor_get(enum AVCodecID id); -+ -+/** -+ * Iterate over all codec descriptors known to libavcodec. -+ * -+ * @param prev previous descriptor. NULL to get the first descriptor. -+ * -+ * @return next descriptor or NULL after the last descriptor -+ */ -+const AVCodecDescriptor* avcodec_descriptor_next(const AVCodecDescriptor* prev); -+ -+/** -+ * @return codec descriptor with the given name or NULL if no such descriptor -+ * exists. -+ */ -+const AVCodecDescriptor* avcodec_descriptor_get_by_name(const char* name); -+ -+/** -+ * @} -+ */ -+ -+#endif // AVCODEC_CODEC_DESC_H -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec_id.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec_id.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec_id.h -@@ -0,0 +1,637 @@ -+/* -+ * Codec IDs -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef AVCODEC_CODEC_ID_H -+#define AVCODEC_CODEC_ID_H -+ -+#include "libavutil/avutil.h" -+#include "libavutil/samplefmt.h" -+ -+/** -+ * @addtogroup lavc_core -+ * @{ -+ */ -+ -+/** -+ * Identify the syntax and semantics of the bitstream. -+ * The principle is roughly: -+ * Two decoders with the same ID can decode the same streams. -+ * Two encoders with the same ID can encode compatible streams. -+ * There may be slight deviations from the principle due to implementation -+ * details. -+ * -+ * If you add a codec ID to this list, add it so that -+ * 1. no value of an existing codec ID changes (that would break ABI), -+ * 2. it is as close as possible to similar codecs -+ * -+ * After adding new codec IDs, do not forget to add an entry to the codec -+ * descriptor list and bump libavcodec minor version. -+ */ -+enum AVCodecID { -+ AV_CODEC_ID_NONE, -+ -+ /* video codecs */ -+ AV_CODEC_ID_MPEG1VIDEO, -+ AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding -+ AV_CODEC_ID_H261, -+ AV_CODEC_ID_H263, -+ AV_CODEC_ID_RV10, -+ AV_CODEC_ID_RV20, -+ AV_CODEC_ID_MJPEG, -+ AV_CODEC_ID_MJPEGB, -+ AV_CODEC_ID_LJPEG, -+ AV_CODEC_ID_SP5X, -+ AV_CODEC_ID_JPEGLS, -+ AV_CODEC_ID_MPEG4, -+ AV_CODEC_ID_RAWVIDEO, -+ AV_CODEC_ID_MSMPEG4V1, -+ AV_CODEC_ID_MSMPEG4V2, -+ AV_CODEC_ID_MSMPEG4V3, -+ AV_CODEC_ID_WMV1, -+ AV_CODEC_ID_WMV2, -+ AV_CODEC_ID_H263P, -+ AV_CODEC_ID_H263I, -+ AV_CODEC_ID_FLV1, -+ AV_CODEC_ID_SVQ1, -+ AV_CODEC_ID_SVQ3, -+ AV_CODEC_ID_DVVIDEO, -+ AV_CODEC_ID_HUFFYUV, -+ AV_CODEC_ID_CYUV, -+ AV_CODEC_ID_H264, -+ AV_CODEC_ID_INDEO3, -+ AV_CODEC_ID_VP3, -+ AV_CODEC_ID_THEORA, -+ AV_CODEC_ID_ASV1, -+ AV_CODEC_ID_ASV2, -+ AV_CODEC_ID_FFV1, -+ AV_CODEC_ID_4XM, -+ AV_CODEC_ID_VCR1, -+ AV_CODEC_ID_CLJR, -+ AV_CODEC_ID_MDEC, -+ AV_CODEC_ID_ROQ, -+ AV_CODEC_ID_INTERPLAY_VIDEO, -+ AV_CODEC_ID_XAN_WC3, -+ AV_CODEC_ID_XAN_WC4, -+ AV_CODEC_ID_RPZA, -+ AV_CODEC_ID_CINEPAK, -+ AV_CODEC_ID_WS_VQA, -+ AV_CODEC_ID_MSRLE, -+ AV_CODEC_ID_MSVIDEO1, -+ AV_CODEC_ID_IDCIN, -+ AV_CODEC_ID_8BPS, -+ AV_CODEC_ID_SMC, -+ AV_CODEC_ID_FLIC, -+ AV_CODEC_ID_TRUEMOTION1, -+ AV_CODEC_ID_VMDVIDEO, -+ AV_CODEC_ID_MSZH, -+ AV_CODEC_ID_ZLIB, -+ AV_CODEC_ID_QTRLE, -+ AV_CODEC_ID_TSCC, -+ AV_CODEC_ID_ULTI, -+ AV_CODEC_ID_QDRAW, -+ AV_CODEC_ID_VIXL, -+ AV_CODEC_ID_QPEG, -+ AV_CODEC_ID_PNG, -+ AV_CODEC_ID_PPM, -+ AV_CODEC_ID_PBM, -+ AV_CODEC_ID_PGM, -+ AV_CODEC_ID_PGMYUV, -+ AV_CODEC_ID_PAM, -+ AV_CODEC_ID_FFVHUFF, -+ AV_CODEC_ID_RV30, -+ AV_CODEC_ID_RV40, -+ AV_CODEC_ID_VC1, -+ AV_CODEC_ID_WMV3, -+ AV_CODEC_ID_LOCO, -+ AV_CODEC_ID_WNV1, -+ AV_CODEC_ID_AASC, -+ AV_CODEC_ID_INDEO2, -+ AV_CODEC_ID_FRAPS, -+ AV_CODEC_ID_TRUEMOTION2, -+ AV_CODEC_ID_BMP, -+ AV_CODEC_ID_CSCD, -+ AV_CODEC_ID_MMVIDEO, -+ AV_CODEC_ID_ZMBV, -+ AV_CODEC_ID_AVS, -+ AV_CODEC_ID_SMACKVIDEO, -+ AV_CODEC_ID_NUV, -+ AV_CODEC_ID_KMVC, -+ AV_CODEC_ID_FLASHSV, -+ AV_CODEC_ID_CAVS, -+ AV_CODEC_ID_JPEG2000, -+ AV_CODEC_ID_VMNC, -+ AV_CODEC_ID_VP5, -+ AV_CODEC_ID_VP6, -+ AV_CODEC_ID_VP6F, -+ AV_CODEC_ID_TARGA, -+ AV_CODEC_ID_DSICINVIDEO, -+ AV_CODEC_ID_TIERTEXSEQVIDEO, -+ AV_CODEC_ID_TIFF, -+ AV_CODEC_ID_GIF, -+ AV_CODEC_ID_DXA, -+ AV_CODEC_ID_DNXHD, -+ AV_CODEC_ID_THP, -+ AV_CODEC_ID_SGI, -+ AV_CODEC_ID_C93, -+ AV_CODEC_ID_BETHSOFTVID, -+ AV_CODEC_ID_PTX, -+ AV_CODEC_ID_TXD, -+ AV_CODEC_ID_VP6A, -+ AV_CODEC_ID_AMV, -+ AV_CODEC_ID_VB, -+ AV_CODEC_ID_PCX, -+ AV_CODEC_ID_SUNRAST, -+ AV_CODEC_ID_INDEO4, -+ AV_CODEC_ID_INDEO5, -+ AV_CODEC_ID_MIMIC, -+ AV_CODEC_ID_RL2, -+ AV_CODEC_ID_ESCAPE124, -+ AV_CODEC_ID_DIRAC, -+ AV_CODEC_ID_BFI, -+ AV_CODEC_ID_CMV, -+ AV_CODEC_ID_MOTIONPIXELS, -+ AV_CODEC_ID_TGV, -+ AV_CODEC_ID_TGQ, -+ AV_CODEC_ID_TQI, -+ AV_CODEC_ID_AURA, -+ AV_CODEC_ID_AURA2, -+ AV_CODEC_ID_V210X, -+ AV_CODEC_ID_TMV, -+ AV_CODEC_ID_V210, -+ AV_CODEC_ID_DPX, -+ AV_CODEC_ID_MAD, -+ AV_CODEC_ID_FRWU, -+ AV_CODEC_ID_FLASHSV2, -+ AV_CODEC_ID_CDGRAPHICS, -+ AV_CODEC_ID_R210, -+ AV_CODEC_ID_ANM, -+ AV_CODEC_ID_BINKVIDEO, -+ AV_CODEC_ID_IFF_ILBM, -+#define AV_CODEC_ID_IFF_BYTERUN1 AV_CODEC_ID_IFF_ILBM -+ AV_CODEC_ID_KGV1, -+ AV_CODEC_ID_YOP, -+ AV_CODEC_ID_VP8, -+ AV_CODEC_ID_PICTOR, -+ AV_CODEC_ID_ANSI, -+ AV_CODEC_ID_A64_MULTI, -+ AV_CODEC_ID_A64_MULTI5, -+ AV_CODEC_ID_R10K, -+ AV_CODEC_ID_MXPEG, -+ AV_CODEC_ID_LAGARITH, -+ AV_CODEC_ID_PRORES, -+ AV_CODEC_ID_JV, -+ AV_CODEC_ID_DFA, -+ AV_CODEC_ID_WMV3IMAGE, -+ AV_CODEC_ID_VC1IMAGE, -+ AV_CODEC_ID_UTVIDEO, -+ AV_CODEC_ID_BMV_VIDEO, -+ AV_CODEC_ID_VBLE, -+ AV_CODEC_ID_DXTORY, -+ AV_CODEC_ID_V410, -+ AV_CODEC_ID_XWD, -+ AV_CODEC_ID_CDXL, -+ AV_CODEC_ID_XBM, -+ AV_CODEC_ID_ZEROCODEC, -+ AV_CODEC_ID_MSS1, -+ AV_CODEC_ID_MSA1, -+ AV_CODEC_ID_TSCC2, -+ AV_CODEC_ID_MTS2, -+ AV_CODEC_ID_CLLC, -+ AV_CODEC_ID_MSS2, -+ AV_CODEC_ID_VP9, -+ AV_CODEC_ID_AIC, -+ AV_CODEC_ID_ESCAPE130, -+ AV_CODEC_ID_G2M, -+ AV_CODEC_ID_WEBP, -+ AV_CODEC_ID_HNM4_VIDEO, -+ AV_CODEC_ID_HEVC, -+#define AV_CODEC_ID_H265 AV_CODEC_ID_HEVC -+ AV_CODEC_ID_FIC, -+ AV_CODEC_ID_ALIAS_PIX, -+ AV_CODEC_ID_BRENDER_PIX, -+ AV_CODEC_ID_PAF_VIDEO, -+ AV_CODEC_ID_EXR, -+ AV_CODEC_ID_VP7, -+ AV_CODEC_ID_SANM, -+ AV_CODEC_ID_SGIRLE, -+ AV_CODEC_ID_MVC1, -+ AV_CODEC_ID_MVC2, -+ AV_CODEC_ID_HQX, -+ AV_CODEC_ID_TDSC, -+ AV_CODEC_ID_HQ_HQA, -+ AV_CODEC_ID_HAP, -+ AV_CODEC_ID_DDS, -+ AV_CODEC_ID_DXV, -+ AV_CODEC_ID_SCREENPRESSO, -+ AV_CODEC_ID_RSCC, -+ AV_CODEC_ID_AVS2, -+ AV_CODEC_ID_PGX, -+ AV_CODEC_ID_AVS3, -+ AV_CODEC_ID_MSP2, -+ AV_CODEC_ID_VVC, -+#define AV_CODEC_ID_H266 AV_CODEC_ID_VVC -+ AV_CODEC_ID_Y41P, -+ AV_CODEC_ID_AVRP, -+ AV_CODEC_ID_012V, -+ AV_CODEC_ID_AVUI, -+ AV_CODEC_ID_AYUV, -+ AV_CODEC_ID_TARGA_Y216, -+ AV_CODEC_ID_V308, -+ AV_CODEC_ID_V408, -+ AV_CODEC_ID_YUV4, -+ AV_CODEC_ID_AVRN, -+ AV_CODEC_ID_CPIA, -+ AV_CODEC_ID_XFACE, -+ AV_CODEC_ID_SNOW, -+ AV_CODEC_ID_SMVJPEG, -+ AV_CODEC_ID_APNG, -+ AV_CODEC_ID_DAALA, -+ AV_CODEC_ID_CFHD, -+ AV_CODEC_ID_TRUEMOTION2RT, -+ AV_CODEC_ID_M101, -+ AV_CODEC_ID_MAGICYUV, -+ AV_CODEC_ID_SHEERVIDEO, -+ AV_CODEC_ID_YLC, -+ AV_CODEC_ID_PSD, -+ AV_CODEC_ID_PIXLET, -+ AV_CODEC_ID_SPEEDHQ, -+ AV_CODEC_ID_FMVC, -+ AV_CODEC_ID_SCPR, -+ AV_CODEC_ID_CLEARVIDEO, -+ AV_CODEC_ID_XPM, -+ AV_CODEC_ID_AV1, -+ AV_CODEC_ID_BITPACKED, -+ AV_CODEC_ID_MSCC, -+ AV_CODEC_ID_SRGC, -+ AV_CODEC_ID_SVG, -+ AV_CODEC_ID_GDV, -+ AV_CODEC_ID_FITS, -+ AV_CODEC_ID_IMM4, -+ AV_CODEC_ID_PROSUMER, -+ AV_CODEC_ID_MWSC, -+ AV_CODEC_ID_WCMV, -+ AV_CODEC_ID_RASC, -+ AV_CODEC_ID_HYMT, -+ AV_CODEC_ID_ARBC, -+ AV_CODEC_ID_AGM, -+ AV_CODEC_ID_LSCR, -+ AV_CODEC_ID_VP4, -+ AV_CODEC_ID_IMM5, -+ AV_CODEC_ID_MVDV, -+ AV_CODEC_ID_MVHA, -+ AV_CODEC_ID_CDTOONS, -+ AV_CODEC_ID_MV30, -+ AV_CODEC_ID_NOTCHLC, -+ AV_CODEC_ID_PFM, -+ AV_CODEC_ID_MOBICLIP, -+ AV_CODEC_ID_PHOTOCD, -+ AV_CODEC_ID_IPU, -+ AV_CODEC_ID_ARGO, -+ AV_CODEC_ID_CRI, -+ AV_CODEC_ID_SIMBIOSIS_IMX, -+ AV_CODEC_ID_SGA_VIDEO, -+ AV_CODEC_ID_GEM, -+ -+ /* various PCM "codecs" */ -+ AV_CODEC_ID_FIRST_AUDIO = -+ 0x10000, ///< A dummy id pointing at the start of audio codecs -+ AV_CODEC_ID_PCM_S16LE = 0x10000, -+ AV_CODEC_ID_PCM_S16BE, -+ AV_CODEC_ID_PCM_U16LE, -+ AV_CODEC_ID_PCM_U16BE, -+ AV_CODEC_ID_PCM_S8, -+ AV_CODEC_ID_PCM_U8, -+ AV_CODEC_ID_PCM_MULAW, -+ AV_CODEC_ID_PCM_ALAW, -+ AV_CODEC_ID_PCM_S32LE, -+ AV_CODEC_ID_PCM_S32BE, -+ AV_CODEC_ID_PCM_U32LE, -+ AV_CODEC_ID_PCM_U32BE, -+ AV_CODEC_ID_PCM_S24LE, -+ AV_CODEC_ID_PCM_S24BE, -+ AV_CODEC_ID_PCM_U24LE, -+ AV_CODEC_ID_PCM_U24BE, -+ AV_CODEC_ID_PCM_S24DAUD, -+ AV_CODEC_ID_PCM_ZORK, -+ AV_CODEC_ID_PCM_S16LE_PLANAR, -+ AV_CODEC_ID_PCM_DVD, -+ AV_CODEC_ID_PCM_F32BE, -+ AV_CODEC_ID_PCM_F32LE, -+ AV_CODEC_ID_PCM_F64BE, -+ AV_CODEC_ID_PCM_F64LE, -+ AV_CODEC_ID_PCM_BLURAY, -+ AV_CODEC_ID_PCM_LXF, -+ AV_CODEC_ID_S302M, -+ AV_CODEC_ID_PCM_S8_PLANAR, -+ AV_CODEC_ID_PCM_S24LE_PLANAR, -+ AV_CODEC_ID_PCM_S32LE_PLANAR, -+ AV_CODEC_ID_PCM_S16BE_PLANAR, -+ AV_CODEC_ID_PCM_S64LE, -+ AV_CODEC_ID_PCM_S64BE, -+ AV_CODEC_ID_PCM_F16LE, -+ AV_CODEC_ID_PCM_F24LE, -+ AV_CODEC_ID_PCM_VIDC, -+ AV_CODEC_ID_PCM_SGA, -+ -+ /* various ADPCM codecs */ -+ AV_CODEC_ID_ADPCM_IMA_QT = 0x11000, -+ AV_CODEC_ID_ADPCM_IMA_WAV, -+ AV_CODEC_ID_ADPCM_IMA_DK3, -+ AV_CODEC_ID_ADPCM_IMA_DK4, -+ AV_CODEC_ID_ADPCM_IMA_WS, -+ AV_CODEC_ID_ADPCM_IMA_SMJPEG, -+ AV_CODEC_ID_ADPCM_MS, -+ AV_CODEC_ID_ADPCM_4XM, -+ AV_CODEC_ID_ADPCM_XA, -+ AV_CODEC_ID_ADPCM_ADX, -+ AV_CODEC_ID_ADPCM_EA, -+ AV_CODEC_ID_ADPCM_G726, -+ AV_CODEC_ID_ADPCM_CT, -+ AV_CODEC_ID_ADPCM_SWF, -+ AV_CODEC_ID_ADPCM_YAMAHA, -+ AV_CODEC_ID_ADPCM_SBPRO_4, -+ AV_CODEC_ID_ADPCM_SBPRO_3, -+ AV_CODEC_ID_ADPCM_SBPRO_2, -+ AV_CODEC_ID_ADPCM_THP, -+ AV_CODEC_ID_ADPCM_IMA_AMV, -+ AV_CODEC_ID_ADPCM_EA_R1, -+ AV_CODEC_ID_ADPCM_EA_R3, -+ AV_CODEC_ID_ADPCM_EA_R2, -+ AV_CODEC_ID_ADPCM_IMA_EA_SEAD, -+ AV_CODEC_ID_ADPCM_IMA_EA_EACS, -+ AV_CODEC_ID_ADPCM_EA_XAS, -+ AV_CODEC_ID_ADPCM_EA_MAXIS_XA, -+ AV_CODEC_ID_ADPCM_IMA_ISS, -+ AV_CODEC_ID_ADPCM_G722, -+ AV_CODEC_ID_ADPCM_IMA_APC, -+ AV_CODEC_ID_ADPCM_VIMA, -+ AV_CODEC_ID_ADPCM_AFC, -+ AV_CODEC_ID_ADPCM_IMA_OKI, -+ AV_CODEC_ID_ADPCM_DTK, -+ AV_CODEC_ID_ADPCM_IMA_RAD, -+ AV_CODEC_ID_ADPCM_G726LE, -+ AV_CODEC_ID_ADPCM_THP_LE, -+ AV_CODEC_ID_ADPCM_PSX, -+ AV_CODEC_ID_ADPCM_AICA, -+ AV_CODEC_ID_ADPCM_IMA_DAT4, -+ AV_CODEC_ID_ADPCM_MTAF, -+ AV_CODEC_ID_ADPCM_AGM, -+ AV_CODEC_ID_ADPCM_ARGO, -+ AV_CODEC_ID_ADPCM_IMA_SSI, -+ AV_CODEC_ID_ADPCM_ZORK, -+ AV_CODEC_ID_ADPCM_IMA_APM, -+ AV_CODEC_ID_ADPCM_IMA_ALP, -+ AV_CODEC_ID_ADPCM_IMA_MTF, -+ AV_CODEC_ID_ADPCM_IMA_CUNNING, -+ AV_CODEC_ID_ADPCM_IMA_MOFLEX, -+ AV_CODEC_ID_ADPCM_IMA_ACORN, -+ -+ /* AMR */ -+ AV_CODEC_ID_AMR_NB = 0x12000, -+ AV_CODEC_ID_AMR_WB, -+ -+ /* RealAudio codecs*/ -+ AV_CODEC_ID_RA_144 = 0x13000, -+ AV_CODEC_ID_RA_288, -+ -+ /* various DPCM codecs */ -+ AV_CODEC_ID_ROQ_DPCM = 0x14000, -+ AV_CODEC_ID_INTERPLAY_DPCM, -+ AV_CODEC_ID_XAN_DPCM, -+ AV_CODEC_ID_SOL_DPCM, -+ AV_CODEC_ID_SDX2_DPCM, -+ AV_CODEC_ID_GREMLIN_DPCM, -+ AV_CODEC_ID_DERF_DPCM, -+ -+ /* audio codecs */ -+ AV_CODEC_ID_MP2 = 0x15000, -+ AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 -+ AV_CODEC_ID_AAC, -+ AV_CODEC_ID_AC3, -+ AV_CODEC_ID_DTS, -+ AV_CODEC_ID_VORBIS, -+ AV_CODEC_ID_DVAUDIO, -+ AV_CODEC_ID_WMAV1, -+ AV_CODEC_ID_WMAV2, -+ AV_CODEC_ID_MACE3, -+ AV_CODEC_ID_MACE6, -+ AV_CODEC_ID_VMDAUDIO, -+ AV_CODEC_ID_FLAC, -+ AV_CODEC_ID_MP3ADU, -+ AV_CODEC_ID_MP3ON4, -+ AV_CODEC_ID_SHORTEN, -+ AV_CODEC_ID_ALAC, -+ AV_CODEC_ID_WESTWOOD_SND1, -+ AV_CODEC_ID_GSM, ///< as in Berlin toast format -+ AV_CODEC_ID_QDM2, -+ AV_CODEC_ID_COOK, -+ AV_CODEC_ID_TRUESPEECH, -+ AV_CODEC_ID_TTA, -+ AV_CODEC_ID_SMACKAUDIO, -+ AV_CODEC_ID_QCELP, -+ AV_CODEC_ID_WAVPACK, -+ AV_CODEC_ID_DSICINAUDIO, -+ AV_CODEC_ID_IMC, -+ AV_CODEC_ID_MUSEPACK7, -+ AV_CODEC_ID_MLP, -+ AV_CODEC_ID_GSM_MS, /* as found in WAV */ -+ AV_CODEC_ID_ATRAC3, -+ AV_CODEC_ID_APE, -+ AV_CODEC_ID_NELLYMOSER, -+ AV_CODEC_ID_MUSEPACK8, -+ AV_CODEC_ID_SPEEX, -+ AV_CODEC_ID_WMAVOICE, -+ AV_CODEC_ID_WMAPRO, -+ AV_CODEC_ID_WMALOSSLESS, -+ AV_CODEC_ID_ATRAC3P, -+ AV_CODEC_ID_EAC3, -+ AV_CODEC_ID_SIPR, -+ AV_CODEC_ID_MP1, -+ AV_CODEC_ID_TWINVQ, -+ AV_CODEC_ID_TRUEHD, -+ AV_CODEC_ID_MP4ALS, -+ AV_CODEC_ID_ATRAC1, -+ AV_CODEC_ID_BINKAUDIO_RDFT, -+ AV_CODEC_ID_BINKAUDIO_DCT, -+ AV_CODEC_ID_AAC_LATM, -+ AV_CODEC_ID_QDMC, -+ AV_CODEC_ID_CELT, -+ AV_CODEC_ID_G723_1, -+ AV_CODEC_ID_G729, -+ AV_CODEC_ID_8SVX_EXP, -+ AV_CODEC_ID_8SVX_FIB, -+ AV_CODEC_ID_BMV_AUDIO, -+ AV_CODEC_ID_RALF, -+ AV_CODEC_ID_IAC, -+ AV_CODEC_ID_ILBC, -+ AV_CODEC_ID_OPUS, -+ AV_CODEC_ID_COMFORT_NOISE, -+ AV_CODEC_ID_TAK, -+ AV_CODEC_ID_METASOUND, -+ AV_CODEC_ID_PAF_AUDIO, -+ AV_CODEC_ID_ON2AVC, -+ AV_CODEC_ID_DSS_SP, -+ AV_CODEC_ID_CODEC2, -+ AV_CODEC_ID_FFWAVESYNTH, -+ AV_CODEC_ID_SONIC, -+ AV_CODEC_ID_SONIC_LS, -+ AV_CODEC_ID_EVRC, -+ AV_CODEC_ID_SMV, -+ AV_CODEC_ID_DSD_LSBF, -+ AV_CODEC_ID_DSD_MSBF, -+ AV_CODEC_ID_DSD_LSBF_PLANAR, -+ AV_CODEC_ID_DSD_MSBF_PLANAR, -+ AV_CODEC_ID_4GV, -+ AV_CODEC_ID_INTERPLAY_ACM, -+ AV_CODEC_ID_XMA1, -+ AV_CODEC_ID_XMA2, -+ AV_CODEC_ID_DST, -+ AV_CODEC_ID_ATRAC3AL, -+ AV_CODEC_ID_ATRAC3PAL, -+ AV_CODEC_ID_DOLBY_E, -+ AV_CODEC_ID_APTX, -+ AV_CODEC_ID_APTX_HD, -+ AV_CODEC_ID_SBC, -+ AV_CODEC_ID_ATRAC9, -+ AV_CODEC_ID_HCOM, -+ AV_CODEC_ID_ACELP_KELVIN, -+ AV_CODEC_ID_MPEGH_3D_AUDIO, -+ AV_CODEC_ID_SIREN, -+ AV_CODEC_ID_HCA, -+ AV_CODEC_ID_FASTAUDIO, -+ AV_CODEC_ID_MSNSIREN, -+ -+ /* subtitle codecs */ -+ AV_CODEC_ID_FIRST_SUBTITLE = -+ 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. -+ AV_CODEC_ID_DVD_SUBTITLE = 0x17000, -+ AV_CODEC_ID_DVB_SUBTITLE, -+ AV_CODEC_ID_TEXT, ///< raw UTF-8 text -+ AV_CODEC_ID_XSUB, -+ AV_CODEC_ID_SSA, -+ AV_CODEC_ID_MOV_TEXT, -+ AV_CODEC_ID_HDMV_PGS_SUBTITLE, -+ AV_CODEC_ID_DVB_TELETEXT, -+ AV_CODEC_ID_SRT, -+ AV_CODEC_ID_MICRODVD, -+ AV_CODEC_ID_EIA_608, -+ AV_CODEC_ID_JACOSUB, -+ AV_CODEC_ID_SAMI, -+ AV_CODEC_ID_REALTEXT, -+ AV_CODEC_ID_STL, -+ AV_CODEC_ID_SUBVIEWER1, -+ AV_CODEC_ID_SUBVIEWER, -+ AV_CODEC_ID_SUBRIP, -+ AV_CODEC_ID_WEBVTT, -+ AV_CODEC_ID_MPL2, -+ AV_CODEC_ID_VPLAYER, -+ AV_CODEC_ID_PJS, -+ AV_CODEC_ID_ASS, -+ AV_CODEC_ID_HDMV_TEXT_SUBTITLE, -+ AV_CODEC_ID_TTML, -+ AV_CODEC_ID_ARIB_CAPTION, -+ -+ /* other specific kind of codecs (generally used for attachments) */ -+ AV_CODEC_ID_FIRST_UNKNOWN = -+ 0x18000, ///< A dummy ID pointing at the start of various fake codecs. -+ AV_CODEC_ID_TTF = 0x18000, -+ -+ AV_CODEC_ID_SCTE_35, ///< Contain timestamp estimated through PCR of program -+ ///< stream. -+ AV_CODEC_ID_EPG, -+ AV_CODEC_ID_BINTEXT, -+ AV_CODEC_ID_XBIN, -+ AV_CODEC_ID_IDF, -+ AV_CODEC_ID_OTF, -+ AV_CODEC_ID_SMPTE_KLV, -+ AV_CODEC_ID_DVD_NAV, -+ AV_CODEC_ID_TIMED_ID3, -+ AV_CODEC_ID_BIN_DATA, -+ -+ AV_CODEC_ID_PROBE = -+ 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf -+ ///< should attempt to identify it -+ -+ AV_CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS -+ * stream (only used by libavformat) */ -+ AV_CODEC_ID_MPEG4SYSTEMS = -+ 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems -+ * stream (only used by libavformat) */ -+ AV_CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing -+ ///< only metadata information. -+ AV_CODEC_ID_WRAPPED_AVFRAME = -+ 0x21001, ///< Passthrough codec, AVFrames wrapped in AVPacket -+}; -+ -+/** -+ * Get the type of the given codec. -+ */ -+enum AVMediaType avcodec_get_type(enum AVCodecID codec_id); -+ -+/** -+ * Get the name of a codec. -+ * @return a static string identifying the codec; never NULL -+ */ -+const char* avcodec_get_name(enum AVCodecID id); -+ -+/** -+ * Return codec bits per sample. -+ * -+ * @param[in] codec_id the codec -+ * @return Number of bits per sample or zero if unknown for the given codec. -+ */ -+int av_get_bits_per_sample(enum AVCodecID codec_id); -+ -+/** -+ * Return codec bits per sample. -+ * Only return non-zero if the bits per sample is exactly correct, not an -+ * approximation. -+ * -+ * @param[in] codec_id the codec -+ * @return Number of bits per sample or zero if unknown for the given codec. -+ */ -+int av_get_exact_bits_per_sample(enum AVCodecID codec_id); -+ -+/** -+ * Return a name for the specified profile, if available. -+ * -+ * @param codec_id the ID of the codec to which the requested profile belongs -+ * @param profile the profile value for which a name is requested -+ * @return A name for the profile if found, NULL otherwise. -+ * -+ * @note unlike av_get_profile_name(), which searches a list of profiles -+ * supported by a specific decoder or encoder implementation, this -+ * function searches the list of profiles from the AVCodecDescriptor -+ */ -+const char* avcodec_profile_name(enum AVCodecID codec_id, int profile); -+ -+/** -+ * Return the PCM codec associated with a sample format. -+ * @param be endianness, 0 for little, 1 for big, -+ * -1 (or anything else) for native -+ * @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE -+ */ -+enum AVCodecID av_get_pcm_codec(enum AVSampleFormat fmt, int be); -+ -+/** -+ * @} -+ */ -+ -+#endif // AVCODEC_CODEC_ID_H -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec_par.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec_par.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/codec_par.h -@@ -0,0 +1,236 @@ -+/* -+ * Codec parameters public API -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef AVCODEC_CODEC_PAR_H -+#define AVCODEC_CODEC_PAR_H -+ -+#include -+ -+#include "libavutil/avutil.h" -+#include "libavutil/rational.h" -+#include "libavutil/pixfmt.h" -+ -+#include "codec_id.h" -+ -+/** -+ * @addtogroup lavc_core -+ */ -+ -+enum AVFieldOrder { -+ AV_FIELD_UNKNOWN, -+ AV_FIELD_PROGRESSIVE, -+ AV_FIELD_TT, //< Top coded_first, top displayed first -+ AV_FIELD_BB, //< Bottom coded first, bottom displayed first -+ AV_FIELD_TB, //< Top coded first, bottom displayed first -+ AV_FIELD_BT, //< Bottom coded first, top displayed first -+}; -+ -+/** -+ * This struct describes the properties of an encoded stream. -+ * -+ * sizeof(AVCodecParameters) is not a part of the public ABI, this struct must -+ * be allocated with avcodec_parameters_alloc() and freed with -+ * avcodec_parameters_free(). -+ */ -+typedef struct AVCodecParameters { -+ /** -+ * General type of the encoded data. -+ */ -+ enum AVMediaType codec_type; -+ /** -+ * Specific type of the encoded data (the codec used). -+ */ -+ enum AVCodecID codec_id; -+ /** -+ * Additional information about the codec (corresponds to the AVI FOURCC). -+ */ -+ uint32_t codec_tag; -+ -+ /** -+ * Extra binary data needed for initializing the decoder, codec-dependent. -+ * -+ * Must be allocated with av_malloc() and will be freed by -+ * avcodec_parameters_free(). The allocated size of extradata must be at -+ * least extradata_size + AV_INPUT_BUFFER_PADDING_SIZE, with the padding -+ * bytes zeroed. -+ */ -+ uint8_t* extradata; -+ /** -+ * Size of the extradata content in bytes. -+ */ -+ int extradata_size; -+ -+ /** -+ * - video: the pixel format, the value corresponds to enum AVPixelFormat. -+ * - audio: the sample format, the value corresponds to enum AVSampleFormat. -+ */ -+ int format; -+ -+ /** -+ * The average bitrate of the encoded data (in bits per second). -+ */ -+ int64_t bit_rate; -+ -+ /** -+ * The number of bits per sample in the codedwords. -+ * -+ * This is basically the bitrate per sample. It is mandatory for a bunch of -+ * formats to actually decode them. It's the number of bits for one sample in -+ * the actual coded bitstream. -+ * -+ * This could be for example 4 for ADPCM -+ * For PCM formats this matches bits_per_raw_sample -+ * Can be 0 -+ */ -+ int bits_per_coded_sample; -+ -+ /** -+ * This is the number of valid bits in each output sample. If the -+ * sample format has more bits, the least significant bits are additional -+ * padding bits, which are always 0. Use right shifts to reduce the sample -+ * to its actual size. For example, audio formats with 24 bit samples will -+ * have bits_per_raw_sample set to 24, and format set to AV_SAMPLE_FMT_S32. -+ * To get the original sample use "(int32_t)sample >> 8"." -+ * -+ * For ADPCM this might be 12 or 16 or similar -+ * Can be 0 -+ */ -+ int bits_per_raw_sample; -+ -+ /** -+ * Codec-specific bitstream restrictions that the stream conforms to. -+ */ -+ int profile; -+ int level; -+ -+ /** -+ * Video only. The dimensions of the video frame in pixels. -+ */ -+ int width; -+ int height; -+ -+ /** -+ * Video only. The aspect ratio (width / height) which a single pixel -+ * should have when displayed. -+ * -+ * When the aspect ratio is unknown / undefined, the numerator should be -+ * set to 0 (the denominator may have any value). -+ */ -+ AVRational sample_aspect_ratio; -+ -+ /** -+ * Video only. The order of the fields in interlaced video. -+ */ -+ enum AVFieldOrder field_order; -+ -+ /** -+ * Video only. Additional colorspace characteristics. -+ */ -+ enum AVColorRange color_range; -+ enum AVColorPrimaries color_primaries; -+ enum AVColorTransferCharacteristic color_trc; -+ enum AVColorSpace color_space; -+ enum AVChromaLocation chroma_location; -+ -+ /** -+ * Video only. Number of delayed frames. -+ */ -+ int video_delay; -+ -+ /** -+ * Audio only. The channel layout bitmask. May be 0 if the channel layout is -+ * unknown or unspecified, otherwise the number of bits set must be equal to -+ * the channels field. -+ */ -+ uint64_t channel_layout; -+ /** -+ * Audio only. The number of audio channels. -+ */ -+ int channels; -+ /** -+ * Audio only. The number of audio samples per second. -+ */ -+ int sample_rate; -+ /** -+ * Audio only. The number of bytes per coded audio frame, required by some -+ * formats. -+ * -+ * Corresponds to nBlockAlign in WAVEFORMATEX. -+ */ -+ int block_align; -+ /** -+ * Audio only. Audio frame size, if known. Required by some formats to be -+ * static. -+ */ -+ int frame_size; -+ -+ /** -+ * Audio only. The amount of padding (in samples) inserted by the encoder at -+ * the beginning of the audio. I.e. this number of leading decoded samples -+ * must be discarded by the caller to get the original audio without leading -+ * padding. -+ */ -+ int initial_padding; -+ /** -+ * Audio only. The amount of padding (in samples) appended by the encoder to -+ * the end of the audio. I.e. this number of decoded samples must be -+ * discarded by the caller from the end of the stream to get the original -+ * audio without any trailing padding. -+ */ -+ int trailing_padding; -+ /** -+ * Audio only. Number of samples to skip after a discontinuity. -+ */ -+ int seek_preroll; -+} AVCodecParameters; -+ -+/** -+ * Allocate a new AVCodecParameters and set its fields to default values -+ * (unknown/invalid/0). The returned struct must be freed with -+ * avcodec_parameters_free(). -+ */ -+AVCodecParameters* avcodec_parameters_alloc(void); -+ -+/** -+ * Free an AVCodecParameters instance and everything associated with it and -+ * write NULL to the supplied pointer. -+ */ -+void avcodec_parameters_free(AVCodecParameters** par); -+ -+/** -+ * Copy the contents of src to dst. Any allocated fields in dst are freed and -+ * replaced with newly allocated duplicates of the corresponding fields in src. -+ * -+ * @return >= 0 on success, a negative AVERROR code on failure. -+ */ -+int avcodec_parameters_copy(AVCodecParameters* dst, -+ const AVCodecParameters* src); -+ -+/** -+ * This function is the same as av_get_audio_frame_duration(), except it works -+ * with AVCodecParameters instead of an AVCodecContext. -+ */ -+int av_get_audio_frame_duration2(AVCodecParameters* par, int frame_bytes); -+ -+/** -+ * @} -+ */ -+ -+#endif // AVCODEC_CODEC_PAR_H -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/defs.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/defs.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/defs.h -@@ -0,0 +1,171 @@ -+/* -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef AVCODEC_DEFS_H -+#define AVCODEC_DEFS_H -+ -+/** -+ * @file -+ * @ingroup libavc -+ * Misc types and constants that do not belong anywhere else. -+ */ -+ -+#include -+#include -+ -+/** -+ * @ingroup lavc_decoding -+ * Required number of additionally allocated bytes at the end of the input -+ * bitstream for decoding. This is mainly needed because some optimized -+ * bitstream readers read 32 or 64 bit at once and could read over the end.
-+ * Note: If the first 23 bits of the additional bytes are not 0, then damaged -+ * MPEG bitstreams could cause overread and segfault. -+ */ -+#define AV_INPUT_BUFFER_PADDING_SIZE 64 -+ -+/** -+ * @ingroup lavc_decoding -+ */ -+enum AVDiscard { -+ /* We leave some space between them for extensions (drop some -+ * keyframes for intra-only or drop just some bidir frames). */ -+ AVDISCARD_NONE = -16, ///< discard nothing -+ AVDISCARD_DEFAULT = -+ 0, ///< discard useless packets like 0 size packets in avi -+ AVDISCARD_NONREF = 8, ///< discard all non reference -+ AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames -+ AVDISCARD_NONINTRA = 24, ///< discard all non intra frames -+ AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes -+ AVDISCARD_ALL = 48, ///< discard all -+}; -+ -+enum AVAudioServiceType { -+ AV_AUDIO_SERVICE_TYPE_MAIN = 0, -+ AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, -+ AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, -+ AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, -+ AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, -+ AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, -+ AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, -+ AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, -+ AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, -+ AV_AUDIO_SERVICE_TYPE_NB, ///< Not part of ABI -+}; -+ -+/** -+ * Pan Scan area. -+ * This specifies the area which should be displayed. -+ * Note there may be multiple such areas for one frame. -+ */ -+typedef struct AVPanScan { -+ /** -+ * id -+ * - encoding: Set by user. -+ * - decoding: Set by libavcodec. -+ */ -+ int id; -+ -+ /** -+ * width and height in 1/16 pel -+ * - encoding: Set by user. -+ * - decoding: Set by libavcodec. -+ */ -+ int width; -+ int height; -+ -+ /** -+ * position of the top left corner in 1/16 pel for up to 3 fields/frames -+ * - encoding: Set by user. -+ * - decoding: Set by libavcodec. -+ */ -+ int16_t position[3][2]; -+} AVPanScan; -+ -+/** -+ * This structure describes the bitrate properties of an encoded bitstream. It -+ * roughly corresponds to a subset the VBV parameters for MPEG-2 or HRD -+ * parameters for H.264/HEVC. -+ */ -+typedef struct AVCPBProperties { -+ /** -+ * Maximum bitrate of the stream, in bits per second. -+ * Zero if unknown or unspecified. -+ */ -+ int64_t max_bitrate; -+ /** -+ * Minimum bitrate of the stream, in bits per second. -+ * Zero if unknown or unspecified. -+ */ -+ int64_t min_bitrate; -+ /** -+ * Average bitrate of the stream, in bits per second. -+ * Zero if unknown or unspecified. -+ */ -+ int64_t avg_bitrate; -+ -+ /** -+ * The size of the buffer to which the ratecontrol is applied, in bits. -+ * Zero if unknown or unspecified. -+ */ -+ int64_t buffer_size; -+ -+ /** -+ * The delay between the time the packet this structure is associated with -+ * is received and the time when it should be decoded, in periods of a 27MHz -+ * clock. -+ * -+ * UINT64_MAX when unknown or unspecified. -+ */ -+ uint64_t vbv_delay; -+} AVCPBProperties; -+ -+/** -+ * Allocate a CPB properties structure and initialize its fields to default -+ * values. -+ * -+ * @param size if non-NULL, the size of the allocated struct will be written -+ * here. This is useful for embedding it in side data. -+ * -+ * @return the newly allocated struct or NULL on failure -+ */ -+AVCPBProperties* av_cpb_properties_alloc(size_t* size); -+ -+/** -+ * This structure supplies correlation between a packet timestamp and a wall -+ * clock production time. The definition follows the Producer Reference Time -+ * ('prft') as defined in ISO/IEC 14496-12 -+ */ -+typedef struct AVProducerReferenceTime { -+ /** -+ * A UTC timestamp, in microseconds, since Unix epoch (e.g, av_gettime()). -+ */ -+ int64_t wallclock; -+ int flags; -+} AVProducerReferenceTime; -+ -+/** -+ * Encode extradata length to a buffer. Used by xiph codecs. -+ * -+ * @param s buffer to write to; must be at least (v/255+1) bytes long -+ * @param v size of extradata in bytes -+ * @return number of bytes written to the buffer. -+ */ -+unsigned int av_xiphlacing(unsigned char* s, unsigned int v); -+ -+#endif // AVCODEC_DEFS_H -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/packet.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/packet.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/packet.h -@@ -0,0 +1,724 @@ -+/* -+ * AVPacket public API -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef AVCODEC_PACKET_H -+#define AVCODEC_PACKET_H -+ -+#include -+#include -+ -+#include "libavutil/attributes.h" -+#include "libavutil/buffer.h" -+#include "libavutil/dict.h" -+#include "libavutil/rational.h" -+ -+#include "libavcodec/version.h" -+ -+/** -+ * @defgroup lavc_packet AVPacket -+ * -+ * Types and functions for working with AVPacket. -+ * @{ -+ */ -+enum AVPacketSideDataType { -+ /** -+ * An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE -+ * bytes worth of palette. This side data signals that a new palette is -+ * present. -+ */ -+ AV_PKT_DATA_PALETTE, -+ -+ /** -+ * The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format -+ * that the extradata buffer was changed and the receiving side should -+ * act upon it appropriately. The new extradata is embedded in the side -+ * data buffer and should be immediately used for processing the current -+ * frame or packet. -+ */ -+ AV_PKT_DATA_NEW_EXTRADATA, -+ -+ /** -+ * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: -+ * @code -+ * u32le param_flags -+ * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) -+ * s32le channel_count -+ * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) -+ * u64le channel_layout -+ * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) -+ * s32le sample_rate -+ * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) -+ * s32le width -+ * s32le height -+ * @endcode -+ */ -+ AV_PKT_DATA_PARAM_CHANGE, -+ -+ /** -+ * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of -+ * structures with info about macroblocks relevant to splitting the -+ * packet into smaller packets on macroblock edges (e.g. as for RFC 2190). -+ * That is, it does not necessarily contain info about all macroblocks, -+ * as long as the distance between macroblocks in the info is smaller -+ * than the target payload size. -+ * Each MB info structure is 12 bytes, and is laid out as follows: -+ * @code -+ * u32le bit offset from the start of the packet -+ * u8 current quantizer at the start of the macroblock -+ * u8 GOB number -+ * u16le macroblock address within the GOB -+ * u8 horizontal MV predictor -+ * u8 vertical MV predictor -+ * u8 horizontal MV predictor for block number 3 -+ * u8 vertical MV predictor for block number 3 -+ * @endcode -+ */ -+ AV_PKT_DATA_H263_MB_INFO, -+ -+ /** -+ * This side data should be associated with an audio stream and contains -+ * ReplayGain information in form of the AVReplayGain struct. -+ */ -+ AV_PKT_DATA_REPLAYGAIN, -+ -+ /** -+ * This side data contains a 3x3 transformation matrix describing an affine -+ * transformation that needs to be applied to the decoded video frames for -+ * correct presentation. -+ * -+ * See libavutil/display.h for a detailed description of the data. -+ */ -+ AV_PKT_DATA_DISPLAYMATRIX, -+ -+ /** -+ * This side data should be associated with a video stream and contains -+ * Stereoscopic 3D information in form of the AVStereo3D struct. -+ */ -+ AV_PKT_DATA_STEREO3D, -+ -+ /** -+ * This side data should be associated with an audio stream and corresponds -+ * to enum AVAudioServiceType. -+ */ -+ AV_PKT_DATA_AUDIO_SERVICE_TYPE, -+ -+ /** -+ * This side data contains quality related information from the encoder. -+ * @code -+ * u32le quality factor of the compressed frame. Allowed range is between 1 -+ * (good) and FF_LAMBDA_MAX (bad). u8 picture type u8 error count u16 -+ * reserved u64le[error count] sum of squared differences between encoder in -+ * and output -+ * @endcode -+ */ -+ AV_PKT_DATA_QUALITY_STATS, -+ -+ /** -+ * This side data contains an integer value representing the stream index -+ * of a "fallback" track. A fallback track indicates an alternate -+ * track to use when the current track can not be decoded for some reason. -+ * e.g. no decoder available for codec. -+ */ -+ AV_PKT_DATA_FALLBACK_TRACK, -+ -+ /** -+ * This side data corresponds to the AVCPBProperties struct. -+ */ -+ AV_PKT_DATA_CPB_PROPERTIES, -+ -+ /** -+ * Recommmends skipping the specified number of samples -+ * @code -+ * u32le number of samples to skip from start of this packet -+ * u32le number of samples to skip from end of this packet -+ * u8 reason for start skip -+ * u8 reason for end skip (0=padding silence, 1=convergence) -+ * @endcode -+ */ -+ AV_PKT_DATA_SKIP_SAMPLES, -+ -+ /** -+ * An AV_PKT_DATA_JP_DUALMONO side data packet indicates that -+ * the packet may contain "dual mono" audio specific to Japanese DTV -+ * and if it is true, recommends only the selected channel to be used. -+ * @code -+ * u8 selected channels (0=mail/left, 1=sub/right, 2=both) -+ * @endcode -+ */ -+ AV_PKT_DATA_JP_DUALMONO, -+ -+ /** -+ * A list of zero terminated key/value strings. There is no end marker for -+ * the list, so it is required to rely on the side data size to stop. -+ */ -+ AV_PKT_DATA_STRINGS_METADATA, -+ -+ /** -+ * Subtitle event position -+ * @code -+ * u32le x1 -+ * u32le y1 -+ * u32le x2 -+ * u32le y2 -+ * @endcode -+ */ -+ AV_PKT_DATA_SUBTITLE_POSITION, -+ -+ /** -+ * Data found in BlockAdditional element of matroska container. There is -+ * no end marker for the data, so it is required to rely on the side data -+ * size to recognize the end. 8 byte id (as found in BlockAddId) followed -+ * by data. -+ */ -+ AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, -+ -+ /** -+ * The optional first identifier line of a WebVTT cue. -+ */ -+ AV_PKT_DATA_WEBVTT_IDENTIFIER, -+ -+ /** -+ * The optional settings (rendering instructions) that immediately -+ * follow the timestamp specifier of a WebVTT cue. -+ */ -+ AV_PKT_DATA_WEBVTT_SETTINGS, -+ -+ /** -+ * A list of zero terminated key/value strings. There is no end marker for -+ * the list, so it is required to rely on the side data size to stop. This -+ * side data includes updated metadata which appeared in the stream. -+ */ -+ AV_PKT_DATA_METADATA_UPDATE, -+ -+ /** -+ * MPEGTS stream ID as uint8_t, this is required to pass the stream ID -+ * information from the demuxer to the corresponding muxer. -+ */ -+ AV_PKT_DATA_MPEGTS_STREAM_ID, -+ -+ /** -+ * Mastering display metadata (based on SMPTE-2086:2014). This metadata -+ * should be associated with a video stream and contains data in the form -+ * of the AVMasteringDisplayMetadata struct. -+ */ -+ AV_PKT_DATA_MASTERING_DISPLAY_METADATA, -+ -+ /** -+ * This side data should be associated with a video stream and corresponds -+ * to the AVSphericalMapping structure. -+ */ -+ AV_PKT_DATA_SPHERICAL, -+ -+ /** -+ * Content light level (based on CTA-861.3). This metadata should be -+ * associated with a video stream and contains data in the form of the -+ * AVContentLightMetadata struct. -+ */ -+ AV_PKT_DATA_CONTENT_LIGHT_LEVEL, -+ -+ /** -+ * ATSC A53 Part 4 Closed Captions. This metadata should be associated with -+ * a video stream. A53 CC bitstream is stored as uint8_t in -+ * AVPacketSideData.data. The number of bytes of CC data is -+ * AVPacketSideData.size. -+ */ -+ AV_PKT_DATA_A53_CC, -+ -+ /** -+ * This side data is encryption initialization data. -+ * The format is not part of ABI, use av_encryption_init_info_* methods to -+ * access. -+ */ -+ AV_PKT_DATA_ENCRYPTION_INIT_INFO, -+ -+ /** -+ * This side data contains encryption info for how to decrypt the packet. -+ * The format is not part of ABI, use av_encryption_info_* methods to access. -+ */ -+ AV_PKT_DATA_ENCRYPTION_INFO, -+ -+ /** -+ * Active Format Description data consisting of a single byte as specified -+ * in ETSI TS 101 154 using AVActiveFormatDescription enum. -+ */ -+ AV_PKT_DATA_AFD, -+ -+ /** -+ * Producer Reference Time data corresponding to the AVProducerReferenceTime -+ * struct, usually exported by some encoders (on demand through the prft flag -+ * set in the AVCodecContext export_side_data field). -+ */ -+ AV_PKT_DATA_PRFT, -+ -+ /** -+ * ICC profile data consisting of an opaque octet buffer following the -+ * format described by ISO 15076-1. -+ */ -+ AV_PKT_DATA_ICC_PROFILE, -+ -+ /** -+ * DOVI configuration -+ * ref: -+ * dolby-vision-bitstreams-within-the-iso-base-media-file-format-v2.1.2, -+ * section 2.2 -+ * dolby-vision-bitstreams-in-mpeg-2-transport-stream-multiplex-v1.2, -+ * section 3.3 Tags are stored in struct AVDOVIDecoderConfigurationRecord. -+ */ -+ AV_PKT_DATA_DOVI_CONF, -+ -+ /** -+ * Timecode which conforms to SMPTE ST 12-1:2014. The data is an array of 4 -+ * uint32_t where the first uint32_t describes how many (1-3) of the other -+ * timecodes are used. The timecode format is described in the documentation -+ * of av_timecode_get_smpte_from_framenum() function in libavutil/timecode.h. -+ */ -+ AV_PKT_DATA_S12M_TIMECODE, -+ -+ /** -+ * HDR10+ dynamic metadata associated with a video frame. The metadata is in -+ * the form of the AVDynamicHDRPlus struct and contains -+ * information for color volume transform - application 4 of -+ * SMPTE 2094-40:2016 standard. -+ */ -+ AV_PKT_DATA_DYNAMIC_HDR10_PLUS, -+ -+ /** -+ * The number of side data types. -+ * This is not part of the public API/ABI in the sense that it may -+ * change when new side data types are added. -+ * This must stay the last enum value. -+ * If its value becomes huge, some code using it -+ * needs to be updated as it assumes it to be smaller than other limits. -+ */ -+ AV_PKT_DATA_NB -+}; -+ -+#define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS // DEPRECATED -+ -+typedef struct AVPacketSideData { -+ uint8_t* data; -+ size_t size; -+ enum AVPacketSideDataType type; -+} AVPacketSideData; -+ -+/** -+ * This structure stores compressed data. It is typically exported by demuxers -+ * and then passed as input to decoders, or received as output from encoders and -+ * then passed to muxers. -+ * -+ * For video, it should typically contain one compressed frame. For audio it may -+ * contain several compressed frames. Encoders are allowed to output empty -+ * packets, with no compressed data, containing only side data -+ * (e.g. to update some stream parameters at the end of encoding). -+ * -+ * The semantics of data ownership depends on the buf field. -+ * If it is set, the packet data is dynamically allocated and is -+ * valid indefinitely until a call to av_packet_unref() reduces the -+ * reference count to 0. -+ * -+ * If the buf field is not set av_packet_ref() would make a copy instead -+ * of increasing the reference count. -+ * -+ * The side data is always allocated with av_malloc(), copied by -+ * av_packet_ref() and freed by av_packet_unref(). -+ * -+ * sizeof(AVPacket) being a part of the public ABI is deprecated. once -+ * av_init_packet() is removed, new packets will only be able to be allocated -+ * with av_packet_alloc(), and new fields may be added to the end of the struct -+ * with a minor bump. -+ * -+ * @see av_packet_alloc -+ * @see av_packet_ref -+ * @see av_packet_unref -+ */ -+typedef struct AVPacket { -+ /** -+ * A reference to the reference-counted buffer where the packet data is -+ * stored. -+ * May be NULL, then the packet data is not reference-counted. -+ */ -+ AVBufferRef* buf; -+ /** -+ * Presentation timestamp in AVStream->time_base units; the time at which -+ * the decompressed packet will be presented to the user. -+ * Can be AV_NOPTS_VALUE if it is not stored in the file. -+ * pts MUST be larger or equal to dts as presentation cannot happen before -+ * decompression, unless one wants to view hex dumps. Some formats misuse -+ * the terms dts and pts/cts to mean something different. Such timestamps -+ * must be converted to true pts/dts before they are stored in AVPacket. -+ */ -+ int64_t pts; -+ /** -+ * Decompression timestamp in AVStream->time_base units; the time at which -+ * the packet is decompressed. -+ * Can be AV_NOPTS_VALUE if it is not stored in the file. -+ */ -+ int64_t dts; -+ uint8_t* data; -+ int size; -+ int stream_index; -+ /** -+ * A combination of AV_PKT_FLAG values -+ */ -+ int flags; -+ /** -+ * Additional packet data that can be provided by the container. -+ * Packet can contain several types of side information. -+ */ -+ AVPacketSideData* side_data; -+ int side_data_elems; -+ -+ /** -+ * Duration of this packet in AVStream->time_base units, 0 if unknown. -+ * Equals next_pts - this_pts in presentation order. -+ */ -+ int64_t duration; -+ -+ int64_t pos; ///< byte position in stream, -1 if unknown -+ -+ /** -+ * for some private data of the user -+ */ -+ void* opaque; -+ -+ /** -+ * AVBufferRef for free use by the API user. FFmpeg will never check the -+ * contents of the buffer ref. FFmpeg calls av_buffer_unref() on it when -+ * the packet is unreferenced. av_packet_copy_props() calls create a new -+ * reference with av_buffer_ref() for the target packet's opaque_ref field. -+ * -+ * This is unrelated to the opaque field, although it serves a similar -+ * purpose. -+ */ -+ AVBufferRef* opaque_ref; -+ -+ /** -+ * Time base of the packet's timestamps. -+ * In the future, this field may be set on packets output by encoders or -+ * demuxers, but its value will be by default ignored on input to decoders -+ * or muxers. -+ */ -+ AVRational time_base; -+} AVPacket; -+ -+#if FF_API_INIT_PACKET -+attribute_deprecated typedef struct AVPacketList { -+ AVPacket pkt; -+ struct AVPacketList* next; -+} AVPacketList; -+#endif -+ -+#define AV_PKT_FLAG_KEY 0x0001 ///< The packet contains a keyframe -+#define AV_PKT_FLAG_CORRUPT 0x0002 ///< The packet content is corrupted -+/** -+ * Flag is used to discard packets which are required to maintain valid -+ * decoder state but are not required for output and should be dropped -+ * after decoding. -+ **/ -+#define AV_PKT_FLAG_DISCARD 0x0004 -+/** -+ * The packet comes from a trusted source. -+ * -+ * Otherwise-unsafe constructs such as arbitrary pointers to data -+ * outside the packet may be followed. -+ */ -+#define AV_PKT_FLAG_TRUSTED 0x0008 -+/** -+ * Flag is used to indicate packets that contain frames that can -+ * be discarded by the decoder. I.e. Non-reference frames. -+ */ -+#define AV_PKT_FLAG_DISPOSABLE 0x0010 -+ -+enum AVSideDataParamChangeFlags { -+ AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001, -+ AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002, -+ AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004, -+ AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008, -+}; -+ -+/** -+ * Allocate an AVPacket and set its fields to default values. The resulting -+ * struct must be freed using av_packet_free(). -+ * -+ * @return An AVPacket filled with default values or NULL on failure. -+ * -+ * @note this only allocates the AVPacket itself, not the data buffers. Those -+ * must be allocated through other means such as av_new_packet. -+ * -+ * @see av_new_packet -+ */ -+AVPacket* av_packet_alloc(void); -+ -+/** -+ * Create a new packet that references the same data as src. -+ * -+ * This is a shortcut for av_packet_alloc()+av_packet_ref(). -+ * -+ * @return newly created AVPacket on success, NULL on error. -+ * -+ * @see av_packet_alloc -+ * @see av_packet_ref -+ */ -+AVPacket* av_packet_clone(const AVPacket* src); -+ -+/** -+ * Free the packet, if the packet is reference counted, it will be -+ * unreferenced first. -+ * -+ * @param pkt packet to be freed. The pointer will be set to NULL. -+ * @note passing NULL is a no-op. -+ */ -+void av_packet_free(AVPacket** pkt); -+ -+#if FF_API_INIT_PACKET -+/** -+ * Initialize optional fields of a packet with default values. -+ * -+ * Note, this does not touch the data and size members, which have to be -+ * initialized separately. -+ * -+ * @param pkt packet -+ * -+ * @see av_packet_alloc -+ * @see av_packet_unref -+ * -+ * @deprecated This function is deprecated. Once it's removed, -+ sizeof(AVPacket) will not be a part of the ABI anymore. -+ */ -+attribute_deprecated void av_init_packet(AVPacket* pkt); -+#endif -+ -+/** -+ * Allocate the payload of a packet and initialize its fields with -+ * default values. -+ * -+ * @param pkt packet -+ * @param size wanted payload size -+ * @return 0 if OK, AVERROR_xxx otherwise -+ */ -+int av_new_packet(AVPacket* pkt, int size); -+ -+/** -+ * Reduce packet size, correctly zeroing padding -+ * -+ * @param pkt packet -+ * @param size new size -+ */ -+void av_shrink_packet(AVPacket* pkt, int size); -+ -+/** -+ * Increase packet size, correctly zeroing padding -+ * -+ * @param pkt packet -+ * @param grow_by number of bytes by which to increase the size of the packet -+ */ -+int av_grow_packet(AVPacket* pkt, int grow_by); -+ -+/** -+ * Initialize a reference-counted packet from av_malloc()ed data. -+ * -+ * @param pkt packet to be initialized. This function will set the data, size, -+ * and buf fields, all others are left untouched. -+ * @param data Data allocated by av_malloc() to be used as packet data. If this -+ * function returns successfully, the data is owned by the underlying -+ * AVBuffer. The caller may not access the data through other means. -+ * @param size size of data in bytes, without the padding. I.e. the full buffer -+ * size is assumed to be size + AV_INPUT_BUFFER_PADDING_SIZE. -+ * -+ * @return 0 on success, a negative AVERROR on error -+ */ -+int av_packet_from_data(AVPacket* pkt, uint8_t* data, int size); -+ -+/** -+ * Allocate new information of a packet. -+ * -+ * @param pkt packet -+ * @param type side information type -+ * @param size side information size -+ * @return pointer to fresh allocated data or NULL otherwise -+ */ -+uint8_t* av_packet_new_side_data(AVPacket* pkt, enum AVPacketSideDataType type, -+ size_t size); -+ -+/** -+ * Wrap an existing array as a packet side data. -+ * -+ * @param pkt packet -+ * @param type side information type -+ * @param data the side data array. It must be allocated with the av_malloc() -+ * family of functions. The ownership of the data is transferred to -+ * pkt. -+ * @param size side information size -+ * @return a non-negative number on success, a negative AVERROR code on -+ * failure. On failure, the packet is unchanged and the data remains -+ * owned by the caller. -+ */ -+int av_packet_add_side_data(AVPacket* pkt, enum AVPacketSideDataType type, -+ uint8_t* data, size_t size); -+ -+/** -+ * Shrink the already allocated side data buffer -+ * -+ * @param pkt packet -+ * @param type side information type -+ * @param size new side information size -+ * @return 0 on success, < 0 on failure -+ */ -+int av_packet_shrink_side_data(AVPacket* pkt, enum AVPacketSideDataType type, -+ size_t size); -+ -+/** -+ * Get side information from packet. -+ * -+ * @param pkt packet -+ * @param type desired side information type -+ * @param size If supplied, *size will be set to the size of the side data -+ * or to zero if the desired side data is not present. -+ * @return pointer to data if present or NULL otherwise -+ */ -+uint8_t* av_packet_get_side_data(const AVPacket* pkt, -+ enum AVPacketSideDataType type, size_t* size); -+ -+const char* av_packet_side_data_name(enum AVPacketSideDataType type); -+ -+/** -+ * Pack a dictionary for use in side_data. -+ * -+ * @param dict The dictionary to pack. -+ * @param size pointer to store the size of the returned data -+ * @return pointer to data if successful, NULL otherwise -+ */ -+uint8_t* av_packet_pack_dictionary(AVDictionary* dict, size_t* size); -+/** -+ * Unpack a dictionary from side_data. -+ * -+ * @param data data from side_data -+ * @param size size of the data -+ * @param dict the metadata storage dictionary -+ * @return 0 on success, < 0 on failure -+ */ -+int av_packet_unpack_dictionary(const uint8_t* data, size_t size, -+ AVDictionary** dict); -+ -+/** -+ * Convenience function to free all the side data stored. -+ * All the other fields stay untouched. -+ * -+ * @param pkt packet -+ */ -+void av_packet_free_side_data(AVPacket* pkt); -+ -+/** -+ * Setup a new reference to the data described by a given packet -+ * -+ * If src is reference-counted, setup dst as a new reference to the -+ * buffer in src. Otherwise allocate a new buffer in dst and copy the -+ * data from src into it. -+ * -+ * All the other fields are copied from src. -+ * -+ * @see av_packet_unref -+ * -+ * @param dst Destination packet. Will be completely overwritten. -+ * @param src Source packet -+ * -+ * @return 0 on success, a negative AVERROR on error. On error, dst -+ * will be blank (as if returned by av_packet_alloc()). -+ */ -+int av_packet_ref(AVPacket* dst, const AVPacket* src); -+ -+/** -+ * Wipe the packet. -+ * -+ * Unreference the buffer referenced by the packet and reset the -+ * remaining packet fields to their default values. -+ * -+ * @param pkt The packet to be unreferenced. -+ */ -+void av_packet_unref(AVPacket* pkt); -+ -+/** -+ * Move every field in src to dst and reset src. -+ * -+ * @see av_packet_unref -+ * -+ * @param src Source packet, will be reset -+ * @param dst Destination packet -+ */ -+void av_packet_move_ref(AVPacket* dst, AVPacket* src); -+ -+/** -+ * Copy only "properties" fields from src to dst. -+ * -+ * Properties for the purpose of this function are all the fields -+ * beside those related to the packet data (buf, data, size) -+ * -+ * @param dst Destination packet -+ * @param src Source packet -+ * -+ * @return 0 on success AVERROR on failure. -+ */ -+int av_packet_copy_props(AVPacket* dst, const AVPacket* src); -+ -+/** -+ * Ensure the data described by a given packet is reference counted. -+ * -+ * @note This function does not ensure that the reference will be writable. -+ * Use av_packet_make_writable instead for that purpose. -+ * -+ * @see av_packet_ref -+ * @see av_packet_make_writable -+ * -+ * @param pkt packet whose data should be made reference counted. -+ * -+ * @return 0 on success, a negative AVERROR on error. On failure, the -+ * packet is unchanged. -+ */ -+int av_packet_make_refcounted(AVPacket* pkt); -+ -+/** -+ * Create a writable reference for the data described by a given packet, -+ * avoiding data copy if possible. -+ * -+ * @param pkt Packet whose data should be made writable. -+ * -+ * @return 0 on success, a negative AVERROR on failure. On failure, the -+ * packet is unchanged. -+ */ -+int av_packet_make_writable(AVPacket* pkt); -+ -+/** -+ * Convert valid timing fields (timestamps / durations) in a packet from one -+ * timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be -+ * ignored. -+ * -+ * @param pkt packet on which the conversion will be performed -+ * @param tb_src source timebase, in which the timing fields in pkt are -+ * expressed -+ * @param tb_dst destination timebase, to which the timing fields will be -+ * converted -+ */ -+void av_packet_rescale_ts(AVPacket* pkt, AVRational tb_src, AVRational tb_dst); -+ -+/** -+ * @} -+ */ -+ -+#endif // AVCODEC_PACKET_H -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/vdpau.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/vdpau.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/vdpau.h -@@ -0,0 +1,156 @@ -+/* -+ * The Video Decode and Presentation API for UNIX (VDPAU) is used for -+ * hardware-accelerated decoding of MPEG-1/2, H.264 and VC-1. -+ * -+ * Copyright (C) 2008 NVIDIA -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef AVCODEC_VDPAU_H -+#define AVCODEC_VDPAU_H -+ -+/** -+ * @file -+ * @ingroup lavc_codec_hwaccel_vdpau -+ * Public libavcodec VDPAU header. -+ */ -+ -+/** -+ * @defgroup lavc_codec_hwaccel_vdpau VDPAU Decoder and Renderer -+ * @ingroup lavc_codec_hwaccel -+ * -+ * VDPAU hardware acceleration has two modules -+ * - VDPAU decoding -+ * - VDPAU presentation -+ * -+ * The VDPAU decoding module parses all headers using FFmpeg -+ * parsing mechanisms and uses VDPAU for the actual decoding. -+ * -+ * As per the current implementation, the actual decoding -+ * and rendering (API calls) are done as part of the VDPAU -+ * presentation (vo_vdpau.c) module. -+ * -+ * @{ -+ */ -+ -+#include -+ -+#include "libavutil/avconfig.h" -+#include "libavutil/attributes.h" -+ -+#include "avcodec.h" -+ -+struct AVCodecContext; -+struct AVFrame; -+ -+typedef int (*AVVDPAU_Render2)(struct AVCodecContext*, struct AVFrame*, -+ const VdpPictureInfo*, uint32_t, -+ const VdpBitstreamBuffer*); -+ -+/** -+ * This structure is used to share data between the libavcodec library and -+ * the client video application. -+ * The user shall allocate the structure via the av_alloc_vdpau_hwaccel -+ * function and make it available as -+ * AVCodecContext.hwaccel_context. Members can be set by the user once -+ * during initialization or through each AVCodecContext.get_buffer() -+ * function call. In any case, they must be valid prior to calling -+ * decoding functions. -+ * -+ * The size of this structure is not a part of the public ABI and must not -+ * be used outside of libavcodec. Use av_vdpau_alloc_context() to allocate an -+ * AVVDPAUContext. -+ */ -+typedef struct AVVDPAUContext { -+ /** -+ * VDPAU decoder handle -+ * -+ * Set by user. -+ */ -+ VdpDecoder decoder; -+ -+ /** -+ * VDPAU decoder render callback -+ * -+ * Set by the user. -+ */ -+ VdpDecoderRender* render; -+ -+ AVVDPAU_Render2 render2; -+} AVVDPAUContext; -+ -+/** -+ * @brief allocation function for AVVDPAUContext -+ * -+ * Allows extending the struct without breaking API/ABI -+ */ -+AVVDPAUContext* av_alloc_vdpaucontext(void); -+ -+AVVDPAU_Render2 av_vdpau_hwaccel_get_render2(const AVVDPAUContext*); -+void av_vdpau_hwaccel_set_render2(AVVDPAUContext*, AVVDPAU_Render2); -+ -+/** -+ * Associate a VDPAU device with a codec context for hardware acceleration. -+ * This function is meant to be called from the get_format() codec callback, -+ * or earlier. It can also be called after avcodec_flush_buffers() to change -+ * the underlying VDPAU device mid-stream (e.g. to recover from non-transparent -+ * display preemption). -+ * -+ * @note get_format() must return AV_PIX_FMT_VDPAU if this function completes -+ * successfully. -+ * -+ * @param avctx decoding context whose get_format() callback is invoked -+ * @param device VDPAU device handle to use for hardware acceleration -+ * @param get_proc_address VDPAU device driver -+ * @param flags zero of more OR'd AV_HWACCEL_FLAG_* flags -+ * -+ * @return 0 on success, an AVERROR code on failure. -+ */ -+int av_vdpau_bind_context(AVCodecContext* avctx, VdpDevice device, -+ VdpGetProcAddress* get_proc_address, unsigned flags); -+ -+/** -+ * Gets the parameters to create an adequate VDPAU video surface for the codec -+ * context using VDPAU hardware decoding acceleration. -+ * -+ * @note Behavior is undefined if the context was not successfully bound to a -+ * VDPAU device using av_vdpau_bind_context(). -+ * -+ * @param avctx the codec context being used for decoding the stream -+ * @param type storage space for the VDPAU video surface chroma type -+ * (or NULL to ignore) -+ * @param width storage space for the VDPAU video surface pixel width -+ * (or NULL to ignore) -+ * @param height storage space for the VDPAU video surface pixel height -+ * (or NULL to ignore) -+ * -+ * @return 0 on success, a negative AVERROR code on failure. -+ */ -+int av_vdpau_get_surface_parameters(AVCodecContext* avctx, VdpChromaType* type, -+ uint32_t* width, uint32_t* height); -+ -+/** -+ * Allocate an AVVDPAUContext. -+ * -+ * @return Newly-allocated AVVDPAUContext or NULL on failure. -+ */ -+AVVDPAUContext* av_vdpau_alloc_context(void); -+ -+/* @}*/ -+ -+#endif /* AVCODEC_VDPAU_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/version.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/version.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavcodec/version.h -@@ -0,0 +1,67 @@ -+/* -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef AVCODEC_VERSION_H -+#define AVCODEC_VERSION_H -+ -+/** -+ * @file -+ * @ingroup libavc -+ * Libavcodec version macros. -+ */ -+ -+#include "libavutil/version.h" -+ -+#define LIBAVCODEC_VERSION_MAJOR 59 -+#define LIBAVCODEC_VERSION_MINOR 18 -+#define LIBAVCODEC_VERSION_MICRO 100 -+ -+#define LIBAVCODEC_VERSION_INT \ -+ AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, LIBAVCODEC_VERSION_MINOR, \ -+ LIBAVCODEC_VERSION_MICRO) -+#define LIBAVCODEC_VERSION \ -+ AV_VERSION(LIBAVCODEC_VERSION_MAJOR, LIBAVCODEC_VERSION_MINOR, \ -+ LIBAVCODEC_VERSION_MICRO) -+#define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT -+ -+#define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION) -+ -+/** -+ * FF_API_* defines may be placed below to indicate public API that will be -+ * dropped at a future version bump. The defines themselves are not part of -+ * the public API and may change, break or disappear at any time. -+ * -+ * @note, when bumping the major version it is recommended to manually -+ * disable each FF_API_* in its own commit instead of disabling them all -+ * at once through the bump. This improves the git bisect-ability of the change. -+ */ -+ -+#define FF_API_OPENH264_SLICE_MODE (LIBAVCODEC_VERSION_MAJOR < 60) -+#define FF_API_OPENH264_CABAC (LIBAVCODEC_VERSION_MAJOR < 60) -+#define FF_API_UNUSED_CODEC_CAPS (LIBAVCODEC_VERSION_MAJOR < 60) -+#define FF_API_THREAD_SAFE_CALLBACKS (LIBAVCODEC_VERSION_MAJOR < 60) -+#define FF_API_DEBUG_MV (LIBAVCODEC_VERSION_MAJOR < 60) -+#define FF_API_GET_FRAME_CLASS (LIBAVCODEC_VERSION_MAJOR < 60) -+#define FF_API_AUTO_THREADS (LIBAVCODEC_VERSION_MAJOR < 60) -+#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 60) -+#define FF_API_AVCTX_TIMEBASE (LIBAVCODEC_VERSION_MAJOR < 60) -+#define FF_API_MPEGVIDEO_OPTS (LIBAVCODEC_VERSION_MAJOR < 60) -+#define FF_API_FLAG_TRUNCATED (LIBAVCODEC_VERSION_MAJOR < 60) -+#define FF_API_SUB_TEXT_FORMAT (LIBAVCODEC_VERSION_MAJOR < 60) -+ -+#endif /* AVCODEC_VERSION_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/attributes.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/attributes.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/attributes.h -@@ -0,0 +1,173 @@ -+/* -+ * copyright (c) 2006 Michael Niedermayer -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+/** -+ * @file -+ * Macro definitions for various function/variable attributes -+ */ -+ -+#ifndef AVUTIL_ATTRIBUTES_H -+#define AVUTIL_ATTRIBUTES_H -+ -+#ifdef __GNUC__ -+# define AV_GCC_VERSION_AT_LEAST(x, y) \ -+ (__GNUC__ > (x) || __GNUC__ == (x) && __GNUC_MINOR__ >= (y)) -+# define AV_GCC_VERSION_AT_MOST(x, y) \ -+ (__GNUC__ < (x) || __GNUC__ == (x) && __GNUC_MINOR__ <= (y)) -+#else -+# define AV_GCC_VERSION_AT_LEAST(x, y) 0 -+# define AV_GCC_VERSION_AT_MOST(x, y) 0 -+#endif -+ -+#ifdef __has_builtin -+# define AV_HAS_BUILTIN(x) __has_builtin(x) -+#else -+# define AV_HAS_BUILTIN(x) 0 -+#endif -+ -+#ifndef av_always_inline -+# if AV_GCC_VERSION_AT_LEAST(3, 1) -+# define av_always_inline __attribute__((always_inline)) inline -+# elif defined(_MSC_VER) -+# define av_always_inline __forceinline -+# else -+# define av_always_inline inline -+# endif -+#endif -+ -+#ifndef av_extern_inline -+# if defined(__ICL) && __ICL >= 1210 || defined(__GNUC_STDC_INLINE__) -+# define av_extern_inline extern inline -+# else -+# define av_extern_inline inline -+# endif -+#endif -+ -+#if AV_GCC_VERSION_AT_LEAST(3, 4) -+# define av_warn_unused_result __attribute__((warn_unused_result)) -+#else -+# define av_warn_unused_result -+#endif -+ -+#if AV_GCC_VERSION_AT_LEAST(3, 1) -+# define av_noinline __attribute__((noinline)) -+#elif defined(_MSC_VER) -+# define av_noinline __declspec(noinline) -+#else -+# define av_noinline -+#endif -+ -+#if AV_GCC_VERSION_AT_LEAST(3, 1) || defined(__clang__) -+# define av_pure __attribute__((pure)) -+#else -+# define av_pure -+#endif -+ -+#if AV_GCC_VERSION_AT_LEAST(2, 6) || defined(__clang__) -+# define av_const __attribute__((const)) -+#else -+# define av_const -+#endif -+ -+#if AV_GCC_VERSION_AT_LEAST(4, 3) || defined(__clang__) -+# define av_cold __attribute__((cold)) -+#else -+# define av_cold -+#endif -+ -+#if AV_GCC_VERSION_AT_LEAST(4, 1) && !defined(__llvm__) -+# define av_flatten __attribute__((flatten)) -+#else -+# define av_flatten -+#endif -+ -+#if AV_GCC_VERSION_AT_LEAST(3, 1) -+# define attribute_deprecated __attribute__((deprecated)) -+#elif defined(_MSC_VER) -+# define attribute_deprecated __declspec(deprecated) -+#else -+# define attribute_deprecated -+#endif -+ -+/** -+ * Disable warnings about deprecated features -+ * This is useful for sections of code kept for backward compatibility and -+ * scheduled for removal. -+ */ -+#ifndef AV_NOWARN_DEPRECATED -+# if AV_GCC_VERSION_AT_LEAST(4, 6) -+# define AV_NOWARN_DEPRECATED(code) \ -+ _Pragma("GCC diagnostic push") \ -+ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \ -+ code _Pragma("GCC diagnostic pop") -+# elif defined(_MSC_VER) -+# define AV_NOWARN_DEPRECATED(code) \ -+ __pragma(warning(push)) __pragma(warning(disable : 4996)) code; \ -+ __pragma(warning(pop)) -+# else -+# define AV_NOWARN_DEPRECATED(code) code -+# endif -+#endif -+ -+#if defined(__GNUC__) || defined(__clang__) -+# define av_unused __attribute__((unused)) -+#else -+# define av_unused -+#endif -+ -+/** -+ * Mark a variable as used and prevent the compiler from optimizing it -+ * away. This is useful for variables accessed only from inline -+ * assembler without the compiler being aware. -+ */ -+#if AV_GCC_VERSION_AT_LEAST(3, 1) || defined(__clang__) -+# define av_used __attribute__((used)) -+#else -+# define av_used -+#endif -+ -+#if AV_GCC_VERSION_AT_LEAST(3, 3) || defined(__clang__) -+# define av_alias __attribute__((may_alias)) -+#else -+# define av_alias -+#endif -+ -+#if (defined(__GNUC__) || defined(__clang__)) && !defined(__INTEL_COMPILER) -+# define av_uninit(x) x = x -+#else -+# define av_uninit(x) x -+#endif -+ -+#if defined(__GNUC__) || defined(__clang__) -+# define av_builtin_constant_p __builtin_constant_p -+# define av_printf_format(fmtpos, attrpos) \ -+ __attribute__((__format__(__printf__, fmtpos, attrpos))) -+#else -+# define av_builtin_constant_p(x) 0 -+# define av_printf_format(fmtpos, attrpos) -+#endif -+ -+#if AV_GCC_VERSION_AT_LEAST(2, 5) || defined(__clang__) -+# define av_noreturn __attribute__((noreturn)) -+#else -+# define av_noreturn -+#endif -+ -+#endif /* AVUTIL_ATTRIBUTES_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/avconfig.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/avconfig.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/avconfig.h -@@ -0,0 +1,6 @@ -+/* Generated by ffmpeg configure */ -+#ifndef AVUTIL_AVCONFIG_H -+#define AVUTIL_AVCONFIG_H -+#define AV_HAVE_BIGENDIAN 0 -+#define AV_HAVE_FAST_UNALIGNED 1 -+#endif /* AVUTIL_AVCONFIG_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/avutil.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/avutil.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/avutil.h -@@ -0,0 +1,366 @@ -+/* -+ * copyright (c) 2006 Michael Niedermayer -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef AVUTIL_AVUTIL_H -+#define AVUTIL_AVUTIL_H -+ -+/** -+ * @file -+ * @ingroup lavu -+ * Convenience header that includes @ref lavu "libavutil"'s core. -+ */ -+ -+/** -+ * @mainpage -+ * -+ * @section ffmpeg_intro Introduction -+ * -+ * This document describes the usage of the different libraries -+ * provided by FFmpeg. -+ * -+ * @li @ref libavc "libavcodec" encoding/decoding library -+ * @li @ref lavfi "libavfilter" graph-based frame editing library -+ * @li @ref libavf "libavformat" I/O and muxing/demuxing library -+ * @li @ref lavd "libavdevice" special devices muxing/demuxing library -+ * @li @ref lavu "libavutil" common utility library -+ * @li @ref lswr "libswresample" audio resampling, format conversion and mixing -+ * @li @ref lpp "libpostproc" post processing library -+ * @li @ref libsws "libswscale" color conversion and scaling library -+ * -+ * @section ffmpeg_versioning Versioning and compatibility -+ * -+ * Each of the FFmpeg libraries contains a version.h header, which defines a -+ * major, minor and micro version number with the -+ * LIBRARYNAME_VERSION_{MAJOR,MINOR,MICRO} macros. The major version -+ * number is incremented with backward incompatible changes - e.g. removing -+ * parts of the public API, reordering public struct members, etc. The minor -+ * version number is incremented for backward compatible API changes or major -+ * new features - e.g. adding a new public function or a new decoder. The micro -+ * version number is incremented for smaller changes that a calling program -+ * might still want to check for - e.g. changing behavior in a previously -+ * unspecified situation. -+ * -+ * FFmpeg guarantees backward API and ABI compatibility for each library as long -+ * as its major version number is unchanged. This means that no public symbols -+ * will be removed or renamed. Types and names of the public struct members and -+ * values of public macros and enums will remain the same (unless they were -+ * explicitly declared as not part of the public API). Documented behavior will -+ * not change. -+ * -+ * In other words, any correct program that works with a given FFmpeg snapshot -+ * should work just as well without any changes with any later snapshot with the -+ * same major versions. This applies to both rebuilding the program against new -+ * FFmpeg versions or to replacing the dynamic FFmpeg libraries that a program -+ * links against. -+ * -+ * However, new public symbols may be added and new members may be appended to -+ * public structs whose size is not part of public ABI (most public structs in -+ * FFmpeg). New macros and enum values may be added. Behavior in undocumented -+ * situations may change slightly (and be documented). All those are accompanied -+ * by an entry in doc/APIchanges and incrementing either the minor or micro -+ * version number. -+ */ -+ -+/** -+ * @defgroup lavu libavutil -+ * Common code shared across all FFmpeg libraries. -+ * -+ * @note -+ * libavutil is designed to be modular. In most cases, in order to use the -+ * functions provided by one component of libavutil you must explicitly include -+ * the specific header containing that feature. If you are only using -+ * media-related components, you could simply include libavutil/avutil.h, which -+ * brings in most of the "core" components. -+ * -+ * @{ -+ * -+ * @defgroup lavu_crypto Crypto and Hashing -+ * -+ * @{ -+ * @} -+ * -+ * @defgroup lavu_math Mathematics -+ * @{ -+ * -+ * @} -+ * -+ * @defgroup lavu_string String Manipulation -+ * -+ * @{ -+ * -+ * @} -+ * -+ * @defgroup lavu_mem Memory Management -+ * -+ * @{ -+ * -+ * @} -+ * -+ * @defgroup lavu_data Data Structures -+ * @{ -+ * -+ * @} -+ * -+ * @defgroup lavu_video Video related -+ * -+ * @{ -+ * -+ * @} -+ * -+ * @defgroup lavu_audio Audio related -+ * -+ * @{ -+ * -+ * @} -+ * -+ * @defgroup lavu_error Error Codes -+ * -+ * @{ -+ * -+ * @} -+ * -+ * @defgroup lavu_log Logging Facility -+ * -+ * @{ -+ * -+ * @} -+ * -+ * @defgroup lavu_misc Other -+ * -+ * @{ -+ * -+ * @defgroup preproc_misc Preprocessor String Macros -+ * -+ * @{ -+ * -+ * @} -+ * -+ * @defgroup version_utils Library Version Macros -+ * -+ * @{ -+ * -+ * @} -+ */ -+ -+/** -+ * @addtogroup lavu_ver -+ * @{ -+ */ -+ -+/** -+ * Return the LIBAVUTIL_VERSION_INT constant. -+ */ -+unsigned avutil_version(void); -+ -+/** -+ * Return an informative version string. This usually is the actual release -+ * version number or a git commit description. This string has no fixed format -+ * and can change any time. It should never be parsed by code. -+ */ -+const char* av_version_info(void); -+ -+/** -+ * Return the libavutil build-time configuration. -+ */ -+const char* avutil_configuration(void); -+ -+/** -+ * Return the libavutil license. -+ */ -+const char* avutil_license(void); -+ -+/** -+ * @} -+ */ -+ -+/** -+ * @addtogroup lavu_media Media Type -+ * @brief Media Type -+ */ -+ -+enum AVMediaType { -+ AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA -+ AVMEDIA_TYPE_VIDEO, -+ AVMEDIA_TYPE_AUDIO, -+ AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous -+ AVMEDIA_TYPE_SUBTITLE, -+ AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse -+ AVMEDIA_TYPE_NB -+}; -+ -+/** -+ * Return a string describing the media_type enum, NULL if media_type -+ * is unknown. -+ */ -+const char* av_get_media_type_string(enum AVMediaType media_type); -+ -+/** -+ * @defgroup lavu_const Constants -+ * @{ -+ * -+ * @defgroup lavu_enc Encoding specific -+ * -+ * @note those definition should move to avcodec -+ * @{ -+ */ -+ -+#define FF_LAMBDA_SHIFT 7 -+#define FF_LAMBDA_SCALE (1 << FF_LAMBDA_SHIFT) -+#define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda -+#define FF_LAMBDA_MAX (256 * 128 - 1) -+ -+#define FF_QUALITY_SCALE FF_LAMBDA_SCALE // FIXME maybe remove -+ -+/** -+ * @} -+ * @defgroup lavu_time Timestamp specific -+ * -+ * FFmpeg internal timebase and timestamp definitions -+ * -+ * @{ -+ */ -+ -+/** -+ * @brief Undefined timestamp value -+ * -+ * Usually reported by demuxer that work on containers that do not provide -+ * either pts or dts. -+ */ -+ -+#define AV_NOPTS_VALUE ((int64_t)UINT64_C(0x8000000000000000)) -+ -+/** -+ * Internal time base represented as integer -+ */ -+ -+#define AV_TIME_BASE 1000000 -+ -+/** -+ * Internal time base represented as fractional value -+ */ -+ -+#define AV_TIME_BASE_Q \ -+ (AVRational) { 1, AV_TIME_BASE } -+ -+/** -+ * @} -+ * @} -+ * @defgroup lavu_picture Image related -+ * -+ * AVPicture types, pixel formats and basic image planes manipulation. -+ * -+ * @{ -+ */ -+ -+enum AVPictureType { -+ AV_PICTURE_TYPE_NONE = 0, ///< Undefined -+ AV_PICTURE_TYPE_I, ///< Intra -+ AV_PICTURE_TYPE_P, ///< Predicted -+ AV_PICTURE_TYPE_B, ///< Bi-dir predicted -+ AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG-4 -+ AV_PICTURE_TYPE_SI, ///< Switching Intra -+ AV_PICTURE_TYPE_SP, ///< Switching Predicted -+ AV_PICTURE_TYPE_BI, ///< BI type -+}; -+ -+/** -+ * Return a single letter to describe the given picture type -+ * pict_type. -+ * -+ * @param[in] pict_type the picture type @return a single character -+ * representing the picture type, '?' if pict_type is unknown -+ */ -+char av_get_picture_type_char(enum AVPictureType pict_type); -+ -+/** -+ * @} -+ */ -+ -+#include "common.h" -+#include "error.h" -+#include "rational.h" -+#include "version.h" -+#include "macros.h" -+#include "mathematics.h" -+#include "log.h" -+#include "pixfmt.h" -+ -+/** -+ * Return x default pointer in case p is NULL. -+ */ -+static inline void* av_x_if_null(const void* p, const void* x) { -+ return (void*)(intptr_t)(p ? p : x); -+} -+ -+/** -+ * Compute the length of an integer list. -+ * -+ * @param elsize size in bytes of each list element (only 1, 2, 4 or 8) -+ * @param term list terminator (usually 0 or -1) -+ * @param list pointer to the list -+ * @return length of the list, in elements, not counting the terminator -+ */ -+unsigned av_int_list_length_for_size(unsigned elsize, const void* list, -+ uint64_t term) av_pure; -+ -+/** -+ * Compute the length of an integer list. -+ * -+ * @param term list terminator (usually 0 or -1) -+ * @param list pointer to the list -+ * @return length of the list, in elements, not counting the terminator -+ */ -+#define av_int_list_length(list, term) \ -+ av_int_list_length_for_size(sizeof(*(list)), list, term) -+ -+/** -+ * Open a file using a UTF-8 filename. -+ * The API of this function matches POSIX fopen(), errors are returned through -+ * errno. -+ */ -+FILE* av_fopen_utf8(const char* path, const char* mode); -+ -+/** -+ * Return the fractional representation of the internal time base. -+ */ -+AVRational av_get_time_base_q(void); -+ -+#define AV_FOURCC_MAX_STRING_SIZE 32 -+ -+#define av_fourcc2str(fourcc) \ -+ av_fourcc_make_string((char[AV_FOURCC_MAX_STRING_SIZE]){0}, fourcc) -+ -+/** -+ * Fill the provided buffer with a string containing a FourCC (four-character -+ * code) representation. -+ * -+ * @param buf a buffer with size in bytes of at least -+ * AV_FOURCC_MAX_STRING_SIZE -+ * @param fourcc the fourcc to represent -+ * @return the buffer in input -+ */ -+char* av_fourcc_make_string(char* buf, uint32_t fourcc); -+ -+/** -+ * @} -+ * @} -+ */ -+ -+#endif /* AVUTIL_AVUTIL_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/buffer.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/buffer.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/buffer.h -@@ -0,0 +1,324 @@ -+/* -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+/** -+ * @file -+ * @ingroup lavu_buffer -+ * refcounted data buffer API -+ */ -+ -+#ifndef AVUTIL_BUFFER_H -+#define AVUTIL_BUFFER_H -+ -+#include -+#include -+ -+/** -+ * @defgroup lavu_buffer AVBuffer -+ * @ingroup lavu_data -+ * -+ * @{ -+ * AVBuffer is an API for reference-counted data buffers. -+ * -+ * There are two core objects in this API -- AVBuffer and AVBufferRef. AVBuffer -+ * represents the data buffer itself; it is opaque and not meant to be accessed -+ * by the caller directly, but only through AVBufferRef. However, the caller may -+ * e.g. compare two AVBuffer pointers to check whether two different references -+ * are describing the same data buffer. AVBufferRef represents a single -+ * reference to an AVBuffer and it is the object that may be manipulated by the -+ * caller directly. -+ * -+ * There are two functions provided for creating a new AVBuffer with a single -+ * reference -- av_buffer_alloc() to just allocate a new buffer, and -+ * av_buffer_create() to wrap an existing array in an AVBuffer. From an existing -+ * reference, additional references may be created with av_buffer_ref(). -+ * Use av_buffer_unref() to free a reference (this will automatically free the -+ * data once all the references are freed). -+ * -+ * The convention throughout this API and the rest of FFmpeg is such that the -+ * buffer is considered writable if there exists only one reference to it (and -+ * it has not been marked as read-only). The av_buffer_is_writable() function is -+ * provided to check whether this is true and av_buffer_make_writable() will -+ * automatically create a new writable buffer when necessary. -+ * Of course nothing prevents the calling code from violating this convention, -+ * however that is safe only when all the existing references are under its -+ * control. -+ * -+ * @note Referencing and unreferencing the buffers is thread-safe and thus -+ * may be done from multiple threads simultaneously without any need for -+ * additional locking. -+ * -+ * @note Two different references to the same buffer can point to different -+ * parts of the buffer (i.e. their AVBufferRef.data will not be equal). -+ */ -+ -+/** -+ * A reference counted buffer type. It is opaque and is meant to be used through -+ * references (AVBufferRef). -+ */ -+typedef struct AVBuffer AVBuffer; -+ -+/** -+ * A reference to a data buffer. -+ * -+ * The size of this struct is not a part of the public ABI and it is not meant -+ * to be allocated directly. -+ */ -+typedef struct AVBufferRef { -+ AVBuffer* buffer; -+ -+ /** -+ * The data buffer. It is considered writable if and only if -+ * this is the only reference to the buffer, in which case -+ * av_buffer_is_writable() returns 1. -+ */ -+ uint8_t* data; -+ /** -+ * Size of data in bytes. -+ */ -+ size_t size; -+} AVBufferRef; -+ -+/** -+ * Allocate an AVBuffer of the given size using av_malloc(). -+ * -+ * @return an AVBufferRef of given size or NULL when out of memory -+ */ -+AVBufferRef* av_buffer_alloc(size_t size); -+ -+/** -+ * Same as av_buffer_alloc(), except the returned buffer will be initialized -+ * to zero. -+ */ -+AVBufferRef* av_buffer_allocz(size_t size); -+ -+/** -+ * Always treat the buffer as read-only, even when it has only one -+ * reference. -+ */ -+#define AV_BUFFER_FLAG_READONLY (1 << 0) -+ -+/** -+ * Create an AVBuffer from an existing array. -+ * -+ * If this function is successful, data is owned by the AVBuffer. The caller may -+ * only access data through the returned AVBufferRef and references derived from -+ * it. -+ * If this function fails, data is left untouched. -+ * @param data data array -+ * @param size size of data in bytes -+ * @param free a callback for freeing this buffer's data -+ * @param opaque parameter to be got for processing or passed to free -+ * @param flags a combination of AV_BUFFER_FLAG_* -+ * -+ * @return an AVBufferRef referring to data on success, NULL on failure. -+ */ -+AVBufferRef* av_buffer_create(uint8_t* data, size_t size, -+ void (*free)(void* opaque, uint8_t* data), -+ void* opaque, int flags); -+ -+/** -+ * Default free callback, which calls av_free() on the buffer data. -+ * This function is meant to be passed to av_buffer_create(), not called -+ * directly. -+ */ -+void av_buffer_default_free(void* opaque, uint8_t* data); -+ -+/** -+ * Create a new reference to an AVBuffer. -+ * -+ * @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on -+ * failure. -+ */ -+AVBufferRef* av_buffer_ref(const AVBufferRef* buf); -+ -+/** -+ * Free a given reference and automatically free the buffer if there are no more -+ * references to it. -+ * -+ * @param buf the reference to be freed. The pointer is set to NULL on return. -+ */ -+void av_buffer_unref(AVBufferRef** buf); -+ -+/** -+ * @return 1 if the caller may write to the data referred to by buf (which is -+ * true if and only if buf is the only reference to the underlying AVBuffer). -+ * Return 0 otherwise. -+ * A positive answer is valid until av_buffer_ref() is called on buf. -+ */ -+int av_buffer_is_writable(const AVBufferRef* buf); -+ -+/** -+ * @return the opaque parameter set by av_buffer_create. -+ */ -+void* av_buffer_get_opaque(const AVBufferRef* buf); -+ -+int av_buffer_get_ref_count(const AVBufferRef* buf); -+ -+/** -+ * Create a writable reference from a given buffer reference, avoiding data copy -+ * if possible. -+ * -+ * @param buf buffer reference to make writable. On success, buf is either left -+ * untouched, or it is unreferenced and a new writable AVBufferRef is -+ * written in its place. On failure, buf is left untouched. -+ * @return 0 on success, a negative AVERROR on failure. -+ */ -+int av_buffer_make_writable(AVBufferRef** buf); -+ -+/** -+ * Reallocate a given buffer. -+ * -+ * @param buf a buffer reference to reallocate. On success, buf will be -+ * unreferenced and a new reference with the required size will be -+ * written in its place. On failure buf will be left untouched. *buf -+ * may be NULL, then a new buffer is allocated. -+ * @param size required new buffer size. -+ * @return 0 on success, a negative AVERROR on failure. -+ * -+ * @note the buffer is actually reallocated with av_realloc() only if it was -+ * initially allocated through av_buffer_realloc(NULL) and there is only one -+ * reference to it (i.e. the one passed to this function). In all other cases -+ * a new buffer is allocated and the data is copied. -+ */ -+int av_buffer_realloc(AVBufferRef** buf, size_t size); -+ -+/** -+ * Ensure dst refers to the same data as src. -+ * -+ * When *dst is already equivalent to src, do nothing. Otherwise unreference dst -+ * and replace it with a new reference to src. -+ * -+ * @param dst Pointer to either a valid buffer reference or NULL. On success, -+ * this will point to a buffer reference equivalent to src. On -+ * failure, dst will be left untouched. -+ * @param src A buffer reference to replace dst with. May be NULL, then this -+ * function is equivalent to av_buffer_unref(dst). -+ * @return 0 on success -+ * AVERROR(ENOMEM) on memory allocation failure. -+ */ -+int av_buffer_replace(AVBufferRef** dst, const AVBufferRef* src); -+ -+/** -+ * @} -+ */ -+ -+/** -+ * @defgroup lavu_bufferpool AVBufferPool -+ * @ingroup lavu_data -+ * -+ * @{ -+ * AVBufferPool is an API for a lock-free thread-safe pool of AVBuffers. -+ * -+ * Frequently allocating and freeing large buffers may be slow. AVBufferPool is -+ * meant to solve this in cases when the caller needs a set of buffers of the -+ * same size (the most obvious use case being buffers for raw video or audio -+ * frames). -+ * -+ * At the beginning, the user must call av_buffer_pool_init() to create the -+ * buffer pool. Then whenever a buffer is needed, call av_buffer_pool_get() to -+ * get a reference to a new buffer, similar to av_buffer_alloc(). This new -+ * reference works in all aspects the same way as the one created by -+ * av_buffer_alloc(). However, when the last reference to this buffer is -+ * unreferenced, it is returned to the pool instead of being freed and will be -+ * reused for subsequent av_buffer_pool_get() calls. -+ * -+ * When the caller is done with the pool and no longer needs to allocate any new -+ * buffers, av_buffer_pool_uninit() must be called to mark the pool as freeable. -+ * Once all the buffers are released, it will automatically be freed. -+ * -+ * Allocating and releasing buffers with this API is thread-safe as long as -+ * either the default alloc callback is used, or the user-supplied one is -+ * thread-safe. -+ */ -+ -+/** -+ * The buffer pool. This structure is opaque and not meant to be accessed -+ * directly. It is allocated with av_buffer_pool_init() and freed with -+ * av_buffer_pool_uninit(). -+ */ -+typedef struct AVBufferPool AVBufferPool; -+ -+/** -+ * Allocate and initialize a buffer pool. -+ * -+ * @param size size of each buffer in this pool -+ * @param alloc a function that will be used to allocate new buffers when the -+ * pool is empty. May be NULL, then the default allocator will be used -+ * (av_buffer_alloc()). -+ * @return newly created buffer pool on success, NULL on error. -+ */ -+AVBufferPool* av_buffer_pool_init(size_t size, -+ AVBufferRef* (*alloc)(size_t size)); -+ -+/** -+ * Allocate and initialize a buffer pool with a more complex allocator. -+ * -+ * @param size size of each buffer in this pool -+ * @param opaque arbitrary user data used by the allocator -+ * @param alloc a function that will be used to allocate new buffers when the -+ * pool is empty. May be NULL, then the default allocator will be -+ * used (av_buffer_alloc()). -+ * @param pool_free a function that will be called immediately before the pool -+ * is freed. I.e. after av_buffer_pool_uninit() is called -+ * by the caller and all the frames are returned to the pool -+ * and freed. It is intended to uninitialize the user opaque -+ * data. May be NULL. -+ * @return newly created buffer pool on success, NULL on error. -+ */ -+AVBufferPool* av_buffer_pool_init2(size_t size, void* opaque, -+ AVBufferRef* (*alloc)(void* opaque, -+ size_t size), -+ void (*pool_free)(void* opaque)); -+ -+/** -+ * Mark the pool as being available for freeing. It will actually be freed only -+ * once all the allocated buffers associated with the pool are released. Thus it -+ * is safe to call this function while some of the allocated buffers are still -+ * in use. -+ * -+ * @param pool pointer to the pool to be freed. It will be set to NULL. -+ */ -+void av_buffer_pool_uninit(AVBufferPool** pool); -+ -+/** -+ * Allocate a new AVBuffer, reusing an old buffer from the pool when available. -+ * This function may be called simultaneously from multiple threads. -+ * -+ * @return a reference to the new buffer on success, NULL on error. -+ */ -+AVBufferRef* av_buffer_pool_get(AVBufferPool* pool); -+ -+/** -+ * Query the original opaque parameter of an allocated buffer in the pool. -+ * -+ * @param ref a buffer reference to a buffer returned by av_buffer_pool_get. -+ * @return the opaque parameter set by the buffer allocator function of the -+ * buffer pool. -+ * -+ * @note the opaque parameter of ref is used by the buffer pool implementation, -+ * therefore you have to use this function to access the original opaque -+ * parameter of an allocated buffer. -+ */ -+void* av_buffer_pool_buffer_get_opaque(const AVBufferRef* ref); -+ -+/** -+ * @} -+ */ -+ -+#endif /* AVUTIL_BUFFER_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/channel_layout.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/channel_layout.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/channel_layout.h -@@ -0,0 +1,270 @@ -+/* -+ * Copyright (c) 2006 Michael Niedermayer -+ * Copyright (c) 2008 Peter Ross -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef AVUTIL_CHANNEL_LAYOUT_H -+#define AVUTIL_CHANNEL_LAYOUT_H -+ -+#include -+ -+/** -+ * @file -+ * audio channel layout utility functions -+ */ -+ -+/** -+ * @addtogroup lavu_audio -+ * @{ -+ */ -+ -+/** -+ * @defgroup channel_masks Audio channel masks -+ * -+ * A channel layout is a 64-bits integer with a bit set for every channel. -+ * The number of bits set must be equal to the number of channels. -+ * The value 0 means that the channel layout is not known. -+ * @note this data structure is not powerful enough to handle channels -+ * combinations that have the same channel multiple times, such as -+ * dual-mono. -+ * -+ * @{ -+ */ -+#define AV_CH_FRONT_LEFT 0x00000001 -+#define AV_CH_FRONT_RIGHT 0x00000002 -+#define AV_CH_FRONT_CENTER 0x00000004 -+#define AV_CH_LOW_FREQUENCY 0x00000008 -+#define AV_CH_BACK_LEFT 0x00000010 -+#define AV_CH_BACK_RIGHT 0x00000020 -+#define AV_CH_FRONT_LEFT_OF_CENTER 0x00000040 -+#define AV_CH_FRONT_RIGHT_OF_CENTER 0x00000080 -+#define AV_CH_BACK_CENTER 0x00000100 -+#define AV_CH_SIDE_LEFT 0x00000200 -+#define AV_CH_SIDE_RIGHT 0x00000400 -+#define AV_CH_TOP_CENTER 0x00000800 -+#define AV_CH_TOP_FRONT_LEFT 0x00001000 -+#define AV_CH_TOP_FRONT_CENTER 0x00002000 -+#define AV_CH_TOP_FRONT_RIGHT 0x00004000 -+#define AV_CH_TOP_BACK_LEFT 0x00008000 -+#define AV_CH_TOP_BACK_CENTER 0x00010000 -+#define AV_CH_TOP_BACK_RIGHT 0x00020000 -+#define AV_CH_STEREO_LEFT 0x20000000 ///< Stereo downmix. -+#define AV_CH_STEREO_RIGHT 0x40000000 ///< See AV_CH_STEREO_LEFT. -+#define AV_CH_WIDE_LEFT 0x0000000080000000ULL -+#define AV_CH_WIDE_RIGHT 0x0000000100000000ULL -+#define AV_CH_SURROUND_DIRECT_LEFT 0x0000000200000000ULL -+#define AV_CH_SURROUND_DIRECT_RIGHT 0x0000000400000000ULL -+#define AV_CH_LOW_FREQUENCY_2 0x0000000800000000ULL -+#define AV_CH_TOP_SIDE_LEFT 0x0000001000000000ULL -+#define AV_CH_TOP_SIDE_RIGHT 0x0000002000000000ULL -+#define AV_CH_BOTTOM_FRONT_CENTER 0x0000004000000000ULL -+#define AV_CH_BOTTOM_FRONT_LEFT 0x0000008000000000ULL -+#define AV_CH_BOTTOM_FRONT_RIGHT 0x0000010000000000ULL -+ -+/** Channel mask value used for AVCodecContext.request_channel_layout -+ to indicate that the user requests the channel order of the decoder output -+ to be the native codec channel order. */ -+#define AV_CH_LAYOUT_NATIVE 0x8000000000000000ULL -+ -+/** -+ * @} -+ * @defgroup channel_mask_c Audio channel layouts -+ * @{ -+ * */ -+#define AV_CH_LAYOUT_MONO (AV_CH_FRONT_CENTER) -+#define AV_CH_LAYOUT_STEREO (AV_CH_FRONT_LEFT | AV_CH_FRONT_RIGHT) -+#define AV_CH_LAYOUT_2POINT1 (AV_CH_LAYOUT_STEREO | AV_CH_LOW_FREQUENCY) -+#define AV_CH_LAYOUT_2_1 (AV_CH_LAYOUT_STEREO | AV_CH_BACK_CENTER) -+#define AV_CH_LAYOUT_SURROUND (AV_CH_LAYOUT_STEREO | AV_CH_FRONT_CENTER) -+#define AV_CH_LAYOUT_3POINT1 (AV_CH_LAYOUT_SURROUND | AV_CH_LOW_FREQUENCY) -+#define AV_CH_LAYOUT_4POINT0 (AV_CH_LAYOUT_SURROUND | AV_CH_BACK_CENTER) -+#define AV_CH_LAYOUT_4POINT1 (AV_CH_LAYOUT_4POINT0 | AV_CH_LOW_FREQUENCY) -+#define AV_CH_LAYOUT_2_2 \ -+ (AV_CH_LAYOUT_STEREO | AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT) -+#define AV_CH_LAYOUT_QUAD \ -+ (AV_CH_LAYOUT_STEREO | AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT) -+#define AV_CH_LAYOUT_5POINT0 \ -+ (AV_CH_LAYOUT_SURROUND | AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT) -+#define AV_CH_LAYOUT_5POINT1 (AV_CH_LAYOUT_5POINT0 | AV_CH_LOW_FREQUENCY) -+#define AV_CH_LAYOUT_5POINT0_BACK \ -+ (AV_CH_LAYOUT_SURROUND | AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT) -+#define AV_CH_LAYOUT_5POINT1_BACK \ -+ (AV_CH_LAYOUT_5POINT0_BACK | AV_CH_LOW_FREQUENCY) -+#define AV_CH_LAYOUT_6POINT0 (AV_CH_LAYOUT_5POINT0 | AV_CH_BACK_CENTER) -+#define AV_CH_LAYOUT_6POINT0_FRONT \ -+ (AV_CH_LAYOUT_2_2 | AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER) -+#define AV_CH_LAYOUT_HEXAGONAL (AV_CH_LAYOUT_5POINT0_BACK | AV_CH_BACK_CENTER) -+#define AV_CH_LAYOUT_6POINT1 (AV_CH_LAYOUT_5POINT1 | AV_CH_BACK_CENTER) -+#define AV_CH_LAYOUT_6POINT1_BACK \ -+ (AV_CH_LAYOUT_5POINT1_BACK | AV_CH_BACK_CENTER) -+#define AV_CH_LAYOUT_6POINT1_FRONT \ -+ (AV_CH_LAYOUT_6POINT0_FRONT | AV_CH_LOW_FREQUENCY) -+#define AV_CH_LAYOUT_7POINT0 \ -+ (AV_CH_LAYOUT_5POINT0 | AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT) -+#define AV_CH_LAYOUT_7POINT0_FRONT \ -+ (AV_CH_LAYOUT_5POINT0 | AV_CH_FRONT_LEFT_OF_CENTER | \ -+ AV_CH_FRONT_RIGHT_OF_CENTER) -+#define AV_CH_LAYOUT_7POINT1 \ -+ (AV_CH_LAYOUT_5POINT1 | AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT) -+#define AV_CH_LAYOUT_7POINT1_WIDE \ -+ (AV_CH_LAYOUT_5POINT1 | AV_CH_FRONT_LEFT_OF_CENTER | \ -+ AV_CH_FRONT_RIGHT_OF_CENTER) -+#define AV_CH_LAYOUT_7POINT1_WIDE_BACK \ -+ (AV_CH_LAYOUT_5POINT1_BACK | AV_CH_FRONT_LEFT_OF_CENTER | \ -+ AV_CH_FRONT_RIGHT_OF_CENTER) -+#define AV_CH_LAYOUT_OCTAGONAL \ -+ (AV_CH_LAYOUT_5POINT0 | AV_CH_BACK_LEFT | AV_CH_BACK_CENTER | \ -+ AV_CH_BACK_RIGHT) -+#define AV_CH_LAYOUT_HEXADECAGONAL \ -+ (AV_CH_LAYOUT_OCTAGONAL | AV_CH_WIDE_LEFT | AV_CH_WIDE_RIGHT | \ -+ AV_CH_TOP_BACK_LEFT | AV_CH_TOP_BACK_RIGHT | AV_CH_TOP_BACK_CENTER | \ -+ AV_CH_TOP_FRONT_CENTER | AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT) -+#define AV_CH_LAYOUT_STEREO_DOWNMIX (AV_CH_STEREO_LEFT | AV_CH_STEREO_RIGHT) -+#define AV_CH_LAYOUT_22POINT2 \ -+ (AV_CH_LAYOUT_5POINT1_BACK | AV_CH_FRONT_LEFT_OF_CENTER | \ -+ AV_CH_FRONT_RIGHT_OF_CENTER | AV_CH_BACK_CENTER | AV_CH_LOW_FREQUENCY_2 | \ -+ AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT | AV_CH_TOP_FRONT_LEFT | \ -+ AV_CH_TOP_FRONT_RIGHT | AV_CH_TOP_FRONT_CENTER | AV_CH_TOP_CENTER | \ -+ AV_CH_TOP_BACK_LEFT | AV_CH_TOP_BACK_RIGHT | AV_CH_TOP_SIDE_LEFT | \ -+ AV_CH_TOP_SIDE_RIGHT | AV_CH_TOP_BACK_CENTER | AV_CH_BOTTOM_FRONT_CENTER | \ -+ AV_CH_BOTTOM_FRONT_LEFT | AV_CH_BOTTOM_FRONT_RIGHT) -+ -+enum AVMatrixEncoding { -+ AV_MATRIX_ENCODING_NONE, -+ AV_MATRIX_ENCODING_DOLBY, -+ AV_MATRIX_ENCODING_DPLII, -+ AV_MATRIX_ENCODING_DPLIIX, -+ AV_MATRIX_ENCODING_DPLIIZ, -+ AV_MATRIX_ENCODING_DOLBYEX, -+ AV_MATRIX_ENCODING_DOLBYHEADPHONE, -+ AV_MATRIX_ENCODING_NB -+}; -+ -+/** -+ * Return a channel layout id that matches name, or 0 if no match is found. -+ * -+ * name can be one or several of the following notations, -+ * separated by '+' or '|': -+ * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, -+ * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); -+ * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, -+ * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); -+ * - a number of channels, in decimal, followed by 'c', yielding -+ * the default channel layout for that number of channels (@see -+ * av_get_default_channel_layout); -+ * - a channel layout mask, in hexadecimal starting with "0x" (see the -+ * AV_CH_* macros). -+ * -+ * Example: "stereo+FC" = "2c+FC" = "2c+1c" = "0x7" -+ */ -+uint64_t av_get_channel_layout(const char* name); -+ -+/** -+ * Return a channel layout and the number of channels based on the specified -+ * name. -+ * -+ * This function is similar to (@see av_get_channel_layout), but can also parse -+ * unknown channel layout specifications. -+ * -+ * @param[in] name channel layout specification string -+ * @param[out] channel_layout parsed channel layout (0 if unknown) -+ * @param[out] nb_channels number of channels -+ * -+ * @return 0 on success, AVERROR(EINVAL) if the parsing fails. -+ */ -+int av_get_extended_channel_layout(const char* name, uint64_t* channel_layout, -+ int* nb_channels); -+ -+/** -+ * Return a description of a channel layout. -+ * If nb_channels is <= 0, it is guessed from the channel_layout. -+ * -+ * @param buf put here the string containing the channel layout -+ * @param buf_size size in bytes of the buffer -+ */ -+void av_get_channel_layout_string(char* buf, int buf_size, int nb_channels, -+ uint64_t channel_layout); -+ -+struct AVBPrint; -+/** -+ * Append a description of a channel layout to a bprint buffer. -+ */ -+void av_bprint_channel_layout(struct AVBPrint* bp, int nb_channels, -+ uint64_t channel_layout); -+ -+/** -+ * Return the number of channels in the channel layout. -+ */ -+int av_get_channel_layout_nb_channels(uint64_t channel_layout); -+ -+/** -+ * Return default channel layout for a given number of channels. -+ */ -+int64_t av_get_default_channel_layout(int nb_channels); -+ -+/** -+ * Get the index of a channel in channel_layout. -+ * -+ * @param channel a channel layout describing exactly one channel which must be -+ * present in channel_layout. -+ * -+ * @return index of channel in channel_layout on success, a negative AVERROR -+ * on error. -+ */ -+int av_get_channel_layout_channel_index(uint64_t channel_layout, -+ uint64_t channel); -+ -+/** -+ * Get the channel with the given index in channel_layout. -+ */ -+uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index); -+ -+/** -+ * Get the name of a given channel. -+ * -+ * @return channel name on success, NULL on error. -+ */ -+const char* av_get_channel_name(uint64_t channel); -+ -+/** -+ * Get the description of a given channel. -+ * -+ * @param channel a channel layout with a single channel -+ * @return channel description on success, NULL on error -+ */ -+const char* av_get_channel_description(uint64_t channel); -+ -+/** -+ * Get the value and name of a standard channel layout. -+ * -+ * @param[in] index index in an internal list, starting at 0 -+ * @param[out] layout channel layout mask -+ * @param[out] name name of the layout -+ * @return 0 if the layout exists, -+ * <0 if index is beyond the limits -+ */ -+int av_get_standard_channel_layout(unsigned index, uint64_t* layout, -+ const char** name); -+ -+/** -+ * @} -+ * @} -+ */ -+ -+#endif /* AVUTIL_CHANNEL_LAYOUT_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/common.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/common.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/common.h -@@ -0,0 +1,590 @@ -+/* -+ * copyright (c) 2006 Michael Niedermayer -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+/** -+ * @file -+ * common internal and external API header -+ */ -+ -+#ifndef AVUTIL_COMMON_H -+#define AVUTIL_COMMON_H -+ -+#if defined(__cplusplus) && !defined(__STDC_CONSTANT_MACROS) && \ -+ !defined(UINT64_C) -+# error missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS -+#endif -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "attributes.h" -+#include "macros.h" -+#include "version.h" -+ -+// rounded division & shift -+#define RSHIFT(a, b) \ -+ ((a) > 0 ? ((a) + ((1 << (b)) >> 1)) >> (b) \ -+ : ((a) + ((1 << (b)) >> 1) - 1) >> (b)) -+/* assume b>0 */ -+#define ROUNDED_DIV(a, b) \ -+ (((a) >= 0 ? (a) + ((b) >> 1) : (a) - ((b) >> 1)) / (b)) -+/* Fast a/(1<=0 and b>=0 */ -+#define AV_CEIL_RSHIFT(a, b) \ -+ (!av_builtin_constant_p(b) ? -((-(a)) >> (b)) : ((a) + (1 << (b)) - 1) >> (b)) -+/* Backwards compat. */ -+#define FF_CEIL_RSHIFT AV_CEIL_RSHIFT -+ -+#define FFUDIV(a, b) (((a) > 0 ? (a) : (a) - (b) + 1) / (b)) -+#define FFUMOD(a, b) ((a) - (b)*FFUDIV(a, b)) -+ -+/** -+ * Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as -+ * they are not representable as absolute values of their type. This is the same -+ * as with *abs() -+ * @see FFNABS() -+ */ -+#define FFABS(a) ((a) >= 0 ? (a) : (-(a))) -+#define FFSIGN(a) ((a) > 0 ? 1 : -1) -+ -+/** -+ * Negative Absolute value. -+ * this works for all integers of all types. -+ * As with many macros, this evaluates its argument twice, it thus must not have -+ * a sideeffect, that is FFNABS(x++) has undefined behavior. -+ */ -+#define FFNABS(a) ((a) <= 0 ? (a) : (-(a))) -+ -+/** -+ * Unsigned Absolute value. -+ * This takes the absolute value of a signed int and returns it as a unsigned. -+ * This also works with INT_MIN which would otherwise not be representable -+ * As with many macros, this evaluates its argument twice. -+ */ -+#define FFABSU(a) ((a) <= 0 ? -(unsigned)(a) : (unsigned)(a)) -+#define FFABS64U(a) ((a) <= 0 ? -(uint64_t)(a) : (uint64_t)(a)) -+ -+/* misc math functions */ -+ -+#ifdef HAVE_AV_CONFIG_H -+# include "config.h" -+# include "intmath.h" -+#endif -+ -+#ifndef av_ceil_log2 -+# define av_ceil_log2 av_ceil_log2_c -+#endif -+#ifndef av_clip -+# define av_clip av_clip_c -+#endif -+#ifndef av_clip64 -+# define av_clip64 av_clip64_c -+#endif -+#ifndef av_clip_uint8 -+# define av_clip_uint8 av_clip_uint8_c -+#endif -+#ifndef av_clip_int8 -+# define av_clip_int8 av_clip_int8_c -+#endif -+#ifndef av_clip_uint16 -+# define av_clip_uint16 av_clip_uint16_c -+#endif -+#ifndef av_clip_int16 -+# define av_clip_int16 av_clip_int16_c -+#endif -+#ifndef av_clipl_int32 -+# define av_clipl_int32 av_clipl_int32_c -+#endif -+#ifndef av_clip_intp2 -+# define av_clip_intp2 av_clip_intp2_c -+#endif -+#ifndef av_clip_uintp2 -+# define av_clip_uintp2 av_clip_uintp2_c -+#endif -+#ifndef av_mod_uintp2 -+# define av_mod_uintp2 av_mod_uintp2_c -+#endif -+#ifndef av_sat_add32 -+# define av_sat_add32 av_sat_add32_c -+#endif -+#ifndef av_sat_dadd32 -+# define av_sat_dadd32 av_sat_dadd32_c -+#endif -+#ifndef av_sat_sub32 -+# define av_sat_sub32 av_sat_sub32_c -+#endif -+#ifndef av_sat_dsub32 -+# define av_sat_dsub32 av_sat_dsub32_c -+#endif -+#ifndef av_sat_add64 -+# define av_sat_add64 av_sat_add64_c -+#endif -+#ifndef av_sat_sub64 -+# define av_sat_sub64 av_sat_sub64_c -+#endif -+#ifndef av_clipf -+# define av_clipf av_clipf_c -+#endif -+#ifndef av_clipd -+# define av_clipd av_clipd_c -+#endif -+#ifndef av_popcount -+# define av_popcount av_popcount_c -+#endif -+#ifndef av_popcount64 -+# define av_popcount64 av_popcount64_c -+#endif -+#ifndef av_parity -+# define av_parity av_parity_c -+#endif -+ -+#ifndef av_log2 -+av_const int av_log2(unsigned v); -+#endif -+ -+#ifndef av_log2_16bit -+av_const int av_log2_16bit(unsigned v); -+#endif -+ -+/** -+ * Clip a signed integer value into the amin-amax range. -+ * @param a value to clip -+ * @param amin minimum value of the clip range -+ * @param amax maximum value of the clip range -+ * @return clipped value -+ */ -+static av_always_inline av_const int av_clip_c(int a, int amin, int amax) { -+#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2 -+ if (amin > amax) abort(); -+#endif -+ if (a < amin) -+ return amin; -+ else if (a > amax) -+ return amax; -+ else -+ return a; -+} -+ -+/** -+ * Clip a signed 64bit integer value into the amin-amax range. -+ * @param a value to clip -+ * @param amin minimum value of the clip range -+ * @param amax maximum value of the clip range -+ * @return clipped value -+ */ -+static av_always_inline av_const int64_t av_clip64_c(int64_t a, int64_t amin, -+ int64_t amax) { -+#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2 -+ if (amin > amax) abort(); -+#endif -+ if (a < amin) -+ return amin; -+ else if (a > amax) -+ return amax; -+ else -+ return a; -+} -+ -+/** -+ * Clip a signed integer value into the 0-255 range. -+ * @param a value to clip -+ * @return clipped value -+ */ -+static av_always_inline av_const uint8_t av_clip_uint8_c(int a) { -+ if (a & (~0xFF)) -+ return (~a) >> 31; -+ else -+ return a; -+} -+ -+/** -+ * Clip a signed integer value into the -128,127 range. -+ * @param a value to clip -+ * @return clipped value -+ */ -+static av_always_inline av_const int8_t av_clip_int8_c(int a) { -+ if ((a + 0x80U) & ~0xFF) -+ return (a >> 31) ^ 0x7F; -+ else -+ return a; -+} -+ -+/** -+ * Clip a signed integer value into the 0-65535 range. -+ * @param a value to clip -+ * @return clipped value -+ */ -+static av_always_inline av_const uint16_t av_clip_uint16_c(int a) { -+ if (a & (~0xFFFF)) -+ return (~a) >> 31; -+ else -+ return a; -+} -+ -+/** -+ * Clip a signed integer value into the -32768,32767 range. -+ * @param a value to clip -+ * @return clipped value -+ */ -+static av_always_inline av_const int16_t av_clip_int16_c(int a) { -+ if ((a + 0x8000U) & ~0xFFFF) -+ return (a >> 31) ^ 0x7FFF; -+ else -+ return a; -+} -+ -+/** -+ * Clip a signed 64-bit integer value into the -2147483648,2147483647 range. -+ * @param a value to clip -+ * @return clipped value -+ */ -+static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a) { -+ if ((a + 0x80000000u) & ~UINT64_C(0xFFFFFFFF)) -+ return (int32_t)((a >> 63) ^ 0x7FFFFFFF); -+ else -+ return (int32_t)a; -+} -+ -+/** -+ * Clip a signed integer into the -(2^p),(2^p-1) range. -+ * @param a value to clip -+ * @param p bit position to clip at -+ * @return clipped value -+ */ -+static av_always_inline av_const int av_clip_intp2_c(int a, int p) { -+ if (((unsigned)a + (1 << p)) & ~((2 << p) - 1)) -+ return (a >> 31) ^ ((1 << p) - 1); -+ else -+ return a; -+} -+ -+/** -+ * Clip a signed integer to an unsigned power of two range. -+ * @param a value to clip -+ * @param p bit position to clip at -+ * @return clipped value -+ */ -+static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p) { -+ if (a & ~((1 << p) - 1)) -+ return (~a) >> 31 & ((1 << p) - 1); -+ else -+ return a; -+} -+ -+/** -+ * Clear high bits from an unsigned integer starting with specific bit position -+ * @param a value to clip -+ * @param p bit position to clip at -+ * @return clipped value -+ */ -+static av_always_inline av_const unsigned av_mod_uintp2_c(unsigned a, -+ unsigned p) { -+ return a & ((1U << p) - 1); -+} -+ -+/** -+ * Add two signed 32-bit values with saturation. -+ * -+ * @param a one value -+ * @param b another value -+ * @return sum with signed saturation -+ */ -+static av_always_inline int av_sat_add32_c(int a, int b) { -+ return av_clipl_int32((int64_t)a + b); -+} -+ -+/** -+ * Add a doubled value to another value with saturation at both stages. -+ * -+ * @param a first value -+ * @param b value doubled and added to a -+ * @return sum sat(a + sat(2*b)) with signed saturation -+ */ -+static av_always_inline int av_sat_dadd32_c(int a, int b) { -+ return av_sat_add32(a, av_sat_add32(b, b)); -+} -+ -+/** -+ * Subtract two signed 32-bit values with saturation. -+ * -+ * @param a one value -+ * @param b another value -+ * @return difference with signed saturation -+ */ -+static av_always_inline int av_sat_sub32_c(int a, int b) { -+ return av_clipl_int32((int64_t)a - b); -+} -+ -+/** -+ * Subtract a doubled value from another value with saturation at both stages. -+ * -+ * @param a first value -+ * @param b value doubled and subtracted from a -+ * @return difference sat(a - sat(2*b)) with signed saturation -+ */ -+static av_always_inline int av_sat_dsub32_c(int a, int b) { -+ return av_sat_sub32(a, av_sat_add32(b, b)); -+} -+ -+/** -+ * Add two signed 64-bit values with saturation. -+ * -+ * @param a one value -+ * @param b another value -+ * @return sum with signed saturation -+ */ -+static av_always_inline int64_t av_sat_add64_c(int64_t a, int64_t b) { -+#if (!defined(__INTEL_COMPILER) && AV_GCC_VERSION_AT_LEAST(5, 1)) || \ -+ AV_HAS_BUILTIN(__builtin_add_overflow) -+ int64_t tmp; -+ return !__builtin_add_overflow(a, b, &tmp) -+ ? tmp -+ : (tmp < 0 ? INT64_MAX : INT64_MIN); -+#else -+ int64_t s = a + (uint64_t)b; -+ if ((int64_t)(a ^ b | ~s ^ b) >= 0) return INT64_MAX ^ (b >> 63); -+ return s; -+#endif -+} -+ -+/** -+ * Subtract two signed 64-bit values with saturation. -+ * -+ * @param a one value -+ * @param b another value -+ * @return difference with signed saturation -+ */ -+static av_always_inline int64_t av_sat_sub64_c(int64_t a, int64_t b) { -+#if (!defined(__INTEL_COMPILER) && AV_GCC_VERSION_AT_LEAST(5, 1)) || \ -+ AV_HAS_BUILTIN(__builtin_sub_overflow) -+ int64_t tmp; -+ return !__builtin_sub_overflow(a, b, &tmp) -+ ? tmp -+ : (tmp < 0 ? INT64_MAX : INT64_MIN); -+#else -+ if (b <= 0 && a >= INT64_MAX + b) return INT64_MAX; -+ if (b >= 0 && a <= INT64_MIN + b) return INT64_MIN; -+ return a - b; -+#endif -+} -+ -+/** -+ * Clip a float value into the amin-amax range. -+ * If a is nan or -inf amin will be returned. -+ * If a is +inf amax will be returned. -+ * @param a value to clip -+ * @param amin minimum value of the clip range -+ * @param amax maximum value of the clip range -+ * @return clipped value -+ */ -+static av_always_inline av_const float av_clipf_c(float a, float amin, -+ float amax) { -+#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2 -+ if (amin > amax) abort(); -+#endif -+ return FFMIN(FFMAX(a, amin), amax); -+} -+ -+/** -+ * Clip a double value into the amin-amax range. -+ * If a is nan or -inf amin will be returned. -+ * If a is +inf amax will be returned. -+ * @param a value to clip -+ * @param amin minimum value of the clip range -+ * @param amax maximum value of the clip range -+ * @return clipped value -+ */ -+static av_always_inline av_const double av_clipd_c(double a, double amin, -+ double amax) { -+#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2 -+ if (amin > amax) abort(); -+#endif -+ return FFMIN(FFMAX(a, amin), amax); -+} -+ -+/** Compute ceil(log2(x)). -+ * @param x value used to compute ceil(log2(x)) -+ * @return computed ceiling of log2(x) -+ */ -+static av_always_inline av_const int av_ceil_log2_c(int x) { -+ return av_log2((x - 1U) << 1); -+} -+ -+/** -+ * Count number of bits set to one in x -+ * @param x value to count bits of -+ * @return the number of bits set to one in x -+ */ -+static av_always_inline av_const int av_popcount_c(uint32_t x) { -+ x -= (x >> 1) & 0x55555555; -+ x = (x & 0x33333333) + ((x >> 2) & 0x33333333); -+ x = (x + (x >> 4)) & 0x0F0F0F0F; -+ x += x >> 8; -+ return (x + (x >> 16)) & 0x3F; -+} -+ -+/** -+ * Count number of bits set to one in x -+ * @param x value to count bits of -+ * @return the number of bits set to one in x -+ */ -+static av_always_inline av_const int av_popcount64_c(uint64_t x) { -+ return av_popcount((uint32_t)x) + av_popcount((uint32_t)(x >> 32)); -+} -+ -+static av_always_inline av_const int av_parity_c(uint32_t v) { -+ return av_popcount(v) & 1; -+} -+ -+/** -+ * Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form. -+ * -+ * @param val Output value, must be an lvalue of type uint32_t. -+ * @param GET_BYTE Expression reading one byte from the input. -+ * Evaluated up to 7 times (4 for the currently -+ * assigned Unicode range). With a memory buffer -+ * input, this could be *ptr++, or if you want to make sure -+ * that *ptr stops at the end of a NULL terminated string then -+ * *ptr ? *ptr++ : 0 -+ * @param ERROR Expression to be evaluated on invalid input, -+ * typically a goto statement. -+ * -+ * @warning ERROR should not contain a loop control statement which -+ * could interact with the internal while loop, and should force an -+ * exit from the macro code (e.g. through a goto or a return) in order -+ * to prevent undefined results. -+ */ -+#define GET_UTF8(val, GET_BYTE, ERROR) \ -+ val = (GET_BYTE); \ -+ { \ -+ uint32_t top = (val & 128) >> 1; \ -+ if ((val & 0xc0) == 0x80 || val >= 0xFE) { \ -+ ERROR \ -+ } \ -+ while (val & top) { \ -+ unsigned int tmp = (GET_BYTE)-128; \ -+ if (tmp >> 6) { \ -+ ERROR \ -+ } \ -+ val = (val << 6) + tmp; \ -+ top <<= 5; \ -+ } \ -+ val &= (top << 1) - 1; \ -+ } -+ -+/** -+ * Convert a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form. -+ * -+ * @param val Output value, must be an lvalue of type uint32_t. -+ * @param GET_16BIT Expression returning two bytes of UTF-16 data converted -+ * to native byte order. Evaluated one or two times. -+ * @param ERROR Expression to be evaluated on invalid input, -+ * typically a goto statement. -+ */ -+#define GET_UTF16(val, GET_16BIT, ERROR) \ -+ val = (GET_16BIT); \ -+ { \ -+ unsigned int hi = val - 0xD800; \ -+ if (hi < 0x800) { \ -+ val = (GET_16BIT)-0xDC00; \ -+ if (val > 0x3FFU || hi > 0x3FFU) { \ -+ ERROR \ -+ } \ -+ val += (hi << 10) + 0x10000; \ -+ } \ -+ } -+ -+/** -+ * @def PUT_UTF8(val, tmp, PUT_BYTE) -+ * Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes -+ * long). -+ * @param val is an input-only argument and should be of type uint32_t. It holds -+ * a UCS-4 encoded Unicode character that is to be converted to UTF-8. If -+ * val is given as a function it is executed only once. -+ * @param tmp is a temporary variable and should be of type uint8_t. It -+ * represents an intermediate value during conversion that is to be -+ * output by PUT_BYTE. -+ * @param PUT_BYTE writes the converted UTF-8 bytes to any proper destination. -+ * It could be a function or a statement, and uses tmp as the input byte. -+ * For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be -+ * executed up to 4 times for values in the valid UTF-8 range and up to -+ * 7 times in the general case, depending on the length of the converted -+ * Unicode character. -+ */ -+#define PUT_UTF8(val, tmp, PUT_BYTE) \ -+ { \ -+ int bytes, shift; \ -+ uint32_t in = val; \ -+ if (in < 0x80) { \ -+ tmp = in; \ -+ PUT_BYTE \ -+ } else { \ -+ bytes = (av_log2(in) + 4) / 5; \ -+ shift = (bytes - 1) * 6; \ -+ tmp = (256 - (256 >> bytes)) | (in >> shift); \ -+ PUT_BYTE \ -+ while (shift >= 6) { \ -+ shift -= 6; \ -+ tmp = 0x80 | ((in >> shift) & 0x3f); \ -+ PUT_BYTE \ -+ } \ -+ } \ -+ } -+ -+/** -+ * @def PUT_UTF16(val, tmp, PUT_16BIT) -+ * Convert a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes). -+ * @param val is an input-only argument and should be of type uint32_t. It holds -+ * a UCS-4 encoded Unicode character that is to be converted to UTF-16. If -+ * val is given as a function it is executed only once. -+ * @param tmp is a temporary variable and should be of type uint16_t. It -+ * represents an intermediate value during conversion that is to be -+ * output by PUT_16BIT. -+ * @param PUT_16BIT writes the converted UTF-16 data to any proper destination -+ * in desired endianness. It could be a function or a statement, and uses tmp -+ * as the input byte. For example, PUT_BYTE could be "*output++ = tmp;" -+ * PUT_BYTE will be executed 1 or 2 times depending on input character. -+ */ -+#define PUT_UTF16(val, tmp, PUT_16BIT) \ -+ { \ -+ uint32_t in = val; \ -+ if (in < 0x10000) { \ -+ tmp = in; \ -+ PUT_16BIT \ -+ } else { \ -+ tmp = 0xD800 | ((in - 0x10000) >> 10); \ -+ PUT_16BIT \ -+ tmp = 0xDC00 | ((in - 0x10000) & 0x3FF); \ -+ PUT_16BIT \ -+ } \ -+ } -+ -+#include "mem.h" -+ -+#ifdef HAVE_AV_CONFIG_H -+# include "internal.h" -+#endif /* HAVE_AV_CONFIG_H */ -+ -+#endif /* AVUTIL_COMMON_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/cpu.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/cpu.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/cpu.h -@@ -0,0 +1,138 @@ -+/* -+ * Copyright (c) 2000, 2001, 2002 Fabrice Bellard -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef AVUTIL_CPU_H -+#define AVUTIL_CPU_H -+ -+#include -+ -+#define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */ -+ -+/* lower 16 bits - CPU features */ -+#define AV_CPU_FLAG_MMX 0x0001 ///< standard MMX -+#define AV_CPU_FLAG_MMXEXT 0x0002 ///< SSE integer functions or AMD MMX ext -+#define AV_CPU_FLAG_MMX2 0x0002 ///< SSE integer functions or AMD MMX ext -+#define AV_CPU_FLAG_3DNOW 0x0004 ///< AMD 3DNOW -+#define AV_CPU_FLAG_SSE 0x0008 ///< SSE functions -+#define AV_CPU_FLAG_SSE2 0x0010 ///< PIV SSE2 functions -+#define AV_CPU_FLAG_SSE2SLOW \ -+ 0x40000000 ///< SSE2 supported, but usually not faster -+ ///< than regular MMX/SSE (e.g. Core1) -+#define AV_CPU_FLAG_3DNOWEXT 0x0020 ///< AMD 3DNowExt -+#define AV_CPU_FLAG_SSE3 0x0040 ///< Prescott SSE3 functions -+#define AV_CPU_FLAG_SSE3SLOW \ -+ 0x20000000 ///< SSE3 supported, but usually not faster -+ ///< than regular MMX/SSE (e.g. Core1) -+#define AV_CPU_FLAG_SSSE3 0x0080 ///< Conroe SSSE3 functions -+#define AV_CPU_FLAG_SSSE3SLOW \ -+ 0x4000000 ///< SSSE3 supported, but usually not faster -+#define AV_CPU_FLAG_ATOM \ -+ 0x10000000 ///< Atom processor, some SSSE3 instructions are slower -+#define AV_CPU_FLAG_SSE4 0x0100 ///< Penryn SSE4.1 functions -+#define AV_CPU_FLAG_SSE42 0x0200 ///< Nehalem SSE4.2 functions -+#define AV_CPU_FLAG_AESNI 0x80000 ///< Advanced Encryption Standard functions -+#define AV_CPU_FLAG_AVX \ -+ 0x4000 ///< AVX functions: requires OS support even if YMM registers aren't -+ ///< used -+#define AV_CPU_FLAG_AVXSLOW \ -+ 0x8000000 ///< AVX supported, but slow when using YMM registers (e.g. -+ ///< Bulldozer) -+#define AV_CPU_FLAG_XOP 0x0400 ///< Bulldozer XOP functions -+#define AV_CPU_FLAG_FMA4 0x0800 ///< Bulldozer FMA4 functions -+#define AV_CPU_FLAG_CMOV 0x1000 ///< supports cmov instruction -+#define AV_CPU_FLAG_AVX2 \ -+ 0x8000 ///< AVX2 functions: requires OS support even if YMM registers aren't -+ ///< used -+#define AV_CPU_FLAG_FMA3 0x10000 ///< Haswell FMA3 functions -+#define AV_CPU_FLAG_BMI1 0x20000 ///< Bit Manipulation Instruction Set 1 -+#define AV_CPU_FLAG_BMI2 0x40000 ///< Bit Manipulation Instruction Set 2 -+#define AV_CPU_FLAG_AVX512 \ -+ 0x100000 ///< AVX-512 functions: requires OS support even if YMM/ZMM -+ ///< registers aren't used -+#define AV_CPU_FLAG_SLOW_GATHER 0x2000000 ///< CPU has slow gathers. -+ -+#define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard -+#define AV_CPU_FLAG_VSX 0x0002 ///< ISA 2.06 -+#define AV_CPU_FLAG_POWER8 0x0004 ///< ISA 2.07 -+ -+#define AV_CPU_FLAG_ARMV5TE (1 << 0) -+#define AV_CPU_FLAG_ARMV6 (1 << 1) -+#define AV_CPU_FLAG_ARMV6T2 (1 << 2) -+#define AV_CPU_FLAG_VFP (1 << 3) -+#define AV_CPU_FLAG_VFPV3 (1 << 4) -+#define AV_CPU_FLAG_NEON (1 << 5) -+#define AV_CPU_FLAG_ARMV8 (1 << 6) -+#define AV_CPU_FLAG_VFP_VM \ -+ (1 << 7) ///< VFPv2 vector mode, deprecated in ARMv7-A and unavailable in -+ ///< various CPUs implementations -+#define AV_CPU_FLAG_SETEND (1 << 16) -+ -+#define AV_CPU_FLAG_MMI (1 << 0) -+#define AV_CPU_FLAG_MSA (1 << 1) -+ -+// Loongarch SIMD extension. -+#define AV_CPU_FLAG_LSX (1 << 0) -+#define AV_CPU_FLAG_LASX (1 << 1) -+ -+/** -+ * Return the flags which specify extensions supported by the CPU. -+ * The returned value is affected by av_force_cpu_flags() if that was used -+ * before. So av_get_cpu_flags() can easily be used in an application to -+ * detect the enabled cpu flags. -+ */ -+int av_get_cpu_flags(void); -+ -+/** -+ * Disables cpu detection and forces the specified flags. -+ * -1 is a special case that disables forcing of specific flags. -+ */ -+void av_force_cpu_flags(int flags); -+ -+/** -+ * Parse CPU caps from a string and update the given AV_CPU_* flags based on -+ * that. -+ * -+ * @return negative on error. -+ */ -+int av_parse_cpu_caps(unsigned* flags, const char* s); -+ -+/** -+ * @return the number of logical CPU cores present. -+ */ -+int av_cpu_count(void); -+ -+/** -+ * Overrides cpu count detection and forces the specified count. -+ * Count < 1 disables forcing of specific count. -+ */ -+void av_cpu_force_count(int count); -+ -+/** -+ * Get the maximum data alignment that may be required by FFmpeg. -+ * -+ * Note that this is affected by the build configuration and the CPU flags mask, -+ * so e.g. if the CPU supports AVX, but libavutil has been built with -+ * --disable-avx or the AV_CPU_FLAG_AVX flag has been disabled through -+ * av_set_cpu_flags_mask(), then this function will behave as if AVX is not -+ * present. -+ */ -+size_t av_cpu_max_align(void); -+ -+#endif /* AVUTIL_CPU_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/dict.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/dict.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/dict.h -@@ -0,0 +1,215 @@ -+/* -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+/** -+ * @file -+ * Public dictionary API. -+ * @deprecated -+ * AVDictionary is provided for compatibility with libav. It is both in -+ * implementation as well as API inefficient. It does not scale and is -+ * extremely slow with large dictionaries. -+ * It is recommended that new code uses our tree container from tree.c/h -+ * where applicable, which uses AVL trees to achieve O(log n) performance. -+ */ -+ -+#ifndef AVUTIL_DICT_H -+#define AVUTIL_DICT_H -+ -+#include -+ -+/** -+ * @addtogroup lavu_dict AVDictionary -+ * @ingroup lavu_data -+ * -+ * @brief Simple key:value store -+ * -+ * @{ -+ * Dictionaries are used for storing key:value pairs. To create -+ * an AVDictionary, simply pass an address of a NULL pointer to -+ * av_dict_set(). NULL can be used as an empty dictionary wherever -+ * a pointer to an AVDictionary is required. -+ * Use av_dict_get() to retrieve an entry or iterate over all -+ * entries and finally av_dict_free() to free the dictionary -+ * and all its contents. -+ * -+ @code -+ AVDictionary *d = NULL; // "create" an empty dictionary -+ AVDictionaryEntry *t = NULL; -+ -+ av_dict_set(&d, "foo", "bar", 0); // add an entry -+ -+ char *k = av_strdup("key"); // if your strings are already allocated, -+ char *v = av_strdup("value"); // you can avoid copying them like this -+ av_dict_set(&d, k, v, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL); -+ -+ while (t = av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX)) { -+ <....> // iterate over all entries in d -+ } -+ av_dict_free(&d); -+ @endcode -+ */ -+ -+#define AV_DICT_MATCH_CASE \ -+ 1 /**< Only get an entry with exact-case key match. Only relevant in \ -+ av_dict_get(). */ -+#define AV_DICT_IGNORE_SUFFIX \ -+ 2 /**< Return first entry in a dictionary whose first part corresponds to \ -+ the search key, ignoring the suffix of the found key string. Only \ -+ relevant in av_dict_get(). */ -+#define AV_DICT_DONT_STRDUP_KEY \ -+ 4 /**< Take ownership of a key that's been \ -+ allocated with av_malloc() or another memory allocation function. */ -+#define AV_DICT_DONT_STRDUP_VAL \ -+ 8 /**< Take ownership of a value that's been \ -+ allocated with av_malloc() or another memory allocation function. */ -+#define AV_DICT_DONT_OVERWRITE 16 ///< Don't overwrite existing entries. -+#define AV_DICT_APPEND \ -+ 32 /**< If the entry already exists, append to it. Note that no \ -+ delimiter is added, the strings are simply concatenated. */ -+#define AV_DICT_MULTIKEY \ -+ 64 /**< Allow to store several equal keys in the dictionary */ -+ -+typedef struct AVDictionaryEntry { -+ char* key; -+ char* value; -+} AVDictionaryEntry; -+ -+typedef struct AVDictionary AVDictionary; -+ -+/** -+ * Get a dictionary entry with matching key. -+ * -+ * The returned entry key or value must not be changed, or it will -+ * cause undefined behavior. -+ * -+ * To iterate through all the dictionary entries, you can set the matching key -+ * to the null string "" and set the AV_DICT_IGNORE_SUFFIX flag. -+ * -+ * @param prev Set to the previous matching element to find the next. -+ * If set to NULL the first matching element is returned. -+ * @param key matching key -+ * @param flags a collection of AV_DICT_* flags controlling how the entry is -+ * retrieved -+ * @return found entry or NULL in case no matching entry was found in the -+ * dictionary -+ */ -+AVDictionaryEntry* av_dict_get(const AVDictionary* m, const char* key, -+ const AVDictionaryEntry* prev, int flags); -+ -+/** -+ * Get number of entries in dictionary. -+ * -+ * @param m dictionary -+ * @return number of entries in dictionary -+ */ -+int av_dict_count(const AVDictionary* m); -+ -+/** -+ * Set the given entry in *pm, overwriting an existing entry. -+ * -+ * Note: If AV_DICT_DONT_STRDUP_KEY or AV_DICT_DONT_STRDUP_VAL is set, -+ * these arguments will be freed on error. -+ * -+ * Warning: Adding a new entry to a dictionary invalidates all existing entries -+ * previously returned with av_dict_get. -+ * -+ * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL -+ * a dictionary struct is allocated and put in *pm. -+ * @param key entry key to add to *pm (will either be av_strduped or added as a -+ * new key depending on flags) -+ * @param value entry value to add to *pm (will be av_strduped or added as a new -+ * key depending on flags). Passing a NULL value will cause an existing entry to -+ * be deleted. -+ * @return >= 0 on success otherwise an error code <0 -+ */ -+int av_dict_set(AVDictionary** pm, const char* key, const char* value, -+ int flags); -+ -+/** -+ * Convenience wrapper for av_dict_set that converts the value to a string -+ * and stores it. -+ * -+ * Note: If AV_DICT_DONT_STRDUP_KEY is set, key will be freed on error. -+ */ -+int av_dict_set_int(AVDictionary** pm, const char* key, int64_t value, -+ int flags); -+ -+/** -+ * Parse the key/value pairs list and add the parsed entries to a dictionary. -+ * -+ * In case of failure, all the successfully set entries are stored in -+ * *pm. You may need to manually free the created dictionary. -+ * -+ * @param key_val_sep a 0-terminated list of characters used to separate -+ * key from value -+ * @param pairs_sep a 0-terminated list of characters used to separate -+ * two pairs from each other -+ * @param flags flags to use when adding to dictionary. -+ * AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL -+ * are ignored since the key/value tokens will always -+ * be duplicated. -+ * @return 0 on success, negative AVERROR code on failure -+ */ -+int av_dict_parse_string(AVDictionary** pm, const char* str, -+ const char* key_val_sep, const char* pairs_sep, -+ int flags); -+ -+/** -+ * Copy entries from one AVDictionary struct into another. -+ * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, -+ * this function will allocate a struct for you and put it in *dst -+ * @param src pointer to source AVDictionary struct -+ * @param flags flags to use when setting entries in *dst -+ * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag -+ * @return 0 on success, negative AVERROR code on failure. If dst was allocated -+ * by this function, callers should free the associated memory. -+ */ -+int av_dict_copy(AVDictionary** dst, const AVDictionary* src, int flags); -+ -+/** -+ * Free all the memory allocated for an AVDictionary struct -+ * and all keys and values. -+ */ -+void av_dict_free(AVDictionary** m); -+ -+/** -+ * Get dictionary entries as a string. -+ * -+ * Create a string containing dictionary's entries. -+ * Such string may be passed back to av_dict_parse_string(). -+ * @note String is escaped with backslashes ('\'). -+ * -+ * @param[in] m dictionary -+ * @param[out] buffer Pointer to buffer that will be allocated with -+ * string containg entries. Buffer must be freed by the caller when is no longer -+ * needed. -+ * @param[in] key_val_sep character used to separate key from value -+ * @param[in] pairs_sep character used to separate two pairs from each -+ * other -+ * @return >= 0 on success, negative on error -+ * @warning Separators cannot be neither '\\' nor '\0'. They also cannot be the -+ * same. -+ */ -+int av_dict_get_string(const AVDictionary* m, char** buffer, -+ const char key_val_sep, const char pairs_sep); -+ -+/** -+ * @} -+ */ -+ -+#endif /* AVUTIL_DICT_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/error.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/error.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/error.h -@@ -0,0 +1,158 @@ -+/* -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+/** -+ * @file -+ * error code definitions -+ */ -+ -+#ifndef AVUTIL_ERROR_H -+#define AVUTIL_ERROR_H -+ -+#include -+#include -+ -+#include "macros.h" -+ -+/** -+ * @addtogroup lavu_error -+ * -+ * @{ -+ */ -+ -+/* error handling */ -+#if EDOM > 0 -+# define AVERROR(e) \ -+ (-(e)) ///< Returns a negative error code from a POSIX error code, to -+ ///< return from library functions. -+# define AVUNERROR(e) \ -+ (-(e)) ///< Returns a POSIX error code from a library function error return -+ ///< value. -+#else -+/* Some platforms have E* and errno already negated. */ -+# define AVERROR(e) (e) -+# define AVUNERROR(e) (e) -+#endif -+ -+#define FFERRTAG(a, b, c, d) (-(int)MKTAG(a, b, c, d)) -+ -+#define AVERROR_BSF_NOT_FOUND \ -+ FFERRTAG(0xF8, 'B', 'S', 'F') ///< Bitstream filter not found -+#define AVERROR_BUG \ -+ FFERRTAG('B', 'U', 'G', '!') ///< Internal bug, also see AVERROR_BUG2 -+#define AVERROR_BUFFER_TOO_SMALL \ -+ FFERRTAG('B', 'U', 'F', 'S') ///< Buffer too small -+#define AVERROR_DECODER_NOT_FOUND \ -+ FFERRTAG(0xF8, 'D', 'E', 'C') ///< Decoder not found -+#define AVERROR_DEMUXER_NOT_FOUND \ -+ FFERRTAG(0xF8, 'D', 'E', 'M') ///< Demuxer not found -+#define AVERROR_ENCODER_NOT_FOUND \ -+ FFERRTAG(0xF8, 'E', 'N', 'C') ///< Encoder not found -+#define AVERROR_EOF FFERRTAG('E', 'O', 'F', ' ') ///< End of file -+#define AVERROR_EXIT \ -+ FFERRTAG('E', 'X', 'I', 'T') ///< Immediate exit was requested; the called -+ ///< function should not be restarted -+#define AVERROR_EXTERNAL \ -+ FFERRTAG('E', 'X', 'T', ' ') ///< Generic error in an external library -+#define AVERROR_FILTER_NOT_FOUND \ -+ FFERRTAG(0xF8, 'F', 'I', 'L') ///< Filter not found -+#define AVERROR_INVALIDDATA \ -+ FFERRTAG('I', 'N', 'D', 'A') ///< Invalid data found when processing input -+#define AVERROR_MUXER_NOT_FOUND \ -+ FFERRTAG(0xF8, 'M', 'U', 'X') ///< Muxer not found -+#define AVERROR_OPTION_NOT_FOUND \ -+ FFERRTAG(0xF8, 'O', 'P', 'T') ///< Option not found -+#define AVERROR_PATCHWELCOME \ -+ FFERRTAG('P', 'A', 'W', \ -+ 'E') ///< Not yet implemented in FFmpeg, patches welcome -+#define AVERROR_PROTOCOL_NOT_FOUND \ -+ FFERRTAG(0xF8, 'P', 'R', 'O') ///< Protocol not found -+ -+#define AVERROR_STREAM_NOT_FOUND \ -+ FFERRTAG(0xF8, 'S', 'T', 'R') ///< Stream not found -+/** -+ * This is semantically identical to AVERROR_BUG -+ * it has been introduced in Libav after our AVERROR_BUG and with a modified -+ * value. -+ */ -+#define AVERROR_BUG2 FFERRTAG('B', 'U', 'G', ' ') -+#define AVERROR_UNKNOWN \ -+ FFERRTAG('U', 'N', 'K', \ -+ 'N') ///< Unknown error, typically from an external library -+#define AVERROR_EXPERIMENTAL \ -+ (-0x2bb2afa8) ///< Requested feature is flagged experimental. Set -+ ///< strict_std_compliance if you really want to use it. -+#define AVERROR_INPUT_CHANGED \ -+ (-0x636e6701) ///< Input changed between calls. Reconfiguration is required. -+ ///< (can be OR-ed with AVERROR_OUTPUT_CHANGED) -+#define AVERROR_OUTPUT_CHANGED \ -+ (-0x636e6702) ///< Output changed between calls. Reconfiguration is required. -+ ///< (can be OR-ed with AVERROR_INPUT_CHANGED) -+/* HTTP & RTSP errors */ -+#define AVERROR_HTTP_BAD_REQUEST FFERRTAG(0xF8, '4', '0', '0') -+#define AVERROR_HTTP_UNAUTHORIZED FFERRTAG(0xF8, '4', '0', '1') -+#define AVERROR_HTTP_FORBIDDEN FFERRTAG(0xF8, '4', '0', '3') -+#define AVERROR_HTTP_NOT_FOUND FFERRTAG(0xF8, '4', '0', '4') -+#define AVERROR_HTTP_OTHER_4XX FFERRTAG(0xF8, '4', 'X', 'X') -+#define AVERROR_HTTP_SERVER_ERROR FFERRTAG(0xF8, '5', 'X', 'X') -+ -+#define AV_ERROR_MAX_STRING_SIZE 64 -+ -+/** -+ * Put a description of the AVERROR code errnum in errbuf. -+ * In case of failure the global variable errno is set to indicate the -+ * error. Even in case of failure av_strerror() will print a generic -+ * error message indicating the errnum provided to errbuf. -+ * -+ * @param errnum error code to describe -+ * @param errbuf buffer to which description is written -+ * @param errbuf_size the size in bytes of errbuf -+ * @return 0 on success, a negative value if a description for errnum -+ * cannot be found -+ */ -+int av_strerror(int errnum, char* errbuf, size_t errbuf_size); -+ -+/** -+ * Fill the provided buffer with a string containing an error string -+ * corresponding to the AVERROR code errnum. -+ * -+ * @param errbuf a buffer -+ * @param errbuf_size size in bytes of errbuf -+ * @param errnum error code to describe -+ * @return the buffer in input, filled with the error description -+ * @see av_strerror() -+ */ -+static inline char* av_make_error_string(char* errbuf, size_t errbuf_size, -+ int errnum) { -+ av_strerror(errnum, errbuf, errbuf_size); -+ return errbuf; -+} -+ -+/** -+ * Convenience macro, the return value should be used only directly in -+ * function arguments but never stand-alone. -+ */ -+#define av_err2str(errnum) \ -+ av_make_error_string((char[AV_ERROR_MAX_STRING_SIZE]){0}, \ -+ AV_ERROR_MAX_STRING_SIZE, errnum) -+ -+/** -+ * @} -+ */ -+ -+#endif /* AVUTIL_ERROR_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/frame.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/frame.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/frame.h -@@ -0,0 +1,927 @@ -+/* -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+/** -+ * @file -+ * @ingroup lavu_frame -+ * reference-counted frame API -+ */ -+ -+#ifndef AVUTIL_FRAME_H -+#define AVUTIL_FRAME_H -+ -+#include -+#include -+ -+#include "avutil.h" -+#include "buffer.h" -+#include "dict.h" -+#include "rational.h" -+#include "samplefmt.h" -+#include "pixfmt.h" -+#include "version.h" -+ -+/** -+ * @defgroup lavu_frame AVFrame -+ * @ingroup lavu_data -+ * -+ * @{ -+ * AVFrame is an abstraction for reference-counted raw multimedia data. -+ */ -+ -+enum AVFrameSideDataType { -+ /** -+ * The data is the AVPanScan struct defined in libavcodec. -+ */ -+ AV_FRAME_DATA_PANSCAN, -+ /** -+ * ATSC A53 Part 4 Closed Captions. -+ * A53 CC bitstream is stored as uint8_t in AVFrameSideData.data. -+ * The number of bytes of CC data is AVFrameSideData.size. -+ */ -+ AV_FRAME_DATA_A53_CC, -+ /** -+ * Stereoscopic 3d metadata. -+ * The data is the AVStereo3D struct defined in libavutil/stereo3d.h. -+ */ -+ AV_FRAME_DATA_STEREO3D, -+ /** -+ * The data is the AVMatrixEncoding enum defined in -+ * libavutil/channel_layout.h. -+ */ -+ AV_FRAME_DATA_MATRIXENCODING, -+ /** -+ * Metadata relevant to a downmix procedure. -+ * The data is the AVDownmixInfo struct defined in libavutil/downmix_info.h. -+ */ -+ AV_FRAME_DATA_DOWNMIX_INFO, -+ /** -+ * ReplayGain information in the form of the AVReplayGain struct. -+ */ -+ AV_FRAME_DATA_REPLAYGAIN, -+ /** -+ * This side data contains a 3x3 transformation matrix describing an affine -+ * transformation that needs to be applied to the frame for correct -+ * presentation. -+ * -+ * See libavutil/display.h for a detailed description of the data. -+ */ -+ AV_FRAME_DATA_DISPLAYMATRIX, -+ /** -+ * Active Format Description data consisting of a single byte as specified -+ * in ETSI TS 101 154 using AVActiveFormatDescription enum. -+ */ -+ AV_FRAME_DATA_AFD, -+ /** -+ * Motion vectors exported by some codecs (on demand through the export_mvs -+ * flag set in the libavcodec AVCodecContext flags2 option). -+ * The data is the AVMotionVector struct defined in -+ * libavutil/motion_vector.h. -+ */ -+ AV_FRAME_DATA_MOTION_VECTORS, -+ /** -+ * Recommmends skipping the specified number of samples. This is exported -+ * only if the "skip_manual" AVOption is set in libavcodec. -+ * This has the same format as AV_PKT_DATA_SKIP_SAMPLES. -+ * @code -+ * u32le number of samples to skip from start of this packet -+ * u32le number of samples to skip from end of this packet -+ * u8 reason for start skip -+ * u8 reason for end skip (0=padding silence, 1=convergence) -+ * @endcode -+ */ -+ AV_FRAME_DATA_SKIP_SAMPLES, -+ /** -+ * This side data must be associated with an audio frame and corresponds to -+ * enum AVAudioServiceType defined in avcodec.h. -+ */ -+ AV_FRAME_DATA_AUDIO_SERVICE_TYPE, -+ /** -+ * Mastering display metadata associated with a video frame. The payload is -+ * an AVMasteringDisplayMetadata type and contains information about the -+ * mastering display color volume. -+ */ -+ AV_FRAME_DATA_MASTERING_DISPLAY_METADATA, -+ /** -+ * The GOP timecode in 25 bit timecode format. Data format is 64-bit integer. -+ * This is set on the first frame of a GOP that has a temporal reference of 0. -+ */ -+ AV_FRAME_DATA_GOP_TIMECODE, -+ -+ /** -+ * The data represents the AVSphericalMapping structure defined in -+ * libavutil/spherical.h. -+ */ -+ AV_FRAME_DATA_SPHERICAL, -+ -+ /** -+ * Content light level (based on CTA-861.3). This payload contains data in -+ * the form of the AVContentLightMetadata struct. -+ */ -+ AV_FRAME_DATA_CONTENT_LIGHT_LEVEL, -+ -+ /** -+ * The data contains an ICC profile as an opaque octet buffer following the -+ * format described by ISO 15076-1 with an optional name defined in the -+ * metadata key entry "name". -+ */ -+ AV_FRAME_DATA_ICC_PROFILE, -+ -+ /** -+ * Timecode which conforms to SMPTE ST 12-1. The data is an array of 4 -+ * uint32_t where the first uint32_t describes how many (1-3) of the other -+ * timecodes are used. The timecode format is described in the documentation -+ * of av_timecode_get_smpte_from_framenum() function in libavutil/timecode.h. -+ */ -+ AV_FRAME_DATA_S12M_TIMECODE, -+ -+ /** -+ * HDR dynamic metadata associated with a video frame. The payload is -+ * an AVDynamicHDRPlus type and contains information for color -+ * volume transform - application 4 of SMPTE 2094-40:2016 standard. -+ */ -+ AV_FRAME_DATA_DYNAMIC_HDR_PLUS, -+ -+ /** -+ * Regions Of Interest, the data is an array of AVRegionOfInterest type, the -+ * number of array element is implied by AVFrameSideData.size / -+ * AVRegionOfInterest.self_size. -+ */ -+ AV_FRAME_DATA_REGIONS_OF_INTEREST, -+ -+ /** -+ * Encoding parameters for a video frame, as described by AVVideoEncParams. -+ */ -+ AV_FRAME_DATA_VIDEO_ENC_PARAMS, -+ -+ /** -+ * User data unregistered metadata associated with a video frame. -+ * This is the H.26[45] UDU SEI message, and shouldn't be used for any other -+ * purpose The data is stored as uint8_t in AVFrameSideData.data which is 16 -+ * bytes of uuid_iso_iec_11578 followed by AVFrameSideData.size - 16 bytes of -+ * user_data_payload_byte. -+ */ -+ AV_FRAME_DATA_SEI_UNREGISTERED, -+ -+ /** -+ * Film grain parameters for a frame, described by AVFilmGrainParams. -+ * Must be present for every frame which should have film grain applied. -+ */ -+ AV_FRAME_DATA_FILM_GRAIN_PARAMS, -+ -+ /** -+ * Bounding boxes for object detection and classification, -+ * as described by AVDetectionBBoxHeader. -+ */ -+ AV_FRAME_DATA_DETECTION_BBOXES, -+ -+ /** -+ * Dolby Vision RPU raw data, suitable for passing to x265 -+ * or other libraries. Array of uint8_t, with NAL emulation -+ * bytes intact. -+ */ -+ AV_FRAME_DATA_DOVI_RPU_BUFFER, -+ -+ /** -+ * Parsed Dolby Vision metadata, suitable for passing to a software -+ * implementation. The payload is the AVDOVIMetadata struct defined in -+ * libavutil/dovi_meta.h. -+ */ -+ AV_FRAME_DATA_DOVI_METADATA, -+}; -+ -+enum AVActiveFormatDescription { -+ AV_AFD_SAME = 8, -+ AV_AFD_4_3 = 9, -+ AV_AFD_16_9 = 10, -+ AV_AFD_14_9 = 11, -+ AV_AFD_4_3_SP_14_9 = 13, -+ AV_AFD_16_9_SP_14_9 = 14, -+ AV_AFD_SP_4_3 = 15, -+}; -+ -+/** -+ * Structure to hold side data for an AVFrame. -+ * -+ * sizeof(AVFrameSideData) is not a part of the public ABI, so new fields may be -+ * added to the end with a minor bump. -+ */ -+typedef struct AVFrameSideData { -+ enum AVFrameSideDataType type; -+ uint8_t* data; -+ size_t size; -+ AVDictionary* metadata; -+ AVBufferRef* buf; -+} AVFrameSideData; -+ -+/** -+ * Structure describing a single Region Of Interest. -+ * -+ * When multiple regions are defined in a single side-data block, they -+ * should be ordered from most to least important - some encoders are only -+ * capable of supporting a limited number of distinct regions, so will have -+ * to truncate the list. -+ * -+ * When overlapping regions are defined, the first region containing a given -+ * area of the frame applies. -+ */ -+typedef struct AVRegionOfInterest { -+ /** -+ * Must be set to the size of this data structure (that is, -+ * sizeof(AVRegionOfInterest)). -+ */ -+ uint32_t self_size; -+ /** -+ * Distance in pixels from the top edge of the frame to the top and -+ * bottom edges and from the left edge of the frame to the left and -+ * right edges of the rectangle defining this region of interest. -+ * -+ * The constraints on a region are encoder dependent, so the region -+ * actually affected may be slightly larger for alignment or other -+ * reasons. -+ */ -+ int top; -+ int bottom; -+ int left; -+ int right; -+ /** -+ * Quantisation offset. -+ * -+ * Must be in the range -1 to +1. A value of zero indicates no quality -+ * change. A negative value asks for better quality (less quantisation), -+ * while a positive value asks for worse quality (greater quantisation). -+ * -+ * The range is calibrated so that the extreme values indicate the -+ * largest possible offset - if the rest of the frame is encoded with the -+ * worst possible quality, an offset of -1 indicates that this region -+ * should be encoded with the best possible quality anyway. Intermediate -+ * values are then interpolated in some codec-dependent way. -+ * -+ * For example, in 10-bit H.264 the quantisation parameter varies between -+ * -12 and 51. A typical qoffset value of -1/10 therefore indicates that -+ * this region should be encoded with a QP around one-tenth of the full -+ * range better than the rest of the frame. So, if most of the frame -+ * were to be encoded with a QP of around 30, this region would get a QP -+ * of around 24 (an offset of approximately -1/10 * (51 - -12) = -6.3). -+ * An extreme value of -1 would indicate that this region should be -+ * encoded with the best possible quality regardless of the treatment of -+ * the rest of the frame - that is, should be encoded at a QP of -12. -+ */ -+ AVRational qoffset; -+} AVRegionOfInterest; -+ -+/** -+ * This structure describes decoded (raw) audio or video data. -+ * -+ * AVFrame must be allocated using av_frame_alloc(). Note that this only -+ * allocates the AVFrame itself, the buffers for the data must be managed -+ * through other means (see below). -+ * AVFrame must be freed with av_frame_free(). -+ * -+ * AVFrame is typically allocated once and then reused multiple times to hold -+ * different data (e.g. a single AVFrame to hold frames received from a -+ * decoder). In such a case, av_frame_unref() will free any references held by -+ * the frame and reset it to its original clean state before it -+ * is reused again. -+ * -+ * The data described by an AVFrame is usually reference counted through the -+ * AVBuffer API. The underlying buffer references are stored in AVFrame.buf / -+ * AVFrame.extended_buf. An AVFrame is considered to be reference counted if at -+ * least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case, -+ * every single data plane must be contained in one of the buffers in -+ * AVFrame.buf or AVFrame.extended_buf. -+ * There may be a single buffer for all the data, or one separate buffer for -+ * each plane, or anything in between. -+ * -+ * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added -+ * to the end with a minor bump. -+ * -+ * Fields can be accessed through AVOptions, the name string used, matches the -+ * C structure field name for fields accessible through AVOptions. The AVClass -+ * for AVFrame can be obtained from avcodec_get_frame_class() -+ */ -+typedef struct AVFrame { -+#define AV_NUM_DATA_POINTERS 8 -+ /** -+ * pointer to the picture/channel planes. -+ * This might be different from the first allocated byte. For video, -+ * it could even point to the end of the image data. -+ * -+ * All pointers in data and extended_data must point into one of the -+ * AVBufferRef in buf or extended_buf. -+ * -+ * Some decoders access areas outside 0,0 - width,height, please -+ * see avcodec_align_dimensions2(). Some filters and swscale can read -+ * up to 16 bytes beyond the planes, if these filters are to be used, -+ * then 16 extra bytes must be allocated. -+ * -+ * NOTE: Pointers not needed by the format MUST be set to NULL. -+ * -+ * @attention In case of video, the data[] pointers can point to the -+ * end of image data in order to reverse line order, when used in -+ * combination with negative values in the linesize[] array. -+ */ -+ uint8_t* data[AV_NUM_DATA_POINTERS]; -+ -+ /** -+ * For video, a positive or negative value, which is typically indicating -+ * the size in bytes of each picture line, but it can also be: -+ * - the negative byte size of lines for vertical flipping -+ * (with data[n] pointing to the end of the data -+ * - a positive or negative multiple of the byte size as for accessing -+ * even and odd fields of a frame (possibly flipped) -+ * -+ * For audio, only linesize[0] may be set. For planar audio, each channel -+ * plane must be the same size. -+ * -+ * For video the linesizes should be multiples of the CPUs alignment -+ * preference, this is 16 or 32 for modern desktop CPUs. -+ * Some code requires such alignment other code can be slower without -+ * correct alignment, for yet other it makes no difference. -+ * -+ * @note The linesize may be larger than the size of usable data -- there -+ * may be extra padding present for performance reasons. -+ * -+ * @attention In case of video, line size values can be negative to achieve -+ * a vertically inverted iteration over image lines. -+ */ -+ int linesize[AV_NUM_DATA_POINTERS]; -+ -+ /** -+ * pointers to the data planes/channels. -+ * -+ * For video, this should simply point to data[]. -+ * -+ * For planar audio, each channel has a separate data pointer, and -+ * linesize[0] contains the size of each channel buffer. -+ * For packed audio, there is just one data pointer, and linesize[0] -+ * contains the total size of the buffer for all channels. -+ * -+ * Note: Both data and extended_data should always be set in a valid frame, -+ * but for planar audio with more channels that can fit in data, -+ * extended_data must be used in order to access all channels. -+ */ -+ uint8_t** extended_data; -+ -+ /** -+ * @name Video dimensions -+ * Video frames only. The coded dimensions (in pixels) of the video frame, -+ * i.e. the size of the rectangle that contains some well-defined values. -+ * -+ * @note The part of the frame intended for display/presentation is further -+ * restricted by the @ref cropping "Cropping rectangle". -+ * @{ -+ */ -+ int width, height; -+ /** -+ * @} -+ */ -+ -+ /** -+ * number of audio samples (per channel) described by this frame -+ */ -+ int nb_samples; -+ -+ /** -+ * format of the frame, -1 if unknown or unset -+ * Values correspond to enum AVPixelFormat for video frames, -+ * enum AVSampleFormat for audio) -+ */ -+ int format; -+ -+ /** -+ * 1 -> keyframe, 0-> not -+ */ -+ int key_frame; -+ -+ /** -+ * Picture type of the frame. -+ */ -+ enum AVPictureType pict_type; -+ -+ /** -+ * Sample aspect ratio for the video frame, 0/1 if unknown/unspecified. -+ */ -+ AVRational sample_aspect_ratio; -+ -+ /** -+ * Presentation timestamp in time_base units (time when frame should be shown -+ * to user). -+ */ -+ int64_t pts; -+ -+ /** -+ * DTS copied from the AVPacket that triggered returning this frame. (if frame -+ * threading isn't used) This is also the Presentation time of this AVFrame -+ * calculated from only AVPacket.dts values without pts values. -+ */ -+ int64_t pkt_dts; -+ -+ /** -+ * Time base for the timestamps in this frame. -+ * In the future, this field may be set on frames output by decoders or -+ * filters, but its value will be by default ignored on input to encoders -+ * or filters. -+ */ -+ AVRational time_base; -+ -+ /** -+ * picture number in bitstream order -+ */ -+ int coded_picture_number; -+ /** -+ * picture number in display order -+ */ -+ int display_picture_number; -+ -+ /** -+ * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) -+ */ -+ int quality; -+ -+ /** -+ * for some private data of the user -+ */ -+ void* opaque; -+ -+ /** -+ * When decoding, this signals how much the picture must be delayed. -+ * extra_delay = repeat_pict / (2*fps) -+ */ -+ int repeat_pict; -+ -+ /** -+ * The content of the picture is interlaced. -+ */ -+ int interlaced_frame; -+ -+ /** -+ * If the content is interlaced, is top field displayed first. -+ */ -+ int top_field_first; -+ -+ /** -+ * Tell user application that palette has changed from previous frame. -+ */ -+ int palette_has_changed; -+ -+ /** -+ * reordered opaque 64 bits (generally an integer or a double precision float -+ * PTS but can be anything). -+ * The user sets AVCodecContext.reordered_opaque to represent the input at -+ * that time, -+ * the decoder reorders values as needed and sets AVFrame.reordered_opaque -+ * to exactly one of the values provided by the user through -+ * AVCodecContext.reordered_opaque -+ */ -+ int64_t reordered_opaque; -+ -+ /** -+ * Sample rate of the audio data. -+ */ -+ int sample_rate; -+ -+ /** -+ * Channel layout of the audio data. -+ */ -+ uint64_t channel_layout; -+ -+ /** -+ * AVBuffer references backing the data for this frame. All the pointers in -+ * data and extended_data must point inside one of the buffers in buf or -+ * extended_buf. This array must be filled contiguously -- if buf[i] is -+ * non-NULL then buf[j] must also be non-NULL for all j < i. -+ * -+ * There may be at most one AVBuffer per data plane, so for video this array -+ * always contains all the references. For planar audio with more than -+ * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in -+ * this array. Then the extra AVBufferRef pointers are stored in the -+ * extended_buf array. -+ */ -+ AVBufferRef* buf[AV_NUM_DATA_POINTERS]; -+ -+ /** -+ * For planar audio which requires more than AV_NUM_DATA_POINTERS -+ * AVBufferRef pointers, this array will hold all the references which -+ * cannot fit into AVFrame.buf. -+ * -+ * Note that this is different from AVFrame.extended_data, which always -+ * contains all the pointers. This array only contains the extra pointers, -+ * which cannot fit into AVFrame.buf. -+ * -+ * This array is always allocated using av_malloc() by whoever constructs -+ * the frame. It is freed in av_frame_unref(). -+ */ -+ AVBufferRef** extended_buf; -+ /** -+ * Number of elements in extended_buf. -+ */ -+ int nb_extended_buf; -+ -+ AVFrameSideData** side_data; -+ int nb_side_data; -+ -+/** -+ * @defgroup lavu_frame_flags AV_FRAME_FLAGS -+ * @ingroup lavu_frame -+ * Flags describing additional frame properties. -+ * -+ * @{ -+ */ -+ -+/** -+ * The frame data may be corrupted, e.g. due to decoding errors. -+ */ -+#define AV_FRAME_FLAG_CORRUPT (1 << 0) -+/** -+ * A flag to mark the frames which need to be decoded, but shouldn't be output. -+ */ -+#define AV_FRAME_FLAG_DISCARD (1 << 2) -+ /** -+ * @} -+ */ -+ -+ /** -+ * Frame flags, a combination of @ref lavu_frame_flags -+ */ -+ int flags; -+ -+ /** -+ * MPEG vs JPEG YUV range. -+ * - encoding: Set by user -+ * - decoding: Set by libavcodec -+ */ -+ enum AVColorRange color_range; -+ -+ enum AVColorPrimaries color_primaries; -+ -+ enum AVColorTransferCharacteristic color_trc; -+ -+ /** -+ * YUV colorspace type. -+ * - encoding: Set by user -+ * - decoding: Set by libavcodec -+ */ -+ enum AVColorSpace colorspace; -+ -+ enum AVChromaLocation chroma_location; -+ -+ /** -+ * frame timestamp estimated using various heuristics, in stream time base -+ * - encoding: unused -+ * - decoding: set by libavcodec, read by user. -+ */ -+ int64_t best_effort_timestamp; -+ -+ /** -+ * reordered pos from the last AVPacket that has been input into the decoder -+ * - encoding: unused -+ * - decoding: Read by user. -+ */ -+ int64_t pkt_pos; -+ -+ /** -+ * duration of the corresponding packet, expressed in -+ * AVStream->time_base units, 0 if unknown. -+ * - encoding: unused -+ * - decoding: Read by user. -+ */ -+ int64_t pkt_duration; -+ -+ /** -+ * metadata. -+ * - encoding: Set by user. -+ * - decoding: Set by libavcodec. -+ */ -+ AVDictionary* metadata; -+ -+ /** -+ * decode error flags of the frame, set to a combination of -+ * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there -+ * were errors during the decoding. -+ * - encoding: unused -+ * - decoding: set by libavcodec, read by user. -+ */ -+ int decode_error_flags; -+#define FF_DECODE_ERROR_INVALID_BITSTREAM 1 -+#define FF_DECODE_ERROR_MISSING_REFERENCE 2 -+#define FF_DECODE_ERROR_CONCEALMENT_ACTIVE 4 -+#define FF_DECODE_ERROR_DECODE_SLICES 8 -+ -+ /** -+ * number of audio channels, only used for audio. -+ * - encoding: unused -+ * - decoding: Read by user. -+ */ -+ int channels; -+ -+ /** -+ * size of the corresponding packet containing the compressed -+ * frame. -+ * It is set to a negative value if unknown. -+ * - encoding: unused -+ * - decoding: set by libavcodec, read by user. -+ */ -+ int pkt_size; -+ -+ /** -+ * For hwaccel-format frames, this should be a reference to the -+ * AVHWFramesContext describing the frame. -+ */ -+ AVBufferRef* hw_frames_ctx; -+ -+ /** -+ * AVBufferRef for free use by the API user. FFmpeg will never check the -+ * contents of the buffer ref. FFmpeg calls av_buffer_unref() on it when -+ * the frame is unreferenced. av_frame_copy_props() calls create a new -+ * reference with av_buffer_ref() for the target frame's opaque_ref field. -+ * -+ * This is unrelated to the opaque field, although it serves a similar -+ * purpose. -+ */ -+ AVBufferRef* opaque_ref; -+ -+ /** -+ * @anchor cropping -+ * @name Cropping -+ * Video frames only. The number of pixels to discard from the the -+ * top/bottom/left/right border of the frame to obtain the sub-rectangle of -+ * the frame intended for presentation. -+ * @{ -+ */ -+ size_t crop_top; -+ size_t crop_bottom; -+ size_t crop_left; -+ size_t crop_right; -+ /** -+ * @} -+ */ -+ -+ /** -+ * AVBufferRef for internal use by a single libav* library. -+ * Must not be used to transfer data between libraries. -+ * Has to be NULL when ownership of the frame leaves the respective library. -+ * -+ * Code outside the FFmpeg libs should never check or change the contents of -+ * the buffer ref. -+ * -+ * FFmpeg calls av_buffer_unref() on it when the frame is unreferenced. -+ * av_frame_copy_props() calls create a new reference with av_buffer_ref() -+ * for the target frame's private_ref field. -+ */ -+ AVBufferRef* private_ref; -+} AVFrame; -+ -+#if FF_API_COLORSPACE_NAME -+/** -+ * Get the name of a colorspace. -+ * @return a static string identifying the colorspace; can be NULL. -+ * @deprecated use av_color_space_name() -+ */ -+attribute_deprecated const char* av_get_colorspace_name(enum AVColorSpace val); -+#endif -+/** -+ * Allocate an AVFrame and set its fields to default values. The resulting -+ * struct must be freed using av_frame_free(). -+ * -+ * @return An AVFrame filled with default values or NULL on failure. -+ * -+ * @note this only allocates the AVFrame itself, not the data buffers. Those -+ * must be allocated through other means, e.g. with av_frame_get_buffer() or -+ * manually. -+ */ -+AVFrame* av_frame_alloc(void); -+ -+/** -+ * Free the frame and any dynamically allocated objects in it, -+ * e.g. extended_data. If the frame is reference counted, it will be -+ * unreferenced first. -+ * -+ * @param frame frame to be freed. The pointer will be set to NULL. -+ */ -+void av_frame_free(AVFrame** frame); -+ -+/** -+ * Set up a new reference to the data described by the source frame. -+ * -+ * Copy frame properties from src to dst and create a new reference for each -+ * AVBufferRef from src. -+ * -+ * If src is not reference counted, new buffers are allocated and the data is -+ * copied. -+ * -+ * @warning: dst MUST have been either unreferenced with av_frame_unref(dst), -+ * or newly allocated with av_frame_alloc() before calling this -+ * function, or undefined behavior will occur. -+ * -+ * @return 0 on success, a negative AVERROR on error -+ */ -+int av_frame_ref(AVFrame* dst, const AVFrame* src); -+ -+/** -+ * Create a new frame that references the same data as src. -+ * -+ * This is a shortcut for av_frame_alloc()+av_frame_ref(). -+ * -+ * @return newly created AVFrame on success, NULL on error. -+ */ -+AVFrame* av_frame_clone(const AVFrame* src); -+ -+/** -+ * Unreference all the buffers referenced by frame and reset the frame fields. -+ */ -+void av_frame_unref(AVFrame* frame); -+ -+/** -+ * Move everything contained in src to dst and reset src. -+ * -+ * @warning: dst is not unreferenced, but directly overwritten without reading -+ * or deallocating its contents. Call av_frame_unref(dst) manually -+ * before calling this function to ensure that no memory is leaked. -+ */ -+void av_frame_move_ref(AVFrame* dst, AVFrame* src); -+ -+/** -+ * Allocate new buffer(s) for audio or video data. -+ * -+ * The following fields must be set on frame before calling this function: -+ * - format (pixel format for video, sample format for audio) -+ * - width and height for video -+ * - nb_samples and channel_layout for audio -+ * -+ * This function will fill AVFrame.data and AVFrame.buf arrays and, if -+ * necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf. -+ * For planar formats, one buffer will be allocated for each plane. -+ * -+ * @warning: if frame already has been allocated, calling this function will -+ * leak memory. In addition, undefined behavior can occur in certain -+ * cases. -+ * -+ * @param frame frame in which to store the new buffers. -+ * @param align Required buffer size alignment. If equal to 0, alignment will be -+ * chosen automatically for the current CPU. It is highly -+ * recommended to pass 0 here unless you know what you are doing. -+ * -+ * @return 0 on success, a negative AVERROR on error. -+ */ -+int av_frame_get_buffer(AVFrame* frame, int align); -+ -+/** -+ * Check if the frame data is writable. -+ * -+ * @return A positive value if the frame data is writable (which is true if and -+ * only if each of the underlying buffers has only one reference, namely the one -+ * stored in this frame). Return 0 otherwise. -+ * -+ * If 1 is returned the answer is valid until av_buffer_ref() is called on any -+ * of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly). -+ * -+ * @see av_frame_make_writable(), av_buffer_is_writable() -+ */ -+int av_frame_is_writable(AVFrame* frame); -+ -+/** -+ * Ensure that the frame data is writable, avoiding data copy if possible. -+ * -+ * Do nothing if the frame is writable, allocate new buffers and copy the data -+ * if it is not. -+ * -+ * @return 0 on success, a negative AVERROR on error. -+ * -+ * @see av_frame_is_writable(), av_buffer_is_writable(), -+ * av_buffer_make_writable() -+ */ -+int av_frame_make_writable(AVFrame* frame); -+ -+/** -+ * Copy the frame data from src to dst. -+ * -+ * This function does not allocate anything, dst must be already initialized and -+ * allocated with the same parameters as src. -+ * -+ * This function only copies the frame data (i.e. the contents of the data / -+ * extended data arrays), not any other properties. -+ * -+ * @return >= 0 on success, a negative AVERROR on error. -+ */ -+int av_frame_copy(AVFrame* dst, const AVFrame* src); -+ -+/** -+ * Copy only "metadata" fields from src to dst. -+ * -+ * Metadata for the purpose of this function are those fields that do not affect -+ * the data layout in the buffers. E.g. pts, sample rate (for audio) or sample -+ * aspect ratio (for video), but not width/height or channel layout. -+ * Side data is also copied. -+ */ -+int av_frame_copy_props(AVFrame* dst, const AVFrame* src); -+ -+/** -+ * Get the buffer reference a given data plane is stored in. -+ * -+ * @param plane index of the data plane of interest in frame->extended_data. -+ * -+ * @return the buffer reference that contains the plane or NULL if the input -+ * frame is not valid. -+ */ -+AVBufferRef* av_frame_get_plane_buffer(AVFrame* frame, int plane); -+ -+/** -+ * Add a new side data to a frame. -+ * -+ * @param frame a frame to which the side data should be added -+ * @param type type of the added side data -+ * @param size size of the side data -+ * -+ * @return newly added side data on success, NULL on error -+ */ -+AVFrameSideData* av_frame_new_side_data(AVFrame* frame, -+ enum AVFrameSideDataType type, -+ size_t size); -+ -+/** -+ * Add a new side data to a frame from an existing AVBufferRef -+ * -+ * @param frame a frame to which the side data should be added -+ * @param type the type of the added side data -+ * @param buf an AVBufferRef to add as side data. The ownership of -+ * the reference is transferred to the frame. -+ * -+ * @return newly added side data on success, NULL on error. On failure -+ * the frame is unchanged and the AVBufferRef remains owned by -+ * the caller. -+ */ -+AVFrameSideData* av_frame_new_side_data_from_buf(AVFrame* frame, -+ enum AVFrameSideDataType type, -+ AVBufferRef* buf); -+ -+/** -+ * @return a pointer to the side data of a given type on success, NULL if there -+ * is no side data with such type in this frame. -+ */ -+AVFrameSideData* av_frame_get_side_data(const AVFrame* frame, -+ enum AVFrameSideDataType type); -+ -+/** -+ * Remove and free all side data instances of the given type. -+ */ -+void av_frame_remove_side_data(AVFrame* frame, enum AVFrameSideDataType type); -+ -+/** -+ * Flags for frame cropping. -+ */ -+enum { -+ /** -+ * Apply the maximum possible cropping, even if it requires setting the -+ * AVFrame.data[] entries to unaligned pointers. Passing unaligned data -+ * to FFmpeg API is generally not allowed, and causes undefined behavior -+ * (such as crashes). You can pass unaligned data only to FFmpeg APIs that -+ * are explicitly documented to accept it. Use this flag only if you -+ * absolutely know what you are doing. -+ */ -+ AV_FRAME_CROP_UNALIGNED = 1 << 0, -+}; -+ -+/** -+ * Crop the given video AVFrame according to its crop_left/crop_top/crop_right/ -+ * crop_bottom fields. If cropping is successful, the function will adjust the -+ * data pointers and the width/height fields, and set the crop fields to 0. -+ * -+ * In all cases, the cropping boundaries will be rounded to the inherent -+ * alignment of the pixel format. In some cases, such as for opaque hwaccel -+ * formats, the left/top cropping is ignored. The crop fields are set to 0 even -+ * if the cropping was rounded or ignored. -+ * -+ * @param frame the frame which should be cropped -+ * @param flags Some combination of AV_FRAME_CROP_* flags, or 0. -+ * -+ * @return >= 0 on success, a negative AVERROR on error. If the cropping fields -+ * were invalid, AVERROR(ERANGE) is returned, and nothing is changed. -+ */ -+int av_frame_apply_cropping(AVFrame* frame, int flags); -+ -+/** -+ * @return a string identifying the side data type -+ */ -+const char* av_frame_side_data_name(enum AVFrameSideDataType type); -+ -+/** -+ * @} -+ */ -+ -+#endif /* AVUTIL_FRAME_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/hwcontext.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/hwcontext.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/hwcontext.h -@@ -0,0 +1,601 @@ -+/* -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef AVUTIL_HWCONTEXT_H -+#define AVUTIL_HWCONTEXT_H -+ -+#include "buffer.h" -+#include "frame.h" -+#include "log.h" -+#include "pixfmt.h" -+ -+enum AVHWDeviceType { -+ AV_HWDEVICE_TYPE_NONE, -+ AV_HWDEVICE_TYPE_VDPAU, -+ AV_HWDEVICE_TYPE_CUDA, -+ AV_HWDEVICE_TYPE_VAAPI, -+ AV_HWDEVICE_TYPE_DXVA2, -+ AV_HWDEVICE_TYPE_QSV, -+ AV_HWDEVICE_TYPE_VIDEOTOOLBOX, -+ AV_HWDEVICE_TYPE_D3D11VA, -+ AV_HWDEVICE_TYPE_DRM, -+ AV_HWDEVICE_TYPE_OPENCL, -+ AV_HWDEVICE_TYPE_MEDIACODEC, -+ AV_HWDEVICE_TYPE_VULKAN, -+}; -+ -+typedef struct AVHWDeviceInternal AVHWDeviceInternal; -+ -+/** -+ * This struct aggregates all the (hardware/vendor-specific) "high-level" state, -+ * i.e. state that is not tied to a concrete processing configuration. -+ * E.g., in an API that supports hardware-accelerated encoding and decoding, -+ * this struct will (if possible) wrap the state that is common to both encoding -+ * and decoding and from which specific instances of encoders or decoders can be -+ * derived. -+ * -+ * This struct is reference-counted with the AVBuffer mechanism. The -+ * av_hwdevice_ctx_alloc() constructor yields a reference, whose data field -+ * points to the actual AVHWDeviceContext. Further objects derived from -+ * AVHWDeviceContext (such as AVHWFramesContext, describing a frame pool with -+ * specific properties) will hold an internal reference to it. After all the -+ * references are released, the AVHWDeviceContext itself will be freed, -+ * optionally invoking a user-specified callback for uninitializing the hardware -+ * state. -+ */ -+typedef struct AVHWDeviceContext { -+ /** -+ * A class for logging. Set by av_hwdevice_ctx_alloc(). -+ */ -+ const AVClass* av_class; -+ -+ /** -+ * Private data used internally by libavutil. Must not be accessed in any -+ * way by the caller. -+ */ -+ AVHWDeviceInternal* internal; -+ -+ /** -+ * This field identifies the underlying API used for hardware access. -+ * -+ * This field is set when this struct is allocated and never changed -+ * afterwards. -+ */ -+ enum AVHWDeviceType type; -+ -+ /** -+ * The format-specific data, allocated and freed by libavutil along with -+ * this context. -+ * -+ * Should be cast by the user to the format-specific context defined in the -+ * corresponding header (hwcontext_*.h) and filled as described in the -+ * documentation before calling av_hwdevice_ctx_init(). -+ * -+ * After calling av_hwdevice_ctx_init() this struct should not be modified -+ * by the caller. -+ */ -+ void* hwctx; -+ -+ /** -+ * This field may be set by the caller before calling av_hwdevice_ctx_init(). -+ * -+ * If non-NULL, this callback will be called when the last reference to -+ * this context is unreferenced, immediately before it is freed. -+ * -+ * @note when other objects (e.g an AVHWFramesContext) are derived from this -+ * struct, this callback will be invoked after all such child objects -+ * are fully uninitialized and their respective destructors invoked. -+ */ -+ void (*free)(struct AVHWDeviceContext* ctx); -+ -+ /** -+ * Arbitrary user data, to be used e.g. by the free() callback. -+ */ -+ void* user_opaque; -+} AVHWDeviceContext; -+ -+typedef struct AVHWFramesInternal AVHWFramesInternal; -+ -+/** -+ * This struct describes a set or pool of "hardware" frames (i.e. those with -+ * data not located in normal system memory). All the frames in the pool are -+ * assumed to be allocated in the same way and interchangeable. -+ * -+ * This struct is reference-counted with the AVBuffer mechanism and tied to a -+ * given AVHWDeviceContext instance. The av_hwframe_ctx_alloc() constructor -+ * yields a reference, whose data field points to the actual AVHWFramesContext -+ * struct. -+ */ -+typedef struct AVHWFramesContext { -+ /** -+ * A class for logging. -+ */ -+ const AVClass* av_class; -+ -+ /** -+ * Private data used internally by libavutil. Must not be accessed in any -+ * way by the caller. -+ */ -+ AVHWFramesInternal* internal; -+ -+ /** -+ * A reference to the parent AVHWDeviceContext. This reference is owned and -+ * managed by the enclosing AVHWFramesContext, but the caller may derive -+ * additional references from it. -+ */ -+ AVBufferRef* device_ref; -+ -+ /** -+ * The parent AVHWDeviceContext. This is simply a pointer to -+ * device_ref->data provided for convenience. -+ * -+ * Set by libavutil in av_hwframe_ctx_init(). -+ */ -+ AVHWDeviceContext* device_ctx; -+ -+ /** -+ * The format-specific data, allocated and freed automatically along with -+ * this context. -+ * -+ * Should be cast by the user to the format-specific context defined in the -+ * corresponding header (hwframe_*.h) and filled as described in the -+ * documentation before calling av_hwframe_ctx_init(). -+ * -+ * After any frames using this context are created, the contents of this -+ * struct should not be modified by the caller. -+ */ -+ void* hwctx; -+ -+ /** -+ * This field may be set by the caller before calling av_hwframe_ctx_init(). -+ * -+ * If non-NULL, this callback will be called when the last reference to -+ * this context is unreferenced, immediately before it is freed. -+ */ -+ void (*free)(struct AVHWFramesContext* ctx); -+ -+ /** -+ * Arbitrary user data, to be used e.g. by the free() callback. -+ */ -+ void* user_opaque; -+ -+ /** -+ * A pool from which the frames are allocated by av_hwframe_get_buffer(). -+ * This field may be set by the caller before calling av_hwframe_ctx_init(). -+ * The buffers returned by calling av_buffer_pool_get() on this pool must -+ * have the properties described in the documentation in the corresponding hw -+ * type's header (hwcontext_*.h). The pool will be freed strictly before -+ * this struct's free() callback is invoked. -+ * -+ * This field may be NULL, then libavutil will attempt to allocate a pool -+ * internally. Note that certain device types enforce pools allocated at -+ * fixed size (frame count), which cannot be extended dynamically. In such a -+ * case, initial_pool_size must be set appropriately. -+ */ -+ AVBufferPool* pool; -+ -+ /** -+ * Initial size of the frame pool. If a device type does not support -+ * dynamically resizing the pool, then this is also the maximum pool size. -+ * -+ * May be set by the caller before calling av_hwframe_ctx_init(). Must be -+ * set if pool is NULL and the device type does not support dynamic pools. -+ */ -+ int initial_pool_size; -+ -+ /** -+ * The pixel format identifying the underlying HW surface type. -+ * -+ * Must be a hwaccel format, i.e. the corresponding descriptor must have the -+ * AV_PIX_FMT_FLAG_HWACCEL flag set. -+ * -+ * Must be set by the user before calling av_hwframe_ctx_init(). -+ */ -+ enum AVPixelFormat format; -+ -+ /** -+ * The pixel format identifying the actual data layout of the hardware -+ * frames. -+ * -+ * Must be set by the caller before calling av_hwframe_ctx_init(). -+ * -+ * @note when the underlying API does not provide the exact data layout, but -+ * only the colorspace/bit depth, this field should be set to the fully -+ * planar version of that format (e.g. for 8-bit 420 YUV it should be -+ * AV_PIX_FMT_YUV420P, not AV_PIX_FMT_NV12 or anything else). -+ */ -+ enum AVPixelFormat sw_format; -+ -+ /** -+ * The allocated dimensions of the frames in this pool. -+ * -+ * Must be set by the user before calling av_hwframe_ctx_init(). -+ */ -+ int width, height; -+} AVHWFramesContext; -+ -+/** -+ * Look up an AVHWDeviceType by name. -+ * -+ * @param name String name of the device type (case-insensitive). -+ * @return The type from enum AVHWDeviceType, or AV_HWDEVICE_TYPE_NONE if -+ * not found. -+ */ -+enum AVHWDeviceType av_hwdevice_find_type_by_name(const char* name); -+ -+/** Get the string name of an AVHWDeviceType. -+ * -+ * @param type Type from enum AVHWDeviceType. -+ * @return Pointer to a static string containing the name, or NULL if the type -+ * is not valid. -+ */ -+const char* av_hwdevice_get_type_name(enum AVHWDeviceType type); -+ -+/** -+ * Iterate over supported device types. -+ * -+ * @param type AV_HWDEVICE_TYPE_NONE initially, then the previous type -+ * returned by this function in subsequent iterations. -+ * @return The next usable device type from enum AVHWDeviceType, or -+ * AV_HWDEVICE_TYPE_NONE if there are no more. -+ */ -+enum AVHWDeviceType av_hwdevice_iterate_types(enum AVHWDeviceType prev); -+ -+/** -+ * Allocate an AVHWDeviceContext for a given hardware type. -+ * -+ * @param type the type of the hardware device to allocate. -+ * @return a reference to the newly created AVHWDeviceContext on success or NULL -+ * on failure. -+ */ -+AVBufferRef* av_hwdevice_ctx_alloc(enum AVHWDeviceType type); -+ -+/** -+ * Finalize the device context before use. This function must be called after -+ * the context is filled with all the required information and before it is -+ * used in any way. -+ * -+ * @param ref a reference to the AVHWDeviceContext -+ * @return 0 on success, a negative AVERROR code on failure -+ */ -+int av_hwdevice_ctx_init(AVBufferRef* ref); -+ -+/** -+ * Open a device of the specified type and create an AVHWDeviceContext for it. -+ * -+ * This is a convenience function intended to cover the simple cases. Callers -+ * who need to fine-tune device creation/management should open the device -+ * manually and then wrap it in an AVHWDeviceContext using -+ * av_hwdevice_ctx_alloc()/av_hwdevice_ctx_init(). -+ * -+ * The returned context is already initialized and ready for use, the caller -+ * should not call av_hwdevice_ctx_init() on it. The user_opaque/free fields of -+ * the created AVHWDeviceContext are set by this function and should not be -+ * touched by the caller. -+ * -+ * @param device_ctx On success, a reference to the newly-created device context -+ * will be written here. The reference is owned by the caller -+ * and must be released with av_buffer_unref() when no longer -+ * needed. On failure, NULL will be written to this pointer. -+ * @param type The type of the device to create. -+ * @param device A type-specific string identifying the device to open. -+ * @param opts A dictionary of additional (type-specific) options to use in -+ * opening the device. The dictionary remains owned by the caller. -+ * @param flags currently unused -+ * -+ * @return 0 on success, a negative AVERROR code on failure. -+ */ -+int av_hwdevice_ctx_create(AVBufferRef** device_ctx, enum AVHWDeviceType type, -+ const char* device, AVDictionary* opts, int flags); -+ -+/** -+ * Create a new device of the specified type from an existing device. -+ * -+ * If the source device is a device of the target type or was originally -+ * derived from such a device (possibly through one or more intermediate -+ * devices of other types), then this will return a reference to the -+ * existing device of the same type as is requested. -+ * -+ * Otherwise, it will attempt to derive a new device from the given source -+ * device. If direct derivation to the new type is not implemented, it will -+ * attempt the same derivation from each ancestor of the source device in -+ * turn looking for an implemented derivation method. -+ * -+ * @param dst_ctx On success, a reference to the newly-created -+ * AVHWDeviceContext. -+ * @param type The type of the new device to create. -+ * @param src_ctx A reference to an existing AVHWDeviceContext which will be -+ * used to create the new device. -+ * @param flags Currently unused; should be set to zero. -+ * @return Zero on success, a negative AVERROR code on failure. -+ */ -+int av_hwdevice_ctx_create_derived(AVBufferRef** dst_ctx, -+ enum AVHWDeviceType type, -+ AVBufferRef* src_ctx, int flags); -+ -+/** -+ * Create a new device of the specified type from an existing device. -+ * -+ * This function performs the same action as av_hwdevice_ctx_create_derived, -+ * however, it is able to set options for the new device to be derived. -+ * -+ * @param dst_ctx On success, a reference to the newly-created -+ * AVHWDeviceContext. -+ * @param type The type of the new device to create. -+ * @param src_ctx A reference to an existing AVHWDeviceContext which will be -+ * used to create the new device. -+ * @param options Options for the new device to create, same format as in -+ * av_hwdevice_ctx_create. -+ * @param flags Currently unused; should be set to zero. -+ * @return Zero on success, a negative AVERROR code on failure. -+ */ -+int av_hwdevice_ctx_create_derived_opts(AVBufferRef** dst_ctx, -+ enum AVHWDeviceType type, -+ AVBufferRef* src_ctx, -+ AVDictionary* options, int flags); -+ -+/** -+ * Allocate an AVHWFramesContext tied to a given device context. -+ * -+ * @param device_ctx a reference to a AVHWDeviceContext. This function will make -+ * a new reference for internal use, the one passed to the -+ * function remains owned by the caller. -+ * @return a reference to the newly created AVHWFramesContext on success or NULL -+ * on failure. -+ */ -+AVBufferRef* av_hwframe_ctx_alloc(AVBufferRef* device_ctx); -+ -+/** -+ * Finalize the context before use. This function must be called after the -+ * context is filled with all the required information and before it is attached -+ * to any frames. -+ * -+ * @param ref a reference to the AVHWFramesContext -+ * @return 0 on success, a negative AVERROR code on failure -+ */ -+int av_hwframe_ctx_init(AVBufferRef* ref); -+ -+/** -+ * Allocate a new frame attached to the given AVHWFramesContext. -+ * -+ * @param hwframe_ctx a reference to an AVHWFramesContext -+ * @param frame an empty (freshly allocated or unreffed) frame to be filled with -+ * newly allocated buffers. -+ * @param flags currently unused, should be set to zero -+ * @return 0 on success, a negative AVERROR code on failure -+ */ -+int av_hwframe_get_buffer(AVBufferRef* hwframe_ctx, AVFrame* frame, int flags); -+ -+/** -+ * Copy data to or from a hw surface. At least one of dst/src must have an -+ * AVHWFramesContext attached. -+ * -+ * If src has an AVHWFramesContext attached, then the format of dst (if set) -+ * must use one of the formats returned by av_hwframe_transfer_get_formats(src, -+ * AV_HWFRAME_TRANSFER_DIRECTION_FROM). -+ * If dst has an AVHWFramesContext attached, then the format of src must use one -+ * of the formats returned by av_hwframe_transfer_get_formats(dst, -+ * AV_HWFRAME_TRANSFER_DIRECTION_TO) -+ * -+ * dst may be "clean" (i.e. with data/buf pointers unset), in which case the -+ * data buffers will be allocated by this function using av_frame_get_buffer(). -+ * If dst->format is set, then this format will be used, otherwise (when -+ * dst->format is AV_PIX_FMT_NONE) the first acceptable format will be chosen. -+ * -+ * The two frames must have matching allocated dimensions (i.e. equal to -+ * AVHWFramesContext.width/height), since not all device types support -+ * transferring a sub-rectangle of the whole surface. The display dimensions -+ * (i.e. AVFrame.width/height) may be smaller than the allocated dimensions, but -+ * also have to be equal for both frames. When the display dimensions are -+ * smaller than the allocated dimensions, the content of the padding in the -+ * destination frame is unspecified. -+ * -+ * @param dst the destination frame. dst is not touched on failure. -+ * @param src the source frame. -+ * @param flags currently unused, should be set to zero -+ * @return 0 on success, a negative AVERROR error code on failure. -+ */ -+int av_hwframe_transfer_data(AVFrame* dst, const AVFrame* src, int flags); -+ -+enum AVHWFrameTransferDirection { -+ /** -+ * Transfer the data from the queried hw frame. -+ */ -+ AV_HWFRAME_TRANSFER_DIRECTION_FROM, -+ -+ /** -+ * Transfer the data to the queried hw frame. -+ */ -+ AV_HWFRAME_TRANSFER_DIRECTION_TO, -+}; -+ -+/** -+ * Get a list of possible source or target formats usable in -+ * av_hwframe_transfer_data(). -+ * -+ * @param hwframe_ctx the frame context to obtain the information for -+ * @param dir the direction of the transfer -+ * @param formats the pointer to the output format list will be written here. -+ * The list is terminated with AV_PIX_FMT_NONE and must be freed -+ * by the caller when no longer needed using av_free(). -+ * If this function returns successfully, the format list will -+ * have at least one item (not counting the terminator). -+ * On failure, the contents of this pointer are unspecified. -+ * @param flags currently unused, should be set to zero -+ * @return 0 on success, a negative AVERROR code on failure. -+ */ -+int av_hwframe_transfer_get_formats(AVBufferRef* hwframe_ctx, -+ enum AVHWFrameTransferDirection dir, -+ enum AVPixelFormat** formats, int flags); -+ -+/** -+ * This struct describes the constraints on hardware frames attached to -+ * a given device with a hardware-specific configuration. This is returned -+ * by av_hwdevice_get_hwframe_constraints() and must be freed by -+ * av_hwframe_constraints_free() after use. -+ */ -+typedef struct AVHWFramesConstraints { -+ /** -+ * A list of possible values for format in the hw_frames_ctx, -+ * terminated by AV_PIX_FMT_NONE. This member will always be filled. -+ */ -+ enum AVPixelFormat* valid_hw_formats; -+ -+ /** -+ * A list of possible values for sw_format in the hw_frames_ctx, -+ * terminated by AV_PIX_FMT_NONE. Can be NULL if this information is -+ * not known. -+ */ -+ enum AVPixelFormat* valid_sw_formats; -+ -+ /** -+ * The minimum size of frames in this hw_frames_ctx. -+ * (Zero if not known.) -+ */ -+ int min_width; -+ int min_height; -+ -+ /** -+ * The maximum size of frames in this hw_frames_ctx. -+ * (INT_MAX if not known / no limit.) -+ */ -+ int max_width; -+ int max_height; -+} AVHWFramesConstraints; -+ -+/** -+ * Allocate a HW-specific configuration structure for a given HW device. -+ * After use, the user must free all members as required by the specific -+ * hardware structure being used, then free the structure itself with -+ * av_free(). -+ * -+ * @param device_ctx a reference to the associated AVHWDeviceContext. -+ * @return The newly created HW-specific configuration structure on -+ * success or NULL on failure. -+ */ -+void* av_hwdevice_hwconfig_alloc(AVBufferRef* device_ctx); -+ -+/** -+ * Get the constraints on HW frames given a device and the HW-specific -+ * configuration to be used with that device. If no HW-specific -+ * configuration is provided, returns the maximum possible capabilities -+ * of the device. -+ * -+ * @param ref a reference to the associated AVHWDeviceContext. -+ * @param hwconfig a filled HW-specific configuration structure, or NULL -+ * to return the maximum possible capabilities of the device. -+ * @return AVHWFramesConstraints structure describing the constraints -+ * on the device, or NULL if not available. -+ */ -+AVHWFramesConstraints* av_hwdevice_get_hwframe_constraints( -+ AVBufferRef* ref, const void* hwconfig); -+ -+/** -+ * Free an AVHWFrameConstraints structure. -+ * -+ * @param constraints The (filled or unfilled) AVHWFrameConstraints structure. -+ */ -+void av_hwframe_constraints_free(AVHWFramesConstraints** constraints); -+ -+/** -+ * Flags to apply to frame mappings. -+ */ -+enum { -+ /** -+ * The mapping must be readable. -+ */ -+ AV_HWFRAME_MAP_READ = 1 << 0, -+ /** -+ * The mapping must be writeable. -+ */ -+ AV_HWFRAME_MAP_WRITE = 1 << 1, -+ /** -+ * The mapped frame will be overwritten completely in subsequent -+ * operations, so the current frame data need not be loaded. Any values -+ * which are not overwritten are unspecified. -+ */ -+ AV_HWFRAME_MAP_OVERWRITE = 1 << 2, -+ /** -+ * The mapping must be direct. That is, there must not be any copying in -+ * the map or unmap steps. Note that performance of direct mappings may -+ * be much lower than normal memory. -+ */ -+ AV_HWFRAME_MAP_DIRECT = 1 << 3, -+}; -+ -+/** -+ * Map a hardware frame. -+ * -+ * This has a number of different possible effects, depending on the format -+ * and origin of the src and dst frames. On input, src should be a usable -+ * frame with valid buffers and dst should be blank (typically as just created -+ * by av_frame_alloc()). src should have an associated hwframe context, and -+ * dst may optionally have a format and associated hwframe context. -+ * -+ * If src was created by mapping a frame from the hwframe context of dst, -+ * then this function undoes the mapping - dst is replaced by a reference to -+ * the frame that src was originally mapped from. -+ * -+ * If both src and dst have an associated hwframe context, then this function -+ * attempts to map the src frame from its hardware context to that of dst and -+ * then fill dst with appropriate data to be usable there. This will only be -+ * possible if the hwframe contexts and associated devices are compatible - -+ * given compatible devices, av_hwframe_ctx_create_derived() can be used to -+ * create a hwframe context for dst in which mapping should be possible. -+ * -+ * If src has a hwframe context but dst does not, then the src frame is -+ * mapped to normal memory and should thereafter be usable as a normal frame. -+ * If the format is set on dst, then the mapping will attempt to create dst -+ * with that format and fail if it is not possible. If format is unset (is -+ * AV_PIX_FMT_NONE) then dst will be mapped with whatever the most appropriate -+ * format to use is (probably the sw_format of the src hwframe context). -+ * -+ * A return value of AVERROR(ENOSYS) indicates that the mapping is not -+ * possible with the given arguments and hwframe setup, while other return -+ * values indicate that it failed somehow. -+ * -+ * @param dst Destination frame, to contain the mapping. -+ * @param src Source frame, to be mapped. -+ * @param flags Some combination of AV_HWFRAME_MAP_* flags. -+ * @return Zero on success, negative AVERROR code on failure. -+ */ -+int av_hwframe_map(AVFrame* dst, const AVFrame* src, int flags); -+ -+/** -+ * Create and initialise an AVHWFramesContext as a mapping of another existing -+ * AVHWFramesContext on a different device. -+ * -+ * av_hwframe_ctx_init() should not be called after this. -+ * -+ * @param derived_frame_ctx On success, a reference to the newly created -+ * AVHWFramesContext. -+ * @param derived_device_ctx A reference to the device to create the new -+ * AVHWFramesContext on. -+ * @param source_frame_ctx A reference to an existing AVHWFramesContext -+ * which will be mapped to the derived context. -+ * @param flags Some combination of AV_HWFRAME_MAP_* flags, defining the -+ * mapping parameters to apply to frames which are allocated -+ * in the derived device. -+ * @return Zero on success, negative AVERROR code on failure. -+ */ -+int av_hwframe_ctx_create_derived(AVBufferRef** derived_frame_ctx, -+ enum AVPixelFormat format, -+ AVBufferRef* derived_device_ctx, -+ AVBufferRef* source_frame_ctx, int flags); -+ -+#endif /* AVUTIL_HWCONTEXT_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/hwcontext_vaapi.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/hwcontext_vaapi.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/hwcontext_vaapi.h -@@ -0,0 +1,117 @@ -+/* -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef AVUTIL_HWCONTEXT_VAAPI_H -+#define AVUTIL_HWCONTEXT_VAAPI_H -+ -+#include -+ -+/** -+ * @file -+ * API-specific header for AV_HWDEVICE_TYPE_VAAPI. -+ * -+ * Dynamic frame pools are supported, but note that any pool used as a render -+ * target is required to be of fixed size in order to be be usable as an -+ * argument to vaCreateContext(). -+ * -+ * For user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs -+ * with the data pointer set to a VASurfaceID. -+ */ -+ -+enum { -+ /** -+ * The quirks field has been set by the user and should not be detected -+ * automatically by av_hwdevice_ctx_init(). -+ */ -+ AV_VAAPI_DRIVER_QUIRK_USER_SET = (1 << 0), -+ /** -+ * The driver does not destroy parameter buffers when they are used by -+ * vaRenderPicture(). Additional code will be required to destroy them -+ * separately afterwards. -+ */ -+ AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS = (1 << 1), -+ -+ /** -+ * The driver does not support the VASurfaceAttribMemoryType attribute, -+ * so the surface allocation code will not try to use it. -+ */ -+ AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE = (1 << 2), -+ -+ /** -+ * The driver does not support surface attributes at all. -+ * The surface allocation code will never pass them to surface allocation, -+ * and the results of the vaQuerySurfaceAttributes() call will be faked. -+ */ -+ AV_VAAPI_DRIVER_QUIRK_SURFACE_ATTRIBUTES = (1 << 3), -+}; -+ -+/** -+ * VAAPI connection details. -+ * -+ * Allocated as AVHWDeviceContext.hwctx -+ */ -+typedef struct AVVAAPIDeviceContext { -+ /** -+ * The VADisplay handle, to be filled by the user. -+ */ -+ VADisplay display; -+ /** -+ * Driver quirks to apply - this is filled by av_hwdevice_ctx_init(), -+ * with reference to a table of known drivers, unless the -+ * AV_VAAPI_DRIVER_QUIRK_USER_SET bit is already present. The user -+ * may need to refer to this field when performing any later -+ * operations using VAAPI with the same VADisplay. -+ */ -+ unsigned int driver_quirks; -+} AVVAAPIDeviceContext; -+ -+/** -+ * VAAPI-specific data associated with a frame pool. -+ * -+ * Allocated as AVHWFramesContext.hwctx. -+ */ -+typedef struct AVVAAPIFramesContext { -+ /** -+ * Set by the user to apply surface attributes to all surfaces in -+ * the frame pool. If null, default settings are used. -+ */ -+ VASurfaceAttrib* attributes; -+ int nb_attributes; -+ /** -+ * The surfaces IDs of all surfaces in the pool after creation. -+ * Only valid if AVHWFramesContext.initial_pool_size was positive. -+ * These are intended to be used as the render_targets arguments to -+ * vaCreateContext(). -+ */ -+ VASurfaceID* surface_ids; -+ int nb_surfaces; -+} AVVAAPIFramesContext; -+ -+/** -+ * VAAPI hardware pipeline configuration details. -+ * -+ * Allocated with av_hwdevice_hwconfig_alloc(). -+ */ -+typedef struct AVVAAPIHWConfig { -+ /** -+ * ID of a VAAPI pipeline configuration. -+ */ -+ VAConfigID config_id; -+} AVVAAPIHWConfig; -+ -+#endif /* AVUTIL_HWCONTEXT_VAAPI_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/intfloat.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/intfloat.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/intfloat.h -@@ -0,0 +1,73 @@ -+/* -+ * Copyright (c) 2011 Mans Rullgard -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef AVUTIL_INTFLOAT_H -+#define AVUTIL_INTFLOAT_H -+ -+#include -+#include "attributes.h" -+ -+union av_intfloat32 { -+ uint32_t i; -+ float f; -+}; -+ -+union av_intfloat64 { -+ uint64_t i; -+ double f; -+}; -+ -+/** -+ * Reinterpret a 32-bit integer as a float. -+ */ -+static av_always_inline float av_int2float(uint32_t i) { -+ union av_intfloat32 v; -+ v.i = i; -+ return v.f; -+} -+ -+/** -+ * Reinterpret a float as a 32-bit integer. -+ */ -+static av_always_inline uint32_t av_float2int(float f) { -+ union av_intfloat32 v; -+ v.f = f; -+ return v.i; -+} -+ -+/** -+ * Reinterpret a 64-bit integer as a double. -+ */ -+static av_always_inline double av_int2double(uint64_t i) { -+ union av_intfloat64 v; -+ v.i = i; -+ return v.f; -+} -+ -+/** -+ * Reinterpret a double as a 64-bit integer. -+ */ -+static av_always_inline uint64_t av_double2int(double f) { -+ union av_intfloat64 v; -+ v.f = f; -+ return v.i; -+} -+ -+#endif /* AVUTIL_INTFLOAT_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/log.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/log.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/log.h -@@ -0,0 +1,388 @@ -+/* -+ * copyright (c) 2006 Michael Niedermayer -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef AVUTIL_LOG_H -+#define AVUTIL_LOG_H -+ -+#include -+#include "avutil.h" -+#include "attributes.h" -+ -+typedef enum { -+ AV_CLASS_CATEGORY_NA = 0, -+ AV_CLASS_CATEGORY_INPUT, -+ AV_CLASS_CATEGORY_OUTPUT, -+ AV_CLASS_CATEGORY_MUXER, -+ AV_CLASS_CATEGORY_DEMUXER, -+ AV_CLASS_CATEGORY_ENCODER, -+ AV_CLASS_CATEGORY_DECODER, -+ AV_CLASS_CATEGORY_FILTER, -+ AV_CLASS_CATEGORY_BITSTREAM_FILTER, -+ AV_CLASS_CATEGORY_SWSCALER, -+ AV_CLASS_CATEGORY_SWRESAMPLER, -+ AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT = 40, -+ AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT, -+ AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT, -+ AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT, -+ AV_CLASS_CATEGORY_DEVICE_OUTPUT, -+ AV_CLASS_CATEGORY_DEVICE_INPUT, -+ AV_CLASS_CATEGORY_NB ///< not part of ABI/API -+} AVClassCategory; -+ -+#define AV_IS_INPUT_DEVICE(category) \ -+ (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT) || \ -+ ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT) || \ -+ ((category) == AV_CLASS_CATEGORY_DEVICE_INPUT)) -+ -+#define AV_IS_OUTPUT_DEVICE(category) \ -+ (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT) || \ -+ ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT) || \ -+ ((category) == AV_CLASS_CATEGORY_DEVICE_OUTPUT)) -+ -+struct AVOptionRanges; -+ -+/** -+ * Describe the class of an AVClass context structure. That is an -+ * arbitrary struct of which the first field is a pointer to an -+ * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). -+ */ -+typedef struct AVClass { -+ /** -+ * The name of the class; usually it is the same name as the -+ * context structure type to which the AVClass is associated. -+ */ -+ const char* class_name; -+ -+ /** -+ * A pointer to a function which returns the name of a context -+ * instance ctx associated with the class. -+ */ -+ const char* (*item_name)(void* ctx); -+ -+ /** -+ * a pointer to the first option specified in the class if any or NULL -+ * -+ * @see av_set_default_options() -+ */ -+ const struct AVOption* option; -+ -+ /** -+ * LIBAVUTIL_VERSION with which this structure was created. -+ * This is used to allow fields to be added without requiring major -+ * version bumps everywhere. -+ */ -+ -+ int version; -+ -+ /** -+ * Offset in the structure where log_level_offset is stored. -+ * 0 means there is no such variable -+ */ -+ int log_level_offset_offset; -+ -+ /** -+ * Offset in the structure where a pointer to the parent context for -+ * logging is stored. For example a decoder could pass its AVCodecContext -+ * to eval as such a parent context, which an av_log() implementation -+ * could then leverage to display the parent context. -+ * The offset can be NULL. -+ */ -+ int parent_log_context_offset; -+ -+ /** -+ * Category used for visualization (like color) -+ * This is only set if the category is equal for all objects using this class. -+ * available since version (51 << 16 | 56 << 8 | 100) -+ */ -+ AVClassCategory category; -+ -+ /** -+ * Callback to return the category. -+ * available since version (51 << 16 | 59 << 8 | 100) -+ */ -+ AVClassCategory (*get_category)(void* ctx); -+ -+ /** -+ * Callback to return the supported/allowed ranges. -+ * available since version (52.12) -+ */ -+ int (*query_ranges)(struct AVOptionRanges**, void* obj, const char* key, -+ int flags); -+ -+ /** -+ * Return next AVOptions-enabled child or NULL -+ */ -+ void* (*child_next)(void* obj, void* prev); -+ -+ /** -+ * Iterate over the AVClasses corresponding to potential AVOptions-enabled -+ * children. -+ * -+ * @param iter pointer to opaque iteration state. The caller must initialize -+ * *iter to NULL before the first call. -+ * @return AVClass for the next AVOptions-enabled child or NULL if there are -+ * no more such children. -+ * -+ * @note The difference between child_next and this is that child_next -+ * iterates over _already existing_ objects, while child_class_iterate -+ * iterates over _all possible_ children. -+ */ -+ const struct AVClass* (*child_class_iterate)(void** iter); -+} AVClass; -+ -+/** -+ * @addtogroup lavu_log -+ * -+ * @{ -+ * -+ * @defgroup lavu_log_constants Logging Constants -+ * -+ * @{ -+ */ -+ -+/** -+ * Print no output. -+ */ -+#define AV_LOG_QUIET -8 -+ -+/** -+ * Something went really wrong and we will crash now. -+ */ -+#define AV_LOG_PANIC 0 -+ -+/** -+ * Something went wrong and recovery is not possible. -+ * For example, no header was found for a format which depends -+ * on headers or an illegal combination of parameters is used. -+ */ -+#define AV_LOG_FATAL 8 -+ -+/** -+ * Something went wrong and cannot losslessly be recovered. -+ * However, not all future data is affected. -+ */ -+#define AV_LOG_ERROR 16 -+ -+/** -+ * Something somehow does not look correct. This may or may not -+ * lead to problems. An example would be the use of '-vstrict -2'. -+ */ -+#define AV_LOG_WARNING 24 -+ -+/** -+ * Standard information. -+ */ -+#define AV_LOG_INFO 32 -+ -+/** -+ * Detailed information. -+ */ -+#define AV_LOG_VERBOSE 40 -+ -+/** -+ * Stuff which is only useful for libav* developers. -+ */ -+#define AV_LOG_DEBUG 48 -+ -+/** -+ * Extremely verbose debugging, useful for libav* development. -+ */ -+#define AV_LOG_TRACE 56 -+ -+#define AV_LOG_MAX_OFFSET (AV_LOG_TRACE - AV_LOG_QUIET) -+ -+/** -+ * @} -+ */ -+ -+/** -+ * Sets additional colors for extended debugging sessions. -+ * @code -+ av_log(ctx, AV_LOG_DEBUG|AV_LOG_C(134), "Message in purple\n"); -+ @endcode -+ * Requires 256color terminal support. Uses outside debugging is not -+ * recommended. -+ */ -+#define AV_LOG_C(x) ((x) << 8) -+ -+/** -+ * Send the specified message to the log if the level is less than or equal -+ * to the current av_log_level. By default, all logging messages are sent to -+ * stderr. This behavior can be altered by setting a different logging callback -+ * function. -+ * @see av_log_set_callback -+ * -+ * @param avcl A pointer to an arbitrary struct of which the first field is a -+ * pointer to an AVClass struct or NULL if general log. -+ * @param level The importance level of the message expressed using a @ref -+ * lavu_log_constants "Logging Constant". -+ * @param fmt The format string (printf-compatible) that specifies how -+ * subsequent arguments are converted to output. -+ */ -+void av_log(void* avcl, int level, const char* fmt, ...) av_printf_format(3, 4); -+ -+/** -+ * Send the specified message to the log once with the initial_level and then -+ * with the subsequent_level. By default, all logging messages are sent to -+ * stderr. This behavior can be altered by setting a different logging callback -+ * function. -+ * @see av_log -+ * -+ * @param avcl A pointer to an arbitrary struct of which the first field is a -+ * pointer to an AVClass struct or NULL if general log. -+ * @param initial_level importance level of the message expressed using a @ref -+ * lavu_log_constants "Logging Constant" for the first occurance. -+ * @param subsequent_level importance level of the message expressed using a -+ * @ref lavu_log_constants "Logging Constant" after the first occurance. -+ * @param fmt The format string (printf-compatible) that specifies how -+ * subsequent arguments are converted to output. -+ * @param state a variable to keep trak of if a message has already been printed -+ * this must be initialized to 0 before the first use. The same state -+ * must not be accessed by 2 Threads simultaneously. -+ */ -+void av_log_once(void* avcl, int initial_level, int subsequent_level, -+ int* state, const char* fmt, ...) av_printf_format(5, 6); -+ -+/** -+ * Send the specified message to the log if the level is less than or equal -+ * to the current av_log_level. By default, all logging messages are sent to -+ * stderr. This behavior can be altered by setting a different logging callback -+ * function. -+ * @see av_log_set_callback -+ * -+ * @param avcl A pointer to an arbitrary struct of which the first field is a -+ * pointer to an AVClass struct. -+ * @param level The importance level of the message expressed using a @ref -+ * lavu_log_constants "Logging Constant". -+ * @param fmt The format string (printf-compatible) that specifies how -+ * subsequent arguments are converted to output. -+ * @param vl The arguments referenced by the format string. -+ */ -+void av_vlog(void* avcl, int level, const char* fmt, va_list vl); -+ -+/** -+ * Get the current log level -+ * -+ * @see lavu_log_constants -+ * -+ * @return Current log level -+ */ -+int av_log_get_level(void); -+ -+/** -+ * Set the log level -+ * -+ * @see lavu_log_constants -+ * -+ * @param level Logging level -+ */ -+void av_log_set_level(int level); -+ -+/** -+ * Set the logging callback -+ * -+ * @note The callback must be thread safe, even if the application does not use -+ * threads itself as some codecs are multithreaded. -+ * -+ * @see av_log_default_callback -+ * -+ * @param callback A logging function with a compatible signature. -+ */ -+void av_log_set_callback(void (*callback)(void*, int, const char*, va_list)); -+ -+/** -+ * Default logging callback -+ * -+ * It prints the message to stderr, optionally colorizing it. -+ * -+ * @param avcl A pointer to an arbitrary struct of which the first field is a -+ * pointer to an AVClass struct. -+ * @param level The importance level of the message expressed using a @ref -+ * lavu_log_constants "Logging Constant". -+ * @param fmt The format string (printf-compatible) that specifies how -+ * subsequent arguments are converted to output. -+ * @param vl The arguments referenced by the format string. -+ */ -+void av_log_default_callback(void* avcl, int level, const char* fmt, -+ va_list vl); -+ -+/** -+ * Return the context name -+ * -+ * @param ctx The AVClass context -+ * -+ * @return The AVClass class_name -+ */ -+const char* av_default_item_name(void* ctx); -+AVClassCategory av_default_get_category(void* ptr); -+ -+/** -+ * Format a line of log the same way as the default callback. -+ * @param line buffer to receive the formatted line -+ * @param line_size size of the buffer -+ * @param print_prefix used to store whether the prefix must be printed; -+ * must point to a persistent integer initially set to 1 -+ */ -+void av_log_format_line(void* ptr, int level, const char* fmt, va_list vl, -+ char* line, int line_size, int* print_prefix); -+ -+/** -+ * Format a line of log the same way as the default callback. -+ * @param line buffer to receive the formatted line; -+ * may be NULL if line_size is 0 -+ * @param line_size size of the buffer; at most line_size-1 characters will -+ * be written to the buffer, plus one null terminator -+ * @param print_prefix used to store whether the prefix must be printed; -+ * must point to a persistent integer initially set to 1 -+ * @return Returns a negative value if an error occurred, otherwise returns -+ * the number of characters that would have been written for a -+ * sufficiently large buffer, not including the terminating null -+ * character. If the return value is not less than line_size, it means -+ * that the log message was truncated to fit the buffer. -+ */ -+int av_log_format_line2(void* ptr, int level, const char* fmt, va_list vl, -+ char* line, int line_size, int* print_prefix); -+ -+/** -+ * Skip repeated messages, this requires the user app to use av_log() instead of -+ * (f)printf as the 2 would otherwise interfere and lead to -+ * "Last message repeated x times" messages below (f)printf messages with some -+ * bad luck. -+ * Also to receive the last, "last repeated" line if any, the user app must -+ * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end -+ */ -+#define AV_LOG_SKIP_REPEATED 1 -+ -+/** -+ * Include the log severity in messages originating from codecs. -+ * -+ * Results in messages such as: -+ * [rawvideo @ 0xDEADBEEF] [error] encode did not produce valid pts -+ */ -+#define AV_LOG_PRINT_LEVEL 2 -+ -+void av_log_set_flags(int arg); -+int av_log_get_flags(void); -+ -+/** -+ * @} -+ */ -+ -+#endif /* AVUTIL_LOG_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/macros.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/macros.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/macros.h -@@ -0,0 +1,87 @@ -+/* -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+/** -+ * @file -+ * @ingroup lavu -+ * Utility Preprocessor macros -+ */ -+ -+#ifndef AVUTIL_MACROS_H -+#define AVUTIL_MACROS_H -+ -+#include "libavutil/avconfig.h" -+ -+#if AV_HAVE_BIGENDIAN -+# define AV_NE(be, le) (be) -+#else -+# define AV_NE(be, le) (le) -+#endif -+ -+/** -+ * Comparator. -+ * For two numerical expressions x and y, gives 1 if x > y, -1 if x < y, and 0 -+ * if x == y. This is useful for instance in a qsort comparator callback. -+ * Furthermore, compilers are able to optimize this to branchless code, and -+ * there is no risk of overflow with signed types. -+ * As with many macros, this evaluates its argument multiple times, it thus -+ * must not have a side-effect. -+ */ -+#define FFDIFFSIGN(x, y) (((x) > (y)) - ((x) < (y))) -+ -+#define FFMAX(a, b) ((a) > (b) ? (a) : (b)) -+#define FFMAX3(a, b, c) FFMAX(FFMAX(a, b), c) -+#define FFMIN(a, b) ((a) > (b) ? (b) : (a)) -+#define FFMIN3(a, b, c) FFMIN(FFMIN(a, b), c) -+ -+#define FFSWAP(type, a, b) \ -+ do { \ -+ type SWAP_tmp = b; \ -+ b = a; \ -+ a = SWAP_tmp; \ -+ } while (0) -+#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0])) -+ -+#define MKTAG(a, b, c, d) \ -+ ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24)) -+#define MKBETAG(a, b, c, d) \ -+ ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24)) -+ -+/** -+ * @addtogroup preproc_misc Preprocessor String Macros -+ * -+ * String manipulation macros -+ * -+ * @{ -+ */ -+ -+#define AV_STRINGIFY(s) AV_TOSTRING(s) -+#define AV_TOSTRING(s) #s -+ -+#define AV_GLUE(a, b) a##b -+#define AV_JOIN(a, b) AV_GLUE(a, b) -+ -+/** -+ * @} -+ */ -+ -+#define AV_PRAGMA(s) _Pragma(#s) -+ -+#define FFALIGN(x, a) (((x) + (a)-1) & ~((a)-1)) -+ -+#endif /* AVUTIL_MACROS_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/mathematics.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/mathematics.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/mathematics.h -@@ -0,0 +1,247 @@ -+/* -+ * copyright (c) 2005-2012 Michael Niedermayer -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+/** -+ * @file -+ * @addtogroup lavu_math -+ * Mathematical utilities for working with timestamp and time base. -+ */ -+ -+#ifndef AVUTIL_MATHEMATICS_H -+#define AVUTIL_MATHEMATICS_H -+ -+#include -+#include -+#include "attributes.h" -+#include "rational.h" -+#include "intfloat.h" -+ -+#ifndef M_E -+# define M_E 2.7182818284590452354 /* e */ -+#endif -+#ifndef M_LN2 -+# define M_LN2 0.69314718055994530942 /* log_e 2 */ -+#endif -+#ifndef M_LN10 -+# define M_LN10 2.30258509299404568402 /* log_e 10 */ -+#endif -+#ifndef M_LOG2_10 -+# define M_LOG2_10 3.32192809488736234787 /* log_2 10 */ -+#endif -+#ifndef M_PHI -+# define M_PHI 1.61803398874989484820 /* phi / golden ratio */ -+#endif -+#ifndef M_PI -+# define M_PI 3.14159265358979323846 /* pi */ -+#endif -+#ifndef M_PI_2 -+# define M_PI_2 1.57079632679489661923 /* pi/2 */ -+#endif -+#ifndef M_SQRT1_2 -+# define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ -+#endif -+#ifndef M_SQRT2 -+# define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ -+#endif -+#ifndef NAN -+# define NAN av_int2float(0x7fc00000) -+#endif -+#ifndef INFINITY -+# define INFINITY av_int2float(0x7f800000) -+#endif -+ -+/** -+ * @addtogroup lavu_math -+ * -+ * @{ -+ */ -+ -+/** -+ * Rounding methods. -+ */ -+enum AVRounding { -+ AV_ROUND_ZERO = 0, ///< Round toward zero. -+ AV_ROUND_INF = 1, ///< Round away from zero. -+ AV_ROUND_DOWN = 2, ///< Round toward -infinity. -+ AV_ROUND_UP = 3, ///< Round toward +infinity. -+ AV_ROUND_NEAR_INF = -+ 5, ///< Round to nearest and halfway cases away from zero. -+ /** -+ * Flag telling rescaling functions to pass `INT64_MIN`/`MAX` through -+ * unchanged, avoiding special cases for #AV_NOPTS_VALUE. -+ * -+ * Unlike other values of the enumeration AVRounding, this value is a -+ * bitmask that must be used in conjunction with another value of the -+ * enumeration through a bitwise OR, in order to set behavior for normal -+ * cases. -+ * -+ * @code{.c} -+ * av_rescale_rnd(3, 1, 2, AV_ROUND_UP | AV_ROUND_PASS_MINMAX); -+ * // Rescaling 3: -+ * // Calculating 3 * 1 / 2 -+ * // 3 / 2 is rounded up to 2 -+ * // => 2 -+ * -+ * av_rescale_rnd(AV_NOPTS_VALUE, 1, 2, AV_ROUND_UP | AV_ROUND_PASS_MINMAX); -+ * // Rescaling AV_NOPTS_VALUE: -+ * // AV_NOPTS_VALUE == INT64_MIN -+ * // AV_NOPTS_VALUE is passed through -+ * // => AV_NOPTS_VALUE -+ * @endcode -+ */ -+ AV_ROUND_PASS_MINMAX = 8192, -+}; -+ -+/** -+ * Compute the greatest common divisor of two integer operands. -+ * -+ * @param a,b Operands -+ * @return GCD of a and b up to sign; if a >= 0 and b >= 0, return value is >= -+ * 0; if a == 0 and b == 0, returns 0. -+ */ -+int64_t av_const av_gcd(int64_t a, int64_t b); -+ -+/** -+ * Rescale a 64-bit integer with rounding to nearest. -+ * -+ * The operation is mathematically equivalent to `a * b / c`, but writing that -+ * directly can overflow. -+ * -+ * This function is equivalent to av_rescale_rnd() with #AV_ROUND_NEAR_INF. -+ * -+ * @see av_rescale_rnd(), av_rescale_q(), av_rescale_q_rnd() -+ */ -+int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const; -+ -+/** -+ * Rescale a 64-bit integer with specified rounding. -+ * -+ * The operation is mathematically equivalent to `a * b / c`, but writing that -+ * directly can overflow, and does not support different rounding methods. -+ * If the result is not representable then INT64_MIN is returned. -+ * -+ * @see av_rescale(), av_rescale_q(), av_rescale_q_rnd() -+ */ -+int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, -+ enum AVRounding rnd) av_const; -+ -+/** -+ * Rescale a 64-bit integer by 2 rational numbers. -+ * -+ * The operation is mathematically equivalent to `a * bq / cq`. -+ * -+ * This function is equivalent to av_rescale_q_rnd() with #AV_ROUND_NEAR_INF. -+ * -+ * @see av_rescale(), av_rescale_rnd(), av_rescale_q_rnd() -+ */ -+int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const; -+ -+/** -+ * Rescale a 64-bit integer by 2 rational numbers with specified rounding. -+ * -+ * The operation is mathematically equivalent to `a * bq / cq`. -+ * -+ * @see av_rescale(), av_rescale_rnd(), av_rescale_q() -+ */ -+int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq, -+ enum AVRounding rnd) av_const; -+ -+/** -+ * Compare two timestamps each in its own time base. -+ * -+ * @return One of the following values: -+ * - -1 if `ts_a` is before `ts_b` -+ * - 1 if `ts_a` is after `ts_b` -+ * - 0 if they represent the same position -+ * -+ * @warning -+ * The result of the function is undefined if one of the timestamps is outside -+ * the `int64_t` range when represented in the other's timebase. -+ */ -+int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b); -+ -+/** -+ * Compare the remainders of two integer operands divided by a common divisor. -+ * -+ * In other words, compare the least significant `log2(mod)` bits of integers -+ * `a` and `b`. -+ * -+ * @code{.c} -+ * av_compare_mod(0x11, 0x02, 0x10) < 0 // since 0x11 % 0x10 (0x1) < 0x02 % -+ * 0x10 (0x2) av_compare_mod(0x11, 0x02, 0x20) > 0 // since 0x11 % 0x20 (0x11) -+ * > 0x02 % 0x20 (0x02) -+ * @endcode -+ * -+ * @param a,b Operands -+ * @param mod Divisor; must be a power of 2 -+ * @return -+ * - a negative value if `a % mod < b % mod` -+ * - a positive value if `a % mod > b % mod` -+ * - zero if `a % mod == b % mod` -+ */ -+int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod); -+ -+/** -+ * Rescale a timestamp while preserving known durations. -+ * -+ * This function is designed to be called per audio packet to scale the input -+ * timestamp to a different time base. Compared to a simple av_rescale_q() -+ * call, this function is robust against possible inconsistent frame durations. -+ * -+ * The `last` parameter is a state variable that must be preserved for all -+ * subsequent calls for the same stream. For the first call, `*last` should be -+ * initialized to #AV_NOPTS_VALUE. -+ * -+ * @param[in] in_tb Input time base -+ * @param[in] in_ts Input timestamp -+ * @param[in] fs_tb Duration time base; typically this is finer-grained -+ * (greater) than `in_tb` and `out_tb` -+ * @param[in] duration Duration till the next call to this function (i.e. -+ * duration of the current packet/frame) -+ * @param[in,out] last Pointer to a timestamp expressed in terms of -+ * `fs_tb`, acting as a state variable -+ * @param[in] out_tb Output timebase -+ * @return Timestamp expressed in terms of `out_tb` -+ * -+ * @note In the context of this function, "duration" is in term of samples, not -+ * seconds. -+ */ -+int64_t av_rescale_delta(AVRational in_tb, int64_t in_ts, AVRational fs_tb, -+ int duration, int64_t* last, AVRational out_tb); -+ -+/** -+ * Add a value to a timestamp. -+ * -+ * This function guarantees that when the same value is repeatly added that -+ * no accumulation of rounding errors occurs. -+ * -+ * @param[in] ts Input timestamp -+ * @param[in] ts_tb Input timestamp time base -+ * @param[in] inc Value to be added -+ * @param[in] inc_tb Time base of `inc` -+ */ -+int64_t av_add_stable(AVRational ts_tb, int64_t ts, AVRational inc_tb, -+ int64_t inc); -+ -+/** -+ * @} -+ */ -+ -+#endif /* AVUTIL_MATHEMATICS_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/mem.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/mem.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/mem.h -@@ -0,0 +1,708 @@ -+/* -+ * copyright (c) 2006 Michael Niedermayer -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+/** -+ * @file -+ * @ingroup lavu_mem -+ * Memory handling functions -+ */ -+ -+#ifndef AVUTIL_MEM_H -+#define AVUTIL_MEM_H -+ -+#include -+#include -+ -+#include "attributes.h" -+#include "avutil.h" -+#include "version.h" -+ -+/** -+ * @addtogroup lavu_mem -+ * Utilities for manipulating memory. -+ * -+ * FFmpeg has several applications of memory that are not required of a typical -+ * program. For example, the computing-heavy components like video decoding and -+ * encoding can be sped up significantly through the use of aligned memory. -+ * -+ * However, for each of FFmpeg's applications of memory, there might not be a -+ * recognized or standardized API for that specific use. Memory alignment, for -+ * instance, varies wildly depending on operating systems, architectures, and -+ * compilers. Hence, this component of @ref libavutil is created to make -+ * dealing with memory consistently possible on all platforms. -+ * -+ * @{ -+ */ -+ -+#if FF_API_DECLARE_ALIGNED -+/** -+ * -+ * @defgroup lavu_mem_macros Alignment Macros -+ * Helper macros for declaring aligned variables. -+ * @{ -+ */ -+ -+/** -+ * @def DECLARE_ALIGNED(n,t,v) -+ * Declare a variable that is aligned in memory. -+ * -+ * @code{.c} -+ * DECLARE_ALIGNED(16, uint16_t, aligned_int) = 42; -+ * DECLARE_ALIGNED(32, uint8_t, aligned_array)[128]; -+ * -+ * // The default-alignment equivalent would be -+ * uint16_t aligned_int = 42; -+ * uint8_t aligned_array[128]; -+ * @endcode -+ * -+ * @param n Minimum alignment in bytes -+ * @param t Type of the variable (or array element) -+ * @param v Name of the variable -+ */ -+ -+/** -+ * @def DECLARE_ASM_ALIGNED(n,t,v) -+ * Declare an aligned variable appropriate for use in inline assembly code. -+ * -+ * @code{.c} -+ * DECLARE_ASM_ALIGNED(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008); -+ * @endcode -+ * -+ * @param n Minimum alignment in bytes -+ * @param t Type of the variable (or array element) -+ * @param v Name of the variable -+ */ -+ -+/** -+ * @def DECLARE_ASM_CONST(n,t,v) -+ * Declare a static constant aligned variable appropriate for use in inline -+ * assembly code. -+ * -+ * @code{.c} -+ * DECLARE_ASM_CONST(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008); -+ * @endcode -+ * -+ * @param n Minimum alignment in bytes -+ * @param t Type of the variable (or array element) -+ * @param v Name of the variable -+ */ -+ -+# if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || \ -+ defined(__SUNPRO_C) -+# define DECLARE_ALIGNED(n, t, v) t __attribute__((aligned(n))) v -+# define DECLARE_ASM_ALIGNED(n, t, v) t __attribute__((aligned(n))) v -+# define DECLARE_ASM_CONST(n, t, v) const t __attribute__((aligned(n))) v -+# elif defined(__DJGPP__) -+# define DECLARE_ALIGNED(n, t, v) t __attribute__((aligned(FFMIN(n, 16)))) v -+# define DECLARE_ASM_ALIGNED(n, t, v) \ -+ t av_used __attribute__((aligned(FFMIN(n, 16)))) v -+# define DECLARE_ASM_CONST(n, t, v) \ -+ static const t av_used __attribute__((aligned(FFMIN(n, 16)))) v -+# elif defined(__GNUC__) || defined(__clang__) -+# define DECLARE_ALIGNED(n, t, v) t __attribute__((aligned(n))) v -+# define DECLARE_ASM_ALIGNED(n, t, v) t av_used __attribute__((aligned(n))) v -+# define DECLARE_ASM_CONST(n, t, v) \ -+ static const t av_used __attribute__((aligned(n))) v -+# elif defined(_MSC_VER) -+# define DECLARE_ALIGNED(n, t, v) __declspec(align(n)) t v -+# define DECLARE_ASM_ALIGNED(n, t, v) __declspec(align(n)) t v -+# define DECLARE_ASM_CONST(n, t, v) __declspec(align(n)) static const t v -+# else -+# define DECLARE_ALIGNED(n, t, v) t v -+# define DECLARE_ASM_ALIGNED(n, t, v) t v -+# define DECLARE_ASM_CONST(n, t, v) static const t v -+# endif -+ -+/** -+ * @} -+ */ -+#endif -+ -+/** -+ * @defgroup lavu_mem_attrs Function Attributes -+ * Function attributes applicable to memory handling functions. -+ * -+ * These function attributes can help compilers emit more useful warnings, or -+ * generate better code. -+ * @{ -+ */ -+ -+/** -+ * @def av_malloc_attrib -+ * Function attribute denoting a malloc-like function. -+ * -+ * @see
Function -+ * attribute `malloc` in GCC's documentation -+ */ -+ -+#if AV_GCC_VERSION_AT_LEAST(3, 1) -+# define av_malloc_attrib __attribute__((__malloc__)) -+#else -+# define av_malloc_attrib -+#endif -+ -+/** -+ * @def av_alloc_size(...) -+ * Function attribute used on a function that allocates memory, whose size is -+ * given by the specified parameter(s). -+ * -+ * @code{.c} -+ * void *av_malloc(size_t size) av_alloc_size(1); -+ * void *av_calloc(size_t nmemb, size_t size) av_alloc_size(1, 2); -+ * @endcode -+ * -+ * @param ... One or two parameter indexes, separated by a comma -+ * -+ * @see Function -+ * attribute `alloc_size` in GCC's documentation -+ */ -+ -+#if AV_GCC_VERSION_AT_LEAST(4, 3) -+# define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__))) -+#else -+# define av_alloc_size(...) -+#endif -+ -+/** -+ * @} -+ */ -+ -+/** -+ * @defgroup lavu_mem_funcs Heap Management -+ * Functions responsible for allocating, freeing, and copying memory. -+ * -+ * All memory allocation functions have a built-in upper limit of `INT_MAX` -+ * bytes. This may be changed with av_max_alloc(), although exercise extreme -+ * caution when doing so. -+ * -+ * @{ -+ */ -+ -+/** -+ * Allocate a memory block with alignment suitable for all memory accesses -+ * (including vectors if available on the CPU). -+ * -+ * @param size Size in bytes for the memory block to be allocated -+ * @return Pointer to the allocated block, or `NULL` if the block cannot -+ * be allocated -+ * @see av_mallocz() -+ */ -+void* av_malloc(size_t size) av_malloc_attrib av_alloc_size(1); -+ -+/** -+ * Allocate a memory block with alignment suitable for all memory accesses -+ * (including vectors if available on the CPU) and zero all the bytes of the -+ * block. -+ * -+ * @param size Size in bytes for the memory block to be allocated -+ * @return Pointer to the allocated block, or `NULL` if it cannot be allocated -+ * @see av_malloc() -+ */ -+void* av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1); -+ -+/** -+ * Allocate a memory block for an array with av_malloc(). -+ * -+ * The allocated memory will have size `size * nmemb` bytes. -+ * -+ * @param nmemb Number of element -+ * @param size Size of a single element -+ * @return Pointer to the allocated block, or `NULL` if the block cannot -+ * be allocated -+ * @see av_malloc() -+ */ -+av_alloc_size(1, 2) void* av_malloc_array(size_t nmemb, size_t size); -+ -+/** -+ * Allocate a memory block for an array with av_mallocz(). -+ * -+ * The allocated memory will have size `size * nmemb` bytes. -+ * -+ * @param nmemb Number of elements -+ * @param size Size of the single element -+ * @return Pointer to the allocated block, or `NULL` if the block cannot -+ * be allocated -+ * -+ * @see av_mallocz() -+ * @see av_malloc_array() -+ */ -+void* av_calloc(size_t nmemb, size_t size) av_malloc_attrib av_alloc_size(1, 2); -+ -+#if FF_API_AV_MALLOCZ_ARRAY -+/** -+ * @deprecated use av_calloc() -+ */ -+attribute_deprecated void* av_mallocz_array(size_t nmemb, -+ size_t size) av_malloc_attrib -+ av_alloc_size(1, 2); -+#endif -+ -+/** -+ * Allocate, reallocate, or free a block of memory. -+ * -+ * If `ptr` is `NULL` and `size` > 0, allocate a new block. If `size` is -+ * zero, free the memory block pointed to by `ptr`. Otherwise, expand or -+ * shrink that block of memory according to `size`. -+ * -+ * @param ptr Pointer to a memory block already allocated with -+ * av_realloc() or `NULL` -+ * @param size Size in bytes of the memory block to be allocated or -+ * reallocated -+ * -+ * @return Pointer to a newly-reallocated block or `NULL` if the block -+ * cannot be reallocated or the function is used to free the memory -+ * block -+ * -+ * @warning Unlike av_malloc(), the returned pointer is not guaranteed to be -+ * correctly aligned. -+ * @see av_fast_realloc() -+ * @see av_reallocp() -+ */ -+void* av_realloc(void* ptr, size_t size) av_alloc_size(2); -+ -+/** -+ * Allocate, reallocate, or free a block of memory through a pointer to a -+ * pointer. -+ * -+ * If `*ptr` is `NULL` and `size` > 0, allocate a new block. If `size` is -+ * zero, free the memory block pointed to by `*ptr`. Otherwise, expand or -+ * shrink that block of memory according to `size`. -+ * -+ * @param[in,out] ptr Pointer to a pointer to a memory block already allocated -+ * with av_realloc(), or a pointer to `NULL`. The pointer -+ * is updated on success, or freed on failure. -+ * @param[in] size Size in bytes for the memory block to be allocated or -+ * reallocated -+ * -+ * @return Zero on success, an AVERROR error code on failure -+ * -+ * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be -+ * correctly aligned. -+ */ -+av_warn_unused_result int av_reallocp(void* ptr, size_t size); -+ -+/** -+ * Allocate, reallocate, or free a block of memory. -+ * -+ * This function does the same thing as av_realloc(), except: -+ * - It takes two size arguments and allocates `nelem * elsize` bytes, -+ * after checking the result of the multiplication for integer overflow. -+ * - It frees the input block in case of failure, thus avoiding the memory -+ * leak with the classic -+ * @code{.c} -+ * buf = realloc(buf); -+ * if (!buf) -+ * return -1; -+ * @endcode -+ * pattern. -+ */ -+void* av_realloc_f(void* ptr, size_t nelem, size_t elsize); -+ -+/** -+ * Allocate, reallocate, or free an array. -+ * -+ * If `ptr` is `NULL` and `nmemb` > 0, allocate a new block. If -+ * `nmemb` is zero, free the memory block pointed to by `ptr`. -+ * -+ * @param ptr Pointer to a memory block already allocated with -+ * av_realloc() or `NULL` -+ * @param nmemb Number of elements in the array -+ * @param size Size of the single element of the array -+ * -+ * @return Pointer to a newly-reallocated block or NULL if the block -+ * cannot be reallocated or the function is used to free the memory -+ * block -+ * -+ * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be -+ * correctly aligned. -+ * @see av_reallocp_array() -+ */ -+av_alloc_size(2, 3) void* av_realloc_array(void* ptr, size_t nmemb, -+ size_t size); -+ -+/** -+ * Allocate, reallocate, or free an array through a pointer to a pointer. -+ * -+ * If `*ptr` is `NULL` and `nmemb` > 0, allocate a new block. If `nmemb` is -+ * zero, free the memory block pointed to by `*ptr`. -+ * -+ * @param[in,out] ptr Pointer to a pointer to a memory block already -+ * allocated with av_realloc(), or a pointer to `NULL`. -+ * The pointer is updated on success, or freed on failure. -+ * @param[in] nmemb Number of elements -+ * @param[in] size Size of the single element -+ * -+ * @return Zero on success, an AVERROR error code on failure -+ * -+ * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be -+ * correctly aligned. -+ */ -+int av_reallocp_array(void* ptr, size_t nmemb, size_t size); -+ -+/** -+ * Reallocate the given buffer if it is not large enough, otherwise do nothing. -+ * -+ * If the given buffer is `NULL`, then a new uninitialized buffer is allocated. -+ * -+ * If the given buffer is not large enough, and reallocation fails, `NULL` is -+ * returned and `*size` is set to 0, but the original buffer is not changed or -+ * freed. -+ * -+ * A typical use pattern follows: -+ * -+ * @code{.c} -+ * uint8_t *buf = ...; -+ * uint8_t *new_buf = av_fast_realloc(buf, ¤t_size, size_needed); -+ * if (!new_buf) { -+ * // Allocation failed; clean up original buffer -+ * av_freep(&buf); -+ * return AVERROR(ENOMEM); -+ * } -+ * @endcode -+ * -+ * @param[in,out] ptr Already allocated buffer, or `NULL` -+ * @param[in,out] size Pointer to the size of buffer `ptr`. `*size` is -+ * updated to the new allocated size, in particular 0 -+ * in case of failure. -+ * @param[in] min_size Desired minimal size of buffer `ptr` -+ * @return `ptr` if the buffer is large enough, a pointer to newly reallocated -+ * buffer if the buffer was not large enough, or `NULL` in case of -+ * error -+ * @see av_realloc() -+ * @see av_fast_malloc() -+ */ -+void* av_fast_realloc(void* ptr, unsigned int* size, size_t min_size); -+ -+/** -+ * Allocate a buffer, reusing the given one if large enough. -+ * -+ * Contrary to av_fast_realloc(), the current buffer contents might not be -+ * preserved and on error the old buffer is freed, thus no special handling to -+ * avoid memleaks is necessary. -+ * -+ * `*ptr` is allowed to be `NULL`, in which case allocation always happens if -+ * `size_needed` is greater than 0. -+ * -+ * @code{.c} -+ * uint8_t *buf = ...; -+ * av_fast_malloc(&buf, ¤t_size, size_needed); -+ * if (!buf) { -+ * // Allocation failed; buf already freed -+ * return AVERROR(ENOMEM); -+ * } -+ * @endcode -+ * -+ * @param[in,out] ptr Pointer to pointer to an already allocated buffer. -+ * `*ptr` will be overwritten with pointer to new -+ * buffer on success or `NULL` on failure -+ * @param[in,out] size Pointer to the size of buffer `*ptr`. `*size` is -+ * updated to the new allocated size, in particular 0 -+ * in case of failure. -+ * @param[in] min_size Desired minimal size of buffer `*ptr` -+ * @see av_realloc() -+ * @see av_fast_mallocz() -+ */ -+void av_fast_malloc(void* ptr, unsigned int* size, size_t min_size); -+ -+/** -+ * Allocate and clear a buffer, reusing the given one if large enough. -+ * -+ * Like av_fast_malloc(), but all newly allocated space is initially cleared. -+ * Reused buffer is not cleared. -+ * -+ * `*ptr` is allowed to be `NULL`, in which case allocation always happens if -+ * `size_needed` is greater than 0. -+ * -+ * @param[in,out] ptr Pointer to pointer to an already allocated buffer. -+ * `*ptr` will be overwritten with pointer to new -+ * buffer on success or `NULL` on failure -+ * @param[in,out] size Pointer to the size of buffer `*ptr`. `*size` is -+ * updated to the new allocated size, in particular 0 -+ * in case of failure. -+ * @param[in] min_size Desired minimal size of buffer `*ptr` -+ * @see av_fast_malloc() -+ */ -+void av_fast_mallocz(void* ptr, unsigned int* size, size_t min_size); -+ -+/** -+ * Free a memory block which has been allocated with a function of av_malloc() -+ * or av_realloc() family. -+ * -+ * @param ptr Pointer to the memory block which should be freed. -+ * -+ * @note `ptr = NULL` is explicitly allowed. -+ * @note It is recommended that you use av_freep() instead, to prevent leaving -+ * behind dangling pointers. -+ * @see av_freep() -+ */ -+void av_free(void* ptr); -+ -+/** -+ * Free a memory block which has been allocated with a function of av_malloc() -+ * or av_realloc() family, and set the pointer pointing to it to `NULL`. -+ * -+ * @code{.c} -+ * uint8_t *buf = av_malloc(16); -+ * av_free(buf); -+ * // buf now contains a dangling pointer to freed memory, and accidental -+ * // dereference of buf will result in a use-after-free, which may be a -+ * // security risk. -+ * -+ * uint8_t *buf = av_malloc(16); -+ * av_freep(&buf); -+ * // buf is now NULL, and accidental dereference will only result in a -+ * // NULL-pointer dereference. -+ * @endcode -+ * -+ * @param ptr Pointer to the pointer to the memory block which should be freed -+ * @note `*ptr = NULL` is safe and leads to no action. -+ * @see av_free() -+ */ -+void av_freep(void* ptr); -+ -+/** -+ * Duplicate a string. -+ * -+ * @param s String to be duplicated -+ * @return Pointer to a newly-allocated string containing a -+ * copy of `s` or `NULL` if the string cannot be allocated -+ * @see av_strndup() -+ */ -+char* av_strdup(const char* s) av_malloc_attrib; -+ -+/** -+ * Duplicate a substring of a string. -+ * -+ * @param s String to be duplicated -+ * @param len Maximum length of the resulting string (not counting the -+ * terminating byte) -+ * @return Pointer to a newly-allocated string containing a -+ * substring of `s` or `NULL` if the string cannot be allocated -+ */ -+char* av_strndup(const char* s, size_t len) av_malloc_attrib; -+ -+/** -+ * Duplicate a buffer with av_malloc(). -+ * -+ * @param p Buffer to be duplicated -+ * @param size Size in bytes of the buffer copied -+ * @return Pointer to a newly allocated buffer containing a -+ * copy of `p` or `NULL` if the buffer cannot be allocated -+ */ -+void* av_memdup(const void* p, size_t size); -+ -+/** -+ * Overlapping memcpy() implementation. -+ * -+ * @param dst Destination buffer -+ * @param back Number of bytes back to start copying (i.e. the initial size of -+ * the overlapping window); must be > 0 -+ * @param cnt Number of bytes to copy; must be >= 0 -+ * -+ * @note `cnt > back` is valid, this will copy the bytes we just copied, -+ * thus creating a repeating pattern with a period length of `back`. -+ */ -+void av_memcpy_backptr(uint8_t* dst, int back, int cnt); -+ -+/** -+ * @} -+ */ -+ -+/** -+ * @defgroup lavu_mem_dynarray Dynamic Array -+ * -+ * Utilities to make an array grow when needed. -+ * -+ * Sometimes, the programmer would want to have an array that can grow when -+ * needed. The libavutil dynamic array utilities fill that need. -+ * -+ * libavutil supports two systems of appending elements onto a dynamically -+ * allocated array, the first one storing the pointer to the value in the -+ * array, and the second storing the value directly. In both systems, the -+ * caller is responsible for maintaining a variable containing the length of -+ * the array, as well as freeing of the array after use. -+ * -+ * The first system stores pointers to values in a block of dynamically -+ * allocated memory. Since only pointers are stored, the function does not need -+ * to know the size of the type. Both av_dynarray_add() and -+ * av_dynarray_add_nofree() implement this system. -+ * -+ * @code -+ * type **array = NULL; //< an array of pointers to values -+ * int nb = 0; //< a variable to keep track of the length of the array -+ * -+ * type to_be_added = ...; -+ * type to_be_added2 = ...; -+ * -+ * av_dynarray_add(&array, &nb, &to_be_added); -+ * if (nb == 0) -+ * return AVERROR(ENOMEM); -+ * -+ * av_dynarray_add(&array, &nb, &to_be_added2); -+ * if (nb == 0) -+ * return AVERROR(ENOMEM); -+ * -+ * // Now: -+ * // nb == 2 -+ * // &to_be_added == array[0] -+ * // &to_be_added2 == array[1] -+ * -+ * av_freep(&array); -+ * @endcode -+ * -+ * The second system stores the value directly in a block of memory. As a -+ * result, the function has to know the size of the type. av_dynarray2_add() -+ * implements this mechanism. -+ * -+ * @code -+ * type *array = NULL; //< an array of values -+ * int nb = 0; //< a variable to keep track of the length of the array -+ * -+ * type to_be_added = ...; -+ * type to_be_added2 = ...; -+ * -+ * type *addr = av_dynarray2_add((void **)&array, &nb, sizeof(*array), NULL); -+ * if (!addr) -+ * return AVERROR(ENOMEM); -+ * memcpy(addr, &to_be_added, sizeof(to_be_added)); -+ * -+ * // Shortcut of the above. -+ * type *addr = av_dynarray2_add((void **)&array, &nb, sizeof(*array), -+ * (const void *)&to_be_added2); -+ * if (!addr) -+ * return AVERROR(ENOMEM); -+ * -+ * // Now: -+ * // nb == 2 -+ * // to_be_added == array[0] -+ * // to_be_added2 == array[1] -+ * -+ * av_freep(&array); -+ * @endcode -+ * -+ * @{ -+ */ -+ -+/** -+ * Add the pointer to an element to a dynamic array. -+ * -+ * The array to grow is supposed to be an array of pointers to -+ * structures, and the element to add must be a pointer to an already -+ * allocated structure. -+ * -+ * The array is reallocated when its size reaches powers of 2. -+ * Therefore, the amortized cost of adding an element is constant. -+ * -+ * In case of success, the pointer to the array is updated in order to -+ * point to the new grown array, and the number pointed to by `nb_ptr` -+ * is incremented. -+ * In case of failure, the array is freed, `*tab_ptr` is set to `NULL` and -+ * `*nb_ptr` is set to 0. -+ * -+ * @param[in,out] tab_ptr Pointer to the array to grow -+ * @param[in,out] nb_ptr Pointer to the number of elements in the array -+ * @param[in] elem Element to add -+ * @see av_dynarray_add_nofree(), av_dynarray2_add() -+ */ -+void av_dynarray_add(void* tab_ptr, int* nb_ptr, void* elem); -+ -+/** -+ * Add an element to a dynamic array. -+ * -+ * Function has the same functionality as av_dynarray_add(), -+ * but it doesn't free memory on fails. It returns error code -+ * instead and leave current buffer untouched. -+ * -+ * @return >=0 on success, negative otherwise -+ * @see av_dynarray_add(), av_dynarray2_add() -+ */ -+av_warn_unused_result int av_dynarray_add_nofree(void* tab_ptr, int* nb_ptr, -+ void* elem); -+ -+/** -+ * Add an element of size `elem_size` to a dynamic array. -+ * -+ * The array is reallocated when its number of elements reaches powers of 2. -+ * Therefore, the amortized cost of adding an element is constant. -+ * -+ * In case of success, the pointer to the array is updated in order to -+ * point to the new grown array, and the number pointed to by `nb_ptr` -+ * is incremented. -+ * In case of failure, the array is freed, `*tab_ptr` is set to `NULL` and -+ * `*nb_ptr` is set to 0. -+ * -+ * @param[in,out] tab_ptr Pointer to the array to grow -+ * @param[in,out] nb_ptr Pointer to the number of elements in the array -+ * @param[in] elem_size Size in bytes of an element in the array -+ * @param[in] elem_data Pointer to the data of the element to add. If -+ * `NULL`, the space of the newly added element is -+ * allocated but left uninitialized. -+ * -+ * @return Pointer to the data of the element to copy in the newly allocated -+ * space -+ * @see av_dynarray_add(), av_dynarray_add_nofree() -+ */ -+void* av_dynarray2_add(void** tab_ptr, int* nb_ptr, size_t elem_size, -+ const uint8_t* elem_data); -+ -+/** -+ * @} -+ */ -+ -+/** -+ * @defgroup lavu_mem_misc Miscellaneous Functions -+ * -+ * Other functions related to memory allocation. -+ * -+ * @{ -+ */ -+ -+/** -+ * Multiply two `size_t` values checking for overflow. -+ * -+ * @param[in] a,b Operands of multiplication -+ * @param[out] r Pointer to the result of the operation -+ * @return 0 on success, AVERROR(EINVAL) on overflow -+ */ -+int av_size_mult(size_t a, size_t b, size_t* r); -+ -+/** -+ * Set the maximum size that may be allocated in one block. -+ * -+ * The value specified with this function is effective for all libavutil's @ref -+ * lavu_mem_funcs "heap management functions." -+ * -+ * By default, the max value is defined as `INT_MAX`. -+ * -+ * @param max Value to be set as the new maximum size -+ * -+ * @warning Exercise extreme caution when using this function. Don't touch -+ * this if you do not understand the full consequence of doing so. -+ */ -+void av_max_alloc(size_t max); -+ -+/** -+ * @} -+ * @} -+ */ -+ -+#endif /* AVUTIL_MEM_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/pixfmt.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/pixfmt.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/pixfmt.h -@@ -0,0 +1,808 @@ -+/* -+ * copyright (c) 2006 Michael Niedermayer -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef AVUTIL_PIXFMT_H -+#define AVUTIL_PIXFMT_H -+ -+/** -+ * @file -+ * pixel format definitions -+ */ -+ -+#include "libavutil/avconfig.h" -+#include "version.h" -+ -+#define AVPALETTE_SIZE 1024 -+#define AVPALETTE_COUNT 256 -+ -+/** -+ * Pixel format. -+ * -+ * @note -+ * AV_PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA -+ * color is put together as: -+ * (A << 24) | (R << 16) | (G << 8) | B -+ * This is stored as BGRA on little-endian CPU architectures and ARGB on -+ * big-endian CPUs. -+ * -+ * @note -+ * If the resolution is not a multiple of the chroma subsampling factor -+ * then the chroma plane resolution must be rounded up. -+ * -+ * @par -+ * When the pixel format is palettized RGB32 (AV_PIX_FMT_PAL8), the palettized -+ * image data is stored in AVFrame.data[0]. The palette is transported in -+ * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is -+ * formatted the same as in AV_PIX_FMT_RGB32 described above (i.e., it is -+ * also endian-specific). Note also that the individual RGB32 palette -+ * components stored in AVFrame.data[1] should be in the range 0..255. -+ * This is important as many custom PAL8 video codecs that were designed -+ * to run on the IBM VGA graphics adapter use 6-bit palette components. -+ * -+ * @par -+ * For all the 8 bits per pixel formats, an RGB32 palette is in data[1] like -+ * for pal8. This palette is filled in automatically by the function -+ * allocating the picture. -+ */ -+enum AVPixelFormat { -+ AV_PIX_FMT_NONE = -1, -+ AV_PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y -+ ///< samples) -+ AV_PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr -+ AV_PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... -+ AV_PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... -+ AV_PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y -+ ///< samples) -+ AV_PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y -+ ///< samples) -+ AV_PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y -+ ///< samples) -+ AV_PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y -+ ///< samples) -+ AV_PIX_FMT_GRAY8, ///< Y , 8bpp -+ AV_PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, -+ ///< in each byte pixels are ordered from the -+ ///< msb to the lsb -+ AV_PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, -+ ///< in each byte pixels are ordered from the -+ ///< msb to the lsb -+ AV_PIX_FMT_PAL8, ///< 8 bits with AV_PIX_FMT_RGB32 palette -+ AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), -+ ///< deprecated in favor of AV_PIX_FMT_YUV420P and -+ ///< setting color_range -+ AV_PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), -+ ///< deprecated in favor of AV_PIX_FMT_YUV422P and -+ ///< setting color_range -+ AV_PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), -+ ///< deprecated in favor of AV_PIX_FMT_YUV444P and -+ ///< setting color_range -+ AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 -+ AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 -+ AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) -+ AV_PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), -+ ///< a byte contains two pixels, the first pixel in the byte -+ ///< is the one composed by the 4 msb bits -+ AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) -+ AV_PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) -+ AV_PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), -+ ///< a byte contains two pixels, the first pixel in the byte -+ ///< is the one composed by the 4 msb bits -+ AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) -+ AV_PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for -+ ///< the UV components, which are interleaved (first byte U -+ ///< and the following byte V) -+ AV_PIX_FMT_NV21, ///< as above, but U and V bytes are swapped -+ -+ AV_PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... -+ AV_PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... -+ AV_PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... -+ AV_PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... -+ -+ AV_PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian -+ AV_PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian -+ AV_PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y -+ ///< samples) -+ AV_PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in -+ ///< favor of AV_PIX_FMT_YUV440P and setting color_range -+ AV_PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 -+ ///< Y & A samples) -+ AV_PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the -+ ///< 2-byte value for each R/G/B component is stored as -+ ///< big-endian -+ AV_PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the -+ ///< 2-byte value for each R/G/B component is stored as -+ ///< little-endian -+ -+ AV_PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), -+ ///< big-endian -+ AV_PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), -+ ///< little-endian -+ AV_PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), -+ ///< big-endian , X=unused/undefined -+ AV_PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), -+ ///< little-endian, X=unused/undefined -+ -+ AV_PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), -+ ///< big-endian -+ AV_PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), -+ ///< little-endian -+ AV_PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), -+ ///< big-endian , X=unused/undefined -+ AV_PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), -+ ///< little-endian, X=unused/undefined -+ -+ /** -+ * Hardware acceleration through VA-API, data[3] contains a -+ * VASurfaceID. -+ */ -+ AV_PIX_FMT_VAAPI, -+ -+ AV_PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per -+ ///< 2x2 Y samples), little-endian -+ AV_PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per -+ ///< 2x2 Y samples), big-endian -+ AV_PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per -+ ///< 2x1 Y samples), little-endian -+ AV_PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per -+ ///< 2x1 Y samples), big-endian -+ AV_PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per -+ ///< 1x1 Y samples), little-endian -+ AV_PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per -+ ///< 1x1 Y samples), big-endian -+ AV_PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] -+ ///< contains a LPDIRECT3DSURFACE9 pointer -+ -+ AV_PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), -+ ///< little-endian, X=unused/undefined -+ AV_PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), -+ ///< big-endian, X=unused/undefined -+ AV_PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), -+ ///< little-endian, X=unused/undefined -+ AV_PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), -+ ///< big-endian, X=unused/undefined -+ AV_PIX_FMT_YA8, ///< 8 bits gray, 8 bits alpha -+ -+ AV_PIX_FMT_Y400A = AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 -+ AV_PIX_FMT_GRAY8A = AV_PIX_FMT_YA8, ///< alias for AV_PIX_FMT_YA8 -+ -+ AV_PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the -+ ///< 2-byte value for each R/G/B component is stored as -+ ///< big-endian -+ AV_PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the -+ ///< 2-byte value for each R/G/B component is stored as -+ ///< little-endian -+ -+ /** -+ * The following 12 formats have the disadvantage of needing 1 format for each -+ * bit depth. Notice that each 9/10 bits sample is stored in 16 bits with -+ * extra padding. If you want to support multiple bit depths, then using -+ * AV_PIX_FMT_YUV420P16* with the bpp stored separately is better. -+ */ -+ AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per -+ ///< 2x2 Y samples), big-endian -+ AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per -+ ///< 2x2 Y samples), little-endian -+ AV_PIX_FMT_YUV420P10BE, ///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per -+ ///< 2x2 Y samples), big-endian -+ AV_PIX_FMT_YUV420P10LE, ///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per -+ ///< 2x2 Y samples), little-endian -+ AV_PIX_FMT_YUV422P10BE, ///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per -+ ///< 2x1 Y samples), big-endian -+ AV_PIX_FMT_YUV422P10LE, ///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per -+ ///< 2x1 Y samples), little-endian -+ AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per -+ ///< 1x1 Y samples), big-endian -+ AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per -+ ///< 1x1 Y samples), little-endian -+ AV_PIX_FMT_YUV444P10BE, ///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per -+ ///< 1x1 Y samples), big-endian -+ AV_PIX_FMT_YUV444P10LE, ///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per -+ ///< 1x1 Y samples), little-endian -+ AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per -+ ///< 2x1 Y samples), big-endian -+ AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per -+ ///< 2x1 Y samples), little-endian -+ AV_PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp -+ AV_PIX_FMT_GBR24P = AV_PIX_FMT_GBRP, // alias for #AV_PIX_FMT_GBRP -+ AV_PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big-endian -+ AV_PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little-endian -+ AV_PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big-endian -+ AV_PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little-endian -+ AV_PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big-endian -+ AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little-endian -+ AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y -+ ///< & A samples) -+ AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y -+ ///< & A samples) -+ AV_PIX_FMT_YUVA420P9BE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per -+ ///< 2x2 Y & A samples), big-endian -+ AV_PIX_FMT_YUVA420P9LE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per -+ ///< 2x2 Y & A samples), little-endian -+ AV_PIX_FMT_YUVA422P9BE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per -+ ///< 2x1 Y & A samples), big-endian -+ AV_PIX_FMT_YUVA422P9LE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per -+ ///< 2x1 Y & A samples), little-endian -+ AV_PIX_FMT_YUVA444P9BE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per -+ ///< 1x1 Y & A samples), big-endian -+ AV_PIX_FMT_YUVA444P9LE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per -+ ///< 1x1 Y & A samples), little-endian -+ AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per -+ ///< 2x2 Y & A samples, big-endian) -+ AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per -+ ///< 2x2 Y & A samples, little-endian) -+ AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per -+ ///< 2x1 Y & A samples, big-endian) -+ AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per -+ ///< 2x1 Y & A samples, little-endian) -+ AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per -+ ///< 1x1 Y & A samples, big-endian) -+ AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per -+ ///< 1x1 Y & A samples, little-endian) -+ AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per -+ ///< 2x2 Y & A samples, big-endian) -+ AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per -+ ///< 2x2 Y & A samples, little-endian) -+ AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per -+ ///< 2x1 Y & A samples, big-endian) -+ AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per -+ ///< 2x1 Y & A samples, little-endian) -+ AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per -+ ///< 1x1 Y & A samples, big-endian) -+ AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per -+ ///< 1x1 Y & A samples, little-endian) -+ -+ AV_PIX_FMT_VDPAU, ///< HW acceleration through VDPAU, Picture.data[3] -+ ///< contains a VdpVideoSurface -+ -+ AV_PIX_FMT_XYZ12LE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), -+ ///< the 2-byte value for each X/Y/Z is stored as -+ ///< little-endian, the 4 lower bits are set to 0 -+ AV_PIX_FMT_XYZ12BE, ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), -+ ///< the 2-byte value for each X/Y/Z is stored as -+ ///< big-endian, the 4 lower bits are set to 0 -+ AV_PIX_FMT_NV16, ///< interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample -+ ///< per 2x1 Y samples) -+ AV_PIX_FMT_NV20LE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb -+ ///< sample per 2x1 Y samples), little-endian -+ AV_PIX_FMT_NV20BE, ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb -+ ///< sample per 2x1 Y samples), big-endian -+ -+ AV_PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, -+ ///< the 2-byte value for each R/G/B/A component is -+ ///< stored as big-endian -+ AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, -+ ///< the 2-byte value for each R/G/B/A component is -+ ///< stored as little-endian -+ AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, -+ ///< the 2-byte value for each R/G/B/A component is -+ ///< stored as big-endian -+ AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, -+ ///< the 2-byte value for each R/G/B/A component is -+ ///< stored as little-endian -+ -+ AV_PIX_FMT_YVYU422, ///< packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb -+ -+ AV_PIX_FMT_YA16BE, ///< 16 bits gray, 16 bits alpha (big-endian) -+ AV_PIX_FMT_YA16LE, ///< 16 bits gray, 16 bits alpha (little-endian) -+ -+ AV_PIX_FMT_GBRAP, ///< planar GBRA 4:4:4:4 32bpp -+ AV_PIX_FMT_GBRAP16BE, ///< planar GBRA 4:4:4:4 64bpp, big-endian -+ AV_PIX_FMT_GBRAP16LE, ///< planar GBRA 4:4:4:4 64bpp, little-endian -+ /** -+ * HW acceleration through QSV, data[3] contains a pointer to the -+ * mfxFrameSurface1 structure. -+ */ -+ AV_PIX_FMT_QSV, -+ /** -+ * HW acceleration though MMAL, data[3] contains a pointer to the -+ * MMAL_BUFFER_HEADER_T structure. -+ */ -+ AV_PIX_FMT_MMAL, -+ -+ AV_PIX_FMT_D3D11VA_VLD, ///< HW decoding through Direct3D11 via old API, -+ ///< Picture.data[3] contains a -+ ///< ID3D11VideoDecoderOutputView pointer -+ -+ /** -+ * HW acceleration through CUDA. data[i] contain CUdeviceptr pointers -+ * exactly as for system memory frames. -+ */ -+ AV_PIX_FMT_CUDA, -+ -+ AV_PIX_FMT_0RGB, ///< packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined -+ AV_PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined -+ AV_PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined -+ AV_PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined -+ -+ AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per -+ ///< 2x2 Y samples), big-endian -+ AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per -+ ///< 2x2 Y samples), little-endian -+ AV_PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per -+ ///< 2x2 Y samples), big-endian -+ AV_PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per -+ ///< 2x2 Y samples), little-endian -+ AV_PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per -+ ///< 2x1 Y samples), big-endian -+ AV_PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per -+ ///< 2x1 Y samples), little-endian -+ AV_PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per -+ ///< 2x1 Y samples), big-endian -+ AV_PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per -+ ///< 2x1 Y samples), little-endian -+ AV_PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per -+ ///< 1x1 Y samples), big-endian -+ AV_PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per -+ ///< 1x1 Y samples), little-endian -+ AV_PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per -+ ///< 1x1 Y samples), big-endian -+ AV_PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per -+ ///< 1x1 Y samples), little-endian -+ AV_PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big-endian -+ AV_PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little-endian -+ AV_PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big-endian -+ AV_PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little-endian -+ AV_PIX_FMT_YUVJ411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 -+ ///< Y samples) full scale (JPEG), deprecated in favor -+ ///< of AV_PIX_FMT_YUV411P and setting color_range -+ -+ AV_PIX_FMT_BAYER_BGGR8, ///< bayer, BGBG..(odd line), GRGR..(even line), -+ ///< 8-bit samples -+ AV_PIX_FMT_BAYER_RGGB8, ///< bayer, RGRG..(odd line), GBGB..(even line), -+ ///< 8-bit samples -+ AV_PIX_FMT_BAYER_GBRG8, ///< bayer, GBGB..(odd line), RGRG..(even line), -+ ///< 8-bit samples -+ AV_PIX_FMT_BAYER_GRBG8, ///< bayer, GRGR..(odd line), BGBG..(even line), -+ ///< 8-bit samples -+ AV_PIX_FMT_BAYER_BGGR16LE, ///< bayer, BGBG..(odd line), GRGR..(even line), -+ ///< 16-bit samples, little-endian -+ AV_PIX_FMT_BAYER_BGGR16BE, ///< bayer, BGBG..(odd line), GRGR..(even line), -+ ///< 16-bit samples, big-endian -+ AV_PIX_FMT_BAYER_RGGB16LE, ///< bayer, RGRG..(odd line), GBGB..(even line), -+ ///< 16-bit samples, little-endian -+ AV_PIX_FMT_BAYER_RGGB16BE, ///< bayer, RGRG..(odd line), GBGB..(even line), -+ ///< 16-bit samples, big-endian -+ AV_PIX_FMT_BAYER_GBRG16LE, ///< bayer, GBGB..(odd line), RGRG..(even line), -+ ///< 16-bit samples, little-endian -+ AV_PIX_FMT_BAYER_GBRG16BE, ///< bayer, GBGB..(odd line), RGRG..(even line), -+ ///< 16-bit samples, big-endian -+ AV_PIX_FMT_BAYER_GRBG16LE, ///< bayer, GRGR..(odd line), BGBG..(even line), -+ ///< 16-bit samples, little-endian -+ AV_PIX_FMT_BAYER_GRBG16BE, ///< bayer, GRGR..(odd line), BGBG..(even line), -+ ///< 16-bit samples, big-endian -+ -+ AV_PIX_FMT_XVMC, ///< XVideo Motion Acceleration via common packet passing -+ -+ AV_PIX_FMT_YUV440P10LE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per -+ ///< 1x2 Y samples), little-endian -+ AV_PIX_FMT_YUV440P10BE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per -+ ///< 1x2 Y samples), big-endian -+ AV_PIX_FMT_YUV440P12LE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per -+ ///< 1x2 Y samples), little-endian -+ AV_PIX_FMT_YUV440P12BE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per -+ ///< 1x2 Y samples), big-endian -+ AV_PIX_FMT_AYUV64LE, ///< packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y -+ ///< & A samples), little-endian -+ AV_PIX_FMT_AYUV64BE, ///< packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y -+ ///< & A samples), big-endian -+ -+ AV_PIX_FMT_VIDEOTOOLBOX, ///< hardware decoding through Videotoolbox -+ -+ AV_PIX_FMT_P010LE, ///< like NV12, with 10bpp per component, data in the high -+ ///< bits, zeros in the low bits, little-endian -+ AV_PIX_FMT_P010BE, ///< like NV12, with 10bpp per component, data in the high -+ ///< bits, zeros in the low bits, big-endian -+ -+ AV_PIX_FMT_GBRAP12BE, ///< planar GBR 4:4:4:4 48bpp, big-endian -+ AV_PIX_FMT_GBRAP12LE, ///< planar GBR 4:4:4:4 48bpp, little-endian -+ -+ AV_PIX_FMT_GBRAP10BE, ///< planar GBR 4:4:4:4 40bpp, big-endian -+ AV_PIX_FMT_GBRAP10LE, ///< planar GBR 4:4:4:4 40bpp, little-endian -+ -+ AV_PIX_FMT_MEDIACODEC, ///< hardware decoding through MediaCodec -+ -+ AV_PIX_FMT_GRAY12BE, ///< Y , 12bpp, big-endian -+ AV_PIX_FMT_GRAY12LE, ///< Y , 12bpp, little-endian -+ AV_PIX_FMT_GRAY10BE, ///< Y , 10bpp, big-endian -+ AV_PIX_FMT_GRAY10LE, ///< Y , 10bpp, little-endian -+ -+ AV_PIX_FMT_P016LE, ///< like NV12, with 16bpp per component, little-endian -+ AV_PIX_FMT_P016BE, ///< like NV12, with 16bpp per component, big-endian -+ -+ /** -+ * Hardware surfaces for Direct3D11. -+ * -+ * This is preferred over the legacy AV_PIX_FMT_D3D11VA_VLD. The new D3D11 -+ * hwaccel API and filtering support AV_PIX_FMT_D3D11 only. -+ * -+ * data[0] contains a ID3D11Texture2D pointer, and data[1] contains the -+ * texture array index of the frame as intptr_t if the ID3D11Texture2D is -+ * an array texture (or always 0 if it's a normal texture). -+ */ -+ AV_PIX_FMT_D3D11, -+ -+ AV_PIX_FMT_GRAY9BE, ///< Y , 9bpp, big-endian -+ AV_PIX_FMT_GRAY9LE, ///< Y , 9bpp, little-endian -+ -+ AV_PIX_FMT_GBRPF32BE, ///< IEEE-754 single precision planar GBR 4:4:4, 96bpp, -+ ///< big-endian -+ AV_PIX_FMT_GBRPF32LE, ///< IEEE-754 single precision planar GBR 4:4:4, 96bpp, -+ ///< little-endian -+ AV_PIX_FMT_GBRAPF32BE, ///< IEEE-754 single precision planar GBRA 4:4:4:4, -+ ///< 128bpp, big-endian -+ AV_PIX_FMT_GBRAPF32LE, ///< IEEE-754 single precision planar GBRA 4:4:4:4, -+ ///< 128bpp, little-endian -+ -+ /** -+ * DRM-managed buffers exposed through PRIME buffer sharing. -+ * -+ * data[0] points to an AVDRMFrameDescriptor. -+ */ -+ AV_PIX_FMT_DRM_PRIME, -+ /** -+ * Hardware surfaces for OpenCL. -+ * -+ * data[i] contain 2D image objects (typed in C as cl_mem, used -+ * in OpenCL as image2d_t) for each plane of the surface. -+ */ -+ AV_PIX_FMT_OPENCL, -+ -+ AV_PIX_FMT_GRAY14BE, ///< Y , 14bpp, big-endian -+ AV_PIX_FMT_GRAY14LE, ///< Y , 14bpp, little-endian -+ -+ AV_PIX_FMT_GRAYF32BE, ///< IEEE-754 single precision Y, 32bpp, big-endian -+ AV_PIX_FMT_GRAYF32LE, ///< IEEE-754 single precision Y, 32bpp, little-endian -+ -+ AV_PIX_FMT_YUVA422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per -+ ///< 2x1 Y samples), 12b alpha, big-endian -+ AV_PIX_FMT_YUVA422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per -+ ///< 2x1 Y samples), 12b alpha, little-endian -+ AV_PIX_FMT_YUVA444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per -+ ///< 1x1 Y samples), 12b alpha, big-endian -+ AV_PIX_FMT_YUVA444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per -+ ///< 1x1 Y samples), 12b alpha, little-endian -+ -+ AV_PIX_FMT_NV24, ///< planar YUV 4:4:4, 24bpp, 1 plane for Y and 1 plane for -+ ///< the UV components, which are interleaved (first byte U -+ ///< and the following byte V) -+ AV_PIX_FMT_NV42, ///< as above, but U and V bytes are swapped -+ -+ /** -+ * Vulkan hardware images. -+ * -+ * data[0] points to an AVVkFrame -+ */ -+ AV_PIX_FMT_VULKAN, -+ -+ AV_PIX_FMT_Y210BE, ///< packed YUV 4:2:2 like YUYV422, 20bpp, data in the -+ ///< high bits, big-endian -+ AV_PIX_FMT_Y210LE, ///< packed YUV 4:2:2 like YUYV422, 20bpp, data in the -+ ///< high bits, little-endian -+ -+ AV_PIX_FMT_X2RGB10LE, ///< packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G -+ ///< 10B(lsb), little-endian, X=unused/undefined -+ AV_PIX_FMT_X2RGB10BE, ///< packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G -+ ///< 10B(lsb), big-endian, X=unused/undefined -+ AV_PIX_FMT_X2BGR10LE, ///< packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G -+ ///< 10R(lsb), little-endian, X=unused/undefined -+ AV_PIX_FMT_X2BGR10BE, ///< packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G -+ ///< 10R(lsb), big-endian, X=unused/undefined -+ -+ AV_PIX_FMT_P210BE, ///< interleaved chroma YUV 4:2:2, 20bpp, data in the high -+ ///< bits, big-endian -+ AV_PIX_FMT_P210LE, ///< interleaved chroma YUV 4:2:2, 20bpp, data in the high -+ ///< bits, little-endian -+ -+ AV_PIX_FMT_P410BE, ///< interleaved chroma YUV 4:4:4, 30bpp, data in the high -+ ///< bits, big-endian -+ AV_PIX_FMT_P410LE, ///< interleaved chroma YUV 4:4:4, 30bpp, data in the high -+ ///< bits, little-endian -+ -+ AV_PIX_FMT_P216BE, ///< interleaved chroma YUV 4:2:2, 32bpp, big-endian -+ AV_PIX_FMT_P216LE, ///< interleaved chroma YUV 4:2:2, 32bpp, liddle-endian -+ -+ AV_PIX_FMT_P416BE, ///< interleaved chroma YUV 4:4:4, 48bpp, big-endian -+ AV_PIX_FMT_P416LE, ///< interleaved chroma YUV 4:4:4, 48bpp, little-endian -+ -+ AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to -+ ///< link with shared libav* because the number of formats -+ ///< might differ between versions -+}; -+ -+#if AV_HAVE_BIGENDIAN -+# define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##be -+#else -+# define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##le -+#endif -+ -+#define AV_PIX_FMT_RGB32 AV_PIX_FMT_NE(ARGB, BGRA) -+#define AV_PIX_FMT_RGB32_1 AV_PIX_FMT_NE(RGBA, ABGR) -+#define AV_PIX_FMT_BGR32 AV_PIX_FMT_NE(ABGR, RGBA) -+#define AV_PIX_FMT_BGR32_1 AV_PIX_FMT_NE(BGRA, ARGB) -+#define AV_PIX_FMT_0RGB32 AV_PIX_FMT_NE(0RGB, BGR0) -+#define AV_PIX_FMT_0BGR32 AV_PIX_FMT_NE(0BGR, RGB0) -+ -+#define AV_PIX_FMT_GRAY9 AV_PIX_FMT_NE(GRAY9BE, GRAY9LE) -+#define AV_PIX_FMT_GRAY10 AV_PIX_FMT_NE(GRAY10BE, GRAY10LE) -+#define AV_PIX_FMT_GRAY12 AV_PIX_FMT_NE(GRAY12BE, GRAY12LE) -+#define AV_PIX_FMT_GRAY14 AV_PIX_FMT_NE(GRAY14BE, GRAY14LE) -+#define AV_PIX_FMT_GRAY16 AV_PIX_FMT_NE(GRAY16BE, GRAY16LE) -+#define AV_PIX_FMT_YA16 AV_PIX_FMT_NE(YA16BE, YA16LE) -+#define AV_PIX_FMT_RGB48 AV_PIX_FMT_NE(RGB48BE, RGB48LE) -+#define AV_PIX_FMT_RGB565 AV_PIX_FMT_NE(RGB565BE, RGB565LE) -+#define AV_PIX_FMT_RGB555 AV_PIX_FMT_NE(RGB555BE, RGB555LE) -+#define AV_PIX_FMT_RGB444 AV_PIX_FMT_NE(RGB444BE, RGB444LE) -+#define AV_PIX_FMT_RGBA64 AV_PIX_FMT_NE(RGBA64BE, RGBA64LE) -+#define AV_PIX_FMT_BGR48 AV_PIX_FMT_NE(BGR48BE, BGR48LE) -+#define AV_PIX_FMT_BGR565 AV_PIX_FMT_NE(BGR565BE, BGR565LE) -+#define AV_PIX_FMT_BGR555 AV_PIX_FMT_NE(BGR555BE, BGR555LE) -+#define AV_PIX_FMT_BGR444 AV_PIX_FMT_NE(BGR444BE, BGR444LE) -+#define AV_PIX_FMT_BGRA64 AV_PIX_FMT_NE(BGRA64BE, BGRA64LE) -+ -+#define AV_PIX_FMT_YUV420P9 AV_PIX_FMT_NE(YUV420P9BE, YUV420P9LE) -+#define AV_PIX_FMT_YUV422P9 AV_PIX_FMT_NE(YUV422P9BE, YUV422P9LE) -+#define AV_PIX_FMT_YUV444P9 AV_PIX_FMT_NE(YUV444P9BE, YUV444P9LE) -+#define AV_PIX_FMT_YUV420P10 AV_PIX_FMT_NE(YUV420P10BE, YUV420P10LE) -+#define AV_PIX_FMT_YUV422P10 AV_PIX_FMT_NE(YUV422P10BE, YUV422P10LE) -+#define AV_PIX_FMT_YUV440P10 AV_PIX_FMT_NE(YUV440P10BE, YUV440P10LE) -+#define AV_PIX_FMT_YUV444P10 AV_PIX_FMT_NE(YUV444P10BE, YUV444P10LE) -+#define AV_PIX_FMT_YUV420P12 AV_PIX_FMT_NE(YUV420P12BE, YUV420P12LE) -+#define AV_PIX_FMT_YUV422P12 AV_PIX_FMT_NE(YUV422P12BE, YUV422P12LE) -+#define AV_PIX_FMT_YUV440P12 AV_PIX_FMT_NE(YUV440P12BE, YUV440P12LE) -+#define AV_PIX_FMT_YUV444P12 AV_PIX_FMT_NE(YUV444P12BE, YUV444P12LE) -+#define AV_PIX_FMT_YUV420P14 AV_PIX_FMT_NE(YUV420P14BE, YUV420P14LE) -+#define AV_PIX_FMT_YUV422P14 AV_PIX_FMT_NE(YUV422P14BE, YUV422P14LE) -+#define AV_PIX_FMT_YUV444P14 AV_PIX_FMT_NE(YUV444P14BE, YUV444P14LE) -+#define AV_PIX_FMT_YUV420P16 AV_PIX_FMT_NE(YUV420P16BE, YUV420P16LE) -+#define AV_PIX_FMT_YUV422P16 AV_PIX_FMT_NE(YUV422P16BE, YUV422P16LE) -+#define AV_PIX_FMT_YUV444P16 AV_PIX_FMT_NE(YUV444P16BE, YUV444P16LE) -+ -+#define AV_PIX_FMT_GBRP9 AV_PIX_FMT_NE(GBRP9BE, GBRP9LE) -+#define AV_PIX_FMT_GBRP10 AV_PIX_FMT_NE(GBRP10BE, GBRP10LE) -+#define AV_PIX_FMT_GBRP12 AV_PIX_FMT_NE(GBRP12BE, GBRP12LE) -+#define AV_PIX_FMT_GBRP14 AV_PIX_FMT_NE(GBRP14BE, GBRP14LE) -+#define AV_PIX_FMT_GBRP16 AV_PIX_FMT_NE(GBRP16BE, GBRP16LE) -+#define AV_PIX_FMT_GBRAP10 AV_PIX_FMT_NE(GBRAP10BE, GBRAP10LE) -+#define AV_PIX_FMT_GBRAP12 AV_PIX_FMT_NE(GBRAP12BE, GBRAP12LE) -+#define AV_PIX_FMT_GBRAP16 AV_PIX_FMT_NE(GBRAP16BE, GBRAP16LE) -+ -+#define AV_PIX_FMT_BAYER_BGGR16 AV_PIX_FMT_NE(BAYER_BGGR16BE, BAYER_BGGR16LE) -+#define AV_PIX_FMT_BAYER_RGGB16 AV_PIX_FMT_NE(BAYER_RGGB16BE, BAYER_RGGB16LE) -+#define AV_PIX_FMT_BAYER_GBRG16 AV_PIX_FMT_NE(BAYER_GBRG16BE, BAYER_GBRG16LE) -+#define AV_PIX_FMT_BAYER_GRBG16 AV_PIX_FMT_NE(BAYER_GRBG16BE, BAYER_GRBG16LE) -+ -+#define AV_PIX_FMT_GBRPF32 AV_PIX_FMT_NE(GBRPF32BE, GBRPF32LE) -+#define AV_PIX_FMT_GBRAPF32 AV_PIX_FMT_NE(GBRAPF32BE, GBRAPF32LE) -+ -+#define AV_PIX_FMT_GRAYF32 AV_PIX_FMT_NE(GRAYF32BE, GRAYF32LE) -+ -+#define AV_PIX_FMT_YUVA420P9 AV_PIX_FMT_NE(YUVA420P9BE, YUVA420P9LE) -+#define AV_PIX_FMT_YUVA422P9 AV_PIX_FMT_NE(YUVA422P9BE, YUVA422P9LE) -+#define AV_PIX_FMT_YUVA444P9 AV_PIX_FMT_NE(YUVA444P9BE, YUVA444P9LE) -+#define AV_PIX_FMT_YUVA420P10 AV_PIX_FMT_NE(YUVA420P10BE, YUVA420P10LE) -+#define AV_PIX_FMT_YUVA422P10 AV_PIX_FMT_NE(YUVA422P10BE, YUVA422P10LE) -+#define AV_PIX_FMT_YUVA444P10 AV_PIX_FMT_NE(YUVA444P10BE, YUVA444P10LE) -+#define AV_PIX_FMT_YUVA422P12 AV_PIX_FMT_NE(YUVA422P12BE, YUVA422P12LE) -+#define AV_PIX_FMT_YUVA444P12 AV_PIX_FMT_NE(YUVA444P12BE, YUVA444P12LE) -+#define AV_PIX_FMT_YUVA420P16 AV_PIX_FMT_NE(YUVA420P16BE, YUVA420P16LE) -+#define AV_PIX_FMT_YUVA422P16 AV_PIX_FMT_NE(YUVA422P16BE, YUVA422P16LE) -+#define AV_PIX_FMT_YUVA444P16 AV_PIX_FMT_NE(YUVA444P16BE, YUVA444P16LE) -+ -+#define AV_PIX_FMT_XYZ12 AV_PIX_FMT_NE(XYZ12BE, XYZ12LE) -+#define AV_PIX_FMT_NV20 AV_PIX_FMT_NE(NV20BE, NV20LE) -+#define AV_PIX_FMT_AYUV64 AV_PIX_FMT_NE(AYUV64BE, AYUV64LE) -+#define AV_PIX_FMT_P010 AV_PIX_FMT_NE(P010BE, P010LE) -+#define AV_PIX_FMT_P016 AV_PIX_FMT_NE(P016BE, P016LE) -+ -+#define AV_PIX_FMT_Y210 AV_PIX_FMT_NE(Y210BE, Y210LE) -+#define AV_PIX_FMT_X2RGB10 AV_PIX_FMT_NE(X2RGB10BE, X2RGB10LE) -+#define AV_PIX_FMT_X2BGR10 AV_PIX_FMT_NE(X2BGR10BE, X2BGR10LE) -+ -+#define AV_PIX_FMT_P210 AV_PIX_FMT_NE(P210BE, P210LE) -+#define AV_PIX_FMT_P410 AV_PIX_FMT_NE(P410BE, P410LE) -+#define AV_PIX_FMT_P216 AV_PIX_FMT_NE(P216BE, P216LE) -+#define AV_PIX_FMT_P416 AV_PIX_FMT_NE(P416BE, P416LE) -+ -+/** -+ * Chromaticity coordinates of the source primaries. -+ * These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.1 and -+ * ITU-T H.273. -+ */ -+enum AVColorPrimaries { -+ AVCOL_PRI_RESERVED0 = 0, -+ AVCOL_PRI_BT709 = -+ 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B -+ AVCOL_PRI_UNSPECIFIED = 2, -+ AVCOL_PRI_RESERVED = 3, -+ AVCOL_PRI_BT470M = -+ 4, ///< also FCC Title 47 Code of Federal Regulations 73.682 (a)(20) -+ -+ AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R -+ ///< BT1700 625 PAL & SECAM -+ AVCOL_PRI_SMPTE170M = -+ 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC -+ AVCOL_PRI_SMPTE240M = -+ 7, ///< identical to above, also called "SMPTE C" even though it uses D65 -+ AVCOL_PRI_FILM = 8, ///< colour filters using Illuminant C -+ AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020 -+ AVCOL_PRI_SMPTE428 = 10, ///< SMPTE ST 428-1 (CIE 1931 XYZ) -+ AVCOL_PRI_SMPTEST428_1 = AVCOL_PRI_SMPTE428, -+ AVCOL_PRI_SMPTE431 = 11, ///< SMPTE ST 431-2 (2011) / DCI P3 -+ AVCOL_PRI_SMPTE432 = 12, ///< SMPTE ST 432-1 (2010) / P3 D65 / Display P3 -+ AVCOL_PRI_EBU3213 = 22, ///< EBU Tech. 3213-E (nothing there) / one of JEDEC -+ ///< P22 group phosphors -+ AVCOL_PRI_JEDEC_P22 = AVCOL_PRI_EBU3213, -+ AVCOL_PRI_NB ///< Not part of ABI -+}; -+ -+/** -+ * Color Transfer Characteristic. -+ * These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.2. -+ */ -+enum AVColorTransferCharacteristic { -+ AVCOL_TRC_RESERVED0 = 0, -+ AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 -+ AVCOL_TRC_UNSPECIFIED = 2, -+ AVCOL_TRC_RESERVED = 3, -+ AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM -+ AVCOL_TRC_GAMMA28 = 5, ///< also ITU-R BT470BG -+ AVCOL_TRC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 -+ ///< 525 or 625 / ITU-R BT1700 NTSC -+ AVCOL_TRC_SMPTE240M = 7, -+ AVCOL_TRC_LINEAR = 8, ///< "Linear transfer characteristics" -+ AVCOL_TRC_LOG = 9, ///< "Logarithmic transfer characteristic (100:1 range)" -+ AVCOL_TRC_LOG_SQRT = -+ 10, ///< "Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)" -+ AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4 -+ AVCOL_TRC_BT1361_ECG = 12, ///< ITU-R BT1361 Extended Colour Gamut -+ AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC) -+ AVCOL_TRC_BT2020_10 = 14, ///< ITU-R BT2020 for 10-bit system -+ AVCOL_TRC_BT2020_12 = 15, ///< ITU-R BT2020 for 12-bit system -+ AVCOL_TRC_SMPTE2084 = -+ 16, ///< SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems -+ AVCOL_TRC_SMPTEST2084 = AVCOL_TRC_SMPTE2084, -+ AVCOL_TRC_SMPTE428 = 17, ///< SMPTE ST 428-1 -+ AVCOL_TRC_SMPTEST428_1 = AVCOL_TRC_SMPTE428, -+ AVCOL_TRC_ARIB_STD_B67 = 18, ///< ARIB STD-B67, known as "Hybrid log-gamma" -+ AVCOL_TRC_NB ///< Not part of ABI -+}; -+ -+/** -+ * YUV colorspace type. -+ * These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.3. -+ */ -+enum AVColorSpace { -+ AVCOL_SPC_RGB = 0, ///< order of coefficients is actually GBR, also IEC -+ ///< 61966-2-1 (sRGB), YZX and ST 428-1 -+ AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / -+ ///< derived in SMPTE RP 177 Annex B -+ AVCOL_SPC_UNSPECIFIED = 2, -+ AVCOL_SPC_RESERVED = -+ 3, ///< reserved for future use by ITU-T and ISO/IEC just like 15-255 are -+ AVCOL_SPC_FCC = -+ 4, ///< FCC Title 47 Code of Federal Regulations 73.682 (a)(20) -+ AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R -+ ///< BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 -+ AVCOL_SPC_SMPTE170M = -+ 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / -+ ///< functionally identical to above -+ AVCOL_SPC_SMPTE240M = -+ 7, ///< derived from 170M primaries and D65 white point, 170M is derived -+ ///< from BT470 System M's primaries -+ AVCOL_SPC_YCGCO = -+ 8, ///< used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16 -+ AVCOL_SPC_YCOCG = AVCOL_SPC_YCGCO, -+ AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system -+ AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system -+ AVCOL_SPC_SMPTE2085 = 11, ///< SMPTE 2085, Y'D'zD'x -+ AVCOL_SPC_CHROMA_DERIVED_NCL = -+ 12, ///< Chromaticity-derived non-constant luminance system -+ AVCOL_SPC_CHROMA_DERIVED_CL = -+ 13, ///< Chromaticity-derived constant luminance system -+ AVCOL_SPC_ICTCP = 14, ///< ITU-R BT.2100-0, ICtCp -+ AVCOL_SPC_NB ///< Not part of ABI -+}; -+ -+/** -+ * Visual content value range. -+ * -+ * These values are based on definitions that can be found in multiple -+ * specifications, such as ITU-T BT.709 (3.4 - Quantization of RGB, luminance -+ * and colour-difference signals), ITU-T BT.2020 (Table 5 - Digital -+ * Representation) as well as ITU-T BT.2100 (Table 9 - Digital 10- and 12-bit -+ * integer representation). At the time of writing, the BT.2100 one is -+ * recommended, as it also defines the full range representation. -+ * -+ * Common definitions: -+ * - For RGB and luma planes such as Y in YCbCr and I in ICtCp, -+ * 'E' is the original value in range of 0.0 to 1.0. -+ * - For chroma planes such as Cb,Cr and Ct,Cp, 'E' is the original -+ * value in range of -0.5 to 0.5. -+ * - 'n' is the output bit depth. -+ * - For additional definitions such as rounding and clipping to valid n -+ * bit unsigned integer range, please refer to BT.2100 (Table 9). -+ */ -+enum AVColorRange { -+ AVCOL_RANGE_UNSPECIFIED = 0, -+ -+ /** -+ * Narrow or limited range content. -+ * -+ * - For luma planes: -+ * -+ * (219 * E + 16) * 2^(n-8) -+ * -+ * F.ex. the range of 16-235 for 8 bits -+ * -+ * - For chroma planes: -+ * -+ * (224 * E + 128) * 2^(n-8) -+ * -+ * F.ex. the range of 16-240 for 8 bits -+ */ -+ AVCOL_RANGE_MPEG = 1, -+ -+ /** -+ * Full range content. -+ * -+ * - For RGB and luma planes: -+ * -+ * (2^n - 1) * E -+ * -+ * F.ex. the range of 0-255 for 8 bits -+ * -+ * - For chroma planes: -+ * -+ * (2^n - 1) * E + 2^(n - 1) -+ * -+ * F.ex. the range of 1-255 for 8 bits -+ */ -+ AVCOL_RANGE_JPEG = 2, -+ AVCOL_RANGE_NB ///< Not part of ABI -+}; -+ -+/** -+ * Location of chroma samples. -+ * -+ * Illustration showing the location of the first (top left) chroma sample of -+ *the image, the left shows only luma, the right shows the location of the -+ *chroma sample, the 2 could be imagined to overlay each other but are drawn -+ *separately due to limitations of ASCII -+ * -+ * 1st 2nd 1st 2nd horizontal luma sample positions -+ * v v v v -+ * ______ ______ -+ *1st luma line > |X X ... |3 4 X ... X are luma samples, -+ * | |1 2 1-6 are possible chroma positions -+ *2nd luma line > |X X ... |5 6 X ... 0 is undefined/unknown position -+ */ -+enum AVChromaLocation { -+ AVCHROMA_LOC_UNSPECIFIED = 0, -+ AVCHROMA_LOC_LEFT = 1, ///< MPEG-2/4 4:2:0, H.264 default for 4:2:0 -+ AVCHROMA_LOC_CENTER = 2, ///< MPEG-1 4:2:0, JPEG 4:2:0, H.263 4:2:0 -+ AVCHROMA_LOC_TOPLEFT = -+ 3, ///< ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2 -+ AVCHROMA_LOC_TOP = 4, -+ AVCHROMA_LOC_BOTTOMLEFT = 5, -+ AVCHROMA_LOC_BOTTOM = 6, -+ AVCHROMA_LOC_NB ///< Not part of ABI -+}; -+ -+#endif /* AVUTIL_PIXFMT_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/rational.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/rational.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/rational.h -@@ -0,0 +1,221 @@ -+/* -+ * rational numbers -+ * Copyright (c) 2003 Michael Niedermayer -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+/** -+ * @file -+ * @ingroup lavu_math_rational -+ * Utilties for rational number calculation. -+ * @author Michael Niedermayer -+ */ -+ -+#ifndef AVUTIL_RATIONAL_H -+#define AVUTIL_RATIONAL_H -+ -+#include -+#include -+#include "attributes.h" -+ -+/** -+ * @defgroup lavu_math_rational AVRational -+ * @ingroup lavu_math -+ * Rational number calculation. -+ * -+ * While rational numbers can be expressed as floating-point numbers, the -+ * conversion process is a lossy one, so are floating-point operations. On the -+ * other hand, the nature of FFmpeg demands highly accurate calculation of -+ * timestamps. This set of rational number utilities serves as a generic -+ * interface for manipulating rational numbers as pairs of numerators and -+ * denominators. -+ * -+ * Many of the functions that operate on AVRational's have the suffix `_q`, in -+ * reference to the mathematical symbol "ℚ" (Q) which denotes the set of all -+ * rational numbers. -+ * -+ * @{ -+ */ -+ -+/** -+ * Rational number (pair of numerator and denominator). -+ */ -+typedef struct AVRational { -+ int num; ///< Numerator -+ int den; ///< Denominator -+} AVRational; -+ -+/** -+ * Create an AVRational. -+ * -+ * Useful for compilers that do not support compound literals. -+ * -+ * @note The return value is not reduced. -+ * @see av_reduce() -+ */ -+static inline AVRational av_make_q(int num, int den) { -+ AVRational r = {num, den}; -+ return r; -+} -+ -+/** -+ * Compare two rationals. -+ * -+ * @param a First rational -+ * @param b Second rational -+ * -+ * @return One of the following values: -+ * - 0 if `a == b` -+ * - 1 if `a > b` -+ * - -1 if `a < b` -+ * - `INT_MIN` if one of the values is of the form `0 / 0` -+ */ -+static inline int av_cmp_q(AVRational a, AVRational b) { -+ const int64_t tmp = a.num * (int64_t)b.den - b.num * (int64_t)a.den; -+ -+ if (tmp) -+ return (int)((tmp ^ a.den ^ b.den) >> 63) | 1; -+ else if (b.den && a.den) -+ return 0; -+ else if (a.num && b.num) -+ return (a.num >> 31) - (b.num >> 31); -+ else -+ return INT_MIN; -+} -+ -+/** -+ * Convert an AVRational to a `double`. -+ * @param a AVRational to convert -+ * @return `a` in floating-point form -+ * @see av_d2q() -+ */ -+static inline double av_q2d(AVRational a) { return a.num / (double)a.den; } -+ -+/** -+ * Reduce a fraction. -+ * -+ * This is useful for framerate calculations. -+ * -+ * @param[out] dst_num Destination numerator -+ * @param[out] dst_den Destination denominator -+ * @param[in] num Source numerator -+ * @param[in] den Source denominator -+ * @param[in] max Maximum allowed values for `dst_num` & `dst_den` -+ * @return 1 if the operation is exact, 0 otherwise -+ */ -+int av_reduce(int* dst_num, int* dst_den, int64_t num, int64_t den, -+ int64_t max); -+ -+/** -+ * Multiply two rationals. -+ * @param b First rational -+ * @param c Second rational -+ * @return b*c -+ */ -+AVRational av_mul_q(AVRational b, AVRational c) av_const; -+ -+/** -+ * Divide one rational by another. -+ * @param b First rational -+ * @param c Second rational -+ * @return b/c -+ */ -+AVRational av_div_q(AVRational b, AVRational c) av_const; -+ -+/** -+ * Add two rationals. -+ * @param b First rational -+ * @param c Second rational -+ * @return b+c -+ */ -+AVRational av_add_q(AVRational b, AVRational c) av_const; -+ -+/** -+ * Subtract one rational from another. -+ * @param b First rational -+ * @param c Second rational -+ * @return b-c -+ */ -+AVRational av_sub_q(AVRational b, AVRational c) av_const; -+ -+/** -+ * Invert a rational. -+ * @param q value -+ * @return 1 / q -+ */ -+static av_always_inline AVRational av_inv_q(AVRational q) { -+ AVRational r = {q.den, q.num}; -+ return r; -+} -+ -+/** -+ * Convert a double precision floating point number to a rational. -+ * -+ * In case of infinity, the returned value is expressed as `{1, 0}` or -+ * `{-1, 0}` depending on the sign. -+ * -+ * @param d `double` to convert -+ * @param max Maximum allowed numerator and denominator -+ * @return `d` in AVRational form -+ * @see av_q2d() -+ */ -+AVRational av_d2q(double d, int max) av_const; -+ -+/** -+ * Find which of the two rationals is closer to another rational. -+ * -+ * @param q Rational to be compared against -+ * @param q1,q2 Rationals to be tested -+ * @return One of the following values: -+ * - 1 if `q1` is nearer to `q` than `q2` -+ * - -1 if `q2` is nearer to `q` than `q1` -+ * - 0 if they have the same distance -+ */ -+int av_nearer_q(AVRational q, AVRational q1, AVRational q2); -+ -+/** -+ * Find the value in a list of rationals nearest a given reference rational. -+ * -+ * @param q Reference rational -+ * @param q_list Array of rationals terminated by `{0, 0}` -+ * @return Index of the nearest value found in the array -+ */ -+int av_find_nearest_q_idx(AVRational q, const AVRational* q_list); -+ -+/** -+ * Convert an AVRational to a IEEE 32-bit `float` expressed in fixed-point -+ * format. -+ * -+ * @param q Rational to be converted -+ * @return Equivalent floating-point value, expressed as an unsigned 32-bit -+ * integer. -+ * @note The returned value is platform-indepedant. -+ */ -+uint32_t av_q2intfloat(AVRational q); -+ -+/** -+ * Return the best rational so that a and b are multiple of it. -+ * If the resulting denominator is larger than max_den, return def. -+ */ -+AVRational av_gcd_q(AVRational a, AVRational b, int max_den, AVRational def); -+ -+/** -+ * @} -+ */ -+ -+#endif /* AVUTIL_RATIONAL_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/samplefmt.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/samplefmt.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/samplefmt.h -@@ -0,0 +1,276 @@ -+/* -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef AVUTIL_SAMPLEFMT_H -+#define AVUTIL_SAMPLEFMT_H -+ -+#include -+ -+#include "avutil.h" -+#include "attributes.h" -+ -+/** -+ * @addtogroup lavu_audio -+ * @{ -+ * -+ * @defgroup lavu_sampfmts Audio sample formats -+ * -+ * Audio sample format enumeration and related convenience functions. -+ * @{ -+ */ -+ -+/** -+ * Audio sample formats -+ * -+ * - The data described by the sample format is always in native-endian order. -+ * Sample values can be expressed by native C types, hence the lack of a -+ * signed 24-bit sample format even though it is a common raw audio data format. -+ * -+ * - The floating-point formats are based on full volume being in the range -+ * [-1.0, 1.0]. Any values outside this range are beyond full volume level. -+ * -+ * - The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg -+ * (such as AVFrame in libavcodec) is as follows: -+ * -+ * @par -+ * For planar sample formats, each audio channel is in a separate data plane, -+ * and linesize is the buffer size, in bytes, for a single plane. All data -+ * planes must be the same size. For packed sample formats, only the first data -+ * plane is used, and samples for each channel are interleaved. In this case, -+ * linesize is the buffer size, in bytes, for the 1 plane. -+ * -+ */ -+enum AVSampleFormat { -+ AV_SAMPLE_FMT_NONE = -1, -+ AV_SAMPLE_FMT_U8, ///< unsigned 8 bits -+ AV_SAMPLE_FMT_S16, ///< signed 16 bits -+ AV_SAMPLE_FMT_S32, ///< signed 32 bits -+ AV_SAMPLE_FMT_FLT, ///< float -+ AV_SAMPLE_FMT_DBL, ///< double -+ -+ AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar -+ AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar -+ AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar -+ AV_SAMPLE_FMT_FLTP, ///< float, planar -+ AV_SAMPLE_FMT_DBLP, ///< double, planar -+ AV_SAMPLE_FMT_S64, ///< signed 64 bits -+ AV_SAMPLE_FMT_S64P, ///< signed 64 bits, planar -+ -+ AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking -+ ///< dynamically -+}; -+ -+/** -+ * Return the name of sample_fmt, or NULL if sample_fmt is not -+ * recognized. -+ */ -+const char* av_get_sample_fmt_name(enum AVSampleFormat sample_fmt); -+ -+/** -+ * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE -+ * on error. -+ */ -+enum AVSampleFormat av_get_sample_fmt(const char* name); -+ -+/** -+ * Return the planar<->packed alternative form of the given sample format, or -+ * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the -+ * requested planar/packed format, the format returned is the same as the -+ * input. -+ */ -+enum AVSampleFormat av_get_alt_sample_fmt(enum AVSampleFormat sample_fmt, -+ int planar); -+ -+/** -+ * Get the packed alternative form of the given sample format. -+ * -+ * If the passed sample_fmt is already in packed format, the format returned is -+ * the same as the input. -+ * -+ * @return the packed alternative form of the given sample format or -+ AV_SAMPLE_FMT_NONE on error. -+ */ -+enum AVSampleFormat av_get_packed_sample_fmt(enum AVSampleFormat sample_fmt); -+ -+/** -+ * Get the planar alternative form of the given sample format. -+ * -+ * If the passed sample_fmt is already in planar format, the format returned is -+ * the same as the input. -+ * -+ * @return the planar alternative form of the given sample format or -+ AV_SAMPLE_FMT_NONE on error. -+ */ -+enum AVSampleFormat av_get_planar_sample_fmt(enum AVSampleFormat sample_fmt); -+ -+/** -+ * Generate a string corresponding to the sample format with -+ * sample_fmt, or a header if sample_fmt is negative. -+ * -+ * @param buf the buffer where to write the string -+ * @param buf_size the size of buf -+ * @param sample_fmt the number of the sample format to print the -+ * corresponding info string, or a negative value to print the -+ * corresponding header. -+ * @return the pointer to the filled buffer or NULL if sample_fmt is -+ * unknown or in case of other errors -+ */ -+char* av_get_sample_fmt_string(char* buf, int buf_size, -+ enum AVSampleFormat sample_fmt); -+ -+/** -+ * Return number of bytes per sample. -+ * -+ * @param sample_fmt the sample format -+ * @return number of bytes per sample or zero if unknown for the given -+ * sample format -+ */ -+int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt); -+ -+/** -+ * Check if the sample format is planar. -+ * -+ * @param sample_fmt the sample format to inspect -+ * @return 1 if the sample format is planar, 0 if it is interleaved -+ */ -+int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt); -+ -+/** -+ * Get the required buffer size for the given audio parameters. -+ * -+ * @param[out] linesize calculated linesize, may be NULL -+ * @param nb_channels the number of channels -+ * @param nb_samples the number of samples in a single channel -+ * @param sample_fmt the sample format -+ * @param align buffer size alignment (0 = default, 1 = no alignment) -+ * @return required buffer size, or negative error code on failure -+ */ -+int av_samples_get_buffer_size(int* linesize, int nb_channels, int nb_samples, -+ enum AVSampleFormat sample_fmt, int align); -+ -+/** -+ * @} -+ * -+ * @defgroup lavu_sampmanip Samples manipulation -+ * -+ * Functions that manipulate audio samples -+ * @{ -+ */ -+ -+/** -+ * Fill plane data pointers and linesize for samples with sample -+ * format sample_fmt. -+ * -+ * The audio_data array is filled with the pointers to the samples data planes: -+ * for planar, set the start point of each channel's data within the buffer, -+ * for packed, set the start point of the entire buffer only. -+ * -+ * The value pointed to by linesize is set to the aligned size of each -+ * channel's data buffer for planar layout, or to the aligned size of the -+ * buffer for all channels for packed layout. -+ * -+ * The buffer in buf must be big enough to contain all the samples -+ * (use av_samples_get_buffer_size() to compute its minimum size), -+ * otherwise the audio_data pointers will point to invalid data. -+ * -+ * @see enum AVSampleFormat -+ * The documentation for AVSampleFormat describes the data layout. -+ * -+ * @param[out] audio_data array to be filled with the pointer for each channel -+ * @param[out] linesize calculated linesize, may be NULL -+ * @param buf the pointer to a buffer containing the samples -+ * @param nb_channels the number of channels -+ * @param nb_samples the number of samples in a single channel -+ * @param sample_fmt the sample format -+ * @param align buffer size alignment (0 = default, 1 = no alignment) -+ * @return minimum size in bytes required for the buffer on -+ * success, or a negative error code on failure -+ */ -+int av_samples_fill_arrays(uint8_t** audio_data, int* linesize, -+ const uint8_t* buf, int nb_channels, int nb_samples, -+ enum AVSampleFormat sample_fmt, int align); -+ -+/** -+ * Allocate a samples buffer for nb_samples samples, and fill data pointers and -+ * linesize accordingly. -+ * The allocated samples buffer can be freed by using av_freep(&audio_data[0]) -+ * Allocated data will be initialized to silence. -+ * -+ * @see enum AVSampleFormat -+ * The documentation for AVSampleFormat describes the data layout. -+ * -+ * @param[out] audio_data array to be filled with the pointer for each channel -+ * @param[out] linesize aligned size for audio buffer(s), may be NULL -+ * @param nb_channels number of audio channels -+ * @param nb_samples number of samples per channel -+ * @param align buffer size alignment (0 = default, 1 = no alignment) -+ * @return >=0 on success or a negative error code on failure -+ * @todo return the size of the allocated buffer in case of success at the next -+ * bump -+ * @see av_samples_fill_arrays() -+ * @see av_samples_alloc_array_and_samples() -+ */ -+int av_samples_alloc(uint8_t** audio_data, int* linesize, int nb_channels, -+ int nb_samples, enum AVSampleFormat sample_fmt, int align); -+ -+/** -+ * Allocate a data pointers array, samples buffer for nb_samples -+ * samples, and fill data pointers and linesize accordingly. -+ * -+ * This is the same as av_samples_alloc(), but also allocates the data -+ * pointers array. -+ * -+ * @see av_samples_alloc() -+ */ -+int av_samples_alloc_array_and_samples(uint8_t*** audio_data, int* linesize, -+ int nb_channels, int nb_samples, -+ enum AVSampleFormat sample_fmt, -+ int align); -+ -+/** -+ * Copy samples from src to dst. -+ * -+ * @param dst destination array of pointers to data planes -+ * @param src source array of pointers to data planes -+ * @param dst_offset offset in samples at which the data will be written to dst -+ * @param src_offset offset in samples at which the data will be read from src -+ * @param nb_samples number of samples to be copied -+ * @param nb_channels number of audio channels -+ * @param sample_fmt audio sample format -+ */ -+int av_samples_copy(uint8_t** dst, uint8_t* const* src, int dst_offset, -+ int src_offset, int nb_samples, int nb_channels, -+ enum AVSampleFormat sample_fmt); -+ -+/** -+ * Fill an audio buffer with silence. -+ * -+ * @param audio_data array of pointers to data planes -+ * @param offset offset in samples at which to start filling -+ * @param nb_samples number of samples to fill -+ * @param nb_channels number of audio channels -+ * @param sample_fmt audio sample format -+ */ -+int av_samples_set_silence(uint8_t** audio_data, int offset, int nb_samples, -+ int nb_channels, enum AVSampleFormat sample_fmt); -+ -+/** -+ * @} -+ * @} -+ */ -+#endif /* AVUTIL_SAMPLEFMT_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/version.h b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/version.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/include/libavutil/version.h -@@ -0,0 +1,118 @@ -+/* -+ * copyright (c) 2003 Fabrice Bellard -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+/** -+ * @file -+ * @ingroup lavu -+ * Libavutil version macros -+ */ -+ -+#ifndef AVUTIL_VERSION_H -+#define AVUTIL_VERSION_H -+ -+#include "macros.h" -+ -+/** -+ * @addtogroup version_utils -+ * -+ * Useful to check and match library version in order to maintain -+ * backward compatibility. -+ * -+ * The FFmpeg libraries follow a versioning sheme very similar to -+ * Semantic Versioning (http://semver.org/) -+ * The difference is that the component called PATCH is called MICRO in FFmpeg -+ * and its value is reset to 100 instead of 0 to keep it above or equal to 100. -+ * Also we do not increase MICRO for every bugfix or change in git master. -+ * -+ * Prior to FFmpeg 3.2 point releases did not change any lib version number to -+ * avoid aliassing different git master checkouts. -+ * Starting with FFmpeg 3.2, the released library versions will occupy -+ * a separate MAJOR.MINOR that is not used on the master development branch. -+ * That is if we branch a release of master 55.10.123 we will bump to 55.11.100 -+ * for the release and master will continue at 55.12.100 after it. Each new -+ * point release will then bump the MICRO improving the usefulness of the lib -+ * versions. -+ * -+ * @{ -+ */ -+ -+#define AV_VERSION_INT(a, b, c) ((a) << 16 | (b) << 8 | (c)) -+#define AV_VERSION_DOT(a, b, c) a##.##b##.##c -+#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c) -+ -+/** -+ * Extract version components from the full ::AV_VERSION_INT int as returned -+ * by functions like ::avformat_version() and ::avcodec_version() -+ */ -+#define AV_VERSION_MAJOR(a) ((a) >> 16) -+#define AV_VERSION_MINOR(a) (((a)&0x00FF00) >> 8) -+#define AV_VERSION_MICRO(a) ((a)&0xFF) -+ -+/** -+ * @} -+ */ -+ -+/** -+ * @defgroup lavu_ver Version and Build diagnostics -+ * -+ * Macros and function useful to check at compiletime and at runtime -+ * which version of libavutil is in use. -+ * -+ * @{ -+ */ -+ -+#define LIBAVUTIL_VERSION_MAJOR 57 -+#define LIBAVUTIL_VERSION_MINOR 17 -+#define LIBAVUTIL_VERSION_MICRO 100 -+ -+#define LIBAVUTIL_VERSION_INT \ -+ AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, LIBAVUTIL_VERSION_MINOR, \ -+ LIBAVUTIL_VERSION_MICRO) -+#define LIBAVUTIL_VERSION \ -+ AV_VERSION(LIBAVUTIL_VERSION_MAJOR, LIBAVUTIL_VERSION_MINOR, \ -+ LIBAVUTIL_VERSION_MICRO) -+#define LIBAVUTIL_BUILD LIBAVUTIL_VERSION_INT -+ -+#define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION) -+ -+/** -+ * @defgroup lavu_depr_guards Deprecation Guards -+ * FF_API_* defines may be placed below to indicate public API that will be -+ * dropped at a future version bump. The defines themselves are not part of -+ * the public API and may change, break or disappear at any time. -+ * -+ * @note, when bumping the major version it is recommended to manually -+ * disable each FF_API_* in its own commit instead of disabling them all -+ * at once through the bump. This improves the git bisect-ability of the change. -+ * -+ * @{ -+ */ -+ -+#define FF_API_D2STR (LIBAVUTIL_VERSION_MAJOR < 58) -+#define FF_API_DECLARE_ALIGNED (LIBAVUTIL_VERSION_MAJOR < 58) -+#define FF_API_COLORSPACE_NAME (LIBAVUTIL_VERSION_MAJOR < 58) -+#define FF_API_AV_MALLOCZ_ARRAY (LIBAVUTIL_VERSION_MAJOR < 58) -+ -+/** -+ * @} -+ * @} -+ */ -+ -+#endif /* AVUTIL_VERSION_H */ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg59/moz.build b/dom/media/platforms/ffmpeg/ffmpeg59/moz.build -new file mode 100644 ---- /dev/null -+++ b/dom/media/platforms/ffmpeg/ffmpeg59/moz.build -@@ -0,0 +1,36 @@ -+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -+# vim: set filetype=python: -+# This Source Code Form is subject to the terms of the Mozilla Public -+# License, v. 2.0. If a copy of the MPL was not distributed with this -+# file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ -+UNIFIED_SOURCES += [ -+ '../FFmpegAudioDecoder.cpp', -+ '../FFmpegDataDecoder.cpp', -+ '../FFmpegDecoderModule.cpp', -+ '../FFmpegVideoDecoder.cpp', -+] -+LOCAL_INCLUDES += [ -+ '..', -+ '/media/mozva', -+ 'include', -+] -+ -+if CONFIG['CC_TYPE'] in ('clang', 'gcc'): -+ CXXFLAGS += [ '-Wno-deprecated-declarations' ] -+if CONFIG['CC_TYPE'] == 'clang': -+ CXXFLAGS += [ -+ '-Wno-unknown-attributes', -+ ] -+if CONFIG['CC_TYPE'] == 'gcc': -+ CXXFLAGS += [ -+ '-Wno-attributes', -+ ] -+if CONFIG['MOZ_WAYLAND']: -+ CXXFLAGS += CONFIG['MOZ_GTK3_CFLAGS'] -+ DEFINES['MOZ_WAYLAND_USE_VAAPI'] = 1 -+ USE_LIBS += ['mozva'] -+ -+include("/ipc/chromium/chromium-config.mozbuild") -+ -+FINAL_LIBRARY = 'xul' -diff --git a/dom/media/platforms/ffmpeg/moz.build b/dom/media/platforms/ffmpeg/moz.build ---- a/dom/media/platforms/ffmpeg/moz.build -+++ b/dom/media/platforms/ffmpeg/moz.build -@@ -14,6 +14,7 @@ - "libav55", - "ffmpeg57", - "ffmpeg58", -+ "ffmpeg59", - ] - - UNIFIED_SOURCES += [ - diff --git a/D139697.diff b/D139697.diff deleted file mode 100644 index 2b9dc32..0000000 --- a/D139697.diff +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/dom/media/platforms/ffmpeg/ffmpeg58/moz.build b/dom/media/platforms/ffmpeg/ffmpeg58/moz.build ---- a/dom/media/platforms/ffmpeg/ffmpeg58/moz.build -+++ b/dom/media/platforms/ffmpeg/ffmpeg58/moz.build -@@ -29,9 +29,6 @@ - if CONFIG['MOZ_WAYLAND']: - CXXFLAGS += CONFIG['MOZ_GTK3_CFLAGS'] - DEFINES['MOZ_WAYLAND_USE_VAAPI'] = 1 -- UNIFIED_SOURCES += [ -- '../FFmpegVideoFramePool.cpp', -- ] - USE_LIBS += ['mozva'] - - include("/ipc/chromium/chromium-config.mozbuild") -diff --git a/dom/media/platforms/ffmpeg/ffvpx/moz.build b/dom/media/platforms/ffmpeg/ffvpx/moz.build ---- a/dom/media/platforms/ffmpeg/ffvpx/moz.build -+++ b/dom/media/platforms/ffmpeg/ffvpx/moz.build -@@ -41,6 +41,9 @@ - CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"] - DEFINES["MOZ_WAYLAND_USE_VAAPI"] = 1 - USE_LIBS += ["mozva"] -+ UNIFIED_SOURCES += [ -+ "../FFmpegVideoFramePool.cpp", -+ ] - - include("/ipc/chromium/chromium-config.mozbuild") - - diff --git a/D139698.diff b/D139698.diff deleted file mode 100644 index 7bf7af9..0000000 --- a/D139698.diff +++ /dev/null @@ -1,191 +0,0 @@ -diff --git a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp ---- a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp -+++ b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp -@@ -64,14 +64,16 @@ - AV_FUNC_56 = 1 << 3, - AV_FUNC_57 = 1 << 4, - AV_FUNC_58 = 1 << 5, -+ AV_FUNC_59 = 1 << 6, - AV_FUNC_AVUTIL_53 = AV_FUNC_53 | AV_FUNC_AVUTIL_MASK, - AV_FUNC_AVUTIL_54 = AV_FUNC_54 | AV_FUNC_AVUTIL_MASK, - AV_FUNC_AVUTIL_55 = AV_FUNC_55 | AV_FUNC_AVUTIL_MASK, - AV_FUNC_AVUTIL_56 = AV_FUNC_56 | AV_FUNC_AVUTIL_MASK, - AV_FUNC_AVUTIL_57 = AV_FUNC_57 | AV_FUNC_AVUTIL_MASK, - AV_FUNC_AVUTIL_58 = AV_FUNC_58 | AV_FUNC_AVUTIL_MASK, -+ AV_FUNC_AVUTIL_59 = AV_FUNC_59 | AV_FUNC_AVUTIL_MASK, - AV_FUNC_AVCODEC_ALL = AV_FUNC_53 | AV_FUNC_54 | AV_FUNC_55 | AV_FUNC_56 | -- AV_FUNC_57 | AV_FUNC_58, -+ AV_FUNC_57 | AV_FUNC_58 | AV_FUNC_59, - AV_FUNC_AVUTIL_ALL = AV_FUNC_AVCODEC_ALL | AV_FUNC_AVUTIL_MASK - }; - -@@ -94,6 +96,9 @@ - case 58: - version = AV_FUNC_58; - break; -+ case 59: -+ version = AV_FUNC_59; -+ break; - default: - FFMPEG_LOG("Unknown avcodec version"); - Unlink(); -@@ -128,15 +133,19 @@ - : LinkResult::MissingLibAVFunction; \ - } - -- AV_FUNC(av_lockmgr_register, AV_FUNC_AVCODEC_ALL) -+ AV_FUNC(av_lockmgr_register, AV_FUNC_53 | AV_FUNC_54 | AV_FUNC_55 | -+ AV_FUNC_56 | AV_FUNC_57 | AV_FUNC_58) - AV_FUNC(avcodec_alloc_context3, AV_FUNC_AVCODEC_ALL) - AV_FUNC(avcodec_close, AV_FUNC_AVCODEC_ALL) -- AV_FUNC(avcodec_decode_audio4, AV_FUNC_AVCODEC_ALL) -- AV_FUNC(avcodec_decode_video2, AV_FUNC_AVCODEC_ALL) -+ AV_FUNC(avcodec_decode_audio4, AV_FUNC_53 | AV_FUNC_54 | AV_FUNC_55 | -+ AV_FUNC_56 | AV_FUNC_57 | AV_FUNC_58) -+ AV_FUNC(avcodec_decode_video2, AV_FUNC_53 | AV_FUNC_54 | AV_FUNC_55 | -+ AV_FUNC_56 | AV_FUNC_57 | AV_FUNC_58) - AV_FUNC(avcodec_find_decoder, AV_FUNC_AVCODEC_ALL) - AV_FUNC(avcodec_flush_buffers, AV_FUNC_AVCODEC_ALL) - AV_FUNC(avcodec_open2, AV_FUNC_AVCODEC_ALL) -- AV_FUNC(avcodec_register_all, AV_FUNC_AVCODEC_ALL) -+ AV_FUNC(avcodec_register_all, AV_FUNC_53 | AV_FUNC_54 | AV_FUNC_55 | -+ AV_FUNC_56 | AV_FUNC_57 | AV_FUNC_58) - AV_FUNC(av_init_packet, AV_FUNC_AVCODEC_ALL) - AV_FUNC(av_parser_init, AV_FUNC_AVCODEC_ALL) - AV_FUNC(av_parser_close, AV_FUNC_AVCODEC_ALL) -@@ -145,49 +154,56 @@ - AV_FUNC(avcodec_alloc_frame, (AV_FUNC_53 | AV_FUNC_54)) - AV_FUNC(avcodec_get_frame_defaults, (AV_FUNC_53 | AV_FUNC_54)) - AV_FUNC(avcodec_free_frame, AV_FUNC_54) -- AV_FUNC(avcodec_send_packet, AV_FUNC_58) -- AV_FUNC(avcodec_receive_frame, AV_FUNC_58) -+ AV_FUNC(avcodec_send_packet, AV_FUNC_58 | AV_FUNC_59) -+ AV_FUNC(avcodec_receive_frame, AV_FUNC_58 | AV_FUNC_59) - AV_FUNC(avcodec_default_get_buffer2, -- (AV_FUNC_55 | AV_FUNC_56 | AV_FUNC_57 | AV_FUNC_58)) -+ (AV_FUNC_55 | AV_FUNC_56 | AV_FUNC_57 | AV_FUNC_58 | AV_FUNC_59)) - AV_FUNC_OPTION(av_rdft_init, AV_FUNC_AVCODEC_ALL) - AV_FUNC_OPTION(av_rdft_calc, AV_FUNC_AVCODEC_ALL) - AV_FUNC_OPTION(av_rdft_end, AV_FUNC_AVCODEC_ALL) - AV_FUNC(av_log_set_level, AV_FUNC_AVUTIL_ALL) - AV_FUNC(av_malloc, AV_FUNC_AVUTIL_ALL) - AV_FUNC(av_freep, AV_FUNC_AVUTIL_ALL) -- AV_FUNC(av_frame_alloc, (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 | -- AV_FUNC_AVUTIL_57 | AV_FUNC_AVUTIL_58)) -- AV_FUNC(av_frame_free, (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 | -- AV_FUNC_AVUTIL_57 | AV_FUNC_AVUTIL_58)) -- AV_FUNC(av_frame_unref, (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 | -- AV_FUNC_AVUTIL_57 | AV_FUNC_AVUTIL_58)) -+ AV_FUNC(av_frame_alloc, -+ (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 | AV_FUNC_AVUTIL_57 | -+ AV_FUNC_AVUTIL_58 | AV_FUNC_AVUTIL_59)) -+ AV_FUNC(av_frame_free, -+ (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 | AV_FUNC_AVUTIL_57 | -+ AV_FUNC_AVUTIL_58 | AV_FUNC_AVUTIL_59)) -+ AV_FUNC(av_frame_unref, -+ (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 | AV_FUNC_AVUTIL_57 | -+ AV_FUNC_AVUTIL_58 | AV_FUNC_AVUTIL_59)) - AV_FUNC(av_image_check_size, AV_FUNC_AVUTIL_ALL) - AV_FUNC(av_image_get_buffer_size, AV_FUNC_AVUTIL_ALL) -- AV_FUNC_OPTION(av_buffer_get_opaque, -- (AV_FUNC_AVUTIL_56 | AV_FUNC_AVUTIL_57 | AV_FUNC_AVUTIL_58)) -- AV_FUNC(av_buffer_create, (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 | -- AV_FUNC_AVUTIL_57 | AV_FUNC_AVUTIL_58)) -+ AV_FUNC_OPTION(av_buffer_get_opaque, (AV_FUNC_AVUTIL_56 | AV_FUNC_AVUTIL_57 | -+ AV_FUNC_AVUTIL_58 | AV_FUNC_AVUTIL_59)) -+ AV_FUNC(av_buffer_create, -+ (AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 | AV_FUNC_AVUTIL_57 | -+ AV_FUNC_AVUTIL_58 | AV_FUNC_AVUTIL_59)) - AV_FUNC_OPTION(av_frame_get_colorspace, AV_FUNC_AVUTIL_ALL) - AV_FUNC_OPTION(av_frame_get_color_range, AV_FUNC_AVUTIL_ALL) - - #ifdef MOZ_WAYLAND -- AV_FUNC_OPTION_SILENT(avcodec_get_hw_config, AV_FUNC_58) -- AV_FUNC_OPTION_SILENT(av_codec_iterate, AV_FUNC_58) -- AV_FUNC_OPTION_SILENT(av_codec_is_decoder, AV_FUNC_58) -- AV_FUNC_OPTION_SILENT(av_hwdevice_ctx_init, AV_FUNC_58) -- AV_FUNC_OPTION_SILENT(av_hwdevice_ctx_alloc, AV_FUNC_58) -- AV_FUNC_OPTION_SILENT(av_hwdevice_hwconfig_alloc, AV_FUNC_58) -- AV_FUNC_OPTION_SILENT(av_hwdevice_get_hwframe_constraints, AV_FUNC_58) -- AV_FUNC_OPTION_SILENT(av_hwframe_constraints_free, AV_FUNC_58) -- AV_FUNC_OPTION_SILENT(av_buffer_ref, AV_FUNC_AVUTIL_58) -- AV_FUNC_OPTION_SILENT(av_buffer_unref, AV_FUNC_AVUTIL_58) -- AV_FUNC_OPTION_SILENT(av_hwframe_transfer_get_formats, AV_FUNC_58) -- AV_FUNC_OPTION_SILENT(av_hwdevice_ctx_create_derived, AV_FUNC_58) -- AV_FUNC_OPTION_SILENT(av_hwframe_ctx_alloc, AV_FUNC_58) -- AV_FUNC_OPTION_SILENT(av_dict_set, AV_FUNC_58) -- AV_FUNC_OPTION_SILENT(av_dict_free, AV_FUNC_58) -- AV_FUNC_OPTION_SILENT(avcodec_get_name, AV_FUNC_58) -- AV_FUNC_OPTION_SILENT(av_get_pix_fmt_string, AV_FUNC_AVUTIL_58) -+ AV_FUNC_OPTION_SILENT(avcodec_get_hw_config, AV_FUNC_58 | AV_FUNC_59) -+ AV_FUNC_OPTION_SILENT(av_codec_iterate, AV_FUNC_58 | AV_FUNC_59) -+ AV_FUNC_OPTION_SILENT(av_codec_is_decoder, AV_FUNC_58 | AV_FUNC_59) -+ AV_FUNC_OPTION_SILENT(av_hwdevice_ctx_init, AV_FUNC_58 | AV_FUNC_59) -+ AV_FUNC_OPTION_SILENT(av_hwdevice_ctx_alloc, AV_FUNC_58 | AV_FUNC_59) -+ AV_FUNC_OPTION_SILENT(av_hwdevice_hwconfig_alloc, AV_FUNC_58 | AV_FUNC_59) -+ AV_FUNC_OPTION_SILENT(av_hwdevice_get_hwframe_constraints, -+ AV_FUNC_58 | AV_FUNC_59) -+ AV_FUNC_OPTION_SILENT(av_hwframe_constraints_free, AV_FUNC_58 | AV_FUNC_59) -+ AV_FUNC_OPTION_SILENT(av_buffer_ref, AV_FUNC_AVUTIL_58 | AV_FUNC_59) -+ AV_FUNC_OPTION_SILENT(av_buffer_unref, AV_FUNC_AVUTIL_58 | AV_FUNC_59) -+ AV_FUNC_OPTION_SILENT(av_hwframe_transfer_get_formats, -+ AV_FUNC_58 | AV_FUNC_59) -+ AV_FUNC_OPTION_SILENT(av_hwdevice_ctx_create_derived, AV_FUNC_58 | AV_FUNC_59) -+ AV_FUNC_OPTION_SILENT(av_hwframe_ctx_alloc, AV_FUNC_58 | AV_FUNC_59) -+ AV_FUNC_OPTION_SILENT(av_dict_set, AV_FUNC_58 | AV_FUNC_59) -+ AV_FUNC_OPTION_SILENT(av_dict_free, AV_FUNC_58 | AV_FUNC_59) -+ AV_FUNC_OPTION_SILENT(avcodec_get_name, AV_FUNC_58 | AV_FUNC_59) -+ AV_FUNC_OPTION_SILENT(av_get_pix_fmt_string, -+ AV_FUNC_AVUTIL_58 | AV_FUNC_AVUTIL_59) - #endif - #undef AV_FUNC - #undef AV_FUNC_OPTION -@@ -219,7 +235,9 @@ - # undef VAD_FUNC_OPTION_SILENT - #endif - -- avcodec_register_all(); -+ if (avcodec_register_all) { -+ avcodec_register_all(); -+ } - if (MOZ_LOG_TEST(sPDMLog, LogLevel::Debug)) { - av_log_set_level(AV_LOG_DEBUG); - } else if (MOZ_LOG_TEST(sPDMLog, LogLevel::Info)) { -diff --git a/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp b/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp ---- a/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp -+++ b/dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp -@@ -27,6 +27,7 @@ - static const char* sLibs[] = { - // clang-format off - #if defined(XP_DARWIN) -+ "libavcodec.59.dylib", - "libavcodec.58.dylib", - "libavcodec.57.dylib", - "libavcodec.56.dylib", -@@ -34,6 +35,7 @@ - "libavcodec.54.dylib", - "libavcodec.53.dylib", - #else -+ "libavcodec.so.59", - "libavcodec.so.58", - "libavcodec-ffmpeg.so.58", - "libavcodec-ffmpeg.so.57", -@@ -76,7 +78,6 @@ - sLinkStatusLibraryName = lib; - return true; - case FFmpegLibWrapper::LinkResult::NoProvidedLib: -- MOZ_ASSERT_UNREACHABLE("Incorrectly-setup sLibAV"); - break; - case FFmpegLibWrapper::LinkResult::NoAVCodecVersion: - if (sLinkStatus > LinkStatus_INVALID_CANDIDATE) { -@@ -152,6 +153,9 @@ - case 58: - module = FFmpegDecoderModule<58>::Create(&sLibAV); - break; -+ case 59: -+ module = FFmpegDecoderModule<59>::Create(&sLibAV); -+ break; - default: - module = nullptr; - } - diff --git a/D139699.diff b/D139699.diff deleted file mode 100644 index a4be4c5..0000000 --- a/D139699.diff +++ /dev/null @@ -1,127 +0,0 @@ -diff --git a/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.cpp ---- a/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.cpp -+++ b/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.cpp -@@ -206,15 +206,49 @@ - media::TimeUnit pts = aSample->mTime; - - while (packet.size > 0) { -- int decoded; -- int bytesConsumed = -+ int decoded = false; -+ int bytesConsumed = -1; -+#if LIBAVCODEC_VERSION_MAJOR < 59 -+ bytesConsumed = - mLib->avcodec_decode_audio4(mCodecContext, mFrame, &decoded, &packet); -- - if (bytesConsumed < 0) { - NS_WARNING("FFmpeg audio decoder error."); - return MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, - RESULT_DETAIL("FFmpeg audio error:%d", bytesConsumed)); - } -+#else -+# define AVERROR_OK 0 -+ -+ int ret = mLib->avcodec_receive_frame(mCodecContext, mFrame); -+ switch (ret) { -+ case AVERROR_OK: -+ decoded = true; -+ break; -+ case AVERROR(EAGAIN): -+ break; -+ case int(AVERROR_EOF): { -+ FFMPEG_LOG(" End of stream."); -+ return MediaResult(NS_ERROR_DOM_MEDIA_END_OF_STREAM, -+ RESULT_DETAIL("End of stream")); -+ } -+ } -+ ret = mLib->avcodec_send_packet(mCodecContext, &packet); -+ switch (ret) { -+ case AVERROR_OK: -+ bytesConsumed = packet.size; -+ break; -+ case AVERROR(EAGAIN): -+ break; -+ case int(AVERROR_EOF): -+ FFMPEG_LOG(" End of stream."); -+ return MediaResult(NS_ERROR_DOM_MEDIA_END_OF_STREAM, -+ RESULT_DETAIL("End of stream")); -+ default: -+ NS_WARNING("FFmpeg audio decoder error."); -+ return MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, -+ RESULT_DETAIL("FFmpeg audio error")); -+ } -+#endif - - if (decoded) { - if (mFrame->format != AV_SAMPLE_FMT_FLT && -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 -@@ -39,6 +39,9 @@ - # define AV_PIX_FMT_YUV444P10LE PIX_FMT_YUV444P10LE - # define AV_PIX_FMT_NONE PIX_FMT_NONE - #endif -+#if LIBAVCODEC_VERSION_MAJOR > 58 -+# define AV_PIX_FMT_VAAPI_VLD AV_PIX_FMT_VAAPI -+#endif - #include "mozilla/PodOperations.h" - #include "mozilla/StaticPrefs_media.h" - #include "mozilla/TaskQueue.h" -@@ -766,6 +769,14 @@ - } - #endif - -+static int64_t GetFramePts(AVFrame* aFrame) { -+#if LIBAVCODEC_VERSION_MAJOR > 58 -+ return aFrame->pts; -+#else -+ return aFrame->pkt_pts; -+#endif -+} -+ - MediaResult FFmpegVideoDecoder::DoDecode( - MediaRawData* aSample, uint8_t* aData, int aSize, bool* aGotFrame, - MediaDataDecoder::DecodedData& aResults) { -@@ -831,7 +842,7 @@ - MediaResult rv; - # ifdef MOZ_WAYLAND_USE_VAAPI - if (IsHardwareAccelerated()) { -- rv = CreateImageVAAPI(mFrame->pkt_pos, mFrame->pkt_pts, -+ rv = CreateImageVAAPI(mFrame->pkt_pos, GetFramePts(mFrame), - mFrame->pkt_duration, aResults); - // If VA-API playback failed, just quit. Decoder is going to be restarted - // without VA-API. -@@ -844,8 +855,8 @@ - } else - # endif - { -- rv = CreateImage(mFrame->pkt_pos, mFrame->pkt_pts, mFrame->pkt_duration, -- aResults); -+ rv = CreateImage(mFrame->pkt_pos, GetFramePts(mFrame), -+ mFrame->pkt_duration, aResults); - } - if (NS_FAILED(rv)) { - return rv; -@@ -879,9 +890,9 @@ - "DoDecodeFrame:decode_video: rv=%d decoded=%d " - "(Input: pts(%" PRId64 ") dts(%" PRId64 ") Output: pts(%" PRId64 - ") " -- "opaque(%" PRId64 ") pkt_pts(%" PRId64 ") pkt_dts(%" PRId64 "))", -+ "opaque(%" PRId64 ") pts(%" PRId64 ") pkt_dts(%" PRId64 "))", - bytesConsumed, decoded, packet.pts, packet.dts, mFrame->pts, -- mFrame->reordered_opaque, mFrame->pkt_pts, mFrame->pkt_dts); -+ mFrame->reordered_opaque, mFrame->pts, mFrame->pkt_dts); - - if (bytesConsumed < 0) { - return MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, -@@ -896,7 +907,8 @@ - } - - // If we've decoded a frame then we need to output it -- int64_t pts = mPtsContext.GuessCorrectPts(mFrame->pkt_pts, mFrame->pkt_dts); -+ int64_t pts = -+ mPtsContext.GuessCorrectPts(GetFramePts(mFrame), mFrame->pkt_dts); - // Retrieve duration from dts. - // We use the first entry found matching this dts (this is done to - // handle damaged file with multiple frames with the same dts) - diff --git a/D139703.diff b/D139703.diff deleted file mode 100644 index 4c929fd..0000000 --- a/D139703.diff +++ /dev/null @@ -1,222 +0,0 @@ -diff --git a/js/src/jit/GenerateAtomicOperations.py b/js/src/jit/GenerateAtomicOperations.py ---- a/js/src/jit/GenerateAtomicOperations.py -+++ b/js/src/jit/GenerateAtomicOperations.py -@@ -10,6 +10,7 @@ - - is_64bit = "JS_64BIT" in buildconfig.defines - cpu_arch = buildconfig.substs["CPU_ARCH"] -+is_gcc = buildconfig.substs["CC_TYPE"] == "gcc" - - - def fmt_insn(s): -@@ -19,21 +20,21 @@ - def gen_seqcst(fun_name): - if cpu_arch in ("x86", "x86_64"): - return r""" -- inline void %(fun_name)s() { -+ INLINE_ATTR void %(fun_name)s() { - asm volatile ("mfence\n\t" ::: "memory"); - }""" % { - "fun_name": fun_name, - } - if cpu_arch == "aarch64": - return r""" -- inline void %(fun_name)s() { -+ INLINE_ATTR void %(fun_name)s() { - asm volatile ("dmb ish\n\t" ::: "memory"); - }""" % { - "fun_name": fun_name, - } - if cpu_arch == "arm": - return r""" -- inline void %(fun_name)s() { -+ INLINE_ATTR void %(fun_name)s() { - asm volatile ("dmb sy\n\t" ::: "memory"); - }""" % { - "fun_name": fun_name, -@@ -63,7 +64,7 @@ - if barrier: - insns += fmt_insn("mfence") - return """ -- inline %(cpp_type)s %(fun_name)s(const %(cpp_type)s* arg) { -+ INLINE_ATTR %(cpp_type)s %(fun_name)s(const %(cpp_type)s* arg) { - %(cpp_type)s res; - asm volatile (%(insns)s - : [res] "=r" (res) -@@ -91,7 +92,7 @@ - if barrier: - insns += fmt_insn("dmb ish") - return """ -- inline %(cpp_type)s %(fun_name)s(const %(cpp_type)s* arg) { -+ INLINE_ATTR %(cpp_type)s %(fun_name)s(const %(cpp_type)s* arg) { - %(cpp_type)s res; - asm volatile (%(insns)s - : [res] "=r" (res) -@@ -117,7 +118,7 @@ - if barrier: - insns += fmt_insn("dmb sy") - return """ -- inline %(cpp_type)s %(fun_name)s(const %(cpp_type)s* arg) { -+ INLINE_ATTR %(cpp_type)s %(fun_name)s(const %(cpp_type)s* arg) { - %(cpp_type)s res; - asm volatile (%(insns)s - : [res] "=r" (res) -@@ -154,7 +155,7 @@ - if barrier: - insns += fmt_insn("mfence") - return """ -- inline void %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { -+ INLINE_ATTR void %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { - asm volatile (%(insns)s - : - : [addr] "r" (addr), [val] "r"(val) -@@ -180,7 +181,7 @@ - if barrier: - insns += fmt_insn("dmb ish") - return """ -- inline void %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { -+ INLINE_ATTR void %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { - asm volatile (%(insns)s - : - : [addr] "r" (addr), [val] "r"(val) -@@ -204,7 +205,7 @@ - if barrier: - insns += fmt_insn("dmb sy") - return """ -- inline void %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { -+ INLINE_ATTR void %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { - asm volatile (%(insns)s - : - : [addr] "r" (addr), [val] "r"(val) -@@ -235,7 +236,7 @@ - assert size == 64 - insns += fmt_insn("xchgq %[val], (%[addr])") - return """ -- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { -+ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { - asm volatile (%(insns)s - : [val] "+r" (val) - : [addr] "r" (addr) -@@ -266,7 +267,7 @@ - insns += fmt_insn("cbnz %w[scratch], 0b") - insns += fmt_insn("dmb ish") - return """ -- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { -+ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { - %(cpp_type)s res; - uint32_t scratch; - asm volatile (%(insns)s -@@ -297,7 +298,7 @@ - insns += fmt_insn("beq 0b") - insns += fmt_insn("dmb sy") - return """ -- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { -+ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { - %(cpp_type)s res; - uint32_t scratch; - asm volatile (%(insns)s -@@ -321,7 +322,7 @@ - # Use a +A constraint to load `oldval` into EDX:EAX as input/output. - # `newval` is loaded into ECX:EBX. - return r""" -- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, -+ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, - %(cpp_type)s oldval, - %(cpp_type)s newval) { - asm volatile ("lock; cmpxchg8b (%%[addr])\n\t" -@@ -337,7 +338,7 @@ - } - if cpu_arch == "arm" and size == 64: - return r""" -- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, -+ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, - %(cpp_type)s oldval, - %(cpp_type)s newval) { - uint32_t oldval0 = oldval & 0xffff'ffff; -@@ -380,7 +381,7 @@ - assert size == 64 - insns += fmt_insn("lock; cmpxchgq %[newval], (%[addr])") - return """ -- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, -+ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, - %(cpp_type)s oldval, - %(cpp_type)s newval) { - asm volatile (%(insns)s -@@ -425,7 +426,7 @@ - insns += fmt_insn("cbnz %w[scratch], 0b") - insns += fmt_insn("1: dmb ish") - return """ -- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, -+ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, - %(cpp_type)s oldval, - %(cpp_type)s newval) { - %(cpp_type)s res, scratch; -@@ -466,7 +467,7 @@ - insns += fmt_insn("beq 0b") - insns += fmt_insn("1: dmb sy") - return """ -- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, -+ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, - %(cpp_type)s oldval, - %(cpp_type)s newval) { - %(cpp_type)s res, scratch; -@@ -501,7 +502,7 @@ - assert size == 64 - insns += fmt_insn("lock; xaddq %[val], (%[addr])") - return """ -- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { -+ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { - asm volatile (%(insns)s - : [val] "+&r" (val) - : [addr] "r" (addr) -@@ -539,7 +540,7 @@ - insns = insns.replace("OP", op) - insns += fmt_insn("jnz 0b") - return """ -- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { -+ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { - %(cpp_type)s res, scratch; - asm volatile (%(insns)s - : [res] "=&a" (res), [scratch] "=&r" (scratch) -@@ -581,7 +582,7 @@ - insns += fmt_insn("cbnz %w[scratch2], 0b") - insns += fmt_insn("dmb ish") - return """ -- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { -+ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { - %(cpp_type)s res; - uintptr_t scratch1, scratch2; - asm volatile (%(insns)s -@@ -621,7 +622,7 @@ - insns += fmt_insn("beq 0b") - insns += fmt_insn("dmb sy") - return """ -- inline %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { -+ INLINE_ATTR %(cpp_type)s %(fun_name)s(%(cpp_type)s* addr, %(cpp_type)s val) { - %(cpp_type)s res; - uintptr_t scratch1, scratch2; - asm volatile (%(insns)s -@@ -681,7 +682,7 @@ - offset -= 1 - - return """ -- inline void %(fun_name)s(uint8_t* dst, const uint8_t* src) { -+ INLINE_ATTR void %(fun_name)s(uint8_t* dst, const uint8_t* src) { - %(cpp_type)s* dst_ = reinterpret_cast<%(cpp_type)s*>(dst); - const %(cpp_type)s* src_ = reinterpret_cast(src); - %(cpp_type)s scratch; -@@ -853,6 +854,13 @@ - "constexpr size_t JS_GENERATED_ATOMICS_WORDSIZE = " + str(wordsize) + ";\n" - ) - -+ # Work around a GCC issue on 32-bit x86 by adding MOZ_NEVER_INLINE. -+ # See bug 1756347. -+ if is_gcc and cpu_arch == "x86": -+ contents = contents.replace("INLINE_ATTR", "MOZ_NEVER_INLINE inline") -+ else: -+ contents = contents.replace("INLINE_ATTR", "inline") -+ - c_out.write( - HEADER_TEMPLATE - % { - diff --git a/D139704.diff b/D139704.diff deleted file mode 100644 index ab1ea42..0000000 --- a/D139704.diff +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/js/src/jit/GenerateAtomicOperations.py b/js/src/jit/GenerateAtomicOperations.py ---- a/js/src/jit/GenerateAtomicOperations.py -+++ b/js/src/jit/GenerateAtomicOperations.py -@@ -666,12 +666,12 @@ - insns += fmt_insn("str %x[scratch], [%x[dst], OFFSET]") - elif cpu_arch == "arm": - if size == 1: -- insns += fmt_insn("ldrb %[scratch], [%[src], OFFSET]") -- insns += fmt_insn("strb %[scratch], [%[dst], OFFSET]") -+ insns += fmt_insn("ldrb %[scratch], [%[src], #OFFSET]") -+ insns += fmt_insn("strb %[scratch], [%[dst], #OFFSET]") - else: - assert size == 4 -- insns += fmt_insn("ldr %[scratch], [%[src], OFFSET]") -- insns += fmt_insn("str %[scratch], [%[dst], OFFSET]") -+ insns += fmt_insn("ldr %[scratch], [%[src], #OFFSET]") -+ insns += fmt_insn("str %[scratch], [%[dst], #OFFSET]") - else: - raise Exception("Unexpected arch") - insns = insns.replace("OFFSET", str(offset * size)) - diff --git a/D142257.diff b/D142257.diff new file mode 100644 index 0000000..5779e41 --- /dev/null +++ b/D142257.diff @@ -0,0 +1,313 @@ +diff -up firefox-99.0/gfx/gl/GLContextEGL.h.D142257 firefox-99.0/gfx/gl/GLContextEGL.h +--- firefox-99.0/gfx/gl/GLContextEGL.h.D142257 2022-03-31 01:24:45.000000000 +0200 ++++ firefox-99.0/gfx/gl/GLContextEGL.h 2022-04-06 10:32:53.287145554 +0200 +@@ -21,11 +21,9 @@ class CompositorWidget; + } // namespace widget + namespace gl { + +-RefPtr DefaultEglLibrary(nsACString* const out_failureId); +- + inline std::shared_ptr DefaultEglDisplay( + nsACString* const out_failureId) { +- const auto lib = DefaultEglLibrary(out_failureId); ++ const auto lib = GLLibraryEGL::Get(out_failureId); + if (!lib) { + return nullptr; + } +diff -up firefox-99.0/gfx/gl/GLContextProviderEGL.cpp.D142257 firefox-99.0/gfx/gl/GLContextProviderEGL.cpp +--- firefox-99.0/gfx/gl/GLContextProviderEGL.cpp.D142257 2022-03-31 01:24:50.000000000 +0200 ++++ firefox-99.0/gfx/gl/GLContextProviderEGL.cpp 2022-04-06 10:34:20.468017966 +0200 +@@ -237,7 +237,7 @@ class GLContextEGLFactory { + already_AddRefed GLContextEGLFactory::CreateImpl( + EGLNativeWindowType aWindow, bool aHardwareWebRender, bool aUseGles) { + nsCString failureId; +- const auto lib = gl::DefaultEglLibrary(&failureId); ++ const auto lib = GLLibraryEGL::Get(&failureId); + if (!lib) { + gfxCriticalNote << "Failed[3] to load EGL library: " << failureId.get(); + return nullptr; +@@ -1209,32 +1209,8 @@ already_AddRefed GLContextPro + /*static*/ + GLContext* GLContextProviderEGL::GetGlobalContext() { return nullptr; } + +-// - +- +-static StaticMutex sMutex; +-static StaticRefPtr gDefaultEglLibrary; +- +-RefPtr DefaultEglLibrary(nsACString* const out_failureId) { +- StaticMutexAutoLock lock(sMutex); +- if (!gDefaultEglLibrary) { +- gDefaultEglLibrary = GLLibraryEGL::Create(out_failureId); +- if (!gDefaultEglLibrary) { +- NS_WARNING("GLLibraryEGL::Create failed"); +- } +- } +- return gDefaultEglLibrary.get(); +-} +- +-// - +- + /*static*/ +-void GLContextProviderEGL::Shutdown() { +- StaticMutexAutoLock lock(sMutex); +- if (!gDefaultEglLibrary) { +- return; +- } +- gDefaultEglLibrary = nullptr; +-} ++void GLContextProviderEGL::Shutdown() { GLLibraryEGL::Shutdown(); } + + } /* namespace gl */ + } /* namespace mozilla */ +diff -up firefox-99.0/gfx/gl/GLLibraryEGL.cpp.D142257 firefox-99.0/gfx/gl/GLLibraryEGL.cpp +--- firefox-99.0/gfx/gl/GLLibraryEGL.cpp.D142257 2022-03-31 01:24:45.000000000 +0200 ++++ firefox-99.0/gfx/gl/GLLibraryEGL.cpp 2022-04-06 10:32:53.288145587 +0200 +@@ -48,6 +48,9 @@ + namespace mozilla { + namespace gl { + ++StaticMutex GLLibraryEGL::sMutex; ++StaticRefPtr GLLibraryEGL::sInstance; ++ + // should match the order of EGLExtensions, and be null-terminated. + static const char* sEGLLibraryExtensionNames[] = { + "EGL_ANDROID_get_native_client_buffer", "EGL_ANGLE_device_creation", +@@ -140,15 +143,17 @@ static PRLibrary* LoadLibraryForEGLOnWin + + #endif // XP_WIN + +-static std::shared_ptr GetAndInitDisplay(GLLibraryEGL& egl, +- void* displayType) { ++static std::shared_ptr GetAndInitDisplay( ++ GLLibraryEGL& egl, void* displayType, ++ const StaticMutexAutoLock& aProofOfLock) { + const auto display = egl.fGetDisplay(displayType); + if (!display) return nullptr; +- return EglDisplay::Create(egl, display, false); ++ return EglDisplay::Create(egl, display, false, aProofOfLock); + } + +-static std::shared_ptr GetAndInitWARPDisplay(GLLibraryEGL& egl, +- void* displayType) { ++static std::shared_ptr GetAndInitWARPDisplay( ++ GLLibraryEGL& egl, void* displayType, ++ const StaticMutexAutoLock& aProofOfLock) { + const EGLAttrib attrib_list[] = { + LOCAL_EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE, + LOCAL_EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE, +@@ -167,11 +172,12 @@ static std::shared_ptr GetAn + return nullptr; + } + +- return EglDisplay::Create(egl, display, true); ++ return EglDisplay::Create(egl, display, true, aProofOfLock); + } + + std::shared_ptr GLLibraryEGL::CreateDisplay( + ID3D11Device* const d3d11Device) { ++ StaticMutexAutoLock lock(sMutex); + EGLDeviceEXT eglDevice = + fCreateDeviceANGLE(LOCAL_EGL_D3D11_DEVICE_ANGLE, d3d11Device, nullptr); + if (!eglDevice) { +@@ -199,7 +205,7 @@ std::shared_ptr GLLibraryEGL + return nullptr; + } + +- const auto ret = EglDisplay::Create(*this, display, false); ++ const auto ret = EglDisplay::Create(*this, display, false, lock); + + if (!ret) { + const EGLint err = fGetError(); +@@ -263,7 +269,8 @@ class AngleErrorReporting { + AngleErrorReporting gAngleErrorReporter; + + static std::shared_ptr GetAndInitDisplayForAccelANGLE( +- GLLibraryEGL& egl, nsACString* const out_failureId) { ++ GLLibraryEGL& egl, nsACString* const out_failureId, ++ const StaticMutexAutoLock& aProofOfLock) { + gfx::FeatureState& d3d11ANGLE = + gfx::gfxConfig::GetFeature(gfx::Feature::D3D11_HW_ANGLE); + +@@ -285,16 +292,18 @@ static std::shared_ptr GetAn + }); + + if (gfx::gfxConfig::IsForcedOnByUser(gfx::Feature::D3D11_HW_ANGLE)) { +- return GetAndInitDisplay(egl, LOCAL_EGL_D3D11_ONLY_DISPLAY_ANGLE); ++ return GetAndInitDisplay(egl, LOCAL_EGL_D3D11_ONLY_DISPLAY_ANGLE, ++ aProofOfLock); + } + + std::shared_ptr ret; + if (d3d11ANGLE.IsEnabled()) { +- ret = GetAndInitDisplay(egl, LOCAL_EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE); ++ ret = GetAndInitDisplay(egl, LOCAL_EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE, ++ aProofOfLock); + } + + if (!ret) { +- ret = GetAndInitDisplay(egl, EGL_DEFAULT_DISPLAY); ++ ret = GetAndInitDisplay(egl, EGL_DEFAULT_DISPLAY, aProofOfLock); + } + + if (!ret && out_failureId->IsEmpty()) { +@@ -326,12 +335,20 @@ Maybe GLLibraryEGL::GetSym + // - + + /* static */ +-RefPtr GLLibraryEGL::Create(nsACString* const out_failureId) { +- RefPtr ret = new GLLibraryEGL; +- if (!ret->Init(out_failureId)) { +- return nullptr; ++RefPtr GLLibraryEGL::Get(nsACString* const out_failureId) { ++ StaticMutexAutoLock lock(sMutex); ++ if (!sInstance) { ++ sInstance = new GLLibraryEGL; ++ if (NS_WARN_IF(!sInstance->Init(out_failureId))) { ++ sInstance = nullptr; ++ } + } +- return ret; ++ return sInstance; ++} ++ ++/* static */ void GLLibraryEGL::Shutdown() { ++ StaticMutexAutoLock lock(sMutex); ++ sInstance = nullptr; + } + + bool GLLibraryEGL::Init(nsACString* const out_failureId) { +@@ -640,9 +657,9 @@ static void MarkExtensions(const char* r + // - + + // static +-std::shared_ptr EglDisplay::Create(GLLibraryEGL& lib, +- const EGLDisplay display, +- const bool isWarp) { ++std::shared_ptr EglDisplay::Create( ++ GLLibraryEGL& lib, const EGLDisplay display, const bool isWarp, ++ const StaticMutexAutoLock& aProofOfLock) { + // Retrieve the EglDisplay if it already exists + { + const auto itr = lib.mActiveDisplays.find(display); +@@ -710,6 +727,7 @@ EglDisplay::EglDisplay(const PrivateUseO + } + + EglDisplay::~EglDisplay() { ++ StaticMutexAutoLock lock(GLLibraryEGL::sMutex); + fTerminate(); + mLib->mActiveDisplays.erase(mDisplay); + } +@@ -718,16 +736,24 @@ EglDisplay::~EglDisplay() { + + std::shared_ptr GLLibraryEGL::DefaultDisplay( + nsACString* const out_failureId) { ++ StaticMutexAutoLock lock(sMutex); + auto ret = mDefaultDisplay.lock(); + if (ret) return ret; + +- ret = CreateDisplay(false, out_failureId); ++ ret = CreateDisplayLocked(false, out_failureId, lock); + mDefaultDisplay = ret; + return ret; + } + + std::shared_ptr GLLibraryEGL::CreateDisplay( + const bool forceAccel, nsACString* const out_failureId) { ++ StaticMutexAutoLock lock(sMutex); ++ return CreateDisplayLocked(forceAccel, out_failureId, lock); ++} ++ ++std::shared_ptr GLLibraryEGL::CreateDisplayLocked( ++ const bool forceAccel, nsACString* const out_failureId, ++ const StaticMutexAutoLock& aProofOfLock) { + std::shared_ptr ret; + + if (IsExtensionSupported(EGLLibExtension::ANGLE_platform_angle_d3d)) { +@@ -747,7 +773,7 @@ std::shared_ptr GLLibraryEGL + + // Hardware accelerated ANGLE path (supported or force accel) + if (shouldTryAccel) { +- ret = GetAndInitDisplayForAccelANGLE(*this, out_failureId); ++ ret = GetAndInitDisplayForAccelANGLE(*this, out_failureId, aProofOfLock); + } + + // Report the acceleration status to telemetry +@@ -766,7 +792,7 @@ std::shared_ptr GLLibraryEGL + + // Fallback to a WARP display if ANGLE fails, or if WARP is forced + if (!ret && shouldTryWARP) { +- ret = GetAndInitWARPDisplay(*this, EGL_DEFAULT_DISPLAY); ++ ret = GetAndInitWARPDisplay(*this, EGL_DEFAULT_DISPLAY, aProofOfLock); + if (!ret) { + if (out_failureId->IsEmpty()) { + *out_failureId = "FEATURE_FAILURE_WARP_FALLBACK"_ns; +@@ -788,7 +814,7 @@ std::shared_ptr GLLibraryEGL + } + } + #endif +- ret = GetAndInitDisplay(*this, nativeDisplay); ++ ret = GetAndInitDisplay(*this, nativeDisplay, aProofOfLock); + } + + if (!ret) { +diff -up firefox-99.0/gfx/gl/GLLibraryEGL.h.D142257 firefox-99.0/gfx/gl/GLLibraryEGL.h +--- firefox-99.0/gfx/gl/GLLibraryEGL.h.D142257 2022-03-31 01:24:50.000000000 +0200 ++++ firefox-99.0/gfx/gl/GLLibraryEGL.h 2022-04-06 10:32:53.288145587 +0200 +@@ -13,6 +13,8 @@ + #include "mozilla/EnumTypeTraits.h" + #include "mozilla/Maybe.h" + #include "mozilla/RefPtr.h" ++#include "mozilla/StaticMutex.h" ++#include "mozilla/StaticPtr.h" + #include "nsISupports.h" + #include "prlink.h" + +@@ -125,14 +127,22 @@ class GLLibraryEGL final { + std::unordered_map> mActiveDisplays; + + public: +- static RefPtr Create(nsACString* const out_failureId); ++ static RefPtr Get(nsACString* const out_failureId); ++ static void Shutdown(); + + private: + ~GLLibraryEGL() = default; + ++ static StaticMutex sMutex; ++ static StaticRefPtr sInstance GUARDED_BY(sMutex); ++ + bool Init(nsACString* const out_failureId); + void InitLibExtensions(); + ++ std::shared_ptr CreateDisplayLocked( ++ bool forceAccel, nsACString* const out_failureId, ++ const StaticMutexAutoLock& aProofOfLock); ++ + public: + Maybe GetSymbolLoader() const; + +@@ -599,8 +609,9 @@ class EglDisplay final { + struct PrivateUseOnly final {}; + + public: +- static std::shared_ptr Create(GLLibraryEGL&, EGLDisplay, +- bool isWarp); ++ static std::shared_ptr Create( ++ GLLibraryEGL&, EGLDisplay, bool isWarp, ++ const StaticMutexAutoLock& aProofOfLock); + + // Only `public` for make_shared. + EglDisplay(const PrivateUseOnly&, GLLibraryEGL&, EGLDisplay, bool isWarp); +diff -up firefox-99.0/gfx/webrender_bindings/RenderThread.cpp.D142257 firefox-99.0/gfx/webrender_bindings/RenderThread.cpp +--- firefox-99.0/gfx/webrender_bindings/RenderThread.cpp.D142257 2022-03-31 01:24:51.000000000 +0200 ++++ firefox-99.0/gfx/webrender_bindings/RenderThread.cpp 2022-04-06 10:32:53.288145587 +0200 +@@ -1163,7 +1163,7 @@ static already_AddRefed C + } + + nsCString failureId; +- const auto lib = gl::DefaultEglLibrary(&failureId); ++ const auto lib = gl::GLLibraryEGL::Get(&failureId); + if (!lib) { + aError.Assign( + nsPrintfCString("RcANGLE(load EGL lib failed: %s)", failureId.get())); diff --git a/firefox-disable-ffvpx-with-vapi.patch b/firefox-disable-ffvpx-with-vapi.patch deleted file mode 100644 index 3ecdbed..0000000 --- a/firefox-disable-ffvpx-with-vapi.patch +++ /dev/null @@ -1,77 +0,0 @@ -diff -up firefox-88.0/dom/media/platforms/PDMFactory.cpp.ffvpx-with-vapi firefox-88.0/dom/media/platforms/PDMFactory.cpp ---- firefox-88.0/dom/media/platforms/PDMFactory.cpp.ffvpx-with-vapi 2021-04-15 21:44:28.000000000 +0200 -+++ firefox-88.0/dom/media/platforms/PDMFactory.cpp 2021-04-19 13:27:07.808429721 +0200 -@@ -481,12 +481,6 @@ void PDMFactory::CreateRddPDMs() { - CreateAndStartupPDM(); - } - #endif --#ifdef MOZ_FFVPX -- if (StaticPrefs::media_ffvpx_enabled() && -- StaticPrefs::media_rdd_ffvpx_enabled()) { -- CreateAndStartupPDM(); -- } --#endif - #ifdef MOZ_FFMPEG - if (StaticPrefs::media_ffmpeg_enabled() && - StaticPrefs::media_rdd_ffmpeg_enabled() && -@@ -495,6 +489,12 @@ void PDMFactory::CreateRddPDMs() { - FFmpegRuntimeLinker::LinkStatusCode()); - } - #endif -+#ifdef MOZ_FFVPX -+ if (StaticPrefs::media_ffvpx_enabled() && -+ StaticPrefs::media_rdd_ffvpx_enabled()) { -+ CreateAndStartupPDM(); -+ } -+#endif - CreateAndStartupPDM(); - } - -@@ -525,11 +525,6 @@ void PDMFactory::CreateContentPDMs() { - CreateAndStartupPDM(); - } - #endif --#ifdef MOZ_FFVPX -- if (StaticPrefs::media_ffvpx_enabled()) { -- CreateAndStartupPDM(); -- } --#endif - #ifdef MOZ_FFMPEG - if (StaticPrefs::media_ffmpeg_enabled() && - !CreateAndStartupPDM()) { -@@ -537,6 +532,11 @@ void PDMFactory::CreateContentPDMs() { - FFmpegRuntimeLinker::LinkStatusCode()); - } - #endif -+#ifdef MOZ_FFVPX -+ if (StaticPrefs::media_ffvpx_enabled()) { -+ CreateAndStartupPDM(); -+ } -+#endif - #ifdef MOZ_WIDGET_ANDROID - if (StaticPrefs::media_android_media_codec_enabled()) { - StartupPDM(AndroidDecoderModule::Create(), -@@ -571,11 +571,6 @@ void PDMFactory::CreateDefaultPDMs() { - CreateAndStartupPDM(); - } - #endif --#ifdef MOZ_FFVPX -- if (StaticPrefs::media_ffvpx_enabled()) { -- CreateAndStartupPDM(); -- } --#endif - #ifdef MOZ_FFMPEG - if (StaticPrefs::media_ffmpeg_enabled() && - !CreateAndStartupPDM()) { -@@ -583,6 +578,11 @@ void PDMFactory::CreateDefaultPDMs() { - FFmpegRuntimeLinker::LinkStatusCode()); - } - #endif -+#ifdef MOZ_FFVPX -+ if (StaticPrefs::media_ffvpx_enabled()) { -+ CreateAndStartupPDM(); -+ } -+#endif - #ifdef MOZ_WIDGET_ANDROID - if (StaticPrefs::media_android_media_codec_enabled()) { - StartupPDM(AndroidDecoderModule::Create(), diff --git a/firefox.spec b/firefox.spec index abb7a07..238bca8 100644 --- a/firefox.spec +++ b/firefox.spec @@ -126,7 +126,7 @@ ExcludeArch: aarch64 %if %{?system_nss} %global nspr_version 4.26 %global nspr_build_version %{nspr_version} -%global nss_version 3.74 +%global nss_version 3.76 %global nss_build_version %{nss_version} %endif @@ -162,7 +162,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox -Version: 98.0.2 +Version: 99.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ @@ -214,16 +214,8 @@ Patch49: build-arm-libaom.patch Patch53: firefox-gcc-build.patch Patch54: mozilla-1669639.patch Patch55: firefox-testing.patch -Patch57: firefox-disable-ffvpx-with-vapi.patch Patch61: firefox-glibc-dynstack.patch Patch62: build-python.patch -#Patch64: mozilla-1753402.patch -# GCC12 build fixes -Patch65: D139022.diff -Patch66: D139078.diff -Patch67: D139088.diff -Patch68: D139703.diff -Patch69: D139704.diff Patch70: crossbeam-downgrade-rhbz2063961.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch @@ -250,11 +242,7 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch -# ffmpeg50 -Patch500: D139696.diff -Patch501: D139697.diff -Patch502: D139698.diff -Patch503: D139699.diff +Patch416: D142257.diff # PGO/LTO patches Patch600: pgo.patch @@ -471,14 +459,6 @@ This package contains results of tests executed during build. %patch49 -p1 -b .build-arm-libaom %patch53 -p1 -b .firefox-gcc-build %patch54 -p1 -b .1669639 -#%patch55 -p1 -b .testing -%patch57 -p1 -b .ffvpx-with-vapi -#%patch64 -p1 -b .1753402 -%patch65 -p1 -b .D139022 -%patch66 -p1 -b .D139078 -%patch67 -p1 -b .D139088 -%patch68 -p1 -b .D139703 -%patch69 -p1 -b .D139704 %ifarch aarch64 %patch70 -p1 -b .crossbeam-downgrade-rhbz2063961 %endif @@ -505,14 +485,7 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 - -# ffmpeg50 -%ifnarch ppc64le -%patch500 -p1 -b .D139696 -%patch501 -p1 -b .D139697 -%patch502 -p1 -b .D139698 -%patch503 -p1 -b .D139699 -%endif +%patch416 -p1 -b .D142257 # PGO patches %if %{build_with_pgo} @@ -1079,6 +1052,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Wed Apr 6 2022 Martin Stransky - 99.0-1 +- Updated to 99.0 + * Thu Mar 31 2022 Martin Stransky - 98.0.2-1 - Updated to 98.0.2 diff --git a/mozilla-1670333.patch b/mozilla-1670333.patch index 19e64c0..1c5c476 100644 --- a/mozilla-1670333.patch +++ b/mozilla-1670333.patch @@ -1,6 +1,6 @@ -diff -up firefox-88.0/dom/media/mp4/MP4Demuxer.cpp.1670333 firefox-88.0/dom/media/mp4/MP4Demuxer.cpp ---- firefox-88.0/dom/media/mp4/MP4Demuxer.cpp.1670333 2021-04-15 21:44:28.000000000 +0200 -+++ firefox-88.0/dom/media/mp4/MP4Demuxer.cpp 2021-04-19 13:36:44.101762211 +0200 +diff -up firefox-99.0/dom/media/mp4/MP4Demuxer.cpp.1670333 firefox-99.0/dom/media/mp4/MP4Demuxer.cpp +--- firefox-99.0/dom/media/mp4/MP4Demuxer.cpp.1670333 2022-03-31 01:24:44.000000000 +0200 ++++ firefox-99.0/dom/media/mp4/MP4Demuxer.cpp 2022-04-04 09:58:35.606351546 +0200 @@ -31,6 +31,8 @@ mozilla::LogModule* GetDemuxerLog() { re DDMOZ_LOG(gMediaDemuxerLog, mozilla::LogLevel::Debug, "::%s: " arg, \ __func__, ##__VA_ARGS__) @@ -23,9 +23,9 @@ diff -up firefox-88.0/dom/media/mp4/MP4Demuxer.cpp.1670333 firefox-88.0/dom/medi if (sample->mKeyframe != keyframe) { NS_WARNING(nsPrintfCString("Frame incorrectly marked as %skeyframe " "@ pts:%" PRId64 " dur:%" PRId64 -diff -up firefox-88.0/dom/media/platforms/PDMFactory.cpp.1670333 firefox-88.0/dom/media/platforms/PDMFactory.cpp ---- firefox-88.0/dom/media/platforms/PDMFactory.cpp.1670333 2021-04-19 13:36:44.087761790 +0200 -+++ firefox-88.0/dom/media/platforms/PDMFactory.cpp 2021-04-19 13:39:52.676433734 +0200 +diff -up firefox-99.0/dom/media/platforms/PDMFactory.cpp.1670333 firefox-99.0/dom/media/platforms/PDMFactory.cpp +--- firefox-99.0/dom/media/platforms/PDMFactory.cpp.1670333 2022-03-31 01:24:44.000000000 +0200 ++++ firefox-99.0/dom/media/platforms/PDMFactory.cpp 2022-04-04 10:09:57.383419125 +0200 @@ -58,6 +58,8 @@ #include @@ -35,22 +35,16 @@ diff -up firefox-88.0/dom/media/platforms/PDMFactory.cpp.1670333 firefox-88.0/do namespace mozilla { #define PDM_INIT_LOG(msg, ...) \ -@@ -572,10 +574,10 @@ void PDMFactory::CreateDefaultPDMs() { - } - #endif +@@ -495,7 +497,7 @@ void PDMFactory::CreateRddPDMs() { #ifdef MOZ_FFMPEG -- if (StaticPrefs::media_ffmpeg_enabled() && + if (StaticPrefs::media_ffmpeg_enabled() && + StaticPrefs::media_rdd_ffmpeg_enabled() && - !CreateAndStartupPDM()) { -- mFailureFlags += GetFailureFlagBasedOnFFmpegStatus( -- FFmpegRuntimeLinker::LinkStatusCode()); -+ if (StaticPrefs::media_ffmpeg_enabled()) { -+ mFFmpegUsed = CreateAndStartupPDM(); -+ if (!mFFmpegUsed) { -+ mFailureFlags += GetFailureFlagBasedOnFFmpegStatus(FFmpegRuntimeLinker::LinkStatusCode()); } ++ !(mFFmpegUsed = CreateAndStartupPDM())) { + mFailureFlags += GetFailureFlagBasedOnFFmpegStatus( + FFmpegRuntimeLinker::LinkStatusCode()); } - #endif - #ifdef MOZ_FFVPX -@@ -592,8 +594,9 @@ void PDMFactory::CreateDefaultPDMs() { +@@ -602,8 +604,9 @@ void PDMFactory::CreateDefaultPDMs() { CreateAndStartupPDM(); @@ -61,9 +55,9 @@ diff -up firefox-88.0/dom/media/platforms/PDMFactory.cpp.1670333 firefox-88.0/do mFailureFlags += DecoderDoctorDiagnostics::Flags::GMPPDMFailedToStartup; } } -diff -up firefox-88.0/dom/media/platforms/PDMFactory.h.1670333 firefox-88.0/dom/media/platforms/PDMFactory.h ---- firefox-88.0/dom/media/platforms/PDMFactory.h.1670333 2021-04-15 21:44:28.000000000 +0200 -+++ firefox-88.0/dom/media/platforms/PDMFactory.h 2021-04-19 13:36:44.101762211 +0200 +diff -up firefox-99.0/dom/media/platforms/PDMFactory.h.1670333 firefox-99.0/dom/media/platforms/PDMFactory.h +--- firefox-99.0/dom/media/platforms/PDMFactory.h.1670333 2022-03-31 01:24:44.000000000 +0200 ++++ firefox-99.0/dom/media/platforms/PDMFactory.h 2022-04-04 09:58:35.606351546 +0200 @@ -121,6 +121,7 @@ class PDMFactory final { RefPtr mNullPDM; diff --git a/pgo.patch b/pgo.patch index e7e715b..eec103c 100644 --- a/pgo.patch +++ b/pgo.patch @@ -1,7 +1,7 @@ -diff -up firefox-96.0/build/moz.configure/lto-pgo.configure.pgo firefox-96.0/build/moz.configure/lto-pgo.configure ---- firefox-96.0/build/moz.configure/lto-pgo.configure.pgo 2022-01-06 19:32:35.000000000 +0100 -+++ firefox-96.0/build/moz.configure/lto-pgo.configure 2022-01-11 15:43:02.193378698 +0100 -@@ -248,8 +248,8 @@ def lto( +diff -up firefox-99.0/build/moz.configure/lto-pgo.configure.pgo firefox-99.0/build/moz.configure/lto-pgo.configure +--- firefox-99.0/build/moz.configure/lto-pgo.configure.pgo 2022-03-31 01:24:38.000000000 +0200 ++++ firefox-99.0/build/moz.configure/lto-pgo.configure 2022-04-04 10:15:45.387694143 +0200 +@@ -247,8 +247,8 @@ def lto( cflags.append("-flto") ldflags.append("-flto") else: @@ -12,7 +12,7 @@ diff -up firefox-96.0/build/moz.configure/lto-pgo.configure.pgo firefox-96.0/bui if target.os == "Android" and value == "cross": # Work around https://github.com/rust-lang/rust/issues/90088 -@@ -265,7 +265,7 @@ def lto( +@@ -264,7 +264,7 @@ def lto( if value == "full": cflags.append("-flto") else: @@ -21,9 +21,9 @@ diff -up firefox-96.0/build/moz.configure/lto-pgo.configure.pgo firefox-96.0/bui # With clang-cl, -flto can only be used with -c or -fuse-ld=lld. # AC_TRY_LINKs during configure don't have -c, so pass -fuse-ld=lld. cflags.append("-fuse-ld=lld") -diff -up firefox-96.0/build/pgo/profileserver.py.pgo firefox-96.0/build/pgo/profileserver.py ---- firefox-96.0/build/pgo/profileserver.py.pgo 2022-01-06 16:56:23.000000000 +0100 -+++ firefox-96.0/build/pgo/profileserver.py 2022-01-11 15:43:02.193378698 +0100 +diff -up firefox-99.0/build/pgo/profileserver.py.pgo firefox-99.0/build/pgo/profileserver.py +--- firefox-99.0/build/pgo/profileserver.py.pgo 2022-03-31 01:24:38.000000000 +0200 ++++ firefox-99.0/build/pgo/profileserver.py 2022-04-04 10:15:45.387694143 +0200 @@ -11,7 +11,7 @@ import glob import subprocess @@ -70,9 +70,9 @@ diff -up firefox-96.0/build/pgo/profileserver.py.pgo firefox-96.0/build/pgo/prof llvm_profdata = env.get("LLVM_PROFDATA") if llvm_profdata: profraw_files = glob.glob("*.profraw") -diff -up firefox-96.0/build/unix/mozconfig.unix.pgo firefox-96.0/build/unix/mozconfig.unix ---- firefox-96.0/build/unix/mozconfig.unix.pgo 2022-01-06 16:56:24.000000000 +0100 -+++ firefox-96.0/build/unix/mozconfig.unix 2022-01-11 15:43:02.193378698 +0100 +diff -up firefox-99.0/build/unix/mozconfig.unix.pgo firefox-99.0/build/unix/mozconfig.unix +--- firefox-99.0/build/unix/mozconfig.unix.pgo 2022-03-31 01:24:38.000000000 +0200 ++++ firefox-99.0/build/unix/mozconfig.unix 2022-04-04 10:15:45.387694143 +0200 @@ -4,6 +4,15 @@ if [ -n "$FORCE_GCC" ]; then CC="$MOZ_FETCHES_DIR/gcc/bin/gcc" CXX="$MOZ_FETCHES_DIR/gcc/bin/g++" @@ -89,18 +89,18 @@ diff -up firefox-96.0/build/unix/mozconfig.unix.pgo firefox-96.0/build/unix/mozc # We want to make sure we use binutils and other binaries in the tooltool # package. mk_add_options "export PATH=$MOZ_FETCHES_DIR/gcc/bin:$PATH" -diff -up firefox-96.0/extensions/spellcheck/src/moz.build.pgo firefox-96.0/extensions/spellcheck/src/moz.build ---- firefox-96.0/extensions/spellcheck/src/moz.build.pgo 2022-01-11 15:43:02.193378698 +0100 -+++ firefox-96.0/extensions/spellcheck/src/moz.build 2022-01-11 15:49:52.929362701 +0100 +diff -up firefox-99.0/extensions/spellcheck/src/moz.build.pgo firefox-99.0/extensions/spellcheck/src/moz.build +--- firefox-99.0/extensions/spellcheck/src/moz.build.pgo 2022-03-31 01:24:50.000000000 +0200 ++++ firefox-99.0/extensions/spellcheck/src/moz.build 2022-04-04 10:15:45.387694143 +0200 @@ -28,3 +28,5 @@ EXPORTS.mozilla += [ "mozInlineSpellChecker.h", "mozSpellChecker.h", ] + +CXXFLAGS += ['-fno-devirtualize'] -diff -up firefox-96.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-96.0/toolkit/components/terminator/nsTerminator.cpp ---- firefox-96.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2022-01-06 16:58:15.000000000 +0100 -+++ firefox-96.0/toolkit/components/terminator/nsTerminator.cpp 2022-01-11 15:43:02.193378698 +0100 +diff -up firefox-99.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-99.0/toolkit/components/terminator/nsTerminator.cpp +--- firefox-99.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2022-04-04 10:15:45.387694143 +0200 ++++ firefox-99.0/toolkit/components/terminator/nsTerminator.cpp 2022-04-04 10:19:07.022239556 +0200 @@ -466,6 +466,11 @@ void nsTerminator::StartWatchdog() { } #endif @@ -111,5 +111,5 @@ diff -up firefox-96.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox + crashAfterMS = INT32_MAX; + UniquePtr options(new Options()); - const PRIntervalTime ticksDuration = - PR_MillisecondsToInterval(HEARTBEAT_INTERVAL_MS); + // crashAfterTicks is guaranteed to be > 0 as + // crashAfterMS >= ADDITIONAL_WAIT_BEFORE_CRASH_MS >> HEARTBEAT_INTERVAL_MS diff --git a/sources b/sources index 67b7300..302967c 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = b9ab1498be90ecf60822df7021f8812f124550d97f8cd687c69d3ab56fc5fb714bfe88c78c978a1794d211724909a9a5cad6a4b483fa05f762909c45d5075520 SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (firefox-98.0.2.source.tar.xz) = b567b53fcdc08491063d535545f558ea56ec5be02ca540661de116986245b79f509e0103cea5661faf9f4b3d30b67758ebdb4b30401e260ee27cbb300203f36e -SHA512 (firefox-langpacks-98.0.2-20220331.tar.xz) = eba580d5dcef421f2a4e3be62a2fdf0788328cc065ae8019062e5d524f5d49b15709892e5846b9fa63148278983c8e627ad85d8a4656502c9f6543474bb94bc6 +SHA512 (firefox-99.0.source.tar.xz) = 08f6d5a668140c4275aba6df463ed3af596043dfe5f27573583afbc1e9f6b27ebca79a52ce2c9598261c631b400b5378744e9e70f51ef9c4098b419e9904aa7c +SHA512 (firefox-langpacks-99.0-20220331.tar.xz) = 9ab5d8989644da67cacfe729c13309ed4f42b654b9b9113bcdb7155b59fcb12fc816de8a3fdea709c9d91f2d5b168eebec5ada6f7637e111ea374adc9eb9c984 From c7aece478831dbb673b452b9a73c43f62a5efabc Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 6 Apr 2022 10:55:42 +0200 Subject: [PATCH 035/545] removed aarch64 unused patch --- crossbeam-downgrade-rhbz2063961.patch | 5110 ------------------------- firefox.spec | 4 - 2 files changed, 5114 deletions(-) delete mode 100644 crossbeam-downgrade-rhbz2063961.patch diff --git a/crossbeam-downgrade-rhbz2063961.patch b/crossbeam-downgrade-rhbz2063961.patch deleted file mode 100644 index 428c3ec..0000000 --- a/crossbeam-downgrade-rhbz2063961.patch +++ /dev/null @@ -1,5110 +0,0 @@ -diff -up firefox-98.0/Cargo.lock.crossbeam-downgrade-rhbz2063961 firefox-98.0/Cargo.lock ---- firefox-98.0/Cargo.lock.crossbeam-downgrade-rhbz2063961 2022-03-05 01:15:33.000000000 +0100 -+++ firefox-98.0/Cargo.lock 2022-03-16 09:35:09.020396771 +0100 -@@ -65,9 +65,9 @@ dependencies = [ - - [[package]] - name = "anyhow" --version = "1.0.52" -+version = "1.0.51" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "84450d0b4a8bd1ba4144ce8ce718fbc5d071358b1e5384bace6536b3d1f2d5b3" -+checksum = "8b26702f315f53b6071259e15dd9d64528213b44d61de1ec926eca7715d62203" - - [[package]] - name = "app_services_logger" -@@ -148,9 +148,9 @@ source = "git+https://github.com/smol-rs - - [[package]] - name = "async-trait" --version = "0.1.52" -+version = "0.1.51" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3" -+checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e" - dependencies = [ - "proc-macro2", - "quote", -@@ -443,9 +443,9 @@ dependencies = [ - - [[package]] - name = "bitreader" --version = "0.3.5" -+version = "0.3.4" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "bd5bf8a17cdc06d475689f9e9226f4b5bf5610e93cf5c3010a518fe6fb0d97f5" -+checksum = "9178181a7d44239c6c8eaafa8688558a2ab5fa04b8855381f2681e9591fb941b" - dependencies = [ - "cfg-if 1.0.0", - ] -@@ -482,7 +482,7 @@ version = "0.1.0" - dependencies = [ - "bits_client", - "comedy", -- "crossbeam-utils 0.8.6", -+ "crossbeam-utils 0.8.5", - "libc", - "log", - "moz_task", -@@ -493,9 +493,9 @@ dependencies = [ - - [[package]] - name = "blake2b_simd" --version = "0.5.11" -+version = "0.5.9" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" -+checksum = "b83b7baab1e671718d78204225800d6b170e648188ac7dc992e9d6bddf87d0c0" - dependencies = [ - "arrayref", - "arrayvec 0.5.2", -@@ -553,16 +553,16 @@ version = "0.1.2" - source = "registry+https://github.com/rust-lang/crates.io-index" - checksum = "b8e3ff9db740167616e528c509b3618046fc05d337f8f3182d300f4aa977d2bb" - dependencies = [ -- "crossbeam-utils 0.8.6", -+ "crossbeam-utils 0.8.5", - "jobserver", - "num_cpus", - ] - - [[package]] - name = "bumpalo" --version = "3.9.1" -+version = "3.8.0" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" -+checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" - - [[package]] - name = "byte-tools" -@@ -600,9 +600,9 @@ checksum = "c4872d67bab6358e59559027aa3b - - [[package]] - name = "cache-padded" --version = "1.2.0" -+version = "1.1.1" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" -+checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" - - [[package]] - name = "cascade_bloom_filter" -@@ -628,7 +628,7 @@ version = "0.0.1" - dependencies = [ - "base64 0.10.1", - "byteorder", -- "crossbeam-utils 0.8.6", -+ "crossbeam-utils 0.8.5", - "cstr", - "log", - "malloc_size_of_derive", -@@ -977,12 +977,12 @@ dependencies = [ - - [[package]] - name = "crossbeam-channel" --version = "0.5.2" -+version = "0.5.1" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" -+checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" - dependencies = [ - "cfg-if 1.0.0", -- "crossbeam-utils 0.8.6", -+ "crossbeam-utils 0.8.5", - ] - - [[package]] -@@ -1003,8 +1003,8 @@ source = "registry+https://github.com/ru - checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" - dependencies = [ - "cfg-if 1.0.0", -- "crossbeam-epoch 0.9.6", -- "crossbeam-utils 0.8.6", -+ "crossbeam-epoch 0.9.5", -+ "crossbeam-utils 0.8.5", - ] - - [[package]] -@@ -1024,12 +1024,12 @@ dependencies = [ - - [[package]] - name = "crossbeam-epoch" --version = "0.9.6" -+version = "0.9.5" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "97242a70df9b89a65d0b6df3c4bf5b9ce03c5b7309019777fbde37e7537f8762" -+checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" - dependencies = [ - "cfg-if 1.0.0", -- "crossbeam-utils 0.8.6", -+ "crossbeam-utils 0.8.5", - "lazy_static", - "memoffset 0.6.5", - "scopeguard", -@@ -1067,9 +1067,9 @@ dependencies = [ - - [[package]] - name = "crossbeam-utils" --version = "0.8.6" -+version = "0.8.5" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" -+checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" - dependencies = [ - "cfg-if 1.0.0", - "lazy_static", -@@ -2728,7 +2728,7 @@ name = "kvstore" - version = "0.1.0" - dependencies = [ - "atomic_refcell", -- "crossbeam-utils 0.8.6", -+ "crossbeam-utils 0.8.5", - "cstr", - "lazy_static", - "libc", -@@ -4216,7 +4216,7 @@ checksum = "d78120e2c850279833f1dd3582f7 - dependencies = [ - "crossbeam-channel", - "crossbeam-deque 0.8.1", -- "crossbeam-utils 0.8.6", -+ "crossbeam-utils 0.8.5", - "lazy_static", - "num_cpus", - ] -@@ -4400,7 +4400,7 @@ dependencies = [ - "base64 0.13.0", - "blake2b_simd", - "constant_time_eq", -- "crossbeam-utils 0.8.6", -+ "crossbeam-utils 0.8.5", - ] - - [[package]] -@@ -6020,7 +6020,7 @@ dependencies = [ - name = "xulstore" - version = "0.1.0" - dependencies = [ -- "crossbeam-utils 0.8.6", -+ "crossbeam-utils 0.8.5", - "cstr", - "libc", - "log", -diff -up firefox-98.0/third_party/rust/anyhow/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/anyhow/.cargo-checksum.json ---- firefox-98.0/third_party/rust/anyhow/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:40.000000000 +0100 -+++ firefox-98.0/third_party/rust/anyhow/.cargo-checksum.json 2022-03-16 09:33:31.989159760 +0100 -@@ -1 +1 @@ --{"files":{"Cargo.toml":"ce2fb7f23073f4f0bd58bae44baab86fa6c3d3595f32d28b410ec52394b3f64c","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"f6bffe3676b128afe14aaf91c972d69c37f2e5afe4e02b99a974f7b7393f4cda","build.rs":"b6ee548cb30aba0a4a7ff92379478fcf94ef246b892da8e2134ee2d9575bf08c","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/backtrace.rs":"5a60bd1fe1717c044c7ab34c062ce6651c0cb08596a5878e391c2755ecac07f9","src/chain.rs":"6edefc5f3c7d69683095862e54e3bb56faba5b3387bf2eeaed429da090007a0a","src/context.rs":"559478ae785ce913523aa21358cc1561ef4b0b95c5c87675a77890364c0162fe","src/ensure.rs":"98b2f4a7923e06cf6558b0a15f39a7c7ff3d36711e217475c6a93690cd58b7a1","src/error.rs":"33a0f6c49d2c5d08b8d027aa930be75ece822331d6e6b28db74520ea69587cbc","src/fmt.rs":"c2d4aad6ce20625a70a7c091e3087b6a2c19a4a87c7a12edb4c98978307245ea","src/kind.rs":"b21b15dbee77d50abe88684a9571b39659076465dd4b1956f366af8fdd26e95a","src/lib.rs":"330286a28b4d4da255db38bc267da17fb03f2333ea26684f82124973ffcaea43","src/macros.rs":"5a735a3fa919de58729be54976678c0a386e8e9af947987f17fd988c531974c7","src/ptr.rs":"f4e28bc9feba1e84160ca9d185008a51b5d72e168e6546f3e942f4258c361e19","src/wrapper.rs":"1229beca67dbd95ca77c9ecce282272acc55276c267c58cb73a75388b4693dda","tests/common/mod.rs":"f9088c2d7afafa64ff730b629272045b776bfafc2f5957508242da630635f2e1","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/drop/mod.rs":"08c3e553c1cc0d2dbd936fc45f4b5b1105057186affd6865e8d261e05f0f0646","tests/test_autotrait.rs":"981e792db353be2f14c7a1cabe43b5f1329c168cb7679077cc2be786a0920d48","tests/test_backtrace.rs":"0e50edbb33b6bd07ba89ff3db72fb7c688ba2a4371fccdbbb20309ab02948b6a","tests/test_boxed.rs":"6b26db0e2eb72afe9af7352ea820837aab90f8d486294616dd5dc34c1b94038c","tests/test_chain.rs":"d5e90e3eba58abc60d241d3aade39e0b8d4006d9a14f3cf015d3d925160b5812","tests/test_context.rs":"8409c53b328562c11e822bd6c3cd17e0d4d50b9bbb8fc3617333fd77303a6a33","tests/test_convert.rs":"7e7a8b4772a427a911014ac4d1083f9519000e786177f898808980dd9bdfde61","tests/test_downcast.rs":"ce8438cb58a1b7f3599740c261f6ef05855127ccde20c83c82db15eaf51c57ad","tests/test_ensure.rs":"f8bc5174219da947e6292891864f35307d5c400fd5690f51d574edaa5e39b8a4","tests/test_ffi.rs":"d0cb4c1d6d9154090982dee72ae3ebe05a5981f976058c3250f1c9da5a45edef","tests/test_fmt.rs":"17572596f257aac9aa2ec4620e292ca6a954128b94772bb948399fab53832e70","tests/test_macros.rs":"3f808b3050fc2b18c5b9058fe71b6b464d70e3658ff9b1daa379cd58c6874296","tests/test_repr.rs":"dbb9b04ddbe1ab31eb5331ea69f05bb3a147299da2275a3d4dcc92947b5591b9","tests/test_source.rs":"b80723cf635a4f8c4df21891b34bfab9ed2b2aa407e7a2f826d24e334cd5f88e","tests/ui/chained-comparison.rs":"6504b03d95b5acc232a7f4defc9f343b2be6733bf475fa0992e8e6545b912bd4","tests/ui/chained-comparison.stderr":"7f1d0a8c251b0ede2d30b3087ec157fc660945c97a642c4a5acf5a14ec58de34","tests/ui/empty-ensure.rs":"ab5bf37c846a0d689f26ce9257a27228411ed64154f9c950f1602d88a355d94b","tests/ui/empty-ensure.stderr":"0fa39de3edadb86382d8cd147c2640771e080338be2f4b067650258e3150f181","tests/ui/no-impl.rs":"fab6cbf2f6ea510b86f567dfb3b7c31250a9fd71ae5d110dbb9188be569ec593","tests/ui/no-impl.stderr":"9d2d9cdf441f1c4a0ccbc4a7433013166425b98cd8dd8738381e8fd070c1aed9","tests/ui/temporary-value.rs":"4dcc96271b2403e6372cf4cfc813445e5ce4365fc6e156b6bc38274098499a70","tests/ui/temporary-value.stderr":"64e448b6759cf51d41b1360307a638452bbe53ffa706f93e4a503b712d7b89a8","tests/ui/wrong-interpolation.rs":"9c44d4674c2dccd27b9dedd03341346ec02d993b41793ee89b5755202e7e367e","tests/ui/wrong-interpolation.stderr":"301e60e2eb9401782c7dc0b3580613a4cb2aafd4cc8065734a630a62e1161aa5"},"package":"84450d0b4a8bd1ba4144ce8ce718fbc5d071358b1e5384bace6536b3d1f2d5b3"} -\ No newline at end of file -+{"files":{"Cargo.toml":"5e3414ce23940106f95102f85e643cb5bed5e8ed9027557963c728d5f46d5586","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"f6bffe3676b128afe14aaf91c972d69c37f2e5afe4e02b99a974f7b7393f4cda","build.rs":"b6ee548cb30aba0a4a7ff92379478fcf94ef246b892da8e2134ee2d9575bf08c","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/backtrace.rs":"a1a52f9874f0aa1382fb404f029c6fa88e53afe38fb2417877d5711f1f2b90c9","src/chain.rs":"6edefc5f3c7d69683095862e54e3bb56faba5b3387bf2eeaed429da090007a0a","src/context.rs":"559478ae785ce913523aa21358cc1561ef4b0b95c5c87675a77890364c0162fe","src/ensure.rs":"98b2f4a7923e06cf6558b0a15f39a7c7ff3d36711e217475c6a93690cd58b7a1","src/error.rs":"33a0f6c49d2c5d08b8d027aa930be75ece822331d6e6b28db74520ea69587cbc","src/fmt.rs":"c2d4aad6ce20625a70a7c091e3087b6a2c19a4a87c7a12edb4c98978307245ea","src/kind.rs":"b21b15dbee77d50abe88684a9571b39659076465dd4b1956f366af8fdd26e95a","src/lib.rs":"f39d4684ce6ce473b585d2f9bc8b7a355cf28e5b5c936431d8072ac5c4fe94fd","src/macros.rs":"5a735a3fa919de58729be54976678c0a386e8e9af947987f17fd988c531974c7","src/ptr.rs":"f4e28bc9feba1e84160ca9d185008a51b5d72e168e6546f3e942f4258c361e19","src/wrapper.rs":"1229beca67dbd95ca77c9ecce282272acc55276c267c58cb73a75388b4693dda","tests/common/mod.rs":"f9088c2d7afafa64ff730b629272045b776bfafc2f5957508242da630635f2e1","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/drop/mod.rs":"382956f4bd3dcd1f6036efb8f11193595a7c60e0a5dbf5f2da149f1f25183abf","tests/test_autotrait.rs":"981e792db353be2f14c7a1cabe43b5f1329c168cb7679077cc2be786a0920d48","tests/test_backtrace.rs":"0e50edbb33b6bd07ba89ff3db72fb7c688ba2a4371fccdbbb20309ab02948b6a","tests/test_boxed.rs":"6b26db0e2eb72afe9af7352ea820837aab90f8d486294616dd5dc34c1b94038c","tests/test_chain.rs":"d5e90e3eba58abc60d241d3aade39e0b8d4006d9a14f3cf015d3d925160b5812","tests/test_context.rs":"8409c53b328562c11e822bd6c3cd17e0d4d50b9bbb8fc3617333fd77303a6a33","tests/test_convert.rs":"7e7a8b4772a427a911014ac4d1083f9519000e786177f898808980dd9bdfde61","tests/test_downcast.rs":"ce8438cb58a1b7f3599740c261f6ef05855127ccde20c83c82db15eaf51c57ad","tests/test_ensure.rs":"45331ef18c4c69acf4b80f5f55d2cefb55cc82f00e854b81d54c3df36a639003","tests/test_ffi.rs":"d0cb4c1d6d9154090982dee72ae3ebe05a5981f976058c3250f1c9da5a45edef","tests/test_fmt.rs":"17572596f257aac9aa2ec4620e292ca6a954128b94772bb948399fab53832e70","tests/test_macros.rs":"3f808b3050fc2b18c5b9058fe71b6b464d70e3658ff9b1daa379cd58c6874296","tests/test_repr.rs":"dbb9b04ddbe1ab31eb5331ea69f05bb3a147299da2275a3d4dcc92947b5591b9","tests/test_source.rs":"b80723cf635a4f8c4df21891b34bfab9ed2b2aa407e7a2f826d24e334cd5f88e","tests/ui/chained-comparison.rs":"6504b03d95b5acc232a7f4defc9f343b2be6733bf475fa0992e8e6545b912bd4","tests/ui/chained-comparison.stderr":"7f1d0a8c251b0ede2d30b3087ec157fc660945c97a642c4a5acf5a14ec58de34","tests/ui/empty-ensure.rs":"ab5bf37c846a0d689f26ce9257a27228411ed64154f9c950f1602d88a355d94b","tests/ui/empty-ensure.stderr":"0fa39de3edadb86382d8cd147c2640771e080338be2f4b067650258e3150f181","tests/ui/no-impl.rs":"fab6cbf2f6ea510b86f567dfb3b7c31250a9fd71ae5d110dbb9188be569ec593","tests/ui/no-impl.stderr":"9d2d9cdf441f1c4a0ccbc4a7433013166425b98cd8dd8738381e8fd070c1aed9","tests/ui/temporary-value.rs":"4dcc96271b2403e6372cf4cfc813445e5ce4365fc6e156b6bc38274098499a70","tests/ui/temporary-value.stderr":"64e448b6759cf51d41b1360307a638452bbe53ffa706f93e4a503b712d7b89a8","tests/ui/wrong-interpolation.rs":"9c44d4674c2dccd27b9dedd03341346ec02d993b41793ee89b5755202e7e367e","tests/ui/wrong-interpolation.stderr":"301e60e2eb9401782c7dc0b3580613a4cb2aafd4cc8065734a630a62e1161aa5"},"package":"8b26702f315f53b6071259e15dd9d64528213b44d61de1ec926eca7715d62203"} -\ No newline at end of file -diff -up firefox-98.0/third_party/rust/anyhow/Cargo.toml.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/anyhow/Cargo.toml ---- firefox-98.0/third_party/rust/anyhow/Cargo.toml.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/anyhow/Cargo.toml 2022-03-16 09:33:31.989159760 +0100 -@@ -13,7 +13,7 @@ - edition = "2018" - rust-version = "1.38" - name = "anyhow" --version = "1.0.52" -+version = "1.0.51" - authors = ["David Tolnay "] - description = "Flexible concrete Error type built on std::error::Error" - documentation = "https://docs.rs/anyhow" -@@ -32,7 +32,7 @@ version = "0.3" - default-features = false - - [dev-dependencies.rustversion] --version = "1.0.6" -+version = "1.0" - - [dev-dependencies.syn] - version = "1.0" -diff -up firefox-98.0/third_party/rust/anyhow/src/backtrace.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/anyhow/src/backtrace.rs ---- firefox-98.0/third_party/rust/anyhow/src/backtrace.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/anyhow/src/backtrace.rs 2022-03-16 09:33:31.989159760 +0100 -@@ -182,7 +182,7 @@ mod capture { - impl Backtrace { - fn enabled() -> bool { - static ENABLED: AtomicUsize = AtomicUsize::new(0); -- match ENABLED.load(Ordering::Relaxed) { -+ match ENABLED.load(Ordering::SeqCst) { - 0 => {} - 1 => return false, - _ => return true, -@@ -194,7 +194,7 @@ mod capture { - None => false, - }, - }; -- ENABLED.store(enabled as usize + 1, Ordering::Relaxed); -+ ENABLED.store(enabled as usize + 1, Ordering::SeqCst); - enabled - } - -diff -up firefox-98.0/third_party/rust/anyhow/src/lib.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/anyhow/src/lib.rs ---- firefox-98.0/third_party/rust/anyhow/src/lib.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/anyhow/src/lib.rs 2022-03-16 09:33:31.989159760 +0100 -@@ -210,7 +210,7 @@ - //! will require an explicit `.map_err(Error::msg)` when working with a - //! non-Anyhow error type inside a function that returns Anyhow's error type. - --#![doc(html_root_url = "https://docs.rs/anyhow/1.0.52")] -+#![doc(html_root_url = "https://docs.rs/anyhow/1.0.51")] - #![cfg_attr(backtrace, feature(backtrace))] - #![cfg_attr(doc_cfg, feature(doc_cfg))] - #![cfg_attr(not(feature = "std"), no_std)] -@@ -225,7 +225,6 @@ - clippy::needless_doctest_main, - clippy::new_ret_no_self, - clippy::redundant_else, -- clippy::return_self_not_must_use, - clippy::unused_self, - clippy::used_underscore_binding, - clippy::wildcard_imports, -diff -up firefox-98.0/third_party/rust/anyhow/tests/drop/mod.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/anyhow/tests/drop/mod.rs ---- firefox-98.0/third_party/rust/anyhow/tests/drop/mod.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/anyhow/tests/drop/mod.rs 2022-03-16 09:33:31.989159760 +0100 -@@ -2,7 +2,8 @@ - - use std::error::Error as StdError; - use std::fmt::{self, Display}; --use std::sync::atomic::{AtomicBool, Ordering}; -+use std::sync::atomic::AtomicBool; -+use std::sync::atomic::Ordering::SeqCst; - use std::sync::Arc; - - #[derive(Debug)] -@@ -18,7 +19,7 @@ impl Flag { - } - - pub fn get(&self) -> bool { -- self.atomic.load(Ordering::Relaxed) -+ self.atomic.load(SeqCst) - } - } - -@@ -47,7 +48,7 @@ impl Display for DetectDrop { - - impl Drop for DetectDrop { - fn drop(&mut self) { -- let already_dropped = self.has_dropped.atomic.swap(true, Ordering::Relaxed); -+ let already_dropped = self.has_dropped.atomic.swap(true, SeqCst); - assert!(!already_dropped); - } - } -diff -up firefox-98.0/third_party/rust/anyhow/tests/test_ensure.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/anyhow/tests/test_ensure.rs ---- firefox-98.0/third_party/rust/anyhow/tests/test_ensure.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/anyhow/tests/test_ensure.rs 2022-03-16 09:33:31.990159794 +0100 -@@ -5,7 +5,6 @@ - clippy::items_after_statements, - clippy::let_and_return, - clippy::let_underscore_drop, -- clippy::logic_bug, - clippy::match_bool, - clippy::never_loop, - clippy::redundant_closure_call, -@@ -46,15 +45,13 @@ impl Trait for T {} - fn assert_err(result: impl FnOnce() -> Result, expected: &'static str) { - let actual = result().unwrap_err().to_string(); - -- // In general different rustc versions will format the interpolated lhs and -- // rhs $:expr fragment with insignificant differences in whitespace or -- // punctuation, so we check the message in full against nightly and do just -- // a cursory test on older toolchains. -- if rustversion::cfg!(nightly) && !cfg!(miri) { -- assert_eq!(actual, expected); -- } else { -- assert_eq!(actual.contains(" vs "), expected.contains(" vs ")); -+ let mut accepted_alternatives = expected.split('\n'); -+ let expected = accepted_alternatives.next_back().unwrap(); -+ if accepted_alternatives.any(|alternative| actual == alternative) { -+ return; - } -+ -+ assert_eq!(actual, expected); - } - - #[test] -@@ -101,7 +98,7 @@ fn test_low_precedence_binary_operator() - let test = || Ok(ensure!(while false == true && false {} < ())); - assert_err( - test, -- "Condition failed: `while false == true && false {} < ()` (() vs ())", -+ "Condition failed: `while false == true && false { } < ()` (() vs ())", - ); - } - -@@ -148,41 +145,41 @@ fn test_unary() { - fn test_if() { - #[rustfmt::skip] - let test = || Ok(ensure!(if false {}.t(1) == 2)); -- assert_err(test, "Condition failed: `if false {}.t(1) == 2` (1 vs 2)"); -+ assert_err(test, "Condition failed: `if false { }.t(1) == 2` (1 vs 2)"); - - #[rustfmt::skip] - let test = || Ok(ensure!(if false {} else {}.t(1) == 2)); - assert_err( - test, -- "Condition failed: `if false {} else {}.t(1) == 2` (1 vs 2)", -+ "Condition failed: `if false { } else { }.t(1) == 2` (1 vs 2)", - ); - - #[rustfmt::skip] - let test = || Ok(ensure!(if false {} else if false {}.t(1) == 2)); - assert_err( - test, -- "Condition failed: `if false {} else if false {}.t(1) == 2` (1 vs 2)", -+ "Condition failed: `if false { } else if false { }.t(1) == 2` (1 vs 2)", - ); - - #[rustfmt::skip] - let test = || Ok(ensure!(if let 1 = 2 {}.t(1) == 2)); - assert_err( - test, -- "Condition failed: `if let 1 = 2 {}.t(1) == 2` (1 vs 2)", -+ "Condition failed: `if let 1 = 2 { }.t(1) == 2` (1 vs 2)", - ); - - #[rustfmt::skip] - let test = || Ok(ensure!(if let 1 | 2 = 2 {}.t(1) == 2)); - assert_err( - test, -- "Condition failed: `if let 1 | 2 = 2 {}.t(1) == 2` (1 vs 2)", -+ "Condition failed: `if let 1 | 2 = 2 { }.t(1) == 2` (1 vs 2)", - ); - - #[rustfmt::skip] - let test = || Ok(ensure!(if let | 1 | 2 = 2 {}.t(1) == 2)); - assert_err( - test, -- "Condition failed: `if let 1 | 2 = 2 {}.t(1) == 2` (1 vs 2)", -+ "Condition failed: `if let 1 | 2 = 2 { }.t(1) == 2` (1 vs 2)", - ); - } - -@@ -192,49 +189,53 @@ fn test_loop() { - let test = || Ok(ensure!(1 + loop { break 1 } == 1)); - assert_err( - test, -- "Condition failed: `1 + loop { break 1 } == 1` (2 vs 1)", -+ // 1.54 puts a double space after loop -+ "Condition failed: `1 + loop { break 1 } == 1` (2 vs 1)\n\ -+ Condition failed: `1 + loop { break 1 } == 1` (2 vs 1)", - ); - - #[rustfmt::skip] - let test = || Ok(ensure!(1 + 'a: loop { break 'a 1 } == 1)); - assert_err( - test, -- "Condition failed: `1 + 'a: loop { break 'a 1 } == 1` (2 vs 1)", -+ // 1.54 puts a double space after loop -+ "Condition failed: `1 + 'a: loop { break 'a 1 } == 1` (2 vs 1)\n\ -+ Condition failed: `1 + 'a: loop { break 'a 1 } == 1` (2 vs 1)", - ); - - #[rustfmt::skip] - let test = || Ok(ensure!(while false {}.t(1) == 2)); - assert_err( - test, -- "Condition failed: `while false {}.t(1) == 2` (1 vs 2)", -+ "Condition failed: `while false { }.t(1) == 2` (1 vs 2)", - ); - - #[rustfmt::skip] - let test = || Ok(ensure!(while let None = Some(1) {}.t(1) == 2)); - assert_err( - test, -- "Condition failed: `while let None = Some(1) {}.t(1) == 2` (1 vs 2)", -+ "Condition failed: `while let None = Some(1) { }.t(1) == 2` (1 vs 2)", - ); - - #[rustfmt::skip] - let test = || Ok(ensure!(for _x in iter::once(0) {}.t(1) == 2)); - assert_err( - test, -- "Condition failed: `for _x in iter::once(0) {}.t(1) == 2` (1 vs 2)", -+ "Condition failed: `for _x in iter::once(0) { }.t(1) == 2` (1 vs 2)", - ); - - #[rustfmt::skip] - let test = || Ok(ensure!(for | _x in iter::once(0) {}.t(1) == 2)); - assert_err( - test, -- "Condition failed: `for _x in iter::once(0) {}.t(1) == 2` (1 vs 2)", -+ "Condition failed: `for _x in iter::once(0) { }.t(1) == 2` (1 vs 2)", - ); - - #[rustfmt::skip] - let test = || Ok(ensure!(for true | false in iter::empty() {}.t(1) == 2)); - assert_err( - test, -- "Condition failed: `for true | false in iter::empty() {}.t(1) == 2` (1 vs 2)", -+ "Condition failed: `for true | false in iter::empty() { }.t(1) == 2` (1 vs 2)", - ); - } - -@@ -263,13 +264,13 @@ fn test_atom() { - let test = || Ok(ensure!(S + async { 1 } == true)); - assert_err( - test, -- "Condition failed: `S + async { 1 } == true` (false vs true)", -+ "Condition failed: `S + async { 1 } == true` (false vs true)", - ); - - let test = || Ok(ensure!(S + async move { 1 } == true)); - assert_err( - test, -- "Condition failed: `S + async move { 1 } == true` (false vs true)", -+ "Condition failed: `S + async move { 1 } == true` (false vs true)", - ); - - let x = &1; -@@ -380,7 +381,7 @@ fn test_macro() { - let test = || Ok(ensure!(stringify! {} != "")); - assert_err( - test, -- "Condition failed: `stringify! {} != \"\"` (\"\" vs \"\")", -+ "Condition failed: `stringify! { } != \"\"` (\"\" vs \"\")", - ); - } - -@@ -528,7 +529,7 @@ fn test_as() { - let test = || Ok(ensure!(f as for<'a> fn() as usize * 0 != 0)); - assert_err( - test, -- "Condition failed: `f as for<'a>fn() as usize * 0 != 0` (0 vs 0)", // FIXME -+ "Condition failed: `f as for<'a>fn() as usize * 0 != 0` (0 vs 0)", - ); - - let test = || Ok(ensure!(f as unsafe fn() as usize * 0 != 0)); -@@ -613,7 +614,7 @@ fn test_pat() { - let test = || Ok(ensure!(if let -1..=1 = 0 { 0 } else { 1 } == 1)); - assert_err( - test, -- "Condition failed: `if let -1 ..=1 = 0 { 0 } else { 1 } == 1` (0 vs 1)", // FIXME -+ "Condition failed: `if let -1 ..=1 = 0 { 0 } else { 1 } == 1` (0 vs 1)", - ); - - let test = || Ok(ensure!(if let &0 = &0 { 0 } else { 1 } == 1)); -@@ -656,13 +657,13 @@ fn test_pat() { - let test = || Ok(ensure!(if let P:: {} = p { 0 } else { 1 } == 1)); - assert_err( - test, -- "Condition failed: `if let P:: { } = p { 0 } else { 1 } == 1` (0 vs 1)", // FIXME -+ "Condition failed: `if let P:: { } = p { 0 } else { 1 } == 1` (0 vs 1)", - ); - - let test = || Ok(ensure!(if let ::std::marker::PhantomData = p {} != ())); - assert_err( - test, -- "Condition failed: `if let ::std::marker::PhantomData = p {} != ()` (() vs ())", -+ "Condition failed: `if let ::std::marker::PhantomData = p { } != ()` (() vs ())", - ); - - let test = || Ok(ensure!(if let ::V = 0 { 0 } else { 1 } == 1)); -@@ -674,7 +675,7 @@ fn test_pat() { - let test = || Ok(ensure!(for _ in iter::once(()) {} != ())); - assert_err( - test, -- "Condition failed: `for _ in iter::once(()) {} != ()` (() vs ())", -+ "Condition failed: `for _ in iter::once(()) { } != ()` (() vs ())", - ); - - let test = || Ok(ensure!(if let stringify!(x) = "x" { 0 } else { 1 } == 1)); -diff -up firefox-98.0/third_party/rust/async-trait/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/.cargo-checksum.json ---- firefox-98.0/third_party/rust/async-trait/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/async-trait/.cargo-checksum.json 2022-03-16 09:33:31.990159794 +0100 -@@ -1 +1 @@ --{"files":{"Cargo.toml":"9168c83306a2940b86790578d9d72c23d70bad572bf67ad3def2c8265bd0c270","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"b733a7cddbdc409fcd5fb8eff5fe1d5692b6d1e0364568366a69bb1dd68e232c","build.rs":"e2ca6b6c6f18d5d47cb662083856d1399946bc41a272b30231c31ae8317a3ed0","src/args.rs":"6eed5497db91752b3aae597943c39e769f60406b37055304e69e4699f1f87b15","src/expand.rs":"f1002235c33fc292e6784937c2c64d6e7ba105147b9a82126c830d09b86c1059","src/lib.rs":"51cd49b85c0a7662ef32f30631f1f6a2ce448f18e951725b9d13227b5a596d3e","src/lifetime.rs":"4b94740e2847ef8df128a25d264f0a1bc1d1723ea107fc53849322b98f1e6927","src/parse.rs":"cd9032fe2c6dcf41050b3a59b9fb98eb9700a29bbe2fa011ee2854014c1666b7","src/receiver.rs":"31f5ff929bb6ac061ca3f44d4efac1ca0c60273d54ef8f8f92234a69829dc88d","tests/compiletest.rs":"0a52a44786aea1c299c695bf948b2ed2081e4cc344e5c2cadceab4eb03d0010d","tests/executor/mod.rs":"3cf48614288715f625514a73ae642f649c2635a402a3ad90278bbee116a7234c","tests/test.rs":"df12d6551ce0a8e3416f83fe92686ab2a22fb0a5dadb45499f531c8822c63c3e","tests/ui/bare-trait-object.rs":"4546e8bd6682de11920fa4c768295fed61954484ef0550dfadbc5677b77f29a5","tests/ui/bare-trait-object.stderr":"1df5569f4615620172affeaa86da629623f32a0bb15f790a10c0837bd9da27e6","tests/ui/delimiter-span.rs":"97edf38c804d5e0d4cef6f040dee113d78ff76b08bf8c49586b803caa3ce7f40","tests/ui/delimiter-span.stderr":"0f70f0bda0e86a43e6d6f6980f1ef8a1989c3e32db593bd60f920025a25728d5","tests/ui/lifetime-span.rs":"263de0b98abd0772fe9dc73ced1a71a3b85efb90d2b208226fe35ab9378c5e5a","tests/ui/lifetime-span.stderr":"21ce55872b2a6d57077ada797a5c3ae78a3d218570605a7509951b45afa212b3","tests/ui/missing-async-in-impl.rs":"5a5538d08d11c145211a92af0d8973eee8b21f33b90adda85430805bd3dbbc83","tests/ui/missing-async-in-impl.stderr":"2916bc8a51e25f4dd18eaf433b916d533943eac2c1afbee64e9a89e7b928040d","tests/ui/missing-async-in-trait.rs":"dc67241593f270233ba885df92e59164126416e68d49d8d62edc251666b5db6e","tests/ui/missing-async-in-trait.stderr":"67e66e7b19358830deff3ba01f5d701a9ae05c4e6fa9c081c49c1c75efbb7ade","tests/ui/missing-body.rs":"d06c0da8c6044e7c790b924136f167e2edc0d0d3fa01f23521f3f08ca605929b","tests/ui/missing-body.stderr":"e5ee994398bf8294324d61df02467a4229f68f4113bf5acc004851c03d66ec6a","tests/ui/must-use.rs":"75090c7df984df0996464337f60371d198bd0caf3f9f44b10d1e131f15fd4fca","tests/ui/must-use.stderr":"cd7bf2fe9023021837b2b3e8cc164ffc18900b01cf704c68cde91edd07d65dc8","tests/ui/self-span.rs":"67ddde05907d7014bfb3f2c63d427b1d72d6c4369a9108a4335dac6bee5832b2","tests/ui/self-span.stderr":"7865153d1e41ecdfa64b197901e3bda57bcda0c486bbcf11dc6e9837ceb40b29","tests/ui/send-not-implemented.rs":"affbbe8bc9c3501d3db3a024e06daa9d076f1d142dba290c7aa1ea119daebd19","tests/ui/send-not-implemented.stderr":"01e6800bcabca87306c72269e38d1eac53ef1e8ad9951a9be052b97aff16364d","tests/ui/unreachable.rs":"be0aa7cc129fe42a1fbd85e36b3f08c6a2bd16c90ed2e33fc4c50e40ce085bcd","tests/ui/unreachable.stderr":"73beb71cb74076f2cb45485271de31658cf59f4143e62daa34b9f2a8980ddfcd","tests/ui/unsupported-self.rs":"f7855bc39dab1fd2f533fb2e873a27c3757dcb9fb57001e4b19f58d3dda36d01","tests/ui/unsupported-self.stderr":"64fc5d45cb51330f0a1e85e69a28b69ddda12a109aa6a8ba3eaee1ac58d93b5f"},"package":"061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3"} -\ No newline at end of file -+{"files":{"Cargo.toml":"fda2e0dc95a93f95edaa7dfdf9b7323593214c1b9e165789cd8b8e6057349ecb","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"b733a7cddbdc409fcd5fb8eff5fe1d5692b6d1e0364568366a69bb1dd68e232c","build.rs":"e2ca6b6c6f18d5d47cb662083856d1399946bc41a272b30231c31ae8317a3ed0","src/args.rs":"6eed5497db91752b3aae597943c39e769f60406b37055304e69e4699f1f87b15","src/expand.rs":"231d1e732f295949939583df7169f49f950317679e7415ee6b5d38b8414f8b7b","src/lib.rs":"51cd49b85c0a7662ef32f30631f1f6a2ce448f18e951725b9d13227b5a596d3e","src/lifetime.rs":"4b94740e2847ef8df128a25d264f0a1bc1d1723ea107fc53849322b98f1e6927","src/parse.rs":"cd9032fe2c6dcf41050b3a59b9fb98eb9700a29bbe2fa011ee2854014c1666b7","src/receiver.rs":"31f5ff929bb6ac061ca3f44d4efac1ca0c60273d54ef8f8f92234a69829dc88d","tests/compiletest.rs":"0a52a44786aea1c299c695bf948b2ed2081e4cc344e5c2cadceab4eb03d0010d","tests/executor/mod.rs":"3cf48614288715f625514a73ae642f649c2635a402a3ad90278bbee116a7234c","tests/test.rs":"8a60ea2181287bfd42bcc73df1d157398f202f60991ec91eb906029e3a1ae88b","tests/ui/bare-trait-object.rs":"4546e8bd6682de11920fa4c768295fed61954484ef0550dfadbc5677b77f29a5","tests/ui/bare-trait-object.stderr":"fd6f80e2cae790f6370c537eaabedb17e9ff06c2b1f056d3d7071ed7f021f831","tests/ui/delimiter-span.rs":"97edf38c804d5e0d4cef6f040dee113d78ff76b08bf8c49586b803caa3ce7f40","tests/ui/delimiter-span.stderr":"f3c32ae57ead984ac985641bd07f50a894b572d6b8b8269556cf606f34d05101","tests/ui/lifetime-span.rs":"263de0b98abd0772fe9dc73ced1a71a3b85efb90d2b208226fe35ab9378c5e5a","tests/ui/lifetime-span.stderr":"1e1cbcbbfded1da0a252666f2077d806d11e16fccea825c7d58805c1d88a9d58","tests/ui/missing-body.rs":"d06c0da8c6044e7c790b924136f167e2edc0d0d3fa01f23521f3f08ca605929b","tests/ui/missing-body.stderr":"636a03cc42933b59d73032ce6cea862e33c16efb9c7fe7f27749247998bc9f23","tests/ui/must-use.rs":"75090c7df984df0996464337f60371d198bd0caf3f9f44b10d1e131f15fd4fca","tests/ui/must-use.stderr":"e6cb190e02f0226df6444065aaca3051f7db8ae599bba18a685155c52bb799b6","tests/ui/self-span.rs":"67ddde05907d7014bfb3f2c63d427b1d72d6c4369a9108a4335dac6bee5832b2","tests/ui/self-span.stderr":"590ba1db336f57133b66b83a576afa6f96f2201147b9c90eea4bdc84b966b19c","tests/ui/send-not-implemented.rs":"affbbe8bc9c3501d3db3a024e06daa9d076f1d142dba290c7aa1ea119daebd19","tests/ui/send-not-implemented.stderr":"63ed733b35b71f29ff0e863d287049e831dd0923978d16f5679ebd4d9d1c6d69","tests/ui/unreachable.rs":"7905c3fd0115753d18d64e12c39f42f3abec7a41b02572ea009c7d93f6d7751d","tests/ui/unreachable.stderr":"1fe3a63e44a99c62c489e1994176f03c2218bf382439bc20f1f12d368fe1558a","tests/ui/unsupported-self.rs":"f7855bc39dab1fd2f533fb2e873a27c3757dcb9fb57001e4b19f58d3dda36d01","tests/ui/unsupported-self.stderr":"be1893e21e626f0f76d16799bf27ad12df304384245462515e1fa63f06a83d80"},"package":"44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e"} -\ No newline at end of file -diff -up firefox-98.0/third_party/rust/async-trait/Cargo.toml.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/Cargo.toml ---- firefox-98.0/third_party/rust/async-trait/Cargo.toml.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/async-trait/Cargo.toml 2022-03-16 09:33:31.990159794 +0100 -@@ -11,9 +11,8 @@ - - [package] - edition = "2018" --rust-version = "1.39" - name = "async-trait" --version = "0.1.52" -+version = "0.1.51" - authors = ["David Tolnay "] - description = "Type erasure for async trait methods" - documentation = "https://docs.rs/async-trait" -@@ -48,5 +47,5 @@ version = "0.1.14" - version = "0.1.14" - - [dev-dependencies.trybuild] --version = "1.0.49" -+version = "1.0.19" - features = ["diff"] -diff -up firefox-98.0/third_party/rust/async-trait/src/expand.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/src/expand.rs ---- firefox-98.0/third_party/rust/async-trait/src/expand.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/async-trait/src/expand.rs 2022-03-16 09:33:31.990159794 +0100 -@@ -125,8 +125,6 @@ fn lint_suppress_with_body() -> Attribut - parse_quote! { - #[allow( - clippy::let_unit_value, -- clippy::no_effect_underscore_binding, -- clippy::shadow_same, - clippy::type_complexity, - clippy::type_repetition_in_bounds, - clippy::used_underscore_binding -diff -up firefox-98.0/third_party/rust/async-trait/tests/test.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/test.rs ---- firefox-98.0/third_party/rust/async-trait/tests/test.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/async-trait/tests/test.rs 2022-03-16 09:33:31.990159794 +0100 -@@ -6,7 +6,6 @@ - clippy::let_underscore_drop, - clippy::let_unit_value, - clippy::missing_panics_doc, -- clippy::missing_safety_doc, - clippy::needless_return, - clippy::trivially_copy_pass_by_ref, - clippy::unused_async -@@ -1377,15 +1376,3 @@ pub mod issue169 { - - pub fn test(_t: &dyn Trait) {} - } -- --// https://github.com/dtolnay/async-trait/issues/183 --pub mod issue183 { -- #![deny(clippy::shadow_same)] -- -- use async_trait::async_trait; -- -- #[async_trait] -- trait Foo { -- async fn foo(_n: i32) {} -- } --} -diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/bare-trait-object.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/bare-trait-object.stderr ---- firefox-98.0/third_party/rust/async-trait/tests/ui/bare-trait-object.stderr.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/async-trait/tests/ui/bare-trait-object.stderr 2022-03-16 09:33:31.990159794 +0100 -@@ -1,13 +1,13 @@ - error: trait objects without an explicit `dyn` are deprecated -- --> tests/ui/bare-trait-object.rs:11:16 -+ --> $DIR/bare-trait-object.rs:11:16 - | - 11 | impl Trait for Send + Sync { - | ^^^^^^^^^^^ help: use `dyn`: `dyn Send + Sync` - | - note: the lint level is defined here -- --> tests/ui/bare-trait-object.rs:1:9 -+ --> $DIR/bare-trait-object.rs:1:9 - | - 1 | #![deny(bare_trait_objects)] - | ^^^^^^^^^^^^^^^^^^ - = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! -- = note: for more information, see -+ = note: for more information, see issue #80165 -diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/delimiter-span.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/delimiter-span.stderr ---- firefox-98.0/third_party/rust/async-trait/tests/ui/delimiter-span.stderr.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/async-trait/tests/ui/delimiter-span.stderr 2022-03-16 09:33:31.990159794 +0100 -@@ -1,5 +1,5 @@ - error: no rules expected the token `{` -- --> tests/ui/delimiter-span.rs:17:16 -+ --> $DIR/delimiter-span.rs:17:16 - | - 3 | macro_rules! picky { - | ------------------ when calling this macro -@@ -8,7 +8,7 @@ error: no rules expected the token `{` - | ^ no rules expected this token in macro call - - error: no rules expected the token `{` -- --> tests/ui/delimiter-span.rs:18:16 -+ --> $DIR/delimiter-span.rs:18:16 - | - 3 | macro_rules! picky { - | ------------------ when calling this macro -diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/lifetime-span.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/lifetime-span.stderr ---- firefox-98.0/third_party/rust/async-trait/tests/ui/lifetime-span.stderr.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/async-trait/tests/ui/lifetime-span.stderr 2022-03-16 09:33:31.990159794 +0100 -@@ -1,5 +1,5 @@ - error[E0726]: implicit elided lifetime not allowed here -- --> tests/ui/lifetime-span.rs:12:6 -+ --> $DIR/lifetime-span.rs:12:6 - | - 12 | impl Trait for A { - | ^^^^^- help: indicate the anonymous lifetime: `<'_>` -@@ -7,7 +7,7 @@ error[E0726]: implicit elided lifetime n - = note: assuming a `'static` lifetime... - - error[E0107]: this trait takes 0 lifetime arguments but 1 lifetime argument was supplied -- --> tests/ui/lifetime-span.rs:32:10 -+ --> $DIR/lifetime-span.rs:32:10 - | - 32 | impl<'r> Trait2<'r> for B { - | ^^^^^^---- help: remove these generics -@@ -15,13 +15,13 @@ error[E0107]: this trait takes 0 lifetim - | expected 0 lifetime arguments - | - note: trait defined here, with 0 lifetime parameters -- --> tests/ui/lifetime-span.rs:22:11 -+ --> $DIR/lifetime-span.rs:22:11 - | - 22 | pub trait Trait2 { - | ^^^^^^ - - error[E0195]: lifetime parameters or bounds on method `method` do not match the trait declaration -- --> tests/ui/lifetime-span.rs:13:14 -+ --> $DIR/lifetime-span.rs:13:14 - | - 8 | async fn method(&'r self); - | ---------------- lifetimes in impl do not match this method in trait -@@ -30,7 +30,7 @@ error[E0195]: lifetime parameters or bou - | ^^^^^^^^^^^^^ lifetimes do not match method in trait - - error[E0195]: lifetime parameters or bounds on method `method` do not match the trait declaration -- --> tests/ui/lifetime-span.rs:18:14 -+ --> $DIR/lifetime-span.rs:18:14 - | - 8 | async fn method(&'r self); - | ---------------- lifetimes in impl do not match this method in trait -@@ -39,7 +39,7 @@ error[E0195]: lifetime parameters or bou - | ^^^^^^^^^^^^^ lifetimes do not match method in trait - - error[E0195]: lifetime parameters or bounds on method `method` do not match the trait declaration -- --> tests/ui/lifetime-span.rs:33:14 -+ --> $DIR/lifetime-span.rs:33:14 - | - 23 | async fn method<'r>(&'r self); - | ---- lifetimes in impl do not match this method in trait -diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/missing-async-in-impl.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/missing-async-in-impl.stderr -diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/missing-async-in-trait.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/missing-async-in-trait.stderr -diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/missing-body.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/missing-body.stderr ---- firefox-98.0/third_party/rust/async-trait/tests/ui/missing-body.stderr.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/async-trait/tests/ui/missing-body.stderr 2022-03-16 09:33:31.990159794 +0100 -@@ -1,5 +1,5 @@ - error: associated function in `impl` without body -- --> tests/ui/missing-body.rs:12:5 -+ --> $DIR/missing-body.rs:12:5 - | - 12 | async fn f(&self); - | ^^^^^^^^^^^^^^^^^- -diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/must-use.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/must-use.stderr ---- firefox-98.0/third_party/rust/async-trait/tests/ui/must-use.stderr.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/async-trait/tests/ui/must-use.stderr 2022-03-16 09:33:31.991159827 +0100 -@@ -1,11 +1,11 @@ - error: unused return value of `Interface::f` that must be used -- --> tests/ui/must-use.rs:18:5 -+ --> $DIR/must-use.rs:18:5 - | - 18 | Thing.f(); - | ^^^^^^^^^^ - | - note: the lint level is defined here -- --> tests/ui/must-use.rs:1:9 -+ --> $DIR/must-use.rs:1:9 - | - 1 | #![deny(unused_must_use)] - | ^^^^^^^^^^^^^^^ -diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/self-span.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/self-span.stderr ---- firefox-98.0/third_party/rust/async-trait/tests/ui/self-span.stderr.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/async-trait/tests/ui/self-span.stderr 2022-03-16 09:33:31.991159827 +0100 -@@ -1,5 +1,5 @@ - error[E0308]: mismatched types -- --> tests/ui/self-span.rs:17:21 -+ --> $DIR/self-span.rs:17:21 - | - 17 | let _: () = self; - | -- ^^^^ expected `()`, found struct `S` -@@ -7,13 +7,13 @@ error[E0308]: mismatched types - | expected due to this - - error: the `Self` constructor can only be used with tuple or unit structs -- --> tests/ui/self-span.rs:18:23 -+ --> $DIR/self-span.rs:18:23 - | - 18 | let _: Self = Self; - | ^^^^ help: use curly brackets: `Self { /* fields */ }` - - error[E0308]: mismatched types -- --> tests/ui/self-span.rs:25:21 -+ --> $DIR/self-span.rs:25:21 - | - 25 | let _: () = self; - | -- ^^^^ expected `()`, found enum `E` -@@ -21,7 +21,7 @@ error[E0308]: mismatched types - | expected due to this - - error[E0533]: expected unit struct, unit variant or constant, found struct variant `Self::V` -- --> tests/ui/self-span.rs:26:23 -+ --> $DIR/self-span.rs:26:23 - | - 26 | let _: Self = Self::V; - | ^^^^^^^ -diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/send-not-implemented.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/send-not-implemented.stderr ---- firefox-98.0/third_party/rust/async-trait/tests/ui/send-not-implemented.stderr.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/async-trait/tests/ui/send-not-implemented.stderr 2022-03-16 09:33:31.991159827 +0100 -@@ -1,5 +1,5 @@ - error: future cannot be sent between threads safely -- --> tests/ui/send-not-implemented.rs:8:26 -+ --> $DIR/send-not-implemented.rs:8:26 - | - 8 | async fn test(&self) { - | __________________________^ -@@ -9,9 +9,9 @@ error: future cannot be sent between thr - 12 | | } - | |_____^ future created by async block is not `Send` - | -- = help: within `impl Future`, the trait `Send` is not implemented for `MutexGuard<'_, ()>` -+ = help: within `impl Future`, the trait `Send` is not implemented for `MutexGuard<'_, ()>` - note: future is not `Send` as this value is used across an await -- --> tests/ui/send-not-implemented.rs:11:9 -+ --> $DIR/send-not-implemented.rs:11:9 - | - 10 | let _guard = mutex.lock().unwrap(); - | ------ has type `MutexGuard<'_, ()>` which is not `Send` -@@ -22,7 +22,7 @@ note: future is not `Send` as this value - = note: required for the cast to the object type `dyn Future + Send` - - error: future cannot be sent between threads safely -- --> tests/ui/send-not-implemented.rs:14:38 -+ --> $DIR/send-not-implemented.rs:14:38 - | - 14 | async fn test_ret(&self) -> bool { - | ______________________________________^ -@@ -33,9 +33,9 @@ error: future cannot be sent between thr - 19 | | } - | |_____^ future created by async block is not `Send` - | -- = help: within `impl Future`, the trait `Send` is not implemented for `MutexGuard<'_, ()>` -+ = help: within `impl Future`, the trait `Send` is not implemented for `MutexGuard<'_, ()>` - note: future is not `Send` as this value is used across an await -- --> tests/ui/send-not-implemented.rs:17:9 -+ --> $DIR/send-not-implemented.rs:17:9 - | - 16 | let _guard = mutex.lock().unwrap(); - | ------ has type `MutexGuard<'_, ()>` which is not `Send` -diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/unreachable.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/unreachable.rs ---- firefox-98.0/third_party/rust/async-trait/tests/ui/unreachable.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/async-trait/tests/ui/unreachable.rs 2022-03-16 09:33:31.991159827 +0100 -@@ -12,8 +12,8 @@ pub trait Trait { - #[async_trait] - pub trait TraitFoo { - async fn f() { -- let _y = unimplemented!(); -- let _z = _y; -+ let y = unimplemented!(); -+ let z = y; - } - } - -diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/unreachable.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/unreachable.stderr ---- firefox-98.0/third_party/rust/async-trait/tests/ui/unreachable.stderr.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/async-trait/tests/ui/unreachable.stderr 2022-03-16 09:33:31.991159827 +0100 -@@ -1,13 +1,13 @@ - error: unreachable statement -- --> tests/ui/unreachable.rs:16:9 -+ --> $DIR/unreachable.rs:16:9 - | --15 | let _y = unimplemented!(); -- | ---------------- any code following this expression is unreachable --16 | let _z = _y; -- | ^^^^^^^^^^^^ unreachable statement -+15 | let y = unimplemented!(); -+ | ---------------- any code following this expression is unreachable -+16 | let z = y; -+ | ^^^^^^^^^^ unreachable statement - | - note: the lint level is defined here -- --> tests/ui/unreachable.rs:1:9 -+ --> $DIR/unreachable.rs:1:9 - | - 1 | #![deny(warnings)] - | ^^^^^^^^ -diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/unsupported-self.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/unsupported-self.rs -diff -up firefox-98.0/third_party/rust/async-trait/tests/ui/unsupported-self.stderr.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/async-trait/tests/ui/unsupported-self.stderr ---- firefox-98.0/third_party/rust/async-trait/tests/ui/unsupported-self.stderr.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/async-trait/tests/ui/unsupported-self.stderr 2022-03-16 09:33:31.991159827 +0100 -@@ -1,5 +1,5 @@ - error: the `Self` constructor can only be used with tuple or unit structs -- --> tests/ui/unsupported-self.rs:11:17 -+ --> $DIR/unsupported-self.rs:11:17 - | - 11 | let _ = Self; - | ^^^^ -diff -up firefox-98.0/third_party/rust/bitreader/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bitreader/.cargo-checksum.json ---- firefox-98.0/third_party/rust/bitreader/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/bitreader/.cargo-checksum.json 2022-03-16 09:33:31.991159827 +0100 -@@ -1 +1 @@ --{"files":{"Cargo.toml":"28a1d4b7f04f3989f856789ec569d890a91b9dfdc8775ff8cbd4e0c1b2f8f9f2","LICENSE-APACHE":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30","LICENSE-MIT":"8583712ee2b062ff3d4d6d3e16f19ff0f92bc3a0a4beeec11a81ef00146fbd4f","README.md":"28986de2e8d457e76ae3303d80094697e6ef4ad8da06a4a3178bb1b52bff63d5","src/lib.rs":"250d841ee01b90209c6c4ad304969de145287c6c6588850b95e6f843ec4dd579","src/tests.rs":"5e62c77cfa155fd8affa8ff3c7ea688d80bce6f4956f9956582775ae3adca1a6"},"package":"bd5bf8a17cdc06d475689f9e9226f4b5bf5610e93cf5c3010a518fe6fb0d97f5"} -\ No newline at end of file -+{"files":{"Cargo.toml":"1da2771067c7bb47f182c75624cec456ef99daf6882314633a2a68aefc2616ad","LICENSE-APACHE":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30","LICENSE-MIT":"8583712ee2b062ff3d4d6d3e16f19ff0f92bc3a0a4beeec11a81ef00146fbd4f","README.md":"28986de2e8d457e76ae3303d80094697e6ef4ad8da06a4a3178bb1b52bff63d5","src/lib.rs":"6dcb62a9279ecad8cdcfe37f383282089753e28adc0f2785ca73d50040bc89e7","src/tests.rs":"f67d17aa8faed5e3838322de9b98bb0cdc58d35fe5870e3f5c65ef1ef788966e"},"package":"9178181a7d44239c6c8eaafa8688558a2ab5fa04b8855381f2681e9591fb941b"} -\ No newline at end of file -diff -up firefox-98.0/third_party/rust/bitreader/Cargo.toml.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bitreader/Cargo.toml ---- firefox-98.0/third_party/rust/bitreader/Cargo.toml.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/bitreader/Cargo.toml 2022-03-16 09:33:31.991159827 +0100 -@@ -3,15 +3,16 @@ - # When uploading crates to the registry Cargo will automatically - # "normalize" Cargo.toml files for maximal compatibility - # with all versions of Cargo and also rewrite `path` dependencies --# to registry (e.g., crates.io) dependencies. -+# to registry (e.g., crates.io) dependencies - # --# If you are reading this file be aware that the original Cargo.toml --# will likely look very different (and much more reasonable). --# See Cargo.toml.orig for the original contents. -+# If you believe there's an error in this file please file an -+# issue against the rust-lang/cargo repository. If you're -+# editing this file be aware that the upstream Cargo.toml -+# will likely look very different (and much more reasonable) - - [package] - name = "bitreader" --version = "0.3.5" -+version = "0.3.4" - authors = ["Ilkka Rauta "] - description = "BitReader helps reading individual bits from a slice of bytes.\n\nYou can read \"unusual\" numbers of bits from the byte slice, for example 13 bits\nat once. The reader internally keeps track of position within the buffer.\n" - homepage = "https://github.com/irauta/bitreader" -diff -up firefox-98.0/third_party/rust/bitreader/src/lib.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bitreader/src/lib.rs ---- firefox-98.0/third_party/rust/bitreader/src/lib.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/bitreader/src/lib.rs 2022-03-16 09:37:01.761157888 +0100 -@@ -50,7 +50,6 @@ - cfg_if::cfg_if!{ - if #[cfg(feature = "std")] { - extern crate std; -- use std::cmp::min; - use std::prelude::v1::*; - use std::fmt; - use std::error::Error; -@@ -58,7 +57,6 @@ cfg_if::cfg_if!{ - } else { - use core::result; - use core::fmt; -- use core::cmp::min; - } - } - -@@ -71,9 +69,6 @@ pub struct BitReader<'a> { - /// Position from the start of the slice, counted as bits instead of bytes - position: u64, - relative_offset: u64, -- -- /// Length this reader is allowed to read from the slice, counted as bits instead of bytes. -- length: u64, - } - - impl<'a> BitReader<'a> { -@@ -84,7 +79,6 @@ impl<'a> BitReader<'a> { - bytes: bytes, - position: 0, - relative_offset: 0, -- length: bytes.len() as u64 * 8, - } - } - -@@ -115,45 +109,6 @@ impl<'a> BitReader<'a> { - bytes: self.bytes, - position: self.position, - relative_offset: self.position, -- length: self.length - self.position, -- } -- } -- -- /// Returns a copy of current BitReader, with the difference that its position() returns -- /// positions relative to the position of the original BitReader at the construction time, and -- /// will not allow reading more than len bits. After construction, both readers are otherwise -- // completely independent, except of course for sharing the same source data. -- /// -- /// ``` -- /// use bitreader::BitReader; -- /// use bitreader::BitReaderError; -- /// -- /// let bytes = &[0b11110000, 0b00001111]; -- /// let mut original = BitReader::new(bytes); -- /// assert_eq!(original.read_u8(4).unwrap(), 0b1111); -- /// assert_eq!(original.position(), 4); -- /// -- /// let mut relative = original.relative_reader_atmost(8); -- /// assert_eq!(relative.position(), 0); -- /// -- /// assert_eq!(original.read_u8(8).unwrap(), 0); -- /// assert_eq!(relative.read_u8(8).unwrap(), 0); -- /// -- /// assert_eq!(original.position(), 12); -- /// assert_eq!(relative.position(), 8); -- /// -- /// assert_eq!(relative.read_u8(8).unwrap_err(), BitReaderError::NotEnoughData{ -- /// position: 8, -- /// length: 8, -- /// requested: 8 -- /// }); -- /// ``` -- pub fn relative_reader_atmost(&self, len: u64) -> BitReader<'a> { -- BitReader { -- bytes: self.bytes, -- position: self.position, -- relative_offset: self.position, -- length: min(self.length - self.position, len), - } - } - -@@ -175,9 +130,9 @@ impl<'a> BitReader<'a> { - let requested = output_bytes.len() as u64 * 8; - if requested > self.remaining() { - Err(BitReaderError::NotEnoughData { -- position: self.position(), -- length: self.length, -- requested, -+ position: self.position, -+ length: (self.bytes.len() * 8) as u64, -+ requested: requested, - }) - } else { - for byte in output_bytes.iter_mut() { -@@ -266,10 +221,10 @@ impl<'a> BitReader<'a> { - /// Skip arbitrary number of bits. However, you can skip at most to the end of the byte slice. - pub fn skip(&mut self, bit_count: u64) -> Result<()> { - let end_position = self.position + bit_count; -- if end_position > (self.relative_offset + self.length) { -+ if end_position > self.bytes.len() as u64 * 8 { - return Err(BitReaderError::NotEnoughData { -- position: self.position(), -- length: self.length, -+ position: self.position, -+ length: (self.bytes.len() * 8) as u64, - requested: bit_count, - }); - } -@@ -284,7 +239,8 @@ impl<'a> BitReader<'a> { - - /// Returns the number of bits not yet read from the underlying slice. - pub fn remaining(&self) -> u64 { -- self.length - self.position -+ let total_bits = self.bytes.len() as u64 * 8; -+ total_bits - self.position - } - - /// Helper to make sure the "bit cursor" is exactly at the beginning of a byte, or at specific -@@ -335,10 +291,10 @@ impl<'a> BitReader<'a> { - } - let start_position = self.position; - let end_position = self.position + bit_count as u64; -- if end_position > (self.relative_offset + self.length) { -+ if end_position > self.bytes.len() as u64 * 8 { - return Err(BitReaderError::NotEnoughData { -- position: self.position(), -- length: self.length, -+ position: self.position, -+ length: (self.bytes.len() * 8) as u64, - requested: bit_count as u64, - }); - } -@@ -366,13 +322,8 @@ pub type Result = result::Result __m256i { -- _mm256_or_si256(_mm256_srli_epi64(x, 32), _mm256_slli_epi64(x, 64 - 32)) -+ _mm256_shuffle_epi32(x, _MM_SHUFFLE!(2, 3, 0, 1)) - } - - #[inline(always)] - unsafe fn rot24(x: __m256i) -> __m256i { -- _mm256_or_si256(_mm256_srli_epi64(x, 24), _mm256_slli_epi64(x, 64 - 24)) -+ let rotate24 = _mm256_setr_epi8( -+ 3, 4, 5, 6, 7, 0, 1, 2, 11, 12, 13, 14, 15, 8, 9, 10, 3, 4, 5, 6, 7, 0, 1, 2, 11, 12, 13, -+ 14, 15, 8, 9, 10, -+ ); -+ _mm256_shuffle_epi8(x, rotate24) - } - - #[inline(always)] - unsafe fn rot16(x: __m256i) -> __m256i { -- _mm256_or_si256(_mm256_srli_epi64(x, 16), _mm256_slli_epi64(x, 64 - 16)) -+ let rotate16 = _mm256_setr_epi8( -+ 2, 3, 4, 5, 6, 7, 0, 1, 10, 11, 12, 13, 14, 15, 8, 9, 2, 3, 4, 5, 6, 7, 0, 1, 10, 11, 12, -+ 13, 14, 15, 8, 9, -+ ); -+ _mm256_shuffle_epi8(x, rotate16) - } - - #[inline(always)] - unsafe fn rot63(x: __m256i) -> __m256i { -- _mm256_or_si256(_mm256_srli_epi64(x, 63), _mm256_slli_epi64(x, 64 - 63)) -+ _mm256_or_si256(_mm256_srli_epi64(x, 63), add(x, x)) - } - - #[inline(always)] -diff -up firefox-98.0/third_party/rust/blake2b_simd/src/lib.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/blake2b_simd/src/lib.rs ---- firefox-98.0/third_party/rust/blake2b_simd/src/lib.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/blake2b_simd/src/lib.rs 2022-03-16 09:33:31.991159827 +0100 -@@ -1,4 +1,4 @@ --//! [![GitHub](https://img.shields.io/github/tag/oconnor663/blake2_simd.svg?label=GitHub)](https://github.com/oconnor663/blake2_simd) [![crates.io](https://img.shields.io/crates/v/blake2b_simd.svg)](https://crates.io/crates/blake2b_simd) [![Actions Status](https://github.com/oconnor663/blake2_simd/workflows/tests/badge.svg)](https://github.com/oconnor663/blake2_simd/actions) -+//! [![GitHub](https://img.shields.io/github/tag/oconnor663/blake2_simd.svg?label=GitHub)](https://github.com/oconnor663/blake2_simd) [![crates.io](https://img.shields.io/crates/v/blake2b_simd.svg)](https://crates.io/crates/blake2b_simd) [![Build Status](https://travis-ci.org/oconnor663/blake2_simd.svg?branch=master)](https://travis-ci.org/oconnor663/blake2_simd) - //! - //! An implementation of the BLAKE2b and BLAKE2bp hash functions. See also - //! [`blake2s_simd`](https://docs.rs/blake2s_simd). -diff -up firefox-98.0/third_party/rust/blake2b_simd/src/portable.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/blake2b_simd/src/portable.rs ---- firefox-98.0/third_party/rust/blake2b_simd/src/portable.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/blake2b_simd/src/portable.rs 2022-03-16 09:33:31.991159827 +0100 -@@ -23,9 +23,7 @@ fn g(v: &mut [Word; 16], a: usize, b: us - v[b] = (v[b] ^ v[c]).rotate_right(63); - } - --// This is too much inlining for some small chips like ARM Cortex-M0, so the --// uninline_portable feature is provided to disable it. --#[cfg_attr(not(feature = "uninline_portable"), inline(always))] -+#[inline(always)] - fn round(r: usize, m: &[Word; 16], v: &mut [Word; 16]) { - // Select the message schedule based on the round. - let s = SIGMA[r]; -diff -up firefox-98.0/third_party/rust/blake2b_simd/src/sse41.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/blake2b_simd/src/sse41.rs ---- firefox-98.0/third_party/rust/blake2b_simd/src/sse41.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/blake2b_simd/src/sse41.rs 2022-03-16 09:33:31.991159827 +0100 -@@ -70,33 +70,26 @@ macro_rules! _MM_SHUFFLE { - }; - } - --// These rotations are the "simple version". For the "complicated version", see --// https://github.com/sneves/blake2-avx2/blob/b3723921f668df09ece52dcd225a36d4a4eea1d9/blake2b-common.h#L43-L46. --// For a discussion of the tradeoffs, see --// https://github.com/sneves/blake2-avx2/pull/5. In short: --// - Due to an LLVM bug (https://bugs.llvm.org/show_bug.cgi?id=44379), this --// version performs better on recent x86 chips. --// - LLVM is able to optimize this version to AVX-512 rotation instructions --// when those are enabled. -- - #[inline(always)] - unsafe fn rot32(x: __m128i) -> __m128i { -- _mm_or_si128(_mm_srli_epi64(x, 32), _mm_slli_epi64(x, 64 - 32)) -+ _mm_shuffle_epi32(x, _MM_SHUFFLE!(2, 3, 0, 1)) - } - - #[inline(always)] - unsafe fn rot24(x: __m128i) -> __m128i { -- _mm_or_si128(_mm_srli_epi64(x, 24), _mm_slli_epi64(x, 64 - 24)) -+ let rotate24 = _mm_setr_epi8(3, 4, 5, 6, 7, 0, 1, 2, 11, 12, 13, 14, 15, 8, 9, 10); -+ _mm_shuffle_epi8(x, rotate24) - } - - #[inline(always)] - unsafe fn rot16(x: __m128i) -> __m128i { -- _mm_or_si128(_mm_srli_epi64(x, 16), _mm_slli_epi64(x, 64 - 16)) -+ let rotate16 = _mm_setr_epi8(2, 3, 4, 5, 6, 7, 0, 1, 10, 11, 12, 13, 14, 15, 8, 9); -+ _mm_shuffle_epi8(x, rotate16) - } - - #[inline(always)] - unsafe fn rot63(x: __m128i) -> __m128i { -- _mm_or_si128(_mm_srli_epi64(x, 63), _mm_slli_epi64(x, 64 - 63)) -+ _mm_or_si128(_mm_srli_epi64(x, 63), add(x, x)) - } - - #[inline(always)] -diff -up firefox-98.0/third_party/rust/bumpalo/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bumpalo/.cargo-checksum.json ---- firefox-98.0/third_party/rust/bumpalo/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/bumpalo/.cargo-checksum.json 2022-03-16 09:33:31.992159860 +0100 -@@ -1 +1 @@ --{"files":{"CHANGELOG.md":"31820be449d15a59a3fd124c89c5c5108bd8934fbd1c11d8d31cca3f9b082aee","Cargo.toml":"9a34d33f35a8271f6fed49f54b096ed9dcf80dd899f60205cf58962529abb4b9","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"65f94e99ddaf4f5d1782a6dae23f35d4293a9a01444a13135a6887017d353cee","README.md":"9a3b4407bab9fdf0f4a2acf5c2d3876f4c78fd25f1b8159462f07343a234fc8e","src/alloc.rs":"ab0f23fa11c26efdd8f0596ebdf0e3faa75d097881fb59639b0fb23340c106bc","src/boxed.rs":"a0dcc1b5691e4a445f35fe84be46a938515dfdca1651396b880682547ae91292","src/collections/collect_in.rs":"243799901b950687d6e78220958cfb3484faefefafd5892e03d1564617842812","src/collections/mod.rs":"0fa36a7a5f2b5916b8e3bf4e2804e87c5f7716c87c719a9ab465d377e6272170","src/collections/raw_vec.rs":"11395868cfd0802fab3fe43417751a5755abb516136923e6d8fdbc2f0ff49d19","src/collections/str/lossy.rs":"c5d62b16e01071e2a574ae41ef6693ad12f1e6c786c5d38f7a13ebd6cb23c088","src/collections/str/mod.rs":"d82a8bd417fbf52a589d89a16ea2a0ac4f6ac920c3976ab1f5b6ac0c8493c4f2","src/collections/string.rs":"d4e6c74d7431fa2548ac10290afef6bcdefbf110c6343f0c0244306c11370b8c","src/collections/vec.rs":"d8d997589a7449f14cdd21fb85583f6c94eb0d3ea2c832d3c4c570e92a0a5cdd","src/lib.rs":"835cbcfa2ac45d9d8d40a13258922419027f60c9481e2cbc1b22690edea2f481"},"package":"a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899"} -\ No newline at end of file -+{"files":{"CHANGELOG.md":"fb807cac318c99faa6fe40bcb6ddefd867c2048b9f2badd813281ddc808191b8","Cargo.toml":"74ed9ce9af6ed0be99c388989ab7e919ca1272fdd7e8a0d223506c790a74f1d5","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"65f94e99ddaf4f5d1782a6dae23f35d4293a9a01444a13135a6887017d353cee","README.md":"84d13918b74c4175683118042305b0a4ff90333da9abf214bcf46d9b546ae319","README.tpl":"ec385000e14590a306855e7893daed0168102f33166bdc1e5cf5fa5599dac03f","src/alloc.rs":"ab0f23fa11c26efdd8f0596ebdf0e3faa75d097881fb59639b0fb23340c106bc","src/boxed.rs":"d18d363677a97a73225cb5c5b90e6187f7b5aae93979a41e40417fdd5a3f9975","src/collections/collect_in.rs":"243799901b950687d6e78220958cfb3484faefefafd5892e03d1564617842812","src/collections/mod.rs":"0fa36a7a5f2b5916b8e3bf4e2804e87c5f7716c87c719a9ab465d377e6272170","src/collections/raw_vec.rs":"11395868cfd0802fab3fe43417751a5755abb516136923e6d8fdbc2f0ff49d19","src/collections/str/lossy.rs":"c5d62b16e01071e2a574ae41ef6693ad12f1e6c786c5d38f7a13ebd6cb23c088","src/collections/str/mod.rs":"d82a8bd417fbf52a589d89a16ea2a0ac4f6ac920c3976ab1f5b6ac0c8493c4f2","src/collections/string.rs":"d4e6c74d7431fa2548ac10290afef6bcdefbf110c6343f0c0244306c11370b8c","src/collections/vec.rs":"8f445224c914c7a4f532636798f2b6ac254e650aa58aa57bd61aee1003d7f6af","src/lib.rs":"05bee63bd4bbfcf09a31b6511b5ec3f56ea1e973d079b398ff15d77be9a13d4a"},"package":"8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c"} -\ No newline at end of file -diff -up firefox-98.0/third_party/rust/bumpalo/Cargo.toml.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bumpalo/Cargo.toml ---- firefox-98.0/third_party/rust/bumpalo/Cargo.toml.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/bumpalo/Cargo.toml 2022-03-16 09:33:31.992159860 +0100 -@@ -12,7 +12,7 @@ - [package] - edition = "2018" - name = "bumpalo" --version = "3.9.1" -+version = "3.8.0" - authors = ["Nick Fitzgerald "] - exclude = ["/.github/*", "/benches", "/tests", "valgrind.supp", "bumpalo.png"] - description = "A fast bump allocation arena for Rust." -diff -up firefox-98.0/third_party/rust/bumpalo/CHANGELOG.md.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bumpalo/CHANGELOG.md ---- firefox-98.0/third_party/rust/bumpalo/CHANGELOG.md.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/bumpalo/CHANGELOG.md 2022-03-16 09:33:31.992159860 +0100 -@@ -28,30 +28,6 @@ Released YYYY-MM-DD. - - -------------------------------------------------------------------------------- - --## 3.9.1 -- --Released 2022-01-06. -- --### Fixed -- --* Fixed link to logo in docs and README.md -- ---------------------------------------------------------------------------------- -- --## 3.9.0 -- --Released 2022-01-05. -- --### Changed -- --* The minimum supported Rust version (MSRV) has been raised to Rust 1.54.0. -- --* `bumpalo::collections::Vec` implements relevant traits for all arrays of -- any size `N` via const generics. Previously, it was just arrays up to length -- 32. Similar for `bumpalo::boxed::Box<[T; N]>`. -- ---------------------------------------------------------------------------------- -- - ## 3.8.0 - - Released 2021-10-19. -diff -up firefox-98.0/third_party/rust/bumpalo/README.md.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bumpalo/README.md ---- firefox-98.0/third_party/rust/bumpalo/README.md.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/bumpalo/README.md 2022-03-16 09:33:31.992159860 +0100 -@@ -1,5 +1,6 @@ - # `bumpalo` - -+ - **A fast bump allocation arena for Rust.** - - [![](https://docs.rs/bumpalo/badge.svg)](https://docs.rs/bumpalo/) -@@ -7,7 +8,7 @@ - [![](https://img.shields.io/crates/d/bumpalo.svg)](https://crates.io/crates/bumpalo) - [![Build Status](https://github.com/fitzgen/bumpalo/workflows/Rust/badge.svg)](https://github.com/fitzgen/bumpalo/actions?query=workflow%3ARust) - --![](https://github.com/fitzgen/bumpalo/raw/main/bumpalo.png) -+![](https://github.com/fitzgen/bumpalo/raw/master/bumpalo.png) - - ### Bump Allocation - -@@ -32,12 +33,11 @@ pointer back to the start of the arena's - deallocation *extremely* fast, but allocated objects' `Drop` implementations are - not invoked. - --> **However:** [`bumpalo::boxed::Box`][box] can be used to wrap -+> **However:** [`bumpalo::boxed::Box`][crate::boxed::Box] can be used to wrap - > `T` values allocated in the `Bump` arena, and calls `T`'s `Drop` - > implementation when the `Box` wrapper goes out of scope. This is similar to - > how [`std::boxed::Box`] works, except without deallocating its backing memory. - --[box]: https://docs.rs/bumpalo/latest/bumpalo/boxed/struct.Box.html - [`std::boxed::Box`]: https://doc.rust-lang.org/std/boxed/struct.Box.html - - ### What happens when the memory chunk is full? -@@ -80,22 +80,19 @@ collection types are modified to allocat - arenas. - - ```rust --#[cfg(feature = "collections")] --{ -- use bumpalo::{Bump, collections::Vec}; -- -- // Create a new bump arena. -- let bump = Bump::new(); -- -- // Create a vector of integers whose storage is backed by the bump arena. The -- // vector cannot outlive its backing arena, and this property is enforced with -- // Rust's lifetime rules. -- let mut v = Vec::new_in(&bump); -- -- // Push a bunch of integers onto `v`! -- for i in 0..100 { -- v.push(i); -- } -+use bumpalo::{Bump, collections::Vec}; -+ -+// Create a new bump arena. -+let bump = Bump::new(); -+ -+// Create a vector of integers whose storage is backed by the bump arena. The -+// vector cannot outlive its backing arena, and this property is enforced with -+// Rust's lifetime rules. -+let mut v = Vec::new_in(&bump); -+ -+// Push a bunch of integers onto `v`! -+for i in 0..100 { -+ v.push(i); - } - ``` - -@@ -117,36 +114,33 @@ can use this to work around the fact tha - in its space itself. - - ```rust --#[cfg(feature = "boxed")] --{ -- use bumpalo::{Bump, boxed::Box}; -- use std::sync::atomic::{AtomicUsize, Ordering}; -- -- static NUM_DROPPED: AtomicUsize = AtomicUsize::new(0); -- -- struct CountDrops; -- -- impl Drop for CountDrops { -- fn drop(&mut self) { -- NUM_DROPPED.fetch_add(1, Ordering::SeqCst); -- } -+use bumpalo::{Bump, boxed::Box}; -+use std::sync::atomic::{AtomicUsize, Ordering}; -+ -+static NUM_DROPPED: AtomicUsize = AtomicUsize::new(0); -+ -+struct CountDrops; -+ -+impl Drop for CountDrops { -+ fn drop(&mut self) { -+ NUM_DROPPED.fetch_add(1, Ordering::SeqCst); - } -+} - -- // Create a new bump arena. -- let bump = Bump::new(); -+// Create a new bump arena. -+let bump = Bump::new(); - -- // Create a `CountDrops` inside the bump arena. -- let mut c = Box::new_in(CountDrops, &bump); -+// Create a `CountDrops` inside the bump arena. -+let mut c = Box::new_in(CountDrops, &bump); - -- // No `CountDrops` have been dropped yet. -- assert_eq!(NUM_DROPPED.load(Ordering::SeqCst), 0); -+// No `CountDrops` have been dropped yet. -+assert_eq!(NUM_DROPPED.load(Ordering::SeqCst), 0); - -- // Drop our `Box`. -- drop(c); -+// Drop our `Box`. -+drop(c); - -- // Its `Drop` implementation was run, and so `NUM_DROPS` has been incremented. -- assert_eq!(NUM_DROPPED.load(Ordering::SeqCst), 1); --} -+// Its `Drop` implementation was run, and so `NUM_DROPS` has been incremented. -+assert_eq!(NUM_DROPPED.load(Ordering::SeqCst), 1); - ``` - - ### `#![no_std]` Support -@@ -180,14 +174,14 @@ bumpalo = { version = "3.4.0", features - - Next, enable the `allocator_api` nightly Rust feature in your `src/lib.rs` or `src/main.rs`: - --```rust,ignore -+```rust - #![feature(allocator_api)] - ``` - - Finally, use `std` collections with `Bump`, so that their internal heap - allocations are made within the given bump arena: - --```rust,ignore -+```rust - #![feature(allocator_api)] - use bumpalo::Bump; - -@@ -203,8 +197,9 @@ v.push(2); - - #### Minimum Supported Rust Version (MSRV) - --This crate is guaranteed to compile on stable Rust **1.54** and up. It might --compile with older versions but that may change in any new patch release. -+This crate is guaranteed to compile on stable Rust 1.44 and up. It might compile -+with older versions but that may change in any new patch release. - - We reserve the right to increment the MSRV on minor releases, however we will strive - to only do it deliberately and for good reasons. -+ -diff -up firefox-98.0/third_party/rust/bumpalo/README.tpl.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bumpalo/README.tpl ---- firefox-98.0/third_party/rust/bumpalo/README.tpl.crossbeam-downgrade-rhbz2063961 2022-03-16 09:33:31.992159860 +0100 -+++ firefox-98.0/third_party/rust/bumpalo/README.tpl 2022-03-16 09:33:31.992159860 +0100 -@@ -0,0 +1,3 @@ -+# `{{crate}}` -+ -+{{readme}} -diff -up firefox-98.0/third_party/rust/bumpalo/src/boxed.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bumpalo/src/boxed.rs ---- firefox-98.0/third_party/rust/bumpalo/src/boxed.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/bumpalo/src/boxed.rs 2022-03-16 09:33:31.992159860 +0100 -@@ -647,25 +647,39 @@ impl<'a, F: ?Sized + Future + Unpin> Fut - } - } - --/// This impl replaces unsize coercion. --impl<'a, T, const N: usize> From> for Box<'a, [T]> { -- fn from(mut arr: Box<'a, [T; N]>) -> Box<'a, [T]> { -- let ptr = core::ptr::slice_from_raw_parts_mut(arr.as_mut_ptr(), N); -- mem::forget(arr); -- unsafe { Box::from_raw(ptr) } -+macro_rules! array_impls { -+ ($($N: expr)+) => { -+ $( -+ /// This impl replaces unsize coercion. -+ impl<'a, T> From> for Box<'a, [T]> { -+ fn from(mut arr: Box<'a, [T; $N]>) -> Box<'a, [T]> { -+ let ptr = core::ptr::slice_from_raw_parts_mut(arr.as_mut_ptr(), $N); -+ mem::forget(arr); -+ unsafe { Box::from_raw(ptr) } -+ } -+ } -+ -+ -+ /// This impl replaces unsize coercion. -+ impl<'a, T> TryFrom> for Box<'a, [T; $N]> { -+ type Error = Box<'a, [T]>; -+ fn try_from(mut slice: Box<'a, [T]>) -> Result, Box<'a, [T]>> { -+ if slice.len() == $N { -+ let ptr = slice.as_mut_ptr() as *mut [T; $N]; -+ mem::forget(slice); -+ Ok(unsafe { Box::from_raw(ptr) }) -+ } else { -+ Err(slice) -+ } -+ } -+ } -+ )+ - } - } - --/// This impl replaces unsize coercion. --impl<'a, T, const N: usize> TryFrom> for Box<'a, [T; N]> { -- type Error = Box<'a, [T]>; -- fn try_from(mut slice: Box<'a, [T]>) -> Result, Box<'a, [T]>> { -- if slice.len() == N { -- let ptr = slice.as_mut_ptr() as *mut [T; N]; -- mem::forget(slice); -- Ok(unsafe { Box::from_raw(ptr) }) -- } else { -- Err(slice) -- } -- } -+array_impls! { -+ 0 1 2 3 4 5 6 7 8 9 -+ 10 11 12 13 14 15 16 17 18 19 -+ 20 21 22 23 24 25 26 27 28 29 -+ 30 31 32 - } -diff -up firefox-98.0/third_party/rust/bumpalo/src/collections/vec.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bumpalo/src/collections/vec.rs ---- firefox-98.0/third_party/rust/bumpalo/src/collections/vec.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/bumpalo/src/collections/vec.rs 2022-03-16 09:33:31.992159860 +0100 -@@ -1983,23 +1983,26 @@ __impl_slice_eq1! { Vec<'a, A>, &'b [B] - __impl_slice_eq1! { Vec<'a, A>, &'b mut [B] } - // __impl_slice_eq1! { Cow<'a, [A]>, Vec<'b, B>, Clone } - --macro_rules! __impl_slice_eq1_array { -- ($Lhs: ty, $Rhs: ty) => { -- impl<'a, 'b, A, B, const N: usize> PartialEq<$Rhs> for $Lhs -- where -- A: PartialEq, -- { -- #[inline] -- fn eq(&self, other: &$Rhs) -> bool { -- self[..] == other[..] -- } -- } -- }; --} -- --__impl_slice_eq1_array! { Vec<'a, A>, [B; N] } --__impl_slice_eq1_array! { Vec<'a, A>, &'b [B; N] } --__impl_slice_eq1_array! { Vec<'a, A>, &'b mut [B; N] } -+macro_rules! array_impls { -+ ($($N: expr)+) => { -+ $( -+ // NOTE: some less important impls are omitted to reduce code bloat -+ __impl_slice_eq1! { Vec<'a, A>, [B; $N] } -+ __impl_slice_eq1! { Vec<'a, A>, &'b [B; $N] } -+ // __impl_slice_eq1! { Vec, &'b mut [B; $N] } -+ // __impl_slice_eq1! { Cow<'a, [A]>, [B; $N], Clone } -+ // __impl_slice_eq1! { Cow<'a, [A]>, &'b [B; $N], Clone } -+ // __impl_slice_eq1! { Cow<'a, [A]>, &'b mut [B; $N], Clone } -+ )+ -+ } -+} -+ -+array_impls! { -+ 0 1 2 3 4 5 6 7 8 9 -+ 10 11 12 13 14 15 16 17 18 19 -+ 20 21 22 23 24 25 26 27 28 29 -+ 30 31 32 -+} - - /// Implements comparison of vectors, lexicographically. - impl<'bump, T: 'bump + PartialOrd> PartialOrd for Vec<'bump, T> { -@@ -2070,18 +2073,6 @@ impl<'bump, T: 'bump> BorrowMut<[T]> for - } - } - --impl<'bump, T> Drop for Vec<'bump, T> { -- fn drop(&mut self) { -- unsafe { -- // use drop for [T] -- // use a raw slice to refer to the elements of the vector as weakest necessary type; -- // could avoid questions of validity in certain cases -- ptr::drop_in_place(ptr::slice_from_raw_parts_mut(self.as_mut_ptr(), self.len)) -- } -- // RawVec handles deallocation -- } --} -- - //////////////////////////////////////////////////////////////////////////////// - // Clone-on-write - //////////////////////////////////////////////////////////////////////////////// -diff -up firefox-98.0/third_party/rust/bumpalo/src/lib.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/bumpalo/src/lib.rs ---- firefox-98.0/third_party/rust/bumpalo/src/lib.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/bumpalo/src/lib.rs 2022-03-16 09:33:31.992159860 +0100 -@@ -1,4 +1,222 @@ --#![doc = include_str!("../README.md")] -+/*! -+ -+**A fast bump allocation arena for Rust.** -+ -+[![](https://docs.rs/bumpalo/badge.svg)](https://docs.rs/bumpalo/) -+[![](https://img.shields.io/crates/v/bumpalo.svg)](https://crates.io/crates/bumpalo) -+[![](https://img.shields.io/crates/d/bumpalo.svg)](https://crates.io/crates/bumpalo) -+[![Build Status](https://github.com/fitzgen/bumpalo/workflows/Rust/badge.svg)](https://github.com/fitzgen/bumpalo/actions?query=workflow%3ARust) -+ -+![](https://github.com/fitzgen/bumpalo/raw/master/bumpalo.png) -+ -+## Bump Allocation -+ -+Bump allocation is a fast, but limited approach to allocation. We have a chunk -+of memory, and we maintain a pointer within that memory. Whenever we allocate an -+object, we do a quick test that we have enough capacity left in our chunk to -+allocate the object and then update the pointer by the object's size. *That's -+it!* -+ -+The disadvantage of bump allocation is that there is no general way to -+deallocate individual objects or reclaim the memory region for a -+no-longer-in-use object. -+ -+These trade offs make bump allocation well-suited for *phase-oriented* -+allocations. That is, a group of objects that will all be allocated during the -+same program phase, used, and then can all be deallocated together as a group. -+ -+## Deallocation en Masse, but No `Drop` -+ -+To deallocate all the objects in the arena at once, we can simply reset the bump -+pointer back to the start of the arena's memory chunk. This makes mass -+deallocation *extremely* fast, but allocated objects' `Drop` implementations are -+not invoked. -+ -+> **However:** [`bumpalo::boxed::Box`][crate::boxed::Box] can be used to wrap -+> `T` values allocated in the `Bump` arena, and calls `T`'s `Drop` -+> implementation when the `Box` wrapper goes out of scope. This is similar to -+> how [`std::boxed::Box`] works, except without deallocating its backing memory. -+ -+[`std::boxed::Box`]: https://doc.rust-lang.org/std/boxed/struct.Box.html -+ -+## What happens when the memory chunk is full? -+ -+This implementation will allocate a new memory chunk from the global allocator -+and then start bump allocating into this new memory chunk. -+ -+## Example -+ -+``` -+use bumpalo::Bump; -+use std::u64; -+ -+struct Doggo { -+ cuteness: u64, -+ age: u8, -+ scritches_required: bool, -+} -+ -+// Create a new arena to bump allocate into. -+let bump = Bump::new(); -+ -+// Allocate values into the arena. -+let scooter = bump.alloc(Doggo { -+ cuteness: u64::max_value(), -+ age: 8, -+ scritches_required: true, -+}); -+ -+// Exclusive, mutable references to the just-allocated value are returned. -+assert!(scooter.scritches_required); -+scooter.age += 1; -+``` -+ -+## Collections -+ -+When the `"collections"` cargo feature is enabled, a fork of some of the `std` -+library's collections are available in the `collections` module. These -+collection types are modified to allocate their space inside `bumpalo::Bump` -+arenas. -+ -+```rust -+# #[cfg(feature = "collections")] -+# { -+use bumpalo::{Bump, collections::Vec}; -+ -+// Create a new bump arena. -+let bump = Bump::new(); -+ -+// Create a vector of integers whose storage is backed by the bump arena. The -+// vector cannot outlive its backing arena, and this property is enforced with -+// Rust's lifetime rules. -+let mut v = Vec::new_in(&bump); -+ -+// Push a bunch of integers onto `v`! -+for i in 0..100 { -+ v.push(i); -+} -+# } -+``` -+ -+Eventually [all `std` collection types will be parameterized by an -+allocator](https://github.com/rust-lang/rust/issues/42774) and we can remove -+this `collections` module and use the `std` versions. -+ -+For unstable, nightly-only support for custom allocators in `std`, see the -+`allocator_api` section below. -+ -+## `bumpalo::boxed::Box` -+ -+When the `"boxed"` cargo feature is enabled, a fork of `std::boxed::Box` library -+is available in the `boxed` module. This `Box` type is modified to allocate its -+space inside `bumpalo::Bump` arenas. -+ -+**A `Box` runs `T`'s drop implementation when the `Box` is dropped.** You -+can use this to work around the fact that `Bump` does not drop values allocated -+in its space itself. -+ -+```rust -+# #[cfg(feature = "boxed")] -+# { -+use bumpalo::{Bump, boxed::Box}; -+use std::sync::atomic::{AtomicUsize, Ordering}; -+ -+static NUM_DROPPED: AtomicUsize = AtomicUsize::new(0); -+ -+struct CountDrops; -+ -+impl Drop for CountDrops { -+ fn drop(&mut self) { -+ NUM_DROPPED.fetch_add(1, Ordering::SeqCst); -+ } -+} -+ -+// Create a new bump arena. -+let bump = Bump::new(); -+ -+// Create a `CountDrops` inside the bump arena. -+let mut c = Box::new_in(CountDrops, &bump); -+ -+// No `CountDrops` have been dropped yet. -+assert_eq!(NUM_DROPPED.load(Ordering::SeqCst), 0); -+ -+// Drop our `Box`. -+drop(c); -+ -+// Its `Drop` implementation was run, and so `NUM_DROPS` has been incremented. -+assert_eq!(NUM_DROPPED.load(Ordering::SeqCst), 1); -+# } -+``` -+ -+## `#![no_std]` Support -+ -+Bumpalo is a `no_std` crate. It depends only on the `alloc` and `core` crates. -+ -+## Thread support -+ -+The `Bump` is `!Sync`, which makes it hard to use in certain situations around threads ‒ for -+example in `rayon`. -+ -+The [`bumpalo-herd`](https://crates.io/crates/bumpalo-herd) crate provides a pool of `Bump` -+allocators for use in such situations. -+ -+## Nightly Rust `feature(allocator_api)` Support -+ -+The unstable, nightly-only Rust `allocator_api` feature defines an `Allocator` -+trait and exposes custom allocators for `std` types. Bumpalo has a matching -+`allocator_api` cargo feature to enable implementing `Allocator` and using -+`Bump` with `std` collections. Note that, as `feature(allocator_api)` is -+unstable and only in nightly Rust, Bumpalo's matching `allocator_api` cargo -+feature should be considered unstable, and will not follow the semver -+conventions that the rest of the crate does. -+ -+First, enable the `allocator_api` feature in your `Cargo.toml`: -+ -+```toml -+[dependencies] -+bumpalo = { version = "3.4.0", features = ["allocator_api"] } -+``` -+ -+Next, enable the `allocator_api` nightly Rust feature in your `src/lib.rs` or `src/main.rs`: -+ -+```rust -+# #[cfg(feature = "allocator_api")] -+# { -+#![feature(allocator_api)] -+# } -+``` -+ -+Finally, use `std` collections with `Bump`, so that their internal heap -+allocations are made within the given bump arena: -+ -+``` -+# #![cfg_attr(feature = "allocator_api", feature(allocator_api))] -+# #[cfg(feature = "allocator_api")] -+# { -+#![feature(allocator_api)] -+use bumpalo::Bump; -+ -+// Create a new bump arena. -+let bump = Bump::new(); -+ -+// Create a `Vec` whose elements are allocated within the bump arena. -+let mut v = Vec::new_in(&bump); -+v.push(0); -+v.push(1); -+v.push(2); -+# } -+``` -+ -+### Minimum Supported Rust Version (MSRV) -+ -+This crate is guaranteed to compile on stable Rust 1.44 and up. It might compile -+with older versions but that may change in any new patch release. -+ -+We reserve the right to increment the MSRV on minor releases, however we will strive -+to only do it deliberately and for good reasons. -+ -+ */ -+ - #![deny(missing_debug_implementations)] - #![deny(missing_docs)] - #![no_std] -@@ -202,7 +420,7 @@ impl Display for AllocOrInit - /// - /// Even when optimizations are on, these functions do not **guarantee** that - /// the value is constructed on the heap. To the best of our knowledge no such --/// guarantee can be made in stable Rust as of 1.51. -+/// guarantee can be made in stable Rust as of 1.44. - /// - /// ### Fallible Initialization: The `_try_with` Method Suffix - /// -diff -up firefox-98.0/third_party/rust/cache-padded/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/cache-padded/.cargo-checksum.json ---- firefox-98.0/third_party/rust/cache-padded/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/cache-padded/.cargo-checksum.json 2022-03-16 09:33:31.992159860 +0100 -@@ -1 +1 @@ --{"files":{"CHANGELOG.md":"01efe9c9a75e5a305dac0e12676ed451f746049a825aa86acef0d8ee90742f71","Cargo.toml":"ea55c73cacac2dcc3bdcb2c657e057d9b73214e76f8654799236b13c853e97bd","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"61d450a57f8699dfc1c39e3bb69236f7d10f31f4503b03aa8b2b37b2448b8b69","src/lib.rs":"4bcb45fe37cdca78ba0e403d9e531102c521ad42e9ffd2ecbb154b4509864978","tests/padding.rs":"120cc65d1fcebbdb0ed8b0c287680ede2483e3ab040746e1a3616ffb39d8f414"},"package":"c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c"} -\ No newline at end of file -+{"files":{"CHANGELOG.md":"50d6fbb00aa801cffefd2ecbbb43bba8686925658b3bf5e304b5af735f90bf08","Cargo.toml":"7ff90cd0fd3bc7449b8f55dea7de4d7d51f7c11948119512a274369733a94321","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"106c91d873d7c2681ca6264195737d7f2ea73f91cc74dd4c200f3fe9c5ea4907","src/lib.rs":"d2b1a7280c5cb8c1e946a5839862a1496749c445851f7ed196debf8386a4e646","tests/padding.rs":"120cc65d1fcebbdb0ed8b0c287680ede2483e3ab040746e1a3616ffb39d8f414"},"package":"631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba"} -\ No newline at end of file -diff -up firefox-98.0/third_party/rust/cache-padded/Cargo.toml.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/cache-padded/Cargo.toml ---- firefox-98.0/third_party/rust/cache-padded/Cargo.toml.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/cache-padded/Cargo.toml 2022-03-16 09:33:31.992159860 +0100 -@@ -3,20 +3,23 @@ - # When uploading crates to the registry Cargo will automatically - # "normalize" Cargo.toml files for maximal compatibility - # with all versions of Cargo and also rewrite `path` dependencies --# to registry (e.g., crates.io) dependencies. -+# to registry (e.g., crates.io) dependencies - # --# If you are reading this file be aware that the original Cargo.toml --# will likely look very different (and much more reasonable). --# See Cargo.toml.orig for the original contents. -+# If you believe there's an error in this file please file an -+# issue against the rust-lang/cargo repository. If you're -+# editing this file be aware that the upstream Cargo.toml -+# will likely look very different (and much more reasonable) - - [package] - edition = "2018" - name = "cache-padded" --version = "1.2.0" -+version = "1.1.1" - authors = ["Stjepan Glavina "] - description = "Prevent false sharing by padding and aligning to the length of a cache line" --homepage = "https://github.com/smol-rs/cache-padded" -+homepage = "https://github.com/stjepang/cache-padded" -+documentation = "https://docs.rs/cache-padded" -+readme = "README.md" - keywords = ["cache", "padding", "lock-free", "atomic"] - categories = ["concurrency", "no-std"] - license = "Apache-2.0 OR MIT" --repository = "https://github.com/smol-rs/cache-padded" -+repository = "https://github.com/stjepang/cache-padded" -diff -up firefox-98.0/third_party/rust/cache-padded/CHANGELOG.md.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/cache-padded/CHANGELOG.md ---- firefox-98.0/third_party/rust/cache-padded/CHANGELOG.md.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/cache-padded/CHANGELOG.md 2022-03-16 09:33:31.992159860 +0100 -@@ -1,7 +1,3 @@ --# Version 1.2.0 -- --- Improve implementation of `CachePadded`. -- - # Version 1.1.1 - - - Forbid unsafe code. -diff -up firefox-98.0/third_party/rust/cache-padded/README.md.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/cache-padded/README.md ---- firefox-98.0/third_party/rust/cache-padded/README.md.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/cache-padded/README.md 2022-03-16 09:33:31.992159860 +0100 -@@ -1,9 +1,9 @@ - # cache-padded - --[![Build](https://github.com/smol-rs/cache-padded/workflows/Build%20and%20test/badge.svg)]( --https://github.com/smol-rs/cache-padded/actions) --[![License](https://img.shields.io/badge/license-Apache--2.0_OR_MIT-blue.svg)]( --https://github.com/smol-rs/cache-padded) -+[![Build](https://github.com/stjepang/cache-padded/workflows/Build%20and%20test/badge.svg)]( -+https://github.com/stjepang/cache-padded/actions) -+[![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)]( -+https://github.com/stjepang/cache-padded) - [![Cargo](https://img.shields.io/crates/v/cache-padded.svg)]( - https://crates.io/crates/cache-padded) - [![Documentation](https://docs.rs/cache-padded/badge.svg)]( -diff -up firefox-98.0/third_party/rust/cache-padded/src/lib.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/cache-padded/src/lib.rs ---- firefox-98.0/third_party/rust/cache-padded/src/lib.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/cache-padded/src/lib.rs 2022-03-16 09:33:31.993159893 +0100 -@@ -1,7 +1,7 @@ - //! Prevent false sharing by padding and aligning to the length of a cache line. - //! - //! In concurrent programming, sometimes it is desirable to make sure commonly accessed shared data --//! is not all placed into the same cache line. Updating an atomic value invalidates the whole cache -+//! is not all placed into the same cache line. Updating an atomic value invalides the whole cache - //! line it belongs to, which makes the next access to the same cache line slower for other CPU - //! cores. Use [`CachePadded`] to ensure updating one piece of data doesn't invalidate other cached - //! data. -@@ -10,9 +10,8 @@ - //! - //! Cache lines are assumed to be N bytes long, depending on the architecture: - //! --//! * On x86-64, aarch64, and powerpc64, N = 128. --//! * On arm, mips, mips64, and riscv64, N = 32. --//! * On s390x, N = 256. -+//! * On x86-64 and aarch64, N = 128. -+//! * On all others, N = 64. - //! - //! Note that N is just a reasonable guess and is not guaranteed to match the actual cache line - //! length of the machine the program is running on. -@@ -68,63 +67,14 @@ use core::ops::{Deref, DerefMut}; - // - https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-optimization-manual.pdf - // - https://github.com/facebook/folly/blob/1b5288e6eea6df074758f877c849b6e73bbb9fbb/folly/lang/Align.h#L107 - // --// ARM's big.LITTLE architecture has asymmetric cores and "big" cores have 128-byte cache line size. -+// ARM's big.LITTLE architecture has asymmetric cores and "big" cores have 128-byte cache lines. - // - // Sources: - // - https://www.mono-project.com/news/2016/09/12/arm64-icache/ - // --// powerpc64 has 128-byte cache line size. --// --// Sources: --// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_ppc64x.go#L9 --#[cfg_attr( -- any( -- target_arch = "x86_64", -- target_arch = "aarch64", -- target_arch = "powerpc64", -- ), -- repr(align(128)) --)] --// arm, mips, mips64, and riscv64 have 32-byte cache line size. --// --// Sources: --// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_arm.go#L7 --// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_mips.go#L7 --// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_mipsle.go#L7 --// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_mips64x.go#L9 --// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_riscv64.go#L7 --#[cfg_attr( -- any( -- target_arch = "arm", -- target_arch = "mips", -- target_arch = "mips64", -- target_arch = "riscv64", -- ), -- repr(align(32)) --)] --// s390x has 256-byte cache line size. --// --// Sources: --// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_s390x.go#L7 --#[cfg_attr(target_arch = "s390x", repr(align(256)))] --// x86 and wasm have 64-byte cache line size. --// --// Sources: --// - https://github.com/golang/go/blob/dda2991c2ea0c5914714469c4defc2562a907230/src/internal/cpu/cpu_x86.go#L9 --// - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_wasm.go#L7 --// --// All others are assumed to have 64-byte cache line size. -+#[cfg_attr(any(target_arch = "x86_64", target_arch = "aarch64"), repr(align(128)))] - #[cfg_attr( -- not(any( -- target_arch = "x86_64", -- target_arch = "aarch64", -- target_arch = "powerpc64", -- target_arch = "arm", -- target_arch = "mips", -- target_arch = "mips64", -- target_arch = "riscv64", -- target_arch = "s390x", -- )), -+ not(any(target_arch = "x86_64", target_arch = "aarch64")), - repr(align(64)) - )] - #[derive(Clone, Copy, Default, Hash, PartialEq, Eq)] -diff -up firefox-98.0/third_party/rust/crossbeam-channel/benches/crossbeam.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/benches/crossbeam.rs ---- firefox-98.0/third_party/rust/crossbeam-channel/benches/crossbeam.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/benches/crossbeam.rs 2022-03-16 09:33:31.993159893 +0100 -@@ -13,7 +13,7 @@ mod unbounded { - - #[bench] - fn create(b: &mut Bencher) { -- b.iter(unbounded::); -+ b.iter(|| unbounded::()); - } - - #[bench] -diff -up firefox-98.0/third_party/rust/crossbeam-channel/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/.cargo-checksum.json ---- firefox-98.0/third_party/rust/crossbeam-channel/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/.cargo-checksum.json 2022-03-16 09:33:31.993159893 +0100 -@@ -1 +1 @@ --{"files":{"CHANGELOG.md":"e70d1a5fa6697a8b24e193e3934975317df12279c167b90fcb9616291792197c","Cargo.lock":"0f4e59f28bdd52c4781d102fc7d1f16d1ea417aaec0a4846432444a4019b2537","Cargo.toml":"c8334f658b699a1a0e25d997d752a9493a627f9ddcb7aab739c7319ea583882f","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"5734ed989dfca1f625b40281ee9f4530f91b2411ec01cb748223e7eb87e201ab","LICENSE-THIRD-PARTY":"b16db96b93b1d7cf7bea533f572091ec6bca3234fbe0a83038be772ff391a44c","README.md":"415a71d4978cfd338a6ae1f1b41284652eccd277a815542c304647dc437a8274","benches/crossbeam.rs":"96cb1abd23cac3ef8a7174a802e94609926b555bb02c9658c78723d433f1dd92","examples/fibonacci.rs":"4e88fa40048cdc31e9c7bb60347d46f92543d7ddf39cab3b52bfe44affdb6a02","examples/matching.rs":"63c250e164607a7a9f643d46f107bb5da846d49e89cf9069909562d20e530f71","examples/stopwatch.rs":"d02121258f08d56f1eb7997e19bcb9bacb6836cfa0abbba90a9e59d8a50ae5cf","src/channel.rs":"a9baaad2f414c38cd324a60ac9375ca58462ce6662217683648e9b66cec43a8c","src/context.rs":"ff4d39639ddf16aaab582d4a5f3d10ef2c71afe1abbf4e60f3d9d2ddbd72c230","src/counter.rs":"c49a9f44587888850edeb62f7c8ecd1acecb39c836834254ff3ac934c478440a","src/err.rs":"fdbde7279a1e74973e5c7d3e835a97836229a357fe465c0ba1a37f2a012d1bef","src/flavors/array.rs":"853c2ad068f912cfb49877bcd41e241f34b25026b709bf0629523f19952e3adc","src/flavors/at.rs":"65bf870b3ddb14738256706b0276f2656ad1fe9cd8eb91737489868edd088e92","src/flavors/list.rs":"50dbe59616c39b5aa184470023ce0cfb1cb0dbd92e1577375d299446981527c0","src/flavors/mod.rs":"3d9d43bc38b0adb18c96c995c2bd3421d8e33ab6c30b20c3c467d21d48e485dc","src/flavors/never.rs":"0e7921922d00c711552fb063c63c78192fa6ddc0762fb81c1713b847495ec39a","src/flavors/tick.rs":"38a479b9f4a72a5ccb9c407a1e7b44d36b6ad0f4e214e39266b12b9564c803dc","src/flavors/zero.rs":"012a53f56b86df22ce49866da95e5f457fb99a18a098f0f64779c6d1cdd7092f","src/lib.rs":"3a65706d4124844ffc4c8cb1f8cc779631ec94f449f85cbb68364ad3619404f1","src/select.rs":"66eb10a6cbdf8dd0869f2a7cac9992fdaee36c9e2a01d708d39d7c794572935b","src/select_macro.rs":"96bc9acb9a22588a4e733b0ab0761ad2be9a6b3e03744e8fc9c6de9ae433b696","src/utils.rs":"746fe315d6cfc832e3dda35e5055c0fd5c99907f1303b2ea7eacc4e37c8527e1","src/waker.rs":"591ee70bf62ccad5aa2fac7b92d444183b02790a79c024f016c78de2396d08a3","tests/after.rs":"0154a8e152880db17a20514ecdd49dabc361d3629858d119b9746b5e932c780c","tests/array.rs":"e5f25e8991863a9a86d61a66be646d04feae527f35b1697fd215b97af4383736","tests/golang.rs":"dc85669c9c4e902b1bb263d00f5cb6f9ecb6d42b19fe53425b55ce97c887da49","tests/iter.rs":"25dc02135bbae9d47a30f9047661648e66bdc134e40ba78bc2fbacbb8b3819bc","tests/list.rs":"de865ef097f3bcb35c1c814554e6108fed43b3dbb1533c8bbcf8688cceb6b6ab","tests/mpsc.rs":"401aa3c6923815058881ddce98070df68ebab283913c89c007436bb8af7ca0ea","tests/never.rs":"ee40c4fc4dd5af4983fae8de6927f52b81174d222c162f745b26c4a6c7108e4f","tests/ready.rs":"d349702f123925a0781b48d677e6dcf64fc5d1fc788a7bf1e151a3d57e81871c","tests/same_channel.rs":"2bab761443671e841e1b2476bd8082d75533a2f6be7946f5dbcee67cdc82dccb","tests/select.rs":"d20259a45f387cbce80c2c876ae81ea3883f36ea01c5151c159d58c362f6ba07","tests/select_macro.rs":"d3af2dc98e0dd03dc4ffab464b8ccb2f8b7504e8bb830948a04c015b92f0b296","tests/thread_locals.rs":"a1ce59e2aff69161621c0cb215eb6ea238088c06a31a8507a74cf179fd5a4299","tests/tick.rs":"5f697bd14c48505d932e82065b5302ef668e1cc19cac18e8ac22e0c83c221c1d","tests/zero.rs":"afbd838001d4196daddf17133e60ccea31529cc48ee01e245ac0d6366d1e30b9"},"package":"e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa"} -\ No newline at end of file -+{"files":{"CHANGELOG.md":"74ac49b84461217698d4430f81b1cdcba0595bc4e57216ffc52b8296ac44cd41","Cargo.lock":"7956079bcac40cc40c894f0260266365ecdb1c01c48636ae4c4080977603e7b8","Cargo.toml":"6a7acaffaa30dab2b5ea1f5ab86b20bc97370314ed03472288745b3b969786dc","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"5734ed989dfca1f625b40281ee9f4530f91b2411ec01cb748223e7eb87e201ab","LICENSE-THIRD-PARTY":"b16db96b93b1d7cf7bea533f572091ec6bca3234fbe0a83038be772ff391a44c","README.md":"415a71d4978cfd338a6ae1f1b41284652eccd277a815542c304647dc437a8274","benches/crossbeam.rs":"f5720508d3458f2451271b9887f7557823304bd38288c928b0d6aa1f459865e5","examples/fibonacci.rs":"6a26ecd74c7493d2c93f4280c0804afc19adc612b77b3d9fea433119ff472a44","examples/matching.rs":"63c250e164607a7a9f643d46f107bb5da846d49e89cf9069909562d20e530f71","examples/stopwatch.rs":"f9a00477b41823199e4af06bddeb0c6cfd22e272340eec1b98b333fc59ee6a1f","src/channel.rs":"a9baaad2f414c38cd324a60ac9375ca58462ce6662217683648e9b66cec43a8c","src/context.rs":"ad24cabfc50dd5e6ae84aa46a0246da12da1f1a6fa19043244ad25136075c6ca","src/counter.rs":"c49a9f44587888850edeb62f7c8ecd1acecb39c836834254ff3ac934c478440a","src/err.rs":"fdbde7279a1e74973e5c7d3e835a97836229a357fe465c0ba1a37f2a012d1bef","src/flavors/array.rs":"c125146771265058ac320226456b1e21667e93649531a3d20157f71cd715881d","src/flavors/at.rs":"65bf870b3ddb14738256706b0276f2656ad1fe9cd8eb91737489868edd088e92","src/flavors/list.rs":"50dbe59616c39b5aa184470023ce0cfb1cb0dbd92e1577375d299446981527c0","src/flavors/mod.rs":"3d9d43bc38b0adb18c96c995c2bd3421d8e33ab6c30b20c3c467d21d48e485dc","src/flavors/never.rs":"0e7921922d00c711552fb063c63c78192fa6ddc0762fb81c1713b847495ec39a","src/flavors/tick.rs":"38a479b9f4a72a5ccb9c407a1e7b44d36b6ad0f4e214e39266b12b9564c803dc","src/flavors/zero.rs":"1bda0c5483b04d53f36f9f4a6fe6f87b69f698068771e637e224c09400c6ce83","src/lib.rs":"3a65706d4124844ffc4c8cb1f8cc779631ec94f449f85cbb68364ad3619404f1","src/select.rs":"4eb4b1988c5dffff3e3d2138d14a1b86613bf62b78c45a5c70f65aaee92c11bb","src/select_macro.rs":"96bc9acb9a22588a4e733b0ab0761ad2be9a6b3e03744e8fc9c6de9ae433b696","src/utils.rs":"746fe315d6cfc832e3dda35e5055c0fd5c99907f1303b2ea7eacc4e37c8527e1","src/waker.rs":"9058cc441d467539c439ef88f0be1a187bf122d26fc116ce3e3a0265a693761f","tests/after.rs":"324c7d773f72bef62d150171f74ba7b7ac1b06f6030b3d4d2b1a35d211956b21","tests/array.rs":"574bff53aff0b0a8c365bf3f9ad77bb64675df9e6e0714be9c16eeeeac22e4d5","tests/golang.rs":"ec03806945fecd381cfce0634e2d776741423589c92e1bd4d8a431ac20f5d2d0","tests/iter.rs":"7563dc7fdf4c63e31dd74ee3fedecdd3aed490f7ef599b98f6f75f929cf79edb","tests/list.rs":"cc2971e69fd7f6a94b5463c9d4e9079df7955b37552e16dd66f4c6e65db60d96","tests/mpsc.rs":"0c4c6b056f5cec77ca19eca45f99b083632700a4b67133e88071a1d22a61d6fe","tests/never.rs":"665441a9fb004f7cd44047619637ebe6766cf2faf58e68e6481397bbfc682e11","tests/ready.rs":"eae3d7f16e817e63f3a6ceda062fece3de5e11c7a9631b32b02f23396a9d59c1","tests/same_channel.rs":"2bab761443671e841e1b2476bd8082d75533a2f6be7946f5dbcee67cdc82dccb","tests/select.rs":"3603f450b23f5e0d1e4014a167a9b23ab149b5f418c8b89636f1c02c90501569","tests/select_macro.rs":"00dd7963f79b96abf30851fdab29e86c8424b502a8a7d34abf4bc1714f493ecf","tests/thread_locals.rs":"3611db5502e6af0a8d15187d09fd195381819795544208b946e9f99b04579a81","tests/tick.rs":"dc4a7d3c8dd888ce135fe8a8c67f5dc8b5ab0c3fa57a48459f96d51fa0f1e6d5","tests/zero.rs":"0ff0587cc74569bfe389e0c619217799a960a0dfc5e6354603c88e6eea1b79a1"},"package":"06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4"} -\ No newline at end of file -diff -up firefox-98.0/third_party/rust/crossbeam-channel/Cargo.lock.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/Cargo.lock ---- firefox-98.0/third_party/rust/crossbeam-channel/Cargo.lock.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/Cargo.lock 2022-03-16 09:33:31.993159893 +0100 -@@ -3,6 +3,12 @@ - version = 3 - - [[package]] -+name = "autocfg" -+version = "1.0.1" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" -+ -+[[package]] - name = "cfg-if" - version = "1.0.0" - source = "registry+https://github.com/rust-lang/crates.io-index" -@@ -10,7 +16,7 @@ checksum = "baf1de4339761588bc0619e3cbc0 - - [[package]] - name = "crossbeam-channel" --version = "0.5.2" -+version = "0.5.1" - dependencies = [ - "cfg-if", - "crossbeam-utils", -@@ -21,19 +27,20 @@ dependencies = [ - - [[package]] - name = "crossbeam-utils" --version = "0.8.6" -+version = "0.8.3" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" -+checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49" - dependencies = [ -+ "autocfg", - "cfg-if", - "lazy_static", - ] - - [[package]] - name = "getrandom" --version = "0.2.3" -+version = "0.2.2" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" -+checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" - dependencies = [ - "cfg-if", - "libc", -@@ -42,9 +49,9 @@ dependencies = [ - - [[package]] - name = "hermit-abi" --version = "0.1.19" -+version = "0.1.18" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -+checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" - dependencies = [ - "libc", - ] -@@ -57,15 +64,15 @@ checksum = "e2abad23fbc42b3700f2f279844d - - [[package]] - name = "libc" --version = "0.2.112" -+version = "0.2.93" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125" -+checksum = "9385f66bf6105b241aa65a61cb923ef20efc665cb9f9bb50ac2f0c4b7f378d41" - - [[package]] - name = "num_cpus" --version = "1.13.1" -+version = "1.13.0" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" -+checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" - dependencies = [ - "hermit-abi", - "libc", -@@ -73,15 +80,15 @@ dependencies = [ - - [[package]] - name = "ppv-lite86" --version = "0.2.16" -+version = "0.2.10" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" -+checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" - - [[package]] - name = "rand" --version = "0.8.4" -+version = "0.8.3" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" -+checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" - dependencies = [ - "libc", - "rand_chacha", -@@ -91,9 +98,9 @@ dependencies = [ - - [[package]] - name = "rand_chacha" --version = "0.3.1" -+version = "0.3.0" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -+checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" - dependencies = [ - "ppv-lite86", - "rand_core", -@@ -101,27 +108,27 @@ dependencies = [ - - [[package]] - name = "rand_core" --version = "0.6.3" -+version = "0.6.2" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" -+checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" - dependencies = [ - "getrandom", - ] - - [[package]] - name = "rand_hc" --version = "0.3.1" -+version = "0.3.0" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" -+checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" - dependencies = [ - "rand_core", - ] - - [[package]] - name = "signal-hook" --version = "0.3.13" -+version = "0.3.8" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "647c97df271007dcea485bb74ffdb57f2e683f1306c854f468a0c244badabf2d" -+checksum = "ef33d6d0cd06e0840fba9985aab098c147e67e05cee14d412d3345ed14ff30ac" - dependencies = [ - "libc", - "signal-hook-registry", -@@ -129,9 +136,9 @@ dependencies = [ - - [[package]] - name = "signal-hook-registry" --version = "1.4.0" -+version = "1.3.0" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" -+checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" - dependencies = [ - "libc", - ] -diff -up firefox-98.0/third_party/rust/crossbeam-channel/Cargo.toml.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/Cargo.toml ---- firefox-98.0/third_party/rust/crossbeam-channel/Cargo.toml.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/Cargo.toml 2022-03-16 09:33:31.993159893 +0100 -@@ -3,19 +3,21 @@ - # When uploading crates to the registry Cargo will automatically - # "normalize" Cargo.toml files for maximal compatibility - # with all versions of Cargo and also rewrite `path` dependencies --# to registry (e.g., crates.io) dependencies. -+# to registry (e.g., crates.io) dependencies - # --# If you are reading this file be aware that the original Cargo.toml --# will likely look very different (and much more reasonable). --# See Cargo.toml.orig for the original contents. -+# If you believe there's an error in this file please file an -+# issue against the rust-lang/cargo repository. If you're -+# editing this file be aware that the upstream Cargo.toml -+# will likely look very different (and much more reasonable) - - [package] - edition = "2018" --rust-version = "1.36" - name = "crossbeam-channel" --version = "0.5.2" -+version = "0.5.1" -+authors = ["The Crossbeam Project Developers"] - description = "Multi-producer multi-consumer channels for message passing" - homepage = "https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-channel" -+documentation = "https://docs.rs/crossbeam-channel" - keywords = ["channel", "mpmc", "select", "golang", "message"] - categories = ["algorithms", "concurrency", "data-structures"] - license = "MIT OR Apache-2.0" -diff -up firefox-98.0/third_party/rust/crossbeam-channel/CHANGELOG.md.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/CHANGELOG.md ---- firefox-98.0/third_party/rust/crossbeam-channel/CHANGELOG.md.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/CHANGELOG.md 2022-03-16 09:33:31.993159893 +0100 -@@ -1,7 +1,3 @@ --# Version 0.5.2 -- --- Fix stacked borrows violations. (#763, #764) -- - # Version 0.5.1 - - - Fix memory leak in unbounded channel. (#669) -diff -up firefox-98.0/third_party/rust/crossbeam-channel/examples/fibonacci.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/examples/fibonacci.rs ---- firefox-98.0/third_party/rust/crossbeam-channel/examples/fibonacci.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/examples/fibonacci.rs 2022-03-16 09:33:31.993159893 +0100 -@@ -10,7 +10,7 @@ fn fibonacci(sender: Sender) { - while sender.send(x).is_ok() { - let tmp = x; - x = y; -- y += tmp; -+ y = tmp + y; - } - } - -diff -up firefox-98.0/third_party/rust/crossbeam-channel/examples/stopwatch.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/examples/stopwatch.rs ---- firefox-98.0/third_party/rust/crossbeam-channel/examples/stopwatch.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/examples/stopwatch.rs 2022-03-16 09:33:31.993159893 +0100 -@@ -33,7 +33,11 @@ fn main() { - - // Prints the elapsed time. - fn show(dur: Duration) { -- println!("Elapsed: {}.{:03} sec", dur.as_secs(), dur.subsec_millis()); -+ println!( -+ "Elapsed: {}.{:03} sec", -+ dur.as_secs(), -+ dur.subsec_nanos() / 1_000_000 -+ ); - } - - let start = Instant::now(); -diff -up firefox-98.0/third_party/rust/crossbeam-channel/src/context.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/src/context.rs ---- firefox-98.0/third_party/rust/crossbeam-channel/src/context.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/src/context.rs 2022-03-16 09:33:31.993159893 +0100 -@@ -1,8 +1,7 @@ - //! Thread-local context used in select. - - use std::cell::Cell; --use std::ptr; --use std::sync::atomic::{AtomicPtr, AtomicUsize, Ordering}; -+use std::sync::atomic::{AtomicUsize, Ordering}; - use std::sync::Arc; - use std::thread::{self, Thread, ThreadId}; - use std::time::Instant; -@@ -12,7 +11,6 @@ use crossbeam_utils::Backoff; - use crate::select::Selected; - - /// Thread-local context used in select. --// This is a private API that is used by the select macro. - #[derive(Debug, Clone)] - pub struct Context { - inner: Arc, -@@ -25,7 +23,7 @@ struct Inner { - select: AtomicUsize, - - /// A slot into which another thread may store a pointer to its `Packet`. -- packet: AtomicPtr<()>, -+ packet: AtomicUsize, - - /// Thread handle. - thread: Thread, -@@ -47,7 +45,7 @@ impl Context { - } - - let mut f = Some(f); -- let mut f = |cx: &Context| -> R { -+ let mut f = move |cx: &Context| -> R { - let f = f.take().unwrap(); - f(cx) - }; -@@ -71,7 +69,7 @@ impl Context { - Context { - inner: Arc::new(Inner { - select: AtomicUsize::new(Selected::Waiting.into()), -- packet: AtomicPtr::new(ptr::null_mut()), -+ packet: AtomicUsize::new(0), - thread: thread::current(), - thread_id: thread::current().id(), - }), -@@ -84,7 +82,7 @@ impl Context { - self.inner - .select - .store(Selected::Waiting.into(), Ordering::Release); -- self.inner.packet.store(ptr::null_mut(), Ordering::Release); -+ self.inner.packet.store(0, Ordering::Release); - } - - /// Attempts to select an operation. -@@ -114,19 +112,19 @@ impl Context { - /// - /// This method must be called after `try_select` succeeds and there is a packet to provide. - #[inline] -- pub fn store_packet(&self, packet: *mut ()) { -- if !packet.is_null() { -+ pub fn store_packet(&self, packet: usize) { -+ if packet != 0 { - self.inner.packet.store(packet, Ordering::Release); - } - } - - /// Waits until a packet is provided and returns it. - #[inline] -- pub fn wait_packet(&self) -> *mut () { -+ pub fn wait_packet(&self) -> usize { - let backoff = Backoff::new(); - loop { - let packet = self.inner.packet.load(Ordering::Acquire); -- if !packet.is_null() { -+ if packet != 0 { - return packet; - } - backoff.snooze(); -diff -up firefox-98.0/third_party/rust/crossbeam-channel/src/flavors/array.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/src/flavors/array.rs ---- firefox-98.0/third_party/rust/crossbeam-channel/src/flavors/array.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/src/flavors/array.rs 2022-03-16 09:33:31.993159893 +0100 -@@ -10,7 +10,7 @@ - - use std::cell::UnsafeCell; - use std::marker::PhantomData; --use std::mem::MaybeUninit; -+use std::mem::{self, MaybeUninit}; - use std::ptr; - use std::sync::atomic::{self, AtomicUsize, Ordering}; - use std::time::Instant; -@@ -110,7 +110,7 @@ impl Channel { - // Allocate a buffer of `cap` slots initialized - // with stamps. - let buffer = { -- let boxed: Box<[Slot]> = (0..cap) -+ let mut boxed: Box<[Slot]> = (0..cap) - .map(|i| { - // Set the stamp to `{ lap: 0, mark: 0, index: i }`. - Slot { -@@ -119,7 +119,9 @@ impl Channel { - } - }) - .collect(); -- Box::into_raw(boxed) as *mut Slot -+ let ptr = boxed.as_mut_ptr(); -+ mem::forget(boxed); -+ ptr - }; - - Channel { -diff -up firefox-98.0/third_party/rust/crossbeam-channel/src/flavors/zero.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/src/flavors/zero.rs ---- firefox-98.0/third_party/rust/crossbeam-channel/src/flavors/zero.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/src/flavors/zero.rs 2022-03-16 09:33:31.993159893 +0100 -@@ -6,7 +6,6 @@ use std::cell::UnsafeCell; - use std::marker::PhantomData; - use std::sync::atomic::{AtomicBool, Ordering}; - use std::time::Instant; --use std::{fmt, ptr}; - - use crossbeam_utils::Backoff; - -@@ -17,19 +16,7 @@ use crate::utils::Spinlock; - use crate::waker::Waker; - - /// A pointer to a packet. --pub struct ZeroToken(*mut ()); -- --impl Default for ZeroToken { -- fn default() -> Self { -- Self(ptr::null_mut()) -- } --} -- --impl fmt::Debug for ZeroToken { -- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { -- fmt::Debug::fmt(&(self.0 as usize), f) -- } --} -+pub(crate) type ZeroToken = usize; - - /// A slot for passing one message from a sender to a receiver. - struct Packet { -@@ -130,10 +117,10 @@ impl Channel { - - // If there's a waiting receiver, pair up with it. - if let Some(operation) = inner.receivers.try_select() { -- token.zero.0 = operation.packet; -+ token.zero = operation.packet; - true - } else if inner.is_disconnected { -- token.zero.0 = ptr::null_mut(); -+ token.zero = 0; - true - } else { - false -@@ -143,11 +130,11 @@ impl Channel { - /// Writes a message into the packet. - pub(crate) unsafe fn write(&self, token: &mut Token, msg: T) -> Result<(), T> { - // If there is no packet, the channel is disconnected. -- if token.zero.0.is_null() { -+ if token.zero == 0 { - return Err(msg); - } - -- let packet = &*(token.zero.0 as *const Packet); -+ let packet = &*(token.zero as *const Packet); - packet.msg.get().write(Some(msg)); - packet.ready.store(true, Ordering::Release); - Ok(()) -@@ -159,10 +146,10 @@ impl Channel { - - // If there's a waiting sender, pair up with it. - if let Some(operation) = inner.senders.try_select() { -- token.zero.0 = operation.packet; -+ token.zero = operation.packet; - true - } else if inner.is_disconnected { -- token.zero.0 = ptr::null_mut(); -+ token.zero = 0; - true - } else { - false -@@ -172,11 +159,11 @@ impl Channel { - /// Reads a message from the packet. - pub(crate) unsafe fn read(&self, token: &mut Token) -> Result { - // If there is no packet, the channel is disconnected. -- if token.zero.0.is_null() { -+ if token.zero == 0 { - return Err(()); - } - -- let packet = &*(token.zero.0 as *const Packet); -+ let packet = &*(token.zero as *const Packet); - - if packet.on_stack { - // The message has been in the packet from the beginning, so there is no need to wait -@@ -190,7 +177,7 @@ impl Channel { - // heap-allocated packet. - packet.wait_ready(); - let msg = packet.msg.get().replace(None).unwrap(); -- drop(Box::from_raw(token.zero.0 as *mut Packet)); -+ drop(Box::from_raw(packet as *const Packet as *mut Packet)); - Ok(msg) - } - } -@@ -202,7 +189,7 @@ impl Channel { - - // If there's a waiting receiver, pair up with it. - if let Some(operation) = inner.receivers.try_select() { -- token.zero.0 = operation.packet; -+ token.zero = operation.packet; - drop(inner); - unsafe { - self.write(token, msg).ok().unwrap(); -@@ -226,7 +213,7 @@ impl Channel { - - // If there's a waiting receiver, pair up with it. - if let Some(operation) = inner.receivers.try_select() { -- token.zero.0 = operation.packet; -+ token.zero = operation.packet; - drop(inner); - unsafe { - self.write(token, msg).ok().unwrap(); -@@ -241,10 +228,10 @@ impl Channel { - Context::with(|cx| { - // Prepare for blocking until a receiver wakes us up. - let oper = Operation::hook(token); -- let mut packet = Packet::::message_on_stack(msg); -+ let packet = Packet::::message_on_stack(msg); - inner - .senders -- .register_with_packet(oper, &mut packet as *mut Packet as *mut (), cx); -+ .register_with_packet(oper, &packet as *const Packet as usize, cx); - inner.receivers.notify(); - drop(inner); - -@@ -279,7 +266,7 @@ impl Channel { - - // If there's a waiting sender, pair up with it. - if let Some(operation) = inner.senders.try_select() { -- token.zero.0 = operation.packet; -+ token.zero = operation.packet; - drop(inner); - unsafe { self.read(token).map_err(|_| TryRecvError::Disconnected) } - } else if inner.is_disconnected { -@@ -296,7 +283,7 @@ impl Channel { - - // If there's a waiting sender, pair up with it. - if let Some(operation) = inner.senders.try_select() { -- token.zero.0 = operation.packet; -+ token.zero = operation.packet; - drop(inner); - unsafe { - return self.read(token).map_err(|_| RecvTimeoutError::Disconnected); -@@ -310,12 +297,10 @@ impl Channel { - Context::with(|cx| { - // Prepare for blocking until a sender wakes us up. - let oper = Operation::hook(token); -- let mut packet = Packet::::empty_on_stack(); -- inner.receivers.register_with_packet( -- oper, -- &mut packet as *mut Packet as *mut (), -- cx, -- ); -+ let packet = Packet::::empty_on_stack(); -+ inner -+ .receivers -+ .register_with_packet(oper, &packet as *const Packet as usize, cx); - inner.senders.notify(); - drop(inner); - -@@ -400,7 +385,7 @@ impl SelectHandle for Receiver<'_, T> - let mut inner = self.0.inner.lock(); - inner - .receivers -- .register_with_packet(oper, packet as *mut (), cx); -+ .register_with_packet(oper, packet as usize, cx); - inner.senders.notify(); - inner.senders.can_select() || inner.is_disconnected - } -@@ -414,7 +399,7 @@ impl SelectHandle for Receiver<'_, T> - } - - fn accept(&self, token: &mut Token, cx: &Context) -> bool { -- token.zero.0 = cx.wait_packet(); -+ token.zero = cx.wait_packet(); - true - } - -@@ -450,7 +435,7 @@ impl SelectHandle for Sender<'_, T> { - let mut inner = self.0.inner.lock(); - inner - .senders -- .register_with_packet(oper, packet as *mut (), cx); -+ .register_with_packet(oper, packet as usize, cx); - inner.receivers.notify(); - inner.receivers.can_select() || inner.is_disconnected - } -@@ -464,7 +449,7 @@ impl SelectHandle for Sender<'_, T> { - } - - fn accept(&self, token: &mut Token, cx: &Context) -> bool { -- token.zero.0 = cx.wait_packet(); -+ token.zero = cx.wait_packet(); - true - } - -diff -up firefox-98.0/third_party/rust/crossbeam-channel/src/select.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/src/select.rs ---- firefox-98.0/third_party/rust/crossbeam-channel/src/select.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/src/select.rs 2022-03-16 09:33:31.993159893 +0100 -@@ -19,7 +19,6 @@ use crate::utils; - /// `read` or `write`. - /// - /// Each field contains data associated with a specific channel flavor. --// This is a private API that is used by the select macro. - #[derive(Debug, Default)] - pub struct Token { - pub at: flavors::at::AtToken, -@@ -94,7 +93,6 @@ impl Into for Selected { - /// - /// This is a handle that assists select in executing an operation, registration, deciding on the - /// appropriate deadline for blocking, etc. --// This is a private API (exposed inside crossbeam_channel::internal module) that is used by the select macro. - pub trait SelectHandle { - /// Attempts to select an operation and returns `true` on success. - fn try_select(&self, token: &mut Token) -> bool; -@@ -444,7 +442,6 @@ fn run_ready( - } - - /// Attempts to select one of the operations without blocking. --// This is a private API (exposed inside crossbeam_channel::internal module) that is used by the select macro. - #[inline] - pub fn try_select<'a>( - handles: &mut [(&'a dyn SelectHandle, usize, *const u8)], -@@ -461,7 +458,6 @@ pub fn try_select<'a>( - } - - /// Blocks until one of the operations becomes ready and selects it. --// This is a private API (exposed inside crossbeam_channel::internal module) that is used by the select macro. - #[inline] - pub fn select<'a>( - handles: &mut [(&'a dyn SelectHandle, usize, *const u8)], -@@ -480,7 +476,6 @@ pub fn select<'a>( - } - - /// Blocks for a limited time until one of the operations becomes ready and selects it. --// This is a private API (exposed inside crossbeam_channel::internal module) that is used by the select macro. - #[inline] - pub fn select_timeout<'a>( - handles: &mut [(&'a dyn SelectHandle, usize, *const u8)], -diff -up firefox-98.0/third_party/rust/crossbeam-channel/src/waker.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/src/waker.rs ---- firefox-98.0/third_party/rust/crossbeam-channel/src/waker.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/src/waker.rs 2022-03-16 09:33:31.993159893 +0100 -@@ -1,6 +1,5 @@ - //! Waking mechanism for threads blocked on channel operations. - --use std::ptr; - use std::sync::atomic::{AtomicBool, Ordering}; - use std::thread::{self, ThreadId}; - -@@ -14,7 +13,7 @@ pub(crate) struct Entry { - pub(crate) oper: Operation, - - /// Optional packet. -- pub(crate) packet: *mut (), -+ pub(crate) packet: usize, - - /// Context associated with the thread owning this operation. - pub(crate) cx: Context, -@@ -45,12 +44,12 @@ impl Waker { - /// Registers a select operation. - #[inline] - pub(crate) fn register(&mut self, oper: Operation, cx: &Context) { -- self.register_with_packet(oper, ptr::null_mut(), cx); -+ self.register_with_packet(oper, 0, cx); - } - - /// Registers a select operation and a packet. - #[inline] -- pub(crate) fn register_with_packet(&mut self, oper: Operation, packet: *mut (), cx: &Context) { -+ pub(crate) fn register_with_packet(&mut self, oper: Operation, packet: usize, cx: &Context) { - self.selectors.push(Entry { - oper, - packet, -@@ -77,26 +76,34 @@ impl Waker { - /// Attempts to find another thread's entry, select the operation, and wake it up. - #[inline] - pub(crate) fn try_select(&mut self) -> Option { -- self.selectors -- .iter() -- .position(|selector| { -+ let mut entry = None; -+ -+ if !self.selectors.is_empty() { -+ let thread_id = current_thread_id(); -+ -+ for i in 0..self.selectors.len() { - // Does the entry belong to a different thread? -- selector.cx.thread_id() != current_thread_id() -- && selector // Try selecting this operation. -- .cx -- .try_select(Selected::Operation(selector.oper)) -- .is_ok() -- && { -+ if self.selectors[i].cx.thread_id() != thread_id { -+ // Try selecting this operation. -+ let sel = Selected::Operation(self.selectors[i].oper); -+ let res = self.selectors[i].cx.try_select(sel); -+ -+ if res.is_ok() { - // Provide the packet. -- selector.cx.store_packet(selector.packet); -+ self.selectors[i].cx.store_packet(self.selectors[i].packet); - // Wake the thread up. -- selector.cx.unpark(); -- true -+ self.selectors[i].cx.unpark(); -+ -+ // Remove the entry from the queue to keep it clean and improve -+ // performance. -+ entry = Some(self.selectors.remove(i)); -+ break; - } -- }) -- // Remove the entry from the queue to keep it clean and improve -- // performance. -- .map(|pos| self.selectors.remove(pos)) -+ } -+ } -+ } -+ -+ entry - } - - /// Returns `true` if there is an entry which can be selected by the current thread. -@@ -118,7 +125,7 @@ impl Waker { - pub(crate) fn watch(&mut self, oper: Operation, cx: &Context) { - self.observers.push(Entry { - oper, -- packet: ptr::null_mut(), -+ packet: 0, - cx: cx.clone(), - }); - } -@@ -262,7 +269,7 @@ impl SyncWaker { - impl Drop for SyncWaker { - #[inline] - fn drop(&mut self) { -- debug_assert!(self.is_empty.load(Ordering::SeqCst)); -+ debug_assert_eq!(self.is_empty.load(Ordering::SeqCst), true); - } - } - -diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/after.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/after.rs ---- firefox-98.0/third_party/rust/crossbeam-channel/tests/after.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/tests/after.rs 2022-03-16 09:33:31.993159893 +0100 -@@ -1,7 +1,5 @@ - //! Tests for the after channel flavor. - --#![cfg(not(miri))] // TODO: many assertions failed due to Miri is slow -- - use std::sync::atomic::AtomicUsize; - use std::sync::atomic::Ordering; - use std::thread; -@@ -58,20 +56,20 @@ fn len_empty_full() { - let r = after(ms(50)); - - assert_eq!(r.len(), 0); -- assert!(r.is_empty()); -- assert!(!r.is_full()); -+ assert_eq!(r.is_empty(), true); -+ assert_eq!(r.is_full(), false); - - thread::sleep(ms(100)); - - assert_eq!(r.len(), 1); -- assert!(!r.is_empty()); -- assert!(r.is_full()); -+ assert_eq!(r.is_empty(), false); -+ assert_eq!(r.is_full(), true); - - r.try_recv().unwrap(); - - assert_eq!(r.len(), 0); -- assert!(r.is_empty()); -- assert!(!r.is_full()); -+ assert_eq!(r.is_empty(), true); -+ assert_eq!(r.is_full(), false); - } - - #[test] -@@ -213,7 +211,7 @@ fn select() { - break; - } - i => { -- oper.recv(v[i]).unwrap(); -+ oper.recv(&v[i]).unwrap(); - hits.fetch_add(1, Ordering::SeqCst); - } - } -diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/array.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/array.rs ---- firefox-98.0/third_party/rust/crossbeam-channel/tests/array.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/tests/array.rs 2022-03-16 09:33:31.994159927 +0100 -@@ -1,7 +1,5 @@ - //! Tests for the array channel flavor. - --#![cfg(not(miri))] // TODO: many assertions failed due to Miri is slow -- - use std::any::Any; - use std::sync::atomic::AtomicUsize; - use std::sync::atomic::Ordering; -@@ -45,38 +43,38 @@ fn len_empty_full() { - let (s, r) = bounded(2); - - assert_eq!(s.len(), 0); -- assert!(s.is_empty()); -- assert!(!s.is_full()); -+ assert_eq!(s.is_empty(), true); -+ assert_eq!(s.is_full(), false); - assert_eq!(r.len(), 0); -- assert!(r.is_empty()); -- assert!(!r.is_full()); -+ assert_eq!(r.is_empty(), true); -+ assert_eq!(r.is_full(), false); - - s.send(()).unwrap(); - - assert_eq!(s.len(), 1); -- assert!(!s.is_empty()); -- assert!(!s.is_full()); -+ assert_eq!(s.is_empty(), false); -+ assert_eq!(s.is_full(), false); - assert_eq!(r.len(), 1); -- assert!(!r.is_empty()); -- assert!(!r.is_full()); -+ assert_eq!(r.is_empty(), false); -+ assert_eq!(r.is_full(), false); - - s.send(()).unwrap(); - - assert_eq!(s.len(), 2); -- assert!(!s.is_empty()); -- assert!(s.is_full()); -+ assert_eq!(s.is_empty(), false); -+ assert_eq!(s.is_full(), true); - assert_eq!(r.len(), 2); -- assert!(!r.is_empty()); -- assert!(r.is_full()); -+ assert_eq!(r.is_empty(), false); -+ assert_eq!(r.is_full(), true); - - r.recv().unwrap(); - - assert_eq!(s.len(), 1); -- assert!(!s.is_empty()); -- assert!(!s.is_full()); -+ assert_eq!(s.is_empty(), false); -+ assert_eq!(s.is_full(), false); - assert_eq!(r.len(), 1); -- assert!(!r.is_empty()); -- assert!(!r.is_full()); -+ assert_eq!(r.is_empty(), false); -+ assert_eq!(r.is_full(), false); - } - - #[test] -diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/golang.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/golang.rs ---- firefox-98.0/third_party/rust/crossbeam-channel/tests/golang.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:40.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/tests/golang.rs 2022-03-16 09:33:31.994159927 +0100 -@@ -9,8 +9,6 @@ - //! - https://golang.org/LICENSE - //! - https://golang.org/PATENTS - --#![allow(clippy::mutex_atomic, clippy::redundant_clone)] -- - use std::alloc::{GlobalAlloc, Layout, System}; - use std::any::Any; - use std::cell::Cell; -@@ -178,7 +176,7 @@ unsafe impl GlobalAlloc for Counter { - if !ret.is_null() { - ALLOCATED.fetch_add(layout.size(), SeqCst); - } -- ret -+ return ret; - } - - unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { -@@ -234,9 +232,6 @@ macro_rules! go { - mod doubleselect { - use super::*; - -- #[cfg(miri)] -- const ITERATIONS: i32 = 100; -- #[cfg(not(miri))] - const ITERATIONS: i32 = 10_000; - - fn sender(n: i32, c1: Chan, c2: Chan, c3: Chan, c4: Chan) { -@@ -696,11 +691,6 @@ mod select { - mod select2 { - use super::*; - -- #[cfg(miri)] -- const N: i32 = 1000; -- #[cfg(not(miri))] -- const N: i32 = 100000; -- - #[test] - fn main() { - fn sender(c: &Chan, n: i32) { -@@ -712,7 +702,9 @@ mod select2 { - fn receiver(c: &Chan, dummy: &Chan, n: i32) { - for _ in 0..n { - select! { -- recv(c.rx()) -> _ => {} -+ recv(c.rx()) -> _ => { -+ () -+ } - recv(dummy.rx()) -> _ => { - panic!("dummy"); - } -@@ -725,18 +717,15 @@ mod select2 { - - ALLOCATED.store(0, SeqCst); - -- go!(c, sender(&c, N)); -- receiver(&c, &dummy, N); -+ go!(c, sender(&c, 100000)); -+ receiver(&c, &dummy, 100000); - - let alloc = ALLOCATED.load(SeqCst); - -- go!(c, sender(&c, N)); -- receiver(&c, &dummy, N); -+ go!(c, sender(&c, 100000)); -+ receiver(&c, &dummy, 100000); - -- assert!( -- !(ALLOCATED.load(SeqCst) > alloc -- && (ALLOCATED.load(SeqCst) - alloc) > (N as usize + 10000)) -- ) -+ assert!(!(ALLOCATED.load(SeqCst) > alloc && (ALLOCATED.load(SeqCst) - alloc) > 110000)) - } - } - -@@ -924,9 +913,6 @@ mod chan_test { - - #[test] - fn test_chan() { -- #[cfg(miri)] -- const N: i32 = 20; -- #[cfg(not(miri))] - const N: i32 = 200; - - for cap in 0..N { -@@ -1066,9 +1052,6 @@ mod chan_test { - - #[test] - fn test_nonblock_recv_race() { -- #[cfg(miri)] -- const N: usize = 100; -- #[cfg(not(miri))] - const N: usize = 1000; - - for _ in 0..N { -@@ -1090,9 +1073,6 @@ mod chan_test { - - #[test] - fn test_nonblock_select_race() { -- #[cfg(miri)] -- const N: usize = 100; -- #[cfg(not(miri))] - const N: usize = 1000; - - let done = make::(1); -@@ -1126,9 +1106,6 @@ mod chan_test { - - #[test] - fn test_nonblock_select_race2() { -- #[cfg(miri)] -- const N: usize = 100; -- #[cfg(not(miri))] - const N: usize = 1000; - - let done = make::(1); -@@ -1165,11 +1142,6 @@ mod chan_test { - // Ensure that send/recv on the same chan in select - // does not crash nor deadlock. - -- #[cfg(miri)] -- const N: usize = 100; -- #[cfg(not(miri))] -- const N: usize = 1000; -- - for &cap in &[0, 10] { - let wg = WaitGroup::new(); - wg.add(2); -@@ -1179,7 +1151,7 @@ mod chan_test { - let p = p; - go!(wg, p, c, { - defer! { wg.done() } -- for i in 0..N { -+ for i in 0..1000 { - if p == 0 || i % 2 == 0 { - select! { - send(c.tx(), p) -> _ => {} -@@ -1208,11 +1180,6 @@ mod chan_test { - - #[test] - fn test_select_stress() { -- #[cfg(miri)] -- const N: usize = 100; -- #[cfg(not(miri))] -- const N: usize = 10000; -- - let c = vec![ - make::(0), - make::(0), -@@ -1220,6 +1187,8 @@ mod chan_test { - make::(3), - ]; - -+ const N: usize = 10000; -+ - // There are 4 goroutines that send N values on each of the chans, - // + 4 goroutines that receive N values on each of the chans, - // + 1 goroutine that sends N values on each of the chans in a single select, -@@ -1317,9 +1286,6 @@ mod chan_test { - - #[test] - fn test_select_fairness() { -- #[cfg(miri)] -- const TRIALS: usize = 100; -- #[cfg(not(miri))] - const TRIALS: usize = 10000; - - let c1 = make::(TRIALS + 1); -@@ -1403,9 +1369,6 @@ mod chan_test { - - #[test] - fn test_pseudo_random_send() { -- #[cfg(miri)] -- const N: usize = 20; -- #[cfg(not(miri))] - const N: usize = 100; - - for cap in 0..N { -@@ -1449,9 +1412,6 @@ mod chan_test { - #[test] - fn test_multi_consumer() { - const NWORK: usize = 23; -- #[cfg(miri)] -- const NITER: usize = 100; -- #[cfg(not(miri))] - const NITER: usize = 271828; - - let pn = [2, 3, 7, 11, 13, 17, 19, 23, 27, 31]; -@@ -1550,9 +1510,6 @@ mod chan1 { - use super::*; - - // sent messages -- #[cfg(miri)] -- const N: usize = 100; -- #[cfg(not(miri))] - const N: usize = 1000; - // receiving "goroutines" - const M: usize = 10; -diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/iter.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/iter.rs ---- firefox-98.0/third_party/rust/crossbeam-channel/tests/iter.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:40.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/tests/iter.rs 2022-03-16 09:33:31.994159927 +0100 -@@ -93,7 +93,7 @@ fn recv_into_iter_owned() { - - assert_eq!(iter.next().unwrap(), 1); - assert_eq!(iter.next().unwrap(), 2); -- assert!(iter.next().is_none()); -+ assert_eq!(iter.next().is_none(), true); - } - - #[test] -@@ -106,5 +106,5 @@ fn recv_into_iter_borrowed() { - let mut iter = (&r).into_iter(); - assert_eq!(iter.next().unwrap(), 1); - assert_eq!(iter.next().unwrap(), 2); -- assert!(iter.next().is_none()); -+ assert_eq!(iter.next().is_none(), true); - } -diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/list.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/list.rs ---- firefox-98.0/third_party/rust/crossbeam-channel/tests/list.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/tests/list.rs 2022-03-16 09:33:31.994159927 +0100 -@@ -41,29 +41,29 @@ fn len_empty_full() { - let (s, r) = unbounded(); - - assert_eq!(s.len(), 0); -- assert!(s.is_empty()); -- assert!(!s.is_full()); -+ assert_eq!(s.is_empty(), true); -+ assert_eq!(s.is_full(), false); - assert_eq!(r.len(), 0); -- assert!(r.is_empty()); -- assert!(!r.is_full()); -+ assert_eq!(r.is_empty(), true); -+ assert_eq!(r.is_full(), false); - - s.send(()).unwrap(); - - assert_eq!(s.len(), 1); -- assert!(!s.is_empty()); -- assert!(!s.is_full()); -+ assert_eq!(s.is_empty(), false); -+ assert_eq!(s.is_full(), false); - assert_eq!(r.len(), 1); -- assert!(!r.is_empty()); -- assert!(!r.is_full()); -+ assert_eq!(r.is_empty(), false); -+ assert_eq!(r.is_full(), false); - - r.recv().unwrap(); - - assert_eq!(s.len(), 0); -- assert!(s.is_empty()); -- assert!(!s.is_full()); -+ assert_eq!(s.is_empty(), true); -+ assert_eq!(s.is_full(), false); - assert_eq!(r.len(), 0); -- assert!(r.is_empty()); -- assert!(!r.is_full()); -+ assert_eq!(r.is_empty(), true); -+ assert_eq!(r.is_full(), false); - } - - #[test] -@@ -239,9 +239,6 @@ fn disconnect_wakes_receiver() { - - #[test] - fn spsc() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 100_000; - - let (s, r) = unbounded(); -@@ -264,9 +261,6 @@ fn spsc() { - - #[test] - fn mpmc() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 25_000; - const THREADS: usize = 4; - -@@ -301,9 +295,6 @@ fn mpmc() { - - #[test] - fn stress_oneshot() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - for _ in 0..COUNT { -@@ -319,9 +310,6 @@ fn stress_oneshot() { - - #[test] - fn stress_iter() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 100_000; - - let (request_s, request_r) = unbounded(); -@@ -383,11 +371,8 @@ fn stress_timeout_two_threads() { - .unwrap(); - } - --#[cfg_attr(miri, ignore)] // Miri is too slow - #[test] - fn drops() { -- const RUNS: usize = 100; -- - static DROPS: AtomicUsize = AtomicUsize::new(0); - - #[derive(Debug, PartialEq)] -@@ -401,7 +386,7 @@ fn drops() { - - let mut rng = thread_rng(); - -- for _ in 0..RUNS { -+ for _ in 0..100 { - let steps = rng.gen_range(0..10_000); - let additional = rng.gen_range(0..1000); - -@@ -436,9 +421,6 @@ fn drops() { - - #[test] - fn linearizable() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 25_000; - const THREADS: usize = 4; - -@@ -459,9 +441,6 @@ fn linearizable() { - - #[test] - fn fairness() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - let (s1, r1) = unbounded::<()>(); -@@ -484,9 +463,6 @@ fn fairness() { - - #[test] - fn fairness_duplicates() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - let (s, r) = unbounded(); -@@ -520,9 +496,6 @@ fn recv_in_send() { - - #[test] - fn channel_through_channel() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 1000; - - type T = Box; -diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/mpsc.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/mpsc.rs ---- firefox-98.0/third_party/rust/crossbeam-channel/tests/mpsc.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/tests/mpsc.rs 2022-03-16 09:33:31.994159927 +0100 -@@ -20,12 +20,6 @@ - //! - https://github.com/rust-lang/rust/blob/master/COPYRIGHT - //! - https://www.rust-lang.org/en-US/legal.html - --#![allow( -- clippy::drop_copy, -- clippy::match_single_binding, -- clippy::redundant_clone --)] -- - use std::sync::mpsc::{RecvError, RecvTimeoutError, TryRecvError}; - use std::sync::mpsc::{SendError, TrySendError}; - use std::thread::JoinHandle; -@@ -182,7 +176,7 @@ macro_rules! select { - ) => ({ - cc::crossbeam_channel_internal! { - $( -- $meth(($rx).inner) -> res => { -+ recv(($rx).inner) -> res => { - let $name = res.map_err(|_| ::std::sync::mpsc::RecvError); - $code - } -@@ -320,18 +314,13 @@ mod channel_tests { - - #[test] - fn stress() { -- #[cfg(miri)] -- const COUNT: usize = 500; -- #[cfg(not(miri))] -- const COUNT: usize = 10000; -- - let (tx, rx) = channel::(); - let t = thread::spawn(move || { -- for _ in 0..COUNT { -+ for _ in 0..10000 { - tx.send(1).unwrap(); - } - }); -- for _ in 0..COUNT { -+ for _ in 0..10000 { - assert_eq!(rx.recv().unwrap(), 1); - } - t.join().ok().unwrap(); -@@ -339,9 +328,6 @@ mod channel_tests { - - #[test] - fn stress_shared() { -- #[cfg(miri)] -- const AMT: u32 = 500; -- #[cfg(not(miri))] - const AMT: u32 = 10000; - const NTHREADS: u32 = 8; - let (tx, rx) = channel::(); -@@ -350,7 +336,10 @@ mod channel_tests { - for _ in 0..AMT * NTHREADS { - assert_eq!(rx.recv().unwrap(), 1); - } -- assert!(rx.try_recv().is_err()); -+ match rx.try_recv() { -+ Ok(..) => panic!(), -+ _ => {} -+ } - }); - - let mut ts = Vec::with_capacity(NTHREADS as usize); -@@ -746,17 +735,12 @@ mod channel_tests { - - #[test] - fn recv_a_lot() { -- #[cfg(miri)] -- const N: usize = 100; -- #[cfg(not(miri))] -- const N: usize = 10000; -- - // Regression test that we don't run out of stack in scheduler context - let (tx, rx) = channel(); -- for _ in 0..N { -+ for _ in 0..10000 { - tx.send(()).unwrap(); - } -- for _ in 0..N { -+ for _ in 0..10000 { - rx.recv().unwrap(); - } - } -@@ -896,7 +880,7 @@ mod channel_tests { - }; - assert_eq!(iter.next().unwrap(), 1); - assert_eq!(iter.next().unwrap(), 2); -- assert!(iter.next().is_none()); -+ assert_eq!(iter.next().is_none(), true); - } - - #[test] -@@ -908,7 +892,7 @@ mod channel_tests { - let mut iter = (&rx).into_iter(); - assert_eq!(iter.next().unwrap(), 1); - assert_eq!(iter.next().unwrap(), 2); -- assert!(iter.next().is_none()); -+ assert_eq!(iter.next().is_none(), true); - } - - #[test] -@@ -1095,18 +1079,13 @@ mod sync_channel_tests { - - #[test] - fn stress() { -- #[cfg(miri)] -- const N: usize = 100; -- #[cfg(not(miri))] -- const N: usize = 10000; -- - let (tx, rx) = sync_channel::(0); - let t = thread::spawn(move || { -- for _ in 0..N { -+ for _ in 0..10000 { - tx.send(1).unwrap(); - } - }); -- for _ in 0..N { -+ for _ in 0..10000 { - assert_eq!(rx.recv().unwrap(), 1); - } - t.join().unwrap(); -@@ -1114,15 +1093,10 @@ mod sync_channel_tests { - - #[test] - fn stress_recv_timeout_two_threads() { -- #[cfg(miri)] -- const N: usize = 100; -- #[cfg(not(miri))] -- const N: usize = 10000; -- - let (tx, rx) = sync_channel::(0); - - let t = thread::spawn(move || { -- for _ in 0..N { -+ for _ in 0..10000 { - tx.send(1).unwrap(); - } - }); -@@ -1139,15 +1113,12 @@ mod sync_channel_tests { - } - } - -- assert_eq!(recv_count, N); -+ assert_eq!(recv_count, 10000); - t.join().unwrap(); - } - - #[test] - fn stress_recv_timeout_shared() { -- #[cfg(miri)] -- const AMT: u32 = 100; -- #[cfg(not(miri))] - const AMT: u32 = 1000; - const NTHREADS: u32 = 8; - let (tx, rx) = sync_channel::(0); -@@ -1194,9 +1165,6 @@ mod sync_channel_tests { - - #[test] - fn stress_shared() { -- #[cfg(miri)] -- const AMT: u32 = 100; -- #[cfg(not(miri))] - const AMT: u32 = 1000; - const NTHREADS: u32 = 8; - let (tx, rx) = sync_channel::(0); -@@ -1206,7 +1174,10 @@ mod sync_channel_tests { - for _ in 0..AMT * NTHREADS { - assert_eq!(rx.recv().unwrap(), 1); - } -- assert!(rx.try_recv().is_err()); -+ match rx.try_recv() { -+ Ok(..) => panic!(), -+ _ => {} -+ } - dtx.send(()).unwrap(); - }); - -@@ -1478,17 +1449,12 @@ mod sync_channel_tests { - - #[test] - fn recv_a_lot() { -- #[cfg(miri)] -- const N: usize = 100; -- #[cfg(not(miri))] -- const N: usize = 10000; -- - // Regression test that we don't run out of stack in scheduler context -- let (tx, rx) = sync_channel(N); -- for _ in 0..N { -+ let (tx, rx) = sync_channel(10000); -+ for _ in 0..10000 { - tx.send(()).unwrap(); - } -- for _ in 0..N { -+ for _ in 0..10000 { - rx.recv().unwrap(); - } - } -@@ -1826,11 +1792,7 @@ mod select_tests { - - #[test] - fn stress() { -- #[cfg(miri)] -- const AMT: i32 = 100; -- #[cfg(not(miri))] - const AMT: i32 = 10000; -- - let (tx1, rx1) = channel::(); - let (tx2, rx2) = channel::(); - let (tx3, rx3) = channel::<()>(); -diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/never.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/never.rs ---- firefox-98.0/third_party/rust/crossbeam-channel/tests/never.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/tests/never.rs 2022-03-16 09:33:31.994159927 +0100 -@@ -65,8 +65,8 @@ fn capacity() { - fn len_empty_full() { - let r = never::(); - assert_eq!(r.len(), 0); -- assert!(r.is_empty()); -- assert!(r.is_full()); -+ assert_eq!(r.is_empty(), true); -+ assert_eq!(r.is_full(), true); - } - - #[test] -diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/ready.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/ready.rs ---- firefox-98.0/third_party/rust/crossbeam-channel/tests/ready.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/tests/ready.rs 2022-03-16 09:33:31.994159927 +0100 -@@ -1,7 +1,5 @@ - //! Tests for channel readiness using the `Select` struct. - --#![allow(clippy::drop_copy)] -- - use std::any::Any; - use std::cell::Cell; - use std::thread; -@@ -492,9 +490,6 @@ fn nesting() { - - #[test] - fn stress_recv() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - let (s1, r1) = unbounded(); -@@ -532,9 +527,6 @@ fn stress_recv() { - - #[test] - fn stress_send() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - let (s1, r1) = bounded(0); -@@ -569,9 +561,6 @@ fn stress_send() { - - #[test] - fn stress_mixed() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - let (s1, r1) = bounded(0); -@@ -677,9 +666,6 @@ fn send_recv_same_channel() { - - #[test] - fn channel_through_channel() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 1000; - - type T = Box; -@@ -736,9 +722,6 @@ fn channel_through_channel() { - - #[test] - fn fairness1() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - let (s1, r1) = bounded::<()>(COUNT); -@@ -784,9 +767,6 @@ fn fairness1() { - - #[test] - fn fairness2() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 100_000; - - let (s1, r1) = unbounded::<()>(); -diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/select_macro.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/select_macro.rs ---- firefox-98.0/third_party/rust/crossbeam-channel/tests/select_macro.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/tests/select_macro.rs 2022-03-16 09:33:31.994159927 +0100 -@@ -1,7 +1,6 @@ - //! Tests for the `select!` macro. - - #![forbid(unsafe_code)] // select! is safe. --#![allow(clippy::drop_copy, clippy::match_single_binding)] - - use std::any::Any; - use std::cell::Cell; -@@ -284,7 +283,6 @@ fn both_ready() { - .unwrap(); - } - --#[cfg_attr(miri, ignore)] // Miri is too slow - #[test] - fn loop_try() { - const RUNS: usize = 20; -@@ -487,9 +485,6 @@ fn panic_receiver() { - - #[test] - fn stress_recv() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - let (s1, r1) = unbounded(); -@@ -523,9 +518,6 @@ fn stress_recv() { - - #[test] - fn stress_send() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - let (s1, r1) = bounded(0); -@@ -556,9 +548,6 @@ fn stress_send() { - - #[test] - fn stress_mixed() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - let (s1, r1) = bounded(0); -@@ -692,9 +681,6 @@ fn matching_with_leftover() { - - #[test] - fn channel_through_channel() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 1000; - - type T = Box; -@@ -740,9 +726,6 @@ fn channel_through_channel() { - - #[test] - fn linearizable_default() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 100_000; - - for step in 0..2 { -@@ -787,9 +770,6 @@ fn linearizable_default() { - - #[test] - fn linearizable_timeout() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 100_000; - - for step in 0..2 { -@@ -834,9 +814,6 @@ fn linearizable_timeout() { - - #[test] - fn fairness1() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - let (s1, r1) = bounded::<()>(COUNT); -@@ -861,9 +838,6 @@ fn fairness1() { - - #[test] - fn fairness2() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - let (s1, r1) = unbounded::<()>(); -@@ -901,9 +875,6 @@ fn fairness2() { - - #[test] - fn fairness_recv() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - let (s1, r1) = bounded::<()>(COUNT); -@@ -926,9 +897,6 @@ fn fairness_recv() { - - #[test] - fn fairness_send() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - let (s1, _r1) = bounded::<()>(COUNT); -@@ -944,7 +912,6 @@ fn fairness_send() { - assert!(hits.iter().all(|x| *x >= COUNT / 4)); - } - --#[allow(clippy::or_fun_call)] // This is intentional. - #[test] - fn references() { - let (s, r) = unbounded::(); -@@ -991,7 +958,6 @@ fn case_blocks() { - drop(s); - } - --#[allow(clippy::redundant_closure_call)] // This is intentional. - #[test] - fn move_handles() { - let (s, r) = unbounded::(); -diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/select.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/select.rs ---- firefox-98.0/third_party/rust/crossbeam-channel/tests/select.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/tests/select.rs 2022-03-16 09:33:31.994159927 +0100 -@@ -1,7 +1,5 @@ - //! Tests for channel selection using the `Select` struct. - --#![allow(clippy::drop_copy)] -- - use std::any::Any; - use std::cell::Cell; - use std::thread; -@@ -408,7 +406,6 @@ fn both_ready() { - .unwrap(); - } - --#[cfg_attr(miri, ignore)] // Miri is too slow - #[test] - fn loop_try() { - const RUNS: usize = 20; -@@ -693,9 +690,6 @@ fn nesting() { - - #[test] - fn stress_recv() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - let (s1, r1) = unbounded(); -@@ -734,9 +728,6 @@ fn stress_recv() { - - #[test] - fn stress_send() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - let (s1, r1) = bounded(0); -@@ -772,9 +763,6 @@ fn stress_send() { - - #[test] - fn stress_mixed() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - let (s1, r1) = bounded(0); -@@ -907,12 +895,12 @@ fn matching() { - for i in 0..THREADS { - scope.spawn(move |_| { - let mut sel = Select::new(); -- let oper1 = sel.recv(r); -- let oper2 = sel.send(s); -+ let oper1 = sel.recv(&r); -+ let oper2 = sel.send(&s); - let oper = sel.select(); - match oper.index() { -- ix if ix == oper1 => assert_ne!(oper.recv(r), Ok(i)), -- ix if ix == oper2 => assert!(oper.send(s, i).is_ok()), -+ ix if ix == oper1 => assert_ne!(oper.recv(&r), Ok(i)), -+ ix if ix == oper2 => assert!(oper.send(&s, i).is_ok()), - _ => unreachable!(), - } - }); -@@ -933,12 +921,12 @@ fn matching_with_leftover() { - for i in 0..THREADS { - scope.spawn(move |_| { - let mut sel = Select::new(); -- let oper1 = sel.recv(r); -- let oper2 = sel.send(s); -+ let oper1 = sel.recv(&r); -+ let oper2 = sel.send(&s); - let oper = sel.select(); - match oper.index() { -- ix if ix == oper1 => assert_ne!(oper.recv(r), Ok(i)), -- ix if ix == oper2 => assert!(oper.send(s, i).is_ok()), -+ ix if ix == oper1 => assert_ne!(oper.recv(&r), Ok(i)), -+ ix if ix == oper2 => assert!(oper.send(&s, i).is_ok()), - _ => unreachable!(), - } - }); -@@ -952,9 +940,6 @@ fn matching_with_leftover() { - - #[test] - fn channel_through_channel() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 1000; - - type T = Box; -@@ -1013,9 +998,6 @@ fn channel_through_channel() { - - #[test] - fn linearizable_try() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 100_000; - - for step in 0..2 { -@@ -1068,9 +1050,6 @@ fn linearizable_try() { - - #[test] - fn linearizable_timeout() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 100_000; - - for step in 0..2 { -@@ -1123,9 +1102,6 @@ fn linearizable_timeout() { - - #[test] - fn fairness1() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - let (s1, r1) = bounded::<()>(COUNT); -@@ -1172,9 +1148,6 @@ fn fairness1() { - - #[test] - fn fairness2() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - let (s1, r1) = unbounded::<()>(); -@@ -1239,8 +1212,8 @@ fn sync_and_clone() { - let (s, r) = &bounded::(0); - - let mut sel = Select::new(); -- let oper1 = sel.recv(r); -- let oper2 = sel.send(s); -+ let oper1 = sel.recv(&r); -+ let oper2 = sel.send(&s); - let sel = &sel; - - scope(|scope| { -@@ -1249,8 +1222,8 @@ fn sync_and_clone() { - let mut sel = sel.clone(); - let oper = sel.select(); - match oper.index() { -- ix if ix == oper1 => assert_ne!(oper.recv(r), Ok(i)), -- ix if ix == oper2 => assert!(oper.send(s, i).is_ok()), -+ ix if ix == oper1 => assert_ne!(oper.recv(&r), Ok(i)), -+ ix if ix == oper2 => assert!(oper.send(&s, i).is_ok()), - _ => unreachable!(), - } - }); -@@ -1268,8 +1241,8 @@ fn send_and_clone() { - let (s, r) = &bounded::(0); - - let mut sel = Select::new(); -- let oper1 = sel.recv(r); -- let oper2 = sel.send(s); -+ let oper1 = sel.recv(&r); -+ let oper2 = sel.send(&s); - - scope(|scope| { - for i in 0..THREADS { -@@ -1277,8 +1250,8 @@ fn send_and_clone() { - scope.spawn(move |_| { - let oper = sel.select(); - match oper.index() { -- ix if ix == oper1 => assert_ne!(oper.recv(r), Ok(i)), -- ix if ix == oper2 => assert!(oper.send(s, i).is_ok()), -+ ix if ix == oper1 => assert_ne!(oper.recv(&r), Ok(i)), -+ ix if ix == oper2 => assert!(oper.send(&s, i).is_ok()), - _ => unreachable!(), - } - }); -@@ -1291,9 +1264,6 @@ fn send_and_clone() { - - #[test] - fn reuse() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - let (s1, r1) = bounded(0); -diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/thread_locals.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/thread_locals.rs ---- firefox-98.0/third_party/rust/crossbeam-channel/tests/thread_locals.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:40.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/tests/thread_locals.rs 2022-03-16 09:33:31.995159961 +0100 -@@ -1,7 +1,5 @@ - //! Tests that make sure accessing thread-locals while exiting the thread doesn't cause panics. - --#![cfg(not(miri))] // error: abnormal termination: the evaluated program aborted execution -- - use std::thread; - use std::time::Duration; - -diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/tick.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/tick.rs ---- firefox-98.0/third_party/rust/crossbeam-channel/tests/tick.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/tests/tick.rs 2022-03-16 09:33:31.995159961 +0100 -@@ -1,7 +1,5 @@ - //! Tests for the tick channel flavor. - --#![cfg(not(miri))] // TODO: many assertions failed due to Miri is slow -- - use std::sync::atomic::AtomicUsize; - use std::sync::atomic::Ordering; - use std::thread; -@@ -80,20 +78,20 @@ fn len_empty_full() { - let r = tick(ms(50)); - - assert_eq!(r.len(), 0); -- assert!(r.is_empty()); -- assert!(!r.is_full()); -+ assert_eq!(r.is_empty(), true); -+ assert_eq!(r.is_full(), false); - - thread::sleep(ms(100)); - - assert_eq!(r.len(), 1); -- assert!(!r.is_empty()); -- assert!(r.is_full()); -+ assert_eq!(r.is_empty(), false); -+ assert_eq!(r.is_full(), true); - - r.try_recv().unwrap(); - - assert_eq!(r.len(), 0); -- assert!(r.is_empty()); -- assert!(!r.is_full()); -+ assert_eq!(r.is_empty(), true); -+ assert_eq!(r.is_full(), false); - } - - #[test] -diff -up firefox-98.0/third_party/rust/crossbeam-channel/tests/zero.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-channel/tests/zero.rs ---- firefox-98.0/third_party/rust/crossbeam-channel/tests/zero.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-channel/tests/zero.rs 2022-03-16 09:33:31.995159961 +0100 -@@ -35,11 +35,11 @@ fn len_empty_full() { - let (s, r) = bounded(0); - - assert_eq!(s.len(), 0); -- assert!(s.is_empty()); -- assert!(s.is_full()); -+ assert_eq!(s.is_empty(), true); -+ assert_eq!(s.is_full(), true); - assert_eq!(r.len(), 0); -- assert!(r.is_empty()); -- assert!(r.is_full()); -+ assert_eq!(r.is_empty(), true); -+ assert_eq!(r.is_full(), true); - - scope(|scope| { - scope.spawn(|_| s.send(0).unwrap()); -@@ -48,11 +48,11 @@ fn len_empty_full() { - .unwrap(); - - assert_eq!(s.len(), 0); -- assert!(s.is_empty()); -- assert!(s.is_full()); -+ assert_eq!(s.is_empty(), true); -+ assert_eq!(s.is_full(), true); - assert_eq!(r.len(), 0); -- assert!(r.is_empty()); -- assert!(r.is_full()); -+ assert_eq!(r.is_empty(), true); -+ assert_eq!(r.is_full(), true); - } - - #[test] -@@ -187,9 +187,6 @@ fn send_timeout() { - - #[test] - fn len() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 25_000; - - let (s, r) = bounded(0); -@@ -252,9 +249,6 @@ fn disconnect_wakes_receiver() { - - #[test] - fn spsc() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 100_000; - - let (s, r) = bounded(0); -@@ -277,9 +271,6 @@ fn spsc() { - - #[test] - fn mpmc() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 25_000; - const THREADS: usize = 4; - -@@ -312,9 +303,6 @@ fn mpmc() { - - #[test] - fn stress_oneshot() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - for _ in 0..COUNT { -@@ -328,7 +316,6 @@ fn stress_oneshot() { - } - } - --#[cfg_attr(miri, ignore)] // Miri is too slow - #[test] - fn stress_iter() { - const COUNT: usize = 1000; -@@ -396,11 +383,8 @@ fn stress_timeout_two_threads() { - .unwrap(); - } - --#[cfg_attr(miri, ignore)] // Miri is too slow - #[test] - fn drops() { -- const RUNS: usize = 100; -- - static DROPS: AtomicUsize = AtomicUsize::new(0); - - #[derive(Debug, PartialEq)] -@@ -414,7 +398,7 @@ fn drops() { - - let mut rng = thread_rng(); - -- for _ in 0..RUNS { -+ for _ in 0..100 { - let steps = rng.gen_range(0..3_000); - - DROPS.store(0, Ordering::SeqCst); -@@ -444,9 +428,6 @@ fn drops() { - - #[test] - fn fairness() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - let (s1, r1) = bounded::<()>(0); -@@ -478,9 +459,6 @@ fn fairness() { - - #[test] - fn fairness_duplicates() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 10_000; - - let (s, r) = bounded::<()>(0); -@@ -539,9 +517,6 @@ fn recv_in_send() { - - #[test] - fn channel_through_channel() { -- #[cfg(miri)] -- const COUNT: usize = 100; -- #[cfg(not(miri))] - const COUNT: usize = 1000; - - type T = Box; -diff -up firefox-98.0/third_party/rust/crossbeam-epoch/benches/pin.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/benches/pin.rs ---- firefox-98.0/third_party/rust/crossbeam-epoch/benches/pin.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-epoch/benches/pin.rs 2022-03-16 09:33:31.995159961 +0100 -@@ -8,7 +8,7 @@ use test::Bencher; - - #[bench] - fn single_pin(b: &mut Bencher) { -- b.iter(epoch::pin); -+ b.iter(|| epoch::pin()); - } - - #[bench] -diff -up firefox-98.0/third_party/rust/crossbeam-epoch/build.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/build.rs ---- firefox-98.0/third_party/rust/crossbeam-epoch/build.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-epoch/build.rs 2022-03-16 09:33:31.995159961 +0100 -@@ -4,19 +4,9 @@ use std::env; - - include!("no_atomic.rs"); - --// The rustc-cfg listed below are considered public API, but it is *unstable* --// and outside of the normal semver guarantees: --// --// - `crossbeam_no_atomic_cas` --// Assume the target does *not* support atomic CAS operations. --// This is usually detected automatically by the build script, but you may --// need to enable it manually when building for custom targets or using --// non-cargo build systems that don't run the build script. --// --// With the exceptions mentioned above, the rustc-cfg strings below are --// *not* public API. Please let us know by opening a GitHub issue if your build --// environment requires some way to enable these cfgs other than by executing --// our build script. -+// The rustc-cfg strings below are *not* public API. Please let us know by -+// opening a GitHub issue if your build environment requires some way to enable -+// these cfgs other than by executing our build script. - fn main() { - let target = match env::var("TARGET") { - Ok(target) => target, -diff -up firefox-98.0/third_party/rust/crossbeam-epoch/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/.cargo-checksum.json ---- firefox-98.0/third_party/rust/crossbeam-epoch/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-epoch/.cargo-checksum.json 2022-03-16 09:33:31.995159961 +0100 -@@ -1 +1 @@ --{"files":{"CHANGELOG.md":"7f3c7198f2e33ba93bb8270e1c1e8dc6d70c343987acd9d0706e3632cbb9e0ad","Cargo.lock":"10e3899295e7e8ce93d3f0b597efbec844bdda40f78ae717f5995341d41ee937","Cargo.toml":"d7e7ab87ca4a4e8cc4ae9644e1537eedc46473ff5f89399b4733c4bdf59058db","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"5734ed989dfca1f625b40281ee9f4530f91b2411ec01cb748223e7eb87e201ab","README.md":"f946b25082979595d3851d90c4e76424be921a779e88e982f8455d44d46057ec","benches/defer.rs":"c330b704d96b2ad1aed29f72c37a99da534adef8cb06a3976d5f93bf567abb20","benches/flush.rs":"0389ac6c473632f0e93c962f223404cc360257f6699b4ec90b9b3be16bb6d74f","benches/pin.rs":"2f649a5153745c7930efdb32a52f9dc522f7b8cf548a251c5e2c82ee25dc3fff","build.rs":"58a36da8f9ca3a9206d31a0d6e7548f200fe8746ebca5edca48679b0d29a8043","examples/sanitize.rs":"a39d1635fa61e643e59192d7a63becc97ff81f03c1f4e03d38cedefb1525026a","no_atomic.rs":"3529c0833bcd1e09a352d3bd1696d3666850c9b09fe2111bf1a783ec16a5f467","src/atomic.rs":"63843b5ecd51b3fc98336247abe8efa824d826f142e40a761636e530d06f3b41","src/collector.rs":"e2d9780d8707e49360b3c33f2f829f29f70e6929307e65e23449b8ba6def6358","src/default.rs":"e1449bd6e61d7c19e9cbdf183f81c67c3487775fcc55572947874ca535d3d54f","src/deferred.rs":"ea532517c8ca22010ed9a624b059471c8a57b25e7925f6a5dfb391be7646a1fa","src/epoch.rs":"d31e66d8fe62299928e25867336d96391b26a4fe890a1cae0885dfcf36d6835b","src/guard.rs":"55c56ca1b2fbc067ae21108f0f7de4be91e5b41df2492055b635ed436782dd52","src/internal.rs":"67a6811b8c58e1152fd1dc17e389884025a0d99d79ab03dee26efcd0d6896690","src/lib.rs":"bcaa7c8dc9f9eb1ef6f56b4c0705db348d00b21325b6c0c1544cd7aec0613dc9","src/sync/list.rs":"10aa4c59845ab9ff1d8bcb6f594b70bbe23c320fa7a2b125fdf85df88b9d61e2","src/sync/mod.rs":"cbc6334460d73761c3dea7f99ed2ccbf267d5da3bc76c812e94f85c9f4565c6a","src/sync/queue.rs":"06173b2255677d0d39178ceb49876fda2878f491e907c595eb65643dbb43c9ba","tests/loom.rs":"db772f4478966de6ec98774ca4093171dc942da635822a0d2d3257d31188cb9b"},"package":"97242a70df9b89a65d0b6df3c4bf5b9ce03c5b7309019777fbde37e7537f8762"} -\ No newline at end of file -+{"files":{"CHANGELOG.md":"40b65a13f12e97a24c838fe2254a3563a5fe00922053ef7256ed4752876614fa","Cargo.lock":"35b1db42b892c01e72ff1f99fc7767e5e47208d083203866337f6f2f7d0738eb","Cargo.toml":"eab75399db818408fd4f45a91919b08e050e56547014816683a269270e292055","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"5734ed989dfca1f625b40281ee9f4530f91b2411ec01cb748223e7eb87e201ab","README.md":"f946b25082979595d3851d90c4e76424be921a779e88e982f8455d44d46057ec","benches/defer.rs":"c330b704d96b2ad1aed29f72c37a99da534adef8cb06a3976d5f93bf567abb20","benches/flush.rs":"0389ac6c473632f0e93c962f223404cc360257f6699b4ec90b9b3be16bb6d74f","benches/pin.rs":"80f9e65ba04a2ddec7a330172d0b0fbc698e20c221b3d8cdc70cc42e3b9099d1","build.rs":"c8684300062c73e96eae8877d03e145ee95e0cd99d4d933696caa582c08e2416","examples/sanitize.rs":"a39d1635fa61e643e59192d7a63becc97ff81f03c1f4e03d38cedefb1525026a","no_atomic.rs":"a2621c1b029c614fb0ab8e3f5cda2e839df88d90d26133181c1b901965f7eec4","src/atomic.rs":"631d3062e3c30d8e505fda3a7e2c68a88abf7617881035d6131c39cb8fdddce0","src/collector.rs":"7d636f3f96fafd033298d1c2ab126205438a46deb84895d8e28bea9eef67798a","src/default.rs":"e1449bd6e61d7c19e9cbdf183f81c67c3487775fcc55572947874ca535d3d54f","src/deferred.rs":"1ee67bd3200d3891076aac8cfc9767abdddc194602f2084d11455484096005ea","src/epoch.rs":"d31e66d8fe62299928e25867336d96391b26a4fe890a1cae0885dfcf36d6835b","src/guard.rs":"55c56ca1b2fbc067ae21108f0f7de4be91e5b41df2492055b635ed436782dd52","src/internal.rs":"f3f8131819b2a4ec4d1a6d392c734688324f3ae708bac6745e88f2930657eba1","src/lib.rs":"bcaa7c8dc9f9eb1ef6f56b4c0705db348d00b21325b6c0c1544cd7aec0613dc9","src/sync/list.rs":"10aa4c59845ab9ff1d8bcb6f594b70bbe23c320fa7a2b125fdf85df88b9d61e2","src/sync/mod.rs":"cbc6334460d73761c3dea7f99ed2ccbf267d5da3bc76c812e94f85c9f4565c6a","src/sync/queue.rs":"262e0d8f343e97df9e2a738461e4255e339710e81c479e484f9efe517ae47135","tests/loom.rs":"db772f4478966de6ec98774ca4093171dc942da635822a0d2d3257d31188cb9b"},"package":"4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd"} -\ No newline at end of file -diff -up firefox-98.0/third_party/rust/crossbeam-epoch/Cargo.lock.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/Cargo.lock ---- firefox-98.0/third_party/rust/crossbeam-epoch/Cargo.lock.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-epoch/Cargo.lock 2022-03-16 09:33:31.995159961 +0100 -@@ -3,15 +3,6 @@ - version = 3 - - [[package]] --name = "ansi_term" --version = "0.12.1" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" --dependencies = [ -- "winapi", --] -- --[[package]] - name = "autocfg" - version = "1.0.1" - source = "registry+https://github.com/rust-lang/crates.io-index" -@@ -19,9 +10,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffe - - [[package]] - name = "cc" --version = "1.0.72" -+version = "1.0.68" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" -+checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" - - [[package]] - name = "cfg-if" -@@ -31,13 +22,13 @@ checksum = "baf1de4339761588bc0619e3cbc0 - - [[package]] - name = "const_fn" --version = "0.4.9" -+version = "0.4.8" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" -+checksum = "f92cfa0fd5690b3cf8c1ef2cabbd9b7ef22fa53cf5e1f92b05103f6d5d1cf6e7" - - [[package]] - name = "crossbeam-epoch" --version = "0.9.6" -+version = "0.9.5" - dependencies = [ - "cfg-if", - "const_fn", -@@ -51,9 +42,9 @@ dependencies = [ - - [[package]] - name = "crossbeam-utils" --version = "0.8.6" -+version = "0.8.5" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" -+checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" - dependencies = [ - "cfg-if", - "lazy_static", -@@ -92,9 +83,9 @@ checksum = "e2abad23fbc42b3700f2f279844d - - [[package]] - name = "libc" --version = "0.2.112" -+version = "0.2.95" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125" -+checksum = "789da6d93f1b866ffe175afc5322a4d76c038605a1c3319bb57b06967ca98a36" - - [[package]] - name = "log" -@@ -107,76 +98,35 @@ dependencies = [ - - [[package]] - name = "loom" --version = "0.5.4" -+version = "0.5.0" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "edc5c7d328e32cc4954e8e01193d7f0ef5ab257b5090b70a964e099a36034309" -+checksum = "7aa5348dc45fa5f2419b6dd4ea20345e6b01b1fcc9d176a322eada1ac3f382ba" - dependencies = [ - "cfg-if", - "generator", - "scoped-tls", -- "tracing", -- "tracing-subscriber", --] -- --[[package]] --name = "matchers" --version = "0.1.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" --dependencies = [ -- "regex-automata", - ] - - [[package]] - name = "memoffset" --version = "0.6.5" -+version = "0.6.4" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -+checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" - dependencies = [ - "autocfg", - ] - - [[package]] --name = "once_cell" --version = "1.9.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" -- --[[package]] --name = "pin-project-lite" --version = "0.2.8" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" -- --[[package]] - name = "ppv-lite86" --version = "0.2.16" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" -- --[[package]] --name = "proc-macro2" --version = "1.0.36" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" --dependencies = [ -- "unicode-xid", --] -- --[[package]] --name = "quote" --version = "1.0.14" -+version = "0.2.10" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "47aa80447ce4daf1717500037052af176af5d38cc3e571d9ec1c7353fc10c87d" --dependencies = [ -- "proc-macro2", --] -+checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" - - [[package]] - name = "rand" --version = "0.8.4" -+version = "0.8.3" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" -+checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" - dependencies = [ - "libc", - "rand_chacha", -@@ -186,9 +136,9 @@ dependencies = [ - - [[package]] - name = "rand_chacha" --version = "0.3.1" -+version = "0.3.0" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -+checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" - dependencies = [ - "ppv-lite86", - "rand_core", -@@ -196,51 +146,27 @@ dependencies = [ - - [[package]] - name = "rand_core" --version = "0.6.3" -+version = "0.6.2" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" -+checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" - dependencies = [ - "getrandom", - ] - - [[package]] - name = "rand_hc" --version = "0.3.1" -+version = "0.3.0" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" -+checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" - dependencies = [ - "rand_core", - ] - - [[package]] --name = "regex" --version = "1.5.4" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" --dependencies = [ -- "regex-syntax", --] -- --[[package]] --name = "regex-automata" --version = "0.1.10" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" --dependencies = [ -- "regex-syntax", --] -- --[[package]] --name = "regex-syntax" --version = "0.6.25" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" -- --[[package]] - name = "rustversion" --version = "1.0.6" -+version = "1.0.5" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" -+checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" - - [[package]] - name = "scoped-tls" -@@ -255,108 +181,6 @@ source = "registry+https://github.com/ru - checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - - [[package]] --name = "sharded-slab" --version = "0.1.4" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" --dependencies = [ -- "lazy_static", --] -- --[[package]] --name = "smallvec" --version = "1.7.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" -- --[[package]] --name = "syn" --version = "1.0.85" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "a684ac3dcd8913827e18cd09a68384ee66c1de24157e3c556c9ab16d85695fb7" --dependencies = [ -- "proc-macro2", -- "quote", -- "unicode-xid", --] -- --[[package]] --name = "thread_local" --version = "1.1.3" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" --dependencies = [ -- "once_cell", --] -- --[[package]] --name = "tracing" --version = "0.1.29" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" --dependencies = [ -- "cfg-if", -- "pin-project-lite", -- "tracing-attributes", -- "tracing-core", --] -- --[[package]] --name = "tracing-attributes" --version = "0.1.18" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" --dependencies = [ -- "proc-macro2", -- "quote", -- "syn", --] -- --[[package]] --name = "tracing-core" --version = "0.1.21" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" --dependencies = [ -- "lazy_static", --] -- --[[package]] --name = "tracing-log" --version = "0.1.2" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" --dependencies = [ -- "lazy_static", -- "log", -- "tracing-core", --] -- --[[package]] --name = "tracing-subscriber" --version = "0.3.5" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "5d81bfa81424cc98cb034b837c985b7a290f592e5b4322f353f94a0ab0f9f594" --dependencies = [ -- "ansi_term", -- "lazy_static", -- "matchers", -- "regex", -- "sharded-slab", -- "smallvec", -- "thread_local", -- "tracing", -- "tracing-core", -- "tracing-log", --] -- --[[package]] --name = "unicode-xid" --version = "0.2.2" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" -- --[[package]] - name = "wasi" - version = "0.10.2+wasi-snapshot-preview1" - source = "registry+https://github.com/rust-lang/crates.io-index" -diff -up firefox-98.0/third_party/rust/crossbeam-epoch/Cargo.toml.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/Cargo.toml ---- firefox-98.0/third_party/rust/crossbeam-epoch/Cargo.toml.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-epoch/Cargo.toml 2022-03-16 09:33:31.995159961 +0100 -@@ -3,19 +3,21 @@ - # When uploading crates to the registry Cargo will automatically - # "normalize" Cargo.toml files for maximal compatibility - # with all versions of Cargo and also rewrite `path` dependencies --# to registry (e.g., crates.io) dependencies. -+# to registry (e.g., crates.io) dependencies - # --# If you are reading this file be aware that the original Cargo.toml --# will likely look very different (and much more reasonable). --# See Cargo.toml.orig for the original contents. -+# If you believe there's an error in this file please file an -+# issue against the rust-lang/cargo repository. If you're -+# editing this file be aware that the upstream Cargo.toml -+# will likely look very different (and much more reasonable) - - [package] - edition = "2018" --rust-version = "1.36" - name = "crossbeam-epoch" --version = "0.9.6" -+version = "0.9.5" -+authors = ["The Crossbeam Project Developers"] - description = "Epoch-based garbage collection" - homepage = "https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-epoch" -+documentation = "https://docs.rs/crossbeam-epoch" - keywords = ["lock-free", "rcu", "atomic", "garbage"] - categories = ["concurrency", "memory-management", "no-std"] - license = "MIT OR Apache-2.0" -diff -up firefox-98.0/third_party/rust/crossbeam-epoch/CHANGELOG.md.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/CHANGELOG.md ---- firefox-98.0/third_party/rust/crossbeam-epoch/CHANGELOG.md.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-epoch/CHANGELOG.md 2022-03-16 09:33:31.995159961 +0100 -@@ -1,16 +1,12 @@ --# Version 0.9.6 -- --- Add `Atomic::fetch_update`. (#706) -- - # Version 0.9.5 - --- Fix UB in `Pointable` impl of `[MaybeUninit]`. (#694) --- Support targets that do not have atomic CAS on stable Rust. (#698) --- Fix breakage with nightly feature due to rust-lang/rust#84510. (#692) -+- Fix UB in `Pointable` impl of `[MaybeUninit]` (#694) -+- Support targets that do not have atomic CAS on stable Rust (#698) -+- Fix breakage with nightly feature due to rust-lang/rust#84510 (#692) - - # Version 0.9.4 - --- Fix UB in `<[MaybeUninit] as Pointable>::init` when global allocator failed allocation. (#690) -+- Fix UB in `<[MaybeUninit] as Pointable>::init` when global allocator failed allocation (#690) - - Bump `loom` dependency to version 0.5. (#686) - - # Version 0.9.3 -diff -up firefox-98.0/third_party/rust/crossbeam-epoch/no_atomic.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/no_atomic.rs ---- firefox-98.0/third_party/rust/crossbeam-epoch/no_atomic.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-epoch/no_atomic.rs 2022-03-16 09:33:31.995159961 +0100 -@@ -3,8 +3,6 @@ - - const NO_ATOMIC_CAS: &[&str] = &[ - "avr-unknown-gnu-atmega328", -- "bpfeb-unknown-none", -- "bpfel-unknown-none", - "msp430-none-elf", - "riscv32i-unknown-none-elf", - "riscv32imc-unknown-none-elf", -@@ -23,7 +21,6 @@ const NO_ATOMIC_64: &[&str] = &[ - "armv7r-none-eabi", - "armv7r-none-eabihf", - "hexagon-unknown-linux-musl", -- "m68k-unknown-linux-gnu", - "mips-unknown-linux-gnu", - "mips-unknown-linux-musl", - "mips-unknown-linux-uclibc", -@@ -33,7 +30,6 @@ const NO_ATOMIC_64: &[&str] = &[ - "mipsel-unknown-none", - "mipsisa32r6-unknown-linux-gnu", - "mipsisa32r6el-unknown-linux-gnu", -- "powerpc-unknown-freebsd", - "powerpc-unknown-linux-gnu", - "powerpc-unknown-linux-gnuspe", - "powerpc-unknown-linux-musl", -@@ -44,14 +40,12 @@ const NO_ATOMIC_64: &[&str] = &[ - "riscv32gc-unknown-linux-gnu", - "riscv32gc-unknown-linux-musl", - "riscv32imac-unknown-none-elf", -- "riscv32imc-esp-espidf", - "thumbv7em-none-eabi", - "thumbv7em-none-eabihf", - "thumbv7m-none-eabi", - "thumbv8m.base-none-eabi", - "thumbv8m.main-none-eabi", - "thumbv8m.main-none-eabihf", -- "armv6k-nintendo-3ds", - "mipsel-sony-psp", - "thumbv4t-none-eabi", - "thumbv6m-none-eabi", -diff -up firefox-98.0/third_party/rust/crossbeam-epoch/src/atomic.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/src/atomic.rs ---- firefox-98.0/third_party/rust/crossbeam-epoch/src/atomic.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-epoch/src/atomic.rs 2022-03-16 09:33:31.995159961 +0100 -@@ -562,65 +562,6 @@ impl Atomic { - }) - } - -- /// Fetches the pointer, and then applies a function to it that returns a new value. -- /// Returns a `Result` of `Ok(previous_value)` if the function returned `Some`, else `Err(_)`. -- /// -- /// Note that the given function may be called multiple times if the value has been changed by -- /// other threads in the meantime, as long as the function returns `Some(_)`, but the function -- /// will have been applied only once to the stored value. -- /// -- /// `fetch_update` takes two [`Ordering`] arguments to describe the memory -- /// ordering of this operation. The first describes the required ordering for -- /// when the operation finally succeeds while the second describes the -- /// required ordering for loads. These correspond to the success and failure -- /// orderings of [`Atomic::compare_exchange`] respectively. -- /// -- /// Using [`Acquire`] as success ordering makes the store part of this -- /// operation [`Relaxed`], and using [`Release`] makes the final successful -- /// load [`Relaxed`]. The (failed) load ordering can only be [`SeqCst`], -- /// [`Acquire`] or [`Relaxed`] and must be equivalent to or weaker than the -- /// success ordering. -- /// -- /// [`Relaxed`]: Ordering::Relaxed -- /// [`Acquire`]: Ordering::Acquire -- /// [`Release`]: Ordering::Release -- /// [`SeqCst`]: Ordering::SeqCst -- /// -- /// # Examples -- /// -- /// ``` -- /// use crossbeam_epoch::{self as epoch, Atomic}; -- /// use std::sync::atomic::Ordering::SeqCst; -- /// -- /// let a = Atomic::new(1234); -- /// let guard = &epoch::pin(); -- /// -- /// let res1 = a.fetch_update(SeqCst, SeqCst, guard, |x| Some(x.with_tag(1))); -- /// assert!(res1.is_ok()); -- /// -- /// let res2 = a.fetch_update(SeqCst, SeqCst, guard, |x| None); -- /// assert!(res2.is_err()); -- /// ``` -- pub fn fetch_update<'g, F>( -- &self, -- set_order: Ordering, -- fail_order: Ordering, -- guard: &'g Guard, -- mut func: F, -- ) -> Result, Shared<'g, T>> -- where -- F: FnMut(Shared<'g, T>) -> Option>, -- { -- let mut prev = self.load(fail_order, guard); -- while let Some(next) = func(prev) { -- match self.compare_exchange_weak(prev, next, set_order, fail_order, guard) { -- Ok(shared) => return Ok(shared), -- Err(next_prev) => prev = next_prev.current, -- } -- } -- Err(prev) -- } -- - /// Stores the pointer `new` (either `Shared` or `Owned`) into the atomic pointer if the current - /// value is the same as `current`. The tag is also taken into account, so two pointers to the - /// same object, but with different tags, will not be considered equal. -diff -up firefox-98.0/third_party/rust/crossbeam-epoch/src/collector.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/src/collector.rs ---- firefox-98.0/third_party/rust/crossbeam-epoch/src/collector.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:40.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-epoch/src/collector.rs 2022-03-16 09:33:31.995159961 +0100 -@@ -178,18 +178,13 @@ mod tests { - - #[test] - fn pin_holds_advance() { -- #[cfg(miri)] -- const N: usize = 500; -- #[cfg(not(miri))] -- const N: usize = 500_000; -- - let collector = Collector::new(); - - thread::scope(|scope| { - for _ in 0..NUM_THREADS { - scope.spawn(|_| { - let handle = collector.register(); -- for _ in 0..N { -+ for _ in 0..500_000 { - let guard = &handle.pin(); - - let before = collector.global.epoch.load(Ordering::Relaxed); -@@ -207,9 +202,6 @@ mod tests { - #[cfg(not(crossbeam_sanitize))] // TODO: assertions failed due to `cfg(crossbeam_sanitize)` reduce `internal::MAX_OBJECTS` - #[test] - fn incremental() { -- #[cfg(miri)] -- const COUNT: usize = 500; -- #[cfg(not(miri))] - const COUNT: usize = 100_000; - static DESTROYS: AtomicUsize = AtomicUsize::new(0); - -@@ -238,16 +230,12 @@ mod tests { - let guard = &handle.pin(); - collector.global.collect(guard); - } -- assert!(DESTROYS.load(Ordering::Relaxed) == COUNT); -+ assert!(DESTROYS.load(Ordering::Relaxed) == 100_000); - } - - #[test] - fn buffering() { - const COUNT: usize = 10; -- #[cfg(miri)] -- const N: usize = 500; -- #[cfg(not(miri))] -- const N: usize = 100_000; - static DESTROYS: AtomicUsize = AtomicUsize::new(0); - - let collector = Collector::new(); -@@ -264,7 +252,7 @@ mod tests { - } - } - -- for _ in 0..N { -+ for _ in 0..100_000 { - collector.global.collect(&handle.pin()); - } - assert!(DESTROYS.load(Ordering::Relaxed) < COUNT); -@@ -280,9 +268,6 @@ mod tests { - - #[test] - fn count_drops() { -- #[cfg(miri)] -- const COUNT: usize = 500; -- #[cfg(not(miri))] - const COUNT: usize = 100_000; - static DROPS: AtomicUsize = AtomicUsize::new(0); - -@@ -316,9 +301,6 @@ mod tests { - - #[test] - fn count_destroy() { -- #[cfg(miri)] -- const COUNT: usize = 500; -- #[cfg(not(miri))] - const COUNT: usize = 100_000; - static DESTROYS: AtomicUsize = AtomicUsize::new(0); - -@@ -385,9 +367,6 @@ mod tests { - - #[test] - fn destroy_array() { -- #[cfg(miri)] -- const COUNT: usize = 500; -- #[cfg(not(miri))] - const COUNT: usize = 100_000; - static DESTROYS: AtomicUsize = AtomicUsize::new(0); - -@@ -423,9 +402,6 @@ mod tests { - #[test] - fn stress() { - const THREADS: usize = 8; -- #[cfg(miri)] -- const COUNT: usize = 500; -- #[cfg(not(miri))] - const COUNT: usize = 100_000; - static DROPS: AtomicUsize = AtomicUsize::new(0); - -diff -up firefox-98.0/third_party/rust/crossbeam-epoch/src/deferred.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/src/deferred.rs ---- firefox-98.0/third_party/rust/crossbeam-epoch/src/deferred.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-epoch/src/deferred.rs 2022-03-16 09:33:31.995159961 +0100 -@@ -81,8 +81,6 @@ impl Deferred { - - #[cfg(all(test, not(crossbeam_loom)))] - mod tests { -- #![allow(clippy::drop_copy)] -- - use super::Deferred; - use std::cell::Cell; - -diff -up firefox-98.0/third_party/rust/crossbeam-epoch/src/internal.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/src/internal.rs ---- firefox-98.0/third_party/rust/crossbeam-epoch/src/internal.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-epoch/src/internal.rs 2022-03-16 09:33:31.995159961 +0100 -@@ -101,7 +101,7 @@ impl Bag { - - /// Seals the bag with the given epoch. - fn seal(self, epoch: Epoch) -> SealedBag { -- SealedBag { epoch, _bag: self } -+ SealedBag { epoch, bag: self } - } - } - -@@ -216,7 +216,7 @@ fn no_op_func() {} - #[derive(Default, Debug)] - struct SealedBag { - epoch: Epoch, -- _bag: Bag, -+ bag: Bag, - } - - /// It is safe to share `SealedBag` because `is_expired` only inspects the epoch. -@@ -311,7 +311,7 @@ impl Global { - // TODO(stjepang): `Local`s are stored in a linked list because linked lists are fairly - // easy to implement in a lock-free manner. However, traversal can be slow due to cache - // misses and data dependencies. We should experiment with other data structures as well. -- for local in self.locals.iter(guard) { -+ for local in self.locals.iter(&guard) { - match local { - Err(IterError::Stalled) => { - // A concurrent thread stalled this iteration. That thread might also try to -diff -up firefox-98.0/third_party/rust/crossbeam-epoch/src/sync/queue.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-epoch/src/sync/queue.rs ---- firefox-98.0/third_party/rust/crossbeam-epoch/src/sync/queue.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:40.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-epoch/src/sync/queue.rs 2022-03-16 09:33:31.996159993 +0100 -@@ -259,9 +259,6 @@ mod test { - } - } - -- #[cfg(miri)] -- const CONC_COUNT: i64 = 1000; -- #[cfg(not(miri))] - const CONC_COUNT: i64 = 1000000; - - #[test] -@@ -425,8 +422,8 @@ mod test { - - let mut vl2 = vl.clone(); - let mut vr2 = vr.clone(); -- vl2.sort_unstable(); -- vr2.sort_unstable(); -+ vl2.sort(); -+ vr2.sort(); - - assert_eq!(vl, vl2); - assert_eq!(vr, vr2); -diff -up firefox-98.0/third_party/rust/crossbeam-utils/build.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-utils/build.rs ---- firefox-98.0/third_party/rust/crossbeam-utils/build.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-utils/build.rs 2022-03-16 09:33:31.996159993 +0100 -@@ -4,31 +4,9 @@ use std::env; - - include!("no_atomic.rs"); - --// The rustc-cfg listed below are considered public API, but it is *unstable* --// and outside of the normal semver guarantees: --// --// - `crossbeam_no_atomic_cas` --// Assume the target does *not* support atomic CAS operations. --// This is usually detected automatically by the build script, but you may --// need to enable it manually when building for custom targets or using --// non-cargo build systems that don't run the build script. --// --// - `crossbeam_no_atomic` --// Assume the target does *not* support any atomic operations. --// This is usually detected automatically by the build script, but you may --// need to enable it manually when building for custom targets or using --// non-cargo build systems that don't run the build script. --// --// - `crossbeam_no_atomic_64` --// Assume the target does *not* support AtomicU64/AtomicI64. --// This is usually detected automatically by the build script, but you may --// need to enable it manually when building for custom targets or using --// non-cargo build systems that don't run the build script. --// --// With the exceptions mentioned above, the rustc-cfg strings below are --// *not* public API. Please let us know by opening a GitHub issue if your build --// environment requires some way to enable these cfgs other than by executing --// our build script. -+// The rustc-cfg strings below are *not* public API. Please let us know by -+// opening a GitHub issue if your build environment requires some way to enable -+// these cfgs other than by executing our build script. - fn main() { - let target = match env::var("TARGET") { - Ok(target) => target, -diff -up firefox-98.0/third_party/rust/crossbeam-utils/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-utils/.cargo-checksum.json ---- firefox-98.0/third_party/rust/crossbeam-utils/.cargo-checksum.json.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-utils/.cargo-checksum.json 2022-03-16 09:33:31.996159993 +0100 -@@ -1 +1 @@ --{"files":{"CHANGELOG.md":"097eb3484f4f13471dfe6879ce61450cc60d4453aecb924f38a8f0e4af593cdd","Cargo.toml":"2734493ab832f12a4f849c333d2dd11760c6ce614b88355da21118f77acdcd70","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"5734ed989dfca1f625b40281ee9f4530f91b2411ec01cb748223e7eb87e201ab","README.md":"dfa9fbed47c344c134a63c84b7c0e4651baeac1554b7b3266d0e38643743fc33","benches/atomic_cell.rs":"c927eb3cd1e5ecc4b91adbc3bde98af15ffab4086190792ba64d5cde0e24df3d","build.rs":"39cf39e855e52559c8f68880a02b3e2778ae2d8f089650af1b3e34a85898aed7","no_atomic.rs":"3529c0833bcd1e09a352d3bd1696d3666850c9b09fe2111bf1a783ec16a5f467","src/atomic/atomic_cell.rs":"9d0785073f506b75c110270947f6a8367ead7faaf29c507d4ede37125310cff6","src/atomic/consume.rs":"7a7736fcd64f6473dfea7653559ffc5e1a2a234df43835f8aa8734862145ac15","src/atomic/mod.rs":"7f6afd5bd0da1f7b51765ab04da4e5f683588ac2d23506e61bf7007bb1e61ba2","src/atomic/seq_lock.rs":"27182e6b87a9db73c5f6831759f8625f9fcdec3c2828204c444aef04f427735a","src/atomic/seq_lock_wide.rs":"9888dd03116bb89ca36d4ab8d5a0b5032107a2983a7eb8024454263b09080088","src/backoff.rs":"7cc7754e15f69b52e92a70d4f49d1bc274693455a0933a2d7eb0605806566af3","src/cache_padded.rs":"6a512698115ad0d5a5b163dbd7a83247e1f1c146c4a30f3fc74b952e3b767b59","src/lib.rs":"6f1bcf157abe06ad8458a53e865bf8efab9fad4a9424790147cee8fefb3795d8","src/sync/mod.rs":"59986f559a8f170a4b3247ab2eea2460b09809d87c8110ed88e4e7103d3519dc","src/sync/parker.rs":"3f997f5b41fec286ccedcf3d36f801d741387badb574820b8e3456117ecd9154","src/sync/sharded_lock.rs":"14be659744918d0b27db24c56b41c618b0f0484b6761da46561023d96c4c120f","src/sync/wait_group.rs":"32e946a7581c55f8aa9904527b92b177c538fa0cf7cbcfa1d1f25990582cb6ea","src/thread.rs":"6a7676fd4e50af63aec6f655121a10cd6e8c704f4677125388186ba58dc5842d","tests/atomic_cell.rs":"ba2e34ed1e27f0d0d4f1bb8a5feb4eb8131f756adb27a719de52c26ee7b86b9c","tests/cache_padded.rs":"1bfaff8354c8184e1ee1f902881ca9400b60effb273b0d3f752801a483d2b66d","tests/parker.rs":"6def4721287d9d70b1cfd63ebb34e1c83fbb3376edbad2bc8aac6ef69dd99d20","tests/sharded_lock.rs":"eb6c5b59f007e0d290dd0f58758e8ccb5cacd38af34e3341368ced815f0c41be","tests/thread.rs":"9a7d7d3028c552fd834c68598b04a1cc252a816bc20ab62cec060d6cd09cab10","tests/wait_group.rs":"ad8f0cdfed31f9594a2e0737234d418f8b924d784a4db8d7e469deab8c95f5f8"},"package":"cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120"} -\ No newline at end of file -+{"files":{"CHANGELOG.md":"5242f1740c65509c465c9a36326d344722facff5f5e58dd064f7b77806b83a46","Cargo.toml":"ac35a7b8ccb16f1ab256951576537aa4179a316c068929c2acef89e0adc12319","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"5734ed989dfca1f625b40281ee9f4530f91b2411ec01cb748223e7eb87e201ab","README.md":"dfa9fbed47c344c134a63c84b7c0e4651baeac1554b7b3266d0e38643743fc33","benches/atomic_cell.rs":"c927eb3cd1e5ecc4b91adbc3bde98af15ffab4086190792ba64d5cde0e24df3d","build.rs":"68cfc4be02429834a19411fba29cb1cb52c841f03ac8104d1bae59a8b2184f9c","no_atomic.rs":"a2621c1b029c614fb0ab8e3f5cda2e839df88d90d26133181c1b901965f7eec4","src/atomic/atomic_cell.rs":"1a3a1e073340317b5ce7a94e29c6a87db89ff7e00da6b92cb3c0339364c3b084","src/atomic/consume.rs":"7a7736fcd64f6473dfea7653559ffc5e1a2a234df43835f8aa8734862145ac15","src/atomic/mod.rs":"7f6afd5bd0da1f7b51765ab04da4e5f683588ac2d23506e61bf7007bb1e61ba2","src/atomic/seq_lock.rs":"27182e6b87a9db73c5f6831759f8625f9fcdec3c2828204c444aef04f427735a","src/atomic/seq_lock_wide.rs":"9888dd03116bb89ca36d4ab8d5a0b5032107a2983a7eb8024454263b09080088","src/backoff.rs":"7cc7754e15f69b52e92a70d4f49d1bc274693455a0933a2d7eb0605806566af3","src/cache_padded.rs":"6a512698115ad0d5a5b163dbd7a83247e1f1c146c4a30f3fc74b952e3b767b59","src/lib.rs":"6f1bcf157abe06ad8458a53e865bf8efab9fad4a9424790147cee8fefb3795d8","src/sync/mod.rs":"59986f559a8f170a4b3247ab2eea2460b09809d87c8110ed88e4e7103d3519dc","src/sync/parker.rs":"ba8f75bff31b8be9275808e8f393e71cc682dfc1109ceccb12f69a3700cff5be","src/sync/sharded_lock.rs":"14be659744918d0b27db24c56b41c618b0f0484b6761da46561023d96c4c120f","src/sync/wait_group.rs":"32e946a7581c55f8aa9904527b92b177c538fa0cf7cbcfa1d1f25990582cb6ea","src/thread.rs":"0eb5ec1d3c1b40600d88eb70539d14276e32307f5bed2b679f50f6a20777a01e","tests/atomic_cell.rs":"6c9453384ecbbe76f8b97b62f022d478d3a76b4eae1e960f49790970f5d52158","tests/cache_padded.rs":"1bfaff8354c8184e1ee1f902881ca9400b60effb273b0d3f752801a483d2b66d","tests/parker.rs":"6def4721287d9d70b1cfd63ebb34e1c83fbb3376edbad2bc8aac6ef69dd99d20","tests/sharded_lock.rs":"726025ce6351fb56ed629d5a56bdf6e833b7afc5dedfa08de0b056c726b6c26d","tests/thread.rs":"9a7d7d3028c552fd834c68598b04a1cc252a816bc20ab62cec060d6cd09cab10","tests/wait_group.rs":"ad8f0cdfed31f9594a2e0737234d418f8b924d784a4db8d7e469deab8c95f5f8"},"package":"d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db"} -\ No newline at end of file -diff -up firefox-98.0/third_party/rust/crossbeam-utils/Cargo.toml.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-utils/Cargo.toml ---- firefox-98.0/third_party/rust/crossbeam-utils/Cargo.toml.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-utils/Cargo.toml 2022-03-16 09:33:31.996159993 +0100 -@@ -3,19 +3,21 @@ - # When uploading crates to the registry Cargo will automatically - # "normalize" Cargo.toml files for maximal compatibility - # with all versions of Cargo and also rewrite `path` dependencies --# to registry (e.g., crates.io) dependencies. -+# to registry (e.g., crates.io) dependencies - # --# If you are reading this file be aware that the original Cargo.toml --# will likely look very different (and much more reasonable). --# See Cargo.toml.orig for the original contents. -+# If you believe there's an error in this file please file an -+# issue against the rust-lang/cargo repository. If you're -+# editing this file be aware that the upstream Cargo.toml -+# will likely look very different (and much more reasonable) - - [package] - edition = "2018" --rust-version = "1.36" - name = "crossbeam-utils" --version = "0.8.6" -+version = "0.8.5" -+authors = ["The Crossbeam Project Developers"] - description = "Utilities for concurrent programming" - homepage = "https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-utils" -+documentation = "https://docs.rs/crossbeam-utils" - keywords = ["scoped", "thread", "atomic", "cache"] - categories = ["algorithms", "concurrency", "data-structures", "no-std"] - license = "MIT OR Apache-2.0" -@@ -29,9 +31,6 @@ optional = true - [dev-dependencies.rand] - version = "0.8" - --[dev-dependencies.rustversion] --version = "1" -- - [features] - default = ["std"] - nightly = [] -diff -up firefox-98.0/third_party/rust/crossbeam-utils/CHANGELOG.md.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-utils/CHANGELOG.md ---- firefox-98.0/third_party/rust/crossbeam-utils/CHANGELOG.md.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-utils/CHANGELOG.md 2022-03-16 09:33:31.996159993 +0100 -@@ -1,12 +1,7 @@ --# Version 0.8.6 -- --- Re-add `AtomicCell<{i,u}64>::{fetch_add,fetch_sub,fetch_and,fetch_or,fetch_xor}` that were accidentally removed in 0.8.0 on targets that do not support `Atomic{I,U}64`. (#767) --- Re-add `AtomicCell<{i,u}128>::{fetch_add,fetch_sub,fetch_and,fetch_or,fetch_xor}` that were accidentally removed in 0.8.0. (#767) -- - # Version 0.8.5 - --- Add `AtomicCell::fetch_update`. (#704) --- Support targets that do not have atomic CAS on stable Rust. (#698) -+- Add `AtomicCell::fetch_update` (#704) -+- Support targets that do not have atomic CAS on stable Rust (#698) - - # Version 0.8.4 - -diff -up firefox-98.0/third_party/rust/crossbeam-utils/no_atomic.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-utils/no_atomic.rs ---- firefox-98.0/third_party/rust/crossbeam-utils/no_atomic.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-utils/no_atomic.rs 2022-03-16 09:33:31.996159993 +0100 -@@ -3,8 +3,6 @@ - - const NO_ATOMIC_CAS: &[&str] = &[ - "avr-unknown-gnu-atmega328", -- "bpfeb-unknown-none", -- "bpfel-unknown-none", - "msp430-none-elf", - "riscv32i-unknown-none-elf", - "riscv32imc-unknown-none-elf", -@@ -23,7 +21,6 @@ const NO_ATOMIC_64: &[&str] = &[ - "armv7r-none-eabi", - "armv7r-none-eabihf", - "hexagon-unknown-linux-musl", -- "m68k-unknown-linux-gnu", - "mips-unknown-linux-gnu", - "mips-unknown-linux-musl", - "mips-unknown-linux-uclibc", -@@ -33,7 +30,6 @@ const NO_ATOMIC_64: &[&str] = &[ - "mipsel-unknown-none", - "mipsisa32r6-unknown-linux-gnu", - "mipsisa32r6el-unknown-linux-gnu", -- "powerpc-unknown-freebsd", - "powerpc-unknown-linux-gnu", - "powerpc-unknown-linux-gnuspe", - "powerpc-unknown-linux-musl", -@@ -44,14 +40,12 @@ const NO_ATOMIC_64: &[&str] = &[ - "riscv32gc-unknown-linux-gnu", - "riscv32gc-unknown-linux-musl", - "riscv32imac-unknown-none-elf", -- "riscv32imc-esp-espidf", - "thumbv7em-none-eabi", - "thumbv7em-none-eabihf", - "thumbv7m-none-eabi", - "thumbv8m.base-none-eabi", - "thumbv8m.main-none-eabi", - "thumbv8m.main-none-eabihf", -- "armv6k-nintendo-3ds", - "mipsel-sony-psp", - "thumbv4t-none-eabi", - "thumbv6m-none-eabi", -diff -up firefox-98.0/third_party/rust/crossbeam-utils/src/atomic/atomic_cell.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-utils/src/atomic/atomic_cell.rs ---- firefox-98.0/third_party/rust/crossbeam-utils/src/atomic/atomic_cell.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-utils/src/atomic/atomic_cell.rs 2022-03-16 09:33:31.996159993 +0100 -@@ -295,7 +295,7 @@ impl AtomicCell { - } - - macro_rules! impl_arithmetic { -- ($t:ty, fallback, $example:tt) => { -+ ($t:ty, $example:tt) => { - impl AtomicCell<$t> { - /// Increments the current value by `val` and returns the previous value. - /// -@@ -313,13 +313,10 @@ macro_rules! impl_arithmetic { - /// ``` - #[inline] - pub fn fetch_add(&self, val: $t) -> $t { -- #[cfg(crossbeam_loom)] -- { -- let _ = val; -- unimplemented!("loom does not support non-atomic atomic ops"); -- } -- #[cfg(not(crossbeam_loom))] -- { -+ if can_transmute::<$t, atomic::AtomicUsize>() { -+ let a = unsafe { &*(self.value.get() as *const atomic::AtomicUsize) }; -+ a.fetch_add(val as usize, Ordering::AcqRel) as $t -+ } else { - let _guard = lock(self.value.get() as usize).write(); - let value = unsafe { &mut *(self.value.get()) }; - let old = *value; -@@ -344,13 +341,10 @@ macro_rules! impl_arithmetic { - /// ``` - #[inline] - pub fn fetch_sub(&self, val: $t) -> $t { -- #[cfg(crossbeam_loom)] -- { -- let _ = val; -- unimplemented!("loom does not support non-atomic atomic ops"); -- } -- #[cfg(not(crossbeam_loom))] -- { -+ if can_transmute::<$t, atomic::AtomicUsize>() { -+ let a = unsafe { &*(self.value.get() as *const atomic::AtomicUsize) }; -+ a.fetch_sub(val as usize, Ordering::AcqRel) as $t -+ } else { - let _guard = lock(self.value.get() as usize).write(); - let value = unsafe { &mut *(self.value.get()) }; - let old = *value; -@@ -373,13 +367,10 @@ macro_rules! impl_arithmetic { - /// ``` - #[inline] - pub fn fetch_and(&self, val: $t) -> $t { -- #[cfg(crossbeam_loom)] -- { -- let _ = val; -- unimplemented!("loom does not support non-atomic atomic ops"); -- } -- #[cfg(not(crossbeam_loom))] -- { -+ if can_transmute::<$t, atomic::AtomicUsize>() { -+ let a = unsafe { &*(self.value.get() as *const atomic::AtomicUsize) }; -+ a.fetch_and(val as usize, Ordering::AcqRel) as $t -+ } else { - let _guard = lock(self.value.get() as usize).write(); - let value = unsafe { &mut *(self.value.get()) }; - let old = *value; -@@ -402,13 +393,10 @@ macro_rules! impl_arithmetic { - /// ``` - #[inline] - pub fn fetch_or(&self, val: $t) -> $t { -- #[cfg(crossbeam_loom)] -- { -- let _ = val; -- unimplemented!("loom does not support non-atomic atomic ops"); -- } -- #[cfg(not(crossbeam_loom))] -- { -+ if can_transmute::<$t, atomic::AtomicUsize>() { -+ let a = unsafe { &*(self.value.get() as *const atomic::AtomicUsize) }; -+ a.fetch_or(val as usize, Ordering::AcqRel) as $t -+ } else { - let _guard = lock(self.value.get() as usize).write(); - let value = unsafe { &mut *(self.value.get()) }; - let old = *value; -@@ -431,13 +419,10 @@ macro_rules! impl_arithmetic { - /// ``` - #[inline] - pub fn fetch_xor(&self, val: $t) -> $t { -- #[cfg(crossbeam_loom)] -- { -- let _ = val; -- unimplemented!("loom does not support non-atomic atomic ops"); -- } -- #[cfg(not(crossbeam_loom))] -- { -+ if can_transmute::<$t, atomic::AtomicUsize>() { -+ let a = unsafe { &*(self.value.get() as *const atomic::AtomicUsize) }; -+ a.fetch_xor(val as usize, Ordering::AcqRel) as $t -+ } else { - let _guard = lock(self.value.get() as usize).write(); - let value = unsafe { &mut *(self.value.get()) }; - let old = *value; -@@ -556,15 +541,9 @@ impl_arithmetic!(i32, atomic::AtomicI32, - impl_arithmetic!(u64, atomic::AtomicU64, "let a = AtomicCell::new(7u64);"); - #[cfg(not(crossbeam_no_atomic_64))] - impl_arithmetic!(i64, atomic::AtomicI64, "let a = AtomicCell::new(7i64);"); --#[cfg(crossbeam_no_atomic_64)] --impl_arithmetic!(u64, fallback, "let a = AtomicCell::new(7u64);"); --#[cfg(crossbeam_no_atomic_64)] --impl_arithmetic!(i64, fallback, "let a = AtomicCell::new(7i64);"); - // TODO: AtomicU128 is unstable - // impl_arithmetic!(u128, atomic::AtomicU128, "let a = AtomicCell::new(7u128);"); - // impl_arithmetic!(i128, atomic::AtomicI128, "let a = AtomicCell::new(7i128);"); --impl_arithmetic!(u128, fallback, "let a = AtomicCell::new(7u128);"); --impl_arithmetic!(i128, fallback, "let a = AtomicCell::new(7i128);"); - - impl_arithmetic!( - usize, -@@ -704,13 +683,105 @@ fn lock(addr: usize) -> &'static SeqLock - // stored at addresses that are multiples of 3. It'd be too bad if `LEN` was divisible by 3. - // In order to protect from such cases, we simply choose a large prime number for `LEN`. - const LEN: usize = 97; -- #[allow(clippy::declare_interior_mutable_const)] -- const L: SeqLock = SeqLock::new(); -+ - static LOCKS: [SeqLock; LEN] = [ -- L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, -- L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, -- L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, -- L, L, L, L, L, L, L, -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), -+ SeqLock::new(), - ]; - - // If the modulus is a constant number, the compiler will use crazy math to transform this into -@@ -762,6 +833,7 @@ macro_rules! atomic { - ($t:ty, $a:ident, $atomic_op:expr, $fallback_op:expr) => { - loop { - atomic!(@check, $t, AtomicUnit, $a, $atomic_op); -+ atomic!(@check, $t, atomic::AtomicUsize, $a, $atomic_op); - - atomic!(@check, $t, atomic::AtomicU8, $a, $atomic_op); - atomic!(@check, $t, atomic::AtomicU16, $a, $atomic_op); -@@ -783,6 +855,7 @@ macro_rules! atomic { - const fn atomic_is_lock_free() -> bool { - // HACK(taiki-e): This is equivalent to `atomic! { T, _a, true, false }`, but can be used in const fn even in Rust 1.36. - let is_lock_free = can_transmute::() -+ | can_transmute::() - | can_transmute::() - | can_transmute::() - | can_transmute::(); -diff -up firefox-98.0/third_party/rust/crossbeam-utils/src/sync/parker.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-utils/src/sync/parker.rs ---- firefox-98.0/third_party/rust/crossbeam-utils/src/sync/parker.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-utils/src/sync/parker.rs 2022-03-16 09:33:31.996159993 +0100 -@@ -175,7 +175,6 @@ impl Parker { - /// - /// let p = Parker::new(); - /// let raw = Parker::into_raw(p); -- /// # let _ = unsafe { Parker::from_raw(raw) }; - /// ``` - pub fn into_raw(this: Parker) -> *const () { - Unparker::into_raw(this.unparker) -@@ -259,7 +258,6 @@ impl Unparker { - /// let p = Parker::new(); - /// let u = p.unparker().clone(); - /// let raw = Unparker::into_raw(u); -- /// # let _ = unsafe { Unparker::from_raw(raw) }; - /// ``` - pub fn into_raw(this: Unparker) -> *const () { - Arc::into_raw(this.inner) as *const () -diff -up firefox-98.0/third_party/rust/crossbeam-utils/src/thread.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-utils/src/thread.rs ---- firefox-98.0/third_party/rust/crossbeam-utils/src/thread.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:40.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-utils/src/thread.rs 2022-03-16 09:33:31.996159993 +0100 -@@ -446,7 +446,7 @@ impl<'scope, 'env> ScopedThreadBuilder<' - unsafe { mem::transmute(closure) }; - - // Finally, spawn the closure. -- self.builder.spawn(closure)? -+ self.builder.spawn(move || closure())? - }; - - let thread = handle.thread().clone(); -diff -up firefox-98.0/third_party/rust/crossbeam-utils/tests/atomic_cell.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-utils/tests/atomic_cell.rs ---- firefox-98.0/third_party/rust/crossbeam-utils/tests/atomic_cell.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-utils/tests/atomic_cell.rs 2022-03-16 09:33:31.996159993 +0100 -@@ -264,22 +264,3 @@ fn const_atomic_cell_new() { - CELL.store(1); - assert_eq!(CELL.load(), 1); - } -- --// https://github.com/crossbeam-rs/crossbeam/issues/748 --#[cfg_attr(miri, ignore)] // TODO --#[rustversion::since(1.37)] // #[repr(align(N))] requires Rust 1.37 --#[test] --fn issue_748() { -- #[allow(dead_code)] -- #[repr(align(8))] -- #[derive(Debug, Clone, Copy, PartialEq, Eq)] -- enum Test { -- Field(u32), -- FieldLess, -- } -- -- assert_eq!(mem::size_of::(), 8); -- assert!(AtomicCell::::is_lock_free()); -- let x = AtomicCell::new(Test::FieldLess); -- assert_eq!(x.load(), Test::FieldLess); --} -diff -up firefox-98.0/third_party/rust/crossbeam-utils/tests/sharded_lock.rs.crossbeam-downgrade-rhbz2063961 firefox-98.0/third_party/rust/crossbeam-utils/tests/sharded_lock.rs ---- firefox-98.0/third_party/rust/crossbeam-utils/tests/sharded_lock.rs.crossbeam-downgrade-rhbz2063961 2022-03-05 00:04:39.000000000 +0100 -+++ firefox-98.0/third_party/rust/crossbeam-utils/tests/sharded_lock.rs 2022-03-16 09:33:31.996159993 +0100 -@@ -21,9 +21,6 @@ fn smoke() { - #[test] - fn frob() { - const N: u32 = 10; -- #[cfg(miri)] -- const M: usize = 100; -- #[cfg(not(miri))] - const M: usize = 1000; - - let r = Arc::new(ShardedLock::new(())); diff --git a/firefox.spec b/firefox.spec index 238bca8..23f2eb0 100644 --- a/firefox.spec +++ b/firefox.spec @@ -216,7 +216,6 @@ Patch54: mozilla-1669639.patch Patch55: firefox-testing.patch Patch61: firefox-glibc-dynstack.patch Patch62: build-python.patch -Patch70: crossbeam-downgrade-rhbz2063961.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch # Test patches @@ -459,9 +458,6 @@ This package contains results of tests executed during build. %patch49 -p1 -b .build-arm-libaom %patch53 -p1 -b .firefox-gcc-build %patch54 -p1 -b .1669639 -%ifarch aarch64 -%patch70 -p1 -b .crossbeam-downgrade-rhbz2063961 -%endif %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 # Test patches From 2dbae13edb2b3b34b241b25227bded589539a56a Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 6 Apr 2022 15:07:45 +0200 Subject: [PATCH 036/545] Removed D142257.diff --- D142257.diff | 313 --------------------------------------------------- firefox.spec | 2 - 2 files changed, 315 deletions(-) delete mode 100644 D142257.diff diff --git a/D142257.diff b/D142257.diff deleted file mode 100644 index 5779e41..0000000 --- a/D142257.diff +++ /dev/null @@ -1,313 +0,0 @@ -diff -up firefox-99.0/gfx/gl/GLContextEGL.h.D142257 firefox-99.0/gfx/gl/GLContextEGL.h ---- firefox-99.0/gfx/gl/GLContextEGL.h.D142257 2022-03-31 01:24:45.000000000 +0200 -+++ firefox-99.0/gfx/gl/GLContextEGL.h 2022-04-06 10:32:53.287145554 +0200 -@@ -21,11 +21,9 @@ class CompositorWidget; - } // namespace widget - namespace gl { - --RefPtr DefaultEglLibrary(nsACString* const out_failureId); -- - inline std::shared_ptr DefaultEglDisplay( - nsACString* const out_failureId) { -- const auto lib = DefaultEglLibrary(out_failureId); -+ const auto lib = GLLibraryEGL::Get(out_failureId); - if (!lib) { - return nullptr; - } -diff -up firefox-99.0/gfx/gl/GLContextProviderEGL.cpp.D142257 firefox-99.0/gfx/gl/GLContextProviderEGL.cpp ---- firefox-99.0/gfx/gl/GLContextProviderEGL.cpp.D142257 2022-03-31 01:24:50.000000000 +0200 -+++ firefox-99.0/gfx/gl/GLContextProviderEGL.cpp 2022-04-06 10:34:20.468017966 +0200 -@@ -237,7 +237,7 @@ class GLContextEGLFactory { - already_AddRefed GLContextEGLFactory::CreateImpl( - EGLNativeWindowType aWindow, bool aHardwareWebRender, bool aUseGles) { - nsCString failureId; -- const auto lib = gl::DefaultEglLibrary(&failureId); -+ const auto lib = GLLibraryEGL::Get(&failureId); - if (!lib) { - gfxCriticalNote << "Failed[3] to load EGL library: " << failureId.get(); - return nullptr; -@@ -1209,32 +1209,8 @@ already_AddRefed GLContextPro - /*static*/ - GLContext* GLContextProviderEGL::GetGlobalContext() { return nullptr; } - --// - -- --static StaticMutex sMutex; --static StaticRefPtr gDefaultEglLibrary; -- --RefPtr DefaultEglLibrary(nsACString* const out_failureId) { -- StaticMutexAutoLock lock(sMutex); -- if (!gDefaultEglLibrary) { -- gDefaultEglLibrary = GLLibraryEGL::Create(out_failureId); -- if (!gDefaultEglLibrary) { -- NS_WARNING("GLLibraryEGL::Create failed"); -- } -- } -- return gDefaultEglLibrary.get(); --} -- --// - -- - /*static*/ --void GLContextProviderEGL::Shutdown() { -- StaticMutexAutoLock lock(sMutex); -- if (!gDefaultEglLibrary) { -- return; -- } -- gDefaultEglLibrary = nullptr; --} -+void GLContextProviderEGL::Shutdown() { GLLibraryEGL::Shutdown(); } - - } /* namespace gl */ - } /* namespace mozilla */ -diff -up firefox-99.0/gfx/gl/GLLibraryEGL.cpp.D142257 firefox-99.0/gfx/gl/GLLibraryEGL.cpp ---- firefox-99.0/gfx/gl/GLLibraryEGL.cpp.D142257 2022-03-31 01:24:45.000000000 +0200 -+++ firefox-99.0/gfx/gl/GLLibraryEGL.cpp 2022-04-06 10:32:53.288145587 +0200 -@@ -48,6 +48,9 @@ - namespace mozilla { - namespace gl { - -+StaticMutex GLLibraryEGL::sMutex; -+StaticRefPtr GLLibraryEGL::sInstance; -+ - // should match the order of EGLExtensions, and be null-terminated. - static const char* sEGLLibraryExtensionNames[] = { - "EGL_ANDROID_get_native_client_buffer", "EGL_ANGLE_device_creation", -@@ -140,15 +143,17 @@ static PRLibrary* LoadLibraryForEGLOnWin - - #endif // XP_WIN - --static std::shared_ptr GetAndInitDisplay(GLLibraryEGL& egl, -- void* displayType) { -+static std::shared_ptr GetAndInitDisplay( -+ GLLibraryEGL& egl, void* displayType, -+ const StaticMutexAutoLock& aProofOfLock) { - const auto display = egl.fGetDisplay(displayType); - if (!display) return nullptr; -- return EglDisplay::Create(egl, display, false); -+ return EglDisplay::Create(egl, display, false, aProofOfLock); - } - --static std::shared_ptr GetAndInitWARPDisplay(GLLibraryEGL& egl, -- void* displayType) { -+static std::shared_ptr GetAndInitWARPDisplay( -+ GLLibraryEGL& egl, void* displayType, -+ const StaticMutexAutoLock& aProofOfLock) { - const EGLAttrib attrib_list[] = { - LOCAL_EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE, - LOCAL_EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE, -@@ -167,11 +172,12 @@ static std::shared_ptr GetAn - return nullptr; - } - -- return EglDisplay::Create(egl, display, true); -+ return EglDisplay::Create(egl, display, true, aProofOfLock); - } - - std::shared_ptr GLLibraryEGL::CreateDisplay( - ID3D11Device* const d3d11Device) { -+ StaticMutexAutoLock lock(sMutex); - EGLDeviceEXT eglDevice = - fCreateDeviceANGLE(LOCAL_EGL_D3D11_DEVICE_ANGLE, d3d11Device, nullptr); - if (!eglDevice) { -@@ -199,7 +205,7 @@ std::shared_ptr GLLibraryEGL - return nullptr; - } - -- const auto ret = EglDisplay::Create(*this, display, false); -+ const auto ret = EglDisplay::Create(*this, display, false, lock); - - if (!ret) { - const EGLint err = fGetError(); -@@ -263,7 +269,8 @@ class AngleErrorReporting { - AngleErrorReporting gAngleErrorReporter; - - static std::shared_ptr GetAndInitDisplayForAccelANGLE( -- GLLibraryEGL& egl, nsACString* const out_failureId) { -+ GLLibraryEGL& egl, nsACString* const out_failureId, -+ const StaticMutexAutoLock& aProofOfLock) { - gfx::FeatureState& d3d11ANGLE = - gfx::gfxConfig::GetFeature(gfx::Feature::D3D11_HW_ANGLE); - -@@ -285,16 +292,18 @@ static std::shared_ptr GetAn - }); - - if (gfx::gfxConfig::IsForcedOnByUser(gfx::Feature::D3D11_HW_ANGLE)) { -- return GetAndInitDisplay(egl, LOCAL_EGL_D3D11_ONLY_DISPLAY_ANGLE); -+ return GetAndInitDisplay(egl, LOCAL_EGL_D3D11_ONLY_DISPLAY_ANGLE, -+ aProofOfLock); - } - - std::shared_ptr ret; - if (d3d11ANGLE.IsEnabled()) { -- ret = GetAndInitDisplay(egl, LOCAL_EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE); -+ ret = GetAndInitDisplay(egl, LOCAL_EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE, -+ aProofOfLock); - } - - if (!ret) { -- ret = GetAndInitDisplay(egl, EGL_DEFAULT_DISPLAY); -+ ret = GetAndInitDisplay(egl, EGL_DEFAULT_DISPLAY, aProofOfLock); - } - - if (!ret && out_failureId->IsEmpty()) { -@@ -326,12 +335,20 @@ Maybe GLLibraryEGL::GetSym - // - - - /* static */ --RefPtr GLLibraryEGL::Create(nsACString* const out_failureId) { -- RefPtr ret = new GLLibraryEGL; -- if (!ret->Init(out_failureId)) { -- return nullptr; -+RefPtr GLLibraryEGL::Get(nsACString* const out_failureId) { -+ StaticMutexAutoLock lock(sMutex); -+ if (!sInstance) { -+ sInstance = new GLLibraryEGL; -+ if (NS_WARN_IF(!sInstance->Init(out_failureId))) { -+ sInstance = nullptr; -+ } - } -- return ret; -+ return sInstance; -+} -+ -+/* static */ void GLLibraryEGL::Shutdown() { -+ StaticMutexAutoLock lock(sMutex); -+ sInstance = nullptr; - } - - bool GLLibraryEGL::Init(nsACString* const out_failureId) { -@@ -640,9 +657,9 @@ static void MarkExtensions(const char* r - // - - - // static --std::shared_ptr EglDisplay::Create(GLLibraryEGL& lib, -- const EGLDisplay display, -- const bool isWarp) { -+std::shared_ptr EglDisplay::Create( -+ GLLibraryEGL& lib, const EGLDisplay display, const bool isWarp, -+ const StaticMutexAutoLock& aProofOfLock) { - // Retrieve the EglDisplay if it already exists - { - const auto itr = lib.mActiveDisplays.find(display); -@@ -710,6 +727,7 @@ EglDisplay::EglDisplay(const PrivateUseO - } - - EglDisplay::~EglDisplay() { -+ StaticMutexAutoLock lock(GLLibraryEGL::sMutex); - fTerminate(); - mLib->mActiveDisplays.erase(mDisplay); - } -@@ -718,16 +736,24 @@ EglDisplay::~EglDisplay() { - - std::shared_ptr GLLibraryEGL::DefaultDisplay( - nsACString* const out_failureId) { -+ StaticMutexAutoLock lock(sMutex); - auto ret = mDefaultDisplay.lock(); - if (ret) return ret; - -- ret = CreateDisplay(false, out_failureId); -+ ret = CreateDisplayLocked(false, out_failureId, lock); - mDefaultDisplay = ret; - return ret; - } - - std::shared_ptr GLLibraryEGL::CreateDisplay( - const bool forceAccel, nsACString* const out_failureId) { -+ StaticMutexAutoLock lock(sMutex); -+ return CreateDisplayLocked(forceAccel, out_failureId, lock); -+} -+ -+std::shared_ptr GLLibraryEGL::CreateDisplayLocked( -+ const bool forceAccel, nsACString* const out_failureId, -+ const StaticMutexAutoLock& aProofOfLock) { - std::shared_ptr ret; - - if (IsExtensionSupported(EGLLibExtension::ANGLE_platform_angle_d3d)) { -@@ -747,7 +773,7 @@ std::shared_ptr GLLibraryEGL - - // Hardware accelerated ANGLE path (supported or force accel) - if (shouldTryAccel) { -- ret = GetAndInitDisplayForAccelANGLE(*this, out_failureId); -+ ret = GetAndInitDisplayForAccelANGLE(*this, out_failureId, aProofOfLock); - } - - // Report the acceleration status to telemetry -@@ -766,7 +792,7 @@ std::shared_ptr GLLibraryEGL - - // Fallback to a WARP display if ANGLE fails, or if WARP is forced - if (!ret && shouldTryWARP) { -- ret = GetAndInitWARPDisplay(*this, EGL_DEFAULT_DISPLAY); -+ ret = GetAndInitWARPDisplay(*this, EGL_DEFAULT_DISPLAY, aProofOfLock); - if (!ret) { - if (out_failureId->IsEmpty()) { - *out_failureId = "FEATURE_FAILURE_WARP_FALLBACK"_ns; -@@ -788,7 +814,7 @@ std::shared_ptr GLLibraryEGL - } - } - #endif -- ret = GetAndInitDisplay(*this, nativeDisplay); -+ ret = GetAndInitDisplay(*this, nativeDisplay, aProofOfLock); - } - - if (!ret) { -diff -up firefox-99.0/gfx/gl/GLLibraryEGL.h.D142257 firefox-99.0/gfx/gl/GLLibraryEGL.h ---- firefox-99.0/gfx/gl/GLLibraryEGL.h.D142257 2022-03-31 01:24:50.000000000 +0200 -+++ firefox-99.0/gfx/gl/GLLibraryEGL.h 2022-04-06 10:32:53.288145587 +0200 -@@ -13,6 +13,8 @@ - #include "mozilla/EnumTypeTraits.h" - #include "mozilla/Maybe.h" - #include "mozilla/RefPtr.h" -+#include "mozilla/StaticMutex.h" -+#include "mozilla/StaticPtr.h" - #include "nsISupports.h" - #include "prlink.h" - -@@ -125,14 +127,22 @@ class GLLibraryEGL final { - std::unordered_map> mActiveDisplays; - - public: -- static RefPtr Create(nsACString* const out_failureId); -+ static RefPtr Get(nsACString* const out_failureId); -+ static void Shutdown(); - - private: - ~GLLibraryEGL() = default; - -+ static StaticMutex sMutex; -+ static StaticRefPtr sInstance GUARDED_BY(sMutex); -+ - bool Init(nsACString* const out_failureId); - void InitLibExtensions(); - -+ std::shared_ptr CreateDisplayLocked( -+ bool forceAccel, nsACString* const out_failureId, -+ const StaticMutexAutoLock& aProofOfLock); -+ - public: - Maybe GetSymbolLoader() const; - -@@ -599,8 +609,9 @@ class EglDisplay final { - struct PrivateUseOnly final {}; - - public: -- static std::shared_ptr Create(GLLibraryEGL&, EGLDisplay, -- bool isWarp); -+ static std::shared_ptr Create( -+ GLLibraryEGL&, EGLDisplay, bool isWarp, -+ const StaticMutexAutoLock& aProofOfLock); - - // Only `public` for make_shared. - EglDisplay(const PrivateUseOnly&, GLLibraryEGL&, EGLDisplay, bool isWarp); -diff -up firefox-99.0/gfx/webrender_bindings/RenderThread.cpp.D142257 firefox-99.0/gfx/webrender_bindings/RenderThread.cpp ---- firefox-99.0/gfx/webrender_bindings/RenderThread.cpp.D142257 2022-03-31 01:24:51.000000000 +0200 -+++ firefox-99.0/gfx/webrender_bindings/RenderThread.cpp 2022-04-06 10:32:53.288145587 +0200 -@@ -1163,7 +1163,7 @@ static already_AddRefed C - } - - nsCString failureId; -- const auto lib = gl::DefaultEglLibrary(&failureId); -+ const auto lib = gl::GLLibraryEGL::Get(&failureId); - if (!lib) { - aError.Assign( - nsPrintfCString("RcANGLE(load EGL lib failed: %s)", failureId.get())); diff --git a/firefox.spec b/firefox.spec index 23f2eb0..86390b6 100644 --- a/firefox.spec +++ b/firefox.spec @@ -241,7 +241,6 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch -Patch416: D142257.diff # PGO/LTO patches Patch600: pgo.patch @@ -481,7 +480,6 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 -%patch416 -p1 -b .D142257 # PGO patches %if %{build_with_pgo} From 93042ae00cde4cc73391a210646be02318e3c826 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 7 Apr 2022 11:34:40 +0200 Subject: [PATCH 037/545] Added ppc64le build fixes --- D141827.diff | 207 ++++++++++++++++++++++++++++++++++++++++++ D141828.diff | 252 +++++++++++++++++++++++++++++++++++++++++++++++++++ firefox.spec | 4 + 3 files changed, 463 insertions(+) create mode 100644 D141827.diff create mode 100644 D141828.diff diff --git a/D141827.diff b/D141827.diff new file mode 100644 index 0000000..67caf5f --- /dev/null +++ b/D141827.diff @@ -0,0 +1,207 @@ +diff -up firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.D141827 firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp +--- firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.D141827 2022-03-31 01:24:44.000000000 +0200 ++++ firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp 2022-04-07 10:10:11.608526890 +0200 +@@ -6,7 +6,7 @@ + + #include "FFmpegVideoFramePool.h" + #include "FFmpegLog.h" +-#include "mozilla/widget/DMABufLibWrapper.h" ++#include "mozilla/widget/DMABufLibWrapper.h" + #include "libavutil/pixfmt.h" + + #undef FFMPEG_LOG +@@ -15,11 +15,11 @@ + + namespace mozilla { + +-RefPtr VideoFrameSurfaceVAAPI::GetAsImage() { ++RefPtr VideoFrameSurface::GetAsImage() { + return new layers::DMABUFSurfaceImage(mSurface); + } + +-VideoFrameSurfaceVAAPI::VideoFrameSurfaceVAAPI(DMABufSurface* aSurface) ++VideoFrameSurface::VideoFrameSurface(DMABufSurface* aSurface) + : mSurface(aSurface), + mLib(nullptr), + mAVHWFramesContext(nullptr), +@@ -30,22 +30,22 @@ VideoFrameSurfaceVAAPI::VideoFrameSurfac + MOZ_ASSERT(mSurface); + MOZ_RELEASE_ASSERT(mSurface->GetAsDMABufSurfaceYUV()); + mSurface->GlobalRefCountCreate(); +- FFMPEG_LOG("VideoFrameSurfaceVAAPI: creating surface UID = %d", ++ FFMPEG_LOG("VideoFrameSurface: creating surface UID = %d", + mSurface->GetUID()); + } + +-void VideoFrameSurfaceVAAPI::LockVAAPIData(AVCodecContext* aAVCodecContext, ++void VideoFrameSurface::LockVAAPIData(AVCodecContext* aAVCodecContext, + AVFrame* aAVFrame, + FFmpegLibWrapper* aLib) { +- FFMPEG_LOG("VideoFrameSurfaceVAAPI: VAAPI locking dmabuf surface UID = %d", ++ FFMPEG_LOG("VideoFrameSurface: VAAPI locking dmabuf surface UID = %d", + mSurface->GetUID()); + mLib = aLib; + mAVHWFramesContext = aLib->av_buffer_ref(aAVCodecContext->hw_frames_ctx); + mHWAVBuffer = aLib->av_buffer_ref(aAVFrame->buf[0]); + } + +-void VideoFrameSurfaceVAAPI::ReleaseVAAPIData(bool aForFrameRecycle) { +- FFMPEG_LOG("VideoFrameSurfaceVAAPI: VAAPI releasing dmabuf surface UID = %d", ++void VideoFrameSurface::ReleaseVAAPIData(bool aForFrameRecycle) { ++ FFMPEG_LOG("VideoFrameSurface: VAAPI releasing dmabuf surface UID = %d", + mSurface->GetUID()); + + // It's possible to unref GPU data while IsUsed() is still set. +@@ -67,8 +67,8 @@ void VideoFrameSurfaceVAAPI::ReleaseVAAP + } + } + +-VideoFrameSurfaceVAAPI::~VideoFrameSurfaceVAAPI() { +- FFMPEG_LOG("VideoFrameSurfaceVAAPI: deleting dmabuf surface UID = %d", ++VideoFrameSurface::~VideoFrameSurface() { ++ FFMPEG_LOG("VideoFrameSurface: deleting dmabuf surface UID = %d", + mSurface->GetUID()); + // We're about to quit, no need to recycle the frames. + ReleaseVAAPIData(/* aForFrameRecycle */ false); +@@ -84,9 +84,8 @@ VideoFramePool::~VideoFramePool() { + void VideoFramePool::ReleaseUnusedVAAPIFrames() { + MutexAutoLock lock(mSurfaceLock); + for (const auto& surface : mDMABufSurfaces) { +- auto* vaapiSurface = surface->AsVideoFrameSurfaceVAAPI(); +- if (!vaapiSurface->IsUsed()) { +- vaapiSurface->ReleaseVAAPIData(); ++ if (!surface->IsUsed()) { ++ surface->ReleaseVAAPIData(); + } + } + } +@@ -96,8 +95,7 @@ RefPtr VideoFramePool + if (surface->IsUsed()) { + continue; + } +- auto* vaapiSurface = surface->AsVideoFrameSurfaceVAAPI(); +- vaapiSurface->ReleaseVAAPIData(); ++ surface->ReleaseVAAPIData(); + return surface; + } + return nullptr; +@@ -121,7 +119,7 @@ RefPtr VideoFramePool + return nullptr; + } + FFMPEG_LOG("Created new VA-API DMABufSurface UID = %d", surface->GetUID()); +- RefPtr surf = new VideoFrameSurfaceVAAPI(surface); ++ RefPtr surf = new VideoFrameSurface(surface); + if (!mTextureCreationWorks) { + mTextureCreationWorks = Some(surface->VerifyTextureCreation()); + } +@@ -138,11 +136,8 @@ RefPtr VideoFramePool + } + FFMPEG_LOG("Reusing VA-API DMABufSurface UID = %d", surface->GetUID()); + } +- +- auto* vaapiSurface = videoSurface->AsVideoFrameSurfaceVAAPI(); +- vaapiSurface->LockVAAPIData(aAVCodecContext, aAVFrame, aLib); +- vaapiSurface->MarkAsUsed(); +- ++ videoSurface->LockVAAPIData(aAVCodecContext, aAVFrame, aLib); ++ videoSurface->MarkAsUsed(); + return videoSurface; + } + +diff -up firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.D141827 firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h +--- firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.D141827 2022-03-31 01:24:44.000000000 +0200 ++++ firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h 2022-04-07 10:09:46.527708638 +0200 +@@ -17,42 +17,17 @@ + namespace mozilla { + + class VideoFramePool; +-class VideoFrameSurfaceVAAPI; + +-class VideoFrameSurface { +- public: +- NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VideoFrameSurface) +- +- VideoFrameSurface() = default; +- +- virtual VideoFrameSurfaceVAAPI* AsVideoFrameSurfaceVAAPI() { return nullptr; } +- +- virtual void SetYUVColorSpace(gfx::YUVColorSpace aColorSpace) = 0; +- virtual void SetColorRange(gfx::ColorRange aColorRange) = 0; +- +- virtual RefPtr GetDMABufSurface() { return nullptr; }; +- virtual RefPtr GetAsImage() = 0; +- +- // Don't allow VideoFrameSurface plain copy as it leads to +- // unexpected DMABufSurface/HW buffer releases and we don't want to +- // deep copy them. +- VideoFrameSurface(const VideoFrameSurface&) = delete; +- const VideoFrameSurface& operator=(VideoFrameSurface const&) = delete; +- +- protected: +- virtual ~VideoFrameSurface(){}; +-}; +- +-// VideoFrameSurfaceVAAPI holds a reference to GPU data with a video frame. ++// VideoFrameSurface holds a reference to GPU data with a video frame. + // + // Actual GPU pixel data are stored at DMABufSurface and + // DMABufSurface is passed to gecko GL rendering pipeline via. + // DMABUFSurfaceImage. + // +-// VideoFrameSurfaceVAAPI can optionally hold VA-API ffmpeg related data to keep ++// VideoFrameSurface can optionally hold VA-API ffmpeg related data to keep + // GPU data locked untill we need them. + // +-// VideoFrameSurfaceVAAPI is used for both HW accelerated video decoding ++// VideoFrameSurface is used for both HW accelerated video decoding + // (VA-API) and ffmpeg SW decoding. + // + // VA-API scenario +@@ -72,13 +47,13 @@ class VideoFrameSurface { + // Unfortunately there isn't any obvious way how to mark particular VASurface + // as used. The best we can do is to hold a reference to particular AVBuffer + // from decoded AVFrame and AVHWFramesContext which owns the AVBuffer. +-class VideoFrameSurfaceVAAPI final : public VideoFrameSurface { ++class VideoFrameSurface { + friend class VideoFramePool; + + public: +- explicit VideoFrameSurfaceVAAPI(DMABufSurface* aSurface); ++ NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VideoFrameSurface) + +- VideoFrameSurfaceVAAPI* AsVideoFrameSurfaceVAAPI() final { return this; } ++ explicit VideoFrameSurface(DMABufSurface* aSurface); + + void SetYUVColorSpace(mozilla::gfx::YUVColorSpace aColorSpace) { + mSurface->GetAsDMABufSurfaceYUV()->SetYUVColorSpace(aColorSpace); +@@ -93,6 +68,12 @@ class VideoFrameSurfaceVAAPI final : pub + + RefPtr GetAsImage(); + ++ // Don't allow VideoFrameSurface plain copy as it leads to ++ // unexpected DMABufSurface/HW buffer releases and we don't want to ++ // deep copy them. ++ VideoFrameSurface(const VideoFrameSurface&) = delete; ++ const VideoFrameSurface& operator=(VideoFrameSurface const&) = delete; ++ + protected: + // Lock VAAPI related data + void LockVAAPIData(AVCodecContext* aAVCodecContext, AVFrame* aAVFrame, +@@ -107,7 +88,7 @@ class VideoFrameSurfaceVAAPI final : pub + void MarkAsUsed() { mSurface->GlobalRefAdd(); } + + private: +- virtual ~VideoFrameSurfaceVAAPI(); ++ virtual ~VideoFrameSurface(); + + const RefPtr mSurface; + const FFmpegLibWrapper* mLib; +@@ -132,7 +113,7 @@ class VideoFramePool final { + private: + // Protect mDMABufSurfaces pool access + Mutex mSurfaceLock; +- nsTArray> mDMABufSurfaces; ++ nsTArray> mDMABufSurfaces; + // We may fail to create texture over DMABuf memory due to driver bugs so + // check that before we export first DMABuf video frame. + Maybe mTextureCreationWorks; diff --git a/D141828.diff b/D141828.diff new file mode 100644 index 0000000..b2475e9 --- /dev/null +++ b/D141828.diff @@ -0,0 +1,252 @@ +diff -up firefox-99.0/dom/media/platforms/ffmpeg/ffmpeg58/moz.build.D141828 firefox-99.0/dom/media/platforms/ffmpeg/ffmpeg58/moz.build +--- firefox-99.0/dom/media/platforms/ffmpeg/ffmpeg58/moz.build.D141828 2022-03-31 01:24:44.000000000 +0200 ++++ firefox-99.0/dom/media/platforms/ffmpeg/ffmpeg58/moz.build 2022-04-07 10:11:34.981246890 +0200 +@@ -30,6 +30,9 @@ if CONFIG['MOZ_WAYLAND']: + CXXFLAGS += CONFIG['MOZ_GTK3_CFLAGS'] + DEFINES['MOZ_WAYLAND_USE_VAAPI'] = 1 + USE_LIBS += ['mozva'] ++ UNIFIED_SOURCES += [ ++ '../FFmpegVideoFramePool.cpp', ++ ] + + include("/ipc/chromium/chromium-config.mozbuild") + +diff -up firefox-99.0/dom/media/platforms/ffmpeg/ffmpeg59/moz.build.D141828 firefox-99.0/dom/media/platforms/ffmpeg/ffmpeg59/moz.build +--- firefox-99.0/dom/media/platforms/ffmpeg/ffmpeg59/moz.build.D141828 2022-03-31 01:24:44.000000000 +0200 ++++ firefox-99.0/dom/media/platforms/ffmpeg/ffmpeg59/moz.build 2022-04-07 10:11:34.981246890 +0200 +@@ -30,6 +30,9 @@ if CONFIG["MOZ_WAYLAND"]: + CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"] + DEFINES["MOZ_WAYLAND_USE_VAAPI"] = 1 + USE_LIBS += ["mozva"] ++ UNIFIED_SOURCES += [ ++ "../FFmpegVideoFramePool.cpp", ++ ] + + include("/ipc/chromium/chromium-config.mozbuild") + +diff -up firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp.D141828 firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp +--- firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp.D141828 2022-03-31 01:24:44.000000000 +0200 ++++ firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp 2022-04-07 10:11:34.981246890 +0200 +@@ -814,7 +814,7 @@ MediaResult FFmpegVideoDecoder(); ++ mVideoFramePool = MakeUnique>(); + } + + // Release unused VA-API surfaces before avcodec_receive_frame() as +diff -up firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h.D141828 firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h +--- firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h.D141828 2022-03-31 01:24:44.000000000 +0200 ++++ firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h 2022-04-07 10:11:34.981246890 +0200 +@@ -16,6 +16,9 @@ + #if LIBAVCODEC_VERSION_MAJOR >= 57 && LIBAVUTIL_VERSION_MAJOR >= 56 + # include "mozilla/layers/TextureClient.h" + #endif ++#ifdef MOZ_WAYLAND_USE_VAAPI ++# include "FFmpegVideoFramePool.h" ++#endif + + struct _VADRMPRIMESurfaceDescriptor; + typedef struct _VADRMPRIMESurfaceDescriptor VADRMPRIMESurfaceDescriptor; +@@ -23,7 +26,6 @@ typedef struct _VADRMPRIMESurfaceDescrip + namespace mozilla { + + class ImageBufferWrapper; +-class VideoFramePool; + + template + class FFmpegVideoDecoder : public FFmpegDataDecoder {}; +@@ -138,7 +140,7 @@ class FFmpegVideoDecoder + AVBufferRef* mVAAPIDeviceContext; + bool mEnableHardwareDecoding; + VADisplay mDisplay; +- UniquePtr mVideoFramePool; ++ UniquePtr> mVideoFramePool; + static nsTArray mAcceleratedFormats; + #endif + RefPtr mImageAllocator; +diff -up firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.D141828 firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp +--- firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.D141828 2022-04-07 10:11:34.980246857 +0200 ++++ firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp 2022-04-07 10:16:02.390971008 +0200 +@@ -5,6 +5,7 @@ + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + #include "FFmpegVideoFramePool.h" ++#include "PlatformDecoderModule.h" + #include "FFmpegLog.h" + #include "mozilla/widget/DMABufLibWrapper.h" + #include "libavutil/pixfmt.h" +@@ -15,11 +16,11 @@ + + namespace mozilla { + +-RefPtr VideoFrameSurface::GetAsImage() { ++RefPtr VideoFrameSurface::GetAsImage() { + return new layers::DMABUFSurfaceImage(mSurface); + } + +-VideoFrameSurface::VideoFrameSurface(DMABufSurface* aSurface) ++VideoFrameSurface::VideoFrameSurface(DMABufSurface* aSurface) + : mSurface(aSurface), + mLib(nullptr), + mAVHWFramesContext(nullptr), +@@ -34,7 +35,7 @@ VideoFrameSurface::VideoFrameSurface(DMA + mSurface->GetUID()); + } + +-void VideoFrameSurface::LockVAAPIData(AVCodecContext* aAVCodecContext, ++void VideoFrameSurface::LockVAAPIData(AVCodecContext* aAVCodecContext, + AVFrame* aAVFrame, + FFmpegLibWrapper* aLib) { + FFMPEG_LOG("VideoFrameSurface: VAAPI locking dmabuf surface UID = %d", +@@ -44,7 +45,7 @@ void VideoFrameSurface::LockVAAPIData(AV + mHWAVBuffer = aLib->av_buffer_ref(aAVFrame->buf[0]); + } + +-void VideoFrameSurface::ReleaseVAAPIData(bool aForFrameRecycle) { ++void VideoFrameSurface::ReleaseVAAPIData(bool aForFrameRecycle) { + FFMPEG_LOG("VideoFrameSurface: VAAPI releasing dmabuf surface UID = %d", + mSurface->GetUID()); + +@@ -67,21 +68,22 @@ void VideoFrameSurface::ReleaseVAAPIData + } + } + +-VideoFrameSurface::~VideoFrameSurface() { ++VideoFrameSurface::~VideoFrameSurface() { + FFMPEG_LOG("VideoFrameSurface: deleting dmabuf surface UID = %d", + mSurface->GetUID()); + // We're about to quit, no need to recycle the frames. + ReleaseVAAPIData(/* aForFrameRecycle */ false); + } + +-VideoFramePool::VideoFramePool() : mSurfaceLock("VideoFramePoolSurfaceLock") {} ++VideoFramePool::VideoFramePool() ++ : mSurfaceLock("VideoFramePoolSurfaceLock") {} + +-VideoFramePool::~VideoFramePool() { ++VideoFramePool::~VideoFramePool() { + MutexAutoLock lock(mSurfaceLock); + mDMABufSurfaces.Clear(); + } + +-void VideoFramePool::ReleaseUnusedVAAPIFrames() { ++void VideoFramePool::ReleaseUnusedVAAPIFrames() { + MutexAutoLock lock(mSurfaceLock); + for (const auto& surface : mDMABufSurfaces) { + if (!surface->IsUsed()) { +@@ -90,7 +92,8 @@ void VideoFramePool::ReleaseUnusedVAAPIF + } + } + +-RefPtr VideoFramePool::GetFreeVideoFrameSurface() { ++RefPtr> ++VideoFramePool::GetFreeVideoFrameSurface() { + for (auto& surface : mDMABufSurfaces) { + if (surface->IsUsed()) { + continue; +@@ -101,7 +104,8 @@ RefPtr VideoFramePool + return nullptr; + } + +-RefPtr VideoFramePool::GetVideoFrameSurface( ++RefPtr> ++VideoFramePool::GetVideoFrameSurface( + VADRMPRIMESurfaceDescriptor& aVaDesc, AVCodecContext* aAVCodecContext, + AVFrame* aAVFrame, FFmpegLibWrapper* aLib) { + if (aVaDesc.fourcc != VA_FOURCC_NV12 && aVaDesc.fourcc != VA_FOURCC_YV12 && +@@ -111,7 +115,8 @@ RefPtr VideoFramePool + } + + MutexAutoLock lock(mSurfaceLock); +- RefPtr videoSurface = GetFreeVideoFrameSurface(); ++ RefPtr> videoSurface = ++ GetFreeVideoFrameSurface(); + if (!videoSurface) { + RefPtr surface = + DMABufSurfaceYUV::CreateYUVSurface(aVaDesc); +@@ -119,7 +124,8 @@ RefPtr VideoFramePool + return nullptr; + } + FFMPEG_LOG("Created new VA-API DMABufSurface UID = %d", surface->GetUID()); +- RefPtr surf = new VideoFrameSurface(surface); ++ RefPtr> surf = ++ new VideoFrameSurface(surface); + if (!mTextureCreationWorks) { + mTextureCreationWorks = Some(surface->VerifyTextureCreation()); + } +diff -up firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.D141828 firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h +--- firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.D141828 2022-04-07 10:11:34.980246857 +0200 ++++ firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h 2022-04-07 10:14:54.478755409 +0200 +@@ -7,8 +7,9 @@ + #ifndef __FFmpegVideoFramePool_h__ + #define __FFmpegVideoFramePool_h__ + +-#include "FFmpegVideoDecoder.h" + #include "FFmpegLibWrapper.h" ++#include "FFmpegLibs.h" ++#include "FFmpegLog.h" + + #include "mozilla/layers/DMABUFSurfaceImage.h" + #include "mozilla/widget/DMABufLibWrapper.h" +@@ -16,8 +17,6 @@ + + namespace mozilla { + +-class VideoFramePool; +- + // VideoFrameSurface holds a reference to GPU data with a video frame. + // + // Actual GPU pixel data are stored at DMABufSurface and +@@ -47,8 +46,19 @@ class VideoFramePool; + // Unfortunately there isn't any obvious way how to mark particular VASurface + // as used. The best we can do is to hold a reference to particular AVBuffer + // from decoded AVFrame and AVHWFramesContext which owns the AVBuffer. +-class VideoFrameSurface { +- friend class VideoFramePool; ++template ++class VideoFrameSurface {}; ++template <> ++class VideoFrameSurface; ++ ++template ++class VideoFramePool {}; ++template <> ++class VideoFramePool; ++ ++template <> ++class VideoFrameSurface { ++ friend class VideoFramePool; + + public: + NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VideoFrameSurface) +@@ -97,23 +107,24 @@ class VideoFrameSurface { + }; + + // VideoFramePool class is thread-safe. +-class VideoFramePool final { ++template <> ++class VideoFramePool { + public: + VideoFramePool(); + ~VideoFramePool(); + +- RefPtr GetVideoFrameSurface( ++ RefPtr> GetVideoFrameSurface( + VADRMPRIMESurfaceDescriptor& aVaDesc, AVCodecContext* aAVCodecContext, + AVFrame* aAVFrame, FFmpegLibWrapper* aLib); + void ReleaseUnusedVAAPIFrames(); + + private: +- RefPtr GetFreeVideoFrameSurface(); ++ RefPtr> GetFreeVideoFrameSurface(); + + private: + // Protect mDMABufSurfaces pool access + Mutex mSurfaceLock; +- nsTArray> mDMABufSurfaces; ++ nsTArray>> mDMABufSurfaces; + // We may fail to create texture over DMABuf memory due to driver bugs so + // check that before we export first DMABuf video frame. + Maybe mTextureCreationWorks; diff --git a/firefox.spec b/firefox.spec index 86390b6..55459a5 100644 --- a/firefox.spec +++ b/firefox.spec @@ -241,6 +241,8 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch +Patch416: D141827.diff +Patch417: D141828.diff # PGO/LTO patches Patch600: pgo.patch @@ -480,6 +482,8 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 +%patch416 -p1 -b .D141827 +%patch417 -p1 -b .D141828 # PGO patches %if %{build_with_pgo} From 5ff18ae10d25fce689f54cb3857adc0db87c4406 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 13 Apr 2022 15:48:10 +0200 Subject: [PATCH 038/545] Updated to 99.0.1 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 85b9eb6..609ba67 100644 --- a/.gitignore +++ b/.gitignore @@ -503,3 +503,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-98.0.2-20220331.tar.xz /firefox-99.0.source.tar.xz /firefox-langpacks-99.0-20220331.tar.xz +/firefox-langpacks-99.0.1-20220413.tar.xz +/firefox-99.0.1.source.tar.xz diff --git a/firefox.spec b/firefox.spec index 55459a5..2e0a544 100644 --- a/firefox.spec +++ b/firefox.spec @@ -162,13 +162,13 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox -Version: 99.0 +Version: 99.0.1 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220331.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220413.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1050,6 +1050,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Wed Apr 13 2022 Martin Stransky - 99.0.1-1 +- Updated to 99.0.1 + * Wed Apr 6 2022 Martin Stransky - 99.0-1 - Updated to 99.0 diff --git a/sources b/sources index 302967c..66ed100 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = b9ab1498be90ecf60822df7021f8812f124550d97f8cd687c69d3ab56fc5fb714bfe88c78c978a1794d211724909a9a5cad6a4b483fa05f762909c45d5075520 SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (firefox-99.0.source.tar.xz) = 08f6d5a668140c4275aba6df463ed3af596043dfe5f27573583afbc1e9f6b27ebca79a52ce2c9598261c631b400b5378744e9e70f51ef9c4098b419e9904aa7c -SHA512 (firefox-langpacks-99.0-20220331.tar.xz) = 9ab5d8989644da67cacfe729c13309ed4f42b654b9b9113bcdb7155b59fcb12fc816de8a3fdea709c9d91f2d5b168eebec5ada6f7637e111ea374adc9eb9c984 +SHA512 (firefox-langpacks-99.0.1-20220413.tar.xz) = 9ec7a4c4d68251176a01cbfa69960241033863e4b59c578846828dd57204b5fe02902fb6c5154352c3142a94106b952f02b141d0f5c8808e5aa901e891c7d60f +SHA512 (firefox-99.0.1.source.tar.xz) = 0006b773ef1057a6e0b959d4f39849ad4a79272b38d565da98062b9aaf0effd2b729349c1f9fa10fccf7d2462d2c536b02c167ae6ad4556d6e519c6d22c25a7f From 40fd3206bd8d31426ec1b9ac4635a9499789cb74 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Thu, 28 Apr 2022 13:03:55 +0200 Subject: [PATCH 039/545] Fixing bookmark install location - rhbz#2054953 --- firefox.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index 2e0a544..5462cd5 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 99.0.1 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -772,7 +772,7 @@ mkdir -p test_results # set up our default bookmarks %if !0%{?flatpak} -%{__cp} -p %{default_bookmarks_file} objdir/dist/bin/browser/chrome/en-US/locale/browser/bookmarks.html +%{__cp} -p %{default_bookmarks_file} objdir/dist/bin/browser/chrome/browser/content/browser/default-bookmarks.html %endif # Make sure locale works for langpacks @@ -1050,6 +1050,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Thu Apr 28 2022 Jan Horak - 99.0.1-2 +- Fixing bookmark install location - rhbz#2054953 + * Wed Apr 13 2022 Martin Stransky - 99.0.1-1 - Updated to 99.0.1 From e4c24fcfb33af407441f9377647a5fc1cf4efcb7 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 2 May 2022 13:37:20 +0200 Subject: [PATCH 040/545] Updated to 100.0 --- .gitignore | 2 + D141827.diff | 207 ---------------------------------- D141828.diff | 252 ------------------------------------------ D142373.diff | 86 ++++++++++++++ firefox.spec | 15 +-- mozilla-1196777.patch | 12 +- sources | 4 +- 7 files changed, 104 insertions(+), 474 deletions(-) delete mode 100644 D141827.diff delete mode 100644 D141828.diff create mode 100644 D142373.diff diff --git a/.gitignore b/.gitignore index 609ba67..ecc5f1d 100644 --- a/.gitignore +++ b/.gitignore @@ -505,3 +505,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-99.0-20220331.tar.xz /firefox-langpacks-99.0.1-20220413.tar.xz /firefox-99.0.1.source.tar.xz +/firefox-100.0.source.tar.xz +/firefox-langpacks-100.0-20220502.tar.xz diff --git a/D141827.diff b/D141827.diff deleted file mode 100644 index 67caf5f..0000000 --- a/D141827.diff +++ /dev/null @@ -1,207 +0,0 @@ -diff -up firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.D141827 firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp ---- firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.D141827 2022-03-31 01:24:44.000000000 +0200 -+++ firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp 2022-04-07 10:10:11.608526890 +0200 -@@ -6,7 +6,7 @@ - - #include "FFmpegVideoFramePool.h" - #include "FFmpegLog.h" --#include "mozilla/widget/DMABufLibWrapper.h" -+#include "mozilla/widget/DMABufLibWrapper.h" - #include "libavutil/pixfmt.h" - - #undef FFMPEG_LOG -@@ -15,11 +15,11 @@ - - namespace mozilla { - --RefPtr VideoFrameSurfaceVAAPI::GetAsImage() { -+RefPtr VideoFrameSurface::GetAsImage() { - return new layers::DMABUFSurfaceImage(mSurface); - } - --VideoFrameSurfaceVAAPI::VideoFrameSurfaceVAAPI(DMABufSurface* aSurface) -+VideoFrameSurface::VideoFrameSurface(DMABufSurface* aSurface) - : mSurface(aSurface), - mLib(nullptr), - mAVHWFramesContext(nullptr), -@@ -30,22 +30,22 @@ VideoFrameSurfaceVAAPI::VideoFrameSurfac - MOZ_ASSERT(mSurface); - MOZ_RELEASE_ASSERT(mSurface->GetAsDMABufSurfaceYUV()); - mSurface->GlobalRefCountCreate(); -- FFMPEG_LOG("VideoFrameSurfaceVAAPI: creating surface UID = %d", -+ FFMPEG_LOG("VideoFrameSurface: creating surface UID = %d", - mSurface->GetUID()); - } - --void VideoFrameSurfaceVAAPI::LockVAAPIData(AVCodecContext* aAVCodecContext, -+void VideoFrameSurface::LockVAAPIData(AVCodecContext* aAVCodecContext, - AVFrame* aAVFrame, - FFmpegLibWrapper* aLib) { -- FFMPEG_LOG("VideoFrameSurfaceVAAPI: VAAPI locking dmabuf surface UID = %d", -+ FFMPEG_LOG("VideoFrameSurface: VAAPI locking dmabuf surface UID = %d", - mSurface->GetUID()); - mLib = aLib; - mAVHWFramesContext = aLib->av_buffer_ref(aAVCodecContext->hw_frames_ctx); - mHWAVBuffer = aLib->av_buffer_ref(aAVFrame->buf[0]); - } - --void VideoFrameSurfaceVAAPI::ReleaseVAAPIData(bool aForFrameRecycle) { -- FFMPEG_LOG("VideoFrameSurfaceVAAPI: VAAPI releasing dmabuf surface UID = %d", -+void VideoFrameSurface::ReleaseVAAPIData(bool aForFrameRecycle) { -+ FFMPEG_LOG("VideoFrameSurface: VAAPI releasing dmabuf surface UID = %d", - mSurface->GetUID()); - - // It's possible to unref GPU data while IsUsed() is still set. -@@ -67,8 +67,8 @@ void VideoFrameSurfaceVAAPI::ReleaseVAAP - } - } - --VideoFrameSurfaceVAAPI::~VideoFrameSurfaceVAAPI() { -- FFMPEG_LOG("VideoFrameSurfaceVAAPI: deleting dmabuf surface UID = %d", -+VideoFrameSurface::~VideoFrameSurface() { -+ FFMPEG_LOG("VideoFrameSurface: deleting dmabuf surface UID = %d", - mSurface->GetUID()); - // We're about to quit, no need to recycle the frames. - ReleaseVAAPIData(/* aForFrameRecycle */ false); -@@ -84,9 +84,8 @@ VideoFramePool::~VideoFramePool() { - void VideoFramePool::ReleaseUnusedVAAPIFrames() { - MutexAutoLock lock(mSurfaceLock); - for (const auto& surface : mDMABufSurfaces) { -- auto* vaapiSurface = surface->AsVideoFrameSurfaceVAAPI(); -- if (!vaapiSurface->IsUsed()) { -- vaapiSurface->ReleaseVAAPIData(); -+ if (!surface->IsUsed()) { -+ surface->ReleaseVAAPIData(); - } - } - } -@@ -96,8 +95,7 @@ RefPtr VideoFramePool - if (surface->IsUsed()) { - continue; - } -- auto* vaapiSurface = surface->AsVideoFrameSurfaceVAAPI(); -- vaapiSurface->ReleaseVAAPIData(); -+ surface->ReleaseVAAPIData(); - return surface; - } - return nullptr; -@@ -121,7 +119,7 @@ RefPtr VideoFramePool - return nullptr; - } - FFMPEG_LOG("Created new VA-API DMABufSurface UID = %d", surface->GetUID()); -- RefPtr surf = new VideoFrameSurfaceVAAPI(surface); -+ RefPtr surf = new VideoFrameSurface(surface); - if (!mTextureCreationWorks) { - mTextureCreationWorks = Some(surface->VerifyTextureCreation()); - } -@@ -138,11 +136,8 @@ RefPtr VideoFramePool - } - FFMPEG_LOG("Reusing VA-API DMABufSurface UID = %d", surface->GetUID()); - } -- -- auto* vaapiSurface = videoSurface->AsVideoFrameSurfaceVAAPI(); -- vaapiSurface->LockVAAPIData(aAVCodecContext, aAVFrame, aLib); -- vaapiSurface->MarkAsUsed(); -- -+ videoSurface->LockVAAPIData(aAVCodecContext, aAVFrame, aLib); -+ videoSurface->MarkAsUsed(); - return videoSurface; - } - -diff -up firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.D141827 firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h ---- firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.D141827 2022-03-31 01:24:44.000000000 +0200 -+++ firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h 2022-04-07 10:09:46.527708638 +0200 -@@ -17,42 +17,17 @@ - namespace mozilla { - - class VideoFramePool; --class VideoFrameSurfaceVAAPI; - --class VideoFrameSurface { -- public: -- NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VideoFrameSurface) -- -- VideoFrameSurface() = default; -- -- virtual VideoFrameSurfaceVAAPI* AsVideoFrameSurfaceVAAPI() { return nullptr; } -- -- virtual void SetYUVColorSpace(gfx::YUVColorSpace aColorSpace) = 0; -- virtual void SetColorRange(gfx::ColorRange aColorRange) = 0; -- -- virtual RefPtr GetDMABufSurface() { return nullptr; }; -- virtual RefPtr GetAsImage() = 0; -- -- // Don't allow VideoFrameSurface plain copy as it leads to -- // unexpected DMABufSurface/HW buffer releases and we don't want to -- // deep copy them. -- VideoFrameSurface(const VideoFrameSurface&) = delete; -- const VideoFrameSurface& operator=(VideoFrameSurface const&) = delete; -- -- protected: -- virtual ~VideoFrameSurface(){}; --}; -- --// VideoFrameSurfaceVAAPI holds a reference to GPU data with a video frame. -+// VideoFrameSurface holds a reference to GPU data with a video frame. - // - // Actual GPU pixel data are stored at DMABufSurface and - // DMABufSurface is passed to gecko GL rendering pipeline via. - // DMABUFSurfaceImage. - // --// VideoFrameSurfaceVAAPI can optionally hold VA-API ffmpeg related data to keep -+// VideoFrameSurface can optionally hold VA-API ffmpeg related data to keep - // GPU data locked untill we need them. - // --// VideoFrameSurfaceVAAPI is used for both HW accelerated video decoding -+// VideoFrameSurface is used for both HW accelerated video decoding - // (VA-API) and ffmpeg SW decoding. - // - // VA-API scenario -@@ -72,13 +47,13 @@ class VideoFrameSurface { - // Unfortunately there isn't any obvious way how to mark particular VASurface - // as used. The best we can do is to hold a reference to particular AVBuffer - // from decoded AVFrame and AVHWFramesContext which owns the AVBuffer. --class VideoFrameSurfaceVAAPI final : public VideoFrameSurface { -+class VideoFrameSurface { - friend class VideoFramePool; - - public: -- explicit VideoFrameSurfaceVAAPI(DMABufSurface* aSurface); -+ NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VideoFrameSurface) - -- VideoFrameSurfaceVAAPI* AsVideoFrameSurfaceVAAPI() final { return this; } -+ explicit VideoFrameSurface(DMABufSurface* aSurface); - - void SetYUVColorSpace(mozilla::gfx::YUVColorSpace aColorSpace) { - mSurface->GetAsDMABufSurfaceYUV()->SetYUVColorSpace(aColorSpace); -@@ -93,6 +68,12 @@ class VideoFrameSurfaceVAAPI final : pub - - RefPtr GetAsImage(); - -+ // Don't allow VideoFrameSurface plain copy as it leads to -+ // unexpected DMABufSurface/HW buffer releases and we don't want to -+ // deep copy them. -+ VideoFrameSurface(const VideoFrameSurface&) = delete; -+ const VideoFrameSurface& operator=(VideoFrameSurface const&) = delete; -+ - protected: - // Lock VAAPI related data - void LockVAAPIData(AVCodecContext* aAVCodecContext, AVFrame* aAVFrame, -@@ -107,7 +88,7 @@ class VideoFrameSurfaceVAAPI final : pub - void MarkAsUsed() { mSurface->GlobalRefAdd(); } - - private: -- virtual ~VideoFrameSurfaceVAAPI(); -+ virtual ~VideoFrameSurface(); - - const RefPtr mSurface; - const FFmpegLibWrapper* mLib; -@@ -132,7 +113,7 @@ class VideoFramePool final { - private: - // Protect mDMABufSurfaces pool access - Mutex mSurfaceLock; -- nsTArray> mDMABufSurfaces; -+ nsTArray> mDMABufSurfaces; - // We may fail to create texture over DMABuf memory due to driver bugs so - // check that before we export first DMABuf video frame. - Maybe mTextureCreationWorks; diff --git a/D141828.diff b/D141828.diff deleted file mode 100644 index b2475e9..0000000 --- a/D141828.diff +++ /dev/null @@ -1,252 +0,0 @@ -diff -up firefox-99.0/dom/media/platforms/ffmpeg/ffmpeg58/moz.build.D141828 firefox-99.0/dom/media/platforms/ffmpeg/ffmpeg58/moz.build ---- firefox-99.0/dom/media/platforms/ffmpeg/ffmpeg58/moz.build.D141828 2022-03-31 01:24:44.000000000 +0200 -+++ firefox-99.0/dom/media/platforms/ffmpeg/ffmpeg58/moz.build 2022-04-07 10:11:34.981246890 +0200 -@@ -30,6 +30,9 @@ if CONFIG['MOZ_WAYLAND']: - CXXFLAGS += CONFIG['MOZ_GTK3_CFLAGS'] - DEFINES['MOZ_WAYLAND_USE_VAAPI'] = 1 - USE_LIBS += ['mozva'] -+ UNIFIED_SOURCES += [ -+ '../FFmpegVideoFramePool.cpp', -+ ] - - include("/ipc/chromium/chromium-config.mozbuild") - -diff -up firefox-99.0/dom/media/platforms/ffmpeg/ffmpeg59/moz.build.D141828 firefox-99.0/dom/media/platforms/ffmpeg/ffmpeg59/moz.build ---- firefox-99.0/dom/media/platforms/ffmpeg/ffmpeg59/moz.build.D141828 2022-03-31 01:24:44.000000000 +0200 -+++ firefox-99.0/dom/media/platforms/ffmpeg/ffmpeg59/moz.build 2022-04-07 10:11:34.981246890 +0200 -@@ -30,6 +30,9 @@ if CONFIG["MOZ_WAYLAND"]: - CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"] - DEFINES["MOZ_WAYLAND_USE_VAAPI"] = 1 - USE_LIBS += ["mozva"] -+ UNIFIED_SOURCES += [ -+ "../FFmpegVideoFramePool.cpp", -+ ] - - include("/ipc/chromium/chromium-config.mozbuild") - -diff -up firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp.D141828 firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp ---- firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp.D141828 2022-03-31 01:24:44.000000000 +0200 -+++ firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp 2022-04-07 10:11:34.981246890 +0200 -@@ -814,7 +814,7 @@ MediaResult FFmpegVideoDecoder(); -+ mVideoFramePool = MakeUnique>(); - } - - // Release unused VA-API surfaces before avcodec_receive_frame() as -diff -up firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h.D141828 firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h ---- firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h.D141828 2022-03-31 01:24:44.000000000 +0200 -+++ firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h 2022-04-07 10:11:34.981246890 +0200 -@@ -16,6 +16,9 @@ - #if LIBAVCODEC_VERSION_MAJOR >= 57 && LIBAVUTIL_VERSION_MAJOR >= 56 - # include "mozilla/layers/TextureClient.h" - #endif -+#ifdef MOZ_WAYLAND_USE_VAAPI -+# include "FFmpegVideoFramePool.h" -+#endif - - struct _VADRMPRIMESurfaceDescriptor; - typedef struct _VADRMPRIMESurfaceDescriptor VADRMPRIMESurfaceDescriptor; -@@ -23,7 +26,6 @@ typedef struct _VADRMPRIMESurfaceDescrip - namespace mozilla { - - class ImageBufferWrapper; --class VideoFramePool; - - template - class FFmpegVideoDecoder : public FFmpegDataDecoder {}; -@@ -138,7 +140,7 @@ class FFmpegVideoDecoder - AVBufferRef* mVAAPIDeviceContext; - bool mEnableHardwareDecoding; - VADisplay mDisplay; -- UniquePtr mVideoFramePool; -+ UniquePtr> mVideoFramePool; - static nsTArray mAcceleratedFormats; - #endif - RefPtr mImageAllocator; -diff -up firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.D141828 firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp ---- firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.D141828 2022-04-07 10:11:34.980246857 +0200 -+++ firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp 2022-04-07 10:16:02.390971008 +0200 -@@ -5,6 +5,7 @@ - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - #include "FFmpegVideoFramePool.h" -+#include "PlatformDecoderModule.h" - #include "FFmpegLog.h" - #include "mozilla/widget/DMABufLibWrapper.h" - #include "libavutil/pixfmt.h" -@@ -15,11 +16,11 @@ - - namespace mozilla { - --RefPtr VideoFrameSurface::GetAsImage() { -+RefPtr VideoFrameSurface::GetAsImage() { - return new layers::DMABUFSurfaceImage(mSurface); - } - --VideoFrameSurface::VideoFrameSurface(DMABufSurface* aSurface) -+VideoFrameSurface::VideoFrameSurface(DMABufSurface* aSurface) - : mSurface(aSurface), - mLib(nullptr), - mAVHWFramesContext(nullptr), -@@ -34,7 +35,7 @@ VideoFrameSurface::VideoFrameSurface(DMA - mSurface->GetUID()); - } - --void VideoFrameSurface::LockVAAPIData(AVCodecContext* aAVCodecContext, -+void VideoFrameSurface::LockVAAPIData(AVCodecContext* aAVCodecContext, - AVFrame* aAVFrame, - FFmpegLibWrapper* aLib) { - FFMPEG_LOG("VideoFrameSurface: VAAPI locking dmabuf surface UID = %d", -@@ -44,7 +45,7 @@ void VideoFrameSurface::LockVAAPIData(AV - mHWAVBuffer = aLib->av_buffer_ref(aAVFrame->buf[0]); - } - --void VideoFrameSurface::ReleaseVAAPIData(bool aForFrameRecycle) { -+void VideoFrameSurface::ReleaseVAAPIData(bool aForFrameRecycle) { - FFMPEG_LOG("VideoFrameSurface: VAAPI releasing dmabuf surface UID = %d", - mSurface->GetUID()); - -@@ -67,21 +68,22 @@ void VideoFrameSurface::ReleaseVAAPIData - } - } - --VideoFrameSurface::~VideoFrameSurface() { -+VideoFrameSurface::~VideoFrameSurface() { - FFMPEG_LOG("VideoFrameSurface: deleting dmabuf surface UID = %d", - mSurface->GetUID()); - // We're about to quit, no need to recycle the frames. - ReleaseVAAPIData(/* aForFrameRecycle */ false); - } - --VideoFramePool::VideoFramePool() : mSurfaceLock("VideoFramePoolSurfaceLock") {} -+VideoFramePool::VideoFramePool() -+ : mSurfaceLock("VideoFramePoolSurfaceLock") {} - --VideoFramePool::~VideoFramePool() { -+VideoFramePool::~VideoFramePool() { - MutexAutoLock lock(mSurfaceLock); - mDMABufSurfaces.Clear(); - } - --void VideoFramePool::ReleaseUnusedVAAPIFrames() { -+void VideoFramePool::ReleaseUnusedVAAPIFrames() { - MutexAutoLock lock(mSurfaceLock); - for (const auto& surface : mDMABufSurfaces) { - if (!surface->IsUsed()) { -@@ -90,7 +92,8 @@ void VideoFramePool::ReleaseUnusedVAAPIF - } - } - --RefPtr VideoFramePool::GetFreeVideoFrameSurface() { -+RefPtr> -+VideoFramePool::GetFreeVideoFrameSurface() { - for (auto& surface : mDMABufSurfaces) { - if (surface->IsUsed()) { - continue; -@@ -101,7 +104,8 @@ RefPtr VideoFramePool - return nullptr; - } - --RefPtr VideoFramePool::GetVideoFrameSurface( -+RefPtr> -+VideoFramePool::GetVideoFrameSurface( - VADRMPRIMESurfaceDescriptor& aVaDesc, AVCodecContext* aAVCodecContext, - AVFrame* aAVFrame, FFmpegLibWrapper* aLib) { - if (aVaDesc.fourcc != VA_FOURCC_NV12 && aVaDesc.fourcc != VA_FOURCC_YV12 && -@@ -111,7 +115,8 @@ RefPtr VideoFramePool - } - - MutexAutoLock lock(mSurfaceLock); -- RefPtr videoSurface = GetFreeVideoFrameSurface(); -+ RefPtr> videoSurface = -+ GetFreeVideoFrameSurface(); - if (!videoSurface) { - RefPtr surface = - DMABufSurfaceYUV::CreateYUVSurface(aVaDesc); -@@ -119,7 +124,8 @@ RefPtr VideoFramePool - return nullptr; - } - FFMPEG_LOG("Created new VA-API DMABufSurface UID = %d", surface->GetUID()); -- RefPtr surf = new VideoFrameSurface(surface); -+ RefPtr> surf = -+ new VideoFrameSurface(surface); - if (!mTextureCreationWorks) { - mTextureCreationWorks = Some(surface->VerifyTextureCreation()); - } -diff -up firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.D141828 firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h ---- firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.D141828 2022-04-07 10:11:34.980246857 +0200 -+++ firefox-99.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h 2022-04-07 10:14:54.478755409 +0200 -@@ -7,8 +7,9 @@ - #ifndef __FFmpegVideoFramePool_h__ - #define __FFmpegVideoFramePool_h__ - --#include "FFmpegVideoDecoder.h" - #include "FFmpegLibWrapper.h" -+#include "FFmpegLibs.h" -+#include "FFmpegLog.h" - - #include "mozilla/layers/DMABUFSurfaceImage.h" - #include "mozilla/widget/DMABufLibWrapper.h" -@@ -16,8 +17,6 @@ - - namespace mozilla { - --class VideoFramePool; -- - // VideoFrameSurface holds a reference to GPU data with a video frame. - // - // Actual GPU pixel data are stored at DMABufSurface and -@@ -47,8 +46,19 @@ class VideoFramePool; - // Unfortunately there isn't any obvious way how to mark particular VASurface - // as used. The best we can do is to hold a reference to particular AVBuffer - // from decoded AVFrame and AVHWFramesContext which owns the AVBuffer. --class VideoFrameSurface { -- friend class VideoFramePool; -+template -+class VideoFrameSurface {}; -+template <> -+class VideoFrameSurface; -+ -+template -+class VideoFramePool {}; -+template <> -+class VideoFramePool; -+ -+template <> -+class VideoFrameSurface { -+ friend class VideoFramePool; - - public: - NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VideoFrameSurface) -@@ -97,23 +107,24 @@ class VideoFrameSurface { - }; - - // VideoFramePool class is thread-safe. --class VideoFramePool final { -+template <> -+class VideoFramePool { - public: - VideoFramePool(); - ~VideoFramePool(); - -- RefPtr GetVideoFrameSurface( -+ RefPtr> GetVideoFrameSurface( - VADRMPRIMESurfaceDescriptor& aVaDesc, AVCodecContext* aAVCodecContext, - AVFrame* aAVFrame, FFmpegLibWrapper* aLib); - void ReleaseUnusedVAAPIFrames(); - - private: -- RefPtr GetFreeVideoFrameSurface(); -+ RefPtr> GetFreeVideoFrameSurface(); - - private: - // Protect mDMABufSurfaces pool access - Mutex mSurfaceLock; -- nsTArray> mDMABufSurfaces; -+ nsTArray>> mDMABufSurfaces; - // We may fail to create texture over DMABuf memory due to driver bugs so - // check that before we export first DMABuf video frame. - Maybe mTextureCreationWorks; diff --git a/D142373.diff b/D142373.diff new file mode 100644 index 0000000..932cf7a --- /dev/null +++ b/D142373.diff @@ -0,0 +1,86 @@ +diff --git a/python/mozbuild/mozbuild/build_commands.py b/python/mozbuild/mozbuild/build_commands.py +--- a/python/mozbuild/mozbuild/build_commands.py ++++ b/python/mozbuild/mozbuild/build_commands.py +@@ -183,10 +183,11 @@ + directory=directory, + verbose=verbose, + keep_going=keep_going, + mach_context=command_context._mach_context, + append_env=append_env, ++ virtualenv_topobjdir=orig_topobjdir, + ) + if status != 0: + return status + + # Packaging the instrumented build is required to get the jarlog +@@ -206,11 +207,11 @@ + pgo_env["LLVM_PROFDATA"] = instr.config_environment.substs.get( + "LLVM_PROFDATA" + ) + pgo_env["JARLOG_FILE"] = mozpath.join(orig_topobjdir, "jarlog/en-US.log") + pgo_cmd = [ +- instr.virtualenv_manager.python_path, ++ command_context.virtualenv_manager.python_path, + mozpath.join(command_context.topsrcdir, "build/pgo/profileserver.py"), + ] + subprocess.check_call(pgo_cmd, cwd=instr.topobjdir, env=pgo_env) + + # Set the default build to MOZ_PROFILE_USE +diff --git a/python/mozbuild/mozbuild/controller/building.py b/python/mozbuild/mozbuild/controller/building.py +--- a/python/mozbuild/mozbuild/controller/building.py ++++ b/python/mozbuild/mozbuild/controller/building.py +@@ -1220,10 +1220,11 @@ + directory=None, + verbose=False, + keep_going=False, + mach_context=None, + append_env=None, ++ virtualenv_topobjdir=None, + ): + """Invoke the build backend. + + ``what`` defines the thing to build. If not defined, the default + target is used. +@@ -1297,10 +1298,11 @@ + config_rc = self.configure( + metrics, + buildstatus_messages=True, + line_handler=output.on_line, + append_env=append_env, ++ virtualenv_topobjdir=virtualenv_topobjdir, + ) + + if config_rc != 0: + return config_rc + +@@ -1635,10 +1637,11 @@ + metrics, + options=None, + buildstatus_messages=False, + line_handler=None, + append_env=None, ++ virtualenv_topobjdir=None, + ): + # Disable indexing in objdir because it is not necessary and can slow + # down builds. + self.metrics = metrics + mkdir(self.topobjdir, not_indexed=True) +@@ -1658,15 +1661,16 @@ + if line.startswith("export "): + k, eq, v = line[len("export ") :].partition("=") + if eq == "=": + append_env[k] = v + ++ virtualenv_topobjdir = virtualenv_topobjdir or self.topobjdir + build_site = CommandSiteManager.from_environment( + self.topsrcdir, + lambda: get_state_dir(specific_to_topsrcdir=True, topsrcdir=self.topsrcdir), + "build", +- os.path.join(self.topobjdir, "_virtualenvs"), ++ os.path.join(virtualenv_topobjdir, "_virtualenvs"), + ) + build_site.ensure() + + command = [build_site.python_path, os.path.join(self.topsrcdir, "configure.py")] + if options: + diff --git a/firefox.spec b/firefox.spec index 5462cd5..d87dfd1 100644 --- a/firefox.spec +++ b/firefox.spec @@ -162,13 +162,13 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox -Version: 99.0.1 -Release: 2%{?pre_tag}%{?dist} +Version: 100.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220413.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220502.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -217,6 +217,7 @@ Patch55: firefox-testing.patch Patch61: firefox-glibc-dynstack.patch Patch62: build-python.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch +Patch72: D142373.diff # Test patches # Generate without context by @@ -241,8 +242,6 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch -Patch416: D141827.diff -Patch417: D141828.diff # PGO/LTO patches Patch600: pgo.patch @@ -460,6 +459,7 @@ This package contains results of tests executed during build. %patch53 -p1 -b .firefox-gcc-build %patch54 -p1 -b .1669639 %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 +%patch72 -p1 -b .D142373 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -482,8 +482,6 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 -%patch416 -p1 -b .D141827 -%patch417 -p1 -b .D141828 # PGO patches %if %{build_with_pgo} @@ -1050,6 +1048,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Mon May 2 2022 Martin Stransky - 100.0-1 +- Updated to 100.0 + * Thu Apr 28 2022 Jan Horak - 99.0.1-2 - Fixing bookmark install location - rhbz#2054953 diff --git a/mozilla-1196777.patch b/mozilla-1196777.patch index 1ab70f7..864741e 100644 --- a/mozilla-1196777.patch +++ b/mozilla-1196777.patch @@ -1,7 +1,7 @@ -diff -up firefox-86.0/widget/gtk/nsWindow.cpp.1196777 firefox-86.0/widget/gtk/nsWindow.cpp ---- firefox-86.0/widget/gtk/nsWindow.cpp.1196777 2021-02-23 17:52:42.291702566 +0100 -+++ firefox-86.0/widget/gtk/nsWindow.cpp 2021-02-23 17:57:52.434895984 +0100 -@@ -195,7 +195,8 @@ const gint kEvents = GDK_TOUCHPAD_GESTUR +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 | @@ -9,5 +9,5 @@ diff -up firefox-86.0/widget/gtk/nsWindow.cpp.1196777 firefox-86.0/widget/gtk/ns + GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK | + GDK_FOCUS_CHANGE_MASK; - #if !GTK_CHECK_VERSION(3, 22, 0) - typedef enum { + /* utility functions */ + static bool is_mouse_in_window(GdkWindow* aWindow, gdouble aMouseX, diff --git a/sources b/sources index 66ed100..32377fc 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = b9ab1498be90ecf60822df7021f8812f124550d97f8cd687c69d3ab56fc5fb714bfe88c78c978a1794d211724909a9a5cad6a4b483fa05f762909c45d5075520 SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (firefox-langpacks-99.0.1-20220413.tar.xz) = 9ec7a4c4d68251176a01cbfa69960241033863e4b59c578846828dd57204b5fe02902fb6c5154352c3142a94106b952f02b141d0f5c8808e5aa901e891c7d60f -SHA512 (firefox-99.0.1.source.tar.xz) = 0006b773ef1057a6e0b959d4f39849ad4a79272b38d565da98062b9aaf0effd2b729349c1f9fa10fccf7d2462d2c536b02c167ae6ad4556d6e519c6d22c25a7f +SHA512 (firefox-100.0.source.tar.xz) = 29c56391c980209ff94c02a9aba18fe27bea188bdcbcf7fe0c0f27f61e823f4507a3ec343b27cb5285cf3901843e9cc4aca8e568beb623c4b69b7282e662b2aa +SHA512 (firefox-langpacks-100.0-20220502.tar.xz) = 38e91cf8d6df6cf455891563f72090d1f277750f62f7a8c3cf5afd1d0a7aa2e1a6b47e65fc9d8419305ec2075c0ff3de41dbb7b5251790ff1bf3cd1f7db7bbbb From b311ef1fb8696a5c5d6e9b34c32fdb0a6315a108 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 3 May 2022 09:54:03 +0200 Subject: [PATCH 041/545] Added fix for mozbz#1759137 --- D145094.diff | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++ firefox.spec | 7 +++++- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 D145094.diff diff --git a/D145094.diff b/D145094.diff new file mode 100644 index 0000000..711acc9 --- /dev/null +++ b/D145094.diff @@ -0,0 +1,61 @@ +diff -up firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.D145094 firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp +--- firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.D145094 2022-04-29 01:01:46.000000000 +0200 ++++ firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp 2022-05-03 09:51:48.570471687 +0200 +@@ -23,7 +23,7 @@ RefPtr VideoFrameSurface< + VideoFrameSurface::VideoFrameSurface(DMABufSurface* aSurface) + : mSurface(aSurface), + mLib(nullptr), +- mAVHWDeviceContext(nullptr), ++ mAVHWFrameContext(nullptr), + mHWAVBuffer(nullptr) { + // Create global refcount object to track mSurface usage over + // gects rendering engine. We can't release it until it's used +@@ -38,16 +38,22 @@ VideoFrameSurface::VideoFrame + void VideoFrameSurface::LockVAAPIData( + AVCodecContext* aAVCodecContext, AVFrame* aAVFrame, + FFmpegLibWrapper* aLib) { +- FFMPEG_LOG("VideoFrameSurface: VAAPI locking dmabuf surface UID = %d", +- mSurface->GetUID()); ++ MOZ_DIAGNOSTIC_ASSERT(aAVCodecContext->hw_frames_ctx); + mLib = aLib; +- mAVHWDeviceContext = aLib->av_buffer_ref(aAVCodecContext->hw_device_ctx); ++ mAVHWFrameContext = aLib->av_buffer_ref(aAVCodecContext->hw_frames_ctx); + mHWAVBuffer = aLib->av_buffer_ref(aAVFrame->buf[0]); ++ FFMPEG_LOG( ++ "VideoFrameSurface: VAAPI locking dmabuf surface UID = %d " ++ "mAVHWFrameContext %p mHWAVBuffer %p", ++ mSurface->GetUID(), mAVHWFrameContext, mHWAVBuffer); + } + + void VideoFrameSurface::ReleaseVAAPIData(bool aForFrameRecycle) { +- FFMPEG_LOG("VideoFrameSurface: VAAPI releasing dmabuf surface UID = %d", +- mSurface->GetUID()); ++ FFMPEG_LOG( ++ "VideoFrameSurface: VAAPI releasing dmabuf surface UID = %d " ++ "aForFrameRecycle %d mLib %p mAVHWFrameContext %p mHWAVBuffer %p", ++ mSurface->GetUID(), aForFrameRecycle, mLib, mAVHWFrameContext, ++ mHWAVBuffer); + + // It's possible to unref GPU data while IsUsed() is still set. + // It can happens when VideoFramePool is deleted while decoder shutdown +@@ -57,7 +63,7 @@ void VideoFrameSurface::Relea + // is closed. + if (mLib) { + mLib->av_buffer_unref(&mHWAVBuffer); +- mLib->av_buffer_unref(&mAVHWDeviceContext); ++ mLib->av_buffer_unref(&mAVHWFrameContext); + } + + // If we want to recycle the frame, make sure it's not used +diff -up firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.D145094 firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h +--- firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.D145094 2022-04-29 00:02:40.000000000 +0200 ++++ firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h 2022-05-03 09:33:27.110885715 +0200 +@@ -102,7 +102,7 @@ class VideoFrameSurface { + + const RefPtr mSurface; + const FFmpegLibWrapper* mLib; +- AVBufferRef* mAVHWDeviceContext; ++ AVBufferRef* mAVHWFrameContext; + AVBufferRef* mHWAVBuffer; + }; + diff --git a/firefox.spec b/firefox.spec index d87dfd1..1611ba3 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 100.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -242,6 +242,7 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch +Patch416: D145094.diff # PGO/LTO patches Patch600: pgo.patch @@ -482,6 +483,7 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 +%patch416 -p1 -b .D145094 # PGO patches %if %{build_with_pgo} @@ -1048,6 +1050,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue May 3 2022 Martin Stransky - 100.0-2 +- Added fix for mozbz#1759137 + * Mon May 2 2022 Martin Stransky - 100.0-1 - Updated to 100.0 From 94ad0536cd079d99ef5148fe701e30cc3daa53c8 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 5 May 2022 12:29:17 +0200 Subject: [PATCH 042/545] Removed Fedora user agent patch (rhbz#2081791) --- firefox-fedora-ua.patch | 20 -------------------- firefox.spec | 7 ++++--- 2 files changed, 4 insertions(+), 23 deletions(-) delete mode 100644 firefox-fedora-ua.patch diff --git a/firefox-fedora-ua.patch b/firefox-fedora-ua.patch deleted file mode 100644 index 053b2a9..0000000 --- a/firefox-fedora-ua.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -up firefox-91.0.1/netwerk/protocol/http/nsHttpHandler.cpp.fedora-ua firefox-91.0.1/netwerk/protocol/http/nsHttpHandler.cpp ---- firefox-91.0.1/netwerk/protocol/http/nsHttpHandler.cpp.fedora-ua 2021-08-16 20:10:57.000000000 +0200 -+++ firefox-91.0.1/netwerk/protocol/http/nsHttpHandler.cpp 2021-08-23 12:07:21.128772096 +0200 -@@ -716,7 +716,7 @@ void nsHttpHandler::BuildUserAgent() { - // than if we didn't preallocate at all. - mUserAgent.SetCapacity(mLegacyAppName.Length() + mLegacyAppVersion.Length() + - #ifndef UA_SPARE_PLATFORM -- mPlatform.Length() + -+ mPlatform.Length() + 10 + - #endif - mOscpu.Length() + mMisc.Length() + mProduct.Length() + - mProductSub.Length() + mAppName.Length() + -@@ -735,6 +735,7 @@ void nsHttpHandler::BuildUserAgent() { - if (!mPlatform.IsEmpty()) { - mUserAgent += mPlatform; - mUserAgent.AppendLiteral("; "); -+ mUserAgent.AppendLiteral("Fedora; "); - } - #endif - if (!mCompatDevice.IsEmpty()) { diff --git a/firefox.spec b/firefox.spec index 1611ba3..9f172c1 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 100.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -230,7 +230,6 @@ Patch102: firefox-tests-xpcshell-freeze.patch # Fedora specific patches Patch215: firefox-enable-addons.patch Patch219: rhbz-1173156.patch -Patch221: firefox-fedora-ua.patch Patch224: mozilla-1170092.patch #ARM run-time patch Patch226: rhbz-1354671.patch @@ -470,7 +469,6 @@ This package contains results of tests executed during build. # Fedora patches %patch215 -p1 -b .addons %patch219 -p1 -b .rhbz-1173156 -%patch221 -p1 -b .fedora-ua %patch224 -p1 -b .1170092 #ARM run-time patch %ifarch aarch64 @@ -1050,6 +1048,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Thu May 5 2022 Martin Stransky - 100.0-3 +- Removed Fedora user agent patch (rhbz#2081791). + * Tue May 3 2022 Martin Stransky - 100.0-2 - Added fix for mozbz#1759137 From db2e77cf9fe645684d98fdd0561eaef3abc801ea Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 9 May 2022 14:17:09 +0200 Subject: [PATCH 043/545] Added fix for mozbz#1767916 --- D145541.diff | 21 +++++++++++++++++++++ firefox.spec | 7 ++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 D145541.diff diff --git a/D145541.diff b/D145541.diff new file mode 100644 index 0000000..7ca3a2e --- /dev/null +++ b/D145541.diff @@ -0,0 +1,21 @@ +diff --git a/widget/gtk/MozContainerWayland.cpp b/widget/gtk/MozContainerWayland.cpp +--- a/widget/gtk/MozContainerWayland.cpp ++++ b/widget/gtk/MozContainerWayland.cpp +@@ -527,10 +527,16 @@ + return; + } + + LOGWAYLAND("%s [%p] scale %d\n", __FUNCTION__, + (void*)moz_container_get_nsWindow(container), scale); ++ // There is a chance that the attached wl_buffer has not yet been doubled ++ // on the main thread when scale factor changed to 2. This leads to ++ // crash with the following message: ++ // Buffer size (AxB) must be an integer multiple of the buffer_scale (2) ++ // Removing the possibly wrong wl_buffer to prevent that crash: ++ wl_surface_attach(wl_container->surface, nullptr, 0, 0); + wl_surface_set_buffer_scale(wl_container->surface, scale); + wl_container->buffer_scale = scale; + } + } + + diff --git a/firefox.spec b/firefox.spec index 9f172c1..13b52e2 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 100.0 -Release: 3%{?pre_tag}%{?dist} +Release: 4%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -242,6 +242,7 @@ Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch Patch416: D145094.diff +Patch417: D145541.diff # PGO/LTO patches Patch600: pgo.patch @@ -482,6 +483,7 @@ This package contains results of tests executed during build. %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 %patch416 -p1 -b .D145094 +%patch417 -p1 -b .D145541 # PGO patches %if %{build_with_pgo} @@ -1048,6 +1050,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Mon May 9 2022 Martin Stransky - 100.0-4 +- Added fix for mozbz#1767916. + * Thu May 5 2022 Martin Stransky - 100.0-3 - Removed Fedora user agent patch (rhbz#2081791). From c66f451d52bbb47cf83e5d3006816742beb1ecc8 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Tue, 10 May 2022 17:17:03 +0200 Subject: [PATCH 044/545] Fix crashes on f36 multimonitor setup and too big profile manager --- firefox.spec | 9 ++++++- mozilla-1767916-multimonitor-crash.patch | 21 +++++++++++++++++ mozilla-1767946-profilemanagersize.patch | 30 ++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 mozilla-1767916-multimonitor-crash.patch create mode 100644 mozilla-1767946-profilemanagersize.patch diff --git a/firefox.spec b/firefox.spec index 13b52e2..4482ab2 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 100.0 -Release: 4%{?pre_tag}%{?dist} +Release: 5%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -218,6 +218,7 @@ Patch61: firefox-glibc-dynstack.patch Patch62: build-python.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch72: D142373.diff +Patch73: mozilla-1767916-multimonitor-crash.patch # Test patches # Generate without context by @@ -243,6 +244,7 @@ Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch Patch416: D145094.diff Patch417: D145541.diff +Patch418: mozilla-1767946-profilemanagersize.patch # PGO/LTO patches Patch600: pgo.patch @@ -461,6 +463,7 @@ This package contains results of tests executed during build. %patch54 -p1 -b .1669639 %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch72 -p1 -b .D142373 +%patch73 -p1 -b .mozilla-1767916-multimonitor-crash # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -484,6 +487,7 @@ This package contains results of tests executed during build. %patch415 -p1 -b .1670333 %patch416 -p1 -b .D145094 %patch417 -p1 -b .D145541 +%patch418 -p1 -b .mozilla-1767946-profilemanagersize # PGO patches %if %{build_with_pgo} @@ -1050,6 +1054,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue May 10 2022 Jan Horak - 100.0-5 +- Fix crashes on f36 multimonitor setup and too big profile manager + * Mon May 9 2022 Martin Stransky - 100.0-4 - Added fix for mozbz#1767916. diff --git a/mozilla-1767916-multimonitor-crash.patch b/mozilla-1767916-multimonitor-crash.patch new file mode 100644 index 0000000..7ca3a2e --- /dev/null +++ b/mozilla-1767916-multimonitor-crash.patch @@ -0,0 +1,21 @@ +diff --git a/widget/gtk/MozContainerWayland.cpp b/widget/gtk/MozContainerWayland.cpp +--- a/widget/gtk/MozContainerWayland.cpp ++++ b/widget/gtk/MozContainerWayland.cpp +@@ -527,10 +527,16 @@ + return; + } + + LOGWAYLAND("%s [%p] scale %d\n", __FUNCTION__, + (void*)moz_container_get_nsWindow(container), scale); ++ // There is a chance that the attached wl_buffer has not yet been doubled ++ // on the main thread when scale factor changed to 2. This leads to ++ // crash with the following message: ++ // Buffer size (AxB) must be an integer multiple of the buffer_scale (2) ++ // Removing the possibly wrong wl_buffer to prevent that crash: ++ wl_surface_attach(wl_container->surface, nullptr, 0, 0); + wl_surface_set_buffer_scale(wl_container->surface, scale); + wl_container->buffer_scale = scale; + } + } + + diff --git a/mozilla-1767946-profilemanagersize.patch b/mozilla-1767946-profilemanagersize.patch new file mode 100644 index 0000000..4469934 --- /dev/null +++ b/mozilla-1767946-profilemanagersize.patch @@ -0,0 +1,30 @@ +diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp +--- a/widget/gtk/nsWindow.cpp ++++ b/widget/gtk/nsWindow.cpp +@@ -3787,11 +3787,12 @@ + mPendingConfigures--; + } + + // Don't fire configure event for scale changes, we handle that + // OnScaleChanged event. Skip that for toplevel windows only. +- if (mWindowType == eWindowType_toplevel) { ++ if (mWindowType == eWindowType_toplevel || ++ mWindowType == eWindowType_dialog) { + MOZ_DIAGNOSTIC_ASSERT(mGdkWindow, + "Getting configure for invisible window?"); + if (mWindowScaleFactor != gdk_window_get_scale_factor(mGdkWindow)) { + LOG(" scale factor changed to %d,return early", + gdk_window_get_scale_factor(mGdkWindow)); +@@ -4864,10 +4865,11 @@ + // Force scale factor recalculation + if (!mGdkWindow) { + mWindowScaleFactorChanged = true; + return; + } ++ LOG("OnScaleChanged -> %d\n", gdk_window_get_scale_factor(mGdkWindow)); + + // Gtk supply us sometimes with doubled events so stay calm in such case. + if (gdk_window_get_scale_factor(mGdkWindow) == mWindowScaleFactor) { + return; + } + From 4fc899095270f26783e0dd350c2eb3e41c7ac978 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Wed, 11 May 2022 09:11:20 +0200 Subject: [PATCH 045/545] Removed already added patch: mozilla-1767916-multimonitor-crash.patch --- firefox.spec | 2 -- mozilla-1767916-multimonitor-crash.patch | 21 --------------------- 2 files changed, 23 deletions(-) delete mode 100644 mozilla-1767916-multimonitor-crash.patch diff --git a/firefox.spec b/firefox.spec index 4482ab2..336f2a5 100644 --- a/firefox.spec +++ b/firefox.spec @@ -218,7 +218,6 @@ Patch61: firefox-glibc-dynstack.patch Patch62: build-python.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch72: D142373.diff -Patch73: mozilla-1767916-multimonitor-crash.patch # Test patches # Generate without context by @@ -463,7 +462,6 @@ This package contains results of tests executed during build. %patch54 -p1 -b .1669639 %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch72 -p1 -b .D142373 -%patch73 -p1 -b .mozilla-1767916-multimonitor-crash # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell diff --git a/mozilla-1767916-multimonitor-crash.patch b/mozilla-1767916-multimonitor-crash.patch deleted file mode 100644 index 7ca3a2e..0000000 --- a/mozilla-1767916-multimonitor-crash.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/widget/gtk/MozContainerWayland.cpp b/widget/gtk/MozContainerWayland.cpp ---- a/widget/gtk/MozContainerWayland.cpp -+++ b/widget/gtk/MozContainerWayland.cpp -@@ -527,10 +527,16 @@ - return; - } - - LOGWAYLAND("%s [%p] scale %d\n", __FUNCTION__, - (void*)moz_container_get_nsWindow(container), scale); -+ // There is a chance that the attached wl_buffer has not yet been doubled -+ // on the main thread when scale factor changed to 2. This leads to -+ // crash with the following message: -+ // Buffer size (AxB) must be an integer multiple of the buffer_scale (2) -+ // Removing the possibly wrong wl_buffer to prevent that crash: -+ wl_surface_attach(wl_container->surface, nullptr, 0, 0); - wl_surface_set_buffer_scale(wl_container->surface, scale); - wl_container->buffer_scale = scale; - } - } - - From 300248bcb6f3dc5126d45aeeef553547e5c22f20 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Mon, 16 May 2022 20:50:22 +0200 Subject: [PATCH 046/545] Fix spellchecker.dictionary_path of F36+ --- firefox-redhat-default-prefs.js | 2 +- firefox.spec | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/firefox-redhat-default-prefs.js b/firefox-redhat-default-prefs.js index 1c0be99..6fcee25 100644 --- a/firefox-redhat-default-prefs.js +++ b/firefox-redhat-default-prefs.js @@ -26,7 +26,7 @@ pref("plugins.notifyMissingFlash", false); pref("browser.display.use_system_colors", false); /* Allow sending credetials to all https:// sites */ pref("network.negotiate-auth.trusted-uris", "https://"); -pref("spellchecker.dictionary_path","/usr/share/myspell"); +pref("spellchecker.dictionary_path","/usr/share/hunspell"); /* Disable DoH by default */ pref("network.trr.mode", 5); /* Enable per-user policy dir, see mozbz#1583466 */ diff --git a/firefox.spec b/firefox.spec index 336f2a5..9b0c29c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 100.0 -Release: 5%{?pre_tag}%{?dist} +Release: 6%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -905,6 +905,13 @@ ln -s %{_datadir}/myspell %{buildroot}%{mozappdir}/dictionaries # Default %{__cp} %{SOURCE12} %{buildroot}%{mozappdir}/browser/defaults/preferences +# Since Fedora 36 the location of dictionaries has changed to /usr/share/hunspell. +# For backward spec compatibility we set the old path in previous versions. +# TODO remove when Fedora 35 becomes obsolete +%if 0%{?fedora} <= 35 +sed -ie 's|/usr/share/hunspell|/usr/share/myspell|g' %{buildroot}%{mozappdir}/browser/defaults/preferences/firefox-redhat-default-prefs.js +%endif + # Copy over run-mozilla.sh %{__cp} build/unix/run-mozilla.sh %{buildroot}%{mozappdir} @@ -1052,6 +1059,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Mon May 16 2022 Jan Horak - 100.0-6 +- Fix spellchecker.dictionary_path of F36+ + * Tue May 10 2022 Jan Horak - 100.0-5 - Fix crashes on f36 multimonitor setup and too big profile manager From b6cd53938dfc9c48b7920ec26a3377b59702f693 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 18 May 2022 09:27:05 +0200 Subject: [PATCH 047/545] Updated to 100.0.1 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index ecc5f1d..f2f630e 100644 --- a/.gitignore +++ b/.gitignore @@ -507,3 +507,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-99.0.1.source.tar.xz /firefox-100.0.source.tar.xz /firefox-langpacks-100.0-20220502.tar.xz +/firefox-100.0.1.source.tar.xz +/firefox-langpacks-100.0.1-20220518.tar.xz diff --git a/firefox.spec b/firefox.spec index 13b52e2..5a6f4cb 100644 --- a/firefox.spec +++ b/firefox.spec @@ -162,13 +162,13 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox -Version: 100.0 -Release: 4%{?pre_tag}%{?dist} +Version: 100.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220502.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220518.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1050,6 +1050,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Wed May 18 2022 Martin Stransky - 100.0.1-1 +- Updated to 100.0.1 + * Mon May 9 2022 Martin Stransky - 100.0-4 - Added fix for mozbz#1767916. diff --git a/sources b/sources index 32377fc..d0ad2a3 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = b9ab1498be90ecf60822df7021f8812f124550d97f8cd687c69d3ab56fc5fb714bfe88c78c978a1794d211724909a9a5cad6a4b483fa05f762909c45d5075520 SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (firefox-100.0.source.tar.xz) = 29c56391c980209ff94c02a9aba18fe27bea188bdcbcf7fe0c0f27f61e823f4507a3ec343b27cb5285cf3901843e9cc4aca8e568beb623c4b69b7282e662b2aa -SHA512 (firefox-langpacks-100.0-20220502.tar.xz) = 38e91cf8d6df6cf455891563f72090d1f277750f62f7a8c3cf5afd1d0a7aa2e1a6b47e65fc9d8419305ec2075c0ff3de41dbb7b5251790ff1bf3cd1f7db7bbbb +SHA512 (firefox-100.0.1.source.tar.xz) = 6ba09542d1573e903978f8e63f39381dcf2180219e80e7401c62c8347100d6d4a973208b8094cff07d76106636cdfef93829fff3398011fd9536dac477ef118e +SHA512 (firefox-langpacks-100.0.1-20220518.tar.xz) = 008dbcf1e6f8dc193bf4939f4fb42559ab38fd410ba9fc10c765378b7e6d174ef869f0475abd863cfe7c3f5ff6e0f701588f53ba1d57c756cbf5ea11981a8ab6 From 23596a6fd9cdae03b3f6219873fe81da3cca46d6 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Thu, 19 May 2022 08:08:03 +0200 Subject: [PATCH 048/545] Fix the sed command for default prefs --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index cfe519b..1a39eeb 100644 --- a/firefox.spec +++ b/firefox.spec @@ -909,7 +909,7 @@ ln -s %{_datadir}/myspell %{buildroot}%{mozappdir}/dictionaries # For backward spec compatibility we set the old path in previous versions. # TODO remove when Fedora 35 becomes obsolete %if 0%{?fedora} <= 35 -sed -ie 's|/usr/share/hunspell|/usr/share/myspell|g' %{buildroot}%{mozappdir}/browser/defaults/preferences/firefox-redhat-default-prefs.js +sed -i -e 's|/usr/share/hunspell|/usr/share/myspell|g' %{buildroot}%{mozappdir}/browser/defaults/preferences/firefox-redhat-default-prefs.js %endif # Copy over run-mozilla.sh From 02b4146177a6f4950da275b59eec7644c3168b21 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 20 May 2022 10:37:38 +0200 Subject: [PATCH 049/545] Updated to 100.0.2 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index f2f630e..9dbb896 100644 --- a/.gitignore +++ b/.gitignore @@ -509,3 +509,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-100.0-20220502.tar.xz /firefox-100.0.1.source.tar.xz /firefox-langpacks-100.0.1-20220518.tar.xz +/firefox-100.0.2.source.tar.xz +/firefox-langpacks-100.0.2-20220520.tar.xz diff --git a/firefox.spec b/firefox.spec index 1a39eeb..aa58a27 100644 --- a/firefox.spec +++ b/firefox.spec @@ -162,13 +162,13 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox -Version: 100.0.1 +Version: 100.0.2 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220518.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220520.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1059,6 +1059,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Fri May 20 2022 Martin Stransky - 100.0.2-1 +- Updated to 100.0.2 + * Wed May 18 2022 Martin Stransky - 100.0.1-1 - Updated to 100.0.1 diff --git a/sources b/sources index d0ad2a3..381f526 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = b9ab1498be90ecf60822df7021f8812f124550d97f8cd687c69d3ab56fc5fb714bfe88c78c978a1794d211724909a9a5cad6a4b483fa05f762909c45d5075520 SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (firefox-100.0.1.source.tar.xz) = 6ba09542d1573e903978f8e63f39381dcf2180219e80e7401c62c8347100d6d4a973208b8094cff07d76106636cdfef93829fff3398011fd9536dac477ef118e -SHA512 (firefox-langpacks-100.0.1-20220518.tar.xz) = 008dbcf1e6f8dc193bf4939f4fb42559ab38fd410ba9fc10c765378b7e6d174ef869f0475abd863cfe7c3f5ff6e0f701588f53ba1d57c756cbf5ea11981a8ab6 +SHA512 (firefox-100.0.2.source.tar.xz) = 6d9922e35e496fa63833ba03d1466e075287e40e50854ddc4f4a2036d9c7ca1f35c03bc6f708a3c469e0ec3b389b3346ac754bb84df0fecb86955fc21c05e00f +SHA512 (firefox-langpacks-100.0.2-20220520.tar.xz) = 12ce91a452cef7937c6b25623a00fa2d2aedea3b7856bbbd3c0ee2cf08f55d525aa5e2b91d11e265b58f4b4505930d99b7a5d295d9cd92839ada3e3850e181af From 972fcbe03983f3b2ba0f0b6dc34b0652105f139e Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 25 May 2022 11:52:47 +0200 Subject: [PATCH 050/545] Added fix for mzbz#1771104 --- D147266.diff | 31 +++++++++++++++++++++++++++++++ D147267.diff | 19 +++++++++++++++++++ firefox.spec | 9 ++++++++- 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 D147266.diff create mode 100644 D147267.diff diff --git a/D147266.diff b/D147266.diff new file mode 100644 index 0000000..5f8a580 --- /dev/null +++ b/D147266.diff @@ -0,0 +1,31 @@ +diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp +--- a/widget/gtk/nsWindow.cpp ++++ b/widget/gtk/nsWindow.cpp +@@ -1430,20 +1430,20 @@ + } + #endif + if (popup->mPopupContextMenu && !popup->mPopupAnchored) { + LOG(" popup [%p] is first context menu", popup); + popup->mRelativePopupPosition = popup->mPopupPosition; +- } else if (popup->mPopupAnchored) { +- LOG(" popup [%p] is anchored", popup); +- if (!popup->mPopupMatchesLayout) { +- NS_WARNING("Anchored popup does not match layout!"); +- } +- popup->mRelativePopupPosition = popup->mPopupPosition; + } else if (popup->mWaylandPopupPrev->mWaylandToplevel == nullptr) { + LOG(" popup [%p] has toplevel as parent", popup); + popup->mRelativePopupPosition = popup->mPopupPosition; + } else { ++ if (popup->mPopupAnchored) { ++ LOG(" popup [%p] is anchored", popup); ++ if (!popup->mPopupMatchesLayout) { ++ NS_WARNING("Anchored popup does not match layout!"); ++ } ++ } + GdkPoint parent = WaylandGetParentPosition(); + + LOG(" popup [%p] uses transformed coordinates\n", popup); + LOG(" parent position [%d, %d]\n", parent.x, parent.y); + LOG(" popup position [%d, %d]\n", popup->mPopupPosition.x, + diff --git a/D147267.diff b/D147267.diff new file mode 100644 index 0000000..1191b85 --- /dev/null +++ b/D147267.diff @@ -0,0 +1,19 @@ +diff -up firefox-100.0.2/widget/gtk/nsWindow.cpp.D147267 firefox-100.0.2/widget/gtk/nsWindow.cpp +--- firefox-100.0.2/widget/gtk/nsWindow.cpp.D147267 2022-05-25 11:46:48.291005415 +0200 ++++ firefox-100.0.2/widget/gtk/nsWindow.cpp 2022-05-25 11:50:11.447736538 +0200 +@@ -2359,11 +2359,12 @@ void nsWindow::WaylandPopupMove() { + LOG(" popup use move to rect %d\n", mPopupUseMoveToRect); + + if (!mPopupUseMoveToRect) { +- if (mNeedsShow && mPopupType != ePopupTypeTooltip) { ++ if (mPopupHint == ePopupTypeMenu) { + // Workaround for https://gitlab.gnome.org/GNOME/gtk/-/issues/4308 +- // Tooltips are created as subsurfaces with relative position. ++ // Tooltips/Utility popus are created as subsurfaces with relative position. ++ // Menu uses absolute positions. + LOG(" use gtk_window_move(%d, %d) for hidden widget\n", mPopupPosition.x, +- mPopupPosition.y); ++ mPopupPosition.y); + gtk_window_move(GTK_WINDOW(mShell), mPopupPosition.x, mPopupPosition.y); + } else { + LOG(" use gtk_window_move(%d, %d) for visible widget\n", diff --git a/firefox.spec b/firefox.spec index aa58a27..40f6e66 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 100.0.2 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -218,6 +218,8 @@ Patch61: firefox-glibc-dynstack.patch Patch62: build-python.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch72: D142373.diff +Patch73: D147266.diff +Patch74: D147267.diff # Test patches # Generate without context by @@ -462,6 +464,8 @@ This package contains results of tests executed during build. %patch54 -p1 -b .1669639 %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch72 -p1 -b .D142373 +%patch73 -p1 -b .D147266 +%patch74 -p1 -b .D147267 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -1059,6 +1063,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Wed May 25 2022 Martin Stransky - 100.0.2-2 +- Added fix for mzbz#1771104 + * Fri May 20 2022 Martin Stransky - 100.0.2-1 - Updated to 100.0.2 From 888df264aa7c71281d5c95b521a91a3639bc3ab2 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 30 May 2022 21:40:33 +0200 Subject: [PATCH 051/545] Update to 101.0 --- .gitignore | 2 + D142373.diff | 86 - D145094.diff | 61 - D145541.diff | 21 - firefox.spec | 19 +- libwebrtc-screen-cast-sync.patch | 2957 ++++++++++++++---------------- mozilla-1663844.patch | 33 +- sources | 4 +- 8 files changed, 1390 insertions(+), 1793 deletions(-) delete mode 100644 D142373.diff delete mode 100644 D145094.diff delete mode 100644 D145541.diff diff --git a/.gitignore b/.gitignore index 9dbb896..9cb84f4 100644 --- a/.gitignore +++ b/.gitignore @@ -511,3 +511,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-100.0.1-20220518.tar.xz /firefox-100.0.2.source.tar.xz /firefox-langpacks-100.0.2-20220520.tar.xz +/firefox-101.0.source.tar.xz +/firefox-langpacks-101.0-20220530.tar.xz diff --git a/D142373.diff b/D142373.diff deleted file mode 100644 index 932cf7a..0000000 --- a/D142373.diff +++ /dev/null @@ -1,86 +0,0 @@ -diff --git a/python/mozbuild/mozbuild/build_commands.py b/python/mozbuild/mozbuild/build_commands.py ---- a/python/mozbuild/mozbuild/build_commands.py -+++ b/python/mozbuild/mozbuild/build_commands.py -@@ -183,10 +183,11 @@ - directory=directory, - verbose=verbose, - keep_going=keep_going, - mach_context=command_context._mach_context, - append_env=append_env, -+ virtualenv_topobjdir=orig_topobjdir, - ) - if status != 0: - return status - - # Packaging the instrumented build is required to get the jarlog -@@ -206,11 +207,11 @@ - pgo_env["LLVM_PROFDATA"] = instr.config_environment.substs.get( - "LLVM_PROFDATA" - ) - pgo_env["JARLOG_FILE"] = mozpath.join(orig_topobjdir, "jarlog/en-US.log") - pgo_cmd = [ -- instr.virtualenv_manager.python_path, -+ command_context.virtualenv_manager.python_path, - mozpath.join(command_context.topsrcdir, "build/pgo/profileserver.py"), - ] - subprocess.check_call(pgo_cmd, cwd=instr.topobjdir, env=pgo_env) - - # Set the default build to MOZ_PROFILE_USE -diff --git a/python/mozbuild/mozbuild/controller/building.py b/python/mozbuild/mozbuild/controller/building.py ---- a/python/mozbuild/mozbuild/controller/building.py -+++ b/python/mozbuild/mozbuild/controller/building.py -@@ -1220,10 +1220,11 @@ - directory=None, - verbose=False, - keep_going=False, - mach_context=None, - append_env=None, -+ virtualenv_topobjdir=None, - ): - """Invoke the build backend. - - ``what`` defines the thing to build. If not defined, the default - target is used. -@@ -1297,10 +1298,11 @@ - config_rc = self.configure( - metrics, - buildstatus_messages=True, - line_handler=output.on_line, - append_env=append_env, -+ virtualenv_topobjdir=virtualenv_topobjdir, - ) - - if config_rc != 0: - return config_rc - -@@ -1635,10 +1637,11 @@ - metrics, - options=None, - buildstatus_messages=False, - line_handler=None, - append_env=None, -+ virtualenv_topobjdir=None, - ): - # Disable indexing in objdir because it is not necessary and can slow - # down builds. - self.metrics = metrics - mkdir(self.topobjdir, not_indexed=True) -@@ -1658,15 +1661,16 @@ - if line.startswith("export "): - k, eq, v = line[len("export ") :].partition("=") - if eq == "=": - append_env[k] = v - -+ virtualenv_topobjdir = virtualenv_topobjdir or self.topobjdir - build_site = CommandSiteManager.from_environment( - self.topsrcdir, - lambda: get_state_dir(specific_to_topsrcdir=True, topsrcdir=self.topsrcdir), - "build", -- os.path.join(self.topobjdir, "_virtualenvs"), -+ os.path.join(virtualenv_topobjdir, "_virtualenvs"), - ) - build_site.ensure() - - command = [build_site.python_path, os.path.join(self.topsrcdir, "configure.py")] - if options: - diff --git a/D145094.diff b/D145094.diff deleted file mode 100644 index 711acc9..0000000 --- a/D145094.diff +++ /dev/null @@ -1,61 +0,0 @@ -diff -up firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.D145094 firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp ---- firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.D145094 2022-04-29 01:01:46.000000000 +0200 -+++ firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp 2022-05-03 09:51:48.570471687 +0200 -@@ -23,7 +23,7 @@ RefPtr VideoFrameSurface< - VideoFrameSurface::VideoFrameSurface(DMABufSurface* aSurface) - : mSurface(aSurface), - mLib(nullptr), -- mAVHWDeviceContext(nullptr), -+ mAVHWFrameContext(nullptr), - mHWAVBuffer(nullptr) { - // Create global refcount object to track mSurface usage over - // gects rendering engine. We can't release it until it's used -@@ -38,16 +38,22 @@ VideoFrameSurface::VideoFrame - void VideoFrameSurface::LockVAAPIData( - AVCodecContext* aAVCodecContext, AVFrame* aAVFrame, - FFmpegLibWrapper* aLib) { -- FFMPEG_LOG("VideoFrameSurface: VAAPI locking dmabuf surface UID = %d", -- mSurface->GetUID()); -+ MOZ_DIAGNOSTIC_ASSERT(aAVCodecContext->hw_frames_ctx); - mLib = aLib; -- mAVHWDeviceContext = aLib->av_buffer_ref(aAVCodecContext->hw_device_ctx); -+ mAVHWFrameContext = aLib->av_buffer_ref(aAVCodecContext->hw_frames_ctx); - mHWAVBuffer = aLib->av_buffer_ref(aAVFrame->buf[0]); -+ FFMPEG_LOG( -+ "VideoFrameSurface: VAAPI locking dmabuf surface UID = %d " -+ "mAVHWFrameContext %p mHWAVBuffer %p", -+ mSurface->GetUID(), mAVHWFrameContext, mHWAVBuffer); - } - - void VideoFrameSurface::ReleaseVAAPIData(bool aForFrameRecycle) { -- FFMPEG_LOG("VideoFrameSurface: VAAPI releasing dmabuf surface UID = %d", -- mSurface->GetUID()); -+ FFMPEG_LOG( -+ "VideoFrameSurface: VAAPI releasing dmabuf surface UID = %d " -+ "aForFrameRecycle %d mLib %p mAVHWFrameContext %p mHWAVBuffer %p", -+ mSurface->GetUID(), aForFrameRecycle, mLib, mAVHWFrameContext, -+ mHWAVBuffer); - - // It's possible to unref GPU data while IsUsed() is still set. - // It can happens when VideoFramePool is deleted while decoder shutdown -@@ -57,7 +63,7 @@ void VideoFrameSurface::Relea - // is closed. - if (mLib) { - mLib->av_buffer_unref(&mHWAVBuffer); -- mLib->av_buffer_unref(&mAVHWDeviceContext); -+ mLib->av_buffer_unref(&mAVHWFrameContext); - } - - // If we want to recycle the frame, make sure it's not used -diff -up firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.D145094 firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h ---- firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.D145094 2022-04-29 00:02:40.000000000 +0200 -+++ firefox-100.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h 2022-05-03 09:33:27.110885715 +0200 -@@ -102,7 +102,7 @@ class VideoFrameSurface { - - const RefPtr mSurface; - const FFmpegLibWrapper* mLib; -- AVBufferRef* mAVHWDeviceContext; -+ AVBufferRef* mAVHWFrameContext; - AVBufferRef* mHWAVBuffer; - }; - diff --git a/D145541.diff b/D145541.diff deleted file mode 100644 index 7ca3a2e..0000000 --- a/D145541.diff +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/widget/gtk/MozContainerWayland.cpp b/widget/gtk/MozContainerWayland.cpp ---- a/widget/gtk/MozContainerWayland.cpp -+++ b/widget/gtk/MozContainerWayland.cpp -@@ -527,10 +527,16 @@ - return; - } - - LOGWAYLAND("%s [%p] scale %d\n", __FUNCTION__, - (void*)moz_container_get_nsWindow(container), scale); -+ // There is a chance that the attached wl_buffer has not yet been doubled -+ // on the main thread when scale factor changed to 2. This leads to -+ // crash with the following message: -+ // Buffer size (AxB) must be an integer multiple of the buffer_scale (2) -+ // Removing the possibly wrong wl_buffer to prevent that crash: -+ wl_surface_attach(wl_container->surface, nullptr, 0, 0); - wl_surface_set_buffer_scale(wl_container->surface, scale); - wl_container->buffer_scale = scale; - } - } - - diff --git a/firefox.spec b/firefox.spec index 40f6e66..3206448 100644 --- a/firefox.spec +++ b/firefox.spec @@ -124,9 +124,9 @@ ExcludeArch: aarch64 %endif %if %{?system_nss} -%global nspr_version 4.26 +%global nspr_version 4.32 %global nspr_build_version %{nspr_version} -%global nss_version 3.76 +%global nss_version 3.78 %global nss_build_version %{nss_version} %endif @@ -162,13 +162,13 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox -Version: 100.0.2 -Release: 2%{?pre_tag}%{?dist} +Version: 101.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220520.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220530.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -217,7 +217,6 @@ Patch55: firefox-testing.patch Patch61: firefox-glibc-dynstack.patch Patch62: build-python.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch -Patch72: D142373.diff Patch73: D147266.diff Patch74: D147267.diff @@ -243,8 +242,6 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch -Patch416: D145094.diff -Patch417: D145541.diff Patch418: mozilla-1767946-profilemanagersize.patch # PGO/LTO patches @@ -463,7 +460,6 @@ This package contains results of tests executed during build. %patch53 -p1 -b .firefox-gcc-build %patch54 -p1 -b .1669639 %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 -%patch72 -p1 -b .D142373 %patch73 -p1 -b .D147266 %patch74 -p1 -b .D147267 @@ -487,8 +483,6 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 -%patch416 -p1 -b .D145094 -%patch417 -p1 -b .D145541 %patch418 -p1 -b .mozilla-1767946-profilemanagersize # PGO patches @@ -1063,6 +1057,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Mon May 30 2022 Martin Stransky - 101.0-1 +- Updated to 101.0 + * Wed May 25 2022 Martin Stransky - 100.0.2-2 - Added fix for mzbz#1771104 diff --git a/libwebrtc-screen-cast-sync.patch b/libwebrtc-screen-cast-sync.patch index 09bfd0f..fab5b5c 100644 --- a/libwebrtc-screen-cast-sync.patch +++ b/libwebrtc-screen-cast-sync.patch @@ -1,13 +1,6 @@ -From e0e925da71abb97a60d02716b18faa19a29fada6 Mon Sep 17 00:00:00 2001 -From: Jan Grulich -Date: Mon, 21 Feb 2022 15:34:52 +0100 -Subject: WebRTC - screen cast sync - - -diff --git a/dom/media/webrtc/third_party_build/moz.build b/dom/media/webrtc/third_party_build/moz.build -index e4c7ba7..a42f913 100644 ---- a/dom/media/webrtc/third_party_build/moz.build -+++ b/dom/media/webrtc/third_party_build/moz.build +diff -up firefox-101.0/dom/media/webrtc/third_party_build/moz.build.libwebrtc-screen-cast-sync firefox-101.0/dom/media/webrtc/third_party_build/moz.build +--- firefox-101.0/dom/media/webrtc/third_party_build/moz.build.libwebrtc-screen-cast-sync 2022-05-27 01:16:54.000000000 +0200 ++++ firefox-101.0/dom/media/webrtc/third_party_build/moz.build 2022-05-30 21:33:19.740522043 +0200 @@ -63,6 +63,8 @@ webrtc_non_unified_sources = [ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": @@ -17,1220 +10,9 @@ index e4c7ba7..a42f913 100644 GN_DIRS += ["../../../../third_party/libwebrtc"] -diff --git a/third_party/drm/README b/third_party/drm/README -new file mode 100644 -index 0000000..f68ed10 ---- /dev/null -+++ b/third_party/drm/README -@@ -0,0 +1,4 @@ -+Libdrm is a drm library wrapper needed to build and run Firefox with -+Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/drm). -+ -+libdrm directory stores headers of libdrm needed for build only. -diff --git a/third_party/drm/drm/drm.h b/third_party/drm/drm/drm.h -new file mode 100644 -index 0000000..5e54c3a ---- /dev/null -+++ b/third_party/drm/drm/drm.h -@@ -0,0 +1,1193 @@ -+/* -+ * Header for the Direct Rendering Manager -+ * -+ * Author: Rickard E. (Rik) Faith -+ * -+ * Acknowledgments: -+ * Dec 1999, Richard Henderson , move to generic cmpxchg. -+ */ -+ -+/* -+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. -+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. -+ * All rights reserved. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#ifndef _DRM_H_ -+#define _DRM_H_ -+ -+#if defined(__linux__) -+ -+#include -+#include -+typedef unsigned int drm_handle_t; -+ -+#else /* One of the BSDs */ -+ -+#include -+#include -+#include -+typedef int8_t __s8; -+typedef uint8_t __u8; -+typedef int16_t __s16; -+typedef uint16_t __u16; -+typedef int32_t __s32; -+typedef uint32_t __u32; -+typedef int64_t __s64; -+typedef uint64_t __u64; -+typedef size_t __kernel_size_t; -+typedef unsigned long drm_handle_t; -+ -+#endif -+ -+#if defined(__cplusplus) -+extern "C" { -+#endif -+ -+#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */ -+#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */ -+#define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */ -+#define DRM_RAM_PERCENT 10 /**< How much system ram can we lock? */ -+ -+#define _DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */ -+#define _DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */ -+#define _DRM_LOCK_IS_HELD(lock) ((lock) & _DRM_LOCK_HELD) -+#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT) -+#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) -+ -+typedef unsigned int drm_context_t; -+typedef unsigned int drm_drawable_t; -+typedef unsigned int drm_magic_t; -+ -+/* -+ * Cliprect. -+ * -+ * \warning: If you change this structure, make sure you change -+ * XF86DRIClipRectRec in the server as well -+ * -+ * \note KW: Actually it's illegal to change either for -+ * backwards-compatibility reasons. -+ */ -+struct drm_clip_rect { -+ unsigned short x1; -+ unsigned short y1; -+ unsigned short x2; -+ unsigned short y2; -+}; -+ -+/* -+ * Drawable information. -+ */ -+struct drm_drawable_info { -+ unsigned int num_rects; -+ struct drm_clip_rect *rects; -+}; -+ -+/* -+ * Texture region, -+ */ -+struct drm_tex_region { -+ unsigned char next; -+ unsigned char prev; -+ unsigned char in_use; -+ unsigned char padding; -+ unsigned int age; -+}; -+ -+/* -+ * Hardware lock. -+ * -+ * The lock structure is a simple cache-line aligned integer. To avoid -+ * processor bus contention on a multiprocessor system, there should not be any -+ * other data stored in the same cache line. -+ */ -+struct drm_hw_lock { -+ __volatile__ unsigned int lock; /**< lock variable */ -+ char padding[60]; /**< Pad to cache line */ -+}; -+ -+/* -+ * DRM_IOCTL_VERSION ioctl argument type. -+ * -+ * \sa drmGetVersion(). -+ */ -+struct drm_version { -+ int version_major; /**< Major version */ -+ int version_minor; /**< Minor version */ -+ int version_patchlevel; /**< Patch level */ -+ __kernel_size_t name_len; /**< Length of name buffer */ -+ char *name; /**< Name of driver */ -+ __kernel_size_t date_len; /**< Length of date buffer */ -+ char *date; /**< User-space buffer to hold date */ -+ __kernel_size_t desc_len; /**< Length of desc buffer */ -+ char *desc; /**< User-space buffer to hold desc */ -+}; -+ -+/* -+ * DRM_IOCTL_GET_UNIQUE ioctl argument type. -+ * -+ * \sa drmGetBusid() and drmSetBusId(). -+ */ -+struct drm_unique { -+ __kernel_size_t unique_len; /**< Length of unique */ -+ char *unique; /**< Unique name for driver instantiation */ -+}; -+ -+struct drm_list { -+ int count; /**< Length of user-space structures */ -+ struct drm_version *version; -+}; -+ -+struct drm_block { -+ int unused; -+}; -+ -+/* -+ * DRM_IOCTL_CONTROL ioctl argument type. -+ * -+ * \sa drmCtlInstHandler() and drmCtlUninstHandler(). -+ */ -+struct drm_control { -+ enum { -+ DRM_ADD_COMMAND, -+ DRM_RM_COMMAND, -+ DRM_INST_HANDLER, -+ DRM_UNINST_HANDLER -+ } func; -+ int irq; -+}; -+ -+/* -+ * Type of memory to map. -+ */ -+enum drm_map_type { -+ _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */ -+ _DRM_REGISTERS = 1, /**< no caching, no core dump */ -+ _DRM_SHM = 2, /**< shared, cached */ -+ _DRM_AGP = 3, /**< AGP/GART */ -+ _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */ -+ _DRM_CONSISTENT = 5 /**< Consistent memory for PCI DMA */ -+}; -+ -+/* -+ * Memory mapping flags. -+ */ -+enum drm_map_flags { -+ _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */ -+ _DRM_READ_ONLY = 0x02, -+ _DRM_LOCKED = 0x04, /**< shared, cached, locked */ -+ _DRM_KERNEL = 0x08, /**< kernel requires access */ -+ _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */ -+ _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */ -+ _DRM_REMOVABLE = 0x40, /**< Removable mapping */ -+ _DRM_DRIVER = 0x80 /**< Managed by driver */ -+}; -+ -+struct drm_ctx_priv_map { -+ unsigned int ctx_id; /**< Context requesting private mapping */ -+ void *handle; /**< Handle of map */ -+}; -+ -+/* -+ * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls -+ * argument type. -+ * -+ * \sa drmAddMap(). -+ */ -+struct drm_map { -+ unsigned long offset; /**< Requested physical address (0 for SAREA)*/ -+ unsigned long size; /**< Requested physical size (bytes) */ -+ enum drm_map_type type; /**< Type of memory to map */ -+ enum drm_map_flags flags; /**< Flags */ -+ void *handle; /**< User-space: "Handle" to pass to mmap() */ -+ /**< Kernel-space: kernel-virtual address */ -+ int mtrr; /**< MTRR slot used */ -+ /* Private data */ -+}; -+ -+/* -+ * DRM_IOCTL_GET_CLIENT ioctl argument type. -+ */ -+struct drm_client { -+ int idx; /**< Which client desired? */ -+ int auth; /**< Is client authenticated? */ -+ unsigned long pid; /**< Process ID */ -+ unsigned long uid; /**< User ID */ -+ unsigned long magic; /**< Magic */ -+ unsigned long iocs; /**< Ioctl count */ -+}; -+ -+enum drm_stat_type { -+ _DRM_STAT_LOCK, -+ _DRM_STAT_OPENS, -+ _DRM_STAT_CLOSES, -+ _DRM_STAT_IOCTLS, -+ _DRM_STAT_LOCKS, -+ _DRM_STAT_UNLOCKS, -+ _DRM_STAT_VALUE, /**< Generic value */ -+ _DRM_STAT_BYTE, /**< Generic byte counter (1024bytes/K) */ -+ _DRM_STAT_COUNT, /**< Generic non-byte counter (1000/k) */ -+ -+ _DRM_STAT_IRQ, /**< IRQ */ -+ _DRM_STAT_PRIMARY, /**< Primary DMA bytes */ -+ _DRM_STAT_SECONDARY, /**< Secondary DMA bytes */ -+ _DRM_STAT_DMA, /**< DMA */ -+ _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */ -+ _DRM_STAT_MISSED /**< Missed DMA opportunity */ -+ /* Add to the *END* of the list */ -+}; -+ -+/* -+ * DRM_IOCTL_GET_STATS ioctl argument type. -+ */ -+struct drm_stats { -+ unsigned long count; -+ struct { -+ unsigned long value; -+ enum drm_stat_type type; -+ } data[15]; -+}; -+ -+/* -+ * Hardware locking flags. -+ */ -+enum drm_lock_flags { -+ _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */ -+ _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */ -+ _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */ -+ _DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */ -+ /* These *HALT* flags aren't supported yet -+ -- they will be used to support the -+ full-screen DGA-like mode. */ -+ _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */ -+ _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ -+}; -+ -+/* -+ * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type. -+ * -+ * \sa drmGetLock() and drmUnlock(). -+ */ -+struct drm_lock { -+ int context; -+ enum drm_lock_flags flags; -+}; -+ -+/* -+ * DMA flags -+ * -+ * \warning -+ * These values \e must match xf86drm.h. -+ * -+ * \sa drm_dma. -+ */ -+enum drm_dma_flags { -+ /* Flags for DMA buffer dispatch */ -+ _DRM_DMA_BLOCK = 0x01, /**< -+ * Block until buffer dispatched. -+ * -+ * \note The buffer may not yet have -+ * been processed by the hardware -- -+ * getting a hardware lock with the -+ * hardware quiescent will ensure -+ * that the buffer has been -+ * processed. -+ */ -+ _DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */ -+ _DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */ -+ -+ /* Flags for DMA buffer request */ -+ _DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */ -+ _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */ -+ _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ -+}; -+ -+/* -+ * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type. -+ * -+ * \sa drmAddBufs(). -+ */ -+struct drm_buf_desc { -+ int count; /**< Number of buffers of this size */ -+ int size; /**< Size in bytes */ -+ int low_mark; /**< Low water mark */ -+ int high_mark; /**< High water mark */ -+ enum { -+ _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */ -+ _DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */ -+ _DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */ -+ _DRM_FB_BUFFER = 0x08, /**< Buffer is in frame buffer */ -+ _DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */ -+ } flags; -+ unsigned long agp_start; /**< -+ * Start address of where the AGP buffers are -+ * in the AGP aperture -+ */ -+}; -+ -+/* -+ * DRM_IOCTL_INFO_BUFS ioctl argument type. -+ */ -+struct drm_buf_info { -+ int count; /**< Entries in list */ -+ struct drm_buf_desc *list; -+}; -+ -+/* -+ * DRM_IOCTL_FREE_BUFS ioctl argument type. -+ */ -+struct drm_buf_free { -+ int count; -+ int *list; -+}; -+ -+/* -+ * Buffer information -+ * -+ * \sa drm_buf_map. -+ */ -+struct drm_buf_pub { -+ int idx; /**< Index into the master buffer list */ -+ int total; /**< Buffer size */ -+ int used; /**< Amount of buffer in use (for DMA) */ -+ void *address; /**< Address of buffer */ -+}; -+ -+/* -+ * DRM_IOCTL_MAP_BUFS ioctl argument type. -+ */ -+struct drm_buf_map { -+ int count; /**< Length of the buffer list */ -+#ifdef __cplusplus -+ void *virt; -+#else -+ void *virtual; /**< Mmap'd area in user-virtual */ -+#endif -+ struct drm_buf_pub *list; /**< Buffer information */ -+}; -+ -+/* -+ * DRM_IOCTL_DMA ioctl argument type. -+ * -+ * Indices here refer to the offset into the buffer list in drm_buf_get. -+ * -+ * \sa drmDMA(). -+ */ -+struct drm_dma { -+ int context; /**< Context handle */ -+ int send_count; /**< Number of buffers to send */ -+ int *send_indices; /**< List of handles to buffers */ -+ int *send_sizes; /**< Lengths of data to send */ -+ enum drm_dma_flags flags; /**< Flags */ -+ int request_count; /**< Number of buffers requested */ -+ int request_size; /**< Desired size for buffers */ -+ int *request_indices; /**< Buffer information */ -+ int *request_sizes; -+ int granted_count; /**< Number of buffers granted */ -+}; -+ -+enum drm_ctx_flags { -+ _DRM_CONTEXT_PRESERVED = 0x01, -+ _DRM_CONTEXT_2DONLY = 0x02 -+}; -+ -+/* -+ * DRM_IOCTL_ADD_CTX ioctl argument type. -+ * -+ * \sa drmCreateContext() and drmDestroyContext(). -+ */ -+struct drm_ctx { -+ drm_context_t handle; -+ enum drm_ctx_flags flags; -+}; -+ -+/* -+ * DRM_IOCTL_RES_CTX ioctl argument type. -+ */ -+struct drm_ctx_res { -+ int count; -+ struct drm_ctx *contexts; -+}; -+ -+/* -+ * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type. -+ */ -+struct drm_draw { -+ drm_drawable_t handle; -+}; -+ -+/* -+ * DRM_IOCTL_UPDATE_DRAW ioctl argument type. -+ */ -+typedef enum { -+ DRM_DRAWABLE_CLIPRECTS -+} drm_drawable_info_type_t; -+ -+struct drm_update_draw { -+ drm_drawable_t handle; -+ unsigned int type; -+ unsigned int num; -+ unsigned long long data; -+}; -+ -+/* -+ * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type. -+ */ -+struct drm_auth { -+ drm_magic_t magic; -+}; -+ -+/* -+ * DRM_IOCTL_IRQ_BUSID ioctl argument type. -+ * -+ * \sa drmGetInterruptFromBusID(). -+ */ -+struct drm_irq_busid { -+ int irq; /**< IRQ number */ -+ int busnum; /**< bus number */ -+ int devnum; /**< device number */ -+ int funcnum; /**< function number */ -+}; -+ -+enum drm_vblank_seq_type { -+ _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ -+ _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ -+ /* bits 1-6 are reserved for high crtcs */ -+ _DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e, -+ _DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */ -+ _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ -+ _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ -+ _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ -+ _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking, unsupported */ -+}; -+#define _DRM_VBLANK_HIGH_CRTC_SHIFT 1 -+ -+#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE) -+#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \ -+ _DRM_VBLANK_SECONDARY | _DRM_VBLANK_NEXTONMISS) -+ -+struct drm_wait_vblank_request { -+ enum drm_vblank_seq_type type; -+ unsigned int sequence; -+ unsigned long signal; -+}; -+ -+struct drm_wait_vblank_reply { -+ enum drm_vblank_seq_type type; -+ unsigned int sequence; -+ long tval_sec; -+ long tval_usec; -+}; -+ -+/* -+ * DRM_IOCTL_WAIT_VBLANK ioctl argument type. -+ * -+ * \sa drmWaitVBlank(). -+ */ -+union drm_wait_vblank { -+ struct drm_wait_vblank_request request; -+ struct drm_wait_vblank_reply reply; -+}; -+ -+#define _DRM_PRE_MODESET 1 -+#define _DRM_POST_MODESET 2 -+ -+/* -+ * DRM_IOCTL_MODESET_CTL ioctl argument type -+ * -+ * \sa drmModesetCtl(). -+ */ -+struct drm_modeset_ctl { -+ __u32 crtc; -+ __u32 cmd; -+}; -+ -+/* -+ * DRM_IOCTL_AGP_ENABLE ioctl argument type. -+ * -+ * \sa drmAgpEnable(). -+ */ -+struct drm_agp_mode { -+ unsigned long mode; /**< AGP mode */ -+}; -+ -+/* -+ * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type. -+ * -+ * \sa drmAgpAlloc() and drmAgpFree(). -+ */ -+struct drm_agp_buffer { -+ unsigned long size; /**< In bytes -- will round to page boundary */ -+ unsigned long handle; /**< Used for binding / unbinding */ -+ unsigned long type; /**< Type of memory to allocate */ -+ unsigned long physical; /**< Physical used by i810 */ -+}; -+ -+/* -+ * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type. -+ * -+ * \sa drmAgpBind() and drmAgpUnbind(). -+ */ -+struct drm_agp_binding { -+ unsigned long handle; /**< From drm_agp_buffer */ -+ unsigned long offset; /**< In bytes -- will round to page boundary */ -+}; -+ -+/* -+ * DRM_IOCTL_AGP_INFO ioctl argument type. -+ * -+ * \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(), -+ * drmAgpBase(), drmAgpSize(), drmAgpMemoryUsed(), drmAgpMemoryAvail(), -+ * drmAgpVendorId() and drmAgpDeviceId(). -+ */ -+struct drm_agp_info { -+ int agp_version_major; -+ int agp_version_minor; -+ unsigned long mode; -+ unsigned long aperture_base; /* physical address */ -+ unsigned long aperture_size; /* bytes */ -+ unsigned long memory_allowed; /* bytes */ -+ unsigned long memory_used; -+ -+ /* PCI information */ -+ unsigned short id_vendor; -+ unsigned short id_device; -+}; -+ -+/* -+ * DRM_IOCTL_SG_ALLOC ioctl argument type. -+ */ -+struct drm_scatter_gather { -+ unsigned long size; /**< In bytes -- will round to page boundary */ -+ unsigned long handle; /**< Used for mapping / unmapping */ -+}; -+ -+/* -+ * DRM_IOCTL_SET_VERSION ioctl argument type. -+ */ -+struct drm_set_version { -+ int drm_di_major; -+ int drm_di_minor; -+ int drm_dd_major; -+ int drm_dd_minor; -+}; -+ -+/* DRM_IOCTL_GEM_CLOSE ioctl argument type */ -+struct drm_gem_close { -+ /** Handle of the object to be closed. */ -+ __u32 handle; -+ __u32 pad; -+}; -+ -+/* DRM_IOCTL_GEM_FLINK ioctl argument type */ -+struct drm_gem_flink { -+ /** Handle for the object being named */ -+ __u32 handle; -+ -+ /** Returned global name */ -+ __u32 name; -+}; -+ -+/* DRM_IOCTL_GEM_OPEN ioctl argument type */ -+struct drm_gem_open { -+ /** Name of object being opened */ -+ __u32 name; -+ -+ /** Returned handle for the object */ -+ __u32 handle; -+ -+ /** Returned size of the object */ -+ __u64 size; -+}; -+ -+/** -+ * DRM_CAP_DUMB_BUFFER -+ * -+ * If set to 1, the driver supports creating dumb buffers via the -+ * &DRM_IOCTL_MODE_CREATE_DUMB ioctl. -+ */ -+#define DRM_CAP_DUMB_BUFFER 0x1 -+/** -+ * DRM_CAP_VBLANK_HIGH_CRTC -+ * -+ * If set to 1, the kernel supports specifying a :ref:`CRTC index` -+ * in the high bits of &drm_wait_vblank_request.type. -+ * -+ * Starting kernel version 2.6.39, this capability is always set to 1. -+ */ -+#define DRM_CAP_VBLANK_HIGH_CRTC 0x2 -+/** -+ * DRM_CAP_DUMB_PREFERRED_DEPTH -+ * -+ * The preferred bit depth for dumb buffers. -+ * -+ * The bit depth is the number of bits used to indicate the color of a single -+ * pixel excluding any padding. This is different from the number of bits per -+ * pixel. For instance, XRGB8888 has a bit depth of 24 but has 32 bits per -+ * pixel. -+ * -+ * Note that this preference only applies to dumb buffers, it's irrelevant for -+ * other types of buffers. -+ */ -+#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3 -+/** -+ * DRM_CAP_DUMB_PREFER_SHADOW -+ * -+ * If set to 1, the driver prefers userspace to render to a shadow buffer -+ * instead of directly rendering to a dumb buffer. For best speed, userspace -+ * should do streaming ordered memory copies into the dumb buffer and never -+ * read from it. -+ * -+ * Note that this preference only applies to dumb buffers, it's irrelevant for -+ * other types of buffers. -+ */ -+#define DRM_CAP_DUMB_PREFER_SHADOW 0x4 -+/** -+ * DRM_CAP_PRIME -+ * -+ * Bitfield of supported PRIME sharing capabilities. See &DRM_PRIME_CAP_IMPORT -+ * and &DRM_PRIME_CAP_EXPORT. -+ * -+ * PRIME buffers are exposed as dma-buf file descriptors. See -+ * Documentation/gpu/drm-mm.rst, section "PRIME Buffer Sharing". -+ */ -+#define DRM_CAP_PRIME 0x5 -+/** -+ * DRM_PRIME_CAP_IMPORT -+ * -+ * If this bit is set in &DRM_CAP_PRIME, the driver supports importing PRIME -+ * buffers via the &DRM_IOCTL_PRIME_FD_TO_HANDLE ioctl. -+ */ -+#define DRM_PRIME_CAP_IMPORT 0x1 -+/** -+ * DRM_PRIME_CAP_EXPORT -+ * -+ * If this bit is set in &DRM_CAP_PRIME, the driver supports exporting PRIME -+ * buffers via the &DRM_IOCTL_PRIME_HANDLE_TO_FD ioctl. -+ */ -+#define DRM_PRIME_CAP_EXPORT 0x2 -+/** -+ * DRM_CAP_TIMESTAMP_MONOTONIC -+ * -+ * If set to 0, the kernel will report timestamps with ``CLOCK_REALTIME`` in -+ * struct drm_event_vblank. If set to 1, the kernel will report timestamps with -+ * ``CLOCK_MONOTONIC``. See ``clock_gettime(2)`` for the definition of these -+ * clocks. -+ * -+ * Starting from kernel version 2.6.39, the default value for this capability -+ * is 1. Starting kernel version 4.15, this capability is always set to 1. -+ */ -+#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 -+/** -+ * DRM_CAP_ASYNC_PAGE_FLIP -+ * -+ * If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC. -+ */ -+#define DRM_CAP_ASYNC_PAGE_FLIP 0x7 -+/** -+ * DRM_CAP_CURSOR_WIDTH -+ * -+ * The ``CURSOR_WIDTH`` and ``CURSOR_HEIGHT`` capabilities return a valid -+ * width x height combination for the hardware cursor. The intention is that a -+ * hardware agnostic userspace can query a cursor plane size to use. -+ * -+ * Note that the cross-driver contract is to merely return a valid size; -+ * drivers are free to attach another meaning on top, eg. i915 returns the -+ * maximum plane size. -+ */ -+#define DRM_CAP_CURSOR_WIDTH 0x8 -+/** -+ * DRM_CAP_CURSOR_HEIGHT -+ * -+ * See &DRM_CAP_CURSOR_WIDTH. -+ */ -+#define DRM_CAP_CURSOR_HEIGHT 0x9 -+/** -+ * DRM_CAP_ADDFB2_MODIFIERS -+ * -+ * If set to 1, the driver supports supplying modifiers in the -+ * &DRM_IOCTL_MODE_ADDFB2 ioctl. -+ */ -+#define DRM_CAP_ADDFB2_MODIFIERS 0x10 -+/** -+ * DRM_CAP_PAGE_FLIP_TARGET -+ * -+ * If set to 1, the driver supports the &DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE and -+ * &DRM_MODE_PAGE_FLIP_TARGET_RELATIVE flags in -+ * &drm_mode_crtc_page_flip_target.flags for the &DRM_IOCTL_MODE_PAGE_FLIP -+ * ioctl. -+ */ -+#define DRM_CAP_PAGE_FLIP_TARGET 0x11 -+/** -+ * DRM_CAP_CRTC_IN_VBLANK_EVENT -+ * -+ * If set to 1, the kernel supports reporting the CRTC ID in -+ * &drm_event_vblank.crtc_id for the &DRM_EVENT_VBLANK and -+ * &DRM_EVENT_FLIP_COMPLETE events. -+ * -+ * Starting kernel version 4.12, this capability is always set to 1. -+ */ -+#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12 -+/** -+ * DRM_CAP_SYNCOBJ -+ * -+ * If set to 1, the driver supports sync objects. See -+ * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects". -+ */ -+#define DRM_CAP_SYNCOBJ 0x13 -+/** -+ * DRM_CAP_SYNCOBJ_TIMELINE -+ * -+ * If set to 1, the driver supports timeline operations on sync objects. See -+ * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects". -+ */ -+#define DRM_CAP_SYNCOBJ_TIMELINE 0x14 -+ -+/* DRM_IOCTL_GET_CAP ioctl argument type */ -+struct drm_get_cap { -+ __u64 capability; -+ __u64 value; -+}; -+ -+/** -+ * DRM_CLIENT_CAP_STEREO_3D -+ * -+ * If set to 1, the DRM core will expose the stereo 3D capabilities of the -+ * monitor by advertising the supported 3D layouts in the flags of struct -+ * drm_mode_modeinfo. See ``DRM_MODE_FLAG_3D_*``. -+ * -+ * This capability is always supported for all drivers starting from kernel -+ * version 3.13. -+ */ -+#define DRM_CLIENT_CAP_STEREO_3D 1 -+ -+/** -+ * DRM_CLIENT_CAP_UNIVERSAL_PLANES -+ * -+ * If set to 1, the DRM core will expose all planes (overlay, primary, and -+ * cursor) to userspace. -+ * -+ * This capability has been introduced in kernel version 3.15. Starting from -+ * kernel version 3.17, this capability is always supported for all drivers. -+ */ -+#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2 -+ -+/** -+ * DRM_CLIENT_CAP_ATOMIC -+ * -+ * If set to 1, the DRM core will expose atomic properties to userspace. This -+ * implicitly enables &DRM_CLIENT_CAP_UNIVERSAL_PLANES and -+ * &DRM_CLIENT_CAP_ASPECT_RATIO. -+ * -+ * If the driver doesn't support atomic mode-setting, enabling this capability -+ * will fail with -EOPNOTSUPP. -+ * -+ * This capability has been introduced in kernel version 4.0. Starting from -+ * kernel version 4.2, this capability is always supported for atomic-capable -+ * drivers. -+ */ -+#define DRM_CLIENT_CAP_ATOMIC 3 -+ -+/** -+ * DRM_CLIENT_CAP_ASPECT_RATIO -+ * -+ * If set to 1, the DRM core will provide aspect ratio information in modes. -+ * See ``DRM_MODE_FLAG_PIC_AR_*``. -+ * -+ * This capability is always supported for all drivers starting from kernel -+ * version 4.18. -+ */ -+#define DRM_CLIENT_CAP_ASPECT_RATIO 4 -+ -+/** -+ * DRM_CLIENT_CAP_WRITEBACK_CONNECTORS -+ * -+ * If set to 1, the DRM core will expose special connectors to be used for -+ * writing back to memory the scene setup in the commit. The client must enable -+ * &DRM_CLIENT_CAP_ATOMIC first. -+ * -+ * This capability is always supported for atomic-capable drivers starting from -+ * kernel version 4.19. -+ */ -+#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5 -+ -+/* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ -+struct drm_set_client_cap { -+ __u64 capability; -+ __u64 value; -+}; -+ -+#define DRM_RDWR O_RDWR -+#define DRM_CLOEXEC O_CLOEXEC -+struct drm_prime_handle { -+ __u32 handle; -+ -+ /** Flags.. only applicable for handle->fd */ -+ __u32 flags; -+ -+ /** Returned dmabuf file descriptor */ -+ __s32 fd; -+}; -+ -+struct drm_syncobj_create { -+ __u32 handle; -+#define DRM_SYNCOBJ_CREATE_SIGNALED (1 << 0) -+ __u32 flags; -+}; -+ -+struct drm_syncobj_destroy { -+ __u32 handle; -+ __u32 pad; -+}; -+ -+#define DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE (1 << 0) -+#define DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_EXPORT_SYNC_FILE (1 << 0) -+struct drm_syncobj_handle { -+ __u32 handle; -+ __u32 flags; -+ -+ __s32 fd; -+ __u32 pad; -+}; -+ -+struct drm_syncobj_transfer { -+ __u32 src_handle; -+ __u32 dst_handle; -+ __u64 src_point; -+ __u64 dst_point; -+ __u32 flags; -+ __u32 pad; -+}; -+ -+#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0) -+#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1) -+#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE (1 << 2) /* wait for time point to become available */ -+struct drm_syncobj_wait { -+ __u64 handles; -+ /* absolute timeout */ -+ __s64 timeout_nsec; -+ __u32 count_handles; -+ __u32 flags; -+ __u32 first_signaled; /* only valid when not waiting all */ -+ __u32 pad; -+}; -+ -+struct drm_syncobj_timeline_wait { -+ __u64 handles; -+ /* wait on specific timeline point for every handles*/ -+ __u64 points; -+ /* absolute timeout */ -+ __s64 timeout_nsec; -+ __u32 count_handles; -+ __u32 flags; -+ __u32 first_signaled; /* only valid when not waiting all */ -+ __u32 pad; -+}; -+ -+ -+struct drm_syncobj_array { -+ __u64 handles; -+ __u32 count_handles; -+ __u32 pad; -+}; -+ -+#define DRM_SYNCOBJ_QUERY_FLAGS_LAST_SUBMITTED (1 << 0) /* last available point on timeline syncobj */ -+struct drm_syncobj_timeline_array { -+ __u64 handles; -+ __u64 points; -+ __u32 count_handles; -+ __u32 flags; -+}; -+ -+ -+/* Query current scanout sequence number */ -+struct drm_crtc_get_sequence { -+ __u32 crtc_id; /* requested crtc_id */ -+ __u32 active; /* return: crtc output is active */ -+ __u64 sequence; /* return: most recent vblank sequence */ -+ __s64 sequence_ns; /* return: most recent time of first pixel out */ -+}; -+ -+/* Queue event to be delivered at specified sequence. Time stamp marks -+ * when the first pixel of the refresh cycle leaves the display engine -+ * for the display -+ */ -+#define DRM_CRTC_SEQUENCE_RELATIVE 0x00000001 /* sequence is relative to current */ -+#define DRM_CRTC_SEQUENCE_NEXT_ON_MISS 0x00000002 /* Use next sequence if we've missed */ -+ -+struct drm_crtc_queue_sequence { -+ __u32 crtc_id; -+ __u32 flags; -+ __u64 sequence; /* on input, target sequence. on output, actual sequence */ -+ __u64 user_data; /* user data passed to event */ -+}; -+ -+#if defined(__cplusplus) -+} -+#endif -+ -+#include "drm_mode.h" -+ -+#if defined(__cplusplus) -+extern "C" { -+#endif -+ -+#define DRM_IOCTL_BASE 'd' -+#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr) -+#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type) -+#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type) -+#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type) -+ -+#define DRM_IOCTL_VERSION DRM_IOWR(0x00, struct drm_version) -+#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, struct drm_unique) -+#define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, struct drm_auth) -+#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, struct drm_irq_busid) -+#define DRM_IOCTL_GET_MAP DRM_IOWR(0x04, struct drm_map) -+#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client) -+#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats) -+#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version) -+#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl) -+#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close) -+#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink) -+#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open) -+#define DRM_IOCTL_GET_CAP DRM_IOWR(0x0c, struct drm_get_cap) -+#define DRM_IOCTL_SET_CLIENT_CAP DRM_IOW( 0x0d, struct drm_set_client_cap) -+ -+#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique) -+#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth) -+#define DRM_IOCTL_BLOCK DRM_IOWR(0x12, struct drm_block) -+#define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, struct drm_block) -+#define DRM_IOCTL_CONTROL DRM_IOW( 0x14, struct drm_control) -+#define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, struct drm_map) -+#define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, struct drm_buf_desc) -+#define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, struct drm_buf_desc) -+#define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, struct drm_buf_info) -+#define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, struct drm_buf_map) -+#define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, struct drm_buf_free) -+ -+#define DRM_IOCTL_RM_MAP DRM_IOW( 0x1b, struct drm_map) -+ -+#define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, struct drm_ctx_priv_map) -+#define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, struct drm_ctx_priv_map) -+ -+#define DRM_IOCTL_SET_MASTER DRM_IO(0x1e) -+#define DRM_IOCTL_DROP_MASTER DRM_IO(0x1f) -+ -+#define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, struct drm_ctx) -+#define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, struct drm_ctx) -+#define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, struct drm_ctx) -+#define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, struct drm_ctx) -+#define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, struct drm_ctx) -+#define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, struct drm_ctx) -+#define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, struct drm_ctx_res) -+#define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, struct drm_draw) -+#define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, struct drm_draw) -+#define DRM_IOCTL_DMA DRM_IOWR(0x29, struct drm_dma) -+#define DRM_IOCTL_LOCK DRM_IOW( 0x2a, struct drm_lock) -+#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock) -+#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock) -+ -+#define DRM_IOCTL_PRIME_HANDLE_TO_FD DRM_IOWR(0x2d, struct drm_prime_handle) -+#define DRM_IOCTL_PRIME_FD_TO_HANDLE DRM_IOWR(0x2e, struct drm_prime_handle) -+ -+#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30) -+#define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31) -+#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode) -+#define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, struct drm_agp_info) -+#define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, struct drm_agp_buffer) -+#define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, struct drm_agp_buffer) -+#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding) -+#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding) -+ -+#define DRM_IOCTL_SG_ALLOC DRM_IOWR(0x38, struct drm_scatter_gather) -+#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather) -+ -+#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank) -+ -+#define DRM_IOCTL_CRTC_GET_SEQUENCE DRM_IOWR(0x3b, struct drm_crtc_get_sequence) -+#define DRM_IOCTL_CRTC_QUEUE_SEQUENCE DRM_IOWR(0x3c, struct drm_crtc_queue_sequence) -+ -+#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw) -+ -+#define DRM_IOCTL_MODE_GETRESOURCES DRM_IOWR(0xA0, struct drm_mode_card_res) -+#define DRM_IOCTL_MODE_GETCRTC DRM_IOWR(0xA1, struct drm_mode_crtc) -+#define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA2, struct drm_mode_crtc) -+#define DRM_IOCTL_MODE_CURSOR DRM_IOWR(0xA3, struct drm_mode_cursor) -+#define DRM_IOCTL_MODE_GETGAMMA DRM_IOWR(0xA4, struct drm_mode_crtc_lut) -+#define DRM_IOCTL_MODE_SETGAMMA DRM_IOWR(0xA5, struct drm_mode_crtc_lut) -+#define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xA6, struct drm_mode_get_encoder) -+#define DRM_IOCTL_MODE_GETCONNECTOR DRM_IOWR(0xA7, struct drm_mode_get_connector) -+#define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA8, struct drm_mode_mode_cmd) /* deprecated (never worked) */ -+#define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd) /* deprecated (never worked) */ -+ -+#define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAA, struct drm_mode_get_property) -+#define DRM_IOCTL_MODE_SETPROPERTY DRM_IOWR(0xAB, struct drm_mode_connector_set_property) -+#define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, struct drm_mode_get_blob) -+#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd) -+#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd) -+/** -+ * DRM_IOCTL_MODE_RMFB - Remove a framebuffer. -+ * -+ * This removes a framebuffer previously added via ADDFB/ADDFB2. The IOCTL -+ * argument is a framebuffer object ID. -+ * -+ * Warning: removing a framebuffer currently in-use on an enabled plane will -+ * disable that plane. The CRTC the plane is linked to may also be disabled -+ * (depending on driver capabilities). -+ */ -+#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int) -+#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip) -+#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd) -+ -+#define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb) -+#define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, struct drm_mode_map_dumb) -+#define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, struct drm_mode_destroy_dumb) -+#define DRM_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xB5, struct drm_mode_get_plane_res) -+#define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane) -+#define DRM_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct drm_mode_set_plane) -+#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2) -+#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties) -+#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property) -+#define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2) -+#define DRM_IOCTL_MODE_ATOMIC DRM_IOWR(0xBC, struct drm_mode_atomic) -+#define DRM_IOCTL_MODE_CREATEPROPBLOB DRM_IOWR(0xBD, struct drm_mode_create_blob) -+#define DRM_IOCTL_MODE_DESTROYPROPBLOB DRM_IOWR(0xBE, struct drm_mode_destroy_blob) -+ -+#define DRM_IOCTL_SYNCOBJ_CREATE DRM_IOWR(0xBF, struct drm_syncobj_create) -+#define DRM_IOCTL_SYNCOBJ_DESTROY DRM_IOWR(0xC0, struct drm_syncobj_destroy) -+#define DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD DRM_IOWR(0xC1, struct drm_syncobj_handle) -+#define DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE DRM_IOWR(0xC2, struct drm_syncobj_handle) -+#define DRM_IOCTL_SYNCOBJ_WAIT DRM_IOWR(0xC3, struct drm_syncobj_wait) -+#define DRM_IOCTL_SYNCOBJ_RESET DRM_IOWR(0xC4, struct drm_syncobj_array) -+#define DRM_IOCTL_SYNCOBJ_SIGNAL DRM_IOWR(0xC5, struct drm_syncobj_array) -+ -+#define DRM_IOCTL_MODE_CREATE_LEASE DRM_IOWR(0xC6, struct drm_mode_create_lease) -+#define DRM_IOCTL_MODE_LIST_LESSEES DRM_IOWR(0xC7, struct drm_mode_list_lessees) -+#define DRM_IOCTL_MODE_GET_LEASE DRM_IOWR(0xC8, struct drm_mode_get_lease) -+#define DRM_IOCTL_MODE_REVOKE_LEASE DRM_IOWR(0xC9, struct drm_mode_revoke_lease) -+ -+#define DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT DRM_IOWR(0xCA, struct drm_syncobj_timeline_wait) -+#define DRM_IOCTL_SYNCOBJ_QUERY DRM_IOWR(0xCB, struct drm_syncobj_timeline_array) -+#define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer) -+#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct drm_syncobj_timeline_array) -+ -+#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2) -+ -+/* -+ * Device specific ioctls should only be in their respective headers -+ * The device specific ioctl range is from 0x40 to 0x9f. -+ * Generic IOCTLS restart at 0xA0. -+ * -+ * \sa drmCommandNone(), drmCommandRead(), drmCommandWrite(), and -+ * drmCommandReadWrite(). -+ */ -+#define DRM_COMMAND_BASE 0x40 -+#define DRM_COMMAND_END 0xA0 -+ -+/* -+ * Header for events written back to userspace on the drm fd. The -+ * type defines the type of event, the length specifies the total -+ * length of the event (including the header), and user_data is -+ * typically a 64 bit value passed with the ioctl that triggered the -+ * event. A read on the drm fd will always only return complete -+ * events, that is, if for example the read buffer is 100 bytes, and -+ * there are two 64 byte events pending, only one will be returned. -+ * -+ * Event types 0 - 0x7fffffff are generic drm events, 0x80000000 and -+ * up are chipset specific. -+ */ -+struct drm_event { -+ __u32 type; -+ __u32 length; -+}; -+ -+#define DRM_EVENT_VBLANK 0x01 -+#define DRM_EVENT_FLIP_COMPLETE 0x02 -+#define DRM_EVENT_CRTC_SEQUENCE 0x03 -+ -+struct drm_event_vblank { -+ struct drm_event base; -+ __u64 user_data; -+ __u32 tv_sec; -+ __u32 tv_usec; -+ __u32 sequence; -+ __u32 crtc_id; /* 0 on older kernels that do not support this */ -+}; -+ -+/* Event delivered at sequence. Time stamp marks when the first pixel -+ * of the refresh cycle leaves the display engine for the display -+ */ -+struct drm_event_crtc_sequence { -+ struct drm_event base; -+ __u64 user_data; -+ __s64 time_ns; -+ __u64 sequence; -+}; -+ -+/* typedef area */ -+typedef struct drm_clip_rect drm_clip_rect_t; -+typedef struct drm_drawable_info drm_drawable_info_t; -+typedef struct drm_tex_region drm_tex_region_t; -+typedef struct drm_hw_lock drm_hw_lock_t; -+typedef struct drm_version drm_version_t; -+typedef struct drm_unique drm_unique_t; -+typedef struct drm_list drm_list_t; -+typedef struct drm_block drm_block_t; -+typedef struct drm_control drm_control_t; -+typedef enum drm_map_type drm_map_type_t; -+typedef enum drm_map_flags drm_map_flags_t; -+typedef struct drm_ctx_priv_map drm_ctx_priv_map_t; -+typedef struct drm_map drm_map_t; -+typedef struct drm_client drm_client_t; -+typedef enum drm_stat_type drm_stat_type_t; -+typedef struct drm_stats drm_stats_t; -+typedef enum drm_lock_flags drm_lock_flags_t; -+typedef struct drm_lock drm_lock_t; -+typedef enum drm_dma_flags drm_dma_flags_t; -+typedef struct drm_buf_desc drm_buf_desc_t; -+typedef struct drm_buf_info drm_buf_info_t; -+typedef struct drm_buf_free drm_buf_free_t; -+typedef struct drm_buf_pub drm_buf_pub_t; -+typedef struct drm_buf_map drm_buf_map_t; -+typedef struct drm_dma drm_dma_t; -+typedef union drm_wait_vblank drm_wait_vblank_t; -+typedef struct drm_agp_mode drm_agp_mode_t; -+typedef enum drm_ctx_flags drm_ctx_flags_t; -+typedef struct drm_ctx drm_ctx_t; -+typedef struct drm_ctx_res drm_ctx_res_t; -+typedef struct drm_draw drm_draw_t; -+typedef struct drm_update_draw drm_update_draw_t; -+typedef struct drm_auth drm_auth_t; -+typedef struct drm_irq_busid drm_irq_busid_t; -+typedef enum drm_vblank_seq_type drm_vblank_seq_type_t; -+ -+typedef struct drm_agp_buffer drm_agp_buffer_t; -+typedef struct drm_agp_binding drm_agp_binding_t; -+typedef struct drm_agp_info drm_agp_info_t; -+typedef struct drm_scatter_gather drm_scatter_gather_t; -+typedef struct drm_set_version drm_set_version_t; -+ -+#if defined(__cplusplus) -+} -+#endif -+ -+#endif -diff --git a/third_party/drm/drm/drm_fourcc.h b/third_party/drm/drm/drm_fourcc.h -new file mode 100644 -index 0000000..4ececa8 ---- /dev/null -+++ b/third_party/drm/drm/drm_fourcc.h +diff -up firefox-101.0/third_party/drm/drm/drm_fourcc.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/drm/drm/drm_fourcc.h +--- firefox-101.0/third_party/drm/drm/drm_fourcc.h.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.741522076 +0200 ++++ firefox-101.0/third_party/drm/drm/drm_fourcc.h 2022-05-30 21:33:19.741522076 +0200 @@ -0,0 +1,1377 @@ +/* + * Copyright 2011 Intel Corporation @@ -2609,11 +1391,1206 @@ index 0000000..4ececa8 +#endif + +#endif /* DRM_FOURCC_H */ -diff --git a/third_party/drm/drm/drm_mode.h b/third_party/drm/drm/drm_mode.h -new file mode 100644 -index 0000000..e1e3516 ---- /dev/null -+++ b/third_party/drm/drm/drm_mode.h +diff -up firefox-101.0/third_party/drm/drm/drm.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/drm/drm/drm.h +--- firefox-101.0/third_party/drm/drm/drm.h.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.741522076 +0200 ++++ firefox-101.0/third_party/drm/drm/drm.h 2022-05-30 21:33:19.741522076 +0200 +@@ -0,0 +1,1193 @@ ++/* ++ * Header for the Direct Rendering Manager ++ * ++ * Author: Rickard E. (Rik) Faith ++ * ++ * Acknowledgments: ++ * Dec 1999, Richard Henderson , move to generic cmpxchg. ++ */ ++ ++/* ++ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. ++ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. ++ * All rights reserved. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++#ifndef _DRM_H_ ++#define _DRM_H_ ++ ++#if defined(__linux__) ++ ++#include ++#include ++typedef unsigned int drm_handle_t; ++ ++#else /* One of the BSDs */ ++ ++#include ++#include ++#include ++typedef int8_t __s8; ++typedef uint8_t __u8; ++typedef int16_t __s16; ++typedef uint16_t __u16; ++typedef int32_t __s32; ++typedef uint32_t __u32; ++typedef int64_t __s64; ++typedef uint64_t __u64; ++typedef size_t __kernel_size_t; ++typedef unsigned long drm_handle_t; ++ ++#endif ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */ ++#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */ ++#define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */ ++#define DRM_RAM_PERCENT 10 /**< How much system ram can we lock? */ ++ ++#define _DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */ ++#define _DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */ ++#define _DRM_LOCK_IS_HELD(lock) ((lock) & _DRM_LOCK_HELD) ++#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT) ++#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) ++ ++typedef unsigned int drm_context_t; ++typedef unsigned int drm_drawable_t; ++typedef unsigned int drm_magic_t; ++ ++/* ++ * Cliprect. ++ * ++ * \warning: If you change this structure, make sure you change ++ * XF86DRIClipRectRec in the server as well ++ * ++ * \note KW: Actually it's illegal to change either for ++ * backwards-compatibility reasons. ++ */ ++struct drm_clip_rect { ++ unsigned short x1; ++ unsigned short y1; ++ unsigned short x2; ++ unsigned short y2; ++}; ++ ++/* ++ * Drawable information. ++ */ ++struct drm_drawable_info { ++ unsigned int num_rects; ++ struct drm_clip_rect *rects; ++}; ++ ++/* ++ * Texture region, ++ */ ++struct drm_tex_region { ++ unsigned char next; ++ unsigned char prev; ++ unsigned char in_use; ++ unsigned char padding; ++ unsigned int age; ++}; ++ ++/* ++ * Hardware lock. ++ * ++ * The lock structure is a simple cache-line aligned integer. To avoid ++ * processor bus contention on a multiprocessor system, there should not be any ++ * other data stored in the same cache line. ++ */ ++struct drm_hw_lock { ++ __volatile__ unsigned int lock; /**< lock variable */ ++ char padding[60]; /**< Pad to cache line */ ++}; ++ ++/* ++ * DRM_IOCTL_VERSION ioctl argument type. ++ * ++ * \sa drmGetVersion(). ++ */ ++struct drm_version { ++ int version_major; /**< Major version */ ++ int version_minor; /**< Minor version */ ++ int version_patchlevel; /**< Patch level */ ++ __kernel_size_t name_len; /**< Length of name buffer */ ++ char *name; /**< Name of driver */ ++ __kernel_size_t date_len; /**< Length of date buffer */ ++ char *date; /**< User-space buffer to hold date */ ++ __kernel_size_t desc_len; /**< Length of desc buffer */ ++ char *desc; /**< User-space buffer to hold desc */ ++}; ++ ++/* ++ * DRM_IOCTL_GET_UNIQUE ioctl argument type. ++ * ++ * \sa drmGetBusid() and drmSetBusId(). ++ */ ++struct drm_unique { ++ __kernel_size_t unique_len; /**< Length of unique */ ++ char *unique; /**< Unique name for driver instantiation */ ++}; ++ ++struct drm_list { ++ int count; /**< Length of user-space structures */ ++ struct drm_version *version; ++}; ++ ++struct drm_block { ++ int unused; ++}; ++ ++/* ++ * DRM_IOCTL_CONTROL ioctl argument type. ++ * ++ * \sa drmCtlInstHandler() and drmCtlUninstHandler(). ++ */ ++struct drm_control { ++ enum { ++ DRM_ADD_COMMAND, ++ DRM_RM_COMMAND, ++ DRM_INST_HANDLER, ++ DRM_UNINST_HANDLER ++ } func; ++ int irq; ++}; ++ ++/* ++ * Type of memory to map. ++ */ ++enum drm_map_type { ++ _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */ ++ _DRM_REGISTERS = 1, /**< no caching, no core dump */ ++ _DRM_SHM = 2, /**< shared, cached */ ++ _DRM_AGP = 3, /**< AGP/GART */ ++ _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */ ++ _DRM_CONSISTENT = 5 /**< Consistent memory for PCI DMA */ ++}; ++ ++/* ++ * Memory mapping flags. ++ */ ++enum drm_map_flags { ++ _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */ ++ _DRM_READ_ONLY = 0x02, ++ _DRM_LOCKED = 0x04, /**< shared, cached, locked */ ++ _DRM_KERNEL = 0x08, /**< kernel requires access */ ++ _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */ ++ _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */ ++ _DRM_REMOVABLE = 0x40, /**< Removable mapping */ ++ _DRM_DRIVER = 0x80 /**< Managed by driver */ ++}; ++ ++struct drm_ctx_priv_map { ++ unsigned int ctx_id; /**< Context requesting private mapping */ ++ void *handle; /**< Handle of map */ ++}; ++ ++/* ++ * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls ++ * argument type. ++ * ++ * \sa drmAddMap(). ++ */ ++struct drm_map { ++ unsigned long offset; /**< Requested physical address (0 for SAREA)*/ ++ unsigned long size; /**< Requested physical size (bytes) */ ++ enum drm_map_type type; /**< Type of memory to map */ ++ enum drm_map_flags flags; /**< Flags */ ++ void *handle; /**< User-space: "Handle" to pass to mmap() */ ++ /**< Kernel-space: kernel-virtual address */ ++ int mtrr; /**< MTRR slot used */ ++ /* Private data */ ++}; ++ ++/* ++ * DRM_IOCTL_GET_CLIENT ioctl argument type. ++ */ ++struct drm_client { ++ int idx; /**< Which client desired? */ ++ int auth; /**< Is client authenticated? */ ++ unsigned long pid; /**< Process ID */ ++ unsigned long uid; /**< User ID */ ++ unsigned long magic; /**< Magic */ ++ unsigned long iocs; /**< Ioctl count */ ++}; ++ ++enum drm_stat_type { ++ _DRM_STAT_LOCK, ++ _DRM_STAT_OPENS, ++ _DRM_STAT_CLOSES, ++ _DRM_STAT_IOCTLS, ++ _DRM_STAT_LOCKS, ++ _DRM_STAT_UNLOCKS, ++ _DRM_STAT_VALUE, /**< Generic value */ ++ _DRM_STAT_BYTE, /**< Generic byte counter (1024bytes/K) */ ++ _DRM_STAT_COUNT, /**< Generic non-byte counter (1000/k) */ ++ ++ _DRM_STAT_IRQ, /**< IRQ */ ++ _DRM_STAT_PRIMARY, /**< Primary DMA bytes */ ++ _DRM_STAT_SECONDARY, /**< Secondary DMA bytes */ ++ _DRM_STAT_DMA, /**< DMA */ ++ _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */ ++ _DRM_STAT_MISSED /**< Missed DMA opportunity */ ++ /* Add to the *END* of the list */ ++}; ++ ++/* ++ * DRM_IOCTL_GET_STATS ioctl argument type. ++ */ ++struct drm_stats { ++ unsigned long count; ++ struct { ++ unsigned long value; ++ enum drm_stat_type type; ++ } data[15]; ++}; ++ ++/* ++ * Hardware locking flags. ++ */ ++enum drm_lock_flags { ++ _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */ ++ _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */ ++ _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */ ++ _DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */ ++ /* These *HALT* flags aren't supported yet ++ -- they will be used to support the ++ full-screen DGA-like mode. */ ++ _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */ ++ _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ ++}; ++ ++/* ++ * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type. ++ * ++ * \sa drmGetLock() and drmUnlock(). ++ */ ++struct drm_lock { ++ int context; ++ enum drm_lock_flags flags; ++}; ++ ++/* ++ * DMA flags ++ * ++ * \warning ++ * These values \e must match xf86drm.h. ++ * ++ * \sa drm_dma. ++ */ ++enum drm_dma_flags { ++ /* Flags for DMA buffer dispatch */ ++ _DRM_DMA_BLOCK = 0x01, /**< ++ * Block until buffer dispatched. ++ * ++ * \note The buffer may not yet have ++ * been processed by the hardware -- ++ * getting a hardware lock with the ++ * hardware quiescent will ensure ++ * that the buffer has been ++ * processed. ++ */ ++ _DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */ ++ _DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */ ++ ++ /* Flags for DMA buffer request */ ++ _DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */ ++ _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */ ++ _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ ++}; ++ ++/* ++ * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type. ++ * ++ * \sa drmAddBufs(). ++ */ ++struct drm_buf_desc { ++ int count; /**< Number of buffers of this size */ ++ int size; /**< Size in bytes */ ++ int low_mark; /**< Low water mark */ ++ int high_mark; /**< High water mark */ ++ enum { ++ _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */ ++ _DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */ ++ _DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */ ++ _DRM_FB_BUFFER = 0x08, /**< Buffer is in frame buffer */ ++ _DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */ ++ } flags; ++ unsigned long agp_start; /**< ++ * Start address of where the AGP buffers are ++ * in the AGP aperture ++ */ ++}; ++ ++/* ++ * DRM_IOCTL_INFO_BUFS ioctl argument type. ++ */ ++struct drm_buf_info { ++ int count; /**< Entries in list */ ++ struct drm_buf_desc *list; ++}; ++ ++/* ++ * DRM_IOCTL_FREE_BUFS ioctl argument type. ++ */ ++struct drm_buf_free { ++ int count; ++ int *list; ++}; ++ ++/* ++ * Buffer information ++ * ++ * \sa drm_buf_map. ++ */ ++struct drm_buf_pub { ++ int idx; /**< Index into the master buffer list */ ++ int total; /**< Buffer size */ ++ int used; /**< Amount of buffer in use (for DMA) */ ++ void *address; /**< Address of buffer */ ++}; ++ ++/* ++ * DRM_IOCTL_MAP_BUFS ioctl argument type. ++ */ ++struct drm_buf_map { ++ int count; /**< Length of the buffer list */ ++#ifdef __cplusplus ++ void *virt; ++#else ++ void *virtual; /**< Mmap'd area in user-virtual */ ++#endif ++ struct drm_buf_pub *list; /**< Buffer information */ ++}; ++ ++/* ++ * DRM_IOCTL_DMA ioctl argument type. ++ * ++ * Indices here refer to the offset into the buffer list in drm_buf_get. ++ * ++ * \sa drmDMA(). ++ */ ++struct drm_dma { ++ int context; /**< Context handle */ ++ int send_count; /**< Number of buffers to send */ ++ int *send_indices; /**< List of handles to buffers */ ++ int *send_sizes; /**< Lengths of data to send */ ++ enum drm_dma_flags flags; /**< Flags */ ++ int request_count; /**< Number of buffers requested */ ++ int request_size; /**< Desired size for buffers */ ++ int *request_indices; /**< Buffer information */ ++ int *request_sizes; ++ int granted_count; /**< Number of buffers granted */ ++}; ++ ++enum drm_ctx_flags { ++ _DRM_CONTEXT_PRESERVED = 0x01, ++ _DRM_CONTEXT_2DONLY = 0x02 ++}; ++ ++/* ++ * DRM_IOCTL_ADD_CTX ioctl argument type. ++ * ++ * \sa drmCreateContext() and drmDestroyContext(). ++ */ ++struct drm_ctx { ++ drm_context_t handle; ++ enum drm_ctx_flags flags; ++}; ++ ++/* ++ * DRM_IOCTL_RES_CTX ioctl argument type. ++ */ ++struct drm_ctx_res { ++ int count; ++ struct drm_ctx *contexts; ++}; ++ ++/* ++ * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type. ++ */ ++struct drm_draw { ++ drm_drawable_t handle; ++}; ++ ++/* ++ * DRM_IOCTL_UPDATE_DRAW ioctl argument type. ++ */ ++typedef enum { ++ DRM_DRAWABLE_CLIPRECTS ++} drm_drawable_info_type_t; ++ ++struct drm_update_draw { ++ drm_drawable_t handle; ++ unsigned int type; ++ unsigned int num; ++ unsigned long long data; ++}; ++ ++/* ++ * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type. ++ */ ++struct drm_auth { ++ drm_magic_t magic; ++}; ++ ++/* ++ * DRM_IOCTL_IRQ_BUSID ioctl argument type. ++ * ++ * \sa drmGetInterruptFromBusID(). ++ */ ++struct drm_irq_busid { ++ int irq; /**< IRQ number */ ++ int busnum; /**< bus number */ ++ int devnum; /**< device number */ ++ int funcnum; /**< function number */ ++}; ++ ++enum drm_vblank_seq_type { ++ _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ ++ _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ ++ /* bits 1-6 are reserved for high crtcs */ ++ _DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e, ++ _DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */ ++ _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ ++ _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ ++ _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ ++ _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking, unsupported */ ++}; ++#define _DRM_VBLANK_HIGH_CRTC_SHIFT 1 ++ ++#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE) ++#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \ ++ _DRM_VBLANK_SECONDARY | _DRM_VBLANK_NEXTONMISS) ++ ++struct drm_wait_vblank_request { ++ enum drm_vblank_seq_type type; ++ unsigned int sequence; ++ unsigned long signal; ++}; ++ ++struct drm_wait_vblank_reply { ++ enum drm_vblank_seq_type type; ++ unsigned int sequence; ++ long tval_sec; ++ long tval_usec; ++}; ++ ++/* ++ * DRM_IOCTL_WAIT_VBLANK ioctl argument type. ++ * ++ * \sa drmWaitVBlank(). ++ */ ++union drm_wait_vblank { ++ struct drm_wait_vblank_request request; ++ struct drm_wait_vblank_reply reply; ++}; ++ ++#define _DRM_PRE_MODESET 1 ++#define _DRM_POST_MODESET 2 ++ ++/* ++ * DRM_IOCTL_MODESET_CTL ioctl argument type ++ * ++ * \sa drmModesetCtl(). ++ */ ++struct drm_modeset_ctl { ++ __u32 crtc; ++ __u32 cmd; ++}; ++ ++/* ++ * DRM_IOCTL_AGP_ENABLE ioctl argument type. ++ * ++ * \sa drmAgpEnable(). ++ */ ++struct drm_agp_mode { ++ unsigned long mode; /**< AGP mode */ ++}; ++ ++/* ++ * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type. ++ * ++ * \sa drmAgpAlloc() and drmAgpFree(). ++ */ ++struct drm_agp_buffer { ++ unsigned long size; /**< In bytes -- will round to page boundary */ ++ unsigned long handle; /**< Used for binding / unbinding */ ++ unsigned long type; /**< Type of memory to allocate */ ++ unsigned long physical; /**< Physical used by i810 */ ++}; ++ ++/* ++ * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type. ++ * ++ * \sa drmAgpBind() and drmAgpUnbind(). ++ */ ++struct drm_agp_binding { ++ unsigned long handle; /**< From drm_agp_buffer */ ++ unsigned long offset; /**< In bytes -- will round to page boundary */ ++}; ++ ++/* ++ * DRM_IOCTL_AGP_INFO ioctl argument type. ++ * ++ * \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(), ++ * drmAgpBase(), drmAgpSize(), drmAgpMemoryUsed(), drmAgpMemoryAvail(), ++ * drmAgpVendorId() and drmAgpDeviceId(). ++ */ ++struct drm_agp_info { ++ int agp_version_major; ++ int agp_version_minor; ++ unsigned long mode; ++ unsigned long aperture_base; /* physical address */ ++ unsigned long aperture_size; /* bytes */ ++ unsigned long memory_allowed; /* bytes */ ++ unsigned long memory_used; ++ ++ /* PCI information */ ++ unsigned short id_vendor; ++ unsigned short id_device; ++}; ++ ++/* ++ * DRM_IOCTL_SG_ALLOC ioctl argument type. ++ */ ++struct drm_scatter_gather { ++ unsigned long size; /**< In bytes -- will round to page boundary */ ++ unsigned long handle; /**< Used for mapping / unmapping */ ++}; ++ ++/* ++ * DRM_IOCTL_SET_VERSION ioctl argument type. ++ */ ++struct drm_set_version { ++ int drm_di_major; ++ int drm_di_minor; ++ int drm_dd_major; ++ int drm_dd_minor; ++}; ++ ++/* DRM_IOCTL_GEM_CLOSE ioctl argument type */ ++struct drm_gem_close { ++ /** Handle of the object to be closed. */ ++ __u32 handle; ++ __u32 pad; ++}; ++ ++/* DRM_IOCTL_GEM_FLINK ioctl argument type */ ++struct drm_gem_flink { ++ /** Handle for the object being named */ ++ __u32 handle; ++ ++ /** Returned global name */ ++ __u32 name; ++}; ++ ++/* DRM_IOCTL_GEM_OPEN ioctl argument type */ ++struct drm_gem_open { ++ /** Name of object being opened */ ++ __u32 name; ++ ++ /** Returned handle for the object */ ++ __u32 handle; ++ ++ /** Returned size of the object */ ++ __u64 size; ++}; ++ ++/** ++ * DRM_CAP_DUMB_BUFFER ++ * ++ * If set to 1, the driver supports creating dumb buffers via the ++ * &DRM_IOCTL_MODE_CREATE_DUMB ioctl. ++ */ ++#define DRM_CAP_DUMB_BUFFER 0x1 ++/** ++ * DRM_CAP_VBLANK_HIGH_CRTC ++ * ++ * If set to 1, the kernel supports specifying a :ref:`CRTC index` ++ * in the high bits of &drm_wait_vblank_request.type. ++ * ++ * Starting kernel version 2.6.39, this capability is always set to 1. ++ */ ++#define DRM_CAP_VBLANK_HIGH_CRTC 0x2 ++/** ++ * DRM_CAP_DUMB_PREFERRED_DEPTH ++ * ++ * The preferred bit depth for dumb buffers. ++ * ++ * The bit depth is the number of bits used to indicate the color of a single ++ * pixel excluding any padding. This is different from the number of bits per ++ * pixel. For instance, XRGB8888 has a bit depth of 24 but has 32 bits per ++ * pixel. ++ * ++ * Note that this preference only applies to dumb buffers, it's irrelevant for ++ * other types of buffers. ++ */ ++#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3 ++/** ++ * DRM_CAP_DUMB_PREFER_SHADOW ++ * ++ * If set to 1, the driver prefers userspace to render to a shadow buffer ++ * instead of directly rendering to a dumb buffer. For best speed, userspace ++ * should do streaming ordered memory copies into the dumb buffer and never ++ * read from it. ++ * ++ * Note that this preference only applies to dumb buffers, it's irrelevant for ++ * other types of buffers. ++ */ ++#define DRM_CAP_DUMB_PREFER_SHADOW 0x4 ++/** ++ * DRM_CAP_PRIME ++ * ++ * Bitfield of supported PRIME sharing capabilities. See &DRM_PRIME_CAP_IMPORT ++ * and &DRM_PRIME_CAP_EXPORT. ++ * ++ * PRIME buffers are exposed as dma-buf file descriptors. See ++ * Documentation/gpu/drm-mm.rst, section "PRIME Buffer Sharing". ++ */ ++#define DRM_CAP_PRIME 0x5 ++/** ++ * DRM_PRIME_CAP_IMPORT ++ * ++ * If this bit is set in &DRM_CAP_PRIME, the driver supports importing PRIME ++ * buffers via the &DRM_IOCTL_PRIME_FD_TO_HANDLE ioctl. ++ */ ++#define DRM_PRIME_CAP_IMPORT 0x1 ++/** ++ * DRM_PRIME_CAP_EXPORT ++ * ++ * If this bit is set in &DRM_CAP_PRIME, the driver supports exporting PRIME ++ * buffers via the &DRM_IOCTL_PRIME_HANDLE_TO_FD ioctl. ++ */ ++#define DRM_PRIME_CAP_EXPORT 0x2 ++/** ++ * DRM_CAP_TIMESTAMP_MONOTONIC ++ * ++ * If set to 0, the kernel will report timestamps with ``CLOCK_REALTIME`` in ++ * struct drm_event_vblank. If set to 1, the kernel will report timestamps with ++ * ``CLOCK_MONOTONIC``. See ``clock_gettime(2)`` for the definition of these ++ * clocks. ++ * ++ * Starting from kernel version 2.6.39, the default value for this capability ++ * is 1. Starting kernel version 4.15, this capability is always set to 1. ++ */ ++#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 ++/** ++ * DRM_CAP_ASYNC_PAGE_FLIP ++ * ++ * If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC. ++ */ ++#define DRM_CAP_ASYNC_PAGE_FLIP 0x7 ++/** ++ * DRM_CAP_CURSOR_WIDTH ++ * ++ * The ``CURSOR_WIDTH`` and ``CURSOR_HEIGHT`` capabilities return a valid ++ * width x height combination for the hardware cursor. The intention is that a ++ * hardware agnostic userspace can query a cursor plane size to use. ++ * ++ * Note that the cross-driver contract is to merely return a valid size; ++ * drivers are free to attach another meaning on top, eg. i915 returns the ++ * maximum plane size. ++ */ ++#define DRM_CAP_CURSOR_WIDTH 0x8 ++/** ++ * DRM_CAP_CURSOR_HEIGHT ++ * ++ * See &DRM_CAP_CURSOR_WIDTH. ++ */ ++#define DRM_CAP_CURSOR_HEIGHT 0x9 ++/** ++ * DRM_CAP_ADDFB2_MODIFIERS ++ * ++ * If set to 1, the driver supports supplying modifiers in the ++ * &DRM_IOCTL_MODE_ADDFB2 ioctl. ++ */ ++#define DRM_CAP_ADDFB2_MODIFIERS 0x10 ++/** ++ * DRM_CAP_PAGE_FLIP_TARGET ++ * ++ * If set to 1, the driver supports the &DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE and ++ * &DRM_MODE_PAGE_FLIP_TARGET_RELATIVE flags in ++ * &drm_mode_crtc_page_flip_target.flags for the &DRM_IOCTL_MODE_PAGE_FLIP ++ * ioctl. ++ */ ++#define DRM_CAP_PAGE_FLIP_TARGET 0x11 ++/** ++ * DRM_CAP_CRTC_IN_VBLANK_EVENT ++ * ++ * If set to 1, the kernel supports reporting the CRTC ID in ++ * &drm_event_vblank.crtc_id for the &DRM_EVENT_VBLANK and ++ * &DRM_EVENT_FLIP_COMPLETE events. ++ * ++ * Starting kernel version 4.12, this capability is always set to 1. ++ */ ++#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12 ++/** ++ * DRM_CAP_SYNCOBJ ++ * ++ * If set to 1, the driver supports sync objects. See ++ * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects". ++ */ ++#define DRM_CAP_SYNCOBJ 0x13 ++/** ++ * DRM_CAP_SYNCOBJ_TIMELINE ++ * ++ * If set to 1, the driver supports timeline operations on sync objects. See ++ * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects". ++ */ ++#define DRM_CAP_SYNCOBJ_TIMELINE 0x14 ++ ++/* DRM_IOCTL_GET_CAP ioctl argument type */ ++struct drm_get_cap { ++ __u64 capability; ++ __u64 value; ++}; ++ ++/** ++ * DRM_CLIENT_CAP_STEREO_3D ++ * ++ * If set to 1, the DRM core will expose the stereo 3D capabilities of the ++ * monitor by advertising the supported 3D layouts in the flags of struct ++ * drm_mode_modeinfo. See ``DRM_MODE_FLAG_3D_*``. ++ * ++ * This capability is always supported for all drivers starting from kernel ++ * version 3.13. ++ */ ++#define DRM_CLIENT_CAP_STEREO_3D 1 ++ ++/** ++ * DRM_CLIENT_CAP_UNIVERSAL_PLANES ++ * ++ * If set to 1, the DRM core will expose all planes (overlay, primary, and ++ * cursor) to userspace. ++ * ++ * This capability has been introduced in kernel version 3.15. Starting from ++ * kernel version 3.17, this capability is always supported for all drivers. ++ */ ++#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2 ++ ++/** ++ * DRM_CLIENT_CAP_ATOMIC ++ * ++ * If set to 1, the DRM core will expose atomic properties to userspace. This ++ * implicitly enables &DRM_CLIENT_CAP_UNIVERSAL_PLANES and ++ * &DRM_CLIENT_CAP_ASPECT_RATIO. ++ * ++ * If the driver doesn't support atomic mode-setting, enabling this capability ++ * will fail with -EOPNOTSUPP. ++ * ++ * This capability has been introduced in kernel version 4.0. Starting from ++ * kernel version 4.2, this capability is always supported for atomic-capable ++ * drivers. ++ */ ++#define DRM_CLIENT_CAP_ATOMIC 3 ++ ++/** ++ * DRM_CLIENT_CAP_ASPECT_RATIO ++ * ++ * If set to 1, the DRM core will provide aspect ratio information in modes. ++ * See ``DRM_MODE_FLAG_PIC_AR_*``. ++ * ++ * This capability is always supported for all drivers starting from kernel ++ * version 4.18. ++ */ ++#define DRM_CLIENT_CAP_ASPECT_RATIO 4 ++ ++/** ++ * DRM_CLIENT_CAP_WRITEBACK_CONNECTORS ++ * ++ * If set to 1, the DRM core will expose special connectors to be used for ++ * writing back to memory the scene setup in the commit. The client must enable ++ * &DRM_CLIENT_CAP_ATOMIC first. ++ * ++ * This capability is always supported for atomic-capable drivers starting from ++ * kernel version 4.19. ++ */ ++#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5 ++ ++/* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ ++struct drm_set_client_cap { ++ __u64 capability; ++ __u64 value; ++}; ++ ++#define DRM_RDWR O_RDWR ++#define DRM_CLOEXEC O_CLOEXEC ++struct drm_prime_handle { ++ __u32 handle; ++ ++ /** Flags.. only applicable for handle->fd */ ++ __u32 flags; ++ ++ /** Returned dmabuf file descriptor */ ++ __s32 fd; ++}; ++ ++struct drm_syncobj_create { ++ __u32 handle; ++#define DRM_SYNCOBJ_CREATE_SIGNALED (1 << 0) ++ __u32 flags; ++}; ++ ++struct drm_syncobj_destroy { ++ __u32 handle; ++ __u32 pad; ++}; ++ ++#define DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE (1 << 0) ++#define DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_EXPORT_SYNC_FILE (1 << 0) ++struct drm_syncobj_handle { ++ __u32 handle; ++ __u32 flags; ++ ++ __s32 fd; ++ __u32 pad; ++}; ++ ++struct drm_syncobj_transfer { ++ __u32 src_handle; ++ __u32 dst_handle; ++ __u64 src_point; ++ __u64 dst_point; ++ __u32 flags; ++ __u32 pad; ++}; ++ ++#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0) ++#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1) ++#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE (1 << 2) /* wait for time point to become available */ ++struct drm_syncobj_wait { ++ __u64 handles; ++ /* absolute timeout */ ++ __s64 timeout_nsec; ++ __u32 count_handles; ++ __u32 flags; ++ __u32 first_signaled; /* only valid when not waiting all */ ++ __u32 pad; ++}; ++ ++struct drm_syncobj_timeline_wait { ++ __u64 handles; ++ /* wait on specific timeline point for every handles*/ ++ __u64 points; ++ /* absolute timeout */ ++ __s64 timeout_nsec; ++ __u32 count_handles; ++ __u32 flags; ++ __u32 first_signaled; /* only valid when not waiting all */ ++ __u32 pad; ++}; ++ ++ ++struct drm_syncobj_array { ++ __u64 handles; ++ __u32 count_handles; ++ __u32 pad; ++}; ++ ++#define DRM_SYNCOBJ_QUERY_FLAGS_LAST_SUBMITTED (1 << 0) /* last available point on timeline syncobj */ ++struct drm_syncobj_timeline_array { ++ __u64 handles; ++ __u64 points; ++ __u32 count_handles; ++ __u32 flags; ++}; ++ ++ ++/* Query current scanout sequence number */ ++struct drm_crtc_get_sequence { ++ __u32 crtc_id; /* requested crtc_id */ ++ __u32 active; /* return: crtc output is active */ ++ __u64 sequence; /* return: most recent vblank sequence */ ++ __s64 sequence_ns; /* return: most recent time of first pixel out */ ++}; ++ ++/* Queue event to be delivered at specified sequence. Time stamp marks ++ * when the first pixel of the refresh cycle leaves the display engine ++ * for the display ++ */ ++#define DRM_CRTC_SEQUENCE_RELATIVE 0x00000001 /* sequence is relative to current */ ++#define DRM_CRTC_SEQUENCE_NEXT_ON_MISS 0x00000002 /* Use next sequence if we've missed */ ++ ++struct drm_crtc_queue_sequence { ++ __u32 crtc_id; ++ __u32 flags; ++ __u64 sequence; /* on input, target sequence. on output, actual sequence */ ++ __u64 user_data; /* user data passed to event */ ++}; ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#include "drm_mode.h" ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++#define DRM_IOCTL_BASE 'd' ++#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr) ++#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type) ++#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type) ++#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type) ++ ++#define DRM_IOCTL_VERSION DRM_IOWR(0x00, struct drm_version) ++#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, struct drm_unique) ++#define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, struct drm_auth) ++#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, struct drm_irq_busid) ++#define DRM_IOCTL_GET_MAP DRM_IOWR(0x04, struct drm_map) ++#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client) ++#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats) ++#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version) ++#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl) ++#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close) ++#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink) ++#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open) ++#define DRM_IOCTL_GET_CAP DRM_IOWR(0x0c, struct drm_get_cap) ++#define DRM_IOCTL_SET_CLIENT_CAP DRM_IOW( 0x0d, struct drm_set_client_cap) ++ ++#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique) ++#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth) ++#define DRM_IOCTL_BLOCK DRM_IOWR(0x12, struct drm_block) ++#define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, struct drm_block) ++#define DRM_IOCTL_CONTROL DRM_IOW( 0x14, struct drm_control) ++#define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, struct drm_map) ++#define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, struct drm_buf_desc) ++#define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, struct drm_buf_desc) ++#define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, struct drm_buf_info) ++#define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, struct drm_buf_map) ++#define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, struct drm_buf_free) ++ ++#define DRM_IOCTL_RM_MAP DRM_IOW( 0x1b, struct drm_map) ++ ++#define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, struct drm_ctx_priv_map) ++#define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, struct drm_ctx_priv_map) ++ ++#define DRM_IOCTL_SET_MASTER DRM_IO(0x1e) ++#define DRM_IOCTL_DROP_MASTER DRM_IO(0x1f) ++ ++#define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, struct drm_ctx) ++#define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, struct drm_ctx) ++#define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, struct drm_ctx) ++#define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, struct drm_ctx) ++#define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, struct drm_ctx) ++#define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, struct drm_ctx) ++#define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, struct drm_ctx_res) ++#define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, struct drm_draw) ++#define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, struct drm_draw) ++#define DRM_IOCTL_DMA DRM_IOWR(0x29, struct drm_dma) ++#define DRM_IOCTL_LOCK DRM_IOW( 0x2a, struct drm_lock) ++#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock) ++#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock) ++ ++#define DRM_IOCTL_PRIME_HANDLE_TO_FD DRM_IOWR(0x2d, struct drm_prime_handle) ++#define DRM_IOCTL_PRIME_FD_TO_HANDLE DRM_IOWR(0x2e, struct drm_prime_handle) ++ ++#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30) ++#define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31) ++#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode) ++#define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, struct drm_agp_info) ++#define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, struct drm_agp_buffer) ++#define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, struct drm_agp_buffer) ++#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding) ++#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding) ++ ++#define DRM_IOCTL_SG_ALLOC DRM_IOWR(0x38, struct drm_scatter_gather) ++#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather) ++ ++#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank) ++ ++#define DRM_IOCTL_CRTC_GET_SEQUENCE DRM_IOWR(0x3b, struct drm_crtc_get_sequence) ++#define DRM_IOCTL_CRTC_QUEUE_SEQUENCE DRM_IOWR(0x3c, struct drm_crtc_queue_sequence) ++ ++#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw) ++ ++#define DRM_IOCTL_MODE_GETRESOURCES DRM_IOWR(0xA0, struct drm_mode_card_res) ++#define DRM_IOCTL_MODE_GETCRTC DRM_IOWR(0xA1, struct drm_mode_crtc) ++#define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA2, struct drm_mode_crtc) ++#define DRM_IOCTL_MODE_CURSOR DRM_IOWR(0xA3, struct drm_mode_cursor) ++#define DRM_IOCTL_MODE_GETGAMMA DRM_IOWR(0xA4, struct drm_mode_crtc_lut) ++#define DRM_IOCTL_MODE_SETGAMMA DRM_IOWR(0xA5, struct drm_mode_crtc_lut) ++#define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xA6, struct drm_mode_get_encoder) ++#define DRM_IOCTL_MODE_GETCONNECTOR DRM_IOWR(0xA7, struct drm_mode_get_connector) ++#define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA8, struct drm_mode_mode_cmd) /* deprecated (never worked) */ ++#define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd) /* deprecated (never worked) */ ++ ++#define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAA, struct drm_mode_get_property) ++#define DRM_IOCTL_MODE_SETPROPERTY DRM_IOWR(0xAB, struct drm_mode_connector_set_property) ++#define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, struct drm_mode_get_blob) ++#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd) ++#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd) ++/** ++ * DRM_IOCTL_MODE_RMFB - Remove a framebuffer. ++ * ++ * This removes a framebuffer previously added via ADDFB/ADDFB2. The IOCTL ++ * argument is a framebuffer object ID. ++ * ++ * Warning: removing a framebuffer currently in-use on an enabled plane will ++ * disable that plane. The CRTC the plane is linked to may also be disabled ++ * (depending on driver capabilities). ++ */ ++#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int) ++#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip) ++#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd) ++ ++#define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb) ++#define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, struct drm_mode_map_dumb) ++#define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, struct drm_mode_destroy_dumb) ++#define DRM_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xB5, struct drm_mode_get_plane_res) ++#define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane) ++#define DRM_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct drm_mode_set_plane) ++#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2) ++#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties) ++#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property) ++#define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2) ++#define DRM_IOCTL_MODE_ATOMIC DRM_IOWR(0xBC, struct drm_mode_atomic) ++#define DRM_IOCTL_MODE_CREATEPROPBLOB DRM_IOWR(0xBD, struct drm_mode_create_blob) ++#define DRM_IOCTL_MODE_DESTROYPROPBLOB DRM_IOWR(0xBE, struct drm_mode_destroy_blob) ++ ++#define DRM_IOCTL_SYNCOBJ_CREATE DRM_IOWR(0xBF, struct drm_syncobj_create) ++#define DRM_IOCTL_SYNCOBJ_DESTROY DRM_IOWR(0xC0, struct drm_syncobj_destroy) ++#define DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD DRM_IOWR(0xC1, struct drm_syncobj_handle) ++#define DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE DRM_IOWR(0xC2, struct drm_syncobj_handle) ++#define DRM_IOCTL_SYNCOBJ_WAIT DRM_IOWR(0xC3, struct drm_syncobj_wait) ++#define DRM_IOCTL_SYNCOBJ_RESET DRM_IOWR(0xC4, struct drm_syncobj_array) ++#define DRM_IOCTL_SYNCOBJ_SIGNAL DRM_IOWR(0xC5, struct drm_syncobj_array) ++ ++#define DRM_IOCTL_MODE_CREATE_LEASE DRM_IOWR(0xC6, struct drm_mode_create_lease) ++#define DRM_IOCTL_MODE_LIST_LESSEES DRM_IOWR(0xC7, struct drm_mode_list_lessees) ++#define DRM_IOCTL_MODE_GET_LEASE DRM_IOWR(0xC8, struct drm_mode_get_lease) ++#define DRM_IOCTL_MODE_REVOKE_LEASE DRM_IOWR(0xC9, struct drm_mode_revoke_lease) ++ ++#define DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT DRM_IOWR(0xCA, struct drm_syncobj_timeline_wait) ++#define DRM_IOCTL_SYNCOBJ_QUERY DRM_IOWR(0xCB, struct drm_syncobj_timeline_array) ++#define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer) ++#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct drm_syncobj_timeline_array) ++ ++#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2) ++ ++/* ++ * Device specific ioctls should only be in their respective headers ++ * The device specific ioctl range is from 0x40 to 0x9f. ++ * Generic IOCTLS restart at 0xA0. ++ * ++ * \sa drmCommandNone(), drmCommandRead(), drmCommandWrite(), and ++ * drmCommandReadWrite(). ++ */ ++#define DRM_COMMAND_BASE 0x40 ++#define DRM_COMMAND_END 0xA0 ++ ++/* ++ * Header for events written back to userspace on the drm fd. The ++ * type defines the type of event, the length specifies the total ++ * length of the event (including the header), and user_data is ++ * typically a 64 bit value passed with the ioctl that triggered the ++ * event. A read on the drm fd will always only return complete ++ * events, that is, if for example the read buffer is 100 bytes, and ++ * there are two 64 byte events pending, only one will be returned. ++ * ++ * Event types 0 - 0x7fffffff are generic drm events, 0x80000000 and ++ * up are chipset specific. ++ */ ++struct drm_event { ++ __u32 type; ++ __u32 length; ++}; ++ ++#define DRM_EVENT_VBLANK 0x01 ++#define DRM_EVENT_FLIP_COMPLETE 0x02 ++#define DRM_EVENT_CRTC_SEQUENCE 0x03 ++ ++struct drm_event_vblank { ++ struct drm_event base; ++ __u64 user_data; ++ __u32 tv_sec; ++ __u32 tv_usec; ++ __u32 sequence; ++ __u32 crtc_id; /* 0 on older kernels that do not support this */ ++}; ++ ++/* Event delivered at sequence. Time stamp marks when the first pixel ++ * of the refresh cycle leaves the display engine for the display ++ */ ++struct drm_event_crtc_sequence { ++ struct drm_event base; ++ __u64 user_data; ++ __s64 time_ns; ++ __u64 sequence; ++}; ++ ++/* typedef area */ ++typedef struct drm_clip_rect drm_clip_rect_t; ++typedef struct drm_drawable_info drm_drawable_info_t; ++typedef struct drm_tex_region drm_tex_region_t; ++typedef struct drm_hw_lock drm_hw_lock_t; ++typedef struct drm_version drm_version_t; ++typedef struct drm_unique drm_unique_t; ++typedef struct drm_list drm_list_t; ++typedef struct drm_block drm_block_t; ++typedef struct drm_control drm_control_t; ++typedef enum drm_map_type drm_map_type_t; ++typedef enum drm_map_flags drm_map_flags_t; ++typedef struct drm_ctx_priv_map drm_ctx_priv_map_t; ++typedef struct drm_map drm_map_t; ++typedef struct drm_client drm_client_t; ++typedef enum drm_stat_type drm_stat_type_t; ++typedef struct drm_stats drm_stats_t; ++typedef enum drm_lock_flags drm_lock_flags_t; ++typedef struct drm_lock drm_lock_t; ++typedef enum drm_dma_flags drm_dma_flags_t; ++typedef struct drm_buf_desc drm_buf_desc_t; ++typedef struct drm_buf_info drm_buf_info_t; ++typedef struct drm_buf_free drm_buf_free_t; ++typedef struct drm_buf_pub drm_buf_pub_t; ++typedef struct drm_buf_map drm_buf_map_t; ++typedef struct drm_dma drm_dma_t; ++typedef union drm_wait_vblank drm_wait_vblank_t; ++typedef struct drm_agp_mode drm_agp_mode_t; ++typedef enum drm_ctx_flags drm_ctx_flags_t; ++typedef struct drm_ctx drm_ctx_t; ++typedef struct drm_ctx_res drm_ctx_res_t; ++typedef struct drm_draw drm_draw_t; ++typedef struct drm_update_draw drm_update_draw_t; ++typedef struct drm_auth drm_auth_t; ++typedef struct drm_irq_busid drm_irq_busid_t; ++typedef enum drm_vblank_seq_type drm_vblank_seq_type_t; ++ ++typedef struct drm_agp_buffer drm_agp_buffer_t; ++typedef struct drm_agp_binding drm_agp_binding_t; ++typedef struct drm_agp_info drm_agp_info_t; ++typedef struct drm_scatter_gather drm_scatter_gather_t; ++typedef struct drm_set_version drm_set_version_t; ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif +diff -up firefox-101.0/third_party/drm/drm/drm_mode.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/drm/drm/drm_mode.h +--- firefox-101.0/third_party/drm/drm/drm_mode.h.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.741522076 +0200 ++++ firefox-101.0/third_party/drm/drm/drm_mode.h 2022-05-30 21:33:19.741522076 +0200 @@ -0,0 +1,1217 @@ +/* + * Copyright (c) 2007 Dave Airlie @@ -3832,11 +3809,9 @@ index 0000000..e1e3516 +#endif + +#endif -diff --git a/third_party/drm/drm/xf86drm.h b/third_party/drm/drm/xf86drm.h -new file mode 100644 -index 0000000..58d66f1 ---- /dev/null -+++ b/third_party/drm/drm/xf86drm.h +diff -up firefox-101.0/third_party/drm/drm/xf86drm.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/drm/drm/xf86drm.h +--- firefox-101.0/third_party/drm/drm/xf86drm.h.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.742522110 +0200 ++++ firefox-101.0/third_party/drm/drm/xf86drm.h 2022-05-30 21:33:19.742522110 +0200 @@ -0,0 +1,966 @@ +/** + * \file xf86drm.h @@ -4804,11 +4779,9 @@ index 0000000..58d66f1 +#endif + +#endif -diff --git a/third_party/drm/libdrm/moz.build b/third_party/drm/libdrm/moz.build -new file mode 100644 -index 0000000..3b37b91 ---- /dev/null -+++ b/third_party/drm/libdrm/moz.build +diff -up firefox-101.0/third_party/drm/libdrm/moz.build.libwebrtc-screen-cast-sync firefox-101.0/third_party/drm/libdrm/moz.build +--- firefox-101.0/third_party/drm/libdrm/moz.build.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.742522110 +0200 ++++ firefox-101.0/third_party/drm/libdrm/moz.build 2022-05-30 21:33:19.742522110 +0200 @@ -0,0 +1,16 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: @@ -4826,11 +4799,9 @@ index 0000000..3b37b91 +LOCAL_INCLUDES += ['/third_party/drm'] + +FINAL_LIBRARY = 'xul' -diff --git a/third_party/drm/libdrm/mozdrm.cpp b/third_party/drm/libdrm/mozdrm.cpp -new file mode 100644 -index 0000000..b2fb59b ---- /dev/null -+++ b/third_party/drm/libdrm/mozdrm.cpp +diff -up firefox-101.0/third_party/drm/libdrm/mozdrm.cpp.libwebrtc-screen-cast-sync firefox-101.0/third_party/drm/libdrm/mozdrm.cpp +--- firefox-101.0/third_party/drm/libdrm/mozdrm.cpp.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.742522110 +0200 ++++ firefox-101.0/third_party/drm/libdrm/mozdrm.cpp 2022-05-30 21:33:19.742522110 +0200 @@ -0,0 +1,66 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: @@ -4898,21 +4869,17 @@ index 0000000..b2fb59b + } + return drmFreeDevices_fn(devices, count); +} -diff --git a/third_party/gbm/README b/third_party/gbm/README -new file mode 100644 -index 0000000..4b6e2e8 ---- /dev/null -+++ b/third_party/gbm/README +diff -up firefox-101.0/third_party/drm/README.libwebrtc-screen-cast-sync firefox-101.0/third_party/drm/README +--- firefox-101.0/third_party/drm/README.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.740522043 +0200 ++++ firefox-101.0/third_party/drm/README 2022-05-30 21:33:19.740522043 +0200 @@ -0,0 +1,4 @@ -+Libgbm is a gbm library wrapper needed to build and run Firefox with -+Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/gbm). ++Libdrm is a drm library wrapper needed to build and run Firefox with ++Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/drm). + -+libgbm directory stores headers of libgbm needed for build only. -diff --git a/third_party/gbm/gbm/gbm.h b/third_party/gbm/gbm/gbm.h -new file mode 100644 -index 0000000..a963ed7 ---- /dev/null -+++ b/third_party/gbm/gbm/gbm.h ++libdrm directory stores headers of libdrm needed for build only. +diff -up firefox-101.0/third_party/gbm/gbm/gbm.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/gbm/gbm/gbm.h +--- firefox-101.0/third_party/gbm/gbm/gbm.h.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.742522110 +0200 ++++ firefox-101.0/third_party/gbm/gbm/gbm.h 2022-05-30 21:33:19.742522110 +0200 @@ -0,0 +1,452 @@ +/* + * Copyright © 2011 Intel Corporation @@ -5366,11 +5333,9 @@ index 0000000..a963ed7 +#endif + +#endif -diff --git a/third_party/gbm/libgbm/moz.build b/third_party/gbm/libgbm/moz.build -new file mode 100644 -index 0000000..0953d2f ---- /dev/null -+++ b/third_party/gbm/libgbm/moz.build +diff -up firefox-101.0/third_party/gbm/libgbm/moz.build.libwebrtc-screen-cast-sync firefox-101.0/third_party/gbm/libgbm/moz.build +--- firefox-101.0/third_party/gbm/libgbm/moz.build.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.742522110 +0200 ++++ firefox-101.0/third_party/gbm/libgbm/moz.build 2022-05-30 21:33:19.742522110 +0200 @@ -0,0 +1,16 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: @@ -5388,11 +5353,9 @@ index 0000000..0953d2f +LOCAL_INCLUDES += ['/third_party/gbm'] + +FINAL_LIBRARY = 'xul' -diff --git a/third_party/gbm/libgbm/mozgbm.cpp b/third_party/gbm/libgbm/mozgbm.cpp -new file mode 100644 -index 0000000..bc024a1 ---- /dev/null -+++ b/third_party/gbm/libgbm/mozgbm.cpp +diff -up firefox-101.0/third_party/gbm/libgbm/mozgbm.cpp.libwebrtc-screen-cast-sync firefox-101.0/third_party/gbm/libgbm/mozgbm.cpp +--- firefox-101.0/third_party/gbm/libgbm/mozgbm.cpp.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.742522110 +0200 ++++ firefox-101.0/third_party/gbm/libgbm/mozgbm.cpp 2022-05-30 21:33:19.742522110 +0200 @@ -0,0 +1,66 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: @@ -5460,11 +5423,18 @@ index 0000000..bc024a1 + } + return gbm_device_destroy_fn(gbm); +} -diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build -index a5cf923..99cabbf 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build -+++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build -@@ -77,6 +77,8 @@ if CONFIG["OS_TARGET"] == "Darwin": +diff -up firefox-101.0/third_party/gbm/README.libwebrtc-screen-cast-sync firefox-101.0/third_party/gbm/README +--- firefox-101.0/third_party/gbm/README.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.742522110 +0200 ++++ firefox-101.0/third_party/gbm/README 2022-05-30 21:33:19.742522110 +0200 +@@ -0,0 +1,4 @@ ++Libgbm is a gbm library wrapper needed to build and run Firefox with ++Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/gbm). ++ ++libgbm directory stores headers of libgbm needed for build only. +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build 2022-05-30 21:33:19.742522110 +0200 +@@ -76,6 +76,8 @@ if CONFIG["OS_TARGET"] == "Darwin": LOCAL_INCLUDES += [ "/media/libyuv/libyuv/include/", "/media/libyuv/libyuv/include/", @@ -5473,7 +5443,7 @@ index a5cf923..99cabbf 100644 "/third_party/pipewire/" ] -@@ -108,7 +110,8 @@ if CONFIG["OS_TARGET"] == "Linux": +@@ -105,7 +107,8 @@ if CONFIG["OS_TARGET"] == "Linux": LOCAL_INCLUDES += [ "/media/libyuv/libyuv/include/", "/media/libyuv/libyuv/include/", @@ -5483,7 +5453,7 @@ index a5cf923..99cabbf 100644 "/third_party/pipewire/" ] -@@ -126,15 +129,18 @@ if CONFIG["OS_TARGET"] == "Linux": +@@ -156,15 +159,18 @@ if CONFIG["OS_TARGET"] == "OpenBSD": ] SOURCES += [ @@ -5505,38 +5475,7 @@ index a5cf923..99cabbf 100644 "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_x11.cc", "/third_party/libwebrtc/modules/desktop_capture/linux/window_finder_x11.cc", "/third_party/libwebrtc/modules/desktop_capture/linux/window_list_utils.cc", -@@ -162,6 +168,8 @@ if CONFIG["OS_TARGET"] == "OpenBSD": - - LOCAL_INCLUDES += [ - "/media/libyuv/libyuv/include/", -+ "/third_party/drm/", -+ "/third_party/gbm/", - "/third_party/pipewire/" - ] - -@@ -177,15 +185,18 @@ if CONFIG["OS_TARGET"] == "OpenBSD": - ] - - SOURCES += [ -- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" -+ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" - ] - - UNIFIED_SOURCES += [ - "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc", -- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_x11.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/shared_x_display.cc", -- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_x11.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/window_finder_x11.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/window_list_utils.cc", -@@ -227,6 +238,7 @@ if CONFIG["OS_TARGET"] == "WINNT": +@@ -206,6 +212,7 @@ if CONFIG["OS_TARGET"] == "WINNT": LOCAL_INCLUDES += [ "/media/libyuv/libyuv/include/", "/media/libyuv/libyuv/include/", @@ -5544,10 +5483,9 @@ index a5cf923..99cabbf 100644 "/third_party/pipewire/" ] -diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc -index c89896d..c8ef822 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc 2022-05-30 21:33:19.742522110 +0200 @@ -14,6 +14,9 @@ #elif defined(WEBRTC_WIN) #include "modules/desktop_capture/win/full_screen_win_application_handler.h" @@ -5558,7 +5496,7 @@ index c89896d..c8ef822 100644 namespace webrtc { -@@ -35,6 +38,9 @@ DesktopCaptureOptions DesktopCaptureOptions::CreateDefault() { +@@ -35,6 +38,9 @@ DesktopCaptureOptions DesktopCaptureOpti #if defined(WEBRTC_USE_X11) result.set_x_display(SharedXDisplay::CreateDefault()); #endif @@ -5568,10 +5506,9 @@ index c89896d..c8ef822 100644 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) result.set_configuration_monitor(new DesktopConfigurationMonitor()); result.set_full_screen_window_detector( -diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h -index ee0dd3a..ac56c8c 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h -+++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h.libwebrtc-screen-cast-sync 2022-05-27 01:17:04.000000000 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h 2022-05-30 21:33:19.743522143 +0200 @@ -17,6 +17,10 @@ #include "modules/desktop_capture/linux/shared_x_display.h" #endif @@ -5611,10 +5548,9 @@ index ee0dd3a..ac56c8c 100644 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) rtc::scoped_refptr configuration_monitor_; bool allow_iosurface_ = false; -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc -index 2fd3b1a..e4685fc 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc 2022-05-30 21:33:19.743522143 +0200 @@ -10,937 +10,67 @@ #include "modules/desktop_capture/linux/base_capturer_pipewire.h" @@ -5718,12 +5654,8 @@ index 2fd3b1a..e4685fc 100644 - case PW_STREAM_STATE_CONNECTING: - break; - } -+BaseCapturerPipeWire::BaseCapturerPipeWire(const DesktopCaptureOptions& options) -+ : options_(options) { -+ screencast_portal_ = std::make_unique( -+ ScreenCastPortal::CaptureSourceType::kAnyScreenContent, this); - } - +-} +- -// static -void BaseCapturerPipeWire::OnStreamParamChanged(void *data, uint32_t id, - const struct spa_pod *format) { @@ -5777,8 +5709,7 @@ index 2fd3b1a..e4685fc 100644 - - struct pw_buffer *next_buffer; - struct pw_buffer *buffer = nullptr; -+BaseCapturerPipeWire::~BaseCapturerPipeWire() {} - +- - next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); - while (next_buffer) { - buffer = next_buffer; @@ -5791,23 +5722,13 @@ index 2fd3b1a..e4685fc 100644 - - if (!buffer) { - return; -+void BaseCapturerPipeWire::OnScreenCastRequestResult( -+ ScreenCastPortal::RequestResponse result, -+ uint32_t stream_node_id, -+ int fd) { -+ if (result != ScreenCastPortal::RequestResponse::kSuccess || -+ !options_.screencast_stream()->StartScreenCastStream(stream_node_id, -+ fd)) { -+ capturer_failed_ = true; -+ RTC_LOG(LS_ERROR) << "ScreenCastPortal failed: " -+ << static_cast(result); - } +- } - - that->HandleBuffer(buffer); - - pw_stream_queue_buffer(that->pw_stream_, buffer); - } - +-} +- -BaseCapturerPipeWire::BaseCapturerPipeWire(CaptureSourceType source_type) - : capture_source_type_(source_type) {} - @@ -5830,10 +5751,7 @@ index 2fd3b1a..e4685fc 100644 - - if (pw_main_loop_) { - pw_thread_loop_destroy(pw_main_loop_); -+void BaseCapturerPipeWire::OnScreenCastSessionClosed() { -+ if (!capturer_failed_) { -+ options_.screencast_stream()->StopScreenCastStream(); - } +- } - - if (start_request_signal_id_) { - g_dbus_connection_signal_unsubscribe(connection_, start_request_signal_id_); @@ -5877,7 +5795,25 @@ index 2fd3b1a..e4685fc 100644 - if (proxy_) { - g_object_unref(proxy_); - proxy_ = nullptr; -- } ++BaseCapturerPipeWire::BaseCapturerPipeWire(const DesktopCaptureOptions& options) ++ : options_(options) { ++ screencast_portal_ = std::make_unique( ++ ScreenCastPortal::CaptureSourceType::kAnyScreenContent, this); ++} ++ ++BaseCapturerPipeWire::~BaseCapturerPipeWire() {} ++ ++void BaseCapturerPipeWire::OnScreenCastRequestResult( ++ ScreenCastPortal::RequestResponse result, ++ uint32_t stream_node_id, ++ int fd) { ++ if (result != ScreenCastPortal::RequestResponse::kSuccess || ++ !options_.screencast_stream()->StartScreenCastStream(stream_node_id, ++ fd)) { ++ capturer_failed_ = true; ++ RTC_LOG(LS_ERROR) << "ScreenCastPortal failed: " ++ << static_cast(result); + } - - if (pw_fd_ != -1) { - close(pw_fd_); @@ -5980,17 +5916,20 @@ index 2fd3b1a..e4685fc 100644 - } - - return stream; --} -- + } + -static void SpaBufferUnmap(unsigned char *map, int map_size, bool IsDMABuf, int fd) { - if (map) { - if (IsDMABuf) { - SyncDmaBuf(fd, DMA_BUF_SYNC_END); - } - munmap(map, map_size); -- } --} -- ++void BaseCapturerPipeWire::OnScreenCastSessionClosed() { ++ if (!capturer_failed_) { ++ options_.screencast_stream()->StopScreenCastStream(); + } + } + -void BaseCapturerPipeWire::HandleBuffer(pw_buffer* buffer) { - spa_buffer* spaBuffer = buffer->buffer; - uint8_t *map = nullptr; @@ -6527,8 +6466,8 @@ index 2fd3b1a..e4685fc 100644 - g_object_unref(outlist); - - that->InitPipeWire(); - } - +-} +- void BaseCapturerPipeWire::Start(Callback* callback) { RTC_DCHECK(!callback_); RTC_DCHECK(callback); @@ -6580,7 +6519,7 @@ index 2fd3b1a..e4685fc 100644 } // Keep in sync with defines at browser/actors/WebRTCParent.jsm -@@ -953,31 +83,13 @@ void BaseCapturerPipeWire::CaptureFrame() { +@@ -953,31 +83,13 @@ void BaseCapturerPipeWire::CaptureFrame( #define PIPEWIRE_NAME "####_PIPEWIRE_PORTAL_####" bool BaseCapturerPipeWire::GetSourceList(SourceList* sources) { @@ -6613,10 +6552,9 @@ index 2fd3b1a..e4685fc 100644 -} - } // namespace webrtc -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h -index af8e20c..5db09e0 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h 2022-05-30 21:33:19.743522143 +0200 @@ -11,160 +11,39 @@ #ifndef MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ #define MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ @@ -6793,11 +6731,9 @@ index af8e20c..5db09e0 100644 }; } // namespace webrtc -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs b/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs -new file mode 100644 -index 0000000..226979f ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.743522143 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs 2022-05-30 21:33:19.743522143 +0200 @@ -0,0 +1,11 @@ +// Copyright 2021 The WebRTC project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be @@ -6810,11 +6746,9 @@ index 0000000..226979f +// xf86drm.h +int drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices); +void drmFreeDevices(drmDevicePtr devices[], int count); -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc -new file mode 100644 -index 0000000..de63c2a ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.743522143 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc 2022-05-30 21:33:19.743522143 +0200 @@ -0,0 +1,695 @@ +/* + * Copyright 2021 The WebRTC project authors. All Rights Reserved. @@ -7511,11 +7445,9 @@ index 0000000..de63c2a +} + +} // namespace webrtc -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h -new file mode 100644 -index 0000000..b755d8b ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.743522143 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h 2022-05-30 21:33:19.743522143 +0200 @@ -0,0 +1,68 @@ +/* + * Copyright 2021 The WebRTC project authors. All Rights Reserved. @@ -7585,11 +7517,9 @@ index 0000000..b755d8b +} // namespace webrtc + +#endif // MODULES_DESKTOP_CAPTURE_LINUX_EGL_DMABUF_H_ -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc -new file mode 100644 -index 0000000..09dea24 ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.743522143 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc 2022-05-30 21:33:19.743522143 +0200 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2022 The WebRTC project authors. All Rights Reserved. @@ -7647,11 +7577,9 @@ index 0000000..09dea24 +} + +} // namespace webrtc -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h -new file mode 100644 -index 0000000..9b9ccf7 ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.743522143 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h 2022-05-30 21:33:19.743522143 +0200 @@ -0,0 +1,41 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. @@ -7694,10 +7622,9 @@ index 0000000..9b9ccf7 +} // namespace webrtc + +#endif // MODULES_DESKTOP_CAPTURE_LINUX_MOUSE_CURSOR_MONITOR_PIPEWIRE_H_ -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs -index 3e21e9d..06a97b8 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs 2022-05-30 21:33:19.743522143 +0200 @@ -7,38 +7,44 @@ //------------------------------------------------ @@ -7757,21 +7684,18 @@ index 3e21e9d..06a97b8 100644 +pw_context *pw_context_new(pw_loop *main_loop, pw_properties *props, size_t user_data_size); +pw_core * pw_context_connect(pw_context *context, pw_properties *properties, size_t user_data_size); +pw_core * pw_context_connect_fd(pw_context *context, int fd, pw_properties *properties, size_t user_data_size); -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment -index 9d7dbd2..06ae18d 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment 2022-05-30 21:33:19.744522177 +0200 @@ -5,4 +5,5 @@ extern "C" { #include +#include } -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc -new file mode 100644 -index 0000000..51ca57a ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.744522177 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc 2022-05-30 21:33:19.744522177 +0200 @@ -0,0 +1,57 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. @@ -7830,11 +7754,9 @@ index 0000000..51ca57a +} + +} // namespace webrtc -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h -new file mode 100644 -index 0000000..bf77855 ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.744522177 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h 2022-05-30 21:33:19.744522177 +0200 @@ -0,0 +1,65 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. @@ -7901,84 +7823,11 @@ index 0000000..bf77855 +} // namespace webrtc + +#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCOPED_GLIB_H_ -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc -deleted file mode 100644 -index 3813d69..0000000 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc -+++ /dev/null -@@ -1,28 +0,0 @@ --/* -- * Copyright 2018 The WebRTC project authors. All Rights Reserved. -- * -- * Use of this source code is governed by a BSD-style license -- * that can be found in the LICENSE file in the root of the source -- * tree. An additional intellectual property rights grant can be found -- * in the file PATENTS. All contributing project authors may -- * be found in the AUTHORS file in the root of the source tree. -- */ -- --#include "modules/desktop_capture/linux/screen_capturer_pipewire.h" -- --#include -- --namespace webrtc { -- --ScreenCapturerPipeWire::ScreenCapturerPipeWire() -- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kScreen) {} --ScreenCapturerPipeWire::~ScreenCapturerPipeWire() {} -- --// static --std::unique_ptr --ScreenCapturerPipeWire::CreateRawScreenCapturer( -- const DesktopCaptureOptions& options) { -- return std::make_unique(); --} -- --} // namespace webrtc -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h -deleted file mode 100644 -index 66dcd68..0000000 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h -+++ /dev/null -@@ -1,33 +0,0 @@ --/* -- * Copyright 2018 The WebRTC project authors. All Rights Reserved. -- * -- * Use of this source code is governed by a BSD-style license -- * that can be found in the LICENSE file in the root of the source -- * tree. An additional intellectual property rights grant can be found -- * in the file PATENTS. All contributing project authors may -- * be found in the AUTHORS file in the root of the source tree. -- */ -- --#ifndef MODULES_DESKTOP_CAPTURE_LINUX_SCREEN_CAPTURER_PIPEWIRE_H_ --#define MODULES_DESKTOP_CAPTURE_LINUX_SCREEN_CAPTURER_PIPEWIRE_H_ -- --#include -- --#include "modules/desktop_capture/linux/base_capturer_pipewire.h" -- --namespace webrtc { -- --class ScreenCapturerPipeWire : public BaseCapturerPipeWire { -- public: -- ScreenCapturerPipeWire(); -- ~ScreenCapturerPipeWire() override; -- -- static std::unique_ptr CreateRawScreenCapturer( -- const DesktopCaptureOptions& options); -- -- RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerPipeWire); --}; -- --} // namespace webrtc -- --#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCREEN_CAPTURER_PIPEWIRE_H_ -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc -new file mode 100644 -index 0000000..306e984 ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.744522177 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc 2022-05-30 21:33:19.744522177 +0200 @@ -0,0 +1,532 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. @@ -8512,11 +8361,9 @@ index 0000000..306e984 +} + +} // namespace webrtc -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h -new file mode 100644 -index 0000000..7da218e ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.744522177 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h 2022-05-30 21:33:19.744522177 +0200 @@ -0,0 +1,169 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. @@ -8687,11 +8534,9 @@ index 0000000..7da218e +} // namespace webrtc + +#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCREENCAST_PORTAL_H_ -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc -new file mode 100644 -index 0000000..c6ba661 ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.744522177 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc 2022-05-30 21:33:19.744522177 +0200 @@ -0,0 +1,872 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. @@ -9565,11 +9410,9 @@ index 0000000..c6ba661 +} + +} // namespace webrtc -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h -new file mode 100644 -index 0000000..72411e5 ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.744522177 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h 2022-05-30 21:33:19.744522177 +0200 @@ -0,0 +1,71 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. @@ -9642,83 +9485,11 @@ index 0000000..72411e5 +} // namespace webrtc + +#endif // MODULES_DESKTOP_CAPTURE_LINUX_SHARED_SCREENCAST_STREAM_H_ -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc -deleted file mode 100644 -index c43a1f1..0000000 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc -+++ /dev/null -@@ -1,28 +0,0 @@ --/* -- * Copyright 2018 The WebRTC project authors. All Rights Reserved. -- * -- * Use of this source code is governed by a BSD-style license -- * that can be found in the LICENSE file in the root of the source -- * tree. An additional intellectual property rights grant can be found -- * in the file PATENTS. All contributing project authors may -- * be found in the AUTHORS file in the root of the source tree. -- */ -- --#include "modules/desktop_capture/linux/window_capturer_pipewire.h" -- --#include -- --namespace webrtc { -- --WindowCapturerPipeWire::WindowCapturerPipeWire() -- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kWindow) {} --WindowCapturerPipeWire::~WindowCapturerPipeWire() {} -- --// static --std::unique_ptr --WindowCapturerPipeWire::CreateRawWindowCapturer( -- const DesktopCaptureOptions& options) { -- return std::make_unique(); --} -- --} // namespace webrtc -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h -deleted file mode 100644 -index 7f184ef..0000000 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h -+++ /dev/null -@@ -1,33 +0,0 @@ --/* -- * Copyright 2018 The WebRTC project authors. All Rights Reserved. -- * -- * Use of this source code is governed by a BSD-style license -- * that can be found in the LICENSE file in the root of the source -- * tree. An additional intellectual property rights grant can be found -- * in the file PATENTS. All contributing project authors may -- * be found in the AUTHORS file in the root of the source tree. -- */ -- --#ifndef MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_CAPTURER_PIPEWIRE_H_ --#define MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_CAPTURER_PIPEWIRE_H_ -- --#include -- --#include "modules/desktop_capture/linux/base_capturer_pipewire.h" -- --namespace webrtc { -- --class WindowCapturerPipeWire : public BaseCapturerPipeWire { -- public: -- WindowCapturerPipeWire(); -- ~WindowCapturerPipeWire() override; -- -- static std::unique_ptr CreateRawWindowCapturer( -- const DesktopCaptureOptions& options); -- -- RTC_DISALLOW_COPY_AND_ASSIGN(WindowCapturerPipeWire); --}; -- --} // namespace webrtc -- --#endif // MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_CAPTURER_PIPEWIRE_H_ -diff --git a/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc b/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc -index e569f6e..3bb51e8 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc 2022-05-30 21:33:19.745522210 +0200 @@ -17,6 +17,10 @@ #include "modules/desktop_capture/linux/mouse_cursor_monitor_x11.h" #endif // defined(WEBRTC_USE_X11) @@ -9730,7 +9501,7 @@ index e569f6e..3bb51e8 100644 namespace webrtc { // static -@@ -44,6 +48,13 @@ MouseCursorMonitor* MouseCursorMonitor::CreateForScreen( +@@ -44,6 +48,13 @@ MouseCursorMonitor* MouseCursorMonitor:: // static std::unique_ptr MouseCursorMonitor::Create( const DesktopCaptureOptions& options) { @@ -9744,10 +9515,9 @@ index e569f6e..3bb51e8 100644 #if defined(WEBRTC_USE_X11) return MouseCursorMonitorX11::Create(options); #else -diff --git a/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc b/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc -index 57a2002..b44ae35 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc 2022-05-30 21:33:19.745522210 +0200 @@ -14,7 +14,7 @@ #include "modules/desktop_capture/desktop_capturer.h" @@ -9757,7 +9527,7 @@ index 57a2002..b44ae35 100644 #endif // defined(WEBRTC_USE_PIPEWIRE) #if defined(WEBRTC_USE_X11) -@@ -28,7 +28,7 @@ std::unique_ptr DesktopCapturer::CreateRawScreenCapturer( +@@ -28,7 +28,7 @@ std::unique_ptr Desktop const DesktopCaptureOptions& options) { #if defined(WEBRTC_USE_PIPEWIRE) if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { @@ -9766,10 +9536,9 @@ index 57a2002..b44ae35 100644 } #endif // defined(WEBRTC_USE_PIPEWIRE) -diff --git a/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc b/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc -index ed03ba0..3bc6577 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc 2022-05-30 21:33:19.745522210 +0200 @@ -14,7 +14,7 @@ #include "modules/desktop_capture/desktop_capturer.h" @@ -9779,7 +9548,7 @@ index ed03ba0..3bc6577 100644 #endif // defined(WEBRTC_USE_PIPEWIRE) #if defined(WEBRTC_USE_X11) -@@ -28,7 +28,7 @@ std::unique_ptr DesktopCapturer::CreateRawWindowCapturer( +@@ -28,7 +28,7 @@ std::unique_ptr Desktop const DesktopCaptureOptions& options) { #if defined(WEBRTC_USE_PIPEWIRE) if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { @@ -9788,11 +9557,10 @@ index ed03ba0..3bc6577 100644 } #endif // defined(WEBRTC_USE_PIPEWIRE) -diff --git a/third_party/moz.build b/third_party/moz.build -index 1941c11..f804531 100644 ---- a/third_party/moz.build -+++ b/third_party/moz.build -@@ -49,6 +49,12 @@ with Files("libwebrtc/**"): +diff -up firefox-101.0/third_party/moz.build.libwebrtc-screen-cast-sync firefox-101.0/third_party/moz.build +--- firefox-101.0/third_party/moz.build.libwebrtc-screen-cast-sync 2022-05-27 01:17:04.000000000 +0200 ++++ firefox-101.0/third_party/moz.build 2022-05-30 21:33:19.745522210 +0200 +@@ -58,6 +58,12 @@ with Files("libwebrtc/**"): with Files("pipewire/**"): BUG_COMPONENT = ("Core", "WebRTC") @@ -9805,11 +9573,10 @@ index 1941c11..f804531 100644 with Files('rlbox_wasm2c_sandbox/**'): BUG_COMPONENT = ('Firefox Build System', 'General') -diff --git a/third_party/pipewire/libpipewire/mozpipewire.cpp b/third_party/pipewire/libpipewire/mozpipewire.cpp -index 1ecfc31..fbeeb8e 100644 ---- a/third_party/pipewire/libpipewire/mozpipewire.cpp -+++ b/third_party/pipewire/libpipewire/mozpipewire.cpp -@@ -69,11 +69,13 @@ static int (*pw_stream_connect_fn)(struct pw_stream *stream, +diff -up firefox-101.0/third_party/pipewire/libpipewire/mozpipewire.cpp.libwebrtc-screen-cast-sync firefox-101.0/third_party/pipewire/libpipewire/mozpipewire.cpp +--- firefox-101.0/third_party/pipewire/libpipewire/mozpipewire.cpp.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 ++++ firefox-101.0/third_party/pipewire/libpipewire/mozpipewire.cpp 2022-05-30 21:33:19.745522210 +0200 +@@ -69,11 +69,13 @@ static int (*pw_stream_connect_fn)(struc enum pw_stream_flags flags, const struct spa_pod **params, uint32_t n_params); @@ -9823,7 +9590,7 @@ index 1ecfc31..fbeeb8e 100644 static int (*pw_stream_queue_buffer_fn)(struct pw_stream *stream, struct pw_buffer *buffer); static int (*pw_stream_update_params_fn)(struct pw_stream *stream, -@@ -87,7 +89,10 @@ static int (*pw_thread_loop_start_fn)(struct pw_thread_loop *loop); +@@ -87,7 +89,10 @@ static int (*pw_thread_loop_start_fn)(st static void (*pw_thread_loop_stop_fn)(struct pw_thread_loop *loop); static void (*pw_thread_loop_lock_fn)(struct pw_thread_loop *loop); static void (*pw_thread_loop_unlock_fn)(struct pw_thread_loop *loop); @@ -9873,7 +9640,7 @@ index 1ecfc31..fbeeb8e 100644 } return IsPwLibraryLoaded(); -@@ -242,6 +255,15 @@ pw_stream_connect(struct pw_stream *stream, +@@ -242,6 +255,15 @@ pw_stream_connect(struct pw_stream *stre params, n_params); } @@ -9889,7 +9656,7 @@ index 1ecfc31..fbeeb8e 100644 struct pw_buffer * pw_stream_dequeue_buffer(struct pw_stream *stream) { -@@ -356,6 +378,23 @@ pw_thread_loop_unlock(struct pw_thread_loop *loop) +@@ -356,6 +378,23 @@ pw_thread_loop_unlock(struct pw_thread_l return pw_thread_loop_unlock_fn(loop); } @@ -9913,7 +9680,7 @@ index 1ecfc31..fbeeb8e 100644 struct pw_properties * pw_properties_new_string(const char *str) -@@ -366,3 +405,12 @@ pw_properties_new_string(const char *str) +@@ -366,3 +405,12 @@ pw_properties_new_string(const char *str return pw_properties_new_string_fn(str); } diff --git a/mozilla-1663844.patch b/mozilla-1663844.patch index 6c2392f..d356425 100644 --- a/mozilla-1663844.patch +++ b/mozilla-1663844.patch @@ -1,6 +1,6 @@ -diff -up firefox-84.0/dom/media/gmp/GMPSharedMemManager.h.1663844 firefox-84.0/dom/media/gmp/GMPSharedMemManager.h ---- firefox-84.0/dom/media/gmp/GMPSharedMemManager.h.1663844 2020-12-07 23:32:59.000000000 +0100 -+++ firefox-84.0/dom/media/gmp/GMPSharedMemManager.h 2020-12-10 12:59:39.287832851 +0100 +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 @@ -10,22 +10,21 @@ diff -up firefox-84.0/dom/media/gmp/GMPSharedMemManager.h.1663844 firefox-84.0/d GMPSharedMem() { for (size_t i = 0; i < sizeof(mGmpAllocated) / sizeof(mGmpAllocated[0]); -diff -up firefox-84.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp.1663844 firefox-84.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp ---- firefox-84.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp.1663844 2020-12-10 12:59:39.287832851 +0100 -+++ firefox-84.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp 2020-12-10 14:05:00.833685947 +0100 -@@ -82,7 +82,7 @@ bool GMPDecoderModule::SupportsMimeType( +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 - bool GMPDecoderModule::SupportsMimeType( - const nsACString& aMimeType, DecoderDoctorDiagnostics* aDiagnostics) const { -- return false; -+ return MP4Decoder::IsH264(aMimeType); - } + nsCString api = nsLiteralCString(CHROMIUM_CDM_API); - /* static */ -diff -up firefox-84.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp.1663844 firefox-84.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp ---- firefox-84.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp.1663844 2020-12-08 00:35:04.000000000 +0100 -+++ firefox-84.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp 2020-12-10 12:59:39.287832851 +0100 -@@ -67,6 +67,8 @@ void GMPVideoDecoder::Decoded(GMPVideoi4 ++ // 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 self = this; if (v) { mDecodedData.AppendElement(std::move(v)); diff --git a/sources b/sources index 381f526..39a05eb 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = b9ab1498be90ecf60822df7021f8812f124550d97f8cd687c69d3ab56fc5fb714bfe88c78c978a1794d211724909a9a5cad6a4b483fa05f762909c45d5075520 SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (firefox-100.0.2.source.tar.xz) = 6d9922e35e496fa63833ba03d1466e075287e40e50854ddc4f4a2036d9c7ca1f35c03bc6f708a3c469e0ec3b389b3346ac754bb84df0fecb86955fc21c05e00f -SHA512 (firefox-langpacks-100.0.2-20220520.tar.xz) = 12ce91a452cef7937c6b25623a00fa2d2aedea3b7856bbbd3c0ee2cf08f55d525aa5e2b91d11e265b58f4b4505930d99b7a5d295d9cd92839ada3e3850e181af +SHA512 (firefox-101.0.source.tar.xz) = fffe7e0940c1443fcdc5b205677764cb4e04b29f33fcfafb2857d383700584f309806b81fc4989efb56cc12a3cca1ff7d451b647050c43e98777b5c952ed5d56 +SHA512 (firefox-langpacks-101.0-20220530.tar.xz) = aa81113b6aef965aa17921d563759da6c499021b6f471369d998c35802f72e79a107080b4df59ca51dae15ac464176f23bce2fc84942f5852e810d963553b687 From 3ef84c7bac2f30d5530fd5bec95d8d1da5be1fd8 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 2 Jun 2022 14:15:48 +0200 Subject: [PATCH 052/545] Updated WebRTC patch --- libwebrtc-screen-cast-sync.patch | 3035 ++++++++++++++++-------------- 1 file changed, 1628 insertions(+), 1407 deletions(-) diff --git a/libwebrtc-screen-cast-sync.patch b/libwebrtc-screen-cast-sync.patch index fab5b5c..157d06e 100644 --- a/libwebrtc-screen-cast-sync.patch +++ b/libwebrtc-screen-cast-sync.patch @@ -1,6 +1,13 @@ -diff -up firefox-101.0/dom/media/webrtc/third_party_build/moz.build.libwebrtc-screen-cast-sync firefox-101.0/dom/media/webrtc/third_party_build/moz.build ---- firefox-101.0/dom/media/webrtc/third_party_build/moz.build.libwebrtc-screen-cast-sync 2022-05-27 01:16:54.000000000 +0200 -+++ firefox-101.0/dom/media/webrtc/third_party_build/moz.build 2022-05-30 21:33:19.740522043 +0200 +From e0e925da71abb97a60d02716b18faa19a29fada6 Mon Sep 17 00:00:00 2001 +From: Jan Grulich +Date: Mon, 21 Feb 2022 15:34:52 +0100 +Subject: WebRTC - screen cast sync + + +diff --git a/dom/media/webrtc/third_party_build/moz.build b/dom/media/webrtc/third_party_build/moz.build +index e4c7ba7..a42f913 100644 +--- a/dom/media/webrtc/third_party_build/moz.build ++++ b/dom/media/webrtc/third_party_build/moz.build @@ -63,6 +63,8 @@ webrtc_non_unified_sources = [ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": @@ -10,9 +17,1220 @@ diff -up firefox-101.0/dom/media/webrtc/third_party_build/moz.build.libwebrtc-sc GN_DIRS += ["../../../../third_party/libwebrtc"] -diff -up firefox-101.0/third_party/drm/drm/drm_fourcc.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/drm/drm/drm_fourcc.h ---- firefox-101.0/third_party/drm/drm/drm_fourcc.h.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.741522076 +0200 -+++ firefox-101.0/third_party/drm/drm/drm_fourcc.h 2022-05-30 21:33:19.741522076 +0200 +diff --git a/third_party/drm/README b/third_party/drm/README +new file mode 100644 +index 0000000..f68ed10 +--- /dev/null ++++ b/third_party/drm/README +@@ -0,0 +1,4 @@ ++Libdrm is a drm library wrapper needed to build and run Firefox with ++Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/drm). ++ ++libdrm directory stores headers of libdrm needed for build only. +diff --git a/third_party/drm/drm/drm.h b/third_party/drm/drm/drm.h +new file mode 100644 +index 0000000..5e54c3a +--- /dev/null ++++ b/third_party/drm/drm/drm.h +@@ -0,0 +1,1193 @@ ++/* ++ * Header for the Direct Rendering Manager ++ * ++ * Author: Rickard E. (Rik) Faith ++ * ++ * Acknowledgments: ++ * Dec 1999, Richard Henderson , move to generic cmpxchg. ++ */ ++ ++/* ++ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. ++ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. ++ * All rights reserved. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++#ifndef _DRM_H_ ++#define _DRM_H_ ++ ++#if defined(__linux__) ++ ++#include ++#include ++typedef unsigned int drm_handle_t; ++ ++#else /* One of the BSDs */ ++ ++#include ++#include ++#include ++typedef int8_t __s8; ++typedef uint8_t __u8; ++typedef int16_t __s16; ++typedef uint16_t __u16; ++typedef int32_t __s32; ++typedef uint32_t __u32; ++typedef int64_t __s64; ++typedef uint64_t __u64; ++typedef size_t __kernel_size_t; ++typedef unsigned long drm_handle_t; ++ ++#endif ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */ ++#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */ ++#define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */ ++#define DRM_RAM_PERCENT 10 /**< How much system ram can we lock? */ ++ ++#define _DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */ ++#define _DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */ ++#define _DRM_LOCK_IS_HELD(lock) ((lock) & _DRM_LOCK_HELD) ++#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT) ++#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) ++ ++typedef unsigned int drm_context_t; ++typedef unsigned int drm_drawable_t; ++typedef unsigned int drm_magic_t; ++ ++/* ++ * Cliprect. ++ * ++ * \warning: If you change this structure, make sure you change ++ * XF86DRIClipRectRec in the server as well ++ * ++ * \note KW: Actually it's illegal to change either for ++ * backwards-compatibility reasons. ++ */ ++struct drm_clip_rect { ++ unsigned short x1; ++ unsigned short y1; ++ unsigned short x2; ++ unsigned short y2; ++}; ++ ++/* ++ * Drawable information. ++ */ ++struct drm_drawable_info { ++ unsigned int num_rects; ++ struct drm_clip_rect *rects; ++}; ++ ++/* ++ * Texture region, ++ */ ++struct drm_tex_region { ++ unsigned char next; ++ unsigned char prev; ++ unsigned char in_use; ++ unsigned char padding; ++ unsigned int age; ++}; ++ ++/* ++ * Hardware lock. ++ * ++ * The lock structure is a simple cache-line aligned integer. To avoid ++ * processor bus contention on a multiprocessor system, there should not be any ++ * other data stored in the same cache line. ++ */ ++struct drm_hw_lock { ++ __volatile__ unsigned int lock; /**< lock variable */ ++ char padding[60]; /**< Pad to cache line */ ++}; ++ ++/* ++ * DRM_IOCTL_VERSION ioctl argument type. ++ * ++ * \sa drmGetVersion(). ++ */ ++struct drm_version { ++ int version_major; /**< Major version */ ++ int version_minor; /**< Minor version */ ++ int version_patchlevel; /**< Patch level */ ++ __kernel_size_t name_len; /**< Length of name buffer */ ++ char *name; /**< Name of driver */ ++ __kernel_size_t date_len; /**< Length of date buffer */ ++ char *date; /**< User-space buffer to hold date */ ++ __kernel_size_t desc_len; /**< Length of desc buffer */ ++ char *desc; /**< User-space buffer to hold desc */ ++}; ++ ++/* ++ * DRM_IOCTL_GET_UNIQUE ioctl argument type. ++ * ++ * \sa drmGetBusid() and drmSetBusId(). ++ */ ++struct drm_unique { ++ __kernel_size_t unique_len; /**< Length of unique */ ++ char *unique; /**< Unique name for driver instantiation */ ++}; ++ ++struct drm_list { ++ int count; /**< Length of user-space structures */ ++ struct drm_version *version; ++}; ++ ++struct drm_block { ++ int unused; ++}; ++ ++/* ++ * DRM_IOCTL_CONTROL ioctl argument type. ++ * ++ * \sa drmCtlInstHandler() and drmCtlUninstHandler(). ++ */ ++struct drm_control { ++ enum { ++ DRM_ADD_COMMAND, ++ DRM_RM_COMMAND, ++ DRM_INST_HANDLER, ++ DRM_UNINST_HANDLER ++ } func; ++ int irq; ++}; ++ ++/* ++ * Type of memory to map. ++ */ ++enum drm_map_type { ++ _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */ ++ _DRM_REGISTERS = 1, /**< no caching, no core dump */ ++ _DRM_SHM = 2, /**< shared, cached */ ++ _DRM_AGP = 3, /**< AGP/GART */ ++ _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */ ++ _DRM_CONSISTENT = 5 /**< Consistent memory for PCI DMA */ ++}; ++ ++/* ++ * Memory mapping flags. ++ */ ++enum drm_map_flags { ++ _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */ ++ _DRM_READ_ONLY = 0x02, ++ _DRM_LOCKED = 0x04, /**< shared, cached, locked */ ++ _DRM_KERNEL = 0x08, /**< kernel requires access */ ++ _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */ ++ _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */ ++ _DRM_REMOVABLE = 0x40, /**< Removable mapping */ ++ _DRM_DRIVER = 0x80 /**< Managed by driver */ ++}; ++ ++struct drm_ctx_priv_map { ++ unsigned int ctx_id; /**< Context requesting private mapping */ ++ void *handle; /**< Handle of map */ ++}; ++ ++/* ++ * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls ++ * argument type. ++ * ++ * \sa drmAddMap(). ++ */ ++struct drm_map { ++ unsigned long offset; /**< Requested physical address (0 for SAREA)*/ ++ unsigned long size; /**< Requested physical size (bytes) */ ++ enum drm_map_type type; /**< Type of memory to map */ ++ enum drm_map_flags flags; /**< Flags */ ++ void *handle; /**< User-space: "Handle" to pass to mmap() */ ++ /**< Kernel-space: kernel-virtual address */ ++ int mtrr; /**< MTRR slot used */ ++ /* Private data */ ++}; ++ ++/* ++ * DRM_IOCTL_GET_CLIENT ioctl argument type. ++ */ ++struct drm_client { ++ int idx; /**< Which client desired? */ ++ int auth; /**< Is client authenticated? */ ++ unsigned long pid; /**< Process ID */ ++ unsigned long uid; /**< User ID */ ++ unsigned long magic; /**< Magic */ ++ unsigned long iocs; /**< Ioctl count */ ++}; ++ ++enum drm_stat_type { ++ _DRM_STAT_LOCK, ++ _DRM_STAT_OPENS, ++ _DRM_STAT_CLOSES, ++ _DRM_STAT_IOCTLS, ++ _DRM_STAT_LOCKS, ++ _DRM_STAT_UNLOCKS, ++ _DRM_STAT_VALUE, /**< Generic value */ ++ _DRM_STAT_BYTE, /**< Generic byte counter (1024bytes/K) */ ++ _DRM_STAT_COUNT, /**< Generic non-byte counter (1000/k) */ ++ ++ _DRM_STAT_IRQ, /**< IRQ */ ++ _DRM_STAT_PRIMARY, /**< Primary DMA bytes */ ++ _DRM_STAT_SECONDARY, /**< Secondary DMA bytes */ ++ _DRM_STAT_DMA, /**< DMA */ ++ _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */ ++ _DRM_STAT_MISSED /**< Missed DMA opportunity */ ++ /* Add to the *END* of the list */ ++}; ++ ++/* ++ * DRM_IOCTL_GET_STATS ioctl argument type. ++ */ ++struct drm_stats { ++ unsigned long count; ++ struct { ++ unsigned long value; ++ enum drm_stat_type type; ++ } data[15]; ++}; ++ ++/* ++ * Hardware locking flags. ++ */ ++enum drm_lock_flags { ++ _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */ ++ _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */ ++ _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */ ++ _DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */ ++ /* These *HALT* flags aren't supported yet ++ -- they will be used to support the ++ full-screen DGA-like mode. */ ++ _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */ ++ _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ ++}; ++ ++/* ++ * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type. ++ * ++ * \sa drmGetLock() and drmUnlock(). ++ */ ++struct drm_lock { ++ int context; ++ enum drm_lock_flags flags; ++}; ++ ++/* ++ * DMA flags ++ * ++ * \warning ++ * These values \e must match xf86drm.h. ++ * ++ * \sa drm_dma. ++ */ ++enum drm_dma_flags { ++ /* Flags for DMA buffer dispatch */ ++ _DRM_DMA_BLOCK = 0x01, /**< ++ * Block until buffer dispatched. ++ * ++ * \note The buffer may not yet have ++ * been processed by the hardware -- ++ * getting a hardware lock with the ++ * hardware quiescent will ensure ++ * that the buffer has been ++ * processed. ++ */ ++ _DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */ ++ _DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */ ++ ++ /* Flags for DMA buffer request */ ++ _DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */ ++ _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */ ++ _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ ++}; ++ ++/* ++ * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type. ++ * ++ * \sa drmAddBufs(). ++ */ ++struct drm_buf_desc { ++ int count; /**< Number of buffers of this size */ ++ int size; /**< Size in bytes */ ++ int low_mark; /**< Low water mark */ ++ int high_mark; /**< High water mark */ ++ enum { ++ _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */ ++ _DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */ ++ _DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */ ++ _DRM_FB_BUFFER = 0x08, /**< Buffer is in frame buffer */ ++ _DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */ ++ } flags; ++ unsigned long agp_start; /**< ++ * Start address of where the AGP buffers are ++ * in the AGP aperture ++ */ ++}; ++ ++/* ++ * DRM_IOCTL_INFO_BUFS ioctl argument type. ++ */ ++struct drm_buf_info { ++ int count; /**< Entries in list */ ++ struct drm_buf_desc *list; ++}; ++ ++/* ++ * DRM_IOCTL_FREE_BUFS ioctl argument type. ++ */ ++struct drm_buf_free { ++ int count; ++ int *list; ++}; ++ ++/* ++ * Buffer information ++ * ++ * \sa drm_buf_map. ++ */ ++struct drm_buf_pub { ++ int idx; /**< Index into the master buffer list */ ++ int total; /**< Buffer size */ ++ int used; /**< Amount of buffer in use (for DMA) */ ++ void *address; /**< Address of buffer */ ++}; ++ ++/* ++ * DRM_IOCTL_MAP_BUFS ioctl argument type. ++ */ ++struct drm_buf_map { ++ int count; /**< Length of the buffer list */ ++#ifdef __cplusplus ++ void *virt; ++#else ++ void *virtual; /**< Mmap'd area in user-virtual */ ++#endif ++ struct drm_buf_pub *list; /**< Buffer information */ ++}; ++ ++/* ++ * DRM_IOCTL_DMA ioctl argument type. ++ * ++ * Indices here refer to the offset into the buffer list in drm_buf_get. ++ * ++ * \sa drmDMA(). ++ */ ++struct drm_dma { ++ int context; /**< Context handle */ ++ int send_count; /**< Number of buffers to send */ ++ int *send_indices; /**< List of handles to buffers */ ++ int *send_sizes; /**< Lengths of data to send */ ++ enum drm_dma_flags flags; /**< Flags */ ++ int request_count; /**< Number of buffers requested */ ++ int request_size; /**< Desired size for buffers */ ++ int *request_indices; /**< Buffer information */ ++ int *request_sizes; ++ int granted_count; /**< Number of buffers granted */ ++}; ++ ++enum drm_ctx_flags { ++ _DRM_CONTEXT_PRESERVED = 0x01, ++ _DRM_CONTEXT_2DONLY = 0x02 ++}; ++ ++/* ++ * DRM_IOCTL_ADD_CTX ioctl argument type. ++ * ++ * \sa drmCreateContext() and drmDestroyContext(). ++ */ ++struct drm_ctx { ++ drm_context_t handle; ++ enum drm_ctx_flags flags; ++}; ++ ++/* ++ * DRM_IOCTL_RES_CTX ioctl argument type. ++ */ ++struct drm_ctx_res { ++ int count; ++ struct drm_ctx *contexts; ++}; ++ ++/* ++ * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type. ++ */ ++struct drm_draw { ++ drm_drawable_t handle; ++}; ++ ++/* ++ * DRM_IOCTL_UPDATE_DRAW ioctl argument type. ++ */ ++typedef enum { ++ DRM_DRAWABLE_CLIPRECTS ++} drm_drawable_info_type_t; ++ ++struct drm_update_draw { ++ drm_drawable_t handle; ++ unsigned int type; ++ unsigned int num; ++ unsigned long long data; ++}; ++ ++/* ++ * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type. ++ */ ++struct drm_auth { ++ drm_magic_t magic; ++}; ++ ++/* ++ * DRM_IOCTL_IRQ_BUSID ioctl argument type. ++ * ++ * \sa drmGetInterruptFromBusID(). ++ */ ++struct drm_irq_busid { ++ int irq; /**< IRQ number */ ++ int busnum; /**< bus number */ ++ int devnum; /**< device number */ ++ int funcnum; /**< function number */ ++}; ++ ++enum drm_vblank_seq_type { ++ _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ ++ _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ ++ /* bits 1-6 are reserved for high crtcs */ ++ _DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e, ++ _DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */ ++ _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ ++ _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ ++ _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ ++ _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking, unsupported */ ++}; ++#define _DRM_VBLANK_HIGH_CRTC_SHIFT 1 ++ ++#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE) ++#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \ ++ _DRM_VBLANK_SECONDARY | _DRM_VBLANK_NEXTONMISS) ++ ++struct drm_wait_vblank_request { ++ enum drm_vblank_seq_type type; ++ unsigned int sequence; ++ unsigned long signal; ++}; ++ ++struct drm_wait_vblank_reply { ++ enum drm_vblank_seq_type type; ++ unsigned int sequence; ++ long tval_sec; ++ long tval_usec; ++}; ++ ++/* ++ * DRM_IOCTL_WAIT_VBLANK ioctl argument type. ++ * ++ * \sa drmWaitVBlank(). ++ */ ++union drm_wait_vblank { ++ struct drm_wait_vblank_request request; ++ struct drm_wait_vblank_reply reply; ++}; ++ ++#define _DRM_PRE_MODESET 1 ++#define _DRM_POST_MODESET 2 ++ ++/* ++ * DRM_IOCTL_MODESET_CTL ioctl argument type ++ * ++ * \sa drmModesetCtl(). ++ */ ++struct drm_modeset_ctl { ++ __u32 crtc; ++ __u32 cmd; ++}; ++ ++/* ++ * DRM_IOCTL_AGP_ENABLE ioctl argument type. ++ * ++ * \sa drmAgpEnable(). ++ */ ++struct drm_agp_mode { ++ unsigned long mode; /**< AGP mode */ ++}; ++ ++/* ++ * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type. ++ * ++ * \sa drmAgpAlloc() and drmAgpFree(). ++ */ ++struct drm_agp_buffer { ++ unsigned long size; /**< In bytes -- will round to page boundary */ ++ unsigned long handle; /**< Used for binding / unbinding */ ++ unsigned long type; /**< Type of memory to allocate */ ++ unsigned long physical; /**< Physical used by i810 */ ++}; ++ ++/* ++ * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type. ++ * ++ * \sa drmAgpBind() and drmAgpUnbind(). ++ */ ++struct drm_agp_binding { ++ unsigned long handle; /**< From drm_agp_buffer */ ++ unsigned long offset; /**< In bytes -- will round to page boundary */ ++}; ++ ++/* ++ * DRM_IOCTL_AGP_INFO ioctl argument type. ++ * ++ * \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(), ++ * drmAgpBase(), drmAgpSize(), drmAgpMemoryUsed(), drmAgpMemoryAvail(), ++ * drmAgpVendorId() and drmAgpDeviceId(). ++ */ ++struct drm_agp_info { ++ int agp_version_major; ++ int agp_version_minor; ++ unsigned long mode; ++ unsigned long aperture_base; /* physical address */ ++ unsigned long aperture_size; /* bytes */ ++ unsigned long memory_allowed; /* bytes */ ++ unsigned long memory_used; ++ ++ /* PCI information */ ++ unsigned short id_vendor; ++ unsigned short id_device; ++}; ++ ++/* ++ * DRM_IOCTL_SG_ALLOC ioctl argument type. ++ */ ++struct drm_scatter_gather { ++ unsigned long size; /**< In bytes -- will round to page boundary */ ++ unsigned long handle; /**< Used for mapping / unmapping */ ++}; ++ ++/* ++ * DRM_IOCTL_SET_VERSION ioctl argument type. ++ */ ++struct drm_set_version { ++ int drm_di_major; ++ int drm_di_minor; ++ int drm_dd_major; ++ int drm_dd_minor; ++}; ++ ++/* DRM_IOCTL_GEM_CLOSE ioctl argument type */ ++struct drm_gem_close { ++ /** Handle of the object to be closed. */ ++ __u32 handle; ++ __u32 pad; ++}; ++ ++/* DRM_IOCTL_GEM_FLINK ioctl argument type */ ++struct drm_gem_flink { ++ /** Handle for the object being named */ ++ __u32 handle; ++ ++ /** Returned global name */ ++ __u32 name; ++}; ++ ++/* DRM_IOCTL_GEM_OPEN ioctl argument type */ ++struct drm_gem_open { ++ /** Name of object being opened */ ++ __u32 name; ++ ++ /** Returned handle for the object */ ++ __u32 handle; ++ ++ /** Returned size of the object */ ++ __u64 size; ++}; ++ ++/** ++ * DRM_CAP_DUMB_BUFFER ++ * ++ * If set to 1, the driver supports creating dumb buffers via the ++ * &DRM_IOCTL_MODE_CREATE_DUMB ioctl. ++ */ ++#define DRM_CAP_DUMB_BUFFER 0x1 ++/** ++ * DRM_CAP_VBLANK_HIGH_CRTC ++ * ++ * If set to 1, the kernel supports specifying a :ref:`CRTC index` ++ * in the high bits of &drm_wait_vblank_request.type. ++ * ++ * Starting kernel version 2.6.39, this capability is always set to 1. ++ */ ++#define DRM_CAP_VBLANK_HIGH_CRTC 0x2 ++/** ++ * DRM_CAP_DUMB_PREFERRED_DEPTH ++ * ++ * The preferred bit depth for dumb buffers. ++ * ++ * The bit depth is the number of bits used to indicate the color of a single ++ * pixel excluding any padding. This is different from the number of bits per ++ * pixel. For instance, XRGB8888 has a bit depth of 24 but has 32 bits per ++ * pixel. ++ * ++ * Note that this preference only applies to dumb buffers, it's irrelevant for ++ * other types of buffers. ++ */ ++#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3 ++/** ++ * DRM_CAP_DUMB_PREFER_SHADOW ++ * ++ * If set to 1, the driver prefers userspace to render to a shadow buffer ++ * instead of directly rendering to a dumb buffer. For best speed, userspace ++ * should do streaming ordered memory copies into the dumb buffer and never ++ * read from it. ++ * ++ * Note that this preference only applies to dumb buffers, it's irrelevant for ++ * other types of buffers. ++ */ ++#define DRM_CAP_DUMB_PREFER_SHADOW 0x4 ++/** ++ * DRM_CAP_PRIME ++ * ++ * Bitfield of supported PRIME sharing capabilities. See &DRM_PRIME_CAP_IMPORT ++ * and &DRM_PRIME_CAP_EXPORT. ++ * ++ * PRIME buffers are exposed as dma-buf file descriptors. See ++ * Documentation/gpu/drm-mm.rst, section "PRIME Buffer Sharing". ++ */ ++#define DRM_CAP_PRIME 0x5 ++/** ++ * DRM_PRIME_CAP_IMPORT ++ * ++ * If this bit is set in &DRM_CAP_PRIME, the driver supports importing PRIME ++ * buffers via the &DRM_IOCTL_PRIME_FD_TO_HANDLE ioctl. ++ */ ++#define DRM_PRIME_CAP_IMPORT 0x1 ++/** ++ * DRM_PRIME_CAP_EXPORT ++ * ++ * If this bit is set in &DRM_CAP_PRIME, the driver supports exporting PRIME ++ * buffers via the &DRM_IOCTL_PRIME_HANDLE_TO_FD ioctl. ++ */ ++#define DRM_PRIME_CAP_EXPORT 0x2 ++/** ++ * DRM_CAP_TIMESTAMP_MONOTONIC ++ * ++ * If set to 0, the kernel will report timestamps with ``CLOCK_REALTIME`` in ++ * struct drm_event_vblank. If set to 1, the kernel will report timestamps with ++ * ``CLOCK_MONOTONIC``. See ``clock_gettime(2)`` for the definition of these ++ * clocks. ++ * ++ * Starting from kernel version 2.6.39, the default value for this capability ++ * is 1. Starting kernel version 4.15, this capability is always set to 1. ++ */ ++#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 ++/** ++ * DRM_CAP_ASYNC_PAGE_FLIP ++ * ++ * If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC. ++ */ ++#define DRM_CAP_ASYNC_PAGE_FLIP 0x7 ++/** ++ * DRM_CAP_CURSOR_WIDTH ++ * ++ * The ``CURSOR_WIDTH`` and ``CURSOR_HEIGHT`` capabilities return a valid ++ * width x height combination for the hardware cursor. The intention is that a ++ * hardware agnostic userspace can query a cursor plane size to use. ++ * ++ * Note that the cross-driver contract is to merely return a valid size; ++ * drivers are free to attach another meaning on top, eg. i915 returns the ++ * maximum plane size. ++ */ ++#define DRM_CAP_CURSOR_WIDTH 0x8 ++/** ++ * DRM_CAP_CURSOR_HEIGHT ++ * ++ * See &DRM_CAP_CURSOR_WIDTH. ++ */ ++#define DRM_CAP_CURSOR_HEIGHT 0x9 ++/** ++ * DRM_CAP_ADDFB2_MODIFIERS ++ * ++ * If set to 1, the driver supports supplying modifiers in the ++ * &DRM_IOCTL_MODE_ADDFB2 ioctl. ++ */ ++#define DRM_CAP_ADDFB2_MODIFIERS 0x10 ++/** ++ * DRM_CAP_PAGE_FLIP_TARGET ++ * ++ * If set to 1, the driver supports the &DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE and ++ * &DRM_MODE_PAGE_FLIP_TARGET_RELATIVE flags in ++ * &drm_mode_crtc_page_flip_target.flags for the &DRM_IOCTL_MODE_PAGE_FLIP ++ * ioctl. ++ */ ++#define DRM_CAP_PAGE_FLIP_TARGET 0x11 ++/** ++ * DRM_CAP_CRTC_IN_VBLANK_EVENT ++ * ++ * If set to 1, the kernel supports reporting the CRTC ID in ++ * &drm_event_vblank.crtc_id for the &DRM_EVENT_VBLANK and ++ * &DRM_EVENT_FLIP_COMPLETE events. ++ * ++ * Starting kernel version 4.12, this capability is always set to 1. ++ */ ++#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12 ++/** ++ * DRM_CAP_SYNCOBJ ++ * ++ * If set to 1, the driver supports sync objects. See ++ * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects". ++ */ ++#define DRM_CAP_SYNCOBJ 0x13 ++/** ++ * DRM_CAP_SYNCOBJ_TIMELINE ++ * ++ * If set to 1, the driver supports timeline operations on sync objects. See ++ * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects". ++ */ ++#define DRM_CAP_SYNCOBJ_TIMELINE 0x14 ++ ++/* DRM_IOCTL_GET_CAP ioctl argument type */ ++struct drm_get_cap { ++ __u64 capability; ++ __u64 value; ++}; ++ ++/** ++ * DRM_CLIENT_CAP_STEREO_3D ++ * ++ * If set to 1, the DRM core will expose the stereo 3D capabilities of the ++ * monitor by advertising the supported 3D layouts in the flags of struct ++ * drm_mode_modeinfo. See ``DRM_MODE_FLAG_3D_*``. ++ * ++ * This capability is always supported for all drivers starting from kernel ++ * version 3.13. ++ */ ++#define DRM_CLIENT_CAP_STEREO_3D 1 ++ ++/** ++ * DRM_CLIENT_CAP_UNIVERSAL_PLANES ++ * ++ * If set to 1, the DRM core will expose all planes (overlay, primary, and ++ * cursor) to userspace. ++ * ++ * This capability has been introduced in kernel version 3.15. Starting from ++ * kernel version 3.17, this capability is always supported for all drivers. ++ */ ++#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2 ++ ++/** ++ * DRM_CLIENT_CAP_ATOMIC ++ * ++ * If set to 1, the DRM core will expose atomic properties to userspace. This ++ * implicitly enables &DRM_CLIENT_CAP_UNIVERSAL_PLANES and ++ * &DRM_CLIENT_CAP_ASPECT_RATIO. ++ * ++ * If the driver doesn't support atomic mode-setting, enabling this capability ++ * will fail with -EOPNOTSUPP. ++ * ++ * This capability has been introduced in kernel version 4.0. Starting from ++ * kernel version 4.2, this capability is always supported for atomic-capable ++ * drivers. ++ */ ++#define DRM_CLIENT_CAP_ATOMIC 3 ++ ++/** ++ * DRM_CLIENT_CAP_ASPECT_RATIO ++ * ++ * If set to 1, the DRM core will provide aspect ratio information in modes. ++ * See ``DRM_MODE_FLAG_PIC_AR_*``. ++ * ++ * This capability is always supported for all drivers starting from kernel ++ * version 4.18. ++ */ ++#define DRM_CLIENT_CAP_ASPECT_RATIO 4 ++ ++/** ++ * DRM_CLIENT_CAP_WRITEBACK_CONNECTORS ++ * ++ * If set to 1, the DRM core will expose special connectors to be used for ++ * writing back to memory the scene setup in the commit. The client must enable ++ * &DRM_CLIENT_CAP_ATOMIC first. ++ * ++ * This capability is always supported for atomic-capable drivers starting from ++ * kernel version 4.19. ++ */ ++#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5 ++ ++/* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ ++struct drm_set_client_cap { ++ __u64 capability; ++ __u64 value; ++}; ++ ++#define DRM_RDWR O_RDWR ++#define DRM_CLOEXEC O_CLOEXEC ++struct drm_prime_handle { ++ __u32 handle; ++ ++ /** Flags.. only applicable for handle->fd */ ++ __u32 flags; ++ ++ /** Returned dmabuf file descriptor */ ++ __s32 fd; ++}; ++ ++struct drm_syncobj_create { ++ __u32 handle; ++#define DRM_SYNCOBJ_CREATE_SIGNALED (1 << 0) ++ __u32 flags; ++}; ++ ++struct drm_syncobj_destroy { ++ __u32 handle; ++ __u32 pad; ++}; ++ ++#define DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE (1 << 0) ++#define DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_EXPORT_SYNC_FILE (1 << 0) ++struct drm_syncobj_handle { ++ __u32 handle; ++ __u32 flags; ++ ++ __s32 fd; ++ __u32 pad; ++}; ++ ++struct drm_syncobj_transfer { ++ __u32 src_handle; ++ __u32 dst_handle; ++ __u64 src_point; ++ __u64 dst_point; ++ __u32 flags; ++ __u32 pad; ++}; ++ ++#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0) ++#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1) ++#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE (1 << 2) /* wait for time point to become available */ ++struct drm_syncobj_wait { ++ __u64 handles; ++ /* absolute timeout */ ++ __s64 timeout_nsec; ++ __u32 count_handles; ++ __u32 flags; ++ __u32 first_signaled; /* only valid when not waiting all */ ++ __u32 pad; ++}; ++ ++struct drm_syncobj_timeline_wait { ++ __u64 handles; ++ /* wait on specific timeline point for every handles*/ ++ __u64 points; ++ /* absolute timeout */ ++ __s64 timeout_nsec; ++ __u32 count_handles; ++ __u32 flags; ++ __u32 first_signaled; /* only valid when not waiting all */ ++ __u32 pad; ++}; ++ ++ ++struct drm_syncobj_array { ++ __u64 handles; ++ __u32 count_handles; ++ __u32 pad; ++}; ++ ++#define DRM_SYNCOBJ_QUERY_FLAGS_LAST_SUBMITTED (1 << 0) /* last available point on timeline syncobj */ ++struct drm_syncobj_timeline_array { ++ __u64 handles; ++ __u64 points; ++ __u32 count_handles; ++ __u32 flags; ++}; ++ ++ ++/* Query current scanout sequence number */ ++struct drm_crtc_get_sequence { ++ __u32 crtc_id; /* requested crtc_id */ ++ __u32 active; /* return: crtc output is active */ ++ __u64 sequence; /* return: most recent vblank sequence */ ++ __s64 sequence_ns; /* return: most recent time of first pixel out */ ++}; ++ ++/* Queue event to be delivered at specified sequence. Time stamp marks ++ * when the first pixel of the refresh cycle leaves the display engine ++ * for the display ++ */ ++#define DRM_CRTC_SEQUENCE_RELATIVE 0x00000001 /* sequence is relative to current */ ++#define DRM_CRTC_SEQUENCE_NEXT_ON_MISS 0x00000002 /* Use next sequence if we've missed */ ++ ++struct drm_crtc_queue_sequence { ++ __u32 crtc_id; ++ __u32 flags; ++ __u64 sequence; /* on input, target sequence. on output, actual sequence */ ++ __u64 user_data; /* user data passed to event */ ++}; ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#include "drm_mode.h" ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++#define DRM_IOCTL_BASE 'd' ++#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr) ++#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type) ++#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type) ++#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type) ++ ++#define DRM_IOCTL_VERSION DRM_IOWR(0x00, struct drm_version) ++#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, struct drm_unique) ++#define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, struct drm_auth) ++#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, struct drm_irq_busid) ++#define DRM_IOCTL_GET_MAP DRM_IOWR(0x04, struct drm_map) ++#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client) ++#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats) ++#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version) ++#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl) ++#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close) ++#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink) ++#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open) ++#define DRM_IOCTL_GET_CAP DRM_IOWR(0x0c, struct drm_get_cap) ++#define DRM_IOCTL_SET_CLIENT_CAP DRM_IOW( 0x0d, struct drm_set_client_cap) ++ ++#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique) ++#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth) ++#define DRM_IOCTL_BLOCK DRM_IOWR(0x12, struct drm_block) ++#define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, struct drm_block) ++#define DRM_IOCTL_CONTROL DRM_IOW( 0x14, struct drm_control) ++#define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, struct drm_map) ++#define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, struct drm_buf_desc) ++#define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, struct drm_buf_desc) ++#define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, struct drm_buf_info) ++#define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, struct drm_buf_map) ++#define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, struct drm_buf_free) ++ ++#define DRM_IOCTL_RM_MAP DRM_IOW( 0x1b, struct drm_map) ++ ++#define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, struct drm_ctx_priv_map) ++#define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, struct drm_ctx_priv_map) ++ ++#define DRM_IOCTL_SET_MASTER DRM_IO(0x1e) ++#define DRM_IOCTL_DROP_MASTER DRM_IO(0x1f) ++ ++#define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, struct drm_ctx) ++#define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, struct drm_ctx) ++#define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, struct drm_ctx) ++#define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, struct drm_ctx) ++#define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, struct drm_ctx) ++#define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, struct drm_ctx) ++#define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, struct drm_ctx_res) ++#define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, struct drm_draw) ++#define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, struct drm_draw) ++#define DRM_IOCTL_DMA DRM_IOWR(0x29, struct drm_dma) ++#define DRM_IOCTL_LOCK DRM_IOW( 0x2a, struct drm_lock) ++#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock) ++#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock) ++ ++#define DRM_IOCTL_PRIME_HANDLE_TO_FD DRM_IOWR(0x2d, struct drm_prime_handle) ++#define DRM_IOCTL_PRIME_FD_TO_HANDLE DRM_IOWR(0x2e, struct drm_prime_handle) ++ ++#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30) ++#define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31) ++#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode) ++#define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, struct drm_agp_info) ++#define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, struct drm_agp_buffer) ++#define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, struct drm_agp_buffer) ++#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding) ++#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding) ++ ++#define DRM_IOCTL_SG_ALLOC DRM_IOWR(0x38, struct drm_scatter_gather) ++#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather) ++ ++#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank) ++ ++#define DRM_IOCTL_CRTC_GET_SEQUENCE DRM_IOWR(0x3b, struct drm_crtc_get_sequence) ++#define DRM_IOCTL_CRTC_QUEUE_SEQUENCE DRM_IOWR(0x3c, struct drm_crtc_queue_sequence) ++ ++#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw) ++ ++#define DRM_IOCTL_MODE_GETRESOURCES DRM_IOWR(0xA0, struct drm_mode_card_res) ++#define DRM_IOCTL_MODE_GETCRTC DRM_IOWR(0xA1, struct drm_mode_crtc) ++#define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA2, struct drm_mode_crtc) ++#define DRM_IOCTL_MODE_CURSOR DRM_IOWR(0xA3, struct drm_mode_cursor) ++#define DRM_IOCTL_MODE_GETGAMMA DRM_IOWR(0xA4, struct drm_mode_crtc_lut) ++#define DRM_IOCTL_MODE_SETGAMMA DRM_IOWR(0xA5, struct drm_mode_crtc_lut) ++#define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xA6, struct drm_mode_get_encoder) ++#define DRM_IOCTL_MODE_GETCONNECTOR DRM_IOWR(0xA7, struct drm_mode_get_connector) ++#define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA8, struct drm_mode_mode_cmd) /* deprecated (never worked) */ ++#define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd) /* deprecated (never worked) */ ++ ++#define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAA, struct drm_mode_get_property) ++#define DRM_IOCTL_MODE_SETPROPERTY DRM_IOWR(0xAB, struct drm_mode_connector_set_property) ++#define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, struct drm_mode_get_blob) ++#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd) ++#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd) ++/** ++ * DRM_IOCTL_MODE_RMFB - Remove a framebuffer. ++ * ++ * This removes a framebuffer previously added via ADDFB/ADDFB2. The IOCTL ++ * argument is a framebuffer object ID. ++ * ++ * Warning: removing a framebuffer currently in-use on an enabled plane will ++ * disable that plane. The CRTC the plane is linked to may also be disabled ++ * (depending on driver capabilities). ++ */ ++#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int) ++#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip) ++#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd) ++ ++#define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb) ++#define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, struct drm_mode_map_dumb) ++#define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, struct drm_mode_destroy_dumb) ++#define DRM_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xB5, struct drm_mode_get_plane_res) ++#define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane) ++#define DRM_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct drm_mode_set_plane) ++#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2) ++#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties) ++#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property) ++#define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2) ++#define DRM_IOCTL_MODE_ATOMIC DRM_IOWR(0xBC, struct drm_mode_atomic) ++#define DRM_IOCTL_MODE_CREATEPROPBLOB DRM_IOWR(0xBD, struct drm_mode_create_blob) ++#define DRM_IOCTL_MODE_DESTROYPROPBLOB DRM_IOWR(0xBE, struct drm_mode_destroy_blob) ++ ++#define DRM_IOCTL_SYNCOBJ_CREATE DRM_IOWR(0xBF, struct drm_syncobj_create) ++#define DRM_IOCTL_SYNCOBJ_DESTROY DRM_IOWR(0xC0, struct drm_syncobj_destroy) ++#define DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD DRM_IOWR(0xC1, struct drm_syncobj_handle) ++#define DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE DRM_IOWR(0xC2, struct drm_syncobj_handle) ++#define DRM_IOCTL_SYNCOBJ_WAIT DRM_IOWR(0xC3, struct drm_syncobj_wait) ++#define DRM_IOCTL_SYNCOBJ_RESET DRM_IOWR(0xC4, struct drm_syncobj_array) ++#define DRM_IOCTL_SYNCOBJ_SIGNAL DRM_IOWR(0xC5, struct drm_syncobj_array) ++ ++#define DRM_IOCTL_MODE_CREATE_LEASE DRM_IOWR(0xC6, struct drm_mode_create_lease) ++#define DRM_IOCTL_MODE_LIST_LESSEES DRM_IOWR(0xC7, struct drm_mode_list_lessees) ++#define DRM_IOCTL_MODE_GET_LEASE DRM_IOWR(0xC8, struct drm_mode_get_lease) ++#define DRM_IOCTL_MODE_REVOKE_LEASE DRM_IOWR(0xC9, struct drm_mode_revoke_lease) ++ ++#define DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT DRM_IOWR(0xCA, struct drm_syncobj_timeline_wait) ++#define DRM_IOCTL_SYNCOBJ_QUERY DRM_IOWR(0xCB, struct drm_syncobj_timeline_array) ++#define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer) ++#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct drm_syncobj_timeline_array) ++ ++#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2) ++ ++/* ++ * Device specific ioctls should only be in their respective headers ++ * The device specific ioctl range is from 0x40 to 0x9f. ++ * Generic IOCTLS restart at 0xA0. ++ * ++ * \sa drmCommandNone(), drmCommandRead(), drmCommandWrite(), and ++ * drmCommandReadWrite(). ++ */ ++#define DRM_COMMAND_BASE 0x40 ++#define DRM_COMMAND_END 0xA0 ++ ++/* ++ * Header for events written back to userspace on the drm fd. The ++ * type defines the type of event, the length specifies the total ++ * length of the event (including the header), and user_data is ++ * typically a 64 bit value passed with the ioctl that triggered the ++ * event. A read on the drm fd will always only return complete ++ * events, that is, if for example the read buffer is 100 bytes, and ++ * there are two 64 byte events pending, only one will be returned. ++ * ++ * Event types 0 - 0x7fffffff are generic drm events, 0x80000000 and ++ * up are chipset specific. ++ */ ++struct drm_event { ++ __u32 type; ++ __u32 length; ++}; ++ ++#define DRM_EVENT_VBLANK 0x01 ++#define DRM_EVENT_FLIP_COMPLETE 0x02 ++#define DRM_EVENT_CRTC_SEQUENCE 0x03 ++ ++struct drm_event_vblank { ++ struct drm_event base; ++ __u64 user_data; ++ __u32 tv_sec; ++ __u32 tv_usec; ++ __u32 sequence; ++ __u32 crtc_id; /* 0 on older kernels that do not support this */ ++}; ++ ++/* Event delivered at sequence. Time stamp marks when the first pixel ++ * of the refresh cycle leaves the display engine for the display ++ */ ++struct drm_event_crtc_sequence { ++ struct drm_event base; ++ __u64 user_data; ++ __s64 time_ns; ++ __u64 sequence; ++}; ++ ++/* typedef area */ ++typedef struct drm_clip_rect drm_clip_rect_t; ++typedef struct drm_drawable_info drm_drawable_info_t; ++typedef struct drm_tex_region drm_tex_region_t; ++typedef struct drm_hw_lock drm_hw_lock_t; ++typedef struct drm_version drm_version_t; ++typedef struct drm_unique drm_unique_t; ++typedef struct drm_list drm_list_t; ++typedef struct drm_block drm_block_t; ++typedef struct drm_control drm_control_t; ++typedef enum drm_map_type drm_map_type_t; ++typedef enum drm_map_flags drm_map_flags_t; ++typedef struct drm_ctx_priv_map drm_ctx_priv_map_t; ++typedef struct drm_map drm_map_t; ++typedef struct drm_client drm_client_t; ++typedef enum drm_stat_type drm_stat_type_t; ++typedef struct drm_stats drm_stats_t; ++typedef enum drm_lock_flags drm_lock_flags_t; ++typedef struct drm_lock drm_lock_t; ++typedef enum drm_dma_flags drm_dma_flags_t; ++typedef struct drm_buf_desc drm_buf_desc_t; ++typedef struct drm_buf_info drm_buf_info_t; ++typedef struct drm_buf_free drm_buf_free_t; ++typedef struct drm_buf_pub drm_buf_pub_t; ++typedef struct drm_buf_map drm_buf_map_t; ++typedef struct drm_dma drm_dma_t; ++typedef union drm_wait_vblank drm_wait_vblank_t; ++typedef struct drm_agp_mode drm_agp_mode_t; ++typedef enum drm_ctx_flags drm_ctx_flags_t; ++typedef struct drm_ctx drm_ctx_t; ++typedef struct drm_ctx_res drm_ctx_res_t; ++typedef struct drm_draw drm_draw_t; ++typedef struct drm_update_draw drm_update_draw_t; ++typedef struct drm_auth drm_auth_t; ++typedef struct drm_irq_busid drm_irq_busid_t; ++typedef enum drm_vblank_seq_type drm_vblank_seq_type_t; ++ ++typedef struct drm_agp_buffer drm_agp_buffer_t; ++typedef struct drm_agp_binding drm_agp_binding_t; ++typedef struct drm_agp_info drm_agp_info_t; ++typedef struct drm_scatter_gather drm_scatter_gather_t; ++typedef struct drm_set_version drm_set_version_t; ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif +diff --git a/third_party/drm/drm/drm_fourcc.h b/third_party/drm/drm/drm_fourcc.h +new file mode 100644 +index 0000000..4ececa8 +--- /dev/null ++++ b/third_party/drm/drm/drm_fourcc.h @@ -0,0 +1,1377 @@ +/* + * Copyright 2011 Intel Corporation @@ -1391,1206 +2609,11 @@ diff -up firefox-101.0/third_party/drm/drm/drm_fourcc.h.libwebrtc-screen-cast-sy +#endif + +#endif /* DRM_FOURCC_H */ -diff -up firefox-101.0/third_party/drm/drm/drm.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/drm/drm/drm.h ---- firefox-101.0/third_party/drm/drm/drm.h.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.741522076 +0200 -+++ firefox-101.0/third_party/drm/drm/drm.h 2022-05-30 21:33:19.741522076 +0200 -@@ -0,0 +1,1193 @@ -+/* -+ * Header for the Direct Rendering Manager -+ * -+ * Author: Rickard E. (Rik) Faith -+ * -+ * Acknowledgments: -+ * Dec 1999, Richard Henderson , move to generic cmpxchg. -+ */ -+ -+/* -+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. -+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. -+ * All rights reserved. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#ifndef _DRM_H_ -+#define _DRM_H_ -+ -+#if defined(__linux__) -+ -+#include -+#include -+typedef unsigned int drm_handle_t; -+ -+#else /* One of the BSDs */ -+ -+#include -+#include -+#include -+typedef int8_t __s8; -+typedef uint8_t __u8; -+typedef int16_t __s16; -+typedef uint16_t __u16; -+typedef int32_t __s32; -+typedef uint32_t __u32; -+typedef int64_t __s64; -+typedef uint64_t __u64; -+typedef size_t __kernel_size_t; -+typedef unsigned long drm_handle_t; -+ -+#endif -+ -+#if defined(__cplusplus) -+extern "C" { -+#endif -+ -+#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */ -+#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */ -+#define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */ -+#define DRM_RAM_PERCENT 10 /**< How much system ram can we lock? */ -+ -+#define _DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */ -+#define _DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */ -+#define _DRM_LOCK_IS_HELD(lock) ((lock) & _DRM_LOCK_HELD) -+#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT) -+#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) -+ -+typedef unsigned int drm_context_t; -+typedef unsigned int drm_drawable_t; -+typedef unsigned int drm_magic_t; -+ -+/* -+ * Cliprect. -+ * -+ * \warning: If you change this structure, make sure you change -+ * XF86DRIClipRectRec in the server as well -+ * -+ * \note KW: Actually it's illegal to change either for -+ * backwards-compatibility reasons. -+ */ -+struct drm_clip_rect { -+ unsigned short x1; -+ unsigned short y1; -+ unsigned short x2; -+ unsigned short y2; -+}; -+ -+/* -+ * Drawable information. -+ */ -+struct drm_drawable_info { -+ unsigned int num_rects; -+ struct drm_clip_rect *rects; -+}; -+ -+/* -+ * Texture region, -+ */ -+struct drm_tex_region { -+ unsigned char next; -+ unsigned char prev; -+ unsigned char in_use; -+ unsigned char padding; -+ unsigned int age; -+}; -+ -+/* -+ * Hardware lock. -+ * -+ * The lock structure is a simple cache-line aligned integer. To avoid -+ * processor bus contention on a multiprocessor system, there should not be any -+ * other data stored in the same cache line. -+ */ -+struct drm_hw_lock { -+ __volatile__ unsigned int lock; /**< lock variable */ -+ char padding[60]; /**< Pad to cache line */ -+}; -+ -+/* -+ * DRM_IOCTL_VERSION ioctl argument type. -+ * -+ * \sa drmGetVersion(). -+ */ -+struct drm_version { -+ int version_major; /**< Major version */ -+ int version_minor; /**< Minor version */ -+ int version_patchlevel; /**< Patch level */ -+ __kernel_size_t name_len; /**< Length of name buffer */ -+ char *name; /**< Name of driver */ -+ __kernel_size_t date_len; /**< Length of date buffer */ -+ char *date; /**< User-space buffer to hold date */ -+ __kernel_size_t desc_len; /**< Length of desc buffer */ -+ char *desc; /**< User-space buffer to hold desc */ -+}; -+ -+/* -+ * DRM_IOCTL_GET_UNIQUE ioctl argument type. -+ * -+ * \sa drmGetBusid() and drmSetBusId(). -+ */ -+struct drm_unique { -+ __kernel_size_t unique_len; /**< Length of unique */ -+ char *unique; /**< Unique name for driver instantiation */ -+}; -+ -+struct drm_list { -+ int count; /**< Length of user-space structures */ -+ struct drm_version *version; -+}; -+ -+struct drm_block { -+ int unused; -+}; -+ -+/* -+ * DRM_IOCTL_CONTROL ioctl argument type. -+ * -+ * \sa drmCtlInstHandler() and drmCtlUninstHandler(). -+ */ -+struct drm_control { -+ enum { -+ DRM_ADD_COMMAND, -+ DRM_RM_COMMAND, -+ DRM_INST_HANDLER, -+ DRM_UNINST_HANDLER -+ } func; -+ int irq; -+}; -+ -+/* -+ * Type of memory to map. -+ */ -+enum drm_map_type { -+ _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */ -+ _DRM_REGISTERS = 1, /**< no caching, no core dump */ -+ _DRM_SHM = 2, /**< shared, cached */ -+ _DRM_AGP = 3, /**< AGP/GART */ -+ _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */ -+ _DRM_CONSISTENT = 5 /**< Consistent memory for PCI DMA */ -+}; -+ -+/* -+ * Memory mapping flags. -+ */ -+enum drm_map_flags { -+ _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */ -+ _DRM_READ_ONLY = 0x02, -+ _DRM_LOCKED = 0x04, /**< shared, cached, locked */ -+ _DRM_KERNEL = 0x08, /**< kernel requires access */ -+ _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */ -+ _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */ -+ _DRM_REMOVABLE = 0x40, /**< Removable mapping */ -+ _DRM_DRIVER = 0x80 /**< Managed by driver */ -+}; -+ -+struct drm_ctx_priv_map { -+ unsigned int ctx_id; /**< Context requesting private mapping */ -+ void *handle; /**< Handle of map */ -+}; -+ -+/* -+ * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls -+ * argument type. -+ * -+ * \sa drmAddMap(). -+ */ -+struct drm_map { -+ unsigned long offset; /**< Requested physical address (0 for SAREA)*/ -+ unsigned long size; /**< Requested physical size (bytes) */ -+ enum drm_map_type type; /**< Type of memory to map */ -+ enum drm_map_flags flags; /**< Flags */ -+ void *handle; /**< User-space: "Handle" to pass to mmap() */ -+ /**< Kernel-space: kernel-virtual address */ -+ int mtrr; /**< MTRR slot used */ -+ /* Private data */ -+}; -+ -+/* -+ * DRM_IOCTL_GET_CLIENT ioctl argument type. -+ */ -+struct drm_client { -+ int idx; /**< Which client desired? */ -+ int auth; /**< Is client authenticated? */ -+ unsigned long pid; /**< Process ID */ -+ unsigned long uid; /**< User ID */ -+ unsigned long magic; /**< Magic */ -+ unsigned long iocs; /**< Ioctl count */ -+}; -+ -+enum drm_stat_type { -+ _DRM_STAT_LOCK, -+ _DRM_STAT_OPENS, -+ _DRM_STAT_CLOSES, -+ _DRM_STAT_IOCTLS, -+ _DRM_STAT_LOCKS, -+ _DRM_STAT_UNLOCKS, -+ _DRM_STAT_VALUE, /**< Generic value */ -+ _DRM_STAT_BYTE, /**< Generic byte counter (1024bytes/K) */ -+ _DRM_STAT_COUNT, /**< Generic non-byte counter (1000/k) */ -+ -+ _DRM_STAT_IRQ, /**< IRQ */ -+ _DRM_STAT_PRIMARY, /**< Primary DMA bytes */ -+ _DRM_STAT_SECONDARY, /**< Secondary DMA bytes */ -+ _DRM_STAT_DMA, /**< DMA */ -+ _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */ -+ _DRM_STAT_MISSED /**< Missed DMA opportunity */ -+ /* Add to the *END* of the list */ -+}; -+ -+/* -+ * DRM_IOCTL_GET_STATS ioctl argument type. -+ */ -+struct drm_stats { -+ unsigned long count; -+ struct { -+ unsigned long value; -+ enum drm_stat_type type; -+ } data[15]; -+}; -+ -+/* -+ * Hardware locking flags. -+ */ -+enum drm_lock_flags { -+ _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */ -+ _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */ -+ _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */ -+ _DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */ -+ /* These *HALT* flags aren't supported yet -+ -- they will be used to support the -+ full-screen DGA-like mode. */ -+ _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */ -+ _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ -+}; -+ -+/* -+ * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type. -+ * -+ * \sa drmGetLock() and drmUnlock(). -+ */ -+struct drm_lock { -+ int context; -+ enum drm_lock_flags flags; -+}; -+ -+/* -+ * DMA flags -+ * -+ * \warning -+ * These values \e must match xf86drm.h. -+ * -+ * \sa drm_dma. -+ */ -+enum drm_dma_flags { -+ /* Flags for DMA buffer dispatch */ -+ _DRM_DMA_BLOCK = 0x01, /**< -+ * Block until buffer dispatched. -+ * -+ * \note The buffer may not yet have -+ * been processed by the hardware -- -+ * getting a hardware lock with the -+ * hardware quiescent will ensure -+ * that the buffer has been -+ * processed. -+ */ -+ _DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */ -+ _DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */ -+ -+ /* Flags for DMA buffer request */ -+ _DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */ -+ _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */ -+ _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ -+}; -+ -+/* -+ * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type. -+ * -+ * \sa drmAddBufs(). -+ */ -+struct drm_buf_desc { -+ int count; /**< Number of buffers of this size */ -+ int size; /**< Size in bytes */ -+ int low_mark; /**< Low water mark */ -+ int high_mark; /**< High water mark */ -+ enum { -+ _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */ -+ _DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */ -+ _DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */ -+ _DRM_FB_BUFFER = 0x08, /**< Buffer is in frame buffer */ -+ _DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */ -+ } flags; -+ unsigned long agp_start; /**< -+ * Start address of where the AGP buffers are -+ * in the AGP aperture -+ */ -+}; -+ -+/* -+ * DRM_IOCTL_INFO_BUFS ioctl argument type. -+ */ -+struct drm_buf_info { -+ int count; /**< Entries in list */ -+ struct drm_buf_desc *list; -+}; -+ -+/* -+ * DRM_IOCTL_FREE_BUFS ioctl argument type. -+ */ -+struct drm_buf_free { -+ int count; -+ int *list; -+}; -+ -+/* -+ * Buffer information -+ * -+ * \sa drm_buf_map. -+ */ -+struct drm_buf_pub { -+ int idx; /**< Index into the master buffer list */ -+ int total; /**< Buffer size */ -+ int used; /**< Amount of buffer in use (for DMA) */ -+ void *address; /**< Address of buffer */ -+}; -+ -+/* -+ * DRM_IOCTL_MAP_BUFS ioctl argument type. -+ */ -+struct drm_buf_map { -+ int count; /**< Length of the buffer list */ -+#ifdef __cplusplus -+ void *virt; -+#else -+ void *virtual; /**< Mmap'd area in user-virtual */ -+#endif -+ struct drm_buf_pub *list; /**< Buffer information */ -+}; -+ -+/* -+ * DRM_IOCTL_DMA ioctl argument type. -+ * -+ * Indices here refer to the offset into the buffer list in drm_buf_get. -+ * -+ * \sa drmDMA(). -+ */ -+struct drm_dma { -+ int context; /**< Context handle */ -+ int send_count; /**< Number of buffers to send */ -+ int *send_indices; /**< List of handles to buffers */ -+ int *send_sizes; /**< Lengths of data to send */ -+ enum drm_dma_flags flags; /**< Flags */ -+ int request_count; /**< Number of buffers requested */ -+ int request_size; /**< Desired size for buffers */ -+ int *request_indices; /**< Buffer information */ -+ int *request_sizes; -+ int granted_count; /**< Number of buffers granted */ -+}; -+ -+enum drm_ctx_flags { -+ _DRM_CONTEXT_PRESERVED = 0x01, -+ _DRM_CONTEXT_2DONLY = 0x02 -+}; -+ -+/* -+ * DRM_IOCTL_ADD_CTX ioctl argument type. -+ * -+ * \sa drmCreateContext() and drmDestroyContext(). -+ */ -+struct drm_ctx { -+ drm_context_t handle; -+ enum drm_ctx_flags flags; -+}; -+ -+/* -+ * DRM_IOCTL_RES_CTX ioctl argument type. -+ */ -+struct drm_ctx_res { -+ int count; -+ struct drm_ctx *contexts; -+}; -+ -+/* -+ * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type. -+ */ -+struct drm_draw { -+ drm_drawable_t handle; -+}; -+ -+/* -+ * DRM_IOCTL_UPDATE_DRAW ioctl argument type. -+ */ -+typedef enum { -+ DRM_DRAWABLE_CLIPRECTS -+} drm_drawable_info_type_t; -+ -+struct drm_update_draw { -+ drm_drawable_t handle; -+ unsigned int type; -+ unsigned int num; -+ unsigned long long data; -+}; -+ -+/* -+ * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type. -+ */ -+struct drm_auth { -+ drm_magic_t magic; -+}; -+ -+/* -+ * DRM_IOCTL_IRQ_BUSID ioctl argument type. -+ * -+ * \sa drmGetInterruptFromBusID(). -+ */ -+struct drm_irq_busid { -+ int irq; /**< IRQ number */ -+ int busnum; /**< bus number */ -+ int devnum; /**< device number */ -+ int funcnum; /**< function number */ -+}; -+ -+enum drm_vblank_seq_type { -+ _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ -+ _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ -+ /* bits 1-6 are reserved for high crtcs */ -+ _DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e, -+ _DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */ -+ _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ -+ _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ -+ _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ -+ _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking, unsupported */ -+}; -+#define _DRM_VBLANK_HIGH_CRTC_SHIFT 1 -+ -+#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE) -+#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \ -+ _DRM_VBLANK_SECONDARY | _DRM_VBLANK_NEXTONMISS) -+ -+struct drm_wait_vblank_request { -+ enum drm_vblank_seq_type type; -+ unsigned int sequence; -+ unsigned long signal; -+}; -+ -+struct drm_wait_vblank_reply { -+ enum drm_vblank_seq_type type; -+ unsigned int sequence; -+ long tval_sec; -+ long tval_usec; -+}; -+ -+/* -+ * DRM_IOCTL_WAIT_VBLANK ioctl argument type. -+ * -+ * \sa drmWaitVBlank(). -+ */ -+union drm_wait_vblank { -+ struct drm_wait_vblank_request request; -+ struct drm_wait_vblank_reply reply; -+}; -+ -+#define _DRM_PRE_MODESET 1 -+#define _DRM_POST_MODESET 2 -+ -+/* -+ * DRM_IOCTL_MODESET_CTL ioctl argument type -+ * -+ * \sa drmModesetCtl(). -+ */ -+struct drm_modeset_ctl { -+ __u32 crtc; -+ __u32 cmd; -+}; -+ -+/* -+ * DRM_IOCTL_AGP_ENABLE ioctl argument type. -+ * -+ * \sa drmAgpEnable(). -+ */ -+struct drm_agp_mode { -+ unsigned long mode; /**< AGP mode */ -+}; -+ -+/* -+ * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type. -+ * -+ * \sa drmAgpAlloc() and drmAgpFree(). -+ */ -+struct drm_agp_buffer { -+ unsigned long size; /**< In bytes -- will round to page boundary */ -+ unsigned long handle; /**< Used for binding / unbinding */ -+ unsigned long type; /**< Type of memory to allocate */ -+ unsigned long physical; /**< Physical used by i810 */ -+}; -+ -+/* -+ * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type. -+ * -+ * \sa drmAgpBind() and drmAgpUnbind(). -+ */ -+struct drm_agp_binding { -+ unsigned long handle; /**< From drm_agp_buffer */ -+ unsigned long offset; /**< In bytes -- will round to page boundary */ -+}; -+ -+/* -+ * DRM_IOCTL_AGP_INFO ioctl argument type. -+ * -+ * \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(), -+ * drmAgpBase(), drmAgpSize(), drmAgpMemoryUsed(), drmAgpMemoryAvail(), -+ * drmAgpVendorId() and drmAgpDeviceId(). -+ */ -+struct drm_agp_info { -+ int agp_version_major; -+ int agp_version_minor; -+ unsigned long mode; -+ unsigned long aperture_base; /* physical address */ -+ unsigned long aperture_size; /* bytes */ -+ unsigned long memory_allowed; /* bytes */ -+ unsigned long memory_used; -+ -+ /* PCI information */ -+ unsigned short id_vendor; -+ unsigned short id_device; -+}; -+ -+/* -+ * DRM_IOCTL_SG_ALLOC ioctl argument type. -+ */ -+struct drm_scatter_gather { -+ unsigned long size; /**< In bytes -- will round to page boundary */ -+ unsigned long handle; /**< Used for mapping / unmapping */ -+}; -+ -+/* -+ * DRM_IOCTL_SET_VERSION ioctl argument type. -+ */ -+struct drm_set_version { -+ int drm_di_major; -+ int drm_di_minor; -+ int drm_dd_major; -+ int drm_dd_minor; -+}; -+ -+/* DRM_IOCTL_GEM_CLOSE ioctl argument type */ -+struct drm_gem_close { -+ /** Handle of the object to be closed. */ -+ __u32 handle; -+ __u32 pad; -+}; -+ -+/* DRM_IOCTL_GEM_FLINK ioctl argument type */ -+struct drm_gem_flink { -+ /** Handle for the object being named */ -+ __u32 handle; -+ -+ /** Returned global name */ -+ __u32 name; -+}; -+ -+/* DRM_IOCTL_GEM_OPEN ioctl argument type */ -+struct drm_gem_open { -+ /** Name of object being opened */ -+ __u32 name; -+ -+ /** Returned handle for the object */ -+ __u32 handle; -+ -+ /** Returned size of the object */ -+ __u64 size; -+}; -+ -+/** -+ * DRM_CAP_DUMB_BUFFER -+ * -+ * If set to 1, the driver supports creating dumb buffers via the -+ * &DRM_IOCTL_MODE_CREATE_DUMB ioctl. -+ */ -+#define DRM_CAP_DUMB_BUFFER 0x1 -+/** -+ * DRM_CAP_VBLANK_HIGH_CRTC -+ * -+ * If set to 1, the kernel supports specifying a :ref:`CRTC index` -+ * in the high bits of &drm_wait_vblank_request.type. -+ * -+ * Starting kernel version 2.6.39, this capability is always set to 1. -+ */ -+#define DRM_CAP_VBLANK_HIGH_CRTC 0x2 -+/** -+ * DRM_CAP_DUMB_PREFERRED_DEPTH -+ * -+ * The preferred bit depth for dumb buffers. -+ * -+ * The bit depth is the number of bits used to indicate the color of a single -+ * pixel excluding any padding. This is different from the number of bits per -+ * pixel. For instance, XRGB8888 has a bit depth of 24 but has 32 bits per -+ * pixel. -+ * -+ * Note that this preference only applies to dumb buffers, it's irrelevant for -+ * other types of buffers. -+ */ -+#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3 -+/** -+ * DRM_CAP_DUMB_PREFER_SHADOW -+ * -+ * If set to 1, the driver prefers userspace to render to a shadow buffer -+ * instead of directly rendering to a dumb buffer. For best speed, userspace -+ * should do streaming ordered memory copies into the dumb buffer and never -+ * read from it. -+ * -+ * Note that this preference only applies to dumb buffers, it's irrelevant for -+ * other types of buffers. -+ */ -+#define DRM_CAP_DUMB_PREFER_SHADOW 0x4 -+/** -+ * DRM_CAP_PRIME -+ * -+ * Bitfield of supported PRIME sharing capabilities. See &DRM_PRIME_CAP_IMPORT -+ * and &DRM_PRIME_CAP_EXPORT. -+ * -+ * PRIME buffers are exposed as dma-buf file descriptors. See -+ * Documentation/gpu/drm-mm.rst, section "PRIME Buffer Sharing". -+ */ -+#define DRM_CAP_PRIME 0x5 -+/** -+ * DRM_PRIME_CAP_IMPORT -+ * -+ * If this bit is set in &DRM_CAP_PRIME, the driver supports importing PRIME -+ * buffers via the &DRM_IOCTL_PRIME_FD_TO_HANDLE ioctl. -+ */ -+#define DRM_PRIME_CAP_IMPORT 0x1 -+/** -+ * DRM_PRIME_CAP_EXPORT -+ * -+ * If this bit is set in &DRM_CAP_PRIME, the driver supports exporting PRIME -+ * buffers via the &DRM_IOCTL_PRIME_HANDLE_TO_FD ioctl. -+ */ -+#define DRM_PRIME_CAP_EXPORT 0x2 -+/** -+ * DRM_CAP_TIMESTAMP_MONOTONIC -+ * -+ * If set to 0, the kernel will report timestamps with ``CLOCK_REALTIME`` in -+ * struct drm_event_vblank. If set to 1, the kernel will report timestamps with -+ * ``CLOCK_MONOTONIC``. See ``clock_gettime(2)`` for the definition of these -+ * clocks. -+ * -+ * Starting from kernel version 2.6.39, the default value for this capability -+ * is 1. Starting kernel version 4.15, this capability is always set to 1. -+ */ -+#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 -+/** -+ * DRM_CAP_ASYNC_PAGE_FLIP -+ * -+ * If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC. -+ */ -+#define DRM_CAP_ASYNC_PAGE_FLIP 0x7 -+/** -+ * DRM_CAP_CURSOR_WIDTH -+ * -+ * The ``CURSOR_WIDTH`` and ``CURSOR_HEIGHT`` capabilities return a valid -+ * width x height combination for the hardware cursor. The intention is that a -+ * hardware agnostic userspace can query a cursor plane size to use. -+ * -+ * Note that the cross-driver contract is to merely return a valid size; -+ * drivers are free to attach another meaning on top, eg. i915 returns the -+ * maximum plane size. -+ */ -+#define DRM_CAP_CURSOR_WIDTH 0x8 -+/** -+ * DRM_CAP_CURSOR_HEIGHT -+ * -+ * See &DRM_CAP_CURSOR_WIDTH. -+ */ -+#define DRM_CAP_CURSOR_HEIGHT 0x9 -+/** -+ * DRM_CAP_ADDFB2_MODIFIERS -+ * -+ * If set to 1, the driver supports supplying modifiers in the -+ * &DRM_IOCTL_MODE_ADDFB2 ioctl. -+ */ -+#define DRM_CAP_ADDFB2_MODIFIERS 0x10 -+/** -+ * DRM_CAP_PAGE_FLIP_TARGET -+ * -+ * If set to 1, the driver supports the &DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE and -+ * &DRM_MODE_PAGE_FLIP_TARGET_RELATIVE flags in -+ * &drm_mode_crtc_page_flip_target.flags for the &DRM_IOCTL_MODE_PAGE_FLIP -+ * ioctl. -+ */ -+#define DRM_CAP_PAGE_FLIP_TARGET 0x11 -+/** -+ * DRM_CAP_CRTC_IN_VBLANK_EVENT -+ * -+ * If set to 1, the kernel supports reporting the CRTC ID in -+ * &drm_event_vblank.crtc_id for the &DRM_EVENT_VBLANK and -+ * &DRM_EVENT_FLIP_COMPLETE events. -+ * -+ * Starting kernel version 4.12, this capability is always set to 1. -+ */ -+#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12 -+/** -+ * DRM_CAP_SYNCOBJ -+ * -+ * If set to 1, the driver supports sync objects. See -+ * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects". -+ */ -+#define DRM_CAP_SYNCOBJ 0x13 -+/** -+ * DRM_CAP_SYNCOBJ_TIMELINE -+ * -+ * If set to 1, the driver supports timeline operations on sync objects. See -+ * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects". -+ */ -+#define DRM_CAP_SYNCOBJ_TIMELINE 0x14 -+ -+/* DRM_IOCTL_GET_CAP ioctl argument type */ -+struct drm_get_cap { -+ __u64 capability; -+ __u64 value; -+}; -+ -+/** -+ * DRM_CLIENT_CAP_STEREO_3D -+ * -+ * If set to 1, the DRM core will expose the stereo 3D capabilities of the -+ * monitor by advertising the supported 3D layouts in the flags of struct -+ * drm_mode_modeinfo. See ``DRM_MODE_FLAG_3D_*``. -+ * -+ * This capability is always supported for all drivers starting from kernel -+ * version 3.13. -+ */ -+#define DRM_CLIENT_CAP_STEREO_3D 1 -+ -+/** -+ * DRM_CLIENT_CAP_UNIVERSAL_PLANES -+ * -+ * If set to 1, the DRM core will expose all planes (overlay, primary, and -+ * cursor) to userspace. -+ * -+ * This capability has been introduced in kernel version 3.15. Starting from -+ * kernel version 3.17, this capability is always supported for all drivers. -+ */ -+#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2 -+ -+/** -+ * DRM_CLIENT_CAP_ATOMIC -+ * -+ * If set to 1, the DRM core will expose atomic properties to userspace. This -+ * implicitly enables &DRM_CLIENT_CAP_UNIVERSAL_PLANES and -+ * &DRM_CLIENT_CAP_ASPECT_RATIO. -+ * -+ * If the driver doesn't support atomic mode-setting, enabling this capability -+ * will fail with -EOPNOTSUPP. -+ * -+ * This capability has been introduced in kernel version 4.0. Starting from -+ * kernel version 4.2, this capability is always supported for atomic-capable -+ * drivers. -+ */ -+#define DRM_CLIENT_CAP_ATOMIC 3 -+ -+/** -+ * DRM_CLIENT_CAP_ASPECT_RATIO -+ * -+ * If set to 1, the DRM core will provide aspect ratio information in modes. -+ * See ``DRM_MODE_FLAG_PIC_AR_*``. -+ * -+ * This capability is always supported for all drivers starting from kernel -+ * version 4.18. -+ */ -+#define DRM_CLIENT_CAP_ASPECT_RATIO 4 -+ -+/** -+ * DRM_CLIENT_CAP_WRITEBACK_CONNECTORS -+ * -+ * If set to 1, the DRM core will expose special connectors to be used for -+ * writing back to memory the scene setup in the commit. The client must enable -+ * &DRM_CLIENT_CAP_ATOMIC first. -+ * -+ * This capability is always supported for atomic-capable drivers starting from -+ * kernel version 4.19. -+ */ -+#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5 -+ -+/* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ -+struct drm_set_client_cap { -+ __u64 capability; -+ __u64 value; -+}; -+ -+#define DRM_RDWR O_RDWR -+#define DRM_CLOEXEC O_CLOEXEC -+struct drm_prime_handle { -+ __u32 handle; -+ -+ /** Flags.. only applicable for handle->fd */ -+ __u32 flags; -+ -+ /** Returned dmabuf file descriptor */ -+ __s32 fd; -+}; -+ -+struct drm_syncobj_create { -+ __u32 handle; -+#define DRM_SYNCOBJ_CREATE_SIGNALED (1 << 0) -+ __u32 flags; -+}; -+ -+struct drm_syncobj_destroy { -+ __u32 handle; -+ __u32 pad; -+}; -+ -+#define DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE (1 << 0) -+#define DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_EXPORT_SYNC_FILE (1 << 0) -+struct drm_syncobj_handle { -+ __u32 handle; -+ __u32 flags; -+ -+ __s32 fd; -+ __u32 pad; -+}; -+ -+struct drm_syncobj_transfer { -+ __u32 src_handle; -+ __u32 dst_handle; -+ __u64 src_point; -+ __u64 dst_point; -+ __u32 flags; -+ __u32 pad; -+}; -+ -+#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0) -+#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1) -+#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE (1 << 2) /* wait for time point to become available */ -+struct drm_syncobj_wait { -+ __u64 handles; -+ /* absolute timeout */ -+ __s64 timeout_nsec; -+ __u32 count_handles; -+ __u32 flags; -+ __u32 first_signaled; /* only valid when not waiting all */ -+ __u32 pad; -+}; -+ -+struct drm_syncobj_timeline_wait { -+ __u64 handles; -+ /* wait on specific timeline point for every handles*/ -+ __u64 points; -+ /* absolute timeout */ -+ __s64 timeout_nsec; -+ __u32 count_handles; -+ __u32 flags; -+ __u32 first_signaled; /* only valid when not waiting all */ -+ __u32 pad; -+}; -+ -+ -+struct drm_syncobj_array { -+ __u64 handles; -+ __u32 count_handles; -+ __u32 pad; -+}; -+ -+#define DRM_SYNCOBJ_QUERY_FLAGS_LAST_SUBMITTED (1 << 0) /* last available point on timeline syncobj */ -+struct drm_syncobj_timeline_array { -+ __u64 handles; -+ __u64 points; -+ __u32 count_handles; -+ __u32 flags; -+}; -+ -+ -+/* Query current scanout sequence number */ -+struct drm_crtc_get_sequence { -+ __u32 crtc_id; /* requested crtc_id */ -+ __u32 active; /* return: crtc output is active */ -+ __u64 sequence; /* return: most recent vblank sequence */ -+ __s64 sequence_ns; /* return: most recent time of first pixel out */ -+}; -+ -+/* Queue event to be delivered at specified sequence. Time stamp marks -+ * when the first pixel of the refresh cycle leaves the display engine -+ * for the display -+ */ -+#define DRM_CRTC_SEQUENCE_RELATIVE 0x00000001 /* sequence is relative to current */ -+#define DRM_CRTC_SEQUENCE_NEXT_ON_MISS 0x00000002 /* Use next sequence if we've missed */ -+ -+struct drm_crtc_queue_sequence { -+ __u32 crtc_id; -+ __u32 flags; -+ __u64 sequence; /* on input, target sequence. on output, actual sequence */ -+ __u64 user_data; /* user data passed to event */ -+}; -+ -+#if defined(__cplusplus) -+} -+#endif -+ -+#include "drm_mode.h" -+ -+#if defined(__cplusplus) -+extern "C" { -+#endif -+ -+#define DRM_IOCTL_BASE 'd' -+#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr) -+#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type) -+#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type) -+#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type) -+ -+#define DRM_IOCTL_VERSION DRM_IOWR(0x00, struct drm_version) -+#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, struct drm_unique) -+#define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, struct drm_auth) -+#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, struct drm_irq_busid) -+#define DRM_IOCTL_GET_MAP DRM_IOWR(0x04, struct drm_map) -+#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client) -+#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats) -+#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version) -+#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl) -+#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close) -+#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink) -+#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open) -+#define DRM_IOCTL_GET_CAP DRM_IOWR(0x0c, struct drm_get_cap) -+#define DRM_IOCTL_SET_CLIENT_CAP DRM_IOW( 0x0d, struct drm_set_client_cap) -+ -+#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique) -+#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth) -+#define DRM_IOCTL_BLOCK DRM_IOWR(0x12, struct drm_block) -+#define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, struct drm_block) -+#define DRM_IOCTL_CONTROL DRM_IOW( 0x14, struct drm_control) -+#define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, struct drm_map) -+#define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, struct drm_buf_desc) -+#define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, struct drm_buf_desc) -+#define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, struct drm_buf_info) -+#define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, struct drm_buf_map) -+#define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, struct drm_buf_free) -+ -+#define DRM_IOCTL_RM_MAP DRM_IOW( 0x1b, struct drm_map) -+ -+#define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, struct drm_ctx_priv_map) -+#define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, struct drm_ctx_priv_map) -+ -+#define DRM_IOCTL_SET_MASTER DRM_IO(0x1e) -+#define DRM_IOCTL_DROP_MASTER DRM_IO(0x1f) -+ -+#define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, struct drm_ctx) -+#define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, struct drm_ctx) -+#define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, struct drm_ctx) -+#define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, struct drm_ctx) -+#define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, struct drm_ctx) -+#define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, struct drm_ctx) -+#define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, struct drm_ctx_res) -+#define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, struct drm_draw) -+#define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, struct drm_draw) -+#define DRM_IOCTL_DMA DRM_IOWR(0x29, struct drm_dma) -+#define DRM_IOCTL_LOCK DRM_IOW( 0x2a, struct drm_lock) -+#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock) -+#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock) -+ -+#define DRM_IOCTL_PRIME_HANDLE_TO_FD DRM_IOWR(0x2d, struct drm_prime_handle) -+#define DRM_IOCTL_PRIME_FD_TO_HANDLE DRM_IOWR(0x2e, struct drm_prime_handle) -+ -+#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30) -+#define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31) -+#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode) -+#define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, struct drm_agp_info) -+#define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, struct drm_agp_buffer) -+#define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, struct drm_agp_buffer) -+#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding) -+#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding) -+ -+#define DRM_IOCTL_SG_ALLOC DRM_IOWR(0x38, struct drm_scatter_gather) -+#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather) -+ -+#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank) -+ -+#define DRM_IOCTL_CRTC_GET_SEQUENCE DRM_IOWR(0x3b, struct drm_crtc_get_sequence) -+#define DRM_IOCTL_CRTC_QUEUE_SEQUENCE DRM_IOWR(0x3c, struct drm_crtc_queue_sequence) -+ -+#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw) -+ -+#define DRM_IOCTL_MODE_GETRESOURCES DRM_IOWR(0xA0, struct drm_mode_card_res) -+#define DRM_IOCTL_MODE_GETCRTC DRM_IOWR(0xA1, struct drm_mode_crtc) -+#define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA2, struct drm_mode_crtc) -+#define DRM_IOCTL_MODE_CURSOR DRM_IOWR(0xA3, struct drm_mode_cursor) -+#define DRM_IOCTL_MODE_GETGAMMA DRM_IOWR(0xA4, struct drm_mode_crtc_lut) -+#define DRM_IOCTL_MODE_SETGAMMA DRM_IOWR(0xA5, struct drm_mode_crtc_lut) -+#define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xA6, struct drm_mode_get_encoder) -+#define DRM_IOCTL_MODE_GETCONNECTOR DRM_IOWR(0xA7, struct drm_mode_get_connector) -+#define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA8, struct drm_mode_mode_cmd) /* deprecated (never worked) */ -+#define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd) /* deprecated (never worked) */ -+ -+#define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAA, struct drm_mode_get_property) -+#define DRM_IOCTL_MODE_SETPROPERTY DRM_IOWR(0xAB, struct drm_mode_connector_set_property) -+#define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, struct drm_mode_get_blob) -+#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd) -+#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd) -+/** -+ * DRM_IOCTL_MODE_RMFB - Remove a framebuffer. -+ * -+ * This removes a framebuffer previously added via ADDFB/ADDFB2. The IOCTL -+ * argument is a framebuffer object ID. -+ * -+ * Warning: removing a framebuffer currently in-use on an enabled plane will -+ * disable that plane. The CRTC the plane is linked to may also be disabled -+ * (depending on driver capabilities). -+ */ -+#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int) -+#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip) -+#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd) -+ -+#define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb) -+#define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, struct drm_mode_map_dumb) -+#define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, struct drm_mode_destroy_dumb) -+#define DRM_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xB5, struct drm_mode_get_plane_res) -+#define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane) -+#define DRM_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct drm_mode_set_plane) -+#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2) -+#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties) -+#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property) -+#define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2) -+#define DRM_IOCTL_MODE_ATOMIC DRM_IOWR(0xBC, struct drm_mode_atomic) -+#define DRM_IOCTL_MODE_CREATEPROPBLOB DRM_IOWR(0xBD, struct drm_mode_create_blob) -+#define DRM_IOCTL_MODE_DESTROYPROPBLOB DRM_IOWR(0xBE, struct drm_mode_destroy_blob) -+ -+#define DRM_IOCTL_SYNCOBJ_CREATE DRM_IOWR(0xBF, struct drm_syncobj_create) -+#define DRM_IOCTL_SYNCOBJ_DESTROY DRM_IOWR(0xC0, struct drm_syncobj_destroy) -+#define DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD DRM_IOWR(0xC1, struct drm_syncobj_handle) -+#define DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE DRM_IOWR(0xC2, struct drm_syncobj_handle) -+#define DRM_IOCTL_SYNCOBJ_WAIT DRM_IOWR(0xC3, struct drm_syncobj_wait) -+#define DRM_IOCTL_SYNCOBJ_RESET DRM_IOWR(0xC4, struct drm_syncobj_array) -+#define DRM_IOCTL_SYNCOBJ_SIGNAL DRM_IOWR(0xC5, struct drm_syncobj_array) -+ -+#define DRM_IOCTL_MODE_CREATE_LEASE DRM_IOWR(0xC6, struct drm_mode_create_lease) -+#define DRM_IOCTL_MODE_LIST_LESSEES DRM_IOWR(0xC7, struct drm_mode_list_lessees) -+#define DRM_IOCTL_MODE_GET_LEASE DRM_IOWR(0xC8, struct drm_mode_get_lease) -+#define DRM_IOCTL_MODE_REVOKE_LEASE DRM_IOWR(0xC9, struct drm_mode_revoke_lease) -+ -+#define DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT DRM_IOWR(0xCA, struct drm_syncobj_timeline_wait) -+#define DRM_IOCTL_SYNCOBJ_QUERY DRM_IOWR(0xCB, struct drm_syncobj_timeline_array) -+#define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer) -+#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct drm_syncobj_timeline_array) -+ -+#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2) -+ -+/* -+ * Device specific ioctls should only be in their respective headers -+ * The device specific ioctl range is from 0x40 to 0x9f. -+ * Generic IOCTLS restart at 0xA0. -+ * -+ * \sa drmCommandNone(), drmCommandRead(), drmCommandWrite(), and -+ * drmCommandReadWrite(). -+ */ -+#define DRM_COMMAND_BASE 0x40 -+#define DRM_COMMAND_END 0xA0 -+ -+/* -+ * Header for events written back to userspace on the drm fd. The -+ * type defines the type of event, the length specifies the total -+ * length of the event (including the header), and user_data is -+ * typically a 64 bit value passed with the ioctl that triggered the -+ * event. A read on the drm fd will always only return complete -+ * events, that is, if for example the read buffer is 100 bytes, and -+ * there are two 64 byte events pending, only one will be returned. -+ * -+ * Event types 0 - 0x7fffffff are generic drm events, 0x80000000 and -+ * up are chipset specific. -+ */ -+struct drm_event { -+ __u32 type; -+ __u32 length; -+}; -+ -+#define DRM_EVENT_VBLANK 0x01 -+#define DRM_EVENT_FLIP_COMPLETE 0x02 -+#define DRM_EVENT_CRTC_SEQUENCE 0x03 -+ -+struct drm_event_vblank { -+ struct drm_event base; -+ __u64 user_data; -+ __u32 tv_sec; -+ __u32 tv_usec; -+ __u32 sequence; -+ __u32 crtc_id; /* 0 on older kernels that do not support this */ -+}; -+ -+/* Event delivered at sequence. Time stamp marks when the first pixel -+ * of the refresh cycle leaves the display engine for the display -+ */ -+struct drm_event_crtc_sequence { -+ struct drm_event base; -+ __u64 user_data; -+ __s64 time_ns; -+ __u64 sequence; -+}; -+ -+/* typedef area */ -+typedef struct drm_clip_rect drm_clip_rect_t; -+typedef struct drm_drawable_info drm_drawable_info_t; -+typedef struct drm_tex_region drm_tex_region_t; -+typedef struct drm_hw_lock drm_hw_lock_t; -+typedef struct drm_version drm_version_t; -+typedef struct drm_unique drm_unique_t; -+typedef struct drm_list drm_list_t; -+typedef struct drm_block drm_block_t; -+typedef struct drm_control drm_control_t; -+typedef enum drm_map_type drm_map_type_t; -+typedef enum drm_map_flags drm_map_flags_t; -+typedef struct drm_ctx_priv_map drm_ctx_priv_map_t; -+typedef struct drm_map drm_map_t; -+typedef struct drm_client drm_client_t; -+typedef enum drm_stat_type drm_stat_type_t; -+typedef struct drm_stats drm_stats_t; -+typedef enum drm_lock_flags drm_lock_flags_t; -+typedef struct drm_lock drm_lock_t; -+typedef enum drm_dma_flags drm_dma_flags_t; -+typedef struct drm_buf_desc drm_buf_desc_t; -+typedef struct drm_buf_info drm_buf_info_t; -+typedef struct drm_buf_free drm_buf_free_t; -+typedef struct drm_buf_pub drm_buf_pub_t; -+typedef struct drm_buf_map drm_buf_map_t; -+typedef struct drm_dma drm_dma_t; -+typedef union drm_wait_vblank drm_wait_vblank_t; -+typedef struct drm_agp_mode drm_agp_mode_t; -+typedef enum drm_ctx_flags drm_ctx_flags_t; -+typedef struct drm_ctx drm_ctx_t; -+typedef struct drm_ctx_res drm_ctx_res_t; -+typedef struct drm_draw drm_draw_t; -+typedef struct drm_update_draw drm_update_draw_t; -+typedef struct drm_auth drm_auth_t; -+typedef struct drm_irq_busid drm_irq_busid_t; -+typedef enum drm_vblank_seq_type drm_vblank_seq_type_t; -+ -+typedef struct drm_agp_buffer drm_agp_buffer_t; -+typedef struct drm_agp_binding drm_agp_binding_t; -+typedef struct drm_agp_info drm_agp_info_t; -+typedef struct drm_scatter_gather drm_scatter_gather_t; -+typedef struct drm_set_version drm_set_version_t; -+ -+#if defined(__cplusplus) -+} -+#endif -+ -+#endif -diff -up firefox-101.0/third_party/drm/drm/drm_mode.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/drm/drm/drm_mode.h ---- firefox-101.0/third_party/drm/drm/drm_mode.h.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.741522076 +0200 -+++ firefox-101.0/third_party/drm/drm/drm_mode.h 2022-05-30 21:33:19.741522076 +0200 +diff --git a/third_party/drm/drm/drm_mode.h b/third_party/drm/drm/drm_mode.h +new file mode 100644 +index 0000000..e1e3516 +--- /dev/null ++++ b/third_party/drm/drm/drm_mode.h @@ -0,0 +1,1217 @@ +/* + * Copyright (c) 2007 Dave Airlie @@ -3809,9 +3832,11 @@ diff -up firefox-101.0/third_party/drm/drm/drm_mode.h.libwebrtc-screen-cast-sync +#endif + +#endif -diff -up firefox-101.0/third_party/drm/drm/xf86drm.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/drm/drm/xf86drm.h ---- firefox-101.0/third_party/drm/drm/xf86drm.h.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.742522110 +0200 -+++ firefox-101.0/third_party/drm/drm/xf86drm.h 2022-05-30 21:33:19.742522110 +0200 +diff --git a/third_party/drm/drm/xf86drm.h b/third_party/drm/drm/xf86drm.h +new file mode 100644 +index 0000000..58d66f1 +--- /dev/null ++++ b/third_party/drm/drm/xf86drm.h @@ -0,0 +1,966 @@ +/** + * \file xf86drm.h @@ -4779,9 +4804,11 @@ diff -up firefox-101.0/third_party/drm/drm/xf86drm.h.libwebrtc-screen-cast-sync +#endif + +#endif -diff -up firefox-101.0/third_party/drm/libdrm/moz.build.libwebrtc-screen-cast-sync firefox-101.0/third_party/drm/libdrm/moz.build ---- firefox-101.0/third_party/drm/libdrm/moz.build.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.742522110 +0200 -+++ firefox-101.0/third_party/drm/libdrm/moz.build 2022-05-30 21:33:19.742522110 +0200 +diff --git a/third_party/drm/libdrm/moz.build b/third_party/drm/libdrm/moz.build +new file mode 100644 +index 0000000..3b37b91 +--- /dev/null ++++ b/third_party/drm/libdrm/moz.build @@ -0,0 +1,16 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: @@ -4799,9 +4826,11 @@ diff -up firefox-101.0/third_party/drm/libdrm/moz.build.libwebrtc-screen-cast-sy +LOCAL_INCLUDES += ['/third_party/drm'] + +FINAL_LIBRARY = 'xul' -diff -up firefox-101.0/third_party/drm/libdrm/mozdrm.cpp.libwebrtc-screen-cast-sync firefox-101.0/third_party/drm/libdrm/mozdrm.cpp ---- firefox-101.0/third_party/drm/libdrm/mozdrm.cpp.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.742522110 +0200 -+++ firefox-101.0/third_party/drm/libdrm/mozdrm.cpp 2022-05-30 21:33:19.742522110 +0200 +diff --git a/third_party/drm/libdrm/mozdrm.cpp b/third_party/drm/libdrm/mozdrm.cpp +new file mode 100644 +index 0000000..b2fb59b +--- /dev/null ++++ b/third_party/drm/libdrm/mozdrm.cpp @@ -0,0 +1,66 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: @@ -4869,17 +4898,21 @@ diff -up firefox-101.0/third_party/drm/libdrm/mozdrm.cpp.libwebrtc-screen-cast-s + } + return drmFreeDevices_fn(devices, count); +} -diff -up firefox-101.0/third_party/drm/README.libwebrtc-screen-cast-sync firefox-101.0/third_party/drm/README ---- firefox-101.0/third_party/drm/README.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.740522043 +0200 -+++ firefox-101.0/third_party/drm/README 2022-05-30 21:33:19.740522043 +0200 +diff --git a/third_party/gbm/README b/third_party/gbm/README +new file mode 100644 +index 0000000..4b6e2e8 +--- /dev/null ++++ b/third_party/gbm/README @@ -0,0 +1,4 @@ -+Libdrm is a drm library wrapper needed to build and run Firefox with -+Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/drm). ++Libgbm is a gbm library wrapper needed to build and run Firefox with ++Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/gbm). + -+libdrm directory stores headers of libdrm needed for build only. -diff -up firefox-101.0/third_party/gbm/gbm/gbm.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/gbm/gbm/gbm.h ---- firefox-101.0/third_party/gbm/gbm/gbm.h.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.742522110 +0200 -+++ firefox-101.0/third_party/gbm/gbm/gbm.h 2022-05-30 21:33:19.742522110 +0200 ++libgbm directory stores headers of libgbm needed for build only. +diff --git a/third_party/gbm/gbm/gbm.h b/third_party/gbm/gbm/gbm.h +new file mode 100644 +index 0000000..a963ed7 +--- /dev/null ++++ b/third_party/gbm/gbm/gbm.h @@ -0,0 +1,452 @@ +/* + * Copyright © 2011 Intel Corporation @@ -5333,9 +5366,11 @@ diff -up firefox-101.0/third_party/gbm/gbm/gbm.h.libwebrtc-screen-cast-sync fire +#endif + +#endif -diff -up firefox-101.0/third_party/gbm/libgbm/moz.build.libwebrtc-screen-cast-sync firefox-101.0/third_party/gbm/libgbm/moz.build ---- firefox-101.0/third_party/gbm/libgbm/moz.build.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.742522110 +0200 -+++ firefox-101.0/third_party/gbm/libgbm/moz.build 2022-05-30 21:33:19.742522110 +0200 +diff --git a/third_party/gbm/libgbm/moz.build b/third_party/gbm/libgbm/moz.build +new file mode 100644 +index 0000000..0953d2f +--- /dev/null ++++ b/third_party/gbm/libgbm/moz.build @@ -0,0 +1,16 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: @@ -5353,9 +5388,11 @@ diff -up firefox-101.0/third_party/gbm/libgbm/moz.build.libwebrtc-screen-cast-sy +LOCAL_INCLUDES += ['/third_party/gbm'] + +FINAL_LIBRARY = 'xul' -diff -up firefox-101.0/third_party/gbm/libgbm/mozgbm.cpp.libwebrtc-screen-cast-sync firefox-101.0/third_party/gbm/libgbm/mozgbm.cpp ---- firefox-101.0/third_party/gbm/libgbm/mozgbm.cpp.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.742522110 +0200 -+++ firefox-101.0/third_party/gbm/libgbm/mozgbm.cpp 2022-05-30 21:33:19.742522110 +0200 +diff --git a/third_party/gbm/libgbm/mozgbm.cpp b/third_party/gbm/libgbm/mozgbm.cpp +new file mode 100644 +index 0000000..bc024a1 +--- /dev/null ++++ b/third_party/gbm/libgbm/mozgbm.cpp @@ -0,0 +1,66 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: @@ -5423,69 +5460,10 @@ diff -up firefox-101.0/third_party/gbm/libgbm/mozgbm.cpp.libwebrtc-screen-cast-s + } + return gbm_device_destroy_fn(gbm); +} -diff -up firefox-101.0/third_party/gbm/README.libwebrtc-screen-cast-sync firefox-101.0/third_party/gbm/README ---- firefox-101.0/third_party/gbm/README.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.742522110 +0200 -+++ firefox-101.0/third_party/gbm/README 2022-05-30 21:33:19.742522110 +0200 -@@ -0,0 +1,4 @@ -+Libgbm is a gbm library wrapper needed to build and run Firefox with -+Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/gbm). -+ -+libgbm directory stores headers of libgbm needed for build only. -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build 2022-05-30 21:33:19.742522110 +0200 -@@ -76,6 +76,8 @@ if CONFIG["OS_TARGET"] == "Darwin": - LOCAL_INCLUDES += [ - "/media/libyuv/libyuv/include/", - "/media/libyuv/libyuv/include/", -+ "/third_party/drm/", -+ "/third_party/gbm/", - "/third_party/pipewire/" - ] - -@@ -105,7 +107,8 @@ if CONFIG["OS_TARGET"] == "Linux": - LOCAL_INCLUDES += [ - "/media/libyuv/libyuv/include/", - "/media/libyuv/libyuv/include/", -- "/third_party/pipewire/", -+ "/third_party/drm/", -+ "/third_party/gbm/", - "/third_party/pipewire/" - ] - -@@ -156,15 +159,18 @@ if CONFIG["OS_TARGET"] == "OpenBSD": - ] - - SOURCES += [ -- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" -+ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" - ] - - UNIFIED_SOURCES += [ - "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc", -- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_x11.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/shared_x_display.cc", -- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_x11.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/window_finder_x11.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/window_list_utils.cc", -@@ -206,6 +212,7 @@ if CONFIG["OS_TARGET"] == "WINNT": - LOCAL_INCLUDES += [ - "/media/libyuv/libyuv/include/", - "/media/libyuv/libyuv/include/", -+ "/third_party/drm/" - "/third_party/pipewire/" - ] - -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc 2022-05-30 21:33:19.742522110 +0200 +diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc +index c89896d..c8ef822 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc @@ -14,6 +14,9 @@ #elif defined(WEBRTC_WIN) #include "modules/desktop_capture/win/full_screen_win_application_handler.h" @@ -5496,7 +5474,7 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_cap namespace webrtc { -@@ -35,6 +38,9 @@ DesktopCaptureOptions DesktopCaptureOpti +@@ -35,6 +38,9 @@ DesktopCaptureOptions DesktopCaptureOptions::CreateDefault() { #if defined(WEBRTC_USE_X11) result.set_x_display(SharedXDisplay::CreateDefault()); #endif @@ -5506,9 +5484,10 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_cap #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) result.set_configuration_monitor(new DesktopConfigurationMonitor()); result.set_full_screen_window_detector( -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h.libwebrtc-screen-cast-sync 2022-05-27 01:17:04.000000000 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h 2022-05-30 21:33:19.743522143 +0200 +diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h +index ee0dd3a..ac56c8c 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h ++++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h @@ -17,6 +17,10 @@ #include "modules/desktop_capture/linux/shared_x_display.h" #endif @@ -5548,9 +5527,10 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_cap #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) rtc::scoped_refptr configuration_monitor_; bool allow_iosurface_ = false; -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc 2022-05-30 21:33:19.743522143 +0200 +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc +index 2fd3b1a..e4685fc 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc @@ -10,937 +10,67 @@ #include "modules/desktop_capture/linux/base_capturer_pipewire.h" @@ -5654,8 +5634,12 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_ - case PW_STREAM_STATE_CONNECTING: - break; - } --} -- ++BaseCapturerPipeWire::BaseCapturerPipeWire(const DesktopCaptureOptions& options) ++ : options_(options) { ++ screencast_portal_ = std::make_unique( ++ ScreenCastPortal::CaptureSourceType::kAnyScreenContent, this); + } + -// static -void BaseCapturerPipeWire::OnStreamParamChanged(void *data, uint32_t id, - const struct spa_pod *format) { @@ -5709,7 +5693,8 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_ - - struct pw_buffer *next_buffer; - struct pw_buffer *buffer = nullptr; -- ++BaseCapturerPipeWire::~BaseCapturerPipeWire() {} + - next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); - while (next_buffer) { - buffer = next_buffer; @@ -5722,13 +5707,23 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_ - - if (!buffer) { - return; -- } ++void BaseCapturerPipeWire::OnScreenCastRequestResult( ++ ScreenCastPortal::RequestResponse result, ++ uint32_t stream_node_id, ++ int fd) { ++ if (result != ScreenCastPortal::RequestResponse::kSuccess || ++ !options_.screencast_stream()->StartScreenCastStream(stream_node_id, ++ fd)) { ++ capturer_failed_ = true; ++ RTC_LOG(LS_ERROR) << "ScreenCastPortal failed: " ++ << static_cast(result); + } - - that->HandleBuffer(buffer); - - pw_stream_queue_buffer(that->pw_stream_, buffer); --} -- + } + -BaseCapturerPipeWire::BaseCapturerPipeWire(CaptureSourceType source_type) - : capture_source_type_(source_type) {} - @@ -5751,7 +5746,10 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_ - - if (pw_main_loop_) { - pw_thread_loop_destroy(pw_main_loop_); -- } ++void BaseCapturerPipeWire::OnScreenCastSessionClosed() { ++ if (!capturer_failed_) { ++ options_.screencast_stream()->StopScreenCastStream(); + } - - if (start_request_signal_id_) { - g_dbus_connection_signal_unsubscribe(connection_, start_request_signal_id_); @@ -5795,25 +5793,7 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_ - if (proxy_) { - g_object_unref(proxy_); - proxy_ = nullptr; -+BaseCapturerPipeWire::BaseCapturerPipeWire(const DesktopCaptureOptions& options) -+ : options_(options) { -+ screencast_portal_ = std::make_unique( -+ ScreenCastPortal::CaptureSourceType::kAnyScreenContent, this); -+} -+ -+BaseCapturerPipeWire::~BaseCapturerPipeWire() {} -+ -+void BaseCapturerPipeWire::OnScreenCastRequestResult( -+ ScreenCastPortal::RequestResponse result, -+ uint32_t stream_node_id, -+ int fd) { -+ if (result != ScreenCastPortal::RequestResponse::kSuccess || -+ !options_.screencast_stream()->StartScreenCastStream(stream_node_id, -+ fd)) { -+ capturer_failed_ = true; -+ RTC_LOG(LS_ERROR) << "ScreenCastPortal failed: " -+ << static_cast(result); - } +- } - - if (pw_fd_ != -1) { - close(pw_fd_); @@ -5916,20 +5896,17 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_ - } - - return stream; - } - +-} +- -static void SpaBufferUnmap(unsigned char *map, int map_size, bool IsDMABuf, int fd) { - if (map) { - if (IsDMABuf) { - SyncDmaBuf(fd, DMA_BUF_SYNC_END); - } - munmap(map, map_size); -+void BaseCapturerPipeWire::OnScreenCastSessionClosed() { -+ if (!capturer_failed_) { -+ options_.screencast_stream()->StopScreenCastStream(); - } - } - +- } +-} +- -void BaseCapturerPipeWire::HandleBuffer(pw_buffer* buffer) { - spa_buffer* spaBuffer = buffer->buffer; - uint8_t *map = nullptr; @@ -6466,8 +6443,8 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_ - g_object_unref(outlist); - - that->InitPipeWire(); --} -- + } + void BaseCapturerPipeWire::Start(Callback* callback) { RTC_DCHECK(!callback_); RTC_DCHECK(callback); @@ -6519,7 +6496,7 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_ } // Keep in sync with defines at browser/actors/WebRTCParent.jsm -@@ -953,31 +83,13 @@ void BaseCapturerPipeWire::CaptureFrame( +@@ -953,31 +83,13 @@ void BaseCapturerPipeWire::CaptureFrame() { #define PIPEWIRE_NAME "####_PIPEWIRE_PORTAL_####" bool BaseCapturerPipeWire::GetSourceList(SourceList* sources) { @@ -6552,9 +6529,10 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_ -} - } // namespace webrtc -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h 2022-05-30 21:33:19.743522143 +0200 +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h +index af8e20c..5db09e0 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h @@ -11,160 +11,39 @@ #ifndef MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ #define MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ @@ -6731,9 +6709,11 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/base_ }; } // namespace webrtc -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.743522143 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs 2022-05-30 21:33:19.743522143 +0200 +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs b/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs +new file mode 100644 +index 0000000..226979f +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs @@ -0,0 +1,11 @@ +// Copyright 2021 The WebRTC project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be @@ -6746,9 +6726,11 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.s +// xf86drm.h +int drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices); +void drmFreeDevices(drmDevicePtr devices[], int count); -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.743522143 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc 2022-05-30 21:33:19.743522143 +0200 +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc +new file mode 100644 +index 0000000..de63c2a +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc @@ -0,0 +1,695 @@ +/* + * Copyright 2021 The WebRTC project authors. All Rights Reserved. @@ -7445,9 +7427,11 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_d +} + +} // namespace webrtc -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.743522143 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h 2022-05-30 21:33:19.743522143 +0200 +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h +new file mode 100644 +index 0000000..b755d8b +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h @@ -0,0 +1,68 @@ +/* + * Copyright 2021 The WebRTC project authors. All Rights Reserved. @@ -7517,9 +7501,11 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_d +} // namespace webrtc + +#endif // MODULES_DESKTOP_CAPTURE_LINUX_EGL_DMABUF_H_ -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.743522143 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc 2022-05-30 21:33:19.743522143 +0200 +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc +new file mode 100644 +index 0000000..09dea24 +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2022 The WebRTC project authors. All Rights Reserved. @@ -7577,9 +7563,11 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse +} + +} // namespace webrtc -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.743522143 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h 2022-05-30 21:33:19.743522143 +0200 +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h +new file mode 100644 +index 0000000..9b9ccf7 +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h @@ -0,0 +1,41 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. @@ -7622,9 +7610,10 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse +} // namespace webrtc + +#endif // MODULES_DESKTOP_CAPTURE_LINUX_MOUSE_CURSOR_MONITOR_PIPEWIRE_H_ -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs 2022-05-30 21:33:19.743522143 +0200 +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs +index 3e21e9d..06a97b8 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs @@ -7,38 +7,44 @@ //------------------------------------------------ @@ -7684,18 +7673,21 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/pipew +pw_context *pw_context_new(pw_loop *main_loop, pw_properties *props, size_t user_data_size); +pw_core * pw_context_connect(pw_context *context, pw_properties *properties, size_t user_data_size); +pw_core * pw_context_connect_fd(pw_context *context, int fd, pw_properties *properties, size_t user_data_size); -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment 2022-05-30 21:33:19.744522177 +0200 +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment +index 9d7dbd2..06ae18d 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment @@ -5,4 +5,5 @@ extern "C" { #include +#include } -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.744522177 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc 2022-05-30 21:33:19.744522177 +0200 +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc +new file mode 100644 +index 0000000..51ca57a +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc @@ -0,0 +1,57 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. @@ -7754,9 +7746,11 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/scope +} + +} // namespace webrtc -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.744522177 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h 2022-05-30 21:33:19.744522177 +0200 +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h +new file mode 100644 +index 0000000..bf77855 +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h @@ -0,0 +1,65 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. @@ -7823,11 +7817,84 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/scope +} // namespace webrtc + +#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCOPED_GLIB_H_ -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.744522177 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc 2022-05-30 21:33:19.744522177 +0200 +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc +deleted file mode 100644 +index 3813d69..0000000 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc ++++ /dev/null +@@ -1,28 +0,0 @@ +-/* +- * Copyright 2018 The WebRTC project authors. All Rights Reserved. +- * +- * Use of this source code is governed by a BSD-style license +- * that can be found in the LICENSE file in the root of the source +- * tree. An additional intellectual property rights grant can be found +- * in the file PATENTS. All contributing project authors may +- * be found in the AUTHORS file in the root of the source tree. +- */ +- +-#include "modules/desktop_capture/linux/screen_capturer_pipewire.h" +- +-#include +- +-namespace webrtc { +- +-ScreenCapturerPipeWire::ScreenCapturerPipeWire() +- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kScreen) {} +-ScreenCapturerPipeWire::~ScreenCapturerPipeWire() {} +- +-// static +-std::unique_ptr +-ScreenCapturerPipeWire::CreateRawScreenCapturer( +- const DesktopCaptureOptions& options) { +- return std::make_unique(); +-} +- +-} // namespace webrtc +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h +deleted file mode 100644 +index 66dcd68..0000000 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h ++++ /dev/null +@@ -1,33 +0,0 @@ +-/* +- * Copyright 2018 The WebRTC project authors. All Rights Reserved. +- * +- * Use of this source code is governed by a BSD-style license +- * that can be found in the LICENSE file in the root of the source +- * tree. An additional intellectual property rights grant can be found +- * in the file PATENTS. All contributing project authors may +- * be found in the AUTHORS file in the root of the source tree. +- */ +- +-#ifndef MODULES_DESKTOP_CAPTURE_LINUX_SCREEN_CAPTURER_PIPEWIRE_H_ +-#define MODULES_DESKTOP_CAPTURE_LINUX_SCREEN_CAPTURER_PIPEWIRE_H_ +- +-#include +- +-#include "modules/desktop_capture/linux/base_capturer_pipewire.h" +- +-namespace webrtc { +- +-class ScreenCapturerPipeWire : public BaseCapturerPipeWire { +- public: +- ScreenCapturerPipeWire(); +- ~ScreenCapturerPipeWire() override; +- +- static std::unique_ptr CreateRawScreenCapturer( +- const DesktopCaptureOptions& options); +- +- RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerPipeWire); +-}; +- +-} // namespace webrtc +- +-#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCREEN_CAPTURER_PIPEWIRE_H_ +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc +new file mode 100644 +index 0000000..306e984 +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc @@ -0,0 +1,532 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. @@ -8361,9 +8428,11 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/scree +} + +} // namespace webrtc -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.744522177 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h 2022-05-30 21:33:19.744522177 +0200 +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h +new file mode 100644 +index 0000000..7da218e +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h @@ -0,0 +1,169 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. @@ -8534,9 +8603,11 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/scree +} // namespace webrtc + +#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCREENCAST_PORTAL_H_ -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.744522177 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc 2022-05-30 21:33:19.744522177 +0200 +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc +new file mode 100644 +index 0000000..c6ba661 +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc @@ -0,0 +1,872 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. @@ -9410,9 +9481,11 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/share +} + +} // namespace webrtc -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h.libwebrtc-screen-cast-sync 2022-05-30 21:33:19.744522177 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h 2022-05-30 21:33:19.744522177 +0200 +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h +new file mode 100644 +index 0000000..72411e5 +--- /dev/null ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h @@ -0,0 +1,71 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. @@ -9485,11 +9558,83 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/share +} // namespace webrtc + +#endif // MODULES_DESKTOP_CAPTURE_LINUX_SHARED_SCREENCAST_STREAM_H_ -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc 2022-05-30 21:33:19.745522210 +0200 +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc +deleted file mode 100644 +index c43a1f1..0000000 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc ++++ /dev/null +@@ -1,28 +0,0 @@ +-/* +- * Copyright 2018 The WebRTC project authors. All Rights Reserved. +- * +- * Use of this source code is governed by a BSD-style license +- * that can be found in the LICENSE file in the root of the source +- * tree. An additional intellectual property rights grant can be found +- * in the file PATENTS. All contributing project authors may +- * be found in the AUTHORS file in the root of the source tree. +- */ +- +-#include "modules/desktop_capture/linux/window_capturer_pipewire.h" +- +-#include +- +-namespace webrtc { +- +-WindowCapturerPipeWire::WindowCapturerPipeWire() +- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kWindow) {} +-WindowCapturerPipeWire::~WindowCapturerPipeWire() {} +- +-// static +-std::unique_ptr +-WindowCapturerPipeWire::CreateRawWindowCapturer( +- const DesktopCaptureOptions& options) { +- return std::make_unique(); +-} +- +-} // namespace webrtc +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h +deleted file mode 100644 +index 7f184ef..0000000 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h ++++ /dev/null +@@ -1,33 +0,0 @@ +-/* +- * Copyright 2018 The WebRTC project authors. All Rights Reserved. +- * +- * Use of this source code is governed by a BSD-style license +- * that can be found in the LICENSE file in the root of the source +- * tree. An additional intellectual property rights grant can be found +- * in the file PATENTS. All contributing project authors may +- * be found in the AUTHORS file in the root of the source tree. +- */ +- +-#ifndef MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_CAPTURER_PIPEWIRE_H_ +-#define MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_CAPTURER_PIPEWIRE_H_ +- +-#include +- +-#include "modules/desktop_capture/linux/base_capturer_pipewire.h" +- +-namespace webrtc { +- +-class WindowCapturerPipeWire : public BaseCapturerPipeWire { +- public: +- WindowCapturerPipeWire(); +- ~WindowCapturerPipeWire() override; +- +- static std::unique_ptr CreateRawWindowCapturer( +- const DesktopCaptureOptions& options); +- +- RTC_DISALLOW_COPY_AND_ASSIGN(WindowCapturerPipeWire); +-}; +- +-} // namespace webrtc +- +-#endif // MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_CAPTURER_PIPEWIRE_H_ +diff --git a/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc b/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc +index e569f6e..3bb51e8 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc @@ -17,6 +17,10 @@ #include "modules/desktop_capture/linux/mouse_cursor_monitor_x11.h" #endif // defined(WEBRTC_USE_X11) @@ -9501,7 +9646,7 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/mouse_curso namespace webrtc { // static -@@ -44,6 +48,13 @@ MouseCursorMonitor* MouseCursorMonitor:: +@@ -44,6 +48,13 @@ MouseCursorMonitor* MouseCursorMonitor::CreateForScreen( // static std::unique_ptr MouseCursorMonitor::Create( const DesktopCaptureOptions& options) { @@ -9515,9 +9660,10 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/mouse_curso #if defined(WEBRTC_USE_X11) return MouseCursorMonitorX11::Create(options); #else -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc 2022-05-30 21:33:19.745522210 +0200 +diff --git a/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc b/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc +index 57a2002..b44ae35 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc @@ -14,7 +14,7 @@ #include "modules/desktop_capture/desktop_capturer.h" @@ -9527,7 +9673,7 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/screen_capt #endif // defined(WEBRTC_USE_PIPEWIRE) #if defined(WEBRTC_USE_X11) -@@ -28,7 +28,7 @@ std::unique_ptr Desktop +@@ -28,7 +28,7 @@ std::unique_ptr DesktopCapturer::CreateRawScreenCapturer( const DesktopCaptureOptions& options) { #if defined(WEBRTC_USE_PIPEWIRE) if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { @@ -9536,9 +9682,10 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/screen_capt } #endif // defined(WEBRTC_USE_PIPEWIRE) -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc 2022-05-30 21:33:19.745522210 +0200 +diff --git a/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc b/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc +index ed03ba0..3bc6577 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc @@ -14,7 +14,7 @@ #include "modules/desktop_capture/desktop_capturer.h" @@ -9548,7 +9695,7 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/window_capt #endif // defined(WEBRTC_USE_PIPEWIRE) #if defined(WEBRTC_USE_X11) -@@ -28,7 +28,7 @@ std::unique_ptr Desktop +@@ -28,7 +28,7 @@ std::unique_ptr DesktopCapturer::CreateRawWindowCapturer( const DesktopCaptureOptions& options) { #if defined(WEBRTC_USE_PIPEWIRE) if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { @@ -9557,10 +9704,11 @@ diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/window_capt } #endif // defined(WEBRTC_USE_PIPEWIRE) -diff -up firefox-101.0/third_party/moz.build.libwebrtc-screen-cast-sync firefox-101.0/third_party/moz.build ---- firefox-101.0/third_party/moz.build.libwebrtc-screen-cast-sync 2022-05-27 01:17:04.000000000 +0200 -+++ firefox-101.0/third_party/moz.build 2022-05-30 21:33:19.745522210 +0200 -@@ -58,6 +58,12 @@ with Files("libwebrtc/**"): +diff --git a/third_party/moz.build b/third_party/moz.build +index 1941c11..f804531 100644 +--- a/third_party/moz.build ++++ b/third_party/moz.build +@@ -49,6 +49,12 @@ with Files("libwebrtc/**"): with Files("pipewire/**"): BUG_COMPONENT = ("Core", "WebRTC") @@ -9573,10 +9721,11 @@ diff -up firefox-101.0/third_party/moz.build.libwebrtc-screen-cast-sync firefox- with Files('rlbox_wasm2c_sandbox/**'): BUG_COMPONENT = ('Firefox Build System', 'General') -diff -up firefox-101.0/third_party/pipewire/libpipewire/mozpipewire.cpp.libwebrtc-screen-cast-sync firefox-101.0/third_party/pipewire/libpipewire/mozpipewire.cpp ---- firefox-101.0/third_party/pipewire/libpipewire/mozpipewire.cpp.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 -+++ firefox-101.0/third_party/pipewire/libpipewire/mozpipewire.cpp 2022-05-30 21:33:19.745522210 +0200 -@@ -69,11 +69,13 @@ static int (*pw_stream_connect_fn)(struc +diff --git a/third_party/pipewire/libpipewire/mozpipewire.cpp b/third_party/pipewire/libpipewire/mozpipewire.cpp +index 1ecfc31..fbeeb8e 100644 +--- a/third_party/pipewire/libpipewire/mozpipewire.cpp ++++ b/third_party/pipewire/libpipewire/mozpipewire.cpp +@@ -69,11 +69,13 @@ static int (*pw_stream_connect_fn)(struct pw_stream *stream, enum pw_stream_flags flags, const struct spa_pod **params, uint32_t n_params); @@ -9590,7 +9739,7 @@ diff -up firefox-101.0/third_party/pipewire/libpipewire/mozpipewire.cpp.libwebrt static int (*pw_stream_queue_buffer_fn)(struct pw_stream *stream, struct pw_buffer *buffer); static int (*pw_stream_update_params_fn)(struct pw_stream *stream, -@@ -87,7 +89,10 @@ static int (*pw_thread_loop_start_fn)(st +@@ -87,7 +89,10 @@ static int (*pw_thread_loop_start_fn)(struct pw_thread_loop *loop); static void (*pw_thread_loop_stop_fn)(struct pw_thread_loop *loop); static void (*pw_thread_loop_lock_fn)(struct pw_thread_loop *loop); static void (*pw_thread_loop_unlock_fn)(struct pw_thread_loop *loop); @@ -9640,7 +9789,7 @@ diff -up firefox-101.0/third_party/pipewire/libpipewire/mozpipewire.cpp.libwebrt } return IsPwLibraryLoaded(); -@@ -242,6 +255,15 @@ pw_stream_connect(struct pw_stream *stre +@@ -242,6 +255,15 @@ pw_stream_connect(struct pw_stream *stream, params, n_params); } @@ -9656,7 +9805,7 @@ diff -up firefox-101.0/third_party/pipewire/libpipewire/mozpipewire.cpp.libwebrt struct pw_buffer * pw_stream_dequeue_buffer(struct pw_stream *stream) { -@@ -356,6 +378,23 @@ pw_thread_loop_unlock(struct pw_thread_l +@@ -356,6 +378,23 @@ pw_thread_loop_unlock(struct pw_thread_loop *loop) return pw_thread_loop_unlock_fn(loop); } @@ -9680,7 +9829,7 @@ diff -up firefox-101.0/third_party/pipewire/libpipewire/mozpipewire.cpp.libwebrt struct pw_properties * pw_properties_new_string(const char *str) -@@ -366,3 +405,12 @@ pw_properties_new_string(const char *str +@@ -366,3 +405,12 @@ pw_properties_new_string(const char *str) return pw_properties_new_string_fn(str); } @@ -9693,3 +9842,75 @@ diff -up firefox-101.0/third_party/pipewire/libpipewire/mozpipewire.cpp.libwebrt + return pw_get_library_version_fn(); +} + +diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build +--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 ++++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build 2022-06-02 12:48:28.316640076 +0200 +@@ -76,6 +76,8 @@ if CONFIG["OS_TARGET"] == "Darwin": + LOCAL_INCLUDES += [ + "/media/libyuv/libyuv/include/", + "/media/libyuv/libyuv/include/", ++ "/third_party/drm/", ++ "/third_party/gbm/", + "/third_party/pipewire/" + ] + +@@ -105,7 +107,8 @@ if CONFIG["OS_TARGET"] == "Linux": + LOCAL_INCLUDES += [ + "/media/libyuv/libyuv/include/", + "/media/libyuv/libyuv/include/", +- "/third_party/pipewire/", ++ "/third_party/drm/", ++ "/third_party/gbm/", + "/third_party/pipewire/" + ] + +@@ -115,12 +118,16 @@ if CONFIG["OS_TARGET"] == "Linux": + ] + + SOURCES += [ +- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" ++ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" ++ + ] + + UNIFIED_SOURCES += [ +- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", +- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc", + "/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc", + "/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc", + "/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc" +@@ -156,15 +163,18 @@ if CONFIG["OS_TARGET"] == "OpenBSD": + ] + + SOURCES += [ +- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" ++ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" + ] + + UNIFIED_SOURCES += [ + "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc", +- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_x11.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/shared_x_display.cc", +- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_x11.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/window_finder_x11.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/window_list_utils.cc", +@@ -206,6 +216,7 @@ if CONFIG["OS_TARGET"] == "WINNT": + LOCAL_INCLUDES += [ + "/media/libyuv/libyuv/include/", + "/media/libyuv/libyuv/include/", ++ "/third_party/drm/" + "/third_party/pipewire/" + ] + From 2c9b4467e21d5852bb5db3c70f46548edb307a04 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 2 Jun 2022 15:25:54 +0200 Subject: [PATCH 053/545] Updated cbindgen to 0.23.0 --- gen_cbindgen-vendor.sh | 2 +- sources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gen_cbindgen-vendor.sh b/gen_cbindgen-vendor.sh index 395613f..c446a51 100755 --- a/gen_cbindgen-vendor.sh +++ b/gen_cbindgen-vendor.sh @@ -12,7 +12,7 @@ to be used with 'cargo vendor' commmand. """ [dependencies] -cbindgen = "0.19.0" +cbindgen = "0.23.0" [[bin]] name = "dummy" diff --git a/sources b/sources index 39a05eb..0b97dec 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ -SHA512 (cbindgen-vendor.tar.xz) = b9ab1498be90ecf60822df7021f8812f124550d97f8cd687c69d3ab56fc5fb714bfe88c78c978a1794d211724909a9a5cad6a4b483fa05f762909c45d5075520 SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 SHA512 (firefox-101.0.source.tar.xz) = fffe7e0940c1443fcdc5b205677764cb4e04b29f33fcfafb2857d383700584f309806b81fc4989efb56cc12a3cca1ff7d451b647050c43e98777b5c952ed5d56 SHA512 (firefox-langpacks-101.0-20220530.tar.xz) = aa81113b6aef965aa17921d563759da6c499021b6f471369d998c35802f72e79a107080b4df59ca51dae15ac464176f23bce2fc84942f5852e810d963553b687 +SHA512 (cbindgen-vendor.tar.xz) = 2bfec52455f133ede2fb7f7e8bcd358cb547a82cbb01e8cef477fe0700ebdfd9cf647cd93a6c11d3b321e441a142e26793c7a7865dba5c93033250ae78cf6b4b From 61879d2c53a0473a24b4a9a69fcedd1af8f74fdf Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 7 Jun 2022 11:19:41 +0200 Subject: [PATCH 054/545] Enabled VA-API by default (+ added VA-API fixes from upstream), Fixed WebGL performance on NVIDIA drivers (mzbz#1735929) --- D144284.diff | 77 ++++++++++++++ D145725.diff | 132 ++++++++++++++++++++++++ D145871.diff | 140 ++++++++++++++++++++++++++ D145966.diff | 20 ++++ D146084.diff | 17 ++++ D146085.diff | 205 +++++++++++++++++++++++++++++++++++++ D146086.diff | 65 ++++++++++++ D146087.diff | 19 ++++ D147420.diff | 179 +++++++++++++++++++++++++++++++++ D147635.diff | 125 +++++++++++++++++++++++ D147636.diff | 278 +++++++++++++++++++++++++++++++++++++++++++++++++++ D147637.diff | 113 +++++++++++++++++++++ D147720.diff | 73 ++++++++++++++ D147874.diff | 64 ++++++++++++ firefox.spec | 44 +++++++- 15 files changed, 1550 insertions(+), 1 deletion(-) create mode 100644 D144284.diff create mode 100644 D145725.diff create mode 100644 D145871.diff create mode 100644 D145966.diff create mode 100644 D146084.diff create mode 100644 D146085.diff create mode 100644 D146086.diff create mode 100644 D146087.diff create mode 100644 D147420.diff create mode 100644 D147635.diff create mode 100644 D147636.diff create mode 100644 D147637.diff create mode 100644 D147720.diff create mode 100644 D147874.diff diff --git a/D144284.diff b/D144284.diff new file mode 100644 index 0000000..d838254 --- /dev/null +++ b/D144284.diff @@ -0,0 +1,77 @@ +diff --git a/gfx/layers/DMABUFSurfaceImage.cpp b/gfx/layers/DMABUFSurfaceImage.cpp +--- a/gfx/layers/DMABUFSurfaceImage.cpp ++++ b/gfx/layers/DMABUFSurfaceImage.cpp +@@ -39,20 +39,20 @@ + + StaticRefPtr sSnapshotContext; + static StaticMutex sSnapshotContextMutex MOZ_UNANNOTATED; + + already_AddRefed DMABUFSurfaceImage::GetAsSourceSurface() { ++ StaticMutexAutoLock lock(sSnapshotContextMutex); + if (!sSnapshotContext) { + nsCString discardFailureId; + sSnapshotContext = GLContextProvider::CreateHeadless({}, &discardFailureId); + if (!sSnapshotContext) { + gfxCriticalError() << "Failed to create snapshot GLContext."; + return nullptr; + } + } + +- StaticMutexAutoLock lock(sSnapshotContextMutex); + sSnapshotContext->MakeCurrent(); + + auto releaseTextures = + mozilla::MakeScopeExit([&] { mSurface->ReleaseTextures(); }); + +diff --git a/widget/gtk/DMABufSurface.cpp b/widget/gtk/DMABufSurface.cpp +--- a/widget/gtk/DMABufSurface.cpp ++++ b/widget/gtk/DMABufSurface.cpp +@@ -53,24 +53,13 @@ + using namespace mozilla::layers; + + #define BUFFER_FLAGS 0 + + static RefPtr sSnapshotContext; ++static StaticMutex sSnapshotContextMutex MOZ_UNANNOTATED; + static Atomic gNewSurfaceUID(1); + +-bool EnsureSnapshotGLContext() { +- if (!sSnapshotContext) { +- nsCString discardFailureId; +- sSnapshotContext = GLContextProvider::CreateHeadless({}, &discardFailureId); +- if (!sSnapshotContext) { +- NS_WARNING("Failed to create snapshot GLContext"); +- return false; +- } +- } +- return true; +-} +- + bool DMABufSurface::IsGlobalRefSet() const { + if (!mGlobalRefCountFd) { + return false; + } + struct pollfd pfd; +@@ -1263,13 +1252,18 @@ + } + + bool DMABufSurfaceYUV::VerifyTextureCreation() { + LOGDMABUF(("DMABufSurfaceYUV::VerifyTextureCreation() UID %d", mUID)); + +- if (!EnsureSnapshotGLContext()) { +- LOGDMABUF((" failed to create GL context!")); +- return false; ++ StaticMutexAutoLock lock(sSnapshotContextMutex); ++ if (!sSnapshotContext) { ++ nsCString discardFailureId; ++ sSnapshotContext = GLContextProvider::CreateHeadless({}, &discardFailureId); ++ if (!sSnapshotContext) { ++ NS_WARNING("Failed to create snapshot GLContext"); ++ return false; ++ } + } + + auto release = MakeScopeExit([&] { ReleaseEGLImages(sSnapshotContext); }); + + for (int i = 0; i < mBufferPlaneCount; i++) { + diff --git a/D145725.diff b/D145725.diff new file mode 100644 index 0000000..1c28b10 --- /dev/null +++ b/D145725.diff @@ -0,0 +1,132 @@ +diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h +--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h ++++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h +@@ -106,10 +106,11 @@ + bool IsHardwareAccelerated(nsACString& aFailureReason) const override; + bool IsHardwareAccelerated() const { + nsAutoCString dummy; + return IsHardwareAccelerated(dummy); + } ++ void UpdateDecodeTimes(TimeStamp aDecodeStart); + + #if LIBAVCODEC_VERSION_MAJOR >= 57 && LIBAVUTIL_VERSION_MAJOR >= 56 + layers::TextureClient* AllocateTextureClientForImage( + struct AVCodecContext* aCodecContext, layers::PlanarYCbCrImage* aImage); + +@@ -142,10 +143,15 @@ + static nsTArray mAcceleratedFormats; + #endif + RefPtr mImageAllocator; + RefPtr mImageContainer; + VideoInfo mInfo; ++ int mDecodedFrames; ++#if LIBAVCODEC_VERSION_MAJOR >= 58 ++ int mDecodedFramesLate; ++#endif ++ float mAverangeDecodeTime; + + class PtsCorrectionContext { + public: + PtsCorrectionContext(); + int64_t GuessCorrectPts(int64_t aPts, int64_t aDts); +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 +@@ -383,10 +383,15 @@ + mDisplay(nullptr), + #endif + mImageAllocator(aAllocator), + mImageContainer(aImageContainer), + mInfo(aConfig), ++ mDecodedFrames(0), ++#if LIBAVCODEC_VERSION_MAJOR >= 58 ++ mDecodedFramesLate(0), ++#endif ++ mAverangeDecodeTime(0), + mLowLatency(aLowLatency) { + FFMPEG_LOG("FFmpegVideoDecoder::FFmpegVideoDecoder MIME %s Codec ID %d", + aConfig.mMimeType.get(), mCodecID); + // Use a new MediaByteBuffer as the object will be modified during + // initialization. +@@ -769,17 +774,41 @@ + #else + return aFrame->pkt_pts; + #endif + } + ++void FFmpegVideoDecoder::UpdateDecodeTimes(TimeStamp aDecodeStart) { ++ mDecodedFrames++; ++ float decodeTime = (TimeStamp::Now() - aDecodeStart).ToMilliseconds(); ++ mAverangeDecodeTime = ++ (mAverangeDecodeTime * (mDecodedFrames - 1) + decodeTime) / ++ mDecodedFrames; ++ FFMPEG_LOG(" averange frame decode time %.2f ms decoded frames %d\n", ++ mAverangeDecodeTime, mDecodedFrames); ++#if LIBAVCODEC_VERSION_MAJOR >= 58 ++ int frameDuration = mFrame->pkt_duration; ++ if (frameDuration > 0 && frameDuration / 1000.0 < decodeTime) { ++ mDecodedFramesLate++; ++ FFMPEG_LOG( ++ " slow decode: failed to decode in time, frame duration %.2f ms, " ++ "decode time %.2f\n", ++ frameDuration / 1000.0, decodeTime); ++ FFMPEG_LOG(" all decoded frames / late decoded frames %d/%d\n", ++ mDecodedFrames, mDecodedFramesLate); ++ } ++#endif ++} ++ + MediaResult FFmpegVideoDecoder::DoDecode( + MediaRawData* aSample, uint8_t* aData, int aSize, bool* aGotFrame, + MediaDataDecoder::DecodedData& aResults) { + MOZ_ASSERT(mTaskQueue->IsOnCurrentThread()); + AVPacket packet; + mLib->av_init_packet(&packet); + ++ TimeStamp decodeStart = TimeStamp::Now(); ++ + packet.data = aData; + packet.size = aSize; + packet.dts = aSample->mTimecode.ToMicroseconds(); + packet.pts = aSample->mTime.ToMicroseconds(); + packet.flags = aSample->mKeyframe ? AV_PKT_FLAG_KEY : 0; +@@ -794,11 +823,10 @@ + // at a time, and we immediately call avcodec_receive_frame right after. + FFMPEG_LOG("avcodec_send_packet error: %d", res); + return MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, + RESULT_DETAIL("avcodec_send_packet error: %d", res)); + } +- + if (aGotFrame) { + *aGotFrame = false; + } + do { + if (!PrepareFrame()) { +@@ -831,10 +859,13 @@ + FFMPEG_LOG(" avcodec_receive_frame error: %d", res); + return MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, + RESULT_DETAIL("avcodec_receive_frame error: %d", res)); + } + ++ UpdateDecodeTimes(decodeStart); ++ decodeStart = TimeStamp::Now(); ++ + MediaResult rv; + # ifdef MOZ_WAYLAND_USE_VAAPI + if (IsHardwareAccelerated()) { + rv = CreateImageVAAPI(mFrame->pkt_pos, GetFramePts(mFrame), + mFrame->pkt_duration, aResults); +@@ -898,10 +929,12 @@ + *aGotFrame = false; + } + return NS_OK; + } + ++ UpdateDecodeTimes(decodeStart); ++ + // If we've decoded a frame then we need to output it + int64_t pts = + mPtsContext.GuessCorrectPts(GetFramePts(mFrame), mFrame->pkt_dts); + // Retrieve duration from dts. + // We use the first entry found matching this dts (this is done to + diff --git a/D145871.diff b/D145871.diff new file mode 100644 index 0000000..33a2e61 --- /dev/null +++ b/D145871.diff @@ -0,0 +1,140 @@ +diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h +--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h ++++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h +@@ -146,10 +146,15 @@ + RefPtr mImageContainer; + VideoInfo mInfo; + int mDecodedFrames; + #if LIBAVCODEC_VERSION_MAJOR >= 58 + int mDecodedFramesLate; ++ // Tracks when decode time of recent frame and averange decode time of ++ // previous frames is bigger than frame interval, ++ // i.e. we fail to decode in time. ++ // We switch to SW decode when we hit HW_DECODE_LATE_FRAMES treshold. ++ int mMissedDecodeInAverangeTime; + #endif + float mAverangeDecodeTime; + + class PtsCorrectionContext { + public: +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 +@@ -14,10 +14,13 @@ + #include "VPXDecoder.h" + #include "mozilla/layers/KnowsCompositor.h" + #if LIBAVCODEC_VERSION_MAJOR >= 57 + # include "mozilla/layers/TextureClient.h" + #endif ++#if LIBAVCODEC_VERSION_MAJOR >= 58 ++# include "mozilla/ProfilerMarkers.h" ++#endif + #ifdef MOZ_WAYLAND_USE_VAAPI + # include "H264.h" + # include "mozilla/layers/DMABUFSurfaceImage.h" + # include "mozilla/widget/DMABufLibWrapper.h" + # include "FFmpegVideoFramePool.h" +@@ -56,13 +59,14 @@ + typedef int VAStatus; + # define VA_EXPORT_SURFACE_READ_ONLY 0x0001 + # define VA_EXPORT_SURFACE_SEPARATE_LAYERS 0x0004 + # define VA_STATUS_SUCCESS 0x00000000 + #endif +- + // Use some extra HW frames for potential rendering lags. + #define EXTRA_HW_FRAMES 6 ++// Defines number of delayed frames until we switch back to SW decode. ++#define HW_DECODE_LATE_FRAMES 15 + + #if LIBAVCODEC_VERSION_MAJOR >= 57 && LIBAVUTIL_VERSION_MAJOR >= 56 + # define CUSTOMIZED_BUFFER_ALLOCATION 1 + #endif + +@@ -386,10 +390,11 @@ + mImageContainer(aImageContainer), + mInfo(aConfig), + mDecodedFrames(0), + #if LIBAVCODEC_VERSION_MAJOR >= 58 + mDecodedFramesLate(0), ++ mMissedDecodeInAverangeTime(0), + #endif + mAverangeDecodeTime(0), + mLowLatency(aLowLatency) { + FFMPEG_LOG("FFmpegVideoDecoder::FFmpegVideoDecoder MIME %s Codec ID %d", + aConfig.mMimeType.get(), mCodecID); +@@ -781,22 +786,32 @@ + float decodeTime = (TimeStamp::Now() - aDecodeStart).ToMilliseconds(); + mAverangeDecodeTime = + (mAverangeDecodeTime * (mDecodedFrames - 1) + decodeTime) / + mDecodedFrames; + FFMPEG_LOG( +- " decode time %.2f ms averange decode time %.2f ms decoded frames %d\n", ++ "Frame decode finished, time %.2f ms averange decode time %.2f ms " ++ "decoded %d frames\n", + decodeTime, mAverangeDecodeTime, mDecodedFrames); + #if LIBAVCODEC_VERSION_MAJOR >= 58 +- int frameDuration = mFrame->pkt_duration; +- if (frameDuration > 0 && frameDuration / 1000.0 < decodeTime) { +- mDecodedFramesLate++; +- FFMPEG_LOG( +- " slow decode: failed to decode in time, frame duration %.2f ms, " +- "decode time %.2f\n", +- frameDuration / 1000.0, decodeTime); +- FFMPEG_LOG(" all decoded frames / late decoded frames %d/%d\n", +- mDecodedFrames, mDecodedFramesLate); ++ if (mFrame->pkt_duration > 0) { ++ // Switch frame duration to ms ++ float frameDuration = mFrame->pkt_duration / 1000.0f; ++ if (frameDuration < decodeTime) { ++ PROFILER_MARKER_TEXT("FFmpegVideoDecoder::DoDecode", MEDIA_PLAYBACK, {}, ++ "frame decode takes too long"); ++ mDecodedFramesLate++; ++ if (frameDuration < mAverangeDecodeTime) { ++ mMissedDecodeInAverangeTime++; ++ } ++ FFMPEG_LOG( ++ " slow decode: failed to decode in time, frame duration %.2f ms, " ++ "decode time %.2f\n", ++ frameDuration, decodeTime); ++ FFMPEG_LOG(" frames: all decoded %d late decoded %d over averange %d\n", ++ mDecodedFrames, mDecodedFramesLate, ++ mMissedDecodeInAverangeTime); ++ } + } + #endif + } + + MediaResult FFmpegVideoDecoder::DoDecode( +@@ -866,10 +881,18 @@ + decodeStart = TimeStamp::Now(); + + MediaResult rv; + # ifdef MOZ_WAYLAND_USE_VAAPI + if (IsHardwareAccelerated()) { ++ if (mMissedDecodeInAverangeTime > HW_DECODE_LATE_FRAMES) { ++ PROFILER_MARKER_TEXT("FFmpegVideoDecoder::DoDecode", MEDIA_PLAYBACK, {}, ++ "Fallback to SW decode"); ++ FFMPEG_LOG(" HW decoding is slow, switch back to SW decode"); ++ return MediaResult( ++ NS_ERROR_DOM_MEDIA_DECODE_ERR, ++ RESULT_DETAIL("HW decoding is slow, switch back to SW decode")); ++ } + rv = CreateImageVAAPI(mFrame->pkt_pos, GetFramePts(mFrame), + mFrame->pkt_duration, aResults); + // If VA-API playback failed, just quit. Decoder is going to be restarted + // without VA-API. + if (NS_FAILED(rv)) { +@@ -1129,11 +1152,11 @@ + } + + MediaResult FFmpegVideoDecoder::CreateImageVAAPI( + int64_t aOffset, int64_t aPts, int64_t aDuration, + MediaDataDecoder::DecodedData& aResults) { +- FFMPEG_LOG("VA-API Got one frame output with pts=%" PRId64 "dts=%" PRId64 ++ FFMPEG_LOG("VA-API Got one frame output with pts=%" PRId64 " dts=%" PRId64 + " duration=%" PRId64 " opaque=%" PRId64, + aPts, mFrame->pkt_dts, aDuration, mCodecContext->reordered_opaque); + + VADRMPRIMESurfaceDescriptor vaDesc; + if (!GetVAAPISurfaceDescriptor(&vaDesc)) { + diff --git a/D145966.diff b/D145966.diff new file mode 100644 index 0000000..2ecfaec --- /dev/null +++ b/D145966.diff @@ -0,0 +1,20 @@ +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 +@@ -780,12 +780,13 @@ + mDecodedFrames++; + float decodeTime = (TimeStamp::Now() - aDecodeStart).ToMilliseconds(); + mAverangeDecodeTime = + (mAverangeDecodeTime * (mDecodedFrames - 1) + decodeTime) / + mDecodedFrames; +- FFMPEG_LOG(" averange frame decode time %.2f ms decoded frames %d\n", +- mAverangeDecodeTime, mDecodedFrames); ++ FFMPEG_LOG( ++ " decode time %.2f ms averange decode time %.2f ms decoded frames %d\n", ++ decodeTime, mAverangeDecodeTime, mDecodedFrames); + #if LIBAVCODEC_VERSION_MAJOR >= 58 + int frameDuration = mFrame->pkt_duration; + if (frameDuration > 0 && frameDuration / 1000.0 < decodeTime) { + mDecodedFramesLate++; + FFMPEG_LOG( + diff --git a/D146084.diff b/D146084.diff new file mode 100644 index 0000000..8ed2c28 --- /dev/null +++ b/D146084.diff @@ -0,0 +1,17 @@ +diff --git a/gfx/layers/ipc/LayersSurfaces.ipdlh b/gfx/layers/ipc/LayersSurfaces.ipdlh +--- a/gfx/layers/ipc/LayersSurfaces.ipdlh ++++ b/gfx/layers/ipc/LayersSurfaces.ipdlh +@@ -57,10 +57,12 @@ + uint64_t[] modifier; + uint32_t flags; + FileDescriptor[] fds; + uint32_t[] width; + uint32_t[] height; ++ uint32_t[] widthAligned; ++ uint32_t[] heightAligned; + uint32_t[] format; + uint32_t[] strides; + uint32_t[] offsets; + YUVColorSpace yUVColorSpace; + ColorRange colorRange; + diff --git a/D146085.diff b/D146085.diff new file mode 100644 index 0000000..6b037f6 --- /dev/null +++ b/D146085.diff @@ -0,0 +1,205 @@ +diff --git a/widget/gtk/DMABufSurface.h b/widget/gtk/DMABufSurface.h +--- a/widget/gtk/DMABufSurface.h ++++ b/widget/gtk/DMABufSurface.h +@@ -275,11 +275,11 @@ + static already_AddRefed CreateYUVSurface( + int aWidth, int aHeight, void** aPixelData = nullptr, + int* aLineSizes = nullptr); + + static already_AddRefed CreateYUVSurface( +- const VADRMPRIMESurfaceDescriptor& aDesc); ++ const VADRMPRIMESurfaceDescriptor& aDesc, int aWidth, int aHeight); + + bool Serialize(mozilla::layers::SurfaceDescriptor& aOutDescriptor); + + DMABufSurfaceYUV* GetAsDMABufSurfaceYUV() { return this; }; + +@@ -304,11 +304,12 @@ + mozilla::gfx::YUVColorSpace GetYUVColorSpace() { return mColorSpace; } + + DMABufSurfaceYUV(); + + bool UpdateYUVData(void** aPixelData, int* aLineSizes); +- bool UpdateYUVData(const VADRMPRIMESurfaceDescriptor& aDesc); ++ bool UpdateYUVData(const VADRMPRIMESurfaceDescriptor& aDesc, int aWidth, ++ int aHeight); + + bool VerifyTextureCreation(); + + private: + ~DMABufSurfaceYUV(); +@@ -329,10 +330,15 @@ + bool CreateEGLImage(mozilla::gl::GLContext* aGLContext, int aPlane); + void ReleaseEGLImages(mozilla::gl::GLContext* aGLContext); + + int mWidth[DMABUF_BUFFER_PLANES]; + int mHeight[DMABUF_BUFFER_PLANES]; ++ // Aligned size of the surface imported from VADRMPRIMESurfaceDescriptor. ++ // It's used only internally to create EGLImage as some GL drivers ++ // needs that (Bug 1724385). ++ int mWidthAligned[DMABUF_BUFFER_PLANES]; ++ int mHeightAligned[DMABUF_BUFFER_PLANES]; + EGLImageKHR mEGLImage[DMABUF_BUFFER_PLANES]; + GLuint mTexture[DMABUF_BUFFER_PLANES]; + mozilla::gfx::YUVColorSpace mColorSpace = + mozilla::gfx::YUVColorSpace::Default; + }; +diff --git a/widget/gtk/DMABufSurface.cpp b/widget/gtk/DMABufSurface.cpp +--- a/widget/gtk/DMABufSurface.cpp ++++ b/widget/gtk/DMABufSurface.cpp +@@ -479,13 +479,13 @@ + if (mGlobalRefCountFd) { + refCountFDs.AppendElement(ipc::FileDescriptor(mGlobalRefCountFd)); + } + + aOutDescriptor = SurfaceDescriptorDMABuf( +- mSurfaceType, modifiers, mGbmBufferFlags, fds, width, height, format, +- strides, offsets, GetYUVColorSpace(), mColorRange, fenceFDs, mUID, +- refCountFDs); ++ mSurfaceType, modifiers, mGbmBufferFlags, fds, width, height, width, ++ height, format, strides, offsets, GetYUVColorSpace(), mColorRange, ++ fenceFDs, mUID, refCountFDs); + return true; + } + + bool DMABufSurfaceRGBA::CreateTexture(GLContext* aGLContext, int aPlane) { + MOZ_ASSERT(!mEGLImage && !mTexture, "EGLImage is already created!"); +@@ -807,15 +807,15 @@ + } + return surf.forget(); + } + + already_AddRefed DMABufSurfaceYUV::CreateYUVSurface( +- const VADRMPRIMESurfaceDescriptor& aDesc) { ++ const VADRMPRIMESurfaceDescriptor& aDesc, int aWidth, int aHeight) { + RefPtr surf = new DMABufSurfaceYUV(); + LOGDMABUF(("DMABufSurfaceYUV::CreateYUVSurface() UID %d from desc\n", + surf->GetUID())); +- if (!surf->UpdateYUVData(aDesc)) { ++ if (!surf->UpdateYUVData(aDesc, aWidth, aHeight)) { + return nullptr; + } + return surf.forget(); + } + +@@ -829,11 +829,16 @@ + } + return surf.forget(); + } + + DMABufSurfaceYUV::DMABufSurfaceYUV() +- : DMABufSurface(SURFACE_NV12), mWidth(), mHeight(), mTexture() { ++ : DMABufSurface(SURFACE_NV12), ++ mWidth(), ++ mHeight(), ++ mWidthAligned(), ++ mHeightAligned(), ++ mTexture() { + for (int i = 0; i < DMABUF_BUFFER_PLANES; i++) { + mEGLImage[i] = LOCAL_EGL_NO_IMAGE; + } + } + +@@ -870,11 +875,12 @@ + close(mDmabufFds[aPlane]); + mDmabufFds[aPlane] = -1; + } + } + +-bool DMABufSurfaceYUV::UpdateYUVData(const VADRMPRIMESurfaceDescriptor& aDesc) { ++bool DMABufSurfaceYUV::UpdateYUVData(const VADRMPRIMESurfaceDescriptor& aDesc, ++ int aWidth, int aHeight) { + if (aDesc.num_layers > DMABUF_BUFFER_PLANES || + aDesc.num_objects > DMABUF_BUFFER_PLANES) { + return false; + } + +@@ -907,12 +913,14 @@ + + mBufferModifiers[i] = aDesc.objects[object].drm_format_modifier; + mDrmFormats[i] = aDesc.layers[i].drm_format; + mOffsets[i] = aDesc.layers[i].offset[0]; + mStrides[i] = aDesc.layers[i].pitch[0]; +- mWidth[i] = aDesc.width >> i; +- mHeight[i] = aDesc.height >> i; ++ mWidthAligned[i] = aDesc.width >> i; ++ mHeightAligned[i] = aDesc.height >> i; ++ mWidth[i] = aWidth >> i; ++ mHeight[i] = aHeight >> i; + + LOGDMABUF((" plane %d size %d x %d format %x", i, mWidth[i], mHeight[i], + mDrmFormats[i])); + } + +@@ -1044,10 +1052,12 @@ + strerror(errno))); + return false; + } + mWidth[i] = aDesc.width()[i]; + mHeight[i] = aDesc.height()[i]; ++ mWidthAligned[i] = aDesc.widthAligned()[i]; ++ mHeightAligned[i] = aDesc.heightAligned()[i]; + mDrmFormats[i] = aDesc.format()[i]; + mStrides[i] = aDesc.strides()[i]; + mOffsets[i] = aDesc.offsets()[i]; + mBufferModifiers[i] = aDesc.modifier()[i]; + LOGDMABUF((" plane %d fd %d size %d x %d format %x", i, mDmabufFds[i], +@@ -1072,10 +1082,12 @@ + + bool DMABufSurfaceYUV::Serialize( + mozilla::layers::SurfaceDescriptor& aOutDescriptor) { + AutoTArray width; + AutoTArray height; ++ AutoTArray widthBytes; ++ AutoTArray heightBytes; + AutoTArray format; + AutoTArray fds; + AutoTArray strides; + AutoTArray offsets; + AutoTArray modifiers; +@@ -1090,10 +1102,12 @@ + } + + for (int i = 0; i < mBufferPlaneCount; i++) { + width.AppendElement(mWidth[i]); + height.AppendElement(mHeight[i]); ++ widthBytes.AppendElement(mWidthAligned[i]); ++ heightBytes.AppendElement(mHeightAligned[i]); + format.AppendElement(mDrmFormats[i]); + fds.AppendElement(ipc::FileDescriptor(mDmabufFds[i])); + strides.AppendElement(mStrides[i]); + offsets.AppendElement(mOffsets[i]); + modifiers.AppendElement(mBufferModifiers[i]); +@@ -1108,12 +1122,13 @@ + if (mGlobalRefCountFd) { + refCountFDs.AppendElement(ipc::FileDescriptor(mGlobalRefCountFd)); + } + + aOutDescriptor = SurfaceDescriptorDMABuf( +- mSurfaceType, modifiers, 0, fds, width, height, format, strides, offsets, +- GetYUVColorSpace(), mColorRange, fenceFDs, mUID, refCountFDs); ++ mSurfaceType, modifiers, 0, fds, width, height, widthBytes, heightBytes, ++ format, strides, offsets, GetYUVColorSpace(), mColorRange, fenceFDs, mUID, ++ refCountFDs); + return true; + } + + bool DMABufSurfaceYUV::CreateEGLImage(GLContext* aGLContext, int aPlane) { + LOGDMABUF( +@@ -1131,13 +1146,13 @@ + return false; + } + + nsTArray attribs; + attribs.AppendElement(LOCAL_EGL_WIDTH); +- attribs.AppendElement(mWidth[aPlane]); ++ attribs.AppendElement(mWidthAligned[aPlane]); + attribs.AppendElement(LOCAL_EGL_HEIGHT); +- attribs.AppendElement(mHeight[aPlane]); ++ attribs.AppendElement(mHeightAligned[aPlane]); + attribs.AppendElement(LOCAL_EGL_LINUX_DRM_FOURCC_EXT); + attribs.AppendElement(mDrmFormats[aPlane]); + #define ADD_PLANE_ATTRIBS_NV12(plane_idx) \ + attribs.AppendElement(LOCAL_EGL_DMA_BUF_PLANE##plane_idx##_FD_EXT); \ + attribs.AppendElement(mDmabufFds[aPlane]); \ + diff --git a/D146086.diff b/D146086.diff new file mode 100644 index 0000000..c6790ad --- /dev/null +++ b/D146086.diff @@ -0,0 +1,65 @@ +diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h b/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h +--- a/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h ++++ b/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h +@@ -112,12 +112,13 @@ + public: + VideoFramePool(); + ~VideoFramePool(); + + RefPtr> GetVideoFrameSurface( +- VADRMPRIMESurfaceDescriptor& aVaDesc, AVCodecContext* aAVCodecContext, +- AVFrame* aAVFrame, FFmpegLibWrapper* aLib); ++ VADRMPRIMESurfaceDescriptor& aVaDesc, int aWidth, int aHeight, ++ AVCodecContext* aAVCodecContext, AVFrame* aAVFrame, ++ FFmpegLibWrapper* aLib); + void ReleaseUnusedVAAPIFrames(); + + private: + RefPtr> GetFreeVideoFrameSurface(); + +diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp b/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp +--- a/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp ++++ b/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp +@@ -111,12 +111,13 @@ + return nullptr; + } + + RefPtr> + VideoFramePool::GetVideoFrameSurface( +- VADRMPRIMESurfaceDescriptor& aVaDesc, AVCodecContext* aAVCodecContext, +- AVFrame* aAVFrame, FFmpegLibWrapper* aLib) { ++ VADRMPRIMESurfaceDescriptor& aVaDesc, int aWidth, int aHeight, ++ AVCodecContext* aAVCodecContext, AVFrame* aAVFrame, ++ FFmpegLibWrapper* aLib) { + if (aVaDesc.fourcc != VA_FOURCC_NV12 && aVaDesc.fourcc != VA_FOURCC_YV12 && + aVaDesc.fourcc != VA_FOURCC_P010) { + FFMPEG_LOG("Unsupported VA-API surface format %d", aVaDesc.fourcc); + return nullptr; + } +@@ -124,11 +125,11 @@ + MutexAutoLock lock(mSurfaceLock); + RefPtr> videoSurface = + GetFreeVideoFrameSurface(); + if (!videoSurface) { + RefPtr surface = +- DMABufSurfaceYUV::CreateYUVSurface(aVaDesc); ++ DMABufSurfaceYUV::CreateYUVSurface(aVaDesc, aWidth, aHeight); + if (!surface) { + return nullptr; + } + FFMPEG_LOG("Created new VA-API DMABufSurface UID = %d", surface->GetUID()); + RefPtr> surf = +@@ -142,11 +143,11 @@ + } + videoSurface = surf; + mDMABufSurfaces.AppendElement(std::move(surf)); + } else { + RefPtr surface = videoSurface->GetDMABufSurface(); +- if (!surface->UpdateYUVData(aVaDesc)) { ++ if (!surface->UpdateYUVData(aVaDesc, aWidth, aHeight)) { + return nullptr; + } + FFMPEG_LOG("Reusing VA-API DMABufSurface UID = %d", surface->GetUID()); + } + videoSurface->LockVAAPIData(aAVCodecContext, aAVFrame, aLib); + diff --git a/D146087.diff b/D146087.diff new file mode 100644 index 0000000..d5dcf9d --- /dev/null +++ b/D146087.diff @@ -0,0 +1,19 @@ +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 +@@ -1164,12 +1164,12 @@ + NS_ERROR_DOM_MEDIA_DECODE_ERR, + RESULT_DETAIL("Unable to get frame by vaExportSurfaceHandle()")); + } + + MOZ_ASSERT(mTaskQueue->IsOnCurrentThread()); +- auto surface = mVideoFramePool->GetVideoFrameSurface(vaDesc, mCodecContext, +- mFrame, mLib); ++ auto surface = mVideoFramePool->GetVideoFrameSurface( ++ vaDesc, mFrame->width, mFrame->height, mCodecContext, mFrame, mLib); + if (!surface) { + return MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, + RESULT_DETAIL("VAAPI dmabuf allocation error")); + } + surface->SetYUVColorSpace(GetFrameColorSpace()); + diff --git a/D147420.diff b/D147420.diff new file mode 100644 index 0000000..1ee3af1 --- /dev/null +++ b/D147420.diff @@ -0,0 +1,179 @@ +diff -up firefox-101.0/gfx/gl/GLContextEGL.h.D147420.diff firefox-101.0/gfx/gl/GLContextEGL.h +--- firefox-101.0/gfx/gl/GLContextEGL.h.D147420.diff 2022-05-27 01:16:54.000000000 +0200 ++++ firefox-101.0/gfx/gl/GLContextEGL.h 2022-06-07 09:01:17.487787806 +0200 +@@ -106,6 +106,9 @@ class GLContextEGL final : public GLCont + static RefPtr CreateEGLPBufferOffscreenContextImpl( + std::shared_ptr, const GLContextCreateDesc&, + const gfx::IntSize& size, bool aUseGles, nsACString* const out_FailureId); ++ static RefPtr CreateEGLSurfacelessContext( ++ const std::shared_ptr display, ++ const GLContextCreateDesc& desc, nsACString* const out_failureId); + + static EGLSurface CreateEGLSurfaceForCompositorWidget( + widget::CompositorWidget* aCompositorWidget, const EGLConfig aConfig); +diff -up firefox-101.0/gfx/gl/GLContextProviderEGL.cpp.D147420.diff firefox-101.0/gfx/gl/GLContextProviderEGL.cpp +--- firefox-101.0/gfx/gl/GLContextProviderEGL.cpp.D147420.diff 2022-05-27 01:16:54.000000000 +0200 ++++ firefox-101.0/gfx/gl/GLContextProviderEGL.cpp 2022-06-07 09:01:17.487787806 +0200 +@@ -1190,16 +1190,42 @@ RefPtr GLContextEGL::Creat + } + + /*static*/ ++RefPtr GLContextEGL::CreateEGLSurfacelessContext( ++ const std::shared_ptr display, const GLContextCreateDesc& desc, ++ nsACString* const out_failureId) { ++ const EGLConfig config = {}; ++ auto fullDesc = GLContextDesc{desc}; ++ fullDesc.isOffscreen = true; ++ RefPtr 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 GLContextProviderEGL::CreateHeadless( + const GLContextCreateDesc& desc, nsACString* const out_failureId) { + const auto display = DefaultEglDisplay(out_failureId); + if (!display) { + return nullptr; + } +- mozilla::gfx::IntSize dummySize = mozilla::gfx::IntSize(16, 16); +- auto ret = GLContextEGL::CreateEGLPBufferOffscreenContext( +- display, desc, dummySize, out_failureId); +- return ret.forget(); ++ RefPtr 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(); + } + + // Don't want a global context on Android as 1) share groups across 2 threads +diff -up firefox-101.0/gfx/gl/GLDefs.h.D147420.diff firefox-101.0/gfx/gl/GLDefs.h +--- firefox-101.0/gfx/gl/GLDefs.h.D147420.diff 2022-05-27 01:16:54.000000000 +0200 ++++ firefox-101.0/gfx/gl/GLDefs.h 2022-06-07 09:01:17.487787806 +0200 +@@ -104,6 +104,9 @@ 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-101.0/gfx/gl/GLLibraryEGL.cpp.D147420.diff firefox-101.0/gfx/gl/GLLibraryEGL.cpp +--- firefox-101.0/gfx/gl/GLLibraryEGL.cpp.D147420.diff 2022-05-27 01:16:54.000000000 +0200 ++++ firefox-101.0/gfx/gl/GLLibraryEGL.cpp 2022-06-07 09:03:04.077349997 +0200 +@@ -82,7 +82,8 @@ static const char* sEGLExtensionNames[] + "EGL_KHR_swap_buffers_with_damage", + "EGL_EXT_buffer_age", + "EGL_KHR_partial_update", +- "EGL_NV_robustness_video_memory_purge"}; ++ "EGL_NV_robustness_video_memory_purge", ++ "EGL_MESA_platform_surfaceless"}; + + PRLibrary* LoadApitraceLibrary() { + const char* path = nullptr; +@@ -151,6 +152,19 @@ static std::shared_ptr GetAn + return EglDisplay::Create(egl, display, false, aProofOfLock); + } + ++#ifdef MOZ_WAYLAND ++static std::shared_ptr GetAndInitSurfacelessDisplay( ++ GLLibraryEGL& egl, const StaticMutexAutoLock& aProofOfLock) { ++ const EGLAttrib attrib_list[] = {LOCAL_EGL_NONE}; ++ const EGLDisplay display = egl.fGetPlatformDisplay( ++ LOCAL_EGL_PLATFORM_SURFACELESS_MESA, EGL_DEFAULT_DISPLAY, attrib_list); ++ if (display == EGL_NO_DISPLAY) { ++ return nullptr; ++ } ++ return EglDisplay::Create(egl, display, true, aProofOfLock); ++} ++#endif ++ + static std::shared_ptr GetAndInitWARPDisplay( + GLLibraryEGL& egl, void* displayType, + const StaticMutexAutoLock& aProofOfLock) { +@@ -629,6 +643,11 @@ bool GLLibraryEGL::Init(nsACString* cons + END_OF_SYMBOLS}; + (void)fnLoadSymbols(symbols); + } ++ { ++ const SymLoadStruct symbols[] = {SYMBOL(GetPlatformDisplay), ++ END_OF_SYMBOLS}; ++ (void)fnLoadSymbols(symbols); ++ } + + return true; + } +@@ -806,7 +825,9 @@ std::shared_ptr GLLibraryEGL + #ifdef MOZ_WAYLAND + // Some drivers doesn't support EGL_DEFAULT_DISPLAY + GdkDisplay* gdkDisplay = gdk_display_get_default(); +- if (widget::GdkIsWaylandDisplay(gdkDisplay)) { ++ if (!gdkDisplay) { ++ ret = GetAndInitSurfacelessDisplay(*this, aProofOfLock); ++ } else if (widget::GdkIsWaylandDisplay(gdkDisplay)) { + nativeDisplay = widget::WaylandDisplayGetWLDisplay(gdkDisplay); + if (!nativeDisplay) { + NS_WARNING("Failed to get wl_display."); +@@ -814,7 +835,9 @@ std::shared_ptr GLLibraryEGL + } + } + #endif +- ret = GetAndInitDisplay(*this, nativeDisplay, aProofOfLock); ++ if (!ret) { ++ ret = GetAndInitDisplay(*this, nativeDisplay, aProofOfLock); ++ } + } + + if (!ret) { +diff -up firefox-101.0/gfx/gl/GLLibraryEGL.h.D147420.diff firefox-101.0/gfx/gl/GLLibraryEGL.h +--- firefox-101.0/gfx/gl/GLLibraryEGL.h.D147420.diff 2022-05-27 01:16:54.000000000 +0200 ++++ firefox-101.0/gfx/gl/GLLibraryEGL.h 2022-06-07 09:01:17.487787806 +0200 +@@ -107,6 +107,7 @@ enum class EGLExtension { + EXT_buffer_age, + KHR_partial_update, + NV_robustness_video_memory_purge, ++ MESA_platform_surfaceless, + Max + }; + +diff -up firefox-101.0/widget/gtk/DMABufSurface.cpp.D147420.diff firefox-101.0/widget/gtk/DMABufSurface.cpp +--- firefox-101.0/widget/gtk/DMABufSurface.cpp.D147420.diff 2022-06-07 09:01:17.486787773 +0200 ++++ firefox-101.0/widget/gtk/DMABufSurface.cpp 2022-06-07 09:01:17.487787806 +0200 +@@ -1259,7 +1259,7 @@ bool DMABufSurfaceYUV::VerifyTextureCrea + nsCString discardFailureId; + sSnapshotContext = GLContextProvider::CreateHeadless({}, &discardFailureId); + if (!sSnapshotContext) { +- NS_WARNING("Failed to create snapshot GLContext"); ++ LOGDMABUF((" failed to create snapshot GLContext")); + return false; + } + } +@@ -1268,10 +1268,12 @@ bool DMABufSurfaceYUV::VerifyTextureCrea + + for (int i = 0; i < mBufferPlaneCount; i++) { + if (!CreateEGLImage(sSnapshotContext, i)) { ++ LOGDMABUF((" failed to create EGL image!")); + return false; + } + } + ++ LOGDMABUF((" success")); + return true; + } + diff --git a/D147635.diff b/D147635.diff new file mode 100644 index 0000000..1d4bb58 --- /dev/null +++ b/D147635.diff @@ -0,0 +1,125 @@ +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/D147636.diff b/D147636.diff new file mode 100644 index 0000000..52462f2 --- /dev/null +++ b/D147636.diff @@ -0,0 +1,278 @@ +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 CreateDMABufSurface( + int aWidth, int aHeight, int aDMABufSurfaceFlags); + ++ static already_AddRefed 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 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 DMABufSurfaceRGBA::CreateDMABufSurface( ++ mozilla::gl::GLContext* aGLContext, const EGLImageKHR aEGLImage, int aWidth, ++ int aHeight) { ++ RefPtr surf = new DMABufSurfaceRGBA(); ++ if (!surf->Create(aGLContext, aEGLImage, aWidth, aHeight)) { ++ return nullptr; ++ } ++ return surf.forget(); ++} ++ + already_AddRefed DMABufSurfaceYUV::CreateYUVSurface( + const VADRMPRIMESurfaceDescriptor& aDesc, int aWidth, int aHeight) { + RefPtr surf = new DMABufSurfaceYUV(); + LOGDMABUF(("DMABufSurfaceYUV::CreateYUVSurface() UID %d from desc\n", + surf->GetUID())); + diff --git a/D147637.diff b/D147637.diff new file mode 100644 index 0000000..0a84b25 --- /dev/null +++ b/D147637.diff @@ -0,0 +1,113 @@ +diff -up firefox-101.0/gfx/gl/SharedSurfaceDMABUF.cpp.D147637.diff firefox-101.0/gfx/gl/SharedSurfaceDMABUF.cpp +--- firefox-101.0/gfx/gl/SharedSurfaceDMABUF.cpp.D147637.diff 2022-05-27 01:16:54.000000000 +0200 ++++ firefox-101.0/gfx/gl/SharedSurfaceDMABUF.cpp 2022-06-07 09:37:29.361992695 +0200 +@@ -12,22 +12,37 @@ + + 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::Create( + const SharedSurfaceDesc& desc) { +- const auto flags = static_cast( +- DMABUF_TEXTURE | DMABUF_USE_MODIFIERS | DMABUF_ALPHA); +- const RefPtr surface = DMABufSurfaceRGBA::CreateDMABufSurface( +- desc.size.width, desc.size.height, flags); +- if (!surface || !surface->CreateTexture(desc.gl)) { ++ const auto& gle = GLContextEGL::Cast(desc.gl); ++ const auto& context = gle->mContext; ++ const auto& egl = *(gle->mEgl); ++ ++ if (!HasDmaBufExtensions(gle)) { + return nullptr; + } + +- const auto tex = surface->GetTexture(); +- auto fb = MozFramebuffer::CreateForBacking(desc.gl, desc.size, 0, false, +- LOCAL_GL_TEXTURE_2D, tex); ++ auto fb = MozFramebuffer::Create(desc.gl, desc.size, 0, false); + if (!fb) return nullptr; + ++ const auto buffer = reinterpret_cast(fb->ColorTex()); ++ const auto image = ++ egl.fCreateImage(context, LOCAL_EGL_GL_TEXTURE_2D, buffer, nullptr); ++ if (!image) return nullptr; ++ ++ const RefPtr surface = DMABufSurfaceRGBA::CreateDMABufSurface( ++ desc.gl, image, desc.size.width, desc.size.height); ++ if (!surface) return nullptr; ++ + return AsUnique(new SharedSurface_DMABUF(desc, std::move(fb), surface)); + } + +@@ -61,7 +76,7 @@ UniquePtr Surface + } + + auto dmabufFactory = MakeUnique(gl); +- if (dmabufFactory->CanCreateSurface()) { ++ if (dmabufFactory->CanCreateSurface(gl)) { + return dmabufFactory; + } + +@@ -71,8 +86,38 @@ UniquePtr Surface + return nullptr; + } + ++bool SurfaceFactory_DMABUF::CanCreateSurface(GLContext& gl) { ++ UniquePtr test = ++ CreateShared(gfx::IntSize(1, 1)); ++ 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 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-101.0/gfx/gl/SharedSurfaceDMABUF.h.D147637.diff firefox-101.0/gfx/gl/SharedSurfaceDMABUF.h +--- firefox-101.0/gfx/gl/SharedSurfaceDMABUF.h.D147637.diff 2022-06-07 09:31:23.678228010 +0200 ++++ firefox-101.0/gfx/gl/SharedSurfaceDMABUF.h 2022-06-07 09:36:39.691512555 +0200 +@@ -59,10 +59,7 @@ class SurfaceFactory_DMABUF : public Sur + return SharedSurface_DMABUF::Create(desc); + } + +- bool CanCreateSurface() { +- UniquePtr test = CreateShared(gfx::IntSize(1, 1)); +- return test != nullptr; +- } ++ bool CanCreateSurface(GLContext& gl); + }; + + } // namespace gl diff --git a/D147720.diff b/D147720.diff new file mode 100644 index 0000000..9287f44 --- /dev/null +++ b/D147720.diff @@ -0,0 +1,73 @@ +diff --git a/widget/gtk/DMABufSurface.h b/widget/gtk/DMABufSurface.h +--- a/widget/gtk/DMABufSurface.h ++++ b/widget/gtk/DMABufSurface.h +@@ -146,11 +146,16 @@ + DMABufSurface(SurfaceType aSurfaceType); + + protected: + virtual bool Create(const mozilla::layers::SurfaceDescriptor& aDesc) = 0; + ++ // Import global ref count from IPC by file descriptor. + void GlobalRefCountImport(int aFd); ++ // Export global ref count by file descriptor. This adds global ref count ++ // reference to the surface. ++ // It's used when dmabuf surface is shared with another process via. IPC. ++ int GlobalRefCountExport(); + void GlobalRefCountDelete(); + + void ReleaseDMABuf(); + + void* MapInternal(uint32_t aX, uint32_t aY, uint32_t aWidth, uint32_t aHeight, +diff --git a/widget/gtk/DMABufSurface.cpp b/widget/gtk/DMABufSurface.cpp +--- a/widget/gtk/DMABufSurface.cpp ++++ b/widget/gtk/DMABufSurface.cpp +@@ -105,11 +105,21 @@ + } + + void DMABufSurface::GlobalRefCountImport(int aFd) { + MOZ_ASSERT(!mGlobalRefCountFd); + mGlobalRefCountFd = aFd; +- GlobalRefAdd(); ++ MOZ_DIAGNOSTIC_ASSERT(IsGlobalRefSet(), ++ "We're importing unreferenced surface!"); ++} ++ ++int DMABufSurface::GlobalRefCountExport() { ++ if (mGlobalRefCountFd) { ++ MOZ_DIAGNOSTIC_ASSERT(IsGlobalRefSet(), ++ "We're exporting unreferenced surface!"); ++ GlobalRefAdd(); ++ } ++ return mGlobalRefCountFd; + } + + void DMABufSurface::GlobalRefCountDelete() { + if (mGlobalRefCountFd) { + GlobalRefRelease(); +@@ -475,11 +485,11 @@ + if (mSync) { + fenceFDs.AppendElement(ipc::FileDescriptor(mSyncFd)); + } + + if (mGlobalRefCountFd) { +- refCountFDs.AppendElement(ipc::FileDescriptor(mGlobalRefCountFd)); ++ refCountFDs.AppendElement(ipc::FileDescriptor(GlobalRefCountExport())); + } + + aOutDescriptor = SurfaceDescriptorDMABuf( + mSurfaceType, modifiers, mGbmBufferFlags, fds, width, height, width, + height, format, strides, offsets, GetYUVColorSpace(), mColorRange, +@@ -1118,11 +1128,11 @@ + if (mSync) { + fenceFDs.AppendElement(ipc::FileDescriptor(mSyncFd)); + } + + if (mGlobalRefCountFd) { +- refCountFDs.AppendElement(ipc::FileDescriptor(mGlobalRefCountFd)); ++ refCountFDs.AppendElement(ipc::FileDescriptor(GlobalRefCountExport())); + } + + aOutDescriptor = SurfaceDescriptorDMABuf( + mSurfaceType, modifiers, 0, fds, width, height, widthBytes, heightBytes, + format, strides, offsets, GetYUVColorSpace(), mColorRange, fenceFDs, mUID, + diff --git a/D147874.diff b/D147874.diff new file mode 100644 index 0000000..f0c57dd --- /dev/null +++ b/D147874.diff @@ -0,0 +1,64 @@ +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& 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/firefox.spec b/firefox.spec index 3206448..4d49292 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 101.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -244,6 +244,24 @@ Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch Patch418: mozilla-1767946-profilemanagersize.patch +# VA-API fixes +Patch420: D144284.diff +Patch421: D147420.diff +Patch422: D147720.diff +Patch423: D147874.diff +Patch424: D146084.diff +Patch425: D146085.diff +Patch426: D146086.diff +Patch427: D146087.diff +Patch428: D145725.diff +Patch429: D145966.diff +Patch430: D145871.diff + +# NVIDIA mzbz#1735929 +Patch440: D147635.diff +Patch441: D147636.diff +Patch442: D147637.diff + # PGO/LTO patches Patch600: pgo.patch Patch602: mozilla-1516803.patch @@ -485,6 +503,26 @@ This package contains results of tests executed during build. %patch415 -p1 -b .1670333 %patch418 -p1 -b .mozilla-1767946-profilemanagersize +# VA-API fixes +%patch420 -p1 -b .D144284.diff +%patch421 -p1 -b .D147420.diff +%patch423 -p1 -b .D147874.diff +%patch424 -p1 -b .D146084.diff +%patch425 -p1 -b .D146085.diff +%patch426 -p1 -b .D146086.diff +%patch427 -p1 -b .D146087.diff +%patch428 -p1 -b .D145725.diff +%patch429 -p1 -b .D145966.diff +%patch430 -p1 -b .D145871.diff + +# NVIDIA mzbz#1735929 +%patch440 -p1 -b .D147635.diff +%patch441 -p1 -b .D147636.diff +%patch442 -p1 -b .D147637.diff + +# More VA-API fixes +%patch422 -p1 -b .D147720.diff + # PGO patches %if %{build_with_pgo} %if !%{build_with_clang} @@ -1057,6 +1095,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue Jun 7 2022 Martin Stransky - 101.0-2 +- Enabled VA-API by default (+ added VA-API fixes from upstream) +- Fixed WebGL performance on NVIDIA drivers (mzbz#1735929) + * Mon May 30 2022 Martin Stransky - 101.0-1 - Updated to 101.0 From fc1bf47cd86638b08e03b90b60b0bc80dd1d6c28 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 9 Jun 2022 11:14:27 +0200 Subject: [PATCH 055/545] Updated to 101.0.1, More VA-API sandbox fixes (mzbz#1769182) --- .gitignore | 2 + D146271.diff | 94 +++++++++++ D146272.diff | 373 ++++++++++++++++++++++++++++++++++++++++++ D146273.diff | 90 ++++++++++ D146274.diff | 158 ++++++++++++++++++ D146275.diff | 125 ++++++++++++++ firefox.spec | 20 ++- mozilla-1773336.patch | 12 ++ sources | 4 +- 9 files changed, 874 insertions(+), 4 deletions(-) create mode 100644 D146271.diff create mode 100644 D146272.diff create mode 100644 D146273.diff create mode 100644 D146274.diff create mode 100644 D146275.diff create mode 100644 mozilla-1773336.patch diff --git a/.gitignore b/.gitignore index 9cb84f4..4ba9226 100644 --- a/.gitignore +++ b/.gitignore @@ -513,3 +513,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-100.0.2-20220520.tar.xz /firefox-101.0.source.tar.xz /firefox-langpacks-101.0-20220530.tar.xz +/firefox-101.0.1.source.tar.xz +/firefox-langpacks-101.0.1-20220609.tar.xz diff --git a/D146271.diff b/D146271.diff new file mode 100644 index 0000000..fd2e0b0 --- /dev/null +++ b/D146271.diff @@ -0,0 +1,94 @@ +diff -up firefox-101.0/security/sandbox/linux/SandboxFilter.cpp.D146271.diff firefox-101.0/security/sandbox/linux/SandboxFilter.cpp +--- firefox-101.0/security/sandbox/linux/SandboxFilter.cpp.D146271.diff 2022-05-27 01:16:59.000000000 +0200 ++++ firefox-101.0/security/sandbox/linux/SandboxFilter.cpp 2022-06-09 09:59:35.569235176 +0200 +@@ -125,28 +125,12 @@ namespace mozilla { + // denied if no broker client is provided by the concrete class. + class SandboxPolicyCommon : public SandboxPolicyBase { + protected: +- enum class ShmemUsage : uint8_t { +- MAY_CREATE, +- ONLY_USE, +- }; +- +- enum class AllowUnsafeSocketPair : uint8_t { +- NO, +- YES, +- }; +- ++ // Subclasses can assign these in their constructors to loosen the ++ // default settings. + SandboxBrokerClient* mBroker = nullptr; + bool mMayCreateShmem = false; + bool mAllowUnsafeSocketPair = false; + +- explicit SandboxPolicyCommon(SandboxBrokerClient* aBroker, +- ShmemUsage aShmemUsage, +- AllowUnsafeSocketPair aAllowUnsafeSocketPair) +- : mBroker(aBroker), +- mMayCreateShmem(aShmemUsage == ShmemUsage::MAY_CREATE), +- mAllowUnsafeSocketPair(aAllowUnsafeSocketPair == +- AllowUnsafeSocketPair::YES) {} +- + SandboxPolicyCommon() = default; + + typedef const sandbox::arch_seccomp_data& ArgsRef; +@@ -1228,11 +1212,13 @@ class ContentSandboxPolicy : public Sand + public: + ContentSandboxPolicy(SandboxBrokerClient* aBroker, + ContentProcessSandboxParams&& aParams) +- : SandboxPolicyCommon(aBroker, ShmemUsage::MAY_CREATE, +- AllowUnsafeSocketPair::YES), +- mParams(std::move(aParams)), ++ : mParams(std::move(aParams)), + mAllowSysV(PR_GetEnv("MOZ_SANDBOX_ALLOW_SYSV") != nullptr), +- mUsingRenderDoc(PR_GetEnv("RENDERDOC_CAPTUREOPTS") != nullptr) {} ++ mUsingRenderDoc(PR_GetEnv("RENDERDOC_CAPTUREOPTS") != nullptr) { ++ mBroker = aBroker; ++ mMayCreateShmem = true; ++ mAllowUnsafeSocketPair = true; ++ } + + ~ContentSandboxPolicy() override = default; + +@@ -1762,9 +1748,10 @@ UniquePtr GetM + // segments, so it may need file brokering. + class RDDSandboxPolicy final : public SandboxPolicyCommon { + public: +- explicit RDDSandboxPolicy(SandboxBrokerClient* aBroker) +- : SandboxPolicyCommon(aBroker, ShmemUsage::MAY_CREATE, +- AllowUnsafeSocketPair::NO) {} ++ explicit RDDSandboxPolicy(SandboxBrokerClient* aBroker) { ++ mBroker = aBroker; ++ mMayCreateShmem = true; ++ } + + #ifndef ANDROID + Maybe EvaluateIpcCall(int aCall, int aArgShift) const override { +@@ -1875,9 +1862,10 @@ UniquePtr GetD + // the SocketProcess sandbox looks like. + class SocketProcessSandboxPolicy final : public SandboxPolicyCommon { + public: +- explicit SocketProcessSandboxPolicy(SandboxBrokerClient* aBroker) +- : SandboxPolicyCommon(aBroker, ShmemUsage::MAY_CREATE, +- AllowUnsafeSocketPair::NO) {} ++ explicit SocketProcessSandboxPolicy(SandboxBrokerClient* aBroker) { ++ mBroker = aBroker; ++ mMayCreateShmem = true; ++ } + + static intptr_t FcntlTrap(const sandbox::arch_seccomp_data& aArgs, + void* aux) { +@@ -2013,9 +2001,10 @@ UniquePtr GetS + + class UtilitySandboxPolicy : public SandboxPolicyCommon { + public: +- explicit UtilitySandboxPolicy(SandboxBrokerClient* aBroker) +- : SandboxPolicyCommon(aBroker, ShmemUsage::MAY_CREATE, +- AllowUnsafeSocketPair::NO) {} ++ explicit UtilitySandboxPolicy(SandboxBrokerClient* aBroker) { ++ mBroker = aBroker; ++ mMayCreateShmem = true; ++ } + + ResultExpr PrctlPolicy() const override { + Arg op(0); diff --git a/D146272.diff b/D146272.diff new file mode 100644 index 0000000..0a2c749 --- /dev/null +++ b/D146272.diff @@ -0,0 +1,373 @@ +diff --git a/security/sandbox/linux/SandboxFilter.cpp b/security/sandbox/linux/SandboxFilter.cpp +--- a/security/sandbox/linux/SandboxFilter.cpp ++++ b/security/sandbox/linux/SandboxFilter.cpp +@@ -128,10 +128,11 @@ + // Subclasses can assign these in their constructors to loosen the + // default settings. + SandboxBrokerClient* mBroker = nullptr; + bool mMayCreateShmem = false; + bool mAllowUnsafeSocketPair = false; ++ bool mBrokeredConnect = false; // Can connect() be brokered? + + SandboxPolicyCommon() = default; + + typedef const sandbox::arch_seccomp_data& ArgsRef; + +@@ -533,10 +534,124 @@ + MOZ_CRASH("unreachable?"); + return -ENOSYS; + #endif + } + ++ // This just needs to return something to stand in for the ++ // unconnected socket until ConnectTrap, below, and keep track of ++ // the socket type somehow. Half a socketpair *is* a socket, so it ++ // should result in minimal confusion in the caller. ++ static intptr_t FakeSocketTrapCommon(int domain, int type, int protocol) { ++ int fds[2]; ++ // X11 client libs will still try to getaddrinfo() even for a ++ // local connection. Also, WebRTC still has vestigial network ++ // code trying to do things in the content process. Politely tell ++ // them no. ++ if (domain != AF_UNIX) { ++ return -EAFNOSUPPORT; ++ } ++ if (socketpair(domain, type, protocol, fds) != 0) { ++ return -errno; ++ } ++ close(fds[1]); ++ return fds[0]; ++ } ++ ++ static intptr_t FakeSocketTrap(ArgsRef aArgs, void* aux) { ++ return FakeSocketTrapCommon(static_cast(aArgs.args[0]), ++ static_cast(aArgs.args[1]), ++ static_cast(aArgs.args[2])); ++ } ++ ++ static intptr_t FakeSocketTrapLegacy(ArgsRef aArgs, void* aux) { ++ const auto innerArgs = reinterpret_cast(aArgs.args[1]); ++ ++ return FakeSocketTrapCommon(static_cast(innerArgs[0]), ++ static_cast(innerArgs[1]), ++ static_cast(innerArgs[2])); ++ } ++ ++ static Maybe DoGetSockOpt(int fd, int optname) { ++ int optval; ++ socklen_t optlen = sizeof(optval); ++ ++ if (getsockopt(fd, SOL_SOCKET, optname, &optval, &optlen) != 0) { ++ return Nothing(); ++ } ++ MOZ_RELEASE_ASSERT(static_cast(optlen) == sizeof(optval)); ++ return Some(optval); ++ } ++ ++ // Substitute the newly connected socket from the broker for the ++ // original socket. This is meant to be used on a fd from ++ // FakeSocketTrap, above, but it should also work to simulate ++ // re-connect()ing a real connected socket. ++ // ++ // Warning: This isn't quite right if the socket is dup()ed, because ++ // other duplicates will still be the original socket, but hopefully ++ // nothing we're dealing with does that. ++ static intptr_t ConnectTrapCommon(SandboxBrokerClient* aBroker, int aFd, ++ const struct sockaddr_un* aAddr, ++ socklen_t aLen) { ++ if (aFd < 0) { ++ return -EBADF; ++ } ++ const auto maybeDomain = DoGetSockOpt(aFd, SO_DOMAIN); ++ if (!maybeDomain) { ++ return -errno; ++ } ++ if (*maybeDomain != AF_UNIX) { ++ return -EAFNOSUPPORT; ++ } ++ const auto maybeType = DoGetSockOpt(aFd, SO_TYPE); ++ if (!maybeType) { ++ return -errno; ++ } ++ const int oldFlags = fcntl(aFd, F_GETFL); ++ if (oldFlags == -1) { ++ return -errno; ++ } ++ const int newFd = aBroker->Connect(aAddr, aLen, *maybeType); ++ if (newFd < 0) { ++ return newFd; ++ } ++ // Copy over the nonblocking flag. The connect() won't be ++ // nonblocking in that case, but that shouldn't matter for ++ // AF_UNIX. The other fcntl-settable flags are either irrelevant ++ // for sockets (e.g., O_APPEND) or would be blocked by this ++ // seccomp-bpf policy, so they're ignored. ++ if (fcntl(newFd, F_SETFL, oldFlags & O_NONBLOCK) != 0) { ++ close(newFd); ++ return -errno; ++ } ++ if (dup2(newFd, aFd) < 0) { ++ close(newFd); ++ return -errno; ++ } ++ close(newFd); ++ return 0; ++ } ++ ++ static intptr_t ConnectTrap(ArgsRef aArgs, void* aux) { ++ typedef const struct sockaddr_un* AddrPtr; ++ ++ return ConnectTrapCommon(static_cast(aux), ++ static_cast(aArgs.args[0]), ++ reinterpret_cast(aArgs.args[1]), ++ static_cast(aArgs.args[2])); ++ } ++ ++ static intptr_t ConnectTrapLegacy(ArgsRef aArgs, void* aux) { ++ const auto innerArgs = reinterpret_cast(aArgs.args[1]); ++ typedef const struct sockaddr_un* AddrPtr; ++ ++ return ConnectTrapCommon(static_cast(aux), ++ static_cast(innerArgs[0]), ++ reinterpret_cast(innerArgs[1]), ++ static_cast(innerArgs[2])); ++ } ++ + public: + ResultExpr InvalidSyscall() const override { + return Trap(BlockedSyscallTrap, nullptr); + } + +@@ -630,15 +745,37 @@ + return Some(Allow()); + } + Arg level(1), optname(2); + // SO_SNDBUF is used by IPC to avoid constructing + // unnecessarily large gather arrays for `sendmsg`. +- return Some( +- If(AllOf(level == SOL_SOCKET, optname == SO_SNDBUF), Allow()) +- .Else(InvalidSyscall())); ++ // ++ // SO_DOMAIN and SO_TYPE are needed for connect() brokering, ++ // but they're harmless even when it's not enabled. ++ return Some(If(AllOf(level == SOL_SOCKET, ++ AnyOf(optname == SO_SNDBUF, optname == SO_DOMAIN, ++ optname == SO_TYPE)), ++ Allow()) ++ .Else(InvalidSyscall())); + } + ++ // These two cases are for connect() brokering, if enabled. ++ case SYS_SOCKET: ++ if (mBrokeredConnect) { ++ const auto trapFn = aHasArgs ? FakeSocketTrap : FakeSocketTrapLegacy; ++ MOZ_ASSERT(mBroker); ++ return Some(Trap(trapFn, mBroker)); ++ } ++ return Nothing(); ++ ++ case SYS_CONNECT: ++ if (mBrokeredConnect) { ++ const auto trapFn = aHasArgs ? ConnectTrap : ConnectTrapLegacy; ++ MOZ_ASSERT(mBroker); ++ return Some(Trap(trapFn, mBroker)); ++ } ++ return Nothing(); ++ + default: + return Nothing(); + } + } + +@@ -1006,10 +1143,16 @@ + return If(AnyOf(request == TCGETS, request == TIOCGWINSZ), + Error(ENOTTY)) + .Else(SandboxPolicyBase::EvaluateSyscall(sysno)); + } + ++ CASES_FOR_dup2: // See ConnectTrapCommon ++ if (mBrokeredConnect) { ++ return Allow(); ++ } ++ return SandboxPolicyBase::EvaluateSyscall(sysno); ++ + #ifdef MOZ_ASAN + // ASAN's error reporter wants to know if stderr is a tty. + case __NR_ioctl: { + Arg fd(0); + return If(fd == STDERR_FILENO, Error(ENOTTY)).Else(InvalidSyscall()); +@@ -1093,133 +1236,20 @@ + + close(fd); + return rv; + } + +- // This just needs to return something to stand in for the +- // unconnected socket until ConnectTrap, below, and keep track of +- // the socket type somehow. Half a socketpair *is* a socket, so it +- // should result in minimal confusion in the caller. +- static intptr_t FakeSocketTrapCommon(int domain, int type, int protocol) { +- int fds[2]; +- // X11 client libs will still try to getaddrinfo() even for a +- // local connection. Also, WebRTC still has vestigial network +- // code trying to do things in the content process. Politely tell +- // them no. +- if (domain != AF_UNIX) { +- return -EAFNOSUPPORT; +- } +- if (socketpair(domain, type, protocol, fds) != 0) { +- return -errno; +- } +- close(fds[1]); +- return fds[0]; +- } +- +- static intptr_t FakeSocketTrap(ArgsRef aArgs, void* aux) { +- return FakeSocketTrapCommon(static_cast(aArgs.args[0]), +- static_cast(aArgs.args[1]), +- static_cast(aArgs.args[2])); +- } +- +- static intptr_t FakeSocketTrapLegacy(ArgsRef aArgs, void* aux) { +- const auto innerArgs = reinterpret_cast(aArgs.args[1]); +- +- return FakeSocketTrapCommon(static_cast(innerArgs[0]), +- static_cast(innerArgs[1]), +- static_cast(innerArgs[2])); +- } +- +- static Maybe DoGetSockOpt(int fd, int optname) { +- int optval; +- socklen_t optlen = sizeof(optval); +- +- if (getsockopt(fd, SOL_SOCKET, optname, &optval, &optlen) != 0) { +- return Nothing(); +- } +- MOZ_RELEASE_ASSERT(static_cast(optlen) == sizeof(optval)); +- return Some(optval); +- } +- +- // Substitute the newly connected socket from the broker for the +- // original socket. This is meant to be used on a fd from +- // FakeSocketTrap, above, but it should also work to simulate +- // re-connect()ing a real connected socket. +- // +- // Warning: This isn't quite right if the socket is dup()ed, because +- // other duplicates will still be the original socket, but hopefully +- // nothing we're dealing with does that. +- static intptr_t ConnectTrapCommon(SandboxBrokerClient* aBroker, int aFd, +- const struct sockaddr_un* aAddr, +- socklen_t aLen) { +- if (aFd < 0) { +- return -EBADF; +- } +- const auto maybeDomain = DoGetSockOpt(aFd, SO_DOMAIN); +- if (!maybeDomain) { +- return -errno; +- } +- if (*maybeDomain != AF_UNIX) { +- return -EAFNOSUPPORT; +- } +- const auto maybeType = DoGetSockOpt(aFd, SO_TYPE); +- if (!maybeType) { +- return -errno; +- } +- const int oldFlags = fcntl(aFd, F_GETFL); +- if (oldFlags == -1) { +- return -errno; +- } +- const int newFd = aBroker->Connect(aAddr, aLen, *maybeType); +- if (newFd < 0) { +- return newFd; +- } +- // Copy over the nonblocking flag. The connect() won't be +- // nonblocking in that case, but that shouldn't matter for +- // AF_UNIX. The other fcntl-settable flags are either irrelevant +- // for sockets (e.g., O_APPEND) or would be blocked by this +- // seccomp-bpf policy, so they're ignored. +- if (fcntl(newFd, F_SETFL, oldFlags & O_NONBLOCK) != 0) { +- close(newFd); +- return -errno; +- } +- if (dup2(newFd, aFd) < 0) { +- close(newFd); +- return -errno; +- } +- close(newFd); +- return 0; +- } +- +- static intptr_t ConnectTrap(ArgsRef aArgs, void* aux) { +- typedef const struct sockaddr_un* AddrPtr; +- +- return ConnectTrapCommon(static_cast(aux), +- static_cast(aArgs.args[0]), +- reinterpret_cast(aArgs.args[1]), +- static_cast(aArgs.args[2])); +- } +- +- static intptr_t ConnectTrapLegacy(ArgsRef aArgs, void* aux) { +- const auto innerArgs = reinterpret_cast(aArgs.args[1]); +- typedef const struct sockaddr_un* AddrPtr; +- +- return ConnectTrapCommon(static_cast(aux), +- static_cast(innerArgs[0]), +- reinterpret_cast(innerArgs[1]), +- static_cast(innerArgs[2])); +- } +- + public: + ContentSandboxPolicy(SandboxBrokerClient* aBroker, + ContentProcessSandboxParams&& aParams) + : mParams(std::move(aParams)), + mAllowSysV(PR_GetEnv("MOZ_SANDBOX_ALLOW_SYSV") != nullptr), + mUsingRenderDoc(PR_GetEnv("RENDERDOC_CAPTUREOPTS") != nullptr) { + mBroker = aBroker; + mMayCreateShmem = true; + mAllowUnsafeSocketPair = true; ++ mBrokeredConnect = true; + } + + ~ContentSandboxPolicy() override = default; + + Maybe EvaluateSocketCall(int aCall, +@@ -1232,18 +1262,16 @@ + + #ifdef ANDROID + case SYS_SOCKET: + return Some(Error(EACCES)); + #else // #ifdef DESKTOP +- case SYS_SOCKET: { +- const auto trapFn = aHasArgs ? FakeSocketTrap : FakeSocketTrapLegacy; +- return Some(AllowBelowLevel(4, Trap(trapFn, nullptr))); +- } +- case SYS_CONNECT: { +- const auto trapFn = aHasArgs ? ConnectTrap : ConnectTrapLegacy; +- return Some(AllowBelowLevel(4, Trap(trapFn, mBroker))); +- } ++ case SYS_SOCKET: ++ case SYS_CONNECT: ++ if (BelowLevel(4)) { ++ return Some(Allow()); ++ } ++ return SandboxPolicyCommon::EvaluateSocketCall(aCall, aHasArgs); + case SYS_RECV: + case SYS_SEND: + case SYS_GETSOCKOPT: + case SYS_SETSOCKOPT: + case SYS_GETSOCKNAME: +@@ -1458,13 +1486,10 @@ + + case __NR_getrusage: + case __NR_times: + return Allow(); + +- CASES_FOR_dup2: // See ConnectTrapCommon +- return Allow(); +- + case __NR_fsync: + case __NR_msync: + return Allow(); + + case __NR_getpriority: + diff --git a/D146273.diff b/D146273.diff new file mode 100644 index 0000000..0d838e2 --- /dev/null +++ b/D146273.diff @@ -0,0 +1,90 @@ +diff --git a/security/sandbox/linux/SandboxFilter.cpp b/security/sandbox/linux/SandboxFilter.cpp +--- a/security/sandbox/linux/SandboxFilter.cpp ++++ b/security/sandbox/linux/SandboxFilter.cpp +@@ -699,10 +699,18 @@ + Maybe EvaluateSocketCall(int aCall, + bool aHasArgs) const override { + switch (aCall) { + case SYS_RECVMSG: + case SYS_SENDMSG: ++ // These next four aren't needed for IPC or other core ++ // functionality at the time of this writing, but they're ++ // subsets of recvmsg/sendmsg so there's nothing gained by not ++ // allowing them here (and simplifying subclasses). ++ case SYS_RECVFROM: ++ case SYS_SENDTO: ++ case SYS_RECV: ++ case SYS_SEND: + return Some(Allow()); + + case SYS_SOCKETPAIR: { + // We try to allow "safe" (always connected) socketpairs when using the + // file broker, or for content processes, but we may need to fall back +@@ -1253,12 +1261,10 @@ + ~ContentSandboxPolicy() override = default; + + Maybe EvaluateSocketCall(int aCall, + bool aHasArgs) const override { + switch (aCall) { +- case SYS_RECVFROM: +- case SYS_SENDTO: + case SYS_SENDMMSG: // libresolv via libasyncns; see bug 1355274 + return Some(Allow()); + + #ifdef ANDROID + case SYS_SOCKET: +@@ -1268,18 +1274,21 @@ + case SYS_CONNECT: + if (BelowLevel(4)) { + return Some(Allow()); + } + return SandboxPolicyCommon::EvaluateSocketCall(aCall, aHasArgs); +- case SYS_RECV: +- case SYS_SEND: ++ ++ // FIXME (bug 1761134): sockopts should be filtered + case SYS_GETSOCKOPT: + case SYS_SETSOCKOPT: ++ // These next 3 were needed for X11; they may not be needed ++ // with X11 lockdown, but there's not much attack surface here. + case SYS_GETSOCKNAME: + case SYS_GETPEERNAME: + case SYS_SHUTDOWN: + return Some(Allow()); ++ + case SYS_ACCEPT: + case SYS_ACCEPT4: + if (mUsingRenderDoc) { + return Some(Allow()); + } +@@ -1908,26 +1917,19 @@ + } + + Maybe EvaluateSocketCall(int aCall, + bool aHasArgs) const override { + switch (aCall) { ++ case SYS_SOCKET: ++ case SYS_CONNECT: + case SYS_BIND: + return Some(Allow()); + +- case SYS_SOCKET: +- return Some(Allow()); +- +- case SYS_CONNECT: +- return Some(Allow()); +- +- case SYS_RECVFROM: +- case SYS_SENDTO: ++ // FIXME(bug 1641401) do we really need this? + case SYS_SENDMMSG: + return Some(Allow()); + +- case SYS_RECV: +- case SYS_SEND: + case SYS_GETSOCKOPT: + case SYS_SETSOCKOPT: + case SYS_GETSOCKNAME: + case SYS_GETPEERNAME: + case SYS_SHUTDOWN: + diff --git a/D146274.diff b/D146274.diff new file mode 100644 index 0000000..8943ac4 --- /dev/null +++ b/D146274.diff @@ -0,0 +1,158 @@ +diff --git a/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp b/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp +--- a/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp ++++ b/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp +@@ -325,30 +325,84 @@ + policy->AddDynamic(perms, trimPath.get()); + } + } + } + ++static void AddX11Dependencies(SandboxBroker::Policy* policy) { ++ // Allow Primus to contact the Bumblebee daemon to manage GPU ++ // switching on NVIDIA Optimus systems. ++ const char* bumblebeeSocket = PR_GetEnv("BUMBLEBEE_SOCKET"); ++ if (bumblebeeSocket == nullptr) { ++ bumblebeeSocket = "/var/run/bumblebee.socket"; ++ } ++ policy->AddPath(SandboxBroker::MAY_CONNECT, bumblebeeSocket); ++ ++#if defined(MOZ_WIDGET_GTK) && defined(MOZ_X11) ++ // Allow local X11 connections, for several purposes: ++ // ++ // * for content processes to use WebGL when the browser is in headless ++ // mode, by opening the X display if/when needed ++ // ++ // * if Primus or VirtualGL is used, to contact the secondary X server ++ static const bool kIsX11 = ++ !mozilla::widget::GdkIsWaylandDisplay() && PR_GetEnv("DISPLAY"); ++ if (kIsX11) { ++ policy->AddPrefix(SandboxBroker::MAY_CONNECT, "/tmp/.X11-unix/X"); ++ if (auto* const xauth = PR_GetEnv("XAUTHORITY")) { ++ policy->AddPath(rdonly, xauth); ++ } else if (auto* const home = PR_GetEnv("HOME")) { ++ // This follows the logic in libXau: append "/.Xauthority", ++ // even if $HOME ends in a slash, except in the special case ++ // where HOME=/ because POSIX allows implementations to treat ++ // an initial double slash specially. ++ nsAutoCString xauth(home); ++ if (xauth != "/"_ns) { ++ xauth.Append('/'); ++ } ++ xauth.AppendLiteral(".Xauthority"); ++ policy->AddPath(rdonly, xauth.get()); ++ } ++ } ++#endif ++} ++ ++static void AddGLDependencies(SandboxBroker::Policy* policy) { ++ // Devices ++ policy->AddDir(rdwr, "/dev/dri"); ++ policy->AddFilePrefix(rdwr, "/dev", "nvidia"); ++ ++ // Hardware info ++ AddDriPaths(policy); ++ ++ // /etc and /usr/share (glvnd, libdrm, drirc, ...?) ++ policy->AddDir(rdonly, "/etc"); ++ policy->AddDir(rdonly, "/usr/share"); ++ policy->AddDir(rdonly, "/usr/local/share"); ++ ++ // Note: This function doesn't do anything about Mesa's shader ++ // cache, because the details can vary by process type, including ++ // whether caching is enabled. ++ ++ AddX11Dependencies(policy); ++} ++ + void SandboxBrokerPolicyFactory::InitContentPolicy() { + const bool headless = + StaticPrefs::security_sandbox_content_headless_AtStartup(); + + // Policy entries that are the same in every process go here, and + // are cached over the lifetime of the factory. + SandboxBroker::Policy* policy = new SandboxBroker::Policy; + // Write permssions +- // +- if (!headless) { +- // Bug 1308851: NVIDIA proprietary driver when using WebGL +- policy->AddFilePrefix(rdwr, "/dev", "nvidia"); +- +- // Bug 1312678: Mesa with DRI when using WebGL +- policy->AddDir(rdwr, "/dev/dri"); +- } + + // Bug 1575985: WASM library sandbox needs RW access to /dev/null + policy->AddPath(rdwr, "/dev/null"); + ++ if (!headless) { ++ AddGLDependencies(policy); ++ } ++ + // Read permissions + policy->AddPath(rdonly, "/dev/urandom"); + policy->AddPath(rdonly, "/dev/random"); + policy->AddPath(rdonly, "/proc/sys/crypto/fips_enabled"); + policy->AddPath(rdonly, "/proc/cpuinfo"); +@@ -370,13 +424,10 @@ + policy->AddDir(rdonly, "/run/host/fonts"); + policy->AddDir(rdonly, "/run/host/user-fonts"); + policy->AddDir(rdonly, "/run/host/local-fonts"); + policy->AddDir(rdonly, "/var/cache/fontconfig"); + +- if (!headless) { +- AddDriPaths(policy); +- } + AddLdconfigPaths(policy); + AddLdLibraryEnvPaths(policy); + + if (!headless) { + // Bug 1385715: NVIDIA PRIME support +@@ -569,45 +620,11 @@ + } + } + #endif + + if (!headless) { +- // Allow Primus to contact the Bumblebee daemon to manage GPU +- // switching on NVIDIA Optimus systems. +- const char* bumblebeeSocket = PR_GetEnv("BUMBLEBEE_SOCKET"); +- if (bumblebeeSocket == nullptr) { +- bumblebeeSocket = "/var/run/bumblebee.socket"; +- } +- policy->AddPath(SandboxBroker::MAY_CONNECT, bumblebeeSocket); +- +-#if defined(MOZ_WIDGET_GTK) && defined(MOZ_X11) +- // Allow local X11 connections, for several purposes: +- // +- // * for content processes to use WebGL when the browser is in headless +- // mode, by opening the X display if/when needed +- // +- // * if Primus or VirtualGL is used, to contact the secondary X server +- static const bool kIsX11 = +- !mozilla::widget::GdkIsWaylandDisplay() && PR_GetEnv("DISPLAY"); +- if (kIsX11) { +- policy->AddPrefix(SandboxBroker::MAY_CONNECT, "/tmp/.X11-unix/X"); +- if (auto* const xauth = PR_GetEnv("XAUTHORITY")) { +- policy->AddPath(rdonly, xauth); +- } else if (auto* const home = PR_GetEnv("HOME")) { +- // This follows the logic in libXau: append "/.Xauthority", +- // even if $HOME ends in a slash, except in the special case +- // where HOME=/ because POSIX allows implementations to treat +- // an initial double slash specially. +- nsAutoCString xauth(home); +- if (xauth != "/"_ns) { +- xauth.Append('/'); +- } +- xauth.AppendLiteral(".Xauthority"); +- policy->AddPath(rdonly, xauth.get()); +- } +- } +-#endif ++ AddX11Dependencies(policy); + } + + // Bug 1732580: when packaged as a strictly confined snap, may need + // read-access to configuration files under $SNAP/. + const char* snap = PR_GetEnv("SNAP"); + diff --git a/D146275.diff b/D146275.diff new file mode 100644 index 0000000..989b317 --- /dev/null +++ b/D146275.diff @@ -0,0 +1,125 @@ +diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp +--- a/ipc/glue/GeckoChildProcessHost.cpp ++++ b/ipc/glue/GeckoChildProcessHost.cpp +@@ -418,10 +418,17 @@ + nsresult rv = NS_GetSpecialDirectory(NS_APP_CONTENT_PROCESS_TEMP_DIR, + getter_AddRefs(contentTempDir)); + if (NS_SUCCEEDED(rv)) { + contentTempDir->GetNativePath(mTmpDirName); + } ++ } else if (aProcessType == GeckoProcessType_RDD) { ++ // The RDD process makes limited use of EGL. If Mesa's shader ++ // cache is enabled and the directory isn't explicitly set, then ++ // it will try to getpwuid() the user which can cause problems ++ // with sandboxing. Because we shouldn't need shader caching in ++ // this process, we just disable the cache to prevent that. ++ mLaunchOptions->env_map["MESA_GLSL_CACHE_DISABLE"] = "true"; + } + #endif + #if defined(MOZ_ENABLE_FORKSERVER) + if (aProcessType == GeckoProcessType_Content && ForkServiceChild::Get()) { + mLaunchOptions->use_forkserver = true; +diff --git a/security/sandbox/common/test/SandboxTestingChildTests.h b/security/sandbox/common/test/SandboxTestingChildTests.h +--- a/security/sandbox/common/test/SandboxTestingChildTests.h ++++ b/security/sandbox/common/test/SandboxTestingChildTests.h +@@ -21,14 +21,16 @@ + # include + # include + # include + # include + # include ++# include + # include + # include + # include + # include "mozilla/ProcInfo_linux.h" ++# include "mozilla/UniquePtrExtensions.h" + # ifdef MOZ_X11 + # include "X11/Xlib.h" + # include "X11UndefineNone.h" + # endif // MOZ_X11 + # endif // XP_LINUX +@@ -595,12 +597,25 @@ + return rv; + }); + + RunTestsSched(child); + +- child->ErrnoTest("socket"_ns, false, +- [] { return socket(AF_UNIX, SOCK_STREAM, 0); }); ++ child->ErrnoTest("socket_inet"_ns, false, ++ [] { return socket(AF_INET, SOCK_STREAM, 0); }); ++ ++ { ++ UniqueFileHandle fd(socket(AF_UNIX, SOCK_STREAM, 0)); ++ child->ErrnoTest("socket_unix"_ns, true, [&] { return fd.get(); }); ++ ++ struct sockaddr_un sun {}; ++ sun.sun_family = AF_UNIX; ++ strncpy(sun.sun_path, "/tmp/forbidden-sock", sizeof(sun.sun_path)); ++ ++ child->ErrnoValueTest("socket_unix_bind"_ns, ENOSYS, [&] { ++ return bind(fd.get(), (struct sockaddr*)&sun, sizeof(sun)); ++ }); ++ } + + child->ErrnoTest("uname"_ns, true, [] { + struct utsname uts; + return uname(&uts); + }); +diff --git a/security/sandbox/linux/SandboxFilter.cpp b/security/sandbox/linux/SandboxFilter.cpp +--- a/security/sandbox/linux/SandboxFilter.cpp ++++ b/security/sandbox/linux/SandboxFilter.cpp +@@ -1783,10 +1783,11 @@ + class RDDSandboxPolicy final : public SandboxPolicyCommon { + public: + explicit RDDSandboxPolicy(SandboxBrokerClient* aBroker) { + mBroker = aBroker; + mMayCreateShmem = true; ++ mBrokeredConnect = true; + } + + #ifndef ANDROID + Maybe EvaluateIpcCall(int aCall, int aArgShift) const override { + // The Intel media driver uses SysV IPC (semaphores and shared +@@ -1818,15 +1819,15 @@ + #endif + + Maybe EvaluateSocketCall(int aCall, + bool aHasArgs) const override { + switch (aCall) { +- // Mesa can call getpwuid_r to get the home dir, which can try +- // to connect to nscd (or maybe servers like NIS or LDAP); this +- // can't be safely allowed, but we can quietly deny it. +- case SYS_SOCKET: +- return Some(Error(EACCES)); ++ // These are for X11. ++ case SYS_GETSOCKNAME: ++ case SYS_GETPEERNAME: ++ case SYS_SHUTDOWN: ++ return Some(Allow()); + + default: + return SandboxPolicyCommon::EvaluateSocketCall(aCall, aHasArgs); + } + } +diff --git a/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp b/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp +--- a/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp ++++ b/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp +@@ -853,13 +853,12 @@ + if (developer_repo_dir) { + policy->AddDir(rdonly, developer_repo_dir); + } + } + +- // VA-API needs DRI and GPU detection +- policy->AddDir(rdwr, "/dev/dri"); +- AddDriPaths(policy.get()); ++ // VA-API needs GPU access and GL context creation ++ AddGLDependencies(policy.get()); + + // FFmpeg and GPU drivers may need general-case library loading + AddLdconfigPaths(policy.get()); + AddLdLibraryEnvPaths(policy.get()); + + diff --git a/firefox.spec b/firefox.spec index 4d49292..118e3ca 100644 --- a/firefox.spec +++ b/firefox.spec @@ -162,8 +162,8 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox -Version: 101.0 -Release: 2%{?pre_tag}%{?dist} +Version: 101.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -219,6 +219,7 @@ Patch62: build-python.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch73: D147266.diff Patch74: D147267.diff +Patch75: mozilla-1773336.patch # Test patches # Generate without context by @@ -256,6 +257,11 @@ Patch427: D146087.diff Patch428: D145725.diff Patch429: D145966.diff Patch430: D145871.diff +Patch431: D146271.diff +Patch432: D146272.diff +Patch433: D146273.diff +Patch434: D146274.diff +Patch435: D146275.diff # NVIDIA mzbz#1735929 Patch440: D147635.diff @@ -480,6 +486,7 @@ This package contains results of tests executed during build. %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch73 -p1 -b .D147266 %patch74 -p1 -b .D147267 +%patch75 -p1 -b .mzbz#1773336 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -514,6 +521,11 @@ This package contains results of tests executed during build. %patch428 -p1 -b .D145725.diff %patch429 -p1 -b .D145966.diff %patch430 -p1 -b .D145871.diff +%patch431 -p1 -b .D146271.diff +%patch432 -p1 -b .D146272.diff +%patch433 -p1 -b .D146273.diff +%patch434 -p1 -b .D146274.diff +%patch435 -p1 -b .D146275.diff # NVIDIA mzbz#1735929 %patch440 -p1 -b .D147635.diff @@ -1095,6 +1107,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Thu Jun 9 2022 Martin Stransky - 101.0.1-1 +- Updated to 101.0.1 +- More VA-API sandbox fixes (mzbz#1769182) + * Tue Jun 7 2022 Martin Stransky - 101.0-2 - Enabled VA-API by default (+ added VA-API fixes from upstream) - Fixed WebGL performance on NVIDIA drivers (mzbz#1735929) diff --git a/mozilla-1773336.patch b/mozilla-1773336.patch new file mode 100644 index 0000000..b65ff89 --- /dev/null +++ b/mozilla-1773336.patch @@ -0,0 +1,12 @@ +diff -up firefox-101.0.1/gfx/webrender_bindings/webrender_ffi.h.old firefox-101.0.1/gfx/webrender_bindings/webrender_ffi.h +--- firefox-101.0.1/gfx/webrender_bindings/webrender_ffi.h.old 2022-06-09 10:31:16.122495733 +0200 ++++ firefox-101.0.1/gfx/webrender_bindings/webrender_ffi.h 2022-06-09 10:31:22.880724352 +0200 +@@ -72,8 +72,6 @@ struct WrPipelineInfo; + struct WrPipelineIdAndEpoch; + using WrPipelineIdEpochs = nsTArray; + +-const uint64_t ROOT_CLIP_CHAIN = ~0; +- + } // namespace wr + } // namespace mozilla + diff --git a/sources b/sources index 0b97dec..ad76a99 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (firefox-101.0.source.tar.xz) = fffe7e0940c1443fcdc5b205677764cb4e04b29f33fcfafb2857d383700584f309806b81fc4989efb56cc12a3cca1ff7d451b647050c43e98777b5c952ed5d56 -SHA512 (firefox-langpacks-101.0-20220530.tar.xz) = aa81113b6aef965aa17921d563759da6c499021b6f471369d998c35802f72e79a107080b4df59ca51dae15ac464176f23bce2fc84942f5852e810d963553b687 SHA512 (cbindgen-vendor.tar.xz) = 2bfec52455f133ede2fb7f7e8bcd358cb547a82cbb01e8cef477fe0700ebdfd9cf647cd93a6c11d3b321e441a142e26793c7a7865dba5c93033250ae78cf6b4b +SHA512 (firefox-101.0.1.source.tar.xz) = 435a7f6013582933e75c41e554a45beda30b5affd7d3ed7d2876026609ba7f17b2c20b507d9d0c9ce2379e335ec09b021257ba30ac55fabf02dca54b03ea70b4 +SHA512 (firefox-langpacks-101.0.1-20220609.tar.xz) = 54c93a0fbded6a42948fd578e5577987186ca04695f9c0648718780d3a491b540187addf1239b13c53e532052888bd2ed76788a06c3a2422a060fb0da303ec58 From b707846f45cac0547f08d2b074aaed76ee736ada Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 9 Jun 2022 11:18:33 +0200 Subject: [PATCH 056/545] Fixed langpack name --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 118e3ca..7fccbea 100644 --- a/firefox.spec +++ b/firefox.spec @@ -168,7 +168,7 @@ URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220530.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220609.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig From 980a9af4ddbabe91f61563d7ec905fe55d5213b1 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 9 Jun 2022 12:12:48 +0200 Subject: [PATCH 057/545] cbindgen build fix --- firefox.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 7fccbea..0673ea6 100644 --- a/firefox.spec +++ b/firefox.spec @@ -486,7 +486,8 @@ This package contains results of tests executed during build. %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch73 -p1 -b .D147266 %patch74 -p1 -b .D147267 -%patch75 -p1 -b .mzbz#1773336 +# Needs for new cbindgen only +%patch75 -p1 -b .1773336 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell From 6edb288b6fdcb4644abc5f892569d59c26aa5d75 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 9 Jun 2022 16:40:46 +0200 Subject: [PATCH 058/545] Updated cbindgen to 0.24.0 --- gen_cbindgen-vendor.sh | 2 +- sources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gen_cbindgen-vendor.sh b/gen_cbindgen-vendor.sh index c446a51..8e10eb2 100755 --- a/gen_cbindgen-vendor.sh +++ b/gen_cbindgen-vendor.sh @@ -12,7 +12,7 @@ to be used with 'cargo vendor' commmand. """ [dependencies] -cbindgen = "0.23.0" +cbindgen = "0.24.0" [[bin]] name = "dummy" diff --git a/sources b/sources index ad76a99..e75afbf 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (cbindgen-vendor.tar.xz) = 2bfec52455f133ede2fb7f7e8bcd358cb547a82cbb01e8cef477fe0700ebdfd9cf647cd93a6c11d3b321e441a142e26793c7a7865dba5c93033250ae78cf6b4b SHA512 (firefox-101.0.1.source.tar.xz) = 435a7f6013582933e75c41e554a45beda30b5affd7d3ed7d2876026609ba7f17b2c20b507d9d0c9ce2379e335ec09b021257ba30ac55fabf02dca54b03ea70b4 SHA512 (firefox-langpacks-101.0.1-20220609.tar.xz) = 54c93a0fbded6a42948fd578e5577987186ca04695f9c0648718780d3a491b540187addf1239b13c53e532052888bd2ed76788a06c3a2422a060fb0da303ec58 +SHA512 (cbindgen-vendor.tar.xz) = d681ca855f3779553b4a452f9dc1e3acea6253b7ef33a65948ab2d32d9848e8c06f0b3f3504ef237d6b9adb4813bdad990f7a79fa9f89333ce0d4e8da7e12d94 From e2a4b7e32db3b6700dccfb76f68e442a72a935f7 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 9 Jun 2022 17:21:56 +0200 Subject: [PATCH 059/545] Adjust GMP plugin setting (rhbz#2094319) --- firefox.spec | 1 + mozilla-1663844.patch | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/firefox.spec b/firefox.spec index 0673ea6..70246c1 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1111,6 +1111,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : * Thu Jun 9 2022 Martin Stransky - 101.0.1-1 - Updated to 101.0.1 - More VA-API sandbox fixes (mzbz#1769182) +- Adjust GMP plugin setting (rhbz#2094319) * Tue Jun 7 2022 Martin Stransky - 101.0-2 - Enabled VA-API by default (+ added VA-API fixes from upstream) diff --git a/mozilla-1663844.patch b/mozilla-1663844.patch index d356425..b8712e0 100644 --- a/mozilla-1663844.patch +++ b/mozilla-1663844.patch @@ -1,6 +1,6 @@ -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 +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 16:45:32.341742564 +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 @@ -10,20 +10,21 @@ diff -up firefox-101.0/dom/media/gmp/GMPSharedMemManager.h.1663844 firefox-101.0 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 - +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 17:14:51.310699618 +0200 +@@ -67,7 +67,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()}); +- isSupported = HaveGMPFor(api, {"h264"_ns, aGMP.value()}); ++ isSupported = true; } 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 + isSupported = HaveGMPFor(api, {"vp9"_ns, aGMP.value()}); + } else if (VPXDecoder::IsVP8(aMimeType)) { +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 16:45:32.341742564 +0200 @@ -70,6 +70,8 @@ void GMPVideoDecoder::Decoded(GMPVideoi4 RefPtr self = this; if (v) { From 33fd704cce4e66e27623dcab99d8f3cef02a991e Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 9 Jun 2022 20:34:42 +0200 Subject: [PATCH 060/545] Fixed openh264 decode --- firefox.spec | 2 +- mozilla-1663844.patch | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/firefox.spec b/firefox.spec index 70246c1..24fce88 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1111,7 +1111,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : * Thu Jun 9 2022 Martin Stransky - 101.0.1-1 - Updated to 101.0.1 - More VA-API sandbox fixes (mzbz#1769182) -- Adjust GMP plugin setting (rhbz#2094319) +- Fixed OpenH264 decode (rhbz#2094319) * Tue Jun 7 2022 Martin Stransky - 101.0-2 - Enabled VA-API by default (+ added VA-API fixes from upstream) diff --git a/mozilla-1663844.patch b/mozilla-1663844.patch index b8712e0..4cc43ea 100644 --- a/mozilla-1663844.patch +++ b/mozilla-1663844.patch @@ -1,6 +1,6 @@ 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 16:45:32.341742564 +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 @@ -12,19 +12,20 @@ diff -up firefox-101.0.1/dom/media/gmp/GMPSharedMemManager.h.1663844 firefox-101 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 17:14:51.310699618 +0200 -@@ -67,7 +67,7 @@ media::DecodeSupportSet GMPDecoderModule - nsCString api = nsLiteralCString(CHROMIUM_CDM_API); ++++ 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; + } - if (MP4Decoder::IsH264(aMimeType)) { -- isSupported = HaveGMPFor(api, {"h264"_ns, aGMP.value()}); -+ isSupported = true; - } else if (VPXDecoder::IsVP9(aMimeType)) { - isSupported = HaveGMPFor(api, {"vp9"_ns, aGMP.value()}); - } else if (VPXDecoder::IsVP8(aMimeType)) { 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 16:45:32.341742564 +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 self = this; if (v) { From bfdfd329b23704e23c73873d70b9231ef6a2c939 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 13 Jun 2022 16:36:43 +0200 Subject: [PATCH 061/545] Fix WebGL mem leaks (mzbz#1773968) --- D149135.diff | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++ firefox.spec | 7 ++++- 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 D149135.diff diff --git a/D149135.diff b/D149135.diff new file mode 100644 index 0000000..6e93f2b --- /dev/null +++ b/D149135.diff @@ -0,0 +1,80 @@ +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/firefox.spec b/firefox.spec index 24fce88..1f412f8 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 101.0.1 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -267,6 +267,7 @@ Patch435: D146275.diff Patch440: D147635.diff Patch441: D147636.diff Patch442: D147637.diff +Patch443: D149135.diff # PGO/LTO patches Patch600: pgo.patch @@ -532,6 +533,7 @@ This package contains results of tests executed during build. %patch440 -p1 -b .D147635.diff %patch441 -p1 -b .D147636.diff %patch442 -p1 -b .D147637.diff +%patch443 -p1 -b .D149135.diff # More VA-API fixes %patch422 -p1 -b .D147720.diff @@ -1108,6 +1110,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Mon Jun 13 2022 Martin Stransky - 101.0.1-2 +- Fix WebGL mem leaks (mzbz#1773968) + * Thu Jun 9 2022 Martin Stransky - 101.0.1-1 - Updated to 101.0.1 - More VA-API sandbox fixes (mzbz#1769182) From 92e16f9069e32c692765fface7cfc01813c81bf9 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 14 Jun 2022 14:33:53 +0200 Subject: [PATCH 062/545] Added more VA-API and WebGL fixes --- D148946.diff | 250 +++++++++++++++++++++++++++++++++++++++++++++++++++ D149238.diff | 100 +++++++++++++++++++++ firefox.spec | 9 +- 3 files changed, 358 insertions(+), 1 deletion(-) create mode 100644 D148946.diff create mode 100644 D149238.diff diff --git a/D148946.diff b/D148946.diff new file mode 100644 index 0000000..e4d9aa4 --- /dev/null +++ b/D148946.diff @@ -0,0 +1,250 @@ +diff -up firefox-101.0.1/gfx/gl/GLContextProviderEGL.cpp.D148946.diff firefox-101.0.1/gfx/gl/GLContextProviderEGL.cpp +--- firefox-101.0.1/gfx/gl/GLContextProviderEGL.cpp.D148946.diff 2022-06-14 14:25:07.290229683 +0200 ++++ firefox-101.0.1/gfx/gl/GLContextProviderEGL.cpp 2022-06-14 14:25:07.313230450 +0200 +@@ -1190,42 +1190,16 @@ RefPtr GLContextEGL::Creat + } + + /*static*/ +-RefPtr GLContextEGL::CreateEGLSurfacelessContext( +- const std::shared_ptr display, const GLContextCreateDesc& desc, +- nsACString* const out_failureId) { +- const EGLConfig config = {}; +- auto fullDesc = GLContextDesc{desc}; +- fullDesc.isOffscreen = true; +- RefPtr 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 GLContextProviderEGL::CreateHeadless( + const GLContextCreateDesc& desc, nsACString* const out_failureId) { + const auto display = DefaultEglDisplay(out_failureId); + if (!display) { + return nullptr; + } +- RefPtr 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-101.0.1/gfx/gl/GLDefs.h.D148946.diff firefox-101.0.1/gfx/gl/GLDefs.h +--- firefox-101.0.1/gfx/gl/GLDefs.h.D148946.diff 2022-06-14 14:25:07.290229683 +0200 ++++ firefox-101.0.1/gfx/gl/GLDefs.h 2022-06-14 14:25:07.313230450 +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-101.0.1/gfx/gl/GLLibraryEGL.cpp.D148946.diff firefox-101.0.1/gfx/gl/GLLibraryEGL.cpp +--- firefox-101.0.1/gfx/gl/GLLibraryEGL.cpp.D148946.diff 2022-06-14 14:25:07.307230250 +0200 ++++ firefox-101.0.1/gfx/gl/GLLibraryEGL.cpp 2022-06-14 14:27:03.477110994 +0200 +@@ -53,9 +53,15 @@ StaticRefPtr 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[] = { +@@ -83,7 +89,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"}; +@@ -156,8 +161,52 @@ static std::shared_ptr GetAn + } + + #ifdef MOZ_WAYLAND ++static std::shared_ptr 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 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 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); +@@ -610,9 +659,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); + } + { +@@ -657,6 +706,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 GLLibraryEGL + // Some drivers doesn't support EGL_DEFAULT_DISPLAY + 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)) { + nativeDisplay = widget::WaylandDisplayGetWLDisplay(gdkDisplay); + if (!nativeDisplay) { +diff -up firefox-101.0.1/gfx/gl/GLLibraryEGL.h.D148946.diff firefox-101.0.1/gfx/gl/GLLibraryEGL.h +--- firefox-101.0.1/gfx/gl/GLLibraryEGL.h.D148946.diff 2022-06-14 14:25:07.307230250 +0200 ++++ firefox-101.0.1/gfx/gl/GLLibraryEGL.h 2022-06-14 14:25:07.313230450 +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/D149238.diff b/D149238.diff new file mode 100644 index 0000000..290c536 --- /dev/null +++ b/D149238.diff @@ -0,0 +1,100 @@ +diff -up firefox-101.0.1/gfx/config/gfxVars.h.D149238.diff firefox-101.0.1/gfx/config/gfxVars.h +--- firefox-101.0.1/gfx/config/gfxVars.h.D149238.diff 2022-06-14 14:28:15.301514131 +0200 ++++ firefox-101.0.1/gfx/config/gfxVars.h 2022-06-14 14:29:32.221087732 +0200 +@@ -91,7 +91,8 @@ class gfxVarReceiver; + _(AllowWebGPU, bool, false) \ + _(UseVP8HwDecode, bool, false) \ + _(UseVP9HwDecode, bool, false) \ +- _(HwDecodedVideoNoCopy, bool, false) ++ _(HwDecodedVideoNoCopy, bool, false) \ ++ _(UseDMABufSurfaceExport, bool, true) + + /* Add new entries above this line. */ + +diff -up firefox-101.0.1/gfx/gl/SharedSurfaceDMABUF.cpp.D149238.diff firefox-101.0.1/gfx/gl/SharedSurfaceDMABUF.cpp +--- firefox-101.0.1/gfx/gl/SharedSurfaceDMABUF.cpp.D149238.diff 2022-06-14 14:28:15.297513997 +0200 ++++ firefox-101.0.1/gfx/gl/SharedSurfaceDMABUF.cpp 2022-06-14 14:28:15.301514131 +0200 +@@ -9,6 +9,7 @@ + #include "GLContextEGL.h" + #include "MozFramebuffer.h" + #include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor, etc ++#include "mozilla/gfx/gfxVars.h" + + namespace mozilla::gl { + +@@ -27,22 +28,39 @@ UniquePtr SharedSu + const auto& context = gle->mContext; + const auto& egl = *(gle->mEgl); + +- if (!HasDmaBufExtensions(gle)) { +- return nullptr; +- } +- +- auto fb = MozFramebuffer::Create(desc.gl, desc.size, 0, false); +- if (!fb) return nullptr; +- +- const auto buffer = reinterpret_cast(fb->ColorTex()); +- const auto image = +- egl.fCreateImage(context, LOCAL_EGL_GL_TEXTURE_2D, buffer, nullptr); +- if (!image) return nullptr; +- +- const RefPtr surface = DMABufSurfaceRGBA::CreateDMABufSurface( +- desc.gl, image, desc.size.width, desc.size.height); +- if (!surface) return nullptr; ++ RefPtr surface; ++ UniquePtr 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( ++ 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(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; ++ } + return AsUnique(new SharedSurface_DMABUF(desc, std::move(fb), surface)); + } + +diff -up firefox-101.0.1/gfx/thebes/gfxPlatform.cpp.D149238.diff firefox-101.0.1/gfx/thebes/gfxPlatform.cpp +--- firefox-101.0.1/gfx/thebes/gfxPlatform.cpp.D149238.diff 2022-06-08 23:06:36.000000000 +0200 ++++ firefox-101.0.1/gfx/thebes/gfxPlatform.cpp 2022-06-14 14:28:15.302514165 +0200 +@@ -2851,6 +2851,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/firefox.spec b/firefox.spec index 1f412f8..80f2a2d 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 101.0.1 -Release: 2%{?pre_tag}%{?dist} +Release: 4%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -268,6 +268,8 @@ Patch440: D147635.diff Patch441: D147636.diff Patch442: D147637.diff Patch443: D149135.diff +Patch444: D148946.diff +Patch445: D149238.diff # PGO/LTO patches Patch600: pgo.patch @@ -537,6 +539,8 @@ This package contains results of tests executed during build. # More VA-API fixes %patch422 -p1 -b .D147720.diff +%patch444 -p1 -b .D148946.diff +%patch445 -p1 -b .D149238.diff # PGO patches %if %{build_with_pgo} @@ -1110,6 +1114,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue Jun 14 2022 Martin Stransky - 101.0.1-3 +- Added fixes for mozbz#1773377 and mozbz#1774075 + * Mon Jun 13 2022 Martin Stransky - 101.0.1-2 - Fix WebGL mem leaks (mzbz#1773968) From cd6ef2bb8265b2054523b97231f7e6daa98aaa31 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 15 Jun 2022 15:05:58 +0200 Subject: [PATCH 063/545] Added fix for mozbz#1758948 (AV1 VA-API playback shuttering) --- firefox.spec | 9 ++++++++- mozilla-1758948.patch | 28 ++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 mozilla-1758948.patch diff --git a/firefox.spec b/firefox.spec index 80f2a2d..1e7b348 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 101.0.1 -Release: 4%{?pre_tag}%{?dist} +Release: 5%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -267,9 +267,12 @@ Patch435: D146275.diff Patch440: D147635.diff Patch441: D147636.diff Patch442: D147637.diff + +# More upstream fixes Patch443: D149135.diff Patch444: D148946.diff Patch445: D149238.diff +Patch446: mozilla-1758948.patch # PGO/LTO patches Patch600: pgo.patch @@ -541,6 +544,7 @@ This package contains results of tests executed during build. %patch422 -p1 -b .D147720.diff %patch444 -p1 -b .D148946.diff %patch445 -p1 -b .D149238.diff +%patch446 -p1 -b .mozbz#1758948 # PGO patches %if %{build_with_pgo} @@ -1114,6 +1118,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Wed Jun 15 2022 Martin Stransky - 101.0.1-5 +- Added fix for mozbz#1758948 (AV1 VA-API playback shuttering) + * Tue Jun 14 2022 Martin Stransky - 101.0.1-3 - Added fixes for mozbz#1773377 and mozbz#1774075 diff --git a/mozilla-1758948.patch b/mozilla-1758948.patch new file mode 100644 index 0000000..7bc99e4 --- /dev/null +++ b/mozilla-1758948.patch @@ -0,0 +1,28 @@ +changeset: 623785:a6b80ee8c35f +tag: tip +parent: 623782:b1ed2fa50612 +user: stransky +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::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; + From 5128ca8e5f4dd6b3d38216891efc0d43189a2205 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 17 Jun 2022 12:54:46 +0200 Subject: [PATCH 064/545] Added fix for mozilla#1774271 --- firefox.spec | 7 ++++++- mozilla-1774271.patch | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 mozilla-1774271.patch diff --git a/firefox.spec b/firefox.spec index 1e7b348..83ad16f 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 101.0.1 -Release: 5%{?pre_tag}%{?dist} +Release: 6%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -273,6 +273,7 @@ Patch443: D149135.diff Patch444: D148946.diff Patch445: D149238.diff Patch446: mozilla-1758948.patch +Patch447: mozilla-1774271.patch # PGO/LTO patches Patch600: pgo.patch @@ -545,6 +546,7 @@ This package contains results of tests executed during build. %patch444 -p1 -b .D148946.diff %patch445 -p1 -b .D149238.diff %patch446 -p1 -b .mozbz#1758948 +%patch447 -p1 -b .mozbz#1774271 # PGO patches %if %{build_with_pgo} @@ -1118,6 +1120,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Fri Jun 17 2022 Martin Stransky - 101.0.1-6 +- Added fix for mozbz#1774271 - Intel/dmabuf export issues. + * Wed Jun 15 2022 Martin Stransky - 101.0.1-5 - Added fix for mozbz#1758948 (AV1 VA-API playback shuttering) diff --git a/mozilla-1774271.patch b/mozilla-1774271.patch new file mode 100644 index 0000000..6029b22 --- /dev/null +++ b/mozilla-1774271.patch @@ -0,0 +1,31 @@ +changeset: 623945:6117c9ecd16b +tag: tip +parent: 623941:45e313943df5 +user: stransky +date: Fri Jun 17 12:36:38 2022 +0200 +files: gfx/thebes/gfxPlatform.cpp +description: +Bug 1774271 [Linux] Don't use EGL_MESA_image_dma_buf_export in Mesa/Intel due to https://gitlab.freedesktop.org/mesa/mesa/-/issues/6688 r?jgilbert + +Depends on https://phabricator.services.mozilla.com/D149238 + +Differential Revision: https://phabricator.services.mozilla.com/D149608 + + +diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp +--- a/gfx/thebes/gfxPlatform.cpp ++++ b/gfx/thebes/gfxPlatform.cpp +@@ -2871,6 +2871,12 @@ void gfxPlatform::InitWebGLConfig() { + adapterDriverVendor.Find("radeonsi") != -1) { + gfxVars::SetUseDMABufSurfaceExport(false); + } ++ // Disable EGL_MESA_image_dma_buf_export on mesa/iris due to ++ // https://gitlab.freedesktop.org/mesa/mesa/-/issues/6688 ++ if (adapterDriverVendor.Find("mesa") != -1 && ++ adapterDriverVendor.Find("iris") != -1) { ++ gfxVars::SetUseDMABufSurfaceExport(false); ++ } + } + } + + From eb4214a710399d5124f5922a22ef72a6ad676a58 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Tue, 21 Jun 2022 11:20:16 +0200 Subject: [PATCH 065/545] Use $GETENFORCE_FILE to call getenforce with full path: rhbz#2091219 --- firefox-mozconfig | 3 ++- firefox.sh.in | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/firefox-mozconfig b/firefox-mozconfig index 90dfccf..ec288fe 100644 --- a/firefox-mozconfig +++ b/firefox-mozconfig @@ -16,7 +16,8 @@ ac_add_options --with-system-fdk-aac ac_add_options --enable-js-shell ac_add_options --with-unsigned-addon-scopes=app,system ac_add_options --without-sysroot -ac_add_options --without-wasm-sandboxed-libraries +ac_add_options --with-wasm-sandboxed-libraries +ac_add_options --disable-bootstrap export BUILD_OFFICIAL=1 export MOZILLA_OFFICIAL=1 diff --git a/firefox.sh.in b/firefox.sh.in index 76df06b..5fef0b2 100644 --- a/firefox.sh.in +++ b/firefox.sh.in @@ -193,7 +193,7 @@ fi # When Firefox is not running, restore SELinux labels for profile files # (rhbz#1731371) if [ $MOZILLA_DOWN -ne 0 ]; then - if [ -x $GETENFORCE_FILE ] && [ `getenforce` != "Disabled" ]; then + if [ -x $GETENFORCE_FILE ] && [ `$GETENFORCE_FILE` != "Disabled" ]; then (restorecon -vr ~/.mozilla/firefox/* &) fi fi From db7de5356d43d6f7ad3272131548e77eac758b9b Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Wed, 22 Jun 2022 10:34:50 +0200 Subject: [PATCH 066/545] Enable wasm sandboxed libraries --- firefox-mozconfig | 1 - firefox.spec | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/firefox-mozconfig b/firefox-mozconfig index ec288fe..ef4e329 100644 --- a/firefox-mozconfig +++ b/firefox-mozconfig @@ -16,7 +16,6 @@ ac_add_options --with-system-fdk-aac ac_add_options --enable-js-shell ac_add_options --with-unsigned-addon-scopes=app,system ac_add_options --without-sysroot -ac_add_options --with-wasm-sandboxed-libraries ac_add_options --disable-bootstrap export BUILD_OFFICIAL=1 diff --git a/firefox.spec b/firefox.spec index 83ad16f..3200521 100644 --- a/firefox.spec +++ b/firefox.spec @@ -317,9 +317,8 @@ BuildRequires: llvm BuildRequires: llvm-devel BuildRequires: clang BuildRequires: clang-libs -%if %{build_with_clang} +# needed for wasm-ld BuildRequires: lld -%endif BuildRequires: pipewire-devel From cad15cfb85b687a6287224a032cbaba836949fb3 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Wed, 22 Jun 2022 10:49:27 +0200 Subject: [PATCH 067/545] Enable rlbox sandboxed libraries --- firefox.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 3200521..8477b91 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 101.0.1 -Release: 6%{?pre_tag}%{?dist} +Release: 7%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1119,6 +1119,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Wed Jun 22 2022 Jan Horak - 101.0.1-7 +- Enable rlbox (third party libraries sandboxing) + * Fri Jun 17 2022 Martin Stransky - 101.0.1-6 - Added fix for mozbz#1774271 - Intel/dmabuf export issues. From 8af042bc544bc91955fff7bd0d8fb1097744b8c0 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Mon, 27 Jun 2022 10:43:19 +0200 Subject: [PATCH 068/545] Reverting RLbox enablement because the sysroot is not on the koji builders - obviously. I was confused by my local envinment which went fine during local build. --- firefox-mozconfig | 2 +- firefox.spec | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/firefox-mozconfig b/firefox-mozconfig index ef4e329..90dfccf 100644 --- a/firefox-mozconfig +++ b/firefox-mozconfig @@ -16,7 +16,7 @@ ac_add_options --with-system-fdk-aac ac_add_options --enable-js-shell ac_add_options --with-unsigned-addon-scopes=app,system ac_add_options --without-sysroot -ac_add_options --disable-bootstrap +ac_add_options --without-wasm-sandboxed-libraries export BUILD_OFFICIAL=1 export MOZILLA_OFFICIAL=1 diff --git a/firefox.spec b/firefox.spec index 8477b91..83ad16f 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 101.0.1 -Release: 7%{?pre_tag}%{?dist} +Release: 6%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -317,8 +317,9 @@ BuildRequires: llvm BuildRequires: llvm-devel BuildRequires: clang BuildRequires: clang-libs -# needed for wasm-ld +%if %{build_with_clang} BuildRequires: lld +%endif BuildRequires: pipewire-devel @@ -1119,9 +1120,6 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog -* Wed Jun 22 2022 Jan Horak - 101.0.1-7 -- Enable rlbox (third party libraries sandboxing) - * Fri Jun 17 2022 Martin Stransky - 101.0.1-6 - Added fix for mozbz#1774271 - Intel/dmabuf export issues. From 386d29543d88095da413cd9dac053a0dfbf39bb0 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 27 Jun 2022 13:39:19 +0200 Subject: [PATCH 069/545] Rebuild --- firefox.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 83ad16f..92efbb1 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 101.0.1 -Release: 6%{?pre_tag}%{?dist} +Release: 7%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1120,6 +1120,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Mon Jun 27 2022 Martin Stransky - 101.0.1-7 +- Rebuild + * Fri Jun 17 2022 Martin Stransky - 101.0.1-6 - Added fix for mozbz#1774271 - Intel/dmabuf export issues. From e88b5e06a77c80019ab24d447f3e83151598bdcd Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Tue, 28 Jun 2022 15:07:03 +0200 Subject: [PATCH 070/545] Enable rlbox --- .gitignore | 1 + firefox-mozconfig | 2 -- firefox.spec | 9 ++++++--- sources | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 4ba9226..22538ad 100644 --- a/.gitignore +++ b/.gitignore @@ -515,3 +515,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-101.0-20220530.tar.xz /firefox-101.0.1.source.tar.xz /firefox-langpacks-101.0.1-20220609.tar.xz +/wasi-sysroot-16.0.tar.gz diff --git a/firefox-mozconfig b/firefox-mozconfig index 90dfccf..469d5c1 100644 --- a/firefox-mozconfig +++ b/firefox-mozconfig @@ -15,8 +15,6 @@ ac_add_options --allow-addon-sideload ac_add_options --with-system-fdk-aac ac_add_options --enable-js-shell ac_add_options --with-unsigned-addon-scopes=app,system -ac_add_options --without-sysroot -ac_add_options --without-wasm-sandboxed-libraries export BUILD_OFFICIAL=1 export MOZILLA_OFFICIAL=1 diff --git a/firefox.spec b/firefox.spec index 92efbb1..18dda69 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1,6 +1,6 @@ # Produce a build suitable for release, i.e. use PGO/LTO. You can turn it off # when building locally to reduce build time. -%global release_build 1 +%global release_build 0 # Run Mozilla test suite as a part of compile rpm section. Turn off when # building locally and don't want to spend 24 hours waiting for results. @@ -171,6 +171,7 @@ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pr Source1: firefox-langpacks-%{version}%{?pre_version}-20220609.tar.xz %endif Source2: cbindgen-vendor.tar.xz +Source3: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-16/wasi-sysroot-16.0.tar.gz Source10: firefox-mozconfig Source12: firefox-redhat-default-prefs.js Source20: firefox.desktop @@ -317,9 +318,7 @@ BuildRequires: llvm BuildRequires: llvm-devel BuildRequires: clang BuildRequires: clang-libs -%if %{build_with_clang} BuildRequires: lld -%endif BuildRequires: pipewire-devel @@ -647,6 +646,10 @@ echo "ac_add_options --with-google-safebrowsing-api-keyfile=`pwd`/google-api-key echo 'export NODEJS="%{_buildrootdir}/bin/node-stdout-nonblocking-wrapper"' >> .mozconfig +# Prepare wasi sdk: +%{__tar} xf %{SOURCE3} +echo "ac_add_options --with-wasi-sysroot=`pwd`/wasi-sysroot" >> .mozconfig + # Remove executable bit to make brp-mangle-shebangs happy. chmod -x third_party/rust/itertools/src/lib.rs chmod a-x third_party/rust/ash/src/extensions/ext/*.rs diff --git a/sources b/sources index e75afbf..f707e70 100644 --- a/sources +++ b/sources @@ -2,3 +2,4 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa3490307 SHA512 (firefox-101.0.1.source.tar.xz) = 435a7f6013582933e75c41e554a45beda30b5affd7d3ed7d2876026609ba7f17b2c20b507d9d0c9ce2379e335ec09b021257ba30ac55fabf02dca54b03ea70b4 SHA512 (firefox-langpacks-101.0.1-20220609.tar.xz) = 54c93a0fbded6a42948fd578e5577987186ca04695f9c0648718780d3a491b540187addf1239b13c53e532052888bd2ed76788a06c3a2422a060fb0da303ec58 SHA512 (cbindgen-vendor.tar.xz) = d681ca855f3779553b4a452f9dc1e3acea6253b7ef33a65948ab2d32d9848e8c06f0b3f3504ef237d6b9adb4813bdad990f7a79fa9f89333ce0d4e8da7e12d94 +SHA512 (wasi-sysroot-16.0.tar.gz) = 21aa04749273aef09523aeb4a38430d273b50276b960f9efed8466d19950124752ab4db79be1b5a54fa93d10ad4ceb7dff258f9f4cf5c7bdd59b3e9d0d7bc0a1 From aa451636d1a9ab71ef8d9109d1359e2b41e597df Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Tue, 28 Jun 2022 15:10:59 +0200 Subject: [PATCH 071/545] Enable release build again --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 18dda69..4d099c9 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1,6 +1,6 @@ # Produce a build suitable for release, i.e. use PGO/LTO. You can turn it off # when building locally to reduce build time. -%global release_build 0 +%global release_build 1 # Run Mozilla test suite as a part of compile rpm section. Turn off when # building locally and don't want to spend 24 hours waiting for results. From 1ae08943fc0d8fcc8cfd2a181ba958acddc2a5df Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Tue, 28 Jun 2022 15:30:10 +0200 Subject: [PATCH 072/545] Revert "Enable release build again" This reverts commit aa451636d1a9ab71ef8d9109d1359e2b41e597df. --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 4d099c9..18dda69 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1,6 +1,6 @@ # Produce a build suitable for release, i.e. use PGO/LTO. You can turn it off # when building locally to reduce build time. -%global release_build 1 +%global release_build 0 # Run Mozilla test suite as a part of compile rpm section. Turn off when # building locally and don't want to spend 24 hours waiting for results. From 6a83fb069ef4b0d0f5a46fe65f9bda401b675eb2 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Tue, 28 Jun 2022 15:30:16 +0200 Subject: [PATCH 073/545] Revert "Enable rlbox" This reverts commit e88b5e06a77c80019ab24d447f3e83151598bdcd. --- .gitignore | 1 - firefox-mozconfig | 2 ++ firefox.spec | 9 +++------ sources | 1 - 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 22538ad..4ba9226 100644 --- a/.gitignore +++ b/.gitignore @@ -515,4 +515,3 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-101.0-20220530.tar.xz /firefox-101.0.1.source.tar.xz /firefox-langpacks-101.0.1-20220609.tar.xz -/wasi-sysroot-16.0.tar.gz diff --git a/firefox-mozconfig b/firefox-mozconfig index 469d5c1..90dfccf 100644 --- a/firefox-mozconfig +++ b/firefox-mozconfig @@ -15,6 +15,8 @@ ac_add_options --allow-addon-sideload ac_add_options --with-system-fdk-aac ac_add_options --enable-js-shell ac_add_options --with-unsigned-addon-scopes=app,system +ac_add_options --without-sysroot +ac_add_options --without-wasm-sandboxed-libraries export BUILD_OFFICIAL=1 export MOZILLA_OFFICIAL=1 diff --git a/firefox.spec b/firefox.spec index 18dda69..92efbb1 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1,6 +1,6 @@ # Produce a build suitable for release, i.e. use PGO/LTO. You can turn it off # when building locally to reduce build time. -%global release_build 0 +%global release_build 1 # Run Mozilla test suite as a part of compile rpm section. Turn off when # building locally and don't want to spend 24 hours waiting for results. @@ -171,7 +171,6 @@ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pr Source1: firefox-langpacks-%{version}%{?pre_version}-20220609.tar.xz %endif Source2: cbindgen-vendor.tar.xz -Source3: https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-16/wasi-sysroot-16.0.tar.gz Source10: firefox-mozconfig Source12: firefox-redhat-default-prefs.js Source20: firefox.desktop @@ -318,7 +317,9 @@ BuildRequires: llvm BuildRequires: llvm-devel BuildRequires: clang BuildRequires: clang-libs +%if %{build_with_clang} BuildRequires: lld +%endif BuildRequires: pipewire-devel @@ -646,10 +647,6 @@ echo "ac_add_options --with-google-safebrowsing-api-keyfile=`pwd`/google-api-key echo 'export NODEJS="%{_buildrootdir}/bin/node-stdout-nonblocking-wrapper"' >> .mozconfig -# Prepare wasi sdk: -%{__tar} xf %{SOURCE3} -echo "ac_add_options --with-wasi-sysroot=`pwd`/wasi-sysroot" >> .mozconfig - # Remove executable bit to make brp-mangle-shebangs happy. chmod -x third_party/rust/itertools/src/lib.rs chmod a-x third_party/rust/ash/src/extensions/ext/*.rs diff --git a/sources b/sources index f707e70..e75afbf 100644 --- a/sources +++ b/sources @@ -2,4 +2,3 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa3490307 SHA512 (firefox-101.0.1.source.tar.xz) = 435a7f6013582933e75c41e554a45beda30b5affd7d3ed7d2876026609ba7f17b2c20b507d9d0c9ce2379e335ec09b021257ba30ac55fabf02dca54b03ea70b4 SHA512 (firefox-langpacks-101.0.1-20220609.tar.xz) = 54c93a0fbded6a42948fd578e5577987186ca04695f9c0648718780d3a491b540187addf1239b13c53e532052888bd2ed76788a06c3a2422a060fb0da303ec58 SHA512 (cbindgen-vendor.tar.xz) = d681ca855f3779553b4a452f9dc1e3acea6253b7ef33a65948ab2d32d9848e8c06f0b3f3504ef237d6b9adb4813bdad990f7a79fa9f89333ce0d4e8da7e12d94 -SHA512 (wasi-sysroot-16.0.tar.gz) = 21aa04749273aef09523aeb4a38430d273b50276b960f9efed8466d19950124752ab4db79be1b5a54fa93d10ad4ceb7dff258f9f4cf5c7bdd59b3e9d0d7bc0a1 From ba25b2cbc30707476682bf7308c201b8f798b8db Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 28 Jun 2022 18:18:25 +0200 Subject: [PATCH 074/545] Updated to 102.0, Applied patch from https://src.fedoraproject.org/rpms/firefox/pull-request/43 --- .gitignore | 2 + D144284.diff | 77 --------- D145725.diff | 132 --------------- D146084.diff | 17 -- D146085.diff | 205 ----------------------- D146086.diff | 65 ------- D146087.diff | 19 --- D147266.diff | 31 ---- D147267.diff | 19 --- D147420.diff | 179 -------------------- D147637.diff | 80 ++++++--- D147720.diff | 73 -------- D148946.diff | 40 ++--- D149238.diff | 84 +--------- firefox.spec | 74 ++++---- mozilla-1767946-profilemanagersize.patch | 30 ---- sources | 4 +- 17 files changed, 121 insertions(+), 1010 deletions(-) delete mode 100644 D144284.diff delete mode 100644 D145725.diff delete mode 100644 D146084.diff delete mode 100644 D146085.diff delete mode 100644 D146086.diff delete mode 100644 D146087.diff delete mode 100644 D147266.diff delete mode 100644 D147267.diff delete mode 100644 D147420.diff delete mode 100644 D147720.diff delete mode 100644 mozilla-1767946-profilemanagersize.patch diff --git a/.gitignore b/.gitignore index 4ba9226..c0734c0 100644 --- a/.gitignore +++ b/.gitignore @@ -515,3 +515,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-101.0-20220530.tar.xz /firefox-101.0.1.source.tar.xz /firefox-langpacks-101.0.1-20220609.tar.xz +/firefox-102.0.source.tar.xz +/firefox-langpacks-102.0-20220628.tar.xz diff --git a/D144284.diff b/D144284.diff deleted file mode 100644 index d838254..0000000 --- a/D144284.diff +++ /dev/null @@ -1,77 +0,0 @@ -diff --git a/gfx/layers/DMABUFSurfaceImage.cpp b/gfx/layers/DMABUFSurfaceImage.cpp ---- a/gfx/layers/DMABUFSurfaceImage.cpp -+++ b/gfx/layers/DMABUFSurfaceImage.cpp -@@ -39,20 +39,20 @@ - - StaticRefPtr sSnapshotContext; - static StaticMutex sSnapshotContextMutex MOZ_UNANNOTATED; - - already_AddRefed DMABUFSurfaceImage::GetAsSourceSurface() { -+ StaticMutexAutoLock lock(sSnapshotContextMutex); - if (!sSnapshotContext) { - nsCString discardFailureId; - sSnapshotContext = GLContextProvider::CreateHeadless({}, &discardFailureId); - if (!sSnapshotContext) { - gfxCriticalError() << "Failed to create snapshot GLContext."; - return nullptr; - } - } - -- StaticMutexAutoLock lock(sSnapshotContextMutex); - sSnapshotContext->MakeCurrent(); - - auto releaseTextures = - mozilla::MakeScopeExit([&] { mSurface->ReleaseTextures(); }); - -diff --git a/widget/gtk/DMABufSurface.cpp b/widget/gtk/DMABufSurface.cpp ---- a/widget/gtk/DMABufSurface.cpp -+++ b/widget/gtk/DMABufSurface.cpp -@@ -53,24 +53,13 @@ - using namespace mozilla::layers; - - #define BUFFER_FLAGS 0 - - static RefPtr sSnapshotContext; -+static StaticMutex sSnapshotContextMutex MOZ_UNANNOTATED; - static Atomic gNewSurfaceUID(1); - --bool EnsureSnapshotGLContext() { -- if (!sSnapshotContext) { -- nsCString discardFailureId; -- sSnapshotContext = GLContextProvider::CreateHeadless({}, &discardFailureId); -- if (!sSnapshotContext) { -- NS_WARNING("Failed to create snapshot GLContext"); -- return false; -- } -- } -- return true; --} -- - bool DMABufSurface::IsGlobalRefSet() const { - if (!mGlobalRefCountFd) { - return false; - } - struct pollfd pfd; -@@ -1263,13 +1252,18 @@ - } - - bool DMABufSurfaceYUV::VerifyTextureCreation() { - LOGDMABUF(("DMABufSurfaceYUV::VerifyTextureCreation() UID %d", mUID)); - -- if (!EnsureSnapshotGLContext()) { -- LOGDMABUF((" failed to create GL context!")); -- return false; -+ StaticMutexAutoLock lock(sSnapshotContextMutex); -+ if (!sSnapshotContext) { -+ nsCString discardFailureId; -+ sSnapshotContext = GLContextProvider::CreateHeadless({}, &discardFailureId); -+ if (!sSnapshotContext) { -+ NS_WARNING("Failed to create snapshot GLContext"); -+ return false; -+ } - } - - auto release = MakeScopeExit([&] { ReleaseEGLImages(sSnapshotContext); }); - - for (int i = 0; i < mBufferPlaneCount; i++) { - diff --git a/D145725.diff b/D145725.diff deleted file mode 100644 index 1c28b10..0000000 --- a/D145725.diff +++ /dev/null @@ -1,132 +0,0 @@ -diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h ---- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h -+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h -@@ -106,10 +106,11 @@ - bool IsHardwareAccelerated(nsACString& aFailureReason) const override; - bool IsHardwareAccelerated() const { - nsAutoCString dummy; - return IsHardwareAccelerated(dummy); - } -+ void UpdateDecodeTimes(TimeStamp aDecodeStart); - - #if LIBAVCODEC_VERSION_MAJOR >= 57 && LIBAVUTIL_VERSION_MAJOR >= 56 - layers::TextureClient* AllocateTextureClientForImage( - struct AVCodecContext* aCodecContext, layers::PlanarYCbCrImage* aImage); - -@@ -142,10 +143,15 @@ - static nsTArray mAcceleratedFormats; - #endif - RefPtr mImageAllocator; - RefPtr mImageContainer; - VideoInfo mInfo; -+ int mDecodedFrames; -+#if LIBAVCODEC_VERSION_MAJOR >= 58 -+ int mDecodedFramesLate; -+#endif -+ float mAverangeDecodeTime; - - class PtsCorrectionContext { - public: - PtsCorrectionContext(); - int64_t GuessCorrectPts(int64_t aPts, int64_t aDts); -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 -@@ -383,10 +383,15 @@ - mDisplay(nullptr), - #endif - mImageAllocator(aAllocator), - mImageContainer(aImageContainer), - mInfo(aConfig), -+ mDecodedFrames(0), -+#if LIBAVCODEC_VERSION_MAJOR >= 58 -+ mDecodedFramesLate(0), -+#endif -+ mAverangeDecodeTime(0), - mLowLatency(aLowLatency) { - FFMPEG_LOG("FFmpegVideoDecoder::FFmpegVideoDecoder MIME %s Codec ID %d", - aConfig.mMimeType.get(), mCodecID); - // Use a new MediaByteBuffer as the object will be modified during - // initialization. -@@ -769,17 +774,41 @@ - #else - return aFrame->pkt_pts; - #endif - } - -+void FFmpegVideoDecoder::UpdateDecodeTimes(TimeStamp aDecodeStart) { -+ mDecodedFrames++; -+ float decodeTime = (TimeStamp::Now() - aDecodeStart).ToMilliseconds(); -+ mAverangeDecodeTime = -+ (mAverangeDecodeTime * (mDecodedFrames - 1) + decodeTime) / -+ mDecodedFrames; -+ FFMPEG_LOG(" averange frame decode time %.2f ms decoded frames %d\n", -+ mAverangeDecodeTime, mDecodedFrames); -+#if LIBAVCODEC_VERSION_MAJOR >= 58 -+ int frameDuration = mFrame->pkt_duration; -+ if (frameDuration > 0 && frameDuration / 1000.0 < decodeTime) { -+ mDecodedFramesLate++; -+ FFMPEG_LOG( -+ " slow decode: failed to decode in time, frame duration %.2f ms, " -+ "decode time %.2f\n", -+ frameDuration / 1000.0, decodeTime); -+ FFMPEG_LOG(" all decoded frames / late decoded frames %d/%d\n", -+ mDecodedFrames, mDecodedFramesLate); -+ } -+#endif -+} -+ - MediaResult FFmpegVideoDecoder::DoDecode( - MediaRawData* aSample, uint8_t* aData, int aSize, bool* aGotFrame, - MediaDataDecoder::DecodedData& aResults) { - MOZ_ASSERT(mTaskQueue->IsOnCurrentThread()); - AVPacket packet; - mLib->av_init_packet(&packet); - -+ TimeStamp decodeStart = TimeStamp::Now(); -+ - packet.data = aData; - packet.size = aSize; - packet.dts = aSample->mTimecode.ToMicroseconds(); - packet.pts = aSample->mTime.ToMicroseconds(); - packet.flags = aSample->mKeyframe ? AV_PKT_FLAG_KEY : 0; -@@ -794,11 +823,10 @@ - // at a time, and we immediately call avcodec_receive_frame right after. - FFMPEG_LOG("avcodec_send_packet error: %d", res); - return MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, - RESULT_DETAIL("avcodec_send_packet error: %d", res)); - } -- - if (aGotFrame) { - *aGotFrame = false; - } - do { - if (!PrepareFrame()) { -@@ -831,10 +859,13 @@ - FFMPEG_LOG(" avcodec_receive_frame error: %d", res); - return MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, - RESULT_DETAIL("avcodec_receive_frame error: %d", res)); - } - -+ UpdateDecodeTimes(decodeStart); -+ decodeStart = TimeStamp::Now(); -+ - MediaResult rv; - # ifdef MOZ_WAYLAND_USE_VAAPI - if (IsHardwareAccelerated()) { - rv = CreateImageVAAPI(mFrame->pkt_pos, GetFramePts(mFrame), - mFrame->pkt_duration, aResults); -@@ -898,10 +929,12 @@ - *aGotFrame = false; - } - return NS_OK; - } - -+ UpdateDecodeTimes(decodeStart); -+ - // If we've decoded a frame then we need to output it - int64_t pts = - mPtsContext.GuessCorrectPts(GetFramePts(mFrame), mFrame->pkt_dts); - // Retrieve duration from dts. - // We use the first entry found matching this dts (this is done to - diff --git a/D146084.diff b/D146084.diff deleted file mode 100644 index 8ed2c28..0000000 --- a/D146084.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/gfx/layers/ipc/LayersSurfaces.ipdlh b/gfx/layers/ipc/LayersSurfaces.ipdlh ---- a/gfx/layers/ipc/LayersSurfaces.ipdlh -+++ b/gfx/layers/ipc/LayersSurfaces.ipdlh -@@ -57,10 +57,12 @@ - uint64_t[] modifier; - uint32_t flags; - FileDescriptor[] fds; - uint32_t[] width; - uint32_t[] height; -+ uint32_t[] widthAligned; -+ uint32_t[] heightAligned; - uint32_t[] format; - uint32_t[] strides; - uint32_t[] offsets; - YUVColorSpace yUVColorSpace; - ColorRange colorRange; - diff --git a/D146085.diff b/D146085.diff deleted file mode 100644 index 6b037f6..0000000 --- a/D146085.diff +++ /dev/null @@ -1,205 +0,0 @@ -diff --git a/widget/gtk/DMABufSurface.h b/widget/gtk/DMABufSurface.h ---- a/widget/gtk/DMABufSurface.h -+++ b/widget/gtk/DMABufSurface.h -@@ -275,11 +275,11 @@ - static already_AddRefed CreateYUVSurface( - int aWidth, int aHeight, void** aPixelData = nullptr, - int* aLineSizes = nullptr); - - static already_AddRefed CreateYUVSurface( -- const VADRMPRIMESurfaceDescriptor& aDesc); -+ const VADRMPRIMESurfaceDescriptor& aDesc, int aWidth, int aHeight); - - bool Serialize(mozilla::layers::SurfaceDescriptor& aOutDescriptor); - - DMABufSurfaceYUV* GetAsDMABufSurfaceYUV() { return this; }; - -@@ -304,11 +304,12 @@ - mozilla::gfx::YUVColorSpace GetYUVColorSpace() { return mColorSpace; } - - DMABufSurfaceYUV(); - - bool UpdateYUVData(void** aPixelData, int* aLineSizes); -- bool UpdateYUVData(const VADRMPRIMESurfaceDescriptor& aDesc); -+ bool UpdateYUVData(const VADRMPRIMESurfaceDescriptor& aDesc, int aWidth, -+ int aHeight); - - bool VerifyTextureCreation(); - - private: - ~DMABufSurfaceYUV(); -@@ -329,10 +330,15 @@ - bool CreateEGLImage(mozilla::gl::GLContext* aGLContext, int aPlane); - void ReleaseEGLImages(mozilla::gl::GLContext* aGLContext); - - int mWidth[DMABUF_BUFFER_PLANES]; - int mHeight[DMABUF_BUFFER_PLANES]; -+ // Aligned size of the surface imported from VADRMPRIMESurfaceDescriptor. -+ // It's used only internally to create EGLImage as some GL drivers -+ // needs that (Bug 1724385). -+ int mWidthAligned[DMABUF_BUFFER_PLANES]; -+ int mHeightAligned[DMABUF_BUFFER_PLANES]; - EGLImageKHR mEGLImage[DMABUF_BUFFER_PLANES]; - GLuint mTexture[DMABUF_BUFFER_PLANES]; - mozilla::gfx::YUVColorSpace mColorSpace = - mozilla::gfx::YUVColorSpace::Default; - }; -diff --git a/widget/gtk/DMABufSurface.cpp b/widget/gtk/DMABufSurface.cpp ---- a/widget/gtk/DMABufSurface.cpp -+++ b/widget/gtk/DMABufSurface.cpp -@@ -479,13 +479,13 @@ - if (mGlobalRefCountFd) { - refCountFDs.AppendElement(ipc::FileDescriptor(mGlobalRefCountFd)); - } - - aOutDescriptor = SurfaceDescriptorDMABuf( -- mSurfaceType, modifiers, mGbmBufferFlags, fds, width, height, format, -- strides, offsets, GetYUVColorSpace(), mColorRange, fenceFDs, mUID, -- refCountFDs); -+ mSurfaceType, modifiers, mGbmBufferFlags, fds, width, height, width, -+ height, format, strides, offsets, GetYUVColorSpace(), mColorRange, -+ fenceFDs, mUID, refCountFDs); - return true; - } - - bool DMABufSurfaceRGBA::CreateTexture(GLContext* aGLContext, int aPlane) { - MOZ_ASSERT(!mEGLImage && !mTexture, "EGLImage is already created!"); -@@ -807,15 +807,15 @@ - } - return surf.forget(); - } - - already_AddRefed DMABufSurfaceYUV::CreateYUVSurface( -- const VADRMPRIMESurfaceDescriptor& aDesc) { -+ const VADRMPRIMESurfaceDescriptor& aDesc, int aWidth, int aHeight) { - RefPtr surf = new DMABufSurfaceYUV(); - LOGDMABUF(("DMABufSurfaceYUV::CreateYUVSurface() UID %d from desc\n", - surf->GetUID())); -- if (!surf->UpdateYUVData(aDesc)) { -+ if (!surf->UpdateYUVData(aDesc, aWidth, aHeight)) { - return nullptr; - } - return surf.forget(); - } - -@@ -829,11 +829,16 @@ - } - return surf.forget(); - } - - DMABufSurfaceYUV::DMABufSurfaceYUV() -- : DMABufSurface(SURFACE_NV12), mWidth(), mHeight(), mTexture() { -+ : DMABufSurface(SURFACE_NV12), -+ mWidth(), -+ mHeight(), -+ mWidthAligned(), -+ mHeightAligned(), -+ mTexture() { - for (int i = 0; i < DMABUF_BUFFER_PLANES; i++) { - mEGLImage[i] = LOCAL_EGL_NO_IMAGE; - } - } - -@@ -870,11 +875,12 @@ - close(mDmabufFds[aPlane]); - mDmabufFds[aPlane] = -1; - } - } - --bool DMABufSurfaceYUV::UpdateYUVData(const VADRMPRIMESurfaceDescriptor& aDesc) { -+bool DMABufSurfaceYUV::UpdateYUVData(const VADRMPRIMESurfaceDescriptor& aDesc, -+ int aWidth, int aHeight) { - if (aDesc.num_layers > DMABUF_BUFFER_PLANES || - aDesc.num_objects > DMABUF_BUFFER_PLANES) { - return false; - } - -@@ -907,12 +913,14 @@ - - mBufferModifiers[i] = aDesc.objects[object].drm_format_modifier; - mDrmFormats[i] = aDesc.layers[i].drm_format; - mOffsets[i] = aDesc.layers[i].offset[0]; - mStrides[i] = aDesc.layers[i].pitch[0]; -- mWidth[i] = aDesc.width >> i; -- mHeight[i] = aDesc.height >> i; -+ mWidthAligned[i] = aDesc.width >> i; -+ mHeightAligned[i] = aDesc.height >> i; -+ mWidth[i] = aWidth >> i; -+ mHeight[i] = aHeight >> i; - - LOGDMABUF((" plane %d size %d x %d format %x", i, mWidth[i], mHeight[i], - mDrmFormats[i])); - } - -@@ -1044,10 +1052,12 @@ - strerror(errno))); - return false; - } - mWidth[i] = aDesc.width()[i]; - mHeight[i] = aDesc.height()[i]; -+ mWidthAligned[i] = aDesc.widthAligned()[i]; -+ mHeightAligned[i] = aDesc.heightAligned()[i]; - mDrmFormats[i] = aDesc.format()[i]; - mStrides[i] = aDesc.strides()[i]; - mOffsets[i] = aDesc.offsets()[i]; - mBufferModifiers[i] = aDesc.modifier()[i]; - LOGDMABUF((" plane %d fd %d size %d x %d format %x", i, mDmabufFds[i], -@@ -1072,10 +1082,12 @@ - - bool DMABufSurfaceYUV::Serialize( - mozilla::layers::SurfaceDescriptor& aOutDescriptor) { - AutoTArray width; - AutoTArray height; -+ AutoTArray widthBytes; -+ AutoTArray heightBytes; - AutoTArray format; - AutoTArray fds; - AutoTArray strides; - AutoTArray offsets; - AutoTArray modifiers; -@@ -1090,10 +1102,12 @@ - } - - for (int i = 0; i < mBufferPlaneCount; i++) { - width.AppendElement(mWidth[i]); - height.AppendElement(mHeight[i]); -+ widthBytes.AppendElement(mWidthAligned[i]); -+ heightBytes.AppendElement(mHeightAligned[i]); - format.AppendElement(mDrmFormats[i]); - fds.AppendElement(ipc::FileDescriptor(mDmabufFds[i])); - strides.AppendElement(mStrides[i]); - offsets.AppendElement(mOffsets[i]); - modifiers.AppendElement(mBufferModifiers[i]); -@@ -1108,12 +1122,13 @@ - if (mGlobalRefCountFd) { - refCountFDs.AppendElement(ipc::FileDescriptor(mGlobalRefCountFd)); - } - - aOutDescriptor = SurfaceDescriptorDMABuf( -- mSurfaceType, modifiers, 0, fds, width, height, format, strides, offsets, -- GetYUVColorSpace(), mColorRange, fenceFDs, mUID, refCountFDs); -+ mSurfaceType, modifiers, 0, fds, width, height, widthBytes, heightBytes, -+ format, strides, offsets, GetYUVColorSpace(), mColorRange, fenceFDs, mUID, -+ refCountFDs); - return true; - } - - bool DMABufSurfaceYUV::CreateEGLImage(GLContext* aGLContext, int aPlane) { - LOGDMABUF( -@@ -1131,13 +1146,13 @@ - return false; - } - - nsTArray attribs; - attribs.AppendElement(LOCAL_EGL_WIDTH); -- attribs.AppendElement(mWidth[aPlane]); -+ attribs.AppendElement(mWidthAligned[aPlane]); - attribs.AppendElement(LOCAL_EGL_HEIGHT); -- attribs.AppendElement(mHeight[aPlane]); -+ attribs.AppendElement(mHeightAligned[aPlane]); - attribs.AppendElement(LOCAL_EGL_LINUX_DRM_FOURCC_EXT); - attribs.AppendElement(mDrmFormats[aPlane]); - #define ADD_PLANE_ATTRIBS_NV12(plane_idx) \ - attribs.AppendElement(LOCAL_EGL_DMA_BUF_PLANE##plane_idx##_FD_EXT); \ - attribs.AppendElement(mDmabufFds[aPlane]); \ - diff --git a/D146086.diff b/D146086.diff deleted file mode 100644 index c6790ad..0000000 --- a/D146086.diff +++ /dev/null @@ -1,65 +0,0 @@ -diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h b/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h ---- a/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h -+++ b/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h -@@ -112,12 +112,13 @@ - public: - VideoFramePool(); - ~VideoFramePool(); - - RefPtr> GetVideoFrameSurface( -- VADRMPRIMESurfaceDescriptor& aVaDesc, AVCodecContext* aAVCodecContext, -- AVFrame* aAVFrame, FFmpegLibWrapper* aLib); -+ VADRMPRIMESurfaceDescriptor& aVaDesc, int aWidth, int aHeight, -+ AVCodecContext* aAVCodecContext, AVFrame* aAVFrame, -+ FFmpegLibWrapper* aLib); - void ReleaseUnusedVAAPIFrames(); - - private: - RefPtr> GetFreeVideoFrameSurface(); - -diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp b/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp ---- a/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp -+++ b/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp -@@ -111,12 +111,13 @@ - return nullptr; - } - - RefPtr> - VideoFramePool::GetVideoFrameSurface( -- VADRMPRIMESurfaceDescriptor& aVaDesc, AVCodecContext* aAVCodecContext, -- AVFrame* aAVFrame, FFmpegLibWrapper* aLib) { -+ VADRMPRIMESurfaceDescriptor& aVaDesc, int aWidth, int aHeight, -+ AVCodecContext* aAVCodecContext, AVFrame* aAVFrame, -+ FFmpegLibWrapper* aLib) { - if (aVaDesc.fourcc != VA_FOURCC_NV12 && aVaDesc.fourcc != VA_FOURCC_YV12 && - aVaDesc.fourcc != VA_FOURCC_P010) { - FFMPEG_LOG("Unsupported VA-API surface format %d", aVaDesc.fourcc); - return nullptr; - } -@@ -124,11 +125,11 @@ - MutexAutoLock lock(mSurfaceLock); - RefPtr> videoSurface = - GetFreeVideoFrameSurface(); - if (!videoSurface) { - RefPtr surface = -- DMABufSurfaceYUV::CreateYUVSurface(aVaDesc); -+ DMABufSurfaceYUV::CreateYUVSurface(aVaDesc, aWidth, aHeight); - if (!surface) { - return nullptr; - } - FFMPEG_LOG("Created new VA-API DMABufSurface UID = %d", surface->GetUID()); - RefPtr> surf = -@@ -142,11 +143,11 @@ - } - videoSurface = surf; - mDMABufSurfaces.AppendElement(std::move(surf)); - } else { - RefPtr surface = videoSurface->GetDMABufSurface(); -- if (!surface->UpdateYUVData(aVaDesc)) { -+ if (!surface->UpdateYUVData(aVaDesc, aWidth, aHeight)) { - return nullptr; - } - FFMPEG_LOG("Reusing VA-API DMABufSurface UID = %d", surface->GetUID()); - } - videoSurface->LockVAAPIData(aAVCodecContext, aAVFrame, aLib); - diff --git a/D146087.diff b/D146087.diff deleted file mode 100644 index d5dcf9d..0000000 --- a/D146087.diff +++ /dev/null @@ -1,19 +0,0 @@ -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 -@@ -1164,12 +1164,12 @@ - NS_ERROR_DOM_MEDIA_DECODE_ERR, - RESULT_DETAIL("Unable to get frame by vaExportSurfaceHandle()")); - } - - MOZ_ASSERT(mTaskQueue->IsOnCurrentThread()); -- auto surface = mVideoFramePool->GetVideoFrameSurface(vaDesc, mCodecContext, -- mFrame, mLib); -+ auto surface = mVideoFramePool->GetVideoFrameSurface( -+ vaDesc, mFrame->width, mFrame->height, mCodecContext, mFrame, mLib); - if (!surface) { - return MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, - RESULT_DETAIL("VAAPI dmabuf allocation error")); - } - surface->SetYUVColorSpace(GetFrameColorSpace()); - diff --git a/D147266.diff b/D147266.diff deleted file mode 100644 index 5f8a580..0000000 --- a/D147266.diff +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp ---- a/widget/gtk/nsWindow.cpp -+++ b/widget/gtk/nsWindow.cpp -@@ -1430,20 +1430,20 @@ - } - #endif - if (popup->mPopupContextMenu && !popup->mPopupAnchored) { - LOG(" popup [%p] is first context menu", popup); - popup->mRelativePopupPosition = popup->mPopupPosition; -- } else if (popup->mPopupAnchored) { -- LOG(" popup [%p] is anchored", popup); -- if (!popup->mPopupMatchesLayout) { -- NS_WARNING("Anchored popup does not match layout!"); -- } -- popup->mRelativePopupPosition = popup->mPopupPosition; - } else if (popup->mWaylandPopupPrev->mWaylandToplevel == nullptr) { - LOG(" popup [%p] has toplevel as parent", popup); - popup->mRelativePopupPosition = popup->mPopupPosition; - } else { -+ if (popup->mPopupAnchored) { -+ LOG(" popup [%p] is anchored", popup); -+ if (!popup->mPopupMatchesLayout) { -+ NS_WARNING("Anchored popup does not match layout!"); -+ } -+ } - GdkPoint parent = WaylandGetParentPosition(); - - LOG(" popup [%p] uses transformed coordinates\n", popup); - LOG(" parent position [%d, %d]\n", parent.x, parent.y); - LOG(" popup position [%d, %d]\n", popup->mPopupPosition.x, - diff --git a/D147267.diff b/D147267.diff deleted file mode 100644 index 1191b85..0000000 --- a/D147267.diff +++ /dev/null @@ -1,19 +0,0 @@ -diff -up firefox-100.0.2/widget/gtk/nsWindow.cpp.D147267 firefox-100.0.2/widget/gtk/nsWindow.cpp ---- firefox-100.0.2/widget/gtk/nsWindow.cpp.D147267 2022-05-25 11:46:48.291005415 +0200 -+++ firefox-100.0.2/widget/gtk/nsWindow.cpp 2022-05-25 11:50:11.447736538 +0200 -@@ -2359,11 +2359,12 @@ void nsWindow::WaylandPopupMove() { - LOG(" popup use move to rect %d\n", mPopupUseMoveToRect); - - if (!mPopupUseMoveToRect) { -- if (mNeedsShow && mPopupType != ePopupTypeTooltip) { -+ if (mPopupHint == ePopupTypeMenu) { - // Workaround for https://gitlab.gnome.org/GNOME/gtk/-/issues/4308 -- // Tooltips are created as subsurfaces with relative position. -+ // Tooltips/Utility popus are created as subsurfaces with relative position. -+ // Menu uses absolute positions. - LOG(" use gtk_window_move(%d, %d) for hidden widget\n", mPopupPosition.x, -- mPopupPosition.y); -+ mPopupPosition.y); - gtk_window_move(GTK_WINDOW(mShell), mPopupPosition.x, mPopupPosition.y); - } else { - LOG(" use gtk_window_move(%d, %d) for visible widget\n", diff --git a/D147420.diff b/D147420.diff deleted file mode 100644 index 1ee3af1..0000000 --- a/D147420.diff +++ /dev/null @@ -1,179 +0,0 @@ -diff -up firefox-101.0/gfx/gl/GLContextEGL.h.D147420.diff firefox-101.0/gfx/gl/GLContextEGL.h ---- firefox-101.0/gfx/gl/GLContextEGL.h.D147420.diff 2022-05-27 01:16:54.000000000 +0200 -+++ firefox-101.0/gfx/gl/GLContextEGL.h 2022-06-07 09:01:17.487787806 +0200 -@@ -106,6 +106,9 @@ class GLContextEGL final : public GLCont - static RefPtr CreateEGLPBufferOffscreenContextImpl( - std::shared_ptr, const GLContextCreateDesc&, - const gfx::IntSize& size, bool aUseGles, nsACString* const out_FailureId); -+ static RefPtr CreateEGLSurfacelessContext( -+ const std::shared_ptr display, -+ const GLContextCreateDesc& desc, nsACString* const out_failureId); - - static EGLSurface CreateEGLSurfaceForCompositorWidget( - widget::CompositorWidget* aCompositorWidget, const EGLConfig aConfig); -diff -up firefox-101.0/gfx/gl/GLContextProviderEGL.cpp.D147420.diff firefox-101.0/gfx/gl/GLContextProviderEGL.cpp ---- firefox-101.0/gfx/gl/GLContextProviderEGL.cpp.D147420.diff 2022-05-27 01:16:54.000000000 +0200 -+++ firefox-101.0/gfx/gl/GLContextProviderEGL.cpp 2022-06-07 09:01:17.487787806 +0200 -@@ -1190,16 +1190,42 @@ RefPtr GLContextEGL::Creat - } - - /*static*/ -+RefPtr GLContextEGL::CreateEGLSurfacelessContext( -+ const std::shared_ptr display, const GLContextCreateDesc& desc, -+ nsACString* const out_failureId) { -+ const EGLConfig config = {}; -+ auto fullDesc = GLContextDesc{desc}; -+ fullDesc.isOffscreen = true; -+ RefPtr 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 GLContextProviderEGL::CreateHeadless( - const GLContextCreateDesc& desc, nsACString* const out_failureId) { - const auto display = DefaultEglDisplay(out_failureId); - if (!display) { - return nullptr; - } -- mozilla::gfx::IntSize dummySize = mozilla::gfx::IntSize(16, 16); -- auto ret = GLContextEGL::CreateEGLPBufferOffscreenContext( -- display, desc, dummySize, out_failureId); -- return ret.forget(); -+ RefPtr 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(); - } - - // Don't want a global context on Android as 1) share groups across 2 threads -diff -up firefox-101.0/gfx/gl/GLDefs.h.D147420.diff firefox-101.0/gfx/gl/GLDefs.h ---- firefox-101.0/gfx/gl/GLDefs.h.D147420.diff 2022-05-27 01:16:54.000000000 +0200 -+++ firefox-101.0/gfx/gl/GLDefs.h 2022-06-07 09:01:17.487787806 +0200 -@@ -104,6 +104,9 @@ 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-101.0/gfx/gl/GLLibraryEGL.cpp.D147420.diff firefox-101.0/gfx/gl/GLLibraryEGL.cpp ---- firefox-101.0/gfx/gl/GLLibraryEGL.cpp.D147420.diff 2022-05-27 01:16:54.000000000 +0200 -+++ firefox-101.0/gfx/gl/GLLibraryEGL.cpp 2022-06-07 09:03:04.077349997 +0200 -@@ -82,7 +82,8 @@ static const char* sEGLExtensionNames[] - "EGL_KHR_swap_buffers_with_damage", - "EGL_EXT_buffer_age", - "EGL_KHR_partial_update", -- "EGL_NV_robustness_video_memory_purge"}; -+ "EGL_NV_robustness_video_memory_purge", -+ "EGL_MESA_platform_surfaceless"}; - - PRLibrary* LoadApitraceLibrary() { - const char* path = nullptr; -@@ -151,6 +152,19 @@ static std::shared_ptr GetAn - return EglDisplay::Create(egl, display, false, aProofOfLock); - } - -+#ifdef MOZ_WAYLAND -+static std::shared_ptr GetAndInitSurfacelessDisplay( -+ GLLibraryEGL& egl, const StaticMutexAutoLock& aProofOfLock) { -+ const EGLAttrib attrib_list[] = {LOCAL_EGL_NONE}; -+ const EGLDisplay display = egl.fGetPlatformDisplay( -+ LOCAL_EGL_PLATFORM_SURFACELESS_MESA, EGL_DEFAULT_DISPLAY, attrib_list); -+ if (display == EGL_NO_DISPLAY) { -+ return nullptr; -+ } -+ return EglDisplay::Create(egl, display, true, aProofOfLock); -+} -+#endif -+ - static std::shared_ptr GetAndInitWARPDisplay( - GLLibraryEGL& egl, void* displayType, - const StaticMutexAutoLock& aProofOfLock) { -@@ -629,6 +643,11 @@ bool GLLibraryEGL::Init(nsACString* cons - END_OF_SYMBOLS}; - (void)fnLoadSymbols(symbols); - } -+ { -+ const SymLoadStruct symbols[] = {SYMBOL(GetPlatformDisplay), -+ END_OF_SYMBOLS}; -+ (void)fnLoadSymbols(symbols); -+ } - - return true; - } -@@ -806,7 +825,9 @@ std::shared_ptr GLLibraryEGL - #ifdef MOZ_WAYLAND - // Some drivers doesn't support EGL_DEFAULT_DISPLAY - GdkDisplay* gdkDisplay = gdk_display_get_default(); -- if (widget::GdkIsWaylandDisplay(gdkDisplay)) { -+ if (!gdkDisplay) { -+ ret = GetAndInitSurfacelessDisplay(*this, aProofOfLock); -+ } else if (widget::GdkIsWaylandDisplay(gdkDisplay)) { - nativeDisplay = widget::WaylandDisplayGetWLDisplay(gdkDisplay); - if (!nativeDisplay) { - NS_WARNING("Failed to get wl_display."); -@@ -814,7 +835,9 @@ std::shared_ptr GLLibraryEGL - } - } - #endif -- ret = GetAndInitDisplay(*this, nativeDisplay, aProofOfLock); -+ if (!ret) { -+ ret = GetAndInitDisplay(*this, nativeDisplay, aProofOfLock); -+ } - } - - if (!ret) { -diff -up firefox-101.0/gfx/gl/GLLibraryEGL.h.D147420.diff firefox-101.0/gfx/gl/GLLibraryEGL.h ---- firefox-101.0/gfx/gl/GLLibraryEGL.h.D147420.diff 2022-05-27 01:16:54.000000000 +0200 -+++ firefox-101.0/gfx/gl/GLLibraryEGL.h 2022-06-07 09:01:17.487787806 +0200 -@@ -107,6 +107,7 @@ enum class EGLExtension { - EXT_buffer_age, - KHR_partial_update, - NV_robustness_video_memory_purge, -+ MESA_platform_surfaceless, - Max - }; - -diff -up firefox-101.0/widget/gtk/DMABufSurface.cpp.D147420.diff firefox-101.0/widget/gtk/DMABufSurface.cpp ---- firefox-101.0/widget/gtk/DMABufSurface.cpp.D147420.diff 2022-06-07 09:01:17.486787773 +0200 -+++ firefox-101.0/widget/gtk/DMABufSurface.cpp 2022-06-07 09:01:17.487787806 +0200 -@@ -1259,7 +1259,7 @@ bool DMABufSurfaceYUV::VerifyTextureCrea - nsCString discardFailureId; - sSnapshotContext = GLContextProvider::CreateHeadless({}, &discardFailureId); - if (!sSnapshotContext) { -- NS_WARNING("Failed to create snapshot GLContext"); -+ LOGDMABUF((" failed to create snapshot GLContext")); - return false; - } - } -@@ -1268,10 +1268,12 @@ bool DMABufSurfaceYUV::VerifyTextureCrea - - for (int i = 0; i < mBufferPlaneCount; i++) { - if (!CreateEGLImage(sSnapshotContext, i)) { -+ LOGDMABUF((" failed to create EGL image!")); - return false; - } - } - -+ LOGDMABUF((" success")); - return true; - } - diff --git a/D147637.diff b/D147637.diff index 0a84b25..89bb25e 100644 --- a/D147637.diff +++ b/D147637.diff @@ -1,7 +1,11 @@ -diff -up firefox-101.0/gfx/gl/SharedSurfaceDMABUF.cpp.D147637.diff firefox-101.0/gfx/gl/SharedSurfaceDMABUF.cpp ---- firefox-101.0/gfx/gl/SharedSurfaceDMABUF.cpp.D147637.diff 2022-05-27 01:16:54.000000000 +0200 -+++ firefox-101.0/gfx/gl/SharedSurfaceDMABUF.cpp 2022-06-07 09:37:29.361992695 +0200 -@@ -12,22 +12,37 @@ +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 { @@ -21,33 +25,54 @@ diff -up firefox-101.0/gfx/gl/SharedSurfaceDMABUF.cpp.D147637.diff firefox-101.0 - const RefPtr 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); + -+ if (!HasDmaBufExtensions(gle)) { - return nullptr; ++ RefPtr surface; ++ UniquePtr 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( ++ 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(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); -+ auto fb = MozFramebuffer::Create(desc.gl, desc.size, 0, false); - if (!fb) return nullptr; - -+ const auto buffer = reinterpret_cast(fb->ColorTex()); -+ const auto image = -+ egl.fCreateImage(context, LOCAL_EGL_GL_TEXTURE_2D, buffer, nullptr); -+ if (!image) return nullptr; -+ -+ const RefPtr surface = DMABufSurfaceRGBA::CreateDMABufSurface( -+ desc.gl, image, desc.size.width, desc.size.height); -+ if (!surface) return nullptr; -+ +- if (!fb) return nullptr; +- return AsUnique(new SharedSurface_DMABUF(desc, std::move(fb), surface)); } -@@ -61,7 +76,7 @@ UniquePtr Surface +@@ -61,7 +94,7 @@ UniquePtr Surface } auto dmabufFactory = MakeUnique(gl); @@ -56,13 +81,13 @@ diff -up firefox-101.0/gfx/gl/SharedSurfaceDMABUF.cpp.D147637.diff firefox-101.0 return dmabufFactory; } -@@ -71,8 +86,38 @@ UniquePtr Surface +@@ -71,8 +104,38 @@ UniquePtr Surface return nullptr; } +bool SurfaceFactory_DMABUF::CanCreateSurface(GLContext& gl) { + UniquePtr test = -+ CreateShared(gfx::IntSize(1, 1)); ++ CreateShared(gfx::IntSize(1, 1), gfx::ColorSpace2::SRGB); + if (!test) { + LOGDMABUF(( + "SurfaceFactory_DMABUF::CanCreateSurface() failed to create surface.")); @@ -96,15 +121,16 @@ diff -up firefox-101.0/gfx/gl/SharedSurfaceDMABUF.cpp.D147637.diff firefox-101.0 layers::TextureType::DMABUF, true}) {} - } // namespace mozilla::gl -diff -up firefox-101.0/gfx/gl/SharedSurfaceDMABUF.h.D147637.diff firefox-101.0/gfx/gl/SharedSurfaceDMABUF.h ---- firefox-101.0/gfx/gl/SharedSurfaceDMABUF.h.D147637.diff 2022-06-07 09:31:23.678228010 +0200 -+++ firefox-101.0/gfx/gl/SharedSurfaceDMABUF.h 2022-06-07 09:36:39.691512555 +0200 -@@ -59,10 +59,7 @@ class SurfaceFactory_DMABUF : public Sur +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 test = CreateShared(gfx::IntSize(1, 1)); +- UniquePtr test = +- CreateShared(gfx::IntSize(1, 1), gfx::ColorSpace2::SRGB); - return test != nullptr; - } + bool CanCreateSurface(GLContext& gl); diff --git a/D147720.diff b/D147720.diff deleted file mode 100644 index 9287f44..0000000 --- a/D147720.diff +++ /dev/null @@ -1,73 +0,0 @@ -diff --git a/widget/gtk/DMABufSurface.h b/widget/gtk/DMABufSurface.h ---- a/widget/gtk/DMABufSurface.h -+++ b/widget/gtk/DMABufSurface.h -@@ -146,11 +146,16 @@ - DMABufSurface(SurfaceType aSurfaceType); - - protected: - virtual bool Create(const mozilla::layers::SurfaceDescriptor& aDesc) = 0; - -+ // Import global ref count from IPC by file descriptor. - void GlobalRefCountImport(int aFd); -+ // Export global ref count by file descriptor. This adds global ref count -+ // reference to the surface. -+ // It's used when dmabuf surface is shared with another process via. IPC. -+ int GlobalRefCountExport(); - void GlobalRefCountDelete(); - - void ReleaseDMABuf(); - - void* MapInternal(uint32_t aX, uint32_t aY, uint32_t aWidth, uint32_t aHeight, -diff --git a/widget/gtk/DMABufSurface.cpp b/widget/gtk/DMABufSurface.cpp ---- a/widget/gtk/DMABufSurface.cpp -+++ b/widget/gtk/DMABufSurface.cpp -@@ -105,11 +105,21 @@ - } - - void DMABufSurface::GlobalRefCountImport(int aFd) { - MOZ_ASSERT(!mGlobalRefCountFd); - mGlobalRefCountFd = aFd; -- GlobalRefAdd(); -+ MOZ_DIAGNOSTIC_ASSERT(IsGlobalRefSet(), -+ "We're importing unreferenced surface!"); -+} -+ -+int DMABufSurface::GlobalRefCountExport() { -+ if (mGlobalRefCountFd) { -+ MOZ_DIAGNOSTIC_ASSERT(IsGlobalRefSet(), -+ "We're exporting unreferenced surface!"); -+ GlobalRefAdd(); -+ } -+ return mGlobalRefCountFd; - } - - void DMABufSurface::GlobalRefCountDelete() { - if (mGlobalRefCountFd) { - GlobalRefRelease(); -@@ -475,11 +485,11 @@ - if (mSync) { - fenceFDs.AppendElement(ipc::FileDescriptor(mSyncFd)); - } - - if (mGlobalRefCountFd) { -- refCountFDs.AppendElement(ipc::FileDescriptor(mGlobalRefCountFd)); -+ refCountFDs.AppendElement(ipc::FileDescriptor(GlobalRefCountExport())); - } - - aOutDescriptor = SurfaceDescriptorDMABuf( - mSurfaceType, modifiers, mGbmBufferFlags, fds, width, height, width, - height, format, strides, offsets, GetYUVColorSpace(), mColorRange, -@@ -1118,11 +1128,11 @@ - if (mSync) { - fenceFDs.AppendElement(ipc::FileDescriptor(mSyncFd)); - } - - if (mGlobalRefCountFd) { -- refCountFDs.AppendElement(ipc::FileDescriptor(mGlobalRefCountFd)); -+ refCountFDs.AppendElement(ipc::FileDescriptor(GlobalRefCountExport())); - } - - aOutDescriptor = SurfaceDescriptorDMABuf( - mSurfaceType, modifiers, 0, fds, width, height, widthBytes, heightBytes, - format, strides, offsets, GetYUVColorSpace(), mColorRange, fenceFDs, mUID, - diff --git a/D148946.diff b/D148946.diff index e4d9aa4..0ab7380 100644 --- a/D148946.diff +++ b/D148946.diff @@ -1,7 +1,7 @@ -diff -up firefox-101.0.1/gfx/gl/GLContextProviderEGL.cpp.D148946.diff firefox-101.0.1/gfx/gl/GLContextProviderEGL.cpp ---- firefox-101.0.1/gfx/gl/GLContextProviderEGL.cpp.D148946.diff 2022-06-14 14:25:07.290229683 +0200 -+++ firefox-101.0.1/gfx/gl/GLContextProviderEGL.cpp 2022-06-14 14:25:07.313230450 +0200 -@@ -1190,42 +1190,16 @@ RefPtr GLContextEGL::Creat +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::Creat } /*static*/ @@ -48,9 +48,9 @@ diff -up firefox-101.0.1/gfx/gl/GLContextProviderEGL.cpp.D148946.diff firefox-10 } // Don't want a global context on Android as 1) share groups across 2 threads -diff -up firefox-101.0.1/gfx/gl/GLDefs.h.D148946.diff firefox-101.0.1/gfx/gl/GLDefs.h ---- firefox-101.0.1/gfx/gl/GLDefs.h.D148946.diff 2022-06-14 14:25:07.290229683 +0200 -+++ firefox-101.0.1/gfx/gl/GLDefs.h 2022-06-14 14:25:07.313230450 +0200 +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 @@ -61,10 +61,10 @@ diff -up firefox-101.0.1/gfx/gl/GLDefs.h.D148946.diff firefox-101.0.1/gfx/gl/GLD // clang-format on #endif -diff -up firefox-101.0.1/gfx/gl/GLLibraryEGL.cpp.D148946.diff firefox-101.0.1/gfx/gl/GLLibraryEGL.cpp ---- firefox-101.0.1/gfx/gl/GLLibraryEGL.cpp.D148946.diff 2022-06-14 14:25:07.307230250 +0200 -+++ firefox-101.0.1/gfx/gl/GLLibraryEGL.cpp 2022-06-14 14:27:03.477110994 +0200 -@@ -53,9 +53,15 @@ StaticRefPtr GLLibraryEGL: +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: // should match the order of EGLExtensions, and be null-terminated. static const char* sEGLLibraryExtensionNames[] = { @@ -83,7 +83,7 @@ diff -up firefox-101.0.1/gfx/gl/GLLibraryEGL.cpp.D148946.diff firefox-101.0.1/gf // should match the order of EGLExtensions, and be null-terminated. static const char* sEGLExtensionNames[] = { -@@ -83,7 +89,6 @@ 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", @@ -91,7 +91,7 @@ diff -up firefox-101.0.1/gfx/gl/GLLibraryEGL.cpp.D148946.diff firefox-101.0.1/gf "EGL_EXT_image_dma_buf_import", "EGL_EXT_image_dma_buf_import_modifiers", "EGL_MESA_image_dma_buf_export"}; -@@ -156,8 +161,52 @@ static std::shared_ptr GetAn +@@ -157,8 +162,52 @@ static std::shared_ptr GetAn } #ifdef MOZ_WAYLAND @@ -144,7 +144,7 @@ diff -up firefox-101.0.1/gfx/gl/GLLibraryEGL.cpp.D148946.diff firefox-101.0.1/gf const EGLAttrib attrib_list[] = {LOCAL_EGL_NONE}; const EGLDisplay display = egl.fGetPlatformDisplay( LOCAL_EGL_PLATFORM_SURFACELESS_MESA, EGL_DEFAULT_DISPLAY, attrib_list); -@@ -610,9 +659,9 @@ bool GLLibraryEGL::Init(nsACString* cons +@@ -611,9 +660,9 @@ bool GLLibraryEGL::Init(nsACString* cons (void)fnLoadSymbols(symbols); } { @@ -157,7 +157,7 @@ diff -up firefox-101.0.1/gfx/gl/GLLibraryEGL.cpp.D148946.diff firefox-101.0.1/gf (void)fnLoadSymbols(symbols); } { -@@ -657,6 +706,10 @@ bool GLLibraryEGL::Init(nsACString* cons +@@ -658,6 +707,10 @@ bool GLLibraryEGL::Init(nsACString* cons END_OF_SYMBOLS}; (void)fnLoadSymbols(symbols); } @@ -169,7 +169,7 @@ diff -up firefox-101.0.1/gfx/gl/GLLibraryEGL.cpp.D148946.diff firefox-101.0.1/gf return true; } @@ -835,7 +888,10 @@ std::shared_ptr GLLibraryEGL - // Some drivers doesn't support EGL_DEFAULT_DISPLAY + #ifdef MOZ_WAYLAND GdkDisplay* gdkDisplay = gdk_display_get_default(); if (!gdkDisplay) { - ret = GetAndInitSurfacelessDisplay(*this, aProofOfLock); @@ -178,11 +178,11 @@ diff -up firefox-101.0.1/gfx/gl/GLLibraryEGL.cpp.D148946.diff firefox-101.0.1/gf + ret = GetAndInitSurfacelessDisplay(*this, aProofOfLock); + } } else if (widget::GdkIsWaylandDisplay(gdkDisplay)) { + // Wayland does not support EGL_DEFAULT_DISPLAY nativeDisplay = widget::WaylandDisplayGetWLDisplay(gdkDisplay); - if (!nativeDisplay) { -diff -up firefox-101.0.1/gfx/gl/GLLibraryEGL.h.D148946.diff firefox-101.0.1/gfx/gl/GLLibraryEGL.h ---- firefox-101.0.1/gfx/gl/GLLibraryEGL.h.D148946.diff 2022-06-14 14:25:07.307230250 +0200 -+++ firefox-101.0.1/gfx/gl/GLLibraryEGL.h 2022-06-14 14:25:07.313230450 +0200 +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, diff --git a/D149238.diff b/D149238.diff index 290c536..e89c1bf 100644 --- a/D149238.diff +++ b/D149238.diff @@ -1,86 +1,20 @@ -diff -up firefox-101.0.1/gfx/config/gfxVars.h.D149238.diff firefox-101.0.1/gfx/config/gfxVars.h ---- firefox-101.0.1/gfx/config/gfxVars.h.D149238.diff 2022-06-14 14:28:15.301514131 +0200 -+++ firefox-101.0.1/gfx/config/gfxVars.h 2022-06-14 14:29:32.221087732 +0200 +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) \ -- _(HwDecodedVideoNoCopy, bool, false) -+ _(HwDecodedVideoNoCopy, bool, false) \ +- _(HwDecodedVideoZeroCopy, bool, false) ++ _(HwDecodedVideoZeroCopy, bool, false) \ + _(UseDMABufSurfaceExport, bool, true) /* Add new entries above this line. */ -diff -up firefox-101.0.1/gfx/gl/SharedSurfaceDMABUF.cpp.D149238.diff firefox-101.0.1/gfx/gl/SharedSurfaceDMABUF.cpp ---- firefox-101.0.1/gfx/gl/SharedSurfaceDMABUF.cpp.D149238.diff 2022-06-14 14:28:15.297513997 +0200 -+++ firefox-101.0.1/gfx/gl/SharedSurfaceDMABUF.cpp 2022-06-14 14:28:15.301514131 +0200 -@@ -9,6 +9,7 @@ - #include "GLContextEGL.h" - #include "MozFramebuffer.h" - #include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor, etc -+#include "mozilla/gfx/gfxVars.h" - - namespace mozilla::gl { - -@@ -27,22 +28,39 @@ UniquePtr SharedSu - const auto& context = gle->mContext; - const auto& egl = *(gle->mEgl); - -- if (!HasDmaBufExtensions(gle)) { -- return nullptr; -- } -- -- auto fb = MozFramebuffer::Create(desc.gl, desc.size, 0, false); -- if (!fb) return nullptr; -- -- const auto buffer = reinterpret_cast(fb->ColorTex()); -- const auto image = -- egl.fCreateImage(context, LOCAL_EGL_GL_TEXTURE_2D, buffer, nullptr); -- if (!image) return nullptr; -- -- const RefPtr surface = DMABufSurfaceRGBA::CreateDMABufSurface( -- desc.gl, image, desc.size.width, desc.size.height); -- if (!surface) return nullptr; -+ RefPtr surface; -+ UniquePtr 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( -+ 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(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; -+ } - return AsUnique(new SharedSurface_DMABUF(desc, std::move(fb), surface)); - } - -diff -up firefox-101.0.1/gfx/thebes/gfxPlatform.cpp.D149238.diff firefox-101.0.1/gfx/thebes/gfxPlatform.cpp ---- firefox-101.0.1/gfx/thebes/gfxPlatform.cpp.D149238.diff 2022-06-08 23:06:36.000000000 +0200 -+++ firefox-101.0.1/gfx/thebes/gfxPlatform.cpp 2022-06-14 14:28:15.302514165 +0200 -@@ -2851,6 +2851,17 @@ void gfxPlatform::InitWebGLConfig() { +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); } } diff --git a/firefox.spec b/firefox.spec index 92efbb1..8523688 100644 --- a/firefox.spec +++ b/firefox.spec @@ -139,6 +139,12 @@ ExcludeArch: aarch64 %bcond_without langpacks +%if %{with langpacks} +%if 0%{?fedora} >= 37 +%bcond_without langpacks_subpkg +%endif +%endif + %if !%{release_build} %global pre_tag .npgo %endif @@ -162,13 +168,13 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox -Version: 101.0.1 -Release: 7%{?pre_tag}%{?dist} +Version: 102.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220609.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220628.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -217,8 +223,6 @@ Patch55: firefox-testing.patch Patch61: firefox-glibc-dynstack.patch Patch62: build-python.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch -Patch73: D147266.diff -Patch74: D147267.diff Patch75: mozilla-1773336.patch # Test patches @@ -243,25 +247,9 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch -Patch418: mozilla-1767946-profilemanagersize.patch # VA-API fixes -Patch420: D144284.diff -Patch421: D147420.diff -Patch422: D147720.diff Patch423: D147874.diff -Patch424: D146084.diff -Patch425: D146085.diff -Patch426: D146086.diff -Patch427: D146087.diff -Patch428: D145725.diff -Patch429: D145966.diff -Patch430: D145871.diff -Patch431: D146271.diff -Patch432: D146272.diff -Patch433: D146273.diff -Patch434: D146274.diff -Patch435: D146275.diff # NVIDIA mzbz#1735929 Patch440: D147635.diff @@ -336,6 +324,11 @@ BuildRequires: icu Requires: mozilla-filesystem Recommends: mozilla-openh264 >= 2.1.1 +%if %{with langpacks_subpkg} +Recommends: firefox-langpacks = %{version}-%{release} +%else +Obsoletes: firefox-langpacks < %{version}-%{release} +%endif Recommends: libva Requires: p11-kit-trust Requires: pciutils-libs @@ -436,6 +429,17 @@ Provides: webclient Mozilla Firefox is an open-source web browser, designed for standards compliance, performance and portability. +%if %{with langpacks_subpkg} +%package langpacks +Summary: Firefox langpacks +Requires: %{name} = %{version}-%{release} +%description langpacks +The firefox-langpacks package contains all the localization +and translations langpack add-ons. +%files langpacks -f %{name}.lang +%dir %{langpackdir} +%endif + %package x11 Summary: Firefox X11 launcher. Requires: %{name} @@ -491,8 +495,6 @@ This package contains results of tests executed during build. %patch53 -p1 -b .firefox-gcc-build %patch54 -p1 -b .1669639 %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 -%patch73 -p1 -b .D147266 -%patch74 -p1 -b .D147267 # Needs for new cbindgen only %patch75 -p1 -b .1773336 @@ -516,24 +518,9 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 -%patch418 -p1 -b .mozilla-1767946-profilemanagersize # VA-API fixes -%patch420 -p1 -b .D144284.diff -%patch421 -p1 -b .D147420.diff %patch423 -p1 -b .D147874.diff -%patch424 -p1 -b .D146084.diff -%patch425 -p1 -b .D146085.diff -%patch426 -p1 -b .D146086.diff -%patch427 -p1 -b .D146087.diff -%patch428 -p1 -b .D145725.diff -%patch429 -p1 -b .D145966.diff -%patch430 -p1 -b .D145871.diff -%patch431 -p1 -b .D146271.diff -%patch432 -p1 -b .D146272.diff -%patch433 -p1 -b .D146273.diff -%patch434 -p1 -b .D146274.diff -%patch435 -p1 -b .D146275.diff # NVIDIA mzbz#1735929 %patch440 -p1 -b .D147635.diff @@ -542,7 +529,6 @@ This package contains results of tests executed during build. %patch443 -p1 -b .D149135.diff # More VA-API fixes -%patch422 -p1 -b .D147720.diff %patch444 -p1 -b .D148946.diff %patch445 -p1 -b .D149238.diff %patch446 -p1 -b .mozbz#1758948 @@ -1055,7 +1041,11 @@ fi %posttrans gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : +%if %{with langpacks_subpkg} +%files +%else %files -f %{name}.lang +%endif %{_bindir}/firefox %{mozappdir}/firefox %{mozappdir}/firefox-bin @@ -1075,9 +1065,11 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{mozappdir}/distribution/distribution.ini # That's Windows only %ghost %{mozappdir}/browser/features/aushelper@mozilla.org.xpi +%if %{without langpacks_subpkg} %if %{with langpacks} %dir %{langpackdir} %endif +%endif %{mozappdir}/browser/omni.ja %{mozappdir}/run-mozilla.sh %{mozappdir}/application.ini @@ -1120,6 +1112,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue Jun 28 2022 Martin Stransky - 102.0-1 +- Updated to 102.0 +- Applied patch from https://src.fedoraproject.org/rpms/firefox/pull-request/43 + * Mon Jun 27 2022 Martin Stransky - 101.0.1-7 - Rebuild diff --git a/mozilla-1767946-profilemanagersize.patch b/mozilla-1767946-profilemanagersize.patch deleted file mode 100644 index 4469934..0000000 --- a/mozilla-1767946-profilemanagersize.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp ---- a/widget/gtk/nsWindow.cpp -+++ b/widget/gtk/nsWindow.cpp -@@ -3787,11 +3787,12 @@ - mPendingConfigures--; - } - - // Don't fire configure event for scale changes, we handle that - // OnScaleChanged event. Skip that for toplevel windows only. -- if (mWindowType == eWindowType_toplevel) { -+ if (mWindowType == eWindowType_toplevel || -+ mWindowType == eWindowType_dialog) { - MOZ_DIAGNOSTIC_ASSERT(mGdkWindow, - "Getting configure for invisible window?"); - if (mWindowScaleFactor != gdk_window_get_scale_factor(mGdkWindow)) { - LOG(" scale factor changed to %d,return early", - gdk_window_get_scale_factor(mGdkWindow)); -@@ -4864,10 +4865,11 @@ - // Force scale factor recalculation - if (!mGdkWindow) { - mWindowScaleFactorChanged = true; - return; - } -+ LOG("OnScaleChanged -> %d\n", gdk_window_get_scale_factor(mGdkWindow)); - - // Gtk supply us sometimes with doubled events so stay calm in such case. - if (gdk_window_get_scale_factor(mGdkWindow) == mWindowScaleFactor) { - return; - } - diff --git a/sources b/sources index e75afbf..122ebf2 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (firefox-101.0.1.source.tar.xz) = 435a7f6013582933e75c41e554a45beda30b5affd7d3ed7d2876026609ba7f17b2c20b507d9d0c9ce2379e335ec09b021257ba30ac55fabf02dca54b03ea70b4 -SHA512 (firefox-langpacks-101.0.1-20220609.tar.xz) = 54c93a0fbded6a42948fd578e5577987186ca04695f9c0648718780d3a491b540187addf1239b13c53e532052888bd2ed76788a06c3a2422a060fb0da303ec58 SHA512 (cbindgen-vendor.tar.xz) = d681ca855f3779553b4a452f9dc1e3acea6253b7ef33a65948ab2d32d9848e8c06f0b3f3504ef237d6b9adb4813bdad990f7a79fa9f89333ce0d4e8da7e12d94 +SHA512 (firefox-102.0.source.tar.xz) = c7dd6d8d74c46573b16d097a5e5d230669e5778cd680b3b6f30510e989d21543138ced3bb013998b76614aa380b28efd8542450c591d8b724e03bd163d012057 +SHA512 (firefox-langpacks-102.0-20220628.tar.xz) = 2e67c06dda372077be087c65778a109070a27bc2e28e347c75ad240a67c57803e315858198273330d931091bf849cfe3d6003d9106d497049090eaf0a4af718c From 72a660f091a444007aafa443299925f9e5dee570 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 11 Jul 2022 11:12:34 +0200 Subject: [PATCH 075/545] Backport upstream fixes to WebRTC for screensharing on Wayland --- firefox.spec | 5 +- libwebrtc-screen-cast-sync.patch | 387 ++++++++++++++++--------------- 2 files changed, 208 insertions(+), 184 deletions(-) diff --git a/firefox.spec b/firefox.spec index 8523688..571be20 100644 --- a/firefox.spec +++ b/firefox.spec @@ -169,7 +169,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 102.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1112,6 +1112,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Mon Jul 11 2022 Jan Grulich - 102.0-2 +- Backport upstream fixes to WebRTC for screensharing on Wayland + * Tue Jun 28 2022 Martin Stransky - 102.0-1 - Updated to 102.0 - Applied patch from https://src.fedoraproject.org/rpms/firefox/pull-request/43 diff --git a/libwebrtc-screen-cast-sync.patch b/libwebrtc-screen-cast-sync.patch index 157d06e..4cf679f 100644 --- a/libwebrtc-screen-cast-sync.patch +++ b/libwebrtc-screen-cast-sync.patch @@ -1,25 +1,25 @@ -From e0e925da71abb97a60d02716b18faa19a29fada6 Mon Sep 17 00:00:00 2001 +From 60b164944e5dd2151cf3fcf959899e430cb57c47 Mon Sep 17 00:00:00 2001 From: Jan Grulich -Date: Mon, 21 Feb 2022 15:34:52 +0100 +Date: Wed, 22 Jun 2022 13:49:07 +0200 Subject: WebRTC - screen cast sync diff --git a/dom/media/webrtc/third_party_build/moz.build b/dom/media/webrtc/third_party_build/moz.build -index e4c7ba7..a42f913 100644 +index e4c7ba736e..a42f9138aa 100644 --- a/dom/media/webrtc/third_party_build/moz.build +++ b/dom/media/webrtc/third_party_build/moz.build @@ -63,6 +63,8 @@ webrtc_non_unified_sources = [ - + if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": DIRS += ["../../../../third_party/pipewire/libpipewire"] + DIRS += ["../../../../third_party/drm/libdrm"] + DIRS += ["../../../../third_party/gbm/libgbm"] - + GN_DIRS += ["../../../../third_party/libwebrtc"] - + diff --git a/third_party/drm/README b/third_party/drm/README new file mode 100644 -index 0000000..f68ed10 +index 0000000000..f68ed100bb --- /dev/null +++ b/third_party/drm/README @@ -0,0 +1,4 @@ @@ -29,7 +29,7 @@ index 0000000..f68ed10 +libdrm directory stores headers of libdrm needed for build only. diff --git a/third_party/drm/drm/drm.h b/third_party/drm/drm/drm.h new file mode 100644 -index 0000000..5e54c3a +index 0000000000..5e54c3aa4c --- /dev/null +++ b/third_party/drm/drm/drm.h @@ -0,0 +1,1193 @@ @@ -1228,7 +1228,7 @@ index 0000000..5e54c3a +#endif diff --git a/third_party/drm/drm/drm_fourcc.h b/third_party/drm/drm/drm_fourcc.h new file mode 100644 -index 0000000..4ececa8 +index 0000000000..4ececa84ba --- /dev/null +++ b/third_party/drm/drm/drm_fourcc.h @@ -0,0 +1,1377 @@ @@ -2611,7 +2611,7 @@ index 0000000..4ececa8 +#endif /* DRM_FOURCC_H */ diff --git a/third_party/drm/drm/drm_mode.h b/third_party/drm/drm/drm_mode.h new file mode 100644 -index 0000000..e1e3516 +index 0000000000..e1e3516828 --- /dev/null +++ b/third_party/drm/drm/drm_mode.h @@ -0,0 +1,1217 @@ @@ -3834,17 +3834,17 @@ index 0000000..e1e3516 +#endif diff --git a/third_party/drm/drm/xf86drm.h b/third_party/drm/drm/xf86drm.h new file mode 100644 -index 0000000..58d66f1 +index 0000000000..58d66f1a6b --- /dev/null +++ b/third_party/drm/drm/xf86drm.h @@ -0,0 +1,966 @@ +/** -+ * \file xf86drm.h ++ * \file xf86drm.h + * OS-independent header for DRM user-level library interface. + * + * \author Rickard E. (Rik) Faith + */ -+ ++ +/* + * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas. + * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. @@ -4037,9 +4037,9 @@ index 0000000..58d66f1 +typedef enum { + /** \name Flags for DMA buffer dispatch */ + /*@{*/ -+ DRM_DMA_BLOCK = 0x01, /**< ++ DRM_DMA_BLOCK = 0x01, /**< + * Block until buffer dispatched. -+ * ++ * + * \note the buffer may not yet have been + * processed by the hardware -- getting a + * hardware lock with the hardware quiescent @@ -4533,7 +4533,7 @@ index 0000000..58d66f1 + drmLockFlags flags); +extern int drmUnlock(int fd, drm_context_t context); +extern int drmFinish(int fd, int context, drmLockFlags flags); -+extern int drmGetContextPrivateMapping(int fd, drm_context_t ctx_id, ++extern int drmGetContextPrivateMapping(int fd, drm_context_t ctx_id, + drm_handle_t * handle); + +/* AGP/GART support: X server (root) only */ @@ -4619,7 +4619,7 @@ index 0000000..58d66f1 + int version; + + void (*vblank_handler)(int fd, -+ unsigned int sequence, ++ unsigned int sequence, + unsigned int tv_sec, + unsigned int tv_usec, + void *user_data); @@ -4806,7 +4806,7 @@ index 0000000..58d66f1 +#endif diff --git a/third_party/drm/libdrm/moz.build b/third_party/drm/libdrm/moz.build new file mode 100644 -index 0000000..3b37b91 +index 0000000000..3b37b913e8 --- /dev/null +++ b/third_party/drm/libdrm/moz.build @@ -0,0 +1,16 @@ @@ -4828,7 +4828,7 @@ index 0000000..3b37b91 +FINAL_LIBRARY = 'xul' diff --git a/third_party/drm/libdrm/mozdrm.cpp b/third_party/drm/libdrm/mozdrm.cpp new file mode 100644 -index 0000000..b2fb59b +index 0000000000..b2fb59be64 --- /dev/null +++ b/third_party/drm/libdrm/mozdrm.cpp @@ -0,0 +1,66 @@ @@ -4900,7 +4900,7 @@ index 0000000..b2fb59b +} diff --git a/third_party/gbm/README b/third_party/gbm/README new file mode 100644 -index 0000000..4b6e2e8 +index 0000000000..4b6e2e8e02 --- /dev/null +++ b/third_party/gbm/README @@ -0,0 +1,4 @@ @@ -4910,7 +4910,7 @@ index 0000000..4b6e2e8 +libgbm directory stores headers of libgbm needed for build only. diff --git a/third_party/gbm/gbm/gbm.h b/third_party/gbm/gbm/gbm.h new file mode 100644 -index 0000000..a963ed7 +index 0000000000..a963ed78e4 --- /dev/null +++ b/third_party/gbm/gbm/gbm.h @@ -0,0 +1,452 @@ @@ -4988,7 +4988,7 @@ index 0000000..a963ed7 +/** Format of the allocated buffer */ +enum gbm_bo_format { + /** RGB with 8 bits per channel in a 32 bit value */ -+ GBM_BO_FORMAT_XRGB8888, ++ GBM_BO_FORMAT_XRGB8888, + /** ARGB with 8 bits per channel in a 32 bit value */ + GBM_BO_FORMAT_ARGB8888 +}; @@ -5368,7 +5368,7 @@ index 0000000..a963ed7 +#endif diff --git a/third_party/gbm/libgbm/moz.build b/third_party/gbm/libgbm/moz.build new file mode 100644 -index 0000000..0953d2f +index 0000000000..0953d2f17a --- /dev/null +++ b/third_party/gbm/libgbm/moz.build @@ -0,0 +1,16 @@ @@ -5390,7 +5390,7 @@ index 0000000..0953d2f +FINAL_LIBRARY = 'xul' diff --git a/third_party/gbm/libgbm/mozgbm.cpp b/third_party/gbm/libgbm/mozgbm.cpp new file mode 100644 -index 0000000..bc024a1 +index 0000000000..bc024a11c0 --- /dev/null +++ b/third_party/gbm/libgbm/mozgbm.cpp @@ -0,0 +1,66 @@ @@ -5460,8 +5460,81 @@ index 0000000..bc024a1 + } + return gbm_device_destroy_fn(gbm); +} +diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build +index d961d726d4..93c901364f 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build ++++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build +@@ -76,6 +76,8 @@ if CONFIG["OS_TARGET"] == "Darwin": + LOCAL_INCLUDES += [ + "/media/libyuv/libyuv/include/", + "/media/libyuv/libyuv/include/", ++ "/third_party/drm/", ++ "/third_party/gbm/", + "/third_party/pipewire/" + ] + +@@ -105,7 +107,8 @@ if CONFIG["OS_TARGET"] == "Linux": + LOCAL_INCLUDES += [ + "/media/libyuv/libyuv/include/", + "/media/libyuv/libyuv/include/", +- "/third_party/pipewire/", ++ "/third_party/drm/", ++ "/third_party/gbm/", + "/third_party/pipewire/" + ] + +@@ -115,12 +118,16 @@ if CONFIG["OS_TARGET"] == "Linux": + ] + + SOURCES += [ +- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" ++ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" ++ + ] + + UNIFIED_SOURCES += [ +- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", +- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc", + "/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc", + "/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc", + "/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc" +@@ -156,15 +163,18 @@ if CONFIG["OS_TARGET"] == "OpenBSD": + ] + + SOURCES += [ +- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" ++ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" + ] + + UNIFIED_SOURCES += [ + "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc", +- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_x11.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/shared_x_display.cc", +- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_x11.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/window_finder_x11.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/window_list_utils.cc", +@@ -206,6 +216,7 @@ if CONFIG["OS_TARGET"] == "WINNT": + LOCAL_INCLUDES += [ + "/media/libyuv/libyuv/include/", + "/media/libyuv/libyuv/include/", ++ "/third_party/drm/" + "/third_party/pipewire/" + ] + diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc -index c89896d..c8ef822 100644 +index c89896d5fd..c8ef822938 100644 --- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc +++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc @@ -14,6 +14,9 @@ @@ -5471,9 +5544,9 @@ index c89896d..c8ef822 100644 +#if defined(WEBRTC_USE_PIPEWIRE) +#include "modules/desktop_capture/linux/shared_screencast_stream.h" +#endif - + namespace webrtc { - + @@ -35,6 +38,9 @@ DesktopCaptureOptions DesktopCaptureOptions::CreateDefault() { #if defined(WEBRTC_USE_X11) result.set_x_display(SharedXDisplay::CreateDefault()); @@ -5485,13 +5558,13 @@ index c89896d..c8ef822 100644 result.set_configuration_monitor(new DesktopConfigurationMonitor()); result.set_full_screen_window_detector( diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h -index ee0dd3a..ac56c8c 100644 +index ee0dd3ab40..ac56c8c1c1 100644 --- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h +++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h @@ -17,6 +17,10 @@ #include "modules/desktop_capture/linux/shared_x_display.h" #endif - + +#if defined(WEBRTC_USE_PIPEWIRE) +#include "modules/desktop_capture/linux/shared_screencast_stream.h" +#endif @@ -5512,7 +5585,7 @@ index ee0dd3a..ac56c8c 100644 + screencast_stream_ = stream; + } #endif - + private: #if defined(WEBRTC_USE_X11) rtc::scoped_refptr x_display_; @@ -5528,13 +5601,13 @@ index ee0dd3a..ac56c8c 100644 rtc::scoped_refptr configuration_monitor_; bool allow_iosurface_ = false; diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc -index 2fd3b1a..e4685fc 100644 +index 2fd3b1a575..e4685fc814 100644 --- a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc +++ b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc @@ -10,937 +10,67 @@ - + #include "modules/desktop_capture/linux/base_capturer_pipewire.h" - + -#include -#include -#include @@ -5553,7 +5626,7 @@ index 2fd3b1a..e4685fc 100644 #include "modules/desktop_capture/desktop_capturer.h" #include "rtc_base/checks.h" #include "rtc_base/logging.h" - + -#if defined(WEBRTC_DLOPEN_PIPEWIRE) -#include "modules/desktop_capture/linux/pipewire_stubs.h" - @@ -5563,7 +5636,7 @@ index 2fd3b1a..e4685fc 100644 -#endif // defined(WEBRTC_DLOPEN_PIPEWIRE) - namespace webrtc { - + -const char kDesktopBusName[] = "org.freedesktop.portal.Desktop"; -const char kDesktopObjectPath[] = "/org/freedesktop/portal/desktop"; -const char kDesktopRequestObjectPath[] = @@ -5639,7 +5712,7 @@ index 2fd3b1a..e4685fc 100644 + screencast_portal_ = std::make_unique( + ScreenCastPortal::CaptureSourceType::kAnyScreenContent, this); } - + -// static -void BaseCapturerPipeWire::OnStreamParamChanged(void *data, uint32_t id, - const struct spa_pod *format) { @@ -5694,7 +5767,7 @@ index 2fd3b1a..e4685fc 100644 - struct pw_buffer *next_buffer; - struct pw_buffer *buffer = nullptr; +BaseCapturerPipeWire::~BaseCapturerPipeWire() {} - + - next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); - while (next_buffer) { - buffer = next_buffer; @@ -5723,7 +5796,7 @@ index 2fd3b1a..e4685fc 100644 - - pw_stream_queue_buffer(that->pw_stream_, buffer); } - + -BaseCapturerPipeWire::BaseCapturerPipeWire(CaptureSourceType source_type) - : capture_source_type_(source_type) {} - @@ -6444,25 +6517,25 @@ index 2fd3b1a..e4685fc 100644 - - that->InitPipeWire(); } - + void BaseCapturerPipeWire::Start(Callback* callback) { RTC_DCHECK(!callback_); RTC_DCHECK(callback); - + - InitPortal(); - callback_ = callback; + + screencast_portal_->Start(); } - + void BaseCapturerPipeWire::CaptureFrame() { - if (portal_init_failed_) { + if (capturer_failed_) { callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); return; } - + - webrtc::MutexLock lock(¤t_frame_lock_); - if (!current_frame_) { - callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); @@ -6475,7 +6548,7 @@ index 2fd3b1a..e4685fc 100644 - } + std::unique_ptr frame = + options_.screencast_stream()->CaptureFrame(); - + - std::unique_ptr result(new BasicDesktopFrame(frame_size)); - result->CopyPixelsFrom( - current_frame_.get(), (frame_size.width() * BasicDesktopFrame::kBytesPerPixel), @@ -6485,31 +6558,31 @@ index 2fd3b1a..e4685fc 100644 callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); return; } - + - // TODO(julien.isorce): http://crbug.com/945468. Set the icc profile on the - // frame, see ScreenCapturerX11::CaptureFrame. + // TODO(julien.isorce): http://crbug.com/945468. Set the icc profile on + // the frame, see ScreenCapturerX11::CaptureFrame. - + - callback_->OnCaptureResult(Result::SUCCESS, std::move(result)); + callback_->OnCaptureResult(Result::SUCCESS, std::move(frame)); } - + // Keep in sync with defines at browser/actors/WebRTCParent.jsm @@ -953,31 +83,13 @@ void BaseCapturerPipeWire::CaptureFrame() { #define PIPEWIRE_NAME "####_PIPEWIRE_PORTAL_####" - + bool BaseCapturerPipeWire::GetSourceList(SourceList* sources) { + RTC_DCHECK(sources->size() == 0); sources->push_back({PIPEWIRE_ID, 0, PIPEWIRE_NAME}); return true; } - + bool BaseCapturerPipeWire::SelectSource(SourceId id) { - // Screen selection is handled by the xdg-desktop-portal. return id == PIPEWIRE_ID; } - + -// static -std::unique_ptr -BaseCapturerPipeWire::CreateRawScreenCapturer( @@ -6530,13 +6603,13 @@ index 2fd3b1a..e4685fc 100644 - } // namespace webrtc diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h -index af8e20c..5db09e0 100644 +index af8e20c84c..5db09e0244 100644 --- a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h +++ b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h @@ -11,160 +11,39 @@ #ifndef MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ #define MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ - + -#include -#define typeof __typeof__ -#include @@ -6547,9 +6620,9 @@ index af8e20c..5db09e0 100644 -#include "rtc_base/synchronization/mutex.h" +#include "modules/desktop_capture/linux/screencast_portal.h" +#include "modules/desktop_capture/linux/shared_screencast_stream.h" - + namespace webrtc { - + -class BaseCapturerPipeWire : public DesktopCapturer { +class BaseCapturerPipeWire : public DesktopCapturer, + public ScreenCastPortal::PortalNotifier { @@ -6563,7 +6636,7 @@ index af8e20c..5db09e0 100644 - explicit BaseCapturerPipeWire(CaptureSourceType source_type); + BaseCapturerPipeWire(const DesktopCaptureOptions& options); ~BaseCapturerPipeWire() override; - + + BaseCapturerPipeWire(const BaseCapturerPipeWire&) = delete; + BaseCapturerPipeWire& operator=(const BaseCapturerPipeWire&) = delete; + @@ -6572,7 +6645,7 @@ index af8e20c..5db09e0 100644 void CaptureFrame() override; bool GetSourceList(SourceList* sources) override; bool SelectSource(SourceId id) override; - + - static std::unique_ptr CreateRawScreenCapturer( - const DesktopCaptureOptions& options); - @@ -6583,7 +6656,7 @@ index af8e20c..5db09e0 100644 + uint32_t stream_node_id, + int fd) override; + void OnScreenCastSessionClosed() override; - + private: - // PipeWire types --> - pw_context* pw_context_ = nullptr; @@ -6707,11 +6780,11 @@ index af8e20c..5db09e0 100644 + bool capturer_failed_ = false; + std::unique_ptr screencast_portal_; }; - + } // namespace webrtc diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs b/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs new file mode 100644 -index 0000000..226979f +index 0000000000..226979fe16 --- /dev/null +++ b/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs @@ -0,0 +1,11 @@ @@ -6728,7 +6801,7 @@ index 0000000..226979f +void drmFreeDevices(drmDevicePtr devices[], int count); diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc new file mode 100644 -index 0000000..de63c2a +index 0000000000..de63c2a0b8 --- /dev/null +++ b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc @@ -0,0 +1,695 @@ @@ -7429,7 +7502,7 @@ index 0000000..de63c2a +} // namespace webrtc diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h new file mode 100644 -index 0000000..b755d8b +index 0000000000..b755d8ba37 --- /dev/null +++ b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h @@ -0,0 +1,68 @@ @@ -7503,7 +7576,7 @@ index 0000000..b755d8b +#endif // MODULES_DESKTOP_CAPTURE_LINUX_EGL_DMABUF_H_ diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc new file mode 100644 -index 0000000..09dea24 +index 0000000000..09dea242b3 --- /dev/null +++ b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc @@ -0,0 +1,56 @@ @@ -7565,7 +7638,7 @@ index 0000000..09dea24 +} // namespace webrtc diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h new file mode 100644 -index 0000000..9b9ccf7 +index 0000000000..9b9ccf74f8 --- /dev/null +++ b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h @@ -0,0 +1,41 @@ @@ -7611,31 +7684,31 @@ index 0000000..9b9ccf7 + +#endif // MODULES_DESKTOP_CAPTURE_LINUX_MOUSE_CURSOR_MONITOR_PIPEWIRE_H_ diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs -index 3e21e9d..06a97b8 100644 +index 3e21e9dc07..06a97b8f29 100644 --- a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs +++ b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs @@ -7,38 +7,44 @@ //------------------------------------------------ - + // core.h -void pw_core_destroy(pw_core *core); -pw_type *pw_core_get_type(pw_core *core); -pw_core * pw_core_new(pw_loop *main_loop, pw_properties *props); +int pw_core_disconnect(pw_core *core); - + // loop.h void pw_loop_destroy(pw_loop *loop); -pw_loop * pw_loop_new(pw_properties *properties); +pw_loop * pw_loop_new(const spa_dict *props); + - + // pipewire.h void pw_init(int *argc, char **argv[]); +const char* pw_get_library_version(); - + // properties.h pw_properties * pw_properties_new_string(const char *args); - + -// remote.h -void pw_remote_add_listener(pw_remote *remote, spa_hook *listener, const pw_remote_events *events, void *data); -int pw_remote_connect_fd(pw_remote *remote, int fd); @@ -7655,7 +7728,7 @@ index 3e21e9d..06a97b8 100644 int pw_stream_queue_buffer(pw_stream *stream, pw_buffer *buffer); int pw_stream_set_active(pw_stream *stream, bool active); +int pw_stream_update_params(pw_stream *stream, const spa_pod **params, uint32_t n_params); - + // thread-loop.h void pw_thread_loop_destroy(pw_thread_loop *loop); -pw_thread_loop * pw_thread_loop_new(pw_loop *loop, const char *name); @@ -7674,18 +7747,18 @@ index 3e21e9d..06a97b8 100644 +pw_core * pw_context_connect(pw_context *context, pw_properties *properties, size_t user_data_size); +pw_core * pw_context_connect_fd(pw_context *context, int fd, pw_properties *properties, size_t user_data_size); diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment -index 9d7dbd2..06ae18d 100644 +index 9d7dbd27c5..06ae18dfd4 100644 --- a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment +++ b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment @@ -5,4 +5,5 @@ extern "C" { - + #include - + +#include } diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc new file mode 100644 -index 0000000..51ca57a +index 0000000000..51ca57adc1 --- /dev/null +++ b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc @@ -0,0 +1,57 @@ @@ -7748,7 +7821,7 @@ index 0000000..51ca57a +} // namespace webrtc diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h new file mode 100644 -index 0000000..bf77855 +index 0000000000..bf77855f95 --- /dev/null +++ b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h @@ -0,0 +1,65 @@ @@ -7819,7 +7892,7 @@ index 0000000..bf77855 +#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCOPED_GLIB_H_ diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc deleted file mode 100644 -index 3813d69..0000000 +index 3813d697bb..0000000000 --- a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc +++ /dev/null @@ -1,28 +0,0 @@ @@ -7853,7 +7926,7 @@ index 3813d69..0000000 -} // namespace webrtc diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h deleted file mode 100644 -index 66dcd68..0000000 +index 66dcd680e0..0000000000 --- a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h +++ /dev/null @@ -1,33 +0,0 @@ @@ -7892,7 +7965,7 @@ index 66dcd68..0000000 -#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCREEN_CAPTURER_PIPEWIRE_H_ diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc new file mode 100644 -index 0000000..306e984 +index 0000000000..306e984207 --- /dev/null +++ b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc @@ -0,0 +1,532 @@ @@ -8430,7 +8503,7 @@ index 0000000..306e984 +} // namespace webrtc diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h new file mode 100644 -index 0000000..7da218e +index 0000000000..7da218ed78 --- /dev/null +++ b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h @@ -0,0 +1,169 @@ @@ -8605,10 +8678,10 @@ index 0000000..7da218e +#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCREENCAST_PORTAL_H_ diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc new file mode 100644 -index 0000000..c6ba661 +index 0000000000..04284ebcb7 --- /dev/null +++ b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc -@@ -0,0 +1,872 @@ +@@ -0,0 +1,892 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. + * @@ -9318,6 +9391,16 @@ index 0000000..c6ba661 + plane_datas.push_back(data); + } + ++ // When importing DMA-BUFs, we use the stride (number of bytes from one row ++ // of pixels in the buffer) provided by PipeWire. The stride from PipeWire ++ // is given by the graphics driver and some drivers might add some ++ // additional padding for memory layout optimizations so not everytime the ++ // stride is equal to BYTES_PER_PIXEL x WIDTH. This is fine, because during ++ // the import we will use OpenGL and same graphics driver so it will be able ++ // to work with the stride it provided, but later on when we work with ++ // images we get from DMA-BUFs we will need to update the stride to be equal ++ // to BYTES_PER_PIXEL x WIDTH as that's the size of the DesktopFrame we ++ // allocate for each captured frame. + src_unique_ptr = egl_dmabuf_->ImageFromDmaBuf( + desktop_size_, spa_video_format_.format, plane_datas, modifier_); + if (src_unique_ptr) { @@ -9326,7 +9409,7 @@ index 0000000..c6ba661 + RTC_LOG(LS_ERROR) << "Dropping DMA-BUF modifier: " << modifier_ + << " and trying to renegotiate stream parameters"; + -+ if (pw_client_version_ >= kDropSingleModifierMinVersion) { ++ if (pw_server_version_ >= kDropSingleModifierMinVersion) { + modifiers_.erase( + std::remove(modifiers_.begin(), modifiers_.end(), modifier_), + modifiers_.end()); @@ -9392,8 +9475,19 @@ index 0000000..c6ba661 + ? video_metadata->region.position.x + : 0; + -+ uint8_t* updated_src = src + (spa_buffer->datas[0].chunk->stride * y_offset) + -+ (kBytesPerPixel * x_offset); ++ const uint32_t frame_stride = kBytesPerPixel * desktop_size_.width(); ++ uint32_t stride = spa_buffer->datas[0].chunk->stride; ++ ++ if (spa_buffer->datas[0].type == SPA_DATA_DmaBuf && stride > frame_stride) { ++ // When DMA-BUFs are used, sometimes spa_buffer->stride we get might ++ // contain additional padding, but after we import the buffer, the stride ++ // we used is no longer relevant and we should just calculate it based on ++ // width. For more context see https://crbug.com/1333304. ++ stride = frame_stride; ++ } ++ ++ uint8_t* updated_src = ++ src + (stride * y_offset) + (kBytesPerPixel * x_offset); + + webrtc::MutexLock lock(&queue_lock_); + @@ -9415,8 +9509,7 @@ index 0000000..c6ba661 + } + + queue_.current_frame()->CopyPixelsFrom( -+ updated_src, -+ (spa_buffer->datas[0].chunk->stride - (kBytesPerPixel * x_offset)), ++ updated_src, (stride - (kBytesPerPixel * x_offset)), + DesktopRect::MakeWH(video_size_.width(), video_size_.height())); + + if (spa_video_format_.format == SPA_VIDEO_FORMAT_RGBx || @@ -9483,7 +9576,7 @@ index 0000000..c6ba661 +} // namespace webrtc diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h new file mode 100644 -index 0000000..72411e5 +index 0000000000..72411e5607 --- /dev/null +++ b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h @@ -0,0 +1,71 @@ @@ -9560,7 +9653,7 @@ index 0000000..72411e5 +#endif // MODULES_DESKTOP_CAPTURE_LINUX_SHARED_SCREENCAST_STREAM_H_ diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc deleted file mode 100644 -index c43a1f1..0000000 +index c43a1f1a0c..0000000000 --- a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc +++ /dev/null @@ -1,28 +0,0 @@ @@ -9594,7 +9687,7 @@ index c43a1f1..0000000 -} // namespace webrtc diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h deleted file mode 100644 -index 7f184ef..0000000 +index 7f184ef299..0000000000 --- a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h +++ /dev/null @@ -1,33 +0,0 @@ @@ -9632,19 +9725,19 @@ index 7f184ef..0000000 - -#endif // MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_CAPTURER_PIPEWIRE_H_ diff --git a/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc b/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc -index e569f6e..3bb51e8 100644 +index e569f6ef35..4a23ba59b2 100644 --- a/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc +++ b/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc @@ -17,6 +17,10 @@ #include "modules/desktop_capture/linux/mouse_cursor_monitor_x11.h" #endif // defined(WEBRTC_USE_X11) - + +#if defined(WEBRTC_USE_PIPEWIRE) +#include "modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h" +#endif // defined(WEBRTC_USE_PIPEWIRE) + namespace webrtc { - + // static @@ -44,6 +48,13 @@ MouseCursorMonitor* MouseCursorMonitor::CreateForScreen( // static @@ -9661,17 +9754,17 @@ index e569f6e..3bb51e8 100644 return MouseCursorMonitorX11::Create(options); #else diff --git a/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc b/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc -index 57a2002..b44ae35 100644 +index 57a2002ac7..b44ae35292 100644 --- a/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc +++ b/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc @@ -14,7 +14,7 @@ #include "modules/desktop_capture/desktop_capturer.h" - + #if defined(WEBRTC_USE_PIPEWIRE) -#include "modules/desktop_capture/linux/screen_capturer_pipewire.h" +#include "modules/desktop_capture/linux/base_capturer_pipewire.h" #endif // defined(WEBRTC_USE_PIPEWIRE) - + #if defined(WEBRTC_USE_X11) @@ -28,7 +28,7 @@ std::unique_ptr DesktopCapturer::CreateRawScreenCapturer( const DesktopCaptureOptions& options) { @@ -9681,19 +9774,19 @@ index 57a2002..b44ae35 100644 + return std::make_unique(options); } #endif // defined(WEBRTC_USE_PIPEWIRE) - + diff --git a/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc b/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc -index ed03ba0..3bc6577 100644 +index ed03ba0291..3bc6577ca5 100644 --- a/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc +++ b/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc @@ -14,7 +14,7 @@ #include "modules/desktop_capture/desktop_capturer.h" - + #if defined(WEBRTC_USE_PIPEWIRE) -#include "modules/desktop_capture/linux/window_capturer_pipewire.h" +#include "modules/desktop_capture/linux/base_capturer_pipewire.h" #endif // defined(WEBRTC_USE_PIPEWIRE) - + #if defined(WEBRTC_USE_X11) @@ -28,7 +28,7 @@ std::unique_ptr DesktopCapturer::CreateRawWindowCapturer( const DesktopCaptureOptions& options) { @@ -9703,15 +9796,15 @@ index ed03ba0..3bc6577 100644 + return std::make_unique(options); } #endif // defined(WEBRTC_USE_PIPEWIRE) - + diff --git a/third_party/moz.build b/third_party/moz.build -index 1941c11..f804531 100644 +index 8cf6f5d9f6..33d4dc29c7 100644 --- a/third_party/moz.build +++ b/third_party/moz.build -@@ -49,6 +49,12 @@ with Files("libwebrtc/**"): +@@ -58,6 +58,12 @@ with Files("libwebrtc/**"): with Files("pipewire/**"): BUG_COMPONENT = ("Core", "WebRTC") - + +with Files("drm/**"): + BUG_COMPONENT = ("Core", "WebRTC") + @@ -9720,9 +9813,9 @@ index 1941c11..f804531 100644 + with Files('rlbox_wasm2c_sandbox/**'): BUG_COMPONENT = ('Firefox Build System', 'General') - + diff --git a/third_party/pipewire/libpipewire/mozpipewire.cpp b/third_party/pipewire/libpipewire/mozpipewire.cpp -index 1ecfc31..fbeeb8e 100644 +index 1ecfc3196a..fbeeb8e5a7 100644 --- a/third_party/pipewire/libpipewire/mozpipewire.cpp +++ b/third_party/pipewire/libpipewire/mozpipewire.cpp @@ -69,11 +69,13 @@ static int (*pw_stream_connect_fn)(struct pw_stream *stream, @@ -9747,7 +9840,7 @@ index 1ecfc31..fbeeb8e 100644 +static void (*pw_thread_loop_signal_fn)(struct pw_thread_loop *loop, bool wait_for_accept); static struct pw_properties* (*pw_properties_new_string_fn)(const char *str); +static const char* (*pw_get_library_version_fn)(); - + bool IsPwLibraryLoaded() { static bool isLoaded = @@ -99,6 +104,7 @@ bool IsPwLibraryLoaded() { @@ -9767,7 +9860,7 @@ index 1ecfc31..fbeeb8e 100644 + IS_FUNC_LOADED(pw_thread_loop_wait_fn) && + IS_FUNC_LOADED(pw_properties_new_string_fn) && + IS_FUNC_LOADED(pw_get_library_version_fn)); - + return isLoaded; } @@ -136,6 +145,7 @@ bool LoadPWLibrary() { @@ -9787,12 +9880,12 @@ index 1ecfc31..fbeeb8e 100644 GET_FUNC(pw_properties_new_string, pwLib); + GET_FUNC(pw_get_library_version, pwLib); } - + return IsPwLibraryLoaded(); @@ -242,6 +255,15 @@ pw_stream_connect(struct pw_stream *stream, params, n_params); } - + +int +pw_stream_disconnect(struct pw_stream *stream) +{ @@ -9808,7 +9901,7 @@ index 1ecfc31..fbeeb8e 100644 @@ -356,6 +378,23 @@ pw_thread_loop_unlock(struct pw_thread_loop *loop) return pw_thread_loop_unlock_fn(loop); } - + +void +pw_thread_loop_signal(struct pw_thread_loop *loop, bool wait_for_accept) +{ @@ -9826,13 +9919,13 @@ index 1ecfc31..fbeeb8e 100644 + } + return pw_thread_loop_wait_fn(loop); +} - + struct pw_properties * pw_properties_new_string(const char *str) @@ -366,3 +405,12 @@ pw_properties_new_string(const char *str) return pw_properties_new_string_fn(str); } - + +const char* +pw_get_library_version() +{ @@ -9842,75 +9935,3 @@ index 1ecfc31..fbeeb8e 100644 + return pw_get_library_version_fn(); +} + -diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build ---- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200 -+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build 2022-06-02 12:48:28.316640076 +0200 -@@ -76,6 +76,8 @@ if CONFIG["OS_TARGET"] == "Darwin": - LOCAL_INCLUDES += [ - "/media/libyuv/libyuv/include/", - "/media/libyuv/libyuv/include/", -+ "/third_party/drm/", -+ "/third_party/gbm/", - "/third_party/pipewire/" - ] - -@@ -105,7 +107,8 @@ if CONFIG["OS_TARGET"] == "Linux": - LOCAL_INCLUDES += [ - "/media/libyuv/libyuv/include/", - "/media/libyuv/libyuv/include/", -- "/third_party/pipewire/", -+ "/third_party/drm/", -+ "/third_party/gbm/", - "/third_party/pipewire/" - ] - -@@ -115,12 +118,16 @@ if CONFIG["OS_TARGET"] == "Linux": - ] - - SOURCES += [ -- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" -+ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" -+ - ] - - UNIFIED_SOURCES += [ -- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", -- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc", - "/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc", - "/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc", - "/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc" -@@ -156,15 +163,18 @@ if CONFIG["OS_TARGET"] == "OpenBSD": - ] - - SOURCES += [ -- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" -+ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" - ] - - UNIFIED_SOURCES += [ - "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc", -- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_x11.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/shared_x_display.cc", -- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_x11.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/window_finder_x11.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/window_list_utils.cc", -@@ -206,6 +216,7 @@ if CONFIG["OS_TARGET"] == "WINNT": - LOCAL_INCLUDES += [ - "/media/libyuv/libyuv/include/", - "/media/libyuv/libyuv/include/", -+ "/third_party/drm/" - "/third_party/pipewire/" - ] - From d3ebfe3ad7a7743eff76db4f044b066c30827dfe Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 13 Jul 2022 14:54:04 +0200 Subject: [PATCH 076/545] Added ARM fixes by Gabriel Hojda --- firefox-102.0-pref-print.patch | 18 +++++++++++++ firefox.spec | 44 ++++++++++++++++++++++++++++++-- work-around-GCC-ICE-on-arm.patch | 12 +++++++++ 3 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 firefox-102.0-pref-print.patch create mode 100644 work-around-GCC-ICE-on-arm.patch diff --git a/firefox-102.0-pref-print.patch b/firefox-102.0-pref-print.patch new file mode 100644 index 0000000..6fd0dce --- /dev/null +++ b/firefox-102.0-pref-print.patch @@ -0,0 +1,18 @@ +diff -up firefox-102.0/widget/gtk/DMABufLibWrapper.cpp.vaapi firefox-102.0/widget/gtk/DMABufLibWrapper.cpp +--- firefox-102.0/widget/gtk/DMABufLibWrapper.cpp.vaapi 2022-07-01 09:49:50.215536872 +0200 ++++ firefox-102.0/widget/gtk/DMABufLibWrapper.cpp 2022-07-01 09:50:43.036306610 +0200 +@@ -283,10 +283,11 @@ bool nsDMABufDevice::IsDMABufTexturesEna + bool nsDMABufDevice::IsDMABufVAAPIEnabled() { + LOGDMABUF( + ("nsDMABufDevice::IsDMABufVAAPIEnabled: EGL %d " +- "media_ffmpeg_vaapi_enabled %d CanUseHardwareVideoDecoding %d " ++ "CanUseHardwareVideoDecoding %d " + "XRE_IsRDDProcess %d\n", +- gfx::gfxVars::UseEGL(), StaticPrefs::media_ffmpeg_vaapi_enabled(), +- gfx::gfxVars::CanUseHardwareVideoDecoding(), XRE_IsRDDProcess())); ++ gfx::gfxVars::UseEGL(), ++ gfx::gfxVars::CanUseHardwareVideoDecoding(), ++ XRE_IsRDDProcess())); + return gfx::gfxVars::UseVAAPI() && XRE_IsRDDProcess() && + gfx::gfxVars::CanUseHardwareVideoDecoding(); + } diff --git a/firefox.spec b/firefox.spec index 571be20..2924c7e 100644 --- a/firefox.spec +++ b/firefox.spec @@ -18,6 +18,7 @@ %global debug_build 0 %global system_nss 1 +%global system_libevent 1 %global build_with_asan 0 %global test_on_wayland 1 @@ -34,7 +35,7 @@ ExcludeArch: s390x # Disabled due to # https://bugzilla.redhat.com/show_bug.cgi?id=1966949 -%if 0%{?fedora} > 33 +%if 0%{?fedora} > 36 ExcludeArch: armv7hl %endif @@ -169,7 +170,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 102.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -262,11 +263,15 @@ Patch444: D148946.diff Patch445: D149238.diff Patch446: mozilla-1758948.patch Patch447: mozilla-1774271.patch +Patch448: firefox-102.0-pref-print.patch # PGO/LTO patches Patch600: pgo.patch Patch602: mozilla-1516803.patch +# a patch for compiling with gcc on arm (from debian) +Patch990: work-around-GCC-ICE-on-arm.patch + # Backported WebRTC changes for PipeWire/Wayland screen sharing support Patch1000: libwebrtc-screen-cast-sync.patch @@ -336,6 +341,9 @@ Requires: pciutils-libs Requires: nspr >= %{nspr_build_version} Requires: nss >= %{nss_build_version} %endif +%if %{?system_libevent} +BuildRequires: pkgconfig(libevent) +%endif BuildRequires: python3-devel BuildRequires: python3-setuptools %if !0%{?flatpak} @@ -533,6 +541,7 @@ This package contains results of tests executed during build. %patch445 -p1 -b .D149238.diff %patch446 -p1 -b .mozbz#1758948 %patch447 -p1 -b .mozbz#1774271 +%patch448 -p1 -b .pref-print # PGO patches %if %{build_with_pgo} @@ -542,6 +551,8 @@ This package contains results of tests executed during build. %endif %endif +%patch990 -p1 -b .work-around-GCC-ICE-on-arm + %patch1000 -p1 -b .libwebrtc-screen-cast-sync %{__rm} -f .mozconfig @@ -565,6 +576,10 @@ echo "ac_add_options --without-system-nspr" >> .mozconfig echo "ac_add_options --without-system-nss" >> .mozconfig %endif +%if %{?system_libevent} +echo "ac_add_options --with-system-libevent" >> .mozconfig +%endif + %if %{?system_ffi} echo "ac_add_options --enable-system-ffi" >> .mozconfig %endif @@ -724,6 +739,27 @@ MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fsanitize=address -Dxmalloc=myxmalloc" MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -fsanitize=address -ldl" %endif +%ifarch %{arm} +# disable hard-coded LTO due to RAM constraints +%{__sed} -i '/cargo_rustc_flags += -Clto/d' config/makefiles/rust.mk +%{__sed} -i '/RUSTFLAGS += -Cembed-bitcode=yes/d' config/makefiles/rust.mk +%{__sed} -i 's/codegen-units=1/codegen-units=16/' config/makefiles/rust.mk + +# make sure "-g0" is the last flag so there's no debug info +MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -g0" + +# https://bugzilla.mozilla.org/show_bug.cgi?id=1738845 +# should not be needed anymore with firefox 103 +echo "ac_add_options --disable-webrtc" >> .mozconfig + +# personal preferences +echo "ac_add_options --disable-webspeech" >> .mozconfig +echo "ac_add_options --disable-synth-speechd" >> .mozconfig +echo "ac_add_options --disable-accessibility" >> .mozconfig +echo "ac_add_options --disable-parental-controls" >> .mozconfig +echo "ac_add_options --disable-printing" >> .mozconfig +%endif + # We don't wantfirefox to use CK_GCM_PARAMS_V3 in nss MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -DNSS_PKCS11_3_0_STRICT" @@ -1112,6 +1148,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Wed Jul 13 2022 Martin Stransky - 102.0-3 +- Update preference logging. +- Added ARM fixes by Gabriel Hojda. + * Mon Jul 11 2022 Jan Grulich - 102.0-2 - Backport upstream fixes to WebRTC for screensharing on Wayland diff --git a/work-around-GCC-ICE-on-arm.patch b/work-around-GCC-ICE-on-arm.patch new file mode 100644 index 0000000..b65c647 --- /dev/null +++ b/work-around-GCC-ICE-on-arm.patch @@ -0,0 +1,12 @@ +diff -ur a/gfx/skia/skia/third_party/skcms/src/Transform_inl.h b/gfx/skia/skia/third_party/skcms/src/Transform_inl.h +--- a/gfx/skia/skia/third_party/skcms/src/Transform_inl.h 2022-05-27 08:37:14.642698922 +0300 ++++ b/gfx/skia/skia/third_party/skcms/src/Transform_inl.h 2022-05-27 12:23:43.592185545 +0300 +@@ -683,7 +683,7 @@ + // GCC 7.2.0 hits an internal compiler error with -finline-functions (or -O3) + // when targeting MIPS 64, i386, or s390x, I think attempting to inline clut() into exec_ops(). + #if 1 && defined(__GNUC__) && !defined(__clang__) \ +- && (defined(__mips64) || defined(__i386) || defined(__s390x__)) ++ && (defined(__arm__) || defined(__mips64) || defined(__i386) || defined(__s390x__)) + #define MAYBE_NOINLINE __attribute__((noinline)) + #else + #define MAYBE_NOINLINE From a76220b14695a6e4595c799e565a154a478a8c7a Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Wed, 13 Jul 2022 17:00:26 +0200 Subject: [PATCH 077/545] Fixing build on rawhide due to python 3.11 --- D147721-python3.11.diff | 136 ++++++++++++++++++++++++++++++++++++++++ firefox.spec | 2 + 2 files changed, 138 insertions(+) create mode 100644 D147721-python3.11.diff diff --git a/D147721-python3.11.diff b/D147721-python3.11.diff new file mode 100644 index 0000000..d935f59 --- /dev/null +++ b/D147721-python3.11.diff @@ -0,0 +1,136 @@ +diff --git a/dom/base/usecounters.py b/dom/base/usecounters.py +--- a/dom/base/usecounters.py ++++ b/dom/base/usecounters.py +@@ -6,11 +6,11 @@ + 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("//"): +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 +@@ -34,11 +34,11 @@ + 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[a-z]+)(?:\s+(?P\S+)(?:\s+(?P\S+))?)?", re.U + ) + for l in input: + m = r.match(l) +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 +@@ -270,11 +270,11 @@ + 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. + +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 +@@ -529,11 +529,11 @@ + ) + 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 +@@ -858,11 +858,11 @@ + 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( +@@ -912,11 +912,11 @@ + + + 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. +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 +@@ -234,11 +234,11 @@ + 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 +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 +@@ -552,11 +552,11 @@ + + 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 +@@ -609,11 +609,11 @@ + 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() + diff --git a/firefox.spec b/firefox.spec index 2924c7e..d1772b7 100644 --- a/firefox.spec +++ b/firefox.spec @@ -225,6 +225,7 @@ Patch61: firefox-glibc-dynstack.patch Patch62: build-python.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch75: mozilla-1773336.patch +Patch76: D147721-python3.11.diff # Test patches # Generate without context by @@ -505,6 +506,7 @@ This package contains results of tests executed during build. %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 # Needs for new cbindgen only %patch75 -p1 -b .1773336 +%patch76 -p1 -b .D147721-python3.11.diff # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell From 39f02cbd913d8f1dc0cd411412ce5ba6e3143840 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 15 Jul 2022 09:28:29 +0200 Subject: [PATCH 078/545] -m --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index d1772b7..d7dce3f 100644 --- a/firefox.spec +++ b/firefox.spec @@ -35,7 +35,7 @@ ExcludeArch: s390x # Disabled due to # https://bugzilla.redhat.com/show_bug.cgi?id=1966949 -%if 0%{?fedora} > 36 +%if 0%{?fedora} > 35 ExcludeArch: armv7hl %endif From 2f128006b4d23bd42110e2740f39de53f8aaf2c3 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Fri, 15 Jul 2022 14:46:05 +0200 Subject: [PATCH 079/545] Fixing build on rawhide due to python 3.11 --- build-python-3.11.patch | 12 ++++++++++++ firefox.spec | 2 ++ 2 files changed, 14 insertions(+) create mode 100644 build-python-3.11.patch diff --git a/build-python-3.11.patch b/build-python-3.11.patch new file mode 100644 index 0000000..6f6cea2 --- /dev/null +++ b/build-python-3.11.patch @@ -0,0 +1,12 @@ +diff -up firefox-102.0/xpcom/idl-parser/xpidl/xpidl.py.python-311 firefox-102.0/xpcom/idl-parser/xpidl/xpidl.py +--- firefox-102.0/xpcom/idl-parser/xpidl/xpidl.py.python-311 2022-07-15 14:23:10.890868155 +0200 ++++ firefox-102.0/xpcom/idl-parser/xpidl/xpidl.py 2022-07-15 14:42:17.308836813 +0200 +@@ -1572,7 +1572,7 @@ 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) diff --git a/firefox.spec b/firefox.spec index d7dce3f..0891447 100644 --- a/firefox.spec +++ b/firefox.spec @@ -226,6 +226,7 @@ Patch62: build-python.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch75: mozilla-1773336.patch Patch76: D147721-python3.11.diff +Patch77: build-python-3.11.patch # Test patches # Generate without context by @@ -507,6 +508,7 @@ This package contains results of tests executed during build. # Needs for new cbindgen only %patch75 -p1 -b .1773336 %patch76 -p1 -b .D147721-python3.11.diff +%patch77 -p1 -b .build-python-3.11 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell From 3f1c25e40c5663edb08798b982b0033046c03ff8 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Fri, 15 Jul 2022 15:57:23 +0200 Subject: [PATCH 080/545] Fixing build on rawhide due to python 3.11 --- build-python-3.11.patch | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/build-python-3.11.patch b/build-python-3.11.patch index 6f6cea2..818d664 100644 --- a/build-python-3.11.patch +++ b/build-python-3.11.patch @@ -1,7 +1,7 @@ -diff -up firefox-102.0/xpcom/idl-parser/xpidl/xpidl.py.python-311 firefox-102.0/xpcom/idl-parser/xpidl/xpidl.py ---- firefox-102.0/xpcom/idl-parser/xpidl/xpidl.py.python-311 2022-07-15 14:23:10.890868155 +0200 -+++ firefox-102.0/xpcom/idl-parser/xpidl/xpidl.py 2022-07-15 14:42:17.308836813 +0200 -@@ -1572,7 +1572,7 @@ class IDLParser(object): +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 15:56:52.101296928 +0200 +@@ -1572,13 +1572,13 @@ class IDLParser(object): t_ignore = " \t" def t_multilinecomment(self, t): @@ -10,3 +10,10 @@ diff -up firefox-102.0/xpcom/idl-parser/xpidl/xpidl.py.python-311 firefox-102.0/ 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 From 4d45de9bff7b7ef01f7d3c9e53a61adc9cf3ce9e Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Fri, 15 Jul 2022 16:19:14 +0200 Subject: [PATCH 081/545] Fixing build on rawhide due to python 3.11 --- build-python-3.11.patch | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build-python-3.11.patch b/build-python-3.11.patch index 818d664..410a3da 100644 --- a/build-python-3.11.patch +++ b/build-python-3.11.patch @@ -1,6 +1,6 @@ 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 15:56:52.101296928 +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" @@ -17,3 +17,12 @@ diff -up firefox-102.0/xpcom/idl-parser/xpidl/xpidl.py.build-python-3.11 firefox 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.*?\n?)%\}[ ]*(C\+\+)?" ++ r"(?s:%\{[ ]*C\+\+[ ]*\n(?P.*?\n?)%\}[ ]*(C\+\+)?)" + t.type = "CDATA" + t.value = t.lexer.lexmatch.group("cdata") + t.lexer.lineno += t.value.count("\n") From de02f241c5dcb1f705a925d4c2e01d4d296dfd24 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 21 Jul 2022 03:11:43 +0000 Subject: [PATCH 082/545] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- firefox.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 0891447..deded82 100644 --- a/firefox.spec +++ b/firefox.spec @@ -170,7 +170,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 102.0 -Release: 3%{?pre_tag}%{?dist} +Release: 4%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1152,6 +1152,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Thu Jul 21 2022 Fedora Release Engineering - 102.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Wed Jul 13 2022 Martin Stransky - 102.0-3 - Update preference logging. - Added ARM fixes by Gabriel Hojda. From 1469e57b1008ce7dcecdf6b68e26370e10412a75 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 21 Jul 2022 11:41:14 +0200 Subject: [PATCH 083/545] Updated to 103.0 --- .gitignore | 2 ++ firefox.spec | 9 +++------ mozilla-1773336.patch | 12 ------------ sources | 4 ++-- 4 files changed, 7 insertions(+), 20 deletions(-) delete mode 100644 mozilla-1773336.patch diff --git a/.gitignore b/.gitignore index c0734c0..f22e708 100644 --- a/.gitignore +++ b/.gitignore @@ -517,3 +517,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-101.0.1-20220609.tar.xz /firefox-102.0.source.tar.xz /firefox-langpacks-102.0-20220628.tar.xz +/firefox-103.0.source.tar.xz +/firefox-langpacks-103.0-20220721.tar.xz diff --git a/firefox.spec b/firefox.spec index deded82..3e28522 100644 --- a/firefox.spec +++ b/firefox.spec @@ -169,13 +169,13 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox -Version: 102.0 -Release: 4%{?pre_tag}%{?dist} +Version: 103.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220628.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220721.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -224,7 +224,6 @@ Patch55: firefox-testing.patch Patch61: firefox-glibc-dynstack.patch Patch62: build-python.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch -Patch75: mozilla-1773336.patch Patch76: D147721-python3.11.diff Patch77: build-python-3.11.patch @@ -505,8 +504,6 @@ This package contains results of tests executed during build. %patch53 -p1 -b .firefox-gcc-build %patch54 -p1 -b .1669639 %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 -# Needs for new cbindgen only -%patch75 -p1 -b .1773336 %patch76 -p1 -b .D147721-python3.11.diff %patch77 -p1 -b .build-python-3.11 diff --git a/mozilla-1773336.patch b/mozilla-1773336.patch deleted file mode 100644 index b65ff89..0000000 --- a/mozilla-1773336.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up firefox-101.0.1/gfx/webrender_bindings/webrender_ffi.h.old firefox-101.0.1/gfx/webrender_bindings/webrender_ffi.h ---- firefox-101.0.1/gfx/webrender_bindings/webrender_ffi.h.old 2022-06-09 10:31:16.122495733 +0200 -+++ firefox-101.0.1/gfx/webrender_bindings/webrender_ffi.h 2022-06-09 10:31:22.880724352 +0200 -@@ -72,8 +72,6 @@ struct WrPipelineInfo; - struct WrPipelineIdAndEpoch; - using WrPipelineIdEpochs = nsTArray; - --const uint64_t ROOT_CLIP_CHAIN = ~0; -- - } // namespace wr - } // namespace mozilla - diff --git a/sources b/sources index 122ebf2..dab47b2 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 SHA512 (cbindgen-vendor.tar.xz) = d681ca855f3779553b4a452f9dc1e3acea6253b7ef33a65948ab2d32d9848e8c06f0b3f3504ef237d6b9adb4813bdad990f7a79fa9f89333ce0d4e8da7e12d94 -SHA512 (firefox-102.0.source.tar.xz) = c7dd6d8d74c46573b16d097a5e5d230669e5778cd680b3b6f30510e989d21543138ced3bb013998b76614aa380b28efd8542450c591d8b724e03bd163d012057 -SHA512 (firefox-langpacks-102.0-20220628.tar.xz) = 2e67c06dda372077be087c65778a109070a27bc2e28e347c75ad240a67c57803e315858198273330d931091bf849cfe3d6003d9106d497049090eaf0a4af718c +SHA512 (firefox-103.0.source.tar.xz) = 016c2f276fb94e5174626f7d8b1a821b2de0f5a07f8a10f00a7ea4d4285591b0c23dd3ef45306579de79b3dfa99ccc527224c33f3319f61cf088b1f4bd097f9e +SHA512 (firefox-langpacks-103.0-20220721.tar.xz) = 5633451a25075439459a6af4917a4dda4e06767a1f4d1055d42cdbe0c3de7a4e2c464f502982ed6bfd1a13b82ad462a9b9fb91910bac85aeb3e77f7af3739b5c From 71b3ae64d2ae86e1d230d85b5df2ddf18deaa632 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Thu, 21 Jul 2022 12:03:34 +0200 Subject: [PATCH 084/545] Removing no longer required D147721-python3.11.diff --- D147721-python3.11.diff | 136 ---------------------------------------- firefox.spec | 2 - 2 files changed, 138 deletions(-) delete mode 100644 D147721-python3.11.diff diff --git a/D147721-python3.11.diff b/D147721-python3.11.diff deleted file mode 100644 index d935f59..0000000 --- a/D147721-python3.11.diff +++ /dev/null @@ -1,136 +0,0 @@ -diff --git a/dom/base/usecounters.py b/dom/base/usecounters.py ---- a/dom/base/usecounters.py -+++ b/dom/base/usecounters.py -@@ -6,11 +6,11 @@ - 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("//"): -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 -@@ -34,11 +34,11 @@ - 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[a-z]+)(?:\s+(?P\S+)(?:\s+(?P\S+))?)?", re.U - ) - for l in input: - m = r.match(l) -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 -@@ -270,11 +270,11 @@ - 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. - -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 -@@ -529,11 +529,11 @@ - ) - 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 -@@ -858,11 +858,11 @@ - 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( -@@ -912,11 +912,11 @@ - - - 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. -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 -@@ -234,11 +234,11 @@ - 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 -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 -@@ -552,11 +552,11 @@ - - 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 -@@ -609,11 +609,11 @@ - 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() - diff --git a/firefox.spec b/firefox.spec index 3e28522..dcaf4b3 100644 --- a/firefox.spec +++ b/firefox.spec @@ -224,7 +224,6 @@ Patch55: firefox-testing.patch Patch61: firefox-glibc-dynstack.patch Patch62: build-python.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch -Patch76: D147721-python3.11.diff Patch77: build-python-3.11.patch # Test patches @@ -504,7 +503,6 @@ This package contains results of tests executed during build. %patch53 -p1 -b .firefox-gcc-build %patch54 -p1 -b .1669639 %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 -%patch76 -p1 -b .D147721-python3.11.diff %patch77 -p1 -b .build-python-3.11 # Test patches From 0d92801bb9b9989734982ee099fe425222b32070 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 26 Jul 2022 17:03:28 +0200 Subject: [PATCH 085/545] Update to 103.0 - build fixes --- firefox.spec | 34 +- libwebrtc-screen-cast-sync-1.patch | 9742 ++++++++++++++++++++++++++++ 2 files changed, 9746 insertions(+), 30 deletions(-) create mode 100644 libwebrtc-screen-cast-sync-1.patch diff --git a/firefox.spec b/firefox.spec index dcaf4b3..b2d6a3a 100644 --- a/firefox.spec +++ b/firefox.spec @@ -248,21 +248,6 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch - -# VA-API fixes -Patch423: D147874.diff - -# NVIDIA mzbz#1735929 -Patch440: D147635.diff -Patch441: D147636.diff -Patch442: D147637.diff - -# More upstream fixes -Patch443: D149135.diff -Patch444: D148946.diff -Patch445: D149238.diff -Patch446: mozilla-1758948.patch -Patch447: mozilla-1774271.patch Patch448: firefox-102.0-pref-print.patch # PGO/LTO patches @@ -273,7 +258,7 @@ Patch602: mozilla-1516803.patch Patch990: work-around-GCC-ICE-on-arm.patch # Backported WebRTC changes for PipeWire/Wayland screen sharing support -Patch1000: libwebrtc-screen-cast-sync.patch +Patch1000: libwebrtc-screen-cast-sync-1.patch %if %{?system_nss} BuildRequires: pkgconfig(nspr) >= %{nspr_version} @@ -526,20 +511,6 @@ This package contains results of tests executed during build. %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 -# VA-API fixes -%patch423 -p1 -b .D147874.diff - -# NVIDIA mzbz#1735929 -%patch440 -p1 -b .D147635.diff -%patch441 -p1 -b .D147636.diff -%patch442 -p1 -b .D147637.diff -%patch443 -p1 -b .D149135.diff - -# More VA-API fixes -%patch444 -p1 -b .D148946.diff -%patch445 -p1 -b .D149238.diff -%patch446 -p1 -b .mozbz#1758948 -%patch447 -p1 -b .mozbz#1774271 %patch448 -p1 -b .pref-print # PGO patches @@ -1147,6 +1118,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue Jul 26 2022 Martin Stransky - 103.0-1 +- Update to 103.0 + * Thu Jul 21 2022 Fedora Release Engineering - 102.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild diff --git a/libwebrtc-screen-cast-sync-1.patch b/libwebrtc-screen-cast-sync-1.patch new file mode 100644 index 0000000..2d7c0a0 --- /dev/null +++ b/libwebrtc-screen-cast-sync-1.patch @@ -0,0 +1,9742 @@ +diff -up firefox-103.0/third_party/drm/drm/drm_fourcc.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/drm/drm/drm_fourcc.h +--- firefox-103.0/third_party/drm/drm/drm_fourcc.h.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.428095335 +0200 ++++ firefox-103.0/third_party/drm/drm/drm_fourcc.h 2022-07-26 16:30:19.428095335 +0200 +@@ -0,0 +1,1377 @@ ++/* ++ * Copyright 2011 Intel Corporation ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++#ifndef DRM_FOURCC_H ++#define DRM_FOURCC_H ++ ++#include "drm.h" ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++/** ++ * DOC: overview ++ * ++ * In the DRM subsystem, framebuffer pixel formats are described using the ++ * fourcc codes defined in `include/uapi/drm/drm_fourcc.h`. In addition to the ++ * fourcc code, a Format Modifier may optionally be provided, in order to ++ * further describe the buffer's format - for example tiling or compression. ++ * ++ * Format Modifiers ++ * ---------------- ++ * ++ * Format modifiers are used in conjunction with a fourcc code, forming a ++ * unique fourcc:modifier pair. This format:modifier pair must fully define the ++ * format and data layout of the buffer, and should be the only way to describe ++ * that particular buffer. ++ * ++ * Having multiple fourcc:modifier pairs which describe the same layout should ++ * be avoided, as such aliases run the risk of different drivers exposing ++ * different names for the same data format, forcing userspace to understand ++ * that they are aliases. ++ * ++ * Format modifiers may change any property of the buffer, including the number ++ * of planes and/or the required allocation size. Format modifiers are ++ * vendor-namespaced, and as such the relationship between a fourcc code and a ++ * modifier is specific to the modifer being used. For example, some modifiers ++ * may preserve meaning - such as number of planes - from the fourcc code, ++ * whereas others may not. ++ * ++ * Modifiers must uniquely encode buffer layout. In other words, a buffer must ++ * match only a single modifier. A modifier must not be a subset of layouts of ++ * another modifier. For instance, it's incorrect to encode pitch alignment in ++ * a modifier: a buffer may match a 64-pixel aligned modifier and a 32-pixel ++ * aligned modifier. That said, modifiers can have implicit minimal ++ * requirements. ++ * ++ * For modifiers where the combination of fourcc code and modifier can alias, ++ * a canonical pair needs to be defined and used by all drivers. Preferred ++ * combinations are also encouraged where all combinations might lead to ++ * confusion and unnecessarily reduced interoperability. An example for the ++ * latter is AFBC, where the ABGR layouts are preferred over ARGB layouts. ++ * ++ * There are two kinds of modifier users: ++ * ++ * - Kernel and user-space drivers: for drivers it's important that modifiers ++ * don't alias, otherwise two drivers might support the same format but use ++ * different aliases, preventing them from sharing buffers in an efficient ++ * format. ++ * - Higher-level programs interfacing with KMS/GBM/EGL/Vulkan/etc: these users ++ * see modifiers as opaque tokens they can check for equality and intersect. ++ * These users musn't need to know to reason about the modifier value ++ * (i.e. they are not expected to extract information out of the modifier). ++ * ++ * Vendors should document their modifier usage in as much detail as ++ * possible, to ensure maximum compatibility across devices, drivers and ++ * applications. ++ * ++ * The authoritative list of format modifier codes is found in ++ * `include/uapi/drm/drm_fourcc.h` ++ */ ++ ++#define fourcc_code(a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \ ++ ((__u32)(c) << 16) | ((__u32)(d) << 24)) ++ ++#define DRM_FORMAT_BIG_ENDIAN (1U<<31) /* format is big endian instead of little endian */ ++ ++/* Reserve 0 for the invalid format specifier */ ++#define DRM_FORMAT_INVALID 0 ++ ++/* color index */ ++#define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ') /* [7:0] C */ ++ ++/* 8 bpp Red */ ++#define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ') /* [7:0] R */ ++ ++/* 10 bpp Red */ ++#define DRM_FORMAT_R10 fourcc_code('R', '1', '0', ' ') /* [15:0] x:R 6:10 little endian */ ++ ++/* 12 bpp Red */ ++#define DRM_FORMAT_R12 fourcc_code('R', '1', '2', ' ') /* [15:0] x:R 4:12 little endian */ ++ ++/* 16 bpp Red */ ++#define DRM_FORMAT_R16 fourcc_code('R', '1', '6', ' ') /* [15:0] R little endian */ ++ ++/* 16 bpp RG */ ++#define DRM_FORMAT_RG88 fourcc_code('R', 'G', '8', '8') /* [15:0] R:G 8:8 little endian */ ++#define DRM_FORMAT_GR88 fourcc_code('G', 'R', '8', '8') /* [15:0] G:R 8:8 little endian */ ++ ++/* 32 bpp RG */ ++#define DRM_FORMAT_RG1616 fourcc_code('R', 'G', '3', '2') /* [31:0] R:G 16:16 little endian */ ++#define DRM_FORMAT_GR1616 fourcc_code('G', 'R', '3', '2') /* [31:0] G:R 16:16 little endian */ ++ ++/* 8 bpp RGB */ ++#define DRM_FORMAT_RGB332 fourcc_code('R', 'G', 'B', '8') /* [7:0] R:G:B 3:3:2 */ ++#define DRM_FORMAT_BGR233 fourcc_code('B', 'G', 'R', '8') /* [7:0] B:G:R 2:3:3 */ ++ ++/* 16 bpp RGB */ ++#define DRM_FORMAT_XRGB4444 fourcc_code('X', 'R', '1', '2') /* [15:0] x:R:G:B 4:4:4:4 little endian */ ++#define DRM_FORMAT_XBGR4444 fourcc_code('X', 'B', '1', '2') /* [15:0] x:B:G:R 4:4:4:4 little endian */ ++#define DRM_FORMAT_RGBX4444 fourcc_code('R', 'X', '1', '2') /* [15:0] R:G:B:x 4:4:4:4 little endian */ ++#define DRM_FORMAT_BGRX4444 fourcc_code('B', 'X', '1', '2') /* [15:0] B:G:R:x 4:4:4:4 little endian */ ++ ++#define DRM_FORMAT_ARGB4444 fourcc_code('A', 'R', '1', '2') /* [15:0] A:R:G:B 4:4:4:4 little endian */ ++#define DRM_FORMAT_ABGR4444 fourcc_code('A', 'B', '1', '2') /* [15:0] A:B:G:R 4:4:4:4 little endian */ ++#define DRM_FORMAT_RGBA4444 fourcc_code('R', 'A', '1', '2') /* [15:0] R:G:B:A 4:4:4:4 little endian */ ++#define DRM_FORMAT_BGRA4444 fourcc_code('B', 'A', '1', '2') /* [15:0] B:G:R:A 4:4:4:4 little endian */ ++ ++#define DRM_FORMAT_XRGB1555 fourcc_code('X', 'R', '1', '5') /* [15:0] x:R:G:B 1:5:5:5 little endian */ ++#define DRM_FORMAT_XBGR1555 fourcc_code('X', 'B', '1', '5') /* [15:0] x:B:G:R 1:5:5:5 little endian */ ++#define DRM_FORMAT_RGBX5551 fourcc_code('R', 'X', '1', '5') /* [15:0] R:G:B:x 5:5:5:1 little endian */ ++#define DRM_FORMAT_BGRX5551 fourcc_code('B', 'X', '1', '5') /* [15:0] B:G:R:x 5:5:5:1 little endian */ ++ ++#define DRM_FORMAT_ARGB1555 fourcc_code('A', 'R', '1', '5') /* [15:0] A:R:G:B 1:5:5:5 little endian */ ++#define DRM_FORMAT_ABGR1555 fourcc_code('A', 'B', '1', '5') /* [15:0] A:B:G:R 1:5:5:5 little endian */ ++#define DRM_FORMAT_RGBA5551 fourcc_code('R', 'A', '1', '5') /* [15:0] R:G:B:A 5:5:5:1 little endian */ ++#define DRM_FORMAT_BGRA5551 fourcc_code('B', 'A', '1', '5') /* [15:0] B:G:R:A 5:5:5:1 little endian */ ++ ++#define DRM_FORMAT_RGB565 fourcc_code('R', 'G', '1', '6') /* [15:0] R:G:B 5:6:5 little endian */ ++#define DRM_FORMAT_BGR565 fourcc_code('B', 'G', '1', '6') /* [15:0] B:G:R 5:6:5 little endian */ ++ ++/* 24 bpp RGB */ ++#define DRM_FORMAT_RGB888 fourcc_code('R', 'G', '2', '4') /* [23:0] R:G:B little endian */ ++#define DRM_FORMAT_BGR888 fourcc_code('B', 'G', '2', '4') /* [23:0] B:G:R little endian */ ++ ++/* 32 bpp RGB */ ++#define DRM_FORMAT_XRGB8888 fourcc_code('X', 'R', '2', '4') /* [31:0] x:R:G:B 8:8:8:8 little endian */ ++#define DRM_FORMAT_XBGR8888 fourcc_code('X', 'B', '2', '4') /* [31:0] x:B:G:R 8:8:8:8 little endian */ ++#define DRM_FORMAT_RGBX8888 fourcc_code('R', 'X', '2', '4') /* [31:0] R:G:B:x 8:8:8:8 little endian */ ++#define DRM_FORMAT_BGRX8888 fourcc_code('B', 'X', '2', '4') /* [31:0] B:G:R:x 8:8:8:8 little endian */ ++ ++#define DRM_FORMAT_ARGB8888 fourcc_code('A', 'R', '2', '4') /* [31:0] A:R:G:B 8:8:8:8 little endian */ ++#define DRM_FORMAT_ABGR8888 fourcc_code('A', 'B', '2', '4') /* [31:0] A:B:G:R 8:8:8:8 little endian */ ++#define DRM_FORMAT_RGBA8888 fourcc_code('R', 'A', '2', '4') /* [31:0] R:G:B:A 8:8:8:8 little endian */ ++#define DRM_FORMAT_BGRA8888 fourcc_code('B', 'A', '2', '4') /* [31:0] B:G:R:A 8:8:8:8 little endian */ ++ ++#define DRM_FORMAT_XRGB2101010 fourcc_code('X', 'R', '3', '0') /* [31:0] x:R:G:B 2:10:10:10 little endian */ ++#define DRM_FORMAT_XBGR2101010 fourcc_code('X', 'B', '3', '0') /* [31:0] x:B:G:R 2:10:10:10 little endian */ ++#define DRM_FORMAT_RGBX1010102 fourcc_code('R', 'X', '3', '0') /* [31:0] R:G:B:x 10:10:10:2 little endian */ ++#define DRM_FORMAT_BGRX1010102 fourcc_code('B', 'X', '3', '0') /* [31:0] B:G:R:x 10:10:10:2 little endian */ ++ ++#define DRM_FORMAT_ARGB2101010 fourcc_code('A', 'R', '3', '0') /* [31:0] A:R:G:B 2:10:10:10 little endian */ ++#define DRM_FORMAT_ABGR2101010 fourcc_code('A', 'B', '3', '0') /* [31:0] A:B:G:R 2:10:10:10 little endian */ ++#define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */ ++#define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */ ++ ++/* 64 bpp RGB */ ++#define DRM_FORMAT_XRGB16161616 fourcc_code('X', 'R', '4', '8') /* [63:0] x:R:G:B 16:16:16:16 little endian */ ++#define DRM_FORMAT_XBGR16161616 fourcc_code('X', 'B', '4', '8') /* [63:0] x:B:G:R 16:16:16:16 little endian */ ++ ++#define DRM_FORMAT_ARGB16161616 fourcc_code('A', 'R', '4', '8') /* [63:0] A:R:G:B 16:16:16:16 little endian */ ++#define DRM_FORMAT_ABGR16161616 fourcc_code('A', 'B', '4', '8') /* [63:0] A:B:G:R 16:16:16:16 little endian */ ++ ++/* ++ * Floating point 64bpp RGB ++ * IEEE 754-2008 binary16 half-precision float ++ * [15:0] sign:exponent:mantissa 1:5:10 ++ */ ++#define DRM_FORMAT_XRGB16161616F fourcc_code('X', 'R', '4', 'H') /* [63:0] x:R:G:B 16:16:16:16 little endian */ ++#define DRM_FORMAT_XBGR16161616F fourcc_code('X', 'B', '4', 'H') /* [63:0] x:B:G:R 16:16:16:16 little endian */ ++ ++#define DRM_FORMAT_ARGB16161616F fourcc_code('A', 'R', '4', 'H') /* [63:0] A:R:G:B 16:16:16:16 little endian */ ++#define DRM_FORMAT_ABGR16161616F fourcc_code('A', 'B', '4', 'H') /* [63:0] A:B:G:R 16:16:16:16 little endian */ ++ ++/* ++ * RGBA format with 10-bit components packed in 64-bit per pixel, with 6 bits ++ * of unused padding per component: ++ */ ++#define DRM_FORMAT_AXBXGXRX106106106106 fourcc_code('A', 'B', '1', '0') /* [63:0] A:x:B:x:G:x:R:x 10:6:10:6:10:6:10:6 little endian */ ++ ++/* packed YCbCr */ ++#define DRM_FORMAT_YUYV fourcc_code('Y', 'U', 'Y', 'V') /* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */ ++#define DRM_FORMAT_YVYU fourcc_code('Y', 'V', 'Y', 'U') /* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */ ++#define DRM_FORMAT_UYVY fourcc_code('U', 'Y', 'V', 'Y') /* [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian */ ++#define DRM_FORMAT_VYUY fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */ ++ ++#define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */ ++#define DRM_FORMAT_XYUV8888 fourcc_code('X', 'Y', 'U', 'V') /* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */ ++#define DRM_FORMAT_VUY888 fourcc_code('V', 'U', '2', '4') /* [23:0] Cr:Cb:Y 8:8:8 little endian */ ++#define DRM_FORMAT_VUY101010 fourcc_code('V', 'U', '3', '0') /* Y followed by U then V, 10:10:10. Non-linear modifier only */ ++ ++/* ++ * packed Y2xx indicate for each component, xx valid data occupy msb ++ * 16-xx padding occupy lsb ++ */ ++#define DRM_FORMAT_Y210 fourcc_code('Y', '2', '1', '0') /* [63:0] Cr0:0:Y1:0:Cb0:0:Y0:0 10:6:10:6:10:6:10:6 little endian per 2 Y pixels */ ++#define DRM_FORMAT_Y212 fourcc_code('Y', '2', '1', '2') /* [63:0] Cr0:0:Y1:0:Cb0:0:Y0:0 12:4:12:4:12:4:12:4 little endian per 2 Y pixels */ ++#define DRM_FORMAT_Y216 fourcc_code('Y', '2', '1', '6') /* [63:0] Cr0:Y1:Cb0:Y0 16:16:16:16 little endian per 2 Y pixels */ ++ ++/* ++ * packed Y4xx indicate for each component, xx valid data occupy msb ++ * 16-xx padding occupy lsb except Y410 ++ */ ++#define DRM_FORMAT_Y410 fourcc_code('Y', '4', '1', '0') /* [31:0] A:Cr:Y:Cb 2:10:10:10 little endian */ ++#define DRM_FORMAT_Y412 fourcc_code('Y', '4', '1', '2') /* [63:0] A:0:Cr:0:Y:0:Cb:0 12:4:12:4:12:4:12:4 little endian */ ++#define DRM_FORMAT_Y416 fourcc_code('Y', '4', '1', '6') /* [63:0] A:Cr:Y:Cb 16:16:16:16 little endian */ ++ ++#define DRM_FORMAT_XVYU2101010 fourcc_code('X', 'V', '3', '0') /* [31:0] X:Cr:Y:Cb 2:10:10:10 little endian */ ++#define DRM_FORMAT_XVYU12_16161616 fourcc_code('X', 'V', '3', '6') /* [63:0] X:0:Cr:0:Y:0:Cb:0 12:4:12:4:12:4:12:4 little endian */ ++#define DRM_FORMAT_XVYU16161616 fourcc_code('X', 'V', '4', '8') /* [63:0] X:Cr:Y:Cb 16:16:16:16 little endian */ ++ ++/* ++ * packed YCbCr420 2x2 tiled formats ++ * first 64 bits will contain Y,Cb,Cr components for a 2x2 tile ++ */ ++/* [63:0] A3:A2:Y3:0:Cr0:0:Y2:0:A1:A0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian */ ++#define DRM_FORMAT_Y0L0 fourcc_code('Y', '0', 'L', '0') ++/* [63:0] X3:X2:Y3:0:Cr0:0:Y2:0:X1:X0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian */ ++#define DRM_FORMAT_X0L0 fourcc_code('X', '0', 'L', '0') ++ ++/* [63:0] A3:A2:Y3:Cr0:Y2:A1:A0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian */ ++#define DRM_FORMAT_Y0L2 fourcc_code('Y', '0', 'L', '2') ++/* [63:0] X3:X2:Y3:Cr0:Y2:X1:X0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian */ ++#define DRM_FORMAT_X0L2 fourcc_code('X', '0', 'L', '2') ++ ++/* ++ * 1-plane YUV 4:2:0 ++ * In these formats, the component ordering is specified (Y, followed by U ++ * then V), but the exact Linear layout is undefined. ++ * These formats can only be used with a non-Linear modifier. ++ */ ++#define DRM_FORMAT_YUV420_8BIT fourcc_code('Y', 'U', '0', '8') ++#define DRM_FORMAT_YUV420_10BIT fourcc_code('Y', 'U', '1', '0') ++ ++/* ++ * 2 plane RGB + A ++ * index 0 = RGB plane, same format as the corresponding non _A8 format has ++ * index 1 = A plane, [7:0] A ++ */ ++#define DRM_FORMAT_XRGB8888_A8 fourcc_code('X', 'R', 'A', '8') ++#define DRM_FORMAT_XBGR8888_A8 fourcc_code('X', 'B', 'A', '8') ++#define DRM_FORMAT_RGBX8888_A8 fourcc_code('R', 'X', 'A', '8') ++#define DRM_FORMAT_BGRX8888_A8 fourcc_code('B', 'X', 'A', '8') ++#define DRM_FORMAT_RGB888_A8 fourcc_code('R', '8', 'A', '8') ++#define DRM_FORMAT_BGR888_A8 fourcc_code('B', '8', 'A', '8') ++#define DRM_FORMAT_RGB565_A8 fourcc_code('R', '5', 'A', '8') ++#define DRM_FORMAT_BGR565_A8 fourcc_code('B', '5', 'A', '8') ++ ++/* ++ * 2 plane YCbCr ++ * index 0 = Y plane, [7:0] Y ++ * index 1 = Cr:Cb plane, [15:0] Cr:Cb little endian ++ * or ++ * index 1 = Cb:Cr plane, [15:0] Cb:Cr little endian ++ */ ++#define DRM_FORMAT_NV12 fourcc_code('N', 'V', '1', '2') /* 2x2 subsampled Cr:Cb plane */ ++#define DRM_FORMAT_NV21 fourcc_code('N', 'V', '2', '1') /* 2x2 subsampled Cb:Cr plane */ ++#define DRM_FORMAT_NV16 fourcc_code('N', 'V', '1', '6') /* 2x1 subsampled Cr:Cb plane */ ++#define DRM_FORMAT_NV61 fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */ ++#define DRM_FORMAT_NV24 fourcc_code('N', 'V', '2', '4') /* non-subsampled Cr:Cb plane */ ++#define DRM_FORMAT_NV42 fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */ ++/* ++ * 2 plane YCbCr ++ * index 0 = Y plane, [39:0] Y3:Y2:Y1:Y0 little endian ++ * index 1 = Cr:Cb plane, [39:0] Cr1:Cb1:Cr0:Cb0 little endian ++ */ ++#define DRM_FORMAT_NV15 fourcc_code('N', 'V', '1', '5') /* 2x2 subsampled Cr:Cb plane */ ++ ++/* ++ * 2 plane YCbCr MSB aligned ++ * index 0 = Y plane, [15:0] Y:x [10:6] little endian ++ * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [10:6:10:6] little endian ++ */ ++#define DRM_FORMAT_P210 fourcc_code('P', '2', '1', '0') /* 2x1 subsampled Cr:Cb plane, 10 bit per channel */ ++ ++/* ++ * 2 plane YCbCr MSB aligned ++ * index 0 = Y plane, [15:0] Y:x [10:6] little endian ++ * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [10:6:10:6] little endian ++ */ ++#define DRM_FORMAT_P010 fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cr:Cb plane 10 bits per channel */ ++ ++/* ++ * 2 plane YCbCr MSB aligned ++ * index 0 = Y plane, [15:0] Y:x [12:4] little endian ++ * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [12:4:12:4] little endian ++ */ ++#define DRM_FORMAT_P012 fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cr:Cb plane 12 bits per channel */ ++ ++/* ++ * 2 plane YCbCr MSB aligned ++ * index 0 = Y plane, [15:0] Y little endian ++ * index 1 = Cr:Cb plane, [31:0] Cr:Cb [16:16] little endian ++ */ ++#define DRM_FORMAT_P016 fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cr:Cb plane 16 bits per channel */ ++ ++/* 3 plane non-subsampled (444) YCbCr ++ * 16 bits per component, but only 10 bits are used and 6 bits are padded ++ * index 0: Y plane, [15:0] Y:x [10:6] little endian ++ * index 1: Cb plane, [15:0] Cb:x [10:6] little endian ++ * index 2: Cr plane, [15:0] Cr:x [10:6] little endian ++ */ ++#define DRM_FORMAT_Q410 fourcc_code('Q', '4', '1', '0') ++ ++/* 3 plane non-subsampled (444) YCrCb ++ * 16 bits per component, but only 10 bits are used and 6 bits are padded ++ * index 0: Y plane, [15:0] Y:x [10:6] little endian ++ * index 1: Cr plane, [15:0] Cr:x [10:6] little endian ++ * index 2: Cb plane, [15:0] Cb:x [10:6] little endian ++ */ ++#define DRM_FORMAT_Q401 fourcc_code('Q', '4', '0', '1') ++ ++/* ++ * 3 plane YCbCr ++ * index 0: Y plane, [7:0] Y ++ * index 1: Cb plane, [7:0] Cb ++ * index 2: Cr plane, [7:0] Cr ++ * or ++ * index 1: Cr plane, [7:0] Cr ++ * index 2: Cb plane, [7:0] Cb ++ */ ++#define DRM_FORMAT_YUV410 fourcc_code('Y', 'U', 'V', '9') /* 4x4 subsampled Cb (1) and Cr (2) planes */ ++#define DRM_FORMAT_YVU410 fourcc_code('Y', 'V', 'U', '9') /* 4x4 subsampled Cr (1) and Cb (2) planes */ ++#define DRM_FORMAT_YUV411 fourcc_code('Y', 'U', '1', '1') /* 4x1 subsampled Cb (1) and Cr (2) planes */ ++#define DRM_FORMAT_YVU411 fourcc_code('Y', 'V', '1', '1') /* 4x1 subsampled Cr (1) and Cb (2) planes */ ++#define DRM_FORMAT_YUV420 fourcc_code('Y', 'U', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes */ ++#define DRM_FORMAT_YVU420 fourcc_code('Y', 'V', '1', '2') /* 2x2 subsampled Cr (1) and Cb (2) planes */ ++#define DRM_FORMAT_YUV422 fourcc_code('Y', 'U', '1', '6') /* 2x1 subsampled Cb (1) and Cr (2) planes */ ++#define DRM_FORMAT_YVU422 fourcc_code('Y', 'V', '1', '6') /* 2x1 subsampled Cr (1) and Cb (2) planes */ ++#define DRM_FORMAT_YUV444 fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */ ++#define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */ ++ ++ ++/* ++ * Format Modifiers: ++ * ++ * Format modifiers describe, typically, a re-ordering or modification ++ * of the data in a plane of an FB. This can be used to express tiled/ ++ * swizzled formats, or compression, or a combination of the two. ++ * ++ * The upper 8 bits of the format modifier are a vendor-id as assigned ++ * below. The lower 56 bits are assigned as vendor sees fit. ++ */ ++ ++/* Vendor Ids: */ ++#define DRM_FORMAT_MOD_VENDOR_NONE 0 ++#define DRM_FORMAT_MOD_VENDOR_INTEL 0x01 ++#define DRM_FORMAT_MOD_VENDOR_AMD 0x02 ++#define DRM_FORMAT_MOD_VENDOR_NVIDIA 0x03 ++#define DRM_FORMAT_MOD_VENDOR_SAMSUNG 0x04 ++#define DRM_FORMAT_MOD_VENDOR_QCOM 0x05 ++#define DRM_FORMAT_MOD_VENDOR_VIVANTE 0x06 ++#define DRM_FORMAT_MOD_VENDOR_BROADCOM 0x07 ++#define DRM_FORMAT_MOD_VENDOR_ARM 0x08 ++#define DRM_FORMAT_MOD_VENDOR_ALLWINNER 0x09 ++#define DRM_FORMAT_MOD_VENDOR_AMLOGIC 0x0a ++ ++/* add more to the end as needed */ ++ ++#define DRM_FORMAT_RESERVED ((1ULL << 56) - 1) ++ ++#define fourcc_mod_get_vendor(modifier) \ ++ (((modifier) >> 56) & 0xff) ++ ++#define fourcc_mod_is_vendor(modifier, vendor) \ ++ (fourcc_mod_get_vendor(modifier) == DRM_FORMAT_MOD_VENDOR_## vendor) ++ ++#define fourcc_mod_code(vendor, val) \ ++ ((((__u64)DRM_FORMAT_MOD_VENDOR_## vendor) << 56) | ((val) & 0x00ffffffffffffffULL)) ++ ++/* ++ * Format Modifier tokens: ++ * ++ * When adding a new token please document the layout with a code comment, ++ * similar to the fourcc codes above. drm_fourcc.h is considered the ++ * authoritative source for all of these. ++ * ++ * Generic modifier names: ++ * ++ * DRM_FORMAT_MOD_GENERIC_* definitions are used to provide vendor-neutral names ++ * for layouts which are common across multiple vendors. To preserve ++ * compatibility, in cases where a vendor-specific definition already exists and ++ * a generic name for it is desired, the common name is a purely symbolic alias ++ * and must use the same numerical value as the original definition. ++ * ++ * Note that generic names should only be used for modifiers which describe ++ * generic layouts (such as pixel re-ordering), which may have ++ * independently-developed support across multiple vendors. ++ * ++ * In future cases where a generic layout is identified before merging with a ++ * vendor-specific modifier, a new 'GENERIC' vendor or modifier using vendor ++ * 'NONE' could be considered. This should only be for obvious, exceptional ++ * cases to avoid polluting the 'GENERIC' namespace with modifiers which only ++ * apply to a single vendor. ++ * ++ * Generic names should not be used for cases where multiple hardware vendors ++ * have implementations of the same standardised compression scheme (such as ++ * AFBC). In those cases, all implementations should use the same format ++ * modifier(s), reflecting the vendor of the standard. ++ */ ++ ++#define DRM_FORMAT_MOD_GENERIC_16_16_TILE DRM_FORMAT_MOD_SAMSUNG_16_16_TILE ++ ++/* ++ * Invalid Modifier ++ * ++ * This modifier can be used as a sentinel to terminate the format modifiers ++ * list, or to initialize a variable with an invalid modifier. It might also be ++ * used to report an error back to userspace for certain APIs. ++ */ ++#define DRM_FORMAT_MOD_INVALID fourcc_mod_code(NONE, DRM_FORMAT_RESERVED) ++ ++/* ++ * Linear Layout ++ * ++ * Just plain linear layout. Note that this is different from no specifying any ++ * modifier (e.g. not setting DRM_MODE_FB_MODIFIERS in the DRM_ADDFB2 ioctl), ++ * which tells the driver to also take driver-internal information into account ++ * and so might actually result in a tiled framebuffer. ++ */ ++#define DRM_FORMAT_MOD_LINEAR fourcc_mod_code(NONE, 0) ++ ++/* ++ * Deprecated: use DRM_FORMAT_MOD_LINEAR instead ++ * ++ * The "none" format modifier doesn't actually mean that the modifier is ++ * implicit, instead it means that the layout is linear. Whether modifiers are ++ * used is out-of-band information carried in an API-specific way (e.g. in a ++ * flag for drm_mode_fb_cmd2). ++ */ ++#define DRM_FORMAT_MOD_NONE 0 ++ ++/* Intel framebuffer modifiers */ ++ ++/* ++ * Intel X-tiling layout ++ * ++ * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb) ++ * in row-major layout. Within the tile bytes are laid out row-major, with ++ * a platform-dependent stride. On top of that the memory can apply ++ * platform-depending swizzling of some higher address bits into bit6. ++ * ++ * Note that this layout is only accurate on intel gen 8+ or valleyview chipsets. ++ * On earlier platforms the is highly platforms specific and not useful for ++ * cross-driver sharing. It exists since on a given platform it does uniquely ++ * identify the layout in a simple way for i915-specific userspace, which ++ * facilitated conversion of userspace to modifiers. Additionally the exact ++ * format on some really old platforms is not known. ++ */ ++#define I915_FORMAT_MOD_X_TILED fourcc_mod_code(INTEL, 1) ++ ++/* ++ * Intel Y-tiling layout ++ * ++ * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb) ++ * in row-major layout. Within the tile bytes are laid out in OWORD (16 bytes) ++ * chunks column-major, with a platform-dependent height. On top of that the ++ * memory can apply platform-depending swizzling of some higher address bits ++ * into bit6. ++ * ++ * Note that this layout is only accurate on intel gen 8+ or valleyview chipsets. ++ * On earlier platforms the is highly platforms specific and not useful for ++ * cross-driver sharing. It exists since on a given platform it does uniquely ++ * identify the layout in a simple way for i915-specific userspace, which ++ * facilitated conversion of userspace to modifiers. Additionally the exact ++ * format on some really old platforms is not known. ++ */ ++#define I915_FORMAT_MOD_Y_TILED fourcc_mod_code(INTEL, 2) ++ ++/* ++ * Intel Yf-tiling layout ++ * ++ * This is a tiled layout using 4Kb tiles in row-major layout. ++ * Within the tile pixels are laid out in 16 256 byte units / sub-tiles which ++ * are arranged in four groups (two wide, two high) with column-major layout. ++ * Each group therefore consits out of four 256 byte units, which are also laid ++ * out as 2x2 column-major. ++ * 256 byte units are made out of four 64 byte blocks of pixels, producing ++ * either a square block or a 2:1 unit. ++ * 64 byte blocks of pixels contain four pixel rows of 16 bytes, where the width ++ * in pixel depends on the pixel depth. ++ */ ++#define I915_FORMAT_MOD_Yf_TILED fourcc_mod_code(INTEL, 3) ++ ++/* ++ * Intel color control surface (CCS) for render compression ++ * ++ * The framebuffer format must be one of the 8:8:8:8 RGB formats. ++ * The main surface will be plane index 0 and must be Y/Yf-tiled, ++ * the CCS will be plane index 1. ++ * ++ * Each CCS tile matches a 1024x512 pixel area of the main surface. ++ * To match certain aspects of the 3D hardware the CCS is ++ * considered to be made up of normal 128Bx32 Y tiles, Thus ++ * the CCS pitch must be specified in multiples of 128 bytes. ++ * ++ * In reality the CCS tile appears to be a 64Bx64 Y tile, composed ++ * of QWORD (8 bytes) chunks instead of OWORD (16 bytes) chunks. ++ * But that fact is not relevant unless the memory is accessed ++ * directly. ++ */ ++#define I915_FORMAT_MOD_Y_TILED_CCS fourcc_mod_code(INTEL, 4) ++#define I915_FORMAT_MOD_Yf_TILED_CCS fourcc_mod_code(INTEL, 5) ++ ++/* ++ * Intel color control surfaces (CCS) for Gen-12 render compression. ++ * ++ * The main surface is Y-tiled and at plane index 0, the CCS is linear and ++ * at index 1. A 64B CCS cache line corresponds to an area of 4x1 tiles in ++ * main surface. In other words, 4 bits in CCS map to a main surface cache ++ * line pair. The main surface pitch is required to be a multiple of four ++ * Y-tile widths. ++ */ ++#define I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS fourcc_mod_code(INTEL, 6) ++ ++/* ++ * Intel color control surfaces (CCS) for Gen-12 media compression ++ * ++ * The main surface is Y-tiled and at plane index 0, the CCS is linear and ++ * at index 1. A 64B CCS cache line corresponds to an area of 4x1 tiles in ++ * main surface. In other words, 4 bits in CCS map to a main surface cache ++ * line pair. The main surface pitch is required to be a multiple of four ++ * Y-tile widths. For semi-planar formats like NV12, CCS planes follow the ++ * Y and UV planes i.e., planes 0 and 1 are used for Y and UV surfaces, ++ * planes 2 and 3 for the respective CCS. ++ */ ++#define I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS fourcc_mod_code(INTEL, 7) ++ ++/* ++ * Intel Color Control Surface with Clear Color (CCS) for Gen-12 render ++ * compression. ++ * ++ * The main surface is Y-tiled and is at plane index 0 whereas CCS is linear ++ * and at index 1. The clear color is stored at index 2, and the pitch should ++ * be ignored. The clear color structure is 256 bits. The first 128 bits ++ * represents Raw Clear Color Red, Green, Blue and Alpha color each represented ++ * by 32 bits. The raw clear color is consumed by the 3d engine and generates ++ * the converted clear color of size 64 bits. The first 32 bits store the Lower ++ * Converted Clear Color value and the next 32 bits store the Higher Converted ++ * Clear Color value when applicable. The Converted Clear Color values are ++ * consumed by the DE. The last 64 bits are used to store Color Discard Enable ++ * and Depth Clear Value Valid which are ignored by the DE. A CCS cache line ++ * corresponds to an area of 4x1 tiles in the main surface. The main surface ++ * pitch is required to be a multiple of 4 tile widths. ++ */ ++#define I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC fourcc_mod_code(INTEL, 8) ++ ++/* ++ * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks ++ * ++ * Macroblocks are laid in a Z-shape, and each pixel data is following the ++ * standard NV12 style. ++ * As for NV12, an image is the result of two frame buffers: one for Y, ++ * one for the interleaved Cb/Cr components (1/2 the height of the Y buffer). ++ * Alignment requirements are (for each buffer): ++ * - multiple of 128 pixels for the width ++ * - multiple of 32 pixels for the height ++ * ++ * For more information: see https://linuxtv.org/downloads/v4l-dvb-apis/re32.html ++ */ ++#define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1) ++ ++/* ++ * Tiled, 16 (pixels) x 16 (lines) - sized macroblocks ++ * ++ * This is a simple tiled layout using tiles of 16x16 pixels in a row-major ++ * layout. For YCbCr formats Cb/Cr components are taken in such a way that ++ * they correspond to their 16x16 luma block. ++ */ ++#define DRM_FORMAT_MOD_SAMSUNG_16_16_TILE fourcc_mod_code(SAMSUNG, 2) ++ ++/* ++ * Qualcomm Compressed Format ++ * ++ * Refers to a compressed variant of the base format that is compressed. ++ * Implementation may be platform and base-format specific. ++ * ++ * Each macrotile consists of m x n (mostly 4 x 4) tiles. ++ * Pixel data pitch/stride is aligned with macrotile width. ++ * Pixel data height is aligned with macrotile height. ++ * Entire pixel data buffer is aligned with 4k(bytes). ++ */ ++#define DRM_FORMAT_MOD_QCOM_COMPRESSED fourcc_mod_code(QCOM, 1) ++ ++/* Vivante framebuffer modifiers */ ++ ++/* ++ * Vivante 4x4 tiling layout ++ * ++ * This is a simple tiled layout using tiles of 4x4 pixels in a row-major ++ * layout. ++ */ ++#define DRM_FORMAT_MOD_VIVANTE_TILED fourcc_mod_code(VIVANTE, 1) ++ ++/* ++ * Vivante 64x64 super-tiling layout ++ * ++ * This is a tiled layout using 64x64 pixel super-tiles, where each super-tile ++ * contains 8x4 groups of 2x4 tiles of 4x4 pixels (like above) each, all in row- ++ * major layout. ++ * ++ * For more information: see ++ * https://github.com/etnaviv/etna_viv/blob/master/doc/hardware.md#texture-tiling ++ */ ++#define DRM_FORMAT_MOD_VIVANTE_SUPER_TILED fourcc_mod_code(VIVANTE, 2) ++ ++/* ++ * Vivante 4x4 tiling layout for dual-pipe ++ * ++ * Same as the 4x4 tiling layout, except every second 4x4 pixel tile starts at a ++ * different base address. Offsets from the base addresses are therefore halved ++ * compared to the non-split tiled layout. ++ */ ++#define DRM_FORMAT_MOD_VIVANTE_SPLIT_TILED fourcc_mod_code(VIVANTE, 3) ++ ++/* ++ * Vivante 64x64 super-tiling layout for dual-pipe ++ * ++ * Same as the 64x64 super-tiling layout, except every second 4x4 pixel tile ++ * starts at a different base address. Offsets from the base addresses are ++ * therefore halved compared to the non-split super-tiled layout. ++ */ ++#define DRM_FORMAT_MOD_VIVANTE_SPLIT_SUPER_TILED fourcc_mod_code(VIVANTE, 4) ++ ++/* NVIDIA frame buffer modifiers */ ++ ++/* ++ * Tegra Tiled Layout, used by Tegra 2, 3 and 4. ++ * ++ * Pixels are arranged in simple tiles of 16 x 16 bytes. ++ */ ++#define DRM_FORMAT_MOD_NVIDIA_TEGRA_TILED fourcc_mod_code(NVIDIA, 1) ++ ++/* ++ * Generalized Block Linear layout, used by desktop GPUs starting with NV50/G80, ++ * and Tegra GPUs starting with Tegra K1. ++ * ++ * Pixels are arranged in Groups of Bytes (GOBs). GOB size and layout varies ++ * based on the architecture generation. GOBs themselves are then arranged in ++ * 3D blocks, with the block dimensions (in terms of GOBs) always being a power ++ * of two, and hence expressible as their log2 equivalent (E.g., "2" represents ++ * a block depth or height of "4"). ++ * ++ * Chapter 20 "Pixel Memory Formats" of the Tegra X1 TRM describes this format ++ * in full detail. ++ * ++ * Macro ++ * Bits Param Description ++ * ---- ----- ----------------------------------------------------------------- ++ * ++ * 3:0 h log2(height) of each block, in GOBs. Placed here for ++ * compatibility with the existing ++ * DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK()-based modifiers. ++ * ++ * 4:4 - Must be 1, to indicate block-linear layout. Necessary for ++ * compatibility with the existing ++ * DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK()-based modifiers. ++ * ++ * 8:5 - Reserved (To support 3D-surfaces with variable log2(depth) block ++ * size). Must be zero. ++ * ++ * Note there is no log2(width) parameter. Some portions of the ++ * hardware support a block width of two gobs, but it is impractical ++ * to use due to lack of support elsewhere, and has no known ++ * benefits. ++ * ++ * 11:9 - Reserved (To support 2D-array textures with variable array stride ++ * in blocks, specified via log2(tile width in blocks)). Must be ++ * zero. ++ * ++ * 19:12 k Page Kind. This value directly maps to a field in the page ++ * tables of all GPUs >= NV50. It affects the exact layout of bits ++ * in memory and can be derived from the tuple ++ * ++ * (format, GPU model, compression type, samples per pixel) ++ * ++ * Where compression type is defined below. If GPU model were ++ * implied by the format modifier, format, or memory buffer, page ++ * kind would not need to be included in the modifier itself, but ++ * since the modifier should define the layout of the associated ++ * memory buffer independent from any device or other context, it ++ * must be included here. ++ * ++ * 21:20 g GOB Height and Page Kind Generation. The height of a GOB changed ++ * starting with Fermi GPUs. Additionally, the mapping between page ++ * kind and bit layout has changed at various points. ++ * ++ * 0 = Gob Height 8, Fermi - Volta, Tegra K1+ Page Kind mapping ++ * 1 = Gob Height 4, G80 - GT2XX Page Kind mapping ++ * 2 = Gob Height 8, Turing+ Page Kind mapping ++ * 3 = Reserved for future use. ++ * ++ * 22:22 s Sector layout. On Tegra GPUs prior to Xavier, there is a further ++ * bit remapping step that occurs at an even lower level than the ++ * page kind and block linear swizzles. This causes the layout of ++ * surfaces mapped in those SOC's GPUs to be incompatible with the ++ * equivalent mapping on other GPUs in the same system. ++ * ++ * 0 = Tegra K1 - Tegra Parker/TX2 Layout. ++ * 1 = Desktop GPU and Tegra Xavier+ Layout ++ * ++ * 25:23 c Lossless Framebuffer Compression type. ++ * ++ * 0 = none ++ * 1 = ROP/3D, layout 1, exact compression format implied by Page ++ * Kind field ++ * 2 = ROP/3D, layout 2, exact compression format implied by Page ++ * Kind field ++ * 3 = CDE horizontal ++ * 4 = CDE vertical ++ * 5 = Reserved for future use ++ * 6 = Reserved for future use ++ * 7 = Reserved for future use ++ * ++ * 55:25 - Reserved for future use. Must be zero. ++ */ ++#define DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(c, s, g, k, h) \ ++ fourcc_mod_code(NVIDIA, (0x10 | \ ++ ((h) & 0xf) | \ ++ (((k) & 0xff) << 12) | \ ++ (((g) & 0x3) << 20) | \ ++ (((s) & 0x1) << 22) | \ ++ (((c) & 0x7) << 23))) ++ ++/* To grandfather in prior block linear format modifiers to the above layout, ++ * the page kind "0", which corresponds to "pitch/linear" and hence is unusable ++ * with block-linear layouts, is remapped within drivers to the value 0xfe, ++ * which corresponds to the "generic" kind used for simple single-sample ++ * uncompressed color formats on Fermi - Volta GPUs. ++ */ ++static __inline__ __u64 ++drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier) ++{ ++ if (!(modifier & 0x10) || (modifier & (0xff << 12))) ++ return modifier; ++ else ++ return modifier | (0xfe << 12); ++} ++ ++/* ++ * 16Bx2 Block Linear layout, used by Tegra K1 and later ++ * ++ * Pixels are arranged in 64x8 Groups Of Bytes (GOBs). GOBs are then stacked ++ * vertically by a power of 2 (1 to 32 GOBs) to form a block. ++ * ++ * Within a GOB, data is ordered as 16B x 2 lines sectors laid in Z-shape. ++ * ++ * Parameter 'v' is the log2 encoding of the number of GOBs stacked vertically. ++ * Valid values are: ++ * ++ * 0 == ONE_GOB ++ * 1 == TWO_GOBS ++ * 2 == FOUR_GOBS ++ * 3 == EIGHT_GOBS ++ * 4 == SIXTEEN_GOBS ++ * 5 == THIRTYTWO_GOBS ++ * ++ * Chapter 20 "Pixel Memory Formats" of the Tegra X1 TRM describes this format ++ * in full detail. ++ */ ++#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(v) \ ++ DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 0, 0, 0, (v)) ++ ++#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_ONE_GOB \ ++ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(0) ++#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_TWO_GOB \ ++ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(1) ++#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_FOUR_GOB \ ++ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(2) ++#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_EIGHT_GOB \ ++ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(3) ++#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_SIXTEEN_GOB \ ++ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(4) ++#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_THIRTYTWO_GOB \ ++ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(5) ++ ++/* ++ * Some Broadcom modifiers take parameters, for example the number of ++ * vertical lines in the image. Reserve the lower 32 bits for modifier ++ * type, and the next 24 bits for parameters. Top 8 bits are the ++ * vendor code. ++ */ ++#define __fourcc_mod_broadcom_param_shift 8 ++#define __fourcc_mod_broadcom_param_bits 48 ++#define fourcc_mod_broadcom_code(val, params) \ ++ fourcc_mod_code(BROADCOM, ((((__u64)params) << __fourcc_mod_broadcom_param_shift) | val)) ++#define fourcc_mod_broadcom_param(m) \ ++ ((int)(((m) >> __fourcc_mod_broadcom_param_shift) & \ ++ ((1ULL << __fourcc_mod_broadcom_param_bits) - 1))) ++#define fourcc_mod_broadcom_mod(m) \ ++ ((m) & ~(((1ULL << __fourcc_mod_broadcom_param_bits) - 1) << \ ++ __fourcc_mod_broadcom_param_shift)) ++ ++/* ++ * Broadcom VC4 "T" format ++ * ++ * This is the primary layout that the V3D GPU can texture from (it ++ * can't do linear). The T format has: ++ * ++ * - 64b utiles of pixels in a raster-order grid according to cpp. It's 4x4 ++ * pixels at 32 bit depth. ++ * ++ * - 1k subtiles made of a 4x4 raster-order grid of 64b utiles (so usually ++ * 16x16 pixels). ++ * ++ * - 4k tiles made of a 2x2 grid of 1k subtiles (so usually 32x32 pixels). On ++ * even 4k tile rows, they're arranged as (BL, TL, TR, BR), and on odd rows ++ * they're (TR, BR, BL, TL), where bottom left is start of memory. ++ * ++ * - an image made of 4k tiles in rows either left-to-right (even rows of 4k ++ * tiles) or right-to-left (odd rows of 4k tiles). ++ */ ++#define DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED fourcc_mod_code(BROADCOM, 1) ++ ++/* ++ * Broadcom SAND format ++ * ++ * This is the native format that the H.264 codec block uses. For VC4 ++ * HVS, it is only valid for H.264 (NV12/21) and RGBA modes. ++ * ++ * The image can be considered to be split into columns, and the ++ * columns are placed consecutively into memory. The width of those ++ * columns can be either 32, 64, 128, or 256 pixels, but in practice ++ * only 128 pixel columns are used. ++ * ++ * The pitch between the start of each column is set to optimally ++ * switch between SDRAM banks. This is passed as the number of lines ++ * of column width in the modifier (we can't use the stride value due ++ * to various core checks that look at it , so you should set the ++ * stride to width*cpp). ++ * ++ * Note that the column height for this format modifier is the same ++ * for all of the planes, assuming that each column contains both Y ++ * and UV. Some SAND-using hardware stores UV in a separate tiled ++ * image from Y to reduce the column height, which is not supported ++ * with these modifiers. ++ */ ++ ++#define DRM_FORMAT_MOD_BROADCOM_SAND32_COL_HEIGHT(v) \ ++ fourcc_mod_broadcom_code(2, v) ++#define DRM_FORMAT_MOD_BROADCOM_SAND64_COL_HEIGHT(v) \ ++ fourcc_mod_broadcom_code(3, v) ++#define DRM_FORMAT_MOD_BROADCOM_SAND128_COL_HEIGHT(v) \ ++ fourcc_mod_broadcom_code(4, v) ++#define DRM_FORMAT_MOD_BROADCOM_SAND256_COL_HEIGHT(v) \ ++ fourcc_mod_broadcom_code(5, v) ++ ++#define DRM_FORMAT_MOD_BROADCOM_SAND32 \ ++ DRM_FORMAT_MOD_BROADCOM_SAND32_COL_HEIGHT(0) ++#define DRM_FORMAT_MOD_BROADCOM_SAND64 \ ++ DRM_FORMAT_MOD_BROADCOM_SAND64_COL_HEIGHT(0) ++#define DRM_FORMAT_MOD_BROADCOM_SAND128 \ ++ DRM_FORMAT_MOD_BROADCOM_SAND128_COL_HEIGHT(0) ++#define DRM_FORMAT_MOD_BROADCOM_SAND256 \ ++ DRM_FORMAT_MOD_BROADCOM_SAND256_COL_HEIGHT(0) ++ ++/* Broadcom UIF format ++ * ++ * This is the common format for the current Broadcom multimedia ++ * blocks, including V3D 3.x and newer, newer video codecs, and ++ * displays. ++ * ++ * The image consists of utiles (64b blocks), UIF blocks (2x2 utiles), ++ * and macroblocks (4x4 UIF blocks). Those 4x4 UIF block groups are ++ * stored in columns, with padding between the columns to ensure that ++ * moving from one column to the next doesn't hit the same SDRAM page ++ * bank. ++ * ++ * To calculate the padding, it is assumed that each hardware block ++ * and the software driving it knows the platform's SDRAM page size, ++ * number of banks, and XOR address, and that it's identical between ++ * all blocks using the format. This tiling modifier will use XOR as ++ * necessary to reduce the padding. If a hardware block can't do XOR, ++ * the assumption is that a no-XOR tiling modifier will be created. ++ */ ++#define DRM_FORMAT_MOD_BROADCOM_UIF fourcc_mod_code(BROADCOM, 6) ++ ++/* ++ * Arm Framebuffer Compression (AFBC) modifiers ++ * ++ * AFBC is a proprietary lossless image compression protocol and format. ++ * It provides fine-grained random access and minimizes the amount of data ++ * transferred between IP blocks. ++ * ++ * AFBC has several features which may be supported and/or used, which are ++ * represented using bits in the modifier. Not all combinations are valid, ++ * and different devices or use-cases may support different combinations. ++ * ++ * Further information on the use of AFBC modifiers can be found in ++ * Documentation/gpu/afbc.rst ++ */ ++ ++/* ++ * The top 4 bits (out of the 56 bits alloted for specifying vendor specific ++ * modifiers) denote the category for modifiers. Currently we have three ++ * categories of modifiers ie AFBC, MISC and AFRC. We can have a maximum of ++ * sixteen different categories. ++ */ ++#define DRM_FORMAT_MOD_ARM_CODE(__type, __val) \ ++ fourcc_mod_code(ARM, ((__u64)(__type) << 52) | ((__val) & 0x000fffffffffffffULL)) ++ ++#define DRM_FORMAT_MOD_ARM_TYPE_AFBC 0x00 ++#define DRM_FORMAT_MOD_ARM_TYPE_MISC 0x01 ++ ++#define DRM_FORMAT_MOD_ARM_AFBC(__afbc_mode) \ ++ DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_AFBC, __afbc_mode) ++ ++/* ++ * AFBC superblock size ++ * ++ * Indicates the superblock size(s) used for the AFBC buffer. The buffer ++ * size (in pixels) must be aligned to a multiple of the superblock size. ++ * Four lowest significant bits(LSBs) are reserved for block size. ++ * ++ * Where one superblock size is specified, it applies to all planes of the ++ * buffer (e.g. 16x16, 32x8). When multiple superblock sizes are specified, ++ * the first applies to the Luma plane and the second applies to the Chroma ++ * plane(s). e.g. (32x8_64x4 means 32x8 Luma, with 64x4 Chroma). ++ * Multiple superblock sizes are only valid for multi-plane YCbCr formats. ++ */ ++#define AFBC_FORMAT_MOD_BLOCK_SIZE_MASK 0xf ++#define AFBC_FORMAT_MOD_BLOCK_SIZE_16x16 (1ULL) ++#define AFBC_FORMAT_MOD_BLOCK_SIZE_32x8 (2ULL) ++#define AFBC_FORMAT_MOD_BLOCK_SIZE_64x4 (3ULL) ++#define AFBC_FORMAT_MOD_BLOCK_SIZE_32x8_64x4 (4ULL) ++ ++/* ++ * AFBC lossless colorspace transform ++ * ++ * Indicates that the buffer makes use of the AFBC lossless colorspace ++ * transform. ++ */ ++#define AFBC_FORMAT_MOD_YTR (1ULL << 4) ++ ++/* ++ * AFBC block-split ++ * ++ * Indicates that the payload of each superblock is split. The second ++ * half of the payload is positioned at a predefined offset from the start ++ * of the superblock payload. ++ */ ++#define AFBC_FORMAT_MOD_SPLIT (1ULL << 5) ++ ++/* ++ * AFBC sparse layout ++ * ++ * This flag indicates that the payload of each superblock must be stored at a ++ * predefined position relative to the other superblocks in the same AFBC ++ * buffer. This order is the same order used by the header buffer. In this mode ++ * each superblock is given the same amount of space as an uncompressed ++ * superblock of the particular format would require, rounding up to the next ++ * multiple of 128 bytes in size. ++ */ ++#define AFBC_FORMAT_MOD_SPARSE (1ULL << 6) ++ ++/* ++ * AFBC copy-block restrict ++ * ++ * Buffers with this flag must obey the copy-block restriction. The restriction ++ * is such that there are no copy-blocks referring across the border of 8x8 ++ * blocks. For the subsampled data the 8x8 limitation is also subsampled. ++ */ ++#define AFBC_FORMAT_MOD_CBR (1ULL << 7) ++ ++/* ++ * AFBC tiled layout ++ * ++ * The tiled layout groups superblocks in 8x8 or 4x4 tiles, where all ++ * superblocks inside a tile are stored together in memory. 8x8 tiles are used ++ * for pixel formats up to and including 32 bpp while 4x4 tiles are used for ++ * larger bpp formats. The order between the tiles is scan line. ++ * When the tiled layout is used, the buffer size (in pixels) must be aligned ++ * to the tile size. ++ */ ++#define AFBC_FORMAT_MOD_TILED (1ULL << 8) ++ ++/* ++ * AFBC solid color blocks ++ * ++ * Indicates that the buffer makes use of solid-color blocks, whereby bandwidth ++ * can be reduced if a whole superblock is a single color. ++ */ ++#define AFBC_FORMAT_MOD_SC (1ULL << 9) ++ ++/* ++ * AFBC double-buffer ++ * ++ * Indicates that the buffer is allocated in a layout safe for front-buffer ++ * rendering. ++ */ ++#define AFBC_FORMAT_MOD_DB (1ULL << 10) ++ ++/* ++ * AFBC buffer content hints ++ * ++ * Indicates that the buffer includes per-superblock content hints. ++ */ ++#define AFBC_FORMAT_MOD_BCH (1ULL << 11) ++ ++/* AFBC uncompressed storage mode ++ * ++ * Indicates that the buffer is using AFBC uncompressed storage mode. ++ * In this mode all superblock payloads in the buffer use the uncompressed ++ * storage mode, which is usually only used for data which cannot be compressed. ++ * The buffer layout is the same as for AFBC buffers without USM set, this only ++ * affects the storage mode of the individual superblocks. Note that even a ++ * buffer without USM set may use uncompressed storage mode for some or all ++ * superblocks, USM just guarantees it for all. ++ */ ++#define AFBC_FORMAT_MOD_USM (1ULL << 12) ++ ++/* ++ * Arm Fixed-Rate Compression (AFRC) modifiers ++ * ++ * AFRC is a proprietary fixed rate image compression protocol and format, ++ * designed to provide guaranteed bandwidth and memory footprint ++ * reductions in graphics and media use-cases. ++ * ++ * AFRC buffers consist of one or more planes, with the same components ++ * and meaning as an uncompressed buffer using the same pixel format. ++ * ++ * Within each plane, the pixel/luma/chroma values are grouped into ++ * "coding unit" blocks which are individually compressed to a ++ * fixed size (in bytes). All coding units within a given plane of a buffer ++ * store the same number of values, and have the same compressed size. ++ * ++ * The coding unit size is configurable, allowing different rates of compression. ++ * ++ * The start of each AFRC buffer plane must be aligned to an alignment granule which ++ * depends on the coding unit size. ++ * ++ * Coding Unit Size Plane Alignment ++ * ---------------- --------------- ++ * 16 bytes 1024 bytes ++ * 24 bytes 512 bytes ++ * 32 bytes 2048 bytes ++ * ++ * Coding units are grouped into paging tiles. AFRC buffer dimensions must be aligned ++ * to a multiple of the paging tile dimensions. ++ * The dimensions of each paging tile depend on whether the buffer is optimised for ++ * scanline (SCAN layout) or rotated (ROT layout) access. ++ * ++ * Layout Paging Tile Width Paging Tile Height ++ * ------ ----------------- ------------------ ++ * SCAN 16 coding units 4 coding units ++ * ROT 8 coding units 8 coding units ++ * ++ * The dimensions of each coding unit depend on the number of components ++ * in the compressed plane and whether the buffer is optimised for ++ * scanline (SCAN layout) or rotated (ROT layout) access. ++ * ++ * Number of Components in Plane Layout Coding Unit Width Coding Unit Height ++ * ----------------------------- --------- ----------------- ------------------ ++ * 1 SCAN 16 samples 4 samples ++ * Example: 16x4 luma samples in a 'Y' plane ++ * 16x4 chroma 'V' values, in the 'V' plane of a fully-planar YUV buffer ++ * ----------------------------- --------- ----------------- ------------------ ++ * 1 ROT 8 samples 8 samples ++ * Example: 8x8 luma samples in a 'Y' plane ++ * 8x8 chroma 'V' values, in the 'V' plane of a fully-planar YUV buffer ++ * ----------------------------- --------- ----------------- ------------------ ++ * 2 DONT CARE 8 samples 4 samples ++ * Example: 8x4 chroma pairs in the 'UV' plane of a semi-planar YUV buffer ++ * ----------------------------- --------- ----------------- ------------------ ++ * 3 DONT CARE 4 samples 4 samples ++ * Example: 4x4 pixels in an RGB buffer without alpha ++ * ----------------------------- --------- ----------------- ------------------ ++ * 4 DONT CARE 4 samples 4 samples ++ * Example: 4x4 pixels in an RGB buffer with alpha ++ */ ++ ++#define DRM_FORMAT_MOD_ARM_TYPE_AFRC 0x02 ++ ++#define DRM_FORMAT_MOD_ARM_AFRC(__afrc_mode) \ ++ DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_AFRC, __afrc_mode) ++ ++/* ++ * AFRC coding unit size modifier. ++ * ++ * Indicates the number of bytes used to store each compressed coding unit for ++ * one or more planes in an AFRC encoded buffer. The coding unit size for chrominance ++ * is the same for both Cb and Cr, which may be stored in separate planes. ++ * ++ * AFRC_FORMAT_MOD_CU_SIZE_P0 indicates the number of bytes used to store ++ * each compressed coding unit in the first plane of the buffer. For RGBA buffers ++ * this is the only plane, while for semi-planar and fully-planar YUV buffers, ++ * this corresponds to the luma plane. ++ * ++ * AFRC_FORMAT_MOD_CU_SIZE_P12 indicates the number of bytes used to store ++ * each compressed coding unit in the second and third planes in the buffer. ++ * For semi-planar and fully-planar YUV buffers, this corresponds to the chroma plane(s). ++ * ++ * For single-plane buffers, AFRC_FORMAT_MOD_CU_SIZE_P0 must be specified ++ * and AFRC_FORMAT_MOD_CU_SIZE_P12 must be zero. ++ * For semi-planar and fully-planar buffers, both AFRC_FORMAT_MOD_CU_SIZE_P0 and ++ * AFRC_FORMAT_MOD_CU_SIZE_P12 must be specified. ++ */ ++#define AFRC_FORMAT_MOD_CU_SIZE_MASK 0xf ++#define AFRC_FORMAT_MOD_CU_SIZE_16 (1ULL) ++#define AFRC_FORMAT_MOD_CU_SIZE_24 (2ULL) ++#define AFRC_FORMAT_MOD_CU_SIZE_32 (3ULL) ++ ++#define AFRC_FORMAT_MOD_CU_SIZE_P0(__afrc_cu_size) (__afrc_cu_size) ++#define AFRC_FORMAT_MOD_CU_SIZE_P12(__afrc_cu_size) ((__afrc_cu_size) << 4) ++ ++/* ++ * AFRC scanline memory layout. ++ * ++ * Indicates if the buffer uses the scanline-optimised layout ++ * for an AFRC encoded buffer, otherwise, it uses the rotation-optimised layout. ++ * The memory layout is the same for all planes. ++ */ ++#define AFRC_FORMAT_MOD_LAYOUT_SCAN (1ULL << 8) ++ ++/* ++ * Arm 16x16 Block U-Interleaved modifier ++ * ++ * This is used by Arm Mali Utgard and Midgard GPUs. It divides the image ++ * into 16x16 pixel blocks. Blocks are stored linearly in order, but pixels ++ * in the block are reordered. ++ */ ++#define DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED \ ++ DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_MISC, 1ULL) ++ ++/* ++ * Allwinner tiled modifier ++ * ++ * This tiling mode is implemented by the VPU found on all Allwinner platforms, ++ * codenamed sunxi. It is associated with a YUV format that uses either 2 or 3 ++ * planes. ++ * ++ * With this tiling, the luminance samples are disposed in tiles representing ++ * 32x32 pixels and the chrominance samples in tiles representing 32x64 pixels. ++ * The pixel order in each tile is linear and the tiles are disposed linearly, ++ * both in row-major order. ++ */ ++#define DRM_FORMAT_MOD_ALLWINNER_TILED fourcc_mod_code(ALLWINNER, 1) ++ ++/* ++ * Amlogic Video Framebuffer Compression modifiers ++ * ++ * Amlogic uses a proprietary lossless image compression protocol and format ++ * for their hardware video codec accelerators, either video decoders or ++ * video input encoders. ++ * ++ * It considerably reduces memory bandwidth while writing and reading ++ * frames in memory. ++ * ++ * The underlying storage is considered to be 3 components, 8bit or 10-bit ++ * per component YCbCr 420, single plane : ++ * - DRM_FORMAT_YUV420_8BIT ++ * - DRM_FORMAT_YUV420_10BIT ++ * ++ * The first 8 bits of the mode defines the layout, then the following 8 bits ++ * defines the options changing the layout. ++ * ++ * Not all combinations are valid, and different SoCs may support different ++ * combinations of layout and options. ++ */ ++#define __fourcc_mod_amlogic_layout_mask 0xff ++#define __fourcc_mod_amlogic_options_shift 8 ++#define __fourcc_mod_amlogic_options_mask 0xff ++ ++#define DRM_FORMAT_MOD_AMLOGIC_FBC(__layout, __options) \ ++ fourcc_mod_code(AMLOGIC, \ ++ ((__layout) & __fourcc_mod_amlogic_layout_mask) | \ ++ (((__options) & __fourcc_mod_amlogic_options_mask) \ ++ << __fourcc_mod_amlogic_options_shift)) ++ ++/* Amlogic FBC Layouts */ ++ ++/* ++ * Amlogic FBC Basic Layout ++ * ++ * The basic layout is composed of: ++ * - a body content organized in 64x32 superblocks with 4096 bytes per ++ * superblock in default mode. ++ * - a 32 bytes per 128x64 header block ++ * ++ * This layout is transferrable between Amlogic SoCs supporting this modifier. ++ */ ++#define AMLOGIC_FBC_LAYOUT_BASIC (1ULL) ++ ++/* ++ * Amlogic FBC Scatter Memory layout ++ * ++ * Indicates the header contains IOMMU references to the compressed ++ * frames content to optimize memory access and layout. ++ * ++ * In this mode, only the header memory address is needed, thus the ++ * content memory organization is tied to the current producer ++ * execution and cannot be saved/dumped neither transferrable between ++ * Amlogic SoCs supporting this modifier. ++ * ++ * Due to the nature of the layout, these buffers are not expected to ++ * be accessible by the user-space clients, but only accessible by the ++ * hardware producers and consumers. ++ * ++ * The user-space clients should expect a failure while trying to mmap ++ * the DMA-BUF handle returned by the producer. ++ */ ++#define AMLOGIC_FBC_LAYOUT_SCATTER (2ULL) ++ ++/* Amlogic FBC Layout Options Bit Mask */ ++ ++/* ++ * Amlogic FBC Memory Saving mode ++ * ++ * Indicates the storage is packed when pixel size is multiple of word ++ * boudaries, i.e. 8bit should be stored in this mode to save allocation ++ * memory. ++ * ++ * This mode reduces body layout to 3072 bytes per 64x32 superblock with ++ * the basic layout and 3200 bytes per 64x32 superblock combined with ++ * the scatter layout. ++ */ ++#define AMLOGIC_FBC_OPTION_MEM_SAVING (1ULL << 0) ++ ++/* ++ * AMD modifiers ++ * ++ * Memory layout: ++ * ++ * without DCC: ++ * - main surface ++ * ++ * with DCC & without DCC_RETILE: ++ * - main surface in plane 0 ++ * - DCC surface in plane 1 (RB-aligned, pipe-aligned if DCC_PIPE_ALIGN is set) ++ * ++ * with DCC & DCC_RETILE: ++ * - main surface in plane 0 ++ * - displayable DCC surface in plane 1 (not RB-aligned & not pipe-aligned) ++ * - pipe-aligned DCC surface in plane 2 (RB-aligned & pipe-aligned) ++ * ++ * For multi-plane formats the above surfaces get merged into one plane for ++ * each format plane, based on the required alignment only. ++ * ++ * Bits Parameter Notes ++ * ----- ------------------------ --------------------------------------------- ++ * ++ * 7:0 TILE_VERSION Values are AMD_FMT_MOD_TILE_VER_* ++ * 12:8 TILE Values are AMD_FMT_MOD_TILE__* ++ * 13 DCC ++ * 14 DCC_RETILE ++ * 15 DCC_PIPE_ALIGN ++ * 16 DCC_INDEPENDENT_64B ++ * 17 DCC_INDEPENDENT_128B ++ * 19:18 DCC_MAX_COMPRESSED_BLOCK Values are AMD_FMT_MOD_DCC_BLOCK_* ++ * 20 DCC_CONSTANT_ENCODE ++ * 23:21 PIPE_XOR_BITS Only for some chips ++ * 26:24 BANK_XOR_BITS Only for some chips ++ * 29:27 PACKERS Only for some chips ++ * 32:30 RB Only for some chips ++ * 35:33 PIPE Only for some chips ++ * 55:36 - Reserved for future use, must be zero ++ */ ++#define AMD_FMT_MOD fourcc_mod_code(AMD, 0) ++ ++#define IS_AMD_FMT_MOD(val) (((val) >> 56) == DRM_FORMAT_MOD_VENDOR_AMD) ++ ++/* Reserve 0 for GFX8 and older */ ++#define AMD_FMT_MOD_TILE_VER_GFX9 1 ++#define AMD_FMT_MOD_TILE_VER_GFX10 2 ++#define AMD_FMT_MOD_TILE_VER_GFX10_RBPLUS 3 ++ ++/* ++ * 64K_S is the same for GFX9/GFX10/GFX10_RBPLUS and hence has GFX9 as canonical ++ * version. ++ */ ++#define AMD_FMT_MOD_TILE_GFX9_64K_S 9 ++ ++/* ++ * 64K_D for non-32 bpp is the same for GFX9/GFX10/GFX10_RBPLUS and hence has ++ * GFX9 as canonical version. ++ */ ++#define AMD_FMT_MOD_TILE_GFX9_64K_D 10 ++#define AMD_FMT_MOD_TILE_GFX9_64K_S_X 25 ++#define AMD_FMT_MOD_TILE_GFX9_64K_D_X 26 ++#define AMD_FMT_MOD_TILE_GFX9_64K_R_X 27 ++ ++#define AMD_FMT_MOD_DCC_BLOCK_64B 0 ++#define AMD_FMT_MOD_DCC_BLOCK_128B 1 ++#define AMD_FMT_MOD_DCC_BLOCK_256B 2 ++ ++#define AMD_FMT_MOD_TILE_VERSION_SHIFT 0 ++#define AMD_FMT_MOD_TILE_VERSION_MASK 0xFF ++#define AMD_FMT_MOD_TILE_SHIFT 8 ++#define AMD_FMT_MOD_TILE_MASK 0x1F ++ ++/* Whether DCC compression is enabled. */ ++#define AMD_FMT_MOD_DCC_SHIFT 13 ++#define AMD_FMT_MOD_DCC_MASK 0x1 ++ ++/* ++ * Whether to include two DCC surfaces, one which is rb & pipe aligned, and ++ * one which is not-aligned. ++ */ ++#define AMD_FMT_MOD_DCC_RETILE_SHIFT 14 ++#define AMD_FMT_MOD_DCC_RETILE_MASK 0x1 ++ ++/* Only set if DCC_RETILE = false */ ++#define AMD_FMT_MOD_DCC_PIPE_ALIGN_SHIFT 15 ++#define AMD_FMT_MOD_DCC_PIPE_ALIGN_MASK 0x1 ++ ++#define AMD_FMT_MOD_DCC_INDEPENDENT_64B_SHIFT 16 ++#define AMD_FMT_MOD_DCC_INDEPENDENT_64B_MASK 0x1 ++#define AMD_FMT_MOD_DCC_INDEPENDENT_128B_SHIFT 17 ++#define AMD_FMT_MOD_DCC_INDEPENDENT_128B_MASK 0x1 ++#define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_SHIFT 18 ++#define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_MASK 0x3 ++ ++/* ++ * DCC supports embedding some clear colors directly in the DCC surface. ++ * However, on older GPUs the rendering HW ignores the embedded clear color ++ * and prefers the driver provided color. This necessitates doing a fastclear ++ * eliminate operation before a process transfers control. ++ * ++ * If this bit is set that means the fastclear eliminate is not needed for these ++ * embeddable colors. ++ */ ++#define AMD_FMT_MOD_DCC_CONSTANT_ENCODE_SHIFT 20 ++#define AMD_FMT_MOD_DCC_CONSTANT_ENCODE_MASK 0x1 ++ ++/* ++ * The below fields are for accounting for per GPU differences. These are only ++ * relevant for GFX9 and later and if the tile field is *_X/_T. ++ * ++ * PIPE_XOR_BITS = always needed ++ * BANK_XOR_BITS = only for TILE_VER_GFX9 ++ * PACKERS = only for TILE_VER_GFX10_RBPLUS ++ * RB = only for TILE_VER_GFX9 & DCC ++ * PIPE = only for TILE_VER_GFX9 & DCC & (DCC_RETILE | DCC_PIPE_ALIGN) ++ */ ++#define AMD_FMT_MOD_PIPE_XOR_BITS_SHIFT 21 ++#define AMD_FMT_MOD_PIPE_XOR_BITS_MASK 0x7 ++#define AMD_FMT_MOD_BANK_XOR_BITS_SHIFT 24 ++#define AMD_FMT_MOD_BANK_XOR_BITS_MASK 0x7 ++#define AMD_FMT_MOD_PACKERS_SHIFT 27 ++#define AMD_FMT_MOD_PACKERS_MASK 0x7 ++#define AMD_FMT_MOD_RB_SHIFT 30 ++#define AMD_FMT_MOD_RB_MASK 0x7 ++#define AMD_FMT_MOD_PIPE_SHIFT 33 ++#define AMD_FMT_MOD_PIPE_MASK 0x7 ++ ++#define AMD_FMT_MOD_SET(field, value) \ ++ ((uint64_t)(value) << AMD_FMT_MOD_##field##_SHIFT) ++#define AMD_FMT_MOD_GET(field, value) \ ++ (((value) >> AMD_FMT_MOD_##field##_SHIFT) & AMD_FMT_MOD_##field##_MASK) ++#define AMD_FMT_MOD_CLEAR(field) \ ++ (~((uint64_t)AMD_FMT_MOD_##field##_MASK << AMD_FMT_MOD_##field##_SHIFT)) ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif /* DRM_FOURCC_H */ +diff -up firefox-103.0/third_party/drm/drm/drm.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/drm/drm/drm.h +--- firefox-103.0/third_party/drm/drm/drm.h.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.427095302 +0200 ++++ firefox-103.0/third_party/drm/drm/drm.h 2022-07-26 16:30:19.427095302 +0200 +@@ -0,0 +1,1193 @@ ++/* ++ * Header for the Direct Rendering Manager ++ * ++ * Author: Rickard E. (Rik) Faith ++ * ++ * Acknowledgments: ++ * Dec 1999, Richard Henderson , move to generic cmpxchg. ++ */ ++ ++/* ++ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. ++ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. ++ * All rights reserved. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++#ifndef _DRM_H_ ++#define _DRM_H_ ++ ++#if defined(__linux__) ++ ++#include ++#include ++typedef unsigned int drm_handle_t; ++ ++#else /* One of the BSDs */ ++ ++#include ++#include ++#include ++typedef int8_t __s8; ++typedef uint8_t __u8; ++typedef int16_t __s16; ++typedef uint16_t __u16; ++typedef int32_t __s32; ++typedef uint32_t __u32; ++typedef int64_t __s64; ++typedef uint64_t __u64; ++typedef size_t __kernel_size_t; ++typedef unsigned long drm_handle_t; ++ ++#endif ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */ ++#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */ ++#define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */ ++#define DRM_RAM_PERCENT 10 /**< How much system ram can we lock? */ ++ ++#define _DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */ ++#define _DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */ ++#define _DRM_LOCK_IS_HELD(lock) ((lock) & _DRM_LOCK_HELD) ++#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT) ++#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) ++ ++typedef unsigned int drm_context_t; ++typedef unsigned int drm_drawable_t; ++typedef unsigned int drm_magic_t; ++ ++/* ++ * Cliprect. ++ * ++ * \warning: If you change this structure, make sure you change ++ * XF86DRIClipRectRec in the server as well ++ * ++ * \note KW: Actually it's illegal to change either for ++ * backwards-compatibility reasons. ++ */ ++struct drm_clip_rect { ++ unsigned short x1; ++ unsigned short y1; ++ unsigned short x2; ++ unsigned short y2; ++}; ++ ++/* ++ * Drawable information. ++ */ ++struct drm_drawable_info { ++ unsigned int num_rects; ++ struct drm_clip_rect *rects; ++}; ++ ++/* ++ * Texture region, ++ */ ++struct drm_tex_region { ++ unsigned char next; ++ unsigned char prev; ++ unsigned char in_use; ++ unsigned char padding; ++ unsigned int age; ++}; ++ ++/* ++ * Hardware lock. ++ * ++ * The lock structure is a simple cache-line aligned integer. To avoid ++ * processor bus contention on a multiprocessor system, there should not be any ++ * other data stored in the same cache line. ++ */ ++struct drm_hw_lock { ++ __volatile__ unsigned int lock; /**< lock variable */ ++ char padding[60]; /**< Pad to cache line */ ++}; ++ ++/* ++ * DRM_IOCTL_VERSION ioctl argument type. ++ * ++ * \sa drmGetVersion(). ++ */ ++struct drm_version { ++ int version_major; /**< Major version */ ++ int version_minor; /**< Minor version */ ++ int version_patchlevel; /**< Patch level */ ++ __kernel_size_t name_len; /**< Length of name buffer */ ++ char *name; /**< Name of driver */ ++ __kernel_size_t date_len; /**< Length of date buffer */ ++ char *date; /**< User-space buffer to hold date */ ++ __kernel_size_t desc_len; /**< Length of desc buffer */ ++ char *desc; /**< User-space buffer to hold desc */ ++}; ++ ++/* ++ * DRM_IOCTL_GET_UNIQUE ioctl argument type. ++ * ++ * \sa drmGetBusid() and drmSetBusId(). ++ */ ++struct drm_unique { ++ __kernel_size_t unique_len; /**< Length of unique */ ++ char *unique; /**< Unique name for driver instantiation */ ++}; ++ ++struct drm_list { ++ int count; /**< Length of user-space structures */ ++ struct drm_version *version; ++}; ++ ++struct drm_block { ++ int unused; ++}; ++ ++/* ++ * DRM_IOCTL_CONTROL ioctl argument type. ++ * ++ * \sa drmCtlInstHandler() and drmCtlUninstHandler(). ++ */ ++struct drm_control { ++ enum { ++ DRM_ADD_COMMAND, ++ DRM_RM_COMMAND, ++ DRM_INST_HANDLER, ++ DRM_UNINST_HANDLER ++ } func; ++ int irq; ++}; ++ ++/* ++ * Type of memory to map. ++ */ ++enum drm_map_type { ++ _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */ ++ _DRM_REGISTERS = 1, /**< no caching, no core dump */ ++ _DRM_SHM = 2, /**< shared, cached */ ++ _DRM_AGP = 3, /**< AGP/GART */ ++ _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */ ++ _DRM_CONSISTENT = 5 /**< Consistent memory for PCI DMA */ ++}; ++ ++/* ++ * Memory mapping flags. ++ */ ++enum drm_map_flags { ++ _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */ ++ _DRM_READ_ONLY = 0x02, ++ _DRM_LOCKED = 0x04, /**< shared, cached, locked */ ++ _DRM_KERNEL = 0x08, /**< kernel requires access */ ++ _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */ ++ _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */ ++ _DRM_REMOVABLE = 0x40, /**< Removable mapping */ ++ _DRM_DRIVER = 0x80 /**< Managed by driver */ ++}; ++ ++struct drm_ctx_priv_map { ++ unsigned int ctx_id; /**< Context requesting private mapping */ ++ void *handle; /**< Handle of map */ ++}; ++ ++/* ++ * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls ++ * argument type. ++ * ++ * \sa drmAddMap(). ++ */ ++struct drm_map { ++ unsigned long offset; /**< Requested physical address (0 for SAREA)*/ ++ unsigned long size; /**< Requested physical size (bytes) */ ++ enum drm_map_type type; /**< Type of memory to map */ ++ enum drm_map_flags flags; /**< Flags */ ++ void *handle; /**< User-space: "Handle" to pass to mmap() */ ++ /**< Kernel-space: kernel-virtual address */ ++ int mtrr; /**< MTRR slot used */ ++ /* Private data */ ++}; ++ ++/* ++ * DRM_IOCTL_GET_CLIENT ioctl argument type. ++ */ ++struct drm_client { ++ int idx; /**< Which client desired? */ ++ int auth; /**< Is client authenticated? */ ++ unsigned long pid; /**< Process ID */ ++ unsigned long uid; /**< User ID */ ++ unsigned long magic; /**< Magic */ ++ unsigned long iocs; /**< Ioctl count */ ++}; ++ ++enum drm_stat_type { ++ _DRM_STAT_LOCK, ++ _DRM_STAT_OPENS, ++ _DRM_STAT_CLOSES, ++ _DRM_STAT_IOCTLS, ++ _DRM_STAT_LOCKS, ++ _DRM_STAT_UNLOCKS, ++ _DRM_STAT_VALUE, /**< Generic value */ ++ _DRM_STAT_BYTE, /**< Generic byte counter (1024bytes/K) */ ++ _DRM_STAT_COUNT, /**< Generic non-byte counter (1000/k) */ ++ ++ _DRM_STAT_IRQ, /**< IRQ */ ++ _DRM_STAT_PRIMARY, /**< Primary DMA bytes */ ++ _DRM_STAT_SECONDARY, /**< Secondary DMA bytes */ ++ _DRM_STAT_DMA, /**< DMA */ ++ _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */ ++ _DRM_STAT_MISSED /**< Missed DMA opportunity */ ++ /* Add to the *END* of the list */ ++}; ++ ++/* ++ * DRM_IOCTL_GET_STATS ioctl argument type. ++ */ ++struct drm_stats { ++ unsigned long count; ++ struct { ++ unsigned long value; ++ enum drm_stat_type type; ++ } data[15]; ++}; ++ ++/* ++ * Hardware locking flags. ++ */ ++enum drm_lock_flags { ++ _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */ ++ _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */ ++ _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */ ++ _DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */ ++ /* These *HALT* flags aren't supported yet ++ -- they will be used to support the ++ full-screen DGA-like mode. */ ++ _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */ ++ _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ ++}; ++ ++/* ++ * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type. ++ * ++ * \sa drmGetLock() and drmUnlock(). ++ */ ++struct drm_lock { ++ int context; ++ enum drm_lock_flags flags; ++}; ++ ++/* ++ * DMA flags ++ * ++ * \warning ++ * These values \e must match xf86drm.h. ++ * ++ * \sa drm_dma. ++ */ ++enum drm_dma_flags { ++ /* Flags for DMA buffer dispatch */ ++ _DRM_DMA_BLOCK = 0x01, /**< ++ * Block until buffer dispatched. ++ * ++ * \note The buffer may not yet have ++ * been processed by the hardware -- ++ * getting a hardware lock with the ++ * hardware quiescent will ensure ++ * that the buffer has been ++ * processed. ++ */ ++ _DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */ ++ _DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */ ++ ++ /* Flags for DMA buffer request */ ++ _DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */ ++ _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */ ++ _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ ++}; ++ ++/* ++ * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type. ++ * ++ * \sa drmAddBufs(). ++ */ ++struct drm_buf_desc { ++ int count; /**< Number of buffers of this size */ ++ int size; /**< Size in bytes */ ++ int low_mark; /**< Low water mark */ ++ int high_mark; /**< High water mark */ ++ enum { ++ _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */ ++ _DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */ ++ _DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */ ++ _DRM_FB_BUFFER = 0x08, /**< Buffer is in frame buffer */ ++ _DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */ ++ } flags; ++ unsigned long agp_start; /**< ++ * Start address of where the AGP buffers are ++ * in the AGP aperture ++ */ ++}; ++ ++/* ++ * DRM_IOCTL_INFO_BUFS ioctl argument type. ++ */ ++struct drm_buf_info { ++ int count; /**< Entries in list */ ++ struct drm_buf_desc *list; ++}; ++ ++/* ++ * DRM_IOCTL_FREE_BUFS ioctl argument type. ++ */ ++struct drm_buf_free { ++ int count; ++ int *list; ++}; ++ ++/* ++ * Buffer information ++ * ++ * \sa drm_buf_map. ++ */ ++struct drm_buf_pub { ++ int idx; /**< Index into the master buffer list */ ++ int total; /**< Buffer size */ ++ int used; /**< Amount of buffer in use (for DMA) */ ++ void *address; /**< Address of buffer */ ++}; ++ ++/* ++ * DRM_IOCTL_MAP_BUFS ioctl argument type. ++ */ ++struct drm_buf_map { ++ int count; /**< Length of the buffer list */ ++#ifdef __cplusplus ++ void *virt; ++#else ++ void *virtual; /**< Mmap'd area in user-virtual */ ++#endif ++ struct drm_buf_pub *list; /**< Buffer information */ ++}; ++ ++/* ++ * DRM_IOCTL_DMA ioctl argument type. ++ * ++ * Indices here refer to the offset into the buffer list in drm_buf_get. ++ * ++ * \sa drmDMA(). ++ */ ++struct drm_dma { ++ int context; /**< Context handle */ ++ int send_count; /**< Number of buffers to send */ ++ int *send_indices; /**< List of handles to buffers */ ++ int *send_sizes; /**< Lengths of data to send */ ++ enum drm_dma_flags flags; /**< Flags */ ++ int request_count; /**< Number of buffers requested */ ++ int request_size; /**< Desired size for buffers */ ++ int *request_indices; /**< Buffer information */ ++ int *request_sizes; ++ int granted_count; /**< Number of buffers granted */ ++}; ++ ++enum drm_ctx_flags { ++ _DRM_CONTEXT_PRESERVED = 0x01, ++ _DRM_CONTEXT_2DONLY = 0x02 ++}; ++ ++/* ++ * DRM_IOCTL_ADD_CTX ioctl argument type. ++ * ++ * \sa drmCreateContext() and drmDestroyContext(). ++ */ ++struct drm_ctx { ++ drm_context_t handle; ++ enum drm_ctx_flags flags; ++}; ++ ++/* ++ * DRM_IOCTL_RES_CTX ioctl argument type. ++ */ ++struct drm_ctx_res { ++ int count; ++ struct drm_ctx *contexts; ++}; ++ ++/* ++ * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type. ++ */ ++struct drm_draw { ++ drm_drawable_t handle; ++}; ++ ++/* ++ * DRM_IOCTL_UPDATE_DRAW ioctl argument type. ++ */ ++typedef enum { ++ DRM_DRAWABLE_CLIPRECTS ++} drm_drawable_info_type_t; ++ ++struct drm_update_draw { ++ drm_drawable_t handle; ++ unsigned int type; ++ unsigned int num; ++ unsigned long long data; ++}; ++ ++/* ++ * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type. ++ */ ++struct drm_auth { ++ drm_magic_t magic; ++}; ++ ++/* ++ * DRM_IOCTL_IRQ_BUSID ioctl argument type. ++ * ++ * \sa drmGetInterruptFromBusID(). ++ */ ++struct drm_irq_busid { ++ int irq; /**< IRQ number */ ++ int busnum; /**< bus number */ ++ int devnum; /**< device number */ ++ int funcnum; /**< function number */ ++}; ++ ++enum drm_vblank_seq_type { ++ _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ ++ _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ ++ /* bits 1-6 are reserved for high crtcs */ ++ _DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e, ++ _DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */ ++ _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ ++ _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ ++ _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ ++ _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking, unsupported */ ++}; ++#define _DRM_VBLANK_HIGH_CRTC_SHIFT 1 ++ ++#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE) ++#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \ ++ _DRM_VBLANK_SECONDARY | _DRM_VBLANK_NEXTONMISS) ++ ++struct drm_wait_vblank_request { ++ enum drm_vblank_seq_type type; ++ unsigned int sequence; ++ unsigned long signal; ++}; ++ ++struct drm_wait_vblank_reply { ++ enum drm_vblank_seq_type type; ++ unsigned int sequence; ++ long tval_sec; ++ long tval_usec; ++}; ++ ++/* ++ * DRM_IOCTL_WAIT_VBLANK ioctl argument type. ++ * ++ * \sa drmWaitVBlank(). ++ */ ++union drm_wait_vblank { ++ struct drm_wait_vblank_request request; ++ struct drm_wait_vblank_reply reply; ++}; ++ ++#define _DRM_PRE_MODESET 1 ++#define _DRM_POST_MODESET 2 ++ ++/* ++ * DRM_IOCTL_MODESET_CTL ioctl argument type ++ * ++ * \sa drmModesetCtl(). ++ */ ++struct drm_modeset_ctl { ++ __u32 crtc; ++ __u32 cmd; ++}; ++ ++/* ++ * DRM_IOCTL_AGP_ENABLE ioctl argument type. ++ * ++ * \sa drmAgpEnable(). ++ */ ++struct drm_agp_mode { ++ unsigned long mode; /**< AGP mode */ ++}; ++ ++/* ++ * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type. ++ * ++ * \sa drmAgpAlloc() and drmAgpFree(). ++ */ ++struct drm_agp_buffer { ++ unsigned long size; /**< In bytes -- will round to page boundary */ ++ unsigned long handle; /**< Used for binding / unbinding */ ++ unsigned long type; /**< Type of memory to allocate */ ++ unsigned long physical; /**< Physical used by i810 */ ++}; ++ ++/* ++ * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type. ++ * ++ * \sa drmAgpBind() and drmAgpUnbind(). ++ */ ++struct drm_agp_binding { ++ unsigned long handle; /**< From drm_agp_buffer */ ++ unsigned long offset; /**< In bytes -- will round to page boundary */ ++}; ++ ++/* ++ * DRM_IOCTL_AGP_INFO ioctl argument type. ++ * ++ * \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(), ++ * drmAgpBase(), drmAgpSize(), drmAgpMemoryUsed(), drmAgpMemoryAvail(), ++ * drmAgpVendorId() and drmAgpDeviceId(). ++ */ ++struct drm_agp_info { ++ int agp_version_major; ++ int agp_version_minor; ++ unsigned long mode; ++ unsigned long aperture_base; /* physical address */ ++ unsigned long aperture_size; /* bytes */ ++ unsigned long memory_allowed; /* bytes */ ++ unsigned long memory_used; ++ ++ /* PCI information */ ++ unsigned short id_vendor; ++ unsigned short id_device; ++}; ++ ++/* ++ * DRM_IOCTL_SG_ALLOC ioctl argument type. ++ */ ++struct drm_scatter_gather { ++ unsigned long size; /**< In bytes -- will round to page boundary */ ++ unsigned long handle; /**< Used for mapping / unmapping */ ++}; ++ ++/* ++ * DRM_IOCTL_SET_VERSION ioctl argument type. ++ */ ++struct drm_set_version { ++ int drm_di_major; ++ int drm_di_minor; ++ int drm_dd_major; ++ int drm_dd_minor; ++}; ++ ++/* DRM_IOCTL_GEM_CLOSE ioctl argument type */ ++struct drm_gem_close { ++ /** Handle of the object to be closed. */ ++ __u32 handle; ++ __u32 pad; ++}; ++ ++/* DRM_IOCTL_GEM_FLINK ioctl argument type */ ++struct drm_gem_flink { ++ /** Handle for the object being named */ ++ __u32 handle; ++ ++ /** Returned global name */ ++ __u32 name; ++}; ++ ++/* DRM_IOCTL_GEM_OPEN ioctl argument type */ ++struct drm_gem_open { ++ /** Name of object being opened */ ++ __u32 name; ++ ++ /** Returned handle for the object */ ++ __u32 handle; ++ ++ /** Returned size of the object */ ++ __u64 size; ++}; ++ ++/** ++ * DRM_CAP_DUMB_BUFFER ++ * ++ * If set to 1, the driver supports creating dumb buffers via the ++ * &DRM_IOCTL_MODE_CREATE_DUMB ioctl. ++ */ ++#define DRM_CAP_DUMB_BUFFER 0x1 ++/** ++ * DRM_CAP_VBLANK_HIGH_CRTC ++ * ++ * If set to 1, the kernel supports specifying a :ref:`CRTC index` ++ * in the high bits of &drm_wait_vblank_request.type. ++ * ++ * Starting kernel version 2.6.39, this capability is always set to 1. ++ */ ++#define DRM_CAP_VBLANK_HIGH_CRTC 0x2 ++/** ++ * DRM_CAP_DUMB_PREFERRED_DEPTH ++ * ++ * The preferred bit depth for dumb buffers. ++ * ++ * The bit depth is the number of bits used to indicate the color of a single ++ * pixel excluding any padding. This is different from the number of bits per ++ * pixel. For instance, XRGB8888 has a bit depth of 24 but has 32 bits per ++ * pixel. ++ * ++ * Note that this preference only applies to dumb buffers, it's irrelevant for ++ * other types of buffers. ++ */ ++#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3 ++/** ++ * DRM_CAP_DUMB_PREFER_SHADOW ++ * ++ * If set to 1, the driver prefers userspace to render to a shadow buffer ++ * instead of directly rendering to a dumb buffer. For best speed, userspace ++ * should do streaming ordered memory copies into the dumb buffer and never ++ * read from it. ++ * ++ * Note that this preference only applies to dumb buffers, it's irrelevant for ++ * other types of buffers. ++ */ ++#define DRM_CAP_DUMB_PREFER_SHADOW 0x4 ++/** ++ * DRM_CAP_PRIME ++ * ++ * Bitfield of supported PRIME sharing capabilities. See &DRM_PRIME_CAP_IMPORT ++ * and &DRM_PRIME_CAP_EXPORT. ++ * ++ * PRIME buffers are exposed as dma-buf file descriptors. See ++ * Documentation/gpu/drm-mm.rst, section "PRIME Buffer Sharing". ++ */ ++#define DRM_CAP_PRIME 0x5 ++/** ++ * DRM_PRIME_CAP_IMPORT ++ * ++ * If this bit is set in &DRM_CAP_PRIME, the driver supports importing PRIME ++ * buffers via the &DRM_IOCTL_PRIME_FD_TO_HANDLE ioctl. ++ */ ++#define DRM_PRIME_CAP_IMPORT 0x1 ++/** ++ * DRM_PRIME_CAP_EXPORT ++ * ++ * If this bit is set in &DRM_CAP_PRIME, the driver supports exporting PRIME ++ * buffers via the &DRM_IOCTL_PRIME_HANDLE_TO_FD ioctl. ++ */ ++#define DRM_PRIME_CAP_EXPORT 0x2 ++/** ++ * DRM_CAP_TIMESTAMP_MONOTONIC ++ * ++ * If set to 0, the kernel will report timestamps with ``CLOCK_REALTIME`` in ++ * struct drm_event_vblank. If set to 1, the kernel will report timestamps with ++ * ``CLOCK_MONOTONIC``. See ``clock_gettime(2)`` for the definition of these ++ * clocks. ++ * ++ * Starting from kernel version 2.6.39, the default value for this capability ++ * is 1. Starting kernel version 4.15, this capability is always set to 1. ++ */ ++#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 ++/** ++ * DRM_CAP_ASYNC_PAGE_FLIP ++ * ++ * If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC. ++ */ ++#define DRM_CAP_ASYNC_PAGE_FLIP 0x7 ++/** ++ * DRM_CAP_CURSOR_WIDTH ++ * ++ * The ``CURSOR_WIDTH`` and ``CURSOR_HEIGHT`` capabilities return a valid ++ * width x height combination for the hardware cursor. The intention is that a ++ * hardware agnostic userspace can query a cursor plane size to use. ++ * ++ * Note that the cross-driver contract is to merely return a valid size; ++ * drivers are free to attach another meaning on top, eg. i915 returns the ++ * maximum plane size. ++ */ ++#define DRM_CAP_CURSOR_WIDTH 0x8 ++/** ++ * DRM_CAP_CURSOR_HEIGHT ++ * ++ * See &DRM_CAP_CURSOR_WIDTH. ++ */ ++#define DRM_CAP_CURSOR_HEIGHT 0x9 ++/** ++ * DRM_CAP_ADDFB2_MODIFIERS ++ * ++ * If set to 1, the driver supports supplying modifiers in the ++ * &DRM_IOCTL_MODE_ADDFB2 ioctl. ++ */ ++#define DRM_CAP_ADDFB2_MODIFIERS 0x10 ++/** ++ * DRM_CAP_PAGE_FLIP_TARGET ++ * ++ * If set to 1, the driver supports the &DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE and ++ * &DRM_MODE_PAGE_FLIP_TARGET_RELATIVE flags in ++ * &drm_mode_crtc_page_flip_target.flags for the &DRM_IOCTL_MODE_PAGE_FLIP ++ * ioctl. ++ */ ++#define DRM_CAP_PAGE_FLIP_TARGET 0x11 ++/** ++ * DRM_CAP_CRTC_IN_VBLANK_EVENT ++ * ++ * If set to 1, the kernel supports reporting the CRTC ID in ++ * &drm_event_vblank.crtc_id for the &DRM_EVENT_VBLANK and ++ * &DRM_EVENT_FLIP_COMPLETE events. ++ * ++ * Starting kernel version 4.12, this capability is always set to 1. ++ */ ++#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12 ++/** ++ * DRM_CAP_SYNCOBJ ++ * ++ * If set to 1, the driver supports sync objects. See ++ * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects". ++ */ ++#define DRM_CAP_SYNCOBJ 0x13 ++/** ++ * DRM_CAP_SYNCOBJ_TIMELINE ++ * ++ * If set to 1, the driver supports timeline operations on sync objects. See ++ * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects". ++ */ ++#define DRM_CAP_SYNCOBJ_TIMELINE 0x14 ++ ++/* DRM_IOCTL_GET_CAP ioctl argument type */ ++struct drm_get_cap { ++ __u64 capability; ++ __u64 value; ++}; ++ ++/** ++ * DRM_CLIENT_CAP_STEREO_3D ++ * ++ * If set to 1, the DRM core will expose the stereo 3D capabilities of the ++ * monitor by advertising the supported 3D layouts in the flags of struct ++ * drm_mode_modeinfo. See ``DRM_MODE_FLAG_3D_*``. ++ * ++ * This capability is always supported for all drivers starting from kernel ++ * version 3.13. ++ */ ++#define DRM_CLIENT_CAP_STEREO_3D 1 ++ ++/** ++ * DRM_CLIENT_CAP_UNIVERSAL_PLANES ++ * ++ * If set to 1, the DRM core will expose all planes (overlay, primary, and ++ * cursor) to userspace. ++ * ++ * This capability has been introduced in kernel version 3.15. Starting from ++ * kernel version 3.17, this capability is always supported for all drivers. ++ */ ++#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2 ++ ++/** ++ * DRM_CLIENT_CAP_ATOMIC ++ * ++ * If set to 1, the DRM core will expose atomic properties to userspace. This ++ * implicitly enables &DRM_CLIENT_CAP_UNIVERSAL_PLANES and ++ * &DRM_CLIENT_CAP_ASPECT_RATIO. ++ * ++ * If the driver doesn't support atomic mode-setting, enabling this capability ++ * will fail with -EOPNOTSUPP. ++ * ++ * This capability has been introduced in kernel version 4.0. Starting from ++ * kernel version 4.2, this capability is always supported for atomic-capable ++ * drivers. ++ */ ++#define DRM_CLIENT_CAP_ATOMIC 3 ++ ++/** ++ * DRM_CLIENT_CAP_ASPECT_RATIO ++ * ++ * If set to 1, the DRM core will provide aspect ratio information in modes. ++ * See ``DRM_MODE_FLAG_PIC_AR_*``. ++ * ++ * This capability is always supported for all drivers starting from kernel ++ * version 4.18. ++ */ ++#define DRM_CLIENT_CAP_ASPECT_RATIO 4 ++ ++/** ++ * DRM_CLIENT_CAP_WRITEBACK_CONNECTORS ++ * ++ * If set to 1, the DRM core will expose special connectors to be used for ++ * writing back to memory the scene setup in the commit. The client must enable ++ * &DRM_CLIENT_CAP_ATOMIC first. ++ * ++ * This capability is always supported for atomic-capable drivers starting from ++ * kernel version 4.19. ++ */ ++#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5 ++ ++/* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ ++struct drm_set_client_cap { ++ __u64 capability; ++ __u64 value; ++}; ++ ++#define DRM_RDWR O_RDWR ++#define DRM_CLOEXEC O_CLOEXEC ++struct drm_prime_handle { ++ __u32 handle; ++ ++ /** Flags.. only applicable for handle->fd */ ++ __u32 flags; ++ ++ /** Returned dmabuf file descriptor */ ++ __s32 fd; ++}; ++ ++struct drm_syncobj_create { ++ __u32 handle; ++#define DRM_SYNCOBJ_CREATE_SIGNALED (1 << 0) ++ __u32 flags; ++}; ++ ++struct drm_syncobj_destroy { ++ __u32 handle; ++ __u32 pad; ++}; ++ ++#define DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE (1 << 0) ++#define DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_EXPORT_SYNC_FILE (1 << 0) ++struct drm_syncobj_handle { ++ __u32 handle; ++ __u32 flags; ++ ++ __s32 fd; ++ __u32 pad; ++}; ++ ++struct drm_syncobj_transfer { ++ __u32 src_handle; ++ __u32 dst_handle; ++ __u64 src_point; ++ __u64 dst_point; ++ __u32 flags; ++ __u32 pad; ++}; ++ ++#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0) ++#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1) ++#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE (1 << 2) /* wait for time point to become available */ ++struct drm_syncobj_wait { ++ __u64 handles; ++ /* absolute timeout */ ++ __s64 timeout_nsec; ++ __u32 count_handles; ++ __u32 flags; ++ __u32 first_signaled; /* only valid when not waiting all */ ++ __u32 pad; ++}; ++ ++struct drm_syncobj_timeline_wait { ++ __u64 handles; ++ /* wait on specific timeline point for every handles*/ ++ __u64 points; ++ /* absolute timeout */ ++ __s64 timeout_nsec; ++ __u32 count_handles; ++ __u32 flags; ++ __u32 first_signaled; /* only valid when not waiting all */ ++ __u32 pad; ++}; ++ ++ ++struct drm_syncobj_array { ++ __u64 handles; ++ __u32 count_handles; ++ __u32 pad; ++}; ++ ++#define DRM_SYNCOBJ_QUERY_FLAGS_LAST_SUBMITTED (1 << 0) /* last available point on timeline syncobj */ ++struct drm_syncobj_timeline_array { ++ __u64 handles; ++ __u64 points; ++ __u32 count_handles; ++ __u32 flags; ++}; ++ ++ ++/* Query current scanout sequence number */ ++struct drm_crtc_get_sequence { ++ __u32 crtc_id; /* requested crtc_id */ ++ __u32 active; /* return: crtc output is active */ ++ __u64 sequence; /* return: most recent vblank sequence */ ++ __s64 sequence_ns; /* return: most recent time of first pixel out */ ++}; ++ ++/* Queue event to be delivered at specified sequence. Time stamp marks ++ * when the first pixel of the refresh cycle leaves the display engine ++ * for the display ++ */ ++#define DRM_CRTC_SEQUENCE_RELATIVE 0x00000001 /* sequence is relative to current */ ++#define DRM_CRTC_SEQUENCE_NEXT_ON_MISS 0x00000002 /* Use next sequence if we've missed */ ++ ++struct drm_crtc_queue_sequence { ++ __u32 crtc_id; ++ __u32 flags; ++ __u64 sequence; /* on input, target sequence. on output, actual sequence */ ++ __u64 user_data; /* user data passed to event */ ++}; ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#include "drm_mode.h" ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++#define DRM_IOCTL_BASE 'd' ++#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr) ++#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type) ++#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type) ++#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type) ++ ++#define DRM_IOCTL_VERSION DRM_IOWR(0x00, struct drm_version) ++#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, struct drm_unique) ++#define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, struct drm_auth) ++#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, struct drm_irq_busid) ++#define DRM_IOCTL_GET_MAP DRM_IOWR(0x04, struct drm_map) ++#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client) ++#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats) ++#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version) ++#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl) ++#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close) ++#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink) ++#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open) ++#define DRM_IOCTL_GET_CAP DRM_IOWR(0x0c, struct drm_get_cap) ++#define DRM_IOCTL_SET_CLIENT_CAP DRM_IOW( 0x0d, struct drm_set_client_cap) ++ ++#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique) ++#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth) ++#define DRM_IOCTL_BLOCK DRM_IOWR(0x12, struct drm_block) ++#define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, struct drm_block) ++#define DRM_IOCTL_CONTROL DRM_IOW( 0x14, struct drm_control) ++#define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, struct drm_map) ++#define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, struct drm_buf_desc) ++#define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, struct drm_buf_desc) ++#define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, struct drm_buf_info) ++#define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, struct drm_buf_map) ++#define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, struct drm_buf_free) ++ ++#define DRM_IOCTL_RM_MAP DRM_IOW( 0x1b, struct drm_map) ++ ++#define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, struct drm_ctx_priv_map) ++#define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, struct drm_ctx_priv_map) ++ ++#define DRM_IOCTL_SET_MASTER DRM_IO(0x1e) ++#define DRM_IOCTL_DROP_MASTER DRM_IO(0x1f) ++ ++#define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, struct drm_ctx) ++#define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, struct drm_ctx) ++#define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, struct drm_ctx) ++#define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, struct drm_ctx) ++#define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, struct drm_ctx) ++#define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, struct drm_ctx) ++#define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, struct drm_ctx_res) ++#define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, struct drm_draw) ++#define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, struct drm_draw) ++#define DRM_IOCTL_DMA DRM_IOWR(0x29, struct drm_dma) ++#define DRM_IOCTL_LOCK DRM_IOW( 0x2a, struct drm_lock) ++#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock) ++#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock) ++ ++#define DRM_IOCTL_PRIME_HANDLE_TO_FD DRM_IOWR(0x2d, struct drm_prime_handle) ++#define DRM_IOCTL_PRIME_FD_TO_HANDLE DRM_IOWR(0x2e, struct drm_prime_handle) ++ ++#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30) ++#define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31) ++#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode) ++#define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, struct drm_agp_info) ++#define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, struct drm_agp_buffer) ++#define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, struct drm_agp_buffer) ++#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding) ++#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding) ++ ++#define DRM_IOCTL_SG_ALLOC DRM_IOWR(0x38, struct drm_scatter_gather) ++#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather) ++ ++#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank) ++ ++#define DRM_IOCTL_CRTC_GET_SEQUENCE DRM_IOWR(0x3b, struct drm_crtc_get_sequence) ++#define DRM_IOCTL_CRTC_QUEUE_SEQUENCE DRM_IOWR(0x3c, struct drm_crtc_queue_sequence) ++ ++#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw) ++ ++#define DRM_IOCTL_MODE_GETRESOURCES DRM_IOWR(0xA0, struct drm_mode_card_res) ++#define DRM_IOCTL_MODE_GETCRTC DRM_IOWR(0xA1, struct drm_mode_crtc) ++#define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA2, struct drm_mode_crtc) ++#define DRM_IOCTL_MODE_CURSOR DRM_IOWR(0xA3, struct drm_mode_cursor) ++#define DRM_IOCTL_MODE_GETGAMMA DRM_IOWR(0xA4, struct drm_mode_crtc_lut) ++#define DRM_IOCTL_MODE_SETGAMMA DRM_IOWR(0xA5, struct drm_mode_crtc_lut) ++#define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xA6, struct drm_mode_get_encoder) ++#define DRM_IOCTL_MODE_GETCONNECTOR DRM_IOWR(0xA7, struct drm_mode_get_connector) ++#define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA8, struct drm_mode_mode_cmd) /* deprecated (never worked) */ ++#define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd) /* deprecated (never worked) */ ++ ++#define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAA, struct drm_mode_get_property) ++#define DRM_IOCTL_MODE_SETPROPERTY DRM_IOWR(0xAB, struct drm_mode_connector_set_property) ++#define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, struct drm_mode_get_blob) ++#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd) ++#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd) ++/** ++ * DRM_IOCTL_MODE_RMFB - Remove a framebuffer. ++ * ++ * This removes a framebuffer previously added via ADDFB/ADDFB2. The IOCTL ++ * argument is a framebuffer object ID. ++ * ++ * Warning: removing a framebuffer currently in-use on an enabled plane will ++ * disable that plane. The CRTC the plane is linked to may also be disabled ++ * (depending on driver capabilities). ++ */ ++#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int) ++#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip) ++#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd) ++ ++#define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb) ++#define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, struct drm_mode_map_dumb) ++#define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, struct drm_mode_destroy_dumb) ++#define DRM_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xB5, struct drm_mode_get_plane_res) ++#define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane) ++#define DRM_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct drm_mode_set_plane) ++#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2) ++#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties) ++#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property) ++#define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2) ++#define DRM_IOCTL_MODE_ATOMIC DRM_IOWR(0xBC, struct drm_mode_atomic) ++#define DRM_IOCTL_MODE_CREATEPROPBLOB DRM_IOWR(0xBD, struct drm_mode_create_blob) ++#define DRM_IOCTL_MODE_DESTROYPROPBLOB DRM_IOWR(0xBE, struct drm_mode_destroy_blob) ++ ++#define DRM_IOCTL_SYNCOBJ_CREATE DRM_IOWR(0xBF, struct drm_syncobj_create) ++#define DRM_IOCTL_SYNCOBJ_DESTROY DRM_IOWR(0xC0, struct drm_syncobj_destroy) ++#define DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD DRM_IOWR(0xC1, struct drm_syncobj_handle) ++#define DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE DRM_IOWR(0xC2, struct drm_syncobj_handle) ++#define DRM_IOCTL_SYNCOBJ_WAIT DRM_IOWR(0xC3, struct drm_syncobj_wait) ++#define DRM_IOCTL_SYNCOBJ_RESET DRM_IOWR(0xC4, struct drm_syncobj_array) ++#define DRM_IOCTL_SYNCOBJ_SIGNAL DRM_IOWR(0xC5, struct drm_syncobj_array) ++ ++#define DRM_IOCTL_MODE_CREATE_LEASE DRM_IOWR(0xC6, struct drm_mode_create_lease) ++#define DRM_IOCTL_MODE_LIST_LESSEES DRM_IOWR(0xC7, struct drm_mode_list_lessees) ++#define DRM_IOCTL_MODE_GET_LEASE DRM_IOWR(0xC8, struct drm_mode_get_lease) ++#define DRM_IOCTL_MODE_REVOKE_LEASE DRM_IOWR(0xC9, struct drm_mode_revoke_lease) ++ ++#define DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT DRM_IOWR(0xCA, struct drm_syncobj_timeline_wait) ++#define DRM_IOCTL_SYNCOBJ_QUERY DRM_IOWR(0xCB, struct drm_syncobj_timeline_array) ++#define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer) ++#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct drm_syncobj_timeline_array) ++ ++#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2) ++ ++/* ++ * Device specific ioctls should only be in their respective headers ++ * The device specific ioctl range is from 0x40 to 0x9f. ++ * Generic IOCTLS restart at 0xA0. ++ * ++ * \sa drmCommandNone(), drmCommandRead(), drmCommandWrite(), and ++ * drmCommandReadWrite(). ++ */ ++#define DRM_COMMAND_BASE 0x40 ++#define DRM_COMMAND_END 0xA0 ++ ++/* ++ * Header for events written back to userspace on the drm fd. The ++ * type defines the type of event, the length specifies the total ++ * length of the event (including the header), and user_data is ++ * typically a 64 bit value passed with the ioctl that triggered the ++ * event. A read on the drm fd will always only return complete ++ * events, that is, if for example the read buffer is 100 bytes, and ++ * there are two 64 byte events pending, only one will be returned. ++ * ++ * Event types 0 - 0x7fffffff are generic drm events, 0x80000000 and ++ * up are chipset specific. ++ */ ++struct drm_event { ++ __u32 type; ++ __u32 length; ++}; ++ ++#define DRM_EVENT_VBLANK 0x01 ++#define DRM_EVENT_FLIP_COMPLETE 0x02 ++#define DRM_EVENT_CRTC_SEQUENCE 0x03 ++ ++struct drm_event_vblank { ++ struct drm_event base; ++ __u64 user_data; ++ __u32 tv_sec; ++ __u32 tv_usec; ++ __u32 sequence; ++ __u32 crtc_id; /* 0 on older kernels that do not support this */ ++}; ++ ++/* Event delivered at sequence. Time stamp marks when the first pixel ++ * of the refresh cycle leaves the display engine for the display ++ */ ++struct drm_event_crtc_sequence { ++ struct drm_event base; ++ __u64 user_data; ++ __s64 time_ns; ++ __u64 sequence; ++}; ++ ++/* typedef area */ ++typedef struct drm_clip_rect drm_clip_rect_t; ++typedef struct drm_drawable_info drm_drawable_info_t; ++typedef struct drm_tex_region drm_tex_region_t; ++typedef struct drm_hw_lock drm_hw_lock_t; ++typedef struct drm_version drm_version_t; ++typedef struct drm_unique drm_unique_t; ++typedef struct drm_list drm_list_t; ++typedef struct drm_block drm_block_t; ++typedef struct drm_control drm_control_t; ++typedef enum drm_map_type drm_map_type_t; ++typedef enum drm_map_flags drm_map_flags_t; ++typedef struct drm_ctx_priv_map drm_ctx_priv_map_t; ++typedef struct drm_map drm_map_t; ++typedef struct drm_client drm_client_t; ++typedef enum drm_stat_type drm_stat_type_t; ++typedef struct drm_stats drm_stats_t; ++typedef enum drm_lock_flags drm_lock_flags_t; ++typedef struct drm_lock drm_lock_t; ++typedef enum drm_dma_flags drm_dma_flags_t; ++typedef struct drm_buf_desc drm_buf_desc_t; ++typedef struct drm_buf_info drm_buf_info_t; ++typedef struct drm_buf_free drm_buf_free_t; ++typedef struct drm_buf_pub drm_buf_pub_t; ++typedef struct drm_buf_map drm_buf_map_t; ++typedef struct drm_dma drm_dma_t; ++typedef union drm_wait_vblank drm_wait_vblank_t; ++typedef struct drm_agp_mode drm_agp_mode_t; ++typedef enum drm_ctx_flags drm_ctx_flags_t; ++typedef struct drm_ctx drm_ctx_t; ++typedef struct drm_ctx_res drm_ctx_res_t; ++typedef struct drm_draw drm_draw_t; ++typedef struct drm_update_draw drm_update_draw_t; ++typedef struct drm_auth drm_auth_t; ++typedef struct drm_irq_busid drm_irq_busid_t; ++typedef enum drm_vblank_seq_type drm_vblank_seq_type_t; ++ ++typedef struct drm_agp_buffer drm_agp_buffer_t; ++typedef struct drm_agp_binding drm_agp_binding_t; ++typedef struct drm_agp_info drm_agp_info_t; ++typedef struct drm_scatter_gather drm_scatter_gather_t; ++typedef struct drm_set_version drm_set_version_t; ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif +diff -up firefox-103.0/third_party/drm/drm/drm_mode.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/drm/drm/drm_mode.h +--- firefox-103.0/third_party/drm/drm/drm_mode.h.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.428095335 +0200 ++++ firefox-103.0/third_party/drm/drm/drm_mode.h 2022-07-26 16:30:19.428095335 +0200 +@@ -0,0 +1,1217 @@ ++/* ++ * Copyright (c) 2007 Dave Airlie ++ * Copyright (c) 2007 Jakob Bornecrantz ++ * Copyright (c) 2008 Red Hat Inc. ++ * Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA ++ * Copyright (c) 2007-2008 Intel Corporation ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included in ++ * all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS ++ * IN THE SOFTWARE. ++ */ ++ ++#ifndef _DRM_MODE_H ++#define _DRM_MODE_H ++ ++#include "drm.h" ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++/** ++ * DOC: overview ++ * ++ * DRM exposes many UAPI and structure definition to have a consistent ++ * and standardized interface with user. ++ * Userspace can refer to these structure definitions and UAPI formats ++ * to communicate to driver ++ */ ++ ++#define DRM_CONNECTOR_NAME_LEN 32 ++#define DRM_DISPLAY_MODE_LEN 32 ++#define DRM_PROP_NAME_LEN 32 ++ ++#define DRM_MODE_TYPE_BUILTIN (1<<0) /* deprecated */ ++#define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN) /* deprecated */ ++#define DRM_MODE_TYPE_CRTC_C ((1<<2) | DRM_MODE_TYPE_BUILTIN) /* deprecated */ ++#define DRM_MODE_TYPE_PREFERRED (1<<3) ++#define DRM_MODE_TYPE_DEFAULT (1<<4) /* deprecated */ ++#define DRM_MODE_TYPE_USERDEF (1<<5) ++#define DRM_MODE_TYPE_DRIVER (1<<6) ++ ++#define DRM_MODE_TYPE_ALL (DRM_MODE_TYPE_PREFERRED | \ ++ DRM_MODE_TYPE_USERDEF | \ ++ DRM_MODE_TYPE_DRIVER) ++ ++/* Video mode flags */ ++/* bit compatible with the xrandr RR_ definitions (bits 0-13) ++ * ++ * ABI warning: Existing userspace really expects ++ * the mode flags to match the xrandr definitions. Any ++ * changes that don't match the xrandr definitions will ++ * likely need a new client cap or some other mechanism ++ * to avoid breaking existing userspace. This includes ++ * allocating new flags in the previously unused bits! ++ */ ++#define DRM_MODE_FLAG_PHSYNC (1<<0) ++#define DRM_MODE_FLAG_NHSYNC (1<<1) ++#define DRM_MODE_FLAG_PVSYNC (1<<2) ++#define DRM_MODE_FLAG_NVSYNC (1<<3) ++#define DRM_MODE_FLAG_INTERLACE (1<<4) ++#define DRM_MODE_FLAG_DBLSCAN (1<<5) ++#define DRM_MODE_FLAG_CSYNC (1<<6) ++#define DRM_MODE_FLAG_PCSYNC (1<<7) ++#define DRM_MODE_FLAG_NCSYNC (1<<8) ++#define DRM_MODE_FLAG_HSKEW (1<<9) /* hskew provided */ ++#define DRM_MODE_FLAG_BCAST (1<<10) /* deprecated */ ++#define DRM_MODE_FLAG_PIXMUX (1<<11) /* deprecated */ ++#define DRM_MODE_FLAG_DBLCLK (1<<12) ++#define DRM_MODE_FLAG_CLKDIV2 (1<<13) ++ /* ++ * When adding a new stereo mode don't forget to adjust DRM_MODE_FLAGS_3D_MAX ++ * (define not exposed to user space). ++ */ ++#define DRM_MODE_FLAG_3D_MASK (0x1f<<14) ++#define DRM_MODE_FLAG_3D_NONE (0<<14) ++#define DRM_MODE_FLAG_3D_FRAME_PACKING (1<<14) ++#define DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE (2<<14) ++#define DRM_MODE_FLAG_3D_LINE_ALTERNATIVE (3<<14) ++#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL (4<<14) ++#define DRM_MODE_FLAG_3D_L_DEPTH (5<<14) ++#define DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH (6<<14) ++#define DRM_MODE_FLAG_3D_TOP_AND_BOTTOM (7<<14) ++#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF (8<<14) ++ ++/* Picture aspect ratio options */ ++#define DRM_MODE_PICTURE_ASPECT_NONE 0 ++#define DRM_MODE_PICTURE_ASPECT_4_3 1 ++#define DRM_MODE_PICTURE_ASPECT_16_9 2 ++#define DRM_MODE_PICTURE_ASPECT_64_27 3 ++#define DRM_MODE_PICTURE_ASPECT_256_135 4 ++ ++/* Content type options */ ++#define DRM_MODE_CONTENT_TYPE_NO_DATA 0 ++#define DRM_MODE_CONTENT_TYPE_GRAPHICS 1 ++#define DRM_MODE_CONTENT_TYPE_PHOTO 2 ++#define DRM_MODE_CONTENT_TYPE_CINEMA 3 ++#define DRM_MODE_CONTENT_TYPE_GAME 4 ++ ++/* Aspect ratio flag bitmask (4 bits 22:19) */ ++#define DRM_MODE_FLAG_PIC_AR_MASK (0x0F<<19) ++#define DRM_MODE_FLAG_PIC_AR_NONE \ ++ (DRM_MODE_PICTURE_ASPECT_NONE<<19) ++#define DRM_MODE_FLAG_PIC_AR_4_3 \ ++ (DRM_MODE_PICTURE_ASPECT_4_3<<19) ++#define DRM_MODE_FLAG_PIC_AR_16_9 \ ++ (DRM_MODE_PICTURE_ASPECT_16_9<<19) ++#define DRM_MODE_FLAG_PIC_AR_64_27 \ ++ (DRM_MODE_PICTURE_ASPECT_64_27<<19) ++#define DRM_MODE_FLAG_PIC_AR_256_135 \ ++ (DRM_MODE_PICTURE_ASPECT_256_135<<19) ++ ++#define DRM_MODE_FLAG_ALL (DRM_MODE_FLAG_PHSYNC | \ ++ DRM_MODE_FLAG_NHSYNC | \ ++ DRM_MODE_FLAG_PVSYNC | \ ++ DRM_MODE_FLAG_NVSYNC | \ ++ DRM_MODE_FLAG_INTERLACE | \ ++ DRM_MODE_FLAG_DBLSCAN | \ ++ DRM_MODE_FLAG_CSYNC | \ ++ DRM_MODE_FLAG_PCSYNC | \ ++ DRM_MODE_FLAG_NCSYNC | \ ++ DRM_MODE_FLAG_HSKEW | \ ++ DRM_MODE_FLAG_DBLCLK | \ ++ DRM_MODE_FLAG_CLKDIV2 | \ ++ DRM_MODE_FLAG_3D_MASK) ++ ++/* DPMS flags */ ++/* bit compatible with the xorg definitions. */ ++#define DRM_MODE_DPMS_ON 0 ++#define DRM_MODE_DPMS_STANDBY 1 ++#define DRM_MODE_DPMS_SUSPEND 2 ++#define DRM_MODE_DPMS_OFF 3 ++ ++/* Scaling mode options */ ++#define DRM_MODE_SCALE_NONE 0 /* Unmodified timing (display or ++ software can still scale) */ ++#define DRM_MODE_SCALE_FULLSCREEN 1 /* Full screen, ignore aspect */ ++#define DRM_MODE_SCALE_CENTER 2 /* Centered, no scaling */ ++#define DRM_MODE_SCALE_ASPECT 3 /* Full screen, preserve aspect */ ++ ++/* Dithering mode options */ ++#define DRM_MODE_DITHERING_OFF 0 ++#define DRM_MODE_DITHERING_ON 1 ++#define DRM_MODE_DITHERING_AUTO 2 ++ ++/* Dirty info options */ ++#define DRM_MODE_DIRTY_OFF 0 ++#define DRM_MODE_DIRTY_ON 1 ++#define DRM_MODE_DIRTY_ANNOTATE 2 ++ ++/* Link Status options */ ++#define DRM_MODE_LINK_STATUS_GOOD 0 ++#define DRM_MODE_LINK_STATUS_BAD 1 ++ ++/* ++ * DRM_MODE_ROTATE_ ++ * ++ * Signals that a drm plane is been rotated degrees in counter ++ * clockwise direction. ++ * ++ * This define is provided as a convenience, looking up the property id ++ * using the name->prop id lookup is the preferred method. ++ */ ++#define DRM_MODE_ROTATE_0 (1<<0) ++#define DRM_MODE_ROTATE_90 (1<<1) ++#define DRM_MODE_ROTATE_180 (1<<2) ++#define DRM_MODE_ROTATE_270 (1<<3) ++ ++/* ++ * DRM_MODE_ROTATE_MASK ++ * ++ * Bitmask used to look for drm plane rotations. ++ */ ++#define DRM_MODE_ROTATE_MASK (\ ++ DRM_MODE_ROTATE_0 | \ ++ DRM_MODE_ROTATE_90 | \ ++ DRM_MODE_ROTATE_180 | \ ++ DRM_MODE_ROTATE_270) ++ ++/* ++ * DRM_MODE_REFLECT_ ++ * ++ * Signals that the contents of a drm plane is reflected along the axis, ++ * in the same way as mirroring. ++ * See kerneldoc chapter "Plane Composition Properties" for more details. ++ * ++ * This define is provided as a convenience, looking up the property id ++ * using the name->prop id lookup is the preferred method. ++ */ ++#define DRM_MODE_REFLECT_X (1<<4) ++#define DRM_MODE_REFLECT_Y (1<<5) ++ ++/* ++ * DRM_MODE_REFLECT_MASK ++ * ++ * Bitmask used to look for drm plane reflections. ++ */ ++#define DRM_MODE_REFLECT_MASK (\ ++ DRM_MODE_REFLECT_X | \ ++ DRM_MODE_REFLECT_Y) ++ ++/* Content Protection Flags */ ++#define DRM_MODE_CONTENT_PROTECTION_UNDESIRED 0 ++#define DRM_MODE_CONTENT_PROTECTION_DESIRED 1 ++#define DRM_MODE_CONTENT_PROTECTION_ENABLED 2 ++ ++/** ++ * struct drm_mode_modeinfo - Display mode information. ++ * @clock: pixel clock in kHz ++ * @hdisplay: horizontal display size ++ * @hsync_start: horizontal sync start ++ * @hsync_end: horizontal sync end ++ * @htotal: horizontal total size ++ * @hskew: horizontal skew ++ * @vdisplay: vertical display size ++ * @vsync_start: vertical sync start ++ * @vsync_end: vertical sync end ++ * @vtotal: vertical total size ++ * @vscan: vertical scan ++ * @vrefresh: approximate vertical refresh rate in Hz ++ * @flags: bitmask of misc. flags, see DRM_MODE_FLAG_* defines ++ * @type: bitmask of type flags, see DRM_MODE_TYPE_* defines ++ * @name: string describing the mode resolution ++ * ++ * This is the user-space API display mode information structure. For the ++ * kernel version see struct drm_display_mode. ++ */ ++struct drm_mode_modeinfo { ++ __u32 clock; ++ __u16 hdisplay; ++ __u16 hsync_start; ++ __u16 hsync_end; ++ __u16 htotal; ++ __u16 hskew; ++ __u16 vdisplay; ++ __u16 vsync_start; ++ __u16 vsync_end; ++ __u16 vtotal; ++ __u16 vscan; ++ ++ __u32 vrefresh; ++ ++ __u32 flags; ++ __u32 type; ++ char name[DRM_DISPLAY_MODE_LEN]; ++}; ++ ++struct drm_mode_card_res { ++ __u64 fb_id_ptr; ++ __u64 crtc_id_ptr; ++ __u64 connector_id_ptr; ++ __u64 encoder_id_ptr; ++ __u32 count_fbs; ++ __u32 count_crtcs; ++ __u32 count_connectors; ++ __u32 count_encoders; ++ __u32 min_width; ++ __u32 max_width; ++ __u32 min_height; ++ __u32 max_height; ++}; ++ ++struct drm_mode_crtc { ++ __u64 set_connectors_ptr; ++ __u32 count_connectors; ++ ++ __u32 crtc_id; /**< Id */ ++ __u32 fb_id; /**< Id of framebuffer */ ++ ++ __u32 x; /**< x Position on the framebuffer */ ++ __u32 y; /**< y Position on the framebuffer */ ++ ++ __u32 gamma_size; ++ __u32 mode_valid; ++ struct drm_mode_modeinfo mode; ++}; ++ ++#define DRM_MODE_PRESENT_TOP_FIELD (1<<0) ++#define DRM_MODE_PRESENT_BOTTOM_FIELD (1<<1) ++ ++/* Planes blend with or override other bits on the CRTC */ ++struct drm_mode_set_plane { ++ __u32 plane_id; ++ __u32 crtc_id; ++ __u32 fb_id; /* fb object contains surface format type */ ++ __u32 flags; /* see above flags */ ++ ++ /* Signed dest location allows it to be partially off screen */ ++ __s32 crtc_x; ++ __s32 crtc_y; ++ __u32 crtc_w; ++ __u32 crtc_h; ++ ++ /* Source values are 16.16 fixed point */ ++ __u32 src_x; ++ __u32 src_y; ++ __u32 src_h; ++ __u32 src_w; ++}; ++ ++/** ++ * struct drm_mode_get_plane - Get plane metadata. ++ * ++ * Userspace can perform a GETPLANE ioctl to retrieve information about a ++ * plane. ++ * ++ * To retrieve the number of formats supported, set @count_format_types to zero ++ * and call the ioctl. @count_format_types will be updated with the value. ++ * ++ * To retrieve these formats, allocate an array with the memory needed to store ++ * @count_format_types formats. Point @format_type_ptr to this array and call ++ * the ioctl again (with @count_format_types still set to the value returned in ++ * the first ioctl call). ++ */ ++struct drm_mode_get_plane { ++ /** ++ * @plane_id: Object ID of the plane whose information should be ++ * retrieved. Set by caller. ++ */ ++ __u32 plane_id; ++ ++ /** @crtc_id: Object ID of the current CRTC. */ ++ __u32 crtc_id; ++ /** @fb_id: Object ID of the current fb. */ ++ __u32 fb_id; ++ ++ /** ++ * @possible_crtcs: Bitmask of CRTC's compatible with the plane. CRTC's ++ * are created and they receive an index, which corresponds to their ++ * position in the bitmask. Bit N corresponds to ++ * :ref:`CRTC index` N. ++ */ ++ __u32 possible_crtcs; ++ /** @gamma_size: Never used. */ ++ __u32 gamma_size; ++ ++ /** @count_format_types: Number of formats. */ ++ __u32 count_format_types; ++ /** ++ * @format_type_ptr: Pointer to ``__u32`` array of formats that are ++ * supported by the plane. These formats do not require modifiers. ++ */ ++ __u64 format_type_ptr; ++}; ++ ++struct drm_mode_get_plane_res { ++ __u64 plane_id_ptr; ++ __u32 count_planes; ++}; ++ ++#define DRM_MODE_ENCODER_NONE 0 ++#define DRM_MODE_ENCODER_DAC 1 ++#define DRM_MODE_ENCODER_TMDS 2 ++#define DRM_MODE_ENCODER_LVDS 3 ++#define DRM_MODE_ENCODER_TVDAC 4 ++#define DRM_MODE_ENCODER_VIRTUAL 5 ++#define DRM_MODE_ENCODER_DSI 6 ++#define DRM_MODE_ENCODER_DPMST 7 ++#define DRM_MODE_ENCODER_DPI 8 ++ ++struct drm_mode_get_encoder { ++ __u32 encoder_id; ++ __u32 encoder_type; ++ ++ __u32 crtc_id; /**< Id of crtc */ ++ ++ __u32 possible_crtcs; ++ __u32 possible_clones; ++}; ++ ++/* This is for connectors with multiple signal types. */ ++/* Try to match DRM_MODE_CONNECTOR_X as closely as possible. */ ++enum drm_mode_subconnector { ++ DRM_MODE_SUBCONNECTOR_Automatic = 0, /* DVI-I, TV */ ++ DRM_MODE_SUBCONNECTOR_Unknown = 0, /* DVI-I, TV, DP */ ++ DRM_MODE_SUBCONNECTOR_VGA = 1, /* DP */ ++ DRM_MODE_SUBCONNECTOR_DVID = 3, /* DVI-I DP */ ++ DRM_MODE_SUBCONNECTOR_DVIA = 4, /* DVI-I */ ++ DRM_MODE_SUBCONNECTOR_Composite = 5, /* TV */ ++ DRM_MODE_SUBCONNECTOR_SVIDEO = 6, /* TV */ ++ DRM_MODE_SUBCONNECTOR_Component = 8, /* TV */ ++ DRM_MODE_SUBCONNECTOR_SCART = 9, /* TV */ ++ DRM_MODE_SUBCONNECTOR_DisplayPort = 10, /* DP */ ++ DRM_MODE_SUBCONNECTOR_HDMIA = 11, /* DP */ ++ DRM_MODE_SUBCONNECTOR_Native = 15, /* DP */ ++ DRM_MODE_SUBCONNECTOR_Wireless = 18, /* DP */ ++}; ++ ++#define DRM_MODE_CONNECTOR_Unknown 0 ++#define DRM_MODE_CONNECTOR_VGA 1 ++#define DRM_MODE_CONNECTOR_DVII 2 ++#define DRM_MODE_CONNECTOR_DVID 3 ++#define DRM_MODE_CONNECTOR_DVIA 4 ++#define DRM_MODE_CONNECTOR_Composite 5 ++#define DRM_MODE_CONNECTOR_SVIDEO 6 ++#define DRM_MODE_CONNECTOR_LVDS 7 ++#define DRM_MODE_CONNECTOR_Component 8 ++#define DRM_MODE_CONNECTOR_9PinDIN 9 ++#define DRM_MODE_CONNECTOR_DisplayPort 10 ++#define DRM_MODE_CONNECTOR_HDMIA 11 ++#define DRM_MODE_CONNECTOR_HDMIB 12 ++#define DRM_MODE_CONNECTOR_TV 13 ++#define DRM_MODE_CONNECTOR_eDP 14 ++#define DRM_MODE_CONNECTOR_VIRTUAL 15 ++#define DRM_MODE_CONNECTOR_DSI 16 ++#define DRM_MODE_CONNECTOR_DPI 17 ++#define DRM_MODE_CONNECTOR_WRITEBACK 18 ++#define DRM_MODE_CONNECTOR_SPI 19 ++#define DRM_MODE_CONNECTOR_USB 20 ++ ++/** ++ * struct drm_mode_get_connector - Get connector metadata. ++ * ++ * User-space can perform a GETCONNECTOR ioctl to retrieve information about a ++ * connector. User-space is expected to retrieve encoders, modes and properties ++ * by performing this ioctl at least twice: the first time to retrieve the ++ * number of elements, the second time to retrieve the elements themselves. ++ * ++ * To retrieve the number of elements, set @count_props and @count_encoders to ++ * zero, set @count_modes to 1, and set @modes_ptr to a temporary struct ++ * drm_mode_modeinfo element. ++ * ++ * To retrieve the elements, allocate arrays for @encoders_ptr, @modes_ptr, ++ * @props_ptr and @prop_values_ptr, then set @count_modes, @count_props and ++ * @count_encoders to their capacity. ++ * ++ * Performing the ioctl only twice may be racy: the number of elements may have ++ * changed with a hotplug event in-between the two ioctls. User-space is ++ * expected to retry the last ioctl until the number of elements stabilizes. ++ * The kernel won't fill any array which doesn't have the expected length. ++ * ++ * **Force-probing a connector** ++ * ++ * If the @count_modes field is set to zero and the DRM client is the current ++ * DRM master, the kernel will perform a forced probe on the connector to ++ * refresh the connector status, modes and EDID. A forced-probe can be slow, ++ * might cause flickering and the ioctl will block. ++ * ++ * User-space needs to force-probe connectors to ensure their metadata is ++ * up-to-date at startup and after receiving a hot-plug event. User-space ++ * may perform a forced-probe when the user explicitly requests it. User-space ++ * shouldn't perform a forced-probe in other situations. ++ */ ++struct drm_mode_get_connector { ++ /** @encoders_ptr: Pointer to ``__u32`` array of object IDs. */ ++ __u64 encoders_ptr; ++ /** @modes_ptr: Pointer to struct drm_mode_modeinfo array. */ ++ __u64 modes_ptr; ++ /** @props_ptr: Pointer to ``__u32`` array of property IDs. */ ++ __u64 props_ptr; ++ /** @prop_values_ptr: Pointer to ``__u64`` array of property values. */ ++ __u64 prop_values_ptr; ++ ++ /** @count_modes: Number of modes. */ ++ __u32 count_modes; ++ /** @count_props: Number of properties. */ ++ __u32 count_props; ++ /** @count_encoders: Number of encoders. */ ++ __u32 count_encoders; ++ ++ /** @encoder_id: Object ID of the current encoder. */ ++ __u32 encoder_id; ++ /** @connector_id: Object ID of the connector. */ ++ __u32 connector_id; ++ /** ++ * @connector_type: Type of the connector. ++ * ++ * See DRM_MODE_CONNECTOR_* defines. ++ */ ++ __u32 connector_type; ++ /** ++ * @connector_type_id: Type-specific connector number. ++ * ++ * This is not an object ID. This is a per-type connector number. Each ++ * (type, type_id) combination is unique across all connectors of a DRM ++ * device. ++ */ ++ __u32 connector_type_id; ++ ++ /** ++ * @connection: Status of the connector. ++ * ++ * See enum drm_connector_status. ++ */ ++ __u32 connection; ++ /** @mm_width: Width of the connected sink in millimeters. */ ++ __u32 mm_width; ++ /** @mm_height: Height of the connected sink in millimeters. */ ++ __u32 mm_height; ++ /** ++ * @subpixel: Subpixel order of the connected sink. ++ * ++ * See enum subpixel_order. ++ */ ++ __u32 subpixel; ++ ++ /** @pad: Padding, must be zero. */ ++ __u32 pad; ++}; ++ ++#define DRM_MODE_PROP_PENDING (1<<0) /* deprecated, do not use */ ++#define DRM_MODE_PROP_RANGE (1<<1) ++#define DRM_MODE_PROP_IMMUTABLE (1<<2) ++#define DRM_MODE_PROP_ENUM (1<<3) /* enumerated type with text strings */ ++#define DRM_MODE_PROP_BLOB (1<<4) ++#define DRM_MODE_PROP_BITMASK (1<<5) /* bitmask of enumerated types */ ++ ++/* non-extended types: legacy bitmask, one bit per type: */ ++#define DRM_MODE_PROP_LEGACY_TYPE ( \ ++ DRM_MODE_PROP_RANGE | \ ++ DRM_MODE_PROP_ENUM | \ ++ DRM_MODE_PROP_BLOB | \ ++ DRM_MODE_PROP_BITMASK) ++ ++/* extended-types: rather than continue to consume a bit per type, ++ * grab a chunk of the bits to use as integer type id. ++ */ ++#define DRM_MODE_PROP_EXTENDED_TYPE 0x0000ffc0 ++#define DRM_MODE_PROP_TYPE(n) ((n) << 6) ++#define DRM_MODE_PROP_OBJECT DRM_MODE_PROP_TYPE(1) ++#define DRM_MODE_PROP_SIGNED_RANGE DRM_MODE_PROP_TYPE(2) ++ ++/* the PROP_ATOMIC flag is used to hide properties from userspace that ++ * is not aware of atomic properties. This is mostly to work around ++ * older userspace (DDX drivers) that read/write each prop they find, ++ * witout being aware that this could be triggering a lengthy modeset. ++ */ ++#define DRM_MODE_PROP_ATOMIC 0x80000000 ++ ++/** ++ * struct drm_mode_property_enum - Description for an enum/bitfield entry. ++ * @value: numeric value for this enum entry. ++ * @name: symbolic name for this enum entry. ++ * ++ * See struct drm_property_enum for details. ++ */ ++struct drm_mode_property_enum { ++ __u64 value; ++ char name[DRM_PROP_NAME_LEN]; ++}; ++ ++/** ++ * struct drm_mode_get_property - Get property metadata. ++ * ++ * User-space can perform a GETPROPERTY ioctl to retrieve information about a ++ * property. The same property may be attached to multiple objects, see ++ * "Modeset Base Object Abstraction". ++ * ++ * The meaning of the @values_ptr field changes depending on the property type. ++ * See &drm_property.flags for more details. ++ * ++ * The @enum_blob_ptr and @count_enum_blobs fields are only meaningful when the ++ * property has the type &DRM_MODE_PROP_ENUM or &DRM_MODE_PROP_BITMASK. For ++ * backwards compatibility, the kernel will always set @count_enum_blobs to ++ * zero when the property has the type &DRM_MODE_PROP_BLOB. User-space must ++ * ignore these two fields if the property has a different type. ++ * ++ * User-space is expected to retrieve values and enums by performing this ioctl ++ * at least twice: the first time to retrieve the number of elements, the ++ * second time to retrieve the elements themselves. ++ * ++ * To retrieve the number of elements, set @count_values and @count_enum_blobs ++ * to zero, then call the ioctl. @count_values will be updated with the number ++ * of elements. If the property has the type &DRM_MODE_PROP_ENUM or ++ * &DRM_MODE_PROP_BITMASK, @count_enum_blobs will be updated as well. ++ * ++ * To retrieve the elements themselves, allocate an array for @values_ptr and ++ * set @count_values to its capacity. If the property has the type ++ * &DRM_MODE_PROP_ENUM or &DRM_MODE_PROP_BITMASK, allocate an array for ++ * @enum_blob_ptr and set @count_enum_blobs to its capacity. Calling the ioctl ++ * again will fill the arrays. ++ */ ++struct drm_mode_get_property { ++ /** @values_ptr: Pointer to a ``__u64`` array. */ ++ __u64 values_ptr; ++ /** @enum_blob_ptr: Pointer to a struct drm_mode_property_enum array. */ ++ __u64 enum_blob_ptr; ++ ++ /** ++ * @prop_id: Object ID of the property which should be retrieved. Set ++ * by the caller. ++ */ ++ __u32 prop_id; ++ /** ++ * @flags: ``DRM_MODE_PROP_*`` bitfield. See &drm_property.flags for ++ * a definition of the flags. ++ */ ++ __u32 flags; ++ /** ++ * @name: Symbolic property name. User-space should use this field to ++ * recognize properties. ++ */ ++ char name[DRM_PROP_NAME_LEN]; ++ ++ /** @count_values: Number of elements in @values_ptr. */ ++ __u32 count_values; ++ /** @count_enum_blobs: Number of elements in @enum_blob_ptr. */ ++ __u32 count_enum_blobs; ++}; ++ ++struct drm_mode_connector_set_property { ++ __u64 value; ++ __u32 prop_id; ++ __u32 connector_id; ++}; ++ ++#define DRM_MODE_OBJECT_CRTC 0xcccccccc ++#define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0 ++#define DRM_MODE_OBJECT_ENCODER 0xe0e0e0e0 ++#define DRM_MODE_OBJECT_MODE 0xdededede ++#define DRM_MODE_OBJECT_PROPERTY 0xb0b0b0b0 ++#define DRM_MODE_OBJECT_FB 0xfbfbfbfb ++#define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb ++#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee ++#define DRM_MODE_OBJECT_ANY 0 ++ ++struct drm_mode_obj_get_properties { ++ __u64 props_ptr; ++ __u64 prop_values_ptr; ++ __u32 count_props; ++ __u32 obj_id; ++ __u32 obj_type; ++}; ++ ++struct drm_mode_obj_set_property { ++ __u64 value; ++ __u32 prop_id; ++ __u32 obj_id; ++ __u32 obj_type; ++}; ++ ++struct drm_mode_get_blob { ++ __u32 blob_id; ++ __u32 length; ++ __u64 data; ++}; ++ ++struct drm_mode_fb_cmd { ++ __u32 fb_id; ++ __u32 width; ++ __u32 height; ++ __u32 pitch; ++ __u32 bpp; ++ __u32 depth; ++ /* driver specific handle */ ++ __u32 handle; ++}; ++ ++#define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */ ++#define DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifer[] */ ++ ++struct drm_mode_fb_cmd2 { ++ __u32 fb_id; ++ __u32 width; ++ __u32 height; ++ __u32 pixel_format; /* fourcc code from drm_fourcc.h */ ++ __u32 flags; /* see above flags */ ++ ++ /* ++ * In case of planar formats, this ioctl allows up to 4 ++ * buffer objects with offsets and pitches per plane. ++ * The pitch and offset order is dictated by the fourcc, ++ * e.g. NV12 (https://fourcc.org/yuv.php#NV12) is described as: ++ * ++ * YUV 4:2:0 image with a plane of 8 bit Y samples ++ * followed by an interleaved U/V plane containing ++ * 8 bit 2x2 subsampled colour difference samples. ++ * ++ * So it would consist of Y as offsets[0] and UV as ++ * offsets[1]. Note that offsets[0] will generally ++ * be 0 (but this is not required). ++ * ++ * To accommodate tiled, compressed, etc formats, a ++ * modifier can be specified. The default value of zero ++ * indicates "native" format as specified by the fourcc. ++ * Vendor specific modifier token. Note that even though ++ * it looks like we have a modifier per-plane, we in fact ++ * do not. The modifier for each plane must be identical. ++ * Thus all combinations of different data layouts for ++ * multi plane formats must be enumerated as separate ++ * modifiers. ++ */ ++ __u32 handles[4]; ++ __u32 pitches[4]; /* pitch for each plane */ ++ __u32 offsets[4]; /* offset of each plane */ ++ __u64 modifier[4]; /* ie, tiling, compress */ ++}; ++ ++#define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01 ++#define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02 ++#define DRM_MODE_FB_DIRTY_FLAGS 0x03 ++ ++#define DRM_MODE_FB_DIRTY_MAX_CLIPS 256 ++ ++/* ++ * Mark a region of a framebuffer as dirty. ++ * ++ * Some hardware does not automatically update display contents ++ * as a hardware or software draw to a framebuffer. This ioctl ++ * allows userspace to tell the kernel and the hardware what ++ * regions of the framebuffer have changed. ++ * ++ * The kernel or hardware is free to update more then just the ++ * region specified by the clip rects. The kernel or hardware ++ * may also delay and/or coalesce several calls to dirty into a ++ * single update. ++ * ++ * Userspace may annotate the updates, the annotates are a ++ * promise made by the caller that the change is either a copy ++ * of pixels or a fill of a single color in the region specified. ++ * ++ * If the DRM_MODE_FB_DIRTY_ANNOTATE_COPY flag is given then ++ * the number of updated regions are half of num_clips given, ++ * where the clip rects are paired in src and dst. The width and ++ * height of each one of the pairs must match. ++ * ++ * If the DRM_MODE_FB_DIRTY_ANNOTATE_FILL flag is given the caller ++ * promises that the region specified of the clip rects is filled ++ * completely with a single color as given in the color argument. ++ */ ++ ++struct drm_mode_fb_dirty_cmd { ++ __u32 fb_id; ++ __u32 flags; ++ __u32 color; ++ __u32 num_clips; ++ __u64 clips_ptr; ++}; ++ ++struct drm_mode_mode_cmd { ++ __u32 connector_id; ++ struct drm_mode_modeinfo mode; ++}; ++ ++#define DRM_MODE_CURSOR_BO 0x01 ++#define DRM_MODE_CURSOR_MOVE 0x02 ++#define DRM_MODE_CURSOR_FLAGS 0x03 ++ ++/* ++ * depending on the value in flags different members are used. ++ * ++ * CURSOR_BO uses ++ * crtc_id ++ * width ++ * height ++ * handle - if 0 turns the cursor off ++ * ++ * CURSOR_MOVE uses ++ * crtc_id ++ * x ++ * y ++ */ ++struct drm_mode_cursor { ++ __u32 flags; ++ __u32 crtc_id; ++ __s32 x; ++ __s32 y; ++ __u32 width; ++ __u32 height; ++ /* driver specific handle */ ++ __u32 handle; ++}; ++ ++struct drm_mode_cursor2 { ++ __u32 flags; ++ __u32 crtc_id; ++ __s32 x; ++ __s32 y; ++ __u32 width; ++ __u32 height; ++ /* driver specific handle */ ++ __u32 handle; ++ __s32 hot_x; ++ __s32 hot_y; ++}; ++ ++struct drm_mode_crtc_lut { ++ __u32 crtc_id; ++ __u32 gamma_size; ++ ++ /* pointers to arrays */ ++ __u64 red; ++ __u64 green; ++ __u64 blue; ++}; ++ ++struct drm_color_ctm { ++ /* ++ * Conversion matrix in S31.32 sign-magnitude ++ * (not two's complement!) format. ++ */ ++ __u64 matrix[9]; ++}; ++ ++struct drm_color_lut { ++ /* ++ * Values are mapped linearly to 0.0 - 1.0 range, with 0x0 == 0.0 and ++ * 0xffff == 1.0. ++ */ ++ __u16 red; ++ __u16 green; ++ __u16 blue; ++ __u16 reserved; ++}; ++ ++/** ++ * struct hdr_metadata_infoframe - HDR Metadata Infoframe Data. ++ * ++ * HDR Metadata Infoframe as per CTA 861.G spec. This is expected ++ * to match exactly with the spec. ++ * ++ * Userspace is expected to pass the metadata information as per ++ * the format described in this structure. ++ */ ++struct hdr_metadata_infoframe { ++ /** ++ * @eotf: Electro-Optical Transfer Function (EOTF) ++ * used in the stream. ++ */ ++ __u8 eotf; ++ /** ++ * @metadata_type: Static_Metadata_Descriptor_ID. ++ */ ++ __u8 metadata_type; ++ /** ++ * @display_primaries: Color Primaries of the Data. ++ * These are coded as unsigned 16-bit values in units of ++ * 0.00002, where 0x0000 represents zero and 0xC350 ++ * represents 1.0000. ++ * @display_primaries.x: X cordinate of color primary. ++ * @display_primaries.y: Y cordinate of color primary. ++ */ ++ struct { ++ __u16 x, y; ++ } display_primaries[3]; ++ /** ++ * @white_point: White Point of Colorspace Data. ++ * These are coded as unsigned 16-bit values in units of ++ * 0.00002, where 0x0000 represents zero and 0xC350 ++ * represents 1.0000. ++ * @white_point.x: X cordinate of whitepoint of color primary. ++ * @white_point.y: Y cordinate of whitepoint of color primary. ++ */ ++ struct { ++ __u16 x, y; ++ } white_point; ++ /** ++ * @max_display_mastering_luminance: Max Mastering Display Luminance. ++ * This value is coded as an unsigned 16-bit value in units of 1 cd/m2, ++ * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2. ++ */ ++ __u16 max_display_mastering_luminance; ++ /** ++ * @min_display_mastering_luminance: Min Mastering Display Luminance. ++ * This value is coded as an unsigned 16-bit value in units of ++ * 0.0001 cd/m2, where 0x0001 represents 0.0001 cd/m2 and 0xFFFF ++ * represents 6.5535 cd/m2. ++ */ ++ __u16 min_display_mastering_luminance; ++ /** ++ * @max_cll: Max Content Light Level. ++ * This value is coded as an unsigned 16-bit value in units of 1 cd/m2, ++ * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2. ++ */ ++ __u16 max_cll; ++ /** ++ * @max_fall: Max Frame Average Light Level. ++ * This value is coded as an unsigned 16-bit value in units of 1 cd/m2, ++ * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2. ++ */ ++ __u16 max_fall; ++}; ++ ++/** ++ * struct hdr_output_metadata - HDR output metadata ++ * ++ * Metadata Information to be passed from userspace ++ */ ++struct hdr_output_metadata { ++ /** ++ * @metadata_type: Static_Metadata_Descriptor_ID. ++ */ ++ __u32 metadata_type; ++ /** ++ * @hdmi_metadata_type1: HDR Metadata Infoframe. ++ */ ++ union { ++ struct hdr_metadata_infoframe hdmi_metadata_type1; ++ }; ++}; ++ ++#define DRM_MODE_PAGE_FLIP_EVENT 0x01 ++#define DRM_MODE_PAGE_FLIP_ASYNC 0x02 ++#define DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE 0x4 ++#define DRM_MODE_PAGE_FLIP_TARGET_RELATIVE 0x8 ++#define DRM_MODE_PAGE_FLIP_TARGET (DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE | \ ++ DRM_MODE_PAGE_FLIP_TARGET_RELATIVE) ++#define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT | \ ++ DRM_MODE_PAGE_FLIP_ASYNC | \ ++ DRM_MODE_PAGE_FLIP_TARGET) ++ ++/* ++ * Request a page flip on the specified crtc. ++ * ++ * This ioctl will ask KMS to schedule a page flip for the specified ++ * crtc. Once any pending rendering targeting the specified fb (as of ++ * ioctl time) has completed, the crtc will be reprogrammed to display ++ * that fb after the next vertical refresh. The ioctl returns ++ * immediately, but subsequent rendering to the current fb will block ++ * in the execbuffer ioctl until the page flip happens. If a page ++ * flip is already pending as the ioctl is called, EBUSY will be ++ * returned. ++ * ++ * Flag DRM_MODE_PAGE_FLIP_EVENT requests that drm sends back a vblank ++ * event (see drm.h: struct drm_event_vblank) when the page flip is ++ * done. The user_data field passed in with this ioctl will be ++ * returned as the user_data field in the vblank event struct. ++ * ++ * Flag DRM_MODE_PAGE_FLIP_ASYNC requests that the flip happen ++ * 'as soon as possible', meaning that it not delay waiting for vblank. ++ * This may cause tearing on the screen. ++ * ++ * The reserved field must be zero. ++ */ ++ ++struct drm_mode_crtc_page_flip { ++ __u32 crtc_id; ++ __u32 fb_id; ++ __u32 flags; ++ __u32 reserved; ++ __u64 user_data; ++}; ++ ++/* ++ * Request a page flip on the specified crtc. ++ * ++ * Same as struct drm_mode_crtc_page_flip, but supports new flags and ++ * re-purposes the reserved field: ++ * ++ * The sequence field must be zero unless either of the ++ * DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags is specified. When ++ * the ABSOLUTE flag is specified, the sequence field denotes the absolute ++ * vblank sequence when the flip should take effect. When the RELATIVE ++ * flag is specified, the sequence field denotes the relative (to the ++ * current one when the ioctl is called) vblank sequence when the flip ++ * should take effect. NOTE: DRM_IOCTL_WAIT_VBLANK must still be used to ++ * make sure the vblank sequence before the target one has passed before ++ * calling this ioctl. The purpose of the ++ * DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags is merely to clarify ++ * the target for when code dealing with a page flip runs during a ++ * vertical blank period. ++ */ ++ ++struct drm_mode_crtc_page_flip_target { ++ __u32 crtc_id; ++ __u32 fb_id; ++ __u32 flags; ++ __u32 sequence; ++ __u64 user_data; ++}; ++ ++/* create a dumb scanout buffer */ ++struct drm_mode_create_dumb { ++ __u32 height; ++ __u32 width; ++ __u32 bpp; ++ __u32 flags; ++ /* handle, pitch, size will be returned */ ++ __u32 handle; ++ __u32 pitch; ++ __u64 size; ++}; ++ ++/* set up for mmap of a dumb scanout buffer */ ++struct drm_mode_map_dumb { ++ /** Handle for the object being mapped. */ ++ __u32 handle; ++ __u32 pad; ++ /** ++ * Fake offset to use for subsequent mmap call ++ * ++ * This is a fixed-size type for 32/64 compatibility. ++ */ ++ __u64 offset; ++}; ++ ++struct drm_mode_destroy_dumb { ++ __u32 handle; ++}; ++ ++/* page-flip flags are valid, plus: */ ++#define DRM_MODE_ATOMIC_TEST_ONLY 0x0100 ++#define DRM_MODE_ATOMIC_NONBLOCK 0x0200 ++#define DRM_MODE_ATOMIC_ALLOW_MODESET 0x0400 ++ ++#define DRM_MODE_ATOMIC_FLAGS (\ ++ DRM_MODE_PAGE_FLIP_EVENT |\ ++ DRM_MODE_PAGE_FLIP_ASYNC |\ ++ DRM_MODE_ATOMIC_TEST_ONLY |\ ++ DRM_MODE_ATOMIC_NONBLOCK |\ ++ DRM_MODE_ATOMIC_ALLOW_MODESET) ++ ++struct drm_mode_atomic { ++ __u32 flags; ++ __u32 count_objs; ++ __u64 objs_ptr; ++ __u64 count_props_ptr; ++ __u64 props_ptr; ++ __u64 prop_values_ptr; ++ __u64 reserved; ++ __u64 user_data; ++}; ++ ++struct drm_format_modifier_blob { ++#define FORMAT_BLOB_CURRENT 1 ++ /* Version of this blob format */ ++ __u32 version; ++ ++ /* Flags */ ++ __u32 flags; ++ ++ /* Number of fourcc formats supported */ ++ __u32 count_formats; ++ ++ /* Where in this blob the formats exist (in bytes) */ ++ __u32 formats_offset; ++ ++ /* Number of drm_format_modifiers */ ++ __u32 count_modifiers; ++ ++ /* Where in this blob the modifiers exist (in bytes) */ ++ __u32 modifiers_offset; ++ ++ /* __u32 formats[] */ ++ /* struct drm_format_modifier modifiers[] */ ++}; ++ ++struct drm_format_modifier { ++ /* Bitmask of formats in get_plane format list this info applies to. The ++ * offset allows a sliding window of which 64 formats (bits). ++ * ++ * Some examples: ++ * In today's world with < 65 formats, and formats 0, and 2 are ++ * supported ++ * 0x0000000000000005 ++ * ^-offset = 0, formats = 5 ++ * ++ * If the number formats grew to 128, and formats 98-102 are ++ * supported with the modifier: ++ * ++ * 0x0000007c00000000 0000000000000000 ++ * ^ ++ * |__offset = 64, formats = 0x7c00000000 ++ * ++ */ ++ __u64 formats; ++ __u32 offset; ++ __u32 pad; ++ ++ /* The modifier that applies to the >get_plane format list bitmask. */ ++ __u64 modifier; ++}; ++ ++/** ++ * struct drm_mode_create_blob - Create New blob property ++ * ++ * Create a new 'blob' data property, copying length bytes from data pointer, ++ * and returning new blob ID. ++ */ ++struct drm_mode_create_blob { ++ /** @data: Pointer to data to copy. */ ++ __u64 data; ++ /** @length: Length of data to copy. */ ++ __u32 length; ++ /** @blob_id: Return: new property ID. */ ++ __u32 blob_id; ++}; ++ ++/** ++ * struct drm_mode_destroy_blob - Destroy user blob ++ * @blob_id: blob_id to destroy ++ * ++ * Destroy a user-created blob property. ++ * ++ * User-space can release blobs as soon as they do not need to refer to them by ++ * their blob object ID. For instance, if you are using a MODE_ID blob in an ++ * atomic commit and you will not make another commit re-using the same ID, you ++ * can destroy the blob as soon as the commit has been issued, without waiting ++ * for it to complete. ++ */ ++struct drm_mode_destroy_blob { ++ __u32 blob_id; ++}; ++ ++/** ++ * struct drm_mode_create_lease - Create lease ++ * ++ * Lease mode resources, creating another drm_master. ++ * ++ * The @object_ids array must reference at least one CRTC, one connector and ++ * one plane if &DRM_CLIENT_CAP_UNIVERSAL_PLANES is enabled. Alternatively, ++ * the lease can be completely empty. ++ */ ++struct drm_mode_create_lease { ++ /** @object_ids: Pointer to array of object ids (__u32) */ ++ __u64 object_ids; ++ /** @object_count: Number of object ids */ ++ __u32 object_count; ++ /** @flags: flags for new FD (O_CLOEXEC, etc) */ ++ __u32 flags; ++ ++ /** @lessee_id: Return: unique identifier for lessee. */ ++ __u32 lessee_id; ++ /** @fd: Return: file descriptor to new drm_master file */ ++ __u32 fd; ++}; ++ ++/** ++ * struct drm_mode_list_lessees - List lessees ++ * ++ * List lesses from a drm_master. ++ */ ++struct drm_mode_list_lessees { ++ /** ++ * @count_lessees: Number of lessees. ++ * ++ * On input, provides length of the array. ++ * On output, provides total number. No ++ * more than the input number will be written ++ * back, so two calls can be used to get ++ * the size and then the data. ++ */ ++ __u32 count_lessees; ++ /** @pad: Padding. */ ++ __u32 pad; ++ ++ /** ++ * @lessees_ptr: Pointer to lessees. ++ * ++ * Pointer to __u64 array of lessee ids ++ */ ++ __u64 lessees_ptr; ++}; ++ ++/** ++ * struct drm_mode_get_lease - Get Lease ++ * ++ * Get leased objects. ++ */ ++struct drm_mode_get_lease { ++ /** ++ * @count_objects: Number of leased objects. ++ * ++ * On input, provides length of the array. ++ * On output, provides total number. No ++ * more than the input number will be written ++ * back, so two calls can be used to get ++ * the size and then the data. ++ */ ++ __u32 count_objects; ++ /** @pad: Padding. */ ++ __u32 pad; ++ ++ /** ++ * @objects_ptr: Pointer to objects. ++ * ++ * Pointer to __u32 array of object ids. ++ */ ++ __u64 objects_ptr; ++}; ++ ++/** ++ * struct drm_mode_revoke_lease - Revoke lease ++ */ ++struct drm_mode_revoke_lease { ++ /** @lessee_id: Unique ID of lessee */ ++ __u32 lessee_id; ++}; ++ ++/** ++ * struct drm_mode_rect - Two dimensional rectangle. ++ * @x1: Horizontal starting coordinate (inclusive). ++ * @y1: Vertical starting coordinate (inclusive). ++ * @x2: Horizontal ending coordinate (exclusive). ++ * @y2: Vertical ending coordinate (exclusive). ++ * ++ * With drm subsystem using struct drm_rect to manage rectangular area this ++ * export it to user-space. ++ * ++ * Currently used by drm_mode_atomic blob property FB_DAMAGE_CLIPS. ++ */ ++struct drm_mode_rect { ++ __s32 x1; ++ __s32 y1; ++ __s32 x2; ++ __s32 y2; ++}; ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif +diff -up firefox-103.0/third_party/drm/drm/xf86drm.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/drm/drm/xf86drm.h +--- firefox-103.0/third_party/drm/drm/xf86drm.h.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.428095335 +0200 ++++ firefox-103.0/third_party/drm/drm/xf86drm.h 2022-07-26 16:30:19.428095335 +0200 +@@ -0,0 +1,966 @@ ++/** ++ * \file xf86drm.h ++ * OS-independent header for DRM user-level library interface. ++ * ++ * \author Rickard E. (Rik) Faith ++ */ ++ ++/* ++ * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas. ++ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. ++ * All Rights Reserved. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++ * DEALINGS IN THE SOFTWARE. ++ * ++ */ ++ ++#ifndef _XF86DRM_H_ ++#define _XF86DRM_H_ ++ ++#include ++#include ++#include ++#include ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++#ifndef DRM_MAX_MINOR ++#define DRM_MAX_MINOR 16 ++#endif ++ ++#if defined(__linux__) ++ ++#define DRM_IOCTL_NR(n) _IOC_NR(n) ++#define DRM_IOC_VOID _IOC_NONE ++#define DRM_IOC_READ _IOC_READ ++#define DRM_IOC_WRITE _IOC_WRITE ++#define DRM_IOC_READWRITE _IOC_READ|_IOC_WRITE ++#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size) ++ ++#else /* One of the *BSDs */ ++ ++#include ++#define DRM_IOCTL_NR(n) ((n) & 0xff) ++#define DRM_IOC_VOID IOC_VOID ++#define DRM_IOC_READ IOC_OUT ++#define DRM_IOC_WRITE IOC_IN ++#define DRM_IOC_READWRITE IOC_INOUT ++#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size) ++ ++#endif ++ ++ /* Defaults, if nothing set in xf86config */ ++#define DRM_DEV_UID 0 ++#define DRM_DEV_GID 0 ++/* Default /dev/dri directory permissions 0755 */ ++#define DRM_DEV_DIRMODE \ ++ (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) ++#define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) ++ ++#ifdef __OpenBSD__ ++#define DRM_DIR_NAME "/dev" ++#define DRM_PRIMARY_MINOR_NAME "drm" ++#define DRM_CONTROL_MINOR_NAME "drmC" ++#define DRM_RENDER_MINOR_NAME "drmR" ++#else ++#define DRM_DIR_NAME "/dev/dri" ++#define DRM_PRIMARY_MINOR_NAME "card" ++#define DRM_CONTROL_MINOR_NAME "controlD" ++#define DRM_RENDER_MINOR_NAME "renderD" ++#define DRM_PROC_NAME "/proc/dri/" /* For backward Linux compatibility */ ++#endif ++ ++#define DRM_DEV_NAME "%s/" DRM_PRIMARY_MINOR_NAME "%d" ++#define DRM_CONTROL_DEV_NAME "%s/" DRM_CONTROL_MINOR_NAME "%d" ++#define DRM_RENDER_DEV_NAME "%s/" DRM_RENDER_MINOR_NAME "%d" ++ ++#define DRM_NODE_NAME_MAX \ ++ (sizeof(DRM_DIR_NAME) + 1 /* slash */ \ ++ + MAX3(sizeof(DRM_PRIMARY_MINOR_NAME), \ ++ sizeof(DRM_CONTROL_MINOR_NAME), \ ++ sizeof(DRM_RENDER_MINOR_NAME)) \ ++ + sizeof("144") /* highest possible node number */ \ ++ + 1) /* NULL-terminator */ ++ ++#define DRM_ERR_NO_DEVICE (-1001) ++#define DRM_ERR_NO_ACCESS (-1002) ++#define DRM_ERR_NOT_ROOT (-1003) ++#define DRM_ERR_INVALID (-1004) ++#define DRM_ERR_NO_FD (-1005) ++ ++#define DRM_AGP_NO_HANDLE 0 ++ ++typedef unsigned int drmSize, *drmSizePtr; /**< For mapped regions */ ++typedef void *drmAddress, **drmAddressPtr; /**< For mapped regions */ ++ ++#if (__GNUC__ >= 3) ++#define DRM_PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a))) ++#else ++#define DRM_PRINTFLIKE(f, a) ++#endif ++ ++typedef struct _drmServerInfo { ++ int (*debug_print)(const char *format, va_list ap) DRM_PRINTFLIKE(1,0); ++ int (*load_module)(const char *name); ++ void (*get_perms)(gid_t *, mode_t *); ++} drmServerInfo, *drmServerInfoPtr; ++ ++typedef struct drmHashEntry { ++ int fd; ++ void (*f)(int, void *, void *); ++ void *tagTable; ++} drmHashEntry; ++ ++extern int drmIoctl(int fd, unsigned long request, void *arg); ++extern void *drmGetHashTable(void); ++extern drmHashEntry *drmGetEntry(int fd); ++ ++/** ++ * Driver version information. ++ * ++ * \sa drmGetVersion() and drmSetVersion(). ++ */ ++typedef struct _drmVersion { ++ int version_major; /**< Major version */ ++ int version_minor; /**< Minor version */ ++ int version_patchlevel; /**< Patch level */ ++ int name_len; /**< Length of name buffer */ ++ char *name; /**< Name of driver */ ++ int date_len; /**< Length of date buffer */ ++ char *date; /**< User-space buffer to hold date */ ++ int desc_len; /**< Length of desc buffer */ ++ char *desc; /**< User-space buffer to hold desc */ ++} drmVersion, *drmVersionPtr; ++ ++typedef struct _drmStats { ++ unsigned long count; /**< Number of data */ ++ struct { ++ unsigned long value; /**< Value from kernel */ ++ const char *long_format; /**< Suggested format for long_name */ ++ const char *long_name; /**< Long name for value */ ++ const char *rate_format; /**< Suggested format for rate_name */ ++ const char *rate_name; /**< Short name for value per second */ ++ int isvalue; /**< True if value (vs. counter) */ ++ const char *mult_names; /**< Multiplier names (e.g., "KGM") */ ++ int mult; /**< Multiplier value (e.g., 1024) */ ++ int verbose; /**< Suggest only in verbose output */ ++ } data[15]; ++} drmStatsT; ++ ++ ++ /* All of these enums *MUST* match with the ++ kernel implementation -- so do *NOT* ++ change them! (The drmlib implementation ++ will just copy the flags instead of ++ translating them.) */ ++typedef enum { ++ DRM_FRAME_BUFFER = 0, /**< WC, no caching, no core dump */ ++ DRM_REGISTERS = 1, /**< no caching, no core dump */ ++ DRM_SHM = 2, /**< shared, cached */ ++ DRM_AGP = 3, /**< AGP/GART */ ++ DRM_SCATTER_GATHER = 4, /**< PCI scatter/gather */ ++ DRM_CONSISTENT = 5 /**< PCI consistent */ ++} drmMapType; ++ ++typedef enum { ++ DRM_RESTRICTED = 0x0001, /**< Cannot be mapped to client-virtual */ ++ DRM_READ_ONLY = 0x0002, /**< Read-only in client-virtual */ ++ DRM_LOCKED = 0x0004, /**< Physical pages locked */ ++ DRM_KERNEL = 0x0008, /**< Kernel requires access */ ++ DRM_WRITE_COMBINING = 0x0010, /**< Use write-combining, if available */ ++ DRM_CONTAINS_LOCK = 0x0020, /**< SHM page that contains lock */ ++ DRM_REMOVABLE = 0x0040 /**< Removable mapping */ ++} drmMapFlags; ++ ++/** ++ * \warning These values *MUST* match drm.h ++ */ ++typedef enum { ++ /** \name Flags for DMA buffer dispatch */ ++ /*@{*/ ++ DRM_DMA_BLOCK = 0x01, /**< ++ * Block until buffer dispatched. ++ * ++ * \note the buffer may not yet have been ++ * processed by the hardware -- getting a ++ * hardware lock with the hardware quiescent ++ * will ensure that the buffer has been ++ * processed. ++ */ ++ DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */ ++ DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */ ++ /*@}*/ ++ ++ /** \name Flags for DMA buffer request */ ++ /*@{*/ ++ DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */ ++ DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */ ++ DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ ++ /*@}*/ ++} drmDMAFlags; ++ ++typedef enum { ++ DRM_PAGE_ALIGN = 0x01, ++ DRM_AGP_BUFFER = 0x02, ++ DRM_SG_BUFFER = 0x04, ++ DRM_FB_BUFFER = 0x08, ++ DRM_PCI_BUFFER_RO = 0x10 ++} drmBufDescFlags; ++ ++typedef enum { ++ DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */ ++ DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */ ++ DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */ ++ DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */ ++ /* These *HALT* flags aren't supported yet ++ -- they will be used to support the ++ full-screen DGA-like mode. */ ++ DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */ ++ DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ ++} drmLockFlags; ++ ++typedef enum { ++ DRM_CONTEXT_PRESERVED = 0x01, /**< This context is preserved and ++ never swapped. */ ++ DRM_CONTEXT_2DONLY = 0x02 /**< This context is for 2D rendering only. */ ++} drm_context_tFlags, *drm_context_tFlagsPtr; ++ ++typedef struct _drmBufDesc { ++ int count; /**< Number of buffers of this size */ ++ int size; /**< Size in bytes */ ++ int low_mark; /**< Low water mark */ ++ int high_mark; /**< High water mark */ ++} drmBufDesc, *drmBufDescPtr; ++ ++typedef struct _drmBufInfo { ++ int count; /**< Number of buffers described in list */ ++ drmBufDescPtr list; /**< List of buffer descriptions */ ++} drmBufInfo, *drmBufInfoPtr; ++ ++typedef struct _drmBuf { ++ int idx; /**< Index into the master buffer list */ ++ int total; /**< Buffer size */ ++ int used; /**< Amount of buffer in use (for DMA) */ ++ drmAddress address; /**< Address */ ++} drmBuf, *drmBufPtr; ++ ++/** ++ * Buffer mapping information. ++ * ++ * Used by drmMapBufs() and drmUnmapBufs() to store information about the ++ * mapped buffers. ++ */ ++typedef struct _drmBufMap { ++ int count; /**< Number of buffers mapped */ ++ drmBufPtr list; /**< Buffers */ ++} drmBufMap, *drmBufMapPtr; ++ ++typedef struct _drmLock { ++ volatile unsigned int lock; ++ char padding[60]; ++ /* This is big enough for most current (and future?) architectures: ++ DEC Alpha: 32 bytes ++ Intel Merced: ? ++ Intel P5/PPro/PII/PIII: 32 bytes ++ Intel StrongARM: 32 bytes ++ Intel i386/i486: 16 bytes ++ MIPS: 32 bytes (?) ++ Motorola 68k: 16 bytes ++ Motorola PowerPC: 32 bytes ++ Sun SPARC: 32 bytes ++ */ ++} drmLock, *drmLockPtr; ++ ++/** ++ * Indices here refer to the offset into ++ * list in drmBufInfo ++ */ ++typedef struct _drmDMAReq { ++ drm_context_t context; /**< Context handle */ ++ int send_count; /**< Number of buffers to send */ ++ int *send_list; /**< List of handles to buffers */ ++ int *send_sizes; /**< Lengths of data to send, in bytes */ ++ drmDMAFlags flags; /**< Flags */ ++ int request_count; /**< Number of buffers requested */ ++ int request_size; /**< Desired size of buffers requested */ ++ int *request_list; /**< Buffer information */ ++ int *request_sizes; /**< Minimum acceptable sizes */ ++ int granted_count; /**< Number of buffers granted at this size */ ++} drmDMAReq, *drmDMAReqPtr; ++ ++typedef struct _drmRegion { ++ drm_handle_t handle; ++ unsigned int offset; ++ drmSize size; ++ drmAddress map; ++} drmRegion, *drmRegionPtr; ++ ++typedef struct _drmTextureRegion { ++ unsigned char next; ++ unsigned char prev; ++ unsigned char in_use; ++ unsigned char padding; /**< Explicitly pad this out */ ++ unsigned int age; ++} drmTextureRegion, *drmTextureRegionPtr; ++ ++ ++typedef enum { ++ DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ ++ DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ ++ /* bits 1-6 are reserved for high crtcs */ ++ DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e, ++ DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */ ++ DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ ++ DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ ++ DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ ++ DRM_VBLANK_SIGNAL = 0x40000000 /* Send signal instead of blocking */ ++} drmVBlankSeqType; ++#define DRM_VBLANK_HIGH_CRTC_SHIFT 1 ++ ++typedef struct _drmVBlankReq { ++ drmVBlankSeqType type; ++ unsigned int sequence; ++ unsigned long signal; ++} drmVBlankReq, *drmVBlankReqPtr; ++ ++typedef struct _drmVBlankReply { ++ drmVBlankSeqType type; ++ unsigned int sequence; ++ long tval_sec; ++ long tval_usec; ++} drmVBlankReply, *drmVBlankReplyPtr; ++ ++typedef union _drmVBlank { ++ drmVBlankReq request; ++ drmVBlankReply reply; ++} drmVBlank, *drmVBlankPtr; ++ ++typedef struct _drmSetVersion { ++ int drm_di_major; ++ int drm_di_minor; ++ int drm_dd_major; ++ int drm_dd_minor; ++} drmSetVersion, *drmSetVersionPtr; ++ ++#define __drm_dummy_lock(lock) (*(__volatile__ unsigned int *)lock) ++ ++#define DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */ ++#define DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */ ++ ++#if defined(__GNUC__) && (__GNUC__ >= 2) ++# if defined(__i386) || defined(__AMD64__) || defined(__x86_64__) || defined(__amd64__) ++ /* Reflect changes here to drmP.h */ ++#define DRM_CAS(lock,old,new,__ret) \ ++ do { \ ++ int __dummy; /* Can't mark eax as clobbered */ \ ++ __asm__ __volatile__( \ ++ "lock ; cmpxchg %4,%1\n\t" \ ++ "setnz %0" \ ++ : "=d" (__ret), \ ++ "=m" (__drm_dummy_lock(lock)), \ ++ "=a" (__dummy) \ ++ : "2" (old), \ ++ "r" (new)); \ ++ } while (0) ++ ++#elif defined(__alpha__) ++ ++#define DRM_CAS(lock, old, new, ret) \ ++ do { \ ++ int tmp, old32; \ ++ __asm__ __volatile__( \ ++ " addl $31, %5, %3\n" \ ++ "1: ldl_l %0, %2\n" \ ++ " cmpeq %0, %3, %1\n" \ ++ " beq %1, 2f\n" \ ++ " mov %4, %0\n" \ ++ " stl_c %0, %2\n" \ ++ " beq %0, 3f\n" \ ++ " mb\n" \ ++ "2: cmpeq %1, 0, %1\n" \ ++ ".subsection 2\n" \ ++ "3: br 1b\n" \ ++ ".previous" \ ++ : "=&r"(tmp), "=&r"(ret), \ ++ "=m"(__drm_dummy_lock(lock)), \ ++ "=&r"(old32) \ ++ : "r"(new), "r"(old) \ ++ : "memory"); \ ++ } while (0) ++ ++#elif defined(__sparc__) ++ ++#define DRM_CAS(lock,old,new,__ret) \ ++do { register unsigned int __old __asm("o0"); \ ++ register unsigned int __new __asm("o1"); \ ++ register volatile unsigned int *__lock __asm("o2"); \ ++ __old = old; \ ++ __new = new; \ ++ __lock = (volatile unsigned int *)lock; \ ++ __asm__ __volatile__( \ ++ /*"cas [%2], %3, %0"*/ \ ++ ".word 0xd3e29008\n\t" \ ++ /*"membar #StoreStore | #StoreLoad"*/ \ ++ ".word 0x8143e00a" \ ++ : "=&r" (__new) \ ++ : "0" (__new), \ ++ "r" (__lock), \ ++ "r" (__old) \ ++ : "memory"); \ ++ __ret = (__new != __old); \ ++} while(0) ++ ++#elif defined(__ia64__) ++ ++#ifdef __INTEL_COMPILER ++/* this currently generates bad code (missing stop bits)... */ ++#include ++ ++#define DRM_CAS(lock,old,new,__ret) \ ++ do { \ ++ unsigned long __result, __old = (old) & 0xffffffff; \ ++ __mf(); \ ++ __result = _InterlockedCompareExchange_acq(&__drm_dummy_lock(lock), (new), __old);\ ++ __ret = (__result) != (__old); \ ++/* __ret = (__sync_val_compare_and_swap(&__drm_dummy_lock(lock), \ ++ (old), (new)) \ ++ != (old)); */\ ++ } while (0) ++ ++#else ++#define DRM_CAS(lock,old,new,__ret) \ ++ do { \ ++ unsigned int __result, __old = (old); \ ++ __asm__ __volatile__( \ ++ "mf\n" \ ++ "mov ar.ccv=%2\n" \ ++ ";;\n" \ ++ "cmpxchg4.acq %0=%1,%3,ar.ccv" \ ++ : "=r" (__result), "=m" (__drm_dummy_lock(lock)) \ ++ : "r" ((unsigned long)__old), "r" (new) \ ++ : "memory"); \ ++ __ret = (__result) != (__old); \ ++ } while (0) ++ ++#endif ++ ++#elif defined(__powerpc__) ++ ++#define DRM_CAS(lock,old,new,__ret) \ ++ do { \ ++ __asm__ __volatile__( \ ++ "sync;" \ ++ "0: lwarx %0,0,%1;" \ ++ " xor. %0,%3,%0;" \ ++ " bne 1f;" \ ++ " stwcx. %2,0,%1;" \ ++ " bne- 0b;" \ ++ "1: " \ ++ "sync;" \ ++ : "=&r"(__ret) \ ++ : "r"(lock), "r"(new), "r"(old) \ ++ : "cr0", "memory"); \ ++ } while (0) ++ ++# elif defined (__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \ ++ || defined (__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \ ++ || defined (__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) \ ++ || defined (__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \ ++ || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \ ++ || defined(__ARM_ARCH_7EM__) ++ /* excluding ARMv4/ARMv5 and lower (lacking ldrex/strex support) */ ++ #undef DRM_DEV_MODE ++ #define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) ++ ++ #define DRM_CAS(lock,old,new,__ret) \ ++ do { \ ++ __asm__ __volatile__ ( \ ++ "1: ldrex %0, [%1]\n" \ ++ " teq %0, %2\n" \ ++ " ite eq\n" \ ++ " strexeq %0, %3, [%1]\n" \ ++ " movne %0, #1\n" \ ++ : "=&r" (__ret) \ ++ : "r" (lock), "r" (old), "r" (new) \ ++ : "cc","memory"); \ ++ } while (0) ++ ++#endif /* architecture */ ++#endif /* __GNUC__ >= 2 */ ++ ++#ifndef DRM_CAS ++#define DRM_CAS(lock,old,new,ret) do { ret=1; } while (0) /* FAST LOCK FAILS */ ++#endif ++ ++#if defined(__alpha__) ++#define DRM_CAS_RESULT(_result) long _result ++#elif defined(__powerpc__) ++#define DRM_CAS_RESULT(_result) int _result ++#else ++#define DRM_CAS_RESULT(_result) char _result ++#endif ++ ++#define DRM_LIGHT_LOCK(fd,lock,context) \ ++ do { \ ++ DRM_CAS_RESULT(__ret); \ ++ DRM_CAS(lock,context,DRM_LOCK_HELD|context,__ret); \ ++ if (__ret) drmGetLock(fd,context,0); \ ++ } while(0) ++ ++ /* This one counts fast locks -- for ++ benchmarking only. */ ++#define DRM_LIGHT_LOCK_COUNT(fd,lock,context,count) \ ++ do { \ ++ DRM_CAS_RESULT(__ret); \ ++ DRM_CAS(lock,context,DRM_LOCK_HELD|context,__ret); \ ++ if (__ret) drmGetLock(fd,context,0); \ ++ else ++count; \ ++ } while(0) ++ ++#define DRM_LOCK(fd,lock,context,flags) \ ++ do { \ ++ if (flags) drmGetLock(fd,context,flags); \ ++ else DRM_LIGHT_LOCK(fd,lock,context); \ ++ } while(0) ++ ++#define DRM_UNLOCK(fd,lock,context) \ ++ do { \ ++ DRM_CAS_RESULT(__ret); \ ++ DRM_CAS(lock,DRM_LOCK_HELD|context,context,__ret); \ ++ if (__ret) drmUnlock(fd,context); \ ++ } while(0) ++ ++ /* Simple spin locks */ ++#define DRM_SPINLOCK(spin,val) \ ++ do { \ ++ DRM_CAS_RESULT(__ret); \ ++ do { \ ++ DRM_CAS(spin,0,val,__ret); \ ++ if (__ret) while ((spin)->lock); \ ++ } while (__ret); \ ++ } while(0) ++ ++#define DRM_SPINLOCK_TAKE(spin,val) \ ++ do { \ ++ DRM_CAS_RESULT(__ret); \ ++ int cur; \ ++ do { \ ++ cur = (*spin).lock; \ ++ DRM_CAS(spin,cur,val,__ret); \ ++ } while (__ret); \ ++ } while(0) ++ ++#define DRM_SPINLOCK_COUNT(spin,val,count,__ret) \ ++ do { \ ++ int __i; \ ++ __ret = 1; \ ++ for (__i = 0; __ret && __i < count; __i++) { \ ++ DRM_CAS(spin,0,val,__ret); \ ++ if (__ret) for (;__i < count && (spin)->lock; __i++); \ ++ } \ ++ } while(0) ++ ++#define DRM_SPINUNLOCK(spin,val) \ ++ do { \ ++ DRM_CAS_RESULT(__ret); \ ++ if ((*spin).lock == val) { /* else server stole lock */ \ ++ do { \ ++ DRM_CAS(spin,val,0,__ret); \ ++ } while (__ret); \ ++ } \ ++ } while(0) ++ ++ ++ ++/* General user-level programmer's API: unprivileged */ ++extern int drmAvailable(void); ++extern int drmOpen(const char *name, const char *busid); ++ ++#define DRM_NODE_PRIMARY 0 ++#define DRM_NODE_CONTROL 1 ++#define DRM_NODE_RENDER 2 ++#define DRM_NODE_MAX 3 ++ ++extern int drmOpenWithType(const char *name, const char *busid, ++ int type); ++ ++extern int drmOpenControl(int minor); ++extern int drmOpenRender(int minor); ++extern int drmClose(int fd); ++extern drmVersionPtr drmGetVersion(int fd); ++extern drmVersionPtr drmGetLibVersion(int fd); ++extern int drmGetCap(int fd, uint64_t capability, uint64_t *value); ++extern void drmFreeVersion(drmVersionPtr); ++extern int drmGetMagic(int fd, drm_magic_t * magic); ++extern char *drmGetBusid(int fd); ++extern int drmGetInterruptFromBusID(int fd, int busnum, int devnum, ++ int funcnum); ++extern int drmGetMap(int fd, int idx, drm_handle_t *offset, ++ drmSize *size, drmMapType *type, ++ drmMapFlags *flags, drm_handle_t *handle, ++ int *mtrr); ++extern int drmGetClient(int fd, int idx, int *auth, int *pid, ++ int *uid, unsigned long *magic, ++ unsigned long *iocs); ++extern int drmGetStats(int fd, drmStatsT *stats); ++extern int drmSetInterfaceVersion(int fd, drmSetVersion *version); ++extern int drmCommandNone(int fd, unsigned long drmCommandIndex); ++extern int drmCommandRead(int fd, unsigned long drmCommandIndex, ++ void *data, unsigned long size); ++extern int drmCommandWrite(int fd, unsigned long drmCommandIndex, ++ void *data, unsigned long size); ++extern int drmCommandWriteRead(int fd, unsigned long drmCommandIndex, ++ void *data, unsigned long size); ++ ++/* General user-level programmer's API: X server (root) only */ ++extern void drmFreeBusid(const char *busid); ++extern int drmSetBusid(int fd, const char *busid); ++extern int drmAuthMagic(int fd, drm_magic_t magic); ++extern int drmAddMap(int fd, ++ drm_handle_t offset, ++ drmSize size, ++ drmMapType type, ++ drmMapFlags flags, ++ drm_handle_t * handle); ++extern int drmRmMap(int fd, drm_handle_t handle); ++extern int drmAddContextPrivateMapping(int fd, drm_context_t ctx_id, ++ drm_handle_t handle); ++ ++extern int drmAddBufs(int fd, int count, int size, ++ drmBufDescFlags flags, ++ int agp_offset); ++extern int drmMarkBufs(int fd, double low, double high); ++extern int drmCreateContext(int fd, drm_context_t * handle); ++extern int drmSetContextFlags(int fd, drm_context_t context, ++ drm_context_tFlags flags); ++extern int drmGetContextFlags(int fd, drm_context_t context, ++ drm_context_tFlagsPtr flags); ++extern int drmAddContextTag(int fd, drm_context_t context, void *tag); ++extern int drmDelContextTag(int fd, drm_context_t context); ++extern void *drmGetContextTag(int fd, drm_context_t context); ++extern drm_context_t * drmGetReservedContextList(int fd, int *count); ++extern void drmFreeReservedContextList(drm_context_t *); ++extern int drmSwitchToContext(int fd, drm_context_t context); ++extern int drmDestroyContext(int fd, drm_context_t handle); ++extern int drmCreateDrawable(int fd, drm_drawable_t * handle); ++extern int drmDestroyDrawable(int fd, drm_drawable_t handle); ++extern int drmUpdateDrawableInfo(int fd, drm_drawable_t handle, ++ drm_drawable_info_type_t type, ++ unsigned int num, void *data); ++extern int drmCtlInstHandler(int fd, int irq); ++extern int drmCtlUninstHandler(int fd); ++extern int drmSetClientCap(int fd, uint64_t capability, ++ uint64_t value); ++ ++extern int drmCrtcGetSequence(int fd, uint32_t crtcId, ++ uint64_t *sequence, uint64_t *ns); ++extern int drmCrtcQueueSequence(int fd, uint32_t crtcId, ++ uint32_t flags, uint64_t sequence, ++ uint64_t *sequence_queued, ++ uint64_t user_data); ++/* General user-level programmer's API: authenticated client and/or X */ ++extern int drmMap(int fd, ++ drm_handle_t handle, ++ drmSize size, ++ drmAddressPtr address); ++extern int drmUnmap(drmAddress address, drmSize size); ++extern drmBufInfoPtr drmGetBufInfo(int fd); ++extern drmBufMapPtr drmMapBufs(int fd); ++extern int drmUnmapBufs(drmBufMapPtr bufs); ++extern int drmDMA(int fd, drmDMAReqPtr request); ++extern int drmFreeBufs(int fd, int count, int *list); ++extern int drmGetLock(int fd, ++ drm_context_t context, ++ drmLockFlags flags); ++extern int drmUnlock(int fd, drm_context_t context); ++extern int drmFinish(int fd, int context, drmLockFlags flags); ++extern int drmGetContextPrivateMapping(int fd, drm_context_t ctx_id, ++ drm_handle_t * handle); ++ ++/* AGP/GART support: X server (root) only */ ++extern int drmAgpAcquire(int fd); ++extern int drmAgpRelease(int fd); ++extern int drmAgpEnable(int fd, unsigned long mode); ++extern int drmAgpAlloc(int fd, unsigned long size, ++ unsigned long type, unsigned long *address, ++ drm_handle_t *handle); ++extern int drmAgpFree(int fd, drm_handle_t handle); ++extern int drmAgpBind(int fd, drm_handle_t handle, ++ unsigned long offset); ++extern int drmAgpUnbind(int fd, drm_handle_t handle); ++ ++/* AGP/GART info: authenticated client and/or X */ ++extern int drmAgpVersionMajor(int fd); ++extern int drmAgpVersionMinor(int fd); ++extern unsigned long drmAgpGetMode(int fd); ++extern unsigned long drmAgpBase(int fd); /* Physical location */ ++extern unsigned long drmAgpSize(int fd); /* Bytes */ ++extern unsigned long drmAgpMemoryUsed(int fd); ++extern unsigned long drmAgpMemoryAvail(int fd); ++extern unsigned int drmAgpVendorId(int fd); ++extern unsigned int drmAgpDeviceId(int fd); ++ ++/* PCI scatter/gather support: X server (root) only */ ++extern int drmScatterGatherAlloc(int fd, unsigned long size, ++ drm_handle_t *handle); ++extern int drmScatterGatherFree(int fd, drm_handle_t handle); ++ ++extern int drmWaitVBlank(int fd, drmVBlankPtr vbl); ++ ++/* Support routines */ ++extern void drmSetServerInfo(drmServerInfoPtr info); ++extern int drmError(int err, const char *label); ++extern void *drmMalloc(int size); ++extern void drmFree(void *pt); ++ ++/* Hash table routines */ ++extern void *drmHashCreate(void); ++extern int drmHashDestroy(void *t); ++extern int drmHashLookup(void *t, unsigned long key, void **value); ++extern int drmHashInsert(void *t, unsigned long key, void *value); ++extern int drmHashDelete(void *t, unsigned long key); ++extern int drmHashFirst(void *t, unsigned long *key, void **value); ++extern int drmHashNext(void *t, unsigned long *key, void **value); ++ ++/* PRNG routines */ ++extern void *drmRandomCreate(unsigned long seed); ++extern int drmRandomDestroy(void *state); ++extern unsigned long drmRandom(void *state); ++extern double drmRandomDouble(void *state); ++ ++/* Skip list routines */ ++ ++extern void *drmSLCreate(void); ++extern int drmSLDestroy(void *l); ++extern int drmSLLookup(void *l, unsigned long key, void **value); ++extern int drmSLInsert(void *l, unsigned long key, void *value); ++extern int drmSLDelete(void *l, unsigned long key); ++extern int drmSLNext(void *l, unsigned long *key, void **value); ++extern int drmSLFirst(void *l, unsigned long *key, void **value); ++extern void drmSLDump(void *l); ++extern int drmSLLookupNeighbors(void *l, unsigned long key, ++ unsigned long *prev_key, void **prev_value, ++ unsigned long *next_key, void **next_value); ++ ++extern int drmOpenOnce(void *unused, const char *BusID, int *newlyopened); ++extern int drmOpenOnceWithType(const char *BusID, int *newlyopened, int type); ++extern void drmCloseOnce(int fd); ++extern void drmMsg(const char *format, ...) DRM_PRINTFLIKE(1, 2); ++ ++extern int drmSetMaster(int fd); ++extern int drmDropMaster(int fd); ++extern int drmIsMaster(int fd); ++ ++#define DRM_EVENT_CONTEXT_VERSION 4 ++ ++typedef struct _drmEventContext { ++ ++ /* This struct is versioned so we can add more pointers if we ++ * add more events. */ ++ int version; ++ ++ void (*vblank_handler)(int fd, ++ unsigned int sequence, ++ unsigned int tv_sec, ++ unsigned int tv_usec, ++ void *user_data); ++ ++ void (*page_flip_handler)(int fd, ++ unsigned int sequence, ++ unsigned int tv_sec, ++ unsigned int tv_usec, ++ void *user_data); ++ ++ void (*page_flip_handler2)(int fd, ++ unsigned int sequence, ++ unsigned int tv_sec, ++ unsigned int tv_usec, ++ unsigned int crtc_id, ++ void *user_data); ++ ++ void (*sequence_handler)(int fd, ++ uint64_t sequence, ++ uint64_t ns, ++ uint64_t user_data); ++} drmEventContext, *drmEventContextPtr; ++ ++extern int drmHandleEvent(int fd, drmEventContextPtr evctx); ++ ++extern char *drmGetDeviceNameFromFd(int fd); ++ ++/* Improved version of drmGetDeviceNameFromFd which attributes for any type of ++ * device/node - card, control or renderD. ++ */ ++extern char *drmGetDeviceNameFromFd2(int fd); ++extern int drmGetNodeTypeFromFd(int fd); ++ ++/* Convert between GEM handles and DMA-BUF file descriptors. ++ * ++ * Warning: since GEM handles are not reference-counted and are unique per ++ * DRM file description, the caller is expected to perform its own reference ++ * counting. drmPrimeFDToHandle is guaranteed to return the same handle for ++ * different FDs if they reference the same underlying buffer object. This ++ * could even be a buffer object originally created on the same DRM FD. ++ * ++ * When sharing a DRM FD with an API such as EGL or GBM, the caller must not ++ * use drmPrimeHandleToFD nor drmPrimeFDToHandle. A single user-space ++ * reference-counting implementation is necessary to avoid double-closing GEM ++ * handles. ++ * ++ * Two processes can't share the same DRM FD and both use it to create or ++ * import GEM handles, even when using a single user-space reference-counting ++ * implementation like GBM, because GBM doesn't share its state between ++ * processes. ++ */ ++extern int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags, int *prime_fd); ++extern int drmPrimeFDToHandle(int fd, int prime_fd, uint32_t *handle); ++ ++extern int drmCloseBufferHandle(int fd, uint32_t handle); ++ ++extern char *drmGetPrimaryDeviceNameFromFd(int fd); ++extern char *drmGetRenderDeviceNameFromFd(int fd); ++ ++#define DRM_BUS_PCI 0 ++#define DRM_BUS_USB 1 ++#define DRM_BUS_PLATFORM 2 ++#define DRM_BUS_HOST1X 3 ++ ++typedef struct _drmPciBusInfo { ++ uint16_t domain; ++ uint8_t bus; ++ uint8_t dev; ++ uint8_t func; ++} drmPciBusInfo, *drmPciBusInfoPtr; ++ ++typedef struct _drmPciDeviceInfo { ++ uint16_t vendor_id; ++ uint16_t device_id; ++ uint16_t subvendor_id; ++ uint16_t subdevice_id; ++ uint8_t revision_id; ++} drmPciDeviceInfo, *drmPciDeviceInfoPtr; ++ ++typedef struct _drmUsbBusInfo { ++ uint8_t bus; ++ uint8_t dev; ++} drmUsbBusInfo, *drmUsbBusInfoPtr; ++ ++typedef struct _drmUsbDeviceInfo { ++ uint16_t vendor; ++ uint16_t product; ++} drmUsbDeviceInfo, *drmUsbDeviceInfoPtr; ++ ++#define DRM_PLATFORM_DEVICE_NAME_LEN 512 ++ ++typedef struct _drmPlatformBusInfo { ++ char fullname[DRM_PLATFORM_DEVICE_NAME_LEN]; ++} drmPlatformBusInfo, *drmPlatformBusInfoPtr; ++ ++typedef struct _drmPlatformDeviceInfo { ++ char **compatible; /* NULL terminated list of compatible strings */ ++} drmPlatformDeviceInfo, *drmPlatformDeviceInfoPtr; ++ ++#define DRM_HOST1X_DEVICE_NAME_LEN 512 ++ ++typedef struct _drmHost1xBusInfo { ++ char fullname[DRM_HOST1X_DEVICE_NAME_LEN]; ++} drmHost1xBusInfo, *drmHost1xBusInfoPtr; ++ ++typedef struct _drmHost1xDeviceInfo { ++ char **compatible; /* NULL terminated list of compatible strings */ ++} drmHost1xDeviceInfo, *drmHost1xDeviceInfoPtr; ++ ++typedef struct _drmDevice { ++ char **nodes; /* DRM_NODE_MAX sized array */ ++ int available_nodes; /* DRM_NODE_* bitmask */ ++ int bustype; ++ union { ++ drmPciBusInfoPtr pci; ++ drmUsbBusInfoPtr usb; ++ drmPlatformBusInfoPtr platform; ++ drmHost1xBusInfoPtr host1x; ++ } businfo; ++ union { ++ drmPciDeviceInfoPtr pci; ++ drmUsbDeviceInfoPtr usb; ++ drmPlatformDeviceInfoPtr platform; ++ drmHost1xDeviceInfoPtr host1x; ++ } deviceinfo; ++} drmDevice, *drmDevicePtr; ++ ++extern int drmGetDevice(int fd, drmDevicePtr *device); ++extern void drmFreeDevice(drmDevicePtr *device); ++ ++extern int drmGetDevices(drmDevicePtr devices[], int max_devices); ++extern void drmFreeDevices(drmDevicePtr devices[], int count); ++ ++#define DRM_DEVICE_GET_PCI_REVISION (1 << 0) ++extern int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr *device); ++extern int drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices); ++ ++extern int drmGetDeviceFromDevId(dev_t dev_id, uint32_t flags, drmDevicePtr *device); ++ ++extern int drmDevicesEqual(drmDevicePtr a, drmDevicePtr b); ++ ++extern int drmSyncobjCreate(int fd, uint32_t flags, uint32_t *handle); ++extern int drmSyncobjDestroy(int fd, uint32_t handle); ++extern int drmSyncobjHandleToFD(int fd, uint32_t handle, int *obj_fd); ++extern int drmSyncobjFDToHandle(int fd, int obj_fd, uint32_t *handle); ++ ++extern int drmSyncobjImportSyncFile(int fd, uint32_t handle, int sync_file_fd); ++extern int drmSyncobjExportSyncFile(int fd, uint32_t handle, int *sync_file_fd); ++extern int drmSyncobjWait(int fd, uint32_t *handles, unsigned num_handles, ++ int64_t timeout_nsec, unsigned flags, ++ uint32_t *first_signaled); ++extern int drmSyncobjReset(int fd, const uint32_t *handles, uint32_t handle_count); ++extern int drmSyncobjSignal(int fd, const uint32_t *handles, uint32_t handle_count); ++extern int drmSyncobjTimelineSignal(int fd, const uint32_t *handles, ++ uint64_t *points, uint32_t handle_count); ++extern int drmSyncobjTimelineWait(int fd, uint32_t *handles, uint64_t *points, ++ unsigned num_handles, ++ int64_t timeout_nsec, unsigned flags, ++ uint32_t *first_signaled); ++extern int drmSyncobjQuery(int fd, uint32_t *handles, uint64_t *points, ++ uint32_t handle_count); ++extern int drmSyncobjQuery2(int fd, uint32_t *handles, uint64_t *points, ++ uint32_t handle_count, uint32_t flags); ++extern int drmSyncobjTransfer(int fd, ++ uint32_t dst_handle, uint64_t dst_point, ++ uint32_t src_handle, uint64_t src_point, ++ uint32_t flags); ++ ++extern char * ++drmGetFormatModifierVendor(uint64_t modifier); ++ ++extern char * ++drmGetFormatModifierName(uint64_t modifier); ++ ++#ifndef fourcc_mod_get_vendor ++#define fourcc_mod_get_vendor(modifier) \ ++ (((modifier) >> 56) & 0xff) ++#endif ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif +diff -up firefox-103.0/third_party/drm/libdrm/moz.build.libwebrtc-screen-cast-sync firefox-103.0/third_party/drm/libdrm/moz.build +--- firefox-103.0/third_party/drm/libdrm/moz.build.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.428095335 +0200 ++++ firefox-103.0/third_party/drm/libdrm/moz.build 2022-07-26 16:30:19.428095335 +0200 +@@ -0,0 +1,16 @@ ++# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- ++# vim: set filetype=python: ++# This Source Code Form is subject to the terms of the Mozilla Public ++# License, v. 2.0. If a copy of the MPL was not distributed with this ++# file, You can obtain one at http://mozilla.org/MPL/2.0/. ++ ++SOURCES += [ ++ 'mozdrm.cpp', ++] ++ ++if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": ++ CXXFLAGS += CONFIG['MOZ_GTK3_CFLAGS'] ++ ++LOCAL_INCLUDES += ['/third_party/drm'] ++ ++FINAL_LIBRARY = 'xul' +diff -up firefox-103.0/third_party/drm/libdrm/mozdrm.cpp.libwebrtc-screen-cast-sync firefox-103.0/third_party/drm/libdrm/mozdrm.cpp +--- firefox-103.0/third_party/drm/libdrm/mozdrm.cpp.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.428095335 +0200 ++++ firefox-103.0/third_party/drm/libdrm/mozdrm.cpp 2022-07-26 16:30:19.428095335 +0200 +@@ -0,0 +1,66 @@ ++/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* vim:expandtab:shiftwidth=4:tabstop=4: ++ */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#include "mozilla/Types.h" ++#include "prlink.h" ++ ++#include ++ ++#define GET_FUNC(func, lib) \ ++ func##_fn = \ ++ (decltype(func##_fn))PR_FindFunctionSymbol(lib, #func) \ ++ ++#define IS_FUNC_LOADED(func) \ ++ (func != nullptr) \ ++ ++static int (*drmGetDevices2_fn)(uint32_t flags, drmDevicePtr devices[], int max_devices); ++static void (*drmFreeDevices_fn)(drmDevicePtr devices[], int count); ++ ++bool IsDRMLibraryLoaded() { ++ static bool isLoaded = ++ (IS_FUNC_LOADED(drmGetDevices2_fn) && ++ IS_FUNC_LOADED(drmFreeDevices_fn)); ++ ++ return isLoaded; ++} ++ ++bool LoadDRMLibrary() { ++ static PRLibrary* drmLib = nullptr; ++ static bool drmInitialized = false; ++ ++ //TODO Thread safe ++ if (!drmInitialized) { ++ drmInitialized = true; ++ drmLib = PR_LoadLibrary("libdrm.so.2"); ++ if (!drmLib) { ++ return false; ++ } ++ ++ GET_FUNC(drmGetDevices2, drmLib); ++ GET_FUNC(drmFreeDevices, drmLib); ++ } ++ ++ return IsDRMLibraryLoaded(); ++} ++ ++int ++drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices) ++{ ++ if (!LoadDRMLibrary()) { ++ return 0; ++ } ++ return drmGetDevices2_fn(flags, devices, max_devices); ++} ++ ++void ++drmFreeDevices(drmDevicePtr devices[], int count) ++{ ++ if (!LoadDRMLibrary()) { ++ return; ++ } ++ return drmFreeDevices_fn(devices, count); ++} +diff -up firefox-103.0/third_party/drm/README.libwebrtc-screen-cast-sync firefox-103.0/third_party/drm/README +--- firefox-103.0/third_party/drm/README.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.427095302 +0200 ++++ firefox-103.0/third_party/drm/README 2022-07-26 16:30:19.427095302 +0200 +@@ -0,0 +1,4 @@ ++Libdrm is a drm library wrapper needed to build and run Firefox with ++Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/drm). ++ ++libdrm directory stores headers of libdrm needed for build only. +diff -up firefox-103.0/third_party/gbm/gbm/gbm.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/gbm/gbm/gbm.h +--- firefox-103.0/third_party/gbm/gbm/gbm.h.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.429095367 +0200 ++++ firefox-103.0/third_party/gbm/gbm/gbm.h 2022-07-26 16:30:19.429095367 +0200 +@@ -0,0 +1,452 @@ ++/* ++ * Copyright © 2011 Intel Corporation ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ++ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++ * DEALINGS IN THE SOFTWARE. ++ * ++ * Authors: ++ * Benjamin Franzke ++ */ ++ ++#ifndef _GBM_H_ ++#define _GBM_H_ ++ ++#define __GBM__ 1 ++ ++#include ++#include ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++ ++/** ++ * \file gbm.h ++ * \brief Generic Buffer Manager ++ */ ++ ++struct gbm_device; ++struct gbm_bo; ++struct gbm_surface; ++ ++/** ++ * \mainpage The Generic Buffer Manager ++ * ++ * This module provides an abstraction that the caller can use to request a ++ * buffer from the underlying memory management system for the platform. ++ * ++ * This allows the creation of portable code whilst still allowing access to ++ * the underlying memory manager. ++ */ ++ ++/** ++ * Abstraction representing the handle to a buffer allocated by the ++ * manager ++ */ ++union gbm_bo_handle { ++ void *ptr; ++ int32_t s32; ++ uint32_t u32; ++ int64_t s64; ++ uint64_t u64; ++}; ++ ++/** Format of the allocated buffer */ ++enum gbm_bo_format { ++ /** RGB with 8 bits per channel in a 32 bit value */ ++ GBM_BO_FORMAT_XRGB8888, ++ /** ARGB with 8 bits per channel in a 32 bit value */ ++ GBM_BO_FORMAT_ARGB8888 ++}; ++ ++ ++/** ++ * The FourCC format codes are taken from the drm_fourcc.h definition, and ++ * re-namespaced. New GBM formats must not be added, unless they are ++ * identical ports from drm_fourcc. ++ */ ++#define __gbm_fourcc_code(a,b,c,d) ((uint32_t)(a) | ((uint32_t)(b) << 8) | \ ++ ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24)) ++ ++#define GBM_FORMAT_BIG_ENDIAN (1<<31) /* format is big endian instead of little endian */ ++ ++/* color index */ ++#define GBM_FORMAT_C8 __gbm_fourcc_code('C', '8', ' ', ' ') /* [7:0] C */ ++ ++/* 8 bpp Red */ ++#define GBM_FORMAT_R8 __gbm_fourcc_code('R', '8', ' ', ' ') /* [7:0] R */ ++ ++/* 16 bpp Red */ ++#define GBM_FORMAT_R16 __gbm_fourcc_code('R', '1', '6', ' ') /* [15:0] R little endian */ ++ ++/* 16 bpp RG */ ++#define GBM_FORMAT_GR88 __gbm_fourcc_code('G', 'R', '8', '8') /* [15:0] G:R 8:8 little endian */ ++ ++/* 8 bpp RGB */ ++#define GBM_FORMAT_RGB332 __gbm_fourcc_code('R', 'G', 'B', '8') /* [7:0] R:G:B 3:3:2 */ ++#define GBM_FORMAT_BGR233 __gbm_fourcc_code('B', 'G', 'R', '8') /* [7:0] B:G:R 2:3:3 */ ++ ++/* 16 bpp RGB */ ++#define GBM_FORMAT_XRGB4444 __gbm_fourcc_code('X', 'R', '1', '2') /* [15:0] x:R:G:B 4:4:4:4 little endian */ ++#define GBM_FORMAT_XBGR4444 __gbm_fourcc_code('X', 'B', '1', '2') /* [15:0] x:B:G:R 4:4:4:4 little endian */ ++#define GBM_FORMAT_RGBX4444 __gbm_fourcc_code('R', 'X', '1', '2') /* [15:0] R:G:B:x 4:4:4:4 little endian */ ++#define GBM_FORMAT_BGRX4444 __gbm_fourcc_code('B', 'X', '1', '2') /* [15:0] B:G:R:x 4:4:4:4 little endian */ ++ ++#define GBM_FORMAT_ARGB4444 __gbm_fourcc_code('A', 'R', '1', '2') /* [15:0] A:R:G:B 4:4:4:4 little endian */ ++#define GBM_FORMAT_ABGR4444 __gbm_fourcc_code('A', 'B', '1', '2') /* [15:0] A:B:G:R 4:4:4:4 little endian */ ++#define GBM_FORMAT_RGBA4444 __gbm_fourcc_code('R', 'A', '1', '2') /* [15:0] R:G:B:A 4:4:4:4 little endian */ ++#define GBM_FORMAT_BGRA4444 __gbm_fourcc_code('B', 'A', '1', '2') /* [15:0] B:G:R:A 4:4:4:4 little endian */ ++ ++#define GBM_FORMAT_XRGB1555 __gbm_fourcc_code('X', 'R', '1', '5') /* [15:0] x:R:G:B 1:5:5:5 little endian */ ++#define GBM_FORMAT_XBGR1555 __gbm_fourcc_code('X', 'B', '1', '5') /* [15:0] x:B:G:R 1:5:5:5 little endian */ ++#define GBM_FORMAT_RGBX5551 __gbm_fourcc_code('R', 'X', '1', '5') /* [15:0] R:G:B:x 5:5:5:1 little endian */ ++#define GBM_FORMAT_BGRX5551 __gbm_fourcc_code('B', 'X', '1', '5') /* [15:0] B:G:R:x 5:5:5:1 little endian */ ++ ++#define GBM_FORMAT_ARGB1555 __gbm_fourcc_code('A', 'R', '1', '5') /* [15:0] A:R:G:B 1:5:5:5 little endian */ ++#define GBM_FORMAT_ABGR1555 __gbm_fourcc_code('A', 'B', '1', '5') /* [15:0] A:B:G:R 1:5:5:5 little endian */ ++#define GBM_FORMAT_RGBA5551 __gbm_fourcc_code('R', 'A', '1', '5') /* [15:0] R:G:B:A 5:5:5:1 little endian */ ++#define GBM_FORMAT_BGRA5551 __gbm_fourcc_code('B', 'A', '1', '5') /* [15:0] B:G:R:A 5:5:5:1 little endian */ ++ ++#define GBM_FORMAT_RGB565 __gbm_fourcc_code('R', 'G', '1', '6') /* [15:0] R:G:B 5:6:5 little endian */ ++#define GBM_FORMAT_BGR565 __gbm_fourcc_code('B', 'G', '1', '6') /* [15:0] B:G:R 5:6:5 little endian */ ++ ++/* 24 bpp RGB */ ++#define GBM_FORMAT_RGB888 __gbm_fourcc_code('R', 'G', '2', '4') /* [23:0] R:G:B little endian */ ++#define GBM_FORMAT_BGR888 __gbm_fourcc_code('B', 'G', '2', '4') /* [23:0] B:G:R little endian */ ++ ++/* 32 bpp RGB */ ++#define GBM_FORMAT_XRGB8888 __gbm_fourcc_code('X', 'R', '2', '4') /* [31:0] x:R:G:B 8:8:8:8 little endian */ ++#define GBM_FORMAT_XBGR8888 __gbm_fourcc_code('X', 'B', '2', '4') /* [31:0] x:B:G:R 8:8:8:8 little endian */ ++#define GBM_FORMAT_RGBX8888 __gbm_fourcc_code('R', 'X', '2', '4') /* [31:0] R:G:B:x 8:8:8:8 little endian */ ++#define GBM_FORMAT_BGRX8888 __gbm_fourcc_code('B', 'X', '2', '4') /* [31:0] B:G:R:x 8:8:8:8 little endian */ ++ ++#define GBM_FORMAT_ARGB8888 __gbm_fourcc_code('A', 'R', '2', '4') /* [31:0] A:R:G:B 8:8:8:8 little endian */ ++#define GBM_FORMAT_ABGR8888 __gbm_fourcc_code('A', 'B', '2', '4') /* [31:0] A:B:G:R 8:8:8:8 little endian */ ++#define GBM_FORMAT_RGBA8888 __gbm_fourcc_code('R', 'A', '2', '4') /* [31:0] R:G:B:A 8:8:8:8 little endian */ ++#define GBM_FORMAT_BGRA8888 __gbm_fourcc_code('B', 'A', '2', '4') /* [31:0] B:G:R:A 8:8:8:8 little endian */ ++ ++#define GBM_FORMAT_XRGB2101010 __gbm_fourcc_code('X', 'R', '3', '0') /* [31:0] x:R:G:B 2:10:10:10 little endian */ ++#define GBM_FORMAT_XBGR2101010 __gbm_fourcc_code('X', 'B', '3', '0') /* [31:0] x:B:G:R 2:10:10:10 little endian */ ++#define GBM_FORMAT_RGBX1010102 __gbm_fourcc_code('R', 'X', '3', '0') /* [31:0] R:G:B:x 10:10:10:2 little endian */ ++#define GBM_FORMAT_BGRX1010102 __gbm_fourcc_code('B', 'X', '3', '0') /* [31:0] B:G:R:x 10:10:10:2 little endian */ ++ ++#define GBM_FORMAT_ARGB2101010 __gbm_fourcc_code('A', 'R', '3', '0') /* [31:0] A:R:G:B 2:10:10:10 little endian */ ++#define GBM_FORMAT_ABGR2101010 __gbm_fourcc_code('A', 'B', '3', '0') /* [31:0] A:B:G:R 2:10:10:10 little endian */ ++#define GBM_FORMAT_RGBA1010102 __gbm_fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */ ++#define GBM_FORMAT_BGRA1010102 __gbm_fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */ ++ ++/* ++ * Floating point 64bpp RGB ++ * IEEE 754-2008 binary16 half-precision float ++ * [15:0] sign:exponent:mantissa 1:5:10 ++ */ ++#define GBM_FORMAT_XBGR16161616F __gbm_fourcc_code('X', 'B', '4', 'H') /* [63:0] x:B:G:R 16:16:16:16 little endian */ ++ ++#define GBM_FORMAT_ABGR16161616F __gbm_fourcc_code('A', 'B', '4', 'H') /* [63:0] A:B:G:R 16:16:16:16 little endian */ ++ ++/* packed YCbCr */ ++#define GBM_FORMAT_YUYV __gbm_fourcc_code('Y', 'U', 'Y', 'V') /* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */ ++#define GBM_FORMAT_YVYU __gbm_fourcc_code('Y', 'V', 'Y', 'U') /* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */ ++#define GBM_FORMAT_UYVY __gbm_fourcc_code('U', 'Y', 'V', 'Y') /* [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian */ ++#define GBM_FORMAT_VYUY __gbm_fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */ ++ ++#define GBM_FORMAT_AYUV __gbm_fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */ ++ ++/* ++ * 2 plane YCbCr ++ * index 0 = Y plane, [7:0] Y ++ * index 1 = Cr:Cb plane, [15:0] Cr:Cb little endian ++ * or ++ * index 1 = Cb:Cr plane, [15:0] Cb:Cr little endian ++ */ ++#define GBM_FORMAT_NV12 __gbm_fourcc_code('N', 'V', '1', '2') /* 2x2 subsampled Cr:Cb plane */ ++#define GBM_FORMAT_NV21 __gbm_fourcc_code('N', 'V', '2', '1') /* 2x2 subsampled Cb:Cr plane */ ++#define GBM_FORMAT_NV16 __gbm_fourcc_code('N', 'V', '1', '6') /* 2x1 subsampled Cr:Cb plane */ ++#define GBM_FORMAT_NV61 __gbm_fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */ ++ ++/* ++ * 3 plane YCbCr ++ * index 0: Y plane, [7:0] Y ++ * index 1: Cb plane, [7:0] Cb ++ * index 2: Cr plane, [7:0] Cr ++ * or ++ * index 1: Cr plane, [7:0] Cr ++ * index 2: Cb plane, [7:0] Cb ++ */ ++#define GBM_FORMAT_YUV410 __gbm_fourcc_code('Y', 'U', 'V', '9') /* 4x4 subsampled Cb (1) and Cr (2) planes */ ++#define GBM_FORMAT_YVU410 __gbm_fourcc_code('Y', 'V', 'U', '9') /* 4x4 subsampled Cr (1) and Cb (2) planes */ ++#define GBM_FORMAT_YUV411 __gbm_fourcc_code('Y', 'U', '1', '1') /* 4x1 subsampled Cb (1) and Cr (2) planes */ ++#define GBM_FORMAT_YVU411 __gbm_fourcc_code('Y', 'V', '1', '1') /* 4x1 subsampled Cr (1) and Cb (2) planes */ ++#define GBM_FORMAT_YUV420 __gbm_fourcc_code('Y', 'U', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes */ ++#define GBM_FORMAT_YVU420 __gbm_fourcc_code('Y', 'V', '1', '2') /* 2x2 subsampled Cr (1) and Cb (2) planes */ ++#define GBM_FORMAT_YUV422 __gbm_fourcc_code('Y', 'U', '1', '6') /* 2x1 subsampled Cb (1) and Cr (2) planes */ ++#define GBM_FORMAT_YVU422 __gbm_fourcc_code('Y', 'V', '1', '6') /* 2x1 subsampled Cr (1) and Cb (2) planes */ ++#define GBM_FORMAT_YUV444 __gbm_fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */ ++#define GBM_FORMAT_YVU444 __gbm_fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */ ++ ++struct gbm_format_name_desc { ++ char name[5]; ++}; ++ ++/** ++ * Flags to indicate the intended use for the buffer - these are passed into ++ * gbm_bo_create(). The caller must set the union of all the flags that are ++ * appropriate ++ * ++ * \sa Use gbm_device_is_format_supported() to check if the combination of format ++ * and use flags are supported ++ */ ++enum gbm_bo_flags { ++ /** ++ * Buffer is going to be presented to the screen using an API such as KMS ++ */ ++ GBM_BO_USE_SCANOUT = (1 << 0), ++ /** ++ * Buffer is going to be used as cursor ++ */ ++ GBM_BO_USE_CURSOR = (1 << 1), ++ /** ++ * Deprecated ++ */ ++ GBM_BO_USE_CURSOR_64X64 = GBM_BO_USE_CURSOR, ++ /** ++ * Buffer is to be used for rendering - for example it is going to be used ++ * as the storage for a color buffer ++ */ ++ GBM_BO_USE_RENDERING = (1 << 2), ++ /** ++ * Buffer can be used for gbm_bo_write. This is guaranteed to work ++ * with GBM_BO_USE_CURSOR, but may not work for other combinations. ++ */ ++ GBM_BO_USE_WRITE = (1 << 3), ++ /** ++ * Buffer is linear, i.e. not tiled. ++ */ ++ GBM_BO_USE_LINEAR = (1 << 4), ++ /** ++ * Buffer is protected, i.e. encrypted and not readable by CPU or any ++ * other non-secure / non-trusted components nor by non-trusted OpenGL, ++ * OpenCL, and Vulkan applications. ++ */ ++ GBM_BO_USE_PROTECTED = (1 << 5), ++}; ++ ++int ++gbm_device_get_fd(struct gbm_device *gbm); ++ ++const char * ++gbm_device_get_backend_name(struct gbm_device *gbm); ++ ++int ++gbm_device_is_format_supported(struct gbm_device *gbm, ++ uint32_t format, uint32_t flags); ++ ++int ++gbm_device_get_format_modifier_plane_count(struct gbm_device *gbm, ++ uint32_t format, ++ uint64_t modifier); ++ ++void ++gbm_device_destroy(struct gbm_device *gbm); ++ ++struct gbm_device * ++gbm_create_device(int fd); ++ ++struct gbm_bo * ++gbm_bo_create(struct gbm_device *gbm, ++ uint32_t width, uint32_t height, ++ uint32_t format, uint32_t flags); ++ ++struct gbm_bo * ++gbm_bo_create_with_modifiers(struct gbm_device *gbm, ++ uint32_t width, uint32_t height, ++ uint32_t format, ++ const uint64_t *modifiers, ++ const unsigned int count); ++ ++struct gbm_bo * ++gbm_bo_create_with_modifiers2(struct gbm_device *gbm, ++ uint32_t width, uint32_t height, ++ uint32_t format, ++ const uint64_t *modifiers, ++ const unsigned int count, ++ uint32_t flags); ++ ++#define GBM_BO_IMPORT_WL_BUFFER 0x5501 ++#define GBM_BO_IMPORT_EGL_IMAGE 0x5502 ++#define GBM_BO_IMPORT_FD 0x5503 ++#define GBM_BO_IMPORT_FD_MODIFIER 0x5504 ++ ++struct gbm_import_fd_data { ++ int fd; ++ uint32_t width; ++ uint32_t height; ++ uint32_t stride; ++ uint32_t format; ++}; ++ ++#define GBM_MAX_PLANES 4 ++ ++struct gbm_import_fd_modifier_data { ++ uint32_t width; ++ uint32_t height; ++ uint32_t format; ++ uint32_t num_fds; ++ int fds[GBM_MAX_PLANES]; ++ int strides[GBM_MAX_PLANES]; ++ int offsets[GBM_MAX_PLANES]; ++ uint64_t modifier; ++}; ++ ++struct gbm_bo * ++gbm_bo_import(struct gbm_device *gbm, uint32_t type, ++ void *buffer, uint32_t flags); ++ ++/** ++ * Flags to indicate the type of mapping for the buffer - these are ++ * passed into gbm_bo_map(). The caller must set the union of all the ++ * flags that are appropriate. ++ * ++ * These flags are independent of the GBM_BO_USE_* creation flags. However, ++ * mapping the buffer may require copying to/from a staging buffer. ++ * ++ * See also: pipe_map_flags ++ */ ++enum gbm_bo_transfer_flags { ++ /** ++ * Buffer contents read back (or accessed directly) at transfer ++ * create time. ++ */ ++ GBM_BO_TRANSFER_READ = (1 << 0), ++ /** ++ * Buffer contents will be written back at unmap time ++ * (or modified as a result of being accessed directly). ++ */ ++ GBM_BO_TRANSFER_WRITE = (1 << 1), ++ /** ++ * Read/modify/write ++ */ ++ GBM_BO_TRANSFER_READ_WRITE = (GBM_BO_TRANSFER_READ | GBM_BO_TRANSFER_WRITE), ++}; ++ ++void * ++gbm_bo_map(struct gbm_bo *bo, ++ uint32_t x, uint32_t y, uint32_t width, uint32_t height, ++ uint32_t flags, uint32_t *stride, void **map_data); ++ ++void ++gbm_bo_unmap(struct gbm_bo *bo, void *map_data); ++ ++uint32_t ++gbm_bo_get_width(struct gbm_bo *bo); ++ ++uint32_t ++gbm_bo_get_height(struct gbm_bo *bo); ++ ++uint32_t ++gbm_bo_get_stride(struct gbm_bo *bo); ++ ++uint32_t ++gbm_bo_get_stride_for_plane(struct gbm_bo *bo, int plane); ++ ++uint32_t ++gbm_bo_get_format(struct gbm_bo *bo); ++ ++uint32_t ++gbm_bo_get_bpp(struct gbm_bo *bo); ++ ++uint32_t ++gbm_bo_get_offset(struct gbm_bo *bo, int plane); ++ ++struct gbm_device * ++gbm_bo_get_device(struct gbm_bo *bo); ++ ++union gbm_bo_handle ++gbm_bo_get_handle(struct gbm_bo *bo); ++ ++int ++gbm_bo_get_fd(struct gbm_bo *bo); ++ ++uint64_t ++gbm_bo_get_modifier(struct gbm_bo *bo); ++ ++int ++gbm_bo_get_plane_count(struct gbm_bo *bo); ++ ++union gbm_bo_handle ++gbm_bo_get_handle_for_plane(struct gbm_bo *bo, int plane); ++ ++int ++gbm_bo_get_fd_for_plane(struct gbm_bo *bo, int plane); ++ ++int ++gbm_bo_write(struct gbm_bo *bo, const void *buf, size_t count); ++ ++void ++gbm_bo_set_user_data(struct gbm_bo *bo, void *data, ++ void (*destroy_user_data)(struct gbm_bo *, void *)); ++ ++void * ++gbm_bo_get_user_data(struct gbm_bo *bo); ++ ++void ++gbm_bo_destroy(struct gbm_bo *bo); ++ ++struct gbm_surface * ++gbm_surface_create(struct gbm_device *gbm, ++ uint32_t width, uint32_t height, ++ uint32_t format, uint32_t flags); ++ ++struct gbm_surface * ++gbm_surface_create_with_modifiers(struct gbm_device *gbm, ++ uint32_t width, uint32_t height, ++ uint32_t format, ++ const uint64_t *modifiers, ++ const unsigned int count); ++ ++struct gbm_surface * ++gbm_surface_create_with_modifiers2(struct gbm_device *gbm, ++ uint32_t width, uint32_t height, ++ uint32_t format, ++ const uint64_t *modifiers, ++ const unsigned int count, ++ uint32_t flags); ++ ++struct gbm_bo * ++gbm_surface_lock_front_buffer(struct gbm_surface *surface); ++ ++void ++gbm_surface_release_buffer(struct gbm_surface *surface, struct gbm_bo *bo); ++ ++int ++gbm_surface_has_free_buffers(struct gbm_surface *surface); ++ ++void ++gbm_surface_destroy(struct gbm_surface *surface); ++ ++char * ++gbm_format_get_name(uint32_t gbm_format, struct gbm_format_name_desc *desc); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff -up firefox-103.0/third_party/gbm/libgbm/moz.build.libwebrtc-screen-cast-sync firefox-103.0/third_party/gbm/libgbm/moz.build +--- firefox-103.0/third_party/gbm/libgbm/moz.build.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.429095367 +0200 ++++ firefox-103.0/third_party/gbm/libgbm/moz.build 2022-07-26 16:30:19.429095367 +0200 +@@ -0,0 +1,16 @@ ++# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- ++# vim: set filetype=python: ++# This Source Code Form is subject to the terms of the Mozilla Public ++# License, v. 2.0. If a copy of the MPL was not distributed with this ++# file, You can obtain one at http://mozilla.org/MPL/2.0/. ++ ++SOURCES += [ ++ 'mozgbm.cpp', ++] ++ ++if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": ++ CXXFLAGS += CONFIG['MOZ_GTK3_CFLAGS'] ++ ++LOCAL_INCLUDES += ['/third_party/gbm'] ++ ++FINAL_LIBRARY = 'xul' +diff -up firefox-103.0/third_party/gbm/libgbm/mozgbm.cpp.libwebrtc-screen-cast-sync firefox-103.0/third_party/gbm/libgbm/mozgbm.cpp +--- firefox-103.0/third_party/gbm/libgbm/mozgbm.cpp.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.429095367 +0200 ++++ firefox-103.0/third_party/gbm/libgbm/mozgbm.cpp 2022-07-26 16:30:19.429095367 +0200 +@@ -0,0 +1,66 @@ ++/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* vim:expandtab:shiftwidth=4:tabstop=4: ++ */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#include "mozilla/Types.h" ++#include "prlink.h" ++ ++#include ++ ++#define GET_FUNC(func, lib) \ ++ func##_fn = \ ++ (decltype(func##_fn))PR_FindFunctionSymbol(lib, #func) \ ++ ++#define IS_FUNC_LOADED(func) \ ++ (func != nullptr) \ ++ ++static struct gbm_device * (*gbm_create_device_fn)(int fd); ++static void (*gbm_device_destroy_fn)(struct gbm_device* gbm); ++ ++bool IsGBMLibraryLoaded() { ++ static bool isLoaded = ++ (IS_FUNC_LOADED(gbm_create_device_fn) && ++ IS_FUNC_LOADED(gbm_device_destroy_fn)); ++ ++ return isLoaded; ++} ++ ++bool LoadGBMLibrary() { ++ static PRLibrary* gbmLib = nullptr; ++ static bool gbmInitialized = false; ++ ++ //TODO Thread safe ++ if (!gbmInitialized) { ++ gbmInitialized = true; ++ gbmLib = PR_LoadLibrary("libgbm.so.1"); ++ if (!gbmLib) { ++ return false; ++ } ++ ++ GET_FUNC(gbm_create_device, gbmLib); ++ GET_FUNC(gbm_device_destroy, gbmLib); ++ } ++ ++ return IsGBMLibraryLoaded(); ++} ++ ++struct gbm_device * ++gbm_create_device(int fd) ++{ ++ if (!LoadGBMLibrary()) { ++ return nullptr; ++ } ++ return gbm_create_device_fn(fd); ++} ++ ++void ++gbm_device_destroy(struct gbm_device* gbm) ++{ ++ if (!LoadGBMLibrary()) { ++ return; ++ } ++ return gbm_device_destroy_fn(gbm); ++} +diff -up firefox-103.0/third_party/gbm/README.libwebrtc-screen-cast-sync firefox-103.0/third_party/gbm/README +--- firefox-103.0/third_party/gbm/README.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.428095335 +0200 ++++ firefox-103.0/third_party/gbm/README 2022-07-26 16:30:19.428095335 +0200 +@@ -0,0 +1,4 @@ ++Libgbm is a gbm library wrapper needed to build and run Firefox with ++Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/gbm). ++ ++libgbm directory stores headers of libgbm needed for build only. +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.libwebrtc-screen-cast-sync 2022-07-18 20:44:36.000000000 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build 2022-07-26 16:34:44.176870636 +0200 +@@ -26,6 +26,8 @@ LOCAL_INCLUDES += [ + "/ipc/chromium/src", + "/media/libyuv/", + "/media/libyuv/libyuv/include/", ++ "/third_party/drm/", ++ "/third_party/gbm/", + "/third_party/libwebrtc/", + "/third_party/libwebrtc/third_party/abseil-cpp/", + "/third_party/pipewire/", +@@ -133,15 +135,18 @@ if CONFIG["OS_TARGET"] == "OpenBSD": + ] + + SOURCES += [ +- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" ++ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" + ] + + UNIFIED_SOURCES += [ + "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc", +- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_x11.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/shared_x_display.cc", +- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_x11.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/window_finder_x11.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/window_list_utils.cc", +@@ -300,12 +305,12 @@ if CONFIG["CPU_ARCH"] == "aarch64" and C + DEFINES["_GNU_SOURCE"] = True + + SOURCES += [ +- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" +- ] +- +- UNIFIED_SOURCES += [ +- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", +- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc" ++ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" + ] + + if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux": +@@ -318,12 +323,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFI + DEFINES["_GNU_SOURCE"] = True + + SOURCES += [ +- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" +- ] +- +- UNIFIED_SOURCES += [ +- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", +- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc" ++ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" + ] + + if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "Linux": +@@ -332,12 +337,12 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CO + DEFINES["_GNU_SOURCE"] = True + + SOURCES += [ +- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" +- ] +- +- UNIFIED_SOURCES += [ +- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", +- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc" ++ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" + ] + + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "Linux": +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc.libwebrtc-screen-cast-sync 2022-07-18 20:44:36.000000000 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc 2022-07-26 16:30:19.429095367 +0200 +@@ -14,6 +14,9 @@ + #elif defined(WEBRTC_WIN) + #include "modules/desktop_capture/win/full_screen_win_application_handler.h" + #endif ++#if defined(WEBRTC_USE_PIPEWIRE) ++#include "modules/desktop_capture/linux/shared_screencast_stream.h" ++#endif + + namespace webrtc { + +@@ -35,6 +38,9 @@ DesktopCaptureOptions DesktopCaptureOpti + #if defined(WEBRTC_USE_X11) + result.set_x_display(SharedXDisplay::CreateDefault()); + #endif ++#if defined(WEBRTC_USE_PIPEWIRE) ++ result.set_screencast_stream(SharedScreenCastStream::CreateDefault()); ++#endif + #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) + result.set_configuration_monitor(new DesktopConfigurationMonitor()); + result.set_full_screen_window_detector( +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h.libwebrtc-screen-cast-sync 2022-07-18 20:44:32.000000000 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h 2022-07-26 16:30:19.429095367 +0200 +@@ -17,6 +17,10 @@ + #include "modules/desktop_capture/linux/shared_x_display.h" + #endif + ++#if defined(WEBRTC_USE_PIPEWIRE) ++#include "modules/desktop_capture/linux/shared_screencast_stream.h" ++#endif ++ + #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) + #include "modules/desktop_capture/mac/desktop_configuration_monitor.h" + #endif +@@ -149,13 +153,26 @@ class RTC_EXPORT DesktopCaptureOptions { + #if defined(WEBRTC_USE_PIPEWIRE) + bool allow_pipewire() const { return allow_pipewire_; } + void set_allow_pipewire(bool allow) { allow_pipewire_ = allow; } ++ ++ const rtc::scoped_refptr& screencast_stream() const { ++ return screencast_stream_; ++ } ++ void set_screencast_stream( ++ rtc::scoped_refptr stream) { ++ screencast_stream_ = stream; ++ } + #endif + + private: + #if defined(WEBRTC_USE_X11) + rtc::scoped_refptr x_display_; + #endif +- ++#if defined(WEBRTC_USE_PIPEWIRE) ++ // An instance of shared PipeWire ScreenCast stream we share between ++ // BaseCapturerPipeWire and MouseCursorMonitorPipeWire as cursor information ++ // is sent together with screen content. ++ rtc::scoped_refptr screencast_stream_; ++#endif + #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) + rtc::scoped_refptr configuration_monitor_; + bool allow_iosurface_ = false; +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.libwebrtc-screen-cast-sync 2022-07-18 20:44:26.000000000 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc 2022-07-26 16:30:19.429095367 +0200 +@@ -10,937 +10,67 @@ + + #include "modules/desktop_capture/linux/base_capturer_pipewire.h" + +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-#include "absl/memory/memory.h" + #include "modules/desktop_capture/desktop_capture_options.h" + #include "modules/desktop_capture/desktop_capturer.h" + #include "rtc_base/checks.h" + #include "rtc_base/logging.h" + +-#if defined(WEBRTC_DLOPEN_PIPEWIRE) +-#include "modules/desktop_capture/linux/pipewire_stubs.h" +- +-using modules_desktop_capture_linux::InitializeStubs; +-using modules_desktop_capture_linux::kModulePipewire; +-using modules_desktop_capture_linux::StubPathMap; +-#endif // defined(WEBRTC_DLOPEN_PIPEWIRE) +- + namespace webrtc { + +-const char kDesktopBusName[] = "org.freedesktop.portal.Desktop"; +-const char kDesktopObjectPath[] = "/org/freedesktop/portal/desktop"; +-const char kDesktopRequestObjectPath[] = +- "/org/freedesktop/portal/desktop/request"; +-const char kSessionInterfaceName[] = "org.freedesktop.portal.Session"; +-const char kRequestInterfaceName[] = "org.freedesktop.portal.Request"; +-const char kScreenCastInterfaceName[] = "org.freedesktop.portal.ScreenCast"; +- +-const int kBytesPerPixel = 4; +- +-#if defined(WEBRTC_DLOPEN_PIPEWIRE) +-const char kPipeWireLib[] = "libpipewire-0.2.so.1"; +-#endif +- +-// static +-struct dma_buf_sync { +- uint64_t flags; +-}; +-#define DMA_BUF_SYNC_READ (1 << 0) +-#define DMA_BUF_SYNC_START (0 << 2) +-#define DMA_BUF_SYNC_END (1 << 2) +-#define DMA_BUF_BASE 'b' +-#define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync) +- +-static void SyncDmaBuf(int fd, uint64_t start_or_end) { +- struct dma_buf_sync sync = { 0 }; +- +- sync.flags = start_or_end | DMA_BUF_SYNC_READ; +- +- while(true) { +- int ret; +- ret = ioctl (fd, DMA_BUF_IOCTL_SYNC, &sync); +- if (ret == -1 && errno == EINTR) { +- continue; +- } else if (ret == -1) { +- RTC_LOG(LS_ERROR) << "Failed to synchronize DMA buffer: " << g_strerror(errno); +- break; +- } else { +- break; +- } +- } +-} +- +-// static +-void BaseCapturerPipeWire::OnCoreError(void *data, +- uint32_t id, +- int seq, +- int res, +- const char *message) { +- RTC_LOG(LS_ERROR) << "core error: " << message; +-} +- +-// static +-void BaseCapturerPipeWire::OnStreamStateChanged(void* data, +- pw_stream_state old_state, +- pw_stream_state state, +- const char* error_message) { +- BaseCapturerPipeWire* that = static_cast(data); +- RTC_DCHECK(that); +- +- switch (state) { +- case PW_STREAM_STATE_ERROR: +- RTC_LOG(LS_ERROR) << "PipeWire stream state error: " << error_message; +- break; +- case PW_STREAM_STATE_PAUSED: +- case PW_STREAM_STATE_STREAMING: +- case PW_STREAM_STATE_UNCONNECTED: +- case PW_STREAM_STATE_CONNECTING: +- break; +- } +-} +- +-// static +-void BaseCapturerPipeWire::OnStreamParamChanged(void *data, uint32_t id, +- const struct spa_pod *format) { +- BaseCapturerPipeWire* that = static_cast(data); +- RTC_DCHECK(that); +- +- RTC_LOG(LS_INFO) << "PipeWire stream param changed."; +- +- if (!format || id != SPA_PARAM_Format) { +- return; +- } +- +- spa_format_video_raw_parse(format, &that->spa_video_format_); +- +- auto width = that->spa_video_format_.size.width; +- auto height = that->spa_video_format_.size.height; +- // In order to be able to build in the non unified environment kBytesPerPixel +- // must be fully qualified, see Bug 1725145 +- auto stride = SPA_ROUND_UP_N(width * BasicDesktopFrame::kBytesPerPixel, 4); +- auto size = height * stride; +- +- that->desktop_size_ = DesktopSize(width, height); +- +- uint8_t buffer[1024] = {}; +- auto builder = spa_pod_builder{buffer, sizeof(buffer)}; +- +- // Setup buffers and meta header for new format. +- const struct spa_pod* params[3]; +- params[0] = reinterpret_cast(spa_pod_builder_add_object(&builder, +- SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers, +- SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int((1<(spa_pod_builder_add_object(&builder, +- SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, +- SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header), +- SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_header)))); +- params[2] = reinterpret_cast(spa_pod_builder_add_object(&builder, +- SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, +- SPA_PARAM_META_type, SPA_POD_Id (SPA_META_VideoCrop), +- SPA_PARAM_META_size, SPA_POD_Int (sizeof(struct spa_meta_region)))); +- pw_stream_update_params(that->pw_stream_, params, 3); +-} +- +-// static +-void BaseCapturerPipeWire::OnStreamProcess(void* data) { +- BaseCapturerPipeWire* that = static_cast(data); +- RTC_DCHECK(that); +- +- struct pw_buffer *next_buffer; +- struct pw_buffer *buffer = nullptr; +- +- next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); +- while (next_buffer) { +- buffer = next_buffer; +- next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); +- +- if (next_buffer) { +- pw_stream_queue_buffer (that->pw_stream_, buffer); +- } +- } +- +- if (!buffer) { +- return; +- } +- +- that->HandleBuffer(buffer); +- +- pw_stream_queue_buffer(that->pw_stream_, buffer); +-} +- +-BaseCapturerPipeWire::BaseCapturerPipeWire(CaptureSourceType source_type) +- : capture_source_type_(source_type) {} +- +-BaseCapturerPipeWire::~BaseCapturerPipeWire() { +- if (pw_main_loop_) { +- pw_thread_loop_stop(pw_main_loop_); +- } +- +- if (pw_stream_) { +- pw_stream_destroy(pw_stream_); +- } +- +- if (pw_core_) { +- pw_core_disconnect(pw_core_); +- } +- +- if (pw_context_) { +- pw_context_destroy(pw_context_); +- } +- +- if (pw_main_loop_) { +- pw_thread_loop_destroy(pw_main_loop_); +- } +- +- if (start_request_signal_id_) { +- g_dbus_connection_signal_unsubscribe(connection_, start_request_signal_id_); +- } +- if (sources_request_signal_id_) { +- g_dbus_connection_signal_unsubscribe(connection_, +- sources_request_signal_id_); +- } +- if (session_request_signal_id_) { +- g_dbus_connection_signal_unsubscribe(connection_, +- session_request_signal_id_); +- } +- +- if (session_handle_) { +- GDBusMessage* message = g_dbus_message_new_method_call( +- kDesktopBusName, session_handle_, kSessionInterfaceName, "Close"); +- if (message) { +- GError* error = nullptr; +- g_dbus_connection_send_message(connection_, message, +- G_DBUS_SEND_MESSAGE_FLAGS_NONE, +- /*out_serial=*/nullptr, &error); +- if (error) { +- RTC_LOG(LS_ERROR) << "Failed to close the session: " << error->message; +- g_error_free(error); +- } +- g_object_unref(message); +- } +- } +- +- g_free(start_handle_); +- g_free(sources_handle_); +- g_free(session_handle_); +- g_free(portal_handle_); +- +- if (cancellable_) { +- g_cancellable_cancel(cancellable_); +- g_object_unref(cancellable_); +- cancellable_ = nullptr; +- } +- +- if (proxy_) { +- g_object_unref(proxy_); +- proxy_ = nullptr; ++BaseCapturerPipeWire::BaseCapturerPipeWire(const DesktopCaptureOptions& options) ++ : options_(options) { ++ screencast_portal_ = std::make_unique( ++ ScreenCastPortal::CaptureSourceType::kAnyScreenContent, this); ++} ++ ++BaseCapturerPipeWire::~BaseCapturerPipeWire() {} ++ ++void BaseCapturerPipeWire::OnScreenCastRequestResult( ++ ScreenCastPortal::RequestResponse result, ++ uint32_t stream_node_id, ++ int fd) { ++ if (result != ScreenCastPortal::RequestResponse::kSuccess || ++ !options_.screencast_stream()->StartScreenCastStream(stream_node_id, ++ fd)) { ++ capturer_failed_ = true; ++ RTC_LOG(LS_ERROR) << "ScreenCastPortal failed: " ++ << static_cast(result); + } +- +- if (pw_fd_ != -1) { +- close(pw_fd_); +- } +-} +- +-void BaseCapturerPipeWire::InitPortal() { +- cancellable_ = g_cancellable_new(); +- g_dbus_proxy_new_for_bus( +- G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, /*info=*/nullptr, +- kDesktopBusName, kDesktopObjectPath, kScreenCastInterfaceName, +- cancellable_, +- reinterpret_cast(OnProxyRequested), this); +-} +- +-void BaseCapturerPipeWire::InitPipeWire() { +-#if defined(WEBRTC_DLOPEN_PIPEWIRE) +- StubPathMap paths; +- +- // Check if the PipeWire library is available. +- paths[kModulePipewire].push_back(kPipeWireLib); +- if (!InitializeStubs(paths)) { +- RTC_LOG(LS_ERROR) << "Failed to load the PipeWire library and symbols."; +- portal_init_failed_ = true; +- return; +- } +-#endif // defined(WEBRTC_DLOPEN_PIPEWIRE) +- +- pw_init(/*argc=*/nullptr, /*argc=*/nullptr); +- +- pw_main_loop_ = pw_thread_loop_new("pipewire-main-loop", nullptr); +- pw_context_ = pw_context_new(pw_thread_loop_get_loop(pw_main_loop_), nullptr, 0); +- if (!pw_context_) { +- RTC_LOG(LS_ERROR) << "Failed to create PipeWire context"; +- return; +- } +- +- pw_core_ = pw_context_connect_fd(pw_context_, pw_fd_, nullptr, 0); +- if (!pw_core_) { +- RTC_LOG(LS_ERROR) << "Failed to connect PipeWire context"; +- return; +- } +- +- // Initialize event handlers, remote end and stream-related. +- pw_core_events_.version = PW_VERSION_CORE_EVENTS; +- pw_core_events_.error = &OnCoreError; +- +- pw_stream_events_.version = PW_VERSION_STREAM_EVENTS; +- pw_stream_events_.state_changed = &OnStreamStateChanged; +- pw_stream_events_.param_changed = &OnStreamParamChanged; +- pw_stream_events_.process = &OnStreamProcess; +- +- pw_core_add_listener(pw_core_, &spa_core_listener_, &pw_core_events_, this); +- +- pw_stream_ = CreateReceivingStream(); +- if (!pw_stream_) { +- RTC_LOG(LS_ERROR) << "Failed to create PipeWire stream"; +- return; +- } +- +- if (pw_thread_loop_start(pw_main_loop_) < 0) { +- RTC_LOG(LS_ERROR) << "Failed to start main PipeWire loop"; +- portal_init_failed_ = true; +- } +- +- RTC_LOG(LS_INFO) << "PipeWire remote opened."; +-} +- +-pw_stream* BaseCapturerPipeWire::CreateReceivingStream() { +- spa_rectangle pwMinScreenBounds = spa_rectangle{1, 1}; +- spa_rectangle pwMaxScreenBounds = spa_rectangle{UINT32_MAX, UINT32_MAX}; +- +- auto stream = pw_stream_new(pw_core_, "webrtc-pipewire-stream", nullptr); +- +- if (!stream) { +- RTC_LOG(LS_ERROR) << "Could not create receiving stream."; +- return nullptr; +- } +- +- uint8_t buffer[1024] = {}; +- const spa_pod* params[2]; +- spa_pod_builder builder = SPA_POD_BUILDER_INIT(buffer, sizeof (buffer)); +- +- params[0] = reinterpret_cast(spa_pod_builder_add_object(&builder, +- SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, +- SPA_FORMAT_mediaType, SPA_POD_Id(SPA_MEDIA_TYPE_video), +- SPA_FORMAT_mediaSubtype, SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw), +- SPA_FORMAT_VIDEO_format, SPA_POD_CHOICE_ENUM_Id(5, SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_RGBx, SPA_VIDEO_FORMAT_RGBA, +- SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_BGRA), +- SPA_FORMAT_VIDEO_size, SPA_POD_CHOICE_RANGE_Rectangle(&pwMinScreenBounds, +- &pwMinScreenBounds, +- &pwMaxScreenBounds), +- 0)); +- pw_stream_add_listener(stream, &spa_stream_listener_, &pw_stream_events_, this); +- +- if (pw_stream_connect(stream, PW_DIRECTION_INPUT, pw_stream_node_id_, +- PW_STREAM_FLAG_AUTOCONNECT, params, 1) != 0) { +- RTC_LOG(LS_ERROR) << "Could not connect receiving stream."; +- portal_init_failed_ = true; +- } +- +- return stream; + } + +-static void SpaBufferUnmap(unsigned char *map, int map_size, bool IsDMABuf, int fd) { +- if (map) { +- if (IsDMABuf) { +- SyncDmaBuf(fd, DMA_BUF_SYNC_END); +- } +- munmap(map, map_size); ++void BaseCapturerPipeWire::OnScreenCastSessionClosed() { ++ if (!capturer_failed_) { ++ options_.screencast_stream()->StopScreenCastStream(); + } + } + +-void BaseCapturerPipeWire::HandleBuffer(pw_buffer* buffer) { +- spa_buffer* spaBuffer = buffer->buffer; +- uint8_t *map = nullptr; +- uint8_t* src = nullptr; +- +- if (spaBuffer->datas[0].chunk->size == 0) { +- RTC_LOG(LS_ERROR) << "Failed to get video stream: Zero size."; +- return; +- } +- +- switch (spaBuffer->datas[0].type) { +- case SPA_DATA_MemFd: +- case SPA_DATA_DmaBuf: +- map = static_cast(mmap( +- nullptr, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, +- PROT_READ, MAP_PRIVATE, spaBuffer->datas[0].fd, 0)); +- if (map == MAP_FAILED) { +- RTC_LOG(LS_ERROR) << "Failed to mmap memory: " << std::strerror(errno); +- return; +- } +- if (spaBuffer->datas[0].type == SPA_DATA_DmaBuf) { +- SyncDmaBuf(spaBuffer->datas[0].fd, DMA_BUF_SYNC_START); +- } +- src = SPA_MEMBER(map, spaBuffer->datas[0].mapoffset, uint8_t); +- break; +- case SPA_DATA_MemPtr: +- map = nullptr; +- src = static_cast(spaBuffer->datas[0].data); +- break; +- default: +- return; +- } +- +- if (!src) { +- RTC_LOG(LS_ERROR) << "Failed to get video stream: Wrong data after mmap()"; +- SpaBufferUnmap(map, +- spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, +- spaBuffer->datas[0].type == SPA_DATA_DmaBuf, spaBuffer->datas[0].fd); +- return; +- } +- +- struct spa_meta_region* video_metadata = +- static_cast( +- spa_buffer_find_meta_data(spaBuffer, SPA_META_VideoCrop, sizeof(*video_metadata))); +- +- // Video size from metada is bigger than an actual video stream size. +- // The metadata are wrong or we should up-scale te video...in both cases +- // just quit now. +- if (video_metadata && +- (video_metadata->region.size.width > (uint32_t)desktop_size_.width() || +- video_metadata->region.size.height > (uint32_t)desktop_size_.height())) { +- RTC_LOG(LS_ERROR) << "Stream metadata sizes are wrong!"; +- SpaBufferUnmap(map, +- spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, +- spaBuffer->datas[0].type == SPA_DATA_DmaBuf, spaBuffer->datas[0].fd); +- return; +- } +- +- // Use video metada when video size from metadata is set and smaller than +- // video stream size, so we need to adjust it. +- video_metadata_use_ = (video_metadata && +- video_metadata->region.size.width != 0 && +- video_metadata->region.size.height != 0 && +- (video_metadata->region.size.width < (uint32_t)desktop_size_.width() || +- video_metadata->region.size.height < (uint32_t)desktop_size_.height())); +- +- DesktopSize video_size_prev = video_size_; +- if (video_metadata_use_) { +- video_size_ = DesktopSize(video_metadata->region.size.width, +- video_metadata->region.size.height); +- } else { +- video_size_ = desktop_size_; +- } +- +- webrtc::MutexLock lock(¤t_frame_lock_); +- if (!current_frame_ || !video_size_.equals(video_size_prev)) { +- current_frame_ = +- std::make_unique +- (video_size_.width() * video_size_.height() * BasicDesktopFrame::kBytesPerPixel); +- } +- +- const int32_t dstStride = video_size_.width() * BasicDesktopFrame::kBytesPerPixel; +- const int32_t srcStride = spaBuffer->datas[0].chunk->stride; +- +- // Adjust source content based on metadata video position +- if (video_metadata_use_ && +- (video_metadata->region.position.y + video_size_.height() <= desktop_size_.height())) { +- src += srcStride * video_metadata->region.position.y; +- } +- const int xOffset = +- video_metadata_use_ && +- (video_metadata->region.position.x + video_size_.width() <= desktop_size_.width()) +- ? video_metadata->region.position.x * BasicDesktopFrame::kBytesPerPixel +- : 0; +- +- uint8_t* dst = current_frame_.get(); +- for (int i = 0; i < video_size_.height(); ++i) { +- // Adjust source content based on crop video position if needed +- src += xOffset; +- std::memcpy(dst, src, dstStride); +- // If both sides decided to go with the RGBx format we need to convert it to +- // BGRx to match color format expected by WebRTC. +- if (spa_video_format_.format == SPA_VIDEO_FORMAT_RGBx || +- spa_video_format_.format == SPA_VIDEO_FORMAT_RGBA) { +- ConvertRGBxToBGRx(dst, dstStride); +- } +- src += srcStride - xOffset; +- dst += dstStride; +- } +- +- SpaBufferUnmap(map, +- spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, +- spaBuffer->datas[0].type == SPA_DATA_DmaBuf, spaBuffer->datas[0].fd); +-} +- +-void BaseCapturerPipeWire::ConvertRGBxToBGRx(uint8_t* frame, uint32_t size) { +- // Change color format for KDE KWin which uses RGBx and not BGRx +- for (uint32_t i = 0; i < size; i += 4) { +- uint8_t tempR = frame[i]; +- uint8_t tempB = frame[i + 2]; +- frame[i] = tempB; +- frame[i + 2] = tempR; +- } +-} +- +-guint BaseCapturerPipeWire::SetupRequestResponseSignal( +- const gchar* object_path, +- GDBusSignalCallback callback) { +- return g_dbus_connection_signal_subscribe( +- connection_, kDesktopBusName, kRequestInterfaceName, "Response", +- object_path, /*arg0=*/nullptr, G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE, +- callback, this, /*user_data_free_func=*/nullptr); +-} +- +-// static +-void BaseCapturerPipeWire::OnProxyRequested(GObject* /*object*/, +- GAsyncResult* result, +- gpointer user_data) { +- BaseCapturerPipeWire* that = static_cast(user_data); +- RTC_DCHECK(that); +- +- GError* error = nullptr; +- GDBusProxy *proxy = g_dbus_proxy_new_finish(result, &error); +- if (!proxy) { +- if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) +- return; +- RTC_LOG(LS_ERROR) << "Failed to create a proxy for the screen cast portal: " +- << error->message; +- g_error_free(error); +- that->portal_init_failed_ = true; +- return; +- } +- that->proxy_ = proxy; +- that->connection_ = g_dbus_proxy_get_connection(that->proxy_); +- +- RTC_LOG(LS_INFO) << "Created proxy for the screen cast portal."; +- that->SessionRequest(); +-} +- +-// static +-gchar* BaseCapturerPipeWire::PrepareSignalHandle(GDBusConnection* connection, +- const gchar* token) { +- gchar* sender = g_strdup(g_dbus_connection_get_unique_name(connection) + 1); +- for (int i = 0; sender[i]; i++) { +- if (sender[i] == '.') { +- sender[i] = '_'; +- } +- } +- +- gchar* handle = g_strconcat(kDesktopRequestObjectPath, "/", sender, "/", +- token, /*end of varargs*/ nullptr); +- g_free(sender); +- +- return handle; +-} +- +-void BaseCapturerPipeWire::SessionRequest() { +- GVariantBuilder builder; +- gchar* variant_string; +- +- g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); +- variant_string = +- g_strdup_printf("webrtc_session%d", g_random_int_range(0, G_MAXINT)); +- g_variant_builder_add(&builder, "{sv}", "session_handle_token", +- g_variant_new_string(variant_string)); +- g_free(variant_string); +- variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); +- g_variant_builder_add(&builder, "{sv}", "handle_token", +- g_variant_new_string(variant_string)); +- +- portal_handle_ = PrepareSignalHandle(connection_, variant_string); +- session_request_signal_id_ = SetupRequestResponseSignal( +- portal_handle_, OnSessionRequestResponseSignal); +- g_free(variant_string); +- +- RTC_LOG(LS_INFO) << "Screen cast session requested."; +- g_dbus_proxy_call( +- proxy_, "CreateSession", g_variant_new("(a{sv})", &builder), +- G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, +- reinterpret_cast(OnSessionRequested), this); +-} +- +-// static +-void BaseCapturerPipeWire::OnSessionRequested(GDBusProxy *proxy, +- GAsyncResult* result, +- gpointer user_data) { +- BaseCapturerPipeWire* that = static_cast(user_data); +- RTC_DCHECK(that); +- +- GError* error = nullptr; +- GVariant* variant = g_dbus_proxy_call_finish(proxy, result, &error); +- if (!variant) { +- if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) +- return; +- RTC_LOG(LS_ERROR) << "Failed to create a screen cast session: " +- << error->message; +- g_error_free(error); +- that->portal_init_failed_ = true; +- return; +- } +- RTC_LOG(LS_INFO) << "Initializing the screen cast session."; +- +- gchar* handle = nullptr; +- g_variant_get_child(variant, 0, "o", &handle); +- g_variant_unref(variant); +- if (!handle) { +- RTC_LOG(LS_ERROR) << "Failed to initialize the screen cast session."; +- if (that->session_request_signal_id_) { +- g_dbus_connection_signal_unsubscribe(that->connection_, +- that->session_request_signal_id_); +- that->session_request_signal_id_ = 0; +- } +- that->portal_init_failed_ = true; +- return; +- } +- +- g_free(handle); +- +- RTC_LOG(LS_INFO) << "Subscribing to the screen cast session."; +-} +- +-// static +-void BaseCapturerPipeWire::OnSessionRequestResponseSignal( +- GDBusConnection* connection, +- const gchar* sender_name, +- const gchar* object_path, +- const gchar* interface_name, +- const gchar* signal_name, +- GVariant* parameters, +- gpointer user_data) { +- BaseCapturerPipeWire* that = static_cast(user_data); +- RTC_DCHECK(that); +- +- RTC_LOG(LS_INFO) +- << "Received response for the screen cast session subscription."; +- +- guint32 portal_response; +- GVariant* response_data; +- g_variant_get(parameters, "(u@a{sv})", &portal_response, &response_data); +- +- GVariant* session_handle = +- g_variant_lookup_value(response_data, "session_handle", NULL); +- that->session_handle_ = g_variant_dup_string(session_handle, NULL); +- +- g_variant_unref(session_handle); +- g_variant_unref(response_data); +- +- if (!that->session_handle_ || portal_response) { +- RTC_LOG(LS_ERROR) +- << "Failed to request the screen cast session subscription."; +- that->portal_init_failed_ = true; +- return; +- } +- +- that->SourcesRequest(); +-} +- +-void BaseCapturerPipeWire::SourcesRequest() { +- GVariantBuilder builder; +- gchar* variant_string; +- +- g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); +- // We want to record monitor content. +- g_variant_builder_add(&builder, "{sv}", "types", +- g_variant_new_uint32(capture_source_type_)); +- // We don't want to allow selection of multiple sources. +- g_variant_builder_add(&builder, "{sv}", "multiple", +- g_variant_new_boolean(false)); +- variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); +- g_variant_builder_add(&builder, "{sv}", "handle_token", +- g_variant_new_string(variant_string)); +- +- sources_handle_ = PrepareSignalHandle(connection_, variant_string); +- sources_request_signal_id_ = SetupRequestResponseSignal( +- sources_handle_, OnSourcesRequestResponseSignal); +- g_free(variant_string); +- +- RTC_LOG(LS_INFO) << "Requesting sources from the screen cast session."; +- g_dbus_proxy_call( +- proxy_, "SelectSources", +- g_variant_new("(oa{sv})", session_handle_, &builder), +- G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, +- reinterpret_cast(OnSourcesRequested), this); +-} +- +-// static +-void BaseCapturerPipeWire::OnSourcesRequested(GDBusProxy *proxy, +- GAsyncResult* result, +- gpointer user_data) { +- BaseCapturerPipeWire* that = static_cast(user_data); +- RTC_DCHECK(that); +- +- GError* error = nullptr; +- GVariant* variant = g_dbus_proxy_call_finish(proxy, result, &error); +- if (!variant) { +- if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) +- return; +- RTC_LOG(LS_ERROR) << "Failed to request the sources: " << error->message; +- g_error_free(error); +- that->portal_init_failed_ = true; +- return; +- } +- +- RTC_LOG(LS_INFO) << "Sources requested from the screen cast session."; +- +- gchar* handle = nullptr; +- g_variant_get_child(variant, 0, "o", &handle); +- g_variant_unref(variant); +- if (!handle) { +- RTC_LOG(LS_ERROR) << "Failed to initialize the screen cast session."; +- if (that->sources_request_signal_id_) { +- g_dbus_connection_signal_unsubscribe(that->connection_, +- that->sources_request_signal_id_); +- that->sources_request_signal_id_ = 0; +- } +- that->portal_init_failed_ = true; +- return; +- } +- +- g_free(handle); +- +- RTC_LOG(LS_INFO) << "Subscribed to sources signal."; +-} +- +-// static +-void BaseCapturerPipeWire::OnSourcesRequestResponseSignal( +- GDBusConnection* connection, +- const gchar* sender_name, +- const gchar* object_path, +- const gchar* interface_name, +- const gchar* signal_name, +- GVariant* parameters, +- gpointer user_data) { +- BaseCapturerPipeWire* that = static_cast(user_data); +- RTC_DCHECK(that); +- +- RTC_LOG(LS_INFO) << "Received sources signal from session."; +- +- guint32 portal_response; +- g_variant_get(parameters, "(u@a{sv})", &portal_response, nullptr); +- if (portal_response) { +- RTC_LOG(LS_ERROR) +- << "Failed to select sources for the screen cast session."; +- that->portal_init_failed_ = true; +- return; +- } +- +- that->StartRequest(); +-} +- +-void BaseCapturerPipeWire::StartRequest() { +- GVariantBuilder builder; +- gchar* variant_string; +- +- g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); +- variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); +- g_variant_builder_add(&builder, "{sv}", "handle_token", +- g_variant_new_string(variant_string)); +- +- start_handle_ = PrepareSignalHandle(connection_, variant_string); +- start_request_signal_id_ = +- SetupRequestResponseSignal(start_handle_, OnStartRequestResponseSignal); +- g_free(variant_string); +- +- // "Identifier for the application window", this is Wayland, so not "x11:...". +- const gchar parent_window[] = ""; +- +- RTC_LOG(LS_INFO) << "Starting the screen cast session."; +- g_dbus_proxy_call( +- proxy_, "Start", +- g_variant_new("(osa{sv})", session_handle_, parent_window, &builder), +- G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, +- reinterpret_cast(OnStartRequested), this); +-} +- +-// static +-void BaseCapturerPipeWire::OnStartRequested(GDBusProxy *proxy, +- GAsyncResult* result, +- gpointer user_data) { +- BaseCapturerPipeWire* that = static_cast(user_data); +- RTC_DCHECK(that); +- +- GError* error = nullptr; +- GVariant* variant = g_dbus_proxy_call_finish(proxy, result, &error); +- if (!variant) { +- if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) +- return; +- RTC_LOG(LS_ERROR) << "Failed to start the screen cast session: " +- << error->message; +- g_error_free(error); +- that->portal_init_failed_ = true; +- return; +- } +- +- RTC_LOG(LS_INFO) << "Initializing the start of the screen cast session."; +- +- gchar* handle = nullptr; +- g_variant_get_child(variant, 0, "o", &handle); +- g_variant_unref(variant); +- if (!handle) { +- RTC_LOG(LS_ERROR) +- << "Failed to initialize the start of the screen cast session."; +- if (that->start_request_signal_id_) { +- g_dbus_connection_signal_unsubscribe(that->connection_, +- that->start_request_signal_id_); +- that->start_request_signal_id_ = 0; +- } +- that->portal_init_failed_ = true; +- return; +- } +- +- g_free(handle); +- +- RTC_LOG(LS_INFO) << "Subscribed to the start signal."; +-} +- +-// static +-void BaseCapturerPipeWire::OnStartRequestResponseSignal( +- GDBusConnection* connection, +- const gchar* sender_name, +- const gchar* object_path, +- const gchar* interface_name, +- const gchar* signal_name, +- GVariant* parameters, +- gpointer user_data) { +- BaseCapturerPipeWire* that = static_cast(user_data); +- RTC_DCHECK(that); +- +- RTC_LOG(LS_INFO) << "Start signal received."; +- guint32 portal_response; +- GVariant* response_data; +- GVariantIter* iter = nullptr; +- g_variant_get(parameters, "(u@a{sv})", &portal_response, &response_data); +- if (portal_response || !response_data) { +- RTC_LOG(LS_ERROR) << "Failed to start the screen cast session."; +- that->portal_init_failed_ = true; +- return; +- } +- +- // Array of PipeWire streams. See +- // https://github.com/flatpak/xdg-desktop-portal/blob/master/data/org.freedesktop.portal.ScreenCast.xml +- // documentation for . +- if (g_variant_lookup(response_data, "streams", "a(ua{sv})", &iter)) { +- GVariant* variant; +- +- while (g_variant_iter_next(iter, "@(ua{sv})", &variant)) { +- guint32 stream_id; +- GVariant* options; +- +- g_variant_get(variant, "(u@a{sv})", &stream_id, &options); +- RTC_DCHECK(options != nullptr); +- +- that->pw_stream_node_id_ = stream_id; +- g_variant_unref(options); +- g_variant_unref(variant); +- } +- } +- g_variant_iter_free(iter); +- g_variant_unref(response_data); +- +- that->OpenPipeWireRemote(); +-} +- +-void BaseCapturerPipeWire::OpenPipeWireRemote() { +- GVariantBuilder builder; +- g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); +- +- RTC_LOG(LS_INFO) << "Opening the PipeWire remote."; +- +- g_dbus_proxy_call_with_unix_fd_list( +- proxy_, "OpenPipeWireRemote", +- g_variant_new("(oa{sv})", session_handle_, &builder), +- G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, /*fd_list=*/nullptr, +- cancellable_, +- reinterpret_cast(OnOpenPipeWireRemoteRequested), +- this); +-} +- +-// static +-void BaseCapturerPipeWire::OnOpenPipeWireRemoteRequested( +- GDBusProxy *proxy, +- GAsyncResult* result, +- gpointer user_data) { +- BaseCapturerPipeWire* that = static_cast(user_data); +- RTC_DCHECK(that); +- +- GError* error = nullptr; +- GUnixFDList* outlist = nullptr; +- GVariant* variant = g_dbus_proxy_call_with_unix_fd_list_finish( +- proxy, &outlist, result, &error); +- if (!variant) { +- if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) +- return; +- RTC_LOG(LS_ERROR) << "Failed to open the PipeWire remote: " +- << error->message; +- g_error_free(error); +- that->portal_init_failed_ = true; +- return; +- } +- +- gint32 index; +- g_variant_get(variant, "(h)", &index); +- +- if ((that->pw_fd_ = g_unix_fd_list_get(outlist, index, &error)) == -1) { +- RTC_LOG(LS_ERROR) << "Failed to get file descriptor from the list: " +- << error->message; +- g_error_free(error); +- g_variant_unref(variant); +- that->portal_init_failed_ = true; +- return; +- } +- +- g_variant_unref(variant); +- g_object_unref(outlist); +- +- that->InitPipeWire(); +-} +- + void BaseCapturerPipeWire::Start(Callback* callback) { + RTC_DCHECK(!callback_); + RTC_DCHECK(callback); + +- InitPortal(); +- + callback_ = callback; ++ ++ screencast_portal_->Start(); + } + + void BaseCapturerPipeWire::CaptureFrame() { +- if (portal_init_failed_) { ++ if (capturer_failed_) { + callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); + return; + } + +- webrtc::MutexLock lock(¤t_frame_lock_); +- if (!current_frame_) { +- callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); +- return; +- } +- +- DesktopSize frame_size = desktop_size_; +- if (video_metadata_use_) { +- frame_size = video_size_; +- } ++ std::unique_ptr frame = ++ options_.screencast_stream()->CaptureFrame(); + +- std::unique_ptr result(new BasicDesktopFrame(frame_size)); +- result->CopyPixelsFrom( +- current_frame_.get(), (frame_size.width() * BasicDesktopFrame::kBytesPerPixel), +- DesktopRect::MakeWH(frame_size.width(), frame_size.height())); +- if (!result) { ++ if (!frame || !frame->data()) { + callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); + return; + } + +- // TODO(julien.isorce): http://crbug.com/945468. Set the icc profile on the +- // frame, see ScreenCapturerX11::CaptureFrame. ++ // TODO(julien.isorce): http://crbug.com/945468. Set the icc profile on ++ // the frame, see ScreenCapturerX11::CaptureFrame. + +- callback_->OnCaptureResult(Result::SUCCESS, std::move(result)); ++ callback_->OnCaptureResult(Result::SUCCESS, std::move(frame)); + } + + // Keep in sync with defines at browser/actors/WebRTCParent.jsm +@@ -953,31 +83,13 @@ void BaseCapturerPipeWire::CaptureFrame( + #define PIPEWIRE_NAME "####_PIPEWIRE_PORTAL_####" + + bool BaseCapturerPipeWire::GetSourceList(SourceList* sources) { ++ RTC_DCHECK(sources->size() == 0); + sources->push_back({PIPEWIRE_ID, 0, PIPEWIRE_NAME}); + return true; + } + + bool BaseCapturerPipeWire::SelectSource(SourceId id) { +- // Screen selection is handled by the xdg-desktop-portal. + return id == PIPEWIRE_ID; + } + +-// static +-std::unique_ptr +-BaseCapturerPipeWire::CreateRawScreenCapturer( +- const DesktopCaptureOptions& options) { +- std::unique_ptr capturer = +- std::make_unique(BaseCapturerPipeWire::CaptureSourceType::kAny); +- return std::move(capturer);} +- +-// static +-std::unique_ptr +-BaseCapturerPipeWire::CreateRawWindowCapturer( +- const DesktopCaptureOptions& options) { +- +- std::unique_ptr capturer = +- std::make_unique(BaseCapturerPipeWire::CaptureSourceType::kAny); +- return std::move(capturer); +-} +- + } // namespace webrtc +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h.libwebrtc-screen-cast-sync 2022-07-18 20:44:26.000000000 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h 2022-07-26 16:30:19.429095367 +0200 +@@ -11,160 +11,39 @@ + #ifndef MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ + #define MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ + +-#include +-#define typeof __typeof__ +-#include +-#include +- + #include "modules/desktop_capture/desktop_capture_options.h" + #include "modules/desktop_capture/desktop_capturer.h" +-#include "rtc_base/synchronization/mutex.h" ++#include "modules/desktop_capture/linux/screencast_portal.h" ++#include "modules/desktop_capture/linux/shared_screencast_stream.h" + + namespace webrtc { + +-class BaseCapturerPipeWire : public DesktopCapturer { ++class BaseCapturerPipeWire : public DesktopCapturer, ++ public ScreenCastPortal::PortalNotifier { + public: +- enum CaptureSourceType : uint32_t { +- kScreen = 0b01, +- kWindow = 0b10, +- kAny = 0b11 +- }; +- +- explicit BaseCapturerPipeWire(CaptureSourceType source_type); ++ BaseCapturerPipeWire(const DesktopCaptureOptions& options); + ~BaseCapturerPipeWire() override; + ++ BaseCapturerPipeWire(const BaseCapturerPipeWire&) = delete; ++ BaseCapturerPipeWire& operator=(const BaseCapturerPipeWire&) = delete; ++ + // DesktopCapturer interface. + void Start(Callback* delegate) override; + void CaptureFrame() override; + bool GetSourceList(SourceList* sources) override; + bool SelectSource(SourceId id) override; + +- static std::unique_ptr CreateRawScreenCapturer( +- const DesktopCaptureOptions& options); +- +- static std::unique_ptr CreateRawWindowCapturer( +- const DesktopCaptureOptions& options); ++ // ScreenCastPortal::PortalNotifier interface. ++ void OnScreenCastRequestResult(ScreenCastPortal::RequestResponse result, ++ uint32_t stream_node_id, ++ int fd) override; ++ void OnScreenCastSessionClosed() override; + + private: +- // PipeWire types --> +- pw_context* pw_context_ = nullptr; +- pw_core* pw_core_ = nullptr; +- pw_stream* pw_stream_ = nullptr; +- pw_thread_loop* pw_main_loop_ = nullptr; +- +- spa_hook spa_core_listener_ = {}; +- spa_hook spa_stream_listener_ = {}; +- +- pw_core_events pw_core_events_ = {}; +- pw_stream_events pw_stream_events_ = {}; +- +- struct spa_video_info_raw spa_video_format_; +- +- guint32 pw_stream_node_id_ = 0; +- gint32 pw_fd_ = -1; +- +- CaptureSourceType capture_source_type_ = +- BaseCapturerPipeWire::CaptureSourceType::kAny; +- +- // <-- end of PipeWire types +- +- GDBusConnection* connection_ = nullptr; +- GDBusProxy* proxy_ = nullptr; +- GCancellable *cancellable_ = nullptr; +- gchar* portal_handle_ = nullptr; +- gchar* session_handle_ = nullptr; +- gchar* sources_handle_ = nullptr; +- gchar* start_handle_ = nullptr; +- guint session_request_signal_id_ = 0; +- guint sources_request_signal_id_ = 0; +- guint start_request_signal_id_ = 0; +- +- bool video_metadata_use_ = false; +- DesktopSize video_size_; +- DesktopSize desktop_size_ = {}; + DesktopCaptureOptions options_ = {}; +- +- webrtc::Mutex current_frame_lock_; +- std::unique_ptr current_frame_; + Callback* callback_ = nullptr; +- +- bool portal_init_failed_ = false; +- +- void InitPortal(); +- void InitPipeWire(); +- +- pw_stream* CreateReceivingStream(); +- void HandleBuffer(pw_buffer* buffer); +- +- void ConvertRGBxToBGRx(uint8_t* frame, uint32_t size); +- +- static void OnCoreError(void *data, +- uint32_t id, +- int seq, +- int res, +- const char *message); +- static void OnStreamParamChanged(void *data, +- uint32_t id, +- const struct spa_pod *format); +- static void OnStreamStateChanged(void* data, +- pw_stream_state old_state, +- pw_stream_state state, +- const char* error_message); +- static void OnStreamProcess(void* data); +- static void OnNewBuffer(void* data, uint32_t id); +- +- guint SetupRequestResponseSignal(const gchar* object_path, +- GDBusSignalCallback callback); +- +- static void OnProxyRequested(GObject* object, +- GAsyncResult* result, +- gpointer user_data); +- +- static gchar* PrepareSignalHandle(GDBusConnection* connection, +- const gchar* token); +- +- void SessionRequest(); +- static void OnSessionRequested(GDBusProxy *proxy, +- GAsyncResult* result, +- gpointer user_data); +- static void OnSessionRequestResponseSignal(GDBusConnection* connection, +- const gchar* sender_name, +- const gchar* object_path, +- const gchar* interface_name, +- const gchar* signal_name, +- GVariant* parameters, +- gpointer user_data); +- +- void SourcesRequest(); +- static void OnSourcesRequested(GDBusProxy *proxy, +- GAsyncResult* result, +- gpointer user_data); +- static void OnSourcesRequestResponseSignal(GDBusConnection* connection, +- const gchar* sender_name, +- const gchar* object_path, +- const gchar* interface_name, +- const gchar* signal_name, +- GVariant* parameters, +- gpointer user_data); +- +- void StartRequest(); +- static void OnStartRequested(GDBusProxy *proxy, +- GAsyncResult* result, +- gpointer user_data); +- static void OnStartRequestResponseSignal(GDBusConnection* connection, +- const gchar* sender_name, +- const gchar* object_path, +- const gchar* interface_name, +- const gchar* signal_name, +- GVariant* parameters, +- gpointer user_data); +- +- void OpenPipeWireRemote(); +- static void OnOpenPipeWireRemoteRequested(GDBusProxy *proxy, +- GAsyncResult* result, +- gpointer user_data); +- +- RTC_DISALLOW_COPY_AND_ASSIGN(BaseCapturerPipeWire); ++ bool capturer_failed_ = false; ++ std::unique_ptr screencast_portal_; + }; + + } // namespace webrtc +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.429095367 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs 2022-07-26 16:30:19.429095367 +0200 +@@ -0,0 +1,11 @@ ++// Copyright 2021 The WebRTC project authors. All rights reserved. ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++//------------------------------------------------ ++// Functions from DRM used in capturer code. ++//-------- ++ ++// xf86drm.h ++int drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices); ++void drmFreeDevices(drmDevicePtr devices[], int count); +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.430095401 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc 2022-07-26 16:30:19.430095401 +0200 +@@ -0,0 +1,695 @@ ++/* ++ * Copyright 2021 The WebRTC project authors. All Rights Reserved. ++ * ++ * Use of this source code is governed by a BSD-style license ++ * that can be found in the LICENSE file in the root of the source ++ * tree. An additional intellectual property rights grant can be found ++ * in the file PATENTS. All contributing project authors may ++ * be found in the AUTHORS file in the root of the source tree. ++ */ ++ ++#include "modules/desktop_capture/linux/egl_dmabuf.h" ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "absl/memory/memory.h" ++#include "absl/types/optional.h" ++#include "rtc_base/checks.h" ++#include "rtc_base/logging.h" ++#include "rtc_base/sanitizer.h" ++#include "rtc_base/string_encode.h" ++ ++namespace webrtc { ++ ++// EGL ++typedef EGLBoolean (*eglBindAPI_func)(EGLenum api); ++typedef EGLContext (*eglCreateContext_func)(EGLDisplay dpy, ++ EGLConfig config, ++ EGLContext share_context, ++ const EGLint* attrib_list); ++typedef EGLBoolean (*eglDestroyContext_func)(EGLDisplay display, ++ EGLContext context); ++typedef EGLBoolean (*eglTerminate_func)(EGLDisplay display); ++typedef EGLImageKHR (*eglCreateImageKHR_func)(EGLDisplay dpy, ++ EGLContext ctx, ++ EGLenum target, ++ EGLClientBuffer buffer, ++ const EGLint* attrib_list); ++typedef EGLBoolean (*eglDestroyImageKHR_func)(EGLDisplay dpy, ++ EGLImageKHR image); ++typedef EGLint (*eglGetError_func)(void); ++typedef void* (*eglGetProcAddress_func)(const char*); ++typedef EGLDisplay (*eglGetPlatformDisplayEXT_func)(EGLenum platform, ++ void* native_display, ++ const EGLint* attrib_list); ++typedef EGLDisplay (*eglGetPlatformDisplay_func)(EGLenum platform, ++ void* native_display, ++ const EGLAttrib* attrib_list); ++ ++typedef EGLBoolean (*eglInitialize_func)(EGLDisplay dpy, ++ EGLint* major, ++ EGLint* minor); ++typedef EGLBoolean (*eglMakeCurrent_func)(EGLDisplay dpy, ++ EGLSurface draw, ++ EGLSurface read, ++ EGLContext ctx); ++typedef EGLBoolean (*eglQueryDmaBufFormatsEXT_func)(EGLDisplay dpy, ++ EGLint max_formats, ++ EGLint* formats, ++ EGLint* num_formats); ++typedef EGLBoolean (*eglQueryDmaBufModifiersEXT_func)(EGLDisplay dpy, ++ EGLint format, ++ EGLint max_modifiers, ++ EGLuint64KHR* modifiers, ++ EGLBoolean* external_only, ++ EGLint* num_modifiers); ++typedef const char* (*eglQueryString_func)(EGLDisplay dpy, EGLint name); ++typedef void (*glEGLImageTargetTexture2DOES_func)(GLenum target, ++ GLeglImageOES image); ++ ++// This doesn't follow naming conventions in WebRTC, where the naming ++// should look like e.g. egl_bind_api instead of EglBindAPI, however ++// we named them according to the exported functions they map to for ++// consistency. ++eglBindAPI_func EglBindAPI = nullptr; ++eglCreateContext_func EglCreateContext = nullptr; ++eglDestroyContext_func EglDestroyContext = nullptr; ++eglTerminate_func EglTerminate = nullptr; ++eglCreateImageKHR_func EglCreateImageKHR = nullptr; ++eglDestroyImageKHR_func EglDestroyImageKHR = nullptr; ++eglGetError_func EglGetError = nullptr; ++eglGetProcAddress_func EglGetProcAddress = nullptr; ++eglGetPlatformDisplayEXT_func EglGetPlatformDisplayEXT = nullptr; ++eglGetPlatformDisplay_func EglGetPlatformDisplay = nullptr; ++eglInitialize_func EglInitialize = nullptr; ++eglMakeCurrent_func EglMakeCurrent = nullptr; ++eglQueryDmaBufFormatsEXT_func EglQueryDmaBufFormatsEXT = nullptr; ++eglQueryDmaBufModifiersEXT_func EglQueryDmaBufModifiersEXT = nullptr; ++eglQueryString_func EglQueryString = nullptr; ++glEGLImageTargetTexture2DOES_func GlEGLImageTargetTexture2DOES = nullptr; ++ ++// GL ++typedef void (*glBindTexture_func)(GLenum target, GLuint texture); ++typedef void (*glDeleteTextures_func)(GLsizei n, const GLuint* textures); ++typedef void (*glGenTextures_func)(GLsizei n, GLuint* textures); ++typedef GLenum (*glGetError_func)(void); ++typedef const GLubyte* (*glGetString_func)(GLenum name); ++typedef void (*glGetTexImage_func)(GLenum target, ++ GLint level, ++ GLenum format, ++ GLenum type, ++ void* pixels); ++typedef void (*glTexParameteri_func)(GLenum target, GLenum pname, GLint param); ++typedef void* (*glXGetProcAddressARB_func)(const char*); ++ ++// This doesn't follow naming conventions in WebRTC, where the naming ++// should look like e.g. egl_bind_api instead of EglBindAPI, however ++// we named them according to the exported functions they map to for ++// consistency. ++glBindTexture_func GlBindTexture = nullptr; ++glDeleteTextures_func GlDeleteTextures = nullptr; ++glGenTextures_func GlGenTextures = nullptr; ++glGetError_func GlGetError = nullptr; ++glGetString_func GlGetString = nullptr; ++glGetTexImage_func GlGetTexImage = nullptr; ++glTexParameteri_func GlTexParameteri = nullptr; ++glXGetProcAddressARB_func GlXGetProcAddressARB = nullptr; ++ ++static const std::string FormatGLError(GLenum err) { ++ switch (err) { ++ case GL_NO_ERROR: ++ return "GL_NO_ERROR"; ++ case GL_INVALID_ENUM: ++ return "GL_INVALID_ENUM"; ++ case GL_INVALID_VALUE: ++ return "GL_INVALID_VALUE"; ++ case GL_INVALID_OPERATION: ++ return "GL_INVALID_OPERATION"; ++ case GL_STACK_OVERFLOW: ++ return "GL_STACK_OVERFLOW"; ++ case GL_STACK_UNDERFLOW: ++ return "GL_STACK_UNDERFLOW"; ++ case GL_OUT_OF_MEMORY: ++ return "GL_OUT_OF_MEMORY"; ++ default: ++ return "GL error code: " + std::to_string(err); ++ } ++} ++ ++static const std::string FormatEGLError(EGLint err) { ++ switch (err) { ++ case EGL_NOT_INITIALIZED: ++ return "EGL_NOT_INITIALIZED"; ++ case EGL_BAD_ACCESS: ++ return "EGL_BAD_ACCESS"; ++ case EGL_BAD_ALLOC: ++ return "EGL_BAD_ALLOC"; ++ case EGL_BAD_ATTRIBUTE: ++ return "EGL_BAD_ATTRIBUTE"; ++ case EGL_BAD_CONTEXT: ++ return "EGL_BAD_CONTEXT"; ++ case EGL_BAD_CONFIG: ++ return "EGL_BAD_CONFIG"; ++ case EGL_BAD_CURRENT_SURFACE: ++ return "EGL_BAD_CURRENT_SURFACE"; ++ case EGL_BAD_DISPLAY: ++ return "EGL_BAD_DISPLAY"; ++ case EGL_BAD_SURFACE: ++ return "EGL_BAD_SURFACE"; ++ case EGL_BAD_MATCH: ++ return "EGL_BAD_MATCH"; ++ case EGL_BAD_PARAMETER: ++ return "EGL_BAD_PARAMETER"; ++ case EGL_BAD_NATIVE_PIXMAP: ++ return "EGL_BAD_NATIVE_PIXMAP"; ++ case EGL_BAD_NATIVE_WINDOW: ++ return "EGL_BAD_NATIVE_WINDOW"; ++ case EGL_CONTEXT_LOST: ++ return "EGL_CONTEXT_LOST"; ++ default: ++ return "EGL error code: " + std::to_string(err); ++ } ++} ++ ++static uint32_t SpaPixelFormatToDrmFormat(uint32_t spa_format) { ++ switch (spa_format) { ++ case SPA_VIDEO_FORMAT_RGBA: ++ return DRM_FORMAT_ABGR8888; ++ case SPA_VIDEO_FORMAT_RGBx: ++ return DRM_FORMAT_XBGR8888; ++ case SPA_VIDEO_FORMAT_BGRA: ++ return DRM_FORMAT_ARGB8888; ++ case SPA_VIDEO_FORMAT_BGRx: ++ return DRM_FORMAT_XRGB8888; ++ default: ++ return DRM_FORMAT_INVALID; ++ } ++} ++ ++static void CloseLibrary(void* library) { ++ if (library) { ++ dlclose(library); ++ library = nullptr; ++ } ++} ++ ++static void* g_lib_egl = nullptr; ++ ++static bool OpenEGL() { ++ g_lib_egl = dlopen("libEGL.so.1", RTLD_NOW | RTLD_GLOBAL); ++ if (g_lib_egl) { ++ EglGetProcAddress = ++ (eglGetProcAddress_func)dlsym(g_lib_egl, "eglGetProcAddress"); ++ return EglGetProcAddress; ++ } ++ ++ return false; ++} ++ ++static bool LoadEGL() { ++ if (OpenEGL()) { ++ EglBindAPI = (eglBindAPI_func)EglGetProcAddress("eglBindAPI"); ++ EglCreateContext = ++ (eglCreateContext_func)EglGetProcAddress("eglCreateContext"); ++ EglDestroyContext = ++ (eglDestroyContext_func)EglGetProcAddress("eglDestroyContext"); ++ EglTerminate = (eglTerminate_func)EglGetProcAddress("eglTerminate"); ++ EglCreateImageKHR = ++ (eglCreateImageKHR_func)EglGetProcAddress("eglCreateImageKHR"); ++ EglDestroyImageKHR = ++ (eglDestroyImageKHR_func)EglGetProcAddress("eglDestroyImageKHR"); ++ EglGetError = (eglGetError_func)EglGetProcAddress("eglGetError"); ++ EglGetPlatformDisplayEXT = (eglGetPlatformDisplayEXT_func)EglGetProcAddress( ++ "eglGetPlatformDisplayEXT"); ++ EglGetPlatformDisplay = ++ (eglGetPlatformDisplay_func)EglGetProcAddress("eglGetPlatformDisplay"); ++ EglInitialize = (eglInitialize_func)EglGetProcAddress("eglInitialize"); ++ EglMakeCurrent = (eglMakeCurrent_func)EglGetProcAddress("eglMakeCurrent"); ++ EglQueryString = (eglQueryString_func)EglGetProcAddress("eglQueryString"); ++ GlEGLImageTargetTexture2DOES = ++ (glEGLImageTargetTexture2DOES_func)EglGetProcAddress( ++ "glEGLImageTargetTexture2DOES"); ++ ++ return EglBindAPI && EglCreateContext && EglCreateImageKHR && ++ EglTerminate && EglDestroyContext && EglDestroyImageKHR && ++ EglGetError && EglGetPlatformDisplayEXT && EglGetPlatformDisplay && ++ EglInitialize && EglMakeCurrent && EglQueryString && ++ GlEGLImageTargetTexture2DOES; ++ } ++ ++ return false; ++} ++ ++static void* g_lib_gl = nullptr; ++ ++static bool OpenGL() { ++ std::vector names = {"libGL.so.1", "libGL.so"}; ++ for (const std::string& name : names) { ++ g_lib_gl = dlopen(name.c_str(), RTLD_NOW | RTLD_GLOBAL); ++ if (g_lib_gl) { ++ GlXGetProcAddressARB = ++ (glXGetProcAddressARB_func)dlsym(g_lib_gl, "glXGetProcAddressARB"); ++ return GlXGetProcAddressARB; ++ } ++ } ++ ++ return false; ++} ++ ++static bool LoadGL() { ++ if (OpenGL()) { ++ GlGetString = (glGetString_func)GlXGetProcAddressARB("glGetString"); ++ if (!GlGetString) { ++ return false; ++ } ++ ++ GlBindTexture = (glBindTexture_func)GlXGetProcAddressARB("glBindTexture"); ++ GlDeleteTextures = ++ (glDeleteTextures_func)GlXGetProcAddressARB("glDeleteTextures"); ++ GlGenTextures = (glGenTextures_func)GlXGetProcAddressARB("glGenTextures"); ++ GlGetError = (glGetError_func)GlXGetProcAddressARB("glGetError"); ++ GlGetTexImage = (glGetTexImage_func)GlXGetProcAddressARB("glGetTexImage"); ++ GlTexParameteri = ++ (glTexParameteri_func)GlXGetProcAddressARB("glTexParameteri"); ++ ++ return GlBindTexture && GlDeleteTextures && GlGenTextures && GlGetError && ++ GlGetTexImage && GlTexParameteri; ++ } ++ ++ return false; ++} ++ ++EglDmaBuf::EglDmaBuf() { ++ if (!LoadEGL()) { ++ RTC_LOG(LS_ERROR) << "Unable to load EGL entry functions."; ++ CloseLibrary(g_lib_egl); ++ return; ++ } ++ ++ if (!LoadGL()) { ++ RTC_LOG(LS_ERROR) << "Failed to load OpenGL entry functions."; ++ CloseLibrary(g_lib_gl); ++ return; ++ } ++ ++ if (!GetClientExtensions(EGL_NO_DISPLAY, EGL_EXTENSIONS)) { ++ return; ++ } ++ ++ bool has_platform_base_ext = false; ++ bool has_platform_gbm_ext = false; ++ bool has_khr_platform_gbm_ext = false; ++ ++ for (const auto& extension : egl_.extensions) { ++ if (extension == "EGL_EXT_platform_base") { ++ has_platform_base_ext = true; ++ continue; ++ } else if (extension == "EGL_MESA_platform_gbm") { ++ has_platform_gbm_ext = true; ++ continue; ++ } else if (extension == "EGL_KHR_platform_gbm") { ++ has_khr_platform_gbm_ext = true; ++ continue; ++ } ++ } ++ ++ if (!has_platform_base_ext || !has_platform_gbm_ext || ++ !has_khr_platform_gbm_ext) { ++ RTC_LOG(LS_ERROR) << "One of required EGL extensions is missing"; ++ return; ++ } ++ ++ egl_.display = EglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_KHR, ++ (void*)EGL_DEFAULT_DISPLAY, nullptr); ++ ++ if (egl_.display == EGL_NO_DISPLAY) { ++ RTC_LOG(LS_ERROR) << "Failed to obtain default EGL display: " ++ << FormatEGLError(EglGetError()) << "\n" ++ << "Defaulting to using first available render node"; ++ absl::optional render_node = GetRenderNode(); ++ if (!render_node) { ++ return; ++ } ++ ++ drm_fd_ = open(render_node->c_str(), O_RDWR); ++ ++ if (drm_fd_ < 0) { ++ RTC_LOG(LS_ERROR) << "Failed to open drm render node: " ++ << strerror(errno); ++ return; ++ } ++ ++ gbm_device_ = gbm_create_device(drm_fd_); ++ ++ if (!gbm_device_) { ++ RTC_LOG(LS_ERROR) << "Cannot create GBM device: " << strerror(errno); ++ close(drm_fd_); ++ return; ++ } ++ ++ // Use eglGetPlatformDisplayEXT() to get the display pointer ++ // if the implementation supports it. ++ egl_.display = ++ EglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_KHR, gbm_device_, nullptr); ++ } ++ ++ if (egl_.display == EGL_NO_DISPLAY) { ++ RTC_LOG(LS_ERROR) << "Error during obtaining EGL display: " ++ << FormatEGLError(EglGetError()); ++ return; ++ } ++ ++ EGLint major, minor; ++ if (EglInitialize(egl_.display, &major, &minor) == EGL_FALSE) { ++ RTC_LOG(LS_ERROR) << "Error during eglInitialize: " ++ << FormatEGLError(EglGetError()); ++ return; ++ } ++ ++ if (EglBindAPI(EGL_OPENGL_API) == EGL_FALSE) { ++ RTC_LOG(LS_ERROR) << "bind OpenGL API failed"; ++ return; ++ } ++ ++ egl_.context = ++ EglCreateContext(egl_.display, nullptr, EGL_NO_CONTEXT, nullptr); ++ ++ if (egl_.context == EGL_NO_CONTEXT) { ++ RTC_LOG(LS_ERROR) << "Couldn't create EGL context: " ++ << FormatGLError(EglGetError()); ++ return; ++ } ++ ++ if (!GetClientExtensions(egl_.display, EGL_EXTENSIONS)) { ++ return; ++ } ++ ++ bool has_image_dma_buf_import_modifiers_ext = false; ++ ++ for (const auto& extension : egl_.extensions) { ++ if (extension == "EGL_EXT_image_dma_buf_import") { ++ has_image_dma_buf_import_ext_ = true; ++ continue; ++ } else if (extension == "EGL_EXT_image_dma_buf_import_modifiers") { ++ has_image_dma_buf_import_modifiers_ext = true; ++ continue; ++ } ++ } ++ ++ if (has_image_dma_buf_import_ext_ && has_image_dma_buf_import_modifiers_ext) { ++ EglQueryDmaBufFormatsEXT = (eglQueryDmaBufFormatsEXT_func)EglGetProcAddress( ++ "eglQueryDmaBufFormatsEXT"); ++ EglQueryDmaBufModifiersEXT = ++ (eglQueryDmaBufModifiersEXT_func)EglGetProcAddress( ++ "eglQueryDmaBufModifiersEXT"); ++ } ++ ++ RTC_LOG(LS_INFO) << "Egl initialization succeeded"; ++ egl_initialized_ = true; ++} ++ ++EglDmaBuf::~EglDmaBuf() { ++ if (gbm_device_) { ++ gbm_device_destroy(gbm_device_); ++ close(drm_fd_); ++ } ++ ++ if (egl_.context != EGL_NO_CONTEXT) { ++ EglDestroyContext(egl_.display, egl_.context); ++ } ++ ++ if (egl_.display != EGL_NO_DISPLAY) { ++ EglTerminate(egl_.display); ++ } ++ ++ // BUG: crbug.com/1290566 ++ // Closing libEGL.so.1 when using NVidia drivers causes a crash ++ // when EglGetPlatformDisplayEXT() is used, at least this one is enough ++ // to be called to make it crash. ++ // It also looks that libepoxy and glad don't dlclose it either ++ // CloseLibrary(g_lib_egl); ++ // CloseLibrary(g_lib_gl); ++} ++ ++bool EglDmaBuf::GetClientExtensions(EGLDisplay dpy, EGLint name) { ++ // Get the list of client extensions ++ const char* client_extensions_cstring = EglQueryString(dpy, name); ++ if (!client_extensions_cstring) { ++ // If eglQueryString() returned NULL, the implementation doesn't support ++ // EGL_EXT_client_extensions. Expect an EGL_BAD_DISPLAY error. ++ RTC_LOG(LS_ERROR) << "No client extensions defined! " ++ << FormatEGLError(EglGetError()); ++ return false; ++ } ++ ++ std::vector client_extensions; ++ rtc::split(client_extensions_cstring, ' ', ++ &client_extensions); ++ for (const auto& extension : client_extensions) { ++ egl_.extensions.push_back(extension); ++ } ++ ++ return true; ++} ++ ++std::unique_ptr EglDmaBuf::ImageFromDmaBuf( ++ const DesktopSize& size, ++ uint32_t format, ++ const std::vector& plane_datas, ++ uint64_t modifier) { ++ std::unique_ptr src; ++ ++ if (!egl_initialized_) { ++ return src; ++ } ++ ++ if (plane_datas.size() <= 0) { ++ RTC_LOG(LS_ERROR) << "Failed to process buffer: invalid number of planes"; ++ return src; ++ } ++ ++ EGLint attribs[47]; ++ int atti = 0; ++ ++ attribs[atti++] = EGL_WIDTH; ++ attribs[atti++] = static_cast(size.width()); ++ attribs[atti++] = EGL_HEIGHT; ++ attribs[atti++] = static_cast(size.height()); ++ attribs[atti++] = EGL_LINUX_DRM_FOURCC_EXT; ++ attribs[atti++] = SpaPixelFormatToDrmFormat(format); ++ ++ if (plane_datas.size() > 0) { ++ attribs[atti++] = EGL_DMA_BUF_PLANE0_FD_EXT; ++ attribs[atti++] = plane_datas[0].fd; ++ attribs[atti++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT; ++ attribs[atti++] = plane_datas[0].offset; ++ attribs[atti++] = EGL_DMA_BUF_PLANE0_PITCH_EXT; ++ attribs[atti++] = plane_datas[0].stride; ++ ++ if (modifier != DRM_FORMAT_MOD_INVALID) { ++ attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT; ++ attribs[atti++] = modifier & 0xFFFFFFFF; ++ attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT; ++ attribs[atti++] = modifier >> 32; ++ } ++ } ++ ++ if (plane_datas.size() > 1) { ++ attribs[atti++] = EGL_DMA_BUF_PLANE1_FD_EXT; ++ attribs[atti++] = plane_datas[1].fd; ++ attribs[atti++] = EGL_DMA_BUF_PLANE1_OFFSET_EXT; ++ attribs[atti++] = plane_datas[1].offset; ++ attribs[atti++] = EGL_DMA_BUF_PLANE1_PITCH_EXT; ++ attribs[atti++] = plane_datas[1].stride; ++ ++ if (modifier != DRM_FORMAT_MOD_INVALID) { ++ attribs[atti++] = EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT; ++ attribs[atti++] = modifier & 0xFFFFFFFF; ++ attribs[atti++] = EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT; ++ attribs[atti++] = modifier >> 32; ++ } ++ } ++ ++ if (plane_datas.size() > 2) { ++ attribs[atti++] = EGL_DMA_BUF_PLANE2_FD_EXT; ++ attribs[atti++] = plane_datas[2].fd; ++ attribs[atti++] = EGL_DMA_BUF_PLANE2_OFFSET_EXT; ++ attribs[atti++] = plane_datas[2].offset; ++ attribs[atti++] = EGL_DMA_BUF_PLANE2_PITCH_EXT; ++ attribs[atti++] = plane_datas[2].stride; ++ ++ if (modifier != DRM_FORMAT_MOD_INVALID) { ++ attribs[atti++] = EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT; ++ attribs[atti++] = modifier & 0xFFFFFFFF; ++ attribs[atti++] = EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT; ++ attribs[atti++] = modifier >> 32; ++ } ++ } ++ ++ if (plane_datas.size() > 3) { ++ attribs[atti++] = EGL_DMA_BUF_PLANE3_FD_EXT; ++ attribs[atti++] = plane_datas[3].fd; ++ attribs[atti++] = EGL_DMA_BUF_PLANE3_OFFSET_EXT; ++ attribs[atti++] = plane_datas[3].offset; ++ attribs[atti++] = EGL_DMA_BUF_PLANE3_PITCH_EXT; ++ attribs[atti++] = plane_datas[3].stride; ++ ++ if (modifier != DRM_FORMAT_MOD_INVALID) { ++ attribs[atti++] = EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT; ++ attribs[atti++] = modifier & 0xFFFFFFFF; ++ attribs[atti++] = EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT; ++ attribs[atti++] = modifier >> 32; ++ } ++ } ++ ++ attribs[atti++] = EGL_NONE; ++ ++ // bind context to render thread ++ EglMakeCurrent(egl_.display, EGL_NO_SURFACE, EGL_NO_SURFACE, egl_.context); ++ ++ // create EGL image from attribute list ++ EGLImageKHR image = EglCreateImageKHR( ++ egl_.display, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, nullptr, attribs); ++ ++ if (image == EGL_NO_IMAGE) { ++ RTC_LOG(LS_ERROR) << "Failed to record frame: Error creating EGLImage - " ++ << FormatEGLError(EglGetError()); ++ return src; ++ } ++ ++ // create GL 2D texture for framebuffer ++ GLuint texture; ++ GlGenTextures(1, &texture); ++ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); ++ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); ++ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); ++ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); ++ GlBindTexture(GL_TEXTURE_2D, texture); ++ GlEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image); ++ ++ src = std::make_unique(plane_datas[0].stride * size.height()); ++ ++ GLenum gl_format = GL_BGRA; ++ switch (format) { ++ case SPA_VIDEO_FORMAT_RGBx: ++ gl_format = GL_RGBA; ++ break; ++ case SPA_VIDEO_FORMAT_RGBA: ++ gl_format = GL_RGBA; ++ break; ++ case SPA_VIDEO_FORMAT_BGRx: ++ gl_format = GL_BGRA; ++ break; ++ default: ++ gl_format = GL_BGRA; ++ break; ++ } ++ GlGetTexImage(GL_TEXTURE_2D, 0, gl_format, GL_UNSIGNED_BYTE, src.get()); ++ ++ if (GlGetError()) { ++ RTC_LOG(LS_ERROR) << "Failed to get image from DMA buffer."; ++ return src; ++ } ++ ++ GlDeleteTextures(1, &texture); ++ EglDestroyImageKHR(egl_.display, image); ++ ++ return src; ++} ++ ++std::vector EglDmaBuf::QueryDmaBufModifiers(uint32_t format) { ++ if (!egl_initialized_) { ++ return {}; ++ } ++ ++ // Explicit modifiers not supported, return just DRM_FORMAT_MOD_INVALID as we ++ // can still use modifier-less DMA-BUFs if we have required extension ++ if (EglQueryDmaBufFormatsEXT == nullptr || ++ EglQueryDmaBufModifiersEXT == nullptr) { ++ return has_image_dma_buf_import_ext_ ++ ? std::vector{DRM_FORMAT_MOD_INVALID} ++ : std::vector{}; ++ } ++ ++ uint32_t drm_format = SpaPixelFormatToDrmFormat(format); ++ // Should never happen as it's us who controls the list of supported formats ++ RTC_DCHECK(drm_format != DRM_FORMAT_INVALID); ++ ++ EGLint count = 0; ++ EGLBoolean success = ++ EglQueryDmaBufFormatsEXT(egl_.display, 0, nullptr, &count); ++ ++ if (!success || !count) { ++ RTC_LOG(LS_ERROR) << "Failed to query DMA-BUF formats."; ++ return {DRM_FORMAT_MOD_INVALID}; ++ } ++ ++ std::vector formats(count); ++ if (!EglQueryDmaBufFormatsEXT(egl_.display, count, ++ reinterpret_cast(formats.data()), ++ &count)) { ++ RTC_LOG(LS_ERROR) << "Failed to query DMA-BUF formats."; ++ return {DRM_FORMAT_MOD_INVALID}; ++ } ++ ++ if (std::find(formats.begin(), formats.end(), drm_format) == formats.end()) { ++ RTC_LOG(LS_ERROR) << "Format " << drm_format ++ << " not supported for modifiers."; ++ return {DRM_FORMAT_MOD_INVALID}; ++ } ++ ++ success = EglQueryDmaBufModifiersEXT(egl_.display, drm_format, 0, nullptr, ++ nullptr, &count); ++ ++ if (!success || !count) { ++ RTC_LOG(LS_ERROR) << "Failed to query DMA-BUF modifiers."; ++ return {DRM_FORMAT_MOD_INVALID}; ++ } ++ ++ std::vector modifiers(count); ++ if (!EglQueryDmaBufModifiersEXT(egl_.display, drm_format, count, ++ modifiers.data(), nullptr, &count)) { ++ RTC_LOG(LS_ERROR) << "Failed to query DMA-BUF modifiers."; ++ } ++ ++ // Support modifier-less buffers ++ modifiers.push_back(DRM_FORMAT_MOD_INVALID); ++ return modifiers; ++} ++ ++absl::optional EglDmaBuf::GetRenderNode() { ++ int max_devices = drmGetDevices2(0, nullptr, 0); ++ if (max_devices <= 0) { ++ RTC_LOG(LS_ERROR) << "drmGetDevices2() has not found any devices (errno=" ++ << -max_devices << ")"; ++ return absl::nullopt; ++ } ++ ++ std::vector devices(max_devices); ++ int ret = drmGetDevices2(0, devices.data(), max_devices); ++ if (ret < 0) { ++ RTC_LOG(LS_ERROR) << "drmGetDevices2() returned an error " << ret; ++ return absl::nullopt; ++ } ++ ++ std::string render_node; ++ ++ for (const drmDevicePtr& device : devices) { ++ if (device->available_nodes & (1 << DRM_NODE_RENDER)) { ++ render_node = device->nodes[DRM_NODE_RENDER]; ++ break; ++ } ++ } ++ ++ drmFreeDevices(devices.data(), ret); ++ return render_node; ++} ++ ++} // namespace webrtc +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.430095401 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h 2022-07-26 16:30:19.430095401 +0200 +@@ -0,0 +1,68 @@ ++/* ++ * Copyright 2021 The WebRTC project authors. All Rights Reserved. ++ * ++ * Use of this source code is governed by a BSD-style license ++ * that can be found in the LICENSE file in the root of the source ++ * tree. An additional intellectual property rights grant can be found ++ * in the file PATENTS. All contributing project authors may ++ * be found in the AUTHORS file in the root of the source tree. ++ */ ++ ++#ifndef MODULES_DESKTOP_CAPTURE_LINUX_EGL_DMABUF_H_ ++#define MODULES_DESKTOP_CAPTURE_LINUX_EGL_DMABUF_H_ ++ ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include "absl/types/optional.h" ++#include "modules/desktop_capture/desktop_geometry.h" ++ ++namespace webrtc { ++ ++class EglDmaBuf { ++ public: ++ struct EGLStruct { ++ std::vector extensions; ++ EGLDisplay display = EGL_NO_DISPLAY; ++ EGLContext context = EGL_NO_CONTEXT; ++ }; ++ ++ struct PlaneData { ++ int32_t fd; ++ uint32_t stride; ++ uint32_t offset; ++ }; ++ ++ EglDmaBuf(); ++ ~EglDmaBuf(); ++ ++ std::unique_ptr ImageFromDmaBuf( ++ const DesktopSize& size, ++ uint32_t format, ++ const std::vector& plane_datas, ++ uint64_t modifiers); ++ std::vector QueryDmaBufModifiers(uint32_t format); ++ ++ bool IsEglInitialized() const { return egl_initialized_; } ++ ++ private: ++ bool GetClientExtensions(EGLDisplay dpy, EGLint name); ++ ++ bool egl_initialized_ = false; ++ bool has_image_dma_buf_import_ext_ = false; ++ int32_t drm_fd_ = -1; // for GBM buffer mmap ++ gbm_device* gbm_device_ = nullptr; // for passed GBM buffer retrieval ++ ++ EGLStruct egl_; ++ ++ absl::optional GetRenderNode(); ++}; ++ ++} // namespace webrtc ++ ++#endif // MODULES_DESKTOP_CAPTURE_LINUX_EGL_DMABUF_H_ +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.430095401 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc 2022-07-26 16:30:19.430095401 +0200 +@@ -0,0 +1,56 @@ ++/* ++ * Copyright (c) 2022 The WebRTC project authors. All Rights Reserved. ++ * ++ * Use of this source code is governed by a BSD-style license ++ * that can be found in the LICENSE file in the root of the source ++ * tree. An additional intellectual property rights grant can be found ++ * in the file PATENTS. All contributing project authors may ++ * be found in the AUTHORS file in the root of the source tree. ++ */ ++ ++#include "modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h" ++ ++#include ++ ++#include "modules/desktop_capture/desktop_capture_options.h" ++#include "modules/desktop_capture/desktop_capturer.h" ++#include "rtc_base/checks.h" ++#include "rtc_base/logging.h" ++ ++namespace webrtc { ++ ++MouseCursorMonitorPipeWire::MouseCursorMonitorPipeWire( ++ const DesktopCaptureOptions& options) ++ : options_(options) { ++} ++ ++MouseCursorMonitorPipeWire::~MouseCursorMonitorPipeWire() {} ++ ++void MouseCursorMonitorPipeWire::Init(Callback* callback, Mode mode) { ++ RTC_DCHECK(!callback_); ++ RTC_DCHECK(callback); ++ ++ callback_ = callback; ++ mode_ = mode; ++} ++ ++void MouseCursorMonitorPipeWire::Capture() { ++ RTC_DCHECK(callback_); ++ ++ std::unique_ptr mouse_cursor = ++ options_.screencast_stream()->CaptureCursor(); ++ ++ if (mouse_cursor && mouse_cursor->image()->data()) { ++ callback_->OnMouseCursor(mouse_cursor.release()); ++ } ++ ++ if (mode_ == SHAPE_AND_POSITION) { ++ absl::optional mouse_cursor_position = ++ options_.screencast_stream()->CaptureCursorPosition(); ++ if (mouse_cursor_position) { ++ callback_->OnMouseCursorPosition(mouse_cursor_position.value()); ++ } ++ } ++} ++ ++} // namespace webrtc +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.430095401 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h 2022-07-26 16:30:19.430095401 +0200 +@@ -0,0 +1,41 @@ ++/* ++ * Copyright 2022 The WebRTC project authors. All Rights Reserved. ++ * ++ * Use of this source code is governed by a BSD-style license ++ * that can be found in the LICENSE file in the root of the source ++ * tree. An additional intellectual property rights grant can be found ++ * in the file PATENTS. All contributing project authors may ++ * be found in the AUTHORS file in the root of the source tree. ++ */ ++ ++#ifndef MODULES_DESKTOP_CAPTURE_LINUX_MOUSE_CURSOR_MONITOR_PIPEWIRE_H_ ++#define MODULES_DESKTOP_CAPTURE_LINUX_MOUSE_CURSOR_MONITOR_PIPEWIRE_H_ ++ ++#include ++ ++#include "api/scoped_refptr.h" ++#include "modules/desktop_capture/desktop_capture_options.h" ++#include "modules/desktop_capture/desktop_capture_types.h" ++#include "modules/desktop_capture/linux/shared_screencast_stream.h" ++#include "modules/desktop_capture/mouse_cursor.h" ++#include "modules/desktop_capture/mouse_cursor_monitor.h" ++ ++namespace webrtc { ++ ++class MouseCursorMonitorPipeWire : public MouseCursorMonitor { ++ public: ++ explicit MouseCursorMonitorPipeWire(const DesktopCaptureOptions& options); ++ ~MouseCursorMonitorPipeWire() override; ++ ++ // MouseCursorMonitor: ++ void Init(Callback* callback, Mode mode) override; ++ void Capture() override; ++ ++ DesktopCaptureOptions options_; ++ Callback* callback_ = nullptr; ++ Mode mode_ = SHAPE_AND_POSITION; ++}; ++ ++} // namespace webrtc ++ ++#endif // MODULES_DESKTOP_CAPTURE_LINUX_MOUSE_CURSOR_MONITOR_PIPEWIRE_H_ +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs.libwebrtc-screen-cast-sync 2022-07-18 20:44:36.000000000 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs 2022-07-26 16:30:19.430095401 +0200 +@@ -7,38 +7,44 @@ + //------------------------------------------------ + + // core.h +-void pw_core_destroy(pw_core *core); +-pw_type *pw_core_get_type(pw_core *core); +-pw_core * pw_core_new(pw_loop *main_loop, pw_properties *props); ++int pw_core_disconnect(pw_core *core); + + // loop.h + void pw_loop_destroy(pw_loop *loop); +-pw_loop * pw_loop_new(pw_properties *properties); ++pw_loop * pw_loop_new(const spa_dict *props); ++ + + // pipewire.h + void pw_init(int *argc, char **argv[]); ++const char* pw_get_library_version(); + + // properties.h + pw_properties * pw_properties_new_string(const char *args); + +-// remote.h +-void pw_remote_add_listener(pw_remote *remote, spa_hook *listener, const pw_remote_events *events, void *data); +-int pw_remote_connect_fd(pw_remote *remote, int fd); +-void pw_remote_destroy(pw_remote *remote); +-pw_remote * pw_remote_new(pw_core *core, pw_properties *properties, size_t user_data_size); +- + // stream.h + void pw_stream_add_listener(pw_stream *stream, spa_hook *listener, const pw_stream_events *events, void *data); +-int pw_stream_connect(pw_stream *stream, enum pw_direction direction, const char *port_path, enum pw_stream_flags flags, const spa_pod **params, uint32_t n_params); ++int pw_stream_connect(pw_stream *stream, enum pw_direction direction, uint32_t target_id, enum pw_stream_flags flags, const spa_pod **params, uint32_t n_params); ++int pw_stream_disconnect(pw_stream *stream); + pw_buffer *pw_stream_dequeue_buffer(pw_stream *stream); + void pw_stream_destroy(pw_stream *stream); +-void pw_stream_finish_format(pw_stream *stream, int res, const spa_pod **params, uint32_t n_params); +-pw_stream * pw_stream_new(pw_remote *remote, const char *name, pw_properties *props); ++pw_stream * pw_stream_new(pw_core *core, const char *name, pw_properties *props); + int pw_stream_queue_buffer(pw_stream *stream, pw_buffer *buffer); + int pw_stream_set_active(pw_stream *stream, bool active); ++int pw_stream_update_params(pw_stream *stream, const spa_pod **params, uint32_t n_params); + + // thread-loop.h + void pw_thread_loop_destroy(pw_thread_loop *loop); +-pw_thread_loop * pw_thread_loop_new(pw_loop *loop, const char *name); ++pw_thread_loop * pw_thread_loop_new(const char *name, const spa_dict *props); + int pw_thread_loop_start(pw_thread_loop *loop); + void pw_thread_loop_stop(pw_thread_loop *loop); ++void pw_thread_loop_lock(pw_thread_loop *loop); ++void pw_thread_loop_unlock(pw_thread_loop *loop); ++pw_loop * pw_thread_loop_get_loop(pw_thread_loop *loop); ++void pw_thread_loop_signal(pw_thread_loop *loop, bool wait_for_accept); ++void pw_thread_loop_wait(pw_thread_loop *loop); ++ ++// context.h ++void pw_context_destroy(pw_context *context); ++pw_context *pw_context_new(pw_loop *main_loop, pw_properties *props, size_t user_data_size); ++pw_core * pw_context_connect(pw_context *context, pw_properties *properties, size_t user_data_size); ++pw_core * pw_context_connect_fd(pw_context *context, int fd, pw_properties *properties, size_t user_data_size); +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment.libwebrtc-screen-cast-sync 2022-07-18 20:44:36.000000000 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment 2022-07-26 16:30:19.430095401 +0200 +@@ -5,4 +5,5 @@ extern "C" { + + #include + ++#include + } +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.430095401 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc 2022-07-26 16:30:19.430095401 +0200 +@@ -0,0 +1,57 @@ ++/* ++ * Copyright 2022 The WebRTC project authors. All Rights Reserved. ++ * ++ * Use of this source code is governed by a BSD-style license ++ * that can be found in the LICENSE file in the root of the source ++ * tree. An additional intellectual property rights grant can be found ++ * in the file PATENTS. All contributing project authors may ++ * be found in the AUTHORS file in the root of the source tree. ++ */ ++ ++#include "modules/desktop_capture/linux/scoped_glib.h" ++ ++namespace webrtc { ++ ++template <> ++Scoped::~Scoped() { ++ if (ptr_) { ++ g_error_free(ptr_); ++ } ++} ++ ++template <> ++Scoped::~Scoped() { ++ if (ptr_) { ++ g_free(ptr_); ++ } ++} ++ ++template <> ++Scoped::~Scoped() { ++ if (ptr_) { ++ g_variant_unref(ptr_); ++ } ++} ++ ++template <> ++Scoped::~Scoped() { ++ if (ptr_) { ++ g_variant_iter_free(ptr_); ++ } ++} ++ ++template <> ++Scoped::~Scoped() { ++ if (ptr_) { ++ g_object_unref(ptr_); ++ } ++} ++ ++template <> ++Scoped::~Scoped() { ++ if (ptr_) { ++ g_object_unref(ptr_); ++ } ++} ++ ++} // namespace webrtc +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.430095401 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h 2022-07-26 16:30:19.430095401 +0200 +@@ -0,0 +1,65 @@ ++/* ++ * Copyright 2022 The WebRTC project authors. All Rights Reserved. ++ * ++ * Use of this source code is governed by a BSD-style license ++ * that can be found in the LICENSE file in the root of the source ++ * tree. An additional intellectual property rights grant can be found ++ * in the file PATENTS. All contributing project authors may ++ * be found in the AUTHORS file in the root of the source tree. ++ */ ++ ++#ifndef MODULES_DESKTOP_CAPTURE_LINUX_SCOPED_GLIB_H_ ++#define MODULES_DESKTOP_CAPTURE_LINUX_SCOPED_GLIB_H_ ++ ++#include ++ ++#include "rtc_base/checks.h" ++ ++namespace webrtc { ++ ++template ++class Scoped { ++ public: ++ Scoped() {} ++ explicit Scoped(T* val) { ptr_ = val; } ++ ~Scoped() { RTC_DCHECK_NOTREACHED(); } ++ ++ T* operator->() const { return ptr_; } ++ ++ explicit operator bool() const { return ptr_ != nullptr; } ++ ++ bool operator!() const { return ptr_ == nullptr; } ++ ++ T* get() const { return ptr_; } ++ ++ T** receive() { ++ RTC_CHECK(!ptr_); ++ return &ptr_; ++ } ++ ++ Scoped& operator=(T* val) { ++ RTC_DCHECK(val); ++ ptr_ = val; ++ return *this; ++ } ++ ++ protected: ++ T* ptr_ = nullptr; ++}; ++ ++template <> ++Scoped::~Scoped(); ++template <> ++Scoped::~Scoped(); ++template <> ++Scoped::~Scoped(); ++template <> ++Scoped::~Scoped(); ++template <> ++Scoped::~Scoped(); ++template <> ++Scoped::~Scoped(); ++ ++} // namespace webrtc ++ ++#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCOPED_GLIB_H_ +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.430095401 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc 2022-07-26 16:30:19.430095401 +0200 +@@ -0,0 +1,532 @@ ++/* ++ * Copyright 2022 The WebRTC project authors. All Rights Reserved. ++ * ++ * Use of this source code is governed by a BSD-style license ++ * that can be found in the LICENSE file in the root of the source ++ * tree. An additional intellectual property rights grant can be found ++ * in the file PATENTS. All contributing project authors may ++ * be found in the AUTHORS file in the root of the source tree. ++ */ ++ ++#include "modules/desktop_capture/linux/screencast_portal.h" ++ ++#include ++#include ++ ++#include "modules/desktop_capture/linux/scoped_glib.h" ++#include "rtc_base/checks.h" ++#include "rtc_base/logging.h" ++ ++namespace webrtc { ++ ++const char kDesktopBusName[] = "org.freedesktop.portal.Desktop"; ++const char kDesktopObjectPath[] = "/org/freedesktop/portal/desktop"; ++const char kDesktopRequestObjectPath[] = ++ "/org/freedesktop/portal/desktop/request"; ++const char kSessionInterfaceName[] = "org.freedesktop.portal.Session"; ++const char kRequestInterfaceName[] = "org.freedesktop.portal.Request"; ++const char kScreenCastInterfaceName[] = "org.freedesktop.portal.ScreenCast"; ++ ++ScreenCastPortal::ScreenCastPortal(CaptureSourceType source_type, ++ PortalNotifier* notifier) ++ : notifier_(notifier), capture_source_type_(source_type) {} ++ ++ScreenCastPortal::~ScreenCastPortal() { ++ if (start_request_signal_id_) { ++ g_dbus_connection_signal_unsubscribe(connection_, start_request_signal_id_); ++ } ++ if (sources_request_signal_id_) { ++ g_dbus_connection_signal_unsubscribe(connection_, ++ sources_request_signal_id_); ++ } ++ if (session_request_signal_id_) { ++ g_dbus_connection_signal_unsubscribe(connection_, ++ session_request_signal_id_); ++ } ++ ++ if (!session_handle_.empty()) { ++ Scoped message( ++ g_dbus_message_new_method_call(kDesktopBusName, session_handle_.c_str(), ++ kSessionInterfaceName, "Close")); ++ if (message.get()) { ++ Scoped error; ++ g_dbus_connection_send_message(connection_, message.get(), ++ G_DBUS_SEND_MESSAGE_FLAGS_NONE, ++ /*out_serial=*/nullptr, error.receive()); ++ if (error.get()) { ++ RTC_LOG(LS_ERROR) << "Failed to close the session: " << error->message; ++ } ++ } ++ } ++ ++ if (cancellable_) { ++ g_cancellable_cancel(cancellable_); ++ g_object_unref(cancellable_); ++ cancellable_ = nullptr; ++ } ++ ++ if (proxy_) { ++ g_object_unref(proxy_); ++ proxy_ = nullptr; ++ } ++ ++ if (pw_fd_ != -1) { ++ close(pw_fd_); ++ } ++} ++ ++void ScreenCastPortal::Start() { ++ cancellable_ = g_cancellable_new(); ++ g_dbus_proxy_new_for_bus( ++ G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, /*info=*/nullptr, ++ kDesktopBusName, kDesktopObjectPath, kScreenCastInterfaceName, ++ cancellable_, reinterpret_cast(OnProxyRequested), ++ this); ++} ++ ++void ScreenCastPortal::PortalFailed(RequestResponse result) { ++ notifier_->OnScreenCastRequestResult(result, pw_stream_node_id_, pw_fd_); ++} ++ ++uint32_t ScreenCastPortal::SetupRequestResponseSignal( ++ const char* object_path, ++ GDBusSignalCallback callback) { ++ return g_dbus_connection_signal_subscribe( ++ connection_, kDesktopBusName, kRequestInterfaceName, "Response", ++ object_path, /*arg0=*/nullptr, G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE, ++ callback, this, /*user_data_free_func=*/nullptr); ++} ++ ++// static ++void ScreenCastPortal::OnProxyRequested(GObject* /*object*/, ++ GAsyncResult* result, ++ gpointer user_data) { ++ ScreenCastPortal* that = static_cast(user_data); ++ RTC_DCHECK(that); ++ ++ Scoped error; ++ GDBusProxy* proxy = g_dbus_proxy_new_finish(result, error.receive()); ++ if (!proxy) { ++ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) ++ return; ++ RTC_LOG(LS_ERROR) << "Failed to create a proxy for the screen cast portal: " ++ << error->message; ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ that->proxy_ = proxy; ++ that->connection_ = g_dbus_proxy_get_connection(that->proxy_); ++ ++ RTC_LOG(LS_INFO) << "Created proxy for the screen cast portal."; ++ ++ that->SessionRequest(); ++} ++ ++// static ++std::string ScreenCastPortal::PrepareSignalHandle(GDBusConnection* connection, ++ const char* token) { ++ Scoped sender( ++ g_strdup(g_dbus_connection_get_unique_name(connection) + 1)); ++ for (int i = 0; sender.get()[i]; ++i) { ++ if (sender.get()[i] == '.') { ++ sender.get()[i] = '_'; ++ } ++ } ++ ++ const char* handle = g_strconcat(kDesktopRequestObjectPath, "/", sender.get(), ++ "/", token, /*end of varargs*/ nullptr); ++ ++ return handle; ++} ++ ++void ScreenCastPortal::SessionRequest() { ++ GVariantBuilder builder; ++ Scoped variant_string; ++ ++ g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); ++ variant_string = ++ g_strdup_printf("webrtc_session%d", g_random_int_range(0, G_MAXINT)); ++ g_variant_builder_add(&builder, "{sv}", "session_handle_token", ++ g_variant_new_string(variant_string.get())); ++ variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); ++ g_variant_builder_add(&builder, "{sv}", "handle_token", ++ g_variant_new_string(variant_string.get())); ++ ++ portal_handle_ = PrepareSignalHandle(connection_, variant_string.get()); ++ session_request_signal_id_ = SetupRequestResponseSignal( ++ portal_handle_.c_str(), OnSessionRequestResponseSignal); ++ ++ RTC_LOG(LS_INFO) << "Screen cast session requested."; ++ g_dbus_proxy_call(proxy_, "CreateSession", g_variant_new("(a{sv})", &builder), ++ G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, ++ reinterpret_cast(OnSessionRequested), ++ this); ++} ++ ++// static ++void ScreenCastPortal::OnSessionRequested(GDBusProxy* proxy, ++ GAsyncResult* result, ++ gpointer user_data) { ++ ScreenCastPortal* that = static_cast(user_data); ++ RTC_DCHECK(that); ++ ++ Scoped error; ++ Scoped variant( ++ g_dbus_proxy_call_finish(proxy, result, error.receive())); ++ if (!variant) { ++ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) ++ return; ++ RTC_LOG(LS_ERROR) << "Failed to create a screen cast session: " ++ << error->message; ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ RTC_LOG(LS_INFO) << "Initializing the screen cast session."; ++ ++ Scoped handle; ++ g_variant_get_child(variant.get(), 0, "o", &handle); ++ if (!handle) { ++ RTC_LOG(LS_ERROR) << "Failed to initialize the screen cast session."; ++ if (that->session_request_signal_id_) { ++ g_dbus_connection_signal_unsubscribe(that->connection_, ++ that->session_request_signal_id_); ++ that->session_request_signal_id_ = 0; ++ } ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ ++ RTC_LOG(LS_INFO) << "Subscribing to the screen cast session."; ++} ++ ++// static ++void ScreenCastPortal::OnSessionRequestResponseSignal( ++ GDBusConnection* connection, ++ const char* sender_name, ++ const char* object_path, ++ const char* interface_name, ++ const char* signal_name, ++ GVariant* parameters, ++ gpointer user_data) { ++ ScreenCastPortal* that = static_cast(user_data); ++ RTC_DCHECK(that); ++ ++ RTC_LOG(LS_INFO) ++ << "Received response for the screen cast session subscription."; ++ ++ uint32_t portal_response; ++ Scoped response_data; ++ g_variant_get(parameters, "(u@a{sv})", &portal_response, ++ response_data.receive()); ++ Scoped session_handle( ++ g_variant_lookup_value(response_data.get(), "session_handle", nullptr)); ++ that->session_handle_ = g_variant_dup_string(session_handle.get(), nullptr); ++ ++ if (that->session_handle_.empty() || portal_response) { ++ RTC_LOG(LS_ERROR) ++ << "Failed to request the screen cast session subscription."; ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ ++ that->session_closed_signal_id_ = g_dbus_connection_signal_subscribe( ++ that->connection_, kDesktopBusName, kSessionInterfaceName, "Closed", ++ that->session_handle_.c_str(), /*arg0=*/nullptr, G_DBUS_SIGNAL_FLAGS_NONE, ++ OnSessionClosedSignal, that, /*user_data_free_func=*/nullptr); ++ ++ that->SourcesRequest(); ++} ++ ++// static ++void ScreenCastPortal::OnSessionClosedSignal(GDBusConnection* connection, ++ const char* sender_name, ++ const char* object_path, ++ const char* interface_name, ++ const char* signal_name, ++ GVariant* parameters, ++ gpointer user_data) { ++ ScreenCastPortal* that = static_cast(user_data); ++ RTC_DCHECK(that); ++ ++ RTC_LOG(LS_INFO) << "Received closed signal from session."; ++ ++ that->notifier_->OnScreenCastSessionClosed(); ++ ++ // Unsubscribe from the signal and free the session handle to avoid calling ++ // Session::Close from the destructor since it's already closed ++ g_dbus_connection_signal_unsubscribe(that->connection_, ++ that->session_closed_signal_id_); ++} ++ ++void ScreenCastPortal::SourcesRequest() { ++ GVariantBuilder builder; ++ Scoped variant_string; ++ ++ g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); ++ // We want to record monitor content. ++ g_variant_builder_add( ++ &builder, "{sv}", "types", ++ g_variant_new_uint32(static_cast(capture_source_type_))); ++ // We don't want to allow selection of multiple sources. ++ g_variant_builder_add(&builder, "{sv}", "multiple", ++ g_variant_new_boolean(false)); ++ ++ Scoped variant( ++ g_dbus_proxy_get_cached_property(proxy_, "AvailableCursorModes")); ++ if (variant.get()) { ++ uint32_t modes = 0; ++ g_variant_get(variant.get(), "u", &modes); ++ // Make request only if this mode is advertised by the portal ++ // implementation. ++ if (modes & static_cast(cursor_mode_)) { ++ g_variant_builder_add( ++ &builder, "{sv}", "cursor_mode", ++ g_variant_new_uint32(static_cast(cursor_mode_))); ++ } ++ } ++ ++ variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); ++ g_variant_builder_add(&builder, "{sv}", "handle_token", ++ g_variant_new_string(variant_string.get())); ++ ++ sources_handle_ = PrepareSignalHandle(connection_, variant_string.get()); ++ sources_request_signal_id_ = SetupRequestResponseSignal( ++ sources_handle_.c_str(), OnSourcesRequestResponseSignal); ++ ++ RTC_LOG(LS_INFO) << "Requesting sources from the screen cast session."; ++ g_dbus_proxy_call( ++ proxy_, "SelectSources", ++ g_variant_new("(oa{sv})", session_handle_.c_str(), &builder), ++ G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, ++ reinterpret_cast(OnSourcesRequested), this); ++} ++ ++// static ++void ScreenCastPortal::OnSourcesRequested(GDBusProxy* proxy, ++ GAsyncResult* result, ++ gpointer user_data) { ++ ScreenCastPortal* that = static_cast(user_data); ++ RTC_DCHECK(that); ++ ++ Scoped error; ++ Scoped variant( ++ g_dbus_proxy_call_finish(proxy, result, error.receive())); ++ if (!variant) { ++ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) ++ return; ++ RTC_LOG(LS_ERROR) << "Failed to request the sources: " << error->message; ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ ++ RTC_LOG(LS_INFO) << "Sources requested from the screen cast session."; ++ ++ Scoped handle; ++ g_variant_get_child(variant.get(), 0, "o", handle.receive()); ++ if (!handle) { ++ RTC_LOG(LS_ERROR) << "Failed to initialize the screen cast session."; ++ if (that->sources_request_signal_id_) { ++ g_dbus_connection_signal_unsubscribe(that->connection_, ++ that->sources_request_signal_id_); ++ that->sources_request_signal_id_ = 0; ++ } ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ ++ RTC_LOG(LS_INFO) << "Subscribed to sources signal."; ++} ++ ++// static ++void ScreenCastPortal::OnSourcesRequestResponseSignal( ++ GDBusConnection* connection, ++ const char* sender_name, ++ const char* object_path, ++ const char* interface_name, ++ const char* signal_name, ++ GVariant* parameters, ++ gpointer user_data) { ++ ScreenCastPortal* that = static_cast(user_data); ++ RTC_DCHECK(that); ++ ++ RTC_LOG(LS_INFO) << "Received sources signal from session."; ++ ++ uint32_t portal_response; ++ g_variant_get(parameters, "(u@a{sv})", &portal_response, nullptr); ++ if (portal_response) { ++ RTC_LOG(LS_ERROR) ++ << "Failed to select sources for the screen cast session."; ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ ++ that->StartRequest(); ++} ++ ++void ScreenCastPortal::StartRequest() { ++ GVariantBuilder builder; ++ Scoped variant_string; ++ ++ g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); ++ variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); ++ g_variant_builder_add(&builder, "{sv}", "handle_token", ++ g_variant_new_string(variant_string.get())); ++ ++ start_handle_ = PrepareSignalHandle(connection_, variant_string.get()); ++ start_request_signal_id_ = SetupRequestResponseSignal( ++ start_handle_.c_str(), OnStartRequestResponseSignal); ++ ++ // "Identifier for the application window", this is Wayland, so not "x11:...". ++ const char parent_window[] = ""; ++ ++ RTC_LOG(LS_INFO) << "Starting the screen cast session."; ++ g_dbus_proxy_call(proxy_, "Start", ++ g_variant_new("(osa{sv})", session_handle_.c_str(), ++ parent_window, &builder), ++ G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, ++ reinterpret_cast(OnStartRequested), ++ this); ++} ++ ++// static ++void ScreenCastPortal::OnStartRequested(GDBusProxy* proxy, ++ GAsyncResult* result, ++ gpointer user_data) { ++ ScreenCastPortal* that = static_cast(user_data); ++ RTC_DCHECK(that); ++ ++ Scoped error; ++ Scoped variant( ++ g_dbus_proxy_call_finish(proxy, result, error.receive())); ++ if (!variant) { ++ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) ++ return; ++ RTC_LOG(LS_ERROR) << "Failed to start the screen cast session: " ++ << error->message; ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ ++ RTC_LOG(LS_INFO) << "Initializing the start of the screen cast session."; ++ ++ Scoped handle; ++ g_variant_get_child(variant.get(), 0, "o", handle.receive()); ++ if (!handle) { ++ RTC_LOG(LS_ERROR) ++ << "Failed to initialize the start of the screen cast session."; ++ if (that->start_request_signal_id_) { ++ g_dbus_connection_signal_unsubscribe(that->connection_, ++ that->start_request_signal_id_); ++ that->start_request_signal_id_ = 0; ++ } ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ ++ RTC_LOG(LS_INFO) << "Subscribed to the start signal."; ++} ++ ++// static ++void ScreenCastPortal::OnStartRequestResponseSignal(GDBusConnection* connection, ++ const char* sender_name, ++ const char* object_path, ++ const char* interface_name, ++ const char* signal_name, ++ GVariant* parameters, ++ gpointer user_data) { ++ ScreenCastPortal* that = static_cast(user_data); ++ RTC_DCHECK(that); ++ ++ RTC_LOG(LS_INFO) << "Start signal received."; ++ uint32_t portal_response; ++ Scoped response_data; ++ Scoped iter; ++ g_variant_get(parameters, "(u@a{sv})", &portal_response, ++ response_data.receive()); ++ if (portal_response || !response_data) { ++ RTC_LOG(LS_ERROR) << "Failed to start the screen cast session."; ++ that->PortalFailed(static_cast(portal_response)); ++ return; ++ } ++ ++ // Array of PipeWire streams. See ++ // https://github.com/flatpak/xdg-desktop-portal/blob/master/data/org.freedesktop.portal.ScreenCast.xml ++ // documentation for . ++ if (g_variant_lookup(response_data.get(), "streams", "a(ua{sv})", ++ iter.receive())) { ++ Scoped variant; ++ ++ while (g_variant_iter_next(iter.get(), "@(ua{sv})", variant.receive())) { ++ uint32_t stream_id; ++ uint32_t type; ++ Scoped options; ++ ++ g_variant_get(variant.get(), "(u@a{sv})", &stream_id, options.receive()); ++ RTC_DCHECK(options.get()); ++ ++ if (g_variant_lookup(options.get(), "source_type", "u", &type)) { ++ that->capture_source_type_ = ++ static_cast(type); ++ } ++ ++ that->pw_stream_node_id_ = stream_id; ++ ++ break; ++ } ++ } ++ ++ that->OpenPipeWireRemote(); ++} ++ ++void ScreenCastPortal::OpenPipeWireRemote() { ++ GVariantBuilder builder; ++ g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); ++ ++ RTC_LOG(LS_INFO) << "Opening the PipeWire remote."; ++ ++ g_dbus_proxy_call_with_unix_fd_list( ++ proxy_, "OpenPipeWireRemote", ++ g_variant_new("(oa{sv})", session_handle_.c_str(), &builder), ++ G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, /*fd_list=*/nullptr, cancellable_, ++ reinterpret_cast(OnOpenPipeWireRemoteRequested), ++ this); ++} ++ ++// static ++void ScreenCastPortal::OnOpenPipeWireRemoteRequested(GDBusProxy* proxy, ++ GAsyncResult* result, ++ gpointer user_data) { ++ ScreenCastPortal* that = static_cast(user_data); ++ RTC_DCHECK(that); ++ ++ Scoped error; ++ Scoped outlist; ++ Scoped variant(g_dbus_proxy_call_with_unix_fd_list_finish( ++ proxy, outlist.receive(), result, error.receive())); ++ if (!variant) { ++ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) ++ return; ++ RTC_LOG(LS_ERROR) << "Failed to open the PipeWire remote: " ++ << error->message; ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ ++ int32_t index; ++ g_variant_get(variant.get(), "(h)", &index); ++ ++ that->pw_fd_ = g_unix_fd_list_get(outlist.get(), index, error.receive()); ++ ++ if (that->pw_fd_ == -1) { ++ RTC_LOG(LS_ERROR) << "Failed to get file descriptor from the list: " ++ << error->message; ++ that->PortalFailed(RequestResponse::kError); ++ return; ++ } ++ ++ that->notifier_->OnScreenCastRequestResult( ++ ScreenCastPortal::RequestResponse::kSuccess, that->pw_stream_node_id_, ++ that->pw_fd_); ++} ++ ++} // namespace webrtc +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.430095401 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h 2022-07-26 16:30:19.430095401 +0200 +@@ -0,0 +1,169 @@ ++/* ++ * Copyright 2022 The WebRTC project authors. All Rights Reserved. ++ * ++ * Use of this source code is governed by a BSD-style license ++ * that can be found in the LICENSE file in the root of the source ++ * tree. An additional intellectual property rights grant can be found ++ * in the file PATENTS. All contributing project authors may ++ * be found in the AUTHORS file in the root of the source tree. ++ */ ++ ++#ifndef MODULES_DESKTOP_CAPTURE_LINUX_SCREENCAST_PORTAL_H_ ++#define MODULES_DESKTOP_CAPTURE_LINUX_SCREENCAST_PORTAL_H_ ++ ++#include ++ ++#include ++ ++#include "absl/types/optional.h" ++ ++namespace webrtc { ++ ++class ScreenCastPortal { ++ public: ++ // Values are set based on source type property in ++ // xdg-desktop-portal/screencast ++ // https://github.com/flatpak/xdg-desktop-portal/blob/master/data/org.freedesktop.portal.ScreenCast.xml ++ enum class CaptureSourceType : uint32_t { ++ kScreen = 0b01, ++ kWindow = 0b10, ++ kAnyScreenContent = kScreen | kWindow ++ }; ++ ++ // Values are set based on cursor mode property in ++ // xdg-desktop-portal/screencast ++ // https://github.com/flatpak/xdg-desktop-portal/blob/master/data/org.freedesktop.portal.ScreenCast.xml ++ enum class CursorMode : uint32_t { ++ // Mouse cursor will not be included in any form ++ kHidden = 0b01, ++ // Mouse cursor will be part of the screen content ++ kEmbedded = 0b10, ++ // Mouse cursor information will be send separately in form of metadata ++ kMetadata = 0b100 ++ }; ++ ++ // Interface that must be implemented by the ScreenCastPortal consumers. ++ enum class RequestResponse { ++ // Success, the request is carried out. ++ kSuccess, ++ // The user cancelled the interaction. ++ kUserCancelled, ++ // The user interaction was ended in some other way. ++ kError, ++ ++ kMaxValue = kError ++ }; ++ ++ class PortalNotifier { ++ public: ++ virtual void OnScreenCastRequestResult(RequestResponse result, ++ uint32_t stream_node_id, ++ int fd) = 0; ++ virtual void OnScreenCastSessionClosed() = 0; ++ ++ protected: ++ PortalNotifier() = default; ++ virtual ~PortalNotifier() = default; ++ }; ++ ++ explicit ScreenCastPortal(CaptureSourceType source_type, ++ PortalNotifier* notifier); ++ ~ScreenCastPortal(); ++ ++ // Initialize ScreenCastPortal with series of DBus calls where we try to ++ // obtain all the required information, like PipeWire file descriptor and ++ // PipeWire stream node ID. ++ // ++ // The observer will return whether the communication with xdg-desktop-portal ++ // was successful and only then you will be able to get all the required ++ // information in order to continue working with PipeWire. ++ void Start(); ++ ++ private: ++ PortalNotifier* notifier_; ++ ++ // A PipeWire stream ID of stream we will be connecting to ++ uint32_t pw_stream_node_id_ = 0; ++ // A file descriptor of PipeWire socket ++ int pw_fd_ = -1; ++ ++ CaptureSourceType capture_source_type_ = ++ ScreenCastPortal::CaptureSourceType::kScreen; ++ ++ CursorMode cursor_mode_ = ScreenCastPortal::CursorMode::kMetadata; ++ ++ GDBusConnection* connection_ = nullptr; ++ GDBusProxy* proxy_ = nullptr; ++ GCancellable* cancellable_ = nullptr; ++ std::string portal_handle_; ++ std::string session_handle_; ++ std::string sources_handle_; ++ std::string start_handle_; ++ guint session_request_signal_id_ = 0; ++ guint sources_request_signal_id_ = 0; ++ guint start_request_signal_id_ = 0; ++ guint session_closed_signal_id_ = 0; ++ ++ void PortalFailed(RequestResponse result); ++ ++ uint32_t SetupRequestResponseSignal(const char* object_path, ++ GDBusSignalCallback callback); ++ ++ static void OnProxyRequested(GObject* object, ++ GAsyncResult* result, ++ gpointer user_data); ++ ++ static std::string PrepareSignalHandle(GDBusConnection* connection, ++ const char* token); ++ ++ void SessionRequest(); ++ static void OnSessionRequested(GDBusProxy* proxy, ++ GAsyncResult* result, ++ gpointer user_data); ++ static void OnSessionRequestResponseSignal(GDBusConnection* connection, ++ const char* sender_name, ++ const char* object_path, ++ const char* interface_name, ++ const char* signal_name, ++ GVariant* parameters, ++ gpointer user_data); ++ static void OnSessionClosedSignal(GDBusConnection* connection, ++ const char* sender_name, ++ const char* object_path, ++ const char* interface_name, ++ const char* signal_name, ++ GVariant* parameters, ++ gpointer user_data); ++ void SourcesRequest(); ++ static void OnSourcesRequested(GDBusProxy* proxy, ++ GAsyncResult* result, ++ gpointer user_data); ++ static void OnSourcesRequestResponseSignal(GDBusConnection* connection, ++ const char* sender_name, ++ const char* object_path, ++ const char* interface_name, ++ const char* signal_name, ++ GVariant* parameters, ++ gpointer user_data); ++ ++ void StartRequest(); ++ static void OnStartRequested(GDBusProxy* proxy, ++ GAsyncResult* result, ++ gpointer user_data); ++ static void OnStartRequestResponseSignal(GDBusConnection* connection, ++ const char* sender_name, ++ const char* object_path, ++ const char* interface_name, ++ const char* signal_name, ++ GVariant* parameters, ++ gpointer user_data); ++ ++ void OpenPipeWireRemote(); ++ static void OnOpenPipeWireRemoteRequested(GDBusProxy* proxy, ++ GAsyncResult* result, ++ gpointer user_data); ++}; ++ ++} // namespace webrtc ++ ++#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCREENCAST_PORTAL_H_ +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.431095434 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc 2022-07-26 16:30:19.430095401 +0200 +@@ -0,0 +1,892 @@ ++/* ++ * Copyright 2022 The WebRTC project authors. All Rights Reserved. ++ * ++ * Use of this source code is governed by a BSD-style license ++ * that can be found in the LICENSE file in the root of the source ++ * tree. An additional intellectual property rights grant can be found ++ * in the file PATENTS. All contributing project authors may ++ * be found in the AUTHORS file in the root of the source tree. ++ */ ++ ++#include "modules/desktop_capture/linux/shared_screencast_stream.h" ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include "absl/memory/memory.h" ++#include "modules/desktop_capture/linux/egl_dmabuf.h" ++#include "modules/desktop_capture/screen_capture_frame_queue.h" ++#include "rtc_base/checks.h" ++#include "rtc_base/logging.h" ++#include "rtc_base/sanitizer.h" ++#include "rtc_base/string_encode.h" ++#include "rtc_base/string_to_number.h" ++#include "rtc_base/synchronization/mutex.h" ++ ++#if defined(WEBRTC_DLOPEN_PIPEWIRE) ++#include "modules/desktop_capture/linux/pipewire_stubs.h" ++using modules_desktop_capture_linux_wayland::InitializeStubs; ++using modules_desktop_capture_linux_wayland::kModuleDrm; ++using modules_desktop_capture_linux_wayland::kModulePipewire; ++using modules_desktop_capture_linux_wayland::StubPathMap; ++#endif // defined(WEBRTC_DLOPEN_PIPEWIRE) ++ ++namespace webrtc { ++ ++const int kBytesPerPixel = 4; ++ ++#if defined(WEBRTC_DLOPEN_PIPEWIRE) ++const char kPipeWireLib[] = "libpipewire-0.3.so.0"; ++const char kDrmLib[] = "libdrm.so.2"; ++#endif ++ ++#if !PW_CHECK_VERSION(0, 3, 29) ++#define SPA_POD_PROP_FLAG_MANDATORY (1u << 3) ++#endif ++#if !PW_CHECK_VERSION(0, 3, 33) ++#define SPA_POD_PROP_FLAG_DONT_FIXATE (1u << 4) ++#endif ++ ++constexpr int kCursorBpp = 4; ++constexpr int CursorMetaSize(int w, int h) { ++ return (sizeof(struct spa_meta_cursor) + sizeof(struct spa_meta_bitmap) + ++ w * h * kCursorBpp); ++} ++ ++struct PipeWireVersion { ++ int major = 0; ++ int minor = 0; ++ int micro = 0; ++}; ++ ++constexpr PipeWireVersion kDmaBufMinVersion = {0, 3, 24}; ++constexpr PipeWireVersion kDmaBufModifierMinVersion = {0, 3, 33}; ++constexpr PipeWireVersion kDropSingleModifierMinVersion = {0, 3, 40}; ++ ++PipeWireVersion ParsePipeWireVersion(const char* version) { ++ std::vector parsed_version; ++ rtc::split(version, '.', &parsed_version); ++ ++ if (parsed_version.size() != 3) { ++ return {}; ++ } ++ ++ absl::optional major = rtc::StringToNumber(parsed_version.at(0)); ++ absl::optional minor = rtc::StringToNumber(parsed_version.at(1)); ++ absl::optional micro = rtc::StringToNumber(parsed_version.at(2)); ++ ++ // Return invalid version if we failed to parse it ++ if (!major || !minor || !micro) { ++ return {0, 0, 0}; ++ } ++ ++ return {major.value(), micro.value(), micro.value()}; ++} ++ ++spa_pod* BuildFormat(spa_pod_builder* builder, ++ uint32_t format, ++ const std::vector& modifiers) { ++ bool first = true; ++ spa_pod_frame frames[2]; ++ spa_rectangle pw_min_screen_bounds = spa_rectangle{1, 1}; ++ spa_rectangle pw_max_screen_bounds = spa_rectangle{UINT32_MAX, UINT32_MAX}; ++ ++ spa_pod_builder_push_object(builder, &frames[0], SPA_TYPE_OBJECT_Format, ++ SPA_PARAM_EnumFormat); ++ spa_pod_builder_add(builder, SPA_FORMAT_mediaType, ++ SPA_POD_Id(SPA_MEDIA_TYPE_video), 0); ++ spa_pod_builder_add(builder, SPA_FORMAT_mediaSubtype, ++ SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw), 0); ++ spa_pod_builder_add(builder, SPA_FORMAT_VIDEO_format, SPA_POD_Id(format), 0); ++ ++ if (modifiers.size()) { ++ if (modifiers.size() == 1 && modifiers[0] == DRM_FORMAT_MOD_INVALID) { ++ spa_pod_builder_prop(builder, SPA_FORMAT_VIDEO_modifier, ++ SPA_POD_PROP_FLAG_MANDATORY); ++ spa_pod_builder_long(builder, modifiers[0]); ++ } else { ++ spa_pod_builder_prop( ++ builder, SPA_FORMAT_VIDEO_modifier, ++ SPA_POD_PROP_FLAG_MANDATORY | SPA_POD_PROP_FLAG_DONT_FIXATE); ++ spa_pod_builder_push_choice(builder, &frames[1], SPA_CHOICE_Enum, 0); ++ ++ // modifiers from the array ++ for (int64_t val : modifiers) { ++ spa_pod_builder_long(builder, val); ++ // Add the first modifier twice as the very first value is the default ++ // option ++ if (first) { ++ spa_pod_builder_long(builder, val); ++ first = false; ++ } ++ } ++ spa_pod_builder_pop(builder, &frames[1]); ++ } ++ } ++ ++ spa_pod_builder_add( ++ builder, SPA_FORMAT_VIDEO_size, ++ SPA_POD_CHOICE_RANGE_Rectangle( ++ &pw_min_screen_bounds, &pw_min_screen_bounds, &pw_max_screen_bounds), ++ 0); ++ ++ return static_cast(spa_pod_builder_pop(builder, &frames[0])); ++} ++ ++class PipeWireThreadLoopLock { ++ public: ++ explicit PipeWireThreadLoopLock(pw_thread_loop* loop) : loop_(loop) { ++ pw_thread_loop_lock(loop_); ++ } ++ ~PipeWireThreadLoopLock() { pw_thread_loop_unlock(loop_); } ++ ++ private: ++ pw_thread_loop* const loop_; ++}; ++ ++class ScopedBuf { ++ public: ++ ScopedBuf() {} ++ ScopedBuf(uint8_t* map, int map_size, int fd) ++ : map_(map), map_size_(map_size), fd_(fd) {} ++ ~ScopedBuf() { ++ if (map_ != MAP_FAILED) { ++ munmap(map_, map_size_); ++ } ++ } ++ ++ explicit operator bool() { return map_ != MAP_FAILED; } ++ ++ void initialize(uint8_t* map, int map_size, int fd) { ++ map_ = map; ++ map_size_ = map_size; ++ fd_ = fd; ++ } ++ ++ uint8_t* get() { return map_; } ++ ++ protected: ++ uint8_t* map_ = static_cast(MAP_FAILED); ++ int map_size_; ++ int fd_; ++}; ++ ++class SharedScreenCastStreamPrivate { ++ public: ++ SharedScreenCastStreamPrivate(); ++ ~SharedScreenCastStreamPrivate(); ++ ++ bool StartScreenCastStream(uint32_t stream_node_id, int fd); ++ void StopScreenCastStream(); ++ std::unique_ptr CaptureFrame(); ++ std::unique_ptr CaptureCursor(); ++ DesktopVector CaptureCursorPosition(); ++ ++ private: ++ uint32_t pw_stream_node_id_ = 0; ++ int pw_fd_ = -1; ++ ++ DesktopSize desktop_size_ = {}; ++ DesktopSize video_size_; ++ ++ webrtc::Mutex queue_lock_; ++ ScreenCaptureFrameQueue queue_ ++ RTC_GUARDED_BY(&queue_lock_); ++ std::unique_ptr mouse_cursor_; ++ DesktopVector mouse_cursor_position_ = DesktopVector(-1, -1); ++ ++ int64_t modifier_; ++ std::unique_ptr egl_dmabuf_; ++ // List of modifiers we query as supported by the graphics card/driver ++ std::vector modifiers_; ++ ++ // PipeWire types ++ struct pw_context* pw_context_ = nullptr; ++ struct pw_core* pw_core_ = nullptr; ++ struct pw_stream* pw_stream_ = nullptr; ++ struct pw_thread_loop* pw_main_loop_ = nullptr; ++ struct spa_source* renegotiate_ = nullptr; ++ ++ spa_hook spa_core_listener_; ++ spa_hook spa_stream_listener_; ++ ++ // A number used to verify all previous methods and the resulting ++ // events have been handled. ++ int server_version_sync_ = 0; ++ // Version of the running PipeWire server we communicate with ++ PipeWireVersion pw_server_version_; ++ // Version of the library used to run our code ++ PipeWireVersion pw_client_version_; ++ ++ // event handlers ++ pw_core_events pw_core_events_ = {}; ++ pw_stream_events pw_stream_events_ = {}; ++ ++ struct spa_video_info_raw spa_video_format_; ++ ++ void ProcessBuffer(pw_buffer* buffer); ++ void ConvertRGBxToBGRx(uint8_t* frame, uint32_t size); ++ ++ // PipeWire callbacks ++ static void OnCoreError(void* data, ++ uint32_t id, ++ int seq, ++ int res, ++ const char* message); ++ static void OnCoreDone(void* user_data, uint32_t id, int seq); ++ static void OnCoreInfo(void* user_data, const pw_core_info* info); ++ static void OnStreamParamChanged(void* data, ++ uint32_t id, ++ const struct spa_pod* format); ++ static void OnStreamStateChanged(void* data, ++ pw_stream_state old_state, ++ pw_stream_state state, ++ const char* error_message); ++ static void OnStreamProcess(void* data); ++ // This will be invoked in case we fail to process DMA-BUF PW buffer using ++ // negotiated stream parameters (modifier). We will drop the modifier we ++ // failed to use and try to use a different one or fallback to shared memory ++ // buffers. ++ static void OnRenegotiateFormat(void* data, uint64_t); ++}; ++ ++bool operator>=(const PipeWireVersion& current_pw_version, ++ const PipeWireVersion& required_pw_version) { ++ if (!current_pw_version.major && !current_pw_version.minor && ++ !current_pw_version.micro) { ++ return false; ++ } ++ ++ return std::tie(current_pw_version.major, current_pw_version.minor, ++ current_pw_version.micro) >= ++ std::tie(required_pw_version.major, required_pw_version.minor, ++ required_pw_version.micro); ++} ++ ++bool operator<=(const PipeWireVersion& current_pw_version, ++ const PipeWireVersion& required_pw_version) { ++ if (!current_pw_version.major && !current_pw_version.minor && ++ !current_pw_version.micro) { ++ return false; ++ } ++ ++ return std::tie(current_pw_version.major, current_pw_version.minor, ++ current_pw_version.micro) <= ++ std::tie(required_pw_version.major, required_pw_version.minor, ++ required_pw_version.micro); ++} ++ ++void SharedScreenCastStreamPrivate::OnCoreError(void* data, ++ uint32_t id, ++ int seq, ++ int res, ++ const char* message) { ++ SharedScreenCastStreamPrivate* that = ++ static_cast(data); ++ RTC_DCHECK(that); ++ ++ RTC_LOG(LS_ERROR) << "PipeWire remote error: " << message; ++} ++ ++void SharedScreenCastStreamPrivate::OnCoreInfo(void* data, ++ const pw_core_info* info) { ++ SharedScreenCastStreamPrivate* stream = ++ static_cast(data); ++ RTC_DCHECK(stream); ++ ++ stream->pw_server_version_ = ParsePipeWireVersion(info->version); ++} ++ ++void SharedScreenCastStreamPrivate::OnCoreDone(void* data, ++ uint32_t id, ++ int seq) { ++ const SharedScreenCastStreamPrivate* stream = ++ static_cast(data); ++ RTC_DCHECK(stream); ++ ++ if (id == PW_ID_CORE && stream->server_version_sync_ == seq) { ++ pw_thread_loop_signal(stream->pw_main_loop_, false); ++ } ++} ++ ++// static ++void SharedScreenCastStreamPrivate::OnStreamStateChanged( ++ void* data, ++ pw_stream_state old_state, ++ pw_stream_state state, ++ const char* error_message) { ++ SharedScreenCastStreamPrivate* that = ++ static_cast(data); ++ RTC_DCHECK(that); ++ ++ switch (state) { ++ case PW_STREAM_STATE_ERROR: ++ RTC_LOG(LS_ERROR) << "PipeWire stream state error: " << error_message; ++ break; ++ case PW_STREAM_STATE_PAUSED: ++ case PW_STREAM_STATE_STREAMING: ++ case PW_STREAM_STATE_UNCONNECTED: ++ case PW_STREAM_STATE_CONNECTING: ++ break; ++ } ++} ++ ++// static ++void SharedScreenCastStreamPrivate::OnStreamParamChanged( ++ void* data, ++ uint32_t id, ++ const struct spa_pod* format) { ++ SharedScreenCastStreamPrivate* that = ++ static_cast(data); ++ RTC_DCHECK(that); ++ ++ RTC_LOG(LS_INFO) << "PipeWire stream format changed."; ++ if (!format || id != SPA_PARAM_Format) { ++ return; ++ } ++ ++ spa_format_video_raw_parse(format, &that->spa_video_format_); ++ ++ auto width = that->spa_video_format_.size.width; ++ auto height = that->spa_video_format_.size.height; ++ auto stride = SPA_ROUND_UP_N(width * kBytesPerPixel, 4); ++ auto size = height * stride; ++ ++ that->desktop_size_ = DesktopSize(width, height); ++ ++ uint8_t buffer[1024] = {}; ++ auto builder = spa_pod_builder{buffer, sizeof(buffer)}; ++ ++ // Setup buffers and meta header for new format. ++ ++ // When SPA_FORMAT_VIDEO_modifier is present we can use DMA-BUFs as ++ // the server announces support for it. ++ // See https://github.com/PipeWire/pipewire/blob/master/doc/dma-buf.dox ++ const bool has_modifier = ++ spa_pod_find_prop(format, nullptr, SPA_FORMAT_VIDEO_modifier); ++ that->modifier_ = ++ has_modifier ? that->spa_video_format_.modifier : DRM_FORMAT_MOD_INVALID; ++ std::vector params; ++ const int buffer_types = ++ has_modifier || (that->pw_server_version_ >= kDmaBufMinVersion) ++ ? (1 << SPA_DATA_DmaBuf) | (1 << SPA_DATA_MemFd) | ++ (1 << SPA_DATA_MemPtr) ++ : (1 << SPA_DATA_MemFd) | (1 << SPA_DATA_MemPtr); ++ ++ params.push_back(reinterpret_cast(spa_pod_builder_add_object( ++ &builder, SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers, ++ SPA_PARAM_BUFFERS_size, SPA_POD_Int(size), SPA_PARAM_BUFFERS_stride, ++ SPA_POD_Int(stride), SPA_PARAM_BUFFERS_buffers, ++ SPA_POD_CHOICE_RANGE_Int(8, 1, 32), SPA_PARAM_BUFFERS_dataType, ++ SPA_POD_CHOICE_FLAGS_Int(buffer_types)))); ++ params.push_back(reinterpret_cast(spa_pod_builder_add_object( ++ &builder, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, ++ SPA_POD_Id(SPA_META_Header), SPA_PARAM_META_size, ++ SPA_POD_Int(sizeof(struct spa_meta_header))))); ++ params.push_back(reinterpret_cast(spa_pod_builder_add_object( ++ &builder, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, ++ SPA_POD_Id(SPA_META_VideoCrop), SPA_PARAM_META_size, ++ SPA_POD_Int(sizeof(struct spa_meta_region))))); ++ params.push_back(reinterpret_cast(spa_pod_builder_add_object( ++ &builder, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, ++ SPA_POD_Id(SPA_META_Cursor), SPA_PARAM_META_size, ++ SPA_POD_CHOICE_RANGE_Int(CursorMetaSize(64, 64), CursorMetaSize(1, 1), ++ CursorMetaSize(384, 384))))); ++ params.push_back(reinterpret_cast(spa_pod_builder_add_object( ++ &builder, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, ++ SPA_POD_Id(SPA_META_VideoDamage), SPA_PARAM_META_size, ++ SPA_POD_CHOICE_RANGE_Int(sizeof(struct spa_meta_region) * 16, ++ sizeof(struct spa_meta_region) * 1, ++ sizeof(struct spa_meta_region) * 16)))); ++ ++ pw_stream_update_params(that->pw_stream_, params.data(), params.size()); ++} ++ ++// static ++void SharedScreenCastStreamPrivate::OnStreamProcess(void* data) { ++ SharedScreenCastStreamPrivate* that = ++ static_cast(data); ++ RTC_DCHECK(that); ++ ++ struct pw_buffer* next_buffer; ++ struct pw_buffer* buffer = nullptr; ++ ++ next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); ++ while (next_buffer) { ++ buffer = next_buffer; ++ next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); ++ ++ if (next_buffer) { ++ pw_stream_queue_buffer(that->pw_stream_, buffer); ++ } ++ } ++ ++ if (!buffer) { ++ return; ++ } ++ ++ that->ProcessBuffer(buffer); ++ ++ pw_stream_queue_buffer(that->pw_stream_, buffer); ++} ++ ++void SharedScreenCastStreamPrivate::OnRenegotiateFormat(void* data, uint64_t) { ++ SharedScreenCastStreamPrivate* that = ++ static_cast(data); ++ RTC_DCHECK(that); ++ ++ { ++ PipeWireThreadLoopLock thread_loop_lock(that->pw_main_loop_); ++ ++ uint8_t buffer[2048] = {}; ++ ++ spa_pod_builder builder = spa_pod_builder{buffer, sizeof(buffer)}; ++ ++ std::vector params; ++ ++ for (uint32_t format : {SPA_VIDEO_FORMAT_BGRA, SPA_VIDEO_FORMAT_RGBA, ++ SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_RGBx}) { ++ if (!that->modifiers_.empty()) { ++ params.push_back(BuildFormat(&builder, format, that->modifiers_)); ++ } ++ params.push_back(BuildFormat(&builder, format, /*modifiers=*/{})); ++ } ++ ++ pw_stream_update_params(that->pw_stream_, params.data(), params.size()); ++ } ++} ++ ++SharedScreenCastStreamPrivate::SharedScreenCastStreamPrivate() {} ++ ++SharedScreenCastStreamPrivate::~SharedScreenCastStreamPrivate() { ++ if (pw_main_loop_) { ++ pw_thread_loop_stop(pw_main_loop_); ++ } ++ ++ if (pw_stream_) { ++ pw_stream_destroy(pw_stream_); ++ } ++ ++ if (pw_core_) { ++ pw_core_disconnect(pw_core_); ++ } ++ ++ if (pw_context_) { ++ pw_context_destroy(pw_context_); ++ } ++ ++ if (pw_main_loop_) { ++ pw_thread_loop_destroy(pw_main_loop_); ++ } ++} ++ ++bool SharedScreenCastStreamPrivate::StartScreenCastStream( ++ uint32_t stream_node_id, ++ int fd) { ++#if defined(WEBRTC_DLOPEN_PIPEWIRE) ++ StubPathMap paths; ++ ++ // Check if the PipeWire and DRM libraries are available. ++ paths[kModulePipewire].push_back(kPipeWireLib); ++ paths[kModuleDrm].push_back(kDrmLib); ++ ++ if (!InitializeStubs(paths)) { ++ RTC_LOG(LS_ERROR) ++ << "One of following libraries is missing on your system:\n" ++ << " - PipeWire (" << kPipeWireLib << ")\n" ++ << " - drm (" << kDrmLib << ")"; ++ return false; ++ } ++#endif // defined(WEBRTC_DLOPEN_PIPEWIRE) ++ egl_dmabuf_ = std::make_unique(); ++ ++ pw_stream_node_id_ = stream_node_id; ++ pw_fd_ = fd; ++ ++ pw_init(/*argc=*/nullptr, /*argc=*/nullptr); ++ ++ pw_main_loop_ = pw_thread_loop_new("pipewire-main-loop", nullptr); ++ ++ pw_context_ = ++ pw_context_new(pw_thread_loop_get_loop(pw_main_loop_), nullptr, 0); ++ if (!pw_context_) { ++ RTC_LOG(LS_ERROR) << "Failed to create PipeWire context"; ++ return false; ++ } ++ ++ if (pw_thread_loop_start(pw_main_loop_) < 0) { ++ RTC_LOG(LS_ERROR) << "Failed to start main PipeWire loop"; ++ return false; ++ } ++ ++ pw_client_version_ = ParsePipeWireVersion(pw_get_library_version()); ++ ++ // Initialize event handlers, remote end and stream-related. ++ pw_core_events_.version = PW_VERSION_CORE_EVENTS; ++ pw_core_events_.info = &OnCoreInfo; ++ pw_core_events_.done = &OnCoreDone; ++ pw_core_events_.error = &OnCoreError; ++ ++ pw_stream_events_.version = PW_VERSION_STREAM_EVENTS; ++ pw_stream_events_.state_changed = &OnStreamStateChanged; ++ pw_stream_events_.param_changed = &OnStreamParamChanged; ++ pw_stream_events_.process = &OnStreamProcess; ++ ++ { ++ PipeWireThreadLoopLock thread_loop_lock(pw_main_loop_); ++ ++ pw_core_ = pw_context_connect_fd(pw_context_, pw_fd_, nullptr, 0); ++ if (!pw_core_) { ++ RTC_LOG(LS_ERROR) << "Failed to connect PipeWire context"; ++ return false; ++ } ++ ++ pw_core_add_listener(pw_core_, &spa_core_listener_, &pw_core_events_, this); ++ ++ // Add an event that can be later invoked by pw_loop_signal_event() ++ renegotiate_ = pw_loop_add_event(pw_thread_loop_get_loop(pw_main_loop_), ++ OnRenegotiateFormat, this); ++ ++ server_version_sync_ = ++ pw_core_sync(pw_core_, PW_ID_CORE, server_version_sync_); ++ ++ pw_thread_loop_wait(pw_main_loop_); ++ ++ pw_properties* reuseProps = ++ pw_properties_new_string("pipewire.client.reuse=1"); ++ pw_stream_ = pw_stream_new(pw_core_, "webrtc-consume-stream", reuseProps); ++ ++ if (!pw_stream_) { ++ RTC_LOG(LS_ERROR) << "Failed to create PipeWire stream"; ++ return false; ++ } ++ ++ pw_stream_add_listener(pw_stream_, &spa_stream_listener_, ++ &pw_stream_events_, this); ++ uint8_t buffer[2048] = {}; ++ ++ spa_pod_builder builder = spa_pod_builder{buffer, sizeof(buffer)}; ++ ++ std::vector params; ++ const bool has_required_pw_client_version = ++ pw_client_version_ >= kDmaBufModifierMinVersion; ++ const bool has_required_pw_server_version = ++ pw_server_version_ >= kDmaBufModifierMinVersion; ++ for (uint32_t format : {SPA_VIDEO_FORMAT_BGRA, SPA_VIDEO_FORMAT_RGBA, ++ SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_RGBx}) { ++ // Modifiers can be used with PipeWire >= 0.3.33 ++ if (has_required_pw_client_version && has_required_pw_server_version) { ++ modifiers_ = egl_dmabuf_->QueryDmaBufModifiers(format); ++ ++ if (!modifiers_.empty()) { ++ params.push_back(BuildFormat(&builder, format, modifiers_)); ++ } ++ } ++ ++ params.push_back(BuildFormat(&builder, format, /*modifiers=*/{})); ++ } ++ ++ if (pw_stream_connect(pw_stream_, PW_DIRECTION_INPUT, pw_stream_node_id_, ++ PW_STREAM_FLAG_AUTOCONNECT, params.data(), ++ params.size()) != 0) { ++ RTC_LOG(LS_ERROR) << "Could not connect receiving stream."; ++ return false; ++ } ++ ++ RTC_LOG(LS_INFO) << "PipeWire remote opened."; ++ } ++ return true; ++} ++ ++void SharedScreenCastStreamPrivate::StopScreenCastStream() { ++ if (pw_stream_) { ++ pw_stream_disconnect(pw_stream_); ++ } ++} ++ ++std::unique_ptr SharedScreenCastStreamPrivate::CaptureFrame() { ++ webrtc::MutexLock lock(&queue_lock_); ++ ++ if (!queue_.current_frame()) { ++ return std::unique_ptr{}; ++ } ++ ++ std::unique_ptr frame = queue_.current_frame()->Share(); ++ return std::move(frame); ++} ++ ++std::unique_ptr SharedScreenCastStreamPrivate::CaptureCursor() { ++ if (!mouse_cursor_) { ++ return nullptr; ++ } ++ ++ return std::move(mouse_cursor_); ++} ++ ++DesktopVector SharedScreenCastStreamPrivate::CaptureCursorPosition() { ++ return mouse_cursor_position_; ++} ++ ++void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { ++ spa_buffer* spa_buffer = buffer->buffer; ++ ScopedBuf map; ++ std::unique_ptr src_unique_ptr; ++ uint8_t* src = nullptr; ++ ++ // Try to update the mouse cursor first, because it can be the only ++ // information carried by the buffer ++ { ++ const struct spa_meta_cursor* cursor = ++ static_cast(spa_buffer_find_meta_data( ++ spa_buffer, SPA_META_Cursor, sizeof(*cursor))); ++ if (cursor && spa_meta_cursor_is_valid(cursor)) { ++ struct spa_meta_bitmap* bitmap = nullptr; ++ ++ if (cursor->bitmap_offset) ++ bitmap = ++ SPA_MEMBER(cursor, cursor->bitmap_offset, struct spa_meta_bitmap); ++ ++ if (bitmap && bitmap->size.width > 0 && bitmap->size.height > 0) { ++ const uint8_t* bitmap_data = ++ SPA_MEMBER(bitmap, bitmap->offset, uint8_t); ++ BasicDesktopFrame* mouse_frame = new BasicDesktopFrame( ++ DesktopSize(bitmap->size.width, bitmap->size.height)); ++ mouse_frame->CopyPixelsFrom( ++ bitmap_data, bitmap->stride, ++ DesktopRect::MakeWH(bitmap->size.width, bitmap->size.height)); ++ mouse_cursor_ = std::make_unique( ++ mouse_frame, DesktopVector(cursor->hotspot.x, cursor->hotspot.y)); ++ } ++ mouse_cursor_position_.set(cursor->position.x, cursor->position.y); ++ } ++ } ++ ++ if (spa_buffer->datas[0].chunk->size == 0) { ++ return; ++ } ++ ++ if (spa_buffer->datas[0].type == SPA_DATA_MemFd) { ++ map.initialize( ++ static_cast( ++ mmap(nullptr, ++ spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset, ++ PROT_READ, MAP_PRIVATE, spa_buffer->datas[0].fd, 0)), ++ spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset, ++ spa_buffer->datas[0].fd); ++ ++ if (!map) { ++ RTC_LOG(LS_ERROR) << "Failed to mmap the memory: " ++ << std::strerror(errno); ++ return; ++ } ++ ++ src = SPA_MEMBER(map.get(), spa_buffer->datas[0].mapoffset, uint8_t); ++ } else if (spa_buffer->datas[0].type == SPA_DATA_DmaBuf) { ++ const uint n_planes = spa_buffer->n_datas; ++ ++ if (!n_planes) { ++ return; ++ } ++ ++ std::vector plane_datas; ++ for (uint32_t i = 0; i < n_planes; ++i) { ++ EglDmaBuf::PlaneData data = { ++ static_cast(spa_buffer->datas[i].fd), ++ static_cast(spa_buffer->datas[i].chunk->stride), ++ static_cast(spa_buffer->datas[i].chunk->offset)}; ++ plane_datas.push_back(data); ++ } ++ ++ // When importing DMA-BUFs, we use the stride (number of bytes from one row ++ // of pixels in the buffer) provided by PipeWire. The stride from PipeWire ++ // is given by the graphics driver and some drivers might add some ++ // additional padding for memory layout optimizations so not everytime the ++ // stride is equal to BYTES_PER_PIXEL x WIDTH. This is fine, because during ++ // the import we will use OpenGL and same graphics driver so it will be able ++ // to work with the stride it provided, but later on when we work with ++ // images we get from DMA-BUFs we will need to update the stride to be equal ++ // to BYTES_PER_PIXEL x WIDTH as that's the size of the DesktopFrame we ++ // allocate for each captured frame. ++ src_unique_ptr = egl_dmabuf_->ImageFromDmaBuf( ++ desktop_size_, spa_video_format_.format, plane_datas, modifier_); ++ if (src_unique_ptr) { ++ src = src_unique_ptr.get(); ++ } else { ++ RTC_LOG(LS_ERROR) << "Dropping DMA-BUF modifier: " << modifier_ ++ << " and trying to renegotiate stream parameters"; ++ ++ if (pw_server_version_ >= kDropSingleModifierMinVersion) { ++ modifiers_.erase( ++ std::remove(modifiers_.begin(), modifiers_.end(), modifier_), ++ modifiers_.end()); ++ } else { ++ modifiers_.clear(); ++ } ++ ++ pw_loop_signal_event(pw_thread_loop_get_loop(pw_main_loop_), ++ renegotiate_); ++ return; ++ } ++ } else if (spa_buffer->datas[0].type == SPA_DATA_MemPtr) { ++ src = static_cast(spa_buffer->datas[0].data); ++ } ++ ++ if (!src) { ++ return; ++ } ++ struct spa_meta_region* video_metadata = ++ static_cast(spa_buffer_find_meta_data( ++ spa_buffer, SPA_META_VideoCrop, sizeof(*video_metadata))); ++ ++ // Video size from metadata is bigger than an actual video stream size. ++ // The metadata are wrong or we should up-scale the video...in both cases ++ // just quit now. ++ if (video_metadata && (video_metadata->region.size.width > ++ static_cast(desktop_size_.width()) || ++ video_metadata->region.size.height > ++ static_cast(desktop_size_.height()))) { ++ RTC_LOG(LS_ERROR) << "Stream metadata sizes are wrong!"; ++ return; ++ } ++ ++ // Use video metadata when video size from metadata is set and smaller than ++ // video stream size, so we need to adjust it. ++ bool video_metadata_use = false; ++ const struct spa_rectangle* video_metadata_size = ++ video_metadata ? &video_metadata->region.size : nullptr; ++ ++ if (video_metadata_size && video_metadata_size->width != 0 && ++ video_metadata_size->height != 0 && ++ (static_cast(video_metadata_size->width) < desktop_size_.width() || ++ static_cast(video_metadata_size->height) < ++ desktop_size_.height())) { ++ video_metadata_use = true; ++ } ++ ++ if (video_metadata_use) { ++ video_size_ = ++ DesktopSize(video_metadata_size->width, video_metadata_size->height); ++ } else { ++ video_size_ = desktop_size_; ++ } ++ ++ uint32_t y_offset = video_metadata_use && (video_metadata->region.position.y + ++ video_size_.height() <= ++ desktop_size_.height()) ++ ? video_metadata->region.position.y ++ : 0; ++ uint32_t x_offset = video_metadata_use && (video_metadata->region.position.x + ++ video_size_.width() <= ++ desktop_size_.width()) ++ ? video_metadata->region.position.x ++ : 0; ++ ++ const uint32_t frame_stride = kBytesPerPixel * desktop_size_.width(); ++ uint32_t stride = spa_buffer->datas[0].chunk->stride; ++ ++ if (spa_buffer->datas[0].type == SPA_DATA_DmaBuf && stride > frame_stride) { ++ // When DMA-BUFs are used, sometimes spa_buffer->stride we get might ++ // contain additional padding, but after we import the buffer, the stride ++ // we used is no longer relevant and we should just calculate it based on ++ // width. For more context see https://crbug.com/1333304. ++ stride = frame_stride; ++ } ++ ++ uint8_t* updated_src = ++ src + (stride * y_offset) + (kBytesPerPixel * x_offset); ++ ++ webrtc::MutexLock lock(&queue_lock_); ++ ++ // Move to the next frame if the current one is being used and shared ++ if (queue_.current_frame() && queue_.current_frame()->IsShared()) { ++ queue_.MoveToNextFrame(); ++ if (queue_.current_frame() && queue_.current_frame()->IsShared()) { ++ RTC_LOG(LS_WARNING) ++ << "Failed to process PipeWire buffer: no available frame"; ++ return; ++ } ++ } ++ ++ if (!queue_.current_frame() || ++ !queue_.current_frame()->size().equals(video_size_)) { ++ std::unique_ptr frame(new BasicDesktopFrame( ++ DesktopSize(video_size_.width(), video_size_.height()))); ++ queue_.ReplaceCurrentFrame(SharedDesktopFrame::Wrap(std::move(frame))); ++ } ++ ++ queue_.current_frame()->CopyPixelsFrom( ++ updated_src, (stride - (kBytesPerPixel * x_offset)), ++ DesktopRect::MakeWH(video_size_.width(), video_size_.height())); ++ ++ if (spa_video_format_.format == SPA_VIDEO_FORMAT_RGBx || ++ spa_video_format_.format == SPA_VIDEO_FORMAT_RGBA) { ++ uint8_t* tmp_src = queue_.current_frame()->data(); ++ for (int i = 0; i < video_size_.height(); ++i) { ++ // If both sides decided to go with the RGBx format we need to convert ++ // it to BGRx to match color format expected by WebRTC. ++ ConvertRGBxToBGRx(tmp_src, queue_.current_frame()->stride()); ++ tmp_src += queue_.current_frame()->stride(); ++ } ++ } ++} ++ ++void SharedScreenCastStreamPrivate::ConvertRGBxToBGRx(uint8_t* frame, ++ uint32_t size) { ++ for (uint32_t i = 0; i < size; i += 4) { ++ uint8_t tempR = frame[i]; ++ uint8_t tempB = frame[i + 2]; ++ frame[i] = tempB; ++ frame[i + 2] = tempR; ++ } ++} ++ ++SharedScreenCastStream::SharedScreenCastStream() ++ : private_(std::make_unique()) {} ++ ++SharedScreenCastStream::~SharedScreenCastStream() {} ++ ++rtc::scoped_refptr ++SharedScreenCastStream::CreateDefault() { ++ // Explicit new, to access non-public constructor. ++ return rtc::scoped_refptr(new SharedScreenCastStream()); ++} ++ ++bool SharedScreenCastStream::StartScreenCastStream(uint32_t stream_node_id, ++ int fd) { ++ return private_->StartScreenCastStream(stream_node_id, fd); ++} ++ ++void SharedScreenCastStream::StopScreenCastStream() { ++ private_->StopScreenCastStream(); ++} ++ ++std::unique_ptr SharedScreenCastStream::CaptureFrame() { ++ return private_->CaptureFrame(); ++} ++ ++std::unique_ptr SharedScreenCastStream::CaptureCursor() { ++ return private_->CaptureCursor(); ++} ++ ++absl::optional SharedScreenCastStream::CaptureCursorPosition() { ++ DesktopVector position = private_->CaptureCursorPosition(); ++ ++ // Consider only (x >= 0 and y >= 0) a valid position ++ if (position.x() < 0 || position.y() < 0) { ++ return absl::nullopt; ++ } ++ ++ return position; ++} ++ ++} // namespace webrtc +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.431095434 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h 2022-07-26 16:30:19.431095434 +0200 +@@ -0,0 +1,71 @@ ++/* ++ * Copyright 2022 The WebRTC project authors. All Rights Reserved. ++ * ++ * Use of this source code is governed by a BSD-style license ++ * that can be found in the LICENSE file in the root of the source ++ * tree. An additional intellectual property rights grant can be found ++ * in the file PATENTS. All contributing project authors may ++ * be found in the AUTHORS file in the root of the source tree. ++ */ ++ ++#ifndef MODULES_DESKTOP_CAPTURE_LINUX_SHARED_SCREENCAST_STREAM_H_ ++#define MODULES_DESKTOP_CAPTURE_LINUX_SHARED_SCREENCAST_STREAM_H_ ++ ++#include ++ ++#include "absl/types/optional.h" ++#include "api/ref_counted_base.h" ++#include "api/scoped_refptr.h" ++#include "modules/desktop_capture/desktop_frame.h" ++#include "modules/desktop_capture/mouse_cursor.h" ++#include "rtc_base/system/rtc_export.h" ++ ++namespace webrtc { ++ ++class SharedScreenCastStreamPrivate; ++ ++class RTC_EXPORT SharedScreenCastStream ++ : public rtc::RefCountedBase { ++ public: ++ static rtc::scoped_refptr CreateDefault(); ++ ++ bool StartScreenCastStream(uint32_t stream_node_id, int fd); ++ void StopScreenCastStream(); ++ ++ // Below functions return the most recent information we get from a ++ // PipeWire buffer on each Process() callback. This assumes that we ++ // managed to successfuly connect to a PipeWire stream provided by the ++ // compositor (based on stream parameters). The cursor data are obtained ++ // from spa_meta_cursor stream metadata and therefore the cursor is not ++ // part of actual screen/window frame. ++ ++ // Returns the most recent screen/window frame we obtained from PipeWire ++ // buffer. Will return an empty frame in case we didn't manage to get a frame ++ // from PipeWire buffer. ++ std::unique_ptr CaptureFrame(); ++ ++ // Returns the most recent mouse cursor image. Will return an nullptr cursor ++ // in case we didn't manage to get a cursor from PipeWire buffer. NOTE: the ++ // cursor image might not be updated on every cursor location change, but ++ // actually only when its shape changes. ++ std::unique_ptr CaptureCursor(); ++ ++ // Returns the most recent mouse cursor position. Will not return a value in ++ // case we didn't manage to get it from PipeWire buffer. ++ absl::optional CaptureCursorPosition(); ++ ++ ~SharedScreenCastStream(); ++ ++ protected: ++ SharedScreenCastStream(); ++ ++ private: ++ SharedScreenCastStream(const SharedScreenCastStream&) = delete; ++ SharedScreenCastStream& operator=(const SharedScreenCastStream&) = delete; ++ ++ std::unique_ptr private_; ++}; ++ ++} // namespace webrtc ++ ++#endif // MODULES_DESKTOP_CAPTURE_LINUX_SHARED_SCREENCAST_STREAM_H_ +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc.libwebrtc-screen-cast-sync 2022-07-18 20:44:26.000000000 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc 2022-07-26 16:30:19.431095434 +0200 +@@ -17,6 +17,10 @@ + #include "modules/desktop_capture/linux/mouse_cursor_monitor_x11.h" + #endif // defined(WEBRTC_USE_X11) + ++#if defined(WEBRTC_USE_PIPEWIRE) ++#include "modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h" ++#endif // defined(WEBRTC_USE_PIPEWIRE) ++ + namespace webrtc { + + // static +@@ -44,6 +48,13 @@ MouseCursorMonitor* MouseCursorMonitor:: + // static + std::unique_ptr MouseCursorMonitor::Create( + const DesktopCaptureOptions& options) { ++#if defined(WEBRTC_USE_PIPEWIRE) ++ if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland() && ++ options.screencast_stream()) { ++ return std::make_unique(options); ++ } ++#endif // defined(WEBRTC_USE_PIPEWIRE) ++ + #if defined(WEBRTC_USE_X11) + return MouseCursorMonitorX11::Create(options); + #else +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc.libwebrtc-screen-cast-sync 2022-07-18 20:44:33.000000000 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc 2022-07-26 16:30:19.431095434 +0200 +@@ -14,7 +14,7 @@ + #include "modules/desktop_capture/desktop_capturer.h" + + #if defined(WEBRTC_USE_PIPEWIRE) +-#include "modules/desktop_capture/linux/screen_capturer_pipewire.h" ++#include "modules/desktop_capture/linux/base_capturer_pipewire.h" + #endif // defined(WEBRTC_USE_PIPEWIRE) + + #if defined(WEBRTC_USE_X11) +@@ -28,7 +28,7 @@ std::unique_ptr Desktop + const DesktopCaptureOptions& options) { + #if defined(WEBRTC_USE_PIPEWIRE) + if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { +- return BaseCapturerPipeWire::CreateRawScreenCapturer(options); ++ return std::make_unique(options); + } + #endif // defined(WEBRTC_USE_PIPEWIRE) + +diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc.libwebrtc-screen-cast-sync 2022-07-18 20:44:26.000000000 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc 2022-07-26 16:30:19.431095434 +0200 +@@ -14,7 +14,7 @@ + #include "modules/desktop_capture/desktop_capturer.h" + + #if defined(WEBRTC_USE_PIPEWIRE) +-#include "modules/desktop_capture/linux/window_capturer_pipewire.h" ++#include "modules/desktop_capture/linux/base_capturer_pipewire.h" + #endif // defined(WEBRTC_USE_PIPEWIRE) + + #if defined(WEBRTC_USE_X11) +@@ -28,7 +28,7 @@ std::unique_ptr Desktop + const DesktopCaptureOptions& options) { + #if defined(WEBRTC_USE_PIPEWIRE) + if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { +- return BaseCapturerPipeWire::CreateRawWindowCapturer(options); ++ return std::make_unique(options); + } + #endif // defined(WEBRTC_USE_PIPEWIRE) + +diff -up firefox-103.0/third_party/moz.build.libwebrtc-screen-cast-sync firefox-103.0/third_party/moz.build +--- firefox-103.0/third_party/moz.build.libwebrtc-screen-cast-sync 2022-07-18 20:44:36.000000000 +0200 ++++ firefox-103.0/third_party/moz.build 2022-07-26 16:30:19.431095434 +0200 +@@ -61,6 +61,12 @@ with Files("libwebrtc/**"): + with Files("pipewire/**"): + BUG_COMPONENT = ("Core", "WebRTC") + ++with Files("drm/**"): ++ BUG_COMPONENT = ("Core", "WebRTC") ++ ++with Files("gbm/**"): ++ BUG_COMPONENT = ("Core", "WebRTC") ++ + with Files('rlbox_wasm2c_sandbox/**'): + BUG_COMPONENT = ('Firefox Build System', 'General') + +diff -up firefox-103.0/third_party/pipewire/libpipewire/mozpipewire.cpp.libwebrtc-screen-cast-sync firefox-103.0/third_party/pipewire/libpipewire/mozpipewire.cpp +--- firefox-103.0/third_party/pipewire/libpipewire/mozpipewire.cpp.libwebrtc-screen-cast-sync 2022-07-18 20:44:36.000000000 +0200 ++++ firefox-103.0/third_party/pipewire/libpipewire/mozpipewire.cpp 2022-07-26 16:30:19.431095434 +0200 +@@ -69,11 +69,13 @@ static int (*pw_stream_connect_fn)(struc + enum pw_stream_flags flags, + const struct spa_pod **params, + uint32_t n_params); ++static int (*pw_stream_disconnect_fn)(struct pw_stream *stream); + static struct pw_buffer* (*pw_stream_dequeue_buffer_fn)(struct pw_stream *stream); + static void (*pw_stream_destroy_fn)(struct pw_stream *stream); + static struct pw_stream* (*pw_stream_new_fn)(struct pw_core *core, + const char *name, + struct pw_properties *props); ++ + static int (*pw_stream_queue_buffer_fn)(struct pw_stream *stream, + struct pw_buffer *buffer); + static int (*pw_stream_update_params_fn)(struct pw_stream *stream, +@@ -87,7 +89,10 @@ static int (*pw_thread_loop_start_fn)(st + static void (*pw_thread_loop_stop_fn)(struct pw_thread_loop *loop); + static void (*pw_thread_loop_lock_fn)(struct pw_thread_loop *loop); + static void (*pw_thread_loop_unlock_fn)(struct pw_thread_loop *loop); ++static void (*pw_thread_loop_wait_fn)(struct pw_thread_loop *loop); ++static void (*pw_thread_loop_signal_fn)(struct pw_thread_loop *loop, bool wait_for_accept); + static struct pw_properties* (*pw_properties_new_string_fn)(const char *str); ++static const char* (*pw_get_library_version_fn)(); + + bool IsPwLibraryLoaded() { + static bool isLoaded = +@@ -99,6 +104,7 @@ bool IsPwLibraryLoaded() { + IS_FUNC_LOADED(pw_init_fn) && + IS_FUNC_LOADED(pw_stream_add_listener_fn) && + IS_FUNC_LOADED(pw_stream_connect_fn) && ++ IS_FUNC_LOADED(pw_stream_disconnect_fn) && + IS_FUNC_LOADED(pw_stream_dequeue_buffer_fn) && + IS_FUNC_LOADED(pw_stream_destroy_fn) && + IS_FUNC_LOADED(pw_stream_new_fn) && +@@ -111,7 +117,10 @@ bool IsPwLibraryLoaded() { + IS_FUNC_LOADED(pw_thread_loop_stop_fn) && + IS_FUNC_LOADED(pw_thread_loop_lock_fn) && + IS_FUNC_LOADED(pw_thread_loop_unlock_fn) && +- IS_FUNC_LOADED(pw_properties_new_string_fn)); ++ IS_FUNC_LOADED(pw_thread_loop_signal_fn) && ++ IS_FUNC_LOADED(pw_thread_loop_wait_fn) && ++ IS_FUNC_LOADED(pw_properties_new_string_fn) && ++ IS_FUNC_LOADED(pw_get_library_version_fn)); + + return isLoaded; + } +@@ -136,6 +145,7 @@ bool LoadPWLibrary() { + GET_FUNC(pw_init, pwLib); + GET_FUNC(pw_stream_add_listener, pwLib); + GET_FUNC(pw_stream_connect, pwLib); ++ GET_FUNC(pw_stream_disconnect, pwLib); + GET_FUNC(pw_stream_dequeue_buffer, pwLib); + GET_FUNC(pw_stream_destroy, pwLib); + GET_FUNC(pw_stream_new, pwLib); +@@ -148,7 +158,10 @@ bool LoadPWLibrary() { + GET_FUNC(pw_thread_loop_stop, pwLib); + GET_FUNC(pw_thread_loop_lock, pwLib); + GET_FUNC(pw_thread_loop_unlock, pwLib); ++ GET_FUNC(pw_thread_loop_signal, pwLib); ++ GET_FUNC(pw_thread_loop_wait, pwLib); + GET_FUNC(pw_properties_new_string, pwLib); ++ GET_FUNC(pw_get_library_version, pwLib); + } + + return IsPwLibraryLoaded(); +@@ -242,6 +255,15 @@ pw_stream_connect(struct pw_stream *stre + params, n_params); + } + ++int ++pw_stream_disconnect(struct pw_stream *stream) ++{ ++ if (!LoadPWLibrary()) { ++ return 0; ++ } ++ return pw_stream_disconnect_fn(stream); ++} ++ + struct pw_buffer * + pw_stream_dequeue_buffer(struct pw_stream *stream) + { +@@ -356,6 +378,23 @@ pw_thread_loop_unlock(struct pw_thread_l + return pw_thread_loop_unlock_fn(loop); + } + ++void ++pw_thread_loop_signal(struct pw_thread_loop *loop, bool wait_for_accept) ++{ ++ if (!LoadPWLibrary()) { ++ return; ++ } ++ return pw_thread_loop_signal_fn(loop, wait_for_accept); ++} ++ ++void ++pw_thread_loop_wait(struct pw_thread_loop *loop) ++{ ++ if (!LoadPWLibrary()) { ++ return; ++ } ++ return pw_thread_loop_wait_fn(loop); ++} + + struct pw_properties * + pw_properties_new_string(const char *str) +@@ -366,3 +405,12 @@ pw_properties_new_string(const char *str + return pw_properties_new_string_fn(str); + } + ++const char* ++pw_get_library_version() ++{ ++ if (!LoadPWLibrary()) { ++ return nullptr; ++ } ++ return pw_get_library_version_fn(); ++} ++ From c27f9f504e043c83ba05fef66fbe5deb9fd9d408 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 27 Jul 2022 11:20:07 +0200 Subject: [PATCH 086/545] Updated cbindgen --- firefox.spec | 2 +- gen_cbindgen-vendor.sh | 2 +- sources | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/firefox.spec b/firefox.spec index b2d6a3a..58f0418 100644 --- a/firefox.spec +++ b/firefox.spec @@ -127,7 +127,7 @@ ExcludeArch: aarch64 %if %{?system_nss} %global nspr_version 4.32 %global nspr_build_version %{nspr_version} -%global nss_version 3.78 +%global nss_version 3.80 %global nss_build_version %{nss_version} %endif diff --git a/gen_cbindgen-vendor.sh b/gen_cbindgen-vendor.sh index 8e10eb2..c2b60f0 100755 --- a/gen_cbindgen-vendor.sh +++ b/gen_cbindgen-vendor.sh @@ -12,7 +12,7 @@ to be used with 'cargo vendor' commmand. """ [dependencies] -cbindgen = "0.24.0" +cbindgen = "0.24.3" [[bin]] name = "dummy" diff --git a/sources b/sources index dab47b2..abf7f49 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (cbindgen-vendor.tar.xz) = d681ca855f3779553b4a452f9dc1e3acea6253b7ef33a65948ab2d32d9848e8c06f0b3f3504ef237d6b9adb4813bdad990f7a79fa9f89333ce0d4e8da7e12d94 SHA512 (firefox-103.0.source.tar.xz) = 016c2f276fb94e5174626f7d8b1a821b2de0f5a07f8a10f00a7ea4d4285591b0c23dd3ef45306579de79b3dfa99ccc527224c33f3319f61cf088b1f4bd097f9e SHA512 (firefox-langpacks-103.0-20220721.tar.xz) = 5633451a25075439459a6af4917a4dda4e06767a1f4d1055d42cdbe0c3de7a4e2c464f502982ed6bfd1a13b82ad462a9b9fb91910bac85aeb3e77f7af3739b5c +SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 From d101c7b7f411eedbe6386bdea44ec3b596f33648 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 28 Jul 2022 13:52:37 +0200 Subject: [PATCH 087/545] Build fixes --- libwebrtc-screen-cast-sync-1.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libwebrtc-screen-cast-sync-1.patch b/libwebrtc-screen-cast-sync-1.patch index 2d7c0a0..83cbd61 100644 --- a/libwebrtc-screen-cast-sync-1.patch +++ b/libwebrtc-screen-cast-sync-1.patch @@ -9740,3 +9740,15 @@ diff -up firefox-103.0/third_party/pipewire/libpipewire/mozpipewire.cpp.libwebrt + return pw_get_library_version_fn(); +} + +diff -up firefox-103.0/dom/media/webrtc/moz.build.webrtc firefox-103.0/dom/media/webrtc/moz.build +--- firefox-103.0/dom/media/webrtc/moz.build.webrtc 2022-07-28 11:41:19.923012830 +0200 ++++ firefox-103.0/dom/media/webrtc/moz.build 2022-07-28 11:41:56.314779745 +0200 +@@ -85,6 +85,8 @@ if CONFIG["MOZ_WEBRTC_SIGNALING"]: + + if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": + DIRS += ["/third_party/pipewire/libpipewire"] ++ DIRS += ["/third_party/drm/libdrm"] ++ DIRS += ["/third_party/gbm/libgbm"] + + # Avoid warnings from third-party code that we can not modify. + if CONFIG["CC_TYPE"] == "clang-cl": From ea24aeef459a0df61781ae287e5f37020eabbeed Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 29 Jul 2022 11:31:44 +0200 Subject: [PATCH 088/545] updated webrtc patch --- libwebrtc-screen-cast-sync-1.patch | 176 ++++++++++++++++------------- 1 file changed, 99 insertions(+), 77 deletions(-) diff --git a/libwebrtc-screen-cast-sync-1.patch b/libwebrtc-screen-cast-sync-1.patch index 83cbd61..f85efe4 100644 --- a/libwebrtc-screen-cast-sync-1.patch +++ b/libwebrtc-screen-cast-sync-1.patch @@ -1,6 +1,18 @@ +diff -up firefox-103.0/dom/media/webrtc/moz.build.libwebrtc-screen-cast-sync firefox-103.0/dom/media/webrtc/moz.build +--- firefox-103.0/dom/media/webrtc/moz.build.libwebrtc-screen-cast-sync 2022-07-18 20:44:03.000000000 +0200 ++++ firefox-103.0/dom/media/webrtc/moz.build 2022-07-28 11:45:30.321408998 +0200 +@@ -85,6 +85,8 @@ if CONFIG["MOZ_WEBRTC_SIGNALING"]: + + if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": + DIRS += ["/third_party/pipewire/libpipewire"] ++ DIRS += ["/third_party/drm/libdrm"] ++ DIRS += ["/third_party/gbm/libgbm"] + + # Avoid warnings from third-party code that we can not modify. + if CONFIG["CC_TYPE"] == "clang-cl": diff -up firefox-103.0/third_party/drm/drm/drm_fourcc.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/drm/drm/drm_fourcc.h ---- firefox-103.0/third_party/drm/drm/drm_fourcc.h.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.428095335 +0200 -+++ firefox-103.0/third_party/drm/drm/drm_fourcc.h 2022-07-26 16:30:19.428095335 +0200 +--- firefox-103.0/third_party/drm/drm/drm_fourcc.h.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.317409023 +0200 ++++ firefox-103.0/third_party/drm/drm/drm_fourcc.h 2022-07-28 11:45:30.317409023 +0200 @@ -0,0 +1,1377 @@ +/* + * Copyright 2011 Intel Corporation @@ -1380,8 +1392,8 @@ diff -up firefox-103.0/third_party/drm/drm/drm_fourcc.h.libwebrtc-screen-cast-sy + +#endif /* DRM_FOURCC_H */ diff -up firefox-103.0/third_party/drm/drm/drm.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/drm/drm/drm.h ---- firefox-103.0/third_party/drm/drm/drm.h.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.427095302 +0200 -+++ firefox-103.0/third_party/drm/drm/drm.h 2022-07-26 16:30:19.427095302 +0200 +--- firefox-103.0/third_party/drm/drm/drm.h.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.317409023 +0200 ++++ firefox-103.0/third_party/drm/drm/drm.h 2022-07-28 11:45:30.317409023 +0200 @@ -0,0 +1,1193 @@ +/* + * Header for the Direct Rendering Manager @@ -2577,8 +2589,8 @@ diff -up firefox-103.0/third_party/drm/drm/drm.h.libwebrtc-screen-cast-sync fire + +#endif diff -up firefox-103.0/third_party/drm/drm/drm_mode.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/drm/drm/drm_mode.h ---- firefox-103.0/third_party/drm/drm/drm_mode.h.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.428095335 +0200 -+++ firefox-103.0/third_party/drm/drm/drm_mode.h 2022-07-26 16:30:19.428095335 +0200 +--- firefox-103.0/third_party/drm/drm/drm_mode.h.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.318409017 +0200 ++++ firefox-103.0/third_party/drm/drm/drm_mode.h 2022-07-28 11:45:30.317409023 +0200 @@ -0,0 +1,1217 @@ +/* + * Copyright (c) 2007 Dave Airlie @@ -3798,8 +3810,8 @@ diff -up firefox-103.0/third_party/drm/drm/drm_mode.h.libwebrtc-screen-cast-sync + +#endif diff -up firefox-103.0/third_party/drm/drm/xf86drm.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/drm/drm/xf86drm.h ---- firefox-103.0/third_party/drm/drm/xf86drm.h.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.428095335 +0200 -+++ firefox-103.0/third_party/drm/drm/xf86drm.h 2022-07-26 16:30:19.428095335 +0200 +--- firefox-103.0/third_party/drm/drm/xf86drm.h.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.318409017 +0200 ++++ firefox-103.0/third_party/drm/drm/xf86drm.h 2022-07-28 11:45:30.318409017 +0200 @@ -0,0 +1,966 @@ +/** + * \file xf86drm.h @@ -4768,8 +4780,8 @@ diff -up firefox-103.0/third_party/drm/drm/xf86drm.h.libwebrtc-screen-cast-sync + +#endif diff -up firefox-103.0/third_party/drm/libdrm/moz.build.libwebrtc-screen-cast-sync firefox-103.0/third_party/drm/libdrm/moz.build ---- firefox-103.0/third_party/drm/libdrm/moz.build.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.428095335 +0200 -+++ firefox-103.0/third_party/drm/libdrm/moz.build 2022-07-26 16:30:19.428095335 +0200 +--- firefox-103.0/third_party/drm/libdrm/moz.build.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.318409017 +0200 ++++ firefox-103.0/third_party/drm/libdrm/moz.build 2022-07-28 11:45:30.318409017 +0200 @@ -0,0 +1,16 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: @@ -4788,8 +4800,8 @@ diff -up firefox-103.0/third_party/drm/libdrm/moz.build.libwebrtc-screen-cast-sy + +FINAL_LIBRARY = 'xul' diff -up firefox-103.0/third_party/drm/libdrm/mozdrm.cpp.libwebrtc-screen-cast-sync firefox-103.0/third_party/drm/libdrm/mozdrm.cpp ---- firefox-103.0/third_party/drm/libdrm/mozdrm.cpp.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.428095335 +0200 -+++ firefox-103.0/third_party/drm/libdrm/mozdrm.cpp 2022-07-26 16:30:19.428095335 +0200 +--- firefox-103.0/third_party/drm/libdrm/mozdrm.cpp.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.318409017 +0200 ++++ firefox-103.0/third_party/drm/libdrm/mozdrm.cpp 2022-07-28 11:45:30.318409017 +0200 @@ -0,0 +1,66 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: @@ -4858,16 +4870,16 @@ diff -up firefox-103.0/third_party/drm/libdrm/mozdrm.cpp.libwebrtc-screen-cast-s + return drmFreeDevices_fn(devices, count); +} diff -up firefox-103.0/third_party/drm/README.libwebrtc-screen-cast-sync firefox-103.0/third_party/drm/README ---- firefox-103.0/third_party/drm/README.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.427095302 +0200 -+++ firefox-103.0/third_party/drm/README 2022-07-26 16:30:19.427095302 +0200 +--- firefox-103.0/third_party/drm/README.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.318409017 +0200 ++++ firefox-103.0/third_party/drm/README 2022-07-28 11:45:30.318409017 +0200 @@ -0,0 +1,4 @@ +Libdrm is a drm library wrapper needed to build and run Firefox with +Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/drm). + +libdrm directory stores headers of libdrm needed for build only. diff -up firefox-103.0/third_party/gbm/gbm/gbm.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/gbm/gbm/gbm.h ---- firefox-103.0/third_party/gbm/gbm/gbm.h.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.429095367 +0200 -+++ firefox-103.0/third_party/gbm/gbm/gbm.h 2022-07-26 16:30:19.429095367 +0200 +--- firefox-103.0/third_party/gbm/gbm/gbm.h.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.318409017 +0200 ++++ firefox-103.0/third_party/gbm/gbm/gbm.h 2022-07-28 11:45:30.318409017 +0200 @@ -0,0 +1,452 @@ +/* + * Copyright © 2011 Intel Corporation @@ -5322,8 +5334,8 @@ diff -up firefox-103.0/third_party/gbm/gbm/gbm.h.libwebrtc-screen-cast-sync fire + +#endif diff -up firefox-103.0/third_party/gbm/libgbm/moz.build.libwebrtc-screen-cast-sync firefox-103.0/third_party/gbm/libgbm/moz.build ---- firefox-103.0/third_party/gbm/libgbm/moz.build.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.429095367 +0200 -+++ firefox-103.0/third_party/gbm/libgbm/moz.build 2022-07-26 16:30:19.429095367 +0200 +--- firefox-103.0/third_party/gbm/libgbm/moz.build.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.318409017 +0200 ++++ firefox-103.0/third_party/gbm/libgbm/moz.build 2022-07-28 11:45:30.318409017 +0200 @@ -0,0 +1,16 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: @@ -5342,8 +5354,8 @@ diff -up firefox-103.0/third_party/gbm/libgbm/moz.build.libwebrtc-screen-cast-sy + +FINAL_LIBRARY = 'xul' diff -up firefox-103.0/third_party/gbm/libgbm/mozgbm.cpp.libwebrtc-screen-cast-sync firefox-103.0/third_party/gbm/libgbm/mozgbm.cpp ---- firefox-103.0/third_party/gbm/libgbm/mozgbm.cpp.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.429095367 +0200 -+++ firefox-103.0/third_party/gbm/libgbm/mozgbm.cpp 2022-07-26 16:30:19.429095367 +0200 +--- firefox-103.0/third_party/gbm/libgbm/mozgbm.cpp.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.318409017 +0200 ++++ firefox-103.0/third_party/gbm/libgbm/mozgbm.cpp 2022-07-28 11:45:30.318409017 +0200 @@ -0,0 +1,66 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: @@ -5412,8 +5424,8 @@ diff -up firefox-103.0/third_party/gbm/libgbm/mozgbm.cpp.libwebrtc-screen-cast-s + return gbm_device_destroy_fn(gbm); +} diff -up firefox-103.0/third_party/gbm/README.libwebrtc-screen-cast-sync firefox-103.0/third_party/gbm/README ---- firefox-103.0/third_party/gbm/README.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.428095335 +0200 -+++ firefox-103.0/third_party/gbm/README 2022-07-26 16:30:19.428095335 +0200 +--- firefox-103.0/third_party/gbm/README.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.318409017 +0200 ++++ firefox-103.0/third_party/gbm/README 2022-07-28 11:45:30.318409017 +0200 @@ -0,0 +1,4 @@ +Libgbm is a gbm library wrapper needed to build and run Firefox with +Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/gbm). @@ -5421,7 +5433,7 @@ diff -up firefox-103.0/third_party/gbm/README.libwebrtc-screen-cast-sync firefox +libgbm directory stores headers of libgbm needed for build only. diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build --- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.libwebrtc-screen-cast-sync 2022-07-18 20:44:36.000000000 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build 2022-07-26 16:34:44.176870636 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build 2022-07-29 11:28:39.473827919 +0200 @@ -26,6 +26,8 @@ LOCAL_INCLUDES += [ "/ipc/chromium/src", "/media/libyuv/", @@ -5453,7 +5465,21 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_cap "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_x11.cc", "/third_party/libwebrtc/modules/desktop_capture/linux/window_finder_x11.cc", "/third_party/libwebrtc/modules/desktop_capture/linux/window_list_utils.cc", -@@ -300,12 +305,12 @@ if CONFIG["CPU_ARCH"] == "aarch64" and C +@@ -241,7 +246,12 @@ if CONFIG["CPU_ARCH"] == "arm": + DEFINES["_GNU_SOURCE"] = True + + SOURCES += [ +- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" ++ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" + ] + + UNIFIED_SOURCES += [ +@@ -300,12 +310,12 @@ if CONFIG["CPU_ARCH"] == "aarch64" and C DEFINES["_GNU_SOURCE"] = True SOURCES += [ @@ -5472,7 +5498,7 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_cap ] if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux": -@@ -318,12 +323,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFI +@@ -318,12 +328,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFI DEFINES["_GNU_SOURCE"] = True SOURCES += [ @@ -5491,16 +5517,28 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_cap ] if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "Linux": -@@ -332,12 +337,12 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CO +@@ -332,12 +342,26 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CO DEFINES["_GNU_SOURCE"] = True SOURCES += [ - "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" -- ] -- ++ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" + ] + - UNIFIED_SOURCES += [ - "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc" ++if CONFIG["CPU_ARCH"] == "ppc64le" and CONFIG["OS_TARGET"] == "Linux": ++ ++ DEFINES["WEBRTC_USE_PIPEWIRE"] = True ++ DEFINES["_GNU_SOURCE"] = True ++ ++ SOURCES += [ + "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", @@ -5512,7 +5550,7 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_cap if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "Linux": diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc --- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc.libwebrtc-screen-cast-sync 2022-07-18 20:44:36.000000000 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc 2022-07-26 16:30:19.429095367 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc 2022-07-28 11:45:30.318409017 +0200 @@ -14,6 +14,9 @@ #elif defined(WEBRTC_WIN) #include "modules/desktop_capture/win/full_screen_win_application_handler.h" @@ -5535,7 +5573,7 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_cap result.set_full_screen_window_detector( diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h --- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h.libwebrtc-screen-cast-sync 2022-07-18 20:44:32.000000000 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h 2022-07-26 16:30:19.429095367 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h 2022-07-28 11:45:30.319409011 +0200 @@ -17,6 +17,10 @@ #include "modules/desktop_capture/linux/shared_x_display.h" #endif @@ -5577,7 +5615,7 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_cap bool allow_iosurface_ = false; diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc --- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.libwebrtc-screen-cast-sync 2022-07-18 20:44:26.000000000 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc 2022-07-26 16:30:19.429095367 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc 2022-07-28 11:45:30.319409011 +0200 @@ -10,937 +10,67 @@ #include "modules/desktop_capture/linux/base_capturer_pipewire.h" @@ -6581,7 +6619,7 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_ } // namespace webrtc diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h --- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h.libwebrtc-screen-cast-sync 2022-07-18 20:44:26.000000000 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h 2022-07-26 16:30:19.429095367 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h 2022-07-28 11:45:30.319409011 +0200 @@ -11,160 +11,39 @@ #ifndef MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ #define MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ @@ -6759,8 +6797,8 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_ } // namespace webrtc diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.429095367 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs 2022-07-26 16:30:19.429095367 +0200 +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.319409011 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs 2022-07-28 11:45:30.319409011 +0200 @@ -0,0 +1,11 @@ +// Copyright 2021 The WebRTC project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be @@ -6774,8 +6812,8 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.s +int drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices); +void drmFreeDevices(drmDevicePtr devices[], int count); diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.430095401 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc 2022-07-26 16:30:19.430095401 +0200 +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.319409011 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc 2022-07-28 11:45:30.319409011 +0200 @@ -0,0 +1,695 @@ +/* + * Copyright 2021 The WebRTC project authors. All Rights Reserved. @@ -7473,8 +7511,8 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_d + +} // namespace webrtc diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.430095401 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h 2022-07-26 16:30:19.430095401 +0200 +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.319409011 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h 2022-07-28 11:45:30.319409011 +0200 @@ -0,0 +1,68 @@ +/* + * Copyright 2021 The WebRTC project authors. All Rights Reserved. @@ -7545,8 +7583,8 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_d + +#endif // MODULES_DESKTOP_CAPTURE_LINUX_EGL_DMABUF_H_ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.430095401 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc 2022-07-26 16:30:19.430095401 +0200 +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.319409011 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc 2022-07-28 11:45:30.319409011 +0200 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2022 The WebRTC project authors. All Rights Reserved. @@ -7605,8 +7643,8 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse + +} // namespace webrtc diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.430095401 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h 2022-07-26 16:30:19.430095401 +0200 +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.319409011 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h 2022-07-28 11:45:30.319409011 +0200 @@ -0,0 +1,41 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. @@ -7651,7 +7689,7 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse +#endif // MODULES_DESKTOP_CAPTURE_LINUX_MOUSE_CURSOR_MONITOR_PIPEWIRE_H_ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs --- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs.libwebrtc-screen-cast-sync 2022-07-18 20:44:36.000000000 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs 2022-07-26 16:30:19.430095401 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs 2022-07-28 11:45:30.319409011 +0200 @@ -7,38 +7,44 @@ //------------------------------------------------ @@ -7713,7 +7751,7 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipew +pw_core * pw_context_connect_fd(pw_context *context, int fd, pw_properties *properties, size_t user_data_size); diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment --- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment.libwebrtc-screen-cast-sync 2022-07-18 20:44:36.000000000 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment 2022-07-26 16:30:19.430095401 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment 2022-07-28 11:45:30.320409004 +0200 @@ -5,4 +5,5 @@ extern "C" { #include @@ -7721,8 +7759,8 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipew +#include } diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.430095401 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc 2022-07-26 16:30:19.430095401 +0200 +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.320409004 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc 2022-07-28 11:45:30.320409004 +0200 @@ -0,0 +1,57 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. @@ -7782,8 +7820,8 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scope + +} // namespace webrtc diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.430095401 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h 2022-07-26 16:30:19.430095401 +0200 +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.320409004 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h 2022-07-28 11:45:30.320409004 +0200 @@ -0,0 +1,65 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. @@ -7850,11 +7888,9 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scope +} // namespace webrtc + +#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCOPED_GLIB_H_ -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.430095401 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc 2022-07-26 16:30:19.430095401 +0200 +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.320409004 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc 2022-07-28 11:45:30.320409004 +0200 @@ -0,0 +1,532 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. @@ -8389,8 +8425,8 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scree + +} // namespace webrtc diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.430095401 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h 2022-07-26 16:30:19.430095401 +0200 +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.320409004 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h 2022-07-28 11:45:30.320409004 +0200 @@ -0,0 +1,169 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. @@ -8562,8 +8598,8 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scree + +#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCREENCAST_PORTAL_H_ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.431095434 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc 2022-07-26 16:30:19.430095401 +0200 +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.320409004 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc 2022-07-28 11:45:30.320409004 +0200 @@ -0,0 +1,892 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. @@ -9458,8 +9494,8 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/share + +} // namespace webrtc diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h.libwebrtc-screen-cast-sync 2022-07-26 16:30:19.431095434 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h 2022-07-26 16:30:19.431095434 +0200 +--- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.320409004 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h 2022-07-28 11:45:30.320409004 +0200 @@ -0,0 +1,71 @@ +/* + * Copyright 2022 The WebRTC project authors. All Rights Reserved. @@ -9532,11 +9568,9 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/share +} // namespace webrtc + +#endif // MODULES_DESKTOP_CAPTURE_LINUX_SHARED_SCREENCAST_STREAM_H_ -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc --- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc.libwebrtc-screen-cast-sync 2022-07-18 20:44:26.000000000 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc 2022-07-26 16:30:19.431095434 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc 2022-07-28 11:45:30.320409004 +0200 @@ -17,6 +17,10 @@ #include "modules/desktop_capture/linux/mouse_cursor_monitor_x11.h" #endif // defined(WEBRTC_USE_X11) @@ -9564,7 +9598,7 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/mouse_curso #else diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc --- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc.libwebrtc-screen-cast-sync 2022-07-18 20:44:33.000000000 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc 2022-07-26 16:30:19.431095434 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc 2022-07-28 11:45:30.320409004 +0200 @@ -14,7 +14,7 @@ #include "modules/desktop_capture/desktop_capturer.h" @@ -9585,7 +9619,7 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/screen_capt diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc --- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc.libwebrtc-screen-cast-sync 2022-07-18 20:44:26.000000000 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc 2022-07-26 16:30:19.431095434 +0200 ++++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc 2022-07-28 11:45:30.320409004 +0200 @@ -14,7 +14,7 @@ #include "modules/desktop_capture/desktop_capturer.h" @@ -9606,7 +9640,7 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/window_capt diff -up firefox-103.0/third_party/moz.build.libwebrtc-screen-cast-sync firefox-103.0/third_party/moz.build --- firefox-103.0/third_party/moz.build.libwebrtc-screen-cast-sync 2022-07-18 20:44:36.000000000 +0200 -+++ firefox-103.0/third_party/moz.build 2022-07-26 16:30:19.431095434 +0200 ++++ firefox-103.0/third_party/moz.build 2022-07-28 11:45:30.321408998 +0200 @@ -61,6 +61,12 @@ with Files("libwebrtc/**"): with Files("pipewire/**"): BUG_COMPONENT = ("Core", "WebRTC") @@ -9622,7 +9656,7 @@ diff -up firefox-103.0/third_party/moz.build.libwebrtc-screen-cast-sync firefox- diff -up firefox-103.0/third_party/pipewire/libpipewire/mozpipewire.cpp.libwebrtc-screen-cast-sync firefox-103.0/third_party/pipewire/libpipewire/mozpipewire.cpp --- firefox-103.0/third_party/pipewire/libpipewire/mozpipewire.cpp.libwebrtc-screen-cast-sync 2022-07-18 20:44:36.000000000 +0200 -+++ firefox-103.0/third_party/pipewire/libpipewire/mozpipewire.cpp 2022-07-26 16:30:19.431095434 +0200 ++++ firefox-103.0/third_party/pipewire/libpipewire/mozpipewire.cpp 2022-07-28 11:45:30.321408998 +0200 @@ -69,11 +69,13 @@ static int (*pw_stream_connect_fn)(struc enum pw_stream_flags flags, const struct spa_pod **params, @@ -9740,15 +9774,3 @@ diff -up firefox-103.0/third_party/pipewire/libpipewire/mozpipewire.cpp.libwebrt + return pw_get_library_version_fn(); +} + -diff -up firefox-103.0/dom/media/webrtc/moz.build.webrtc firefox-103.0/dom/media/webrtc/moz.build ---- firefox-103.0/dom/media/webrtc/moz.build.webrtc 2022-07-28 11:41:19.923012830 +0200 -+++ firefox-103.0/dom/media/webrtc/moz.build 2022-07-28 11:41:56.314779745 +0200 -@@ -85,6 +85,8 @@ if CONFIG["MOZ_WEBRTC_SIGNALING"]: - - if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": - DIRS += ["/third_party/pipewire/libpipewire"] -+ DIRS += ["/third_party/drm/libdrm"] -+ DIRS += ["/third_party/gbm/libgbm"] - - # Avoid warnings from third-party code that we can not modify. - if CONFIG["CC_TYPE"] == "clang-cl": From 6b8336e97f8b5a041b2981651b2226ef32cef3cd Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 1 Aug 2022 13:52:21 +0200 Subject: [PATCH 089/545] Disabled webrtc-screen-cast patch on ppc64le due to build failures --- firefox.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/firefox.spec b/firefox.spec index 58f0418..bc1234e 100644 --- a/firefox.spec +++ b/firefox.spec @@ -523,7 +523,9 @@ This package contains results of tests executed during build. %patch990 -p1 -b .work-around-GCC-ICE-on-arm +%ifnarch ppc64le %patch1000 -p1 -b .libwebrtc-screen-cast-sync +%endif %{__rm} -f .mozconfig %{__cp} %{SOURCE10} .mozconfig From 36a931ea7a0f776497cb12ab071678b521d797fc Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 2 Aug 2022 08:59:36 +0200 Subject: [PATCH 090/545] Disabled ppc64le due to webrtc build failures (rhbz#2113850) --- firefox.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/firefox.spec b/firefox.spec index bc1234e..ba443dd 100644 --- a/firefox.spec +++ b/firefox.spec @@ -33,6 +33,10 @@ # https://bugzilla.redhat.com/show_bug.cgi?id=1897522 ExcludeArch: s390x +# Temporary disabled due to webrtc build failures +# https://bugzilla.redhat.com/show_bug.cgi?id=2113850 +ExcludeArch: ppc64le + # Disabled due to # https://bugzilla.redhat.com/show_bug.cgi?id=1966949 %if 0%{?fedora} > 35 @@ -1122,6 +1126,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %changelog * Tue Jul 26 2022 Martin Stransky - 103.0-1 - Update to 103.0 +- Disabled ppc64le due to webrtc build failures (rhbz#2113850) * Thu Jul 21 2022 Fedora Release Engineering - 102.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From c1b363d122cc9a3e28b3b7b665f7bf9c91f8d73c Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 2 Aug 2022 17:29:21 +0200 Subject: [PATCH 091/545] Update to 103.0.1 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index f22e708..64c6848 100644 --- a/.gitignore +++ b/.gitignore @@ -519,3 +519,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-102.0-20220628.tar.xz /firefox-103.0.source.tar.xz /firefox-langpacks-103.0-20220721.tar.xz +/firefox-103.0.1.source.tar.xz +/firefox-langpacks-103.0.1-20220802.tar.xz diff --git a/firefox.spec b/firefox.spec index ba443dd..dc94f85 100644 --- a/firefox.spec +++ b/firefox.spec @@ -173,13 +173,13 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox -Version: 103.0 +Version: 103.0.1 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220721.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220802.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1124,6 +1124,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue Aug 2 2022 Martin Stransky - 103.0.1-1 +- Update to 103.0.1 + * Tue Jul 26 2022 Martin Stransky - 103.0-1 - Update to 103.0 - Disabled ppc64le due to webrtc build failures (rhbz#2113850) diff --git a/sources b/sources index abf7f49..6b32f41 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 -SHA512 (firefox-103.0.source.tar.xz) = 016c2f276fb94e5174626f7d8b1a821b2de0f5a07f8a10f00a7ea4d4285591b0c23dd3ef45306579de79b3dfa99ccc527224c33f3319f61cf088b1f4bd097f9e -SHA512 (firefox-langpacks-103.0-20220721.tar.xz) = 5633451a25075439459a6af4917a4dda4e06767a1f4d1055d42cdbe0c3de7a4e2c464f502982ed6bfd1a13b82ad462a9b9fb91910bac85aeb3e77f7af3739b5c SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 +SHA512 (firefox-103.0.1.source.tar.xz) = cb487e1d5d602e6b07093b5e722c4e70b9bf39f42c13c25642f263f90f9d3940d02e6fdbab9e8f41b66a50f81d70300acf81c222f08a26eed3ae55777fdc6303 +SHA512 (firefox-langpacks-103.0.1-20220802.tar.xz) = 3cd881215c1b46469c790e67c2e6d53626d37ee6b4550b8783ebb43ece7eb3ec18bf11e323a15af341f82d7bd18878d8eadc6c3ade7681f3a891bab6e3319a45 From 85f5f771e92b10b6b34cf8da8b2dbb0f9f6562c8 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 4 Aug 2022 11:32:33 +0200 Subject: [PATCH 092/545] -m --- firefox.spec | 24 ++++++++++-------------- libwebrtc-screen-cast-sync-1.patch | 2 +- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/firefox.spec b/firefox.spec index dc94f85..7dd3262 100644 --- a/firefox.spec +++ b/firefox.spec @@ -39,7 +39,7 @@ ExcludeArch: ppc64le # Disabled due to # https://bugzilla.redhat.com/show_bug.cgi?id=1966949 -%if 0%{?fedora} > 35 +%if 0%{?fedora} > 36 ExcludeArch: armv7hl %endif @@ -51,6 +51,10 @@ ExcludeArch: aarch64 %ifarch armv7hl %global create_debuginfo 0 + +# always use clang for arm builds +%global toolchain clang +%global build_with_clang 1 %endif # Temporary disabled due to @@ -174,7 +178,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 103.0.1 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -527,7 +531,7 @@ This package contains results of tests executed during build. %patch990 -p1 -b .work-around-GCC-ICE-on-arm -%ifnarch ppc64le +%ifnarch ppc64le %{arm} %patch1000 -p1 -b .libwebrtc-screen-cast-sync %endif @@ -723,17 +727,6 @@ MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -fsanitize=address -ldl" # make sure "-g0" is the last flag so there's no debug info MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -g0" - -# https://bugzilla.mozilla.org/show_bug.cgi?id=1738845 -# should not be needed anymore with firefox 103 -echo "ac_add_options --disable-webrtc" >> .mozconfig - -# personal preferences -echo "ac_add_options --disable-webspeech" >> .mozconfig -echo "ac_add_options --disable-synth-speechd" >> .mozconfig -echo "ac_add_options --disable-accessibility" >> .mozconfig -echo "ac_add_options --disable-parental-controls" >> .mozconfig -echo "ac_add_options --disable-printing" >> .mozconfig %endif # We don't wantfirefox to use CK_GCM_PARAMS_V3 in nss @@ -1124,6 +1117,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue Aug 4 2022 Martin Stransky - 103.0.1-2 +- Added arm build fixes by Gabriel Hojda + * Tue Aug 2 2022 Martin Stransky - 103.0.1-1 - Update to 103.0.1 diff --git a/libwebrtc-screen-cast-sync-1.patch b/libwebrtc-screen-cast-sync-1.patch index f85efe4..07025b1 100644 --- a/libwebrtc-screen-cast-sync-1.patch +++ b/libwebrtc-screen-cast-sync-1.patch @@ -7847,7 +7847,7 @@ diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scope + public: + Scoped() {} + explicit Scoped(T* val) { ptr_ = val; } -+ ~Scoped() { RTC_DCHECK_NOTREACHED(); } ++ ~Scoped() { RTC_NOTREACHED(); } + + T* operator->() const { return ptr_; } + From d9f5bf9ed40c19122be024f0270d844ae21b3a6e Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 4 Aug 2022 11:38:01 +0200 Subject: [PATCH 093/545] fixed changelog --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 7dd3262..871eadb 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1117,7 +1117,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog -* Tue Aug 4 2022 Martin Stransky - 103.0.1-2 +* Thu Aug 4 2022 Martin Stransky - 103.0.1-2 - Added arm build fixes by Gabriel Hojda * Tue Aug 2 2022 Martin Stransky - 103.0.1-1 From bd3fc12e39a49d8ba0f57bbdedde7cb7a2dface8 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 4 Aug 2022 11:48:18 +0200 Subject: [PATCH 094/545] Enable VA-API (rhbz#2115253) --- firefox-enable-vaapi.patch | 18 ++++++++++++++++++ firefox.spec | 3 +++ 2 files changed, 21 insertions(+) create mode 100644 firefox-enable-vaapi.patch diff --git a/firefox-enable-vaapi.patch b/firefox-enable-vaapi.patch new file mode 100644 index 0000000..bfa50a0 --- /dev/null +++ b/firefox-enable-vaapi.patch @@ -0,0 +1,18 @@ +diff -up firefox-103.0/gfx/thebes/gfxPlatformGtk.cpp.enable-vaapi firefox-103.0/gfx/thebes/gfxPlatformGtk.cpp +--- firefox-103.0/gfx/thebes/gfxPlatformGtk.cpp.enable-vaapi 2022-07-18 20:44:04.000000000 +0200 ++++ firefox-103.0/gfx/thebes/gfxPlatformGtk.cpp 2022-08-04 11:41:18.109583874 +0200 +@@ -232,13 +232,8 @@ void gfxPlatformGtk::InitDmabufConfig() + void gfxPlatformGtk::InitVAAPIConfig() { + FeatureState& feature = gfxConfig::GetFeature(Feature::VAAPI); + #ifdef MOZ_WAYLAND +-# ifdef NIGHTLY_BUILD + feature.EnableByDefault(); +-# else +- feature.DisableByDefault(FeatureStatus::Disabled, +- "VAAPI is disabled by default", +- "FEATURE_VAAPI_DISABLED"_ns); +-# endif ++ + nsCString failureId; + int32_t status; + nsCOMPtr gfxInfo = components::GfxInfo::Service(); diff --git a/firefox.spec b/firefox.spec index 871eadb..ec7b31e 100644 --- a/firefox.spec +++ b/firefox.spec @@ -250,6 +250,7 @@ Patch224: mozilla-1170092.patch Patch226: rhbz-1354671.patch Patch228: disable-openh264-download.patch Patch229: firefox-nss-addon-hack.patch +Patch230: firefox-enable-vaapi.patch # Upstream patches Patch402: mozilla-1196777.patch @@ -513,6 +514,7 @@ This package contains results of tests executed during build. %endif %patch228 -p1 -b .disable-openh264-download %patch229 -p1 -b .firefox-nss-addon-hack +%patch230 -p1 -b .firefox-enable-vaapi %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 @@ -1119,6 +1121,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %changelog * Thu Aug 4 2022 Martin Stransky - 103.0.1-2 - Added arm build fixes by Gabriel Hojda +- Enable VA-API (rhbz#2115253) * Tue Aug 2 2022 Martin Stransky - 103.0.1-1 - Update to 103.0.1 From c6d827cb4ebcb6d60f26fd138143279ea4963848 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 5 Aug 2022 11:30:09 +0200 Subject: [PATCH 095/545] Don't use clang suffix on arm --- firefox.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/firefox.spec b/firefox.spec index ec7b31e..d7d9a09 100644 --- a/firefox.spec +++ b/firefox.spec @@ -157,9 +157,12 @@ ExcludeArch: aarch64 %if !%{release_build} %global pre_tag .npgo %endif +# Don't use 'clang' suffix on arm +%ifnarch %{arm} %if %{build_with_clang} %global pre_tag .clang %endif +%endif %if %{build_with_asan} %global pre_tag .asan %global build_with_pgo 0 From b65f309bcd70b159991e7924a19ae48655f764b5 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 12 Aug 2022 13:34:40 +0200 Subject: [PATCH 096/545] Updated to 103.0.2 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 64c6848..9655e88 100644 --- a/.gitignore +++ b/.gitignore @@ -521,3 +521,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-103.0-20220721.tar.xz /firefox-103.0.1.source.tar.xz /firefox-langpacks-103.0.1-20220802.tar.xz +/firefox-103.0.2.source.tar.xz +/firefox-langpacks-103.0.2-20220812.tar.xz diff --git a/firefox.spec b/firefox.spec index d7d9a09..24168b3 100644 --- a/firefox.spec +++ b/firefox.spec @@ -180,13 +180,13 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox -Version: 103.0.1 -Release: 2%{?pre_tag}%{?dist} +Version: 103.0.2 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220802.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220812.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1122,6 +1122,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Fri Aug 12 2022 Martin Stransky - 103.0.2-1 +- Updated to 103.0.2 + * Thu Aug 4 2022 Martin Stransky - 103.0.1-2 - Added arm build fixes by Gabriel Hojda - Enable VA-API (rhbz#2115253) diff --git a/sources b/sources index 6b32f41..18ecc3f 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 -SHA512 (firefox-103.0.1.source.tar.xz) = cb487e1d5d602e6b07093b5e722c4e70b9bf39f42c13c25642f263f90f9d3940d02e6fdbab9e8f41b66a50f81d70300acf81c222f08a26eed3ae55777fdc6303 -SHA512 (firefox-langpacks-103.0.1-20220802.tar.xz) = 3cd881215c1b46469c790e67c2e6d53626d37ee6b4550b8783ebb43ece7eb3ec18bf11e323a15af341f82d7bd18878d8eadc6c3ade7681f3a891bab6e3319a45 +SHA512 (firefox-103.0.2.source.tar.xz) = f13984bb551039c80ef731931f08a284f070142ecb479b31a4caad026a6b535e3fc7ae506b629e933ba5f5a1676f14b6b36d031d22584170492676f8727c822a +SHA512 (firefox-langpacks-103.0.2-20220812.tar.xz) = f81f80cffabd6fe8809ec1bce705ebf89208f5a2b92ca1636dc8c82f452bed4f5386e33e441639ede8ba5bd165fa9855e91a560bd3e62c8f5e7f7502be4f3383 From babecc662ffdee9a8189ce1f75bb62b0ebc1adf5 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 16 Aug 2022 20:57:04 +0200 Subject: [PATCH 097/545] Updated to 104.0 --- .gitignore | 2 ++ firefox-102.0-pref-print.patch | 18 ---------------- firefox-enable-vaapi.patch | 38 ++++++++++++++++++---------------- firefox.spec | 10 ++++----- sources | 4 ++-- 5 files changed, 29 insertions(+), 43 deletions(-) delete mode 100644 firefox-102.0-pref-print.patch diff --git a/.gitignore b/.gitignore index 9655e88..de97af4 100644 --- a/.gitignore +++ b/.gitignore @@ -523,3 +523,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-103.0.1-20220802.tar.xz /firefox-103.0.2.source.tar.xz /firefox-langpacks-103.0.2-20220812.tar.xz +/firefox-104.0.source.tar.xz +/firefox-langpacks-104.0-20220816.tar.xz diff --git a/firefox-102.0-pref-print.patch b/firefox-102.0-pref-print.patch deleted file mode 100644 index 6fd0dce..0000000 --- a/firefox-102.0-pref-print.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -up firefox-102.0/widget/gtk/DMABufLibWrapper.cpp.vaapi firefox-102.0/widget/gtk/DMABufLibWrapper.cpp ---- firefox-102.0/widget/gtk/DMABufLibWrapper.cpp.vaapi 2022-07-01 09:49:50.215536872 +0200 -+++ firefox-102.0/widget/gtk/DMABufLibWrapper.cpp 2022-07-01 09:50:43.036306610 +0200 -@@ -283,10 +283,11 @@ bool nsDMABufDevice::IsDMABufTexturesEna - bool nsDMABufDevice::IsDMABufVAAPIEnabled() { - LOGDMABUF( - ("nsDMABufDevice::IsDMABufVAAPIEnabled: EGL %d " -- "media_ffmpeg_vaapi_enabled %d CanUseHardwareVideoDecoding %d " -+ "CanUseHardwareVideoDecoding %d " - "XRE_IsRDDProcess %d\n", -- gfx::gfxVars::UseEGL(), StaticPrefs::media_ffmpeg_vaapi_enabled(), -- gfx::gfxVars::CanUseHardwareVideoDecoding(), XRE_IsRDDProcess())); -+ gfx::gfxVars::UseEGL(), -+ gfx::gfxVars::CanUseHardwareVideoDecoding(), -+ XRE_IsRDDProcess())); - return gfx::gfxVars::UseVAAPI() && XRE_IsRDDProcess() && - gfx::gfxVars::CanUseHardwareVideoDecoding(); - } diff --git a/firefox-enable-vaapi.patch b/firefox-enable-vaapi.patch index bfa50a0..ddf30d1 100644 --- a/firefox-enable-vaapi.patch +++ b/firefox-enable-vaapi.patch @@ -1,18 +1,20 @@ -diff -up firefox-103.0/gfx/thebes/gfxPlatformGtk.cpp.enable-vaapi firefox-103.0/gfx/thebes/gfxPlatformGtk.cpp ---- firefox-103.0/gfx/thebes/gfxPlatformGtk.cpp.enable-vaapi 2022-07-18 20:44:04.000000000 +0200 -+++ firefox-103.0/gfx/thebes/gfxPlatformGtk.cpp 2022-08-04 11:41:18.109583874 +0200 -@@ -232,13 +232,8 @@ void gfxPlatformGtk::InitDmabufConfig() - void gfxPlatformGtk::InitVAAPIConfig() { - FeatureState& feature = gfxConfig::GetFeature(Feature::VAAPI); - #ifdef MOZ_WAYLAND --# ifdef NIGHTLY_BUILD - feature.EnableByDefault(); --# else -- feature.DisableByDefault(FeatureStatus::Disabled, -- "VAAPI is disabled by default", -- "FEATURE_VAAPI_DISABLED"_ns); --# endif -+ - nsCString failureId; - int32_t status; - nsCOMPtr gfxInfo = components::GfxInfo::Service(); +diff -up firefox-104.0/gfx/thebes/gfxPlatformGtk.cpp.firefox-enable-vaapi firefox-104.0/gfx/thebes/gfxPlatformGtk.cpp +diff -up firefox-104.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi firefox-104.0/widget/gtk/GfxInfo.cpp +--- firefox-104.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi 2022-08-16 15:14:53.014042400 +0200 ++++ firefox-104.0/widget/gtk/GfxInfo.cpp 2022-08-16 15:15:30.482301677 +0200 +@@ -873,15 +873,6 @@ const nsTArray& GfxInfo:: + nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED, + V(0, 0, 0, 0), "FEATURE_HARDWARE_VIDEO_DECODING_NO_LINUX_AMD", ""); + +- // Disable on Release/late Beta +-#if !defined(EARLY_BETA_OR_EARLIER) +- APPEND_TO_DRIVER_BLOCKLIST(OperatingSystem::Linux, DeviceFamily::All, +- nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING, +- nsIGfxInfo::FEATURE_BLOCKED_DEVICE, +- DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0), +- "FEATURE_HARDWARE_VIDEO_DECODING_DISABLE", ""); +-#endif +- + //////////////////////////////////// + // FEATURE_WEBRENDER_PARTIAL_PRESENT + APPEND_TO_DRIVER_BLOCKLIST_EXT( diff --git a/firefox.spec b/firefox.spec index 24168b3..6b96147 100644 --- a/firefox.spec +++ b/firefox.spec @@ -180,13 +180,13 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox -Version: 103.0.2 +Version: 104.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220812.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220816.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -260,7 +260,6 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch -Patch448: firefox-102.0-pref-print.patch # PGO/LTO patches Patch600: pgo.patch @@ -524,8 +523,6 @@ This package contains results of tests executed during build. %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 -%patch448 -p1 -b .pref-print - # PGO patches %if %{build_with_pgo} %if !%{build_with_clang} @@ -1122,6 +1119,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue Aug 16 2022 Martin Stransky - 104.0-1 +- Updated to 104.0 + * Fri Aug 12 2022 Martin Stransky - 103.0.2-1 - Updated to 103.0.2 diff --git a/sources b/sources index 18ecc3f..9a2f897 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 -SHA512 (firefox-103.0.2.source.tar.xz) = f13984bb551039c80ef731931f08a284f070142ecb479b31a4caad026a6b535e3fc7ae506b629e933ba5f5a1676f14b6b36d031d22584170492676f8727c822a -SHA512 (firefox-langpacks-103.0.2-20220812.tar.xz) = f81f80cffabd6fe8809ec1bce705ebf89208f5a2b92ca1636dc8c82f452bed4f5386e33e441639ede8ba5bd165fa9855e91a560bd3e62c8f5e7f7502be4f3383 +SHA512 (firefox-104.0.source.tar.xz) = 818759eeda6cd103998bbfec80e917a3598aebec1c055699bcf6eac612816e899e360f6f7b0b4a1eabebaed312208d6765b84242a310cfc35587e6fb19a74c59 +SHA512 (firefox-langpacks-104.0-20220816.tar.xz) = 63ae80626ae4ad641460639f60cfa378ea3293a24e897d7e7a7e2b3dddf57de93be7328361f750de693c0601a438fff09624a0eae6ec19ddca9e0a08200455be From a23c216427e79d6572acc3bfccfbfc345e76fe01 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 17 Aug 2022 10:30:53 +0200 Subject: [PATCH 098/545] Added build fix --- D154024.diff | 17 +++++++++++++++++ firefox.spec | 7 ++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 D154024.diff diff --git a/D154024.diff b/D154024.diff new file mode 100644 index 0000000..776f40b --- /dev/null +++ b/D154024.diff @@ -0,0 +1,17 @@ +diff --git a/toolkit/crashreporter/client/ping.cpp b/toolkit/crashreporter/client/ping.cpp +--- a/toolkit/crashreporter/client/ping.cpp ++++ b/toolkit/crashreporter/client/ping.cpp +@@ -51,11 +51,11 @@ + CFUUIDBytes bytes = CFUUIDGetUUIDBytes(uuid); + memcpy(&id, &bytes, sizeof(UUID)); + + CFRelease(uuid); + #elif defined(HAVE_ARC4RANDOM_BUF) // Android, BSD, ... +- arc4random_buf(id, sizeof(UUID)); ++ arc4random_buf(&id, sizeof(UUID)); + #else // Linux + int fd = open("/dev/urandom", O_RDONLY); + + if (fd == -1) { + return ""; + diff --git a/firefox.spec b/firefox.spec index 6b96147..310a1e2 100644 --- a/firefox.spec +++ b/firefox.spec @@ -181,7 +181,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 104.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -236,6 +236,7 @@ Patch61: firefox-glibc-dynstack.patch Patch62: build-python.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch77: build-python-3.11.patch +Patch78: D154024.diff # Test patches # Generate without context by @@ -500,6 +501,7 @@ This package contains results of tests executed during build. %patch54 -p1 -b .1669639 %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch77 -p1 -b .build-python-3.11 +%patch78 -p1 -b .D154024 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -1119,6 +1121,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Wed Aug 17 2022 Martin Stransky - 104.0-2 +- Added build fixes + * Tue Aug 16 2022 Martin Stransky - 104.0-1 - Updated to 104.0 From 9d9142cadb95ab23e84bb72c3953999853cc6f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Fri, 5 Aug 2022 11:48:50 +0000 Subject: [PATCH 099/545] work around broken moz.build file on ppc64le Patch the pre-generated file with the missing bits. Related: mozb#1779545, mozb#1775202 --- firefox.spec | 9 +++++---- mozilla-1775202.patch | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 mozilla-1775202.patch diff --git a/firefox.spec b/firefox.spec index 310a1e2..9eec447 100644 --- a/firefox.spec +++ b/firefox.spec @@ -33,10 +33,6 @@ # https://bugzilla.redhat.com/show_bug.cgi?id=1897522 ExcludeArch: s390x -# Temporary disabled due to webrtc build failures -# https://bugzilla.redhat.com/show_bug.cgi?id=2113850 -ExcludeArch: ppc64le - # Disabled due to # https://bugzilla.redhat.com/show_bug.cgi?id=1966949 %if 0%{?fedora} > 36 @@ -272,6 +268,9 @@ Patch990: work-around-GCC-ICE-on-arm.patch # Backported WebRTC changes for PipeWire/Wayland screen sharing support Patch1000: libwebrtc-screen-cast-sync-1.patch +# Work around broken moz.build file on ppc64le (mozb#1779545, mozb#1775202) +Patch1100: mozilla-1775202.patch + %if %{?system_nss} BuildRequires: pkgconfig(nspr) >= %{nspr_version} BuildRequires: pkgconfig(nss) >= %{nss_version} @@ -539,6 +538,8 @@ This package contains results of tests executed during build. %patch1000 -p1 -b .libwebrtc-screen-cast-sync %endif +%patch1100 -p1 -b .ppc-mobzuild + %{__rm} -f .mozconfig %{__cp} %{SOURCE10} .mozconfig echo "ac_add_options --enable-default-toolkit=cairo-gtk3-wayland" >> .mozconfig diff --git a/mozilla-1775202.patch b/mozilla-1775202.patch new file mode 100644 index 0000000..b1748de --- /dev/null +++ b/mozilla-1775202.patch @@ -0,0 +1,17 @@ +diff --git a/third_party/libwebrtc/moz.build b/third_party/libwebrtc/moz.build +index 8579f8bb3622..d9ca79d4fcb8 100644 +--- a/third_party/libwebrtc/moz.build ++++ b/third_party/libwebrtc/moz.build +@@ -520,7 +520,10 @@ if CONFIG["CPU_ARCH"] == "ppc64" and CONFIG["OS_TARGET"] == "Linux": + "/third_party/libwebrtc/api/audio_codecs/isac/audio_decoder_isac_float_gn", + "/third_party/libwebrtc/api/audio_codecs/isac/audio_encoder_isac_float_gn", + "/third_party/libwebrtc/modules/audio_coding/isac_c_gn", +- "/third_party/libwebrtc/modules/audio_coding/isac_gn" ++ "/third_party/libwebrtc/modules/audio_coding/isac_gn", ++ "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn", ++ "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn", ++ "/third_party/libwebrtc/modules/desktop_capture/primitives_gn" + ] + + if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux": + From 2300fa46f5f61ab189e08fef6441193231cba85b Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Mon, 22 Aug 2022 21:28:13 +0200 Subject: [PATCH 100/545] Update to 104.0 respin --- .gitignore | 1 + firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index de97af4..8d2ff7e 100644 --- a/.gitignore +++ b/.gitignore @@ -525,3 +525,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-103.0.2-20220812.tar.xz /firefox-104.0.source.tar.xz /firefox-langpacks-104.0-20220816.tar.xz +/firefox-langpacks-104.0-20220822.tar.xz diff --git a/firefox.spec b/firefox.spec index 310a1e2..851d805 100644 --- a/firefox.spec +++ b/firefox.spec @@ -181,12 +181,12 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 104.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220816.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220822.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1121,6 +1121,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Mon Aug 22 2022 Eike Rathke - 104.0-3 +- Update to 104.0 respin + * Wed Aug 17 2022 Martin Stransky - 104.0-2 - Added build fixes diff --git a/sources b/sources index 9a2f897..87bb3df 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 -SHA512 (firefox-104.0.source.tar.xz) = 818759eeda6cd103998bbfec80e917a3598aebec1c055699bcf6eac612816e899e360f6f7b0b4a1eabebaed312208d6765b84242a310cfc35587e6fb19a74c59 -SHA512 (firefox-langpacks-104.0-20220816.tar.xz) = 63ae80626ae4ad641460639f60cfa378ea3293a24e897d7e7a7e2b3dddf57de93be7328361f750de693c0601a438fff09624a0eae6ec19ddca9e0a08200455be +SHA512 (firefox-104.0.source.tar.xz) = 8778650ffa3c2d18802c348e27789f00cff143c7ca0ae01b1bcd050b6942c149db25696b48f3c702fbde901c15fcae976ac731a456f641637cae3eb56d0077d3 +SHA512 (firefox-langpacks-104.0-20220822.tar.xz) = f2eb109de14f82041115eab5f4e10d8555017617f8d5067709a1588536d50df8fd94f767d9b5866002f8da6901894d46931d82bfce9c2aceb1a33b68c48074db From 720c2b63eb5ec3d6218b9ffb782a0c4d443c34ea Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Tue, 23 Aug 2022 11:18:15 +0200 Subject: [PATCH 101/545] bump release due to ppc64le fixes --- firefox.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 761116f..b3cfd98 100644 --- a/firefox.spec +++ b/firefox.spec @@ -177,7 +177,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 104.0 -Release: 3%{?pre_tag}%{?dist} +Release: 4%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1122,6 +1122,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue Aug 23 2022 Jan Horak - 104.0-4 +- Rebuild due to ppc64le fixes + * Mon Aug 22 2022 Eike Rathke - 104.0-3 - Update to 104.0 respin From 7e1b07c41aea995e1618e073e8c3a1718a6b6249 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Wed, 17 Aug 2022 10:25:36 +0200 Subject: [PATCH 102/545] Use constrain_build macro to simplify parallel make handling With constrain_build it is possible to just say how much RAM per process / CPU core we need to build and it automatically calculates out the right -jXX number to use. I've used 2 GB per CPU as the initial setting, but if we run into issues with gcc running out of memory on e.g. s390x, the number can be easily increased (which then reduces parallelism on low memory builders). --- firefox.spec | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/firefox.spec b/firefox.spec index b3cfd98..ea8a25b 100644 --- a/firefox.spec +++ b/firefox.spec @@ -177,7 +177,7 @@ ExcludeArch: aarch64 Summary: Mozilla Firefox Web browser Name: firefox Version: 104.0 -Release: 4%{?pre_tag}%{?dist} +Release: 5%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -760,27 +760,10 @@ echo "ac_add_options MOZ_PGO=1" >> .mozconfig export CCACHE_DISABLE=1 %endif -MOZ_SMP_FLAGS=-j1 -# On x86_64 architectures, Mozilla can build up to 4 jobs at once in parallel, -# however builds tend to fail on other arches when building in parallel. -%ifarch %{ix86} s390x %{arm} aarch64 -[ -z "$RPM_BUILD_NCPUS" ] && \ - RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`" -[ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2 -%endif -%ifarch x86_64 ppc ppc64 ppc64le -[ -z "$RPM_BUILD_NCPUS" ] && \ - RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`" -[ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2 -[ "$RPM_BUILD_NCPUS" -ge 4 ] && MOZ_SMP_FLAGS=-j4 -[ "$RPM_BUILD_NCPUS" -ge 8 ] && MOZ_SMP_FLAGS=-j8 -[ "$RPM_BUILD_NCPUS" -ge 16 ] && MOZ_SMP_FLAGS=-j16 -[ "$RPM_BUILD_NCPUS" -ge 24 ] && MOZ_SMP_FLAGS=-j24 -[ "$RPM_BUILD_NCPUS" -ge 32 ] && MOZ_SMP_FLAGS=-j32 -[ "$RPM_BUILD_NCPUS" -ge 64 ] && MOZ_SMP_FLAGS=-j64 -%endif +# Require 2 GB of RAM per CPU core +%constrain_build -m 2048 -echo "mk_add_options MOZ_MAKE_FLAGS=\"$MOZ_SMP_FLAGS\"" >> .mozconfig +echo "mk_add_options MOZ_MAKE_FLAGS=\"-j%{_smp_build_ncpus}\"" >> .mozconfig echo "mk_add_options MOZ_SERVICES_SYNC=1" >> .mozconfig echo "export STRIP=/bin/true" >> .mozconfig #export MACH_USE_SYSTEM_PYTHON=1 @@ -1122,6 +1105,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue Aug 23 2022 Kalev Lember - 104.0-5 +- Use constrain_build macro to simplify parallel make handling + * Tue Aug 23 2022 Jan Horak - 104.0-4 - Rebuild due to ppc64le fixes From 1ad3bd1b2451eba507ab60632c8e4b5c9325f21e Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Wed, 17 Aug 2022 10:26:14 +0200 Subject: [PATCH 103/545] Drop obsolete build conditionals This drops ifarch conditionals on architectures that are no longer used in koji (ppc64, s390, arm on F37+), and conditionals on EOL Fedora versions. --- firefox.spec | 39 ++++------------------------------- rhbz-1219542-s390-build.patch | 23 --------------------- 2 files changed, 4 insertions(+), 58 deletions(-) delete mode 100644 rhbz-1219542-s390-build.patch diff --git a/firefox.spec b/firefox.spec index ea8a25b..f970fe1 100644 --- a/firefox.spec +++ b/firefox.spec @@ -33,18 +33,6 @@ # https://bugzilla.redhat.com/show_bug.cgi?id=1897522 ExcludeArch: s390x -# Disabled due to -# https://bugzilla.redhat.com/show_bug.cgi?id=1966949 -%if 0%{?fedora} > 36 -ExcludeArch: armv7hl -%endif - -# Disabled due to -# https://bugzilla.redhat.com/show_bug.cgi?id=2019160 -%if 0%{?fedora} == 33 -ExcludeArch: aarch64 -%endif - %ifarch armv7hl %global create_debuginfo 0 @@ -96,7 +84,7 @@ ExcludeArch: aarch64 %global build_with_pgo 0 %endif # Big endian platforms -%ifarch ppc64 s390x +%ifarch s390x %global big_endian 1 %endif @@ -214,7 +202,6 @@ Source45: run-wayland-compositor # Build patches Patch3: mozilla-build-arm.patch -Patch25: rhbz-1219542-s390-build.patch Patch32: build-rust-ppc64le.patch Patch35: build-ppc-jit.patch # Fixing missing cacheFlush when JS_CODEGEN_NONE is used (s390x) @@ -391,10 +378,7 @@ BuildRequires: liberation-mono-fonts BuildRequires: liberation-sans-fonts BuildRequires: liberation-serif-fonts # ---------------------------------- -# Missing on f32 -%if 0%{?fedora} > 33 BuildRequires: google-carlito-fonts -%endif BuildRequires: google-droid-sans-fonts BuildRequires: google-noto-fonts-common BuildRequires: google-noto-cjk-fonts-common @@ -413,10 +397,7 @@ BuildRequires: lohit-tamil-fonts BuildRequires: lohit-telugu-fonts # ---------------------------------- BuildRequires: paktype-naskh-basic-fonts -# faild to build in Koji / f32 -%if 0%{?fedora} > 33 BuildRequires: pt-sans-fonts -%endif BuildRequires: smc-meera-fonts BuildRequires: stix-fonts BuildRequires: abattis-cantarell-fonts @@ -485,9 +466,6 @@ This package contains results of tests executed during build. # there is a compare of config and js/config directories and .orig suffix is # ignored during this compare. -%ifarch s390 -%patch25 -p1 -b .rhbz-1219542-s390 -%endif %patch40 -p1 -b .aarch64-skia %if 0%{?disable_elfhack} %patch41 -p1 -b .disable-elfhack @@ -612,7 +590,7 @@ echo "ac_add_options --with-system-libvpx" >> .mozconfig echo "ac_add_options --without-system-libvpx" >> .mozconfig %endif -%ifarch s390 s390x +%ifarch s390x echo "ac_add_options --disable-jit" >> .mozconfig %endif @@ -676,34 +654,24 @@ MOZ_OPT_FLAGS=$(echo "%{optflags}" | %{__sed} -e 's/-Wall//') # for some sources # Explicitly force the hardening flags for Firefox so it passes the checksec test; # See also https://fedoraproject.org/wiki/Changes/Harden_All_Packages -%if 0%{?fedora} < 30 -MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -Wformat-security -Wformat -Werror=format-security" -%else # Workaround for mozbz#1531309 MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-Werror=format-security//') -%endif -%if 0%{?fedora} > 30 MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fpermissive" -%endif %if %{?hardened_build} MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fPIC -Wl,-z,relro -Wl,-z,now" %endif %if %{?debug_build} MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-O2//') %endif -%ifarch s390 -MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-g/-g1/') # If MOZ_DEBUG_FLAGS is empty, firefox's build will default it to "-g" which # overrides the -g1 from line above and breaks building on s390/arm # (OOM when linking, rhbz#1238225) -export MOZ_DEBUG_FLAGS=" " -%endif %ifarch %{arm} %{ix86} MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-g/-g0/') export MOZ_DEBUG_FLAGS=" " %endif %if !%{build_with_clang} -%ifarch s390 ppc aarch64 %{ix86} +%ifarch aarch64 %{ix86} MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads" %endif %ifarch %{arm} @@ -1107,6 +1075,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %changelog * Tue Aug 23 2022 Kalev Lember - 104.0-5 - Use constrain_build macro to simplify parallel make handling +- Drop obsolete build conditionals * Tue Aug 23 2022 Jan Horak - 104.0-4 - Rebuild due to ppc64le fixes diff --git a/rhbz-1219542-s390-build.patch b/rhbz-1219542-s390-build.patch deleted file mode 100644 index f94e43a..0000000 --- a/rhbz-1219542-s390-build.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -up firefox-55.0/js/src/old-configure.in.rhbz-1219542-s390 firefox-55.0/js/src/old-configure.in ---- firefox-55.0/js/src/old-configure.in.rhbz-1219542-s390 2017-07-31 18:20:48.000000000 +0200 -+++ firefox-55.0/js/src/old-configure.in 2017-08-02 14:31:32.190243669 +0200 -@@ -541,7 +541,7 @@ case "$host" in - - *-linux*|*-kfreebsd*-gnu|*-gnu*) - HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX" -- HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}" -+ HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O1}" - ;; - - *) -@@ -617,8 +617,8 @@ case "$target" in - - *-*linux*) - if test "$GNU_CC" -o "$GNU_CXX"; then -- MOZ_PGO_OPTIMIZE_FLAGS="-O3" -- MOZ_OPTIMIZE_FLAGS="-O3" -+ MOZ_PGO_OPTIMIZE_FLAGS="-O1" -+ MOZ_OPTIMIZE_FLAGS="-O1" - if test -z "$CLANG_CC"; then - MOZ_OPTIMIZE_FLAGS="-freorder-blocks $MOZ_OPTIMIZE_FLAGS" - fi From 594959d6f80f090d837c7ca1286459de3aa1769c Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Wed, 17 Aug 2022 10:29:03 +0200 Subject: [PATCH 104/545] Drop unused patches --- D145871.diff | 140 - D145966.diff | 20 - D146271.diff | 94 - D146272.diff | 373 -- D146273.diff | 90 - D146274.diff | 158 - D146275.diff | 125 - D147635.diff | 125 - D147636.diff | 278 -- D147637.diff | 139 - D147874.diff | 64 - D148946.diff | 250 -- D149135.diff | 80 - D149238.diff | 34 - build-cubeb-pulse-arm.patch | 4946 ------------------------ fedora-build.patch | 23 - firefox-kde-webrender.patch | 33 - firefox.spec | 1 + mozilla-1640982.patch | 16 - mozilla-1672139.patch | 91 - mozilla-1673313.patch | 351 -- mozilla-1700520.patch | 51 - mozilla-1701089.patch | 23 - mozilla-1753402.patch | 12 - mozilla-1758948.patch | 28 - mozilla-1774271.patch | 31 - mozilla-1885133.patch | 21 - mozilla-440908.patch | 111 - rhbz-1400293-fix-mozilla-1324096.patch | 72 - rust-thirdparty-checksum-fix.patch | 6 - 30 files changed, 1 insertion(+), 7785 deletions(-) delete mode 100644 D145871.diff delete mode 100644 D145966.diff delete mode 100644 D146271.diff delete mode 100644 D146272.diff delete mode 100644 D146273.diff delete mode 100644 D146274.diff delete mode 100644 D146275.diff delete mode 100644 D147635.diff delete mode 100644 D147636.diff delete mode 100644 D147637.diff delete mode 100644 D147874.diff delete mode 100644 D148946.diff delete mode 100644 D149135.diff delete mode 100644 D149238.diff delete mode 100644 build-cubeb-pulse-arm.patch delete mode 100644 fedora-build.patch delete mode 100644 firefox-kde-webrender.patch delete mode 100644 mozilla-1640982.patch delete mode 100644 mozilla-1672139.patch delete mode 100644 mozilla-1673313.patch delete mode 100644 mozilla-1700520.patch delete mode 100644 mozilla-1701089.patch delete mode 100644 mozilla-1753402.patch delete mode 100644 mozilla-1758948.patch delete mode 100644 mozilla-1774271.patch delete mode 100644 mozilla-1885133.patch delete mode 100644 mozilla-440908.patch delete mode 100644 rhbz-1400293-fix-mozilla-1324096.patch delete mode 100644 rust-thirdparty-checksum-fix.patch diff --git a/D145871.diff b/D145871.diff deleted file mode 100644 index 33a2e61..0000000 --- a/D145871.diff +++ /dev/null @@ -1,140 +0,0 @@ -diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h ---- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h -+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h -@@ -146,10 +146,15 @@ - RefPtr mImageContainer; - VideoInfo mInfo; - int mDecodedFrames; - #if LIBAVCODEC_VERSION_MAJOR >= 58 - int mDecodedFramesLate; -+ // Tracks when decode time of recent frame and averange decode time of -+ // previous frames is bigger than frame interval, -+ // i.e. we fail to decode in time. -+ // We switch to SW decode when we hit HW_DECODE_LATE_FRAMES treshold. -+ int mMissedDecodeInAverangeTime; - #endif - float mAverangeDecodeTime; - - class PtsCorrectionContext { - public: -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 -@@ -14,10 +14,13 @@ - #include "VPXDecoder.h" - #include "mozilla/layers/KnowsCompositor.h" - #if LIBAVCODEC_VERSION_MAJOR >= 57 - # include "mozilla/layers/TextureClient.h" - #endif -+#if LIBAVCODEC_VERSION_MAJOR >= 58 -+# include "mozilla/ProfilerMarkers.h" -+#endif - #ifdef MOZ_WAYLAND_USE_VAAPI - # include "H264.h" - # include "mozilla/layers/DMABUFSurfaceImage.h" - # include "mozilla/widget/DMABufLibWrapper.h" - # include "FFmpegVideoFramePool.h" -@@ -56,13 +59,14 @@ - typedef int VAStatus; - # define VA_EXPORT_SURFACE_READ_ONLY 0x0001 - # define VA_EXPORT_SURFACE_SEPARATE_LAYERS 0x0004 - # define VA_STATUS_SUCCESS 0x00000000 - #endif -- - // Use some extra HW frames for potential rendering lags. - #define EXTRA_HW_FRAMES 6 -+// Defines number of delayed frames until we switch back to SW decode. -+#define HW_DECODE_LATE_FRAMES 15 - - #if LIBAVCODEC_VERSION_MAJOR >= 57 && LIBAVUTIL_VERSION_MAJOR >= 56 - # define CUSTOMIZED_BUFFER_ALLOCATION 1 - #endif - -@@ -386,10 +390,11 @@ - mImageContainer(aImageContainer), - mInfo(aConfig), - mDecodedFrames(0), - #if LIBAVCODEC_VERSION_MAJOR >= 58 - mDecodedFramesLate(0), -+ mMissedDecodeInAverangeTime(0), - #endif - mAverangeDecodeTime(0), - mLowLatency(aLowLatency) { - FFMPEG_LOG("FFmpegVideoDecoder::FFmpegVideoDecoder MIME %s Codec ID %d", - aConfig.mMimeType.get(), mCodecID); -@@ -781,22 +786,32 @@ - float decodeTime = (TimeStamp::Now() - aDecodeStart).ToMilliseconds(); - mAverangeDecodeTime = - (mAverangeDecodeTime * (mDecodedFrames - 1) + decodeTime) / - mDecodedFrames; - FFMPEG_LOG( -- " decode time %.2f ms averange decode time %.2f ms decoded frames %d\n", -+ "Frame decode finished, time %.2f ms averange decode time %.2f ms " -+ "decoded %d frames\n", - decodeTime, mAverangeDecodeTime, mDecodedFrames); - #if LIBAVCODEC_VERSION_MAJOR >= 58 -- int frameDuration = mFrame->pkt_duration; -- if (frameDuration > 0 && frameDuration / 1000.0 < decodeTime) { -- mDecodedFramesLate++; -- FFMPEG_LOG( -- " slow decode: failed to decode in time, frame duration %.2f ms, " -- "decode time %.2f\n", -- frameDuration / 1000.0, decodeTime); -- FFMPEG_LOG(" all decoded frames / late decoded frames %d/%d\n", -- mDecodedFrames, mDecodedFramesLate); -+ if (mFrame->pkt_duration > 0) { -+ // Switch frame duration to ms -+ float frameDuration = mFrame->pkt_duration / 1000.0f; -+ if (frameDuration < decodeTime) { -+ PROFILER_MARKER_TEXT("FFmpegVideoDecoder::DoDecode", MEDIA_PLAYBACK, {}, -+ "frame decode takes too long"); -+ mDecodedFramesLate++; -+ if (frameDuration < mAverangeDecodeTime) { -+ mMissedDecodeInAverangeTime++; -+ } -+ FFMPEG_LOG( -+ " slow decode: failed to decode in time, frame duration %.2f ms, " -+ "decode time %.2f\n", -+ frameDuration, decodeTime); -+ FFMPEG_LOG(" frames: all decoded %d late decoded %d over averange %d\n", -+ mDecodedFrames, mDecodedFramesLate, -+ mMissedDecodeInAverangeTime); -+ } - } - #endif - } - - MediaResult FFmpegVideoDecoder::DoDecode( -@@ -866,10 +881,18 @@ - decodeStart = TimeStamp::Now(); - - MediaResult rv; - # ifdef MOZ_WAYLAND_USE_VAAPI - if (IsHardwareAccelerated()) { -+ if (mMissedDecodeInAverangeTime > HW_DECODE_LATE_FRAMES) { -+ PROFILER_MARKER_TEXT("FFmpegVideoDecoder::DoDecode", MEDIA_PLAYBACK, {}, -+ "Fallback to SW decode"); -+ FFMPEG_LOG(" HW decoding is slow, switch back to SW decode"); -+ return MediaResult( -+ NS_ERROR_DOM_MEDIA_DECODE_ERR, -+ RESULT_DETAIL("HW decoding is slow, switch back to SW decode")); -+ } - rv = CreateImageVAAPI(mFrame->pkt_pos, GetFramePts(mFrame), - mFrame->pkt_duration, aResults); - // If VA-API playback failed, just quit. Decoder is going to be restarted - // without VA-API. - if (NS_FAILED(rv)) { -@@ -1129,11 +1152,11 @@ - } - - MediaResult FFmpegVideoDecoder::CreateImageVAAPI( - int64_t aOffset, int64_t aPts, int64_t aDuration, - MediaDataDecoder::DecodedData& aResults) { -- FFMPEG_LOG("VA-API Got one frame output with pts=%" PRId64 "dts=%" PRId64 -+ FFMPEG_LOG("VA-API Got one frame output with pts=%" PRId64 " dts=%" PRId64 - " duration=%" PRId64 " opaque=%" PRId64, - aPts, mFrame->pkt_dts, aDuration, mCodecContext->reordered_opaque); - - VADRMPRIMESurfaceDescriptor vaDesc; - if (!GetVAAPISurfaceDescriptor(&vaDesc)) { - diff --git a/D145966.diff b/D145966.diff deleted file mode 100644 index 2ecfaec..0000000 --- a/D145966.diff +++ /dev/null @@ -1,20 +0,0 @@ -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 -@@ -780,12 +780,13 @@ - mDecodedFrames++; - float decodeTime = (TimeStamp::Now() - aDecodeStart).ToMilliseconds(); - mAverangeDecodeTime = - (mAverangeDecodeTime * (mDecodedFrames - 1) + decodeTime) / - mDecodedFrames; -- FFMPEG_LOG(" averange frame decode time %.2f ms decoded frames %d\n", -- mAverangeDecodeTime, mDecodedFrames); -+ FFMPEG_LOG( -+ " decode time %.2f ms averange decode time %.2f ms decoded frames %d\n", -+ decodeTime, mAverangeDecodeTime, mDecodedFrames); - #if LIBAVCODEC_VERSION_MAJOR >= 58 - int frameDuration = mFrame->pkt_duration; - if (frameDuration > 0 && frameDuration / 1000.0 < decodeTime) { - mDecodedFramesLate++; - FFMPEG_LOG( - diff --git a/D146271.diff b/D146271.diff deleted file mode 100644 index fd2e0b0..0000000 --- a/D146271.diff +++ /dev/null @@ -1,94 +0,0 @@ -diff -up firefox-101.0/security/sandbox/linux/SandboxFilter.cpp.D146271.diff firefox-101.0/security/sandbox/linux/SandboxFilter.cpp ---- firefox-101.0/security/sandbox/linux/SandboxFilter.cpp.D146271.diff 2022-05-27 01:16:59.000000000 +0200 -+++ firefox-101.0/security/sandbox/linux/SandboxFilter.cpp 2022-06-09 09:59:35.569235176 +0200 -@@ -125,28 +125,12 @@ namespace mozilla { - // denied if no broker client is provided by the concrete class. - class SandboxPolicyCommon : public SandboxPolicyBase { - protected: -- enum class ShmemUsage : uint8_t { -- MAY_CREATE, -- ONLY_USE, -- }; -- -- enum class AllowUnsafeSocketPair : uint8_t { -- NO, -- YES, -- }; -- -+ // Subclasses can assign these in their constructors to loosen the -+ // default settings. - SandboxBrokerClient* mBroker = nullptr; - bool mMayCreateShmem = false; - bool mAllowUnsafeSocketPair = false; - -- explicit SandboxPolicyCommon(SandboxBrokerClient* aBroker, -- ShmemUsage aShmemUsage, -- AllowUnsafeSocketPair aAllowUnsafeSocketPair) -- : mBroker(aBroker), -- mMayCreateShmem(aShmemUsage == ShmemUsage::MAY_CREATE), -- mAllowUnsafeSocketPair(aAllowUnsafeSocketPair == -- AllowUnsafeSocketPair::YES) {} -- - SandboxPolicyCommon() = default; - - typedef const sandbox::arch_seccomp_data& ArgsRef; -@@ -1228,11 +1212,13 @@ class ContentSandboxPolicy : public Sand - public: - ContentSandboxPolicy(SandboxBrokerClient* aBroker, - ContentProcessSandboxParams&& aParams) -- : SandboxPolicyCommon(aBroker, ShmemUsage::MAY_CREATE, -- AllowUnsafeSocketPair::YES), -- mParams(std::move(aParams)), -+ : mParams(std::move(aParams)), - mAllowSysV(PR_GetEnv("MOZ_SANDBOX_ALLOW_SYSV") != nullptr), -- mUsingRenderDoc(PR_GetEnv("RENDERDOC_CAPTUREOPTS") != nullptr) {} -+ mUsingRenderDoc(PR_GetEnv("RENDERDOC_CAPTUREOPTS") != nullptr) { -+ mBroker = aBroker; -+ mMayCreateShmem = true; -+ mAllowUnsafeSocketPair = true; -+ } - - ~ContentSandboxPolicy() override = default; - -@@ -1762,9 +1748,10 @@ UniquePtr GetM - // segments, so it may need file brokering. - class RDDSandboxPolicy final : public SandboxPolicyCommon { - public: -- explicit RDDSandboxPolicy(SandboxBrokerClient* aBroker) -- : SandboxPolicyCommon(aBroker, ShmemUsage::MAY_CREATE, -- AllowUnsafeSocketPair::NO) {} -+ explicit RDDSandboxPolicy(SandboxBrokerClient* aBroker) { -+ mBroker = aBroker; -+ mMayCreateShmem = true; -+ } - - #ifndef ANDROID - Maybe EvaluateIpcCall(int aCall, int aArgShift) const override { -@@ -1875,9 +1862,10 @@ UniquePtr GetD - // the SocketProcess sandbox looks like. - class SocketProcessSandboxPolicy final : public SandboxPolicyCommon { - public: -- explicit SocketProcessSandboxPolicy(SandboxBrokerClient* aBroker) -- : SandboxPolicyCommon(aBroker, ShmemUsage::MAY_CREATE, -- AllowUnsafeSocketPair::NO) {} -+ explicit SocketProcessSandboxPolicy(SandboxBrokerClient* aBroker) { -+ mBroker = aBroker; -+ mMayCreateShmem = true; -+ } - - static intptr_t FcntlTrap(const sandbox::arch_seccomp_data& aArgs, - void* aux) { -@@ -2013,9 +2001,10 @@ UniquePtr GetS - - class UtilitySandboxPolicy : public SandboxPolicyCommon { - public: -- explicit UtilitySandboxPolicy(SandboxBrokerClient* aBroker) -- : SandboxPolicyCommon(aBroker, ShmemUsage::MAY_CREATE, -- AllowUnsafeSocketPair::NO) {} -+ explicit UtilitySandboxPolicy(SandboxBrokerClient* aBroker) { -+ mBroker = aBroker; -+ mMayCreateShmem = true; -+ } - - ResultExpr PrctlPolicy() const override { - Arg op(0); diff --git a/D146272.diff b/D146272.diff deleted file mode 100644 index 0a2c749..0000000 --- a/D146272.diff +++ /dev/null @@ -1,373 +0,0 @@ -diff --git a/security/sandbox/linux/SandboxFilter.cpp b/security/sandbox/linux/SandboxFilter.cpp ---- a/security/sandbox/linux/SandboxFilter.cpp -+++ b/security/sandbox/linux/SandboxFilter.cpp -@@ -128,10 +128,11 @@ - // Subclasses can assign these in their constructors to loosen the - // default settings. - SandboxBrokerClient* mBroker = nullptr; - bool mMayCreateShmem = false; - bool mAllowUnsafeSocketPair = false; -+ bool mBrokeredConnect = false; // Can connect() be brokered? - - SandboxPolicyCommon() = default; - - typedef const sandbox::arch_seccomp_data& ArgsRef; - -@@ -533,10 +534,124 @@ - MOZ_CRASH("unreachable?"); - return -ENOSYS; - #endif - } - -+ // This just needs to return something to stand in for the -+ // unconnected socket until ConnectTrap, below, and keep track of -+ // the socket type somehow. Half a socketpair *is* a socket, so it -+ // should result in minimal confusion in the caller. -+ static intptr_t FakeSocketTrapCommon(int domain, int type, int protocol) { -+ int fds[2]; -+ // X11 client libs will still try to getaddrinfo() even for a -+ // local connection. Also, WebRTC still has vestigial network -+ // code trying to do things in the content process. Politely tell -+ // them no. -+ if (domain != AF_UNIX) { -+ return -EAFNOSUPPORT; -+ } -+ if (socketpair(domain, type, protocol, fds) != 0) { -+ return -errno; -+ } -+ close(fds[1]); -+ return fds[0]; -+ } -+ -+ static intptr_t FakeSocketTrap(ArgsRef aArgs, void* aux) { -+ return FakeSocketTrapCommon(static_cast(aArgs.args[0]), -+ static_cast(aArgs.args[1]), -+ static_cast(aArgs.args[2])); -+ } -+ -+ static intptr_t FakeSocketTrapLegacy(ArgsRef aArgs, void* aux) { -+ const auto innerArgs = reinterpret_cast(aArgs.args[1]); -+ -+ return FakeSocketTrapCommon(static_cast(innerArgs[0]), -+ static_cast(innerArgs[1]), -+ static_cast(innerArgs[2])); -+ } -+ -+ static Maybe DoGetSockOpt(int fd, int optname) { -+ int optval; -+ socklen_t optlen = sizeof(optval); -+ -+ if (getsockopt(fd, SOL_SOCKET, optname, &optval, &optlen) != 0) { -+ return Nothing(); -+ } -+ MOZ_RELEASE_ASSERT(static_cast(optlen) == sizeof(optval)); -+ return Some(optval); -+ } -+ -+ // Substitute the newly connected socket from the broker for the -+ // original socket. This is meant to be used on a fd from -+ // FakeSocketTrap, above, but it should also work to simulate -+ // re-connect()ing a real connected socket. -+ // -+ // Warning: This isn't quite right if the socket is dup()ed, because -+ // other duplicates will still be the original socket, but hopefully -+ // nothing we're dealing with does that. -+ static intptr_t ConnectTrapCommon(SandboxBrokerClient* aBroker, int aFd, -+ const struct sockaddr_un* aAddr, -+ socklen_t aLen) { -+ if (aFd < 0) { -+ return -EBADF; -+ } -+ const auto maybeDomain = DoGetSockOpt(aFd, SO_DOMAIN); -+ if (!maybeDomain) { -+ return -errno; -+ } -+ if (*maybeDomain != AF_UNIX) { -+ return -EAFNOSUPPORT; -+ } -+ const auto maybeType = DoGetSockOpt(aFd, SO_TYPE); -+ if (!maybeType) { -+ return -errno; -+ } -+ const int oldFlags = fcntl(aFd, F_GETFL); -+ if (oldFlags == -1) { -+ return -errno; -+ } -+ const int newFd = aBroker->Connect(aAddr, aLen, *maybeType); -+ if (newFd < 0) { -+ return newFd; -+ } -+ // Copy over the nonblocking flag. The connect() won't be -+ // nonblocking in that case, but that shouldn't matter for -+ // AF_UNIX. The other fcntl-settable flags are either irrelevant -+ // for sockets (e.g., O_APPEND) or would be blocked by this -+ // seccomp-bpf policy, so they're ignored. -+ if (fcntl(newFd, F_SETFL, oldFlags & O_NONBLOCK) != 0) { -+ close(newFd); -+ return -errno; -+ } -+ if (dup2(newFd, aFd) < 0) { -+ close(newFd); -+ return -errno; -+ } -+ close(newFd); -+ return 0; -+ } -+ -+ static intptr_t ConnectTrap(ArgsRef aArgs, void* aux) { -+ typedef const struct sockaddr_un* AddrPtr; -+ -+ return ConnectTrapCommon(static_cast(aux), -+ static_cast(aArgs.args[0]), -+ reinterpret_cast(aArgs.args[1]), -+ static_cast(aArgs.args[2])); -+ } -+ -+ static intptr_t ConnectTrapLegacy(ArgsRef aArgs, void* aux) { -+ const auto innerArgs = reinterpret_cast(aArgs.args[1]); -+ typedef const struct sockaddr_un* AddrPtr; -+ -+ return ConnectTrapCommon(static_cast(aux), -+ static_cast(innerArgs[0]), -+ reinterpret_cast(innerArgs[1]), -+ static_cast(innerArgs[2])); -+ } -+ - public: - ResultExpr InvalidSyscall() const override { - return Trap(BlockedSyscallTrap, nullptr); - } - -@@ -630,15 +745,37 @@ - return Some(Allow()); - } - Arg level(1), optname(2); - // SO_SNDBUF is used by IPC to avoid constructing - // unnecessarily large gather arrays for `sendmsg`. -- return Some( -- If(AllOf(level == SOL_SOCKET, optname == SO_SNDBUF), Allow()) -- .Else(InvalidSyscall())); -+ // -+ // SO_DOMAIN and SO_TYPE are needed for connect() brokering, -+ // but they're harmless even when it's not enabled. -+ return Some(If(AllOf(level == SOL_SOCKET, -+ AnyOf(optname == SO_SNDBUF, optname == SO_DOMAIN, -+ optname == SO_TYPE)), -+ Allow()) -+ .Else(InvalidSyscall())); - } - -+ // These two cases are for connect() brokering, if enabled. -+ case SYS_SOCKET: -+ if (mBrokeredConnect) { -+ const auto trapFn = aHasArgs ? FakeSocketTrap : FakeSocketTrapLegacy; -+ MOZ_ASSERT(mBroker); -+ return Some(Trap(trapFn, mBroker)); -+ } -+ return Nothing(); -+ -+ case SYS_CONNECT: -+ if (mBrokeredConnect) { -+ const auto trapFn = aHasArgs ? ConnectTrap : ConnectTrapLegacy; -+ MOZ_ASSERT(mBroker); -+ return Some(Trap(trapFn, mBroker)); -+ } -+ return Nothing(); -+ - default: - return Nothing(); - } - } - -@@ -1006,10 +1143,16 @@ - return If(AnyOf(request == TCGETS, request == TIOCGWINSZ), - Error(ENOTTY)) - .Else(SandboxPolicyBase::EvaluateSyscall(sysno)); - } - -+ CASES_FOR_dup2: // See ConnectTrapCommon -+ if (mBrokeredConnect) { -+ return Allow(); -+ } -+ return SandboxPolicyBase::EvaluateSyscall(sysno); -+ - #ifdef MOZ_ASAN - // ASAN's error reporter wants to know if stderr is a tty. - case __NR_ioctl: { - Arg fd(0); - return If(fd == STDERR_FILENO, Error(ENOTTY)).Else(InvalidSyscall()); -@@ -1093,133 +1236,20 @@ - - close(fd); - return rv; - } - -- // This just needs to return something to stand in for the -- // unconnected socket until ConnectTrap, below, and keep track of -- // the socket type somehow. Half a socketpair *is* a socket, so it -- // should result in minimal confusion in the caller. -- static intptr_t FakeSocketTrapCommon(int domain, int type, int protocol) { -- int fds[2]; -- // X11 client libs will still try to getaddrinfo() even for a -- // local connection. Also, WebRTC still has vestigial network -- // code trying to do things in the content process. Politely tell -- // them no. -- if (domain != AF_UNIX) { -- return -EAFNOSUPPORT; -- } -- if (socketpair(domain, type, protocol, fds) != 0) { -- return -errno; -- } -- close(fds[1]); -- return fds[0]; -- } -- -- static intptr_t FakeSocketTrap(ArgsRef aArgs, void* aux) { -- return FakeSocketTrapCommon(static_cast(aArgs.args[0]), -- static_cast(aArgs.args[1]), -- static_cast(aArgs.args[2])); -- } -- -- static intptr_t FakeSocketTrapLegacy(ArgsRef aArgs, void* aux) { -- const auto innerArgs = reinterpret_cast(aArgs.args[1]); -- -- return FakeSocketTrapCommon(static_cast(innerArgs[0]), -- static_cast(innerArgs[1]), -- static_cast(innerArgs[2])); -- } -- -- static Maybe DoGetSockOpt(int fd, int optname) { -- int optval; -- socklen_t optlen = sizeof(optval); -- -- if (getsockopt(fd, SOL_SOCKET, optname, &optval, &optlen) != 0) { -- return Nothing(); -- } -- MOZ_RELEASE_ASSERT(static_cast(optlen) == sizeof(optval)); -- return Some(optval); -- } -- -- // Substitute the newly connected socket from the broker for the -- // original socket. This is meant to be used on a fd from -- // FakeSocketTrap, above, but it should also work to simulate -- // re-connect()ing a real connected socket. -- // -- // Warning: This isn't quite right if the socket is dup()ed, because -- // other duplicates will still be the original socket, but hopefully -- // nothing we're dealing with does that. -- static intptr_t ConnectTrapCommon(SandboxBrokerClient* aBroker, int aFd, -- const struct sockaddr_un* aAddr, -- socklen_t aLen) { -- if (aFd < 0) { -- return -EBADF; -- } -- const auto maybeDomain = DoGetSockOpt(aFd, SO_DOMAIN); -- if (!maybeDomain) { -- return -errno; -- } -- if (*maybeDomain != AF_UNIX) { -- return -EAFNOSUPPORT; -- } -- const auto maybeType = DoGetSockOpt(aFd, SO_TYPE); -- if (!maybeType) { -- return -errno; -- } -- const int oldFlags = fcntl(aFd, F_GETFL); -- if (oldFlags == -1) { -- return -errno; -- } -- const int newFd = aBroker->Connect(aAddr, aLen, *maybeType); -- if (newFd < 0) { -- return newFd; -- } -- // Copy over the nonblocking flag. The connect() won't be -- // nonblocking in that case, but that shouldn't matter for -- // AF_UNIX. The other fcntl-settable flags are either irrelevant -- // for sockets (e.g., O_APPEND) or would be blocked by this -- // seccomp-bpf policy, so they're ignored. -- if (fcntl(newFd, F_SETFL, oldFlags & O_NONBLOCK) != 0) { -- close(newFd); -- return -errno; -- } -- if (dup2(newFd, aFd) < 0) { -- close(newFd); -- return -errno; -- } -- close(newFd); -- return 0; -- } -- -- static intptr_t ConnectTrap(ArgsRef aArgs, void* aux) { -- typedef const struct sockaddr_un* AddrPtr; -- -- return ConnectTrapCommon(static_cast(aux), -- static_cast(aArgs.args[0]), -- reinterpret_cast(aArgs.args[1]), -- static_cast(aArgs.args[2])); -- } -- -- static intptr_t ConnectTrapLegacy(ArgsRef aArgs, void* aux) { -- const auto innerArgs = reinterpret_cast(aArgs.args[1]); -- typedef const struct sockaddr_un* AddrPtr; -- -- return ConnectTrapCommon(static_cast(aux), -- static_cast(innerArgs[0]), -- reinterpret_cast(innerArgs[1]), -- static_cast(innerArgs[2])); -- } -- - public: - ContentSandboxPolicy(SandboxBrokerClient* aBroker, - ContentProcessSandboxParams&& aParams) - : mParams(std::move(aParams)), - mAllowSysV(PR_GetEnv("MOZ_SANDBOX_ALLOW_SYSV") != nullptr), - mUsingRenderDoc(PR_GetEnv("RENDERDOC_CAPTUREOPTS") != nullptr) { - mBroker = aBroker; - mMayCreateShmem = true; - mAllowUnsafeSocketPair = true; -+ mBrokeredConnect = true; - } - - ~ContentSandboxPolicy() override = default; - - Maybe EvaluateSocketCall(int aCall, -@@ -1232,18 +1262,16 @@ - - #ifdef ANDROID - case SYS_SOCKET: - return Some(Error(EACCES)); - #else // #ifdef DESKTOP -- case SYS_SOCKET: { -- const auto trapFn = aHasArgs ? FakeSocketTrap : FakeSocketTrapLegacy; -- return Some(AllowBelowLevel(4, Trap(trapFn, nullptr))); -- } -- case SYS_CONNECT: { -- const auto trapFn = aHasArgs ? ConnectTrap : ConnectTrapLegacy; -- return Some(AllowBelowLevel(4, Trap(trapFn, mBroker))); -- } -+ case SYS_SOCKET: -+ case SYS_CONNECT: -+ if (BelowLevel(4)) { -+ return Some(Allow()); -+ } -+ return SandboxPolicyCommon::EvaluateSocketCall(aCall, aHasArgs); - case SYS_RECV: - case SYS_SEND: - case SYS_GETSOCKOPT: - case SYS_SETSOCKOPT: - case SYS_GETSOCKNAME: -@@ -1458,13 +1486,10 @@ - - case __NR_getrusage: - case __NR_times: - return Allow(); - -- CASES_FOR_dup2: // See ConnectTrapCommon -- return Allow(); -- - case __NR_fsync: - case __NR_msync: - return Allow(); - - case __NR_getpriority: - diff --git a/D146273.diff b/D146273.diff deleted file mode 100644 index 0d838e2..0000000 --- a/D146273.diff +++ /dev/null @@ -1,90 +0,0 @@ -diff --git a/security/sandbox/linux/SandboxFilter.cpp b/security/sandbox/linux/SandboxFilter.cpp ---- a/security/sandbox/linux/SandboxFilter.cpp -+++ b/security/sandbox/linux/SandboxFilter.cpp -@@ -699,10 +699,18 @@ - Maybe EvaluateSocketCall(int aCall, - bool aHasArgs) const override { - switch (aCall) { - case SYS_RECVMSG: - case SYS_SENDMSG: -+ // These next four aren't needed for IPC or other core -+ // functionality at the time of this writing, but they're -+ // subsets of recvmsg/sendmsg so there's nothing gained by not -+ // allowing them here (and simplifying subclasses). -+ case SYS_RECVFROM: -+ case SYS_SENDTO: -+ case SYS_RECV: -+ case SYS_SEND: - return Some(Allow()); - - case SYS_SOCKETPAIR: { - // We try to allow "safe" (always connected) socketpairs when using the - // file broker, or for content processes, but we may need to fall back -@@ -1253,12 +1261,10 @@ - ~ContentSandboxPolicy() override = default; - - Maybe EvaluateSocketCall(int aCall, - bool aHasArgs) const override { - switch (aCall) { -- case SYS_RECVFROM: -- case SYS_SENDTO: - case SYS_SENDMMSG: // libresolv via libasyncns; see bug 1355274 - return Some(Allow()); - - #ifdef ANDROID - case SYS_SOCKET: -@@ -1268,18 +1274,21 @@ - case SYS_CONNECT: - if (BelowLevel(4)) { - return Some(Allow()); - } - return SandboxPolicyCommon::EvaluateSocketCall(aCall, aHasArgs); -- case SYS_RECV: -- case SYS_SEND: -+ -+ // FIXME (bug 1761134): sockopts should be filtered - case SYS_GETSOCKOPT: - case SYS_SETSOCKOPT: -+ // These next 3 were needed for X11; they may not be needed -+ // with X11 lockdown, but there's not much attack surface here. - case SYS_GETSOCKNAME: - case SYS_GETPEERNAME: - case SYS_SHUTDOWN: - return Some(Allow()); -+ - case SYS_ACCEPT: - case SYS_ACCEPT4: - if (mUsingRenderDoc) { - return Some(Allow()); - } -@@ -1908,26 +1917,19 @@ - } - - Maybe EvaluateSocketCall(int aCall, - bool aHasArgs) const override { - switch (aCall) { -+ case SYS_SOCKET: -+ case SYS_CONNECT: - case SYS_BIND: - return Some(Allow()); - -- case SYS_SOCKET: -- return Some(Allow()); -- -- case SYS_CONNECT: -- return Some(Allow()); -- -- case SYS_RECVFROM: -- case SYS_SENDTO: -+ // FIXME(bug 1641401) do we really need this? - case SYS_SENDMMSG: - return Some(Allow()); - -- case SYS_RECV: -- case SYS_SEND: - case SYS_GETSOCKOPT: - case SYS_SETSOCKOPT: - case SYS_GETSOCKNAME: - case SYS_GETPEERNAME: - case SYS_SHUTDOWN: - diff --git a/D146274.diff b/D146274.diff deleted file mode 100644 index 8943ac4..0000000 --- a/D146274.diff +++ /dev/null @@ -1,158 +0,0 @@ -diff --git a/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp b/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp ---- a/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp -+++ b/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp -@@ -325,30 +325,84 @@ - policy->AddDynamic(perms, trimPath.get()); - } - } - } - -+static void AddX11Dependencies(SandboxBroker::Policy* policy) { -+ // Allow Primus to contact the Bumblebee daemon to manage GPU -+ // switching on NVIDIA Optimus systems. -+ const char* bumblebeeSocket = PR_GetEnv("BUMBLEBEE_SOCKET"); -+ if (bumblebeeSocket == nullptr) { -+ bumblebeeSocket = "/var/run/bumblebee.socket"; -+ } -+ policy->AddPath(SandboxBroker::MAY_CONNECT, bumblebeeSocket); -+ -+#if defined(MOZ_WIDGET_GTK) && defined(MOZ_X11) -+ // Allow local X11 connections, for several purposes: -+ // -+ // * for content processes to use WebGL when the browser is in headless -+ // mode, by opening the X display if/when needed -+ // -+ // * if Primus or VirtualGL is used, to contact the secondary X server -+ static const bool kIsX11 = -+ !mozilla::widget::GdkIsWaylandDisplay() && PR_GetEnv("DISPLAY"); -+ if (kIsX11) { -+ policy->AddPrefix(SandboxBroker::MAY_CONNECT, "/tmp/.X11-unix/X"); -+ if (auto* const xauth = PR_GetEnv("XAUTHORITY")) { -+ policy->AddPath(rdonly, xauth); -+ } else if (auto* const home = PR_GetEnv("HOME")) { -+ // This follows the logic in libXau: append "/.Xauthority", -+ // even if $HOME ends in a slash, except in the special case -+ // where HOME=/ because POSIX allows implementations to treat -+ // an initial double slash specially. -+ nsAutoCString xauth(home); -+ if (xauth != "/"_ns) { -+ xauth.Append('/'); -+ } -+ xauth.AppendLiteral(".Xauthority"); -+ policy->AddPath(rdonly, xauth.get()); -+ } -+ } -+#endif -+} -+ -+static void AddGLDependencies(SandboxBroker::Policy* policy) { -+ // Devices -+ policy->AddDir(rdwr, "/dev/dri"); -+ policy->AddFilePrefix(rdwr, "/dev", "nvidia"); -+ -+ // Hardware info -+ AddDriPaths(policy); -+ -+ // /etc and /usr/share (glvnd, libdrm, drirc, ...?) -+ policy->AddDir(rdonly, "/etc"); -+ policy->AddDir(rdonly, "/usr/share"); -+ policy->AddDir(rdonly, "/usr/local/share"); -+ -+ // Note: This function doesn't do anything about Mesa's shader -+ // cache, because the details can vary by process type, including -+ // whether caching is enabled. -+ -+ AddX11Dependencies(policy); -+} -+ - void SandboxBrokerPolicyFactory::InitContentPolicy() { - const bool headless = - StaticPrefs::security_sandbox_content_headless_AtStartup(); - - // Policy entries that are the same in every process go here, and - // are cached over the lifetime of the factory. - SandboxBroker::Policy* policy = new SandboxBroker::Policy; - // Write permssions -- // -- if (!headless) { -- // Bug 1308851: NVIDIA proprietary driver when using WebGL -- policy->AddFilePrefix(rdwr, "/dev", "nvidia"); -- -- // Bug 1312678: Mesa with DRI when using WebGL -- policy->AddDir(rdwr, "/dev/dri"); -- } - - // Bug 1575985: WASM library sandbox needs RW access to /dev/null - policy->AddPath(rdwr, "/dev/null"); - -+ if (!headless) { -+ AddGLDependencies(policy); -+ } -+ - // Read permissions - policy->AddPath(rdonly, "/dev/urandom"); - policy->AddPath(rdonly, "/dev/random"); - policy->AddPath(rdonly, "/proc/sys/crypto/fips_enabled"); - policy->AddPath(rdonly, "/proc/cpuinfo"); -@@ -370,13 +424,10 @@ - policy->AddDir(rdonly, "/run/host/fonts"); - policy->AddDir(rdonly, "/run/host/user-fonts"); - policy->AddDir(rdonly, "/run/host/local-fonts"); - policy->AddDir(rdonly, "/var/cache/fontconfig"); - -- if (!headless) { -- AddDriPaths(policy); -- } - AddLdconfigPaths(policy); - AddLdLibraryEnvPaths(policy); - - if (!headless) { - // Bug 1385715: NVIDIA PRIME support -@@ -569,45 +620,11 @@ - } - } - #endif - - if (!headless) { -- // Allow Primus to contact the Bumblebee daemon to manage GPU -- // switching on NVIDIA Optimus systems. -- const char* bumblebeeSocket = PR_GetEnv("BUMBLEBEE_SOCKET"); -- if (bumblebeeSocket == nullptr) { -- bumblebeeSocket = "/var/run/bumblebee.socket"; -- } -- policy->AddPath(SandboxBroker::MAY_CONNECT, bumblebeeSocket); -- --#if defined(MOZ_WIDGET_GTK) && defined(MOZ_X11) -- // Allow local X11 connections, for several purposes: -- // -- // * for content processes to use WebGL when the browser is in headless -- // mode, by opening the X display if/when needed -- // -- // * if Primus or VirtualGL is used, to contact the secondary X server -- static const bool kIsX11 = -- !mozilla::widget::GdkIsWaylandDisplay() && PR_GetEnv("DISPLAY"); -- if (kIsX11) { -- policy->AddPrefix(SandboxBroker::MAY_CONNECT, "/tmp/.X11-unix/X"); -- if (auto* const xauth = PR_GetEnv("XAUTHORITY")) { -- policy->AddPath(rdonly, xauth); -- } else if (auto* const home = PR_GetEnv("HOME")) { -- // This follows the logic in libXau: append "/.Xauthority", -- // even if $HOME ends in a slash, except in the special case -- // where HOME=/ because POSIX allows implementations to treat -- // an initial double slash specially. -- nsAutoCString xauth(home); -- if (xauth != "/"_ns) { -- xauth.Append('/'); -- } -- xauth.AppendLiteral(".Xauthority"); -- policy->AddPath(rdonly, xauth.get()); -- } -- } --#endif -+ AddX11Dependencies(policy); - } - - // Bug 1732580: when packaged as a strictly confined snap, may need - // read-access to configuration files under $SNAP/. - const char* snap = PR_GetEnv("SNAP"); - diff --git a/D146275.diff b/D146275.diff deleted file mode 100644 index 989b317..0000000 --- a/D146275.diff +++ /dev/null @@ -1,125 +0,0 @@ -diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp ---- a/ipc/glue/GeckoChildProcessHost.cpp -+++ b/ipc/glue/GeckoChildProcessHost.cpp -@@ -418,10 +418,17 @@ - nsresult rv = NS_GetSpecialDirectory(NS_APP_CONTENT_PROCESS_TEMP_DIR, - getter_AddRefs(contentTempDir)); - if (NS_SUCCEEDED(rv)) { - contentTempDir->GetNativePath(mTmpDirName); - } -+ } else if (aProcessType == GeckoProcessType_RDD) { -+ // The RDD process makes limited use of EGL. If Mesa's shader -+ // cache is enabled and the directory isn't explicitly set, then -+ // it will try to getpwuid() the user which can cause problems -+ // with sandboxing. Because we shouldn't need shader caching in -+ // this process, we just disable the cache to prevent that. -+ mLaunchOptions->env_map["MESA_GLSL_CACHE_DISABLE"] = "true"; - } - #endif - #if defined(MOZ_ENABLE_FORKSERVER) - if (aProcessType == GeckoProcessType_Content && ForkServiceChild::Get()) { - mLaunchOptions->use_forkserver = true; -diff --git a/security/sandbox/common/test/SandboxTestingChildTests.h b/security/sandbox/common/test/SandboxTestingChildTests.h ---- a/security/sandbox/common/test/SandboxTestingChildTests.h -+++ b/security/sandbox/common/test/SandboxTestingChildTests.h -@@ -21,14 +21,16 @@ - # include - # include - # include - # include - # include -+# include - # include - # include - # include - # include "mozilla/ProcInfo_linux.h" -+# include "mozilla/UniquePtrExtensions.h" - # ifdef MOZ_X11 - # include "X11/Xlib.h" - # include "X11UndefineNone.h" - # endif // MOZ_X11 - # endif // XP_LINUX -@@ -595,12 +597,25 @@ - return rv; - }); - - RunTestsSched(child); - -- child->ErrnoTest("socket"_ns, false, -- [] { return socket(AF_UNIX, SOCK_STREAM, 0); }); -+ child->ErrnoTest("socket_inet"_ns, false, -+ [] { return socket(AF_INET, SOCK_STREAM, 0); }); -+ -+ { -+ UniqueFileHandle fd(socket(AF_UNIX, SOCK_STREAM, 0)); -+ child->ErrnoTest("socket_unix"_ns, true, [&] { return fd.get(); }); -+ -+ struct sockaddr_un sun {}; -+ sun.sun_family = AF_UNIX; -+ strncpy(sun.sun_path, "/tmp/forbidden-sock", sizeof(sun.sun_path)); -+ -+ child->ErrnoValueTest("socket_unix_bind"_ns, ENOSYS, [&] { -+ return bind(fd.get(), (struct sockaddr*)&sun, sizeof(sun)); -+ }); -+ } - - child->ErrnoTest("uname"_ns, true, [] { - struct utsname uts; - return uname(&uts); - }); -diff --git a/security/sandbox/linux/SandboxFilter.cpp b/security/sandbox/linux/SandboxFilter.cpp ---- a/security/sandbox/linux/SandboxFilter.cpp -+++ b/security/sandbox/linux/SandboxFilter.cpp -@@ -1783,10 +1783,11 @@ - class RDDSandboxPolicy final : public SandboxPolicyCommon { - public: - explicit RDDSandboxPolicy(SandboxBrokerClient* aBroker) { - mBroker = aBroker; - mMayCreateShmem = true; -+ mBrokeredConnect = true; - } - - #ifndef ANDROID - Maybe EvaluateIpcCall(int aCall, int aArgShift) const override { - // The Intel media driver uses SysV IPC (semaphores and shared -@@ -1818,15 +1819,15 @@ - #endif - - Maybe EvaluateSocketCall(int aCall, - bool aHasArgs) const override { - switch (aCall) { -- // Mesa can call getpwuid_r to get the home dir, which can try -- // to connect to nscd (or maybe servers like NIS or LDAP); this -- // can't be safely allowed, but we can quietly deny it. -- case SYS_SOCKET: -- return Some(Error(EACCES)); -+ // These are for X11. -+ case SYS_GETSOCKNAME: -+ case SYS_GETPEERNAME: -+ case SYS_SHUTDOWN: -+ return Some(Allow()); - - default: - return SandboxPolicyCommon::EvaluateSocketCall(aCall, aHasArgs); - } - } -diff --git a/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp b/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp ---- a/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp -+++ b/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp -@@ -853,13 +853,12 @@ - if (developer_repo_dir) { - policy->AddDir(rdonly, developer_repo_dir); - } - } - -- // VA-API needs DRI and GPU detection -- policy->AddDir(rdwr, "/dev/dri"); -- AddDriPaths(policy.get()); -+ // VA-API needs GPU access and GL context creation -+ AddGLDependencies(policy.get()); - - // FFmpeg and GPU drivers may need general-case library loading - AddLdconfigPaths(policy.get()); - AddLdLibraryEnvPaths(policy.get()); - - diff --git a/D147635.diff b/D147635.diff deleted file mode 100644 index 1d4bb58..0000000 --- a/D147635.diff +++ /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/D147636.diff b/D147636.diff deleted file mode 100644 index 52462f2..0000000 --- a/D147636.diff +++ /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 CreateDMABufSurface( - int aWidth, int aHeight, int aDMABufSurfaceFlags); - -+ static already_AddRefed 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 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 DMABufSurfaceRGBA::CreateDMABufSurface( -+ mozilla::gl::GLContext* aGLContext, const EGLImageKHR aEGLImage, int aWidth, -+ int aHeight) { -+ RefPtr surf = new DMABufSurfaceRGBA(); -+ if (!surf->Create(aGLContext, aEGLImage, aWidth, aHeight)) { -+ return nullptr; -+ } -+ return surf.forget(); -+} -+ - already_AddRefed DMABufSurfaceYUV::CreateYUVSurface( - const VADRMPRIMESurfaceDescriptor& aDesc, int aWidth, int aHeight) { - RefPtr surf = new DMABufSurfaceYUV(); - LOGDMABUF(("DMABufSurfaceYUV::CreateYUVSurface() UID %d from desc\n", - surf->GetUID())); - diff --git a/D147637.diff b/D147637.diff deleted file mode 100644 index 89bb25e..0000000 --- a/D147637.diff +++ /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::Create( - const SharedSurfaceDesc& desc) { -- const auto flags = static_cast( -- DMABUF_TEXTURE | DMABUF_USE_MODIFIERS | DMABUF_ALPHA); -- const RefPtr 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 surface; -+ UniquePtr 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( -+ 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(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 Surface - } - - auto dmabufFactory = MakeUnique(gl); -- if (dmabufFactory->CanCreateSurface()) { -+ if (dmabufFactory->CanCreateSurface(gl)) { - return dmabufFactory; - } - -@@ -71,8 +104,38 @@ UniquePtr Surface - return nullptr; - } - -+bool SurfaceFactory_DMABUF::CanCreateSurface(GLContext& gl) { -+ UniquePtr 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 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 test = -- CreateShared(gfx::IntSize(1, 1), gfx::ColorSpace2::SRGB); -- return test != nullptr; -- } -+ bool CanCreateSurface(GLContext& gl); - }; - - } // namespace gl diff --git a/D147874.diff b/D147874.diff deleted file mode 100644 index f0c57dd..0000000 --- a/D147874.diff +++ /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& 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/D148946.diff b/D148946.diff deleted file mode 100644 index 0ab7380..0000000 --- a/D148946.diff +++ /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::Creat - } - - /*static*/ --RefPtr GLContextEGL::CreateEGLSurfacelessContext( -- const std::shared_ptr display, const GLContextCreateDesc& desc, -- nsACString* const out_failureId) { -- const EGLConfig config = {}; -- auto fullDesc = GLContextDesc{desc}; -- fullDesc.isOffscreen = true; -- RefPtr 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 GLContextProviderEGL::CreateHeadless( - const GLContextCreateDesc& desc, nsACString* const out_failureId) { - const auto display = DefaultEglDisplay(out_failureId); - if (!display) { - return nullptr; - } -- RefPtr 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: - - // 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 GetAn - } - - #ifdef MOZ_WAYLAND -+static std::shared_ptr 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 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 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 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/D149135.diff b/D149135.diff deleted file mode 100644 index 6e93f2b..0000000 --- a/D149135.diff +++ /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/D149238.diff b/D149238.diff deleted file mode 100644 index e89c1bf..0000000 --- a/D149238.diff +++ /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/build-cubeb-pulse-arm.patch b/build-cubeb-pulse-arm.patch deleted file mode 100644 index 008208c..0000000 --- a/build-cubeb-pulse-arm.patch +++ /dev/null @@ -1,4946 +0,0 @@ -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/Cargo.toml.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/Cargo.toml ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/Cargo.toml.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/Cargo.toml 2017-08-04 13:37:46.383821740 +0200 -@@ -7,7 +7,11 @@ description = "Cubeb backed for PulseAud - [features] - pulse-dlopen = ["pulse-ffi/dlopen"] - -+[lib] -+crate-type = ["staticlib", "rlib"] -+ - [dependencies] - cubeb-ffi = { path = "cubeb-ffi" } - pulse-ffi = { path = "pulse-ffi" } -+pulse = { path = "pulse-rs" } - semver = "^0.6" -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/cubeb-ffi/src/ffi.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/cubeb-ffi/src/ffi.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/cubeb-ffi/src/ffi.rs.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/cubeb-ffi/src/ffi.rs 2017-08-04 13:37:46.384821737 +0200 -@@ -11,45 +11,45 @@ pub enum Context {} - pub enum Stream {} - - // These need to match cubeb_sample_format --pub const SAMPLE_S16LE: c_int = 0; --pub const SAMPLE_S16BE: c_int = 1; --pub const SAMPLE_FLOAT32LE: c_int = 2; --pub const SAMPLE_FLOAT32BE: c_int = 3; - pub type SampleFormat = c_int; -+pub const SAMPLE_S16LE: SampleFormat = 0; -+pub const SAMPLE_S16BE: SampleFormat = 1; -+pub const SAMPLE_FLOAT32LE: SampleFormat = 2; -+pub const SAMPLE_FLOAT32BE: SampleFormat = 3; - - #[cfg(target_endian = "little")] --pub const SAMPLE_S16NE: c_int = SAMPLE_S16LE; -+pub const SAMPLE_S16NE: SampleFormat = SAMPLE_S16LE; - #[cfg(target_endian = "little")] --pub const SAMPLE_FLOAT32NE: c_int = SAMPLE_FLOAT32LE; -+pub const SAMPLE_FLOAT32NE: SampleFormat = SAMPLE_FLOAT32LE; - #[cfg(target_endian = "big")] --pub const SAMPLE_S16NE: c_int = SAMPLE_S16BE; -+pub const SAMPLE_S16NE: SampleFormat = SAMPLE_S16BE; - #[cfg(target_endian = "big")] --pub const SAMPLE_FLOAT32NE: c_int = SAMPLE_FLOAT32BE; -+pub const SAMPLE_FLOAT32NE: SampleFormat = SAMPLE_FLOAT32BE; - - pub type DeviceId = *const c_void; - - // These need to match cubeb_channel_layout --pub const LAYOUT_UNDEFINED: c_int = 0; --pub const LAYOUT_DUAL_MONO: c_int = 1; --pub const LAYOUT_DUAL_MONO_LFE: c_int = 2; --pub const LAYOUT_MONO: c_int = 3; --pub const LAYOUT_MONO_LFE: c_int = 4; --pub const LAYOUT_STEREO: c_int = 5; --pub const LAYOUT_STEREO_LFE: c_int = 6; --pub const LAYOUT_3F: c_int = 7; --pub const LAYOUT_3F_LFE: c_int = 8; --pub const LAYOUT_2F1: c_int = 9; --pub const LAYOUT_2F1_LFE: c_int = 10; --pub const LAYOUT_3F1: c_int = 11; --pub const LAYOUT_3F1_LFE: c_int = 12; --pub const LAYOUT_2F2: c_int = 13; --pub const LAYOUT_2F2_LFE: c_int = 14; --pub const LAYOUT_3F2: c_int = 15; --pub const LAYOUT_3F2_LFE: c_int = 16; --pub const LAYOUT_3F3R_LFE: c_int = 17; --pub const LAYOUT_3F4_LFE: c_int = 18; --pub const LAYOUT_MAX: c_int = 19; - pub type ChannelLayout = c_int; -+pub const LAYOUT_UNDEFINED: ChannelLayout = 0; -+pub const LAYOUT_DUAL_MONO: ChannelLayout = 1; -+pub const LAYOUT_DUAL_MONO_LFE: ChannelLayout = 2; -+pub const LAYOUT_MONO: ChannelLayout = 3; -+pub const LAYOUT_MONO_LFE: ChannelLayout = 4; -+pub const LAYOUT_STEREO: ChannelLayout = 5; -+pub const LAYOUT_STEREO_LFE: ChannelLayout = 6; -+pub const LAYOUT_3F: ChannelLayout = 7; -+pub const LAYOUT_3F_LFE: ChannelLayout = 8; -+pub const LAYOUT_2F1: ChannelLayout = 9; -+pub const LAYOUT_2F1_LFE: ChannelLayout = 10; -+pub const LAYOUT_3F1: ChannelLayout = 11; -+pub const LAYOUT_3F1_LFE: ChannelLayout = 12; -+pub const LAYOUT_2F2: ChannelLayout = 13; -+pub const LAYOUT_2F2_LFE: ChannelLayout = 14; -+pub const LAYOUT_3F2: ChannelLayout = 15; -+pub const LAYOUT_3F2_LFE: ChannelLayout = 16; -+pub const LAYOUT_3F3R_LFE: ChannelLayout = 17; -+pub const LAYOUT_3F4_LFE: ChannelLayout = 18; -+pub const LAYOUT_MAX: ChannelLayout = 256; - - #[repr(C)] - #[derive(Clone, Copy, Debug)] -@@ -77,11 +77,11 @@ impl Default for Device { - } - - // These need to match cubeb_state --pub const STATE_STARTED: c_int = 0; --pub const STATE_STOPPED: c_int = 1; --pub const STATE_DRAINED: c_int = 2; --pub const STATE_ERROR: c_int = 3; - pub type State = c_int; -+pub const STATE_STARTED: State = 0; -+pub const STATE_STOPPED: State = 1; -+pub const STATE_DRAINED: State = 2; -+pub const STATE_ERROR: State = 3; - - pub const OK: i32 = 0; - pub const ERROR: i32 = -1; -@@ -249,32 +249,42 @@ pub struct LayoutMap { - } - - // cubeb_mixer.h -+pub type Channel = c_int; - - // These need to match cubeb_channel --pub const CHANNEL_INVALID: c_int = -1; --pub const CHANNEL_MONO: c_int = 0; --pub const CHANNEL_LEFT: c_int = 1; --pub const CHANNEL_RIGHT: c_int = 2; --pub const CHANNEL_CENTER: c_int = 3; --pub const CHANNEL_LS: c_int = 4; --pub const CHANNEL_RS: c_int = 5; --pub const CHANNEL_RLS: c_int = 6; --pub const CHANNEL_RCENTER: c_int = 7; --pub const CHANNEL_RRS: c_int = 8; --pub const CHANNEL_LFE: c_int = 9; --pub const CHANNEL_MAX: c_int = 256; --pub type Channel = c_int; -+pub const CHANNEL_INVALID: Channel = -1; -+pub const CHANNEL_MONO: Channel = 0; -+pub const CHANNEL_LEFT: Channel = 1; -+pub const CHANNEL_RIGHT: Channel = 2; -+pub const CHANNEL_CENTER: Channel = 3; -+pub const CHANNEL_LS: Channel = 4; -+pub const CHANNEL_RS: Channel = 5; -+pub const CHANNEL_RLS: Channel = 6; -+pub const CHANNEL_RCENTER: Channel = 7; -+pub const CHANNEL_RRS: Channel = 8; -+pub const CHANNEL_LFE: Channel = 9; -+pub const CHANNEL_MAX: Channel = 10; - - #[repr(C)] -+#[derive(Clone, Copy, Debug)] - pub struct ChannelMap { - pub channels: c_uint, -- pub map: [Channel; 256], -+ pub map: [Channel; CHANNEL_MAX as usize], - } - impl ::std::default::Default for ChannelMap { - fn default() -> Self { - ChannelMap { - channels: 0, -- map: unsafe { ::std::mem::zeroed() }, -+ map: [CHANNEL_INVALID, -+ CHANNEL_INVALID, -+ CHANNEL_INVALID, -+ CHANNEL_INVALID, -+ CHANNEL_INVALID, -+ CHANNEL_INVALID, -+ CHANNEL_INVALID, -+ CHANNEL_INVALID, -+ CHANNEL_INVALID, -+ CHANNEL_INVALID], - } - } - } -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-ffi/src/ffi_funcs.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-ffi/src/ffi_funcs.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-ffi/src/ffi_funcs.rs.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-ffi/src/ffi_funcs.rs 2017-08-04 13:37:46.384821737 +0200 -@@ -8,8 +8,8 @@ macro_rules! cstr { - - #[cfg(not(feature = "dlopen"))] - mod static_fns { -- use std::os::raw::{c_char, c_double, c_int, c_float, c_uint, c_void}; - use super::*; -+ use std::os::raw::{c_char, c_double, c_float, c_int, c_uint, c_void}; - - #[link(name = "pulse")] - extern "C" { -@@ -62,6 +62,7 @@ mod static_fns { - userdata: *mut c_void) - -> *mut pa_operation; - pub fn pa_context_set_state_callback(c: *mut pa_context, cb: pa_context_notify_cb_t, userdata: *mut c_void); -+ pub fn pa_context_errno(c: *mut pa_context) -> c_int; - pub fn pa_context_set_subscribe_callback(c: *mut pa_context, - cb: pa_context_subscribe_cb_t, - userdata: *mut c_void); -@@ -70,6 +71,7 @@ mod static_fns { - cb: pa_context_success_cb_t, - userdata: *mut c_void) - -> *mut pa_operation; -+ pub fn pa_context_ref(c: *mut pa_context) -> *mut pa_context; - pub fn pa_context_unref(c: *mut pa_context); - pub fn pa_cvolume_set(a: *mut pa_cvolume, channels: c_uint, v: pa_volume_t) -> *mut pa_cvolume; - pub fn pa_cvolume_set_balance(v: *mut pa_cvolume, -@@ -80,12 +82,20 @@ mod static_fns { - pub fn pa_mainloop_api_once(m: *mut pa_mainloop_api, - callback: pa_mainloop_api_once_cb_t, - userdata: *mut c_void); -- pub fn pa_operation_get_state(o: *const pa_operation) -> pa_operation_state_t; -+ pub fn pa_strerror(error: pa_error_code_t) -> *const c_char; -+ pub fn pa_operation_ref(o: *mut pa_operation) -> *mut pa_operation; - pub fn pa_operation_unref(o: *mut pa_operation); -+ pub fn pa_operation_cancel(o: *mut pa_operation); -+ pub fn pa_operation_get_state(o: *const pa_operation) -> pa_operation_state_t; -+ pub fn pa_operation_set_state_callback(o: *mut pa_operation, -+ cb: pa_operation_notify_cb_t, -+ userdata: *mut c_void); - pub fn pa_proplist_gets(p: *mut pa_proplist, key: *const c_char) -> *const c_char; - pub fn pa_rtclock_now() -> pa_usec_t; - pub fn pa_stream_begin_write(p: *mut pa_stream, data: *mut *mut c_void, nbytes: *mut usize) -> c_int; - pub fn pa_stream_cancel_write(p: *mut pa_stream) -> c_int; -+ pub fn pa_stream_is_suspended(s: *const pa_stream) -> c_int; -+ pub fn pa_stream_is_corked(s: *const pa_stream) -> c_int; - pub fn pa_stream_connect_playback(s: *mut pa_stream, - dev: *const c_char, - attr: *const pa_buffer_attr, -@@ -112,6 +122,7 @@ mod static_fns { - pub fn pa_stream_get_latency(s: *const pa_stream, r_usec: *mut pa_usec_t, negative: *mut c_int) -> c_int; - pub fn pa_stream_get_sample_spec(s: *const pa_stream) -> *const pa_sample_spec; - pub fn pa_stream_get_state(p: *const pa_stream) -> pa_stream_state_t; -+ pub fn pa_stream_get_context(s: *const pa_stream) -> *mut pa_context; - pub fn pa_stream_get_time(s: *const pa_stream, r_usec: *mut pa_usec_t) -> c_int; - pub fn pa_stream_new(c: *mut pa_context, - name: *const c_char, -@@ -123,6 +134,7 @@ mod static_fns { - pub fn pa_stream_set_state_callback(s: *mut pa_stream, cb: pa_stream_notify_cb_t, userdata: *mut c_void); - pub fn pa_stream_set_write_callback(p: *mut pa_stream, cb: pa_stream_request_cb_t, userdata: *mut c_void); - pub fn pa_stream_set_read_callback(p: *mut pa_stream, cb: pa_stream_request_cb_t, userdata: *mut c_void); -+ pub fn pa_stream_ref(s: *mut pa_stream) -> *mut pa_stream; - pub fn pa_stream_unref(s: *mut pa_stream); - pub fn pa_stream_update_timing_info(p: *mut pa_stream, - cb: pa_stream_success_cb_t, -@@ -148,8 +160,6 @@ mod static_fns { - pub fn pa_threaded_mainloop_unlock(m: *mut pa_threaded_mainloop); - pub fn pa_threaded_mainloop_wait(m: *mut pa_threaded_mainloop); - pub fn pa_usec_to_bytes(t: pa_usec_t, spec: *const pa_sample_spec) -> usize; -- pub fn pa_xfree(ptr: *mut c_void); -- pub fn pa_xstrdup(str: *const c_char) -> *mut c_char; - pub fn pa_xrealloc(ptr: *mut c_void, size: usize) -> *mut c_void; - } - } -@@ -159,9 +169,9 @@ pub use self::static_fns::*; - - #[cfg(feature = "dlopen")] - mod dynamic_fns { -- use std::os::raw::{c_char, c_double, c_int, c_float, c_uint, c_void}; -- use libc::{dlclose, dlopen, dlsym, RTLD_LAZY}; - use super::*; -+ use libc::{RTLD_LAZY, dlclose, dlopen, dlsym}; -+ use std::os::raw::{c_char, c_double, c_float, c_int, c_uint, c_void}; - - #[derive(Debug)] - pub struct LibLoader { -@@ -287,6 +297,13 @@ mod dynamic_fns { - } - fp - }; -+ PA_CONTEXT_ERRNO = { -+ let fp = dlsym(h, cstr!("pa_context_errno")); -+ if fp.is_null() { -+ return None; -+ } -+ fp -+ }; - PA_CONTEXT_SET_SUBSCRIBE_CALLBACK = { - let fp = dlsym(h, cstr!("pa_context_set_subscribe_callback")); - if fp.is_null() { -@@ -301,6 +318,13 @@ mod dynamic_fns { - } - fp - }; -+ PA_CONTEXT_REF = { -+ let fp = dlsym(h, cstr!("pa_context_ref")); -+ if fp.is_null() { -+ return None; -+ } -+ fp -+ }; - PA_CONTEXT_UNREF = { - let fp = dlsym(h, cstr!("pa_context_unref")); - if fp.is_null() { -@@ -336,8 +360,15 @@ mod dynamic_fns { - } - fp - }; -- PA_OPERATION_GET_STATE = { -- let fp = dlsym(h, cstr!("pa_operation_get_state")); -+ PA_STRERROR = { -+ let fp = dlsym(h, cstr!("pa_strerror")); -+ if fp.is_null() { -+ return None; -+ } -+ fp -+ }; -+ PA_OPERATION_REF = { -+ let fp = dlsym(h, cstr!("pa_operation_ref")); - if fp.is_null() { - return None; - } -@@ -350,6 +381,27 @@ mod dynamic_fns { - } - fp - }; -+ PA_OPERATION_CANCEL = { -+ let fp = dlsym(h, cstr!("pa_operation_cancel")); -+ if fp.is_null() { -+ return None; -+ } -+ fp -+ }; -+ PA_OPERATION_GET_STATE = { -+ let fp = dlsym(h, cstr!("pa_operation_get_state")); -+ if fp.is_null() { -+ return None; -+ } -+ fp -+ }; -+ PA_OPERATION_SET_STATE_CALLBACK = { -+ let fp = dlsym(h, cstr!("pa_operation_set_state_callback")); -+ if fp.is_null() { -+ return None; -+ } -+ fp -+ }; - PA_PROPLIST_GETS = { - let fp = dlsym(h, cstr!("pa_proplist_gets")); - if fp.is_null() { -@@ -378,6 +430,20 @@ mod dynamic_fns { - } - fp - }; -+ PA_STREAM_IS_SUSPENDED = { -+ let fp = dlsym(h, cstr!("pa_stream_is_suspended")); -+ if fp.is_null() { -+ return None; -+ } -+ fp -+ }; -+ PA_STREAM_IS_CORKED = { -+ let fp = dlsym(h, cstr!("pa_stream_is_corked")); -+ if fp.is_null() { -+ return None; -+ } -+ fp -+ }; - PA_STREAM_CONNECT_PLAYBACK = { - let fp = dlsym(h, cstr!("pa_stream_connect_playback")); - if fp.is_null() { -@@ -462,6 +528,13 @@ mod dynamic_fns { - } - fp - }; -+ PA_STREAM_GET_CONTEXT = { -+ let fp = dlsym(h, cstr!("pa_stream_get_context")); -+ if fp.is_null() { -+ return None; -+ } -+ fp -+ }; - PA_STREAM_GET_TIME = { - let fp = dlsym(h, cstr!("pa_stream_get_time")); - if fp.is_null() { -@@ -511,6 +584,13 @@ mod dynamic_fns { - } - fp - }; -+ PA_STREAM_REF = { -+ let fp = dlsym(h, cstr!("pa_stream_ref")); -+ if fp.is_null() { -+ return None; -+ } -+ fp -+ }; - PA_STREAM_UNREF = { - let fp = dlsym(h, cstr!("pa_stream_unref")); - if fp.is_null() { -@@ -623,20 +703,6 @@ mod dynamic_fns { - } - fp - }; -- PA_XFREE = { -- let fp = dlsym(h, cstr!("pa_xfree")); -- if fp.is_null() { -- return None; -- } -- fp -- }; -- PA_XSTRDUP = { -- let fp = dlsym(h, cstr!("pa_xstrdup")); -- if fp.is_null() { -- return None; -- } -- fp -- }; - PA_XREALLOC = { - let fp = dlsym(h, cstr!("pa_xrealloc")); - if fp.is_null() { -@@ -837,6 +903,12 @@ mod dynamic_fns { - *mut c_void)>(PA_CONTEXT_SET_STATE_CALLBACK))(c, cb, userdata) - } - -+ static mut PA_CONTEXT_ERRNO: *mut ::libc::c_void = 0 as *mut _; -+ #[inline] -+ pub unsafe fn pa_context_errno(c: *mut pa_context) -> c_int { -+ (::std::mem::transmute::<_, extern "C" fn(*mut pa_context) -> c_int>(PA_CONTEXT_ERRNO))(c) -+ } -+ - static mut PA_CONTEXT_SET_SUBSCRIBE_CALLBACK: *mut ::libc::c_void = 0 as *mut _; - #[inline] - pub unsafe fn pa_context_set_subscribe_callback(c: *mut pa_context, -@@ -863,6 +935,12 @@ mod dynamic_fns { - -> *mut pa_operation>(PA_CONTEXT_SUBSCRIBE))(c, m, cb, userdata) - } - -+ static mut PA_CONTEXT_REF: *mut ::libc::c_void = 0 as *mut _; -+ #[inline] -+ pub unsafe fn pa_context_ref(c: *mut pa_context) -> *mut pa_context { -+ (::std::mem::transmute::<_, extern "C" fn(*mut pa_context) -> *mut pa_context>(PA_CONTEXT_REF))(c) -+ } -+ - static mut PA_CONTEXT_UNREF: *mut ::libc::c_void = 0 as *mut _; - #[inline] - pub unsafe fn pa_context_unref(c: *mut pa_context) { -@@ -907,6 +985,30 @@ mod dynamic_fns { - *mut c_void)>(PA_MAINLOOP_API_ONCE))(m, callback, userdata) - } - -+ static mut PA_STRERROR: *mut ::libc::c_void = 0 as *mut _; -+ #[inline] -+ pub unsafe fn pa_strerror(error: pa_error_code_t) -> *const c_char { -+ (::std::mem::transmute::<_, extern "C" fn(pa_error_code_t) -> *const c_char>(PA_STRERROR))(error) -+ } -+ -+ static mut PA_OPERATION_REF: *mut ::libc::c_void = 0 as *mut _; -+ #[inline] -+ pub unsafe fn pa_operation_ref(o: *mut pa_operation) -> *mut pa_operation { -+ (::std::mem::transmute::<_, extern "C" fn(*mut pa_operation) -> *mut pa_operation>(PA_OPERATION_REF))(o) -+ } -+ -+ static mut PA_OPERATION_UNREF: *mut ::libc::c_void = 0 as *mut _; -+ #[inline] -+ pub unsafe fn pa_operation_unref(o: *mut pa_operation) { -+ (::std::mem::transmute::<_, extern "C" fn(*mut pa_operation)>(PA_OPERATION_UNREF))(o) -+ } -+ -+ static mut PA_OPERATION_CANCEL: *mut ::libc::c_void = 0 as *mut _; -+ #[inline] -+ pub unsafe fn pa_operation_cancel(o: *mut pa_operation) { -+ (::std::mem::transmute::<_, extern "C" fn(*mut pa_operation)>(PA_OPERATION_CANCEL))(o) -+ } -+ - static mut PA_OPERATION_GET_STATE: *mut ::libc::c_void = 0 as *mut _; - #[inline] - pub unsafe fn pa_operation_get_state(o: *const pa_operation) -> pa_operation_state_t { -@@ -915,10 +1017,15 @@ mod dynamic_fns { - -> pa_operation_state_t>(PA_OPERATION_GET_STATE))(o) - } - -- static mut PA_OPERATION_UNREF: *mut ::libc::c_void = 0 as *mut _; -+ static mut PA_OPERATION_SET_STATE_CALLBACK: *mut ::libc::c_void = 0 as *mut _; - #[inline] -- pub unsafe fn pa_operation_unref(o: *mut pa_operation) { -- (::std::mem::transmute::<_, extern "C" fn(*mut pa_operation)>(PA_OPERATION_UNREF))(o) -+ pub unsafe fn pa_operation_set_state_callback(o: *mut pa_operation, -+ cb: pa_operation_notify_cb_t, -+ userdata: *mut c_void) { -+ (::std::mem::transmute::<_, -+ extern "C" fn(*mut pa_operation, -+ pa_operation_notify_cb_t, -+ *mut c_void)>(PA_OPERATION_SET_STATE_CALLBACK))(o, cb, userdata) - } - - static mut PA_PROPLIST_GETS: *mut ::libc::c_void = 0 as *mut _; -@@ -951,6 +1058,18 @@ mod dynamic_fns { - (::std::mem::transmute::<_, extern "C" fn(*mut pa_stream) -> c_int>(PA_STREAM_CANCEL_WRITE))(p) - } - -+ static mut PA_STREAM_IS_SUSPENDED: *mut ::libc::c_void = 0 as *mut _; -+ #[inline] -+ pub unsafe fn pa_stream_is_suspended(s: *const pa_stream) -> c_int { -+ (::std::mem::transmute::<_, extern "C" fn(*const pa_stream) -> c_int>(PA_STREAM_IS_SUSPENDED))(s) -+ } -+ -+ static mut PA_STREAM_IS_CORKED: *mut ::libc::c_void = 0 as *mut _; -+ #[inline] -+ pub unsafe fn pa_stream_is_corked(s: *const pa_stream) -> c_int { -+ (::std::mem::transmute::<_, extern "C" fn(*const pa_stream) -> c_int>(PA_STREAM_IS_CORKED))(s) -+ } -+ - static mut PA_STREAM_CONNECT_PLAYBACK: *mut ::libc::c_void = 0 as *mut _; - #[inline] - pub unsafe fn pa_stream_connect_playback(s: *mut pa_stream, -@@ -1066,6 +1185,12 @@ mod dynamic_fns { - (::std::mem::transmute::<_, extern "C" fn(*const pa_stream) -> pa_stream_state_t>(PA_STREAM_GET_STATE))(p) - } - -+ static mut PA_STREAM_GET_CONTEXT: *mut ::libc::c_void = 0 as *mut _; -+ #[inline] -+ pub unsafe fn pa_stream_get_context(s: *const pa_stream) -> *mut pa_context { -+ (::std::mem::transmute::<_, extern "C" fn(*const pa_stream) -> *mut pa_context>(PA_STREAM_GET_CONTEXT))(s) -+ } -+ - static mut PA_STREAM_GET_TIME: *mut ::libc::c_void = 0 as *mut _; - #[inline] - pub unsafe fn pa_stream_get_time(s: *const pa_stream, r_usec: *mut pa_usec_t) -> c_int { -@@ -1132,6 +1257,12 @@ mod dynamic_fns { - *mut c_void)>(PA_STREAM_SET_READ_CALLBACK))(p, cb, userdata) - } - -+ static mut PA_STREAM_REF: *mut ::libc::c_void = 0 as *mut _; -+ #[inline] -+ pub unsafe fn pa_stream_ref(s: *mut pa_stream) -> *mut pa_stream { -+ (::std::mem::transmute::<_, extern "C" fn(*mut pa_stream) -> *mut pa_stream>(PA_STREAM_REF))(s) -+ } -+ - static mut PA_STREAM_UNREF: *mut ::libc::c_void = 0 as *mut _; - #[inline] - pub unsafe fn pa_stream_unref(s: *mut pa_stream) { -@@ -1253,18 +1384,6 @@ mod dynamic_fns { - spec) - } - -- static mut PA_XFREE: *mut ::libc::c_void = 0 as *mut _; -- #[inline] -- pub unsafe fn pa_xfree(ptr: *mut c_void) { -- (::std::mem::transmute::<_, extern "C" fn(*mut c_void)>(PA_XFREE))(ptr) -- } -- -- static mut PA_XSTRDUP: *mut ::libc::c_void = 0 as *mut _; -- #[inline] -- pub unsafe fn pa_xstrdup(str: *const c_char) -> *mut c_char { -- (::std::mem::transmute::<_, extern "C" fn(*const c_char) -> *mut c_char>(PA_XSTRDUP))(str) -- } -- - static mut PA_XREALLOC: *mut ::libc::c_void = 0 as *mut _; - #[inline] - pub unsafe fn pa_xrealloc(ptr: *mut c_void, size: usize) -> *mut c_void { -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-ffi/src/ffi_types.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-ffi/src/ffi_types.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-ffi/src/ffi_types.rs.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-ffi/src/ffi_types.rs 2017-08-04 13:37:46.384821737 +0200 -@@ -1,6 +1,6 @@ - #![allow(non_camel_case_types)] - --use std::os::raw::{c_char, c_int, c_long, c_ulong, c_void}; -+use std::os::raw::{c_char, c_int, c_long, c_uint, c_ulong, c_void}; - - /* automatically generated by rust-bindgen */ - pub const PA_RATE_MAX: u32 = 48000 * 8; -@@ -74,10 +74,10 @@ pub const PA_OPERATION_DONE: c_int = 1; - pub const PA_OPERATION_CANCELLED: c_int = 2; - pub type pa_operation_state_t = c_int; - --pub const PA_CONTEXT_NOFLAGS: c_int = 0; --pub const PA_CONTEXT_NOAUTOSPAWN: c_int = 1; --pub const PA_CONTEXT_NOFAIL: c_int = 2; --pub type pa_context_flags_t = c_int; -+pub const PA_CONTEXT_NOFLAGS: c_uint = 0; -+pub const PA_CONTEXT_NOAUTOSPAWN: c_uint = 1; -+pub const PA_CONTEXT_NOFAIL: c_uint = 2; -+pub type pa_context_flags_t = c_uint; - - pub const PA_DIRECTION_OUTPUT: c_int = 1; - pub const PA_DIRECTION_INPUT: c_int = 2; -@@ -93,28 +93,28 @@ pub const PA_STREAM_RECORD: c_int = 2; - pub const PA_STREAM_UPLOAD: c_int = 3; - pub type pa_stream_direction_t = c_int; - --pub const PA_STREAM_NOFLAGS: c_int = 0x0_0000; --pub const PA_STREAM_START_CORKED: c_int = 0x0_0001; --pub const PA_STREAM_INTERPOLATE_TIMING: c_int = 0x0_0002; --pub const PA_STREAM_NOT_MONOTONIC: c_int = 0x0_0004; --pub const PA_STREAM_AUTO_TIMING_UPDATE: c_int = 0x0_0008; --pub const PA_STREAM_NO_REMAP_CHANNELS: c_int = 0x0_0010; --pub const PA_STREAM_NO_REMIX_CHANNELS: c_int = 0x0_0020; --pub const PA_STREAM_FIX_FORMAT: c_int = 0x0_0040; --pub const PA_STREAM_FIX_RATE: c_int = 0x0_0080; --pub const PA_STREAM_FIX_CHANNELS: c_int = 0x0_0100; --pub const PA_STREAM_DONT_MOVE: c_int = 0x0_0200; --pub const PA_STREAM_VARIABLE_RATE: c_int = 0x0_0400; --pub const PA_STREAM_PEAK_DETECT: c_int = 0x0_0800; --pub const PA_STREAM_START_MUTED: c_int = 0x0_1000; --pub const PA_STREAM_ADJUST_LATENCY: c_int = 0x0_2000; --pub const PA_STREAM_EARLY_REQUESTS: c_int = 0x0_4000; --pub const PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND: c_int = 0x0_8000; --pub const PA_STREAM_START_UNMUTED: c_int = 0x1_0000; --pub const PA_STREAM_FAIL_ON_SUSPEND: c_int = 0x2_0000; --pub const PA_STREAM_RELATIVE_VOLUME: c_int = 0x4_0000; --pub const PA_STREAM_PASSTHROUGH: c_int = 0x8_0000; --pub type pa_stream_flags_t = c_int; -+pub const PA_STREAM_NOFLAGS: c_uint = 0x0_0000; -+pub const PA_STREAM_START_CORKED: c_uint = 0x0_0001; -+pub const PA_STREAM_INTERPOLATE_TIMING: c_uint = 0x0_0002; -+pub const PA_STREAM_NOT_MONOTONIC: c_uint = 0x0_0004; -+pub const PA_STREAM_AUTO_TIMING_UPDATE: c_uint = 0x0_0008; -+pub const PA_STREAM_NO_REMAP_CHANNELS: c_uint = 0x0_0010; -+pub const PA_STREAM_NO_REMIX_CHANNELS: c_uint = 0x0_0020; -+pub const PA_STREAM_FIX_FORMAT: c_uint = 0x0_0040; -+pub const PA_STREAM_FIX_RATE: c_uint = 0x0_0080; -+pub const PA_STREAM_FIX_CHANNELS: c_uint = 0x0_0100; -+pub const PA_STREAM_DONT_MOVE: c_uint = 0x0_0200; -+pub const PA_STREAM_VARIABLE_RATE: c_uint = 0x0_0400; -+pub const PA_STREAM_PEAK_DETECT: c_uint = 0x0_0800; -+pub const PA_STREAM_START_MUTED: c_uint = 0x0_1000; -+pub const PA_STREAM_ADJUST_LATENCY: c_uint = 0x0_2000; -+pub const PA_STREAM_EARLY_REQUESTS: c_uint = 0x0_4000; -+pub const PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND: c_uint = 0x0_8000; -+pub const PA_STREAM_START_UNMUTED: c_uint = 0x1_0000; -+pub const PA_STREAM_FAIL_ON_SUSPEND: c_uint = 0x2_0000; -+pub const PA_STREAM_RELATIVE_VOLUME: c_uint = 0x4_0000; -+pub const PA_STREAM_PASSTHROUGH: c_uint = 0x8_0000; -+pub type pa_stream_flags_t = c_uint; - - #[repr(C)] - #[derive(Clone, Copy, Debug)] -@@ -162,19 +162,19 @@ pub const PA_ERR_BUSY: c_int = 26; - pub const PA_ERR_MAX: c_int = 27; - pub type pa_error_code_t = c_int; - --pub const PA_SUBSCRIPTION_MASK_NULL: c_int = 0; --pub const PA_SUBSCRIPTION_MASK_SINK: c_int = 1; --pub const PA_SUBSCRIPTION_MASK_SOURCE: c_int = 2; --pub const PA_SUBSCRIPTION_MASK_SINK_INPUT: c_int = 4; --pub const PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT: c_int = 8; --pub const PA_SUBSCRIPTION_MASK_MODULE: c_int = 16; --pub const PA_SUBSCRIPTION_MASK_CLIENT: c_int = 32; --pub const PA_SUBSCRIPTION_MASK_SAMPLE_CACHE: c_int = 64; --pub const PA_SUBSCRIPTION_MASK_SERVER: c_int = 128; --pub const PA_SUBSCRIPTION_MASK_AUTOLOAD: c_int = 256; --pub const PA_SUBSCRIPTION_MASK_CARD: c_int = 512; --pub const PA_SUBSCRIPTION_MASK_ALL: c_int = 767; --pub type pa_subscription_mask_t = c_int; -+pub const PA_SUBSCRIPTION_MASK_NULL: c_uint = 0x0; -+pub const PA_SUBSCRIPTION_MASK_SINK: c_uint = 0x1; -+pub const PA_SUBSCRIPTION_MASK_SOURCE: c_uint = 0x2; -+pub const PA_SUBSCRIPTION_MASK_SINK_INPUT: c_uint = 0x4; -+pub const PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT: c_uint = 0x8; -+pub const PA_SUBSCRIPTION_MASK_MODULE: c_uint = 0x10; -+pub const PA_SUBSCRIPTION_MASK_CLIENT: c_uint = 0x20; -+pub const PA_SUBSCRIPTION_MASK_SAMPLE_CACHE: c_uint = 0x40; -+pub const PA_SUBSCRIPTION_MASK_SERVER: c_uint = 0x80; -+pub const PA_SUBSCRIPTION_MASK_AUTOLOAD: c_uint = 0x100; -+pub const PA_SUBSCRIPTION_MASK_CARD: c_uint = 0x200; -+pub const PA_SUBSCRIPTION_MASK_ALL: c_uint = 0x3FF; -+pub type pa_subscription_mask_t = c_uint; - - pub const PA_SUBSCRIPTION_EVENT_SINK: c_int = 0; - pub const PA_SUBSCRIPTION_EVENT_SOURCE: c_int = 1; -@@ -244,17 +244,17 @@ pub const PA_SEEK_RELATIVE_ON_READ: c_in - pub const PA_SEEK_RELATIVE_END: c_int = 3; - pub type pa_seek_mode_t = c_int; - --pub const PA_SINK_NOFLAGS: c_int = 0; --pub const PA_SINK_HW_VOLUME_CTRL: c_int = 1; --pub const PA_SINK_LATENCY: c_int = 2; --pub const PA_SINK_HARDWARE: c_int = 4; --pub const PA_SINK_NETWORK: c_int = 8; --pub const PA_SINK_HW_MUTE_CTRL: c_int = 16; --pub const PA_SINK_DECIBEL_VOLUME: c_int = 32; --pub const PA_SINK_FLAT_VOLUME: c_int = 64; --pub const PA_SINK_DYNAMIC_LATENCY: c_int = 128; --pub const PA_SINK_SET_FORMATS: c_int = 256; --pub type pa_sink_flags_t = c_int; -+pub const PA_SINK_NOFLAGS: c_uint = 0x000; -+pub const PA_SINK_HW_VOLUME_CTRL: c_uint = 0x001; -+pub const PA_SINK_LATENCY: c_uint = 0x002; -+pub const PA_SINK_HARDWARE: c_uint = 0x004; -+pub const PA_SINK_NETWORK: c_uint = 0x008; -+pub const PA_SINK_HW_MUTE_CTRL: c_uint = 0x010; -+pub const PA_SINK_DECIBEL_VOLUME: c_uint = 0x020; -+pub const PA_SINK_FLAT_VOLUME: c_uint = 0x040; -+pub const PA_SINK_DYNAMIC_LATENCY: c_uint = 0x080; -+pub const PA_SINK_SET_FORMATS: c_uint = 0x100; -+pub type pa_sink_flags_t = c_uint; - - pub const PA_SINK_INVALID_STATE: c_int = -1; - pub const PA_SINK_RUNNING: c_int = 0; -@@ -264,16 +264,16 @@ pub const PA_SINK_INIT: c_int = -2; - pub const PA_SINK_UNLINKED: c_int = -3; - pub type pa_sink_state_t = c_int; - --pub const PA_SOURCE_NOFLAGS: c_int = 0x00; --pub const PA_SOURCE_HW_VOLUME_CTRL: c_int = 0x01; --pub const PA_SOURCE_LATENCY: c_int = 0x02; --pub const PA_SOURCE_HARDWARE: c_int = 0x04; --pub const PA_SOURCE_NETWORK: c_int = 0x08; --pub const PA_SOURCE_HW_MUTE_CTRL: c_int = 0x10; --pub const PA_SOURCE_DECIBEL_VOLUME: c_int = 0x20; --pub const PA_SOURCE_DYNAMIC_LATENCY: c_int = 0x40; --pub const PA_SOURCE_FLAT_VOLUME: c_int = 0x80; --pub type pa_source_flags_t = c_int; -+pub const PA_SOURCE_NOFLAGS: c_uint = 0x00; -+pub const PA_SOURCE_HW_VOLUME_CTRL: c_uint = 0x01; -+pub const PA_SOURCE_LATENCY: c_uint = 0x02; -+pub const PA_SOURCE_HARDWARE: c_uint = 0x04; -+pub const PA_SOURCE_NETWORK: c_uint = 0x08; -+pub const PA_SOURCE_HW_MUTE_CTRL: c_uint = 0x10; -+pub const PA_SOURCE_DECIBEL_VOLUME: c_uint = 0x20; -+pub const PA_SOURCE_DYNAMIC_LATENCY: c_uint = 0x40; -+pub const PA_SOURCE_FLAT_VOLUME: c_uint = 0x80; -+pub type pa_source_flags_t = c_uint; - - pub const PA_SOURCE_INVALID_STATE: c_int = -1; - pub const PA_SOURCE_RUNNING: c_int = 0; -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/Cargo.toml.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/Cargo.toml ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/Cargo.toml.cubeb-pulse-arm 2017-08-04 13:37:46.384821737 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/Cargo.toml 2017-08-04 13:37:46.384821737 +0200 -@@ -0,0 +1,8 @@ -+[package] -+name = "pulse" -+version = "0.1.0" -+authors = ["Dan Glastonbury "] -+ -+[dependencies] -+bitflags = "^0.7.0" -+pulse-ffi = { path = "../pulse-ffi" } -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/context.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/context.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/context.rs.cubeb-pulse-arm 2017-08-04 13:37:46.385821734 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/context.rs 2017-08-04 13:37:46.385821734 +0200 -@@ -0,0 +1,394 @@ -+// Copyright © 2017 Mozilla Foundation -+// -+// This program is made available under an ISC-style license. See the -+// accompanying file LICENSE for details. -+ -+use ::*; -+use ffi; -+use std::ffi::CStr; -+use std::os::raw::{c_int, c_void}; -+use std::ptr; -+use util::UnwrapCStr; -+ -+// A note about `wrapped` functions -+// -+// C FFI demands `unsafe extern fn(*mut pa_context, ...) -> i32`, etc, -+// but we want to allow such callbacks to be safe. This means no -+// `unsafe` or `extern`, and callbacks should be called with a safe -+// wrapper of `*mut pa_context`. Since the callback doesn't take -+// ownership, this is `&Context`. `fn wrapped(...)` defines a -+// function that converts from our safe signature to the unsafe -+// signature. -+// -+// Currently, we use a property of Rust, namely that each function -+// gets its own unique type. These unique types can't be written -+// directly, so we use generic and a type parameter, and let the Rust -+// compiler fill in the name for us: -+// -+// fn get_sink_input_info(&self, ..., _: CB, ...) -> ... -+// where CB: Fn(&Context, *const SinkInputInfo, i32, *mut c_void) -+// -+// Because we aren't storing or passing any state, we assert, at run-time :-(, -+// that our functions are zero-sized: -+// -+// assert!(mem::size_of::() == 0); -+// -+// We need to obtain a value of type F in order to call it. Since we -+// can't name the function, we have to unsafely construct that value -+// somehow - we do this using mem::uninitialized. Then, we call that -+// function with a reference to the Context, and save the result: -+// -+// | generate value || call it | -+// let result = ::std::mem::uninitialized::()(&mut object); -+// -+// Lastly, since our Object is an owned type, we need to avoid -+// dropping it, then return the result we just generated. -+// -+// mem::forget(object); -+// result -+ -+// Aid in returning Operation from callbacks -+macro_rules! op_or_err { -+ ($self_:ident, $e:expr) => {{ -+ let o = unsafe { $e }; -+ if o.is_null() { -+ Err(ErrorCode::from_error_code($self_.errno())) -+ } else { -+ Ok(unsafe { operation::from_raw_ptr(o) }) -+ } -+ }} -+} -+ -+#[repr(C)] -+#[derive(Debug)] -+pub struct Context(*mut ffi::pa_context); -+ -+impl Context { -+ pub fn new<'a, OPT>(api: &MainloopApi, name: OPT) -> Option -+ where OPT: Into> -+ { -+ let ptr = unsafe { ffi::pa_context_new(api.raw_mut(), name.unwrap_cstr()) }; -+ if ptr.is_null() { -+ None -+ } else { -+ Some(Context(ptr)) -+ } -+ } -+ -+ #[doc(hidden)] -+ pub fn raw_mut(&self) -> &mut ffi::pa_context { -+ unsafe { &mut *self.0 } -+ } -+ -+ pub fn unref(self) { -+ unsafe { -+ ffi::pa_context_unref(self.raw_mut()); -+ } -+ } -+ -+ pub fn clear_state_callback(&self) { -+ unsafe { -+ ffi::pa_context_set_state_callback(self.raw_mut(), None, ptr::null_mut()); -+ } -+ } -+ -+ pub fn set_state_callback(&self, _: CB, userdata: *mut c_void) -+ where CB: Fn(&Context, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(c: *mut ffi::pa_context, userdata: *mut c_void) -+ where F: Fn(&Context, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let ctx = context::from_raw_ptr(c); -+ let result = uninitialized::()(&ctx, userdata); -+ forget(ctx); -+ -+ result -+ } -+ -+ unsafe { -+ ffi::pa_context_set_state_callback(self.raw_mut(), Some(wrapped::), userdata); -+ } -+ } -+ -+ pub fn errno(&self) -> ffi::pa_error_code_t { -+ unsafe { ffi::pa_context_errno(self.raw_mut()) } -+ } -+ -+ pub fn get_state(&self) -> ContextState { -+ ContextState::try_from(unsafe { -+ ffi::pa_context_get_state(self.raw_mut()) -+ }).expect("pa_context_get_state returned invalid ContextState") -+ } -+ -+ pub fn connect<'a, OPT>(&self, server: OPT, flags: ContextFlags, api: *const ffi::pa_spawn_api) -> Result<()> -+ where OPT: Into> -+ { -+ let r = unsafe { -+ ffi::pa_context_connect(self.raw_mut(), -+ server.into().unwrap_cstr(), -+ flags.into(), -+ api) -+ }; -+ error_result!((), r) -+ } -+ -+ pub fn disconnect(&self) { -+ unsafe { -+ ffi::pa_context_disconnect(self.raw_mut()); -+ } -+ } -+ -+ -+ pub fn drain(&self, _: CB, userdata: *mut c_void) -> Result -+ where CB: Fn(&Context, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(c: *mut ffi::pa_context, userdata: *mut c_void) -+ where F: Fn(&Context, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let ctx = context::from_raw_ptr(c); -+ let result = uninitialized::()(&ctx, userdata); -+ forget(ctx); -+ -+ result -+ } -+ -+ op_or_err!(self, -+ ffi::pa_context_drain(self.raw_mut(), Some(wrapped::), userdata)) -+ } -+ -+ pub fn rttime_new(&self, usec: USec, _: CB, userdata: *mut c_void) -> *mut ffi::pa_time_event -+ where CB: Fn(&MainloopApi, *mut ffi::pa_time_event, &TimeVal, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(a: *mut ffi::pa_mainloop_api, -+ e: *mut ffi::pa_time_event, -+ tv: *const TimeVal, -+ userdata: *mut c_void) -+ where F: Fn(&MainloopApi, *mut ffi::pa_time_event, &TimeVal, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let api = mainloop_api::from_raw_ptr(a); -+ let timeval = &*tv; -+ let result = uninitialized::()(&api, e, timeval, userdata); -+ forget(api); -+ -+ result -+ } -+ -+ unsafe { ffi::pa_context_rttime_new(self.raw_mut(), usec, Some(wrapped::), userdata) } -+ } -+ -+ pub fn get_server_info(&self, _: CB, userdata: *mut c_void) -> Result -+ where CB: Fn(&Context, &ServerInfo, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(c: *mut ffi::pa_context, i: *const ffi::pa_server_info, userdata: *mut c_void) -+ where F: Fn(&Context, &ServerInfo, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ debug_assert_ne!(i, ptr::null_mut()); -+ let info = &*i; -+ let ctx = context::from_raw_ptr(c); -+ let result = uninitialized::()(&ctx, info, userdata); -+ forget(ctx); -+ -+ result -+ } -+ -+ op_or_err!(self, -+ ffi::pa_context_get_server_info(self.raw_mut(), Some(wrapped::), userdata)) -+ } -+ -+ pub fn get_sink_info_by_name(&self, name: &CStr, _: CB, userdata: *mut c_void) -> Result -+ where CB: Fn(&Context, *const SinkInfo, i32, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(c: *mut ffi::pa_context, -+ info: *const ffi::pa_sink_info, -+ eol: c_int, -+ userdata: *mut c_void) -+ where F: Fn(&Context, *const SinkInfo, i32, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let ctx = context::from_raw_ptr(c); -+ let result = uninitialized::()(&ctx, info, eol, userdata); -+ forget(ctx); -+ -+ result -+ } -+ -+ op_or_err!(self, -+ ffi::pa_context_get_sink_info_by_name(self.raw_mut(), name.as_ptr(), Some(wrapped::), userdata)) -+ } -+ -+ pub fn get_sink_info_list(&self, _: CB, userdata: *mut c_void) -> Result -+ where CB: Fn(&Context, *const SinkInfo, i32, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(c: *mut ffi::pa_context, -+ info: *const ffi::pa_sink_info, -+ eol: c_int, -+ userdata: *mut c_void) -+ where F: Fn(&Context, *const SinkInfo, i32, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let ctx = context::from_raw_ptr(c); -+ let result = uninitialized::()(&ctx, info, eol, userdata); -+ forget(ctx); -+ -+ result -+ } -+ -+ op_or_err!(self, -+ ffi::pa_context_get_sink_info_list(self.raw_mut(), Some(wrapped::), userdata)) -+ } -+ -+ pub fn get_sink_input_info(&self, idx: u32, _: CB, userdata: *mut c_void) -> Result -+ where CB: Fn(&Context, *const SinkInputInfo, i32, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(c: *mut ffi::pa_context, -+ info: *const ffi::pa_sink_input_info, -+ eol: c_int, -+ userdata: *mut c_void) -+ where F: Fn(&Context, *const SinkInputInfo, i32, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let ctx = context::from_raw_ptr(c); -+ let result = uninitialized::()(&ctx, info, eol, userdata); -+ forget(ctx); -+ -+ result -+ } -+ -+ op_or_err!(self, -+ ffi::pa_context_get_sink_input_info(self.raw_mut(), idx, Some(wrapped::), userdata)) -+ } -+ -+ pub fn get_source_info_list(&self, _: CB, userdata: *mut c_void) -> Result -+ where CB: Fn(&Context, *const SourceInfo, i32, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(c: *mut ffi::pa_context, -+ info: *const ffi::pa_source_info, -+ eol: c_int, -+ userdata: *mut c_void) -+ where F: Fn(&Context, *const SourceInfo, i32, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let ctx = context::from_raw_ptr(c); -+ let result = uninitialized::()(&ctx, info, eol, userdata); -+ forget(ctx); -+ -+ result -+ } -+ -+ op_or_err!(self, -+ ffi::pa_context_get_source_info_list(self.raw_mut(), Some(wrapped::), userdata)) -+ } -+ -+ pub fn set_sink_input_volume(&self, -+ idx: u32, -+ volume: &CVolume, -+ _: CB, -+ userdata: *mut c_void) -+ -> Result -+ where CB: Fn(&Context, i32, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(c: *mut ffi::pa_context, success: c_int, userdata: *mut c_void) -+ where F: Fn(&Context, i32, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let ctx = context::from_raw_ptr(c); -+ let result = uninitialized::()(&ctx, success, userdata); -+ forget(ctx); -+ -+ result -+ } -+ -+ op_or_err!(self, -+ ffi::pa_context_set_sink_input_volume(self.raw_mut(), idx, volume, Some(wrapped::), userdata)) -+ } -+ -+ pub fn subscribe(&self, m: SubscriptionMask, _: CB, userdata: *mut c_void) -> Result -+ where CB: Fn(&Context, i32, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(c: *mut ffi::pa_context, success: c_int, userdata: *mut c_void) -+ where F: Fn(&Context, i32, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let ctx = context::from_raw_ptr(c); -+ let result = uninitialized::()(&ctx, success, userdata); -+ forget(ctx); -+ -+ result -+ } -+ -+ op_or_err!(self, -+ ffi::pa_context_subscribe(self.raw_mut(), m.into(), Some(wrapped::), userdata)) -+ } -+ -+ pub fn clear_subscribe_callback(&self) { -+ unsafe { -+ ffi::pa_context_set_subscribe_callback(self.raw_mut(), None, ptr::null_mut()); -+ } -+ } -+ -+ pub fn set_subscribe_callback(&self, _: CB, userdata: *mut c_void) -+ where CB: Fn(&Context, SubscriptionEvent, u32, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(c: *mut ffi::pa_context, -+ t: ffi::pa_subscription_event_type_t, -+ idx: u32, -+ userdata: *mut c_void) -+ where F: Fn(&Context, SubscriptionEvent, u32, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let ctx = context::from_raw_ptr(c); -+ let event = SubscriptionEvent::try_from(t) -+ .expect("pa_context_subscribe_cb_t passed invalid pa_subscription_event_type_t"); -+ let result = uninitialized::()(&ctx, event, idx, userdata); -+ forget(ctx); -+ -+ result -+ } -+ -+ unsafe { -+ ffi::pa_context_set_subscribe_callback(self.raw_mut(), Some(wrapped::), userdata); -+ } -+ } -+} -+ -+#[doc(hidden)] -+pub unsafe fn from_raw_ptr(ptr: *mut ffi::pa_context) -> Context { -+ Context(ptr) -+} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/error.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/error.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/error.rs.cubeb-pulse-arm 2017-08-04 13:37:46.385821734 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/error.rs 2017-08-04 13:37:46.385821734 +0200 -@@ -0,0 +1,56 @@ -+// Copyright © 2017 Mozilla Foundation -+// -+// This program is made available under an ISC-style license. See the -+// accompanying file LICENSE for details. -+ -+use ffi; -+use std::ffi::CStr; -+ -+#[macro_export] -+macro_rules! error_result { -+ ($t:expr, $err:expr) => { -+ if $err >= 0 { -+ Ok($t) -+ } else { -+ Err(ErrorCode::from_error_result($err)) -+ } -+ } -+} -+ -+#[derive(Debug, PartialEq)] -+pub struct ErrorCode { -+ err: ffi::pa_error_code_t, -+} -+ -+impl ErrorCode { -+ pub fn from_error_result(err: i32) -> Self { -+ debug_assert!(err < 0); -+ ErrorCode { -+ err: (-err) as ffi::pa_error_code_t, -+ } -+ } -+ -+ pub fn from_error_code(err: ffi::pa_error_code_t) -> Self { -+ debug_assert!(err > 0); -+ ErrorCode { -+ err: err, -+ } -+ } -+ -+ fn desc(&self) -> &'static str { -+ let cstr = unsafe { CStr::from_ptr(ffi::pa_strerror(self.err)) }; -+ cstr.to_str().unwrap() -+ } -+} -+ -+impl ::std::error::Error for ErrorCode { -+ fn description(&self) -> &str { -+ self.desc() -+ } -+} -+ -+impl ::std::fmt::Display for ErrorCode { -+ fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { -+ write!(f, "{:?}: {}", self, self.desc()) -+ } -+} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/lib.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/lib.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/lib.rs.cubeb-pulse-arm 2017-08-04 13:37:46.385821734 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/lib.rs 2017-08-04 13:37:46.385821734 +0200 -@@ -0,0 +1,653 @@ -+// Copyright © 2017 Mozilla Foundation -+// -+// This program is made available under an ISC-style license. See the -+// accompanying file LICENSE for details. -+ -+#[macro_use] -+extern crate bitflags; -+extern crate pulse_ffi as ffi; -+ -+#[macro_use] -+mod error; -+mod context; -+mod mainloop_api; -+mod operation; -+mod proplist; -+mod stream; -+mod threaded_mainloop; -+mod util; -+ -+pub use context::Context; -+pub use error::ErrorCode; -+pub use ffi::pa_buffer_attr as BufferAttr; -+pub use ffi::pa_channel_map as ChannelMap; -+pub use ffi::pa_cvolume as CVolume; -+pub use ffi::pa_sample_spec as SampleSpec; -+pub use ffi::pa_server_info as ServerInfo; -+pub use ffi::pa_sink_info as SinkInfo; -+pub use ffi::pa_sink_input_info as SinkInputInfo; -+pub use ffi::pa_source_info as SourceInfo; -+pub use ffi::pa_usec_t as USec; -+pub use ffi::pa_volume_t as Volume; -+pub use ffi::timeval as TimeVal; -+pub use mainloop_api::MainloopApi; -+pub use operation::Operation; -+pub use proplist::Proplist; -+use std::os::raw::{c_char, c_uint}; -+pub use stream::Stream; -+pub use threaded_mainloop::ThreadedMainloop; -+ -+#[allow(non_camel_case_types)] -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum SampleFormat { -+ Invalid = ffi::PA_SAMPLE_INVALID, -+ U8 = ffi::PA_SAMPLE_U8, -+ Alaw = ffi::PA_SAMPLE_ALAW, -+ Ulaw = ffi::PA_SAMPLE_ULAW, -+ Signed16LE = ffi::PA_SAMPLE_S16LE, -+ Signed16BE = ffi::PA_SAMPLE_S16BE, -+ Float32LE = ffi::PA_SAMPLE_FLOAT32LE, -+ Float32BE = ffi::PA_SAMPLE_FLOAT32BE, -+ Signed32LE = ffi::PA_SAMPLE_S32LE, -+ Signed32BE = ffi::PA_SAMPLE_S32BE, -+ Signed24LE = ffi::PA_SAMPLE_S24LE, -+ Signed24BE = ffi::PA_SAMPLE_S24BE, -+ Signed24_32LE = ffi::PA_SAMPLE_S24_32LE, -+ Signed23_32BE = ffi::PA_SAMPLE_S24_32BE, -+} -+ -+impl Default for SampleFormat { -+ fn default() -> Self { -+ SampleFormat::Invalid -+ } -+} -+ -+impl Into for SampleFormat { -+ fn into(self) -> ffi::pa_sample_format_t { -+ self as ffi::pa_sample_format_t -+ } -+} -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum ContextState { -+ Unconnected = ffi::PA_CONTEXT_UNCONNECTED, -+ Connecting = ffi::PA_CONTEXT_CONNECTING, -+ Authorizing = ffi::PA_CONTEXT_AUTHORIZING, -+ SettingName = ffi::PA_CONTEXT_SETTING_NAME, -+ Ready = ffi::PA_CONTEXT_READY, -+ Failed = ffi::PA_CONTEXT_FAILED, -+ Terminated = ffi::PA_CONTEXT_TERMINATED, -+} -+ -+impl ContextState { -+ // This function implements the PA_CONTENT_IS_GOOD macro from pulse/def.h -+ // It must match the version from PA headers. -+ pub fn is_good(self) -> bool { -+ match self { -+ ContextState::Connecting | -+ ContextState::Authorizing | -+ ContextState::SettingName | -+ ContextState::Ready => true, -+ _ => false, -+ } -+ } -+ -+ pub fn try_from(x: ffi::pa_context_state_t) -> Option { -+ if x >= ffi::PA_CONTEXT_UNCONNECTED && x <= ffi::PA_CONTEXT_TERMINATED { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+impl Default for ContextState { -+ fn default() -> Self { -+ ContextState::Unconnected -+ } -+} -+ -+impl Into for ContextState { -+ fn into(self) -> ffi::pa_context_state_t { -+ self as ffi::pa_context_state_t -+ } -+} -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum StreamState { -+ Unconnected = ffi::PA_STREAM_UNCONNECTED, -+ Creating = ffi::PA_STREAM_CREATING, -+ Ready = ffi::PA_STREAM_READY, -+ Failed = ffi::PA_STREAM_FAILED, -+ Terminated = ffi::PA_STREAM_TERMINATED, -+} -+ -+impl StreamState { -+ // This function implements the PA_STREAM_IS_GOOD macro from pulse/def.h -+ // It must match the version from PA headers. -+ pub fn is_good(self) -> bool { -+ match self { -+ StreamState::Creating | StreamState::Ready => true, -+ _ => false, -+ } -+ } -+ -+ pub fn try_from(x: ffi::pa_stream_state_t) -> Option { -+ if x >= ffi::PA_STREAM_UNCONNECTED && x <= ffi::PA_STREAM_TERMINATED { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+impl Default for StreamState { -+ fn default() -> Self { -+ StreamState::Unconnected -+ } -+} -+ -+impl Into for StreamState { -+ fn into(self) -> ffi::pa_stream_state_t { -+ self as ffi::pa_stream_state_t -+ } -+} -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum OperationState { -+ Running = ffi::PA_OPERATION_RUNNING, -+ Done = ffi::PA_OPERATION_DONE, -+ Cancelled = ffi::PA_OPERATION_CANCELLED, -+} -+ -+impl OperationState { -+ pub fn try_from(x: ffi::pa_operation_state_t) -> Option { -+ if x >= ffi::PA_OPERATION_RUNNING && x <= ffi::PA_OPERATION_CANCELLED { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+impl Into for OperationState { -+ fn into(self) -> ffi::pa_operation_state_t { -+ self as ffi::pa_operation_state_t -+ } -+} -+ -+bitflags! { -+ pub flags ContextFlags: u32 { -+ const CONTEXT_FLAGS_NOAUTOSPAWN = ffi::PA_CONTEXT_NOAUTOSPAWN, -+ const CONTEXT_FLAGS_NOFAIL = ffi::PA_CONTEXT_NOFAIL, -+ } -+} -+ -+impl Into for ContextFlags { -+ fn into(self) -> ffi::pa_context_flags_t { -+ self.bits() as ffi::pa_context_flags_t -+ } -+} -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum DeviceType { -+ Sink = ffi::PA_DEVICE_TYPE_SINK, -+ Source = ffi::PA_DEVICE_TYPE_SOURCE, -+} -+ -+impl DeviceType { -+ pub fn try_from(x: ffi::pa_device_type_t) -> Option { -+ if x >= ffi::PA_DEVICE_TYPE_SINK && x <= ffi::PA_DEVICE_TYPE_SOURCE { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+impl Into for DeviceType { -+ fn into(self) -> ffi::pa_device_type_t { -+ self as ffi::pa_device_type_t -+ } -+} -+ -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum StreamDirection { -+ NoDirection = ffi::PA_STREAM_NODIRECTION, -+ Playback = ffi::PA_STREAM_PLAYBACK, -+ Record = ffi::PA_STREAM_RECORD, -+ StreamUpload = ffi::PA_STREAM_UPLOAD, -+} -+ -+impl StreamDirection { -+ pub fn try_from(x: ffi::pa_stream_direction_t) -> Option { -+ if x >= ffi::PA_STREAM_NODIRECTION && x <= ffi::PA_STREAM_UPLOAD { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+impl Into for StreamDirection { -+ fn into(self) -> ffi::pa_stream_direction_t { -+ self as ffi::pa_stream_direction_t -+ } -+} -+ -+bitflags! { -+ pub flags StreamFlags : u32 { -+ const STREAM_START_CORKED = ffi::PA_STREAM_START_CORKED, -+ const STREAM_INTERPOLATE_TIMING = ffi::PA_STREAM_INTERPOLATE_TIMING, -+ const STREAM_NOT_MONOTONIC = ffi::PA_STREAM_NOT_MONOTONIC, -+ const STREAM_AUTO_TIMING_UPDATE = ffi::PA_STREAM_AUTO_TIMING_UPDATE, -+ const STREAM_NO_REMAP_CHANNELS = ffi::PA_STREAM_NO_REMAP_CHANNELS, -+ const STREAM_NO_REMIX_CHANNELS = ffi::PA_STREAM_NO_REMIX_CHANNELS, -+ const STREAM_FIX_FORMAT = ffi::PA_STREAM_FIX_FORMAT, -+ const STREAM_FIX_RATE = ffi::PA_STREAM_FIX_RATE, -+ const STREAM_FIX_CHANNELS = ffi::PA_STREAM_FIX_CHANNELS, -+ const STREAM_DONT_MOVE = ffi::PA_STREAM_DONT_MOVE, -+ const STREAM_VARIABLE_RATE = ffi::PA_STREAM_VARIABLE_RATE, -+ const STREAM_PEAK_DETECT = ffi::PA_STREAM_PEAK_DETECT, -+ const STREAM_START_MUTED = ffi::PA_STREAM_START_MUTED, -+ const STREAM_ADJUST_LATENCY = ffi::PA_STREAM_ADJUST_LATENCY, -+ const STREAM_EARLY_REQUESTS = ffi::PA_STREAM_EARLY_REQUESTS, -+ const STREAM_DONT_INHIBIT_AUTO_SUSPEND = ffi::PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND, -+ const STREAM_START_UNMUTED = ffi::PA_STREAM_START_UNMUTED, -+ const STREAM_FAIL_ON_SUSPEND = ffi::PA_STREAM_FAIL_ON_SUSPEND, -+ const STREAM_RELATIVE_VOLUME = ffi::PA_STREAM_RELATIVE_VOLUME, -+ const STREAM_PASSTHROUGH = ffi::PA_STREAM_PASSTHROUGH, -+ } -+} -+ -+impl StreamFlags { -+ pub fn try_from(x: ffi::pa_stream_flags_t) -> Option { -+ if (x & -+ !(ffi::PA_STREAM_NOFLAGS | ffi::PA_STREAM_START_CORKED | ffi::PA_STREAM_INTERPOLATE_TIMING | -+ ffi::PA_STREAM_NOT_MONOTONIC | ffi::PA_STREAM_AUTO_TIMING_UPDATE | -+ ffi::PA_STREAM_NO_REMAP_CHANNELS | -+ ffi::PA_STREAM_NO_REMIX_CHANNELS | ffi::PA_STREAM_FIX_FORMAT | ffi::PA_STREAM_FIX_RATE | -+ ffi::PA_STREAM_FIX_CHANNELS | -+ ffi::PA_STREAM_DONT_MOVE | ffi::PA_STREAM_VARIABLE_RATE | ffi::PA_STREAM_PEAK_DETECT | -+ ffi::PA_STREAM_START_MUTED | ffi::PA_STREAM_ADJUST_LATENCY | -+ ffi::PA_STREAM_EARLY_REQUESTS | -+ ffi::PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND | -+ ffi::PA_STREAM_START_UNMUTED | ffi::PA_STREAM_FAIL_ON_SUSPEND | -+ ffi::PA_STREAM_RELATIVE_VOLUME | ffi::PA_STREAM_PASSTHROUGH)) == 0 { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+impl Into for StreamFlags { -+ fn into(self) -> ffi::pa_stream_flags_t { -+ self.bits() as ffi::pa_stream_flags_t -+ } -+} -+ -+bitflags!{ -+ pub flags SubscriptionMask : u32 { -+ const SUBSCRIPTION_MASK_SINK = ffi::PA_SUBSCRIPTION_MASK_SINK, -+ const SUBSCRIPTION_MASK_SOURCE = ffi::PA_SUBSCRIPTION_MASK_SOURCE, -+ const SUBSCRIPTION_MASK_SINK_INPUT = ffi::PA_SUBSCRIPTION_MASK_SINK_INPUT, -+ const SUBSCRIPTION_MASK_SOURCE_OUTPUT = ffi::PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT, -+ const SUBSCRIPTION_MASK_MODULE = ffi::PA_SUBSCRIPTION_MASK_MODULE, -+ const SUBSCRIPTION_MASK_CLIENT = ffi::PA_SUBSCRIPTION_MASK_CLIENT, -+ const SUBSCRIPTION_MASK_SAMPLE_CACHE = ffi::PA_SUBSCRIPTION_MASK_SAMPLE_CACHE, -+ const SUBSCRIPTION_MASK_SERVER = ffi::PA_SUBSCRIPTION_MASK_SERVER, -+ const SUBSCRIPTION_MASK_AUTOLOAD = ffi::PA_SUBSCRIPTION_MASK_AUTOLOAD, -+ const SUBSCRIPTION_MASK_CARD = ffi::PA_SUBSCRIPTION_MASK_CARD, -+ } -+} -+ -+impl SubscriptionMask { -+ pub fn try_from(x: ffi::pa_subscription_mask_t) -> Option { -+ if (x & !ffi::PA_SUBSCRIPTION_MASK_ALL) == 0 { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+impl Into for SubscriptionMask { -+ fn into(self) -> ffi::pa_subscription_mask_t { -+ self.bits() as ffi::pa_subscription_mask_t -+ } -+} -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum SubscriptionEventFacility { -+ Sink = ffi::PA_SUBSCRIPTION_EVENT_SINK, -+ Source = ffi::PA_SUBSCRIPTION_EVENT_SOURCE, -+ SinkInput = ffi::PA_SUBSCRIPTION_EVENT_SINK_INPUT, -+ SourceOutput = ffi::PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT, -+ Module = ffi::PA_SUBSCRIPTION_EVENT_MODULE, -+ Client = ffi::PA_SUBSCRIPTION_EVENT_CLIENT, -+ SampleCache = ffi::PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE, -+ Server = ffi::PA_SUBSCRIPTION_EVENT_SERVER, -+ Autoload = ffi::PA_SUBSCRIPTION_EVENT_AUTOLOAD, -+ Card = ffi::PA_SUBSCRIPTION_EVENT_CARD, -+} -+ -+#[repr(C)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum SubscriptionEventType { -+ New, -+ Change, -+ Remove, -+} -+ -+#[repr(C)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub struct SubscriptionEvent(ffi::pa_subscription_event_type_t); -+impl SubscriptionEvent { -+ pub fn try_from(x: ffi::pa_subscription_event_type_t) -> Option { -+ if (x & !(ffi::PA_SUBSCRIPTION_EVENT_TYPE_MASK | ffi::PA_SUBSCRIPTION_EVENT_FACILITY_MASK)) == 0 { -+ Some(SubscriptionEvent(x)) -+ } else { -+ None -+ } -+ } -+ -+ pub fn event_facility(self) -> SubscriptionEventFacility { -+ unsafe { ::std::mem::transmute(self.0 & ffi::PA_SUBSCRIPTION_EVENT_FACILITY_MASK) } -+ } -+ -+ pub fn event_type(self) -> SubscriptionEventType { -+ unsafe { ::std::mem::transmute(((self.0 & ffi::PA_SUBSCRIPTION_EVENT_TYPE_MASK) >> 4)) } -+ } -+} -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum SeekMode { -+ Relative = ffi::PA_SEEK_RELATIVE, -+ Absolute = ffi::PA_SEEK_ABSOLUTE, -+ RelativeOnRead = ffi::PA_SEEK_RELATIVE_ON_READ, -+ RelativeEnd = ffi::PA_SEEK_RELATIVE_END, -+} -+ -+impl SeekMode { -+ pub fn try_from(x: ffi::pa_seek_mode_t) -> Option { -+ if x >= ffi::PA_SEEK_RELATIVE && x <= ffi::PA_SEEK_RELATIVE_END { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+impl Into for SeekMode { -+ fn into(self) -> ffi::pa_seek_mode_t { -+ self as ffi::pa_seek_mode_t -+ } -+} -+ -+bitflags! { -+ pub flags SinkFlags: u32 { -+ const SINK_HW_VOLUME_CTRL = ffi::PA_SINK_HW_VOLUME_CTRL, -+ const SINK_LATENCY = ffi::PA_SINK_LATENCY, -+ const SINK_HARDWARE = ffi::PA_SINK_HARDWARE, -+ const SINK_NETWORK = ffi::PA_SINK_NETWORK, -+ const SINK_HW_MUTE_CTRL = ffi::PA_SINK_HW_MUTE_CTRL, -+ const SINK_DECIBEL_VOLUME = ffi::PA_SINK_DECIBEL_VOLUME, -+ const SINK_FLAT_VOLUME = ffi::PA_SINK_FLAT_VOLUME, -+ const SINK_DYNAMIC_LATENCY = ffi::PA_SINK_DYNAMIC_LATENCY, -+ const SINK_SET_FORMATS = ffi::PA_SINK_SET_FORMATS, -+ } -+} -+ -+impl SinkFlags { -+ pub fn try_from(x: ffi::pa_sink_flags_t) -> Option { -+ if (x & -+ !(ffi::PA_SOURCE_NOFLAGS | ffi::PA_SOURCE_HW_VOLUME_CTRL | ffi::PA_SOURCE_LATENCY | -+ ffi::PA_SOURCE_HARDWARE | ffi::PA_SOURCE_NETWORK | ffi::PA_SOURCE_HW_MUTE_CTRL | -+ ffi::PA_SOURCE_DECIBEL_VOLUME | -+ ffi::PA_SOURCE_DYNAMIC_LATENCY | ffi::PA_SOURCE_FLAT_VOLUME)) == 0 { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum SinkState { -+ InvalidState = ffi::PA_SINK_INVALID_STATE, -+ Running = ffi::PA_SINK_RUNNING, -+ Idle = ffi::PA_SINK_IDLE, -+ Suspended = ffi::PA_SINK_SUSPENDED, -+ Init = ffi::PA_SINK_INIT, -+ Unlinked = ffi::PA_SINK_UNLINKED, -+} -+ -+bitflags!{ -+ pub flags SourceFlags: u32 { -+ const SOURCE_FLAGS_HW_VOLUME_CTRL = ffi::PA_SOURCE_HW_VOLUME_CTRL, -+ const SOURCE_FLAGS_LATENCY = ffi::PA_SOURCE_LATENCY, -+ const SOURCE_FLAGS_HARDWARE = ffi::PA_SOURCE_HARDWARE, -+ const SOURCE_FLAGS_NETWORK = ffi::PA_SOURCE_NETWORK, -+ const SOURCE_FLAGS_HW_MUTE_CTRL = ffi::PA_SOURCE_HW_MUTE_CTRL, -+ const SOURCE_FLAGS_DECIBEL_VOLUME = ffi::PA_SOURCE_DECIBEL_VOLUME, -+ const SOURCE_FLAGS_DYNAMIC_LATENCY = ffi::PA_SOURCE_DYNAMIC_LATENCY, -+ const SOURCE_FLAGS_FLAT_VOLUME = ffi::PA_SOURCE_FLAT_VOLUME, -+ } -+} -+ -+impl Into for SourceFlags { -+ fn into(self) -> ffi::pa_source_flags_t { -+ self.bits() as ffi::pa_source_flags_t -+ } -+} -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum SourceState { -+ InvalidState = ffi::PA_SOURCE_INVALID_STATE, -+ Running = ffi::PA_SOURCE_RUNNING, -+ Idle = ffi::PA_SOURCE_IDLE, -+ Suspended = ffi::PA_SOURCE_SUSPENDED, -+ Init = ffi::PA_SOURCE_INIT, -+ Unlinked = ffi::PA_SOURCE_UNLINKED, -+} -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum PortAvailable { -+ Unknown = ffi::PA_PORT_AVAILABLE_UNKNOWN, -+ No = ffi::PA_PORT_AVAILABLE_NO, -+ Yes = ffi::PA_PORT_AVAILABLE_YES, -+} -+ -+impl PortAvailable { -+ pub fn try_from(x: ffi::pa_port_available_t) -> Option { -+ if x >= ffi::PA_PORT_AVAILABLE_UNKNOWN && x <= ffi::PA_PORT_AVAILABLE_YES { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+impl Into for PortAvailable { -+ fn into(self) -> ffi::pa_port_available_t { -+ self as ffi::pa_port_available_t -+ } -+} -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum ChannelPosition { -+ Invalid = ffi::PA_CHANNEL_POSITION_INVALID, -+ Mono = ffi::PA_CHANNEL_POSITION_MONO, -+ FrontLeft = ffi::PA_CHANNEL_POSITION_FRONT_LEFT, -+ FrontRight = ffi::PA_CHANNEL_POSITION_FRONT_RIGHT, -+ FrontCenter = ffi::PA_CHANNEL_POSITION_FRONT_CENTER, -+ RearCenter = ffi::PA_CHANNEL_POSITION_REAR_CENTER, -+ RearLeft = ffi::PA_CHANNEL_POSITION_REAR_LEFT, -+ RearRight = ffi::PA_CHANNEL_POSITION_REAR_RIGHT, -+ LowFreqEffects = ffi::PA_CHANNEL_POSITION_LFE, -+ FrontLeftOfCenter = ffi::PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER, -+ FrontRightOfCenter = ffi::PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER, -+ SideLeft = ffi::PA_CHANNEL_POSITION_SIDE_LEFT, -+ SideRight = ffi::PA_CHANNEL_POSITION_SIDE_RIGHT, -+ Aux0 = ffi::PA_CHANNEL_POSITION_AUX0, -+ Aux1 = ffi::PA_CHANNEL_POSITION_AUX1, -+ Aux2 = ffi::PA_CHANNEL_POSITION_AUX2, -+ Aux3 = ffi::PA_CHANNEL_POSITION_AUX3, -+ Aux4 = ffi::PA_CHANNEL_POSITION_AUX4, -+ Aux5 = ffi::PA_CHANNEL_POSITION_AUX5, -+ Aux6 = ffi::PA_CHANNEL_POSITION_AUX6, -+ Aux7 = ffi::PA_CHANNEL_POSITION_AUX7, -+ Aux8 = ffi::PA_CHANNEL_POSITION_AUX8, -+ Aux9 = ffi::PA_CHANNEL_POSITION_AUX9, -+ Aux10 = ffi::PA_CHANNEL_POSITION_AUX10, -+ Aux11 = ffi::PA_CHANNEL_POSITION_AUX11, -+ Aux12 = ffi::PA_CHANNEL_POSITION_AUX12, -+ Aux13 = ffi::PA_CHANNEL_POSITION_AUX13, -+ Aux14 = ffi::PA_CHANNEL_POSITION_AUX14, -+ Aux15 = ffi::PA_CHANNEL_POSITION_AUX15, -+ Aux16 = ffi::PA_CHANNEL_POSITION_AUX16, -+ Aux17 = ffi::PA_CHANNEL_POSITION_AUX17, -+ Aux18 = ffi::PA_CHANNEL_POSITION_AUX18, -+ Aux19 = ffi::PA_CHANNEL_POSITION_AUX19, -+ Aux20 = ffi::PA_CHANNEL_POSITION_AUX20, -+ Aux21 = ffi::PA_CHANNEL_POSITION_AUX21, -+ Aux22 = ffi::PA_CHANNEL_POSITION_AUX22, -+ Aux23 = ffi::PA_CHANNEL_POSITION_AUX23, -+ Aux24 = ffi::PA_CHANNEL_POSITION_AUX24, -+ Aux25 = ffi::PA_CHANNEL_POSITION_AUX25, -+ Aux26 = ffi::PA_CHANNEL_POSITION_AUX26, -+ Aux27 = ffi::PA_CHANNEL_POSITION_AUX27, -+ Aux28 = ffi::PA_CHANNEL_POSITION_AUX28, -+ Aux29 = ffi::PA_CHANNEL_POSITION_AUX29, -+ Aux30 = ffi::PA_CHANNEL_POSITION_AUX30, -+ Aux31 = ffi::PA_CHANNEL_POSITION_AUX31, -+ TopCenter = ffi::PA_CHANNEL_POSITION_TOP_CENTER, -+ TopFrontLeft = ffi::PA_CHANNEL_POSITION_TOP_FRONT_LEFT, -+ TopFrontRight = ffi::PA_CHANNEL_POSITION_TOP_FRONT_RIGHT, -+ TopFrontCenter = ffi::PA_CHANNEL_POSITION_TOP_FRONT_CENTER, -+ TopRearLeft = ffi::PA_CHANNEL_POSITION_TOP_REAR_LEFT, -+ TopRearRight = ffi::PA_CHANNEL_POSITION_TOP_REAR_RIGHT, -+ TopRearCenter = ffi::PA_CHANNEL_POSITION_TOP_REAR_CENTER, -+} -+ -+impl ChannelPosition { -+ pub fn try_from(x: ffi::pa_channel_position_t) -> Option { -+ if x >= ffi::PA_CHANNEL_POSITION_INVALID && x < ffi::PA_CHANNEL_POSITION_MAX { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+impl Default for ChannelPosition { -+ fn default() -> Self { -+ ChannelPosition::Invalid -+ } -+} -+ -+impl Into for ChannelPosition { -+ fn into(self) -> ffi::pa_channel_position_t { -+ self as ffi::pa_channel_position_t -+ } -+} -+pub type Result = ::std::result::Result; -+ -+pub trait CVolumeExt { -+ fn set(&mut self, channels: c_uint, v: Volume); -+ fn set_balance(&mut self, map: &ChannelMap, new_balance: f32); -+} -+ -+impl CVolumeExt for CVolume { -+ fn set(&mut self, channels: c_uint, v: Volume) { -+ unsafe { -+ ffi::pa_cvolume_set(self, channels, v); -+ } -+ } -+ -+ fn set_balance(&mut self, map: &ChannelMap, new_balance: f32) { -+ unsafe { -+ ffi::pa_cvolume_set_balance(self, map, new_balance); -+ } -+ } -+} -+ -+pub trait ChannelMapExt { -+ fn init() -> ChannelMap; -+ fn can_balance(&self) -> bool; -+} -+ -+impl ChannelMapExt for ChannelMap { -+ fn init() -> ChannelMap { -+ let mut cm = ChannelMap::default(); -+ unsafe { -+ ffi::pa_channel_map_init(&mut cm); -+ } -+ cm -+ } -+ fn can_balance(&self) -> bool { -+ unsafe { ffi::pa_channel_map_can_balance(self) > 0 } -+ } -+} -+ -+pub trait ProplistExt { -+ fn proplist(&self) -> Proplist; -+} -+ -+impl ProplistExt for SinkInfo { -+ fn proplist(&self) -> Proplist { -+ unsafe { proplist::from_raw_ptr(self.proplist) } -+ } -+} -+ -+impl ProplistExt for SourceInfo { -+ fn proplist(&self) -> Proplist { -+ unsafe { proplist::from_raw_ptr(self.proplist) } -+ } -+} -+ -+pub trait SampleSpecExt { -+ fn frame_size(&self) -> usize; -+} -+ -+impl SampleSpecExt for SampleSpec { -+ fn frame_size(&self) -> usize { -+ unsafe { ffi::pa_frame_size(self) } -+ } -+} -+ -+pub trait USecExt { -+ fn to_bytes(self, spec: &SampleSpec) -> usize; -+} -+ -+impl USecExt for USec { -+ fn to_bytes(self, spec: &SampleSpec) -> usize { -+ unsafe { ffi::pa_usec_to_bytes(self, spec) } -+ } -+} -+ -+pub fn library_version() -> *const c_char { -+ unsafe { ffi::pa_get_library_version() } -+} -+ -+pub fn sw_volume_from_linear(vol: f64) -> Volume { -+ unsafe { ffi::pa_sw_volume_from_linear(vol) } -+} -+ -+pub fn rtclock_now() -> USec { -+ unsafe { ffi::pa_rtclock_now() } -+} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/mainloop_api.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/mainloop_api.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/mainloop_api.rs.cubeb-pulse-arm 2017-08-04 13:37:46.385821734 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/mainloop_api.rs 2017-08-04 13:37:46.385821734 +0200 -@@ -0,0 +1,58 @@ -+// Copyright © 2017 Mozilla Foundation -+// -+// This program is made available under an ISC-style license. See the -+// accompanying file LICENSE for details. -+ -+use ffi; -+use std::mem; -+use std::os::raw::c_void; -+ -+ -+#[allow(non_camel_case_types)] -+type pa_once_cb_t = Option; -+fn wrap_once_cb(_: F) -> pa_once_cb_t -+ where F: Fn(&MainloopApi, *mut c_void) -+{ -+ assert!(mem::size_of::() == 0); -+ -+ unsafe extern "C" fn wrapped(m: *mut ffi::pa_mainloop_api, userdata: *mut c_void) -+ where F: Fn(&MainloopApi, *mut c_void) -+ { -+ let api = from_raw_ptr(m); -+ let result = mem::transmute::<_, &F>(&())(&api, userdata); -+ mem::forget(api); -+ result -+ } -+ -+ Some(wrapped::) -+} -+ -+pub struct MainloopApi(*mut ffi::pa_mainloop_api); -+ -+impl MainloopApi { -+ pub fn raw_mut(&self) -> &mut ffi::pa_mainloop_api { -+ unsafe { &mut *self.0 } -+ } -+ -+ pub fn once(&self, cb: CB, userdata: *mut c_void) -+ where CB: Fn(&MainloopApi, *mut c_void) -+ { -+ let wrapped = wrap_once_cb(cb); -+ unsafe { -+ ffi::pa_mainloop_api_once(self.raw_mut(), wrapped, userdata); -+ } -+ } -+ -+ pub fn time_free(&self, e: *mut ffi::pa_time_event) { -+ unsafe { -+ if let Some(f) = self.raw_mut().time_free { -+ f(e); -+ } -+ } -+ } -+} -+ -+pub unsafe fn from_raw_ptr(raw: *mut ffi::pa_mainloop_api) -> MainloopApi { -+ MainloopApi(raw) -+} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/operation.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/operation.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/operation.rs.cubeb-pulse-arm 2017-08-04 13:37:46.385821734 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/operation.rs 2017-08-04 13:37:46.385821734 +0200 -@@ -0,0 +1,43 @@ -+// Copyright © 2017 Mozilla Foundation -+// -+// This program is made available under an ISC-style license. See the -+// accompanying file LICENSE for details. -+ -+use ffi; -+ -+#[derive(Debug)] -+pub struct Operation(*mut ffi::pa_operation); -+ -+impl Operation { -+ pub unsafe fn from_raw_ptr(raw: *mut ffi::pa_operation) -> Operation { -+ Operation(raw) -+ } -+ -+ pub fn cancel(&mut self) { -+ unsafe { -+ ffi::pa_operation_cancel(self.0); -+ } -+ } -+ -+ pub fn get_state(&self) -> ffi::pa_operation_state_t { -+ unsafe { ffi::pa_operation_get_state(self.0) } -+ } -+} -+ -+impl Clone for Operation { -+ fn clone(&self) -> Self { -+ Operation(unsafe { ffi::pa_operation_ref(self.0) }) -+ } -+} -+ -+impl Drop for Operation { -+ fn drop(&mut self) { -+ unsafe { -+ ffi::pa_operation_unref(self.0); -+ } -+ } -+} -+ -+pub unsafe fn from_raw_ptr(raw: *mut ffi::pa_operation) -> Operation { -+ Operation::from_raw_ptr(raw) -+} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/proplist.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/proplist.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/proplist.rs.cubeb-pulse-arm 2017-08-04 13:37:46.385821734 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/proplist.rs 2017-08-04 13:37:46.385821734 +0200 -@@ -0,0 +1,31 @@ -+// Copyright © 2017 Mozilla Foundation -+// -+// This program is made available under an ISC-style license. See the -+// accompanying file LICENSE for details. -+ -+use ffi; -+use std::ffi::{CStr, CString}; -+ -+#[derive(Debug)] -+pub struct Proplist(*mut ffi::pa_proplist); -+ -+impl Proplist { -+ pub fn gets(&self, key: T) -> Option<&CStr> -+ where T: Into> -+ { -+ let key = match CString::new(key) { -+ Ok(k) => k, -+ _ => return None, -+ }; -+ let r = unsafe { ffi::pa_proplist_gets(self.0, key.as_ptr()) }; -+ if r.is_null() { -+ None -+ } else { -+ Some(unsafe { CStr::from_ptr(r) }) -+ } -+ } -+} -+ -+pub unsafe fn from_raw_ptr(raw: *mut ffi::pa_proplist) -> Proplist { -+ return Proplist(raw); -+} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/stream.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/stream.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/stream.rs.cubeb-pulse-arm 2017-08-04 13:37:46.386821731 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/stream.rs 2017-08-04 13:37:46.386821731 +0200 -@@ -0,0 +1,367 @@ -+// Copyright © 2017 Mozilla Foundation -+// -+// This program is made available under an ISC-style license. See the -+// accompanying file LICENSE for details. -+ -+use ::*; -+use context; -+use ffi; -+use operation; -+use std::ffi::CStr; -+use std::mem; -+use std::os::raw::{c_int, c_void}; -+use std::ptr; -+use util::*; -+ -+#[derive(Debug)] -+pub struct Stream(*mut ffi::pa_stream); -+ -+impl Stream { -+ pub fn new<'a, CM>(c: &Context, name: &::std::ffi::CStr, ss: &SampleSpec, map: CM) -> Option -+ where CM: Into> -+ { -+ let ptr = unsafe { -+ ffi::pa_stream_new(c.raw_mut(), -+ name.as_ptr(), -+ ss as *const _, -+ to_ptr(map.into())) -+ }; -+ if ptr.is_null() { -+ None -+ } else { -+ Some(Stream(ptr)) -+ } -+ } -+ -+ #[doc(hidden)] -+ pub fn raw_mut(&self) -> &mut ffi::pa_stream { -+ unsafe { &mut *self.0 } -+ } -+ -+ pub fn unref(self) { -+ unsafe { -+ ffi::pa_stream_unref(self.raw_mut()); -+ } -+ } -+ -+ pub fn get_state(&self) -> StreamState { -+ StreamState::try_from(unsafe { -+ ffi::pa_stream_get_state(self.raw_mut()) -+ }).expect("pa_stream_get_state returned invalid StreamState") -+ } -+ -+ pub fn get_context(&self) -> Option { -+ let ptr = unsafe { ffi::pa_stream_get_context(self.raw_mut()) }; -+ if ptr.is_null() { -+ return None; -+ } -+ -+ let ctx = unsafe { context::from_raw_ptr(ptr) }; -+ Some(ctx) -+ } -+ -+ pub fn get_index(&self) -> u32 { -+ unsafe { ffi::pa_stream_get_index(self.raw_mut()) } -+ } -+ -+ pub fn get_device_name<'a>(&'a self) -> Result<&'a CStr> { -+ let r = unsafe { ffi::pa_stream_get_device_name(self.raw_mut()) }; -+ if r.is_null() { -+ let err = if let Some(c) = self.get_context() { -+ c.errno() -+ } else { -+ ffi::PA_ERR_UNKNOWN -+ }; -+ return Err(ErrorCode::from_error_code(err)); -+ } -+ Ok(unsafe { CStr::from_ptr(r) }) -+ } -+ -+ pub fn is_suspended(&self) -> Result { -+ let r = unsafe { ffi::pa_stream_is_suspended(self.raw_mut()) }; -+ error_result!(r != 0, r) -+ } -+ -+ pub fn is_corked(&self) -> Result { -+ let r = unsafe { ffi::pa_stream_is_corked(self.raw_mut()) }; -+ error_result!(r != 0, r) -+ } -+ -+ pub fn connect_playback<'a, D, A, V, S>(&self, -+ dev: D, -+ attr: A, -+ flags: StreamFlags, -+ volume: V, -+ sync_stream: S) -+ -> Result<()> -+ where D: Into>, -+ A: Into>, -+ V: Into>, -+ S: Into> -+ { -+ let r = unsafe { -+ ffi::pa_stream_connect_playback(self.raw_mut(), -+ str_to_ptr(dev.into()), -+ to_ptr(attr.into()), -+ flags.into(), -+ to_ptr(volume.into()), -+ map_to_mut_ptr(sync_stream.into(), |p| p.0)) -+ }; -+ error_result!((), r) -+ } -+ -+ pub fn connect_record<'a, D, A>(&self, dev: D, attr: A, flags: StreamFlags) -> Result<()> -+ where D: Into>, -+ A: Into> -+ { -+ let r = unsafe { -+ ffi::pa_stream_connect_record(self.raw_mut(), -+ str_to_ptr(dev.into()), -+ to_ptr(attr.into()), -+ flags.into()) -+ }; -+ error_result!((), r) -+ } -+ -+ pub fn disconnect(&self) -> Result<()> { -+ let r = unsafe { ffi::pa_stream_disconnect(self.raw_mut()) }; -+ error_result!((), r) -+ } -+ -+ pub fn begin_write(&self, req_bytes: usize) -> Result<(*mut c_void, usize)> { -+ let mut data: *mut c_void = ptr::null_mut(); -+ let mut nbytes = req_bytes; -+ let r = unsafe { ffi::pa_stream_begin_write(self.raw_mut(), &mut data, &mut nbytes) }; -+ error_result!((data, nbytes), r) -+ } -+ -+ pub fn cancel_write(&self) -> Result<()> { -+ let r = unsafe { ffi::pa_stream_cancel_write(self.raw_mut()) }; -+ error_result!((), r) -+ } -+ -+ pub fn write(&self, data: *const c_void, nbytes: usize, offset: i64, seek: SeekMode) -> Result<()> { -+ let r = unsafe { ffi::pa_stream_write(self.raw_mut(), data, nbytes, None, offset, seek.into()) }; -+ error_result!((), r) -+ } -+ -+ pub unsafe fn peek(&self, data: *mut *const c_void, length: *mut usize) -> Result<()> { -+ let r = ffi::pa_stream_peek(self.raw_mut(), data, length); -+ error_result!((), r) -+ } -+ -+ pub fn drop(&self) -> Result<()> { -+ let r = unsafe { ffi::pa_stream_drop(self.raw_mut()) }; -+ error_result!((), r) -+ } -+ -+ pub fn writable_size(&self) -> Result { -+ let r = unsafe { ffi::pa_stream_writable_size(self.raw_mut()) }; -+ if r == ::std::usize::MAX { -+ let err = if let Some(c) = self.get_context() { -+ c.errno() -+ } else { -+ ffi::PA_ERR_UNKNOWN -+ }; -+ return Err(ErrorCode::from_error_code(err)); -+ } -+ Ok(r) -+ } -+ -+ pub fn readable_size(&self) -> Result { -+ let r = unsafe { ffi::pa_stream_readable_size(self.raw_mut()) }; -+ if r == ::std::usize::MAX { -+ let err = if let Some(c) = self.get_context() { -+ c.errno() -+ } else { -+ ffi::PA_ERR_UNKNOWN -+ }; -+ return Err(ErrorCode::from_error_code(err)); -+ } -+ Ok(r) -+ } -+ -+ pub fn update_timing_info(&self, _: CB, userdata: *mut c_void) -> Result -+ where CB: Fn(&Stream, i32, *mut c_void) -+ { -+ debug_assert_eq!(mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(s: *mut ffi::pa_stream, success: c_int, userdata: *mut c_void) -+ where F: Fn(&Stream, i32, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let mut stm = stream::from_raw_ptr(s); -+ let result = uninitialized::()(&mut stm, success, userdata); -+ forget(stm); -+ -+ result -+ } -+ -+ let r = unsafe { ffi::pa_stream_update_timing_info(self.raw_mut(), Some(wrapped::), userdata) }; -+ if r.is_null() { -+ let err = if let Some(c) = self.get_context() { -+ c.errno() -+ } else { -+ ffi::PA_ERR_UNKNOWN -+ }; -+ return Err(ErrorCode::from_error_code(err)); -+ } -+ Ok(unsafe { operation::from_raw_ptr(r) }) -+ } -+ -+ pub fn clear_state_callback(&self) { -+ unsafe { -+ ffi::pa_stream_set_state_callback(self.raw_mut(), None, ptr::null_mut()); -+ } -+ } -+ -+ pub fn set_state_callback(&self, _: CB, userdata: *mut c_void) -+ where CB: Fn(&Stream, *mut c_void) -+ { -+ debug_assert_eq!(mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(s: *mut ffi::pa_stream, userdata: *mut c_void) -+ where F: Fn(&Stream, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let mut stm = stream::from_raw_ptr(s); -+ let result = uninitialized::()(&mut stm, userdata); -+ forget(stm); -+ -+ result -+ } -+ -+ unsafe { -+ ffi::pa_stream_set_state_callback(self.raw_mut(), Some(wrapped::), userdata); -+ } -+ } -+ -+ pub fn clear_write_callback(&self) { -+ unsafe { -+ ffi::pa_stream_set_write_callback(self.raw_mut(), None, ptr::null_mut()); -+ } -+ } -+ -+ pub fn set_write_callback(&self, _: CB, userdata: *mut c_void) -+ where CB: Fn(&Stream, usize, *mut c_void) -+ { -+ debug_assert_eq!(mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(s: *mut ffi::pa_stream, nbytes: usize, userdata: *mut c_void) -+ where F: Fn(&Stream, usize, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let mut stm = stream::from_raw_ptr(s); -+ let result = uninitialized::()(&mut stm, nbytes, userdata); -+ forget(stm); -+ -+ result -+ } -+ -+ unsafe { -+ ffi::pa_stream_set_write_callback(self.raw_mut(), Some(wrapped::), userdata); -+ } -+ } -+ -+ pub fn clear_read_callback(&self) { -+ unsafe { -+ ffi::pa_stream_set_read_callback(self.raw_mut(), None, ptr::null_mut()); -+ } -+ } -+ -+ pub fn set_read_callback(&self, _: CB, userdata: *mut c_void) -+ where CB: Fn(&Stream, usize, *mut c_void) -+ { -+ debug_assert_eq!(mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(s: *mut ffi::pa_stream, nbytes: usize, userdata: *mut c_void) -+ where F: Fn(&Stream, usize, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let mut stm = stream::from_raw_ptr(s); -+ let result = uninitialized::()(&mut stm, nbytes, userdata); -+ forget(stm); -+ -+ result -+ } -+ -+ unsafe { -+ ffi::pa_stream_set_read_callback(self.raw_mut(), Some(wrapped::), userdata); -+ } -+ } -+ -+ pub fn cork(&self, b: i32, _: CB, userdata: *mut c_void) -> Result -+ where CB: Fn(&Stream, i32, *mut c_void) -+ { -+ debug_assert_eq!(mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(s: *mut ffi::pa_stream, success: c_int, userdata: *mut c_void) -+ where F: Fn(&Stream, i32, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let mut stm = stream::from_raw_ptr(s); -+ let result = uninitialized::()(&mut stm, success, userdata); -+ forget(stm); -+ -+ result -+ } -+ -+ let r = unsafe { ffi::pa_stream_cork(self.raw_mut(), b, Some(wrapped::), userdata) }; -+ if r.is_null() { -+ let err = if let Some(c) = self.get_context() { -+ c.errno() -+ } else { -+ ffi::PA_ERR_UNKNOWN -+ }; -+ return Err(ErrorCode::from_error_code(err)); -+ } -+ Ok(unsafe { operation::from_raw_ptr(r) }) -+ } -+ -+ pub fn get_time(&self) -> Result<(u64)> { -+ let mut usec: u64 = 0; -+ let r = unsafe { ffi::pa_stream_get_time(self.raw_mut(), &mut usec) }; -+ error_result!(usec, r) -+ } -+ -+ pub fn get_latency(&self) -> Result<(u64, bool)> { -+ let mut usec: u64 = 0; -+ let mut negative: i32 = 0; -+ let r = unsafe { ffi::pa_stream_get_latency(self.raw_mut(), &mut usec, &mut negative) }; -+ error_result!((usec, negative != 0), r) -+ } -+ -+ pub fn get_sample_spec(&self) -> &SampleSpec { -+ unsafe { -+ let ptr = ffi::pa_stream_get_sample_spec(self.raw_mut()); -+ debug_assert!(!ptr.is_null()); -+ &*ptr -+ } -+ } -+ -+ pub fn get_channel_map(&self) -> &ChannelMap { -+ unsafe { -+ let ptr = ffi::pa_stream_get_channel_map(self.raw_mut()); -+ debug_assert!(!ptr.is_null()); -+ &*ptr -+ } -+ } -+ -+ pub fn get_buffer_attr(&self) -> &BufferAttr { -+ unsafe { -+ let ptr = ffi::pa_stream_get_buffer_attr(self.raw_mut()); -+ debug_assert!(!ptr.is_null()); -+ &*ptr -+ } -+ } -+} -+ -+#[doc(hidden)] -+pub unsafe fn from_raw_ptr(ptr: *mut ffi::pa_stream) -> Stream { -+ Stream(ptr) -+} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/threaded_mainloop.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/threaded_mainloop.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/threaded_mainloop.rs.cubeb-pulse-arm 2017-08-04 13:37:46.386821731 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/threaded_mainloop.rs 2017-08-04 13:37:46.386821731 +0200 -@@ -0,0 +1,92 @@ -+// Copyright © 2017 Mozilla Foundation -+// -+// This program is made available under an ISC-style license. See the -+// accompanying file LICENSE for details. -+ -+use ErrorCode; -+use Result; -+use ffi; -+use mainloop_api; -+use mainloop_api::MainloopApi; -+ -+#[derive(Debug)] -+pub struct ThreadedMainloop(*mut ffi::pa_threaded_mainloop); -+ -+impl ThreadedMainloop { -+ pub unsafe fn from_raw_ptr(raw: *mut ffi::pa_threaded_mainloop) -> Self { -+ ThreadedMainloop(raw) -+ } -+ -+ pub fn new() -> Self { -+ unsafe { ThreadedMainloop::from_raw_ptr(ffi::pa_threaded_mainloop_new()) } -+ } -+ -+ pub fn raw_mut(&self) -> &mut ffi::pa_threaded_mainloop { -+ unsafe { &mut *self.0 } -+ } -+ -+ pub fn is_null(&self) -> bool { -+ self.0.is_null() -+ } -+ -+ pub fn start(&self) -> Result<()> { -+ match unsafe { ffi::pa_threaded_mainloop_start(self.raw_mut()) } { -+ 0 => Ok(()), -+ _ => Err(ErrorCode::from_error_code(ffi::PA_ERR_UNKNOWN)), -+ } -+ } -+ -+ pub fn stop(&self) { -+ unsafe { -+ ffi::pa_threaded_mainloop_stop(self.raw_mut()); -+ } -+ } -+ -+ pub fn lock(&self) { -+ unsafe { -+ ffi::pa_threaded_mainloop_lock(self.raw_mut()); -+ } -+ } -+ -+ pub fn unlock(&self) { -+ unsafe { -+ ffi::pa_threaded_mainloop_unlock(self.raw_mut()); -+ } -+ } -+ -+ pub fn wait(&self) { -+ unsafe { -+ ffi::pa_threaded_mainloop_wait(self.raw_mut()); -+ } -+ } -+ -+ pub fn signal(&self) { -+ unsafe { -+ ffi::pa_threaded_mainloop_signal(self.raw_mut(), 0); -+ } -+ } -+ -+ pub fn get_api(&self) -> MainloopApi { -+ unsafe { mainloop_api::from_raw_ptr(ffi::pa_threaded_mainloop_get_api(self.raw_mut())) } -+ } -+ -+ pub fn in_thread(&self) -> bool { -+ unsafe { ffi::pa_threaded_mainloop_in_thread(self.raw_mut()) != 0 } -+ } -+} -+ -+impl ::std::default::Default for ThreadedMainloop { -+ fn default() -> Self { -+ ThreadedMainloop(::std::ptr::null_mut()) -+ } -+} -+ -+impl ::std::ops::Drop for ThreadedMainloop { -+ fn drop(&mut self) { -+ if !self.is_null() { -+ unsafe { -+ ffi::pa_threaded_mainloop_free(self.raw_mut()); -+ } -+ } -+ } -+} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/util.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/util.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/util.rs.cubeb-pulse-arm 2017-08-04 13:37:46.386821731 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/util.rs 2017-08-04 13:37:46.386821731 +0200 -@@ -0,0 +1,41 @@ -+// Copyright © 2017 Mozilla Foundation -+// -+// This program is made available under an ISC-style license. See the -+// accompanying file LICENSE for details. -+ -+use std::ffi::CStr; -+use std::os::raw::c_char; -+use std::ptr; -+ -+pub trait UnwrapCStr { -+ fn unwrap_cstr(self) -> *const c_char; -+} -+ -+impl<'a, U> UnwrapCStr for U -+ where U: Into> -+{ -+ fn unwrap_cstr(self) -> *const c_char { -+ self.into().map(|o| o.as_ptr()).unwrap_or(0 as *const _) -+ } -+} -+ -+pub fn map_to_mut_ptr *mut U>(t: Option<&mut T>, f: F) -> *mut U { -+ match t { -+ Some(x) => f(x), -+ None => ptr::null_mut(), -+ } -+} -+ -+pub fn str_to_ptr(s: Option<&CStr>) -> *const c_char { -+ match s { -+ Some(x) => x.as_ptr(), -+ None => ptr::null(), -+ } -+} -+ -+pub fn to_ptr(t: Option<&T>) -> *const T { -+ match t { -+ Some(x) => x as *const T, -+ None => ptr::null(), -+ } -+} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/README.md.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/README.md ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/README.md.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/README.md 2017-08-04 13:37:46.383821740 +0200 -@@ -3,3 +3,4 @@ - Implementation of PulseAudio backend for Cubeb written in Rust. - - [![Travis Build Status](https://travis-ci.org/djg/cubeb-pulse-rs.svg?branch=master)](https://travis-ci.org/djg/cubeb-pulse-rs) -+[![Travis Build Status](https://travis-ci.org/djg/cubeb-pulse-rs.svg?branch=dev)](https://travis-ci.org/djg/cubeb-pulse-rs) -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/README_MOZILLA.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/README_MOZILLA ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/README_MOZILLA.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/README_MOZILLA 2017-08-04 13:37:46.383821740 +0200 -@@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla - - The cubeb-pulse-rs git repository is: https://github.com/djg/cubeb-pulse-rs.git - --The git commit ID used was dbcd7f96aea8d249a4b78f9a7597768c9dff22eb (2017-04-25 11:42:10 +1000) -+The git commit ID used was 64515819cdf54a16626df5dce5f5c7cb1220d53b (2017-06-19 17:41:30 +1000) -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/context.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/context.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/context.rs.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/context.rs 2017-08-04 13:50:38.145480458 +0200 -@@ -4,67 +4,60 @@ - // accompanying file LICENSE for details. - - use backend::*; --use backend::cork_state::CorkState; - use capi::PULSE_OPS; - use cubeb; -+use pulse::{self, ProplistExt}; - use pulse_ffi::*; - use semver; - use std::default::Default; --use std::ffi::CStr; -+use std::ffi::{CStr, CString}; - use std::mem; --use std::os::raw::{c_char, c_int, c_void}; -+use std::os::raw::{c_char, c_void}; - use std::ptr; - --macro_rules! dup_str { -- ($Dst: expr, $Src: expr) => { -- if !$Dst.is_null() { -- pa_xfree($Dst as *mut _); -- } -- -- $Dst = pa_xstrdup($Src); -- } --} -- --fn pa_channel_to_cubeb_channel(channel: pa_channel_position_t) -> cubeb::Channel { -- assert_ne!(channel, PA_CHANNEL_POSITION_INVALID); -+fn pa_channel_to_cubeb_channel(channel: pulse::ChannelPosition) -> cubeb::Channel { -+ use pulse::ChannelPosition; -+ assert_ne!(channel, ChannelPosition::Invalid); - match channel { -- PA_CHANNEL_POSITION_MONO => cubeb::CHANNEL_MONO, -- PA_CHANNEL_POSITION_FRONT_LEFT => cubeb::CHANNEL_LEFT, -- PA_CHANNEL_POSITION_FRONT_RIGHT => cubeb::CHANNEL_RIGHT, -- PA_CHANNEL_POSITION_FRONT_CENTER => cubeb::CHANNEL_CENTER, -- PA_CHANNEL_POSITION_SIDE_LEFT => cubeb::CHANNEL_LS, -- PA_CHANNEL_POSITION_SIDE_RIGHT => cubeb::CHANNEL_RS, -- PA_CHANNEL_POSITION_REAR_LEFT => cubeb::CHANNEL_RLS, -- PA_CHANNEL_POSITION_REAR_CENTER => cubeb::CHANNEL_RCENTER, -- PA_CHANNEL_POSITION_REAR_RIGHT => cubeb::CHANNEL_RRS, -- PA_CHANNEL_POSITION_LFE => cubeb::CHANNEL_LFE, -+ ChannelPosition::Mono => cubeb::CHANNEL_MONO, -+ ChannelPosition::FrontLeft => cubeb::CHANNEL_LEFT, -+ ChannelPosition::FrontRight => cubeb::CHANNEL_RIGHT, -+ ChannelPosition::FrontCenter => cubeb::CHANNEL_CENTER, -+ ChannelPosition::SideLeft => cubeb::CHANNEL_LS, -+ ChannelPosition::SideRight => cubeb::CHANNEL_RS, -+ ChannelPosition::RearLeft => cubeb::CHANNEL_RLS, -+ ChannelPosition::RearCenter => cubeb::CHANNEL_RCENTER, -+ ChannelPosition::RearRight => cubeb::CHANNEL_RRS, -+ ChannelPosition::LowFreqEffects => cubeb::CHANNEL_LFE, - _ => cubeb::CHANNEL_INVALID, - } - } - --fn channel_map_to_layout(cm: &pa_channel_map) -> cubeb::ChannelLayout { -+fn channel_map_to_layout(cm: &pulse::ChannelMap) -> cubeb::ChannelLayout { -+ use pulse::ChannelPosition; - let mut cubeb_map: cubeb::ChannelMap = Default::default(); - cubeb_map.channels = cm.channels as u32; - for i in 0usize..cm.channels as usize { -- cubeb_map.map[i] = pa_channel_to_cubeb_channel(cm.map[i]); -+ cubeb_map.map[i] = pa_channel_to_cubeb_channel(ChannelPosition::try_from(cm.map[i]) -+ .unwrap_or(ChannelPosition::Invalid)); - } - unsafe { cubeb::cubeb_channel_map_to_layout(&cubeb_map) } - } - - #[derive(Debug)] - pub struct DefaultInfo { -- pub sample_spec: pa_sample_spec, -- pub channel_map: pa_channel_map, -- pub flags: pa_sink_flags_t, -+ pub sample_spec: pulse::SampleSpec, -+ pub channel_map: pulse::ChannelMap, -+ pub flags: pulse::SinkFlags, - } - - #[derive(Debug)] - pub struct Context { - pub ops: *const cubeb::Ops, -- pub mainloop: *mut pa_threaded_mainloop, -- pub context: *mut pa_context, -+ pub mainloop: pulse::ThreadedMainloop, -+ pub context: Option, - pub default_sink_info: Option, -- pub context_name: *const c_char, -+ pub context_name: Option, - pub collection_changed_callback: cubeb::DeviceCollectionChangedCallback, - pub collection_changed_user_ptr: *mut c_void, - pub error: bool, -@@ -82,7 +75,7 @@ impl Drop for Context { - - impl Context { - #[cfg(feature = "pulse-dlopen")] -- fn _new(name: *const i8) -> Result> { -+ fn _new(name: Option) -> Result> { - let libpulse = unsafe { open() }; - if libpulse.is_none() { - return Err(cubeb::ERROR); -@@ -91,12 +84,12 @@ impl Context { - let ctx = Box::new(Context { - ops: &PULSE_OPS, - libpulse: libpulse.unwrap(), -- mainloop: unsafe { pa_threaded_mainloop_new() }, -- context: 0 as *mut _, -+ mainloop: pulse::ThreadedMainloop::new(), -+ context: None, - default_sink_info: None, - context_name: name, - collection_changed_callback: None, -- collection_changed_user_ptr: 0 as *mut _, -+ collection_changed_user_ptr: ptr::null_mut(), - error: true, - version_0_9_8: false, - version_2_0_0: false, -@@ -106,15 +99,15 @@ impl Context { - } - - #[cfg(not(feature = "pulse-dlopen"))] -- fn _new(name: *const i8) -> Result> { -+ fn _new(name: Option) -> Result> { - Ok(Box::new(Context { - ops: &PULSE_OPS, -- mainloop: unsafe { pa_threaded_mainloop_new() }, -- context: 0 as *mut _, -+ mainloop: pulse::ThreadedMainloop::new(), -+ context: None, - default_sink_info: None, - context_name: name, - collection_changed_callback: None, -- collection_changed_user_ptr: 0 as *mut _, -+ collection_changed_user_ptr: ptr::null_mut(), - error: true, - version_0_9_8: false, - version_2_0_0: false, -@@ -122,53 +115,66 @@ impl Context { - } - - pub fn new(name: *const c_char) -> Result> { -+ fn server_info_cb(context: &pulse::Context, info: &pulse::ServerInfo, u: *mut c_void) { -+ fn sink_info_cb(_: &pulse::Context, i: *const pulse::SinkInfo, eol: i32, u: *mut c_void) { -+ let mut ctx = unsafe { &mut *(u as *mut Context) }; -+ if eol == 0 { -+ let info = unsafe { &*i }; -+ let flags = pulse::SinkFlags::try_from(info.flags).expect("SinkInfo contains invalid flags"); -+ ctx.default_sink_info = Some(DefaultInfo { -+ sample_spec: info.sample_spec, -+ channel_map: info.channel_map, -+ flags: flags, -+ }); -+ } -+ ctx.mainloop.signal(); -+ } -+ -+ let _ = context.get_sink_info_by_name(unsafe { CStr::from_ptr(info.default_sink_name) }, -+ sink_info_cb, -+ u); -+ } -+ -+ let name = super::try_cstr_from(name).map(|s| s.to_owned()); - let mut ctx = try!(Context::_new(name)); - -- unsafe { pa_threaded_mainloop_start(ctx.mainloop) }; -+ if ctx.mainloop.start().is_err() { -+ ctx.destroy(); -+ return Err(cubeb::ERROR); -+ } - -- if ctx.pulse_context_init() != cubeb::OK { -+ if ctx.context_init() != cubeb::OK { - ctx.destroy(); - return Err(cubeb::ERROR); - } - -- unsafe { -- /* server_info_callback performs a second async query, -- * which is responsible for initializing default_sink_info -- * and signalling the mainloop to end the wait. */ -- pa_threaded_mainloop_lock(ctx.mainloop); -- let o = pa_context_get_server_info(ctx.context, -- Some(server_info_callback), -- ctx.as_mut() as *mut Context as *mut _); -- if !o.is_null() { -- ctx.operation_wait(ptr::null_mut(), o); -- pa_operation_unref(o); -+ ctx.mainloop.lock(); -+ /* server_info_callback performs a second async query, -+ * which is responsible for initializing default_sink_info -+ * and signalling the mainloop to end the wait. */ -+ let user_data: *mut c_void = ctx.as_mut() as *mut _ as *mut _; -+ if let Some(ref context) = ctx.context { -+ if let Ok(o) = context.get_server_info(server_info_cb, user_data) { -+ ctx.operation_wait(None, &o); - } -- pa_threaded_mainloop_unlock(ctx.mainloop); -- assert!(ctx.default_sink_info.is_some()); - } -+ assert!(ctx.default_sink_info.is_some()); -+ ctx.mainloop.unlock(); - - // Return the result. - Ok(ctx) - } - - pub fn destroy(&mut self) { -- if !self.context.is_null() { -- unsafe { self.pulse_context_destroy() }; -- } -- assert!(self.context.is_null()); -+ self.context_destroy(); - - if !self.mainloop.is_null() { -- unsafe { -- pa_threaded_mainloop_stop(self.mainloop); -- pa_threaded_mainloop_free(self.mainloop); -- self.mainloop = ptr::null_mut(); -- } -+ self.mainloop.stop(); - } -- assert!(self.mainloop.is_null()); - } - - pub fn new_stream(&mut self, -- stream_name: *const c_char, -+ stream_name: &CStr, - input_device: cubeb::DeviceId, - input_stream_params: Option, - output_device: cubeb::DeviceId, -@@ -178,7 +184,7 @@ impl Context { - state_callback: cubeb::StateCallback, - user_ptr: *mut c_void) - -> Result> { -- if self.error && self.pulse_context_init() != 0 { -+ if self.error && self.context_init() != 0 { - return Err(cubeb::ERROR); - } - -@@ -221,41 +227,151 @@ impl Context { - } - - pub fn enumerate_devices(&self, devtype: cubeb::DeviceType) -> Result { -- let mut user_data: PulseDevListData = Default::default(); -- user_data.context = self as *const _ as *mut _; -+ fn add_output_device(_: &pulse::Context, i: *const pulse::SinkInfo, eol: i32, user_data: *mut c_void) { -+ if eol != 0 { -+ return; -+ } - -- unsafe { -- pa_threaded_mainloop_lock(self.mainloop); -+ debug_assert!(!i.is_null()); -+ debug_assert!(!user_data.is_null()); -+ -+ let mut list_data = unsafe { &mut *(user_data as *mut PulseDevListData) }; -+ let info = unsafe { &*i }; -+ -+ let group_id = match info.proplist().gets("sysfs.path") { -+ Some(p) => p.to_owned().into_raw(), -+ _ => ptr::null_mut(), -+ }; -+ -+ let vendor_name = match info.proplist().gets("device.vendor.name") { -+ Some(p) => p.to_owned().into_raw(), -+ _ => ptr::null_mut(), -+ }; -+ -+ let info_name = unsafe { CStr::from_ptr(info.name) }.to_owned(); -+ let info_description = unsafe { CStr::from_ptr(info.description) }.to_owned(); -+ -+ let preferred = if info_name == list_data.default_sink_name { -+ cubeb::DEVICE_PREF_ALL -+ } else { -+ cubeb::DevicePref::empty() -+ }; -+ -+ let ctx = &(*list_data.context); -+ -+ let device_id = info_name.into_raw(); -+ let friendly_name = info_description.into_raw(); -+ let devinfo = cubeb::DeviceInfo { -+ device_id: device_id, -+ devid: device_id as cubeb::DeviceId, -+ friendly_name: friendly_name, -+ group_id: group_id, -+ vendor_name: vendor_name, -+ devtype: cubeb::DEVICE_TYPE_OUTPUT, -+ state: ctx.state_from_port(info.active_port), -+ preferred: preferred, -+ format: cubeb::DeviceFmt::all(), -+ default_format: pulse_format_to_cubeb_format(info.sample_spec.format), -+ max_channels: info.channel_map.channels as u32, -+ min_rate: 1, -+ max_rate: PA_RATE_MAX, -+ default_rate: info.sample_spec.rate, -+ latency_lo: 0, -+ latency_hi: 0, -+ }; -+ list_data.devinfo.push(devinfo); -+ -+ ctx.mainloop.signal(); -+ } -+ -+ fn add_input_device(_: &pulse::Context, i: *const pulse::SourceInfo, eol: i32, user_data: *mut c_void) { -+ if eol != 0 { -+ return; -+ } -+ -+ debug_assert!(!user_data.is_null()); -+ debug_assert!(!i.is_null()); -+ -+ let mut list_data = unsafe { &mut *(user_data as *mut PulseDevListData) }; -+ let info = unsafe { &*i }; -+ -+ let group_id = match info.proplist().gets("sysfs.path") { -+ Some(p) => p.to_owned().into_raw(), -+ _ => ptr::null_mut(), -+ }; -+ -+ let vendor_name = match info.proplist().gets("device.vendor.name") { -+ Some(p) => p.to_owned().into_raw(), -+ _ => ptr::null_mut(), -+ }; - -- let o = pa_context_get_server_info(self.context, -- Some(pulse_server_info_cb), -- &mut user_data as *mut _ as *mut _); -- if !o.is_null() { -- self.operation_wait(ptr::null_mut(), o); -- pa_operation_unref(o); -+ let info_name = unsafe { CStr::from_ptr(info.name) }.to_owned(); -+ let info_description = unsafe { CStr::from_ptr(info.description) }.to_owned(); -+ -+ let preferred = if info_name == list_data.default_source_name { -+ cubeb::DEVICE_PREF_ALL -+ } else { -+ cubeb::DevicePref::empty() -+ }; -+ -+ let ctx = &(*list_data.context); -+ let device_id = info_name.into_raw(); -+ let friendly_name = info_description.into_raw(); -+ let devinfo = cubeb::DeviceInfo { -+ device_id: device_id, -+ devid: device_id as cubeb::DeviceId, -+ friendly_name: friendly_name, -+ group_id: group_id, -+ vendor_name: vendor_name, -+ devtype: cubeb::DEVICE_TYPE_INPUT, -+ state: ctx.state_from_port(info.active_port), -+ preferred: preferred, -+ format: cubeb::DeviceFmt::all(), -+ default_format: pulse_format_to_cubeb_format(info.sample_spec.format), -+ max_channels: info.channel_map.channels as u32, -+ min_rate: 1, -+ max_rate: PA_RATE_MAX, -+ default_rate: info.sample_spec.rate, -+ latency_lo: 0, -+ latency_hi: 0, -+ }; -+ -+ list_data.devinfo.push(devinfo); -+ -+ ctx.mainloop.signal(); -+ } -+ -+ fn default_device_names(_: &pulse::Context, info: &pulse::ServerInfo, user_data: *mut c_void) { -+ let list_data = unsafe { &mut *(user_data as *mut PulseDevListData) }; -+ -+ list_data.default_sink_name = unsafe { CStr::from_ptr(info.default_sink_name) }.to_owned(); -+ list_data.default_source_name = unsafe { CStr::from_ptr(info.default_source_name) }.to_owned(); -+ -+ (*list_data.context).mainloop.signal(); -+ } -+ -+ let mut user_data = PulseDevListData::new(self); -+ -+ if let Some(ref context) = self.context { -+ self.mainloop.lock(); -+ -+ if let Ok(o) = context.get_server_info(default_device_names, &mut user_data as *mut _ as *mut _) { -+ self.operation_wait(None, &o); - } - - if devtype == cubeb::DEVICE_TYPE_OUTPUT { -- let o = pa_context_get_sink_info_list(self.context, -- Some(pulse_sink_info_cb), -- &mut user_data as *mut _ as *mut _); -- if !o.is_null() { -- self.operation_wait(ptr::null_mut(), o); -- pa_operation_unref(o); -+ if let Ok(o) = context.get_sink_info_list(add_output_device, &mut user_data as *mut _ as *mut _) { -+ self.operation_wait(None, &o); - } - } - - if devtype == cubeb::DEVICE_TYPE_INPUT { -- let o = pa_context_get_source_info_list(self.context, -- Some(pulse_source_info_cb), -- &mut user_data as *mut _ as *mut _); -- if !o.is_null() { -- self.operation_wait(ptr::null_mut(), o); -- pa_operation_unref(o); -+ if let Ok(o) = context.get_source_info_list(add_input_device, &mut user_data as *mut _ as *mut _) { -+ self.operation_wait(None, &o); - } - } - -- pa_threaded_mainloop_unlock(self.mainloop); -+ self.mainloop.unlock(); - } - - // Extract the array of cubeb_device_info from -@@ -282,16 +398,16 @@ impl Context { - coll.count); - for dev in devices.iter_mut() { - if !dev.device_id.is_null() { -- pa_xfree(dev.device_id as *mut _); -+ let _ = CString::from_raw(dev.device_id as *mut _); - } - if !dev.group_id.is_null() { -- pa_xfree(dev.group_id as *mut _); -+ let _ = CString::from_raw(dev.group_id as *mut _); - } - if !dev.vendor_name.is_null() { -- pa_xfree(dev.vendor_name as *mut _); -+ let _ = CString::from_raw(dev.vendor_name as *mut _); - } - if !dev.friendly_name.is_null() { -- pa_xfree(dev.friendly_name as *mut _); -+ let _ = CString::from_raw(dev.friendly_name as *mut _); - } - } - } -@@ -302,115 +418,125 @@ impl Context { - cb: cubeb::DeviceCollectionChangedCallback, - user_ptr: *mut c_void) - -> i32 { -- unsafe extern "C" fn subscribe_success(_: *mut pa_context, success: i32, user_data: *mut c_void) { -- let ctx = &*(user_data as *mut Context); -+ fn update_collection(_: &pulse::Context, event: pulse::SubscriptionEvent, index: u32, user_data: *mut c_void) { -+ let mut ctx = unsafe { &mut *(user_data as *mut Context) }; -+ -+ let (f, t) = (event.event_facility(), event.event_type()); -+ match f { -+ pulse::SubscriptionEventFacility::Source | -+ pulse::SubscriptionEventFacility::Sink => { -+ match t { -+ pulse::SubscriptionEventType::Remove | -+ pulse::SubscriptionEventType::New => { -+ if cubeb::log_enabled() { -+ let op = if t == pulse::SubscriptionEventType::New { -+ "Adding" -+ } else { -+ "Removing" -+ }; -+ let dev = if f == pulse::SubscriptionEventFacility::Sink { -+ "sink" -+ } else { -+ "source " -+ }; -+ log!("{} {} index {}", op, dev, index); -+ -+ unsafe { -+ ctx.collection_changed_callback.unwrap()(ctx as *mut _ as *mut _, -+ ctx.collection_changed_user_ptr); -+ } -+ } -+ }, -+ _ => {}, -+ } -+ }, -+ _ => {}, -+ } -+ } -+ -+ fn success(_: &pulse::Context, success: i32, user_data: *mut c_void) { -+ let ctx = unsafe { &*(user_data as *mut Context) }; - debug_assert_ne!(success, 0); -- pa_threaded_mainloop_signal(ctx.mainloop, 0); -+ ctx.mainloop.signal(); - } - - self.collection_changed_callback = cb; - self.collection_changed_user_ptr = user_ptr; - -- unsafe { -- pa_threaded_mainloop_lock(self.mainloop); -+ let user_data: *mut c_void = self as *mut _ as *mut _; -+ if let Some(ref context) = self.context { -+ self.mainloop.lock(); - -- let mut mask: pa_subscription_mask_t = PA_SUBSCRIPTION_MASK_NULL; -+ let mut mask = pulse::SubscriptionMask::empty(); - if self.collection_changed_callback.is_none() { - // Unregister subscription -- pa_context_set_subscribe_callback(self.context, None, ptr::null_mut()); -+ context.clear_subscribe_callback(); - } else { -- pa_context_set_subscribe_callback(self.context, -- Some(pulse_subscribe_callback), -- self as *mut _ as *mut _); -- if devtype == cubeb::DEVICE_TYPE_INPUT { -- mask |= PA_SUBSCRIPTION_MASK_SOURCE -+ context.set_subscribe_callback(update_collection, user_data); -+ if devtype.contains(cubeb::DEVICE_TYPE_INPUT) { -+ mask |= pulse::SUBSCRIPTION_MASK_SOURCE - }; -- if devtype == cubeb::DEVICE_TYPE_OUTPUT { -- mask |= PA_SUBSCRIPTION_MASK_SOURCE -+ if devtype.contains(cubeb::DEVICE_TYPE_OUTPUT) { -+ mask = pulse::SUBSCRIPTION_MASK_SINK - }; - } - -- let o = pa_context_subscribe(self.context, -- mask, -- Some(subscribe_success), -- self as *const _ as *mut _); -- if o.is_null() { -+ if let Ok(o) = context.subscribe(mask, success, self as *const _ as *mut _) { -+ self.operation_wait(None, &o); -+ } else { - log!("Context subscribe failed"); - return cubeb::ERROR; - } -- self.operation_wait(ptr::null_mut(), o); -- pa_operation_unref(o); - -- pa_threaded_mainloop_unlock(self.mainloop); -+ self.mainloop.unlock(); - } - - cubeb::OK - } - -- // -- -- pub fn pulse_stream_cork(&self, stream: *mut pa_stream, state: CorkState) { -- unsafe extern "C" fn cork_success(_: *mut pa_stream, _: i32, u: *mut c_void) { -- let mainloop = u as *mut pa_threaded_mainloop; -- pa_threaded_mainloop_signal(mainloop, 0); -+ pub fn context_init(&mut self) -> i32 { -+ fn error_state(c: &pulse::Context, u: *mut c_void) { -+ let mut ctx = unsafe { &mut *(u as *mut Context) }; -+ if !c.get_state().is_good() { -+ ctx.error = true; -+ } -+ ctx.mainloop.signal(); - } - -- if stream.is_null() { -- return; -+ if self.context.is_some() { -+ debug_assert!(self.error); -+ self.context_destroy(); - } - -- let o = unsafe { -- pa_stream_cork(stream, -- state.is_cork() as i32, -- Some(cork_success), -- self.mainloop as *mut _) -+ self.context = { -+ let name = match self.context_name.as_ref() { -+ Some(s) => Some(s.as_ref()), -+ None => None, -+ }; -+ pulse::Context::new(&self.mainloop.get_api(), name) - }; - -- if !o.is_null() { -- self.operation_wait(stream, o); -- unsafe { pa_operation_unref(o) }; -+ let context_ptr: *mut c_void = self as *mut _ as *mut _; -+ if self.context.is_none() { -+ return cubeb::ERROR; - } -- } - -- pub fn pulse_context_init(&mut self) -> i32 { -- unsafe extern "C" fn error_state(c: *mut pa_context, u: *mut c_void) { -- let mut ctx = &mut *(u as *mut Context); -- if !PA_CONTEXT_IS_GOOD(pa_context_get_state(c)) { -- ctx.error = true; -- } -- pa_threaded_mainloop_signal(ctx.mainloop, 0); -+ self.mainloop.lock(); -+ if let Some(ref context) = self.context { -+ context.set_state_callback(error_state, context_ptr); -+ let _ = context.connect(None, pulse::ContextFlags::empty(), ptr::null()); - } - -- if !self.context.is_null() { -- debug_assert!(self.error); -- unsafe { self.pulse_context_destroy() }; -+ if !self.wait_until_context_ready() { -+ self.mainloop.unlock(); -+ self.context_destroy(); -+ return cubeb::ERROR; - } - -- unsafe { -- self.context = pa_context_new(pa_threaded_mainloop_get_api(self.mainloop), -- self.context_name); -- -- if self.context.is_null() { -- return cubeb::ERROR; -- } -- -- pa_context_set_state_callback(self.context, Some(error_state), self as *mut _ as *mut _); -- -- pa_threaded_mainloop_lock(self.mainloop); -- pa_context_connect(self.context, ptr::null(), 0, ptr::null()); -- -- if !self.wait_until_context_ready() { -- pa_threaded_mainloop_unlock(self.mainloop); -- self.pulse_context_destroy(); -- assert!(self.context.is_null()); -- return cubeb::ERROR; -- } -+ self.mainloop.unlock(); - -- pa_threaded_mainloop_unlock(self.mainloop); -- } -- -- let version_str = unsafe { CStr::from_ptr(pa_get_library_version()) }; -- if let Ok(version) = semver::Version::parse(version_str.to_string_lossy().as_ref()) { -+ let version_str = unsafe { CStr::from_ptr(pulse::library_version()) }; -+ if let Ok(version) = semver::Version::parse(&version_str.to_string_lossy()) { - self.version_0_9_8 = version >= semver::Version::parse("0.9.8").expect("Failed to parse version"); - self.version_2_0_0 = version >= semver::Version::parse("2.0.0").expect("Failed to parse version"); - } -@@ -420,34 +546,42 @@ impl Context { - cubeb::OK - } - -- unsafe fn pulse_context_destroy(&mut self) { -- unsafe extern "C" fn drain_complete(_c: *mut pa_context, u: *mut c_void) { -- let mainloop = u as *mut pa_threaded_mainloop; -- pa_threaded_mainloop_signal(mainloop, 0); -- } -- -- pa_threaded_mainloop_lock(self.mainloop); -- let o = pa_context_drain(self.context, Some(drain_complete), self.mainloop as *mut _); -- if !o.is_null() { -- self.operation_wait(ptr::null_mut(), o); -- pa_operation_unref(o); -- } -- pa_context_set_state_callback(self.context, None, ptr::null_mut()); -- pa_context_disconnect(self.context); -- pa_context_unref(self.context); -- self.context = ptr::null_mut(); -- pa_threaded_mainloop_unlock(self.mainloop); -+ fn context_destroy(&mut self) { -+ fn drain_complete(_: &pulse::Context, u: *mut c_void) { -+ let ctx = unsafe { &*(u as *mut Context) }; -+ ctx.mainloop.signal(); -+ } -+ -+ let context_ptr: *mut c_void = self as *mut _ as *mut _; -+ match self.context.take() { -+ Some(ctx) => { -+ self.mainloop.lock(); -+ if let Ok(o) = ctx.drain(drain_complete, context_ptr) { -+ self.operation_wait(None, &o); -+ } -+ ctx.clear_state_callback(); -+ ctx.disconnect(); -+ ctx.unref(); -+ self.mainloop.unlock(); -+ }, -+ _ => {}, -+ } - } - -- pub fn operation_wait(&self, stream: *mut pa_stream, o: *mut pa_operation) -> bool { -- unsafe { -- while pa_operation_get_state(o) == PA_OPERATION_RUNNING { -- pa_threaded_mainloop_wait(self.mainloop); -- if !PA_CONTEXT_IS_GOOD(pa_context_get_state(self.context)) { -+ pub fn operation_wait<'a, S>(&self, s: S, o: &pulse::Operation) -> bool -+ where S: Into> -+ { -+ let stream = s.into(); -+ while o.get_state() == PA_OPERATION_RUNNING { -+ self.mainloop.wait(); -+ if let Some(ref context) = self.context { -+ if !context.get_state().is_good() { - return false; - } -+ } - -- if !stream.is_null() && !PA_STREAM_IS_GOOD(pa_stream_get_state(stream)) { -+ if let Some(stm) = stream { -+ if !stm.get_state().is_good() { - return false; - } - } -@@ -457,36 +591,23 @@ impl Context { - } - - pub fn wait_until_context_ready(&self) -> bool { -- loop { -- let state = unsafe { pa_context_get_state(self.context) }; -- if !PA_CONTEXT_IS_GOOD(state) { -- return false; -- } -- if state == PA_CONTEXT_READY { -- break; -- } -- unsafe { -- pa_threaded_mainloop_wait(self.mainloop); -+ if let Some(ref context) = self.context { -+ loop { -+ let state = context.get_state(); -+ if !state.is_good() { -+ return false; -+ } -+ if state == pulse::ContextState::Ready { -+ break; -+ } -+ self.mainloop.wait(); - } - } - - true - } - -- fn state_from_sink_port(&self, i: *const pa_port_info) -> cubeb::DeviceState { -- if !i.is_null() { -- let info = unsafe { *i }; -- if self.version_2_0_0 && info.available == PA_PORT_AVAILABLE_NO { -- cubeb::DeviceState::Unplugged -- } else { -- cubeb::DeviceState::Enabled -- } -- } else { -- cubeb::DeviceState::Enabled -- } -- } -- -- fn state_from_source_port(&self, i: *mut pa_port_info) -> cubeb::DeviceState { -+ fn state_from_port(&self, i: *const pa_port_info) -> cubeb::DeviceState { - if !i.is_null() { - let info = unsafe { *i }; - if self.version_2_0_0 && info.available == PA_PORT_AVAILABLE_NO { -@@ -500,62 +621,30 @@ impl Context { - } - } - --// Callbacks --unsafe extern "C" fn server_info_callback(context: *mut pa_context, info: *const pa_server_info, u: *mut c_void) { -- unsafe extern "C" fn sink_info_callback(_context: *mut pa_context, -- info: *const pa_sink_info, -- eol: i32, -- u: *mut c_void) { -- let mut ctx = &mut *(u as *mut Context); -- if eol == 0 { -- let info = *info; -- ctx.default_sink_info = Some(DefaultInfo { -- sample_spec: info.sample_spec, -- channel_map: info.channel_map, -- flags: info.flags, -- }); -- } -- pa_threaded_mainloop_signal(ctx.mainloop, 0); -- } -- -- let o = pa_context_get_sink_info_by_name(context, -- (*info).default_sink_name, -- Some(sink_info_callback), -- u); -- if !o.is_null() { -- pa_operation_unref(o); -- } --} -- --struct PulseDevListData { -- default_sink_name: *mut c_char, -- default_source_name: *mut c_char, -+struct PulseDevListData<'a> { -+ default_sink_name: CString, -+ default_source_name: CString, - devinfo: Vec, -- context: *mut Context, -+ context: &'a Context, - } - --impl Drop for PulseDevListData { -- fn drop(&mut self) { -- if !self.default_sink_name.is_null() { -- unsafe { -- pa_xfree(self.default_sink_name as *mut _); -- } -- } -- if !self.default_source_name.is_null() { -- unsafe { -- pa_xfree(self.default_source_name as *mut _); -- } -+impl<'a> PulseDevListData<'a> { -+ pub fn new<'b>(context: &'b Context) -> Self -+ where 'b: 'a -+ { -+ PulseDevListData { -+ default_sink_name: CString::default(), -+ default_source_name: CString::default(), -+ devinfo: Vec::new(), -+ context: context, - } - } - } - --impl Default for PulseDevListData { -- fn default() -> Self { -- PulseDevListData { -- default_sink_name: ptr::null_mut(), -- default_source_name: ptr::null_mut(), -- devinfo: Vec::new(), -- context: ptr::null_mut(), -+impl<'a> Drop for PulseDevListData<'a> { -+ fn drop(&mut self) { -+ for elem in &mut self.devinfo { -+ let _ = unsafe { Box::from_raw(elem) }; - } - } - } -@@ -566,192 +655,7 @@ fn pulse_format_to_cubeb_format(format: - PA_SAMPLE_S16BE => cubeb::DEVICE_FMT_S16BE, - PA_SAMPLE_FLOAT32LE => cubeb::DEVICE_FMT_F32LE, - PA_SAMPLE_FLOAT32BE => cubeb::DEVICE_FMT_F32BE, -- _ => { -- panic!("Invalid format"); -- }, -+ // Unsupported format, return F32NE -+ _ => cubeb::CUBEB_FMT_F32NE, - } - } -- --unsafe extern "C" fn pulse_sink_info_cb(_context: *mut pa_context, -- i: *const pa_sink_info, -- eol: i32, -- user_data: *mut c_void) { -- if eol != 0 || i.is_null() { -- return; -- } -- -- debug_assert!(!user_data.is_null()); -- -- let info = *i; -- let mut list_data = &mut *(user_data as *mut PulseDevListData); -- -- let device_id = pa_xstrdup(info.name); -- -- let group_id = { -- let prop = pa_proplist_gets(info.proplist, b"sysfs.path\0".as_ptr() as *const c_char); -- if !prop.is_null() { -- pa_xstrdup(prop) -- } else { -- ptr::null_mut() -- } -- }; -- -- let vendor_name = { -- let prop = pa_proplist_gets(info.proplist, -- b"device.vendor.name\0".as_ptr() as *const c_char); -- if !prop.is_null() { -- pa_xstrdup(prop) -- } else { -- ptr::null_mut() -- } -- }; -- -- let preferred = if strcmp(info.name, list_data.default_sink_name) == 0 { -- cubeb::DEVICE_PREF_ALL -- } else { -- cubeb::DevicePref::empty() -- }; -- -- let ctx = &(*list_data.context); -- -- let devinfo = cubeb::DeviceInfo { -- device_id: device_id, -- devid: device_id as cubeb::DeviceId, -- friendly_name: pa_xstrdup(info.description), -- group_id: group_id, -- vendor_name: vendor_name, -- devtype: cubeb::DEVICE_TYPE_OUTPUT, -- state: ctx.state_from_sink_port(info.active_port), -- preferred: preferred, -- format: cubeb::DeviceFmt::all(), -- default_format: pulse_format_to_cubeb_format(info.sample_spec.format), -- max_channels: info.channel_map.channels as u32, -- min_rate: 1, -- max_rate: PA_RATE_MAX, -- default_rate: info.sample_spec.rate, -- latency_lo: 0, -- latency_hi: 0, -- }; -- list_data.devinfo.push(devinfo); -- -- pa_threaded_mainloop_signal(ctx.mainloop, 0); --} -- --unsafe extern "C" fn pulse_source_info_cb(_context: *mut pa_context, -- i: *const pa_source_info, -- eol: i32, -- user_data: *mut c_void) { -- if eol != 0 || i.is_null() { -- return; -- } -- -- debug_assert!(!user_data.is_null()); -- -- let info = *i; -- let mut list_data = &mut *(user_data as *mut PulseDevListData); -- -- let device_id = pa_xstrdup(info.name); -- -- let group_id = { -- let prop = pa_proplist_gets(info.proplist, b"sysfs.path\0".as_ptr() as *mut c_char); -- if !prop.is_null() { -- pa_xstrdup(prop) -- } else { -- ptr::null_mut() -- } -- }; -- -- let vendor_name = { -- let prop = pa_proplist_gets(info.proplist, -- b"device.vendor.name\0".as_ptr() as *mut c_char); -- if !prop.is_null() { -- pa_xstrdup(prop) -- } else { -- ptr::null_mut() -- } -- }; -- -- let preferred = if strcmp(info.name, list_data.default_source_name) == 0 { -- cubeb::DEVICE_PREF_ALL -- } else { -- cubeb::DevicePref::empty() -- }; -- -- let ctx = &(*list_data.context); -- -- let devinfo = cubeb::DeviceInfo { -- device_id: device_id, -- devid: device_id as cubeb::DeviceId, -- friendly_name: pa_xstrdup(info.description), -- group_id: group_id, -- vendor_name: vendor_name, -- devtype: cubeb::DEVICE_TYPE_INPUT, -- state: ctx.state_from_source_port(info.active_port), -- preferred: preferred, -- format: cubeb::DeviceFmt::all(), -- default_format: pulse_format_to_cubeb_format(info.sample_spec.format), -- max_channels: info.channel_map.channels as u32, -- min_rate: 1, -- max_rate: PA_RATE_MAX, -- default_rate: info.sample_spec.rate, -- latency_lo: 0, -- latency_hi: 0, -- }; -- -- list_data.devinfo.push(devinfo); -- -- pa_threaded_mainloop_signal(ctx.mainloop, 0); --} -- --unsafe extern "C" fn pulse_server_info_cb(_context: *mut pa_context, -- i: *const pa_server_info, -- user_data: *mut c_void) { -- assert!(!i.is_null()); -- let info = *i; -- let list_data = &mut *(user_data as *mut PulseDevListData); -- -- dup_str!(list_data.default_sink_name, info.default_sink_name); -- dup_str!(list_data.default_source_name, info.default_source_name); -- -- pa_threaded_mainloop_signal((*list_data.context).mainloop, 0); --} -- --unsafe extern "C" fn pulse_subscribe_callback(_ctx: *mut pa_context, -- t: pa_subscription_event_type_t, -- index: u32, -- user_data: *mut c_void) { -- let mut ctx = &mut *(user_data as *mut Context); -- -- match t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK { -- PA_SUBSCRIPTION_EVENT_SOURCE | -- PA_SUBSCRIPTION_EVENT_SINK => { -- -- if cubeb::log_enabled() { -- if (t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SOURCE && -- (t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_REMOVE { -- log!("Removing sink index %d", index); -- } else if (t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SOURCE && -- (t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_NEW { -- log!("Adding sink index %d", index); -- } -- if (t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SINK && -- (t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_REMOVE { -- log!("Removing source index %d", index); -- } else if (t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SINK && -- (t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_NEW { -- log!("Adding source index %d", index); -- } -- } -- -- if (t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_REMOVE || -- (t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_NEW { -- ctx.collection_changed_callback.unwrap()(ctx as *mut _ as *mut _, ctx.collection_changed_user_ptr); -- } -- }, -- _ => {}, -- } --} -- --extern "C" { -- pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int; --} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/mod.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/mod.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/mod.rs.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/mod.rs 2017-08-04 13:37:46.386821731 +0200 -@@ -7,8 +7,16 @@ mod context; - mod cork_state; - mod stream; - -+use std::os::raw::c_char; -+use std::ffi::CStr; -+ - pub type Result = ::std::result::Result; - - pub use self::context::Context; - pub use self::stream::Device; - pub use self::stream::Stream; -+ -+// helper to convert *const c_char to Option -+fn try_cstr_from<'str>(s: *const c_char) -> Option<&'str CStr> { -+ if s.is_null() { None } else { Some(unsafe { CStr::from_ptr(s) }) } -+} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/stream.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/stream.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/stream.rs.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/stream.rs 2017-08-04 13:37:46.387821728 +0200 -@@ -6,8 +6,10 @@ - use backend::*; - use backend::cork_state::CorkState; - use cubeb; -+use pulse::{self, CVolumeExt, ChannelMapExt, SampleSpecExt, USecExt}; - use pulse_ffi::*; --use std::os::raw::{c_char, c_long, c_void}; -+use std::ffi::{CStr, CString}; -+use std::os::raw::{c_long, c_void}; - use std::ptr; - - const PULSE_NO_GAIN: f32 = -1.0; -@@ -36,15 +38,12 @@ fn cubeb_channel_to_pa_channel(channel: - MAP[idx as usize] - } - --fn layout_to_channel_map(layout: cubeb::ChannelLayout) -> pa_channel_map { -+fn layout_to_channel_map(layout: cubeb::ChannelLayout) -> pulse::ChannelMap { - assert_ne!(layout, cubeb::LAYOUT_UNDEFINED); - - let order = cubeb::mixer::channel_index_to_order(layout); - -- let mut cm: pa_channel_map = Default::default(); -- unsafe { -- pa_channel_map_init(&mut cm); -- } -+ let mut cm = pulse::ChannelMap::init(); - cm.channels = order.len() as u8; - for (s, d) in order.iter().zip(cm.map.iter_mut()) { - *d = cubeb_channel_to_pa_channel(*s); -@@ -57,24 +56,27 @@ pub struct Device(cubeb::Device); - impl Drop for Device { - fn drop(&mut self) { - unsafe { -- pa_xfree(self.0.input_name as *mut _); -- pa_xfree(self.0.output_name as *mut _); -+ if !self.0.input_name.is_null() { -+ let _ = CString::from_raw(self.0.input_name); -+ } -+ if !self.0.output_name.is_null() { -+ let _ = CString::from_raw(self.0.output_name); -+ } - } - } - } - -- - #[derive(Debug)] - pub struct Stream<'ctx> { - context: &'ctx Context, -- output_stream: *mut pa_stream, -- input_stream: *mut pa_stream, -+ output_stream: Option, -+ input_stream: Option, - data_callback: cubeb::DataCallback, - state_callback: cubeb::StateCallback, - user_ptr: *mut c_void, - drain_timer: *mut pa_time_event, -- output_sample_spec: pa_sample_spec, -- input_sample_spec: pa_sample_spec, -+ output_sample_spec: pulse::SampleSpec, -+ input_sample_spec: pulse::SampleSpec, - shutdown: bool, - volume: f32, - state: cubeb::State, -@@ -88,7 +90,7 @@ impl<'ctx> Drop for Stream<'ctx> { - - impl<'ctx> Stream<'ctx> { - pub fn new(context: &'ctx Context, -- stream_name: *const c_char, -+ stream_name: &CStr, - input_device: cubeb::DeviceId, - input_stream_params: Option, - output_device: cubeb::DeviceId, -@@ -99,83 +101,167 @@ impl<'ctx> Stream<'ctx> { - user_ptr: *mut c_void) - -> Result>> { - -+ fn check_error(s: &pulse::Stream, u: *mut c_void) { -+ let stm = unsafe { &mut *(u as *mut Stream) }; -+ if !s.get_state().is_good() { -+ stm.state_change_callback(cubeb::STATE_ERROR); -+ } -+ stm.context.mainloop.signal(); -+ } -+ -+ fn read_data(s: &pulse::Stream, nbytes: usize, u: *mut c_void) { -+ fn read_from_input(s: &pulse::Stream, buffer: *mut *const c_void, size: *mut usize) -> i32 { -+ let readable_size: i32 = s.readable_size() -+ .and_then(|s| Ok(s as i32)) -+ .unwrap_or(-1); -+ if readable_size > 0 { -+ if unsafe { s.peek(buffer, size).is_err() } { -+ return -1; -+ } -+ } -+ readable_size -+ } -+ -+ logv!("Input callback buffer size {}", nbytes); -+ let mut stm = unsafe { &mut *(u as *mut Stream) }; -+ if stm.shutdown { -+ return; -+ } -+ -+ let mut read_data: *const c_void = ptr::null(); -+ let mut read_size: usize = 0; -+ while read_from_input(s, &mut read_data, &mut read_size) > 0 { -+ /* read_data can be NULL in case of a hole. */ -+ if !read_data.is_null() { -+ let in_frame_size = stm.input_sample_spec.frame_size(); -+ let read_frames = read_size / in_frame_size; -+ -+ if stm.output_stream.is_some() { -+ // input/capture + output/playback operation -+ let out_frame_size = stm.output_sample_spec.frame_size(); -+ let write_size = read_frames * out_frame_size; -+ // Offer full duplex data for writing -+ stm.trigger_user_callback(read_data, write_size); -+ } else { -+ // input/capture only operation. Call callback directly -+ let got = unsafe { -+ stm.data_callback.unwrap()(stm as *mut _ as *mut _, -+ stm.user_ptr, -+ read_data, -+ ptr::null_mut(), -+ read_frames as c_long) -+ }; -+ -+ if got < 0 || got as usize != read_frames { -+ let _ = s.cancel_write(); -+ stm.shutdown = true; -+ break; -+ } -+ } -+ } -+ -+ if read_size > 0 { -+ let _ = s.drop(); -+ } -+ -+ if stm.shutdown { -+ return; -+ } -+ } -+ } -+ -+ fn write_data(_: &pulse::Stream, nbytes: usize, u: *mut c_void) { -+ logv!("Output callback to be written buffer size {}", nbytes); -+ let mut stm = unsafe { &mut *(u as *mut Stream) }; -+ if stm.shutdown || stm.state != cubeb::STATE_STARTED { -+ return; -+ } -+ -+ if stm.input_stream.is_none() { -+ // Output/playback only operation. -+ // Write directly to output -+ debug_assert!(stm.output_stream.is_some()); -+ stm.trigger_user_callback(ptr::null(), nbytes); -+ } -+ } -+ - let mut stm = Box::new(Stream { - context: context, -- output_stream: ptr::null_mut(), -- input_stream: ptr::null_mut(), -+ output_stream: None, -+ input_stream: None, - data_callback: data_callback, - state_callback: state_callback, - user_ptr: user_ptr, - drain_timer: ptr::null_mut(), -- output_sample_spec: pa_sample_spec::default(), -- input_sample_spec: pa_sample_spec::default(), -+ output_sample_spec: pulse::SampleSpec::default(), -+ input_sample_spec: pulse::SampleSpec::default(), - shutdown: false, - volume: PULSE_NO_GAIN, - state: cubeb::STATE_ERROR, - }); - -- unsafe { -- pa_threaded_mainloop_lock(stm.context.mainloop); -+ if let Some(ref context) = stm.context.context { -+ stm.context.mainloop.lock(); -+ -+ // Setup output stream - if let Some(ref stream_params) = output_stream_params { -- match stm.pulse_stream_init(stream_params, stream_name) { -- Ok(s) => stm.output_stream = s, -+ match Stream::stream_init(context, stream_params, stream_name) { -+ Ok(s) => { -+ stm.output_sample_spec = *s.get_sample_spec(); -+ -+ s.set_state_callback(check_error, stm.as_mut() as *mut _ as *mut _); -+ s.set_write_callback(write_data, stm.as_mut() as *mut _ as *mut _); -+ -+ let battr = set_buffering_attribute(latency_frames, &stm.output_sample_spec); -+ let device_name = super::try_cstr_from(output_device as *const _); -+ let _ = s.connect_playback(device_name, -+ &battr, -+ pulse::STREAM_AUTO_TIMING_UPDATE | pulse::STREAM_INTERPOLATE_TIMING | -+ pulse::STREAM_START_CORKED | -+ pulse::STREAM_ADJUST_LATENCY, -+ None, -+ None); -+ -+ stm.output_stream = Some(s); -+ }, - Err(e) => { -- pa_threaded_mainloop_unlock(stm.context.mainloop); -+ stm.context.mainloop.unlock(); - stm.destroy(); - return Err(e); - }, - } - -- stm.output_sample_spec = *pa_stream_get_sample_spec(stm.output_stream); -- -- pa_stream_set_state_callback(stm.output_stream, -- Some(stream_state_callback), -- stm.as_mut() as *mut _ as *mut _); -- pa_stream_set_write_callback(stm.output_stream, -- Some(stream_write_callback), -- stm.as_mut() as *mut _ as *mut _); -- -- let battr = set_buffering_attribute(latency_frames, &stm.output_sample_spec); -- pa_stream_connect_playback(stm.output_stream, -- output_device as *mut c_char, -- &battr, -- PA_STREAM_AUTO_TIMING_UPDATE | PA_STREAM_INTERPOLATE_TIMING | -- PA_STREAM_START_CORKED | -- PA_STREAM_ADJUST_LATENCY, -- ptr::null(), -- ptr::null_mut()); - } - - // Set up input stream - if let Some(ref stream_params) = input_stream_params { -- match stm.pulse_stream_init(stream_params, stream_name) { -- Ok(s) => stm.input_stream = s, -+ match Stream::stream_init(context, stream_params, stream_name) { -+ Ok(s) => { -+ stm.input_sample_spec = *s.get_sample_spec(); -+ -+ s.set_state_callback(check_error, stm.as_mut() as *mut _ as *mut _); -+ s.set_read_callback(read_data, stm.as_mut() as *mut _ as *mut _); -+ -+ let battr = set_buffering_attribute(latency_frames, &stm.input_sample_spec); -+ let device_name = super::try_cstr_from(input_device as *const _); -+ let _ = s.connect_record(device_name, -+ &battr, -+ pulse::STREAM_AUTO_TIMING_UPDATE | pulse::STREAM_INTERPOLATE_TIMING | -+ pulse::STREAM_START_CORKED | -+ pulse::STREAM_ADJUST_LATENCY); -+ -+ stm.input_stream = Some(s); -+ }, - Err(e) => { -- pa_threaded_mainloop_unlock(stm.context.mainloop); -+ stm.context.mainloop.unlock(); - stm.destroy(); - return Err(e); - }, - } - -- stm.input_sample_spec = *(pa_stream_get_sample_spec(stm.input_stream)); -- -- pa_stream_set_state_callback(stm.input_stream, -- Some(stream_state_callback), -- stm.as_mut() as *mut _ as *mut _); -- pa_stream_set_read_callback(stm.input_stream, -- Some(stream_read_callback), -- stm.as_mut() as *mut _ as *mut _); -- -- let battr = set_buffering_attribute(latency_frames, &stm.input_sample_spec); -- pa_stream_connect_record(stm.input_stream, -- input_device as *mut c_char, -- &battr, -- PA_STREAM_AUTO_TIMING_UPDATE | PA_STREAM_INTERPOLATE_TIMING | -- PA_STREAM_START_CORKED | -- PA_STREAM_ADJUST_LATENCY); - } - -- let r = if stm.wait_until_stream_ready() { -+ let r = if stm.wait_until_ready() { - /* force a timing update now, otherwise timing info does not become valid - until some point after initialization has completed. */ - stm.update_timing_info() -@@ -183,7 +269,7 @@ impl<'ctx> Stream<'ctx> { - false - }; - -- pa_threaded_mainloop_unlock(stm.context.mainloop); -+ stm.context.mainloop.unlock(); - - if !r { - stm.destroy(); -@@ -191,10 +277,10 @@ impl<'ctx> Stream<'ctx> { - } - - if cubeb::log_enabled() { -- if output_stream_params.is_some() { -- let output_att = *pa_stream_get_buffer_attr(stm.output_stream); -- log!("Output buffer attributes maxlength %u, tlength %u, \ -- prebuf %u, minreq %u, fragsize %u", -+ if let Some(ref output_stream) = stm.output_stream { -+ let output_att = output_stream.get_buffer_attr(); -+ log!("Output buffer attributes maxlength {}, tlength {}, \ -+ prebuf {}, minreq {}, fragsize {}", - output_att.maxlength, - output_att.tlength, - output_att.prebuf, -@@ -202,10 +288,10 @@ impl<'ctx> Stream<'ctx> { - output_att.fragsize); - } - -- if input_stream_params.is_some() { -- let input_att = *pa_stream_get_buffer_attr(stm.input_stream); -- log!("Input buffer attributes maxlength %u, tlength %u, \ -- prebuf %u, minreq %u, fragsize %u", -+ if let Some(ref input_stream) = stm.input_stream { -+ let input_att = input_stream.get_buffer_attr(); -+ log!("Input buffer attributes maxlength {}, tlength {}, \ -+ prebuf {}, minreq {}, fragsize {}", - input_att.maxlength, - input_att.tlength, - input_att.prebuf, -@@ -219,224 +305,250 @@ impl<'ctx> Stream<'ctx> { - } - - fn destroy(&mut self) { -- self.stream_cork(CorkState::cork()); -+ self.cork(CorkState::cork()); - -- unsafe { -- pa_threaded_mainloop_lock(self.context.mainloop); -- if !self.output_stream.is_null() { -- if !self.drain_timer.is_null() { -- /* there's no pa_rttime_free, so use this instead. */ -- let ma = pa_threaded_mainloop_get_api(self.context.mainloop); -- if !ma.is_null() { -- (*ma).time_free.unwrap()(self.drain_timer); -+ self.context.mainloop.lock(); -+ { -+ match self.output_stream.take() { -+ Some(stm) => { -+ if !self.drain_timer.is_null() { -+ /* there's no pa_rttime_free, so use this instead. */ -+ self.context -+ .mainloop -+ .get_api() -+ .time_free(self.drain_timer); - } -- } -- -- pa_stream_set_state_callback(self.output_stream, None, ptr::null_mut()); -- pa_stream_set_write_callback(self.output_stream, None, ptr::null_mut()); -- pa_stream_disconnect(self.output_stream); -- pa_stream_unref(self.output_stream); -+ stm.clear_state_callback(); -+ stm.clear_write_callback(); -+ let _ = stm.disconnect(); -+ stm.unref(); -+ }, -+ _ => {}, -+ } -+ -+ match self.input_stream.take() { -+ Some(stm) => { -+ stm.clear_state_callback(); -+ stm.clear_read_callback(); -+ let _ = stm.disconnect(); -+ stm.unref(); -+ }, -+ _ => {}, - } -- -- if !self.input_stream.is_null() { -- pa_stream_set_state_callback(self.input_stream, None, ptr::null_mut()); -- pa_stream_set_read_callback(self.input_stream, None, ptr::null_mut()); -- pa_stream_disconnect(self.input_stream); -- pa_stream_unref(self.input_stream); -- } -- pa_threaded_mainloop_unlock(self.context.mainloop); - } -+ self.context.mainloop.unlock(); - } - - pub fn start(&mut self) -> i32 { -+ fn output_preroll(_: &pulse::MainloopApi, u: *mut c_void) { -+ let mut stm = unsafe { &mut *(u as *mut Stream) }; -+ if !stm.shutdown { -+ let size = stm.output_stream -+ .as_ref() -+ .map_or(0, |s| s.writable_size().unwrap_or(0)); -+ stm.trigger_user_callback(ptr::null_mut(), size); -+ } -+ } -+ - self.shutdown = false; -- self.stream_cork(CorkState::uncork() | CorkState::notify()); -+ self.cork(CorkState::uncork() | CorkState::notify()); - -- if !self.output_stream.is_null() && self.input_stream.is_null() { -- unsafe { -- /* On output only case need to manually call user cb once in order to make -- * things roll. This is done via a defer event in order to execute it -- * from PA server thread. */ -- pa_threaded_mainloop_lock(self.context.mainloop); -- pa_mainloop_api_once(pa_threaded_mainloop_get_api(self.context.mainloop), -- Some(pulse_defer_event_cb), -- self as *mut _ as *mut _); -- pa_threaded_mainloop_unlock(self.context.mainloop); -- } -+ if self.output_stream.is_some() && self.input_stream.is_none() { -+ /* On output only case need to manually call user cb once in order to make -+ * things roll. This is done via a defer event in order to execute it -+ * from PA server thread. */ -+ self.context.mainloop.lock(); -+ self.context -+ .mainloop -+ .get_api() -+ .once(output_preroll, self as *mut _ as *mut _); -+ self.context.mainloop.unlock(); - } - - cubeb::OK - } - - pub fn stop(&mut self) -> i32 { -- unsafe { -- pa_threaded_mainloop_lock(self.context.mainloop); -+ { -+ self.context.mainloop.lock(); - self.shutdown = true; - // If draining is taking place wait to finish - while !self.drain_timer.is_null() { -- pa_threaded_mainloop_wait(self.context.mainloop); -+ self.context.mainloop.wait(); - } -- pa_threaded_mainloop_unlock(self.context.mainloop); -+ self.context.mainloop.unlock(); - } -- self.stream_cork(CorkState::cork() | CorkState::notify()); -+ self.cork(CorkState::cork() | CorkState::notify()); - - cubeb::OK - } - - pub fn position(&self) -> Result { -- if self.output_stream.is_null() { -- return Err(cubeb::ERROR); -- } -+ let in_thread = self.context.mainloop.in_thread(); - -- let position = unsafe { -- let in_thread = pa_threaded_mainloop_in_thread(self.context.mainloop); -- -- if in_thread == 0 { -- pa_threaded_mainloop_lock(self.context.mainloop); -- } -- -- let mut r_usec: pa_usec_t = Default::default(); -- let r = pa_stream_get_time(self.output_stream, &mut r_usec); -- if in_thread == 0 { -- pa_threaded_mainloop_unlock(self.context.mainloop); -- } -- -- if r != 0 { -- return Err(cubeb::ERROR); -- } -+ if !in_thread { -+ self.context.mainloop.lock(); -+ } - -- let bytes = pa_usec_to_bytes(r_usec, &self.output_sample_spec); -- (bytes / pa_frame_size(&self.output_sample_spec)) as u64 -+ let r = match self.output_stream { -+ None => Err(cubeb::ERROR), -+ Some(ref stm) => { -+ match stm.get_time() { -+ Ok(r_usec) => { -+ let bytes = r_usec.to_bytes(&self.output_sample_spec); -+ Ok((bytes / self.output_sample_spec.frame_size()) as u64) -+ }, -+ Err(_) => Err(cubeb::ERROR), -+ } -+ }, - }; -- Ok(position) -- } - -- pub fn latency(&self) -> Result { -- if self.output_stream.is_null() { -- return Err(cubeb::ERROR); -+ if !in_thread { -+ self.context.mainloop.unlock(); - } - -- let mut r_usec: pa_usec_t = 0; -- let mut negative: i32 = 0; -- let r = unsafe { pa_stream_get_latency(self.output_stream, &mut r_usec, &mut negative) }; -+ r -+ } - -- if r != 0 { -- return Err(cubeb::ERROR); -+ pub fn latency(&self) -> Result { -+ match self.output_stream { -+ None => Err(cubeb::ERROR), -+ Some(ref stm) => { -+ match stm.get_latency() { -+ Ok((r_usec, negative)) => { -+ debug_assert!(negative); -+ let latency = (r_usec * self.output_sample_spec.rate as pa_usec_t / PA_USEC_PER_SEC) as u32; -+ Ok(latency) -+ }, -+ Err(_) => Err(cubeb::ERROR), -+ } -+ }, - } -- -- debug_assert_eq!(negative, 0); -- let latency = (r_usec * self.output_sample_spec.rate as pa_usec_t / PA_USEC_PER_SEC) as u32; -- -- Ok(latency) - } - - pub fn set_volume(&mut self, volume: f32) -> i32 { -- if self.output_stream.is_null() { -- return cubeb::ERROR; -- } -- -- unsafe { -- pa_threaded_mainloop_lock(self.context.mainloop); -- -- while self.context.default_sink_info.is_none() { -- pa_threaded_mainloop_wait(self.context.mainloop); -- } -- -- let mut cvol: pa_cvolume = Default::default(); -- -- /* if the pulse daemon is configured to use flat volumes, -- * apply our own gain instead of changing the input volume on the sink. */ -- let flags = { -- match self.context.default_sink_info { -- Some(ref info) => info.flags, -- _ => 0, -- } -- }; -- -- if (flags & PA_SINK_FLAT_VOLUME) != 0 { -- self.volume = volume; -- } else { -- let ss = pa_stream_get_sample_spec(self.output_stream); -- let vol = pa_sw_volume_from_linear(volume as f64); -- pa_cvolume_set(&mut cvol, (*ss).channels as u32, vol); -- -- let index = pa_stream_get_index(self.output_stream); -+ match self.output_stream { -+ None => cubeb::ERROR, -+ Some(ref stm) => { -+ if let Some(ref context) = self.context.context { -+ self.context.mainloop.lock(); -+ -+ let mut cvol: pa_cvolume = Default::default(); -+ -+ /* if the pulse daemon is configured to use flat -+ * volumes, apply our own gain instead of changing -+ * the input volume on the sink. */ -+ let flags = { -+ match self.context.default_sink_info { -+ Some(ref info) => info.flags, -+ _ => pulse::SinkFlags::empty(), -+ } -+ }; -+ -+ if flags.contains(pulse::SINK_FLAT_VOLUME) { -+ self.volume = volume; -+ } else { -+ let channels = stm.get_sample_spec().channels; -+ let vol = pulse::sw_volume_from_linear(volume as f64); -+ cvol.set(channels as u32, vol); -+ -+ let index = stm.get_index(); -+ -+ let context_ptr = self.context as *const _ as *mut _; -+ if let Ok(o) = context.set_sink_input_volume(index, &cvol, context_success, context_ptr) { -+ self.context.operation_wait(stm, &o); -+ } -+ } - -- let op = pa_context_set_sink_input_volume(self.context.context, -- index, -- &cvol, -- Some(volume_success), -- self as *mut _ as *mut _); -- if !op.is_null() { -- self.context.operation_wait(self.output_stream, op); -- pa_operation_unref(op); -+ self.context.mainloop.unlock(); -+ cubeb::OK -+ } else { -+ cubeb::ERROR - } -- } -- -- pa_threaded_mainloop_unlock(self.context.mainloop); -+ }, - } -- cubeb::OK - } - - pub fn set_panning(&mut self, panning: f32) -> i32 { -- if self.output_stream.is_null() { -- return cubeb::ERROR; -- } -+ #[repr(C)] -+ struct SinkInputInfoResult<'a> { -+ pub cvol: pulse::CVolume, -+ pub mainloop: &'a pulse::ThreadedMainloop, -+ } -+ -+ fn get_input_volume(_: &pulse::Context, info: *const pulse::SinkInputInfo, eol: i32, u: *mut c_void) { -+ let mut r = unsafe { &mut *(u as *mut SinkInputInfoResult) }; -+ if eol == 0 { -+ let info = unsafe { *info }; -+ r.cvol = info.volume; -+ } -+ r.mainloop.signal(); -+ } -+ -+ match self.output_stream { -+ None => cubeb::ERROR, -+ Some(ref stm) => { -+ if let Some(ref context) = self.context.context { -+ self.context.mainloop.lock(); -+ -+ let map = stm.get_channel_map(); -+ if !map.can_balance() { -+ self.context.mainloop.unlock(); -+ return cubeb::ERROR; -+ } - -- unsafe { -- pa_threaded_mainloop_lock(self.context.mainloop); -+ let index = stm.get_index(); - -- let map = pa_stream_get_channel_map(self.output_stream); -- if pa_channel_map_can_balance(map) == 0 { -- pa_threaded_mainloop_unlock(self.context.mainloop); -- return cubeb::ERROR; -- } -+ let mut r = SinkInputInfoResult { -+ cvol: pulse::CVolume::default(), -+ mainloop: &self.context.mainloop, -+ }; - -- let index = pa_stream_get_index(self.output_stream); -+ if let Ok(o) = context.get_sink_input_info(index, get_input_volume, &mut r as *mut _ as *mut _) { -+ self.context.operation_wait(stm, &o); -+ } - -- let mut cvol: pa_cvolume = Default::default(); -- let mut r = SinkInputInfoResult { -- cvol: &mut cvol, -- mainloop: self.context.mainloop, -- }; -+ r.cvol.set_balance(map, panning); - -- let op = pa_context_get_sink_input_info(self.context.context, -- index, -- Some(sink_input_info_cb), -- &mut r as *mut _ as *mut _); -- if !op.is_null() { -- self.context.operation_wait(self.output_stream, op); -- pa_operation_unref(op); -- } -- -- pa_cvolume_set_balance(&mut cvol, map, panning); -- -- let op = pa_context_set_sink_input_volume(self.context.context, -- index, -- &cvol, -- Some(volume_success), -- self as *mut _ as *mut _); -- if !op.is_null() { -- self.context.operation_wait(self.output_stream, op); -- pa_operation_unref(op); -- } -+ let context_ptr = self.context as *const _ as *mut _; -+ if let Ok(o) = context.set_sink_input_volume(index, &r.cvol, context_success, context_ptr) { -+ self.context.operation_wait(stm, &o); -+ } - -- pa_threaded_mainloop_unlock(self.context.mainloop); -- } -+ self.context.mainloop.unlock(); - -- cubeb::OK -+ cubeb::OK -+ } else { -+ cubeb::ERROR -+ } -+ }, -+ } - } - - pub fn current_device(&self) -> Result> { - if self.context.version_0_9_8 { - let mut dev = Box::new(cubeb::Device::default()); - -- if !self.input_stream.is_null() { -- dev.input_name = unsafe { pa_xstrdup(pa_stream_get_device_name(self.input_stream)) }; -+ if self.input_stream.is_some() { -+ if let Some(ref stm) = self.input_stream { -+ dev.input_name = match stm.get_device_name() { -+ Ok(name) => name.to_owned().into_raw(), -+ Err(_) => { -+ return Err(cubeb::ERROR); -+ }, -+ } -+ } - } - -- if !self.output_stream.is_null() { -- dev.output_name = unsafe { pa_xstrdup(pa_stream_get_device_name(self.output_stream)) }; -+ if !self.output_stream.is_some() { -+ if let Some(ref stm) = self.output_stream { -+ dev.output_name = match stm.get_device_name() { -+ Ok(name) => name.to_owned().into_raw(), -+ Err(_) => { -+ return Err(cubeb::ERROR); -+ }, -+ } -+ } - } - - Ok(dev) -@@ -445,51 +557,62 @@ impl<'ctx> Stream<'ctx> { - } - } - -- fn pulse_stream_init(&mut self, -- stream_params: &cubeb::StreamParams, -- stream_name: *const c_char) -- -> Result<*mut pa_stream> { -+ fn stream_init(context: &pulse::Context, -+ stream_params: &cubeb::StreamParams, -+ stream_name: &CStr) -+ -> Result { - -- fn to_pulse_format(format: cubeb::SampleFormat) -> pa_sample_format_t { -+ fn to_pulse_format(format: cubeb::SampleFormat) -> pulse::SampleFormat { - match format { -- cubeb::SAMPLE_S16LE => PA_SAMPLE_S16LE, -- cubeb::SAMPLE_S16BE => PA_SAMPLE_S16BE, -- cubeb::SAMPLE_FLOAT32LE => PA_SAMPLE_FLOAT32LE, -- cubeb::SAMPLE_FLOAT32BE => PA_SAMPLE_FLOAT32BE, -- _ => panic!("Invalid format: {:?}", format), -+ cubeb::SAMPLE_S16LE => pulse::SampleFormat::Signed16LE, -+ cubeb::SAMPLE_S16BE => pulse::SampleFormat::Signed16BE, -+ cubeb::SAMPLE_FLOAT32LE => pulse::SampleFormat::Float32LE, -+ cubeb::SAMPLE_FLOAT32BE => pulse::SampleFormat::Float32BE, -+ _ => pulse::SampleFormat::Invalid, - } - } - - let fmt = to_pulse_format(stream_params.format); -- if fmt == PA_SAMPLE_INVALID { -+ if fmt == pulse::SampleFormat::Invalid { - return Err(cubeb::ERROR_INVALID_FORMAT); - } - -- let ss = pa_sample_spec { -+ let ss = pulse::SampleSpec { - channels: stream_params.channels as u8, -- format: fmt, -+ format: fmt.into(), - rate: stream_params.rate, - }; - -- let stream = if stream_params.layout == cubeb::LAYOUT_UNDEFINED { -- unsafe { pa_stream_new(self.context.context, stream_name, &ss, ptr::null_mut()) } -- } else { -- let cm = layout_to_channel_map(stream_params.layout); -- unsafe { pa_stream_new(self.context.context, stream_name, &ss, &cm) } -+ let cm: Option = match stream_params.layout { -+ cubeb::LAYOUT_UNDEFINED => None, -+ _ => Some(layout_to_channel_map(stream_params.layout)), - }; - -- if !stream.is_null() { -- Ok(stream) -- } else { -- Err(cubeb::ERROR) -+ let stream = pulse::Stream::new(context, stream_name, &ss, cm.as_ref()); -+ -+ match stream { -+ None => Err(cubeb::ERROR), -+ Some(stm) => Ok(stm), -+ } -+ } -+ -+ pub fn cork_stream(&self, stream: Option<&pulse::Stream>, state: CorkState) { -+ if let Some(stm) = stream { -+ if let Ok(o) = stm.cork(state.is_cork() as i32, -+ stream_success, -+ self as *const _ as *mut _) { -+ self.context.operation_wait(stream, &o); -+ } - } - } - -- fn stream_cork(&mut self, state: CorkState) { -- unsafe { pa_threaded_mainloop_lock(self.context.mainloop) }; -- self.context.pulse_stream_cork(self.output_stream, state); -- self.context.pulse_stream_cork(self.input_stream, state); -- unsafe { pa_threaded_mainloop_unlock(self.context.mainloop) }; -+ fn cork(&mut self, state: CorkState) { -+ { -+ self.context.mainloop.lock(); -+ self.cork_stream(self.output_stream.as_ref(), state); -+ self.cork_stream(self.input_stream.as_ref(), state); -+ self.context.mainloop.unlock() -+ } - - if state.is_notify() { - self.state_change_callback(if state.is_cork() { -@@ -503,18 +626,9 @@ impl<'ctx> Stream<'ctx> { - fn update_timing_info(&self) -> bool { - let mut r = false; - -- if !self.output_stream.is_null() { -- let o = unsafe { -- pa_stream_update_timing_info(self.output_stream, -- Some(stream_success_callback), -- self as *const _ as *mut _) -- }; -- -- if !o.is_null() { -- r = self.context.operation_wait(self.output_stream, o); -- unsafe { -- pa_operation_unref(o); -- } -+ if let Some(ref stm) = self.output_stream { -+ if let Ok(o) = stm.update_timing_info(stream_success, self as *const _ as *mut _) { -+ r = self.context.operation_wait(stm, &o); - } - - if !r { -@@ -522,18 +636,9 @@ impl<'ctx> Stream<'ctx> { - } - } - -- if !self.input_stream.is_null() { -- let o = unsafe { -- pa_stream_update_timing_info(self.input_stream, -- Some(stream_success_callback), -- self as *const _ as *mut _) -- }; -- -- if !o.is_null() { -- r = self.context.operation_wait(self.input_stream, o); -- unsafe { -- pa_operation_unref(o); -- } -+ if let Some(ref stm) = self.input_stream { -+ if let Ok(o) = stm.update_timing_info(stream_success, self as *const _ as *mut _) { -+ r = self.context.operation_wait(stm, &o); - } - } - -@@ -547,232 +652,162 @@ impl<'ctx> Stream<'ctx> { - } - } - -- fn wait_until_stream_ready(&self) -> bool { -- if !self.output_stream.is_null() && !wait_until_io_stream_ready(self.output_stream, self.context.mainloop) { -- return false; -- } -- -- if !self.input_stream.is_null() && !wait_until_io_stream_ready(self.input_stream, self.context.mainloop) { -- return false; -- } -- -- true -- } -- -- fn trigger_user_callback(&mut self, s: *mut pa_stream, input_data: *const c_void, nbytes: usize) { -- let frame_size = unsafe { pa_frame_size(&self.output_sample_spec) }; -- debug_assert_eq!(nbytes % frame_size, 0); -- -- let mut buffer: *mut c_void = ptr::null_mut(); -- let mut r: i32; -- -- let mut towrite = nbytes; -- let mut read_offset = 0usize; -- while towrite > 0 { -- let mut size = towrite; -- r = unsafe { pa_stream_begin_write(s, &mut buffer, &mut size) }; -- // Note: this has failed running under rr on occassion - needs investigation. -- debug_assert_eq!(r, 0); -- debug_assert!(size > 0); -- debug_assert_eq!(size % frame_size, 0); -- -- logv!("Trigger user callback with output buffer size={}, read_offset={}", -- size, -- read_offset); -- let read_ptr = unsafe { (input_data as *const u8).offset(read_offset as isize) }; -- let got = unsafe { -- self.data_callback.unwrap()(self as *const _ as *mut _, -- self.user_ptr, -- read_ptr as *const _ as *mut _, -- buffer, -- (size / frame_size) as c_long) -- }; -- if got < 0 { -- unsafe { -- pa_stream_cancel_write(s); -- } -- self.shutdown = true; -- return; -- } -- // If more iterations move offset of read buffer -- if !input_data.is_null() { -- let in_frame_size = unsafe { pa_frame_size(&self.input_sample_spec) }; -- read_offset += (size / frame_size) * in_frame_size; -+ fn wait_until_ready(&self) -> bool { -+ fn wait_until_io_stream_ready(stm: &pulse::Stream, mainloop: &pulse::ThreadedMainloop) -> bool { -+ if mainloop.is_null() { -+ return false; - } - -- if self.volume != PULSE_NO_GAIN { -- let samples = (self.output_sample_spec.channels as usize * size / frame_size) as isize; -- -- if self.output_sample_spec.format == PA_SAMPLE_S16BE || -- self.output_sample_spec.format == PA_SAMPLE_S16LE { -- let b = buffer as *mut i16; -- for i in 0..samples { -- unsafe { *b.offset(i) *= self.volume as i16 }; -- } -- } else { -- let b = buffer as *mut f32; -- for i in 0..samples { -- unsafe { *b.offset(i) *= self.volume }; -- } -+ loop { -+ let state = stm.get_state(); -+ if !state.is_good() { -+ return false; -+ } -+ if state == pulse::StreamState::Ready { -+ break; - } -+ mainloop.wait(); - } - -- r = unsafe { -- pa_stream_write(s, -- buffer, -- got as usize * frame_size, -- None, -- 0, -- PA_SEEK_RELATIVE) -- }; -- debug_assert_eq!(r, 0); -+ true -+ } - -- if (got as usize) < size / frame_size { -- let mut latency: pa_usec_t = 0; -- let rr: i32 = unsafe { pa_stream_get_latency(s, &mut latency, ptr::null_mut()) }; -- if rr == -(PA_ERR_NODATA as i32) { -- /* this needs a better guess. */ -- latency = 100 * PA_USEC_PER_MSEC; -- } -- debug_assert!(r == 0 || r == -(PA_ERR_NODATA as i32)); -- /* pa_stream_drain is useless, see PA bug# 866. this is a workaround. */ -- /* arbitrary safety margin: double the current latency. */ -- debug_assert!(self.drain_timer.is_null()); -- self.drain_timer = unsafe { -- pa_context_rttime_new(self.context.context, -- pa_rtclock_now() + 2 * latency, -- Some(stream_drain_callback), -- self as *const _ as *mut _) -- }; -- self.shutdown = true; -- return; -+ if let Some(ref stm) = self.output_stream { -+ if !wait_until_io_stream_ready(stm, &self.context.mainloop) { -+ return false; - } -- -- towrite -= size; - } - -- debug_assert_eq!(towrite, 0); -- } --} -- --unsafe extern "C" fn stream_success_callback(_s: *mut pa_stream, _success: i32, u: *mut c_void) { -- let stm = &*(u as *mut Stream); -- pa_threaded_mainloop_signal(stm.context.mainloop, 0); --} -- --unsafe extern "C" fn stream_drain_callback(a: *mut pa_mainloop_api, -- e: *mut pa_time_event, -- _tv: *const timeval, -- u: *mut c_void) { -- let mut stm = &mut *(u as *mut Stream); -- debug_assert_eq!(stm.drain_timer, e); -- stm.state_change_callback(cubeb::STATE_DRAINED); -- /* there's no pa_rttime_free, so use this instead. */ -- (*a).time_free.unwrap()(stm.drain_timer); -- stm.drain_timer = ptr::null_mut(); -- pa_threaded_mainloop_signal(stm.context.mainloop, 0); --} -- --unsafe extern "C" fn stream_state_callback(s: *mut pa_stream, u: *mut c_void) { -- let stm = &mut *(u as *mut Stream); -- if !PA_STREAM_IS_GOOD(pa_stream_get_state(s)) { -- stm.state_change_callback(cubeb::STATE_ERROR); -- } -- pa_threaded_mainloop_signal(stm.context.mainloop, 0); --} -- --fn read_from_input(s: *mut pa_stream, buffer: *mut *const c_void, size: *mut usize) -> i32 { -- let readable_size = unsafe { pa_stream_readable_size(s) }; -- if readable_size > 0 && unsafe { pa_stream_peek(s, buffer, size) } < 0 { -- return -1; -- } -- -- readable_size as i32 --} -+ if let Some(ref stm) = self.input_stream { -+ if !wait_until_io_stream_ready(stm, &self.context.mainloop) { -+ return false; -+ } -+ } - --unsafe extern "C" fn stream_write_callback(s: *mut pa_stream, nbytes: usize, u: *mut c_void) { -- logv!("Output callback to be written buffer size {}", nbytes); -- let mut stm = &mut *(u as *mut Stream); -- if stm.shutdown || stm.state != cubeb::STATE_STARTED { -- return; -+ true - } - -- if stm.input_stream.is_null() { -- // Output/playback only operation. -- // Write directly to output -- debug_assert!(!stm.output_stream.is_null()); -- stm.trigger_user_callback(s, ptr::null(), nbytes); -- } --} -+ fn trigger_user_callback(&mut self, input_data: *const c_void, nbytes: usize) { -+ fn drained_cb(a: &pulse::MainloopApi, e: *mut pa_time_event, _tv: &pulse::TimeVal, u: *mut c_void) { -+ let mut stm = unsafe { &mut *(u as *mut Stream) }; -+ debug_assert_eq!(stm.drain_timer, e); -+ stm.state_change_callback(cubeb::STATE_DRAINED); -+ /* there's no pa_rttime_free, so use this instead. */ -+ a.time_free(stm.drain_timer); -+ stm.drain_timer = ptr::null_mut(); -+ stm.context.mainloop.signal(); -+ } -+ -+ if let Some(ref stm) = self.output_stream { -+ -+ let frame_size = self.output_sample_spec.frame_size(); -+ debug_assert_eq!(nbytes % frame_size, 0); -+ -+ let mut towrite = nbytes; -+ let mut read_offset = 0usize; -+ while towrite > 0 { -+ match stm.begin_write(towrite) { -+ Err(e) => { -+ panic!("Failed to write data: {}", e); -+ }, -+ Ok((buffer, size)) => { -+ debug_assert!(size > 0); -+ debug_assert_eq!(size % frame_size, 0); -+ -+ logv!("Trigger user callback with output buffer size={}, read_offset={}", -+ size, -+ read_offset); -+ let read_ptr = unsafe { (input_data as *const u8).offset(read_offset as isize) }; -+ let got = unsafe { -+ self.data_callback.unwrap()(self as *const _ as *mut _, -+ self.user_ptr, -+ read_ptr as *const _ as *mut _, -+ buffer, -+ (size / frame_size) as c_long) -+ }; -+ if got < 0 { -+ let _ = stm.cancel_write(); -+ self.shutdown = true; -+ return; -+ } -+ -+ // If more iterations move offset of read buffer -+ if !input_data.is_null() { -+ let in_frame_size = self.input_sample_spec.frame_size(); -+ read_offset += (size / frame_size) * in_frame_size; -+ } -+ -+ if self.volume != PULSE_NO_GAIN { -+ let samples = (self.output_sample_spec.channels as usize * size / frame_size) as isize; -+ -+ if self.output_sample_spec.format == PA_SAMPLE_S16BE || -+ self.output_sample_spec.format == PA_SAMPLE_S16LE { -+ let b = buffer as *mut i16; -+ for i in 0..samples { -+ unsafe { *b.offset(i) *= self.volume as i16 }; -+ } -+ } else { -+ let b = buffer as *mut f32; -+ for i in 0..samples { -+ unsafe { *b.offset(i) *= self.volume }; -+ } -+ } -+ } -+ -+ let r = stm.write(buffer, -+ got as usize * frame_size, -+ 0, -+ pulse::SeekMode::Relative); -+ debug_assert!(r.is_ok()); -+ -+ if (got as usize) < size / frame_size { -+ let latency = match stm.get_latency() { -+ Ok((l, negative)) => { -+ assert_ne!(negative, true); -+ l -+ }, -+ Err(e) => { -+ debug_assert_eq!(e, pulse::ErrorCode::from_error_code(PA_ERR_NODATA)); -+ /* this needs a better guess. */ -+ 100 * PA_USEC_PER_MSEC -+ }, -+ }; -+ -+ /* pa_stream_drain is useless, see PA bug# 866. this is a workaround. */ -+ /* arbitrary safety margin: double the current latency. */ -+ debug_assert!(self.drain_timer.is_null()); -+ let stream_ptr = self as *const _ as *mut _; -+ if let Some(ref context) = self.context.context { -+ self.drain_timer = -+ context.rttime_new(pulse::rtclock_now() + 2 * latency, drained_cb, stream_ptr); -+ } -+ self.shutdown = true; -+ return; -+ } - --unsafe extern "C" fn stream_read_callback(s: *mut pa_stream, nbytes: usize, u: *mut c_void) { -- logv!("Input callback buffer size {}", nbytes); -- let mut stm = &mut *(u as *mut Stream); -- if stm.shutdown { -- return; -- } -- -- let mut read_data: *const c_void = ptr::null(); -- let mut read_size: usize = 0; -- while read_from_input(s, &mut read_data, &mut read_size) > 0 { -- /* read_data can be NULL in case of a hole. */ -- if !read_data.is_null() { -- let in_frame_size = pa_frame_size(&stm.input_sample_spec); -- let read_frames = read_size / in_frame_size; -- -- if !stm.output_stream.is_null() { -- // input/capture + output/playback operation -- let out_frame_size = pa_frame_size(&stm.output_sample_spec); -- let write_size = read_frames * out_frame_size; -- // Offer full duplex data for writing -- let stream = stm.output_stream; -- stm.trigger_user_callback(stream, read_data, write_size); -- } else { -- // input/capture only operation. Call callback directly -- let got = stm.data_callback.unwrap()(stm as *mut _ as *mut _, -- stm.user_ptr, -- read_data, -- ptr::null_mut(), -- read_frames as c_long); -- if got < 0 || got as usize != read_frames { -- pa_stream_cancel_write(s); -- stm.shutdown = true; -- break; -+ towrite -= size; -+ }, - } - } -- } -- -- if read_size > 0 { -- pa_stream_drop(s); -- } -- -- if stm.shutdown { -- return; -+ debug_assert_eq!(towrite, 0); - } - } - } - --fn wait_until_io_stream_ready(stream: *mut pa_stream, mainloop: *mut pa_threaded_mainloop) -> bool { -- if stream.is_null() || mainloop.is_null() { -- return false; -- } -- -- loop { -- let state = unsafe { pa_stream_get_state(stream) }; -- if !PA_STREAM_IS_GOOD(state) { -- return false; -- } -- if state == PA_STREAM_READY { -- break; -- } -- unsafe { pa_threaded_mainloop_wait(mainloop) }; -- } -+fn stream_success(_: &pulse::Stream, success: i32, u: *mut c_void) { -+ let stm = unsafe { &*(u as *mut Stream) }; -+ debug_assert_ne!(success, 0); -+ stm.context.mainloop.signal(); -+} - -- true -+fn context_success(_: &pulse::Context, success: i32, u: *mut c_void) { -+ let ctx = unsafe { &*(u as *mut Context) }; -+ debug_assert_ne!(success, 0); -+ ctx.mainloop.signal(); - } - - fn set_buffering_attribute(latency_frames: u32, sample_spec: &pa_sample_spec) -> pa_buffer_attr { -- let tlength = latency_frames * unsafe { pa_frame_size(sample_spec) } as u32; -+ let tlength = latency_frames * sample_spec.frame_size() as u32; - let minreq = tlength / 4; - let battr = pa_buffer_attr { - maxlength: u32::max_value(), -@@ -791,34 +826,3 @@ fn set_buffering_attribute(latency_frame - - battr - } -- --unsafe extern "C" fn pulse_defer_event_cb(_a: *mut pa_mainloop_api, u: *mut c_void) { -- let mut stm = &mut *(u as *mut Stream); -- if stm.shutdown { -- return; -- } -- let writable_size = pa_stream_writable_size(stm.output_stream); -- let stream = stm.output_stream; -- stm.trigger_user_callback(stream, ptr::null_mut(), writable_size); --} -- --#[repr(C)] --struct SinkInputInfoResult { -- pub cvol: *mut pa_cvolume, -- pub mainloop: *mut pa_threaded_mainloop, --} -- --unsafe extern "C" fn sink_input_info_cb(_c: *mut pa_context, i: *const pa_sink_input_info, eol: i32, u: *mut c_void) { -- let info = &*i; -- let mut r = &mut *(u as *mut SinkInputInfoResult); -- if eol == 0 { -- *r.cvol = info.volume; -- } -- pa_threaded_mainloop_signal(r.mainloop, 0); --} -- --unsafe extern "C" fn volume_success(_c: *mut pa_context, success: i32, u: *mut c_void) { -- let stm = &*(u as *mut Stream); -- debug_assert_ne!(success, 0); -- pa_threaded_mainloop_signal(stm.context.mainloop, 0); --} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/capi.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/capi.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/capi.rs.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/capi.rs 2017-08-04 13:37:46.387821728 +0200 -@@ -5,6 +5,7 @@ - - use backend; - use cubeb; -+use std::ffi::CStr; - use std::os::raw::{c_char, c_void}; - - unsafe extern "C" fn capi_init(c: *mut *mut cubeb::Context, context_name: *const c_char) -> i32 { -@@ -114,21 +115,18 @@ unsafe extern "C" fn capi_stream_init(c: - state_callback: cubeb::StateCallback, - user_ptr: *mut c_void) - -> i32 { -+ fn try_stream_params_from(sp: *mut cubeb::StreamParams) -> Option { -+ if sp.is_null() { None } else { Some(unsafe { *sp }) } -+ } -+ - let mut ctx = &mut *(c as *mut backend::Context); -+ let stream_name = CStr::from_ptr(stream_name); - - match ctx.new_stream(stream_name, - input_device, -- if input_stream_params.is_null() { -- None -- } else { -- Some(*input_stream_params) -- }, -+ try_stream_params_from(input_stream_params), - output_device, -- if output_stream_params.is_null() { -- None -- } else { -- Some(*output_stream_params) -- }, -+ try_stream_params_from(output_stream_params), - latency_frames, - data_callback, - state_callback, -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/lib.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/lib.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/lib.rs.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/lib.rs 2017-08-04 13:37:46.387821728 +0200 -@@ -8,6 +8,7 @@ - #[macro_use] - extern crate cubeb_ffi as cubeb; - extern crate pulse_ffi; -+extern crate pulse; - extern crate semver; - - mod capi; -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/update.sh.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/update.sh ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/update.sh.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/update.sh 2017-08-04 13:37:46.383821740 +0200 -@@ -13,6 +13,9 @@ cp -pr $1/cubeb-ffi/src/* cubeb-ffi/src/ - test -d pulse-ffi/src || mkdir -p pulse-ffi/src - cp -pr $1/pulse-ffi/Cargo.toml pulse-ffi/ - cp -pr $1/pulse-ffi/src/* pulse-ffi/src/ -+test -d pulse-rs/src || mkdir -p pulse-rs/src -+cp -pr $1/pulse-rs/Cargo.toml pulse-rs/ -+cp -pr $1/pulse-rs/src/* pulse-rs/src/ - - if [ -d $1/.git ]; then - rev=$(cd $1 && git rev-parse --verify HEAD) -diff -up firefox-55.0/toolkit/library/gtest/rust/Cargo.lock.cubeb-pulse-arm firefox-55.0/toolkit/library/gtest/rust/Cargo.lock ---- firefox-55.0/toolkit/library/gtest/rust/Cargo.lock.cubeb-pulse-arm 2017-08-04 13:37:46.388821725 +0200 -+++ firefox-55.0/toolkit/library/gtest/rust/Cargo.lock 2017-08-04 13:59:15.592940994 +0200 -@@ -252,6 +252,7 @@ name = "cubeb-pulse" - version = "0.0.1" - dependencies = [ - "cubeb-ffi 0.0.1", -+ "pulse 0.1.0", - "pulse-ffi 0.1.0", - "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - ] -@@ -660,6 +661,14 @@ version = "0.1.1" - source = "registry+https://github.com/rust-lang/crates.io-index" - - [[package]] -+name = "pulse" -+version = "0.1.0" -+dependencies = [ -+ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -+ "pulse-ffi 0.1.0", -+] -+ -+[[package]] - name = "pulse-ffi" - version = "0.1.0" - dependencies = [ -diff -up firefox-55.0/toolkit/library/rust/Cargo.lock.cubeb-pulse-arm firefox-55.0/toolkit/library/rust/Cargo.lock ---- firefox-55.0/toolkit/library/rust/Cargo.lock.cubeb-pulse-arm 2017-08-04 13:37:46.388821725 +0200 -+++ firefox-55.0/toolkit/library/rust/Cargo.lock 2017-08-04 13:52:24.551163669 +0200 -@@ -250,6 +250,7 @@ name = "cubeb-pulse" - version = "0.0.1" - dependencies = [ - "cubeb-ffi 0.0.1", -+ "pulse 0.1.0", - "pulse-ffi 0.1.0", - "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - ] -@@ -647,6 +648,14 @@ version = "0.1.1" - source = "registry+https://github.com/rust-lang/crates.io-index" - - [[package]] -+name = "pulse" -+version = "0.1.0" -+dependencies = [ -+ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -+ "pulse-ffi 0.1.0", -+] -+ -+[[package]] - name = "pulse-ffi" - version = "0.1.0" - dependencies = [ diff --git a/fedora-build.patch b/fedora-build.patch deleted file mode 100644 index 74127ec..0000000 --- a/fedora-build.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -up firefox-54.0/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium.old firefox-54.0/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium -diff -up firefox-54.0/media/mtransport/third_party/nICEr/nicer.gyp.old firefox-54.0/media/mtransport/third_party/nICEr/nicer.gyp ---- firefox-54.0/media/mtransport/third_party/nICEr/nicer.gyp.old 2017-06-08 14:59:08.786996664 +0200 -+++ firefox-54.0/media/mtransport/third_party/nICEr/nicer.gyp 2017-06-08 14:59:22.642946570 +0200 -@@ -211,7 +211,6 @@ - '-Wno-parentheses', - '-Wno-strict-prototypes', - '-Wmissing-prototypes', -- '-Wno-format', - ], - 'defines' : [ - 'LINUX', -diff -up firefox-54.0/media/mtransport/third_party/nrappkit/nrappkit.gyp.build firefox-54.0/media/mtransport/third_party/nrappkit/nrappkit.gyp ---- firefox-54.0/media/mtransport/third_party/nrappkit/nrappkit.gyp.build 2017-06-08 15:08:03.627063097 +0200 -+++ firefox-54.0/media/mtransport/third_party/nrappkit/nrappkit.gyp 2017-06-08 15:08:15.657019606 +0200 -@@ -206,7 +206,6 @@ - '-Wno-parentheses', - '-Wno-strict-prototypes', - '-Wmissing-prototypes', -- '-Wno-format', - ], - 'defines' : [ - 'LINUX', diff --git a/firefox-kde-webrender.patch b/firefox-kde-webrender.patch deleted file mode 100644 index f5f4ac7..0000000 --- a/firefox-kde-webrender.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff -up firefox-87.0/widget/GfxInfoX11.cpp.firefox-kde-webrender firefox-87.0/widget/GfxInfoX11.cpp ---- firefox-87.0/widget/GfxInfoX11.cpp.firefox-kde-webrender 2021-03-22 19:55:59.169952960 +0100 -+++ firefox-87.0/widget/GfxInfoX11.cpp 2021-03-22 20:04:35.332183657 +0100 -@@ -738,6 +738,14 @@ const nsTArray& GfxInfo:: - DRIVER_GREATER_THAN_OR_EQUAL, V(17, 0, 0, 0), - "FEATURE_ROLLOUT_INTEL_GNOME_WAYLAND_MESA", "Mesa 17.0.0.0"); - -+ APPEND_TO_DRIVER_BLOCKLIST_EXT( -+ OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, -+ DesktopEnvironment::KDE, WindowProtocol::Wayland, -+ DriverVendor::MesaAll, DeviceFamily::IntelRolloutWebRender, -+ nsIGfxInfo::FEATURE_WEBRENDER, nsIGfxInfo::FEATURE_ALLOW_ALWAYS, -+ DRIVER_GREATER_THAN_OR_EQUAL, V(17, 0, 0, 0), -+ "FEATURE_ROLLOUT_INTEL_GNOME_WAYLAND_MESA", "Mesa 17.0.0.0"); -+ - // ATI Mesa baseline, chosen arbitrarily. - APPEND_TO_DRIVER_BLOCKLIST_EXT( - OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, -@@ -754,6 +762,14 @@ const nsTArray& GfxInfo:: - DRIVER_GREATER_THAN_OR_EQUAL, V(17, 0, 0, 0), - "FEATURE_ROLLOUT_ATI_GNOME_WAYLAND_MESA", "Mesa 17.0.0.0"); - -+ APPEND_TO_DRIVER_BLOCKLIST_EXT( -+ OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, -+ DesktopEnvironment::KDE, WindowProtocol::Wayland, -+ DriverVendor::MesaAll, DeviceFamily::AtiRolloutWebRender, -+ nsIGfxInfo::FEATURE_WEBRENDER, nsIGfxInfo::FEATURE_ALLOW_ALWAYS, -+ DRIVER_GREATER_THAN_OR_EQUAL, V(17, 0, 0, 0), -+ "FEATURE_ROLLOUT_ATI_GNOME_WAYLAND_MESA", "Mesa 17.0.0.0"); -+ - #ifdef EARLY_BETA_OR_EARLIER - // Intel Mesa baseline, chosen arbitrarily. - APPEND_TO_DRIVER_BLOCKLIST_EXT( diff --git a/firefox.spec b/firefox.spec index f970fe1..221882a 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1076,6 +1076,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : * Tue Aug 23 2022 Kalev Lember - 104.0-5 - Use constrain_build macro to simplify parallel make handling - Drop obsolete build conditionals +- Drop unused patches * Tue Aug 23 2022 Jan Horak - 104.0-4 - Rebuild due to ppc64le fixes diff --git a/mozilla-1640982.patch b/mozilla-1640982.patch deleted file mode 100644 index b63ba3b..0000000 --- a/mozilla-1640982.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk ---- a/config/makefiles/rust.mk -+++ b/config/makefiles/rust.mk -@@ -61,7 +61,11 @@ - # Enable link-time optimization for release builds, but not when linking - # gkrust_gtest. - ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE))) -+# Pass -Clto for older versions of rust, and CARGO_PROFILE_RELEASE_LTO=true -+# for newer ones that support it. Combining the latter with -Clto works, so -+# set both everywhere. - cargo_rustc_flags += -Clto -+export CARGO_PROFILE_RELEASE_LTO=true - endif - endif - endif - diff --git a/mozilla-1672139.patch b/mozilla-1672139.patch deleted file mode 100644 index efd40cb..0000000 --- a/mozilla-1672139.patch +++ /dev/null @@ -1,91 +0,0 @@ -diff --git a/gfx/layers/ipc/CompositorBridgeParent.cpp b/gfx/layers/ipc/CompositorBridgeParent.cpp ---- a/gfx/layers/ipc/CompositorBridgeParent.cpp -+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp -@@ -2376,30 +2376,28 @@ - if (mWrBridge->PipelineId() == aPipelineId) { - mWrBridge->RemoveEpochDataPriorTo(aEpoch); - -- if (!mPaused) { -- if (mIsForcedFirstPaint) { -- uiController->NotifyFirstPaint(); -- mIsForcedFirstPaint = false; -- } -- -- std::pair key(aPipelineId, aEpoch); -- nsTArray payload = -- mWrBridge->TakePendingScrollPayload(key); -- if (!payload.IsEmpty()) { -- RecordCompositionPayloadsPresented(payload); -- } -- -- TransactionId transactionId = mWrBridge->FlushTransactionIdsForEpoch( -- aEpoch, aCompositeStartId, aCompositeStart, aRenderStart, -- aCompositeEnd, uiController); -- Unused << SendDidComposite(LayersId{0}, transactionId, aCompositeStart, -- aCompositeEnd); -- -- nsTArray notifications; -- mWrBridge->ExtractImageCompositeNotifications(¬ifications); -- if (!notifications.IsEmpty()) { -- Unused << ImageBridgeParent::NotifyImageComposites(notifications); -- } -+ if (mIsForcedFirstPaint) { -+ uiController->NotifyFirstPaint(); -+ mIsForcedFirstPaint = false; -+ } -+ -+ std::pair key(aPipelineId, aEpoch); -+ nsTArray payload = -+ mWrBridge->TakePendingScrollPayload(key); -+ if (!payload.IsEmpty()) { -+ RecordCompositionPayloadsPresented(payload); -+ } -+ -+ TransactionId transactionId = mWrBridge->FlushTransactionIdsForEpoch( -+ aEpoch, aCompositeStartId, aCompositeStart, aRenderStart, aCompositeEnd, -+ uiController); -+ Unused << SendDidComposite(LayersId{0}, transactionId, aCompositeStart, -+ aCompositeEnd); -+ -+ nsTArray notifications; -+ mWrBridge->ExtractImageCompositeNotifications(¬ifications); -+ if (!notifications.IsEmpty()) { -+ Unused << ImageBridgeParent::NotifyImageComposites(notifications); - } - return; - } -@@ -2408,21 +2406,19 @@ - if (wrBridge && wrBridge->GetCompositorBridge()) { - MOZ_ASSERT(!wrBridge->IsRootWebRenderBridgeParent()); - wrBridge->RemoveEpochDataPriorTo(aEpoch); -- if (!mPaused) { -- std::pair key(aPipelineId, aEpoch); -- nsTArray payload = -- wrBridge->TakePendingScrollPayload(key); -- if (!payload.IsEmpty()) { -- RecordCompositionPayloadsPresented(payload); -- } -- -- TransactionId transactionId = wrBridge->FlushTransactionIdsForEpoch( -- aEpoch, aCompositeStartId, aCompositeStart, aRenderStart, -- aCompositeEnd, uiController, aStats, &stats); -- Unused << wrBridge->GetCompositorBridge()->SendDidComposite( -- wrBridge->GetLayersId(), transactionId, aCompositeStart, -- aCompositeEnd); -+ -+ std::pair key(aPipelineId, aEpoch); -+ nsTArray payload = -+ wrBridge->TakePendingScrollPayload(key); -+ if (!payload.IsEmpty()) { -+ RecordCompositionPayloadsPresented(payload); - } -+ -+ TransactionId transactionId = wrBridge->FlushTransactionIdsForEpoch( -+ aEpoch, aCompositeStartId, aCompositeStart, aRenderStart, aCompositeEnd, -+ uiController, aStats, &stats); -+ Unused << wrBridge->GetCompositorBridge()->SendDidComposite( -+ wrBridge->GetLayersId(), transactionId, aCompositeStart, aCompositeEnd); - } - - if (!stats.IsEmpty()) { - diff --git a/mozilla-1673313.patch b/mozilla-1673313.patch deleted file mode 100644 index 549243b..0000000 --- a/mozilla-1673313.patch +++ /dev/null @@ -1,351 +0,0 @@ -changeset: 556172:143b4ca96ec9 -tag: tip -parent: 556169:61c35792ca70 -user: stransky -date: Mon Oct 26 12:15:49 2020 +0100 -files: widget/gtk/WindowSurfaceWayland.cpp widget/gtk/WindowSurfaceWayland.h -description: -Bug 1673313 [Wayland] Don't fail when Shm allocation fails, r?jhorak - -- Make WaylandAllocateShmMemory() fallible. -- Implement WaylandReAllocateShmMemory() to re-allocate Shm pool. -- Remove WaylandShmPool::Resize() and use WaylandShmPool::Create() only. -- Implement and use WaylandShmPool::Release(). -- Make WindowSurfaceWayland::CreateWaylandBuffer() as fallible. - -Differential Revision: https://phabricator.services.mozilla.com/D94735 - - -diff --git a/widget/gtk/WindowSurfaceWayland.cpp b/widget/gtk/WindowSurfaceWayland.cpp ---- a/widget/gtk/WindowSurfaceWayland.cpp -+++ b/widget/gtk/WindowSurfaceWayland.cpp -@@ -209,14 +209,23 @@ RefPtr WindowBackBuffe - } - - static int WaylandAllocateShmMemory(int aSize) { -- static int counter = 0; -- nsPrintfCString shmName("/wayland.mozilla.ipc.%d", counter++); -- int fd = shm_open(shmName.get(), O_CREAT | O_RDWR | O_EXCL, 0600); -- if (fd >= 0) { -- shm_unlink(shmName.get()); -- } else { -- printf_stderr("Unable to SHM memory segment\n"); -- MOZ_CRASH(); -+ int fd = -1; -+ do { -+ static int counter = 0; -+ nsPrintfCString shmName("/wayland.mozilla.ipc.%d", counter++); -+ fd = shm_open(shmName.get(), O_CREAT | O_RDWR | O_EXCL, 0600); -+ if (fd >= 0) { -+ // We don't want to use leaked file -+ if (shm_unlink(shmName.get()) != 0) { -+ NS_WARNING("shm_unlink failed"); -+ return -1; -+ } -+ } -+ } while (fd < 0 && errno == EEXIST); -+ -+ if (fd < 0) { -+ NS_WARNING(nsPrintfCString("shm_open failed: %s", strerror(errno)).get()); -+ return -1; - } - - int ret = 0; -@@ -225,59 +234,103 @@ static int WaylandAllocateShmMemory(int - ret = posix_fallocate(fd, 0, aSize); - } while (ret == EINTR); - if (ret != 0) { -+ NS_WARNING( -+ nsPrintfCString("posix_fallocate() fails to allocate shm memory: %s", -+ strerror(ret)) -+ .get()); - close(fd); -- MOZ_CRASH("posix_fallocate() fails to allocate shm memory"); -+ return -1; - } - #else - do { - ret = ftruncate(fd, aSize); - } while (ret < 0 && errno == EINTR); - if (ret < 0) { -+ NS_WARNING(nsPrintfCString("ftruncate() fails to allocate shm memory: %s", -+ strerror(ret)) -+ .get()); - close(fd); -- MOZ_CRASH("ftruncate() fails to allocate shm memory"); -+ fd = -1; - } - #endif - - return fd; - } - --WaylandShmPool::WaylandShmPool(RefPtr aWaylandDisplay, -- int aSize) -- : mAllocatedSize(aSize) { -- mShmPoolFd = WaylandAllocateShmMemory(mAllocatedSize); -- mImageData = mmap(nullptr, mAllocatedSize, PROT_READ | PROT_WRITE, MAP_SHARED, -- mShmPoolFd, 0); -- MOZ_RELEASE_ASSERT(mImageData != MAP_FAILED, -- "Unable to map drawing surface!"); -+static bool WaylandReAllocateShmMemory(int aFd, int aSize) { -+ if (ftruncate(aFd, aSize) < 0) { -+ return false; -+ } -+#ifdef HAVE_POSIX_FALLOCATE -+ do { -+ errno = posix_fallocate(aFd, 0, aSize); -+ } while (errno == EINTR); -+ if (errno != 0) { -+ return false; -+ } -+#endif -+ return true; -+} - -- mShmPool = -- wl_shm_create_pool(aWaylandDisplay->GetShm(), mShmPoolFd, mAllocatedSize); -+WaylandShmPool::WaylandShmPool() -+ : mShmPool(nullptr), -+ mShmPoolFd(-1), -+ mAllocatedSize(0), -+ mImageData(MAP_FAILED){}; - -- // We set our queue to get mShmPool events at compositor thread. -- wl_proxy_set_queue((struct wl_proxy*)mShmPool, -- aWaylandDisplay->GetEventQueue()); -+void WaylandShmPool::Release() { -+ if (mImageData != MAP_FAILED) { -+ munmap(mImageData, mAllocatedSize); -+ mImageData = MAP_FAILED; -+ } -+ if (mShmPool) { -+ wl_shm_pool_destroy(mShmPool); -+ mShmPool = 0; -+ } -+ if (mShmPoolFd >= 0) { -+ close(mShmPoolFd); -+ mShmPoolFd = -1; -+ } - } - --bool WaylandShmPool::Resize(int aSize) { -+bool WaylandShmPool::Create(RefPtr aWaylandDisplay, -+ int aSize) { - // We do size increase only -- if (aSize <= mAllocatedSize) return true; -- -- if (ftruncate(mShmPoolFd, aSize) < 0) return false; -+ if (aSize <= mAllocatedSize) { -+ return true; -+ } - --#ifdef HAVE_POSIX_FALLOCATE -- do { -- errno = posix_fallocate(mShmPoolFd, 0, aSize); -- } while (errno == EINTR); -- if (errno != 0) return false; --#endif -+ if (mShmPoolFd < 0) { -+ mShmPoolFd = WaylandAllocateShmMemory(aSize); -+ if (mShmPoolFd < 0) { -+ return false; -+ } -+ } else { -+ if (!WaylandReAllocateShmMemory(mShmPoolFd, aSize)) { -+ Release(); -+ return false; -+ } -+ } - -- wl_shm_pool_resize(mShmPool, aSize); -- -- munmap(mImageData, mAllocatedSize); -- -+ if (mImageData != MAP_FAILED) { -+ munmap(mImageData, mAllocatedSize); -+ } - mImageData = - mmap(nullptr, aSize, PROT_READ | PROT_WRITE, MAP_SHARED, mShmPoolFd, 0); -- if (mImageData == MAP_FAILED) return false; -+ if (mImageData == MAP_FAILED) { -+ NS_WARNING("Unable to map drawing surface!"); -+ Release(); -+ return false; -+ } -+ -+ if (mShmPool) { -+ wl_shm_pool_resize(mShmPool, aSize); -+ } else { -+ mShmPool = wl_shm_create_pool(aWaylandDisplay->GetShm(), mShmPoolFd, aSize); -+ // We set our queue to get mShmPool events at compositor thread. -+ wl_proxy_set_queue((struct wl_proxy*)mShmPool, -+ aWaylandDisplay->GetEventQueue()); -+ } - - mAllocatedSize = aSize; - return true; -@@ -289,11 +342,7 @@ void WaylandShmPool::SetImageDataFromPoo - memcpy(mImageData, aSourcePool->GetImageData(), aImageDataSize); - } - --WaylandShmPool::~WaylandShmPool() { -- munmap(mImageData, mAllocatedSize); -- wl_shm_pool_destroy(mShmPool); -- close(mShmPoolFd); --} -+WaylandShmPool::~WaylandShmPool() { Release(); } - - static void buffer_release(void* data, wl_buffer* buffer) { - auto surface = reinterpret_cast(data); -@@ -302,14 +351,14 @@ static void buffer_release(void* data, w - - static const struct wl_buffer_listener buffer_listener = {buffer_release}; - --void WindowBackBufferShm::Create(int aWidth, int aHeight) { -+bool WindowBackBufferShm::Create(int aWidth, int aHeight) { - MOZ_ASSERT(!IsAttached(), "We can't create attached buffers."); -- MOZ_ASSERT(!mWLBuffer, "there is wl_buffer already!"); - -- int newBufferSize = aWidth * aHeight * BUFFER_BPP; -- if (!mShmPool.Resize(newBufferSize)) { -- mWLBuffer = nullptr; -- return; -+ ReleaseShmSurface(); -+ -+ int size = aWidth * aHeight * BUFFER_BPP; -+ if (!mShmPool.Create(GetWaylandDisplay(), size)) { -+ return false; - } - - mWLBuffer = -@@ -325,14 +374,16 @@ void WindowBackBufferShm::Create(int aWi - LOGWAYLAND(("WindowBackBufferShm::Create [%p] wl_buffer %p ID %d\n", - (void*)this, (void*)mWLBuffer, - mWLBuffer ? wl_proxy_get_id((struct wl_proxy*)mWLBuffer) : -1)); -+ return true; - } - - void WindowBackBufferShm::ReleaseShmSurface() { - LOGWAYLAND(("WindowBackBufferShm::Release [%p]\n", (void*)this)); -- -- wl_buffer_destroy(mWLBuffer); -+ if (mWLBuffer) { -+ wl_buffer_destroy(mWLBuffer); -+ mWLBuffer = nullptr; -+ } - mWidth = mHeight = 0; -- mWLBuffer = nullptr; - } - - void WindowBackBufferShm::Clear() { -@@ -340,16 +391,13 @@ void WindowBackBufferShm::Clear() { - } - - WindowBackBufferShm::WindowBackBufferShm( -- WindowSurfaceWayland* aWindowSurfaceWayland, int aWidth, int aHeight) -+ WindowSurfaceWayland* aWindowSurfaceWayland) - : WindowBackBuffer(aWindowSurfaceWayland), -- mShmPool(aWindowSurfaceWayland->GetWaylandDisplay(), -- aWidth * aHeight * BUFFER_BPP), -+ mShmPool(), - mWLBuffer(nullptr), -- mWidth(aWidth), -- mHeight(aHeight), -- mAttached(false) { -- Create(aWidth, aHeight); --} -+ mWidth(0), -+ mHeight(0), -+ mAttached(false) {} - - WindowBackBufferShm::~WindowBackBufferShm() { ReleaseShmSurface(); } - -@@ -357,13 +405,9 @@ bool WindowBackBufferShm::Resize(int aWi - if (aWidth == mWidth && aHeight == mHeight) { - return true; - } -- - LOGWAYLAND(("WindowBackBufferShm::Resize [%p] %d %d\n", (void*)this, aWidth, - aHeight)); -- -- ReleaseShmSurface(); - Create(aWidth, aHeight); -- - return (mWLBuffer != nullptr); - } - -@@ -488,11 +532,13 @@ WindowBackBuffer* WindowSurfaceWayland:: - return nullptr; - } - -- WindowBackBuffer* buffer = new WindowBackBufferShm(this, aWidth, aHeight); -- if (buffer) { -- mShmBackupBuffer[availableBuffer] = buffer; -+ WindowBackBuffer* buffer = new WindowBackBufferShm(this); -+ if (!buffer->Create(aWidth, aHeight)) { -+ delete buffer; -+ return nullptr; - } - -+ mShmBackupBuffer[availableBuffer] = buffer; - return buffer; - } - -diff --git a/widget/gtk/WindowSurfaceWayland.h b/widget/gtk/WindowSurfaceWayland.h ---- a/widget/gtk/WindowSurfaceWayland.h -+++ b/widget/gtk/WindowSurfaceWayland.h -@@ -25,14 +25,14 @@ class WindowSurfaceWayland; - // Allocates and owns shared memory for Wayland drawing surface - class WaylandShmPool { - public: -- WaylandShmPool(RefPtr aDisplay, int aSize); -- ~WaylandShmPool(); -- -- bool Resize(int aSize); -+ bool Create(RefPtr aWaylandDisplay, int aSize); -+ void Release(); - wl_shm_pool* GetShmPool() { return mShmPool; }; - void* GetImageData() { return mImageData; }; - void SetImageDataFromPool(class WaylandShmPool* aSourcePool, - int aImageDataSize); -+ WaylandShmPool(); -+ ~WaylandShmPool(); - - private: - wl_shm_pool* mShmPool; -@@ -53,6 +53,7 @@ class WindowBackBuffer { - virtual bool IsAttached() = 0; - - virtual void Clear() = 0; -+ virtual bool Create(int aWidth, int aHeight) = 0; - virtual bool Resize(int aWidth, int aHeight) = 0; - - virtual int GetWidth() = 0; -@@ -87,8 +88,7 @@ class WindowBackBuffer { - - class WindowBackBufferShm : public WindowBackBuffer { - public: -- WindowBackBufferShm(WindowSurfaceWayland* aWindowSurfaceWayland, int aWidth, -- int aHeight); -+ WindowBackBufferShm(WindowSurfaceWayland* aWindowSurfaceWayland); - ~WindowBackBufferShm(); - - already_AddRefed Lock(); -@@ -100,6 +100,7 @@ class WindowBackBufferShm : public Windo - void SetAttached() { mAttached = true; }; - - void Clear(); -+ bool Create(int aWidth, int aHeight); - bool Resize(int aWidth, int aHeight); - bool SetImageDataFromBuffer(class WindowBackBuffer* aSourceBuffer); - -@@ -109,7 +110,6 @@ class WindowBackBufferShm : public Windo - wl_buffer* GetWlBuffer() { return mWLBuffer; }; - - private: -- void Create(int aWidth, int aHeight); - void ReleaseShmSurface(); - - // WaylandShmPool provides actual shared memory we draw into - diff --git a/mozilla-1700520.patch b/mozilla-1700520.patch deleted file mode 100644 index c93cbe2..0000000 --- a/mozilla-1700520.patch +++ /dev/null @@ -1,51 +0,0 @@ -diff --git a/gfx/wr/swgl/src/blend.h b/gfx/wr/swgl/src/blend.h ---- a/gfx/wr/swgl/src/blend.h -+++ b/gfx/wr/swgl/src/blend.h -@@ -405,7 +405,7 @@ - blend_key = BlendKey(AA_BLEND_KEY_NONE + blend_key); - } - --static ALWAYS_INLINE WideRGBA8 blend_pixels(uint32_t* buf, PackedRGBA8 pdst, -+static PREFER_INLINE WideRGBA8 blend_pixels(uint32_t* buf, PackedRGBA8 pdst, - WideRGBA8 src, int span = 4) { - WideRGBA8 dst = unpack(pdst); - const WideRGBA8 RGB_MASK = {0xFFFF, 0xFFFF, 0xFFFF, 0, 0xFFFF, 0xFFFF, -@@ -686,7 +686,7 @@ - // clang-format on - } - --static ALWAYS_INLINE WideR8 blend_pixels(uint8_t* buf, WideR8 dst, WideR8 src, -+static PREFER_INLINE WideR8 blend_pixels(uint8_t* buf, WideR8 dst, WideR8 src, - int span = 4) { - // clang-format off - #define BLEND_CASE_KEY(key) \ -diff --git a/gfx/wr/swgl/src/gl.cc b/gfx/wr/swgl/src/gl.cc ---- a/gfx/wr/swgl/src/gl.cc -+++ b/gfx/wr/swgl/src/gl.cc -@@ -58,10 +58,24 @@ - } - - #else --# define ALWAYS_INLINE __attribute__((always_inline)) inline -+// GCC is slower when dealing with always_inline, especially in debug builds. -+// When using Clang, use always_inline more aggressively. -+# if defined(__clang__) || defined(NDEBUG) -+# define ALWAYS_INLINE __attribute__((always_inline)) inline -+# else -+# define ALWAYS_INLINE inline -+# endif - # define NO_INLINE __attribute__((noinline)) - #endif - -+// Some functions may cause excessive binary bloat if inlined in debug or with -+// GCC builds, so use PREFER_INLINE on these instead of ALWAYS_INLINE. -+#if defined(__clang__) && defined(NDEBUG) -+# define PREFER_INLINE ALWAYS_INLINE -+#else -+# define PREFER_INLINE inline -+#endif -+ - #define UNREACHABLE __builtin_unreachable() - - #define UNUSED [[maybe_unused]] - diff --git a/mozilla-1701089.patch b/mozilla-1701089.patch deleted file mode 100644 index af431f2..0000000 --- a/mozilla-1701089.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/dom/media/gmp/GMPParent.cpp b/dom/media/gmp/GMPParent.cpp ---- a/dom/media/gmp/GMPParent.cpp -+++ b/dom/media/gmp/GMPParent.cpp -@@ -884,7 +884,7 @@ - // - // Google's code to parse manifests can be used as a reference for strings - // the manifest may contain -- // https://cs.chromium.org/chromium/src/chrome/common/media/cdm_manifest.cc?l=73&rcl=393e60bfc2299449db7ef374c0ef1c324716e562 -+ // https://source.chromium.org/chromium/chromium/src/+/master:components/cdm/common/cdm_manifest.cc;l=74;drc=775880ced8a989191281e93854c7f2201f25068f - // - // Gecko's internal strings can be found at - // https://searchfox.org/mozilla-central/rev/ea63a0888d406fae720cf24f4727d87569a8cab5/dom/media/eme/MediaKeySystemAccess.cpp#149-155 -@@ -892,7 +892,8 @@ - nsCString codec; - if (chromiumCodec.EqualsASCII("vp8")) { - codec = "vp8"_ns; -- } else if (chromiumCodec.EqualsASCII("vp9.0")) { -+ } else if (chromiumCodec.EqualsASCII("vp9.0") || // Legacy string. -+ chromiumCodec.EqualsASCII("vp09")) { - codec = "vp9"_ns; - } else if (chromiumCodec.EqualsASCII("avc1")) { - codec = "h264"_ns; - diff --git a/mozilla-1753402.patch b/mozilla-1753402.patch deleted file mode 100644 index e53e73b..0000000 --- a/mozilla-1753402.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/tools/profiler/rust-api/build.rs b/tools/profiler/rust-api/build.rs ---- a/tools/profiler/rust-api/build.rs -+++ b/tools/profiler/rust-api/build.rs -@@ -61,6 +61,7 @@ - let mut builder = Builder::default() - .enable_cxx_namespaces() - .with_codegen_config(CodegenConfig::TYPES | CodegenConfig::VARS | CodegenConfig::FUNCTIONS) -+ .disable_untagged_union() - .size_t_is_usize(true); - - for dir in SEARCH_PATHS.iter() { - diff --git a/mozilla-1758948.patch b/mozilla-1758948.patch deleted file mode 100644 index 7bc99e4..0000000 --- a/mozilla-1758948.patch +++ /dev/null @@ -1,28 +0,0 @@ -changeset: 623785:a6b80ee8c35f -tag: tip -parent: 623782:b1ed2fa50612 -user: stransky -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::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/mozilla-1774271.patch b/mozilla-1774271.patch deleted file mode 100644 index 6029b22..0000000 --- a/mozilla-1774271.patch +++ /dev/null @@ -1,31 +0,0 @@ -changeset: 623945:6117c9ecd16b -tag: tip -parent: 623941:45e313943df5 -user: stransky -date: Fri Jun 17 12:36:38 2022 +0200 -files: gfx/thebes/gfxPlatform.cpp -description: -Bug 1774271 [Linux] Don't use EGL_MESA_image_dma_buf_export in Mesa/Intel due to https://gitlab.freedesktop.org/mesa/mesa/-/issues/6688 r?jgilbert - -Depends on https://phabricator.services.mozilla.com/D149238 - -Differential Revision: https://phabricator.services.mozilla.com/D149608 - - -diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp ---- a/gfx/thebes/gfxPlatform.cpp -+++ b/gfx/thebes/gfxPlatform.cpp -@@ -2871,6 +2871,12 @@ void gfxPlatform::InitWebGLConfig() { - adapterDriverVendor.Find("radeonsi") != -1) { - gfxVars::SetUseDMABufSurfaceExport(false); - } -+ // Disable EGL_MESA_image_dma_buf_export on mesa/iris due to -+ // https://gitlab.freedesktop.org/mesa/mesa/-/issues/6688 -+ if (adapterDriverVendor.Find("mesa") != -1 && -+ adapterDriverVendor.Find("iris") != -1) { -+ gfxVars::SetUseDMABufSurfaceExport(false); -+ } - } - } - - diff --git a/mozilla-1885133.patch b/mozilla-1885133.patch deleted file mode 100644 index a73503a..0000000 --- a/mozilla-1885133.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/browser/components/shell/nsGNOMEShellDBusHelper.cpp b/browser/components/shell/nsGNOMEShellDBusHelper.cpp ---- a/browser/components/shell/nsGNOMEShellDBusHelper.cpp -+++ b/browser/components/shell/nsGNOMEShellDBusHelper.cpp -@@ -29,7 +29,7 @@ static bool GetGnomeSearchTitle(const ch - } - - AutoTArray formatStrings; -- CopyASCIItoUTF16(nsCString(aSearchedTerm), *formatStrings.AppendElement()); -+ CopyUTF8toUTF16(nsCString(aSearchedTerm), *formatStrings.AppendElement()); - - nsAutoString gnomeSearchTitle; - bundle->FormatStringFromName("gnomeSearchProviderSearch", formatStrings, -@@ -41,7 +41,7 @@ static bool GetGnomeSearchTitle(const ch - static const char* introspect_template = - "\n" -+ "\"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\">\n" - "\n" - " \n" - " \n" diff --git a/mozilla-440908.patch b/mozilla-440908.patch deleted file mode 100644 index cce5248..0000000 --- a/mozilla-440908.patch +++ /dev/null @@ -1,111 +0,0 @@ -diff -up firefox-56.0/modules/libpref/prefapi.cpp.440908 firefox-56.0/modules/libpref/prefapi.cpp ---- firefox-56.0/modules/libpref/prefapi.cpp.440908 2017-09-14 22:15:52.000000000 +0200 -+++ firefox-56.0/modules/libpref/prefapi.cpp 2017-09-25 10:39:39.266572792 +0200 -@@ -1036,8 +1036,8 @@ void PREF_ReaderCallback(void *clo - PrefValue value, - PrefType type, - bool isDefault, -- bool isStickyDefault) -- -+ bool isStickyDefault, -+ bool isLocked) - { - uint32_t flags = 0; - if (isDefault) { -@@ -1049,4 +1049,6 @@ void PREF_ReaderCallback(void *clo - flags |= kPrefForceSet; - } - pref_HashPref(pref, value, type, flags); -+ if (isLocked) -+ PREF_LockPref(pref, true); - } -diff -up firefox-56.0/modules/libpref/prefapi.h.440908 firefox-56.0/modules/libpref/prefapi.h ---- firefox-56.0/modules/libpref/prefapi.h.440908 2017-07-31 18:20:51.000000000 +0200 -+++ firefox-56.0/modules/libpref/prefapi.h 2017-09-25 10:39:39.267572789 +0200 -@@ -246,8 +246,8 @@ void PREF_ReaderCallback( void *closure, - PrefValue value, - PrefType type, - bool isDefault, -- bool isStickyDefault); -- -+ bool isStickyDefault, -+ bool isLocked); - - /* - * Callback whenever we change a preference -diff -up firefox-56.0/modules/libpref/prefread.cpp.440908 firefox-56.0/modules/libpref/prefread.cpp ---- firefox-56.0/modules/libpref/prefread.cpp.440908 2017-09-14 22:15:52.000000000 +0200 -+++ firefox-56.0/modules/libpref/prefread.cpp 2017-09-25 10:39:39.267572789 +0200 -@@ -43,6 +43,7 @@ enum { - #define BITS_PER_HEX_DIGIT 4 - - static const char kUserPref[] = "user_pref"; -+static const char kLockPref[] = "lockPref"; - static const char kPref[] = "pref"; - static const char kPrefSticky[] = "sticky_pref"; - static const char kTrue[] = "true"; -@@ -146,7 +147,7 @@ pref_DoCallback(PrefParseState *ps) - break; - } - (*ps->reader)(ps->closure, ps->lb, value, ps->vtype, ps->fdefault, -- ps->fstickydefault); -+ ps->fstickydefault, ps->flock); - return true; - } - -@@ -215,6 +216,7 @@ PREF_ParseBuf(PrefParseState *ps, const - ps->vtype = PrefType::Invalid; - ps->fdefault = false; - ps->fstickydefault = false; -+ ps->flock = false; - } - switch (c) { - case '/': /* begin comment block or line? */ -@@ -225,11 +227,14 @@ PREF_ParseBuf(PrefParseState *ps, const - break; - case 'u': /* indicating user_pref */ - case 's': /* indicating sticky_pref */ -+ case 'l': /* indicating lockPref */ - case 'p': /* indicating pref */ - if (c == 'u') { - ps->smatch = kUserPref; - } else if (c == 's') { - ps->smatch = kPrefSticky; -+ } else if (c == 'l') { -+ ps->smatch = kLockPref; - } else { - ps->smatch = kPref; - } -@@ -277,8 +282,10 @@ PREF_ParseBuf(PrefParseState *ps, const - /* name parsing */ - case PREF_PARSE_UNTIL_NAME: - if (c == '\"' || c == '\'') { -- ps->fdefault = (ps->smatch == kPref || ps->smatch == kPrefSticky); -+ ps->fdefault = (ps->smatch == kPref || ps->smatch == kPrefSticky -+ || ps->smatch == kLockPref); - ps->fstickydefault = (ps->smatch == kPrefSticky); -+ ps->flock = (ps->smatch == kLockPref); - ps->quotechar = c; - ps->nextstate = PREF_PARSE_UNTIL_COMMA; /* return here when done */ - state = PREF_PARSE_QUOTED_STRING; -diff -up firefox-56.0/modules/libpref/prefread.h.440908 firefox-56.0/modules/libpref/prefread.h ---- firefox-56.0/modules/libpref/prefread.h.440908 2017-09-14 22:15:52.000000000 +0200 -+++ firefox-56.0/modules/libpref/prefread.h 2017-09-25 10:39:39.267572789 +0200 -@@ -34,7 +34,8 @@ typedef void (*PrefReader)(void *c - PrefValue val, - PrefType type, - bool defPref, -- bool stickyPref); -+ bool stickyPref, -+ bool lockPref); - - /** - * Report any errors or warnings we encounter during parsing. -@@ -62,6 +63,7 @@ typedef struct PrefParseState { - PrefType vtype; /* PREF_STRING,INT,BOOL */ - bool fdefault; /* true if (default) pref */ - bool fstickydefault; /* true if (sticky) pref */ -+ bool flock; /* true if pref to be locked */ - } PrefParseState; - - /** diff --git a/rhbz-1400293-fix-mozilla-1324096.patch b/rhbz-1400293-fix-mozilla-1324096.patch deleted file mode 100644 index 4a2691e..0000000 --- a/rhbz-1400293-fix-mozilla-1324096.patch +++ /dev/null @@ -1,72 +0,0 @@ -diff --git a/security/certverifier/CertVerifier.cpp b/security/certverifier/CertVerifier.cpp ---- a/security/certverifier/CertVerifier.cpp -+++ b/security/certverifier/CertVerifier.cpp -@@ -120,16 +120,20 @@ IsCertChainRootBuiltInRoot(const UniqueC - } - CERTCertificate* root = rootNode->cert; - if (!root) { - return Result::FATAL_ERROR_LIBRARY_FAILURE; - } - return IsCertBuiltInRoot(root, result); - } - -+// The term "builtin root" traditionally refers to a root CA certificate that -+// has been added to the NSS trust store, because it has been approved -+// for inclusion according to the Mozilla CA policy, and might be accepted -+// by Mozilla applications as an issuer for certificates seen on the public web. - Result - IsCertBuiltInRoot(CERTCertificate* cert, bool& result) - { - result = false; - #ifdef DEBUG - nsCOMPtr component(do_GetService(PSM_COMPONENT_CONTRACTID)); - if (!component) { - return Result::FATAL_ERROR_LIBRARY_FAILURE; -@@ -142,25 +146,38 @@ IsCertBuiltInRoot(CERTCertificate* cert, - return Success; - } - #endif // DEBUG - AutoSECMODListReadLock lock; - for (SECMODModuleList* list = SECMOD_GetDefaultModuleList(); list; - list = list->next) { - for (int i = 0; i < list->module->slotCount; i++) { - PK11SlotInfo* slot = list->module->slots[i]; -- // PK11_HasRootCerts should return true if and only if the given slot has -- // an object with a CKA_CLASS of CKO_NETSCAPE_BUILTIN_ROOT_LIST, which -- // should be true only of the builtin root list. -- // If we can find a copy of the given certificate on the slot with the -- // builtin root list, that certificate must be a builtin. -- if (PK11_IsPresent(slot) && PK11_HasRootCerts(slot) && -- PK11_FindCertInSlot(slot, cert, nullptr) != CK_INVALID_HANDLE) { -- result = true; -- return Success; -+ // We're searching for the "builtin root module", which is a module that -+ // contains an object with a CKA_CLASS of CKO_NETSCAPE_BUILTIN_ROOT_LIST. -+ // We use PK11_HasRootCerts() to identify a module with that property. -+ // In the past, we exclusively used the PKCS#11 module named nssckbi, -+ // which is provided by the NSS library. -+ // Nowadays, some distributions use a replacement module, which contains -+ // the builtin roots, but which also contains additional CA certificates, -+ // such as CAs trusted in a local deployment. -+ // We want to be able to distinguish between these two categories, -+ // because a CA, which may issue certificates for the public web, -+ // is expected to comply with additional requirements. -+ // If the certificate has attribute CKA_NSS_MOZILLA_CA_POLICY set to true, -+ // then we treat it as a "builtin root". -+ if (PK11_IsPresent(slot) && PK11_HasRootCerts(slot)) { -+ CK_OBJECT_HANDLE handle = PK11_FindCertInSlot(slot, cert, nullptr); -+ if (handle != CK_INVALID_HANDLE && -+ PK11_HasAttributeSet(slot, handle, CKA_NSS_MOZILLA_CA_POLICY, -+ false)) { -+ // Attribute was found, and is set to true -+ result = true; -+ break; -+ } - } - } - } - return Success; - } - - static Result - BuildCertChainForOneKeyUsage(NSSCertDBTrustDomain& trustDomain, Input certDER, diff --git a/rust-thirdparty-checksum-fix.patch b/rust-thirdparty-checksum-fix.patch deleted file mode 100644 index 8047ea8..0000000 --- a/rust-thirdparty-checksum-fix.patch +++ /dev/null @@ -1,6 +0,0 @@ -diff -up firefox-72.0/third_party/rust/backtrace-sys/.cargo-checksum.json.checksum-fix firefox-72.0/third_party/rust/backtrace-sys/.cargo-checksum.json ---- firefox-72.0/third_party/rust/backtrace-sys/.cargo-checksum.json.checksum-fix 2020-01-07 10:55:14.265047927 +0100 -+++ firefox-72.0/third_party/rust/backtrace-sys/.cargo-checksum.json 2020-01-07 10:55:18.109059804 +0100 -@@ -1 +1 @@ --{"files":{"Cargo.toml":"d7b29a5b7e31bc0ffb83473b2f78041527903740402c1a6394329857045174f7","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","build.rs":"0fe1e551ab35e7589f96979cf1d366561b62925e9c7da6249c25f25684ce9ede","src/lib.rs":"cb45ba047240bceac6ea74da50c2f48ae81a965b578c833a766a3ea0db1075f3","src/libbacktrace/LICENSE":"ef8a9b3247488f8901ca60de9b17b745d7bd67e5ec1e622f80d62364572200d8","src/libbacktrace/Makefile.am":"5353e0ce3a4732b42ccf031c474f7234336992cb23ba76cbfda3aa5262e69988","src/libbacktrace/Makefile.in":"1802d55fa8ef616a407c69311b3fa4e579093d124a215c834149ab1c50b4f3ad","src/libbacktrace/Mark.Twain-Tom.Sawyer.txt":"461eb7cb2d57d293fc680c836464c9125e4382be3596f7d415093ae9db8fcb0e","src/libbacktrace/README.md":"3b27ca2f7ddaf464ad81366a278ed4d34ad513de3766b330a51464828fa3131f","src/libbacktrace/acinclude.m4":"7f1d64805039b0e41d4c4106265618a6f8921d3cf091d64ab31fa7b900dc892f","src/libbacktrace/aclocal.m4":"4899cfe70722ba1de2b42b4e9965c1db1b173b5d6d4522cdc785becd5a5c212c","src/libbacktrace/alloc.c":"33891bbaf755c050058f8fd7dd3708e6062ef65245a0717216af45b78bab0fd0","src/libbacktrace/atomic.c":"82fd23c7ee7154d1ce4fc823637ede9cfa0e469f4073f38fff4dd9081070f1aa","src/libbacktrace/backtrace-supported.h.in":"42277f3c383386b6cfa3d3d889336e92303fac0ae1a9fb8a6a56737245dfb8f3","src/libbacktrace/backtrace.c":"837ea7b781a737d1ed37e4d03c463bcbe1432b2dc3b79b37344b21013cdfcca4","src/libbacktrace/backtrace.h":"9f035b3830c1c6000259c8ecf0bf53144f7c2e6064dfc95975b89f7f612ebf0e","src/libbacktrace/btest.c":"41c774496d58177e408b1dc33d6a792d0940634885978eed73fb192f732cafc5","src/libbacktrace/config.guess":"9be3de218833c076786b919dc34aab691611f4cd73316e7705f2673e2c41921b","src/libbacktrace/config.h.in":"b5002d9f96f6a26f54317f9d23a5ffff71fa3ee520fd8993810891d43b9a9bf7","src/libbacktrace/config.sub":"c8e70ab53f04d2f2b0280aa0e8a5432e90a902bfa2af7b0854168eb1fb3a84c0","src/libbacktrace/config/libtool.m4":"644ce34d5e9fcc544f3ef5c707f4cb29add798bbfc24e29932b55fb251e50353","src/libbacktrace/config/ltoptions.m4":"9d294950c4d97e2c891d472933113f397d410ef2a8ed875d714f81761626bbd8","src/libbacktrace/config/ltsugar.m4":"2c6618a04aa6389a2a528cde2e69ed5de55acc6c50892b486ea3e56e4e5b2c3b","src/libbacktrace/config/ltversion.m4":"8d129a46367fadad9f202dac50e708696d4d628313d01745127388e9c736e996","src/libbacktrace/config/lt~obsolete.m4":"c6c668594337aafef7d59f585bce7010436153815fe341461d81301a2235b959","src/libbacktrace/configure":"59763fc255248b54fba5d0761d61093a73d51fa4cb400b0df1b5f339b9c2f48a","src/libbacktrace/configure.ac":"b9292548330eb4d2cb014e9d9e6cd4df656aed982917365896a8f2534e9732e5","src/libbacktrace/dwarf.c":"c2103af5f94dd135e5df2a98dfc28ef2cbe0f3d56783d21e1487b9f314bfcbbc","src/libbacktrace/edtest.c":"947b9878ae45f6ba95d3b949bb080e9feed4ffdb27536cf5602b81ce79556ccf","src/libbacktrace/edtest2.c":"964bb0bb510a19013fb1cb56552929ed15cf55787eba4369d5820b74be07d249","src/libbacktrace/elf.c":"fe3e10d33c0c0965f016381302128ce82d664071095ad5077932377e3a789679","src/libbacktrace/fileline.c":"7b3b92044648f45becc498d4ed41ddc8ec08f0d11f6491cc05cfccd8a4d7627a","src/libbacktrace/filenames.h":"2c23cde7dd12dd9e0343cb37b5066036112deca703b61178f07c01f3e01398c9","src/libbacktrace/filetype.awk":"aa38776487a77dc13c93efa2a861204b384c3c4333501ed9bdb4ccbde2a784c0","src/libbacktrace/install-sh":"e7064b5e01a8d173409749c337966698fa04661cde1e3ef1a93be250eec0d2c3","src/libbacktrace/internal.h":"88c63ad6acc7e68330df3028675be4d4e3374bd787255fe22dd3febbbbc438b6","src/libbacktrace/ltmain.sh":"873bdcbc8690bd90c0f3632aac40027e880fd95ea45fb5a02ed901fea4afa4fe","src/libbacktrace/macho.c":"9a8864901eede4c34305b05bb6e815b25b76f04b59caf74381ca9dfbe8f1a8c4","src/libbacktrace/missing":"300bea3fb273b763eca2e4bb1576c663605d9b49de385fd375f82be8d912f506","src/libbacktrace/mmap.c":"5be917f3e9eba1fe49eb1bb391e28609e8377b4ce4593cace6012bf17434a33c","src/libbacktrace/mmapio.c":"be5719c4f92e70045fe6014a0493a5b4adc165ecde42c20130ea6e9da1ce978f","src/libbacktrace/move-if-change":"689762b92d23003926ba729acf98b9a109abf46de0698c09ddfa0d20490d8af5","src/libbacktrace/nounwind.c":"5eee9cc7298b7d0d2aea68eef62175541f34f88acf17736e0612056c5bb7318d","src/libbacktrace/pecoff.c":"bb536ae71a1a1c4dad5508d26032e7e81860df6d8ddfc8d696378ebefbc513b1","src/libbacktrace/posix.c":"f5e0ff701a1a1e29a25462ea49f174b049dafc6c25e040ee0eb77dd189353277","src/libbacktrace/print.c":"2d446406c8e2d9a1258d46d119be1c563bd86b6a4039cbf773b6de09c541390d","src/libbacktrace/read.c":"d0d4007f681f265a6c31e27ded45f4007502c90464eefdb4e80b69e4ae2ede28","src/libbacktrace/simple.c":"b0f767d3740195015aeadaa67e84bf6eb255a730f258485ca86bdbe02b066eca","src/libbacktrace/sort.c":"a82f911fc826a353ea5616379748dfa318ad4e57e20791af7ead853f7e73583d","src/libbacktrace/state.c":"a45abbe4077a47d17fb9687057c40828e633df12d21b8ed40b71a78d86918100","src/libbacktrace/stest.c":"7443fe435f1ee5ce49a3e634faf81a4137d66a057577fe88a211cfa819ddb2e2","src/libbacktrace/testlib.c":"a7e096e895b36db7f997a6673ce48f92a032046876511e813a8a52de6079b29a","src/libbacktrace/testlib.h":"02e02404dc89dd4f3dd82635f794a927541dd78d490d777bedf8a5424e5033fc","src/libbacktrace/ttest.c":"380f3b2be164bd6770768181fa05f1778cee8f0322434896d19724ae7cd105df","src/libbacktrace/unknown.c":"d2d148ea045dcad96ba1c5528b7036b000eeb8439ae397bca01deb0d8b287972","src/libbacktrace/xcoff.c":"e70ed97743306f71ea6132a058d68f1bb7be1380a2d38725b5dc877f5e07905d","src/libbacktrace/ztest.c":"7ad8277664e596aecb6af25818b7671e199ef6002ec2c38d9288179c5cad2082","symbol-map":"c81ced08aa32f0edb1d0ed6e4aaf5d3d516f8c158417d2ba3fa36b45b6ae08fd"},"package":"c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0"} -+{"files":{"Cargo.toml":"d7b29a5b7e31bc0ffb83473b2f78041527903740402c1a6394329857045174f7","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","build.rs":"0fe1e551ab35e7589f96979cf1d366561b62925e9c7da6249c25f25684ce9ede","src/lib.rs":"cb45ba047240bceac6ea74da50c2f48ae81a965b578c833a766a3ea0db1075f3","src/libbacktrace/LICENSE":"ef8a9b3247488f8901ca60de9b17b745d7bd67e5ec1e622f80d62364572200d8","src/libbacktrace/Makefile.am":"5353e0ce3a4732b42ccf031c474f7234336992cb23ba76cbfda3aa5262e69988","src/libbacktrace/Makefile.in":"1802d55fa8ef616a407c69311b3fa4e579093d124a215c834149ab1c50b4f3ad","src/libbacktrace/Mark.Twain-Tom.Sawyer.txt":"461eb7cb2d57d293fc680c836464c9125e4382be3596f7d415093ae9db8fcb0e","src/libbacktrace/README.md":"3b27ca2f7ddaf464ad81366a278ed4d34ad513de3766b330a51464828fa3131f","src/libbacktrace/acinclude.m4":"7f1d64805039b0e41d4c4106265618a6f8921d3cf091d64ab31fa7b900dc892f","src/libbacktrace/aclocal.m4":"4899cfe70722ba1de2b42b4e9965c1db1b173b5d6d4522cdc785becd5a5c212c","src/libbacktrace/alloc.c":"33891bbaf755c050058f8fd7dd3708e6062ef65245a0717216af45b78bab0fd0","src/libbacktrace/atomic.c":"82fd23c7ee7154d1ce4fc823637ede9cfa0e469f4073f38fff4dd9081070f1aa","src/libbacktrace/backtrace-supported.h.in":"42277f3c383386b6cfa3d3d889336e92303fac0ae1a9fb8a6a56737245dfb8f3","src/libbacktrace/backtrace.c":"837ea7b781a737d1ed37e4d03c463bcbe1432b2dc3b79b37344b21013cdfcca4","src/libbacktrace/backtrace.h":"9f035b3830c1c6000259c8ecf0bf53144f7c2e6064dfc95975b89f7f612ebf0e","src/libbacktrace/btest.c":"41c774496d58177e408b1dc33d6a792d0940634885978eed73fb192f732cafc5","src/libbacktrace/config.guess":"0913c6ce799fbfca156ae5fb55fc2e5950808b4d1435e71c6a8b768e54424052","src/libbacktrace/config.h.in":"b5002d9f96f6a26f54317f9d23a5ffff71fa3ee520fd8993810891d43b9a9bf7","src/libbacktrace/config.sub":"c8e70ab53f04d2f2b0280aa0e8a5432e90a902bfa2af7b0854168eb1fb3a84c0","src/libbacktrace/config/libtool.m4":"644ce34d5e9fcc544f3ef5c707f4cb29add798bbfc24e29932b55fb251e50353","src/libbacktrace/config/ltoptions.m4":"9d294950c4d97e2c891d472933113f397d410ef2a8ed875d714f81761626bbd8","src/libbacktrace/config/ltsugar.m4":"2c6618a04aa6389a2a528cde2e69ed5de55acc6c50892b486ea3e56e4e5b2c3b","src/libbacktrace/config/ltversion.m4":"8d129a46367fadad9f202dac50e708696d4d628313d01745127388e9c736e996","src/libbacktrace/config/lt~obsolete.m4":"c6c668594337aafef7d59f585bce7010436153815fe341461d81301a2235b959","src/libbacktrace/configure":"59763fc255248b54fba5d0761d61093a73d51fa4cb400b0df1b5f339b9c2f48a","src/libbacktrace/configure.ac":"b9292548330eb4d2cb014e9d9e6cd4df656aed982917365896a8f2534e9732e5","src/libbacktrace/dwarf.c":"c2103af5f94dd135e5df2a98dfc28ef2cbe0f3d56783d21e1487b9f314bfcbbc","src/libbacktrace/edtest.c":"947b9878ae45f6ba95d3b949bb080e9feed4ffdb27536cf5602b81ce79556ccf","src/libbacktrace/edtest2.c":"964bb0bb510a19013fb1cb56552929ed15cf55787eba4369d5820b74be07d249","src/libbacktrace/elf.c":"fe3e10d33c0c0965f016381302128ce82d664071095ad5077932377e3a789679","src/libbacktrace/fileline.c":"7b3b92044648f45becc498d4ed41ddc8ec08f0d11f6491cc05cfccd8a4d7627a","src/libbacktrace/filenames.h":"2c23cde7dd12dd9e0343cb37b5066036112deca703b61178f07c01f3e01398c9","src/libbacktrace/filetype.awk":"aa38776487a77dc13c93efa2a861204b384c3c4333501ed9bdb4ccbde2a784c0","src/libbacktrace/install-sh":"e7064b5e01a8d173409749c337966698fa04661cde1e3ef1a93be250eec0d2c3","src/libbacktrace/internal.h":"88c63ad6acc7e68330df3028675be4d4e3374bd787255fe22dd3febbbbc438b6","src/libbacktrace/ltmain.sh":"873bdcbc8690bd90c0f3632aac40027e880fd95ea45fb5a02ed901fea4afa4fe","src/libbacktrace/macho.c":"9a8864901eede4c34305b05bb6e815b25b76f04b59caf74381ca9dfbe8f1a8c4","src/libbacktrace/missing":"300bea3fb273b763eca2e4bb1576c663605d9b49de385fd375f82be8d912f506","src/libbacktrace/mmap.c":"5be917f3e9eba1fe49eb1bb391e28609e8377b4ce4593cace6012bf17434a33c","src/libbacktrace/mmapio.c":"be5719c4f92e70045fe6014a0493a5b4adc165ecde42c20130ea6e9da1ce978f","src/libbacktrace/move-if-change":"689762b92d23003926ba729acf98b9a109abf46de0698c09ddfa0d20490d8af5","src/libbacktrace/nounwind.c":"5eee9cc7298b7d0d2aea68eef62175541f34f88acf17736e0612056c5bb7318d","src/libbacktrace/pecoff.c":"bb536ae71a1a1c4dad5508d26032e7e81860df6d8ddfc8d696378ebefbc513b1","src/libbacktrace/posix.c":"f5e0ff701a1a1e29a25462ea49f174b049dafc6c25e040ee0eb77dd189353277","src/libbacktrace/print.c":"2d446406c8e2d9a1258d46d119be1c563bd86b6a4039cbf773b6de09c541390d","src/libbacktrace/read.c":"d0d4007f681f265a6c31e27ded45f4007502c90464eefdb4e80b69e4ae2ede28","src/libbacktrace/simple.c":"b0f767d3740195015aeadaa67e84bf6eb255a730f258485ca86bdbe02b066eca","src/libbacktrace/sort.c":"a82f911fc826a353ea5616379748dfa318ad4e57e20791af7ead853f7e73583d","src/libbacktrace/state.c":"a45abbe4077a47d17fb9687057c40828e633df12d21b8ed40b71a78d86918100","src/libbacktrace/stest.c":"7443fe435f1ee5ce49a3e634faf81a4137d66a057577fe88a211cfa819ddb2e2","src/libbacktrace/testlib.c":"a7e096e895b36db7f997a6673ce48f92a032046876511e813a8a52de6079b29a","src/libbacktrace/testlib.h":"02e02404dc89dd4f3dd82635f794a927541dd78d490d777bedf8a5424e5033fc","src/libbacktrace/ttest.c":"380f3b2be164bd6770768181fa05f1778cee8f0322434896d19724ae7cd105df","src/libbacktrace/unknown.c":"d2d148ea045dcad96ba1c5528b7036b000eeb8439ae397bca01deb0d8b287972","src/libbacktrace/xcoff.c":"e70ed97743306f71ea6132a058d68f1bb7be1380a2d38725b5dc877f5e07905d","src/libbacktrace/ztest.c":"7ad8277664e596aecb6af25818b7671e199ef6002ec2c38d9288179c5cad2082","symbol-map":"c81ced08aa32f0edb1d0ed6e4aaf5d3d516f8c158417d2ba3fa36b45b6ae08fd"},"package":"c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0"} From 078b597b1e74879a6c87fc30ec101b5dd3011057 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Wed, 17 Aug 2022 10:30:14 +0200 Subject: [PATCH 105/545] Use build_ldflags These are the LDFLAGS that all packages are supposed to use, including hardening and other flags. --- firefox.spec | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/firefox.spec b/firefox.spec index 221882a..bb7b33f 100644 --- a/firefox.spec +++ b/firefox.spec @@ -670,20 +670,16 @@ MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-O2//') MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-g/-g0/') export MOZ_DEBUG_FLAGS=" " %endif +MOZ_LINK_FLAGS="%{build_ldflags}" %if !%{build_with_clang} %ifarch aarch64 %{ix86} -MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads" +MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" %endif %ifarch %{arm} -MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--strip-debug" +MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -Wl,--no-keep-memory -Wl,--strip-debug" echo "ac_add_options --enable-linker=gold" >> .mozconfig %endif %endif -%if 0%{?flatpak} -# Make sure the linker can find libraries in /app/lib64 as we don't use -# __global_ldflags that normally sets this. -MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -L%{_libdir}" -%endif %ifarch %{arm} %{ix86} %{s390x} export RUSTFLAGS="-Cdebuginfo=0" %endif @@ -1077,6 +1073,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : - Use constrain_build macro to simplify parallel make handling - Drop obsolete build conditionals - Drop unused patches +- Use build_ldflags * Tue Aug 23 2022 Jan Horak - 104.0-4 - Rebuild due to ppc64le fixes From 73c24a4d458769b6a8560eb855a4f7a2545fe998 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Wed, 17 Aug 2022 10:31:20 +0200 Subject: [PATCH 106/545] Drop hardened_build option Now that we correctly use Fedora's ldflags (previous commit), there's no need to do anything special to enable hardened build. All of it is already included in the default build flags. --- firefox.spec | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/firefox.spec b/firefox.spec index bb7b33f..26bd17a 100644 --- a/firefox.spec +++ b/firefox.spec @@ -65,7 +65,6 @@ ExcludeArch: s390x %else %global system_libvpx 0 %endif -%global hardened_build 1 %global system_jpeg 1 %global disable_elfhack 1 %global use_bundled_cbindgen 1 @@ -657,9 +656,6 @@ MOZ_OPT_FLAGS=$(echo "%{optflags}" | %{__sed} -e 's/-Wall//') # Workaround for mozbz#1531309 MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-Werror=format-security//') MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fpermissive" -%if %{?hardened_build} -MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fPIC -Wl,-z,relro -Wl,-z,now" -%endif %if %{?debug_build} MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-O2//') %endif @@ -1074,6 +1070,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : - Drop obsolete build conditionals - Drop unused patches - Use build_ldflags +- Drop hardened_build option * Tue Aug 23 2022 Jan Horak - 104.0-4 - Rebuild due to ppc64le fixes From f5c2bd2d80a2c69fa7e0f3e5bcda6b16493bf958 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Wed, 17 Aug 2022 10:32:01 +0200 Subject: [PATCH 107/545] Re-enable s390x builds It builds fine again after latest fixes. --- firefox.spec | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/firefox.spec b/firefox.spec index 26bd17a..9d407b3 100644 --- a/firefox.spec +++ b/firefox.spec @@ -28,11 +28,6 @@ %global build_with_clang 0 %endif -# There are still build problems on s390x, see -# https://koji.fedoraproject.org/koji/taskinfo?taskID=55048351 -# https://bugzilla.redhat.com/show_bug.cgi?id=1897522 -ExcludeArch: s390x - %ifarch armv7hl %global create_debuginfo 0 @@ -1071,6 +1066,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : - Drop unused patches - Use build_ldflags - Drop hardened_build option +- Re-enable s390x builds * Tue Aug 23 2022 Jan Horak - 104.0-4 - Rebuild due to ppc64le fixes From 3e4bfaceacca1e9f5956d2cf29fff73abad01d2c Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Tue, 23 Aug 2022 16:31:43 +0200 Subject: [PATCH 108/545] Fix the build on F35 Add back previous RPM_BUILD_NCPUS limiting code as F35 doesn't have the new %constrain_build macro. We can drop the compat code as soon as F35 is EOL. --- firefox.spec | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 9d407b3..1486383 100644 --- a/firefox.spec +++ b/firefox.spec @@ -715,10 +715,34 @@ echo "ac_add_options MOZ_PGO=1" >> .mozconfig export CCACHE_DISABLE=1 %endif +%if 0%{?fedora} > 35 # Require 2 GB of RAM per CPU core %constrain_build -m 2048 - echo "mk_add_options MOZ_MAKE_FLAGS=\"-j%{_smp_build_ncpus}\"" >> .mozconfig +%else +# F35 doesn't have %%constrain_build +MOZ_SMP_FLAGS=-j1 +# On x86_64 architectures, Mozilla can build up to 4 jobs at once in parallel, +# however builds tend to fail on other arches when building in parallel. +%ifarch %{ix86} s390x %{arm} aarch64 +[ -z "$RPM_BUILD_NCPUS" ] && \ + RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`" +[ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2 +%endif +%ifarch x86_64 ppc ppc64 ppc64le +[ -z "$RPM_BUILD_NCPUS" ] && \ + RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`" +[ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2 +[ "$RPM_BUILD_NCPUS" -ge 4 ] && MOZ_SMP_FLAGS=-j4 +[ "$RPM_BUILD_NCPUS" -ge 8 ] && MOZ_SMP_FLAGS=-j8 +[ "$RPM_BUILD_NCPUS" -ge 16 ] && MOZ_SMP_FLAGS=-j16 +[ "$RPM_BUILD_NCPUS" -ge 24 ] && MOZ_SMP_FLAGS=-j24 +[ "$RPM_BUILD_NCPUS" -ge 32 ] && MOZ_SMP_FLAGS=-j32 +[ "$RPM_BUILD_NCPUS" -ge 64 ] && MOZ_SMP_FLAGS=-j64 +%endif +echo "mk_add_options MOZ_MAKE_FLAGS=\"$MOZ_SMP_FLAGS\"" >> .mozconfig +%endif + echo "mk_add_options MOZ_SERVICES_SYNC=1" >> .mozconfig echo "export STRIP=/bin/true" >> .mozconfig #export MACH_USE_SYSTEM_PYTHON=1 From 5075a9d0d6c47c73c3c5ea0b8ae2b0873c623ea2 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Wed, 24 Aug 2022 11:33:27 +0200 Subject: [PATCH 109/545] Fix typo in ifarch condition It's supposed to be "%ifarch s390x", not "%ifarch %{s390x}" as %{s390x} macro doesn't exist. --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 1486383..8346b89 100644 --- a/firefox.spec +++ b/firefox.spec @@ -671,7 +671,7 @@ MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -Wl,--no-keep-memory -Wl,--strip-debug" echo "ac_add_options --enable-linker=gold" >> .mozconfig %endif %endif -%ifarch %{arm} %{ix86} %{s390x} +%ifarch %{arm} %{ix86} s390x export RUSTFLAGS="-Cdebuginfo=0" %endif %if %{build_with_asan} From 8cc909acb98a71ca27b6dcbb7ea960cdb7113a3d Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 30 Aug 2022 14:18:31 +0200 Subject: [PATCH 110/545] Updated to 104.0.1 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 8d2ff7e..a06dc71 100644 --- a/.gitignore +++ b/.gitignore @@ -526,3 +526,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-104.0.source.tar.xz /firefox-langpacks-104.0-20220816.tar.xz /firefox-langpacks-104.0-20220822.tar.xz +/firefox-langpacks-104.0.1-20220830.tar.xz +/firefox-104.0.1.source.tar.xz diff --git a/firefox.spec b/firefox.spec index 8346b89..f68fdd8 100644 --- a/firefox.spec +++ b/firefox.spec @@ -158,13 +158,13 @@ Summary: Mozilla Firefox Web browser Name: firefox -Version: 104.0 -Release: 5%{?pre_tag}%{?dist} +Version: 104.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220822.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220830.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1084,6 +1084,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue Aug 30 2022 Martin Stransky - 104.0.1-1 +- Updated to 104.0.1 + * Tue Aug 23 2022 Kalev Lember - 104.0-5 - Use constrain_build macro to simplify parallel make handling - Drop obsolete build conditionals diff --git a/sources b/sources index 87bb3df..7436b83 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 -SHA512 (firefox-104.0.source.tar.xz) = 8778650ffa3c2d18802c348e27789f00cff143c7ca0ae01b1bcd050b6942c149db25696b48f3c702fbde901c15fcae976ac731a456f641637cae3eb56d0077d3 -SHA512 (firefox-langpacks-104.0-20220822.tar.xz) = f2eb109de14f82041115eab5f4e10d8555017617f8d5067709a1588536d50df8fd94f767d9b5866002f8da6901894d46931d82bfce9c2aceb1a33b68c48074db +SHA512 (firefox-langpacks-104.0.1-20220830.tar.xz) = 616b4abfa30234efbc522dc2046ff30bef591262ee3f7d83ad2d8c9c5386474cddf194e143627bc19dffa309042a84023c223799ad8f87573f4c948bf9a360ce +SHA512 (firefox-104.0.1.source.tar.xz) = ad80fccfde34a201fc4b596c2a0a1d959abc132946dde0865b6da624a07fd9c57381bc268c394a17f295e0e183d122b2cf5c5126e8a0bc99684affaa6212e246 From 64c0f9493e6c000473155b371c2f6212db815dc8 Mon Sep 17 00:00:00 2001 From: Leo Bunel Date: Mon, 5 Sep 2022 13:55:20 +0000 Subject: [PATCH 111/545] Update French translation in firefox.desktop This change proposes a French translation for the "Open the Profile Manager" entry in the top bar menu. --- firefox.desktop | 1 + 1 file changed, 1 insertion(+) diff --git a/firefox.desktop b/firefox.desktop index 6e51fb3..02e156d 100644 --- a/firefox.desktop +++ b/firefox.desktop @@ -272,4 +272,5 @@ Exec=firefox --private-window %u Name=Open the Profile Manager Name[cs]=Správa profilů Name[de]=Profilverwaltung öffnen +Name[fr]=Ouvrir le gestionnaire de profils Exec=firefox --ProfileManager From d033d1ab6807775897f7c84bc09eab06d2521eab Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 7 Sep 2022 08:49:32 +0200 Subject: [PATCH 112/545] Updated to 104.0.2 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index a06dc71..c35f3e3 100644 --- a/.gitignore +++ b/.gitignore @@ -528,3 +528,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-104.0-20220822.tar.xz /firefox-langpacks-104.0.1-20220830.tar.xz /firefox-104.0.1.source.tar.xz +/firefox-104.0.2.source.tar.xz +/firefox-langpacks-104.0.2-20220906.tar.xz diff --git a/firefox.spec b/firefox.spec index f68fdd8..ad13fa5 100644 --- a/firefox.spec +++ b/firefox.spec @@ -158,13 +158,13 @@ Summary: Mozilla Firefox Web browser Name: firefox -Version: 104.0.1 +Version: 104.0.2 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220830.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220906.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1084,6 +1084,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue Sep 6 2022 Martin Stransky - 104.0.2-1 +- Updated to 104.0.2 + * Tue Aug 30 2022 Martin Stransky - 104.0.1-1 - Updated to 104.0.1 diff --git a/sources b/sources index 7436b83..20f15bc 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 -SHA512 (firefox-langpacks-104.0.1-20220830.tar.xz) = 616b4abfa30234efbc522dc2046ff30bef591262ee3f7d83ad2d8c9c5386474cddf194e143627bc19dffa309042a84023c223799ad8f87573f4c948bf9a360ce -SHA512 (firefox-104.0.1.source.tar.xz) = ad80fccfde34a201fc4b596c2a0a1d959abc132946dde0865b6da624a07fd9c57381bc268c394a17f295e0e183d122b2cf5c5126e8a0bc99684affaa6212e246 +SHA512 (firefox-104.0.2.source.tar.xz) = bf0d972add11566f5ef6402a22abd82122945de9fa9aab6ed7bb7e41d0843d41948a6d95c0769b0b704c066c8ff6e3f3bf26fcf288c64cd3b3f09a13d4dd467d +SHA512 (firefox-langpacks-104.0.2-20220906.tar.xz) = 139d6e0979ac780f496f30ccde1b03ab1cb8a7fd1d7cb0be605a5e2a31bdbb675ab887d5f5cc5ccf7e76e016bae5e2a26205d063ebfd5020bbd269869dadba20 From fc66484a39b700c5ac2844099a134f03c83b68a7 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 21 Sep 2022 11:20:26 +0200 Subject: [PATCH 113/545] Update to 105.0 --- .gitignore | 2 ++ D154024.diff | 17 ----------------- firefox.spec | 9 +++++---- mozilla-1670333.patch | 32 ++++++++++++++++---------------- sources | 2 ++ 5 files changed, 25 insertions(+), 37 deletions(-) delete mode 100644 D154024.diff diff --git a/.gitignore b/.gitignore index c35f3e3..66bb1e4 100644 --- a/.gitignore +++ b/.gitignore @@ -530,3 +530,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-104.0.1.source.tar.xz /firefox-104.0.2.source.tar.xz /firefox-langpacks-104.0.2-20220906.tar.xz +/firefox-langpacks-105.0-20220920.tar.xz +/firefox-105.0.source.tar.xz diff --git a/D154024.diff b/D154024.diff deleted file mode 100644 index 776f40b..0000000 --- a/D154024.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/toolkit/crashreporter/client/ping.cpp b/toolkit/crashreporter/client/ping.cpp ---- a/toolkit/crashreporter/client/ping.cpp -+++ b/toolkit/crashreporter/client/ping.cpp -@@ -51,11 +51,11 @@ - CFUUIDBytes bytes = CFUUIDGetUUIDBytes(uuid); - memcpy(&id, &bytes, sizeof(UUID)); - - CFRelease(uuid); - #elif defined(HAVE_ARC4RANDOM_BUF) // Android, BSD, ... -- arc4random_buf(id, sizeof(UUID)); -+ arc4random_buf(&id, sizeof(UUID)); - #else // Linux - int fd = open("/dev/urandom", O_RDONLY); - - if (fd == -1) { - return ""; - diff --git a/firefox.spec b/firefox.spec index ad13fa5..d77c5ec 100644 --- a/firefox.spec +++ b/firefox.spec @@ -158,13 +158,13 @@ Summary: Mozilla Firefox Web browser Name: firefox -Version: 104.0.2 +Version: 105.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220906.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220920.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -213,7 +213,6 @@ Patch61: firefox-glibc-dynstack.patch Patch62: build-python.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch77: build-python-3.11.patch -Patch78: D154024.diff # Test patches # Generate without context by @@ -472,7 +471,6 @@ This package contains results of tests executed during build. %patch54 -p1 -b .1669639 %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch77 -p1 -b .build-python-3.11 -%patch78 -p1 -b .D154024 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -1084,6 +1082,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue Sep 20 2022 Martin Stransky - 105.0-1 +- Updated to 105.0 + * Tue Sep 6 2022 Martin Stransky - 104.0.2-1 - Updated to 104.0.2 diff --git a/mozilla-1670333.patch b/mozilla-1670333.patch index 1c5c476..a1eaa9a 100644 --- a/mozilla-1670333.patch +++ b/mozilla-1670333.patch @@ -1,6 +1,6 @@ -diff -up firefox-99.0/dom/media/mp4/MP4Demuxer.cpp.1670333 firefox-99.0/dom/media/mp4/MP4Demuxer.cpp ---- firefox-99.0/dom/media/mp4/MP4Demuxer.cpp.1670333 2022-03-31 01:24:44.000000000 +0200 -+++ firefox-99.0/dom/media/mp4/MP4Demuxer.cpp 2022-04-04 09:58:35.606351546 +0200 +diff -up firefox-105.0/dom/media/mp4/MP4Demuxer.cpp.1670333 firefox-105.0/dom/media/mp4/MP4Demuxer.cpp +--- firefox-105.0/dom/media/mp4/MP4Demuxer.cpp.1670333 2022-09-15 20:49:09.000000000 +0200 ++++ firefox-105.0/dom/media/mp4/MP4Demuxer.cpp 2022-09-20 09:16:35.404519249 +0200 @@ -31,6 +31,8 @@ mozilla::LogModule* GetDemuxerLog() { re DDMOZ_LOG(gMediaDemuxerLog, mozilla::LogLevel::Debug, "::%s: " arg, \ __func__, ##__VA_ARGS__) @@ -23,19 +23,19 @@ diff -up firefox-99.0/dom/media/mp4/MP4Demuxer.cpp.1670333 firefox-99.0/dom/medi if (sample->mKeyframe != keyframe) { NS_WARNING(nsPrintfCString("Frame incorrectly marked as %skeyframe " "@ pts:%" PRId64 " dur:%" PRId64 -diff -up firefox-99.0/dom/media/platforms/PDMFactory.cpp.1670333 firefox-99.0/dom/media/platforms/PDMFactory.cpp ---- firefox-99.0/dom/media/platforms/PDMFactory.cpp.1670333 2022-03-31 01:24:44.000000000 +0200 -+++ firefox-99.0/dom/media/platforms/PDMFactory.cpp 2022-04-04 10:09:57.383419125 +0200 -@@ -58,6 +58,8 @@ +diff -up firefox-105.0/dom/media/platforms/PDMFactory.cpp.1670333 firefox-105.0/dom/media/platforms/PDMFactory.cpp +--- firefox-105.0/dom/media/platforms/PDMFactory.cpp.1670333 2022-09-15 20:49:09.000000000 +0200 ++++ firefox-105.0/dom/media/platforms/PDMFactory.cpp 2022-09-20 09:20:05.369572900 +0200 +@@ -61,6 +61,8 @@ #include +bool gUseKeyframeFromContainer = false; + - namespace mozilla { - - #define PDM_INIT_LOG(msg, ...) \ -@@ -495,7 +497,7 @@ void PDMFactory::CreateRddPDMs() { + using DecodeSupport = mozilla::media::DecodeSupport; + using DecodeSupportSet = mozilla::media::DecodeSupportSet; + using MediaCodec = mozilla::media::MediaCodec; +@@ -553,7 +555,7 @@ void PDMFactory::CreateRddPDMs() { #ifdef MOZ_FFMPEG if (StaticPrefs::media_ffmpeg_enabled() && StaticPrefs::media_rdd_ffmpeg_enabled() && @@ -44,7 +44,7 @@ diff -up firefox-99.0/dom/media/platforms/PDMFactory.cpp.1670333 firefox-99.0/do mFailureFlags += GetFailureFlagBasedOnFFmpegStatus( FFmpegRuntimeLinker::LinkStatusCode()); } -@@ -602,8 +604,9 @@ void PDMFactory::CreateDefaultPDMs() { +@@ -653,8 +655,9 @@ void PDMFactory::CreateContentPDMs() { CreateAndStartupPDM(); @@ -55,10 +55,10 @@ diff -up firefox-99.0/dom/media/platforms/PDMFactory.cpp.1670333 firefox-99.0/do mFailureFlags += DecoderDoctorDiagnostics::Flags::GMPPDMFailedToStartup; } } -diff -up firefox-99.0/dom/media/platforms/PDMFactory.h.1670333 firefox-99.0/dom/media/platforms/PDMFactory.h ---- firefox-99.0/dom/media/platforms/PDMFactory.h.1670333 2022-03-31 01:24:44.000000000 +0200 -+++ firefox-99.0/dom/media/platforms/PDMFactory.h 2022-04-04 09:58:35.606351546 +0200 -@@ -121,6 +121,7 @@ class PDMFactory final { +diff -up firefox-105.0/dom/media/platforms/PDMFactory.h.1670333 firefox-105.0/dom/media/platforms/PDMFactory.h +--- firefox-105.0/dom/media/platforms/PDMFactory.h.1670333 2022-09-15 20:49:08.000000000 +0200 ++++ firefox-105.0/dom/media/platforms/PDMFactory.h 2022-09-20 09:16:35.404519249 +0200 +@@ -102,6 +102,7 @@ class PDMFactory final { RefPtr mNullPDM; DecoderDoctorDiagnostics::FlagsSet mFailureFlags; diff --git a/sources b/sources index 20f15bc..f4e3ee3 100644 --- a/sources +++ b/sources @@ -2,3 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa3490307 SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (firefox-104.0.2.source.tar.xz) = bf0d972add11566f5ef6402a22abd82122945de9fa9aab6ed7bb7e41d0843d41948a6d95c0769b0b704c066c8ff6e3f3bf26fcf288c64cd3b3f09a13d4dd467d SHA512 (firefox-langpacks-104.0.2-20220906.tar.xz) = 139d6e0979ac780f496f30ccde1b03ab1cb8a7fd1d7cb0be605a5e2a31bdbb675ab887d5f5cc5ccf7e76e016bae5e2a26205d063ebfd5020bbd269869dadba20 +SHA512 (firefox-langpacks-105.0-20220920.tar.xz) = 11470bd984d0535336769204614b40d331487fa65427c96b4f9ffb4013e8b9d7d7e55e087b6352fbee669d2d4fcdd9115aba748c63feffa51e63e072d6a4e3be +SHA512 (firefox-105.0.source.tar.xz) = a48f323f874b538402630a9094daa83189b3ca319feddc80fd66d087eca13f21c8b2d85be9c29e948c18cb7c524adac44e135adcde4d4592738e104ae9c1a734 From c8fd8993ea79acbba326dc9a5f88ff23f9dbec28 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 22 Sep 2022 09:11:08 +0200 Subject: [PATCH 114/545] updated nss version --- firefox.spec | 2 +- sources | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/firefox.spec b/firefox.spec index d77c5ec..75640c2 100644 --- a/firefox.spec +++ b/firefox.spec @@ -113,7 +113,7 @@ %if %{?system_nss} %global nspr_version 4.32 %global nspr_build_version %{nspr_version} -%global nss_version 3.80 +%global nss_version 3.82 %global nss_build_version %{nss_version} %endif diff --git a/sources b/sources index f4e3ee3..e032546 100644 --- a/sources +++ b/sources @@ -1,6 +1,4 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 -SHA512 (firefox-104.0.2.source.tar.xz) = bf0d972add11566f5ef6402a22abd82122945de9fa9aab6ed7bb7e41d0843d41948a6d95c0769b0b704c066c8ff6e3f3bf26fcf288c64cd3b3f09a13d4dd467d -SHA512 (firefox-langpacks-104.0.2-20220906.tar.xz) = 139d6e0979ac780f496f30ccde1b03ab1cb8a7fd1d7cb0be605a5e2a31bdbb675ab887d5f5cc5ccf7e76e016bae5e2a26205d063ebfd5020bbd269869dadba20 SHA512 (firefox-langpacks-105.0-20220920.tar.xz) = 11470bd984d0535336769204614b40d331487fa65427c96b4f9ffb4013e8b9d7d7e55e087b6352fbee669d2d4fcdd9115aba748c63feffa51e63e072d6a4e3be SHA512 (firefox-105.0.source.tar.xz) = a48f323f874b538402630a9094daa83189b3ca319feddc80fd66d087eca13f21c8b2d85be9c29e948c18cb7c524adac44e135adcde4d4592738e104ae9c1a734 From 64f367594e7f3b866d44a438c707af78924c28d5 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 22 Sep 2022 22:10:39 +0200 Subject: [PATCH 115/545] Updated to 105.0.1 --- .gitignore | 2 ++ firefox-i686-build.patch | 12 ++++++++++++ firefox.spec | 7 ++++++- sources | 4 ++-- 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 firefox-i686-build.patch diff --git a/.gitignore b/.gitignore index 66bb1e4..477fd16 100644 --- a/.gitignore +++ b/.gitignore @@ -532,3 +532,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-104.0.2-20220906.tar.xz /firefox-langpacks-105.0-20220920.tar.xz /firefox-105.0.source.tar.xz +/firefox-105.0.1.source.tar.xz +/firefox-langpacks-105.0.1-20220922.tar.xz diff --git a/firefox-i686-build.patch b/firefox-i686-build.patch new file mode 100644 index 0000000..320199f --- /dev/null +++ b/firefox-i686-build.patch @@ -0,0 +1,12 @@ +diff -up firefox-105.0/mozglue/misc/SIMD_avx2.cpp.old firefox-105.0/mozglue/misc/SIMD_avx2.cpp +--- firefox-105.0/mozglue/misc/SIMD_avx2.cpp.old 2022-09-22 21:35:07.006221995 +0200 ++++ firefox-105.0/mozglue/misc/SIMD_avx2.cpp 2022-09-22 21:36:12.972480517 +0200 +@@ -55,7 +55,7 @@ __m256i CmpEq256(__m256i a, __m256i b) { + return _mm256_cmpeq_epi64(a, b); + } + +-# if defined(__GNUC__) && !defined(__clang__) ++# if 0 + + // See the comment in SIMD.cpp over Load32BitsIntoXMM. This is just adapted + // from that workaround. Testing this, it also yields the correct instructions diff --git a/firefox.spec b/firefox.spec index 75640c2..f1f127d 100644 --- a/firefox.spec +++ b/firefox.spec @@ -158,7 +158,7 @@ Summary: Mozilla Firefox Web browser Name: firefox -Version: 105.0 +Version: 105.0.1 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ @@ -213,6 +213,7 @@ Patch61: firefox-glibc-dynstack.patch Patch62: build-python.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch77: build-python-3.11.patch +Patch78: firefox-i686-build.patch # Test patches # Generate without context by @@ -471,6 +472,7 @@ This package contains results of tests executed during build. %patch54 -p1 -b .1669639 %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch77 -p1 -b .build-python-3.11 +%patch78 -p1 -b .firefox-i686 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -1082,6 +1084,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue Sep 22 2022 Martin Stransky - 105.0.1-1 +- Updated to 105.0.1 + * Tue Sep 20 2022 Martin Stransky - 105.0-1 - Updated to 105.0 diff --git a/sources b/sources index e032546..5ec7b62 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 -SHA512 (firefox-langpacks-105.0-20220920.tar.xz) = 11470bd984d0535336769204614b40d331487fa65427c96b4f9ffb4013e8b9d7d7e55e087b6352fbee669d2d4fcdd9115aba748c63feffa51e63e072d6a4e3be -SHA512 (firefox-105.0.source.tar.xz) = a48f323f874b538402630a9094daa83189b3ca319feddc80fd66d087eca13f21c8b2d85be9c29e948c18cb7c524adac44e135adcde4d4592738e104ae9c1a734 +SHA512 (firefox-105.0.1.source.tar.xz) = 66ef7cd5028953e7da9d55e127135739c9d85be68ec633b71c52d6c9427edb0bd8a38504148484cd322adcefb57bfefe6e57cb15855f195508fe438864f4322b +SHA512 (firefox-langpacks-105.0.1-20220922.tar.xz) = d731ee2be094bc061260d30e256a08fed2eaacf862437a28e6206549847557be9649aa364c6b515ba0023725d8d89378a1e2340b0426d011e0042d57425fabf2 From 420bed369a14c31770c183de8249b37b4654ae0c Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 22 Sep 2022 22:11:05 +0200 Subject: [PATCH 116/545] Updated to 105.0.1 --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index f1f127d..ae0914d 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1084,7 +1084,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog -* Tue Sep 22 2022 Martin Stransky - 105.0.1-1 +* Thu Sep 22 2022 Martin Stransky - 105.0.1-1 - Updated to 105.0.1 * Tue Sep 20 2022 Martin Stransky - 105.0-1 From ddc85ef64314ee3433340b671c06732ed22a891d Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 22 Sep 2022 22:44:50 +0200 Subject: [PATCH 117/545] langpack fix --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index ae0914d..2d3f257 100644 --- a/firefox.spec +++ b/firefox.spec @@ -164,7 +164,7 @@ URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220920.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220922.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig From ea59033f8e413357024b4aa1eb9b0b1018c386e1 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 23 Sep 2022 11:23:57 +0200 Subject: [PATCH 118/545] Excluded i686 due to https://bugzilla.mozilla.org/show_bug.cgi?id=1792159 --- firefox.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/firefox.spec b/firefox.spec index 2d3f257..5997c54 100644 --- a/firefox.spec +++ b/firefox.spec @@ -2,6 +2,9 @@ # when building locally to reduce build time. %global release_build 1 +# Excluded due to https://bugzilla.mozilla.org/show_bug.cgi?id=1792159 +ExcludeArch: i686 + # Run Mozilla test suite as a part of compile rpm section. Turn off when # building locally and don't want to spend 24 hours waiting for results. %global run_firefox_tests 0 @@ -1086,6 +1089,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %changelog * Thu Sep 22 2022 Martin Stransky - 105.0.1-1 - Updated to 105.0.1 +- Excluded i686 due to https://bugzilla.mozilla.org/show_bug.cgi?id=1792159 * Tue Sep 20 2022 Martin Stransky - 105.0-1 - Updated to 105.0 From d0beb2802b36616a436b19d7f72bcfbf7d8adc4b Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 26 Sep 2022 09:13:54 +0200 Subject: [PATCH 119/545] Added RHBZ to i686 build failure --- firefox.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 5997c54..c13f247 100644 --- a/firefox.spec +++ b/firefox.spec @@ -3,6 +3,7 @@ %global release_build 1 # Excluded due to https://bugzilla.mozilla.org/show_bug.cgi?id=1792159 +# https://bugzilla.redhat.com/show_bug.cgi?id=2129720 ExcludeArch: i686 # Run Mozilla test suite as a part of compile rpm section. Turn off when @@ -1089,7 +1090,8 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %changelog * Thu Sep 22 2022 Martin Stransky - 105.0.1-1 - Updated to 105.0.1 -- Excluded i686 due to https://bugzilla.mozilla.org/show_bug.cgi?id=1792159 +- Excluded i686 due to https://bugzilla.mozilla.org/show_bug.cgi?id=1792159, + https://bugzilla.redhat.com/show_bug.cgi?id=2129720 * Tue Sep 20 2022 Martin Stransky - 105.0-1 - Updated to 105.0 From 7b980b9542a07ae6b20942875102991c615b377d Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 30 Sep 2022 10:28:39 +0200 Subject: [PATCH 120/545] Added fix for mozilla#1791856 / rhbz#2130087 --- firefox.spec | 7 ++++++- mozilla-1791856.patch | 30 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 mozilla-1791856.patch diff --git a/firefox.spec b/firefox.spec index c13f247..0540539 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 105.0.1 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -242,6 +242,7 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch +Patch416: mozilla-1791856.patch # PGO/LTO patches Patch600: pgo.patch @@ -499,6 +500,7 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 +%patch416 -p1 -b .1791856 # PGO patches %if %{build_with_pgo} @@ -1088,6 +1090,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Fri Sep 30 Martin Stransky - 105.0.1-2 +- Added fix for mozilla#1791856 / rhbz#2130087 + * Thu Sep 22 2022 Martin Stransky - 105.0.1-1 - Updated to 105.0.1 - Excluded i686 due to https://bugzilla.mozilla.org/show_bug.cgi?id=1792159, diff --git a/mozilla-1791856.patch b/mozilla-1791856.patch new file mode 100644 index 0000000..c7623be --- /dev/null +++ b/mozilla-1791856.patch @@ -0,0 +1,30 @@ +diff -up firefox-105.0.1/widget/gtk/nsWindow.cpp.old firefox-105.0.1/widget/gtk/nsWindow.cpp +--- firefox-105.0.1/widget/gtk/nsWindow.cpp.old 2022-09-30 10:23:00.424784507 +0200 ++++ firefox-105.0.1/widget/gtk/nsWindow.cpp 2022-09-30 10:24:36.345005046 +0200 +@@ -1949,26 +1949,6 @@ void nsWindow::NativeMoveResizeWaylandPo + bool needsPositionUpdate = newBounds.TopLeft() != mBounds.TopLeft(); + bool needsSizeUpdate = newBounds.Size() != mLastSizeRequest; + +- if (needsPositionUpdate) { +- // See Bug 1735095 +- // Font scale causes rounding errors which we can't handle by move-to-rect. +- // The font scale should not be used, but let's handle it somehow to +- // avoid endless move calls. +- if (StaticPrefs::layout_css_devPixelsPerPx() > 0 || +- gfxPlatformGtk::GetFontScaleFactor() != 1) { +- bool roundingError = (abs(newBounds.x - mBounds.x) < 2 && +- abs(newBounds.y - mBounds.y) < 2); +- if (roundingError) { +- // Keep the window where it is. +- GdkPoint topLeft = DevicePixelsToGdkPointRoundDown(mBounds.TopLeft()); +- LOG(" apply rounding error workaround, move to %d, %d", topLeft.x, +- topLeft.y); +- gtk_window_move(GTK_WINDOW(mShell), topLeft.x, topLeft.y); +- needsPositionUpdate = false; +- } +- } +- } +- + if (needsSizeUpdate) { + // Wayland compositor changed popup size request from layout. + // Set the constraints to use them in nsMenuPopupFrame::SetPopupPosition(). From 61ea27fc645523cb71333ce51b4357b67ff6f060 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 30 Sep 2022 10:33:30 +0200 Subject: [PATCH 121/545] Fixed changelog --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 0540539..23326e5 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1090,7 +1090,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog -* Fri Sep 30 Martin Stransky - 105.0.1-2 +* Fri Sep 30 2022 Martin Stransky - 105.0.1-2 - Added fix for mozilla#1791856 / rhbz#2130087 * Thu Sep 22 2022 Martin Stransky - 105.0.1-1 From 1f98173a5b2d203e3129fc369d5297bd72d45449 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 5 Oct 2022 10:20:26 +0200 Subject: [PATCH 122/545] Update to 105.0.2 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 477fd16..aafd4a1 100644 --- a/.gitignore +++ b/.gitignore @@ -534,3 +534,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-105.0.source.tar.xz /firefox-105.0.1.source.tar.xz /firefox-langpacks-105.0.1-20220922.tar.xz +/firefox-105.0.2.source.tar.xz +/firefox-langpacks-105.0.2-20221005.tar.xz diff --git a/firefox.spec b/firefox.spec index 23326e5..6693ba9 100644 --- a/firefox.spec +++ b/firefox.spec @@ -162,13 +162,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 105.0.1 -Release: 2%{?pre_tag}%{?dist} +Version: 105.0.2 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220922.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20221005.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1090,6 +1090,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Wed Oct 5 2022 Martin Stransky - 105.0.2-1 +- Updated to 105.0.2 + * Fri Sep 30 2022 Martin Stransky - 105.0.1-2 - Added fix for mozilla#1791856 / rhbz#2130087 diff --git a/sources b/sources index 5ec7b62..2b0e7a7 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 -SHA512 (firefox-105.0.1.source.tar.xz) = 66ef7cd5028953e7da9d55e127135739c9d85be68ec633b71c52d6c9427edb0bd8a38504148484cd322adcefb57bfefe6e57cb15855f195508fe438864f4322b -SHA512 (firefox-langpacks-105.0.1-20220922.tar.xz) = d731ee2be094bc061260d30e256a08fed2eaacf862437a28e6206549847557be9649aa364c6b515ba0023725d8d89378a1e2340b0426d011e0042d57425fabf2 +SHA512 (firefox-105.0.2.source.tar.xz) = 49f4c0e7ecf2cef6fa7de8362185bd9ce6950304dadbbea0522a5782016587b9d58f32b45f0e0edf7a2cc31ea158ed10c886b287a18d1f2bff3daf50d9f0b926 +SHA512 (firefox-langpacks-105.0.2-20221005.tar.xz) = 4145606fbe11d57d91b3bfa93c54150c8ce8cad852349cacd96370a94960a1e176ea98eb6f7f4c8520dc51132202f6e434e96ee586c13a26c787281707d3da17 From 949ba97268fdcbef42a1042d8aaf52aaa993ede5 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 14 Oct 2022 10:26:51 +0200 Subject: [PATCH 123/545] Fixed crashes on multi-monitor systems --- D158747.diff | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++ firefox.spec | 7 +++++- 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 D158747.diff diff --git a/D158747.diff b/D158747.diff new file mode 100644 index 0000000..ef1290a --- /dev/null +++ b/D158747.diff @@ -0,0 +1,65 @@ +diff --git a/widget/gtk/ScreenHelperGTK.cpp b/widget/gtk/ScreenHelperGTK.cpp +--- a/widget/gtk/ScreenHelperGTK.cpp ++++ b/widget/gtk/ScreenHelperGTK.cpp +@@ -221,11 +221,11 @@ + refreshRate, contentsScale, defaultCssScale, dpi, + Screen::IsPseudoDisplay::No); + } + + void ScreenGetterGtk::RefreshScreens() { +- LOG_SCREEN("Refreshing screens"); ++ LOG_SCREEN("ScreenGetterGtk::RefreshScreens()"); + AutoTArray, 4> screenList; + + GdkScreen* defaultScreen = gdk_screen_get_default(); + gint numScreens = gdk_screen_get_n_monitors(defaultScreen); + LOG_SCREEN("GDK reports %d screens", numScreens); +@@ -387,16 +387,16 @@ + monitor->refresh, contentsScale, defaultCssScale, + dpi, Screen::IsPseudoDisplay::No); + } + + void ScreenGetterWayland::RefreshScreens() { +- LOG_SCREEN("Refreshing screens"); ++ LOG_SCREEN("ScreenGetterWayland::RefreshScreens()"); + AutoTArray, 4> managerScreenList; + + mScreenList.Clear(); + const gint numScreens = mMonitors.Length(); +- LOG_SCREEN("Wayland reports %d screens", numScreens); ++ LOG_SCREEN("Wayland reports %d monitors", numScreens); + for (gint i = 0; i < numScreens; i++) { + RefPtr screen = MakeScreenWayland(i); + mScreenList.AppendElement(screen); + managerScreenList.AppendElement(screen); + } +@@ -446,18 +446,27 @@ + + return -1; + } + + RefPtr ScreenGetterWayland::GetScreenForWindow(nsWindow* aWindow) { +- if (mScreenList.IsEmpty()) { ++ if (mMonitors.IsEmpty()) { + return nullptr; + } + + int monitor = GetMonitorForWindow(aWindow); + if (monitor < 0) { + return nullptr; + } ++ ++ if (mMonitors.Length() != mScreenList.Length()) { ++ // Gtk list of GtkScreens are out of sync with our monitor list. ++ // Try to refresh it now. ++ RefreshScreens(); ++ } ++ ++ MOZ_DIAGNOSTIC_ASSERT((unsigned)monitor < mScreenList.Length(), ++ "We're missing screen?"); + return mScreenList[monitor]; + } + + static bool IsGNOMECompositor() { + const char* currentDesktop = getenv("XDG_CURRENT_DESKTOP"); + diff --git a/firefox.spec b/firefox.spec index 6693ba9..ebd59df 100644 --- a/firefox.spec +++ b/firefox.spec @@ -163,7 +163,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 105.0.2 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -243,6 +243,7 @@ Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch Patch416: mozilla-1791856.patch +Patch417: D158747.diff # PGO/LTO patches Patch600: pgo.patch @@ -501,6 +502,7 @@ This package contains results of tests executed during build. %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 %patch416 -p1 -b .1791856 +%patch417 -p1 -b .D158747 # PGO patches %if %{build_with_pgo} @@ -1090,6 +1092,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Fri Oct 14 2022 Martin Stransky - 105.0.2-2 +- Fixed crashes on multi-monitor systems (mzbz#1793922) + * Wed Oct 5 2022 Martin Stransky - 105.0.2-1 - Updated to 105.0.2 From c3c6c167a2108c3105d730cc2be4b31bb894c47e Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 14 Oct 2022 15:03:58 +0200 Subject: [PATCH 124/545] Update to 106.0 --- .gitignore | 2 + firefox.spec | 13 +-- mozilla-1667096.patch | 185 +++++++++++++++++++++++++++++++----------- mozilla-1791856.patch | 30 ------- sources | 4 +- 5 files changed, 148 insertions(+), 86 deletions(-) delete mode 100644 mozilla-1791856.patch diff --git a/.gitignore b/.gitignore index aafd4a1..559c5cd 100644 --- a/.gitignore +++ b/.gitignore @@ -536,3 +536,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-105.0.1-20220922.tar.xz /firefox-105.0.2.source.tar.xz /firefox-langpacks-105.0.2-20221005.tar.xz +/firefox-langpacks-106.0-20221014.tar.xz +/firefox-106.0.source.tar.xz diff --git a/firefox.spec b/firefox.spec index ebd59df..d9443eb 100644 --- a/firefox.spec +++ b/firefox.spec @@ -162,13 +162,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 105.0.2 -Release: 2%{?pre_tag}%{?dist} +Version: 106.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20221005.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20221014.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -242,7 +242,6 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch -Patch416: mozilla-1791856.patch Patch417: D158747.diff # PGO/LTO patches @@ -501,7 +500,6 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 -%patch416 -p1 -b .1791856 %patch417 -p1 -b .D158747 # PGO patches @@ -515,7 +513,7 @@ This package contains results of tests executed during build. %patch990 -p1 -b .work-around-GCC-ICE-on-arm %ifnarch ppc64le %{arm} -%patch1000 -p1 -b .libwebrtc-screen-cast-sync +#%patch1000 -p1 -b .libwebrtc-screen-cast-sync %endif %patch1100 -p1 -b .ppc-mobzuild @@ -1092,6 +1090,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Fri Oct 14 2022 Martin Stransky - 106.0-1 +- Updated to 106.0 + * Fri Oct 14 2022 Martin Stransky - 105.0.2-2 - Fixed crashes on multi-monitor systems (mzbz#1793922) diff --git a/mozilla-1667096.patch b/mozilla-1667096.patch index d2f2bf7..99222fc 100644 --- a/mozilla-1667096.patch +++ b/mozilla-1667096.patch @@ -1,7 +1,7 @@ -diff -up firefox-98.0/media/ffvpx/libavcodec/codec_list.c.1667096 firefox-98.0/media/ffvpx/libavcodec/codec_list.c ---- firefox-98.0/media/ffvpx/libavcodec/codec_list.c.1667096 2022-03-01 11:15:54.962398882 +0100 -+++ firefox-98.0/media/ffvpx/libavcodec/codec_list.c 2022-03-01 11:17:46.605000755 +0100 -@@ -11,6 +11,9 @@ static const AVCodec * const codec_list[ +diff -up firefox-106.0/media/ffvpx/libavcodec/codec_list.c.1667096 firefox-106.0/media/ffvpx/libavcodec/codec_list.c +--- firefox-106.0/media/ffvpx/libavcodec/codec_list.c.1667096 2022-10-10 18:05:25.000000000 +0200 ++++ firefox-106.0/media/ffvpx/libavcodec/codec_list.c 2022-10-14 10:43:44.943418216 +0200 +@@ -11,6 +11,9 @@ static const FFCodec * const codec_list[ #if CONFIG_MP3_DECODER &ff_mp3_decoder, #endif @@ -11,10 +11,10 @@ diff -up firefox-98.0/media/ffvpx/libavcodec/codec_list.c.1667096 firefox-98.0/m #if CONFIG_LIBDAV1D &ff_libdav1d_decoder, #endif -diff -up firefox-98.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-98.0/media/ffvpx/libavcodec/libfdk-aacdec.c ---- firefox-98.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 2022-03-01 11:15:54.963398914 +0100 -+++ firefox-98.0/media/ffvpx/libavcodec/libfdk-aacdec.c 2022-03-01 11:15:54.963398914 +0100 -@@ -0,0 +1,409 @@ +diff -up firefox-106.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-106.0/media/ffvpx/libavcodec/libfdk-aacdec.c +--- firefox-106.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 2022-10-14 10:43:44.943418216 +0200 ++++ firefox-106.0/media/ffvpx/libavcodec/libfdk-aacdec.c 2022-10-14 13:33:42.604975843 +0200 +@@ -0,0 +1,498 @@ +/* + * AAC decoder wrapper + * Copyright (c) 2012 Martin Storsjo @@ -40,6 +40,7 @@ diff -up firefox-98.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-98. +#include "libavutil/common.h" +#include "libavutil/opt.h" +#include "avcodec.h" ++#include "codec_internal.h" +#include "internal.h" + +#ifdef AACDECODER_LIB_VL0 @@ -73,7 +74,14 @@ diff -up firefox-98.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-98. + int drc_heavy; + int drc_effect; + int drc_cut; ++ int album_mode; + int level_limit; ++#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 ++ int output_delay_set; ++ int flush_samples; ++ int delay_samples; ++#endif ++ AVChannelLayout downmix_layout; +} FDKAACDecContext; + + @@ -92,17 +100,23 @@ diff -up firefox-98.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-98. + OFFSET(drc_boost), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 127, AD, NULL }, + { "drc_cut", "Dynamic Range Control: attenuation factor, where [0] is none and [127] is max compression", + OFFSET(drc_cut), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 127, AD, NULL }, -+ { "drc_level", "Dynamic Range Control: reference level, quantized to 0.25dB steps where [0] is 0dB and [127] is -31.75dB", -+ OFFSET(drc_level), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 127, AD, NULL }, ++ { "drc_level", "Dynamic Range Control: reference level, quantized to 0.25dB steps where [0] is 0dB and [127] is -31.75dB, -1 for auto, and -2 for disabled", ++ OFFSET(drc_level), AV_OPT_TYPE_INT, { .i64 = -1}, -2, 127, AD, NULL }, + { "drc_heavy", "Dynamic Range Control: heavy compression, where [1] is on (RF mode) and [0] is off", + OFFSET(drc_heavy), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 1, AD, NULL }, +#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 -+ { "level_limit", "Signal level limiting", OFFSET(level_limit), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, 1, AD }, ++ { "level_limit", "Signal level limiting", ++ OFFSET(level_limit), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, AD }, +#endif +#if FDKDEC_VER_AT_LEAST(3, 0) // 3.0.0 + { "drc_effect","Dynamic Range Control: effect type, where e.g. [0] is none and [6] is general", + OFFSET(drc_effect), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 8, AD, NULL }, +#endif ++#if FDKDEC_VER_AT_LEAST(3, 1) // 3.1.0 ++ { "album_mode","Dynamic Range Control: album mode, where [0] is off and [1] is on", ++ OFFSET(album_mode), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 1, AD, NULL }, ++#endif ++ { "downmix", "Request a specific channel layout from the decoder", OFFSET(downmix_layout), AV_OPT_TYPE_CHLAYOUT, {.str = NULL}, .flags = AD }, + { NULL } +}; + @@ -132,6 +146,14 @@ diff -up firefox-98.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-98. + } + avctx->sample_rate = info->sampleRate; + avctx->frame_size = info->frameSize; ++#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 ++ if (!s->output_delay_set && info->outputDelay) { ++ // Set this only once. ++ s->flush_samples = info->outputDelay; ++ s->delay_samples = info->outputDelay; ++ s->output_delay_set = 1; ++ } ++#endif + + for (i = 0; i < info->numChannels; i++) { + AUDIO_CHANNEL_TYPE ctype = info->pChannelType[i]; @@ -209,17 +231,15 @@ diff -up firefox-98.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-98. + ch_error = 1; + } + } -+ if (!ch_error && -+ av_get_channel_layout_nb_channels(ch_layout) != info->numChannels) { ++ ++ av_channel_layout_uninit(&avctx->ch_layout); ++ av_channel_layout_from_mask(&avctx->ch_layout, ch_layout); ++ if (!ch_error && avctx->ch_layout.nb_channels != info->numChannels) { + av_log(avctx, AV_LOG_WARNING, "unsupported channel configuration\n"); + ch_error = 1; + } + if (ch_error) -+ avctx->channel_layout = 0; -+ else -+ avctx->channel_layout = ch_layout; -+ -+ avctx->channels = info->numChannels; ++ avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; + + return 0; +} @@ -261,11 +281,19 @@ diff -up firefox-98.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-98. + return AVERROR_UNKNOWN; + } + -+ if (avctx->request_channel_layout > 0 && -+ avctx->request_channel_layout != AV_CH_LAYOUT_NATIVE) { ++#if FF_API_OLD_CHANNEL_LAYOUT ++FF_DISABLE_DEPRECATION_WARNINGS ++ if (avctx->request_channel_layout) { ++ av_channel_layout_uninit(&s->downmix_layout); ++ av_channel_layout_from_mask(&s->downmix_layout, avctx->request_channel_layout); ++ } ++FF_ENABLE_DEPRECATION_WARNINGS ++#endif ++ if (s->downmix_layout.nb_channels > 0 && ++ s->downmix_layout.order != AV_CHANNEL_ORDER_NATIVE) { + int downmix_channels = -1; + -+ switch (avctx->request_channel_layout) { ++ switch (s->downmix_layout.u.mask) { + case AV_CH_LAYOUT_STEREO: + case AV_CH_LAYOUT_STEREO_DOWNMIX: + downmix_channels = 2; @@ -274,7 +302,7 @@ diff -up firefox-98.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-98. + downmix_channels = 1; + break; + default: -+ av_log(avctx, AV_LOG_WARNING, "Invalid request_channel_layout\n"); ++ av_log(avctx, AV_LOG_WARNING, "Invalid downmix option\n"); + break; + } + @@ -311,6 +339,12 @@ diff -up firefox-98.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-98. + } + + if (s->drc_level != -1) { ++ // This option defaults to -1, i.e. not calling ++ // aacDecoder_SetParam(AAC_DRC_REFERENCE_LEVEL) at all, which defaults ++ // to the level from DRC metadata, if available. The user can set ++ // -drc_level -2, which calls aacDecoder_SetParam( ++ // AAC_DRC_REFERENCE_LEVEL) with a negative value, which then ++ // explicitly disables the feature. + if (aacDecoder_SetParam(s->handle, AAC_DRC_REFERENCE_LEVEL, s->drc_level) != AAC_DEC_OK) { + av_log(avctx, AV_LOG_ERROR, "Unable to set DRC reference level in the decoder\n"); + return AVERROR_UNKNOWN; @@ -325,6 +359,7 @@ diff -up firefox-98.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-98. + } + +#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 ++ // Setting this parameter to -1 enables the auto behaviour in the library. + if (aacDecoder_SetParam(s->handle, AAC_PCM_LIMITER_ENABLE, s->level_limit) != AAC_DEC_OK) { + av_log(avctx, AV_LOG_ERROR, "Unable to set in signal level limiting in the decoder\n"); + return AVERROR_UNKNOWN; @@ -340,6 +375,15 @@ diff -up firefox-98.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-98. + } +#endif + ++#if FDKDEC_VER_AT_LEAST(3, 1) // 3.1.0 ++ if (s->album_mode != -1) { ++ if (aacDecoder_SetParam(s->handle, AAC_UNIDRC_ALBUM_MODE, s->album_mode) != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to set album mode in the decoder\n"); ++ return AVERROR_UNKNOWN; ++ } ++ } ++#endif ++ + avctx->sample_fmt = AV_SAMPLE_FMT_S16; + + s->decoder_buffer_size = DECODER_BUFFSIZE * DECODER_MAX_CHANNELS; @@ -350,22 +394,38 @@ diff -up firefox-98.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-98. + return 0; +} + -+static int fdk_aac_decode_frame(AVCodecContext *avctx, void *data, ++static int fdk_aac_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame_ptr, AVPacket *avpkt) +{ + FDKAACDecContext *s = avctx->priv_data; -+ AVFrame *frame = data; + int ret; + AAC_DECODER_ERROR err; + UINT valid = avpkt->size; ++ UINT flags = 0; ++ int input_offset = 0; + -+ err = aacDecoder_Fill(s->handle, &avpkt->data, &avpkt->size, &valid); -+ if (err != AAC_DEC_OK) { -+ av_log(avctx, AV_LOG_ERROR, "aacDecoder_Fill() failed: %x\n", err); -+ return AVERROR_INVALIDDATA; ++ if (avpkt->size) { ++ err = aacDecoder_Fill(s->handle, &avpkt->data, &avpkt->size, &valid); ++ if (err != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "aacDecoder_Fill() failed: %x\n", err); ++ return AVERROR_INVALIDDATA; ++ } ++ } else { ++#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 ++ /* Handle decoder draining */ ++ if (s->flush_samples > 0) { ++ flags |= AACDEC_FLUSH; ++ } else { ++ return AVERROR_EOF; ++ } ++#else ++ return AVERROR_EOF; ++#endif + } + -+ err = aacDecoder_DecodeFrame(s->handle, (INT_PCM *) s->decoder_buffer, s->decoder_buffer_size / sizeof(INT_PCM), 0); ++ err = aacDecoder_DecodeFrame(s->handle, (INT_PCM *) s->decoder_buffer, ++ s->decoder_buffer_size / sizeof(INT_PCM), ++ flags); + if (err == AAC_DEC_NOT_ENOUGH_BITS) { + ret = avpkt->size - valid; + goto end; @@ -381,11 +441,36 @@ diff -up firefox-98.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-98. + goto end; + frame->nb_samples = avctx->frame_size; + ++#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 ++ if (flags & AACDEC_FLUSH) { ++ // Only return the right amount of samples at the end; if calling the ++ // decoder with AACDEC_FLUSH, it will keep returning frames indefinitely. ++ frame->nb_samples = FFMIN(s->flush_samples, frame->nb_samples); ++ av_log(s, AV_LOG_DEBUG, "Returning %d/%d delayed samples.\n", ++ frame->nb_samples, s->flush_samples); ++ s->flush_samples -= frame->nb_samples; ++ } else { ++ // Trim off samples from the start to compensate for extra decoder ++ // delay. We could also just adjust the pts, but this avoids ++ // including the extra samples in the output altogether. ++ if (s->delay_samples) { ++ int drop_samples = FFMIN(s->delay_samples, frame->nb_samples); ++ av_log(s, AV_LOG_DEBUG, "Dropping %d/%d delayed samples.\n", ++ drop_samples, s->delay_samples); ++ s->delay_samples -= drop_samples; ++ frame->nb_samples -= drop_samples; ++ input_offset = drop_samples * avctx->ch_layout.nb_channels; ++ if (frame->nb_samples <= 0) ++ return 0; ++ } ++ } ++#endif ++ + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + goto end; + -+ memcpy(frame->extended_data[0], s->decoder_buffer, -+ avctx->channels * avctx->frame_size * ++ memcpy(frame->extended_data[0], s->decoder_buffer + input_offset, ++ avctx->ch_layout.nb_channels * frame->nb_samples * + av_get_bytes_per_sample(avctx->sample_fmt)); + + *got_frame_ptr = 1; @@ -408,26 +493,30 @@ diff -up firefox-98.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-98. + av_log(avctx, AV_LOG_WARNING, "failed to clear buffer when flushing\n"); +} + -+AVCodec ff_libfdk_aac_decoder = { -+ .name = "libfdk_aac", -+ .long_name = NULL_IF_CONFIG_SMALL("Fraunhofer FDK AAC"), -+ .type = AVMEDIA_TYPE_AUDIO, -+ .id = AV_CODEC_ID_AAC, ++const FFCodec ff_libfdk_aac_decoder = { ++ .p.name = "libfdk_aac", ++ .p.long_name = NULL_IF_CONFIG_SMALL("Fraunhofer FDK AAC"), ++ .p.type = AVMEDIA_TYPE_AUDIO, ++ .p.id = AV_CODEC_ID_AAC, + .priv_data_size = sizeof(FDKAACDecContext), + .init = fdk_aac_decode_init, -+ .decode = fdk_aac_decode_frame, ++ FF_CODEC_DECODE_CB(fdk_aac_decode_frame), + .close = fdk_aac_decode_close, + .flush = fdk_aac_decode_flush, -+ .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, -+ .priv_class = &fdk_aac_dec_class, ++ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF ++#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 ++ | AV_CODEC_CAP_DELAY ++#endif ++ , ++ .p.priv_class = &fdk_aac_dec_class, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | + FF_CODEC_CAP_INIT_CLEANUP, -+ .wrapper_name = "libfdk", ++ .p.wrapper_name = "libfdk", +}; -diff -up firefox-98.0/media/ffvpx/libavcodec/moz.build.1667096 firefox-98.0/media/ffvpx/libavcodec/moz.build ---- firefox-98.0/media/ffvpx/libavcodec/moz.build.1667096 2022-03-01 11:15:54.963398914 +0100 -+++ firefox-98.0/media/ffvpx/libavcodec/moz.build 2022-03-01 11:18:00.646453768 +0100 -@@ -123,6 +123,12 @@ if CONFIG['MOZ_LIBAV_FFT']: +diff -up firefox-106.0/media/ffvpx/libavcodec/moz.build.1667096 firefox-106.0/media/ffvpx/libavcodec/moz.build +--- firefox-106.0/media/ffvpx/libavcodec/moz.build.1667096 2022-10-10 18:05:25.000000000 +0200 ++++ firefox-106.0/media/ffvpx/libavcodec/moz.build 2022-10-14 10:43:44.943418216 +0200 +@@ -129,6 +129,12 @@ if CONFIG['MOZ_LIBAV_FFT']: 'avfft.c', ] @@ -440,10 +529,10 @@ diff -up firefox-98.0/media/ffvpx/libavcodec/moz.build.1667096 firefox-98.0/medi SYMBOLS_FILE = 'avcodec.symbols' NoVisibilityFlags() -diff -up firefox-98.0/toolkit/moz.configure.1667096 firefox-98.0/toolkit/moz.configure ---- firefox-98.0/toolkit/moz.configure.1667096 2022-03-01 11:15:54.881396269 +0100 -+++ firefox-98.0/toolkit/moz.configure 2022-03-01 11:15:54.963398914 +0100 -@@ -1950,6 +1950,15 @@ with only_when(compile_environment): +diff -up firefox-106.0/toolkit/moz.configure.1667096 firefox-106.0/toolkit/moz.configure +--- firefox-106.0/toolkit/moz.configure.1667096 2022-10-14 10:43:44.912417169 +0200 ++++ firefox-106.0/toolkit/moz.configure 2022-10-14 10:43:44.944418250 +0200 +@@ -2148,6 +2148,15 @@ with only_when(compile_environment): set_config("MOZ_SYSTEM_PNG", True, when="--with-system-png") diff --git a/mozilla-1791856.patch b/mozilla-1791856.patch deleted file mode 100644 index c7623be..0000000 --- a/mozilla-1791856.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff -up firefox-105.0.1/widget/gtk/nsWindow.cpp.old firefox-105.0.1/widget/gtk/nsWindow.cpp ---- firefox-105.0.1/widget/gtk/nsWindow.cpp.old 2022-09-30 10:23:00.424784507 +0200 -+++ firefox-105.0.1/widget/gtk/nsWindow.cpp 2022-09-30 10:24:36.345005046 +0200 -@@ -1949,26 +1949,6 @@ void nsWindow::NativeMoveResizeWaylandPo - bool needsPositionUpdate = newBounds.TopLeft() != mBounds.TopLeft(); - bool needsSizeUpdate = newBounds.Size() != mLastSizeRequest; - -- if (needsPositionUpdate) { -- // See Bug 1735095 -- // Font scale causes rounding errors which we can't handle by move-to-rect. -- // The font scale should not be used, but let's handle it somehow to -- // avoid endless move calls. -- if (StaticPrefs::layout_css_devPixelsPerPx() > 0 || -- gfxPlatformGtk::GetFontScaleFactor() != 1) { -- bool roundingError = (abs(newBounds.x - mBounds.x) < 2 && -- abs(newBounds.y - mBounds.y) < 2); -- if (roundingError) { -- // Keep the window where it is. -- GdkPoint topLeft = DevicePixelsToGdkPointRoundDown(mBounds.TopLeft()); -- LOG(" apply rounding error workaround, move to %d, %d", topLeft.x, -- topLeft.y); -- gtk_window_move(GTK_WINDOW(mShell), topLeft.x, topLeft.y); -- needsPositionUpdate = false; -- } -- } -- } -- - if (needsSizeUpdate) { - // Wayland compositor changed popup size request from layout. - // Set the constraints to use them in nsMenuPopupFrame::SetPopupPosition(). diff --git a/sources b/sources index 2b0e7a7..3608af1 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 -SHA512 (firefox-105.0.2.source.tar.xz) = 49f4c0e7ecf2cef6fa7de8362185bd9ce6950304dadbbea0522a5782016587b9d58f32b45f0e0edf7a2cc31ea158ed10c886b287a18d1f2bff3daf50d9f0b926 -SHA512 (firefox-langpacks-105.0.2-20221005.tar.xz) = 4145606fbe11d57d91b3bfa93c54150c8ce8cad852349cacd96370a94960a1e176ea98eb6f7f4c8520dc51132202f6e434e96ee586c13a26c787281707d3da17 +SHA512 (firefox-langpacks-106.0-20221014.tar.xz) = 92f90a91107f48e27bb223c3d06941eca9a68bf7d2909d6192e6413191d291cec3d92654e0d64afea691ced7954c17444d79d7231a426a989d9969955ad5c8f3 +SHA512 (firefox-106.0.source.tar.xz) = 30ced2fff818858267eaab23974f6962c5d39433ce8e26507589535fc9348f00cf5e45b90997dfb6e2361b70900547fdb0e70d741127cc6705089ea585ea2296 From 904a6ec37fc332e0b65c42f1f813d3282d40913e Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 20 Oct 2022 11:33:35 +0200 Subject: [PATCH 125/545] Disabled PGO build due to rhbz#2136401 --- firefox.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index d9443eb..27e18d7 100644 --- a/firefox.spec +++ b/firefox.spec @@ -75,7 +75,8 @@ ExcludeArch: i686 %global build_with_pgo 0 %ifarch x86_64 %if %{release_build} -%global build_with_pgo 1 +#Disabled PGO build due to rhbz#2136401 +%global build_with_pgo 0 %endif %endif %if 0%{?flatpak} @@ -656,6 +657,7 @@ MOZ_OPT_FLAGS=$(echo "%{optflags}" | %{__sed} -e 's/-Wall//') # See also https://fedoraproject.org/wiki/Changes/Harden_All_Packages # Workaround for mozbz#1531309 MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-Werror=format-security//') +# More Fedora specific build flags MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fpermissive" %if %{?debug_build} MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-O2//') @@ -1092,6 +1094,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %changelog * Fri Oct 14 2022 Martin Stransky - 106.0-1 - Updated to 106.0 +- Disabled PGO build due to rhbz#2136401 * Fri Oct 14 2022 Martin Stransky - 105.0.2-2 - Fixed crashes on multi-monitor systems (mzbz#1793922) From 38d5cff9df9636515ffee1c66db7402ebce69f64 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 20 Oct 2022 11:53:27 +0200 Subject: [PATCH 126/545] Bug 2134527 Set widget.use-xdg-desktop-portal.file-picker=1 by default for Firefox / Fedora 37+ --- firefox.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/firefox.spec b/firefox.spec index 27e18d7..ff6f588 100644 --- a/firefox.spec +++ b/firefox.spec @@ -932,6 +932,11 @@ ln -s %{_datadir}/myspell %{buildroot}%{mozappdir}/dictionaries # Default %{__cp} %{SOURCE12} %{buildroot}%{mozappdir}/browser/defaults/preferences +# rhbz#2134527 - Use portal Gtk file dialog on Fedora 37+ +%if 0%{?fedora} > 36 +echo 'pref("widget.use-xdg-desktop-portal.file-picker", 1);' >> %{buildroot}%{mozappdir}/browser/defaults/preferences/firefox-redhat-default-prefs.js +%endif + # Since Fedora 36 the location of dictionaries has changed to /usr/share/hunspell. # For backward spec compatibility we set the old path in previous versions. # TODO remove when Fedora 35 becomes obsolete From f0029706cee042f03f836e10d51bb2245e9fa392 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Thu, 20 Oct 2022 14:41:02 +0200 Subject: [PATCH 127/545] Enable upstream WebRTC code for screensharing on Wayland --- firefox.spec | 9 +- libwebrtc-screen-cast-sync-1.patch | 9776 ---------------------------- libwebrtc-screen-cast-sync.patch | 4462 +------------ 3 files changed, 175 insertions(+), 14072 deletions(-) delete mode 100644 libwebrtc-screen-cast-sync-1.patch diff --git a/firefox.spec b/firefox.spec index ff6f588..abdcc98 100644 --- a/firefox.spec +++ b/firefox.spec @@ -164,7 +164,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 106.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -253,7 +253,7 @@ Patch602: mozilla-1516803.patch Patch990: work-around-GCC-ICE-on-arm.patch # Backported WebRTC changes for PipeWire/Wayland screen sharing support -Patch1000: libwebrtc-screen-cast-sync-1.patch +Patch1000: libwebrtc-screen-cast-sync.patch # Work around broken moz.build file on ppc64le (mozb#1779545, mozb#1775202) Patch1100: mozilla-1775202.patch @@ -514,7 +514,7 @@ This package contains results of tests executed during build. %patch990 -p1 -b .work-around-GCC-ICE-on-arm %ifnarch ppc64le %{arm} -#%patch1000 -p1 -b .libwebrtc-screen-cast-sync +%patch1000 -p1 -b .libwebrtc-screen-cast-sync %endif %patch1100 -p1 -b .ppc-mobzuild @@ -1097,6 +1097,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Thu Oct 20 2022 Jan Grulich - 106.0-2 +- Enable upstream WebRTC code for screensharing on Wayland + * Fri Oct 14 2022 Martin Stransky - 106.0-1 - Updated to 106.0 - Disabled PGO build due to rhbz#2136401 diff --git a/libwebrtc-screen-cast-sync-1.patch b/libwebrtc-screen-cast-sync-1.patch deleted file mode 100644 index 07025b1..0000000 --- a/libwebrtc-screen-cast-sync-1.patch +++ /dev/null @@ -1,9776 +0,0 @@ -diff -up firefox-103.0/dom/media/webrtc/moz.build.libwebrtc-screen-cast-sync firefox-103.0/dom/media/webrtc/moz.build ---- firefox-103.0/dom/media/webrtc/moz.build.libwebrtc-screen-cast-sync 2022-07-18 20:44:03.000000000 +0200 -+++ firefox-103.0/dom/media/webrtc/moz.build 2022-07-28 11:45:30.321408998 +0200 -@@ -85,6 +85,8 @@ if CONFIG["MOZ_WEBRTC_SIGNALING"]: - - if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": - DIRS += ["/third_party/pipewire/libpipewire"] -+ DIRS += ["/third_party/drm/libdrm"] -+ DIRS += ["/third_party/gbm/libgbm"] - - # Avoid warnings from third-party code that we can not modify. - if CONFIG["CC_TYPE"] == "clang-cl": -diff -up firefox-103.0/third_party/drm/drm/drm_fourcc.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/drm/drm/drm_fourcc.h ---- firefox-103.0/third_party/drm/drm/drm_fourcc.h.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.317409023 +0200 -+++ firefox-103.0/third_party/drm/drm/drm_fourcc.h 2022-07-28 11:45:30.317409023 +0200 -@@ -0,0 +1,1377 @@ -+/* -+ * Copyright 2011 Intel Corporation -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#ifndef DRM_FOURCC_H -+#define DRM_FOURCC_H -+ -+#include "drm.h" -+ -+#if defined(__cplusplus) -+extern "C" { -+#endif -+ -+/** -+ * DOC: overview -+ * -+ * In the DRM subsystem, framebuffer pixel formats are described using the -+ * fourcc codes defined in `include/uapi/drm/drm_fourcc.h`. In addition to the -+ * fourcc code, a Format Modifier may optionally be provided, in order to -+ * further describe the buffer's format - for example tiling or compression. -+ * -+ * Format Modifiers -+ * ---------------- -+ * -+ * Format modifiers are used in conjunction with a fourcc code, forming a -+ * unique fourcc:modifier pair. This format:modifier pair must fully define the -+ * format and data layout of the buffer, and should be the only way to describe -+ * that particular buffer. -+ * -+ * Having multiple fourcc:modifier pairs which describe the same layout should -+ * be avoided, as such aliases run the risk of different drivers exposing -+ * different names for the same data format, forcing userspace to understand -+ * that they are aliases. -+ * -+ * Format modifiers may change any property of the buffer, including the number -+ * of planes and/or the required allocation size. Format modifiers are -+ * vendor-namespaced, and as such the relationship between a fourcc code and a -+ * modifier is specific to the modifer being used. For example, some modifiers -+ * may preserve meaning - such as number of planes - from the fourcc code, -+ * whereas others may not. -+ * -+ * Modifiers must uniquely encode buffer layout. In other words, a buffer must -+ * match only a single modifier. A modifier must not be a subset of layouts of -+ * another modifier. For instance, it's incorrect to encode pitch alignment in -+ * a modifier: a buffer may match a 64-pixel aligned modifier and a 32-pixel -+ * aligned modifier. That said, modifiers can have implicit minimal -+ * requirements. -+ * -+ * For modifiers where the combination of fourcc code and modifier can alias, -+ * a canonical pair needs to be defined and used by all drivers. Preferred -+ * combinations are also encouraged where all combinations might lead to -+ * confusion and unnecessarily reduced interoperability. An example for the -+ * latter is AFBC, where the ABGR layouts are preferred over ARGB layouts. -+ * -+ * There are two kinds of modifier users: -+ * -+ * - Kernel and user-space drivers: for drivers it's important that modifiers -+ * don't alias, otherwise two drivers might support the same format but use -+ * different aliases, preventing them from sharing buffers in an efficient -+ * format. -+ * - Higher-level programs interfacing with KMS/GBM/EGL/Vulkan/etc: these users -+ * see modifiers as opaque tokens they can check for equality and intersect. -+ * These users musn't need to know to reason about the modifier value -+ * (i.e. they are not expected to extract information out of the modifier). -+ * -+ * Vendors should document their modifier usage in as much detail as -+ * possible, to ensure maximum compatibility across devices, drivers and -+ * applications. -+ * -+ * The authoritative list of format modifier codes is found in -+ * `include/uapi/drm/drm_fourcc.h` -+ */ -+ -+#define fourcc_code(a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \ -+ ((__u32)(c) << 16) | ((__u32)(d) << 24)) -+ -+#define DRM_FORMAT_BIG_ENDIAN (1U<<31) /* format is big endian instead of little endian */ -+ -+/* Reserve 0 for the invalid format specifier */ -+#define DRM_FORMAT_INVALID 0 -+ -+/* color index */ -+#define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ') /* [7:0] C */ -+ -+/* 8 bpp Red */ -+#define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ') /* [7:0] R */ -+ -+/* 10 bpp Red */ -+#define DRM_FORMAT_R10 fourcc_code('R', '1', '0', ' ') /* [15:0] x:R 6:10 little endian */ -+ -+/* 12 bpp Red */ -+#define DRM_FORMAT_R12 fourcc_code('R', '1', '2', ' ') /* [15:0] x:R 4:12 little endian */ -+ -+/* 16 bpp Red */ -+#define DRM_FORMAT_R16 fourcc_code('R', '1', '6', ' ') /* [15:0] R little endian */ -+ -+/* 16 bpp RG */ -+#define DRM_FORMAT_RG88 fourcc_code('R', 'G', '8', '8') /* [15:0] R:G 8:8 little endian */ -+#define DRM_FORMAT_GR88 fourcc_code('G', 'R', '8', '8') /* [15:0] G:R 8:8 little endian */ -+ -+/* 32 bpp RG */ -+#define DRM_FORMAT_RG1616 fourcc_code('R', 'G', '3', '2') /* [31:0] R:G 16:16 little endian */ -+#define DRM_FORMAT_GR1616 fourcc_code('G', 'R', '3', '2') /* [31:0] G:R 16:16 little endian */ -+ -+/* 8 bpp RGB */ -+#define DRM_FORMAT_RGB332 fourcc_code('R', 'G', 'B', '8') /* [7:0] R:G:B 3:3:2 */ -+#define DRM_FORMAT_BGR233 fourcc_code('B', 'G', 'R', '8') /* [7:0] B:G:R 2:3:3 */ -+ -+/* 16 bpp RGB */ -+#define DRM_FORMAT_XRGB4444 fourcc_code('X', 'R', '1', '2') /* [15:0] x:R:G:B 4:4:4:4 little endian */ -+#define DRM_FORMAT_XBGR4444 fourcc_code('X', 'B', '1', '2') /* [15:0] x:B:G:R 4:4:4:4 little endian */ -+#define DRM_FORMAT_RGBX4444 fourcc_code('R', 'X', '1', '2') /* [15:0] R:G:B:x 4:4:4:4 little endian */ -+#define DRM_FORMAT_BGRX4444 fourcc_code('B', 'X', '1', '2') /* [15:0] B:G:R:x 4:4:4:4 little endian */ -+ -+#define DRM_FORMAT_ARGB4444 fourcc_code('A', 'R', '1', '2') /* [15:0] A:R:G:B 4:4:4:4 little endian */ -+#define DRM_FORMAT_ABGR4444 fourcc_code('A', 'B', '1', '2') /* [15:0] A:B:G:R 4:4:4:4 little endian */ -+#define DRM_FORMAT_RGBA4444 fourcc_code('R', 'A', '1', '2') /* [15:0] R:G:B:A 4:4:4:4 little endian */ -+#define DRM_FORMAT_BGRA4444 fourcc_code('B', 'A', '1', '2') /* [15:0] B:G:R:A 4:4:4:4 little endian */ -+ -+#define DRM_FORMAT_XRGB1555 fourcc_code('X', 'R', '1', '5') /* [15:0] x:R:G:B 1:5:5:5 little endian */ -+#define DRM_FORMAT_XBGR1555 fourcc_code('X', 'B', '1', '5') /* [15:0] x:B:G:R 1:5:5:5 little endian */ -+#define DRM_FORMAT_RGBX5551 fourcc_code('R', 'X', '1', '5') /* [15:0] R:G:B:x 5:5:5:1 little endian */ -+#define DRM_FORMAT_BGRX5551 fourcc_code('B', 'X', '1', '5') /* [15:0] B:G:R:x 5:5:5:1 little endian */ -+ -+#define DRM_FORMAT_ARGB1555 fourcc_code('A', 'R', '1', '5') /* [15:0] A:R:G:B 1:5:5:5 little endian */ -+#define DRM_FORMAT_ABGR1555 fourcc_code('A', 'B', '1', '5') /* [15:0] A:B:G:R 1:5:5:5 little endian */ -+#define DRM_FORMAT_RGBA5551 fourcc_code('R', 'A', '1', '5') /* [15:0] R:G:B:A 5:5:5:1 little endian */ -+#define DRM_FORMAT_BGRA5551 fourcc_code('B', 'A', '1', '5') /* [15:0] B:G:R:A 5:5:5:1 little endian */ -+ -+#define DRM_FORMAT_RGB565 fourcc_code('R', 'G', '1', '6') /* [15:0] R:G:B 5:6:5 little endian */ -+#define DRM_FORMAT_BGR565 fourcc_code('B', 'G', '1', '6') /* [15:0] B:G:R 5:6:5 little endian */ -+ -+/* 24 bpp RGB */ -+#define DRM_FORMAT_RGB888 fourcc_code('R', 'G', '2', '4') /* [23:0] R:G:B little endian */ -+#define DRM_FORMAT_BGR888 fourcc_code('B', 'G', '2', '4') /* [23:0] B:G:R little endian */ -+ -+/* 32 bpp RGB */ -+#define DRM_FORMAT_XRGB8888 fourcc_code('X', 'R', '2', '4') /* [31:0] x:R:G:B 8:8:8:8 little endian */ -+#define DRM_FORMAT_XBGR8888 fourcc_code('X', 'B', '2', '4') /* [31:0] x:B:G:R 8:8:8:8 little endian */ -+#define DRM_FORMAT_RGBX8888 fourcc_code('R', 'X', '2', '4') /* [31:0] R:G:B:x 8:8:8:8 little endian */ -+#define DRM_FORMAT_BGRX8888 fourcc_code('B', 'X', '2', '4') /* [31:0] B:G:R:x 8:8:8:8 little endian */ -+ -+#define DRM_FORMAT_ARGB8888 fourcc_code('A', 'R', '2', '4') /* [31:0] A:R:G:B 8:8:8:8 little endian */ -+#define DRM_FORMAT_ABGR8888 fourcc_code('A', 'B', '2', '4') /* [31:0] A:B:G:R 8:8:8:8 little endian */ -+#define DRM_FORMAT_RGBA8888 fourcc_code('R', 'A', '2', '4') /* [31:0] R:G:B:A 8:8:8:8 little endian */ -+#define DRM_FORMAT_BGRA8888 fourcc_code('B', 'A', '2', '4') /* [31:0] B:G:R:A 8:8:8:8 little endian */ -+ -+#define DRM_FORMAT_XRGB2101010 fourcc_code('X', 'R', '3', '0') /* [31:0] x:R:G:B 2:10:10:10 little endian */ -+#define DRM_FORMAT_XBGR2101010 fourcc_code('X', 'B', '3', '0') /* [31:0] x:B:G:R 2:10:10:10 little endian */ -+#define DRM_FORMAT_RGBX1010102 fourcc_code('R', 'X', '3', '0') /* [31:0] R:G:B:x 10:10:10:2 little endian */ -+#define DRM_FORMAT_BGRX1010102 fourcc_code('B', 'X', '3', '0') /* [31:0] B:G:R:x 10:10:10:2 little endian */ -+ -+#define DRM_FORMAT_ARGB2101010 fourcc_code('A', 'R', '3', '0') /* [31:0] A:R:G:B 2:10:10:10 little endian */ -+#define DRM_FORMAT_ABGR2101010 fourcc_code('A', 'B', '3', '0') /* [31:0] A:B:G:R 2:10:10:10 little endian */ -+#define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */ -+#define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */ -+ -+/* 64 bpp RGB */ -+#define DRM_FORMAT_XRGB16161616 fourcc_code('X', 'R', '4', '8') /* [63:0] x:R:G:B 16:16:16:16 little endian */ -+#define DRM_FORMAT_XBGR16161616 fourcc_code('X', 'B', '4', '8') /* [63:0] x:B:G:R 16:16:16:16 little endian */ -+ -+#define DRM_FORMAT_ARGB16161616 fourcc_code('A', 'R', '4', '8') /* [63:0] A:R:G:B 16:16:16:16 little endian */ -+#define DRM_FORMAT_ABGR16161616 fourcc_code('A', 'B', '4', '8') /* [63:0] A:B:G:R 16:16:16:16 little endian */ -+ -+/* -+ * Floating point 64bpp RGB -+ * IEEE 754-2008 binary16 half-precision float -+ * [15:0] sign:exponent:mantissa 1:5:10 -+ */ -+#define DRM_FORMAT_XRGB16161616F fourcc_code('X', 'R', '4', 'H') /* [63:0] x:R:G:B 16:16:16:16 little endian */ -+#define DRM_FORMAT_XBGR16161616F fourcc_code('X', 'B', '4', 'H') /* [63:0] x:B:G:R 16:16:16:16 little endian */ -+ -+#define DRM_FORMAT_ARGB16161616F fourcc_code('A', 'R', '4', 'H') /* [63:0] A:R:G:B 16:16:16:16 little endian */ -+#define DRM_FORMAT_ABGR16161616F fourcc_code('A', 'B', '4', 'H') /* [63:0] A:B:G:R 16:16:16:16 little endian */ -+ -+/* -+ * RGBA format with 10-bit components packed in 64-bit per pixel, with 6 bits -+ * of unused padding per component: -+ */ -+#define DRM_FORMAT_AXBXGXRX106106106106 fourcc_code('A', 'B', '1', '0') /* [63:0] A:x:B:x:G:x:R:x 10:6:10:6:10:6:10:6 little endian */ -+ -+/* packed YCbCr */ -+#define DRM_FORMAT_YUYV fourcc_code('Y', 'U', 'Y', 'V') /* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */ -+#define DRM_FORMAT_YVYU fourcc_code('Y', 'V', 'Y', 'U') /* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */ -+#define DRM_FORMAT_UYVY fourcc_code('U', 'Y', 'V', 'Y') /* [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian */ -+#define DRM_FORMAT_VYUY fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */ -+ -+#define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */ -+#define DRM_FORMAT_XYUV8888 fourcc_code('X', 'Y', 'U', 'V') /* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */ -+#define DRM_FORMAT_VUY888 fourcc_code('V', 'U', '2', '4') /* [23:0] Cr:Cb:Y 8:8:8 little endian */ -+#define DRM_FORMAT_VUY101010 fourcc_code('V', 'U', '3', '0') /* Y followed by U then V, 10:10:10. Non-linear modifier only */ -+ -+/* -+ * packed Y2xx indicate for each component, xx valid data occupy msb -+ * 16-xx padding occupy lsb -+ */ -+#define DRM_FORMAT_Y210 fourcc_code('Y', '2', '1', '0') /* [63:0] Cr0:0:Y1:0:Cb0:0:Y0:0 10:6:10:6:10:6:10:6 little endian per 2 Y pixels */ -+#define DRM_FORMAT_Y212 fourcc_code('Y', '2', '1', '2') /* [63:0] Cr0:0:Y1:0:Cb0:0:Y0:0 12:4:12:4:12:4:12:4 little endian per 2 Y pixels */ -+#define DRM_FORMAT_Y216 fourcc_code('Y', '2', '1', '6') /* [63:0] Cr0:Y1:Cb0:Y0 16:16:16:16 little endian per 2 Y pixels */ -+ -+/* -+ * packed Y4xx indicate for each component, xx valid data occupy msb -+ * 16-xx padding occupy lsb except Y410 -+ */ -+#define DRM_FORMAT_Y410 fourcc_code('Y', '4', '1', '0') /* [31:0] A:Cr:Y:Cb 2:10:10:10 little endian */ -+#define DRM_FORMAT_Y412 fourcc_code('Y', '4', '1', '2') /* [63:0] A:0:Cr:0:Y:0:Cb:0 12:4:12:4:12:4:12:4 little endian */ -+#define DRM_FORMAT_Y416 fourcc_code('Y', '4', '1', '6') /* [63:0] A:Cr:Y:Cb 16:16:16:16 little endian */ -+ -+#define DRM_FORMAT_XVYU2101010 fourcc_code('X', 'V', '3', '0') /* [31:0] X:Cr:Y:Cb 2:10:10:10 little endian */ -+#define DRM_FORMAT_XVYU12_16161616 fourcc_code('X', 'V', '3', '6') /* [63:0] X:0:Cr:0:Y:0:Cb:0 12:4:12:4:12:4:12:4 little endian */ -+#define DRM_FORMAT_XVYU16161616 fourcc_code('X', 'V', '4', '8') /* [63:0] X:Cr:Y:Cb 16:16:16:16 little endian */ -+ -+/* -+ * packed YCbCr420 2x2 tiled formats -+ * first 64 bits will contain Y,Cb,Cr components for a 2x2 tile -+ */ -+/* [63:0] A3:A2:Y3:0:Cr0:0:Y2:0:A1:A0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian */ -+#define DRM_FORMAT_Y0L0 fourcc_code('Y', '0', 'L', '0') -+/* [63:0] X3:X2:Y3:0:Cr0:0:Y2:0:X1:X0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian */ -+#define DRM_FORMAT_X0L0 fourcc_code('X', '0', 'L', '0') -+ -+/* [63:0] A3:A2:Y3:Cr0:Y2:A1:A0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian */ -+#define DRM_FORMAT_Y0L2 fourcc_code('Y', '0', 'L', '2') -+/* [63:0] X3:X2:Y3:Cr0:Y2:X1:X0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian */ -+#define DRM_FORMAT_X0L2 fourcc_code('X', '0', 'L', '2') -+ -+/* -+ * 1-plane YUV 4:2:0 -+ * In these formats, the component ordering is specified (Y, followed by U -+ * then V), but the exact Linear layout is undefined. -+ * These formats can only be used with a non-Linear modifier. -+ */ -+#define DRM_FORMAT_YUV420_8BIT fourcc_code('Y', 'U', '0', '8') -+#define DRM_FORMAT_YUV420_10BIT fourcc_code('Y', 'U', '1', '0') -+ -+/* -+ * 2 plane RGB + A -+ * index 0 = RGB plane, same format as the corresponding non _A8 format has -+ * index 1 = A plane, [7:0] A -+ */ -+#define DRM_FORMAT_XRGB8888_A8 fourcc_code('X', 'R', 'A', '8') -+#define DRM_FORMAT_XBGR8888_A8 fourcc_code('X', 'B', 'A', '8') -+#define DRM_FORMAT_RGBX8888_A8 fourcc_code('R', 'X', 'A', '8') -+#define DRM_FORMAT_BGRX8888_A8 fourcc_code('B', 'X', 'A', '8') -+#define DRM_FORMAT_RGB888_A8 fourcc_code('R', '8', 'A', '8') -+#define DRM_FORMAT_BGR888_A8 fourcc_code('B', '8', 'A', '8') -+#define DRM_FORMAT_RGB565_A8 fourcc_code('R', '5', 'A', '8') -+#define DRM_FORMAT_BGR565_A8 fourcc_code('B', '5', 'A', '8') -+ -+/* -+ * 2 plane YCbCr -+ * index 0 = Y plane, [7:0] Y -+ * index 1 = Cr:Cb plane, [15:0] Cr:Cb little endian -+ * or -+ * index 1 = Cb:Cr plane, [15:0] Cb:Cr little endian -+ */ -+#define DRM_FORMAT_NV12 fourcc_code('N', 'V', '1', '2') /* 2x2 subsampled Cr:Cb plane */ -+#define DRM_FORMAT_NV21 fourcc_code('N', 'V', '2', '1') /* 2x2 subsampled Cb:Cr plane */ -+#define DRM_FORMAT_NV16 fourcc_code('N', 'V', '1', '6') /* 2x1 subsampled Cr:Cb plane */ -+#define DRM_FORMAT_NV61 fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */ -+#define DRM_FORMAT_NV24 fourcc_code('N', 'V', '2', '4') /* non-subsampled Cr:Cb plane */ -+#define DRM_FORMAT_NV42 fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */ -+/* -+ * 2 plane YCbCr -+ * index 0 = Y plane, [39:0] Y3:Y2:Y1:Y0 little endian -+ * index 1 = Cr:Cb plane, [39:0] Cr1:Cb1:Cr0:Cb0 little endian -+ */ -+#define DRM_FORMAT_NV15 fourcc_code('N', 'V', '1', '5') /* 2x2 subsampled Cr:Cb plane */ -+ -+/* -+ * 2 plane YCbCr MSB aligned -+ * index 0 = Y plane, [15:0] Y:x [10:6] little endian -+ * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [10:6:10:6] little endian -+ */ -+#define DRM_FORMAT_P210 fourcc_code('P', '2', '1', '0') /* 2x1 subsampled Cr:Cb plane, 10 bit per channel */ -+ -+/* -+ * 2 plane YCbCr MSB aligned -+ * index 0 = Y plane, [15:0] Y:x [10:6] little endian -+ * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [10:6:10:6] little endian -+ */ -+#define DRM_FORMAT_P010 fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cr:Cb plane 10 bits per channel */ -+ -+/* -+ * 2 plane YCbCr MSB aligned -+ * index 0 = Y plane, [15:0] Y:x [12:4] little endian -+ * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [12:4:12:4] little endian -+ */ -+#define DRM_FORMAT_P012 fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cr:Cb plane 12 bits per channel */ -+ -+/* -+ * 2 plane YCbCr MSB aligned -+ * index 0 = Y plane, [15:0] Y little endian -+ * index 1 = Cr:Cb plane, [31:0] Cr:Cb [16:16] little endian -+ */ -+#define DRM_FORMAT_P016 fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cr:Cb plane 16 bits per channel */ -+ -+/* 3 plane non-subsampled (444) YCbCr -+ * 16 bits per component, but only 10 bits are used and 6 bits are padded -+ * index 0: Y plane, [15:0] Y:x [10:6] little endian -+ * index 1: Cb plane, [15:0] Cb:x [10:6] little endian -+ * index 2: Cr plane, [15:0] Cr:x [10:6] little endian -+ */ -+#define DRM_FORMAT_Q410 fourcc_code('Q', '4', '1', '0') -+ -+/* 3 plane non-subsampled (444) YCrCb -+ * 16 bits per component, but only 10 bits are used and 6 bits are padded -+ * index 0: Y plane, [15:0] Y:x [10:6] little endian -+ * index 1: Cr plane, [15:0] Cr:x [10:6] little endian -+ * index 2: Cb plane, [15:0] Cb:x [10:6] little endian -+ */ -+#define DRM_FORMAT_Q401 fourcc_code('Q', '4', '0', '1') -+ -+/* -+ * 3 plane YCbCr -+ * index 0: Y plane, [7:0] Y -+ * index 1: Cb plane, [7:0] Cb -+ * index 2: Cr plane, [7:0] Cr -+ * or -+ * index 1: Cr plane, [7:0] Cr -+ * index 2: Cb plane, [7:0] Cb -+ */ -+#define DRM_FORMAT_YUV410 fourcc_code('Y', 'U', 'V', '9') /* 4x4 subsampled Cb (1) and Cr (2) planes */ -+#define DRM_FORMAT_YVU410 fourcc_code('Y', 'V', 'U', '9') /* 4x4 subsampled Cr (1) and Cb (2) planes */ -+#define DRM_FORMAT_YUV411 fourcc_code('Y', 'U', '1', '1') /* 4x1 subsampled Cb (1) and Cr (2) planes */ -+#define DRM_FORMAT_YVU411 fourcc_code('Y', 'V', '1', '1') /* 4x1 subsampled Cr (1) and Cb (2) planes */ -+#define DRM_FORMAT_YUV420 fourcc_code('Y', 'U', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes */ -+#define DRM_FORMAT_YVU420 fourcc_code('Y', 'V', '1', '2') /* 2x2 subsampled Cr (1) and Cb (2) planes */ -+#define DRM_FORMAT_YUV422 fourcc_code('Y', 'U', '1', '6') /* 2x1 subsampled Cb (1) and Cr (2) planes */ -+#define DRM_FORMAT_YVU422 fourcc_code('Y', 'V', '1', '6') /* 2x1 subsampled Cr (1) and Cb (2) planes */ -+#define DRM_FORMAT_YUV444 fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */ -+#define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */ -+ -+ -+/* -+ * Format Modifiers: -+ * -+ * Format modifiers describe, typically, a re-ordering or modification -+ * of the data in a plane of an FB. This can be used to express tiled/ -+ * swizzled formats, or compression, or a combination of the two. -+ * -+ * The upper 8 bits of the format modifier are a vendor-id as assigned -+ * below. The lower 56 bits are assigned as vendor sees fit. -+ */ -+ -+/* Vendor Ids: */ -+#define DRM_FORMAT_MOD_VENDOR_NONE 0 -+#define DRM_FORMAT_MOD_VENDOR_INTEL 0x01 -+#define DRM_FORMAT_MOD_VENDOR_AMD 0x02 -+#define DRM_FORMAT_MOD_VENDOR_NVIDIA 0x03 -+#define DRM_FORMAT_MOD_VENDOR_SAMSUNG 0x04 -+#define DRM_FORMAT_MOD_VENDOR_QCOM 0x05 -+#define DRM_FORMAT_MOD_VENDOR_VIVANTE 0x06 -+#define DRM_FORMAT_MOD_VENDOR_BROADCOM 0x07 -+#define DRM_FORMAT_MOD_VENDOR_ARM 0x08 -+#define DRM_FORMAT_MOD_VENDOR_ALLWINNER 0x09 -+#define DRM_FORMAT_MOD_VENDOR_AMLOGIC 0x0a -+ -+/* add more to the end as needed */ -+ -+#define DRM_FORMAT_RESERVED ((1ULL << 56) - 1) -+ -+#define fourcc_mod_get_vendor(modifier) \ -+ (((modifier) >> 56) & 0xff) -+ -+#define fourcc_mod_is_vendor(modifier, vendor) \ -+ (fourcc_mod_get_vendor(modifier) == DRM_FORMAT_MOD_VENDOR_## vendor) -+ -+#define fourcc_mod_code(vendor, val) \ -+ ((((__u64)DRM_FORMAT_MOD_VENDOR_## vendor) << 56) | ((val) & 0x00ffffffffffffffULL)) -+ -+/* -+ * Format Modifier tokens: -+ * -+ * When adding a new token please document the layout with a code comment, -+ * similar to the fourcc codes above. drm_fourcc.h is considered the -+ * authoritative source for all of these. -+ * -+ * Generic modifier names: -+ * -+ * DRM_FORMAT_MOD_GENERIC_* definitions are used to provide vendor-neutral names -+ * for layouts which are common across multiple vendors. To preserve -+ * compatibility, in cases where a vendor-specific definition already exists and -+ * a generic name for it is desired, the common name is a purely symbolic alias -+ * and must use the same numerical value as the original definition. -+ * -+ * Note that generic names should only be used for modifiers which describe -+ * generic layouts (such as pixel re-ordering), which may have -+ * independently-developed support across multiple vendors. -+ * -+ * In future cases where a generic layout is identified before merging with a -+ * vendor-specific modifier, a new 'GENERIC' vendor or modifier using vendor -+ * 'NONE' could be considered. This should only be for obvious, exceptional -+ * cases to avoid polluting the 'GENERIC' namespace with modifiers which only -+ * apply to a single vendor. -+ * -+ * Generic names should not be used for cases where multiple hardware vendors -+ * have implementations of the same standardised compression scheme (such as -+ * AFBC). In those cases, all implementations should use the same format -+ * modifier(s), reflecting the vendor of the standard. -+ */ -+ -+#define DRM_FORMAT_MOD_GENERIC_16_16_TILE DRM_FORMAT_MOD_SAMSUNG_16_16_TILE -+ -+/* -+ * Invalid Modifier -+ * -+ * This modifier can be used as a sentinel to terminate the format modifiers -+ * list, or to initialize a variable with an invalid modifier. It might also be -+ * used to report an error back to userspace for certain APIs. -+ */ -+#define DRM_FORMAT_MOD_INVALID fourcc_mod_code(NONE, DRM_FORMAT_RESERVED) -+ -+/* -+ * Linear Layout -+ * -+ * Just plain linear layout. Note that this is different from no specifying any -+ * modifier (e.g. not setting DRM_MODE_FB_MODIFIERS in the DRM_ADDFB2 ioctl), -+ * which tells the driver to also take driver-internal information into account -+ * and so might actually result in a tiled framebuffer. -+ */ -+#define DRM_FORMAT_MOD_LINEAR fourcc_mod_code(NONE, 0) -+ -+/* -+ * Deprecated: use DRM_FORMAT_MOD_LINEAR instead -+ * -+ * The "none" format modifier doesn't actually mean that the modifier is -+ * implicit, instead it means that the layout is linear. Whether modifiers are -+ * used is out-of-band information carried in an API-specific way (e.g. in a -+ * flag for drm_mode_fb_cmd2). -+ */ -+#define DRM_FORMAT_MOD_NONE 0 -+ -+/* Intel framebuffer modifiers */ -+ -+/* -+ * Intel X-tiling layout -+ * -+ * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb) -+ * in row-major layout. Within the tile bytes are laid out row-major, with -+ * a platform-dependent stride. On top of that the memory can apply -+ * platform-depending swizzling of some higher address bits into bit6. -+ * -+ * Note that this layout is only accurate on intel gen 8+ or valleyview chipsets. -+ * On earlier platforms the is highly platforms specific and not useful for -+ * cross-driver sharing. It exists since on a given platform it does uniquely -+ * identify the layout in a simple way for i915-specific userspace, which -+ * facilitated conversion of userspace to modifiers. Additionally the exact -+ * format on some really old platforms is not known. -+ */ -+#define I915_FORMAT_MOD_X_TILED fourcc_mod_code(INTEL, 1) -+ -+/* -+ * Intel Y-tiling layout -+ * -+ * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb) -+ * in row-major layout. Within the tile bytes are laid out in OWORD (16 bytes) -+ * chunks column-major, with a platform-dependent height. On top of that the -+ * memory can apply platform-depending swizzling of some higher address bits -+ * into bit6. -+ * -+ * Note that this layout is only accurate on intel gen 8+ or valleyview chipsets. -+ * On earlier platforms the is highly platforms specific and not useful for -+ * cross-driver sharing. It exists since on a given platform it does uniquely -+ * identify the layout in a simple way for i915-specific userspace, which -+ * facilitated conversion of userspace to modifiers. Additionally the exact -+ * format on some really old platforms is not known. -+ */ -+#define I915_FORMAT_MOD_Y_TILED fourcc_mod_code(INTEL, 2) -+ -+/* -+ * Intel Yf-tiling layout -+ * -+ * This is a tiled layout using 4Kb tiles in row-major layout. -+ * Within the tile pixels are laid out in 16 256 byte units / sub-tiles which -+ * are arranged in four groups (two wide, two high) with column-major layout. -+ * Each group therefore consits out of four 256 byte units, which are also laid -+ * out as 2x2 column-major. -+ * 256 byte units are made out of four 64 byte blocks of pixels, producing -+ * either a square block or a 2:1 unit. -+ * 64 byte blocks of pixels contain four pixel rows of 16 bytes, where the width -+ * in pixel depends on the pixel depth. -+ */ -+#define I915_FORMAT_MOD_Yf_TILED fourcc_mod_code(INTEL, 3) -+ -+/* -+ * Intel color control surface (CCS) for render compression -+ * -+ * The framebuffer format must be one of the 8:8:8:8 RGB formats. -+ * The main surface will be plane index 0 and must be Y/Yf-tiled, -+ * the CCS will be plane index 1. -+ * -+ * Each CCS tile matches a 1024x512 pixel area of the main surface. -+ * To match certain aspects of the 3D hardware the CCS is -+ * considered to be made up of normal 128Bx32 Y tiles, Thus -+ * the CCS pitch must be specified in multiples of 128 bytes. -+ * -+ * In reality the CCS tile appears to be a 64Bx64 Y tile, composed -+ * of QWORD (8 bytes) chunks instead of OWORD (16 bytes) chunks. -+ * But that fact is not relevant unless the memory is accessed -+ * directly. -+ */ -+#define I915_FORMAT_MOD_Y_TILED_CCS fourcc_mod_code(INTEL, 4) -+#define I915_FORMAT_MOD_Yf_TILED_CCS fourcc_mod_code(INTEL, 5) -+ -+/* -+ * Intel color control surfaces (CCS) for Gen-12 render compression. -+ * -+ * The main surface is Y-tiled and at plane index 0, the CCS is linear and -+ * at index 1. A 64B CCS cache line corresponds to an area of 4x1 tiles in -+ * main surface. In other words, 4 bits in CCS map to a main surface cache -+ * line pair. The main surface pitch is required to be a multiple of four -+ * Y-tile widths. -+ */ -+#define I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS fourcc_mod_code(INTEL, 6) -+ -+/* -+ * Intel color control surfaces (CCS) for Gen-12 media compression -+ * -+ * The main surface is Y-tiled and at plane index 0, the CCS is linear and -+ * at index 1. A 64B CCS cache line corresponds to an area of 4x1 tiles in -+ * main surface. In other words, 4 bits in CCS map to a main surface cache -+ * line pair. The main surface pitch is required to be a multiple of four -+ * Y-tile widths. For semi-planar formats like NV12, CCS planes follow the -+ * Y and UV planes i.e., planes 0 and 1 are used for Y and UV surfaces, -+ * planes 2 and 3 for the respective CCS. -+ */ -+#define I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS fourcc_mod_code(INTEL, 7) -+ -+/* -+ * Intel Color Control Surface with Clear Color (CCS) for Gen-12 render -+ * compression. -+ * -+ * The main surface is Y-tiled and is at plane index 0 whereas CCS is linear -+ * and at index 1. The clear color is stored at index 2, and the pitch should -+ * be ignored. The clear color structure is 256 bits. The first 128 bits -+ * represents Raw Clear Color Red, Green, Blue and Alpha color each represented -+ * by 32 bits. The raw clear color is consumed by the 3d engine and generates -+ * the converted clear color of size 64 bits. The first 32 bits store the Lower -+ * Converted Clear Color value and the next 32 bits store the Higher Converted -+ * Clear Color value when applicable. The Converted Clear Color values are -+ * consumed by the DE. The last 64 bits are used to store Color Discard Enable -+ * and Depth Clear Value Valid which are ignored by the DE. A CCS cache line -+ * corresponds to an area of 4x1 tiles in the main surface. The main surface -+ * pitch is required to be a multiple of 4 tile widths. -+ */ -+#define I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC fourcc_mod_code(INTEL, 8) -+ -+/* -+ * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks -+ * -+ * Macroblocks are laid in a Z-shape, and each pixel data is following the -+ * standard NV12 style. -+ * As for NV12, an image is the result of two frame buffers: one for Y, -+ * one for the interleaved Cb/Cr components (1/2 the height of the Y buffer). -+ * Alignment requirements are (for each buffer): -+ * - multiple of 128 pixels for the width -+ * - multiple of 32 pixels for the height -+ * -+ * For more information: see https://linuxtv.org/downloads/v4l-dvb-apis/re32.html -+ */ -+#define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1) -+ -+/* -+ * Tiled, 16 (pixels) x 16 (lines) - sized macroblocks -+ * -+ * This is a simple tiled layout using tiles of 16x16 pixels in a row-major -+ * layout. For YCbCr formats Cb/Cr components are taken in such a way that -+ * they correspond to their 16x16 luma block. -+ */ -+#define DRM_FORMAT_MOD_SAMSUNG_16_16_TILE fourcc_mod_code(SAMSUNG, 2) -+ -+/* -+ * Qualcomm Compressed Format -+ * -+ * Refers to a compressed variant of the base format that is compressed. -+ * Implementation may be platform and base-format specific. -+ * -+ * Each macrotile consists of m x n (mostly 4 x 4) tiles. -+ * Pixel data pitch/stride is aligned with macrotile width. -+ * Pixel data height is aligned with macrotile height. -+ * Entire pixel data buffer is aligned with 4k(bytes). -+ */ -+#define DRM_FORMAT_MOD_QCOM_COMPRESSED fourcc_mod_code(QCOM, 1) -+ -+/* Vivante framebuffer modifiers */ -+ -+/* -+ * Vivante 4x4 tiling layout -+ * -+ * This is a simple tiled layout using tiles of 4x4 pixels in a row-major -+ * layout. -+ */ -+#define DRM_FORMAT_MOD_VIVANTE_TILED fourcc_mod_code(VIVANTE, 1) -+ -+/* -+ * Vivante 64x64 super-tiling layout -+ * -+ * This is a tiled layout using 64x64 pixel super-tiles, where each super-tile -+ * contains 8x4 groups of 2x4 tiles of 4x4 pixels (like above) each, all in row- -+ * major layout. -+ * -+ * For more information: see -+ * https://github.com/etnaviv/etna_viv/blob/master/doc/hardware.md#texture-tiling -+ */ -+#define DRM_FORMAT_MOD_VIVANTE_SUPER_TILED fourcc_mod_code(VIVANTE, 2) -+ -+/* -+ * Vivante 4x4 tiling layout for dual-pipe -+ * -+ * Same as the 4x4 tiling layout, except every second 4x4 pixel tile starts at a -+ * different base address. Offsets from the base addresses are therefore halved -+ * compared to the non-split tiled layout. -+ */ -+#define DRM_FORMAT_MOD_VIVANTE_SPLIT_TILED fourcc_mod_code(VIVANTE, 3) -+ -+/* -+ * Vivante 64x64 super-tiling layout for dual-pipe -+ * -+ * Same as the 64x64 super-tiling layout, except every second 4x4 pixel tile -+ * starts at a different base address. Offsets from the base addresses are -+ * therefore halved compared to the non-split super-tiled layout. -+ */ -+#define DRM_FORMAT_MOD_VIVANTE_SPLIT_SUPER_TILED fourcc_mod_code(VIVANTE, 4) -+ -+/* NVIDIA frame buffer modifiers */ -+ -+/* -+ * Tegra Tiled Layout, used by Tegra 2, 3 and 4. -+ * -+ * Pixels are arranged in simple tiles of 16 x 16 bytes. -+ */ -+#define DRM_FORMAT_MOD_NVIDIA_TEGRA_TILED fourcc_mod_code(NVIDIA, 1) -+ -+/* -+ * Generalized Block Linear layout, used by desktop GPUs starting with NV50/G80, -+ * and Tegra GPUs starting with Tegra K1. -+ * -+ * Pixels are arranged in Groups of Bytes (GOBs). GOB size and layout varies -+ * based on the architecture generation. GOBs themselves are then arranged in -+ * 3D blocks, with the block dimensions (in terms of GOBs) always being a power -+ * of two, and hence expressible as their log2 equivalent (E.g., "2" represents -+ * a block depth or height of "4"). -+ * -+ * Chapter 20 "Pixel Memory Formats" of the Tegra X1 TRM describes this format -+ * in full detail. -+ * -+ * Macro -+ * Bits Param Description -+ * ---- ----- ----------------------------------------------------------------- -+ * -+ * 3:0 h log2(height) of each block, in GOBs. Placed here for -+ * compatibility with the existing -+ * DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK()-based modifiers. -+ * -+ * 4:4 - Must be 1, to indicate block-linear layout. Necessary for -+ * compatibility with the existing -+ * DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK()-based modifiers. -+ * -+ * 8:5 - Reserved (To support 3D-surfaces with variable log2(depth) block -+ * size). Must be zero. -+ * -+ * Note there is no log2(width) parameter. Some portions of the -+ * hardware support a block width of two gobs, but it is impractical -+ * to use due to lack of support elsewhere, and has no known -+ * benefits. -+ * -+ * 11:9 - Reserved (To support 2D-array textures with variable array stride -+ * in blocks, specified via log2(tile width in blocks)). Must be -+ * zero. -+ * -+ * 19:12 k Page Kind. This value directly maps to a field in the page -+ * tables of all GPUs >= NV50. It affects the exact layout of bits -+ * in memory and can be derived from the tuple -+ * -+ * (format, GPU model, compression type, samples per pixel) -+ * -+ * Where compression type is defined below. If GPU model were -+ * implied by the format modifier, format, or memory buffer, page -+ * kind would not need to be included in the modifier itself, but -+ * since the modifier should define the layout of the associated -+ * memory buffer independent from any device or other context, it -+ * must be included here. -+ * -+ * 21:20 g GOB Height and Page Kind Generation. The height of a GOB changed -+ * starting with Fermi GPUs. Additionally, the mapping between page -+ * kind and bit layout has changed at various points. -+ * -+ * 0 = Gob Height 8, Fermi - Volta, Tegra K1+ Page Kind mapping -+ * 1 = Gob Height 4, G80 - GT2XX Page Kind mapping -+ * 2 = Gob Height 8, Turing+ Page Kind mapping -+ * 3 = Reserved for future use. -+ * -+ * 22:22 s Sector layout. On Tegra GPUs prior to Xavier, there is a further -+ * bit remapping step that occurs at an even lower level than the -+ * page kind and block linear swizzles. This causes the layout of -+ * surfaces mapped in those SOC's GPUs to be incompatible with the -+ * equivalent mapping on other GPUs in the same system. -+ * -+ * 0 = Tegra K1 - Tegra Parker/TX2 Layout. -+ * 1 = Desktop GPU and Tegra Xavier+ Layout -+ * -+ * 25:23 c Lossless Framebuffer Compression type. -+ * -+ * 0 = none -+ * 1 = ROP/3D, layout 1, exact compression format implied by Page -+ * Kind field -+ * 2 = ROP/3D, layout 2, exact compression format implied by Page -+ * Kind field -+ * 3 = CDE horizontal -+ * 4 = CDE vertical -+ * 5 = Reserved for future use -+ * 6 = Reserved for future use -+ * 7 = Reserved for future use -+ * -+ * 55:25 - Reserved for future use. Must be zero. -+ */ -+#define DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(c, s, g, k, h) \ -+ fourcc_mod_code(NVIDIA, (0x10 | \ -+ ((h) & 0xf) | \ -+ (((k) & 0xff) << 12) | \ -+ (((g) & 0x3) << 20) | \ -+ (((s) & 0x1) << 22) | \ -+ (((c) & 0x7) << 23))) -+ -+/* To grandfather in prior block linear format modifiers to the above layout, -+ * the page kind "0", which corresponds to "pitch/linear" and hence is unusable -+ * with block-linear layouts, is remapped within drivers to the value 0xfe, -+ * which corresponds to the "generic" kind used for simple single-sample -+ * uncompressed color formats on Fermi - Volta GPUs. -+ */ -+static __inline__ __u64 -+drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier) -+{ -+ if (!(modifier & 0x10) || (modifier & (0xff << 12))) -+ return modifier; -+ else -+ return modifier | (0xfe << 12); -+} -+ -+/* -+ * 16Bx2 Block Linear layout, used by Tegra K1 and later -+ * -+ * Pixels are arranged in 64x8 Groups Of Bytes (GOBs). GOBs are then stacked -+ * vertically by a power of 2 (1 to 32 GOBs) to form a block. -+ * -+ * Within a GOB, data is ordered as 16B x 2 lines sectors laid in Z-shape. -+ * -+ * Parameter 'v' is the log2 encoding of the number of GOBs stacked vertically. -+ * Valid values are: -+ * -+ * 0 == ONE_GOB -+ * 1 == TWO_GOBS -+ * 2 == FOUR_GOBS -+ * 3 == EIGHT_GOBS -+ * 4 == SIXTEEN_GOBS -+ * 5 == THIRTYTWO_GOBS -+ * -+ * Chapter 20 "Pixel Memory Formats" of the Tegra X1 TRM describes this format -+ * in full detail. -+ */ -+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(v) \ -+ DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 0, 0, 0, (v)) -+ -+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_ONE_GOB \ -+ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(0) -+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_TWO_GOB \ -+ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(1) -+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_FOUR_GOB \ -+ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(2) -+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_EIGHT_GOB \ -+ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(3) -+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_SIXTEEN_GOB \ -+ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(4) -+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_THIRTYTWO_GOB \ -+ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(5) -+ -+/* -+ * Some Broadcom modifiers take parameters, for example the number of -+ * vertical lines in the image. Reserve the lower 32 bits for modifier -+ * type, and the next 24 bits for parameters. Top 8 bits are the -+ * vendor code. -+ */ -+#define __fourcc_mod_broadcom_param_shift 8 -+#define __fourcc_mod_broadcom_param_bits 48 -+#define fourcc_mod_broadcom_code(val, params) \ -+ fourcc_mod_code(BROADCOM, ((((__u64)params) << __fourcc_mod_broadcom_param_shift) | val)) -+#define fourcc_mod_broadcom_param(m) \ -+ ((int)(((m) >> __fourcc_mod_broadcom_param_shift) & \ -+ ((1ULL << __fourcc_mod_broadcom_param_bits) - 1))) -+#define fourcc_mod_broadcom_mod(m) \ -+ ((m) & ~(((1ULL << __fourcc_mod_broadcom_param_bits) - 1) << \ -+ __fourcc_mod_broadcom_param_shift)) -+ -+/* -+ * Broadcom VC4 "T" format -+ * -+ * This is the primary layout that the V3D GPU can texture from (it -+ * can't do linear). The T format has: -+ * -+ * - 64b utiles of pixels in a raster-order grid according to cpp. It's 4x4 -+ * pixels at 32 bit depth. -+ * -+ * - 1k subtiles made of a 4x4 raster-order grid of 64b utiles (so usually -+ * 16x16 pixels). -+ * -+ * - 4k tiles made of a 2x2 grid of 1k subtiles (so usually 32x32 pixels). On -+ * even 4k tile rows, they're arranged as (BL, TL, TR, BR), and on odd rows -+ * they're (TR, BR, BL, TL), where bottom left is start of memory. -+ * -+ * - an image made of 4k tiles in rows either left-to-right (even rows of 4k -+ * tiles) or right-to-left (odd rows of 4k tiles). -+ */ -+#define DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED fourcc_mod_code(BROADCOM, 1) -+ -+/* -+ * Broadcom SAND format -+ * -+ * This is the native format that the H.264 codec block uses. For VC4 -+ * HVS, it is only valid for H.264 (NV12/21) and RGBA modes. -+ * -+ * The image can be considered to be split into columns, and the -+ * columns are placed consecutively into memory. The width of those -+ * columns can be either 32, 64, 128, or 256 pixels, but in practice -+ * only 128 pixel columns are used. -+ * -+ * The pitch between the start of each column is set to optimally -+ * switch between SDRAM banks. This is passed as the number of lines -+ * of column width in the modifier (we can't use the stride value due -+ * to various core checks that look at it , so you should set the -+ * stride to width*cpp). -+ * -+ * Note that the column height for this format modifier is the same -+ * for all of the planes, assuming that each column contains both Y -+ * and UV. Some SAND-using hardware stores UV in a separate tiled -+ * image from Y to reduce the column height, which is not supported -+ * with these modifiers. -+ */ -+ -+#define DRM_FORMAT_MOD_BROADCOM_SAND32_COL_HEIGHT(v) \ -+ fourcc_mod_broadcom_code(2, v) -+#define DRM_FORMAT_MOD_BROADCOM_SAND64_COL_HEIGHT(v) \ -+ fourcc_mod_broadcom_code(3, v) -+#define DRM_FORMAT_MOD_BROADCOM_SAND128_COL_HEIGHT(v) \ -+ fourcc_mod_broadcom_code(4, v) -+#define DRM_FORMAT_MOD_BROADCOM_SAND256_COL_HEIGHT(v) \ -+ fourcc_mod_broadcom_code(5, v) -+ -+#define DRM_FORMAT_MOD_BROADCOM_SAND32 \ -+ DRM_FORMAT_MOD_BROADCOM_SAND32_COL_HEIGHT(0) -+#define DRM_FORMAT_MOD_BROADCOM_SAND64 \ -+ DRM_FORMAT_MOD_BROADCOM_SAND64_COL_HEIGHT(0) -+#define DRM_FORMAT_MOD_BROADCOM_SAND128 \ -+ DRM_FORMAT_MOD_BROADCOM_SAND128_COL_HEIGHT(0) -+#define DRM_FORMAT_MOD_BROADCOM_SAND256 \ -+ DRM_FORMAT_MOD_BROADCOM_SAND256_COL_HEIGHT(0) -+ -+/* Broadcom UIF format -+ * -+ * This is the common format for the current Broadcom multimedia -+ * blocks, including V3D 3.x and newer, newer video codecs, and -+ * displays. -+ * -+ * The image consists of utiles (64b blocks), UIF blocks (2x2 utiles), -+ * and macroblocks (4x4 UIF blocks). Those 4x4 UIF block groups are -+ * stored in columns, with padding between the columns to ensure that -+ * moving from one column to the next doesn't hit the same SDRAM page -+ * bank. -+ * -+ * To calculate the padding, it is assumed that each hardware block -+ * and the software driving it knows the platform's SDRAM page size, -+ * number of banks, and XOR address, and that it's identical between -+ * all blocks using the format. This tiling modifier will use XOR as -+ * necessary to reduce the padding. If a hardware block can't do XOR, -+ * the assumption is that a no-XOR tiling modifier will be created. -+ */ -+#define DRM_FORMAT_MOD_BROADCOM_UIF fourcc_mod_code(BROADCOM, 6) -+ -+/* -+ * Arm Framebuffer Compression (AFBC) modifiers -+ * -+ * AFBC is a proprietary lossless image compression protocol and format. -+ * It provides fine-grained random access and minimizes the amount of data -+ * transferred between IP blocks. -+ * -+ * AFBC has several features which may be supported and/or used, which are -+ * represented using bits in the modifier. Not all combinations are valid, -+ * and different devices or use-cases may support different combinations. -+ * -+ * Further information on the use of AFBC modifiers can be found in -+ * Documentation/gpu/afbc.rst -+ */ -+ -+/* -+ * The top 4 bits (out of the 56 bits alloted for specifying vendor specific -+ * modifiers) denote the category for modifiers. Currently we have three -+ * categories of modifiers ie AFBC, MISC and AFRC. We can have a maximum of -+ * sixteen different categories. -+ */ -+#define DRM_FORMAT_MOD_ARM_CODE(__type, __val) \ -+ fourcc_mod_code(ARM, ((__u64)(__type) << 52) | ((__val) & 0x000fffffffffffffULL)) -+ -+#define DRM_FORMAT_MOD_ARM_TYPE_AFBC 0x00 -+#define DRM_FORMAT_MOD_ARM_TYPE_MISC 0x01 -+ -+#define DRM_FORMAT_MOD_ARM_AFBC(__afbc_mode) \ -+ DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_AFBC, __afbc_mode) -+ -+/* -+ * AFBC superblock size -+ * -+ * Indicates the superblock size(s) used for the AFBC buffer. The buffer -+ * size (in pixels) must be aligned to a multiple of the superblock size. -+ * Four lowest significant bits(LSBs) are reserved for block size. -+ * -+ * Where one superblock size is specified, it applies to all planes of the -+ * buffer (e.g. 16x16, 32x8). When multiple superblock sizes are specified, -+ * the first applies to the Luma plane and the second applies to the Chroma -+ * plane(s). e.g. (32x8_64x4 means 32x8 Luma, with 64x4 Chroma). -+ * Multiple superblock sizes are only valid for multi-plane YCbCr formats. -+ */ -+#define AFBC_FORMAT_MOD_BLOCK_SIZE_MASK 0xf -+#define AFBC_FORMAT_MOD_BLOCK_SIZE_16x16 (1ULL) -+#define AFBC_FORMAT_MOD_BLOCK_SIZE_32x8 (2ULL) -+#define AFBC_FORMAT_MOD_BLOCK_SIZE_64x4 (3ULL) -+#define AFBC_FORMAT_MOD_BLOCK_SIZE_32x8_64x4 (4ULL) -+ -+/* -+ * AFBC lossless colorspace transform -+ * -+ * Indicates that the buffer makes use of the AFBC lossless colorspace -+ * transform. -+ */ -+#define AFBC_FORMAT_MOD_YTR (1ULL << 4) -+ -+/* -+ * AFBC block-split -+ * -+ * Indicates that the payload of each superblock is split. The second -+ * half of the payload is positioned at a predefined offset from the start -+ * of the superblock payload. -+ */ -+#define AFBC_FORMAT_MOD_SPLIT (1ULL << 5) -+ -+/* -+ * AFBC sparse layout -+ * -+ * This flag indicates that the payload of each superblock must be stored at a -+ * predefined position relative to the other superblocks in the same AFBC -+ * buffer. This order is the same order used by the header buffer. In this mode -+ * each superblock is given the same amount of space as an uncompressed -+ * superblock of the particular format would require, rounding up to the next -+ * multiple of 128 bytes in size. -+ */ -+#define AFBC_FORMAT_MOD_SPARSE (1ULL << 6) -+ -+/* -+ * AFBC copy-block restrict -+ * -+ * Buffers with this flag must obey the copy-block restriction. The restriction -+ * is such that there are no copy-blocks referring across the border of 8x8 -+ * blocks. For the subsampled data the 8x8 limitation is also subsampled. -+ */ -+#define AFBC_FORMAT_MOD_CBR (1ULL << 7) -+ -+/* -+ * AFBC tiled layout -+ * -+ * The tiled layout groups superblocks in 8x8 or 4x4 tiles, where all -+ * superblocks inside a tile are stored together in memory. 8x8 tiles are used -+ * for pixel formats up to and including 32 bpp while 4x4 tiles are used for -+ * larger bpp formats. The order between the tiles is scan line. -+ * When the tiled layout is used, the buffer size (in pixels) must be aligned -+ * to the tile size. -+ */ -+#define AFBC_FORMAT_MOD_TILED (1ULL << 8) -+ -+/* -+ * AFBC solid color blocks -+ * -+ * Indicates that the buffer makes use of solid-color blocks, whereby bandwidth -+ * can be reduced if a whole superblock is a single color. -+ */ -+#define AFBC_FORMAT_MOD_SC (1ULL << 9) -+ -+/* -+ * AFBC double-buffer -+ * -+ * Indicates that the buffer is allocated in a layout safe for front-buffer -+ * rendering. -+ */ -+#define AFBC_FORMAT_MOD_DB (1ULL << 10) -+ -+/* -+ * AFBC buffer content hints -+ * -+ * Indicates that the buffer includes per-superblock content hints. -+ */ -+#define AFBC_FORMAT_MOD_BCH (1ULL << 11) -+ -+/* AFBC uncompressed storage mode -+ * -+ * Indicates that the buffer is using AFBC uncompressed storage mode. -+ * In this mode all superblock payloads in the buffer use the uncompressed -+ * storage mode, which is usually only used for data which cannot be compressed. -+ * The buffer layout is the same as for AFBC buffers without USM set, this only -+ * affects the storage mode of the individual superblocks. Note that even a -+ * buffer without USM set may use uncompressed storage mode for some or all -+ * superblocks, USM just guarantees it for all. -+ */ -+#define AFBC_FORMAT_MOD_USM (1ULL << 12) -+ -+/* -+ * Arm Fixed-Rate Compression (AFRC) modifiers -+ * -+ * AFRC is a proprietary fixed rate image compression protocol and format, -+ * designed to provide guaranteed bandwidth and memory footprint -+ * reductions in graphics and media use-cases. -+ * -+ * AFRC buffers consist of one or more planes, with the same components -+ * and meaning as an uncompressed buffer using the same pixel format. -+ * -+ * Within each plane, the pixel/luma/chroma values are grouped into -+ * "coding unit" blocks which are individually compressed to a -+ * fixed size (in bytes). All coding units within a given plane of a buffer -+ * store the same number of values, and have the same compressed size. -+ * -+ * The coding unit size is configurable, allowing different rates of compression. -+ * -+ * The start of each AFRC buffer plane must be aligned to an alignment granule which -+ * depends on the coding unit size. -+ * -+ * Coding Unit Size Plane Alignment -+ * ---------------- --------------- -+ * 16 bytes 1024 bytes -+ * 24 bytes 512 bytes -+ * 32 bytes 2048 bytes -+ * -+ * Coding units are grouped into paging tiles. AFRC buffer dimensions must be aligned -+ * to a multiple of the paging tile dimensions. -+ * The dimensions of each paging tile depend on whether the buffer is optimised for -+ * scanline (SCAN layout) or rotated (ROT layout) access. -+ * -+ * Layout Paging Tile Width Paging Tile Height -+ * ------ ----------------- ------------------ -+ * SCAN 16 coding units 4 coding units -+ * ROT 8 coding units 8 coding units -+ * -+ * The dimensions of each coding unit depend on the number of components -+ * in the compressed plane and whether the buffer is optimised for -+ * scanline (SCAN layout) or rotated (ROT layout) access. -+ * -+ * Number of Components in Plane Layout Coding Unit Width Coding Unit Height -+ * ----------------------------- --------- ----------------- ------------------ -+ * 1 SCAN 16 samples 4 samples -+ * Example: 16x4 luma samples in a 'Y' plane -+ * 16x4 chroma 'V' values, in the 'V' plane of a fully-planar YUV buffer -+ * ----------------------------- --------- ----------------- ------------------ -+ * 1 ROT 8 samples 8 samples -+ * Example: 8x8 luma samples in a 'Y' plane -+ * 8x8 chroma 'V' values, in the 'V' plane of a fully-planar YUV buffer -+ * ----------------------------- --------- ----------------- ------------------ -+ * 2 DONT CARE 8 samples 4 samples -+ * Example: 8x4 chroma pairs in the 'UV' plane of a semi-planar YUV buffer -+ * ----------------------------- --------- ----------------- ------------------ -+ * 3 DONT CARE 4 samples 4 samples -+ * Example: 4x4 pixels in an RGB buffer without alpha -+ * ----------------------------- --------- ----------------- ------------------ -+ * 4 DONT CARE 4 samples 4 samples -+ * Example: 4x4 pixels in an RGB buffer with alpha -+ */ -+ -+#define DRM_FORMAT_MOD_ARM_TYPE_AFRC 0x02 -+ -+#define DRM_FORMAT_MOD_ARM_AFRC(__afrc_mode) \ -+ DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_AFRC, __afrc_mode) -+ -+/* -+ * AFRC coding unit size modifier. -+ * -+ * Indicates the number of bytes used to store each compressed coding unit for -+ * one or more planes in an AFRC encoded buffer. The coding unit size for chrominance -+ * is the same for both Cb and Cr, which may be stored in separate planes. -+ * -+ * AFRC_FORMAT_MOD_CU_SIZE_P0 indicates the number of bytes used to store -+ * each compressed coding unit in the first plane of the buffer. For RGBA buffers -+ * this is the only plane, while for semi-planar and fully-planar YUV buffers, -+ * this corresponds to the luma plane. -+ * -+ * AFRC_FORMAT_MOD_CU_SIZE_P12 indicates the number of bytes used to store -+ * each compressed coding unit in the second and third planes in the buffer. -+ * For semi-planar and fully-planar YUV buffers, this corresponds to the chroma plane(s). -+ * -+ * For single-plane buffers, AFRC_FORMAT_MOD_CU_SIZE_P0 must be specified -+ * and AFRC_FORMAT_MOD_CU_SIZE_P12 must be zero. -+ * For semi-planar and fully-planar buffers, both AFRC_FORMAT_MOD_CU_SIZE_P0 and -+ * AFRC_FORMAT_MOD_CU_SIZE_P12 must be specified. -+ */ -+#define AFRC_FORMAT_MOD_CU_SIZE_MASK 0xf -+#define AFRC_FORMAT_MOD_CU_SIZE_16 (1ULL) -+#define AFRC_FORMAT_MOD_CU_SIZE_24 (2ULL) -+#define AFRC_FORMAT_MOD_CU_SIZE_32 (3ULL) -+ -+#define AFRC_FORMAT_MOD_CU_SIZE_P0(__afrc_cu_size) (__afrc_cu_size) -+#define AFRC_FORMAT_MOD_CU_SIZE_P12(__afrc_cu_size) ((__afrc_cu_size) << 4) -+ -+/* -+ * AFRC scanline memory layout. -+ * -+ * Indicates if the buffer uses the scanline-optimised layout -+ * for an AFRC encoded buffer, otherwise, it uses the rotation-optimised layout. -+ * The memory layout is the same for all planes. -+ */ -+#define AFRC_FORMAT_MOD_LAYOUT_SCAN (1ULL << 8) -+ -+/* -+ * Arm 16x16 Block U-Interleaved modifier -+ * -+ * This is used by Arm Mali Utgard and Midgard GPUs. It divides the image -+ * into 16x16 pixel blocks. Blocks are stored linearly in order, but pixels -+ * in the block are reordered. -+ */ -+#define DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED \ -+ DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_MISC, 1ULL) -+ -+/* -+ * Allwinner tiled modifier -+ * -+ * This tiling mode is implemented by the VPU found on all Allwinner platforms, -+ * codenamed sunxi. It is associated with a YUV format that uses either 2 or 3 -+ * planes. -+ * -+ * With this tiling, the luminance samples are disposed in tiles representing -+ * 32x32 pixels and the chrominance samples in tiles representing 32x64 pixels. -+ * The pixel order in each tile is linear and the tiles are disposed linearly, -+ * both in row-major order. -+ */ -+#define DRM_FORMAT_MOD_ALLWINNER_TILED fourcc_mod_code(ALLWINNER, 1) -+ -+/* -+ * Amlogic Video Framebuffer Compression modifiers -+ * -+ * Amlogic uses a proprietary lossless image compression protocol and format -+ * for their hardware video codec accelerators, either video decoders or -+ * video input encoders. -+ * -+ * It considerably reduces memory bandwidth while writing and reading -+ * frames in memory. -+ * -+ * The underlying storage is considered to be 3 components, 8bit or 10-bit -+ * per component YCbCr 420, single plane : -+ * - DRM_FORMAT_YUV420_8BIT -+ * - DRM_FORMAT_YUV420_10BIT -+ * -+ * The first 8 bits of the mode defines the layout, then the following 8 bits -+ * defines the options changing the layout. -+ * -+ * Not all combinations are valid, and different SoCs may support different -+ * combinations of layout and options. -+ */ -+#define __fourcc_mod_amlogic_layout_mask 0xff -+#define __fourcc_mod_amlogic_options_shift 8 -+#define __fourcc_mod_amlogic_options_mask 0xff -+ -+#define DRM_FORMAT_MOD_AMLOGIC_FBC(__layout, __options) \ -+ fourcc_mod_code(AMLOGIC, \ -+ ((__layout) & __fourcc_mod_amlogic_layout_mask) | \ -+ (((__options) & __fourcc_mod_amlogic_options_mask) \ -+ << __fourcc_mod_amlogic_options_shift)) -+ -+/* Amlogic FBC Layouts */ -+ -+/* -+ * Amlogic FBC Basic Layout -+ * -+ * The basic layout is composed of: -+ * - a body content organized in 64x32 superblocks with 4096 bytes per -+ * superblock in default mode. -+ * - a 32 bytes per 128x64 header block -+ * -+ * This layout is transferrable between Amlogic SoCs supporting this modifier. -+ */ -+#define AMLOGIC_FBC_LAYOUT_BASIC (1ULL) -+ -+/* -+ * Amlogic FBC Scatter Memory layout -+ * -+ * Indicates the header contains IOMMU references to the compressed -+ * frames content to optimize memory access and layout. -+ * -+ * In this mode, only the header memory address is needed, thus the -+ * content memory organization is tied to the current producer -+ * execution and cannot be saved/dumped neither transferrable between -+ * Amlogic SoCs supporting this modifier. -+ * -+ * Due to the nature of the layout, these buffers are not expected to -+ * be accessible by the user-space clients, but only accessible by the -+ * hardware producers and consumers. -+ * -+ * The user-space clients should expect a failure while trying to mmap -+ * the DMA-BUF handle returned by the producer. -+ */ -+#define AMLOGIC_FBC_LAYOUT_SCATTER (2ULL) -+ -+/* Amlogic FBC Layout Options Bit Mask */ -+ -+/* -+ * Amlogic FBC Memory Saving mode -+ * -+ * Indicates the storage is packed when pixel size is multiple of word -+ * boudaries, i.e. 8bit should be stored in this mode to save allocation -+ * memory. -+ * -+ * This mode reduces body layout to 3072 bytes per 64x32 superblock with -+ * the basic layout and 3200 bytes per 64x32 superblock combined with -+ * the scatter layout. -+ */ -+#define AMLOGIC_FBC_OPTION_MEM_SAVING (1ULL << 0) -+ -+/* -+ * AMD modifiers -+ * -+ * Memory layout: -+ * -+ * without DCC: -+ * - main surface -+ * -+ * with DCC & without DCC_RETILE: -+ * - main surface in plane 0 -+ * - DCC surface in plane 1 (RB-aligned, pipe-aligned if DCC_PIPE_ALIGN is set) -+ * -+ * with DCC & DCC_RETILE: -+ * - main surface in plane 0 -+ * - displayable DCC surface in plane 1 (not RB-aligned & not pipe-aligned) -+ * - pipe-aligned DCC surface in plane 2 (RB-aligned & pipe-aligned) -+ * -+ * For multi-plane formats the above surfaces get merged into one plane for -+ * each format plane, based on the required alignment only. -+ * -+ * Bits Parameter Notes -+ * ----- ------------------------ --------------------------------------------- -+ * -+ * 7:0 TILE_VERSION Values are AMD_FMT_MOD_TILE_VER_* -+ * 12:8 TILE Values are AMD_FMT_MOD_TILE__* -+ * 13 DCC -+ * 14 DCC_RETILE -+ * 15 DCC_PIPE_ALIGN -+ * 16 DCC_INDEPENDENT_64B -+ * 17 DCC_INDEPENDENT_128B -+ * 19:18 DCC_MAX_COMPRESSED_BLOCK Values are AMD_FMT_MOD_DCC_BLOCK_* -+ * 20 DCC_CONSTANT_ENCODE -+ * 23:21 PIPE_XOR_BITS Only for some chips -+ * 26:24 BANK_XOR_BITS Only for some chips -+ * 29:27 PACKERS Only for some chips -+ * 32:30 RB Only for some chips -+ * 35:33 PIPE Only for some chips -+ * 55:36 - Reserved for future use, must be zero -+ */ -+#define AMD_FMT_MOD fourcc_mod_code(AMD, 0) -+ -+#define IS_AMD_FMT_MOD(val) (((val) >> 56) == DRM_FORMAT_MOD_VENDOR_AMD) -+ -+/* Reserve 0 for GFX8 and older */ -+#define AMD_FMT_MOD_TILE_VER_GFX9 1 -+#define AMD_FMT_MOD_TILE_VER_GFX10 2 -+#define AMD_FMT_MOD_TILE_VER_GFX10_RBPLUS 3 -+ -+/* -+ * 64K_S is the same for GFX9/GFX10/GFX10_RBPLUS and hence has GFX9 as canonical -+ * version. -+ */ -+#define AMD_FMT_MOD_TILE_GFX9_64K_S 9 -+ -+/* -+ * 64K_D for non-32 bpp is the same for GFX9/GFX10/GFX10_RBPLUS and hence has -+ * GFX9 as canonical version. -+ */ -+#define AMD_FMT_MOD_TILE_GFX9_64K_D 10 -+#define AMD_FMT_MOD_TILE_GFX9_64K_S_X 25 -+#define AMD_FMT_MOD_TILE_GFX9_64K_D_X 26 -+#define AMD_FMT_MOD_TILE_GFX9_64K_R_X 27 -+ -+#define AMD_FMT_MOD_DCC_BLOCK_64B 0 -+#define AMD_FMT_MOD_DCC_BLOCK_128B 1 -+#define AMD_FMT_MOD_DCC_BLOCK_256B 2 -+ -+#define AMD_FMT_MOD_TILE_VERSION_SHIFT 0 -+#define AMD_FMT_MOD_TILE_VERSION_MASK 0xFF -+#define AMD_FMT_MOD_TILE_SHIFT 8 -+#define AMD_FMT_MOD_TILE_MASK 0x1F -+ -+/* Whether DCC compression is enabled. */ -+#define AMD_FMT_MOD_DCC_SHIFT 13 -+#define AMD_FMT_MOD_DCC_MASK 0x1 -+ -+/* -+ * Whether to include two DCC surfaces, one which is rb & pipe aligned, and -+ * one which is not-aligned. -+ */ -+#define AMD_FMT_MOD_DCC_RETILE_SHIFT 14 -+#define AMD_FMT_MOD_DCC_RETILE_MASK 0x1 -+ -+/* Only set if DCC_RETILE = false */ -+#define AMD_FMT_MOD_DCC_PIPE_ALIGN_SHIFT 15 -+#define AMD_FMT_MOD_DCC_PIPE_ALIGN_MASK 0x1 -+ -+#define AMD_FMT_MOD_DCC_INDEPENDENT_64B_SHIFT 16 -+#define AMD_FMT_MOD_DCC_INDEPENDENT_64B_MASK 0x1 -+#define AMD_FMT_MOD_DCC_INDEPENDENT_128B_SHIFT 17 -+#define AMD_FMT_MOD_DCC_INDEPENDENT_128B_MASK 0x1 -+#define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_SHIFT 18 -+#define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_MASK 0x3 -+ -+/* -+ * DCC supports embedding some clear colors directly in the DCC surface. -+ * However, on older GPUs the rendering HW ignores the embedded clear color -+ * and prefers the driver provided color. This necessitates doing a fastclear -+ * eliminate operation before a process transfers control. -+ * -+ * If this bit is set that means the fastclear eliminate is not needed for these -+ * embeddable colors. -+ */ -+#define AMD_FMT_MOD_DCC_CONSTANT_ENCODE_SHIFT 20 -+#define AMD_FMT_MOD_DCC_CONSTANT_ENCODE_MASK 0x1 -+ -+/* -+ * The below fields are for accounting for per GPU differences. These are only -+ * relevant for GFX9 and later and if the tile field is *_X/_T. -+ * -+ * PIPE_XOR_BITS = always needed -+ * BANK_XOR_BITS = only for TILE_VER_GFX9 -+ * PACKERS = only for TILE_VER_GFX10_RBPLUS -+ * RB = only for TILE_VER_GFX9 & DCC -+ * PIPE = only for TILE_VER_GFX9 & DCC & (DCC_RETILE | DCC_PIPE_ALIGN) -+ */ -+#define AMD_FMT_MOD_PIPE_XOR_BITS_SHIFT 21 -+#define AMD_FMT_MOD_PIPE_XOR_BITS_MASK 0x7 -+#define AMD_FMT_MOD_BANK_XOR_BITS_SHIFT 24 -+#define AMD_FMT_MOD_BANK_XOR_BITS_MASK 0x7 -+#define AMD_FMT_MOD_PACKERS_SHIFT 27 -+#define AMD_FMT_MOD_PACKERS_MASK 0x7 -+#define AMD_FMT_MOD_RB_SHIFT 30 -+#define AMD_FMT_MOD_RB_MASK 0x7 -+#define AMD_FMT_MOD_PIPE_SHIFT 33 -+#define AMD_FMT_MOD_PIPE_MASK 0x7 -+ -+#define AMD_FMT_MOD_SET(field, value) \ -+ ((uint64_t)(value) << AMD_FMT_MOD_##field##_SHIFT) -+#define AMD_FMT_MOD_GET(field, value) \ -+ (((value) >> AMD_FMT_MOD_##field##_SHIFT) & AMD_FMT_MOD_##field##_MASK) -+#define AMD_FMT_MOD_CLEAR(field) \ -+ (~((uint64_t)AMD_FMT_MOD_##field##_MASK << AMD_FMT_MOD_##field##_SHIFT)) -+ -+#if defined(__cplusplus) -+} -+#endif -+ -+#endif /* DRM_FOURCC_H */ -diff -up firefox-103.0/third_party/drm/drm/drm.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/drm/drm/drm.h ---- firefox-103.0/third_party/drm/drm/drm.h.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.317409023 +0200 -+++ firefox-103.0/third_party/drm/drm/drm.h 2022-07-28 11:45:30.317409023 +0200 -@@ -0,0 +1,1193 @@ -+/* -+ * Header for the Direct Rendering Manager -+ * -+ * Author: Rickard E. (Rik) Faith -+ * -+ * Acknowledgments: -+ * Dec 1999, Richard Henderson , move to generic cmpxchg. -+ */ -+ -+/* -+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. -+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. -+ * All rights reserved. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#ifndef _DRM_H_ -+#define _DRM_H_ -+ -+#if defined(__linux__) -+ -+#include -+#include -+typedef unsigned int drm_handle_t; -+ -+#else /* One of the BSDs */ -+ -+#include -+#include -+#include -+typedef int8_t __s8; -+typedef uint8_t __u8; -+typedef int16_t __s16; -+typedef uint16_t __u16; -+typedef int32_t __s32; -+typedef uint32_t __u32; -+typedef int64_t __s64; -+typedef uint64_t __u64; -+typedef size_t __kernel_size_t; -+typedef unsigned long drm_handle_t; -+ -+#endif -+ -+#if defined(__cplusplus) -+extern "C" { -+#endif -+ -+#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */ -+#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */ -+#define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */ -+#define DRM_RAM_PERCENT 10 /**< How much system ram can we lock? */ -+ -+#define _DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */ -+#define _DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */ -+#define _DRM_LOCK_IS_HELD(lock) ((lock) & _DRM_LOCK_HELD) -+#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT) -+#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) -+ -+typedef unsigned int drm_context_t; -+typedef unsigned int drm_drawable_t; -+typedef unsigned int drm_magic_t; -+ -+/* -+ * Cliprect. -+ * -+ * \warning: If you change this structure, make sure you change -+ * XF86DRIClipRectRec in the server as well -+ * -+ * \note KW: Actually it's illegal to change either for -+ * backwards-compatibility reasons. -+ */ -+struct drm_clip_rect { -+ unsigned short x1; -+ unsigned short y1; -+ unsigned short x2; -+ unsigned short y2; -+}; -+ -+/* -+ * Drawable information. -+ */ -+struct drm_drawable_info { -+ unsigned int num_rects; -+ struct drm_clip_rect *rects; -+}; -+ -+/* -+ * Texture region, -+ */ -+struct drm_tex_region { -+ unsigned char next; -+ unsigned char prev; -+ unsigned char in_use; -+ unsigned char padding; -+ unsigned int age; -+}; -+ -+/* -+ * Hardware lock. -+ * -+ * The lock structure is a simple cache-line aligned integer. To avoid -+ * processor bus contention on a multiprocessor system, there should not be any -+ * other data stored in the same cache line. -+ */ -+struct drm_hw_lock { -+ __volatile__ unsigned int lock; /**< lock variable */ -+ char padding[60]; /**< Pad to cache line */ -+}; -+ -+/* -+ * DRM_IOCTL_VERSION ioctl argument type. -+ * -+ * \sa drmGetVersion(). -+ */ -+struct drm_version { -+ int version_major; /**< Major version */ -+ int version_minor; /**< Minor version */ -+ int version_patchlevel; /**< Patch level */ -+ __kernel_size_t name_len; /**< Length of name buffer */ -+ char *name; /**< Name of driver */ -+ __kernel_size_t date_len; /**< Length of date buffer */ -+ char *date; /**< User-space buffer to hold date */ -+ __kernel_size_t desc_len; /**< Length of desc buffer */ -+ char *desc; /**< User-space buffer to hold desc */ -+}; -+ -+/* -+ * DRM_IOCTL_GET_UNIQUE ioctl argument type. -+ * -+ * \sa drmGetBusid() and drmSetBusId(). -+ */ -+struct drm_unique { -+ __kernel_size_t unique_len; /**< Length of unique */ -+ char *unique; /**< Unique name for driver instantiation */ -+}; -+ -+struct drm_list { -+ int count; /**< Length of user-space structures */ -+ struct drm_version *version; -+}; -+ -+struct drm_block { -+ int unused; -+}; -+ -+/* -+ * DRM_IOCTL_CONTROL ioctl argument type. -+ * -+ * \sa drmCtlInstHandler() and drmCtlUninstHandler(). -+ */ -+struct drm_control { -+ enum { -+ DRM_ADD_COMMAND, -+ DRM_RM_COMMAND, -+ DRM_INST_HANDLER, -+ DRM_UNINST_HANDLER -+ } func; -+ int irq; -+}; -+ -+/* -+ * Type of memory to map. -+ */ -+enum drm_map_type { -+ _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */ -+ _DRM_REGISTERS = 1, /**< no caching, no core dump */ -+ _DRM_SHM = 2, /**< shared, cached */ -+ _DRM_AGP = 3, /**< AGP/GART */ -+ _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */ -+ _DRM_CONSISTENT = 5 /**< Consistent memory for PCI DMA */ -+}; -+ -+/* -+ * Memory mapping flags. -+ */ -+enum drm_map_flags { -+ _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */ -+ _DRM_READ_ONLY = 0x02, -+ _DRM_LOCKED = 0x04, /**< shared, cached, locked */ -+ _DRM_KERNEL = 0x08, /**< kernel requires access */ -+ _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */ -+ _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */ -+ _DRM_REMOVABLE = 0x40, /**< Removable mapping */ -+ _DRM_DRIVER = 0x80 /**< Managed by driver */ -+}; -+ -+struct drm_ctx_priv_map { -+ unsigned int ctx_id; /**< Context requesting private mapping */ -+ void *handle; /**< Handle of map */ -+}; -+ -+/* -+ * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls -+ * argument type. -+ * -+ * \sa drmAddMap(). -+ */ -+struct drm_map { -+ unsigned long offset; /**< Requested physical address (0 for SAREA)*/ -+ unsigned long size; /**< Requested physical size (bytes) */ -+ enum drm_map_type type; /**< Type of memory to map */ -+ enum drm_map_flags flags; /**< Flags */ -+ void *handle; /**< User-space: "Handle" to pass to mmap() */ -+ /**< Kernel-space: kernel-virtual address */ -+ int mtrr; /**< MTRR slot used */ -+ /* Private data */ -+}; -+ -+/* -+ * DRM_IOCTL_GET_CLIENT ioctl argument type. -+ */ -+struct drm_client { -+ int idx; /**< Which client desired? */ -+ int auth; /**< Is client authenticated? */ -+ unsigned long pid; /**< Process ID */ -+ unsigned long uid; /**< User ID */ -+ unsigned long magic; /**< Magic */ -+ unsigned long iocs; /**< Ioctl count */ -+}; -+ -+enum drm_stat_type { -+ _DRM_STAT_LOCK, -+ _DRM_STAT_OPENS, -+ _DRM_STAT_CLOSES, -+ _DRM_STAT_IOCTLS, -+ _DRM_STAT_LOCKS, -+ _DRM_STAT_UNLOCKS, -+ _DRM_STAT_VALUE, /**< Generic value */ -+ _DRM_STAT_BYTE, /**< Generic byte counter (1024bytes/K) */ -+ _DRM_STAT_COUNT, /**< Generic non-byte counter (1000/k) */ -+ -+ _DRM_STAT_IRQ, /**< IRQ */ -+ _DRM_STAT_PRIMARY, /**< Primary DMA bytes */ -+ _DRM_STAT_SECONDARY, /**< Secondary DMA bytes */ -+ _DRM_STAT_DMA, /**< DMA */ -+ _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */ -+ _DRM_STAT_MISSED /**< Missed DMA opportunity */ -+ /* Add to the *END* of the list */ -+}; -+ -+/* -+ * DRM_IOCTL_GET_STATS ioctl argument type. -+ */ -+struct drm_stats { -+ unsigned long count; -+ struct { -+ unsigned long value; -+ enum drm_stat_type type; -+ } data[15]; -+}; -+ -+/* -+ * Hardware locking flags. -+ */ -+enum drm_lock_flags { -+ _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */ -+ _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */ -+ _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */ -+ _DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */ -+ /* These *HALT* flags aren't supported yet -+ -- they will be used to support the -+ full-screen DGA-like mode. */ -+ _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */ -+ _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ -+}; -+ -+/* -+ * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type. -+ * -+ * \sa drmGetLock() and drmUnlock(). -+ */ -+struct drm_lock { -+ int context; -+ enum drm_lock_flags flags; -+}; -+ -+/* -+ * DMA flags -+ * -+ * \warning -+ * These values \e must match xf86drm.h. -+ * -+ * \sa drm_dma. -+ */ -+enum drm_dma_flags { -+ /* Flags for DMA buffer dispatch */ -+ _DRM_DMA_BLOCK = 0x01, /**< -+ * Block until buffer dispatched. -+ * -+ * \note The buffer may not yet have -+ * been processed by the hardware -- -+ * getting a hardware lock with the -+ * hardware quiescent will ensure -+ * that the buffer has been -+ * processed. -+ */ -+ _DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */ -+ _DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */ -+ -+ /* Flags for DMA buffer request */ -+ _DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */ -+ _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */ -+ _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ -+}; -+ -+/* -+ * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type. -+ * -+ * \sa drmAddBufs(). -+ */ -+struct drm_buf_desc { -+ int count; /**< Number of buffers of this size */ -+ int size; /**< Size in bytes */ -+ int low_mark; /**< Low water mark */ -+ int high_mark; /**< High water mark */ -+ enum { -+ _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */ -+ _DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */ -+ _DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */ -+ _DRM_FB_BUFFER = 0x08, /**< Buffer is in frame buffer */ -+ _DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */ -+ } flags; -+ unsigned long agp_start; /**< -+ * Start address of where the AGP buffers are -+ * in the AGP aperture -+ */ -+}; -+ -+/* -+ * DRM_IOCTL_INFO_BUFS ioctl argument type. -+ */ -+struct drm_buf_info { -+ int count; /**< Entries in list */ -+ struct drm_buf_desc *list; -+}; -+ -+/* -+ * DRM_IOCTL_FREE_BUFS ioctl argument type. -+ */ -+struct drm_buf_free { -+ int count; -+ int *list; -+}; -+ -+/* -+ * Buffer information -+ * -+ * \sa drm_buf_map. -+ */ -+struct drm_buf_pub { -+ int idx; /**< Index into the master buffer list */ -+ int total; /**< Buffer size */ -+ int used; /**< Amount of buffer in use (for DMA) */ -+ void *address; /**< Address of buffer */ -+}; -+ -+/* -+ * DRM_IOCTL_MAP_BUFS ioctl argument type. -+ */ -+struct drm_buf_map { -+ int count; /**< Length of the buffer list */ -+#ifdef __cplusplus -+ void *virt; -+#else -+ void *virtual; /**< Mmap'd area in user-virtual */ -+#endif -+ struct drm_buf_pub *list; /**< Buffer information */ -+}; -+ -+/* -+ * DRM_IOCTL_DMA ioctl argument type. -+ * -+ * Indices here refer to the offset into the buffer list in drm_buf_get. -+ * -+ * \sa drmDMA(). -+ */ -+struct drm_dma { -+ int context; /**< Context handle */ -+ int send_count; /**< Number of buffers to send */ -+ int *send_indices; /**< List of handles to buffers */ -+ int *send_sizes; /**< Lengths of data to send */ -+ enum drm_dma_flags flags; /**< Flags */ -+ int request_count; /**< Number of buffers requested */ -+ int request_size; /**< Desired size for buffers */ -+ int *request_indices; /**< Buffer information */ -+ int *request_sizes; -+ int granted_count; /**< Number of buffers granted */ -+}; -+ -+enum drm_ctx_flags { -+ _DRM_CONTEXT_PRESERVED = 0x01, -+ _DRM_CONTEXT_2DONLY = 0x02 -+}; -+ -+/* -+ * DRM_IOCTL_ADD_CTX ioctl argument type. -+ * -+ * \sa drmCreateContext() and drmDestroyContext(). -+ */ -+struct drm_ctx { -+ drm_context_t handle; -+ enum drm_ctx_flags flags; -+}; -+ -+/* -+ * DRM_IOCTL_RES_CTX ioctl argument type. -+ */ -+struct drm_ctx_res { -+ int count; -+ struct drm_ctx *contexts; -+}; -+ -+/* -+ * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type. -+ */ -+struct drm_draw { -+ drm_drawable_t handle; -+}; -+ -+/* -+ * DRM_IOCTL_UPDATE_DRAW ioctl argument type. -+ */ -+typedef enum { -+ DRM_DRAWABLE_CLIPRECTS -+} drm_drawable_info_type_t; -+ -+struct drm_update_draw { -+ drm_drawable_t handle; -+ unsigned int type; -+ unsigned int num; -+ unsigned long long data; -+}; -+ -+/* -+ * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type. -+ */ -+struct drm_auth { -+ drm_magic_t magic; -+}; -+ -+/* -+ * DRM_IOCTL_IRQ_BUSID ioctl argument type. -+ * -+ * \sa drmGetInterruptFromBusID(). -+ */ -+struct drm_irq_busid { -+ int irq; /**< IRQ number */ -+ int busnum; /**< bus number */ -+ int devnum; /**< device number */ -+ int funcnum; /**< function number */ -+}; -+ -+enum drm_vblank_seq_type { -+ _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ -+ _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ -+ /* bits 1-6 are reserved for high crtcs */ -+ _DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e, -+ _DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */ -+ _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ -+ _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ -+ _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ -+ _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking, unsupported */ -+}; -+#define _DRM_VBLANK_HIGH_CRTC_SHIFT 1 -+ -+#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE) -+#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \ -+ _DRM_VBLANK_SECONDARY | _DRM_VBLANK_NEXTONMISS) -+ -+struct drm_wait_vblank_request { -+ enum drm_vblank_seq_type type; -+ unsigned int sequence; -+ unsigned long signal; -+}; -+ -+struct drm_wait_vblank_reply { -+ enum drm_vblank_seq_type type; -+ unsigned int sequence; -+ long tval_sec; -+ long tval_usec; -+}; -+ -+/* -+ * DRM_IOCTL_WAIT_VBLANK ioctl argument type. -+ * -+ * \sa drmWaitVBlank(). -+ */ -+union drm_wait_vblank { -+ struct drm_wait_vblank_request request; -+ struct drm_wait_vblank_reply reply; -+}; -+ -+#define _DRM_PRE_MODESET 1 -+#define _DRM_POST_MODESET 2 -+ -+/* -+ * DRM_IOCTL_MODESET_CTL ioctl argument type -+ * -+ * \sa drmModesetCtl(). -+ */ -+struct drm_modeset_ctl { -+ __u32 crtc; -+ __u32 cmd; -+}; -+ -+/* -+ * DRM_IOCTL_AGP_ENABLE ioctl argument type. -+ * -+ * \sa drmAgpEnable(). -+ */ -+struct drm_agp_mode { -+ unsigned long mode; /**< AGP mode */ -+}; -+ -+/* -+ * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type. -+ * -+ * \sa drmAgpAlloc() and drmAgpFree(). -+ */ -+struct drm_agp_buffer { -+ unsigned long size; /**< In bytes -- will round to page boundary */ -+ unsigned long handle; /**< Used for binding / unbinding */ -+ unsigned long type; /**< Type of memory to allocate */ -+ unsigned long physical; /**< Physical used by i810 */ -+}; -+ -+/* -+ * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type. -+ * -+ * \sa drmAgpBind() and drmAgpUnbind(). -+ */ -+struct drm_agp_binding { -+ unsigned long handle; /**< From drm_agp_buffer */ -+ unsigned long offset; /**< In bytes -- will round to page boundary */ -+}; -+ -+/* -+ * DRM_IOCTL_AGP_INFO ioctl argument type. -+ * -+ * \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(), -+ * drmAgpBase(), drmAgpSize(), drmAgpMemoryUsed(), drmAgpMemoryAvail(), -+ * drmAgpVendorId() and drmAgpDeviceId(). -+ */ -+struct drm_agp_info { -+ int agp_version_major; -+ int agp_version_minor; -+ unsigned long mode; -+ unsigned long aperture_base; /* physical address */ -+ unsigned long aperture_size; /* bytes */ -+ unsigned long memory_allowed; /* bytes */ -+ unsigned long memory_used; -+ -+ /* PCI information */ -+ unsigned short id_vendor; -+ unsigned short id_device; -+}; -+ -+/* -+ * DRM_IOCTL_SG_ALLOC ioctl argument type. -+ */ -+struct drm_scatter_gather { -+ unsigned long size; /**< In bytes -- will round to page boundary */ -+ unsigned long handle; /**< Used for mapping / unmapping */ -+}; -+ -+/* -+ * DRM_IOCTL_SET_VERSION ioctl argument type. -+ */ -+struct drm_set_version { -+ int drm_di_major; -+ int drm_di_minor; -+ int drm_dd_major; -+ int drm_dd_minor; -+}; -+ -+/* DRM_IOCTL_GEM_CLOSE ioctl argument type */ -+struct drm_gem_close { -+ /** Handle of the object to be closed. */ -+ __u32 handle; -+ __u32 pad; -+}; -+ -+/* DRM_IOCTL_GEM_FLINK ioctl argument type */ -+struct drm_gem_flink { -+ /** Handle for the object being named */ -+ __u32 handle; -+ -+ /** Returned global name */ -+ __u32 name; -+}; -+ -+/* DRM_IOCTL_GEM_OPEN ioctl argument type */ -+struct drm_gem_open { -+ /** Name of object being opened */ -+ __u32 name; -+ -+ /** Returned handle for the object */ -+ __u32 handle; -+ -+ /** Returned size of the object */ -+ __u64 size; -+}; -+ -+/** -+ * DRM_CAP_DUMB_BUFFER -+ * -+ * If set to 1, the driver supports creating dumb buffers via the -+ * &DRM_IOCTL_MODE_CREATE_DUMB ioctl. -+ */ -+#define DRM_CAP_DUMB_BUFFER 0x1 -+/** -+ * DRM_CAP_VBLANK_HIGH_CRTC -+ * -+ * If set to 1, the kernel supports specifying a :ref:`CRTC index` -+ * in the high bits of &drm_wait_vblank_request.type. -+ * -+ * Starting kernel version 2.6.39, this capability is always set to 1. -+ */ -+#define DRM_CAP_VBLANK_HIGH_CRTC 0x2 -+/** -+ * DRM_CAP_DUMB_PREFERRED_DEPTH -+ * -+ * The preferred bit depth for dumb buffers. -+ * -+ * The bit depth is the number of bits used to indicate the color of a single -+ * pixel excluding any padding. This is different from the number of bits per -+ * pixel. For instance, XRGB8888 has a bit depth of 24 but has 32 bits per -+ * pixel. -+ * -+ * Note that this preference only applies to dumb buffers, it's irrelevant for -+ * other types of buffers. -+ */ -+#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3 -+/** -+ * DRM_CAP_DUMB_PREFER_SHADOW -+ * -+ * If set to 1, the driver prefers userspace to render to a shadow buffer -+ * instead of directly rendering to a dumb buffer. For best speed, userspace -+ * should do streaming ordered memory copies into the dumb buffer and never -+ * read from it. -+ * -+ * Note that this preference only applies to dumb buffers, it's irrelevant for -+ * other types of buffers. -+ */ -+#define DRM_CAP_DUMB_PREFER_SHADOW 0x4 -+/** -+ * DRM_CAP_PRIME -+ * -+ * Bitfield of supported PRIME sharing capabilities. See &DRM_PRIME_CAP_IMPORT -+ * and &DRM_PRIME_CAP_EXPORT. -+ * -+ * PRIME buffers are exposed as dma-buf file descriptors. See -+ * Documentation/gpu/drm-mm.rst, section "PRIME Buffer Sharing". -+ */ -+#define DRM_CAP_PRIME 0x5 -+/** -+ * DRM_PRIME_CAP_IMPORT -+ * -+ * If this bit is set in &DRM_CAP_PRIME, the driver supports importing PRIME -+ * buffers via the &DRM_IOCTL_PRIME_FD_TO_HANDLE ioctl. -+ */ -+#define DRM_PRIME_CAP_IMPORT 0x1 -+/** -+ * DRM_PRIME_CAP_EXPORT -+ * -+ * If this bit is set in &DRM_CAP_PRIME, the driver supports exporting PRIME -+ * buffers via the &DRM_IOCTL_PRIME_HANDLE_TO_FD ioctl. -+ */ -+#define DRM_PRIME_CAP_EXPORT 0x2 -+/** -+ * DRM_CAP_TIMESTAMP_MONOTONIC -+ * -+ * If set to 0, the kernel will report timestamps with ``CLOCK_REALTIME`` in -+ * struct drm_event_vblank. If set to 1, the kernel will report timestamps with -+ * ``CLOCK_MONOTONIC``. See ``clock_gettime(2)`` for the definition of these -+ * clocks. -+ * -+ * Starting from kernel version 2.6.39, the default value for this capability -+ * is 1. Starting kernel version 4.15, this capability is always set to 1. -+ */ -+#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 -+/** -+ * DRM_CAP_ASYNC_PAGE_FLIP -+ * -+ * If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC. -+ */ -+#define DRM_CAP_ASYNC_PAGE_FLIP 0x7 -+/** -+ * DRM_CAP_CURSOR_WIDTH -+ * -+ * The ``CURSOR_WIDTH`` and ``CURSOR_HEIGHT`` capabilities return a valid -+ * width x height combination for the hardware cursor. The intention is that a -+ * hardware agnostic userspace can query a cursor plane size to use. -+ * -+ * Note that the cross-driver contract is to merely return a valid size; -+ * drivers are free to attach another meaning on top, eg. i915 returns the -+ * maximum plane size. -+ */ -+#define DRM_CAP_CURSOR_WIDTH 0x8 -+/** -+ * DRM_CAP_CURSOR_HEIGHT -+ * -+ * See &DRM_CAP_CURSOR_WIDTH. -+ */ -+#define DRM_CAP_CURSOR_HEIGHT 0x9 -+/** -+ * DRM_CAP_ADDFB2_MODIFIERS -+ * -+ * If set to 1, the driver supports supplying modifiers in the -+ * &DRM_IOCTL_MODE_ADDFB2 ioctl. -+ */ -+#define DRM_CAP_ADDFB2_MODIFIERS 0x10 -+/** -+ * DRM_CAP_PAGE_FLIP_TARGET -+ * -+ * If set to 1, the driver supports the &DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE and -+ * &DRM_MODE_PAGE_FLIP_TARGET_RELATIVE flags in -+ * &drm_mode_crtc_page_flip_target.flags for the &DRM_IOCTL_MODE_PAGE_FLIP -+ * ioctl. -+ */ -+#define DRM_CAP_PAGE_FLIP_TARGET 0x11 -+/** -+ * DRM_CAP_CRTC_IN_VBLANK_EVENT -+ * -+ * If set to 1, the kernel supports reporting the CRTC ID in -+ * &drm_event_vblank.crtc_id for the &DRM_EVENT_VBLANK and -+ * &DRM_EVENT_FLIP_COMPLETE events. -+ * -+ * Starting kernel version 4.12, this capability is always set to 1. -+ */ -+#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12 -+/** -+ * DRM_CAP_SYNCOBJ -+ * -+ * If set to 1, the driver supports sync objects. See -+ * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects". -+ */ -+#define DRM_CAP_SYNCOBJ 0x13 -+/** -+ * DRM_CAP_SYNCOBJ_TIMELINE -+ * -+ * If set to 1, the driver supports timeline operations on sync objects. See -+ * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects". -+ */ -+#define DRM_CAP_SYNCOBJ_TIMELINE 0x14 -+ -+/* DRM_IOCTL_GET_CAP ioctl argument type */ -+struct drm_get_cap { -+ __u64 capability; -+ __u64 value; -+}; -+ -+/** -+ * DRM_CLIENT_CAP_STEREO_3D -+ * -+ * If set to 1, the DRM core will expose the stereo 3D capabilities of the -+ * monitor by advertising the supported 3D layouts in the flags of struct -+ * drm_mode_modeinfo. See ``DRM_MODE_FLAG_3D_*``. -+ * -+ * This capability is always supported for all drivers starting from kernel -+ * version 3.13. -+ */ -+#define DRM_CLIENT_CAP_STEREO_3D 1 -+ -+/** -+ * DRM_CLIENT_CAP_UNIVERSAL_PLANES -+ * -+ * If set to 1, the DRM core will expose all planes (overlay, primary, and -+ * cursor) to userspace. -+ * -+ * This capability has been introduced in kernel version 3.15. Starting from -+ * kernel version 3.17, this capability is always supported for all drivers. -+ */ -+#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2 -+ -+/** -+ * DRM_CLIENT_CAP_ATOMIC -+ * -+ * If set to 1, the DRM core will expose atomic properties to userspace. This -+ * implicitly enables &DRM_CLIENT_CAP_UNIVERSAL_PLANES and -+ * &DRM_CLIENT_CAP_ASPECT_RATIO. -+ * -+ * If the driver doesn't support atomic mode-setting, enabling this capability -+ * will fail with -EOPNOTSUPP. -+ * -+ * This capability has been introduced in kernel version 4.0. Starting from -+ * kernel version 4.2, this capability is always supported for atomic-capable -+ * drivers. -+ */ -+#define DRM_CLIENT_CAP_ATOMIC 3 -+ -+/** -+ * DRM_CLIENT_CAP_ASPECT_RATIO -+ * -+ * If set to 1, the DRM core will provide aspect ratio information in modes. -+ * See ``DRM_MODE_FLAG_PIC_AR_*``. -+ * -+ * This capability is always supported for all drivers starting from kernel -+ * version 4.18. -+ */ -+#define DRM_CLIENT_CAP_ASPECT_RATIO 4 -+ -+/** -+ * DRM_CLIENT_CAP_WRITEBACK_CONNECTORS -+ * -+ * If set to 1, the DRM core will expose special connectors to be used for -+ * writing back to memory the scene setup in the commit. The client must enable -+ * &DRM_CLIENT_CAP_ATOMIC first. -+ * -+ * This capability is always supported for atomic-capable drivers starting from -+ * kernel version 4.19. -+ */ -+#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5 -+ -+/* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ -+struct drm_set_client_cap { -+ __u64 capability; -+ __u64 value; -+}; -+ -+#define DRM_RDWR O_RDWR -+#define DRM_CLOEXEC O_CLOEXEC -+struct drm_prime_handle { -+ __u32 handle; -+ -+ /** Flags.. only applicable for handle->fd */ -+ __u32 flags; -+ -+ /** Returned dmabuf file descriptor */ -+ __s32 fd; -+}; -+ -+struct drm_syncobj_create { -+ __u32 handle; -+#define DRM_SYNCOBJ_CREATE_SIGNALED (1 << 0) -+ __u32 flags; -+}; -+ -+struct drm_syncobj_destroy { -+ __u32 handle; -+ __u32 pad; -+}; -+ -+#define DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE (1 << 0) -+#define DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_EXPORT_SYNC_FILE (1 << 0) -+struct drm_syncobj_handle { -+ __u32 handle; -+ __u32 flags; -+ -+ __s32 fd; -+ __u32 pad; -+}; -+ -+struct drm_syncobj_transfer { -+ __u32 src_handle; -+ __u32 dst_handle; -+ __u64 src_point; -+ __u64 dst_point; -+ __u32 flags; -+ __u32 pad; -+}; -+ -+#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0) -+#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1) -+#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE (1 << 2) /* wait for time point to become available */ -+struct drm_syncobj_wait { -+ __u64 handles; -+ /* absolute timeout */ -+ __s64 timeout_nsec; -+ __u32 count_handles; -+ __u32 flags; -+ __u32 first_signaled; /* only valid when not waiting all */ -+ __u32 pad; -+}; -+ -+struct drm_syncobj_timeline_wait { -+ __u64 handles; -+ /* wait on specific timeline point for every handles*/ -+ __u64 points; -+ /* absolute timeout */ -+ __s64 timeout_nsec; -+ __u32 count_handles; -+ __u32 flags; -+ __u32 first_signaled; /* only valid when not waiting all */ -+ __u32 pad; -+}; -+ -+ -+struct drm_syncobj_array { -+ __u64 handles; -+ __u32 count_handles; -+ __u32 pad; -+}; -+ -+#define DRM_SYNCOBJ_QUERY_FLAGS_LAST_SUBMITTED (1 << 0) /* last available point on timeline syncobj */ -+struct drm_syncobj_timeline_array { -+ __u64 handles; -+ __u64 points; -+ __u32 count_handles; -+ __u32 flags; -+}; -+ -+ -+/* Query current scanout sequence number */ -+struct drm_crtc_get_sequence { -+ __u32 crtc_id; /* requested crtc_id */ -+ __u32 active; /* return: crtc output is active */ -+ __u64 sequence; /* return: most recent vblank sequence */ -+ __s64 sequence_ns; /* return: most recent time of first pixel out */ -+}; -+ -+/* Queue event to be delivered at specified sequence. Time stamp marks -+ * when the first pixel of the refresh cycle leaves the display engine -+ * for the display -+ */ -+#define DRM_CRTC_SEQUENCE_RELATIVE 0x00000001 /* sequence is relative to current */ -+#define DRM_CRTC_SEQUENCE_NEXT_ON_MISS 0x00000002 /* Use next sequence if we've missed */ -+ -+struct drm_crtc_queue_sequence { -+ __u32 crtc_id; -+ __u32 flags; -+ __u64 sequence; /* on input, target sequence. on output, actual sequence */ -+ __u64 user_data; /* user data passed to event */ -+}; -+ -+#if defined(__cplusplus) -+} -+#endif -+ -+#include "drm_mode.h" -+ -+#if defined(__cplusplus) -+extern "C" { -+#endif -+ -+#define DRM_IOCTL_BASE 'd' -+#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr) -+#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type) -+#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type) -+#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type) -+ -+#define DRM_IOCTL_VERSION DRM_IOWR(0x00, struct drm_version) -+#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, struct drm_unique) -+#define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, struct drm_auth) -+#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, struct drm_irq_busid) -+#define DRM_IOCTL_GET_MAP DRM_IOWR(0x04, struct drm_map) -+#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client) -+#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats) -+#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version) -+#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl) -+#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close) -+#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink) -+#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open) -+#define DRM_IOCTL_GET_CAP DRM_IOWR(0x0c, struct drm_get_cap) -+#define DRM_IOCTL_SET_CLIENT_CAP DRM_IOW( 0x0d, struct drm_set_client_cap) -+ -+#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique) -+#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth) -+#define DRM_IOCTL_BLOCK DRM_IOWR(0x12, struct drm_block) -+#define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, struct drm_block) -+#define DRM_IOCTL_CONTROL DRM_IOW( 0x14, struct drm_control) -+#define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, struct drm_map) -+#define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, struct drm_buf_desc) -+#define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, struct drm_buf_desc) -+#define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, struct drm_buf_info) -+#define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, struct drm_buf_map) -+#define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, struct drm_buf_free) -+ -+#define DRM_IOCTL_RM_MAP DRM_IOW( 0x1b, struct drm_map) -+ -+#define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, struct drm_ctx_priv_map) -+#define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, struct drm_ctx_priv_map) -+ -+#define DRM_IOCTL_SET_MASTER DRM_IO(0x1e) -+#define DRM_IOCTL_DROP_MASTER DRM_IO(0x1f) -+ -+#define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, struct drm_ctx) -+#define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, struct drm_ctx) -+#define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, struct drm_ctx) -+#define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, struct drm_ctx) -+#define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, struct drm_ctx) -+#define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, struct drm_ctx) -+#define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, struct drm_ctx_res) -+#define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, struct drm_draw) -+#define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, struct drm_draw) -+#define DRM_IOCTL_DMA DRM_IOWR(0x29, struct drm_dma) -+#define DRM_IOCTL_LOCK DRM_IOW( 0x2a, struct drm_lock) -+#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock) -+#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock) -+ -+#define DRM_IOCTL_PRIME_HANDLE_TO_FD DRM_IOWR(0x2d, struct drm_prime_handle) -+#define DRM_IOCTL_PRIME_FD_TO_HANDLE DRM_IOWR(0x2e, struct drm_prime_handle) -+ -+#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30) -+#define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31) -+#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode) -+#define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, struct drm_agp_info) -+#define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, struct drm_agp_buffer) -+#define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, struct drm_agp_buffer) -+#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding) -+#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding) -+ -+#define DRM_IOCTL_SG_ALLOC DRM_IOWR(0x38, struct drm_scatter_gather) -+#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather) -+ -+#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank) -+ -+#define DRM_IOCTL_CRTC_GET_SEQUENCE DRM_IOWR(0x3b, struct drm_crtc_get_sequence) -+#define DRM_IOCTL_CRTC_QUEUE_SEQUENCE DRM_IOWR(0x3c, struct drm_crtc_queue_sequence) -+ -+#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw) -+ -+#define DRM_IOCTL_MODE_GETRESOURCES DRM_IOWR(0xA0, struct drm_mode_card_res) -+#define DRM_IOCTL_MODE_GETCRTC DRM_IOWR(0xA1, struct drm_mode_crtc) -+#define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA2, struct drm_mode_crtc) -+#define DRM_IOCTL_MODE_CURSOR DRM_IOWR(0xA3, struct drm_mode_cursor) -+#define DRM_IOCTL_MODE_GETGAMMA DRM_IOWR(0xA4, struct drm_mode_crtc_lut) -+#define DRM_IOCTL_MODE_SETGAMMA DRM_IOWR(0xA5, struct drm_mode_crtc_lut) -+#define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xA6, struct drm_mode_get_encoder) -+#define DRM_IOCTL_MODE_GETCONNECTOR DRM_IOWR(0xA7, struct drm_mode_get_connector) -+#define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA8, struct drm_mode_mode_cmd) /* deprecated (never worked) */ -+#define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd) /* deprecated (never worked) */ -+ -+#define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAA, struct drm_mode_get_property) -+#define DRM_IOCTL_MODE_SETPROPERTY DRM_IOWR(0xAB, struct drm_mode_connector_set_property) -+#define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, struct drm_mode_get_blob) -+#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd) -+#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd) -+/** -+ * DRM_IOCTL_MODE_RMFB - Remove a framebuffer. -+ * -+ * This removes a framebuffer previously added via ADDFB/ADDFB2. The IOCTL -+ * argument is a framebuffer object ID. -+ * -+ * Warning: removing a framebuffer currently in-use on an enabled plane will -+ * disable that plane. The CRTC the plane is linked to may also be disabled -+ * (depending on driver capabilities). -+ */ -+#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int) -+#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip) -+#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd) -+ -+#define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb) -+#define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, struct drm_mode_map_dumb) -+#define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, struct drm_mode_destroy_dumb) -+#define DRM_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xB5, struct drm_mode_get_plane_res) -+#define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane) -+#define DRM_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct drm_mode_set_plane) -+#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2) -+#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties) -+#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property) -+#define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2) -+#define DRM_IOCTL_MODE_ATOMIC DRM_IOWR(0xBC, struct drm_mode_atomic) -+#define DRM_IOCTL_MODE_CREATEPROPBLOB DRM_IOWR(0xBD, struct drm_mode_create_blob) -+#define DRM_IOCTL_MODE_DESTROYPROPBLOB DRM_IOWR(0xBE, struct drm_mode_destroy_blob) -+ -+#define DRM_IOCTL_SYNCOBJ_CREATE DRM_IOWR(0xBF, struct drm_syncobj_create) -+#define DRM_IOCTL_SYNCOBJ_DESTROY DRM_IOWR(0xC0, struct drm_syncobj_destroy) -+#define DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD DRM_IOWR(0xC1, struct drm_syncobj_handle) -+#define DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE DRM_IOWR(0xC2, struct drm_syncobj_handle) -+#define DRM_IOCTL_SYNCOBJ_WAIT DRM_IOWR(0xC3, struct drm_syncobj_wait) -+#define DRM_IOCTL_SYNCOBJ_RESET DRM_IOWR(0xC4, struct drm_syncobj_array) -+#define DRM_IOCTL_SYNCOBJ_SIGNAL DRM_IOWR(0xC5, struct drm_syncobj_array) -+ -+#define DRM_IOCTL_MODE_CREATE_LEASE DRM_IOWR(0xC6, struct drm_mode_create_lease) -+#define DRM_IOCTL_MODE_LIST_LESSEES DRM_IOWR(0xC7, struct drm_mode_list_lessees) -+#define DRM_IOCTL_MODE_GET_LEASE DRM_IOWR(0xC8, struct drm_mode_get_lease) -+#define DRM_IOCTL_MODE_REVOKE_LEASE DRM_IOWR(0xC9, struct drm_mode_revoke_lease) -+ -+#define DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT DRM_IOWR(0xCA, struct drm_syncobj_timeline_wait) -+#define DRM_IOCTL_SYNCOBJ_QUERY DRM_IOWR(0xCB, struct drm_syncobj_timeline_array) -+#define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer) -+#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct drm_syncobj_timeline_array) -+ -+#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2) -+ -+/* -+ * Device specific ioctls should only be in their respective headers -+ * The device specific ioctl range is from 0x40 to 0x9f. -+ * Generic IOCTLS restart at 0xA0. -+ * -+ * \sa drmCommandNone(), drmCommandRead(), drmCommandWrite(), and -+ * drmCommandReadWrite(). -+ */ -+#define DRM_COMMAND_BASE 0x40 -+#define DRM_COMMAND_END 0xA0 -+ -+/* -+ * Header for events written back to userspace on the drm fd. The -+ * type defines the type of event, the length specifies the total -+ * length of the event (including the header), and user_data is -+ * typically a 64 bit value passed with the ioctl that triggered the -+ * event. A read on the drm fd will always only return complete -+ * events, that is, if for example the read buffer is 100 bytes, and -+ * there are two 64 byte events pending, only one will be returned. -+ * -+ * Event types 0 - 0x7fffffff are generic drm events, 0x80000000 and -+ * up are chipset specific. -+ */ -+struct drm_event { -+ __u32 type; -+ __u32 length; -+}; -+ -+#define DRM_EVENT_VBLANK 0x01 -+#define DRM_EVENT_FLIP_COMPLETE 0x02 -+#define DRM_EVENT_CRTC_SEQUENCE 0x03 -+ -+struct drm_event_vblank { -+ struct drm_event base; -+ __u64 user_data; -+ __u32 tv_sec; -+ __u32 tv_usec; -+ __u32 sequence; -+ __u32 crtc_id; /* 0 on older kernels that do not support this */ -+}; -+ -+/* Event delivered at sequence. Time stamp marks when the first pixel -+ * of the refresh cycle leaves the display engine for the display -+ */ -+struct drm_event_crtc_sequence { -+ struct drm_event base; -+ __u64 user_data; -+ __s64 time_ns; -+ __u64 sequence; -+}; -+ -+/* typedef area */ -+typedef struct drm_clip_rect drm_clip_rect_t; -+typedef struct drm_drawable_info drm_drawable_info_t; -+typedef struct drm_tex_region drm_tex_region_t; -+typedef struct drm_hw_lock drm_hw_lock_t; -+typedef struct drm_version drm_version_t; -+typedef struct drm_unique drm_unique_t; -+typedef struct drm_list drm_list_t; -+typedef struct drm_block drm_block_t; -+typedef struct drm_control drm_control_t; -+typedef enum drm_map_type drm_map_type_t; -+typedef enum drm_map_flags drm_map_flags_t; -+typedef struct drm_ctx_priv_map drm_ctx_priv_map_t; -+typedef struct drm_map drm_map_t; -+typedef struct drm_client drm_client_t; -+typedef enum drm_stat_type drm_stat_type_t; -+typedef struct drm_stats drm_stats_t; -+typedef enum drm_lock_flags drm_lock_flags_t; -+typedef struct drm_lock drm_lock_t; -+typedef enum drm_dma_flags drm_dma_flags_t; -+typedef struct drm_buf_desc drm_buf_desc_t; -+typedef struct drm_buf_info drm_buf_info_t; -+typedef struct drm_buf_free drm_buf_free_t; -+typedef struct drm_buf_pub drm_buf_pub_t; -+typedef struct drm_buf_map drm_buf_map_t; -+typedef struct drm_dma drm_dma_t; -+typedef union drm_wait_vblank drm_wait_vblank_t; -+typedef struct drm_agp_mode drm_agp_mode_t; -+typedef enum drm_ctx_flags drm_ctx_flags_t; -+typedef struct drm_ctx drm_ctx_t; -+typedef struct drm_ctx_res drm_ctx_res_t; -+typedef struct drm_draw drm_draw_t; -+typedef struct drm_update_draw drm_update_draw_t; -+typedef struct drm_auth drm_auth_t; -+typedef struct drm_irq_busid drm_irq_busid_t; -+typedef enum drm_vblank_seq_type drm_vblank_seq_type_t; -+ -+typedef struct drm_agp_buffer drm_agp_buffer_t; -+typedef struct drm_agp_binding drm_agp_binding_t; -+typedef struct drm_agp_info drm_agp_info_t; -+typedef struct drm_scatter_gather drm_scatter_gather_t; -+typedef struct drm_set_version drm_set_version_t; -+ -+#if defined(__cplusplus) -+} -+#endif -+ -+#endif -diff -up firefox-103.0/third_party/drm/drm/drm_mode.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/drm/drm/drm_mode.h ---- firefox-103.0/third_party/drm/drm/drm_mode.h.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.318409017 +0200 -+++ firefox-103.0/third_party/drm/drm/drm_mode.h 2022-07-28 11:45:30.317409023 +0200 -@@ -0,0 +1,1217 @@ -+/* -+ * Copyright (c) 2007 Dave Airlie -+ * Copyright (c) 2007 Jakob Bornecrantz -+ * Copyright (c) 2008 Red Hat Inc. -+ * Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA -+ * Copyright (c) 2007-2008 Intel Corporation -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -+ * IN THE SOFTWARE. -+ */ -+ -+#ifndef _DRM_MODE_H -+#define _DRM_MODE_H -+ -+#include "drm.h" -+ -+#if defined(__cplusplus) -+extern "C" { -+#endif -+ -+/** -+ * DOC: overview -+ * -+ * DRM exposes many UAPI and structure definition to have a consistent -+ * and standardized interface with user. -+ * Userspace can refer to these structure definitions and UAPI formats -+ * to communicate to driver -+ */ -+ -+#define DRM_CONNECTOR_NAME_LEN 32 -+#define DRM_DISPLAY_MODE_LEN 32 -+#define DRM_PROP_NAME_LEN 32 -+ -+#define DRM_MODE_TYPE_BUILTIN (1<<0) /* deprecated */ -+#define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN) /* deprecated */ -+#define DRM_MODE_TYPE_CRTC_C ((1<<2) | DRM_MODE_TYPE_BUILTIN) /* deprecated */ -+#define DRM_MODE_TYPE_PREFERRED (1<<3) -+#define DRM_MODE_TYPE_DEFAULT (1<<4) /* deprecated */ -+#define DRM_MODE_TYPE_USERDEF (1<<5) -+#define DRM_MODE_TYPE_DRIVER (1<<6) -+ -+#define DRM_MODE_TYPE_ALL (DRM_MODE_TYPE_PREFERRED | \ -+ DRM_MODE_TYPE_USERDEF | \ -+ DRM_MODE_TYPE_DRIVER) -+ -+/* Video mode flags */ -+/* bit compatible with the xrandr RR_ definitions (bits 0-13) -+ * -+ * ABI warning: Existing userspace really expects -+ * the mode flags to match the xrandr definitions. Any -+ * changes that don't match the xrandr definitions will -+ * likely need a new client cap or some other mechanism -+ * to avoid breaking existing userspace. This includes -+ * allocating new flags in the previously unused bits! -+ */ -+#define DRM_MODE_FLAG_PHSYNC (1<<0) -+#define DRM_MODE_FLAG_NHSYNC (1<<1) -+#define DRM_MODE_FLAG_PVSYNC (1<<2) -+#define DRM_MODE_FLAG_NVSYNC (1<<3) -+#define DRM_MODE_FLAG_INTERLACE (1<<4) -+#define DRM_MODE_FLAG_DBLSCAN (1<<5) -+#define DRM_MODE_FLAG_CSYNC (1<<6) -+#define DRM_MODE_FLAG_PCSYNC (1<<7) -+#define DRM_MODE_FLAG_NCSYNC (1<<8) -+#define DRM_MODE_FLAG_HSKEW (1<<9) /* hskew provided */ -+#define DRM_MODE_FLAG_BCAST (1<<10) /* deprecated */ -+#define DRM_MODE_FLAG_PIXMUX (1<<11) /* deprecated */ -+#define DRM_MODE_FLAG_DBLCLK (1<<12) -+#define DRM_MODE_FLAG_CLKDIV2 (1<<13) -+ /* -+ * When adding a new stereo mode don't forget to adjust DRM_MODE_FLAGS_3D_MAX -+ * (define not exposed to user space). -+ */ -+#define DRM_MODE_FLAG_3D_MASK (0x1f<<14) -+#define DRM_MODE_FLAG_3D_NONE (0<<14) -+#define DRM_MODE_FLAG_3D_FRAME_PACKING (1<<14) -+#define DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE (2<<14) -+#define DRM_MODE_FLAG_3D_LINE_ALTERNATIVE (3<<14) -+#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL (4<<14) -+#define DRM_MODE_FLAG_3D_L_DEPTH (5<<14) -+#define DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH (6<<14) -+#define DRM_MODE_FLAG_3D_TOP_AND_BOTTOM (7<<14) -+#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF (8<<14) -+ -+/* Picture aspect ratio options */ -+#define DRM_MODE_PICTURE_ASPECT_NONE 0 -+#define DRM_MODE_PICTURE_ASPECT_4_3 1 -+#define DRM_MODE_PICTURE_ASPECT_16_9 2 -+#define DRM_MODE_PICTURE_ASPECT_64_27 3 -+#define DRM_MODE_PICTURE_ASPECT_256_135 4 -+ -+/* Content type options */ -+#define DRM_MODE_CONTENT_TYPE_NO_DATA 0 -+#define DRM_MODE_CONTENT_TYPE_GRAPHICS 1 -+#define DRM_MODE_CONTENT_TYPE_PHOTO 2 -+#define DRM_MODE_CONTENT_TYPE_CINEMA 3 -+#define DRM_MODE_CONTENT_TYPE_GAME 4 -+ -+/* Aspect ratio flag bitmask (4 bits 22:19) */ -+#define DRM_MODE_FLAG_PIC_AR_MASK (0x0F<<19) -+#define DRM_MODE_FLAG_PIC_AR_NONE \ -+ (DRM_MODE_PICTURE_ASPECT_NONE<<19) -+#define DRM_MODE_FLAG_PIC_AR_4_3 \ -+ (DRM_MODE_PICTURE_ASPECT_4_3<<19) -+#define DRM_MODE_FLAG_PIC_AR_16_9 \ -+ (DRM_MODE_PICTURE_ASPECT_16_9<<19) -+#define DRM_MODE_FLAG_PIC_AR_64_27 \ -+ (DRM_MODE_PICTURE_ASPECT_64_27<<19) -+#define DRM_MODE_FLAG_PIC_AR_256_135 \ -+ (DRM_MODE_PICTURE_ASPECT_256_135<<19) -+ -+#define DRM_MODE_FLAG_ALL (DRM_MODE_FLAG_PHSYNC | \ -+ DRM_MODE_FLAG_NHSYNC | \ -+ DRM_MODE_FLAG_PVSYNC | \ -+ DRM_MODE_FLAG_NVSYNC | \ -+ DRM_MODE_FLAG_INTERLACE | \ -+ DRM_MODE_FLAG_DBLSCAN | \ -+ DRM_MODE_FLAG_CSYNC | \ -+ DRM_MODE_FLAG_PCSYNC | \ -+ DRM_MODE_FLAG_NCSYNC | \ -+ DRM_MODE_FLAG_HSKEW | \ -+ DRM_MODE_FLAG_DBLCLK | \ -+ DRM_MODE_FLAG_CLKDIV2 | \ -+ DRM_MODE_FLAG_3D_MASK) -+ -+/* DPMS flags */ -+/* bit compatible with the xorg definitions. */ -+#define DRM_MODE_DPMS_ON 0 -+#define DRM_MODE_DPMS_STANDBY 1 -+#define DRM_MODE_DPMS_SUSPEND 2 -+#define DRM_MODE_DPMS_OFF 3 -+ -+/* Scaling mode options */ -+#define DRM_MODE_SCALE_NONE 0 /* Unmodified timing (display or -+ software can still scale) */ -+#define DRM_MODE_SCALE_FULLSCREEN 1 /* Full screen, ignore aspect */ -+#define DRM_MODE_SCALE_CENTER 2 /* Centered, no scaling */ -+#define DRM_MODE_SCALE_ASPECT 3 /* Full screen, preserve aspect */ -+ -+/* Dithering mode options */ -+#define DRM_MODE_DITHERING_OFF 0 -+#define DRM_MODE_DITHERING_ON 1 -+#define DRM_MODE_DITHERING_AUTO 2 -+ -+/* Dirty info options */ -+#define DRM_MODE_DIRTY_OFF 0 -+#define DRM_MODE_DIRTY_ON 1 -+#define DRM_MODE_DIRTY_ANNOTATE 2 -+ -+/* Link Status options */ -+#define DRM_MODE_LINK_STATUS_GOOD 0 -+#define DRM_MODE_LINK_STATUS_BAD 1 -+ -+/* -+ * DRM_MODE_ROTATE_ -+ * -+ * Signals that a drm plane is been rotated degrees in counter -+ * clockwise direction. -+ * -+ * This define is provided as a convenience, looking up the property id -+ * using the name->prop id lookup is the preferred method. -+ */ -+#define DRM_MODE_ROTATE_0 (1<<0) -+#define DRM_MODE_ROTATE_90 (1<<1) -+#define DRM_MODE_ROTATE_180 (1<<2) -+#define DRM_MODE_ROTATE_270 (1<<3) -+ -+/* -+ * DRM_MODE_ROTATE_MASK -+ * -+ * Bitmask used to look for drm plane rotations. -+ */ -+#define DRM_MODE_ROTATE_MASK (\ -+ DRM_MODE_ROTATE_0 | \ -+ DRM_MODE_ROTATE_90 | \ -+ DRM_MODE_ROTATE_180 | \ -+ DRM_MODE_ROTATE_270) -+ -+/* -+ * DRM_MODE_REFLECT_ -+ * -+ * Signals that the contents of a drm plane is reflected along the axis, -+ * in the same way as mirroring. -+ * See kerneldoc chapter "Plane Composition Properties" for more details. -+ * -+ * This define is provided as a convenience, looking up the property id -+ * using the name->prop id lookup is the preferred method. -+ */ -+#define DRM_MODE_REFLECT_X (1<<4) -+#define DRM_MODE_REFLECT_Y (1<<5) -+ -+/* -+ * DRM_MODE_REFLECT_MASK -+ * -+ * Bitmask used to look for drm plane reflections. -+ */ -+#define DRM_MODE_REFLECT_MASK (\ -+ DRM_MODE_REFLECT_X | \ -+ DRM_MODE_REFLECT_Y) -+ -+/* Content Protection Flags */ -+#define DRM_MODE_CONTENT_PROTECTION_UNDESIRED 0 -+#define DRM_MODE_CONTENT_PROTECTION_DESIRED 1 -+#define DRM_MODE_CONTENT_PROTECTION_ENABLED 2 -+ -+/** -+ * struct drm_mode_modeinfo - Display mode information. -+ * @clock: pixel clock in kHz -+ * @hdisplay: horizontal display size -+ * @hsync_start: horizontal sync start -+ * @hsync_end: horizontal sync end -+ * @htotal: horizontal total size -+ * @hskew: horizontal skew -+ * @vdisplay: vertical display size -+ * @vsync_start: vertical sync start -+ * @vsync_end: vertical sync end -+ * @vtotal: vertical total size -+ * @vscan: vertical scan -+ * @vrefresh: approximate vertical refresh rate in Hz -+ * @flags: bitmask of misc. flags, see DRM_MODE_FLAG_* defines -+ * @type: bitmask of type flags, see DRM_MODE_TYPE_* defines -+ * @name: string describing the mode resolution -+ * -+ * This is the user-space API display mode information structure. For the -+ * kernel version see struct drm_display_mode. -+ */ -+struct drm_mode_modeinfo { -+ __u32 clock; -+ __u16 hdisplay; -+ __u16 hsync_start; -+ __u16 hsync_end; -+ __u16 htotal; -+ __u16 hskew; -+ __u16 vdisplay; -+ __u16 vsync_start; -+ __u16 vsync_end; -+ __u16 vtotal; -+ __u16 vscan; -+ -+ __u32 vrefresh; -+ -+ __u32 flags; -+ __u32 type; -+ char name[DRM_DISPLAY_MODE_LEN]; -+}; -+ -+struct drm_mode_card_res { -+ __u64 fb_id_ptr; -+ __u64 crtc_id_ptr; -+ __u64 connector_id_ptr; -+ __u64 encoder_id_ptr; -+ __u32 count_fbs; -+ __u32 count_crtcs; -+ __u32 count_connectors; -+ __u32 count_encoders; -+ __u32 min_width; -+ __u32 max_width; -+ __u32 min_height; -+ __u32 max_height; -+}; -+ -+struct drm_mode_crtc { -+ __u64 set_connectors_ptr; -+ __u32 count_connectors; -+ -+ __u32 crtc_id; /**< Id */ -+ __u32 fb_id; /**< Id of framebuffer */ -+ -+ __u32 x; /**< x Position on the framebuffer */ -+ __u32 y; /**< y Position on the framebuffer */ -+ -+ __u32 gamma_size; -+ __u32 mode_valid; -+ struct drm_mode_modeinfo mode; -+}; -+ -+#define DRM_MODE_PRESENT_TOP_FIELD (1<<0) -+#define DRM_MODE_PRESENT_BOTTOM_FIELD (1<<1) -+ -+/* Planes blend with or override other bits on the CRTC */ -+struct drm_mode_set_plane { -+ __u32 plane_id; -+ __u32 crtc_id; -+ __u32 fb_id; /* fb object contains surface format type */ -+ __u32 flags; /* see above flags */ -+ -+ /* Signed dest location allows it to be partially off screen */ -+ __s32 crtc_x; -+ __s32 crtc_y; -+ __u32 crtc_w; -+ __u32 crtc_h; -+ -+ /* Source values are 16.16 fixed point */ -+ __u32 src_x; -+ __u32 src_y; -+ __u32 src_h; -+ __u32 src_w; -+}; -+ -+/** -+ * struct drm_mode_get_plane - Get plane metadata. -+ * -+ * Userspace can perform a GETPLANE ioctl to retrieve information about a -+ * plane. -+ * -+ * To retrieve the number of formats supported, set @count_format_types to zero -+ * and call the ioctl. @count_format_types will be updated with the value. -+ * -+ * To retrieve these formats, allocate an array with the memory needed to store -+ * @count_format_types formats. Point @format_type_ptr to this array and call -+ * the ioctl again (with @count_format_types still set to the value returned in -+ * the first ioctl call). -+ */ -+struct drm_mode_get_plane { -+ /** -+ * @plane_id: Object ID of the plane whose information should be -+ * retrieved. Set by caller. -+ */ -+ __u32 plane_id; -+ -+ /** @crtc_id: Object ID of the current CRTC. */ -+ __u32 crtc_id; -+ /** @fb_id: Object ID of the current fb. */ -+ __u32 fb_id; -+ -+ /** -+ * @possible_crtcs: Bitmask of CRTC's compatible with the plane. CRTC's -+ * are created and they receive an index, which corresponds to their -+ * position in the bitmask. Bit N corresponds to -+ * :ref:`CRTC index` N. -+ */ -+ __u32 possible_crtcs; -+ /** @gamma_size: Never used. */ -+ __u32 gamma_size; -+ -+ /** @count_format_types: Number of formats. */ -+ __u32 count_format_types; -+ /** -+ * @format_type_ptr: Pointer to ``__u32`` array of formats that are -+ * supported by the plane. These formats do not require modifiers. -+ */ -+ __u64 format_type_ptr; -+}; -+ -+struct drm_mode_get_plane_res { -+ __u64 plane_id_ptr; -+ __u32 count_planes; -+}; -+ -+#define DRM_MODE_ENCODER_NONE 0 -+#define DRM_MODE_ENCODER_DAC 1 -+#define DRM_MODE_ENCODER_TMDS 2 -+#define DRM_MODE_ENCODER_LVDS 3 -+#define DRM_MODE_ENCODER_TVDAC 4 -+#define DRM_MODE_ENCODER_VIRTUAL 5 -+#define DRM_MODE_ENCODER_DSI 6 -+#define DRM_MODE_ENCODER_DPMST 7 -+#define DRM_MODE_ENCODER_DPI 8 -+ -+struct drm_mode_get_encoder { -+ __u32 encoder_id; -+ __u32 encoder_type; -+ -+ __u32 crtc_id; /**< Id of crtc */ -+ -+ __u32 possible_crtcs; -+ __u32 possible_clones; -+}; -+ -+/* This is for connectors with multiple signal types. */ -+/* Try to match DRM_MODE_CONNECTOR_X as closely as possible. */ -+enum drm_mode_subconnector { -+ DRM_MODE_SUBCONNECTOR_Automatic = 0, /* DVI-I, TV */ -+ DRM_MODE_SUBCONNECTOR_Unknown = 0, /* DVI-I, TV, DP */ -+ DRM_MODE_SUBCONNECTOR_VGA = 1, /* DP */ -+ DRM_MODE_SUBCONNECTOR_DVID = 3, /* DVI-I DP */ -+ DRM_MODE_SUBCONNECTOR_DVIA = 4, /* DVI-I */ -+ DRM_MODE_SUBCONNECTOR_Composite = 5, /* TV */ -+ DRM_MODE_SUBCONNECTOR_SVIDEO = 6, /* TV */ -+ DRM_MODE_SUBCONNECTOR_Component = 8, /* TV */ -+ DRM_MODE_SUBCONNECTOR_SCART = 9, /* TV */ -+ DRM_MODE_SUBCONNECTOR_DisplayPort = 10, /* DP */ -+ DRM_MODE_SUBCONNECTOR_HDMIA = 11, /* DP */ -+ DRM_MODE_SUBCONNECTOR_Native = 15, /* DP */ -+ DRM_MODE_SUBCONNECTOR_Wireless = 18, /* DP */ -+}; -+ -+#define DRM_MODE_CONNECTOR_Unknown 0 -+#define DRM_MODE_CONNECTOR_VGA 1 -+#define DRM_MODE_CONNECTOR_DVII 2 -+#define DRM_MODE_CONNECTOR_DVID 3 -+#define DRM_MODE_CONNECTOR_DVIA 4 -+#define DRM_MODE_CONNECTOR_Composite 5 -+#define DRM_MODE_CONNECTOR_SVIDEO 6 -+#define DRM_MODE_CONNECTOR_LVDS 7 -+#define DRM_MODE_CONNECTOR_Component 8 -+#define DRM_MODE_CONNECTOR_9PinDIN 9 -+#define DRM_MODE_CONNECTOR_DisplayPort 10 -+#define DRM_MODE_CONNECTOR_HDMIA 11 -+#define DRM_MODE_CONNECTOR_HDMIB 12 -+#define DRM_MODE_CONNECTOR_TV 13 -+#define DRM_MODE_CONNECTOR_eDP 14 -+#define DRM_MODE_CONNECTOR_VIRTUAL 15 -+#define DRM_MODE_CONNECTOR_DSI 16 -+#define DRM_MODE_CONNECTOR_DPI 17 -+#define DRM_MODE_CONNECTOR_WRITEBACK 18 -+#define DRM_MODE_CONNECTOR_SPI 19 -+#define DRM_MODE_CONNECTOR_USB 20 -+ -+/** -+ * struct drm_mode_get_connector - Get connector metadata. -+ * -+ * User-space can perform a GETCONNECTOR ioctl to retrieve information about a -+ * connector. User-space is expected to retrieve encoders, modes and properties -+ * by performing this ioctl at least twice: the first time to retrieve the -+ * number of elements, the second time to retrieve the elements themselves. -+ * -+ * To retrieve the number of elements, set @count_props and @count_encoders to -+ * zero, set @count_modes to 1, and set @modes_ptr to a temporary struct -+ * drm_mode_modeinfo element. -+ * -+ * To retrieve the elements, allocate arrays for @encoders_ptr, @modes_ptr, -+ * @props_ptr and @prop_values_ptr, then set @count_modes, @count_props and -+ * @count_encoders to their capacity. -+ * -+ * Performing the ioctl only twice may be racy: the number of elements may have -+ * changed with a hotplug event in-between the two ioctls. User-space is -+ * expected to retry the last ioctl until the number of elements stabilizes. -+ * The kernel won't fill any array which doesn't have the expected length. -+ * -+ * **Force-probing a connector** -+ * -+ * If the @count_modes field is set to zero and the DRM client is the current -+ * DRM master, the kernel will perform a forced probe on the connector to -+ * refresh the connector status, modes and EDID. A forced-probe can be slow, -+ * might cause flickering and the ioctl will block. -+ * -+ * User-space needs to force-probe connectors to ensure their metadata is -+ * up-to-date at startup and after receiving a hot-plug event. User-space -+ * may perform a forced-probe when the user explicitly requests it. User-space -+ * shouldn't perform a forced-probe in other situations. -+ */ -+struct drm_mode_get_connector { -+ /** @encoders_ptr: Pointer to ``__u32`` array of object IDs. */ -+ __u64 encoders_ptr; -+ /** @modes_ptr: Pointer to struct drm_mode_modeinfo array. */ -+ __u64 modes_ptr; -+ /** @props_ptr: Pointer to ``__u32`` array of property IDs. */ -+ __u64 props_ptr; -+ /** @prop_values_ptr: Pointer to ``__u64`` array of property values. */ -+ __u64 prop_values_ptr; -+ -+ /** @count_modes: Number of modes. */ -+ __u32 count_modes; -+ /** @count_props: Number of properties. */ -+ __u32 count_props; -+ /** @count_encoders: Number of encoders. */ -+ __u32 count_encoders; -+ -+ /** @encoder_id: Object ID of the current encoder. */ -+ __u32 encoder_id; -+ /** @connector_id: Object ID of the connector. */ -+ __u32 connector_id; -+ /** -+ * @connector_type: Type of the connector. -+ * -+ * See DRM_MODE_CONNECTOR_* defines. -+ */ -+ __u32 connector_type; -+ /** -+ * @connector_type_id: Type-specific connector number. -+ * -+ * This is not an object ID. This is a per-type connector number. Each -+ * (type, type_id) combination is unique across all connectors of a DRM -+ * device. -+ */ -+ __u32 connector_type_id; -+ -+ /** -+ * @connection: Status of the connector. -+ * -+ * See enum drm_connector_status. -+ */ -+ __u32 connection; -+ /** @mm_width: Width of the connected sink in millimeters. */ -+ __u32 mm_width; -+ /** @mm_height: Height of the connected sink in millimeters. */ -+ __u32 mm_height; -+ /** -+ * @subpixel: Subpixel order of the connected sink. -+ * -+ * See enum subpixel_order. -+ */ -+ __u32 subpixel; -+ -+ /** @pad: Padding, must be zero. */ -+ __u32 pad; -+}; -+ -+#define DRM_MODE_PROP_PENDING (1<<0) /* deprecated, do not use */ -+#define DRM_MODE_PROP_RANGE (1<<1) -+#define DRM_MODE_PROP_IMMUTABLE (1<<2) -+#define DRM_MODE_PROP_ENUM (1<<3) /* enumerated type with text strings */ -+#define DRM_MODE_PROP_BLOB (1<<4) -+#define DRM_MODE_PROP_BITMASK (1<<5) /* bitmask of enumerated types */ -+ -+/* non-extended types: legacy bitmask, one bit per type: */ -+#define DRM_MODE_PROP_LEGACY_TYPE ( \ -+ DRM_MODE_PROP_RANGE | \ -+ DRM_MODE_PROP_ENUM | \ -+ DRM_MODE_PROP_BLOB | \ -+ DRM_MODE_PROP_BITMASK) -+ -+/* extended-types: rather than continue to consume a bit per type, -+ * grab a chunk of the bits to use as integer type id. -+ */ -+#define DRM_MODE_PROP_EXTENDED_TYPE 0x0000ffc0 -+#define DRM_MODE_PROP_TYPE(n) ((n) << 6) -+#define DRM_MODE_PROP_OBJECT DRM_MODE_PROP_TYPE(1) -+#define DRM_MODE_PROP_SIGNED_RANGE DRM_MODE_PROP_TYPE(2) -+ -+/* the PROP_ATOMIC flag is used to hide properties from userspace that -+ * is not aware of atomic properties. This is mostly to work around -+ * older userspace (DDX drivers) that read/write each prop they find, -+ * witout being aware that this could be triggering a lengthy modeset. -+ */ -+#define DRM_MODE_PROP_ATOMIC 0x80000000 -+ -+/** -+ * struct drm_mode_property_enum - Description for an enum/bitfield entry. -+ * @value: numeric value for this enum entry. -+ * @name: symbolic name for this enum entry. -+ * -+ * See struct drm_property_enum for details. -+ */ -+struct drm_mode_property_enum { -+ __u64 value; -+ char name[DRM_PROP_NAME_LEN]; -+}; -+ -+/** -+ * struct drm_mode_get_property - Get property metadata. -+ * -+ * User-space can perform a GETPROPERTY ioctl to retrieve information about a -+ * property. The same property may be attached to multiple objects, see -+ * "Modeset Base Object Abstraction". -+ * -+ * The meaning of the @values_ptr field changes depending on the property type. -+ * See &drm_property.flags for more details. -+ * -+ * The @enum_blob_ptr and @count_enum_blobs fields are only meaningful when the -+ * property has the type &DRM_MODE_PROP_ENUM or &DRM_MODE_PROP_BITMASK. For -+ * backwards compatibility, the kernel will always set @count_enum_blobs to -+ * zero when the property has the type &DRM_MODE_PROP_BLOB. User-space must -+ * ignore these two fields if the property has a different type. -+ * -+ * User-space is expected to retrieve values and enums by performing this ioctl -+ * at least twice: the first time to retrieve the number of elements, the -+ * second time to retrieve the elements themselves. -+ * -+ * To retrieve the number of elements, set @count_values and @count_enum_blobs -+ * to zero, then call the ioctl. @count_values will be updated with the number -+ * of elements. If the property has the type &DRM_MODE_PROP_ENUM or -+ * &DRM_MODE_PROP_BITMASK, @count_enum_blobs will be updated as well. -+ * -+ * To retrieve the elements themselves, allocate an array for @values_ptr and -+ * set @count_values to its capacity. If the property has the type -+ * &DRM_MODE_PROP_ENUM or &DRM_MODE_PROP_BITMASK, allocate an array for -+ * @enum_blob_ptr and set @count_enum_blobs to its capacity. Calling the ioctl -+ * again will fill the arrays. -+ */ -+struct drm_mode_get_property { -+ /** @values_ptr: Pointer to a ``__u64`` array. */ -+ __u64 values_ptr; -+ /** @enum_blob_ptr: Pointer to a struct drm_mode_property_enum array. */ -+ __u64 enum_blob_ptr; -+ -+ /** -+ * @prop_id: Object ID of the property which should be retrieved. Set -+ * by the caller. -+ */ -+ __u32 prop_id; -+ /** -+ * @flags: ``DRM_MODE_PROP_*`` bitfield. See &drm_property.flags for -+ * a definition of the flags. -+ */ -+ __u32 flags; -+ /** -+ * @name: Symbolic property name. User-space should use this field to -+ * recognize properties. -+ */ -+ char name[DRM_PROP_NAME_LEN]; -+ -+ /** @count_values: Number of elements in @values_ptr. */ -+ __u32 count_values; -+ /** @count_enum_blobs: Number of elements in @enum_blob_ptr. */ -+ __u32 count_enum_blobs; -+}; -+ -+struct drm_mode_connector_set_property { -+ __u64 value; -+ __u32 prop_id; -+ __u32 connector_id; -+}; -+ -+#define DRM_MODE_OBJECT_CRTC 0xcccccccc -+#define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0 -+#define DRM_MODE_OBJECT_ENCODER 0xe0e0e0e0 -+#define DRM_MODE_OBJECT_MODE 0xdededede -+#define DRM_MODE_OBJECT_PROPERTY 0xb0b0b0b0 -+#define DRM_MODE_OBJECT_FB 0xfbfbfbfb -+#define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb -+#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee -+#define DRM_MODE_OBJECT_ANY 0 -+ -+struct drm_mode_obj_get_properties { -+ __u64 props_ptr; -+ __u64 prop_values_ptr; -+ __u32 count_props; -+ __u32 obj_id; -+ __u32 obj_type; -+}; -+ -+struct drm_mode_obj_set_property { -+ __u64 value; -+ __u32 prop_id; -+ __u32 obj_id; -+ __u32 obj_type; -+}; -+ -+struct drm_mode_get_blob { -+ __u32 blob_id; -+ __u32 length; -+ __u64 data; -+}; -+ -+struct drm_mode_fb_cmd { -+ __u32 fb_id; -+ __u32 width; -+ __u32 height; -+ __u32 pitch; -+ __u32 bpp; -+ __u32 depth; -+ /* driver specific handle */ -+ __u32 handle; -+}; -+ -+#define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */ -+#define DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifer[] */ -+ -+struct drm_mode_fb_cmd2 { -+ __u32 fb_id; -+ __u32 width; -+ __u32 height; -+ __u32 pixel_format; /* fourcc code from drm_fourcc.h */ -+ __u32 flags; /* see above flags */ -+ -+ /* -+ * In case of planar formats, this ioctl allows up to 4 -+ * buffer objects with offsets and pitches per plane. -+ * The pitch and offset order is dictated by the fourcc, -+ * e.g. NV12 (https://fourcc.org/yuv.php#NV12) is described as: -+ * -+ * YUV 4:2:0 image with a plane of 8 bit Y samples -+ * followed by an interleaved U/V plane containing -+ * 8 bit 2x2 subsampled colour difference samples. -+ * -+ * So it would consist of Y as offsets[0] and UV as -+ * offsets[1]. Note that offsets[0] will generally -+ * be 0 (but this is not required). -+ * -+ * To accommodate tiled, compressed, etc formats, a -+ * modifier can be specified. The default value of zero -+ * indicates "native" format as specified by the fourcc. -+ * Vendor specific modifier token. Note that even though -+ * it looks like we have a modifier per-plane, we in fact -+ * do not. The modifier for each plane must be identical. -+ * Thus all combinations of different data layouts for -+ * multi plane formats must be enumerated as separate -+ * modifiers. -+ */ -+ __u32 handles[4]; -+ __u32 pitches[4]; /* pitch for each plane */ -+ __u32 offsets[4]; /* offset of each plane */ -+ __u64 modifier[4]; /* ie, tiling, compress */ -+}; -+ -+#define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01 -+#define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02 -+#define DRM_MODE_FB_DIRTY_FLAGS 0x03 -+ -+#define DRM_MODE_FB_DIRTY_MAX_CLIPS 256 -+ -+/* -+ * Mark a region of a framebuffer as dirty. -+ * -+ * Some hardware does not automatically update display contents -+ * as a hardware or software draw to a framebuffer. This ioctl -+ * allows userspace to tell the kernel and the hardware what -+ * regions of the framebuffer have changed. -+ * -+ * The kernel or hardware is free to update more then just the -+ * region specified by the clip rects. The kernel or hardware -+ * may also delay and/or coalesce several calls to dirty into a -+ * single update. -+ * -+ * Userspace may annotate the updates, the annotates are a -+ * promise made by the caller that the change is either a copy -+ * of pixels or a fill of a single color in the region specified. -+ * -+ * If the DRM_MODE_FB_DIRTY_ANNOTATE_COPY flag is given then -+ * the number of updated regions are half of num_clips given, -+ * where the clip rects are paired in src and dst. The width and -+ * height of each one of the pairs must match. -+ * -+ * If the DRM_MODE_FB_DIRTY_ANNOTATE_FILL flag is given the caller -+ * promises that the region specified of the clip rects is filled -+ * completely with a single color as given in the color argument. -+ */ -+ -+struct drm_mode_fb_dirty_cmd { -+ __u32 fb_id; -+ __u32 flags; -+ __u32 color; -+ __u32 num_clips; -+ __u64 clips_ptr; -+}; -+ -+struct drm_mode_mode_cmd { -+ __u32 connector_id; -+ struct drm_mode_modeinfo mode; -+}; -+ -+#define DRM_MODE_CURSOR_BO 0x01 -+#define DRM_MODE_CURSOR_MOVE 0x02 -+#define DRM_MODE_CURSOR_FLAGS 0x03 -+ -+/* -+ * depending on the value in flags different members are used. -+ * -+ * CURSOR_BO uses -+ * crtc_id -+ * width -+ * height -+ * handle - if 0 turns the cursor off -+ * -+ * CURSOR_MOVE uses -+ * crtc_id -+ * x -+ * y -+ */ -+struct drm_mode_cursor { -+ __u32 flags; -+ __u32 crtc_id; -+ __s32 x; -+ __s32 y; -+ __u32 width; -+ __u32 height; -+ /* driver specific handle */ -+ __u32 handle; -+}; -+ -+struct drm_mode_cursor2 { -+ __u32 flags; -+ __u32 crtc_id; -+ __s32 x; -+ __s32 y; -+ __u32 width; -+ __u32 height; -+ /* driver specific handle */ -+ __u32 handle; -+ __s32 hot_x; -+ __s32 hot_y; -+}; -+ -+struct drm_mode_crtc_lut { -+ __u32 crtc_id; -+ __u32 gamma_size; -+ -+ /* pointers to arrays */ -+ __u64 red; -+ __u64 green; -+ __u64 blue; -+}; -+ -+struct drm_color_ctm { -+ /* -+ * Conversion matrix in S31.32 sign-magnitude -+ * (not two's complement!) format. -+ */ -+ __u64 matrix[9]; -+}; -+ -+struct drm_color_lut { -+ /* -+ * Values are mapped linearly to 0.0 - 1.0 range, with 0x0 == 0.0 and -+ * 0xffff == 1.0. -+ */ -+ __u16 red; -+ __u16 green; -+ __u16 blue; -+ __u16 reserved; -+}; -+ -+/** -+ * struct hdr_metadata_infoframe - HDR Metadata Infoframe Data. -+ * -+ * HDR Metadata Infoframe as per CTA 861.G spec. This is expected -+ * to match exactly with the spec. -+ * -+ * Userspace is expected to pass the metadata information as per -+ * the format described in this structure. -+ */ -+struct hdr_metadata_infoframe { -+ /** -+ * @eotf: Electro-Optical Transfer Function (EOTF) -+ * used in the stream. -+ */ -+ __u8 eotf; -+ /** -+ * @metadata_type: Static_Metadata_Descriptor_ID. -+ */ -+ __u8 metadata_type; -+ /** -+ * @display_primaries: Color Primaries of the Data. -+ * These are coded as unsigned 16-bit values in units of -+ * 0.00002, where 0x0000 represents zero and 0xC350 -+ * represents 1.0000. -+ * @display_primaries.x: X cordinate of color primary. -+ * @display_primaries.y: Y cordinate of color primary. -+ */ -+ struct { -+ __u16 x, y; -+ } display_primaries[3]; -+ /** -+ * @white_point: White Point of Colorspace Data. -+ * These are coded as unsigned 16-bit values in units of -+ * 0.00002, where 0x0000 represents zero and 0xC350 -+ * represents 1.0000. -+ * @white_point.x: X cordinate of whitepoint of color primary. -+ * @white_point.y: Y cordinate of whitepoint of color primary. -+ */ -+ struct { -+ __u16 x, y; -+ } white_point; -+ /** -+ * @max_display_mastering_luminance: Max Mastering Display Luminance. -+ * This value is coded as an unsigned 16-bit value in units of 1 cd/m2, -+ * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2. -+ */ -+ __u16 max_display_mastering_luminance; -+ /** -+ * @min_display_mastering_luminance: Min Mastering Display Luminance. -+ * This value is coded as an unsigned 16-bit value in units of -+ * 0.0001 cd/m2, where 0x0001 represents 0.0001 cd/m2 and 0xFFFF -+ * represents 6.5535 cd/m2. -+ */ -+ __u16 min_display_mastering_luminance; -+ /** -+ * @max_cll: Max Content Light Level. -+ * This value is coded as an unsigned 16-bit value in units of 1 cd/m2, -+ * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2. -+ */ -+ __u16 max_cll; -+ /** -+ * @max_fall: Max Frame Average Light Level. -+ * This value is coded as an unsigned 16-bit value in units of 1 cd/m2, -+ * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2. -+ */ -+ __u16 max_fall; -+}; -+ -+/** -+ * struct hdr_output_metadata - HDR output metadata -+ * -+ * Metadata Information to be passed from userspace -+ */ -+struct hdr_output_metadata { -+ /** -+ * @metadata_type: Static_Metadata_Descriptor_ID. -+ */ -+ __u32 metadata_type; -+ /** -+ * @hdmi_metadata_type1: HDR Metadata Infoframe. -+ */ -+ union { -+ struct hdr_metadata_infoframe hdmi_metadata_type1; -+ }; -+}; -+ -+#define DRM_MODE_PAGE_FLIP_EVENT 0x01 -+#define DRM_MODE_PAGE_FLIP_ASYNC 0x02 -+#define DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE 0x4 -+#define DRM_MODE_PAGE_FLIP_TARGET_RELATIVE 0x8 -+#define DRM_MODE_PAGE_FLIP_TARGET (DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE | \ -+ DRM_MODE_PAGE_FLIP_TARGET_RELATIVE) -+#define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT | \ -+ DRM_MODE_PAGE_FLIP_ASYNC | \ -+ DRM_MODE_PAGE_FLIP_TARGET) -+ -+/* -+ * Request a page flip on the specified crtc. -+ * -+ * This ioctl will ask KMS to schedule a page flip for the specified -+ * crtc. Once any pending rendering targeting the specified fb (as of -+ * ioctl time) has completed, the crtc will be reprogrammed to display -+ * that fb after the next vertical refresh. The ioctl returns -+ * immediately, but subsequent rendering to the current fb will block -+ * in the execbuffer ioctl until the page flip happens. If a page -+ * flip is already pending as the ioctl is called, EBUSY will be -+ * returned. -+ * -+ * Flag DRM_MODE_PAGE_FLIP_EVENT requests that drm sends back a vblank -+ * event (see drm.h: struct drm_event_vblank) when the page flip is -+ * done. The user_data field passed in with this ioctl will be -+ * returned as the user_data field in the vblank event struct. -+ * -+ * Flag DRM_MODE_PAGE_FLIP_ASYNC requests that the flip happen -+ * 'as soon as possible', meaning that it not delay waiting for vblank. -+ * This may cause tearing on the screen. -+ * -+ * The reserved field must be zero. -+ */ -+ -+struct drm_mode_crtc_page_flip { -+ __u32 crtc_id; -+ __u32 fb_id; -+ __u32 flags; -+ __u32 reserved; -+ __u64 user_data; -+}; -+ -+/* -+ * Request a page flip on the specified crtc. -+ * -+ * Same as struct drm_mode_crtc_page_flip, but supports new flags and -+ * re-purposes the reserved field: -+ * -+ * The sequence field must be zero unless either of the -+ * DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags is specified. When -+ * the ABSOLUTE flag is specified, the sequence field denotes the absolute -+ * vblank sequence when the flip should take effect. When the RELATIVE -+ * flag is specified, the sequence field denotes the relative (to the -+ * current one when the ioctl is called) vblank sequence when the flip -+ * should take effect. NOTE: DRM_IOCTL_WAIT_VBLANK must still be used to -+ * make sure the vblank sequence before the target one has passed before -+ * calling this ioctl. The purpose of the -+ * DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags is merely to clarify -+ * the target for when code dealing with a page flip runs during a -+ * vertical blank period. -+ */ -+ -+struct drm_mode_crtc_page_flip_target { -+ __u32 crtc_id; -+ __u32 fb_id; -+ __u32 flags; -+ __u32 sequence; -+ __u64 user_data; -+}; -+ -+/* create a dumb scanout buffer */ -+struct drm_mode_create_dumb { -+ __u32 height; -+ __u32 width; -+ __u32 bpp; -+ __u32 flags; -+ /* handle, pitch, size will be returned */ -+ __u32 handle; -+ __u32 pitch; -+ __u64 size; -+}; -+ -+/* set up for mmap of a dumb scanout buffer */ -+struct drm_mode_map_dumb { -+ /** Handle for the object being mapped. */ -+ __u32 handle; -+ __u32 pad; -+ /** -+ * Fake offset to use for subsequent mmap call -+ * -+ * This is a fixed-size type for 32/64 compatibility. -+ */ -+ __u64 offset; -+}; -+ -+struct drm_mode_destroy_dumb { -+ __u32 handle; -+}; -+ -+/* page-flip flags are valid, plus: */ -+#define DRM_MODE_ATOMIC_TEST_ONLY 0x0100 -+#define DRM_MODE_ATOMIC_NONBLOCK 0x0200 -+#define DRM_MODE_ATOMIC_ALLOW_MODESET 0x0400 -+ -+#define DRM_MODE_ATOMIC_FLAGS (\ -+ DRM_MODE_PAGE_FLIP_EVENT |\ -+ DRM_MODE_PAGE_FLIP_ASYNC |\ -+ DRM_MODE_ATOMIC_TEST_ONLY |\ -+ DRM_MODE_ATOMIC_NONBLOCK |\ -+ DRM_MODE_ATOMIC_ALLOW_MODESET) -+ -+struct drm_mode_atomic { -+ __u32 flags; -+ __u32 count_objs; -+ __u64 objs_ptr; -+ __u64 count_props_ptr; -+ __u64 props_ptr; -+ __u64 prop_values_ptr; -+ __u64 reserved; -+ __u64 user_data; -+}; -+ -+struct drm_format_modifier_blob { -+#define FORMAT_BLOB_CURRENT 1 -+ /* Version of this blob format */ -+ __u32 version; -+ -+ /* Flags */ -+ __u32 flags; -+ -+ /* Number of fourcc formats supported */ -+ __u32 count_formats; -+ -+ /* Where in this blob the formats exist (in bytes) */ -+ __u32 formats_offset; -+ -+ /* Number of drm_format_modifiers */ -+ __u32 count_modifiers; -+ -+ /* Where in this blob the modifiers exist (in bytes) */ -+ __u32 modifiers_offset; -+ -+ /* __u32 formats[] */ -+ /* struct drm_format_modifier modifiers[] */ -+}; -+ -+struct drm_format_modifier { -+ /* Bitmask of formats in get_plane format list this info applies to. The -+ * offset allows a sliding window of which 64 formats (bits). -+ * -+ * Some examples: -+ * In today's world with < 65 formats, and formats 0, and 2 are -+ * supported -+ * 0x0000000000000005 -+ * ^-offset = 0, formats = 5 -+ * -+ * If the number formats grew to 128, and formats 98-102 are -+ * supported with the modifier: -+ * -+ * 0x0000007c00000000 0000000000000000 -+ * ^ -+ * |__offset = 64, formats = 0x7c00000000 -+ * -+ */ -+ __u64 formats; -+ __u32 offset; -+ __u32 pad; -+ -+ /* The modifier that applies to the >get_plane format list bitmask. */ -+ __u64 modifier; -+}; -+ -+/** -+ * struct drm_mode_create_blob - Create New blob property -+ * -+ * Create a new 'blob' data property, copying length bytes from data pointer, -+ * and returning new blob ID. -+ */ -+struct drm_mode_create_blob { -+ /** @data: Pointer to data to copy. */ -+ __u64 data; -+ /** @length: Length of data to copy. */ -+ __u32 length; -+ /** @blob_id: Return: new property ID. */ -+ __u32 blob_id; -+}; -+ -+/** -+ * struct drm_mode_destroy_blob - Destroy user blob -+ * @blob_id: blob_id to destroy -+ * -+ * Destroy a user-created blob property. -+ * -+ * User-space can release blobs as soon as they do not need to refer to them by -+ * their blob object ID. For instance, if you are using a MODE_ID blob in an -+ * atomic commit and you will not make another commit re-using the same ID, you -+ * can destroy the blob as soon as the commit has been issued, without waiting -+ * for it to complete. -+ */ -+struct drm_mode_destroy_blob { -+ __u32 blob_id; -+}; -+ -+/** -+ * struct drm_mode_create_lease - Create lease -+ * -+ * Lease mode resources, creating another drm_master. -+ * -+ * The @object_ids array must reference at least one CRTC, one connector and -+ * one plane if &DRM_CLIENT_CAP_UNIVERSAL_PLANES is enabled. Alternatively, -+ * the lease can be completely empty. -+ */ -+struct drm_mode_create_lease { -+ /** @object_ids: Pointer to array of object ids (__u32) */ -+ __u64 object_ids; -+ /** @object_count: Number of object ids */ -+ __u32 object_count; -+ /** @flags: flags for new FD (O_CLOEXEC, etc) */ -+ __u32 flags; -+ -+ /** @lessee_id: Return: unique identifier for lessee. */ -+ __u32 lessee_id; -+ /** @fd: Return: file descriptor to new drm_master file */ -+ __u32 fd; -+}; -+ -+/** -+ * struct drm_mode_list_lessees - List lessees -+ * -+ * List lesses from a drm_master. -+ */ -+struct drm_mode_list_lessees { -+ /** -+ * @count_lessees: Number of lessees. -+ * -+ * On input, provides length of the array. -+ * On output, provides total number. No -+ * more than the input number will be written -+ * back, so two calls can be used to get -+ * the size and then the data. -+ */ -+ __u32 count_lessees; -+ /** @pad: Padding. */ -+ __u32 pad; -+ -+ /** -+ * @lessees_ptr: Pointer to lessees. -+ * -+ * Pointer to __u64 array of lessee ids -+ */ -+ __u64 lessees_ptr; -+}; -+ -+/** -+ * struct drm_mode_get_lease - Get Lease -+ * -+ * Get leased objects. -+ */ -+struct drm_mode_get_lease { -+ /** -+ * @count_objects: Number of leased objects. -+ * -+ * On input, provides length of the array. -+ * On output, provides total number. No -+ * more than the input number will be written -+ * back, so two calls can be used to get -+ * the size and then the data. -+ */ -+ __u32 count_objects; -+ /** @pad: Padding. */ -+ __u32 pad; -+ -+ /** -+ * @objects_ptr: Pointer to objects. -+ * -+ * Pointer to __u32 array of object ids. -+ */ -+ __u64 objects_ptr; -+}; -+ -+/** -+ * struct drm_mode_revoke_lease - Revoke lease -+ */ -+struct drm_mode_revoke_lease { -+ /** @lessee_id: Unique ID of lessee */ -+ __u32 lessee_id; -+}; -+ -+/** -+ * struct drm_mode_rect - Two dimensional rectangle. -+ * @x1: Horizontal starting coordinate (inclusive). -+ * @y1: Vertical starting coordinate (inclusive). -+ * @x2: Horizontal ending coordinate (exclusive). -+ * @y2: Vertical ending coordinate (exclusive). -+ * -+ * With drm subsystem using struct drm_rect to manage rectangular area this -+ * export it to user-space. -+ * -+ * Currently used by drm_mode_atomic blob property FB_DAMAGE_CLIPS. -+ */ -+struct drm_mode_rect { -+ __s32 x1; -+ __s32 y1; -+ __s32 x2; -+ __s32 y2; -+}; -+ -+#if defined(__cplusplus) -+} -+#endif -+ -+#endif -diff -up firefox-103.0/third_party/drm/drm/xf86drm.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/drm/drm/xf86drm.h ---- firefox-103.0/third_party/drm/drm/xf86drm.h.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.318409017 +0200 -+++ firefox-103.0/third_party/drm/drm/xf86drm.h 2022-07-28 11:45:30.318409017 +0200 -@@ -0,0 +1,966 @@ -+/** -+ * \file xf86drm.h -+ * OS-independent header for DRM user-level library interface. -+ * -+ * \author Rickard E. (Rik) Faith -+ */ -+ -+/* -+ * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas. -+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. -+ * All Rights Reserved. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -+ * DEALINGS IN THE SOFTWARE. -+ * -+ */ -+ -+#ifndef _XF86DRM_H_ -+#define _XF86DRM_H_ -+ -+#include -+#include -+#include -+#include -+ -+#if defined(__cplusplus) -+extern "C" { -+#endif -+ -+#ifndef DRM_MAX_MINOR -+#define DRM_MAX_MINOR 16 -+#endif -+ -+#if defined(__linux__) -+ -+#define DRM_IOCTL_NR(n) _IOC_NR(n) -+#define DRM_IOC_VOID _IOC_NONE -+#define DRM_IOC_READ _IOC_READ -+#define DRM_IOC_WRITE _IOC_WRITE -+#define DRM_IOC_READWRITE _IOC_READ|_IOC_WRITE -+#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size) -+ -+#else /* One of the *BSDs */ -+ -+#include -+#define DRM_IOCTL_NR(n) ((n) & 0xff) -+#define DRM_IOC_VOID IOC_VOID -+#define DRM_IOC_READ IOC_OUT -+#define DRM_IOC_WRITE IOC_IN -+#define DRM_IOC_READWRITE IOC_INOUT -+#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size) -+ -+#endif -+ -+ /* Defaults, if nothing set in xf86config */ -+#define DRM_DEV_UID 0 -+#define DRM_DEV_GID 0 -+/* Default /dev/dri directory permissions 0755 */ -+#define DRM_DEV_DIRMODE \ -+ (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) -+#define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) -+ -+#ifdef __OpenBSD__ -+#define DRM_DIR_NAME "/dev" -+#define DRM_PRIMARY_MINOR_NAME "drm" -+#define DRM_CONTROL_MINOR_NAME "drmC" -+#define DRM_RENDER_MINOR_NAME "drmR" -+#else -+#define DRM_DIR_NAME "/dev/dri" -+#define DRM_PRIMARY_MINOR_NAME "card" -+#define DRM_CONTROL_MINOR_NAME "controlD" -+#define DRM_RENDER_MINOR_NAME "renderD" -+#define DRM_PROC_NAME "/proc/dri/" /* For backward Linux compatibility */ -+#endif -+ -+#define DRM_DEV_NAME "%s/" DRM_PRIMARY_MINOR_NAME "%d" -+#define DRM_CONTROL_DEV_NAME "%s/" DRM_CONTROL_MINOR_NAME "%d" -+#define DRM_RENDER_DEV_NAME "%s/" DRM_RENDER_MINOR_NAME "%d" -+ -+#define DRM_NODE_NAME_MAX \ -+ (sizeof(DRM_DIR_NAME) + 1 /* slash */ \ -+ + MAX3(sizeof(DRM_PRIMARY_MINOR_NAME), \ -+ sizeof(DRM_CONTROL_MINOR_NAME), \ -+ sizeof(DRM_RENDER_MINOR_NAME)) \ -+ + sizeof("144") /* highest possible node number */ \ -+ + 1) /* NULL-terminator */ -+ -+#define DRM_ERR_NO_DEVICE (-1001) -+#define DRM_ERR_NO_ACCESS (-1002) -+#define DRM_ERR_NOT_ROOT (-1003) -+#define DRM_ERR_INVALID (-1004) -+#define DRM_ERR_NO_FD (-1005) -+ -+#define DRM_AGP_NO_HANDLE 0 -+ -+typedef unsigned int drmSize, *drmSizePtr; /**< For mapped regions */ -+typedef void *drmAddress, **drmAddressPtr; /**< For mapped regions */ -+ -+#if (__GNUC__ >= 3) -+#define DRM_PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a))) -+#else -+#define DRM_PRINTFLIKE(f, a) -+#endif -+ -+typedef struct _drmServerInfo { -+ int (*debug_print)(const char *format, va_list ap) DRM_PRINTFLIKE(1,0); -+ int (*load_module)(const char *name); -+ void (*get_perms)(gid_t *, mode_t *); -+} drmServerInfo, *drmServerInfoPtr; -+ -+typedef struct drmHashEntry { -+ int fd; -+ void (*f)(int, void *, void *); -+ void *tagTable; -+} drmHashEntry; -+ -+extern int drmIoctl(int fd, unsigned long request, void *arg); -+extern void *drmGetHashTable(void); -+extern drmHashEntry *drmGetEntry(int fd); -+ -+/** -+ * Driver version information. -+ * -+ * \sa drmGetVersion() and drmSetVersion(). -+ */ -+typedef struct _drmVersion { -+ int version_major; /**< Major version */ -+ int version_minor; /**< Minor version */ -+ int version_patchlevel; /**< Patch level */ -+ int name_len; /**< Length of name buffer */ -+ char *name; /**< Name of driver */ -+ int date_len; /**< Length of date buffer */ -+ char *date; /**< User-space buffer to hold date */ -+ int desc_len; /**< Length of desc buffer */ -+ char *desc; /**< User-space buffer to hold desc */ -+} drmVersion, *drmVersionPtr; -+ -+typedef struct _drmStats { -+ unsigned long count; /**< Number of data */ -+ struct { -+ unsigned long value; /**< Value from kernel */ -+ const char *long_format; /**< Suggested format for long_name */ -+ const char *long_name; /**< Long name for value */ -+ const char *rate_format; /**< Suggested format for rate_name */ -+ const char *rate_name; /**< Short name for value per second */ -+ int isvalue; /**< True if value (vs. counter) */ -+ const char *mult_names; /**< Multiplier names (e.g., "KGM") */ -+ int mult; /**< Multiplier value (e.g., 1024) */ -+ int verbose; /**< Suggest only in verbose output */ -+ } data[15]; -+} drmStatsT; -+ -+ -+ /* All of these enums *MUST* match with the -+ kernel implementation -- so do *NOT* -+ change them! (The drmlib implementation -+ will just copy the flags instead of -+ translating them.) */ -+typedef enum { -+ DRM_FRAME_BUFFER = 0, /**< WC, no caching, no core dump */ -+ DRM_REGISTERS = 1, /**< no caching, no core dump */ -+ DRM_SHM = 2, /**< shared, cached */ -+ DRM_AGP = 3, /**< AGP/GART */ -+ DRM_SCATTER_GATHER = 4, /**< PCI scatter/gather */ -+ DRM_CONSISTENT = 5 /**< PCI consistent */ -+} drmMapType; -+ -+typedef enum { -+ DRM_RESTRICTED = 0x0001, /**< Cannot be mapped to client-virtual */ -+ DRM_READ_ONLY = 0x0002, /**< Read-only in client-virtual */ -+ DRM_LOCKED = 0x0004, /**< Physical pages locked */ -+ DRM_KERNEL = 0x0008, /**< Kernel requires access */ -+ DRM_WRITE_COMBINING = 0x0010, /**< Use write-combining, if available */ -+ DRM_CONTAINS_LOCK = 0x0020, /**< SHM page that contains lock */ -+ DRM_REMOVABLE = 0x0040 /**< Removable mapping */ -+} drmMapFlags; -+ -+/** -+ * \warning These values *MUST* match drm.h -+ */ -+typedef enum { -+ /** \name Flags for DMA buffer dispatch */ -+ /*@{*/ -+ DRM_DMA_BLOCK = 0x01, /**< -+ * Block until buffer dispatched. -+ * -+ * \note the buffer may not yet have been -+ * processed by the hardware -- getting a -+ * hardware lock with the hardware quiescent -+ * will ensure that the buffer has been -+ * processed. -+ */ -+ DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */ -+ DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */ -+ /*@}*/ -+ -+ /** \name Flags for DMA buffer request */ -+ /*@{*/ -+ DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */ -+ DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */ -+ DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ -+ /*@}*/ -+} drmDMAFlags; -+ -+typedef enum { -+ DRM_PAGE_ALIGN = 0x01, -+ DRM_AGP_BUFFER = 0x02, -+ DRM_SG_BUFFER = 0x04, -+ DRM_FB_BUFFER = 0x08, -+ DRM_PCI_BUFFER_RO = 0x10 -+} drmBufDescFlags; -+ -+typedef enum { -+ DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */ -+ DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */ -+ DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */ -+ DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */ -+ /* These *HALT* flags aren't supported yet -+ -- they will be used to support the -+ full-screen DGA-like mode. */ -+ DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */ -+ DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ -+} drmLockFlags; -+ -+typedef enum { -+ DRM_CONTEXT_PRESERVED = 0x01, /**< This context is preserved and -+ never swapped. */ -+ DRM_CONTEXT_2DONLY = 0x02 /**< This context is for 2D rendering only. */ -+} drm_context_tFlags, *drm_context_tFlagsPtr; -+ -+typedef struct _drmBufDesc { -+ int count; /**< Number of buffers of this size */ -+ int size; /**< Size in bytes */ -+ int low_mark; /**< Low water mark */ -+ int high_mark; /**< High water mark */ -+} drmBufDesc, *drmBufDescPtr; -+ -+typedef struct _drmBufInfo { -+ int count; /**< Number of buffers described in list */ -+ drmBufDescPtr list; /**< List of buffer descriptions */ -+} drmBufInfo, *drmBufInfoPtr; -+ -+typedef struct _drmBuf { -+ int idx; /**< Index into the master buffer list */ -+ int total; /**< Buffer size */ -+ int used; /**< Amount of buffer in use (for DMA) */ -+ drmAddress address; /**< Address */ -+} drmBuf, *drmBufPtr; -+ -+/** -+ * Buffer mapping information. -+ * -+ * Used by drmMapBufs() and drmUnmapBufs() to store information about the -+ * mapped buffers. -+ */ -+typedef struct _drmBufMap { -+ int count; /**< Number of buffers mapped */ -+ drmBufPtr list; /**< Buffers */ -+} drmBufMap, *drmBufMapPtr; -+ -+typedef struct _drmLock { -+ volatile unsigned int lock; -+ char padding[60]; -+ /* This is big enough for most current (and future?) architectures: -+ DEC Alpha: 32 bytes -+ Intel Merced: ? -+ Intel P5/PPro/PII/PIII: 32 bytes -+ Intel StrongARM: 32 bytes -+ Intel i386/i486: 16 bytes -+ MIPS: 32 bytes (?) -+ Motorola 68k: 16 bytes -+ Motorola PowerPC: 32 bytes -+ Sun SPARC: 32 bytes -+ */ -+} drmLock, *drmLockPtr; -+ -+/** -+ * Indices here refer to the offset into -+ * list in drmBufInfo -+ */ -+typedef struct _drmDMAReq { -+ drm_context_t context; /**< Context handle */ -+ int send_count; /**< Number of buffers to send */ -+ int *send_list; /**< List of handles to buffers */ -+ int *send_sizes; /**< Lengths of data to send, in bytes */ -+ drmDMAFlags flags; /**< Flags */ -+ int request_count; /**< Number of buffers requested */ -+ int request_size; /**< Desired size of buffers requested */ -+ int *request_list; /**< Buffer information */ -+ int *request_sizes; /**< Minimum acceptable sizes */ -+ int granted_count; /**< Number of buffers granted at this size */ -+} drmDMAReq, *drmDMAReqPtr; -+ -+typedef struct _drmRegion { -+ drm_handle_t handle; -+ unsigned int offset; -+ drmSize size; -+ drmAddress map; -+} drmRegion, *drmRegionPtr; -+ -+typedef struct _drmTextureRegion { -+ unsigned char next; -+ unsigned char prev; -+ unsigned char in_use; -+ unsigned char padding; /**< Explicitly pad this out */ -+ unsigned int age; -+} drmTextureRegion, *drmTextureRegionPtr; -+ -+ -+typedef enum { -+ DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ -+ DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ -+ /* bits 1-6 are reserved for high crtcs */ -+ DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e, -+ DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */ -+ DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ -+ DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ -+ DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ -+ DRM_VBLANK_SIGNAL = 0x40000000 /* Send signal instead of blocking */ -+} drmVBlankSeqType; -+#define DRM_VBLANK_HIGH_CRTC_SHIFT 1 -+ -+typedef struct _drmVBlankReq { -+ drmVBlankSeqType type; -+ unsigned int sequence; -+ unsigned long signal; -+} drmVBlankReq, *drmVBlankReqPtr; -+ -+typedef struct _drmVBlankReply { -+ drmVBlankSeqType type; -+ unsigned int sequence; -+ long tval_sec; -+ long tval_usec; -+} drmVBlankReply, *drmVBlankReplyPtr; -+ -+typedef union _drmVBlank { -+ drmVBlankReq request; -+ drmVBlankReply reply; -+} drmVBlank, *drmVBlankPtr; -+ -+typedef struct _drmSetVersion { -+ int drm_di_major; -+ int drm_di_minor; -+ int drm_dd_major; -+ int drm_dd_minor; -+} drmSetVersion, *drmSetVersionPtr; -+ -+#define __drm_dummy_lock(lock) (*(__volatile__ unsigned int *)lock) -+ -+#define DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */ -+#define DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */ -+ -+#if defined(__GNUC__) && (__GNUC__ >= 2) -+# if defined(__i386) || defined(__AMD64__) || defined(__x86_64__) || defined(__amd64__) -+ /* Reflect changes here to drmP.h */ -+#define DRM_CAS(lock,old,new,__ret) \ -+ do { \ -+ int __dummy; /* Can't mark eax as clobbered */ \ -+ __asm__ __volatile__( \ -+ "lock ; cmpxchg %4,%1\n\t" \ -+ "setnz %0" \ -+ : "=d" (__ret), \ -+ "=m" (__drm_dummy_lock(lock)), \ -+ "=a" (__dummy) \ -+ : "2" (old), \ -+ "r" (new)); \ -+ } while (0) -+ -+#elif defined(__alpha__) -+ -+#define DRM_CAS(lock, old, new, ret) \ -+ do { \ -+ int tmp, old32; \ -+ __asm__ __volatile__( \ -+ " addl $31, %5, %3\n" \ -+ "1: ldl_l %0, %2\n" \ -+ " cmpeq %0, %3, %1\n" \ -+ " beq %1, 2f\n" \ -+ " mov %4, %0\n" \ -+ " stl_c %0, %2\n" \ -+ " beq %0, 3f\n" \ -+ " mb\n" \ -+ "2: cmpeq %1, 0, %1\n" \ -+ ".subsection 2\n" \ -+ "3: br 1b\n" \ -+ ".previous" \ -+ : "=&r"(tmp), "=&r"(ret), \ -+ "=m"(__drm_dummy_lock(lock)), \ -+ "=&r"(old32) \ -+ : "r"(new), "r"(old) \ -+ : "memory"); \ -+ } while (0) -+ -+#elif defined(__sparc__) -+ -+#define DRM_CAS(lock,old,new,__ret) \ -+do { register unsigned int __old __asm("o0"); \ -+ register unsigned int __new __asm("o1"); \ -+ register volatile unsigned int *__lock __asm("o2"); \ -+ __old = old; \ -+ __new = new; \ -+ __lock = (volatile unsigned int *)lock; \ -+ __asm__ __volatile__( \ -+ /*"cas [%2], %3, %0"*/ \ -+ ".word 0xd3e29008\n\t" \ -+ /*"membar #StoreStore | #StoreLoad"*/ \ -+ ".word 0x8143e00a" \ -+ : "=&r" (__new) \ -+ : "0" (__new), \ -+ "r" (__lock), \ -+ "r" (__old) \ -+ : "memory"); \ -+ __ret = (__new != __old); \ -+} while(0) -+ -+#elif defined(__ia64__) -+ -+#ifdef __INTEL_COMPILER -+/* this currently generates bad code (missing stop bits)... */ -+#include -+ -+#define DRM_CAS(lock,old,new,__ret) \ -+ do { \ -+ unsigned long __result, __old = (old) & 0xffffffff; \ -+ __mf(); \ -+ __result = _InterlockedCompareExchange_acq(&__drm_dummy_lock(lock), (new), __old);\ -+ __ret = (__result) != (__old); \ -+/* __ret = (__sync_val_compare_and_swap(&__drm_dummy_lock(lock), \ -+ (old), (new)) \ -+ != (old)); */\ -+ } while (0) -+ -+#else -+#define DRM_CAS(lock,old,new,__ret) \ -+ do { \ -+ unsigned int __result, __old = (old); \ -+ __asm__ __volatile__( \ -+ "mf\n" \ -+ "mov ar.ccv=%2\n" \ -+ ";;\n" \ -+ "cmpxchg4.acq %0=%1,%3,ar.ccv" \ -+ : "=r" (__result), "=m" (__drm_dummy_lock(lock)) \ -+ : "r" ((unsigned long)__old), "r" (new) \ -+ : "memory"); \ -+ __ret = (__result) != (__old); \ -+ } while (0) -+ -+#endif -+ -+#elif defined(__powerpc__) -+ -+#define DRM_CAS(lock,old,new,__ret) \ -+ do { \ -+ __asm__ __volatile__( \ -+ "sync;" \ -+ "0: lwarx %0,0,%1;" \ -+ " xor. %0,%3,%0;" \ -+ " bne 1f;" \ -+ " stwcx. %2,0,%1;" \ -+ " bne- 0b;" \ -+ "1: " \ -+ "sync;" \ -+ : "=&r"(__ret) \ -+ : "r"(lock), "r"(new), "r"(old) \ -+ : "cr0", "memory"); \ -+ } while (0) -+ -+# elif defined (__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \ -+ || defined (__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \ -+ || defined (__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) \ -+ || defined (__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \ -+ || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \ -+ || defined(__ARM_ARCH_7EM__) -+ /* excluding ARMv4/ARMv5 and lower (lacking ldrex/strex support) */ -+ #undef DRM_DEV_MODE -+ #define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) -+ -+ #define DRM_CAS(lock,old,new,__ret) \ -+ do { \ -+ __asm__ __volatile__ ( \ -+ "1: ldrex %0, [%1]\n" \ -+ " teq %0, %2\n" \ -+ " ite eq\n" \ -+ " strexeq %0, %3, [%1]\n" \ -+ " movne %0, #1\n" \ -+ : "=&r" (__ret) \ -+ : "r" (lock), "r" (old), "r" (new) \ -+ : "cc","memory"); \ -+ } while (0) -+ -+#endif /* architecture */ -+#endif /* __GNUC__ >= 2 */ -+ -+#ifndef DRM_CAS -+#define DRM_CAS(lock,old,new,ret) do { ret=1; } while (0) /* FAST LOCK FAILS */ -+#endif -+ -+#if defined(__alpha__) -+#define DRM_CAS_RESULT(_result) long _result -+#elif defined(__powerpc__) -+#define DRM_CAS_RESULT(_result) int _result -+#else -+#define DRM_CAS_RESULT(_result) char _result -+#endif -+ -+#define DRM_LIGHT_LOCK(fd,lock,context) \ -+ do { \ -+ DRM_CAS_RESULT(__ret); \ -+ DRM_CAS(lock,context,DRM_LOCK_HELD|context,__ret); \ -+ if (__ret) drmGetLock(fd,context,0); \ -+ } while(0) -+ -+ /* This one counts fast locks -- for -+ benchmarking only. */ -+#define DRM_LIGHT_LOCK_COUNT(fd,lock,context,count) \ -+ do { \ -+ DRM_CAS_RESULT(__ret); \ -+ DRM_CAS(lock,context,DRM_LOCK_HELD|context,__ret); \ -+ if (__ret) drmGetLock(fd,context,0); \ -+ else ++count; \ -+ } while(0) -+ -+#define DRM_LOCK(fd,lock,context,flags) \ -+ do { \ -+ if (flags) drmGetLock(fd,context,flags); \ -+ else DRM_LIGHT_LOCK(fd,lock,context); \ -+ } while(0) -+ -+#define DRM_UNLOCK(fd,lock,context) \ -+ do { \ -+ DRM_CAS_RESULT(__ret); \ -+ DRM_CAS(lock,DRM_LOCK_HELD|context,context,__ret); \ -+ if (__ret) drmUnlock(fd,context); \ -+ } while(0) -+ -+ /* Simple spin locks */ -+#define DRM_SPINLOCK(spin,val) \ -+ do { \ -+ DRM_CAS_RESULT(__ret); \ -+ do { \ -+ DRM_CAS(spin,0,val,__ret); \ -+ if (__ret) while ((spin)->lock); \ -+ } while (__ret); \ -+ } while(0) -+ -+#define DRM_SPINLOCK_TAKE(spin,val) \ -+ do { \ -+ DRM_CAS_RESULT(__ret); \ -+ int cur; \ -+ do { \ -+ cur = (*spin).lock; \ -+ DRM_CAS(spin,cur,val,__ret); \ -+ } while (__ret); \ -+ } while(0) -+ -+#define DRM_SPINLOCK_COUNT(spin,val,count,__ret) \ -+ do { \ -+ int __i; \ -+ __ret = 1; \ -+ for (__i = 0; __ret && __i < count; __i++) { \ -+ DRM_CAS(spin,0,val,__ret); \ -+ if (__ret) for (;__i < count && (spin)->lock; __i++); \ -+ } \ -+ } while(0) -+ -+#define DRM_SPINUNLOCK(spin,val) \ -+ do { \ -+ DRM_CAS_RESULT(__ret); \ -+ if ((*spin).lock == val) { /* else server stole lock */ \ -+ do { \ -+ DRM_CAS(spin,val,0,__ret); \ -+ } while (__ret); \ -+ } \ -+ } while(0) -+ -+ -+ -+/* General user-level programmer's API: unprivileged */ -+extern int drmAvailable(void); -+extern int drmOpen(const char *name, const char *busid); -+ -+#define DRM_NODE_PRIMARY 0 -+#define DRM_NODE_CONTROL 1 -+#define DRM_NODE_RENDER 2 -+#define DRM_NODE_MAX 3 -+ -+extern int drmOpenWithType(const char *name, const char *busid, -+ int type); -+ -+extern int drmOpenControl(int minor); -+extern int drmOpenRender(int minor); -+extern int drmClose(int fd); -+extern drmVersionPtr drmGetVersion(int fd); -+extern drmVersionPtr drmGetLibVersion(int fd); -+extern int drmGetCap(int fd, uint64_t capability, uint64_t *value); -+extern void drmFreeVersion(drmVersionPtr); -+extern int drmGetMagic(int fd, drm_magic_t * magic); -+extern char *drmGetBusid(int fd); -+extern int drmGetInterruptFromBusID(int fd, int busnum, int devnum, -+ int funcnum); -+extern int drmGetMap(int fd, int idx, drm_handle_t *offset, -+ drmSize *size, drmMapType *type, -+ drmMapFlags *flags, drm_handle_t *handle, -+ int *mtrr); -+extern int drmGetClient(int fd, int idx, int *auth, int *pid, -+ int *uid, unsigned long *magic, -+ unsigned long *iocs); -+extern int drmGetStats(int fd, drmStatsT *stats); -+extern int drmSetInterfaceVersion(int fd, drmSetVersion *version); -+extern int drmCommandNone(int fd, unsigned long drmCommandIndex); -+extern int drmCommandRead(int fd, unsigned long drmCommandIndex, -+ void *data, unsigned long size); -+extern int drmCommandWrite(int fd, unsigned long drmCommandIndex, -+ void *data, unsigned long size); -+extern int drmCommandWriteRead(int fd, unsigned long drmCommandIndex, -+ void *data, unsigned long size); -+ -+/* General user-level programmer's API: X server (root) only */ -+extern void drmFreeBusid(const char *busid); -+extern int drmSetBusid(int fd, const char *busid); -+extern int drmAuthMagic(int fd, drm_magic_t magic); -+extern int drmAddMap(int fd, -+ drm_handle_t offset, -+ drmSize size, -+ drmMapType type, -+ drmMapFlags flags, -+ drm_handle_t * handle); -+extern int drmRmMap(int fd, drm_handle_t handle); -+extern int drmAddContextPrivateMapping(int fd, drm_context_t ctx_id, -+ drm_handle_t handle); -+ -+extern int drmAddBufs(int fd, int count, int size, -+ drmBufDescFlags flags, -+ int agp_offset); -+extern int drmMarkBufs(int fd, double low, double high); -+extern int drmCreateContext(int fd, drm_context_t * handle); -+extern int drmSetContextFlags(int fd, drm_context_t context, -+ drm_context_tFlags flags); -+extern int drmGetContextFlags(int fd, drm_context_t context, -+ drm_context_tFlagsPtr flags); -+extern int drmAddContextTag(int fd, drm_context_t context, void *tag); -+extern int drmDelContextTag(int fd, drm_context_t context); -+extern void *drmGetContextTag(int fd, drm_context_t context); -+extern drm_context_t * drmGetReservedContextList(int fd, int *count); -+extern void drmFreeReservedContextList(drm_context_t *); -+extern int drmSwitchToContext(int fd, drm_context_t context); -+extern int drmDestroyContext(int fd, drm_context_t handle); -+extern int drmCreateDrawable(int fd, drm_drawable_t * handle); -+extern int drmDestroyDrawable(int fd, drm_drawable_t handle); -+extern int drmUpdateDrawableInfo(int fd, drm_drawable_t handle, -+ drm_drawable_info_type_t type, -+ unsigned int num, void *data); -+extern int drmCtlInstHandler(int fd, int irq); -+extern int drmCtlUninstHandler(int fd); -+extern int drmSetClientCap(int fd, uint64_t capability, -+ uint64_t value); -+ -+extern int drmCrtcGetSequence(int fd, uint32_t crtcId, -+ uint64_t *sequence, uint64_t *ns); -+extern int drmCrtcQueueSequence(int fd, uint32_t crtcId, -+ uint32_t flags, uint64_t sequence, -+ uint64_t *sequence_queued, -+ uint64_t user_data); -+/* General user-level programmer's API: authenticated client and/or X */ -+extern int drmMap(int fd, -+ drm_handle_t handle, -+ drmSize size, -+ drmAddressPtr address); -+extern int drmUnmap(drmAddress address, drmSize size); -+extern drmBufInfoPtr drmGetBufInfo(int fd); -+extern drmBufMapPtr drmMapBufs(int fd); -+extern int drmUnmapBufs(drmBufMapPtr bufs); -+extern int drmDMA(int fd, drmDMAReqPtr request); -+extern int drmFreeBufs(int fd, int count, int *list); -+extern int drmGetLock(int fd, -+ drm_context_t context, -+ drmLockFlags flags); -+extern int drmUnlock(int fd, drm_context_t context); -+extern int drmFinish(int fd, int context, drmLockFlags flags); -+extern int drmGetContextPrivateMapping(int fd, drm_context_t ctx_id, -+ drm_handle_t * handle); -+ -+/* AGP/GART support: X server (root) only */ -+extern int drmAgpAcquire(int fd); -+extern int drmAgpRelease(int fd); -+extern int drmAgpEnable(int fd, unsigned long mode); -+extern int drmAgpAlloc(int fd, unsigned long size, -+ unsigned long type, unsigned long *address, -+ drm_handle_t *handle); -+extern int drmAgpFree(int fd, drm_handle_t handle); -+extern int drmAgpBind(int fd, drm_handle_t handle, -+ unsigned long offset); -+extern int drmAgpUnbind(int fd, drm_handle_t handle); -+ -+/* AGP/GART info: authenticated client and/or X */ -+extern int drmAgpVersionMajor(int fd); -+extern int drmAgpVersionMinor(int fd); -+extern unsigned long drmAgpGetMode(int fd); -+extern unsigned long drmAgpBase(int fd); /* Physical location */ -+extern unsigned long drmAgpSize(int fd); /* Bytes */ -+extern unsigned long drmAgpMemoryUsed(int fd); -+extern unsigned long drmAgpMemoryAvail(int fd); -+extern unsigned int drmAgpVendorId(int fd); -+extern unsigned int drmAgpDeviceId(int fd); -+ -+/* PCI scatter/gather support: X server (root) only */ -+extern int drmScatterGatherAlloc(int fd, unsigned long size, -+ drm_handle_t *handle); -+extern int drmScatterGatherFree(int fd, drm_handle_t handle); -+ -+extern int drmWaitVBlank(int fd, drmVBlankPtr vbl); -+ -+/* Support routines */ -+extern void drmSetServerInfo(drmServerInfoPtr info); -+extern int drmError(int err, const char *label); -+extern void *drmMalloc(int size); -+extern void drmFree(void *pt); -+ -+/* Hash table routines */ -+extern void *drmHashCreate(void); -+extern int drmHashDestroy(void *t); -+extern int drmHashLookup(void *t, unsigned long key, void **value); -+extern int drmHashInsert(void *t, unsigned long key, void *value); -+extern int drmHashDelete(void *t, unsigned long key); -+extern int drmHashFirst(void *t, unsigned long *key, void **value); -+extern int drmHashNext(void *t, unsigned long *key, void **value); -+ -+/* PRNG routines */ -+extern void *drmRandomCreate(unsigned long seed); -+extern int drmRandomDestroy(void *state); -+extern unsigned long drmRandom(void *state); -+extern double drmRandomDouble(void *state); -+ -+/* Skip list routines */ -+ -+extern void *drmSLCreate(void); -+extern int drmSLDestroy(void *l); -+extern int drmSLLookup(void *l, unsigned long key, void **value); -+extern int drmSLInsert(void *l, unsigned long key, void *value); -+extern int drmSLDelete(void *l, unsigned long key); -+extern int drmSLNext(void *l, unsigned long *key, void **value); -+extern int drmSLFirst(void *l, unsigned long *key, void **value); -+extern void drmSLDump(void *l); -+extern int drmSLLookupNeighbors(void *l, unsigned long key, -+ unsigned long *prev_key, void **prev_value, -+ unsigned long *next_key, void **next_value); -+ -+extern int drmOpenOnce(void *unused, const char *BusID, int *newlyopened); -+extern int drmOpenOnceWithType(const char *BusID, int *newlyopened, int type); -+extern void drmCloseOnce(int fd); -+extern void drmMsg(const char *format, ...) DRM_PRINTFLIKE(1, 2); -+ -+extern int drmSetMaster(int fd); -+extern int drmDropMaster(int fd); -+extern int drmIsMaster(int fd); -+ -+#define DRM_EVENT_CONTEXT_VERSION 4 -+ -+typedef struct _drmEventContext { -+ -+ /* This struct is versioned so we can add more pointers if we -+ * add more events. */ -+ int version; -+ -+ void (*vblank_handler)(int fd, -+ unsigned int sequence, -+ unsigned int tv_sec, -+ unsigned int tv_usec, -+ void *user_data); -+ -+ void (*page_flip_handler)(int fd, -+ unsigned int sequence, -+ unsigned int tv_sec, -+ unsigned int tv_usec, -+ void *user_data); -+ -+ void (*page_flip_handler2)(int fd, -+ unsigned int sequence, -+ unsigned int tv_sec, -+ unsigned int tv_usec, -+ unsigned int crtc_id, -+ void *user_data); -+ -+ void (*sequence_handler)(int fd, -+ uint64_t sequence, -+ uint64_t ns, -+ uint64_t user_data); -+} drmEventContext, *drmEventContextPtr; -+ -+extern int drmHandleEvent(int fd, drmEventContextPtr evctx); -+ -+extern char *drmGetDeviceNameFromFd(int fd); -+ -+/* Improved version of drmGetDeviceNameFromFd which attributes for any type of -+ * device/node - card, control or renderD. -+ */ -+extern char *drmGetDeviceNameFromFd2(int fd); -+extern int drmGetNodeTypeFromFd(int fd); -+ -+/* Convert between GEM handles and DMA-BUF file descriptors. -+ * -+ * Warning: since GEM handles are not reference-counted and are unique per -+ * DRM file description, the caller is expected to perform its own reference -+ * counting. drmPrimeFDToHandle is guaranteed to return the same handle for -+ * different FDs if they reference the same underlying buffer object. This -+ * could even be a buffer object originally created on the same DRM FD. -+ * -+ * When sharing a DRM FD with an API such as EGL or GBM, the caller must not -+ * use drmPrimeHandleToFD nor drmPrimeFDToHandle. A single user-space -+ * reference-counting implementation is necessary to avoid double-closing GEM -+ * handles. -+ * -+ * Two processes can't share the same DRM FD and both use it to create or -+ * import GEM handles, even when using a single user-space reference-counting -+ * implementation like GBM, because GBM doesn't share its state between -+ * processes. -+ */ -+extern int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags, int *prime_fd); -+extern int drmPrimeFDToHandle(int fd, int prime_fd, uint32_t *handle); -+ -+extern int drmCloseBufferHandle(int fd, uint32_t handle); -+ -+extern char *drmGetPrimaryDeviceNameFromFd(int fd); -+extern char *drmGetRenderDeviceNameFromFd(int fd); -+ -+#define DRM_BUS_PCI 0 -+#define DRM_BUS_USB 1 -+#define DRM_BUS_PLATFORM 2 -+#define DRM_BUS_HOST1X 3 -+ -+typedef struct _drmPciBusInfo { -+ uint16_t domain; -+ uint8_t bus; -+ uint8_t dev; -+ uint8_t func; -+} drmPciBusInfo, *drmPciBusInfoPtr; -+ -+typedef struct _drmPciDeviceInfo { -+ uint16_t vendor_id; -+ uint16_t device_id; -+ uint16_t subvendor_id; -+ uint16_t subdevice_id; -+ uint8_t revision_id; -+} drmPciDeviceInfo, *drmPciDeviceInfoPtr; -+ -+typedef struct _drmUsbBusInfo { -+ uint8_t bus; -+ uint8_t dev; -+} drmUsbBusInfo, *drmUsbBusInfoPtr; -+ -+typedef struct _drmUsbDeviceInfo { -+ uint16_t vendor; -+ uint16_t product; -+} drmUsbDeviceInfo, *drmUsbDeviceInfoPtr; -+ -+#define DRM_PLATFORM_DEVICE_NAME_LEN 512 -+ -+typedef struct _drmPlatformBusInfo { -+ char fullname[DRM_PLATFORM_DEVICE_NAME_LEN]; -+} drmPlatformBusInfo, *drmPlatformBusInfoPtr; -+ -+typedef struct _drmPlatformDeviceInfo { -+ char **compatible; /* NULL terminated list of compatible strings */ -+} drmPlatformDeviceInfo, *drmPlatformDeviceInfoPtr; -+ -+#define DRM_HOST1X_DEVICE_NAME_LEN 512 -+ -+typedef struct _drmHost1xBusInfo { -+ char fullname[DRM_HOST1X_DEVICE_NAME_LEN]; -+} drmHost1xBusInfo, *drmHost1xBusInfoPtr; -+ -+typedef struct _drmHost1xDeviceInfo { -+ char **compatible; /* NULL terminated list of compatible strings */ -+} drmHost1xDeviceInfo, *drmHost1xDeviceInfoPtr; -+ -+typedef struct _drmDevice { -+ char **nodes; /* DRM_NODE_MAX sized array */ -+ int available_nodes; /* DRM_NODE_* bitmask */ -+ int bustype; -+ union { -+ drmPciBusInfoPtr pci; -+ drmUsbBusInfoPtr usb; -+ drmPlatformBusInfoPtr platform; -+ drmHost1xBusInfoPtr host1x; -+ } businfo; -+ union { -+ drmPciDeviceInfoPtr pci; -+ drmUsbDeviceInfoPtr usb; -+ drmPlatformDeviceInfoPtr platform; -+ drmHost1xDeviceInfoPtr host1x; -+ } deviceinfo; -+} drmDevice, *drmDevicePtr; -+ -+extern int drmGetDevice(int fd, drmDevicePtr *device); -+extern void drmFreeDevice(drmDevicePtr *device); -+ -+extern int drmGetDevices(drmDevicePtr devices[], int max_devices); -+extern void drmFreeDevices(drmDevicePtr devices[], int count); -+ -+#define DRM_DEVICE_GET_PCI_REVISION (1 << 0) -+extern int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr *device); -+extern int drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices); -+ -+extern int drmGetDeviceFromDevId(dev_t dev_id, uint32_t flags, drmDevicePtr *device); -+ -+extern int drmDevicesEqual(drmDevicePtr a, drmDevicePtr b); -+ -+extern int drmSyncobjCreate(int fd, uint32_t flags, uint32_t *handle); -+extern int drmSyncobjDestroy(int fd, uint32_t handle); -+extern int drmSyncobjHandleToFD(int fd, uint32_t handle, int *obj_fd); -+extern int drmSyncobjFDToHandle(int fd, int obj_fd, uint32_t *handle); -+ -+extern int drmSyncobjImportSyncFile(int fd, uint32_t handle, int sync_file_fd); -+extern int drmSyncobjExportSyncFile(int fd, uint32_t handle, int *sync_file_fd); -+extern int drmSyncobjWait(int fd, uint32_t *handles, unsigned num_handles, -+ int64_t timeout_nsec, unsigned flags, -+ uint32_t *first_signaled); -+extern int drmSyncobjReset(int fd, const uint32_t *handles, uint32_t handle_count); -+extern int drmSyncobjSignal(int fd, const uint32_t *handles, uint32_t handle_count); -+extern int drmSyncobjTimelineSignal(int fd, const uint32_t *handles, -+ uint64_t *points, uint32_t handle_count); -+extern int drmSyncobjTimelineWait(int fd, uint32_t *handles, uint64_t *points, -+ unsigned num_handles, -+ int64_t timeout_nsec, unsigned flags, -+ uint32_t *first_signaled); -+extern int drmSyncobjQuery(int fd, uint32_t *handles, uint64_t *points, -+ uint32_t handle_count); -+extern int drmSyncobjQuery2(int fd, uint32_t *handles, uint64_t *points, -+ uint32_t handle_count, uint32_t flags); -+extern int drmSyncobjTransfer(int fd, -+ uint32_t dst_handle, uint64_t dst_point, -+ uint32_t src_handle, uint64_t src_point, -+ uint32_t flags); -+ -+extern char * -+drmGetFormatModifierVendor(uint64_t modifier); -+ -+extern char * -+drmGetFormatModifierName(uint64_t modifier); -+ -+#ifndef fourcc_mod_get_vendor -+#define fourcc_mod_get_vendor(modifier) \ -+ (((modifier) >> 56) & 0xff) -+#endif -+ -+#if defined(__cplusplus) -+} -+#endif -+ -+#endif -diff -up firefox-103.0/third_party/drm/libdrm/moz.build.libwebrtc-screen-cast-sync firefox-103.0/third_party/drm/libdrm/moz.build ---- firefox-103.0/third_party/drm/libdrm/moz.build.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.318409017 +0200 -+++ firefox-103.0/third_party/drm/libdrm/moz.build 2022-07-28 11:45:30.318409017 +0200 -@@ -0,0 +1,16 @@ -+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -+# vim: set filetype=python: -+# This Source Code Form is subject to the terms of the Mozilla Public -+# License, v. 2.0. If a copy of the MPL was not distributed with this -+# file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ -+SOURCES += [ -+ 'mozdrm.cpp', -+] -+ -+if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": -+ CXXFLAGS += CONFIG['MOZ_GTK3_CFLAGS'] -+ -+LOCAL_INCLUDES += ['/third_party/drm'] -+ -+FINAL_LIBRARY = 'xul' -diff -up firefox-103.0/third_party/drm/libdrm/mozdrm.cpp.libwebrtc-screen-cast-sync firefox-103.0/third_party/drm/libdrm/mozdrm.cpp ---- firefox-103.0/third_party/drm/libdrm/mozdrm.cpp.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.318409017 +0200 -+++ firefox-103.0/third_party/drm/libdrm/mozdrm.cpp 2022-07-28 11:45:30.318409017 +0200 -@@ -0,0 +1,66 @@ -+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -+/* vim:expandtab:shiftwidth=4:tabstop=4: -+ */ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+#include "mozilla/Types.h" -+#include "prlink.h" -+ -+#include -+ -+#define GET_FUNC(func, lib) \ -+ func##_fn = \ -+ (decltype(func##_fn))PR_FindFunctionSymbol(lib, #func) \ -+ -+#define IS_FUNC_LOADED(func) \ -+ (func != nullptr) \ -+ -+static int (*drmGetDevices2_fn)(uint32_t flags, drmDevicePtr devices[], int max_devices); -+static void (*drmFreeDevices_fn)(drmDevicePtr devices[], int count); -+ -+bool IsDRMLibraryLoaded() { -+ static bool isLoaded = -+ (IS_FUNC_LOADED(drmGetDevices2_fn) && -+ IS_FUNC_LOADED(drmFreeDevices_fn)); -+ -+ return isLoaded; -+} -+ -+bool LoadDRMLibrary() { -+ static PRLibrary* drmLib = nullptr; -+ static bool drmInitialized = false; -+ -+ //TODO Thread safe -+ if (!drmInitialized) { -+ drmInitialized = true; -+ drmLib = PR_LoadLibrary("libdrm.so.2"); -+ if (!drmLib) { -+ return false; -+ } -+ -+ GET_FUNC(drmGetDevices2, drmLib); -+ GET_FUNC(drmFreeDevices, drmLib); -+ } -+ -+ return IsDRMLibraryLoaded(); -+} -+ -+int -+drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices) -+{ -+ if (!LoadDRMLibrary()) { -+ return 0; -+ } -+ return drmGetDevices2_fn(flags, devices, max_devices); -+} -+ -+void -+drmFreeDevices(drmDevicePtr devices[], int count) -+{ -+ if (!LoadDRMLibrary()) { -+ return; -+ } -+ return drmFreeDevices_fn(devices, count); -+} -diff -up firefox-103.0/third_party/drm/README.libwebrtc-screen-cast-sync firefox-103.0/third_party/drm/README ---- firefox-103.0/third_party/drm/README.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.318409017 +0200 -+++ firefox-103.0/third_party/drm/README 2022-07-28 11:45:30.318409017 +0200 -@@ -0,0 +1,4 @@ -+Libdrm is a drm library wrapper needed to build and run Firefox with -+Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/drm). -+ -+libdrm directory stores headers of libdrm needed for build only. -diff -up firefox-103.0/third_party/gbm/gbm/gbm.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/gbm/gbm/gbm.h ---- firefox-103.0/third_party/gbm/gbm/gbm.h.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.318409017 +0200 -+++ firefox-103.0/third_party/gbm/gbm/gbm.h 2022-07-28 11:45:30.318409017 +0200 -@@ -0,0 +1,452 @@ -+/* -+ * Copyright © 2011 Intel Corporation -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -+ * DEALINGS IN THE SOFTWARE. -+ * -+ * Authors: -+ * Benjamin Franzke -+ */ -+ -+#ifndef _GBM_H_ -+#define _GBM_H_ -+ -+#define __GBM__ 1 -+ -+#include -+#include -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+/** -+ * \file gbm.h -+ * \brief Generic Buffer Manager -+ */ -+ -+struct gbm_device; -+struct gbm_bo; -+struct gbm_surface; -+ -+/** -+ * \mainpage The Generic Buffer Manager -+ * -+ * This module provides an abstraction that the caller can use to request a -+ * buffer from the underlying memory management system for the platform. -+ * -+ * This allows the creation of portable code whilst still allowing access to -+ * the underlying memory manager. -+ */ -+ -+/** -+ * Abstraction representing the handle to a buffer allocated by the -+ * manager -+ */ -+union gbm_bo_handle { -+ void *ptr; -+ int32_t s32; -+ uint32_t u32; -+ int64_t s64; -+ uint64_t u64; -+}; -+ -+/** Format of the allocated buffer */ -+enum gbm_bo_format { -+ /** RGB with 8 bits per channel in a 32 bit value */ -+ GBM_BO_FORMAT_XRGB8888, -+ /** ARGB with 8 bits per channel in a 32 bit value */ -+ GBM_BO_FORMAT_ARGB8888 -+}; -+ -+ -+/** -+ * The FourCC format codes are taken from the drm_fourcc.h definition, and -+ * re-namespaced. New GBM formats must not be added, unless they are -+ * identical ports from drm_fourcc. -+ */ -+#define __gbm_fourcc_code(a,b,c,d) ((uint32_t)(a) | ((uint32_t)(b) << 8) | \ -+ ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24)) -+ -+#define GBM_FORMAT_BIG_ENDIAN (1<<31) /* format is big endian instead of little endian */ -+ -+/* color index */ -+#define GBM_FORMAT_C8 __gbm_fourcc_code('C', '8', ' ', ' ') /* [7:0] C */ -+ -+/* 8 bpp Red */ -+#define GBM_FORMAT_R8 __gbm_fourcc_code('R', '8', ' ', ' ') /* [7:0] R */ -+ -+/* 16 bpp Red */ -+#define GBM_FORMAT_R16 __gbm_fourcc_code('R', '1', '6', ' ') /* [15:0] R little endian */ -+ -+/* 16 bpp RG */ -+#define GBM_FORMAT_GR88 __gbm_fourcc_code('G', 'R', '8', '8') /* [15:0] G:R 8:8 little endian */ -+ -+/* 8 bpp RGB */ -+#define GBM_FORMAT_RGB332 __gbm_fourcc_code('R', 'G', 'B', '8') /* [7:0] R:G:B 3:3:2 */ -+#define GBM_FORMAT_BGR233 __gbm_fourcc_code('B', 'G', 'R', '8') /* [7:0] B:G:R 2:3:3 */ -+ -+/* 16 bpp RGB */ -+#define GBM_FORMAT_XRGB4444 __gbm_fourcc_code('X', 'R', '1', '2') /* [15:0] x:R:G:B 4:4:4:4 little endian */ -+#define GBM_FORMAT_XBGR4444 __gbm_fourcc_code('X', 'B', '1', '2') /* [15:0] x:B:G:R 4:4:4:4 little endian */ -+#define GBM_FORMAT_RGBX4444 __gbm_fourcc_code('R', 'X', '1', '2') /* [15:0] R:G:B:x 4:4:4:4 little endian */ -+#define GBM_FORMAT_BGRX4444 __gbm_fourcc_code('B', 'X', '1', '2') /* [15:0] B:G:R:x 4:4:4:4 little endian */ -+ -+#define GBM_FORMAT_ARGB4444 __gbm_fourcc_code('A', 'R', '1', '2') /* [15:0] A:R:G:B 4:4:4:4 little endian */ -+#define GBM_FORMAT_ABGR4444 __gbm_fourcc_code('A', 'B', '1', '2') /* [15:0] A:B:G:R 4:4:4:4 little endian */ -+#define GBM_FORMAT_RGBA4444 __gbm_fourcc_code('R', 'A', '1', '2') /* [15:0] R:G:B:A 4:4:4:4 little endian */ -+#define GBM_FORMAT_BGRA4444 __gbm_fourcc_code('B', 'A', '1', '2') /* [15:0] B:G:R:A 4:4:4:4 little endian */ -+ -+#define GBM_FORMAT_XRGB1555 __gbm_fourcc_code('X', 'R', '1', '5') /* [15:0] x:R:G:B 1:5:5:5 little endian */ -+#define GBM_FORMAT_XBGR1555 __gbm_fourcc_code('X', 'B', '1', '5') /* [15:0] x:B:G:R 1:5:5:5 little endian */ -+#define GBM_FORMAT_RGBX5551 __gbm_fourcc_code('R', 'X', '1', '5') /* [15:0] R:G:B:x 5:5:5:1 little endian */ -+#define GBM_FORMAT_BGRX5551 __gbm_fourcc_code('B', 'X', '1', '5') /* [15:0] B:G:R:x 5:5:5:1 little endian */ -+ -+#define GBM_FORMAT_ARGB1555 __gbm_fourcc_code('A', 'R', '1', '5') /* [15:0] A:R:G:B 1:5:5:5 little endian */ -+#define GBM_FORMAT_ABGR1555 __gbm_fourcc_code('A', 'B', '1', '5') /* [15:0] A:B:G:R 1:5:5:5 little endian */ -+#define GBM_FORMAT_RGBA5551 __gbm_fourcc_code('R', 'A', '1', '5') /* [15:0] R:G:B:A 5:5:5:1 little endian */ -+#define GBM_FORMAT_BGRA5551 __gbm_fourcc_code('B', 'A', '1', '5') /* [15:0] B:G:R:A 5:5:5:1 little endian */ -+ -+#define GBM_FORMAT_RGB565 __gbm_fourcc_code('R', 'G', '1', '6') /* [15:0] R:G:B 5:6:5 little endian */ -+#define GBM_FORMAT_BGR565 __gbm_fourcc_code('B', 'G', '1', '6') /* [15:0] B:G:R 5:6:5 little endian */ -+ -+/* 24 bpp RGB */ -+#define GBM_FORMAT_RGB888 __gbm_fourcc_code('R', 'G', '2', '4') /* [23:0] R:G:B little endian */ -+#define GBM_FORMAT_BGR888 __gbm_fourcc_code('B', 'G', '2', '4') /* [23:0] B:G:R little endian */ -+ -+/* 32 bpp RGB */ -+#define GBM_FORMAT_XRGB8888 __gbm_fourcc_code('X', 'R', '2', '4') /* [31:0] x:R:G:B 8:8:8:8 little endian */ -+#define GBM_FORMAT_XBGR8888 __gbm_fourcc_code('X', 'B', '2', '4') /* [31:0] x:B:G:R 8:8:8:8 little endian */ -+#define GBM_FORMAT_RGBX8888 __gbm_fourcc_code('R', 'X', '2', '4') /* [31:0] R:G:B:x 8:8:8:8 little endian */ -+#define GBM_FORMAT_BGRX8888 __gbm_fourcc_code('B', 'X', '2', '4') /* [31:0] B:G:R:x 8:8:8:8 little endian */ -+ -+#define GBM_FORMAT_ARGB8888 __gbm_fourcc_code('A', 'R', '2', '4') /* [31:0] A:R:G:B 8:8:8:8 little endian */ -+#define GBM_FORMAT_ABGR8888 __gbm_fourcc_code('A', 'B', '2', '4') /* [31:0] A:B:G:R 8:8:8:8 little endian */ -+#define GBM_FORMAT_RGBA8888 __gbm_fourcc_code('R', 'A', '2', '4') /* [31:0] R:G:B:A 8:8:8:8 little endian */ -+#define GBM_FORMAT_BGRA8888 __gbm_fourcc_code('B', 'A', '2', '4') /* [31:0] B:G:R:A 8:8:8:8 little endian */ -+ -+#define GBM_FORMAT_XRGB2101010 __gbm_fourcc_code('X', 'R', '3', '0') /* [31:0] x:R:G:B 2:10:10:10 little endian */ -+#define GBM_FORMAT_XBGR2101010 __gbm_fourcc_code('X', 'B', '3', '0') /* [31:0] x:B:G:R 2:10:10:10 little endian */ -+#define GBM_FORMAT_RGBX1010102 __gbm_fourcc_code('R', 'X', '3', '0') /* [31:0] R:G:B:x 10:10:10:2 little endian */ -+#define GBM_FORMAT_BGRX1010102 __gbm_fourcc_code('B', 'X', '3', '0') /* [31:0] B:G:R:x 10:10:10:2 little endian */ -+ -+#define GBM_FORMAT_ARGB2101010 __gbm_fourcc_code('A', 'R', '3', '0') /* [31:0] A:R:G:B 2:10:10:10 little endian */ -+#define GBM_FORMAT_ABGR2101010 __gbm_fourcc_code('A', 'B', '3', '0') /* [31:0] A:B:G:R 2:10:10:10 little endian */ -+#define GBM_FORMAT_RGBA1010102 __gbm_fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */ -+#define GBM_FORMAT_BGRA1010102 __gbm_fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */ -+ -+/* -+ * Floating point 64bpp RGB -+ * IEEE 754-2008 binary16 half-precision float -+ * [15:0] sign:exponent:mantissa 1:5:10 -+ */ -+#define GBM_FORMAT_XBGR16161616F __gbm_fourcc_code('X', 'B', '4', 'H') /* [63:0] x:B:G:R 16:16:16:16 little endian */ -+ -+#define GBM_FORMAT_ABGR16161616F __gbm_fourcc_code('A', 'B', '4', 'H') /* [63:0] A:B:G:R 16:16:16:16 little endian */ -+ -+/* packed YCbCr */ -+#define GBM_FORMAT_YUYV __gbm_fourcc_code('Y', 'U', 'Y', 'V') /* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */ -+#define GBM_FORMAT_YVYU __gbm_fourcc_code('Y', 'V', 'Y', 'U') /* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */ -+#define GBM_FORMAT_UYVY __gbm_fourcc_code('U', 'Y', 'V', 'Y') /* [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian */ -+#define GBM_FORMAT_VYUY __gbm_fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */ -+ -+#define GBM_FORMAT_AYUV __gbm_fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */ -+ -+/* -+ * 2 plane YCbCr -+ * index 0 = Y plane, [7:0] Y -+ * index 1 = Cr:Cb plane, [15:0] Cr:Cb little endian -+ * or -+ * index 1 = Cb:Cr plane, [15:0] Cb:Cr little endian -+ */ -+#define GBM_FORMAT_NV12 __gbm_fourcc_code('N', 'V', '1', '2') /* 2x2 subsampled Cr:Cb plane */ -+#define GBM_FORMAT_NV21 __gbm_fourcc_code('N', 'V', '2', '1') /* 2x2 subsampled Cb:Cr plane */ -+#define GBM_FORMAT_NV16 __gbm_fourcc_code('N', 'V', '1', '6') /* 2x1 subsampled Cr:Cb plane */ -+#define GBM_FORMAT_NV61 __gbm_fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */ -+ -+/* -+ * 3 plane YCbCr -+ * index 0: Y plane, [7:0] Y -+ * index 1: Cb plane, [7:0] Cb -+ * index 2: Cr plane, [7:0] Cr -+ * or -+ * index 1: Cr plane, [7:0] Cr -+ * index 2: Cb plane, [7:0] Cb -+ */ -+#define GBM_FORMAT_YUV410 __gbm_fourcc_code('Y', 'U', 'V', '9') /* 4x4 subsampled Cb (1) and Cr (2) planes */ -+#define GBM_FORMAT_YVU410 __gbm_fourcc_code('Y', 'V', 'U', '9') /* 4x4 subsampled Cr (1) and Cb (2) planes */ -+#define GBM_FORMAT_YUV411 __gbm_fourcc_code('Y', 'U', '1', '1') /* 4x1 subsampled Cb (1) and Cr (2) planes */ -+#define GBM_FORMAT_YVU411 __gbm_fourcc_code('Y', 'V', '1', '1') /* 4x1 subsampled Cr (1) and Cb (2) planes */ -+#define GBM_FORMAT_YUV420 __gbm_fourcc_code('Y', 'U', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes */ -+#define GBM_FORMAT_YVU420 __gbm_fourcc_code('Y', 'V', '1', '2') /* 2x2 subsampled Cr (1) and Cb (2) planes */ -+#define GBM_FORMAT_YUV422 __gbm_fourcc_code('Y', 'U', '1', '6') /* 2x1 subsampled Cb (1) and Cr (2) planes */ -+#define GBM_FORMAT_YVU422 __gbm_fourcc_code('Y', 'V', '1', '6') /* 2x1 subsampled Cr (1) and Cb (2) planes */ -+#define GBM_FORMAT_YUV444 __gbm_fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */ -+#define GBM_FORMAT_YVU444 __gbm_fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */ -+ -+struct gbm_format_name_desc { -+ char name[5]; -+}; -+ -+/** -+ * Flags to indicate the intended use for the buffer - these are passed into -+ * gbm_bo_create(). The caller must set the union of all the flags that are -+ * appropriate -+ * -+ * \sa Use gbm_device_is_format_supported() to check if the combination of format -+ * and use flags are supported -+ */ -+enum gbm_bo_flags { -+ /** -+ * Buffer is going to be presented to the screen using an API such as KMS -+ */ -+ GBM_BO_USE_SCANOUT = (1 << 0), -+ /** -+ * Buffer is going to be used as cursor -+ */ -+ GBM_BO_USE_CURSOR = (1 << 1), -+ /** -+ * Deprecated -+ */ -+ GBM_BO_USE_CURSOR_64X64 = GBM_BO_USE_CURSOR, -+ /** -+ * Buffer is to be used for rendering - for example it is going to be used -+ * as the storage for a color buffer -+ */ -+ GBM_BO_USE_RENDERING = (1 << 2), -+ /** -+ * Buffer can be used for gbm_bo_write. This is guaranteed to work -+ * with GBM_BO_USE_CURSOR, but may not work for other combinations. -+ */ -+ GBM_BO_USE_WRITE = (1 << 3), -+ /** -+ * Buffer is linear, i.e. not tiled. -+ */ -+ GBM_BO_USE_LINEAR = (1 << 4), -+ /** -+ * Buffer is protected, i.e. encrypted and not readable by CPU or any -+ * other non-secure / non-trusted components nor by non-trusted OpenGL, -+ * OpenCL, and Vulkan applications. -+ */ -+ GBM_BO_USE_PROTECTED = (1 << 5), -+}; -+ -+int -+gbm_device_get_fd(struct gbm_device *gbm); -+ -+const char * -+gbm_device_get_backend_name(struct gbm_device *gbm); -+ -+int -+gbm_device_is_format_supported(struct gbm_device *gbm, -+ uint32_t format, uint32_t flags); -+ -+int -+gbm_device_get_format_modifier_plane_count(struct gbm_device *gbm, -+ uint32_t format, -+ uint64_t modifier); -+ -+void -+gbm_device_destroy(struct gbm_device *gbm); -+ -+struct gbm_device * -+gbm_create_device(int fd); -+ -+struct gbm_bo * -+gbm_bo_create(struct gbm_device *gbm, -+ uint32_t width, uint32_t height, -+ uint32_t format, uint32_t flags); -+ -+struct gbm_bo * -+gbm_bo_create_with_modifiers(struct gbm_device *gbm, -+ uint32_t width, uint32_t height, -+ uint32_t format, -+ const uint64_t *modifiers, -+ const unsigned int count); -+ -+struct gbm_bo * -+gbm_bo_create_with_modifiers2(struct gbm_device *gbm, -+ uint32_t width, uint32_t height, -+ uint32_t format, -+ const uint64_t *modifiers, -+ const unsigned int count, -+ uint32_t flags); -+ -+#define GBM_BO_IMPORT_WL_BUFFER 0x5501 -+#define GBM_BO_IMPORT_EGL_IMAGE 0x5502 -+#define GBM_BO_IMPORT_FD 0x5503 -+#define GBM_BO_IMPORT_FD_MODIFIER 0x5504 -+ -+struct gbm_import_fd_data { -+ int fd; -+ uint32_t width; -+ uint32_t height; -+ uint32_t stride; -+ uint32_t format; -+}; -+ -+#define GBM_MAX_PLANES 4 -+ -+struct gbm_import_fd_modifier_data { -+ uint32_t width; -+ uint32_t height; -+ uint32_t format; -+ uint32_t num_fds; -+ int fds[GBM_MAX_PLANES]; -+ int strides[GBM_MAX_PLANES]; -+ int offsets[GBM_MAX_PLANES]; -+ uint64_t modifier; -+}; -+ -+struct gbm_bo * -+gbm_bo_import(struct gbm_device *gbm, uint32_t type, -+ void *buffer, uint32_t flags); -+ -+/** -+ * Flags to indicate the type of mapping for the buffer - these are -+ * passed into gbm_bo_map(). The caller must set the union of all the -+ * flags that are appropriate. -+ * -+ * These flags are independent of the GBM_BO_USE_* creation flags. However, -+ * mapping the buffer may require copying to/from a staging buffer. -+ * -+ * See also: pipe_map_flags -+ */ -+enum gbm_bo_transfer_flags { -+ /** -+ * Buffer contents read back (or accessed directly) at transfer -+ * create time. -+ */ -+ GBM_BO_TRANSFER_READ = (1 << 0), -+ /** -+ * Buffer contents will be written back at unmap time -+ * (or modified as a result of being accessed directly). -+ */ -+ GBM_BO_TRANSFER_WRITE = (1 << 1), -+ /** -+ * Read/modify/write -+ */ -+ GBM_BO_TRANSFER_READ_WRITE = (GBM_BO_TRANSFER_READ | GBM_BO_TRANSFER_WRITE), -+}; -+ -+void * -+gbm_bo_map(struct gbm_bo *bo, -+ uint32_t x, uint32_t y, uint32_t width, uint32_t height, -+ uint32_t flags, uint32_t *stride, void **map_data); -+ -+void -+gbm_bo_unmap(struct gbm_bo *bo, void *map_data); -+ -+uint32_t -+gbm_bo_get_width(struct gbm_bo *bo); -+ -+uint32_t -+gbm_bo_get_height(struct gbm_bo *bo); -+ -+uint32_t -+gbm_bo_get_stride(struct gbm_bo *bo); -+ -+uint32_t -+gbm_bo_get_stride_for_plane(struct gbm_bo *bo, int plane); -+ -+uint32_t -+gbm_bo_get_format(struct gbm_bo *bo); -+ -+uint32_t -+gbm_bo_get_bpp(struct gbm_bo *bo); -+ -+uint32_t -+gbm_bo_get_offset(struct gbm_bo *bo, int plane); -+ -+struct gbm_device * -+gbm_bo_get_device(struct gbm_bo *bo); -+ -+union gbm_bo_handle -+gbm_bo_get_handle(struct gbm_bo *bo); -+ -+int -+gbm_bo_get_fd(struct gbm_bo *bo); -+ -+uint64_t -+gbm_bo_get_modifier(struct gbm_bo *bo); -+ -+int -+gbm_bo_get_plane_count(struct gbm_bo *bo); -+ -+union gbm_bo_handle -+gbm_bo_get_handle_for_plane(struct gbm_bo *bo, int plane); -+ -+int -+gbm_bo_get_fd_for_plane(struct gbm_bo *bo, int plane); -+ -+int -+gbm_bo_write(struct gbm_bo *bo, const void *buf, size_t count); -+ -+void -+gbm_bo_set_user_data(struct gbm_bo *bo, void *data, -+ void (*destroy_user_data)(struct gbm_bo *, void *)); -+ -+void * -+gbm_bo_get_user_data(struct gbm_bo *bo); -+ -+void -+gbm_bo_destroy(struct gbm_bo *bo); -+ -+struct gbm_surface * -+gbm_surface_create(struct gbm_device *gbm, -+ uint32_t width, uint32_t height, -+ uint32_t format, uint32_t flags); -+ -+struct gbm_surface * -+gbm_surface_create_with_modifiers(struct gbm_device *gbm, -+ uint32_t width, uint32_t height, -+ uint32_t format, -+ const uint64_t *modifiers, -+ const unsigned int count); -+ -+struct gbm_surface * -+gbm_surface_create_with_modifiers2(struct gbm_device *gbm, -+ uint32_t width, uint32_t height, -+ uint32_t format, -+ const uint64_t *modifiers, -+ const unsigned int count, -+ uint32_t flags); -+ -+struct gbm_bo * -+gbm_surface_lock_front_buffer(struct gbm_surface *surface); -+ -+void -+gbm_surface_release_buffer(struct gbm_surface *surface, struct gbm_bo *bo); -+ -+int -+gbm_surface_has_free_buffers(struct gbm_surface *surface); -+ -+void -+gbm_surface_destroy(struct gbm_surface *surface); -+ -+char * -+gbm_format_get_name(uint32_t gbm_format, struct gbm_format_name_desc *desc); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif -diff -up firefox-103.0/third_party/gbm/libgbm/moz.build.libwebrtc-screen-cast-sync firefox-103.0/third_party/gbm/libgbm/moz.build ---- firefox-103.0/third_party/gbm/libgbm/moz.build.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.318409017 +0200 -+++ firefox-103.0/third_party/gbm/libgbm/moz.build 2022-07-28 11:45:30.318409017 +0200 -@@ -0,0 +1,16 @@ -+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -+# vim: set filetype=python: -+# This Source Code Form is subject to the terms of the Mozilla Public -+# License, v. 2.0. If a copy of the MPL was not distributed with this -+# file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ -+SOURCES += [ -+ 'mozgbm.cpp', -+] -+ -+if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": -+ CXXFLAGS += CONFIG['MOZ_GTK3_CFLAGS'] -+ -+LOCAL_INCLUDES += ['/third_party/gbm'] -+ -+FINAL_LIBRARY = 'xul' -diff -up firefox-103.0/third_party/gbm/libgbm/mozgbm.cpp.libwebrtc-screen-cast-sync firefox-103.0/third_party/gbm/libgbm/mozgbm.cpp ---- firefox-103.0/third_party/gbm/libgbm/mozgbm.cpp.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.318409017 +0200 -+++ firefox-103.0/third_party/gbm/libgbm/mozgbm.cpp 2022-07-28 11:45:30.318409017 +0200 -@@ -0,0 +1,66 @@ -+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -+/* vim:expandtab:shiftwidth=4:tabstop=4: -+ */ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+#include "mozilla/Types.h" -+#include "prlink.h" -+ -+#include -+ -+#define GET_FUNC(func, lib) \ -+ func##_fn = \ -+ (decltype(func##_fn))PR_FindFunctionSymbol(lib, #func) \ -+ -+#define IS_FUNC_LOADED(func) \ -+ (func != nullptr) \ -+ -+static struct gbm_device * (*gbm_create_device_fn)(int fd); -+static void (*gbm_device_destroy_fn)(struct gbm_device* gbm); -+ -+bool IsGBMLibraryLoaded() { -+ static bool isLoaded = -+ (IS_FUNC_LOADED(gbm_create_device_fn) && -+ IS_FUNC_LOADED(gbm_device_destroy_fn)); -+ -+ return isLoaded; -+} -+ -+bool LoadGBMLibrary() { -+ static PRLibrary* gbmLib = nullptr; -+ static bool gbmInitialized = false; -+ -+ //TODO Thread safe -+ if (!gbmInitialized) { -+ gbmInitialized = true; -+ gbmLib = PR_LoadLibrary("libgbm.so.1"); -+ if (!gbmLib) { -+ return false; -+ } -+ -+ GET_FUNC(gbm_create_device, gbmLib); -+ GET_FUNC(gbm_device_destroy, gbmLib); -+ } -+ -+ return IsGBMLibraryLoaded(); -+} -+ -+struct gbm_device * -+gbm_create_device(int fd) -+{ -+ if (!LoadGBMLibrary()) { -+ return nullptr; -+ } -+ return gbm_create_device_fn(fd); -+} -+ -+void -+gbm_device_destroy(struct gbm_device* gbm) -+{ -+ if (!LoadGBMLibrary()) { -+ return; -+ } -+ return gbm_device_destroy_fn(gbm); -+} -diff -up firefox-103.0/third_party/gbm/README.libwebrtc-screen-cast-sync firefox-103.0/third_party/gbm/README ---- firefox-103.0/third_party/gbm/README.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.318409017 +0200 -+++ firefox-103.0/third_party/gbm/README 2022-07-28 11:45:30.318409017 +0200 -@@ -0,0 +1,4 @@ -+Libgbm is a gbm library wrapper needed to build and run Firefox with -+Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/gbm). -+ -+libgbm directory stores headers of libgbm needed for build only. -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.libwebrtc-screen-cast-sync 2022-07-18 20:44:36.000000000 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build 2022-07-29 11:28:39.473827919 +0200 -@@ -26,6 +26,8 @@ LOCAL_INCLUDES += [ - "/ipc/chromium/src", - "/media/libyuv/", - "/media/libyuv/libyuv/include/", -+ "/third_party/drm/", -+ "/third_party/gbm/", - "/third_party/libwebrtc/", - "/third_party/libwebrtc/third_party/abseil-cpp/", - "/third_party/pipewire/", -@@ -133,15 +135,18 @@ if CONFIG["OS_TARGET"] == "OpenBSD": - ] - - SOURCES += [ -- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" -+ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" - ] - - UNIFIED_SOURCES += [ - "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc", -- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_x11.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/shared_x_display.cc", -- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_x11.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/window_finder_x11.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/window_list_utils.cc", -@@ -241,7 +246,12 @@ if CONFIG["CPU_ARCH"] == "arm": - DEFINES["_GNU_SOURCE"] = True - - SOURCES += [ -- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" -+ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" - ] - - UNIFIED_SOURCES += [ -@@ -300,12 +310,12 @@ if CONFIG["CPU_ARCH"] == "aarch64" and C - DEFINES["_GNU_SOURCE"] = True - - SOURCES += [ -- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" -- ] -- -- UNIFIED_SOURCES += [ -- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", -- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc" -+ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" - ] - - if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux": -@@ -318,12 +328,12 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFI - DEFINES["_GNU_SOURCE"] = True - - SOURCES += [ -- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" -- ] -- -- UNIFIED_SOURCES += [ -- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", -- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc" -+ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" - ] - - if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "Linux": -@@ -332,12 +342,26 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CO - DEFINES["_GNU_SOURCE"] = True - - SOURCES += [ -- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" -+ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" - ] - -- UNIFIED_SOURCES += [ -- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", -- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc" -+if CONFIG["CPU_ARCH"] == "ppc64le" and CONFIG["OS_TARGET"] == "Linux": -+ -+ DEFINES["WEBRTC_USE_PIPEWIRE"] = True -+ DEFINES["_GNU_SOURCE"] = True -+ -+ SOURCES += [ -+ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" - ] - - if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "Linux": -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc.libwebrtc-screen-cast-sync 2022-07-18 20:44:36.000000000 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc 2022-07-28 11:45:30.318409017 +0200 -@@ -14,6 +14,9 @@ - #elif defined(WEBRTC_WIN) - #include "modules/desktop_capture/win/full_screen_win_application_handler.h" - #endif -+#if defined(WEBRTC_USE_PIPEWIRE) -+#include "modules/desktop_capture/linux/shared_screencast_stream.h" -+#endif - - namespace webrtc { - -@@ -35,6 +38,9 @@ DesktopCaptureOptions DesktopCaptureOpti - #if defined(WEBRTC_USE_X11) - result.set_x_display(SharedXDisplay::CreateDefault()); - #endif -+#if defined(WEBRTC_USE_PIPEWIRE) -+ result.set_screencast_stream(SharedScreenCastStream::CreateDefault()); -+#endif - #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) - result.set_configuration_monitor(new DesktopConfigurationMonitor()); - result.set_full_screen_window_detector( -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h.libwebrtc-screen-cast-sync 2022-07-18 20:44:32.000000000 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h 2022-07-28 11:45:30.319409011 +0200 -@@ -17,6 +17,10 @@ - #include "modules/desktop_capture/linux/shared_x_display.h" - #endif - -+#if defined(WEBRTC_USE_PIPEWIRE) -+#include "modules/desktop_capture/linux/shared_screencast_stream.h" -+#endif -+ - #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) - #include "modules/desktop_capture/mac/desktop_configuration_monitor.h" - #endif -@@ -149,13 +153,26 @@ class RTC_EXPORT DesktopCaptureOptions { - #if defined(WEBRTC_USE_PIPEWIRE) - bool allow_pipewire() const { return allow_pipewire_; } - void set_allow_pipewire(bool allow) { allow_pipewire_ = allow; } -+ -+ const rtc::scoped_refptr& screencast_stream() const { -+ return screencast_stream_; -+ } -+ void set_screencast_stream( -+ rtc::scoped_refptr stream) { -+ screencast_stream_ = stream; -+ } - #endif - - private: - #if defined(WEBRTC_USE_X11) - rtc::scoped_refptr x_display_; - #endif -- -+#if defined(WEBRTC_USE_PIPEWIRE) -+ // An instance of shared PipeWire ScreenCast stream we share between -+ // BaseCapturerPipeWire and MouseCursorMonitorPipeWire as cursor information -+ // is sent together with screen content. -+ rtc::scoped_refptr screencast_stream_; -+#endif - #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) - rtc::scoped_refptr configuration_monitor_; - bool allow_iosurface_ = false; -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc.libwebrtc-screen-cast-sync 2022-07-18 20:44:26.000000000 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc 2022-07-28 11:45:30.319409011 +0200 -@@ -10,937 +10,67 @@ - - #include "modules/desktop_capture/linux/base_capturer_pipewire.h" - --#include --#include --#include --#include -- --#include --#include --#include -- --#include --#include --#include -- --#include "absl/memory/memory.h" - #include "modules/desktop_capture/desktop_capture_options.h" - #include "modules/desktop_capture/desktop_capturer.h" - #include "rtc_base/checks.h" - #include "rtc_base/logging.h" - --#if defined(WEBRTC_DLOPEN_PIPEWIRE) --#include "modules/desktop_capture/linux/pipewire_stubs.h" -- --using modules_desktop_capture_linux::InitializeStubs; --using modules_desktop_capture_linux::kModulePipewire; --using modules_desktop_capture_linux::StubPathMap; --#endif // defined(WEBRTC_DLOPEN_PIPEWIRE) -- - namespace webrtc { - --const char kDesktopBusName[] = "org.freedesktop.portal.Desktop"; --const char kDesktopObjectPath[] = "/org/freedesktop/portal/desktop"; --const char kDesktopRequestObjectPath[] = -- "/org/freedesktop/portal/desktop/request"; --const char kSessionInterfaceName[] = "org.freedesktop.portal.Session"; --const char kRequestInterfaceName[] = "org.freedesktop.portal.Request"; --const char kScreenCastInterfaceName[] = "org.freedesktop.portal.ScreenCast"; -- --const int kBytesPerPixel = 4; -- --#if defined(WEBRTC_DLOPEN_PIPEWIRE) --const char kPipeWireLib[] = "libpipewire-0.2.so.1"; --#endif -- --// static --struct dma_buf_sync { -- uint64_t flags; --}; --#define DMA_BUF_SYNC_READ (1 << 0) --#define DMA_BUF_SYNC_START (0 << 2) --#define DMA_BUF_SYNC_END (1 << 2) --#define DMA_BUF_BASE 'b' --#define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync) -- --static void SyncDmaBuf(int fd, uint64_t start_or_end) { -- struct dma_buf_sync sync = { 0 }; -- -- sync.flags = start_or_end | DMA_BUF_SYNC_READ; -- -- while(true) { -- int ret; -- ret = ioctl (fd, DMA_BUF_IOCTL_SYNC, &sync); -- if (ret == -1 && errno == EINTR) { -- continue; -- } else if (ret == -1) { -- RTC_LOG(LS_ERROR) << "Failed to synchronize DMA buffer: " << g_strerror(errno); -- break; -- } else { -- break; -- } -- } --} -- --// static --void BaseCapturerPipeWire::OnCoreError(void *data, -- uint32_t id, -- int seq, -- int res, -- const char *message) { -- RTC_LOG(LS_ERROR) << "core error: " << message; --} -- --// static --void BaseCapturerPipeWire::OnStreamStateChanged(void* data, -- pw_stream_state old_state, -- pw_stream_state state, -- const char* error_message) { -- BaseCapturerPipeWire* that = static_cast(data); -- RTC_DCHECK(that); -- -- switch (state) { -- case PW_STREAM_STATE_ERROR: -- RTC_LOG(LS_ERROR) << "PipeWire stream state error: " << error_message; -- break; -- case PW_STREAM_STATE_PAUSED: -- case PW_STREAM_STATE_STREAMING: -- case PW_STREAM_STATE_UNCONNECTED: -- case PW_STREAM_STATE_CONNECTING: -- break; -- } --} -- --// static --void BaseCapturerPipeWire::OnStreamParamChanged(void *data, uint32_t id, -- const struct spa_pod *format) { -- BaseCapturerPipeWire* that = static_cast(data); -- RTC_DCHECK(that); -- -- RTC_LOG(LS_INFO) << "PipeWire stream param changed."; -- -- if (!format || id != SPA_PARAM_Format) { -- return; -- } -- -- spa_format_video_raw_parse(format, &that->spa_video_format_); -- -- auto width = that->spa_video_format_.size.width; -- auto height = that->spa_video_format_.size.height; -- // In order to be able to build in the non unified environment kBytesPerPixel -- // must be fully qualified, see Bug 1725145 -- auto stride = SPA_ROUND_UP_N(width * BasicDesktopFrame::kBytesPerPixel, 4); -- auto size = height * stride; -- -- that->desktop_size_ = DesktopSize(width, height); -- -- uint8_t buffer[1024] = {}; -- auto builder = spa_pod_builder{buffer, sizeof(buffer)}; -- -- // Setup buffers and meta header for new format. -- const struct spa_pod* params[3]; -- params[0] = reinterpret_cast(spa_pod_builder_add_object(&builder, -- SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers, -- SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int((1<(spa_pod_builder_add_object(&builder, -- SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, -- SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header), -- SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_header)))); -- params[2] = reinterpret_cast(spa_pod_builder_add_object(&builder, -- SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, -- SPA_PARAM_META_type, SPA_POD_Id (SPA_META_VideoCrop), -- SPA_PARAM_META_size, SPA_POD_Int (sizeof(struct spa_meta_region)))); -- pw_stream_update_params(that->pw_stream_, params, 3); --} -- --// static --void BaseCapturerPipeWire::OnStreamProcess(void* data) { -- BaseCapturerPipeWire* that = static_cast(data); -- RTC_DCHECK(that); -- -- struct pw_buffer *next_buffer; -- struct pw_buffer *buffer = nullptr; -- -- next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); -- while (next_buffer) { -- buffer = next_buffer; -- next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); -- -- if (next_buffer) { -- pw_stream_queue_buffer (that->pw_stream_, buffer); -- } -- } -- -- if (!buffer) { -- return; -- } -- -- that->HandleBuffer(buffer); -- -- pw_stream_queue_buffer(that->pw_stream_, buffer); --} -- --BaseCapturerPipeWire::BaseCapturerPipeWire(CaptureSourceType source_type) -- : capture_source_type_(source_type) {} -- --BaseCapturerPipeWire::~BaseCapturerPipeWire() { -- if (pw_main_loop_) { -- pw_thread_loop_stop(pw_main_loop_); -- } -- -- if (pw_stream_) { -- pw_stream_destroy(pw_stream_); -- } -- -- if (pw_core_) { -- pw_core_disconnect(pw_core_); -- } -- -- if (pw_context_) { -- pw_context_destroy(pw_context_); -- } -- -- if (pw_main_loop_) { -- pw_thread_loop_destroy(pw_main_loop_); -- } -- -- if (start_request_signal_id_) { -- g_dbus_connection_signal_unsubscribe(connection_, start_request_signal_id_); -- } -- if (sources_request_signal_id_) { -- g_dbus_connection_signal_unsubscribe(connection_, -- sources_request_signal_id_); -- } -- if (session_request_signal_id_) { -- g_dbus_connection_signal_unsubscribe(connection_, -- session_request_signal_id_); -- } -- -- if (session_handle_) { -- GDBusMessage* message = g_dbus_message_new_method_call( -- kDesktopBusName, session_handle_, kSessionInterfaceName, "Close"); -- if (message) { -- GError* error = nullptr; -- g_dbus_connection_send_message(connection_, message, -- G_DBUS_SEND_MESSAGE_FLAGS_NONE, -- /*out_serial=*/nullptr, &error); -- if (error) { -- RTC_LOG(LS_ERROR) << "Failed to close the session: " << error->message; -- g_error_free(error); -- } -- g_object_unref(message); -- } -- } -- -- g_free(start_handle_); -- g_free(sources_handle_); -- g_free(session_handle_); -- g_free(portal_handle_); -- -- if (cancellable_) { -- g_cancellable_cancel(cancellable_); -- g_object_unref(cancellable_); -- cancellable_ = nullptr; -- } -- -- if (proxy_) { -- g_object_unref(proxy_); -- proxy_ = nullptr; -+BaseCapturerPipeWire::BaseCapturerPipeWire(const DesktopCaptureOptions& options) -+ : options_(options) { -+ screencast_portal_ = std::make_unique( -+ ScreenCastPortal::CaptureSourceType::kAnyScreenContent, this); -+} -+ -+BaseCapturerPipeWire::~BaseCapturerPipeWire() {} -+ -+void BaseCapturerPipeWire::OnScreenCastRequestResult( -+ ScreenCastPortal::RequestResponse result, -+ uint32_t stream_node_id, -+ int fd) { -+ if (result != ScreenCastPortal::RequestResponse::kSuccess || -+ !options_.screencast_stream()->StartScreenCastStream(stream_node_id, -+ fd)) { -+ capturer_failed_ = true; -+ RTC_LOG(LS_ERROR) << "ScreenCastPortal failed: " -+ << static_cast(result); - } -- -- if (pw_fd_ != -1) { -- close(pw_fd_); -- } --} -- --void BaseCapturerPipeWire::InitPortal() { -- cancellable_ = g_cancellable_new(); -- g_dbus_proxy_new_for_bus( -- G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, /*info=*/nullptr, -- kDesktopBusName, kDesktopObjectPath, kScreenCastInterfaceName, -- cancellable_, -- reinterpret_cast(OnProxyRequested), this); --} -- --void BaseCapturerPipeWire::InitPipeWire() { --#if defined(WEBRTC_DLOPEN_PIPEWIRE) -- StubPathMap paths; -- -- // Check if the PipeWire library is available. -- paths[kModulePipewire].push_back(kPipeWireLib); -- if (!InitializeStubs(paths)) { -- RTC_LOG(LS_ERROR) << "Failed to load the PipeWire library and symbols."; -- portal_init_failed_ = true; -- return; -- } --#endif // defined(WEBRTC_DLOPEN_PIPEWIRE) -- -- pw_init(/*argc=*/nullptr, /*argc=*/nullptr); -- -- pw_main_loop_ = pw_thread_loop_new("pipewire-main-loop", nullptr); -- pw_context_ = pw_context_new(pw_thread_loop_get_loop(pw_main_loop_), nullptr, 0); -- if (!pw_context_) { -- RTC_LOG(LS_ERROR) << "Failed to create PipeWire context"; -- return; -- } -- -- pw_core_ = pw_context_connect_fd(pw_context_, pw_fd_, nullptr, 0); -- if (!pw_core_) { -- RTC_LOG(LS_ERROR) << "Failed to connect PipeWire context"; -- return; -- } -- -- // Initialize event handlers, remote end and stream-related. -- pw_core_events_.version = PW_VERSION_CORE_EVENTS; -- pw_core_events_.error = &OnCoreError; -- -- pw_stream_events_.version = PW_VERSION_STREAM_EVENTS; -- pw_stream_events_.state_changed = &OnStreamStateChanged; -- pw_stream_events_.param_changed = &OnStreamParamChanged; -- pw_stream_events_.process = &OnStreamProcess; -- -- pw_core_add_listener(pw_core_, &spa_core_listener_, &pw_core_events_, this); -- -- pw_stream_ = CreateReceivingStream(); -- if (!pw_stream_) { -- RTC_LOG(LS_ERROR) << "Failed to create PipeWire stream"; -- return; -- } -- -- if (pw_thread_loop_start(pw_main_loop_) < 0) { -- RTC_LOG(LS_ERROR) << "Failed to start main PipeWire loop"; -- portal_init_failed_ = true; -- } -- -- RTC_LOG(LS_INFO) << "PipeWire remote opened."; --} -- --pw_stream* BaseCapturerPipeWire::CreateReceivingStream() { -- spa_rectangle pwMinScreenBounds = spa_rectangle{1, 1}; -- spa_rectangle pwMaxScreenBounds = spa_rectangle{UINT32_MAX, UINT32_MAX}; -- -- auto stream = pw_stream_new(pw_core_, "webrtc-pipewire-stream", nullptr); -- -- if (!stream) { -- RTC_LOG(LS_ERROR) << "Could not create receiving stream."; -- return nullptr; -- } -- -- uint8_t buffer[1024] = {}; -- const spa_pod* params[2]; -- spa_pod_builder builder = SPA_POD_BUILDER_INIT(buffer, sizeof (buffer)); -- -- params[0] = reinterpret_cast(spa_pod_builder_add_object(&builder, -- SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, -- SPA_FORMAT_mediaType, SPA_POD_Id(SPA_MEDIA_TYPE_video), -- SPA_FORMAT_mediaSubtype, SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw), -- SPA_FORMAT_VIDEO_format, SPA_POD_CHOICE_ENUM_Id(5, SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_RGBx, SPA_VIDEO_FORMAT_RGBA, -- SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_BGRA), -- SPA_FORMAT_VIDEO_size, SPA_POD_CHOICE_RANGE_Rectangle(&pwMinScreenBounds, -- &pwMinScreenBounds, -- &pwMaxScreenBounds), -- 0)); -- pw_stream_add_listener(stream, &spa_stream_listener_, &pw_stream_events_, this); -- -- if (pw_stream_connect(stream, PW_DIRECTION_INPUT, pw_stream_node_id_, -- PW_STREAM_FLAG_AUTOCONNECT, params, 1) != 0) { -- RTC_LOG(LS_ERROR) << "Could not connect receiving stream."; -- portal_init_failed_ = true; -- } -- -- return stream; - } - --static void SpaBufferUnmap(unsigned char *map, int map_size, bool IsDMABuf, int fd) { -- if (map) { -- if (IsDMABuf) { -- SyncDmaBuf(fd, DMA_BUF_SYNC_END); -- } -- munmap(map, map_size); -+void BaseCapturerPipeWire::OnScreenCastSessionClosed() { -+ if (!capturer_failed_) { -+ options_.screencast_stream()->StopScreenCastStream(); - } - } - --void BaseCapturerPipeWire::HandleBuffer(pw_buffer* buffer) { -- spa_buffer* spaBuffer = buffer->buffer; -- uint8_t *map = nullptr; -- uint8_t* src = nullptr; -- -- if (spaBuffer->datas[0].chunk->size == 0) { -- RTC_LOG(LS_ERROR) << "Failed to get video stream: Zero size."; -- return; -- } -- -- switch (spaBuffer->datas[0].type) { -- case SPA_DATA_MemFd: -- case SPA_DATA_DmaBuf: -- map = static_cast(mmap( -- nullptr, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, -- PROT_READ, MAP_PRIVATE, spaBuffer->datas[0].fd, 0)); -- if (map == MAP_FAILED) { -- RTC_LOG(LS_ERROR) << "Failed to mmap memory: " << std::strerror(errno); -- return; -- } -- if (spaBuffer->datas[0].type == SPA_DATA_DmaBuf) { -- SyncDmaBuf(spaBuffer->datas[0].fd, DMA_BUF_SYNC_START); -- } -- src = SPA_MEMBER(map, spaBuffer->datas[0].mapoffset, uint8_t); -- break; -- case SPA_DATA_MemPtr: -- map = nullptr; -- src = static_cast(spaBuffer->datas[0].data); -- break; -- default: -- return; -- } -- -- if (!src) { -- RTC_LOG(LS_ERROR) << "Failed to get video stream: Wrong data after mmap()"; -- SpaBufferUnmap(map, -- spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, -- spaBuffer->datas[0].type == SPA_DATA_DmaBuf, spaBuffer->datas[0].fd); -- return; -- } -- -- struct spa_meta_region* video_metadata = -- static_cast( -- spa_buffer_find_meta_data(spaBuffer, SPA_META_VideoCrop, sizeof(*video_metadata))); -- -- // Video size from metada is bigger than an actual video stream size. -- // The metadata are wrong or we should up-scale te video...in both cases -- // just quit now. -- if (video_metadata && -- (video_metadata->region.size.width > (uint32_t)desktop_size_.width() || -- video_metadata->region.size.height > (uint32_t)desktop_size_.height())) { -- RTC_LOG(LS_ERROR) << "Stream metadata sizes are wrong!"; -- SpaBufferUnmap(map, -- spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, -- spaBuffer->datas[0].type == SPA_DATA_DmaBuf, spaBuffer->datas[0].fd); -- return; -- } -- -- // Use video metada when video size from metadata is set and smaller than -- // video stream size, so we need to adjust it. -- video_metadata_use_ = (video_metadata && -- video_metadata->region.size.width != 0 && -- video_metadata->region.size.height != 0 && -- (video_metadata->region.size.width < (uint32_t)desktop_size_.width() || -- video_metadata->region.size.height < (uint32_t)desktop_size_.height())); -- -- DesktopSize video_size_prev = video_size_; -- if (video_metadata_use_) { -- video_size_ = DesktopSize(video_metadata->region.size.width, -- video_metadata->region.size.height); -- } else { -- video_size_ = desktop_size_; -- } -- -- webrtc::MutexLock lock(¤t_frame_lock_); -- if (!current_frame_ || !video_size_.equals(video_size_prev)) { -- current_frame_ = -- std::make_unique -- (video_size_.width() * video_size_.height() * BasicDesktopFrame::kBytesPerPixel); -- } -- -- const int32_t dstStride = video_size_.width() * BasicDesktopFrame::kBytesPerPixel; -- const int32_t srcStride = spaBuffer->datas[0].chunk->stride; -- -- // Adjust source content based on metadata video position -- if (video_metadata_use_ && -- (video_metadata->region.position.y + video_size_.height() <= desktop_size_.height())) { -- src += srcStride * video_metadata->region.position.y; -- } -- const int xOffset = -- video_metadata_use_ && -- (video_metadata->region.position.x + video_size_.width() <= desktop_size_.width()) -- ? video_metadata->region.position.x * BasicDesktopFrame::kBytesPerPixel -- : 0; -- -- uint8_t* dst = current_frame_.get(); -- for (int i = 0; i < video_size_.height(); ++i) { -- // Adjust source content based on crop video position if needed -- src += xOffset; -- std::memcpy(dst, src, dstStride); -- // If both sides decided to go with the RGBx format we need to convert it to -- // BGRx to match color format expected by WebRTC. -- if (spa_video_format_.format == SPA_VIDEO_FORMAT_RGBx || -- spa_video_format_.format == SPA_VIDEO_FORMAT_RGBA) { -- ConvertRGBxToBGRx(dst, dstStride); -- } -- src += srcStride - xOffset; -- dst += dstStride; -- } -- -- SpaBufferUnmap(map, -- spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, -- spaBuffer->datas[0].type == SPA_DATA_DmaBuf, spaBuffer->datas[0].fd); --} -- --void BaseCapturerPipeWire::ConvertRGBxToBGRx(uint8_t* frame, uint32_t size) { -- // Change color format for KDE KWin which uses RGBx and not BGRx -- for (uint32_t i = 0; i < size; i += 4) { -- uint8_t tempR = frame[i]; -- uint8_t tempB = frame[i + 2]; -- frame[i] = tempB; -- frame[i + 2] = tempR; -- } --} -- --guint BaseCapturerPipeWire::SetupRequestResponseSignal( -- const gchar* object_path, -- GDBusSignalCallback callback) { -- return g_dbus_connection_signal_subscribe( -- connection_, kDesktopBusName, kRequestInterfaceName, "Response", -- object_path, /*arg0=*/nullptr, G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE, -- callback, this, /*user_data_free_func=*/nullptr); --} -- --// static --void BaseCapturerPipeWire::OnProxyRequested(GObject* /*object*/, -- GAsyncResult* result, -- gpointer user_data) { -- BaseCapturerPipeWire* that = static_cast(user_data); -- RTC_DCHECK(that); -- -- GError* error = nullptr; -- GDBusProxy *proxy = g_dbus_proxy_new_finish(result, &error); -- if (!proxy) { -- if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) -- return; -- RTC_LOG(LS_ERROR) << "Failed to create a proxy for the screen cast portal: " -- << error->message; -- g_error_free(error); -- that->portal_init_failed_ = true; -- return; -- } -- that->proxy_ = proxy; -- that->connection_ = g_dbus_proxy_get_connection(that->proxy_); -- -- RTC_LOG(LS_INFO) << "Created proxy for the screen cast portal."; -- that->SessionRequest(); --} -- --// static --gchar* BaseCapturerPipeWire::PrepareSignalHandle(GDBusConnection* connection, -- const gchar* token) { -- gchar* sender = g_strdup(g_dbus_connection_get_unique_name(connection) + 1); -- for (int i = 0; sender[i]; i++) { -- if (sender[i] == '.') { -- sender[i] = '_'; -- } -- } -- -- gchar* handle = g_strconcat(kDesktopRequestObjectPath, "/", sender, "/", -- token, /*end of varargs*/ nullptr); -- g_free(sender); -- -- return handle; --} -- --void BaseCapturerPipeWire::SessionRequest() { -- GVariantBuilder builder; -- gchar* variant_string; -- -- g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); -- variant_string = -- g_strdup_printf("webrtc_session%d", g_random_int_range(0, G_MAXINT)); -- g_variant_builder_add(&builder, "{sv}", "session_handle_token", -- g_variant_new_string(variant_string)); -- g_free(variant_string); -- variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); -- g_variant_builder_add(&builder, "{sv}", "handle_token", -- g_variant_new_string(variant_string)); -- -- portal_handle_ = PrepareSignalHandle(connection_, variant_string); -- session_request_signal_id_ = SetupRequestResponseSignal( -- portal_handle_, OnSessionRequestResponseSignal); -- g_free(variant_string); -- -- RTC_LOG(LS_INFO) << "Screen cast session requested."; -- g_dbus_proxy_call( -- proxy_, "CreateSession", g_variant_new("(a{sv})", &builder), -- G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, -- reinterpret_cast(OnSessionRequested), this); --} -- --// static --void BaseCapturerPipeWire::OnSessionRequested(GDBusProxy *proxy, -- GAsyncResult* result, -- gpointer user_data) { -- BaseCapturerPipeWire* that = static_cast(user_data); -- RTC_DCHECK(that); -- -- GError* error = nullptr; -- GVariant* variant = g_dbus_proxy_call_finish(proxy, result, &error); -- if (!variant) { -- if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) -- return; -- RTC_LOG(LS_ERROR) << "Failed to create a screen cast session: " -- << error->message; -- g_error_free(error); -- that->portal_init_failed_ = true; -- return; -- } -- RTC_LOG(LS_INFO) << "Initializing the screen cast session."; -- -- gchar* handle = nullptr; -- g_variant_get_child(variant, 0, "o", &handle); -- g_variant_unref(variant); -- if (!handle) { -- RTC_LOG(LS_ERROR) << "Failed to initialize the screen cast session."; -- if (that->session_request_signal_id_) { -- g_dbus_connection_signal_unsubscribe(that->connection_, -- that->session_request_signal_id_); -- that->session_request_signal_id_ = 0; -- } -- that->portal_init_failed_ = true; -- return; -- } -- -- g_free(handle); -- -- RTC_LOG(LS_INFO) << "Subscribing to the screen cast session."; --} -- --// static --void BaseCapturerPipeWire::OnSessionRequestResponseSignal( -- GDBusConnection* connection, -- const gchar* sender_name, -- const gchar* object_path, -- const gchar* interface_name, -- const gchar* signal_name, -- GVariant* parameters, -- gpointer user_data) { -- BaseCapturerPipeWire* that = static_cast(user_data); -- RTC_DCHECK(that); -- -- RTC_LOG(LS_INFO) -- << "Received response for the screen cast session subscription."; -- -- guint32 portal_response; -- GVariant* response_data; -- g_variant_get(parameters, "(u@a{sv})", &portal_response, &response_data); -- -- GVariant* session_handle = -- g_variant_lookup_value(response_data, "session_handle", NULL); -- that->session_handle_ = g_variant_dup_string(session_handle, NULL); -- -- g_variant_unref(session_handle); -- g_variant_unref(response_data); -- -- if (!that->session_handle_ || portal_response) { -- RTC_LOG(LS_ERROR) -- << "Failed to request the screen cast session subscription."; -- that->portal_init_failed_ = true; -- return; -- } -- -- that->SourcesRequest(); --} -- --void BaseCapturerPipeWire::SourcesRequest() { -- GVariantBuilder builder; -- gchar* variant_string; -- -- g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); -- // We want to record monitor content. -- g_variant_builder_add(&builder, "{sv}", "types", -- g_variant_new_uint32(capture_source_type_)); -- // We don't want to allow selection of multiple sources. -- g_variant_builder_add(&builder, "{sv}", "multiple", -- g_variant_new_boolean(false)); -- variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); -- g_variant_builder_add(&builder, "{sv}", "handle_token", -- g_variant_new_string(variant_string)); -- -- sources_handle_ = PrepareSignalHandle(connection_, variant_string); -- sources_request_signal_id_ = SetupRequestResponseSignal( -- sources_handle_, OnSourcesRequestResponseSignal); -- g_free(variant_string); -- -- RTC_LOG(LS_INFO) << "Requesting sources from the screen cast session."; -- g_dbus_proxy_call( -- proxy_, "SelectSources", -- g_variant_new("(oa{sv})", session_handle_, &builder), -- G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, -- reinterpret_cast(OnSourcesRequested), this); --} -- --// static --void BaseCapturerPipeWire::OnSourcesRequested(GDBusProxy *proxy, -- GAsyncResult* result, -- gpointer user_data) { -- BaseCapturerPipeWire* that = static_cast(user_data); -- RTC_DCHECK(that); -- -- GError* error = nullptr; -- GVariant* variant = g_dbus_proxy_call_finish(proxy, result, &error); -- if (!variant) { -- if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) -- return; -- RTC_LOG(LS_ERROR) << "Failed to request the sources: " << error->message; -- g_error_free(error); -- that->portal_init_failed_ = true; -- return; -- } -- -- RTC_LOG(LS_INFO) << "Sources requested from the screen cast session."; -- -- gchar* handle = nullptr; -- g_variant_get_child(variant, 0, "o", &handle); -- g_variant_unref(variant); -- if (!handle) { -- RTC_LOG(LS_ERROR) << "Failed to initialize the screen cast session."; -- if (that->sources_request_signal_id_) { -- g_dbus_connection_signal_unsubscribe(that->connection_, -- that->sources_request_signal_id_); -- that->sources_request_signal_id_ = 0; -- } -- that->portal_init_failed_ = true; -- return; -- } -- -- g_free(handle); -- -- RTC_LOG(LS_INFO) << "Subscribed to sources signal."; --} -- --// static --void BaseCapturerPipeWire::OnSourcesRequestResponseSignal( -- GDBusConnection* connection, -- const gchar* sender_name, -- const gchar* object_path, -- const gchar* interface_name, -- const gchar* signal_name, -- GVariant* parameters, -- gpointer user_data) { -- BaseCapturerPipeWire* that = static_cast(user_data); -- RTC_DCHECK(that); -- -- RTC_LOG(LS_INFO) << "Received sources signal from session."; -- -- guint32 portal_response; -- g_variant_get(parameters, "(u@a{sv})", &portal_response, nullptr); -- if (portal_response) { -- RTC_LOG(LS_ERROR) -- << "Failed to select sources for the screen cast session."; -- that->portal_init_failed_ = true; -- return; -- } -- -- that->StartRequest(); --} -- --void BaseCapturerPipeWire::StartRequest() { -- GVariantBuilder builder; -- gchar* variant_string; -- -- g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); -- variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); -- g_variant_builder_add(&builder, "{sv}", "handle_token", -- g_variant_new_string(variant_string)); -- -- start_handle_ = PrepareSignalHandle(connection_, variant_string); -- start_request_signal_id_ = -- SetupRequestResponseSignal(start_handle_, OnStartRequestResponseSignal); -- g_free(variant_string); -- -- // "Identifier for the application window", this is Wayland, so not "x11:...". -- const gchar parent_window[] = ""; -- -- RTC_LOG(LS_INFO) << "Starting the screen cast session."; -- g_dbus_proxy_call( -- proxy_, "Start", -- g_variant_new("(osa{sv})", session_handle_, parent_window, &builder), -- G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, -- reinterpret_cast(OnStartRequested), this); --} -- --// static --void BaseCapturerPipeWire::OnStartRequested(GDBusProxy *proxy, -- GAsyncResult* result, -- gpointer user_data) { -- BaseCapturerPipeWire* that = static_cast(user_data); -- RTC_DCHECK(that); -- -- GError* error = nullptr; -- GVariant* variant = g_dbus_proxy_call_finish(proxy, result, &error); -- if (!variant) { -- if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) -- return; -- RTC_LOG(LS_ERROR) << "Failed to start the screen cast session: " -- << error->message; -- g_error_free(error); -- that->portal_init_failed_ = true; -- return; -- } -- -- RTC_LOG(LS_INFO) << "Initializing the start of the screen cast session."; -- -- gchar* handle = nullptr; -- g_variant_get_child(variant, 0, "o", &handle); -- g_variant_unref(variant); -- if (!handle) { -- RTC_LOG(LS_ERROR) -- << "Failed to initialize the start of the screen cast session."; -- if (that->start_request_signal_id_) { -- g_dbus_connection_signal_unsubscribe(that->connection_, -- that->start_request_signal_id_); -- that->start_request_signal_id_ = 0; -- } -- that->portal_init_failed_ = true; -- return; -- } -- -- g_free(handle); -- -- RTC_LOG(LS_INFO) << "Subscribed to the start signal."; --} -- --// static --void BaseCapturerPipeWire::OnStartRequestResponseSignal( -- GDBusConnection* connection, -- const gchar* sender_name, -- const gchar* object_path, -- const gchar* interface_name, -- const gchar* signal_name, -- GVariant* parameters, -- gpointer user_data) { -- BaseCapturerPipeWire* that = static_cast(user_data); -- RTC_DCHECK(that); -- -- RTC_LOG(LS_INFO) << "Start signal received."; -- guint32 portal_response; -- GVariant* response_data; -- GVariantIter* iter = nullptr; -- g_variant_get(parameters, "(u@a{sv})", &portal_response, &response_data); -- if (portal_response || !response_data) { -- RTC_LOG(LS_ERROR) << "Failed to start the screen cast session."; -- that->portal_init_failed_ = true; -- return; -- } -- -- // Array of PipeWire streams. See -- // https://github.com/flatpak/xdg-desktop-portal/blob/master/data/org.freedesktop.portal.ScreenCast.xml -- // documentation for . -- if (g_variant_lookup(response_data, "streams", "a(ua{sv})", &iter)) { -- GVariant* variant; -- -- while (g_variant_iter_next(iter, "@(ua{sv})", &variant)) { -- guint32 stream_id; -- GVariant* options; -- -- g_variant_get(variant, "(u@a{sv})", &stream_id, &options); -- RTC_DCHECK(options != nullptr); -- -- that->pw_stream_node_id_ = stream_id; -- g_variant_unref(options); -- g_variant_unref(variant); -- } -- } -- g_variant_iter_free(iter); -- g_variant_unref(response_data); -- -- that->OpenPipeWireRemote(); --} -- --void BaseCapturerPipeWire::OpenPipeWireRemote() { -- GVariantBuilder builder; -- g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); -- -- RTC_LOG(LS_INFO) << "Opening the PipeWire remote."; -- -- g_dbus_proxy_call_with_unix_fd_list( -- proxy_, "OpenPipeWireRemote", -- g_variant_new("(oa{sv})", session_handle_, &builder), -- G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, /*fd_list=*/nullptr, -- cancellable_, -- reinterpret_cast(OnOpenPipeWireRemoteRequested), -- this); --} -- --// static --void BaseCapturerPipeWire::OnOpenPipeWireRemoteRequested( -- GDBusProxy *proxy, -- GAsyncResult* result, -- gpointer user_data) { -- BaseCapturerPipeWire* that = static_cast(user_data); -- RTC_DCHECK(that); -- -- GError* error = nullptr; -- GUnixFDList* outlist = nullptr; -- GVariant* variant = g_dbus_proxy_call_with_unix_fd_list_finish( -- proxy, &outlist, result, &error); -- if (!variant) { -- if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) -- return; -- RTC_LOG(LS_ERROR) << "Failed to open the PipeWire remote: " -- << error->message; -- g_error_free(error); -- that->portal_init_failed_ = true; -- return; -- } -- -- gint32 index; -- g_variant_get(variant, "(h)", &index); -- -- if ((that->pw_fd_ = g_unix_fd_list_get(outlist, index, &error)) == -1) { -- RTC_LOG(LS_ERROR) << "Failed to get file descriptor from the list: " -- << error->message; -- g_error_free(error); -- g_variant_unref(variant); -- that->portal_init_failed_ = true; -- return; -- } -- -- g_variant_unref(variant); -- g_object_unref(outlist); -- -- that->InitPipeWire(); --} -- - void BaseCapturerPipeWire::Start(Callback* callback) { - RTC_DCHECK(!callback_); - RTC_DCHECK(callback); - -- InitPortal(); -- - callback_ = callback; -+ -+ screencast_portal_->Start(); - } - - void BaseCapturerPipeWire::CaptureFrame() { -- if (portal_init_failed_) { -+ if (capturer_failed_) { - callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); - return; - } - -- webrtc::MutexLock lock(¤t_frame_lock_); -- if (!current_frame_) { -- callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); -- return; -- } -- -- DesktopSize frame_size = desktop_size_; -- if (video_metadata_use_) { -- frame_size = video_size_; -- } -+ std::unique_ptr frame = -+ options_.screencast_stream()->CaptureFrame(); - -- std::unique_ptr result(new BasicDesktopFrame(frame_size)); -- result->CopyPixelsFrom( -- current_frame_.get(), (frame_size.width() * BasicDesktopFrame::kBytesPerPixel), -- DesktopRect::MakeWH(frame_size.width(), frame_size.height())); -- if (!result) { -+ if (!frame || !frame->data()) { - callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); - return; - } - -- // TODO(julien.isorce): http://crbug.com/945468. Set the icc profile on the -- // frame, see ScreenCapturerX11::CaptureFrame. -+ // TODO(julien.isorce): http://crbug.com/945468. Set the icc profile on -+ // the frame, see ScreenCapturerX11::CaptureFrame. - -- callback_->OnCaptureResult(Result::SUCCESS, std::move(result)); -+ callback_->OnCaptureResult(Result::SUCCESS, std::move(frame)); - } - - // Keep in sync with defines at browser/actors/WebRTCParent.jsm -@@ -953,31 +83,13 @@ void BaseCapturerPipeWire::CaptureFrame( - #define PIPEWIRE_NAME "####_PIPEWIRE_PORTAL_####" - - bool BaseCapturerPipeWire::GetSourceList(SourceList* sources) { -+ RTC_DCHECK(sources->size() == 0); - sources->push_back({PIPEWIRE_ID, 0, PIPEWIRE_NAME}); - return true; - } - - bool BaseCapturerPipeWire::SelectSource(SourceId id) { -- // Screen selection is handled by the xdg-desktop-portal. - return id == PIPEWIRE_ID; - } - --// static --std::unique_ptr --BaseCapturerPipeWire::CreateRawScreenCapturer( -- const DesktopCaptureOptions& options) { -- std::unique_ptr capturer = -- std::make_unique(BaseCapturerPipeWire::CaptureSourceType::kAny); -- return std::move(capturer);} -- --// static --std::unique_ptr --BaseCapturerPipeWire::CreateRawWindowCapturer( -- const DesktopCaptureOptions& options) { -- -- std::unique_ptr capturer = -- std::make_unique(BaseCapturerPipeWire::CaptureSourceType::kAny); -- return std::move(capturer); --} -- - } // namespace webrtc -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h.libwebrtc-screen-cast-sync 2022-07-18 20:44:26.000000000 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h 2022-07-28 11:45:30.319409011 +0200 -@@ -11,160 +11,39 @@ - #ifndef MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ - #define MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ - --#include --#define typeof __typeof__ --#include --#include -- - #include "modules/desktop_capture/desktop_capture_options.h" - #include "modules/desktop_capture/desktop_capturer.h" --#include "rtc_base/synchronization/mutex.h" -+#include "modules/desktop_capture/linux/screencast_portal.h" -+#include "modules/desktop_capture/linux/shared_screencast_stream.h" - - namespace webrtc { - --class BaseCapturerPipeWire : public DesktopCapturer { -+class BaseCapturerPipeWire : public DesktopCapturer, -+ public ScreenCastPortal::PortalNotifier { - public: -- enum CaptureSourceType : uint32_t { -- kScreen = 0b01, -- kWindow = 0b10, -- kAny = 0b11 -- }; -- -- explicit BaseCapturerPipeWire(CaptureSourceType source_type); -+ BaseCapturerPipeWire(const DesktopCaptureOptions& options); - ~BaseCapturerPipeWire() override; - -+ BaseCapturerPipeWire(const BaseCapturerPipeWire&) = delete; -+ BaseCapturerPipeWire& operator=(const BaseCapturerPipeWire&) = delete; -+ - // DesktopCapturer interface. - void Start(Callback* delegate) override; - void CaptureFrame() override; - bool GetSourceList(SourceList* sources) override; - bool SelectSource(SourceId id) override; - -- static std::unique_ptr CreateRawScreenCapturer( -- const DesktopCaptureOptions& options); -- -- static std::unique_ptr CreateRawWindowCapturer( -- const DesktopCaptureOptions& options); -+ // ScreenCastPortal::PortalNotifier interface. -+ void OnScreenCastRequestResult(ScreenCastPortal::RequestResponse result, -+ uint32_t stream_node_id, -+ int fd) override; -+ void OnScreenCastSessionClosed() override; - - private: -- // PipeWire types --> -- pw_context* pw_context_ = nullptr; -- pw_core* pw_core_ = nullptr; -- pw_stream* pw_stream_ = nullptr; -- pw_thread_loop* pw_main_loop_ = nullptr; -- -- spa_hook spa_core_listener_ = {}; -- spa_hook spa_stream_listener_ = {}; -- -- pw_core_events pw_core_events_ = {}; -- pw_stream_events pw_stream_events_ = {}; -- -- struct spa_video_info_raw spa_video_format_; -- -- guint32 pw_stream_node_id_ = 0; -- gint32 pw_fd_ = -1; -- -- CaptureSourceType capture_source_type_ = -- BaseCapturerPipeWire::CaptureSourceType::kAny; -- -- // <-- end of PipeWire types -- -- GDBusConnection* connection_ = nullptr; -- GDBusProxy* proxy_ = nullptr; -- GCancellable *cancellable_ = nullptr; -- gchar* portal_handle_ = nullptr; -- gchar* session_handle_ = nullptr; -- gchar* sources_handle_ = nullptr; -- gchar* start_handle_ = nullptr; -- guint session_request_signal_id_ = 0; -- guint sources_request_signal_id_ = 0; -- guint start_request_signal_id_ = 0; -- -- bool video_metadata_use_ = false; -- DesktopSize video_size_; -- DesktopSize desktop_size_ = {}; - DesktopCaptureOptions options_ = {}; -- -- webrtc::Mutex current_frame_lock_; -- std::unique_ptr current_frame_; - Callback* callback_ = nullptr; -- -- bool portal_init_failed_ = false; -- -- void InitPortal(); -- void InitPipeWire(); -- -- pw_stream* CreateReceivingStream(); -- void HandleBuffer(pw_buffer* buffer); -- -- void ConvertRGBxToBGRx(uint8_t* frame, uint32_t size); -- -- static void OnCoreError(void *data, -- uint32_t id, -- int seq, -- int res, -- const char *message); -- static void OnStreamParamChanged(void *data, -- uint32_t id, -- const struct spa_pod *format); -- static void OnStreamStateChanged(void* data, -- pw_stream_state old_state, -- pw_stream_state state, -- const char* error_message); -- static void OnStreamProcess(void* data); -- static void OnNewBuffer(void* data, uint32_t id); -- -- guint SetupRequestResponseSignal(const gchar* object_path, -- GDBusSignalCallback callback); -- -- static void OnProxyRequested(GObject* object, -- GAsyncResult* result, -- gpointer user_data); -- -- static gchar* PrepareSignalHandle(GDBusConnection* connection, -- const gchar* token); -- -- void SessionRequest(); -- static void OnSessionRequested(GDBusProxy *proxy, -- GAsyncResult* result, -- gpointer user_data); -- static void OnSessionRequestResponseSignal(GDBusConnection* connection, -- const gchar* sender_name, -- const gchar* object_path, -- const gchar* interface_name, -- const gchar* signal_name, -- GVariant* parameters, -- gpointer user_data); -- -- void SourcesRequest(); -- static void OnSourcesRequested(GDBusProxy *proxy, -- GAsyncResult* result, -- gpointer user_data); -- static void OnSourcesRequestResponseSignal(GDBusConnection* connection, -- const gchar* sender_name, -- const gchar* object_path, -- const gchar* interface_name, -- const gchar* signal_name, -- GVariant* parameters, -- gpointer user_data); -- -- void StartRequest(); -- static void OnStartRequested(GDBusProxy *proxy, -- GAsyncResult* result, -- gpointer user_data); -- static void OnStartRequestResponseSignal(GDBusConnection* connection, -- const gchar* sender_name, -- const gchar* object_path, -- const gchar* interface_name, -- const gchar* signal_name, -- GVariant* parameters, -- gpointer user_data); -- -- void OpenPipeWireRemote(); -- static void OnOpenPipeWireRemoteRequested(GDBusProxy *proxy, -- GAsyncResult* result, -- gpointer user_data); -- -- RTC_DISALLOW_COPY_AND_ASSIGN(BaseCapturerPipeWire); -+ bool capturer_failed_ = false; -+ std::unique_ptr screencast_portal_; - }; - - } // namespace webrtc -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.319409011 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs 2022-07-28 11:45:30.319409011 +0200 -@@ -0,0 +1,11 @@ -+// Copyright 2021 The WebRTC project authors. All rights reserved. -+// Use of this source code is governed by a BSD-style license that can be -+// found in the LICENSE file. -+ -+//------------------------------------------------ -+// Functions from DRM used in capturer code. -+//-------- -+ -+// xf86drm.h -+int drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices); -+void drmFreeDevices(drmDevicePtr devices[], int count); -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.319409011 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc 2022-07-28 11:45:30.319409011 +0200 -@@ -0,0 +1,695 @@ -+/* -+ * Copyright 2021 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#include "modules/desktop_capture/linux/egl_dmabuf.h" -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "absl/memory/memory.h" -+#include "absl/types/optional.h" -+#include "rtc_base/checks.h" -+#include "rtc_base/logging.h" -+#include "rtc_base/sanitizer.h" -+#include "rtc_base/string_encode.h" -+ -+namespace webrtc { -+ -+// EGL -+typedef EGLBoolean (*eglBindAPI_func)(EGLenum api); -+typedef EGLContext (*eglCreateContext_func)(EGLDisplay dpy, -+ EGLConfig config, -+ EGLContext share_context, -+ const EGLint* attrib_list); -+typedef EGLBoolean (*eglDestroyContext_func)(EGLDisplay display, -+ EGLContext context); -+typedef EGLBoolean (*eglTerminate_func)(EGLDisplay display); -+typedef EGLImageKHR (*eglCreateImageKHR_func)(EGLDisplay dpy, -+ EGLContext ctx, -+ EGLenum target, -+ EGLClientBuffer buffer, -+ const EGLint* attrib_list); -+typedef EGLBoolean (*eglDestroyImageKHR_func)(EGLDisplay dpy, -+ EGLImageKHR image); -+typedef EGLint (*eglGetError_func)(void); -+typedef void* (*eglGetProcAddress_func)(const char*); -+typedef EGLDisplay (*eglGetPlatformDisplayEXT_func)(EGLenum platform, -+ void* native_display, -+ const EGLint* attrib_list); -+typedef EGLDisplay (*eglGetPlatformDisplay_func)(EGLenum platform, -+ void* native_display, -+ const EGLAttrib* attrib_list); -+ -+typedef EGLBoolean (*eglInitialize_func)(EGLDisplay dpy, -+ EGLint* major, -+ EGLint* minor); -+typedef EGLBoolean (*eglMakeCurrent_func)(EGLDisplay dpy, -+ EGLSurface draw, -+ EGLSurface read, -+ EGLContext ctx); -+typedef EGLBoolean (*eglQueryDmaBufFormatsEXT_func)(EGLDisplay dpy, -+ EGLint max_formats, -+ EGLint* formats, -+ EGLint* num_formats); -+typedef EGLBoolean (*eglQueryDmaBufModifiersEXT_func)(EGLDisplay dpy, -+ EGLint format, -+ EGLint max_modifiers, -+ EGLuint64KHR* modifiers, -+ EGLBoolean* external_only, -+ EGLint* num_modifiers); -+typedef const char* (*eglQueryString_func)(EGLDisplay dpy, EGLint name); -+typedef void (*glEGLImageTargetTexture2DOES_func)(GLenum target, -+ GLeglImageOES image); -+ -+// This doesn't follow naming conventions in WebRTC, where the naming -+// should look like e.g. egl_bind_api instead of EglBindAPI, however -+// we named them according to the exported functions they map to for -+// consistency. -+eglBindAPI_func EglBindAPI = nullptr; -+eglCreateContext_func EglCreateContext = nullptr; -+eglDestroyContext_func EglDestroyContext = nullptr; -+eglTerminate_func EglTerminate = nullptr; -+eglCreateImageKHR_func EglCreateImageKHR = nullptr; -+eglDestroyImageKHR_func EglDestroyImageKHR = nullptr; -+eglGetError_func EglGetError = nullptr; -+eglGetProcAddress_func EglGetProcAddress = nullptr; -+eglGetPlatformDisplayEXT_func EglGetPlatformDisplayEXT = nullptr; -+eglGetPlatformDisplay_func EglGetPlatformDisplay = nullptr; -+eglInitialize_func EglInitialize = nullptr; -+eglMakeCurrent_func EglMakeCurrent = nullptr; -+eglQueryDmaBufFormatsEXT_func EglQueryDmaBufFormatsEXT = nullptr; -+eglQueryDmaBufModifiersEXT_func EglQueryDmaBufModifiersEXT = nullptr; -+eglQueryString_func EglQueryString = nullptr; -+glEGLImageTargetTexture2DOES_func GlEGLImageTargetTexture2DOES = nullptr; -+ -+// GL -+typedef void (*glBindTexture_func)(GLenum target, GLuint texture); -+typedef void (*glDeleteTextures_func)(GLsizei n, const GLuint* textures); -+typedef void (*glGenTextures_func)(GLsizei n, GLuint* textures); -+typedef GLenum (*glGetError_func)(void); -+typedef const GLubyte* (*glGetString_func)(GLenum name); -+typedef void (*glGetTexImage_func)(GLenum target, -+ GLint level, -+ GLenum format, -+ GLenum type, -+ void* pixels); -+typedef void (*glTexParameteri_func)(GLenum target, GLenum pname, GLint param); -+typedef void* (*glXGetProcAddressARB_func)(const char*); -+ -+// This doesn't follow naming conventions in WebRTC, where the naming -+// should look like e.g. egl_bind_api instead of EglBindAPI, however -+// we named them according to the exported functions they map to for -+// consistency. -+glBindTexture_func GlBindTexture = nullptr; -+glDeleteTextures_func GlDeleteTextures = nullptr; -+glGenTextures_func GlGenTextures = nullptr; -+glGetError_func GlGetError = nullptr; -+glGetString_func GlGetString = nullptr; -+glGetTexImage_func GlGetTexImage = nullptr; -+glTexParameteri_func GlTexParameteri = nullptr; -+glXGetProcAddressARB_func GlXGetProcAddressARB = nullptr; -+ -+static const std::string FormatGLError(GLenum err) { -+ switch (err) { -+ case GL_NO_ERROR: -+ return "GL_NO_ERROR"; -+ case GL_INVALID_ENUM: -+ return "GL_INVALID_ENUM"; -+ case GL_INVALID_VALUE: -+ return "GL_INVALID_VALUE"; -+ case GL_INVALID_OPERATION: -+ return "GL_INVALID_OPERATION"; -+ case GL_STACK_OVERFLOW: -+ return "GL_STACK_OVERFLOW"; -+ case GL_STACK_UNDERFLOW: -+ return "GL_STACK_UNDERFLOW"; -+ case GL_OUT_OF_MEMORY: -+ return "GL_OUT_OF_MEMORY"; -+ default: -+ return "GL error code: " + std::to_string(err); -+ } -+} -+ -+static const std::string FormatEGLError(EGLint err) { -+ switch (err) { -+ case EGL_NOT_INITIALIZED: -+ return "EGL_NOT_INITIALIZED"; -+ case EGL_BAD_ACCESS: -+ return "EGL_BAD_ACCESS"; -+ case EGL_BAD_ALLOC: -+ return "EGL_BAD_ALLOC"; -+ case EGL_BAD_ATTRIBUTE: -+ return "EGL_BAD_ATTRIBUTE"; -+ case EGL_BAD_CONTEXT: -+ return "EGL_BAD_CONTEXT"; -+ case EGL_BAD_CONFIG: -+ return "EGL_BAD_CONFIG"; -+ case EGL_BAD_CURRENT_SURFACE: -+ return "EGL_BAD_CURRENT_SURFACE"; -+ case EGL_BAD_DISPLAY: -+ return "EGL_BAD_DISPLAY"; -+ case EGL_BAD_SURFACE: -+ return "EGL_BAD_SURFACE"; -+ case EGL_BAD_MATCH: -+ return "EGL_BAD_MATCH"; -+ case EGL_BAD_PARAMETER: -+ return "EGL_BAD_PARAMETER"; -+ case EGL_BAD_NATIVE_PIXMAP: -+ return "EGL_BAD_NATIVE_PIXMAP"; -+ case EGL_BAD_NATIVE_WINDOW: -+ return "EGL_BAD_NATIVE_WINDOW"; -+ case EGL_CONTEXT_LOST: -+ return "EGL_CONTEXT_LOST"; -+ default: -+ return "EGL error code: " + std::to_string(err); -+ } -+} -+ -+static uint32_t SpaPixelFormatToDrmFormat(uint32_t spa_format) { -+ switch (spa_format) { -+ case SPA_VIDEO_FORMAT_RGBA: -+ return DRM_FORMAT_ABGR8888; -+ case SPA_VIDEO_FORMAT_RGBx: -+ return DRM_FORMAT_XBGR8888; -+ case SPA_VIDEO_FORMAT_BGRA: -+ return DRM_FORMAT_ARGB8888; -+ case SPA_VIDEO_FORMAT_BGRx: -+ return DRM_FORMAT_XRGB8888; -+ default: -+ return DRM_FORMAT_INVALID; -+ } -+} -+ -+static void CloseLibrary(void* library) { -+ if (library) { -+ dlclose(library); -+ library = nullptr; -+ } -+} -+ -+static void* g_lib_egl = nullptr; -+ -+static bool OpenEGL() { -+ g_lib_egl = dlopen("libEGL.so.1", RTLD_NOW | RTLD_GLOBAL); -+ if (g_lib_egl) { -+ EglGetProcAddress = -+ (eglGetProcAddress_func)dlsym(g_lib_egl, "eglGetProcAddress"); -+ return EglGetProcAddress; -+ } -+ -+ return false; -+} -+ -+static bool LoadEGL() { -+ if (OpenEGL()) { -+ EglBindAPI = (eglBindAPI_func)EglGetProcAddress("eglBindAPI"); -+ EglCreateContext = -+ (eglCreateContext_func)EglGetProcAddress("eglCreateContext"); -+ EglDestroyContext = -+ (eglDestroyContext_func)EglGetProcAddress("eglDestroyContext"); -+ EglTerminate = (eglTerminate_func)EglGetProcAddress("eglTerminate"); -+ EglCreateImageKHR = -+ (eglCreateImageKHR_func)EglGetProcAddress("eglCreateImageKHR"); -+ EglDestroyImageKHR = -+ (eglDestroyImageKHR_func)EglGetProcAddress("eglDestroyImageKHR"); -+ EglGetError = (eglGetError_func)EglGetProcAddress("eglGetError"); -+ EglGetPlatformDisplayEXT = (eglGetPlatformDisplayEXT_func)EglGetProcAddress( -+ "eglGetPlatformDisplayEXT"); -+ EglGetPlatformDisplay = -+ (eglGetPlatformDisplay_func)EglGetProcAddress("eglGetPlatformDisplay"); -+ EglInitialize = (eglInitialize_func)EglGetProcAddress("eglInitialize"); -+ EglMakeCurrent = (eglMakeCurrent_func)EglGetProcAddress("eglMakeCurrent"); -+ EglQueryString = (eglQueryString_func)EglGetProcAddress("eglQueryString"); -+ GlEGLImageTargetTexture2DOES = -+ (glEGLImageTargetTexture2DOES_func)EglGetProcAddress( -+ "glEGLImageTargetTexture2DOES"); -+ -+ return EglBindAPI && EglCreateContext && EglCreateImageKHR && -+ EglTerminate && EglDestroyContext && EglDestroyImageKHR && -+ EglGetError && EglGetPlatformDisplayEXT && EglGetPlatformDisplay && -+ EglInitialize && EglMakeCurrent && EglQueryString && -+ GlEGLImageTargetTexture2DOES; -+ } -+ -+ return false; -+} -+ -+static void* g_lib_gl = nullptr; -+ -+static bool OpenGL() { -+ std::vector names = {"libGL.so.1", "libGL.so"}; -+ for (const std::string& name : names) { -+ g_lib_gl = dlopen(name.c_str(), RTLD_NOW | RTLD_GLOBAL); -+ if (g_lib_gl) { -+ GlXGetProcAddressARB = -+ (glXGetProcAddressARB_func)dlsym(g_lib_gl, "glXGetProcAddressARB"); -+ return GlXGetProcAddressARB; -+ } -+ } -+ -+ return false; -+} -+ -+static bool LoadGL() { -+ if (OpenGL()) { -+ GlGetString = (glGetString_func)GlXGetProcAddressARB("glGetString"); -+ if (!GlGetString) { -+ return false; -+ } -+ -+ GlBindTexture = (glBindTexture_func)GlXGetProcAddressARB("glBindTexture"); -+ GlDeleteTextures = -+ (glDeleteTextures_func)GlXGetProcAddressARB("glDeleteTextures"); -+ GlGenTextures = (glGenTextures_func)GlXGetProcAddressARB("glGenTextures"); -+ GlGetError = (glGetError_func)GlXGetProcAddressARB("glGetError"); -+ GlGetTexImage = (glGetTexImage_func)GlXGetProcAddressARB("glGetTexImage"); -+ GlTexParameteri = -+ (glTexParameteri_func)GlXGetProcAddressARB("glTexParameteri"); -+ -+ return GlBindTexture && GlDeleteTextures && GlGenTextures && GlGetError && -+ GlGetTexImage && GlTexParameteri; -+ } -+ -+ return false; -+} -+ -+EglDmaBuf::EglDmaBuf() { -+ if (!LoadEGL()) { -+ RTC_LOG(LS_ERROR) << "Unable to load EGL entry functions."; -+ CloseLibrary(g_lib_egl); -+ return; -+ } -+ -+ if (!LoadGL()) { -+ RTC_LOG(LS_ERROR) << "Failed to load OpenGL entry functions."; -+ CloseLibrary(g_lib_gl); -+ return; -+ } -+ -+ if (!GetClientExtensions(EGL_NO_DISPLAY, EGL_EXTENSIONS)) { -+ return; -+ } -+ -+ bool has_platform_base_ext = false; -+ bool has_platform_gbm_ext = false; -+ bool has_khr_platform_gbm_ext = false; -+ -+ for (const auto& extension : egl_.extensions) { -+ if (extension == "EGL_EXT_platform_base") { -+ has_platform_base_ext = true; -+ continue; -+ } else if (extension == "EGL_MESA_platform_gbm") { -+ has_platform_gbm_ext = true; -+ continue; -+ } else if (extension == "EGL_KHR_platform_gbm") { -+ has_khr_platform_gbm_ext = true; -+ continue; -+ } -+ } -+ -+ if (!has_platform_base_ext || !has_platform_gbm_ext || -+ !has_khr_platform_gbm_ext) { -+ RTC_LOG(LS_ERROR) << "One of required EGL extensions is missing"; -+ return; -+ } -+ -+ egl_.display = EglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_KHR, -+ (void*)EGL_DEFAULT_DISPLAY, nullptr); -+ -+ if (egl_.display == EGL_NO_DISPLAY) { -+ RTC_LOG(LS_ERROR) << "Failed to obtain default EGL display: " -+ << FormatEGLError(EglGetError()) << "\n" -+ << "Defaulting to using first available render node"; -+ absl::optional render_node = GetRenderNode(); -+ if (!render_node) { -+ return; -+ } -+ -+ drm_fd_ = open(render_node->c_str(), O_RDWR); -+ -+ if (drm_fd_ < 0) { -+ RTC_LOG(LS_ERROR) << "Failed to open drm render node: " -+ << strerror(errno); -+ return; -+ } -+ -+ gbm_device_ = gbm_create_device(drm_fd_); -+ -+ if (!gbm_device_) { -+ RTC_LOG(LS_ERROR) << "Cannot create GBM device: " << strerror(errno); -+ close(drm_fd_); -+ return; -+ } -+ -+ // Use eglGetPlatformDisplayEXT() to get the display pointer -+ // if the implementation supports it. -+ egl_.display = -+ EglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_KHR, gbm_device_, nullptr); -+ } -+ -+ if (egl_.display == EGL_NO_DISPLAY) { -+ RTC_LOG(LS_ERROR) << "Error during obtaining EGL display: " -+ << FormatEGLError(EglGetError()); -+ return; -+ } -+ -+ EGLint major, minor; -+ if (EglInitialize(egl_.display, &major, &minor) == EGL_FALSE) { -+ RTC_LOG(LS_ERROR) << "Error during eglInitialize: " -+ << FormatEGLError(EglGetError()); -+ return; -+ } -+ -+ if (EglBindAPI(EGL_OPENGL_API) == EGL_FALSE) { -+ RTC_LOG(LS_ERROR) << "bind OpenGL API failed"; -+ return; -+ } -+ -+ egl_.context = -+ EglCreateContext(egl_.display, nullptr, EGL_NO_CONTEXT, nullptr); -+ -+ if (egl_.context == EGL_NO_CONTEXT) { -+ RTC_LOG(LS_ERROR) << "Couldn't create EGL context: " -+ << FormatGLError(EglGetError()); -+ return; -+ } -+ -+ if (!GetClientExtensions(egl_.display, EGL_EXTENSIONS)) { -+ return; -+ } -+ -+ bool has_image_dma_buf_import_modifiers_ext = false; -+ -+ for (const auto& extension : egl_.extensions) { -+ if (extension == "EGL_EXT_image_dma_buf_import") { -+ has_image_dma_buf_import_ext_ = true; -+ continue; -+ } else if (extension == "EGL_EXT_image_dma_buf_import_modifiers") { -+ has_image_dma_buf_import_modifiers_ext = true; -+ continue; -+ } -+ } -+ -+ if (has_image_dma_buf_import_ext_ && has_image_dma_buf_import_modifiers_ext) { -+ EglQueryDmaBufFormatsEXT = (eglQueryDmaBufFormatsEXT_func)EglGetProcAddress( -+ "eglQueryDmaBufFormatsEXT"); -+ EglQueryDmaBufModifiersEXT = -+ (eglQueryDmaBufModifiersEXT_func)EglGetProcAddress( -+ "eglQueryDmaBufModifiersEXT"); -+ } -+ -+ RTC_LOG(LS_INFO) << "Egl initialization succeeded"; -+ egl_initialized_ = true; -+} -+ -+EglDmaBuf::~EglDmaBuf() { -+ if (gbm_device_) { -+ gbm_device_destroy(gbm_device_); -+ close(drm_fd_); -+ } -+ -+ if (egl_.context != EGL_NO_CONTEXT) { -+ EglDestroyContext(egl_.display, egl_.context); -+ } -+ -+ if (egl_.display != EGL_NO_DISPLAY) { -+ EglTerminate(egl_.display); -+ } -+ -+ // BUG: crbug.com/1290566 -+ // Closing libEGL.so.1 when using NVidia drivers causes a crash -+ // when EglGetPlatformDisplayEXT() is used, at least this one is enough -+ // to be called to make it crash. -+ // It also looks that libepoxy and glad don't dlclose it either -+ // CloseLibrary(g_lib_egl); -+ // CloseLibrary(g_lib_gl); -+} -+ -+bool EglDmaBuf::GetClientExtensions(EGLDisplay dpy, EGLint name) { -+ // Get the list of client extensions -+ const char* client_extensions_cstring = EglQueryString(dpy, name); -+ if (!client_extensions_cstring) { -+ // If eglQueryString() returned NULL, the implementation doesn't support -+ // EGL_EXT_client_extensions. Expect an EGL_BAD_DISPLAY error. -+ RTC_LOG(LS_ERROR) << "No client extensions defined! " -+ << FormatEGLError(EglGetError()); -+ return false; -+ } -+ -+ std::vector client_extensions; -+ rtc::split(client_extensions_cstring, ' ', -+ &client_extensions); -+ for (const auto& extension : client_extensions) { -+ egl_.extensions.push_back(extension); -+ } -+ -+ return true; -+} -+ -+std::unique_ptr EglDmaBuf::ImageFromDmaBuf( -+ const DesktopSize& size, -+ uint32_t format, -+ const std::vector& plane_datas, -+ uint64_t modifier) { -+ std::unique_ptr src; -+ -+ if (!egl_initialized_) { -+ return src; -+ } -+ -+ if (plane_datas.size() <= 0) { -+ RTC_LOG(LS_ERROR) << "Failed to process buffer: invalid number of planes"; -+ return src; -+ } -+ -+ EGLint attribs[47]; -+ int atti = 0; -+ -+ attribs[atti++] = EGL_WIDTH; -+ attribs[atti++] = static_cast(size.width()); -+ attribs[atti++] = EGL_HEIGHT; -+ attribs[atti++] = static_cast(size.height()); -+ attribs[atti++] = EGL_LINUX_DRM_FOURCC_EXT; -+ attribs[atti++] = SpaPixelFormatToDrmFormat(format); -+ -+ if (plane_datas.size() > 0) { -+ attribs[atti++] = EGL_DMA_BUF_PLANE0_FD_EXT; -+ attribs[atti++] = plane_datas[0].fd; -+ attribs[atti++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT; -+ attribs[atti++] = plane_datas[0].offset; -+ attribs[atti++] = EGL_DMA_BUF_PLANE0_PITCH_EXT; -+ attribs[atti++] = plane_datas[0].stride; -+ -+ if (modifier != DRM_FORMAT_MOD_INVALID) { -+ attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT; -+ attribs[atti++] = modifier & 0xFFFFFFFF; -+ attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT; -+ attribs[atti++] = modifier >> 32; -+ } -+ } -+ -+ if (plane_datas.size() > 1) { -+ attribs[atti++] = EGL_DMA_BUF_PLANE1_FD_EXT; -+ attribs[atti++] = plane_datas[1].fd; -+ attribs[atti++] = EGL_DMA_BUF_PLANE1_OFFSET_EXT; -+ attribs[atti++] = plane_datas[1].offset; -+ attribs[atti++] = EGL_DMA_BUF_PLANE1_PITCH_EXT; -+ attribs[atti++] = plane_datas[1].stride; -+ -+ if (modifier != DRM_FORMAT_MOD_INVALID) { -+ attribs[atti++] = EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT; -+ attribs[atti++] = modifier & 0xFFFFFFFF; -+ attribs[atti++] = EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT; -+ attribs[atti++] = modifier >> 32; -+ } -+ } -+ -+ if (plane_datas.size() > 2) { -+ attribs[atti++] = EGL_DMA_BUF_PLANE2_FD_EXT; -+ attribs[atti++] = plane_datas[2].fd; -+ attribs[atti++] = EGL_DMA_BUF_PLANE2_OFFSET_EXT; -+ attribs[atti++] = plane_datas[2].offset; -+ attribs[atti++] = EGL_DMA_BUF_PLANE2_PITCH_EXT; -+ attribs[atti++] = plane_datas[2].stride; -+ -+ if (modifier != DRM_FORMAT_MOD_INVALID) { -+ attribs[atti++] = EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT; -+ attribs[atti++] = modifier & 0xFFFFFFFF; -+ attribs[atti++] = EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT; -+ attribs[atti++] = modifier >> 32; -+ } -+ } -+ -+ if (plane_datas.size() > 3) { -+ attribs[atti++] = EGL_DMA_BUF_PLANE3_FD_EXT; -+ attribs[atti++] = plane_datas[3].fd; -+ attribs[atti++] = EGL_DMA_BUF_PLANE3_OFFSET_EXT; -+ attribs[atti++] = plane_datas[3].offset; -+ attribs[atti++] = EGL_DMA_BUF_PLANE3_PITCH_EXT; -+ attribs[atti++] = plane_datas[3].stride; -+ -+ if (modifier != DRM_FORMAT_MOD_INVALID) { -+ attribs[atti++] = EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT; -+ attribs[atti++] = modifier & 0xFFFFFFFF; -+ attribs[atti++] = EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT; -+ attribs[atti++] = modifier >> 32; -+ } -+ } -+ -+ attribs[atti++] = EGL_NONE; -+ -+ // bind context to render thread -+ EglMakeCurrent(egl_.display, EGL_NO_SURFACE, EGL_NO_SURFACE, egl_.context); -+ -+ // create EGL image from attribute list -+ EGLImageKHR image = EglCreateImageKHR( -+ egl_.display, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, nullptr, attribs); -+ -+ if (image == EGL_NO_IMAGE) { -+ RTC_LOG(LS_ERROR) << "Failed to record frame: Error creating EGLImage - " -+ << FormatEGLError(EglGetError()); -+ return src; -+ } -+ -+ // create GL 2D texture for framebuffer -+ GLuint texture; -+ GlGenTextures(1, &texture); -+ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); -+ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); -+ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); -+ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); -+ GlBindTexture(GL_TEXTURE_2D, texture); -+ GlEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image); -+ -+ src = std::make_unique(plane_datas[0].stride * size.height()); -+ -+ GLenum gl_format = GL_BGRA; -+ switch (format) { -+ case SPA_VIDEO_FORMAT_RGBx: -+ gl_format = GL_RGBA; -+ break; -+ case SPA_VIDEO_FORMAT_RGBA: -+ gl_format = GL_RGBA; -+ break; -+ case SPA_VIDEO_FORMAT_BGRx: -+ gl_format = GL_BGRA; -+ break; -+ default: -+ gl_format = GL_BGRA; -+ break; -+ } -+ GlGetTexImage(GL_TEXTURE_2D, 0, gl_format, GL_UNSIGNED_BYTE, src.get()); -+ -+ if (GlGetError()) { -+ RTC_LOG(LS_ERROR) << "Failed to get image from DMA buffer."; -+ return src; -+ } -+ -+ GlDeleteTextures(1, &texture); -+ EglDestroyImageKHR(egl_.display, image); -+ -+ return src; -+} -+ -+std::vector EglDmaBuf::QueryDmaBufModifiers(uint32_t format) { -+ if (!egl_initialized_) { -+ return {}; -+ } -+ -+ // Explicit modifiers not supported, return just DRM_FORMAT_MOD_INVALID as we -+ // can still use modifier-less DMA-BUFs if we have required extension -+ if (EglQueryDmaBufFormatsEXT == nullptr || -+ EglQueryDmaBufModifiersEXT == nullptr) { -+ return has_image_dma_buf_import_ext_ -+ ? std::vector{DRM_FORMAT_MOD_INVALID} -+ : std::vector{}; -+ } -+ -+ uint32_t drm_format = SpaPixelFormatToDrmFormat(format); -+ // Should never happen as it's us who controls the list of supported formats -+ RTC_DCHECK(drm_format != DRM_FORMAT_INVALID); -+ -+ EGLint count = 0; -+ EGLBoolean success = -+ EglQueryDmaBufFormatsEXT(egl_.display, 0, nullptr, &count); -+ -+ if (!success || !count) { -+ RTC_LOG(LS_ERROR) << "Failed to query DMA-BUF formats."; -+ return {DRM_FORMAT_MOD_INVALID}; -+ } -+ -+ std::vector formats(count); -+ if (!EglQueryDmaBufFormatsEXT(egl_.display, count, -+ reinterpret_cast(formats.data()), -+ &count)) { -+ RTC_LOG(LS_ERROR) << "Failed to query DMA-BUF formats."; -+ return {DRM_FORMAT_MOD_INVALID}; -+ } -+ -+ if (std::find(formats.begin(), formats.end(), drm_format) == formats.end()) { -+ RTC_LOG(LS_ERROR) << "Format " << drm_format -+ << " not supported for modifiers."; -+ return {DRM_FORMAT_MOD_INVALID}; -+ } -+ -+ success = EglQueryDmaBufModifiersEXT(egl_.display, drm_format, 0, nullptr, -+ nullptr, &count); -+ -+ if (!success || !count) { -+ RTC_LOG(LS_ERROR) << "Failed to query DMA-BUF modifiers."; -+ return {DRM_FORMAT_MOD_INVALID}; -+ } -+ -+ std::vector modifiers(count); -+ if (!EglQueryDmaBufModifiersEXT(egl_.display, drm_format, count, -+ modifiers.data(), nullptr, &count)) { -+ RTC_LOG(LS_ERROR) << "Failed to query DMA-BUF modifiers."; -+ } -+ -+ // Support modifier-less buffers -+ modifiers.push_back(DRM_FORMAT_MOD_INVALID); -+ return modifiers; -+} -+ -+absl::optional EglDmaBuf::GetRenderNode() { -+ int max_devices = drmGetDevices2(0, nullptr, 0); -+ if (max_devices <= 0) { -+ RTC_LOG(LS_ERROR) << "drmGetDevices2() has not found any devices (errno=" -+ << -max_devices << ")"; -+ return absl::nullopt; -+ } -+ -+ std::vector devices(max_devices); -+ int ret = drmGetDevices2(0, devices.data(), max_devices); -+ if (ret < 0) { -+ RTC_LOG(LS_ERROR) << "drmGetDevices2() returned an error " << ret; -+ return absl::nullopt; -+ } -+ -+ std::string render_node; -+ -+ for (const drmDevicePtr& device : devices) { -+ if (device->available_nodes & (1 << DRM_NODE_RENDER)) { -+ render_node = device->nodes[DRM_NODE_RENDER]; -+ break; -+ } -+ } -+ -+ drmFreeDevices(devices.data(), ret); -+ return render_node; -+} -+ -+} // namespace webrtc -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.319409011 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h 2022-07-28 11:45:30.319409011 +0200 -@@ -0,0 +1,68 @@ -+/* -+ * Copyright 2021 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#ifndef MODULES_DESKTOP_CAPTURE_LINUX_EGL_DMABUF_H_ -+#define MODULES_DESKTOP_CAPTURE_LINUX_EGL_DMABUF_H_ -+ -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+#include "absl/types/optional.h" -+#include "modules/desktop_capture/desktop_geometry.h" -+ -+namespace webrtc { -+ -+class EglDmaBuf { -+ public: -+ struct EGLStruct { -+ std::vector extensions; -+ EGLDisplay display = EGL_NO_DISPLAY; -+ EGLContext context = EGL_NO_CONTEXT; -+ }; -+ -+ struct PlaneData { -+ int32_t fd; -+ uint32_t stride; -+ uint32_t offset; -+ }; -+ -+ EglDmaBuf(); -+ ~EglDmaBuf(); -+ -+ std::unique_ptr ImageFromDmaBuf( -+ const DesktopSize& size, -+ uint32_t format, -+ const std::vector& plane_datas, -+ uint64_t modifiers); -+ std::vector QueryDmaBufModifiers(uint32_t format); -+ -+ bool IsEglInitialized() const { return egl_initialized_; } -+ -+ private: -+ bool GetClientExtensions(EGLDisplay dpy, EGLint name); -+ -+ bool egl_initialized_ = false; -+ bool has_image_dma_buf_import_ext_ = false; -+ int32_t drm_fd_ = -1; // for GBM buffer mmap -+ gbm_device* gbm_device_ = nullptr; // for passed GBM buffer retrieval -+ -+ EGLStruct egl_; -+ -+ absl::optional GetRenderNode(); -+}; -+ -+} // namespace webrtc -+ -+#endif // MODULES_DESKTOP_CAPTURE_LINUX_EGL_DMABUF_H_ -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.319409011 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc 2022-07-28 11:45:30.319409011 +0200 -@@ -0,0 +1,56 @@ -+/* -+ * Copyright (c) 2022 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#include "modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h" -+ -+#include -+ -+#include "modules/desktop_capture/desktop_capture_options.h" -+#include "modules/desktop_capture/desktop_capturer.h" -+#include "rtc_base/checks.h" -+#include "rtc_base/logging.h" -+ -+namespace webrtc { -+ -+MouseCursorMonitorPipeWire::MouseCursorMonitorPipeWire( -+ const DesktopCaptureOptions& options) -+ : options_(options) { -+} -+ -+MouseCursorMonitorPipeWire::~MouseCursorMonitorPipeWire() {} -+ -+void MouseCursorMonitorPipeWire::Init(Callback* callback, Mode mode) { -+ RTC_DCHECK(!callback_); -+ RTC_DCHECK(callback); -+ -+ callback_ = callback; -+ mode_ = mode; -+} -+ -+void MouseCursorMonitorPipeWire::Capture() { -+ RTC_DCHECK(callback_); -+ -+ std::unique_ptr mouse_cursor = -+ options_.screencast_stream()->CaptureCursor(); -+ -+ if (mouse_cursor && mouse_cursor->image()->data()) { -+ callback_->OnMouseCursor(mouse_cursor.release()); -+ } -+ -+ if (mode_ == SHAPE_AND_POSITION) { -+ absl::optional mouse_cursor_position = -+ options_.screencast_stream()->CaptureCursorPosition(); -+ if (mouse_cursor_position) { -+ callback_->OnMouseCursorPosition(mouse_cursor_position.value()); -+ } -+ } -+} -+ -+} // namespace webrtc -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.319409011 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h 2022-07-28 11:45:30.319409011 +0200 -@@ -0,0 +1,41 @@ -+/* -+ * Copyright 2022 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#ifndef MODULES_DESKTOP_CAPTURE_LINUX_MOUSE_CURSOR_MONITOR_PIPEWIRE_H_ -+#define MODULES_DESKTOP_CAPTURE_LINUX_MOUSE_CURSOR_MONITOR_PIPEWIRE_H_ -+ -+#include -+ -+#include "api/scoped_refptr.h" -+#include "modules/desktop_capture/desktop_capture_options.h" -+#include "modules/desktop_capture/desktop_capture_types.h" -+#include "modules/desktop_capture/linux/shared_screencast_stream.h" -+#include "modules/desktop_capture/mouse_cursor.h" -+#include "modules/desktop_capture/mouse_cursor_monitor.h" -+ -+namespace webrtc { -+ -+class MouseCursorMonitorPipeWire : public MouseCursorMonitor { -+ public: -+ explicit MouseCursorMonitorPipeWire(const DesktopCaptureOptions& options); -+ ~MouseCursorMonitorPipeWire() override; -+ -+ // MouseCursorMonitor: -+ void Init(Callback* callback, Mode mode) override; -+ void Capture() override; -+ -+ DesktopCaptureOptions options_; -+ Callback* callback_ = nullptr; -+ Mode mode_ = SHAPE_AND_POSITION; -+}; -+ -+} // namespace webrtc -+ -+#endif // MODULES_DESKTOP_CAPTURE_LINUX_MOUSE_CURSOR_MONITOR_PIPEWIRE_H_ -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs.libwebrtc-screen-cast-sync 2022-07-18 20:44:36.000000000 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs 2022-07-28 11:45:30.319409011 +0200 -@@ -7,38 +7,44 @@ - //------------------------------------------------ - - // core.h --void pw_core_destroy(pw_core *core); --pw_type *pw_core_get_type(pw_core *core); --pw_core * pw_core_new(pw_loop *main_loop, pw_properties *props); -+int pw_core_disconnect(pw_core *core); - - // loop.h - void pw_loop_destroy(pw_loop *loop); --pw_loop * pw_loop_new(pw_properties *properties); -+pw_loop * pw_loop_new(const spa_dict *props); -+ - - // pipewire.h - void pw_init(int *argc, char **argv[]); -+const char* pw_get_library_version(); - - // properties.h - pw_properties * pw_properties_new_string(const char *args); - --// remote.h --void pw_remote_add_listener(pw_remote *remote, spa_hook *listener, const pw_remote_events *events, void *data); --int pw_remote_connect_fd(pw_remote *remote, int fd); --void pw_remote_destroy(pw_remote *remote); --pw_remote * pw_remote_new(pw_core *core, pw_properties *properties, size_t user_data_size); -- - // stream.h - void pw_stream_add_listener(pw_stream *stream, spa_hook *listener, const pw_stream_events *events, void *data); --int pw_stream_connect(pw_stream *stream, enum pw_direction direction, const char *port_path, enum pw_stream_flags flags, const spa_pod **params, uint32_t n_params); -+int pw_stream_connect(pw_stream *stream, enum pw_direction direction, uint32_t target_id, enum pw_stream_flags flags, const spa_pod **params, uint32_t n_params); -+int pw_stream_disconnect(pw_stream *stream); - pw_buffer *pw_stream_dequeue_buffer(pw_stream *stream); - void pw_stream_destroy(pw_stream *stream); --void pw_stream_finish_format(pw_stream *stream, int res, const spa_pod **params, uint32_t n_params); --pw_stream * pw_stream_new(pw_remote *remote, const char *name, pw_properties *props); -+pw_stream * pw_stream_new(pw_core *core, const char *name, pw_properties *props); - int pw_stream_queue_buffer(pw_stream *stream, pw_buffer *buffer); - int pw_stream_set_active(pw_stream *stream, bool active); -+int pw_stream_update_params(pw_stream *stream, const spa_pod **params, uint32_t n_params); - - // thread-loop.h - void pw_thread_loop_destroy(pw_thread_loop *loop); --pw_thread_loop * pw_thread_loop_new(pw_loop *loop, const char *name); -+pw_thread_loop * pw_thread_loop_new(const char *name, const spa_dict *props); - int pw_thread_loop_start(pw_thread_loop *loop); - void pw_thread_loop_stop(pw_thread_loop *loop); -+void pw_thread_loop_lock(pw_thread_loop *loop); -+void pw_thread_loop_unlock(pw_thread_loop *loop); -+pw_loop * pw_thread_loop_get_loop(pw_thread_loop *loop); -+void pw_thread_loop_signal(pw_thread_loop *loop, bool wait_for_accept); -+void pw_thread_loop_wait(pw_thread_loop *loop); -+ -+// context.h -+void pw_context_destroy(pw_context *context); -+pw_context *pw_context_new(pw_loop *main_loop, pw_properties *props, size_t user_data_size); -+pw_core * pw_context_connect(pw_context *context, pw_properties *properties, size_t user_data_size); -+pw_core * pw_context_connect_fd(pw_context *context, int fd, pw_properties *properties, size_t user_data_size); -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment.libwebrtc-screen-cast-sync 2022-07-18 20:44:36.000000000 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment 2022-07-28 11:45:30.320409004 +0200 -@@ -5,4 +5,5 @@ extern "C" { - - #include - -+#include - } -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.320409004 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc 2022-07-28 11:45:30.320409004 +0200 -@@ -0,0 +1,57 @@ -+/* -+ * Copyright 2022 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#include "modules/desktop_capture/linux/scoped_glib.h" -+ -+namespace webrtc { -+ -+template <> -+Scoped::~Scoped() { -+ if (ptr_) { -+ g_error_free(ptr_); -+ } -+} -+ -+template <> -+Scoped::~Scoped() { -+ if (ptr_) { -+ g_free(ptr_); -+ } -+} -+ -+template <> -+Scoped::~Scoped() { -+ if (ptr_) { -+ g_variant_unref(ptr_); -+ } -+} -+ -+template <> -+Scoped::~Scoped() { -+ if (ptr_) { -+ g_variant_iter_free(ptr_); -+ } -+} -+ -+template <> -+Scoped::~Scoped() { -+ if (ptr_) { -+ g_object_unref(ptr_); -+ } -+} -+ -+template <> -+Scoped::~Scoped() { -+ if (ptr_) { -+ g_object_unref(ptr_); -+ } -+} -+ -+} // namespace webrtc -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.320409004 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h 2022-07-28 11:45:30.320409004 +0200 -@@ -0,0 +1,65 @@ -+/* -+ * Copyright 2022 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#ifndef MODULES_DESKTOP_CAPTURE_LINUX_SCOPED_GLIB_H_ -+#define MODULES_DESKTOP_CAPTURE_LINUX_SCOPED_GLIB_H_ -+ -+#include -+ -+#include "rtc_base/checks.h" -+ -+namespace webrtc { -+ -+template -+class Scoped { -+ public: -+ Scoped() {} -+ explicit Scoped(T* val) { ptr_ = val; } -+ ~Scoped() { RTC_NOTREACHED(); } -+ -+ T* operator->() const { return ptr_; } -+ -+ explicit operator bool() const { return ptr_ != nullptr; } -+ -+ bool operator!() const { return ptr_ == nullptr; } -+ -+ T* get() const { return ptr_; } -+ -+ T** receive() { -+ RTC_CHECK(!ptr_); -+ return &ptr_; -+ } -+ -+ Scoped& operator=(T* val) { -+ RTC_DCHECK(val); -+ ptr_ = val; -+ return *this; -+ } -+ -+ protected: -+ T* ptr_ = nullptr; -+}; -+ -+template <> -+Scoped::~Scoped(); -+template <> -+Scoped::~Scoped(); -+template <> -+Scoped::~Scoped(); -+template <> -+Scoped::~Scoped(); -+template <> -+Scoped::~Scoped(); -+template <> -+Scoped::~Scoped(); -+ -+} // namespace webrtc -+ -+#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCOPED_GLIB_H_ -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.320409004 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc 2022-07-28 11:45:30.320409004 +0200 -@@ -0,0 +1,532 @@ -+/* -+ * Copyright 2022 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#include "modules/desktop_capture/linux/screencast_portal.h" -+ -+#include -+#include -+ -+#include "modules/desktop_capture/linux/scoped_glib.h" -+#include "rtc_base/checks.h" -+#include "rtc_base/logging.h" -+ -+namespace webrtc { -+ -+const char kDesktopBusName[] = "org.freedesktop.portal.Desktop"; -+const char kDesktopObjectPath[] = "/org/freedesktop/portal/desktop"; -+const char kDesktopRequestObjectPath[] = -+ "/org/freedesktop/portal/desktop/request"; -+const char kSessionInterfaceName[] = "org.freedesktop.portal.Session"; -+const char kRequestInterfaceName[] = "org.freedesktop.portal.Request"; -+const char kScreenCastInterfaceName[] = "org.freedesktop.portal.ScreenCast"; -+ -+ScreenCastPortal::ScreenCastPortal(CaptureSourceType source_type, -+ PortalNotifier* notifier) -+ : notifier_(notifier), capture_source_type_(source_type) {} -+ -+ScreenCastPortal::~ScreenCastPortal() { -+ if (start_request_signal_id_) { -+ g_dbus_connection_signal_unsubscribe(connection_, start_request_signal_id_); -+ } -+ if (sources_request_signal_id_) { -+ g_dbus_connection_signal_unsubscribe(connection_, -+ sources_request_signal_id_); -+ } -+ if (session_request_signal_id_) { -+ g_dbus_connection_signal_unsubscribe(connection_, -+ session_request_signal_id_); -+ } -+ -+ if (!session_handle_.empty()) { -+ Scoped message( -+ g_dbus_message_new_method_call(kDesktopBusName, session_handle_.c_str(), -+ kSessionInterfaceName, "Close")); -+ if (message.get()) { -+ Scoped error; -+ g_dbus_connection_send_message(connection_, message.get(), -+ G_DBUS_SEND_MESSAGE_FLAGS_NONE, -+ /*out_serial=*/nullptr, error.receive()); -+ if (error.get()) { -+ RTC_LOG(LS_ERROR) << "Failed to close the session: " << error->message; -+ } -+ } -+ } -+ -+ if (cancellable_) { -+ g_cancellable_cancel(cancellable_); -+ g_object_unref(cancellable_); -+ cancellable_ = nullptr; -+ } -+ -+ if (proxy_) { -+ g_object_unref(proxy_); -+ proxy_ = nullptr; -+ } -+ -+ if (pw_fd_ != -1) { -+ close(pw_fd_); -+ } -+} -+ -+void ScreenCastPortal::Start() { -+ cancellable_ = g_cancellable_new(); -+ g_dbus_proxy_new_for_bus( -+ G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, /*info=*/nullptr, -+ kDesktopBusName, kDesktopObjectPath, kScreenCastInterfaceName, -+ cancellable_, reinterpret_cast(OnProxyRequested), -+ this); -+} -+ -+void ScreenCastPortal::PortalFailed(RequestResponse result) { -+ notifier_->OnScreenCastRequestResult(result, pw_stream_node_id_, pw_fd_); -+} -+ -+uint32_t ScreenCastPortal::SetupRequestResponseSignal( -+ const char* object_path, -+ GDBusSignalCallback callback) { -+ return g_dbus_connection_signal_subscribe( -+ connection_, kDesktopBusName, kRequestInterfaceName, "Response", -+ object_path, /*arg0=*/nullptr, G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE, -+ callback, this, /*user_data_free_func=*/nullptr); -+} -+ -+// static -+void ScreenCastPortal::OnProxyRequested(GObject* /*object*/, -+ GAsyncResult* result, -+ gpointer user_data) { -+ ScreenCastPortal* that = static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ Scoped error; -+ GDBusProxy* proxy = g_dbus_proxy_new_finish(result, error.receive()); -+ if (!proxy) { -+ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) -+ return; -+ RTC_LOG(LS_ERROR) << "Failed to create a proxy for the screen cast portal: " -+ << error->message; -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ that->proxy_ = proxy; -+ that->connection_ = g_dbus_proxy_get_connection(that->proxy_); -+ -+ RTC_LOG(LS_INFO) << "Created proxy for the screen cast portal."; -+ -+ that->SessionRequest(); -+} -+ -+// static -+std::string ScreenCastPortal::PrepareSignalHandle(GDBusConnection* connection, -+ const char* token) { -+ Scoped sender( -+ g_strdup(g_dbus_connection_get_unique_name(connection) + 1)); -+ for (int i = 0; sender.get()[i]; ++i) { -+ if (sender.get()[i] == '.') { -+ sender.get()[i] = '_'; -+ } -+ } -+ -+ const char* handle = g_strconcat(kDesktopRequestObjectPath, "/", sender.get(), -+ "/", token, /*end of varargs*/ nullptr); -+ -+ return handle; -+} -+ -+void ScreenCastPortal::SessionRequest() { -+ GVariantBuilder builder; -+ Scoped variant_string; -+ -+ g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); -+ variant_string = -+ g_strdup_printf("webrtc_session%d", g_random_int_range(0, G_MAXINT)); -+ g_variant_builder_add(&builder, "{sv}", "session_handle_token", -+ g_variant_new_string(variant_string.get())); -+ variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); -+ g_variant_builder_add(&builder, "{sv}", "handle_token", -+ g_variant_new_string(variant_string.get())); -+ -+ portal_handle_ = PrepareSignalHandle(connection_, variant_string.get()); -+ session_request_signal_id_ = SetupRequestResponseSignal( -+ portal_handle_.c_str(), OnSessionRequestResponseSignal); -+ -+ RTC_LOG(LS_INFO) << "Screen cast session requested."; -+ g_dbus_proxy_call(proxy_, "CreateSession", g_variant_new("(a{sv})", &builder), -+ G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, -+ reinterpret_cast(OnSessionRequested), -+ this); -+} -+ -+// static -+void ScreenCastPortal::OnSessionRequested(GDBusProxy* proxy, -+ GAsyncResult* result, -+ gpointer user_data) { -+ ScreenCastPortal* that = static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ Scoped error; -+ Scoped variant( -+ g_dbus_proxy_call_finish(proxy, result, error.receive())); -+ if (!variant) { -+ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) -+ return; -+ RTC_LOG(LS_ERROR) << "Failed to create a screen cast session: " -+ << error->message; -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ RTC_LOG(LS_INFO) << "Initializing the screen cast session."; -+ -+ Scoped handle; -+ g_variant_get_child(variant.get(), 0, "o", &handle); -+ if (!handle) { -+ RTC_LOG(LS_ERROR) << "Failed to initialize the screen cast session."; -+ if (that->session_request_signal_id_) { -+ g_dbus_connection_signal_unsubscribe(that->connection_, -+ that->session_request_signal_id_); -+ that->session_request_signal_id_ = 0; -+ } -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ -+ RTC_LOG(LS_INFO) << "Subscribing to the screen cast session."; -+} -+ -+// static -+void ScreenCastPortal::OnSessionRequestResponseSignal( -+ GDBusConnection* connection, -+ const char* sender_name, -+ const char* object_path, -+ const char* interface_name, -+ const char* signal_name, -+ GVariant* parameters, -+ gpointer user_data) { -+ ScreenCastPortal* that = static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ RTC_LOG(LS_INFO) -+ << "Received response for the screen cast session subscription."; -+ -+ uint32_t portal_response; -+ Scoped response_data; -+ g_variant_get(parameters, "(u@a{sv})", &portal_response, -+ response_data.receive()); -+ Scoped session_handle( -+ g_variant_lookup_value(response_data.get(), "session_handle", nullptr)); -+ that->session_handle_ = g_variant_dup_string(session_handle.get(), nullptr); -+ -+ if (that->session_handle_.empty() || portal_response) { -+ RTC_LOG(LS_ERROR) -+ << "Failed to request the screen cast session subscription."; -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ -+ that->session_closed_signal_id_ = g_dbus_connection_signal_subscribe( -+ that->connection_, kDesktopBusName, kSessionInterfaceName, "Closed", -+ that->session_handle_.c_str(), /*arg0=*/nullptr, G_DBUS_SIGNAL_FLAGS_NONE, -+ OnSessionClosedSignal, that, /*user_data_free_func=*/nullptr); -+ -+ that->SourcesRequest(); -+} -+ -+// static -+void ScreenCastPortal::OnSessionClosedSignal(GDBusConnection* connection, -+ const char* sender_name, -+ const char* object_path, -+ const char* interface_name, -+ const char* signal_name, -+ GVariant* parameters, -+ gpointer user_data) { -+ ScreenCastPortal* that = static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ RTC_LOG(LS_INFO) << "Received closed signal from session."; -+ -+ that->notifier_->OnScreenCastSessionClosed(); -+ -+ // Unsubscribe from the signal and free the session handle to avoid calling -+ // Session::Close from the destructor since it's already closed -+ g_dbus_connection_signal_unsubscribe(that->connection_, -+ that->session_closed_signal_id_); -+} -+ -+void ScreenCastPortal::SourcesRequest() { -+ GVariantBuilder builder; -+ Scoped variant_string; -+ -+ g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); -+ // We want to record monitor content. -+ g_variant_builder_add( -+ &builder, "{sv}", "types", -+ g_variant_new_uint32(static_cast(capture_source_type_))); -+ // We don't want to allow selection of multiple sources. -+ g_variant_builder_add(&builder, "{sv}", "multiple", -+ g_variant_new_boolean(false)); -+ -+ Scoped variant( -+ g_dbus_proxy_get_cached_property(proxy_, "AvailableCursorModes")); -+ if (variant.get()) { -+ uint32_t modes = 0; -+ g_variant_get(variant.get(), "u", &modes); -+ // Make request only if this mode is advertised by the portal -+ // implementation. -+ if (modes & static_cast(cursor_mode_)) { -+ g_variant_builder_add( -+ &builder, "{sv}", "cursor_mode", -+ g_variant_new_uint32(static_cast(cursor_mode_))); -+ } -+ } -+ -+ variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); -+ g_variant_builder_add(&builder, "{sv}", "handle_token", -+ g_variant_new_string(variant_string.get())); -+ -+ sources_handle_ = PrepareSignalHandle(connection_, variant_string.get()); -+ sources_request_signal_id_ = SetupRequestResponseSignal( -+ sources_handle_.c_str(), OnSourcesRequestResponseSignal); -+ -+ RTC_LOG(LS_INFO) << "Requesting sources from the screen cast session."; -+ g_dbus_proxy_call( -+ proxy_, "SelectSources", -+ g_variant_new("(oa{sv})", session_handle_.c_str(), &builder), -+ G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, -+ reinterpret_cast(OnSourcesRequested), this); -+} -+ -+// static -+void ScreenCastPortal::OnSourcesRequested(GDBusProxy* proxy, -+ GAsyncResult* result, -+ gpointer user_data) { -+ ScreenCastPortal* that = static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ Scoped error; -+ Scoped variant( -+ g_dbus_proxy_call_finish(proxy, result, error.receive())); -+ if (!variant) { -+ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) -+ return; -+ RTC_LOG(LS_ERROR) << "Failed to request the sources: " << error->message; -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ -+ RTC_LOG(LS_INFO) << "Sources requested from the screen cast session."; -+ -+ Scoped handle; -+ g_variant_get_child(variant.get(), 0, "o", handle.receive()); -+ if (!handle) { -+ RTC_LOG(LS_ERROR) << "Failed to initialize the screen cast session."; -+ if (that->sources_request_signal_id_) { -+ g_dbus_connection_signal_unsubscribe(that->connection_, -+ that->sources_request_signal_id_); -+ that->sources_request_signal_id_ = 0; -+ } -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ -+ RTC_LOG(LS_INFO) << "Subscribed to sources signal."; -+} -+ -+// static -+void ScreenCastPortal::OnSourcesRequestResponseSignal( -+ GDBusConnection* connection, -+ const char* sender_name, -+ const char* object_path, -+ const char* interface_name, -+ const char* signal_name, -+ GVariant* parameters, -+ gpointer user_data) { -+ ScreenCastPortal* that = static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ RTC_LOG(LS_INFO) << "Received sources signal from session."; -+ -+ uint32_t portal_response; -+ g_variant_get(parameters, "(u@a{sv})", &portal_response, nullptr); -+ if (portal_response) { -+ RTC_LOG(LS_ERROR) -+ << "Failed to select sources for the screen cast session."; -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ -+ that->StartRequest(); -+} -+ -+void ScreenCastPortal::StartRequest() { -+ GVariantBuilder builder; -+ Scoped variant_string; -+ -+ g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); -+ variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); -+ g_variant_builder_add(&builder, "{sv}", "handle_token", -+ g_variant_new_string(variant_string.get())); -+ -+ start_handle_ = PrepareSignalHandle(connection_, variant_string.get()); -+ start_request_signal_id_ = SetupRequestResponseSignal( -+ start_handle_.c_str(), OnStartRequestResponseSignal); -+ -+ // "Identifier for the application window", this is Wayland, so not "x11:...". -+ const char parent_window[] = ""; -+ -+ RTC_LOG(LS_INFO) << "Starting the screen cast session."; -+ g_dbus_proxy_call(proxy_, "Start", -+ g_variant_new("(osa{sv})", session_handle_.c_str(), -+ parent_window, &builder), -+ G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, -+ reinterpret_cast(OnStartRequested), -+ this); -+} -+ -+// static -+void ScreenCastPortal::OnStartRequested(GDBusProxy* proxy, -+ GAsyncResult* result, -+ gpointer user_data) { -+ ScreenCastPortal* that = static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ Scoped error; -+ Scoped variant( -+ g_dbus_proxy_call_finish(proxy, result, error.receive())); -+ if (!variant) { -+ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) -+ return; -+ RTC_LOG(LS_ERROR) << "Failed to start the screen cast session: " -+ << error->message; -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ -+ RTC_LOG(LS_INFO) << "Initializing the start of the screen cast session."; -+ -+ Scoped handle; -+ g_variant_get_child(variant.get(), 0, "o", handle.receive()); -+ if (!handle) { -+ RTC_LOG(LS_ERROR) -+ << "Failed to initialize the start of the screen cast session."; -+ if (that->start_request_signal_id_) { -+ g_dbus_connection_signal_unsubscribe(that->connection_, -+ that->start_request_signal_id_); -+ that->start_request_signal_id_ = 0; -+ } -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ -+ RTC_LOG(LS_INFO) << "Subscribed to the start signal."; -+} -+ -+// static -+void ScreenCastPortal::OnStartRequestResponseSignal(GDBusConnection* connection, -+ const char* sender_name, -+ const char* object_path, -+ const char* interface_name, -+ const char* signal_name, -+ GVariant* parameters, -+ gpointer user_data) { -+ ScreenCastPortal* that = static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ RTC_LOG(LS_INFO) << "Start signal received."; -+ uint32_t portal_response; -+ Scoped response_data; -+ Scoped iter; -+ g_variant_get(parameters, "(u@a{sv})", &portal_response, -+ response_data.receive()); -+ if (portal_response || !response_data) { -+ RTC_LOG(LS_ERROR) << "Failed to start the screen cast session."; -+ that->PortalFailed(static_cast(portal_response)); -+ return; -+ } -+ -+ // Array of PipeWire streams. See -+ // https://github.com/flatpak/xdg-desktop-portal/blob/master/data/org.freedesktop.portal.ScreenCast.xml -+ // documentation for . -+ if (g_variant_lookup(response_data.get(), "streams", "a(ua{sv})", -+ iter.receive())) { -+ Scoped variant; -+ -+ while (g_variant_iter_next(iter.get(), "@(ua{sv})", variant.receive())) { -+ uint32_t stream_id; -+ uint32_t type; -+ Scoped options; -+ -+ g_variant_get(variant.get(), "(u@a{sv})", &stream_id, options.receive()); -+ RTC_DCHECK(options.get()); -+ -+ if (g_variant_lookup(options.get(), "source_type", "u", &type)) { -+ that->capture_source_type_ = -+ static_cast(type); -+ } -+ -+ that->pw_stream_node_id_ = stream_id; -+ -+ break; -+ } -+ } -+ -+ that->OpenPipeWireRemote(); -+} -+ -+void ScreenCastPortal::OpenPipeWireRemote() { -+ GVariantBuilder builder; -+ g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); -+ -+ RTC_LOG(LS_INFO) << "Opening the PipeWire remote."; -+ -+ g_dbus_proxy_call_with_unix_fd_list( -+ proxy_, "OpenPipeWireRemote", -+ g_variant_new("(oa{sv})", session_handle_.c_str(), &builder), -+ G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, /*fd_list=*/nullptr, cancellable_, -+ reinterpret_cast(OnOpenPipeWireRemoteRequested), -+ this); -+} -+ -+// static -+void ScreenCastPortal::OnOpenPipeWireRemoteRequested(GDBusProxy* proxy, -+ GAsyncResult* result, -+ gpointer user_data) { -+ ScreenCastPortal* that = static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ Scoped error; -+ Scoped outlist; -+ Scoped variant(g_dbus_proxy_call_with_unix_fd_list_finish( -+ proxy, outlist.receive(), result, error.receive())); -+ if (!variant) { -+ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) -+ return; -+ RTC_LOG(LS_ERROR) << "Failed to open the PipeWire remote: " -+ << error->message; -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ -+ int32_t index; -+ g_variant_get(variant.get(), "(h)", &index); -+ -+ that->pw_fd_ = g_unix_fd_list_get(outlist.get(), index, error.receive()); -+ -+ if (that->pw_fd_ == -1) { -+ RTC_LOG(LS_ERROR) << "Failed to get file descriptor from the list: " -+ << error->message; -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ -+ that->notifier_->OnScreenCastRequestResult( -+ ScreenCastPortal::RequestResponse::kSuccess, that->pw_stream_node_id_, -+ that->pw_fd_); -+} -+ -+} // namespace webrtc -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.320409004 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h 2022-07-28 11:45:30.320409004 +0200 -@@ -0,0 +1,169 @@ -+/* -+ * Copyright 2022 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#ifndef MODULES_DESKTOP_CAPTURE_LINUX_SCREENCAST_PORTAL_H_ -+#define MODULES_DESKTOP_CAPTURE_LINUX_SCREENCAST_PORTAL_H_ -+ -+#include -+ -+#include -+ -+#include "absl/types/optional.h" -+ -+namespace webrtc { -+ -+class ScreenCastPortal { -+ public: -+ // Values are set based on source type property in -+ // xdg-desktop-portal/screencast -+ // https://github.com/flatpak/xdg-desktop-portal/blob/master/data/org.freedesktop.portal.ScreenCast.xml -+ enum class CaptureSourceType : uint32_t { -+ kScreen = 0b01, -+ kWindow = 0b10, -+ kAnyScreenContent = kScreen | kWindow -+ }; -+ -+ // Values are set based on cursor mode property in -+ // xdg-desktop-portal/screencast -+ // https://github.com/flatpak/xdg-desktop-portal/blob/master/data/org.freedesktop.portal.ScreenCast.xml -+ enum class CursorMode : uint32_t { -+ // Mouse cursor will not be included in any form -+ kHidden = 0b01, -+ // Mouse cursor will be part of the screen content -+ kEmbedded = 0b10, -+ // Mouse cursor information will be send separately in form of metadata -+ kMetadata = 0b100 -+ }; -+ -+ // Interface that must be implemented by the ScreenCastPortal consumers. -+ enum class RequestResponse { -+ // Success, the request is carried out. -+ kSuccess, -+ // The user cancelled the interaction. -+ kUserCancelled, -+ // The user interaction was ended in some other way. -+ kError, -+ -+ kMaxValue = kError -+ }; -+ -+ class PortalNotifier { -+ public: -+ virtual void OnScreenCastRequestResult(RequestResponse result, -+ uint32_t stream_node_id, -+ int fd) = 0; -+ virtual void OnScreenCastSessionClosed() = 0; -+ -+ protected: -+ PortalNotifier() = default; -+ virtual ~PortalNotifier() = default; -+ }; -+ -+ explicit ScreenCastPortal(CaptureSourceType source_type, -+ PortalNotifier* notifier); -+ ~ScreenCastPortal(); -+ -+ // Initialize ScreenCastPortal with series of DBus calls where we try to -+ // obtain all the required information, like PipeWire file descriptor and -+ // PipeWire stream node ID. -+ // -+ // The observer will return whether the communication with xdg-desktop-portal -+ // was successful and only then you will be able to get all the required -+ // information in order to continue working with PipeWire. -+ void Start(); -+ -+ private: -+ PortalNotifier* notifier_; -+ -+ // A PipeWire stream ID of stream we will be connecting to -+ uint32_t pw_stream_node_id_ = 0; -+ // A file descriptor of PipeWire socket -+ int pw_fd_ = -1; -+ -+ CaptureSourceType capture_source_type_ = -+ ScreenCastPortal::CaptureSourceType::kScreen; -+ -+ CursorMode cursor_mode_ = ScreenCastPortal::CursorMode::kMetadata; -+ -+ GDBusConnection* connection_ = nullptr; -+ GDBusProxy* proxy_ = nullptr; -+ GCancellable* cancellable_ = nullptr; -+ std::string portal_handle_; -+ std::string session_handle_; -+ std::string sources_handle_; -+ std::string start_handle_; -+ guint session_request_signal_id_ = 0; -+ guint sources_request_signal_id_ = 0; -+ guint start_request_signal_id_ = 0; -+ guint session_closed_signal_id_ = 0; -+ -+ void PortalFailed(RequestResponse result); -+ -+ uint32_t SetupRequestResponseSignal(const char* object_path, -+ GDBusSignalCallback callback); -+ -+ static void OnProxyRequested(GObject* object, -+ GAsyncResult* result, -+ gpointer user_data); -+ -+ static std::string PrepareSignalHandle(GDBusConnection* connection, -+ const char* token); -+ -+ void SessionRequest(); -+ static void OnSessionRequested(GDBusProxy* proxy, -+ GAsyncResult* result, -+ gpointer user_data); -+ static void OnSessionRequestResponseSignal(GDBusConnection* connection, -+ const char* sender_name, -+ const char* object_path, -+ const char* interface_name, -+ const char* signal_name, -+ GVariant* parameters, -+ gpointer user_data); -+ static void OnSessionClosedSignal(GDBusConnection* connection, -+ const char* sender_name, -+ const char* object_path, -+ const char* interface_name, -+ const char* signal_name, -+ GVariant* parameters, -+ gpointer user_data); -+ void SourcesRequest(); -+ static void OnSourcesRequested(GDBusProxy* proxy, -+ GAsyncResult* result, -+ gpointer user_data); -+ static void OnSourcesRequestResponseSignal(GDBusConnection* connection, -+ const char* sender_name, -+ const char* object_path, -+ const char* interface_name, -+ const char* signal_name, -+ GVariant* parameters, -+ gpointer user_data); -+ -+ void StartRequest(); -+ static void OnStartRequested(GDBusProxy* proxy, -+ GAsyncResult* result, -+ gpointer user_data); -+ static void OnStartRequestResponseSignal(GDBusConnection* connection, -+ const char* sender_name, -+ const char* object_path, -+ const char* interface_name, -+ const char* signal_name, -+ GVariant* parameters, -+ gpointer user_data); -+ -+ void OpenPipeWireRemote(); -+ static void OnOpenPipeWireRemoteRequested(GDBusProxy* proxy, -+ GAsyncResult* result, -+ gpointer user_data); -+}; -+ -+} // namespace webrtc -+ -+#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCREENCAST_PORTAL_H_ -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.320409004 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc 2022-07-28 11:45:30.320409004 +0200 -@@ -0,0 +1,892 @@ -+/* -+ * Copyright 2022 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#include "modules/desktop_capture/linux/shared_screencast_stream.h" -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include "absl/memory/memory.h" -+#include "modules/desktop_capture/linux/egl_dmabuf.h" -+#include "modules/desktop_capture/screen_capture_frame_queue.h" -+#include "rtc_base/checks.h" -+#include "rtc_base/logging.h" -+#include "rtc_base/sanitizer.h" -+#include "rtc_base/string_encode.h" -+#include "rtc_base/string_to_number.h" -+#include "rtc_base/synchronization/mutex.h" -+ -+#if defined(WEBRTC_DLOPEN_PIPEWIRE) -+#include "modules/desktop_capture/linux/pipewire_stubs.h" -+using modules_desktop_capture_linux_wayland::InitializeStubs; -+using modules_desktop_capture_linux_wayland::kModuleDrm; -+using modules_desktop_capture_linux_wayland::kModulePipewire; -+using modules_desktop_capture_linux_wayland::StubPathMap; -+#endif // defined(WEBRTC_DLOPEN_PIPEWIRE) -+ -+namespace webrtc { -+ -+const int kBytesPerPixel = 4; -+ -+#if defined(WEBRTC_DLOPEN_PIPEWIRE) -+const char kPipeWireLib[] = "libpipewire-0.3.so.0"; -+const char kDrmLib[] = "libdrm.so.2"; -+#endif -+ -+#if !PW_CHECK_VERSION(0, 3, 29) -+#define SPA_POD_PROP_FLAG_MANDATORY (1u << 3) -+#endif -+#if !PW_CHECK_VERSION(0, 3, 33) -+#define SPA_POD_PROP_FLAG_DONT_FIXATE (1u << 4) -+#endif -+ -+constexpr int kCursorBpp = 4; -+constexpr int CursorMetaSize(int w, int h) { -+ return (sizeof(struct spa_meta_cursor) + sizeof(struct spa_meta_bitmap) + -+ w * h * kCursorBpp); -+} -+ -+struct PipeWireVersion { -+ int major = 0; -+ int minor = 0; -+ int micro = 0; -+}; -+ -+constexpr PipeWireVersion kDmaBufMinVersion = {0, 3, 24}; -+constexpr PipeWireVersion kDmaBufModifierMinVersion = {0, 3, 33}; -+constexpr PipeWireVersion kDropSingleModifierMinVersion = {0, 3, 40}; -+ -+PipeWireVersion ParsePipeWireVersion(const char* version) { -+ std::vector parsed_version; -+ rtc::split(version, '.', &parsed_version); -+ -+ if (parsed_version.size() != 3) { -+ return {}; -+ } -+ -+ absl::optional major = rtc::StringToNumber(parsed_version.at(0)); -+ absl::optional minor = rtc::StringToNumber(parsed_version.at(1)); -+ absl::optional micro = rtc::StringToNumber(parsed_version.at(2)); -+ -+ // Return invalid version if we failed to parse it -+ if (!major || !minor || !micro) { -+ return {0, 0, 0}; -+ } -+ -+ return {major.value(), micro.value(), micro.value()}; -+} -+ -+spa_pod* BuildFormat(spa_pod_builder* builder, -+ uint32_t format, -+ const std::vector& modifiers) { -+ bool first = true; -+ spa_pod_frame frames[2]; -+ spa_rectangle pw_min_screen_bounds = spa_rectangle{1, 1}; -+ spa_rectangle pw_max_screen_bounds = spa_rectangle{UINT32_MAX, UINT32_MAX}; -+ -+ spa_pod_builder_push_object(builder, &frames[0], SPA_TYPE_OBJECT_Format, -+ SPA_PARAM_EnumFormat); -+ spa_pod_builder_add(builder, SPA_FORMAT_mediaType, -+ SPA_POD_Id(SPA_MEDIA_TYPE_video), 0); -+ spa_pod_builder_add(builder, SPA_FORMAT_mediaSubtype, -+ SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw), 0); -+ spa_pod_builder_add(builder, SPA_FORMAT_VIDEO_format, SPA_POD_Id(format), 0); -+ -+ if (modifiers.size()) { -+ if (modifiers.size() == 1 && modifiers[0] == DRM_FORMAT_MOD_INVALID) { -+ spa_pod_builder_prop(builder, SPA_FORMAT_VIDEO_modifier, -+ SPA_POD_PROP_FLAG_MANDATORY); -+ spa_pod_builder_long(builder, modifiers[0]); -+ } else { -+ spa_pod_builder_prop( -+ builder, SPA_FORMAT_VIDEO_modifier, -+ SPA_POD_PROP_FLAG_MANDATORY | SPA_POD_PROP_FLAG_DONT_FIXATE); -+ spa_pod_builder_push_choice(builder, &frames[1], SPA_CHOICE_Enum, 0); -+ -+ // modifiers from the array -+ for (int64_t val : modifiers) { -+ spa_pod_builder_long(builder, val); -+ // Add the first modifier twice as the very first value is the default -+ // option -+ if (first) { -+ spa_pod_builder_long(builder, val); -+ first = false; -+ } -+ } -+ spa_pod_builder_pop(builder, &frames[1]); -+ } -+ } -+ -+ spa_pod_builder_add( -+ builder, SPA_FORMAT_VIDEO_size, -+ SPA_POD_CHOICE_RANGE_Rectangle( -+ &pw_min_screen_bounds, &pw_min_screen_bounds, &pw_max_screen_bounds), -+ 0); -+ -+ return static_cast(spa_pod_builder_pop(builder, &frames[0])); -+} -+ -+class PipeWireThreadLoopLock { -+ public: -+ explicit PipeWireThreadLoopLock(pw_thread_loop* loop) : loop_(loop) { -+ pw_thread_loop_lock(loop_); -+ } -+ ~PipeWireThreadLoopLock() { pw_thread_loop_unlock(loop_); } -+ -+ private: -+ pw_thread_loop* const loop_; -+}; -+ -+class ScopedBuf { -+ public: -+ ScopedBuf() {} -+ ScopedBuf(uint8_t* map, int map_size, int fd) -+ : map_(map), map_size_(map_size), fd_(fd) {} -+ ~ScopedBuf() { -+ if (map_ != MAP_FAILED) { -+ munmap(map_, map_size_); -+ } -+ } -+ -+ explicit operator bool() { return map_ != MAP_FAILED; } -+ -+ void initialize(uint8_t* map, int map_size, int fd) { -+ map_ = map; -+ map_size_ = map_size; -+ fd_ = fd; -+ } -+ -+ uint8_t* get() { return map_; } -+ -+ protected: -+ uint8_t* map_ = static_cast(MAP_FAILED); -+ int map_size_; -+ int fd_; -+}; -+ -+class SharedScreenCastStreamPrivate { -+ public: -+ SharedScreenCastStreamPrivate(); -+ ~SharedScreenCastStreamPrivate(); -+ -+ bool StartScreenCastStream(uint32_t stream_node_id, int fd); -+ void StopScreenCastStream(); -+ std::unique_ptr CaptureFrame(); -+ std::unique_ptr CaptureCursor(); -+ DesktopVector CaptureCursorPosition(); -+ -+ private: -+ uint32_t pw_stream_node_id_ = 0; -+ int pw_fd_ = -1; -+ -+ DesktopSize desktop_size_ = {}; -+ DesktopSize video_size_; -+ -+ webrtc::Mutex queue_lock_; -+ ScreenCaptureFrameQueue queue_ -+ RTC_GUARDED_BY(&queue_lock_); -+ std::unique_ptr mouse_cursor_; -+ DesktopVector mouse_cursor_position_ = DesktopVector(-1, -1); -+ -+ int64_t modifier_; -+ std::unique_ptr egl_dmabuf_; -+ // List of modifiers we query as supported by the graphics card/driver -+ std::vector modifiers_; -+ -+ // PipeWire types -+ struct pw_context* pw_context_ = nullptr; -+ struct pw_core* pw_core_ = nullptr; -+ struct pw_stream* pw_stream_ = nullptr; -+ struct pw_thread_loop* pw_main_loop_ = nullptr; -+ struct spa_source* renegotiate_ = nullptr; -+ -+ spa_hook spa_core_listener_; -+ spa_hook spa_stream_listener_; -+ -+ // A number used to verify all previous methods and the resulting -+ // events have been handled. -+ int server_version_sync_ = 0; -+ // Version of the running PipeWire server we communicate with -+ PipeWireVersion pw_server_version_; -+ // Version of the library used to run our code -+ PipeWireVersion pw_client_version_; -+ -+ // event handlers -+ pw_core_events pw_core_events_ = {}; -+ pw_stream_events pw_stream_events_ = {}; -+ -+ struct spa_video_info_raw spa_video_format_; -+ -+ void ProcessBuffer(pw_buffer* buffer); -+ void ConvertRGBxToBGRx(uint8_t* frame, uint32_t size); -+ -+ // PipeWire callbacks -+ static void OnCoreError(void* data, -+ uint32_t id, -+ int seq, -+ int res, -+ const char* message); -+ static void OnCoreDone(void* user_data, uint32_t id, int seq); -+ static void OnCoreInfo(void* user_data, const pw_core_info* info); -+ static void OnStreamParamChanged(void* data, -+ uint32_t id, -+ const struct spa_pod* format); -+ static void OnStreamStateChanged(void* data, -+ pw_stream_state old_state, -+ pw_stream_state state, -+ const char* error_message); -+ static void OnStreamProcess(void* data); -+ // This will be invoked in case we fail to process DMA-BUF PW buffer using -+ // negotiated stream parameters (modifier). We will drop the modifier we -+ // failed to use and try to use a different one or fallback to shared memory -+ // buffers. -+ static void OnRenegotiateFormat(void* data, uint64_t); -+}; -+ -+bool operator>=(const PipeWireVersion& current_pw_version, -+ const PipeWireVersion& required_pw_version) { -+ if (!current_pw_version.major && !current_pw_version.minor && -+ !current_pw_version.micro) { -+ return false; -+ } -+ -+ return std::tie(current_pw_version.major, current_pw_version.minor, -+ current_pw_version.micro) >= -+ std::tie(required_pw_version.major, required_pw_version.minor, -+ required_pw_version.micro); -+} -+ -+bool operator<=(const PipeWireVersion& current_pw_version, -+ const PipeWireVersion& required_pw_version) { -+ if (!current_pw_version.major && !current_pw_version.minor && -+ !current_pw_version.micro) { -+ return false; -+ } -+ -+ return std::tie(current_pw_version.major, current_pw_version.minor, -+ current_pw_version.micro) <= -+ std::tie(required_pw_version.major, required_pw_version.minor, -+ required_pw_version.micro); -+} -+ -+void SharedScreenCastStreamPrivate::OnCoreError(void* data, -+ uint32_t id, -+ int seq, -+ int res, -+ const char* message) { -+ SharedScreenCastStreamPrivate* that = -+ static_cast(data); -+ RTC_DCHECK(that); -+ -+ RTC_LOG(LS_ERROR) << "PipeWire remote error: " << message; -+} -+ -+void SharedScreenCastStreamPrivate::OnCoreInfo(void* data, -+ const pw_core_info* info) { -+ SharedScreenCastStreamPrivate* stream = -+ static_cast(data); -+ RTC_DCHECK(stream); -+ -+ stream->pw_server_version_ = ParsePipeWireVersion(info->version); -+} -+ -+void SharedScreenCastStreamPrivate::OnCoreDone(void* data, -+ uint32_t id, -+ int seq) { -+ const SharedScreenCastStreamPrivate* stream = -+ static_cast(data); -+ RTC_DCHECK(stream); -+ -+ if (id == PW_ID_CORE && stream->server_version_sync_ == seq) { -+ pw_thread_loop_signal(stream->pw_main_loop_, false); -+ } -+} -+ -+// static -+void SharedScreenCastStreamPrivate::OnStreamStateChanged( -+ void* data, -+ pw_stream_state old_state, -+ pw_stream_state state, -+ const char* error_message) { -+ SharedScreenCastStreamPrivate* that = -+ static_cast(data); -+ RTC_DCHECK(that); -+ -+ switch (state) { -+ case PW_STREAM_STATE_ERROR: -+ RTC_LOG(LS_ERROR) << "PipeWire stream state error: " << error_message; -+ break; -+ case PW_STREAM_STATE_PAUSED: -+ case PW_STREAM_STATE_STREAMING: -+ case PW_STREAM_STATE_UNCONNECTED: -+ case PW_STREAM_STATE_CONNECTING: -+ break; -+ } -+} -+ -+// static -+void SharedScreenCastStreamPrivate::OnStreamParamChanged( -+ void* data, -+ uint32_t id, -+ const struct spa_pod* format) { -+ SharedScreenCastStreamPrivate* that = -+ static_cast(data); -+ RTC_DCHECK(that); -+ -+ RTC_LOG(LS_INFO) << "PipeWire stream format changed."; -+ if (!format || id != SPA_PARAM_Format) { -+ return; -+ } -+ -+ spa_format_video_raw_parse(format, &that->spa_video_format_); -+ -+ auto width = that->spa_video_format_.size.width; -+ auto height = that->spa_video_format_.size.height; -+ auto stride = SPA_ROUND_UP_N(width * kBytesPerPixel, 4); -+ auto size = height * stride; -+ -+ that->desktop_size_ = DesktopSize(width, height); -+ -+ uint8_t buffer[1024] = {}; -+ auto builder = spa_pod_builder{buffer, sizeof(buffer)}; -+ -+ // Setup buffers and meta header for new format. -+ -+ // When SPA_FORMAT_VIDEO_modifier is present we can use DMA-BUFs as -+ // the server announces support for it. -+ // See https://github.com/PipeWire/pipewire/blob/master/doc/dma-buf.dox -+ const bool has_modifier = -+ spa_pod_find_prop(format, nullptr, SPA_FORMAT_VIDEO_modifier); -+ that->modifier_ = -+ has_modifier ? that->spa_video_format_.modifier : DRM_FORMAT_MOD_INVALID; -+ std::vector params; -+ const int buffer_types = -+ has_modifier || (that->pw_server_version_ >= kDmaBufMinVersion) -+ ? (1 << SPA_DATA_DmaBuf) | (1 << SPA_DATA_MemFd) | -+ (1 << SPA_DATA_MemPtr) -+ : (1 << SPA_DATA_MemFd) | (1 << SPA_DATA_MemPtr); -+ -+ params.push_back(reinterpret_cast(spa_pod_builder_add_object( -+ &builder, SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers, -+ SPA_PARAM_BUFFERS_size, SPA_POD_Int(size), SPA_PARAM_BUFFERS_stride, -+ SPA_POD_Int(stride), SPA_PARAM_BUFFERS_buffers, -+ SPA_POD_CHOICE_RANGE_Int(8, 1, 32), SPA_PARAM_BUFFERS_dataType, -+ SPA_POD_CHOICE_FLAGS_Int(buffer_types)))); -+ params.push_back(reinterpret_cast(spa_pod_builder_add_object( -+ &builder, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, -+ SPA_POD_Id(SPA_META_Header), SPA_PARAM_META_size, -+ SPA_POD_Int(sizeof(struct spa_meta_header))))); -+ params.push_back(reinterpret_cast(spa_pod_builder_add_object( -+ &builder, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, -+ SPA_POD_Id(SPA_META_VideoCrop), SPA_PARAM_META_size, -+ SPA_POD_Int(sizeof(struct spa_meta_region))))); -+ params.push_back(reinterpret_cast(spa_pod_builder_add_object( -+ &builder, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, -+ SPA_POD_Id(SPA_META_Cursor), SPA_PARAM_META_size, -+ SPA_POD_CHOICE_RANGE_Int(CursorMetaSize(64, 64), CursorMetaSize(1, 1), -+ CursorMetaSize(384, 384))))); -+ params.push_back(reinterpret_cast(spa_pod_builder_add_object( -+ &builder, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, -+ SPA_POD_Id(SPA_META_VideoDamage), SPA_PARAM_META_size, -+ SPA_POD_CHOICE_RANGE_Int(sizeof(struct spa_meta_region) * 16, -+ sizeof(struct spa_meta_region) * 1, -+ sizeof(struct spa_meta_region) * 16)))); -+ -+ pw_stream_update_params(that->pw_stream_, params.data(), params.size()); -+} -+ -+// static -+void SharedScreenCastStreamPrivate::OnStreamProcess(void* data) { -+ SharedScreenCastStreamPrivate* that = -+ static_cast(data); -+ RTC_DCHECK(that); -+ -+ struct pw_buffer* next_buffer; -+ struct pw_buffer* buffer = nullptr; -+ -+ next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); -+ while (next_buffer) { -+ buffer = next_buffer; -+ next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); -+ -+ if (next_buffer) { -+ pw_stream_queue_buffer(that->pw_stream_, buffer); -+ } -+ } -+ -+ if (!buffer) { -+ return; -+ } -+ -+ that->ProcessBuffer(buffer); -+ -+ pw_stream_queue_buffer(that->pw_stream_, buffer); -+} -+ -+void SharedScreenCastStreamPrivate::OnRenegotiateFormat(void* data, uint64_t) { -+ SharedScreenCastStreamPrivate* that = -+ static_cast(data); -+ RTC_DCHECK(that); -+ -+ { -+ PipeWireThreadLoopLock thread_loop_lock(that->pw_main_loop_); -+ -+ uint8_t buffer[2048] = {}; -+ -+ spa_pod_builder builder = spa_pod_builder{buffer, sizeof(buffer)}; -+ -+ std::vector params; -+ -+ for (uint32_t format : {SPA_VIDEO_FORMAT_BGRA, SPA_VIDEO_FORMAT_RGBA, -+ SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_RGBx}) { -+ if (!that->modifiers_.empty()) { -+ params.push_back(BuildFormat(&builder, format, that->modifiers_)); -+ } -+ params.push_back(BuildFormat(&builder, format, /*modifiers=*/{})); -+ } -+ -+ pw_stream_update_params(that->pw_stream_, params.data(), params.size()); -+ } -+} -+ -+SharedScreenCastStreamPrivate::SharedScreenCastStreamPrivate() {} -+ -+SharedScreenCastStreamPrivate::~SharedScreenCastStreamPrivate() { -+ if (pw_main_loop_) { -+ pw_thread_loop_stop(pw_main_loop_); -+ } -+ -+ if (pw_stream_) { -+ pw_stream_destroy(pw_stream_); -+ } -+ -+ if (pw_core_) { -+ pw_core_disconnect(pw_core_); -+ } -+ -+ if (pw_context_) { -+ pw_context_destroy(pw_context_); -+ } -+ -+ if (pw_main_loop_) { -+ pw_thread_loop_destroy(pw_main_loop_); -+ } -+} -+ -+bool SharedScreenCastStreamPrivate::StartScreenCastStream( -+ uint32_t stream_node_id, -+ int fd) { -+#if defined(WEBRTC_DLOPEN_PIPEWIRE) -+ StubPathMap paths; -+ -+ // Check if the PipeWire and DRM libraries are available. -+ paths[kModulePipewire].push_back(kPipeWireLib); -+ paths[kModuleDrm].push_back(kDrmLib); -+ -+ if (!InitializeStubs(paths)) { -+ RTC_LOG(LS_ERROR) -+ << "One of following libraries is missing on your system:\n" -+ << " - PipeWire (" << kPipeWireLib << ")\n" -+ << " - drm (" << kDrmLib << ")"; -+ return false; -+ } -+#endif // defined(WEBRTC_DLOPEN_PIPEWIRE) -+ egl_dmabuf_ = std::make_unique(); -+ -+ pw_stream_node_id_ = stream_node_id; -+ pw_fd_ = fd; -+ -+ pw_init(/*argc=*/nullptr, /*argc=*/nullptr); -+ -+ pw_main_loop_ = pw_thread_loop_new("pipewire-main-loop", nullptr); -+ -+ pw_context_ = -+ pw_context_new(pw_thread_loop_get_loop(pw_main_loop_), nullptr, 0); -+ if (!pw_context_) { -+ RTC_LOG(LS_ERROR) << "Failed to create PipeWire context"; -+ return false; -+ } -+ -+ if (pw_thread_loop_start(pw_main_loop_) < 0) { -+ RTC_LOG(LS_ERROR) << "Failed to start main PipeWire loop"; -+ return false; -+ } -+ -+ pw_client_version_ = ParsePipeWireVersion(pw_get_library_version()); -+ -+ // Initialize event handlers, remote end and stream-related. -+ pw_core_events_.version = PW_VERSION_CORE_EVENTS; -+ pw_core_events_.info = &OnCoreInfo; -+ pw_core_events_.done = &OnCoreDone; -+ pw_core_events_.error = &OnCoreError; -+ -+ pw_stream_events_.version = PW_VERSION_STREAM_EVENTS; -+ pw_stream_events_.state_changed = &OnStreamStateChanged; -+ pw_stream_events_.param_changed = &OnStreamParamChanged; -+ pw_stream_events_.process = &OnStreamProcess; -+ -+ { -+ PipeWireThreadLoopLock thread_loop_lock(pw_main_loop_); -+ -+ pw_core_ = pw_context_connect_fd(pw_context_, pw_fd_, nullptr, 0); -+ if (!pw_core_) { -+ RTC_LOG(LS_ERROR) << "Failed to connect PipeWire context"; -+ return false; -+ } -+ -+ pw_core_add_listener(pw_core_, &spa_core_listener_, &pw_core_events_, this); -+ -+ // Add an event that can be later invoked by pw_loop_signal_event() -+ renegotiate_ = pw_loop_add_event(pw_thread_loop_get_loop(pw_main_loop_), -+ OnRenegotiateFormat, this); -+ -+ server_version_sync_ = -+ pw_core_sync(pw_core_, PW_ID_CORE, server_version_sync_); -+ -+ pw_thread_loop_wait(pw_main_loop_); -+ -+ pw_properties* reuseProps = -+ pw_properties_new_string("pipewire.client.reuse=1"); -+ pw_stream_ = pw_stream_new(pw_core_, "webrtc-consume-stream", reuseProps); -+ -+ if (!pw_stream_) { -+ RTC_LOG(LS_ERROR) << "Failed to create PipeWire stream"; -+ return false; -+ } -+ -+ pw_stream_add_listener(pw_stream_, &spa_stream_listener_, -+ &pw_stream_events_, this); -+ uint8_t buffer[2048] = {}; -+ -+ spa_pod_builder builder = spa_pod_builder{buffer, sizeof(buffer)}; -+ -+ std::vector params; -+ const bool has_required_pw_client_version = -+ pw_client_version_ >= kDmaBufModifierMinVersion; -+ const bool has_required_pw_server_version = -+ pw_server_version_ >= kDmaBufModifierMinVersion; -+ for (uint32_t format : {SPA_VIDEO_FORMAT_BGRA, SPA_VIDEO_FORMAT_RGBA, -+ SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_RGBx}) { -+ // Modifiers can be used with PipeWire >= 0.3.33 -+ if (has_required_pw_client_version && has_required_pw_server_version) { -+ modifiers_ = egl_dmabuf_->QueryDmaBufModifiers(format); -+ -+ if (!modifiers_.empty()) { -+ params.push_back(BuildFormat(&builder, format, modifiers_)); -+ } -+ } -+ -+ params.push_back(BuildFormat(&builder, format, /*modifiers=*/{})); -+ } -+ -+ if (pw_stream_connect(pw_stream_, PW_DIRECTION_INPUT, pw_stream_node_id_, -+ PW_STREAM_FLAG_AUTOCONNECT, params.data(), -+ params.size()) != 0) { -+ RTC_LOG(LS_ERROR) << "Could not connect receiving stream."; -+ return false; -+ } -+ -+ RTC_LOG(LS_INFO) << "PipeWire remote opened."; -+ } -+ return true; -+} -+ -+void SharedScreenCastStreamPrivate::StopScreenCastStream() { -+ if (pw_stream_) { -+ pw_stream_disconnect(pw_stream_); -+ } -+} -+ -+std::unique_ptr SharedScreenCastStreamPrivate::CaptureFrame() { -+ webrtc::MutexLock lock(&queue_lock_); -+ -+ if (!queue_.current_frame()) { -+ return std::unique_ptr{}; -+ } -+ -+ std::unique_ptr frame = queue_.current_frame()->Share(); -+ return std::move(frame); -+} -+ -+std::unique_ptr SharedScreenCastStreamPrivate::CaptureCursor() { -+ if (!mouse_cursor_) { -+ return nullptr; -+ } -+ -+ return std::move(mouse_cursor_); -+} -+ -+DesktopVector SharedScreenCastStreamPrivate::CaptureCursorPosition() { -+ return mouse_cursor_position_; -+} -+ -+void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { -+ spa_buffer* spa_buffer = buffer->buffer; -+ ScopedBuf map; -+ std::unique_ptr src_unique_ptr; -+ uint8_t* src = nullptr; -+ -+ // Try to update the mouse cursor first, because it can be the only -+ // information carried by the buffer -+ { -+ const struct spa_meta_cursor* cursor = -+ static_cast(spa_buffer_find_meta_data( -+ spa_buffer, SPA_META_Cursor, sizeof(*cursor))); -+ if (cursor && spa_meta_cursor_is_valid(cursor)) { -+ struct spa_meta_bitmap* bitmap = nullptr; -+ -+ if (cursor->bitmap_offset) -+ bitmap = -+ SPA_MEMBER(cursor, cursor->bitmap_offset, struct spa_meta_bitmap); -+ -+ if (bitmap && bitmap->size.width > 0 && bitmap->size.height > 0) { -+ const uint8_t* bitmap_data = -+ SPA_MEMBER(bitmap, bitmap->offset, uint8_t); -+ BasicDesktopFrame* mouse_frame = new BasicDesktopFrame( -+ DesktopSize(bitmap->size.width, bitmap->size.height)); -+ mouse_frame->CopyPixelsFrom( -+ bitmap_data, bitmap->stride, -+ DesktopRect::MakeWH(bitmap->size.width, bitmap->size.height)); -+ mouse_cursor_ = std::make_unique( -+ mouse_frame, DesktopVector(cursor->hotspot.x, cursor->hotspot.y)); -+ } -+ mouse_cursor_position_.set(cursor->position.x, cursor->position.y); -+ } -+ } -+ -+ if (spa_buffer->datas[0].chunk->size == 0) { -+ return; -+ } -+ -+ if (spa_buffer->datas[0].type == SPA_DATA_MemFd) { -+ map.initialize( -+ static_cast( -+ mmap(nullptr, -+ spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset, -+ PROT_READ, MAP_PRIVATE, spa_buffer->datas[0].fd, 0)), -+ spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset, -+ spa_buffer->datas[0].fd); -+ -+ if (!map) { -+ RTC_LOG(LS_ERROR) << "Failed to mmap the memory: " -+ << std::strerror(errno); -+ return; -+ } -+ -+ src = SPA_MEMBER(map.get(), spa_buffer->datas[0].mapoffset, uint8_t); -+ } else if (spa_buffer->datas[0].type == SPA_DATA_DmaBuf) { -+ const uint n_planes = spa_buffer->n_datas; -+ -+ if (!n_planes) { -+ return; -+ } -+ -+ std::vector plane_datas; -+ for (uint32_t i = 0; i < n_planes; ++i) { -+ EglDmaBuf::PlaneData data = { -+ static_cast(spa_buffer->datas[i].fd), -+ static_cast(spa_buffer->datas[i].chunk->stride), -+ static_cast(spa_buffer->datas[i].chunk->offset)}; -+ plane_datas.push_back(data); -+ } -+ -+ // When importing DMA-BUFs, we use the stride (number of bytes from one row -+ // of pixels in the buffer) provided by PipeWire. The stride from PipeWire -+ // is given by the graphics driver and some drivers might add some -+ // additional padding for memory layout optimizations so not everytime the -+ // stride is equal to BYTES_PER_PIXEL x WIDTH. This is fine, because during -+ // the import we will use OpenGL and same graphics driver so it will be able -+ // to work with the stride it provided, but later on when we work with -+ // images we get from DMA-BUFs we will need to update the stride to be equal -+ // to BYTES_PER_PIXEL x WIDTH as that's the size of the DesktopFrame we -+ // allocate for each captured frame. -+ src_unique_ptr = egl_dmabuf_->ImageFromDmaBuf( -+ desktop_size_, spa_video_format_.format, plane_datas, modifier_); -+ if (src_unique_ptr) { -+ src = src_unique_ptr.get(); -+ } else { -+ RTC_LOG(LS_ERROR) << "Dropping DMA-BUF modifier: " << modifier_ -+ << " and trying to renegotiate stream parameters"; -+ -+ if (pw_server_version_ >= kDropSingleModifierMinVersion) { -+ modifiers_.erase( -+ std::remove(modifiers_.begin(), modifiers_.end(), modifier_), -+ modifiers_.end()); -+ } else { -+ modifiers_.clear(); -+ } -+ -+ pw_loop_signal_event(pw_thread_loop_get_loop(pw_main_loop_), -+ renegotiate_); -+ return; -+ } -+ } else if (spa_buffer->datas[0].type == SPA_DATA_MemPtr) { -+ src = static_cast(spa_buffer->datas[0].data); -+ } -+ -+ if (!src) { -+ return; -+ } -+ struct spa_meta_region* video_metadata = -+ static_cast(spa_buffer_find_meta_data( -+ spa_buffer, SPA_META_VideoCrop, sizeof(*video_metadata))); -+ -+ // Video size from metadata is bigger than an actual video stream size. -+ // The metadata are wrong or we should up-scale the video...in both cases -+ // just quit now. -+ if (video_metadata && (video_metadata->region.size.width > -+ static_cast(desktop_size_.width()) || -+ video_metadata->region.size.height > -+ static_cast(desktop_size_.height()))) { -+ RTC_LOG(LS_ERROR) << "Stream metadata sizes are wrong!"; -+ return; -+ } -+ -+ // Use video metadata when video size from metadata is set and smaller than -+ // video stream size, so we need to adjust it. -+ bool video_metadata_use = false; -+ const struct spa_rectangle* video_metadata_size = -+ video_metadata ? &video_metadata->region.size : nullptr; -+ -+ if (video_metadata_size && video_metadata_size->width != 0 && -+ video_metadata_size->height != 0 && -+ (static_cast(video_metadata_size->width) < desktop_size_.width() || -+ static_cast(video_metadata_size->height) < -+ desktop_size_.height())) { -+ video_metadata_use = true; -+ } -+ -+ if (video_metadata_use) { -+ video_size_ = -+ DesktopSize(video_metadata_size->width, video_metadata_size->height); -+ } else { -+ video_size_ = desktop_size_; -+ } -+ -+ uint32_t y_offset = video_metadata_use && (video_metadata->region.position.y + -+ video_size_.height() <= -+ desktop_size_.height()) -+ ? video_metadata->region.position.y -+ : 0; -+ uint32_t x_offset = video_metadata_use && (video_metadata->region.position.x + -+ video_size_.width() <= -+ desktop_size_.width()) -+ ? video_metadata->region.position.x -+ : 0; -+ -+ const uint32_t frame_stride = kBytesPerPixel * desktop_size_.width(); -+ uint32_t stride = spa_buffer->datas[0].chunk->stride; -+ -+ if (spa_buffer->datas[0].type == SPA_DATA_DmaBuf && stride > frame_stride) { -+ // When DMA-BUFs are used, sometimes spa_buffer->stride we get might -+ // contain additional padding, but after we import the buffer, the stride -+ // we used is no longer relevant and we should just calculate it based on -+ // width. For more context see https://crbug.com/1333304. -+ stride = frame_stride; -+ } -+ -+ uint8_t* updated_src = -+ src + (stride * y_offset) + (kBytesPerPixel * x_offset); -+ -+ webrtc::MutexLock lock(&queue_lock_); -+ -+ // Move to the next frame if the current one is being used and shared -+ if (queue_.current_frame() && queue_.current_frame()->IsShared()) { -+ queue_.MoveToNextFrame(); -+ if (queue_.current_frame() && queue_.current_frame()->IsShared()) { -+ RTC_LOG(LS_WARNING) -+ << "Failed to process PipeWire buffer: no available frame"; -+ return; -+ } -+ } -+ -+ if (!queue_.current_frame() || -+ !queue_.current_frame()->size().equals(video_size_)) { -+ std::unique_ptr frame(new BasicDesktopFrame( -+ DesktopSize(video_size_.width(), video_size_.height()))); -+ queue_.ReplaceCurrentFrame(SharedDesktopFrame::Wrap(std::move(frame))); -+ } -+ -+ queue_.current_frame()->CopyPixelsFrom( -+ updated_src, (stride - (kBytesPerPixel * x_offset)), -+ DesktopRect::MakeWH(video_size_.width(), video_size_.height())); -+ -+ if (spa_video_format_.format == SPA_VIDEO_FORMAT_RGBx || -+ spa_video_format_.format == SPA_VIDEO_FORMAT_RGBA) { -+ uint8_t* tmp_src = queue_.current_frame()->data(); -+ for (int i = 0; i < video_size_.height(); ++i) { -+ // If both sides decided to go with the RGBx format we need to convert -+ // it to BGRx to match color format expected by WebRTC. -+ ConvertRGBxToBGRx(tmp_src, queue_.current_frame()->stride()); -+ tmp_src += queue_.current_frame()->stride(); -+ } -+ } -+} -+ -+void SharedScreenCastStreamPrivate::ConvertRGBxToBGRx(uint8_t* frame, -+ uint32_t size) { -+ for (uint32_t i = 0; i < size; i += 4) { -+ uint8_t tempR = frame[i]; -+ uint8_t tempB = frame[i + 2]; -+ frame[i] = tempB; -+ frame[i + 2] = tempR; -+ } -+} -+ -+SharedScreenCastStream::SharedScreenCastStream() -+ : private_(std::make_unique()) {} -+ -+SharedScreenCastStream::~SharedScreenCastStream() {} -+ -+rtc::scoped_refptr -+SharedScreenCastStream::CreateDefault() { -+ // Explicit new, to access non-public constructor. -+ return rtc::scoped_refptr(new SharedScreenCastStream()); -+} -+ -+bool SharedScreenCastStream::StartScreenCastStream(uint32_t stream_node_id, -+ int fd) { -+ return private_->StartScreenCastStream(stream_node_id, fd); -+} -+ -+void SharedScreenCastStream::StopScreenCastStream() { -+ private_->StopScreenCastStream(); -+} -+ -+std::unique_ptr SharedScreenCastStream::CaptureFrame() { -+ return private_->CaptureFrame(); -+} -+ -+std::unique_ptr SharedScreenCastStream::CaptureCursor() { -+ return private_->CaptureCursor(); -+} -+ -+absl::optional SharedScreenCastStream::CaptureCursorPosition() { -+ DesktopVector position = private_->CaptureCursorPosition(); -+ -+ // Consider only (x >= 0 and y >= 0) a valid position -+ if (position.x() < 0 || position.y() < 0) { -+ return absl::nullopt; -+ } -+ -+ return position; -+} -+ -+} // namespace webrtc -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h.libwebrtc-screen-cast-sync 2022-07-28 11:45:30.320409004 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h 2022-07-28 11:45:30.320409004 +0200 -@@ -0,0 +1,71 @@ -+/* -+ * Copyright 2022 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#ifndef MODULES_DESKTOP_CAPTURE_LINUX_SHARED_SCREENCAST_STREAM_H_ -+#define MODULES_DESKTOP_CAPTURE_LINUX_SHARED_SCREENCAST_STREAM_H_ -+ -+#include -+ -+#include "absl/types/optional.h" -+#include "api/ref_counted_base.h" -+#include "api/scoped_refptr.h" -+#include "modules/desktop_capture/desktop_frame.h" -+#include "modules/desktop_capture/mouse_cursor.h" -+#include "rtc_base/system/rtc_export.h" -+ -+namespace webrtc { -+ -+class SharedScreenCastStreamPrivate; -+ -+class RTC_EXPORT SharedScreenCastStream -+ : public rtc::RefCountedBase { -+ public: -+ static rtc::scoped_refptr CreateDefault(); -+ -+ bool StartScreenCastStream(uint32_t stream_node_id, int fd); -+ void StopScreenCastStream(); -+ -+ // Below functions return the most recent information we get from a -+ // PipeWire buffer on each Process() callback. This assumes that we -+ // managed to successfuly connect to a PipeWire stream provided by the -+ // compositor (based on stream parameters). The cursor data are obtained -+ // from spa_meta_cursor stream metadata and therefore the cursor is not -+ // part of actual screen/window frame. -+ -+ // Returns the most recent screen/window frame we obtained from PipeWire -+ // buffer. Will return an empty frame in case we didn't manage to get a frame -+ // from PipeWire buffer. -+ std::unique_ptr CaptureFrame(); -+ -+ // Returns the most recent mouse cursor image. Will return an nullptr cursor -+ // in case we didn't manage to get a cursor from PipeWire buffer. NOTE: the -+ // cursor image might not be updated on every cursor location change, but -+ // actually only when its shape changes. -+ std::unique_ptr CaptureCursor(); -+ -+ // Returns the most recent mouse cursor position. Will not return a value in -+ // case we didn't manage to get it from PipeWire buffer. -+ absl::optional CaptureCursorPosition(); -+ -+ ~SharedScreenCastStream(); -+ -+ protected: -+ SharedScreenCastStream(); -+ -+ private: -+ SharedScreenCastStream(const SharedScreenCastStream&) = delete; -+ SharedScreenCastStream& operator=(const SharedScreenCastStream&) = delete; -+ -+ std::unique_ptr private_; -+}; -+ -+} // namespace webrtc -+ -+#endif // MODULES_DESKTOP_CAPTURE_LINUX_SHARED_SCREENCAST_STREAM_H_ -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc.libwebrtc-screen-cast-sync 2022-07-18 20:44:26.000000000 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc 2022-07-28 11:45:30.320409004 +0200 -@@ -17,6 +17,10 @@ - #include "modules/desktop_capture/linux/mouse_cursor_monitor_x11.h" - #endif // defined(WEBRTC_USE_X11) - -+#if defined(WEBRTC_USE_PIPEWIRE) -+#include "modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h" -+#endif // defined(WEBRTC_USE_PIPEWIRE) -+ - namespace webrtc { - - // static -@@ -44,6 +48,13 @@ MouseCursorMonitor* MouseCursorMonitor:: - // static - std::unique_ptr MouseCursorMonitor::Create( - const DesktopCaptureOptions& options) { -+#if defined(WEBRTC_USE_PIPEWIRE) -+ if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland() && -+ options.screencast_stream()) { -+ return std::make_unique(options); -+ } -+#endif // defined(WEBRTC_USE_PIPEWIRE) -+ - #if defined(WEBRTC_USE_X11) - return MouseCursorMonitorX11::Create(options); - #else -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc.libwebrtc-screen-cast-sync 2022-07-18 20:44:33.000000000 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc 2022-07-28 11:45:30.320409004 +0200 -@@ -14,7 +14,7 @@ - #include "modules/desktop_capture/desktop_capturer.h" - - #if defined(WEBRTC_USE_PIPEWIRE) --#include "modules/desktop_capture/linux/screen_capturer_pipewire.h" -+#include "modules/desktop_capture/linux/base_capturer_pipewire.h" - #endif // defined(WEBRTC_USE_PIPEWIRE) - - #if defined(WEBRTC_USE_X11) -@@ -28,7 +28,7 @@ std::unique_ptr Desktop - const DesktopCaptureOptions& options) { - #if defined(WEBRTC_USE_PIPEWIRE) - if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { -- return BaseCapturerPipeWire::CreateRawScreenCapturer(options); -+ return std::make_unique(options); - } - #endif // defined(WEBRTC_USE_PIPEWIRE) - -diff -up firefox-103.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc.libwebrtc-screen-cast-sync firefox-103.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc ---- firefox-103.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc.libwebrtc-screen-cast-sync 2022-07-18 20:44:26.000000000 +0200 -+++ firefox-103.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc 2022-07-28 11:45:30.320409004 +0200 -@@ -14,7 +14,7 @@ - #include "modules/desktop_capture/desktop_capturer.h" - - #if defined(WEBRTC_USE_PIPEWIRE) --#include "modules/desktop_capture/linux/window_capturer_pipewire.h" -+#include "modules/desktop_capture/linux/base_capturer_pipewire.h" - #endif // defined(WEBRTC_USE_PIPEWIRE) - - #if defined(WEBRTC_USE_X11) -@@ -28,7 +28,7 @@ std::unique_ptr Desktop - const DesktopCaptureOptions& options) { - #if defined(WEBRTC_USE_PIPEWIRE) - if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { -- return BaseCapturerPipeWire::CreateRawWindowCapturer(options); -+ return std::make_unique(options); - } - #endif // defined(WEBRTC_USE_PIPEWIRE) - -diff -up firefox-103.0/third_party/moz.build.libwebrtc-screen-cast-sync firefox-103.0/third_party/moz.build ---- firefox-103.0/third_party/moz.build.libwebrtc-screen-cast-sync 2022-07-18 20:44:36.000000000 +0200 -+++ firefox-103.0/third_party/moz.build 2022-07-28 11:45:30.321408998 +0200 -@@ -61,6 +61,12 @@ with Files("libwebrtc/**"): - with Files("pipewire/**"): - BUG_COMPONENT = ("Core", "WebRTC") - -+with Files("drm/**"): -+ BUG_COMPONENT = ("Core", "WebRTC") -+ -+with Files("gbm/**"): -+ BUG_COMPONENT = ("Core", "WebRTC") -+ - with Files('rlbox_wasm2c_sandbox/**'): - BUG_COMPONENT = ('Firefox Build System', 'General') - -diff -up firefox-103.0/third_party/pipewire/libpipewire/mozpipewire.cpp.libwebrtc-screen-cast-sync firefox-103.0/third_party/pipewire/libpipewire/mozpipewire.cpp ---- firefox-103.0/third_party/pipewire/libpipewire/mozpipewire.cpp.libwebrtc-screen-cast-sync 2022-07-18 20:44:36.000000000 +0200 -+++ firefox-103.0/third_party/pipewire/libpipewire/mozpipewire.cpp 2022-07-28 11:45:30.321408998 +0200 -@@ -69,11 +69,13 @@ static int (*pw_stream_connect_fn)(struc - enum pw_stream_flags flags, - const struct spa_pod **params, - uint32_t n_params); -+static int (*pw_stream_disconnect_fn)(struct pw_stream *stream); - static struct pw_buffer* (*pw_stream_dequeue_buffer_fn)(struct pw_stream *stream); - static void (*pw_stream_destroy_fn)(struct pw_stream *stream); - static struct pw_stream* (*pw_stream_new_fn)(struct pw_core *core, - const char *name, - struct pw_properties *props); -+ - static int (*pw_stream_queue_buffer_fn)(struct pw_stream *stream, - struct pw_buffer *buffer); - static int (*pw_stream_update_params_fn)(struct pw_stream *stream, -@@ -87,7 +89,10 @@ static int (*pw_thread_loop_start_fn)(st - static void (*pw_thread_loop_stop_fn)(struct pw_thread_loop *loop); - static void (*pw_thread_loop_lock_fn)(struct pw_thread_loop *loop); - static void (*pw_thread_loop_unlock_fn)(struct pw_thread_loop *loop); -+static void (*pw_thread_loop_wait_fn)(struct pw_thread_loop *loop); -+static void (*pw_thread_loop_signal_fn)(struct pw_thread_loop *loop, bool wait_for_accept); - static struct pw_properties* (*pw_properties_new_string_fn)(const char *str); -+static const char* (*pw_get_library_version_fn)(); - - bool IsPwLibraryLoaded() { - static bool isLoaded = -@@ -99,6 +104,7 @@ bool IsPwLibraryLoaded() { - IS_FUNC_LOADED(pw_init_fn) && - IS_FUNC_LOADED(pw_stream_add_listener_fn) && - IS_FUNC_LOADED(pw_stream_connect_fn) && -+ IS_FUNC_LOADED(pw_stream_disconnect_fn) && - IS_FUNC_LOADED(pw_stream_dequeue_buffer_fn) && - IS_FUNC_LOADED(pw_stream_destroy_fn) && - IS_FUNC_LOADED(pw_stream_new_fn) && -@@ -111,7 +117,10 @@ bool IsPwLibraryLoaded() { - IS_FUNC_LOADED(pw_thread_loop_stop_fn) && - IS_FUNC_LOADED(pw_thread_loop_lock_fn) && - IS_FUNC_LOADED(pw_thread_loop_unlock_fn) && -- IS_FUNC_LOADED(pw_properties_new_string_fn)); -+ IS_FUNC_LOADED(pw_thread_loop_signal_fn) && -+ IS_FUNC_LOADED(pw_thread_loop_wait_fn) && -+ IS_FUNC_LOADED(pw_properties_new_string_fn) && -+ IS_FUNC_LOADED(pw_get_library_version_fn)); - - return isLoaded; - } -@@ -136,6 +145,7 @@ bool LoadPWLibrary() { - GET_FUNC(pw_init, pwLib); - GET_FUNC(pw_stream_add_listener, pwLib); - GET_FUNC(pw_stream_connect, pwLib); -+ GET_FUNC(pw_stream_disconnect, pwLib); - GET_FUNC(pw_stream_dequeue_buffer, pwLib); - GET_FUNC(pw_stream_destroy, pwLib); - GET_FUNC(pw_stream_new, pwLib); -@@ -148,7 +158,10 @@ bool LoadPWLibrary() { - GET_FUNC(pw_thread_loop_stop, pwLib); - GET_FUNC(pw_thread_loop_lock, pwLib); - GET_FUNC(pw_thread_loop_unlock, pwLib); -+ GET_FUNC(pw_thread_loop_signal, pwLib); -+ GET_FUNC(pw_thread_loop_wait, pwLib); - GET_FUNC(pw_properties_new_string, pwLib); -+ GET_FUNC(pw_get_library_version, pwLib); - } - - return IsPwLibraryLoaded(); -@@ -242,6 +255,15 @@ pw_stream_connect(struct pw_stream *stre - params, n_params); - } - -+int -+pw_stream_disconnect(struct pw_stream *stream) -+{ -+ if (!LoadPWLibrary()) { -+ return 0; -+ } -+ return pw_stream_disconnect_fn(stream); -+} -+ - struct pw_buffer * - pw_stream_dequeue_buffer(struct pw_stream *stream) - { -@@ -356,6 +378,23 @@ pw_thread_loop_unlock(struct pw_thread_l - return pw_thread_loop_unlock_fn(loop); - } - -+void -+pw_thread_loop_signal(struct pw_thread_loop *loop, bool wait_for_accept) -+{ -+ if (!LoadPWLibrary()) { -+ return; -+ } -+ return pw_thread_loop_signal_fn(loop, wait_for_accept); -+} -+ -+void -+pw_thread_loop_wait(struct pw_thread_loop *loop) -+{ -+ if (!LoadPWLibrary()) { -+ return; -+ } -+ return pw_thread_loop_wait_fn(loop); -+} - - struct pw_properties * - pw_properties_new_string(const char *str) -@@ -366,3 +405,12 @@ pw_properties_new_string(const char *str - return pw_properties_new_string_fn(str); - } - -+const char* -+pw_get_library_version() -+{ -+ if (!LoadPWLibrary()) { -+ return nullptr; -+ } -+ return pw_get_library_version_fn(); -+} -+ diff --git a/libwebrtc-screen-cast-sync.patch b/libwebrtc-screen-cast-sync.patch index 4cf679f..ede3aec 100644 --- a/libwebrtc-screen-cast-sync.patch +++ b/libwebrtc-screen-cast-sync.patch @@ -1,25 +1,19 @@ -From 60b164944e5dd2151cf3fcf959899e430cb57c47 Mon Sep 17 00:00:00 2001 -From: Jan Grulich -Date: Wed, 22 Jun 2022 13:49:07 +0200 -Subject: WebRTC - screen cast sync +diff --git a/dom/media/webrtc/moz.build b/dom/media/webrtc/moz.build +index ddf9321b58ea..af0f7ab64cc3 100644 +--- a/dom/media/webrtc/moz.build ++++ b/dom/media/webrtc/moz.build +@@ -84,6 +84,8 @@ if CONFIG["MOZ_WEBRTC_SIGNALING"]: + ] + if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": ++ DIRS += ["/third_party/drm/libdrm"] ++ DIRS += ["/third_party/gbm/libgbm"] + DIRS += ["/third_party/pipewire/libpipewire"] -diff --git a/dom/media/webrtc/third_party_build/moz.build b/dom/media/webrtc/third_party_build/moz.build -index e4c7ba736e..a42f9138aa 100644 ---- a/dom/media/webrtc/third_party_build/moz.build -+++ b/dom/media/webrtc/third_party_build/moz.build -@@ -63,6 +63,8 @@ webrtc_non_unified_sources = [ - - if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": - DIRS += ["../../../../third_party/pipewire/libpipewire"] -+ DIRS += ["../../../../third_party/drm/libdrm"] -+ DIRS += ["../../../../third_party/gbm/libgbm"] - - GN_DIRS += ["../../../../third_party/libwebrtc"] - + # Avoid warnings from third-party code that we can not modify. diff --git a/third_party/drm/README b/third_party/drm/README new file mode 100644 -index 0000000000..f68ed100bb +index 000000000000..f68ed100bb77 --- /dev/null +++ b/third_party/drm/README @@ -0,0 +1,4 @@ @@ -29,7 +23,7 @@ index 0000000000..f68ed100bb +libdrm directory stores headers of libdrm needed for build only. diff --git a/third_party/drm/drm/drm.h b/third_party/drm/drm/drm.h new file mode 100644 -index 0000000000..5e54c3aa4c +index 000000000000..5e54c3aa4c3a --- /dev/null +++ b/third_party/drm/drm/drm.h @@ -0,0 +1,1193 @@ @@ -1228,7 +1222,7 @@ index 0000000000..5e54c3aa4c +#endif diff --git a/third_party/drm/drm/drm_fourcc.h b/third_party/drm/drm/drm_fourcc.h new file mode 100644 -index 0000000000..4ececa84ba +index 000000000000..4ececa84baa6 --- /dev/null +++ b/third_party/drm/drm/drm_fourcc.h @@ -0,0 +1,1377 @@ @@ -2611,7 +2605,7 @@ index 0000000000..4ececa84ba +#endif /* DRM_FOURCC_H */ diff --git a/third_party/drm/drm/drm_mode.h b/third_party/drm/drm/drm_mode.h new file mode 100644 -index 0000000000..e1e3516828 +index 000000000000..e1e351682872 --- /dev/null +++ b/third_party/drm/drm/drm_mode.h @@ -0,0 +1,1217 @@ @@ -3834,7 +3828,7 @@ index 0000000000..e1e3516828 +#endif diff --git a/third_party/drm/drm/xf86drm.h b/third_party/drm/drm/xf86drm.h new file mode 100644 -index 0000000000..58d66f1a6b +index 000000000000..a105b9e13108 --- /dev/null +++ b/third_party/drm/drm/xf86drm.h @@ -0,0 +1,966 @@ @@ -4806,7 +4800,7 @@ index 0000000000..58d66f1a6b +#endif diff --git a/third_party/drm/libdrm/moz.build b/third_party/drm/libdrm/moz.build new file mode 100644 -index 0000000000..3b37b913e8 +index 000000000000..3b37b913e8b2 --- /dev/null +++ b/third_party/drm/libdrm/moz.build @@ -0,0 +1,16 @@ @@ -4828,7 +4822,7 @@ index 0000000000..3b37b913e8 +FINAL_LIBRARY = 'xul' diff --git a/third_party/drm/libdrm/mozdrm.cpp b/third_party/drm/libdrm/mozdrm.cpp new file mode 100644 -index 0000000000..b2fb59be64 +index 000000000000..b2fb59be64a2 --- /dev/null +++ b/third_party/drm/libdrm/mozdrm.cpp @@ -0,0 +1,66 @@ @@ -4900,7 +4894,7 @@ index 0000000000..b2fb59be64 +} diff --git a/third_party/gbm/README b/third_party/gbm/README new file mode 100644 -index 0000000000..4b6e2e8e02 +index 000000000000..4b6e2e8e02b2 --- /dev/null +++ b/third_party/gbm/README @@ -0,0 +1,4 @@ @@ -4910,7 +4904,7 @@ index 0000000000..4b6e2e8e02 +libgbm directory stores headers of libgbm needed for build only. diff --git a/third_party/gbm/gbm/gbm.h b/third_party/gbm/gbm/gbm.h new file mode 100644 -index 0000000000..a963ed78e4 +index 000000000000..e28fa04aaed8 --- /dev/null +++ b/third_party/gbm/gbm/gbm.h @@ -0,0 +1,452 @@ @@ -5368,7 +5362,7 @@ index 0000000000..a963ed78e4 +#endif diff --git a/third_party/gbm/libgbm/moz.build b/third_party/gbm/libgbm/moz.build new file mode 100644 -index 0000000000..0953d2f17a +index 000000000000..0953d2f17a54 --- /dev/null +++ b/third_party/gbm/libgbm/moz.build @@ -0,0 +1,16 @@ @@ -5390,7 +5384,7 @@ index 0000000000..0953d2f17a +FINAL_LIBRARY = 'xul' diff --git a/third_party/gbm/libgbm/mozgbm.cpp b/third_party/gbm/libgbm/mozgbm.cpp new file mode 100644 -index 0000000000..bc024a11c0 +index 000000000000..bc024a11c0b7 --- /dev/null +++ b/third_party/gbm/libgbm/mozgbm.cpp @@ -0,0 +1,66 @@ @@ -5461,4347 +5455,229 @@ index 0000000000..bc024a11c0 + return gbm_device_destroy_fn(gbm); +} diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build -index d961d726d4..93c901364f 100644 +index 809899a92847..8869fae89703 100644 --- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build +++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build -@@ -76,6 +76,8 @@ if CONFIG["OS_TARGET"] == "Darwin": - LOCAL_INCLUDES += [ - "/media/libyuv/libyuv/include/", - "/media/libyuv/libyuv/include/", -+ "/third_party/drm/", -+ "/third_party/gbm/", - "/third_party/pipewire/" - ] +@@ -8,7 +8,8 @@ + if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": + CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"] -@@ -105,7 +107,8 @@ if CONFIG["OS_TARGET"] == "Linux": - LOCAL_INCLUDES += [ - "/media/libyuv/libyuv/include/", - "/media/libyuv/libyuv/include/", -- "/third_party/pipewire/", -+ "/third_party/drm/", -+ "/third_party/gbm/", - "/third_party/pipewire/" - ] +-COMPILE_FLAGS["OS_INCLUDES"] = [] ++# FIXME: No idea why it doesn't pick libdrm from /third_party/drm ++COMPILE_FLAGS["OS_INCLUDES"] = [ "-I/usr/include/libdrm" ] + AllowCompilerWarnings() -@@ -115,12 +118,16 @@ if CONFIG["OS_TARGET"] == "Linux": - ] - - SOURCES += [ -- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" -+ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" -+ - ] + DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1" +@@ -27,6 +28,8 @@ LOCAL_INCLUDES += [ + "/ipc/chromium/src", + "/media/libyuv/", + "/media/libyuv/libyuv/include/", ++ "/third_party/drm/", ++ "/third_party/gbm/", + "/third_party/libwebrtc/", + "/third_party/libwebrtc/third_party/abseil-cpp/", + "/third_party/pipewire/", +@@ -240,7 +243,15 @@ if CONFIG["CPU_ARCH"] == "arm": + DEFINES["_GNU_SOURCE"] = True UNIFIED_SOURCES += [ -- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", -- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc", - "/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc", - "/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc", - "/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc" -@@ -156,15 +163,18 @@ if CONFIG["OS_TARGET"] == "OpenBSD": +- "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/moz_base_capturer_pipewire.cc" ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/scoped_glib.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/xdg_desktop_portal_utils.cc" ] - SOURCES += [ -- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc" -+ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc" - ] + if CONFIG["CPU_ARCH"] == "ppc64": +@@ -295,7 +306,15 @@ if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": + DEFINES["_GNU_SOURCE"] = True UNIFIED_SOURCES += [ - "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc", -- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_x11.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/shared_x_display.cc", -- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_x11.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/window_finder_x11.cc", - "/third_party/libwebrtc/modules/desktop_capture/linux/window_list_utils.cc", -@@ -206,6 +216,7 @@ if CONFIG["OS_TARGET"] == "WINNT": - LOCAL_INCLUDES += [ - "/media/libyuv/libyuv/include/", - "/media/libyuv/libyuv/include/", -+ "/third_party/drm/" - "/third_party/pipewire/" +- "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/moz_base_capturer_pipewire.cc" ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/scoped_glib.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/xdg_desktop_portal_utils.cc" ] + if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux": +@@ -305,7 +324,15 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux": + DEFINES["_GNU_SOURCE"] = True + + UNIFIED_SOURCES += [ +- "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/moz_base_capturer_pipewire.cc" ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/scoped_glib.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/xdg_desktop_portal_utils.cc" + ] + + if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "Linux": +@@ -315,7 +342,15 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "Linux": + DEFINES["_GNU_SOURCE"] = True + + UNIFIED_SOURCES += [ +- "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/moz_base_capturer_pipewire.cc" ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/scoped_glib.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/xdg_desktop_portal_utils.cc" + ] + + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "Linux": diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc -index c89896d5fd..c8ef822938 100644 +index 8bdc83b76218..ab7932195c85 100644 --- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc +++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc -@@ -14,6 +14,9 @@ +@@ -14,7 +14,7 @@ #elif defined(WEBRTC_WIN) #include "modules/desktop_capture/win/full_screen_win_application_handler.h" #endif +-#if defined(WEBRTC_USE_PIPEWIRE) && !defined(WEBRTC_MOZILLA_BUILD) +#if defined(WEBRTC_USE_PIPEWIRE) -+#include "modules/desktop_capture/linux/shared_screencast_stream.h" -+#endif + #include "modules/desktop_capture/linux/wayland/shared_screencast_stream.h" + #endif - namespace webrtc { - -@@ -35,6 +38,9 @@ DesktopCaptureOptions DesktopCaptureOptions::CreateDefault() { +@@ -40,7 +40,7 @@ DesktopCaptureOptions DesktopCaptureOptions::CreateDefault() { #if defined(WEBRTC_USE_X11) result.set_x_display(SharedXDisplay::CreateDefault()); #endif +-#if defined(WEBRTC_USE_PIPEWIRE) && !defined(WEBRTC_MOZILLA_BUILD) +#if defined(WEBRTC_USE_PIPEWIRE) -+ result.set_screencast_stream(SharedScreenCastStream::CreateDefault()); -+#endif + result.set_screencast_stream(SharedScreenCastStream::CreateDefault()); + #endif #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) - result.set_configuration_monitor(new DesktopConfigurationMonitor()); - result.set_full_screen_window_detector( diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h -index ee0dd3ab40..ac56c8c1c1 100644 +index 1605d30f82d1..eb5b8a2a8777 100644 --- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h +++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h -@@ -17,6 +17,10 @@ - #include "modules/desktop_capture/linux/shared_x_display.h" +@@ -17,7 +17,7 @@ + #include "modules/desktop_capture/linux/x11/shared_x_display.h" #endif +-#if defined(WEBRTC_USE_PIPEWIRE) && !defined(WEBRTC_MOZILLA_BUILD) +#if defined(WEBRTC_USE_PIPEWIRE) -+#include "modules/desktop_capture/linux/shared_screencast_stream.h" -+#endif -+ - #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) - #include "modules/desktop_capture/mac/desktop_configuration_monitor.h" + #include "modules/desktop_capture/linux/wayland/shared_screencast_stream.h" #endif -@@ -149,13 +153,26 @@ class RTC_EXPORT DesktopCaptureOptions { - #if defined(WEBRTC_USE_PIPEWIRE) + +@@ -181,7 +181,6 @@ class RTC_EXPORT DesktopCaptureOptions { bool allow_pipewire() const { return allow_pipewire_; } void set_allow_pipewire(bool allow) { allow_pipewire_ = allow; } -+ -+ const rtc::scoped_refptr& screencast_stream() const { -+ return screencast_stream_; -+ } -+ void set_screencast_stream( -+ rtc::scoped_refptr stream) { -+ screencast_stream_ = stream; -+ } + +-#if !defined(WEBRTC_MOZILLA_BUILD) + const rtc::scoped_refptr& screencast_stream() const { + return screencast_stream_; + } +@@ -189,14 +188,13 @@ class RTC_EXPORT DesktopCaptureOptions { + rtc::scoped_refptr stream) { + screencast_stream_ = stream; + } +-#endif #endif private: #if defined(WEBRTC_USE_X11) rtc::scoped_refptr x_display_; #endif -- +-#if defined(WEBRTC_USE_PIPEWIRE) && !defined(WEBRTC_MOZILLA_BUILD) +#if defined(WEBRTC_USE_PIPEWIRE) -+ // An instance of shared PipeWire ScreenCast stream we share between -+ // BaseCapturerPipeWire and MouseCursorMonitorPipeWire as cursor information -+ // is sent together with screen content. -+ rtc::scoped_refptr screencast_stream_; -+#endif - #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) - rtc::scoped_refptr configuration_monitor_; - bool allow_iosurface_ = false; -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc -index 2fd3b1a575..e4685fc814 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc -@@ -10,937 +10,67 @@ - - #include "modules/desktop_capture/linux/base_capturer_pipewire.h" - --#include --#include --#include --#include -- --#include --#include --#include -- --#include --#include --#include -- --#include "absl/memory/memory.h" - #include "modules/desktop_capture/desktop_capture_options.h" - #include "modules/desktop_capture/desktop_capturer.h" - #include "rtc_base/checks.h" - #include "rtc_base/logging.h" - --#if defined(WEBRTC_DLOPEN_PIPEWIRE) --#include "modules/desktop_capture/linux/pipewire_stubs.h" -- --using modules_desktop_capture_linux::InitializeStubs; --using modules_desktop_capture_linux::kModulePipewire; --using modules_desktop_capture_linux::StubPathMap; --#endif // defined(WEBRTC_DLOPEN_PIPEWIRE) -- - namespace webrtc { - --const char kDesktopBusName[] = "org.freedesktop.portal.Desktop"; --const char kDesktopObjectPath[] = "/org/freedesktop/portal/desktop"; --const char kDesktopRequestObjectPath[] = -- "/org/freedesktop/portal/desktop/request"; --const char kSessionInterfaceName[] = "org.freedesktop.portal.Session"; --const char kRequestInterfaceName[] = "org.freedesktop.portal.Request"; --const char kScreenCastInterfaceName[] = "org.freedesktop.portal.ScreenCast"; -- --const int kBytesPerPixel = 4; -- --#if defined(WEBRTC_DLOPEN_PIPEWIRE) --const char kPipeWireLib[] = "libpipewire-0.2.so.1"; --#endif -- --// static --struct dma_buf_sync { -- uint64_t flags; --}; --#define DMA_BUF_SYNC_READ (1 << 0) --#define DMA_BUF_SYNC_START (0 << 2) --#define DMA_BUF_SYNC_END (1 << 2) --#define DMA_BUF_BASE 'b' --#define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync) -- --static void SyncDmaBuf(int fd, uint64_t start_or_end) { -- struct dma_buf_sync sync = { 0 }; -- -- sync.flags = start_or_end | DMA_BUF_SYNC_READ; -- -- while(true) { -- int ret; -- ret = ioctl (fd, DMA_BUF_IOCTL_SYNC, &sync); -- if (ret == -1 && errno == EINTR) { -- continue; -- } else if (ret == -1) { -- RTC_LOG(LS_ERROR) << "Failed to synchronize DMA buffer: " << g_strerror(errno); -- break; -- } else { -- break; -- } -- } --} -- --// static --void BaseCapturerPipeWire::OnCoreError(void *data, -- uint32_t id, -- int seq, -- int res, -- const char *message) { -- RTC_LOG(LS_ERROR) << "core error: " << message; --} -- --// static --void BaseCapturerPipeWire::OnStreamStateChanged(void* data, -- pw_stream_state old_state, -- pw_stream_state state, -- const char* error_message) { -- BaseCapturerPipeWire* that = static_cast(data); -- RTC_DCHECK(that); -- -- switch (state) { -- case PW_STREAM_STATE_ERROR: -- RTC_LOG(LS_ERROR) << "PipeWire stream state error: " << error_message; -- break; -- case PW_STREAM_STATE_PAUSED: -- case PW_STREAM_STATE_STREAMING: -- case PW_STREAM_STATE_UNCONNECTED: -- case PW_STREAM_STATE_CONNECTING: -- break; -- } -+BaseCapturerPipeWire::BaseCapturerPipeWire(const DesktopCaptureOptions& options) -+ : options_(options) { -+ screencast_portal_ = std::make_unique( -+ ScreenCastPortal::CaptureSourceType::kAnyScreenContent, this); - } - --// static --void BaseCapturerPipeWire::OnStreamParamChanged(void *data, uint32_t id, -- const struct spa_pod *format) { -- BaseCapturerPipeWire* that = static_cast(data); -- RTC_DCHECK(that); -- -- RTC_LOG(LS_INFO) << "PipeWire stream param changed."; -- -- if (!format || id != SPA_PARAM_Format) { -- return; -- } -- -- spa_format_video_raw_parse(format, &that->spa_video_format_); -- -- auto width = that->spa_video_format_.size.width; -- auto height = that->spa_video_format_.size.height; -- // In order to be able to build in the non unified environment kBytesPerPixel -- // must be fully qualified, see Bug 1725145 -- auto stride = SPA_ROUND_UP_N(width * BasicDesktopFrame::kBytesPerPixel, 4); -- auto size = height * stride; -- -- that->desktop_size_ = DesktopSize(width, height); -- -- uint8_t buffer[1024] = {}; -- auto builder = spa_pod_builder{buffer, sizeof(buffer)}; -- -- // Setup buffers and meta header for new format. -- const struct spa_pod* params[3]; -- params[0] = reinterpret_cast(spa_pod_builder_add_object(&builder, -- SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers, -- SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int((1<(spa_pod_builder_add_object(&builder, -- SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, -- SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header), -- SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_header)))); -- params[2] = reinterpret_cast(spa_pod_builder_add_object(&builder, -- SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, -- SPA_PARAM_META_type, SPA_POD_Id (SPA_META_VideoCrop), -- SPA_PARAM_META_size, SPA_POD_Int (sizeof(struct spa_meta_region)))); -- pw_stream_update_params(that->pw_stream_, params, 3); --} -- --// static --void BaseCapturerPipeWire::OnStreamProcess(void* data) { -- BaseCapturerPipeWire* that = static_cast(data); -- RTC_DCHECK(that); -- -- struct pw_buffer *next_buffer; -- struct pw_buffer *buffer = nullptr; -+BaseCapturerPipeWire::~BaseCapturerPipeWire() {} - -- next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); -- while (next_buffer) { -- buffer = next_buffer; -- next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); -- -- if (next_buffer) { -- pw_stream_queue_buffer (that->pw_stream_, buffer); -- } -- } -- -- if (!buffer) { -- return; -+void BaseCapturerPipeWire::OnScreenCastRequestResult( -+ ScreenCastPortal::RequestResponse result, -+ uint32_t stream_node_id, -+ int fd) { -+ if (result != ScreenCastPortal::RequestResponse::kSuccess || -+ !options_.screencast_stream()->StartScreenCastStream(stream_node_id, -+ fd)) { -+ capturer_failed_ = true; -+ RTC_LOG(LS_ERROR) << "ScreenCastPortal failed: " -+ << static_cast(result); - } -- -- that->HandleBuffer(buffer); -- -- pw_stream_queue_buffer(that->pw_stream_, buffer); - } - --BaseCapturerPipeWire::BaseCapturerPipeWire(CaptureSourceType source_type) -- : capture_source_type_(source_type) {} -- --BaseCapturerPipeWire::~BaseCapturerPipeWire() { -- if (pw_main_loop_) { -- pw_thread_loop_stop(pw_main_loop_); -- } -- -- if (pw_stream_) { -- pw_stream_destroy(pw_stream_); -- } -- -- if (pw_core_) { -- pw_core_disconnect(pw_core_); -- } -- -- if (pw_context_) { -- pw_context_destroy(pw_context_); -- } -- -- if (pw_main_loop_) { -- pw_thread_loop_destroy(pw_main_loop_); -+void BaseCapturerPipeWire::OnScreenCastSessionClosed() { -+ if (!capturer_failed_) { -+ options_.screencast_stream()->StopScreenCastStream(); - } -- -- if (start_request_signal_id_) { -- g_dbus_connection_signal_unsubscribe(connection_, start_request_signal_id_); -- } -- if (sources_request_signal_id_) { -- g_dbus_connection_signal_unsubscribe(connection_, -- sources_request_signal_id_); -- } -- if (session_request_signal_id_) { -- g_dbus_connection_signal_unsubscribe(connection_, -- session_request_signal_id_); -- } -- -- if (session_handle_) { -- GDBusMessage* message = g_dbus_message_new_method_call( -- kDesktopBusName, session_handle_, kSessionInterfaceName, "Close"); -- if (message) { -- GError* error = nullptr; -- g_dbus_connection_send_message(connection_, message, -- G_DBUS_SEND_MESSAGE_FLAGS_NONE, -- /*out_serial=*/nullptr, &error); -- if (error) { -- RTC_LOG(LS_ERROR) << "Failed to close the session: " << error->message; -- g_error_free(error); -- } -- g_object_unref(message); -- } -- } -- -- g_free(start_handle_); -- g_free(sources_handle_); -- g_free(session_handle_); -- g_free(portal_handle_); -- -- if (cancellable_) { -- g_cancellable_cancel(cancellable_); -- g_object_unref(cancellable_); -- cancellable_ = nullptr; -- } -- -- if (proxy_) { -- g_object_unref(proxy_); -- proxy_ = nullptr; -- } -- -- if (pw_fd_ != -1) { -- close(pw_fd_); -- } --} -- --void BaseCapturerPipeWire::InitPortal() { -- cancellable_ = g_cancellable_new(); -- g_dbus_proxy_new_for_bus( -- G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, /*info=*/nullptr, -- kDesktopBusName, kDesktopObjectPath, kScreenCastInterfaceName, -- cancellable_, -- reinterpret_cast(OnProxyRequested), this); --} -- --void BaseCapturerPipeWire::InitPipeWire() { --#if defined(WEBRTC_DLOPEN_PIPEWIRE) -- StubPathMap paths; -- -- // Check if the PipeWire library is available. -- paths[kModulePipewire].push_back(kPipeWireLib); -- if (!InitializeStubs(paths)) { -- RTC_LOG(LS_ERROR) << "Failed to load the PipeWire library and symbols."; -- portal_init_failed_ = true; -- return; -- } --#endif // defined(WEBRTC_DLOPEN_PIPEWIRE) -- -- pw_init(/*argc=*/nullptr, /*argc=*/nullptr); -- -- pw_main_loop_ = pw_thread_loop_new("pipewire-main-loop", nullptr); -- pw_context_ = pw_context_new(pw_thread_loop_get_loop(pw_main_loop_), nullptr, 0); -- if (!pw_context_) { -- RTC_LOG(LS_ERROR) << "Failed to create PipeWire context"; -- return; -- } -- -- pw_core_ = pw_context_connect_fd(pw_context_, pw_fd_, nullptr, 0); -- if (!pw_core_) { -- RTC_LOG(LS_ERROR) << "Failed to connect PipeWire context"; -- return; -- } -- -- // Initialize event handlers, remote end and stream-related. -- pw_core_events_.version = PW_VERSION_CORE_EVENTS; -- pw_core_events_.error = &OnCoreError; -- -- pw_stream_events_.version = PW_VERSION_STREAM_EVENTS; -- pw_stream_events_.state_changed = &OnStreamStateChanged; -- pw_stream_events_.param_changed = &OnStreamParamChanged; -- pw_stream_events_.process = &OnStreamProcess; -- -- pw_core_add_listener(pw_core_, &spa_core_listener_, &pw_core_events_, this); -- -- pw_stream_ = CreateReceivingStream(); -- if (!pw_stream_) { -- RTC_LOG(LS_ERROR) << "Failed to create PipeWire stream"; -- return; -- } -- -- if (pw_thread_loop_start(pw_main_loop_) < 0) { -- RTC_LOG(LS_ERROR) << "Failed to start main PipeWire loop"; -- portal_init_failed_ = true; -- } -- -- RTC_LOG(LS_INFO) << "PipeWire remote opened."; --} -- --pw_stream* BaseCapturerPipeWire::CreateReceivingStream() { -- spa_rectangle pwMinScreenBounds = spa_rectangle{1, 1}; -- spa_rectangle pwMaxScreenBounds = spa_rectangle{UINT32_MAX, UINT32_MAX}; -- -- auto stream = pw_stream_new(pw_core_, "webrtc-pipewire-stream", nullptr); -- -- if (!stream) { -- RTC_LOG(LS_ERROR) << "Could not create receiving stream."; -- return nullptr; -- } -- -- uint8_t buffer[1024] = {}; -- const spa_pod* params[2]; -- spa_pod_builder builder = SPA_POD_BUILDER_INIT(buffer, sizeof (buffer)); -- -- params[0] = reinterpret_cast(spa_pod_builder_add_object(&builder, -- SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat, -- SPA_FORMAT_mediaType, SPA_POD_Id(SPA_MEDIA_TYPE_video), -- SPA_FORMAT_mediaSubtype, SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw), -- SPA_FORMAT_VIDEO_format, SPA_POD_CHOICE_ENUM_Id(5, SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_RGBx, SPA_VIDEO_FORMAT_RGBA, -- SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_BGRA), -- SPA_FORMAT_VIDEO_size, SPA_POD_CHOICE_RANGE_Rectangle(&pwMinScreenBounds, -- &pwMinScreenBounds, -- &pwMaxScreenBounds), -- 0)); -- pw_stream_add_listener(stream, &spa_stream_listener_, &pw_stream_events_, this); -- -- if (pw_stream_connect(stream, PW_DIRECTION_INPUT, pw_stream_node_id_, -- PW_STREAM_FLAG_AUTOCONNECT, params, 1) != 0) { -- RTC_LOG(LS_ERROR) << "Could not connect receiving stream."; -- portal_init_failed_ = true; -- } -- -- return stream; --} -- --static void SpaBufferUnmap(unsigned char *map, int map_size, bool IsDMABuf, int fd) { -- if (map) { -- if (IsDMABuf) { -- SyncDmaBuf(fd, DMA_BUF_SYNC_END); -- } -- munmap(map, map_size); -- } --} -- --void BaseCapturerPipeWire::HandleBuffer(pw_buffer* buffer) { -- spa_buffer* spaBuffer = buffer->buffer; -- uint8_t *map = nullptr; -- uint8_t* src = nullptr; -- -- if (spaBuffer->datas[0].chunk->size == 0) { -- RTC_LOG(LS_ERROR) << "Failed to get video stream: Zero size."; -- return; -- } -- -- switch (spaBuffer->datas[0].type) { -- case SPA_DATA_MemFd: -- case SPA_DATA_DmaBuf: -- map = static_cast(mmap( -- nullptr, spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, -- PROT_READ, MAP_PRIVATE, spaBuffer->datas[0].fd, 0)); -- if (map == MAP_FAILED) { -- RTC_LOG(LS_ERROR) << "Failed to mmap memory: " << std::strerror(errno); -- return; -- } -- if (spaBuffer->datas[0].type == SPA_DATA_DmaBuf) { -- SyncDmaBuf(spaBuffer->datas[0].fd, DMA_BUF_SYNC_START); -- } -- src = SPA_MEMBER(map, spaBuffer->datas[0].mapoffset, uint8_t); -- break; -- case SPA_DATA_MemPtr: -- map = nullptr; -- src = static_cast(spaBuffer->datas[0].data); -- break; -- default: -- return; -- } -- -- if (!src) { -- RTC_LOG(LS_ERROR) << "Failed to get video stream: Wrong data after mmap()"; -- SpaBufferUnmap(map, -- spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, -- spaBuffer->datas[0].type == SPA_DATA_DmaBuf, spaBuffer->datas[0].fd); -- return; -- } -- -- struct spa_meta_region* video_metadata = -- static_cast( -- spa_buffer_find_meta_data(spaBuffer, SPA_META_VideoCrop, sizeof(*video_metadata))); -- -- // Video size from metada is bigger than an actual video stream size. -- // The metadata are wrong or we should up-scale te video...in both cases -- // just quit now. -- if (video_metadata && -- (video_metadata->region.size.width > (uint32_t)desktop_size_.width() || -- video_metadata->region.size.height > (uint32_t)desktop_size_.height())) { -- RTC_LOG(LS_ERROR) << "Stream metadata sizes are wrong!"; -- SpaBufferUnmap(map, -- spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, -- spaBuffer->datas[0].type == SPA_DATA_DmaBuf, spaBuffer->datas[0].fd); -- return; -- } -- -- // Use video metada when video size from metadata is set and smaller than -- // video stream size, so we need to adjust it. -- video_metadata_use_ = (video_metadata && -- video_metadata->region.size.width != 0 && -- video_metadata->region.size.height != 0 && -- (video_metadata->region.size.width < (uint32_t)desktop_size_.width() || -- video_metadata->region.size.height < (uint32_t)desktop_size_.height())); -- -- DesktopSize video_size_prev = video_size_; -- if (video_metadata_use_) { -- video_size_ = DesktopSize(video_metadata->region.size.width, -- video_metadata->region.size.height); -- } else { -- video_size_ = desktop_size_; -- } -- -- webrtc::MutexLock lock(¤t_frame_lock_); -- if (!current_frame_ || !video_size_.equals(video_size_prev)) { -- current_frame_ = -- std::make_unique -- (video_size_.width() * video_size_.height() * BasicDesktopFrame::kBytesPerPixel); -- } -- -- const int32_t dstStride = video_size_.width() * BasicDesktopFrame::kBytesPerPixel; -- const int32_t srcStride = spaBuffer->datas[0].chunk->stride; -- -- // Adjust source content based on metadata video position -- if (video_metadata_use_ && -- (video_metadata->region.position.y + video_size_.height() <= desktop_size_.height())) { -- src += srcStride * video_metadata->region.position.y; -- } -- const int xOffset = -- video_metadata_use_ && -- (video_metadata->region.position.x + video_size_.width() <= desktop_size_.width()) -- ? video_metadata->region.position.x * BasicDesktopFrame::kBytesPerPixel -- : 0; -- -- uint8_t* dst = current_frame_.get(); -- for (int i = 0; i < video_size_.height(); ++i) { -- // Adjust source content based on crop video position if needed -- src += xOffset; -- std::memcpy(dst, src, dstStride); -- // If both sides decided to go with the RGBx format we need to convert it to -- // BGRx to match color format expected by WebRTC. -- if (spa_video_format_.format == SPA_VIDEO_FORMAT_RGBx || -- spa_video_format_.format == SPA_VIDEO_FORMAT_RGBA) { -- ConvertRGBxToBGRx(dst, dstStride); -- } -- src += srcStride - xOffset; -- dst += dstStride; -- } -- -- SpaBufferUnmap(map, -- spaBuffer->datas[0].maxsize + spaBuffer->datas[0].mapoffset, -- spaBuffer->datas[0].type == SPA_DATA_DmaBuf, spaBuffer->datas[0].fd); --} -- --void BaseCapturerPipeWire::ConvertRGBxToBGRx(uint8_t* frame, uint32_t size) { -- // Change color format for KDE KWin which uses RGBx and not BGRx -- for (uint32_t i = 0; i < size; i += 4) { -- uint8_t tempR = frame[i]; -- uint8_t tempB = frame[i + 2]; -- frame[i] = tempB; -- frame[i + 2] = tempR; -- } --} -- --guint BaseCapturerPipeWire::SetupRequestResponseSignal( -- const gchar* object_path, -- GDBusSignalCallback callback) { -- return g_dbus_connection_signal_subscribe( -- connection_, kDesktopBusName, kRequestInterfaceName, "Response", -- object_path, /*arg0=*/nullptr, G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE, -- callback, this, /*user_data_free_func=*/nullptr); --} -- --// static --void BaseCapturerPipeWire::OnProxyRequested(GObject* /*object*/, -- GAsyncResult* result, -- gpointer user_data) { -- BaseCapturerPipeWire* that = static_cast(user_data); -- RTC_DCHECK(that); -- -- GError* error = nullptr; -- GDBusProxy *proxy = g_dbus_proxy_new_finish(result, &error); -- if (!proxy) { -- if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) -- return; -- RTC_LOG(LS_ERROR) << "Failed to create a proxy for the screen cast portal: " -- << error->message; -- g_error_free(error); -- that->portal_init_failed_ = true; -- return; -- } -- that->proxy_ = proxy; -- that->connection_ = g_dbus_proxy_get_connection(that->proxy_); -- -- RTC_LOG(LS_INFO) << "Created proxy for the screen cast portal."; -- that->SessionRequest(); --} -- --// static --gchar* BaseCapturerPipeWire::PrepareSignalHandle(GDBusConnection* connection, -- const gchar* token) { -- gchar* sender = g_strdup(g_dbus_connection_get_unique_name(connection) + 1); -- for (int i = 0; sender[i]; i++) { -- if (sender[i] == '.') { -- sender[i] = '_'; -- } -- } -- -- gchar* handle = g_strconcat(kDesktopRequestObjectPath, "/", sender, "/", -- token, /*end of varargs*/ nullptr); -- g_free(sender); -- -- return handle; --} -- --void BaseCapturerPipeWire::SessionRequest() { -- GVariantBuilder builder; -- gchar* variant_string; -- -- g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); -- variant_string = -- g_strdup_printf("webrtc_session%d", g_random_int_range(0, G_MAXINT)); -- g_variant_builder_add(&builder, "{sv}", "session_handle_token", -- g_variant_new_string(variant_string)); -- g_free(variant_string); -- variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); -- g_variant_builder_add(&builder, "{sv}", "handle_token", -- g_variant_new_string(variant_string)); -- -- portal_handle_ = PrepareSignalHandle(connection_, variant_string); -- session_request_signal_id_ = SetupRequestResponseSignal( -- portal_handle_, OnSessionRequestResponseSignal); -- g_free(variant_string); -- -- RTC_LOG(LS_INFO) << "Screen cast session requested."; -- g_dbus_proxy_call( -- proxy_, "CreateSession", g_variant_new("(a{sv})", &builder), -- G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, -- reinterpret_cast(OnSessionRequested), this); --} -- --// static --void BaseCapturerPipeWire::OnSessionRequested(GDBusProxy *proxy, -- GAsyncResult* result, -- gpointer user_data) { -- BaseCapturerPipeWire* that = static_cast(user_data); -- RTC_DCHECK(that); -- -- GError* error = nullptr; -- GVariant* variant = g_dbus_proxy_call_finish(proxy, result, &error); -- if (!variant) { -- if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) -- return; -- RTC_LOG(LS_ERROR) << "Failed to create a screen cast session: " -- << error->message; -- g_error_free(error); -- that->portal_init_failed_ = true; -- return; -- } -- RTC_LOG(LS_INFO) << "Initializing the screen cast session."; -- -- gchar* handle = nullptr; -- g_variant_get_child(variant, 0, "o", &handle); -- g_variant_unref(variant); -- if (!handle) { -- RTC_LOG(LS_ERROR) << "Failed to initialize the screen cast session."; -- if (that->session_request_signal_id_) { -- g_dbus_connection_signal_unsubscribe(that->connection_, -- that->session_request_signal_id_); -- that->session_request_signal_id_ = 0; -- } -- that->portal_init_failed_ = true; -- return; -- } -- -- g_free(handle); -- -- RTC_LOG(LS_INFO) << "Subscribing to the screen cast session."; --} -- --// static --void BaseCapturerPipeWire::OnSessionRequestResponseSignal( -- GDBusConnection* connection, -- const gchar* sender_name, -- const gchar* object_path, -- const gchar* interface_name, -- const gchar* signal_name, -- GVariant* parameters, -- gpointer user_data) { -- BaseCapturerPipeWire* that = static_cast(user_data); -- RTC_DCHECK(that); -- -- RTC_LOG(LS_INFO) -- << "Received response for the screen cast session subscription."; -- -- guint32 portal_response; -- GVariant* response_data; -- g_variant_get(parameters, "(u@a{sv})", &portal_response, &response_data); -- -- GVariant* session_handle = -- g_variant_lookup_value(response_data, "session_handle", NULL); -- that->session_handle_ = g_variant_dup_string(session_handle, NULL); -- -- g_variant_unref(session_handle); -- g_variant_unref(response_data); -- -- if (!that->session_handle_ || portal_response) { -- RTC_LOG(LS_ERROR) -- << "Failed to request the screen cast session subscription."; -- that->portal_init_failed_ = true; -- return; -- } -- -- that->SourcesRequest(); --} -- --void BaseCapturerPipeWire::SourcesRequest() { -- GVariantBuilder builder; -- gchar* variant_string; -- -- g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); -- // We want to record monitor content. -- g_variant_builder_add(&builder, "{sv}", "types", -- g_variant_new_uint32(capture_source_type_)); -- // We don't want to allow selection of multiple sources. -- g_variant_builder_add(&builder, "{sv}", "multiple", -- g_variant_new_boolean(false)); -- variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); -- g_variant_builder_add(&builder, "{sv}", "handle_token", -- g_variant_new_string(variant_string)); -- -- sources_handle_ = PrepareSignalHandle(connection_, variant_string); -- sources_request_signal_id_ = SetupRequestResponseSignal( -- sources_handle_, OnSourcesRequestResponseSignal); -- g_free(variant_string); -- -- RTC_LOG(LS_INFO) << "Requesting sources from the screen cast session."; -- g_dbus_proxy_call( -- proxy_, "SelectSources", -- g_variant_new("(oa{sv})", session_handle_, &builder), -- G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, -- reinterpret_cast(OnSourcesRequested), this); --} -- --// static --void BaseCapturerPipeWire::OnSourcesRequested(GDBusProxy *proxy, -- GAsyncResult* result, -- gpointer user_data) { -- BaseCapturerPipeWire* that = static_cast(user_data); -- RTC_DCHECK(that); -- -- GError* error = nullptr; -- GVariant* variant = g_dbus_proxy_call_finish(proxy, result, &error); -- if (!variant) { -- if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) -- return; -- RTC_LOG(LS_ERROR) << "Failed to request the sources: " << error->message; -- g_error_free(error); -- that->portal_init_failed_ = true; -- return; -- } -- -- RTC_LOG(LS_INFO) << "Sources requested from the screen cast session."; -- -- gchar* handle = nullptr; -- g_variant_get_child(variant, 0, "o", &handle); -- g_variant_unref(variant); -- if (!handle) { -- RTC_LOG(LS_ERROR) << "Failed to initialize the screen cast session."; -- if (that->sources_request_signal_id_) { -- g_dbus_connection_signal_unsubscribe(that->connection_, -- that->sources_request_signal_id_); -- that->sources_request_signal_id_ = 0; -- } -- that->portal_init_failed_ = true; -- return; -- } -- -- g_free(handle); -- -- RTC_LOG(LS_INFO) << "Subscribed to sources signal."; --} -- --// static --void BaseCapturerPipeWire::OnSourcesRequestResponseSignal( -- GDBusConnection* connection, -- const gchar* sender_name, -- const gchar* object_path, -- const gchar* interface_name, -- const gchar* signal_name, -- GVariant* parameters, -- gpointer user_data) { -- BaseCapturerPipeWire* that = static_cast(user_data); -- RTC_DCHECK(that); -- -- RTC_LOG(LS_INFO) << "Received sources signal from session."; -- -- guint32 portal_response; -- g_variant_get(parameters, "(u@a{sv})", &portal_response, nullptr); -- if (portal_response) { -- RTC_LOG(LS_ERROR) -- << "Failed to select sources for the screen cast session."; -- that->portal_init_failed_ = true; -- return; -- } -- -- that->StartRequest(); --} -- --void BaseCapturerPipeWire::StartRequest() { -- GVariantBuilder builder; -- gchar* variant_string; -- -- g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); -- variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); -- g_variant_builder_add(&builder, "{sv}", "handle_token", -- g_variant_new_string(variant_string)); -- -- start_handle_ = PrepareSignalHandle(connection_, variant_string); -- start_request_signal_id_ = -- SetupRequestResponseSignal(start_handle_, OnStartRequestResponseSignal); -- g_free(variant_string); -- -- // "Identifier for the application window", this is Wayland, so not "x11:...". -- const gchar parent_window[] = ""; -- -- RTC_LOG(LS_INFO) << "Starting the screen cast session."; -- g_dbus_proxy_call( -- proxy_, "Start", -- g_variant_new("(osa{sv})", session_handle_, parent_window, &builder), -- G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, -- reinterpret_cast(OnStartRequested), this); --} -- --// static --void BaseCapturerPipeWire::OnStartRequested(GDBusProxy *proxy, -- GAsyncResult* result, -- gpointer user_data) { -- BaseCapturerPipeWire* that = static_cast(user_data); -- RTC_DCHECK(that); -- -- GError* error = nullptr; -- GVariant* variant = g_dbus_proxy_call_finish(proxy, result, &error); -- if (!variant) { -- if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) -- return; -- RTC_LOG(LS_ERROR) << "Failed to start the screen cast session: " -- << error->message; -- g_error_free(error); -- that->portal_init_failed_ = true; -- return; -- } -- -- RTC_LOG(LS_INFO) << "Initializing the start of the screen cast session."; -- -- gchar* handle = nullptr; -- g_variant_get_child(variant, 0, "o", &handle); -- g_variant_unref(variant); -- if (!handle) { -- RTC_LOG(LS_ERROR) -- << "Failed to initialize the start of the screen cast session."; -- if (that->start_request_signal_id_) { -- g_dbus_connection_signal_unsubscribe(that->connection_, -- that->start_request_signal_id_); -- that->start_request_signal_id_ = 0; -- } -- that->portal_init_failed_ = true; -- return; -- } -- -- g_free(handle); -- -- RTC_LOG(LS_INFO) << "Subscribed to the start signal."; --} -- --// static --void BaseCapturerPipeWire::OnStartRequestResponseSignal( -- GDBusConnection* connection, -- const gchar* sender_name, -- const gchar* object_path, -- const gchar* interface_name, -- const gchar* signal_name, -- GVariant* parameters, -- gpointer user_data) { -- BaseCapturerPipeWire* that = static_cast(user_data); -- RTC_DCHECK(that); -- -- RTC_LOG(LS_INFO) << "Start signal received."; -- guint32 portal_response; -- GVariant* response_data; -- GVariantIter* iter = nullptr; -- g_variant_get(parameters, "(u@a{sv})", &portal_response, &response_data); -- if (portal_response || !response_data) { -- RTC_LOG(LS_ERROR) << "Failed to start the screen cast session."; -- that->portal_init_failed_ = true; -- return; -- } -- -- // Array of PipeWire streams. See -- // https://github.com/flatpak/xdg-desktop-portal/blob/master/data/org.freedesktop.portal.ScreenCast.xml -- // documentation for . -- if (g_variant_lookup(response_data, "streams", "a(ua{sv})", &iter)) { -- GVariant* variant; -- -- while (g_variant_iter_next(iter, "@(ua{sv})", &variant)) { -- guint32 stream_id; -- GVariant* options; -- -- g_variant_get(variant, "(u@a{sv})", &stream_id, &options); -- RTC_DCHECK(options != nullptr); -- -- that->pw_stream_node_id_ = stream_id; -- g_variant_unref(options); -- g_variant_unref(variant); -- } -- } -- g_variant_iter_free(iter); -- g_variant_unref(response_data); -- -- that->OpenPipeWireRemote(); --} -- --void BaseCapturerPipeWire::OpenPipeWireRemote() { -- GVariantBuilder builder; -- g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); -- -- RTC_LOG(LS_INFO) << "Opening the PipeWire remote."; -- -- g_dbus_proxy_call_with_unix_fd_list( -- proxy_, "OpenPipeWireRemote", -- g_variant_new("(oa{sv})", session_handle_, &builder), -- G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, /*fd_list=*/nullptr, -- cancellable_, -- reinterpret_cast(OnOpenPipeWireRemoteRequested), -- this); --} -- --// static --void BaseCapturerPipeWire::OnOpenPipeWireRemoteRequested( -- GDBusProxy *proxy, -- GAsyncResult* result, -- gpointer user_data) { -- BaseCapturerPipeWire* that = static_cast(user_data); -- RTC_DCHECK(that); -- -- GError* error = nullptr; -- GUnixFDList* outlist = nullptr; -- GVariant* variant = g_dbus_proxy_call_with_unix_fd_list_finish( -- proxy, &outlist, result, &error); -- if (!variant) { -- if (g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) -- return; -- RTC_LOG(LS_ERROR) << "Failed to open the PipeWire remote: " -- << error->message; -- g_error_free(error); -- that->portal_init_failed_ = true; -- return; -- } -- -- gint32 index; -- g_variant_get(variant, "(h)", &index); -- -- if ((that->pw_fd_ = g_unix_fd_list_get(outlist, index, &error)) == -1) { -- RTC_LOG(LS_ERROR) << "Failed to get file descriptor from the list: " -- << error->message; -- g_error_free(error); -- g_variant_unref(variant); -- that->portal_init_failed_ = true; -- return; -- } -- -- g_variant_unref(variant); -- g_object_unref(outlist); -- -- that->InitPipeWire(); - } - - void BaseCapturerPipeWire::Start(Callback* callback) { - RTC_DCHECK(!callback_); - RTC_DCHECK(callback); - -- InitPortal(); -- - callback_ = callback; -+ -+ screencast_portal_->Start(); - } - - void BaseCapturerPipeWire::CaptureFrame() { -- if (portal_init_failed_) { -+ if (capturer_failed_) { - callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); - return; - } - -- webrtc::MutexLock lock(¤t_frame_lock_); -- if (!current_frame_) { -- callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); -- return; -- } -- -- DesktopSize frame_size = desktop_size_; -- if (video_metadata_use_) { -- frame_size = video_size_; -- } -+ std::unique_ptr frame = -+ options_.screencast_stream()->CaptureFrame(); - -- std::unique_ptr result(new BasicDesktopFrame(frame_size)); -- result->CopyPixelsFrom( -- current_frame_.get(), (frame_size.width() * BasicDesktopFrame::kBytesPerPixel), -- DesktopRect::MakeWH(frame_size.width(), frame_size.height())); -- if (!result) { -+ if (!frame || !frame->data()) { - callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); - return; - } - -- // TODO(julien.isorce): http://crbug.com/945468. Set the icc profile on the -- // frame, see ScreenCapturerX11::CaptureFrame. -+ // TODO(julien.isorce): http://crbug.com/945468. Set the icc profile on -+ // the frame, see ScreenCapturerX11::CaptureFrame. - -- callback_->OnCaptureResult(Result::SUCCESS, std::move(result)); -+ callback_->OnCaptureResult(Result::SUCCESS, std::move(frame)); - } - - // Keep in sync with defines at browser/actors/WebRTCParent.jsm -@@ -953,31 +83,13 @@ void BaseCapturerPipeWire::CaptureFrame() { - #define PIPEWIRE_NAME "####_PIPEWIRE_PORTAL_####" - - bool BaseCapturerPipeWire::GetSourceList(SourceList* sources) { -+ RTC_DCHECK(sources->size() == 0); - sources->push_back({PIPEWIRE_ID, 0, PIPEWIRE_NAME}); + // An instance of shared PipeWire ScreenCast stream we share between + // BaseCapturerPipeWire and MouseCursorMonitorPipeWire as cursor information + // is sent together with screen content. +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc +index 75659a9eb9e2..32578411059b 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc +@@ -105,7 +105,7 @@ bool BaseCapturerPipeWire::GetSourceList(SourceList* sources) { + // is often treated as a null/placeholder id, so we shouldn't use that. + // TODO(https://crbug.com/1297671): Reconsider type of ID when plumbing + // token that will enable stream re-use. +- sources->push_back({1}); ++ sources->push_back({PIPEWIRE_ID, 0, PIPEWIRE_NAME}); return true; } - bool BaseCapturerPipeWire::SelectSource(SourceId id) { -- // Screen selection is handled by the xdg-desktop-portal. - return id == PIPEWIRE_ID; - } - --// static --std::unique_ptr --BaseCapturerPipeWire::CreateRawScreenCapturer( -- const DesktopCaptureOptions& options) { -- std::unique_ptr capturer = -- std::make_unique(BaseCapturerPipeWire::CaptureSourceType::kAny); -- return std::move(capturer);} -- --// static --std::unique_ptr --BaseCapturerPipeWire::CreateRawWindowCapturer( -- const DesktopCaptureOptions& options) { -- -- std::unique_ptr capturer = -- std::make_unique(BaseCapturerPipeWire::CaptureSourceType::kAny); -- return std::move(capturer); --} -- - } // namespace webrtc -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h -index af8e20c84c..5db09e0244 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h -@@ -11,160 +11,39 @@ - #ifndef MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ - #define MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ - --#include --#define typeof __typeof__ --#include --#include -- - #include "modules/desktop_capture/desktop_capture_options.h" - #include "modules/desktop_capture/desktop_capturer.h" --#include "rtc_base/synchronization/mutex.h" -+#include "modules/desktop_capture/linux/screencast_portal.h" -+#include "modules/desktop_capture/linux/shared_screencast_stream.h" - - namespace webrtc { - --class BaseCapturerPipeWire : public DesktopCapturer { -+class BaseCapturerPipeWire : public DesktopCapturer, -+ public ScreenCastPortal::PortalNotifier { - public: -- enum CaptureSourceType : uint32_t { -- kScreen = 0b01, -- kWindow = 0b10, -- kAny = 0b11 -- }; -- -- explicit BaseCapturerPipeWire(CaptureSourceType source_type); -+ BaseCapturerPipeWire(const DesktopCaptureOptions& options); - ~BaseCapturerPipeWire() override; - -+ BaseCapturerPipeWire(const BaseCapturerPipeWire&) = delete; -+ BaseCapturerPipeWire& operator=(const BaseCapturerPipeWire&) = delete; -+ - // DesktopCapturer interface. - void Start(Callback* delegate) override; - void CaptureFrame() override; - bool GetSourceList(SourceList* sources) override; - bool SelectSource(SourceId id) override; - -- static std::unique_ptr CreateRawScreenCapturer( -- const DesktopCaptureOptions& options); -- -- static std::unique_ptr CreateRawWindowCapturer( -- const DesktopCaptureOptions& options); -+ // ScreenCastPortal::PortalNotifier interface. -+ void OnScreenCastRequestResult(ScreenCastPortal::RequestResponse result, -+ uint32_t stream_node_id, -+ int fd) override; -+ void OnScreenCastSessionClosed() override; - - private: -- // PipeWire types --> -- pw_context* pw_context_ = nullptr; -- pw_core* pw_core_ = nullptr; -- pw_stream* pw_stream_ = nullptr; -- pw_thread_loop* pw_main_loop_ = nullptr; -- -- spa_hook spa_core_listener_ = {}; -- spa_hook spa_stream_listener_ = {}; -- -- pw_core_events pw_core_events_ = {}; -- pw_stream_events pw_stream_events_ = {}; -- -- struct spa_video_info_raw spa_video_format_; -- -- guint32 pw_stream_node_id_ = 0; -- gint32 pw_fd_ = -1; -- -- CaptureSourceType capture_source_type_ = -- BaseCapturerPipeWire::CaptureSourceType::kAny; -- -- // <-- end of PipeWire types -- -- GDBusConnection* connection_ = nullptr; -- GDBusProxy* proxy_ = nullptr; -- GCancellable *cancellable_ = nullptr; -- gchar* portal_handle_ = nullptr; -- gchar* session_handle_ = nullptr; -- gchar* sources_handle_ = nullptr; -- gchar* start_handle_ = nullptr; -- guint session_request_signal_id_ = 0; -- guint sources_request_signal_id_ = 0; -- guint start_request_signal_id_ = 0; -- -- bool video_metadata_use_ = false; -- DesktopSize video_size_; -- DesktopSize desktop_size_ = {}; - DesktopCaptureOptions options_ = {}; -- -- webrtc::Mutex current_frame_lock_; -- std::unique_ptr current_frame_; - Callback* callback_ = nullptr; -- -- bool portal_init_failed_ = false; -- -- void InitPortal(); -- void InitPipeWire(); -- -- pw_stream* CreateReceivingStream(); -- void HandleBuffer(pw_buffer* buffer); -- -- void ConvertRGBxToBGRx(uint8_t* frame, uint32_t size); -- -- static void OnCoreError(void *data, -- uint32_t id, -- int seq, -- int res, -- const char *message); -- static void OnStreamParamChanged(void *data, -- uint32_t id, -- const struct spa_pod *format); -- static void OnStreamStateChanged(void* data, -- pw_stream_state old_state, -- pw_stream_state state, -- const char* error_message); -- static void OnStreamProcess(void* data); -- static void OnNewBuffer(void* data, uint32_t id); -- -- guint SetupRequestResponseSignal(const gchar* object_path, -- GDBusSignalCallback callback); -- -- static void OnProxyRequested(GObject* object, -- GAsyncResult* result, -- gpointer user_data); -- -- static gchar* PrepareSignalHandle(GDBusConnection* connection, -- const gchar* token); -- -- void SessionRequest(); -- static void OnSessionRequested(GDBusProxy *proxy, -- GAsyncResult* result, -- gpointer user_data); -- static void OnSessionRequestResponseSignal(GDBusConnection* connection, -- const gchar* sender_name, -- const gchar* object_path, -- const gchar* interface_name, -- const gchar* signal_name, -- GVariant* parameters, -- gpointer user_data); -- -- void SourcesRequest(); -- static void OnSourcesRequested(GDBusProxy *proxy, -- GAsyncResult* result, -- gpointer user_data); -- static void OnSourcesRequestResponseSignal(GDBusConnection* connection, -- const gchar* sender_name, -- const gchar* object_path, -- const gchar* interface_name, -- const gchar* signal_name, -- GVariant* parameters, -- gpointer user_data); -- -- void StartRequest(); -- static void OnStartRequested(GDBusProxy *proxy, -- GAsyncResult* result, -- gpointer user_data); -- static void OnStartRequestResponseSignal(GDBusConnection* connection, -- const gchar* sender_name, -- const gchar* object_path, -- const gchar* interface_name, -- const gchar* signal_name, -- GVariant* parameters, -- gpointer user_data); -- -- void OpenPipeWireRemote(); -- static void OnOpenPipeWireRemoteRequested(GDBusProxy *proxy, -- GAsyncResult* result, -- gpointer user_data); -- -- RTC_DISALLOW_COPY_AND_ASSIGN(BaseCapturerPipeWire); -+ bool capturer_failed_ = false; -+ std::unique_ptr screencast_portal_; - }; - - } // namespace webrtc -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs b/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs -new file mode 100644 -index 0000000000..226979fe16 ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs -@@ -0,0 +1,11 @@ -+// Copyright 2021 The WebRTC project authors. All rights reserved. -+// Use of this source code is governed by a BSD-style license that can be -+// found in the LICENSE file. -+ -+//------------------------------------------------ -+// Functions from DRM used in capturer code. -+//-------- -+ -+// xf86drm.h -+int drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices); -+void drmFreeDevices(drmDevicePtr devices[], int count); -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc -new file mode 100644 -index 0000000000..de63c2a0b8 ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc -@@ -0,0 +1,695 @@ -+/* -+ * Copyright 2021 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#include "modules/desktop_capture/linux/egl_dmabuf.h" -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "absl/memory/memory.h" -+#include "absl/types/optional.h" -+#include "rtc_base/checks.h" -+#include "rtc_base/logging.h" -+#include "rtc_base/sanitizer.h" -+#include "rtc_base/string_encode.h" -+ -+namespace webrtc { -+ -+// EGL -+typedef EGLBoolean (*eglBindAPI_func)(EGLenum api); -+typedef EGLContext (*eglCreateContext_func)(EGLDisplay dpy, -+ EGLConfig config, -+ EGLContext share_context, -+ const EGLint* attrib_list); -+typedef EGLBoolean (*eglDestroyContext_func)(EGLDisplay display, -+ EGLContext context); -+typedef EGLBoolean (*eglTerminate_func)(EGLDisplay display); -+typedef EGLImageKHR (*eglCreateImageKHR_func)(EGLDisplay dpy, -+ EGLContext ctx, -+ EGLenum target, -+ EGLClientBuffer buffer, -+ const EGLint* attrib_list); -+typedef EGLBoolean (*eglDestroyImageKHR_func)(EGLDisplay dpy, -+ EGLImageKHR image); -+typedef EGLint (*eglGetError_func)(void); -+typedef void* (*eglGetProcAddress_func)(const char*); -+typedef EGLDisplay (*eglGetPlatformDisplayEXT_func)(EGLenum platform, -+ void* native_display, -+ const EGLint* attrib_list); -+typedef EGLDisplay (*eglGetPlatformDisplay_func)(EGLenum platform, -+ void* native_display, -+ const EGLAttrib* attrib_list); -+ -+typedef EGLBoolean (*eglInitialize_func)(EGLDisplay dpy, -+ EGLint* major, -+ EGLint* minor); -+typedef EGLBoolean (*eglMakeCurrent_func)(EGLDisplay dpy, -+ EGLSurface draw, -+ EGLSurface read, -+ EGLContext ctx); -+typedef EGLBoolean (*eglQueryDmaBufFormatsEXT_func)(EGLDisplay dpy, -+ EGLint max_formats, -+ EGLint* formats, -+ EGLint* num_formats); -+typedef EGLBoolean (*eglQueryDmaBufModifiersEXT_func)(EGLDisplay dpy, -+ EGLint format, -+ EGLint max_modifiers, -+ EGLuint64KHR* modifiers, -+ EGLBoolean* external_only, -+ EGLint* num_modifiers); -+typedef const char* (*eglQueryString_func)(EGLDisplay dpy, EGLint name); -+typedef void (*glEGLImageTargetTexture2DOES_func)(GLenum target, -+ GLeglImageOES image); -+ -+// This doesn't follow naming conventions in WebRTC, where the naming -+// should look like e.g. egl_bind_api instead of EglBindAPI, however -+// we named them according to the exported functions they map to for -+// consistency. -+eglBindAPI_func EglBindAPI = nullptr; -+eglCreateContext_func EglCreateContext = nullptr; -+eglDestroyContext_func EglDestroyContext = nullptr; -+eglTerminate_func EglTerminate = nullptr; -+eglCreateImageKHR_func EglCreateImageKHR = nullptr; -+eglDestroyImageKHR_func EglDestroyImageKHR = nullptr; -+eglGetError_func EglGetError = nullptr; -+eglGetProcAddress_func EglGetProcAddress = nullptr; -+eglGetPlatformDisplayEXT_func EglGetPlatformDisplayEXT = nullptr; -+eglGetPlatformDisplay_func EglGetPlatformDisplay = nullptr; -+eglInitialize_func EglInitialize = nullptr; -+eglMakeCurrent_func EglMakeCurrent = nullptr; -+eglQueryDmaBufFormatsEXT_func EglQueryDmaBufFormatsEXT = nullptr; -+eglQueryDmaBufModifiersEXT_func EglQueryDmaBufModifiersEXT = nullptr; -+eglQueryString_func EglQueryString = nullptr; -+glEGLImageTargetTexture2DOES_func GlEGLImageTargetTexture2DOES = nullptr; -+ -+// GL -+typedef void (*glBindTexture_func)(GLenum target, GLuint texture); -+typedef void (*glDeleteTextures_func)(GLsizei n, const GLuint* textures); -+typedef void (*glGenTextures_func)(GLsizei n, GLuint* textures); -+typedef GLenum (*glGetError_func)(void); -+typedef const GLubyte* (*glGetString_func)(GLenum name); -+typedef void (*glGetTexImage_func)(GLenum target, -+ GLint level, -+ GLenum format, -+ GLenum type, -+ void* pixels); -+typedef void (*glTexParameteri_func)(GLenum target, GLenum pname, GLint param); -+typedef void* (*glXGetProcAddressARB_func)(const char*); -+ -+// This doesn't follow naming conventions in WebRTC, where the naming -+// should look like e.g. egl_bind_api instead of EglBindAPI, however -+// we named them according to the exported functions they map to for -+// consistency. -+glBindTexture_func GlBindTexture = nullptr; -+glDeleteTextures_func GlDeleteTextures = nullptr; -+glGenTextures_func GlGenTextures = nullptr; -+glGetError_func GlGetError = nullptr; -+glGetString_func GlGetString = nullptr; -+glGetTexImage_func GlGetTexImage = nullptr; -+glTexParameteri_func GlTexParameteri = nullptr; -+glXGetProcAddressARB_func GlXGetProcAddressARB = nullptr; -+ -+static const std::string FormatGLError(GLenum err) { -+ switch (err) { -+ case GL_NO_ERROR: -+ return "GL_NO_ERROR"; -+ case GL_INVALID_ENUM: -+ return "GL_INVALID_ENUM"; -+ case GL_INVALID_VALUE: -+ return "GL_INVALID_VALUE"; -+ case GL_INVALID_OPERATION: -+ return "GL_INVALID_OPERATION"; -+ case GL_STACK_OVERFLOW: -+ return "GL_STACK_OVERFLOW"; -+ case GL_STACK_UNDERFLOW: -+ return "GL_STACK_UNDERFLOW"; -+ case GL_OUT_OF_MEMORY: -+ return "GL_OUT_OF_MEMORY"; -+ default: -+ return "GL error code: " + std::to_string(err); -+ } -+} -+ -+static const std::string FormatEGLError(EGLint err) { -+ switch (err) { -+ case EGL_NOT_INITIALIZED: -+ return "EGL_NOT_INITIALIZED"; -+ case EGL_BAD_ACCESS: -+ return "EGL_BAD_ACCESS"; -+ case EGL_BAD_ALLOC: -+ return "EGL_BAD_ALLOC"; -+ case EGL_BAD_ATTRIBUTE: -+ return "EGL_BAD_ATTRIBUTE"; -+ case EGL_BAD_CONTEXT: -+ return "EGL_BAD_CONTEXT"; -+ case EGL_BAD_CONFIG: -+ return "EGL_BAD_CONFIG"; -+ case EGL_BAD_CURRENT_SURFACE: -+ return "EGL_BAD_CURRENT_SURFACE"; -+ case EGL_BAD_DISPLAY: -+ return "EGL_BAD_DISPLAY"; -+ case EGL_BAD_SURFACE: -+ return "EGL_BAD_SURFACE"; -+ case EGL_BAD_MATCH: -+ return "EGL_BAD_MATCH"; -+ case EGL_BAD_PARAMETER: -+ return "EGL_BAD_PARAMETER"; -+ case EGL_BAD_NATIVE_PIXMAP: -+ return "EGL_BAD_NATIVE_PIXMAP"; -+ case EGL_BAD_NATIVE_WINDOW: -+ return "EGL_BAD_NATIVE_WINDOW"; -+ case EGL_CONTEXT_LOST: -+ return "EGL_CONTEXT_LOST"; -+ default: -+ return "EGL error code: " + std::to_string(err); -+ } -+} -+ -+static uint32_t SpaPixelFormatToDrmFormat(uint32_t spa_format) { -+ switch (spa_format) { -+ case SPA_VIDEO_FORMAT_RGBA: -+ return DRM_FORMAT_ABGR8888; -+ case SPA_VIDEO_FORMAT_RGBx: -+ return DRM_FORMAT_XBGR8888; -+ case SPA_VIDEO_FORMAT_BGRA: -+ return DRM_FORMAT_ARGB8888; -+ case SPA_VIDEO_FORMAT_BGRx: -+ return DRM_FORMAT_XRGB8888; -+ default: -+ return DRM_FORMAT_INVALID; -+ } -+} -+ -+static void CloseLibrary(void* library) { -+ if (library) { -+ dlclose(library); -+ library = nullptr; -+ } -+} -+ -+static void* g_lib_egl = nullptr; -+ -+static bool OpenEGL() { -+ g_lib_egl = dlopen("libEGL.so.1", RTLD_NOW | RTLD_GLOBAL); -+ if (g_lib_egl) { -+ EglGetProcAddress = -+ (eglGetProcAddress_func)dlsym(g_lib_egl, "eglGetProcAddress"); -+ return EglGetProcAddress; -+ } -+ -+ return false; -+} -+ -+static bool LoadEGL() { -+ if (OpenEGL()) { -+ EglBindAPI = (eglBindAPI_func)EglGetProcAddress("eglBindAPI"); -+ EglCreateContext = -+ (eglCreateContext_func)EglGetProcAddress("eglCreateContext"); -+ EglDestroyContext = -+ (eglDestroyContext_func)EglGetProcAddress("eglDestroyContext"); -+ EglTerminate = (eglTerminate_func)EglGetProcAddress("eglTerminate"); -+ EglCreateImageKHR = -+ (eglCreateImageKHR_func)EglGetProcAddress("eglCreateImageKHR"); -+ EglDestroyImageKHR = -+ (eglDestroyImageKHR_func)EglGetProcAddress("eglDestroyImageKHR"); -+ EglGetError = (eglGetError_func)EglGetProcAddress("eglGetError"); -+ EglGetPlatformDisplayEXT = (eglGetPlatformDisplayEXT_func)EglGetProcAddress( -+ "eglGetPlatformDisplayEXT"); -+ EglGetPlatformDisplay = -+ (eglGetPlatformDisplay_func)EglGetProcAddress("eglGetPlatformDisplay"); -+ EglInitialize = (eglInitialize_func)EglGetProcAddress("eglInitialize"); -+ EglMakeCurrent = (eglMakeCurrent_func)EglGetProcAddress("eglMakeCurrent"); -+ EglQueryString = (eglQueryString_func)EglGetProcAddress("eglQueryString"); -+ GlEGLImageTargetTexture2DOES = -+ (glEGLImageTargetTexture2DOES_func)EglGetProcAddress( -+ "glEGLImageTargetTexture2DOES"); -+ -+ return EglBindAPI && EglCreateContext && EglCreateImageKHR && -+ EglTerminate && EglDestroyContext && EglDestroyImageKHR && -+ EglGetError && EglGetPlatformDisplayEXT && EglGetPlatformDisplay && -+ EglInitialize && EglMakeCurrent && EglQueryString && -+ GlEGLImageTargetTexture2DOES; -+ } -+ -+ return false; -+} -+ -+static void* g_lib_gl = nullptr; -+ -+static bool OpenGL() { -+ std::vector names = {"libGL.so.1", "libGL.so"}; -+ for (const std::string& name : names) { -+ g_lib_gl = dlopen(name.c_str(), RTLD_NOW | RTLD_GLOBAL); -+ if (g_lib_gl) { -+ GlXGetProcAddressARB = -+ (glXGetProcAddressARB_func)dlsym(g_lib_gl, "glXGetProcAddressARB"); -+ return GlXGetProcAddressARB; -+ } -+ } -+ -+ return false; -+} -+ -+static bool LoadGL() { -+ if (OpenGL()) { -+ GlGetString = (glGetString_func)GlXGetProcAddressARB("glGetString"); -+ if (!GlGetString) { -+ return false; -+ } -+ -+ GlBindTexture = (glBindTexture_func)GlXGetProcAddressARB("glBindTexture"); -+ GlDeleteTextures = -+ (glDeleteTextures_func)GlXGetProcAddressARB("glDeleteTextures"); -+ GlGenTextures = (glGenTextures_func)GlXGetProcAddressARB("glGenTextures"); -+ GlGetError = (glGetError_func)GlXGetProcAddressARB("glGetError"); -+ GlGetTexImage = (glGetTexImage_func)GlXGetProcAddressARB("glGetTexImage"); -+ GlTexParameteri = -+ (glTexParameteri_func)GlXGetProcAddressARB("glTexParameteri"); -+ -+ return GlBindTexture && GlDeleteTextures && GlGenTextures && GlGetError && -+ GlGetTexImage && GlTexParameteri; -+ } -+ -+ return false; -+} -+ -+EglDmaBuf::EglDmaBuf() { -+ if (!LoadEGL()) { -+ RTC_LOG(LS_ERROR) << "Unable to load EGL entry functions."; -+ CloseLibrary(g_lib_egl); -+ return; -+ } -+ -+ if (!LoadGL()) { -+ RTC_LOG(LS_ERROR) << "Failed to load OpenGL entry functions."; -+ CloseLibrary(g_lib_gl); -+ return; -+ } -+ -+ if (!GetClientExtensions(EGL_NO_DISPLAY, EGL_EXTENSIONS)) { -+ return; -+ } -+ -+ bool has_platform_base_ext = false; -+ bool has_platform_gbm_ext = false; -+ bool has_khr_platform_gbm_ext = false; -+ -+ for (const auto& extension : egl_.extensions) { -+ if (extension == "EGL_EXT_platform_base") { -+ has_platform_base_ext = true; -+ continue; -+ } else if (extension == "EGL_MESA_platform_gbm") { -+ has_platform_gbm_ext = true; -+ continue; -+ } else if (extension == "EGL_KHR_platform_gbm") { -+ has_khr_platform_gbm_ext = true; -+ continue; -+ } -+ } -+ -+ if (!has_platform_base_ext || !has_platform_gbm_ext || -+ !has_khr_platform_gbm_ext) { -+ RTC_LOG(LS_ERROR) << "One of required EGL extensions is missing"; -+ return; -+ } -+ -+ egl_.display = EglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_KHR, -+ (void*)EGL_DEFAULT_DISPLAY, nullptr); -+ -+ if (egl_.display == EGL_NO_DISPLAY) { -+ RTC_LOG(LS_ERROR) << "Failed to obtain default EGL display: " -+ << FormatEGLError(EglGetError()) << "\n" -+ << "Defaulting to using first available render node"; -+ absl::optional render_node = GetRenderNode(); -+ if (!render_node) { -+ return; -+ } -+ -+ drm_fd_ = open(render_node->c_str(), O_RDWR); -+ -+ if (drm_fd_ < 0) { -+ RTC_LOG(LS_ERROR) << "Failed to open drm render node: " -+ << strerror(errno); -+ return; -+ } -+ -+ gbm_device_ = gbm_create_device(drm_fd_); -+ -+ if (!gbm_device_) { -+ RTC_LOG(LS_ERROR) << "Cannot create GBM device: " << strerror(errno); -+ close(drm_fd_); -+ return; -+ } -+ -+ // Use eglGetPlatformDisplayEXT() to get the display pointer -+ // if the implementation supports it. -+ egl_.display = -+ EglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_KHR, gbm_device_, nullptr); -+ } -+ -+ if (egl_.display == EGL_NO_DISPLAY) { -+ RTC_LOG(LS_ERROR) << "Error during obtaining EGL display: " -+ << FormatEGLError(EglGetError()); -+ return; -+ } -+ -+ EGLint major, minor; -+ if (EglInitialize(egl_.display, &major, &minor) == EGL_FALSE) { -+ RTC_LOG(LS_ERROR) << "Error during eglInitialize: " -+ << FormatEGLError(EglGetError()); -+ return; -+ } -+ -+ if (EglBindAPI(EGL_OPENGL_API) == EGL_FALSE) { -+ RTC_LOG(LS_ERROR) << "bind OpenGL API failed"; -+ return; -+ } -+ -+ egl_.context = -+ EglCreateContext(egl_.display, nullptr, EGL_NO_CONTEXT, nullptr); -+ -+ if (egl_.context == EGL_NO_CONTEXT) { -+ RTC_LOG(LS_ERROR) << "Couldn't create EGL context: " -+ << FormatGLError(EglGetError()); -+ return; -+ } -+ -+ if (!GetClientExtensions(egl_.display, EGL_EXTENSIONS)) { -+ return; -+ } -+ -+ bool has_image_dma_buf_import_modifiers_ext = false; -+ -+ for (const auto& extension : egl_.extensions) { -+ if (extension == "EGL_EXT_image_dma_buf_import") { -+ has_image_dma_buf_import_ext_ = true; -+ continue; -+ } else if (extension == "EGL_EXT_image_dma_buf_import_modifiers") { -+ has_image_dma_buf_import_modifiers_ext = true; -+ continue; -+ } -+ } -+ -+ if (has_image_dma_buf_import_ext_ && has_image_dma_buf_import_modifiers_ext) { -+ EglQueryDmaBufFormatsEXT = (eglQueryDmaBufFormatsEXT_func)EglGetProcAddress( -+ "eglQueryDmaBufFormatsEXT"); -+ EglQueryDmaBufModifiersEXT = -+ (eglQueryDmaBufModifiersEXT_func)EglGetProcAddress( -+ "eglQueryDmaBufModifiersEXT"); -+ } -+ -+ RTC_LOG(LS_INFO) << "Egl initialization succeeded"; -+ egl_initialized_ = true; -+} -+ -+EglDmaBuf::~EglDmaBuf() { -+ if (gbm_device_) { -+ gbm_device_destroy(gbm_device_); -+ close(drm_fd_); -+ } -+ -+ if (egl_.context != EGL_NO_CONTEXT) { -+ EglDestroyContext(egl_.display, egl_.context); -+ } -+ -+ if (egl_.display != EGL_NO_DISPLAY) { -+ EglTerminate(egl_.display); -+ } -+ -+ // BUG: crbug.com/1290566 -+ // Closing libEGL.so.1 when using NVidia drivers causes a crash -+ // when EglGetPlatformDisplayEXT() is used, at least this one is enough -+ // to be called to make it crash. -+ // It also looks that libepoxy and glad don't dlclose it either -+ // CloseLibrary(g_lib_egl); -+ // CloseLibrary(g_lib_gl); -+} -+ -+bool EglDmaBuf::GetClientExtensions(EGLDisplay dpy, EGLint name) { -+ // Get the list of client extensions -+ const char* client_extensions_cstring = EglQueryString(dpy, name); -+ if (!client_extensions_cstring) { -+ // If eglQueryString() returned NULL, the implementation doesn't support -+ // EGL_EXT_client_extensions. Expect an EGL_BAD_DISPLAY error. -+ RTC_LOG(LS_ERROR) << "No client extensions defined! " -+ << FormatEGLError(EglGetError()); -+ return false; -+ } -+ -+ std::vector client_extensions; -+ rtc::split(client_extensions_cstring, ' ', -+ &client_extensions); -+ for (const auto& extension : client_extensions) { -+ egl_.extensions.push_back(extension); -+ } -+ -+ return true; -+} -+ -+std::unique_ptr EglDmaBuf::ImageFromDmaBuf( -+ const DesktopSize& size, -+ uint32_t format, -+ const std::vector& plane_datas, -+ uint64_t modifier) { -+ std::unique_ptr src; -+ -+ if (!egl_initialized_) { -+ return src; -+ } -+ -+ if (plane_datas.size() <= 0) { -+ RTC_LOG(LS_ERROR) << "Failed to process buffer: invalid number of planes"; -+ return src; -+ } -+ -+ EGLint attribs[47]; -+ int atti = 0; -+ -+ attribs[atti++] = EGL_WIDTH; -+ attribs[atti++] = static_cast(size.width()); -+ attribs[atti++] = EGL_HEIGHT; -+ attribs[atti++] = static_cast(size.height()); -+ attribs[atti++] = EGL_LINUX_DRM_FOURCC_EXT; -+ attribs[atti++] = SpaPixelFormatToDrmFormat(format); -+ -+ if (plane_datas.size() > 0) { -+ attribs[atti++] = EGL_DMA_BUF_PLANE0_FD_EXT; -+ attribs[atti++] = plane_datas[0].fd; -+ attribs[atti++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT; -+ attribs[atti++] = plane_datas[0].offset; -+ attribs[atti++] = EGL_DMA_BUF_PLANE0_PITCH_EXT; -+ attribs[atti++] = plane_datas[0].stride; -+ -+ if (modifier != DRM_FORMAT_MOD_INVALID) { -+ attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT; -+ attribs[atti++] = modifier & 0xFFFFFFFF; -+ attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT; -+ attribs[atti++] = modifier >> 32; -+ } -+ } -+ -+ if (plane_datas.size() > 1) { -+ attribs[atti++] = EGL_DMA_BUF_PLANE1_FD_EXT; -+ attribs[atti++] = plane_datas[1].fd; -+ attribs[atti++] = EGL_DMA_BUF_PLANE1_OFFSET_EXT; -+ attribs[atti++] = plane_datas[1].offset; -+ attribs[atti++] = EGL_DMA_BUF_PLANE1_PITCH_EXT; -+ attribs[atti++] = plane_datas[1].stride; -+ -+ if (modifier != DRM_FORMAT_MOD_INVALID) { -+ attribs[atti++] = EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT; -+ attribs[atti++] = modifier & 0xFFFFFFFF; -+ attribs[atti++] = EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT; -+ attribs[atti++] = modifier >> 32; -+ } -+ } -+ -+ if (plane_datas.size() > 2) { -+ attribs[atti++] = EGL_DMA_BUF_PLANE2_FD_EXT; -+ attribs[atti++] = plane_datas[2].fd; -+ attribs[atti++] = EGL_DMA_BUF_PLANE2_OFFSET_EXT; -+ attribs[atti++] = plane_datas[2].offset; -+ attribs[atti++] = EGL_DMA_BUF_PLANE2_PITCH_EXT; -+ attribs[atti++] = plane_datas[2].stride; -+ -+ if (modifier != DRM_FORMAT_MOD_INVALID) { -+ attribs[atti++] = EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT; -+ attribs[atti++] = modifier & 0xFFFFFFFF; -+ attribs[atti++] = EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT; -+ attribs[atti++] = modifier >> 32; -+ } -+ } -+ -+ if (plane_datas.size() > 3) { -+ attribs[atti++] = EGL_DMA_BUF_PLANE3_FD_EXT; -+ attribs[atti++] = plane_datas[3].fd; -+ attribs[atti++] = EGL_DMA_BUF_PLANE3_OFFSET_EXT; -+ attribs[atti++] = plane_datas[3].offset; -+ attribs[atti++] = EGL_DMA_BUF_PLANE3_PITCH_EXT; -+ attribs[atti++] = plane_datas[3].stride; -+ -+ if (modifier != DRM_FORMAT_MOD_INVALID) { -+ attribs[atti++] = EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT; -+ attribs[atti++] = modifier & 0xFFFFFFFF; -+ attribs[atti++] = EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT; -+ attribs[atti++] = modifier >> 32; -+ } -+ } -+ -+ attribs[atti++] = EGL_NONE; -+ -+ // bind context to render thread -+ EglMakeCurrent(egl_.display, EGL_NO_SURFACE, EGL_NO_SURFACE, egl_.context); -+ -+ // create EGL image from attribute list -+ EGLImageKHR image = EglCreateImageKHR( -+ egl_.display, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, nullptr, attribs); -+ -+ if (image == EGL_NO_IMAGE) { -+ RTC_LOG(LS_ERROR) << "Failed to record frame: Error creating EGLImage - " -+ << FormatEGLError(EglGetError()); -+ return src; -+ } -+ -+ // create GL 2D texture for framebuffer -+ GLuint texture; -+ GlGenTextures(1, &texture); -+ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); -+ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); -+ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); -+ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); -+ GlBindTexture(GL_TEXTURE_2D, texture); -+ GlEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image); -+ -+ src = std::make_unique(plane_datas[0].stride * size.height()); -+ -+ GLenum gl_format = GL_BGRA; -+ switch (format) { -+ case SPA_VIDEO_FORMAT_RGBx: -+ gl_format = GL_RGBA; -+ break; -+ case SPA_VIDEO_FORMAT_RGBA: -+ gl_format = GL_RGBA; -+ break; -+ case SPA_VIDEO_FORMAT_BGRx: -+ gl_format = GL_BGRA; -+ break; -+ default: -+ gl_format = GL_BGRA; -+ break; -+ } -+ GlGetTexImage(GL_TEXTURE_2D, 0, gl_format, GL_UNSIGNED_BYTE, src.get()); -+ -+ if (GlGetError()) { -+ RTC_LOG(LS_ERROR) << "Failed to get image from DMA buffer."; -+ return src; -+ } -+ -+ GlDeleteTextures(1, &texture); -+ EglDestroyImageKHR(egl_.display, image); -+ -+ return src; -+} -+ -+std::vector EglDmaBuf::QueryDmaBufModifiers(uint32_t format) { -+ if (!egl_initialized_) { -+ return {}; -+ } -+ -+ // Explicit modifiers not supported, return just DRM_FORMAT_MOD_INVALID as we -+ // can still use modifier-less DMA-BUFs if we have required extension -+ if (EglQueryDmaBufFormatsEXT == nullptr || -+ EglQueryDmaBufModifiersEXT == nullptr) { -+ return has_image_dma_buf_import_ext_ -+ ? std::vector{DRM_FORMAT_MOD_INVALID} -+ : std::vector{}; -+ } -+ -+ uint32_t drm_format = SpaPixelFormatToDrmFormat(format); -+ // Should never happen as it's us who controls the list of supported formats -+ RTC_DCHECK(drm_format != DRM_FORMAT_INVALID); -+ -+ EGLint count = 0; -+ EGLBoolean success = -+ EglQueryDmaBufFormatsEXT(egl_.display, 0, nullptr, &count); -+ -+ if (!success || !count) { -+ RTC_LOG(LS_ERROR) << "Failed to query DMA-BUF formats."; -+ return {DRM_FORMAT_MOD_INVALID}; -+ } -+ -+ std::vector formats(count); -+ if (!EglQueryDmaBufFormatsEXT(egl_.display, count, -+ reinterpret_cast(formats.data()), -+ &count)) { -+ RTC_LOG(LS_ERROR) << "Failed to query DMA-BUF formats."; -+ return {DRM_FORMAT_MOD_INVALID}; -+ } -+ -+ if (std::find(formats.begin(), formats.end(), drm_format) == formats.end()) { -+ RTC_LOG(LS_ERROR) << "Format " << drm_format -+ << " not supported for modifiers."; -+ return {DRM_FORMAT_MOD_INVALID}; -+ } -+ -+ success = EglQueryDmaBufModifiersEXT(egl_.display, drm_format, 0, nullptr, -+ nullptr, &count); -+ -+ if (!success || !count) { -+ RTC_LOG(LS_ERROR) << "Failed to query DMA-BUF modifiers."; -+ return {DRM_FORMAT_MOD_INVALID}; -+ } -+ -+ std::vector modifiers(count); -+ if (!EglQueryDmaBufModifiersEXT(egl_.display, drm_format, count, -+ modifiers.data(), nullptr, &count)) { -+ RTC_LOG(LS_ERROR) << "Failed to query DMA-BUF modifiers."; -+ } -+ -+ // Support modifier-less buffers -+ modifiers.push_back(DRM_FORMAT_MOD_INVALID); -+ return modifiers; -+} -+ -+absl::optional EglDmaBuf::GetRenderNode() { -+ int max_devices = drmGetDevices2(0, nullptr, 0); -+ if (max_devices <= 0) { -+ RTC_LOG(LS_ERROR) << "drmGetDevices2() has not found any devices (errno=" -+ << -max_devices << ")"; -+ return absl::nullopt; -+ } -+ -+ std::vector devices(max_devices); -+ int ret = drmGetDevices2(0, devices.data(), max_devices); -+ if (ret < 0) { -+ RTC_LOG(LS_ERROR) << "drmGetDevices2() returned an error " << ret; -+ return absl::nullopt; -+ } -+ -+ std::string render_node; -+ -+ for (const drmDevicePtr& device : devices) { -+ if (device->available_nodes & (1 << DRM_NODE_RENDER)) { -+ render_node = device->nodes[DRM_NODE_RENDER]; -+ break; -+ } -+ } -+ -+ drmFreeDevices(devices.data(), ret); -+ return render_node; -+} -+ -+} // namespace webrtc -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h -new file mode 100644 -index 0000000000..b755d8ba37 ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h -@@ -0,0 +1,68 @@ -+/* -+ * Copyright 2021 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#ifndef MODULES_DESKTOP_CAPTURE_LINUX_EGL_DMABUF_H_ -+#define MODULES_DESKTOP_CAPTURE_LINUX_EGL_DMABUF_H_ -+ -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+#include "absl/types/optional.h" -+#include "modules/desktop_capture/desktop_geometry.h" -+ -+namespace webrtc { -+ -+class EglDmaBuf { -+ public: -+ struct EGLStruct { -+ std::vector extensions; -+ EGLDisplay display = EGL_NO_DISPLAY; -+ EGLContext context = EGL_NO_CONTEXT; -+ }; -+ -+ struct PlaneData { -+ int32_t fd; -+ uint32_t stride; -+ uint32_t offset; -+ }; -+ -+ EglDmaBuf(); -+ ~EglDmaBuf(); -+ -+ std::unique_ptr ImageFromDmaBuf( -+ const DesktopSize& size, -+ uint32_t format, -+ const std::vector& plane_datas, -+ uint64_t modifiers); -+ std::vector QueryDmaBufModifiers(uint32_t format); -+ -+ bool IsEglInitialized() const { return egl_initialized_; } -+ -+ private: -+ bool GetClientExtensions(EGLDisplay dpy, EGLint name); -+ -+ bool egl_initialized_ = false; -+ bool has_image_dma_buf_import_ext_ = false; -+ int32_t drm_fd_ = -1; // for GBM buffer mmap -+ gbm_device* gbm_device_ = nullptr; // for passed GBM buffer retrieval -+ -+ EGLStruct egl_; -+ -+ absl::optional GetRenderNode(); -+}; -+ -+} // namespace webrtc -+ -+#endif // MODULES_DESKTOP_CAPTURE_LINUX_EGL_DMABUF_H_ -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc -new file mode 100644 -index 0000000000..09dea242b3 ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc -@@ -0,0 +1,56 @@ -+/* -+ * Copyright (c) 2022 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#include "modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h" -+ -+#include -+ -+#include "modules/desktop_capture/desktop_capture_options.h" -+#include "modules/desktop_capture/desktop_capturer.h" -+#include "rtc_base/checks.h" -+#include "rtc_base/logging.h" -+ -+namespace webrtc { -+ -+MouseCursorMonitorPipeWire::MouseCursorMonitorPipeWire( -+ const DesktopCaptureOptions& options) -+ : options_(options) { -+} -+ -+MouseCursorMonitorPipeWire::~MouseCursorMonitorPipeWire() {} -+ -+void MouseCursorMonitorPipeWire::Init(Callback* callback, Mode mode) { -+ RTC_DCHECK(!callback_); -+ RTC_DCHECK(callback); -+ -+ callback_ = callback; -+ mode_ = mode; -+} -+ -+void MouseCursorMonitorPipeWire::Capture() { -+ RTC_DCHECK(callback_); -+ -+ std::unique_ptr mouse_cursor = -+ options_.screencast_stream()->CaptureCursor(); -+ -+ if (mouse_cursor && mouse_cursor->image()->data()) { -+ callback_->OnMouseCursor(mouse_cursor.release()); -+ } -+ -+ if (mode_ == SHAPE_AND_POSITION) { -+ absl::optional mouse_cursor_position = -+ options_.screencast_stream()->CaptureCursorPosition(); -+ if (mouse_cursor_position) { -+ callback_->OnMouseCursorPosition(mouse_cursor_position.value()); -+ } -+ } -+} -+ -+} // namespace webrtc -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h -new file mode 100644 -index 0000000000..9b9ccf74f8 ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h -@@ -0,0 +1,41 @@ -+/* -+ * Copyright 2022 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#ifndef MODULES_DESKTOP_CAPTURE_LINUX_MOUSE_CURSOR_MONITOR_PIPEWIRE_H_ -+#define MODULES_DESKTOP_CAPTURE_LINUX_MOUSE_CURSOR_MONITOR_PIPEWIRE_H_ -+ -+#include -+ -+#include "api/scoped_refptr.h" -+#include "modules/desktop_capture/desktop_capture_options.h" -+#include "modules/desktop_capture/desktop_capture_types.h" -+#include "modules/desktop_capture/linux/shared_screencast_stream.h" -+#include "modules/desktop_capture/mouse_cursor.h" -+#include "modules/desktop_capture/mouse_cursor_monitor.h" -+ -+namespace webrtc { -+ -+class MouseCursorMonitorPipeWire : public MouseCursorMonitor { -+ public: -+ explicit MouseCursorMonitorPipeWire(const DesktopCaptureOptions& options); -+ ~MouseCursorMonitorPipeWire() override; -+ -+ // MouseCursorMonitor: -+ void Init(Callback* callback, Mode mode) override; -+ void Capture() override; -+ -+ DesktopCaptureOptions options_; -+ Callback* callback_ = nullptr; -+ Mode mode_ = SHAPE_AND_POSITION; -+}; -+ -+} // namespace webrtc -+ -+#endif // MODULES_DESKTOP_CAPTURE_LINUX_MOUSE_CURSOR_MONITOR_PIPEWIRE_H_ -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs -index 3e21e9dc07..06a97b8f29 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs -@@ -7,38 +7,44 @@ - //------------------------------------------------ - - // core.h --void pw_core_destroy(pw_core *core); --pw_type *pw_core_get_type(pw_core *core); --pw_core * pw_core_new(pw_loop *main_loop, pw_properties *props); -+int pw_core_disconnect(pw_core *core); - - // loop.h - void pw_loop_destroy(pw_loop *loop); --pw_loop * pw_loop_new(pw_properties *properties); -+pw_loop * pw_loop_new(const spa_dict *props); -+ - - // pipewire.h - void pw_init(int *argc, char **argv[]); -+const char* pw_get_library_version(); - - // properties.h - pw_properties * pw_properties_new_string(const char *args); - --// remote.h --void pw_remote_add_listener(pw_remote *remote, spa_hook *listener, const pw_remote_events *events, void *data); --int pw_remote_connect_fd(pw_remote *remote, int fd); --void pw_remote_destroy(pw_remote *remote); --pw_remote * pw_remote_new(pw_core *core, pw_properties *properties, size_t user_data_size); -- - // stream.h - void pw_stream_add_listener(pw_stream *stream, spa_hook *listener, const pw_stream_events *events, void *data); --int pw_stream_connect(pw_stream *stream, enum pw_direction direction, const char *port_path, enum pw_stream_flags flags, const spa_pod **params, uint32_t n_params); -+int pw_stream_connect(pw_stream *stream, enum pw_direction direction, uint32_t target_id, enum pw_stream_flags flags, const spa_pod **params, uint32_t n_params); -+int pw_stream_disconnect(pw_stream *stream); - pw_buffer *pw_stream_dequeue_buffer(pw_stream *stream); - void pw_stream_destroy(pw_stream *stream); --void pw_stream_finish_format(pw_stream *stream, int res, const spa_pod **params, uint32_t n_params); --pw_stream * pw_stream_new(pw_remote *remote, const char *name, pw_properties *props); -+pw_stream * pw_stream_new(pw_core *core, const char *name, pw_properties *props); - int pw_stream_queue_buffer(pw_stream *stream, pw_buffer *buffer); - int pw_stream_set_active(pw_stream *stream, bool active); -+int pw_stream_update_params(pw_stream *stream, const spa_pod **params, uint32_t n_params); - - // thread-loop.h - void pw_thread_loop_destroy(pw_thread_loop *loop); --pw_thread_loop * pw_thread_loop_new(pw_loop *loop, const char *name); -+pw_thread_loop * pw_thread_loop_new(const char *name, const spa_dict *props); - int pw_thread_loop_start(pw_thread_loop *loop); - void pw_thread_loop_stop(pw_thread_loop *loop); -+void pw_thread_loop_lock(pw_thread_loop *loop); -+void pw_thread_loop_unlock(pw_thread_loop *loop); -+pw_loop * pw_thread_loop_get_loop(pw_thread_loop *loop); -+void pw_thread_loop_signal(pw_thread_loop *loop, bool wait_for_accept); -+void pw_thread_loop_wait(pw_thread_loop *loop); -+ -+// context.h -+void pw_context_destroy(pw_context *context); -+pw_context *pw_context_new(pw_loop *main_loop, pw_properties *props, size_t user_data_size); -+pw_core * pw_context_connect(pw_context *context, pw_properties *properties, size_t user_data_size); -+pw_core * pw_context_connect_fd(pw_context *context, int fd, pw_properties *properties, size_t user_data_size); -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment -index 9d7dbd27c5..06ae18dfd4 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment -@@ -5,4 +5,5 @@ extern "C" { - - #include - -+#include - } -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc -new file mode 100644 -index 0000000000..51ca57adc1 ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc -@@ -0,0 +1,57 @@ -+/* -+ * Copyright 2022 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#include "modules/desktop_capture/linux/scoped_glib.h" -+ -+namespace webrtc { -+ -+template <> -+Scoped::~Scoped() { -+ if (ptr_) { -+ g_error_free(ptr_); -+ } -+} -+ -+template <> -+Scoped::~Scoped() { -+ if (ptr_) { -+ g_free(ptr_); -+ } -+} -+ -+template <> -+Scoped::~Scoped() { -+ if (ptr_) { -+ g_variant_unref(ptr_); -+ } -+} -+ -+template <> -+Scoped::~Scoped() { -+ if (ptr_) { -+ g_variant_iter_free(ptr_); -+ } -+} -+ -+template <> -+Scoped::~Scoped() { -+ if (ptr_) { -+ g_object_unref(ptr_); -+ } -+} -+ -+template <> -+Scoped::~Scoped() { -+ if (ptr_) { -+ g_object_unref(ptr_); -+ } -+} -+ -+} // namespace webrtc -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h -new file mode 100644 -index 0000000000..bf77855f95 ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h -@@ -0,0 +1,65 @@ -+/* -+ * Copyright 2022 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#ifndef MODULES_DESKTOP_CAPTURE_LINUX_SCOPED_GLIB_H_ -+#define MODULES_DESKTOP_CAPTURE_LINUX_SCOPED_GLIB_H_ -+ -+#include -+ -+#include "rtc_base/checks.h" -+ -+namespace webrtc { -+ -+template -+class Scoped { -+ public: -+ Scoped() {} -+ explicit Scoped(T* val) { ptr_ = val; } -+ ~Scoped() { RTC_DCHECK_NOTREACHED(); } -+ -+ T* operator->() const { return ptr_; } -+ -+ explicit operator bool() const { return ptr_ != nullptr; } -+ -+ bool operator!() const { return ptr_ == nullptr; } -+ -+ T* get() const { return ptr_; } -+ -+ T** receive() { -+ RTC_CHECK(!ptr_); -+ return &ptr_; -+ } -+ -+ Scoped& operator=(T* val) { -+ RTC_DCHECK(val); -+ ptr_ = val; -+ return *this; -+ } -+ -+ protected: -+ T* ptr_ = nullptr; -+}; -+ -+template <> -+Scoped::~Scoped(); -+template <> -+Scoped::~Scoped(); -+template <> -+Scoped::~Scoped(); -+template <> -+Scoped::~Scoped(); -+template <> -+Scoped::~Scoped(); -+template <> -+Scoped::~Scoped(); -+ -+} // namespace webrtc -+ -+#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCOPED_GLIB_H_ -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc -deleted file mode 100644 -index 3813d697bb..0000000000 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc -+++ /dev/null -@@ -1,28 +0,0 @@ --/* -- * Copyright 2018 The WebRTC project authors. All Rights Reserved. -- * -- * Use of this source code is governed by a BSD-style license -- * that can be found in the LICENSE file in the root of the source -- * tree. An additional intellectual property rights grant can be found -- * in the file PATENTS. All contributing project authors may -- * be found in the AUTHORS file in the root of the source tree. -- */ -- --#include "modules/desktop_capture/linux/screen_capturer_pipewire.h" -- --#include -- --namespace webrtc { -- --ScreenCapturerPipeWire::ScreenCapturerPipeWire() -- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kScreen) {} --ScreenCapturerPipeWire::~ScreenCapturerPipeWire() {} -- --// static --std::unique_ptr --ScreenCapturerPipeWire::CreateRawScreenCapturer( -- const DesktopCaptureOptions& options) { -- return std::make_unique(); --} -- --} // namespace webrtc -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h -deleted file mode 100644 -index 66dcd680e0..0000000000 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h -+++ /dev/null -@@ -1,33 +0,0 @@ --/* -- * Copyright 2018 The WebRTC project authors. All Rights Reserved. -- * -- * Use of this source code is governed by a BSD-style license -- * that can be found in the LICENSE file in the root of the source -- * tree. An additional intellectual property rights grant can be found -- * in the file PATENTS. All contributing project authors may -- * be found in the AUTHORS file in the root of the source tree. -- */ -- --#ifndef MODULES_DESKTOP_CAPTURE_LINUX_SCREEN_CAPTURER_PIPEWIRE_H_ --#define MODULES_DESKTOP_CAPTURE_LINUX_SCREEN_CAPTURER_PIPEWIRE_H_ -- --#include -- --#include "modules/desktop_capture/linux/base_capturer_pipewire.h" -- --namespace webrtc { -- --class ScreenCapturerPipeWire : public BaseCapturerPipeWire { -- public: -- ScreenCapturerPipeWire(); -- ~ScreenCapturerPipeWire() override; -- -- static std::unique_ptr CreateRawScreenCapturer( -- const DesktopCaptureOptions& options); -- -- RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerPipeWire); --}; -- --} // namespace webrtc -- --#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCREEN_CAPTURER_PIPEWIRE_H_ -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc -new file mode 100644 -index 0000000000..306e984207 ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc -@@ -0,0 +1,532 @@ -+/* -+ * Copyright 2022 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#include "modules/desktop_capture/linux/screencast_portal.h" -+ -+#include -+#include -+ -+#include "modules/desktop_capture/linux/scoped_glib.h" -+#include "rtc_base/checks.h" -+#include "rtc_base/logging.h" -+ -+namespace webrtc { -+ -+const char kDesktopBusName[] = "org.freedesktop.portal.Desktop"; -+const char kDesktopObjectPath[] = "/org/freedesktop/portal/desktop"; -+const char kDesktopRequestObjectPath[] = -+ "/org/freedesktop/portal/desktop/request"; -+const char kSessionInterfaceName[] = "org.freedesktop.portal.Session"; -+const char kRequestInterfaceName[] = "org.freedesktop.portal.Request"; -+const char kScreenCastInterfaceName[] = "org.freedesktop.portal.ScreenCast"; -+ -+ScreenCastPortal::ScreenCastPortal(CaptureSourceType source_type, -+ PortalNotifier* notifier) -+ : notifier_(notifier), capture_source_type_(source_type) {} -+ -+ScreenCastPortal::~ScreenCastPortal() { -+ if (start_request_signal_id_) { -+ g_dbus_connection_signal_unsubscribe(connection_, start_request_signal_id_); -+ } -+ if (sources_request_signal_id_) { -+ g_dbus_connection_signal_unsubscribe(connection_, -+ sources_request_signal_id_); -+ } -+ if (session_request_signal_id_) { -+ g_dbus_connection_signal_unsubscribe(connection_, -+ session_request_signal_id_); -+ } -+ -+ if (!session_handle_.empty()) { -+ Scoped message( -+ g_dbus_message_new_method_call(kDesktopBusName, session_handle_.c_str(), -+ kSessionInterfaceName, "Close")); -+ if (message.get()) { -+ Scoped error; -+ g_dbus_connection_send_message(connection_, message.get(), -+ G_DBUS_SEND_MESSAGE_FLAGS_NONE, -+ /*out_serial=*/nullptr, error.receive()); -+ if (error.get()) { -+ RTC_LOG(LS_ERROR) << "Failed to close the session: " << error->message; -+ } -+ } -+ } -+ -+ if (cancellable_) { -+ g_cancellable_cancel(cancellable_); -+ g_object_unref(cancellable_); -+ cancellable_ = nullptr; -+ } -+ -+ if (proxy_) { -+ g_object_unref(proxy_); -+ proxy_ = nullptr; -+ } -+ -+ if (pw_fd_ != -1) { -+ close(pw_fd_); -+ } -+} -+ -+void ScreenCastPortal::Start() { -+ cancellable_ = g_cancellable_new(); -+ g_dbus_proxy_new_for_bus( -+ G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, /*info=*/nullptr, -+ kDesktopBusName, kDesktopObjectPath, kScreenCastInterfaceName, -+ cancellable_, reinterpret_cast(OnProxyRequested), -+ this); -+} -+ -+void ScreenCastPortal::PortalFailed(RequestResponse result) { -+ notifier_->OnScreenCastRequestResult(result, pw_stream_node_id_, pw_fd_); -+} -+ -+uint32_t ScreenCastPortal::SetupRequestResponseSignal( -+ const char* object_path, -+ GDBusSignalCallback callback) { -+ return g_dbus_connection_signal_subscribe( -+ connection_, kDesktopBusName, kRequestInterfaceName, "Response", -+ object_path, /*arg0=*/nullptr, G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE, -+ callback, this, /*user_data_free_func=*/nullptr); -+} -+ -+// static -+void ScreenCastPortal::OnProxyRequested(GObject* /*object*/, -+ GAsyncResult* result, -+ gpointer user_data) { -+ ScreenCastPortal* that = static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ Scoped error; -+ GDBusProxy* proxy = g_dbus_proxy_new_finish(result, error.receive()); -+ if (!proxy) { -+ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) -+ return; -+ RTC_LOG(LS_ERROR) << "Failed to create a proxy for the screen cast portal: " -+ << error->message; -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ that->proxy_ = proxy; -+ that->connection_ = g_dbus_proxy_get_connection(that->proxy_); -+ -+ RTC_LOG(LS_INFO) << "Created proxy for the screen cast portal."; -+ -+ that->SessionRequest(); -+} -+ -+// static -+std::string ScreenCastPortal::PrepareSignalHandle(GDBusConnection* connection, -+ const char* token) { -+ Scoped sender( -+ g_strdup(g_dbus_connection_get_unique_name(connection) + 1)); -+ for (int i = 0; sender.get()[i]; ++i) { -+ if (sender.get()[i] == '.') { -+ sender.get()[i] = '_'; -+ } -+ } -+ -+ const char* handle = g_strconcat(kDesktopRequestObjectPath, "/", sender.get(), -+ "/", token, /*end of varargs*/ nullptr); -+ -+ return handle; -+} -+ -+void ScreenCastPortal::SessionRequest() { -+ GVariantBuilder builder; -+ Scoped variant_string; -+ -+ g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); -+ variant_string = -+ g_strdup_printf("webrtc_session%d", g_random_int_range(0, G_MAXINT)); -+ g_variant_builder_add(&builder, "{sv}", "session_handle_token", -+ g_variant_new_string(variant_string.get())); -+ variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); -+ g_variant_builder_add(&builder, "{sv}", "handle_token", -+ g_variant_new_string(variant_string.get())); -+ -+ portal_handle_ = PrepareSignalHandle(connection_, variant_string.get()); -+ session_request_signal_id_ = SetupRequestResponseSignal( -+ portal_handle_.c_str(), OnSessionRequestResponseSignal); -+ -+ RTC_LOG(LS_INFO) << "Screen cast session requested."; -+ g_dbus_proxy_call(proxy_, "CreateSession", g_variant_new("(a{sv})", &builder), -+ G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, -+ reinterpret_cast(OnSessionRequested), -+ this); -+} -+ -+// static -+void ScreenCastPortal::OnSessionRequested(GDBusProxy* proxy, -+ GAsyncResult* result, -+ gpointer user_data) { -+ ScreenCastPortal* that = static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ Scoped error; -+ Scoped variant( -+ g_dbus_proxy_call_finish(proxy, result, error.receive())); -+ if (!variant) { -+ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) -+ return; -+ RTC_LOG(LS_ERROR) << "Failed to create a screen cast session: " -+ << error->message; -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ RTC_LOG(LS_INFO) << "Initializing the screen cast session."; -+ -+ Scoped handle; -+ g_variant_get_child(variant.get(), 0, "o", &handle); -+ if (!handle) { -+ RTC_LOG(LS_ERROR) << "Failed to initialize the screen cast session."; -+ if (that->session_request_signal_id_) { -+ g_dbus_connection_signal_unsubscribe(that->connection_, -+ that->session_request_signal_id_); -+ that->session_request_signal_id_ = 0; -+ } -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ -+ RTC_LOG(LS_INFO) << "Subscribing to the screen cast session."; -+} -+ -+// static -+void ScreenCastPortal::OnSessionRequestResponseSignal( -+ GDBusConnection* connection, -+ const char* sender_name, -+ const char* object_path, -+ const char* interface_name, -+ const char* signal_name, -+ GVariant* parameters, -+ gpointer user_data) { -+ ScreenCastPortal* that = static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ RTC_LOG(LS_INFO) -+ << "Received response for the screen cast session subscription."; -+ -+ uint32_t portal_response; -+ Scoped response_data; -+ g_variant_get(parameters, "(u@a{sv})", &portal_response, -+ response_data.receive()); -+ Scoped session_handle( -+ g_variant_lookup_value(response_data.get(), "session_handle", nullptr)); -+ that->session_handle_ = g_variant_dup_string(session_handle.get(), nullptr); -+ -+ if (that->session_handle_.empty() || portal_response) { -+ RTC_LOG(LS_ERROR) -+ << "Failed to request the screen cast session subscription."; -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ -+ that->session_closed_signal_id_ = g_dbus_connection_signal_subscribe( -+ that->connection_, kDesktopBusName, kSessionInterfaceName, "Closed", -+ that->session_handle_.c_str(), /*arg0=*/nullptr, G_DBUS_SIGNAL_FLAGS_NONE, -+ OnSessionClosedSignal, that, /*user_data_free_func=*/nullptr); -+ -+ that->SourcesRequest(); -+} -+ -+// static -+void ScreenCastPortal::OnSessionClosedSignal(GDBusConnection* connection, -+ const char* sender_name, -+ const char* object_path, -+ const char* interface_name, -+ const char* signal_name, -+ GVariant* parameters, -+ gpointer user_data) { -+ ScreenCastPortal* that = static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ RTC_LOG(LS_INFO) << "Received closed signal from session."; -+ -+ that->notifier_->OnScreenCastSessionClosed(); -+ -+ // Unsubscribe from the signal and free the session handle to avoid calling -+ // Session::Close from the destructor since it's already closed -+ g_dbus_connection_signal_unsubscribe(that->connection_, -+ that->session_closed_signal_id_); -+} -+ -+void ScreenCastPortal::SourcesRequest() { -+ GVariantBuilder builder; -+ Scoped variant_string; -+ -+ g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); -+ // We want to record monitor content. -+ g_variant_builder_add( -+ &builder, "{sv}", "types", -+ g_variant_new_uint32(static_cast(capture_source_type_))); -+ // We don't want to allow selection of multiple sources. -+ g_variant_builder_add(&builder, "{sv}", "multiple", -+ g_variant_new_boolean(false)); -+ -+ Scoped variant( -+ g_dbus_proxy_get_cached_property(proxy_, "AvailableCursorModes")); -+ if (variant.get()) { -+ uint32_t modes = 0; -+ g_variant_get(variant.get(), "u", &modes); -+ // Make request only if this mode is advertised by the portal -+ // implementation. -+ if (modes & static_cast(cursor_mode_)) { -+ g_variant_builder_add( -+ &builder, "{sv}", "cursor_mode", -+ g_variant_new_uint32(static_cast(cursor_mode_))); -+ } -+ } -+ -+ variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); -+ g_variant_builder_add(&builder, "{sv}", "handle_token", -+ g_variant_new_string(variant_string.get())); -+ -+ sources_handle_ = PrepareSignalHandle(connection_, variant_string.get()); -+ sources_request_signal_id_ = SetupRequestResponseSignal( -+ sources_handle_.c_str(), OnSourcesRequestResponseSignal); -+ -+ RTC_LOG(LS_INFO) << "Requesting sources from the screen cast session."; -+ g_dbus_proxy_call( -+ proxy_, "SelectSources", -+ g_variant_new("(oa{sv})", session_handle_.c_str(), &builder), -+ G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, -+ reinterpret_cast(OnSourcesRequested), this); -+} -+ -+// static -+void ScreenCastPortal::OnSourcesRequested(GDBusProxy* proxy, -+ GAsyncResult* result, -+ gpointer user_data) { -+ ScreenCastPortal* that = static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ Scoped error; -+ Scoped variant( -+ g_dbus_proxy_call_finish(proxy, result, error.receive())); -+ if (!variant) { -+ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) -+ return; -+ RTC_LOG(LS_ERROR) << "Failed to request the sources: " << error->message; -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ -+ RTC_LOG(LS_INFO) << "Sources requested from the screen cast session."; -+ -+ Scoped handle; -+ g_variant_get_child(variant.get(), 0, "o", handle.receive()); -+ if (!handle) { -+ RTC_LOG(LS_ERROR) << "Failed to initialize the screen cast session."; -+ if (that->sources_request_signal_id_) { -+ g_dbus_connection_signal_unsubscribe(that->connection_, -+ that->sources_request_signal_id_); -+ that->sources_request_signal_id_ = 0; -+ } -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ -+ RTC_LOG(LS_INFO) << "Subscribed to sources signal."; -+} -+ -+// static -+void ScreenCastPortal::OnSourcesRequestResponseSignal( -+ GDBusConnection* connection, -+ const char* sender_name, -+ const char* object_path, -+ const char* interface_name, -+ const char* signal_name, -+ GVariant* parameters, -+ gpointer user_data) { -+ ScreenCastPortal* that = static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ RTC_LOG(LS_INFO) << "Received sources signal from session."; -+ -+ uint32_t portal_response; -+ g_variant_get(parameters, "(u@a{sv})", &portal_response, nullptr); -+ if (portal_response) { -+ RTC_LOG(LS_ERROR) -+ << "Failed to select sources for the screen cast session."; -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ -+ that->StartRequest(); -+} -+ -+void ScreenCastPortal::StartRequest() { -+ GVariantBuilder builder; -+ Scoped variant_string; -+ -+ g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); -+ variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); -+ g_variant_builder_add(&builder, "{sv}", "handle_token", -+ g_variant_new_string(variant_string.get())); -+ -+ start_handle_ = PrepareSignalHandle(connection_, variant_string.get()); -+ start_request_signal_id_ = SetupRequestResponseSignal( -+ start_handle_.c_str(), OnStartRequestResponseSignal); -+ -+ // "Identifier for the application window", this is Wayland, so not "x11:...". -+ const char parent_window[] = ""; -+ -+ RTC_LOG(LS_INFO) << "Starting the screen cast session."; -+ g_dbus_proxy_call(proxy_, "Start", -+ g_variant_new("(osa{sv})", session_handle_.c_str(), -+ parent_window, &builder), -+ G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, -+ reinterpret_cast(OnStartRequested), -+ this); -+} -+ -+// static -+void ScreenCastPortal::OnStartRequested(GDBusProxy* proxy, -+ GAsyncResult* result, -+ gpointer user_data) { -+ ScreenCastPortal* that = static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ Scoped error; -+ Scoped variant( -+ g_dbus_proxy_call_finish(proxy, result, error.receive())); -+ if (!variant) { -+ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) -+ return; -+ RTC_LOG(LS_ERROR) << "Failed to start the screen cast session: " -+ << error->message; -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ -+ RTC_LOG(LS_INFO) << "Initializing the start of the screen cast session."; -+ -+ Scoped handle; -+ g_variant_get_child(variant.get(), 0, "o", handle.receive()); -+ if (!handle) { -+ RTC_LOG(LS_ERROR) -+ << "Failed to initialize the start of the screen cast session."; -+ if (that->start_request_signal_id_) { -+ g_dbus_connection_signal_unsubscribe(that->connection_, -+ that->start_request_signal_id_); -+ that->start_request_signal_id_ = 0; -+ } -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ -+ RTC_LOG(LS_INFO) << "Subscribed to the start signal."; -+} -+ -+// static -+void ScreenCastPortal::OnStartRequestResponseSignal(GDBusConnection* connection, -+ const char* sender_name, -+ const char* object_path, -+ const char* interface_name, -+ const char* signal_name, -+ GVariant* parameters, -+ gpointer user_data) { -+ ScreenCastPortal* that = static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ RTC_LOG(LS_INFO) << "Start signal received."; -+ uint32_t portal_response; -+ Scoped response_data; -+ Scoped iter; -+ g_variant_get(parameters, "(u@a{sv})", &portal_response, -+ response_data.receive()); -+ if (portal_response || !response_data) { -+ RTC_LOG(LS_ERROR) << "Failed to start the screen cast session."; -+ that->PortalFailed(static_cast(portal_response)); -+ return; -+ } -+ -+ // Array of PipeWire streams. See -+ // https://github.com/flatpak/xdg-desktop-portal/blob/master/data/org.freedesktop.portal.ScreenCast.xml -+ // documentation for . -+ if (g_variant_lookup(response_data.get(), "streams", "a(ua{sv})", -+ iter.receive())) { -+ Scoped variant; -+ -+ while (g_variant_iter_next(iter.get(), "@(ua{sv})", variant.receive())) { -+ uint32_t stream_id; -+ uint32_t type; -+ Scoped options; -+ -+ g_variant_get(variant.get(), "(u@a{sv})", &stream_id, options.receive()); -+ RTC_DCHECK(options.get()); -+ -+ if (g_variant_lookup(options.get(), "source_type", "u", &type)) { -+ that->capture_source_type_ = -+ static_cast(type); -+ } -+ -+ that->pw_stream_node_id_ = stream_id; -+ -+ break; -+ } -+ } -+ -+ that->OpenPipeWireRemote(); -+} -+ -+void ScreenCastPortal::OpenPipeWireRemote() { -+ GVariantBuilder builder; -+ g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); -+ -+ RTC_LOG(LS_INFO) << "Opening the PipeWire remote."; -+ -+ g_dbus_proxy_call_with_unix_fd_list( -+ proxy_, "OpenPipeWireRemote", -+ g_variant_new("(oa{sv})", session_handle_.c_str(), &builder), -+ G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, /*fd_list=*/nullptr, cancellable_, -+ reinterpret_cast(OnOpenPipeWireRemoteRequested), -+ this); -+} -+ -+// static -+void ScreenCastPortal::OnOpenPipeWireRemoteRequested(GDBusProxy* proxy, -+ GAsyncResult* result, -+ gpointer user_data) { -+ ScreenCastPortal* that = static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ Scoped error; -+ Scoped outlist; -+ Scoped variant(g_dbus_proxy_call_with_unix_fd_list_finish( -+ proxy, outlist.receive(), result, error.receive())); -+ if (!variant) { -+ if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) -+ return; -+ RTC_LOG(LS_ERROR) << "Failed to open the PipeWire remote: " -+ << error->message; -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ -+ int32_t index; -+ g_variant_get(variant.get(), "(h)", &index); -+ -+ that->pw_fd_ = g_unix_fd_list_get(outlist.get(), index, error.receive()); -+ -+ if (that->pw_fd_ == -1) { -+ RTC_LOG(LS_ERROR) << "Failed to get file descriptor from the list: " -+ << error->message; -+ that->PortalFailed(RequestResponse::kError); -+ return; -+ } -+ -+ that->notifier_->OnScreenCastRequestResult( -+ ScreenCastPortal::RequestResponse::kSuccess, that->pw_stream_node_id_, -+ that->pw_fd_); -+} -+ -+} // namespace webrtc -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h -new file mode 100644 -index 0000000000..7da218ed78 ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h -@@ -0,0 +1,169 @@ -+/* -+ * Copyright 2022 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#ifndef MODULES_DESKTOP_CAPTURE_LINUX_SCREENCAST_PORTAL_H_ -+#define MODULES_DESKTOP_CAPTURE_LINUX_SCREENCAST_PORTAL_H_ -+ -+#include -+ -+#include -+ -+#include "absl/types/optional.h" -+ -+namespace webrtc { -+ -+class ScreenCastPortal { -+ public: -+ // Values are set based on source type property in -+ // xdg-desktop-portal/screencast -+ // https://github.com/flatpak/xdg-desktop-portal/blob/master/data/org.freedesktop.portal.ScreenCast.xml -+ enum class CaptureSourceType : uint32_t { -+ kScreen = 0b01, -+ kWindow = 0b10, -+ kAnyScreenContent = kScreen | kWindow -+ }; -+ -+ // Values are set based on cursor mode property in -+ // xdg-desktop-portal/screencast -+ // https://github.com/flatpak/xdg-desktop-portal/blob/master/data/org.freedesktop.portal.ScreenCast.xml -+ enum class CursorMode : uint32_t { -+ // Mouse cursor will not be included in any form -+ kHidden = 0b01, -+ // Mouse cursor will be part of the screen content -+ kEmbedded = 0b10, -+ // Mouse cursor information will be send separately in form of metadata -+ kMetadata = 0b100 -+ }; -+ -+ // Interface that must be implemented by the ScreenCastPortal consumers. -+ enum class RequestResponse { -+ // Success, the request is carried out. -+ kSuccess, -+ // The user cancelled the interaction. -+ kUserCancelled, -+ // The user interaction was ended in some other way. -+ kError, -+ -+ kMaxValue = kError -+ }; -+ -+ class PortalNotifier { -+ public: -+ virtual void OnScreenCastRequestResult(RequestResponse result, -+ uint32_t stream_node_id, -+ int fd) = 0; -+ virtual void OnScreenCastSessionClosed() = 0; -+ -+ protected: -+ PortalNotifier() = default; -+ virtual ~PortalNotifier() = default; -+ }; -+ -+ explicit ScreenCastPortal(CaptureSourceType source_type, -+ PortalNotifier* notifier); -+ ~ScreenCastPortal(); -+ -+ // Initialize ScreenCastPortal with series of DBus calls where we try to -+ // obtain all the required information, like PipeWire file descriptor and -+ // PipeWire stream node ID. -+ // -+ // The observer will return whether the communication with xdg-desktop-portal -+ // was successful and only then you will be able to get all the required -+ // information in order to continue working with PipeWire. -+ void Start(); -+ -+ private: -+ PortalNotifier* notifier_; -+ -+ // A PipeWire stream ID of stream we will be connecting to -+ uint32_t pw_stream_node_id_ = 0; -+ // A file descriptor of PipeWire socket -+ int pw_fd_ = -1; -+ -+ CaptureSourceType capture_source_type_ = -+ ScreenCastPortal::CaptureSourceType::kScreen; -+ -+ CursorMode cursor_mode_ = ScreenCastPortal::CursorMode::kMetadata; -+ -+ GDBusConnection* connection_ = nullptr; -+ GDBusProxy* proxy_ = nullptr; -+ GCancellable* cancellable_ = nullptr; -+ std::string portal_handle_; -+ std::string session_handle_; -+ std::string sources_handle_; -+ std::string start_handle_; -+ guint session_request_signal_id_ = 0; -+ guint sources_request_signal_id_ = 0; -+ guint start_request_signal_id_ = 0; -+ guint session_closed_signal_id_ = 0; -+ -+ void PortalFailed(RequestResponse result); -+ -+ uint32_t SetupRequestResponseSignal(const char* object_path, -+ GDBusSignalCallback callback); -+ -+ static void OnProxyRequested(GObject* object, -+ GAsyncResult* result, -+ gpointer user_data); -+ -+ static std::string PrepareSignalHandle(GDBusConnection* connection, -+ const char* token); -+ -+ void SessionRequest(); -+ static void OnSessionRequested(GDBusProxy* proxy, -+ GAsyncResult* result, -+ gpointer user_data); -+ static void OnSessionRequestResponseSignal(GDBusConnection* connection, -+ const char* sender_name, -+ const char* object_path, -+ const char* interface_name, -+ const char* signal_name, -+ GVariant* parameters, -+ gpointer user_data); -+ static void OnSessionClosedSignal(GDBusConnection* connection, -+ const char* sender_name, -+ const char* object_path, -+ const char* interface_name, -+ const char* signal_name, -+ GVariant* parameters, -+ gpointer user_data); -+ void SourcesRequest(); -+ static void OnSourcesRequested(GDBusProxy* proxy, -+ GAsyncResult* result, -+ gpointer user_data); -+ static void OnSourcesRequestResponseSignal(GDBusConnection* connection, -+ const char* sender_name, -+ const char* object_path, -+ const char* interface_name, -+ const char* signal_name, -+ GVariant* parameters, -+ gpointer user_data); -+ -+ void StartRequest(); -+ static void OnStartRequested(GDBusProxy* proxy, -+ GAsyncResult* result, -+ gpointer user_data); -+ static void OnStartRequestResponseSignal(GDBusConnection* connection, -+ const char* sender_name, -+ const char* object_path, -+ const char* interface_name, -+ const char* signal_name, -+ GVariant* parameters, -+ gpointer user_data); -+ -+ void OpenPipeWireRemote(); -+ static void OnOpenPipeWireRemoteRequested(GDBusProxy* proxy, -+ GAsyncResult* result, -+ gpointer user_data); -+}; -+ -+} // namespace webrtc -+ -+#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCREENCAST_PORTAL_H_ -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc -new file mode 100644 -index 0000000000..04284ebcb7 ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc -@@ -0,0 +1,892 @@ -+/* -+ * Copyright 2022 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#include "modules/desktop_capture/linux/shared_screencast_stream.h" -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include "absl/memory/memory.h" -+#include "modules/desktop_capture/linux/egl_dmabuf.h" -+#include "modules/desktop_capture/screen_capture_frame_queue.h" -+#include "rtc_base/checks.h" -+#include "rtc_base/logging.h" -+#include "rtc_base/sanitizer.h" -+#include "rtc_base/string_encode.h" -+#include "rtc_base/string_to_number.h" -+#include "rtc_base/synchronization/mutex.h" -+ -+#if defined(WEBRTC_DLOPEN_PIPEWIRE) -+#include "modules/desktop_capture/linux/pipewire_stubs.h" -+using modules_desktop_capture_linux_wayland::InitializeStubs; -+using modules_desktop_capture_linux_wayland::kModuleDrm; -+using modules_desktop_capture_linux_wayland::kModulePipewire; -+using modules_desktop_capture_linux_wayland::StubPathMap; -+#endif // defined(WEBRTC_DLOPEN_PIPEWIRE) -+ -+namespace webrtc { -+ -+const int kBytesPerPixel = 4; -+ -+#if defined(WEBRTC_DLOPEN_PIPEWIRE) -+const char kPipeWireLib[] = "libpipewire-0.3.so.0"; -+const char kDrmLib[] = "libdrm.so.2"; -+#endif -+ -+#if !PW_CHECK_VERSION(0, 3, 29) -+#define SPA_POD_PROP_FLAG_MANDATORY (1u << 3) -+#endif -+#if !PW_CHECK_VERSION(0, 3, 33) -+#define SPA_POD_PROP_FLAG_DONT_FIXATE (1u << 4) -+#endif -+ -+constexpr int kCursorBpp = 4; -+constexpr int CursorMetaSize(int w, int h) { -+ return (sizeof(struct spa_meta_cursor) + sizeof(struct spa_meta_bitmap) + -+ w * h * kCursorBpp); -+} -+ -+struct PipeWireVersion { -+ int major = 0; -+ int minor = 0; -+ int micro = 0; -+}; -+ -+constexpr PipeWireVersion kDmaBufMinVersion = {0, 3, 24}; -+constexpr PipeWireVersion kDmaBufModifierMinVersion = {0, 3, 33}; -+constexpr PipeWireVersion kDropSingleModifierMinVersion = {0, 3, 40}; -+ -+PipeWireVersion ParsePipeWireVersion(const char* version) { -+ std::vector parsed_version; -+ rtc::split(version, '.', &parsed_version); -+ -+ if (parsed_version.size() != 3) { -+ return {}; -+ } -+ -+ absl::optional major = rtc::StringToNumber(parsed_version.at(0)); -+ absl::optional minor = rtc::StringToNumber(parsed_version.at(1)); -+ absl::optional micro = rtc::StringToNumber(parsed_version.at(2)); -+ -+ // Return invalid version if we failed to parse it -+ if (!major || !minor || !micro) { -+ return {0, 0, 0}; -+ } -+ -+ return {major.value(), micro.value(), micro.value()}; -+} -+ -+spa_pod* BuildFormat(spa_pod_builder* builder, -+ uint32_t format, -+ const std::vector& modifiers) { -+ bool first = true; -+ spa_pod_frame frames[2]; -+ spa_rectangle pw_min_screen_bounds = spa_rectangle{1, 1}; -+ spa_rectangle pw_max_screen_bounds = spa_rectangle{UINT32_MAX, UINT32_MAX}; -+ -+ spa_pod_builder_push_object(builder, &frames[0], SPA_TYPE_OBJECT_Format, -+ SPA_PARAM_EnumFormat); -+ spa_pod_builder_add(builder, SPA_FORMAT_mediaType, -+ SPA_POD_Id(SPA_MEDIA_TYPE_video), 0); -+ spa_pod_builder_add(builder, SPA_FORMAT_mediaSubtype, -+ SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw), 0); -+ spa_pod_builder_add(builder, SPA_FORMAT_VIDEO_format, SPA_POD_Id(format), 0); -+ -+ if (modifiers.size()) { -+ if (modifiers.size() == 1 && modifiers[0] == DRM_FORMAT_MOD_INVALID) { -+ spa_pod_builder_prop(builder, SPA_FORMAT_VIDEO_modifier, -+ SPA_POD_PROP_FLAG_MANDATORY); -+ spa_pod_builder_long(builder, modifiers[0]); -+ } else { -+ spa_pod_builder_prop( -+ builder, SPA_FORMAT_VIDEO_modifier, -+ SPA_POD_PROP_FLAG_MANDATORY | SPA_POD_PROP_FLAG_DONT_FIXATE); -+ spa_pod_builder_push_choice(builder, &frames[1], SPA_CHOICE_Enum, 0); -+ -+ // modifiers from the array -+ for (int64_t val : modifiers) { -+ spa_pod_builder_long(builder, val); -+ // Add the first modifier twice as the very first value is the default -+ // option -+ if (first) { -+ spa_pod_builder_long(builder, val); -+ first = false; -+ } -+ } -+ spa_pod_builder_pop(builder, &frames[1]); -+ } -+ } -+ -+ spa_pod_builder_add( -+ builder, SPA_FORMAT_VIDEO_size, -+ SPA_POD_CHOICE_RANGE_Rectangle( -+ &pw_min_screen_bounds, &pw_min_screen_bounds, &pw_max_screen_bounds), -+ 0); -+ -+ return static_cast(spa_pod_builder_pop(builder, &frames[0])); -+} -+ -+class PipeWireThreadLoopLock { -+ public: -+ explicit PipeWireThreadLoopLock(pw_thread_loop* loop) : loop_(loop) { -+ pw_thread_loop_lock(loop_); -+ } -+ ~PipeWireThreadLoopLock() { pw_thread_loop_unlock(loop_); } -+ -+ private: -+ pw_thread_loop* const loop_; -+}; -+ -+class ScopedBuf { -+ public: -+ ScopedBuf() {} -+ ScopedBuf(uint8_t* map, int map_size, int fd) -+ : map_(map), map_size_(map_size), fd_(fd) {} -+ ~ScopedBuf() { -+ if (map_ != MAP_FAILED) { -+ munmap(map_, map_size_); -+ } -+ } -+ -+ explicit operator bool() { return map_ != MAP_FAILED; } -+ -+ void initialize(uint8_t* map, int map_size, int fd) { -+ map_ = map; -+ map_size_ = map_size; -+ fd_ = fd; -+ } -+ -+ uint8_t* get() { return map_; } -+ -+ protected: -+ uint8_t* map_ = static_cast(MAP_FAILED); -+ int map_size_; -+ int fd_; -+}; -+ -+class SharedScreenCastStreamPrivate { -+ public: -+ SharedScreenCastStreamPrivate(); -+ ~SharedScreenCastStreamPrivate(); -+ -+ bool StartScreenCastStream(uint32_t stream_node_id, int fd); -+ void StopScreenCastStream(); -+ std::unique_ptr CaptureFrame(); -+ std::unique_ptr CaptureCursor(); -+ DesktopVector CaptureCursorPosition(); -+ -+ private: -+ uint32_t pw_stream_node_id_ = 0; -+ int pw_fd_ = -1; -+ -+ DesktopSize desktop_size_ = {}; -+ DesktopSize video_size_; -+ -+ webrtc::Mutex queue_lock_; -+ ScreenCaptureFrameQueue queue_ -+ RTC_GUARDED_BY(&queue_lock_); -+ std::unique_ptr mouse_cursor_; -+ DesktopVector mouse_cursor_position_ = DesktopVector(-1, -1); -+ -+ int64_t modifier_; -+ std::unique_ptr egl_dmabuf_; -+ // List of modifiers we query as supported by the graphics card/driver -+ std::vector modifiers_; -+ -+ // PipeWire types -+ struct pw_context* pw_context_ = nullptr; -+ struct pw_core* pw_core_ = nullptr; -+ struct pw_stream* pw_stream_ = nullptr; -+ struct pw_thread_loop* pw_main_loop_ = nullptr; -+ struct spa_source* renegotiate_ = nullptr; -+ -+ spa_hook spa_core_listener_; -+ spa_hook spa_stream_listener_; -+ -+ // A number used to verify all previous methods and the resulting -+ // events have been handled. -+ int server_version_sync_ = 0; -+ // Version of the running PipeWire server we communicate with -+ PipeWireVersion pw_server_version_; -+ // Version of the library used to run our code -+ PipeWireVersion pw_client_version_; -+ -+ // event handlers -+ pw_core_events pw_core_events_ = {}; -+ pw_stream_events pw_stream_events_ = {}; -+ -+ struct spa_video_info_raw spa_video_format_; -+ -+ void ProcessBuffer(pw_buffer* buffer); -+ void ConvertRGBxToBGRx(uint8_t* frame, uint32_t size); -+ -+ // PipeWire callbacks -+ static void OnCoreError(void* data, -+ uint32_t id, -+ int seq, -+ int res, -+ const char* message); -+ static void OnCoreDone(void* user_data, uint32_t id, int seq); -+ static void OnCoreInfo(void* user_data, const pw_core_info* info); -+ static void OnStreamParamChanged(void* data, -+ uint32_t id, -+ const struct spa_pod* format); -+ static void OnStreamStateChanged(void* data, -+ pw_stream_state old_state, -+ pw_stream_state state, -+ const char* error_message); -+ static void OnStreamProcess(void* data); -+ // This will be invoked in case we fail to process DMA-BUF PW buffer using -+ // negotiated stream parameters (modifier). We will drop the modifier we -+ // failed to use and try to use a different one or fallback to shared memory -+ // buffers. -+ static void OnRenegotiateFormat(void* data, uint64_t); -+}; -+ -+bool operator>=(const PipeWireVersion& current_pw_version, -+ const PipeWireVersion& required_pw_version) { -+ if (!current_pw_version.major && !current_pw_version.minor && -+ !current_pw_version.micro) { -+ return false; -+ } -+ -+ return std::tie(current_pw_version.major, current_pw_version.minor, -+ current_pw_version.micro) >= -+ std::tie(required_pw_version.major, required_pw_version.minor, -+ required_pw_version.micro); -+} -+ -+bool operator<=(const PipeWireVersion& current_pw_version, -+ const PipeWireVersion& required_pw_version) { -+ if (!current_pw_version.major && !current_pw_version.minor && -+ !current_pw_version.micro) { -+ return false; -+ } -+ -+ return std::tie(current_pw_version.major, current_pw_version.minor, -+ current_pw_version.micro) <= -+ std::tie(required_pw_version.major, required_pw_version.minor, -+ required_pw_version.micro); -+} -+ -+void SharedScreenCastStreamPrivate::OnCoreError(void* data, -+ uint32_t id, -+ int seq, -+ int res, -+ const char* message) { -+ SharedScreenCastStreamPrivate* that = -+ static_cast(data); -+ RTC_DCHECK(that); -+ -+ RTC_LOG(LS_ERROR) << "PipeWire remote error: " << message; -+} -+ -+void SharedScreenCastStreamPrivate::OnCoreInfo(void* data, -+ const pw_core_info* info) { -+ SharedScreenCastStreamPrivate* stream = -+ static_cast(data); -+ RTC_DCHECK(stream); -+ -+ stream->pw_server_version_ = ParsePipeWireVersion(info->version); -+} -+ -+void SharedScreenCastStreamPrivate::OnCoreDone(void* data, -+ uint32_t id, -+ int seq) { -+ const SharedScreenCastStreamPrivate* stream = -+ static_cast(data); -+ RTC_DCHECK(stream); -+ -+ if (id == PW_ID_CORE && stream->server_version_sync_ == seq) { -+ pw_thread_loop_signal(stream->pw_main_loop_, false); -+ } -+} -+ -+// static -+void SharedScreenCastStreamPrivate::OnStreamStateChanged( -+ void* data, -+ pw_stream_state old_state, -+ pw_stream_state state, -+ const char* error_message) { -+ SharedScreenCastStreamPrivate* that = -+ static_cast(data); -+ RTC_DCHECK(that); -+ -+ switch (state) { -+ case PW_STREAM_STATE_ERROR: -+ RTC_LOG(LS_ERROR) << "PipeWire stream state error: " << error_message; -+ break; -+ case PW_STREAM_STATE_PAUSED: -+ case PW_STREAM_STATE_STREAMING: -+ case PW_STREAM_STATE_UNCONNECTED: -+ case PW_STREAM_STATE_CONNECTING: -+ break; -+ } -+} -+ -+// static -+void SharedScreenCastStreamPrivate::OnStreamParamChanged( -+ void* data, -+ uint32_t id, -+ const struct spa_pod* format) { -+ SharedScreenCastStreamPrivate* that = -+ static_cast(data); -+ RTC_DCHECK(that); -+ -+ RTC_LOG(LS_INFO) << "PipeWire stream format changed."; -+ if (!format || id != SPA_PARAM_Format) { -+ return; -+ } -+ -+ spa_format_video_raw_parse(format, &that->spa_video_format_); -+ -+ auto width = that->spa_video_format_.size.width; -+ auto height = that->spa_video_format_.size.height; -+ auto stride = SPA_ROUND_UP_N(width * kBytesPerPixel, 4); -+ auto size = height * stride; -+ -+ that->desktop_size_ = DesktopSize(width, height); -+ -+ uint8_t buffer[1024] = {}; -+ auto builder = spa_pod_builder{buffer, sizeof(buffer)}; -+ -+ // Setup buffers and meta header for new format. -+ -+ // When SPA_FORMAT_VIDEO_modifier is present we can use DMA-BUFs as -+ // the server announces support for it. -+ // See https://github.com/PipeWire/pipewire/blob/master/doc/dma-buf.dox -+ const bool has_modifier = -+ spa_pod_find_prop(format, nullptr, SPA_FORMAT_VIDEO_modifier); -+ that->modifier_ = -+ has_modifier ? that->spa_video_format_.modifier : DRM_FORMAT_MOD_INVALID; -+ std::vector params; -+ const int buffer_types = -+ has_modifier || (that->pw_server_version_ >= kDmaBufMinVersion) -+ ? (1 << SPA_DATA_DmaBuf) | (1 << SPA_DATA_MemFd) | -+ (1 << SPA_DATA_MemPtr) -+ : (1 << SPA_DATA_MemFd) | (1 << SPA_DATA_MemPtr); -+ -+ params.push_back(reinterpret_cast(spa_pod_builder_add_object( -+ &builder, SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers, -+ SPA_PARAM_BUFFERS_size, SPA_POD_Int(size), SPA_PARAM_BUFFERS_stride, -+ SPA_POD_Int(stride), SPA_PARAM_BUFFERS_buffers, -+ SPA_POD_CHOICE_RANGE_Int(8, 1, 32), SPA_PARAM_BUFFERS_dataType, -+ SPA_POD_CHOICE_FLAGS_Int(buffer_types)))); -+ params.push_back(reinterpret_cast(spa_pod_builder_add_object( -+ &builder, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, -+ SPA_POD_Id(SPA_META_Header), SPA_PARAM_META_size, -+ SPA_POD_Int(sizeof(struct spa_meta_header))))); -+ params.push_back(reinterpret_cast(spa_pod_builder_add_object( -+ &builder, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, -+ SPA_POD_Id(SPA_META_VideoCrop), SPA_PARAM_META_size, -+ SPA_POD_Int(sizeof(struct spa_meta_region))))); -+ params.push_back(reinterpret_cast(spa_pod_builder_add_object( -+ &builder, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, -+ SPA_POD_Id(SPA_META_Cursor), SPA_PARAM_META_size, -+ SPA_POD_CHOICE_RANGE_Int(CursorMetaSize(64, 64), CursorMetaSize(1, 1), -+ CursorMetaSize(384, 384))))); -+ params.push_back(reinterpret_cast(spa_pod_builder_add_object( -+ &builder, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, -+ SPA_POD_Id(SPA_META_VideoDamage), SPA_PARAM_META_size, -+ SPA_POD_CHOICE_RANGE_Int(sizeof(struct spa_meta_region) * 16, -+ sizeof(struct spa_meta_region) * 1, -+ sizeof(struct spa_meta_region) * 16)))); -+ -+ pw_stream_update_params(that->pw_stream_, params.data(), params.size()); -+} -+ -+// static -+void SharedScreenCastStreamPrivate::OnStreamProcess(void* data) { -+ SharedScreenCastStreamPrivate* that = -+ static_cast(data); -+ RTC_DCHECK(that); -+ -+ struct pw_buffer* next_buffer; -+ struct pw_buffer* buffer = nullptr; -+ -+ next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); -+ while (next_buffer) { -+ buffer = next_buffer; -+ next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); -+ -+ if (next_buffer) { -+ pw_stream_queue_buffer(that->pw_stream_, buffer); -+ } -+ } -+ -+ if (!buffer) { -+ return; -+ } -+ -+ that->ProcessBuffer(buffer); -+ -+ pw_stream_queue_buffer(that->pw_stream_, buffer); -+} -+ -+void SharedScreenCastStreamPrivate::OnRenegotiateFormat(void* data, uint64_t) { -+ SharedScreenCastStreamPrivate* that = -+ static_cast(data); -+ RTC_DCHECK(that); -+ -+ { -+ PipeWireThreadLoopLock thread_loop_lock(that->pw_main_loop_); -+ -+ uint8_t buffer[2048] = {}; -+ -+ spa_pod_builder builder = spa_pod_builder{buffer, sizeof(buffer)}; -+ -+ std::vector params; -+ -+ for (uint32_t format : {SPA_VIDEO_FORMAT_BGRA, SPA_VIDEO_FORMAT_RGBA, -+ SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_RGBx}) { -+ if (!that->modifiers_.empty()) { -+ params.push_back(BuildFormat(&builder, format, that->modifiers_)); -+ } -+ params.push_back(BuildFormat(&builder, format, /*modifiers=*/{})); -+ } -+ -+ pw_stream_update_params(that->pw_stream_, params.data(), params.size()); -+ } -+} -+ -+SharedScreenCastStreamPrivate::SharedScreenCastStreamPrivate() {} -+ -+SharedScreenCastStreamPrivate::~SharedScreenCastStreamPrivate() { -+ if (pw_main_loop_) { -+ pw_thread_loop_stop(pw_main_loop_); -+ } -+ -+ if (pw_stream_) { -+ pw_stream_destroy(pw_stream_); -+ } -+ -+ if (pw_core_) { -+ pw_core_disconnect(pw_core_); -+ } -+ -+ if (pw_context_) { -+ pw_context_destroy(pw_context_); -+ } -+ -+ if (pw_main_loop_) { -+ pw_thread_loop_destroy(pw_main_loop_); -+ } -+} -+ -+bool SharedScreenCastStreamPrivate::StartScreenCastStream( -+ uint32_t stream_node_id, -+ int fd) { -+#if defined(WEBRTC_DLOPEN_PIPEWIRE) -+ StubPathMap paths; -+ -+ // Check if the PipeWire and DRM libraries are available. -+ paths[kModulePipewire].push_back(kPipeWireLib); -+ paths[kModuleDrm].push_back(kDrmLib); -+ -+ if (!InitializeStubs(paths)) { -+ RTC_LOG(LS_ERROR) -+ << "One of following libraries is missing on your system:\n" -+ << " - PipeWire (" << kPipeWireLib << ")\n" -+ << " - drm (" << kDrmLib << ")"; -+ return false; -+ } -+#endif // defined(WEBRTC_DLOPEN_PIPEWIRE) -+ egl_dmabuf_ = std::make_unique(); -+ -+ pw_stream_node_id_ = stream_node_id; -+ pw_fd_ = fd; -+ -+ pw_init(/*argc=*/nullptr, /*argc=*/nullptr); -+ -+ pw_main_loop_ = pw_thread_loop_new("pipewire-main-loop", nullptr); -+ -+ pw_context_ = -+ pw_context_new(pw_thread_loop_get_loop(pw_main_loop_), nullptr, 0); -+ if (!pw_context_) { -+ RTC_LOG(LS_ERROR) << "Failed to create PipeWire context"; -+ return false; -+ } -+ -+ if (pw_thread_loop_start(pw_main_loop_) < 0) { -+ RTC_LOG(LS_ERROR) << "Failed to start main PipeWire loop"; -+ return false; -+ } -+ -+ pw_client_version_ = ParsePipeWireVersion(pw_get_library_version()); -+ -+ // Initialize event handlers, remote end and stream-related. -+ pw_core_events_.version = PW_VERSION_CORE_EVENTS; -+ pw_core_events_.info = &OnCoreInfo; -+ pw_core_events_.done = &OnCoreDone; -+ pw_core_events_.error = &OnCoreError; -+ -+ pw_stream_events_.version = PW_VERSION_STREAM_EVENTS; -+ pw_stream_events_.state_changed = &OnStreamStateChanged; -+ pw_stream_events_.param_changed = &OnStreamParamChanged; -+ pw_stream_events_.process = &OnStreamProcess; -+ -+ { -+ PipeWireThreadLoopLock thread_loop_lock(pw_main_loop_); -+ -+ pw_core_ = pw_context_connect_fd(pw_context_, pw_fd_, nullptr, 0); -+ if (!pw_core_) { -+ RTC_LOG(LS_ERROR) << "Failed to connect PipeWire context"; -+ return false; -+ } -+ -+ pw_core_add_listener(pw_core_, &spa_core_listener_, &pw_core_events_, this); -+ -+ // Add an event that can be later invoked by pw_loop_signal_event() -+ renegotiate_ = pw_loop_add_event(pw_thread_loop_get_loop(pw_main_loop_), -+ OnRenegotiateFormat, this); -+ -+ server_version_sync_ = -+ pw_core_sync(pw_core_, PW_ID_CORE, server_version_sync_); -+ -+ pw_thread_loop_wait(pw_main_loop_); -+ -+ pw_properties* reuseProps = -+ pw_properties_new_string("pipewire.client.reuse=1"); -+ pw_stream_ = pw_stream_new(pw_core_, "webrtc-consume-stream", reuseProps); -+ -+ if (!pw_stream_) { -+ RTC_LOG(LS_ERROR) << "Failed to create PipeWire stream"; -+ return false; -+ } -+ -+ pw_stream_add_listener(pw_stream_, &spa_stream_listener_, -+ &pw_stream_events_, this); -+ uint8_t buffer[2048] = {}; -+ -+ spa_pod_builder builder = spa_pod_builder{buffer, sizeof(buffer)}; -+ -+ std::vector params; -+ const bool has_required_pw_client_version = -+ pw_client_version_ >= kDmaBufModifierMinVersion; -+ const bool has_required_pw_server_version = -+ pw_server_version_ >= kDmaBufModifierMinVersion; -+ for (uint32_t format : {SPA_VIDEO_FORMAT_BGRA, SPA_VIDEO_FORMAT_RGBA, -+ SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_RGBx}) { -+ // Modifiers can be used with PipeWire >= 0.3.33 -+ if (has_required_pw_client_version && has_required_pw_server_version) { -+ modifiers_ = egl_dmabuf_->QueryDmaBufModifiers(format); -+ -+ if (!modifiers_.empty()) { -+ params.push_back(BuildFormat(&builder, format, modifiers_)); -+ } -+ } -+ -+ params.push_back(BuildFormat(&builder, format, /*modifiers=*/{})); -+ } -+ -+ if (pw_stream_connect(pw_stream_, PW_DIRECTION_INPUT, pw_stream_node_id_, -+ PW_STREAM_FLAG_AUTOCONNECT, params.data(), -+ params.size()) != 0) { -+ RTC_LOG(LS_ERROR) << "Could not connect receiving stream."; -+ return false; -+ } -+ -+ RTC_LOG(LS_INFO) << "PipeWire remote opened."; -+ } -+ return true; -+} -+ -+void SharedScreenCastStreamPrivate::StopScreenCastStream() { -+ if (pw_stream_) { -+ pw_stream_disconnect(pw_stream_); -+ } -+} -+ -+std::unique_ptr SharedScreenCastStreamPrivate::CaptureFrame() { -+ webrtc::MutexLock lock(&queue_lock_); -+ -+ if (!queue_.current_frame()) { -+ return std::unique_ptr{}; -+ } -+ -+ std::unique_ptr frame = queue_.current_frame()->Share(); -+ return std::move(frame); -+} -+ -+std::unique_ptr SharedScreenCastStreamPrivate::CaptureCursor() { -+ if (!mouse_cursor_) { -+ return nullptr; -+ } -+ -+ return std::move(mouse_cursor_); -+} -+ -+DesktopVector SharedScreenCastStreamPrivate::CaptureCursorPosition() { -+ return mouse_cursor_position_; -+} -+ -+void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { -+ spa_buffer* spa_buffer = buffer->buffer; -+ ScopedBuf map; -+ std::unique_ptr src_unique_ptr; -+ uint8_t* src = nullptr; -+ -+ // Try to update the mouse cursor first, because it can be the only -+ // information carried by the buffer -+ { -+ const struct spa_meta_cursor* cursor = -+ static_cast(spa_buffer_find_meta_data( -+ spa_buffer, SPA_META_Cursor, sizeof(*cursor))); -+ if (cursor && spa_meta_cursor_is_valid(cursor)) { -+ struct spa_meta_bitmap* bitmap = nullptr; -+ -+ if (cursor->bitmap_offset) -+ bitmap = -+ SPA_MEMBER(cursor, cursor->bitmap_offset, struct spa_meta_bitmap); -+ -+ if (bitmap && bitmap->size.width > 0 && bitmap->size.height > 0) { -+ const uint8_t* bitmap_data = -+ SPA_MEMBER(bitmap, bitmap->offset, uint8_t); -+ BasicDesktopFrame* mouse_frame = new BasicDesktopFrame( -+ DesktopSize(bitmap->size.width, bitmap->size.height)); -+ mouse_frame->CopyPixelsFrom( -+ bitmap_data, bitmap->stride, -+ DesktopRect::MakeWH(bitmap->size.width, bitmap->size.height)); -+ mouse_cursor_ = std::make_unique( -+ mouse_frame, DesktopVector(cursor->hotspot.x, cursor->hotspot.y)); -+ } -+ mouse_cursor_position_.set(cursor->position.x, cursor->position.y); -+ } -+ } -+ -+ if (spa_buffer->datas[0].chunk->size == 0) { -+ return; -+ } -+ -+ if (spa_buffer->datas[0].type == SPA_DATA_MemFd) { -+ map.initialize( -+ static_cast( -+ mmap(nullptr, -+ spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset, -+ PROT_READ, MAP_PRIVATE, spa_buffer->datas[0].fd, 0)), -+ spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset, -+ spa_buffer->datas[0].fd); -+ -+ if (!map) { -+ RTC_LOG(LS_ERROR) << "Failed to mmap the memory: " -+ << std::strerror(errno); -+ return; -+ } -+ -+ src = SPA_MEMBER(map.get(), spa_buffer->datas[0].mapoffset, uint8_t); -+ } else if (spa_buffer->datas[0].type == SPA_DATA_DmaBuf) { -+ const uint n_planes = spa_buffer->n_datas; -+ -+ if (!n_planes) { -+ return; -+ } -+ -+ std::vector plane_datas; -+ for (uint32_t i = 0; i < n_planes; ++i) { -+ EglDmaBuf::PlaneData data = { -+ static_cast(spa_buffer->datas[i].fd), -+ static_cast(spa_buffer->datas[i].chunk->stride), -+ static_cast(spa_buffer->datas[i].chunk->offset)}; -+ plane_datas.push_back(data); -+ } -+ -+ // When importing DMA-BUFs, we use the stride (number of bytes from one row -+ // of pixels in the buffer) provided by PipeWire. The stride from PipeWire -+ // is given by the graphics driver and some drivers might add some -+ // additional padding for memory layout optimizations so not everytime the -+ // stride is equal to BYTES_PER_PIXEL x WIDTH. This is fine, because during -+ // the import we will use OpenGL and same graphics driver so it will be able -+ // to work with the stride it provided, but later on when we work with -+ // images we get from DMA-BUFs we will need to update the stride to be equal -+ // to BYTES_PER_PIXEL x WIDTH as that's the size of the DesktopFrame we -+ // allocate for each captured frame. -+ src_unique_ptr = egl_dmabuf_->ImageFromDmaBuf( -+ desktop_size_, spa_video_format_.format, plane_datas, modifier_); -+ if (src_unique_ptr) { -+ src = src_unique_ptr.get(); -+ } else { -+ RTC_LOG(LS_ERROR) << "Dropping DMA-BUF modifier: " << modifier_ -+ << " and trying to renegotiate stream parameters"; -+ -+ if (pw_server_version_ >= kDropSingleModifierMinVersion) { -+ modifiers_.erase( -+ std::remove(modifiers_.begin(), modifiers_.end(), modifier_), -+ modifiers_.end()); -+ } else { -+ modifiers_.clear(); -+ } -+ -+ pw_loop_signal_event(pw_thread_loop_get_loop(pw_main_loop_), -+ renegotiate_); -+ return; -+ } -+ } else if (spa_buffer->datas[0].type == SPA_DATA_MemPtr) { -+ src = static_cast(spa_buffer->datas[0].data); -+ } -+ -+ if (!src) { -+ return; -+ } -+ struct spa_meta_region* video_metadata = -+ static_cast(spa_buffer_find_meta_data( -+ spa_buffer, SPA_META_VideoCrop, sizeof(*video_metadata))); -+ -+ // Video size from metadata is bigger than an actual video stream size. -+ // The metadata are wrong or we should up-scale the video...in both cases -+ // just quit now. -+ if (video_metadata && (video_metadata->region.size.width > -+ static_cast(desktop_size_.width()) || -+ video_metadata->region.size.height > -+ static_cast(desktop_size_.height()))) { -+ RTC_LOG(LS_ERROR) << "Stream metadata sizes are wrong!"; -+ return; -+ } -+ -+ // Use video metadata when video size from metadata is set and smaller than -+ // video stream size, so we need to adjust it. -+ bool video_metadata_use = false; -+ const struct spa_rectangle* video_metadata_size = -+ video_metadata ? &video_metadata->region.size : nullptr; -+ -+ if (video_metadata_size && video_metadata_size->width != 0 && -+ video_metadata_size->height != 0 && -+ (static_cast(video_metadata_size->width) < desktop_size_.width() || -+ static_cast(video_metadata_size->height) < -+ desktop_size_.height())) { -+ video_metadata_use = true; -+ } -+ -+ if (video_metadata_use) { -+ video_size_ = -+ DesktopSize(video_metadata_size->width, video_metadata_size->height); -+ } else { -+ video_size_ = desktop_size_; -+ } -+ -+ uint32_t y_offset = video_metadata_use && (video_metadata->region.position.y + -+ video_size_.height() <= -+ desktop_size_.height()) -+ ? video_metadata->region.position.y -+ : 0; -+ uint32_t x_offset = video_metadata_use && (video_metadata->region.position.x + -+ video_size_.width() <= -+ desktop_size_.width()) -+ ? video_metadata->region.position.x -+ : 0; -+ -+ const uint32_t frame_stride = kBytesPerPixel * desktop_size_.width(); -+ uint32_t stride = spa_buffer->datas[0].chunk->stride; -+ -+ if (spa_buffer->datas[0].type == SPA_DATA_DmaBuf && stride > frame_stride) { -+ // When DMA-BUFs are used, sometimes spa_buffer->stride we get might -+ // contain additional padding, but after we import the buffer, the stride -+ // we used is no longer relevant and we should just calculate it based on -+ // width. For more context see https://crbug.com/1333304. -+ stride = frame_stride; -+ } -+ -+ uint8_t* updated_src = -+ src + (stride * y_offset) + (kBytesPerPixel * x_offset); -+ -+ webrtc::MutexLock lock(&queue_lock_); -+ -+ // Move to the next frame if the current one is being used and shared -+ if (queue_.current_frame() && queue_.current_frame()->IsShared()) { -+ queue_.MoveToNextFrame(); -+ if (queue_.current_frame() && queue_.current_frame()->IsShared()) { -+ RTC_LOG(LS_WARNING) -+ << "Failed to process PipeWire buffer: no available frame"; -+ return; -+ } -+ } -+ -+ if (!queue_.current_frame() || -+ !queue_.current_frame()->size().equals(video_size_)) { -+ std::unique_ptr frame(new BasicDesktopFrame( -+ DesktopSize(video_size_.width(), video_size_.height()))); -+ queue_.ReplaceCurrentFrame(SharedDesktopFrame::Wrap(std::move(frame))); -+ } -+ -+ queue_.current_frame()->CopyPixelsFrom( -+ updated_src, (stride - (kBytesPerPixel * x_offset)), -+ DesktopRect::MakeWH(video_size_.width(), video_size_.height())); -+ -+ if (spa_video_format_.format == SPA_VIDEO_FORMAT_RGBx || -+ spa_video_format_.format == SPA_VIDEO_FORMAT_RGBA) { -+ uint8_t* tmp_src = queue_.current_frame()->data(); -+ for (int i = 0; i < video_size_.height(); ++i) { -+ // If both sides decided to go with the RGBx format we need to convert -+ // it to BGRx to match color format expected by WebRTC. -+ ConvertRGBxToBGRx(tmp_src, queue_.current_frame()->stride()); -+ tmp_src += queue_.current_frame()->stride(); -+ } -+ } -+} -+ -+void SharedScreenCastStreamPrivate::ConvertRGBxToBGRx(uint8_t* frame, -+ uint32_t size) { -+ for (uint32_t i = 0; i < size; i += 4) { -+ uint8_t tempR = frame[i]; -+ uint8_t tempB = frame[i + 2]; -+ frame[i] = tempB; -+ frame[i + 2] = tempR; -+ } -+} -+ -+SharedScreenCastStream::SharedScreenCastStream() -+ : private_(std::make_unique()) {} -+ -+SharedScreenCastStream::~SharedScreenCastStream() {} -+ -+rtc::scoped_refptr -+SharedScreenCastStream::CreateDefault() { -+ // Explicit new, to access non-public constructor. -+ return rtc::scoped_refptr(new SharedScreenCastStream()); -+} -+ -+bool SharedScreenCastStream::StartScreenCastStream(uint32_t stream_node_id, -+ int fd) { -+ return private_->StartScreenCastStream(stream_node_id, fd); -+} -+ -+void SharedScreenCastStream::StopScreenCastStream() { -+ private_->StopScreenCastStream(); -+} -+ -+std::unique_ptr SharedScreenCastStream::CaptureFrame() { -+ return private_->CaptureFrame(); -+} -+ -+std::unique_ptr SharedScreenCastStream::CaptureCursor() { -+ return private_->CaptureCursor(); -+} -+ -+absl::optional SharedScreenCastStream::CaptureCursorPosition() { -+ DesktopVector position = private_->CaptureCursorPosition(); -+ -+ // Consider only (x >= 0 and y >= 0) a valid position -+ if (position.x() < 0 || position.y() < 0) { -+ return absl::nullopt; -+ } -+ -+ return position; -+} -+ -+} // namespace webrtc -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h -new file mode 100644 -index 0000000000..72411e5607 ---- /dev/null -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h -@@ -0,0 +1,71 @@ -+/* -+ * Copyright 2022 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#ifndef MODULES_DESKTOP_CAPTURE_LINUX_SHARED_SCREENCAST_STREAM_H_ -+#define MODULES_DESKTOP_CAPTURE_LINUX_SHARED_SCREENCAST_STREAM_H_ -+ -+#include -+ -+#include "absl/types/optional.h" -+#include "api/ref_counted_base.h" -+#include "api/scoped_refptr.h" -+#include "modules/desktop_capture/desktop_frame.h" -+#include "modules/desktop_capture/mouse_cursor.h" -+#include "rtc_base/system/rtc_export.h" -+ -+namespace webrtc { -+ -+class SharedScreenCastStreamPrivate; -+ -+class RTC_EXPORT SharedScreenCastStream -+ : public rtc::RefCountedBase { -+ public: -+ static rtc::scoped_refptr CreateDefault(); -+ -+ bool StartScreenCastStream(uint32_t stream_node_id, int fd); -+ void StopScreenCastStream(); -+ -+ // Below functions return the most recent information we get from a -+ // PipeWire buffer on each Process() callback. This assumes that we -+ // managed to successfuly connect to a PipeWire stream provided by the -+ // compositor (based on stream parameters). The cursor data are obtained -+ // from spa_meta_cursor stream metadata and therefore the cursor is not -+ // part of actual screen/window frame. -+ -+ // Returns the most recent screen/window frame we obtained from PipeWire -+ // buffer. Will return an empty frame in case we didn't manage to get a frame -+ // from PipeWire buffer. -+ std::unique_ptr CaptureFrame(); -+ -+ // Returns the most recent mouse cursor image. Will return an nullptr cursor -+ // in case we didn't manage to get a cursor from PipeWire buffer. NOTE: the -+ // cursor image might not be updated on every cursor location change, but -+ // actually only when its shape changes. -+ std::unique_ptr CaptureCursor(); -+ -+ // Returns the most recent mouse cursor position. Will not return a value in -+ // case we didn't manage to get it from PipeWire buffer. -+ absl::optional CaptureCursorPosition(); -+ -+ ~SharedScreenCastStream(); -+ -+ protected: -+ SharedScreenCastStream(); -+ -+ private: -+ SharedScreenCastStream(const SharedScreenCastStream&) = delete; -+ SharedScreenCastStream& operator=(const SharedScreenCastStream&) = delete; -+ -+ std::unique_ptr private_; -+}; -+ -+} // namespace webrtc -+ -+#endif // MODULES_DESKTOP_CAPTURE_LINUX_SHARED_SCREENCAST_STREAM_H_ -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc -deleted file mode 100644 -index c43a1f1a0c..0000000000 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc -+++ /dev/null -@@ -1,28 +0,0 @@ --/* -- * Copyright 2018 The WebRTC project authors. All Rights Reserved. -- * -- * Use of this source code is governed by a BSD-style license -- * that can be found in the LICENSE file in the root of the source -- * tree. An additional intellectual property rights grant can be found -- * in the file PATENTS. All contributing project authors may -- * be found in the AUTHORS file in the root of the source tree. -- */ -- --#include "modules/desktop_capture/linux/window_capturer_pipewire.h" -- --#include -- --namespace webrtc { -- --WindowCapturerPipeWire::WindowCapturerPipeWire() -- : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::kWindow) {} --WindowCapturerPipeWire::~WindowCapturerPipeWire() {} -- --// static --std::unique_ptr --WindowCapturerPipeWire::CreateRawWindowCapturer( -- const DesktopCaptureOptions& options) { -- return std::make_unique(); --} -- --} // namespace webrtc -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h -deleted file mode 100644 -index 7f184ef299..0000000000 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h -+++ /dev/null -@@ -1,33 +0,0 @@ --/* -- * Copyright 2018 The WebRTC project authors. All Rights Reserved. -- * -- * Use of this source code is governed by a BSD-style license -- * that can be found in the LICENSE file in the root of the source -- * tree. An additional intellectual property rights grant can be found -- * in the file PATENTS. All contributing project authors may -- * be found in the AUTHORS file in the root of the source tree. -- */ -- --#ifndef MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_CAPTURER_PIPEWIRE_H_ --#define MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_CAPTURER_PIPEWIRE_H_ -- --#include -- --#include "modules/desktop_capture/linux/base_capturer_pipewire.h" -- --namespace webrtc { -- --class WindowCapturerPipeWire : public BaseCapturerPipeWire { -- public: -- WindowCapturerPipeWire(); -- ~WindowCapturerPipeWire() override; -- -- static std::unique_ptr CreateRawWindowCapturer( -- const DesktopCaptureOptions& options); -- -- RTC_DISALLOW_COPY_AND_ASSIGN(WindowCapturerPipeWire); --}; -- --} // namespace webrtc -- --#endif // MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_CAPTURER_PIPEWIRE_H_ -diff --git a/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc b/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc -index e569f6ef35..4a23ba59b2 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc -@@ -17,6 +17,10 @@ - #include "modules/desktop_capture/linux/mouse_cursor_monitor_x11.h" - #endif // defined(WEBRTC_USE_X11) - -+#if defined(WEBRTC_USE_PIPEWIRE) -+#include "modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h" -+#endif // defined(WEBRTC_USE_PIPEWIRE) -+ - namespace webrtc { - - // static -@@ -44,6 +48,13 @@ MouseCursorMonitor* MouseCursorMonitor::CreateForScreen( - // static - std::unique_ptr MouseCursorMonitor::Create( - const DesktopCaptureOptions& options) { -+#if defined(WEBRTC_USE_PIPEWIRE) -+ if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland() && -+ options.screencast_stream()) { -+ return std::make_unique(options); -+ } -+#endif // defined(WEBRTC_USE_PIPEWIRE) -+ - #if defined(WEBRTC_USE_X11) - return MouseCursorMonitorX11::Create(options); - #else diff --git a/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc b/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc -index 57a2002ac7..b44ae35292 100644 +index d9f27951302d..18840cc6d7ef 100644 --- a/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc +++ b/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc -@@ -14,7 +14,7 @@ +@@ -14,11 +14,7 @@ #include "modules/desktop_capture/desktop_capturer.h" #if defined(WEBRTC_USE_PIPEWIRE) --#include "modules/desktop_capture/linux/screen_capturer_pipewire.h" -+#include "modules/desktop_capture/linux/base_capturer_pipewire.h" +-#if defined(WEBRTC_MOZILLA_BUILD) +-#include "modules/desktop_capture/linux/wayland/moz_base_capturer_pipewire.h" +-#else + #include "modules/desktop_capture/linux/wayland/base_capturer_pipewire.h" +-#endif #endif // defined(WEBRTC_USE_PIPEWIRE) #if defined(WEBRTC_USE_X11) -@@ -28,7 +28,7 @@ std::unique_ptr DesktopCapturer::CreateRawScreenCapturer( +@@ -32,11 +28,7 @@ std::unique_ptr DesktopCapturer::CreateRawScreenCapturer( const DesktopCaptureOptions& options) { #if defined(WEBRTC_USE_PIPEWIRE) if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { -- return BaseCapturerPipeWire::CreateRawScreenCapturer(options); -+ return std::make_unique(options); +-#if defined(WEBRTC_MOZILLA_BUILD) +- return BaseCapturerPipeWire::CreateRawCapturer(options); +-#else + return std::make_unique(options); +-#endif } #endif // defined(WEBRTC_USE_PIPEWIRE) diff --git a/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc b/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc -index ed03ba0291..3bc6577ca5 100644 +index b2b1e376ada5..638c42ae3963 100644 --- a/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc +++ b/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc -@@ -14,7 +14,7 @@ +@@ -14,11 +14,7 @@ #include "modules/desktop_capture/desktop_capturer.h" #if defined(WEBRTC_USE_PIPEWIRE) --#include "modules/desktop_capture/linux/window_capturer_pipewire.h" -+#include "modules/desktop_capture/linux/base_capturer_pipewire.h" +-#if defined(WEBRTC_MOZILLA_BUILD) +-#include "modules/desktop_capture/linux/wayland/moz_base_capturer_pipewire.h" +-#else + #include "modules/desktop_capture/linux/wayland/base_capturer_pipewire.h" +-#endif #endif // defined(WEBRTC_USE_PIPEWIRE) #if defined(WEBRTC_USE_X11) -@@ -28,7 +28,7 @@ std::unique_ptr DesktopCapturer::CreateRawWindowCapturer( +@@ -32,11 +28,7 @@ std::unique_ptr DesktopCapturer::CreateRawWindowCapturer( const DesktopCaptureOptions& options) { #if defined(WEBRTC_USE_PIPEWIRE) if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { -- return BaseCapturerPipeWire::CreateRawWindowCapturer(options); -+ return std::make_unique(options); +-#if defined(WEBRTC_MOZILLA_BUILD) +- return BaseCapturerPipeWire::CreateRawCapturer(options); +-#else + return std::make_unique(options); +-#endif } #endif // defined(WEBRTC_USE_PIPEWIRE) diff --git a/third_party/moz.build b/third_party/moz.build -index 8cf6f5d9f6..33d4dc29c7 100644 +index 19ee0224b041..fab8f23c624f 100644 --- a/third_party/moz.build +++ b/third_party/moz.build -@@ -58,6 +58,12 @@ with Files("libwebrtc/**"): +@@ -61,6 +61,12 @@ with Files("libwebrtc/**"): with Files("pipewire/**"): BUG_COMPONENT = ("Core", "WebRTC") @@ -9815,7 +5691,7 @@ index 8cf6f5d9f6..33d4dc29c7 100644 BUG_COMPONENT = ('Firefox Build System', 'General') diff --git a/third_party/pipewire/libpipewire/mozpipewire.cpp b/third_party/pipewire/libpipewire/mozpipewire.cpp -index 1ecfc3196a..fbeeb8e5a7 100644 +index 1ecfc3196af1..fbeeb8e5a760 100644 --- a/third_party/pipewire/libpipewire/mozpipewire.cpp +++ b/third_party/pipewire/libpipewire/mozpipewire.cpp @@ -69,11 +69,13 @@ static int (*pw_stream_connect_fn)(struct pw_stream *stream, From beb5e712a120ceb6a2d4a94d40192abedd23a6d9 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 20 Oct 2022 20:56:13 +0200 Subject: [PATCH 128/545] no sysctl on aarch64 --- firefox-aarch64-sysctl.patch | 12 ++++++++++++ firefox.spec | 2 ++ 2 files changed, 14 insertions(+) create mode 100644 firefox-aarch64-sysctl.patch diff --git a/firefox-aarch64-sysctl.patch b/firefox-aarch64-sysctl.patch new file mode 100644 index 0000000..b4a8c67 --- /dev/null +++ b/firefox-aarch64-sysctl.patch @@ -0,0 +1,12 @@ +diff -up firefox-106.0/media/ffvpx/config_unix_aarch64.h.old firefox-106.0/media/ffvpx/config_unix_aarch64.h +--- firefox-106.0/media/ffvpx/config_unix_aarch64.h.old 2022-10-20 20:50:57.938936868 +0200 ++++ firefox-106.0/media/ffvpx/config_unix_aarch64.h 2022-10-20 20:51:05.431187713 +0200 +@@ -329,7 +329,7 @@ + #define HAVE_SLEEP 0 + #define HAVE_STRERROR_R 1 + #define HAVE_SYSCONF 1 +-#define HAVE_SYSCTL 1 ++#define HAVE_SYSCTL 0 + #define HAVE_USLEEP 1 + #define HAVE_UTGETOSTYPEFROMSTRING 0 + #define HAVE_VIRTUALALLOC 0 diff --git a/firefox.spec b/firefox.spec index ff6f588..d9ad573 100644 --- a/firefox.spec +++ b/firefox.spec @@ -219,6 +219,7 @@ Patch62: build-python.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch77: build-python-3.11.patch Patch78: firefox-i686-build.patch +Patch79: firefox-aarch64-sysctl.patch # Test patches # Generate without context by @@ -479,6 +480,7 @@ This package contains results of tests executed during build. %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch77 -p1 -b .build-python-3.11 %patch78 -p1 -b .firefox-i686 +%patch79 -p1 -b .aarch64-sysctl # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell From 041f2c131b89b44581d3b6b5bee7b9989deb90bb Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Sun, 23 Oct 2022 15:41:32 +0200 Subject: [PATCH 129/545] Updated to 106.0.1 --- .gitignore | 2 ++ firefox.spec | 24 ++++++++++++++++++------ sources | 4 ++-- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 559c5cd..6285fa9 100644 --- a/.gitignore +++ b/.gitignore @@ -538,3 +538,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-105.0.2-20221005.tar.xz /firefox-langpacks-106.0-20221014.tar.xz /firefox-106.0.source.tar.xz +/firefox-106.0.1.source.tar.xz +/firefox-langpacks-106.0.1-20221023.tar.xz diff --git a/firefox.spec b/firefox.spec index e967852..dbfff39 100644 --- a/firefox.spec +++ b/firefox.spec @@ -21,6 +21,13 @@ ExcludeArch: i686 # as the build is *very* slow. %global debug_build 0 +# rhbz#2134527 - Use portal Gtk file dialog on Fedora 37+ +%if 0%{?fedora} >= 37 +%global use_xdg_file_portal 1 +%else +%global use_xdg_file_portal 0 +%endif + %global system_nss 1 %global system_libevent 1 %global build_with_asan 0 @@ -163,13 +170,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 106.0 -Release: 2%{?pre_tag}%{?dist} +Version: 106.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20221014.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20221023.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -333,6 +340,9 @@ BuildRequires: python3-setuptools %if !0%{?flatpak} Requires: u2f-hidraw-policy %endif +%if %{?use_xdg_file_portal} +Requires: xdg-desktop-portal +%endif BuildRequires: desktop-file-utils %if !0%{?flatpak} @@ -933,9 +943,7 @@ ln -s %{_datadir}/myspell %{buildroot}%{mozappdir}/dictionaries # Default %{__cp} %{SOURCE12} %{buildroot}%{mozappdir}/browser/defaults/preferences - -# rhbz#2134527 - Use portal Gtk file dialog on Fedora 37+ -%if 0%{?fedora} > 36 +%if %{?use_xdg_file_portal} echo 'pref("widget.use-xdg-desktop-portal.file-picker", 1);' >> %{buildroot}%{mozappdir}/browser/defaults/preferences/firefox-redhat-default-prefs.js %endif @@ -1099,6 +1107,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Sun Oct 23 2022 Martin Stransky - 106.0.1-1 +- Update to 106.0.01 +- Require xdg-desktop-portal when file dialog portal is used. + * Thu Oct 20 2022 Jan Grulich - 106.0-2 - Enable upstream WebRTC code for screensharing on Wayland diff --git a/sources b/sources index 3608af1..26fd11c 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 -SHA512 (firefox-langpacks-106.0-20221014.tar.xz) = 92f90a91107f48e27bb223c3d06941eca9a68bf7d2909d6192e6413191d291cec3d92654e0d64afea691ced7954c17444d79d7231a426a989d9969955ad5c8f3 -SHA512 (firefox-106.0.source.tar.xz) = 30ced2fff818858267eaab23974f6962c5d39433ce8e26507589535fc9348f00cf5e45b90997dfb6e2361b70900547fdb0e70d741127cc6705089ea585ea2296 +SHA512 (firefox-106.0.1.source.tar.xz) = 15f5a65a69e11dd0c463b358cafb5ad0f31db93619b9ec3f89e8c5e14d4d319d9423fe4dcd0dbbcbedc1ad444dcbd8e5e30e483220277f5b550bff6124b66519 +SHA512 (firefox-langpacks-106.0.1-20221023.tar.xz) = 07b12d49a0cce77f6ffb6d1bffa230d16740570bd241f41246dc489eea2b7d1583b836760d077b8a3af5c04e80d7bcd1460dc11c73f85f0b736fb6fd87013850 From c93bbf6684daad651035b4420743f5d41e8f2288 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 24 Oct 2022 08:31:17 +0200 Subject: [PATCH 130/545] Build fix, disabled portals on F37+ --- firefox.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index dbfff39..b35cdf8 100644 --- a/firefox.spec +++ b/firefox.spec @@ -21,9 +21,10 @@ ExcludeArch: i686 # as the build is *very* slow. %global debug_build 0 -# rhbz#2134527 - Use portal Gtk file dialog on Fedora 37+ +# See rhbz#2134527 - Use portal Gtk file dialog on Fedora 37+ +# Disabled due to various issues now. %if 0%{?fedora} >= 37 -%global use_xdg_file_portal 1 +%global use_xdg_file_portal 0 %else %global use_xdg_file_portal 0 %endif @@ -417,6 +418,7 @@ BuildRequires: xorg-x11-fonts-misc %endif BuildRequires: make BuildRequires: pciutils-libs +BuildRequires: mesa-libgbm-devel Obsoletes: mozilla <= 37:1.7.13 Provides: webclient @@ -1110,6 +1112,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : * Sun Oct 23 2022 Martin Stransky - 106.0.1-1 - Update to 106.0.01 - Require xdg-desktop-portal when file dialog portal is used. +- Disabled file dialog portals on F37+ * Thu Oct 20 2022 Jan Grulich - 106.0-2 - Enable upstream WebRTC code for screensharing on Wayland From 2d32336ce6baae3b33ae5075553ad47b502a5279 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 31 Oct 2022 20:37:24 +0100 Subject: [PATCH 131/545] Update to 106.0.3 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 6285fa9..9290e2b 100644 --- a/.gitignore +++ b/.gitignore @@ -540,3 +540,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-106.0.source.tar.xz /firefox-106.0.1.source.tar.xz /firefox-langpacks-106.0.1-20221023.tar.xz +/firefox-106.0.3.source.tar.xz +/firefox-langpacks-106.0.3-20221031.tar.xz diff --git a/firefox.spec b/firefox.spec index b35cdf8..0c9e21b 100644 --- a/firefox.spec +++ b/firefox.spec @@ -171,13 +171,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 106.0.1 +Version: 106.0.3 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20221023.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20221031.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1109,8 +1109,11 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Mon Oct 31 2022 Martin Stransky - 106.0.3-1 +- Update to 106.0.3 + * Sun Oct 23 2022 Martin Stransky - 106.0.1-1 -- Update to 106.0.01 +- Update to 106.0.1 - Require xdg-desktop-portal when file dialog portal is used. - Disabled file dialog portals on F37+ diff --git a/sources b/sources index 26fd11c..6c53e9e 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 -SHA512 (firefox-106.0.1.source.tar.xz) = 15f5a65a69e11dd0c463b358cafb5ad0f31db93619b9ec3f89e8c5e14d4d319d9423fe4dcd0dbbcbedc1ad444dcbd8e5e30e483220277f5b550bff6124b66519 -SHA512 (firefox-langpacks-106.0.1-20221023.tar.xz) = 07b12d49a0cce77f6ffb6d1bffa230d16740570bd241f41246dc489eea2b7d1583b836760d077b8a3af5c04e80d7bcd1460dc11c73f85f0b736fb6fd87013850 +SHA512 (firefox-106.0.3.source.tar.xz) = 226bde9082330abe134d1726cec59b473d4d6839ea55ca20faddb901f032d89eb9d2bd5d887ccd4ba515c6b1a44817420cfee2e9f4f8a79ed46a38287083d28d +SHA512 (firefox-langpacks-106.0.3-20221031.tar.xz) = 55240ae67558cd1da37e1505164de5e614b9a6d81f9dd14158c0e2731706cb52fe3effb8ec2bcc244d0ef762f70136d8a7844463f4d678dc079232b579c5ed5b From 97a5bb3a976d64869a0ef1da84759239ccbf692d Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 4 Nov 2022 10:39:34 +0100 Subject: [PATCH 132/545] Update to 106.0.4 --- firefox.spec | 7 +++++-- sources | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/firefox.spec b/firefox.spec index 0c9e21b..92b796a 100644 --- a/firefox.spec +++ b/firefox.spec @@ -171,13 +171,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 106.0.3 +Version: 106.0.4 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20221031.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20221104.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1109,6 +1109,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Fri Nov 04 2022 Martin Stransky - 106.0.4-1 +- Update to 106.0.4 + * Mon Oct 31 2022 Martin Stransky - 106.0.3-1 - Update to 106.0.3 diff --git a/sources b/sources index 6c53e9e..0c24c82 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 -SHA512 (firefox-106.0.3.source.tar.xz) = 226bde9082330abe134d1726cec59b473d4d6839ea55ca20faddb901f032d89eb9d2bd5d887ccd4ba515c6b1a44817420cfee2e9f4f8a79ed46a38287083d28d -SHA512 (firefox-langpacks-106.0.3-20221031.tar.xz) = 55240ae67558cd1da37e1505164de5e614b9a6d81f9dd14158c0e2731706cb52fe3effb8ec2bcc244d0ef762f70136d8a7844463f4d678dc079232b579c5ed5b +SHA512 (firefox-106.0.4.source.tar.xz) = 598171d3de33fe64b662681f3455d21f788d521ad47c96309a789c20662c3a45e436d6ebb99245e1366ae3cb6c17b672179ec4b7230a86e0fbe6625b40922c5c +SHA512 (firefox-langpacks-106.0.4-20221104.tar.xz) = 02c340c144383a483dfdbf14d43e68dd8e8ae77f8b2dd10f82f1fd1128f2ce027ff42edf4e40a6cd8e975275f8f807599dd4c464226581eabda34cb06ad93e1c From caacd1dc09c84671c725a47720c95efbdd11e178 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 15 Nov 2022 12:36:03 +0100 Subject: [PATCH 133/545] Update to 107.0 --- D158747.diff | 65 --------------------------------- disable-openh264-download.patch | 17 ++++----- firefox-aarch64-sysctl.patch | 12 ------ firefox.spec | 11 +++--- 4 files changed, 13 insertions(+), 92 deletions(-) delete mode 100644 D158747.diff delete mode 100644 firefox-aarch64-sysctl.patch diff --git a/D158747.diff b/D158747.diff deleted file mode 100644 index ef1290a..0000000 --- a/D158747.diff +++ /dev/null @@ -1,65 +0,0 @@ -diff --git a/widget/gtk/ScreenHelperGTK.cpp b/widget/gtk/ScreenHelperGTK.cpp ---- a/widget/gtk/ScreenHelperGTK.cpp -+++ b/widget/gtk/ScreenHelperGTK.cpp -@@ -221,11 +221,11 @@ - refreshRate, contentsScale, defaultCssScale, dpi, - Screen::IsPseudoDisplay::No); - } - - void ScreenGetterGtk::RefreshScreens() { -- LOG_SCREEN("Refreshing screens"); -+ LOG_SCREEN("ScreenGetterGtk::RefreshScreens()"); - AutoTArray, 4> screenList; - - GdkScreen* defaultScreen = gdk_screen_get_default(); - gint numScreens = gdk_screen_get_n_monitors(defaultScreen); - LOG_SCREEN("GDK reports %d screens", numScreens); -@@ -387,16 +387,16 @@ - monitor->refresh, contentsScale, defaultCssScale, - dpi, Screen::IsPseudoDisplay::No); - } - - void ScreenGetterWayland::RefreshScreens() { -- LOG_SCREEN("Refreshing screens"); -+ LOG_SCREEN("ScreenGetterWayland::RefreshScreens()"); - AutoTArray, 4> managerScreenList; - - mScreenList.Clear(); - const gint numScreens = mMonitors.Length(); -- LOG_SCREEN("Wayland reports %d screens", numScreens); -+ LOG_SCREEN("Wayland reports %d monitors", numScreens); - for (gint i = 0; i < numScreens; i++) { - RefPtr screen = MakeScreenWayland(i); - mScreenList.AppendElement(screen); - managerScreenList.AppendElement(screen); - } -@@ -446,18 +446,27 @@ - - return -1; - } - - RefPtr ScreenGetterWayland::GetScreenForWindow(nsWindow* aWindow) { -- if (mScreenList.IsEmpty()) { -+ if (mMonitors.IsEmpty()) { - return nullptr; - } - - int monitor = GetMonitorForWindow(aWindow); - if (monitor < 0) { - return nullptr; - } -+ -+ if (mMonitors.Length() != mScreenList.Length()) { -+ // Gtk list of GtkScreens are out of sync with our monitor list. -+ // Try to refresh it now. -+ RefreshScreens(); -+ } -+ -+ MOZ_DIAGNOSTIC_ASSERT((unsigned)monitor < mScreenList.Length(), -+ "We're missing screen?"); - return mScreenList[monitor]; - } - - static bool IsGNOMECompositor() { - const char* currentDesktop = getenv("XDG_CURRENT_DESKTOP"); - diff --git a/disable-openh264-download.patch b/disable-openh264-download.patch index 028b730..01fa2da 100644 --- a/disable-openh264-download.patch +++ b/disable-openh264-download.patch @@ -1,8 +1,8 @@ -diff -up firefox-81.0/toolkit/modules/GMPInstallManager.jsm.old firefox-81.0/toolkit/modules/GMPInstallManager.jsm ---- firefox-81.0/toolkit/modules/GMPInstallManager.jsm.old 2020-09-25 10:39:04.769458703 +0200 -+++ firefox-81.0/toolkit/modules/GMPInstallManager.jsm 2020-09-25 10:39:22.038504747 +0200 +diff -up firefox-81.0/toolkit/modules/GMPInstallManager.sys.mjs.old firefox-81.0/toolkit/modules/GMPInstallManager.sys.mjs +--- firefox-81.0/toolkit/modules/GMPInstallManager.sys.mjs.old 2020-09-25 10:39:04.769458703 +0200 ++++ firefox-81.0/toolkit/modules/GMPInstallManager.sys.mjs 2020-09-25 10:39:22.038504747 +0200 @@ -54,10 +54,6 @@ function getScopedLogger(prefix) { - + const LOCAL_GMP_SOURCES = [ { - id: "gmp-gmpopenh264", @@ -21,11 +21,11 @@ diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn #endif - content/global/gmp-sources/openh264.json (gmp-sources/openh264.json) content/global/gmp-sources/widevinecdm.json (gmp-sources/widevinecdm.json) - + # Third party files -diff --git a/toolkit/modules/GMPInstallManager.jsm b/toolkit/modules/GMPInstallManager.jsm ---- a/toolkit/modules/GMPInstallManager.jsm -+++ b/toolkit/modules/GMPInstallManager.jsm +diff --git a/toolkit/modules/GMPInstallManager.sys.mjs b/toolkit/modules/GMPInstallManager.sys.mjs +--- a/toolkit/modules/GMPInstallManager.sys.mjs ++++ b/toolkit/modules/GMPInstallManager.sys.mjs @@ -238,6 +234,9 @@ GMPInstallManager.prototype = { * downloaderr, verifyerr or previouserrorencountered */ @@ -36,4 +36,3 @@ diff --git a/toolkit/modules/GMPInstallManager.jsm b/toolkit/modules/GMPInstallM if (this._deferred) { let log = getScopedLogger("GMPInstallManager.installAddon"); log.error("previous error encountered"); - diff --git a/firefox-aarch64-sysctl.patch b/firefox-aarch64-sysctl.patch deleted file mode 100644 index b4a8c67..0000000 --- a/firefox-aarch64-sysctl.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up firefox-106.0/media/ffvpx/config_unix_aarch64.h.old firefox-106.0/media/ffvpx/config_unix_aarch64.h ---- firefox-106.0/media/ffvpx/config_unix_aarch64.h.old 2022-10-20 20:50:57.938936868 +0200 -+++ firefox-106.0/media/ffvpx/config_unix_aarch64.h 2022-10-20 20:51:05.431187713 +0200 -@@ -329,7 +329,7 @@ - #define HAVE_SLEEP 0 - #define HAVE_STRERROR_R 1 - #define HAVE_SYSCONF 1 --#define HAVE_SYSCTL 1 -+#define HAVE_SYSCTL 0 - #define HAVE_USLEEP 1 - #define HAVE_UTGETOSTYPEFROMSTRING 0 - #define HAVE_VIRTUALALLOC 0 diff --git a/firefox.spec b/firefox.spec index 92b796a..12ce268 100644 --- a/firefox.spec +++ b/firefox.spec @@ -171,13 +171,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 106.0.4 +Version: 107.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20221104.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20221114.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -227,7 +227,6 @@ Patch62: build-python.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch77: build-python-3.11.patch Patch78: firefox-i686-build.patch -Patch79: firefox-aarch64-sysctl.patch # Test patches # Generate without context by @@ -252,7 +251,6 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch -Patch417: D158747.diff # PGO/LTO patches Patch600: pgo.patch @@ -492,7 +490,6 @@ This package contains results of tests executed during build. %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch77 -p1 -b .build-python-3.11 %patch78 -p1 -b .firefox-i686 -%patch79 -p1 -b .aarch64-sysctl # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -515,7 +512,6 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 -%patch417 -p1 -b .D158747 # PGO patches %if %{build_with_pgo} @@ -1109,6 +1105,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Mon Nov 14 2022 Martin Stransky - 107.0-1 +- Update to 107.0 + * Fri Nov 04 2022 Martin Stransky - 106.0.4-1 - Update to 106.0.4 From dc74e4c39e9afaac3482839d5e5bd2f08a3c427b Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 15 Nov 2022 13:01:13 +0100 Subject: [PATCH 134/545] Uploaded sources --- .gitignore | 2 ++ sources | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 9290e2b..71afeb9 100644 --- a/.gitignore +++ b/.gitignore @@ -542,3 +542,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-106.0.1-20221023.tar.xz /firefox-106.0.3.source.tar.xz /firefox-langpacks-106.0.3-20221031.tar.xz +/firefox-langpacks-107.0-20221114.tar.xz +/firefox-107.0.source.tar.xz diff --git a/sources b/sources index 0c24c82..c027db4 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 -SHA512 (firefox-106.0.4.source.tar.xz) = 598171d3de33fe64b662681f3455d21f788d521ad47c96309a789c20662c3a45e436d6ebb99245e1366ae3cb6c17b672179ec4b7230a86e0fbe6625b40922c5c -SHA512 (firefox-langpacks-106.0.4-20221104.tar.xz) = 02c340c144383a483dfdbf14d43e68dd8e8ae77f8b2dd10f82f1fd1128f2ce027ff42edf4e40a6cd8e975275f8f807599dd4c464226581eabda34cb06ad93e1c +SHA512 (firefox-langpacks-107.0-20221114.tar.xz) = 2fd489ce5256cb5a5135eb606abfe04abf94ce75bbc1bd9f8bfcd49f4cfb010128d3b2ddd998e80aec540712067ab0e9ee863d01bb0ae8ff1fb43d01cbf58f93 +SHA512 (firefox-107.0.source.tar.xz) = 4b442631079a13e1d11223499b1d8daf622d9d84b38898f9084670ddcb5738b73e0d967a5050d5930bf862aa69e8d46ebf6d751ac6d0f075a1d75ff4738bdb6e From 34d53c32b50b3416c822e231c6ec6ec4e6369f7c Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 15 Nov 2022 16:08:46 +0100 Subject: [PATCH 135/545] Updated NSS version to 3.84 --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 12ce268..0ae3e1a 100644 --- a/firefox.spec +++ b/firefox.spec @@ -126,7 +126,7 @@ ExcludeArch: i686 %if %{?system_nss} %global nspr_version 4.32 %global nspr_build_version %{nspr_version} -%global nss_version 3.82 +%global nss_version 3.84 %global nss_build_version %{nss_version} %endif From 6018070ba3c621c8cc5d07dd7a14d58c65f7ad63 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Fri, 18 Nov 2022 09:24:31 +0100 Subject: [PATCH 136/545] Reintroduced the mozilla symbols --- firefox.spec | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/firefox.spec b/firefox.spec index 0ae3e1a..99c824d 100644 --- a/firefox.spec +++ b/firefox.spec @@ -436,6 +436,23 @@ and translations langpack add-ons. %dir %{langpackdir} %endif +%if %{enable_mozilla_crashreporter} +%global moz_debug_prefix %{_prefix}/lib/debug +%global moz_debug_dir %{moz_debug_prefix}%{mozappdir} +%global uname_m %(uname -m) +%global symbols_file_name %{name}-%{version}.en-US.%{_os}-%{uname_m}.crashreporter-symbols.zip +%global symbols_file_path %{moz_debug_dir}/%{symbols_file_name} +%global _find_debuginfo_opts -p %{symbols_file_path} -o debugcrashreporter.list +%global crashreporter_pkg_name mozilla-crashreporter-%{name}-debuginfo +%package -n %{crashreporter_pkg_name} +Summary: Debugging symbols used by Mozilla's crash reporter servers +%description -n %{crashreporter_pkg_name} +This package provides debug information for Firefox, for use by +Mozilla's crash reporter servers. If you are trying to locally +debug %{name}, you want to install %{name}-debuginfo instead. +%files -n %{crashreporter_pkg_name} -f debugcrashreporter.list +%endif + %package x11 Summary: Firefox X11 launcher. Requires: %{name} @@ -610,10 +627,6 @@ echo "ac_add_options --enable-address-sanitizer" >> .mozconfig echo "ac_add_options --disable-jemalloc" >> .mozconfig %endif -%if !%{enable_mozilla_crashreporter} -echo "ac_add_options --disable-crashreporter" >> .mozconfig -%endif - # api keys full path echo "ac_add_options --with-mozilla-api-keyfile=`pwd`/mozilla-api-key" >> .mozconfig # It seems that the api key we have is for the safe browsing only @@ -932,6 +945,14 @@ ln -s %{_datadir}/hunspell %{buildroot}%{mozappdir}/dictionaries ln -s %{_datadir}/myspell %{buildroot}%{mozappdir}/dictionaries %endif +# Enable crash reporter for Firefox application +%if %{enable_mozilla_crashreporter} +sed -i -e "s/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/" %{buildroot}/%{mozappdir}/application.ini +# Add debuginfo for crash-stats.mozilla.com +%{__mkdir_p} %{buildroot}/%{moz_debug_dir} +%{__cp} objdir/dist/%{symbols_file_name} %{buildroot}/%{moz_debug_dir} +%endif + %if 0%{?run_firefox_tests} %{__mkdir_p} %{buildroot}/%{version}-%{release}/test_results %{__cp} test_results/* %{buildroot}/%{version}-%{release}/test_results @@ -1079,13 +1100,11 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_datadir}/icons/hicolor/32x32/apps/firefox.png %{_datadir}/icons/hicolor/48x48/apps/firefox.png %{_datadir}/icons/hicolor/symbolic/apps/firefox-symbolic.svg -%if %{enable_mozilla_crashreporter} %{mozappdir}/crashreporter %{mozappdir}/crashreporter.ini %{mozappdir}/minidump-analyzer %{mozappdir}/Throbber-small.gif %{mozappdir}/browser/crashreporter-override.ini -%endif %{mozappdir}/*.so %{mozappdir}/defaults/pref/channel-prefs.js %{mozappdir}/dependentlibs.list From e6bc05547aa359282a372e5bb4f569c4ff0ccfd6 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 21 Nov 2022 10:34:25 +0100 Subject: [PATCH 137/545] Temporary disable crashreporter --- firefox.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 99c824d..19df527 100644 --- a/firefox.spec +++ b/firefox.spec @@ -52,7 +52,8 @@ ExcludeArch: i686 # https://bugzilla.redhat.com/show_bug.cgi?id=1951606 %global enable_mozilla_crashreporter 0 %ifarch x86_64 %{ix86} -%global enable_mozilla_crashreporter 1 +# Temporaty disabled due to build issues +%global enable_mozilla_crashreporter 0 %endif %if %{build_with_asan} %global enable_mozilla_crashreporter 0 From 5da6e10440846729419620dba4f22929db8914f2 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Mon, 21 Nov 2022 14:04:07 +0100 Subject: [PATCH 138/545] Enabled mozilla crashreporter again --- firefox.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/firefox.spec b/firefox.spec index 19df527..94d977b 100644 --- a/firefox.spec +++ b/firefox.spec @@ -52,8 +52,7 @@ ExcludeArch: i686 # https://bugzilla.redhat.com/show_bug.cgi?id=1951606 %global enable_mozilla_crashreporter 0 %ifarch x86_64 %{ix86} -# Temporaty disabled due to build issues -%global enable_mozilla_crashreporter 0 +%global enable_mozilla_crashreporter 1 %endif %if %{build_with_asan} %global enable_mozilla_crashreporter 0 @@ -173,7 +172,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 107.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -948,6 +947,7 @@ ln -s %{_datadir}/myspell %{buildroot}%{mozappdir}/dictionaries # Enable crash reporter for Firefox application %if %{enable_mozilla_crashreporter} +./mach buildsymbols sed -i -e "s/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/" %{buildroot}/%{mozappdir}/application.ini # Add debuginfo for crash-stats.mozilla.com %{__mkdir_p} %{buildroot}/%{moz_debug_dir} @@ -1125,6 +1125,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Mon Nov 21 2022 Jan Horak - 107.0-2 +- Enabled mozilla crashreporter again + * Mon Nov 14 2022 Martin Stransky - 107.0-1 - Update to 107.0 From 9d15a20e5c058896a73fae3faa152e1c082dd869 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 22 Nov 2022 11:04:14 +0100 Subject: [PATCH 139/545] Disabled crashreporter --- firefox.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index 94d977b..cba5da3 100644 --- a/firefox.spec +++ b/firefox.spec @@ -52,7 +52,7 @@ ExcludeArch: i686 # https://bugzilla.redhat.com/show_bug.cgi?id=1951606 %global enable_mozilla_crashreporter 0 %ifarch x86_64 %{ix86} -%global enable_mozilla_crashreporter 1 +%global enable_mozilla_crashreporter 0 %endif %if %{build_with_asan} %global enable_mozilla_crashreporter 0 @@ -172,7 +172,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 107.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1125,6 +1125,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Mon Nov 21 2022 Martin Stransky - 107.0-3 +- Disabled crashreporter + * Mon Nov 21 2022 Jan Horak - 107.0-2 - Enabled mozilla crashreporter again From 4dc4e22ba397191c818dca851c1fd41fcdfcf475 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 22 Nov 2022 21:00:59 +0100 Subject: [PATCH 140/545] crashreporter fixes on second arches --- firefox.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/firefox.spec b/firefox.spec index cba5da3..afe191d 100644 --- a/firefox.spec +++ b/firefox.spec @@ -600,6 +600,10 @@ echo "ac_add_options --disable-debug" >> .mozconfig echo "ac_add_options --disable-jemalloc" >> .mozconfig %endif +%if !%{enable_mozilla_crashreporter} +echo "ac_add_options --disable-crashreporter" >> .mozconfig +%endif + %if 0%{?build_tests} echo "ac_add_options --enable-tests" >> .mozconfig %else @@ -1101,11 +1105,13 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_datadir}/icons/hicolor/32x32/apps/firefox.png %{_datadir}/icons/hicolor/48x48/apps/firefox.png %{_datadir}/icons/hicolor/symbolic/apps/firefox-symbolic.svg +%if %{enable_mozilla_crashreporter} %{mozappdir}/crashreporter %{mozappdir}/crashreporter.ini %{mozappdir}/minidump-analyzer %{mozappdir}/Throbber-small.gif %{mozappdir}/browser/crashreporter-override.ini +%endif %{mozappdir}/*.so %{mozappdir}/defaults/pref/channel-prefs.js %{mozappdir}/dependentlibs.list From 753639d3807775dfb4ac93a9fcadb6279dc6af79 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 24 Nov 2022 22:10:59 +0100 Subject: [PATCH 141/545] Added fix for mozbz#1779186 - fix VA-API playback artifacts --- D161724.diff | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++ firefox.spec | 7 ++++- 2 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 D161724.diff diff --git a/D161724.diff b/D161724.diff new file mode 100644 index 0000000..5f953c6 --- /dev/null +++ b/D161724.diff @@ -0,0 +1,79 @@ +diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h +--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h ++++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h +@@ -173,10 +173,11 @@ + + PtsCorrectionContext mPtsContext; + + DurationMap mDurationMap; + const bool mLowLatency; ++ AVDiscard mFrameDrop = AVDISCARD_DEFAULT; + + // True if we're allocating shmem for ffmpeg decode buffer. + Maybe> mIsUsingShmemBufferForDecode; + + #if LIBAVCODEC_VERSION_MAJOR >= 57 && LIBAVUTIL_VERSION_MAJOR >= 56 +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 +@@ -829,10 +829,17 @@ + packet.dts = aSample->mTimecode.ToMicroseconds(); + packet.pts = aSample->mTime.ToMicroseconds(); + packet.flags = aSample->mKeyframe ? AV_PKT_FLAG_KEY : 0; + packet.pos = aSample->mOffset; + ++ mCodecContext->skip_frame = mFrameDrop; ++#if MOZ_LOGGING ++ if (mFrameDrop == AVDISCARD_NONREF) { ++ FFMPEG_LOG("Frame skip AVDISCARD_NONREF"); ++ } ++#endif ++ + #if LIBAVCODEC_VERSION_MAJOR >= 58 + packet.duration = aSample->mDuration.ToMicroseconds(); + int res = mLib->avcodec_send_packet(mCodecContext, &packet); + if (res < 0) { + // In theory, avcodec_send_packet could sent -EAGAIN should its internal +@@ -881,10 +888,22 @@ + return MediaResult( + NS_ERROR_DOM_MEDIA_DECODE_ERR, + RESULT_DETAIL("avcodec_receive_frame error: %s", errStr)); + } + ++ if (mFrameDrop == AVDISCARD_NONREF) { ++ FFMPEG_LOG("Requested pts %" PRId64 " decoded frame pts %" PRId64, ++ packet.pts, GetFramePts(mFrame) + mFrame->pkt_duration); ++ // Switch back to default frame skip policy if we hit correct ++ // decode times. 5 ms treshold is taken from mpv project which ++ // use similar approach after seek (feed_packet() at f_decoder_wrapper.c). ++ if (packet.pts - 5000 <= GetFramePts(mFrame) + mFrame->pkt_duration) { ++ FFMPEG_LOG("Set frame drop to AVDISCARD_DEFAULT."); ++ mFrameDrop = AVDISCARD_DEFAULT; ++ } ++ } ++ + UpdateDecodeTimes(decodeStart); + decodeStart = TimeStamp::Now(); + + MediaResult rv; + # ifdef MOZ_WAYLAND_USE_VAAPI +@@ -1211,13 +1230,18 @@ + } + #endif + + RefPtr + FFmpegVideoDecoder::ProcessFlush() { ++ FFMPEG_LOG("ProcessFlush()"); + MOZ_ASSERT(mTaskQueue->IsOnCurrentThread()); + mPtsContext.Reset(); + mDurationMap.Clear(); ++ // Discard non-ref frames on HW accelerated backend to avoid decode artifacts. ++ if (IsHardwareAccelerated()) { ++ mFrameDrop = AVDISCARD_NONREF; ++ } + return FFmpegDataDecoder::ProcessFlush(); + } + + AVCodecID FFmpegVideoDecoder::GetCodecId( + const nsACString& aMimeType) { + diff --git a/firefox.spec b/firefox.spec index afe191d..e9fa216 100644 --- a/firefox.spec +++ b/firefox.spec @@ -172,7 +172,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 107.0 -Release: 3%{?pre_tag}%{?dist} +Release: 4%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -251,6 +251,7 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch +Patch416: D161724.diff # PGO/LTO patches Patch600: pgo.patch @@ -529,6 +530,7 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 +%patch416 -p1 -b .D161724 # PGO patches %if %{build_with_pgo} @@ -1131,6 +1133,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Thu Nov 24 2022 Martin Stransky - 107.0-4 +- Added fix for mozbz#1779186 - fix VA-API playback artifacts + * Mon Nov 21 2022 Martin Stransky - 107.0-3 - Disabled crashreporter From df84cc2cb65be7aca6d669d37555d342a6513eec Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 6 Dec 2022 16:25:27 +0100 Subject: [PATCH 142/545] Update to 107.0.1 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 71afeb9..7a5677a 100644 --- a/.gitignore +++ b/.gitignore @@ -544,3 +544,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-106.0.3-20221031.tar.xz /firefox-langpacks-107.0-20221114.tar.xz /firefox-107.0.source.tar.xz +/firefox-107.0.1.source.tar.xz +/firefox-langpacks-107.0.1-20221206.tar.xz diff --git a/firefox.spec b/firefox.spec index e9fa216..a4ec79f 100644 --- a/firefox.spec +++ b/firefox.spec @@ -171,13 +171,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 107.0 -Release: 4%{?pre_tag}%{?dist} +Version: 107.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20221114.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20221206.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1133,6 +1133,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue Dec 6 2022 Martin Stransky - 107.0.1-1 +- Update to 107.0.1 + * Thu Nov 24 2022 Martin Stransky - 107.0-4 - Added fix for mozbz#1779186 - fix VA-API playback artifacts diff --git a/sources b/sources index c027db4..03c9173 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 -SHA512 (firefox-langpacks-107.0-20221114.tar.xz) = 2fd489ce5256cb5a5135eb606abfe04abf94ce75bbc1bd9f8bfcd49f4cfb010128d3b2ddd998e80aec540712067ab0e9ee863d01bb0ae8ff1fb43d01cbf58f93 -SHA512 (firefox-107.0.source.tar.xz) = 4b442631079a13e1d11223499b1d8daf622d9d84b38898f9084670ddcb5738b73e0d967a5050d5930bf862aa69e8d46ebf6d751ac6d0f075a1d75ff4738bdb6e +SHA512 (firefox-107.0.1.source.tar.xz) = e57e4bfcecbcc6dbe73f23577a14a2998c8c3f3d602f85ea06f99e0974e78481b9f7bdb019cb4e9733e59f56be1407edd64a2adb7b284bb4a87b46b1e2295dea +SHA512 (firefox-langpacks-107.0.1-20221206.tar.xz) = 5d10a60937734f589b18aa648a6e3c3c65d7992d62d6781f6508d66e993ddea6fe66af4b4c78862c748ecfcbda746b982a68e0c3aa2244014508281be2545998 From 5acb5af57fed31ba5c41c9e2ab0175ca3760c7fc Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 7 Dec 2022 08:18:22 +0100 Subject: [PATCH 143/545] Updated to 108.0 --- .gitignore | 2 ++ D161724.diff | 79 ----------------------------------------------- firefox-mozconfig | 1 + firefox.spec | 15 ++++----- sources | 6 ++-- 5 files changed, 12 insertions(+), 91 deletions(-) delete mode 100644 D161724.diff diff --git a/.gitignore b/.gitignore index 7a5677a..63b0925 100644 --- a/.gitignore +++ b/.gitignore @@ -546,3 +546,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-107.0.source.tar.xz /firefox-107.0.1.source.tar.xz /firefox-langpacks-107.0.1-20221206.tar.xz +/firefox-108.0.source.tar.xz +/firefox-langpacks-108.0-20221206.tar.xz diff --git a/D161724.diff b/D161724.diff deleted file mode 100644 index 5f953c6..0000000 --- a/D161724.diff +++ /dev/null @@ -1,79 +0,0 @@ -diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h ---- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h -+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h -@@ -173,10 +173,11 @@ - - PtsCorrectionContext mPtsContext; - - DurationMap mDurationMap; - const bool mLowLatency; -+ AVDiscard mFrameDrop = AVDISCARD_DEFAULT; - - // True if we're allocating shmem for ffmpeg decode buffer. - Maybe> mIsUsingShmemBufferForDecode; - - #if LIBAVCODEC_VERSION_MAJOR >= 57 && LIBAVUTIL_VERSION_MAJOR >= 56 -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 -@@ -829,10 +829,17 @@ - packet.dts = aSample->mTimecode.ToMicroseconds(); - packet.pts = aSample->mTime.ToMicroseconds(); - packet.flags = aSample->mKeyframe ? AV_PKT_FLAG_KEY : 0; - packet.pos = aSample->mOffset; - -+ mCodecContext->skip_frame = mFrameDrop; -+#if MOZ_LOGGING -+ if (mFrameDrop == AVDISCARD_NONREF) { -+ FFMPEG_LOG("Frame skip AVDISCARD_NONREF"); -+ } -+#endif -+ - #if LIBAVCODEC_VERSION_MAJOR >= 58 - packet.duration = aSample->mDuration.ToMicroseconds(); - int res = mLib->avcodec_send_packet(mCodecContext, &packet); - if (res < 0) { - // In theory, avcodec_send_packet could sent -EAGAIN should its internal -@@ -881,10 +888,22 @@ - return MediaResult( - NS_ERROR_DOM_MEDIA_DECODE_ERR, - RESULT_DETAIL("avcodec_receive_frame error: %s", errStr)); - } - -+ if (mFrameDrop == AVDISCARD_NONREF) { -+ FFMPEG_LOG("Requested pts %" PRId64 " decoded frame pts %" PRId64, -+ packet.pts, GetFramePts(mFrame) + mFrame->pkt_duration); -+ // Switch back to default frame skip policy if we hit correct -+ // decode times. 5 ms treshold is taken from mpv project which -+ // use similar approach after seek (feed_packet() at f_decoder_wrapper.c). -+ if (packet.pts - 5000 <= GetFramePts(mFrame) + mFrame->pkt_duration) { -+ FFMPEG_LOG("Set frame drop to AVDISCARD_DEFAULT."); -+ mFrameDrop = AVDISCARD_DEFAULT; -+ } -+ } -+ - UpdateDecodeTimes(decodeStart); - decodeStart = TimeStamp::Now(); - - MediaResult rv; - # ifdef MOZ_WAYLAND_USE_VAAPI -@@ -1211,13 +1230,18 @@ - } - #endif - - RefPtr - FFmpegVideoDecoder::ProcessFlush() { -+ FFMPEG_LOG("ProcessFlush()"); - MOZ_ASSERT(mTaskQueue->IsOnCurrentThread()); - mPtsContext.Reset(); - mDurationMap.Clear(); -+ // Discard non-ref frames on HW accelerated backend to avoid decode artifacts. -+ if (IsHardwareAccelerated()) { -+ mFrameDrop = AVDISCARD_NONREF; -+ } - return FFmpegDataDecoder::ProcessFlush(); - } - - AVCodecID FFmpegVideoDecoder::GetCodecId( - const nsACString& aMimeType) { - diff --git a/firefox-mozconfig b/firefox-mozconfig index 90dfccf..3108550 100644 --- a/firefox-mozconfig +++ b/firefox-mozconfig @@ -5,6 +5,7 @@ ac_add_options --disable-strip #ac_add_options --enable-libnotify ac_add_options --enable-necko-wifi ac_add_options --disable-updater +ac_add_options --disable-elfhack ac_add_options --enable-chrome-format=omni ac_add_options --enable-pulseaudio ac_add_options --enable-av1 diff --git a/firefox.spec b/firefox.spec index a4ec79f..1620ade 100644 --- a/firefox.spec +++ b/firefox.spec @@ -73,7 +73,6 @@ ExcludeArch: i686 %global system_libvpx 0 %endif %global system_jpeg 1 -%global disable_elfhack 1 %global use_bundled_cbindgen 1 %if %{debug_build} %global release_build 0 @@ -171,7 +170,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 107.0.1 +Version: 108.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ @@ -214,7 +213,7 @@ Patch35: build-ppc-jit.patch # Fixing missing cacheFlush when JS_CODEGEN_NONE is used (s390x) Patch38: build-cacheFlush-missing.patch Patch40: build-aarch64-skia.patch -Patch41: build-disable-elfhack.patch +#Patch41: build-disable-elfhack.patch Patch44: build-arm-libopus.patch Patch46: firefox-nss-version.patch Patch47: fedora-shebang-build.patch @@ -251,7 +250,6 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch -Patch416: D161724.diff # PGO/LTO patches Patch600: pgo.patch @@ -496,9 +494,6 @@ This package contains results of tests executed during build. # ignored during this compare. %patch40 -p1 -b .aarch64-skia -%if 0%{?disable_elfhack} -%patch41 -p1 -b .disable-elfhack -%endif %patch3 -p1 -b .arm %patch44 -p1 -b .build-arm-libopus %patch47 -p1 -b .fedora-shebang @@ -506,7 +501,7 @@ This package contains results of tests executed during build. %patch53 -p1 -b .firefox-gcc-build %patch54 -p1 -b .1669639 %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 -%patch77 -p1 -b .build-python-3.11 +#%patch77 -p1 -b .build-python-3.11 %patch78 -p1 -b .firefox-i686 # Test patches @@ -530,7 +525,6 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 -%patch416 -p1 -b .D161724 # PGO patches %if %{build_with_pgo} @@ -1133,6 +1127,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue Dec 6 2022 Martin Stransky - 108.0-1 +- Update to 108.0 + * Tue Dec 6 2022 Martin Stransky - 107.0.1-1 - Update to 107.0.1 diff --git a/sources b/sources index 03c9173..9c575ee 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ -SHA512 (mochitest-python.tar.gz) = 18e1aeb475df5fbf1fe3838897d5ac2f3114aa349030713fc2be27af087b1b12f57642621b87bd052f324a7cb7fbae5f36b21502191d85692f62c8cdd69c8bf2 SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 -SHA512 (firefox-107.0.1.source.tar.xz) = e57e4bfcecbcc6dbe73f23577a14a2998c8c3f3d602f85ea06f99e0974e78481b9f7bdb019cb4e9733e59f56be1407edd64a2adb7b284bb4a87b46b1e2295dea -SHA512 (firefox-langpacks-107.0.1-20221206.tar.xz) = 5d10a60937734f589b18aa648a6e3c3c65d7992d62d6781f6508d66e993ddea6fe66af4b4c78862c748ecfcbda746b982a68e0c3aa2244014508281be2545998 +SHA512 (firefox-108.0.source.tar.xz) = 773d390442c348de0d2c1f5dbebaccf24db1d9cc4eec3a47c419cdb4c8b03e1d9cd8eabb5c60941fdd7ab83e5b6702e5e803ba00beeee76e115a1fe7306362bc +SHA512 (firefox-langpacks-108.0-20221206.tar.xz) = 8d6f080e25c6d8bb391442014290e8b18f59efd6792f811ecd5327cce05ff58ec64fb8be7e0e91e6d4bb2576e5453243ea99b767df1989e7eb346853cc50483d +SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 From de8541003015c301a9455c7b0fa37ce33a1b8256 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 7 Dec 2022 08:42:18 +0100 Subject: [PATCH 144/545] Updated nss version --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 1620ade..eb76b07 100644 --- a/firefox.spec +++ b/firefox.spec @@ -125,7 +125,7 @@ ExcludeArch: i686 %if %{?system_nss} %global nspr_version 4.32 %global nspr_build_version %{nspr_version} -%global nss_version 3.84 +%global nss_version 3.85 %global nss_build_version %{nss_version} %endif From 2abef0ec2b206c0749530e15c4dba232d3fc86d7 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 8 Dec 2022 11:05:41 +0100 Subject: [PATCH 145/545] build fixes --- D162136.diff | 57 + build-python-3.11.patch | 28 - build-python.patch | 12 - firefox-mozconfig | 2 - firefox.spec | 8 +- mozilla-1667096.patch | 37 +- python-build.patch | 4558 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 4637 insertions(+), 65 deletions(-) create mode 100644 D162136.diff delete mode 100644 build-python-3.11.patch delete mode 100644 build-python.patch create mode 100644 python-build.patch diff --git a/D162136.diff b/D162136.diff new file mode 100644 index 0000000..bbd3de1 --- /dev/null +++ b/D162136.diff @@ -0,0 +1,57 @@ +diff --git a/python/mach/mach/site.py b/python/mach/mach/site.py +--- a/python/mach/mach/site.py ++++ b/python/mach/mach/site.py +@@ -16,14 +16,14 @@ + import shutil + import site + import subprocess + import sys + import sysconfig +-from pathlib import Path + import tempfile + from contextlib import contextmanager +-from typing import Optional, Callable ++from pathlib import Path ++from typing import Callable, Optional + + from mach.requirements import ( + MachEnvRequirements, + UnexpectedFlexibleRequirementException, + ) +@@ -761,11 +761,11 @@ + self.bin_path = os.path.join(prefix, "Scripts") + self.python_path = os.path.join(self.bin_path, "python.exe") + else: + self.bin_path = os.path.join(prefix, "bin") + self.python_path = os.path.join(self.bin_path, "python") +- self.prefix = prefix ++ self.prefix = os.path.realpath(prefix) + + @functools.lru_cache(maxsize=None) + def resolve_sysconfig_packages_path(self, sysconfig_path): + # macOS uses a different default sysconfig scheme based on whether it's using the + # system Python or running in a virtualenv. +@@ -781,20 +781,16 @@ + data_path = Path(sysconfig_paths["data"]) + path = Path(sysconfig_paths[sysconfig_path]) + relative_path = path.relative_to(data_path) + + # Path to virtualenv's "site-packages" directory for provided sysconfig path +- return os.path.normpath( +- os.path.normcase(os.path.realpath(Path(self.prefix) / relative_path)) +- ) ++ return os.path.normpath(os.path.normcase(Path(self.prefix) / relative_path)) + + def site_packages_dirs(self): + dirs = [] + if sys.platform.startswith("win"): +- dirs.append( +- os.path.normpath(os.path.normcase(os.path.realpath(self.prefix))) +- ) ++ dirs.append(os.path.normpath(os.path.normcase(self.prefix))) + purelib = self.resolve_sysconfig_packages_path("purelib") + platlib = self.resolve_sysconfig_packages_path("platlib") + + dirs.append(purelib) + if platlib != purelib: + diff --git a/build-python-3.11.patch b/build-python-3.11.patch deleted file mode 100644 index 410a3da..0000000 --- a/build-python-3.11.patch +++ /dev/null @@ -1,28 +0,0 @@ -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.*?\n?)%\}[ ]*(C\+\+)?" -+ r"(?s:%\{[ ]*C\+\+[ ]*\n(?P.*?\n?)%\}[ ]*(C\+\+)?)" - t.type = "CDATA" - t.value = t.lexer.lexmatch.group("cdata") - t.lexer.lineno += t.value.count("\n") diff --git a/build-python.patch b/build-python.patch deleted file mode 100644 index eae8e18..0000000 --- a/build-python.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up firefox-95.0/build/mach_virtualenv_packages.txt.pytpatch firefox-95.0/build/mach_virtualenv_packages.txt ---- firefox-95.0/build/mach_virtualenv_packages.txt.pytpatch 2021-12-06 07:52:44.829038010 +0100 -+++ firefox-95.0/build/mach_virtualenv_packages.txt 2021-12-06 07:53:56.676269562 +0100 -@@ -1,7 +1,7 @@ - packages.txt:build/common_virtualenv_packages.txt - # glean-sdk may not be installable if a wheel isn't available - # and it has to be built from source. --pypi-optional:glean-sdk==40.0.0:telemetry will not be collected -+pypi-optional:glean-sdk>=40.0.0,<=42.2.0:telemetry will not be collected - # Mach gracefully handles the case where `psutil` is unavailable. - # We aren't (yet) able to pin packages in automation, so we have to - # support down to the oldest locally-installed version (5.4.2). diff --git a/firefox-mozconfig b/firefox-mozconfig index 3108550..676a0e0 100644 --- a/firefox-mozconfig +++ b/firefox-mozconfig @@ -2,10 +2,8 @@ ac_add_options --with-system-zlib ac_add_options --disable-strip -#ac_add_options --enable-libnotify ac_add_options --enable-necko-wifi ac_add_options --disable-updater -ac_add_options --disable-elfhack ac_add_options --enable-chrome-format=omni ac_add_options --enable-pulseaudio ac_add_options --enable-av1 diff --git a/firefox.spec b/firefox.spec index eb76b07..bdfd9da 100644 --- a/firefox.spec +++ b/firefox.spec @@ -168,6 +168,8 @@ ExcludeArch: i686 %global __provides_exclude_from ^%{mozappdir} %global __requires_exclude ^(%%(find %{buildroot}%{mozappdir} -name '*.so' | xargs -n1 basename | sort -u | paste -s -d '|' -)) +%undefine _package_note_flags + Summary: Mozilla Firefox Web browser Name: firefox Version: 108.0 @@ -213,7 +215,6 @@ Patch35: build-ppc-jit.patch # Fixing missing cacheFlush when JS_CODEGEN_NONE is used (s390x) Patch38: build-cacheFlush-missing.patch Patch40: build-aarch64-skia.patch -#Patch41: build-disable-elfhack.patch Patch44: build-arm-libopus.patch Patch46: firefox-nss-version.patch Patch47: fedora-shebang-build.patch @@ -222,10 +223,9 @@ Patch53: firefox-gcc-build.patch Patch54: mozilla-1669639.patch Patch55: firefox-testing.patch Patch61: firefox-glibc-dynstack.patch -Patch62: build-python.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch -Patch77: build-python-3.11.patch Patch78: firefox-i686-build.patch +Patch80: D162136.diff # Test patches # Generate without context by @@ -501,8 +501,8 @@ This package contains results of tests executed during build. %patch53 -p1 -b .firefox-gcc-build %patch54 -p1 -b .1669639 %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 -#%patch77 -p1 -b .build-python-3.11 %patch78 -p1 -b .firefox-i686 +%patch80 -p1 -b .D162136 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell diff --git a/mozilla-1667096.patch b/mozilla-1667096.patch index 99222fc..85dd729 100644 --- a/mozilla-1667096.patch +++ b/mozilla-1667096.patch @@ -1,6 +1,6 @@ -diff -up firefox-106.0/media/ffvpx/libavcodec/codec_list.c.1667096 firefox-106.0/media/ffvpx/libavcodec/codec_list.c ---- firefox-106.0/media/ffvpx/libavcodec/codec_list.c.1667096 2022-10-10 18:05:25.000000000 +0200 -+++ firefox-106.0/media/ffvpx/libavcodec/codec_list.c 2022-10-14 10:43:44.943418216 +0200 +diff -up firefox-108.0/media/ffvpx/libavcodec/codec_list.c.1667096 firefox-108.0/media/ffvpx/libavcodec/codec_list.c +--- firefox-108.0/media/ffvpx/libavcodec/codec_list.c.1667096 2022-12-05 21:18:00.000000000 +0100 ++++ firefox-108.0/media/ffvpx/libavcodec/codec_list.c 2022-12-08 08:29:54.513562296 +0100 @@ -11,6 +11,9 @@ static const FFCodec * const codec_list[ #if CONFIG_MP3_DECODER &ff_mp3_decoder, @@ -11,10 +11,10 @@ diff -up firefox-106.0/media/ffvpx/libavcodec/codec_list.c.1667096 firefox-106.0 #if CONFIG_LIBDAV1D &ff_libdav1d_decoder, #endif -diff -up firefox-106.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-106.0/media/ffvpx/libavcodec/libfdk-aacdec.c ---- firefox-106.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 2022-10-14 10:43:44.943418216 +0200 -+++ firefox-106.0/media/ffvpx/libavcodec/libfdk-aacdec.c 2022-10-14 13:33:42.604975843 +0200 -@@ -0,0 +1,498 @@ +diff -up firefox-108.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-108.0/media/ffvpx/libavcodec/libfdk-aacdec.c +--- firefox-108.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 2022-12-08 08:29:54.514562328 +0100 ++++ firefox-108.0/media/ffvpx/libavcodec/libfdk-aacdec.c 2022-09-03 18:20:04.000000000 +0200 +@@ -0,0 +1,497 @@ +/* + * AAC decoder wrapper + * Copyright (c) 2012 Martin Storsjo @@ -41,7 +41,7 @@ diff -up firefox-106.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-10 +#include "libavutil/opt.h" +#include "avcodec.h" +#include "codec_internal.h" -+#include "internal.h" ++#include "decode.h" + +#ifdef AACDECODER_LIB_VL0 +#define FDKDEC_VER_AT_LEAST(vl0, vl1) \ @@ -495,7 +495,7 @@ diff -up firefox-106.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-10 + +const FFCodec ff_libfdk_aac_decoder = { + .p.name = "libfdk_aac", -+ .p.long_name = NULL_IF_CONFIG_SMALL("Fraunhofer FDK AAC"), ++ CODEC_LONG_NAME("Fraunhofer FDK AAC"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_AAC, + .priv_data_size = sizeof(FDKAACDecContext), @@ -509,14 +509,13 @@ diff -up firefox-106.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-10 +#endif + , + .p.priv_class = &fdk_aac_dec_class, -+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | -+ FF_CODEC_CAP_INIT_CLEANUP, ++ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .p.wrapper_name = "libfdk", +}; -diff -up firefox-106.0/media/ffvpx/libavcodec/moz.build.1667096 firefox-106.0/media/ffvpx/libavcodec/moz.build ---- firefox-106.0/media/ffvpx/libavcodec/moz.build.1667096 2022-10-10 18:05:25.000000000 +0200 -+++ firefox-106.0/media/ffvpx/libavcodec/moz.build 2022-10-14 10:43:44.943418216 +0200 -@@ -129,6 +129,12 @@ if CONFIG['MOZ_LIBAV_FFT']: +diff -up firefox-108.0/media/ffvpx/libavcodec/moz.build.1667096 firefox-108.0/media/ffvpx/libavcodec/moz.build +--- firefox-108.0/media/ffvpx/libavcodec/moz.build.1667096 2022-12-05 21:18:01.000000000 +0100 ++++ firefox-108.0/media/ffvpx/libavcodec/moz.build 2022-12-08 08:29:54.514562328 +0100 +@@ -130,6 +130,12 @@ if CONFIG['MOZ_LIBAV_FFT']: 'avfft.c', ] @@ -529,10 +528,10 @@ diff -up firefox-106.0/media/ffvpx/libavcodec/moz.build.1667096 firefox-106.0/me SYMBOLS_FILE = 'avcodec.symbols' NoVisibilityFlags() -diff -up firefox-106.0/toolkit/moz.configure.1667096 firefox-106.0/toolkit/moz.configure ---- firefox-106.0/toolkit/moz.configure.1667096 2022-10-14 10:43:44.912417169 +0200 -+++ firefox-106.0/toolkit/moz.configure 2022-10-14 10:43:44.944418250 +0200 -@@ -2148,6 +2148,15 @@ with only_when(compile_environment): +diff -up firefox-108.0/toolkit/moz.configure.1667096 firefox-108.0/toolkit/moz.configure +--- firefox-108.0/toolkit/moz.configure.1667096 2022-12-05 21:21:08.000000000 +0100 ++++ firefox-108.0/toolkit/moz.configure 2022-12-08 08:29:54.514562328 +0100 +@@ -2134,6 +2134,15 @@ with only_when(compile_environment): set_config("MOZ_SYSTEM_PNG", True, when="--with-system-png") diff --git a/python-build.patch b/python-build.patch new file mode 100644 index 0000000..ad1d0fc --- /dev/null +++ b/python-build.patch @@ -0,0 +1,4558 @@ +diff --git a/python/l10n/mozxchannel/__init__.py b/python/l10n/mozxchannel/__init__.py +--- a/python/l10n/mozxchannel/__init__.py ++++ b/python/l10n/mozxchannel/__init__.py +@@ -46,25 +46,6 @@ def get_default_config(topsrcdir, string + "mobile/android/locales/l10n.toml", + ], + }, +- "comm-central": { +- "path": topsrcdir / "comm", +- "post-clobber": True, +- "url": "https://hg.mozilla.org/comm-central/", +- "heads": { +- # This list of repositories is ordered, starting with the +- # one with the most recent content (central) to the oldest +- # (ESR). In case two ESR versions are supported, the oldest +- # ESR goes last (e.g. esr78 goes after esr91). +- "comm": "comm-central", +- "comm-beta": "releases/comm-beta", +- "comm-esr102": "releases/comm-esr102", +- }, +- "config_files": [ +- "comm/calendar/locales/l10n.toml", +- "comm/mail/locales/l10n.toml", +- "comm/suite/locales/l10n.toml", +- ], +- }, + }, + } + +diff --git a/python/mach/docs/windows-usage-outside-mozillabuild.rst b/python/mach/docs/windows-usage-outside-mozillabuild.rst +--- a/python/mach/docs/windows-usage-outside-mozillabuild.rst ++++ b/python/mach/docs/windows-usage-outside-mozillabuild.rst +@@ -117,3 +117,8 @@ Success! + + At this point, you should be able to invoke Mach and manage your version control system outside + of MozillaBuild. ++ ++.. tip:: ++ ++ `See here `__ for a detailed guide on ++ installing and customizing a development environment with MSYS2, zsh, and Windows Terminal. +diff --git a/python/mach/mach/site.py b/python/mach/mach/site.py +--- a/python/mach/mach/site.py ++++ b/python/mach/mach/site.py +@@ -18,10 +18,10 @@ import site + import subprocess + import sys + import sysconfig +-from pathlib import Path + import tempfile + from contextlib import contextmanager +-from typing import Optional, Callable ++from pathlib import Path ++from typing import Callable, Optional + + from mach.requirements import ( + MachEnvRequirements, +@@ -663,6 +663,58 @@ class CommandSiteManager: + stderr=subprocess.STDOUT, + universal_newlines=True, + ) ++ ++ if not check_result.returncode: ++ return ++ ++ """ ++ Some commands may use the "setup.py" script of first-party modules. This causes ++ a "*.egg-info" dir to be created for that module (which pip can then detect as ++ a package). Since we add all first-party module directories to the .pthfile for ++ the "mach" venv, these first-party modules are then detected by all venvs after ++ they are created. The problem is that these .egg-info directories can become ++ stale (since if the first-party module is updated it's not guaranteed that the ++ command that runs the "setup.py" was ran afterwards). This can cause ++ incompatibilities with the pip check (since the dependencies can change between ++ different versions). ++ ++ These .egg-info dirs are in our VCS ignore lists (eg: ".hgignore") because they ++ are necessary to run some commands, so we don't want to always purge them, and we ++ also don't want to accidentally commit them. Given this, we can leverage our VCS ++ to find all the current first-party .egg-info dirs. ++ ++ If we're in the case where 'pip check' fails, then we can try purging the ++ first-party .egg-info dirs, then run the 'pip check' again afterwards. If it's ++ still failing, then we know the .egg-info dirs weren't the problem. If that's ++ the case we can just raise the error encountered, which is the same as before. ++ """ ++ ++ def _delete_ignored_egg_info_dirs(): ++ from pathlib import Path ++ ++ from mozversioncontrol import get_repository_from_env ++ ++ with get_repository_from_env() as repo: ++ ignored_file_finder = repo.get_ignored_files_finder().find( ++ "**/*.egg-info" ++ ) ++ ++ unique_egg_info_dirs = { ++ Path(found[0]).parent for found in ignored_file_finder ++ } ++ ++ for egg_info_dir in unique_egg_info_dirs: ++ shutil.rmtree(egg_info_dir) ++ ++ _delete_ignored_egg_info_dirs() ++ ++ check_result = subprocess.run( ++ [self.python_path, "-m", "pip", "check"], ++ stdout=subprocess.PIPE, ++ stderr=subprocess.STDOUT, ++ universal_newlines=True, ++ ) ++ + if check_result.returncode: + if quiet: + # If "quiet" was specified, then the "pip install" output wasn't printed +@@ -763,7 +815,7 @@ class PythonVirtualenv: + else: + self.bin_path = os.path.join(prefix, "bin") + self.python_path = os.path.join(self.bin_path, "python") +- self.prefix = prefix ++ self.prefix = os.path.realpath(prefix) + + @functools.lru_cache(maxsize=None) + def resolve_sysconfig_packages_path(self, sysconfig_path): +@@ -783,16 +835,12 @@ class PythonVirtualenv: + relative_path = path.relative_to(data_path) + + # Path to virtualenv's "site-packages" directory for provided sysconfig path +- return os.path.normpath( +- os.path.normcase(os.path.realpath(Path(self.prefix) / relative_path)) +- ) ++ return os.path.normpath(os.path.normcase(Path(self.prefix) / relative_path)) + + def site_packages_dirs(self): + dirs = [] + if sys.platform.startswith("win"): +- dirs.append( +- os.path.normpath(os.path.normcase(os.path.realpath(self.prefix))) +- ) ++ dirs.append(os.path.normpath(os.path.normcase(self.prefix))) + purelib = self.resolve_sysconfig_packages_path("purelib") + platlib = self.resolve_sysconfig_packages_path("platlib") + +diff --git a/python/mozboot/bin/bootstrap.py b/python/mozboot/bin/bootstrap.py +--- a/python/mozboot/bin/bootstrap.py ++++ b/python/mozboot/bin/bootstrap.py +@@ -11,8 +11,6 @@ + # Python environment (except that it's run with a sufficiently recent version of + # Python 3), so we are restricted to stdlib modules. + +-from __future__ import absolute_import, print_function, unicode_literals +- + import sys + + major, minor = sys.version_info[:2] +@@ -23,14 +21,13 @@ if (major < 3) or (major == 3 and minor + ) + sys.exit(1) + ++import ctypes + import os + import shutil + import subprocess + import tempfile +-import ctypes +- ++from optparse import OptionParser + from pathlib import Path +-from optparse import OptionParser + + CLONE_MERCURIAL_PULL_FAIL = """ + Failed to pull from hg.mozilla.org. +@@ -55,7 +52,7 @@ def which(name): + search_dirs = os.environ["PATH"].split(os.pathsep) + potential_names = [name] + if WINDOWS: +- potential_names.append(name + ".exe") ++ potential_names.insert(0, name + ".exe") + + for path in search_dirs: + for executable_name in potential_names: +@@ -105,7 +102,7 @@ def input_clone_dest(vcs, no_interactive + return None + + +-def hg_clone_firefox(hg: Path, dest: Path): ++def hg_clone_firefox(hg: Path, dest: Path, head_repo, head_rev): + # We create an empty repo then modify the config before adding data. + # This is necessary to ensure storage settings are optimally + # configured. +@@ -139,16 +136,28 @@ def hg_clone_firefox(hg: Path, dest: Pat + fh.write("# This is necessary to keep performance in check\n") + fh.write("maxchainlen = 10000\n") + ++ # Pulling a specific revision into an empty repository induces a lot of ++ # load on the Mercurial server, so we always pull from mozilla-unified (which, ++ # when done from an empty repository, is equivalent to a clone), and then pull ++ # the specific revision we want (if we want a specific one, otherwise we just ++ # use the "central" bookmark), at which point it will be an incremental pull, ++ # that the server can process more easily. ++ # This is the same thing that robustcheckout does on automation. + res = subprocess.call( + [str(hg), "pull", "https://hg.mozilla.org/mozilla-unified"], cwd=str(dest) + ) ++ if not res and head_repo: ++ res = subprocess.call( ++ [str(hg), "pull", head_repo, "-r", head_rev], cwd=str(dest) ++ ) + print("") + if res: + print(CLONE_MERCURIAL_PULL_FAIL % dest) + return None + +- print('updating to "central" - the development head of Gecko and Firefox') +- res = subprocess.call([str(hg), "update", "-r", "central"], cwd=str(dest)) ++ head_rev = head_rev or "central" ++ print(f'updating to "{head_rev}" - the development head of Gecko and Firefox') ++ res = subprocess.call([str(hg), "update", "-r", head_rev], cwd=str(dest)) + if res: + print( + f"error updating; you will need to `cd {dest} && hg update -r central` " +@@ -157,7 +166,7 @@ def hg_clone_firefox(hg: Path, dest: Pat + return dest + + +-def git_clone_firefox(git: Path, dest: Path, watchman: Path): ++def git_clone_firefox(git: Path, dest: Path, watchman: Path, head_repo, head_rev): + tempdir = None + cinnabar = None + env = dict(os.environ) +@@ -196,8 +205,7 @@ def git_clone_firefox(git: Path, dest: P + [ + str(git), + "clone", +- "-b", +- "bookmarks/central", ++ "--no-checkout", + "hg::https://hg.mozilla.org/mozilla-unified", + str(dest), + ], +@@ -210,6 +218,19 @@ def git_clone_firefox(git: Path, dest: P + [str(git), "config", "pull.ff", "only"], cwd=str(dest), env=env + ) + ++ if head_repo: ++ subprocess.check_call( ++ [str(git), "cinnabar", "fetch", f"hg::{head_repo}", head_rev], ++ cwd=str(dest), ++ env=env, ++ ) ++ ++ subprocess.check_call( ++ [str(git), "checkout", "FETCH_HEAD" if head_rev else "bookmarks/central"], ++ cwd=str(dest), ++ env=env, ++ ) ++ + watchman_sample = dest / ".git/hooks/fsmonitor-watchman.sample" + # Older versions of git didn't include fsmonitor-watchman.sample. + if watchman and watchman_sample.exists(): +@@ -233,12 +254,6 @@ def git_clone_firefox(git: Path, dest: P + subprocess.check_call(config_args, cwd=str(dest), env=env) + return dest + finally: +- if not cinnabar: +- print( +- "Failed to install git-cinnabar. Try performing a manual " +- "installation: https://github.com/glandium/git-cinnabar/wiki/" +- "Mozilla:-A-git-workflow-for-Gecko-development" +- ) + if tempdir: + shutil.rmtree(str(tempdir)) + +@@ -326,11 +341,15 @@ def clone(options): + add_microsoft_defender_antivirus_exclusions(dest, no_system_changes) + + print(f"Cloning Firefox {VCS_HUMAN_READABLE[vcs]} repository to {dest}") ++ ++ head_repo = os.environ.get("GECKO_HEAD_REPOSITORY") ++ head_rev = os.environ.get("GECKO_HEAD_REV") ++ + if vcs == "hg": +- return hg_clone_firefox(binary, dest) ++ return hg_clone_firefox(binary, dest, head_repo, head_rev) + else: + watchman = which("watchman") +- return git_clone_firefox(binary, dest, watchman) ++ return git_clone_firefox(binary, dest, watchman, head_repo, head_rev) + + + def bootstrap(srcdir: Path, application_choice, no_interactive, no_system_changes): +diff --git a/python/mozboot/mozboot/android.py b/python/mozboot/mozboot/android.py +--- a/python/mozboot/mozboot/android.py ++++ b/python/mozboot/mozboot/android.py +@@ -2,8 +2,6 @@ + # 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/. + +-from __future__ import absolute_import, print_function, unicode_literals +- + import errno + import json + import os +@@ -11,15 +9,16 @@ import stat + import subprocess + import sys + import time +-import requests ++from pathlib import Path + from typing import Optional, Union +-from pathlib import Path +-from tqdm import tqdm ++ ++import requests + + # We need the NDK version in multiple different places, and it's inconvenient + # to pass down the NDK version to all relevant places, so we have this global + # variable. + from mozboot.bootstrap import MOZCONFIG_SUGGESTION_TEMPLATE ++from tqdm import tqdm + + NDK_VERSION = "r21d" + CMDLINE_TOOLS_VERSION_STRING = "7.0" +@@ -74,7 +73,7 @@ output as packages are downloaded and in + + MOBILE_ANDROID_MOZCONFIG_TEMPLATE = """ + # Build GeckoView/Firefox for Android: +-ac_add_options --enable-application=mobile/android ++ac_add_options --enable-project=mobile/android + + # Targeting the following architecture. + # For regular phones, no --target is needed. +@@ -90,8 +89,7 @@ ac_add_options --enable-application=mobi + + MOBILE_ANDROID_ARTIFACT_MODE_MOZCONFIG_TEMPLATE = """ + # Build GeckoView/Firefox for Android Artifact Mode: +-ac_add_options --enable-application=mobile/android +-ac_add_options --target=arm-linux-androideabi ++ac_add_options --enable-project=mobile/android + ac_add_options --enable-artifact-builds + + {extra_lines} +@@ -162,18 +160,19 @@ def download( + download_file_path: Path, + ): + with requests.Session() as session: +- request = session.head(url) ++ request = session.head(url, allow_redirects=True) ++ request.raise_for_status() + remote_file_size = int(request.headers["content-length"]) + + if download_file_path.is_file(): + local_file_size = download_file_path.stat().st_size + + if local_file_size == remote_file_size: +- print(f"{download_file_path} already downloaded. Skipping download...") ++ print( ++ f"{download_file_path.name} already downloaded. Skipping download..." ++ ) + else: +- print( +- f"Partial download detected. Resuming download of {download_file_path}..." +- ) ++ print(f"Partial download detected. Resuming download of {url}...") + download_internal( + download_file_path, + session, +@@ -182,7 +181,7 @@ def download( + local_file_size, + ) + else: +- print(f"Downloading {download_file_path}...") ++ print(f"Downloading {url}...") + download_internal(download_file_path, session, url, remote_file_size) + + +diff --git a/python/mozboot/mozboot/archlinux.py b/python/mozboot/mozboot/archlinux.py +--- a/python/mozboot/mozboot/archlinux.py ++++ b/python/mozboot/mozboot/archlinux.py +@@ -2,120 +2,27 @@ + # 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/. + +-from __future__ import absolute_import, print_function, unicode_literals +- +-import os + import sys +-import tempfile +-import subprocess +- +-from pathlib import Path + + from mozboot.base import BaseBootstrapper + from mozboot.linux_common import LinuxBootstrapper + +-# NOTE: This script is intended to be run with a vanilla Python install. We +-# have to rely on the standard library instead of Python 2+3 helpers like +-# the six module. +-if sys.version_info < (3,): +- input = raw_input # noqa +- +- +-AUR_URL_TEMPLATE = "https://aur.archlinux.org/cgit/aur.git/snapshot/{}.tar.gz" +- + + class ArchlinuxBootstrapper(LinuxBootstrapper, BaseBootstrapper): + """Archlinux experimental bootstrapper.""" + +- SYSTEM_PACKAGES = ["base-devel", "unzip", "zip"] +- +- BROWSER_PACKAGES = [ +- "alsa-lib", +- "dbus-glib", +- "gtk3", +- "libevent", +- "libvpx", +- "libxt", +- "mime-types", +- "startup-notification", +- "gst-plugins-base-libs", +- "libpulse", +- "xorg-server-xvfb", +- "gst-libav", +- "gst-plugins-good", +- ] +- +- BROWSER_AUR_PACKAGES = [ +- "uuid", +- ] +- +- MOBILE_ANDROID_COMMON_PACKAGES = [ +- # See comment about 32 bit binaries and multilib below. +- "multilib/lib32-ncurses", +- "multilib/lib32-readline", +- "multilib/lib32-zlib", +- ] +- + def __init__(self, version, dist_id, **kwargs): + print("Using an experimental bootstrapper for Archlinux.", file=sys.stderr) + BaseBootstrapper.__init__(self, **kwargs) + +- def install_system_packages(self): +- self.pacman_install(*self.SYSTEM_PACKAGES) +- +- def install_browser_packages(self, mozconfig_builder, artifact_mode=False): +- # TODO: Figure out what not to install for artifact mode +- self.aur_install(*self.BROWSER_AUR_PACKAGES) +- self.pacman_install(*self.BROWSER_PACKAGES) +- +- def install_browser_artifact_mode_packages(self, mozconfig_builder): +- self.install_browser_packages(mozconfig_builder, artifact_mode=True) +- +- def ensure_nasm_packages(self): +- # installed via install_browser_packages +- pass +- +- def install_mobile_android_packages(self, mozconfig_builder, artifact_mode=False): +- # Multi-part process: +- # 1. System packages. +- # 2. Android SDK. Android NDK only if we are not in artifact mode. Android packages. +- +- # 1. This is hard to believe, but the Android SDK binaries are 32-bit +- # and that conflicts with 64-bit Arch installations out of the box. The +- # solution is to add the multilibs repository; unfortunately, this +- # requires manual intervention. +- try: +- self.pacman_install(*self.MOBILE_ANDROID_COMMON_PACKAGES) +- except Exception as e: +- print( +- "Failed to install all packages. The Android developer " +- "toolchain requires 32 bit binaries be enabled (see " +- "https://wiki.archlinux.org/index.php/Android). You may need to " +- "manually enable the multilib repository following the instructions " +- "at https://wiki.archlinux.org/index.php/Multilib.", +- file=sys.stderr, +- ) +- raise e +- +- # 2. Android pieces. +- super().install_mobile_android_packages( +- mozconfig_builder, artifact_mode=artifact_mode +- ) ++ def install_packages(self, packages): ++ # watchman is not available via pacman ++ packages = [p for p in packages if p != "watchman"] ++ self.pacman_install(*packages) + + def upgrade_mercurial(self, current): + self.pacman_install("mercurial") + +- def pacman_is_installed(self, package): +- command = ["pacman", "-Q", package] +- return ( +- subprocess.run( +- command, +- stdout=subprocess.DEVNULL, +- stderr=subprocess.DEVNULL, +- ).returncode +- == 0 +- ) +- + def pacman_install(self, *packages): + command = ["pacman", "-S", "--needed"] + if self.no_interactive: +@@ -124,71 +31,3 @@ class ArchlinuxBootstrapper(LinuxBootstr + command.extend(packages) + + self.run_as_root(command) +- +- def run(self, command, env=None): +- subprocess.check_call(command, stdin=sys.stdin, env=env) +- +- def download(self, uri): +- command = ["curl", "-L", "-O", uri] +- self.run(command) +- +- def unpack(self, path: Path, name, ext): +- if ext == ".gz": +- compression = "-z" +- else: +- print(f"unsupported compression extension: {ext}", file=sys.stderr) +- sys.exit(1) +- +- name = path / (name + ".tar" + ext) +- command = ["tar", "-x", compression, "-f", str(name), "-C", str(path)] +- self.run(command) +- +- def makepkg(self, name): +- command = ["makepkg", "-sri"] +- if self.no_interactive: +- command.append("--noconfirm") +- makepkg_env = os.environ.copy() +- makepkg_env["PKGDEST"] = "." +- self.run(command, env=makepkg_env) +- +- def aur_install(self, *packages): +- needed = [] +- +- for package in packages: +- if self.pacman_is_installed(package): +- print( +- f"warning: AUR package {package} is installed -- skipping", +- file=sys.stderr, +- ) +- else: +- needed.append(package) +- +- # all required AUR packages are already installed! +- if not needed: +- return +- +- path = Path(tempfile.mkdtemp(prefix="mozboot-")) +- if not self.no_interactive: +- print( +- "WARNING! This script requires to install packages from the AUR " +- "This is potentially insecure so I recommend that you carefully " +- "read each package description and check the sources." +- f"These packages will be built in {path}: " + ", ".join(needed), +- file=sys.stderr, +- ) +- choice = input("Do you want to continue? (yes/no) [no]") +- if choice != "yes": +- sys.exit(1) +- +- base_dir = Path.cwd() +- os.chdir(path) +- for name in needed: +- url = AUR_URL_TEMPLATE.format(package) +- ext = Path(url).suffix +- directory = path / name +- self.download(url) +- self.unpack(path, name, ext) +- os.chdir(directory) +- self.makepkg(name) +- +- os.chdir(base_dir) +diff --git a/python/mozboot/mozboot/base.py b/python/mozboot/mozboot/base.py +--- a/python/mozboot/mozboot/base.py ++++ b/python/mozboot/mozboot/base.py +@@ -2,25 +2,22 @@ + # 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/. + +-from __future__ import absolute_import, print_function, unicode_literals +- + import os + import re + import subprocess + import sys +- + from pathlib import Path + +-from packaging.version import Version ++from mach.util import to_optional_path, win_to_msys_path + from mozboot import rust + from mozboot.util import ( ++ MINIMUM_RUST_VERSION, + get_mach_virtualenv_binary, +- MINIMUM_RUST_VERSION, + http_download_and_save, + ) ++from mozbuild.bootstrap import bootstrap_all_toolchains_for, bootstrap_toolchain + from mozfile import which +-from mozbuild.bootstrap import bootstrap_toolchain +-from mach.util import to_optional_path, win_to_msys_path ++from packaging.version import Version + + NO_MERCURIAL = """ + Could not find Mercurial (hg) in the current shell's path. Try starting a new +@@ -143,7 +140,7 @@ ac_add_options --enable-artifact-builds + + JS_MOZCONFIG_TEMPLATE = """\ + # Build only the SpiderMonkey JS test shell +-ac_add_options --enable-application=js ++ac_add_options --enable-project=js + """ + + # Upgrade Mercurial older than this. +@@ -344,47 +341,12 @@ class BaseBootstrapper(object): + % __name__ + ) + +- def ensure_stylo_packages(self): +- """ +- Install any necessary packages needed for Stylo development. +- """ +- raise NotImplementedError( +- "%s does not yet implement ensure_stylo_packages()" % __name__ +- ) +- +- def ensure_nasm_packages(self): +- """ +- Install nasm. +- """ +- raise NotImplementedError( +- "%s does not yet implement ensure_nasm_packages()" % __name__ +- ) +- + def ensure_sccache_packages(self): + """ + Install sccache. + """ + pass + +- def ensure_node_packages(self): +- """ +- Install any necessary packages needed to supply NodeJS""" +- raise NotImplementedError( +- "%s does not yet implement ensure_node_packages()" % __name__ +- ) +- +- def ensure_fix_stacks_packages(self): +- """ +- Install fix-stacks. +- """ +- pass +- +- def ensure_minidump_stackwalk_packages(self): +- """ +- Install minidump-stackwalk. +- """ +- pass +- + def install_toolchain_static_analysis(self, toolchain_job): + clang_tools_path = self.state_dir / "clang-tools" + if not clang_tools_path.exists(): +@@ -428,9 +390,17 @@ class BaseBootstrapper(object): + + subprocess.check_call(cmd, cwd=str(install_dir)) + +- def run_as_root(self, command): ++ def auto_bootstrap(self, application): ++ args = ["--with-ccache=sccache"] ++ if application.endswith("_artifact_mode"): ++ args.append("--enable-artifact-builds") ++ application = application[: -len("_artifact_mode")] ++ args.append("--enable-project={}".format(application.replace("_", "/"))) ++ bootstrap_all_toolchains_for(args) ++ ++ def run_as_root(self, command, may_use_sudo=True): + if os.geteuid() != 0: +- if which("sudo"): ++ if may_use_sudo and which("sudo"): + command.insert(0, "sudo") + else: + command = ["su", "root", "-c", " ".join(command)] +@@ -439,107 +409,6 @@ class BaseBootstrapper(object): + + subprocess.check_call(command, stdin=sys.stdin) + +- def dnf_install(self, *packages): +- if which("dnf"): +- +- def not_installed(package): +- # We could check for "Error: No matching Packages to list", but +- # checking `dnf`s exit code is sufficent. +- # Ideally we'd invoke dnf with '--cacheonly', but there's: +- # https://bugzilla.redhat.com/show_bug.cgi?id=2030255 +- is_installed = subprocess.run( +- ["dnf", "list", "--installed", package], +- stdout=subprocess.PIPE, +- stderr=subprocess.STDOUT, +- ) +- if is_installed.returncode not in [0, 1]: +- stdout = is_installed.stdout +- raise Exception( +- f'Failed to determine whether package "{package}" is installed: "{stdout}"' +- ) +- return is_installed.returncode != 0 +- +- packages = list(filter(not_installed, packages)) +- if len(packages) == 0: +- # avoid sudo prompt (support unattended re-bootstrapping) +- return +- +- command = ["dnf", "install"] +- else: +- command = ["yum", "install"] +- +- if self.no_interactive: +- command.append("-y") +- command.extend(packages) +- +- self.run_as_root(command) +- +- def dnf_groupinstall(self, *packages): +- if which("dnf"): +- installed = subprocess.run( +- # Ideally we'd invoke dnf with '--cacheonly', but there's: +- # https://bugzilla.redhat.com/show_bug.cgi?id=2030255 +- # Ideally we'd use `--installed` instead of the undocumented +- # `installed` subcommand, but that doesn't currently work: +- # https://bugzilla.redhat.com/show_bug.cgi?id=1884616#c0 +- ["dnf", "group", "list", "installed", "--hidden"], +- universal_newlines=True, +- stdout=subprocess.PIPE, +- stderr=subprocess.STDOUT, +- ) +- if installed.returncode != 0: +- raise Exception( +- f'Failed to determine currently-installed package groups: "{installed.stdout}"' +- ) +- installed_packages = (pkg.strip() for pkg in installed.stdout.split("\n")) +- packages = list(filter(lambda p: p not in installed_packages, packages)) +- if len(packages) == 0: +- # avoid sudo prompt (support unattended re-bootstrapping) +- return +- +- command = ["dnf", "groupinstall"] +- else: +- command = ["yum", "groupinstall"] +- +- if self.no_interactive: +- command.append("-y") +- command.extend(packages) +- +- self.run_as_root(command) +- +- def dnf_update(self, *packages): +- if which("dnf"): +- command = ["dnf", "update"] +- else: +- command = ["yum", "update"] +- +- if self.no_interactive: +- command.append("-y") +- command.extend(packages) +- +- self.run_as_root(command) +- +- def apt_install(self, *packages): +- command = ["apt-get", "install"] +- if self.no_interactive: +- command.append("-y") +- command.extend(packages) +- +- self.run_as_root(command) +- +- def apt_update(self): +- command = ["apt-get", "update"] +- if self.no_interactive: +- command.append("-y") +- +- self.run_as_root(command) +- +- def apt_add_architecture(self, arch): +- command = ["dpkg", "--add-architecture"] +- command.extend(arch) +- +- self.run_as_root(command) +- + def prompt_int(self, prompt, low, high, default=None): + """Prompts the user with prompt and requires an integer between low and high. + +@@ -757,14 +626,10 @@ class BaseBootstrapper(object): + if modern: + print("Your version of Rust (%s) is new enough." % version) + +- if rustup: +- self.ensure_rust_targets(rustup, version) +- return +- +- if version: ++ elif version: + print("Your version of Rust (%s) is too old." % version) + +- if rustup: ++ if rustup and not modern: + rustup_version = self._parse_version(rustup) + if not rustup_version: + print(RUSTUP_OLD) +@@ -776,10 +641,16 @@ class BaseBootstrapper(object): + if not modern: + print(RUST_UPGRADE_FAILED % (MODERN_RUST_VERSION, after)) + sys.exit(1) +- else: ++ elif not rustup: + # No rustup. Download and run the installer. + print("Will try to install Rust.") + self.install_rust() ++ modern, version = self.is_rust_modern(cargo_bin) ++ rustup = to_optional_path( ++ which("rustup", extra_search_dirs=[str(cargo_bin)]) ++ ) ++ ++ self.ensure_rust_targets(rustup, version) + + def ensure_rust_targets(self, rustup: Path, rust_version): + """Make sure appropriate cross target libraries are installed.""" +diff --git a/python/mozboot/mozboot/bootstrap.py b/python/mozboot/mozboot/bootstrap.py +--- a/python/mozboot/mozboot/bootstrap.py ++++ b/python/mozboot/mozboot/bootstrap.py +@@ -2,48 +2,46 @@ + # 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/. + +-from __future__ import absolute_import, print_function, unicode_literals +- +-from collections import OrderedDict +- + import os + import platform + import re + import shutil +-import sys ++import stat + import subprocess ++import sys + import time +-from typing import Optional ++from collections import OrderedDict + from pathlib import Path +-from packaging.version import Version ++from typing import Optional ++ ++# Use distro package to retrieve linux platform information ++import distro ++from mach.site import MachSiteManager ++from mach.telemetry import initialize_telemetry_setting + from mach.util import ( ++ UserError, + get_state_dir, +- UserError, + to_optional_path, + to_optional_str, + win_to_msys_path, + ) +-from mach.telemetry import initialize_telemetry_setting +-from mach.site import MachSiteManager ++from mozboot.archlinux import ArchlinuxBootstrapper + from mozboot.base import MODERN_RUST_VERSION + from mozboot.centosfedora import CentOSFedoraBootstrapper +-from mozboot.opensuse import OpenSUSEBootstrapper + from mozboot.debian import DebianBootstrapper + from mozboot.freebsd import FreeBSDBootstrapper + from mozboot.gentoo import GentooBootstrapper +-from mozboot.osx import OSXBootstrapper, OSXBootstrapperLight ++from mozboot.mozconfig import MozconfigBuilder ++from mozboot.mozillabuild import MozillaBuildBootstrapper + from mozboot.openbsd import OpenBSDBootstrapper +-from mozboot.archlinux import ArchlinuxBootstrapper ++from mozboot.opensuse import OpenSUSEBootstrapper ++from mozboot.osx import OSXBootstrapper, OSXBootstrapperLight + from mozboot.solus import SolusBootstrapper + from mozboot.void import VoidBootstrapper + from mozboot.windows import WindowsBootstrapper +-from mozboot.mozillabuild import MozillaBuildBootstrapper +-from mozboot.mozconfig import MozconfigBuilder ++from mozbuild.base import MozbuildObject + from mozfile import which +-from mozbuild.base import MozbuildObject +- +-# Use distro package to retrieve linux platform information +-import distro ++from packaging.version import Version + + APPLICATION_CHOICE = """ + Note on Artifact Mode: +@@ -123,6 +121,7 @@ DEBIAN_DISTROS = ( + "devuan", + "pureos", + "deepin", ++ "tuxedo", + ) + + ADD_GIT_CINNABAR_PATH = """ +@@ -250,13 +249,11 @@ class Bootstrapper(object): + # Also install the clang static-analysis package by default + # The best place to install our packages is in the state directory + # we have. We should have created one above in non-interactive mode. +- self.instance.ensure_node_packages() +- self.instance.ensure_fix_stacks_packages() +- self.instance.ensure_minidump_stackwalk_packages() ++ self.instance.auto_bootstrap(application) ++ self.instance.install_toolchain_artifact("fix-stacks") ++ self.instance.install_toolchain_artifact("minidump-stackwalk") + if not self.instance.artifact_mode: +- self.instance.ensure_stylo_packages() + self.instance.ensure_clang_static_analysis_package() +- self.instance.ensure_nasm_packages() + self.instance.ensure_sccache_packages() + # Like 'ensure_browser_packages' or 'ensure_mobile_android_packages' + getattr(self.instance, "ensure_%s_packages" % application)() +@@ -325,7 +322,6 @@ class Bootstrapper(object): + state_dir = Path(get_state_dir()) + self.instance.state_dir = state_dir + +- hg_installed, hg_modern = self.instance.ensure_mercurial_modern() + hg = to_optional_path(which("hg")) + + # We need to enable the loading of hgrc in case extensions are +@@ -355,6 +351,10 @@ class Bootstrapper(object): + + # Possibly configure Mercurial, but not if the current checkout or repo + # type is Git. ++ hg_installed = bool(hg) ++ if checkout_type == "hg": ++ hg_installed, hg_modern = self.instance.ensure_mercurial_modern() ++ + if hg_installed and checkout_type == "hg": + if not self.instance.no_interactive: + configure_hg = self.instance.prompt_yesno(prompt=CONFIGURE_MERCURIAL) +@@ -485,8 +485,8 @@ class Bootstrapper(object): + # distutils is singled out here because some distros (namely Ubuntu) + # include it in a separate package outside of the main Python + # installation. ++ import distutils.spawn + import distutils.sysconfig +- import distutils.spawn + + assert distutils.sysconfig is not None and distutils.spawn is not None + except ImportError as e: +@@ -610,11 +610,11 @@ def current_firefox_checkout(env, hg: Op + # Just check for known-good files in the checkout, to prevent attempted + # foot-shootings. Determining a canonical git checkout of mozilla-unified + # is...complicated +- elif git_dir.exists(): ++ elif git_dir.exists() or hg_dir.exists(): + moz_configure = path / "moz.configure" + if moz_configure.exists(): + _warn_if_risky_revision(path) +- return "git", path ++ return ("git" if git_dir.exists() else "hg"), path + + if not len(path.parents): + break +@@ -639,13 +639,23 @@ def update_git_tools(git: Optional[Path] + # repository. It now only downloads prebuilt binaries, so if we are + # updating from an old setup, remove the repository and start over. + if (cinnabar_dir / ".git").exists(): +- shutil.rmtree(str(cinnabar_dir)) ++ # git sets pack files read-only, which causes problems removing ++ # them on Windows. To work around that, we use an error handler ++ # on rmtree that retries to remove the file after chmod'ing it. ++ def onerror(func, path, exc): ++ if func == os.unlink: ++ os.chmod(path, stat.S_IRWXU) ++ func(path) ++ else: ++ raise ++ ++ shutil.rmtree(str(cinnabar_dir), onerror=onerror) + + # If we already have an executable, ask it to update itself. + exists = cinnabar_exe.exists() + if exists: + try: +- subprocess.check_call([cinnabar_exe, "self-update"]) ++ subprocess.check_call([str(cinnabar_exe), "self-update"]) + except subprocess.CalledProcessError as e: + print(e) + +diff --git a/python/mozboot/mozboot/centosfedora.py b/python/mozboot/mozboot/centosfedora.py +--- a/python/mozboot/mozboot/centosfedora.py ++++ b/python/mozboot/mozboot/centosfedora.py +@@ -2,10 +2,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/. + +-from __future__ import absolute_import, print_function, unicode_literals ++import subprocess + + from mozboot.base import BaseBootstrapper + from mozboot.linux_common import LinuxBootstrapper ++from mozfile import which + + + class CentOSFedoraBootstrapper(LinuxBootstrapper, BaseBootstrapper): +@@ -16,79 +17,63 @@ class CentOSFedoraBootstrapper(LinuxBoot + self.version = int(version.split(".")[0]) + self.dist_id = dist_id + +- self.group_packages = [] +- +- self.packages = ["which"] +- +- self.browser_group_packages = ["GNOME Software Development"] +- +- self.browser_packages = [ +- "alsa-lib-devel", +- "dbus-glib-devel", +- "glibc-static", +- # Development group. +- "libstdc++-static", +- "libXt-devel", +- "pulseaudio-libs-devel", +- "gcc-c++", +- ] +- +- self.mobile_android_packages = [] +- ++ def install_packages(self, packages): ++ if self.version >= 33 and "perl" in packages: ++ packages.append("perl-FindBin") ++ # watchman is not available on centos/rocky + if self.distro in ("centos", "rocky"): +- self.group_packages += ["Development Tools"] +- +- self.packages += ["curl-devel"] +- +- self.browser_packages += ["gtk3-devel"] +- +- if self.version == 6: +- self.group_packages += [ +- "Development Libraries", +- "GNOME Software Development", +- ] +- +- else: +- self.packages += ["redhat-rpm-config"] +- +- self.browser_group_packages = ["Development Tools"] +- +- elif self.distro == "fedora": +- self.group_packages += ["C Development Tools and Libraries"] +- +- self.packages += [ +- "redhat-rpm-config", +- "watchman", +- ] +- if self.version >= 33: +- self.packages.append("perl-FindBin") +- +- self.mobile_android_packages += ["ncurses-compat-libs"] +- +- self.packages += ["python3-devel"] +- +- def install_system_packages(self): +- self.dnf_groupinstall(*self.group_packages) +- self.dnf_install(*self.packages) +- +- def install_browser_packages(self, mozconfig_builder, artifact_mode=False): +- # TODO: Figure out what not to install for artifact mode +- self.dnf_groupinstall(*self.browser_group_packages) +- self.dnf_install(*self.browser_packages) +- +- def install_browser_artifact_mode_packages(self, mozconfig_builder): +- self.install_browser_packages(mozconfig_builder, artifact_mode=True) +- +- def install_mobile_android_packages(self, mozconfig_builder, artifact_mode=False): +- # Install Android specific packages. +- self.dnf_install(*self.mobile_android_packages) +- +- super().install_mobile_android_packages( +- mozconfig_builder, artifact_mode=artifact_mode +- ) ++ packages = [p for p in packages if p != "watchman"] ++ self.dnf_install(*packages) + + def upgrade_mercurial(self, current): + if current is None: + self.dnf_install("mercurial") + else: + self.dnf_update("mercurial") ++ ++ def dnf_install(self, *packages): ++ if which("dnf"): ++ ++ def not_installed(package): ++ # We could check for "Error: No matching Packages to list", but ++ # checking `dnf`s exit code is sufficent. ++ # Ideally we'd invoke dnf with '--cacheonly', but there's: ++ # https://bugzilla.redhat.com/show_bug.cgi?id=2030255 ++ is_installed = subprocess.run( ++ ["dnf", "list", "--installed", package], ++ stdout=subprocess.PIPE, ++ stderr=subprocess.STDOUT, ++ ) ++ if is_installed.returncode not in [0, 1]: ++ stdout = is_installed.stdout ++ raise Exception( ++ f'Failed to determine whether package "{package}" is installed: "{stdout}"' ++ ) ++ return is_installed.returncode != 0 ++ ++ packages = list(filter(not_installed, packages)) ++ if len(packages) == 0: ++ # avoid sudo prompt (support unattended re-bootstrapping) ++ return ++ ++ command = ["dnf", "install"] ++ else: ++ command = ["yum", "install"] ++ ++ if self.no_interactive: ++ command.append("-y") ++ command.extend(packages) ++ ++ self.run_as_root(command) ++ ++ def dnf_update(self, *packages): ++ if which("dnf"): ++ command = ["dnf", "update"] ++ else: ++ command = ["yum", "update"] ++ ++ if self.no_interactive: ++ command.append("-y") ++ command.extend(packages) ++ ++ self.run_as_root(command) +diff --git a/python/mozboot/mozboot/debian.py b/python/mozboot/mozboot/debian.py +--- a/python/mozboot/mozboot/debian.py ++++ b/python/mozboot/mozboot/debian.py +@@ -2,48 +2,13 @@ + # 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/. + +-from __future__ import absolute_import, print_function, unicode_literals ++import sys + +-from mozboot.base import BaseBootstrapper, MERCURIAL_INSTALL_PROMPT ++from mozboot.base import MERCURIAL_INSTALL_PROMPT, BaseBootstrapper + from mozboot.linux_common import LinuxBootstrapper + +-import sys +- + + class DebianBootstrapper(LinuxBootstrapper, BaseBootstrapper): +- +- # These are common packages for all Debian-derived distros (such as +- # Ubuntu). +- COMMON_PACKAGES = [ +- "build-essential", +- "libpython3-dev", +- "m4", +- "unzip", +- "uuid", +- "zip", +- ] +- +- # These are common packages for building Firefox for Desktop +- # (browser) for all Debian-derived distros (such as Ubuntu). +- BROWSER_COMMON_PACKAGES = [ +- "libasound2-dev", +- "libcurl4-openssl-dev", +- "libdbus-1-dev", +- "libdbus-glib-1-dev", +- "libdrm-dev", +- "libgtk-3-dev", +- "libpulse-dev", +- "libx11-xcb-dev", +- "libxt-dev", +- "xvfb", +- ] +- +- # These are common packages for building Firefox for Android +- # (mobile/android) for all Debian-derived distros (such as Ubuntu). +- MOBILE_ANDROID_COMMON_PACKAGES = [ +- "libncurses5", # For native debugging in Android Studio +- ] +- + def __init__(self, distro, version, dist_id, codename, **kwargs): + BaseBootstrapper.__init__(self, **kwargs) + +@@ -52,16 +17,6 @@ class DebianBootstrapper(LinuxBootstrapp + self.dist_id = dist_id + self.codename = codename + +- self.packages = list(self.COMMON_PACKAGES) +- +- try: +- version_number = int(version) +- except ValueError: +- version_number = None +- +- if (version_number and (version_number >= 11)) or version == "unstable": +- self.packages += ["watchman"] +- + def suggest_install_distutils(self): + print( + "HINT: Try installing distutils with " +@@ -75,26 +30,15 @@ class DebianBootstrapper(LinuxBootstrapp + file=sys.stderr, + ) + +- def install_system_packages(self): +- self.apt_install(*self.packages) +- +- def install_browser_packages(self, mozconfig_builder, artifact_mode=False): +- # TODO: Figure out what not to install for artifact mode +- self.apt_install(*self.BROWSER_COMMON_PACKAGES) +- +- def install_browser_artifact_mode_packages(self, mozconfig_builder): +- self.install_browser_packages(mozconfig_builder, artifact_mode=True) ++ def install_packages(self, packages): ++ try: ++ if int(self.version) < 11: ++ # watchman is only available starting from Debian 11. ++ packages = [p for p in packages if p != "watchman"] ++ except ValueError: ++ pass + +- def install_mobile_android_packages(self, mozconfig_builder, artifact_mode=False): +- # Multi-part process: +- # 1. System packages. +- # 2. Android SDK. Android NDK only if we are not in artifact mode. Android packages. +- self.apt_install(*self.MOBILE_ANDROID_COMMON_PACKAGES) +- +- # 2. Android pieces. +- super().install_mobile_android_packages( +- mozconfig_builder, artifact_mode=artifact_mode +- ) ++ self.apt_install(*packages) + + def _update_package_manager(self): + self.apt_update() +@@ -122,3 +66,18 @@ class DebianBootstrapper(LinuxBootstrapp + # pip. + assert res == 1 + self.run_as_root(["pip3", "install", "--upgrade", "Mercurial"]) ++ ++ def apt_install(self, *packages): ++ command = ["apt-get", "install"] ++ if self.no_interactive: ++ command.append("-y") ++ command.extend(packages) ++ ++ self.run_as_root(command) ++ ++ def apt_update(self): ++ command = ["apt-get", "update"] ++ if self.no_interactive: ++ command.append("-y") ++ ++ self.run_as_root(command) +diff --git a/python/mozboot/mozboot/freebsd.py b/python/mozboot/mozboot/freebsd.py +--- a/python/mozboot/mozboot/freebsd.py ++++ b/python/mozboot/mozboot/freebsd.py +@@ -2,7 +2,6 @@ + # 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/. + +-from __future__ import absolute_import, print_function, unicode_literals + import sys + + from mozboot.base import BaseBootstrapper +@@ -19,11 +18,11 @@ class FreeBSDBootstrapper(BaseBootstrapp + "gmake", + "gtar", + "m4", ++ "npm", + "pkgconf", + "py%d%d-sqlite3" % sys.version_info[0:2], + "rust", + "watchman", +- "zip", + ] + + self.browser_packages = [ +@@ -56,10 +55,11 @@ class FreeBSDBootstrapper(BaseBootstrapp + def install_browser_packages(self, mozconfig_builder, artifact_mode=False): + # TODO: Figure out what not to install for artifact mode + packages = self.browser_packages.copy() +- if sys.platform.startswith("netbsd"): +- packages.extend(["brotli", "gtk3+", "libv4l"]) +- else: +- packages.extend(["gtk3", "mesa-dri", "v4l_compat"]) ++ if not artifact_mode: ++ if sys.platform.startswith("netbsd"): ++ packages.extend(["brotli", "gtk3+", "libv4l", "cbindgen"]) ++ else: ++ packages.extend(["gtk3", "mesa-dri", "v4l_compat", "rust-cbindgen"]) + self.pkg_install(*packages) + + def install_browser_artifact_mode_packages(self, mozconfig_builder): +@@ -69,19 +69,5 @@ class FreeBSDBootstrapper(BaseBootstrapp + # TODO: we don't ship clang base static analysis for this platform + pass + +- def ensure_stylo_packages(self): +- # Clang / llvm already installed as browser package +- if sys.platform.startswith("netbsd"): +- self.pkg_install("cbindgen") +- else: +- self.pkg_install("rust-cbindgen") +- +- def ensure_nasm_packages(self): +- # installed via install_browser_packages +- pass +- +- def ensure_node_packages(self): +- self.pkg_install("npm") +- + def upgrade_mercurial(self, current): + self.pkg_install("mercurial") +diff --git a/python/mozboot/mozboot/gentoo.py b/python/mozboot/mozboot/gentoo.py +--- a/python/mozboot/mozboot/gentoo.py ++++ b/python/mozboot/mozboot/gentoo.py +@@ -2,8 +2,6 @@ + # 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/. + +-from __future__ import absolute_import, print_function, unicode_literals +- + from mozboot.base import BaseBootstrapper + from mozboot.linux_common import LinuxBootstrapper + +@@ -15,32 +13,13 @@ class GentooBootstrapper(LinuxBootstrapp + self.version = version + self.dist_id = dist_id + +- def install_system_packages(self): +- self.ensure_system_packages() +- +- def ensure_system_packages(self): +- self.run_as_root( +- ["emerge", "--noreplace", "--quiet", "app-arch/zip", "dev-util/watchman"] +- ) +- +- def install_browser_packages(self, mozconfig_builder, artifact_mode=False): +- # TODO: Figure out what not to install for artifact mode +- self.run_as_root( +- [ +- "emerge", +- "--oneshot", +- "--noreplace", +- "--quiet", +- "--newuse", +- "dev-libs/dbus-glib", +- "media-sound/pulseaudio", +- "x11-libs/gtk+:3", +- "x11-libs/libXt", +- ] +- ) +- +- def install_browser_artifact_mode_packages(self, mozconfig_builder): +- self.install_browser_packages(mozconfig_builder, artifact_mode=True) ++ def install_packages(self, packages): ++ DISAMBIGUATE = { ++ "tar": "app-arch/tar", ++ } ++ # watchman is available but requires messing with USEs. ++ packages = [DISAMBIGUATE.get(p, p) for p in packages if p != "watchman"] ++ self.run_as_root(["emerge", "--noreplace"] + packages) + + def _update_package_manager(self): + self.run_as_root(["emerge", "--sync"]) +diff --git a/python/mozboot/mozboot/linux_common.py b/python/mozboot/mozboot/linux_common.py +--- a/python/mozboot/mozboot/linux_common.py ++++ b/python/mozboot/mozboot/linux_common.py +@@ -6,8 +6,6 @@ + # needed to install Stylo and Node dependencies. This class must come before + # BaseBootstrapper in the inheritance list. + +-from __future__ import absolute_import, print_function, unicode_literals +- + import platform + + +@@ -15,68 +13,6 @@ def is_non_x86_64(): + return platform.machine() != "x86_64" + + +-class SccacheInstall(object): +- def __init__(self, **kwargs): +- pass +- +- def ensure_sccache_packages(self): +- self.install_toolchain_artifact("sccache") +- +- +-class FixStacksInstall(object): +- def __init__(self, **kwargs): +- pass +- +- def ensure_fix_stacks_packages(self): +- self.install_toolchain_artifact("fix-stacks") +- +- +-class StyloInstall(object): +- def __init__(self, **kwargs): +- pass +- +- def ensure_stylo_packages(self): +- if is_non_x86_64(): +- print( +- "Cannot install bindgen clang and cbindgen packages from taskcluster.\n" +- "Please install these packages manually." +- ) +- return +- +- self.install_toolchain_artifact("clang") +- self.install_toolchain_artifact("cbindgen") +- +- +-class NasmInstall(object): +- def __init__(self, **kwargs): +- pass +- +- def ensure_nasm_packages(self): +- if is_non_x86_64(): +- print( +- "Cannot install nasm from taskcluster.\n" +- "Please install this package manually." +- ) +- return +- +- self.install_toolchain_artifact("nasm") +- +- +-class NodeInstall(object): +- def __init__(self, **kwargs): +- pass +- +- def ensure_node_packages(self): +- if is_non_x86_64(): +- print( +- "Cannot install node package from taskcluster.\n" +- "Please install this package manually." +- ) +- return +- +- self.install_toolchain_artifact("node") +- +- + class ClangStaticAnalysisInstall(object): + def __init__(self, **kwargs): + pass +@@ -94,14 +30,6 @@ class ClangStaticAnalysisInstall(object) + self.install_toolchain_static_analysis(static_analysis.LINUX_CLANG_TIDY) + + +-class MinidumpStackwalkInstall(object): +- def __init__(self, **kwargs): +- pass +- +- def ensure_minidump_stackwalk_packages(self): +- self.install_toolchain_artifact("minidump-stackwalk") +- +- + class MobileAndroidBootstrapper(object): + def __init__(self, **kwargs): + pass +@@ -154,13 +82,32 @@ class MobileAndroidBootstrapper(object): + + class LinuxBootstrapper( + ClangStaticAnalysisInstall, +- FixStacksInstall, +- MinidumpStackwalkInstall, + MobileAndroidBootstrapper, +- NasmInstall, +- NodeInstall, +- SccacheInstall, +- StyloInstall, + ): + def __init__(self, **kwargs): + pass ++ ++ def ensure_sccache_packages(self): ++ pass ++ ++ def install_system_packages(self): ++ self.install_packages( ++ [ ++ "bash", ++ "findutils", # contains xargs ++ "gzip", ++ "libxml2", # used by bootstrapped clang ++ "m4", ++ "make", ++ "perl", ++ "tar", ++ "unzip", ++ "watchman", ++ ] ++ ) ++ ++ def install_browser_packages(self, mozconfig_builder, artifact_mode=False): ++ pass ++ ++ def install_browser_artifact_mode_packages(self, mozconfig_builder): ++ pass +diff --git a/python/mozboot/mozboot/mach_commands.py b/python/mozboot/mozboot/mach_commands.py +--- a/python/mozboot/mozboot/mach_commands.py ++++ b/python/mozboot/mozboot/mach_commands.py +@@ -2,13 +2,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/. + +-from __future__ import absolute_import, print_function, unicode_literals +- + import errno + import sys ++from pathlib import Path + +-from pathlib import Path +-from mach.decorators import CommandArgument, Command ++from mach.decorators import Command, CommandArgument + from mozboot.bootstrap import APPLICATIONS + + +@@ -71,8 +69,8 @@ def vcs_setup(command_context, update_on + """ + import mozboot.bootstrap as bootstrap + import mozversioncontrol ++ from mach.util import to_optional_path + from mozfile import which +- from mach.util import to_optional_path + + repo = mozversioncontrol.get_repository_object(command_context._mach_context.topdir) + tool = "hg" +diff --git a/python/mozboot/mozboot/mozconfig.py b/python/mozboot/mozboot/mozconfig.py +--- a/python/mozboot/mozboot/mozconfig.py ++++ b/python/mozboot/mozboot/mozconfig.py +@@ -2,15 +2,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/. + +-from __future__ import absolute_import +- + import filecmp + import os +- + from pathlib import Path + from typing import Union + +- + MOZ_MYCONFIG_ERROR = """ + The MOZ_MYCONFIG environment variable to define the location of mozconfigs + is deprecated. If you wish to define the mozconfig path via an environment +diff --git a/python/mozboot/mozboot/mozillabuild.py b/python/mozboot/mozboot/mozillabuild.py +--- a/python/mozboot/mozboot/mozillabuild.py ++++ b/python/mozboot/mozboot/mozillabuild.py +@@ -2,8 +2,6 @@ + # 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/. + +-from __future__ import absolute_import, print_function, unicode_literals +- + import ctypes + import os + import platform +@@ -231,35 +229,9 @@ class MozillaBuildBootstrapper(BaseBoots + def ensure_sccache_packages(self): + from mozboot import sccache + +- self.install_toolchain_artifact("sccache") + self.install_toolchain_artifact(sccache.RUSTC_DIST_TOOLCHAIN, no_unpack=True) + self.install_toolchain_artifact(sccache.CLANG_DIST_TOOLCHAIN, no_unpack=True) + +- def ensure_stylo_packages(self): +- # On-device artifact builds are supported; on-device desktop builds are not. +- if is_aarch64_host(): +- raise Exception( +- "You should not be performing desktop builds on an " +- "AArch64 device. If you want to do artifact builds " +- "instead, please choose the appropriate artifact build " +- "option when beginning bootstrap." +- ) +- +- self.install_toolchain_artifact("clang") +- self.install_toolchain_artifact("cbindgen") +- +- def ensure_nasm_packages(self): +- self.install_toolchain_artifact("nasm") +- +- def ensure_node_packages(self): +- self.install_toolchain_artifact("node") +- +- def ensure_fix_stacks_packages(self): +- self.install_toolchain_artifact("fix-stacks") +- +- def ensure_minidump_stackwalk_packages(self): +- self.install_toolchain_artifact("minidump-stackwalk") +- + def _update_package_manager(self): + pass + +diff --git a/python/mozboot/mozboot/openbsd.py b/python/mozboot/mozboot/openbsd.py +--- a/python/mozboot/mozboot/openbsd.py ++++ b/python/mozboot/mozboot/openbsd.py +@@ -2,8 +2,6 @@ + # 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/. + +-from __future__ import absolute_import, print_function, unicode_literals +- + from mozboot.base import BaseBootstrapper + + +@@ -11,9 +9,17 @@ class OpenBSDBootstrapper(BaseBootstrapp + def __init__(self, version, **kwargs): + BaseBootstrapper.__init__(self, **kwargs) + +- self.packages = ["gmake", "gtar", "rust", "unzip", "zip"] ++ self.packages = ["gmake", "gtar", "rust", "unzip"] + +- self.browser_packages = ["llvm", "nasm", "gtk+3", "dbus-glib", "pulseaudio"] ++ self.browser_packages = [ ++ "llvm", ++ "cbindgen", ++ "nasm", ++ "node", ++ "gtk+3", ++ "dbus-glib", ++ "pulseaudio", ++ ] + + def install_system_packages(self): + # we use -z because there's no other way to say "any autoconf-2.13" +@@ -30,14 +36,3 @@ class OpenBSDBootstrapper(BaseBootstrapp + def ensure_clang_static_analysis_package(self): + # TODO: we don't ship clang base static analysis for this platform + pass +- +- def ensure_stylo_packages(self): +- # Clang / llvm already installed as browser package +- self.run_as_root(["pkg_add", "cbindgen"]) +- +- def ensure_nasm_packages(self): +- # installed via install_browser_packages +- pass +- +- def ensure_node_packages(self): +- self.run_as_root(["pkg_add", "node"]) +diff --git a/python/mozboot/mozboot/opensuse.py b/python/mozboot/mozboot/opensuse.py +--- a/python/mozboot/mozboot/opensuse.py ++++ b/python/mozboot/mozboot/opensuse.py +@@ -2,107 +2,24 @@ + # 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/. + +-from __future__ import absolute_import, print_function, unicode_literals +- +-from mozboot.base import BaseBootstrapper, MERCURIAL_INSTALL_PROMPT ++from mozboot.base import MERCURIAL_INSTALL_PROMPT, BaseBootstrapper + from mozboot.linux_common import LinuxBootstrapper + +-import distro +-import subprocess +- + + class OpenSUSEBootstrapper(LinuxBootstrapper, BaseBootstrapper): + """openSUSE experimental bootstrapper.""" + +- SYSTEM_PACKAGES = [ +- "libcurl-devel", +- "libpulse-devel", +- "rpmconf", +- "which", +- "unzip", +- ] +- +- BROWSER_PACKAGES = [ +- "alsa-devel", +- "gcc-c++", +- "gtk3-devel", +- "dbus-1-glib-devel", +- "glibc-devel-static", +- "libstdc++-devel", +- "libXt-devel", +- "libproxy-devel", +- "libuuid-devel", +- "clang-devel", +- "patterns-gnome-devel_gnome", +- ] +- +- OPTIONAL_BROWSER_PACKAGES = [ +- "gconf2-devel", # https://bugzilla.mozilla.org/show_bug.cgi?id=1779931 +- ] +- +- BROWSER_GROUP_PACKAGES = ["devel_C_C++", "devel_gnome"] +- +- MOBILE_ANDROID_COMMON_PACKAGES = ["java-1_8_0-openjdk"] +- + def __init__(self, version, dist_id, **kwargs): + print("Using an experimental bootstrapper for openSUSE.") + BaseBootstrapper.__init__(self, **kwargs) + +- def install_system_packages(self): +- self.zypper_install(*self.SYSTEM_PACKAGES) +- +- def install_browser_packages(self, mozconfig_builder, artifact_mode=False): +- # TODO: Figure out what not to install for artifact mode +- packages_to_install = self.BROWSER_PACKAGES.copy() +- +- for package in self.OPTIONAL_BROWSER_PACKAGES: +- if self.zypper_can_install(package): +- packages_to_install.append(package) +- else: +- print( +- f"WARNING! zypper cannot find a package for '{package}' for " +- f"{distro.name(True)}. It will not be automatically installed." +- ) +- +- self.zypper_install(*packages_to_install) +- +- def install_browser_group_packages(self): +- self.ensure_browser_group_packages() +- +- def install_browser_artifact_mode_packages(self, mozconfig_builder): +- self.install_browser_packages(mozconfig_builder, artifact_mode=True) +- +- def ensure_clang_static_analysis_package(self): +- from mozboot import static_analysis +- +- self.install_toolchain_static_analysis(static_analysis.LINUX_CLANG_TIDY) +- +- def ensure_browser_group_packages(self, artifact_mode=False): +- # TODO: Figure out what not to install for artifact mode +- self.zypper_patterninstall(*self.BROWSER_GROUP_PACKAGES) +- +- def install_mobile_android_packages(self, mozconfig_builder, artifact_mode=False): +- # Multi-part process: +- # 1. System packages. +- # 2. Android SDK. Android NDK only if we are not in artifact mode. Android packages. +- +- # 1. This is hard to believe, but the Android SDK binaries are 32-bit +- # and that conflicts with 64-bit Arch installations out of the box. The +- # solution is to add the multilibs repository; unfortunately, this +- # requires manual intervention. +- try: +- self.zypper_install(*self.MOBILE_ANDROID_COMMON_PACKAGES) +- except Exception as e: +- print( +- "Failed to install all packages. The Android developer " +- "toolchain requires 32 bit binaries be enabled" +- ) +- raise e +- +- # 2. Android pieces. +- super().install_mobile_android_packages( +- mozconfig_builder, artifact_mode=artifact_mode +- ) ++ def install_packages(self, packages): ++ ALTERNATIVE_NAMES = { ++ "libxml2": "libxml2-2", ++ } ++ # watchman is not available ++ packages = [ALTERNATIVE_NAMES.get(p, p) for p in packages if p != "watchman"] ++ self.zypper_install(*packages) + + def _update_package_manager(self): + self.zypper_update() +@@ -142,14 +59,5 @@ class OpenSUSEBootstrapper(LinuxBootstra + def zypper_install(self, *packages): + self.zypper("install", *packages) + +- def zypper_can_install(self, package): +- return ( +- subprocess.call(["zypper", "search", package], stdout=subprocess.DEVNULL) +- == 0 +- ) +- + def zypper_update(self, *packages): + self.zypper("update", *packages) +- +- def zypper_patterninstall(self, *packages): +- self.zypper("install", "-t", "pattern", *packages) +diff --git a/python/mozboot/mozboot/osx.py b/python/mozboot/mozboot/osx.py +--- a/python/mozboot/mozboot/osx.py ++++ b/python/mozboot/mozboot/osx.py +@@ -2,8 +2,6 @@ + # 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/. + +-from __future__ import absolute_import, print_function, unicode_literals +- + import platform + import subprocess + import sys +@@ -14,11 +12,10 @@ try: + except ImportError: + from urllib.request import urlopen + +-from packaging.version import Version +- ++from mach.util import to_optional_path, to_optional_str + from mozboot.base import BaseBootstrapper + from mozfile import which +-from mach.util import to_optional_path, to_optional_str ++from packaging.version import Version + + HOMEBREW_BOOTSTRAP = ( + "https://raw.githubusercontent.com/Homebrew/install/master/install.sh" +@@ -166,21 +163,9 @@ class OSXBootstrapperLight(OSXAndroidBoo + def install_browser_artifact_mode_packages(self, mozconfig_builder): + pass + +- def ensure_node_packages(self): +- pass +- +- def ensure_stylo_packages(self): +- pass +- + def ensure_clang_static_analysis_package(self): + pass + +- def ensure_nasm_packages(self): +- pass +- +- def ensure_minidump_stackwalk_packages(self): +- self.install_toolchain_artifact("minidump-stackwalk") +- + + class OSXBootstrapper(OSXAndroidBootstrapper, BaseBootstrapper): + def __init__(self, version, **kwargs): +@@ -299,26 +284,9 @@ class OSXBootstrapper(OSXAndroidBootstra + def ensure_sccache_packages(self): + from mozboot import sccache + +- self.install_toolchain_artifact("sccache") + self.install_toolchain_artifact(sccache.RUSTC_DIST_TOOLCHAIN, no_unpack=True) + self.install_toolchain_artifact(sccache.CLANG_DIST_TOOLCHAIN, no_unpack=True) + +- def ensure_fix_stacks_packages(self): +- self.install_toolchain_artifact("fix-stacks") +- +- def ensure_stylo_packages(self): +- self.install_toolchain_artifact("clang") +- self.install_toolchain_artifact("cbindgen") +- +- def ensure_nasm_packages(self): +- self.install_toolchain_artifact("nasm") +- +- def ensure_node_packages(self): +- self.install_toolchain_artifact("node") +- +- def ensure_minidump_stackwalk_packages(self): +- self.install_toolchain_artifact("minidump-stackwalk") +- + def install_homebrew(self): + print(BREW_INSTALL) + bootstrap = urlopen(url=HOMEBREW_BOOTSTRAP, timeout=20).read() +diff --git a/python/mozboot/mozboot/rust.py b/python/mozboot/mozboot/rust.py +--- a/python/mozboot/mozboot/rust.py ++++ b/python/mozboot/mozboot/rust.py +@@ -2,16 +2,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/. + +-from __future__ import absolute_import, print_function, unicode_literals +- + import platform as platform_mod + import sys + +- + # Base url for pulling the rustup installer. +-# Use the no-CNAME host for compatibilty with Python 2.7 +-# which doesn't support SNI. +-RUSTUP_URL_BASE = "https://static-rust-lang-org.s3.amazonaws.com/rustup" ++RUSTUP_URL_BASE = "https://static.rust-lang.org/rustup" + + # Pull this to get the lastest stable version number. + RUSTUP_MANIFEST = RUSTUP_URL_BASE + "/release-stable.toml" +@@ -123,6 +118,7 @@ def rustup_latest_version(): + + def http_download_and_hash(url): + import hashlib ++ + import requests + + h = hashlib.sha256() +diff --git a/python/mozboot/mozboot/sccache.py b/python/mozboot/mozboot/sccache.py +--- a/python/mozboot/mozboot/sccache.py ++++ b/python/mozboot/mozboot/sccache.py +@@ -2,8 +2,6 @@ + # 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/. + +-from __future__ import absolute_import, print_function, unicode_literals +- + # sccache-dist currently expects clients to provide toolchains when + # distributing from macOS or Windows, so we download linux binaries capable + # of cross-compiling for these cases. +diff --git a/python/mozboot/mozboot/solus.py b/python/mozboot/mozboot/solus.py +--- a/python/mozboot/mozboot/solus.py ++++ b/python/mozboot/mozboot/solus.py +@@ -2,73 +2,19 @@ + # 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/. + +-from __future__ import absolute_import, print_function, unicode_literals +- +-import sys +-import subprocess +- + from mozboot.base import BaseBootstrapper + from mozboot.linux_common import LinuxBootstrapper + +-# NOTE: This script is intended to be run with a vanilla Python install. We +-# have to rely on the standard library instead of Python 2+3 helpers like +-# the six module. +-if sys.version_info < (3,): +- input = raw_input # noqa +- + + class SolusBootstrapper(LinuxBootstrapper, BaseBootstrapper): + """Solus experimental bootstrapper.""" + +- SYSTEM_PACKAGES = ["unzip", "zip"] +- SYSTEM_COMPONENTS = ["system.devel"] +- +- BROWSER_PACKAGES = [ +- "alsa-lib", +- "dbus", +- "libgtk-3", +- "libevent", +- "libvpx", +- "libxt", +- "libstartup-notification", +- "gst-plugins-base", +- "gst-plugins-good", +- "pulseaudio", +- "xorg-server-xvfb", +- ] +- +- MOBILE_ANDROID_COMMON_PACKAGES = [ +- # See comment about 32 bit binaries and multilib below. +- "ncurses-32bit", +- "readline-32bit", +- "zlib-32bit", +- ] +- + def __init__(self, version, dist_id, **kwargs): + print("Using an experimental bootstrapper for Solus.") + BaseBootstrapper.__init__(self, **kwargs) + +- def install_system_packages(self): +- self.package_install(*self.SYSTEM_PACKAGES) +- self.component_install(*self.SYSTEM_COMPONENTS) +- +- def install_browser_packages(self, mozconfig_builder, artifact_mode=False): +- self.package_install(*self.BROWSER_PACKAGES) +- +- def install_browser_artifact_mode_packages(self, mozconfig_builder): +- self.install_browser_packages(mozconfig_builder, artifact_mode=True) +- +- def install_mobile_android_packages(self, mozconfig_builder, artifact_mode=False): +- try: +- self.package_install(*self.MOBILE_ANDROID_COMMON_PACKAGES) +- except Exception as e: +- print("Failed to install all packages!") +- raise e +- +- # 2. Android pieces. +- super().install_mobile_android_packages( +- mozconfig_builder, artifact_mode=artifact_mode +- ) ++ def install_packages(self, packages): ++ self.package_install(*packages) + + def _update_package_manager(self): + pass +@@ -84,15 +30,3 @@ class SolusBootstrapper(LinuxBootstrappe + command.extend(packages) + + self.run_as_root(command) +- +- def component_install(self, *components): +- command = ["eopkg", "install", "-c"] +- if self.no_interactive: +- command.append("--yes-all") +- +- command.extend(components) +- +- self.run_as_root(command) +- +- def run(self, command, env=None): +- subprocess.check_call(command, stdin=sys.stdin, env=env) +diff --git a/python/mozboot/mozboot/static_analysis.py b/python/mozboot/mozboot/static_analysis.py +--- a/python/mozboot/mozboot/static_analysis.py ++++ b/python/mozboot/mozboot/static_analysis.py +@@ -2,8 +2,6 @@ + # 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/. + +-from __future__ import absolute_import, print_function, unicode_literals +- + WINDOWS_CLANG_TIDY = "win64-clang-tidy" + LINUX_CLANG_TIDY = "linux64-clang-tidy" + MACOS_CLANG_TIDY = "macosx64-clang-tidy" +diff --git a/python/mozboot/mozboot/util.py b/python/mozboot/mozboot/util.py +--- a/python/mozboot/mozboot/util.py ++++ b/python/mozboot/mozboot/util.py +@@ -2,27 +2,14 @@ + # 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/. + +-from __future__ import absolute_import, print_function, unicode_literals +- + import hashlib + import os +-import sys +- + from pathlib import Path ++from urllib.request import urlopen + + from mach.site import PythonVirtualenv + from mach.util import get_state_dir + +-# NOTE: This script is intended to be run with a vanilla Python install. We +-# have to rely on the standard library instead of Python 2+3 helpers like +-# the six module. +-if sys.version_info < (3,): +- from urllib2 import urlopen +- +- input = raw_input # noqa +-else: +- from urllib.request import urlopen +- + MINIMUM_RUST_VERSION = "1.63.0" + + +diff --git a/python/mozboot/mozboot/void.py b/python/mozboot/mozboot/void.py +--- a/python/mozboot/mozboot/void.py ++++ b/python/mozboot/mozboot/void.py +@@ -2,31 +2,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/. + +-from __future__ import absolute_import, print_function, unicode_literals +- +-import os +-import subprocess +-import sys +- + from mozboot.base import BaseBootstrapper + from mozboot.linux_common import LinuxBootstrapper + + + class VoidBootstrapper(LinuxBootstrapper, BaseBootstrapper): +- +- PACKAGES = ["clang", "make", "mercurial", "watchman", "unzip", "zip"] +- +- BROWSER_PACKAGES = [ +- "dbus-devel", +- "dbus-glib-devel", +- "gtk+3-devel", +- "pulseaudio", +- "pulseaudio-devel", +- "libcurl-devel", +- "libxcb-devel", +- "libXt-devel", +- ] +- + def __init__(self, version, dist_id, **kwargs): + BaseBootstrapper.__init__(self, **kwargs) + +@@ -34,18 +14,10 @@ class VoidBootstrapper(LinuxBootstrapper + self.version = version + self.dist_id = dist_id + +- self.packages = self.PACKAGES +- self.browser_packages = self.BROWSER_PACKAGES +- + def run_as_root(self, command): + # VoidLinux doesn't support users sudo'ing most commands by default because of the group + # configuration. +- if os.geteuid() != 0: +- command = ["su", "root", "-c", " ".join(command)] +- +- print("Executing as root:", subprocess.list2cmdline(command)) +- +- subprocess.check_call(command, stdin=sys.stdin) ++ super().run_as_root(command, may_use_sudo=False) + + def xbps_install(self, *packages): + command = ["xbps-install"] +@@ -62,14 +34,8 @@ class VoidBootstrapper(LinuxBootstrapper + + self.run_as_root(command) + +- def install_system_packages(self): +- self.xbps_install(*self.packages) +- +- def install_browser_packages(self, mozconfig_builder, artifact_mode=False): +- self.xbps_install(*self.browser_packages) +- +- def install_browser_artifact_mode_packages(self, mozconfig_builder): +- self.install_browser_packages(mozconfig_builder, artifact_mode=True) ++ def install_packages(self, packages): ++ self.xbps_install(*packages) + + def _update_package_manager(self): + self.xbps_update() +diff --git a/python/mozboot/mozboot/windows.py b/python/mozboot/mozboot/windows.py +--- a/python/mozboot/mozboot/windows.py ++++ b/python/mozboot/mozboot/windows.py +@@ -2,12 +2,10 @@ + # 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/. + +-from __future__ import absolute_import, print_function, unicode_literals +- + import ctypes + import os ++import subprocess + import sys +-import subprocess + + from mozboot.base import BaseBootstrapper + from mozfile import which +@@ -50,7 +48,6 @@ class WindowsBootstrapper(BaseBootstrapp + "patchutils", + "diffutils", + "tar", +- "zip", + "unzip", + "mingw-w64-x86_64-toolchain", # TODO: Remove when Mercurial is installable from a wheel. + "mingw-w64-i686-toolchain", +@@ -106,25 +103,6 @@ class WindowsBootstrapper(BaseBootstrapp + + self.install_toolchain_static_analysis(static_analysis.WINDOWS_CLANG_TIDY) + +- def ensure_stylo_packages(self): +- # On-device artifact builds are supported; on-device desktop builds are not. +- if is_aarch64_host(): +- raise Exception( +- "You should not be performing desktop builds on an " +- "AArch64 device. If you want to do artifact builds " +- "instead, please choose the appropriate artifact build " +- "option when beginning bootstrap." +- ) +- +- self.install_toolchain_artifact("clang") +- self.install_toolchain_artifact("cbindgen") +- +- def ensure_nasm_packages(self): +- self.install_toolchain_artifact("nasm") +- +- def ensure_node_packages(self): +- self.install_toolchain_artifact("node") +- + def _update_package_manager(self): + self.pacman_update() + +diff --git a/python/mozbuild/mozbuild/action/langpack_manifest.py b/python/mozbuild/mozbuild/action/langpack_manifest.py +--- a/python/mozbuild/mozbuild/action/langpack_manifest.py ++++ b/python/mozbuild/mozbuild/action/langpack_manifest.py +@@ -4,28 +4,30 @@ + + ### + # This script generates a web manifest JSON file based on the xpi-stage +-# directory structure. It extracts the data from defines.inc files from +-# the locale directory, chrome registry entries and other information +-# necessary to produce the complete manifest file for a language pack. ++# directory structure. It extracts data necessary to produce the complete ++# manifest file for a language pack: ++# from the `langpack-manifest.ftl` file in the locale directory; ++# from chrome registry entries; ++# and from other information in the `xpi-stage` directory. + ### ++ + from __future__ import absolute_import, print_function, unicode_literals + + import argparse +-import sys +-import os +-import json ++import datetime + import io +-import datetime +-import requests +-import mozversioncontrol ++import json ++import logging ++import os ++import sys ++ ++import fluent.syntax.ast as FTL + import mozpack.path as mozpath +-from mozpack.chrome.manifest import ( +- Manifest, +- ManifestLocale, +- parse_manifest, +-) ++import mozversioncontrol ++import requests ++from fluent.syntax.parser import FluentParser + from mozbuild.configure.util import Version +-from mozbuild.preprocessor import Preprocessor ++from mozpack.chrome.manifest import Manifest, ManifestLocale, parse_manifest + + + def write_file(path, content): +@@ -112,53 +114,89 @@ def get_timestamp_for_locale(path): + + + ### +-# Parses multiple defines files into a single key-value pair object. ++# Parses an FTL file into a key-value pair object. ++# Does not support attributes, terms, variables, functions or selectors; ++# only messages with values consisting of text elements and literals. + # + # Args: +-# paths (str) - a comma separated list of paths to defines files ++# path (str) - a path to an FTL file + # + # Returns: +-# (dict) - a key-value dict with defines ++# (dict) - A mapping of message keys to formatted string values. ++# Empty if the file at `path` was not found. + # + # Example: +-# res = parse_defines('./toolkit/defines.inc,./browser/defines.inc') ++# res = parse_flat_ftl('./browser/langpack-metadata.ftl') + # res == { +-# 'MOZ_LANG_TITLE': 'Polski', +-# 'MOZ_LANGPACK_CREATOR': 'Aviary.pl', +-# 'MOZ_LANGPACK_CONTRIBUTORS': 'Marek Stepien, Marek Wawoczny' ++# 'langpack-title': 'Polski', ++# 'langpack-creator': 'mozilla.org', ++# 'langpack-contributors': 'Joe Solon, Suzy Solon' + # } + ### +-def parse_defines(paths): +- pp = Preprocessor() +- for path in paths: +- pp.do_include(path) ++def parse_flat_ftl(path): ++ parser = FluentParser(with_spans=False) ++ try: ++ with open(path, encoding="utf-8") as file: ++ res = parser.parse(file.read()) ++ except FileNotFoundError as err: ++ logging.warning(err) ++ return {} + +- return pp.context ++ result = {} ++ for entry in res.body: ++ if isinstance(entry, FTL.Message) and isinstance(entry.value, FTL.Pattern): ++ flat = "" ++ for elem in entry.value.elements: ++ if isinstance(elem, FTL.TextElement): ++ flat += elem.value ++ elif isinstance(elem.expression, FTL.Literal): ++ flat += elem.expression.parse()["value"] ++ else: ++ name = type(elem.expression).__name__ ++ raise Exception(f"Unsupported {name} for {entry.id.name} in {path}") ++ result[entry.id.name] = flat.strip() ++ return result + + +-### +-# Converts the list of contributors from the old RDF based list +-# of entries, into a comma separated list. ++## ++# Generates the title and description for the langpack. ++# ++# Uses data stored in a JSON file next to this source, ++# which is expected to have the following format: ++# Record ++# ++# If an English name is given and is different from the native one, ++# it will be included parenthetically in the title. ++# ++# NOTE: If you're updating the native locale names, ++# you should also update the data in ++# toolkit/components/mozintl/mozIntl.sys.mjs. + # + # Args: +-# str (str) - a string with an RDF list of contributors entries ++# app (str) - Application name ++# locale (str) - Locale identifier + # + # Returns: +-# (str) - a comma separated list of contributors ++# (str, str) - Tuple of title and description + # +-# Example: +-# s = convert_contributors(' +-# Marek Wawoczny +-# Marek Stepien +-# ') +-# s == 'Marek Wawoczny, Marek Stepien' + ### +-def convert_contributors(str): +- str = str.replace("", "") +- tokens = str.split("") +- tokens = map(lambda t: t.strip(), tokens) +- tokens = filter(lambda t: t != "", tokens) +- return ", ".join(tokens) ++def get_title_and_description(app, locale): ++ dir = os.path.dirname(__file__) ++ with open(os.path.join(dir, "langpack_localeNames.json"), encoding="utf-8") as nf: ++ names = json.load(nf) ++ if locale in names: ++ data = names[locale] ++ native = data["native"] ++ english = data["english"] if "english" in data else native ++ titleName = f"{native} ({english})" if english != native else native ++ descName = f"{native} ({locale})" ++ else: ++ titleName = locale ++ descName = locale ++ ++ title = f"Language Pack: {titleName}" ++ description = f"{app} Language Pack for {descName}" ++ return title, description + + + ### +@@ -166,26 +204,25 @@ def convert_contributors(str): + # and optionally adding the list of contributors, if provided. + # + # Args: +-# author (str) - a string with the name of the author +-# contributors (str) - RDF based list of contributors from a chrome manifest ++# ftl (dict) - a key-value mapping of locale-specific strings + # + # Returns: + # (str) - a string to be placed in the author field of the manifest.json + # + # Example: +-# s = build_author_string( +-# 'Aviary.pl', +-# ' +-# Marek Wawoczny +-# Marek Stepien +-# ') +-# s == 'Aviary.pl (contributors: Marek Wawoczny, Marek Stepien)' ++# s = get_author({ ++# 'langpack-creator': 'mozilla.org', ++# 'langpack-contributors': 'Joe Solon, Suzy Solon' ++# }) ++# s == 'mozilla.org (contributors: Joe Solon, Suzy Solon)' + ### +-def build_author_string(author, contributors): +- contrib = convert_contributors(contributors) +- if len(contrib) == 0: ++def get_author(ftl): ++ author = ftl["langpack-creator"] if "langpack-creator" in ftl else "mozilla.org" ++ contrib = ftl["langpack-contributors"] if "langpack-contributors" in ftl else "" ++ if contrib: ++ return f"{author} (contributors: {contrib})" ++ else: + return author +- return "{0} (contributors: {1})".format(author, contrib) + + + ## +@@ -333,7 +370,7 @@ def get_version_maybe_buildid(version): + # resources are for + # app_name (str) - The name of the application the language + # resources are for +-# defines (dict) - A dictionary of defines entries ++# ftl (dict) - A dictionary of locale-specific strings + # chrome_entries (dict) - A dictionary of chrome registry entries + # + # Returns: +@@ -346,7 +383,7 @@ def get_version_maybe_buildid(version): + # '57.0.*', + # 'Firefox', + # '/var/vcs/l10n-central', +-# {'MOZ_LANG_TITLE': 'Polski'}, ++# {'langpack-title': 'Polski'}, + # chrome_entries + # ) + # manifest == { +@@ -392,18 +429,13 @@ def create_webmanifest( + app_name, + l10n_basedir, + langpack_eid, +- defines, ++ ftl, + chrome_entries, + ): + locales = list(map(lambda loc: loc.strip(), locstr.split(","))) + main_locale = locales[0] +- +- author = build_author_string( +- defines["MOZ_LANGPACK_CREATOR"], +- defines["MOZ_LANGPACK_CONTRIBUTORS"] +- if "MOZ_LANGPACK_CONTRIBUTORS" in defines +- else "", +- ) ++ title, description = get_title_and_description(app_name, main_locale) ++ author = get_author(ftl) + + manifest = { + "langpack_id": main_locale, +@@ -415,8 +447,8 @@ def create_webmanifest( + "strict_max_version": max_app_ver, + } + }, +- "name": "{0} Language Pack".format(defines["MOZ_LANG_TITLE"]), +- "description": "Language pack for {0} for {1}".format(app_name, main_locale), ++ "name": title, ++ "description": description, + "version": get_version_maybe_buildid(version), + "languages": {}, + "sources": {"browser": {"base_path": "browser/"}}, +@@ -466,10 +498,8 @@ def main(args): + "--langpack-eid", help="Language pack id to use for this locale" + ) + parser.add_argument( +- "--defines", +- default=[], +- nargs="+", +- help="List of defines files to load data from", ++ "--metadata", ++ help="FTL file defining langpack metadata", + ) + parser.add_argument("--input", help="Langpack directory.") + +@@ -480,7 +510,7 @@ def main(args): + os.path.join(args.input, "chrome.manifest"), args.input, chrome_entries + ) + +- defines = parse_defines(args.defines) ++ ftl = parse_flat_ftl(args.metadata) + + # Mangle the app version to set min version (remove patch level) + min_app_version = args.app_version +@@ -502,7 +532,7 @@ def main(args): + args.app_name, + args.l10n_basedir, + args.langpack_eid, +- defines, ++ ftl, + chrome_entries, + ) + write_file(os.path.join(args.input, "manifest.json"), res) +diff --git a/python/mozbuild/mozbuild/action/make_dmg.py b/python/mozbuild/mozbuild/action/make_dmg.py +--- a/python/mozbuild/mozbuild/action/make_dmg.py ++++ b/python/mozbuild/mozbuild/action/make_dmg.py +@@ -2,13 +2,16 @@ + # 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/. + +-from __future__ import absolute_import, print_function ++import argparse ++import platform ++import sys ++from pathlib import Path + ++from mozbuild.bootstrap import bootstrap_toolchain + from mozbuild.repackaging.application_ini import get_application_ini_value + from mozpack import dmg + +-import argparse +-import sys ++is_linux = platform.system() == "Linux" + + + def main(args): +@@ -41,7 +44,20 @@ def main(args): + options.inpath, "App", "CodeName", fallback="Name" + ) + +- dmg.create_dmg(options.inpath, options.dmgfile, volume_name, extra_files) ++ # Resolve required tools ++ dmg_tool = bootstrap_toolchain("dmg/dmg") ++ hfs_tool = bootstrap_toolchain("dmg/hfsplus") ++ mkfshfs_tool = bootstrap_toolchain("hfsplus/newfs_hfs") ++ ++ dmg.create_dmg( ++ source_directory=Path(options.inpath), ++ output_dmg=Path(options.dmgfile), ++ volume_name=volume_name, ++ extra_files=extra_files, ++ dmg_tool=dmg_tool, ++ hfs_tool=hfs_tool, ++ mkfshfs_tool=mkfshfs_tool, ++ ) + + return 0 + +diff --git a/python/mozbuild/mozbuild/action/unpack_dmg.py b/python/mozbuild/mozbuild/action/unpack_dmg.py +--- a/python/mozbuild/mozbuild/action/unpack_dmg.py ++++ b/python/mozbuild/mozbuild/action/unpack_dmg.py +@@ -2,12 +2,18 @@ + # 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/. + +-from __future__ import absolute_import, print_function ++import argparse ++import sys ++from pathlib import Path + ++from mozbuild.bootstrap import bootstrap_toolchain + from mozpack import dmg + +-import argparse +-import sys ++ ++def _path_or_none(input: str): ++ if not input: ++ return None ++ return Path(input) + + + def main(args): +@@ -26,12 +32,17 @@ def main(args): + + options = parser.parse_args(args) + ++ dmg_tool = bootstrap_toolchain("dmg/dmg") ++ hfs_tool = bootstrap_toolchain("dmg/hfsplus") ++ + dmg.extract_dmg( +- dmgfile=options.dmgfile, +- output=options.outpath, +- dsstore=options.dsstore, +- background=options.background, +- icon=options.icon, ++ dmgfile=Path(options.dmgfile), ++ output=Path(options.outpath), ++ dmg_tool=Path(dmg_tool), ++ hfs_tool=Path(hfs_tool), ++ dsstore=_path_or_none(options.dsstore), ++ background=_path_or_none(options.background), ++ icon=_path_or_none(options.icon), + ) + return 0 + +diff --git a/python/mozbuild/mozbuild/artifacts.py b/python/mozbuild/mozbuild/artifacts.py +--- a/python/mozbuild/mozbuild/artifacts.py ++++ b/python/mozbuild/mozbuild/artifacts.py +@@ -129,7 +129,6 @@ class ArtifactJob(object): + ("bin/http3server", ("bin", "bin")), + ("bin/plugins/gmp-*/*/*", ("bin/plugins", "bin")), + ("bin/plugins/*", ("bin/plugins", "plugins")), +- ("bin/components/*.xpt", ("bin/components", "bin/components")), + } + + # We can tell our input is a test archive by this suffix, which happens to +@@ -137,6 +136,32 @@ class ArtifactJob(object): + _test_zip_archive_suffix = ".common.tests.zip" + _test_tar_archive_suffix = ".common.tests.tar.gz" + ++ # A map of extra archives to fetch and unpack. An extra archive might ++ # include optional build output to incorporate into the local artifact ++ # build. Test archives and crashreporter symbols could be extra archives ++ # but they require special handling; this mechanism is generic and intended ++ # only for the simplest cases. ++ # ++ # Each suffix key matches a candidate archive (i.e., an artifact produced by ++ # an upstream build). Each value is itself a dictionary that must contain ++ # the following keys: ++ # ++ # - `description`: a purely informational string description. ++ # - `src_prefix`: entry names in the archive with leading `src_prefix` will ++ # have the prefix stripped. ++ # - `dest_prefix`: entry names in the archive will have `dest_prefix` ++ # prepended. ++ # ++ # The entries in the archive, suitably renamed, will be extracted into `dist`. ++ _extra_archives = { ++ ".xpt_artifacts.zip": { ++ "description": "XPT Artifacts", ++ "src_prefix": "", ++ "dest_prefix": "xpt_artifacts", ++ }, ++ } ++ _extra_archive_suffixes = tuple(sorted(_extra_archives.keys())) ++ + def __init__( + self, + log=None, +@@ -190,6 +215,8 @@ class ArtifactJob(object): + self._symbols_archive_suffix + ): + yield name ++ elif name.endswith(ArtifactJob._extra_archive_suffixes): ++ yield name + else: + self.log( + logging.DEBUG, +@@ -222,6 +249,8 @@ class ArtifactJob(object): + self._symbols_archive_suffix + ): + return self.process_symbols_archive(filename, processed_filename) ++ if filename.endswith(ArtifactJob._extra_archive_suffixes): ++ return self.process_extra_archive(filename, processed_filename) + return self.process_package_artifact(filename, processed_filename) + + def process_package_artifact(self, filename, processed_filename): +@@ -373,6 +402,43 @@ class ArtifactJob(object): + ) + writer.add(destpath.encode("utf-8"), entry) + ++ def process_extra_archive(self, filename, processed_filename): ++ for suffix, extra_archive in ArtifactJob._extra_archives.items(): ++ if filename.endswith(suffix): ++ self.log( ++ logging.INFO, ++ "artifact", ++ {"filename": filename, "description": extra_archive["description"]}, ++ '"{filename}" is a recognized extra archive ({description})', ++ ) ++ break ++ else: ++ raise ValueError('"{}" is not a recognized extra archive!'.format(filename)) ++ ++ src_prefix = extra_archive["src_prefix"] ++ dest_prefix = extra_archive["dest_prefix"] ++ ++ with self.get_writer(file=processed_filename, compress_level=5) as writer: ++ for filename, entry in self.iter_artifact_archive(filename): ++ if not filename.startswith(src_prefix): ++ self.log( ++ logging.DEBUG, ++ "artifact", ++ {"filename": filename, "src_prefix": src_prefix}, ++ "Skipping extra archive item {filename} " ++ "that does not start with {src_prefix}", ++ ) ++ continue ++ destpath = mozpath.relpath(filename, src_prefix) ++ destpath = mozpath.join(dest_prefix, destpath) ++ self.log( ++ logging.INFO, ++ "artifact", ++ {"destpath": destpath}, ++ "Adding {destpath} to processed archive", ++ ) ++ writer.add(destpath.encode("utf-8"), entry) ++ + def iter_artifact_archive(self, filename): + if filename.endswith(".zip"): + reader = JarReader(filename) +@@ -1392,7 +1458,15 @@ https://firefox-source-docs.mozilla.org/ + {"processed_filename": processed_filename}, + "Writing processed {processed_filename}", + ) +- self._artifact_job.process_artifact(filename, processed_filename) ++ try: ++ self._artifact_job.process_artifact(filename, processed_filename) ++ except Exception as e: ++ # Delete the partial output of failed processing. ++ try: ++ os.remove(processed_filename) ++ except FileNotFoundError: ++ pass ++ raise e + + self._artifact_cache._persist_limit.register_file(processed_filename) + +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 +@@ -215,8 +215,8 @@ class BuildBackend(LoggingMixin): + invalidate the XUL cache (which includes some JS) at application + startup-time. The application checks for .purgecaches in the + application directory, which varies according to +- --enable-application. There's a further wrinkle on macOS, where +- the real application directory is part of a Cocoa bundle ++ --enable-application/--enable-project. There's a further wrinkle on ++ macOS, where the real application directory is part of a Cocoa bundle + produced from the regular application directory by the build + system. In this case, we write to both locations, since the + build system recreates the Cocoa bundle from the contents of the +diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py +--- a/python/mozbuild/mozbuild/backend/recursivemake.py ++++ b/python/mozbuild/mozbuild/backend/recursivemake.py +@@ -8,26 +8,24 @@ import io + import logging + import os + import re +-import six +- + from collections import defaultdict, namedtuple + from itertools import chain + from operator import itemgetter +-from six import StringIO + +-from mozpack.manifests import InstallManifest + import mozpack.path as mozpath +- ++import six + from mozbuild import frontend + from mozbuild.frontend.context import ( + AbsolutePath, ++ ObjDirPath, + Path, + RenamedSourcePath, + SourcePath, +- ObjDirPath, + ) +-from .common import CommonBackend +-from .make import MakeBackend ++from mozbuild.shellutil import quote as shell_quote ++from mozpack.manifests import InstallManifest ++from six import StringIO ++ + from ..frontend.data import ( + BaseLibrary, + BaseProgram, +@@ -46,6 +44,7 @@ from ..frontend.data import ( + HostLibrary, + HostProgram, + HostRustProgram, ++ HostSharedLibrary, + HostSimpleProgram, + HostSources, + InstallationTarget, +@@ -58,7 +57,6 @@ from ..frontend.data import ( + ObjdirPreprocessedFiles, + PerSourceFlag, + Program, +- HostSharedLibrary, + RustProgram, + RustTests, + SandboxedWasmLibrary, +@@ -71,9 +69,10 @@ from ..frontend.data import ( + WasmSources, + XPIDLModule, + ) +-from ..util import ensureParentDir, FileAvoidWrite, OrderedDefaultDict, pairwise + from ..makeutil import Makefile +-from mozbuild.shellutil import quote as shell_quote ++from ..util import FileAvoidWrite, OrderedDefaultDict, ensureParentDir, pairwise ++from .common import CommonBackend ++from .make import MakeBackend + + # To protect against accidentally adding logic to Makefiles that belong in moz.build, + # we check if moz.build-like variables are defined in Makefiles. If they are, we throw +@@ -367,7 +366,6 @@ class RecursiveMakeBackend(MakeBackend): + self._traversal = RecursiveMakeTraversal() + self._compile_graph = OrderedDefaultDict(set) + self._rust_targets = set() +- self._rust_lib_targets = set() + self._gkrust_target = None + self._pre_compile = set() + +@@ -611,7 +609,6 @@ class RecursiveMakeBackend(MakeBackend): + build_target = self._build_target_for_obj(obj) + self._compile_graph[build_target] + self._rust_targets.add(build_target) +- self._rust_lib_targets.add(build_target) + if obj.is_gkrust: + self._gkrust_target = build_target + +@@ -774,7 +771,6 @@ class RecursiveMakeBackend(MakeBackend): + # on other directories in the tree, so putting them first here will + # start them earlier in the build. + rust_roots = sorted(r for r in roots if r in self._rust_targets) +- rust_libs = sorted(r for r in roots if r in self._rust_lib_targets) + if category == "compile" and rust_roots: + rust_rule = root_deps_mk.create_rule(["recurse_rust"]) + rust_rule.add_dependencies(rust_roots) +@@ -786,7 +782,7 @@ class RecursiveMakeBackend(MakeBackend): + # builds. + for prior_target, target in pairwise( + sorted( +- [t for t in rust_libs], key=lambda t: t != self._gkrust_target ++ [t for t in rust_roots], key=lambda t: t != self._gkrust_target + ) + ): + r = root_deps_mk.create_rule([target]) +@@ -1201,8 +1197,9 @@ class RecursiveMakeBackend(MakeBackend): + self, obj, backend_file, target_variable, target_cargo_variable + ): + backend_file.write_once("CARGO_FILE := %s\n" % obj.cargo_file) +- backend_file.write_once("CARGO_TARGET_DIR := .\n") +- backend_file.write("%s += %s\n" % (target_variable, obj.location)) ++ target_dir = mozpath.normpath(backend_file.environment.topobjdir) ++ backend_file.write_once("CARGO_TARGET_DIR := %s\n" % target_dir) ++ backend_file.write("%s += $(DEPTH)/%s\n" % (target_variable, obj.location)) + backend_file.write("%s += %s\n" % (target_cargo_variable, obj.name)) + + def _process_rust_program(self, obj, backend_file): +diff --git a/python/mozbuild/mozbuild/bootstrap.py b/python/mozbuild/mozbuild/bootstrap.py +--- a/python/mozbuild/mozbuild/bootstrap.py ++++ b/python/mozbuild/mozbuild/bootstrap.py +@@ -2,16 +2,16 @@ + # 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/. + +-from mozbuild.configure import ConfigureSandbox +-from pathlib import Path + import functools + import io + import logging + import os ++from pathlib import Path ++ ++from mozbuild.configure import ConfigureSandbox + + +-@functools.lru_cache(maxsize=None) +-def _bootstrap_sandbox(): ++def _raw_sandbox(extra_args=[]): + # Here, we don't want an existing mozconfig to interfere with what we + # do, neither do we want the default for --enable-bootstrap (which is not + # always on) to prevent this from doing something. +@@ -22,9 +22,17 @@ def _bootstrap_sandbox(): + logger.propagate = False + sandbox = ConfigureSandbox( + {}, +- argv=["configure", "--enable-bootstrap", f"MOZCONFIG={os.devnull}"], ++ argv=["configure"] ++ + extra_args ++ + ["--enable-bootstrap", f"MOZCONFIG={os.devnull}"], + logger=logger, + ) ++ return sandbox ++ ++ ++@functools.lru_cache(maxsize=None) ++def _bootstrap_sandbox(): ++ sandbox = _raw_sandbox() + moz_configure = ( + Path(__file__).parent.parent.parent.parent / "build" / "moz.configure" + ) +@@ -42,3 +50,12 @@ def bootstrap_toolchain(toolchain_job): + # Returns the path to the toolchain. + sandbox = _bootstrap_sandbox() + return sandbox._value_for(sandbox["bootstrap_path"](toolchain_job)) ++ ++ ++def bootstrap_all_toolchains_for(configure_args=[]): ++ sandbox = _raw_sandbox(configure_args) ++ moz_configure = Path(__file__).parent.parent.parent.parent / "moz.configure" ++ sandbox.include_file(str(moz_configure)) ++ for depend in sandbox._depends.values(): ++ if depend.name == "bootstrap_path": ++ depend.result() +diff --git a/python/mozbuild/mozbuild/controller/building.py b/python/mozbuild/mozbuild/controller/building.py +--- a/python/mozbuild/mozbuild/controller/building.py ++++ b/python/mozbuild/mozbuild/controller/building.py +@@ -765,11 +765,11 @@ class StaticAnalysisFooter(Footer): + processed = monitor.num_files_processed + percent = "(%.2f%%)" % (processed * 100.0 / total) + parts = [ +- ("dim", "Processing"), ++ ("bright_black", "Processing"), + ("yellow", str(processed)), +- ("dim", "of"), ++ ("bright_black", "of"), + ("yellow", str(total)), +- ("dim", "files"), ++ ("bright_black", "files"), + ("green", percent), + ] + if monitor.current_file: +diff --git a/python/mozbuild/mozbuild/frontend/gyp_reader.py b/python/mozbuild/mozbuild/frontend/gyp_reader.py +--- a/python/mozbuild/mozbuild/frontend/gyp_reader.py ++++ b/python/mozbuild/mozbuild/frontend/gyp_reader.py +@@ -4,18 +4,20 @@ + + from __future__ import absolute_import, print_function, unicode_literals + ++import os ++import sys ++import time ++ + import gyp + import gyp.msvs_emulation ++import mozpack.path as mozpath + import six +-import sys +-import os +-import time ++from mozbuild import shellutil ++from mozbuild.util import expand_variables ++from mozpack.files import FileFinder + +-import mozpack.path as mozpath +-from mozpack.files import FileFinder ++from .context import VARIABLES, ObjDirPath, SourcePath, TemplateContext + from .sandbox import alphabetical_sorted +-from .context import ObjDirPath, SourcePath, TemplateContext, VARIABLES +-from mozbuild.util import expand_variables + + # Define this module as gyp.generator.mozbuild so that gyp can use it + # as a generator under the name "mozbuild". +@@ -443,6 +445,12 @@ class GypProcessor(object): + "build_files": [path], + "root_targets": None, + } ++ # The NSS gyp configuration uses CC and CFLAGS to determine the ++ # floating-point ABI on arm. ++ os.environ.update( ++ CC=config.substs["CC"], ++ CFLAGS=shellutil.quote(*config.substs["CC_BASE_FLAGS"]), ++ ) + + if gyp_dir_attrs.no_chromium: + includes = [] +diff --git a/python/mozbuild/mozbuild/generated_sources.py b/python/mozbuild/mozbuild/generated_sources.py +--- a/python/mozbuild/mozbuild/generated_sources.py ++++ b/python/mozbuild/mozbuild/generated_sources.py +@@ -8,8 +8,10 @@ import hashlib + import json + import os + ++import mozpack.path as mozpath + from mozpack.files import FileFinder +-import mozpack.path as mozpath ++ ++GENERATED_SOURCE_EXTS = (".rs", ".c", ".h", ".cc", ".cpp") + + + def sha512_digest(data): +@@ -56,7 +58,7 @@ def get_generated_sources(): + base = mozpath.join(buildconfig.substs["RUST_TARGET"], rust_build_kind, "build") + finder = FileFinder(mozpath.join(buildconfig.topobjdir, base)) + for p, f in finder: +- if p.endswith((".rs", ".c", ".h", ".cc", ".cpp")): ++ if p.endswith(GENERATED_SOURCE_EXTS): + yield mozpath.join(base, p), f + + +diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py +--- a/python/mozbuild/mozbuild/mach_commands.py ++++ b/python/mozbuild/mozbuild/mach_commands.py +@@ -5,6 +5,7 @@ + from __future__ import absolute_import, print_function, unicode_literals + + import argparse ++import errno + import itertools + import json + import logging +@@ -17,26 +18,20 @@ import subprocess + import sys + import tempfile + import time +-import errno ++from pathlib import Path + + import mozbuild.settings # noqa need @SettingsProvider hook to execute + import mozpack.path as mozpath +- +-from pathlib import Path + from mach.decorators import ( ++ Command, + CommandArgument, + CommandArgumentGroup, +- Command, + SettingsProvider, + SubCommand, + ) +- +-from mozbuild.base import ( +- BinaryNotFoundException, +- BuildEnvironmentNotFoundException, +- MachCommandConditions as conditions, +- MozbuildObject, +-) ++from mozbuild.base import BinaryNotFoundException, BuildEnvironmentNotFoundException ++from mozbuild.base import MachCommandConditions as conditions ++from mozbuild.base import MozbuildObject + from mozbuild.util import MOZBUILD_METRICS_PATH + + here = os.path.abspath(os.path.dirname(__file__)) +@@ -217,6 +212,114 @@ def check( + + @SubCommand( + "cargo", ++ "udeps", ++ description="Run `cargo udeps` on a given crate. Defaults to gkrust.", ++ metrics_path=MOZBUILD_METRICS_PATH, ++) ++@CommandArgument( ++ "--all-crates", ++ action="store_true", ++ help="Check all of the crates in the tree.", ++) ++@CommandArgument("crates", default=None, nargs="*", help="The crate name(s) to check.") ++@CommandArgument( ++ "--jobs", ++ "-j", ++ default="0", ++ nargs="?", ++ metavar="jobs", ++ type=int, ++ help="Run the tests in parallel using multiple processes.", ++) ++@CommandArgument("-v", "--verbose", action="store_true", help="Verbose output.") ++@CommandArgument( ++ "--message-format-json", ++ action="store_true", ++ help="Emit error messages as JSON.", ++) ++@CommandArgument( ++ "--expect-unused", ++ action="store_true", ++ help="Do not return an error exit code if udeps detects unused dependencies.", ++) ++def udeps( ++ command_context, ++ all_crates=None, ++ crates=None, ++ jobs=0, ++ verbose=False, ++ message_format_json=False, ++ expect_unused=False, ++): ++ from mozbuild.controller.building import BuildDriver ++ ++ command_context.log_manager.enable_all_structured_loggers() ++ ++ try: ++ command_context.config_environment ++ except BuildEnvironmentNotFoundException: ++ build = command_context._spawn(BuildDriver) ++ ret = build.build( ++ command_context.metrics, ++ what=["pre-export", "export"], ++ jobs=jobs, ++ verbose=verbose, ++ mach_context=command_context._mach_context, ++ ) ++ if ret != 0: ++ return ret ++ # XXX duplication with `mach vendor rust` ++ crates_and_roots = { ++ "gkrust": "toolkit/library/rust", ++ "gkrust-gtest": "toolkit/library/gtest/rust", ++ "geckodriver": "testing/geckodriver", ++ } ++ ++ if all_crates: ++ crates = crates_and_roots.keys() ++ elif not crates: ++ crates = ["gkrust"] ++ ++ for crate in crates: ++ root = crates_and_roots.get(crate, None) ++ if not root: ++ print( ++ "Cannot locate crate %s. Please check your spelling or " ++ "add the crate information to the list." % crate ++ ) ++ return 1 ++ ++ udeps_targets = [ ++ "force-cargo-library-udeps", ++ "force-cargo-host-library-udeps", ++ "force-cargo-program-udeps", ++ "force-cargo-host-program-udeps", ++ ] ++ ++ append_env = {} ++ if message_format_json: ++ append_env["USE_CARGO_JSON_MESSAGE_FORMAT"] = "1" ++ if expect_unused: ++ append_env["CARGO_UDEPS_EXPECT_ERR"] = "1" ++ ++ ret = command_context._run_make( ++ srcdir=False, ++ directory=root, ++ ensure_exit_code=0, ++ silent=not verbose, ++ print_directory=False, ++ target=udeps_targets, ++ num_jobs=jobs, ++ append_env=append_env, ++ ) ++ if ret != 0: ++ return ret ++ ++ return 0 ++ ++ ++@SubCommand( ++ "cargo", + "vet", + description="Run `cargo vet`.", + ) +@@ -278,6 +381,209 @@ def cargo_vet(command_context, arguments + return res if stdout else res.returncode + + ++@SubCommand( ++ "cargo", ++ "clippy", ++ description="Run `cargo clippy` on a given crate. Defaults to gkrust.", ++ metrics_path=MOZBUILD_METRICS_PATH, ++) ++@CommandArgument( ++ "--all-crates", ++ default=None, ++ action="store_true", ++ help="Check all of the crates in the tree.", ++) ++@CommandArgument("crates", default=None, nargs="*", help="The crate name(s) to check.") ++@CommandArgument( ++ "--jobs", ++ "-j", ++ default="0", ++ nargs="?", ++ metavar="jobs", ++ type=int, ++ help="Run the tests in parallel using multiple processes.", ++) ++@CommandArgument("-v", "--verbose", action="store_true", help="Verbose output.") ++@CommandArgument( ++ "--message-format-json", ++ action="store_true", ++ help="Emit error messages as JSON.", ++) ++def clippy( ++ command_context, ++ all_crates=None, ++ crates=None, ++ jobs=0, ++ verbose=False, ++ message_format_json=False, ++): ++ from mozbuild.controller.building import BuildDriver ++ ++ command_context.log_manager.enable_all_structured_loggers() ++ ++ try: ++ command_context.config_environment ++ except BuildEnvironmentNotFoundException: ++ build = command_context._spawn(BuildDriver) ++ ret = build.build( ++ command_context.metrics, ++ what=["pre-export", "export"], ++ jobs=jobs, ++ verbose=verbose, ++ mach_context=command_context._mach_context, ++ ) ++ if ret != 0: ++ return ret ++ # XXX duplication with `mach vendor rust` ++ crates_and_roots = { ++ "gkrust": "toolkit/library/rust", ++ "gkrust-gtest": "toolkit/library/gtest/rust", ++ "geckodriver": "testing/geckodriver", ++ } ++ ++ if all_crates: ++ crates = crates_and_roots.keys() ++ elif crates is None or crates == []: ++ crates = ["gkrust"] ++ ++ final_ret = 0 ++ ++ for crate in crates: ++ root = crates_and_roots.get(crate, None) ++ if not root: ++ print( ++ "Cannot locate crate %s. Please check your spelling or " ++ "add the crate information to the list." % crate ++ ) ++ return 1 ++ ++ check_targets = [ ++ "force-cargo-library-clippy", ++ "force-cargo-host-library-clippy", ++ "force-cargo-program-clippy", ++ "force-cargo-host-program-clippy", ++ ] ++ ++ append_env = {} ++ if message_format_json: ++ append_env["USE_CARGO_JSON_MESSAGE_FORMAT"] = "1" ++ ++ ret = 2 ++ ++ try: ++ ret = command_context._run_make( ++ srcdir=False, ++ directory=root, ++ ensure_exit_code=0, ++ silent=not verbose, ++ print_directory=False, ++ target=check_targets, ++ num_jobs=jobs, ++ append_env=append_env, ++ ) ++ except Exception as e: ++ print("%s" % e) ++ if ret != 0: ++ final_ret = ret ++ ++ return final_ret ++ ++ ++@SubCommand( ++ "cargo", ++ "audit", ++ description="Run `cargo audit` on a given crate. Defaults to gkrust.", ++) ++@CommandArgument( ++ "--all-crates", ++ action="store_true", ++ help="Run `cargo audit` on all the crates in the tree.", ++) ++@CommandArgument( ++ "crates", ++ default=None, ++ nargs="*", ++ help="The crate name(s) to run `cargo audit` on.", ++) ++@CommandArgument( ++ "--jobs", ++ "-j", ++ default="0", ++ nargs="?", ++ metavar="jobs", ++ type=int, ++ help="Run `audit` in parallel using multiple processes.", ++) ++@CommandArgument("-v", "--verbose", action="store_true", help="Verbose output.") ++@CommandArgument( ++ "--message-format-json", ++ action="store_true", ++ help="Emit error messages as JSON.", ++) ++def audit( ++ command_context, ++ all_crates=None, ++ crates=None, ++ jobs=0, ++ verbose=False, ++ message_format_json=False, ++): ++ # XXX duplication with `mach vendor rust` ++ crates_and_roots = { ++ "gkrust": "toolkit/library/rust", ++ "gkrust-gtest": "toolkit/library/gtest/rust", ++ "geckodriver": "testing/geckodriver", ++ } ++ ++ if all_crates: ++ crates = crates_and_roots.keys() ++ elif not crates: ++ crates = ["gkrust"] ++ ++ final_ret = 0 ++ ++ for crate in crates: ++ root = crates_and_roots.get(crate, None) ++ if not root: ++ print( ++ "Cannot locate crate %s. Please check your spelling or " ++ "add the crate information to the list." % crate ++ ) ++ return 1 ++ ++ check_targets = [ ++ "force-cargo-library-audit", ++ "force-cargo-host-library-audit", ++ "force-cargo-program-audit", ++ "force-cargo-host-program-audit", ++ ] ++ ++ append_env = {} ++ if message_format_json: ++ append_env["USE_CARGO_JSON_MESSAGE_FORMAT"] = "1" ++ ++ ret = 2 ++ ++ try: ++ ret = command_context._run_make( ++ srcdir=False, ++ directory=root, ++ ensure_exit_code=0, ++ silent=not verbose, ++ print_directory=False, ++ target=check_targets ++ + ["cargo_build_flags=-f %s/Cargo.lock" % command_context.topsrcdir], ++ num_jobs=jobs, ++ append_env=append_env, ++ ) ++ except Exception as e: ++ print("%s" % e) ++ if ret != 0: ++ final_ret = ret ++ ++ return final_ret ++ ++ + @Command( + "doctor", + category="devenv", +@@ -891,8 +1197,9 @@ def gtest( + pass_thru=True, + ) + ++ import functools ++ + from mozprocess import ProcessHandlerMixin +- import functools + + def handle_line(job_id, line): + # Prepend the jobId +@@ -946,7 +1253,7 @@ def android_gtest( + setup_logging("mach-gtest", {}, {default_format: sys.stdout}, format_args) + + # ensure that a device is available and test app is installed +- from mozrunner.devices.android_device import verify_android_device, get_adb_path ++ from mozrunner.devices.android_device import get_adb_path, verify_android_device + + verify_android_device( + command_context, install=install, app=package, device_serial=device_serial +@@ -1046,8 +1353,8 @@ def install(command_context, **kwargs): + """Install a package.""" + if conditions.is_android(command_context): + from mozrunner.devices.android_device import ( ++ InstallIntent, + verify_android_device, +- InstallIntent, + ) + + ret = ( +@@ -1386,9 +1693,9 @@ def _run_android( + use_existing_process=False, + ): + from mozrunner.devices.android_device import ( +- verify_android_device, ++ InstallIntent, + _get_device, +- InstallIntent, ++ verify_android_device, + ) + from six.moves import shlex_quote + +@@ -1782,7 +2089,7 @@ def _run_desktop( + stacks, + show_dump_stats, + ): +- from mozprofile import Profile, Preferences ++ from mozprofile import Preferences, Profile + + try: + if packaged: +@@ -2106,7 +2413,34 @@ def repackage(command_context): + scriptworkers in order to bundle things up into shippable formats, such as a + .dmg on OSX or an installer exe on Windows. + """ +- print("Usage: ./mach repackage [dmg|installer|mar] [args...]") ++ print("Usage: ./mach repackage [dmg|pkg|installer|mar] [args...]") ++ ++ ++@SubCommand( ++ "repackage", "deb", description="Repackage a tar file into a .deb for Linux" ++) ++@CommandArgument("--input", "-i", type=str, required=True, help="Input filename") ++@CommandArgument("--output", "-o", type=str, required=True, help="Output filename") ++@CommandArgument("--arch", type=str, required=True, help="One of ['x86', 'x86_64']") ++@CommandArgument( ++ "--templates", ++ type=str, ++ required=True, ++ help="Location of the templates used to generate the debian/ directory files", ++) ++def repackage_deb(command_context, input, output, arch, templates): ++ if not os.path.exists(input): ++ print("Input file does not exist: %s" % input) ++ return 1 ++ ++ template_dir = os.path.join( ++ command_context.topsrcdir, ++ templates, ++ ) ++ ++ from mozbuild.repackaging.deb import repackage_deb ++ ++ repackage_deb(input, output, template_dir, arch) + + + @SubCommand("repackage", "dmg", description="Repackage a tar file into a .dmg for OSX") +@@ -2117,18 +2451,24 @@ def repackage_dmg(command_context, input + print("Input file does not exist: %s" % input) + return 1 + +- if not os.path.exists(os.path.join(command_context.topobjdir, "config.status")): +- print( +- "config.status not found. Please run |mach configure| " +- "prior to |mach repackage|." +- ) +- return 1 +- + from mozbuild.repackaging.dmg import repackage_dmg + + repackage_dmg(input, output) + + ++@SubCommand("repackage", "pkg", description="Repackage a tar file into a .pkg for OSX") ++@CommandArgument("--input", "-i", type=str, required=True, help="Input filename") ++@CommandArgument("--output", "-o", type=str, required=True, help="Output filename") ++def repackage_pkg(command_context, input, output): ++ if not os.path.exists(input): ++ print("Input file does not exist: %s" % input) ++ return 1 ++ ++ from mozbuild.repackaging.pkg import repackage_pkg ++ ++ repackage_pkg(input, output) ++ ++ + @SubCommand( + "repackage", "installer", description="Repackage into a Windows installer exe" + ) +diff --git a/python/mozbuild/mozbuild/repackaging/dmg.py b/python/mozbuild/mozbuild/repackaging/dmg.py +--- a/python/mozbuild/mozbuild/repackaging/dmg.py ++++ b/python/mozbuild/mozbuild/repackaging/dmg.py +@@ -2,16 +2,13 @@ + # 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/. + +-from __future__ import absolute_import, print_function ++import tarfile ++from pathlib import Path + +-import errno +-import os +-import tempfile +-import tarfile +-import shutil +-import mozpack.path as mozpath ++import mozfile ++from mozbuild.bootstrap import bootstrap_toolchain ++from mozbuild.repackaging.application_ini import get_application_ini_value + from mozpack.dmg import create_dmg +-from mozbuild.repackaging.application_ini import get_application_ini_value + + + def repackage_dmg(infile, output): +@@ -19,27 +16,41 @@ def repackage_dmg(infile, output): + if not tarfile.is_tarfile(infile): + raise Exception("Input file %s is not a valid tarfile." % infile) + +- tmpdir = tempfile.mkdtemp() +- try: ++ # Resolve required tools ++ dmg_tool = bootstrap_toolchain("dmg/dmg") ++ if not dmg_tool: ++ raise Exception("DMG tool not found") ++ hfs_tool = bootstrap_toolchain("dmg/hfsplus") ++ if not hfs_tool: ++ raise Exception("HFS tool not found") ++ mkfshfs_tool = bootstrap_toolchain("hfsplus/newfs_hfs") ++ if not mkfshfs_tool: ++ raise Exception("MKFSHFS tool not found") ++ ++ with mozfile.TemporaryDirectory() as tmp: ++ tmpdir = Path(tmp) + with tarfile.open(infile) as tar: + tar.extractall(path=tmpdir) + + # Remove the /Applications symlink. If we don't, an rsync command in + # create_dmg() will break, and create_dmg() re-creates the symlink anyway. +- try: +- os.remove(mozpath.join(tmpdir, " ")) +- except OSError as e: +- if e.errno != errno.ENOENT: +- raise ++ symlink = tmpdir / " " ++ if symlink.is_file(): ++ symlink.unlink() + + volume_name = get_application_ini_value( +- tmpdir, "App", "CodeName", fallback="Name" ++ str(tmpdir), "App", "CodeName", fallback="Name" + ) + + # The extra_files argument is empty [] because they are already a part + # of the original dmg produced by the build, and they remain in the + # tarball generated by the signing task. +- create_dmg(tmpdir, output, volume_name, []) +- +- finally: +- shutil.rmtree(tmpdir) ++ create_dmg( ++ source_directory=tmpdir, ++ output_dmg=Path(output), ++ volume_name=volume_name, ++ extra_files=[], ++ dmg_tool=Path(dmg_tool), ++ hfs_tool=Path(hfs_tool), ++ mkfshfs_tool=Path(mkfshfs_tool), ++ ) +diff --git a/python/mozbuild/mozbuild/test/action/test_langpack_manifest.py b/python/mozbuild/mozbuild/test/action/test_langpack_manifest.py +--- a/python/mozbuild/mozbuild/test/action/test_langpack_manifest.py ++++ b/python/mozbuild/mozbuild/test/action/test_langpack_manifest.py +@@ -5,14 +5,13 @@ + + from __future__ import absolute_import, print_function + +-import unittest + import json + import os +- +-import mozunit ++import tempfile ++import unittest + + import mozbuild.action.langpack_manifest as langpack_manifest +-from mozbuild.preprocessor import Context ++import mozunit + + + class TestGenerateManifest(unittest.TestCase): +@@ -20,16 +19,30 @@ class TestGenerateManifest(unittest.Test + Unit tests for langpack_manifest.py. + """ + ++ def test_parse_flat_ftl(self): ++ src = """ ++langpack-creator = bar {"bar"} ++langpack-contributors = { "" } ++""" ++ tmp = tempfile.NamedTemporaryFile(mode="wt", suffix=".ftl", delete=False) ++ try: ++ tmp.write(src) ++ tmp.close() ++ ftl = langpack_manifest.parse_flat_ftl(tmp.name) ++ self.assertEqual(ftl["langpack-creator"], "bar bar") ++ self.assertEqual(ftl["langpack-contributors"], "") ++ finally: ++ os.remove(tmp.name) ++ ++ def test_parse_flat_ftl_missing(self): ++ ftl = langpack_manifest.parse_flat_ftl("./does-not-exist.ftl") ++ self.assertEqual(len(ftl), 0) ++ + def test_manifest(self): +- ctx = Context() +- ctx["MOZ_LANG_TITLE"] = "Finnish" +- ctx["MOZ_LANGPACK_CREATOR"] = "Suomennosprojekti" +- ctx[ +- "MOZ_LANGPACK_CONTRIBUTORS" +- ] = """ +- Joe Smith +- Mary White +- """ ++ ctx = { ++ "langpack-creator": "Suomennosprojekti", ++ "langpack-contributors": "Joe Smith, Mary White", ++ } + os.environ["MOZ_BUILD_DATE"] = "20210928100000" + manifest = langpack_manifest.create_webmanifest( + "fi", +@@ -44,16 +57,17 @@ class TestGenerateManifest(unittest.Test + ) + + data = json.loads(manifest) +- self.assertEqual(data["name"], "Finnish Language Pack") ++ self.assertEqual(data["name"], "Language Pack: Suomi (Finnish)") + self.assertEqual( + data["author"], "Suomennosprojekti (contributors: Joe Smith, Mary White)" + ) + self.assertEqual(data["version"], "57.0.1buildid20210928.100000") + + def test_manifest_without_contributors(self): +- ctx = Context() +- ctx["MOZ_LANG_TITLE"] = "Finnish" +- ctx["MOZ_LANGPACK_CREATOR"] = "Suomennosprojekti" ++ ctx = { ++ "langpack-creator": "Suomennosprojekti", ++ "langpack-contributors": "", ++ } + manifest = langpack_manifest.create_webmanifest( + "fi", + "57.0.1", +@@ -67,7 +81,7 @@ class TestGenerateManifest(unittest.Test + ) + + data = json.loads(manifest) +- self.assertEqual(data["name"], "Finnish Language Pack") ++ self.assertEqual(data["name"], "Language Pack: Suomi (Finnish)") + self.assertEqual(data["author"], "Suomennosprojekti") + + +diff --git a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py +--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py ++++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py +@@ -6,21 +6,18 @@ from __future__ import absolute_import, + + import io + import os +-import six.moves.cPickle as pickle +-import six + import unittest + +-from mozpack.manifests import InstallManifest +-from mozunit import main +- ++import mozpack.path as mozpath ++import six ++import six.moves.cPickle as pickle + from mozbuild.backend.recursivemake import RecursiveMakeBackend, RecursiveMakeTraversal + from mozbuild.backend.test_manifest import TestManifestBackend + from mozbuild.frontend.emitter import TreeMetadataEmitter + from mozbuild.frontend.reader import BuildReader +- + from mozbuild.test.backend.common import BackendTester +- +-import mozpack.path as mozpath ++from mozpack.manifests import InstallManifest ++from mozunit import main + + + class TestRecursiveMakeTraversal(unittest.TestCase): +@@ -1011,10 +1008,10 @@ class TestRecursiveMakeBackend(BackendTe + + expected = [ + "CARGO_FILE := %s/code/Cargo.toml" % env.topsrcdir, +- "CARGO_TARGET_DIR := .", +- "RUST_PROGRAMS += i686-pc-windows-msvc/release/target.exe", ++ "CARGO_TARGET_DIR := %s" % env.topobjdir, ++ "RUST_PROGRAMS += $(DEPTH)/i686-pc-windows-msvc/release/target.exe", + "RUST_CARGO_PROGRAMS += target", +- "HOST_RUST_PROGRAMS += i686-pc-windows-msvc/release/host.exe", ++ "HOST_RUST_PROGRAMS += $(DEPTH)/i686-pc-windows-msvc/release/host.exe", + "HOST_RUST_CARGO_PROGRAMS += host", + ] + +diff --git a/python/mozbuild/mozbuild/vendor/moz_yaml.py b/python/mozbuild/mozbuild/vendor/moz_yaml.py +--- a/python/mozbuild/mozbuild/vendor/moz_yaml.py ++++ b/python/mozbuild/mozbuild/vendor/moz_yaml.py +@@ -104,6 +104,10 @@ origin: + # optional + license-file: COPYING + ++ # If there are any mozilla-specific notes you want to put ++ # about a library, they can be put here. ++ notes: Notes about the library ++ + # Configuration for the automated vendoring system. + # optional + vendoring: +@@ -379,6 +383,7 @@ def _schema_1(): + "origin": { + Required("name"): All(str, Length(min=1)), + Required("description"): All(str, Length(min=1)), ++ "notes": All(str, Length(min=1)), + Required("url"): FqdnUrl(), + Required("license"): Msg(License(), msg="Unsupported License"), + "license-file": All(str, Length(min=1)), +diff --git a/python/mozbuild/mozbuild/vendor/vendor_manifest.py b/python/mozbuild/mozbuild/vendor/vendor_manifest.py +--- a/python/mozbuild/mozbuild/vendor/vendor_manifest.py ++++ b/python/mozbuild/mozbuild/vendor/vendor_manifest.py +@@ -25,7 +25,7 @@ from mozbuild.vendor.rewrite_mozbuild im + MozBuildRewriteException, + ) + +-DEFAULT_EXCLUDE_FILES = [".git*"] ++DEFAULT_EXCLUDE_FILES = [".git*", ".git*/**"] + DEFAULT_KEEP_FILES = ["**/moz.build", "**/moz.yaml"] + DEFAULT_INCLUDE_FILES = [] + +diff --git a/python/mozbuild/mozbuild/vendor/vendor_rust.py b/python/mozbuild/mozbuild/vendor/vendor_rust.py +--- a/python/mozbuild/mozbuild/vendor/vendor_rust.py ++++ b/python/mozbuild/mozbuild/vendor/vendor_rust.py +@@ -196,6 +196,7 @@ class VendorRust(MozbuildObject): + f + for f in self.repository.get_changed_files("M") + if os.path.basename(f) not in ("Cargo.toml", "Cargo.lock") ++ and not f.startswith("supply-chain/") + ] + if modified: + self.log( +diff --git a/python/mozbuild/mozpack/dmg.py b/python/mozbuild/mozpack/dmg.py +--- a/python/mozbuild/mozpack/dmg.py ++++ b/python/mozbuild/mozpack/dmg.py +@@ -2,28 +2,18 @@ + # 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/. + +-from __future__ import absolute_import, print_function, unicode_literals +- +-import buildconfig +-import errno +-import mozfile + import os + import platform + import shutil + import subprocess ++from pathlib import Path ++from typing import List + ++import mozfile + from mozbuild.util import ensureParentDir + + is_linux = platform.system() == "Linux" +- +- +-def mkdir(dir): +- if not os.path.isdir(dir): +- try: +- os.makedirs(dir) +- except OSError as e: +- if e.errno != errno.EEXIST: +- raise ++is_osx = platform.system() == "Darwin" + + + def chmod(dir): +@@ -31,48 +21,50 @@ def chmod(dir): + subprocess.check_call(["chmod", "-R", "a+rX,a-st,u+w,go-w", dir]) + + +-def rsync(source, dest): ++def rsync(source: Path, dest: Path): + "rsync the contents of directory source into directory dest" + # Ensure a trailing slash on directories so rsync copies the *contents* of source. +- if not source.endswith("/") and os.path.isdir(source): +- source += "/" +- subprocess.check_call(["rsync", "-a", "--copy-unsafe-links", source, dest]) ++ raw_source = str(source) ++ if source.is_dir(): ++ raw_source = str(source) + "/" ++ subprocess.check_call(["rsync", "-a", "--copy-unsafe-links", raw_source, dest]) + + +-def set_folder_icon(dir, tmpdir): ++def set_folder_icon(dir: Path, tmpdir: Path, hfs_tool: Path = None): + "Set HFS attributes of dir to use a custom icon" +- if not is_linux: ++ if is_linux: ++ hfs = tmpdir / "staged.hfs" ++ subprocess.check_call([hfs_tool, hfs, "attr", "/", "C"]) ++ elif is_osx: + subprocess.check_call(["SetFile", "-a", "C", dir]) +- else: +- hfs = os.path.join(tmpdir, "staged.hfs") +- subprocess.check_call([buildconfig.substs["HFS_TOOL"], hfs, "attr", "/", "C"]) + + +-def generate_hfs_file(stagedir, tmpdir, volume_name): ++def generate_hfs_file( ++ stagedir: Path, tmpdir: Path, volume_name: str, mkfshfs_tool: Path ++): + """ + When cross compiling, we zero fill an hfs file, that we will turn into + a DMG. To do so we test the size of the staged dir, and add some slight + padding to that. + """ +- if is_linux: +- hfs = os.path.join(tmpdir, "staged.hfs") +- output = subprocess.check_output(["du", "-s", stagedir]) +- size = int(output.split()[0]) / 1000 # Get in MB +- size = int(size * 1.02) # Bump the used size slightly larger. +- # Setup a proper file sized out with zero's +- subprocess.check_call( +- [ +- "dd", +- "if=/dev/zero", +- "of={}".format(hfs), +- "bs=1M", +- "count={}".format(size), +- ] +- ) +- subprocess.check_call([buildconfig.substs["MKFSHFS"], "-v", volume_name, hfs]) ++ hfs = tmpdir / "staged.hfs" ++ output = subprocess.check_output(["du", "-s", stagedir]) ++ size = int(output.split()[0]) / 1000 # Get in MB ++ size = int(size * 1.02) # Bump the used size slightly larger. ++ # Setup a proper file sized out with zero's ++ subprocess.check_call( ++ [ ++ "dd", ++ "if=/dev/zero", ++ "of={}".format(hfs), ++ "bs=1M", ++ "count={}".format(size), ++ ] ++ ) ++ subprocess.check_call([mkfshfs_tool, "-v", volume_name, hfs]) + + +-def create_app_symlink(stagedir, tmpdir): ++def create_app_symlink(stagedir: Path, tmpdir: Path, hfs_tool: Path = None): + """ + Make a symlink to /Applications. The symlink name is a space + so we don't have to localize it. The Applications folder icon +@@ -80,18 +72,34 @@ def create_app_symlink(stagedir, tmpdir) + """ + if is_linux: + hfs = os.path.join(tmpdir, "staged.hfs") +- subprocess.check_call( +- [buildconfig.substs["HFS_TOOL"], hfs, "symlink", "/ ", "/Applications"] +- ) +- else: +- os.symlink("/Applications", os.path.join(stagedir, " ")) ++ subprocess.check_call([hfs_tool, hfs, "symlink", "/ ", "/Applications"]) ++ elif is_osx: ++ os.symlink("/Applications", stagedir / " ") + + +-def create_dmg_from_staged(stagedir, output_dmg, tmpdir, volume_name): ++def create_dmg_from_staged( ++ stagedir: Path, ++ output_dmg: Path, ++ tmpdir: Path, ++ volume_name: str, ++ hfs_tool: Path = None, ++ dmg_tool: Path = None, ++): + "Given a prepared directory stagedir, produce a DMG at output_dmg." +- if not is_linux: +- # Running on OS X +- hybrid = os.path.join(tmpdir, "hybrid.dmg") ++ if is_linux: ++ # The dmg tool doesn't create the destination directories, and silently ++ # returns success if the parent directory doesn't exist. ++ ensureParentDir(output_dmg) ++ ++ hfs = os.path.join(tmpdir, "staged.hfs") ++ subprocess.check_call([hfs_tool, hfs, "addall", stagedir]) ++ subprocess.check_call( ++ [dmg_tool, "build", hfs, output_dmg], ++ # dmg is seriously chatty ++ stdout=subprocess.DEVNULL, ++ ) ++ elif is_osx: ++ hybrid = tmpdir / "hybrid.dmg" + subprocess.check_call( + [ + "hdiutil", +@@ -121,37 +129,17 @@ def create_dmg_from_staged(stagedir, out + output_dmg, + ] + ) +- else: +- # The dmg tool doesn't create the destination directories, and silently +- # returns success if the parent directory doesn't exist. +- ensureParentDir(output_dmg) +- +- hfs = os.path.join(tmpdir, "staged.hfs") +- subprocess.check_call([buildconfig.substs["HFS_TOOL"], hfs, "addall", stagedir]) +- subprocess.check_call( +- [buildconfig.substs["DMG_TOOL"], "build", hfs, output_dmg], +- # dmg is seriously chatty +- stdout=open(os.devnull, "wb"), +- ) + + +-def check_tools(*tools): +- """ +- Check that each tool named in tools exists in SUBSTS and is executable. +- """ +- for tool in tools: +- path = buildconfig.substs[tool] +- if not path: +- raise Exception('Required tool "%s" not found' % tool) +- if not os.path.isfile(path): +- raise Exception('Required tool "%s" not found at path "%s"' % (tool, path)) +- if not os.access(path, os.X_OK): +- raise Exception( +- 'Required tool "%s" at path "%s" is not executable' % (tool, path) +- ) +- +- +-def create_dmg(source_directory, output_dmg, volume_name, extra_files): ++def create_dmg( ++ source_directory: Path, ++ output_dmg: Path, ++ volume_name: str, ++ extra_files: List[tuple], ++ dmg_tool: Path, ++ hfs_tool: Path, ++ mkfshfs_tool: Path, ++): + """ + Create a DMG disk image at the path output_dmg from source_directory. + +@@ -162,73 +150,80 @@ def create_dmg(source_directory, output_ + if platform.system() not in ("Darwin", "Linux"): + raise Exception("Don't know how to build a DMG on '%s'" % platform.system()) + +- if is_linux: +- check_tools("DMG_TOOL", "MKFSHFS", "HFS_TOOL") +- with mozfile.TemporaryDirectory() as tmpdir: +- stagedir = os.path.join(tmpdir, "stage") +- os.mkdir(stagedir) ++ with mozfile.TemporaryDirectory() as tmp: ++ tmpdir = Path(tmp) ++ stagedir = tmpdir / "stage" ++ stagedir.mkdir() ++ + # Copy the app bundle over using rsync + rsync(source_directory, stagedir) + # Copy extra files + for source, target in extra_files: +- full_target = os.path.join(stagedir, target) +- mkdir(os.path.dirname(full_target)) ++ full_target = stagedir / target ++ full_target.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(source, full_target) +- generate_hfs_file(stagedir, tmpdir, volume_name) +- create_app_symlink(stagedir, tmpdir) ++ if is_linux: ++ # Not needed in osx ++ generate_hfs_file(stagedir, tmpdir, volume_name, mkfshfs_tool) ++ create_app_symlink(stagedir, tmpdir, hfs_tool) + # Set the folder attributes to use a custom icon +- set_folder_icon(stagedir, tmpdir) ++ set_folder_icon(stagedir, tmpdir, hfs_tool) + chmod(stagedir) +- create_dmg_from_staged(stagedir, output_dmg, tmpdir, volume_name) ++ create_dmg_from_staged( ++ stagedir, output_dmg, tmpdir, volume_name, hfs_tool, dmg_tool ++ ) + + +-def extract_dmg_contents(dmgfile, destdir): +- import buildconfig +- ++def extract_dmg_contents( ++ dmgfile: Path, ++ destdir: Path, ++ dmg_tool: Path = None, ++ hfs_tool: Path = None, ++): + if is_linux: + with mozfile.TemporaryDirectory() as tmpdir: + hfs_file = os.path.join(tmpdir, "firefox.hfs") + subprocess.check_call( +- [buildconfig.substs["DMG_TOOL"], "extract", dmgfile, hfs_file], ++ [dmg_tool, "extract", dmgfile, hfs_file], + # dmg is seriously chatty +- stdout=open(os.devnull, "wb"), +- ) +- subprocess.check_call( +- [buildconfig.substs["HFS_TOOL"], hfs_file, "extractall", "/", destdir] ++ stdout=subprocess.DEVNULL, + ) ++ subprocess.check_call([hfs_tool, hfs_file, "extractall", "/", destdir]) + else: +- unpack_diskimage = os.path.join( +- buildconfig.topsrcdir, "build", "package", "mac_osx", "unpack-diskimage" +- ) +- unpack_mountpoint = os.path.join( +- "/tmp", "{}-unpack".format(buildconfig.substs["MOZ_APP_NAME"]) +- ) ++ # TODO: find better way to resolve topsrcdir (checkout directory) ++ topsrcdir = Path(__file__).parent.parent.parent.parent.resolve() ++ unpack_diskimage = topsrcdir / "build/package/mac_osx/unpack-diskimage" ++ unpack_mountpoint = Path("/tmp/app-unpack") + subprocess.check_call([unpack_diskimage, dmgfile, unpack_mountpoint, destdir]) + + +-def extract_dmg(dmgfile, output, dsstore=None, icon=None, background=None): ++def extract_dmg( ++ dmgfile: Path, ++ output: Path, ++ dmg_tool: Path = None, ++ hfs_tool: Path = None, ++ dsstore: Path = None, ++ icon: Path = None, ++ background: Path = None, ++): + if platform.system() not in ("Darwin", "Linux"): + raise Exception("Don't know how to extract a DMG on '%s'" % platform.system()) + +- if is_linux: +- check_tools("DMG_TOOL", "MKFSHFS", "HFS_TOOL") +- +- with mozfile.TemporaryDirectory() as tmpdir: +- extract_dmg_contents(dmgfile, tmpdir) +- if os.path.islink(os.path.join(tmpdir, " ")): ++ with mozfile.TemporaryDirectory() as tmp: ++ tmpdir = Path(tmp) ++ extract_dmg_contents(dmgfile, tmpdir, dmg_tool, hfs_tool) ++ applications_symlink = tmpdir / " " ++ if applications_symlink.is_symlink(): + # Rsync will fail on the presence of this symlink +- os.remove(os.path.join(tmpdir, " ")) ++ applications_symlink.unlink() + rsync(tmpdir, output) + + if dsstore: +- mkdir(os.path.dirname(dsstore)) +- rsync(os.path.join(tmpdir, ".DS_Store"), dsstore) ++ dsstore.parent.mkdir(parents=True, exist_ok=True) ++ rsync(tmpdir / ".DS_Store", dsstore) + if background: +- mkdir(os.path.dirname(background)) +- rsync( +- os.path.join(tmpdir, ".background", os.path.basename(background)), +- background, +- ) ++ background.parent.mkdir(parents=True, exist_ok=True) ++ rsync(tmpdir / ".background" / background.name, background) + if icon: +- mkdir(os.path.dirname(icon)) +- rsync(os.path.join(tmpdir, ".VolumeIcon.icns"), icon) ++ icon.parent.mkdir(parents=True, exist_ok=True) ++ rsync(tmpdir / ".VolumeIcon.icns", icon) +diff --git a/python/mozbuild/mozpack/mozjar.py b/python/mozbuild/mozpack/mozjar.py +--- a/python/mozbuild/mozpack/mozjar.py ++++ b/python/mozbuild/mozpack/mozjar.py +@@ -287,12 +287,22 @@ class JarFileReader(object): + self.compressed = header["compression"] != JAR_STORED + self.compress = header["compression"] + ++ def readable(self): ++ return True ++ + def read(self, length=-1): + """ + Read some amount of uncompressed data. + """ + return self.uncompressed_data.read(length) + ++ def readinto(self, b): ++ """ ++ Read bytes into a pre-allocated, writable bytes-like object `b` and return ++ the number of bytes read. ++ """ ++ return self.uncompressed_data.readinto(b) ++ + def readlines(self): + """ + Return a list containing all the lines of data in the uncompressed +@@ -320,6 +330,10 @@ class JarFileReader(object): + self.uncompressed_data.close() + + @property ++ def closed(self): ++ return self.uncompressed_data.closed ++ ++ @property + def compressed_data(self): + """ + Return the raw compressed data. +diff --git a/python/mozbuild/mozpack/test/python.ini b/python/mozbuild/mozpack/test/python.ini +--- a/python/mozbuild/mozpack/test/python.ini ++++ b/python/mozbuild/mozpack/test/python.ini +@@ -14,4 +14,5 @@ subsuite = mozbuild + [test_packager_l10n.py] + [test_packager_unpack.py] + [test_path.py] ++[test_pkg.py] + [test_unify.py] +diff --git a/python/mozlint/mozlint/cli.py b/python/mozlint/mozlint/cli.py +--- a/python/mozlint/mozlint/cli.py ++++ b/python/mozlint/mozlint/cli.py +@@ -46,10 +46,13 @@ class MozlintParser(ArgumentParser): + [ + ["-W", "--warnings"], + { ++ "const": True, ++ "nargs": "?", ++ "choices": ["soft"], + "dest": "show_warnings", +- "default": False, +- "action": "store_true", +- "help": "Display and fail on warnings in addition to errors.", ++ "help": "Display and fail on warnings in addition to errors. " ++ "--warnings=soft can be used to report warnings but only fail " ++ "on errors.", + }, + ], + [ +diff --git a/python/mozlint/mozlint/result.py b/python/mozlint/mozlint/result.py +--- a/python/mozlint/mozlint/result.py ++++ b/python/mozlint/mozlint/result.py +@@ -3,6 +3,7 @@ + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + + from collections import defaultdict ++from itertools import chain + from json import JSONEncoder + import os + import mozpack.path as mozpath +@@ -15,7 +16,8 @@ class ResultSummary(object): + + root = None + +- def __init__(self, root): ++ def __init__(self, root, fail_on_warnings=True): ++ self.fail_on_warnings = fail_on_warnings + self.reset() + + # Store the repository root folder to be able to build +@@ -30,9 +32,19 @@ class ResultSummary(object): + self.suppressed_warnings = defaultdict(int) + self.fixed = 0 + ++ def has_issues_failure(self): ++ """Returns true in case issues were detected during the lint run. Do not ++ consider warning issues in case `self.fail_on_warnings` is set to False. ++ """ ++ if self.fail_on_warnings is False: ++ return any( ++ result.level != "warning" for result in chain(*self.issues.values()) ++ ) ++ return len(self.issues) >= 1 ++ + @property + def returncode(self): +- if self.issues or self.failed: ++ if self.has_issues_failure() or self.failed: + return 1 + return 0 + +diff --git a/python/mozlint/mozlint/roller.py b/python/mozlint/mozlint/roller.py +--- a/python/mozlint/mozlint/roller.py ++++ b/python/mozlint/mozlint/roller.py +@@ -177,7 +177,11 @@ class LintRoller(object): + self._setupargs = setupargs or {} + + # result state +- self.result = ResultSummary(root) ++ self.result = ResultSummary( ++ root, ++ # Prevent failing on warnings when the --warnings parameter is set to "soft" ++ fail_on_warnings=lintargs.get("show_warnings") != "soft", ++ ) + + self.root = root + self.exclude = exclude or [] +diff --git a/python/mozlint/mozlint/types.py b/python/mozlint/mozlint/types.py +--- a/python/mozlint/mozlint/types.py ++++ b/python/mozlint/mozlint/types.py +@@ -87,40 +87,6 @@ class BaseType(object): + pass + + +-class FileType(BaseType): +- """Abstract base class for linter types that check each file +- +- Subclasses of this linter type will read each file and check the file contents +- """ +- +- __metaclass__ = ABCMeta +- +- @abstractmethod +- def lint_single_file(payload, line, config): +- """Run linter defined by `config` against `paths` with `lintargs`. +- +- :param path: Path to the file to lint. +- :param config: Linter config the paths are being linted against. +- :param lintargs: External arguments to the linter not defined in +- the definition, but passed in by a consumer. +- :returns: An error message or None +- """ +- pass +- +- def _lint(self, path, config, **lintargs): +- if os.path.isdir(path): +- return self._lint_dir(path, config, **lintargs) +- +- payload = config["payload"] +- +- errors = [] +- message = self.lint_single_file(payload, path, config) +- if message: +- errors.append(result.from_config(config, message=message, path=path)) +- +- return errors +- +- + class LineType(BaseType): + """Abstract base class for linter types that check each line individually. + +@@ -182,6 +148,10 @@ class ExternalType(BaseType): + return func(files, config, **lintargs) + + ++class ExternalFileType(ExternalType): ++ batch = False ++ ++ + class GlobalType(ExternalType): + """Linter type that runs an external global linting function just once. + +@@ -237,6 +207,7 @@ supported_types = { + "string": StringType(), + "regex": RegexType(), + "external": ExternalType(), ++ "external-file": ExternalFileType(), + "global": GlobalType(), + "structured_log": StructuredLogType(), + } +diff --git a/python/mozlint/test/test_roller.py b/python/mozlint/test/test_roller.py +--- a/python/mozlint/test/test_roller.py ++++ b/python/mozlint/test/test_roller.py +@@ -14,6 +14,7 @@ import pytest + + from mozlint.errors import LintersNotConfigured, NoValidLinter + from mozlint.result import Issue, ResultSummary ++from mozlint.roller import LintRoller + from itertools import chain + + +@@ -152,26 +153,41 @@ def test_roll_warnings(lint, linters, fi + assert result.total_suppressed_warnings == 0 + + +-def test_roll_code_review(monkeypatch, lint, linters, files): ++def test_roll_code_review(monkeypatch, linters, files): + monkeypatch.setenv("CODE_REVIEW", "1") +- lint.lintargs["show_warnings"] = False ++ lint = LintRoller(root=here, show_warnings=False) + lint.read(linters("warning")) + result = lint.roll(files) + assert len(result.issues) == 1 + assert result.total_issues == 2 + assert len(result.suppressed_warnings) == 0 + assert result.total_suppressed_warnings == 0 ++ assert result.returncode == 1 + + +-def test_roll_code_review_warnings_disabled(monkeypatch, lint, linters, files): ++def test_roll_code_review_warnings_disabled(monkeypatch, linters, files): + monkeypatch.setenv("CODE_REVIEW", "1") +- lint.lintargs["show_warnings"] = False ++ lint = LintRoller(root=here, show_warnings=False) + lint.read(linters("warning_no_code_review")) + result = lint.roll(files) + assert len(result.issues) == 0 + assert result.total_issues == 0 ++ assert lint.result.fail_on_warnings is True + assert len(result.suppressed_warnings) == 1 + assert result.total_suppressed_warnings == 2 ++ assert result.returncode == 0 ++ ++ ++def test_roll_code_review_warnings_soft(linters, files): ++ lint = LintRoller(root=here, show_warnings="soft") ++ lint.read(linters("warning_no_code_review")) ++ result = lint.roll(files) ++ assert len(result.issues) == 1 ++ assert result.total_issues == 2 ++ assert lint.result.fail_on_warnings is False ++ assert len(result.suppressed_warnings) == 0 ++ assert result.total_suppressed_warnings == 0 ++ assert result.returncode == 0 + + + def fake_run_worker(config, paths, **lintargs): +diff --git a/python/mozperftest/mozperftest/test/webpagetest.py b/python/mozperftest/mozperftest/test/webpagetest.py +--- a/python/mozperftest/mozperftest/test/webpagetest.py ++++ b/python/mozperftest/mozperftest/test/webpagetest.py +@@ -29,6 +29,7 @@ ACCEPTED_CONNECTIONS = [ + + ACCEPTED_STATISTICS = ["average", "median", "standardDeviation"] + WPT_KEY_FILE = "WPT_key.txt" ++WPT_API_EXPIRED_MESSAGE = "API key expired" + + + class WPTTimeOutError(Exception): +@@ -112,6 +113,14 @@ class WPTInvalidStatisticsError(Exceptio + pass + + ++class WPTExpiredAPIKeyError(Exception): ++ """ ++ This error is raised if we get a notification from WPT that our API key has expired ++ """ ++ ++ pass ++ ++ + class PropagatingErrorThread(Thread): + def run(self): + self.exc = None +@@ -244,6 +253,11 @@ class WebPageTest(Layer): + requested_results = requests.get(url) + results_of_request = json.loads(requested_results.text) + start = time.time() ++ if ( ++ "statusText" in results_of_request.keys() ++ and results_of_request["statusText"] == WPT_API_EXPIRED_MESSAGE ++ ): ++ raise WPTExpiredAPIKeyError("The API key has expired") + while ( + requested_results.status_code == 200 + and time.time() - start < self.timeout_limit +diff --git a/python/mozperftest/mozperftest/tests/test_webpagetest.py b/python/mozperftest/mozperftest/tests/test_webpagetest.py +--- a/python/mozperftest/mozperftest/tests/test_webpagetest.py ++++ b/python/mozperftest/mozperftest/tests/test_webpagetest.py +@@ -13,10 +13,12 @@ from mozperftest.test.webpagetest import + WPTBrowserSelectionError, + WPTInvalidURLError, + WPTLocationSelectionError, +- WPTInvalidConnectionSelection, +- ACCEPTED_STATISTICS, + WPTInvalidStatisticsError, + WPTDataProcessingError, ++ WPTExpiredAPIKeyError, ++ WPTInvalidConnectionSelection, ++ WPT_API_EXPIRED_MESSAGE, ++ ACCEPTED_STATISTICS, + ) + + WPT_METRICS = [ +@@ -82,7 +84,9 @@ def init_placeholder_wpt_data(fvonly=Fal + return placeholder_data + + +-def init_mocked_request(status_code, WPT_test_status_code=200, **kwargs): ++def init_mocked_request( ++ status_code, WPT_test_status_code=200, WPT_test_status_text="Ok", **kwargs ++): + mock_data = { + "data": { + "ec2-us-east-1": {"PendingTests": {"Queued": 3}, "Label": "California"}, +@@ -92,6 +96,7 @@ def init_mocked_request(status_code, WPT + "remaining": 2000, + }, + "statusCode": WPT_test_status_code, ++ "statusText": WPT_test_status_text, + } + for key, value in kwargs.items(): + mock_data["data"][key] = value +@@ -245,3 +250,23 @@ def test_webpagetest_test_metric_not_fou + test = webpagetest.WebPageTest(env, mach_cmd) + with pytest.raises(WPTDataProcessingError): + test.run(metadata) ++ ++ ++@mock.patch("mozperftest.utils.get_tc_secret", return_value={"wpt_key": "fake_key"}) ++@mock.patch( ++ "mozperftest.test.webpagetest.WebPageTest.location_queue", return_value=None ++) ++@mock.patch( ++ "requests.get", ++ return_value=init_mocked_request( ++ 200, WPT_test_status_code=400, WPT_test_status_text=WPT_API_EXPIRED_MESSAGE ++ ), ++) ++@mock.patch("mozperftest.test.webpagetest.WPT_KEY_FILE", "tests/data/WPT_fakekey.txt") ++def test_webpagetest_test_expired_api_key(*mocked): ++ mach_cmd, metadata, env = running_env(tests=[str(EXAMPLE_WPT_TEST)]) ++ metadata.script["options"]["test_list"] = ["google.ca"] ++ metadata.script["options"]["test_parameters"]["wait_between_requests"] = 1 ++ test = webpagetest.WebPageTest(env, mach_cmd) ++ with pytest.raises(WPTExpiredAPIKeyError): ++ test.run(metadata) +diff --git a/python/mozterm/mozterm/widgets.py b/python/mozterm/mozterm/widgets.py +--- a/python/mozterm/mozterm/widgets.py ++++ b/python/mozterm/mozterm/widgets.py +@@ -6,6 +6,8 @@ from __future__ import absolute_import, + + from .terminal import Terminal + ++DEFAULT = "\x1b(B\x1b[m" ++ + + class BaseWidget(object): + def __init__(self, terminal=None): +@@ -39,7 +41,16 @@ class Footer(BaseWidget): + for part in parts: + try: + func, part = part +- encoded = getattr(self.term, func)(part) ++ attribute = getattr(self.term, func) ++ # In Blessed, these attributes aren't always callable ++ if callable(attribute): ++ encoded = attribute(part) ++ else: ++ # If it's not callable, assume it's just the raw ++ # ANSI Escape Sequence and prepend it ourselves. ++ # Append DEFAULT to stop text that comes afterwards ++ # from inheriting the formatting we prepended. ++ encoded = attribute + part + DEFAULT + except ValueError: + encoded = part + +diff --git a/python/mozterm/test/test_terminal.py b/python/mozterm/test/test_terminal.py +--- a/python/mozterm/test/test_terminal.py ++++ b/python/mozterm/test/test_terminal.py +@@ -9,32 +9,17 @@ import sys + + import mozunit + import pytest +- +-from mozterm import Terminal, NullTerminal ++from mozterm import NullTerminal, Terminal + + + def test_terminal(): +- blessings = pytest.importorskip("blessings") ++ blessed = pytest.importorskip("blessed") + term = Terminal() +- assert isinstance(term, blessings.Terminal) ++ assert isinstance(term, blessed.Terminal) + + term = Terminal(disable_styling=True) + assert isinstance(term, NullTerminal) + +- del sys.modules["blessings"] +- orig = sys.path[:] +- for path in orig: +- if "blessings" in path: +- sys.path.remove(path) +- +- term = Terminal() +- assert isinstance(term, NullTerminal) +- +- with pytest.raises(ImportError): +- term = Terminal(raises=True) +- +- sys.path = orig +- + + def test_null_terminal(): + term = NullTerminal() +diff --git a/python/mozterm/test/test_widgets.py b/python/mozterm/test/test_widgets.py +--- a/python/mozterm/test/test_widgets.py ++++ b/python/mozterm/test/test_widgets.py +@@ -4,41 +4,42 @@ + + from __future__ import absolute_import, unicode_literals + ++import sys + from io import StringIO + + import mozunit + import pytest +- + from mozterm import Terminal + from mozterm.widgets import Footer + + + @pytest.fixture +-def terminal(monkeypatch): +- blessings = pytest.importorskip("blessings") ++def terminal(): ++ blessed = pytest.importorskip("blessed") + + kind = "xterm-256color" + try: + term = Terminal(stream=StringIO(), force_styling=True, kind=kind) +- except blessings.curses.error: ++ except blessed.curses.error: + pytest.skip("terminal '{}' not found".format(kind)) + +- # For some reason blessings returns None for width/height though a comment +- # says that shouldn't ever happen. +- monkeypatch.setattr(term, "_height_and_width", lambda: (100, 100)) + return term + + ++@pytest.mark.skipif( ++ not sys.platform.startswith("win"), ++ reason="Only do ANSI Escape Sequence comparisons on Windows.", ++) + def test_footer(terminal): + footer = Footer(terminal=terminal) + footer.write( + [ +- ("dim", "foo"), ++ ("bright_black", "foo"), + ("green", "bar"), + ] + ) + value = terminal.stream.getvalue() +- expected = "\x1b7\x1b[2mfoo\x1b(B\x1b[m \x1b[32mbar\x1b(B\x1b[m\x1b8" ++ expected = "\x1b7\x1b[90mfoo\x1b(B\x1b[m \x1b[32mbar\x1b(B\x1b[m\x1b8" + assert value == expected + + footer.clear() +diff --git a/python/mozversioncontrol/mozversioncontrol/__init__.py b/python/mozversioncontrol/mozversioncontrol/__init__.py +--- a/python/mozversioncontrol/mozversioncontrol/__init__.py ++++ b/python/mozversioncontrol/mozversioncontrol/__init__.py +@@ -222,6 +222,16 @@ class Repository(object): + """ + + @abc.abstractmethod ++ def get_ignored_files_finder(self): ++ """Obtain a mozpack.files.BaseFinder of ignored files in the working ++ directory. ++ ++ The Finder will have its list of all files in the repo cached for its ++ entire lifetime, so operations on the Finder will not track with, for ++ example, changes to the repo during the Finder's lifetime. ++ """ ++ ++ @abc.abstractmethod + def working_directory_clean(self, untracked=False, ignored=False): + """Determine if the working directory is free of modifications. + +@@ -501,6 +511,15 @@ class HgRepository(Repository): + ) + return FileListFinder(files) + ++ def get_ignored_files_finder(self): ++ # Can return backslashes on Windows. Normalize to forward slashes. ++ files = list( ++ p.replace("\\", "/").split(" ")[-1] ++ for p in self._run("status", "-i").split("\n") ++ if p ++ ) ++ return FileListFinder(files) ++ + def working_directory_clean(self, untracked=False, ignored=False): + args = ["status", "--modified", "--added", "--removed", "--deleted"] + if untracked: +@@ -675,6 +694,16 @@ class GitRepository(Repository): + files = [p for p in self._run("ls-files", "-z").split("\0") if p] + return FileListFinder(files) + ++ def get_ignored_files_finder(self): ++ files = [ ++ p ++ for p in self._run( ++ "ls-files", "-i", "-o", "-z", "--exclude-standard" ++ ).split("\0") ++ if p ++ ] ++ return FileListFinder(files) ++ + def working_directory_clean(self, untracked=False, ignored=False): + args = ["status", "--porcelain"] + +diff --git a/python/sites/mach.txt b/python/sites/mach.txt +--- a/python/sites/mach.txt ++++ b/python/sites/mach.txt +@@ -42,10 +42,10 @@ pth:testing/mozbase/mozsystemmonitor + pth:testing/mozbase/mozscreenshot + pth:testing/mozbase/moztest + pth:testing/mozbase/mozversion ++pth:testing/mozharness + pth:testing/raptor + pth:testing/talos + pth:testing/web-platform +-vendored:testing/web-platform/tests/tools/third_party/funcsigs + vendored:testing/web-platform/tests/tools/third_party/h2 + vendored:testing/web-platform/tests/tools/third_party/hpack + vendored:testing/web-platform/tests/tools/third_party/html5lib +@@ -139,5 +139,5 @@ pypi-optional:glean-sdk==51.8.2:telemetr + # Mach gracefully handles the case where `psutil` is unavailable. + # We aren't (yet) able to pin packages in automation, so we have to + # support down to the oldest locally-installed version (5.4.2). +-pypi-optional:psutil>=5.4.2,<=5.8.0:telemetry will be missing some data +-pypi-optional:zstandard>=0.11.1,<=0.17.0:zstd archives will not be possible to extract ++pypi-optional:psutil>=5.4.2,<=5.9.4:telemetry will be missing some data ++pypi-optional:zstandard>=0.11.1,<=0.19.0:zstd archives will not be possible to extract From 8cc8a041593ae1e4eacc0a5dc0dda55ce8a81b78 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 14 Dec 2022 11:26:36 +0100 Subject: [PATCH 146/545] Disabled s390x due to https://bugzilla.redhat.com/show_bug.cgi?id=2153213 --- firefox.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/firefox.spec b/firefox.spec index bdfd9da..a79274e 100644 --- a/firefox.spec +++ b/firefox.spec @@ -6,6 +6,10 @@ # https://bugzilla.redhat.com/show_bug.cgi?id=2129720 ExcludeArch: i686 +# Disabled due to build failures: +# https://bugzilla.redhat.com/show_bug.cgi?id=2153213 +ExcludeArch: s390x + # Run Mozilla test suite as a part of compile rpm section. Turn off when # building locally and don't want to spend 24 hours waiting for results. %global run_firefox_tests 0 From 69f67c3201bbf2df56e418e8893fb9c47c161932 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 14 Dec 2022 11:34:10 +0100 Subject: [PATCH 147/545] disable elf hack on aarch64 --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index a79274e..98a6f58 100644 --- a/firefox.spec +++ b/firefox.spec @@ -575,7 +575,7 @@ echo "ac_add_options --with-system-libevent" >> .mozconfig echo "ac_add_options --enable-system-ffi" >> .mozconfig %endif -%ifarch %{arm} +%ifarch %{arm} aarch64 echo "ac_add_options --disable-elf-hack" >> .mozconfig %endif From 6d4d79277fff78b208d1238363d79112aa40d790 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 14 Dec 2022 11:38:44 +0100 Subject: [PATCH 148/545] Exclude armv7hl due to bugzilla.redhat.com/show_bug.cgi?id=2153213 --- build-disable-elfhack.patch | 12 ------------ firefox.spec | 1 + 2 files changed, 1 insertion(+), 12 deletions(-) delete mode 100644 build-disable-elfhack.patch diff --git a/build-disable-elfhack.patch b/build-disable-elfhack.patch deleted file mode 100644 index 04d49f2..0000000 --- a/build-disable-elfhack.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up firefox-97.0/toolkit/moz.configure.disable-elfhack firefox-97.0/toolkit/moz.configure ---- firefox-97.0/toolkit/moz.configure.disable-elfhack 2022-02-08 09:58:47.518047952 +0100 -+++ firefox-97.0/toolkit/moz.configure 2022-02-08 10:17:49.552945956 +0100 -@@ -1273,7 +1273,7 @@ with only_when("--enable-compile-environ - help="{Enable|Disable} elf hacks", - ) - -- set_config("USE_ELF_HACK", depends_if("--enable-elf-hack")(lambda _: True)) -+ set_config("USE_ELF_HACK", depends_if("--enable-elf-hack")(lambda _: False)) - - - @depends(build_environment) diff --git a/firefox.spec b/firefox.spec index 98a6f58..75956b5 100644 --- a/firefox.spec +++ b/firefox.spec @@ -9,6 +9,7 @@ ExcludeArch: i686 # Disabled due to build failures: # https://bugzilla.redhat.com/show_bug.cgi?id=2153213 ExcludeArch: s390x +ExcludeArch: armv7hl # Run Mozilla test suite as a part of compile rpm section. Turn off when # building locally and don't want to spend 24 hours waiting for results. From d04948255c1ff9163006539bef6f26e9b45a39c7 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 14 Dec 2022 16:33:57 +0100 Subject: [PATCH 149/545] Updated to build 2 --- .gitignore | 1 + firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 63b0925..fb7790d 100644 --- a/.gitignore +++ b/.gitignore @@ -548,3 +548,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-107.0.1-20221206.tar.xz /firefox-108.0.source.tar.xz /firefox-langpacks-108.0-20221206.tar.xz +/firefox-langpacks-108.0-20221214.tar.xz diff --git a/firefox.spec b/firefox.spec index 75956b5..5575c31 100644 --- a/firefox.spec +++ b/firefox.spec @@ -178,12 +178,12 @@ ExcludeArch: armv7hl Summary: Mozilla Firefox Web browser Name: firefox Version: 108.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20221206.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20221214.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1132,6 +1132,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Tue Dec 14 2022 Martin Stransky - 108.0-2 +- Update to 108.0 Build 2 + * Tue Dec 6 2022 Martin Stransky - 108.0-1 - Update to 108.0 diff --git a/sources b/sources index 9c575ee..4ab4ebf 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 -SHA512 (firefox-108.0.source.tar.xz) = 773d390442c348de0d2c1f5dbebaccf24db1d9cc4eec3a47c419cdb4c8b03e1d9cd8eabb5c60941fdd7ab83e5b6702e5e803ba00beeee76e115a1fe7306362bc -SHA512 (firefox-langpacks-108.0-20221206.tar.xz) = 8d6f080e25c6d8bb391442014290e8b18f59efd6792f811ecd5327cce05ff58ec64fb8be7e0e91e6d4bb2576e5453243ea99b767df1989e7eb346853cc50483d SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 +SHA512 (firefox-108.0.source.tar.xz) = fa800f62cca395a51b9a04373a27be48fc3860208e34ecf74d908127638d1eb8c41cf9898be6896777d408127d5c4b7104d9ee89c97da923b2dc6ea32186187e +SHA512 (firefox-langpacks-108.0-20221214.tar.xz) = 53d471c63df74f9dae1cda4a9e1c654cbe232b3173a9d3f553ba4c27db27655b4a9d43b74fb576c73ef2eefbba7f67d4d79dbd83842bbbdee04311df5aa2e042 From 1d86ce0d55acac653800e5d5e19ec5fad25569ee Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 15 Dec 2022 09:46:54 +0100 Subject: [PATCH 150/545] build fixes --- D162136.diff | 57 ---------------------------------------------------- firefox.spec | 4 +--- 2 files changed, 1 insertion(+), 60 deletions(-) delete mode 100644 D162136.diff diff --git a/D162136.diff b/D162136.diff deleted file mode 100644 index bbd3de1..0000000 --- a/D162136.diff +++ /dev/null @@ -1,57 +0,0 @@ -diff --git a/python/mach/mach/site.py b/python/mach/mach/site.py ---- a/python/mach/mach/site.py -+++ b/python/mach/mach/site.py -@@ -16,14 +16,14 @@ - import shutil - import site - import subprocess - import sys - import sysconfig --from pathlib import Path - import tempfile - from contextlib import contextmanager --from typing import Optional, Callable -+from pathlib import Path -+from typing import Callable, Optional - - from mach.requirements import ( - MachEnvRequirements, - UnexpectedFlexibleRequirementException, - ) -@@ -761,11 +761,11 @@ - self.bin_path = os.path.join(prefix, "Scripts") - self.python_path = os.path.join(self.bin_path, "python.exe") - else: - self.bin_path = os.path.join(prefix, "bin") - self.python_path = os.path.join(self.bin_path, "python") -- self.prefix = prefix -+ self.prefix = os.path.realpath(prefix) - - @functools.lru_cache(maxsize=None) - def resolve_sysconfig_packages_path(self, sysconfig_path): - # macOS uses a different default sysconfig scheme based on whether it's using the - # system Python or running in a virtualenv. -@@ -781,20 +781,16 @@ - data_path = Path(sysconfig_paths["data"]) - path = Path(sysconfig_paths[sysconfig_path]) - relative_path = path.relative_to(data_path) - - # Path to virtualenv's "site-packages" directory for provided sysconfig path -- return os.path.normpath( -- os.path.normcase(os.path.realpath(Path(self.prefix) / relative_path)) -- ) -+ return os.path.normpath(os.path.normcase(Path(self.prefix) / relative_path)) - - def site_packages_dirs(self): - dirs = [] - if sys.platform.startswith("win"): -- dirs.append( -- os.path.normpath(os.path.normcase(os.path.realpath(self.prefix))) -- ) -+ dirs.append(os.path.normpath(os.path.normcase(self.prefix))) - purelib = self.resolve_sysconfig_packages_path("purelib") - platlib = self.resolve_sysconfig_packages_path("platlib") - - dirs.append(purelib) - if platlib != purelib: - diff --git a/firefox.spec b/firefox.spec index 5575c31..95c33c4 100644 --- a/firefox.spec +++ b/firefox.spec @@ -230,7 +230,6 @@ Patch55: firefox-testing.patch Patch61: firefox-glibc-dynstack.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch78: firefox-i686-build.patch -Patch80: D162136.diff # Test patches # Generate without context by @@ -507,7 +506,6 @@ This package contains results of tests executed during build. %patch54 -p1 -b .1669639 %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch78 -p1 -b .firefox-i686 -%patch80 -p1 -b .D162136 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -1132,7 +1130,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog -* Tue Dec 14 2022 Martin Stransky - 108.0-2 +* Wed Dec 14 2022 Martin Stransky - 108.0-2 - Update to 108.0 Build 2 * Tue Dec 6 2022 Martin Stransky - 108.0-1 From 6fa1c4438c477aabba3435c318ffa5040d8c874a Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 15 Dec 2022 10:05:22 +0100 Subject: [PATCH 151/545] Added fix for mozbz#1802327 --- D163310.diff | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ firefox.spec | 2 ++ 2 files changed, 60 insertions(+) create mode 100644 D163310.diff diff --git a/D163310.diff b/D163310.diff new file mode 100644 index 0000000..bad1f17 --- /dev/null +++ b/D163310.diff @@ -0,0 +1,58 @@ +diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp +--- a/widget/gtk/nsWindow.cpp ++++ b/widget/gtk/nsWindow.cpp +@@ -3029,11 +3029,11 @@ + #endif + } + + void nsWindow::SetUserTimeAndStartupTokenForActivatedWindow() { + nsGTKToolkit* toolkit = nsGTKToolkit::GetToolkit(); +- if (!toolkit) { ++ if (!toolkit || MOZ_UNLIKELY(mWindowType == eWindowType_invisible)) { + return; + } + + mWindowActivationTokenFromEnv = toolkit->GetStartupToken(); + if (!mWindowActivationTokenFromEnv.IsEmpty()) { +@@ -6614,30 +6614,34 @@ + return; + } + } + } + // Set up usertime/startupID metadata for the created window. +- if (mWindowType != eWindowType_invisible) { ++ // On X11 we use gtk_window_set_startup_id() so we need to call it ++ // before show. ++ if (GdkIsX11Display()) { + SetUserTimeAndStartupTokenForActivatedWindow(); + } + if (GdkIsWaylandDisplay()) { + if (IsWaylandPopup()) { + ShowWaylandPopupWindow(); + } else { + ShowWaylandToplevelWindow(); + } ++ } else { ++ LOG(" calling gtk_widget_show(mShell)\n"); ++ gtk_widget_show(mShell); ++ } ++ if (GdkIsWaylandDisplay()) { ++ SetUserTimeAndStartupTokenForActivatedWindow(); + #ifdef MOZ_WAYLAND + auto token = std::move(mWindowActivationTokenFromEnv); + if (!token.IsEmpty()) { + FocusWaylandWindow(token.get()); + } + #endif +- } else { +- LOG(" calling gtk_widget_show(mShell)\n"); +- gtk_widget_show(mShell); +- } +- ++ } + if (mHiddenPopupPositioned && IsPopup()) { + LOG(" re-position hidden popup window"); + gtk_window_move(GTK_WINDOW(mShell), mPopupPosition.x, mPopupPosition.y); + mHiddenPopupPositioned = false; + } + diff --git a/firefox.spec b/firefox.spec index 95c33c4..6292b72 100644 --- a/firefox.spec +++ b/firefox.spec @@ -230,6 +230,7 @@ Patch55: firefox-testing.patch Patch61: firefox-glibc-dynstack.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch78: firefox-i686-build.patch +Patch79: D163310.diff # Test patches # Generate without context by @@ -506,6 +507,7 @@ This package contains results of tests executed during build. %patch54 -p1 -b .1669639 %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch78 -p1 -b .firefox-i686 +%patch79 -p1 -b .D163310 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell From 5c5335d4f77a398e7e4eea75f84ec6aa80100121 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 15 Dec 2022 10:07:09 +0100 Subject: [PATCH 152/545] Changelog update --- firefox.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/firefox.spec b/firefox.spec index 6292b72..e558357 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1134,6 +1134,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %changelog * Wed Dec 14 2022 Martin Stransky - 108.0-2 - Update to 108.0 Build 2 +- Added fix for rhbz#2149821 * Tue Dec 6 2022 Martin Stransky - 108.0-1 - Update to 108.0 From b8542b1767283f245b122ee3805f3633ff132972 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 19 Dec 2022 13:56:57 +0100 Subject: [PATCH 153/545] Update to 108.0.1 --- .gitignore | 2 ++ sources | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index fb7790d..4d02086 100644 --- a/.gitignore +++ b/.gitignore @@ -549,3 +549,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-108.0.source.tar.xz /firefox-langpacks-108.0-20221206.tar.xz /firefox-langpacks-108.0-20221214.tar.xz +/firefox-108.0.1.source.tar.xz +/firefox-langpacks-108.0.1-20221218.tar.xz diff --git a/sources b/sources index 4ab4ebf..07df57d 100644 --- a/sources +++ b/sources @@ -2,3 +2,5 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2 SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 SHA512 (firefox-108.0.source.tar.xz) = fa800f62cca395a51b9a04373a27be48fc3860208e34ecf74d908127638d1eb8c41cf9898be6896777d408127d5c4b7104d9ee89c97da923b2dc6ea32186187e SHA512 (firefox-langpacks-108.0-20221214.tar.xz) = 53d471c63df74f9dae1cda4a9e1c654cbe232b3173a9d3f553ba4c27db27655b4a9d43b74fb576c73ef2eefbba7f67d4d79dbd83842bbbdee04311df5aa2e042 +SHA512 (firefox-108.0.1.source.tar.xz) = e6219ed6324422ec293ed96868738e056582bb9f7fb82e59362541f3465c6ebca806d26ecd801156b074c3675bd5a22507b1f1fa53eebf82b7dd35f2b1ff0625 +SHA512 (firefox-langpacks-108.0.1-20221218.tar.xz) = ac9766a4eb419ba04a138cbd3a4f44dac9d83a4c2680f5b29f8b2da2ac9659cc0b1706b974e15563b2aaed371a11a999f5f11172610d60e4ebe6dcb860f1b1f2 From 50222bf3930f17983c5223c47dcfa74aa0474071 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 19 Dec 2022 13:57:06 +0100 Subject: [PATCH 154/545] Update to 108.0.1 --- firefox.spec | 9 ++++++--- sources | 2 -- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/firefox.spec b/firefox.spec index 5575c31..81fcd1f 100644 --- a/firefox.spec +++ b/firefox.spec @@ -177,13 +177,13 @@ ExcludeArch: armv7hl Summary: Mozilla Firefox Web browser Name: firefox -Version: 108.0 -Release: 2%{?pre_tag}%{?dist} +Version: 108.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20221214.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20221219.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1132,6 +1132,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Mon Dec 19 2022 Martin Stransky - 108.0.1-1 +- Update to 108.0.1 + * Tue Dec 14 2022 Martin Stransky - 108.0-2 - Update to 108.0 Build 2 diff --git a/sources b/sources index 07df57d..e70567f 100644 --- a/sources +++ b/sources @@ -1,6 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 -SHA512 (firefox-108.0.source.tar.xz) = fa800f62cca395a51b9a04373a27be48fc3860208e34ecf74d908127638d1eb8c41cf9898be6896777d408127d5c4b7104d9ee89c97da923b2dc6ea32186187e -SHA512 (firefox-langpacks-108.0-20221214.tar.xz) = 53d471c63df74f9dae1cda4a9e1c654cbe232b3173a9d3f553ba4c27db27655b4a9d43b74fb576c73ef2eefbba7f67d4d79dbd83842bbbdee04311df5aa2e042 SHA512 (firefox-108.0.1.source.tar.xz) = e6219ed6324422ec293ed96868738e056582bb9f7fb82e59362541f3465c6ebca806d26ecd801156b074c3675bd5a22507b1f1fa53eebf82b7dd35f2b1ff0625 SHA512 (firefox-langpacks-108.0.1-20221218.tar.xz) = ac9766a4eb419ba04a138cbd3a4f44dac9d83a4c2680f5b29f8b2da2ac9659cc0b1706b974e15563b2aaed371a11a999f5f11172610d60e4ebe6dcb860f1b1f2 From dc1af54df88ae616f95c13be3dd86fa48d4b6bc2 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 20 Dec 2022 13:25:21 +0100 Subject: [PATCH 155/545] Build fix - typo --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 32c78a2..2d239ce 100644 --- a/firefox.spec +++ b/firefox.spec @@ -183,7 +183,7 @@ URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20221219.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20221218.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig From ec6b601b49b434e0fc96da96e0cba7d91619d2e6 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 21 Dec 2022 10:23:23 +0100 Subject: [PATCH 156/545] Added mozbz#1795851 [wayland] Crash buffer size (170x113) is not divisible by scale (2) --- D163696.diff | 55 +++++++++ D163697.diff | 28 +++++ D163698.diff | 315 +++++++++++++++++++++++++++++++++++++++++++++++++++ firefox.spec | 12 +- 4 files changed, 409 insertions(+), 1 deletion(-) create mode 100644 D163696.diff create mode 100644 D163697.diff create mode 100644 D163698.diff diff --git a/D163696.diff b/D163696.diff new file mode 100644 index 0000000..9002e71 --- /dev/null +++ b/D163696.diff @@ -0,0 +1,55 @@ +diff --git a/widget/gtk/GtkCompositorWidget.cpp b/widget/gtk/GtkCompositorWidget.cpp +--- a/widget/gtk/GtkCompositorWidget.cpp ++++ b/widget/gtk/GtkCompositorWidget.cpp +@@ -19,13 +19,14 @@ + # include "mozilla/layers/NativeLayerWayland.h" + #endif + + #ifdef MOZ_LOGGING + # undef LOG +-# define LOG(...) \ ++# define LOG(str, ...) \ + MOZ_LOG(IsPopup() ? gWidgetPopupLog : gWidgetLog, \ +- mozilla::LogLevel::Debug, (__VA_ARGS__)) ++ mozilla::LogLevel::Debug, \ ++ ("[%p]: " str, mWidget.get(), ##__VA_ARGS__)) + #endif /* MOZ_LOGGING */ + + namespace mozilla { + namespace widget { + +@@ -92,10 +93,13 @@ + + nsIWidget* GtkCompositorWidget::RealWidget() { return mWidget; } + + void GtkCompositorWidget::NotifyClientSizeChanged( + const LayoutDeviceIntSize& aClientSize) { ++ LOG("GtkCompositorWidget::NotifyClientSizeChanged() to %d x %d", ++ aClientSize.width, aClientSize.height); ++ + auto size = mClientSize.Lock(); + *size = aClientSize; + } + + LayoutDeviceIntSize GtkCompositorWidget::GetClientSize() { +@@ -107,14 +111,19 @@ + const LayoutDeviceRect& aSize) { + if (!mWidget || !mWidget->IsWaitingForCompositorResume()) { + return; + } + ++ LOG("GtkCompositorWidget::RemoteLayoutSizeUpdated() %d x %d", ++ (int)aSize.width, (int)aSize.height); ++ + // We're waiting for layout to match widget size. + auto clientSize = mClientSize.Lock(); + if (clientSize->width != (int)aSize.width || + clientSize->height != (int)aSize.height) { ++ LOG("quit, client size doesn't match (%d x %d)", clientSize->width, ++ clientSize->height); + return; + } + + mWidget->ResumeCompositorFromCompositorThread(); + } + diff --git a/D163697.diff b/D163697.diff new file mode 100644 index 0000000..c6a15ba --- /dev/null +++ b/D163697.diff @@ -0,0 +1,28 @@ +diff --git a/widget/gtk/ScreenHelperGTK.cpp b/widget/gtk/ScreenHelperGTK.cpp +--- a/widget/gtk/ScreenHelperGTK.cpp ++++ b/widget/gtk/ScreenHelperGTK.cpp +@@ -433,19 +433,21 @@ + return -1; + } + + GdkRectangle workArea; + if (!GdkMonitorGetWorkarea(monitor, &workArea)) { ++ LOG_SCREEN(" failed, can't get work area"); + return -1; + } + + for (unsigned int i = 0; i < mMonitors.Length(); i++) { + // Although Gtk/Mutter is very creative in reporting various screens sizes + // we can rely on Gtk work area start position to match wl_output. + if (mMonitors[i]->x == workArea.x && mMonitors[i]->y == workArea.y) { +- LOG_SCREEN(" monitor %d values %d %d -> %d x %d", i, mMonitors[i]->x, +- mMonitors[i]->y, mMonitors[i]->width, mMonitors[i]->height); ++ LOG_SCREEN(" monitor %d work area [%d, %d] -> (%d x %d) scale %d", i, ++ mMonitors[i]->x, mMonitors[i]->y, mMonitors[i]->width, ++ mMonitors[i]->height, mMonitors[i]->scale); + return i; + } + } + + return -1; + diff --git a/D163698.diff b/D163698.diff new file mode 100644 index 0000000..d889961 --- /dev/null +++ b/D163698.diff @@ -0,0 +1,315 @@ +diff --git a/widget/gtk/MozContainerWayland.h b/widget/gtk/MozContainerWayland.h +--- a/widget/gtk/MozContainerWayland.h ++++ b/widget/gtk/MozContainerWayland.h +@@ -76,13 +76,17 @@ + struct wl_egl_window* moz_container_wayland_get_egl_window( + MozContainer* container, double scale); + + gboolean moz_container_wayland_has_egl_window(MozContainer* container); + void moz_container_wayland_egl_window_set_size(MozContainer* container, +- int width, int height); ++ nsIntSize aSize); ++bool moz_container_wayland_egl_window_needs_size_update(MozContainer* container, ++ nsIntSize aSize, ++ int scale); + void moz_container_wayland_set_scale_factor(MozContainer* container); +-void moz_container_wayland_set_scale_factor_locked(MozContainer* container); ++void moz_container_wayland_set_scale_factor_locked( ++ const mozilla::MutexAutoLock& aProofOfLock, MozContainer* container); + + void moz_container_wayland_add_initial_draw_callback_locked( + MozContainer* container, const std::function& initial_draw_cb); + void moz_container_wayland_add_or_fire_initial_draw_callback( + MozContainer* container, const std::function& initial_draw_cb); +diff --git a/widget/gtk/MozContainerWayland.cpp b/widget/gtk/MozContainerWayland.cpp +--- a/widget/gtk/MozContainerWayland.cpp ++++ b/widget/gtk/MozContainerWayland.cpp +@@ -108,13 +108,11 @@ + mSurface = moz_container_wayland_surface_lock(aContainer); + } + MozContainerSurfaceLock::~MozContainerSurfaceLock() { + moz_container_wayland_surface_unlock(mContainer, &mSurface); + } +-struct wl_surface* MozContainerSurfaceLock::GetSurface() { +- return mSurface; +-} ++struct wl_surface* MozContainerSurfaceLock::GetSurface() { return mSurface; } + + // Imlemented in MozContainer.cpp + void moz_container_realize(GtkWidget* widget); + + // Invalidate gtk wl_surface to commit changes to wl_subsurface. +@@ -163,15 +161,16 @@ + // This is called from layout/compositor code only with + // size equal to GL rendering context. Otherwise there are + // rendering artifacts as wl_egl_window size does not match + // GL rendering pipeline setup. + void moz_container_wayland_egl_window_set_size(MozContainer* container, +- int width, int height) { ++ nsIntSize aSize) { + MozContainerWayland* wl_container = &container->wl_container; + MutexAutoLock lock(*wl_container->container_lock); + if (wl_container->eglwindow) { +- wl_egl_window_resize(wl_container->eglwindow, width, height, 0, 0); ++ wl_egl_window_resize(wl_container->eglwindow, aSize.width, aSize.height, 0, ++ 0); + } + } + + void moz_container_wayland_class_init(MozContainerClass* klass) { + /*GObjectClass *gobject_class = G_OBJECT_CLASS (klass); +@@ -432,11 +431,11 @@ + MOZ_CONTAINER(widget))) { + return FALSE; + } + } + +- moz_container_wayland_set_scale_factor_locked(MOZ_CONTAINER(widget)); ++ moz_container_wayland_set_scale_factor_locked(lock, MOZ_CONTAINER(widget)); + moz_container_wayland_set_opaque_region_locked(lock, MOZ_CONTAINER(widget)); + moz_container_clear_input_region(MOZ_CONTAINER(widget)); + moz_container_wayland_invalidate(MOZ_CONTAINER(widget)); + return FALSE; + } +@@ -487,11 +486,11 @@ + if (!container->wl_container.surface) { + if (!moz_container_wayland_surface_create_locked(lock, container)) { + return; + } + } +- moz_container_wayland_set_scale_factor_locked(container); ++ moz_container_wayland_set_scale_factor_locked(lock, container); + moz_container_wayland_set_opaque_region_locked(lock, container); + moz_container_wayland_move_locked(lock, container, allocation->x, + allocation->y); + moz_container_clear_input_region(container); + moz_container_wayland_invalidate(MOZ_CONTAINER(widget)); +@@ -542,55 +541,61 @@ + if (wl_container->surface) { + moz_container_wayland_set_opaque_region_locked(lock, container); + } + } + +-void moz_container_wayland_set_scale_factor_locked(MozContainer* container) { ++static void moz_container_wayland_surface_set_scale_locked( ++ const MutexAutoLock& aProofOfLock, MozContainerWayland* wl_container, ++ int scale) { ++ if (wl_container->buffer_scale == scale) { ++ return; ++ } ++ ++ LOGCONTAINER("%s scale %d\n", __FUNCTION__, scale); ++ ++ // There is a chance that the attached wl_buffer has not yet been doubled ++ // on the main thread when scale factor changed to 2. This leads to ++ // crash with the following message: ++ // Buffer size (AxB) must be an integer multiple of the buffer_scale (2) ++ // Removing the possibly wrong wl_buffer to prevent that crash: ++ wl_surface_attach(wl_container->surface, nullptr, 0, 0); ++ wl_surface_set_buffer_scale(wl_container->surface, scale); ++ wl_container->buffer_scale = scale; ++} ++ ++void moz_container_wayland_set_scale_factor_locked( ++ const MutexAutoLock& aProofOfLock, MozContainer* container) { + if (gfx::gfxVars::UseWebRenderCompositor()) { + // the compositor backend handles scaling itself + return; + } + + MozContainerWayland* wl_container = &container->wl_container; + wl_container->container_lock->AssertCurrentThreadOwns(); + + nsWindow* window = moz_container_get_nsWindow(container); +- +- if (window && window->UseFractionalScale()) { ++ MOZ_DIAGNOSTIC_ASSERT(window); ++ if (window->UseFractionalScale()) { + if (!wl_container->viewport) { + wl_container->viewport = wp_viewporter_get_viewport( + WaylandDisplayGet()->GetViewporter(), wl_container->surface); + } + + GdkWindow* gdkWindow = gtk_widget_get_window(GTK_WIDGET(container)); + wp_viewport_set_destination(wl_container->viewport, + gdk_window_get_width(gdkWindow), + gdk_window_get_height(gdkWindow)); + } else { +- int scale = window ? window->GdkCeiledScaleFactor() : 1; +- +- if (scale == wl_container->buffer_scale) { +- return; +- } +- +- LOGCONTAINER("%s [%p] scale %d\n", __FUNCTION__, +- (void*)moz_container_get_nsWindow(container), scale); +- // There is a chance that the attached wl_buffer has not yet been doubled +- // on the main thread when scale factor changed to 2. This leads to +- // crash with the following message: +- // Buffer size (AxB) must be an integer multiple of the buffer_scale (2) +- // Removing the possibly wrong wl_buffer to prevent that crash: +- wl_surface_attach(wl_container->surface, nullptr, 0, 0); +- wl_surface_set_buffer_scale(wl_container->surface, scale); +- wl_container->buffer_scale = scale; ++ moz_container_wayland_surface_set_scale_locked( ++ aProofOfLock, wl_container, window->GdkCeiledScaleFactor()); + } + } + + void moz_container_wayland_set_scale_factor(MozContainer* container) { + MutexAutoLock lock(*container->wl_container.container_lock); + if (container->wl_container.surface) { +- moz_container_wayland_set_scale_factor_locked(container); ++ moz_container_wayland_set_scale_factor_locked(lock, container); + } + } + + static bool moz_container_wayland_surface_create_locked( + const MutexAutoLock& aProofOfLock, MozContainer* container) { +@@ -598,10 +603,12 @@ + + LOGWAYLAND("%s [%p]\n", __FUNCTION__, + (void*)moz_container_get_nsWindow(container)); + + GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(container)); ++ MOZ_DIAGNOSTIC_ASSERT(window); ++ + wl_surface* parent_surface = gdk_wayland_window_get_wl_surface(window); + if (!parent_surface) { + LOGWAYLAND(" Failed - missing parent surface!"); + return false; + } +@@ -691,36 +698,65 @@ + *surface = nullptr; + } + container->wl_container.container_lock->Unlock(); + } + ++bool moz_container_wayland_egl_window_needs_size_update(MozContainer* container, ++ nsIntSize aSize, ++ int aScale) { ++ MozContainerWayland* wl_container = &container->wl_container; ++ if (wl_container->buffer_scale != aScale) { ++ return true; ++ } ++ nsIntSize recentSize; ++ wl_egl_window_get_attached_size(wl_container->eglwindow, &recentSize.width, ++ &recentSize.height); ++ return aSize != recentSize; ++} ++ + struct wl_egl_window* moz_container_wayland_get_egl_window( + MozContainer* container, double scale) { + MozContainerWayland* wl_container = &container->wl_container; + +- LOGCONTAINER("%s [%p] eglwindow %p\n", __FUNCTION__, ++ LOGCONTAINER("%s [%p] eglwindow %p scale %d\n", __FUNCTION__, + (void*)moz_container_get_nsWindow(container), +- (void*)wl_container->eglwindow); ++ (void*)wl_container->eglwindow, (int)scale); + + MutexAutoLock lock(*wl_container->container_lock); + if (!wl_container->surface || !wl_container->ready_to_draw) { +- LOGWAYLAND( ++ LOGCONTAINER( + " quit, wl_container->surface %p wl_container->ready_to_draw %d\n", + wl_container->surface, wl_container->ready_to_draw); + return nullptr; + } ++ ++ GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(container)); ++ nsIntSize requestedSize((int)round(gdk_window_get_width(window) * scale), ++ (int)round(gdk_window_get_height(window) * scale)); ++ + if (!wl_container->eglwindow) { +- GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(container)); + wl_container->eglwindow = wl_egl_window_create( +- wl_container->surface, (int)round(gdk_window_get_width(window) * scale), +- (int)round(gdk_window_get_height(window) * scale)); ++ wl_container->surface, requestedSize.width, requestedSize.height); + +- LOGCONTAINER("%s [%p] created eglwindow %p size %d x %d scale %f\n", ++ LOGCONTAINER("%s [%p] created eglwindow %p size %d x %d (with scale %f)\n", + __FUNCTION__, (void*)moz_container_get_nsWindow(container), +- (void*)wl_container->eglwindow, gdk_window_get_width(window), +- gdk_window_get_height(window), scale); ++ (void*)wl_container->eglwindow, requestedSize.width, ++ requestedSize.height, scale); ++ } else { ++ nsIntSize recentSize; ++ wl_egl_window_get_attached_size(wl_container->eglwindow, &recentSize.width, ++ &recentSize.height); ++ if (requestedSize != recentSize) { ++ LOGCONTAINER("%s [%p] resized to %d x %d (with scale %f)\n", __FUNCTION__, ++ (void*)moz_container_get_nsWindow(container), ++ requestedSize.width, requestedSize.height, scale); ++ wl_egl_window_resize(wl_container->eglwindow, requestedSize.width, ++ requestedSize.height, 0, 0); ++ } + } ++ moz_container_wayland_surface_set_scale_locked(lock, wl_container, ++ static_cast(scale)); + return wl_container->eglwindow; + } + + gboolean moz_container_wayland_has_egl_window(MozContainer* container) { + return container->wl_container.eglwindow != nullptr; +diff --git a/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp b/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp +--- a/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp ++++ b/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp +@@ -301,11 +301,11 @@ + LayoutDeviceIntRect r = iter.Get(); + wl_surface_damage_buffer(waylandSurface, r.x, r.y, r.width, r.height); + } + } + +- moz_container_wayland_set_scale_factor_locked(container); ++ moz_container_wayland_set_scale_factor_locked(aProofOfLock, container); + mInProgressBuffer->AttachAndCommit(waylandSurface); + + mInProgressBuffer->ResetBufferAge(); + mFrontBuffer = mInProgressBuffer; + mFrontBufferInvalidRegion = aInvalidRegion; +diff --git a/widget/gtk/mozwayland/mozwayland.c b/widget/gtk/mozwayland/mozwayland.c +--- a/widget/gtk/mozwayland/mozwayland.c ++++ b/widget/gtk/mozwayland/mozwayland.c +@@ -186,10 +186,13 @@ + MOZ_EXPORT void wl_egl_window_destroy(struct wl_egl_window* egl_window) {} + + MOZ_EXPORT void wl_egl_window_resize(struct wl_egl_window* egl_window, + int width, int height, int dx, int dy) {} + ++MOZ_EXPORT void wl_egl_window_get_attached_size( ++ struct wl_egl_window* egl_window, int* width, int* height) {} ++ + MOZ_EXPORT void wl_list_init(struct wl_list* list) {} + + MOZ_EXPORT void wl_list_insert(struct wl_list* list, struct wl_list* elm) {} + + MOZ_EXPORT void wl_list_remove(struct wl_list* elm) {} +diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp +--- a/widget/gtk/nsWindow.cpp ++++ b/widget/gtk/nsWindow.cpp +@@ -9816,13 +9816,18 @@ + void nsWindow::SetEGLNativeWindowSize( + const LayoutDeviceIntSize& aEGLWindowSize) { + if (!mContainer || !GdkIsWaylandDisplay()) { + return; + } +- moz_container_wayland_egl_window_set_size(mContainer, aEGLWindowSize.width, +- aEGLWindowSize.height); +- moz_container_wayland_set_scale_factor(mContainer); ++ if (moz_container_wayland_egl_window_needs_size_update( ++ mContainer, aEGLWindowSize.ToUnknownSize(), GdkCeiledScaleFactor())) { ++ LOG("nsWindow::SetEGLNativeWindowSize() %d x %d", aEGLWindowSize.width, ++ aEGLWindowSize.height); ++ moz_container_wayland_egl_window_set_size(mContainer, ++ aEGLWindowSize.ToUnknownSize()); ++ moz_container_wayland_set_scale_factor(mContainer); ++ } + } + #endif + + LayoutDeviceIntSize nsWindow::GetMozContainerSize() { + LayoutDeviceIntSize size(0, 0); + diff --git a/firefox.spec b/firefox.spec index 2d239ce..aa1d967 100644 --- a/firefox.spec +++ b/firefox.spec @@ -178,7 +178,7 @@ ExcludeArch: armv7hl Summary: Mozilla Firefox Web browser Name: firefox Version: 108.0.1 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -255,6 +255,9 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch +Patch416: D163696.diff +Patch417: D163697.diff +Patch418: D163698.diff # PGO/LTO patches Patch600: pgo.patch @@ -530,6 +533,9 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 +%patch416 -p1 -b .D163696 +%patch417 -p1 -b .D163697 +%patch418 -p1 -b .D163698 # PGO patches %if %{build_with_pgo} @@ -1132,6 +1138,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Wed Dec 21 2022 Martin Stransky - 108.0.1-2 +- Added mozbz#1795851 [wayland] Crash buffer size (170x113) + is not divisible by scale (2) + * Mon Dec 19 2022 Martin Stransky - 108.0.1-1 - Update to 108.0.1 From cd7d2b004aab96ba5a9b1545f1e5244c50f1781a Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 21 Dec 2022 10:41:32 +0100 Subject: [PATCH 157/545] Added second arch build fix --- D164896.diff | 1842 ++++++++++++++++++++++++++++++++++++++++++++++++++ firefox.spec | 12 +- 2 files changed, 1848 insertions(+), 6 deletions(-) create mode 100644 D164896.diff diff --git a/D164896.diff b/D164896.diff new file mode 100644 index 0000000..3212ea5 --- /dev/null +++ b/D164896.diff @@ -0,0 +1,1842 @@ +diff --git a/Cargo.lock b/Cargo.lock +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -5775,13 +5775,13 @@ + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" + + [[package]] + name = "uniffi" +-version = "0.21.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "f54af5ada67d1173457a99a7bb44a7917f63e7466764cb4714865c7a6678b830" ++version = "0.21.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "b983553c0d1ad73547c65fa0c399aa800bee4a70ad330198e1c7a523212da5ee" + dependencies = [ + "anyhow", + "bytes 1.2.1", + "camino", + "cargo_metadata", +@@ -5885,13 +5885,11 @@ + "uniffi_macros", + ] + + [[package]] + name = "uniffi_bindgen" +-version = "0.21.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "12cc4af3c0180c7e86c4a3acf2b6587af04ba2567b1e948993df10f421796621" ++version = "0.21.1" + dependencies = [ + "anyhow", + "askama", + "bincode", + "camino", +@@ -5908,24 +5906,34 @@ + "weedle2", + ] + + [[package]] + name = "uniffi_build" +-version = "0.21.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "510287c368a9386eb731ebe824a6fc6c82a105e20d020af1aa20519c1c1561db" ++version = "0.21.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "d035e50433ee3d52ab0dcdcf3b9b26f2cc2ec39294b3c07d95865a518709455f" + dependencies = [ + "anyhow", + "camino", + "uniffi_bindgen", + ] + + [[package]] ++name = "uniffi_checksum_derive" ++version = "0.21.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "78b6e16d46caf942016997af8bbdf4b163bf8ae3deb0b667d9643de7b7ffd4c9" ++dependencies = [ ++ "quote", ++ "syn", ++] ++ ++[[package]] + name = "uniffi_macros" +-version = "0.21.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "5c8604503caa2cbcf271578dc51ca236d40e3b22e1514ffa2e638e2c39f6ad10" ++version = "0.21.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "c96a574677566f83ea8458dac1dd7792fd63e7c3f9dbcd865f0e8d6f8057b127" + dependencies = [ + "bincode", + "camino", + "fs-err", + "once_cell", +@@ -5938,15 +5946,17 @@ + "uniffi_meta", + ] + + [[package]] + name = "uniffi_meta" +-version = "0.21.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "cd9417cc653937681436b93838d8c5f97a5b8c58697813982ee8810bd1dc3b57" ++version = "0.21.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "729835442da829c9b6f7c111c76cf87b2498e129101203bec94f0c39a3296a38" + dependencies = [ + "serde", ++ "siphasher", ++ "uniffi_checksum_derive", + ] + + [[package]] + name = "unix_path" + version = "1.0.1" +diff --git a/Cargo.toml b/Cargo.toml +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -180,10 +180,14 @@ + # okay, but it means that their dependencies on UniFFI crates will normally + # also be the git versions. Patch them to use the published versions to avoid + # duplicate crates. + + [patch."https://github.com/mozilla/uniffi-rs.git"] +-uniffi = "=0.21.0" +-uniffi_bindgen = "=0.21.0" +-uniffi_build = "=0.21.0" +-uniffi_macros = "=0.21.0" ++uniffi = "=0.21.1" ++#uniffi_bindgen = "=0.21.1" ++uniffi_build = "=0.21.1" ++uniffi_macros = "=0.21.1" + weedle2 = "=4.0.0" ++ ++# Patched to use uniffi_version = 0.21.0 for checksums. ++[patch.crates-io.uniffi_bindgen] ++path = "third_party/rust/uniffi_bindgen" +diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml +--- a/supply-chain/audits.toml ++++ b/supply-chain/audits.toml +@@ -1535,10 +1535,16 @@ + who = "Jan-Erik Rediger " + criteria = "safe-to-deploy" + delta = "0.20.0 -> 0.21.0" + notes = "Maintained by the Glean and Application Services team." + ++[[audits.uniffi]] ++who = "Mike Hommey " ++criteria = "safe-to-deploy" ++delta = "0.21.0 -> 0.21.1" ++notes = "No changes." ++ + [[audits.uniffi_bindgen]] + who = "Travis Long " + criteria = "safe-to-deploy" + version = "0.19.3" + notes = "Maintained by the Glean and Application Services teams." +@@ -1558,10 +1564,16 @@ + who = "Jan-Erik Rediger " + criteria = "safe-to-deploy" + delta = "0.20.0 -> 0.21.0" + notes = "Maintained by the Glean and Application Services team." + ++[[audits.uniffi_bindgen]] ++who = "Mike Hommey " ++criteria = "safe-to-deploy" ++delta = "0.21.0 -> 0.21.1" ++notes = "I authored the changes in this version." ++ + [[audits.uniffi_build]] + who = "Travis Long " + criteria = "safe-to-deploy" + version = "0.19.3" + notes = "Maintained by the Glean and Application Services teams." +@@ -1581,10 +1593,22 @@ + who = "Jan-Erik Rediger " + criteria = "safe-to-deploy" + delta = "0.20.0 -> 0.21.0" + notes = "Maintained by the Glean and Application Services team." + ++[[audits.uniffi_build]] ++who = "Mike Hommey " ++criteria = "safe-to-deploy" ++delta = "0.21.0 -> 0.21.1" ++notes = "No changes." ++ ++[[audits.uniffi_checksum_derive]] ++who = "Mike Hommey " ++criteria = "safe-to-deploy" ++version = "0.21.1" ++notes = "I authored this crate." ++ + [[audits.uniffi_macros]] + who = "Travis Long " + criteria = "safe-to-deploy" + version = "0.19.3" + notes = "Maintained by the Glean and Application Services teams." +@@ -1604,10 +1628,16 @@ + who = "Jan-Erik Rediger " + criteria = "safe-to-deploy" + delta = "0.20.0 -> 0.21.0" + notes = "Maintained by the Glean and Application Services team." + ++[[audits.uniffi_macros]] ++who = "Mike Hommey " ++criteria = "safe-to-deploy" ++delta = "0.21.0 -> 0.21.1" ++notes = "No changes." ++ + [[audits.uniffi_meta]] + who = "Jan-Erik Rediger " + criteria = "safe-to-deploy" + version = "0.19.6" + notes = "Maintained by the Glean and Application Services team." +@@ -1621,10 +1651,16 @@ + who = "Jan-Erik Rediger " + criteria = "safe-to-deploy" + delta = "0.20.0 -> 0.21.0" + notes = "Maintained by the Glean and Application Services team." + ++[[audits.uniffi_meta]] ++who = "Mike Hommey " ++criteria = "safe-to-deploy" ++delta = "0.21.0 -> 0.21.1" ++notes = "I authored the changes in this version." ++ + [[audits.void]] + who = "Bobby Holley " + criteria = "safe-to-deploy" + version = "1.0.2" + notes = "Very small crate, just hosts the Void type for easier cross-crate interfacing." +diff --git a/supply-chain/config.toml b/supply-chain/config.toml +--- a/supply-chain/config.toml ++++ b/supply-chain/config.toml +@@ -156,10 +156,14 @@ + + [policy.tabs] + audit-as-crates-io = false + notes = "This is a first-party crate, maintained by the appservices team, which is entirely unrelated to the crates.io package of the same name." + ++[policy.uniffi_bindgen] ++audit-as-crates-io = false ++notes = "This is a first-party crate, normally vendored, but currently patched in-tree until next update." ++ + [policy.viaduct] + audit-as-crates-io = false + notes = "This is a first-party crate, maintained by the appservices team, which is entirely unrelated to the crates.io package of the same name." + + [policy.webdriver] +diff --git a/third_party/rust/uniffi/.cargo-checksum.json b/third_party/rust/uniffi/.cargo-checksum.json +--- a/third_party/rust/uniffi/.cargo-checksum.json ++++ b/third_party/rust/uniffi/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"b7bde8b1b6bb7e1420c9c486d7562d1639fbb82a2b6459b8b3b7d15f002377d3","release.toml":"a6602545cd6eb46e44d89ce946d7954957ac00f1c955de54c736fa2cb560b1df","src/ffi/ffidefault.rs":"c7ab752fffed17c3fabb60e818ad1d093482f95dd0bdeae6871287695c583e48","src/ffi/foreignbytes.rs":"37061e2da7135576abccb86fe27b4fefc054586a040f2ca81fe9858d5649e887","src/ffi/foreigncallbacks.rs":"c0974920313ac81dd4bb28a51dd9e9ef50c8ea6d965f0bfdde58c661a4ca719f","src/ffi/mod.rs":"3fb3b74607066e0052fc91168e9473dbf82dbae562f85c33774a7f5f6b350616","src/ffi/rustbuffer.rs":"b773637d9e4651b80cd16f7a02ed75846d02ce0a9e32b718ce644cdba3a83cdd","src/ffi/rustcalls.rs":"4a85a90b0d46974ab9e80e403a1cddaa252337b227e1a672bb6fdbbca5a66259","src/lib.rs":"83614739f8c0c939b217755cfde169a85608a52ea197f63f7850e5765e2c5f97","src/panichook.rs":"9f49c7994a8e5489c1105c488bb3f8c5571bc5f813e7be90441eca15da5c9851","src/testing.rs":"f287d682a8f27465838b2aba91993c635a4dcd281d802dc12c7c75794324123f","tests/ui/proc_macro_arc.rs":"d766dffee3fe6a93522d40f44a7f15592db141fd674034fa5f016e06f510e87b","tests/ui/proc_macro_arc.stderr":"9e7d098abdd47f249ff62fe0a2ee0f8b96282ec5a3be0c48a778baab4624180f","tests/ui/version_mismatch.rs":"16ea359e5853517ee0d0704c015ae8c825533109fbefd715130d0f4a51f15898","tests/ui/version_mismatch.stderr":"aadbd8f3847f5663022d8dd75d6afa3b25dfc8abccd30b386a681f98587d4ceb"},"package":"f54af5ada67d1173457a99a7bb44a7917f63e7466764cb4714865c7a6678b830"} +\ No newline at end of file ++{"files":{"Cargo.toml":"40a5376941ee93f7d3d013862731eaced1121c852bd4df4affe1cd65bf9b68be","release.toml":"a6602545cd6eb46e44d89ce946d7954957ac00f1c955de54c736fa2cb560b1df","src/ffi/ffidefault.rs":"c7ab752fffed17c3fabb60e818ad1d093482f95dd0bdeae6871287695c583e48","src/ffi/foreignbytes.rs":"37061e2da7135576abccb86fe27b4fefc054586a040f2ca81fe9858d5649e887","src/ffi/foreigncallbacks.rs":"c0974920313ac81dd4bb28a51dd9e9ef50c8ea6d965f0bfdde58c661a4ca719f","src/ffi/mod.rs":"3fb3b74607066e0052fc91168e9473dbf82dbae562f85c33774a7f5f6b350616","src/ffi/rustbuffer.rs":"b773637d9e4651b80cd16f7a02ed75846d02ce0a9e32b718ce644cdba3a83cdd","src/ffi/rustcalls.rs":"4a85a90b0d46974ab9e80e403a1cddaa252337b227e1a672bb6fdbbca5a66259","src/lib.rs":"83614739f8c0c939b217755cfde169a85608a52ea197f63f7850e5765e2c5f97","src/panichook.rs":"9f49c7994a8e5489c1105c488bb3f8c5571bc5f813e7be90441eca15da5c9851","src/testing.rs":"f287d682a8f27465838b2aba91993c635a4dcd281d802dc12c7c75794324123f","tests/ui/proc_macro_arc.rs":"d766dffee3fe6a93522d40f44a7f15592db141fd674034fa5f016e06f510e87b","tests/ui/proc_macro_arc.stderr":"9e7d098abdd47f249ff62fe0a2ee0f8b96282ec5a3be0c48a778baab4624180f","tests/ui/version_mismatch.rs":"16ea359e5853517ee0d0704c015ae8c825533109fbefd715130d0f4a51f15898","tests/ui/version_mismatch.stderr":"aadbd8f3847f5663022d8dd75d6afa3b25dfc8abccd30b386a681f98587d4ceb"},"package":"b983553c0d1ad73547c65fa0c399aa800bee4a70ad330198e1c7a523212da5ee"} +\ No newline at end of file +diff --git a/third_party/rust/uniffi/Cargo.toml b/third_party/rust/uniffi/Cargo.toml +--- a/third_party/rust/uniffi/Cargo.toml ++++ b/third_party/rust/uniffi/Cargo.toml +@@ -10,22 +10,21 @@ + # See Cargo.toml.orig for the original contents. + + [package] + edition = "2021" + name = "uniffi" +-version = "0.21.0" ++version = "0.21.1" + authors = ["Firefox Sync Team "] + description = "a multi-language bindings generator for rust (runtime support code)" + homepage = "https://mozilla.github.io/uniffi-rs" + documentation = "https://mozilla.github.io/uniffi-rs" + keywords = [ + "ffi", + "bindgen", + ] + license = "MPL-2.0" + repository = "https://github.com/mozilla/uniffi-rs" +-resolver = "2" + + [dependencies.anyhow] + version = "1" + + [dependencies.bytes] +@@ -48,15 +47,15 @@ + + [dependencies.static_assertions] + version = "1.1.0" + + [dependencies.uniffi_bindgen] +-version = "=0.21.0" ++version = "=0.21.1" + optional = true + + [dependencies.uniffi_macros] +-version = "=0.21.0" ++version = "=0.21.1" + + [dev-dependencies.trybuild] + version = "1" + + [features] +diff --git a/third_party/rust/uniffi_bindgen/.cargo-checksum.json b/third_party/rust/uniffi_bindgen/.cargo-checksum.json +--- a/third_party/rust/uniffi_bindgen/.cargo-checksum.json ++++ b/third_party/rust/uniffi_bindgen/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{"Cargo.lock":"5ed0714fd87076b5b5f11ca60553f12559e69794c2fec7d487a398f31a577a5f","Cargo.toml":"209b8cb7759ec813ee1e27a4b7e1d2bed2604c37d7c55578058bc7089ee9557e","askama.toml":"1a245b7803adca782837e125c49100147d2de0d5a1c949ff95e91af1701f6058","src/backend/config.rs":"4861dbf251dbb10beb1ed7e3eea7d79499a0de1cd9ce9ee8381a0e729c097dea","src/backend/declarations.rs":"12b8d6e651f84634de5cd02a47601965df7438f64f1a73f136bd89b6b5d515cf","src/backend/mod.rs":"899cd3b816d0467e35789b92ac3b8d5910f6dab98156d405db4803da8721fd36","src/backend/oracle.rs":"9e2b8a45af604a6e4952644e81f43f6aec6e0a1d03939c68b582529dd01a51e0","src/backend/types.rs":"7c49a92096a54eefd2336c48d60fe20ded9490142ab3a229a7c1a99fec14df3d","src/bindings/kotlin/gen_kotlin/callback_interface.rs":"b7fe795670830f3aa8a955c787b1127fe68313ee751013948527948fe5526b01","src/bindings/kotlin/gen_kotlin/compounds.rs":"d1e9a4237ff2ff711a3eae7a564c39e26f598c156ebfd34c0f04879e3533dd4f","src/bindings/kotlin/gen_kotlin/custom.rs":"4176f6ed5f66504f8fd981198bbfbae795dab5ef0d0281881d19b697f5560c44","src/bindings/kotlin/gen_kotlin/enum_.rs":"f85ae8dcb55c8f274139bf321af0ba237ae69894165ad6bd693d793f58af8e5e","src/bindings/kotlin/gen_kotlin/error.rs":"867f583aea5da7aabeb9b6d2544d7e52984cdea4aa008ce5f2ec941074735e1a","src/bindings/kotlin/gen_kotlin/external.rs":"1f7e91d7439891fe3c403274e35880ee4fc3a0da555510bdfa23c1ed2bbd8020","src/bindings/kotlin/gen_kotlin/miscellany.rs":"644ee5bb1f3619be5a36b2b3900af554ea38073cd054004f421e69c3cb8d50bc","src/bindings/kotlin/gen_kotlin/mod.rs":"90412e7927c284668a9eb75823c198182e58e5177d5561896c43b79367564b27","src/bindings/kotlin/gen_kotlin/object.rs":"6478a3e9d5e66186521730d0d481abd1ee4f123050ea050ac5a483842f08b003","src/bindings/kotlin/gen_kotlin/primitives.rs":"914d1f8253ed6a2937f67e8bd8f04f46aef4f22455ceb8a6caa84427adc2093e","src/bindings/kotlin/gen_kotlin/record.rs":"7961fcfbec5ebf8fc010b564ea4bd59402c919f6922898d48226d8c995569dd7","src/bindings/kotlin/mod.rs":"e68f2ea29e66ee62a56704e1e4464eea6d28bbdb52ab187bbe7a57ab3f362ea7","src/bindings/kotlin/templates/BooleanHelper.kt":"28e8a5088c8d58c9bfdbc575af8d8725060521fdd7d092684a8044b24ae567c7","src/bindings/kotlin/templates/CallbackInterfaceRuntime.kt":"6ede374b0fcbb3bcc939894e6f4729b3bec7ec7356831a60fba96ca38dc91aa8","src/bindings/kotlin/templates/CallbackInterfaceTemplate.kt":"5a704eb8c044ed22905e4d526ee3fc0b86f42fe82ac1eb4ad3758ad0552ea8c8","src/bindings/kotlin/templates/CustomTypeTemplate.kt":"5d4dacf29e89bcdcc46d155d993e6059d2df704e775dc853469310198253b231","src/bindings/kotlin/templates/DurationHelper.kt":"414a98161538a26f3a9b357353270c1f245ad6ceed99496aca7162cf473a92fd","src/bindings/kotlin/templates/EnumTemplate.kt":"ab3e2063aad3b91188db839dceb59b854a6a8b60fb35e545e270e64fee7c73fa","src/bindings/kotlin/templates/ErrorTemplate.kt":"a5ec2bdfc026838e1096dbf3301f21aa4ea22e8c93458d45bb1c8c7b9ee1fc5b","src/bindings/kotlin/templates/ExternalTypeTemplate.kt":"2097e0b830640ef18c79449ffa376d1dd35a8c4a5230e413c915f3b868aae872","src/bindings/kotlin/templates/FfiConverterTemplate.kt":"aa22962aaa9f641d48ccf44cb56d9f8a7736cbfaa01e1a1656662cfe5dd5c1d7","src/bindings/kotlin/templates/Float32Helper.kt":"662d95af3b629d143fb4d47cb7e9aa26ed28a5f3846de0341e28b0f9fb08bc25","src/bindings/kotlin/templates/Float64Helper.kt":"a77d099fa7d91e8702c1700e7949ffb6aaba9c6e8041ff48bab34b8e1fc9a0aa","src/bindings/kotlin/templates/Helpers.kt":"46c07798a26b53b06405c8bbbf86e3fcf38fadc1484ea04ce9d482defea89288","src/bindings/kotlin/templates/Int16Helper.kt":"7f83c4a48e1f3b2a59a3ca6a2662be8bc9baf3a5a748b31223cb3f51721ef249","src/bindings/kotlin/templates/Int32Helper.kt":"e02e4702175554b09fd2dd6ac3089dcd2c395f08ec60e762159566a9c9889450","src/bindings/kotlin/templates/Int64Helper.kt":"7a6fd6ca486852c89399c699935a9dfa1c32b9356d9a965cfde532581f05d9fa","src/bindings/kotlin/templates/Int8Helper.kt":"0554545494b6b9a76ce94f9c1723f8cf4230a13076feb75d620b1c9ca1ac4668","src/bindings/kotlin/templates/MapTemplate.kt":"399569d6443e8ad01e2deb95d78d8d2d15bf8eccee8be4fbe9ce4b8ebc0a6101","src/bindings/kotlin/templates/NamespaceLibraryTemplate.kt":"1eba4e77381155c2c96a6af2ef30fca881ade4957852f730fd10aa4f3d9cd3c4","src/bindings/kotlin/templates/ObjectRuntime.kt":"c11d233de41405caa55a56bcaa3bb69ce153ffa6fdff2aa218051929f5c4aeec","src/bindings/kotlin/templates/ObjectTemplate.kt":"7e32d92ec6116da9b7d7f278b15333a2fd2a82dde8c21534e3f6fe371d19f333","src/bindings/kotlin/templates/OptionalTemplate.kt":"5f9f2c1baa829ed3c9b61c3edb0f1fccf5ea3cccc052a69cf8966715d8fcf149","src/bindings/kotlin/templates/RecordTemplate.kt":"193ecdad9322fb5483b95bf2a259270a9b22ba054790794e9abb3fd219196bc5","src/bindings/kotlin/templates/RustBufferTemplate.kt":"415637f80a78c12b3d00db063c14a7ab5c61b098bdb1fc81a0be8bae9511776b","src/bindings/kotlin/templates/SequenceTemplate.kt":"786693b20c608a4f059b91df115278f5f12122b4c14a2e7ce18b6fc9b22b1296","src/bindings/kotlin/templates/StringHelper.kt":"060839663580d8199671b7c3bb3dce5e9106aa766ce2c6e0afc2d2bd788a1d83","src/bindings/kotlin/templates/TimestampHelper.kt":"353c2890f06ad6dda238e9aebb4bdff7bb838e17e46abf351ed3ff1fbc4e6580","src/bindings/kotlin/templates/TopLevelFunctionTemplate.kt":"09b8bb5ffea7075518ee657f83017d44ff0cbf584fd85676b082199139c9be09","src/bindings/kotlin/templates/Types.kt":"db7ed7384b4391a4bc1425ec3a89e0c890538ad30f5e115bae4998c059c8a21b","src/bindings/kotlin/templates/UInt16Helper.kt":"e84a1f30a5a899ba2c5db614d3f3c74f25bccf6dd99bf68b8830829332d051e9","src/bindings/kotlin/templates/UInt32Helper.kt":"7cdf08cc580046935f27ba07b53685968608a102e0a6be305111037c63d7ddf8","src/bindings/kotlin/templates/UInt64Helper.kt":"fd7baacbf3ab6202ff83edcc66e5f7beb11a10053ba66d0b49547616cc7cbe1f","src/bindings/kotlin/templates/UInt8Helper.kt":"bbf5a6d66c995aea9fe2fa9840c6bfa78b03520a09469b984f0e1d43191e453a","src/bindings/kotlin/templates/macros.kt":"eb5e0f9915b8ec9fbf3bf1a714625fbdcef7a7ee7461916e87fec872434ed3ec","src/bindings/kotlin/templates/wrapper.kt":"dd81cf28a4e07c685d29c87a4053eccb6339835cfc7fce3cf581d3d111fed4f5","src/bindings/mod.rs":"51ac55a3d505d5a88eedc83cf12623c2738277a9cd22bf3bbe05be1244de078b","src/bindings/python/gen_python/callback_interface.rs":"e3ffb8ba1aa8ac8ddcfff6554e7ec0d2d695d12955a98a04d114d2d6ca5dacc8","src/bindings/python/gen_python/compounds.rs":"e406c773c3b66368ea74973df742cdcba3014521812048f15de7c0e783eedfaf","src/bindings/python/gen_python/custom.rs":"33756f6bdafbd9b1a3a439c1cced3c83dc1fdb82b5ec235c064e69670ea6086c","src/bindings/python/gen_python/enum_.rs":"634c8406b07cbd24ea4f71cae4c971169e4989ce8019188f4bcd515bc3c77c5d","src/bindings/python/gen_python/error.rs":"d1a3b3edb91d9502064463cc3324770a1a6e0f234d6b49b5d7c43636bfe81d59","src/bindings/python/gen_python/external.rs":"8920b7a2a3b39a9647ec17cdff44308db3bfe9a582f026b060003edd76407599","src/bindings/python/gen_python/miscellany.rs":"f3898b75cf494b39662d886eb78d9cc06685650265fc8a1e87e5de67baa342ae","src/bindings/python/gen_python/mod.rs":"552de45cab20c4467bdcc774c305f298c9d7487c6b89f6786cb7ef1774ccddf6","src/bindings/python/gen_python/object.rs":"b4d3d8a935d4acd689cf1f3857d461dbab3a51c7c8bd821890198fb58ef3a63f","src/bindings/python/gen_python/primitives.rs":"928523bb91d2192d615d044f1fef3714681140562b740cf72dce3168e660e276","src/bindings/python/gen_python/record.rs":"f961dfe8dd1e5caa633754de7ecc684c2211c9b6633a5e6beb6053e60500b9f2","src/bindings/python/mod.rs":"bcf295b334b332c7fd1214ddfdaa727cfe37fed531c3862ce25906b3a70b71c7","src/bindings/python/templates/BooleanHelper.py":"d384ffeefcb5982c4875e819d06e919a295eaa9ff57735e6fef0801bb810d5c9","src/bindings/python/templates/CallbackInterfaceRuntime.py":"7ffef485fc008e2d9efcd07326102f300bd4673b4351353e9e2908355936c3d7","src/bindings/python/templates/CallbackInterfaceTemplate.py":"089b5cc1131e8c9b867c899cb649ce22eb9ba6a4addab4ebf9ba63316c394693","src/bindings/python/templates/CustomType.py":"db3309b3f944fb813d4cef47a04d67a86f824183f7e31289184683155fd985d9","src/bindings/python/templates/DurationHelper.py":"179c14dccd8cc7dc9791f896414f0b5d124ec116eb78173371bd8a0743208da1","src/bindings/python/templates/EnumTemplate.py":"825ca373286f1b3b252b8a1263e29c9e2f0d3e170ceb364bd6c28d6c4595597b","src/bindings/python/templates/ErrorTemplate.py":"b6b1b0d3fc074a7c3ba7db394c5d6cb3279b0fc0e6a331154303c2c6c907458b","src/bindings/python/templates/ExternalTemplate.py":"f582a6e872fe9f8275d33d36ffe017028ca459fe7c53aa680a2512718d0c0fda","src/bindings/python/templates/Float32Helper.py":"7dbc51889cff47ebf1600fad490849e4a87cac4fc0d1756eebd21609eb80b4a9","src/bindings/python/templates/Float64Helper.py":"ba9f334d1339b6eaedcacc1e35068939727170a684f41dec9ee04762ed98cec1","src/bindings/python/templates/Helpers.py":"68f03f651c38c810fa453e123e26f7c94b7a1f9178e0d863b985c3c8fabaa642","src/bindings/python/templates/Int16Helper.py":"60c22fb8b445841ebb3c68be11b81c9eba84a680eaa0e30770953361231da9b5","src/bindings/python/templates/Int32Helper.py":"aff0a017cf767394174e46d8c4fe5a5a704a8e6384fcc38d227634dfe7826916","src/bindings/python/templates/Int64Helper.py":"6c314b91699a6c6ad7db3ef636713bc2a0af9609c82acfd6062b0588177c0026","src/bindings/python/templates/Int8Helper.py":"a6e2d121b1a6d59886fceab3949e571aba1abc06dfede52666954bf15366fb6f","src/bindings/python/templates/MapTemplate.py":"bbe609b865010b98b38c58f2d4fcc97f2adec3e931903bf67263a5e440a84400","src/bindings/python/templates/NamespaceLibraryTemplate.py":"4726dbeb61508a71153436126bc04d03af966dca4f5b37511beb8bcfb6f1f307","src/bindings/python/templates/ObjectTemplate.py":"68302f6da6e4e80fc0cc8eb4ef2d4353d19ad3e9955112a2fabec8bf1b1293c7","src/bindings/python/templates/OptionalTemplate.py":"ab6da433370ba7c1316e266247ee1b7165bc02f6f288e40a7c68806c018e3282","src/bindings/python/templates/RecordTemplate.py":"98cef2adbc2b890e5c67257fb32a57380070988ef4112408eeca85e0b87b566b","src/bindings/python/templates/RustBufferHelper.py":"11f733051e63733c637fb19c4758cb58a40d045792028465f36891f89c7c5f36","src/bindings/python/templates/RustBufferTemplate.py":"90950cfeeb7a028aac9b65aeca897b217eddcfa165a0d59e8af037e834f34146","src/bindings/python/templates/SequenceTemplate.py":"faf2b1d5272a66258972d88c29d5b527cf9e589c8399e30f7ad5a0503133ce9b","src/bindings/python/templates/StringHelper.py":"941a7ad71d9598701efa15323df93766934583a55f4266d26db31e6b744603fc","src/bindings/python/templates/TimestampHelper.py":"b412cea69117858c05bae3210d378c6296658ed02a50e87c52c392dcb62c7892","src/bindings/python/templates/TopLevelFunctionTemplate.py":"2b2883b14f324e543cfeea5293d2a4907fa9ebe93b779da7174a58929d8b0442","src/bindings/python/templates/Types.py":"2eee78ca838f65b7e8ff8f760558c71ca80ad314aaa44efd1d1b8e13b349f1bc","src/bindings/python/templates/UInt16Helper.py":"06be5c9dacdf20e586f8236ed75cf2ca2470078fd8570843ea97c581b25bf860","src/bindings/python/templates/UInt32Helper.py":"41bb9bbf9b7be1060945e1267b1cc052585ec43696b1591f0ee779a0be0feaff","src/bindings/python/templates/UInt64Helper.py":"ba2825fc295a07292d9fb4aeebe74dabb9e6dbe505643e2347875ab12e511f31","src/bindings/python/templates/UInt8Helper.py":"dca5b3fc4a429fb233326224f85c4eccd3a7802ca9958ec309c7f197d59b4e3d","src/bindings/python/templates/macros.py":"3f02a32941e20aea15e136780c24c9695021dbcae08044c4f654f75aadcbd1e1","src/bindings/python/templates/wrapper.py":"627a6e18e72040909887261b8ad918c68104b15110df26b2205d7827c690e8c3","src/bindings/ruby/gen_ruby/mod.rs":"33ae9fc3f69e4c5b7bb6df41e53298f89934cee2bb6d7e7ea8488cefc9d06c03","src/bindings/ruby/gen_ruby/tests.rs":"7dcb86b08e643c43503f4cac6396833497f6988b004321c0067700ee29ffbf32","src/bindings/ruby/mod.rs":"f57fccdfc544210e8cc70e01e4991cee6e72d258ede9d2bb226baad24a3ef0d7","src/bindings/ruby/templates/EnumTemplate.rb":"5480edb347f5829e478d19474691babd72f37616ed846d519b5a61cb1d6cf047","src/bindings/ruby/templates/ErrorTemplate.rb":"147b2c3ff44c19624e7bf7b3a2a04b7badbba5743eaefa0d5e6c05943119c87e","src/bindings/ruby/templates/NamespaceLibraryTemplate.rb":"9b1454208bc83ef8f26aef33713d681e2284dbfea986ec0dd6c9b9c8b7d65e4a","src/bindings/ruby/templates/ObjectTemplate.rb":"c2d2fa2db62d48322b66b53888dcc6de2fc3e579a6b8d0a9f24029c18fffcbb5","src/bindings/ruby/templates/RecordTemplate.rb":"4aeff886928ca972e5dc9b799581b30c66a6f6dce446af3285dd3ed6b422dea9","src/bindings/ruby/templates/RustBufferBuilder.rb":"2ee5a4b97fe590de98ec2119b2dfe103bba75e15b5fb3c178fa51dfa662dfe2c","src/bindings/ruby/templates/RustBufferStream.rb":"ddfc38a6388bdddf8cc24bb6f1af948e4eef2d7ae2091a5130fee57cf53e5a7d","src/bindings/ruby/templates/RustBufferTemplate.rb":"8f37664f5436ba74ccdd801e16220f1b879d2fb56f51f5845b6047c92dc079f8","src/bindings/ruby/templates/TopLevelFunctionTemplate.rb":"88213e7e25bef664da939c04dd5621f438af735ffcb4d2d0c24a529538630069","src/bindings/ruby/templates/macros.rb":"d732a62291c78ccfbc3208227c1b57f6add723fad91b7e699d693e360840e1b0","src/bindings/ruby/templates/wrapper.rb":"542cdf46fb871e66089c9f008cf472cca411fe217d8c66a0a66776c35469aab5","src/bindings/swift/gen_swift/callback_interface.rs":"e331871ac6c9ac9b9533848fb6ddfcabc1e605970343cad307b6d86b72ebe96a","src/bindings/swift/gen_swift/compounds.rs":"f9e87b342f1f9a14295d87bad59d786d4c253a24d22900c2aba44816713718ae","src/bindings/swift/gen_swift/custom.rs":"45cdfa35ef7345dc353d0d2f3cebb17d726e90abdf5ef49422d6b2db65f8fd25","src/bindings/swift/gen_swift/enum_.rs":"018eea78ef85c9f8d715a5bc15c8273030d4f6ba297019949eb578c5cc6276fd","src/bindings/swift/gen_swift/error.rs":"bd95c3303e40f03a321f2cdc8e15a0251f4c7ddbc3c32c4c57eb9569db218488","src/bindings/swift/gen_swift/miscellany.rs":"66f16968f6cccc0b61c544e336a49b96218551731dcce566a176903c9afb3b57","src/bindings/swift/gen_swift/mod.rs":"1e8f98e05a5b03798c91ada854f6a4f2a0682c252143d63c16c6a06bd0419e4b","src/bindings/swift/gen_swift/object.rs":"072a44f484cc66694c57a9fa41ba50a531c9ce19738e11ce9df17cdfc007648f","src/bindings/swift/gen_swift/primitives.rs":"b37b8f3ad3aa7e769e6d465a31282e377f93cd69e4dcf39a56dc833f412ed412","src/bindings/swift/gen_swift/record.rs":"48296332960be3731b9139dc664d4b8a5d56d04cffa34dc995b62cf202b4dbfd","src/bindings/swift/mod.rs":"0ad4afd667ef17b3b577ded9a09cdaa5595afbdb24e7474c6b1e6a8e0a024593","src/bindings/swift/templates/BooleanHelper.swift":"f607928c4d598893421fe9c9f183bab2f23a877a07afeb123dbe90515249ec86","src/bindings/swift/templates/BridgingHeaderTemplate.h":"93a289e393ecdbe1bf986215c3b19d2aed7677d47f79b1833ce73cf6f8762e80","src/bindings/swift/templates/CallbackInterfaceRuntime.swift":"aac01eb4269151be9dde8c95ee8eba7e8d0841b3c2b1dbd88885f01ac64ee147","src/bindings/swift/templates/CallbackInterfaceTemplate.swift":"c9700f52e932556c59a9bfea68fc786746b7f321ff75c33d0a8c1565effaeef5","src/bindings/swift/templates/CustomType.swift":"fe6414f2ce3ea7b148742e2fecf2206d7e69935dd78d56e014aec70f4d6ad3ec","src/bindings/swift/templates/DurationHelper.swift":"bca4a6498b27fe0c877df3c7fbe148538eeda03e68d4e760a7c8a6a15f2067ff","src/bindings/swift/templates/EnumTemplate.swift":"e61bdf7949aa5a7b55a2c10c243e960f683c862e5977f06e7f5956646b4ccb49","src/bindings/swift/templates/ErrorTemplate.swift":"58fb5907d20b7a6db67b128e5f6350015278990fef5945be42477a5b5f82bb18","src/bindings/swift/templates/Float32Helper.swift":"6c1a4da059dd4c6c4392511c93fe9daf4ddeeab71e39afd122797b0e19254318","src/bindings/swift/templates/Float64Helper.swift":"f741568cdfb8e1421369a9a1dc845630a3a0e2dc2d6acf157afd80cd3ef5966f","src/bindings/swift/templates/Helpers.swift":"3cf3a5342a1ef0c7e078b0e58c32ae4437c4fb5dc41acbbd56b1128393c76602","src/bindings/swift/templates/Int16Helper.swift":"76eec2a54a65790c5959380cc9a7362b1e2e201632cccb789153c52e10c8dc4f","src/bindings/swift/templates/Int32Helper.swift":"5afc5e103bf637813fd4b77ab63e47ed38893525101a483218a339f222710061","src/bindings/swift/templates/Int64Helper.swift":"c1a6f6661ef1ad3bd00e8d0bf81adaa6539686eee2b481b046b76dbd87681adf","src/bindings/swift/templates/Int8Helper.swift":"bc46598c966e579cca22d336748c74cdce5674eaaaf75fc24e5fdaa36a43cf9c","src/bindings/swift/templates/MapTemplate.swift":"8b5a9cb41a1ad41b5566fbe3906a1449e5453289208a9fc6a611de1eb937142a","src/bindings/swift/templates/ModuleMapTemplate.modulemap":"99ad1e9bf550a21497296f9248ecd4385dd6d0b5892951d24cf990cdbf3eec2c","src/bindings/swift/templates/ObjectTemplate.swift":"98f744d7baf41e28d9184ae7e1aa9522b1bd951d507e0987879b11d7995782aa","src/bindings/swift/templates/OptionalTemplate.swift":"73f777d2df4fdf42daf0d6035436d168b0d5f0abc15153b97029bc305408f597","src/bindings/swift/templates/RecordTemplate.swift":"af0dc13b32d34254b4cfef3b74f52fd4611aa6c32e055e203414511fd3bbb00a","src/bindings/swift/templates/RustBufferTemplate.swift":"ed16f20cecd264f086c923cd92a5198f444aec99aad4d39e9012f09f530ca809","src/bindings/swift/templates/SequenceTemplate.swift":"977f1409909ff08018c0a80c1330737023b39a8f9fa9a13f5bf9ab4806cac199","src/bindings/swift/templates/StringHelper.swift":"b773c2b3a03f30338ff233881d1b0c0238831b812eff6eb9f0fafcb32ab0743a","src/bindings/swift/templates/TimestampHelper.swift":"6e22e370feae1199bff16bcc6f431decfb7700b02e6afdd84693a0c474eb045e","src/bindings/swift/templates/TopLevelFunctionTemplate.swift":"ca7fcbaa06ee31c7433fd6aa238b6c1135a843f469d9b4f37d4874d514fd80d0","src/bindings/swift/templates/Types.swift":"2f42430cb4ffba8e9b5084c0cf8790fb5bae151878134b8a21e745acf75d2b08","src/bindings/swift/templates/UInt16Helper.swift":"16adb3b50403dad114fad0b86bc220c5adc3bd987c57c290aee7c6407891dfbc","src/bindings/swift/templates/UInt32Helper.swift":"680ddd2815184f520723820f10698a089c222df0388bc0f7734c6d5234194aec","src/bindings/swift/templates/UInt64Helper.swift":"b752852162028a0c132f79f9005c47c263a4dab98833e86758cd7b467e305629","src/bindings/swift/templates/UInt8Helper.swift":"54f4821e704969eeb5c0e002b890d975a20eda3ddc3ee56169ee3c615dfa1079","src/bindings/swift/templates/macros.swift":"0744724c37419e894132b39aea4b8e1f473460583883fa37f38c787a7deea32c","src/bindings/swift/templates/wrapper.swift":"ca1af5fe47bca972c76fb8c9f52b18f727d4343204408de3dd0aae384f0a4171","src/interface/attributes.rs":"2f76377eebdd62e770bb9089885482a49a57e1f8405320bb778353f3e8974447","src/interface/callbacks.rs":"c9f4b97b21195ba2d1787f032f1daa5f4ce2fc40e014942e07e4eb37b5b95ee9","src/interface/enum_.rs":"1a7cda619a986a20fd4d0f145206aba2c500ce5dfca90d01e5324996fd68dc04","src/interface/error.rs":"f31fc0a7e41b4c8f4b81d06958fda14af6f05bfa318206098e0ec351cf4db809","src/interface/ffi.rs":"22d24e4dda327fa78c7632a6e5bbe374ecac0165acc550007feb729d8f4d6adf","src/interface/function.rs":"d6df6d8d412d7c45fe33c7337b37aeb851ae0f21834c4bd8b315aad4ca4ec309","src/interface/literal.rs":"3d2102cb47ff658f329d66d6c867b13a50e7f56535f23c1b414f857741360358","src/interface/mod.rs":"1d1993504ce61a2f578cb6fb42c79b7829a0767c20983581d631ee948819665e","src/interface/namespace.rs":"ab0f63241bb6a0a32f9fd2a1544468cb6daa1f91f6116b7246b52a4a94e4f461","src/interface/object.rs":"44836747d5d00bb40ecadb889c9a6ff32c1cbf625b5a6a337f5891f495fd92fd","src/interface/record.rs":"5859ea6c1f6c5524d1e6f3846954986710d5f74f1c6fd6324c4245b5f70013d5","src/interface/types/finder.rs":"a27f24e64b5bfc796378d1012b5e72001f0a442e8185fdc4430b106595d4b819","src/interface/types/mod.rs":"fe63c3fd233ad905af0358c5d610c85a5a57f263eb899acc756454a1029c4569","src/interface/types/resolver.rs":"7e7ce336ef77c0a6c23deea36856737a97cca9b1c3f5cd0d676fe7df6ade6480","src/lib.rs":"a41b43e3628bb6b3f725580eec255b409947945672887de87c21d5122775a245","src/macro_metadata/ci.rs":"0d6e53d2b5645dd3cc7d196bd3a32ee82c029e1adb9ae93708c27a3fa5c55a88","src/macro_metadata/extract.rs":"ec392692a4601343312f60937987fe460cfb40d2c63a6bb1531fe91903916f10","src/macro_metadata/mod.rs":"1668e6d947fd4a957f557410a8095649de6f8d7fd3eb6a403b8587280dca2d54","src/main.rs":"bbf8e9942d398387e7518533f9b9dc42bfa66156430a87a17605a80a356c0dea","src/scaffolding/mod.rs":"35ae72220843cf3cccefd96e190553e32a5f34ccc58d552fd9165faea12db260","src/scaffolding/templates/CallbackInterfaceTemplate.rs":"3c8caa2e148add8d80701894ee6904fc2d3c5c6424d6d414b36edb6f593b5023","src/scaffolding/templates/EnumTemplate.rs":"eb8802f04f1fd1c9451ad72c1195c136288fdb4e488922b24db75b2fdae65cd7","src/scaffolding/templates/ErrorTemplate.rs":"e7ca4538908a273dd7ba3834219b30fa0e537b2171144f06b6a96fbefb90cd1d","src/scaffolding/templates/ExternalTypesTemplate.rs":"8ecc805cf119abac8c5f60605f9183ee9ec8d37f9ec75bba5e18bb8b482a1abb","src/scaffolding/templates/ObjectTemplate.rs":"34de640428486e17a61ded4f42ce13d8eac3e66cc9f60196ce2575cdc0bd8df6","src/scaffolding/templates/RecordTemplate.rs":"e8d5af954f46f023a243721d6fc70aa176c3a4c0a9dd340048bfe46f3eeed783","src/scaffolding/templates/ReexportUniFFIScaffolding.rs":"559a17c8e39c473ff1effe9651f05b83d443ecd8abed13e03f2b63872d7e1593","src/scaffolding/templates/RustBuffer.rs":"ccf7521012d93c41265375c6d2e80ce861ec93b41383da83c37718386dd726f6","src/scaffolding/templates/TopLevelFunctionTemplate.rs":"35eaefb0862f25ff683d58fb0be6ad5f74bbe2fc85047273200c3a5f4c728434","src/scaffolding/templates/macros.rs":"a41c9690d411074c59fc4609f897431669b9d939625a08f5304a71a88901ba7c","src/scaffolding/templates/scaffolding_template.rs":"3589f8e8e1f9b194ff4a6245665d3a421c771dec3cc947c4264bfcd34573550e"},"package":"12cc4af3c0180c7e86c4a3acf2b6587af04ba2567b1e948993df10f421796621"} +\ No newline at end of file ++{"files":{"Cargo.lock":"3b1693f0ada97ba7e0527d763402404b39fe341da22bd45aaf057e4be3fa3234","Cargo.toml":"58662147277f1620eccd6592f83623cf71959df8326e9d700fdaac47c6e6cf35","askama.toml":"1a245b7803adca782837e125c49100147d2de0d5a1c949ff95e91af1701f6058","src/backend/config.rs":"4861dbf251dbb10beb1ed7e3eea7d79499a0de1cd9ce9ee8381a0e729c097dea","src/backend/declarations.rs":"12b8d6e651f84634de5cd02a47601965df7438f64f1a73f136bd89b6b5d515cf","src/backend/mod.rs":"899cd3b816d0467e35789b92ac3b8d5910f6dab98156d405db4803da8721fd36","src/backend/oracle.rs":"9e2b8a45af604a6e4952644e81f43f6aec6e0a1d03939c68b582529dd01a51e0","src/backend/types.rs":"7c49a92096a54eefd2336c48d60fe20ded9490142ab3a229a7c1a99fec14df3d","src/bindings/kotlin/gen_kotlin/callback_interface.rs":"b7fe795670830f3aa8a955c787b1127fe68313ee751013948527948fe5526b01","src/bindings/kotlin/gen_kotlin/compounds.rs":"d1e9a4237ff2ff711a3eae7a564c39e26f598c156ebfd34c0f04879e3533dd4f","src/bindings/kotlin/gen_kotlin/custom.rs":"4176f6ed5f66504f8fd981198bbfbae795dab5ef0d0281881d19b697f5560c44","src/bindings/kotlin/gen_kotlin/enum_.rs":"f85ae8dcb55c8f274139bf321af0ba237ae69894165ad6bd693d793f58af8e5e","src/bindings/kotlin/gen_kotlin/error.rs":"867f583aea5da7aabeb9b6d2544d7e52984cdea4aa008ce5f2ec941074735e1a","src/bindings/kotlin/gen_kotlin/external.rs":"1f7e91d7439891fe3c403274e35880ee4fc3a0da555510bdfa23c1ed2bbd8020","src/bindings/kotlin/gen_kotlin/miscellany.rs":"644ee5bb1f3619be5a36b2b3900af554ea38073cd054004f421e69c3cb8d50bc","src/bindings/kotlin/gen_kotlin/mod.rs":"90412e7927c284668a9eb75823c198182e58e5177d5561896c43b79367564b27","src/bindings/kotlin/gen_kotlin/object.rs":"6478a3e9d5e66186521730d0d481abd1ee4f123050ea050ac5a483842f08b003","src/bindings/kotlin/gen_kotlin/primitives.rs":"914d1f8253ed6a2937f67e8bd8f04f46aef4f22455ceb8a6caa84427adc2093e","src/bindings/kotlin/gen_kotlin/record.rs":"7961fcfbec5ebf8fc010b564ea4bd59402c919f6922898d48226d8c995569dd7","src/bindings/kotlin/mod.rs":"e68f2ea29e66ee62a56704e1e4464eea6d28bbdb52ab187bbe7a57ab3f362ea7","src/bindings/kotlin/templates/BooleanHelper.kt":"28e8a5088c8d58c9bfdbc575af8d8725060521fdd7d092684a8044b24ae567c7","src/bindings/kotlin/templates/CallbackInterfaceRuntime.kt":"6ede374b0fcbb3bcc939894e6f4729b3bec7ec7356831a60fba96ca38dc91aa8","src/bindings/kotlin/templates/CallbackInterfaceTemplate.kt":"5a704eb8c044ed22905e4d526ee3fc0b86f42fe82ac1eb4ad3758ad0552ea8c8","src/bindings/kotlin/templates/CustomTypeTemplate.kt":"5d4dacf29e89bcdcc46d155d993e6059d2df704e775dc853469310198253b231","src/bindings/kotlin/templates/DurationHelper.kt":"414a98161538a26f3a9b357353270c1f245ad6ceed99496aca7162cf473a92fd","src/bindings/kotlin/templates/EnumTemplate.kt":"ab3e2063aad3b91188db839dceb59b854a6a8b60fb35e545e270e64fee7c73fa","src/bindings/kotlin/templates/ErrorTemplate.kt":"a5ec2bdfc026838e1096dbf3301f21aa4ea22e8c93458d45bb1c8c7b9ee1fc5b","src/bindings/kotlin/templates/ExternalTypeTemplate.kt":"2097e0b830640ef18c79449ffa376d1dd35a8c4a5230e413c915f3b868aae872","src/bindings/kotlin/templates/FfiConverterTemplate.kt":"aa22962aaa9f641d48ccf44cb56d9f8a7736cbfaa01e1a1656662cfe5dd5c1d7","src/bindings/kotlin/templates/Float32Helper.kt":"662d95af3b629d143fb4d47cb7e9aa26ed28a5f3846de0341e28b0f9fb08bc25","src/bindings/kotlin/templates/Float64Helper.kt":"a77d099fa7d91e8702c1700e7949ffb6aaba9c6e8041ff48bab34b8e1fc9a0aa","src/bindings/kotlin/templates/Helpers.kt":"46c07798a26b53b06405c8bbbf86e3fcf38fadc1484ea04ce9d482defea89288","src/bindings/kotlin/templates/Int16Helper.kt":"7f83c4a48e1f3b2a59a3ca6a2662be8bc9baf3a5a748b31223cb3f51721ef249","src/bindings/kotlin/templates/Int32Helper.kt":"e02e4702175554b09fd2dd6ac3089dcd2c395f08ec60e762159566a9c9889450","src/bindings/kotlin/templates/Int64Helper.kt":"7a6fd6ca486852c89399c699935a9dfa1c32b9356d9a965cfde532581f05d9fa","src/bindings/kotlin/templates/Int8Helper.kt":"0554545494b6b9a76ce94f9c1723f8cf4230a13076feb75d620b1c9ca1ac4668","src/bindings/kotlin/templates/MapTemplate.kt":"399569d6443e8ad01e2deb95d78d8d2d15bf8eccee8be4fbe9ce4b8ebc0a6101","src/bindings/kotlin/templates/NamespaceLibraryTemplate.kt":"1eba4e77381155c2c96a6af2ef30fca881ade4957852f730fd10aa4f3d9cd3c4","src/bindings/kotlin/templates/ObjectRuntime.kt":"c11d233de41405caa55a56bcaa3bb69ce153ffa6fdff2aa218051929f5c4aeec","src/bindings/kotlin/templates/ObjectTemplate.kt":"7e32d92ec6116da9b7d7f278b15333a2fd2a82dde8c21534e3f6fe371d19f333","src/bindings/kotlin/templates/OptionalTemplate.kt":"5f9f2c1baa829ed3c9b61c3edb0f1fccf5ea3cccc052a69cf8966715d8fcf149","src/bindings/kotlin/templates/RecordTemplate.kt":"193ecdad9322fb5483b95bf2a259270a9b22ba054790794e9abb3fd219196bc5","src/bindings/kotlin/templates/RustBufferTemplate.kt":"415637f80a78c12b3d00db063c14a7ab5c61b098bdb1fc81a0be8bae9511776b","src/bindings/kotlin/templates/SequenceTemplate.kt":"786693b20c608a4f059b91df115278f5f12122b4c14a2e7ce18b6fc9b22b1296","src/bindings/kotlin/templates/StringHelper.kt":"060839663580d8199671b7c3bb3dce5e9106aa766ce2c6e0afc2d2bd788a1d83","src/bindings/kotlin/templates/TimestampHelper.kt":"353c2890f06ad6dda238e9aebb4bdff7bb838e17e46abf351ed3ff1fbc4e6580","src/bindings/kotlin/templates/TopLevelFunctionTemplate.kt":"09b8bb5ffea7075518ee657f83017d44ff0cbf584fd85676b082199139c9be09","src/bindings/kotlin/templates/Types.kt":"db7ed7384b4391a4bc1425ec3a89e0c890538ad30f5e115bae4998c059c8a21b","src/bindings/kotlin/templates/UInt16Helper.kt":"e84a1f30a5a899ba2c5db614d3f3c74f25bccf6dd99bf68b8830829332d051e9","src/bindings/kotlin/templates/UInt32Helper.kt":"7cdf08cc580046935f27ba07b53685968608a102e0a6be305111037c63d7ddf8","src/bindings/kotlin/templates/UInt64Helper.kt":"fd7baacbf3ab6202ff83edcc66e5f7beb11a10053ba66d0b49547616cc7cbe1f","src/bindings/kotlin/templates/UInt8Helper.kt":"bbf5a6d66c995aea9fe2fa9840c6bfa78b03520a09469b984f0e1d43191e453a","src/bindings/kotlin/templates/macros.kt":"eb5e0f9915b8ec9fbf3bf1a714625fbdcef7a7ee7461916e87fec872434ed3ec","src/bindings/kotlin/templates/wrapper.kt":"dd81cf28a4e07c685d29c87a4053eccb6339835cfc7fce3cf581d3d111fed4f5","src/bindings/mod.rs":"51ac55a3d505d5a88eedc83cf12623c2738277a9cd22bf3bbe05be1244de078b","src/bindings/python/gen_python/callback_interface.rs":"e3ffb8ba1aa8ac8ddcfff6554e7ec0d2d695d12955a98a04d114d2d6ca5dacc8","src/bindings/python/gen_python/compounds.rs":"e406c773c3b66368ea74973df742cdcba3014521812048f15de7c0e783eedfaf","src/bindings/python/gen_python/custom.rs":"33756f6bdafbd9b1a3a439c1cced3c83dc1fdb82b5ec235c064e69670ea6086c","src/bindings/python/gen_python/enum_.rs":"634c8406b07cbd24ea4f71cae4c971169e4989ce8019188f4bcd515bc3c77c5d","src/bindings/python/gen_python/error.rs":"d1a3b3edb91d9502064463cc3324770a1a6e0f234d6b49b5d7c43636bfe81d59","src/bindings/python/gen_python/external.rs":"8920b7a2a3b39a9647ec17cdff44308db3bfe9a582f026b060003edd76407599","src/bindings/python/gen_python/miscellany.rs":"f3898b75cf494b39662d886eb78d9cc06685650265fc8a1e87e5de67baa342ae","src/bindings/python/gen_python/mod.rs":"552de45cab20c4467bdcc774c305f298c9d7487c6b89f6786cb7ef1774ccddf6","src/bindings/python/gen_python/object.rs":"b4d3d8a935d4acd689cf1f3857d461dbab3a51c7c8bd821890198fb58ef3a63f","src/bindings/python/gen_python/primitives.rs":"928523bb91d2192d615d044f1fef3714681140562b740cf72dce3168e660e276","src/bindings/python/gen_python/record.rs":"f961dfe8dd1e5caa633754de7ecc684c2211c9b6633a5e6beb6053e60500b9f2","src/bindings/python/mod.rs":"bcf295b334b332c7fd1214ddfdaa727cfe37fed531c3862ce25906b3a70b71c7","src/bindings/python/templates/BooleanHelper.py":"d384ffeefcb5982c4875e819d06e919a295eaa9ff57735e6fef0801bb810d5c9","src/bindings/python/templates/CallbackInterfaceRuntime.py":"7ffef485fc008e2d9efcd07326102f300bd4673b4351353e9e2908355936c3d7","src/bindings/python/templates/CallbackInterfaceTemplate.py":"089b5cc1131e8c9b867c899cb649ce22eb9ba6a4addab4ebf9ba63316c394693","src/bindings/python/templates/CustomType.py":"db3309b3f944fb813d4cef47a04d67a86f824183f7e31289184683155fd985d9","src/bindings/python/templates/DurationHelper.py":"179c14dccd8cc7dc9791f896414f0b5d124ec116eb78173371bd8a0743208da1","src/bindings/python/templates/EnumTemplate.py":"825ca373286f1b3b252b8a1263e29c9e2f0d3e170ceb364bd6c28d6c4595597b","src/bindings/python/templates/ErrorTemplate.py":"b6b1b0d3fc074a7c3ba7db394c5d6cb3279b0fc0e6a331154303c2c6c907458b","src/bindings/python/templates/ExternalTemplate.py":"f582a6e872fe9f8275d33d36ffe017028ca459fe7c53aa680a2512718d0c0fda","src/bindings/python/templates/Float32Helper.py":"7dbc51889cff47ebf1600fad490849e4a87cac4fc0d1756eebd21609eb80b4a9","src/bindings/python/templates/Float64Helper.py":"ba9f334d1339b6eaedcacc1e35068939727170a684f41dec9ee04762ed98cec1","src/bindings/python/templates/Helpers.py":"68f03f651c38c810fa453e123e26f7c94b7a1f9178e0d863b985c3c8fabaa642","src/bindings/python/templates/Int16Helper.py":"60c22fb8b445841ebb3c68be11b81c9eba84a680eaa0e30770953361231da9b5","src/bindings/python/templates/Int32Helper.py":"aff0a017cf767394174e46d8c4fe5a5a704a8e6384fcc38d227634dfe7826916","src/bindings/python/templates/Int64Helper.py":"6c314b91699a6c6ad7db3ef636713bc2a0af9609c82acfd6062b0588177c0026","src/bindings/python/templates/Int8Helper.py":"a6e2d121b1a6d59886fceab3949e571aba1abc06dfede52666954bf15366fb6f","src/bindings/python/templates/MapTemplate.py":"bbe609b865010b98b38c58f2d4fcc97f2adec3e931903bf67263a5e440a84400","src/bindings/python/templates/NamespaceLibraryTemplate.py":"4726dbeb61508a71153436126bc04d03af966dca4f5b37511beb8bcfb6f1f307","src/bindings/python/templates/ObjectTemplate.py":"68302f6da6e4e80fc0cc8eb4ef2d4353d19ad3e9955112a2fabec8bf1b1293c7","src/bindings/python/templates/OptionalTemplate.py":"ab6da433370ba7c1316e266247ee1b7165bc02f6f288e40a7c68806c018e3282","src/bindings/python/templates/RecordTemplate.py":"98cef2adbc2b890e5c67257fb32a57380070988ef4112408eeca85e0b87b566b","src/bindings/python/templates/RustBufferHelper.py":"11f733051e63733c637fb19c4758cb58a40d045792028465f36891f89c7c5f36","src/bindings/python/templates/RustBufferTemplate.py":"90950cfeeb7a028aac9b65aeca897b217eddcfa165a0d59e8af037e834f34146","src/bindings/python/templates/SequenceTemplate.py":"faf2b1d5272a66258972d88c29d5b527cf9e589c8399e30f7ad5a0503133ce9b","src/bindings/python/templates/StringHelper.py":"941a7ad71d9598701efa15323df93766934583a55f4266d26db31e6b744603fc","src/bindings/python/templates/TimestampHelper.py":"b412cea69117858c05bae3210d378c6296658ed02a50e87c52c392dcb62c7892","src/bindings/python/templates/TopLevelFunctionTemplate.py":"2b2883b14f324e543cfeea5293d2a4907fa9ebe93b779da7174a58929d8b0442","src/bindings/python/templates/Types.py":"2eee78ca838f65b7e8ff8f760558c71ca80ad314aaa44efd1d1b8e13b349f1bc","src/bindings/python/templates/UInt16Helper.py":"06be5c9dacdf20e586f8236ed75cf2ca2470078fd8570843ea97c581b25bf860","src/bindings/python/templates/UInt32Helper.py":"41bb9bbf9b7be1060945e1267b1cc052585ec43696b1591f0ee779a0be0feaff","src/bindings/python/templates/UInt64Helper.py":"ba2825fc295a07292d9fb4aeebe74dabb9e6dbe505643e2347875ab12e511f31","src/bindings/python/templates/UInt8Helper.py":"dca5b3fc4a429fb233326224f85c4eccd3a7802ca9958ec309c7f197d59b4e3d","src/bindings/python/templates/macros.py":"3f02a32941e20aea15e136780c24c9695021dbcae08044c4f654f75aadcbd1e1","src/bindings/python/templates/wrapper.py":"627a6e18e72040909887261b8ad918c68104b15110df26b2205d7827c690e8c3","src/bindings/ruby/gen_ruby/mod.rs":"33ae9fc3f69e4c5b7bb6df41e53298f89934cee2bb6d7e7ea8488cefc9d06c03","src/bindings/ruby/gen_ruby/tests.rs":"7dcb86b08e643c43503f4cac6396833497f6988b004321c0067700ee29ffbf32","src/bindings/ruby/mod.rs":"f57fccdfc544210e8cc70e01e4991cee6e72d258ede9d2bb226baad24a3ef0d7","src/bindings/ruby/templates/EnumTemplate.rb":"5480edb347f5829e478d19474691babd72f37616ed846d519b5a61cb1d6cf047","src/bindings/ruby/templates/ErrorTemplate.rb":"147b2c3ff44c19624e7bf7b3a2a04b7badbba5743eaefa0d5e6c05943119c87e","src/bindings/ruby/templates/NamespaceLibraryTemplate.rb":"9b1454208bc83ef8f26aef33713d681e2284dbfea986ec0dd6c9b9c8b7d65e4a","src/bindings/ruby/templates/ObjectTemplate.rb":"c2d2fa2db62d48322b66b53888dcc6de2fc3e579a6b8d0a9f24029c18fffcbb5","src/bindings/ruby/templates/RecordTemplate.rb":"4aeff886928ca972e5dc9b799581b30c66a6f6dce446af3285dd3ed6b422dea9","src/bindings/ruby/templates/RustBufferBuilder.rb":"2ee5a4b97fe590de98ec2119b2dfe103bba75e15b5fb3c178fa51dfa662dfe2c","src/bindings/ruby/templates/RustBufferStream.rb":"ddfc38a6388bdddf8cc24bb6f1af948e4eef2d7ae2091a5130fee57cf53e5a7d","src/bindings/ruby/templates/RustBufferTemplate.rb":"8f37664f5436ba74ccdd801e16220f1b879d2fb56f51f5845b6047c92dc079f8","src/bindings/ruby/templates/TopLevelFunctionTemplate.rb":"88213e7e25bef664da939c04dd5621f438af735ffcb4d2d0c24a529538630069","src/bindings/ruby/templates/macros.rb":"d732a62291c78ccfbc3208227c1b57f6add723fad91b7e699d693e360840e1b0","src/bindings/ruby/templates/wrapper.rb":"542cdf46fb871e66089c9f008cf472cca411fe217d8c66a0a66776c35469aab5","src/bindings/swift/gen_swift/callback_interface.rs":"e331871ac6c9ac9b9533848fb6ddfcabc1e605970343cad307b6d86b72ebe96a","src/bindings/swift/gen_swift/compounds.rs":"f9e87b342f1f9a14295d87bad59d786d4c253a24d22900c2aba44816713718ae","src/bindings/swift/gen_swift/custom.rs":"45cdfa35ef7345dc353d0d2f3cebb17d726e90abdf5ef49422d6b2db65f8fd25","src/bindings/swift/gen_swift/enum_.rs":"018eea78ef85c9f8d715a5bc15c8273030d4f6ba297019949eb578c5cc6276fd","src/bindings/swift/gen_swift/error.rs":"bd95c3303e40f03a321f2cdc8e15a0251f4c7ddbc3c32c4c57eb9569db218488","src/bindings/swift/gen_swift/miscellany.rs":"66f16968f6cccc0b61c544e336a49b96218551731dcce566a176903c9afb3b57","src/bindings/swift/gen_swift/mod.rs":"1e8f98e05a5b03798c91ada854f6a4f2a0682c252143d63c16c6a06bd0419e4b","src/bindings/swift/gen_swift/object.rs":"072a44f484cc66694c57a9fa41ba50a531c9ce19738e11ce9df17cdfc007648f","src/bindings/swift/gen_swift/primitives.rs":"b37b8f3ad3aa7e769e6d465a31282e377f93cd69e4dcf39a56dc833f412ed412","src/bindings/swift/gen_swift/record.rs":"48296332960be3731b9139dc664d4b8a5d56d04cffa34dc995b62cf202b4dbfd","src/bindings/swift/mod.rs":"0ad4afd667ef17b3b577ded9a09cdaa5595afbdb24e7474c6b1e6a8e0a024593","src/bindings/swift/templates/BooleanHelper.swift":"f607928c4d598893421fe9c9f183bab2f23a877a07afeb123dbe90515249ec86","src/bindings/swift/templates/BridgingHeaderTemplate.h":"93a289e393ecdbe1bf986215c3b19d2aed7677d47f79b1833ce73cf6f8762e80","src/bindings/swift/templates/CallbackInterfaceRuntime.swift":"aac01eb4269151be9dde8c95ee8eba7e8d0841b3c2b1dbd88885f01ac64ee147","src/bindings/swift/templates/CallbackInterfaceTemplate.swift":"c9700f52e932556c59a9bfea68fc786746b7f321ff75c33d0a8c1565effaeef5","src/bindings/swift/templates/CustomType.swift":"fe6414f2ce3ea7b148742e2fecf2206d7e69935dd78d56e014aec70f4d6ad3ec","src/bindings/swift/templates/DurationHelper.swift":"bca4a6498b27fe0c877df3c7fbe148538eeda03e68d4e760a7c8a6a15f2067ff","src/bindings/swift/templates/EnumTemplate.swift":"e61bdf7949aa5a7b55a2c10c243e960f683c862e5977f06e7f5956646b4ccb49","src/bindings/swift/templates/ErrorTemplate.swift":"58fb5907d20b7a6db67b128e5f6350015278990fef5945be42477a5b5f82bb18","src/bindings/swift/templates/Float32Helper.swift":"6c1a4da059dd4c6c4392511c93fe9daf4ddeeab71e39afd122797b0e19254318","src/bindings/swift/templates/Float64Helper.swift":"f741568cdfb8e1421369a9a1dc845630a3a0e2dc2d6acf157afd80cd3ef5966f","src/bindings/swift/templates/Helpers.swift":"3cf3a5342a1ef0c7e078b0e58c32ae4437c4fb5dc41acbbd56b1128393c76602","src/bindings/swift/templates/Int16Helper.swift":"76eec2a54a65790c5959380cc9a7362b1e2e201632cccb789153c52e10c8dc4f","src/bindings/swift/templates/Int32Helper.swift":"5afc5e103bf637813fd4b77ab63e47ed38893525101a483218a339f222710061","src/bindings/swift/templates/Int64Helper.swift":"c1a6f6661ef1ad3bd00e8d0bf81adaa6539686eee2b481b046b76dbd87681adf","src/bindings/swift/templates/Int8Helper.swift":"bc46598c966e579cca22d336748c74cdce5674eaaaf75fc24e5fdaa36a43cf9c","src/bindings/swift/templates/MapTemplate.swift":"8b5a9cb41a1ad41b5566fbe3906a1449e5453289208a9fc6a611de1eb937142a","src/bindings/swift/templates/ModuleMapTemplate.modulemap":"99ad1e9bf550a21497296f9248ecd4385dd6d0b5892951d24cf990cdbf3eec2c","src/bindings/swift/templates/ObjectTemplate.swift":"98f744d7baf41e28d9184ae7e1aa9522b1bd951d507e0987879b11d7995782aa","src/bindings/swift/templates/OptionalTemplate.swift":"73f777d2df4fdf42daf0d6035436d168b0d5f0abc15153b97029bc305408f597","src/bindings/swift/templates/RecordTemplate.swift":"af0dc13b32d34254b4cfef3b74f52fd4611aa6c32e055e203414511fd3bbb00a","src/bindings/swift/templates/RustBufferTemplate.swift":"ed16f20cecd264f086c923cd92a5198f444aec99aad4d39e9012f09f530ca809","src/bindings/swift/templates/SequenceTemplate.swift":"977f1409909ff08018c0a80c1330737023b39a8f9fa9a13f5bf9ab4806cac199","src/bindings/swift/templates/StringHelper.swift":"b773c2b3a03f30338ff233881d1b0c0238831b812eff6eb9f0fafcb32ab0743a","src/bindings/swift/templates/TimestampHelper.swift":"6e22e370feae1199bff16bcc6f431decfb7700b02e6afdd84693a0c474eb045e","src/bindings/swift/templates/TopLevelFunctionTemplate.swift":"ca7fcbaa06ee31c7433fd6aa238b6c1135a843f469d9b4f37d4874d514fd80d0","src/bindings/swift/templates/Types.swift":"2f42430cb4ffba8e9b5084c0cf8790fb5bae151878134b8a21e745acf75d2b08","src/bindings/swift/templates/UInt16Helper.swift":"16adb3b50403dad114fad0b86bc220c5adc3bd987c57c290aee7c6407891dfbc","src/bindings/swift/templates/UInt32Helper.swift":"680ddd2815184f520723820f10698a089c222df0388bc0f7734c6d5234194aec","src/bindings/swift/templates/UInt64Helper.swift":"b752852162028a0c132f79f9005c47c263a4dab98833e86758cd7b467e305629","src/bindings/swift/templates/UInt8Helper.swift":"54f4821e704969eeb5c0e002b890d975a20eda3ddc3ee56169ee3c615dfa1079","src/bindings/swift/templates/macros.swift":"0744724c37419e894132b39aea4b8e1f473460583883fa37f38c787a7deea32c","src/bindings/swift/templates/wrapper.swift":"ca1af5fe47bca972c76fb8c9f52b18f727d4343204408de3dd0aae384f0a4171","src/interface/attributes.rs":"6c062b60deb332fbb76e70bc675e65c2bc3f2060fad7cec87492609fa9ce166c","src/interface/callbacks.rs":"e311fe8c80fae1d84c1e867a3c36a47a6d6a41847bb2d633edefac7c69402c84","src/interface/enum_.rs":"4ff34ff12c19be0bc9d807020fd4c8e20660c418741e68408671a18165e4b95b","src/interface/error.rs":"85a61e5bb38b369b60110928a78dc84ae77a06d0cbae4dfe9ff9dff2b8c27e5a","src/interface/ffi.rs":"22d24e4dda327fa78c7632a6e5bbe374ecac0165acc550007feb729d8f4d6adf","src/interface/function.rs":"19219c6c984d4117362ee5c269712ec2ad462476902442062ef2a3b0619b014c","src/interface/literal.rs":"d93d168176ba2824d26c490396f4baffc1d418c3c94e4a1ef0ceb3cfca16a239","src/interface/mod.rs":"88dd169859004da79bd1488e6432bc7dae8b6cba9238cab1d676e570dad31d62","src/interface/namespace.rs":"ab0f63241bb6a0a32f9fd2a1544468cb6daa1f91f6116b7246b52a4a94e4f461","src/interface/object.rs":"106cbf5ec2a684700dd99c9748ba161320abb2cecec3c5022d5dd1a9ec4f5b85","src/interface/record.rs":"5b9db093c0c90f5c757e09e6c9afee6b99e2e724c7b388924990b1a6f46357e9","src/interface/types/finder.rs":"a27f24e64b5bfc796378d1012b5e72001f0a442e8185fdc4430b106595d4b819","src/interface/types/mod.rs":"25a598fd206975cc1e62aaa269b461654c913ad6c0b6a2719c486acfcc68b45b","src/interface/types/resolver.rs":"7e7ce336ef77c0a6c23deea36856737a97cca9b1c3f5cd0d676fe7df6ade6480","src/lib.rs":"a41b43e3628bb6b3f725580eec255b409947945672887de87c21d5122775a245","src/macro_metadata/ci.rs":"0d6e53d2b5645dd3cc7d196bd3a32ee82c029e1adb9ae93708c27a3fa5c55a88","src/macro_metadata/extract.rs":"ec392692a4601343312f60937987fe460cfb40d2c63a6bb1531fe91903916f10","src/macro_metadata/mod.rs":"1668e6d947fd4a957f557410a8095649de6f8d7fd3eb6a403b8587280dca2d54","src/main.rs":"bbf8e9942d398387e7518533f9b9dc42bfa66156430a87a17605a80a356c0dea","src/scaffolding/mod.rs":"35ae72220843cf3cccefd96e190553e32a5f34ccc58d552fd9165faea12db260","src/scaffolding/templates/CallbackInterfaceTemplate.rs":"3c8caa2e148add8d80701894ee6904fc2d3c5c6424d6d414b36edb6f593b5023","src/scaffolding/templates/EnumTemplate.rs":"eb8802f04f1fd1c9451ad72c1195c136288fdb4e488922b24db75b2fdae65cd7","src/scaffolding/templates/ErrorTemplate.rs":"e7ca4538908a273dd7ba3834219b30fa0e537b2171144f06b6a96fbefb90cd1d","src/scaffolding/templates/ExternalTypesTemplate.rs":"8ecc805cf119abac8c5f60605f9183ee9ec8d37f9ec75bba5e18bb8b482a1abb","src/scaffolding/templates/ObjectTemplate.rs":"34de640428486e17a61ded4f42ce13d8eac3e66cc9f60196ce2575cdc0bd8df6","src/scaffolding/templates/RecordTemplate.rs":"e8d5af954f46f023a243721d6fc70aa176c3a4c0a9dd340048bfe46f3eeed783","src/scaffolding/templates/ReexportUniFFIScaffolding.rs":"559a17c8e39c473ff1effe9651f05b83d443ecd8abed13e03f2b63872d7e1593","src/scaffolding/templates/RustBuffer.rs":"ccf7521012d93c41265375c6d2e80ce861ec93b41383da83c37718386dd726f6","src/scaffolding/templates/TopLevelFunctionTemplate.rs":"35eaefb0862f25ff683d58fb0be6ad5f74bbe2fc85047273200c3a5f4c728434","src/scaffolding/templates/macros.rs":"a41c9690d411074c59fc4609f897431669b9d939625a08f5304a71a88901ba7c","src/scaffolding/templates/scaffolding_template.rs":"3589f8e8e1f9b194ff4a6245665d3a421c771dec3cc947c4264bfcd34573550e"},"package":"5d46080a4840abccf7c0cce21931dae53215cbd7dd969b5e63c486235ce91a2a"} +\ No newline at end of file +diff --git a/third_party/rust/uniffi_bindgen/Cargo.lock b/third_party/rust/uniffi_bindgen/Cargo.lock +--- a/third_party/rust/uniffi_bindgen/Cargo.lock ++++ b/third_party/rust/uniffi_bindgen/Cargo.lock +@@ -2,13 +2,13 @@ + # It is not intended for manual editing. + version = 3 + + [[package]] + name = "anyhow" +-version = "1.0.65" ++version = "1.0.66" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602" ++checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" + + [[package]] + name = "askama" + version = "0.11.1" + source = "registry+https://github.com/rust-lang/crates.io-index" +@@ -97,13 +97,13 @@ + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + + [[package]] + name = "clap" +-version = "3.2.22" ++version = "3.2.23" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750" ++checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" + dependencies = [ + "atty", + "bitflags", + "clap_derive", + "clap_lex", +@@ -136,13 +136,13 @@ + "os_str_bytes", + ] + + [[package]] + name = "fs-err" +-version = "2.8.1" ++version = "2.9.0" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "64db3e262960f0662f43a6366788d5f10f7f244b8f7d7d987f560baf5ded5c50" ++checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" + + [[package]] + name = "goblin" + version = "0.5.4" + source = "registry+https://github.com/rust-lang/crates.io-index" +@@ -174,13 +174,13 @@ + "libc", + ] + + [[package]] + name = "indexmap" +-version = "1.9.1" ++version = "1.9.2" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" ++checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" + dependencies = [ + "autocfg", + "hashbrown", + ] + +@@ -190,13 +190,13 @@ + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" + + [[package]] + name = "libc" +-version = "0.2.135" ++version = "0.2.138" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" ++checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" + + [[package]] + name = "log" + version = "0.4.17" + source = "registry+https://github.com/rust-lang/crates.io-index" +@@ -243,25 +243,25 @@ + "minimal-lexical", + ] + + [[package]] + name = "once_cell" +-version = "1.15.0" ++version = "1.16.0" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" ++checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" + + [[package]] + name = "os_str_bytes" +-version = "6.3.0" ++version = "6.4.1" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" ++checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" + + [[package]] + name = "paste" +-version = "1.0.9" ++version = "1.0.10" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" ++checksum = "cf1c2c742266c2f1041c914ba65355a83ae8747b05f208319784083583494b4b" + + [[package]] + name = "plain" + version = "0.2.3" + source = "registry+https://github.com/rust-lang/crates.io-index" +@@ -291,13 +291,13 @@ + "version_check", + ] + + [[package]] + name = "proc-macro2" +-version = "1.0.46" ++version = "1.0.47" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b" ++checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" + dependencies = [ + "unicode-ident", + ] + + [[package]] +@@ -335,50 +335,56 @@ + "syn", + ] + + [[package]] + name = "serde" +-version = "1.0.145" ++version = "1.0.150" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" ++checksum = "e326c9ec8042f1b5da33252c8a37e9ffbd2c9bef0155215b6e6c80c790e05f91" + dependencies = [ + "serde_derive", + ] + + [[package]] + name = "serde_derive" +-version = "1.0.145" ++version = "1.0.150" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" ++checksum = "42a3df25b0713732468deadad63ab9da1f1fd75a48a15024b50363f128db627e" + dependencies = [ + "proc-macro2", + "quote", + "syn", + ] + + [[package]] + name = "serde_json" +-version = "1.0.86" ++version = "1.0.89" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "41feea4228a6f1cd09ec7a3593a682276702cd67b5273544757dae23c096f074" ++checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" + dependencies = [ + "itoa", + "ryu", + "serde", + ] + + [[package]] ++name = "siphasher" ++version = "0.3.10" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" ++ ++[[package]] + name = "strsim" + version = "0.10.0" + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + + [[package]] + name = "syn" +-version = "1.0.102" ++version = "1.0.105" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1" ++checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" + dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", + ] +@@ -392,19 +398,19 @@ + "winapi-util", + ] + + [[package]] + name = "textwrap" +-version = "0.15.1" ++version = "0.16.0" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16" ++checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + + [[package]] + name = "toml" +-version = "0.5.9" ++version = "0.5.10" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" ++checksum = "1333c76748e868a4d9d1017b5ab53171dfd095f70c712fdb4653a406547f598f" + dependencies = [ + "serde", + ] + + [[package]] +@@ -422,11 +428,11 @@ + source = "registry+https://github.com/rust-lang/crates.io-index" + checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" + + [[package]] + name = "uniffi_bindgen" +-version = "0.21.0" ++version = "0.21.1" + dependencies = [ + "anyhow", + "askama", + "bincode", + "camino", +@@ -442,16 +448,28 @@ + "uniffi_meta", + "weedle2", + ] + + [[package]] ++name = "uniffi_checksum_derive" ++version = "0.21.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "78b6e16d46caf942016997af8bbdf4b163bf8ae3deb0b667d9643de7b7ffd4c9" ++dependencies = [ ++ "quote", ++ "syn", ++] ++ ++[[package]] + name = "uniffi_meta" +-version = "0.21.0" ++version = "0.21.1" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "cd9417cc653937681436b93838d8c5f97a5b8c58697813982ee8810bd1dc3b57" ++checksum = "729835442da829c9b6f7c111c76cf87b2498e129101203bec94f0c39a3296a38" + dependencies = [ + "serde", ++ "siphasher", ++ "uniffi_checksum_derive", + ] + + [[package]] + name = "version_check" + version = "0.9.4" +diff --git a/third_party/rust/uniffi_bindgen/Cargo.toml b/third_party/rust/uniffi_bindgen/Cargo.toml +--- a/third_party/rust/uniffi_bindgen/Cargo.toml ++++ b/third_party/rust/uniffi_bindgen/Cargo.toml +@@ -10,22 +10,21 @@ + # See Cargo.toml.orig for the original contents. + + [package] + edition = "2021" + name = "uniffi_bindgen" +-version = "0.21.0" ++version = "0.21.1" + authors = ["Firefox Sync Team "] + description = "a multi-language bindings generator for rust (codegen and cli tooling)" + homepage = "https://mozilla.github.io/uniffi-rs" + documentation = "https://mozilla.github.io/uniffi-rs" + keywords = [ + "ffi", + "bindgen", + ] + license = "MPL-2.0" + repository = "https://github.com/mozilla/uniffi-rs" +-resolver = "2" + + [[bin]] + name = "uniffi-bindgen" + path = "src/main.rs" + +@@ -74,9 +73,9 @@ + + [dependencies.toml] + version = "0.5" + + [dependencies.uniffi_meta] +-version = "=0.21.0" ++version = "=0.21.1" + + [dependencies.weedle2] + version = "4.0.0" +diff --git a/third_party/rust/uniffi_bindgen/src/interface/attributes.rs b/third_party/rust/uniffi_bindgen/src/interface/attributes.rs +--- a/third_party/rust/uniffi_bindgen/src/interface/attributes.rs ++++ b/third_party/rust/uniffi_bindgen/src/interface/attributes.rs +@@ -13,17 +13,18 @@ + //! We only support a small number of attributes, so it's manageable to have them + //! all handled by a single abstraction. This might need to be refactored in future + //! if we grow significantly more complicated attribute handling. + + use anyhow::{bail, Result}; ++use uniffi_meta::Checksum; + + /// Represents an attribute parsed from UDL, like `[ByRef]` or `[Throws]`. + /// + /// This is a convenience enum for parsing UDL attributes and erroring out if we encounter + /// any unsupported ones. These don't convert directly into parts of a `ComponentInterface`, but + /// may influence the properties of things like functions and arguments. +-#[derive(Debug, Clone, Hash)] ++#[derive(Debug, Clone, Checksum)] + pub(super) enum Attribute { + ByRef, + Enum, + Error, + Name(String), +@@ -117,11 +118,11 @@ + Ok(attrs) + } + + /// Attributes that can be attached to an `enum` definition in the UDL. + /// There's only one case here: using `[Error]` to mark an enum as an error class. +-#[derive(Debug, Clone, Hash, Default)] ++#[derive(Debug, Clone, Checksum, Default)] + pub(super) struct EnumAttributes(Vec); + + impl EnumAttributes { + pub fn contains_error_attr(&self) -> bool { + self.0.iter().any(|attr| attr.is_error()) +@@ -153,11 +154,11 @@ + + /// Represents UDL attributes that might appear on a function. + /// + /// This supports the `[Throws=ErrorName]` attribute for functions that + /// can produce an error. +-#[derive(Debug, Clone, Hash, Default)] ++#[derive(Debug, Clone, Checksum, Default)] + pub(super) struct FunctionAttributes(Vec); + + impl FunctionAttributes { + pub(super) fn get_throws_err(&self) -> Option<&str> { + self.0.iter().find_map(|attr| match attr { +@@ -196,11 +197,11 @@ + + /// Represents UDL attributes that might appear on a function argument. + /// + /// This supports the `[ByRef]` attribute for arguments that should be passed + /// by reference in the generated Rust scaffolding. +-#[derive(Debug, Clone, Hash, Default)] ++#[derive(Debug, Clone, Checksum, Default)] + pub(super) struct ArgumentAttributes(Vec); + + impl ArgumentAttributes { + pub fn by_ref(&self) -> bool { + self.0.iter().any(|attr| matches!(attr, Attribute::ByRef)) +@@ -231,11 +232,11 @@ + } + } + } + + /// Represents UDL attributes that might appear on an `interface` definition. +-#[derive(Debug, Clone, Hash, Default)] ++#[derive(Debug, Clone, Checksum, Default)] + pub(super) struct InterfaceAttributes(Vec); + + impl InterfaceAttributes { + pub fn contains_enum_attr(&self) -> bool { + self.0.iter().any(|attr| attr.is_enum()) +@@ -285,11 +286,11 @@ + + /// Represents UDL attributes that might appear on a constructor. + /// + /// This supports the `[Throws=ErrorName]` attribute for constructors that can produce + /// an error, and the `[Name=MethodName]` for non-default constructors. +-#[derive(Debug, Clone, Hash, Default)] ++#[derive(Debug, Clone, Checksum, Default)] + pub(super) struct ConstructorAttributes(Vec); + + impl ConstructorAttributes { + pub(super) fn get_throws_err(&self) -> Option<&str> { + self.0.iter().find_map(|attr| match attr { +@@ -324,11 +325,11 @@ + + /// Represents UDL attributes that might appear on a method. + /// + /// This supports the `[Throws=ErrorName]` attribute for methods that can produce + /// an error, and the `[Self=ByArc]` attribute for methods that take `Arc` as receiver. +-#[derive(Debug, Clone, Hash, Default)] ++#[derive(Debug, Clone, Checksum, Default)] + pub(super) struct MethodAttributes(Vec); + + impl MethodAttributes { + pub(super) fn get_throws_err(&self) -> Option<&str> { + self.0.iter().find_map(|attr| match attr { +@@ -373,11 +374,11 @@ + /// Represents the different possible types of method call receiver. + /// + /// Actually we only support one of these right now, `[Self=ByArc]`. + /// We might add more in future, e.g. a `[Self=ByRef]` if there are cases + /// where we need to force the receiver to be taken by reference. +-#[derive(Debug, Clone, Hash)] ++#[derive(Debug, Clone, Checksum)] + pub(super) enum SelfType { + ByArc, // Method receiver is `Arc`. + } + + impl TryFrom<&weedle::attribute::IdentifierOrString<'_>> for SelfType { +@@ -396,11 +397,11 @@ + } + + /// Represents UDL attributes that might appear on a typedef + /// + /// This supports the `[External="crate_name"]` and `[Custom]` attributes for types. +-#[derive(Debug, Clone, Hash, Default)] ++#[derive(Debug, Clone, Checksum, Default)] + pub(super) struct TypedefAttributes(Vec); + + impl TypedefAttributes { + pub(super) fn get_crate_name(&self) -> String { + self.0 +diff --git a/third_party/rust/uniffi_bindgen/src/interface/callbacks.rs b/third_party/rust/uniffi_bindgen/src/interface/callbacks.rs +--- a/third_party/rust/uniffi_bindgen/src/interface/callbacks.rs ++++ b/third_party/rust/uniffi_bindgen/src/interface/callbacks.rs +@@ -31,23 +31,29 @@ + //! assert_eq!(callback.name(), "Example"); + //! assert_eq!(callback.methods()[0].name(), "hello"); + //! # Ok::<(), anyhow::Error>(()) + //! ``` + +-use std::hash::{Hash, Hasher}; +- + use anyhow::{bail, Result}; ++use uniffi_meta::Checksum; + + use super::ffi::{FFIArgument, FFIFunction, FFIType}; + use super::object::Method; + use super::types::{Type, TypeIterator}; + use super::{APIConverter, ComponentInterface}; + +-#[derive(Debug, Clone)] ++#[derive(Debug, Clone, Checksum)] + pub struct CallbackInterface { + pub(super) name: String, + pub(super) methods: Vec, ++ // We don't include the FFIFunc in the hash calculation, because: ++ // - it is entirely determined by the other fields, ++ // so excluding it is safe. ++ // - its `name` property includes a checksum derived from the very ++ // hash value we're trying to calculate here, so excluding it ++ // avoids a weird circular depenendency in the calculation. ++ #[checksum_ignore] + pub(super) ffi_init_callback: FFIFunction, + } + + impl CallbackInterface { + fn new(name: String) -> CallbackInterface { +@@ -86,23 +92,10 @@ + pub fn iter_types(&self) -> TypeIterator<'_> { + Box::new(self.methods.iter().flat_map(Method::iter_types)) + } + } + +-impl Hash for CallbackInterface { +- fn hash(&self, state: &mut H) { +- // We don't include the FFIFunc in the hash calculation, because: +- // - it is entirely determined by the other fields, +- // so excluding it is safe. +- // - its `name` property includes a checksum derived from the very +- // hash value we're trying to calculate here, so excluding it +- // avoids a weird circular depenendency in the calculation. +- self.name.hash(state); +- self.methods.hash(state); +- } +-} +- + impl APIConverter for weedle::CallbackInterfaceDefinition<'_> { + fn convert(&self, ci: &mut ComponentInterface) -> Result { + if self.attributes.is_some() { + bail!("callback interface attributes are not supported yet"); + } +diff --git a/third_party/rust/uniffi_bindgen/src/interface/enum_.rs b/third_party/rust/uniffi_bindgen/src/interface/enum_.rs +--- a/third_party/rust/uniffi_bindgen/src/interface/enum_.rs ++++ b/third_party/rust/uniffi_bindgen/src/interface/enum_.rs +@@ -75,21 +75,22 @@ + //! assert_eq!(e.variants()[1].fields()[0].name(), "first"); + //! # Ok::<(), anyhow::Error>(()) + //! ``` + + use anyhow::{bail, Result}; ++use uniffi_meta::Checksum; + + use super::record::Field; + use super::types::{Type, TypeIterator}; + use super::{APIConverter, ComponentInterface}; + + /// Represents an enum with named variants, each of which may have named + /// and typed fields. + /// + /// Enums are passed across the FFI by serializing to a bytebuffer, with a + /// i32 indicating the variant followed by the serialization of each field. +-#[derive(Debug, Clone, Hash)] ++#[derive(Debug, Clone, Checksum)] + pub struct Enum { + pub(super) name: String, + pub(super) variants: Vec, + // "Flat" enums do not have, and will never have, variants with associated data. + pub(super) flat: bool, +@@ -172,11 +173,11 @@ + } + + /// Represents an individual variant in an Enum. + /// + /// Each variant has a name and zero or more fields. +-#[derive(Debug, Clone, Default, Hash)] ++#[derive(Debug, Clone, Default, Checksum)] + pub struct Variant { + pub(super) name: String, + pub(super) fields: Vec, + } + +diff --git a/third_party/rust/uniffi_bindgen/src/interface/error.rs b/third_party/rust/uniffi_bindgen/src/interface/error.rs +--- a/third_party/rust/uniffi_bindgen/src/interface/error.rs ++++ b/third_party/rust/uniffi_bindgen/src/interface/error.rs +@@ -81,10 +81,11 @@ + //! assert_eq!(err.is_flat(), false); + //! # Ok::<(), anyhow::Error>(()) + //! ``` + + use anyhow::Result; ++use uniffi_meta::Checksum; + + use super::enum_::{Enum, Variant}; + use super::types::{Type, TypeIterator}; + use super::{APIConverter, ComponentInterface}; + +@@ -92,11 +93,11 @@ + /// + /// Errors are represented in the UDL as enums with the special `[Error]` attribute, but + /// they're handled in the FFI very differently. We create them in `uniffi::call_with_result()` if + /// the wrapped function returns an `Err` value + /// struct and assign an integer error code to each variant. +-#[derive(Debug, Clone, Hash)] ++#[derive(Debug, Clone, Checksum)] + pub struct Error { + pub name: String, + enum_: Enum, + } + +diff --git a/third_party/rust/uniffi_bindgen/src/interface/function.rs b/third_party/rust/uniffi_bindgen/src/interface/function.rs +--- a/third_party/rust/uniffi_bindgen/src/interface/function.rs ++++ b/third_party/rust/uniffi_bindgen/src/interface/function.rs +@@ -30,13 +30,13 @@ + //! assert!(matches!(func.return_type(), Some(Type::String))); + //! assert_eq!(func.arguments().len(), 0); + //! # Ok::<(), anyhow::Error>(()) + //! ``` + use std::convert::TryFrom; +-use std::hash::{Hash, Hasher}; + + use anyhow::{bail, Result}; ++use uniffi_meta::Checksum; + + use super::ffi::{FFIArgument, FFIFunction}; + use super::literal::{convert_default_value, Literal}; + use super::types::{Type, TypeIterator}; + use super::{ +@@ -49,15 +49,22 @@ + /// + /// Each `Function` corresponds to a standalone function in the rust module, + /// and has a corresponding standalone function in the foreign language bindings. + /// + /// In the FFI, this will be a standalone function with appropriately lowered types. +-#[derive(Debug, Clone)] ++#[derive(Debug, Clone, Checksum)] + pub struct Function { + pub(super) name: String, + pub(super) arguments: Vec, + pub(super) return_type: Option, ++ // We don't include the FFIFunc in the hash calculation, because: ++ // - it is entirely determined by the other fields, ++ // so excluding it is safe. ++ // - its `name` property includes a checksum derived from the very ++ // hash value we're trying to calculate here, so excluding it ++ // avoids a weird circular depenendency in the calculation. ++ #[checksum_ignore] + pub(super) ffi_func: FFIFunction, + pub(super) attributes: FunctionAttributes, + } + + impl Function { +@@ -140,25 +147,10 @@ + attributes: Default::default(), + } + } + } + +-impl Hash for Function { +- fn hash(&self, state: &mut H) { +- // We don't include the FFIFunc in the hash calculation, because: +- // - it is entirely determined by the other fields, +- // so excluding it is safe. +- // - its `name` property includes a checksum derived from the very +- // hash value we're trying to calculate here, so excluding it +- // avoids a weird circular depenendency in the calculation. +- self.name.hash(state); +- self.arguments.hash(state); +- self.return_type.hash(state); +- self.attributes.hash(state); +- } +-} +- + impl APIConverter for weedle::namespace::NamespaceMember<'_> { + fn convert(&self, ci: &mut ComponentInterface) -> Result { + match self { + weedle::namespace::NamespaceMember::Operation(f) => f.convert(ci), + _ => bail!("no support for namespace member type {:?} yet", self), +@@ -183,11 +175,11 @@ + } + + /// Represents an argument to a function/constructor/method call. + /// + /// Each argument has a name and a type, along with some optional metadata. +-#[derive(Debug, Clone, Hash)] ++#[derive(Debug, Clone, Checksum)] + pub struct Argument { + pub(super) name: String, + pub(super) type_: Type, + pub(super) by_ref: bool, + pub(super) optional: bool, +diff --git a/third_party/rust/uniffi_bindgen/src/interface/literal.rs b/third_party/rust/uniffi_bindgen/src/interface/literal.rs +--- a/third_party/rust/uniffi_bindgen/src/interface/literal.rs ++++ b/third_party/rust/uniffi_bindgen/src/interface/literal.rs +@@ -6,16 +6,17 @@ + //! + //! This module provides support for interpreting literal values from the UDL, + //! which appear in places such as default arguments. + + use anyhow::{bail, Result}; ++use uniffi_meta::Checksum; + + use super::types::Type; + + // Represents a literal value. + // Used for e.g. default argument values. +-#[derive(Debug, Clone, Hash)] ++#[derive(Debug, Clone, Checksum)] + pub enum Literal { + Boolean(bool), + String(String), + // Integers are represented as the widest representation we can. + // Number formatting vary with language and radix, so we avoid a lot of parsing and +@@ -33,11 +34,11 @@ + Null, + } + + // Represent the radix of integer literal values. + // We preserve the radix into the generated bindings for readability reasons. +-#[derive(Debug, Clone, Copy, Hash)] ++#[derive(Debug, Clone, Copy, Checksum)] + pub enum Radix { + Decimal = 10, + Octal = 8, + Hexadecimal = 16, + } +diff --git a/third_party/rust/uniffi_bindgen/src/interface/mod.rs b/third_party/rust/uniffi_bindgen/src/interface/mod.rs +--- a/third_party/rust/uniffi_bindgen/src/interface/mod.rs ++++ b/third_party/rust/uniffi_bindgen/src/interface/mod.rs +@@ -42,16 +42,11 @@ + //! a good opportunity here for e.g. interned strings, but we're nowhere near the point were we need + //! that kind of optimization just yet. + //! + //! * Error messages and general developer experience leave a lot to be desired. + +-use std::{ +- collections::HashSet, +- convert::TryFrom, +- hash::{Hash, Hasher}, +- iter, +-}; ++use std::{collections::HashSet, convert::TryFrom, iter}; + + use anyhow::{bail, Result}; + + pub mod types; + pub use types::Type; +@@ -75,26 +70,30 @@ + mod record; + pub use record::{Field, Record}; + + pub mod ffi; + pub use ffi::{FFIArgument, FFIFunction, FFIType}; +-use uniffi_meta::{MethodMetadata, ObjectMetadata}; ++use uniffi_meta::{Checksum, MethodMetadata, ObjectMetadata}; + + /// The main public interface for this module, representing the complete details of an interface exposed + /// by a rust component and the details of consuming it via an extern-C FFI layer. + /// +-#[derive(Debug, Default)] ++#[derive(Debug, Default, Checksum)] + pub struct ComponentInterface { + /// Every ComponentInterface gets tagged with the version of uniffi used to create it. + /// This helps us avoid using a lib compiled with one version together with bindings created + /// using a different version, which might introduce unsafety. + uniffi_version: String, + /// All of the types used in the interface. ++ // We can't checksum `self.types`, but its contents are implied by the other fields ++ // anyway, so it's safe to ignore it. ++ #[checksum_ignore] + pub(super) types: TypeUniverse, + /// The unique prefix that we'll use for namespacing when exposing this component's API. + namespace: String, + /// The internal unique prefix used to namespace FFI symbols ++ #[checksum_ignore] + ffi_namespace: String, + /// The high-level API provided by the component. + enums: Vec, + records: Vec, + functions: Vec, +@@ -105,11 +104,11 @@ + + impl ComponentInterface { + /// Parse a `ComponentInterface` from a string containing a WebIDL definition. + pub fn from_webidl(idl: &str) -> Result { + let mut ci = Self { +- uniffi_version: env!("CARGO_PKG_VERSION").to_string(), ++ uniffi_version: "0.21.0".to_string(), + ..Default::default() + }; + // There's some lifetime thing with the errors returned from weedle::Definitions::parse + // that my own lifetime is too short to worry about figuring out; unwrap and move on. + +@@ -319,20 +318,12 @@ + /// and the same version of Rust, will always have the same checksum value. + /// - Two ComponentInterfaces will, with high probability, have different checksum values if: + /// - They were generated from two different WebIDL files. + /// - They were generated by two different versions of uniffi + /// +- /// The checksum may or may not change depending on the version of Rust used; since we expect +- /// consumers to be using the same executable to generate both the scaffolding and the bindings, +- /// assuming the same version of Rust seems acceptable. +- /// + /// Note that this is designed to prevent accidents, not attacks, so there is no need for the + /// checksum to be cryptographically secure. +- /// +- /// TODO: it's not clear to me if the derivation of `Hash` is actually deterministic enough to +- /// ensure the guarantees above, or if it might be sensitive to e.g. compiler-driven re-ordering +- /// of struct field. Let's see how it goes... + pub fn checksum(&self) -> u16 { + uniffi_meta::checksum(self) + } + + /// The namespace to use in FFI-level function definitions. +@@ -670,27 +661,10 @@ + } + Ok(()) + } + } + +-/// `ComponentInterface` structs can be hashed, but this is mostly a convenient way to +-/// produce a checksum of their contents. They're not really intended to live in a hashtable. +-impl Hash for ComponentInterface { +- fn hash(&self, state: &mut H) { +- // We can't hash `self.types`, but its contents are implied by the other fields +- // anyway, so it's safe to ignore it. +- self.uniffi_version.hash(state); +- self.namespace.hash(state); +- self.enums.hash(state); +- self.records.hash(state); +- self.functions.hash(state); +- self.objects.hash(state); +- self.callback_interfaces.hash(state); +- self.errors.hash(state); +- } +-} +- + fn get_or_insert_object<'a>(objects: &'a mut Vec, name: &str) -> &'a mut Object { + // The find-based way of writing this currently runs into a borrow checker + // error, so we use position + match objects.iter_mut().position(|o| o.name == name) { + Some(idx) => &mut objects[idx], +diff --git a/third_party/rust/uniffi_bindgen/src/interface/object.rs b/third_party/rust/uniffi_bindgen/src/interface/object.rs +--- a/third_party/rust/uniffi_bindgen/src/interface/object.rs ++++ b/third_party/rust/uniffi_bindgen/src/interface/object.rs +@@ -56,14 +56,14 @@ + //! assert_eq!(obj.constructors().len(), 0); + //! # Ok::<(), anyhow::Error>(()) + //! ``` + + use std::convert::TryFrom; +-use std::hash::{Hash, Hasher}; + use std::{collections::HashSet, iter}; + + use anyhow::{bail, Result}; ++use uniffi_meta::Checksum; + + use super::ffi::{FFIArgument, FFIFunction, FFIType}; + use super::function::Argument; + use super::types::{Type, TypeIterator}; + use super::{ +@@ -84,16 +84,24 @@ + /// binding code is expected to stitch these functions back together into an appropriate class + /// definition (or that language's equivalent thereof). + /// + /// TODO: + /// - maybe "Class" would be a better name than "Object" here? +-#[derive(Debug, Clone)] ++#[derive(Debug, Clone, Checksum)] + pub struct Object { + pub(super) name: String, + pub(super) constructors: Vec, + pub(super) methods: Vec, ++ // We don't include the FFIFunc in the hash calculation, because: ++ // - it is entirely determined by the other fields, ++ // so excluding it is safe. ++ // - its `name` property includes a checksum derived from the very ++ // hash value we're trying to calculate here, so excluding it ++ // avoids a weird circular depenendency in the calculation. ++ #[checksum_ignore] + pub(super) ffi_func_free: FFIFunction, ++ #[checksum_ignore] + pub(super) uses_deprecated_threadsafe_attribute: bool, + } + + impl Object { + pub(super) fn new(name: String) -> Object { +@@ -188,24 +196,10 @@ + .flatten(), + ) + } + } + +-impl Hash for Object { +- fn hash(&self, state: &mut H) { +- // We don't include the FFIFunc in the hash calculation, because: +- // - it is entirely determined by the other fields, +- // so excluding it is safe. +- // - its `name` property includes a checksum derived from the very +- // hash value we're trying to calculate here, so excluding it +- // avoids a weird circular depenendency in the calculation. +- self.name.hash(state); +- self.constructors.hash(state); +- self.methods.hash(state); +- } +-} +- + impl APIConverter for weedle::InterfaceDefinition<'_> { + fn convert(&self, ci: &mut ComponentInterface) -> Result { + if self.inheritance.is_some() { + bail!("interface inheritence is not supported"); + } +@@ -243,14 +237,21 @@ + + // Represents a constructor for an object type. + // + // In the FFI, this will be a function that returns a pointer to an instance + // of the corresponding object type. +-#[derive(Debug, Clone)] ++#[derive(Debug, Clone, Checksum)] + pub struct Constructor { + pub(super) name: String, + pub(super) arguments: Vec, ++ // We don't include the FFIFunc in the hash calculation, because: ++ // - it is entirely determined by the other fields, ++ // so excluding it is safe. ++ // - its `name` property includes a checksum derived from the very ++ // hash value we're trying to calculate here, so excluding it ++ // avoids a weird circular depenendency in the calculation. ++ #[checksum_ignore] + pub(super) ffi_func: FFIFunction, + pub(super) attributes: ConstructorAttributes, + } + + impl Constructor { +@@ -297,24 +298,10 @@ + pub fn iter_types(&self) -> TypeIterator<'_> { + Box::new(self.arguments.iter().flat_map(Argument::iter_types)) + } + } + +-impl Hash for Constructor { +- fn hash(&self, state: &mut H) { +- // We don't include the FFIFunc in the hash calculation, because: +- // - it is entirely determined by the other fields, +- // so excluding it is safe. +- // - its `name` property includes a checksum derived from the very +- // hash value we're trying to calculate here, so excluding it +- // avoids a weird circular depenendency in the calculation. +- self.name.hash(state); +- self.arguments.hash(state); +- self.attributes.hash(state); +- } +-} +- + impl Default for Constructor { + fn default() -> Self { + Constructor { + name: String::from("new"), + arguments: Vec::new(), +@@ -341,16 +328,23 @@ + + // Represents an instance method for an object type. + // + // The FFI will represent this as a function whose first/self argument is a + // `FFIType::RustArcPtr` to the instance. +-#[derive(Debug, Clone)] ++#[derive(Debug, Clone, Checksum)] + pub struct Method { + pub(super) name: String, + pub(super) object_name: String, ++ pub(super) arguments: Vec, + pub(super) return_type: Option, +- pub(super) arguments: Vec, ++ // We don't include the FFIFunc in the hash calculation, because: ++ // - it is entirely determined by the other fields, ++ // so excluding it is safe. ++ // - its `name` property includes a checksum derived from the very ++ // hash value we're trying to calculate here, so excluding it ++ // avoids a weird circular depenendency in the calculation. ++ #[checksum_ignore] + pub(super) ffi_func: FFIFunction, + pub(super) attributes: MethodAttributes, + } + + impl Method { +@@ -448,26 +442,10 @@ + attributes: Default::default(), + } + } + } + +-impl Hash for Method { +- fn hash(&self, state: &mut H) { +- // We don't include the FFIFunc in the hash calculation, because: +- // - it is entirely determined by the other fields, +- // so excluding it is safe. +- // - its `name` property includes a checksum derived from the very +- // hash value we're trying to calculate here, so excluding it +- // avoids a weird circular depenendency in the calculation. +- self.name.hash(state); +- self.object_name.hash(state); +- self.arguments.hash(state); +- self.return_type.hash(state); +- self.attributes.hash(state); +- } +-} +- + impl APIConverter for weedle::interface::OperationInterfaceMember<'_> { + fn convert(&self, ci: &mut ComponentInterface) -> Result { + if self.special.is_some() { + bail!("special operations not supported"); + } +diff --git a/third_party/rust/uniffi_bindgen/src/interface/record.rs b/third_party/rust/uniffi_bindgen/src/interface/record.rs +--- a/third_party/rust/uniffi_bindgen/src/interface/record.rs ++++ b/third_party/rust/uniffi_bindgen/src/interface/record.rs +@@ -43,10 +43,11 @@ + //! assert_eq!(record.fields()[1].name(), "value"); + //! # Ok::<(), anyhow::Error>(()) + //! ``` + + use anyhow::{bail, Result}; ++use uniffi_meta::Checksum; + + use super::types::{Type, TypeIterator}; + use super::{ + convert_type, + literal::{convert_default_value, Literal}, +@@ -56,11 +57,11 @@ + /// Represents a "data class" style object, for passing around complex values. + /// + /// In the FFI these are represented as a byte buffer, which one side explicitly + /// serializes the data into and the other serializes it out of. So I guess they're + /// kind of like "pass by clone" values. +-#[derive(Debug, Clone, Hash)] ++#[derive(Debug, Clone, Checksum)] + pub struct Record { + pub(super) name: String, + pub(super) fields: Vec, + } + +@@ -107,11 +108,11 @@ + }) + } + } + + // Represents an individual field on a Record. +-#[derive(Debug, Clone, Hash)] ++#[derive(Debug, Clone, Checksum)] + pub struct Field { + pub(super) name: String, + pub(super) type_: Type, + pub(super) required: bool, + pub(super) default: Option, +diff --git a/third_party/rust/uniffi_bindgen/src/interface/types/mod.rs b/third_party/rust/uniffi_bindgen/src/interface/types/mod.rs +--- a/third_party/rust/uniffi_bindgen/src/interface/types/mod.rs ++++ b/third_party/rust/uniffi_bindgen/src/interface/types/mod.rs +@@ -23,10 +23,11 @@ + + use std::{collections::hash_map::Entry, collections::BTreeSet, collections::HashMap, iter}; + + use anyhow::{bail, Result}; + use heck::ToUpperCamelCase; ++use uniffi_meta::Checksum; + + use super::ffi::FFIType; + + mod finder; + pub(super) use finder::TypeFinder; +@@ -34,11 +35,11 @@ + pub(super) use resolver::{resolve_builtin_type, TypeResolver}; + + /// Represents all the different high-level types that can be used in a component interface. + /// At this level we identify user-defined types by name, without knowing any details + /// of their internal structure apart from what type of thing they are (record, enum, etc). +-#[derive(Debug, Clone, Eq, PartialEq, Hash, Ord, PartialOrd)] ++#[derive(Debug, Clone, Eq, PartialEq, Checksum, Ord, PartialOrd)] + pub enum Type { + // Primitive types. + UInt8, + Int8, + UInt16, +diff --git a/third_party/rust/uniffi_build/.cargo-checksum.json b/third_party/rust/uniffi_build/.cargo-checksum.json +--- a/third_party/rust/uniffi_build/.cargo-checksum.json ++++ b/third_party/rust/uniffi_build/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"bf9105f53978ecdccad9a75fc3645f97982d3c4162a5a9b49ab16554162b51c1","src/lib.rs":"485a0c0ab99077a1d4037f4deec9801e87a248196e7589a002556fb84973528a"},"package":"510287c368a9386eb731ebe824a6fc6c82a105e20d020af1aa20519c1c1561db"} +\ No newline at end of file ++{"files":{"Cargo.toml":"30736876caf953bd0040b6c0fc824744556bf52fe23d656c7d01442d4c180674","src/lib.rs":"485a0c0ab99077a1d4037f4deec9801e87a248196e7589a002556fb84973528a"},"package":"d035e50433ee3d52ab0dcdcf3b9b26f2cc2ec39294b3c07d95865a518709455f"} +\ No newline at end of file +diff --git a/third_party/rust/uniffi_build/Cargo.toml b/third_party/rust/uniffi_build/Cargo.toml +--- a/third_party/rust/uniffi_build/Cargo.toml ++++ b/third_party/rust/uniffi_build/Cargo.toml +@@ -10,31 +10,30 @@ + # See Cargo.toml.orig for the original contents. + + [package] + edition = "2021" + name = "uniffi_build" +-version = "0.21.0" ++version = "0.21.1" + authors = ["Firefox Sync Team "] + description = "a multi-language bindings generator for rust (build script helpers)" + homepage = "https://mozilla.github.io/uniffi-rs" + documentation = "https://mozilla.github.io/uniffi-rs" + keywords = [ + "ffi", + "bindgen", + ] + license = "MPL-2.0" + repository = "https://github.com/mozilla/uniffi-rs" +-resolver = "2" + + [dependencies.anyhow] + version = "1" + + [dependencies.camino] + version = "1.0.8" + + [dependencies.uniffi_bindgen] +-version = "=0.21.0" ++version = "=0.21.1" + optional = true + + [features] + builtin-bindgen = ["uniffi_bindgen"] + default = [] +diff --git a/third_party/rust/uniffi_checksum_derive/.cargo-checksum.json b/third_party/rust/uniffi_checksum_derive/.cargo-checksum.json +new file mode 100644 +--- /dev/null ++++ b/third_party/rust/uniffi_checksum_derive/.cargo-checksum.json +@@ -0,0 +1 @@ ++{"files":{"Cargo.toml":"2ab3c60724c4c504297f8876bf0a8d1291f76a2fc46f5e83634aa147e89ffc71","src/lib.rs":"c68c69a1cf6a69e5fe78f7b069364a265c5bb6ce8c0abf0b5745eca01c79604a"},"package":"78b6e16d46caf942016997af8bbdf4b163bf8ae3deb0b667d9643de7b7ffd4c9"} +\ No newline at end of file +diff --git a/third_party/rust/uniffi_checksum_derive/Cargo.toml b/third_party/rust/uniffi_checksum_derive/Cargo.toml +new file mode 100644 +--- /dev/null ++++ b/third_party/rust/uniffi_checksum_derive/Cargo.toml +@@ -0,0 +1,42 @@ ++# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO ++# ++# When uploading crates to the registry Cargo will automatically ++# "normalize" Cargo.toml files for maximal compatibility ++# with all versions of Cargo and also rewrite `path` dependencies ++# to registry (e.g., crates.io) dependencies. ++# ++# If you are reading this file be aware that the original Cargo.toml ++# will likely look very different (and much more reasonable). ++# See Cargo.toml.orig for the original contents. ++ ++[package] ++edition = "2021" ++name = "uniffi_checksum_derive" ++version = "0.21.1" ++authors = ["Firefox Sync Team "] ++description = "a multi-language bindings generator for rust (checksum custom derive)" ++homepage = "https://mozilla.github.io/uniffi-rs" ++documentation = "https://mozilla.github.io/uniffi-rs" ++keywords = [ ++ "ffi", ++ "bindgen", ++] ++license = "MPL-2.0" ++repository = "https://github.com/mozilla/uniffi-rs" ++ ++[lib] ++proc-macro = true ++ ++[dependencies.quote] ++version = "1.0" ++ ++[dependencies.syn] ++version = "1.0" ++features = [ ++ "derive", ++ "parsing", ++] ++ ++[features] ++default = [] ++nightly = [] +diff --git a/third_party/rust/uniffi_checksum_derive/src/lib.rs b/third_party/rust/uniffi_checksum_derive/src/lib.rs +new file mode 100644 +--- /dev/null ++++ b/third_party/rust/uniffi_checksum_derive/src/lib.rs +@@ -0,0 +1,134 @@ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++#![cfg_attr(feature = "nightly", feature(proc_macro_expand))] ++ ++//! Custom derive for uniffi_meta::Checksum ++ ++use proc_macro::TokenStream; ++use quote::{format_ident, quote}; ++use syn::{parse_macro_input, Attribute, Data, DeriveInput, Expr, ExprLit, Fields, Index, Lit}; ++ ++fn has_ignore_attribute(attrs: &[Attribute]) -> bool { ++ attrs.iter().any(|attr| { ++ if attr.path.is_ident("checksum_ignore") { ++ if !attr.tokens.is_empty() { ++ panic!("#[checksum_ignore] doesn't accept extra information"); ++ } ++ true ++ } else { ++ false ++ } ++ }) ++} ++ ++#[proc_macro_derive(Checksum, attributes(checksum_ignore))] ++pub fn checksum_derive(input: TokenStream) -> TokenStream { ++ let input: DeriveInput = parse_macro_input!(input); ++ ++ let name = input.ident; ++ ++ let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); ++ ++ let code = match input.data { ++ Data::Enum(enum_) ++ if enum_.variants.len() == 1 ++ && enum_ ++ .variants ++ .iter() ++ .all(|variant| matches!(variant.fields, Fields::Unit)) => ++ { ++ quote!() ++ } ++ Data::Enum(enum_) => { ++ let mut next_discriminant = 0u64; ++ let match_inner = enum_.variants.iter().map(|variant| { ++ let ident = &variant.ident; ++ if has_ignore_attribute(&variant.attrs) { ++ panic!("#[checksum_ignore] is not supported in enums"); ++ } ++ match &variant.discriminant { ++ Some((_, Expr::Lit(ExprLit { lit: Lit::Int(value), .. }))) => { ++ next_discriminant = value.base10_parse::().unwrap(); ++ } ++ Some(_) => { ++ panic!("#[derive(Checksum)] doesn't support non-numeric explicit discriminants in enums"); ++ } ++ None => {} ++ } ++ let discriminant = quote! { state.write(&#next_discriminant.to_le_bytes()) }; ++ next_discriminant += 1; ++ match &variant.fields { ++ Fields::Unnamed(fields) => { ++ let field_idents = fields ++ .unnamed ++ .iter() ++ .enumerate() ++ .map(|(num, _)| format_ident!("__self_{}", num)); ++ let field_stmts = field_idents ++ .clone() ++ .map(|ident| quote! { Checksum::checksum(#ident, state); }); ++ quote! { ++ Self::#ident(#(#field_idents,)*) => { ++ #discriminant; ++ #(#field_stmts)* ++ } ++ } ++ } ++ Fields::Named(fields) => { ++ let field_idents = fields ++ .named ++ .iter() ++ .map(|field| field.ident.as_ref().unwrap()); ++ let field_stmts = field_idents ++ .clone() ++ .map(|ident| quote! { Checksum::checksum(#ident, state); }); ++ quote! { ++ Self::#ident { #(#field_idents,)* } => { ++ #discriminant; ++ #(#field_stmts)* ++ } ++ } ++ } ++ Fields::Unit => quote! { Self::#ident => #discriminant, }, ++ } ++ }); ++ quote! { ++ match self { ++ #(#match_inner)* ++ } ++ } ++ } ++ Data::Struct(struct_) => { ++ let stmts = struct_ ++ .fields ++ .iter() ++ .enumerate() ++ .filter_map(|(num, field)| { ++ (!has_ignore_attribute(&field.attrs)).then(|| match field.ident.as_ref() { ++ Some(ident) => quote! { Checksum::checksum(&self.#ident, state); }, ++ None => { ++ let i = Index::from(num); ++ quote! { Checksum::checksum(&self.#i, state); } ++ } ++ }) ++ }); ++ quote! { ++ #(#stmts)* ++ } ++ } ++ Data::Union(_) => { ++ panic!("#[derive(Checksum)] is not supported for unions"); ++ } ++ }; ++ ++ quote! { ++ #[automatically_derived] ++ impl #impl_generics Checksum for #name #ty_generics #where_clause { ++ fn checksum<__H: ::core::hash::Hasher>(&self, state: &mut __H) { ++ #code ++ } ++ } ++ } ++ .into() ++} +diff --git a/third_party/rust/uniffi_macros/.cargo-checksum.json b/third_party/rust/uniffi_macros/.cargo-checksum.json +--- a/third_party/rust/uniffi_macros/.cargo-checksum.json ++++ b/third_party/rust/uniffi_macros/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"55f7e114dd34b0c60b58890120f8707601a5401e9d49d42a239b03da2e660d4f","src/export.rs":"e23929cf6fb5542d29514fe668f3b3d836fad968eacd9c6fcba74c5cd9cf2b61","src/export/metadata.rs":"af89a9942c7c0c4043a3cd57d1e6bd71cde19005e1f9f246efac761f47eff6be","src/export/metadata/convert.rs":"81060fb3390165d77db021f44142a2f3f10882515f859d7393857083370f2d35","src/export/metadata/function.rs":"11833cabd37e7671c0a01944bec73b8892a15df814bbe4c26fdae57aad89a2ba","src/export/metadata/impl_.rs":"ecfdaa132f05dd946414281e52165ef19c90c0bfd76ec651d4ec86837bd41d1c","src/export/scaffolding.rs":"66939405063e56fc983126f249e2d7ddc3257cb045a738abd0cf813a4aafc59c","src/lib.rs":"ca77b437a58cfb3ddeb106d3c1c8378545c46ef241298e62ab1190c5136d1fb1","src/object.rs":"955b596f344304013692042bdc1760bbb1192ec33950b0dd2932cb8de94ec297","src/record.rs":"67a5c7ed6a448f7ad8f5c8e930c5e3007b2b0cac32f52cc8596bdae6fb3c816e","src/util.rs":"6389a9b4258808a3af168cf85658fb7c069172d5e528ee0e94210fa664f2a414"},"package":"5c8604503caa2cbcf271578dc51ca236d40e3b22e1514ffa2e638e2c39f6ad10"} +\ No newline at end of file ++{"files":{"Cargo.toml":"6511b493b676ac3941d70477c91abec62642c3c9aab088ecdf4f733eef3f1faa","src/export.rs":"e23929cf6fb5542d29514fe668f3b3d836fad968eacd9c6fcba74c5cd9cf2b61","src/export/metadata.rs":"af89a9942c7c0c4043a3cd57d1e6bd71cde19005e1f9f246efac761f47eff6be","src/export/metadata/convert.rs":"81060fb3390165d77db021f44142a2f3f10882515f859d7393857083370f2d35","src/export/metadata/function.rs":"11833cabd37e7671c0a01944bec73b8892a15df814bbe4c26fdae57aad89a2ba","src/export/metadata/impl_.rs":"ecfdaa132f05dd946414281e52165ef19c90c0bfd76ec651d4ec86837bd41d1c","src/export/scaffolding.rs":"66939405063e56fc983126f249e2d7ddc3257cb045a738abd0cf813a4aafc59c","src/lib.rs":"ca77b437a58cfb3ddeb106d3c1c8378545c46ef241298e62ab1190c5136d1fb1","src/object.rs":"955b596f344304013692042bdc1760bbb1192ec33950b0dd2932cb8de94ec297","src/record.rs":"67a5c7ed6a448f7ad8f5c8e930c5e3007b2b0cac32f52cc8596bdae6fb3c816e","src/util.rs":"6389a9b4258808a3af168cf85658fb7c069172d5e528ee0e94210fa664f2a414"},"package":"c96a574677566f83ea8458dac1dd7792fd63e7c3f9dbcd865f0e8d6f8057b127"} +\ No newline at end of file +diff --git a/third_party/rust/uniffi_macros/Cargo.toml b/third_party/rust/uniffi_macros/Cargo.toml +--- a/third_party/rust/uniffi_macros/Cargo.toml ++++ b/third_party/rust/uniffi_macros/Cargo.toml +@@ -10,22 +10,21 @@ + # See Cargo.toml.orig for the original contents. + + [package] + edition = "2021" + name = "uniffi_macros" +-version = "0.21.0" ++version = "0.21.1" + authors = ["Firefox Sync Team "] + description = "a multi-language bindings generator for rust (convenience macros)" + homepage = "https://mozilla.github.io/uniffi-rs" + documentation = "https://mozilla.github.io/uniffi-rs" + keywords = [ + "ffi", + "bindgen", + ] + license = "MPL-2.0" + repository = "https://github.com/mozilla/uniffi-rs" +-resolver = "2" + + [lib] + proc-macro = true + + [dependencies.bincode] +@@ -58,14 +57,14 @@ + + [dependencies.toml] + version = "0.5.9" + + [dependencies.uniffi_build] +-version = "=0.21.0" ++version = "=0.21.1" + + [dependencies.uniffi_meta] +-version = "=0.21.0" ++version = "=0.21.1" + + [features] + builtin-bindgen = ["uniffi_build/builtin-bindgen"] + default = [] + nightly = [] +diff --git a/third_party/rust/uniffi_meta/.cargo-checksum.json b/third_party/rust/uniffi_meta/.cargo-checksum.json +--- a/third_party/rust/uniffi_meta/.cargo-checksum.json ++++ b/third_party/rust/uniffi_meta/.cargo-checksum.json +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"4a474782b3acac7e99435c0cfc6cd4790817ee5c15980b10dc927d95795b977f","src/lib.rs":"dc4c91763c01e8c09ef55cdb103bc02c7aba71c5660ba88f776a8a03a747d6e8"},"package":"cd9417cc653937681436b93838d8c5f97a5b8c58697813982ee8810bd1dc3b57"} +\ No newline at end of file ++{"files":{"Cargo.toml":"4c34032ec5fadf8b996c671425d5afa38e0e5c223ab0b2ed3b44099fb78157d3","src/lib.rs":"a9854421f120e1c4a9d7d36bb006a4c5e7d2e054564f95aa9b6956e7ebb348fd"},"package":"729835442da829c9b6f7c111c76cf87b2498e129101203bec94f0c39a3296a38"} +\ No newline at end of file +diff --git a/third_party/rust/uniffi_meta/Cargo.toml b/third_party/rust/uniffi_meta/Cargo.toml +--- a/third_party/rust/uniffi_meta/Cargo.toml ++++ b/third_party/rust/uniffi_meta/Cargo.toml +@@ -10,19 +10,24 @@ + # See Cargo.toml.orig for the original contents. + + [package] + edition = "2021" + name = "uniffi_meta" +-version = "0.21.0" ++version = "0.21.1" + description = "uniffi_meta" + homepage = "https://mozilla.github.io/uniffi-rs" + keywords = [ + "ffi", + "bindgen", + ] + license = "MPL-2.0" + repository = "https://github.com/mozilla/uniffi-rs" +-resolver = "2" + + [dependencies.serde] + version = "1.0.136" + features = ["derive"] ++ ++[dependencies.siphasher] ++version = "0.3" ++ ++[dependencies.uniffi_checksum_derive] ++version = "0.21.0" +diff --git a/third_party/rust/uniffi_meta/src/lib.rs b/third_party/rust/uniffi_meta/src/lib.rs +--- a/third_party/rust/uniffi_meta/src/lib.rs ++++ b/third_party/rust/uniffi_meta/src/lib.rs +@@ -1,17 +1,87 @@ + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +-use std::{ +- collections::hash_map::DefaultHasher, +- hash::{Hash, Hasher}, +-}; ++use std::hash::Hasher; ++pub use uniffi_checksum_derive::Checksum; + + use serde::{Deserialize, Serialize}; + +-#[derive(Clone, Debug, Hash, Deserialize, Serialize)] ++/// Similar to std::hash::Hash. ++/// ++/// Implementations of this trait are expected to update the hasher state in ++/// the same way across platforms. #[derive(Checksum)] will do the right thing. ++pub trait Checksum { ++ fn checksum(&self, state: &mut H); ++} ++ ++impl Checksum for bool { ++ fn checksum(&self, state: &mut H) { ++ state.write_u8(*self as u8); ++ } ++} ++ ++impl Checksum for u64 { ++ fn checksum(&self, state: &mut H) { ++ state.write(&self.to_le_bytes()); ++ } ++} ++ ++impl Checksum for i64 { ++ fn checksum(&self, state: &mut H) { ++ state.write(&self.to_le_bytes()); ++ } ++} ++ ++impl Checksum for Box { ++ fn checksum(&self, state: &mut H) { ++ (**self).checksum(state) ++ } ++} ++ ++impl Checksum for [T] { ++ fn checksum(&self, state: &mut H) { ++ state.write(&(self.len() as u64).to_le_bytes()); ++ for item in self { ++ Checksum::checksum(item, state); ++ } ++ } ++} ++ ++impl Checksum for Vec { ++ fn checksum(&self, state: &mut H) { ++ Checksum::checksum(&**self, state); ++ } ++} ++ ++impl Checksum for Option { ++ fn checksum(&self, state: &mut H) { ++ match self { ++ None => state.write(&0u64.to_le_bytes()), ++ Some(value) => { ++ state.write(&1u64.to_le_bytes()); ++ Checksum::checksum(value, state) ++ } ++ } ++ } ++} ++ ++impl Checksum for str { ++ fn checksum(&self, state: &mut H) { ++ state.write(self.as_bytes()); ++ state.write_u8(0xff); ++ } ++} ++ ++impl Checksum for String { ++ fn checksum(&self, state: &mut H) { ++ (**self).checksum(state) ++ } ++} ++ ++#[derive(Clone, Debug, Checksum, Deserialize, Serialize)] + pub struct FnMetadata { + pub module_path: Vec, + pub name: String, + pub inputs: Vec, + pub return_type: Option, +@@ -21,11 +91,11 @@ + pub fn ffi_symbol_name(&self) -> String { + fn_ffi_symbol_name(&self.module_path, &self.name, checksum(self)) + } + } + +-#[derive(Clone, Debug, Hash, Deserialize, Serialize)] ++#[derive(Clone, Debug, Checksum, Deserialize, Serialize)] + pub struct MethodMetadata { + pub module_path: Vec, + pub self_name: String, + pub name: String, + pub inputs: Vec, +@@ -37,18 +107,18 @@ + let full_name = format!("impl_{}_{}", self.self_name, self.name); + fn_ffi_symbol_name(&self.module_path, &full_name, checksum(self)) + } + } + +-#[derive(Clone, Debug, Hash, Deserialize, Serialize)] ++#[derive(Clone, Debug, Checksum, Deserialize, Serialize)] + pub struct FnParamMetadata { + pub name: String, + #[serde(rename = "type")] + pub ty: Type, + } + +-#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)] ++#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Checksum, Deserialize, Serialize)] + pub enum Type { + U8, + U16, + U32, + U64, +@@ -76,25 +146,25 @@ + Unresolved { + name: String, + }, + } + +-#[derive(Clone, Debug, Hash, Deserialize, Serialize)] ++#[derive(Clone, Debug, Checksum, Deserialize, Serialize)] + pub struct RecordMetadata { + pub module_path: Vec, + pub name: String, + pub fields: Vec, + } + +-#[derive(Clone, Debug, Hash, Deserialize, Serialize)] ++#[derive(Clone, Debug, Checksum, Deserialize, Serialize)] + pub struct FieldMetadata { + pub name: String, + #[serde(rename = "type")] + pub ty: Type, + } + +-#[derive(Clone, Debug, Hash, Deserialize, Serialize)] ++#[derive(Clone, Debug, Checksum, Deserialize, Serialize)] + pub struct ObjectMetadata { + pub module_path: Vec, + pub name: String, + } + +@@ -106,27 +176,27 @@ + let free_name = format!("object_free_{}", self.name); + fn_ffi_symbol_name(&self.module_path, &free_name, checksum(self)) + } + } + +-/// Returns the last 16 bits of the value's hash as computed with [`DefaultHasher`]. ++/// Returns the last 16 bits of the value's hash as computed with [`SipHasher13`]. + /// + /// To be used as a checksum of FFI symbols, as a safeguard against different UniFFI versions being + /// used for scaffolding and bindings generation. +-pub fn checksum(val: &T) -> u16 { +- let mut hasher = DefaultHasher::new(); +- val.hash(&mut hasher); ++pub fn checksum(val: &T) -> u16 { ++ let mut hasher = siphasher::sip::SipHasher13::new(); ++ val.checksum(&mut hasher); + (hasher.finish() & 0x000000000000FFFF) as u16 + } + + pub fn fn_ffi_symbol_name(mod_path: &[String], name: &str, checksum: u16) -> String { + let mod_path = mod_path.join("__"); + format!("_uniffi_{mod_path}_{name}_{checksum:x}") + } + + /// Enum covering all the possible metadata types +-#[derive(Clone, Debug, Hash, Deserialize, Serialize)] ++#[derive(Clone, Debug, Checksum, Deserialize, Serialize)] + pub enum Metadata { + Func(FnMetadata), + Method(MethodMetadata), + Record(RecordMetadata), + Object(ObjectMetadata), + diff --git a/firefox.spec b/firefox.spec index aa1d967..c3d5f02 100644 --- a/firefox.spec +++ b/firefox.spec @@ -6,11 +6,6 @@ # https://bugzilla.redhat.com/show_bug.cgi?id=2129720 ExcludeArch: i686 -# Disabled due to build failures: -# https://bugzilla.redhat.com/show_bug.cgi?id=2153213 -ExcludeArch: s390x -ExcludeArch: armv7hl - # Run Mozilla test suite as a part of compile rpm section. Turn off when # building locally and don't want to spend 24 hours waiting for results. %global run_firefox_tests 0 @@ -178,7 +173,7 @@ ExcludeArch: armv7hl Summary: Mozilla Firefox Web browser Name: firefox Version: 108.0.1 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -258,6 +253,7 @@ Patch415: mozilla-1670333.patch Patch416: D163696.diff Patch417: D163697.diff Patch418: D163698.diff +Patch419: D164896.diff # PGO/LTO patches Patch600: pgo.patch @@ -536,6 +532,7 @@ This package contains results of tests executed during build. %patch416 -p1 -b .D163696 %patch417 -p1 -b .D163697 %patch418 -p1 -b .D163698 +%patch419 -p1 -b .D164896 # PGO patches %if %{build_with_pgo} @@ -1138,6 +1135,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Wed Dec 21 2022 Martin Stransky - 108.0.1-3 +- Added second arch build fix + * Wed Dec 21 2022 Martin Stransky - 108.0.1-2 - Added mozbz#1795851 [wayland] Crash buffer size (170x113) is not divisible by scale (2) From 8c2f692734313638a3a18386377656fb9530a35e Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Mon, 9 Jan 2023 15:39:25 +0100 Subject: [PATCH 158/545] Drop conditionals for F35 Fedora 35 is now EOL. --- firefox.spec | 40 ++++------------------------------------ 1 file changed, 4 insertions(+), 36 deletions(-) diff --git a/firefox.spec b/firefox.spec index c3d5f02..efa282f 100644 --- a/firefox.spec +++ b/firefox.spec @@ -173,7 +173,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 108.0.1 -Release: 3%{?pre_tag}%{?dist} +Release: 4%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -754,33 +754,9 @@ echo "ac_add_options MOZ_PGO=1" >> .mozconfig export CCACHE_DISABLE=1 %endif -%if 0%{?fedora} > 35 # Require 2 GB of RAM per CPU core %constrain_build -m 2048 echo "mk_add_options MOZ_MAKE_FLAGS=\"-j%{_smp_build_ncpus}\"" >> .mozconfig -%else -# F35 doesn't have %%constrain_build -MOZ_SMP_FLAGS=-j1 -# On x86_64 architectures, Mozilla can build up to 4 jobs at once in parallel, -# however builds tend to fail on other arches when building in parallel. -%ifarch %{ix86} s390x %{arm} aarch64 -[ -z "$RPM_BUILD_NCPUS" ] && \ - RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`" -[ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2 -%endif -%ifarch x86_64 ppc ppc64 ppc64le -[ -z "$RPM_BUILD_NCPUS" ] && \ - RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`" -[ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2 -[ "$RPM_BUILD_NCPUS" -ge 4 ] && MOZ_SMP_FLAGS=-j4 -[ "$RPM_BUILD_NCPUS" -ge 8 ] && MOZ_SMP_FLAGS=-j8 -[ "$RPM_BUILD_NCPUS" -ge 16 ] && MOZ_SMP_FLAGS=-j16 -[ "$RPM_BUILD_NCPUS" -ge 24 ] && MOZ_SMP_FLAGS=-j24 -[ "$RPM_BUILD_NCPUS" -ge 32 ] && MOZ_SMP_FLAGS=-j32 -[ "$RPM_BUILD_NCPUS" -ge 64 ] && MOZ_SMP_FLAGS=-j64 -%endif -echo "mk_add_options MOZ_MAKE_FLAGS=\"$MOZ_SMP_FLAGS\"" >> .mozconfig -%endif echo "mk_add_options MOZ_SERVICES_SYNC=1" >> .mozconfig echo "export STRIP=/bin/true" >> .mozconfig @@ -947,11 +923,7 @@ create_default_langpack "zh-TW" "zh" # Use the system hunspell dictionaries %{__rm} -rf %{buildroot}%{mozappdir}/dictionaries -%if 0%{?fedora} > 35 ln -s %{_datadir}/hunspell %{buildroot}%{mozappdir}/dictionaries -%else -ln -s %{_datadir}/myspell %{buildroot}%{mozappdir}/dictionaries -%endif # Enable crash reporter for Firefox application %if %{enable_mozilla_crashreporter} @@ -975,13 +947,6 @@ sed -i -e "s/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/" %{buildroot}/%{moz echo 'pref("widget.use-xdg-desktop-portal.file-picker", 1);' >> %{buildroot}%{mozappdir}/browser/defaults/preferences/firefox-redhat-default-prefs.js %endif -# Since Fedora 36 the location of dictionaries has changed to /usr/share/hunspell. -# For backward spec compatibility we set the old path in previous versions. -# TODO remove when Fedora 35 becomes obsolete -%if 0%{?fedora} <= 35 -sed -i -e 's|/usr/share/hunspell|/usr/share/myspell|g' %{buildroot}%{mozappdir}/browser/defaults/preferences/firefox-redhat-default-prefs.js -%endif - # Copy over run-mozilla.sh %{__cp} build/unix/run-mozilla.sh %{buildroot}%{mozappdir} @@ -1135,6 +1100,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Mon Jan 09 2023 Kalev Lember - 108.0.1-4 +- Drop conditionals for F35 + * Wed Dec 21 2022 Martin Stransky - 108.0.1-3 - Added second arch build fix From 4f8d37fe68e2b67f7a3e19fa4f4de4f6a8568773 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Mon, 9 Jan 2023 23:41:16 +0100 Subject: [PATCH 159/545] Avoid using rpm macros for simple shell commands Using e.g. %{__cp} instead of cp makes everything just harder to read without any clear benefits. --- firefox.spec | 124 +++++++++++++++++++++++++-------------------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/firefox.spec b/firefox.spec index efa282f..22a5e94 100644 --- a/firefox.spec +++ b/firefox.spec @@ -550,15 +550,15 @@ This package contains results of tests executed during build. %patch1100 -p1 -b .ppc-mobzuild -%{__rm} -f .mozconfig -%{__cp} %{SOURCE10} .mozconfig +rm -f .mozconfig +cp %{SOURCE10} .mozconfig echo "ac_add_options --enable-default-toolkit=cairo-gtk3-wayland" >> .mozconfig %if %{official_branding} echo "ac_add_options --enable-official-branding" >> .mozconfig %endif -%{__cp} %{SOURCE24} mozilla-api-key -%{__cp} %{SOURCE27} google-api-key -%{__cp} %{SOURCE35} google-loc-api-key +cp %{SOURCE24} mozilla-api-key +cp %{SOURCE27} google-api-key +cp %{SOURCE35} google-loc-api-key echo "ac_add_options --prefix=\"%{_prefix}\"" >> .mozconfig echo "ac_add_options --libdir=\"%{_libdir}\"" >> .mozconfig @@ -658,7 +658,7 @@ chmod a-x third_party/rust/ash/src/extensions/nv/*.rs %if 0%{?use_bundled_cbindgen} mkdir -p my_rust_vendor cd my_rust_vendor -%{__tar} xf %{SOURCE2} +tar xf %{SOURCE2} mkdir -p .cargo cat > .cargo/config < objdir/_virtualenvs/init_py3/pip.conf << EOF +cat > objdir/_virtualenvs/init_py3/pip.conf << EOF [global] find-links=`pwd`/mochitest-python no-index=true @@ -808,26 +808,26 @@ mkdir -p test_results # set up our default bookmarks %if !0%{?flatpak} -%{__cp} -p %{default_bookmarks_file} objdir/dist/bin/browser/chrome/browser/content/browser/default-bookmarks.html +cp -p %{default_bookmarks_file} objdir/dist/bin/browser/chrome/browser/content/browser/default-bookmarks.html %endif # Make sure locale works for langpacks -%{__cat} > objdir/dist/bin/browser/defaults/preferences/firefox-l10n.js << EOF +cat > objdir/dist/bin/browser/defaults/preferences/firefox-l10n.js << EOF pref("general.useragent.locale", "chrome://global/locale/intl.properties"); EOF DESTDIR=%{buildroot} make -C objdir install -%{__mkdir_p} %{buildroot}{%{_libdir},%{_bindir},%{_datadir}/applications} +mkdir -p %{buildroot}{%{_libdir},%{_bindir},%{_datadir}/applications} desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE20} desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE31} desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE29} # set up the firefox start script -%{__rm} -rf %{buildroot}%{_bindir}/firefox -%{__sed} -e 's,/__PREFIX__,%{_prefix},g' %{SOURCE21} > %{buildroot}%{_bindir}/firefox -%{__chmod} 755 %{buildroot}%{_bindir}/firefox +rm -rf %{buildroot}%{_bindir}/firefox +sed -e 's,/__PREFIX__,%{_prefix},g' %{SOURCE21} > %{buildroot}%{_bindir}/firefox +chmod 755 %{buildroot}%{_bindir}/firefox %if 0%{?flatpak} sed -i -e 's|%FLATPAK_ENV_VARS%|export TMPDIR="$XDG_CACHE_HOME/tmp"|' %{buildroot}%{_bindir}/firefox @@ -835,36 +835,36 @@ sed -i -e 's|%FLATPAK_ENV_VARS%|export TMPDIR="$XDG_CACHE_HOME/tmp"|' %{buildroo sed -i -e 's|%FLATPAK_ENV_VARS%||' %{buildroot}%{_bindir}/firefox %endif -%{__sed} -e 's,/__PREFIX__,%{_prefix},g' %{SOURCE30} > %{buildroot}%{_bindir}/firefox-x11 -%{__chmod} 755 %{buildroot}%{_bindir}/firefox-x11 -%{__sed} -e 's,/__PREFIX__,%{_prefix},g' %{SOURCE28} > %{buildroot}%{_bindir}/firefox-wayland -%{__chmod} 755 %{buildroot}%{_bindir}/firefox-wayland +sed -e 's,/__PREFIX__,%{_prefix},g' %{SOURCE30} > %{buildroot}%{_bindir}/firefox-x11 +chmod 755 %{buildroot}%{_bindir}/firefox-x11 +sed -e 's,/__PREFIX__,%{_prefix},g' %{SOURCE28} > %{buildroot}%{_bindir}/firefox-wayland +chmod 755 %{buildroot}%{_bindir}/firefox-wayland -%{__install} -p -D -m 644 %{SOURCE23} %{buildroot}%{_mandir}/man1/firefox.1 +install -p -D -m 644 %{SOURCE23} %{buildroot}%{_mandir}/man1/firefox.1 -%{__rm} -f %{buildroot}/%{mozappdir}/firefox-config -%{__rm} -f %{buildroot}/%{mozappdir}/update-settings.ini +rm -f %{buildroot}/%{mozappdir}/firefox-config +rm -f %{buildroot}/%{mozappdir}/update-settings.ini for s in 16 22 24 32 48 256; do - %{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps - %{__cp} -p browser/branding/official/default${s}.png \ - %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps/firefox.png + mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps + cp -p browser/branding/official/default${s}.png \ + %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps/firefox.png done # Install hight contrast icon -%{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps -%{__cp} -p %{SOURCE25} \ - %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps +mkdir -p %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps +cp -p %{SOURCE25} \ + %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps echo > %{name}.lang %if %{with langpacks} # Extract langpacks, make any mods needed, repack the langpack, and install it. -%{__mkdir_p} %{buildroot}%{langpackdir} -%{__tar} xf %{SOURCE1} +mkdir -p %{buildroot}%{langpackdir} +tar xf %{SOURCE1} for langpack in `ls firefox-langpacks/*.xpi`; do language=`basename $langpack .xpi` extensionID=langpack-$language@firefox.mozilla.org - %{__mkdir_p} $extensionID + mkdir -p $extensionID unzip -qq $langpack -d $extensionID find $extensionID -type f | xargs chmod 644 @@ -872,7 +872,7 @@ for langpack in `ls firefox-langpacks/*.xpi`; do zip -qq -r9mX ../${extensionID}.xpi * cd - - %{__install} -m 644 ${extensionID}.xpi %{buildroot}%{langpackdir} + install -m 644 ${extensionID}.xpi %{buildroot}%{langpackdir} language=`echo $language | sed -e 's/-/_/g'` %if 0%{?flatpak} echo "%{langpackdir}/${extensionID}.xpi" >> %{name}.lang @@ -880,7 +880,7 @@ for langpack in `ls firefox-langpacks/*.xpi`; do echo "%%lang($language) %{langpackdir}/${extensionID}.xpi" >> %{name}.lang %endif done -%{__rm} -rf firefox-langpacks +rm -rf firefox-langpacks # Install langpack workaround (see #707100, #821169) function create_default_langpack() { @@ -909,20 +909,20 @@ create_default_langpack "sv-SE" "sv" create_default_langpack "zh-TW" "zh" %endif -%{__mkdir_p} %{buildroot}/%{mozappdir}/browser/defaults/preferences +mkdir -p %{buildroot}/%{mozappdir}/browser/defaults/preferences # System config dir -%{__mkdir_p} %{buildroot}/%{_sysconfdir}/%{name}/pref +mkdir -p %{buildroot}/%{_sysconfdir}/%{name}/pref # System extensions -%{__mkdir_p} %{buildroot}%{_datadir}/mozilla/extensions/%{firefox_app_id} -%{__mkdir_p} %{buildroot}%{_libdir}/mozilla/extensions/%{firefox_app_id} +mkdir -p %{buildroot}%{_datadir}/mozilla/extensions/%{firefox_app_id} +mkdir -p %{buildroot}%{_libdir}/mozilla/extensions/%{firefox_app_id} # Copy over the LICENSE -%{__install} -p -c -m 644 LICENSE %{buildroot}/%{mozappdir} +install -p -c -m 644 LICENSE %{buildroot}/%{mozappdir} # Use the system hunspell dictionaries -%{__rm} -rf %{buildroot}%{mozappdir}/dictionaries +rm -rf %{buildroot}%{mozappdir}/dictionaries ln -s %{_datadir}/hunspell %{buildroot}%{mozappdir}/dictionaries # Enable crash reporter for Firefox application @@ -930,39 +930,39 @@ ln -s %{_datadir}/hunspell %{buildroot}%{mozappdir}/dictionaries ./mach buildsymbols sed -i -e "s/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/" %{buildroot}/%{mozappdir}/application.ini # Add debuginfo for crash-stats.mozilla.com -%{__mkdir_p} %{buildroot}/%{moz_debug_dir} -%{__cp} objdir/dist/%{symbols_file_name} %{buildroot}/%{moz_debug_dir} +mkdir -p %{buildroot}/%{moz_debug_dir} +cp objdir/dist/%{symbols_file_name} %{buildroot}/%{moz_debug_dir} %endif %if 0%{?run_firefox_tests} -%{__mkdir_p} %{buildroot}/%{version}-%{release}/test_results -%{__cp} test_results/* %{buildroot}/%{version}-%{release}/test_results -%{__cp} test_summary.txt %{buildroot}/%{version}-%{release}/ -%{__cp} failures-* %{buildroot}/%{version}-%{release}/ || true +mkdir -p %{buildroot}/%{version}-%{release}/test_results +cp test_results/* %{buildroot}/%{version}-%{release}/test_results +cp test_summary.txt %{buildroot}/%{version}-%{release}/ +cp failures-* %{buildroot}/%{version}-%{release}/ || true %endif # Default -%{__cp} %{SOURCE12} %{buildroot}%{mozappdir}/browser/defaults/preferences +cp %{SOURCE12} %{buildroot}%{mozappdir}/browser/defaults/preferences %if %{?use_xdg_file_portal} echo 'pref("widget.use-xdg-desktop-portal.file-picker", 1);' >> %{buildroot}%{mozappdir}/browser/defaults/preferences/firefox-redhat-default-prefs.js %endif # Copy over run-mozilla.sh -%{__cp} build/unix/run-mozilla.sh %{buildroot}%{mozappdir} +cp build/unix/run-mozilla.sh %{buildroot}%{mozappdir} # Add distribution.ini -%{__mkdir_p} %{buildroot}%{mozappdir}/distribution -%{__cp} %{SOURCE26} %{buildroot}%{mozappdir}/distribution +mkdir -p %{buildroot}%{mozappdir}/distribution +cp %{SOURCE26} %{buildroot}%{mozappdir}/distribution # Install appdata file mkdir -p %{buildroot}%{_datadir}/metainfo -%{__sed} -e "s/__VERSION__/%{version}/" \ - -e "s/__DATE__/$(date '+%F')/" \ - %{SOURCE33} > %{buildroot}%{_datadir}/metainfo/firefox.appdata.xml +sed -e "s/__VERSION__/%{version}/" \ + -e "s/__DATE__/$(date '+%F')/" \ + %{SOURCE33} > %{buildroot}%{_datadir}/metainfo/firefox.appdata.xml # Install Gnome search provider files mkdir -p %{buildroot}%{_datadir}/gnome-shell/search-providers -%{__cp} %{SOURCE34} %{buildroot}%{_datadir}/gnome-shell/search-providers +cp %{SOURCE34} %{buildroot}%{_datadir}/gnome-shell/search-providers # Remove gtk2 support as flash plugin is no longer supported rm -rf %{buildroot}%{mozappdir}/gtk2/ @@ -1009,10 +1009,10 @@ appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/*.appdata %preun # is it a final removal? if [ $1 -eq 0 ]; then - %{__rm} -rf %{mozappdir}/components - %{__rm} -rf %{mozappdir}/extensions - %{__rm} -rf %{mozappdir}/plugins - %{__rm} -rf %{langpackdir} + rm -rf %{mozappdir}/components + rm -rf %{mozappdir}/extensions + rm -rf %{mozappdir}/plugins + rm -rf %{langpackdir} fi %post From 8bed0f2480ab6d0dc3c697dfd7ade7f8d008226e Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Mon, 9 Jan 2023 23:54:02 +0100 Subject: [PATCH 160/545] Drop rpm scriptlets for things that are handled by rpm file triggers update-desktop-database and gtk-update-icon-cache are both handled by file triggers in desktop-file-utils and hicolor-icon-theme packages these days and there is no need to invoke them manually in individual packages any more. --- firefox.spec | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/firefox.spec b/firefox.spec index 22a5e94..af584c6 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1015,20 +1015,6 @@ if [ $1 -eq 0 ]; then rm -rf %{langpackdir} fi -%post -update-desktop-database &> /dev/null || : -touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : - -%postun -update-desktop-database &> /dev/null || : -if [ $1 -eq 0 ] ; then - touch --no-create %{_datadir}/icons/hicolor &>/dev/null - gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : -fi - -%posttrans -gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : - %if %{with langpacks_subpkg} %files %else From 802ee5c394c59db62fdf8f17c80bc87a5f99a6c2 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Fri, 13 Jan 2023 09:26:17 +0100 Subject: [PATCH 161/545] Update to 108.0.2 --- .gitignore | 2 + D164896.diff | 1842 -------------------------------------------------- firefox.spec | 11 +- sources | 4 +- 4 files changed, 10 insertions(+), 1849 deletions(-) delete mode 100644 D164896.diff diff --git a/.gitignore b/.gitignore index 4d02086..3ee35a9 100644 --- a/.gitignore +++ b/.gitignore @@ -551,3 +551,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-108.0-20221214.tar.xz /firefox-108.0.1.source.tar.xz /firefox-langpacks-108.0.1-20221218.tar.xz +/firefox-108.0.2.source.tar.xz +/firefox-langpacks-108.0.2-20230112.tar.xz diff --git a/D164896.diff b/D164896.diff deleted file mode 100644 index 3212ea5..0000000 --- a/D164896.diff +++ /dev/null @@ -1,1842 +0,0 @@ -diff --git a/Cargo.lock b/Cargo.lock ---- a/Cargo.lock -+++ b/Cargo.lock -@@ -5775,13 +5775,13 @@ - source = "registry+https://github.com/rust-lang/crates.io-index" - checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" - - [[package]] - name = "uniffi" --version = "0.21.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "f54af5ada67d1173457a99a7bb44a7917f63e7466764cb4714865c7a6678b830" -+version = "0.21.1" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "b983553c0d1ad73547c65fa0c399aa800bee4a70ad330198e1c7a523212da5ee" - dependencies = [ - "anyhow", - "bytes 1.2.1", - "camino", - "cargo_metadata", -@@ -5885,13 +5885,11 @@ - "uniffi_macros", - ] - - [[package]] - name = "uniffi_bindgen" --version = "0.21.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "12cc4af3c0180c7e86c4a3acf2b6587af04ba2567b1e948993df10f421796621" -+version = "0.21.1" - dependencies = [ - "anyhow", - "askama", - "bincode", - "camino", -@@ -5908,24 +5906,34 @@ - "weedle2", - ] - - [[package]] - name = "uniffi_build" --version = "0.21.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "510287c368a9386eb731ebe824a6fc6c82a105e20d020af1aa20519c1c1561db" -+version = "0.21.1" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "d035e50433ee3d52ab0dcdcf3b9b26f2cc2ec39294b3c07d95865a518709455f" - dependencies = [ - "anyhow", - "camino", - "uniffi_bindgen", - ] - - [[package]] -+name = "uniffi_checksum_derive" -+version = "0.21.1" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "78b6e16d46caf942016997af8bbdf4b163bf8ae3deb0b667d9643de7b7ffd4c9" -+dependencies = [ -+ "quote", -+ "syn", -+] -+ -+[[package]] - name = "uniffi_macros" --version = "0.21.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "5c8604503caa2cbcf271578dc51ca236d40e3b22e1514ffa2e638e2c39f6ad10" -+version = "0.21.1" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "c96a574677566f83ea8458dac1dd7792fd63e7c3f9dbcd865f0e8d6f8057b127" - dependencies = [ - "bincode", - "camino", - "fs-err", - "once_cell", -@@ -5938,15 +5946,17 @@ - "uniffi_meta", - ] - - [[package]] - name = "uniffi_meta" --version = "0.21.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "cd9417cc653937681436b93838d8c5f97a5b8c58697813982ee8810bd1dc3b57" -+version = "0.21.1" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "729835442da829c9b6f7c111c76cf87b2498e129101203bec94f0c39a3296a38" - dependencies = [ - "serde", -+ "siphasher", -+ "uniffi_checksum_derive", - ] - - [[package]] - name = "unix_path" - version = "1.0.1" -diff --git a/Cargo.toml b/Cargo.toml ---- a/Cargo.toml -+++ b/Cargo.toml -@@ -180,10 +180,14 @@ - # okay, but it means that their dependencies on UniFFI crates will normally - # also be the git versions. Patch them to use the published versions to avoid - # duplicate crates. - - [patch."https://github.com/mozilla/uniffi-rs.git"] --uniffi = "=0.21.0" --uniffi_bindgen = "=0.21.0" --uniffi_build = "=0.21.0" --uniffi_macros = "=0.21.0" -+uniffi = "=0.21.1" -+#uniffi_bindgen = "=0.21.1" -+uniffi_build = "=0.21.1" -+uniffi_macros = "=0.21.1" - weedle2 = "=4.0.0" -+ -+# Patched to use uniffi_version = 0.21.0 for checksums. -+[patch.crates-io.uniffi_bindgen] -+path = "third_party/rust/uniffi_bindgen" -diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml ---- a/supply-chain/audits.toml -+++ b/supply-chain/audits.toml -@@ -1535,10 +1535,16 @@ - who = "Jan-Erik Rediger " - criteria = "safe-to-deploy" - delta = "0.20.0 -> 0.21.0" - notes = "Maintained by the Glean and Application Services team." - -+[[audits.uniffi]] -+who = "Mike Hommey " -+criteria = "safe-to-deploy" -+delta = "0.21.0 -> 0.21.1" -+notes = "No changes." -+ - [[audits.uniffi_bindgen]] - who = "Travis Long " - criteria = "safe-to-deploy" - version = "0.19.3" - notes = "Maintained by the Glean and Application Services teams." -@@ -1558,10 +1564,16 @@ - who = "Jan-Erik Rediger " - criteria = "safe-to-deploy" - delta = "0.20.0 -> 0.21.0" - notes = "Maintained by the Glean and Application Services team." - -+[[audits.uniffi_bindgen]] -+who = "Mike Hommey " -+criteria = "safe-to-deploy" -+delta = "0.21.0 -> 0.21.1" -+notes = "I authored the changes in this version." -+ - [[audits.uniffi_build]] - who = "Travis Long " - criteria = "safe-to-deploy" - version = "0.19.3" - notes = "Maintained by the Glean and Application Services teams." -@@ -1581,10 +1593,22 @@ - who = "Jan-Erik Rediger " - criteria = "safe-to-deploy" - delta = "0.20.0 -> 0.21.0" - notes = "Maintained by the Glean and Application Services team." - -+[[audits.uniffi_build]] -+who = "Mike Hommey " -+criteria = "safe-to-deploy" -+delta = "0.21.0 -> 0.21.1" -+notes = "No changes." -+ -+[[audits.uniffi_checksum_derive]] -+who = "Mike Hommey " -+criteria = "safe-to-deploy" -+version = "0.21.1" -+notes = "I authored this crate." -+ - [[audits.uniffi_macros]] - who = "Travis Long " - criteria = "safe-to-deploy" - version = "0.19.3" - notes = "Maintained by the Glean and Application Services teams." -@@ -1604,10 +1628,16 @@ - who = "Jan-Erik Rediger " - criteria = "safe-to-deploy" - delta = "0.20.0 -> 0.21.0" - notes = "Maintained by the Glean and Application Services team." - -+[[audits.uniffi_macros]] -+who = "Mike Hommey " -+criteria = "safe-to-deploy" -+delta = "0.21.0 -> 0.21.1" -+notes = "No changes." -+ - [[audits.uniffi_meta]] - who = "Jan-Erik Rediger " - criteria = "safe-to-deploy" - version = "0.19.6" - notes = "Maintained by the Glean and Application Services team." -@@ -1621,10 +1651,16 @@ - who = "Jan-Erik Rediger " - criteria = "safe-to-deploy" - delta = "0.20.0 -> 0.21.0" - notes = "Maintained by the Glean and Application Services team." - -+[[audits.uniffi_meta]] -+who = "Mike Hommey " -+criteria = "safe-to-deploy" -+delta = "0.21.0 -> 0.21.1" -+notes = "I authored the changes in this version." -+ - [[audits.void]] - who = "Bobby Holley " - criteria = "safe-to-deploy" - version = "1.0.2" - notes = "Very small crate, just hosts the Void type for easier cross-crate interfacing." -diff --git a/supply-chain/config.toml b/supply-chain/config.toml ---- a/supply-chain/config.toml -+++ b/supply-chain/config.toml -@@ -156,10 +156,14 @@ - - [policy.tabs] - audit-as-crates-io = false - notes = "This is a first-party crate, maintained by the appservices team, which is entirely unrelated to the crates.io package of the same name." - -+[policy.uniffi_bindgen] -+audit-as-crates-io = false -+notes = "This is a first-party crate, normally vendored, but currently patched in-tree until next update." -+ - [policy.viaduct] - audit-as-crates-io = false - notes = "This is a first-party crate, maintained by the appservices team, which is entirely unrelated to the crates.io package of the same name." - - [policy.webdriver] -diff --git a/third_party/rust/uniffi/.cargo-checksum.json b/third_party/rust/uniffi/.cargo-checksum.json ---- a/third_party/rust/uniffi/.cargo-checksum.json -+++ b/third_party/rust/uniffi/.cargo-checksum.json -@@ -1 +1 @@ --{"files":{"Cargo.toml":"b7bde8b1b6bb7e1420c9c486d7562d1639fbb82a2b6459b8b3b7d15f002377d3","release.toml":"a6602545cd6eb46e44d89ce946d7954957ac00f1c955de54c736fa2cb560b1df","src/ffi/ffidefault.rs":"c7ab752fffed17c3fabb60e818ad1d093482f95dd0bdeae6871287695c583e48","src/ffi/foreignbytes.rs":"37061e2da7135576abccb86fe27b4fefc054586a040f2ca81fe9858d5649e887","src/ffi/foreigncallbacks.rs":"c0974920313ac81dd4bb28a51dd9e9ef50c8ea6d965f0bfdde58c661a4ca719f","src/ffi/mod.rs":"3fb3b74607066e0052fc91168e9473dbf82dbae562f85c33774a7f5f6b350616","src/ffi/rustbuffer.rs":"b773637d9e4651b80cd16f7a02ed75846d02ce0a9e32b718ce644cdba3a83cdd","src/ffi/rustcalls.rs":"4a85a90b0d46974ab9e80e403a1cddaa252337b227e1a672bb6fdbbca5a66259","src/lib.rs":"83614739f8c0c939b217755cfde169a85608a52ea197f63f7850e5765e2c5f97","src/panichook.rs":"9f49c7994a8e5489c1105c488bb3f8c5571bc5f813e7be90441eca15da5c9851","src/testing.rs":"f287d682a8f27465838b2aba91993c635a4dcd281d802dc12c7c75794324123f","tests/ui/proc_macro_arc.rs":"d766dffee3fe6a93522d40f44a7f15592db141fd674034fa5f016e06f510e87b","tests/ui/proc_macro_arc.stderr":"9e7d098abdd47f249ff62fe0a2ee0f8b96282ec5a3be0c48a778baab4624180f","tests/ui/version_mismatch.rs":"16ea359e5853517ee0d0704c015ae8c825533109fbefd715130d0f4a51f15898","tests/ui/version_mismatch.stderr":"aadbd8f3847f5663022d8dd75d6afa3b25dfc8abccd30b386a681f98587d4ceb"},"package":"f54af5ada67d1173457a99a7bb44a7917f63e7466764cb4714865c7a6678b830"} -\ No newline at end of file -+{"files":{"Cargo.toml":"40a5376941ee93f7d3d013862731eaced1121c852bd4df4affe1cd65bf9b68be","release.toml":"a6602545cd6eb46e44d89ce946d7954957ac00f1c955de54c736fa2cb560b1df","src/ffi/ffidefault.rs":"c7ab752fffed17c3fabb60e818ad1d093482f95dd0bdeae6871287695c583e48","src/ffi/foreignbytes.rs":"37061e2da7135576abccb86fe27b4fefc054586a040f2ca81fe9858d5649e887","src/ffi/foreigncallbacks.rs":"c0974920313ac81dd4bb28a51dd9e9ef50c8ea6d965f0bfdde58c661a4ca719f","src/ffi/mod.rs":"3fb3b74607066e0052fc91168e9473dbf82dbae562f85c33774a7f5f6b350616","src/ffi/rustbuffer.rs":"b773637d9e4651b80cd16f7a02ed75846d02ce0a9e32b718ce644cdba3a83cdd","src/ffi/rustcalls.rs":"4a85a90b0d46974ab9e80e403a1cddaa252337b227e1a672bb6fdbbca5a66259","src/lib.rs":"83614739f8c0c939b217755cfde169a85608a52ea197f63f7850e5765e2c5f97","src/panichook.rs":"9f49c7994a8e5489c1105c488bb3f8c5571bc5f813e7be90441eca15da5c9851","src/testing.rs":"f287d682a8f27465838b2aba91993c635a4dcd281d802dc12c7c75794324123f","tests/ui/proc_macro_arc.rs":"d766dffee3fe6a93522d40f44a7f15592db141fd674034fa5f016e06f510e87b","tests/ui/proc_macro_arc.stderr":"9e7d098abdd47f249ff62fe0a2ee0f8b96282ec5a3be0c48a778baab4624180f","tests/ui/version_mismatch.rs":"16ea359e5853517ee0d0704c015ae8c825533109fbefd715130d0f4a51f15898","tests/ui/version_mismatch.stderr":"aadbd8f3847f5663022d8dd75d6afa3b25dfc8abccd30b386a681f98587d4ceb"},"package":"b983553c0d1ad73547c65fa0c399aa800bee4a70ad330198e1c7a523212da5ee"} -\ No newline at end of file -diff --git a/third_party/rust/uniffi/Cargo.toml b/third_party/rust/uniffi/Cargo.toml ---- a/third_party/rust/uniffi/Cargo.toml -+++ b/third_party/rust/uniffi/Cargo.toml -@@ -10,22 +10,21 @@ - # See Cargo.toml.orig for the original contents. - - [package] - edition = "2021" - name = "uniffi" --version = "0.21.0" -+version = "0.21.1" - authors = ["Firefox Sync Team "] - description = "a multi-language bindings generator for rust (runtime support code)" - homepage = "https://mozilla.github.io/uniffi-rs" - documentation = "https://mozilla.github.io/uniffi-rs" - keywords = [ - "ffi", - "bindgen", - ] - license = "MPL-2.0" - repository = "https://github.com/mozilla/uniffi-rs" --resolver = "2" - - [dependencies.anyhow] - version = "1" - - [dependencies.bytes] -@@ -48,15 +47,15 @@ - - [dependencies.static_assertions] - version = "1.1.0" - - [dependencies.uniffi_bindgen] --version = "=0.21.0" -+version = "=0.21.1" - optional = true - - [dependencies.uniffi_macros] --version = "=0.21.0" -+version = "=0.21.1" - - [dev-dependencies.trybuild] - version = "1" - - [features] -diff --git a/third_party/rust/uniffi_bindgen/.cargo-checksum.json b/third_party/rust/uniffi_bindgen/.cargo-checksum.json ---- a/third_party/rust/uniffi_bindgen/.cargo-checksum.json -+++ b/third_party/rust/uniffi_bindgen/.cargo-checksum.json -@@ -1 +1 @@ --{"files":{"Cargo.lock":"5ed0714fd87076b5b5f11ca60553f12559e69794c2fec7d487a398f31a577a5f","Cargo.toml":"209b8cb7759ec813ee1e27a4b7e1d2bed2604c37d7c55578058bc7089ee9557e","askama.toml":"1a245b7803adca782837e125c49100147d2de0d5a1c949ff95e91af1701f6058","src/backend/config.rs":"4861dbf251dbb10beb1ed7e3eea7d79499a0de1cd9ce9ee8381a0e729c097dea","src/backend/declarations.rs":"12b8d6e651f84634de5cd02a47601965df7438f64f1a73f136bd89b6b5d515cf","src/backend/mod.rs":"899cd3b816d0467e35789b92ac3b8d5910f6dab98156d405db4803da8721fd36","src/backend/oracle.rs":"9e2b8a45af604a6e4952644e81f43f6aec6e0a1d03939c68b582529dd01a51e0","src/backend/types.rs":"7c49a92096a54eefd2336c48d60fe20ded9490142ab3a229a7c1a99fec14df3d","src/bindings/kotlin/gen_kotlin/callback_interface.rs":"b7fe795670830f3aa8a955c787b1127fe68313ee751013948527948fe5526b01","src/bindings/kotlin/gen_kotlin/compounds.rs":"d1e9a4237ff2ff711a3eae7a564c39e26f598c156ebfd34c0f04879e3533dd4f","src/bindings/kotlin/gen_kotlin/custom.rs":"4176f6ed5f66504f8fd981198bbfbae795dab5ef0d0281881d19b697f5560c44","src/bindings/kotlin/gen_kotlin/enum_.rs":"f85ae8dcb55c8f274139bf321af0ba237ae69894165ad6bd693d793f58af8e5e","src/bindings/kotlin/gen_kotlin/error.rs":"867f583aea5da7aabeb9b6d2544d7e52984cdea4aa008ce5f2ec941074735e1a","src/bindings/kotlin/gen_kotlin/external.rs":"1f7e91d7439891fe3c403274e35880ee4fc3a0da555510bdfa23c1ed2bbd8020","src/bindings/kotlin/gen_kotlin/miscellany.rs":"644ee5bb1f3619be5a36b2b3900af554ea38073cd054004f421e69c3cb8d50bc","src/bindings/kotlin/gen_kotlin/mod.rs":"90412e7927c284668a9eb75823c198182e58e5177d5561896c43b79367564b27","src/bindings/kotlin/gen_kotlin/object.rs":"6478a3e9d5e66186521730d0d481abd1ee4f123050ea050ac5a483842f08b003","src/bindings/kotlin/gen_kotlin/primitives.rs":"914d1f8253ed6a2937f67e8bd8f04f46aef4f22455ceb8a6caa84427adc2093e","src/bindings/kotlin/gen_kotlin/record.rs":"7961fcfbec5ebf8fc010b564ea4bd59402c919f6922898d48226d8c995569dd7","src/bindings/kotlin/mod.rs":"e68f2ea29e66ee62a56704e1e4464eea6d28bbdb52ab187bbe7a57ab3f362ea7","src/bindings/kotlin/templates/BooleanHelper.kt":"28e8a5088c8d58c9bfdbc575af8d8725060521fdd7d092684a8044b24ae567c7","src/bindings/kotlin/templates/CallbackInterfaceRuntime.kt":"6ede374b0fcbb3bcc939894e6f4729b3bec7ec7356831a60fba96ca38dc91aa8","src/bindings/kotlin/templates/CallbackInterfaceTemplate.kt":"5a704eb8c044ed22905e4d526ee3fc0b86f42fe82ac1eb4ad3758ad0552ea8c8","src/bindings/kotlin/templates/CustomTypeTemplate.kt":"5d4dacf29e89bcdcc46d155d993e6059d2df704e775dc853469310198253b231","src/bindings/kotlin/templates/DurationHelper.kt":"414a98161538a26f3a9b357353270c1f245ad6ceed99496aca7162cf473a92fd","src/bindings/kotlin/templates/EnumTemplate.kt":"ab3e2063aad3b91188db839dceb59b854a6a8b60fb35e545e270e64fee7c73fa","src/bindings/kotlin/templates/ErrorTemplate.kt":"a5ec2bdfc026838e1096dbf3301f21aa4ea22e8c93458d45bb1c8c7b9ee1fc5b","src/bindings/kotlin/templates/ExternalTypeTemplate.kt":"2097e0b830640ef18c79449ffa376d1dd35a8c4a5230e413c915f3b868aae872","src/bindings/kotlin/templates/FfiConverterTemplate.kt":"aa22962aaa9f641d48ccf44cb56d9f8a7736cbfaa01e1a1656662cfe5dd5c1d7","src/bindings/kotlin/templates/Float32Helper.kt":"662d95af3b629d143fb4d47cb7e9aa26ed28a5f3846de0341e28b0f9fb08bc25","src/bindings/kotlin/templates/Float64Helper.kt":"a77d099fa7d91e8702c1700e7949ffb6aaba9c6e8041ff48bab34b8e1fc9a0aa","src/bindings/kotlin/templates/Helpers.kt":"46c07798a26b53b06405c8bbbf86e3fcf38fadc1484ea04ce9d482defea89288","src/bindings/kotlin/templates/Int16Helper.kt":"7f83c4a48e1f3b2a59a3ca6a2662be8bc9baf3a5a748b31223cb3f51721ef249","src/bindings/kotlin/templates/Int32Helper.kt":"e02e4702175554b09fd2dd6ac3089dcd2c395f08ec60e762159566a9c9889450","src/bindings/kotlin/templates/Int64Helper.kt":"7a6fd6ca486852c89399c699935a9dfa1c32b9356d9a965cfde532581f05d9fa","src/bindings/kotlin/templates/Int8Helper.kt":"0554545494b6b9a76ce94f9c1723f8cf4230a13076feb75d620b1c9ca1ac4668","src/bindings/kotlin/templates/MapTemplate.kt":"399569d6443e8ad01e2deb95d78d8d2d15bf8eccee8be4fbe9ce4b8ebc0a6101","src/bindings/kotlin/templates/NamespaceLibraryTemplate.kt":"1eba4e77381155c2c96a6af2ef30fca881ade4957852f730fd10aa4f3d9cd3c4","src/bindings/kotlin/templates/ObjectRuntime.kt":"c11d233de41405caa55a56bcaa3bb69ce153ffa6fdff2aa218051929f5c4aeec","src/bindings/kotlin/templates/ObjectTemplate.kt":"7e32d92ec6116da9b7d7f278b15333a2fd2a82dde8c21534e3f6fe371d19f333","src/bindings/kotlin/templates/OptionalTemplate.kt":"5f9f2c1baa829ed3c9b61c3edb0f1fccf5ea3cccc052a69cf8966715d8fcf149","src/bindings/kotlin/templates/RecordTemplate.kt":"193ecdad9322fb5483b95bf2a259270a9b22ba054790794e9abb3fd219196bc5","src/bindings/kotlin/templates/RustBufferTemplate.kt":"415637f80a78c12b3d00db063c14a7ab5c61b098bdb1fc81a0be8bae9511776b","src/bindings/kotlin/templates/SequenceTemplate.kt":"786693b20c608a4f059b91df115278f5f12122b4c14a2e7ce18b6fc9b22b1296","src/bindings/kotlin/templates/StringHelper.kt":"060839663580d8199671b7c3bb3dce5e9106aa766ce2c6e0afc2d2bd788a1d83","src/bindings/kotlin/templates/TimestampHelper.kt":"353c2890f06ad6dda238e9aebb4bdff7bb838e17e46abf351ed3ff1fbc4e6580","src/bindings/kotlin/templates/TopLevelFunctionTemplate.kt":"09b8bb5ffea7075518ee657f83017d44ff0cbf584fd85676b082199139c9be09","src/bindings/kotlin/templates/Types.kt":"db7ed7384b4391a4bc1425ec3a89e0c890538ad30f5e115bae4998c059c8a21b","src/bindings/kotlin/templates/UInt16Helper.kt":"e84a1f30a5a899ba2c5db614d3f3c74f25bccf6dd99bf68b8830829332d051e9","src/bindings/kotlin/templates/UInt32Helper.kt":"7cdf08cc580046935f27ba07b53685968608a102e0a6be305111037c63d7ddf8","src/bindings/kotlin/templates/UInt64Helper.kt":"fd7baacbf3ab6202ff83edcc66e5f7beb11a10053ba66d0b49547616cc7cbe1f","src/bindings/kotlin/templates/UInt8Helper.kt":"bbf5a6d66c995aea9fe2fa9840c6bfa78b03520a09469b984f0e1d43191e453a","src/bindings/kotlin/templates/macros.kt":"eb5e0f9915b8ec9fbf3bf1a714625fbdcef7a7ee7461916e87fec872434ed3ec","src/bindings/kotlin/templates/wrapper.kt":"dd81cf28a4e07c685d29c87a4053eccb6339835cfc7fce3cf581d3d111fed4f5","src/bindings/mod.rs":"51ac55a3d505d5a88eedc83cf12623c2738277a9cd22bf3bbe05be1244de078b","src/bindings/python/gen_python/callback_interface.rs":"e3ffb8ba1aa8ac8ddcfff6554e7ec0d2d695d12955a98a04d114d2d6ca5dacc8","src/bindings/python/gen_python/compounds.rs":"e406c773c3b66368ea74973df742cdcba3014521812048f15de7c0e783eedfaf","src/bindings/python/gen_python/custom.rs":"33756f6bdafbd9b1a3a439c1cced3c83dc1fdb82b5ec235c064e69670ea6086c","src/bindings/python/gen_python/enum_.rs":"634c8406b07cbd24ea4f71cae4c971169e4989ce8019188f4bcd515bc3c77c5d","src/bindings/python/gen_python/error.rs":"d1a3b3edb91d9502064463cc3324770a1a6e0f234d6b49b5d7c43636bfe81d59","src/bindings/python/gen_python/external.rs":"8920b7a2a3b39a9647ec17cdff44308db3bfe9a582f026b060003edd76407599","src/bindings/python/gen_python/miscellany.rs":"f3898b75cf494b39662d886eb78d9cc06685650265fc8a1e87e5de67baa342ae","src/bindings/python/gen_python/mod.rs":"552de45cab20c4467bdcc774c305f298c9d7487c6b89f6786cb7ef1774ccddf6","src/bindings/python/gen_python/object.rs":"b4d3d8a935d4acd689cf1f3857d461dbab3a51c7c8bd821890198fb58ef3a63f","src/bindings/python/gen_python/primitives.rs":"928523bb91d2192d615d044f1fef3714681140562b740cf72dce3168e660e276","src/bindings/python/gen_python/record.rs":"f961dfe8dd1e5caa633754de7ecc684c2211c9b6633a5e6beb6053e60500b9f2","src/bindings/python/mod.rs":"bcf295b334b332c7fd1214ddfdaa727cfe37fed531c3862ce25906b3a70b71c7","src/bindings/python/templates/BooleanHelper.py":"d384ffeefcb5982c4875e819d06e919a295eaa9ff57735e6fef0801bb810d5c9","src/bindings/python/templates/CallbackInterfaceRuntime.py":"7ffef485fc008e2d9efcd07326102f300bd4673b4351353e9e2908355936c3d7","src/bindings/python/templates/CallbackInterfaceTemplate.py":"089b5cc1131e8c9b867c899cb649ce22eb9ba6a4addab4ebf9ba63316c394693","src/bindings/python/templates/CustomType.py":"db3309b3f944fb813d4cef47a04d67a86f824183f7e31289184683155fd985d9","src/bindings/python/templates/DurationHelper.py":"179c14dccd8cc7dc9791f896414f0b5d124ec116eb78173371bd8a0743208da1","src/bindings/python/templates/EnumTemplate.py":"825ca373286f1b3b252b8a1263e29c9e2f0d3e170ceb364bd6c28d6c4595597b","src/bindings/python/templates/ErrorTemplate.py":"b6b1b0d3fc074a7c3ba7db394c5d6cb3279b0fc0e6a331154303c2c6c907458b","src/bindings/python/templates/ExternalTemplate.py":"f582a6e872fe9f8275d33d36ffe017028ca459fe7c53aa680a2512718d0c0fda","src/bindings/python/templates/Float32Helper.py":"7dbc51889cff47ebf1600fad490849e4a87cac4fc0d1756eebd21609eb80b4a9","src/bindings/python/templates/Float64Helper.py":"ba9f334d1339b6eaedcacc1e35068939727170a684f41dec9ee04762ed98cec1","src/bindings/python/templates/Helpers.py":"68f03f651c38c810fa453e123e26f7c94b7a1f9178e0d863b985c3c8fabaa642","src/bindings/python/templates/Int16Helper.py":"60c22fb8b445841ebb3c68be11b81c9eba84a680eaa0e30770953361231da9b5","src/bindings/python/templates/Int32Helper.py":"aff0a017cf767394174e46d8c4fe5a5a704a8e6384fcc38d227634dfe7826916","src/bindings/python/templates/Int64Helper.py":"6c314b91699a6c6ad7db3ef636713bc2a0af9609c82acfd6062b0588177c0026","src/bindings/python/templates/Int8Helper.py":"a6e2d121b1a6d59886fceab3949e571aba1abc06dfede52666954bf15366fb6f","src/bindings/python/templates/MapTemplate.py":"bbe609b865010b98b38c58f2d4fcc97f2adec3e931903bf67263a5e440a84400","src/bindings/python/templates/NamespaceLibraryTemplate.py":"4726dbeb61508a71153436126bc04d03af966dca4f5b37511beb8bcfb6f1f307","src/bindings/python/templates/ObjectTemplate.py":"68302f6da6e4e80fc0cc8eb4ef2d4353d19ad3e9955112a2fabec8bf1b1293c7","src/bindings/python/templates/OptionalTemplate.py":"ab6da433370ba7c1316e266247ee1b7165bc02f6f288e40a7c68806c018e3282","src/bindings/python/templates/RecordTemplate.py":"98cef2adbc2b890e5c67257fb32a57380070988ef4112408eeca85e0b87b566b","src/bindings/python/templates/RustBufferHelper.py":"11f733051e63733c637fb19c4758cb58a40d045792028465f36891f89c7c5f36","src/bindings/python/templates/RustBufferTemplate.py":"90950cfeeb7a028aac9b65aeca897b217eddcfa165a0d59e8af037e834f34146","src/bindings/python/templates/SequenceTemplate.py":"faf2b1d5272a66258972d88c29d5b527cf9e589c8399e30f7ad5a0503133ce9b","src/bindings/python/templates/StringHelper.py":"941a7ad71d9598701efa15323df93766934583a55f4266d26db31e6b744603fc","src/bindings/python/templates/TimestampHelper.py":"b412cea69117858c05bae3210d378c6296658ed02a50e87c52c392dcb62c7892","src/bindings/python/templates/TopLevelFunctionTemplate.py":"2b2883b14f324e543cfeea5293d2a4907fa9ebe93b779da7174a58929d8b0442","src/bindings/python/templates/Types.py":"2eee78ca838f65b7e8ff8f760558c71ca80ad314aaa44efd1d1b8e13b349f1bc","src/bindings/python/templates/UInt16Helper.py":"06be5c9dacdf20e586f8236ed75cf2ca2470078fd8570843ea97c581b25bf860","src/bindings/python/templates/UInt32Helper.py":"41bb9bbf9b7be1060945e1267b1cc052585ec43696b1591f0ee779a0be0feaff","src/bindings/python/templates/UInt64Helper.py":"ba2825fc295a07292d9fb4aeebe74dabb9e6dbe505643e2347875ab12e511f31","src/bindings/python/templates/UInt8Helper.py":"dca5b3fc4a429fb233326224f85c4eccd3a7802ca9958ec309c7f197d59b4e3d","src/bindings/python/templates/macros.py":"3f02a32941e20aea15e136780c24c9695021dbcae08044c4f654f75aadcbd1e1","src/bindings/python/templates/wrapper.py":"627a6e18e72040909887261b8ad918c68104b15110df26b2205d7827c690e8c3","src/bindings/ruby/gen_ruby/mod.rs":"33ae9fc3f69e4c5b7bb6df41e53298f89934cee2bb6d7e7ea8488cefc9d06c03","src/bindings/ruby/gen_ruby/tests.rs":"7dcb86b08e643c43503f4cac6396833497f6988b004321c0067700ee29ffbf32","src/bindings/ruby/mod.rs":"f57fccdfc544210e8cc70e01e4991cee6e72d258ede9d2bb226baad24a3ef0d7","src/bindings/ruby/templates/EnumTemplate.rb":"5480edb347f5829e478d19474691babd72f37616ed846d519b5a61cb1d6cf047","src/bindings/ruby/templates/ErrorTemplate.rb":"147b2c3ff44c19624e7bf7b3a2a04b7badbba5743eaefa0d5e6c05943119c87e","src/bindings/ruby/templates/NamespaceLibraryTemplate.rb":"9b1454208bc83ef8f26aef33713d681e2284dbfea986ec0dd6c9b9c8b7d65e4a","src/bindings/ruby/templates/ObjectTemplate.rb":"c2d2fa2db62d48322b66b53888dcc6de2fc3e579a6b8d0a9f24029c18fffcbb5","src/bindings/ruby/templates/RecordTemplate.rb":"4aeff886928ca972e5dc9b799581b30c66a6f6dce446af3285dd3ed6b422dea9","src/bindings/ruby/templates/RustBufferBuilder.rb":"2ee5a4b97fe590de98ec2119b2dfe103bba75e15b5fb3c178fa51dfa662dfe2c","src/bindings/ruby/templates/RustBufferStream.rb":"ddfc38a6388bdddf8cc24bb6f1af948e4eef2d7ae2091a5130fee57cf53e5a7d","src/bindings/ruby/templates/RustBufferTemplate.rb":"8f37664f5436ba74ccdd801e16220f1b879d2fb56f51f5845b6047c92dc079f8","src/bindings/ruby/templates/TopLevelFunctionTemplate.rb":"88213e7e25bef664da939c04dd5621f438af735ffcb4d2d0c24a529538630069","src/bindings/ruby/templates/macros.rb":"d732a62291c78ccfbc3208227c1b57f6add723fad91b7e699d693e360840e1b0","src/bindings/ruby/templates/wrapper.rb":"542cdf46fb871e66089c9f008cf472cca411fe217d8c66a0a66776c35469aab5","src/bindings/swift/gen_swift/callback_interface.rs":"e331871ac6c9ac9b9533848fb6ddfcabc1e605970343cad307b6d86b72ebe96a","src/bindings/swift/gen_swift/compounds.rs":"f9e87b342f1f9a14295d87bad59d786d4c253a24d22900c2aba44816713718ae","src/bindings/swift/gen_swift/custom.rs":"45cdfa35ef7345dc353d0d2f3cebb17d726e90abdf5ef49422d6b2db65f8fd25","src/bindings/swift/gen_swift/enum_.rs":"018eea78ef85c9f8d715a5bc15c8273030d4f6ba297019949eb578c5cc6276fd","src/bindings/swift/gen_swift/error.rs":"bd95c3303e40f03a321f2cdc8e15a0251f4c7ddbc3c32c4c57eb9569db218488","src/bindings/swift/gen_swift/miscellany.rs":"66f16968f6cccc0b61c544e336a49b96218551731dcce566a176903c9afb3b57","src/bindings/swift/gen_swift/mod.rs":"1e8f98e05a5b03798c91ada854f6a4f2a0682c252143d63c16c6a06bd0419e4b","src/bindings/swift/gen_swift/object.rs":"072a44f484cc66694c57a9fa41ba50a531c9ce19738e11ce9df17cdfc007648f","src/bindings/swift/gen_swift/primitives.rs":"b37b8f3ad3aa7e769e6d465a31282e377f93cd69e4dcf39a56dc833f412ed412","src/bindings/swift/gen_swift/record.rs":"48296332960be3731b9139dc664d4b8a5d56d04cffa34dc995b62cf202b4dbfd","src/bindings/swift/mod.rs":"0ad4afd667ef17b3b577ded9a09cdaa5595afbdb24e7474c6b1e6a8e0a024593","src/bindings/swift/templates/BooleanHelper.swift":"f607928c4d598893421fe9c9f183bab2f23a877a07afeb123dbe90515249ec86","src/bindings/swift/templates/BridgingHeaderTemplate.h":"93a289e393ecdbe1bf986215c3b19d2aed7677d47f79b1833ce73cf6f8762e80","src/bindings/swift/templates/CallbackInterfaceRuntime.swift":"aac01eb4269151be9dde8c95ee8eba7e8d0841b3c2b1dbd88885f01ac64ee147","src/bindings/swift/templates/CallbackInterfaceTemplate.swift":"c9700f52e932556c59a9bfea68fc786746b7f321ff75c33d0a8c1565effaeef5","src/bindings/swift/templates/CustomType.swift":"fe6414f2ce3ea7b148742e2fecf2206d7e69935dd78d56e014aec70f4d6ad3ec","src/bindings/swift/templates/DurationHelper.swift":"bca4a6498b27fe0c877df3c7fbe148538eeda03e68d4e760a7c8a6a15f2067ff","src/bindings/swift/templates/EnumTemplate.swift":"e61bdf7949aa5a7b55a2c10c243e960f683c862e5977f06e7f5956646b4ccb49","src/bindings/swift/templates/ErrorTemplate.swift":"58fb5907d20b7a6db67b128e5f6350015278990fef5945be42477a5b5f82bb18","src/bindings/swift/templates/Float32Helper.swift":"6c1a4da059dd4c6c4392511c93fe9daf4ddeeab71e39afd122797b0e19254318","src/bindings/swift/templates/Float64Helper.swift":"f741568cdfb8e1421369a9a1dc845630a3a0e2dc2d6acf157afd80cd3ef5966f","src/bindings/swift/templates/Helpers.swift":"3cf3a5342a1ef0c7e078b0e58c32ae4437c4fb5dc41acbbd56b1128393c76602","src/bindings/swift/templates/Int16Helper.swift":"76eec2a54a65790c5959380cc9a7362b1e2e201632cccb789153c52e10c8dc4f","src/bindings/swift/templates/Int32Helper.swift":"5afc5e103bf637813fd4b77ab63e47ed38893525101a483218a339f222710061","src/bindings/swift/templates/Int64Helper.swift":"c1a6f6661ef1ad3bd00e8d0bf81adaa6539686eee2b481b046b76dbd87681adf","src/bindings/swift/templates/Int8Helper.swift":"bc46598c966e579cca22d336748c74cdce5674eaaaf75fc24e5fdaa36a43cf9c","src/bindings/swift/templates/MapTemplate.swift":"8b5a9cb41a1ad41b5566fbe3906a1449e5453289208a9fc6a611de1eb937142a","src/bindings/swift/templates/ModuleMapTemplate.modulemap":"99ad1e9bf550a21497296f9248ecd4385dd6d0b5892951d24cf990cdbf3eec2c","src/bindings/swift/templates/ObjectTemplate.swift":"98f744d7baf41e28d9184ae7e1aa9522b1bd951d507e0987879b11d7995782aa","src/bindings/swift/templates/OptionalTemplate.swift":"73f777d2df4fdf42daf0d6035436d168b0d5f0abc15153b97029bc305408f597","src/bindings/swift/templates/RecordTemplate.swift":"af0dc13b32d34254b4cfef3b74f52fd4611aa6c32e055e203414511fd3bbb00a","src/bindings/swift/templates/RustBufferTemplate.swift":"ed16f20cecd264f086c923cd92a5198f444aec99aad4d39e9012f09f530ca809","src/bindings/swift/templates/SequenceTemplate.swift":"977f1409909ff08018c0a80c1330737023b39a8f9fa9a13f5bf9ab4806cac199","src/bindings/swift/templates/StringHelper.swift":"b773c2b3a03f30338ff233881d1b0c0238831b812eff6eb9f0fafcb32ab0743a","src/bindings/swift/templates/TimestampHelper.swift":"6e22e370feae1199bff16bcc6f431decfb7700b02e6afdd84693a0c474eb045e","src/bindings/swift/templates/TopLevelFunctionTemplate.swift":"ca7fcbaa06ee31c7433fd6aa238b6c1135a843f469d9b4f37d4874d514fd80d0","src/bindings/swift/templates/Types.swift":"2f42430cb4ffba8e9b5084c0cf8790fb5bae151878134b8a21e745acf75d2b08","src/bindings/swift/templates/UInt16Helper.swift":"16adb3b50403dad114fad0b86bc220c5adc3bd987c57c290aee7c6407891dfbc","src/bindings/swift/templates/UInt32Helper.swift":"680ddd2815184f520723820f10698a089c222df0388bc0f7734c6d5234194aec","src/bindings/swift/templates/UInt64Helper.swift":"b752852162028a0c132f79f9005c47c263a4dab98833e86758cd7b467e305629","src/bindings/swift/templates/UInt8Helper.swift":"54f4821e704969eeb5c0e002b890d975a20eda3ddc3ee56169ee3c615dfa1079","src/bindings/swift/templates/macros.swift":"0744724c37419e894132b39aea4b8e1f473460583883fa37f38c787a7deea32c","src/bindings/swift/templates/wrapper.swift":"ca1af5fe47bca972c76fb8c9f52b18f727d4343204408de3dd0aae384f0a4171","src/interface/attributes.rs":"2f76377eebdd62e770bb9089885482a49a57e1f8405320bb778353f3e8974447","src/interface/callbacks.rs":"c9f4b97b21195ba2d1787f032f1daa5f4ce2fc40e014942e07e4eb37b5b95ee9","src/interface/enum_.rs":"1a7cda619a986a20fd4d0f145206aba2c500ce5dfca90d01e5324996fd68dc04","src/interface/error.rs":"f31fc0a7e41b4c8f4b81d06958fda14af6f05bfa318206098e0ec351cf4db809","src/interface/ffi.rs":"22d24e4dda327fa78c7632a6e5bbe374ecac0165acc550007feb729d8f4d6adf","src/interface/function.rs":"d6df6d8d412d7c45fe33c7337b37aeb851ae0f21834c4bd8b315aad4ca4ec309","src/interface/literal.rs":"3d2102cb47ff658f329d66d6c867b13a50e7f56535f23c1b414f857741360358","src/interface/mod.rs":"1d1993504ce61a2f578cb6fb42c79b7829a0767c20983581d631ee948819665e","src/interface/namespace.rs":"ab0f63241bb6a0a32f9fd2a1544468cb6daa1f91f6116b7246b52a4a94e4f461","src/interface/object.rs":"44836747d5d00bb40ecadb889c9a6ff32c1cbf625b5a6a337f5891f495fd92fd","src/interface/record.rs":"5859ea6c1f6c5524d1e6f3846954986710d5f74f1c6fd6324c4245b5f70013d5","src/interface/types/finder.rs":"a27f24e64b5bfc796378d1012b5e72001f0a442e8185fdc4430b106595d4b819","src/interface/types/mod.rs":"fe63c3fd233ad905af0358c5d610c85a5a57f263eb899acc756454a1029c4569","src/interface/types/resolver.rs":"7e7ce336ef77c0a6c23deea36856737a97cca9b1c3f5cd0d676fe7df6ade6480","src/lib.rs":"a41b43e3628bb6b3f725580eec255b409947945672887de87c21d5122775a245","src/macro_metadata/ci.rs":"0d6e53d2b5645dd3cc7d196bd3a32ee82c029e1adb9ae93708c27a3fa5c55a88","src/macro_metadata/extract.rs":"ec392692a4601343312f60937987fe460cfb40d2c63a6bb1531fe91903916f10","src/macro_metadata/mod.rs":"1668e6d947fd4a957f557410a8095649de6f8d7fd3eb6a403b8587280dca2d54","src/main.rs":"bbf8e9942d398387e7518533f9b9dc42bfa66156430a87a17605a80a356c0dea","src/scaffolding/mod.rs":"35ae72220843cf3cccefd96e190553e32a5f34ccc58d552fd9165faea12db260","src/scaffolding/templates/CallbackInterfaceTemplate.rs":"3c8caa2e148add8d80701894ee6904fc2d3c5c6424d6d414b36edb6f593b5023","src/scaffolding/templates/EnumTemplate.rs":"eb8802f04f1fd1c9451ad72c1195c136288fdb4e488922b24db75b2fdae65cd7","src/scaffolding/templates/ErrorTemplate.rs":"e7ca4538908a273dd7ba3834219b30fa0e537b2171144f06b6a96fbefb90cd1d","src/scaffolding/templates/ExternalTypesTemplate.rs":"8ecc805cf119abac8c5f60605f9183ee9ec8d37f9ec75bba5e18bb8b482a1abb","src/scaffolding/templates/ObjectTemplate.rs":"34de640428486e17a61ded4f42ce13d8eac3e66cc9f60196ce2575cdc0bd8df6","src/scaffolding/templates/RecordTemplate.rs":"e8d5af954f46f023a243721d6fc70aa176c3a4c0a9dd340048bfe46f3eeed783","src/scaffolding/templates/ReexportUniFFIScaffolding.rs":"559a17c8e39c473ff1effe9651f05b83d443ecd8abed13e03f2b63872d7e1593","src/scaffolding/templates/RustBuffer.rs":"ccf7521012d93c41265375c6d2e80ce861ec93b41383da83c37718386dd726f6","src/scaffolding/templates/TopLevelFunctionTemplate.rs":"35eaefb0862f25ff683d58fb0be6ad5f74bbe2fc85047273200c3a5f4c728434","src/scaffolding/templates/macros.rs":"a41c9690d411074c59fc4609f897431669b9d939625a08f5304a71a88901ba7c","src/scaffolding/templates/scaffolding_template.rs":"3589f8e8e1f9b194ff4a6245665d3a421c771dec3cc947c4264bfcd34573550e"},"package":"12cc4af3c0180c7e86c4a3acf2b6587af04ba2567b1e948993df10f421796621"} -\ No newline at end of file -+{"files":{"Cargo.lock":"3b1693f0ada97ba7e0527d763402404b39fe341da22bd45aaf057e4be3fa3234","Cargo.toml":"58662147277f1620eccd6592f83623cf71959df8326e9d700fdaac47c6e6cf35","askama.toml":"1a245b7803adca782837e125c49100147d2de0d5a1c949ff95e91af1701f6058","src/backend/config.rs":"4861dbf251dbb10beb1ed7e3eea7d79499a0de1cd9ce9ee8381a0e729c097dea","src/backend/declarations.rs":"12b8d6e651f84634de5cd02a47601965df7438f64f1a73f136bd89b6b5d515cf","src/backend/mod.rs":"899cd3b816d0467e35789b92ac3b8d5910f6dab98156d405db4803da8721fd36","src/backend/oracle.rs":"9e2b8a45af604a6e4952644e81f43f6aec6e0a1d03939c68b582529dd01a51e0","src/backend/types.rs":"7c49a92096a54eefd2336c48d60fe20ded9490142ab3a229a7c1a99fec14df3d","src/bindings/kotlin/gen_kotlin/callback_interface.rs":"b7fe795670830f3aa8a955c787b1127fe68313ee751013948527948fe5526b01","src/bindings/kotlin/gen_kotlin/compounds.rs":"d1e9a4237ff2ff711a3eae7a564c39e26f598c156ebfd34c0f04879e3533dd4f","src/bindings/kotlin/gen_kotlin/custom.rs":"4176f6ed5f66504f8fd981198bbfbae795dab5ef0d0281881d19b697f5560c44","src/bindings/kotlin/gen_kotlin/enum_.rs":"f85ae8dcb55c8f274139bf321af0ba237ae69894165ad6bd693d793f58af8e5e","src/bindings/kotlin/gen_kotlin/error.rs":"867f583aea5da7aabeb9b6d2544d7e52984cdea4aa008ce5f2ec941074735e1a","src/bindings/kotlin/gen_kotlin/external.rs":"1f7e91d7439891fe3c403274e35880ee4fc3a0da555510bdfa23c1ed2bbd8020","src/bindings/kotlin/gen_kotlin/miscellany.rs":"644ee5bb1f3619be5a36b2b3900af554ea38073cd054004f421e69c3cb8d50bc","src/bindings/kotlin/gen_kotlin/mod.rs":"90412e7927c284668a9eb75823c198182e58e5177d5561896c43b79367564b27","src/bindings/kotlin/gen_kotlin/object.rs":"6478a3e9d5e66186521730d0d481abd1ee4f123050ea050ac5a483842f08b003","src/bindings/kotlin/gen_kotlin/primitives.rs":"914d1f8253ed6a2937f67e8bd8f04f46aef4f22455ceb8a6caa84427adc2093e","src/bindings/kotlin/gen_kotlin/record.rs":"7961fcfbec5ebf8fc010b564ea4bd59402c919f6922898d48226d8c995569dd7","src/bindings/kotlin/mod.rs":"e68f2ea29e66ee62a56704e1e4464eea6d28bbdb52ab187bbe7a57ab3f362ea7","src/bindings/kotlin/templates/BooleanHelper.kt":"28e8a5088c8d58c9bfdbc575af8d8725060521fdd7d092684a8044b24ae567c7","src/bindings/kotlin/templates/CallbackInterfaceRuntime.kt":"6ede374b0fcbb3bcc939894e6f4729b3bec7ec7356831a60fba96ca38dc91aa8","src/bindings/kotlin/templates/CallbackInterfaceTemplate.kt":"5a704eb8c044ed22905e4d526ee3fc0b86f42fe82ac1eb4ad3758ad0552ea8c8","src/bindings/kotlin/templates/CustomTypeTemplate.kt":"5d4dacf29e89bcdcc46d155d993e6059d2df704e775dc853469310198253b231","src/bindings/kotlin/templates/DurationHelper.kt":"414a98161538a26f3a9b357353270c1f245ad6ceed99496aca7162cf473a92fd","src/bindings/kotlin/templates/EnumTemplate.kt":"ab3e2063aad3b91188db839dceb59b854a6a8b60fb35e545e270e64fee7c73fa","src/bindings/kotlin/templates/ErrorTemplate.kt":"a5ec2bdfc026838e1096dbf3301f21aa4ea22e8c93458d45bb1c8c7b9ee1fc5b","src/bindings/kotlin/templates/ExternalTypeTemplate.kt":"2097e0b830640ef18c79449ffa376d1dd35a8c4a5230e413c915f3b868aae872","src/bindings/kotlin/templates/FfiConverterTemplate.kt":"aa22962aaa9f641d48ccf44cb56d9f8a7736cbfaa01e1a1656662cfe5dd5c1d7","src/bindings/kotlin/templates/Float32Helper.kt":"662d95af3b629d143fb4d47cb7e9aa26ed28a5f3846de0341e28b0f9fb08bc25","src/bindings/kotlin/templates/Float64Helper.kt":"a77d099fa7d91e8702c1700e7949ffb6aaba9c6e8041ff48bab34b8e1fc9a0aa","src/bindings/kotlin/templates/Helpers.kt":"46c07798a26b53b06405c8bbbf86e3fcf38fadc1484ea04ce9d482defea89288","src/bindings/kotlin/templates/Int16Helper.kt":"7f83c4a48e1f3b2a59a3ca6a2662be8bc9baf3a5a748b31223cb3f51721ef249","src/bindings/kotlin/templates/Int32Helper.kt":"e02e4702175554b09fd2dd6ac3089dcd2c395f08ec60e762159566a9c9889450","src/bindings/kotlin/templates/Int64Helper.kt":"7a6fd6ca486852c89399c699935a9dfa1c32b9356d9a965cfde532581f05d9fa","src/bindings/kotlin/templates/Int8Helper.kt":"0554545494b6b9a76ce94f9c1723f8cf4230a13076feb75d620b1c9ca1ac4668","src/bindings/kotlin/templates/MapTemplate.kt":"399569d6443e8ad01e2deb95d78d8d2d15bf8eccee8be4fbe9ce4b8ebc0a6101","src/bindings/kotlin/templates/NamespaceLibraryTemplate.kt":"1eba4e77381155c2c96a6af2ef30fca881ade4957852f730fd10aa4f3d9cd3c4","src/bindings/kotlin/templates/ObjectRuntime.kt":"c11d233de41405caa55a56bcaa3bb69ce153ffa6fdff2aa218051929f5c4aeec","src/bindings/kotlin/templates/ObjectTemplate.kt":"7e32d92ec6116da9b7d7f278b15333a2fd2a82dde8c21534e3f6fe371d19f333","src/bindings/kotlin/templates/OptionalTemplate.kt":"5f9f2c1baa829ed3c9b61c3edb0f1fccf5ea3cccc052a69cf8966715d8fcf149","src/bindings/kotlin/templates/RecordTemplate.kt":"193ecdad9322fb5483b95bf2a259270a9b22ba054790794e9abb3fd219196bc5","src/bindings/kotlin/templates/RustBufferTemplate.kt":"415637f80a78c12b3d00db063c14a7ab5c61b098bdb1fc81a0be8bae9511776b","src/bindings/kotlin/templates/SequenceTemplate.kt":"786693b20c608a4f059b91df115278f5f12122b4c14a2e7ce18b6fc9b22b1296","src/bindings/kotlin/templates/StringHelper.kt":"060839663580d8199671b7c3bb3dce5e9106aa766ce2c6e0afc2d2bd788a1d83","src/bindings/kotlin/templates/TimestampHelper.kt":"353c2890f06ad6dda238e9aebb4bdff7bb838e17e46abf351ed3ff1fbc4e6580","src/bindings/kotlin/templates/TopLevelFunctionTemplate.kt":"09b8bb5ffea7075518ee657f83017d44ff0cbf584fd85676b082199139c9be09","src/bindings/kotlin/templates/Types.kt":"db7ed7384b4391a4bc1425ec3a89e0c890538ad30f5e115bae4998c059c8a21b","src/bindings/kotlin/templates/UInt16Helper.kt":"e84a1f30a5a899ba2c5db614d3f3c74f25bccf6dd99bf68b8830829332d051e9","src/bindings/kotlin/templates/UInt32Helper.kt":"7cdf08cc580046935f27ba07b53685968608a102e0a6be305111037c63d7ddf8","src/bindings/kotlin/templates/UInt64Helper.kt":"fd7baacbf3ab6202ff83edcc66e5f7beb11a10053ba66d0b49547616cc7cbe1f","src/bindings/kotlin/templates/UInt8Helper.kt":"bbf5a6d66c995aea9fe2fa9840c6bfa78b03520a09469b984f0e1d43191e453a","src/bindings/kotlin/templates/macros.kt":"eb5e0f9915b8ec9fbf3bf1a714625fbdcef7a7ee7461916e87fec872434ed3ec","src/bindings/kotlin/templates/wrapper.kt":"dd81cf28a4e07c685d29c87a4053eccb6339835cfc7fce3cf581d3d111fed4f5","src/bindings/mod.rs":"51ac55a3d505d5a88eedc83cf12623c2738277a9cd22bf3bbe05be1244de078b","src/bindings/python/gen_python/callback_interface.rs":"e3ffb8ba1aa8ac8ddcfff6554e7ec0d2d695d12955a98a04d114d2d6ca5dacc8","src/bindings/python/gen_python/compounds.rs":"e406c773c3b66368ea74973df742cdcba3014521812048f15de7c0e783eedfaf","src/bindings/python/gen_python/custom.rs":"33756f6bdafbd9b1a3a439c1cced3c83dc1fdb82b5ec235c064e69670ea6086c","src/bindings/python/gen_python/enum_.rs":"634c8406b07cbd24ea4f71cae4c971169e4989ce8019188f4bcd515bc3c77c5d","src/bindings/python/gen_python/error.rs":"d1a3b3edb91d9502064463cc3324770a1a6e0f234d6b49b5d7c43636bfe81d59","src/bindings/python/gen_python/external.rs":"8920b7a2a3b39a9647ec17cdff44308db3bfe9a582f026b060003edd76407599","src/bindings/python/gen_python/miscellany.rs":"f3898b75cf494b39662d886eb78d9cc06685650265fc8a1e87e5de67baa342ae","src/bindings/python/gen_python/mod.rs":"552de45cab20c4467bdcc774c305f298c9d7487c6b89f6786cb7ef1774ccddf6","src/bindings/python/gen_python/object.rs":"b4d3d8a935d4acd689cf1f3857d461dbab3a51c7c8bd821890198fb58ef3a63f","src/bindings/python/gen_python/primitives.rs":"928523bb91d2192d615d044f1fef3714681140562b740cf72dce3168e660e276","src/bindings/python/gen_python/record.rs":"f961dfe8dd1e5caa633754de7ecc684c2211c9b6633a5e6beb6053e60500b9f2","src/bindings/python/mod.rs":"bcf295b334b332c7fd1214ddfdaa727cfe37fed531c3862ce25906b3a70b71c7","src/bindings/python/templates/BooleanHelper.py":"d384ffeefcb5982c4875e819d06e919a295eaa9ff57735e6fef0801bb810d5c9","src/bindings/python/templates/CallbackInterfaceRuntime.py":"7ffef485fc008e2d9efcd07326102f300bd4673b4351353e9e2908355936c3d7","src/bindings/python/templates/CallbackInterfaceTemplate.py":"089b5cc1131e8c9b867c899cb649ce22eb9ba6a4addab4ebf9ba63316c394693","src/bindings/python/templates/CustomType.py":"db3309b3f944fb813d4cef47a04d67a86f824183f7e31289184683155fd985d9","src/bindings/python/templates/DurationHelper.py":"179c14dccd8cc7dc9791f896414f0b5d124ec116eb78173371bd8a0743208da1","src/bindings/python/templates/EnumTemplate.py":"825ca373286f1b3b252b8a1263e29c9e2f0d3e170ceb364bd6c28d6c4595597b","src/bindings/python/templates/ErrorTemplate.py":"b6b1b0d3fc074a7c3ba7db394c5d6cb3279b0fc0e6a331154303c2c6c907458b","src/bindings/python/templates/ExternalTemplate.py":"f582a6e872fe9f8275d33d36ffe017028ca459fe7c53aa680a2512718d0c0fda","src/bindings/python/templates/Float32Helper.py":"7dbc51889cff47ebf1600fad490849e4a87cac4fc0d1756eebd21609eb80b4a9","src/bindings/python/templates/Float64Helper.py":"ba9f334d1339b6eaedcacc1e35068939727170a684f41dec9ee04762ed98cec1","src/bindings/python/templates/Helpers.py":"68f03f651c38c810fa453e123e26f7c94b7a1f9178e0d863b985c3c8fabaa642","src/bindings/python/templates/Int16Helper.py":"60c22fb8b445841ebb3c68be11b81c9eba84a680eaa0e30770953361231da9b5","src/bindings/python/templates/Int32Helper.py":"aff0a017cf767394174e46d8c4fe5a5a704a8e6384fcc38d227634dfe7826916","src/bindings/python/templates/Int64Helper.py":"6c314b91699a6c6ad7db3ef636713bc2a0af9609c82acfd6062b0588177c0026","src/bindings/python/templates/Int8Helper.py":"a6e2d121b1a6d59886fceab3949e571aba1abc06dfede52666954bf15366fb6f","src/bindings/python/templates/MapTemplate.py":"bbe609b865010b98b38c58f2d4fcc97f2adec3e931903bf67263a5e440a84400","src/bindings/python/templates/NamespaceLibraryTemplate.py":"4726dbeb61508a71153436126bc04d03af966dca4f5b37511beb8bcfb6f1f307","src/bindings/python/templates/ObjectTemplate.py":"68302f6da6e4e80fc0cc8eb4ef2d4353d19ad3e9955112a2fabec8bf1b1293c7","src/bindings/python/templates/OptionalTemplate.py":"ab6da433370ba7c1316e266247ee1b7165bc02f6f288e40a7c68806c018e3282","src/bindings/python/templates/RecordTemplate.py":"98cef2adbc2b890e5c67257fb32a57380070988ef4112408eeca85e0b87b566b","src/bindings/python/templates/RustBufferHelper.py":"11f733051e63733c637fb19c4758cb58a40d045792028465f36891f89c7c5f36","src/bindings/python/templates/RustBufferTemplate.py":"90950cfeeb7a028aac9b65aeca897b217eddcfa165a0d59e8af037e834f34146","src/bindings/python/templates/SequenceTemplate.py":"faf2b1d5272a66258972d88c29d5b527cf9e589c8399e30f7ad5a0503133ce9b","src/bindings/python/templates/StringHelper.py":"941a7ad71d9598701efa15323df93766934583a55f4266d26db31e6b744603fc","src/bindings/python/templates/TimestampHelper.py":"b412cea69117858c05bae3210d378c6296658ed02a50e87c52c392dcb62c7892","src/bindings/python/templates/TopLevelFunctionTemplate.py":"2b2883b14f324e543cfeea5293d2a4907fa9ebe93b779da7174a58929d8b0442","src/bindings/python/templates/Types.py":"2eee78ca838f65b7e8ff8f760558c71ca80ad314aaa44efd1d1b8e13b349f1bc","src/bindings/python/templates/UInt16Helper.py":"06be5c9dacdf20e586f8236ed75cf2ca2470078fd8570843ea97c581b25bf860","src/bindings/python/templates/UInt32Helper.py":"41bb9bbf9b7be1060945e1267b1cc052585ec43696b1591f0ee779a0be0feaff","src/bindings/python/templates/UInt64Helper.py":"ba2825fc295a07292d9fb4aeebe74dabb9e6dbe505643e2347875ab12e511f31","src/bindings/python/templates/UInt8Helper.py":"dca5b3fc4a429fb233326224f85c4eccd3a7802ca9958ec309c7f197d59b4e3d","src/bindings/python/templates/macros.py":"3f02a32941e20aea15e136780c24c9695021dbcae08044c4f654f75aadcbd1e1","src/bindings/python/templates/wrapper.py":"627a6e18e72040909887261b8ad918c68104b15110df26b2205d7827c690e8c3","src/bindings/ruby/gen_ruby/mod.rs":"33ae9fc3f69e4c5b7bb6df41e53298f89934cee2bb6d7e7ea8488cefc9d06c03","src/bindings/ruby/gen_ruby/tests.rs":"7dcb86b08e643c43503f4cac6396833497f6988b004321c0067700ee29ffbf32","src/bindings/ruby/mod.rs":"f57fccdfc544210e8cc70e01e4991cee6e72d258ede9d2bb226baad24a3ef0d7","src/bindings/ruby/templates/EnumTemplate.rb":"5480edb347f5829e478d19474691babd72f37616ed846d519b5a61cb1d6cf047","src/bindings/ruby/templates/ErrorTemplate.rb":"147b2c3ff44c19624e7bf7b3a2a04b7badbba5743eaefa0d5e6c05943119c87e","src/bindings/ruby/templates/NamespaceLibraryTemplate.rb":"9b1454208bc83ef8f26aef33713d681e2284dbfea986ec0dd6c9b9c8b7d65e4a","src/bindings/ruby/templates/ObjectTemplate.rb":"c2d2fa2db62d48322b66b53888dcc6de2fc3e579a6b8d0a9f24029c18fffcbb5","src/bindings/ruby/templates/RecordTemplate.rb":"4aeff886928ca972e5dc9b799581b30c66a6f6dce446af3285dd3ed6b422dea9","src/bindings/ruby/templates/RustBufferBuilder.rb":"2ee5a4b97fe590de98ec2119b2dfe103bba75e15b5fb3c178fa51dfa662dfe2c","src/bindings/ruby/templates/RustBufferStream.rb":"ddfc38a6388bdddf8cc24bb6f1af948e4eef2d7ae2091a5130fee57cf53e5a7d","src/bindings/ruby/templates/RustBufferTemplate.rb":"8f37664f5436ba74ccdd801e16220f1b879d2fb56f51f5845b6047c92dc079f8","src/bindings/ruby/templates/TopLevelFunctionTemplate.rb":"88213e7e25bef664da939c04dd5621f438af735ffcb4d2d0c24a529538630069","src/bindings/ruby/templates/macros.rb":"d732a62291c78ccfbc3208227c1b57f6add723fad91b7e699d693e360840e1b0","src/bindings/ruby/templates/wrapper.rb":"542cdf46fb871e66089c9f008cf472cca411fe217d8c66a0a66776c35469aab5","src/bindings/swift/gen_swift/callback_interface.rs":"e331871ac6c9ac9b9533848fb6ddfcabc1e605970343cad307b6d86b72ebe96a","src/bindings/swift/gen_swift/compounds.rs":"f9e87b342f1f9a14295d87bad59d786d4c253a24d22900c2aba44816713718ae","src/bindings/swift/gen_swift/custom.rs":"45cdfa35ef7345dc353d0d2f3cebb17d726e90abdf5ef49422d6b2db65f8fd25","src/bindings/swift/gen_swift/enum_.rs":"018eea78ef85c9f8d715a5bc15c8273030d4f6ba297019949eb578c5cc6276fd","src/bindings/swift/gen_swift/error.rs":"bd95c3303e40f03a321f2cdc8e15a0251f4c7ddbc3c32c4c57eb9569db218488","src/bindings/swift/gen_swift/miscellany.rs":"66f16968f6cccc0b61c544e336a49b96218551731dcce566a176903c9afb3b57","src/bindings/swift/gen_swift/mod.rs":"1e8f98e05a5b03798c91ada854f6a4f2a0682c252143d63c16c6a06bd0419e4b","src/bindings/swift/gen_swift/object.rs":"072a44f484cc66694c57a9fa41ba50a531c9ce19738e11ce9df17cdfc007648f","src/bindings/swift/gen_swift/primitives.rs":"b37b8f3ad3aa7e769e6d465a31282e377f93cd69e4dcf39a56dc833f412ed412","src/bindings/swift/gen_swift/record.rs":"48296332960be3731b9139dc664d4b8a5d56d04cffa34dc995b62cf202b4dbfd","src/bindings/swift/mod.rs":"0ad4afd667ef17b3b577ded9a09cdaa5595afbdb24e7474c6b1e6a8e0a024593","src/bindings/swift/templates/BooleanHelper.swift":"f607928c4d598893421fe9c9f183bab2f23a877a07afeb123dbe90515249ec86","src/bindings/swift/templates/BridgingHeaderTemplate.h":"93a289e393ecdbe1bf986215c3b19d2aed7677d47f79b1833ce73cf6f8762e80","src/bindings/swift/templates/CallbackInterfaceRuntime.swift":"aac01eb4269151be9dde8c95ee8eba7e8d0841b3c2b1dbd88885f01ac64ee147","src/bindings/swift/templates/CallbackInterfaceTemplate.swift":"c9700f52e932556c59a9bfea68fc786746b7f321ff75c33d0a8c1565effaeef5","src/bindings/swift/templates/CustomType.swift":"fe6414f2ce3ea7b148742e2fecf2206d7e69935dd78d56e014aec70f4d6ad3ec","src/bindings/swift/templates/DurationHelper.swift":"bca4a6498b27fe0c877df3c7fbe148538eeda03e68d4e760a7c8a6a15f2067ff","src/bindings/swift/templates/EnumTemplate.swift":"e61bdf7949aa5a7b55a2c10c243e960f683c862e5977f06e7f5956646b4ccb49","src/bindings/swift/templates/ErrorTemplate.swift":"58fb5907d20b7a6db67b128e5f6350015278990fef5945be42477a5b5f82bb18","src/bindings/swift/templates/Float32Helper.swift":"6c1a4da059dd4c6c4392511c93fe9daf4ddeeab71e39afd122797b0e19254318","src/bindings/swift/templates/Float64Helper.swift":"f741568cdfb8e1421369a9a1dc845630a3a0e2dc2d6acf157afd80cd3ef5966f","src/bindings/swift/templates/Helpers.swift":"3cf3a5342a1ef0c7e078b0e58c32ae4437c4fb5dc41acbbd56b1128393c76602","src/bindings/swift/templates/Int16Helper.swift":"76eec2a54a65790c5959380cc9a7362b1e2e201632cccb789153c52e10c8dc4f","src/bindings/swift/templates/Int32Helper.swift":"5afc5e103bf637813fd4b77ab63e47ed38893525101a483218a339f222710061","src/bindings/swift/templates/Int64Helper.swift":"c1a6f6661ef1ad3bd00e8d0bf81adaa6539686eee2b481b046b76dbd87681adf","src/bindings/swift/templates/Int8Helper.swift":"bc46598c966e579cca22d336748c74cdce5674eaaaf75fc24e5fdaa36a43cf9c","src/bindings/swift/templates/MapTemplate.swift":"8b5a9cb41a1ad41b5566fbe3906a1449e5453289208a9fc6a611de1eb937142a","src/bindings/swift/templates/ModuleMapTemplate.modulemap":"99ad1e9bf550a21497296f9248ecd4385dd6d0b5892951d24cf990cdbf3eec2c","src/bindings/swift/templates/ObjectTemplate.swift":"98f744d7baf41e28d9184ae7e1aa9522b1bd951d507e0987879b11d7995782aa","src/bindings/swift/templates/OptionalTemplate.swift":"73f777d2df4fdf42daf0d6035436d168b0d5f0abc15153b97029bc305408f597","src/bindings/swift/templates/RecordTemplate.swift":"af0dc13b32d34254b4cfef3b74f52fd4611aa6c32e055e203414511fd3bbb00a","src/bindings/swift/templates/RustBufferTemplate.swift":"ed16f20cecd264f086c923cd92a5198f444aec99aad4d39e9012f09f530ca809","src/bindings/swift/templates/SequenceTemplate.swift":"977f1409909ff08018c0a80c1330737023b39a8f9fa9a13f5bf9ab4806cac199","src/bindings/swift/templates/StringHelper.swift":"b773c2b3a03f30338ff233881d1b0c0238831b812eff6eb9f0fafcb32ab0743a","src/bindings/swift/templates/TimestampHelper.swift":"6e22e370feae1199bff16bcc6f431decfb7700b02e6afdd84693a0c474eb045e","src/bindings/swift/templates/TopLevelFunctionTemplate.swift":"ca7fcbaa06ee31c7433fd6aa238b6c1135a843f469d9b4f37d4874d514fd80d0","src/bindings/swift/templates/Types.swift":"2f42430cb4ffba8e9b5084c0cf8790fb5bae151878134b8a21e745acf75d2b08","src/bindings/swift/templates/UInt16Helper.swift":"16adb3b50403dad114fad0b86bc220c5adc3bd987c57c290aee7c6407891dfbc","src/bindings/swift/templates/UInt32Helper.swift":"680ddd2815184f520723820f10698a089c222df0388bc0f7734c6d5234194aec","src/bindings/swift/templates/UInt64Helper.swift":"b752852162028a0c132f79f9005c47c263a4dab98833e86758cd7b467e305629","src/bindings/swift/templates/UInt8Helper.swift":"54f4821e704969eeb5c0e002b890d975a20eda3ddc3ee56169ee3c615dfa1079","src/bindings/swift/templates/macros.swift":"0744724c37419e894132b39aea4b8e1f473460583883fa37f38c787a7deea32c","src/bindings/swift/templates/wrapper.swift":"ca1af5fe47bca972c76fb8c9f52b18f727d4343204408de3dd0aae384f0a4171","src/interface/attributes.rs":"6c062b60deb332fbb76e70bc675e65c2bc3f2060fad7cec87492609fa9ce166c","src/interface/callbacks.rs":"e311fe8c80fae1d84c1e867a3c36a47a6d6a41847bb2d633edefac7c69402c84","src/interface/enum_.rs":"4ff34ff12c19be0bc9d807020fd4c8e20660c418741e68408671a18165e4b95b","src/interface/error.rs":"85a61e5bb38b369b60110928a78dc84ae77a06d0cbae4dfe9ff9dff2b8c27e5a","src/interface/ffi.rs":"22d24e4dda327fa78c7632a6e5bbe374ecac0165acc550007feb729d8f4d6adf","src/interface/function.rs":"19219c6c984d4117362ee5c269712ec2ad462476902442062ef2a3b0619b014c","src/interface/literal.rs":"d93d168176ba2824d26c490396f4baffc1d418c3c94e4a1ef0ceb3cfca16a239","src/interface/mod.rs":"88dd169859004da79bd1488e6432bc7dae8b6cba9238cab1d676e570dad31d62","src/interface/namespace.rs":"ab0f63241bb6a0a32f9fd2a1544468cb6daa1f91f6116b7246b52a4a94e4f461","src/interface/object.rs":"106cbf5ec2a684700dd99c9748ba161320abb2cecec3c5022d5dd1a9ec4f5b85","src/interface/record.rs":"5b9db093c0c90f5c757e09e6c9afee6b99e2e724c7b388924990b1a6f46357e9","src/interface/types/finder.rs":"a27f24e64b5bfc796378d1012b5e72001f0a442e8185fdc4430b106595d4b819","src/interface/types/mod.rs":"25a598fd206975cc1e62aaa269b461654c913ad6c0b6a2719c486acfcc68b45b","src/interface/types/resolver.rs":"7e7ce336ef77c0a6c23deea36856737a97cca9b1c3f5cd0d676fe7df6ade6480","src/lib.rs":"a41b43e3628bb6b3f725580eec255b409947945672887de87c21d5122775a245","src/macro_metadata/ci.rs":"0d6e53d2b5645dd3cc7d196bd3a32ee82c029e1adb9ae93708c27a3fa5c55a88","src/macro_metadata/extract.rs":"ec392692a4601343312f60937987fe460cfb40d2c63a6bb1531fe91903916f10","src/macro_metadata/mod.rs":"1668e6d947fd4a957f557410a8095649de6f8d7fd3eb6a403b8587280dca2d54","src/main.rs":"bbf8e9942d398387e7518533f9b9dc42bfa66156430a87a17605a80a356c0dea","src/scaffolding/mod.rs":"35ae72220843cf3cccefd96e190553e32a5f34ccc58d552fd9165faea12db260","src/scaffolding/templates/CallbackInterfaceTemplate.rs":"3c8caa2e148add8d80701894ee6904fc2d3c5c6424d6d414b36edb6f593b5023","src/scaffolding/templates/EnumTemplate.rs":"eb8802f04f1fd1c9451ad72c1195c136288fdb4e488922b24db75b2fdae65cd7","src/scaffolding/templates/ErrorTemplate.rs":"e7ca4538908a273dd7ba3834219b30fa0e537b2171144f06b6a96fbefb90cd1d","src/scaffolding/templates/ExternalTypesTemplate.rs":"8ecc805cf119abac8c5f60605f9183ee9ec8d37f9ec75bba5e18bb8b482a1abb","src/scaffolding/templates/ObjectTemplate.rs":"34de640428486e17a61ded4f42ce13d8eac3e66cc9f60196ce2575cdc0bd8df6","src/scaffolding/templates/RecordTemplate.rs":"e8d5af954f46f023a243721d6fc70aa176c3a4c0a9dd340048bfe46f3eeed783","src/scaffolding/templates/ReexportUniFFIScaffolding.rs":"559a17c8e39c473ff1effe9651f05b83d443ecd8abed13e03f2b63872d7e1593","src/scaffolding/templates/RustBuffer.rs":"ccf7521012d93c41265375c6d2e80ce861ec93b41383da83c37718386dd726f6","src/scaffolding/templates/TopLevelFunctionTemplate.rs":"35eaefb0862f25ff683d58fb0be6ad5f74bbe2fc85047273200c3a5f4c728434","src/scaffolding/templates/macros.rs":"a41c9690d411074c59fc4609f897431669b9d939625a08f5304a71a88901ba7c","src/scaffolding/templates/scaffolding_template.rs":"3589f8e8e1f9b194ff4a6245665d3a421c771dec3cc947c4264bfcd34573550e"},"package":"5d46080a4840abccf7c0cce21931dae53215cbd7dd969b5e63c486235ce91a2a"} -\ No newline at end of file -diff --git a/third_party/rust/uniffi_bindgen/Cargo.lock b/third_party/rust/uniffi_bindgen/Cargo.lock ---- a/third_party/rust/uniffi_bindgen/Cargo.lock -+++ b/third_party/rust/uniffi_bindgen/Cargo.lock -@@ -2,13 +2,13 @@ - # It is not intended for manual editing. - version = 3 - - [[package]] - name = "anyhow" --version = "1.0.65" -+version = "1.0.66" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602" -+checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" - - [[package]] - name = "askama" - version = "0.11.1" - source = "registry+https://github.com/rust-lang/crates.io-index" -@@ -97,13 +97,13 @@ - source = "registry+https://github.com/rust-lang/crates.io-index" - checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - - [[package]] - name = "clap" --version = "3.2.22" -+version = "3.2.23" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750" -+checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" - dependencies = [ - "atty", - "bitflags", - "clap_derive", - "clap_lex", -@@ -136,13 +136,13 @@ - "os_str_bytes", - ] - - [[package]] - name = "fs-err" --version = "2.8.1" -+version = "2.9.0" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "64db3e262960f0662f43a6366788d5f10f7f244b8f7d7d987f560baf5ded5c50" -+checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" - - [[package]] - name = "goblin" - version = "0.5.4" - source = "registry+https://github.com/rust-lang/crates.io-index" -@@ -174,13 +174,13 @@ - "libc", - ] - - [[package]] - name = "indexmap" --version = "1.9.1" -+version = "1.9.2" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" -+checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" - dependencies = [ - "autocfg", - "hashbrown", - ] - -@@ -190,13 +190,13 @@ - source = "registry+https://github.com/rust-lang/crates.io-index" - checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" - - [[package]] - name = "libc" --version = "0.2.135" -+version = "0.2.138" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" -+checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" - - [[package]] - name = "log" - version = "0.4.17" - source = "registry+https://github.com/rust-lang/crates.io-index" -@@ -243,25 +243,25 @@ - "minimal-lexical", - ] - - [[package]] - name = "once_cell" --version = "1.15.0" -+version = "1.16.0" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" -+checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" - - [[package]] - name = "os_str_bytes" --version = "6.3.0" -+version = "6.4.1" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" -+checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" - - [[package]] - name = "paste" --version = "1.0.9" -+version = "1.0.10" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" -+checksum = "cf1c2c742266c2f1041c914ba65355a83ae8747b05f208319784083583494b4b" - - [[package]] - name = "plain" - version = "0.2.3" - source = "registry+https://github.com/rust-lang/crates.io-index" -@@ -291,13 +291,13 @@ - "version_check", - ] - - [[package]] - name = "proc-macro2" --version = "1.0.46" -+version = "1.0.47" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b" -+checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" - dependencies = [ - "unicode-ident", - ] - - [[package]] -@@ -335,50 +335,56 @@ - "syn", - ] - - [[package]] - name = "serde" --version = "1.0.145" -+version = "1.0.150" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" -+checksum = "e326c9ec8042f1b5da33252c8a37e9ffbd2c9bef0155215b6e6c80c790e05f91" - dependencies = [ - "serde_derive", - ] - - [[package]] - name = "serde_derive" --version = "1.0.145" -+version = "1.0.150" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" -+checksum = "42a3df25b0713732468deadad63ab9da1f1fd75a48a15024b50363f128db627e" - dependencies = [ - "proc-macro2", - "quote", - "syn", - ] - - [[package]] - name = "serde_json" --version = "1.0.86" -+version = "1.0.89" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "41feea4228a6f1cd09ec7a3593a682276702cd67b5273544757dae23c096f074" -+checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" - dependencies = [ - "itoa", - "ryu", - "serde", - ] - - [[package]] -+name = "siphasher" -+version = "0.3.10" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" -+ -+[[package]] - name = "strsim" - version = "0.10.0" - source = "registry+https://github.com/rust-lang/crates.io-index" - checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - - [[package]] - name = "syn" --version = "1.0.102" -+version = "1.0.105" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1" -+checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" - dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", - ] -@@ -392,19 +398,19 @@ - "winapi-util", - ] - - [[package]] - name = "textwrap" --version = "0.15.1" -+version = "0.16.0" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16" -+checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - - [[package]] - name = "toml" --version = "0.5.9" -+version = "0.5.10" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" -+checksum = "1333c76748e868a4d9d1017b5ab53171dfd095f70c712fdb4653a406547f598f" - dependencies = [ - "serde", - ] - - [[package]] -@@ -422,11 +428,11 @@ - source = "registry+https://github.com/rust-lang/crates.io-index" - checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" - - [[package]] - name = "uniffi_bindgen" --version = "0.21.0" -+version = "0.21.1" - dependencies = [ - "anyhow", - "askama", - "bincode", - "camino", -@@ -442,16 +448,28 @@ - "uniffi_meta", - "weedle2", - ] - - [[package]] -+name = "uniffi_checksum_derive" -+version = "0.21.1" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "78b6e16d46caf942016997af8bbdf4b163bf8ae3deb0b667d9643de7b7ffd4c9" -+dependencies = [ -+ "quote", -+ "syn", -+] -+ -+[[package]] - name = "uniffi_meta" --version = "0.21.0" -+version = "0.21.1" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "cd9417cc653937681436b93838d8c5f97a5b8c58697813982ee8810bd1dc3b57" -+checksum = "729835442da829c9b6f7c111c76cf87b2498e129101203bec94f0c39a3296a38" - dependencies = [ - "serde", -+ "siphasher", -+ "uniffi_checksum_derive", - ] - - [[package]] - name = "version_check" - version = "0.9.4" -diff --git a/third_party/rust/uniffi_bindgen/Cargo.toml b/third_party/rust/uniffi_bindgen/Cargo.toml ---- a/third_party/rust/uniffi_bindgen/Cargo.toml -+++ b/third_party/rust/uniffi_bindgen/Cargo.toml -@@ -10,22 +10,21 @@ - # See Cargo.toml.orig for the original contents. - - [package] - edition = "2021" - name = "uniffi_bindgen" --version = "0.21.0" -+version = "0.21.1" - authors = ["Firefox Sync Team "] - description = "a multi-language bindings generator for rust (codegen and cli tooling)" - homepage = "https://mozilla.github.io/uniffi-rs" - documentation = "https://mozilla.github.io/uniffi-rs" - keywords = [ - "ffi", - "bindgen", - ] - license = "MPL-2.0" - repository = "https://github.com/mozilla/uniffi-rs" --resolver = "2" - - [[bin]] - name = "uniffi-bindgen" - path = "src/main.rs" - -@@ -74,9 +73,9 @@ - - [dependencies.toml] - version = "0.5" - - [dependencies.uniffi_meta] --version = "=0.21.0" -+version = "=0.21.1" - - [dependencies.weedle2] - version = "4.0.0" -diff --git a/third_party/rust/uniffi_bindgen/src/interface/attributes.rs b/third_party/rust/uniffi_bindgen/src/interface/attributes.rs ---- a/third_party/rust/uniffi_bindgen/src/interface/attributes.rs -+++ b/third_party/rust/uniffi_bindgen/src/interface/attributes.rs -@@ -13,17 +13,18 @@ - //! We only support a small number of attributes, so it's manageable to have them - //! all handled by a single abstraction. This might need to be refactored in future - //! if we grow significantly more complicated attribute handling. - - use anyhow::{bail, Result}; -+use uniffi_meta::Checksum; - - /// Represents an attribute parsed from UDL, like `[ByRef]` or `[Throws]`. - /// - /// This is a convenience enum for parsing UDL attributes and erroring out if we encounter - /// any unsupported ones. These don't convert directly into parts of a `ComponentInterface`, but - /// may influence the properties of things like functions and arguments. --#[derive(Debug, Clone, Hash)] -+#[derive(Debug, Clone, Checksum)] - pub(super) enum Attribute { - ByRef, - Enum, - Error, - Name(String), -@@ -117,11 +118,11 @@ - Ok(attrs) - } - - /// Attributes that can be attached to an `enum` definition in the UDL. - /// There's only one case here: using `[Error]` to mark an enum as an error class. --#[derive(Debug, Clone, Hash, Default)] -+#[derive(Debug, Clone, Checksum, Default)] - pub(super) struct EnumAttributes(Vec); - - impl EnumAttributes { - pub fn contains_error_attr(&self) -> bool { - self.0.iter().any(|attr| attr.is_error()) -@@ -153,11 +154,11 @@ - - /// Represents UDL attributes that might appear on a function. - /// - /// This supports the `[Throws=ErrorName]` attribute for functions that - /// can produce an error. --#[derive(Debug, Clone, Hash, Default)] -+#[derive(Debug, Clone, Checksum, Default)] - pub(super) struct FunctionAttributes(Vec); - - impl FunctionAttributes { - pub(super) fn get_throws_err(&self) -> Option<&str> { - self.0.iter().find_map(|attr| match attr { -@@ -196,11 +197,11 @@ - - /// Represents UDL attributes that might appear on a function argument. - /// - /// This supports the `[ByRef]` attribute for arguments that should be passed - /// by reference in the generated Rust scaffolding. --#[derive(Debug, Clone, Hash, Default)] -+#[derive(Debug, Clone, Checksum, Default)] - pub(super) struct ArgumentAttributes(Vec); - - impl ArgumentAttributes { - pub fn by_ref(&self) -> bool { - self.0.iter().any(|attr| matches!(attr, Attribute::ByRef)) -@@ -231,11 +232,11 @@ - } - } - } - - /// Represents UDL attributes that might appear on an `interface` definition. --#[derive(Debug, Clone, Hash, Default)] -+#[derive(Debug, Clone, Checksum, Default)] - pub(super) struct InterfaceAttributes(Vec); - - impl InterfaceAttributes { - pub fn contains_enum_attr(&self) -> bool { - self.0.iter().any(|attr| attr.is_enum()) -@@ -285,11 +286,11 @@ - - /// Represents UDL attributes that might appear on a constructor. - /// - /// This supports the `[Throws=ErrorName]` attribute for constructors that can produce - /// an error, and the `[Name=MethodName]` for non-default constructors. --#[derive(Debug, Clone, Hash, Default)] -+#[derive(Debug, Clone, Checksum, Default)] - pub(super) struct ConstructorAttributes(Vec); - - impl ConstructorAttributes { - pub(super) fn get_throws_err(&self) -> Option<&str> { - self.0.iter().find_map(|attr| match attr { -@@ -324,11 +325,11 @@ - - /// Represents UDL attributes that might appear on a method. - /// - /// This supports the `[Throws=ErrorName]` attribute for methods that can produce - /// an error, and the `[Self=ByArc]` attribute for methods that take `Arc` as receiver. --#[derive(Debug, Clone, Hash, Default)] -+#[derive(Debug, Clone, Checksum, Default)] - pub(super) struct MethodAttributes(Vec); - - impl MethodAttributes { - pub(super) fn get_throws_err(&self) -> Option<&str> { - self.0.iter().find_map(|attr| match attr { -@@ -373,11 +374,11 @@ - /// Represents the different possible types of method call receiver. - /// - /// Actually we only support one of these right now, `[Self=ByArc]`. - /// We might add more in future, e.g. a `[Self=ByRef]` if there are cases - /// where we need to force the receiver to be taken by reference. --#[derive(Debug, Clone, Hash)] -+#[derive(Debug, Clone, Checksum)] - pub(super) enum SelfType { - ByArc, // Method receiver is `Arc`. - } - - impl TryFrom<&weedle::attribute::IdentifierOrString<'_>> for SelfType { -@@ -396,11 +397,11 @@ - } - - /// Represents UDL attributes that might appear on a typedef - /// - /// This supports the `[External="crate_name"]` and `[Custom]` attributes for types. --#[derive(Debug, Clone, Hash, Default)] -+#[derive(Debug, Clone, Checksum, Default)] - pub(super) struct TypedefAttributes(Vec); - - impl TypedefAttributes { - pub(super) fn get_crate_name(&self) -> String { - self.0 -diff --git a/third_party/rust/uniffi_bindgen/src/interface/callbacks.rs b/third_party/rust/uniffi_bindgen/src/interface/callbacks.rs ---- a/third_party/rust/uniffi_bindgen/src/interface/callbacks.rs -+++ b/third_party/rust/uniffi_bindgen/src/interface/callbacks.rs -@@ -31,23 +31,29 @@ - //! assert_eq!(callback.name(), "Example"); - //! assert_eq!(callback.methods()[0].name(), "hello"); - //! # Ok::<(), anyhow::Error>(()) - //! ``` - --use std::hash::{Hash, Hasher}; -- - use anyhow::{bail, Result}; -+use uniffi_meta::Checksum; - - use super::ffi::{FFIArgument, FFIFunction, FFIType}; - use super::object::Method; - use super::types::{Type, TypeIterator}; - use super::{APIConverter, ComponentInterface}; - --#[derive(Debug, Clone)] -+#[derive(Debug, Clone, Checksum)] - pub struct CallbackInterface { - pub(super) name: String, - pub(super) methods: Vec, -+ // We don't include the FFIFunc in the hash calculation, because: -+ // - it is entirely determined by the other fields, -+ // so excluding it is safe. -+ // - its `name` property includes a checksum derived from the very -+ // hash value we're trying to calculate here, so excluding it -+ // avoids a weird circular depenendency in the calculation. -+ #[checksum_ignore] - pub(super) ffi_init_callback: FFIFunction, - } - - impl CallbackInterface { - fn new(name: String) -> CallbackInterface { -@@ -86,23 +92,10 @@ - pub fn iter_types(&self) -> TypeIterator<'_> { - Box::new(self.methods.iter().flat_map(Method::iter_types)) - } - } - --impl Hash for CallbackInterface { -- fn hash(&self, state: &mut H) { -- // We don't include the FFIFunc in the hash calculation, because: -- // - it is entirely determined by the other fields, -- // so excluding it is safe. -- // - its `name` property includes a checksum derived from the very -- // hash value we're trying to calculate here, so excluding it -- // avoids a weird circular depenendency in the calculation. -- self.name.hash(state); -- self.methods.hash(state); -- } --} -- - impl APIConverter for weedle::CallbackInterfaceDefinition<'_> { - fn convert(&self, ci: &mut ComponentInterface) -> Result { - if self.attributes.is_some() { - bail!("callback interface attributes are not supported yet"); - } -diff --git a/third_party/rust/uniffi_bindgen/src/interface/enum_.rs b/third_party/rust/uniffi_bindgen/src/interface/enum_.rs ---- a/third_party/rust/uniffi_bindgen/src/interface/enum_.rs -+++ b/third_party/rust/uniffi_bindgen/src/interface/enum_.rs -@@ -75,21 +75,22 @@ - //! assert_eq!(e.variants()[1].fields()[0].name(), "first"); - //! # Ok::<(), anyhow::Error>(()) - //! ``` - - use anyhow::{bail, Result}; -+use uniffi_meta::Checksum; - - use super::record::Field; - use super::types::{Type, TypeIterator}; - use super::{APIConverter, ComponentInterface}; - - /// Represents an enum with named variants, each of which may have named - /// and typed fields. - /// - /// Enums are passed across the FFI by serializing to a bytebuffer, with a - /// i32 indicating the variant followed by the serialization of each field. --#[derive(Debug, Clone, Hash)] -+#[derive(Debug, Clone, Checksum)] - pub struct Enum { - pub(super) name: String, - pub(super) variants: Vec, - // "Flat" enums do not have, and will never have, variants with associated data. - pub(super) flat: bool, -@@ -172,11 +173,11 @@ - } - - /// Represents an individual variant in an Enum. - /// - /// Each variant has a name and zero or more fields. --#[derive(Debug, Clone, Default, Hash)] -+#[derive(Debug, Clone, Default, Checksum)] - pub struct Variant { - pub(super) name: String, - pub(super) fields: Vec, - } - -diff --git a/third_party/rust/uniffi_bindgen/src/interface/error.rs b/third_party/rust/uniffi_bindgen/src/interface/error.rs ---- a/third_party/rust/uniffi_bindgen/src/interface/error.rs -+++ b/third_party/rust/uniffi_bindgen/src/interface/error.rs -@@ -81,10 +81,11 @@ - //! assert_eq!(err.is_flat(), false); - //! # Ok::<(), anyhow::Error>(()) - //! ``` - - use anyhow::Result; -+use uniffi_meta::Checksum; - - use super::enum_::{Enum, Variant}; - use super::types::{Type, TypeIterator}; - use super::{APIConverter, ComponentInterface}; - -@@ -92,11 +93,11 @@ - /// - /// Errors are represented in the UDL as enums with the special `[Error]` attribute, but - /// they're handled in the FFI very differently. We create them in `uniffi::call_with_result()` if - /// the wrapped function returns an `Err` value - /// struct and assign an integer error code to each variant. --#[derive(Debug, Clone, Hash)] -+#[derive(Debug, Clone, Checksum)] - pub struct Error { - pub name: String, - enum_: Enum, - } - -diff --git a/third_party/rust/uniffi_bindgen/src/interface/function.rs b/third_party/rust/uniffi_bindgen/src/interface/function.rs ---- a/third_party/rust/uniffi_bindgen/src/interface/function.rs -+++ b/third_party/rust/uniffi_bindgen/src/interface/function.rs -@@ -30,13 +30,13 @@ - //! assert!(matches!(func.return_type(), Some(Type::String))); - //! assert_eq!(func.arguments().len(), 0); - //! # Ok::<(), anyhow::Error>(()) - //! ``` - use std::convert::TryFrom; --use std::hash::{Hash, Hasher}; - - use anyhow::{bail, Result}; -+use uniffi_meta::Checksum; - - use super::ffi::{FFIArgument, FFIFunction}; - use super::literal::{convert_default_value, Literal}; - use super::types::{Type, TypeIterator}; - use super::{ -@@ -49,15 +49,22 @@ - /// - /// Each `Function` corresponds to a standalone function in the rust module, - /// and has a corresponding standalone function in the foreign language bindings. - /// - /// In the FFI, this will be a standalone function with appropriately lowered types. --#[derive(Debug, Clone)] -+#[derive(Debug, Clone, Checksum)] - pub struct Function { - pub(super) name: String, - pub(super) arguments: Vec, - pub(super) return_type: Option, -+ // We don't include the FFIFunc in the hash calculation, because: -+ // - it is entirely determined by the other fields, -+ // so excluding it is safe. -+ // - its `name` property includes a checksum derived from the very -+ // hash value we're trying to calculate here, so excluding it -+ // avoids a weird circular depenendency in the calculation. -+ #[checksum_ignore] - pub(super) ffi_func: FFIFunction, - pub(super) attributes: FunctionAttributes, - } - - impl Function { -@@ -140,25 +147,10 @@ - attributes: Default::default(), - } - } - } - --impl Hash for Function { -- fn hash(&self, state: &mut H) { -- // We don't include the FFIFunc in the hash calculation, because: -- // - it is entirely determined by the other fields, -- // so excluding it is safe. -- // - its `name` property includes a checksum derived from the very -- // hash value we're trying to calculate here, so excluding it -- // avoids a weird circular depenendency in the calculation. -- self.name.hash(state); -- self.arguments.hash(state); -- self.return_type.hash(state); -- self.attributes.hash(state); -- } --} -- - impl APIConverter for weedle::namespace::NamespaceMember<'_> { - fn convert(&self, ci: &mut ComponentInterface) -> Result { - match self { - weedle::namespace::NamespaceMember::Operation(f) => f.convert(ci), - _ => bail!("no support for namespace member type {:?} yet", self), -@@ -183,11 +175,11 @@ - } - - /// Represents an argument to a function/constructor/method call. - /// - /// Each argument has a name and a type, along with some optional metadata. --#[derive(Debug, Clone, Hash)] -+#[derive(Debug, Clone, Checksum)] - pub struct Argument { - pub(super) name: String, - pub(super) type_: Type, - pub(super) by_ref: bool, - pub(super) optional: bool, -diff --git a/third_party/rust/uniffi_bindgen/src/interface/literal.rs b/third_party/rust/uniffi_bindgen/src/interface/literal.rs ---- a/third_party/rust/uniffi_bindgen/src/interface/literal.rs -+++ b/third_party/rust/uniffi_bindgen/src/interface/literal.rs -@@ -6,16 +6,17 @@ - //! - //! This module provides support for interpreting literal values from the UDL, - //! which appear in places such as default arguments. - - use anyhow::{bail, Result}; -+use uniffi_meta::Checksum; - - use super::types::Type; - - // Represents a literal value. - // Used for e.g. default argument values. --#[derive(Debug, Clone, Hash)] -+#[derive(Debug, Clone, Checksum)] - pub enum Literal { - Boolean(bool), - String(String), - // Integers are represented as the widest representation we can. - // Number formatting vary with language and radix, so we avoid a lot of parsing and -@@ -33,11 +34,11 @@ - Null, - } - - // Represent the radix of integer literal values. - // We preserve the radix into the generated bindings for readability reasons. --#[derive(Debug, Clone, Copy, Hash)] -+#[derive(Debug, Clone, Copy, Checksum)] - pub enum Radix { - Decimal = 10, - Octal = 8, - Hexadecimal = 16, - } -diff --git a/third_party/rust/uniffi_bindgen/src/interface/mod.rs b/third_party/rust/uniffi_bindgen/src/interface/mod.rs ---- a/third_party/rust/uniffi_bindgen/src/interface/mod.rs -+++ b/third_party/rust/uniffi_bindgen/src/interface/mod.rs -@@ -42,16 +42,11 @@ - //! a good opportunity here for e.g. interned strings, but we're nowhere near the point were we need - //! that kind of optimization just yet. - //! - //! * Error messages and general developer experience leave a lot to be desired. - --use std::{ -- collections::HashSet, -- convert::TryFrom, -- hash::{Hash, Hasher}, -- iter, --}; -+use std::{collections::HashSet, convert::TryFrom, iter}; - - use anyhow::{bail, Result}; - - pub mod types; - pub use types::Type; -@@ -75,26 +70,30 @@ - mod record; - pub use record::{Field, Record}; - - pub mod ffi; - pub use ffi::{FFIArgument, FFIFunction, FFIType}; --use uniffi_meta::{MethodMetadata, ObjectMetadata}; -+use uniffi_meta::{Checksum, MethodMetadata, ObjectMetadata}; - - /// The main public interface for this module, representing the complete details of an interface exposed - /// by a rust component and the details of consuming it via an extern-C FFI layer. - /// --#[derive(Debug, Default)] -+#[derive(Debug, Default, Checksum)] - pub struct ComponentInterface { - /// Every ComponentInterface gets tagged with the version of uniffi used to create it. - /// This helps us avoid using a lib compiled with one version together with bindings created - /// using a different version, which might introduce unsafety. - uniffi_version: String, - /// All of the types used in the interface. -+ // We can't checksum `self.types`, but its contents are implied by the other fields -+ // anyway, so it's safe to ignore it. -+ #[checksum_ignore] - pub(super) types: TypeUniverse, - /// The unique prefix that we'll use for namespacing when exposing this component's API. - namespace: String, - /// The internal unique prefix used to namespace FFI symbols -+ #[checksum_ignore] - ffi_namespace: String, - /// The high-level API provided by the component. - enums: Vec, - records: Vec, - functions: Vec, -@@ -105,11 +104,11 @@ - - impl ComponentInterface { - /// Parse a `ComponentInterface` from a string containing a WebIDL definition. - pub fn from_webidl(idl: &str) -> Result { - let mut ci = Self { -- uniffi_version: env!("CARGO_PKG_VERSION").to_string(), -+ uniffi_version: "0.21.0".to_string(), - ..Default::default() - }; - // There's some lifetime thing with the errors returned from weedle::Definitions::parse - // that my own lifetime is too short to worry about figuring out; unwrap and move on. - -@@ -319,20 +318,12 @@ - /// and the same version of Rust, will always have the same checksum value. - /// - Two ComponentInterfaces will, with high probability, have different checksum values if: - /// - They were generated from two different WebIDL files. - /// - They were generated by two different versions of uniffi - /// -- /// The checksum may or may not change depending on the version of Rust used; since we expect -- /// consumers to be using the same executable to generate both the scaffolding and the bindings, -- /// assuming the same version of Rust seems acceptable. -- /// - /// Note that this is designed to prevent accidents, not attacks, so there is no need for the - /// checksum to be cryptographically secure. -- /// -- /// TODO: it's not clear to me if the derivation of `Hash` is actually deterministic enough to -- /// ensure the guarantees above, or if it might be sensitive to e.g. compiler-driven re-ordering -- /// of struct field. Let's see how it goes... - pub fn checksum(&self) -> u16 { - uniffi_meta::checksum(self) - } - - /// The namespace to use in FFI-level function definitions. -@@ -670,27 +661,10 @@ - } - Ok(()) - } - } - --/// `ComponentInterface` structs can be hashed, but this is mostly a convenient way to --/// produce a checksum of their contents. They're not really intended to live in a hashtable. --impl Hash for ComponentInterface { -- fn hash(&self, state: &mut H) { -- // We can't hash `self.types`, but its contents are implied by the other fields -- // anyway, so it's safe to ignore it. -- self.uniffi_version.hash(state); -- self.namespace.hash(state); -- self.enums.hash(state); -- self.records.hash(state); -- self.functions.hash(state); -- self.objects.hash(state); -- self.callback_interfaces.hash(state); -- self.errors.hash(state); -- } --} -- - fn get_or_insert_object<'a>(objects: &'a mut Vec, name: &str) -> &'a mut Object { - // The find-based way of writing this currently runs into a borrow checker - // error, so we use position - match objects.iter_mut().position(|o| o.name == name) { - Some(idx) => &mut objects[idx], -diff --git a/third_party/rust/uniffi_bindgen/src/interface/object.rs b/third_party/rust/uniffi_bindgen/src/interface/object.rs ---- a/third_party/rust/uniffi_bindgen/src/interface/object.rs -+++ b/third_party/rust/uniffi_bindgen/src/interface/object.rs -@@ -56,14 +56,14 @@ - //! assert_eq!(obj.constructors().len(), 0); - //! # Ok::<(), anyhow::Error>(()) - //! ``` - - use std::convert::TryFrom; --use std::hash::{Hash, Hasher}; - use std::{collections::HashSet, iter}; - - use anyhow::{bail, Result}; -+use uniffi_meta::Checksum; - - use super::ffi::{FFIArgument, FFIFunction, FFIType}; - use super::function::Argument; - use super::types::{Type, TypeIterator}; - use super::{ -@@ -84,16 +84,24 @@ - /// binding code is expected to stitch these functions back together into an appropriate class - /// definition (or that language's equivalent thereof). - /// - /// TODO: - /// - maybe "Class" would be a better name than "Object" here? --#[derive(Debug, Clone)] -+#[derive(Debug, Clone, Checksum)] - pub struct Object { - pub(super) name: String, - pub(super) constructors: Vec, - pub(super) methods: Vec, -+ // We don't include the FFIFunc in the hash calculation, because: -+ // - it is entirely determined by the other fields, -+ // so excluding it is safe. -+ // - its `name` property includes a checksum derived from the very -+ // hash value we're trying to calculate here, so excluding it -+ // avoids a weird circular depenendency in the calculation. -+ #[checksum_ignore] - pub(super) ffi_func_free: FFIFunction, -+ #[checksum_ignore] - pub(super) uses_deprecated_threadsafe_attribute: bool, - } - - impl Object { - pub(super) fn new(name: String) -> Object { -@@ -188,24 +196,10 @@ - .flatten(), - ) - } - } - --impl Hash for Object { -- fn hash(&self, state: &mut H) { -- // We don't include the FFIFunc in the hash calculation, because: -- // - it is entirely determined by the other fields, -- // so excluding it is safe. -- // - its `name` property includes a checksum derived from the very -- // hash value we're trying to calculate here, so excluding it -- // avoids a weird circular depenendency in the calculation. -- self.name.hash(state); -- self.constructors.hash(state); -- self.methods.hash(state); -- } --} -- - impl APIConverter for weedle::InterfaceDefinition<'_> { - fn convert(&self, ci: &mut ComponentInterface) -> Result { - if self.inheritance.is_some() { - bail!("interface inheritence is not supported"); - } -@@ -243,14 +237,21 @@ - - // Represents a constructor for an object type. - // - // In the FFI, this will be a function that returns a pointer to an instance - // of the corresponding object type. --#[derive(Debug, Clone)] -+#[derive(Debug, Clone, Checksum)] - pub struct Constructor { - pub(super) name: String, - pub(super) arguments: Vec, -+ // We don't include the FFIFunc in the hash calculation, because: -+ // - it is entirely determined by the other fields, -+ // so excluding it is safe. -+ // - its `name` property includes a checksum derived from the very -+ // hash value we're trying to calculate here, so excluding it -+ // avoids a weird circular depenendency in the calculation. -+ #[checksum_ignore] - pub(super) ffi_func: FFIFunction, - pub(super) attributes: ConstructorAttributes, - } - - impl Constructor { -@@ -297,24 +298,10 @@ - pub fn iter_types(&self) -> TypeIterator<'_> { - Box::new(self.arguments.iter().flat_map(Argument::iter_types)) - } - } - --impl Hash for Constructor { -- fn hash(&self, state: &mut H) { -- // We don't include the FFIFunc in the hash calculation, because: -- // - it is entirely determined by the other fields, -- // so excluding it is safe. -- // - its `name` property includes a checksum derived from the very -- // hash value we're trying to calculate here, so excluding it -- // avoids a weird circular depenendency in the calculation. -- self.name.hash(state); -- self.arguments.hash(state); -- self.attributes.hash(state); -- } --} -- - impl Default for Constructor { - fn default() -> Self { - Constructor { - name: String::from("new"), - arguments: Vec::new(), -@@ -341,16 +328,23 @@ - - // Represents an instance method for an object type. - // - // The FFI will represent this as a function whose first/self argument is a - // `FFIType::RustArcPtr` to the instance. --#[derive(Debug, Clone)] -+#[derive(Debug, Clone, Checksum)] - pub struct Method { - pub(super) name: String, - pub(super) object_name: String, -+ pub(super) arguments: Vec, - pub(super) return_type: Option, -- pub(super) arguments: Vec, -+ // We don't include the FFIFunc in the hash calculation, because: -+ // - it is entirely determined by the other fields, -+ // so excluding it is safe. -+ // - its `name` property includes a checksum derived from the very -+ // hash value we're trying to calculate here, so excluding it -+ // avoids a weird circular depenendency in the calculation. -+ #[checksum_ignore] - pub(super) ffi_func: FFIFunction, - pub(super) attributes: MethodAttributes, - } - - impl Method { -@@ -448,26 +442,10 @@ - attributes: Default::default(), - } - } - } - --impl Hash for Method { -- fn hash(&self, state: &mut H) { -- // We don't include the FFIFunc in the hash calculation, because: -- // - it is entirely determined by the other fields, -- // so excluding it is safe. -- // - its `name` property includes a checksum derived from the very -- // hash value we're trying to calculate here, so excluding it -- // avoids a weird circular depenendency in the calculation. -- self.name.hash(state); -- self.object_name.hash(state); -- self.arguments.hash(state); -- self.return_type.hash(state); -- self.attributes.hash(state); -- } --} -- - impl APIConverter for weedle::interface::OperationInterfaceMember<'_> { - fn convert(&self, ci: &mut ComponentInterface) -> Result { - if self.special.is_some() { - bail!("special operations not supported"); - } -diff --git a/third_party/rust/uniffi_bindgen/src/interface/record.rs b/third_party/rust/uniffi_bindgen/src/interface/record.rs ---- a/third_party/rust/uniffi_bindgen/src/interface/record.rs -+++ b/third_party/rust/uniffi_bindgen/src/interface/record.rs -@@ -43,10 +43,11 @@ - //! assert_eq!(record.fields()[1].name(), "value"); - //! # Ok::<(), anyhow::Error>(()) - //! ``` - - use anyhow::{bail, Result}; -+use uniffi_meta::Checksum; - - use super::types::{Type, TypeIterator}; - use super::{ - convert_type, - literal::{convert_default_value, Literal}, -@@ -56,11 +57,11 @@ - /// Represents a "data class" style object, for passing around complex values. - /// - /// In the FFI these are represented as a byte buffer, which one side explicitly - /// serializes the data into and the other serializes it out of. So I guess they're - /// kind of like "pass by clone" values. --#[derive(Debug, Clone, Hash)] -+#[derive(Debug, Clone, Checksum)] - pub struct Record { - pub(super) name: String, - pub(super) fields: Vec, - } - -@@ -107,11 +108,11 @@ - }) - } - } - - // Represents an individual field on a Record. --#[derive(Debug, Clone, Hash)] -+#[derive(Debug, Clone, Checksum)] - pub struct Field { - pub(super) name: String, - pub(super) type_: Type, - pub(super) required: bool, - pub(super) default: Option, -diff --git a/third_party/rust/uniffi_bindgen/src/interface/types/mod.rs b/third_party/rust/uniffi_bindgen/src/interface/types/mod.rs ---- a/third_party/rust/uniffi_bindgen/src/interface/types/mod.rs -+++ b/third_party/rust/uniffi_bindgen/src/interface/types/mod.rs -@@ -23,10 +23,11 @@ - - use std::{collections::hash_map::Entry, collections::BTreeSet, collections::HashMap, iter}; - - use anyhow::{bail, Result}; - use heck::ToUpperCamelCase; -+use uniffi_meta::Checksum; - - use super::ffi::FFIType; - - mod finder; - pub(super) use finder::TypeFinder; -@@ -34,11 +35,11 @@ - pub(super) use resolver::{resolve_builtin_type, TypeResolver}; - - /// Represents all the different high-level types that can be used in a component interface. - /// At this level we identify user-defined types by name, without knowing any details - /// of their internal structure apart from what type of thing they are (record, enum, etc). --#[derive(Debug, Clone, Eq, PartialEq, Hash, Ord, PartialOrd)] -+#[derive(Debug, Clone, Eq, PartialEq, Checksum, Ord, PartialOrd)] - pub enum Type { - // Primitive types. - UInt8, - Int8, - UInt16, -diff --git a/third_party/rust/uniffi_build/.cargo-checksum.json b/third_party/rust/uniffi_build/.cargo-checksum.json ---- a/third_party/rust/uniffi_build/.cargo-checksum.json -+++ b/third_party/rust/uniffi_build/.cargo-checksum.json -@@ -1 +1 @@ --{"files":{"Cargo.toml":"bf9105f53978ecdccad9a75fc3645f97982d3c4162a5a9b49ab16554162b51c1","src/lib.rs":"485a0c0ab99077a1d4037f4deec9801e87a248196e7589a002556fb84973528a"},"package":"510287c368a9386eb731ebe824a6fc6c82a105e20d020af1aa20519c1c1561db"} -\ No newline at end of file -+{"files":{"Cargo.toml":"30736876caf953bd0040b6c0fc824744556bf52fe23d656c7d01442d4c180674","src/lib.rs":"485a0c0ab99077a1d4037f4deec9801e87a248196e7589a002556fb84973528a"},"package":"d035e50433ee3d52ab0dcdcf3b9b26f2cc2ec39294b3c07d95865a518709455f"} -\ No newline at end of file -diff --git a/third_party/rust/uniffi_build/Cargo.toml b/third_party/rust/uniffi_build/Cargo.toml ---- a/third_party/rust/uniffi_build/Cargo.toml -+++ b/third_party/rust/uniffi_build/Cargo.toml -@@ -10,31 +10,30 @@ - # See Cargo.toml.orig for the original contents. - - [package] - edition = "2021" - name = "uniffi_build" --version = "0.21.0" -+version = "0.21.1" - authors = ["Firefox Sync Team "] - description = "a multi-language bindings generator for rust (build script helpers)" - homepage = "https://mozilla.github.io/uniffi-rs" - documentation = "https://mozilla.github.io/uniffi-rs" - keywords = [ - "ffi", - "bindgen", - ] - license = "MPL-2.0" - repository = "https://github.com/mozilla/uniffi-rs" --resolver = "2" - - [dependencies.anyhow] - version = "1" - - [dependencies.camino] - version = "1.0.8" - - [dependencies.uniffi_bindgen] --version = "=0.21.0" -+version = "=0.21.1" - optional = true - - [features] - builtin-bindgen = ["uniffi_bindgen"] - default = [] -diff --git a/third_party/rust/uniffi_checksum_derive/.cargo-checksum.json b/third_party/rust/uniffi_checksum_derive/.cargo-checksum.json -new file mode 100644 ---- /dev/null -+++ b/third_party/rust/uniffi_checksum_derive/.cargo-checksum.json -@@ -0,0 +1 @@ -+{"files":{"Cargo.toml":"2ab3c60724c4c504297f8876bf0a8d1291f76a2fc46f5e83634aa147e89ffc71","src/lib.rs":"c68c69a1cf6a69e5fe78f7b069364a265c5bb6ce8c0abf0b5745eca01c79604a"},"package":"78b6e16d46caf942016997af8bbdf4b163bf8ae3deb0b667d9643de7b7ffd4c9"} -\ No newline at end of file -diff --git a/third_party/rust/uniffi_checksum_derive/Cargo.toml b/third_party/rust/uniffi_checksum_derive/Cargo.toml -new file mode 100644 ---- /dev/null -+++ b/third_party/rust/uniffi_checksum_derive/Cargo.toml -@@ -0,0 +1,42 @@ -+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO -+# -+# When uploading crates to the registry Cargo will automatically -+# "normalize" Cargo.toml files for maximal compatibility -+# with all versions of Cargo and also rewrite `path` dependencies -+# to registry (e.g., crates.io) dependencies. -+# -+# If you are reading this file be aware that the original Cargo.toml -+# will likely look very different (and much more reasonable). -+# See Cargo.toml.orig for the original contents. -+ -+[package] -+edition = "2021" -+name = "uniffi_checksum_derive" -+version = "0.21.1" -+authors = ["Firefox Sync Team "] -+description = "a multi-language bindings generator for rust (checksum custom derive)" -+homepage = "https://mozilla.github.io/uniffi-rs" -+documentation = "https://mozilla.github.io/uniffi-rs" -+keywords = [ -+ "ffi", -+ "bindgen", -+] -+license = "MPL-2.0" -+repository = "https://github.com/mozilla/uniffi-rs" -+ -+[lib] -+proc-macro = true -+ -+[dependencies.quote] -+version = "1.0" -+ -+[dependencies.syn] -+version = "1.0" -+features = [ -+ "derive", -+ "parsing", -+] -+ -+[features] -+default = [] -+nightly = [] -diff --git a/third_party/rust/uniffi_checksum_derive/src/lib.rs b/third_party/rust/uniffi_checksum_derive/src/lib.rs -new file mode 100644 ---- /dev/null -+++ b/third_party/rust/uniffi_checksum_derive/src/lib.rs -@@ -0,0 +1,134 @@ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+#![cfg_attr(feature = "nightly", feature(proc_macro_expand))] -+ -+//! Custom derive for uniffi_meta::Checksum -+ -+use proc_macro::TokenStream; -+use quote::{format_ident, quote}; -+use syn::{parse_macro_input, Attribute, Data, DeriveInput, Expr, ExprLit, Fields, Index, Lit}; -+ -+fn has_ignore_attribute(attrs: &[Attribute]) -> bool { -+ attrs.iter().any(|attr| { -+ if attr.path.is_ident("checksum_ignore") { -+ if !attr.tokens.is_empty() { -+ panic!("#[checksum_ignore] doesn't accept extra information"); -+ } -+ true -+ } else { -+ false -+ } -+ }) -+} -+ -+#[proc_macro_derive(Checksum, attributes(checksum_ignore))] -+pub fn checksum_derive(input: TokenStream) -> TokenStream { -+ let input: DeriveInput = parse_macro_input!(input); -+ -+ let name = input.ident; -+ -+ let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); -+ -+ let code = match input.data { -+ Data::Enum(enum_) -+ if enum_.variants.len() == 1 -+ && enum_ -+ .variants -+ .iter() -+ .all(|variant| matches!(variant.fields, Fields::Unit)) => -+ { -+ quote!() -+ } -+ Data::Enum(enum_) => { -+ let mut next_discriminant = 0u64; -+ let match_inner = enum_.variants.iter().map(|variant| { -+ let ident = &variant.ident; -+ if has_ignore_attribute(&variant.attrs) { -+ panic!("#[checksum_ignore] is not supported in enums"); -+ } -+ match &variant.discriminant { -+ Some((_, Expr::Lit(ExprLit { lit: Lit::Int(value), .. }))) => { -+ next_discriminant = value.base10_parse::().unwrap(); -+ } -+ Some(_) => { -+ panic!("#[derive(Checksum)] doesn't support non-numeric explicit discriminants in enums"); -+ } -+ None => {} -+ } -+ let discriminant = quote! { state.write(&#next_discriminant.to_le_bytes()) }; -+ next_discriminant += 1; -+ match &variant.fields { -+ Fields::Unnamed(fields) => { -+ let field_idents = fields -+ .unnamed -+ .iter() -+ .enumerate() -+ .map(|(num, _)| format_ident!("__self_{}", num)); -+ let field_stmts = field_idents -+ .clone() -+ .map(|ident| quote! { Checksum::checksum(#ident, state); }); -+ quote! { -+ Self::#ident(#(#field_idents,)*) => { -+ #discriminant; -+ #(#field_stmts)* -+ } -+ } -+ } -+ Fields::Named(fields) => { -+ let field_idents = fields -+ .named -+ .iter() -+ .map(|field| field.ident.as_ref().unwrap()); -+ let field_stmts = field_idents -+ .clone() -+ .map(|ident| quote! { Checksum::checksum(#ident, state); }); -+ quote! { -+ Self::#ident { #(#field_idents,)* } => { -+ #discriminant; -+ #(#field_stmts)* -+ } -+ } -+ } -+ Fields::Unit => quote! { Self::#ident => #discriminant, }, -+ } -+ }); -+ quote! { -+ match self { -+ #(#match_inner)* -+ } -+ } -+ } -+ Data::Struct(struct_) => { -+ let stmts = struct_ -+ .fields -+ .iter() -+ .enumerate() -+ .filter_map(|(num, field)| { -+ (!has_ignore_attribute(&field.attrs)).then(|| match field.ident.as_ref() { -+ Some(ident) => quote! { Checksum::checksum(&self.#ident, state); }, -+ None => { -+ let i = Index::from(num); -+ quote! { Checksum::checksum(&self.#i, state); } -+ } -+ }) -+ }); -+ quote! { -+ #(#stmts)* -+ } -+ } -+ Data::Union(_) => { -+ panic!("#[derive(Checksum)] is not supported for unions"); -+ } -+ }; -+ -+ quote! { -+ #[automatically_derived] -+ impl #impl_generics Checksum for #name #ty_generics #where_clause { -+ fn checksum<__H: ::core::hash::Hasher>(&self, state: &mut __H) { -+ #code -+ } -+ } -+ } -+ .into() -+} -diff --git a/third_party/rust/uniffi_macros/.cargo-checksum.json b/third_party/rust/uniffi_macros/.cargo-checksum.json ---- a/third_party/rust/uniffi_macros/.cargo-checksum.json -+++ b/third_party/rust/uniffi_macros/.cargo-checksum.json -@@ -1 +1 @@ --{"files":{"Cargo.toml":"55f7e114dd34b0c60b58890120f8707601a5401e9d49d42a239b03da2e660d4f","src/export.rs":"e23929cf6fb5542d29514fe668f3b3d836fad968eacd9c6fcba74c5cd9cf2b61","src/export/metadata.rs":"af89a9942c7c0c4043a3cd57d1e6bd71cde19005e1f9f246efac761f47eff6be","src/export/metadata/convert.rs":"81060fb3390165d77db021f44142a2f3f10882515f859d7393857083370f2d35","src/export/metadata/function.rs":"11833cabd37e7671c0a01944bec73b8892a15df814bbe4c26fdae57aad89a2ba","src/export/metadata/impl_.rs":"ecfdaa132f05dd946414281e52165ef19c90c0bfd76ec651d4ec86837bd41d1c","src/export/scaffolding.rs":"66939405063e56fc983126f249e2d7ddc3257cb045a738abd0cf813a4aafc59c","src/lib.rs":"ca77b437a58cfb3ddeb106d3c1c8378545c46ef241298e62ab1190c5136d1fb1","src/object.rs":"955b596f344304013692042bdc1760bbb1192ec33950b0dd2932cb8de94ec297","src/record.rs":"67a5c7ed6a448f7ad8f5c8e930c5e3007b2b0cac32f52cc8596bdae6fb3c816e","src/util.rs":"6389a9b4258808a3af168cf85658fb7c069172d5e528ee0e94210fa664f2a414"},"package":"5c8604503caa2cbcf271578dc51ca236d40e3b22e1514ffa2e638e2c39f6ad10"} -\ No newline at end of file -+{"files":{"Cargo.toml":"6511b493b676ac3941d70477c91abec62642c3c9aab088ecdf4f733eef3f1faa","src/export.rs":"e23929cf6fb5542d29514fe668f3b3d836fad968eacd9c6fcba74c5cd9cf2b61","src/export/metadata.rs":"af89a9942c7c0c4043a3cd57d1e6bd71cde19005e1f9f246efac761f47eff6be","src/export/metadata/convert.rs":"81060fb3390165d77db021f44142a2f3f10882515f859d7393857083370f2d35","src/export/metadata/function.rs":"11833cabd37e7671c0a01944bec73b8892a15df814bbe4c26fdae57aad89a2ba","src/export/metadata/impl_.rs":"ecfdaa132f05dd946414281e52165ef19c90c0bfd76ec651d4ec86837bd41d1c","src/export/scaffolding.rs":"66939405063e56fc983126f249e2d7ddc3257cb045a738abd0cf813a4aafc59c","src/lib.rs":"ca77b437a58cfb3ddeb106d3c1c8378545c46ef241298e62ab1190c5136d1fb1","src/object.rs":"955b596f344304013692042bdc1760bbb1192ec33950b0dd2932cb8de94ec297","src/record.rs":"67a5c7ed6a448f7ad8f5c8e930c5e3007b2b0cac32f52cc8596bdae6fb3c816e","src/util.rs":"6389a9b4258808a3af168cf85658fb7c069172d5e528ee0e94210fa664f2a414"},"package":"c96a574677566f83ea8458dac1dd7792fd63e7c3f9dbcd865f0e8d6f8057b127"} -\ No newline at end of file -diff --git a/third_party/rust/uniffi_macros/Cargo.toml b/third_party/rust/uniffi_macros/Cargo.toml ---- a/third_party/rust/uniffi_macros/Cargo.toml -+++ b/third_party/rust/uniffi_macros/Cargo.toml -@@ -10,22 +10,21 @@ - # See Cargo.toml.orig for the original contents. - - [package] - edition = "2021" - name = "uniffi_macros" --version = "0.21.0" -+version = "0.21.1" - authors = ["Firefox Sync Team "] - description = "a multi-language bindings generator for rust (convenience macros)" - homepage = "https://mozilla.github.io/uniffi-rs" - documentation = "https://mozilla.github.io/uniffi-rs" - keywords = [ - "ffi", - "bindgen", - ] - license = "MPL-2.0" - repository = "https://github.com/mozilla/uniffi-rs" --resolver = "2" - - [lib] - proc-macro = true - - [dependencies.bincode] -@@ -58,14 +57,14 @@ - - [dependencies.toml] - version = "0.5.9" - - [dependencies.uniffi_build] --version = "=0.21.0" -+version = "=0.21.1" - - [dependencies.uniffi_meta] --version = "=0.21.0" -+version = "=0.21.1" - - [features] - builtin-bindgen = ["uniffi_build/builtin-bindgen"] - default = [] - nightly = [] -diff --git a/third_party/rust/uniffi_meta/.cargo-checksum.json b/third_party/rust/uniffi_meta/.cargo-checksum.json ---- a/third_party/rust/uniffi_meta/.cargo-checksum.json -+++ b/third_party/rust/uniffi_meta/.cargo-checksum.json -@@ -1 +1 @@ --{"files":{"Cargo.toml":"4a474782b3acac7e99435c0cfc6cd4790817ee5c15980b10dc927d95795b977f","src/lib.rs":"dc4c91763c01e8c09ef55cdb103bc02c7aba71c5660ba88f776a8a03a747d6e8"},"package":"cd9417cc653937681436b93838d8c5f97a5b8c58697813982ee8810bd1dc3b57"} -\ No newline at end of file -+{"files":{"Cargo.toml":"4c34032ec5fadf8b996c671425d5afa38e0e5c223ab0b2ed3b44099fb78157d3","src/lib.rs":"a9854421f120e1c4a9d7d36bb006a4c5e7d2e054564f95aa9b6956e7ebb348fd"},"package":"729835442da829c9b6f7c111c76cf87b2498e129101203bec94f0c39a3296a38"} -\ No newline at end of file -diff --git a/third_party/rust/uniffi_meta/Cargo.toml b/third_party/rust/uniffi_meta/Cargo.toml ---- a/third_party/rust/uniffi_meta/Cargo.toml -+++ b/third_party/rust/uniffi_meta/Cargo.toml -@@ -10,19 +10,24 @@ - # See Cargo.toml.orig for the original contents. - - [package] - edition = "2021" - name = "uniffi_meta" --version = "0.21.0" -+version = "0.21.1" - description = "uniffi_meta" - homepage = "https://mozilla.github.io/uniffi-rs" - keywords = [ - "ffi", - "bindgen", - ] - license = "MPL-2.0" - repository = "https://github.com/mozilla/uniffi-rs" --resolver = "2" - - [dependencies.serde] - version = "1.0.136" - features = ["derive"] -+ -+[dependencies.siphasher] -+version = "0.3" -+ -+[dependencies.uniffi_checksum_derive] -+version = "0.21.0" -diff --git a/third_party/rust/uniffi_meta/src/lib.rs b/third_party/rust/uniffi_meta/src/lib.rs ---- a/third_party/rust/uniffi_meta/src/lib.rs -+++ b/third_party/rust/uniffi_meta/src/lib.rs -@@ -1,17 +1,87 @@ - /* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - --use std::{ -- collections::hash_map::DefaultHasher, -- hash::{Hash, Hasher}, --}; -+use std::hash::Hasher; -+pub use uniffi_checksum_derive::Checksum; - - use serde::{Deserialize, Serialize}; - --#[derive(Clone, Debug, Hash, Deserialize, Serialize)] -+/// Similar to std::hash::Hash. -+/// -+/// Implementations of this trait are expected to update the hasher state in -+/// the same way across platforms. #[derive(Checksum)] will do the right thing. -+pub trait Checksum { -+ fn checksum(&self, state: &mut H); -+} -+ -+impl Checksum for bool { -+ fn checksum(&self, state: &mut H) { -+ state.write_u8(*self as u8); -+ } -+} -+ -+impl Checksum for u64 { -+ fn checksum(&self, state: &mut H) { -+ state.write(&self.to_le_bytes()); -+ } -+} -+ -+impl Checksum for i64 { -+ fn checksum(&self, state: &mut H) { -+ state.write(&self.to_le_bytes()); -+ } -+} -+ -+impl Checksum for Box { -+ fn checksum(&self, state: &mut H) { -+ (**self).checksum(state) -+ } -+} -+ -+impl Checksum for [T] { -+ fn checksum(&self, state: &mut H) { -+ state.write(&(self.len() as u64).to_le_bytes()); -+ for item in self { -+ Checksum::checksum(item, state); -+ } -+ } -+} -+ -+impl Checksum for Vec { -+ fn checksum(&self, state: &mut H) { -+ Checksum::checksum(&**self, state); -+ } -+} -+ -+impl Checksum for Option { -+ fn checksum(&self, state: &mut H) { -+ match self { -+ None => state.write(&0u64.to_le_bytes()), -+ Some(value) => { -+ state.write(&1u64.to_le_bytes()); -+ Checksum::checksum(value, state) -+ } -+ } -+ } -+} -+ -+impl Checksum for str { -+ fn checksum(&self, state: &mut H) { -+ state.write(self.as_bytes()); -+ state.write_u8(0xff); -+ } -+} -+ -+impl Checksum for String { -+ fn checksum(&self, state: &mut H) { -+ (**self).checksum(state) -+ } -+} -+ -+#[derive(Clone, Debug, Checksum, Deserialize, Serialize)] - pub struct FnMetadata { - pub module_path: Vec, - pub name: String, - pub inputs: Vec, - pub return_type: Option, -@@ -21,11 +91,11 @@ - pub fn ffi_symbol_name(&self) -> String { - fn_ffi_symbol_name(&self.module_path, &self.name, checksum(self)) - } - } - --#[derive(Clone, Debug, Hash, Deserialize, Serialize)] -+#[derive(Clone, Debug, Checksum, Deserialize, Serialize)] - pub struct MethodMetadata { - pub module_path: Vec, - pub self_name: String, - pub name: String, - pub inputs: Vec, -@@ -37,18 +107,18 @@ - let full_name = format!("impl_{}_{}", self.self_name, self.name); - fn_ffi_symbol_name(&self.module_path, &full_name, checksum(self)) - } - } - --#[derive(Clone, Debug, Hash, Deserialize, Serialize)] -+#[derive(Clone, Debug, Checksum, Deserialize, Serialize)] - pub struct FnParamMetadata { - pub name: String, - #[serde(rename = "type")] - pub ty: Type, - } - --#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)] -+#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Checksum, Deserialize, Serialize)] - pub enum Type { - U8, - U16, - U32, - U64, -@@ -76,25 +146,25 @@ - Unresolved { - name: String, - }, - } - --#[derive(Clone, Debug, Hash, Deserialize, Serialize)] -+#[derive(Clone, Debug, Checksum, Deserialize, Serialize)] - pub struct RecordMetadata { - pub module_path: Vec, - pub name: String, - pub fields: Vec, - } - --#[derive(Clone, Debug, Hash, Deserialize, Serialize)] -+#[derive(Clone, Debug, Checksum, Deserialize, Serialize)] - pub struct FieldMetadata { - pub name: String, - #[serde(rename = "type")] - pub ty: Type, - } - --#[derive(Clone, Debug, Hash, Deserialize, Serialize)] -+#[derive(Clone, Debug, Checksum, Deserialize, Serialize)] - pub struct ObjectMetadata { - pub module_path: Vec, - pub name: String, - } - -@@ -106,27 +176,27 @@ - let free_name = format!("object_free_{}", self.name); - fn_ffi_symbol_name(&self.module_path, &free_name, checksum(self)) - } - } - --/// Returns the last 16 bits of the value's hash as computed with [`DefaultHasher`]. -+/// Returns the last 16 bits of the value's hash as computed with [`SipHasher13`]. - /// - /// To be used as a checksum of FFI symbols, as a safeguard against different UniFFI versions being - /// used for scaffolding and bindings generation. --pub fn checksum(val: &T) -> u16 { -- let mut hasher = DefaultHasher::new(); -- val.hash(&mut hasher); -+pub fn checksum(val: &T) -> u16 { -+ let mut hasher = siphasher::sip::SipHasher13::new(); -+ val.checksum(&mut hasher); - (hasher.finish() & 0x000000000000FFFF) as u16 - } - - pub fn fn_ffi_symbol_name(mod_path: &[String], name: &str, checksum: u16) -> String { - let mod_path = mod_path.join("__"); - format!("_uniffi_{mod_path}_{name}_{checksum:x}") - } - - /// Enum covering all the possible metadata types --#[derive(Clone, Debug, Hash, Deserialize, Serialize)] -+#[derive(Clone, Debug, Checksum, Deserialize, Serialize)] - pub enum Metadata { - Func(FnMetadata), - Method(MethodMetadata), - Record(RecordMetadata), - Object(ObjectMetadata), - diff --git a/firefox.spec b/firefox.spec index af584c6..4862a95 100644 --- a/firefox.spec +++ b/firefox.spec @@ -172,13 +172,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 108.0.1 -Release: 4%{?pre_tag}%{?dist} +Version: 108.0.2 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20221218.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230112.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -253,7 +253,6 @@ Patch415: mozilla-1670333.patch Patch416: D163696.diff Patch417: D163697.diff Patch418: D163698.diff -Patch419: D164896.diff # PGO/LTO patches Patch600: pgo.patch @@ -532,7 +531,6 @@ This package contains results of tests executed during build. %patch416 -p1 -b .D163696 %patch417 -p1 -b .D163697 %patch418 -p1 -b .D163698 -%patch419 -p1 -b .D164896 # PGO patches %if %{build_with_pgo} @@ -1086,6 +1084,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Jan 12 2023 Jan Horak - 108.0.2-1 +- Update to 108.0.2 + * Mon Jan 09 2023 Kalev Lember - 108.0.1-4 - Drop conditionals for F35 diff --git a/sources b/sources index e70567f..65c6114 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 -SHA512 (firefox-108.0.1.source.tar.xz) = e6219ed6324422ec293ed96868738e056582bb9f7fb82e59362541f3465c6ebca806d26ecd801156b074c3675bd5a22507b1f1fa53eebf82b7dd35f2b1ff0625 -SHA512 (firefox-langpacks-108.0.1-20221218.tar.xz) = ac9766a4eb419ba04a138cbd3a4f44dac9d83a4c2680f5b29f8b2da2ac9659cc0b1706b974e15563b2aaed371a11a999f5f11172610d60e4ebe6dcb860f1b1f2 +SHA512 (firefox-108.0.2.source.tar.xz) = f856ef034fa4a526e19968aed092c9ee99e124d2d271ec1c1bbd091d9a03e23293d69c7a9ae17c43258cde7e73c294534b471e36441e576377854f607c9bfa3a +SHA512 (firefox-langpacks-108.0.2-20230112.tar.xz) = dfe1273fe3c29e737623915c10a900f370306a9af00c92b0479f2c779056823b99dff0ff94a779f8a8fa14c4d85e27813da297bfc5439802c8f1b2e5e31431b5 From 916853162b025e3c1bafab144658627618c2ec55 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 13 Jan 2023 11:25:04 +0100 Subject: [PATCH 162/545] Updated to 109.0 --- D163310.diff | 58 - D163696.diff | 55 - D163697.diff | 28 - D163698.diff | 315 ---- D164896.diff | 1842 -------------------- firefox.spec | 19 +- libwebrtc-screen-cast-sync.patch | 2673 +++++++++++++++--------------- mozilla-1663844.patch | 26 +- 8 files changed, 1341 insertions(+), 3675 deletions(-) delete mode 100644 D163310.diff delete mode 100644 D163696.diff delete mode 100644 D163697.diff delete mode 100644 D163698.diff delete mode 100644 D164896.diff diff --git a/D163310.diff b/D163310.diff deleted file mode 100644 index bad1f17..0000000 --- a/D163310.diff +++ /dev/null @@ -1,58 +0,0 @@ -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp ---- a/widget/gtk/nsWindow.cpp -+++ b/widget/gtk/nsWindow.cpp -@@ -3029,11 +3029,11 @@ - #endif - } - - void nsWindow::SetUserTimeAndStartupTokenForActivatedWindow() { - nsGTKToolkit* toolkit = nsGTKToolkit::GetToolkit(); -- if (!toolkit) { -+ if (!toolkit || MOZ_UNLIKELY(mWindowType == eWindowType_invisible)) { - return; - } - - mWindowActivationTokenFromEnv = toolkit->GetStartupToken(); - if (!mWindowActivationTokenFromEnv.IsEmpty()) { -@@ -6614,30 +6614,34 @@ - return; - } - } - } - // Set up usertime/startupID metadata for the created window. -- if (mWindowType != eWindowType_invisible) { -+ // On X11 we use gtk_window_set_startup_id() so we need to call it -+ // before show. -+ if (GdkIsX11Display()) { - SetUserTimeAndStartupTokenForActivatedWindow(); - } - if (GdkIsWaylandDisplay()) { - if (IsWaylandPopup()) { - ShowWaylandPopupWindow(); - } else { - ShowWaylandToplevelWindow(); - } -+ } else { -+ LOG(" calling gtk_widget_show(mShell)\n"); -+ gtk_widget_show(mShell); -+ } -+ if (GdkIsWaylandDisplay()) { -+ SetUserTimeAndStartupTokenForActivatedWindow(); - #ifdef MOZ_WAYLAND - auto token = std::move(mWindowActivationTokenFromEnv); - if (!token.IsEmpty()) { - FocusWaylandWindow(token.get()); - } - #endif -- } else { -- LOG(" calling gtk_widget_show(mShell)\n"); -- gtk_widget_show(mShell); -- } -- -+ } - if (mHiddenPopupPositioned && IsPopup()) { - LOG(" re-position hidden popup window"); - gtk_window_move(GTK_WINDOW(mShell), mPopupPosition.x, mPopupPosition.y); - mHiddenPopupPositioned = false; - } - diff --git a/D163696.diff b/D163696.diff deleted file mode 100644 index 9002e71..0000000 --- a/D163696.diff +++ /dev/null @@ -1,55 +0,0 @@ -diff --git a/widget/gtk/GtkCompositorWidget.cpp b/widget/gtk/GtkCompositorWidget.cpp ---- a/widget/gtk/GtkCompositorWidget.cpp -+++ b/widget/gtk/GtkCompositorWidget.cpp -@@ -19,13 +19,14 @@ - # include "mozilla/layers/NativeLayerWayland.h" - #endif - - #ifdef MOZ_LOGGING - # undef LOG --# define LOG(...) \ -+# define LOG(str, ...) \ - MOZ_LOG(IsPopup() ? gWidgetPopupLog : gWidgetLog, \ -- mozilla::LogLevel::Debug, (__VA_ARGS__)) -+ mozilla::LogLevel::Debug, \ -+ ("[%p]: " str, mWidget.get(), ##__VA_ARGS__)) - #endif /* MOZ_LOGGING */ - - namespace mozilla { - namespace widget { - -@@ -92,10 +93,13 @@ - - nsIWidget* GtkCompositorWidget::RealWidget() { return mWidget; } - - void GtkCompositorWidget::NotifyClientSizeChanged( - const LayoutDeviceIntSize& aClientSize) { -+ LOG("GtkCompositorWidget::NotifyClientSizeChanged() to %d x %d", -+ aClientSize.width, aClientSize.height); -+ - auto size = mClientSize.Lock(); - *size = aClientSize; - } - - LayoutDeviceIntSize GtkCompositorWidget::GetClientSize() { -@@ -107,14 +111,19 @@ - const LayoutDeviceRect& aSize) { - if (!mWidget || !mWidget->IsWaitingForCompositorResume()) { - return; - } - -+ LOG("GtkCompositorWidget::RemoteLayoutSizeUpdated() %d x %d", -+ (int)aSize.width, (int)aSize.height); -+ - // We're waiting for layout to match widget size. - auto clientSize = mClientSize.Lock(); - if (clientSize->width != (int)aSize.width || - clientSize->height != (int)aSize.height) { -+ LOG("quit, client size doesn't match (%d x %d)", clientSize->width, -+ clientSize->height); - return; - } - - mWidget->ResumeCompositorFromCompositorThread(); - } - diff --git a/D163697.diff b/D163697.diff deleted file mode 100644 index c6a15ba..0000000 --- a/D163697.diff +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/widget/gtk/ScreenHelperGTK.cpp b/widget/gtk/ScreenHelperGTK.cpp ---- a/widget/gtk/ScreenHelperGTK.cpp -+++ b/widget/gtk/ScreenHelperGTK.cpp -@@ -433,19 +433,21 @@ - return -1; - } - - GdkRectangle workArea; - if (!GdkMonitorGetWorkarea(monitor, &workArea)) { -+ LOG_SCREEN(" failed, can't get work area"); - return -1; - } - - for (unsigned int i = 0; i < mMonitors.Length(); i++) { - // Although Gtk/Mutter is very creative in reporting various screens sizes - // we can rely on Gtk work area start position to match wl_output. - if (mMonitors[i]->x == workArea.x && mMonitors[i]->y == workArea.y) { -- LOG_SCREEN(" monitor %d values %d %d -> %d x %d", i, mMonitors[i]->x, -- mMonitors[i]->y, mMonitors[i]->width, mMonitors[i]->height); -+ LOG_SCREEN(" monitor %d work area [%d, %d] -> (%d x %d) scale %d", i, -+ mMonitors[i]->x, mMonitors[i]->y, mMonitors[i]->width, -+ mMonitors[i]->height, mMonitors[i]->scale); - return i; - } - } - - return -1; - diff --git a/D163698.diff b/D163698.diff deleted file mode 100644 index d889961..0000000 --- a/D163698.diff +++ /dev/null @@ -1,315 +0,0 @@ -diff --git a/widget/gtk/MozContainerWayland.h b/widget/gtk/MozContainerWayland.h ---- a/widget/gtk/MozContainerWayland.h -+++ b/widget/gtk/MozContainerWayland.h -@@ -76,13 +76,17 @@ - struct wl_egl_window* moz_container_wayland_get_egl_window( - MozContainer* container, double scale); - - gboolean moz_container_wayland_has_egl_window(MozContainer* container); - void moz_container_wayland_egl_window_set_size(MozContainer* container, -- int width, int height); -+ nsIntSize aSize); -+bool moz_container_wayland_egl_window_needs_size_update(MozContainer* container, -+ nsIntSize aSize, -+ int scale); - void moz_container_wayland_set_scale_factor(MozContainer* container); --void moz_container_wayland_set_scale_factor_locked(MozContainer* container); -+void moz_container_wayland_set_scale_factor_locked( -+ const mozilla::MutexAutoLock& aProofOfLock, MozContainer* container); - - void moz_container_wayland_add_initial_draw_callback_locked( - MozContainer* container, const std::function& initial_draw_cb); - void moz_container_wayland_add_or_fire_initial_draw_callback( - MozContainer* container, const std::function& initial_draw_cb); -diff --git a/widget/gtk/MozContainerWayland.cpp b/widget/gtk/MozContainerWayland.cpp ---- a/widget/gtk/MozContainerWayland.cpp -+++ b/widget/gtk/MozContainerWayland.cpp -@@ -108,13 +108,11 @@ - mSurface = moz_container_wayland_surface_lock(aContainer); - } - MozContainerSurfaceLock::~MozContainerSurfaceLock() { - moz_container_wayland_surface_unlock(mContainer, &mSurface); - } --struct wl_surface* MozContainerSurfaceLock::GetSurface() { -- return mSurface; --} -+struct wl_surface* MozContainerSurfaceLock::GetSurface() { return mSurface; } - - // Imlemented in MozContainer.cpp - void moz_container_realize(GtkWidget* widget); - - // Invalidate gtk wl_surface to commit changes to wl_subsurface. -@@ -163,15 +161,16 @@ - // This is called from layout/compositor code only with - // size equal to GL rendering context. Otherwise there are - // rendering artifacts as wl_egl_window size does not match - // GL rendering pipeline setup. - void moz_container_wayland_egl_window_set_size(MozContainer* container, -- int width, int height) { -+ nsIntSize aSize) { - MozContainerWayland* wl_container = &container->wl_container; - MutexAutoLock lock(*wl_container->container_lock); - if (wl_container->eglwindow) { -- wl_egl_window_resize(wl_container->eglwindow, width, height, 0, 0); -+ wl_egl_window_resize(wl_container->eglwindow, aSize.width, aSize.height, 0, -+ 0); - } - } - - void moz_container_wayland_class_init(MozContainerClass* klass) { - /*GObjectClass *gobject_class = G_OBJECT_CLASS (klass); -@@ -432,11 +431,11 @@ - MOZ_CONTAINER(widget))) { - return FALSE; - } - } - -- moz_container_wayland_set_scale_factor_locked(MOZ_CONTAINER(widget)); -+ moz_container_wayland_set_scale_factor_locked(lock, MOZ_CONTAINER(widget)); - moz_container_wayland_set_opaque_region_locked(lock, MOZ_CONTAINER(widget)); - moz_container_clear_input_region(MOZ_CONTAINER(widget)); - moz_container_wayland_invalidate(MOZ_CONTAINER(widget)); - return FALSE; - } -@@ -487,11 +486,11 @@ - if (!container->wl_container.surface) { - if (!moz_container_wayland_surface_create_locked(lock, container)) { - return; - } - } -- moz_container_wayland_set_scale_factor_locked(container); -+ moz_container_wayland_set_scale_factor_locked(lock, container); - moz_container_wayland_set_opaque_region_locked(lock, container); - moz_container_wayland_move_locked(lock, container, allocation->x, - allocation->y); - moz_container_clear_input_region(container); - moz_container_wayland_invalidate(MOZ_CONTAINER(widget)); -@@ -542,55 +541,61 @@ - if (wl_container->surface) { - moz_container_wayland_set_opaque_region_locked(lock, container); - } - } - --void moz_container_wayland_set_scale_factor_locked(MozContainer* container) { -+static void moz_container_wayland_surface_set_scale_locked( -+ const MutexAutoLock& aProofOfLock, MozContainerWayland* wl_container, -+ int scale) { -+ if (wl_container->buffer_scale == scale) { -+ return; -+ } -+ -+ LOGCONTAINER("%s scale %d\n", __FUNCTION__, scale); -+ -+ // There is a chance that the attached wl_buffer has not yet been doubled -+ // on the main thread when scale factor changed to 2. This leads to -+ // crash with the following message: -+ // Buffer size (AxB) must be an integer multiple of the buffer_scale (2) -+ // Removing the possibly wrong wl_buffer to prevent that crash: -+ wl_surface_attach(wl_container->surface, nullptr, 0, 0); -+ wl_surface_set_buffer_scale(wl_container->surface, scale); -+ wl_container->buffer_scale = scale; -+} -+ -+void moz_container_wayland_set_scale_factor_locked( -+ const MutexAutoLock& aProofOfLock, MozContainer* container) { - if (gfx::gfxVars::UseWebRenderCompositor()) { - // the compositor backend handles scaling itself - return; - } - - MozContainerWayland* wl_container = &container->wl_container; - wl_container->container_lock->AssertCurrentThreadOwns(); - - nsWindow* window = moz_container_get_nsWindow(container); -- -- if (window && window->UseFractionalScale()) { -+ MOZ_DIAGNOSTIC_ASSERT(window); -+ if (window->UseFractionalScale()) { - if (!wl_container->viewport) { - wl_container->viewport = wp_viewporter_get_viewport( - WaylandDisplayGet()->GetViewporter(), wl_container->surface); - } - - GdkWindow* gdkWindow = gtk_widget_get_window(GTK_WIDGET(container)); - wp_viewport_set_destination(wl_container->viewport, - gdk_window_get_width(gdkWindow), - gdk_window_get_height(gdkWindow)); - } else { -- int scale = window ? window->GdkCeiledScaleFactor() : 1; -- -- if (scale == wl_container->buffer_scale) { -- return; -- } -- -- LOGCONTAINER("%s [%p] scale %d\n", __FUNCTION__, -- (void*)moz_container_get_nsWindow(container), scale); -- // There is a chance that the attached wl_buffer has not yet been doubled -- // on the main thread when scale factor changed to 2. This leads to -- // crash with the following message: -- // Buffer size (AxB) must be an integer multiple of the buffer_scale (2) -- // Removing the possibly wrong wl_buffer to prevent that crash: -- wl_surface_attach(wl_container->surface, nullptr, 0, 0); -- wl_surface_set_buffer_scale(wl_container->surface, scale); -- wl_container->buffer_scale = scale; -+ moz_container_wayland_surface_set_scale_locked( -+ aProofOfLock, wl_container, window->GdkCeiledScaleFactor()); - } - } - - void moz_container_wayland_set_scale_factor(MozContainer* container) { - MutexAutoLock lock(*container->wl_container.container_lock); - if (container->wl_container.surface) { -- moz_container_wayland_set_scale_factor_locked(container); -+ moz_container_wayland_set_scale_factor_locked(lock, container); - } - } - - static bool moz_container_wayland_surface_create_locked( - const MutexAutoLock& aProofOfLock, MozContainer* container) { -@@ -598,10 +603,12 @@ - - LOGWAYLAND("%s [%p]\n", __FUNCTION__, - (void*)moz_container_get_nsWindow(container)); - - GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(container)); -+ MOZ_DIAGNOSTIC_ASSERT(window); -+ - wl_surface* parent_surface = gdk_wayland_window_get_wl_surface(window); - if (!parent_surface) { - LOGWAYLAND(" Failed - missing parent surface!"); - return false; - } -@@ -691,36 +698,65 @@ - *surface = nullptr; - } - container->wl_container.container_lock->Unlock(); - } - -+bool moz_container_wayland_egl_window_needs_size_update(MozContainer* container, -+ nsIntSize aSize, -+ int aScale) { -+ MozContainerWayland* wl_container = &container->wl_container; -+ if (wl_container->buffer_scale != aScale) { -+ return true; -+ } -+ nsIntSize recentSize; -+ wl_egl_window_get_attached_size(wl_container->eglwindow, &recentSize.width, -+ &recentSize.height); -+ return aSize != recentSize; -+} -+ - struct wl_egl_window* moz_container_wayland_get_egl_window( - MozContainer* container, double scale) { - MozContainerWayland* wl_container = &container->wl_container; - -- LOGCONTAINER("%s [%p] eglwindow %p\n", __FUNCTION__, -+ LOGCONTAINER("%s [%p] eglwindow %p scale %d\n", __FUNCTION__, - (void*)moz_container_get_nsWindow(container), -- (void*)wl_container->eglwindow); -+ (void*)wl_container->eglwindow, (int)scale); - - MutexAutoLock lock(*wl_container->container_lock); - if (!wl_container->surface || !wl_container->ready_to_draw) { -- LOGWAYLAND( -+ LOGCONTAINER( - " quit, wl_container->surface %p wl_container->ready_to_draw %d\n", - wl_container->surface, wl_container->ready_to_draw); - return nullptr; - } -+ -+ GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(container)); -+ nsIntSize requestedSize((int)round(gdk_window_get_width(window) * scale), -+ (int)round(gdk_window_get_height(window) * scale)); -+ - if (!wl_container->eglwindow) { -- GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(container)); - wl_container->eglwindow = wl_egl_window_create( -- wl_container->surface, (int)round(gdk_window_get_width(window) * scale), -- (int)round(gdk_window_get_height(window) * scale)); -+ wl_container->surface, requestedSize.width, requestedSize.height); - -- LOGCONTAINER("%s [%p] created eglwindow %p size %d x %d scale %f\n", -+ LOGCONTAINER("%s [%p] created eglwindow %p size %d x %d (with scale %f)\n", - __FUNCTION__, (void*)moz_container_get_nsWindow(container), -- (void*)wl_container->eglwindow, gdk_window_get_width(window), -- gdk_window_get_height(window), scale); -+ (void*)wl_container->eglwindow, requestedSize.width, -+ requestedSize.height, scale); -+ } else { -+ nsIntSize recentSize; -+ wl_egl_window_get_attached_size(wl_container->eglwindow, &recentSize.width, -+ &recentSize.height); -+ if (requestedSize != recentSize) { -+ LOGCONTAINER("%s [%p] resized to %d x %d (with scale %f)\n", __FUNCTION__, -+ (void*)moz_container_get_nsWindow(container), -+ requestedSize.width, requestedSize.height, scale); -+ wl_egl_window_resize(wl_container->eglwindow, requestedSize.width, -+ requestedSize.height, 0, 0); -+ } - } -+ moz_container_wayland_surface_set_scale_locked(lock, wl_container, -+ static_cast(scale)); - return wl_container->eglwindow; - } - - gboolean moz_container_wayland_has_egl_window(MozContainer* container) { - return container->wl_container.eglwindow != nullptr; -diff --git a/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp b/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp ---- a/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp -+++ b/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp -@@ -301,11 +301,11 @@ - LayoutDeviceIntRect r = iter.Get(); - wl_surface_damage_buffer(waylandSurface, r.x, r.y, r.width, r.height); - } - } - -- moz_container_wayland_set_scale_factor_locked(container); -+ moz_container_wayland_set_scale_factor_locked(aProofOfLock, container); - mInProgressBuffer->AttachAndCommit(waylandSurface); - - mInProgressBuffer->ResetBufferAge(); - mFrontBuffer = mInProgressBuffer; - mFrontBufferInvalidRegion = aInvalidRegion; -diff --git a/widget/gtk/mozwayland/mozwayland.c b/widget/gtk/mozwayland/mozwayland.c ---- a/widget/gtk/mozwayland/mozwayland.c -+++ b/widget/gtk/mozwayland/mozwayland.c -@@ -186,10 +186,13 @@ - MOZ_EXPORT void wl_egl_window_destroy(struct wl_egl_window* egl_window) {} - - MOZ_EXPORT void wl_egl_window_resize(struct wl_egl_window* egl_window, - int width, int height, int dx, int dy) {} - -+MOZ_EXPORT void wl_egl_window_get_attached_size( -+ struct wl_egl_window* egl_window, int* width, int* height) {} -+ - MOZ_EXPORT void wl_list_init(struct wl_list* list) {} - - MOZ_EXPORT void wl_list_insert(struct wl_list* list, struct wl_list* elm) {} - - MOZ_EXPORT void wl_list_remove(struct wl_list* elm) {} -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp ---- a/widget/gtk/nsWindow.cpp -+++ b/widget/gtk/nsWindow.cpp -@@ -9816,13 +9816,18 @@ - void nsWindow::SetEGLNativeWindowSize( - const LayoutDeviceIntSize& aEGLWindowSize) { - if (!mContainer || !GdkIsWaylandDisplay()) { - return; - } -- moz_container_wayland_egl_window_set_size(mContainer, aEGLWindowSize.width, -- aEGLWindowSize.height); -- moz_container_wayland_set_scale_factor(mContainer); -+ if (moz_container_wayland_egl_window_needs_size_update( -+ mContainer, aEGLWindowSize.ToUnknownSize(), GdkCeiledScaleFactor())) { -+ LOG("nsWindow::SetEGLNativeWindowSize() %d x %d", aEGLWindowSize.width, -+ aEGLWindowSize.height); -+ moz_container_wayland_egl_window_set_size(mContainer, -+ aEGLWindowSize.ToUnknownSize()); -+ moz_container_wayland_set_scale_factor(mContainer); -+ } - } - #endif - - LayoutDeviceIntSize nsWindow::GetMozContainerSize() { - LayoutDeviceIntSize size(0, 0); - diff --git a/D164896.diff b/D164896.diff deleted file mode 100644 index 3212ea5..0000000 --- a/D164896.diff +++ /dev/null @@ -1,1842 +0,0 @@ -diff --git a/Cargo.lock b/Cargo.lock ---- a/Cargo.lock -+++ b/Cargo.lock -@@ -5775,13 +5775,13 @@ - source = "registry+https://github.com/rust-lang/crates.io-index" - checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" - - [[package]] - name = "uniffi" --version = "0.21.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "f54af5ada67d1173457a99a7bb44a7917f63e7466764cb4714865c7a6678b830" -+version = "0.21.1" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "b983553c0d1ad73547c65fa0c399aa800bee4a70ad330198e1c7a523212da5ee" - dependencies = [ - "anyhow", - "bytes 1.2.1", - "camino", - "cargo_metadata", -@@ -5885,13 +5885,11 @@ - "uniffi_macros", - ] - - [[package]] - name = "uniffi_bindgen" --version = "0.21.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "12cc4af3c0180c7e86c4a3acf2b6587af04ba2567b1e948993df10f421796621" -+version = "0.21.1" - dependencies = [ - "anyhow", - "askama", - "bincode", - "camino", -@@ -5908,24 +5906,34 @@ - "weedle2", - ] - - [[package]] - name = "uniffi_build" --version = "0.21.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "510287c368a9386eb731ebe824a6fc6c82a105e20d020af1aa20519c1c1561db" -+version = "0.21.1" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "d035e50433ee3d52ab0dcdcf3b9b26f2cc2ec39294b3c07d95865a518709455f" - dependencies = [ - "anyhow", - "camino", - "uniffi_bindgen", - ] - - [[package]] -+name = "uniffi_checksum_derive" -+version = "0.21.1" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "78b6e16d46caf942016997af8bbdf4b163bf8ae3deb0b667d9643de7b7ffd4c9" -+dependencies = [ -+ "quote", -+ "syn", -+] -+ -+[[package]] - name = "uniffi_macros" --version = "0.21.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "5c8604503caa2cbcf271578dc51ca236d40e3b22e1514ffa2e638e2c39f6ad10" -+version = "0.21.1" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "c96a574677566f83ea8458dac1dd7792fd63e7c3f9dbcd865f0e8d6f8057b127" - dependencies = [ - "bincode", - "camino", - "fs-err", - "once_cell", -@@ -5938,15 +5946,17 @@ - "uniffi_meta", - ] - - [[package]] - name = "uniffi_meta" --version = "0.21.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "cd9417cc653937681436b93838d8c5f97a5b8c58697813982ee8810bd1dc3b57" -+version = "0.21.1" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "729835442da829c9b6f7c111c76cf87b2498e129101203bec94f0c39a3296a38" - dependencies = [ - "serde", -+ "siphasher", -+ "uniffi_checksum_derive", - ] - - [[package]] - name = "unix_path" - version = "1.0.1" -diff --git a/Cargo.toml b/Cargo.toml ---- a/Cargo.toml -+++ b/Cargo.toml -@@ -180,10 +180,14 @@ - # okay, but it means that their dependencies on UniFFI crates will normally - # also be the git versions. Patch them to use the published versions to avoid - # duplicate crates. - - [patch."https://github.com/mozilla/uniffi-rs.git"] --uniffi = "=0.21.0" --uniffi_bindgen = "=0.21.0" --uniffi_build = "=0.21.0" --uniffi_macros = "=0.21.0" -+uniffi = "=0.21.1" -+#uniffi_bindgen = "=0.21.1" -+uniffi_build = "=0.21.1" -+uniffi_macros = "=0.21.1" - weedle2 = "=4.0.0" -+ -+# Patched to use uniffi_version = 0.21.0 for checksums. -+[patch.crates-io.uniffi_bindgen] -+path = "third_party/rust/uniffi_bindgen" -diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml ---- a/supply-chain/audits.toml -+++ b/supply-chain/audits.toml -@@ -1535,10 +1535,16 @@ - who = "Jan-Erik Rediger " - criteria = "safe-to-deploy" - delta = "0.20.0 -> 0.21.0" - notes = "Maintained by the Glean and Application Services team." - -+[[audits.uniffi]] -+who = "Mike Hommey " -+criteria = "safe-to-deploy" -+delta = "0.21.0 -> 0.21.1" -+notes = "No changes." -+ - [[audits.uniffi_bindgen]] - who = "Travis Long " - criteria = "safe-to-deploy" - version = "0.19.3" - notes = "Maintained by the Glean and Application Services teams." -@@ -1558,10 +1564,16 @@ - who = "Jan-Erik Rediger " - criteria = "safe-to-deploy" - delta = "0.20.0 -> 0.21.0" - notes = "Maintained by the Glean and Application Services team." - -+[[audits.uniffi_bindgen]] -+who = "Mike Hommey " -+criteria = "safe-to-deploy" -+delta = "0.21.0 -> 0.21.1" -+notes = "I authored the changes in this version." -+ - [[audits.uniffi_build]] - who = "Travis Long " - criteria = "safe-to-deploy" - version = "0.19.3" - notes = "Maintained by the Glean and Application Services teams." -@@ -1581,10 +1593,22 @@ - who = "Jan-Erik Rediger " - criteria = "safe-to-deploy" - delta = "0.20.0 -> 0.21.0" - notes = "Maintained by the Glean and Application Services team." - -+[[audits.uniffi_build]] -+who = "Mike Hommey " -+criteria = "safe-to-deploy" -+delta = "0.21.0 -> 0.21.1" -+notes = "No changes." -+ -+[[audits.uniffi_checksum_derive]] -+who = "Mike Hommey " -+criteria = "safe-to-deploy" -+version = "0.21.1" -+notes = "I authored this crate." -+ - [[audits.uniffi_macros]] - who = "Travis Long " - criteria = "safe-to-deploy" - version = "0.19.3" - notes = "Maintained by the Glean and Application Services teams." -@@ -1604,10 +1628,16 @@ - who = "Jan-Erik Rediger " - criteria = "safe-to-deploy" - delta = "0.20.0 -> 0.21.0" - notes = "Maintained by the Glean and Application Services team." - -+[[audits.uniffi_macros]] -+who = "Mike Hommey " -+criteria = "safe-to-deploy" -+delta = "0.21.0 -> 0.21.1" -+notes = "No changes." -+ - [[audits.uniffi_meta]] - who = "Jan-Erik Rediger " - criteria = "safe-to-deploy" - version = "0.19.6" - notes = "Maintained by the Glean and Application Services team." -@@ -1621,10 +1651,16 @@ - who = "Jan-Erik Rediger " - criteria = "safe-to-deploy" - delta = "0.20.0 -> 0.21.0" - notes = "Maintained by the Glean and Application Services team." - -+[[audits.uniffi_meta]] -+who = "Mike Hommey " -+criteria = "safe-to-deploy" -+delta = "0.21.0 -> 0.21.1" -+notes = "I authored the changes in this version." -+ - [[audits.void]] - who = "Bobby Holley " - criteria = "safe-to-deploy" - version = "1.0.2" - notes = "Very small crate, just hosts the Void type for easier cross-crate interfacing." -diff --git a/supply-chain/config.toml b/supply-chain/config.toml ---- a/supply-chain/config.toml -+++ b/supply-chain/config.toml -@@ -156,10 +156,14 @@ - - [policy.tabs] - audit-as-crates-io = false - notes = "This is a first-party crate, maintained by the appservices team, which is entirely unrelated to the crates.io package of the same name." - -+[policy.uniffi_bindgen] -+audit-as-crates-io = false -+notes = "This is a first-party crate, normally vendored, but currently patched in-tree until next update." -+ - [policy.viaduct] - audit-as-crates-io = false - notes = "This is a first-party crate, maintained by the appservices team, which is entirely unrelated to the crates.io package of the same name." - - [policy.webdriver] -diff --git a/third_party/rust/uniffi/.cargo-checksum.json b/third_party/rust/uniffi/.cargo-checksum.json ---- a/third_party/rust/uniffi/.cargo-checksum.json -+++ b/third_party/rust/uniffi/.cargo-checksum.json -@@ -1 +1 @@ --{"files":{"Cargo.toml":"b7bde8b1b6bb7e1420c9c486d7562d1639fbb82a2b6459b8b3b7d15f002377d3","release.toml":"a6602545cd6eb46e44d89ce946d7954957ac00f1c955de54c736fa2cb560b1df","src/ffi/ffidefault.rs":"c7ab752fffed17c3fabb60e818ad1d093482f95dd0bdeae6871287695c583e48","src/ffi/foreignbytes.rs":"37061e2da7135576abccb86fe27b4fefc054586a040f2ca81fe9858d5649e887","src/ffi/foreigncallbacks.rs":"c0974920313ac81dd4bb28a51dd9e9ef50c8ea6d965f0bfdde58c661a4ca719f","src/ffi/mod.rs":"3fb3b74607066e0052fc91168e9473dbf82dbae562f85c33774a7f5f6b350616","src/ffi/rustbuffer.rs":"b773637d9e4651b80cd16f7a02ed75846d02ce0a9e32b718ce644cdba3a83cdd","src/ffi/rustcalls.rs":"4a85a90b0d46974ab9e80e403a1cddaa252337b227e1a672bb6fdbbca5a66259","src/lib.rs":"83614739f8c0c939b217755cfde169a85608a52ea197f63f7850e5765e2c5f97","src/panichook.rs":"9f49c7994a8e5489c1105c488bb3f8c5571bc5f813e7be90441eca15da5c9851","src/testing.rs":"f287d682a8f27465838b2aba91993c635a4dcd281d802dc12c7c75794324123f","tests/ui/proc_macro_arc.rs":"d766dffee3fe6a93522d40f44a7f15592db141fd674034fa5f016e06f510e87b","tests/ui/proc_macro_arc.stderr":"9e7d098abdd47f249ff62fe0a2ee0f8b96282ec5a3be0c48a778baab4624180f","tests/ui/version_mismatch.rs":"16ea359e5853517ee0d0704c015ae8c825533109fbefd715130d0f4a51f15898","tests/ui/version_mismatch.stderr":"aadbd8f3847f5663022d8dd75d6afa3b25dfc8abccd30b386a681f98587d4ceb"},"package":"f54af5ada67d1173457a99a7bb44a7917f63e7466764cb4714865c7a6678b830"} -\ No newline at end of file -+{"files":{"Cargo.toml":"40a5376941ee93f7d3d013862731eaced1121c852bd4df4affe1cd65bf9b68be","release.toml":"a6602545cd6eb46e44d89ce946d7954957ac00f1c955de54c736fa2cb560b1df","src/ffi/ffidefault.rs":"c7ab752fffed17c3fabb60e818ad1d093482f95dd0bdeae6871287695c583e48","src/ffi/foreignbytes.rs":"37061e2da7135576abccb86fe27b4fefc054586a040f2ca81fe9858d5649e887","src/ffi/foreigncallbacks.rs":"c0974920313ac81dd4bb28a51dd9e9ef50c8ea6d965f0bfdde58c661a4ca719f","src/ffi/mod.rs":"3fb3b74607066e0052fc91168e9473dbf82dbae562f85c33774a7f5f6b350616","src/ffi/rustbuffer.rs":"b773637d9e4651b80cd16f7a02ed75846d02ce0a9e32b718ce644cdba3a83cdd","src/ffi/rustcalls.rs":"4a85a90b0d46974ab9e80e403a1cddaa252337b227e1a672bb6fdbbca5a66259","src/lib.rs":"83614739f8c0c939b217755cfde169a85608a52ea197f63f7850e5765e2c5f97","src/panichook.rs":"9f49c7994a8e5489c1105c488bb3f8c5571bc5f813e7be90441eca15da5c9851","src/testing.rs":"f287d682a8f27465838b2aba91993c635a4dcd281d802dc12c7c75794324123f","tests/ui/proc_macro_arc.rs":"d766dffee3fe6a93522d40f44a7f15592db141fd674034fa5f016e06f510e87b","tests/ui/proc_macro_arc.stderr":"9e7d098abdd47f249ff62fe0a2ee0f8b96282ec5a3be0c48a778baab4624180f","tests/ui/version_mismatch.rs":"16ea359e5853517ee0d0704c015ae8c825533109fbefd715130d0f4a51f15898","tests/ui/version_mismatch.stderr":"aadbd8f3847f5663022d8dd75d6afa3b25dfc8abccd30b386a681f98587d4ceb"},"package":"b983553c0d1ad73547c65fa0c399aa800bee4a70ad330198e1c7a523212da5ee"} -\ No newline at end of file -diff --git a/third_party/rust/uniffi/Cargo.toml b/third_party/rust/uniffi/Cargo.toml ---- a/third_party/rust/uniffi/Cargo.toml -+++ b/third_party/rust/uniffi/Cargo.toml -@@ -10,22 +10,21 @@ - # See Cargo.toml.orig for the original contents. - - [package] - edition = "2021" - name = "uniffi" --version = "0.21.0" -+version = "0.21.1" - authors = ["Firefox Sync Team "] - description = "a multi-language bindings generator for rust (runtime support code)" - homepage = "https://mozilla.github.io/uniffi-rs" - documentation = "https://mozilla.github.io/uniffi-rs" - keywords = [ - "ffi", - "bindgen", - ] - license = "MPL-2.0" - repository = "https://github.com/mozilla/uniffi-rs" --resolver = "2" - - [dependencies.anyhow] - version = "1" - - [dependencies.bytes] -@@ -48,15 +47,15 @@ - - [dependencies.static_assertions] - version = "1.1.0" - - [dependencies.uniffi_bindgen] --version = "=0.21.0" -+version = "=0.21.1" - optional = true - - [dependencies.uniffi_macros] --version = "=0.21.0" -+version = "=0.21.1" - - [dev-dependencies.trybuild] - version = "1" - - [features] -diff --git a/third_party/rust/uniffi_bindgen/.cargo-checksum.json b/third_party/rust/uniffi_bindgen/.cargo-checksum.json ---- a/third_party/rust/uniffi_bindgen/.cargo-checksum.json -+++ b/third_party/rust/uniffi_bindgen/.cargo-checksum.json -@@ -1 +1 @@ --{"files":{"Cargo.lock":"5ed0714fd87076b5b5f11ca60553f12559e69794c2fec7d487a398f31a577a5f","Cargo.toml":"209b8cb7759ec813ee1e27a4b7e1d2bed2604c37d7c55578058bc7089ee9557e","askama.toml":"1a245b7803adca782837e125c49100147d2de0d5a1c949ff95e91af1701f6058","src/backend/config.rs":"4861dbf251dbb10beb1ed7e3eea7d79499a0de1cd9ce9ee8381a0e729c097dea","src/backend/declarations.rs":"12b8d6e651f84634de5cd02a47601965df7438f64f1a73f136bd89b6b5d515cf","src/backend/mod.rs":"899cd3b816d0467e35789b92ac3b8d5910f6dab98156d405db4803da8721fd36","src/backend/oracle.rs":"9e2b8a45af604a6e4952644e81f43f6aec6e0a1d03939c68b582529dd01a51e0","src/backend/types.rs":"7c49a92096a54eefd2336c48d60fe20ded9490142ab3a229a7c1a99fec14df3d","src/bindings/kotlin/gen_kotlin/callback_interface.rs":"b7fe795670830f3aa8a955c787b1127fe68313ee751013948527948fe5526b01","src/bindings/kotlin/gen_kotlin/compounds.rs":"d1e9a4237ff2ff711a3eae7a564c39e26f598c156ebfd34c0f04879e3533dd4f","src/bindings/kotlin/gen_kotlin/custom.rs":"4176f6ed5f66504f8fd981198bbfbae795dab5ef0d0281881d19b697f5560c44","src/bindings/kotlin/gen_kotlin/enum_.rs":"f85ae8dcb55c8f274139bf321af0ba237ae69894165ad6bd693d793f58af8e5e","src/bindings/kotlin/gen_kotlin/error.rs":"867f583aea5da7aabeb9b6d2544d7e52984cdea4aa008ce5f2ec941074735e1a","src/bindings/kotlin/gen_kotlin/external.rs":"1f7e91d7439891fe3c403274e35880ee4fc3a0da555510bdfa23c1ed2bbd8020","src/bindings/kotlin/gen_kotlin/miscellany.rs":"644ee5bb1f3619be5a36b2b3900af554ea38073cd054004f421e69c3cb8d50bc","src/bindings/kotlin/gen_kotlin/mod.rs":"90412e7927c284668a9eb75823c198182e58e5177d5561896c43b79367564b27","src/bindings/kotlin/gen_kotlin/object.rs":"6478a3e9d5e66186521730d0d481abd1ee4f123050ea050ac5a483842f08b003","src/bindings/kotlin/gen_kotlin/primitives.rs":"914d1f8253ed6a2937f67e8bd8f04f46aef4f22455ceb8a6caa84427adc2093e","src/bindings/kotlin/gen_kotlin/record.rs":"7961fcfbec5ebf8fc010b564ea4bd59402c919f6922898d48226d8c995569dd7","src/bindings/kotlin/mod.rs":"e68f2ea29e66ee62a56704e1e4464eea6d28bbdb52ab187bbe7a57ab3f362ea7","src/bindings/kotlin/templates/BooleanHelper.kt":"28e8a5088c8d58c9bfdbc575af8d8725060521fdd7d092684a8044b24ae567c7","src/bindings/kotlin/templates/CallbackInterfaceRuntime.kt":"6ede374b0fcbb3bcc939894e6f4729b3bec7ec7356831a60fba96ca38dc91aa8","src/bindings/kotlin/templates/CallbackInterfaceTemplate.kt":"5a704eb8c044ed22905e4d526ee3fc0b86f42fe82ac1eb4ad3758ad0552ea8c8","src/bindings/kotlin/templates/CustomTypeTemplate.kt":"5d4dacf29e89bcdcc46d155d993e6059d2df704e775dc853469310198253b231","src/bindings/kotlin/templates/DurationHelper.kt":"414a98161538a26f3a9b357353270c1f245ad6ceed99496aca7162cf473a92fd","src/bindings/kotlin/templates/EnumTemplate.kt":"ab3e2063aad3b91188db839dceb59b854a6a8b60fb35e545e270e64fee7c73fa","src/bindings/kotlin/templates/ErrorTemplate.kt":"a5ec2bdfc026838e1096dbf3301f21aa4ea22e8c93458d45bb1c8c7b9ee1fc5b","src/bindings/kotlin/templates/ExternalTypeTemplate.kt":"2097e0b830640ef18c79449ffa376d1dd35a8c4a5230e413c915f3b868aae872","src/bindings/kotlin/templates/FfiConverterTemplate.kt":"aa22962aaa9f641d48ccf44cb56d9f8a7736cbfaa01e1a1656662cfe5dd5c1d7","src/bindings/kotlin/templates/Float32Helper.kt":"662d95af3b629d143fb4d47cb7e9aa26ed28a5f3846de0341e28b0f9fb08bc25","src/bindings/kotlin/templates/Float64Helper.kt":"a77d099fa7d91e8702c1700e7949ffb6aaba9c6e8041ff48bab34b8e1fc9a0aa","src/bindings/kotlin/templates/Helpers.kt":"46c07798a26b53b06405c8bbbf86e3fcf38fadc1484ea04ce9d482defea89288","src/bindings/kotlin/templates/Int16Helper.kt":"7f83c4a48e1f3b2a59a3ca6a2662be8bc9baf3a5a748b31223cb3f51721ef249","src/bindings/kotlin/templates/Int32Helper.kt":"e02e4702175554b09fd2dd6ac3089dcd2c395f08ec60e762159566a9c9889450","src/bindings/kotlin/templates/Int64Helper.kt":"7a6fd6ca486852c89399c699935a9dfa1c32b9356d9a965cfde532581f05d9fa","src/bindings/kotlin/templates/Int8Helper.kt":"0554545494b6b9a76ce94f9c1723f8cf4230a13076feb75d620b1c9ca1ac4668","src/bindings/kotlin/templates/MapTemplate.kt":"399569d6443e8ad01e2deb95d78d8d2d15bf8eccee8be4fbe9ce4b8ebc0a6101","src/bindings/kotlin/templates/NamespaceLibraryTemplate.kt":"1eba4e77381155c2c96a6af2ef30fca881ade4957852f730fd10aa4f3d9cd3c4","src/bindings/kotlin/templates/ObjectRuntime.kt":"c11d233de41405caa55a56bcaa3bb69ce153ffa6fdff2aa218051929f5c4aeec","src/bindings/kotlin/templates/ObjectTemplate.kt":"7e32d92ec6116da9b7d7f278b15333a2fd2a82dde8c21534e3f6fe371d19f333","src/bindings/kotlin/templates/OptionalTemplate.kt":"5f9f2c1baa829ed3c9b61c3edb0f1fccf5ea3cccc052a69cf8966715d8fcf149","src/bindings/kotlin/templates/RecordTemplate.kt":"193ecdad9322fb5483b95bf2a259270a9b22ba054790794e9abb3fd219196bc5","src/bindings/kotlin/templates/RustBufferTemplate.kt":"415637f80a78c12b3d00db063c14a7ab5c61b098bdb1fc81a0be8bae9511776b","src/bindings/kotlin/templates/SequenceTemplate.kt":"786693b20c608a4f059b91df115278f5f12122b4c14a2e7ce18b6fc9b22b1296","src/bindings/kotlin/templates/StringHelper.kt":"060839663580d8199671b7c3bb3dce5e9106aa766ce2c6e0afc2d2bd788a1d83","src/bindings/kotlin/templates/TimestampHelper.kt":"353c2890f06ad6dda238e9aebb4bdff7bb838e17e46abf351ed3ff1fbc4e6580","src/bindings/kotlin/templates/TopLevelFunctionTemplate.kt":"09b8bb5ffea7075518ee657f83017d44ff0cbf584fd85676b082199139c9be09","src/bindings/kotlin/templates/Types.kt":"db7ed7384b4391a4bc1425ec3a89e0c890538ad30f5e115bae4998c059c8a21b","src/bindings/kotlin/templates/UInt16Helper.kt":"e84a1f30a5a899ba2c5db614d3f3c74f25bccf6dd99bf68b8830829332d051e9","src/bindings/kotlin/templates/UInt32Helper.kt":"7cdf08cc580046935f27ba07b53685968608a102e0a6be305111037c63d7ddf8","src/bindings/kotlin/templates/UInt64Helper.kt":"fd7baacbf3ab6202ff83edcc66e5f7beb11a10053ba66d0b49547616cc7cbe1f","src/bindings/kotlin/templates/UInt8Helper.kt":"bbf5a6d66c995aea9fe2fa9840c6bfa78b03520a09469b984f0e1d43191e453a","src/bindings/kotlin/templates/macros.kt":"eb5e0f9915b8ec9fbf3bf1a714625fbdcef7a7ee7461916e87fec872434ed3ec","src/bindings/kotlin/templates/wrapper.kt":"dd81cf28a4e07c685d29c87a4053eccb6339835cfc7fce3cf581d3d111fed4f5","src/bindings/mod.rs":"51ac55a3d505d5a88eedc83cf12623c2738277a9cd22bf3bbe05be1244de078b","src/bindings/python/gen_python/callback_interface.rs":"e3ffb8ba1aa8ac8ddcfff6554e7ec0d2d695d12955a98a04d114d2d6ca5dacc8","src/bindings/python/gen_python/compounds.rs":"e406c773c3b66368ea74973df742cdcba3014521812048f15de7c0e783eedfaf","src/bindings/python/gen_python/custom.rs":"33756f6bdafbd9b1a3a439c1cced3c83dc1fdb82b5ec235c064e69670ea6086c","src/bindings/python/gen_python/enum_.rs":"634c8406b07cbd24ea4f71cae4c971169e4989ce8019188f4bcd515bc3c77c5d","src/bindings/python/gen_python/error.rs":"d1a3b3edb91d9502064463cc3324770a1a6e0f234d6b49b5d7c43636bfe81d59","src/bindings/python/gen_python/external.rs":"8920b7a2a3b39a9647ec17cdff44308db3bfe9a582f026b060003edd76407599","src/bindings/python/gen_python/miscellany.rs":"f3898b75cf494b39662d886eb78d9cc06685650265fc8a1e87e5de67baa342ae","src/bindings/python/gen_python/mod.rs":"552de45cab20c4467bdcc774c305f298c9d7487c6b89f6786cb7ef1774ccddf6","src/bindings/python/gen_python/object.rs":"b4d3d8a935d4acd689cf1f3857d461dbab3a51c7c8bd821890198fb58ef3a63f","src/bindings/python/gen_python/primitives.rs":"928523bb91d2192d615d044f1fef3714681140562b740cf72dce3168e660e276","src/bindings/python/gen_python/record.rs":"f961dfe8dd1e5caa633754de7ecc684c2211c9b6633a5e6beb6053e60500b9f2","src/bindings/python/mod.rs":"bcf295b334b332c7fd1214ddfdaa727cfe37fed531c3862ce25906b3a70b71c7","src/bindings/python/templates/BooleanHelper.py":"d384ffeefcb5982c4875e819d06e919a295eaa9ff57735e6fef0801bb810d5c9","src/bindings/python/templates/CallbackInterfaceRuntime.py":"7ffef485fc008e2d9efcd07326102f300bd4673b4351353e9e2908355936c3d7","src/bindings/python/templates/CallbackInterfaceTemplate.py":"089b5cc1131e8c9b867c899cb649ce22eb9ba6a4addab4ebf9ba63316c394693","src/bindings/python/templates/CustomType.py":"db3309b3f944fb813d4cef47a04d67a86f824183f7e31289184683155fd985d9","src/bindings/python/templates/DurationHelper.py":"179c14dccd8cc7dc9791f896414f0b5d124ec116eb78173371bd8a0743208da1","src/bindings/python/templates/EnumTemplate.py":"825ca373286f1b3b252b8a1263e29c9e2f0d3e170ceb364bd6c28d6c4595597b","src/bindings/python/templates/ErrorTemplate.py":"b6b1b0d3fc074a7c3ba7db394c5d6cb3279b0fc0e6a331154303c2c6c907458b","src/bindings/python/templates/ExternalTemplate.py":"f582a6e872fe9f8275d33d36ffe017028ca459fe7c53aa680a2512718d0c0fda","src/bindings/python/templates/Float32Helper.py":"7dbc51889cff47ebf1600fad490849e4a87cac4fc0d1756eebd21609eb80b4a9","src/bindings/python/templates/Float64Helper.py":"ba9f334d1339b6eaedcacc1e35068939727170a684f41dec9ee04762ed98cec1","src/bindings/python/templates/Helpers.py":"68f03f651c38c810fa453e123e26f7c94b7a1f9178e0d863b985c3c8fabaa642","src/bindings/python/templates/Int16Helper.py":"60c22fb8b445841ebb3c68be11b81c9eba84a680eaa0e30770953361231da9b5","src/bindings/python/templates/Int32Helper.py":"aff0a017cf767394174e46d8c4fe5a5a704a8e6384fcc38d227634dfe7826916","src/bindings/python/templates/Int64Helper.py":"6c314b91699a6c6ad7db3ef636713bc2a0af9609c82acfd6062b0588177c0026","src/bindings/python/templates/Int8Helper.py":"a6e2d121b1a6d59886fceab3949e571aba1abc06dfede52666954bf15366fb6f","src/bindings/python/templates/MapTemplate.py":"bbe609b865010b98b38c58f2d4fcc97f2adec3e931903bf67263a5e440a84400","src/bindings/python/templates/NamespaceLibraryTemplate.py":"4726dbeb61508a71153436126bc04d03af966dca4f5b37511beb8bcfb6f1f307","src/bindings/python/templates/ObjectTemplate.py":"68302f6da6e4e80fc0cc8eb4ef2d4353d19ad3e9955112a2fabec8bf1b1293c7","src/bindings/python/templates/OptionalTemplate.py":"ab6da433370ba7c1316e266247ee1b7165bc02f6f288e40a7c68806c018e3282","src/bindings/python/templates/RecordTemplate.py":"98cef2adbc2b890e5c67257fb32a57380070988ef4112408eeca85e0b87b566b","src/bindings/python/templates/RustBufferHelper.py":"11f733051e63733c637fb19c4758cb58a40d045792028465f36891f89c7c5f36","src/bindings/python/templates/RustBufferTemplate.py":"90950cfeeb7a028aac9b65aeca897b217eddcfa165a0d59e8af037e834f34146","src/bindings/python/templates/SequenceTemplate.py":"faf2b1d5272a66258972d88c29d5b527cf9e589c8399e30f7ad5a0503133ce9b","src/bindings/python/templates/StringHelper.py":"941a7ad71d9598701efa15323df93766934583a55f4266d26db31e6b744603fc","src/bindings/python/templates/TimestampHelper.py":"b412cea69117858c05bae3210d378c6296658ed02a50e87c52c392dcb62c7892","src/bindings/python/templates/TopLevelFunctionTemplate.py":"2b2883b14f324e543cfeea5293d2a4907fa9ebe93b779da7174a58929d8b0442","src/bindings/python/templates/Types.py":"2eee78ca838f65b7e8ff8f760558c71ca80ad314aaa44efd1d1b8e13b349f1bc","src/bindings/python/templates/UInt16Helper.py":"06be5c9dacdf20e586f8236ed75cf2ca2470078fd8570843ea97c581b25bf860","src/bindings/python/templates/UInt32Helper.py":"41bb9bbf9b7be1060945e1267b1cc052585ec43696b1591f0ee779a0be0feaff","src/bindings/python/templates/UInt64Helper.py":"ba2825fc295a07292d9fb4aeebe74dabb9e6dbe505643e2347875ab12e511f31","src/bindings/python/templates/UInt8Helper.py":"dca5b3fc4a429fb233326224f85c4eccd3a7802ca9958ec309c7f197d59b4e3d","src/bindings/python/templates/macros.py":"3f02a32941e20aea15e136780c24c9695021dbcae08044c4f654f75aadcbd1e1","src/bindings/python/templates/wrapper.py":"627a6e18e72040909887261b8ad918c68104b15110df26b2205d7827c690e8c3","src/bindings/ruby/gen_ruby/mod.rs":"33ae9fc3f69e4c5b7bb6df41e53298f89934cee2bb6d7e7ea8488cefc9d06c03","src/bindings/ruby/gen_ruby/tests.rs":"7dcb86b08e643c43503f4cac6396833497f6988b004321c0067700ee29ffbf32","src/bindings/ruby/mod.rs":"f57fccdfc544210e8cc70e01e4991cee6e72d258ede9d2bb226baad24a3ef0d7","src/bindings/ruby/templates/EnumTemplate.rb":"5480edb347f5829e478d19474691babd72f37616ed846d519b5a61cb1d6cf047","src/bindings/ruby/templates/ErrorTemplate.rb":"147b2c3ff44c19624e7bf7b3a2a04b7badbba5743eaefa0d5e6c05943119c87e","src/bindings/ruby/templates/NamespaceLibraryTemplate.rb":"9b1454208bc83ef8f26aef33713d681e2284dbfea986ec0dd6c9b9c8b7d65e4a","src/bindings/ruby/templates/ObjectTemplate.rb":"c2d2fa2db62d48322b66b53888dcc6de2fc3e579a6b8d0a9f24029c18fffcbb5","src/bindings/ruby/templates/RecordTemplate.rb":"4aeff886928ca972e5dc9b799581b30c66a6f6dce446af3285dd3ed6b422dea9","src/bindings/ruby/templates/RustBufferBuilder.rb":"2ee5a4b97fe590de98ec2119b2dfe103bba75e15b5fb3c178fa51dfa662dfe2c","src/bindings/ruby/templates/RustBufferStream.rb":"ddfc38a6388bdddf8cc24bb6f1af948e4eef2d7ae2091a5130fee57cf53e5a7d","src/bindings/ruby/templates/RustBufferTemplate.rb":"8f37664f5436ba74ccdd801e16220f1b879d2fb56f51f5845b6047c92dc079f8","src/bindings/ruby/templates/TopLevelFunctionTemplate.rb":"88213e7e25bef664da939c04dd5621f438af735ffcb4d2d0c24a529538630069","src/bindings/ruby/templates/macros.rb":"d732a62291c78ccfbc3208227c1b57f6add723fad91b7e699d693e360840e1b0","src/bindings/ruby/templates/wrapper.rb":"542cdf46fb871e66089c9f008cf472cca411fe217d8c66a0a66776c35469aab5","src/bindings/swift/gen_swift/callback_interface.rs":"e331871ac6c9ac9b9533848fb6ddfcabc1e605970343cad307b6d86b72ebe96a","src/bindings/swift/gen_swift/compounds.rs":"f9e87b342f1f9a14295d87bad59d786d4c253a24d22900c2aba44816713718ae","src/bindings/swift/gen_swift/custom.rs":"45cdfa35ef7345dc353d0d2f3cebb17d726e90abdf5ef49422d6b2db65f8fd25","src/bindings/swift/gen_swift/enum_.rs":"018eea78ef85c9f8d715a5bc15c8273030d4f6ba297019949eb578c5cc6276fd","src/bindings/swift/gen_swift/error.rs":"bd95c3303e40f03a321f2cdc8e15a0251f4c7ddbc3c32c4c57eb9569db218488","src/bindings/swift/gen_swift/miscellany.rs":"66f16968f6cccc0b61c544e336a49b96218551731dcce566a176903c9afb3b57","src/bindings/swift/gen_swift/mod.rs":"1e8f98e05a5b03798c91ada854f6a4f2a0682c252143d63c16c6a06bd0419e4b","src/bindings/swift/gen_swift/object.rs":"072a44f484cc66694c57a9fa41ba50a531c9ce19738e11ce9df17cdfc007648f","src/bindings/swift/gen_swift/primitives.rs":"b37b8f3ad3aa7e769e6d465a31282e377f93cd69e4dcf39a56dc833f412ed412","src/bindings/swift/gen_swift/record.rs":"48296332960be3731b9139dc664d4b8a5d56d04cffa34dc995b62cf202b4dbfd","src/bindings/swift/mod.rs":"0ad4afd667ef17b3b577ded9a09cdaa5595afbdb24e7474c6b1e6a8e0a024593","src/bindings/swift/templates/BooleanHelper.swift":"f607928c4d598893421fe9c9f183bab2f23a877a07afeb123dbe90515249ec86","src/bindings/swift/templates/BridgingHeaderTemplate.h":"93a289e393ecdbe1bf986215c3b19d2aed7677d47f79b1833ce73cf6f8762e80","src/bindings/swift/templates/CallbackInterfaceRuntime.swift":"aac01eb4269151be9dde8c95ee8eba7e8d0841b3c2b1dbd88885f01ac64ee147","src/bindings/swift/templates/CallbackInterfaceTemplate.swift":"c9700f52e932556c59a9bfea68fc786746b7f321ff75c33d0a8c1565effaeef5","src/bindings/swift/templates/CustomType.swift":"fe6414f2ce3ea7b148742e2fecf2206d7e69935dd78d56e014aec70f4d6ad3ec","src/bindings/swift/templates/DurationHelper.swift":"bca4a6498b27fe0c877df3c7fbe148538eeda03e68d4e760a7c8a6a15f2067ff","src/bindings/swift/templates/EnumTemplate.swift":"e61bdf7949aa5a7b55a2c10c243e960f683c862e5977f06e7f5956646b4ccb49","src/bindings/swift/templates/ErrorTemplate.swift":"58fb5907d20b7a6db67b128e5f6350015278990fef5945be42477a5b5f82bb18","src/bindings/swift/templates/Float32Helper.swift":"6c1a4da059dd4c6c4392511c93fe9daf4ddeeab71e39afd122797b0e19254318","src/bindings/swift/templates/Float64Helper.swift":"f741568cdfb8e1421369a9a1dc845630a3a0e2dc2d6acf157afd80cd3ef5966f","src/bindings/swift/templates/Helpers.swift":"3cf3a5342a1ef0c7e078b0e58c32ae4437c4fb5dc41acbbd56b1128393c76602","src/bindings/swift/templates/Int16Helper.swift":"76eec2a54a65790c5959380cc9a7362b1e2e201632cccb789153c52e10c8dc4f","src/bindings/swift/templates/Int32Helper.swift":"5afc5e103bf637813fd4b77ab63e47ed38893525101a483218a339f222710061","src/bindings/swift/templates/Int64Helper.swift":"c1a6f6661ef1ad3bd00e8d0bf81adaa6539686eee2b481b046b76dbd87681adf","src/bindings/swift/templates/Int8Helper.swift":"bc46598c966e579cca22d336748c74cdce5674eaaaf75fc24e5fdaa36a43cf9c","src/bindings/swift/templates/MapTemplate.swift":"8b5a9cb41a1ad41b5566fbe3906a1449e5453289208a9fc6a611de1eb937142a","src/bindings/swift/templates/ModuleMapTemplate.modulemap":"99ad1e9bf550a21497296f9248ecd4385dd6d0b5892951d24cf990cdbf3eec2c","src/bindings/swift/templates/ObjectTemplate.swift":"98f744d7baf41e28d9184ae7e1aa9522b1bd951d507e0987879b11d7995782aa","src/bindings/swift/templates/OptionalTemplate.swift":"73f777d2df4fdf42daf0d6035436d168b0d5f0abc15153b97029bc305408f597","src/bindings/swift/templates/RecordTemplate.swift":"af0dc13b32d34254b4cfef3b74f52fd4611aa6c32e055e203414511fd3bbb00a","src/bindings/swift/templates/RustBufferTemplate.swift":"ed16f20cecd264f086c923cd92a5198f444aec99aad4d39e9012f09f530ca809","src/bindings/swift/templates/SequenceTemplate.swift":"977f1409909ff08018c0a80c1330737023b39a8f9fa9a13f5bf9ab4806cac199","src/bindings/swift/templates/StringHelper.swift":"b773c2b3a03f30338ff233881d1b0c0238831b812eff6eb9f0fafcb32ab0743a","src/bindings/swift/templates/TimestampHelper.swift":"6e22e370feae1199bff16bcc6f431decfb7700b02e6afdd84693a0c474eb045e","src/bindings/swift/templates/TopLevelFunctionTemplate.swift":"ca7fcbaa06ee31c7433fd6aa238b6c1135a843f469d9b4f37d4874d514fd80d0","src/bindings/swift/templates/Types.swift":"2f42430cb4ffba8e9b5084c0cf8790fb5bae151878134b8a21e745acf75d2b08","src/bindings/swift/templates/UInt16Helper.swift":"16adb3b50403dad114fad0b86bc220c5adc3bd987c57c290aee7c6407891dfbc","src/bindings/swift/templates/UInt32Helper.swift":"680ddd2815184f520723820f10698a089c222df0388bc0f7734c6d5234194aec","src/bindings/swift/templates/UInt64Helper.swift":"b752852162028a0c132f79f9005c47c263a4dab98833e86758cd7b467e305629","src/bindings/swift/templates/UInt8Helper.swift":"54f4821e704969eeb5c0e002b890d975a20eda3ddc3ee56169ee3c615dfa1079","src/bindings/swift/templates/macros.swift":"0744724c37419e894132b39aea4b8e1f473460583883fa37f38c787a7deea32c","src/bindings/swift/templates/wrapper.swift":"ca1af5fe47bca972c76fb8c9f52b18f727d4343204408de3dd0aae384f0a4171","src/interface/attributes.rs":"2f76377eebdd62e770bb9089885482a49a57e1f8405320bb778353f3e8974447","src/interface/callbacks.rs":"c9f4b97b21195ba2d1787f032f1daa5f4ce2fc40e014942e07e4eb37b5b95ee9","src/interface/enum_.rs":"1a7cda619a986a20fd4d0f145206aba2c500ce5dfca90d01e5324996fd68dc04","src/interface/error.rs":"f31fc0a7e41b4c8f4b81d06958fda14af6f05bfa318206098e0ec351cf4db809","src/interface/ffi.rs":"22d24e4dda327fa78c7632a6e5bbe374ecac0165acc550007feb729d8f4d6adf","src/interface/function.rs":"d6df6d8d412d7c45fe33c7337b37aeb851ae0f21834c4bd8b315aad4ca4ec309","src/interface/literal.rs":"3d2102cb47ff658f329d66d6c867b13a50e7f56535f23c1b414f857741360358","src/interface/mod.rs":"1d1993504ce61a2f578cb6fb42c79b7829a0767c20983581d631ee948819665e","src/interface/namespace.rs":"ab0f63241bb6a0a32f9fd2a1544468cb6daa1f91f6116b7246b52a4a94e4f461","src/interface/object.rs":"44836747d5d00bb40ecadb889c9a6ff32c1cbf625b5a6a337f5891f495fd92fd","src/interface/record.rs":"5859ea6c1f6c5524d1e6f3846954986710d5f74f1c6fd6324c4245b5f70013d5","src/interface/types/finder.rs":"a27f24e64b5bfc796378d1012b5e72001f0a442e8185fdc4430b106595d4b819","src/interface/types/mod.rs":"fe63c3fd233ad905af0358c5d610c85a5a57f263eb899acc756454a1029c4569","src/interface/types/resolver.rs":"7e7ce336ef77c0a6c23deea36856737a97cca9b1c3f5cd0d676fe7df6ade6480","src/lib.rs":"a41b43e3628bb6b3f725580eec255b409947945672887de87c21d5122775a245","src/macro_metadata/ci.rs":"0d6e53d2b5645dd3cc7d196bd3a32ee82c029e1adb9ae93708c27a3fa5c55a88","src/macro_metadata/extract.rs":"ec392692a4601343312f60937987fe460cfb40d2c63a6bb1531fe91903916f10","src/macro_metadata/mod.rs":"1668e6d947fd4a957f557410a8095649de6f8d7fd3eb6a403b8587280dca2d54","src/main.rs":"bbf8e9942d398387e7518533f9b9dc42bfa66156430a87a17605a80a356c0dea","src/scaffolding/mod.rs":"35ae72220843cf3cccefd96e190553e32a5f34ccc58d552fd9165faea12db260","src/scaffolding/templates/CallbackInterfaceTemplate.rs":"3c8caa2e148add8d80701894ee6904fc2d3c5c6424d6d414b36edb6f593b5023","src/scaffolding/templates/EnumTemplate.rs":"eb8802f04f1fd1c9451ad72c1195c136288fdb4e488922b24db75b2fdae65cd7","src/scaffolding/templates/ErrorTemplate.rs":"e7ca4538908a273dd7ba3834219b30fa0e537b2171144f06b6a96fbefb90cd1d","src/scaffolding/templates/ExternalTypesTemplate.rs":"8ecc805cf119abac8c5f60605f9183ee9ec8d37f9ec75bba5e18bb8b482a1abb","src/scaffolding/templates/ObjectTemplate.rs":"34de640428486e17a61ded4f42ce13d8eac3e66cc9f60196ce2575cdc0bd8df6","src/scaffolding/templates/RecordTemplate.rs":"e8d5af954f46f023a243721d6fc70aa176c3a4c0a9dd340048bfe46f3eeed783","src/scaffolding/templates/ReexportUniFFIScaffolding.rs":"559a17c8e39c473ff1effe9651f05b83d443ecd8abed13e03f2b63872d7e1593","src/scaffolding/templates/RustBuffer.rs":"ccf7521012d93c41265375c6d2e80ce861ec93b41383da83c37718386dd726f6","src/scaffolding/templates/TopLevelFunctionTemplate.rs":"35eaefb0862f25ff683d58fb0be6ad5f74bbe2fc85047273200c3a5f4c728434","src/scaffolding/templates/macros.rs":"a41c9690d411074c59fc4609f897431669b9d939625a08f5304a71a88901ba7c","src/scaffolding/templates/scaffolding_template.rs":"3589f8e8e1f9b194ff4a6245665d3a421c771dec3cc947c4264bfcd34573550e"},"package":"12cc4af3c0180c7e86c4a3acf2b6587af04ba2567b1e948993df10f421796621"} -\ No newline at end of file -+{"files":{"Cargo.lock":"3b1693f0ada97ba7e0527d763402404b39fe341da22bd45aaf057e4be3fa3234","Cargo.toml":"58662147277f1620eccd6592f83623cf71959df8326e9d700fdaac47c6e6cf35","askama.toml":"1a245b7803adca782837e125c49100147d2de0d5a1c949ff95e91af1701f6058","src/backend/config.rs":"4861dbf251dbb10beb1ed7e3eea7d79499a0de1cd9ce9ee8381a0e729c097dea","src/backend/declarations.rs":"12b8d6e651f84634de5cd02a47601965df7438f64f1a73f136bd89b6b5d515cf","src/backend/mod.rs":"899cd3b816d0467e35789b92ac3b8d5910f6dab98156d405db4803da8721fd36","src/backend/oracle.rs":"9e2b8a45af604a6e4952644e81f43f6aec6e0a1d03939c68b582529dd01a51e0","src/backend/types.rs":"7c49a92096a54eefd2336c48d60fe20ded9490142ab3a229a7c1a99fec14df3d","src/bindings/kotlin/gen_kotlin/callback_interface.rs":"b7fe795670830f3aa8a955c787b1127fe68313ee751013948527948fe5526b01","src/bindings/kotlin/gen_kotlin/compounds.rs":"d1e9a4237ff2ff711a3eae7a564c39e26f598c156ebfd34c0f04879e3533dd4f","src/bindings/kotlin/gen_kotlin/custom.rs":"4176f6ed5f66504f8fd981198bbfbae795dab5ef0d0281881d19b697f5560c44","src/bindings/kotlin/gen_kotlin/enum_.rs":"f85ae8dcb55c8f274139bf321af0ba237ae69894165ad6bd693d793f58af8e5e","src/bindings/kotlin/gen_kotlin/error.rs":"867f583aea5da7aabeb9b6d2544d7e52984cdea4aa008ce5f2ec941074735e1a","src/bindings/kotlin/gen_kotlin/external.rs":"1f7e91d7439891fe3c403274e35880ee4fc3a0da555510bdfa23c1ed2bbd8020","src/bindings/kotlin/gen_kotlin/miscellany.rs":"644ee5bb1f3619be5a36b2b3900af554ea38073cd054004f421e69c3cb8d50bc","src/bindings/kotlin/gen_kotlin/mod.rs":"90412e7927c284668a9eb75823c198182e58e5177d5561896c43b79367564b27","src/bindings/kotlin/gen_kotlin/object.rs":"6478a3e9d5e66186521730d0d481abd1ee4f123050ea050ac5a483842f08b003","src/bindings/kotlin/gen_kotlin/primitives.rs":"914d1f8253ed6a2937f67e8bd8f04f46aef4f22455ceb8a6caa84427adc2093e","src/bindings/kotlin/gen_kotlin/record.rs":"7961fcfbec5ebf8fc010b564ea4bd59402c919f6922898d48226d8c995569dd7","src/bindings/kotlin/mod.rs":"e68f2ea29e66ee62a56704e1e4464eea6d28bbdb52ab187bbe7a57ab3f362ea7","src/bindings/kotlin/templates/BooleanHelper.kt":"28e8a5088c8d58c9bfdbc575af8d8725060521fdd7d092684a8044b24ae567c7","src/bindings/kotlin/templates/CallbackInterfaceRuntime.kt":"6ede374b0fcbb3bcc939894e6f4729b3bec7ec7356831a60fba96ca38dc91aa8","src/bindings/kotlin/templates/CallbackInterfaceTemplate.kt":"5a704eb8c044ed22905e4d526ee3fc0b86f42fe82ac1eb4ad3758ad0552ea8c8","src/bindings/kotlin/templates/CustomTypeTemplate.kt":"5d4dacf29e89bcdcc46d155d993e6059d2df704e775dc853469310198253b231","src/bindings/kotlin/templates/DurationHelper.kt":"414a98161538a26f3a9b357353270c1f245ad6ceed99496aca7162cf473a92fd","src/bindings/kotlin/templates/EnumTemplate.kt":"ab3e2063aad3b91188db839dceb59b854a6a8b60fb35e545e270e64fee7c73fa","src/bindings/kotlin/templates/ErrorTemplate.kt":"a5ec2bdfc026838e1096dbf3301f21aa4ea22e8c93458d45bb1c8c7b9ee1fc5b","src/bindings/kotlin/templates/ExternalTypeTemplate.kt":"2097e0b830640ef18c79449ffa376d1dd35a8c4a5230e413c915f3b868aae872","src/bindings/kotlin/templates/FfiConverterTemplate.kt":"aa22962aaa9f641d48ccf44cb56d9f8a7736cbfaa01e1a1656662cfe5dd5c1d7","src/bindings/kotlin/templates/Float32Helper.kt":"662d95af3b629d143fb4d47cb7e9aa26ed28a5f3846de0341e28b0f9fb08bc25","src/bindings/kotlin/templates/Float64Helper.kt":"a77d099fa7d91e8702c1700e7949ffb6aaba9c6e8041ff48bab34b8e1fc9a0aa","src/bindings/kotlin/templates/Helpers.kt":"46c07798a26b53b06405c8bbbf86e3fcf38fadc1484ea04ce9d482defea89288","src/bindings/kotlin/templates/Int16Helper.kt":"7f83c4a48e1f3b2a59a3ca6a2662be8bc9baf3a5a748b31223cb3f51721ef249","src/bindings/kotlin/templates/Int32Helper.kt":"e02e4702175554b09fd2dd6ac3089dcd2c395f08ec60e762159566a9c9889450","src/bindings/kotlin/templates/Int64Helper.kt":"7a6fd6ca486852c89399c699935a9dfa1c32b9356d9a965cfde532581f05d9fa","src/bindings/kotlin/templates/Int8Helper.kt":"0554545494b6b9a76ce94f9c1723f8cf4230a13076feb75d620b1c9ca1ac4668","src/bindings/kotlin/templates/MapTemplate.kt":"399569d6443e8ad01e2deb95d78d8d2d15bf8eccee8be4fbe9ce4b8ebc0a6101","src/bindings/kotlin/templates/NamespaceLibraryTemplate.kt":"1eba4e77381155c2c96a6af2ef30fca881ade4957852f730fd10aa4f3d9cd3c4","src/bindings/kotlin/templates/ObjectRuntime.kt":"c11d233de41405caa55a56bcaa3bb69ce153ffa6fdff2aa218051929f5c4aeec","src/bindings/kotlin/templates/ObjectTemplate.kt":"7e32d92ec6116da9b7d7f278b15333a2fd2a82dde8c21534e3f6fe371d19f333","src/bindings/kotlin/templates/OptionalTemplate.kt":"5f9f2c1baa829ed3c9b61c3edb0f1fccf5ea3cccc052a69cf8966715d8fcf149","src/bindings/kotlin/templates/RecordTemplate.kt":"193ecdad9322fb5483b95bf2a259270a9b22ba054790794e9abb3fd219196bc5","src/bindings/kotlin/templates/RustBufferTemplate.kt":"415637f80a78c12b3d00db063c14a7ab5c61b098bdb1fc81a0be8bae9511776b","src/bindings/kotlin/templates/SequenceTemplate.kt":"786693b20c608a4f059b91df115278f5f12122b4c14a2e7ce18b6fc9b22b1296","src/bindings/kotlin/templates/StringHelper.kt":"060839663580d8199671b7c3bb3dce5e9106aa766ce2c6e0afc2d2bd788a1d83","src/bindings/kotlin/templates/TimestampHelper.kt":"353c2890f06ad6dda238e9aebb4bdff7bb838e17e46abf351ed3ff1fbc4e6580","src/bindings/kotlin/templates/TopLevelFunctionTemplate.kt":"09b8bb5ffea7075518ee657f83017d44ff0cbf584fd85676b082199139c9be09","src/bindings/kotlin/templates/Types.kt":"db7ed7384b4391a4bc1425ec3a89e0c890538ad30f5e115bae4998c059c8a21b","src/bindings/kotlin/templates/UInt16Helper.kt":"e84a1f30a5a899ba2c5db614d3f3c74f25bccf6dd99bf68b8830829332d051e9","src/bindings/kotlin/templates/UInt32Helper.kt":"7cdf08cc580046935f27ba07b53685968608a102e0a6be305111037c63d7ddf8","src/bindings/kotlin/templates/UInt64Helper.kt":"fd7baacbf3ab6202ff83edcc66e5f7beb11a10053ba66d0b49547616cc7cbe1f","src/bindings/kotlin/templates/UInt8Helper.kt":"bbf5a6d66c995aea9fe2fa9840c6bfa78b03520a09469b984f0e1d43191e453a","src/bindings/kotlin/templates/macros.kt":"eb5e0f9915b8ec9fbf3bf1a714625fbdcef7a7ee7461916e87fec872434ed3ec","src/bindings/kotlin/templates/wrapper.kt":"dd81cf28a4e07c685d29c87a4053eccb6339835cfc7fce3cf581d3d111fed4f5","src/bindings/mod.rs":"51ac55a3d505d5a88eedc83cf12623c2738277a9cd22bf3bbe05be1244de078b","src/bindings/python/gen_python/callback_interface.rs":"e3ffb8ba1aa8ac8ddcfff6554e7ec0d2d695d12955a98a04d114d2d6ca5dacc8","src/bindings/python/gen_python/compounds.rs":"e406c773c3b66368ea74973df742cdcba3014521812048f15de7c0e783eedfaf","src/bindings/python/gen_python/custom.rs":"33756f6bdafbd9b1a3a439c1cced3c83dc1fdb82b5ec235c064e69670ea6086c","src/bindings/python/gen_python/enum_.rs":"634c8406b07cbd24ea4f71cae4c971169e4989ce8019188f4bcd515bc3c77c5d","src/bindings/python/gen_python/error.rs":"d1a3b3edb91d9502064463cc3324770a1a6e0f234d6b49b5d7c43636bfe81d59","src/bindings/python/gen_python/external.rs":"8920b7a2a3b39a9647ec17cdff44308db3bfe9a582f026b060003edd76407599","src/bindings/python/gen_python/miscellany.rs":"f3898b75cf494b39662d886eb78d9cc06685650265fc8a1e87e5de67baa342ae","src/bindings/python/gen_python/mod.rs":"552de45cab20c4467bdcc774c305f298c9d7487c6b89f6786cb7ef1774ccddf6","src/bindings/python/gen_python/object.rs":"b4d3d8a935d4acd689cf1f3857d461dbab3a51c7c8bd821890198fb58ef3a63f","src/bindings/python/gen_python/primitives.rs":"928523bb91d2192d615d044f1fef3714681140562b740cf72dce3168e660e276","src/bindings/python/gen_python/record.rs":"f961dfe8dd1e5caa633754de7ecc684c2211c9b6633a5e6beb6053e60500b9f2","src/bindings/python/mod.rs":"bcf295b334b332c7fd1214ddfdaa727cfe37fed531c3862ce25906b3a70b71c7","src/bindings/python/templates/BooleanHelper.py":"d384ffeefcb5982c4875e819d06e919a295eaa9ff57735e6fef0801bb810d5c9","src/bindings/python/templates/CallbackInterfaceRuntime.py":"7ffef485fc008e2d9efcd07326102f300bd4673b4351353e9e2908355936c3d7","src/bindings/python/templates/CallbackInterfaceTemplate.py":"089b5cc1131e8c9b867c899cb649ce22eb9ba6a4addab4ebf9ba63316c394693","src/bindings/python/templates/CustomType.py":"db3309b3f944fb813d4cef47a04d67a86f824183f7e31289184683155fd985d9","src/bindings/python/templates/DurationHelper.py":"179c14dccd8cc7dc9791f896414f0b5d124ec116eb78173371bd8a0743208da1","src/bindings/python/templates/EnumTemplate.py":"825ca373286f1b3b252b8a1263e29c9e2f0d3e170ceb364bd6c28d6c4595597b","src/bindings/python/templates/ErrorTemplate.py":"b6b1b0d3fc074a7c3ba7db394c5d6cb3279b0fc0e6a331154303c2c6c907458b","src/bindings/python/templates/ExternalTemplate.py":"f582a6e872fe9f8275d33d36ffe017028ca459fe7c53aa680a2512718d0c0fda","src/bindings/python/templates/Float32Helper.py":"7dbc51889cff47ebf1600fad490849e4a87cac4fc0d1756eebd21609eb80b4a9","src/bindings/python/templates/Float64Helper.py":"ba9f334d1339b6eaedcacc1e35068939727170a684f41dec9ee04762ed98cec1","src/bindings/python/templates/Helpers.py":"68f03f651c38c810fa453e123e26f7c94b7a1f9178e0d863b985c3c8fabaa642","src/bindings/python/templates/Int16Helper.py":"60c22fb8b445841ebb3c68be11b81c9eba84a680eaa0e30770953361231da9b5","src/bindings/python/templates/Int32Helper.py":"aff0a017cf767394174e46d8c4fe5a5a704a8e6384fcc38d227634dfe7826916","src/bindings/python/templates/Int64Helper.py":"6c314b91699a6c6ad7db3ef636713bc2a0af9609c82acfd6062b0588177c0026","src/bindings/python/templates/Int8Helper.py":"a6e2d121b1a6d59886fceab3949e571aba1abc06dfede52666954bf15366fb6f","src/bindings/python/templates/MapTemplate.py":"bbe609b865010b98b38c58f2d4fcc97f2adec3e931903bf67263a5e440a84400","src/bindings/python/templates/NamespaceLibraryTemplate.py":"4726dbeb61508a71153436126bc04d03af966dca4f5b37511beb8bcfb6f1f307","src/bindings/python/templates/ObjectTemplate.py":"68302f6da6e4e80fc0cc8eb4ef2d4353d19ad3e9955112a2fabec8bf1b1293c7","src/bindings/python/templates/OptionalTemplate.py":"ab6da433370ba7c1316e266247ee1b7165bc02f6f288e40a7c68806c018e3282","src/bindings/python/templates/RecordTemplate.py":"98cef2adbc2b890e5c67257fb32a57380070988ef4112408eeca85e0b87b566b","src/bindings/python/templates/RustBufferHelper.py":"11f733051e63733c637fb19c4758cb58a40d045792028465f36891f89c7c5f36","src/bindings/python/templates/RustBufferTemplate.py":"90950cfeeb7a028aac9b65aeca897b217eddcfa165a0d59e8af037e834f34146","src/bindings/python/templates/SequenceTemplate.py":"faf2b1d5272a66258972d88c29d5b527cf9e589c8399e30f7ad5a0503133ce9b","src/bindings/python/templates/StringHelper.py":"941a7ad71d9598701efa15323df93766934583a55f4266d26db31e6b744603fc","src/bindings/python/templates/TimestampHelper.py":"b412cea69117858c05bae3210d378c6296658ed02a50e87c52c392dcb62c7892","src/bindings/python/templates/TopLevelFunctionTemplate.py":"2b2883b14f324e543cfeea5293d2a4907fa9ebe93b779da7174a58929d8b0442","src/bindings/python/templates/Types.py":"2eee78ca838f65b7e8ff8f760558c71ca80ad314aaa44efd1d1b8e13b349f1bc","src/bindings/python/templates/UInt16Helper.py":"06be5c9dacdf20e586f8236ed75cf2ca2470078fd8570843ea97c581b25bf860","src/bindings/python/templates/UInt32Helper.py":"41bb9bbf9b7be1060945e1267b1cc052585ec43696b1591f0ee779a0be0feaff","src/bindings/python/templates/UInt64Helper.py":"ba2825fc295a07292d9fb4aeebe74dabb9e6dbe505643e2347875ab12e511f31","src/bindings/python/templates/UInt8Helper.py":"dca5b3fc4a429fb233326224f85c4eccd3a7802ca9958ec309c7f197d59b4e3d","src/bindings/python/templates/macros.py":"3f02a32941e20aea15e136780c24c9695021dbcae08044c4f654f75aadcbd1e1","src/bindings/python/templates/wrapper.py":"627a6e18e72040909887261b8ad918c68104b15110df26b2205d7827c690e8c3","src/bindings/ruby/gen_ruby/mod.rs":"33ae9fc3f69e4c5b7bb6df41e53298f89934cee2bb6d7e7ea8488cefc9d06c03","src/bindings/ruby/gen_ruby/tests.rs":"7dcb86b08e643c43503f4cac6396833497f6988b004321c0067700ee29ffbf32","src/bindings/ruby/mod.rs":"f57fccdfc544210e8cc70e01e4991cee6e72d258ede9d2bb226baad24a3ef0d7","src/bindings/ruby/templates/EnumTemplate.rb":"5480edb347f5829e478d19474691babd72f37616ed846d519b5a61cb1d6cf047","src/bindings/ruby/templates/ErrorTemplate.rb":"147b2c3ff44c19624e7bf7b3a2a04b7badbba5743eaefa0d5e6c05943119c87e","src/bindings/ruby/templates/NamespaceLibraryTemplate.rb":"9b1454208bc83ef8f26aef33713d681e2284dbfea986ec0dd6c9b9c8b7d65e4a","src/bindings/ruby/templates/ObjectTemplate.rb":"c2d2fa2db62d48322b66b53888dcc6de2fc3e579a6b8d0a9f24029c18fffcbb5","src/bindings/ruby/templates/RecordTemplate.rb":"4aeff886928ca972e5dc9b799581b30c66a6f6dce446af3285dd3ed6b422dea9","src/bindings/ruby/templates/RustBufferBuilder.rb":"2ee5a4b97fe590de98ec2119b2dfe103bba75e15b5fb3c178fa51dfa662dfe2c","src/bindings/ruby/templates/RustBufferStream.rb":"ddfc38a6388bdddf8cc24bb6f1af948e4eef2d7ae2091a5130fee57cf53e5a7d","src/bindings/ruby/templates/RustBufferTemplate.rb":"8f37664f5436ba74ccdd801e16220f1b879d2fb56f51f5845b6047c92dc079f8","src/bindings/ruby/templates/TopLevelFunctionTemplate.rb":"88213e7e25bef664da939c04dd5621f438af735ffcb4d2d0c24a529538630069","src/bindings/ruby/templates/macros.rb":"d732a62291c78ccfbc3208227c1b57f6add723fad91b7e699d693e360840e1b0","src/bindings/ruby/templates/wrapper.rb":"542cdf46fb871e66089c9f008cf472cca411fe217d8c66a0a66776c35469aab5","src/bindings/swift/gen_swift/callback_interface.rs":"e331871ac6c9ac9b9533848fb6ddfcabc1e605970343cad307b6d86b72ebe96a","src/bindings/swift/gen_swift/compounds.rs":"f9e87b342f1f9a14295d87bad59d786d4c253a24d22900c2aba44816713718ae","src/bindings/swift/gen_swift/custom.rs":"45cdfa35ef7345dc353d0d2f3cebb17d726e90abdf5ef49422d6b2db65f8fd25","src/bindings/swift/gen_swift/enum_.rs":"018eea78ef85c9f8d715a5bc15c8273030d4f6ba297019949eb578c5cc6276fd","src/bindings/swift/gen_swift/error.rs":"bd95c3303e40f03a321f2cdc8e15a0251f4c7ddbc3c32c4c57eb9569db218488","src/bindings/swift/gen_swift/miscellany.rs":"66f16968f6cccc0b61c544e336a49b96218551731dcce566a176903c9afb3b57","src/bindings/swift/gen_swift/mod.rs":"1e8f98e05a5b03798c91ada854f6a4f2a0682c252143d63c16c6a06bd0419e4b","src/bindings/swift/gen_swift/object.rs":"072a44f484cc66694c57a9fa41ba50a531c9ce19738e11ce9df17cdfc007648f","src/bindings/swift/gen_swift/primitives.rs":"b37b8f3ad3aa7e769e6d465a31282e377f93cd69e4dcf39a56dc833f412ed412","src/bindings/swift/gen_swift/record.rs":"48296332960be3731b9139dc664d4b8a5d56d04cffa34dc995b62cf202b4dbfd","src/bindings/swift/mod.rs":"0ad4afd667ef17b3b577ded9a09cdaa5595afbdb24e7474c6b1e6a8e0a024593","src/bindings/swift/templates/BooleanHelper.swift":"f607928c4d598893421fe9c9f183bab2f23a877a07afeb123dbe90515249ec86","src/bindings/swift/templates/BridgingHeaderTemplate.h":"93a289e393ecdbe1bf986215c3b19d2aed7677d47f79b1833ce73cf6f8762e80","src/bindings/swift/templates/CallbackInterfaceRuntime.swift":"aac01eb4269151be9dde8c95ee8eba7e8d0841b3c2b1dbd88885f01ac64ee147","src/bindings/swift/templates/CallbackInterfaceTemplate.swift":"c9700f52e932556c59a9bfea68fc786746b7f321ff75c33d0a8c1565effaeef5","src/bindings/swift/templates/CustomType.swift":"fe6414f2ce3ea7b148742e2fecf2206d7e69935dd78d56e014aec70f4d6ad3ec","src/bindings/swift/templates/DurationHelper.swift":"bca4a6498b27fe0c877df3c7fbe148538eeda03e68d4e760a7c8a6a15f2067ff","src/bindings/swift/templates/EnumTemplate.swift":"e61bdf7949aa5a7b55a2c10c243e960f683c862e5977f06e7f5956646b4ccb49","src/bindings/swift/templates/ErrorTemplate.swift":"58fb5907d20b7a6db67b128e5f6350015278990fef5945be42477a5b5f82bb18","src/bindings/swift/templates/Float32Helper.swift":"6c1a4da059dd4c6c4392511c93fe9daf4ddeeab71e39afd122797b0e19254318","src/bindings/swift/templates/Float64Helper.swift":"f741568cdfb8e1421369a9a1dc845630a3a0e2dc2d6acf157afd80cd3ef5966f","src/bindings/swift/templates/Helpers.swift":"3cf3a5342a1ef0c7e078b0e58c32ae4437c4fb5dc41acbbd56b1128393c76602","src/bindings/swift/templates/Int16Helper.swift":"76eec2a54a65790c5959380cc9a7362b1e2e201632cccb789153c52e10c8dc4f","src/bindings/swift/templates/Int32Helper.swift":"5afc5e103bf637813fd4b77ab63e47ed38893525101a483218a339f222710061","src/bindings/swift/templates/Int64Helper.swift":"c1a6f6661ef1ad3bd00e8d0bf81adaa6539686eee2b481b046b76dbd87681adf","src/bindings/swift/templates/Int8Helper.swift":"bc46598c966e579cca22d336748c74cdce5674eaaaf75fc24e5fdaa36a43cf9c","src/bindings/swift/templates/MapTemplate.swift":"8b5a9cb41a1ad41b5566fbe3906a1449e5453289208a9fc6a611de1eb937142a","src/bindings/swift/templates/ModuleMapTemplate.modulemap":"99ad1e9bf550a21497296f9248ecd4385dd6d0b5892951d24cf990cdbf3eec2c","src/bindings/swift/templates/ObjectTemplate.swift":"98f744d7baf41e28d9184ae7e1aa9522b1bd951d507e0987879b11d7995782aa","src/bindings/swift/templates/OptionalTemplate.swift":"73f777d2df4fdf42daf0d6035436d168b0d5f0abc15153b97029bc305408f597","src/bindings/swift/templates/RecordTemplate.swift":"af0dc13b32d34254b4cfef3b74f52fd4611aa6c32e055e203414511fd3bbb00a","src/bindings/swift/templates/RustBufferTemplate.swift":"ed16f20cecd264f086c923cd92a5198f444aec99aad4d39e9012f09f530ca809","src/bindings/swift/templates/SequenceTemplate.swift":"977f1409909ff08018c0a80c1330737023b39a8f9fa9a13f5bf9ab4806cac199","src/bindings/swift/templates/StringHelper.swift":"b773c2b3a03f30338ff233881d1b0c0238831b812eff6eb9f0fafcb32ab0743a","src/bindings/swift/templates/TimestampHelper.swift":"6e22e370feae1199bff16bcc6f431decfb7700b02e6afdd84693a0c474eb045e","src/bindings/swift/templates/TopLevelFunctionTemplate.swift":"ca7fcbaa06ee31c7433fd6aa238b6c1135a843f469d9b4f37d4874d514fd80d0","src/bindings/swift/templates/Types.swift":"2f42430cb4ffba8e9b5084c0cf8790fb5bae151878134b8a21e745acf75d2b08","src/bindings/swift/templates/UInt16Helper.swift":"16adb3b50403dad114fad0b86bc220c5adc3bd987c57c290aee7c6407891dfbc","src/bindings/swift/templates/UInt32Helper.swift":"680ddd2815184f520723820f10698a089c222df0388bc0f7734c6d5234194aec","src/bindings/swift/templates/UInt64Helper.swift":"b752852162028a0c132f79f9005c47c263a4dab98833e86758cd7b467e305629","src/bindings/swift/templates/UInt8Helper.swift":"54f4821e704969eeb5c0e002b890d975a20eda3ddc3ee56169ee3c615dfa1079","src/bindings/swift/templates/macros.swift":"0744724c37419e894132b39aea4b8e1f473460583883fa37f38c787a7deea32c","src/bindings/swift/templates/wrapper.swift":"ca1af5fe47bca972c76fb8c9f52b18f727d4343204408de3dd0aae384f0a4171","src/interface/attributes.rs":"6c062b60deb332fbb76e70bc675e65c2bc3f2060fad7cec87492609fa9ce166c","src/interface/callbacks.rs":"e311fe8c80fae1d84c1e867a3c36a47a6d6a41847bb2d633edefac7c69402c84","src/interface/enum_.rs":"4ff34ff12c19be0bc9d807020fd4c8e20660c418741e68408671a18165e4b95b","src/interface/error.rs":"85a61e5bb38b369b60110928a78dc84ae77a06d0cbae4dfe9ff9dff2b8c27e5a","src/interface/ffi.rs":"22d24e4dda327fa78c7632a6e5bbe374ecac0165acc550007feb729d8f4d6adf","src/interface/function.rs":"19219c6c984d4117362ee5c269712ec2ad462476902442062ef2a3b0619b014c","src/interface/literal.rs":"d93d168176ba2824d26c490396f4baffc1d418c3c94e4a1ef0ceb3cfca16a239","src/interface/mod.rs":"88dd169859004da79bd1488e6432bc7dae8b6cba9238cab1d676e570dad31d62","src/interface/namespace.rs":"ab0f63241bb6a0a32f9fd2a1544468cb6daa1f91f6116b7246b52a4a94e4f461","src/interface/object.rs":"106cbf5ec2a684700dd99c9748ba161320abb2cecec3c5022d5dd1a9ec4f5b85","src/interface/record.rs":"5b9db093c0c90f5c757e09e6c9afee6b99e2e724c7b388924990b1a6f46357e9","src/interface/types/finder.rs":"a27f24e64b5bfc796378d1012b5e72001f0a442e8185fdc4430b106595d4b819","src/interface/types/mod.rs":"25a598fd206975cc1e62aaa269b461654c913ad6c0b6a2719c486acfcc68b45b","src/interface/types/resolver.rs":"7e7ce336ef77c0a6c23deea36856737a97cca9b1c3f5cd0d676fe7df6ade6480","src/lib.rs":"a41b43e3628bb6b3f725580eec255b409947945672887de87c21d5122775a245","src/macro_metadata/ci.rs":"0d6e53d2b5645dd3cc7d196bd3a32ee82c029e1adb9ae93708c27a3fa5c55a88","src/macro_metadata/extract.rs":"ec392692a4601343312f60937987fe460cfb40d2c63a6bb1531fe91903916f10","src/macro_metadata/mod.rs":"1668e6d947fd4a957f557410a8095649de6f8d7fd3eb6a403b8587280dca2d54","src/main.rs":"bbf8e9942d398387e7518533f9b9dc42bfa66156430a87a17605a80a356c0dea","src/scaffolding/mod.rs":"35ae72220843cf3cccefd96e190553e32a5f34ccc58d552fd9165faea12db260","src/scaffolding/templates/CallbackInterfaceTemplate.rs":"3c8caa2e148add8d80701894ee6904fc2d3c5c6424d6d414b36edb6f593b5023","src/scaffolding/templates/EnumTemplate.rs":"eb8802f04f1fd1c9451ad72c1195c136288fdb4e488922b24db75b2fdae65cd7","src/scaffolding/templates/ErrorTemplate.rs":"e7ca4538908a273dd7ba3834219b30fa0e537b2171144f06b6a96fbefb90cd1d","src/scaffolding/templates/ExternalTypesTemplate.rs":"8ecc805cf119abac8c5f60605f9183ee9ec8d37f9ec75bba5e18bb8b482a1abb","src/scaffolding/templates/ObjectTemplate.rs":"34de640428486e17a61ded4f42ce13d8eac3e66cc9f60196ce2575cdc0bd8df6","src/scaffolding/templates/RecordTemplate.rs":"e8d5af954f46f023a243721d6fc70aa176c3a4c0a9dd340048bfe46f3eeed783","src/scaffolding/templates/ReexportUniFFIScaffolding.rs":"559a17c8e39c473ff1effe9651f05b83d443ecd8abed13e03f2b63872d7e1593","src/scaffolding/templates/RustBuffer.rs":"ccf7521012d93c41265375c6d2e80ce861ec93b41383da83c37718386dd726f6","src/scaffolding/templates/TopLevelFunctionTemplate.rs":"35eaefb0862f25ff683d58fb0be6ad5f74bbe2fc85047273200c3a5f4c728434","src/scaffolding/templates/macros.rs":"a41c9690d411074c59fc4609f897431669b9d939625a08f5304a71a88901ba7c","src/scaffolding/templates/scaffolding_template.rs":"3589f8e8e1f9b194ff4a6245665d3a421c771dec3cc947c4264bfcd34573550e"},"package":"5d46080a4840abccf7c0cce21931dae53215cbd7dd969b5e63c486235ce91a2a"} -\ No newline at end of file -diff --git a/third_party/rust/uniffi_bindgen/Cargo.lock b/third_party/rust/uniffi_bindgen/Cargo.lock ---- a/third_party/rust/uniffi_bindgen/Cargo.lock -+++ b/third_party/rust/uniffi_bindgen/Cargo.lock -@@ -2,13 +2,13 @@ - # It is not intended for manual editing. - version = 3 - - [[package]] - name = "anyhow" --version = "1.0.65" -+version = "1.0.66" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602" -+checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" - - [[package]] - name = "askama" - version = "0.11.1" - source = "registry+https://github.com/rust-lang/crates.io-index" -@@ -97,13 +97,13 @@ - source = "registry+https://github.com/rust-lang/crates.io-index" - checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - - [[package]] - name = "clap" --version = "3.2.22" -+version = "3.2.23" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750" -+checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" - dependencies = [ - "atty", - "bitflags", - "clap_derive", - "clap_lex", -@@ -136,13 +136,13 @@ - "os_str_bytes", - ] - - [[package]] - name = "fs-err" --version = "2.8.1" -+version = "2.9.0" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "64db3e262960f0662f43a6366788d5f10f7f244b8f7d7d987f560baf5ded5c50" -+checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" - - [[package]] - name = "goblin" - version = "0.5.4" - source = "registry+https://github.com/rust-lang/crates.io-index" -@@ -174,13 +174,13 @@ - "libc", - ] - - [[package]] - name = "indexmap" --version = "1.9.1" -+version = "1.9.2" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" -+checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" - dependencies = [ - "autocfg", - "hashbrown", - ] - -@@ -190,13 +190,13 @@ - source = "registry+https://github.com/rust-lang/crates.io-index" - checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" - - [[package]] - name = "libc" --version = "0.2.135" -+version = "0.2.138" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" -+checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" - - [[package]] - name = "log" - version = "0.4.17" - source = "registry+https://github.com/rust-lang/crates.io-index" -@@ -243,25 +243,25 @@ - "minimal-lexical", - ] - - [[package]] - name = "once_cell" --version = "1.15.0" -+version = "1.16.0" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" -+checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" - - [[package]] - name = "os_str_bytes" --version = "6.3.0" -+version = "6.4.1" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" -+checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" - - [[package]] - name = "paste" --version = "1.0.9" -+version = "1.0.10" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" -+checksum = "cf1c2c742266c2f1041c914ba65355a83ae8747b05f208319784083583494b4b" - - [[package]] - name = "plain" - version = "0.2.3" - source = "registry+https://github.com/rust-lang/crates.io-index" -@@ -291,13 +291,13 @@ - "version_check", - ] - - [[package]] - name = "proc-macro2" --version = "1.0.46" -+version = "1.0.47" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b" -+checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" - dependencies = [ - "unicode-ident", - ] - - [[package]] -@@ -335,50 +335,56 @@ - "syn", - ] - - [[package]] - name = "serde" --version = "1.0.145" -+version = "1.0.150" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" -+checksum = "e326c9ec8042f1b5da33252c8a37e9ffbd2c9bef0155215b6e6c80c790e05f91" - dependencies = [ - "serde_derive", - ] - - [[package]] - name = "serde_derive" --version = "1.0.145" -+version = "1.0.150" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" -+checksum = "42a3df25b0713732468deadad63ab9da1f1fd75a48a15024b50363f128db627e" - dependencies = [ - "proc-macro2", - "quote", - "syn", - ] - - [[package]] - name = "serde_json" --version = "1.0.86" -+version = "1.0.89" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "41feea4228a6f1cd09ec7a3593a682276702cd67b5273544757dae23c096f074" -+checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" - dependencies = [ - "itoa", - "ryu", - "serde", - ] - - [[package]] -+name = "siphasher" -+version = "0.3.10" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" -+ -+[[package]] - name = "strsim" - version = "0.10.0" - source = "registry+https://github.com/rust-lang/crates.io-index" - checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - - [[package]] - name = "syn" --version = "1.0.102" -+version = "1.0.105" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1" -+checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" - dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", - ] -@@ -392,19 +398,19 @@ - "winapi-util", - ] - - [[package]] - name = "textwrap" --version = "0.15.1" -+version = "0.16.0" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16" -+checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - - [[package]] - name = "toml" --version = "0.5.9" -+version = "0.5.10" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" -+checksum = "1333c76748e868a4d9d1017b5ab53171dfd095f70c712fdb4653a406547f598f" - dependencies = [ - "serde", - ] - - [[package]] -@@ -422,11 +428,11 @@ - source = "registry+https://github.com/rust-lang/crates.io-index" - checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" - - [[package]] - name = "uniffi_bindgen" --version = "0.21.0" -+version = "0.21.1" - dependencies = [ - "anyhow", - "askama", - "bincode", - "camino", -@@ -442,16 +448,28 @@ - "uniffi_meta", - "weedle2", - ] - - [[package]] -+name = "uniffi_checksum_derive" -+version = "0.21.1" -+source = "registry+https://github.com/rust-lang/crates.io-index" -+checksum = "78b6e16d46caf942016997af8bbdf4b163bf8ae3deb0b667d9643de7b7ffd4c9" -+dependencies = [ -+ "quote", -+ "syn", -+] -+ -+[[package]] - name = "uniffi_meta" --version = "0.21.0" -+version = "0.21.1" - source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "cd9417cc653937681436b93838d8c5f97a5b8c58697813982ee8810bd1dc3b57" -+checksum = "729835442da829c9b6f7c111c76cf87b2498e129101203bec94f0c39a3296a38" - dependencies = [ - "serde", -+ "siphasher", -+ "uniffi_checksum_derive", - ] - - [[package]] - name = "version_check" - version = "0.9.4" -diff --git a/third_party/rust/uniffi_bindgen/Cargo.toml b/third_party/rust/uniffi_bindgen/Cargo.toml ---- a/third_party/rust/uniffi_bindgen/Cargo.toml -+++ b/third_party/rust/uniffi_bindgen/Cargo.toml -@@ -10,22 +10,21 @@ - # See Cargo.toml.orig for the original contents. - - [package] - edition = "2021" - name = "uniffi_bindgen" --version = "0.21.0" -+version = "0.21.1" - authors = ["Firefox Sync Team "] - description = "a multi-language bindings generator for rust (codegen and cli tooling)" - homepage = "https://mozilla.github.io/uniffi-rs" - documentation = "https://mozilla.github.io/uniffi-rs" - keywords = [ - "ffi", - "bindgen", - ] - license = "MPL-2.0" - repository = "https://github.com/mozilla/uniffi-rs" --resolver = "2" - - [[bin]] - name = "uniffi-bindgen" - path = "src/main.rs" - -@@ -74,9 +73,9 @@ - - [dependencies.toml] - version = "0.5" - - [dependencies.uniffi_meta] --version = "=0.21.0" -+version = "=0.21.1" - - [dependencies.weedle2] - version = "4.0.0" -diff --git a/third_party/rust/uniffi_bindgen/src/interface/attributes.rs b/third_party/rust/uniffi_bindgen/src/interface/attributes.rs ---- a/third_party/rust/uniffi_bindgen/src/interface/attributes.rs -+++ b/third_party/rust/uniffi_bindgen/src/interface/attributes.rs -@@ -13,17 +13,18 @@ - //! We only support a small number of attributes, so it's manageable to have them - //! all handled by a single abstraction. This might need to be refactored in future - //! if we grow significantly more complicated attribute handling. - - use anyhow::{bail, Result}; -+use uniffi_meta::Checksum; - - /// Represents an attribute parsed from UDL, like `[ByRef]` or `[Throws]`. - /// - /// This is a convenience enum for parsing UDL attributes and erroring out if we encounter - /// any unsupported ones. These don't convert directly into parts of a `ComponentInterface`, but - /// may influence the properties of things like functions and arguments. --#[derive(Debug, Clone, Hash)] -+#[derive(Debug, Clone, Checksum)] - pub(super) enum Attribute { - ByRef, - Enum, - Error, - Name(String), -@@ -117,11 +118,11 @@ - Ok(attrs) - } - - /// Attributes that can be attached to an `enum` definition in the UDL. - /// There's only one case here: using `[Error]` to mark an enum as an error class. --#[derive(Debug, Clone, Hash, Default)] -+#[derive(Debug, Clone, Checksum, Default)] - pub(super) struct EnumAttributes(Vec); - - impl EnumAttributes { - pub fn contains_error_attr(&self) -> bool { - self.0.iter().any(|attr| attr.is_error()) -@@ -153,11 +154,11 @@ - - /// Represents UDL attributes that might appear on a function. - /// - /// This supports the `[Throws=ErrorName]` attribute for functions that - /// can produce an error. --#[derive(Debug, Clone, Hash, Default)] -+#[derive(Debug, Clone, Checksum, Default)] - pub(super) struct FunctionAttributes(Vec); - - impl FunctionAttributes { - pub(super) fn get_throws_err(&self) -> Option<&str> { - self.0.iter().find_map(|attr| match attr { -@@ -196,11 +197,11 @@ - - /// Represents UDL attributes that might appear on a function argument. - /// - /// This supports the `[ByRef]` attribute for arguments that should be passed - /// by reference in the generated Rust scaffolding. --#[derive(Debug, Clone, Hash, Default)] -+#[derive(Debug, Clone, Checksum, Default)] - pub(super) struct ArgumentAttributes(Vec); - - impl ArgumentAttributes { - pub fn by_ref(&self) -> bool { - self.0.iter().any(|attr| matches!(attr, Attribute::ByRef)) -@@ -231,11 +232,11 @@ - } - } - } - - /// Represents UDL attributes that might appear on an `interface` definition. --#[derive(Debug, Clone, Hash, Default)] -+#[derive(Debug, Clone, Checksum, Default)] - pub(super) struct InterfaceAttributes(Vec); - - impl InterfaceAttributes { - pub fn contains_enum_attr(&self) -> bool { - self.0.iter().any(|attr| attr.is_enum()) -@@ -285,11 +286,11 @@ - - /// Represents UDL attributes that might appear on a constructor. - /// - /// This supports the `[Throws=ErrorName]` attribute for constructors that can produce - /// an error, and the `[Name=MethodName]` for non-default constructors. --#[derive(Debug, Clone, Hash, Default)] -+#[derive(Debug, Clone, Checksum, Default)] - pub(super) struct ConstructorAttributes(Vec); - - impl ConstructorAttributes { - pub(super) fn get_throws_err(&self) -> Option<&str> { - self.0.iter().find_map(|attr| match attr { -@@ -324,11 +325,11 @@ - - /// Represents UDL attributes that might appear on a method. - /// - /// This supports the `[Throws=ErrorName]` attribute for methods that can produce - /// an error, and the `[Self=ByArc]` attribute for methods that take `Arc` as receiver. --#[derive(Debug, Clone, Hash, Default)] -+#[derive(Debug, Clone, Checksum, Default)] - pub(super) struct MethodAttributes(Vec); - - impl MethodAttributes { - pub(super) fn get_throws_err(&self) -> Option<&str> { - self.0.iter().find_map(|attr| match attr { -@@ -373,11 +374,11 @@ - /// Represents the different possible types of method call receiver. - /// - /// Actually we only support one of these right now, `[Self=ByArc]`. - /// We might add more in future, e.g. a `[Self=ByRef]` if there are cases - /// where we need to force the receiver to be taken by reference. --#[derive(Debug, Clone, Hash)] -+#[derive(Debug, Clone, Checksum)] - pub(super) enum SelfType { - ByArc, // Method receiver is `Arc`. - } - - impl TryFrom<&weedle::attribute::IdentifierOrString<'_>> for SelfType { -@@ -396,11 +397,11 @@ - } - - /// Represents UDL attributes that might appear on a typedef - /// - /// This supports the `[External="crate_name"]` and `[Custom]` attributes for types. --#[derive(Debug, Clone, Hash, Default)] -+#[derive(Debug, Clone, Checksum, Default)] - pub(super) struct TypedefAttributes(Vec); - - impl TypedefAttributes { - pub(super) fn get_crate_name(&self) -> String { - self.0 -diff --git a/third_party/rust/uniffi_bindgen/src/interface/callbacks.rs b/third_party/rust/uniffi_bindgen/src/interface/callbacks.rs ---- a/third_party/rust/uniffi_bindgen/src/interface/callbacks.rs -+++ b/third_party/rust/uniffi_bindgen/src/interface/callbacks.rs -@@ -31,23 +31,29 @@ - //! assert_eq!(callback.name(), "Example"); - //! assert_eq!(callback.methods()[0].name(), "hello"); - //! # Ok::<(), anyhow::Error>(()) - //! ``` - --use std::hash::{Hash, Hasher}; -- - use anyhow::{bail, Result}; -+use uniffi_meta::Checksum; - - use super::ffi::{FFIArgument, FFIFunction, FFIType}; - use super::object::Method; - use super::types::{Type, TypeIterator}; - use super::{APIConverter, ComponentInterface}; - --#[derive(Debug, Clone)] -+#[derive(Debug, Clone, Checksum)] - pub struct CallbackInterface { - pub(super) name: String, - pub(super) methods: Vec, -+ // We don't include the FFIFunc in the hash calculation, because: -+ // - it is entirely determined by the other fields, -+ // so excluding it is safe. -+ // - its `name` property includes a checksum derived from the very -+ // hash value we're trying to calculate here, so excluding it -+ // avoids a weird circular depenendency in the calculation. -+ #[checksum_ignore] - pub(super) ffi_init_callback: FFIFunction, - } - - impl CallbackInterface { - fn new(name: String) -> CallbackInterface { -@@ -86,23 +92,10 @@ - pub fn iter_types(&self) -> TypeIterator<'_> { - Box::new(self.methods.iter().flat_map(Method::iter_types)) - } - } - --impl Hash for CallbackInterface { -- fn hash(&self, state: &mut H) { -- // We don't include the FFIFunc in the hash calculation, because: -- // - it is entirely determined by the other fields, -- // so excluding it is safe. -- // - its `name` property includes a checksum derived from the very -- // hash value we're trying to calculate here, so excluding it -- // avoids a weird circular depenendency in the calculation. -- self.name.hash(state); -- self.methods.hash(state); -- } --} -- - impl APIConverter for weedle::CallbackInterfaceDefinition<'_> { - fn convert(&self, ci: &mut ComponentInterface) -> Result { - if self.attributes.is_some() { - bail!("callback interface attributes are not supported yet"); - } -diff --git a/third_party/rust/uniffi_bindgen/src/interface/enum_.rs b/third_party/rust/uniffi_bindgen/src/interface/enum_.rs ---- a/third_party/rust/uniffi_bindgen/src/interface/enum_.rs -+++ b/third_party/rust/uniffi_bindgen/src/interface/enum_.rs -@@ -75,21 +75,22 @@ - //! assert_eq!(e.variants()[1].fields()[0].name(), "first"); - //! # Ok::<(), anyhow::Error>(()) - //! ``` - - use anyhow::{bail, Result}; -+use uniffi_meta::Checksum; - - use super::record::Field; - use super::types::{Type, TypeIterator}; - use super::{APIConverter, ComponentInterface}; - - /// Represents an enum with named variants, each of which may have named - /// and typed fields. - /// - /// Enums are passed across the FFI by serializing to a bytebuffer, with a - /// i32 indicating the variant followed by the serialization of each field. --#[derive(Debug, Clone, Hash)] -+#[derive(Debug, Clone, Checksum)] - pub struct Enum { - pub(super) name: String, - pub(super) variants: Vec, - // "Flat" enums do not have, and will never have, variants with associated data. - pub(super) flat: bool, -@@ -172,11 +173,11 @@ - } - - /// Represents an individual variant in an Enum. - /// - /// Each variant has a name and zero or more fields. --#[derive(Debug, Clone, Default, Hash)] -+#[derive(Debug, Clone, Default, Checksum)] - pub struct Variant { - pub(super) name: String, - pub(super) fields: Vec, - } - -diff --git a/third_party/rust/uniffi_bindgen/src/interface/error.rs b/third_party/rust/uniffi_bindgen/src/interface/error.rs ---- a/third_party/rust/uniffi_bindgen/src/interface/error.rs -+++ b/third_party/rust/uniffi_bindgen/src/interface/error.rs -@@ -81,10 +81,11 @@ - //! assert_eq!(err.is_flat(), false); - //! # Ok::<(), anyhow::Error>(()) - //! ``` - - use anyhow::Result; -+use uniffi_meta::Checksum; - - use super::enum_::{Enum, Variant}; - use super::types::{Type, TypeIterator}; - use super::{APIConverter, ComponentInterface}; - -@@ -92,11 +93,11 @@ - /// - /// Errors are represented in the UDL as enums with the special `[Error]` attribute, but - /// they're handled in the FFI very differently. We create them in `uniffi::call_with_result()` if - /// the wrapped function returns an `Err` value - /// struct and assign an integer error code to each variant. --#[derive(Debug, Clone, Hash)] -+#[derive(Debug, Clone, Checksum)] - pub struct Error { - pub name: String, - enum_: Enum, - } - -diff --git a/third_party/rust/uniffi_bindgen/src/interface/function.rs b/third_party/rust/uniffi_bindgen/src/interface/function.rs ---- a/third_party/rust/uniffi_bindgen/src/interface/function.rs -+++ b/third_party/rust/uniffi_bindgen/src/interface/function.rs -@@ -30,13 +30,13 @@ - //! assert!(matches!(func.return_type(), Some(Type::String))); - //! assert_eq!(func.arguments().len(), 0); - //! # Ok::<(), anyhow::Error>(()) - //! ``` - use std::convert::TryFrom; --use std::hash::{Hash, Hasher}; - - use anyhow::{bail, Result}; -+use uniffi_meta::Checksum; - - use super::ffi::{FFIArgument, FFIFunction}; - use super::literal::{convert_default_value, Literal}; - use super::types::{Type, TypeIterator}; - use super::{ -@@ -49,15 +49,22 @@ - /// - /// Each `Function` corresponds to a standalone function in the rust module, - /// and has a corresponding standalone function in the foreign language bindings. - /// - /// In the FFI, this will be a standalone function with appropriately lowered types. --#[derive(Debug, Clone)] -+#[derive(Debug, Clone, Checksum)] - pub struct Function { - pub(super) name: String, - pub(super) arguments: Vec, - pub(super) return_type: Option, -+ // We don't include the FFIFunc in the hash calculation, because: -+ // - it is entirely determined by the other fields, -+ // so excluding it is safe. -+ // - its `name` property includes a checksum derived from the very -+ // hash value we're trying to calculate here, so excluding it -+ // avoids a weird circular depenendency in the calculation. -+ #[checksum_ignore] - pub(super) ffi_func: FFIFunction, - pub(super) attributes: FunctionAttributes, - } - - impl Function { -@@ -140,25 +147,10 @@ - attributes: Default::default(), - } - } - } - --impl Hash for Function { -- fn hash(&self, state: &mut H) { -- // We don't include the FFIFunc in the hash calculation, because: -- // - it is entirely determined by the other fields, -- // so excluding it is safe. -- // - its `name` property includes a checksum derived from the very -- // hash value we're trying to calculate here, so excluding it -- // avoids a weird circular depenendency in the calculation. -- self.name.hash(state); -- self.arguments.hash(state); -- self.return_type.hash(state); -- self.attributes.hash(state); -- } --} -- - impl APIConverter for weedle::namespace::NamespaceMember<'_> { - fn convert(&self, ci: &mut ComponentInterface) -> Result { - match self { - weedle::namespace::NamespaceMember::Operation(f) => f.convert(ci), - _ => bail!("no support for namespace member type {:?} yet", self), -@@ -183,11 +175,11 @@ - } - - /// Represents an argument to a function/constructor/method call. - /// - /// Each argument has a name and a type, along with some optional metadata. --#[derive(Debug, Clone, Hash)] -+#[derive(Debug, Clone, Checksum)] - pub struct Argument { - pub(super) name: String, - pub(super) type_: Type, - pub(super) by_ref: bool, - pub(super) optional: bool, -diff --git a/third_party/rust/uniffi_bindgen/src/interface/literal.rs b/third_party/rust/uniffi_bindgen/src/interface/literal.rs ---- a/third_party/rust/uniffi_bindgen/src/interface/literal.rs -+++ b/third_party/rust/uniffi_bindgen/src/interface/literal.rs -@@ -6,16 +6,17 @@ - //! - //! This module provides support for interpreting literal values from the UDL, - //! which appear in places such as default arguments. - - use anyhow::{bail, Result}; -+use uniffi_meta::Checksum; - - use super::types::Type; - - // Represents a literal value. - // Used for e.g. default argument values. --#[derive(Debug, Clone, Hash)] -+#[derive(Debug, Clone, Checksum)] - pub enum Literal { - Boolean(bool), - String(String), - // Integers are represented as the widest representation we can. - // Number formatting vary with language and radix, so we avoid a lot of parsing and -@@ -33,11 +34,11 @@ - Null, - } - - // Represent the radix of integer literal values. - // We preserve the radix into the generated bindings for readability reasons. --#[derive(Debug, Clone, Copy, Hash)] -+#[derive(Debug, Clone, Copy, Checksum)] - pub enum Radix { - Decimal = 10, - Octal = 8, - Hexadecimal = 16, - } -diff --git a/third_party/rust/uniffi_bindgen/src/interface/mod.rs b/third_party/rust/uniffi_bindgen/src/interface/mod.rs ---- a/third_party/rust/uniffi_bindgen/src/interface/mod.rs -+++ b/third_party/rust/uniffi_bindgen/src/interface/mod.rs -@@ -42,16 +42,11 @@ - //! a good opportunity here for e.g. interned strings, but we're nowhere near the point were we need - //! that kind of optimization just yet. - //! - //! * Error messages and general developer experience leave a lot to be desired. - --use std::{ -- collections::HashSet, -- convert::TryFrom, -- hash::{Hash, Hasher}, -- iter, --}; -+use std::{collections::HashSet, convert::TryFrom, iter}; - - use anyhow::{bail, Result}; - - pub mod types; - pub use types::Type; -@@ -75,26 +70,30 @@ - mod record; - pub use record::{Field, Record}; - - pub mod ffi; - pub use ffi::{FFIArgument, FFIFunction, FFIType}; --use uniffi_meta::{MethodMetadata, ObjectMetadata}; -+use uniffi_meta::{Checksum, MethodMetadata, ObjectMetadata}; - - /// The main public interface for this module, representing the complete details of an interface exposed - /// by a rust component and the details of consuming it via an extern-C FFI layer. - /// --#[derive(Debug, Default)] -+#[derive(Debug, Default, Checksum)] - pub struct ComponentInterface { - /// Every ComponentInterface gets tagged with the version of uniffi used to create it. - /// This helps us avoid using a lib compiled with one version together with bindings created - /// using a different version, which might introduce unsafety. - uniffi_version: String, - /// All of the types used in the interface. -+ // We can't checksum `self.types`, but its contents are implied by the other fields -+ // anyway, so it's safe to ignore it. -+ #[checksum_ignore] - pub(super) types: TypeUniverse, - /// The unique prefix that we'll use for namespacing when exposing this component's API. - namespace: String, - /// The internal unique prefix used to namespace FFI symbols -+ #[checksum_ignore] - ffi_namespace: String, - /// The high-level API provided by the component. - enums: Vec, - records: Vec, - functions: Vec, -@@ -105,11 +104,11 @@ - - impl ComponentInterface { - /// Parse a `ComponentInterface` from a string containing a WebIDL definition. - pub fn from_webidl(idl: &str) -> Result { - let mut ci = Self { -- uniffi_version: env!("CARGO_PKG_VERSION").to_string(), -+ uniffi_version: "0.21.0".to_string(), - ..Default::default() - }; - // There's some lifetime thing with the errors returned from weedle::Definitions::parse - // that my own lifetime is too short to worry about figuring out; unwrap and move on. - -@@ -319,20 +318,12 @@ - /// and the same version of Rust, will always have the same checksum value. - /// - Two ComponentInterfaces will, with high probability, have different checksum values if: - /// - They were generated from two different WebIDL files. - /// - They were generated by two different versions of uniffi - /// -- /// The checksum may or may not change depending on the version of Rust used; since we expect -- /// consumers to be using the same executable to generate both the scaffolding and the bindings, -- /// assuming the same version of Rust seems acceptable. -- /// - /// Note that this is designed to prevent accidents, not attacks, so there is no need for the - /// checksum to be cryptographically secure. -- /// -- /// TODO: it's not clear to me if the derivation of `Hash` is actually deterministic enough to -- /// ensure the guarantees above, or if it might be sensitive to e.g. compiler-driven re-ordering -- /// of struct field. Let's see how it goes... - pub fn checksum(&self) -> u16 { - uniffi_meta::checksum(self) - } - - /// The namespace to use in FFI-level function definitions. -@@ -670,27 +661,10 @@ - } - Ok(()) - } - } - --/// `ComponentInterface` structs can be hashed, but this is mostly a convenient way to --/// produce a checksum of their contents. They're not really intended to live in a hashtable. --impl Hash for ComponentInterface { -- fn hash(&self, state: &mut H) { -- // We can't hash `self.types`, but its contents are implied by the other fields -- // anyway, so it's safe to ignore it. -- self.uniffi_version.hash(state); -- self.namespace.hash(state); -- self.enums.hash(state); -- self.records.hash(state); -- self.functions.hash(state); -- self.objects.hash(state); -- self.callback_interfaces.hash(state); -- self.errors.hash(state); -- } --} -- - fn get_or_insert_object<'a>(objects: &'a mut Vec, name: &str) -> &'a mut Object { - // The find-based way of writing this currently runs into a borrow checker - // error, so we use position - match objects.iter_mut().position(|o| o.name == name) { - Some(idx) => &mut objects[idx], -diff --git a/third_party/rust/uniffi_bindgen/src/interface/object.rs b/third_party/rust/uniffi_bindgen/src/interface/object.rs ---- a/third_party/rust/uniffi_bindgen/src/interface/object.rs -+++ b/third_party/rust/uniffi_bindgen/src/interface/object.rs -@@ -56,14 +56,14 @@ - //! assert_eq!(obj.constructors().len(), 0); - //! # Ok::<(), anyhow::Error>(()) - //! ``` - - use std::convert::TryFrom; --use std::hash::{Hash, Hasher}; - use std::{collections::HashSet, iter}; - - use anyhow::{bail, Result}; -+use uniffi_meta::Checksum; - - use super::ffi::{FFIArgument, FFIFunction, FFIType}; - use super::function::Argument; - use super::types::{Type, TypeIterator}; - use super::{ -@@ -84,16 +84,24 @@ - /// binding code is expected to stitch these functions back together into an appropriate class - /// definition (or that language's equivalent thereof). - /// - /// TODO: - /// - maybe "Class" would be a better name than "Object" here? --#[derive(Debug, Clone)] -+#[derive(Debug, Clone, Checksum)] - pub struct Object { - pub(super) name: String, - pub(super) constructors: Vec, - pub(super) methods: Vec, -+ // We don't include the FFIFunc in the hash calculation, because: -+ // - it is entirely determined by the other fields, -+ // so excluding it is safe. -+ // - its `name` property includes a checksum derived from the very -+ // hash value we're trying to calculate here, so excluding it -+ // avoids a weird circular depenendency in the calculation. -+ #[checksum_ignore] - pub(super) ffi_func_free: FFIFunction, -+ #[checksum_ignore] - pub(super) uses_deprecated_threadsafe_attribute: bool, - } - - impl Object { - pub(super) fn new(name: String) -> Object { -@@ -188,24 +196,10 @@ - .flatten(), - ) - } - } - --impl Hash for Object { -- fn hash(&self, state: &mut H) { -- // We don't include the FFIFunc in the hash calculation, because: -- // - it is entirely determined by the other fields, -- // so excluding it is safe. -- // - its `name` property includes a checksum derived from the very -- // hash value we're trying to calculate here, so excluding it -- // avoids a weird circular depenendency in the calculation. -- self.name.hash(state); -- self.constructors.hash(state); -- self.methods.hash(state); -- } --} -- - impl APIConverter for weedle::InterfaceDefinition<'_> { - fn convert(&self, ci: &mut ComponentInterface) -> Result { - if self.inheritance.is_some() { - bail!("interface inheritence is not supported"); - } -@@ -243,14 +237,21 @@ - - // Represents a constructor for an object type. - // - // In the FFI, this will be a function that returns a pointer to an instance - // of the corresponding object type. --#[derive(Debug, Clone)] -+#[derive(Debug, Clone, Checksum)] - pub struct Constructor { - pub(super) name: String, - pub(super) arguments: Vec, -+ // We don't include the FFIFunc in the hash calculation, because: -+ // - it is entirely determined by the other fields, -+ // so excluding it is safe. -+ // - its `name` property includes a checksum derived from the very -+ // hash value we're trying to calculate here, so excluding it -+ // avoids a weird circular depenendency in the calculation. -+ #[checksum_ignore] - pub(super) ffi_func: FFIFunction, - pub(super) attributes: ConstructorAttributes, - } - - impl Constructor { -@@ -297,24 +298,10 @@ - pub fn iter_types(&self) -> TypeIterator<'_> { - Box::new(self.arguments.iter().flat_map(Argument::iter_types)) - } - } - --impl Hash for Constructor { -- fn hash(&self, state: &mut H) { -- // We don't include the FFIFunc in the hash calculation, because: -- // - it is entirely determined by the other fields, -- // so excluding it is safe. -- // - its `name` property includes a checksum derived from the very -- // hash value we're trying to calculate here, so excluding it -- // avoids a weird circular depenendency in the calculation. -- self.name.hash(state); -- self.arguments.hash(state); -- self.attributes.hash(state); -- } --} -- - impl Default for Constructor { - fn default() -> Self { - Constructor { - name: String::from("new"), - arguments: Vec::new(), -@@ -341,16 +328,23 @@ - - // Represents an instance method for an object type. - // - // The FFI will represent this as a function whose first/self argument is a - // `FFIType::RustArcPtr` to the instance. --#[derive(Debug, Clone)] -+#[derive(Debug, Clone, Checksum)] - pub struct Method { - pub(super) name: String, - pub(super) object_name: String, -+ pub(super) arguments: Vec, - pub(super) return_type: Option, -- pub(super) arguments: Vec, -+ // We don't include the FFIFunc in the hash calculation, because: -+ // - it is entirely determined by the other fields, -+ // so excluding it is safe. -+ // - its `name` property includes a checksum derived from the very -+ // hash value we're trying to calculate here, so excluding it -+ // avoids a weird circular depenendency in the calculation. -+ #[checksum_ignore] - pub(super) ffi_func: FFIFunction, - pub(super) attributes: MethodAttributes, - } - - impl Method { -@@ -448,26 +442,10 @@ - attributes: Default::default(), - } - } - } - --impl Hash for Method { -- fn hash(&self, state: &mut H) { -- // We don't include the FFIFunc in the hash calculation, because: -- // - it is entirely determined by the other fields, -- // so excluding it is safe. -- // - its `name` property includes a checksum derived from the very -- // hash value we're trying to calculate here, so excluding it -- // avoids a weird circular depenendency in the calculation. -- self.name.hash(state); -- self.object_name.hash(state); -- self.arguments.hash(state); -- self.return_type.hash(state); -- self.attributes.hash(state); -- } --} -- - impl APIConverter for weedle::interface::OperationInterfaceMember<'_> { - fn convert(&self, ci: &mut ComponentInterface) -> Result { - if self.special.is_some() { - bail!("special operations not supported"); - } -diff --git a/third_party/rust/uniffi_bindgen/src/interface/record.rs b/third_party/rust/uniffi_bindgen/src/interface/record.rs ---- a/third_party/rust/uniffi_bindgen/src/interface/record.rs -+++ b/third_party/rust/uniffi_bindgen/src/interface/record.rs -@@ -43,10 +43,11 @@ - //! assert_eq!(record.fields()[1].name(), "value"); - //! # Ok::<(), anyhow::Error>(()) - //! ``` - - use anyhow::{bail, Result}; -+use uniffi_meta::Checksum; - - use super::types::{Type, TypeIterator}; - use super::{ - convert_type, - literal::{convert_default_value, Literal}, -@@ -56,11 +57,11 @@ - /// Represents a "data class" style object, for passing around complex values. - /// - /// In the FFI these are represented as a byte buffer, which one side explicitly - /// serializes the data into and the other serializes it out of. So I guess they're - /// kind of like "pass by clone" values. --#[derive(Debug, Clone, Hash)] -+#[derive(Debug, Clone, Checksum)] - pub struct Record { - pub(super) name: String, - pub(super) fields: Vec, - } - -@@ -107,11 +108,11 @@ - }) - } - } - - // Represents an individual field on a Record. --#[derive(Debug, Clone, Hash)] -+#[derive(Debug, Clone, Checksum)] - pub struct Field { - pub(super) name: String, - pub(super) type_: Type, - pub(super) required: bool, - pub(super) default: Option, -diff --git a/third_party/rust/uniffi_bindgen/src/interface/types/mod.rs b/third_party/rust/uniffi_bindgen/src/interface/types/mod.rs ---- a/third_party/rust/uniffi_bindgen/src/interface/types/mod.rs -+++ b/third_party/rust/uniffi_bindgen/src/interface/types/mod.rs -@@ -23,10 +23,11 @@ - - use std::{collections::hash_map::Entry, collections::BTreeSet, collections::HashMap, iter}; - - use anyhow::{bail, Result}; - use heck::ToUpperCamelCase; -+use uniffi_meta::Checksum; - - use super::ffi::FFIType; - - mod finder; - pub(super) use finder::TypeFinder; -@@ -34,11 +35,11 @@ - pub(super) use resolver::{resolve_builtin_type, TypeResolver}; - - /// Represents all the different high-level types that can be used in a component interface. - /// At this level we identify user-defined types by name, without knowing any details - /// of their internal structure apart from what type of thing they are (record, enum, etc). --#[derive(Debug, Clone, Eq, PartialEq, Hash, Ord, PartialOrd)] -+#[derive(Debug, Clone, Eq, PartialEq, Checksum, Ord, PartialOrd)] - pub enum Type { - // Primitive types. - UInt8, - Int8, - UInt16, -diff --git a/third_party/rust/uniffi_build/.cargo-checksum.json b/third_party/rust/uniffi_build/.cargo-checksum.json ---- a/third_party/rust/uniffi_build/.cargo-checksum.json -+++ b/third_party/rust/uniffi_build/.cargo-checksum.json -@@ -1 +1 @@ --{"files":{"Cargo.toml":"bf9105f53978ecdccad9a75fc3645f97982d3c4162a5a9b49ab16554162b51c1","src/lib.rs":"485a0c0ab99077a1d4037f4deec9801e87a248196e7589a002556fb84973528a"},"package":"510287c368a9386eb731ebe824a6fc6c82a105e20d020af1aa20519c1c1561db"} -\ No newline at end of file -+{"files":{"Cargo.toml":"30736876caf953bd0040b6c0fc824744556bf52fe23d656c7d01442d4c180674","src/lib.rs":"485a0c0ab99077a1d4037f4deec9801e87a248196e7589a002556fb84973528a"},"package":"d035e50433ee3d52ab0dcdcf3b9b26f2cc2ec39294b3c07d95865a518709455f"} -\ No newline at end of file -diff --git a/third_party/rust/uniffi_build/Cargo.toml b/third_party/rust/uniffi_build/Cargo.toml ---- a/third_party/rust/uniffi_build/Cargo.toml -+++ b/third_party/rust/uniffi_build/Cargo.toml -@@ -10,31 +10,30 @@ - # See Cargo.toml.orig for the original contents. - - [package] - edition = "2021" - name = "uniffi_build" --version = "0.21.0" -+version = "0.21.1" - authors = ["Firefox Sync Team "] - description = "a multi-language bindings generator for rust (build script helpers)" - homepage = "https://mozilla.github.io/uniffi-rs" - documentation = "https://mozilla.github.io/uniffi-rs" - keywords = [ - "ffi", - "bindgen", - ] - license = "MPL-2.0" - repository = "https://github.com/mozilla/uniffi-rs" --resolver = "2" - - [dependencies.anyhow] - version = "1" - - [dependencies.camino] - version = "1.0.8" - - [dependencies.uniffi_bindgen] --version = "=0.21.0" -+version = "=0.21.1" - optional = true - - [features] - builtin-bindgen = ["uniffi_bindgen"] - default = [] -diff --git a/third_party/rust/uniffi_checksum_derive/.cargo-checksum.json b/third_party/rust/uniffi_checksum_derive/.cargo-checksum.json -new file mode 100644 ---- /dev/null -+++ b/third_party/rust/uniffi_checksum_derive/.cargo-checksum.json -@@ -0,0 +1 @@ -+{"files":{"Cargo.toml":"2ab3c60724c4c504297f8876bf0a8d1291f76a2fc46f5e83634aa147e89ffc71","src/lib.rs":"c68c69a1cf6a69e5fe78f7b069364a265c5bb6ce8c0abf0b5745eca01c79604a"},"package":"78b6e16d46caf942016997af8bbdf4b163bf8ae3deb0b667d9643de7b7ffd4c9"} -\ No newline at end of file -diff --git a/third_party/rust/uniffi_checksum_derive/Cargo.toml b/third_party/rust/uniffi_checksum_derive/Cargo.toml -new file mode 100644 ---- /dev/null -+++ b/third_party/rust/uniffi_checksum_derive/Cargo.toml -@@ -0,0 +1,42 @@ -+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO -+# -+# When uploading crates to the registry Cargo will automatically -+# "normalize" Cargo.toml files for maximal compatibility -+# with all versions of Cargo and also rewrite `path` dependencies -+# to registry (e.g., crates.io) dependencies. -+# -+# If you are reading this file be aware that the original Cargo.toml -+# will likely look very different (and much more reasonable). -+# See Cargo.toml.orig for the original contents. -+ -+[package] -+edition = "2021" -+name = "uniffi_checksum_derive" -+version = "0.21.1" -+authors = ["Firefox Sync Team "] -+description = "a multi-language bindings generator for rust (checksum custom derive)" -+homepage = "https://mozilla.github.io/uniffi-rs" -+documentation = "https://mozilla.github.io/uniffi-rs" -+keywords = [ -+ "ffi", -+ "bindgen", -+] -+license = "MPL-2.0" -+repository = "https://github.com/mozilla/uniffi-rs" -+ -+[lib] -+proc-macro = true -+ -+[dependencies.quote] -+version = "1.0" -+ -+[dependencies.syn] -+version = "1.0" -+features = [ -+ "derive", -+ "parsing", -+] -+ -+[features] -+default = [] -+nightly = [] -diff --git a/third_party/rust/uniffi_checksum_derive/src/lib.rs b/third_party/rust/uniffi_checksum_derive/src/lib.rs -new file mode 100644 ---- /dev/null -+++ b/third_party/rust/uniffi_checksum_derive/src/lib.rs -@@ -0,0 +1,134 @@ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+#![cfg_attr(feature = "nightly", feature(proc_macro_expand))] -+ -+//! Custom derive for uniffi_meta::Checksum -+ -+use proc_macro::TokenStream; -+use quote::{format_ident, quote}; -+use syn::{parse_macro_input, Attribute, Data, DeriveInput, Expr, ExprLit, Fields, Index, Lit}; -+ -+fn has_ignore_attribute(attrs: &[Attribute]) -> bool { -+ attrs.iter().any(|attr| { -+ if attr.path.is_ident("checksum_ignore") { -+ if !attr.tokens.is_empty() { -+ panic!("#[checksum_ignore] doesn't accept extra information"); -+ } -+ true -+ } else { -+ false -+ } -+ }) -+} -+ -+#[proc_macro_derive(Checksum, attributes(checksum_ignore))] -+pub fn checksum_derive(input: TokenStream) -> TokenStream { -+ let input: DeriveInput = parse_macro_input!(input); -+ -+ let name = input.ident; -+ -+ let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); -+ -+ let code = match input.data { -+ Data::Enum(enum_) -+ if enum_.variants.len() == 1 -+ && enum_ -+ .variants -+ .iter() -+ .all(|variant| matches!(variant.fields, Fields::Unit)) => -+ { -+ quote!() -+ } -+ Data::Enum(enum_) => { -+ let mut next_discriminant = 0u64; -+ let match_inner = enum_.variants.iter().map(|variant| { -+ let ident = &variant.ident; -+ if has_ignore_attribute(&variant.attrs) { -+ panic!("#[checksum_ignore] is not supported in enums"); -+ } -+ match &variant.discriminant { -+ Some((_, Expr::Lit(ExprLit { lit: Lit::Int(value), .. }))) => { -+ next_discriminant = value.base10_parse::().unwrap(); -+ } -+ Some(_) => { -+ panic!("#[derive(Checksum)] doesn't support non-numeric explicit discriminants in enums"); -+ } -+ None => {} -+ } -+ let discriminant = quote! { state.write(&#next_discriminant.to_le_bytes()) }; -+ next_discriminant += 1; -+ match &variant.fields { -+ Fields::Unnamed(fields) => { -+ let field_idents = fields -+ .unnamed -+ .iter() -+ .enumerate() -+ .map(|(num, _)| format_ident!("__self_{}", num)); -+ let field_stmts = field_idents -+ .clone() -+ .map(|ident| quote! { Checksum::checksum(#ident, state); }); -+ quote! { -+ Self::#ident(#(#field_idents,)*) => { -+ #discriminant; -+ #(#field_stmts)* -+ } -+ } -+ } -+ Fields::Named(fields) => { -+ let field_idents = fields -+ .named -+ .iter() -+ .map(|field| field.ident.as_ref().unwrap()); -+ let field_stmts = field_idents -+ .clone() -+ .map(|ident| quote! { Checksum::checksum(#ident, state); }); -+ quote! { -+ Self::#ident { #(#field_idents,)* } => { -+ #discriminant; -+ #(#field_stmts)* -+ } -+ } -+ } -+ Fields::Unit => quote! { Self::#ident => #discriminant, }, -+ } -+ }); -+ quote! { -+ match self { -+ #(#match_inner)* -+ } -+ } -+ } -+ Data::Struct(struct_) => { -+ let stmts = struct_ -+ .fields -+ .iter() -+ .enumerate() -+ .filter_map(|(num, field)| { -+ (!has_ignore_attribute(&field.attrs)).then(|| match field.ident.as_ref() { -+ Some(ident) => quote! { Checksum::checksum(&self.#ident, state); }, -+ None => { -+ let i = Index::from(num); -+ quote! { Checksum::checksum(&self.#i, state); } -+ } -+ }) -+ }); -+ quote! { -+ #(#stmts)* -+ } -+ } -+ Data::Union(_) => { -+ panic!("#[derive(Checksum)] is not supported for unions"); -+ } -+ }; -+ -+ quote! { -+ #[automatically_derived] -+ impl #impl_generics Checksum for #name #ty_generics #where_clause { -+ fn checksum<__H: ::core::hash::Hasher>(&self, state: &mut __H) { -+ #code -+ } -+ } -+ } -+ .into() -+} -diff --git a/third_party/rust/uniffi_macros/.cargo-checksum.json b/third_party/rust/uniffi_macros/.cargo-checksum.json ---- a/third_party/rust/uniffi_macros/.cargo-checksum.json -+++ b/third_party/rust/uniffi_macros/.cargo-checksum.json -@@ -1 +1 @@ --{"files":{"Cargo.toml":"55f7e114dd34b0c60b58890120f8707601a5401e9d49d42a239b03da2e660d4f","src/export.rs":"e23929cf6fb5542d29514fe668f3b3d836fad968eacd9c6fcba74c5cd9cf2b61","src/export/metadata.rs":"af89a9942c7c0c4043a3cd57d1e6bd71cde19005e1f9f246efac761f47eff6be","src/export/metadata/convert.rs":"81060fb3390165d77db021f44142a2f3f10882515f859d7393857083370f2d35","src/export/metadata/function.rs":"11833cabd37e7671c0a01944bec73b8892a15df814bbe4c26fdae57aad89a2ba","src/export/metadata/impl_.rs":"ecfdaa132f05dd946414281e52165ef19c90c0bfd76ec651d4ec86837bd41d1c","src/export/scaffolding.rs":"66939405063e56fc983126f249e2d7ddc3257cb045a738abd0cf813a4aafc59c","src/lib.rs":"ca77b437a58cfb3ddeb106d3c1c8378545c46ef241298e62ab1190c5136d1fb1","src/object.rs":"955b596f344304013692042bdc1760bbb1192ec33950b0dd2932cb8de94ec297","src/record.rs":"67a5c7ed6a448f7ad8f5c8e930c5e3007b2b0cac32f52cc8596bdae6fb3c816e","src/util.rs":"6389a9b4258808a3af168cf85658fb7c069172d5e528ee0e94210fa664f2a414"},"package":"5c8604503caa2cbcf271578dc51ca236d40e3b22e1514ffa2e638e2c39f6ad10"} -\ No newline at end of file -+{"files":{"Cargo.toml":"6511b493b676ac3941d70477c91abec62642c3c9aab088ecdf4f733eef3f1faa","src/export.rs":"e23929cf6fb5542d29514fe668f3b3d836fad968eacd9c6fcba74c5cd9cf2b61","src/export/metadata.rs":"af89a9942c7c0c4043a3cd57d1e6bd71cde19005e1f9f246efac761f47eff6be","src/export/metadata/convert.rs":"81060fb3390165d77db021f44142a2f3f10882515f859d7393857083370f2d35","src/export/metadata/function.rs":"11833cabd37e7671c0a01944bec73b8892a15df814bbe4c26fdae57aad89a2ba","src/export/metadata/impl_.rs":"ecfdaa132f05dd946414281e52165ef19c90c0bfd76ec651d4ec86837bd41d1c","src/export/scaffolding.rs":"66939405063e56fc983126f249e2d7ddc3257cb045a738abd0cf813a4aafc59c","src/lib.rs":"ca77b437a58cfb3ddeb106d3c1c8378545c46ef241298e62ab1190c5136d1fb1","src/object.rs":"955b596f344304013692042bdc1760bbb1192ec33950b0dd2932cb8de94ec297","src/record.rs":"67a5c7ed6a448f7ad8f5c8e930c5e3007b2b0cac32f52cc8596bdae6fb3c816e","src/util.rs":"6389a9b4258808a3af168cf85658fb7c069172d5e528ee0e94210fa664f2a414"},"package":"c96a574677566f83ea8458dac1dd7792fd63e7c3f9dbcd865f0e8d6f8057b127"} -\ No newline at end of file -diff --git a/third_party/rust/uniffi_macros/Cargo.toml b/third_party/rust/uniffi_macros/Cargo.toml ---- a/third_party/rust/uniffi_macros/Cargo.toml -+++ b/third_party/rust/uniffi_macros/Cargo.toml -@@ -10,22 +10,21 @@ - # See Cargo.toml.orig for the original contents. - - [package] - edition = "2021" - name = "uniffi_macros" --version = "0.21.0" -+version = "0.21.1" - authors = ["Firefox Sync Team "] - description = "a multi-language bindings generator for rust (convenience macros)" - homepage = "https://mozilla.github.io/uniffi-rs" - documentation = "https://mozilla.github.io/uniffi-rs" - keywords = [ - "ffi", - "bindgen", - ] - license = "MPL-2.0" - repository = "https://github.com/mozilla/uniffi-rs" --resolver = "2" - - [lib] - proc-macro = true - - [dependencies.bincode] -@@ -58,14 +57,14 @@ - - [dependencies.toml] - version = "0.5.9" - - [dependencies.uniffi_build] --version = "=0.21.0" -+version = "=0.21.1" - - [dependencies.uniffi_meta] --version = "=0.21.0" -+version = "=0.21.1" - - [features] - builtin-bindgen = ["uniffi_build/builtin-bindgen"] - default = [] - nightly = [] -diff --git a/third_party/rust/uniffi_meta/.cargo-checksum.json b/third_party/rust/uniffi_meta/.cargo-checksum.json ---- a/third_party/rust/uniffi_meta/.cargo-checksum.json -+++ b/third_party/rust/uniffi_meta/.cargo-checksum.json -@@ -1 +1 @@ --{"files":{"Cargo.toml":"4a474782b3acac7e99435c0cfc6cd4790817ee5c15980b10dc927d95795b977f","src/lib.rs":"dc4c91763c01e8c09ef55cdb103bc02c7aba71c5660ba88f776a8a03a747d6e8"},"package":"cd9417cc653937681436b93838d8c5f97a5b8c58697813982ee8810bd1dc3b57"} -\ No newline at end of file -+{"files":{"Cargo.toml":"4c34032ec5fadf8b996c671425d5afa38e0e5c223ab0b2ed3b44099fb78157d3","src/lib.rs":"a9854421f120e1c4a9d7d36bb006a4c5e7d2e054564f95aa9b6956e7ebb348fd"},"package":"729835442da829c9b6f7c111c76cf87b2498e129101203bec94f0c39a3296a38"} -\ No newline at end of file -diff --git a/third_party/rust/uniffi_meta/Cargo.toml b/third_party/rust/uniffi_meta/Cargo.toml ---- a/third_party/rust/uniffi_meta/Cargo.toml -+++ b/third_party/rust/uniffi_meta/Cargo.toml -@@ -10,19 +10,24 @@ - # See Cargo.toml.orig for the original contents. - - [package] - edition = "2021" - name = "uniffi_meta" --version = "0.21.0" -+version = "0.21.1" - description = "uniffi_meta" - homepage = "https://mozilla.github.io/uniffi-rs" - keywords = [ - "ffi", - "bindgen", - ] - license = "MPL-2.0" - repository = "https://github.com/mozilla/uniffi-rs" --resolver = "2" - - [dependencies.serde] - version = "1.0.136" - features = ["derive"] -+ -+[dependencies.siphasher] -+version = "0.3" -+ -+[dependencies.uniffi_checksum_derive] -+version = "0.21.0" -diff --git a/third_party/rust/uniffi_meta/src/lib.rs b/third_party/rust/uniffi_meta/src/lib.rs ---- a/third_party/rust/uniffi_meta/src/lib.rs -+++ b/third_party/rust/uniffi_meta/src/lib.rs -@@ -1,17 +1,87 @@ - /* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - --use std::{ -- collections::hash_map::DefaultHasher, -- hash::{Hash, Hasher}, --}; -+use std::hash::Hasher; -+pub use uniffi_checksum_derive::Checksum; - - use serde::{Deserialize, Serialize}; - --#[derive(Clone, Debug, Hash, Deserialize, Serialize)] -+/// Similar to std::hash::Hash. -+/// -+/// Implementations of this trait are expected to update the hasher state in -+/// the same way across platforms. #[derive(Checksum)] will do the right thing. -+pub trait Checksum { -+ fn checksum(&self, state: &mut H); -+} -+ -+impl Checksum for bool { -+ fn checksum(&self, state: &mut H) { -+ state.write_u8(*self as u8); -+ } -+} -+ -+impl Checksum for u64 { -+ fn checksum(&self, state: &mut H) { -+ state.write(&self.to_le_bytes()); -+ } -+} -+ -+impl Checksum for i64 { -+ fn checksum(&self, state: &mut H) { -+ state.write(&self.to_le_bytes()); -+ } -+} -+ -+impl Checksum for Box { -+ fn checksum(&self, state: &mut H) { -+ (**self).checksum(state) -+ } -+} -+ -+impl Checksum for [T] { -+ fn checksum(&self, state: &mut H) { -+ state.write(&(self.len() as u64).to_le_bytes()); -+ for item in self { -+ Checksum::checksum(item, state); -+ } -+ } -+} -+ -+impl Checksum for Vec { -+ fn checksum(&self, state: &mut H) { -+ Checksum::checksum(&**self, state); -+ } -+} -+ -+impl Checksum for Option { -+ fn checksum(&self, state: &mut H) { -+ match self { -+ None => state.write(&0u64.to_le_bytes()), -+ Some(value) => { -+ state.write(&1u64.to_le_bytes()); -+ Checksum::checksum(value, state) -+ } -+ } -+ } -+} -+ -+impl Checksum for str { -+ fn checksum(&self, state: &mut H) { -+ state.write(self.as_bytes()); -+ state.write_u8(0xff); -+ } -+} -+ -+impl Checksum for String { -+ fn checksum(&self, state: &mut H) { -+ (**self).checksum(state) -+ } -+} -+ -+#[derive(Clone, Debug, Checksum, Deserialize, Serialize)] - pub struct FnMetadata { - pub module_path: Vec, - pub name: String, - pub inputs: Vec, - pub return_type: Option, -@@ -21,11 +91,11 @@ - pub fn ffi_symbol_name(&self) -> String { - fn_ffi_symbol_name(&self.module_path, &self.name, checksum(self)) - } - } - --#[derive(Clone, Debug, Hash, Deserialize, Serialize)] -+#[derive(Clone, Debug, Checksum, Deserialize, Serialize)] - pub struct MethodMetadata { - pub module_path: Vec, - pub self_name: String, - pub name: String, - pub inputs: Vec, -@@ -37,18 +107,18 @@ - let full_name = format!("impl_{}_{}", self.self_name, self.name); - fn_ffi_symbol_name(&self.module_path, &full_name, checksum(self)) - } - } - --#[derive(Clone, Debug, Hash, Deserialize, Serialize)] -+#[derive(Clone, Debug, Checksum, Deserialize, Serialize)] - pub struct FnParamMetadata { - pub name: String, - #[serde(rename = "type")] - pub ty: Type, - } - --#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)] -+#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Checksum, Deserialize, Serialize)] - pub enum Type { - U8, - U16, - U32, - U64, -@@ -76,25 +146,25 @@ - Unresolved { - name: String, - }, - } - --#[derive(Clone, Debug, Hash, Deserialize, Serialize)] -+#[derive(Clone, Debug, Checksum, Deserialize, Serialize)] - pub struct RecordMetadata { - pub module_path: Vec, - pub name: String, - pub fields: Vec, - } - --#[derive(Clone, Debug, Hash, Deserialize, Serialize)] -+#[derive(Clone, Debug, Checksum, Deserialize, Serialize)] - pub struct FieldMetadata { - pub name: String, - #[serde(rename = "type")] - pub ty: Type, - } - --#[derive(Clone, Debug, Hash, Deserialize, Serialize)] -+#[derive(Clone, Debug, Checksum, Deserialize, Serialize)] - pub struct ObjectMetadata { - pub module_path: Vec, - pub name: String, - } - -@@ -106,27 +176,27 @@ - let free_name = format!("object_free_{}", self.name); - fn_ffi_symbol_name(&self.module_path, &free_name, checksum(self)) - } - } - --/// Returns the last 16 bits of the value's hash as computed with [`DefaultHasher`]. -+/// Returns the last 16 bits of the value's hash as computed with [`SipHasher13`]. - /// - /// To be used as a checksum of FFI symbols, as a safeguard against different UniFFI versions being - /// used for scaffolding and bindings generation. --pub fn checksum(val: &T) -> u16 { -- let mut hasher = DefaultHasher::new(); -- val.hash(&mut hasher); -+pub fn checksum(val: &T) -> u16 { -+ let mut hasher = siphasher::sip::SipHasher13::new(); -+ val.checksum(&mut hasher); - (hasher.finish() & 0x000000000000FFFF) as u16 - } - - pub fn fn_ffi_symbol_name(mod_path: &[String], name: &str, checksum: u16) -> String { - let mod_path = mod_path.join("__"); - format!("_uniffi_{mod_path}_{name}_{checksum:x}") - } - - /// Enum covering all the possible metadata types --#[derive(Clone, Debug, Hash, Deserialize, Serialize)] -+#[derive(Clone, Debug, Checksum, Deserialize, Serialize)] - pub enum Metadata { - Func(FnMetadata), - Method(MethodMetadata), - Record(RecordMetadata), - Object(ObjectMetadata), - diff --git a/firefox.spec b/firefox.spec index af584c6..fb86584 100644 --- a/firefox.spec +++ b/firefox.spec @@ -172,13 +172,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 108.0.1 -Release: 4%{?pre_tag}%{?dist} +Version: 109.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20221218.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230111.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -225,7 +225,6 @@ Patch55: firefox-testing.patch Patch61: firefox-glibc-dynstack.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch78: firefox-i686-build.patch -Patch79: D163310.diff # Test patches # Generate without context by @@ -250,10 +249,6 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch -Patch416: D163696.diff -Patch417: D163697.diff -Patch418: D163698.diff -Patch419: D164896.diff # PGO/LTO patches Patch600: pgo.patch @@ -506,7 +501,6 @@ This package contains results of tests executed during build. %patch54 -p1 -b .1669639 %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch78 -p1 -b .firefox-i686 -%patch79 -p1 -b .D163310 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -529,10 +523,6 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 -%patch416 -p1 -b .D163696 -%patch417 -p1 -b .D163697 -%patch418 -p1 -b .D163698 -%patch419 -p1 -b .D164896 # PGO patches %if %{build_with_pgo} @@ -1086,6 +1076,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Jan 11 2023 Martin Stransky - 109.0-1 +- Update to 109.0 + * Mon Jan 09 2023 Kalev Lember - 108.0.1-4 - Drop conditionals for F35 diff --git a/libwebrtc-screen-cast-sync.patch b/libwebrtc-screen-cast-sync.patch index ede3aec..5631b26 100644 --- a/libwebrtc-screen-cast-sync.patch +++ b/libwebrtc-screen-cast-sync.patch @@ -1,1230 +1,18 @@ -diff --git a/dom/media/webrtc/moz.build b/dom/media/webrtc/moz.build -index ddf9321b58ea..af0f7ab64cc3 100644 ---- a/dom/media/webrtc/moz.build -+++ b/dom/media/webrtc/moz.build +diff -up firefox-109.0/dom/media/webrtc/moz.build.libwebrtc-screen-cast-sync firefox-109.0/dom/media/webrtc/moz.build +--- firefox-109.0/dom/media/webrtc/moz.build.libwebrtc-screen-cast-sync 2023-01-09 20:34:10.000000000 +0100 ++++ firefox-109.0/dom/media/webrtc/moz.build 2023-01-12 15:16:09.192614055 +0100 @@ -84,6 +84,8 @@ if CONFIG["MOZ_WEBRTC_SIGNALING"]: ] - + if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": + DIRS += ["/third_party/drm/libdrm"] + DIRS += ["/third_party/gbm/libgbm"] DIRS += ["/third_party/pipewire/libpipewire"] - + # Avoid warnings from third-party code that we can not modify. -diff --git a/third_party/drm/README b/third_party/drm/README -new file mode 100644 -index 000000000000..f68ed100bb77 ---- /dev/null -+++ b/third_party/drm/README -@@ -0,0 +1,4 @@ -+Libdrm is a drm library wrapper needed to build and run Firefox with -+Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/drm). -+ -+libdrm directory stores headers of libdrm needed for build only. -diff --git a/third_party/drm/drm/drm.h b/third_party/drm/drm/drm.h -new file mode 100644 -index 000000000000..5e54c3aa4c3a ---- /dev/null -+++ b/third_party/drm/drm/drm.h -@@ -0,0 +1,1193 @@ -+/* -+ * Header for the Direct Rendering Manager -+ * -+ * Author: Rickard E. (Rik) Faith -+ * -+ * Acknowledgments: -+ * Dec 1999, Richard Henderson , move to generic cmpxchg. -+ */ -+ -+/* -+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. -+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. -+ * All rights reserved. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#ifndef _DRM_H_ -+#define _DRM_H_ -+ -+#if defined(__linux__) -+ -+#include -+#include -+typedef unsigned int drm_handle_t; -+ -+#else /* One of the BSDs */ -+ -+#include -+#include -+#include -+typedef int8_t __s8; -+typedef uint8_t __u8; -+typedef int16_t __s16; -+typedef uint16_t __u16; -+typedef int32_t __s32; -+typedef uint32_t __u32; -+typedef int64_t __s64; -+typedef uint64_t __u64; -+typedef size_t __kernel_size_t; -+typedef unsigned long drm_handle_t; -+ -+#endif -+ -+#if defined(__cplusplus) -+extern "C" { -+#endif -+ -+#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */ -+#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */ -+#define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */ -+#define DRM_RAM_PERCENT 10 /**< How much system ram can we lock? */ -+ -+#define _DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */ -+#define _DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */ -+#define _DRM_LOCK_IS_HELD(lock) ((lock) & _DRM_LOCK_HELD) -+#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT) -+#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) -+ -+typedef unsigned int drm_context_t; -+typedef unsigned int drm_drawable_t; -+typedef unsigned int drm_magic_t; -+ -+/* -+ * Cliprect. -+ * -+ * \warning: If you change this structure, make sure you change -+ * XF86DRIClipRectRec in the server as well -+ * -+ * \note KW: Actually it's illegal to change either for -+ * backwards-compatibility reasons. -+ */ -+struct drm_clip_rect { -+ unsigned short x1; -+ unsigned short y1; -+ unsigned short x2; -+ unsigned short y2; -+}; -+ -+/* -+ * Drawable information. -+ */ -+struct drm_drawable_info { -+ unsigned int num_rects; -+ struct drm_clip_rect *rects; -+}; -+ -+/* -+ * Texture region, -+ */ -+struct drm_tex_region { -+ unsigned char next; -+ unsigned char prev; -+ unsigned char in_use; -+ unsigned char padding; -+ unsigned int age; -+}; -+ -+/* -+ * Hardware lock. -+ * -+ * The lock structure is a simple cache-line aligned integer. To avoid -+ * processor bus contention on a multiprocessor system, there should not be any -+ * other data stored in the same cache line. -+ */ -+struct drm_hw_lock { -+ __volatile__ unsigned int lock; /**< lock variable */ -+ char padding[60]; /**< Pad to cache line */ -+}; -+ -+/* -+ * DRM_IOCTL_VERSION ioctl argument type. -+ * -+ * \sa drmGetVersion(). -+ */ -+struct drm_version { -+ int version_major; /**< Major version */ -+ int version_minor; /**< Minor version */ -+ int version_patchlevel; /**< Patch level */ -+ __kernel_size_t name_len; /**< Length of name buffer */ -+ char *name; /**< Name of driver */ -+ __kernel_size_t date_len; /**< Length of date buffer */ -+ char *date; /**< User-space buffer to hold date */ -+ __kernel_size_t desc_len; /**< Length of desc buffer */ -+ char *desc; /**< User-space buffer to hold desc */ -+}; -+ -+/* -+ * DRM_IOCTL_GET_UNIQUE ioctl argument type. -+ * -+ * \sa drmGetBusid() and drmSetBusId(). -+ */ -+struct drm_unique { -+ __kernel_size_t unique_len; /**< Length of unique */ -+ char *unique; /**< Unique name for driver instantiation */ -+}; -+ -+struct drm_list { -+ int count; /**< Length of user-space structures */ -+ struct drm_version *version; -+}; -+ -+struct drm_block { -+ int unused; -+}; -+ -+/* -+ * DRM_IOCTL_CONTROL ioctl argument type. -+ * -+ * \sa drmCtlInstHandler() and drmCtlUninstHandler(). -+ */ -+struct drm_control { -+ enum { -+ DRM_ADD_COMMAND, -+ DRM_RM_COMMAND, -+ DRM_INST_HANDLER, -+ DRM_UNINST_HANDLER -+ } func; -+ int irq; -+}; -+ -+/* -+ * Type of memory to map. -+ */ -+enum drm_map_type { -+ _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */ -+ _DRM_REGISTERS = 1, /**< no caching, no core dump */ -+ _DRM_SHM = 2, /**< shared, cached */ -+ _DRM_AGP = 3, /**< AGP/GART */ -+ _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */ -+ _DRM_CONSISTENT = 5 /**< Consistent memory for PCI DMA */ -+}; -+ -+/* -+ * Memory mapping flags. -+ */ -+enum drm_map_flags { -+ _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */ -+ _DRM_READ_ONLY = 0x02, -+ _DRM_LOCKED = 0x04, /**< shared, cached, locked */ -+ _DRM_KERNEL = 0x08, /**< kernel requires access */ -+ _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */ -+ _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */ -+ _DRM_REMOVABLE = 0x40, /**< Removable mapping */ -+ _DRM_DRIVER = 0x80 /**< Managed by driver */ -+}; -+ -+struct drm_ctx_priv_map { -+ unsigned int ctx_id; /**< Context requesting private mapping */ -+ void *handle; /**< Handle of map */ -+}; -+ -+/* -+ * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls -+ * argument type. -+ * -+ * \sa drmAddMap(). -+ */ -+struct drm_map { -+ unsigned long offset; /**< Requested physical address (0 for SAREA)*/ -+ unsigned long size; /**< Requested physical size (bytes) */ -+ enum drm_map_type type; /**< Type of memory to map */ -+ enum drm_map_flags flags; /**< Flags */ -+ void *handle; /**< User-space: "Handle" to pass to mmap() */ -+ /**< Kernel-space: kernel-virtual address */ -+ int mtrr; /**< MTRR slot used */ -+ /* Private data */ -+}; -+ -+/* -+ * DRM_IOCTL_GET_CLIENT ioctl argument type. -+ */ -+struct drm_client { -+ int idx; /**< Which client desired? */ -+ int auth; /**< Is client authenticated? */ -+ unsigned long pid; /**< Process ID */ -+ unsigned long uid; /**< User ID */ -+ unsigned long magic; /**< Magic */ -+ unsigned long iocs; /**< Ioctl count */ -+}; -+ -+enum drm_stat_type { -+ _DRM_STAT_LOCK, -+ _DRM_STAT_OPENS, -+ _DRM_STAT_CLOSES, -+ _DRM_STAT_IOCTLS, -+ _DRM_STAT_LOCKS, -+ _DRM_STAT_UNLOCKS, -+ _DRM_STAT_VALUE, /**< Generic value */ -+ _DRM_STAT_BYTE, /**< Generic byte counter (1024bytes/K) */ -+ _DRM_STAT_COUNT, /**< Generic non-byte counter (1000/k) */ -+ -+ _DRM_STAT_IRQ, /**< IRQ */ -+ _DRM_STAT_PRIMARY, /**< Primary DMA bytes */ -+ _DRM_STAT_SECONDARY, /**< Secondary DMA bytes */ -+ _DRM_STAT_DMA, /**< DMA */ -+ _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */ -+ _DRM_STAT_MISSED /**< Missed DMA opportunity */ -+ /* Add to the *END* of the list */ -+}; -+ -+/* -+ * DRM_IOCTL_GET_STATS ioctl argument type. -+ */ -+struct drm_stats { -+ unsigned long count; -+ struct { -+ unsigned long value; -+ enum drm_stat_type type; -+ } data[15]; -+}; -+ -+/* -+ * Hardware locking flags. -+ */ -+enum drm_lock_flags { -+ _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */ -+ _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */ -+ _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */ -+ _DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */ -+ /* These *HALT* flags aren't supported yet -+ -- they will be used to support the -+ full-screen DGA-like mode. */ -+ _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */ -+ _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ -+}; -+ -+/* -+ * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type. -+ * -+ * \sa drmGetLock() and drmUnlock(). -+ */ -+struct drm_lock { -+ int context; -+ enum drm_lock_flags flags; -+}; -+ -+/* -+ * DMA flags -+ * -+ * \warning -+ * These values \e must match xf86drm.h. -+ * -+ * \sa drm_dma. -+ */ -+enum drm_dma_flags { -+ /* Flags for DMA buffer dispatch */ -+ _DRM_DMA_BLOCK = 0x01, /**< -+ * Block until buffer dispatched. -+ * -+ * \note The buffer may not yet have -+ * been processed by the hardware -- -+ * getting a hardware lock with the -+ * hardware quiescent will ensure -+ * that the buffer has been -+ * processed. -+ */ -+ _DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */ -+ _DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */ -+ -+ /* Flags for DMA buffer request */ -+ _DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */ -+ _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */ -+ _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ -+}; -+ -+/* -+ * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type. -+ * -+ * \sa drmAddBufs(). -+ */ -+struct drm_buf_desc { -+ int count; /**< Number of buffers of this size */ -+ int size; /**< Size in bytes */ -+ int low_mark; /**< Low water mark */ -+ int high_mark; /**< High water mark */ -+ enum { -+ _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */ -+ _DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */ -+ _DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */ -+ _DRM_FB_BUFFER = 0x08, /**< Buffer is in frame buffer */ -+ _DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */ -+ } flags; -+ unsigned long agp_start; /**< -+ * Start address of where the AGP buffers are -+ * in the AGP aperture -+ */ -+}; -+ -+/* -+ * DRM_IOCTL_INFO_BUFS ioctl argument type. -+ */ -+struct drm_buf_info { -+ int count; /**< Entries in list */ -+ struct drm_buf_desc *list; -+}; -+ -+/* -+ * DRM_IOCTL_FREE_BUFS ioctl argument type. -+ */ -+struct drm_buf_free { -+ int count; -+ int *list; -+}; -+ -+/* -+ * Buffer information -+ * -+ * \sa drm_buf_map. -+ */ -+struct drm_buf_pub { -+ int idx; /**< Index into the master buffer list */ -+ int total; /**< Buffer size */ -+ int used; /**< Amount of buffer in use (for DMA) */ -+ void *address; /**< Address of buffer */ -+}; -+ -+/* -+ * DRM_IOCTL_MAP_BUFS ioctl argument type. -+ */ -+struct drm_buf_map { -+ int count; /**< Length of the buffer list */ -+#ifdef __cplusplus -+ void *virt; -+#else -+ void *virtual; /**< Mmap'd area in user-virtual */ -+#endif -+ struct drm_buf_pub *list; /**< Buffer information */ -+}; -+ -+/* -+ * DRM_IOCTL_DMA ioctl argument type. -+ * -+ * Indices here refer to the offset into the buffer list in drm_buf_get. -+ * -+ * \sa drmDMA(). -+ */ -+struct drm_dma { -+ int context; /**< Context handle */ -+ int send_count; /**< Number of buffers to send */ -+ int *send_indices; /**< List of handles to buffers */ -+ int *send_sizes; /**< Lengths of data to send */ -+ enum drm_dma_flags flags; /**< Flags */ -+ int request_count; /**< Number of buffers requested */ -+ int request_size; /**< Desired size for buffers */ -+ int *request_indices; /**< Buffer information */ -+ int *request_sizes; -+ int granted_count; /**< Number of buffers granted */ -+}; -+ -+enum drm_ctx_flags { -+ _DRM_CONTEXT_PRESERVED = 0x01, -+ _DRM_CONTEXT_2DONLY = 0x02 -+}; -+ -+/* -+ * DRM_IOCTL_ADD_CTX ioctl argument type. -+ * -+ * \sa drmCreateContext() and drmDestroyContext(). -+ */ -+struct drm_ctx { -+ drm_context_t handle; -+ enum drm_ctx_flags flags; -+}; -+ -+/* -+ * DRM_IOCTL_RES_CTX ioctl argument type. -+ */ -+struct drm_ctx_res { -+ int count; -+ struct drm_ctx *contexts; -+}; -+ -+/* -+ * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type. -+ */ -+struct drm_draw { -+ drm_drawable_t handle; -+}; -+ -+/* -+ * DRM_IOCTL_UPDATE_DRAW ioctl argument type. -+ */ -+typedef enum { -+ DRM_DRAWABLE_CLIPRECTS -+} drm_drawable_info_type_t; -+ -+struct drm_update_draw { -+ drm_drawable_t handle; -+ unsigned int type; -+ unsigned int num; -+ unsigned long long data; -+}; -+ -+/* -+ * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type. -+ */ -+struct drm_auth { -+ drm_magic_t magic; -+}; -+ -+/* -+ * DRM_IOCTL_IRQ_BUSID ioctl argument type. -+ * -+ * \sa drmGetInterruptFromBusID(). -+ */ -+struct drm_irq_busid { -+ int irq; /**< IRQ number */ -+ int busnum; /**< bus number */ -+ int devnum; /**< device number */ -+ int funcnum; /**< function number */ -+}; -+ -+enum drm_vblank_seq_type { -+ _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ -+ _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ -+ /* bits 1-6 are reserved for high crtcs */ -+ _DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e, -+ _DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */ -+ _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ -+ _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ -+ _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ -+ _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking, unsupported */ -+}; -+#define _DRM_VBLANK_HIGH_CRTC_SHIFT 1 -+ -+#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE) -+#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \ -+ _DRM_VBLANK_SECONDARY | _DRM_VBLANK_NEXTONMISS) -+ -+struct drm_wait_vblank_request { -+ enum drm_vblank_seq_type type; -+ unsigned int sequence; -+ unsigned long signal; -+}; -+ -+struct drm_wait_vblank_reply { -+ enum drm_vblank_seq_type type; -+ unsigned int sequence; -+ long tval_sec; -+ long tval_usec; -+}; -+ -+/* -+ * DRM_IOCTL_WAIT_VBLANK ioctl argument type. -+ * -+ * \sa drmWaitVBlank(). -+ */ -+union drm_wait_vblank { -+ struct drm_wait_vblank_request request; -+ struct drm_wait_vblank_reply reply; -+}; -+ -+#define _DRM_PRE_MODESET 1 -+#define _DRM_POST_MODESET 2 -+ -+/* -+ * DRM_IOCTL_MODESET_CTL ioctl argument type -+ * -+ * \sa drmModesetCtl(). -+ */ -+struct drm_modeset_ctl { -+ __u32 crtc; -+ __u32 cmd; -+}; -+ -+/* -+ * DRM_IOCTL_AGP_ENABLE ioctl argument type. -+ * -+ * \sa drmAgpEnable(). -+ */ -+struct drm_agp_mode { -+ unsigned long mode; /**< AGP mode */ -+}; -+ -+/* -+ * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type. -+ * -+ * \sa drmAgpAlloc() and drmAgpFree(). -+ */ -+struct drm_agp_buffer { -+ unsigned long size; /**< In bytes -- will round to page boundary */ -+ unsigned long handle; /**< Used for binding / unbinding */ -+ unsigned long type; /**< Type of memory to allocate */ -+ unsigned long physical; /**< Physical used by i810 */ -+}; -+ -+/* -+ * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type. -+ * -+ * \sa drmAgpBind() and drmAgpUnbind(). -+ */ -+struct drm_agp_binding { -+ unsigned long handle; /**< From drm_agp_buffer */ -+ unsigned long offset; /**< In bytes -- will round to page boundary */ -+}; -+ -+/* -+ * DRM_IOCTL_AGP_INFO ioctl argument type. -+ * -+ * \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(), -+ * drmAgpBase(), drmAgpSize(), drmAgpMemoryUsed(), drmAgpMemoryAvail(), -+ * drmAgpVendorId() and drmAgpDeviceId(). -+ */ -+struct drm_agp_info { -+ int agp_version_major; -+ int agp_version_minor; -+ unsigned long mode; -+ unsigned long aperture_base; /* physical address */ -+ unsigned long aperture_size; /* bytes */ -+ unsigned long memory_allowed; /* bytes */ -+ unsigned long memory_used; -+ -+ /* PCI information */ -+ unsigned short id_vendor; -+ unsigned short id_device; -+}; -+ -+/* -+ * DRM_IOCTL_SG_ALLOC ioctl argument type. -+ */ -+struct drm_scatter_gather { -+ unsigned long size; /**< In bytes -- will round to page boundary */ -+ unsigned long handle; /**< Used for mapping / unmapping */ -+}; -+ -+/* -+ * DRM_IOCTL_SET_VERSION ioctl argument type. -+ */ -+struct drm_set_version { -+ int drm_di_major; -+ int drm_di_minor; -+ int drm_dd_major; -+ int drm_dd_minor; -+}; -+ -+/* DRM_IOCTL_GEM_CLOSE ioctl argument type */ -+struct drm_gem_close { -+ /** Handle of the object to be closed. */ -+ __u32 handle; -+ __u32 pad; -+}; -+ -+/* DRM_IOCTL_GEM_FLINK ioctl argument type */ -+struct drm_gem_flink { -+ /** Handle for the object being named */ -+ __u32 handle; -+ -+ /** Returned global name */ -+ __u32 name; -+}; -+ -+/* DRM_IOCTL_GEM_OPEN ioctl argument type */ -+struct drm_gem_open { -+ /** Name of object being opened */ -+ __u32 name; -+ -+ /** Returned handle for the object */ -+ __u32 handle; -+ -+ /** Returned size of the object */ -+ __u64 size; -+}; -+ -+/** -+ * DRM_CAP_DUMB_BUFFER -+ * -+ * If set to 1, the driver supports creating dumb buffers via the -+ * &DRM_IOCTL_MODE_CREATE_DUMB ioctl. -+ */ -+#define DRM_CAP_DUMB_BUFFER 0x1 -+/** -+ * DRM_CAP_VBLANK_HIGH_CRTC -+ * -+ * If set to 1, the kernel supports specifying a :ref:`CRTC index` -+ * in the high bits of &drm_wait_vblank_request.type. -+ * -+ * Starting kernel version 2.6.39, this capability is always set to 1. -+ */ -+#define DRM_CAP_VBLANK_HIGH_CRTC 0x2 -+/** -+ * DRM_CAP_DUMB_PREFERRED_DEPTH -+ * -+ * The preferred bit depth for dumb buffers. -+ * -+ * The bit depth is the number of bits used to indicate the color of a single -+ * pixel excluding any padding. This is different from the number of bits per -+ * pixel. For instance, XRGB8888 has a bit depth of 24 but has 32 bits per -+ * pixel. -+ * -+ * Note that this preference only applies to dumb buffers, it's irrelevant for -+ * other types of buffers. -+ */ -+#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3 -+/** -+ * DRM_CAP_DUMB_PREFER_SHADOW -+ * -+ * If set to 1, the driver prefers userspace to render to a shadow buffer -+ * instead of directly rendering to a dumb buffer. For best speed, userspace -+ * should do streaming ordered memory copies into the dumb buffer and never -+ * read from it. -+ * -+ * Note that this preference only applies to dumb buffers, it's irrelevant for -+ * other types of buffers. -+ */ -+#define DRM_CAP_DUMB_PREFER_SHADOW 0x4 -+/** -+ * DRM_CAP_PRIME -+ * -+ * Bitfield of supported PRIME sharing capabilities. See &DRM_PRIME_CAP_IMPORT -+ * and &DRM_PRIME_CAP_EXPORT. -+ * -+ * PRIME buffers are exposed as dma-buf file descriptors. See -+ * Documentation/gpu/drm-mm.rst, section "PRIME Buffer Sharing". -+ */ -+#define DRM_CAP_PRIME 0x5 -+/** -+ * DRM_PRIME_CAP_IMPORT -+ * -+ * If this bit is set in &DRM_CAP_PRIME, the driver supports importing PRIME -+ * buffers via the &DRM_IOCTL_PRIME_FD_TO_HANDLE ioctl. -+ */ -+#define DRM_PRIME_CAP_IMPORT 0x1 -+/** -+ * DRM_PRIME_CAP_EXPORT -+ * -+ * If this bit is set in &DRM_CAP_PRIME, the driver supports exporting PRIME -+ * buffers via the &DRM_IOCTL_PRIME_HANDLE_TO_FD ioctl. -+ */ -+#define DRM_PRIME_CAP_EXPORT 0x2 -+/** -+ * DRM_CAP_TIMESTAMP_MONOTONIC -+ * -+ * If set to 0, the kernel will report timestamps with ``CLOCK_REALTIME`` in -+ * struct drm_event_vblank. If set to 1, the kernel will report timestamps with -+ * ``CLOCK_MONOTONIC``. See ``clock_gettime(2)`` for the definition of these -+ * clocks. -+ * -+ * Starting from kernel version 2.6.39, the default value for this capability -+ * is 1. Starting kernel version 4.15, this capability is always set to 1. -+ */ -+#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 -+/** -+ * DRM_CAP_ASYNC_PAGE_FLIP -+ * -+ * If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC. -+ */ -+#define DRM_CAP_ASYNC_PAGE_FLIP 0x7 -+/** -+ * DRM_CAP_CURSOR_WIDTH -+ * -+ * The ``CURSOR_WIDTH`` and ``CURSOR_HEIGHT`` capabilities return a valid -+ * width x height combination for the hardware cursor. The intention is that a -+ * hardware agnostic userspace can query a cursor plane size to use. -+ * -+ * Note that the cross-driver contract is to merely return a valid size; -+ * drivers are free to attach another meaning on top, eg. i915 returns the -+ * maximum plane size. -+ */ -+#define DRM_CAP_CURSOR_WIDTH 0x8 -+/** -+ * DRM_CAP_CURSOR_HEIGHT -+ * -+ * See &DRM_CAP_CURSOR_WIDTH. -+ */ -+#define DRM_CAP_CURSOR_HEIGHT 0x9 -+/** -+ * DRM_CAP_ADDFB2_MODIFIERS -+ * -+ * If set to 1, the driver supports supplying modifiers in the -+ * &DRM_IOCTL_MODE_ADDFB2 ioctl. -+ */ -+#define DRM_CAP_ADDFB2_MODIFIERS 0x10 -+/** -+ * DRM_CAP_PAGE_FLIP_TARGET -+ * -+ * If set to 1, the driver supports the &DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE and -+ * &DRM_MODE_PAGE_FLIP_TARGET_RELATIVE flags in -+ * &drm_mode_crtc_page_flip_target.flags for the &DRM_IOCTL_MODE_PAGE_FLIP -+ * ioctl. -+ */ -+#define DRM_CAP_PAGE_FLIP_TARGET 0x11 -+/** -+ * DRM_CAP_CRTC_IN_VBLANK_EVENT -+ * -+ * If set to 1, the kernel supports reporting the CRTC ID in -+ * &drm_event_vblank.crtc_id for the &DRM_EVENT_VBLANK and -+ * &DRM_EVENT_FLIP_COMPLETE events. -+ * -+ * Starting kernel version 4.12, this capability is always set to 1. -+ */ -+#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12 -+/** -+ * DRM_CAP_SYNCOBJ -+ * -+ * If set to 1, the driver supports sync objects. See -+ * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects". -+ */ -+#define DRM_CAP_SYNCOBJ 0x13 -+/** -+ * DRM_CAP_SYNCOBJ_TIMELINE -+ * -+ * If set to 1, the driver supports timeline operations on sync objects. See -+ * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects". -+ */ -+#define DRM_CAP_SYNCOBJ_TIMELINE 0x14 -+ -+/* DRM_IOCTL_GET_CAP ioctl argument type */ -+struct drm_get_cap { -+ __u64 capability; -+ __u64 value; -+}; -+ -+/** -+ * DRM_CLIENT_CAP_STEREO_3D -+ * -+ * If set to 1, the DRM core will expose the stereo 3D capabilities of the -+ * monitor by advertising the supported 3D layouts in the flags of struct -+ * drm_mode_modeinfo. See ``DRM_MODE_FLAG_3D_*``. -+ * -+ * This capability is always supported for all drivers starting from kernel -+ * version 3.13. -+ */ -+#define DRM_CLIENT_CAP_STEREO_3D 1 -+ -+/** -+ * DRM_CLIENT_CAP_UNIVERSAL_PLANES -+ * -+ * If set to 1, the DRM core will expose all planes (overlay, primary, and -+ * cursor) to userspace. -+ * -+ * This capability has been introduced in kernel version 3.15. Starting from -+ * kernel version 3.17, this capability is always supported for all drivers. -+ */ -+#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2 -+ -+/** -+ * DRM_CLIENT_CAP_ATOMIC -+ * -+ * If set to 1, the DRM core will expose atomic properties to userspace. This -+ * implicitly enables &DRM_CLIENT_CAP_UNIVERSAL_PLANES and -+ * &DRM_CLIENT_CAP_ASPECT_RATIO. -+ * -+ * If the driver doesn't support atomic mode-setting, enabling this capability -+ * will fail with -EOPNOTSUPP. -+ * -+ * This capability has been introduced in kernel version 4.0. Starting from -+ * kernel version 4.2, this capability is always supported for atomic-capable -+ * drivers. -+ */ -+#define DRM_CLIENT_CAP_ATOMIC 3 -+ -+/** -+ * DRM_CLIENT_CAP_ASPECT_RATIO -+ * -+ * If set to 1, the DRM core will provide aspect ratio information in modes. -+ * See ``DRM_MODE_FLAG_PIC_AR_*``. -+ * -+ * This capability is always supported for all drivers starting from kernel -+ * version 4.18. -+ */ -+#define DRM_CLIENT_CAP_ASPECT_RATIO 4 -+ -+/** -+ * DRM_CLIENT_CAP_WRITEBACK_CONNECTORS -+ * -+ * If set to 1, the DRM core will expose special connectors to be used for -+ * writing back to memory the scene setup in the commit. The client must enable -+ * &DRM_CLIENT_CAP_ATOMIC first. -+ * -+ * This capability is always supported for atomic-capable drivers starting from -+ * kernel version 4.19. -+ */ -+#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5 -+ -+/* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ -+struct drm_set_client_cap { -+ __u64 capability; -+ __u64 value; -+}; -+ -+#define DRM_RDWR O_RDWR -+#define DRM_CLOEXEC O_CLOEXEC -+struct drm_prime_handle { -+ __u32 handle; -+ -+ /** Flags.. only applicable for handle->fd */ -+ __u32 flags; -+ -+ /** Returned dmabuf file descriptor */ -+ __s32 fd; -+}; -+ -+struct drm_syncobj_create { -+ __u32 handle; -+#define DRM_SYNCOBJ_CREATE_SIGNALED (1 << 0) -+ __u32 flags; -+}; -+ -+struct drm_syncobj_destroy { -+ __u32 handle; -+ __u32 pad; -+}; -+ -+#define DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE (1 << 0) -+#define DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_EXPORT_SYNC_FILE (1 << 0) -+struct drm_syncobj_handle { -+ __u32 handle; -+ __u32 flags; -+ -+ __s32 fd; -+ __u32 pad; -+}; -+ -+struct drm_syncobj_transfer { -+ __u32 src_handle; -+ __u32 dst_handle; -+ __u64 src_point; -+ __u64 dst_point; -+ __u32 flags; -+ __u32 pad; -+}; -+ -+#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0) -+#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1) -+#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE (1 << 2) /* wait for time point to become available */ -+struct drm_syncobj_wait { -+ __u64 handles; -+ /* absolute timeout */ -+ __s64 timeout_nsec; -+ __u32 count_handles; -+ __u32 flags; -+ __u32 first_signaled; /* only valid when not waiting all */ -+ __u32 pad; -+}; -+ -+struct drm_syncobj_timeline_wait { -+ __u64 handles; -+ /* wait on specific timeline point for every handles*/ -+ __u64 points; -+ /* absolute timeout */ -+ __s64 timeout_nsec; -+ __u32 count_handles; -+ __u32 flags; -+ __u32 first_signaled; /* only valid when not waiting all */ -+ __u32 pad; -+}; -+ -+ -+struct drm_syncobj_array { -+ __u64 handles; -+ __u32 count_handles; -+ __u32 pad; -+}; -+ -+#define DRM_SYNCOBJ_QUERY_FLAGS_LAST_SUBMITTED (1 << 0) /* last available point on timeline syncobj */ -+struct drm_syncobj_timeline_array { -+ __u64 handles; -+ __u64 points; -+ __u32 count_handles; -+ __u32 flags; -+}; -+ -+ -+/* Query current scanout sequence number */ -+struct drm_crtc_get_sequence { -+ __u32 crtc_id; /* requested crtc_id */ -+ __u32 active; /* return: crtc output is active */ -+ __u64 sequence; /* return: most recent vblank sequence */ -+ __s64 sequence_ns; /* return: most recent time of first pixel out */ -+}; -+ -+/* Queue event to be delivered at specified sequence. Time stamp marks -+ * when the first pixel of the refresh cycle leaves the display engine -+ * for the display -+ */ -+#define DRM_CRTC_SEQUENCE_RELATIVE 0x00000001 /* sequence is relative to current */ -+#define DRM_CRTC_SEQUENCE_NEXT_ON_MISS 0x00000002 /* Use next sequence if we've missed */ -+ -+struct drm_crtc_queue_sequence { -+ __u32 crtc_id; -+ __u32 flags; -+ __u64 sequence; /* on input, target sequence. on output, actual sequence */ -+ __u64 user_data; /* user data passed to event */ -+}; -+ -+#if defined(__cplusplus) -+} -+#endif -+ -+#include "drm_mode.h" -+ -+#if defined(__cplusplus) -+extern "C" { -+#endif -+ -+#define DRM_IOCTL_BASE 'd' -+#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr) -+#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type) -+#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type) -+#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type) -+ -+#define DRM_IOCTL_VERSION DRM_IOWR(0x00, struct drm_version) -+#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, struct drm_unique) -+#define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, struct drm_auth) -+#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, struct drm_irq_busid) -+#define DRM_IOCTL_GET_MAP DRM_IOWR(0x04, struct drm_map) -+#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client) -+#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats) -+#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version) -+#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl) -+#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close) -+#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink) -+#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open) -+#define DRM_IOCTL_GET_CAP DRM_IOWR(0x0c, struct drm_get_cap) -+#define DRM_IOCTL_SET_CLIENT_CAP DRM_IOW( 0x0d, struct drm_set_client_cap) -+ -+#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique) -+#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth) -+#define DRM_IOCTL_BLOCK DRM_IOWR(0x12, struct drm_block) -+#define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, struct drm_block) -+#define DRM_IOCTL_CONTROL DRM_IOW( 0x14, struct drm_control) -+#define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, struct drm_map) -+#define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, struct drm_buf_desc) -+#define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, struct drm_buf_desc) -+#define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, struct drm_buf_info) -+#define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, struct drm_buf_map) -+#define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, struct drm_buf_free) -+ -+#define DRM_IOCTL_RM_MAP DRM_IOW( 0x1b, struct drm_map) -+ -+#define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, struct drm_ctx_priv_map) -+#define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, struct drm_ctx_priv_map) -+ -+#define DRM_IOCTL_SET_MASTER DRM_IO(0x1e) -+#define DRM_IOCTL_DROP_MASTER DRM_IO(0x1f) -+ -+#define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, struct drm_ctx) -+#define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, struct drm_ctx) -+#define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, struct drm_ctx) -+#define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, struct drm_ctx) -+#define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, struct drm_ctx) -+#define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, struct drm_ctx) -+#define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, struct drm_ctx_res) -+#define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, struct drm_draw) -+#define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, struct drm_draw) -+#define DRM_IOCTL_DMA DRM_IOWR(0x29, struct drm_dma) -+#define DRM_IOCTL_LOCK DRM_IOW( 0x2a, struct drm_lock) -+#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock) -+#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock) -+ -+#define DRM_IOCTL_PRIME_HANDLE_TO_FD DRM_IOWR(0x2d, struct drm_prime_handle) -+#define DRM_IOCTL_PRIME_FD_TO_HANDLE DRM_IOWR(0x2e, struct drm_prime_handle) -+ -+#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30) -+#define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31) -+#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode) -+#define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, struct drm_agp_info) -+#define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, struct drm_agp_buffer) -+#define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, struct drm_agp_buffer) -+#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding) -+#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding) -+ -+#define DRM_IOCTL_SG_ALLOC DRM_IOWR(0x38, struct drm_scatter_gather) -+#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather) -+ -+#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank) -+ -+#define DRM_IOCTL_CRTC_GET_SEQUENCE DRM_IOWR(0x3b, struct drm_crtc_get_sequence) -+#define DRM_IOCTL_CRTC_QUEUE_SEQUENCE DRM_IOWR(0x3c, struct drm_crtc_queue_sequence) -+ -+#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw) -+ -+#define DRM_IOCTL_MODE_GETRESOURCES DRM_IOWR(0xA0, struct drm_mode_card_res) -+#define DRM_IOCTL_MODE_GETCRTC DRM_IOWR(0xA1, struct drm_mode_crtc) -+#define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA2, struct drm_mode_crtc) -+#define DRM_IOCTL_MODE_CURSOR DRM_IOWR(0xA3, struct drm_mode_cursor) -+#define DRM_IOCTL_MODE_GETGAMMA DRM_IOWR(0xA4, struct drm_mode_crtc_lut) -+#define DRM_IOCTL_MODE_SETGAMMA DRM_IOWR(0xA5, struct drm_mode_crtc_lut) -+#define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xA6, struct drm_mode_get_encoder) -+#define DRM_IOCTL_MODE_GETCONNECTOR DRM_IOWR(0xA7, struct drm_mode_get_connector) -+#define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA8, struct drm_mode_mode_cmd) /* deprecated (never worked) */ -+#define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd) /* deprecated (never worked) */ -+ -+#define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAA, struct drm_mode_get_property) -+#define DRM_IOCTL_MODE_SETPROPERTY DRM_IOWR(0xAB, struct drm_mode_connector_set_property) -+#define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, struct drm_mode_get_blob) -+#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd) -+#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd) -+/** -+ * DRM_IOCTL_MODE_RMFB - Remove a framebuffer. -+ * -+ * This removes a framebuffer previously added via ADDFB/ADDFB2. The IOCTL -+ * argument is a framebuffer object ID. -+ * -+ * Warning: removing a framebuffer currently in-use on an enabled plane will -+ * disable that plane. The CRTC the plane is linked to may also be disabled -+ * (depending on driver capabilities). -+ */ -+#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int) -+#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip) -+#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd) -+ -+#define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb) -+#define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, struct drm_mode_map_dumb) -+#define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, struct drm_mode_destroy_dumb) -+#define DRM_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xB5, struct drm_mode_get_plane_res) -+#define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane) -+#define DRM_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct drm_mode_set_plane) -+#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2) -+#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties) -+#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property) -+#define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2) -+#define DRM_IOCTL_MODE_ATOMIC DRM_IOWR(0xBC, struct drm_mode_atomic) -+#define DRM_IOCTL_MODE_CREATEPROPBLOB DRM_IOWR(0xBD, struct drm_mode_create_blob) -+#define DRM_IOCTL_MODE_DESTROYPROPBLOB DRM_IOWR(0xBE, struct drm_mode_destroy_blob) -+ -+#define DRM_IOCTL_SYNCOBJ_CREATE DRM_IOWR(0xBF, struct drm_syncobj_create) -+#define DRM_IOCTL_SYNCOBJ_DESTROY DRM_IOWR(0xC0, struct drm_syncobj_destroy) -+#define DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD DRM_IOWR(0xC1, struct drm_syncobj_handle) -+#define DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE DRM_IOWR(0xC2, struct drm_syncobj_handle) -+#define DRM_IOCTL_SYNCOBJ_WAIT DRM_IOWR(0xC3, struct drm_syncobj_wait) -+#define DRM_IOCTL_SYNCOBJ_RESET DRM_IOWR(0xC4, struct drm_syncobj_array) -+#define DRM_IOCTL_SYNCOBJ_SIGNAL DRM_IOWR(0xC5, struct drm_syncobj_array) -+ -+#define DRM_IOCTL_MODE_CREATE_LEASE DRM_IOWR(0xC6, struct drm_mode_create_lease) -+#define DRM_IOCTL_MODE_LIST_LESSEES DRM_IOWR(0xC7, struct drm_mode_list_lessees) -+#define DRM_IOCTL_MODE_GET_LEASE DRM_IOWR(0xC8, struct drm_mode_get_lease) -+#define DRM_IOCTL_MODE_REVOKE_LEASE DRM_IOWR(0xC9, struct drm_mode_revoke_lease) -+ -+#define DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT DRM_IOWR(0xCA, struct drm_syncobj_timeline_wait) -+#define DRM_IOCTL_SYNCOBJ_QUERY DRM_IOWR(0xCB, struct drm_syncobj_timeline_array) -+#define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer) -+#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct drm_syncobj_timeline_array) -+ -+#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2) -+ -+/* -+ * Device specific ioctls should only be in their respective headers -+ * The device specific ioctl range is from 0x40 to 0x9f. -+ * Generic IOCTLS restart at 0xA0. -+ * -+ * \sa drmCommandNone(), drmCommandRead(), drmCommandWrite(), and -+ * drmCommandReadWrite(). -+ */ -+#define DRM_COMMAND_BASE 0x40 -+#define DRM_COMMAND_END 0xA0 -+ -+/* -+ * Header for events written back to userspace on the drm fd. The -+ * type defines the type of event, the length specifies the total -+ * length of the event (including the header), and user_data is -+ * typically a 64 bit value passed with the ioctl that triggered the -+ * event. A read on the drm fd will always only return complete -+ * events, that is, if for example the read buffer is 100 bytes, and -+ * there are two 64 byte events pending, only one will be returned. -+ * -+ * Event types 0 - 0x7fffffff are generic drm events, 0x80000000 and -+ * up are chipset specific. -+ */ -+struct drm_event { -+ __u32 type; -+ __u32 length; -+}; -+ -+#define DRM_EVENT_VBLANK 0x01 -+#define DRM_EVENT_FLIP_COMPLETE 0x02 -+#define DRM_EVENT_CRTC_SEQUENCE 0x03 -+ -+struct drm_event_vblank { -+ struct drm_event base; -+ __u64 user_data; -+ __u32 tv_sec; -+ __u32 tv_usec; -+ __u32 sequence; -+ __u32 crtc_id; /* 0 on older kernels that do not support this */ -+}; -+ -+/* Event delivered at sequence. Time stamp marks when the first pixel -+ * of the refresh cycle leaves the display engine for the display -+ */ -+struct drm_event_crtc_sequence { -+ struct drm_event base; -+ __u64 user_data; -+ __s64 time_ns; -+ __u64 sequence; -+}; -+ -+/* typedef area */ -+typedef struct drm_clip_rect drm_clip_rect_t; -+typedef struct drm_drawable_info drm_drawable_info_t; -+typedef struct drm_tex_region drm_tex_region_t; -+typedef struct drm_hw_lock drm_hw_lock_t; -+typedef struct drm_version drm_version_t; -+typedef struct drm_unique drm_unique_t; -+typedef struct drm_list drm_list_t; -+typedef struct drm_block drm_block_t; -+typedef struct drm_control drm_control_t; -+typedef enum drm_map_type drm_map_type_t; -+typedef enum drm_map_flags drm_map_flags_t; -+typedef struct drm_ctx_priv_map drm_ctx_priv_map_t; -+typedef struct drm_map drm_map_t; -+typedef struct drm_client drm_client_t; -+typedef enum drm_stat_type drm_stat_type_t; -+typedef struct drm_stats drm_stats_t; -+typedef enum drm_lock_flags drm_lock_flags_t; -+typedef struct drm_lock drm_lock_t; -+typedef enum drm_dma_flags drm_dma_flags_t; -+typedef struct drm_buf_desc drm_buf_desc_t; -+typedef struct drm_buf_info drm_buf_info_t; -+typedef struct drm_buf_free drm_buf_free_t; -+typedef struct drm_buf_pub drm_buf_pub_t; -+typedef struct drm_buf_map drm_buf_map_t; -+typedef struct drm_dma drm_dma_t; -+typedef union drm_wait_vblank drm_wait_vblank_t; -+typedef struct drm_agp_mode drm_agp_mode_t; -+typedef enum drm_ctx_flags drm_ctx_flags_t; -+typedef struct drm_ctx drm_ctx_t; -+typedef struct drm_ctx_res drm_ctx_res_t; -+typedef struct drm_draw drm_draw_t; -+typedef struct drm_update_draw drm_update_draw_t; -+typedef struct drm_auth drm_auth_t; -+typedef struct drm_irq_busid drm_irq_busid_t; -+typedef enum drm_vblank_seq_type drm_vblank_seq_type_t; -+ -+typedef struct drm_agp_buffer drm_agp_buffer_t; -+typedef struct drm_agp_binding drm_agp_binding_t; -+typedef struct drm_agp_info drm_agp_info_t; -+typedef struct drm_scatter_gather drm_scatter_gather_t; -+typedef struct drm_set_version drm_set_version_t; -+ -+#if defined(__cplusplus) -+} -+#endif -+ -+#endif -diff --git a/third_party/drm/drm/drm_fourcc.h b/third_party/drm/drm/drm_fourcc.h -new file mode 100644 -index 000000000000..4ececa84baa6 ---- /dev/null -+++ b/third_party/drm/drm/drm_fourcc.h +diff -up firefox-109.0/third_party/drm/drm/drm_fourcc.h.libwebrtc-screen-cast-sync firefox-109.0/third_party/drm/drm/drm_fourcc.h +--- firefox-109.0/third_party/drm/drm/drm_fourcc.h.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.193614089 +0100 ++++ firefox-109.0/third_party/drm/drm/drm_fourcc.h 2023-01-12 15:16:09.193614089 +0100 @@ -0,0 +1,1377 @@ +/* + * Copyright 2011 Intel Corporation @@ -2603,11 +1391,1206 @@ index 000000000000..4ececa84baa6 +#endif + +#endif /* DRM_FOURCC_H */ -diff --git a/third_party/drm/drm/drm_mode.h b/third_party/drm/drm/drm_mode.h -new file mode 100644 -index 000000000000..e1e351682872 ---- /dev/null -+++ b/third_party/drm/drm/drm_mode.h +diff -up firefox-109.0/third_party/drm/drm/drm.h.libwebrtc-screen-cast-sync firefox-109.0/third_party/drm/drm/drm.h +--- firefox-109.0/third_party/drm/drm/drm.h.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.193614089 +0100 ++++ firefox-109.0/third_party/drm/drm/drm.h 2023-01-12 15:16:09.193614089 +0100 +@@ -0,0 +1,1193 @@ ++/* ++ * Header for the Direct Rendering Manager ++ * ++ * Author: Rickard E. (Rik) Faith ++ * ++ * Acknowledgments: ++ * Dec 1999, Richard Henderson , move to generic cmpxchg. ++ */ ++ ++/* ++ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. ++ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. ++ * All rights reserved. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++#ifndef _DRM_H_ ++#define _DRM_H_ ++ ++#if defined(__linux__) ++ ++#include ++#include ++typedef unsigned int drm_handle_t; ++ ++#else /* One of the BSDs */ ++ ++#include ++#include ++#include ++typedef int8_t __s8; ++typedef uint8_t __u8; ++typedef int16_t __s16; ++typedef uint16_t __u16; ++typedef int32_t __s32; ++typedef uint32_t __u32; ++typedef int64_t __s64; ++typedef uint64_t __u64; ++typedef size_t __kernel_size_t; ++typedef unsigned long drm_handle_t; ++ ++#endif ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */ ++#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */ ++#define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */ ++#define DRM_RAM_PERCENT 10 /**< How much system ram can we lock? */ ++ ++#define _DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */ ++#define _DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */ ++#define _DRM_LOCK_IS_HELD(lock) ((lock) & _DRM_LOCK_HELD) ++#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT) ++#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) ++ ++typedef unsigned int drm_context_t; ++typedef unsigned int drm_drawable_t; ++typedef unsigned int drm_magic_t; ++ ++/* ++ * Cliprect. ++ * ++ * \warning: If you change this structure, make sure you change ++ * XF86DRIClipRectRec in the server as well ++ * ++ * \note KW: Actually it's illegal to change either for ++ * backwards-compatibility reasons. ++ */ ++struct drm_clip_rect { ++ unsigned short x1; ++ unsigned short y1; ++ unsigned short x2; ++ unsigned short y2; ++}; ++ ++/* ++ * Drawable information. ++ */ ++struct drm_drawable_info { ++ unsigned int num_rects; ++ struct drm_clip_rect *rects; ++}; ++ ++/* ++ * Texture region, ++ */ ++struct drm_tex_region { ++ unsigned char next; ++ unsigned char prev; ++ unsigned char in_use; ++ unsigned char padding; ++ unsigned int age; ++}; ++ ++/* ++ * Hardware lock. ++ * ++ * The lock structure is a simple cache-line aligned integer. To avoid ++ * processor bus contention on a multiprocessor system, there should not be any ++ * other data stored in the same cache line. ++ */ ++struct drm_hw_lock { ++ __volatile__ unsigned int lock; /**< lock variable */ ++ char padding[60]; /**< Pad to cache line */ ++}; ++ ++/* ++ * DRM_IOCTL_VERSION ioctl argument type. ++ * ++ * \sa drmGetVersion(). ++ */ ++struct drm_version { ++ int version_major; /**< Major version */ ++ int version_minor; /**< Minor version */ ++ int version_patchlevel; /**< Patch level */ ++ __kernel_size_t name_len; /**< Length of name buffer */ ++ char *name; /**< Name of driver */ ++ __kernel_size_t date_len; /**< Length of date buffer */ ++ char *date; /**< User-space buffer to hold date */ ++ __kernel_size_t desc_len; /**< Length of desc buffer */ ++ char *desc; /**< User-space buffer to hold desc */ ++}; ++ ++/* ++ * DRM_IOCTL_GET_UNIQUE ioctl argument type. ++ * ++ * \sa drmGetBusid() and drmSetBusId(). ++ */ ++struct drm_unique { ++ __kernel_size_t unique_len; /**< Length of unique */ ++ char *unique; /**< Unique name for driver instantiation */ ++}; ++ ++struct drm_list { ++ int count; /**< Length of user-space structures */ ++ struct drm_version *version; ++}; ++ ++struct drm_block { ++ int unused; ++}; ++ ++/* ++ * DRM_IOCTL_CONTROL ioctl argument type. ++ * ++ * \sa drmCtlInstHandler() and drmCtlUninstHandler(). ++ */ ++struct drm_control { ++ enum { ++ DRM_ADD_COMMAND, ++ DRM_RM_COMMAND, ++ DRM_INST_HANDLER, ++ DRM_UNINST_HANDLER ++ } func; ++ int irq; ++}; ++ ++/* ++ * Type of memory to map. ++ */ ++enum drm_map_type { ++ _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */ ++ _DRM_REGISTERS = 1, /**< no caching, no core dump */ ++ _DRM_SHM = 2, /**< shared, cached */ ++ _DRM_AGP = 3, /**< AGP/GART */ ++ _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */ ++ _DRM_CONSISTENT = 5 /**< Consistent memory for PCI DMA */ ++}; ++ ++/* ++ * Memory mapping flags. ++ */ ++enum drm_map_flags { ++ _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */ ++ _DRM_READ_ONLY = 0x02, ++ _DRM_LOCKED = 0x04, /**< shared, cached, locked */ ++ _DRM_KERNEL = 0x08, /**< kernel requires access */ ++ _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */ ++ _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */ ++ _DRM_REMOVABLE = 0x40, /**< Removable mapping */ ++ _DRM_DRIVER = 0x80 /**< Managed by driver */ ++}; ++ ++struct drm_ctx_priv_map { ++ unsigned int ctx_id; /**< Context requesting private mapping */ ++ void *handle; /**< Handle of map */ ++}; ++ ++/* ++ * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls ++ * argument type. ++ * ++ * \sa drmAddMap(). ++ */ ++struct drm_map { ++ unsigned long offset; /**< Requested physical address (0 for SAREA)*/ ++ unsigned long size; /**< Requested physical size (bytes) */ ++ enum drm_map_type type; /**< Type of memory to map */ ++ enum drm_map_flags flags; /**< Flags */ ++ void *handle; /**< User-space: "Handle" to pass to mmap() */ ++ /**< Kernel-space: kernel-virtual address */ ++ int mtrr; /**< MTRR slot used */ ++ /* Private data */ ++}; ++ ++/* ++ * DRM_IOCTL_GET_CLIENT ioctl argument type. ++ */ ++struct drm_client { ++ int idx; /**< Which client desired? */ ++ int auth; /**< Is client authenticated? */ ++ unsigned long pid; /**< Process ID */ ++ unsigned long uid; /**< User ID */ ++ unsigned long magic; /**< Magic */ ++ unsigned long iocs; /**< Ioctl count */ ++}; ++ ++enum drm_stat_type { ++ _DRM_STAT_LOCK, ++ _DRM_STAT_OPENS, ++ _DRM_STAT_CLOSES, ++ _DRM_STAT_IOCTLS, ++ _DRM_STAT_LOCKS, ++ _DRM_STAT_UNLOCKS, ++ _DRM_STAT_VALUE, /**< Generic value */ ++ _DRM_STAT_BYTE, /**< Generic byte counter (1024bytes/K) */ ++ _DRM_STAT_COUNT, /**< Generic non-byte counter (1000/k) */ ++ ++ _DRM_STAT_IRQ, /**< IRQ */ ++ _DRM_STAT_PRIMARY, /**< Primary DMA bytes */ ++ _DRM_STAT_SECONDARY, /**< Secondary DMA bytes */ ++ _DRM_STAT_DMA, /**< DMA */ ++ _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */ ++ _DRM_STAT_MISSED /**< Missed DMA opportunity */ ++ /* Add to the *END* of the list */ ++}; ++ ++/* ++ * DRM_IOCTL_GET_STATS ioctl argument type. ++ */ ++struct drm_stats { ++ unsigned long count; ++ struct { ++ unsigned long value; ++ enum drm_stat_type type; ++ } data[15]; ++}; ++ ++/* ++ * Hardware locking flags. ++ */ ++enum drm_lock_flags { ++ _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */ ++ _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */ ++ _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */ ++ _DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */ ++ /* These *HALT* flags aren't supported yet ++ -- they will be used to support the ++ full-screen DGA-like mode. */ ++ _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */ ++ _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ ++}; ++ ++/* ++ * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type. ++ * ++ * \sa drmGetLock() and drmUnlock(). ++ */ ++struct drm_lock { ++ int context; ++ enum drm_lock_flags flags; ++}; ++ ++/* ++ * DMA flags ++ * ++ * \warning ++ * These values \e must match xf86drm.h. ++ * ++ * \sa drm_dma. ++ */ ++enum drm_dma_flags { ++ /* Flags for DMA buffer dispatch */ ++ _DRM_DMA_BLOCK = 0x01, /**< ++ * Block until buffer dispatched. ++ * ++ * \note The buffer may not yet have ++ * been processed by the hardware -- ++ * getting a hardware lock with the ++ * hardware quiescent will ensure ++ * that the buffer has been ++ * processed. ++ */ ++ _DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */ ++ _DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */ ++ ++ /* Flags for DMA buffer request */ ++ _DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */ ++ _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */ ++ _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ ++}; ++ ++/* ++ * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type. ++ * ++ * \sa drmAddBufs(). ++ */ ++struct drm_buf_desc { ++ int count; /**< Number of buffers of this size */ ++ int size; /**< Size in bytes */ ++ int low_mark; /**< Low water mark */ ++ int high_mark; /**< High water mark */ ++ enum { ++ _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */ ++ _DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */ ++ _DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */ ++ _DRM_FB_BUFFER = 0x08, /**< Buffer is in frame buffer */ ++ _DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */ ++ } flags; ++ unsigned long agp_start; /**< ++ * Start address of where the AGP buffers are ++ * in the AGP aperture ++ */ ++}; ++ ++/* ++ * DRM_IOCTL_INFO_BUFS ioctl argument type. ++ */ ++struct drm_buf_info { ++ int count; /**< Entries in list */ ++ struct drm_buf_desc *list; ++}; ++ ++/* ++ * DRM_IOCTL_FREE_BUFS ioctl argument type. ++ */ ++struct drm_buf_free { ++ int count; ++ int *list; ++}; ++ ++/* ++ * Buffer information ++ * ++ * \sa drm_buf_map. ++ */ ++struct drm_buf_pub { ++ int idx; /**< Index into the master buffer list */ ++ int total; /**< Buffer size */ ++ int used; /**< Amount of buffer in use (for DMA) */ ++ void *address; /**< Address of buffer */ ++}; ++ ++/* ++ * DRM_IOCTL_MAP_BUFS ioctl argument type. ++ */ ++struct drm_buf_map { ++ int count; /**< Length of the buffer list */ ++#ifdef __cplusplus ++ void *virt; ++#else ++ void *virtual; /**< Mmap'd area in user-virtual */ ++#endif ++ struct drm_buf_pub *list; /**< Buffer information */ ++}; ++ ++/* ++ * DRM_IOCTL_DMA ioctl argument type. ++ * ++ * Indices here refer to the offset into the buffer list in drm_buf_get. ++ * ++ * \sa drmDMA(). ++ */ ++struct drm_dma { ++ int context; /**< Context handle */ ++ int send_count; /**< Number of buffers to send */ ++ int *send_indices; /**< List of handles to buffers */ ++ int *send_sizes; /**< Lengths of data to send */ ++ enum drm_dma_flags flags; /**< Flags */ ++ int request_count; /**< Number of buffers requested */ ++ int request_size; /**< Desired size for buffers */ ++ int *request_indices; /**< Buffer information */ ++ int *request_sizes; ++ int granted_count; /**< Number of buffers granted */ ++}; ++ ++enum drm_ctx_flags { ++ _DRM_CONTEXT_PRESERVED = 0x01, ++ _DRM_CONTEXT_2DONLY = 0x02 ++}; ++ ++/* ++ * DRM_IOCTL_ADD_CTX ioctl argument type. ++ * ++ * \sa drmCreateContext() and drmDestroyContext(). ++ */ ++struct drm_ctx { ++ drm_context_t handle; ++ enum drm_ctx_flags flags; ++}; ++ ++/* ++ * DRM_IOCTL_RES_CTX ioctl argument type. ++ */ ++struct drm_ctx_res { ++ int count; ++ struct drm_ctx *contexts; ++}; ++ ++/* ++ * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type. ++ */ ++struct drm_draw { ++ drm_drawable_t handle; ++}; ++ ++/* ++ * DRM_IOCTL_UPDATE_DRAW ioctl argument type. ++ */ ++typedef enum { ++ DRM_DRAWABLE_CLIPRECTS ++} drm_drawable_info_type_t; ++ ++struct drm_update_draw { ++ drm_drawable_t handle; ++ unsigned int type; ++ unsigned int num; ++ unsigned long long data; ++}; ++ ++/* ++ * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type. ++ */ ++struct drm_auth { ++ drm_magic_t magic; ++}; ++ ++/* ++ * DRM_IOCTL_IRQ_BUSID ioctl argument type. ++ * ++ * \sa drmGetInterruptFromBusID(). ++ */ ++struct drm_irq_busid { ++ int irq; /**< IRQ number */ ++ int busnum; /**< bus number */ ++ int devnum; /**< device number */ ++ int funcnum; /**< function number */ ++}; ++ ++enum drm_vblank_seq_type { ++ _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ ++ _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ ++ /* bits 1-6 are reserved for high crtcs */ ++ _DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e, ++ _DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */ ++ _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ ++ _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ ++ _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ ++ _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking, unsupported */ ++}; ++#define _DRM_VBLANK_HIGH_CRTC_SHIFT 1 ++ ++#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE) ++#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \ ++ _DRM_VBLANK_SECONDARY | _DRM_VBLANK_NEXTONMISS) ++ ++struct drm_wait_vblank_request { ++ enum drm_vblank_seq_type type; ++ unsigned int sequence; ++ unsigned long signal; ++}; ++ ++struct drm_wait_vblank_reply { ++ enum drm_vblank_seq_type type; ++ unsigned int sequence; ++ long tval_sec; ++ long tval_usec; ++}; ++ ++/* ++ * DRM_IOCTL_WAIT_VBLANK ioctl argument type. ++ * ++ * \sa drmWaitVBlank(). ++ */ ++union drm_wait_vblank { ++ struct drm_wait_vblank_request request; ++ struct drm_wait_vblank_reply reply; ++}; ++ ++#define _DRM_PRE_MODESET 1 ++#define _DRM_POST_MODESET 2 ++ ++/* ++ * DRM_IOCTL_MODESET_CTL ioctl argument type ++ * ++ * \sa drmModesetCtl(). ++ */ ++struct drm_modeset_ctl { ++ __u32 crtc; ++ __u32 cmd; ++}; ++ ++/* ++ * DRM_IOCTL_AGP_ENABLE ioctl argument type. ++ * ++ * \sa drmAgpEnable(). ++ */ ++struct drm_agp_mode { ++ unsigned long mode; /**< AGP mode */ ++}; ++ ++/* ++ * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type. ++ * ++ * \sa drmAgpAlloc() and drmAgpFree(). ++ */ ++struct drm_agp_buffer { ++ unsigned long size; /**< In bytes -- will round to page boundary */ ++ unsigned long handle; /**< Used for binding / unbinding */ ++ unsigned long type; /**< Type of memory to allocate */ ++ unsigned long physical; /**< Physical used by i810 */ ++}; ++ ++/* ++ * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type. ++ * ++ * \sa drmAgpBind() and drmAgpUnbind(). ++ */ ++struct drm_agp_binding { ++ unsigned long handle; /**< From drm_agp_buffer */ ++ unsigned long offset; /**< In bytes -- will round to page boundary */ ++}; ++ ++/* ++ * DRM_IOCTL_AGP_INFO ioctl argument type. ++ * ++ * \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(), ++ * drmAgpBase(), drmAgpSize(), drmAgpMemoryUsed(), drmAgpMemoryAvail(), ++ * drmAgpVendorId() and drmAgpDeviceId(). ++ */ ++struct drm_agp_info { ++ int agp_version_major; ++ int agp_version_minor; ++ unsigned long mode; ++ unsigned long aperture_base; /* physical address */ ++ unsigned long aperture_size; /* bytes */ ++ unsigned long memory_allowed; /* bytes */ ++ unsigned long memory_used; ++ ++ /* PCI information */ ++ unsigned short id_vendor; ++ unsigned short id_device; ++}; ++ ++/* ++ * DRM_IOCTL_SG_ALLOC ioctl argument type. ++ */ ++struct drm_scatter_gather { ++ unsigned long size; /**< In bytes -- will round to page boundary */ ++ unsigned long handle; /**< Used for mapping / unmapping */ ++}; ++ ++/* ++ * DRM_IOCTL_SET_VERSION ioctl argument type. ++ */ ++struct drm_set_version { ++ int drm_di_major; ++ int drm_di_minor; ++ int drm_dd_major; ++ int drm_dd_minor; ++}; ++ ++/* DRM_IOCTL_GEM_CLOSE ioctl argument type */ ++struct drm_gem_close { ++ /** Handle of the object to be closed. */ ++ __u32 handle; ++ __u32 pad; ++}; ++ ++/* DRM_IOCTL_GEM_FLINK ioctl argument type */ ++struct drm_gem_flink { ++ /** Handle for the object being named */ ++ __u32 handle; ++ ++ /** Returned global name */ ++ __u32 name; ++}; ++ ++/* DRM_IOCTL_GEM_OPEN ioctl argument type */ ++struct drm_gem_open { ++ /** Name of object being opened */ ++ __u32 name; ++ ++ /** Returned handle for the object */ ++ __u32 handle; ++ ++ /** Returned size of the object */ ++ __u64 size; ++}; ++ ++/** ++ * DRM_CAP_DUMB_BUFFER ++ * ++ * If set to 1, the driver supports creating dumb buffers via the ++ * &DRM_IOCTL_MODE_CREATE_DUMB ioctl. ++ */ ++#define DRM_CAP_DUMB_BUFFER 0x1 ++/** ++ * DRM_CAP_VBLANK_HIGH_CRTC ++ * ++ * If set to 1, the kernel supports specifying a :ref:`CRTC index` ++ * in the high bits of &drm_wait_vblank_request.type. ++ * ++ * Starting kernel version 2.6.39, this capability is always set to 1. ++ */ ++#define DRM_CAP_VBLANK_HIGH_CRTC 0x2 ++/** ++ * DRM_CAP_DUMB_PREFERRED_DEPTH ++ * ++ * The preferred bit depth for dumb buffers. ++ * ++ * The bit depth is the number of bits used to indicate the color of a single ++ * pixel excluding any padding. This is different from the number of bits per ++ * pixel. For instance, XRGB8888 has a bit depth of 24 but has 32 bits per ++ * pixel. ++ * ++ * Note that this preference only applies to dumb buffers, it's irrelevant for ++ * other types of buffers. ++ */ ++#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3 ++/** ++ * DRM_CAP_DUMB_PREFER_SHADOW ++ * ++ * If set to 1, the driver prefers userspace to render to a shadow buffer ++ * instead of directly rendering to a dumb buffer. For best speed, userspace ++ * should do streaming ordered memory copies into the dumb buffer and never ++ * read from it. ++ * ++ * Note that this preference only applies to dumb buffers, it's irrelevant for ++ * other types of buffers. ++ */ ++#define DRM_CAP_DUMB_PREFER_SHADOW 0x4 ++/** ++ * DRM_CAP_PRIME ++ * ++ * Bitfield of supported PRIME sharing capabilities. See &DRM_PRIME_CAP_IMPORT ++ * and &DRM_PRIME_CAP_EXPORT. ++ * ++ * PRIME buffers are exposed as dma-buf file descriptors. See ++ * Documentation/gpu/drm-mm.rst, section "PRIME Buffer Sharing". ++ */ ++#define DRM_CAP_PRIME 0x5 ++/** ++ * DRM_PRIME_CAP_IMPORT ++ * ++ * If this bit is set in &DRM_CAP_PRIME, the driver supports importing PRIME ++ * buffers via the &DRM_IOCTL_PRIME_FD_TO_HANDLE ioctl. ++ */ ++#define DRM_PRIME_CAP_IMPORT 0x1 ++/** ++ * DRM_PRIME_CAP_EXPORT ++ * ++ * If this bit is set in &DRM_CAP_PRIME, the driver supports exporting PRIME ++ * buffers via the &DRM_IOCTL_PRIME_HANDLE_TO_FD ioctl. ++ */ ++#define DRM_PRIME_CAP_EXPORT 0x2 ++/** ++ * DRM_CAP_TIMESTAMP_MONOTONIC ++ * ++ * If set to 0, the kernel will report timestamps with ``CLOCK_REALTIME`` in ++ * struct drm_event_vblank. If set to 1, the kernel will report timestamps with ++ * ``CLOCK_MONOTONIC``. See ``clock_gettime(2)`` for the definition of these ++ * clocks. ++ * ++ * Starting from kernel version 2.6.39, the default value for this capability ++ * is 1. Starting kernel version 4.15, this capability is always set to 1. ++ */ ++#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 ++/** ++ * DRM_CAP_ASYNC_PAGE_FLIP ++ * ++ * If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC. ++ */ ++#define DRM_CAP_ASYNC_PAGE_FLIP 0x7 ++/** ++ * DRM_CAP_CURSOR_WIDTH ++ * ++ * The ``CURSOR_WIDTH`` and ``CURSOR_HEIGHT`` capabilities return a valid ++ * width x height combination for the hardware cursor. The intention is that a ++ * hardware agnostic userspace can query a cursor plane size to use. ++ * ++ * Note that the cross-driver contract is to merely return a valid size; ++ * drivers are free to attach another meaning on top, eg. i915 returns the ++ * maximum plane size. ++ */ ++#define DRM_CAP_CURSOR_WIDTH 0x8 ++/** ++ * DRM_CAP_CURSOR_HEIGHT ++ * ++ * See &DRM_CAP_CURSOR_WIDTH. ++ */ ++#define DRM_CAP_CURSOR_HEIGHT 0x9 ++/** ++ * DRM_CAP_ADDFB2_MODIFIERS ++ * ++ * If set to 1, the driver supports supplying modifiers in the ++ * &DRM_IOCTL_MODE_ADDFB2 ioctl. ++ */ ++#define DRM_CAP_ADDFB2_MODIFIERS 0x10 ++/** ++ * DRM_CAP_PAGE_FLIP_TARGET ++ * ++ * If set to 1, the driver supports the &DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE and ++ * &DRM_MODE_PAGE_FLIP_TARGET_RELATIVE flags in ++ * &drm_mode_crtc_page_flip_target.flags for the &DRM_IOCTL_MODE_PAGE_FLIP ++ * ioctl. ++ */ ++#define DRM_CAP_PAGE_FLIP_TARGET 0x11 ++/** ++ * DRM_CAP_CRTC_IN_VBLANK_EVENT ++ * ++ * If set to 1, the kernel supports reporting the CRTC ID in ++ * &drm_event_vblank.crtc_id for the &DRM_EVENT_VBLANK and ++ * &DRM_EVENT_FLIP_COMPLETE events. ++ * ++ * Starting kernel version 4.12, this capability is always set to 1. ++ */ ++#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12 ++/** ++ * DRM_CAP_SYNCOBJ ++ * ++ * If set to 1, the driver supports sync objects. See ++ * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects". ++ */ ++#define DRM_CAP_SYNCOBJ 0x13 ++/** ++ * DRM_CAP_SYNCOBJ_TIMELINE ++ * ++ * If set to 1, the driver supports timeline operations on sync objects. See ++ * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects". ++ */ ++#define DRM_CAP_SYNCOBJ_TIMELINE 0x14 ++ ++/* DRM_IOCTL_GET_CAP ioctl argument type */ ++struct drm_get_cap { ++ __u64 capability; ++ __u64 value; ++}; ++ ++/** ++ * DRM_CLIENT_CAP_STEREO_3D ++ * ++ * If set to 1, the DRM core will expose the stereo 3D capabilities of the ++ * monitor by advertising the supported 3D layouts in the flags of struct ++ * drm_mode_modeinfo. See ``DRM_MODE_FLAG_3D_*``. ++ * ++ * This capability is always supported for all drivers starting from kernel ++ * version 3.13. ++ */ ++#define DRM_CLIENT_CAP_STEREO_3D 1 ++ ++/** ++ * DRM_CLIENT_CAP_UNIVERSAL_PLANES ++ * ++ * If set to 1, the DRM core will expose all planes (overlay, primary, and ++ * cursor) to userspace. ++ * ++ * This capability has been introduced in kernel version 3.15. Starting from ++ * kernel version 3.17, this capability is always supported for all drivers. ++ */ ++#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2 ++ ++/** ++ * DRM_CLIENT_CAP_ATOMIC ++ * ++ * If set to 1, the DRM core will expose atomic properties to userspace. This ++ * implicitly enables &DRM_CLIENT_CAP_UNIVERSAL_PLANES and ++ * &DRM_CLIENT_CAP_ASPECT_RATIO. ++ * ++ * If the driver doesn't support atomic mode-setting, enabling this capability ++ * will fail with -EOPNOTSUPP. ++ * ++ * This capability has been introduced in kernel version 4.0. Starting from ++ * kernel version 4.2, this capability is always supported for atomic-capable ++ * drivers. ++ */ ++#define DRM_CLIENT_CAP_ATOMIC 3 ++ ++/** ++ * DRM_CLIENT_CAP_ASPECT_RATIO ++ * ++ * If set to 1, the DRM core will provide aspect ratio information in modes. ++ * See ``DRM_MODE_FLAG_PIC_AR_*``. ++ * ++ * This capability is always supported for all drivers starting from kernel ++ * version 4.18. ++ */ ++#define DRM_CLIENT_CAP_ASPECT_RATIO 4 ++ ++/** ++ * DRM_CLIENT_CAP_WRITEBACK_CONNECTORS ++ * ++ * If set to 1, the DRM core will expose special connectors to be used for ++ * writing back to memory the scene setup in the commit. The client must enable ++ * &DRM_CLIENT_CAP_ATOMIC first. ++ * ++ * This capability is always supported for atomic-capable drivers starting from ++ * kernel version 4.19. ++ */ ++#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5 ++ ++/* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ ++struct drm_set_client_cap { ++ __u64 capability; ++ __u64 value; ++}; ++ ++#define DRM_RDWR O_RDWR ++#define DRM_CLOEXEC O_CLOEXEC ++struct drm_prime_handle { ++ __u32 handle; ++ ++ /** Flags.. only applicable for handle->fd */ ++ __u32 flags; ++ ++ /** Returned dmabuf file descriptor */ ++ __s32 fd; ++}; ++ ++struct drm_syncobj_create { ++ __u32 handle; ++#define DRM_SYNCOBJ_CREATE_SIGNALED (1 << 0) ++ __u32 flags; ++}; ++ ++struct drm_syncobj_destroy { ++ __u32 handle; ++ __u32 pad; ++}; ++ ++#define DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE (1 << 0) ++#define DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_EXPORT_SYNC_FILE (1 << 0) ++struct drm_syncobj_handle { ++ __u32 handle; ++ __u32 flags; ++ ++ __s32 fd; ++ __u32 pad; ++}; ++ ++struct drm_syncobj_transfer { ++ __u32 src_handle; ++ __u32 dst_handle; ++ __u64 src_point; ++ __u64 dst_point; ++ __u32 flags; ++ __u32 pad; ++}; ++ ++#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0) ++#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1) ++#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE (1 << 2) /* wait for time point to become available */ ++struct drm_syncobj_wait { ++ __u64 handles; ++ /* absolute timeout */ ++ __s64 timeout_nsec; ++ __u32 count_handles; ++ __u32 flags; ++ __u32 first_signaled; /* only valid when not waiting all */ ++ __u32 pad; ++}; ++ ++struct drm_syncobj_timeline_wait { ++ __u64 handles; ++ /* wait on specific timeline point for every handles*/ ++ __u64 points; ++ /* absolute timeout */ ++ __s64 timeout_nsec; ++ __u32 count_handles; ++ __u32 flags; ++ __u32 first_signaled; /* only valid when not waiting all */ ++ __u32 pad; ++}; ++ ++ ++struct drm_syncobj_array { ++ __u64 handles; ++ __u32 count_handles; ++ __u32 pad; ++}; ++ ++#define DRM_SYNCOBJ_QUERY_FLAGS_LAST_SUBMITTED (1 << 0) /* last available point on timeline syncobj */ ++struct drm_syncobj_timeline_array { ++ __u64 handles; ++ __u64 points; ++ __u32 count_handles; ++ __u32 flags; ++}; ++ ++ ++/* Query current scanout sequence number */ ++struct drm_crtc_get_sequence { ++ __u32 crtc_id; /* requested crtc_id */ ++ __u32 active; /* return: crtc output is active */ ++ __u64 sequence; /* return: most recent vblank sequence */ ++ __s64 sequence_ns; /* return: most recent time of first pixel out */ ++}; ++ ++/* Queue event to be delivered at specified sequence. Time stamp marks ++ * when the first pixel of the refresh cycle leaves the display engine ++ * for the display ++ */ ++#define DRM_CRTC_SEQUENCE_RELATIVE 0x00000001 /* sequence is relative to current */ ++#define DRM_CRTC_SEQUENCE_NEXT_ON_MISS 0x00000002 /* Use next sequence if we've missed */ ++ ++struct drm_crtc_queue_sequence { ++ __u32 crtc_id; ++ __u32 flags; ++ __u64 sequence; /* on input, target sequence. on output, actual sequence */ ++ __u64 user_data; /* user data passed to event */ ++}; ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#include "drm_mode.h" ++ ++#if defined(__cplusplus) ++extern "C" { ++#endif ++ ++#define DRM_IOCTL_BASE 'd' ++#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr) ++#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type) ++#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type) ++#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type) ++ ++#define DRM_IOCTL_VERSION DRM_IOWR(0x00, struct drm_version) ++#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, struct drm_unique) ++#define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, struct drm_auth) ++#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, struct drm_irq_busid) ++#define DRM_IOCTL_GET_MAP DRM_IOWR(0x04, struct drm_map) ++#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client) ++#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats) ++#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version) ++#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl) ++#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close) ++#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink) ++#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open) ++#define DRM_IOCTL_GET_CAP DRM_IOWR(0x0c, struct drm_get_cap) ++#define DRM_IOCTL_SET_CLIENT_CAP DRM_IOW( 0x0d, struct drm_set_client_cap) ++ ++#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique) ++#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth) ++#define DRM_IOCTL_BLOCK DRM_IOWR(0x12, struct drm_block) ++#define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, struct drm_block) ++#define DRM_IOCTL_CONTROL DRM_IOW( 0x14, struct drm_control) ++#define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, struct drm_map) ++#define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, struct drm_buf_desc) ++#define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, struct drm_buf_desc) ++#define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, struct drm_buf_info) ++#define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, struct drm_buf_map) ++#define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, struct drm_buf_free) ++ ++#define DRM_IOCTL_RM_MAP DRM_IOW( 0x1b, struct drm_map) ++ ++#define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, struct drm_ctx_priv_map) ++#define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, struct drm_ctx_priv_map) ++ ++#define DRM_IOCTL_SET_MASTER DRM_IO(0x1e) ++#define DRM_IOCTL_DROP_MASTER DRM_IO(0x1f) ++ ++#define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, struct drm_ctx) ++#define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, struct drm_ctx) ++#define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, struct drm_ctx) ++#define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, struct drm_ctx) ++#define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, struct drm_ctx) ++#define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, struct drm_ctx) ++#define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, struct drm_ctx_res) ++#define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, struct drm_draw) ++#define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, struct drm_draw) ++#define DRM_IOCTL_DMA DRM_IOWR(0x29, struct drm_dma) ++#define DRM_IOCTL_LOCK DRM_IOW( 0x2a, struct drm_lock) ++#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock) ++#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock) ++ ++#define DRM_IOCTL_PRIME_HANDLE_TO_FD DRM_IOWR(0x2d, struct drm_prime_handle) ++#define DRM_IOCTL_PRIME_FD_TO_HANDLE DRM_IOWR(0x2e, struct drm_prime_handle) ++ ++#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30) ++#define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31) ++#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode) ++#define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, struct drm_agp_info) ++#define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, struct drm_agp_buffer) ++#define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, struct drm_agp_buffer) ++#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding) ++#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding) ++ ++#define DRM_IOCTL_SG_ALLOC DRM_IOWR(0x38, struct drm_scatter_gather) ++#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather) ++ ++#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank) ++ ++#define DRM_IOCTL_CRTC_GET_SEQUENCE DRM_IOWR(0x3b, struct drm_crtc_get_sequence) ++#define DRM_IOCTL_CRTC_QUEUE_SEQUENCE DRM_IOWR(0x3c, struct drm_crtc_queue_sequence) ++ ++#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw) ++ ++#define DRM_IOCTL_MODE_GETRESOURCES DRM_IOWR(0xA0, struct drm_mode_card_res) ++#define DRM_IOCTL_MODE_GETCRTC DRM_IOWR(0xA1, struct drm_mode_crtc) ++#define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA2, struct drm_mode_crtc) ++#define DRM_IOCTL_MODE_CURSOR DRM_IOWR(0xA3, struct drm_mode_cursor) ++#define DRM_IOCTL_MODE_GETGAMMA DRM_IOWR(0xA4, struct drm_mode_crtc_lut) ++#define DRM_IOCTL_MODE_SETGAMMA DRM_IOWR(0xA5, struct drm_mode_crtc_lut) ++#define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xA6, struct drm_mode_get_encoder) ++#define DRM_IOCTL_MODE_GETCONNECTOR DRM_IOWR(0xA7, struct drm_mode_get_connector) ++#define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA8, struct drm_mode_mode_cmd) /* deprecated (never worked) */ ++#define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd) /* deprecated (never worked) */ ++ ++#define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAA, struct drm_mode_get_property) ++#define DRM_IOCTL_MODE_SETPROPERTY DRM_IOWR(0xAB, struct drm_mode_connector_set_property) ++#define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, struct drm_mode_get_blob) ++#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd) ++#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd) ++/** ++ * DRM_IOCTL_MODE_RMFB - Remove a framebuffer. ++ * ++ * This removes a framebuffer previously added via ADDFB/ADDFB2. The IOCTL ++ * argument is a framebuffer object ID. ++ * ++ * Warning: removing a framebuffer currently in-use on an enabled plane will ++ * disable that plane. The CRTC the plane is linked to may also be disabled ++ * (depending on driver capabilities). ++ */ ++#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int) ++#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip) ++#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd) ++ ++#define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb) ++#define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, struct drm_mode_map_dumb) ++#define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, struct drm_mode_destroy_dumb) ++#define DRM_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xB5, struct drm_mode_get_plane_res) ++#define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane) ++#define DRM_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct drm_mode_set_plane) ++#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2) ++#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties) ++#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property) ++#define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2) ++#define DRM_IOCTL_MODE_ATOMIC DRM_IOWR(0xBC, struct drm_mode_atomic) ++#define DRM_IOCTL_MODE_CREATEPROPBLOB DRM_IOWR(0xBD, struct drm_mode_create_blob) ++#define DRM_IOCTL_MODE_DESTROYPROPBLOB DRM_IOWR(0xBE, struct drm_mode_destroy_blob) ++ ++#define DRM_IOCTL_SYNCOBJ_CREATE DRM_IOWR(0xBF, struct drm_syncobj_create) ++#define DRM_IOCTL_SYNCOBJ_DESTROY DRM_IOWR(0xC0, struct drm_syncobj_destroy) ++#define DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD DRM_IOWR(0xC1, struct drm_syncobj_handle) ++#define DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE DRM_IOWR(0xC2, struct drm_syncobj_handle) ++#define DRM_IOCTL_SYNCOBJ_WAIT DRM_IOWR(0xC3, struct drm_syncobj_wait) ++#define DRM_IOCTL_SYNCOBJ_RESET DRM_IOWR(0xC4, struct drm_syncobj_array) ++#define DRM_IOCTL_SYNCOBJ_SIGNAL DRM_IOWR(0xC5, struct drm_syncobj_array) ++ ++#define DRM_IOCTL_MODE_CREATE_LEASE DRM_IOWR(0xC6, struct drm_mode_create_lease) ++#define DRM_IOCTL_MODE_LIST_LESSEES DRM_IOWR(0xC7, struct drm_mode_list_lessees) ++#define DRM_IOCTL_MODE_GET_LEASE DRM_IOWR(0xC8, struct drm_mode_get_lease) ++#define DRM_IOCTL_MODE_REVOKE_LEASE DRM_IOWR(0xC9, struct drm_mode_revoke_lease) ++ ++#define DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT DRM_IOWR(0xCA, struct drm_syncobj_timeline_wait) ++#define DRM_IOCTL_SYNCOBJ_QUERY DRM_IOWR(0xCB, struct drm_syncobj_timeline_array) ++#define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer) ++#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct drm_syncobj_timeline_array) ++ ++#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2) ++ ++/* ++ * Device specific ioctls should only be in their respective headers ++ * The device specific ioctl range is from 0x40 to 0x9f. ++ * Generic IOCTLS restart at 0xA0. ++ * ++ * \sa drmCommandNone(), drmCommandRead(), drmCommandWrite(), and ++ * drmCommandReadWrite(). ++ */ ++#define DRM_COMMAND_BASE 0x40 ++#define DRM_COMMAND_END 0xA0 ++ ++/* ++ * Header for events written back to userspace on the drm fd. The ++ * type defines the type of event, the length specifies the total ++ * length of the event (including the header), and user_data is ++ * typically a 64 bit value passed with the ioctl that triggered the ++ * event. A read on the drm fd will always only return complete ++ * events, that is, if for example the read buffer is 100 bytes, and ++ * there are two 64 byte events pending, only one will be returned. ++ * ++ * Event types 0 - 0x7fffffff are generic drm events, 0x80000000 and ++ * up are chipset specific. ++ */ ++struct drm_event { ++ __u32 type; ++ __u32 length; ++}; ++ ++#define DRM_EVENT_VBLANK 0x01 ++#define DRM_EVENT_FLIP_COMPLETE 0x02 ++#define DRM_EVENT_CRTC_SEQUENCE 0x03 ++ ++struct drm_event_vblank { ++ struct drm_event base; ++ __u64 user_data; ++ __u32 tv_sec; ++ __u32 tv_usec; ++ __u32 sequence; ++ __u32 crtc_id; /* 0 on older kernels that do not support this */ ++}; ++ ++/* Event delivered at sequence. Time stamp marks when the first pixel ++ * of the refresh cycle leaves the display engine for the display ++ */ ++struct drm_event_crtc_sequence { ++ struct drm_event base; ++ __u64 user_data; ++ __s64 time_ns; ++ __u64 sequence; ++}; ++ ++/* typedef area */ ++typedef struct drm_clip_rect drm_clip_rect_t; ++typedef struct drm_drawable_info drm_drawable_info_t; ++typedef struct drm_tex_region drm_tex_region_t; ++typedef struct drm_hw_lock drm_hw_lock_t; ++typedef struct drm_version drm_version_t; ++typedef struct drm_unique drm_unique_t; ++typedef struct drm_list drm_list_t; ++typedef struct drm_block drm_block_t; ++typedef struct drm_control drm_control_t; ++typedef enum drm_map_type drm_map_type_t; ++typedef enum drm_map_flags drm_map_flags_t; ++typedef struct drm_ctx_priv_map drm_ctx_priv_map_t; ++typedef struct drm_map drm_map_t; ++typedef struct drm_client drm_client_t; ++typedef enum drm_stat_type drm_stat_type_t; ++typedef struct drm_stats drm_stats_t; ++typedef enum drm_lock_flags drm_lock_flags_t; ++typedef struct drm_lock drm_lock_t; ++typedef enum drm_dma_flags drm_dma_flags_t; ++typedef struct drm_buf_desc drm_buf_desc_t; ++typedef struct drm_buf_info drm_buf_info_t; ++typedef struct drm_buf_free drm_buf_free_t; ++typedef struct drm_buf_pub drm_buf_pub_t; ++typedef struct drm_buf_map drm_buf_map_t; ++typedef struct drm_dma drm_dma_t; ++typedef union drm_wait_vblank drm_wait_vblank_t; ++typedef struct drm_agp_mode drm_agp_mode_t; ++typedef enum drm_ctx_flags drm_ctx_flags_t; ++typedef struct drm_ctx drm_ctx_t; ++typedef struct drm_ctx_res drm_ctx_res_t; ++typedef struct drm_draw drm_draw_t; ++typedef struct drm_update_draw drm_update_draw_t; ++typedef struct drm_auth drm_auth_t; ++typedef struct drm_irq_busid drm_irq_busid_t; ++typedef enum drm_vblank_seq_type drm_vblank_seq_type_t; ++ ++typedef struct drm_agp_buffer drm_agp_buffer_t; ++typedef struct drm_agp_binding drm_agp_binding_t; ++typedef struct drm_agp_info drm_agp_info_t; ++typedef struct drm_scatter_gather drm_scatter_gather_t; ++typedef struct drm_set_version drm_set_version_t; ++ ++#if defined(__cplusplus) ++} ++#endif ++ ++#endif +diff -up firefox-109.0/third_party/drm/drm/drm_mode.h.libwebrtc-screen-cast-sync firefox-109.0/third_party/drm/drm/drm_mode.h +--- firefox-109.0/third_party/drm/drm/drm_mode.h.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.194614122 +0100 ++++ firefox-109.0/third_party/drm/drm/drm_mode.h 2023-01-12 15:16:09.194614122 +0100 @@ -0,0 +1,1217 @@ +/* + * Copyright (c) 2007 Dave Airlie @@ -3826,11 +3809,9 @@ index 000000000000..e1e351682872 +#endif + +#endif -diff --git a/third_party/drm/drm/xf86drm.h b/third_party/drm/drm/xf86drm.h -new file mode 100644 -index 000000000000..a105b9e13108 ---- /dev/null -+++ b/third_party/drm/drm/xf86drm.h +diff -up firefox-109.0/third_party/drm/drm/xf86drm.h.libwebrtc-screen-cast-sync firefox-109.0/third_party/drm/drm/xf86drm.h +--- firefox-109.0/third_party/drm/drm/xf86drm.h.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.194614122 +0100 ++++ firefox-109.0/third_party/drm/drm/xf86drm.h 2023-01-12 15:16:09.194614122 +0100 @@ -0,0 +1,966 @@ +/** + * \file xf86drm.h @@ -4798,11 +4779,9 @@ index 000000000000..a105b9e13108 +#endif + +#endif -diff --git a/third_party/drm/libdrm/moz.build b/third_party/drm/libdrm/moz.build -new file mode 100644 -index 000000000000..3b37b913e8b2 ---- /dev/null -+++ b/third_party/drm/libdrm/moz.build +diff -up firefox-109.0/third_party/drm/libdrm/moz.build.libwebrtc-screen-cast-sync firefox-109.0/third_party/drm/libdrm/moz.build +--- firefox-109.0/third_party/drm/libdrm/moz.build.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.194614122 +0100 ++++ firefox-109.0/third_party/drm/libdrm/moz.build 2023-01-12 15:16:09.194614122 +0100 @@ -0,0 +1,16 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: @@ -4820,11 +4799,9 @@ index 000000000000..3b37b913e8b2 +LOCAL_INCLUDES += ['/third_party/drm'] + +FINAL_LIBRARY = 'xul' -diff --git a/third_party/drm/libdrm/mozdrm.cpp b/third_party/drm/libdrm/mozdrm.cpp -new file mode 100644 -index 000000000000..b2fb59be64a2 ---- /dev/null -+++ b/third_party/drm/libdrm/mozdrm.cpp +diff -up firefox-109.0/third_party/drm/libdrm/mozdrm.cpp.libwebrtc-screen-cast-sync firefox-109.0/third_party/drm/libdrm/mozdrm.cpp +--- firefox-109.0/third_party/drm/libdrm/mozdrm.cpp.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.194614122 +0100 ++++ firefox-109.0/third_party/drm/libdrm/mozdrm.cpp 2023-01-12 15:16:09.194614122 +0100 @@ -0,0 +1,66 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: @@ -4892,21 +4869,17 @@ index 000000000000..b2fb59be64a2 + } + return drmFreeDevices_fn(devices, count); +} -diff --git a/third_party/gbm/README b/third_party/gbm/README -new file mode 100644 -index 000000000000..4b6e2e8e02b2 ---- /dev/null -+++ b/third_party/gbm/README +diff -up firefox-109.0/third_party/drm/README.libwebrtc-screen-cast-sync firefox-109.0/third_party/drm/README +--- firefox-109.0/third_party/drm/README.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.194614122 +0100 ++++ firefox-109.0/third_party/drm/README 2023-01-12 15:16:09.194614122 +0100 @@ -0,0 +1,4 @@ -+Libgbm is a gbm library wrapper needed to build and run Firefox with -+Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/gbm). ++Libdrm is a drm library wrapper needed to build and run Firefox with ++Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/drm). + -+libgbm directory stores headers of libgbm needed for build only. -diff --git a/third_party/gbm/gbm/gbm.h b/third_party/gbm/gbm/gbm.h -new file mode 100644 -index 000000000000..e28fa04aaed8 ---- /dev/null -+++ b/third_party/gbm/gbm/gbm.h ++libdrm directory stores headers of libdrm needed for build only. +diff -up firefox-109.0/third_party/gbm/gbm/gbm.h.libwebrtc-screen-cast-sync firefox-109.0/third_party/gbm/gbm/gbm.h +--- firefox-109.0/third_party/gbm/gbm/gbm.h.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.195614155 +0100 ++++ firefox-109.0/third_party/gbm/gbm/gbm.h 2023-01-12 15:16:09.195614155 +0100 @@ -0,0 +1,452 @@ +/* + * Copyright © 2011 Intel Corporation @@ -5360,11 +5333,9 @@ index 000000000000..e28fa04aaed8 +#endif + +#endif -diff --git a/third_party/gbm/libgbm/moz.build b/third_party/gbm/libgbm/moz.build -new file mode 100644 -index 000000000000..0953d2f17a54 ---- /dev/null -+++ b/third_party/gbm/libgbm/moz.build +diff -up firefox-109.0/third_party/gbm/libgbm/moz.build.libwebrtc-screen-cast-sync firefox-109.0/third_party/gbm/libgbm/moz.build +--- firefox-109.0/third_party/gbm/libgbm/moz.build.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.195614155 +0100 ++++ firefox-109.0/third_party/gbm/libgbm/moz.build 2023-01-12 15:16:09.195614155 +0100 @@ -0,0 +1,16 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: @@ -5382,11 +5353,9 @@ index 000000000000..0953d2f17a54 +LOCAL_INCLUDES += ['/third_party/gbm'] + +FINAL_LIBRARY = 'xul' -diff --git a/third_party/gbm/libgbm/mozgbm.cpp b/third_party/gbm/libgbm/mozgbm.cpp -new file mode 100644 -index 000000000000..bc024a11c0b7 ---- /dev/null -+++ b/third_party/gbm/libgbm/mozgbm.cpp +diff -up firefox-109.0/third_party/gbm/libgbm/mozgbm.cpp.libwebrtc-screen-cast-sync firefox-109.0/third_party/gbm/libgbm/mozgbm.cpp +--- firefox-109.0/third_party/gbm/libgbm/mozgbm.cpp.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.195614155 +0100 ++++ firefox-109.0/third_party/gbm/libgbm/mozgbm.cpp 2023-01-12 15:16:09.195614155 +0100 @@ -0,0 +1,66 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:expandtab:shiftwidth=4:tabstop=4: @@ -5454,19 +5423,26 @@ index 000000000000..bc024a11c0b7 + } + return gbm_device_destroy_fn(gbm); +} -diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build -index 809899a92847..8869fae89703 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build -+++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build +diff -up firefox-109.0/third_party/gbm/README.libwebrtc-screen-cast-sync firefox-109.0/third_party/gbm/README +--- firefox-109.0/third_party/gbm/README.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.195614155 +0100 ++++ firefox-109.0/third_party/gbm/README 2023-01-12 15:16:09.195614155 +0100 +@@ -0,0 +1,4 @@ ++Libgbm is a gbm library wrapper needed to build and run Firefox with ++Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/gbm). ++ ++libgbm directory stores headers of libgbm needed for build only. +diff -up firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn/moz.build.libwebrtc-screen-cast-sync firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn/moz.build +--- firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn/moz.build.libwebrtc-screen-cast-sync 2023-01-09 20:34:19.000000000 +0100 ++++ firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn/moz.build 2023-01-13 10:53:01.407572566 +0100 @@ -8,7 +8,8 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"] - + -COMPILE_FLAGS["OS_INCLUDES"] = [] +# FIXME: No idea why it doesn't pick libdrm from /third_party/drm +COMPILE_FLAGS["OS_INCLUDES"] = [ "-I/usr/include/libdrm" ] AllowCompilerWarnings() - + DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1" @@ -27,6 +28,8 @@ LOCAL_INCLUDES += [ "/ipc/chromium/src", @@ -5477,14 +5453,15 @@ index 809899a92847..8869fae89703 100644 "/third_party/libwebrtc/", "/third_party/libwebrtc/third_party/abseil-cpp/", "/third_party/pipewire/", -@@ -240,7 +243,15 @@ if CONFIG["CPU_ARCH"] == "arm": +@@ -242,7 +245,16 @@ if CONFIG["CPU_ARCH"] == "arm": DEFINES["_GNU_SOURCE"] = True - - UNIFIED_SOURCES += [ + + SOURCES += [ - "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/moz_base_capturer_pipewire.cc" + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/restore_token_manager.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/scoped_glib.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc", @@ -5492,33 +5469,34 @@ index 809899a92847..8869fae89703 100644 + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/xdg_desktop_portal_utils.cc" ] - + if CONFIG["CPU_ARCH"] == "ppc64": -@@ -295,7 +306,15 @@ if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["OS_TARGET"] == "Linux": +@@ -297,7 +309,15 @@ if CONFIG["CPU_ARCH"] == "aarch64" and C DEFINES["_GNU_SOURCE"] = True - - UNIFIED_SOURCES += [ + + SOURCES += [ - "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/moz_base_capturer_pipewire.cc" + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/scoped_glib.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/restore_token_manager.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/xdg_desktop_portal_utils.cc" ] - + if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux": -@@ -305,7 +324,15 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux": +@@ -307,7 +327,16 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFI DEFINES["_GNU_SOURCE"] = True - - UNIFIED_SOURCES += [ + + SOURCES += [ - "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/moz_base_capturer_pipewire.cc" + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/restore_token_manager.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/scoped_glib.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc", @@ -5526,16 +5504,17 @@ index 809899a92847..8869fae89703 100644 + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/xdg_desktop_portal_utils.cc" ] - + if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "Linux": -@@ -315,7 +342,15 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "Linux": +@@ -317,7 +346,16 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CO DEFINES["_GNU_SOURCE"] = True - - UNIFIED_SOURCES += [ + + SOURCES += [ - "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/moz_base_capturer_pipewire.cc" + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.cc", ++ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/restore_token_manager.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/scoped_glib.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc", @@ -5543,13 +5522,12 @@ index 809899a92847..8869fae89703 100644 + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc", + "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/xdg_desktop_portal_utils.cc" ] - + if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "Linux": -diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc -index 8bdc83b76218..ab7932195c85 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc -@@ -14,7 +14,7 @@ +diff -up firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc.libwebrtc-screen-cast-sync firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc +--- firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc.libwebrtc-screen-cast-sync 2023-01-09 20:34:20.000000000 +0100 ++++ firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc 2023-01-12 15:16:09.196614189 +0100 +@@ -17,7 +17,7 @@ #elif defined(WEBRTC_WIN) #include "modules/desktop_capture/win/full_screen_win_application_handler.h" #endif @@ -5557,8 +5535,8 @@ index 8bdc83b76218..ab7932195c85 100644 +#if defined(WEBRTC_USE_PIPEWIRE) #include "modules/desktop_capture/linux/wayland/shared_screencast_stream.h" #endif - -@@ -40,7 +40,7 @@ DesktopCaptureOptions DesktopCaptureOptions::CreateDefault() { + +@@ -41,7 +41,7 @@ DesktopCaptureOptions DesktopCaptureOpti #if defined(WEBRTC_USE_X11) result.set_x_display(SharedXDisplay::CreateDefault()); #endif @@ -5567,34 +5545,32 @@ index 8bdc83b76218..ab7932195c85 100644 result.set_screencast_stream(SharedScreenCastStream::CreateDefault()); #endif #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) -diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h -index 1605d30f82d1..eb5b8a2a8777 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h -+++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h +diff -up firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h.libwebrtc-screen-cast-sync firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h +--- firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h.libwebrtc-screen-cast-sync 2023-01-09 20:34:21.000000000 +0100 ++++ firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h 2023-01-13 10:00:35.449402964 +0100 @@ -17,7 +17,7 @@ #include "modules/desktop_capture/linux/x11/shared_x_display.h" #endif - + -#if defined(WEBRTC_USE_PIPEWIRE) && !defined(WEBRTC_MOZILLA_BUILD) +#if defined(WEBRTC_USE_PIPEWIRE) #include "modules/desktop_capture/linux/wayland/shared_screencast_stream.h" #endif - + @@ -181,7 +181,6 @@ class RTC_EXPORT DesktopCaptureOptions { bool allow_pipewire() const { return allow_pipewire_; } void set_allow_pipewire(bool allow) { allow_pipewire_ = allow; } - + -#if !defined(WEBRTC_MOZILLA_BUILD) const rtc::scoped_refptr& screencast_stream() const { return screencast_stream_; } -@@ -189,14 +188,13 @@ class RTC_EXPORT DesktopCaptureOptions { - rtc::scoped_refptr stream) { - screencast_stream_ = stream; - } --#endif +@@ -196,13 +195,12 @@ class RTC_EXPORT DesktopCaptureOptions { + void set_height(uint32_t height) { height_ = height; } + uint32_t get_height() const { return height_; } #endif - +-#endif + private: #if defined(WEBRTC_USE_X11) rtc::scoped_refptr x_display_; @@ -5604,26 +5580,24 @@ index 1605d30f82d1..eb5b8a2a8777 100644 // An instance of shared PipeWire ScreenCast stream we share between // BaseCapturerPipeWire and MouseCursorMonitorPipeWire as cursor information // is sent together with screen content. -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc -index 75659a9eb9e2..32578411059b 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc -@@ -105,7 +105,7 @@ bool BaseCapturerPipeWire::GetSourceList(SourceList* sources) { +diff -up firefox-109.0/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc.libwebrtc-screen-cast-sync firefox-109.0/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc +--- firefox-109.0/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc.libwebrtc-screen-cast-sync 2023-01-09 20:34:21.000000000 +0100 ++++ firefox-109.0/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc 2023-01-12 15:16:09.196614189 +0100 +@@ -136,7 +136,7 @@ bool BaseCapturerPipeWire::GetSourceList // is often treated as a null/placeholder id, so we shouldn't use that. // TODO(https://crbug.com/1297671): Reconsider type of ID when plumbing // token that will enable stream re-use. -- sources->push_back({1}); +- sources->push_back({source_id_}); + sources->push_back({PIPEWIRE_ID, 0, PIPEWIRE_NAME}); return true; } - -diff --git a/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc b/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc -index d9f27951302d..18840cc6d7ef 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc + +diff -up firefox-109.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc.libwebrtc-screen-cast-sync firefox-109.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc +--- firefox-109.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc.libwebrtc-screen-cast-sync 2023-01-09 20:34:20.000000000 +0100 ++++ firefox-109.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc 2023-01-12 15:16:09.196614189 +0100 @@ -14,11 +14,7 @@ #include "modules/desktop_capture/desktop_capturer.h" - + #if defined(WEBRTC_USE_PIPEWIRE) -#if defined(WEBRTC_MOZILLA_BUILD) -#include "modules/desktop_capture/linux/wayland/moz_base_capturer_pipewire.h" @@ -5631,9 +5605,9 @@ index d9f27951302d..18840cc6d7ef 100644 #include "modules/desktop_capture/linux/wayland/base_capturer_pipewire.h" -#endif #endif // defined(WEBRTC_USE_PIPEWIRE) - + #if defined(WEBRTC_USE_X11) -@@ -32,11 +28,7 @@ std::unique_ptr DesktopCapturer::CreateRawScreenCapturer( +@@ -32,11 +28,7 @@ std::unique_ptr Desktop const DesktopCaptureOptions& options) { #if defined(WEBRTC_USE_PIPEWIRE) if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { @@ -5644,14 +5618,13 @@ index d9f27951302d..18840cc6d7ef 100644 -#endif } #endif // defined(WEBRTC_USE_PIPEWIRE) - -diff --git a/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc b/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc -index b2b1e376ada5..638c42ae3963 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc + +diff -up firefox-109.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc.libwebrtc-screen-cast-sync firefox-109.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc +--- firefox-109.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc.libwebrtc-screen-cast-sync 2023-01-09 20:34:21.000000000 +0100 ++++ firefox-109.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc 2023-01-12 15:16:09.196614189 +0100 @@ -14,11 +14,7 @@ #include "modules/desktop_capture/desktop_capturer.h" - + #if defined(WEBRTC_USE_PIPEWIRE) -#if defined(WEBRTC_MOZILLA_BUILD) -#include "modules/desktop_capture/linux/wayland/moz_base_capturer_pipewire.h" @@ -5659,9 +5632,9 @@ index b2b1e376ada5..638c42ae3963 100644 #include "modules/desktop_capture/linux/wayland/base_capturer_pipewire.h" -#endif #endif // defined(WEBRTC_USE_PIPEWIRE) - + #if defined(WEBRTC_USE_X11) -@@ -32,11 +28,7 @@ std::unique_ptr DesktopCapturer::CreateRawWindowCapturer( +@@ -32,11 +28,7 @@ std::unique_ptr Desktop const DesktopCaptureOptions& options) { #if defined(WEBRTC_USE_PIPEWIRE) if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { @@ -5672,15 +5645,14 @@ index b2b1e376ada5..638c42ae3963 100644 -#endif } #endif // defined(WEBRTC_USE_PIPEWIRE) - -diff --git a/third_party/moz.build b/third_party/moz.build -index 19ee0224b041..fab8f23c624f 100644 ---- a/third_party/moz.build -+++ b/third_party/moz.build + +diff -up firefox-109.0/third_party/moz.build.libwebrtc-screen-cast-sync firefox-109.0/third_party/moz.build +--- firefox-109.0/third_party/moz.build.libwebrtc-screen-cast-sync 2023-01-09 20:34:21.000000000 +0100 ++++ firefox-109.0/third_party/moz.build 2023-01-12 15:16:09.197614223 +0100 @@ -61,6 +61,12 @@ with Files("libwebrtc/**"): with Files("pipewire/**"): BUG_COMPONENT = ("Core", "WebRTC") - + +with Files("drm/**"): + BUG_COMPONENT = ("Core", "WebRTC") + @@ -5689,12 +5661,11 @@ index 19ee0224b041..fab8f23c624f 100644 + with Files('rlbox_wasm2c_sandbox/**'): BUG_COMPONENT = ('Firefox Build System', 'General') - -diff --git a/third_party/pipewire/libpipewire/mozpipewire.cpp b/third_party/pipewire/libpipewire/mozpipewire.cpp -index 1ecfc3196af1..fbeeb8e5a760 100644 ---- a/third_party/pipewire/libpipewire/mozpipewire.cpp -+++ b/third_party/pipewire/libpipewire/mozpipewire.cpp -@@ -69,11 +69,13 @@ static int (*pw_stream_connect_fn)(struct pw_stream *stream, + +diff -up firefox-109.0/third_party/pipewire/libpipewire/mozpipewire.cpp.libwebrtc-screen-cast-sync firefox-109.0/third_party/pipewire/libpipewire/mozpipewire.cpp +--- firefox-109.0/third_party/pipewire/libpipewire/mozpipewire.cpp.libwebrtc-screen-cast-sync 2023-01-09 20:34:21.000000000 +0100 ++++ firefox-109.0/third_party/pipewire/libpipewire/mozpipewire.cpp 2023-01-12 15:16:09.197614223 +0100 +@@ -69,11 +69,13 @@ static int (*pw_stream_connect_fn)(struc enum pw_stream_flags flags, const struct spa_pod **params, uint32_t n_params); @@ -5708,7 +5679,7 @@ index 1ecfc3196af1..fbeeb8e5a760 100644 static int (*pw_stream_queue_buffer_fn)(struct pw_stream *stream, struct pw_buffer *buffer); static int (*pw_stream_update_params_fn)(struct pw_stream *stream, -@@ -87,7 +89,10 @@ static int (*pw_thread_loop_start_fn)(struct pw_thread_loop *loop); +@@ -87,7 +89,10 @@ static int (*pw_thread_loop_start_fn)(st static void (*pw_thread_loop_stop_fn)(struct pw_thread_loop *loop); static void (*pw_thread_loop_lock_fn)(struct pw_thread_loop *loop); static void (*pw_thread_loop_unlock_fn)(struct pw_thread_loop *loop); @@ -5716,7 +5687,7 @@ index 1ecfc3196af1..fbeeb8e5a760 100644 +static void (*pw_thread_loop_signal_fn)(struct pw_thread_loop *loop, bool wait_for_accept); static struct pw_properties* (*pw_properties_new_string_fn)(const char *str); +static const char* (*pw_get_library_version_fn)(); - + bool IsPwLibraryLoaded() { static bool isLoaded = @@ -99,6 +104,7 @@ bool IsPwLibraryLoaded() { @@ -5736,7 +5707,7 @@ index 1ecfc3196af1..fbeeb8e5a760 100644 + IS_FUNC_LOADED(pw_thread_loop_wait_fn) && + IS_FUNC_LOADED(pw_properties_new_string_fn) && + IS_FUNC_LOADED(pw_get_library_version_fn)); - + return isLoaded; } @@ -136,6 +145,7 @@ bool LoadPWLibrary() { @@ -5756,12 +5727,12 @@ index 1ecfc3196af1..fbeeb8e5a760 100644 GET_FUNC(pw_properties_new_string, pwLib); + GET_FUNC(pw_get_library_version, pwLib); } - + return IsPwLibraryLoaded(); -@@ -242,6 +255,15 @@ pw_stream_connect(struct pw_stream *stream, +@@ -242,6 +255,15 @@ pw_stream_connect(struct pw_stream *stre params, n_params); } - + +int +pw_stream_disconnect(struct pw_stream *stream) +{ @@ -5774,10 +5745,10 @@ index 1ecfc3196af1..fbeeb8e5a760 100644 struct pw_buffer * pw_stream_dequeue_buffer(struct pw_stream *stream) { -@@ -356,6 +378,23 @@ pw_thread_loop_unlock(struct pw_thread_loop *loop) +@@ -356,6 +378,23 @@ pw_thread_loop_unlock(struct pw_thread_l return pw_thread_loop_unlock_fn(loop); } - + +void +pw_thread_loop_signal(struct pw_thread_loop *loop, bool wait_for_accept) +{ @@ -5795,13 +5766,13 @@ index 1ecfc3196af1..fbeeb8e5a760 100644 + } + return pw_thread_loop_wait_fn(loop); +} - + struct pw_properties * pw_properties_new_string(const char *str) -@@ -366,3 +405,12 @@ pw_properties_new_string(const char *str) +@@ -366,3 +405,12 @@ pw_properties_new_string(const char *str return pw_properties_new_string_fn(str); } - + +const char* +pw_get_library_version() +{ diff --git a/mozilla-1663844.patch b/mozilla-1663844.patch index 4cc43ea..afa5168 100644 --- a/mozilla-1663844.patch +++ b/mozilla-1663844.patch @@ -1,7 +1,7 @@ -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 { +diff -up firefox-109.0/dom/media/gmp/GMPSharedMemManager.h.1663844 firefox-109.0/dom/media/gmp/GMPSharedMemManager.h +--- firefox-109.0/dom/media/gmp/GMPSharedMemManager.h.1663844 2023-01-09 20:34:10.000000000 +0100 ++++ firefox-109.0/dom/media/gmp/GMPSharedMemManager.h 2023-01-12 09:28:56.035741438 +0100 +@@ -26,7 +26,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). @@ -10,9 +10,9 @@ diff -up firefox-101.0.1/dom/media/gmp/GMPSharedMemManager.h.1663844 firefox-101 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 +diff -up firefox-109.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp.1663844 firefox-109.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp +--- firefox-109.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp.1663844 2023-01-09 20:34:10.000000000 +0100 ++++ firefox-109.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp 2023-01-12 09:28:56.036741473 +0100 @@ -84,6 +84,9 @@ media::DecodeSupportSet GMPDecoderModule media::DecodeSupportSet GMPDecoderModule::SupportsMimeType( @@ -23,12 +23,12 @@ diff -up firefox-101.0.1/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp.1 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 self = this; - if (v) { +diff -up firefox-109.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp.1663844 firefox-109.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp +--- firefox-109.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp.1663844 2023-01-12 09:28:56.036741473 +0100 ++++ firefox-109.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp 2023-01-12 14:18:12.354866405 +0100 +@@ -81,6 +81,8 @@ void GMPVideoDecoder::Decoded(GMPVideoi4 + }); + mDecodedData.AppendElement(std::move(v)); + mDecodePromise.ResolveIfExists(std::move(mDecodedData), __func__); + mDecodedData = DecodedData(); From 42899b87280e9663677d6acf77761e2d353bc241 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 13 Jan 2023 11:28:12 +0100 Subject: [PATCH 163/545] updates nss version --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 712af81..ff326a9 100644 --- a/firefox.spec +++ b/firefox.spec @@ -125,7 +125,7 @@ ExcludeArch: i686 %if %{?system_nss} %global nspr_version 4.32 %global nspr_build_version %{nspr_version} -%global nss_version 3.85 +%global nss_version 3.86 %global nss_build_version %{nss_version} %endif From 4ea325ddcaa4af71a13d22dea17e77b0debb0122 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 13 Jan 2023 11:42:48 +0100 Subject: [PATCH 164/545] source upload --- .gitignore | 2 ++ sources | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 3ee35a9..b9d0233 100644 --- a/.gitignore +++ b/.gitignore @@ -553,3 +553,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-108.0.1-20221218.tar.xz /firefox-108.0.2.source.tar.xz /firefox-langpacks-108.0.2-20230112.tar.xz +/firefox-109.0.source.tar.xz +/firefox-langpacks-109.0-20230111.tar.xz diff --git a/sources b/sources index 65c6114..274569a 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 -SHA512 (firefox-108.0.2.source.tar.xz) = f856ef034fa4a526e19968aed092c9ee99e124d2d271ec1c1bbd091d9a03e23293d69c7a9ae17c43258cde7e73c294534b471e36441e576377854f607c9bfa3a -SHA512 (firefox-langpacks-108.0.2-20230112.tar.xz) = dfe1273fe3c29e737623915c10a900f370306a9af00c92b0479f2c779056823b99dff0ff94a779f8a8fa14c4d85e27813da297bfc5439802c8f1b2e5e31431b5 +SHA512 (firefox-109.0.source.tar.xz) = c5c0ce594acfa8df3ea5f8790f617c03e5eb5bc31120bbddd7bc0b08d0f052ac92be94e555dfcde728d6a033173abc2a78ade267978296eb81058ca4b0a2fcef +SHA512 (firefox-langpacks-109.0-20230111.tar.xz) = 8a07111d28ae40a4761ffec839b51cb391291befd45adc18bbd6e20ded1e89aedbe69ae54f47aaf354cdd70f92d22833cf254ec1405930c9cd6d785e9d5c0daf From 92926706f3e228e9c26d7adab5eb98e410a87631 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 13 Jan 2023 14:10:45 +0100 Subject: [PATCH 165/545] disabled webrtc patch on aarch64 --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index ff326a9..89e7296 100644 --- a/firefox.spec +++ b/firefox.spec @@ -534,7 +534,7 @@ This package contains results of tests executed during build. %patch990 -p1 -b .work-around-GCC-ICE-on-arm -%ifnarch ppc64le %{arm} +%ifnarch ppc64le %{arm} aarch64 %patch1000 -p1 -b .libwebrtc-screen-cast-sync %endif From 2871a2e5671f6d3643874827a9c383aff145919b Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 16 Jan 2023 10:45:56 +0100 Subject: [PATCH 166/545] Updated to build 2 --- firefox.spec | 2 +- sources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index 89e7296..cb4398e 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1076,7 +1076,7 @@ fi #--------------------------------------------------------------------- %changelog -* Wed Jan 11 2023 Martin Stransky - 109.0-1 +* Mon Jan 16 2023 Martin Stransky - 109.0-1 - Update to 109.0 * Thu Jan 12 2023 Jan Horak - 108.0.2-1 diff --git a/sources b/sources index 274569a..fcf64d5 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 -SHA512 (firefox-109.0.source.tar.xz) = c5c0ce594acfa8df3ea5f8790f617c03e5eb5bc31120bbddd7bc0b08d0f052ac92be94e555dfcde728d6a033173abc2a78ade267978296eb81058ca4b0a2fcef SHA512 (firefox-langpacks-109.0-20230111.tar.xz) = 8a07111d28ae40a4761ffec839b51cb391291befd45adc18bbd6e20ded1e89aedbe69ae54f47aaf354cdd70f92d22833cf254ec1405930c9cd6d785e9d5c0daf +SHA512 (firefox-109.0.source.tar.xz) = 9e2b6e20353e414da3d2eb9dcd3d77757664a98a4438a8e84f19a1c7c203e40136b08bf96a458fac05ddc627347217d32f1f6337980c5ca918874993657a58e7 From 1913d82157ee9a05f6766651455f000149af385b Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 16 Jan 2023 11:43:35 +0100 Subject: [PATCH 167/545] Added fix for mozbz#1804973 Wayland/EGL window crash --- D164651.diff | 18 ++++++++++++++++++ firefox.spec | 2 ++ 2 files changed, 20 insertions(+) create mode 100644 D164651.diff diff --git a/D164651.diff b/D164651.diff new file mode 100644 index 0000000..aaae3e9 --- /dev/null +++ b/D164651.diff @@ -0,0 +1,18 @@ +diff --git a/widget/gtk/MozContainerWayland.cpp b/widget/gtk/MozContainerWayland.cpp +--- a/widget/gtk/MozContainerWayland.cpp ++++ b/widget/gtk/MozContainerWayland.cpp +@@ -702,10 +702,13 @@ + + bool moz_container_wayland_egl_window_needs_size_update(MozContainer* container, + nsIntSize aSize, + int aScale) { + MozContainerWayland* wl_container = &container->wl_container; ++ if (!wl_container->eglwindow) { ++ return false; ++ } + if (wl_container->buffer_scale != aScale) { + return true; + } + nsIntSize recentSize; + wl_egl_window_get_attached_size(wl_container->eglwindow, &recentSize.width, + diff --git a/firefox.spec b/firefox.spec index cb4398e..416d326 100644 --- a/firefox.spec +++ b/firefox.spec @@ -249,6 +249,7 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch +Patch416: D164651.diff # PGO/LTO patches Patch600: pgo.patch @@ -523,6 +524,7 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 +%patch416 -p1 -b .D164651 # PGO patches %if %{build_with_pgo} From 54310019ecbbc49f9b176d6cb55210b11b59e55b Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 16 Jan 2023 13:31:38 +0100 Subject: [PATCH 168/545] Second arch build fix --- mozilla-1775202.patch | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/mozilla-1775202.patch b/mozilla-1775202.patch index b1748de..e237f4c 100644 --- a/mozilla-1775202.patch +++ b/mozilla-1775202.patch @@ -1,17 +1,14 @@ -diff --git a/third_party/libwebrtc/moz.build b/third_party/libwebrtc/moz.build -index 8579f8bb3622..d9ca79d4fcb8 100644 ---- a/third_party/libwebrtc/moz.build -+++ b/third_party/libwebrtc/moz.build -@@ -520,7 +520,10 @@ if CONFIG["CPU_ARCH"] == "ppc64" and CONFIG["OS_TARGET"] == "Linux": +diff -up firefox-109.0/third_party/libwebrtc/moz.build.ppc-mobzuild firefox-109.0/third_party/libwebrtc/moz.build +--- firefox-109.0/third_party/libwebrtc/moz.build.ppc-mobzuild 2023-01-12 21:02:15.000000000 +0100 ++++ firefox-109.0/third_party/libwebrtc/moz.build 2023-01-16 13:30:28.404450100 +0100 +@@ -621,7 +621,9 @@ if CONFIG["CPU_ARCH"] == "ppc64" and CON "/third_party/libwebrtc/api/audio_codecs/isac/audio_decoder_isac_float_gn", "/third_party/libwebrtc/api/audio_codecs/isac/audio_encoder_isac_float_gn", "/third_party/libwebrtc/modules/audio_coding/isac_c_gn", - "/third_party/libwebrtc/modules/audio_coding/isac_gn" + "/third_party/libwebrtc/modules/audio_coding/isac_gn", -+ "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn", + "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn", + "/third_party/libwebrtc/modules/desktop_capture/primitives_gn" ] if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux": - From b2b36e851ec0724d1e6790ce5eb357e53402033e Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 17 Jan 2023 14:28:43 +0100 Subject: [PATCH 169/545] Added VA-API fixes mozbz#1809162, mozbz#1801576 --- D166324.diff | 75 +++++++ firefox.spec | 9 +- mozilla-1809162.patch | 504 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 587 insertions(+), 1 deletion(-) create mode 100644 D166324.diff create mode 100644 mozilla-1809162.patch diff --git a/D166324.diff b/D166324.diff new file mode 100644 index 0000000..00d234d --- /dev/null +++ b/D166324.diff @@ -0,0 +1,75 @@ +diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h +--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h ++++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h +@@ -175,11 +175,10 @@ + + PtsCorrectionContext mPtsContext; + + DurationMap mDurationMap; + const bool mLowLatency; +- AVDiscard mFrameDrop = AVDISCARD_DEFAULT; + const Maybe mTrackingId; + PerformanceRecorderMulti mPerformanceRecorder; + + // True if we're allocating shmem for ffmpeg decode buffer. + Maybe> mIsUsingShmemBufferForDecode; +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 +@@ -850,17 +850,10 @@ + packet.dts = aSample->mTimecode.ToMicroseconds(); + packet.pts = aSample->mTime.ToMicroseconds(); + packet.flags = aSample->mKeyframe ? AV_PKT_FLAG_KEY : 0; + packet.pos = aSample->mOffset; + +- mCodecContext->skip_frame = mFrameDrop; +-#if MOZ_LOGGING +- if (mFrameDrop == AVDISCARD_NONREF) { +- FFMPEG_LOG("Frame skip AVDISCARD_NONREF"); +- } +-#endif +- + mTrackingId.apply([&](const auto& aId) { + MediaInfoFlag flag = MediaInfoFlag::None; + flag |= (aSample->mKeyframe ? MediaInfoFlag::KeyFrame + : MediaInfoFlag::NonKeyFrame); + flag |= (IsHardwareAccelerated() ? MediaInfoFlag::HardwareDecoding +@@ -943,22 +936,10 @@ + return MediaResult( + NS_ERROR_DOM_MEDIA_DECODE_ERR, + RESULT_DETAIL("avcodec_receive_frame error: %s", errStr)); + } + +- if (mFrameDrop == AVDISCARD_NONREF) { +- FFMPEG_LOG("Requested pts %" PRId64 " decoded frame pts %" PRId64, +- packet.pts, GetFramePts(mFrame) + mFrame->pkt_duration); +- // Switch back to default frame skip policy if we hit correct +- // decode times. 5 ms treshold is taken from mpv project which +- // use similar approach after seek (feed_packet() at f_decoder_wrapper.c). +- if (packet.pts - 5000 <= GetFramePts(mFrame) + mFrame->pkt_duration) { +- FFMPEG_LOG("Set frame drop to AVDISCARD_DEFAULT."); +- mFrameDrop = AVDISCARD_DEFAULT; +- } +- } +- + UpdateDecodeTimes(decodeStart); + decodeStart = TimeStamp::Now(); + + MediaResult rv; + # ifdef MOZ_WAYLAND_USE_VAAPI +@@ -1366,14 +1347,10 @@ + FFMPEG_LOG("ProcessFlush()"); + MOZ_ASSERT(mTaskQueue->IsOnCurrentThread()); + mPtsContext.Reset(); + mDurationMap.Clear(); + mPerformanceRecorder.Record(std::numeric_limits::max()); +- // Discard non-ref frames on HW accelerated backend to avoid decode artifacts. +- if (IsHardwareAccelerated()) { +- mFrameDrop = AVDISCARD_NONREF; +- } + return FFmpegDataDecoder::ProcessFlush(); + } + + AVCodecID FFmpegVideoDecoder::GetCodecId( + const nsACString& aMimeType) { + diff --git a/firefox.spec b/firefox.spec index 416d326..7219707 100644 --- a/firefox.spec +++ b/firefox.spec @@ -173,7 +173,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 109.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -250,6 +250,8 @@ Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch Patch416: D164651.diff +Patch417: D166324.diff +Patch418: mozilla-1809162.patch # PGO/LTO patches Patch600: pgo.patch @@ -525,6 +527,8 @@ This package contains results of tests executed during build. %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 %patch416 -p1 -b .D164651 +%patch417 -p1 -b .D166324 +%patch418 -p1 -b .1809162 # PGO patches %if %{build_with_pgo} @@ -1078,6 +1082,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Jan 17 2023 Martin Stransky - 109.0-2 +- Added VA-API fixes mozbz#1809162, mozbz#1801576 + * Mon Jan 16 2023 Martin Stransky - 109.0-1 - Update to 109.0 diff --git a/mozilla-1809162.patch b/mozilla-1809162.patch new file mode 100644 index 0000000..a6d2571 --- /dev/null +++ b/mozilla-1809162.patch @@ -0,0 +1,504 @@ +diff -up firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.1809162 firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp +--- firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.1809162 2023-01-12 21:02:00.000000000 +0100 ++++ firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp 2023-01-17 14:23:30.004040571 +0100 +@@ -9,6 +9,7 @@ + #include "FFmpegLog.h" + #include "mozilla/widget/DMABufLibWrapper.h" + #include "libavutil/pixfmt.h" ++#include "mozilla/gfx/gfxVars.h" + + #ifdef MOZ_LOGGING + # undef DMABUF_LOG +@@ -87,7 +88,10 @@ VideoFrameSurface::~VideoFram + } + + VideoFramePool::VideoFramePool() +- : mSurfaceLock("VideoFramePoolSurfaceLock") {} ++ : mSurfaceLock("VideoFramePoolSurfaceLock"), ++ mSurfaceCopy(!gfx::gfxVars::HwDecodedVideoZeroCopy()) { ++ DMABUF_LOG("VideoFramePool::VideoFramePool() surface copy %d", mSurfaceCopy); ++} + + VideoFramePool::~VideoFramePool() { + MutexAutoLock lock(mSurfaceLock); +@@ -129,32 +133,31 @@ VideoFramePool::GetVideoFrame + MutexAutoLock lock(mSurfaceLock); + RefPtr> videoSurface = + GetFreeVideoFrameSurface(); ++ RefPtr surface = ++ videoSurface ? videoSurface->GetDMABufSurface() : new DMABufSurfaceYUV(); + if (!videoSurface) { +- RefPtr surface = +- DMABufSurfaceYUV::CreateYUVSurface(aVaDesc, aWidth, aHeight); +- if (!surface) { +- return nullptr; +- } + DMABUF_LOG("Created new VA-API DMABufSurface UID %d", surface->GetUID()); +- RefPtr> surf = +- new VideoFrameSurface(surface); +- if (!mTextureCreationWorks) { +- mTextureCreationWorks = Some(surface->VerifyTextureCreation()); +- } +- if (!*mTextureCreationWorks) { +- DMABUF_LOG(" failed to create texture over DMABuf memory!"); +- return nullptr; +- } +- videoSurface = surf; +- mDMABufSurfaces.AppendElement(std::move(surf)); ++ videoSurface = new VideoFrameSurface(surface); ++ mDMABufSurfaces.AppendElement(videoSurface); + } else { +- RefPtr surface = videoSurface->GetDMABufSurface(); + DMABUF_LOG("Reusing VA-API DMABufSurface UID %d", surface->GetUID()); +- if (!surface->UpdateYUVData(aVaDesc, aWidth, aHeight)) { ++ } ++ ++ if (!surface->UpdateYUVData(aVaDesc, aWidth, aHeight, mSurfaceCopy)) { ++ return nullptr; ++ } ++ ++ if (MOZ_UNLIKELY(!mTextureCreationWorks)) { ++ mTextureCreationWorks = Some(surface->VerifyTextureCreation()); ++ if (!*mTextureCreationWorks) { ++ DMABUF_LOG(" failed to create texture over DMABuf memory!"); + return nullptr; + } + } +- videoSurface->LockVAAPIData(aAVCodecContext, aAVFrame, aLib); ++ ++ if (!mSurfaceCopy) { ++ videoSurface->LockVAAPIData(aAVCodecContext, aAVFrame, aLib); ++ } + videoSurface->MarkAsUsed(); + return videoSurface; + } +diff -up firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.1809162 firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h +--- firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.1809162 2023-01-12 21:02:00.000000000 +0100 ++++ firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h 2023-01-17 14:23:30.004040571 +0100 +@@ -129,6 +129,8 @@ class VideoFramePool { + // We may fail to create texture over DMABuf memory due to driver bugs so + // check that before we export first DMABuf video frame. + Maybe mTextureCreationWorks; ++ // Copy decoded dmabuf surfaces so we can return them to ffmpeg immediately. ++ const bool mSurfaceCopy; + }; + + } // namespace mozilla +diff -up firefox-109.0/gfx/thebes/gfxPlatformGtk.cpp.1809162 firefox-109.0/gfx/thebes/gfxPlatformGtk.cpp +--- firefox-109.0/gfx/thebes/gfxPlatformGtk.cpp.1809162 2023-01-12 21:02:01.000000000 +0100 ++++ firefox-109.0/gfx/thebes/gfxPlatformGtk.cpp 2023-01-17 14:23:30.004040571 +0100 +@@ -253,6 +253,34 @@ bool gfxPlatformGtk::InitVAAPIConfig(boo + feature.ForceDisable(FeatureStatus::Unavailable, "Requires EGL", + "FEATURE_FAILURE_REQUIRES_EGL"_ns); + } ++ ++ if (feature.IsEnabled()) { ++ FeatureState& featureZeroCopyDecode = ++ gfxConfig::GetFeature(Feature::HW_DECODED_VIDEO_ZERO_COPY); ++ featureZeroCopyDecode.EnableByDefault(); ++ ++ if (!StaticPrefs::media_ffmpeg_vaapi_zero_copy_enabled_AtStartup()) { ++ featureZeroCopyDecode.UserDisable("Disabled by pref", ++ "FEATURE_FAILURE_USER_DISABLED"_ns); ++ } else { ++ if (NS_FAILED(gfxInfo->GetFeatureStatus( ++ nsIGfxInfo::FEATURE_HW_DECODED_VIDEO_ZERO_COPY, failureId, ++ &status))) { ++ featureZeroCopyDecode.DisableByDefault( ++ FeatureStatus::BlockedNoGfxInfo, "gfxInfo is broken", ++ "FEATURE_FAILURE_WR_NO_GFX_INFO"_ns); ++ } else if (status != nsIGfxInfo::FEATURE_ALLOW_ALWAYS) { ++ featureZeroCopyDecode.DisableByDefault( ++ FeatureStatus::Blocked, "Blocklisted by gfxInfo", failureId); ++ } ++ if (StaticPrefs::media_ffmpeg_vaapi_zero_copy_force_enabled_AtStartup()) { ++ featureZeroCopyDecode.UserForceEnable("Force enabled by pref"); ++ } ++ if (featureZeroCopyDecode.IsEnabled()) { ++ gfxVars::SetHwDecodedVideoZeroCopy(true); ++ } ++ } ++ } + #else + feature.DisableByDefault(FeatureStatus::Unavailable, + "Wayland support missing", +diff -up firefox-109.0/modules/libpref/init/StaticPrefList.yaml.1809162 firefox-109.0/modules/libpref/init/StaticPrefList.yaml +--- firefox-109.0/modules/libpref/init/StaticPrefList.yaml.1809162 2023-01-12 21:02:07.000000000 +0100 ++++ firefox-109.0/modules/libpref/init/StaticPrefList.yaml 2023-01-17 14:23:30.005040605 +0100 +@@ -9836,6 +9836,14 @@ + type: RelaxedAtomicBool + value: false + mirror: always ++- name: media.ffmpeg.vaapi.zero-copy.enabled ++ type: bool ++ value: true ++ mirror: once ++- name: media.ffmpeg.vaapi.zero-copy.force-enabled ++ type: bool ++ value: false ++ mirror: once + #endif # MOZ_WIDGET_GTK + #endif # MOZ_FFMPEG + +diff -up firefox-109.0/widget/gtk/DMABufLibWrapper.cpp.1809162 firefox-109.0/widget/gtk/DMABufLibWrapper.cpp +--- firefox-109.0/widget/gtk/DMABufLibWrapper.cpp.1809162 2023-01-12 21:02:18.000000000 +0100 ++++ firefox-109.0/widget/gtk/DMABufLibWrapper.cpp 2023-01-17 14:23:30.005040605 +0100 +@@ -12,12 +12,17 @@ + #include "mozilla/StaticPrefs_media.h" + #include "mozilla/gfx/gfxVars.h" + #include "WidgetUtilsGtk.h" ++#include "gfxConfig.h" ++#include "nsIGfxInfo.h" ++#include "mozilla/Components.h" + + #include + #include + #include + #include + ++using namespace mozilla::gfx; ++ + namespace mozilla { + namespace widget { + +@@ -224,24 +229,13 @@ nsDMABufDevice::~nsDMABufDevice() { + int nsDMABufDevice::GetDRMFd() { return mDRMFd; } + + bool nsDMABufDevice::Configure(nsACString& aFailureId) { +- LOGDMABUF(("nsDMABufDevice::Configure()")); ++ if (mInitialized) { ++ return true; ++ } + +- MOZ_ASSERT(!mInitialized); ++ LOGDMABUF(("nsDMABufDevice::Configure()")); + mInitialized = true; + +- bool isDMABufUsed = ( +-#ifdef NIGHTLY_BUILD +- StaticPrefs::widget_dmabuf_textures_enabled() || +-#endif +- StaticPrefs::widget_dmabuf_webgl_enabled()); +- +- if (!isDMABufUsed) { +- // Disabled by user, just quit. +- LOGDMABUF(("IsDMABufEnabled(): Disabled by preferences.")); +- aFailureId = "FEATURE_FAILURE_NO_PREFS_ENABLED"; +- return false; +- } +- + if (!nsGbmLib::IsAvailable()) { + LOGDMABUF(("nsGbmLib is not available!")); + aFailureId = "FEATURE_FAILURE_NO_LIBGBM"; +@@ -327,5 +321,13 @@ nsDMABufDevice* GetDMABufDevice() { + return &dmaBufDevice; + } + ++nsDMABufDevice* GetAndConfigureDMABufDevice() { ++ nsCString failureId; ++ if (GetDMABufDevice()->Configure(failureId)) { ++ return GetDMABufDevice(); ++ } ++ return nullptr; ++} ++ + } // namespace widget + } // namespace mozilla +diff -up firefox-109.0/widget/gtk/DMABufLibWrapper.h.1809162 firefox-109.0/widget/gtk/DMABufLibWrapper.h +--- firefox-109.0/widget/gtk/DMABufLibWrapper.h.1809162 2023-01-12 21:02:18.000000000 +0100 ++++ firefox-109.0/widget/gtk/DMABufLibWrapper.h 2023-01-17 14:23:30.005040605 +0100 +@@ -215,6 +215,7 @@ class nsDMABufDevice { + }; + + nsDMABufDevice* GetDMABufDevice(); ++nsDMABufDevice* GetAndConfigureDMABufDevice(); + + } // namespace widget + } // namespace mozilla +diff -up firefox-109.0/widget/gtk/DMABufSurface.cpp.1809162 firefox-109.0/widget/gtk/DMABufSurface.cpp +--- firefox-109.0/widget/gtk/DMABufSurface.cpp.1809162 2023-01-12 21:02:18.000000000 +0100 ++++ firefox-109.0/widget/gtk/DMABufSurface.cpp 2023-01-17 14:23:30.006040639 +0100 +@@ -67,13 +67,14 @@ RefPtr ClaimSnapshotGLContext + nsCString discardFailureId; + sSnapshotContext = GLContextProvider::CreateHeadless({}, &discardFailureId); + if (!sSnapshotContext) { +- LOGDMABUF(("GetAsSourceSurface: Failed to create snapshot GLContext.")); ++ LOGDMABUF( ++ ("ClaimSnapshotGLContext: Failed to create snapshot GLContext.")); + return nullptr; + } + sSnapshotContext->mOwningThreadId = Nothing(); // No singular owner. + } + if (!sSnapshotContext->MakeCurrent()) { +- LOGDMABUF(("GetAsSourceSurface: Failed to make GLContext current.")); ++ LOGDMABUF(("ClaimSnapshotGLContext: Failed to make GLContext current.")); + return nullptr; + } + return sSnapshotContext; +@@ -84,6 +85,7 @@ void ReturnSnapshotGLContext(RefPtrmUseTLSIsCurrent); + if (!aGLContext->IsCurrent()) { ++ LOGDMABUF(("ReturnSnapshotGLContext() failed, is not current!")); + return; + } + const auto& gle = gl::GLContextEGL::Cast(aGLContext); +@@ -911,7 +913,7 @@ already_AddRefed DMABu + RefPtr surf = new DMABufSurfaceYUV(); + LOGDMABUF(("DMABufSurfaceYUV::CreateYUVSurface() UID %d from desc\n", + surf->GetUID())); +- if (!surf->UpdateYUVData(aDesc, aWidth, aHeight)) { ++ if (!surf->UpdateYUVData(aDesc, aWidth, aHeight, false)) { + return nullptr; + } + return surf.forget(); +@@ -975,16 +977,16 @@ void DMABufSurfaceYUV::CloseFileDescript + } + } + +-bool DMABufSurfaceYUV::UpdateYUVData(const VADRMPRIMESurfaceDescriptor& aDesc, +- int aWidth, int aHeight) { ++bool DMABufSurfaceYUV::ImportPRIMESurfaceDescriptor( ++ const VADRMPRIMESurfaceDescriptor& aDesc, int aWidth, int aHeight) { ++ LOGDMABUF(("DMABufSurfaceYUV::ImportPRIMESurfaceDescriptor() UID %d", mUID)); ++ // Already exists? ++ MOZ_DIAGNOSTIC_ASSERT(mDmabufFds[0] < 0); ++ + if (aDesc.num_layers > DMABUF_BUFFER_PLANES || + aDesc.num_objects > DMABUF_BUFFER_PLANES) { +- return false; +- } +- +- LOGDMABUF(("DMABufSurfaceYUV::UpdateYUVData() UID %d", mUID)); +- if (mDmabufFds[0] >= 0) { +- LOGDMABUF((" Already created!")); ++ LOGDMABUF((" Can't import, wrong layers/objects number (%d, %d)", ++ aDesc.num_layers, aDesc.num_objects)); + return false; + } + if (aDesc.fourcc == VA_FOURCC_NV12) { +@@ -994,8 +996,7 @@ bool DMABufSurfaceYUV::UpdateYUVData(con + } else if (aDesc.fourcc == VA_FOURCC_YV12) { + mSurfaceType = SURFACE_YUV420; + } else { +- LOGDMABUF(("UpdateYUVData(): Can't import surface data of 0x%x format", +- aDesc.fourcc)); ++ LOGDMABUF((" Can't import surface data of 0x%x format", aDesc.fourcc)); + return false; + } + +@@ -1003,12 +1004,6 @@ bool DMABufSurfaceYUV::UpdateYUVData(con + + for (unsigned int i = 0; i < aDesc.num_layers; i++) { + unsigned int object = aDesc.layers[i].object_index[0]; +- // Intel exports VA-API surfaces in one object,planes have the same FD. +- // AMD exports surfaces in two objects with different FDs. +- int fd = aDesc.objects[object].fd; +- bool dupFD = (object != i); +- mDmabufFds[i] = dupFD ? dup(fd) : fd; +- + mBufferModifiers[i] = aDesc.objects[object].drm_format_modifier; + mDrmFormats[i] = aDesc.layers[i].drm_format; + mOffsets[i] = aDesc.layers[i].offset[0]; +@@ -1017,18 +1012,104 @@ bool DMABufSurfaceYUV::UpdateYUVData(con + mHeightAligned[i] = aDesc.height >> i; + mWidth[i] = aWidth >> i; + mHeight[i] = aHeight >> i; +- + LOGDMABUF((" plane %d size %d x %d format %x", i, mWidth[i], mHeight[i], + mDrmFormats[i])); + } ++ return true; ++} + ++bool DMABufSurfaceYUV::MoveYUVDataImpl(const VADRMPRIMESurfaceDescriptor& aDesc, ++ int aWidth, int aHeight) { ++ if (!ImportPRIMESurfaceDescriptor(aDesc, aWidth, aHeight)) { ++ return false; ++ } ++ for (unsigned int i = 0; i < aDesc.num_layers; i++) { ++ unsigned int object = aDesc.layers[i].object_index[0]; ++ // Intel exports VA-API surfaces in one object,planes have the same FD. ++ // AMD exports surfaces in two objects with different FDs. ++ int fd = aDesc.objects[object].fd; ++ bool dupFD = (object != i); ++ mDmabufFds[i] = dupFD ? dup(fd) : fd; ++ } + return true; + } + +-bool DMABufSurfaceYUV::CreateYUVPlane(int aPlane, int aWidth, int aHeight, +- int aDrmFormat) { ++bool DMABufSurfaceYUV::CreateYUVPlane(int aPlane) { + LOGDMABUF(("DMABufSurfaceYUV::CreateYUVPlane() UID %d size %d x %d", mUID, +- aWidth, aHeight)); ++ mWidth[aPlane], mHeight[aPlane])); ++ ++ if (!GetAndConfigureDMABufDevice()->GetGbmDevice()) { ++ LOGDMABUF((" Missing GbmDevice!")); ++ return false; ++ } ++ ++ bool useModifiers = (mBufferModifiers[aPlane] != DRM_FORMAT_MOD_INVALID); ++ if (useModifiers) { ++ mGbmBufferObject[aPlane] = nsGbmLib::CreateWithModifiers( ++ GetDMABufDevice()->GetGbmDevice(), mWidth[aPlane], mHeight[aPlane], ++ mDrmFormats[aPlane], mBufferModifiers + aPlane, 1); ++ } else { ++ mGbmBufferObject[aPlane] = nsGbmLib::Create( ++ GetDMABufDevice()->GetGbmDevice(), mWidth[aPlane], mHeight[aPlane], ++ mDrmFormats[aPlane], GBM_BO_USE_RENDERING); ++ } ++ if (!mGbmBufferObject[aPlane]) { ++ LOGDMABUF((" Failed to create GbmBufferObject: %s", strerror(errno))); ++ return false; ++ } ++ ++ mStrides[aPlane] = nsGbmLib::GetStride(mGbmBufferObject[aPlane]); ++ mOffsets[aPlane] = nsGbmLib::GetOffset(mGbmBufferObject[aPlane], 0); ++ mWidthAligned[aPlane] = mWidth[aPlane]; ++ mHeightAligned[aPlane] = mHeight[aPlane]; ++ return true; ++} ++ ++bool DMABufSurfaceYUV::CopyYUVDataImpl(const VADRMPRIMESurfaceDescriptor& aDesc, ++ int aWidth, int aHeight) { ++ RefPtr tmpSurf = CreateYUVSurface(aDesc, aWidth, aHeight); ++ if (!tmpSurf) { ++ return false; ++ } ++ ++ if (!ImportPRIMESurfaceDescriptor(aDesc, aWidth, aHeight)) { ++ return false; ++ } ++ ++ StaticMutexAutoLock lock(sSnapshotContextMutex); ++ RefPtr context = ClaimSnapshotGLContext(); ++ auto releaseTextures = MakeScopeExit([&] { ++ tmpSurf->ReleaseTextures(); ++ ReleaseTextures(); ++ ReturnSnapshotGLContext(context); ++ }); ++ ++ for (int i = 0; i < mBufferPlaneCount; i++) { ++ if (!tmpSurf->CreateTexture(context, i)) { ++ return false; ++ } ++ if (!CreateYUVPlane(i) || !CreateTexture(context, i)) { ++ return false; ++ } ++ gfx::IntSize size(GetWidth(i), GetHeight(i)); ++ context->BlitHelper()->BlitTextureToTexture( ++ tmpSurf->GetTexture(i), GetTexture(i), size, size, LOCAL_GL_TEXTURE_2D, ++ LOCAL_GL_TEXTURE_2D); ++ } ++ return true; ++} ++ ++bool DMABufSurfaceYUV::UpdateYUVData(const VADRMPRIMESurfaceDescriptor& aDesc, ++ int aWidth, int aHeight, bool aCopy) { ++ LOGDMABUF(("DMABufSurfaceYUV::UpdateYUVData() UID %d copy %d", mUID, aCopy)); ++ return aCopy ? CopyYUVDataImpl(aDesc, aWidth, aHeight) ++ : MoveYUVDataImpl(aDesc, aWidth, aHeight); ++} ++ ++bool DMABufSurfaceYUV::CreateLinearYUVPlane(int aPlane, int aWidth, int aHeight, ++ int aDrmFormat) { ++ LOGDMABUF(("DMABufSurfaceYUV::CreateLinearYUVPlane() UID %d size %d x %d", ++ mUID, aWidth, aHeight)); + + if (!GetDMABufDevice()->GetGbmDevice()) { + LOGDMABUF((" Missing GbmDevice!")); +@@ -1118,13 +1199,13 @@ bool DMABufSurfaceYUV::Create(int aWidth + mSurfaceType = SURFACE_YUV420; + mBufferPlaneCount = 3; + +- if (!CreateYUVPlane(0, aWidth, aHeight, GBM_FORMAT_R8)) { ++ if (!CreateLinearYUVPlane(0, aWidth, aHeight, GBM_FORMAT_R8)) { + return false; + } +- if (!CreateYUVPlane(1, aWidth >> 1, aHeight >> 1, GBM_FORMAT_R8)) { ++ if (!CreateLinearYUVPlane(1, aWidth >> 1, aHeight >> 1, GBM_FORMAT_R8)) { + return false; + } +- if (!CreateYUVPlane(2, aWidth >> 1, aHeight >> 1, GBM_FORMAT_R8)) { ++ if (!CreateLinearYUVPlane(2, aWidth >> 1, aHeight >> 1, GBM_FORMAT_R8)) { + return false; + } + if (!aPixelData || !aLineSizes) { +diff -up firefox-109.0/widget/gtk/DMABufSurface.h.1809162 firefox-109.0/widget/gtk/DMABufSurface.h +--- firefox-109.0/widget/gtk/DMABufSurface.h.1809162 2023-01-12 21:02:18.000000000 +0100 ++++ firefox-109.0/widget/gtk/DMABufSurface.h 2023-01-17 14:23:30.006040639 +0100 +@@ -323,7 +323,7 @@ class DMABufSurfaceYUV : public DMABufSu + + bool UpdateYUVData(void** aPixelData, int* aLineSizes); + bool UpdateYUVData(const VADRMPRIMESurfaceDescriptor& aDesc, int aWidth, +- int aHeight); ++ int aHeight, bool aCopy); + + bool VerifyTextureCreation(); + +@@ -332,9 +332,18 @@ class DMABufSurfaceYUV : public DMABufSu + + bool Create(const mozilla::layers::SurfaceDescriptor& aDesc); + bool Create(int aWidth, int aHeight, void** aPixelData, int* aLineSizes); +- bool CreateYUVPlane(int aPlane, int aWidth, int aHeight, int aDrmFormat); ++ bool CreateYUVPlane(int aPlane); ++ bool CreateLinearYUVPlane(int aPlane, int aWidth, int aHeight, ++ int aDrmFormat); + void UpdateYUVPlane(int aPlane, void* aPixelData, int aLineSize); + ++ bool MoveYUVDataImpl(const VADRMPRIMESurfaceDescriptor& aDesc, int aWidth, ++ int aHeight); ++ bool CopyYUVDataImpl(const VADRMPRIMESurfaceDescriptor& aDesc, int aWidth, ++ int aHeight); ++ ++ bool ImportPRIMESurfaceDescriptor(const VADRMPRIMESurfaceDescriptor& aDesc, ++ int aWidth, int aHeight); + bool ImportSurfaceDescriptor( + const mozilla::layers::SurfaceDescriptorDMABuf& aDesc); + +diff -up firefox-109.0/widget/gtk/GfxInfo.cpp.1809162 firefox-109.0/widget/gtk/GfxInfo.cpp +--- firefox-109.0/widget/gtk/GfxInfo.cpp.1809162 2023-01-17 14:23:30.006040639 +0100 ++++ firefox-109.0/widget/gtk/GfxInfo.cpp 2023-01-17 14:24:42.116475502 +0100 +@@ -887,6 +887,40 @@ const nsTArray& GfxInfo:: + V(0, 0, 0, 0), "FEATURE_HARDWARE_VIDEO_DECODING_NO_LINUX_AMD", ""); + + //////////////////////////////////// ++ // FEATURE_HW_DECODED_VIDEO_ZERO_COPY ++ APPEND_TO_DRIVER_BLOCKLIST_EXT( ++ OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, ++ DesktopEnvironment::All, WindowProtocol::All, DriverVendor::MesaAll, ++ DeviceFamily::All, nsIGfxInfo::FEATURE_HW_DECODED_VIDEO_ZERO_COPY, ++ nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN, ++ V(21, 0, 0, 0), "FEATURE_HW_DECODED_VIDEO_ZERO_COPY", "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_HW_DECODED_VIDEO_ZERO_COPY, ++ nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED, ++ V(0, 0, 0, 0), "FEATURE_HW_DECODED_VIDEO_ZERO_COPY_NO_LINUX_NVIDIA", ++ ""); ++ ++ // Disable on all AMD devices (Bug 1802844) ++ APPEND_TO_DRIVER_BLOCKLIST_EXT( ++ OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, ++ DesktopEnvironment::All, WindowProtocol::All, DriverVendor::All, ++ DeviceFamily::AtiAll, nsIGfxInfo::FEATURE_HW_DECODED_VIDEO_ZERO_COPY, ++ nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED, ++ V(0, 0, 0, 0), "FEATURE_HW_DECODED_VIDEO_ZERO_COPY_NO_LINUX_AMD", ""); ++ ++ // As FEATURE_HW_DECODED_VIDEO_ZERO_COPY is allow listed feature ++ // we need to explicitly enable it on all Intel hardware. ++ APPEND_TO_DRIVER_BLOCKLIST2(OperatingSystem::Linux, DeviceFamily::IntelAll, ++ nsIGfxInfo::FEATURE_HW_DECODED_VIDEO_ZERO_COPY, ++ nsIGfxInfo::FEATURE_ALLOW_ALWAYS, ++ DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0), ++ "FEATURE_ROLLOUT_ALL"); ++ ++ //////////////////////////////////// + // FEATURE_WEBRENDER_PARTIAL_PRESENT + APPEND_TO_DRIVER_BLOCKLIST_EXT( + OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, From d1c72896f384d96026fabc9a2450c768c86e9500 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 17 Jan 2023 22:32:33 +0100 Subject: [PATCH 170/545] build fix --- mozilla-1809162.patch | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/mozilla-1809162.patch b/mozilla-1809162.patch index a6d2571..6ca07c5 100644 --- a/mozilla-1809162.patch +++ b/mozilla-1809162.patch @@ -1,6 +1,6 @@ diff -up firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.1809162 firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp --- firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.1809162 2023-01-12 21:02:00.000000000 +0100 -+++ firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp 2023-01-17 14:23:30.004040571 +0100 ++++ firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp 2023-01-17 21:12:16.926871788 +0100 @@ -9,6 +9,7 @@ #include "FFmpegLog.h" #include "mozilla/widget/DMABufLibWrapper.h" @@ -21,12 +21,13 @@ diff -up firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.18091 VideoFramePool::~VideoFramePool() { MutexAutoLock lock(mSurfaceLock); -@@ -129,32 +133,31 @@ VideoFramePool::GetVideoFrame +@@ -127,34 +131,34 @@ VideoFramePool::GetVideoFrame + } + MutexAutoLock lock(mSurfaceLock); ++ RefPtr surface; RefPtr> videoSurface = GetFreeVideoFrameSurface(); -+ RefPtr surface = -+ videoSurface ? videoSurface->GetDMABufSurface() : new DMABufSurfaceYUV(); if (!videoSurface) { - RefPtr surface = - DMABufSurfaceYUV::CreateYUVSurface(aVaDesc, aWidth, aHeight); @@ -45,10 +46,12 @@ diff -up firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.18091 - } - videoSurface = surf; - mDMABufSurfaces.AppendElement(std::move(surf)); ++ surface = new DMABufSurfaceYUV(); + videoSurface = new VideoFrameSurface(surface); + mDMABufSurfaces.AppendElement(videoSurface); } else { - RefPtr surface = videoSurface->GetDMABufSurface(); ++ surface = videoSurface->GetDMABufSurface(); DMABUF_LOG("Reusing VA-API DMABufSurface UID %d", surface->GetUID()); - if (!surface->UpdateYUVData(aVaDesc, aWidth, aHeight)) { + } @@ -74,7 +77,7 @@ diff -up firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.18091 } diff -up firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.1809162 firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h --- firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.1809162 2023-01-12 21:02:00.000000000 +0100 -+++ firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h 2023-01-17 14:23:30.004040571 +0100 ++++ firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h 2023-01-17 14:34:01.738414382 +0100 @@ -129,6 +129,8 @@ class VideoFramePool { // We may fail to create texture over DMABuf memory due to driver bugs so // check that before we export first DMABuf video frame. @@ -86,7 +89,7 @@ diff -up firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.1809162 } // namespace mozilla diff -up firefox-109.0/gfx/thebes/gfxPlatformGtk.cpp.1809162 firefox-109.0/gfx/thebes/gfxPlatformGtk.cpp --- firefox-109.0/gfx/thebes/gfxPlatformGtk.cpp.1809162 2023-01-12 21:02:01.000000000 +0100 -+++ firefox-109.0/gfx/thebes/gfxPlatformGtk.cpp 2023-01-17 14:23:30.004040571 +0100 ++++ firefox-109.0/gfx/thebes/gfxPlatformGtk.cpp 2023-01-17 14:34:01.738414382 +0100 @@ -253,6 +253,34 @@ bool gfxPlatformGtk::InitVAAPIConfig(boo feature.ForceDisable(FeatureStatus::Unavailable, "Requires EGL", "FEATURE_FAILURE_REQUIRES_EGL"_ns); @@ -124,7 +127,7 @@ diff -up firefox-109.0/gfx/thebes/gfxPlatformGtk.cpp.1809162 firefox-109.0/gfx/t "Wayland support missing", diff -up firefox-109.0/modules/libpref/init/StaticPrefList.yaml.1809162 firefox-109.0/modules/libpref/init/StaticPrefList.yaml --- firefox-109.0/modules/libpref/init/StaticPrefList.yaml.1809162 2023-01-12 21:02:07.000000000 +0100 -+++ firefox-109.0/modules/libpref/init/StaticPrefList.yaml 2023-01-17 14:23:30.005040605 +0100 ++++ firefox-109.0/modules/libpref/init/StaticPrefList.yaml 2023-01-17 14:34:01.739414416 +0100 @@ -9836,6 +9836,14 @@ type: RelaxedAtomicBool value: false @@ -142,7 +145,7 @@ diff -up firefox-109.0/modules/libpref/init/StaticPrefList.yaml.1809162 firefox- diff -up firefox-109.0/widget/gtk/DMABufLibWrapper.cpp.1809162 firefox-109.0/widget/gtk/DMABufLibWrapper.cpp --- firefox-109.0/widget/gtk/DMABufLibWrapper.cpp.1809162 2023-01-12 21:02:18.000000000 +0100 -+++ firefox-109.0/widget/gtk/DMABufLibWrapper.cpp 2023-01-17 14:23:30.005040605 +0100 ++++ firefox-109.0/widget/gtk/DMABufLibWrapper.cpp 2023-01-17 14:34:01.739414416 +0100 @@ -12,12 +12,17 @@ #include "mozilla/StaticPrefs_media.h" #include "mozilla/gfx/gfxVars.h" @@ -206,7 +209,7 @@ diff -up firefox-109.0/widget/gtk/DMABufLibWrapper.cpp.1809162 firefox-109.0/wid } // namespace mozilla diff -up firefox-109.0/widget/gtk/DMABufLibWrapper.h.1809162 firefox-109.0/widget/gtk/DMABufLibWrapper.h --- firefox-109.0/widget/gtk/DMABufLibWrapper.h.1809162 2023-01-12 21:02:18.000000000 +0100 -+++ firefox-109.0/widget/gtk/DMABufLibWrapper.h 2023-01-17 14:23:30.005040605 +0100 ++++ firefox-109.0/widget/gtk/DMABufLibWrapper.h 2023-01-17 14:34:01.739414416 +0100 @@ -215,6 +215,7 @@ class nsDMABufDevice { }; @@ -217,7 +220,7 @@ diff -up firefox-109.0/widget/gtk/DMABufLibWrapper.h.1809162 firefox-109.0/widge } // namespace mozilla diff -up firefox-109.0/widget/gtk/DMABufSurface.cpp.1809162 firefox-109.0/widget/gtk/DMABufSurface.cpp --- firefox-109.0/widget/gtk/DMABufSurface.cpp.1809162 2023-01-12 21:02:18.000000000 +0100 -+++ firefox-109.0/widget/gtk/DMABufSurface.cpp 2023-01-17 14:23:30.006040639 +0100 ++++ firefox-109.0/widget/gtk/DMABufSurface.cpp 2023-01-17 14:34:01.740414450 +0100 @@ -67,13 +67,14 @@ RefPtr ClaimSnapshotGLContext nsCString discardFailureId; sSnapshotContext = GLContextProvider::CreateHeadless({}, &discardFailureId); @@ -428,7 +431,7 @@ diff -up firefox-109.0/widget/gtk/DMABufSurface.cpp.1809162 firefox-109.0/widget if (!aPixelData || !aLineSizes) { diff -up firefox-109.0/widget/gtk/DMABufSurface.h.1809162 firefox-109.0/widget/gtk/DMABufSurface.h --- firefox-109.0/widget/gtk/DMABufSurface.h.1809162 2023-01-12 21:02:18.000000000 +0100 -+++ firefox-109.0/widget/gtk/DMABufSurface.h 2023-01-17 14:23:30.006040639 +0100 ++++ firefox-109.0/widget/gtk/DMABufSurface.h 2023-01-17 14:34:01.740414450 +0100 @@ -323,7 +323,7 @@ class DMABufSurfaceYUV : public DMABufSu bool UpdateYUVData(void** aPixelData, int* aLineSizes); @@ -459,8 +462,8 @@ diff -up firefox-109.0/widget/gtk/DMABufSurface.h.1809162 firefox-109.0/widget/g const mozilla::layers::SurfaceDescriptorDMABuf& aDesc); diff -up firefox-109.0/widget/gtk/GfxInfo.cpp.1809162 firefox-109.0/widget/gtk/GfxInfo.cpp ---- firefox-109.0/widget/gtk/GfxInfo.cpp.1809162 2023-01-17 14:23:30.006040639 +0100 -+++ firefox-109.0/widget/gtk/GfxInfo.cpp 2023-01-17 14:24:42.116475502 +0100 +--- firefox-109.0/widget/gtk/GfxInfo.cpp.1809162 2023-01-17 14:34:01.724413908 +0100 ++++ firefox-109.0/widget/gtk/GfxInfo.cpp 2023-01-17 14:34:01.740414450 +0100 @@ -887,6 +887,40 @@ const nsTArray& GfxInfo:: V(0, 0, 0, 0), "FEATURE_HARDWARE_VIDEO_DECODING_NO_LINUX_AMD", ""); From e2711446e1bd4dbd7cd8cb6ad173dadee9e2bc21 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 19 Jan 2023 03:27:52 +0000 Subject: [PATCH 171/545] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- firefox.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 7219707..244ac1e 100644 --- a/firefox.spec +++ b/firefox.spec @@ -173,7 +173,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 109.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1082,6 +1082,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Jan 19 2023 Fedora Release Engineering - 109.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Tue Jan 17 2023 Martin Stransky - 109.0-2 - Added VA-API fixes mozbz#1809162, mozbz#1801576 From f58ac6040ca2beb452b7d4fce12ef73c3bf70e60 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 19 Jan 2023 11:02:02 +0100 Subject: [PATCH 172/545] Removed mozbz#1809162 --- firefox.spec | 7 +- mozilla-1809162.patch | 507 ------------------------------------------ 2 files changed, 4 insertions(+), 510 deletions(-) delete mode 100644 mozilla-1809162.patch diff --git a/firefox.spec b/firefox.spec index 7219707..44cf0f2 100644 --- a/firefox.spec +++ b/firefox.spec @@ -173,7 +173,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 109.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -251,7 +251,6 @@ Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch Patch416: D164651.diff Patch417: D166324.diff -Patch418: mozilla-1809162.patch # PGO/LTO patches Patch600: pgo.patch @@ -528,7 +527,6 @@ This package contains results of tests executed during build. %patch415 -p1 -b .1670333 %patch416 -p1 -b .D164651 %patch417 -p1 -b .D166324 -%patch418 -p1 -b .1809162 # PGO patches %if %{build_with_pgo} @@ -1082,6 +1080,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Jan 19 2023 Martin Stransky - 109.0-3 +- Removed mozbz#1809162 + * Tue Jan 17 2023 Martin Stransky - 109.0-2 - Added VA-API fixes mozbz#1809162, mozbz#1801576 diff --git a/mozilla-1809162.patch b/mozilla-1809162.patch deleted file mode 100644 index 6ca07c5..0000000 --- a/mozilla-1809162.patch +++ /dev/null @@ -1,507 +0,0 @@ -diff -up firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.1809162 firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp ---- firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp.1809162 2023-01-12 21:02:00.000000000 +0100 -+++ firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.cpp 2023-01-17 21:12:16.926871788 +0100 -@@ -9,6 +9,7 @@ - #include "FFmpegLog.h" - #include "mozilla/widget/DMABufLibWrapper.h" - #include "libavutil/pixfmt.h" -+#include "mozilla/gfx/gfxVars.h" - - #ifdef MOZ_LOGGING - # undef DMABUF_LOG -@@ -87,7 +88,10 @@ VideoFrameSurface::~VideoFram - } - - VideoFramePool::VideoFramePool() -- : mSurfaceLock("VideoFramePoolSurfaceLock") {} -+ : mSurfaceLock("VideoFramePoolSurfaceLock"), -+ mSurfaceCopy(!gfx::gfxVars::HwDecodedVideoZeroCopy()) { -+ DMABUF_LOG("VideoFramePool::VideoFramePool() surface copy %d", mSurfaceCopy); -+} - - VideoFramePool::~VideoFramePool() { - MutexAutoLock lock(mSurfaceLock); -@@ -127,34 +131,34 @@ VideoFramePool::GetVideoFrame - } - - MutexAutoLock lock(mSurfaceLock); -+ RefPtr surface; - RefPtr> videoSurface = - GetFreeVideoFrameSurface(); - if (!videoSurface) { -- RefPtr surface = -- DMABufSurfaceYUV::CreateYUVSurface(aVaDesc, aWidth, aHeight); -- if (!surface) { -- return nullptr; -- } - DMABUF_LOG("Created new VA-API DMABufSurface UID %d", surface->GetUID()); -- RefPtr> surf = -- new VideoFrameSurface(surface); -- if (!mTextureCreationWorks) { -- mTextureCreationWorks = Some(surface->VerifyTextureCreation()); -- } -- if (!*mTextureCreationWorks) { -- DMABUF_LOG(" failed to create texture over DMABuf memory!"); -- return nullptr; -- } -- videoSurface = surf; -- mDMABufSurfaces.AppendElement(std::move(surf)); -+ surface = new DMABufSurfaceYUV(); -+ videoSurface = new VideoFrameSurface(surface); -+ mDMABufSurfaces.AppendElement(videoSurface); - } else { -- RefPtr surface = videoSurface->GetDMABufSurface(); -+ surface = videoSurface->GetDMABufSurface(); - DMABUF_LOG("Reusing VA-API DMABufSurface UID %d", surface->GetUID()); -- if (!surface->UpdateYUVData(aVaDesc, aWidth, aHeight)) { -+ } -+ -+ if (!surface->UpdateYUVData(aVaDesc, aWidth, aHeight, mSurfaceCopy)) { -+ return nullptr; -+ } -+ -+ if (MOZ_UNLIKELY(!mTextureCreationWorks)) { -+ mTextureCreationWorks = Some(surface->VerifyTextureCreation()); -+ if (!*mTextureCreationWorks) { -+ DMABUF_LOG(" failed to create texture over DMABuf memory!"); - return nullptr; - } - } -- videoSurface->LockVAAPIData(aAVCodecContext, aAVFrame, aLib); -+ -+ if (!mSurfaceCopy) { -+ videoSurface->LockVAAPIData(aAVCodecContext, aAVFrame, aLib); -+ } - videoSurface->MarkAsUsed(); - return videoSurface; - } -diff -up firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.1809162 firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h ---- firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h.1809162 2023-01-12 21:02:00.000000000 +0100 -+++ firefox-109.0/dom/media/platforms/ffmpeg/FFmpegVideoFramePool.h 2023-01-17 14:34:01.738414382 +0100 -@@ -129,6 +129,8 @@ class VideoFramePool { - // We may fail to create texture over DMABuf memory due to driver bugs so - // check that before we export first DMABuf video frame. - Maybe mTextureCreationWorks; -+ // Copy decoded dmabuf surfaces so we can return them to ffmpeg immediately. -+ const bool mSurfaceCopy; - }; - - } // namespace mozilla -diff -up firefox-109.0/gfx/thebes/gfxPlatformGtk.cpp.1809162 firefox-109.0/gfx/thebes/gfxPlatformGtk.cpp ---- firefox-109.0/gfx/thebes/gfxPlatformGtk.cpp.1809162 2023-01-12 21:02:01.000000000 +0100 -+++ firefox-109.0/gfx/thebes/gfxPlatformGtk.cpp 2023-01-17 14:34:01.738414382 +0100 -@@ -253,6 +253,34 @@ bool gfxPlatformGtk::InitVAAPIConfig(boo - feature.ForceDisable(FeatureStatus::Unavailable, "Requires EGL", - "FEATURE_FAILURE_REQUIRES_EGL"_ns); - } -+ -+ if (feature.IsEnabled()) { -+ FeatureState& featureZeroCopyDecode = -+ gfxConfig::GetFeature(Feature::HW_DECODED_VIDEO_ZERO_COPY); -+ featureZeroCopyDecode.EnableByDefault(); -+ -+ if (!StaticPrefs::media_ffmpeg_vaapi_zero_copy_enabled_AtStartup()) { -+ featureZeroCopyDecode.UserDisable("Disabled by pref", -+ "FEATURE_FAILURE_USER_DISABLED"_ns); -+ } else { -+ if (NS_FAILED(gfxInfo->GetFeatureStatus( -+ nsIGfxInfo::FEATURE_HW_DECODED_VIDEO_ZERO_COPY, failureId, -+ &status))) { -+ featureZeroCopyDecode.DisableByDefault( -+ FeatureStatus::BlockedNoGfxInfo, "gfxInfo is broken", -+ "FEATURE_FAILURE_WR_NO_GFX_INFO"_ns); -+ } else if (status != nsIGfxInfo::FEATURE_ALLOW_ALWAYS) { -+ featureZeroCopyDecode.DisableByDefault( -+ FeatureStatus::Blocked, "Blocklisted by gfxInfo", failureId); -+ } -+ if (StaticPrefs::media_ffmpeg_vaapi_zero_copy_force_enabled_AtStartup()) { -+ featureZeroCopyDecode.UserForceEnable("Force enabled by pref"); -+ } -+ if (featureZeroCopyDecode.IsEnabled()) { -+ gfxVars::SetHwDecodedVideoZeroCopy(true); -+ } -+ } -+ } - #else - feature.DisableByDefault(FeatureStatus::Unavailable, - "Wayland support missing", -diff -up firefox-109.0/modules/libpref/init/StaticPrefList.yaml.1809162 firefox-109.0/modules/libpref/init/StaticPrefList.yaml ---- firefox-109.0/modules/libpref/init/StaticPrefList.yaml.1809162 2023-01-12 21:02:07.000000000 +0100 -+++ firefox-109.0/modules/libpref/init/StaticPrefList.yaml 2023-01-17 14:34:01.739414416 +0100 -@@ -9836,6 +9836,14 @@ - type: RelaxedAtomicBool - value: false - mirror: always -+- name: media.ffmpeg.vaapi.zero-copy.enabled -+ type: bool -+ value: true -+ mirror: once -+- name: media.ffmpeg.vaapi.zero-copy.force-enabled -+ type: bool -+ value: false -+ mirror: once - #endif # MOZ_WIDGET_GTK - #endif # MOZ_FFMPEG - -diff -up firefox-109.0/widget/gtk/DMABufLibWrapper.cpp.1809162 firefox-109.0/widget/gtk/DMABufLibWrapper.cpp ---- firefox-109.0/widget/gtk/DMABufLibWrapper.cpp.1809162 2023-01-12 21:02:18.000000000 +0100 -+++ firefox-109.0/widget/gtk/DMABufLibWrapper.cpp 2023-01-17 14:34:01.739414416 +0100 -@@ -12,12 +12,17 @@ - #include "mozilla/StaticPrefs_media.h" - #include "mozilla/gfx/gfxVars.h" - #include "WidgetUtilsGtk.h" -+#include "gfxConfig.h" -+#include "nsIGfxInfo.h" -+#include "mozilla/Components.h" - - #include - #include - #include - #include - -+using namespace mozilla::gfx; -+ - namespace mozilla { - namespace widget { - -@@ -224,24 +229,13 @@ nsDMABufDevice::~nsDMABufDevice() { - int nsDMABufDevice::GetDRMFd() { return mDRMFd; } - - bool nsDMABufDevice::Configure(nsACString& aFailureId) { -- LOGDMABUF(("nsDMABufDevice::Configure()")); -+ if (mInitialized) { -+ return true; -+ } - -- MOZ_ASSERT(!mInitialized); -+ LOGDMABUF(("nsDMABufDevice::Configure()")); - mInitialized = true; - -- bool isDMABufUsed = ( --#ifdef NIGHTLY_BUILD -- StaticPrefs::widget_dmabuf_textures_enabled() || --#endif -- StaticPrefs::widget_dmabuf_webgl_enabled()); -- -- if (!isDMABufUsed) { -- // Disabled by user, just quit. -- LOGDMABUF(("IsDMABufEnabled(): Disabled by preferences.")); -- aFailureId = "FEATURE_FAILURE_NO_PREFS_ENABLED"; -- return false; -- } -- - if (!nsGbmLib::IsAvailable()) { - LOGDMABUF(("nsGbmLib is not available!")); - aFailureId = "FEATURE_FAILURE_NO_LIBGBM"; -@@ -327,5 +321,13 @@ nsDMABufDevice* GetDMABufDevice() { - return &dmaBufDevice; - } - -+nsDMABufDevice* GetAndConfigureDMABufDevice() { -+ nsCString failureId; -+ if (GetDMABufDevice()->Configure(failureId)) { -+ return GetDMABufDevice(); -+ } -+ return nullptr; -+} -+ - } // namespace widget - } // namespace mozilla -diff -up firefox-109.0/widget/gtk/DMABufLibWrapper.h.1809162 firefox-109.0/widget/gtk/DMABufLibWrapper.h ---- firefox-109.0/widget/gtk/DMABufLibWrapper.h.1809162 2023-01-12 21:02:18.000000000 +0100 -+++ firefox-109.0/widget/gtk/DMABufLibWrapper.h 2023-01-17 14:34:01.739414416 +0100 -@@ -215,6 +215,7 @@ class nsDMABufDevice { - }; - - nsDMABufDevice* GetDMABufDevice(); -+nsDMABufDevice* GetAndConfigureDMABufDevice(); - - } // namespace widget - } // namespace mozilla -diff -up firefox-109.0/widget/gtk/DMABufSurface.cpp.1809162 firefox-109.0/widget/gtk/DMABufSurface.cpp ---- firefox-109.0/widget/gtk/DMABufSurface.cpp.1809162 2023-01-12 21:02:18.000000000 +0100 -+++ firefox-109.0/widget/gtk/DMABufSurface.cpp 2023-01-17 14:34:01.740414450 +0100 -@@ -67,13 +67,14 @@ RefPtr ClaimSnapshotGLContext - nsCString discardFailureId; - sSnapshotContext = GLContextProvider::CreateHeadless({}, &discardFailureId); - if (!sSnapshotContext) { -- LOGDMABUF(("GetAsSourceSurface: Failed to create snapshot GLContext.")); -+ LOGDMABUF( -+ ("ClaimSnapshotGLContext: Failed to create snapshot GLContext.")); - return nullptr; - } - sSnapshotContext->mOwningThreadId = Nothing(); // No singular owner. - } - if (!sSnapshotContext->MakeCurrent()) { -- LOGDMABUF(("GetAsSourceSurface: Failed to make GLContext current.")); -+ LOGDMABUF(("ClaimSnapshotGLContext: Failed to make GLContext current.")); - return nullptr; - } - return sSnapshotContext; -@@ -84,6 +85,7 @@ void ReturnSnapshotGLContext(RefPtrmUseTLSIsCurrent); - if (!aGLContext->IsCurrent()) { -+ LOGDMABUF(("ReturnSnapshotGLContext() failed, is not current!")); - return; - } - const auto& gle = gl::GLContextEGL::Cast(aGLContext); -@@ -911,7 +913,7 @@ already_AddRefed DMABu - RefPtr surf = new DMABufSurfaceYUV(); - LOGDMABUF(("DMABufSurfaceYUV::CreateYUVSurface() UID %d from desc\n", - surf->GetUID())); -- if (!surf->UpdateYUVData(aDesc, aWidth, aHeight)) { -+ if (!surf->UpdateYUVData(aDesc, aWidth, aHeight, false)) { - return nullptr; - } - return surf.forget(); -@@ -975,16 +977,16 @@ void DMABufSurfaceYUV::CloseFileDescript - } - } - --bool DMABufSurfaceYUV::UpdateYUVData(const VADRMPRIMESurfaceDescriptor& aDesc, -- int aWidth, int aHeight) { -+bool DMABufSurfaceYUV::ImportPRIMESurfaceDescriptor( -+ const VADRMPRIMESurfaceDescriptor& aDesc, int aWidth, int aHeight) { -+ LOGDMABUF(("DMABufSurfaceYUV::ImportPRIMESurfaceDescriptor() UID %d", mUID)); -+ // Already exists? -+ MOZ_DIAGNOSTIC_ASSERT(mDmabufFds[0] < 0); -+ - if (aDesc.num_layers > DMABUF_BUFFER_PLANES || - aDesc.num_objects > DMABUF_BUFFER_PLANES) { -- return false; -- } -- -- LOGDMABUF(("DMABufSurfaceYUV::UpdateYUVData() UID %d", mUID)); -- if (mDmabufFds[0] >= 0) { -- LOGDMABUF((" Already created!")); -+ LOGDMABUF((" Can't import, wrong layers/objects number (%d, %d)", -+ aDesc.num_layers, aDesc.num_objects)); - return false; - } - if (aDesc.fourcc == VA_FOURCC_NV12) { -@@ -994,8 +996,7 @@ bool DMABufSurfaceYUV::UpdateYUVData(con - } else if (aDesc.fourcc == VA_FOURCC_YV12) { - mSurfaceType = SURFACE_YUV420; - } else { -- LOGDMABUF(("UpdateYUVData(): Can't import surface data of 0x%x format", -- aDesc.fourcc)); -+ LOGDMABUF((" Can't import surface data of 0x%x format", aDesc.fourcc)); - return false; - } - -@@ -1003,12 +1004,6 @@ bool DMABufSurfaceYUV::UpdateYUVData(con - - for (unsigned int i = 0; i < aDesc.num_layers; i++) { - unsigned int object = aDesc.layers[i].object_index[0]; -- // Intel exports VA-API surfaces in one object,planes have the same FD. -- // AMD exports surfaces in two objects with different FDs. -- int fd = aDesc.objects[object].fd; -- bool dupFD = (object != i); -- mDmabufFds[i] = dupFD ? dup(fd) : fd; -- - mBufferModifiers[i] = aDesc.objects[object].drm_format_modifier; - mDrmFormats[i] = aDesc.layers[i].drm_format; - mOffsets[i] = aDesc.layers[i].offset[0]; -@@ -1017,18 +1012,104 @@ bool DMABufSurfaceYUV::UpdateYUVData(con - mHeightAligned[i] = aDesc.height >> i; - mWidth[i] = aWidth >> i; - mHeight[i] = aHeight >> i; -- - LOGDMABUF((" plane %d size %d x %d format %x", i, mWidth[i], mHeight[i], - mDrmFormats[i])); - } -+ return true; -+} - -+bool DMABufSurfaceYUV::MoveYUVDataImpl(const VADRMPRIMESurfaceDescriptor& aDesc, -+ int aWidth, int aHeight) { -+ if (!ImportPRIMESurfaceDescriptor(aDesc, aWidth, aHeight)) { -+ return false; -+ } -+ for (unsigned int i = 0; i < aDesc.num_layers; i++) { -+ unsigned int object = aDesc.layers[i].object_index[0]; -+ // Intel exports VA-API surfaces in one object,planes have the same FD. -+ // AMD exports surfaces in two objects with different FDs. -+ int fd = aDesc.objects[object].fd; -+ bool dupFD = (object != i); -+ mDmabufFds[i] = dupFD ? dup(fd) : fd; -+ } - return true; - } - --bool DMABufSurfaceYUV::CreateYUVPlane(int aPlane, int aWidth, int aHeight, -- int aDrmFormat) { -+bool DMABufSurfaceYUV::CreateYUVPlane(int aPlane) { - LOGDMABUF(("DMABufSurfaceYUV::CreateYUVPlane() UID %d size %d x %d", mUID, -- aWidth, aHeight)); -+ mWidth[aPlane], mHeight[aPlane])); -+ -+ if (!GetAndConfigureDMABufDevice()->GetGbmDevice()) { -+ LOGDMABUF((" Missing GbmDevice!")); -+ return false; -+ } -+ -+ bool useModifiers = (mBufferModifiers[aPlane] != DRM_FORMAT_MOD_INVALID); -+ if (useModifiers) { -+ mGbmBufferObject[aPlane] = nsGbmLib::CreateWithModifiers( -+ GetDMABufDevice()->GetGbmDevice(), mWidth[aPlane], mHeight[aPlane], -+ mDrmFormats[aPlane], mBufferModifiers + aPlane, 1); -+ } else { -+ mGbmBufferObject[aPlane] = nsGbmLib::Create( -+ GetDMABufDevice()->GetGbmDevice(), mWidth[aPlane], mHeight[aPlane], -+ mDrmFormats[aPlane], GBM_BO_USE_RENDERING); -+ } -+ if (!mGbmBufferObject[aPlane]) { -+ LOGDMABUF((" Failed to create GbmBufferObject: %s", strerror(errno))); -+ return false; -+ } -+ -+ mStrides[aPlane] = nsGbmLib::GetStride(mGbmBufferObject[aPlane]); -+ mOffsets[aPlane] = nsGbmLib::GetOffset(mGbmBufferObject[aPlane], 0); -+ mWidthAligned[aPlane] = mWidth[aPlane]; -+ mHeightAligned[aPlane] = mHeight[aPlane]; -+ return true; -+} -+ -+bool DMABufSurfaceYUV::CopyYUVDataImpl(const VADRMPRIMESurfaceDescriptor& aDesc, -+ int aWidth, int aHeight) { -+ RefPtr tmpSurf = CreateYUVSurface(aDesc, aWidth, aHeight); -+ if (!tmpSurf) { -+ return false; -+ } -+ -+ if (!ImportPRIMESurfaceDescriptor(aDesc, aWidth, aHeight)) { -+ return false; -+ } -+ -+ StaticMutexAutoLock lock(sSnapshotContextMutex); -+ RefPtr context = ClaimSnapshotGLContext(); -+ auto releaseTextures = MakeScopeExit([&] { -+ tmpSurf->ReleaseTextures(); -+ ReleaseTextures(); -+ ReturnSnapshotGLContext(context); -+ }); -+ -+ for (int i = 0; i < mBufferPlaneCount; i++) { -+ if (!tmpSurf->CreateTexture(context, i)) { -+ return false; -+ } -+ if (!CreateYUVPlane(i) || !CreateTexture(context, i)) { -+ return false; -+ } -+ gfx::IntSize size(GetWidth(i), GetHeight(i)); -+ context->BlitHelper()->BlitTextureToTexture( -+ tmpSurf->GetTexture(i), GetTexture(i), size, size, LOCAL_GL_TEXTURE_2D, -+ LOCAL_GL_TEXTURE_2D); -+ } -+ return true; -+} -+ -+bool DMABufSurfaceYUV::UpdateYUVData(const VADRMPRIMESurfaceDescriptor& aDesc, -+ int aWidth, int aHeight, bool aCopy) { -+ LOGDMABUF(("DMABufSurfaceYUV::UpdateYUVData() UID %d copy %d", mUID, aCopy)); -+ return aCopy ? CopyYUVDataImpl(aDesc, aWidth, aHeight) -+ : MoveYUVDataImpl(aDesc, aWidth, aHeight); -+} -+ -+bool DMABufSurfaceYUV::CreateLinearYUVPlane(int aPlane, int aWidth, int aHeight, -+ int aDrmFormat) { -+ LOGDMABUF(("DMABufSurfaceYUV::CreateLinearYUVPlane() UID %d size %d x %d", -+ mUID, aWidth, aHeight)); - - if (!GetDMABufDevice()->GetGbmDevice()) { - LOGDMABUF((" Missing GbmDevice!")); -@@ -1118,13 +1199,13 @@ bool DMABufSurfaceYUV::Create(int aWidth - mSurfaceType = SURFACE_YUV420; - mBufferPlaneCount = 3; - -- if (!CreateYUVPlane(0, aWidth, aHeight, GBM_FORMAT_R8)) { -+ if (!CreateLinearYUVPlane(0, aWidth, aHeight, GBM_FORMAT_R8)) { - return false; - } -- if (!CreateYUVPlane(1, aWidth >> 1, aHeight >> 1, GBM_FORMAT_R8)) { -+ if (!CreateLinearYUVPlane(1, aWidth >> 1, aHeight >> 1, GBM_FORMAT_R8)) { - return false; - } -- if (!CreateYUVPlane(2, aWidth >> 1, aHeight >> 1, GBM_FORMAT_R8)) { -+ if (!CreateLinearYUVPlane(2, aWidth >> 1, aHeight >> 1, GBM_FORMAT_R8)) { - return false; - } - if (!aPixelData || !aLineSizes) { -diff -up firefox-109.0/widget/gtk/DMABufSurface.h.1809162 firefox-109.0/widget/gtk/DMABufSurface.h ---- firefox-109.0/widget/gtk/DMABufSurface.h.1809162 2023-01-12 21:02:18.000000000 +0100 -+++ firefox-109.0/widget/gtk/DMABufSurface.h 2023-01-17 14:34:01.740414450 +0100 -@@ -323,7 +323,7 @@ class DMABufSurfaceYUV : public DMABufSu - - bool UpdateYUVData(void** aPixelData, int* aLineSizes); - bool UpdateYUVData(const VADRMPRIMESurfaceDescriptor& aDesc, int aWidth, -- int aHeight); -+ int aHeight, bool aCopy); - - bool VerifyTextureCreation(); - -@@ -332,9 +332,18 @@ class DMABufSurfaceYUV : public DMABufSu - - bool Create(const mozilla::layers::SurfaceDescriptor& aDesc); - bool Create(int aWidth, int aHeight, void** aPixelData, int* aLineSizes); -- bool CreateYUVPlane(int aPlane, int aWidth, int aHeight, int aDrmFormat); -+ bool CreateYUVPlane(int aPlane); -+ bool CreateLinearYUVPlane(int aPlane, int aWidth, int aHeight, -+ int aDrmFormat); - void UpdateYUVPlane(int aPlane, void* aPixelData, int aLineSize); - -+ bool MoveYUVDataImpl(const VADRMPRIMESurfaceDescriptor& aDesc, int aWidth, -+ int aHeight); -+ bool CopyYUVDataImpl(const VADRMPRIMESurfaceDescriptor& aDesc, int aWidth, -+ int aHeight); -+ -+ bool ImportPRIMESurfaceDescriptor(const VADRMPRIMESurfaceDescriptor& aDesc, -+ int aWidth, int aHeight); - bool ImportSurfaceDescriptor( - const mozilla::layers::SurfaceDescriptorDMABuf& aDesc); - -diff -up firefox-109.0/widget/gtk/GfxInfo.cpp.1809162 firefox-109.0/widget/gtk/GfxInfo.cpp ---- firefox-109.0/widget/gtk/GfxInfo.cpp.1809162 2023-01-17 14:34:01.724413908 +0100 -+++ firefox-109.0/widget/gtk/GfxInfo.cpp 2023-01-17 14:34:01.740414450 +0100 -@@ -887,6 +887,40 @@ const nsTArray& GfxInfo:: - V(0, 0, 0, 0), "FEATURE_HARDWARE_VIDEO_DECODING_NO_LINUX_AMD", ""); - - //////////////////////////////////// -+ // FEATURE_HW_DECODED_VIDEO_ZERO_COPY -+ APPEND_TO_DRIVER_BLOCKLIST_EXT( -+ OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, -+ DesktopEnvironment::All, WindowProtocol::All, DriverVendor::MesaAll, -+ DeviceFamily::All, nsIGfxInfo::FEATURE_HW_DECODED_VIDEO_ZERO_COPY, -+ nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN, -+ V(21, 0, 0, 0), "FEATURE_HW_DECODED_VIDEO_ZERO_COPY", "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_HW_DECODED_VIDEO_ZERO_COPY, -+ nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED, -+ V(0, 0, 0, 0), "FEATURE_HW_DECODED_VIDEO_ZERO_COPY_NO_LINUX_NVIDIA", -+ ""); -+ -+ // Disable on all AMD devices (Bug 1802844) -+ APPEND_TO_DRIVER_BLOCKLIST_EXT( -+ OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, -+ DesktopEnvironment::All, WindowProtocol::All, DriverVendor::All, -+ DeviceFamily::AtiAll, nsIGfxInfo::FEATURE_HW_DECODED_VIDEO_ZERO_COPY, -+ nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED, -+ V(0, 0, 0, 0), "FEATURE_HW_DECODED_VIDEO_ZERO_COPY_NO_LINUX_AMD", ""); -+ -+ // As FEATURE_HW_DECODED_VIDEO_ZERO_COPY is allow listed feature -+ // we need to explicitly enable it on all Intel hardware. -+ APPEND_TO_DRIVER_BLOCKLIST2(OperatingSystem::Linux, DeviceFamily::IntelAll, -+ nsIGfxInfo::FEATURE_HW_DECODED_VIDEO_ZERO_COPY, -+ nsIGfxInfo::FEATURE_ALLOW_ALWAYS, -+ DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0), -+ "FEATURE_ROLLOUT_ALL"); -+ -+ //////////////////////////////////// - // FEATURE_WEBRENDER_PARTIAL_PRESENT - APPEND_TO_DRIVER_BLOCKLIST_EXT( - OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, From f2d423870e87bacc15103840bb938c86fea14698 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 1 Feb 2023 21:31:08 +0100 Subject: [PATCH 173/545] Updated to 109.0.1, Added fix for rhbz#2147344 / mzbz#1813500. --- .gitignore | 2 + firefox.spec | 12 ++++-- mozilla-1813500.patch | 94 +++++++++++++++++++++++++++++++++++++++++++ sources | 2 + 4 files changed, 107 insertions(+), 3 deletions(-) create mode 100644 mozilla-1813500.patch diff --git a/.gitignore b/.gitignore index b9d0233..8e5b802 100644 --- a/.gitignore +++ b/.gitignore @@ -555,3 +555,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-108.0.2-20230112.tar.xz /firefox-109.0.source.tar.xz /firefox-langpacks-109.0-20230111.tar.xz +/firefox-109.0.1.source.tar.xz +/firefox-langpacks-109.0.1-20230201.tar.xz diff --git a/firefox.spec b/firefox.spec index fc61f0d..69bd9e3 100644 --- a/firefox.spec +++ b/firefox.spec @@ -172,13 +172,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 109.0 -Release: 4%{?pre_tag}%{?dist} +Version: 109.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230111.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230201.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -251,6 +251,7 @@ Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch Patch416: D164651.diff Patch417: D166324.diff +Patch418: mozilla-1813500.patch # PGO/LTO patches Patch600: pgo.patch @@ -527,6 +528,7 @@ This package contains results of tests executed during build. %patch415 -p1 -b .1670333 %patch416 -p1 -b .D164651 %patch417 -p1 -b .D166324 +%patch418 -p1 -b .1813500 # PGO patches %if %{build_with_pgo} @@ -1080,6 +1082,10 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Feb 1 2023 Martin Stransky - 109.0.1-1 +- Updated to 109.0.1 +- Added fix for rhbz#2147344 / mzbz#1813500. + * Thu Jan 19 2023 Martin Stransky - 109.0-4 - Removed mozbz#1809162 diff --git a/mozilla-1813500.patch b/mozilla-1813500.patch new file mode 100644 index 0000000..565d27d --- /dev/null +++ b/mozilla-1813500.patch @@ -0,0 +1,94 @@ +changeset: 651243:ff57728124c6 +tag: tip +parent: 651233:dd0fdd1daa69 +user: stransky +date: Tue Jan 31 15:53:38 2023 +0100 +files: widget/gtk/GfxInfo.cpp +description: +Bug 1813500 [Linux] Don't hang Firefox when glxtest process hangs r?emilio,rmader + +Differential Revision: https://phabricator.services.mozilla.com/D168385 + + +diff --git a/widget/gtk/GfxInfo.cpp b/widget/gtk/GfxInfo.cpp +--- a/widget/gtk/GfxInfo.cpp ++++ b/widget/gtk/GfxInfo.cpp +@@ -11,6 +11,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -29,6 +30,9 @@ + #include "WidgetUtilsGtk.h" + #include "MediaCodecsSupport.h" + ++// How long we wait for data from glxtest process in milliseconds. ++#define GLXTEST_TIMEOUT 4000 ++ + #define EXIT_STATUS_BUFFER_TOO_SMALL 2 + #ifdef DEBUG + bool fire_glxtest_process(); +@@ -99,12 +103,28 @@ void GfxInfo::GetData() { + // information in a separate process to protect against bad drivers. + + // if glxtest_pipe == -1, that means that we already read the information +- if (glxtest_pipe == -1) return; ++ if (glxtest_pipe == -1) { ++ return; ++ } ++ ++ const TimeStamp deadline = ++ TimeStamp::Now() + TimeDuration::FromMilliseconds(GLXTEST_TIMEOUT); + + enum { buf_size = 2048 }; + char buf[buf_size]; +- ssize_t bytesread = read(glxtest_pipe, &buf, +- buf_size - 1); // -1 because we'll append a zero ++ ssize_t bytesread = 0; ++ ++ struct pollfd pfd {}; ++ pfd.fd = glxtest_pipe; ++ pfd.events = POLLIN; ++ auto ret = poll(&pfd, 1, GLXTEST_TIMEOUT); ++ if (ret <= 0) { ++ gfxCriticalNote << "glxtest: failed to read data from glxtest, we may " ++ "fallback to software rendering\n"; ++ } else { ++ // -1 because we'll append a zero ++ bytesread = read(glxtest_pipe, &buf, buf_size - 1); ++ } + close(glxtest_pipe); + glxtest_pipe = -1; + +@@ -129,9 +149,9 @@ void GfxInfo::GetData() { + int waitpid_errno = 0; + while (wait_for_glxtest_process) { + wait_for_glxtest_process = false; +- if (waitpid(glxtest_pid, &glxtest_status, 0) == -1) { ++ if (waitpid(glxtest_pid, &glxtest_status, WNOHANG) == -1) { + waitpid_errno = errno; +- if (waitpid_errno == EINTR) { ++ if (waitpid_errno == EAGAIN || waitpid_errno == EINTR) { + wait_for_glxtest_process = true; + } else { + // Bug 718629 +@@ -142,6 +162,15 @@ void GfxInfo::GetData() { + waiting_for_glxtest_process_failed = (waitpid_errno != ECHILD); + } + } ++ if (wait_for_glxtest_process) { ++ if (TimeStamp::Now() > deadline) { ++ gfxCriticalNote << "glxtest: glxtest process hangs\n"; ++ waiting_for_glxtest_process_failed = true; ++ break; ++ } ++ // Wait 100ms to another waitpid() check. ++ usleep(100000); ++ } + } + + int exit_code = EXIT_FAILURE; + diff --git a/sources b/sources index fcf64d5..96ba157 100644 --- a/sources +++ b/sources @@ -2,3 +2,5 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2 SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 SHA512 (firefox-langpacks-109.0-20230111.tar.xz) = 8a07111d28ae40a4761ffec839b51cb391291befd45adc18bbd6e20ded1e89aedbe69ae54f47aaf354cdd70f92d22833cf254ec1405930c9cd6d785e9d5c0daf SHA512 (firefox-109.0.source.tar.xz) = 9e2b6e20353e414da3d2eb9dcd3d77757664a98a4438a8e84f19a1c7c203e40136b08bf96a458fac05ddc627347217d32f1f6337980c5ca918874993657a58e7 +SHA512 (firefox-109.0.1.source.tar.xz) = 58b21449a16a794152888f50e7fe9488c28739a7e067729acdc1de9f2e8384e6316cffdfe89f690f0d211189668d940825b4f8a26b8100468ae120772df99d72 +SHA512 (firefox-langpacks-109.0.1-20230201.tar.xz) = d8497c53466650d06db44382b6e8a1ac337205c820f67b9a635a7ecc7001eaa4b9391de3f7e88e2f3602510150c54e128723915366438c296f7e15e729f87fb2 From 5bddf2e064bb7fe0541e27a578f42bd4ff40e617 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 2 Feb 2023 08:58:33 +0100 Subject: [PATCH 174/545] removed unused patch --- D164651.diff | 18 ------------------ firefox.spec | 2 -- sources | 2 -- 3 files changed, 22 deletions(-) delete mode 100644 D164651.diff diff --git a/D164651.diff b/D164651.diff deleted file mode 100644 index aaae3e9..0000000 --- a/D164651.diff +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/widget/gtk/MozContainerWayland.cpp b/widget/gtk/MozContainerWayland.cpp ---- a/widget/gtk/MozContainerWayland.cpp -+++ b/widget/gtk/MozContainerWayland.cpp -@@ -702,10 +702,13 @@ - - bool moz_container_wayland_egl_window_needs_size_update(MozContainer* container, - nsIntSize aSize, - int aScale) { - MozContainerWayland* wl_container = &container->wl_container; -+ if (!wl_container->eglwindow) { -+ return false; -+ } - if (wl_container->buffer_scale != aScale) { - return true; - } - nsIntSize recentSize; - wl_egl_window_get_attached_size(wl_container->eglwindow, &recentSize.width, - diff --git a/firefox.spec b/firefox.spec index 69bd9e3..24bc1d5 100644 --- a/firefox.spec +++ b/firefox.spec @@ -249,7 +249,6 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch -Patch416: D164651.diff Patch417: D166324.diff Patch418: mozilla-1813500.patch @@ -526,7 +525,6 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 -%patch416 -p1 -b .D164651 %patch417 -p1 -b .D166324 %patch418 -p1 -b .1813500 diff --git a/sources b/sources index 96ba157..6fc963d 100644 --- a/sources +++ b/sources @@ -1,6 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 -SHA512 (firefox-langpacks-109.0-20230111.tar.xz) = 8a07111d28ae40a4761ffec839b51cb391291befd45adc18bbd6e20ded1e89aedbe69ae54f47aaf354cdd70f92d22833cf254ec1405930c9cd6d785e9d5c0daf -SHA512 (firefox-109.0.source.tar.xz) = 9e2b6e20353e414da3d2eb9dcd3d77757664a98a4438a8e84f19a1c7c203e40136b08bf96a458fac05ddc627347217d32f1f6337980c5ca918874993657a58e7 SHA512 (firefox-109.0.1.source.tar.xz) = 58b21449a16a794152888f50e7fe9488c28739a7e067729acdc1de9f2e8384e6316cffdfe89f690f0d211189668d940825b4f8a26b8100468ae120772df99d72 SHA512 (firefox-langpacks-109.0.1-20230201.tar.xz) = d8497c53466650d06db44382b6e8a1ac337205c820f67b9a635a7ecc7001eaa4b9391de3f7e88e2f3602510150c54e128723915366438c296f7e15e729f87fb2 From ee371f01de59af53376e83f1cbc1b63ec90bb2ac Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 7 Feb 2023 11:52:32 +0100 Subject: [PATCH 175/545] Rawhide/GCC 13 build fixes --- firefox-gcc-13-build.patch | 24 ++++++++++++++++++++++++ firefox.spec | 7 ++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 firefox-gcc-13-build.patch diff --git a/firefox-gcc-13-build.patch b/firefox-gcc-13-build.patch new file mode 100644 index 0000000..8512b76 --- /dev/null +++ b/firefox-gcc-13-build.patch @@ -0,0 +1,24 @@ +--- firefox-109.0.1/gfx/2d/Rect.h.old 2023-02-07 09:44:24.946279843 +0100 ++++ firefox-109.0.1/gfx/2d/Rect.h 2023-02-07 09:44:47.969032049 +0100 +@@ -324,8 +324,8 @@ IntRectTyped RoundedToInt(const R + + template + bool RectIsInt32Safe(const RectTyped& aRect) { +- float min = (float)std::numeric_limits::min(); +- float max = (float)std::numeric_limits::max(); ++ float min = (float)std::numeric_limits::min(); ++ float max = (float)std::numeric_limits::max(); + return aRect.x > min && aRect.y > min && aRect.width < max && + aRect.height < max && aRect.XMost() < max && aRect.YMost() < max; + } +diff -up firefox-109.0.1/toolkit/components/telemetry/pingsender/pingsender.cpp.old firefox-109.0.1/toolkit/components/telemetry/pingsender/pingsender.cpp +--- firefox-109.0.1/toolkit/components/telemetry/pingsender/pingsender.cpp.old 2023-02-07 11:03:41.788720090 +0100 ++++ firefox-109.0.1/toolkit/components/telemetry/pingsender/pingsender.cpp 2023-02-07 11:04:29.195345659 +0100 +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + #include + diff --git a/firefox.spec b/firefox.spec index 24bc1d5..4a8d830 100644 --- a/firefox.spec +++ b/firefox.spec @@ -173,7 +173,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 109.0.1 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -225,6 +225,7 @@ Patch55: firefox-testing.patch Patch61: firefox-glibc-dynstack.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch78: firefox-i686-build.patch +Patch79: firefox-gcc-13-build.patch # Test patches # Generate without context by @@ -503,6 +504,7 @@ This package contains results of tests executed during build. %patch54 -p1 -b .1669639 %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch78 -p1 -b .firefox-i686 +%patch79 -p1 -b .firefox-gcc-13-build # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -1080,6 +1082,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Feb 7 2023 Martin Stransky - 109.0.1-2 +- Rawhide build fix + * Wed Feb 1 2023 Martin Stransky - 109.0.1-1 - Updated to 109.0.1 - Added fix for rhbz#2147344 / mzbz#1813500. From c5357ea592146a28b12bc91c7fd369109dca62ab Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 10 Feb 2023 11:33:03 +0100 Subject: [PATCH 176/545] Updated to 110.0 --- .gitignore | 2 ++ D166324.diff | 75 ---------------------------------------------------- D167194.diff | 19 +++++++++++++ firefox.spec | 13 +++++---- sources | 4 +-- 5 files changed, 31 insertions(+), 82 deletions(-) delete mode 100644 D166324.diff create mode 100644 D167194.diff diff --git a/.gitignore b/.gitignore index 8e5b802..f237494 100644 --- a/.gitignore +++ b/.gitignore @@ -557,3 +557,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-109.0-20230111.tar.xz /firefox-109.0.1.source.tar.xz /firefox-langpacks-109.0.1-20230201.tar.xz +/firefox-110.0.source.tar.xz +/firefox-langpacks-110.0-20230210.tar.xz diff --git a/D166324.diff b/D166324.diff deleted file mode 100644 index 00d234d..0000000 --- a/D166324.diff +++ /dev/null @@ -1,75 +0,0 @@ -diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h ---- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h -+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h -@@ -175,11 +175,10 @@ - - PtsCorrectionContext mPtsContext; - - DurationMap mDurationMap; - const bool mLowLatency; -- AVDiscard mFrameDrop = AVDISCARD_DEFAULT; - const Maybe mTrackingId; - PerformanceRecorderMulti mPerformanceRecorder; - - // True if we're allocating shmem for ffmpeg decode buffer. - Maybe> mIsUsingShmemBufferForDecode; -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 -@@ -850,17 +850,10 @@ - packet.dts = aSample->mTimecode.ToMicroseconds(); - packet.pts = aSample->mTime.ToMicroseconds(); - packet.flags = aSample->mKeyframe ? AV_PKT_FLAG_KEY : 0; - packet.pos = aSample->mOffset; - -- mCodecContext->skip_frame = mFrameDrop; --#if MOZ_LOGGING -- if (mFrameDrop == AVDISCARD_NONREF) { -- FFMPEG_LOG("Frame skip AVDISCARD_NONREF"); -- } --#endif -- - mTrackingId.apply([&](const auto& aId) { - MediaInfoFlag flag = MediaInfoFlag::None; - flag |= (aSample->mKeyframe ? MediaInfoFlag::KeyFrame - : MediaInfoFlag::NonKeyFrame); - flag |= (IsHardwareAccelerated() ? MediaInfoFlag::HardwareDecoding -@@ -943,22 +936,10 @@ - return MediaResult( - NS_ERROR_DOM_MEDIA_DECODE_ERR, - RESULT_DETAIL("avcodec_receive_frame error: %s", errStr)); - } - -- if (mFrameDrop == AVDISCARD_NONREF) { -- FFMPEG_LOG("Requested pts %" PRId64 " decoded frame pts %" PRId64, -- packet.pts, GetFramePts(mFrame) + mFrame->pkt_duration); -- // Switch back to default frame skip policy if we hit correct -- // decode times. 5 ms treshold is taken from mpv project which -- // use similar approach after seek (feed_packet() at f_decoder_wrapper.c). -- if (packet.pts - 5000 <= GetFramePts(mFrame) + mFrame->pkt_duration) { -- FFMPEG_LOG("Set frame drop to AVDISCARD_DEFAULT."); -- mFrameDrop = AVDISCARD_DEFAULT; -- } -- } -- - UpdateDecodeTimes(decodeStart); - decodeStart = TimeStamp::Now(); - - MediaResult rv; - # ifdef MOZ_WAYLAND_USE_VAAPI -@@ -1366,14 +1347,10 @@ - FFMPEG_LOG("ProcessFlush()"); - MOZ_ASSERT(mTaskQueue->IsOnCurrentThread()); - mPtsContext.Reset(); - mDurationMap.Clear(); - mPerformanceRecorder.Record(std::numeric_limits::max()); -- // Discard non-ref frames on HW accelerated backend to avoid decode artifacts. -- if (IsHardwareAccelerated()) { -- mFrameDrop = AVDISCARD_NONREF; -- } - return FFmpegDataDecoder::ProcessFlush(); - } - - AVCodecID FFmpegVideoDecoder::GetCodecId( - const nsACString& aMimeType) { - diff --git a/D167194.diff b/D167194.diff new file mode 100644 index 0000000..2bb764e --- /dev/null +++ b/D167194.diff @@ -0,0 +1,19 @@ +diff --git a/js/src/irregexp/moz.build b/js/src/irregexp/moz.build +--- a/js/src/irregexp/moz.build ++++ b/js/src/irregexp/moz.build +@@ -12,10 +12,14 @@ + include("../js-config.mozbuild") + include("../js-cxxflags.mozbuild") + + CXXFLAGS += ["-Wno-error=type-limits", "-Wno-error=return-type"] + ++# Suppress spurious warnings in third-party code. See bug 1810584. ++if CONFIG["CC_TYPE"] == "gcc": ++ CXXFLAGS += ["-Wno-error=nonnull"] ++ + UNIFIED_SOURCES += [ + "imported/regexp-bytecode-generator.cc", + "imported/regexp-bytecode-peephole.cc", + "imported/regexp-bytecodes.cc", + "imported/regexp-compiler-tonode.cc", + diff --git a/firefox.spec b/firefox.spec index 4a8d830..c9ad2dd 100644 --- a/firefox.spec +++ b/firefox.spec @@ -172,13 +172,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 109.0.1 -Release: 2%{?pre_tag}%{?dist} +Version: 110.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230201.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230210.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -226,6 +226,7 @@ Patch61: firefox-glibc-dynstack.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch78: firefox-i686-build.patch Patch79: firefox-gcc-13-build.patch +Patch80: D167194.diff # Test patches # Generate without context by @@ -250,7 +251,6 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch -Patch417: D166324.diff Patch418: mozilla-1813500.patch # PGO/LTO patches @@ -505,6 +505,7 @@ This package contains results of tests executed during build. %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch78 -p1 -b .firefox-i686 %patch79 -p1 -b .firefox-gcc-13-build +%patch80 -p1 -b .D167194 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -527,7 +528,6 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 -%patch417 -p1 -b .D166324 %patch418 -p1 -b .1813500 # PGO patches @@ -1082,6 +1082,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Feb 9 2023 Martin Stransky - 110.0-1 +- Updated to 110.0 + * Tue Feb 7 2023 Martin Stransky - 109.0.1-2 - Rawhide build fix diff --git a/sources b/sources index 6fc963d..3d80ed0 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 -SHA512 (firefox-109.0.1.source.tar.xz) = 58b21449a16a794152888f50e7fe9488c28739a7e067729acdc1de9f2e8384e6316cffdfe89f690f0d211189668d940825b4f8a26b8100468ae120772df99d72 -SHA512 (firefox-langpacks-109.0.1-20230201.tar.xz) = d8497c53466650d06db44382b6e8a1ac337205c820f67b9a635a7ecc7001eaa4b9391de3f7e88e2f3602510150c54e128723915366438c296f7e15e729f87fb2 +SHA512 (firefox-110.0.source.tar.xz) = a5f0642b7efe36f4be7cf70fb4f29785569ced39076359730a86670e4703bb4c7a6ec1358aa6b4b75f91b5770e1c05d586e4fb7200be72ce3a592ffd17b32945 +SHA512 (firefox-langpacks-110.0-20230210.tar.xz) = 081b96ebfa64ef020b577b3a469e63292b0c62c1da97a7d7c1a4f9689a7a1841a8e53e64f22d690f1193ba9b8e14c0b59bf9575f042e9c5e0fdc88776d8cedaa From 13c22b1d0b3386430dafd98207ed635b999c67c8 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 13 Feb 2023 09:07:01 +0100 Subject: [PATCH 177/545] Added fix for orca --- D169197.diff | 23 +++++++++++++++++++++++ firefox.spec | 7 ++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 D169197.diff diff --git a/D169197.diff b/D169197.diff new file mode 100644 index 0000000..7b51ca4 --- /dev/null +++ b/D169197.diff @@ -0,0 +1,23 @@ +diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp +--- a/widget/gtk/nsWindow.cpp ++++ b/widget/gtk/nsWindow.cpp +@@ -654,10 +654,18 @@ + if (window == this) { + sStoredLeaveNotifyEvent = nullptr; + } + } + ++ // We need to detach accessible object here because mContainer is a custom ++ // widget and doesn't call gtk_widget_real_destroy() from destroy handler ++ // as regular widgets. ++ AtkObject* ac = gtk_widget_get_accessible(GTK_WIDGET(mContainer)); ++ if (ac) { ++ gtk_accessible_set_widget(GTK_ACCESSIBLE(ac), nullptr); ++ } ++ + gtk_widget_destroy(mShell); + mShell = nullptr; + mContainer = nullptr; + + MOZ_ASSERT(!mGdkWindow, + diff --git a/firefox.spec b/firefox.spec index c9ad2dd..f0506e6 100644 --- a/firefox.spec +++ b/firefox.spec @@ -173,7 +173,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 110.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -227,6 +227,7 @@ Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch78: firefox-i686-build.patch Patch79: firefox-gcc-13-build.patch Patch80: D167194.diff +Patch81: D169197.diff # Test patches # Generate without context by @@ -506,6 +507,7 @@ This package contains results of tests executed during build. %patch78 -p1 -b .firefox-i686 %patch79 -p1 -b .firefox-gcc-13-build %patch80 -p1 -b .D167194 +%patch81 -p1 -b .D169197 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -1082,6 +1084,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Feb 13 2023 Martin Stransky - 110.0-2 +- Added fix for orca + * Thu Feb 9 2023 Martin Stransky - 110.0-1 - Updated to 110.0 From b5fde26b8f3ffc4df831b3bed1cea084852c448d Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 14 Feb 2023 11:07:07 +0100 Subject: [PATCH 178/545] Updated to latest 110.0 upstream build --- .gitignore | 1 + firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index f237494..d50931b 100644 --- a/.gitignore +++ b/.gitignore @@ -559,3 +559,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-109.0.1-20230201.tar.xz /firefox-110.0.source.tar.xz /firefox-langpacks-110.0-20230210.tar.xz +/firefox-langpacks-110.0-20230214.tar.xz diff --git a/firefox.spec b/firefox.spec index f0506e6..ef20f25 100644 --- a/firefox.spec +++ b/firefox.spec @@ -173,12 +173,12 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 110.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230210.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230214.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1084,6 +1084,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Feb 14 2023 Martin Stransky - 110.0-3 +- Updated to 110.0 build 3 + * Mon Feb 13 2023 Martin Stransky - 110.0-2 - Added fix for orca diff --git a/sources b/sources index 3d80ed0..110b172 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 -SHA512 (firefox-110.0.source.tar.xz) = a5f0642b7efe36f4be7cf70fb4f29785569ced39076359730a86670e4703bb4c7a6ec1358aa6b4b75f91b5770e1c05d586e4fb7200be72ce3a592ffd17b32945 -SHA512 (firefox-langpacks-110.0-20230210.tar.xz) = 081b96ebfa64ef020b577b3a469e63292b0c62c1da97a7d7c1a4f9689a7a1841a8e53e64f22d690f1193ba9b8e14c0b59bf9575f042e9c5e0fdc88776d8cedaa +SHA512 (firefox-110.0.source.tar.xz) = 52a37a8f59a694c4790c0a14cd81fba9e2c982f64e00191afd0897c39ae1d5e25f24cff16f74d0a0b5cdf8e93a9a0974b6042b0de605cf1a533ef4e6a3c0dcf9 +SHA512 (firefox-langpacks-110.0-20230214.tar.xz) = 63b8a4428674393cd1d0742708c7c300e9a85d6b294f8fb281b773373db5735208f8d27df7fe769ddba259743f76502e0bf20e953736ebc78a9b3178afa5ecf7 From e8035fe0a1f249b6dd13693670d8bbe5a043f54a Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 20 Mar 2023 15:02:19 +0100 Subject: [PATCH 179/545] Updated to 111.0 --- .gitignore | 2 + D167194.diff | 19 - D168799.diff | 93 + D169197.diff | 23 - firefox.spec | 29 +- libwebrtc-screen-cast-sync.patch | 5784 ------------------------------ mozilla-1170092.patch | 99 - mozilla-1813500.patch | 94 - sources | 4 +- 9 files changed, 106 insertions(+), 6041 deletions(-) delete mode 100644 D167194.diff create mode 100644 D168799.diff delete mode 100644 D169197.diff delete mode 100644 libwebrtc-screen-cast-sync.patch delete mode 100644 mozilla-1170092.patch delete mode 100644 mozilla-1813500.patch diff --git a/.gitignore b/.gitignore index d50931b..8787abe 100644 --- a/.gitignore +++ b/.gitignore @@ -560,3 +560,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-110.0.source.tar.xz /firefox-langpacks-110.0-20230210.tar.xz /firefox-langpacks-110.0-20230214.tar.xz +/firefox-111.0.source.tar.xz +/firefox-langpacks-111.0-20230320.tar.xz diff --git a/D167194.diff b/D167194.diff deleted file mode 100644 index 2bb764e..0000000 --- a/D167194.diff +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/js/src/irregexp/moz.build b/js/src/irregexp/moz.build ---- a/js/src/irregexp/moz.build -+++ b/js/src/irregexp/moz.build -@@ -12,10 +12,14 @@ - include("../js-config.mozbuild") - include("../js-cxxflags.mozbuild") - - CXXFLAGS += ["-Wno-error=type-limits", "-Wno-error=return-type"] - -+# Suppress spurious warnings in third-party code. See bug 1810584. -+if CONFIG["CC_TYPE"] == "gcc": -+ CXXFLAGS += ["-Wno-error=nonnull"] -+ - UNIFIED_SOURCES += [ - "imported/regexp-bytecode-generator.cc", - "imported/regexp-bytecode-peephole.cc", - "imported/regexp-bytecodes.cc", - "imported/regexp-compiler-tonode.cc", - diff --git a/D168799.diff b/D168799.diff new file mode 100644 index 0000000..40dc3b4 --- /dev/null +++ b/D168799.diff @@ -0,0 +1,93 @@ +diff --git a/extensions/pref/autoconfig/test/unit/test_autoconfig_custom_path.js b/extensions/pref/autoconfig/test/unit/test_autoconfig_custom_path.js +--- a/extensions/pref/autoconfig/test/unit/test_autoconfig_custom_path.js ++++ b/extensions/pref/autoconfig/test/unit/test_autoconfig_custom_path.js +@@ -9,10 +9,13 @@ + let testDirName = do_get_cwd().clone(); + Services.env.set("MOZ_SYSTEM_CONFIG_DIR", testDirName.path); + + updateAppInfo(); + ++ try { ++ Services.dirsvc.undefine("SysConfD"); ++ } catch (e) {} + let customSysConfD = Services.dirsvc.get("SysConfD", Ci.nsIFile); + let parent = customSysConfD.parent; + let child = customSysConfD.leafName; + notEqual("/etc", parent.path, "SysConfD is not in /etc"); + equal("xpcshell", child, "SysConfD is xpcshell"); +diff --git a/extensions/pref/autoconfig/test/unit/test_autoconfig_default_path.js b/extensions/pref/autoconfig/test/unit/test_autoconfig_default_path.js +--- a/extensions/pref/autoconfig/test/unit/test_autoconfig_default_path.js ++++ b/extensions/pref/autoconfig/test/unit/test_autoconfig_default_path.js +@@ -6,8 +6,11 @@ + ); + + function run_test() { + updateAppInfo(); + ++ try { ++ Services.dirsvc.undefine("SysConfD"); ++ } catch (e) {} + let defaultSysConfD = Services.dirsvc.get("SysConfD", Ci.nsIFile); + equal("/etc/xpcshell", defaultSysConfD.path, "SysConfD is in /etc"); + } +diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp +--- a/modules/libpref/Preferences.cpp ++++ b/modules/libpref/Preferences.cpp +@@ -4917,27 +4917,10 @@ + ArrayLength(specialFiles)); + if (NS_FAILED(rv)) { + NS_WARNING("Error parsing application default preferences."); + } + +-#if defined(MOZ_WIDGET_GTK) +- // Under Flatpak/Snap package, load /etc/firefox/defaults/pref/*.js. +- if (mozilla::widget::IsRunningUnderFlatpakOrSnap()) { +- nsCOMPtr defaultSnapPrefDir; +- rv = NS_GetSpecialDirectory(NS_OS_SYSTEM_CONFIG_DIR, +- getter_AddRefs(defaultSnapPrefDir)); +- NS_ENSURE_SUCCESS(rv, rv); +- defaultSnapPrefDir->AppendNative("defaults"_ns); +- defaultSnapPrefDir->AppendNative("pref"_ns); +- +- rv = pref_LoadPrefsInDir(defaultSnapPrefDir, nullptr, 0); +- if (NS_FAILED(rv)) { +- NS_WARNING("Error parsing application default preferences under Snap."); +- } +- } +-#endif +- + // Load jar:$app/omni.jar!/defaults/preferences/*.js + // or jar:$gre/omni.jar!/defaults/preferences/*.js. + RefPtr appJarReader = Omnijar::GetReader(Omnijar::APP); + + // GetReader(Omnijar::APP) returns null when `$app == $gre`, in +@@ -5006,10 +4989,28 @@ + // Do we care if a file provided by this process fails to load? + pref_LoadPrefsInDir(path, nullptr, 0); + } + } + ++#if defined(MOZ_WIDGET_GTK) ++ // To ensure the system-wide preferences are not overwritten by ++ // firefox/browser/defauts/preferences/*.js we need to load ++ // the /etc/firefox/defaults/pref/*.js settings as last. ++ // Under Flatpak, the NS_OS_SYSTEM_CONFIG_DIR points to /app/etc/firefox ++ nsCOMPtr defaultSystemPrefDir; ++ rv = NS_GetSpecialDirectory(NS_OS_SYSTEM_CONFIG_DIR, ++ getter_AddRefs(defaultSystemPrefDir)); ++ NS_ENSURE_SUCCESS(rv, rv); ++ defaultSystemPrefDir->AppendNative("defaults"_ns); ++ defaultSystemPrefDir->AppendNative("pref"_ns); ++ ++ rv = pref_LoadPrefsInDir(defaultSystemPrefDir, nullptr, 0); ++ if (NS_FAILED(rv)) { ++ NS_WARNING("Error parsing application default preferences."); ++ } ++#endif ++ + if (XRE_IsParentProcess()) { + SetupTelemetryPref(); + } + + if (aIsStartup) { + diff --git a/D169197.diff b/D169197.diff deleted file mode 100644 index 7b51ca4..0000000 --- a/D169197.diff +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp ---- a/widget/gtk/nsWindow.cpp -+++ b/widget/gtk/nsWindow.cpp -@@ -654,10 +654,18 @@ - if (window == this) { - sStoredLeaveNotifyEvent = nullptr; - } - } - -+ // We need to detach accessible object here because mContainer is a custom -+ // widget and doesn't call gtk_widget_real_destroy() from destroy handler -+ // as regular widgets. -+ AtkObject* ac = gtk_widget_get_accessible(GTK_WIDGET(mContainer)); -+ if (ac) { -+ gtk_accessible_set_widget(GTK_ACCESSIBLE(ac), nullptr); -+ } -+ - gtk_widget_destroy(mShell); - mShell = nullptr; - mContainer = nullptr; - - MOZ_ASSERT(!mGdkWindow, - diff --git a/firefox.spec b/firefox.spec index ef20f25..294e98d 100644 --- a/firefox.spec +++ b/firefox.spec @@ -125,7 +125,7 @@ ExcludeArch: i686 %if %{?system_nss} %global nspr_version 4.32 %global nspr_build_version %{nspr_version} -%global nss_version 3.86 +%global nss_version 3.88 %global nss_build_version %{nss_version} %endif @@ -172,13 +172,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 110.0 -Release: 3%{?pre_tag}%{?dist} +Version: 111.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230214.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230320.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -226,8 +226,6 @@ Patch61: firefox-glibc-dynstack.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch78: firefox-i686-build.patch Patch79: firefox-gcc-13-build.patch -Patch80: D167194.diff -Patch81: D169197.diff # Test patches # Generate without context by @@ -240,7 +238,7 @@ Patch102: firefox-tests-xpcshell-freeze.patch # Fedora specific patches Patch215: firefox-enable-addons.patch Patch219: rhbz-1173156.patch -Patch224: mozilla-1170092.patch +Patch224: D168799.diff #ARM run-time patch Patch226: rhbz-1354671.patch Patch228: disable-openh264-download.patch @@ -252,7 +250,6 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch -Patch418: mozilla-1813500.patch # PGO/LTO patches Patch600: pgo.patch @@ -261,9 +258,6 @@ Patch602: mozilla-1516803.patch # a patch for compiling with gcc on arm (from debian) Patch990: work-around-GCC-ICE-on-arm.patch -# Backported WebRTC changes for PipeWire/Wayland screen sharing support -Patch1000: libwebrtc-screen-cast-sync.patch - # Work around broken moz.build file on ppc64le (mozb#1779545, mozb#1775202) Patch1100: mozilla-1775202.patch @@ -506,8 +500,6 @@ This package contains results of tests executed during build. %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch78 -p1 -b .firefox-i686 %patch79 -p1 -b .firefox-gcc-13-build -%patch80 -p1 -b .D167194 -%patch81 -p1 -b .D169197 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -517,7 +509,7 @@ This package contains results of tests executed during build. # Fedora patches %patch215 -p1 -b .addons %patch219 -p1 -b .rhbz-1173156 -%patch224 -p1 -b .1170092 +%patch224 -p1 -b .D168799.diff #ARM run-time patch %ifarch aarch64 %patch226 -p1 -b .1354671 @@ -530,7 +522,6 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 -%patch418 -p1 -b .1813500 # PGO patches %if %{build_with_pgo} @@ -541,11 +532,6 @@ This package contains results of tests executed during build. %endif %patch990 -p1 -b .work-around-GCC-ICE-on-arm - -%ifnarch ppc64le %{arm} aarch64 -%patch1000 -p1 -b .libwebrtc-screen-cast-sync -%endif - %patch1100 -p1 -b .ppc-mobzuild rm -f .mozconfig @@ -1084,6 +1070,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Mar 20 2023 Martin Stransky - 111.0-1 +- Updated to 111.0 + * Tue Feb 14 2023 Martin Stransky - 110.0-3 - Updated to 110.0 build 3 diff --git a/libwebrtc-screen-cast-sync.patch b/libwebrtc-screen-cast-sync.patch deleted file mode 100644 index 5631b26..0000000 --- a/libwebrtc-screen-cast-sync.patch +++ /dev/null @@ -1,5784 +0,0 @@ -diff -up firefox-109.0/dom/media/webrtc/moz.build.libwebrtc-screen-cast-sync firefox-109.0/dom/media/webrtc/moz.build ---- firefox-109.0/dom/media/webrtc/moz.build.libwebrtc-screen-cast-sync 2023-01-09 20:34:10.000000000 +0100 -+++ firefox-109.0/dom/media/webrtc/moz.build 2023-01-12 15:16:09.192614055 +0100 -@@ -84,6 +84,8 @@ if CONFIG["MOZ_WEBRTC_SIGNALING"]: - ] - - if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": -+ DIRS += ["/third_party/drm/libdrm"] -+ DIRS += ["/third_party/gbm/libgbm"] - DIRS += ["/third_party/pipewire/libpipewire"] - - # Avoid warnings from third-party code that we can not modify. -diff -up firefox-109.0/third_party/drm/drm/drm_fourcc.h.libwebrtc-screen-cast-sync firefox-109.0/third_party/drm/drm/drm_fourcc.h ---- firefox-109.0/third_party/drm/drm/drm_fourcc.h.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.193614089 +0100 -+++ firefox-109.0/third_party/drm/drm/drm_fourcc.h 2023-01-12 15:16:09.193614089 +0100 -@@ -0,0 +1,1377 @@ -+/* -+ * Copyright 2011 Intel Corporation -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#ifndef DRM_FOURCC_H -+#define DRM_FOURCC_H -+ -+#include "drm.h" -+ -+#if defined(__cplusplus) -+extern "C" { -+#endif -+ -+/** -+ * DOC: overview -+ * -+ * In the DRM subsystem, framebuffer pixel formats are described using the -+ * fourcc codes defined in `include/uapi/drm/drm_fourcc.h`. In addition to the -+ * fourcc code, a Format Modifier may optionally be provided, in order to -+ * further describe the buffer's format - for example tiling or compression. -+ * -+ * Format Modifiers -+ * ---------------- -+ * -+ * Format modifiers are used in conjunction with a fourcc code, forming a -+ * unique fourcc:modifier pair. This format:modifier pair must fully define the -+ * format and data layout of the buffer, and should be the only way to describe -+ * that particular buffer. -+ * -+ * Having multiple fourcc:modifier pairs which describe the same layout should -+ * be avoided, as such aliases run the risk of different drivers exposing -+ * different names for the same data format, forcing userspace to understand -+ * that they are aliases. -+ * -+ * Format modifiers may change any property of the buffer, including the number -+ * of planes and/or the required allocation size. Format modifiers are -+ * vendor-namespaced, and as such the relationship between a fourcc code and a -+ * modifier is specific to the modifer being used. For example, some modifiers -+ * may preserve meaning - such as number of planes - from the fourcc code, -+ * whereas others may not. -+ * -+ * Modifiers must uniquely encode buffer layout. In other words, a buffer must -+ * match only a single modifier. A modifier must not be a subset of layouts of -+ * another modifier. For instance, it's incorrect to encode pitch alignment in -+ * a modifier: a buffer may match a 64-pixel aligned modifier and a 32-pixel -+ * aligned modifier. That said, modifiers can have implicit minimal -+ * requirements. -+ * -+ * For modifiers where the combination of fourcc code and modifier can alias, -+ * a canonical pair needs to be defined and used by all drivers. Preferred -+ * combinations are also encouraged where all combinations might lead to -+ * confusion and unnecessarily reduced interoperability. An example for the -+ * latter is AFBC, where the ABGR layouts are preferred over ARGB layouts. -+ * -+ * There are two kinds of modifier users: -+ * -+ * - Kernel and user-space drivers: for drivers it's important that modifiers -+ * don't alias, otherwise two drivers might support the same format but use -+ * different aliases, preventing them from sharing buffers in an efficient -+ * format. -+ * - Higher-level programs interfacing with KMS/GBM/EGL/Vulkan/etc: these users -+ * see modifiers as opaque tokens they can check for equality and intersect. -+ * These users musn't need to know to reason about the modifier value -+ * (i.e. they are not expected to extract information out of the modifier). -+ * -+ * Vendors should document their modifier usage in as much detail as -+ * possible, to ensure maximum compatibility across devices, drivers and -+ * applications. -+ * -+ * The authoritative list of format modifier codes is found in -+ * `include/uapi/drm/drm_fourcc.h` -+ */ -+ -+#define fourcc_code(a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \ -+ ((__u32)(c) << 16) | ((__u32)(d) << 24)) -+ -+#define DRM_FORMAT_BIG_ENDIAN (1U<<31) /* format is big endian instead of little endian */ -+ -+/* Reserve 0 for the invalid format specifier */ -+#define DRM_FORMAT_INVALID 0 -+ -+/* color index */ -+#define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ') /* [7:0] C */ -+ -+/* 8 bpp Red */ -+#define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ') /* [7:0] R */ -+ -+/* 10 bpp Red */ -+#define DRM_FORMAT_R10 fourcc_code('R', '1', '0', ' ') /* [15:0] x:R 6:10 little endian */ -+ -+/* 12 bpp Red */ -+#define DRM_FORMAT_R12 fourcc_code('R', '1', '2', ' ') /* [15:0] x:R 4:12 little endian */ -+ -+/* 16 bpp Red */ -+#define DRM_FORMAT_R16 fourcc_code('R', '1', '6', ' ') /* [15:0] R little endian */ -+ -+/* 16 bpp RG */ -+#define DRM_FORMAT_RG88 fourcc_code('R', 'G', '8', '8') /* [15:0] R:G 8:8 little endian */ -+#define DRM_FORMAT_GR88 fourcc_code('G', 'R', '8', '8') /* [15:0] G:R 8:8 little endian */ -+ -+/* 32 bpp RG */ -+#define DRM_FORMAT_RG1616 fourcc_code('R', 'G', '3', '2') /* [31:0] R:G 16:16 little endian */ -+#define DRM_FORMAT_GR1616 fourcc_code('G', 'R', '3', '2') /* [31:0] G:R 16:16 little endian */ -+ -+/* 8 bpp RGB */ -+#define DRM_FORMAT_RGB332 fourcc_code('R', 'G', 'B', '8') /* [7:0] R:G:B 3:3:2 */ -+#define DRM_FORMAT_BGR233 fourcc_code('B', 'G', 'R', '8') /* [7:0] B:G:R 2:3:3 */ -+ -+/* 16 bpp RGB */ -+#define DRM_FORMAT_XRGB4444 fourcc_code('X', 'R', '1', '2') /* [15:0] x:R:G:B 4:4:4:4 little endian */ -+#define DRM_FORMAT_XBGR4444 fourcc_code('X', 'B', '1', '2') /* [15:0] x:B:G:R 4:4:4:4 little endian */ -+#define DRM_FORMAT_RGBX4444 fourcc_code('R', 'X', '1', '2') /* [15:0] R:G:B:x 4:4:4:4 little endian */ -+#define DRM_FORMAT_BGRX4444 fourcc_code('B', 'X', '1', '2') /* [15:0] B:G:R:x 4:4:4:4 little endian */ -+ -+#define DRM_FORMAT_ARGB4444 fourcc_code('A', 'R', '1', '2') /* [15:0] A:R:G:B 4:4:4:4 little endian */ -+#define DRM_FORMAT_ABGR4444 fourcc_code('A', 'B', '1', '2') /* [15:0] A:B:G:R 4:4:4:4 little endian */ -+#define DRM_FORMAT_RGBA4444 fourcc_code('R', 'A', '1', '2') /* [15:0] R:G:B:A 4:4:4:4 little endian */ -+#define DRM_FORMAT_BGRA4444 fourcc_code('B', 'A', '1', '2') /* [15:0] B:G:R:A 4:4:4:4 little endian */ -+ -+#define DRM_FORMAT_XRGB1555 fourcc_code('X', 'R', '1', '5') /* [15:0] x:R:G:B 1:5:5:5 little endian */ -+#define DRM_FORMAT_XBGR1555 fourcc_code('X', 'B', '1', '5') /* [15:0] x:B:G:R 1:5:5:5 little endian */ -+#define DRM_FORMAT_RGBX5551 fourcc_code('R', 'X', '1', '5') /* [15:0] R:G:B:x 5:5:5:1 little endian */ -+#define DRM_FORMAT_BGRX5551 fourcc_code('B', 'X', '1', '5') /* [15:0] B:G:R:x 5:5:5:1 little endian */ -+ -+#define DRM_FORMAT_ARGB1555 fourcc_code('A', 'R', '1', '5') /* [15:0] A:R:G:B 1:5:5:5 little endian */ -+#define DRM_FORMAT_ABGR1555 fourcc_code('A', 'B', '1', '5') /* [15:0] A:B:G:R 1:5:5:5 little endian */ -+#define DRM_FORMAT_RGBA5551 fourcc_code('R', 'A', '1', '5') /* [15:0] R:G:B:A 5:5:5:1 little endian */ -+#define DRM_FORMAT_BGRA5551 fourcc_code('B', 'A', '1', '5') /* [15:0] B:G:R:A 5:5:5:1 little endian */ -+ -+#define DRM_FORMAT_RGB565 fourcc_code('R', 'G', '1', '6') /* [15:0] R:G:B 5:6:5 little endian */ -+#define DRM_FORMAT_BGR565 fourcc_code('B', 'G', '1', '6') /* [15:0] B:G:R 5:6:5 little endian */ -+ -+/* 24 bpp RGB */ -+#define DRM_FORMAT_RGB888 fourcc_code('R', 'G', '2', '4') /* [23:0] R:G:B little endian */ -+#define DRM_FORMAT_BGR888 fourcc_code('B', 'G', '2', '4') /* [23:0] B:G:R little endian */ -+ -+/* 32 bpp RGB */ -+#define DRM_FORMAT_XRGB8888 fourcc_code('X', 'R', '2', '4') /* [31:0] x:R:G:B 8:8:8:8 little endian */ -+#define DRM_FORMAT_XBGR8888 fourcc_code('X', 'B', '2', '4') /* [31:0] x:B:G:R 8:8:8:8 little endian */ -+#define DRM_FORMAT_RGBX8888 fourcc_code('R', 'X', '2', '4') /* [31:0] R:G:B:x 8:8:8:8 little endian */ -+#define DRM_FORMAT_BGRX8888 fourcc_code('B', 'X', '2', '4') /* [31:0] B:G:R:x 8:8:8:8 little endian */ -+ -+#define DRM_FORMAT_ARGB8888 fourcc_code('A', 'R', '2', '4') /* [31:0] A:R:G:B 8:8:8:8 little endian */ -+#define DRM_FORMAT_ABGR8888 fourcc_code('A', 'B', '2', '4') /* [31:0] A:B:G:R 8:8:8:8 little endian */ -+#define DRM_FORMAT_RGBA8888 fourcc_code('R', 'A', '2', '4') /* [31:0] R:G:B:A 8:8:8:8 little endian */ -+#define DRM_FORMAT_BGRA8888 fourcc_code('B', 'A', '2', '4') /* [31:0] B:G:R:A 8:8:8:8 little endian */ -+ -+#define DRM_FORMAT_XRGB2101010 fourcc_code('X', 'R', '3', '0') /* [31:0] x:R:G:B 2:10:10:10 little endian */ -+#define DRM_FORMAT_XBGR2101010 fourcc_code('X', 'B', '3', '0') /* [31:0] x:B:G:R 2:10:10:10 little endian */ -+#define DRM_FORMAT_RGBX1010102 fourcc_code('R', 'X', '3', '0') /* [31:0] R:G:B:x 10:10:10:2 little endian */ -+#define DRM_FORMAT_BGRX1010102 fourcc_code('B', 'X', '3', '0') /* [31:0] B:G:R:x 10:10:10:2 little endian */ -+ -+#define DRM_FORMAT_ARGB2101010 fourcc_code('A', 'R', '3', '0') /* [31:0] A:R:G:B 2:10:10:10 little endian */ -+#define DRM_FORMAT_ABGR2101010 fourcc_code('A', 'B', '3', '0') /* [31:0] A:B:G:R 2:10:10:10 little endian */ -+#define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */ -+#define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */ -+ -+/* 64 bpp RGB */ -+#define DRM_FORMAT_XRGB16161616 fourcc_code('X', 'R', '4', '8') /* [63:0] x:R:G:B 16:16:16:16 little endian */ -+#define DRM_FORMAT_XBGR16161616 fourcc_code('X', 'B', '4', '8') /* [63:0] x:B:G:R 16:16:16:16 little endian */ -+ -+#define DRM_FORMAT_ARGB16161616 fourcc_code('A', 'R', '4', '8') /* [63:0] A:R:G:B 16:16:16:16 little endian */ -+#define DRM_FORMAT_ABGR16161616 fourcc_code('A', 'B', '4', '8') /* [63:0] A:B:G:R 16:16:16:16 little endian */ -+ -+/* -+ * Floating point 64bpp RGB -+ * IEEE 754-2008 binary16 half-precision float -+ * [15:0] sign:exponent:mantissa 1:5:10 -+ */ -+#define DRM_FORMAT_XRGB16161616F fourcc_code('X', 'R', '4', 'H') /* [63:0] x:R:G:B 16:16:16:16 little endian */ -+#define DRM_FORMAT_XBGR16161616F fourcc_code('X', 'B', '4', 'H') /* [63:0] x:B:G:R 16:16:16:16 little endian */ -+ -+#define DRM_FORMAT_ARGB16161616F fourcc_code('A', 'R', '4', 'H') /* [63:0] A:R:G:B 16:16:16:16 little endian */ -+#define DRM_FORMAT_ABGR16161616F fourcc_code('A', 'B', '4', 'H') /* [63:0] A:B:G:R 16:16:16:16 little endian */ -+ -+/* -+ * RGBA format with 10-bit components packed in 64-bit per pixel, with 6 bits -+ * of unused padding per component: -+ */ -+#define DRM_FORMAT_AXBXGXRX106106106106 fourcc_code('A', 'B', '1', '0') /* [63:0] A:x:B:x:G:x:R:x 10:6:10:6:10:6:10:6 little endian */ -+ -+/* packed YCbCr */ -+#define DRM_FORMAT_YUYV fourcc_code('Y', 'U', 'Y', 'V') /* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */ -+#define DRM_FORMAT_YVYU fourcc_code('Y', 'V', 'Y', 'U') /* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */ -+#define DRM_FORMAT_UYVY fourcc_code('U', 'Y', 'V', 'Y') /* [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian */ -+#define DRM_FORMAT_VYUY fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */ -+ -+#define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */ -+#define DRM_FORMAT_XYUV8888 fourcc_code('X', 'Y', 'U', 'V') /* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */ -+#define DRM_FORMAT_VUY888 fourcc_code('V', 'U', '2', '4') /* [23:0] Cr:Cb:Y 8:8:8 little endian */ -+#define DRM_FORMAT_VUY101010 fourcc_code('V', 'U', '3', '0') /* Y followed by U then V, 10:10:10. Non-linear modifier only */ -+ -+/* -+ * packed Y2xx indicate for each component, xx valid data occupy msb -+ * 16-xx padding occupy lsb -+ */ -+#define DRM_FORMAT_Y210 fourcc_code('Y', '2', '1', '0') /* [63:0] Cr0:0:Y1:0:Cb0:0:Y0:0 10:6:10:6:10:6:10:6 little endian per 2 Y pixels */ -+#define DRM_FORMAT_Y212 fourcc_code('Y', '2', '1', '2') /* [63:0] Cr0:0:Y1:0:Cb0:0:Y0:0 12:4:12:4:12:4:12:4 little endian per 2 Y pixels */ -+#define DRM_FORMAT_Y216 fourcc_code('Y', '2', '1', '6') /* [63:0] Cr0:Y1:Cb0:Y0 16:16:16:16 little endian per 2 Y pixels */ -+ -+/* -+ * packed Y4xx indicate for each component, xx valid data occupy msb -+ * 16-xx padding occupy lsb except Y410 -+ */ -+#define DRM_FORMAT_Y410 fourcc_code('Y', '4', '1', '0') /* [31:0] A:Cr:Y:Cb 2:10:10:10 little endian */ -+#define DRM_FORMAT_Y412 fourcc_code('Y', '4', '1', '2') /* [63:0] A:0:Cr:0:Y:0:Cb:0 12:4:12:4:12:4:12:4 little endian */ -+#define DRM_FORMAT_Y416 fourcc_code('Y', '4', '1', '6') /* [63:0] A:Cr:Y:Cb 16:16:16:16 little endian */ -+ -+#define DRM_FORMAT_XVYU2101010 fourcc_code('X', 'V', '3', '0') /* [31:0] X:Cr:Y:Cb 2:10:10:10 little endian */ -+#define DRM_FORMAT_XVYU12_16161616 fourcc_code('X', 'V', '3', '6') /* [63:0] X:0:Cr:0:Y:0:Cb:0 12:4:12:4:12:4:12:4 little endian */ -+#define DRM_FORMAT_XVYU16161616 fourcc_code('X', 'V', '4', '8') /* [63:0] X:Cr:Y:Cb 16:16:16:16 little endian */ -+ -+/* -+ * packed YCbCr420 2x2 tiled formats -+ * first 64 bits will contain Y,Cb,Cr components for a 2x2 tile -+ */ -+/* [63:0] A3:A2:Y3:0:Cr0:0:Y2:0:A1:A0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian */ -+#define DRM_FORMAT_Y0L0 fourcc_code('Y', '0', 'L', '0') -+/* [63:0] X3:X2:Y3:0:Cr0:0:Y2:0:X1:X0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian */ -+#define DRM_FORMAT_X0L0 fourcc_code('X', '0', 'L', '0') -+ -+/* [63:0] A3:A2:Y3:Cr0:Y2:A1:A0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian */ -+#define DRM_FORMAT_Y0L2 fourcc_code('Y', '0', 'L', '2') -+/* [63:0] X3:X2:Y3:Cr0:Y2:X1:X0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian */ -+#define DRM_FORMAT_X0L2 fourcc_code('X', '0', 'L', '2') -+ -+/* -+ * 1-plane YUV 4:2:0 -+ * In these formats, the component ordering is specified (Y, followed by U -+ * then V), but the exact Linear layout is undefined. -+ * These formats can only be used with a non-Linear modifier. -+ */ -+#define DRM_FORMAT_YUV420_8BIT fourcc_code('Y', 'U', '0', '8') -+#define DRM_FORMAT_YUV420_10BIT fourcc_code('Y', 'U', '1', '0') -+ -+/* -+ * 2 plane RGB + A -+ * index 0 = RGB plane, same format as the corresponding non _A8 format has -+ * index 1 = A plane, [7:0] A -+ */ -+#define DRM_FORMAT_XRGB8888_A8 fourcc_code('X', 'R', 'A', '8') -+#define DRM_FORMAT_XBGR8888_A8 fourcc_code('X', 'B', 'A', '8') -+#define DRM_FORMAT_RGBX8888_A8 fourcc_code('R', 'X', 'A', '8') -+#define DRM_FORMAT_BGRX8888_A8 fourcc_code('B', 'X', 'A', '8') -+#define DRM_FORMAT_RGB888_A8 fourcc_code('R', '8', 'A', '8') -+#define DRM_FORMAT_BGR888_A8 fourcc_code('B', '8', 'A', '8') -+#define DRM_FORMAT_RGB565_A8 fourcc_code('R', '5', 'A', '8') -+#define DRM_FORMAT_BGR565_A8 fourcc_code('B', '5', 'A', '8') -+ -+/* -+ * 2 plane YCbCr -+ * index 0 = Y plane, [7:0] Y -+ * index 1 = Cr:Cb plane, [15:0] Cr:Cb little endian -+ * or -+ * index 1 = Cb:Cr plane, [15:0] Cb:Cr little endian -+ */ -+#define DRM_FORMAT_NV12 fourcc_code('N', 'V', '1', '2') /* 2x2 subsampled Cr:Cb plane */ -+#define DRM_FORMAT_NV21 fourcc_code('N', 'V', '2', '1') /* 2x2 subsampled Cb:Cr plane */ -+#define DRM_FORMAT_NV16 fourcc_code('N', 'V', '1', '6') /* 2x1 subsampled Cr:Cb plane */ -+#define DRM_FORMAT_NV61 fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */ -+#define DRM_FORMAT_NV24 fourcc_code('N', 'V', '2', '4') /* non-subsampled Cr:Cb plane */ -+#define DRM_FORMAT_NV42 fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */ -+/* -+ * 2 plane YCbCr -+ * index 0 = Y plane, [39:0] Y3:Y2:Y1:Y0 little endian -+ * index 1 = Cr:Cb plane, [39:0] Cr1:Cb1:Cr0:Cb0 little endian -+ */ -+#define DRM_FORMAT_NV15 fourcc_code('N', 'V', '1', '5') /* 2x2 subsampled Cr:Cb plane */ -+ -+/* -+ * 2 plane YCbCr MSB aligned -+ * index 0 = Y plane, [15:0] Y:x [10:6] little endian -+ * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [10:6:10:6] little endian -+ */ -+#define DRM_FORMAT_P210 fourcc_code('P', '2', '1', '0') /* 2x1 subsampled Cr:Cb plane, 10 bit per channel */ -+ -+/* -+ * 2 plane YCbCr MSB aligned -+ * index 0 = Y plane, [15:0] Y:x [10:6] little endian -+ * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [10:6:10:6] little endian -+ */ -+#define DRM_FORMAT_P010 fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cr:Cb plane 10 bits per channel */ -+ -+/* -+ * 2 plane YCbCr MSB aligned -+ * index 0 = Y plane, [15:0] Y:x [12:4] little endian -+ * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [12:4:12:4] little endian -+ */ -+#define DRM_FORMAT_P012 fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cr:Cb plane 12 bits per channel */ -+ -+/* -+ * 2 plane YCbCr MSB aligned -+ * index 0 = Y plane, [15:0] Y little endian -+ * index 1 = Cr:Cb plane, [31:0] Cr:Cb [16:16] little endian -+ */ -+#define DRM_FORMAT_P016 fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cr:Cb plane 16 bits per channel */ -+ -+/* 3 plane non-subsampled (444) YCbCr -+ * 16 bits per component, but only 10 bits are used and 6 bits are padded -+ * index 0: Y plane, [15:0] Y:x [10:6] little endian -+ * index 1: Cb plane, [15:0] Cb:x [10:6] little endian -+ * index 2: Cr plane, [15:0] Cr:x [10:6] little endian -+ */ -+#define DRM_FORMAT_Q410 fourcc_code('Q', '4', '1', '0') -+ -+/* 3 plane non-subsampled (444) YCrCb -+ * 16 bits per component, but only 10 bits are used and 6 bits are padded -+ * index 0: Y plane, [15:0] Y:x [10:6] little endian -+ * index 1: Cr plane, [15:0] Cr:x [10:6] little endian -+ * index 2: Cb plane, [15:0] Cb:x [10:6] little endian -+ */ -+#define DRM_FORMAT_Q401 fourcc_code('Q', '4', '0', '1') -+ -+/* -+ * 3 plane YCbCr -+ * index 0: Y plane, [7:0] Y -+ * index 1: Cb plane, [7:0] Cb -+ * index 2: Cr plane, [7:0] Cr -+ * or -+ * index 1: Cr plane, [7:0] Cr -+ * index 2: Cb plane, [7:0] Cb -+ */ -+#define DRM_FORMAT_YUV410 fourcc_code('Y', 'U', 'V', '9') /* 4x4 subsampled Cb (1) and Cr (2) planes */ -+#define DRM_FORMAT_YVU410 fourcc_code('Y', 'V', 'U', '9') /* 4x4 subsampled Cr (1) and Cb (2) planes */ -+#define DRM_FORMAT_YUV411 fourcc_code('Y', 'U', '1', '1') /* 4x1 subsampled Cb (1) and Cr (2) planes */ -+#define DRM_FORMAT_YVU411 fourcc_code('Y', 'V', '1', '1') /* 4x1 subsampled Cr (1) and Cb (2) planes */ -+#define DRM_FORMAT_YUV420 fourcc_code('Y', 'U', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes */ -+#define DRM_FORMAT_YVU420 fourcc_code('Y', 'V', '1', '2') /* 2x2 subsampled Cr (1) and Cb (2) planes */ -+#define DRM_FORMAT_YUV422 fourcc_code('Y', 'U', '1', '6') /* 2x1 subsampled Cb (1) and Cr (2) planes */ -+#define DRM_FORMAT_YVU422 fourcc_code('Y', 'V', '1', '6') /* 2x1 subsampled Cr (1) and Cb (2) planes */ -+#define DRM_FORMAT_YUV444 fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */ -+#define DRM_FORMAT_YVU444 fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */ -+ -+ -+/* -+ * Format Modifiers: -+ * -+ * Format modifiers describe, typically, a re-ordering or modification -+ * of the data in a plane of an FB. This can be used to express tiled/ -+ * swizzled formats, or compression, or a combination of the two. -+ * -+ * The upper 8 bits of the format modifier are a vendor-id as assigned -+ * below. The lower 56 bits are assigned as vendor sees fit. -+ */ -+ -+/* Vendor Ids: */ -+#define DRM_FORMAT_MOD_VENDOR_NONE 0 -+#define DRM_FORMAT_MOD_VENDOR_INTEL 0x01 -+#define DRM_FORMAT_MOD_VENDOR_AMD 0x02 -+#define DRM_FORMAT_MOD_VENDOR_NVIDIA 0x03 -+#define DRM_FORMAT_MOD_VENDOR_SAMSUNG 0x04 -+#define DRM_FORMAT_MOD_VENDOR_QCOM 0x05 -+#define DRM_FORMAT_MOD_VENDOR_VIVANTE 0x06 -+#define DRM_FORMAT_MOD_VENDOR_BROADCOM 0x07 -+#define DRM_FORMAT_MOD_VENDOR_ARM 0x08 -+#define DRM_FORMAT_MOD_VENDOR_ALLWINNER 0x09 -+#define DRM_FORMAT_MOD_VENDOR_AMLOGIC 0x0a -+ -+/* add more to the end as needed */ -+ -+#define DRM_FORMAT_RESERVED ((1ULL << 56) - 1) -+ -+#define fourcc_mod_get_vendor(modifier) \ -+ (((modifier) >> 56) & 0xff) -+ -+#define fourcc_mod_is_vendor(modifier, vendor) \ -+ (fourcc_mod_get_vendor(modifier) == DRM_FORMAT_MOD_VENDOR_## vendor) -+ -+#define fourcc_mod_code(vendor, val) \ -+ ((((__u64)DRM_FORMAT_MOD_VENDOR_## vendor) << 56) | ((val) & 0x00ffffffffffffffULL)) -+ -+/* -+ * Format Modifier tokens: -+ * -+ * When adding a new token please document the layout with a code comment, -+ * similar to the fourcc codes above. drm_fourcc.h is considered the -+ * authoritative source for all of these. -+ * -+ * Generic modifier names: -+ * -+ * DRM_FORMAT_MOD_GENERIC_* definitions are used to provide vendor-neutral names -+ * for layouts which are common across multiple vendors. To preserve -+ * compatibility, in cases where a vendor-specific definition already exists and -+ * a generic name for it is desired, the common name is a purely symbolic alias -+ * and must use the same numerical value as the original definition. -+ * -+ * Note that generic names should only be used for modifiers which describe -+ * generic layouts (such as pixel re-ordering), which may have -+ * independently-developed support across multiple vendors. -+ * -+ * In future cases where a generic layout is identified before merging with a -+ * vendor-specific modifier, a new 'GENERIC' vendor or modifier using vendor -+ * 'NONE' could be considered. This should only be for obvious, exceptional -+ * cases to avoid polluting the 'GENERIC' namespace with modifiers which only -+ * apply to a single vendor. -+ * -+ * Generic names should not be used for cases where multiple hardware vendors -+ * have implementations of the same standardised compression scheme (such as -+ * AFBC). In those cases, all implementations should use the same format -+ * modifier(s), reflecting the vendor of the standard. -+ */ -+ -+#define DRM_FORMAT_MOD_GENERIC_16_16_TILE DRM_FORMAT_MOD_SAMSUNG_16_16_TILE -+ -+/* -+ * Invalid Modifier -+ * -+ * This modifier can be used as a sentinel to terminate the format modifiers -+ * list, or to initialize a variable with an invalid modifier. It might also be -+ * used to report an error back to userspace for certain APIs. -+ */ -+#define DRM_FORMAT_MOD_INVALID fourcc_mod_code(NONE, DRM_FORMAT_RESERVED) -+ -+/* -+ * Linear Layout -+ * -+ * Just plain linear layout. Note that this is different from no specifying any -+ * modifier (e.g. not setting DRM_MODE_FB_MODIFIERS in the DRM_ADDFB2 ioctl), -+ * which tells the driver to also take driver-internal information into account -+ * and so might actually result in a tiled framebuffer. -+ */ -+#define DRM_FORMAT_MOD_LINEAR fourcc_mod_code(NONE, 0) -+ -+/* -+ * Deprecated: use DRM_FORMAT_MOD_LINEAR instead -+ * -+ * The "none" format modifier doesn't actually mean that the modifier is -+ * implicit, instead it means that the layout is linear. Whether modifiers are -+ * used is out-of-band information carried in an API-specific way (e.g. in a -+ * flag for drm_mode_fb_cmd2). -+ */ -+#define DRM_FORMAT_MOD_NONE 0 -+ -+/* Intel framebuffer modifiers */ -+ -+/* -+ * Intel X-tiling layout -+ * -+ * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb) -+ * in row-major layout. Within the tile bytes are laid out row-major, with -+ * a platform-dependent stride. On top of that the memory can apply -+ * platform-depending swizzling of some higher address bits into bit6. -+ * -+ * Note that this layout is only accurate on intel gen 8+ or valleyview chipsets. -+ * On earlier platforms the is highly platforms specific and not useful for -+ * cross-driver sharing. It exists since on a given platform it does uniquely -+ * identify the layout in a simple way for i915-specific userspace, which -+ * facilitated conversion of userspace to modifiers. Additionally the exact -+ * format on some really old platforms is not known. -+ */ -+#define I915_FORMAT_MOD_X_TILED fourcc_mod_code(INTEL, 1) -+ -+/* -+ * Intel Y-tiling layout -+ * -+ * This is a tiled layout using 4Kb tiles (except on gen2 where the tiles 2Kb) -+ * in row-major layout. Within the tile bytes are laid out in OWORD (16 bytes) -+ * chunks column-major, with a platform-dependent height. On top of that the -+ * memory can apply platform-depending swizzling of some higher address bits -+ * into bit6. -+ * -+ * Note that this layout is only accurate on intel gen 8+ or valleyview chipsets. -+ * On earlier platforms the is highly platforms specific and not useful for -+ * cross-driver sharing. It exists since on a given platform it does uniquely -+ * identify the layout in a simple way for i915-specific userspace, which -+ * facilitated conversion of userspace to modifiers. Additionally the exact -+ * format on some really old platforms is not known. -+ */ -+#define I915_FORMAT_MOD_Y_TILED fourcc_mod_code(INTEL, 2) -+ -+/* -+ * Intel Yf-tiling layout -+ * -+ * This is a tiled layout using 4Kb tiles in row-major layout. -+ * Within the tile pixels are laid out in 16 256 byte units / sub-tiles which -+ * are arranged in four groups (two wide, two high) with column-major layout. -+ * Each group therefore consits out of four 256 byte units, which are also laid -+ * out as 2x2 column-major. -+ * 256 byte units are made out of four 64 byte blocks of pixels, producing -+ * either a square block or a 2:1 unit. -+ * 64 byte blocks of pixels contain four pixel rows of 16 bytes, where the width -+ * in pixel depends on the pixel depth. -+ */ -+#define I915_FORMAT_MOD_Yf_TILED fourcc_mod_code(INTEL, 3) -+ -+/* -+ * Intel color control surface (CCS) for render compression -+ * -+ * The framebuffer format must be one of the 8:8:8:8 RGB formats. -+ * The main surface will be plane index 0 and must be Y/Yf-tiled, -+ * the CCS will be plane index 1. -+ * -+ * Each CCS tile matches a 1024x512 pixel area of the main surface. -+ * To match certain aspects of the 3D hardware the CCS is -+ * considered to be made up of normal 128Bx32 Y tiles, Thus -+ * the CCS pitch must be specified in multiples of 128 bytes. -+ * -+ * In reality the CCS tile appears to be a 64Bx64 Y tile, composed -+ * of QWORD (8 bytes) chunks instead of OWORD (16 bytes) chunks. -+ * But that fact is not relevant unless the memory is accessed -+ * directly. -+ */ -+#define I915_FORMAT_MOD_Y_TILED_CCS fourcc_mod_code(INTEL, 4) -+#define I915_FORMAT_MOD_Yf_TILED_CCS fourcc_mod_code(INTEL, 5) -+ -+/* -+ * Intel color control surfaces (CCS) for Gen-12 render compression. -+ * -+ * The main surface is Y-tiled and at plane index 0, the CCS is linear and -+ * at index 1. A 64B CCS cache line corresponds to an area of 4x1 tiles in -+ * main surface. In other words, 4 bits in CCS map to a main surface cache -+ * line pair. The main surface pitch is required to be a multiple of four -+ * Y-tile widths. -+ */ -+#define I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS fourcc_mod_code(INTEL, 6) -+ -+/* -+ * Intel color control surfaces (CCS) for Gen-12 media compression -+ * -+ * The main surface is Y-tiled and at plane index 0, the CCS is linear and -+ * at index 1. A 64B CCS cache line corresponds to an area of 4x1 tiles in -+ * main surface. In other words, 4 bits in CCS map to a main surface cache -+ * line pair. The main surface pitch is required to be a multiple of four -+ * Y-tile widths. For semi-planar formats like NV12, CCS planes follow the -+ * Y and UV planes i.e., planes 0 and 1 are used for Y and UV surfaces, -+ * planes 2 and 3 for the respective CCS. -+ */ -+#define I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS fourcc_mod_code(INTEL, 7) -+ -+/* -+ * Intel Color Control Surface with Clear Color (CCS) for Gen-12 render -+ * compression. -+ * -+ * The main surface is Y-tiled and is at plane index 0 whereas CCS is linear -+ * and at index 1. The clear color is stored at index 2, and the pitch should -+ * be ignored. The clear color structure is 256 bits. The first 128 bits -+ * represents Raw Clear Color Red, Green, Blue and Alpha color each represented -+ * by 32 bits. The raw clear color is consumed by the 3d engine and generates -+ * the converted clear color of size 64 bits. The first 32 bits store the Lower -+ * Converted Clear Color value and the next 32 bits store the Higher Converted -+ * Clear Color value when applicable. The Converted Clear Color values are -+ * consumed by the DE. The last 64 bits are used to store Color Discard Enable -+ * and Depth Clear Value Valid which are ignored by the DE. A CCS cache line -+ * corresponds to an area of 4x1 tiles in the main surface. The main surface -+ * pitch is required to be a multiple of 4 tile widths. -+ */ -+#define I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC fourcc_mod_code(INTEL, 8) -+ -+/* -+ * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks -+ * -+ * Macroblocks are laid in a Z-shape, and each pixel data is following the -+ * standard NV12 style. -+ * As for NV12, an image is the result of two frame buffers: one for Y, -+ * one for the interleaved Cb/Cr components (1/2 the height of the Y buffer). -+ * Alignment requirements are (for each buffer): -+ * - multiple of 128 pixels for the width -+ * - multiple of 32 pixels for the height -+ * -+ * For more information: see https://linuxtv.org/downloads/v4l-dvb-apis/re32.html -+ */ -+#define DRM_FORMAT_MOD_SAMSUNG_64_32_TILE fourcc_mod_code(SAMSUNG, 1) -+ -+/* -+ * Tiled, 16 (pixels) x 16 (lines) - sized macroblocks -+ * -+ * This is a simple tiled layout using tiles of 16x16 pixels in a row-major -+ * layout. For YCbCr formats Cb/Cr components are taken in such a way that -+ * they correspond to their 16x16 luma block. -+ */ -+#define DRM_FORMAT_MOD_SAMSUNG_16_16_TILE fourcc_mod_code(SAMSUNG, 2) -+ -+/* -+ * Qualcomm Compressed Format -+ * -+ * Refers to a compressed variant of the base format that is compressed. -+ * Implementation may be platform and base-format specific. -+ * -+ * Each macrotile consists of m x n (mostly 4 x 4) tiles. -+ * Pixel data pitch/stride is aligned with macrotile width. -+ * Pixel data height is aligned with macrotile height. -+ * Entire pixel data buffer is aligned with 4k(bytes). -+ */ -+#define DRM_FORMAT_MOD_QCOM_COMPRESSED fourcc_mod_code(QCOM, 1) -+ -+/* Vivante framebuffer modifiers */ -+ -+/* -+ * Vivante 4x4 tiling layout -+ * -+ * This is a simple tiled layout using tiles of 4x4 pixels in a row-major -+ * layout. -+ */ -+#define DRM_FORMAT_MOD_VIVANTE_TILED fourcc_mod_code(VIVANTE, 1) -+ -+/* -+ * Vivante 64x64 super-tiling layout -+ * -+ * This is a tiled layout using 64x64 pixel super-tiles, where each super-tile -+ * contains 8x4 groups of 2x4 tiles of 4x4 pixels (like above) each, all in row- -+ * major layout. -+ * -+ * For more information: see -+ * https://github.com/etnaviv/etna_viv/blob/master/doc/hardware.md#texture-tiling -+ */ -+#define DRM_FORMAT_MOD_VIVANTE_SUPER_TILED fourcc_mod_code(VIVANTE, 2) -+ -+/* -+ * Vivante 4x4 tiling layout for dual-pipe -+ * -+ * Same as the 4x4 tiling layout, except every second 4x4 pixel tile starts at a -+ * different base address. Offsets from the base addresses are therefore halved -+ * compared to the non-split tiled layout. -+ */ -+#define DRM_FORMAT_MOD_VIVANTE_SPLIT_TILED fourcc_mod_code(VIVANTE, 3) -+ -+/* -+ * Vivante 64x64 super-tiling layout for dual-pipe -+ * -+ * Same as the 64x64 super-tiling layout, except every second 4x4 pixel tile -+ * starts at a different base address. Offsets from the base addresses are -+ * therefore halved compared to the non-split super-tiled layout. -+ */ -+#define DRM_FORMAT_MOD_VIVANTE_SPLIT_SUPER_TILED fourcc_mod_code(VIVANTE, 4) -+ -+/* NVIDIA frame buffer modifiers */ -+ -+/* -+ * Tegra Tiled Layout, used by Tegra 2, 3 and 4. -+ * -+ * Pixels are arranged in simple tiles of 16 x 16 bytes. -+ */ -+#define DRM_FORMAT_MOD_NVIDIA_TEGRA_TILED fourcc_mod_code(NVIDIA, 1) -+ -+/* -+ * Generalized Block Linear layout, used by desktop GPUs starting with NV50/G80, -+ * and Tegra GPUs starting with Tegra K1. -+ * -+ * Pixels are arranged in Groups of Bytes (GOBs). GOB size and layout varies -+ * based on the architecture generation. GOBs themselves are then arranged in -+ * 3D blocks, with the block dimensions (in terms of GOBs) always being a power -+ * of two, and hence expressible as their log2 equivalent (E.g., "2" represents -+ * a block depth or height of "4"). -+ * -+ * Chapter 20 "Pixel Memory Formats" of the Tegra X1 TRM describes this format -+ * in full detail. -+ * -+ * Macro -+ * Bits Param Description -+ * ---- ----- ----------------------------------------------------------------- -+ * -+ * 3:0 h log2(height) of each block, in GOBs. Placed here for -+ * compatibility with the existing -+ * DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK()-based modifiers. -+ * -+ * 4:4 - Must be 1, to indicate block-linear layout. Necessary for -+ * compatibility with the existing -+ * DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK()-based modifiers. -+ * -+ * 8:5 - Reserved (To support 3D-surfaces with variable log2(depth) block -+ * size). Must be zero. -+ * -+ * Note there is no log2(width) parameter. Some portions of the -+ * hardware support a block width of two gobs, but it is impractical -+ * to use due to lack of support elsewhere, and has no known -+ * benefits. -+ * -+ * 11:9 - Reserved (To support 2D-array textures with variable array stride -+ * in blocks, specified via log2(tile width in blocks)). Must be -+ * zero. -+ * -+ * 19:12 k Page Kind. This value directly maps to a field in the page -+ * tables of all GPUs >= NV50. It affects the exact layout of bits -+ * in memory and can be derived from the tuple -+ * -+ * (format, GPU model, compression type, samples per pixel) -+ * -+ * Where compression type is defined below. If GPU model were -+ * implied by the format modifier, format, or memory buffer, page -+ * kind would not need to be included in the modifier itself, but -+ * since the modifier should define the layout of the associated -+ * memory buffer independent from any device or other context, it -+ * must be included here. -+ * -+ * 21:20 g GOB Height and Page Kind Generation. The height of a GOB changed -+ * starting with Fermi GPUs. Additionally, the mapping between page -+ * kind and bit layout has changed at various points. -+ * -+ * 0 = Gob Height 8, Fermi - Volta, Tegra K1+ Page Kind mapping -+ * 1 = Gob Height 4, G80 - GT2XX Page Kind mapping -+ * 2 = Gob Height 8, Turing+ Page Kind mapping -+ * 3 = Reserved for future use. -+ * -+ * 22:22 s Sector layout. On Tegra GPUs prior to Xavier, there is a further -+ * bit remapping step that occurs at an even lower level than the -+ * page kind and block linear swizzles. This causes the layout of -+ * surfaces mapped in those SOC's GPUs to be incompatible with the -+ * equivalent mapping on other GPUs in the same system. -+ * -+ * 0 = Tegra K1 - Tegra Parker/TX2 Layout. -+ * 1 = Desktop GPU and Tegra Xavier+ Layout -+ * -+ * 25:23 c Lossless Framebuffer Compression type. -+ * -+ * 0 = none -+ * 1 = ROP/3D, layout 1, exact compression format implied by Page -+ * Kind field -+ * 2 = ROP/3D, layout 2, exact compression format implied by Page -+ * Kind field -+ * 3 = CDE horizontal -+ * 4 = CDE vertical -+ * 5 = Reserved for future use -+ * 6 = Reserved for future use -+ * 7 = Reserved for future use -+ * -+ * 55:25 - Reserved for future use. Must be zero. -+ */ -+#define DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(c, s, g, k, h) \ -+ fourcc_mod_code(NVIDIA, (0x10 | \ -+ ((h) & 0xf) | \ -+ (((k) & 0xff) << 12) | \ -+ (((g) & 0x3) << 20) | \ -+ (((s) & 0x1) << 22) | \ -+ (((c) & 0x7) << 23))) -+ -+/* To grandfather in prior block linear format modifiers to the above layout, -+ * the page kind "0", which corresponds to "pitch/linear" and hence is unusable -+ * with block-linear layouts, is remapped within drivers to the value 0xfe, -+ * which corresponds to the "generic" kind used for simple single-sample -+ * uncompressed color formats on Fermi - Volta GPUs. -+ */ -+static __inline__ __u64 -+drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier) -+{ -+ if (!(modifier & 0x10) || (modifier & (0xff << 12))) -+ return modifier; -+ else -+ return modifier | (0xfe << 12); -+} -+ -+/* -+ * 16Bx2 Block Linear layout, used by Tegra K1 and later -+ * -+ * Pixels are arranged in 64x8 Groups Of Bytes (GOBs). GOBs are then stacked -+ * vertically by a power of 2 (1 to 32 GOBs) to form a block. -+ * -+ * Within a GOB, data is ordered as 16B x 2 lines sectors laid in Z-shape. -+ * -+ * Parameter 'v' is the log2 encoding of the number of GOBs stacked vertically. -+ * Valid values are: -+ * -+ * 0 == ONE_GOB -+ * 1 == TWO_GOBS -+ * 2 == FOUR_GOBS -+ * 3 == EIGHT_GOBS -+ * 4 == SIXTEEN_GOBS -+ * 5 == THIRTYTWO_GOBS -+ * -+ * Chapter 20 "Pixel Memory Formats" of the Tegra X1 TRM describes this format -+ * in full detail. -+ */ -+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(v) \ -+ DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(0, 0, 0, 0, (v)) -+ -+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_ONE_GOB \ -+ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(0) -+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_TWO_GOB \ -+ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(1) -+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_FOUR_GOB \ -+ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(2) -+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_EIGHT_GOB \ -+ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(3) -+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_SIXTEEN_GOB \ -+ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(4) -+#define DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK_THIRTYTWO_GOB \ -+ DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(5) -+ -+/* -+ * Some Broadcom modifiers take parameters, for example the number of -+ * vertical lines in the image. Reserve the lower 32 bits for modifier -+ * type, and the next 24 bits for parameters. Top 8 bits are the -+ * vendor code. -+ */ -+#define __fourcc_mod_broadcom_param_shift 8 -+#define __fourcc_mod_broadcom_param_bits 48 -+#define fourcc_mod_broadcom_code(val, params) \ -+ fourcc_mod_code(BROADCOM, ((((__u64)params) << __fourcc_mod_broadcom_param_shift) | val)) -+#define fourcc_mod_broadcom_param(m) \ -+ ((int)(((m) >> __fourcc_mod_broadcom_param_shift) & \ -+ ((1ULL << __fourcc_mod_broadcom_param_bits) - 1))) -+#define fourcc_mod_broadcom_mod(m) \ -+ ((m) & ~(((1ULL << __fourcc_mod_broadcom_param_bits) - 1) << \ -+ __fourcc_mod_broadcom_param_shift)) -+ -+/* -+ * Broadcom VC4 "T" format -+ * -+ * This is the primary layout that the V3D GPU can texture from (it -+ * can't do linear). The T format has: -+ * -+ * - 64b utiles of pixels in a raster-order grid according to cpp. It's 4x4 -+ * pixels at 32 bit depth. -+ * -+ * - 1k subtiles made of a 4x4 raster-order grid of 64b utiles (so usually -+ * 16x16 pixels). -+ * -+ * - 4k tiles made of a 2x2 grid of 1k subtiles (so usually 32x32 pixels). On -+ * even 4k tile rows, they're arranged as (BL, TL, TR, BR), and on odd rows -+ * they're (TR, BR, BL, TL), where bottom left is start of memory. -+ * -+ * - an image made of 4k tiles in rows either left-to-right (even rows of 4k -+ * tiles) or right-to-left (odd rows of 4k tiles). -+ */ -+#define DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED fourcc_mod_code(BROADCOM, 1) -+ -+/* -+ * Broadcom SAND format -+ * -+ * This is the native format that the H.264 codec block uses. For VC4 -+ * HVS, it is only valid for H.264 (NV12/21) and RGBA modes. -+ * -+ * The image can be considered to be split into columns, and the -+ * columns are placed consecutively into memory. The width of those -+ * columns can be either 32, 64, 128, or 256 pixels, but in practice -+ * only 128 pixel columns are used. -+ * -+ * The pitch between the start of each column is set to optimally -+ * switch between SDRAM banks. This is passed as the number of lines -+ * of column width in the modifier (we can't use the stride value due -+ * to various core checks that look at it , so you should set the -+ * stride to width*cpp). -+ * -+ * Note that the column height for this format modifier is the same -+ * for all of the planes, assuming that each column contains both Y -+ * and UV. Some SAND-using hardware stores UV in a separate tiled -+ * image from Y to reduce the column height, which is not supported -+ * with these modifiers. -+ */ -+ -+#define DRM_FORMAT_MOD_BROADCOM_SAND32_COL_HEIGHT(v) \ -+ fourcc_mod_broadcom_code(2, v) -+#define DRM_FORMAT_MOD_BROADCOM_SAND64_COL_HEIGHT(v) \ -+ fourcc_mod_broadcom_code(3, v) -+#define DRM_FORMAT_MOD_BROADCOM_SAND128_COL_HEIGHT(v) \ -+ fourcc_mod_broadcom_code(4, v) -+#define DRM_FORMAT_MOD_BROADCOM_SAND256_COL_HEIGHT(v) \ -+ fourcc_mod_broadcom_code(5, v) -+ -+#define DRM_FORMAT_MOD_BROADCOM_SAND32 \ -+ DRM_FORMAT_MOD_BROADCOM_SAND32_COL_HEIGHT(0) -+#define DRM_FORMAT_MOD_BROADCOM_SAND64 \ -+ DRM_FORMAT_MOD_BROADCOM_SAND64_COL_HEIGHT(0) -+#define DRM_FORMAT_MOD_BROADCOM_SAND128 \ -+ DRM_FORMAT_MOD_BROADCOM_SAND128_COL_HEIGHT(0) -+#define DRM_FORMAT_MOD_BROADCOM_SAND256 \ -+ DRM_FORMAT_MOD_BROADCOM_SAND256_COL_HEIGHT(0) -+ -+/* Broadcom UIF format -+ * -+ * This is the common format for the current Broadcom multimedia -+ * blocks, including V3D 3.x and newer, newer video codecs, and -+ * displays. -+ * -+ * The image consists of utiles (64b blocks), UIF blocks (2x2 utiles), -+ * and macroblocks (4x4 UIF blocks). Those 4x4 UIF block groups are -+ * stored in columns, with padding between the columns to ensure that -+ * moving from one column to the next doesn't hit the same SDRAM page -+ * bank. -+ * -+ * To calculate the padding, it is assumed that each hardware block -+ * and the software driving it knows the platform's SDRAM page size, -+ * number of banks, and XOR address, and that it's identical between -+ * all blocks using the format. This tiling modifier will use XOR as -+ * necessary to reduce the padding. If a hardware block can't do XOR, -+ * the assumption is that a no-XOR tiling modifier will be created. -+ */ -+#define DRM_FORMAT_MOD_BROADCOM_UIF fourcc_mod_code(BROADCOM, 6) -+ -+/* -+ * Arm Framebuffer Compression (AFBC) modifiers -+ * -+ * AFBC is a proprietary lossless image compression protocol and format. -+ * It provides fine-grained random access and minimizes the amount of data -+ * transferred between IP blocks. -+ * -+ * AFBC has several features which may be supported and/or used, which are -+ * represented using bits in the modifier. Not all combinations are valid, -+ * and different devices or use-cases may support different combinations. -+ * -+ * Further information on the use of AFBC modifiers can be found in -+ * Documentation/gpu/afbc.rst -+ */ -+ -+/* -+ * The top 4 bits (out of the 56 bits alloted for specifying vendor specific -+ * modifiers) denote the category for modifiers. Currently we have three -+ * categories of modifiers ie AFBC, MISC and AFRC. We can have a maximum of -+ * sixteen different categories. -+ */ -+#define DRM_FORMAT_MOD_ARM_CODE(__type, __val) \ -+ fourcc_mod_code(ARM, ((__u64)(__type) << 52) | ((__val) & 0x000fffffffffffffULL)) -+ -+#define DRM_FORMAT_MOD_ARM_TYPE_AFBC 0x00 -+#define DRM_FORMAT_MOD_ARM_TYPE_MISC 0x01 -+ -+#define DRM_FORMAT_MOD_ARM_AFBC(__afbc_mode) \ -+ DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_AFBC, __afbc_mode) -+ -+/* -+ * AFBC superblock size -+ * -+ * Indicates the superblock size(s) used for the AFBC buffer. The buffer -+ * size (in pixels) must be aligned to a multiple of the superblock size. -+ * Four lowest significant bits(LSBs) are reserved for block size. -+ * -+ * Where one superblock size is specified, it applies to all planes of the -+ * buffer (e.g. 16x16, 32x8). When multiple superblock sizes are specified, -+ * the first applies to the Luma plane and the second applies to the Chroma -+ * plane(s). e.g. (32x8_64x4 means 32x8 Luma, with 64x4 Chroma). -+ * Multiple superblock sizes are only valid for multi-plane YCbCr formats. -+ */ -+#define AFBC_FORMAT_MOD_BLOCK_SIZE_MASK 0xf -+#define AFBC_FORMAT_MOD_BLOCK_SIZE_16x16 (1ULL) -+#define AFBC_FORMAT_MOD_BLOCK_SIZE_32x8 (2ULL) -+#define AFBC_FORMAT_MOD_BLOCK_SIZE_64x4 (3ULL) -+#define AFBC_FORMAT_MOD_BLOCK_SIZE_32x8_64x4 (4ULL) -+ -+/* -+ * AFBC lossless colorspace transform -+ * -+ * Indicates that the buffer makes use of the AFBC lossless colorspace -+ * transform. -+ */ -+#define AFBC_FORMAT_MOD_YTR (1ULL << 4) -+ -+/* -+ * AFBC block-split -+ * -+ * Indicates that the payload of each superblock is split. The second -+ * half of the payload is positioned at a predefined offset from the start -+ * of the superblock payload. -+ */ -+#define AFBC_FORMAT_MOD_SPLIT (1ULL << 5) -+ -+/* -+ * AFBC sparse layout -+ * -+ * This flag indicates that the payload of each superblock must be stored at a -+ * predefined position relative to the other superblocks in the same AFBC -+ * buffer. This order is the same order used by the header buffer. In this mode -+ * each superblock is given the same amount of space as an uncompressed -+ * superblock of the particular format would require, rounding up to the next -+ * multiple of 128 bytes in size. -+ */ -+#define AFBC_FORMAT_MOD_SPARSE (1ULL << 6) -+ -+/* -+ * AFBC copy-block restrict -+ * -+ * Buffers with this flag must obey the copy-block restriction. The restriction -+ * is such that there are no copy-blocks referring across the border of 8x8 -+ * blocks. For the subsampled data the 8x8 limitation is also subsampled. -+ */ -+#define AFBC_FORMAT_MOD_CBR (1ULL << 7) -+ -+/* -+ * AFBC tiled layout -+ * -+ * The tiled layout groups superblocks in 8x8 or 4x4 tiles, where all -+ * superblocks inside a tile are stored together in memory. 8x8 tiles are used -+ * for pixel formats up to and including 32 bpp while 4x4 tiles are used for -+ * larger bpp formats. The order between the tiles is scan line. -+ * When the tiled layout is used, the buffer size (in pixels) must be aligned -+ * to the tile size. -+ */ -+#define AFBC_FORMAT_MOD_TILED (1ULL << 8) -+ -+/* -+ * AFBC solid color blocks -+ * -+ * Indicates that the buffer makes use of solid-color blocks, whereby bandwidth -+ * can be reduced if a whole superblock is a single color. -+ */ -+#define AFBC_FORMAT_MOD_SC (1ULL << 9) -+ -+/* -+ * AFBC double-buffer -+ * -+ * Indicates that the buffer is allocated in a layout safe for front-buffer -+ * rendering. -+ */ -+#define AFBC_FORMAT_MOD_DB (1ULL << 10) -+ -+/* -+ * AFBC buffer content hints -+ * -+ * Indicates that the buffer includes per-superblock content hints. -+ */ -+#define AFBC_FORMAT_MOD_BCH (1ULL << 11) -+ -+/* AFBC uncompressed storage mode -+ * -+ * Indicates that the buffer is using AFBC uncompressed storage mode. -+ * In this mode all superblock payloads in the buffer use the uncompressed -+ * storage mode, which is usually only used for data which cannot be compressed. -+ * The buffer layout is the same as for AFBC buffers without USM set, this only -+ * affects the storage mode of the individual superblocks. Note that even a -+ * buffer without USM set may use uncompressed storage mode for some or all -+ * superblocks, USM just guarantees it for all. -+ */ -+#define AFBC_FORMAT_MOD_USM (1ULL << 12) -+ -+/* -+ * Arm Fixed-Rate Compression (AFRC) modifiers -+ * -+ * AFRC is a proprietary fixed rate image compression protocol and format, -+ * designed to provide guaranteed bandwidth and memory footprint -+ * reductions in graphics and media use-cases. -+ * -+ * AFRC buffers consist of one or more planes, with the same components -+ * and meaning as an uncompressed buffer using the same pixel format. -+ * -+ * Within each plane, the pixel/luma/chroma values are grouped into -+ * "coding unit" blocks which are individually compressed to a -+ * fixed size (in bytes). All coding units within a given plane of a buffer -+ * store the same number of values, and have the same compressed size. -+ * -+ * The coding unit size is configurable, allowing different rates of compression. -+ * -+ * The start of each AFRC buffer plane must be aligned to an alignment granule which -+ * depends on the coding unit size. -+ * -+ * Coding Unit Size Plane Alignment -+ * ---------------- --------------- -+ * 16 bytes 1024 bytes -+ * 24 bytes 512 bytes -+ * 32 bytes 2048 bytes -+ * -+ * Coding units are grouped into paging tiles. AFRC buffer dimensions must be aligned -+ * to a multiple of the paging tile dimensions. -+ * The dimensions of each paging tile depend on whether the buffer is optimised for -+ * scanline (SCAN layout) or rotated (ROT layout) access. -+ * -+ * Layout Paging Tile Width Paging Tile Height -+ * ------ ----------------- ------------------ -+ * SCAN 16 coding units 4 coding units -+ * ROT 8 coding units 8 coding units -+ * -+ * The dimensions of each coding unit depend on the number of components -+ * in the compressed plane and whether the buffer is optimised for -+ * scanline (SCAN layout) or rotated (ROT layout) access. -+ * -+ * Number of Components in Plane Layout Coding Unit Width Coding Unit Height -+ * ----------------------------- --------- ----------------- ------------------ -+ * 1 SCAN 16 samples 4 samples -+ * Example: 16x4 luma samples in a 'Y' plane -+ * 16x4 chroma 'V' values, in the 'V' plane of a fully-planar YUV buffer -+ * ----------------------------- --------- ----------------- ------------------ -+ * 1 ROT 8 samples 8 samples -+ * Example: 8x8 luma samples in a 'Y' plane -+ * 8x8 chroma 'V' values, in the 'V' plane of a fully-planar YUV buffer -+ * ----------------------------- --------- ----------------- ------------------ -+ * 2 DONT CARE 8 samples 4 samples -+ * Example: 8x4 chroma pairs in the 'UV' plane of a semi-planar YUV buffer -+ * ----------------------------- --------- ----------------- ------------------ -+ * 3 DONT CARE 4 samples 4 samples -+ * Example: 4x4 pixels in an RGB buffer without alpha -+ * ----------------------------- --------- ----------------- ------------------ -+ * 4 DONT CARE 4 samples 4 samples -+ * Example: 4x4 pixels in an RGB buffer with alpha -+ */ -+ -+#define DRM_FORMAT_MOD_ARM_TYPE_AFRC 0x02 -+ -+#define DRM_FORMAT_MOD_ARM_AFRC(__afrc_mode) \ -+ DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_AFRC, __afrc_mode) -+ -+/* -+ * AFRC coding unit size modifier. -+ * -+ * Indicates the number of bytes used to store each compressed coding unit for -+ * one or more planes in an AFRC encoded buffer. The coding unit size for chrominance -+ * is the same for both Cb and Cr, which may be stored in separate planes. -+ * -+ * AFRC_FORMAT_MOD_CU_SIZE_P0 indicates the number of bytes used to store -+ * each compressed coding unit in the first plane of the buffer. For RGBA buffers -+ * this is the only plane, while for semi-planar and fully-planar YUV buffers, -+ * this corresponds to the luma plane. -+ * -+ * AFRC_FORMAT_MOD_CU_SIZE_P12 indicates the number of bytes used to store -+ * each compressed coding unit in the second and third planes in the buffer. -+ * For semi-planar and fully-planar YUV buffers, this corresponds to the chroma plane(s). -+ * -+ * For single-plane buffers, AFRC_FORMAT_MOD_CU_SIZE_P0 must be specified -+ * and AFRC_FORMAT_MOD_CU_SIZE_P12 must be zero. -+ * For semi-planar and fully-planar buffers, both AFRC_FORMAT_MOD_CU_SIZE_P0 and -+ * AFRC_FORMAT_MOD_CU_SIZE_P12 must be specified. -+ */ -+#define AFRC_FORMAT_MOD_CU_SIZE_MASK 0xf -+#define AFRC_FORMAT_MOD_CU_SIZE_16 (1ULL) -+#define AFRC_FORMAT_MOD_CU_SIZE_24 (2ULL) -+#define AFRC_FORMAT_MOD_CU_SIZE_32 (3ULL) -+ -+#define AFRC_FORMAT_MOD_CU_SIZE_P0(__afrc_cu_size) (__afrc_cu_size) -+#define AFRC_FORMAT_MOD_CU_SIZE_P12(__afrc_cu_size) ((__afrc_cu_size) << 4) -+ -+/* -+ * AFRC scanline memory layout. -+ * -+ * Indicates if the buffer uses the scanline-optimised layout -+ * for an AFRC encoded buffer, otherwise, it uses the rotation-optimised layout. -+ * The memory layout is the same for all planes. -+ */ -+#define AFRC_FORMAT_MOD_LAYOUT_SCAN (1ULL << 8) -+ -+/* -+ * Arm 16x16 Block U-Interleaved modifier -+ * -+ * This is used by Arm Mali Utgard and Midgard GPUs. It divides the image -+ * into 16x16 pixel blocks. Blocks are stored linearly in order, but pixels -+ * in the block are reordered. -+ */ -+#define DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED \ -+ DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_MISC, 1ULL) -+ -+/* -+ * Allwinner tiled modifier -+ * -+ * This tiling mode is implemented by the VPU found on all Allwinner platforms, -+ * codenamed sunxi. It is associated with a YUV format that uses either 2 or 3 -+ * planes. -+ * -+ * With this tiling, the luminance samples are disposed in tiles representing -+ * 32x32 pixels and the chrominance samples in tiles representing 32x64 pixels. -+ * The pixel order in each tile is linear and the tiles are disposed linearly, -+ * both in row-major order. -+ */ -+#define DRM_FORMAT_MOD_ALLWINNER_TILED fourcc_mod_code(ALLWINNER, 1) -+ -+/* -+ * Amlogic Video Framebuffer Compression modifiers -+ * -+ * Amlogic uses a proprietary lossless image compression protocol and format -+ * for their hardware video codec accelerators, either video decoders or -+ * video input encoders. -+ * -+ * It considerably reduces memory bandwidth while writing and reading -+ * frames in memory. -+ * -+ * The underlying storage is considered to be 3 components, 8bit or 10-bit -+ * per component YCbCr 420, single plane : -+ * - DRM_FORMAT_YUV420_8BIT -+ * - DRM_FORMAT_YUV420_10BIT -+ * -+ * The first 8 bits of the mode defines the layout, then the following 8 bits -+ * defines the options changing the layout. -+ * -+ * Not all combinations are valid, and different SoCs may support different -+ * combinations of layout and options. -+ */ -+#define __fourcc_mod_amlogic_layout_mask 0xff -+#define __fourcc_mod_amlogic_options_shift 8 -+#define __fourcc_mod_amlogic_options_mask 0xff -+ -+#define DRM_FORMAT_MOD_AMLOGIC_FBC(__layout, __options) \ -+ fourcc_mod_code(AMLOGIC, \ -+ ((__layout) & __fourcc_mod_amlogic_layout_mask) | \ -+ (((__options) & __fourcc_mod_amlogic_options_mask) \ -+ << __fourcc_mod_amlogic_options_shift)) -+ -+/* Amlogic FBC Layouts */ -+ -+/* -+ * Amlogic FBC Basic Layout -+ * -+ * The basic layout is composed of: -+ * - a body content organized in 64x32 superblocks with 4096 bytes per -+ * superblock in default mode. -+ * - a 32 bytes per 128x64 header block -+ * -+ * This layout is transferrable between Amlogic SoCs supporting this modifier. -+ */ -+#define AMLOGIC_FBC_LAYOUT_BASIC (1ULL) -+ -+/* -+ * Amlogic FBC Scatter Memory layout -+ * -+ * Indicates the header contains IOMMU references to the compressed -+ * frames content to optimize memory access and layout. -+ * -+ * In this mode, only the header memory address is needed, thus the -+ * content memory organization is tied to the current producer -+ * execution and cannot be saved/dumped neither transferrable between -+ * Amlogic SoCs supporting this modifier. -+ * -+ * Due to the nature of the layout, these buffers are not expected to -+ * be accessible by the user-space clients, but only accessible by the -+ * hardware producers and consumers. -+ * -+ * The user-space clients should expect a failure while trying to mmap -+ * the DMA-BUF handle returned by the producer. -+ */ -+#define AMLOGIC_FBC_LAYOUT_SCATTER (2ULL) -+ -+/* Amlogic FBC Layout Options Bit Mask */ -+ -+/* -+ * Amlogic FBC Memory Saving mode -+ * -+ * Indicates the storage is packed when pixel size is multiple of word -+ * boudaries, i.e. 8bit should be stored in this mode to save allocation -+ * memory. -+ * -+ * This mode reduces body layout to 3072 bytes per 64x32 superblock with -+ * the basic layout and 3200 bytes per 64x32 superblock combined with -+ * the scatter layout. -+ */ -+#define AMLOGIC_FBC_OPTION_MEM_SAVING (1ULL << 0) -+ -+/* -+ * AMD modifiers -+ * -+ * Memory layout: -+ * -+ * without DCC: -+ * - main surface -+ * -+ * with DCC & without DCC_RETILE: -+ * - main surface in plane 0 -+ * - DCC surface in plane 1 (RB-aligned, pipe-aligned if DCC_PIPE_ALIGN is set) -+ * -+ * with DCC & DCC_RETILE: -+ * - main surface in plane 0 -+ * - displayable DCC surface in plane 1 (not RB-aligned & not pipe-aligned) -+ * - pipe-aligned DCC surface in plane 2 (RB-aligned & pipe-aligned) -+ * -+ * For multi-plane formats the above surfaces get merged into one plane for -+ * each format plane, based on the required alignment only. -+ * -+ * Bits Parameter Notes -+ * ----- ------------------------ --------------------------------------------- -+ * -+ * 7:0 TILE_VERSION Values are AMD_FMT_MOD_TILE_VER_* -+ * 12:8 TILE Values are AMD_FMT_MOD_TILE__* -+ * 13 DCC -+ * 14 DCC_RETILE -+ * 15 DCC_PIPE_ALIGN -+ * 16 DCC_INDEPENDENT_64B -+ * 17 DCC_INDEPENDENT_128B -+ * 19:18 DCC_MAX_COMPRESSED_BLOCK Values are AMD_FMT_MOD_DCC_BLOCK_* -+ * 20 DCC_CONSTANT_ENCODE -+ * 23:21 PIPE_XOR_BITS Only for some chips -+ * 26:24 BANK_XOR_BITS Only for some chips -+ * 29:27 PACKERS Only for some chips -+ * 32:30 RB Only for some chips -+ * 35:33 PIPE Only for some chips -+ * 55:36 - Reserved for future use, must be zero -+ */ -+#define AMD_FMT_MOD fourcc_mod_code(AMD, 0) -+ -+#define IS_AMD_FMT_MOD(val) (((val) >> 56) == DRM_FORMAT_MOD_VENDOR_AMD) -+ -+/* Reserve 0 for GFX8 and older */ -+#define AMD_FMT_MOD_TILE_VER_GFX9 1 -+#define AMD_FMT_MOD_TILE_VER_GFX10 2 -+#define AMD_FMT_MOD_TILE_VER_GFX10_RBPLUS 3 -+ -+/* -+ * 64K_S is the same for GFX9/GFX10/GFX10_RBPLUS and hence has GFX9 as canonical -+ * version. -+ */ -+#define AMD_FMT_MOD_TILE_GFX9_64K_S 9 -+ -+/* -+ * 64K_D for non-32 bpp is the same for GFX9/GFX10/GFX10_RBPLUS and hence has -+ * GFX9 as canonical version. -+ */ -+#define AMD_FMT_MOD_TILE_GFX9_64K_D 10 -+#define AMD_FMT_MOD_TILE_GFX9_64K_S_X 25 -+#define AMD_FMT_MOD_TILE_GFX9_64K_D_X 26 -+#define AMD_FMT_MOD_TILE_GFX9_64K_R_X 27 -+ -+#define AMD_FMT_MOD_DCC_BLOCK_64B 0 -+#define AMD_FMT_MOD_DCC_BLOCK_128B 1 -+#define AMD_FMT_MOD_DCC_BLOCK_256B 2 -+ -+#define AMD_FMT_MOD_TILE_VERSION_SHIFT 0 -+#define AMD_FMT_MOD_TILE_VERSION_MASK 0xFF -+#define AMD_FMT_MOD_TILE_SHIFT 8 -+#define AMD_FMT_MOD_TILE_MASK 0x1F -+ -+/* Whether DCC compression is enabled. */ -+#define AMD_FMT_MOD_DCC_SHIFT 13 -+#define AMD_FMT_MOD_DCC_MASK 0x1 -+ -+/* -+ * Whether to include two DCC surfaces, one which is rb & pipe aligned, and -+ * one which is not-aligned. -+ */ -+#define AMD_FMT_MOD_DCC_RETILE_SHIFT 14 -+#define AMD_FMT_MOD_DCC_RETILE_MASK 0x1 -+ -+/* Only set if DCC_RETILE = false */ -+#define AMD_FMT_MOD_DCC_PIPE_ALIGN_SHIFT 15 -+#define AMD_FMT_MOD_DCC_PIPE_ALIGN_MASK 0x1 -+ -+#define AMD_FMT_MOD_DCC_INDEPENDENT_64B_SHIFT 16 -+#define AMD_FMT_MOD_DCC_INDEPENDENT_64B_MASK 0x1 -+#define AMD_FMT_MOD_DCC_INDEPENDENT_128B_SHIFT 17 -+#define AMD_FMT_MOD_DCC_INDEPENDENT_128B_MASK 0x1 -+#define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_SHIFT 18 -+#define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_MASK 0x3 -+ -+/* -+ * DCC supports embedding some clear colors directly in the DCC surface. -+ * However, on older GPUs the rendering HW ignores the embedded clear color -+ * and prefers the driver provided color. This necessitates doing a fastclear -+ * eliminate operation before a process transfers control. -+ * -+ * If this bit is set that means the fastclear eliminate is not needed for these -+ * embeddable colors. -+ */ -+#define AMD_FMT_MOD_DCC_CONSTANT_ENCODE_SHIFT 20 -+#define AMD_FMT_MOD_DCC_CONSTANT_ENCODE_MASK 0x1 -+ -+/* -+ * The below fields are for accounting for per GPU differences. These are only -+ * relevant for GFX9 and later and if the tile field is *_X/_T. -+ * -+ * PIPE_XOR_BITS = always needed -+ * BANK_XOR_BITS = only for TILE_VER_GFX9 -+ * PACKERS = only for TILE_VER_GFX10_RBPLUS -+ * RB = only for TILE_VER_GFX9 & DCC -+ * PIPE = only for TILE_VER_GFX9 & DCC & (DCC_RETILE | DCC_PIPE_ALIGN) -+ */ -+#define AMD_FMT_MOD_PIPE_XOR_BITS_SHIFT 21 -+#define AMD_FMT_MOD_PIPE_XOR_BITS_MASK 0x7 -+#define AMD_FMT_MOD_BANK_XOR_BITS_SHIFT 24 -+#define AMD_FMT_MOD_BANK_XOR_BITS_MASK 0x7 -+#define AMD_FMT_MOD_PACKERS_SHIFT 27 -+#define AMD_FMT_MOD_PACKERS_MASK 0x7 -+#define AMD_FMT_MOD_RB_SHIFT 30 -+#define AMD_FMT_MOD_RB_MASK 0x7 -+#define AMD_FMT_MOD_PIPE_SHIFT 33 -+#define AMD_FMT_MOD_PIPE_MASK 0x7 -+ -+#define AMD_FMT_MOD_SET(field, value) \ -+ ((uint64_t)(value) << AMD_FMT_MOD_##field##_SHIFT) -+#define AMD_FMT_MOD_GET(field, value) \ -+ (((value) >> AMD_FMT_MOD_##field##_SHIFT) & AMD_FMT_MOD_##field##_MASK) -+#define AMD_FMT_MOD_CLEAR(field) \ -+ (~((uint64_t)AMD_FMT_MOD_##field##_MASK << AMD_FMT_MOD_##field##_SHIFT)) -+ -+#if defined(__cplusplus) -+} -+#endif -+ -+#endif /* DRM_FOURCC_H */ -diff -up firefox-109.0/third_party/drm/drm/drm.h.libwebrtc-screen-cast-sync firefox-109.0/third_party/drm/drm/drm.h ---- firefox-109.0/third_party/drm/drm/drm.h.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.193614089 +0100 -+++ firefox-109.0/third_party/drm/drm/drm.h 2023-01-12 15:16:09.193614089 +0100 -@@ -0,0 +1,1193 @@ -+/* -+ * Header for the Direct Rendering Manager -+ * -+ * Author: Rickard E. (Rik) Faith -+ * -+ * Acknowledgments: -+ * Dec 1999, Richard Henderson , move to generic cmpxchg. -+ */ -+ -+/* -+ * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. -+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. -+ * All rights reserved. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#ifndef _DRM_H_ -+#define _DRM_H_ -+ -+#if defined(__linux__) -+ -+#include -+#include -+typedef unsigned int drm_handle_t; -+ -+#else /* One of the BSDs */ -+ -+#include -+#include -+#include -+typedef int8_t __s8; -+typedef uint8_t __u8; -+typedef int16_t __s16; -+typedef uint16_t __u16; -+typedef int32_t __s32; -+typedef uint32_t __u32; -+typedef int64_t __s64; -+typedef uint64_t __u64; -+typedef size_t __kernel_size_t; -+typedef unsigned long drm_handle_t; -+ -+#endif -+ -+#if defined(__cplusplus) -+extern "C" { -+#endif -+ -+#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */ -+#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */ -+#define DRM_MAX_ORDER 22 /**< Up to 2^22 bytes = 4MB */ -+#define DRM_RAM_PERCENT 10 /**< How much system ram can we lock? */ -+ -+#define _DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */ -+#define _DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */ -+#define _DRM_LOCK_IS_HELD(lock) ((lock) & _DRM_LOCK_HELD) -+#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT) -+#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) -+ -+typedef unsigned int drm_context_t; -+typedef unsigned int drm_drawable_t; -+typedef unsigned int drm_magic_t; -+ -+/* -+ * Cliprect. -+ * -+ * \warning: If you change this structure, make sure you change -+ * XF86DRIClipRectRec in the server as well -+ * -+ * \note KW: Actually it's illegal to change either for -+ * backwards-compatibility reasons. -+ */ -+struct drm_clip_rect { -+ unsigned short x1; -+ unsigned short y1; -+ unsigned short x2; -+ unsigned short y2; -+}; -+ -+/* -+ * Drawable information. -+ */ -+struct drm_drawable_info { -+ unsigned int num_rects; -+ struct drm_clip_rect *rects; -+}; -+ -+/* -+ * Texture region, -+ */ -+struct drm_tex_region { -+ unsigned char next; -+ unsigned char prev; -+ unsigned char in_use; -+ unsigned char padding; -+ unsigned int age; -+}; -+ -+/* -+ * Hardware lock. -+ * -+ * The lock structure is a simple cache-line aligned integer. To avoid -+ * processor bus contention on a multiprocessor system, there should not be any -+ * other data stored in the same cache line. -+ */ -+struct drm_hw_lock { -+ __volatile__ unsigned int lock; /**< lock variable */ -+ char padding[60]; /**< Pad to cache line */ -+}; -+ -+/* -+ * DRM_IOCTL_VERSION ioctl argument type. -+ * -+ * \sa drmGetVersion(). -+ */ -+struct drm_version { -+ int version_major; /**< Major version */ -+ int version_minor; /**< Minor version */ -+ int version_patchlevel; /**< Patch level */ -+ __kernel_size_t name_len; /**< Length of name buffer */ -+ char *name; /**< Name of driver */ -+ __kernel_size_t date_len; /**< Length of date buffer */ -+ char *date; /**< User-space buffer to hold date */ -+ __kernel_size_t desc_len; /**< Length of desc buffer */ -+ char *desc; /**< User-space buffer to hold desc */ -+}; -+ -+/* -+ * DRM_IOCTL_GET_UNIQUE ioctl argument type. -+ * -+ * \sa drmGetBusid() and drmSetBusId(). -+ */ -+struct drm_unique { -+ __kernel_size_t unique_len; /**< Length of unique */ -+ char *unique; /**< Unique name for driver instantiation */ -+}; -+ -+struct drm_list { -+ int count; /**< Length of user-space structures */ -+ struct drm_version *version; -+}; -+ -+struct drm_block { -+ int unused; -+}; -+ -+/* -+ * DRM_IOCTL_CONTROL ioctl argument type. -+ * -+ * \sa drmCtlInstHandler() and drmCtlUninstHandler(). -+ */ -+struct drm_control { -+ enum { -+ DRM_ADD_COMMAND, -+ DRM_RM_COMMAND, -+ DRM_INST_HANDLER, -+ DRM_UNINST_HANDLER -+ } func; -+ int irq; -+}; -+ -+/* -+ * Type of memory to map. -+ */ -+enum drm_map_type { -+ _DRM_FRAME_BUFFER = 0, /**< WC (no caching), no core dump */ -+ _DRM_REGISTERS = 1, /**< no caching, no core dump */ -+ _DRM_SHM = 2, /**< shared, cached */ -+ _DRM_AGP = 3, /**< AGP/GART */ -+ _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */ -+ _DRM_CONSISTENT = 5 /**< Consistent memory for PCI DMA */ -+}; -+ -+/* -+ * Memory mapping flags. -+ */ -+enum drm_map_flags { -+ _DRM_RESTRICTED = 0x01, /**< Cannot be mapped to user-virtual */ -+ _DRM_READ_ONLY = 0x02, -+ _DRM_LOCKED = 0x04, /**< shared, cached, locked */ -+ _DRM_KERNEL = 0x08, /**< kernel requires access */ -+ _DRM_WRITE_COMBINING = 0x10, /**< use write-combining if available */ -+ _DRM_CONTAINS_LOCK = 0x20, /**< SHM page that contains lock */ -+ _DRM_REMOVABLE = 0x40, /**< Removable mapping */ -+ _DRM_DRIVER = 0x80 /**< Managed by driver */ -+}; -+ -+struct drm_ctx_priv_map { -+ unsigned int ctx_id; /**< Context requesting private mapping */ -+ void *handle; /**< Handle of map */ -+}; -+ -+/* -+ * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls -+ * argument type. -+ * -+ * \sa drmAddMap(). -+ */ -+struct drm_map { -+ unsigned long offset; /**< Requested physical address (0 for SAREA)*/ -+ unsigned long size; /**< Requested physical size (bytes) */ -+ enum drm_map_type type; /**< Type of memory to map */ -+ enum drm_map_flags flags; /**< Flags */ -+ void *handle; /**< User-space: "Handle" to pass to mmap() */ -+ /**< Kernel-space: kernel-virtual address */ -+ int mtrr; /**< MTRR slot used */ -+ /* Private data */ -+}; -+ -+/* -+ * DRM_IOCTL_GET_CLIENT ioctl argument type. -+ */ -+struct drm_client { -+ int idx; /**< Which client desired? */ -+ int auth; /**< Is client authenticated? */ -+ unsigned long pid; /**< Process ID */ -+ unsigned long uid; /**< User ID */ -+ unsigned long magic; /**< Magic */ -+ unsigned long iocs; /**< Ioctl count */ -+}; -+ -+enum drm_stat_type { -+ _DRM_STAT_LOCK, -+ _DRM_STAT_OPENS, -+ _DRM_STAT_CLOSES, -+ _DRM_STAT_IOCTLS, -+ _DRM_STAT_LOCKS, -+ _DRM_STAT_UNLOCKS, -+ _DRM_STAT_VALUE, /**< Generic value */ -+ _DRM_STAT_BYTE, /**< Generic byte counter (1024bytes/K) */ -+ _DRM_STAT_COUNT, /**< Generic non-byte counter (1000/k) */ -+ -+ _DRM_STAT_IRQ, /**< IRQ */ -+ _DRM_STAT_PRIMARY, /**< Primary DMA bytes */ -+ _DRM_STAT_SECONDARY, /**< Secondary DMA bytes */ -+ _DRM_STAT_DMA, /**< DMA */ -+ _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */ -+ _DRM_STAT_MISSED /**< Missed DMA opportunity */ -+ /* Add to the *END* of the list */ -+}; -+ -+/* -+ * DRM_IOCTL_GET_STATS ioctl argument type. -+ */ -+struct drm_stats { -+ unsigned long count; -+ struct { -+ unsigned long value; -+ enum drm_stat_type type; -+ } data[15]; -+}; -+ -+/* -+ * Hardware locking flags. -+ */ -+enum drm_lock_flags { -+ _DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */ -+ _DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */ -+ _DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */ -+ _DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */ -+ /* These *HALT* flags aren't supported yet -+ -- they will be used to support the -+ full-screen DGA-like mode. */ -+ _DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */ -+ _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ -+}; -+ -+/* -+ * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type. -+ * -+ * \sa drmGetLock() and drmUnlock(). -+ */ -+struct drm_lock { -+ int context; -+ enum drm_lock_flags flags; -+}; -+ -+/* -+ * DMA flags -+ * -+ * \warning -+ * These values \e must match xf86drm.h. -+ * -+ * \sa drm_dma. -+ */ -+enum drm_dma_flags { -+ /* Flags for DMA buffer dispatch */ -+ _DRM_DMA_BLOCK = 0x01, /**< -+ * Block until buffer dispatched. -+ * -+ * \note The buffer may not yet have -+ * been processed by the hardware -- -+ * getting a hardware lock with the -+ * hardware quiescent will ensure -+ * that the buffer has been -+ * processed. -+ */ -+ _DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */ -+ _DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */ -+ -+ /* Flags for DMA buffer request */ -+ _DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */ -+ _DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */ -+ _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ -+}; -+ -+/* -+ * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type. -+ * -+ * \sa drmAddBufs(). -+ */ -+struct drm_buf_desc { -+ int count; /**< Number of buffers of this size */ -+ int size; /**< Size in bytes */ -+ int low_mark; /**< Low water mark */ -+ int high_mark; /**< High water mark */ -+ enum { -+ _DRM_PAGE_ALIGN = 0x01, /**< Align on page boundaries for DMA */ -+ _DRM_AGP_BUFFER = 0x02, /**< Buffer is in AGP space */ -+ _DRM_SG_BUFFER = 0x04, /**< Scatter/gather memory buffer */ -+ _DRM_FB_BUFFER = 0x08, /**< Buffer is in frame buffer */ -+ _DRM_PCI_BUFFER_RO = 0x10 /**< Map PCI DMA buffer read-only */ -+ } flags; -+ unsigned long agp_start; /**< -+ * Start address of where the AGP buffers are -+ * in the AGP aperture -+ */ -+}; -+ -+/* -+ * DRM_IOCTL_INFO_BUFS ioctl argument type. -+ */ -+struct drm_buf_info { -+ int count; /**< Entries in list */ -+ struct drm_buf_desc *list; -+}; -+ -+/* -+ * DRM_IOCTL_FREE_BUFS ioctl argument type. -+ */ -+struct drm_buf_free { -+ int count; -+ int *list; -+}; -+ -+/* -+ * Buffer information -+ * -+ * \sa drm_buf_map. -+ */ -+struct drm_buf_pub { -+ int idx; /**< Index into the master buffer list */ -+ int total; /**< Buffer size */ -+ int used; /**< Amount of buffer in use (for DMA) */ -+ void *address; /**< Address of buffer */ -+}; -+ -+/* -+ * DRM_IOCTL_MAP_BUFS ioctl argument type. -+ */ -+struct drm_buf_map { -+ int count; /**< Length of the buffer list */ -+#ifdef __cplusplus -+ void *virt; -+#else -+ void *virtual; /**< Mmap'd area in user-virtual */ -+#endif -+ struct drm_buf_pub *list; /**< Buffer information */ -+}; -+ -+/* -+ * DRM_IOCTL_DMA ioctl argument type. -+ * -+ * Indices here refer to the offset into the buffer list in drm_buf_get. -+ * -+ * \sa drmDMA(). -+ */ -+struct drm_dma { -+ int context; /**< Context handle */ -+ int send_count; /**< Number of buffers to send */ -+ int *send_indices; /**< List of handles to buffers */ -+ int *send_sizes; /**< Lengths of data to send */ -+ enum drm_dma_flags flags; /**< Flags */ -+ int request_count; /**< Number of buffers requested */ -+ int request_size; /**< Desired size for buffers */ -+ int *request_indices; /**< Buffer information */ -+ int *request_sizes; -+ int granted_count; /**< Number of buffers granted */ -+}; -+ -+enum drm_ctx_flags { -+ _DRM_CONTEXT_PRESERVED = 0x01, -+ _DRM_CONTEXT_2DONLY = 0x02 -+}; -+ -+/* -+ * DRM_IOCTL_ADD_CTX ioctl argument type. -+ * -+ * \sa drmCreateContext() and drmDestroyContext(). -+ */ -+struct drm_ctx { -+ drm_context_t handle; -+ enum drm_ctx_flags flags; -+}; -+ -+/* -+ * DRM_IOCTL_RES_CTX ioctl argument type. -+ */ -+struct drm_ctx_res { -+ int count; -+ struct drm_ctx *contexts; -+}; -+ -+/* -+ * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type. -+ */ -+struct drm_draw { -+ drm_drawable_t handle; -+}; -+ -+/* -+ * DRM_IOCTL_UPDATE_DRAW ioctl argument type. -+ */ -+typedef enum { -+ DRM_DRAWABLE_CLIPRECTS -+} drm_drawable_info_type_t; -+ -+struct drm_update_draw { -+ drm_drawable_t handle; -+ unsigned int type; -+ unsigned int num; -+ unsigned long long data; -+}; -+ -+/* -+ * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type. -+ */ -+struct drm_auth { -+ drm_magic_t magic; -+}; -+ -+/* -+ * DRM_IOCTL_IRQ_BUSID ioctl argument type. -+ * -+ * \sa drmGetInterruptFromBusID(). -+ */ -+struct drm_irq_busid { -+ int irq; /**< IRQ number */ -+ int busnum; /**< bus number */ -+ int devnum; /**< device number */ -+ int funcnum; /**< function number */ -+}; -+ -+enum drm_vblank_seq_type { -+ _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ -+ _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ -+ /* bits 1-6 are reserved for high crtcs */ -+ _DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e, -+ _DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */ -+ _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ -+ _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ -+ _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ -+ _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking, unsupported */ -+}; -+#define _DRM_VBLANK_HIGH_CRTC_SHIFT 1 -+ -+#define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE) -+#define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \ -+ _DRM_VBLANK_SECONDARY | _DRM_VBLANK_NEXTONMISS) -+ -+struct drm_wait_vblank_request { -+ enum drm_vblank_seq_type type; -+ unsigned int sequence; -+ unsigned long signal; -+}; -+ -+struct drm_wait_vblank_reply { -+ enum drm_vblank_seq_type type; -+ unsigned int sequence; -+ long tval_sec; -+ long tval_usec; -+}; -+ -+/* -+ * DRM_IOCTL_WAIT_VBLANK ioctl argument type. -+ * -+ * \sa drmWaitVBlank(). -+ */ -+union drm_wait_vblank { -+ struct drm_wait_vblank_request request; -+ struct drm_wait_vblank_reply reply; -+}; -+ -+#define _DRM_PRE_MODESET 1 -+#define _DRM_POST_MODESET 2 -+ -+/* -+ * DRM_IOCTL_MODESET_CTL ioctl argument type -+ * -+ * \sa drmModesetCtl(). -+ */ -+struct drm_modeset_ctl { -+ __u32 crtc; -+ __u32 cmd; -+}; -+ -+/* -+ * DRM_IOCTL_AGP_ENABLE ioctl argument type. -+ * -+ * \sa drmAgpEnable(). -+ */ -+struct drm_agp_mode { -+ unsigned long mode; /**< AGP mode */ -+}; -+ -+/* -+ * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type. -+ * -+ * \sa drmAgpAlloc() and drmAgpFree(). -+ */ -+struct drm_agp_buffer { -+ unsigned long size; /**< In bytes -- will round to page boundary */ -+ unsigned long handle; /**< Used for binding / unbinding */ -+ unsigned long type; /**< Type of memory to allocate */ -+ unsigned long physical; /**< Physical used by i810 */ -+}; -+ -+/* -+ * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type. -+ * -+ * \sa drmAgpBind() and drmAgpUnbind(). -+ */ -+struct drm_agp_binding { -+ unsigned long handle; /**< From drm_agp_buffer */ -+ unsigned long offset; /**< In bytes -- will round to page boundary */ -+}; -+ -+/* -+ * DRM_IOCTL_AGP_INFO ioctl argument type. -+ * -+ * \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(), -+ * drmAgpBase(), drmAgpSize(), drmAgpMemoryUsed(), drmAgpMemoryAvail(), -+ * drmAgpVendorId() and drmAgpDeviceId(). -+ */ -+struct drm_agp_info { -+ int agp_version_major; -+ int agp_version_minor; -+ unsigned long mode; -+ unsigned long aperture_base; /* physical address */ -+ unsigned long aperture_size; /* bytes */ -+ unsigned long memory_allowed; /* bytes */ -+ unsigned long memory_used; -+ -+ /* PCI information */ -+ unsigned short id_vendor; -+ unsigned short id_device; -+}; -+ -+/* -+ * DRM_IOCTL_SG_ALLOC ioctl argument type. -+ */ -+struct drm_scatter_gather { -+ unsigned long size; /**< In bytes -- will round to page boundary */ -+ unsigned long handle; /**< Used for mapping / unmapping */ -+}; -+ -+/* -+ * DRM_IOCTL_SET_VERSION ioctl argument type. -+ */ -+struct drm_set_version { -+ int drm_di_major; -+ int drm_di_minor; -+ int drm_dd_major; -+ int drm_dd_minor; -+}; -+ -+/* DRM_IOCTL_GEM_CLOSE ioctl argument type */ -+struct drm_gem_close { -+ /** Handle of the object to be closed. */ -+ __u32 handle; -+ __u32 pad; -+}; -+ -+/* DRM_IOCTL_GEM_FLINK ioctl argument type */ -+struct drm_gem_flink { -+ /** Handle for the object being named */ -+ __u32 handle; -+ -+ /** Returned global name */ -+ __u32 name; -+}; -+ -+/* DRM_IOCTL_GEM_OPEN ioctl argument type */ -+struct drm_gem_open { -+ /** Name of object being opened */ -+ __u32 name; -+ -+ /** Returned handle for the object */ -+ __u32 handle; -+ -+ /** Returned size of the object */ -+ __u64 size; -+}; -+ -+/** -+ * DRM_CAP_DUMB_BUFFER -+ * -+ * If set to 1, the driver supports creating dumb buffers via the -+ * &DRM_IOCTL_MODE_CREATE_DUMB ioctl. -+ */ -+#define DRM_CAP_DUMB_BUFFER 0x1 -+/** -+ * DRM_CAP_VBLANK_HIGH_CRTC -+ * -+ * If set to 1, the kernel supports specifying a :ref:`CRTC index` -+ * in the high bits of &drm_wait_vblank_request.type. -+ * -+ * Starting kernel version 2.6.39, this capability is always set to 1. -+ */ -+#define DRM_CAP_VBLANK_HIGH_CRTC 0x2 -+/** -+ * DRM_CAP_DUMB_PREFERRED_DEPTH -+ * -+ * The preferred bit depth for dumb buffers. -+ * -+ * The bit depth is the number of bits used to indicate the color of a single -+ * pixel excluding any padding. This is different from the number of bits per -+ * pixel. For instance, XRGB8888 has a bit depth of 24 but has 32 bits per -+ * pixel. -+ * -+ * Note that this preference only applies to dumb buffers, it's irrelevant for -+ * other types of buffers. -+ */ -+#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3 -+/** -+ * DRM_CAP_DUMB_PREFER_SHADOW -+ * -+ * If set to 1, the driver prefers userspace to render to a shadow buffer -+ * instead of directly rendering to a dumb buffer. For best speed, userspace -+ * should do streaming ordered memory copies into the dumb buffer and never -+ * read from it. -+ * -+ * Note that this preference only applies to dumb buffers, it's irrelevant for -+ * other types of buffers. -+ */ -+#define DRM_CAP_DUMB_PREFER_SHADOW 0x4 -+/** -+ * DRM_CAP_PRIME -+ * -+ * Bitfield of supported PRIME sharing capabilities. See &DRM_PRIME_CAP_IMPORT -+ * and &DRM_PRIME_CAP_EXPORT. -+ * -+ * PRIME buffers are exposed as dma-buf file descriptors. See -+ * Documentation/gpu/drm-mm.rst, section "PRIME Buffer Sharing". -+ */ -+#define DRM_CAP_PRIME 0x5 -+/** -+ * DRM_PRIME_CAP_IMPORT -+ * -+ * If this bit is set in &DRM_CAP_PRIME, the driver supports importing PRIME -+ * buffers via the &DRM_IOCTL_PRIME_FD_TO_HANDLE ioctl. -+ */ -+#define DRM_PRIME_CAP_IMPORT 0x1 -+/** -+ * DRM_PRIME_CAP_EXPORT -+ * -+ * If this bit is set in &DRM_CAP_PRIME, the driver supports exporting PRIME -+ * buffers via the &DRM_IOCTL_PRIME_HANDLE_TO_FD ioctl. -+ */ -+#define DRM_PRIME_CAP_EXPORT 0x2 -+/** -+ * DRM_CAP_TIMESTAMP_MONOTONIC -+ * -+ * If set to 0, the kernel will report timestamps with ``CLOCK_REALTIME`` in -+ * struct drm_event_vblank. If set to 1, the kernel will report timestamps with -+ * ``CLOCK_MONOTONIC``. See ``clock_gettime(2)`` for the definition of these -+ * clocks. -+ * -+ * Starting from kernel version 2.6.39, the default value for this capability -+ * is 1. Starting kernel version 4.15, this capability is always set to 1. -+ */ -+#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 -+/** -+ * DRM_CAP_ASYNC_PAGE_FLIP -+ * -+ * If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC. -+ */ -+#define DRM_CAP_ASYNC_PAGE_FLIP 0x7 -+/** -+ * DRM_CAP_CURSOR_WIDTH -+ * -+ * The ``CURSOR_WIDTH`` and ``CURSOR_HEIGHT`` capabilities return a valid -+ * width x height combination for the hardware cursor. The intention is that a -+ * hardware agnostic userspace can query a cursor plane size to use. -+ * -+ * Note that the cross-driver contract is to merely return a valid size; -+ * drivers are free to attach another meaning on top, eg. i915 returns the -+ * maximum plane size. -+ */ -+#define DRM_CAP_CURSOR_WIDTH 0x8 -+/** -+ * DRM_CAP_CURSOR_HEIGHT -+ * -+ * See &DRM_CAP_CURSOR_WIDTH. -+ */ -+#define DRM_CAP_CURSOR_HEIGHT 0x9 -+/** -+ * DRM_CAP_ADDFB2_MODIFIERS -+ * -+ * If set to 1, the driver supports supplying modifiers in the -+ * &DRM_IOCTL_MODE_ADDFB2 ioctl. -+ */ -+#define DRM_CAP_ADDFB2_MODIFIERS 0x10 -+/** -+ * DRM_CAP_PAGE_FLIP_TARGET -+ * -+ * If set to 1, the driver supports the &DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE and -+ * &DRM_MODE_PAGE_FLIP_TARGET_RELATIVE flags in -+ * &drm_mode_crtc_page_flip_target.flags for the &DRM_IOCTL_MODE_PAGE_FLIP -+ * ioctl. -+ */ -+#define DRM_CAP_PAGE_FLIP_TARGET 0x11 -+/** -+ * DRM_CAP_CRTC_IN_VBLANK_EVENT -+ * -+ * If set to 1, the kernel supports reporting the CRTC ID in -+ * &drm_event_vblank.crtc_id for the &DRM_EVENT_VBLANK and -+ * &DRM_EVENT_FLIP_COMPLETE events. -+ * -+ * Starting kernel version 4.12, this capability is always set to 1. -+ */ -+#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12 -+/** -+ * DRM_CAP_SYNCOBJ -+ * -+ * If set to 1, the driver supports sync objects. See -+ * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects". -+ */ -+#define DRM_CAP_SYNCOBJ 0x13 -+/** -+ * DRM_CAP_SYNCOBJ_TIMELINE -+ * -+ * If set to 1, the driver supports timeline operations on sync objects. See -+ * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects". -+ */ -+#define DRM_CAP_SYNCOBJ_TIMELINE 0x14 -+ -+/* DRM_IOCTL_GET_CAP ioctl argument type */ -+struct drm_get_cap { -+ __u64 capability; -+ __u64 value; -+}; -+ -+/** -+ * DRM_CLIENT_CAP_STEREO_3D -+ * -+ * If set to 1, the DRM core will expose the stereo 3D capabilities of the -+ * monitor by advertising the supported 3D layouts in the flags of struct -+ * drm_mode_modeinfo. See ``DRM_MODE_FLAG_3D_*``. -+ * -+ * This capability is always supported for all drivers starting from kernel -+ * version 3.13. -+ */ -+#define DRM_CLIENT_CAP_STEREO_3D 1 -+ -+/** -+ * DRM_CLIENT_CAP_UNIVERSAL_PLANES -+ * -+ * If set to 1, the DRM core will expose all planes (overlay, primary, and -+ * cursor) to userspace. -+ * -+ * This capability has been introduced in kernel version 3.15. Starting from -+ * kernel version 3.17, this capability is always supported for all drivers. -+ */ -+#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2 -+ -+/** -+ * DRM_CLIENT_CAP_ATOMIC -+ * -+ * If set to 1, the DRM core will expose atomic properties to userspace. This -+ * implicitly enables &DRM_CLIENT_CAP_UNIVERSAL_PLANES and -+ * &DRM_CLIENT_CAP_ASPECT_RATIO. -+ * -+ * If the driver doesn't support atomic mode-setting, enabling this capability -+ * will fail with -EOPNOTSUPP. -+ * -+ * This capability has been introduced in kernel version 4.0. Starting from -+ * kernel version 4.2, this capability is always supported for atomic-capable -+ * drivers. -+ */ -+#define DRM_CLIENT_CAP_ATOMIC 3 -+ -+/** -+ * DRM_CLIENT_CAP_ASPECT_RATIO -+ * -+ * If set to 1, the DRM core will provide aspect ratio information in modes. -+ * See ``DRM_MODE_FLAG_PIC_AR_*``. -+ * -+ * This capability is always supported for all drivers starting from kernel -+ * version 4.18. -+ */ -+#define DRM_CLIENT_CAP_ASPECT_RATIO 4 -+ -+/** -+ * DRM_CLIENT_CAP_WRITEBACK_CONNECTORS -+ * -+ * If set to 1, the DRM core will expose special connectors to be used for -+ * writing back to memory the scene setup in the commit. The client must enable -+ * &DRM_CLIENT_CAP_ATOMIC first. -+ * -+ * This capability is always supported for atomic-capable drivers starting from -+ * kernel version 4.19. -+ */ -+#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5 -+ -+/* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ -+struct drm_set_client_cap { -+ __u64 capability; -+ __u64 value; -+}; -+ -+#define DRM_RDWR O_RDWR -+#define DRM_CLOEXEC O_CLOEXEC -+struct drm_prime_handle { -+ __u32 handle; -+ -+ /** Flags.. only applicable for handle->fd */ -+ __u32 flags; -+ -+ /** Returned dmabuf file descriptor */ -+ __s32 fd; -+}; -+ -+struct drm_syncobj_create { -+ __u32 handle; -+#define DRM_SYNCOBJ_CREATE_SIGNALED (1 << 0) -+ __u32 flags; -+}; -+ -+struct drm_syncobj_destroy { -+ __u32 handle; -+ __u32 pad; -+}; -+ -+#define DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE (1 << 0) -+#define DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_EXPORT_SYNC_FILE (1 << 0) -+struct drm_syncobj_handle { -+ __u32 handle; -+ __u32 flags; -+ -+ __s32 fd; -+ __u32 pad; -+}; -+ -+struct drm_syncobj_transfer { -+ __u32 src_handle; -+ __u32 dst_handle; -+ __u64 src_point; -+ __u64 dst_point; -+ __u32 flags; -+ __u32 pad; -+}; -+ -+#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0) -+#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1) -+#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE (1 << 2) /* wait for time point to become available */ -+struct drm_syncobj_wait { -+ __u64 handles; -+ /* absolute timeout */ -+ __s64 timeout_nsec; -+ __u32 count_handles; -+ __u32 flags; -+ __u32 first_signaled; /* only valid when not waiting all */ -+ __u32 pad; -+}; -+ -+struct drm_syncobj_timeline_wait { -+ __u64 handles; -+ /* wait on specific timeline point for every handles*/ -+ __u64 points; -+ /* absolute timeout */ -+ __s64 timeout_nsec; -+ __u32 count_handles; -+ __u32 flags; -+ __u32 first_signaled; /* only valid when not waiting all */ -+ __u32 pad; -+}; -+ -+ -+struct drm_syncobj_array { -+ __u64 handles; -+ __u32 count_handles; -+ __u32 pad; -+}; -+ -+#define DRM_SYNCOBJ_QUERY_FLAGS_LAST_SUBMITTED (1 << 0) /* last available point on timeline syncobj */ -+struct drm_syncobj_timeline_array { -+ __u64 handles; -+ __u64 points; -+ __u32 count_handles; -+ __u32 flags; -+}; -+ -+ -+/* Query current scanout sequence number */ -+struct drm_crtc_get_sequence { -+ __u32 crtc_id; /* requested crtc_id */ -+ __u32 active; /* return: crtc output is active */ -+ __u64 sequence; /* return: most recent vblank sequence */ -+ __s64 sequence_ns; /* return: most recent time of first pixel out */ -+}; -+ -+/* Queue event to be delivered at specified sequence. Time stamp marks -+ * when the first pixel of the refresh cycle leaves the display engine -+ * for the display -+ */ -+#define DRM_CRTC_SEQUENCE_RELATIVE 0x00000001 /* sequence is relative to current */ -+#define DRM_CRTC_SEQUENCE_NEXT_ON_MISS 0x00000002 /* Use next sequence if we've missed */ -+ -+struct drm_crtc_queue_sequence { -+ __u32 crtc_id; -+ __u32 flags; -+ __u64 sequence; /* on input, target sequence. on output, actual sequence */ -+ __u64 user_data; /* user data passed to event */ -+}; -+ -+#if defined(__cplusplus) -+} -+#endif -+ -+#include "drm_mode.h" -+ -+#if defined(__cplusplus) -+extern "C" { -+#endif -+ -+#define DRM_IOCTL_BASE 'd' -+#define DRM_IO(nr) _IO(DRM_IOCTL_BASE,nr) -+#define DRM_IOR(nr,type) _IOR(DRM_IOCTL_BASE,nr,type) -+#define DRM_IOW(nr,type) _IOW(DRM_IOCTL_BASE,nr,type) -+#define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type) -+ -+#define DRM_IOCTL_VERSION DRM_IOWR(0x00, struct drm_version) -+#define DRM_IOCTL_GET_UNIQUE DRM_IOWR(0x01, struct drm_unique) -+#define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, struct drm_auth) -+#define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, struct drm_irq_busid) -+#define DRM_IOCTL_GET_MAP DRM_IOWR(0x04, struct drm_map) -+#define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, struct drm_client) -+#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats) -+#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version) -+#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl) -+#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close) -+#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink) -+#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open) -+#define DRM_IOCTL_GET_CAP DRM_IOWR(0x0c, struct drm_get_cap) -+#define DRM_IOCTL_SET_CLIENT_CAP DRM_IOW( 0x0d, struct drm_set_client_cap) -+ -+#define DRM_IOCTL_SET_UNIQUE DRM_IOW( 0x10, struct drm_unique) -+#define DRM_IOCTL_AUTH_MAGIC DRM_IOW( 0x11, struct drm_auth) -+#define DRM_IOCTL_BLOCK DRM_IOWR(0x12, struct drm_block) -+#define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, struct drm_block) -+#define DRM_IOCTL_CONTROL DRM_IOW( 0x14, struct drm_control) -+#define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, struct drm_map) -+#define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, struct drm_buf_desc) -+#define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, struct drm_buf_desc) -+#define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, struct drm_buf_info) -+#define DRM_IOCTL_MAP_BUFS DRM_IOWR(0x19, struct drm_buf_map) -+#define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, struct drm_buf_free) -+ -+#define DRM_IOCTL_RM_MAP DRM_IOW( 0x1b, struct drm_map) -+ -+#define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, struct drm_ctx_priv_map) -+#define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, struct drm_ctx_priv_map) -+ -+#define DRM_IOCTL_SET_MASTER DRM_IO(0x1e) -+#define DRM_IOCTL_DROP_MASTER DRM_IO(0x1f) -+ -+#define DRM_IOCTL_ADD_CTX DRM_IOWR(0x20, struct drm_ctx) -+#define DRM_IOCTL_RM_CTX DRM_IOWR(0x21, struct drm_ctx) -+#define DRM_IOCTL_MOD_CTX DRM_IOW( 0x22, struct drm_ctx) -+#define DRM_IOCTL_GET_CTX DRM_IOWR(0x23, struct drm_ctx) -+#define DRM_IOCTL_SWITCH_CTX DRM_IOW( 0x24, struct drm_ctx) -+#define DRM_IOCTL_NEW_CTX DRM_IOW( 0x25, struct drm_ctx) -+#define DRM_IOCTL_RES_CTX DRM_IOWR(0x26, struct drm_ctx_res) -+#define DRM_IOCTL_ADD_DRAW DRM_IOWR(0x27, struct drm_draw) -+#define DRM_IOCTL_RM_DRAW DRM_IOWR(0x28, struct drm_draw) -+#define DRM_IOCTL_DMA DRM_IOWR(0x29, struct drm_dma) -+#define DRM_IOCTL_LOCK DRM_IOW( 0x2a, struct drm_lock) -+#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock) -+#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock) -+ -+#define DRM_IOCTL_PRIME_HANDLE_TO_FD DRM_IOWR(0x2d, struct drm_prime_handle) -+#define DRM_IOCTL_PRIME_FD_TO_HANDLE DRM_IOWR(0x2e, struct drm_prime_handle) -+ -+#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30) -+#define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31) -+#define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode) -+#define DRM_IOCTL_AGP_INFO DRM_IOR( 0x33, struct drm_agp_info) -+#define DRM_IOCTL_AGP_ALLOC DRM_IOWR(0x34, struct drm_agp_buffer) -+#define DRM_IOCTL_AGP_FREE DRM_IOW( 0x35, struct drm_agp_buffer) -+#define DRM_IOCTL_AGP_BIND DRM_IOW( 0x36, struct drm_agp_binding) -+#define DRM_IOCTL_AGP_UNBIND DRM_IOW( 0x37, struct drm_agp_binding) -+ -+#define DRM_IOCTL_SG_ALLOC DRM_IOWR(0x38, struct drm_scatter_gather) -+#define DRM_IOCTL_SG_FREE DRM_IOW( 0x39, struct drm_scatter_gather) -+ -+#define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, union drm_wait_vblank) -+ -+#define DRM_IOCTL_CRTC_GET_SEQUENCE DRM_IOWR(0x3b, struct drm_crtc_get_sequence) -+#define DRM_IOCTL_CRTC_QUEUE_SEQUENCE DRM_IOWR(0x3c, struct drm_crtc_queue_sequence) -+ -+#define DRM_IOCTL_UPDATE_DRAW DRM_IOW(0x3f, struct drm_update_draw) -+ -+#define DRM_IOCTL_MODE_GETRESOURCES DRM_IOWR(0xA0, struct drm_mode_card_res) -+#define DRM_IOCTL_MODE_GETCRTC DRM_IOWR(0xA1, struct drm_mode_crtc) -+#define DRM_IOCTL_MODE_SETCRTC DRM_IOWR(0xA2, struct drm_mode_crtc) -+#define DRM_IOCTL_MODE_CURSOR DRM_IOWR(0xA3, struct drm_mode_cursor) -+#define DRM_IOCTL_MODE_GETGAMMA DRM_IOWR(0xA4, struct drm_mode_crtc_lut) -+#define DRM_IOCTL_MODE_SETGAMMA DRM_IOWR(0xA5, struct drm_mode_crtc_lut) -+#define DRM_IOCTL_MODE_GETENCODER DRM_IOWR(0xA6, struct drm_mode_get_encoder) -+#define DRM_IOCTL_MODE_GETCONNECTOR DRM_IOWR(0xA7, struct drm_mode_get_connector) -+#define DRM_IOCTL_MODE_ATTACHMODE DRM_IOWR(0xA8, struct drm_mode_mode_cmd) /* deprecated (never worked) */ -+#define DRM_IOCTL_MODE_DETACHMODE DRM_IOWR(0xA9, struct drm_mode_mode_cmd) /* deprecated (never worked) */ -+ -+#define DRM_IOCTL_MODE_GETPROPERTY DRM_IOWR(0xAA, struct drm_mode_get_property) -+#define DRM_IOCTL_MODE_SETPROPERTY DRM_IOWR(0xAB, struct drm_mode_connector_set_property) -+#define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, struct drm_mode_get_blob) -+#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd) -+#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd) -+/** -+ * DRM_IOCTL_MODE_RMFB - Remove a framebuffer. -+ * -+ * This removes a framebuffer previously added via ADDFB/ADDFB2. The IOCTL -+ * argument is a framebuffer object ID. -+ * -+ * Warning: removing a framebuffer currently in-use on an enabled plane will -+ * disable that plane. The CRTC the plane is linked to may also be disabled -+ * (depending on driver capabilities). -+ */ -+#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int) -+#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip) -+#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd) -+ -+#define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb) -+#define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, struct drm_mode_map_dumb) -+#define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, struct drm_mode_destroy_dumb) -+#define DRM_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xB5, struct drm_mode_get_plane_res) -+#define DRM_IOCTL_MODE_GETPLANE DRM_IOWR(0xB6, struct drm_mode_get_plane) -+#define DRM_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct drm_mode_set_plane) -+#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2) -+#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties) -+#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property) -+#define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2) -+#define DRM_IOCTL_MODE_ATOMIC DRM_IOWR(0xBC, struct drm_mode_atomic) -+#define DRM_IOCTL_MODE_CREATEPROPBLOB DRM_IOWR(0xBD, struct drm_mode_create_blob) -+#define DRM_IOCTL_MODE_DESTROYPROPBLOB DRM_IOWR(0xBE, struct drm_mode_destroy_blob) -+ -+#define DRM_IOCTL_SYNCOBJ_CREATE DRM_IOWR(0xBF, struct drm_syncobj_create) -+#define DRM_IOCTL_SYNCOBJ_DESTROY DRM_IOWR(0xC0, struct drm_syncobj_destroy) -+#define DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD DRM_IOWR(0xC1, struct drm_syncobj_handle) -+#define DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE DRM_IOWR(0xC2, struct drm_syncobj_handle) -+#define DRM_IOCTL_SYNCOBJ_WAIT DRM_IOWR(0xC3, struct drm_syncobj_wait) -+#define DRM_IOCTL_SYNCOBJ_RESET DRM_IOWR(0xC4, struct drm_syncobj_array) -+#define DRM_IOCTL_SYNCOBJ_SIGNAL DRM_IOWR(0xC5, struct drm_syncobj_array) -+ -+#define DRM_IOCTL_MODE_CREATE_LEASE DRM_IOWR(0xC6, struct drm_mode_create_lease) -+#define DRM_IOCTL_MODE_LIST_LESSEES DRM_IOWR(0xC7, struct drm_mode_list_lessees) -+#define DRM_IOCTL_MODE_GET_LEASE DRM_IOWR(0xC8, struct drm_mode_get_lease) -+#define DRM_IOCTL_MODE_REVOKE_LEASE DRM_IOWR(0xC9, struct drm_mode_revoke_lease) -+ -+#define DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT DRM_IOWR(0xCA, struct drm_syncobj_timeline_wait) -+#define DRM_IOCTL_SYNCOBJ_QUERY DRM_IOWR(0xCB, struct drm_syncobj_timeline_array) -+#define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer) -+#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct drm_syncobj_timeline_array) -+ -+#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2) -+ -+/* -+ * Device specific ioctls should only be in their respective headers -+ * The device specific ioctl range is from 0x40 to 0x9f. -+ * Generic IOCTLS restart at 0xA0. -+ * -+ * \sa drmCommandNone(), drmCommandRead(), drmCommandWrite(), and -+ * drmCommandReadWrite(). -+ */ -+#define DRM_COMMAND_BASE 0x40 -+#define DRM_COMMAND_END 0xA0 -+ -+/* -+ * Header for events written back to userspace on the drm fd. The -+ * type defines the type of event, the length specifies the total -+ * length of the event (including the header), and user_data is -+ * typically a 64 bit value passed with the ioctl that triggered the -+ * event. A read on the drm fd will always only return complete -+ * events, that is, if for example the read buffer is 100 bytes, and -+ * there are two 64 byte events pending, only one will be returned. -+ * -+ * Event types 0 - 0x7fffffff are generic drm events, 0x80000000 and -+ * up are chipset specific. -+ */ -+struct drm_event { -+ __u32 type; -+ __u32 length; -+}; -+ -+#define DRM_EVENT_VBLANK 0x01 -+#define DRM_EVENT_FLIP_COMPLETE 0x02 -+#define DRM_EVENT_CRTC_SEQUENCE 0x03 -+ -+struct drm_event_vblank { -+ struct drm_event base; -+ __u64 user_data; -+ __u32 tv_sec; -+ __u32 tv_usec; -+ __u32 sequence; -+ __u32 crtc_id; /* 0 on older kernels that do not support this */ -+}; -+ -+/* Event delivered at sequence. Time stamp marks when the first pixel -+ * of the refresh cycle leaves the display engine for the display -+ */ -+struct drm_event_crtc_sequence { -+ struct drm_event base; -+ __u64 user_data; -+ __s64 time_ns; -+ __u64 sequence; -+}; -+ -+/* typedef area */ -+typedef struct drm_clip_rect drm_clip_rect_t; -+typedef struct drm_drawable_info drm_drawable_info_t; -+typedef struct drm_tex_region drm_tex_region_t; -+typedef struct drm_hw_lock drm_hw_lock_t; -+typedef struct drm_version drm_version_t; -+typedef struct drm_unique drm_unique_t; -+typedef struct drm_list drm_list_t; -+typedef struct drm_block drm_block_t; -+typedef struct drm_control drm_control_t; -+typedef enum drm_map_type drm_map_type_t; -+typedef enum drm_map_flags drm_map_flags_t; -+typedef struct drm_ctx_priv_map drm_ctx_priv_map_t; -+typedef struct drm_map drm_map_t; -+typedef struct drm_client drm_client_t; -+typedef enum drm_stat_type drm_stat_type_t; -+typedef struct drm_stats drm_stats_t; -+typedef enum drm_lock_flags drm_lock_flags_t; -+typedef struct drm_lock drm_lock_t; -+typedef enum drm_dma_flags drm_dma_flags_t; -+typedef struct drm_buf_desc drm_buf_desc_t; -+typedef struct drm_buf_info drm_buf_info_t; -+typedef struct drm_buf_free drm_buf_free_t; -+typedef struct drm_buf_pub drm_buf_pub_t; -+typedef struct drm_buf_map drm_buf_map_t; -+typedef struct drm_dma drm_dma_t; -+typedef union drm_wait_vblank drm_wait_vblank_t; -+typedef struct drm_agp_mode drm_agp_mode_t; -+typedef enum drm_ctx_flags drm_ctx_flags_t; -+typedef struct drm_ctx drm_ctx_t; -+typedef struct drm_ctx_res drm_ctx_res_t; -+typedef struct drm_draw drm_draw_t; -+typedef struct drm_update_draw drm_update_draw_t; -+typedef struct drm_auth drm_auth_t; -+typedef struct drm_irq_busid drm_irq_busid_t; -+typedef enum drm_vblank_seq_type drm_vblank_seq_type_t; -+ -+typedef struct drm_agp_buffer drm_agp_buffer_t; -+typedef struct drm_agp_binding drm_agp_binding_t; -+typedef struct drm_agp_info drm_agp_info_t; -+typedef struct drm_scatter_gather drm_scatter_gather_t; -+typedef struct drm_set_version drm_set_version_t; -+ -+#if defined(__cplusplus) -+} -+#endif -+ -+#endif -diff -up firefox-109.0/third_party/drm/drm/drm_mode.h.libwebrtc-screen-cast-sync firefox-109.0/third_party/drm/drm/drm_mode.h ---- firefox-109.0/third_party/drm/drm/drm_mode.h.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.194614122 +0100 -+++ firefox-109.0/third_party/drm/drm/drm_mode.h 2023-01-12 15:16:09.194614122 +0100 -@@ -0,0 +1,1217 @@ -+/* -+ * Copyright (c) 2007 Dave Airlie -+ * Copyright (c) 2007 Jakob Bornecrantz -+ * Copyright (c) 2008 Red Hat Inc. -+ * Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA -+ * Copyright (c) 2007-2008 Intel Corporation -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -+ * IN THE SOFTWARE. -+ */ -+ -+#ifndef _DRM_MODE_H -+#define _DRM_MODE_H -+ -+#include "drm.h" -+ -+#if defined(__cplusplus) -+extern "C" { -+#endif -+ -+/** -+ * DOC: overview -+ * -+ * DRM exposes many UAPI and structure definition to have a consistent -+ * and standardized interface with user. -+ * Userspace can refer to these structure definitions and UAPI formats -+ * to communicate to driver -+ */ -+ -+#define DRM_CONNECTOR_NAME_LEN 32 -+#define DRM_DISPLAY_MODE_LEN 32 -+#define DRM_PROP_NAME_LEN 32 -+ -+#define DRM_MODE_TYPE_BUILTIN (1<<0) /* deprecated */ -+#define DRM_MODE_TYPE_CLOCK_C ((1<<1) | DRM_MODE_TYPE_BUILTIN) /* deprecated */ -+#define DRM_MODE_TYPE_CRTC_C ((1<<2) | DRM_MODE_TYPE_BUILTIN) /* deprecated */ -+#define DRM_MODE_TYPE_PREFERRED (1<<3) -+#define DRM_MODE_TYPE_DEFAULT (1<<4) /* deprecated */ -+#define DRM_MODE_TYPE_USERDEF (1<<5) -+#define DRM_MODE_TYPE_DRIVER (1<<6) -+ -+#define DRM_MODE_TYPE_ALL (DRM_MODE_TYPE_PREFERRED | \ -+ DRM_MODE_TYPE_USERDEF | \ -+ DRM_MODE_TYPE_DRIVER) -+ -+/* Video mode flags */ -+/* bit compatible with the xrandr RR_ definitions (bits 0-13) -+ * -+ * ABI warning: Existing userspace really expects -+ * the mode flags to match the xrandr definitions. Any -+ * changes that don't match the xrandr definitions will -+ * likely need a new client cap or some other mechanism -+ * to avoid breaking existing userspace. This includes -+ * allocating new flags in the previously unused bits! -+ */ -+#define DRM_MODE_FLAG_PHSYNC (1<<0) -+#define DRM_MODE_FLAG_NHSYNC (1<<1) -+#define DRM_MODE_FLAG_PVSYNC (1<<2) -+#define DRM_MODE_FLAG_NVSYNC (1<<3) -+#define DRM_MODE_FLAG_INTERLACE (1<<4) -+#define DRM_MODE_FLAG_DBLSCAN (1<<5) -+#define DRM_MODE_FLAG_CSYNC (1<<6) -+#define DRM_MODE_FLAG_PCSYNC (1<<7) -+#define DRM_MODE_FLAG_NCSYNC (1<<8) -+#define DRM_MODE_FLAG_HSKEW (1<<9) /* hskew provided */ -+#define DRM_MODE_FLAG_BCAST (1<<10) /* deprecated */ -+#define DRM_MODE_FLAG_PIXMUX (1<<11) /* deprecated */ -+#define DRM_MODE_FLAG_DBLCLK (1<<12) -+#define DRM_MODE_FLAG_CLKDIV2 (1<<13) -+ /* -+ * When adding a new stereo mode don't forget to adjust DRM_MODE_FLAGS_3D_MAX -+ * (define not exposed to user space). -+ */ -+#define DRM_MODE_FLAG_3D_MASK (0x1f<<14) -+#define DRM_MODE_FLAG_3D_NONE (0<<14) -+#define DRM_MODE_FLAG_3D_FRAME_PACKING (1<<14) -+#define DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE (2<<14) -+#define DRM_MODE_FLAG_3D_LINE_ALTERNATIVE (3<<14) -+#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL (4<<14) -+#define DRM_MODE_FLAG_3D_L_DEPTH (5<<14) -+#define DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH (6<<14) -+#define DRM_MODE_FLAG_3D_TOP_AND_BOTTOM (7<<14) -+#define DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF (8<<14) -+ -+/* Picture aspect ratio options */ -+#define DRM_MODE_PICTURE_ASPECT_NONE 0 -+#define DRM_MODE_PICTURE_ASPECT_4_3 1 -+#define DRM_MODE_PICTURE_ASPECT_16_9 2 -+#define DRM_MODE_PICTURE_ASPECT_64_27 3 -+#define DRM_MODE_PICTURE_ASPECT_256_135 4 -+ -+/* Content type options */ -+#define DRM_MODE_CONTENT_TYPE_NO_DATA 0 -+#define DRM_MODE_CONTENT_TYPE_GRAPHICS 1 -+#define DRM_MODE_CONTENT_TYPE_PHOTO 2 -+#define DRM_MODE_CONTENT_TYPE_CINEMA 3 -+#define DRM_MODE_CONTENT_TYPE_GAME 4 -+ -+/* Aspect ratio flag bitmask (4 bits 22:19) */ -+#define DRM_MODE_FLAG_PIC_AR_MASK (0x0F<<19) -+#define DRM_MODE_FLAG_PIC_AR_NONE \ -+ (DRM_MODE_PICTURE_ASPECT_NONE<<19) -+#define DRM_MODE_FLAG_PIC_AR_4_3 \ -+ (DRM_MODE_PICTURE_ASPECT_4_3<<19) -+#define DRM_MODE_FLAG_PIC_AR_16_9 \ -+ (DRM_MODE_PICTURE_ASPECT_16_9<<19) -+#define DRM_MODE_FLAG_PIC_AR_64_27 \ -+ (DRM_MODE_PICTURE_ASPECT_64_27<<19) -+#define DRM_MODE_FLAG_PIC_AR_256_135 \ -+ (DRM_MODE_PICTURE_ASPECT_256_135<<19) -+ -+#define DRM_MODE_FLAG_ALL (DRM_MODE_FLAG_PHSYNC | \ -+ DRM_MODE_FLAG_NHSYNC | \ -+ DRM_MODE_FLAG_PVSYNC | \ -+ DRM_MODE_FLAG_NVSYNC | \ -+ DRM_MODE_FLAG_INTERLACE | \ -+ DRM_MODE_FLAG_DBLSCAN | \ -+ DRM_MODE_FLAG_CSYNC | \ -+ DRM_MODE_FLAG_PCSYNC | \ -+ DRM_MODE_FLAG_NCSYNC | \ -+ DRM_MODE_FLAG_HSKEW | \ -+ DRM_MODE_FLAG_DBLCLK | \ -+ DRM_MODE_FLAG_CLKDIV2 | \ -+ DRM_MODE_FLAG_3D_MASK) -+ -+/* DPMS flags */ -+/* bit compatible with the xorg definitions. */ -+#define DRM_MODE_DPMS_ON 0 -+#define DRM_MODE_DPMS_STANDBY 1 -+#define DRM_MODE_DPMS_SUSPEND 2 -+#define DRM_MODE_DPMS_OFF 3 -+ -+/* Scaling mode options */ -+#define DRM_MODE_SCALE_NONE 0 /* Unmodified timing (display or -+ software can still scale) */ -+#define DRM_MODE_SCALE_FULLSCREEN 1 /* Full screen, ignore aspect */ -+#define DRM_MODE_SCALE_CENTER 2 /* Centered, no scaling */ -+#define DRM_MODE_SCALE_ASPECT 3 /* Full screen, preserve aspect */ -+ -+/* Dithering mode options */ -+#define DRM_MODE_DITHERING_OFF 0 -+#define DRM_MODE_DITHERING_ON 1 -+#define DRM_MODE_DITHERING_AUTO 2 -+ -+/* Dirty info options */ -+#define DRM_MODE_DIRTY_OFF 0 -+#define DRM_MODE_DIRTY_ON 1 -+#define DRM_MODE_DIRTY_ANNOTATE 2 -+ -+/* Link Status options */ -+#define DRM_MODE_LINK_STATUS_GOOD 0 -+#define DRM_MODE_LINK_STATUS_BAD 1 -+ -+/* -+ * DRM_MODE_ROTATE_ -+ * -+ * Signals that a drm plane is been rotated degrees in counter -+ * clockwise direction. -+ * -+ * This define is provided as a convenience, looking up the property id -+ * using the name->prop id lookup is the preferred method. -+ */ -+#define DRM_MODE_ROTATE_0 (1<<0) -+#define DRM_MODE_ROTATE_90 (1<<1) -+#define DRM_MODE_ROTATE_180 (1<<2) -+#define DRM_MODE_ROTATE_270 (1<<3) -+ -+/* -+ * DRM_MODE_ROTATE_MASK -+ * -+ * Bitmask used to look for drm plane rotations. -+ */ -+#define DRM_MODE_ROTATE_MASK (\ -+ DRM_MODE_ROTATE_0 | \ -+ DRM_MODE_ROTATE_90 | \ -+ DRM_MODE_ROTATE_180 | \ -+ DRM_MODE_ROTATE_270) -+ -+/* -+ * DRM_MODE_REFLECT_ -+ * -+ * Signals that the contents of a drm plane is reflected along the axis, -+ * in the same way as mirroring. -+ * See kerneldoc chapter "Plane Composition Properties" for more details. -+ * -+ * This define is provided as a convenience, looking up the property id -+ * using the name->prop id lookup is the preferred method. -+ */ -+#define DRM_MODE_REFLECT_X (1<<4) -+#define DRM_MODE_REFLECT_Y (1<<5) -+ -+/* -+ * DRM_MODE_REFLECT_MASK -+ * -+ * Bitmask used to look for drm plane reflections. -+ */ -+#define DRM_MODE_REFLECT_MASK (\ -+ DRM_MODE_REFLECT_X | \ -+ DRM_MODE_REFLECT_Y) -+ -+/* Content Protection Flags */ -+#define DRM_MODE_CONTENT_PROTECTION_UNDESIRED 0 -+#define DRM_MODE_CONTENT_PROTECTION_DESIRED 1 -+#define DRM_MODE_CONTENT_PROTECTION_ENABLED 2 -+ -+/** -+ * struct drm_mode_modeinfo - Display mode information. -+ * @clock: pixel clock in kHz -+ * @hdisplay: horizontal display size -+ * @hsync_start: horizontal sync start -+ * @hsync_end: horizontal sync end -+ * @htotal: horizontal total size -+ * @hskew: horizontal skew -+ * @vdisplay: vertical display size -+ * @vsync_start: vertical sync start -+ * @vsync_end: vertical sync end -+ * @vtotal: vertical total size -+ * @vscan: vertical scan -+ * @vrefresh: approximate vertical refresh rate in Hz -+ * @flags: bitmask of misc. flags, see DRM_MODE_FLAG_* defines -+ * @type: bitmask of type flags, see DRM_MODE_TYPE_* defines -+ * @name: string describing the mode resolution -+ * -+ * This is the user-space API display mode information structure. For the -+ * kernel version see struct drm_display_mode. -+ */ -+struct drm_mode_modeinfo { -+ __u32 clock; -+ __u16 hdisplay; -+ __u16 hsync_start; -+ __u16 hsync_end; -+ __u16 htotal; -+ __u16 hskew; -+ __u16 vdisplay; -+ __u16 vsync_start; -+ __u16 vsync_end; -+ __u16 vtotal; -+ __u16 vscan; -+ -+ __u32 vrefresh; -+ -+ __u32 flags; -+ __u32 type; -+ char name[DRM_DISPLAY_MODE_LEN]; -+}; -+ -+struct drm_mode_card_res { -+ __u64 fb_id_ptr; -+ __u64 crtc_id_ptr; -+ __u64 connector_id_ptr; -+ __u64 encoder_id_ptr; -+ __u32 count_fbs; -+ __u32 count_crtcs; -+ __u32 count_connectors; -+ __u32 count_encoders; -+ __u32 min_width; -+ __u32 max_width; -+ __u32 min_height; -+ __u32 max_height; -+}; -+ -+struct drm_mode_crtc { -+ __u64 set_connectors_ptr; -+ __u32 count_connectors; -+ -+ __u32 crtc_id; /**< Id */ -+ __u32 fb_id; /**< Id of framebuffer */ -+ -+ __u32 x; /**< x Position on the framebuffer */ -+ __u32 y; /**< y Position on the framebuffer */ -+ -+ __u32 gamma_size; -+ __u32 mode_valid; -+ struct drm_mode_modeinfo mode; -+}; -+ -+#define DRM_MODE_PRESENT_TOP_FIELD (1<<0) -+#define DRM_MODE_PRESENT_BOTTOM_FIELD (1<<1) -+ -+/* Planes blend with or override other bits on the CRTC */ -+struct drm_mode_set_plane { -+ __u32 plane_id; -+ __u32 crtc_id; -+ __u32 fb_id; /* fb object contains surface format type */ -+ __u32 flags; /* see above flags */ -+ -+ /* Signed dest location allows it to be partially off screen */ -+ __s32 crtc_x; -+ __s32 crtc_y; -+ __u32 crtc_w; -+ __u32 crtc_h; -+ -+ /* Source values are 16.16 fixed point */ -+ __u32 src_x; -+ __u32 src_y; -+ __u32 src_h; -+ __u32 src_w; -+}; -+ -+/** -+ * struct drm_mode_get_plane - Get plane metadata. -+ * -+ * Userspace can perform a GETPLANE ioctl to retrieve information about a -+ * plane. -+ * -+ * To retrieve the number of formats supported, set @count_format_types to zero -+ * and call the ioctl. @count_format_types will be updated with the value. -+ * -+ * To retrieve these formats, allocate an array with the memory needed to store -+ * @count_format_types formats. Point @format_type_ptr to this array and call -+ * the ioctl again (with @count_format_types still set to the value returned in -+ * the first ioctl call). -+ */ -+struct drm_mode_get_plane { -+ /** -+ * @plane_id: Object ID of the plane whose information should be -+ * retrieved. Set by caller. -+ */ -+ __u32 plane_id; -+ -+ /** @crtc_id: Object ID of the current CRTC. */ -+ __u32 crtc_id; -+ /** @fb_id: Object ID of the current fb. */ -+ __u32 fb_id; -+ -+ /** -+ * @possible_crtcs: Bitmask of CRTC's compatible with the plane. CRTC's -+ * are created and they receive an index, which corresponds to their -+ * position in the bitmask. Bit N corresponds to -+ * :ref:`CRTC index` N. -+ */ -+ __u32 possible_crtcs; -+ /** @gamma_size: Never used. */ -+ __u32 gamma_size; -+ -+ /** @count_format_types: Number of formats. */ -+ __u32 count_format_types; -+ /** -+ * @format_type_ptr: Pointer to ``__u32`` array of formats that are -+ * supported by the plane. These formats do not require modifiers. -+ */ -+ __u64 format_type_ptr; -+}; -+ -+struct drm_mode_get_plane_res { -+ __u64 plane_id_ptr; -+ __u32 count_planes; -+}; -+ -+#define DRM_MODE_ENCODER_NONE 0 -+#define DRM_MODE_ENCODER_DAC 1 -+#define DRM_MODE_ENCODER_TMDS 2 -+#define DRM_MODE_ENCODER_LVDS 3 -+#define DRM_MODE_ENCODER_TVDAC 4 -+#define DRM_MODE_ENCODER_VIRTUAL 5 -+#define DRM_MODE_ENCODER_DSI 6 -+#define DRM_MODE_ENCODER_DPMST 7 -+#define DRM_MODE_ENCODER_DPI 8 -+ -+struct drm_mode_get_encoder { -+ __u32 encoder_id; -+ __u32 encoder_type; -+ -+ __u32 crtc_id; /**< Id of crtc */ -+ -+ __u32 possible_crtcs; -+ __u32 possible_clones; -+}; -+ -+/* This is for connectors with multiple signal types. */ -+/* Try to match DRM_MODE_CONNECTOR_X as closely as possible. */ -+enum drm_mode_subconnector { -+ DRM_MODE_SUBCONNECTOR_Automatic = 0, /* DVI-I, TV */ -+ DRM_MODE_SUBCONNECTOR_Unknown = 0, /* DVI-I, TV, DP */ -+ DRM_MODE_SUBCONNECTOR_VGA = 1, /* DP */ -+ DRM_MODE_SUBCONNECTOR_DVID = 3, /* DVI-I DP */ -+ DRM_MODE_SUBCONNECTOR_DVIA = 4, /* DVI-I */ -+ DRM_MODE_SUBCONNECTOR_Composite = 5, /* TV */ -+ DRM_MODE_SUBCONNECTOR_SVIDEO = 6, /* TV */ -+ DRM_MODE_SUBCONNECTOR_Component = 8, /* TV */ -+ DRM_MODE_SUBCONNECTOR_SCART = 9, /* TV */ -+ DRM_MODE_SUBCONNECTOR_DisplayPort = 10, /* DP */ -+ DRM_MODE_SUBCONNECTOR_HDMIA = 11, /* DP */ -+ DRM_MODE_SUBCONNECTOR_Native = 15, /* DP */ -+ DRM_MODE_SUBCONNECTOR_Wireless = 18, /* DP */ -+}; -+ -+#define DRM_MODE_CONNECTOR_Unknown 0 -+#define DRM_MODE_CONNECTOR_VGA 1 -+#define DRM_MODE_CONNECTOR_DVII 2 -+#define DRM_MODE_CONNECTOR_DVID 3 -+#define DRM_MODE_CONNECTOR_DVIA 4 -+#define DRM_MODE_CONNECTOR_Composite 5 -+#define DRM_MODE_CONNECTOR_SVIDEO 6 -+#define DRM_MODE_CONNECTOR_LVDS 7 -+#define DRM_MODE_CONNECTOR_Component 8 -+#define DRM_MODE_CONNECTOR_9PinDIN 9 -+#define DRM_MODE_CONNECTOR_DisplayPort 10 -+#define DRM_MODE_CONNECTOR_HDMIA 11 -+#define DRM_MODE_CONNECTOR_HDMIB 12 -+#define DRM_MODE_CONNECTOR_TV 13 -+#define DRM_MODE_CONNECTOR_eDP 14 -+#define DRM_MODE_CONNECTOR_VIRTUAL 15 -+#define DRM_MODE_CONNECTOR_DSI 16 -+#define DRM_MODE_CONNECTOR_DPI 17 -+#define DRM_MODE_CONNECTOR_WRITEBACK 18 -+#define DRM_MODE_CONNECTOR_SPI 19 -+#define DRM_MODE_CONNECTOR_USB 20 -+ -+/** -+ * struct drm_mode_get_connector - Get connector metadata. -+ * -+ * User-space can perform a GETCONNECTOR ioctl to retrieve information about a -+ * connector. User-space is expected to retrieve encoders, modes and properties -+ * by performing this ioctl at least twice: the first time to retrieve the -+ * number of elements, the second time to retrieve the elements themselves. -+ * -+ * To retrieve the number of elements, set @count_props and @count_encoders to -+ * zero, set @count_modes to 1, and set @modes_ptr to a temporary struct -+ * drm_mode_modeinfo element. -+ * -+ * To retrieve the elements, allocate arrays for @encoders_ptr, @modes_ptr, -+ * @props_ptr and @prop_values_ptr, then set @count_modes, @count_props and -+ * @count_encoders to their capacity. -+ * -+ * Performing the ioctl only twice may be racy: the number of elements may have -+ * changed with a hotplug event in-between the two ioctls. User-space is -+ * expected to retry the last ioctl until the number of elements stabilizes. -+ * The kernel won't fill any array which doesn't have the expected length. -+ * -+ * **Force-probing a connector** -+ * -+ * If the @count_modes field is set to zero and the DRM client is the current -+ * DRM master, the kernel will perform a forced probe on the connector to -+ * refresh the connector status, modes and EDID. A forced-probe can be slow, -+ * might cause flickering and the ioctl will block. -+ * -+ * User-space needs to force-probe connectors to ensure their metadata is -+ * up-to-date at startup and after receiving a hot-plug event. User-space -+ * may perform a forced-probe when the user explicitly requests it. User-space -+ * shouldn't perform a forced-probe in other situations. -+ */ -+struct drm_mode_get_connector { -+ /** @encoders_ptr: Pointer to ``__u32`` array of object IDs. */ -+ __u64 encoders_ptr; -+ /** @modes_ptr: Pointer to struct drm_mode_modeinfo array. */ -+ __u64 modes_ptr; -+ /** @props_ptr: Pointer to ``__u32`` array of property IDs. */ -+ __u64 props_ptr; -+ /** @prop_values_ptr: Pointer to ``__u64`` array of property values. */ -+ __u64 prop_values_ptr; -+ -+ /** @count_modes: Number of modes. */ -+ __u32 count_modes; -+ /** @count_props: Number of properties. */ -+ __u32 count_props; -+ /** @count_encoders: Number of encoders. */ -+ __u32 count_encoders; -+ -+ /** @encoder_id: Object ID of the current encoder. */ -+ __u32 encoder_id; -+ /** @connector_id: Object ID of the connector. */ -+ __u32 connector_id; -+ /** -+ * @connector_type: Type of the connector. -+ * -+ * See DRM_MODE_CONNECTOR_* defines. -+ */ -+ __u32 connector_type; -+ /** -+ * @connector_type_id: Type-specific connector number. -+ * -+ * This is not an object ID. This is a per-type connector number. Each -+ * (type, type_id) combination is unique across all connectors of a DRM -+ * device. -+ */ -+ __u32 connector_type_id; -+ -+ /** -+ * @connection: Status of the connector. -+ * -+ * See enum drm_connector_status. -+ */ -+ __u32 connection; -+ /** @mm_width: Width of the connected sink in millimeters. */ -+ __u32 mm_width; -+ /** @mm_height: Height of the connected sink in millimeters. */ -+ __u32 mm_height; -+ /** -+ * @subpixel: Subpixel order of the connected sink. -+ * -+ * See enum subpixel_order. -+ */ -+ __u32 subpixel; -+ -+ /** @pad: Padding, must be zero. */ -+ __u32 pad; -+}; -+ -+#define DRM_MODE_PROP_PENDING (1<<0) /* deprecated, do not use */ -+#define DRM_MODE_PROP_RANGE (1<<1) -+#define DRM_MODE_PROP_IMMUTABLE (1<<2) -+#define DRM_MODE_PROP_ENUM (1<<3) /* enumerated type with text strings */ -+#define DRM_MODE_PROP_BLOB (1<<4) -+#define DRM_MODE_PROP_BITMASK (1<<5) /* bitmask of enumerated types */ -+ -+/* non-extended types: legacy bitmask, one bit per type: */ -+#define DRM_MODE_PROP_LEGACY_TYPE ( \ -+ DRM_MODE_PROP_RANGE | \ -+ DRM_MODE_PROP_ENUM | \ -+ DRM_MODE_PROP_BLOB | \ -+ DRM_MODE_PROP_BITMASK) -+ -+/* extended-types: rather than continue to consume a bit per type, -+ * grab a chunk of the bits to use as integer type id. -+ */ -+#define DRM_MODE_PROP_EXTENDED_TYPE 0x0000ffc0 -+#define DRM_MODE_PROP_TYPE(n) ((n) << 6) -+#define DRM_MODE_PROP_OBJECT DRM_MODE_PROP_TYPE(1) -+#define DRM_MODE_PROP_SIGNED_RANGE DRM_MODE_PROP_TYPE(2) -+ -+/* the PROP_ATOMIC flag is used to hide properties from userspace that -+ * is not aware of atomic properties. This is mostly to work around -+ * older userspace (DDX drivers) that read/write each prop they find, -+ * witout being aware that this could be triggering a lengthy modeset. -+ */ -+#define DRM_MODE_PROP_ATOMIC 0x80000000 -+ -+/** -+ * struct drm_mode_property_enum - Description for an enum/bitfield entry. -+ * @value: numeric value for this enum entry. -+ * @name: symbolic name for this enum entry. -+ * -+ * See struct drm_property_enum for details. -+ */ -+struct drm_mode_property_enum { -+ __u64 value; -+ char name[DRM_PROP_NAME_LEN]; -+}; -+ -+/** -+ * struct drm_mode_get_property - Get property metadata. -+ * -+ * User-space can perform a GETPROPERTY ioctl to retrieve information about a -+ * property. The same property may be attached to multiple objects, see -+ * "Modeset Base Object Abstraction". -+ * -+ * The meaning of the @values_ptr field changes depending on the property type. -+ * See &drm_property.flags for more details. -+ * -+ * The @enum_blob_ptr and @count_enum_blobs fields are only meaningful when the -+ * property has the type &DRM_MODE_PROP_ENUM or &DRM_MODE_PROP_BITMASK. For -+ * backwards compatibility, the kernel will always set @count_enum_blobs to -+ * zero when the property has the type &DRM_MODE_PROP_BLOB. User-space must -+ * ignore these two fields if the property has a different type. -+ * -+ * User-space is expected to retrieve values and enums by performing this ioctl -+ * at least twice: the first time to retrieve the number of elements, the -+ * second time to retrieve the elements themselves. -+ * -+ * To retrieve the number of elements, set @count_values and @count_enum_blobs -+ * to zero, then call the ioctl. @count_values will be updated with the number -+ * of elements. If the property has the type &DRM_MODE_PROP_ENUM or -+ * &DRM_MODE_PROP_BITMASK, @count_enum_blobs will be updated as well. -+ * -+ * To retrieve the elements themselves, allocate an array for @values_ptr and -+ * set @count_values to its capacity. If the property has the type -+ * &DRM_MODE_PROP_ENUM or &DRM_MODE_PROP_BITMASK, allocate an array for -+ * @enum_blob_ptr and set @count_enum_blobs to its capacity. Calling the ioctl -+ * again will fill the arrays. -+ */ -+struct drm_mode_get_property { -+ /** @values_ptr: Pointer to a ``__u64`` array. */ -+ __u64 values_ptr; -+ /** @enum_blob_ptr: Pointer to a struct drm_mode_property_enum array. */ -+ __u64 enum_blob_ptr; -+ -+ /** -+ * @prop_id: Object ID of the property which should be retrieved. Set -+ * by the caller. -+ */ -+ __u32 prop_id; -+ /** -+ * @flags: ``DRM_MODE_PROP_*`` bitfield. See &drm_property.flags for -+ * a definition of the flags. -+ */ -+ __u32 flags; -+ /** -+ * @name: Symbolic property name. User-space should use this field to -+ * recognize properties. -+ */ -+ char name[DRM_PROP_NAME_LEN]; -+ -+ /** @count_values: Number of elements in @values_ptr. */ -+ __u32 count_values; -+ /** @count_enum_blobs: Number of elements in @enum_blob_ptr. */ -+ __u32 count_enum_blobs; -+}; -+ -+struct drm_mode_connector_set_property { -+ __u64 value; -+ __u32 prop_id; -+ __u32 connector_id; -+}; -+ -+#define DRM_MODE_OBJECT_CRTC 0xcccccccc -+#define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0 -+#define DRM_MODE_OBJECT_ENCODER 0xe0e0e0e0 -+#define DRM_MODE_OBJECT_MODE 0xdededede -+#define DRM_MODE_OBJECT_PROPERTY 0xb0b0b0b0 -+#define DRM_MODE_OBJECT_FB 0xfbfbfbfb -+#define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb -+#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee -+#define DRM_MODE_OBJECT_ANY 0 -+ -+struct drm_mode_obj_get_properties { -+ __u64 props_ptr; -+ __u64 prop_values_ptr; -+ __u32 count_props; -+ __u32 obj_id; -+ __u32 obj_type; -+}; -+ -+struct drm_mode_obj_set_property { -+ __u64 value; -+ __u32 prop_id; -+ __u32 obj_id; -+ __u32 obj_type; -+}; -+ -+struct drm_mode_get_blob { -+ __u32 blob_id; -+ __u32 length; -+ __u64 data; -+}; -+ -+struct drm_mode_fb_cmd { -+ __u32 fb_id; -+ __u32 width; -+ __u32 height; -+ __u32 pitch; -+ __u32 bpp; -+ __u32 depth; -+ /* driver specific handle */ -+ __u32 handle; -+}; -+ -+#define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */ -+#define DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifer[] */ -+ -+struct drm_mode_fb_cmd2 { -+ __u32 fb_id; -+ __u32 width; -+ __u32 height; -+ __u32 pixel_format; /* fourcc code from drm_fourcc.h */ -+ __u32 flags; /* see above flags */ -+ -+ /* -+ * In case of planar formats, this ioctl allows up to 4 -+ * buffer objects with offsets and pitches per plane. -+ * The pitch and offset order is dictated by the fourcc, -+ * e.g. NV12 (https://fourcc.org/yuv.php#NV12) is described as: -+ * -+ * YUV 4:2:0 image with a plane of 8 bit Y samples -+ * followed by an interleaved U/V plane containing -+ * 8 bit 2x2 subsampled colour difference samples. -+ * -+ * So it would consist of Y as offsets[0] and UV as -+ * offsets[1]. Note that offsets[0] will generally -+ * be 0 (but this is not required). -+ * -+ * To accommodate tiled, compressed, etc formats, a -+ * modifier can be specified. The default value of zero -+ * indicates "native" format as specified by the fourcc. -+ * Vendor specific modifier token. Note that even though -+ * it looks like we have a modifier per-plane, we in fact -+ * do not. The modifier for each plane must be identical. -+ * Thus all combinations of different data layouts for -+ * multi plane formats must be enumerated as separate -+ * modifiers. -+ */ -+ __u32 handles[4]; -+ __u32 pitches[4]; /* pitch for each plane */ -+ __u32 offsets[4]; /* offset of each plane */ -+ __u64 modifier[4]; /* ie, tiling, compress */ -+}; -+ -+#define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01 -+#define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02 -+#define DRM_MODE_FB_DIRTY_FLAGS 0x03 -+ -+#define DRM_MODE_FB_DIRTY_MAX_CLIPS 256 -+ -+/* -+ * Mark a region of a framebuffer as dirty. -+ * -+ * Some hardware does not automatically update display contents -+ * as a hardware or software draw to a framebuffer. This ioctl -+ * allows userspace to tell the kernel and the hardware what -+ * regions of the framebuffer have changed. -+ * -+ * The kernel or hardware is free to update more then just the -+ * region specified by the clip rects. The kernel or hardware -+ * may also delay and/or coalesce several calls to dirty into a -+ * single update. -+ * -+ * Userspace may annotate the updates, the annotates are a -+ * promise made by the caller that the change is either a copy -+ * of pixels or a fill of a single color in the region specified. -+ * -+ * If the DRM_MODE_FB_DIRTY_ANNOTATE_COPY flag is given then -+ * the number of updated regions are half of num_clips given, -+ * where the clip rects are paired in src and dst. The width and -+ * height of each one of the pairs must match. -+ * -+ * If the DRM_MODE_FB_DIRTY_ANNOTATE_FILL flag is given the caller -+ * promises that the region specified of the clip rects is filled -+ * completely with a single color as given in the color argument. -+ */ -+ -+struct drm_mode_fb_dirty_cmd { -+ __u32 fb_id; -+ __u32 flags; -+ __u32 color; -+ __u32 num_clips; -+ __u64 clips_ptr; -+}; -+ -+struct drm_mode_mode_cmd { -+ __u32 connector_id; -+ struct drm_mode_modeinfo mode; -+}; -+ -+#define DRM_MODE_CURSOR_BO 0x01 -+#define DRM_MODE_CURSOR_MOVE 0x02 -+#define DRM_MODE_CURSOR_FLAGS 0x03 -+ -+/* -+ * depending on the value in flags different members are used. -+ * -+ * CURSOR_BO uses -+ * crtc_id -+ * width -+ * height -+ * handle - if 0 turns the cursor off -+ * -+ * CURSOR_MOVE uses -+ * crtc_id -+ * x -+ * y -+ */ -+struct drm_mode_cursor { -+ __u32 flags; -+ __u32 crtc_id; -+ __s32 x; -+ __s32 y; -+ __u32 width; -+ __u32 height; -+ /* driver specific handle */ -+ __u32 handle; -+}; -+ -+struct drm_mode_cursor2 { -+ __u32 flags; -+ __u32 crtc_id; -+ __s32 x; -+ __s32 y; -+ __u32 width; -+ __u32 height; -+ /* driver specific handle */ -+ __u32 handle; -+ __s32 hot_x; -+ __s32 hot_y; -+}; -+ -+struct drm_mode_crtc_lut { -+ __u32 crtc_id; -+ __u32 gamma_size; -+ -+ /* pointers to arrays */ -+ __u64 red; -+ __u64 green; -+ __u64 blue; -+}; -+ -+struct drm_color_ctm { -+ /* -+ * Conversion matrix in S31.32 sign-magnitude -+ * (not two's complement!) format. -+ */ -+ __u64 matrix[9]; -+}; -+ -+struct drm_color_lut { -+ /* -+ * Values are mapped linearly to 0.0 - 1.0 range, with 0x0 == 0.0 and -+ * 0xffff == 1.0. -+ */ -+ __u16 red; -+ __u16 green; -+ __u16 blue; -+ __u16 reserved; -+}; -+ -+/** -+ * struct hdr_metadata_infoframe - HDR Metadata Infoframe Data. -+ * -+ * HDR Metadata Infoframe as per CTA 861.G spec. This is expected -+ * to match exactly with the spec. -+ * -+ * Userspace is expected to pass the metadata information as per -+ * the format described in this structure. -+ */ -+struct hdr_metadata_infoframe { -+ /** -+ * @eotf: Electro-Optical Transfer Function (EOTF) -+ * used in the stream. -+ */ -+ __u8 eotf; -+ /** -+ * @metadata_type: Static_Metadata_Descriptor_ID. -+ */ -+ __u8 metadata_type; -+ /** -+ * @display_primaries: Color Primaries of the Data. -+ * These are coded as unsigned 16-bit values in units of -+ * 0.00002, where 0x0000 represents zero and 0xC350 -+ * represents 1.0000. -+ * @display_primaries.x: X cordinate of color primary. -+ * @display_primaries.y: Y cordinate of color primary. -+ */ -+ struct { -+ __u16 x, y; -+ } display_primaries[3]; -+ /** -+ * @white_point: White Point of Colorspace Data. -+ * These are coded as unsigned 16-bit values in units of -+ * 0.00002, where 0x0000 represents zero and 0xC350 -+ * represents 1.0000. -+ * @white_point.x: X cordinate of whitepoint of color primary. -+ * @white_point.y: Y cordinate of whitepoint of color primary. -+ */ -+ struct { -+ __u16 x, y; -+ } white_point; -+ /** -+ * @max_display_mastering_luminance: Max Mastering Display Luminance. -+ * This value is coded as an unsigned 16-bit value in units of 1 cd/m2, -+ * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2. -+ */ -+ __u16 max_display_mastering_luminance; -+ /** -+ * @min_display_mastering_luminance: Min Mastering Display Luminance. -+ * This value is coded as an unsigned 16-bit value in units of -+ * 0.0001 cd/m2, where 0x0001 represents 0.0001 cd/m2 and 0xFFFF -+ * represents 6.5535 cd/m2. -+ */ -+ __u16 min_display_mastering_luminance; -+ /** -+ * @max_cll: Max Content Light Level. -+ * This value is coded as an unsigned 16-bit value in units of 1 cd/m2, -+ * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2. -+ */ -+ __u16 max_cll; -+ /** -+ * @max_fall: Max Frame Average Light Level. -+ * This value is coded as an unsigned 16-bit value in units of 1 cd/m2, -+ * where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2. -+ */ -+ __u16 max_fall; -+}; -+ -+/** -+ * struct hdr_output_metadata - HDR output metadata -+ * -+ * Metadata Information to be passed from userspace -+ */ -+struct hdr_output_metadata { -+ /** -+ * @metadata_type: Static_Metadata_Descriptor_ID. -+ */ -+ __u32 metadata_type; -+ /** -+ * @hdmi_metadata_type1: HDR Metadata Infoframe. -+ */ -+ union { -+ struct hdr_metadata_infoframe hdmi_metadata_type1; -+ }; -+}; -+ -+#define DRM_MODE_PAGE_FLIP_EVENT 0x01 -+#define DRM_MODE_PAGE_FLIP_ASYNC 0x02 -+#define DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE 0x4 -+#define DRM_MODE_PAGE_FLIP_TARGET_RELATIVE 0x8 -+#define DRM_MODE_PAGE_FLIP_TARGET (DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE | \ -+ DRM_MODE_PAGE_FLIP_TARGET_RELATIVE) -+#define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT | \ -+ DRM_MODE_PAGE_FLIP_ASYNC | \ -+ DRM_MODE_PAGE_FLIP_TARGET) -+ -+/* -+ * Request a page flip on the specified crtc. -+ * -+ * This ioctl will ask KMS to schedule a page flip for the specified -+ * crtc. Once any pending rendering targeting the specified fb (as of -+ * ioctl time) has completed, the crtc will be reprogrammed to display -+ * that fb after the next vertical refresh. The ioctl returns -+ * immediately, but subsequent rendering to the current fb will block -+ * in the execbuffer ioctl until the page flip happens. If a page -+ * flip is already pending as the ioctl is called, EBUSY will be -+ * returned. -+ * -+ * Flag DRM_MODE_PAGE_FLIP_EVENT requests that drm sends back a vblank -+ * event (see drm.h: struct drm_event_vblank) when the page flip is -+ * done. The user_data field passed in with this ioctl will be -+ * returned as the user_data field in the vblank event struct. -+ * -+ * Flag DRM_MODE_PAGE_FLIP_ASYNC requests that the flip happen -+ * 'as soon as possible', meaning that it not delay waiting for vblank. -+ * This may cause tearing on the screen. -+ * -+ * The reserved field must be zero. -+ */ -+ -+struct drm_mode_crtc_page_flip { -+ __u32 crtc_id; -+ __u32 fb_id; -+ __u32 flags; -+ __u32 reserved; -+ __u64 user_data; -+}; -+ -+/* -+ * Request a page flip on the specified crtc. -+ * -+ * Same as struct drm_mode_crtc_page_flip, but supports new flags and -+ * re-purposes the reserved field: -+ * -+ * The sequence field must be zero unless either of the -+ * DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags is specified. When -+ * the ABSOLUTE flag is specified, the sequence field denotes the absolute -+ * vblank sequence when the flip should take effect. When the RELATIVE -+ * flag is specified, the sequence field denotes the relative (to the -+ * current one when the ioctl is called) vblank sequence when the flip -+ * should take effect. NOTE: DRM_IOCTL_WAIT_VBLANK must still be used to -+ * make sure the vblank sequence before the target one has passed before -+ * calling this ioctl. The purpose of the -+ * DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags is merely to clarify -+ * the target for when code dealing with a page flip runs during a -+ * vertical blank period. -+ */ -+ -+struct drm_mode_crtc_page_flip_target { -+ __u32 crtc_id; -+ __u32 fb_id; -+ __u32 flags; -+ __u32 sequence; -+ __u64 user_data; -+}; -+ -+/* create a dumb scanout buffer */ -+struct drm_mode_create_dumb { -+ __u32 height; -+ __u32 width; -+ __u32 bpp; -+ __u32 flags; -+ /* handle, pitch, size will be returned */ -+ __u32 handle; -+ __u32 pitch; -+ __u64 size; -+}; -+ -+/* set up for mmap of a dumb scanout buffer */ -+struct drm_mode_map_dumb { -+ /** Handle for the object being mapped. */ -+ __u32 handle; -+ __u32 pad; -+ /** -+ * Fake offset to use for subsequent mmap call -+ * -+ * This is a fixed-size type for 32/64 compatibility. -+ */ -+ __u64 offset; -+}; -+ -+struct drm_mode_destroy_dumb { -+ __u32 handle; -+}; -+ -+/* page-flip flags are valid, plus: */ -+#define DRM_MODE_ATOMIC_TEST_ONLY 0x0100 -+#define DRM_MODE_ATOMIC_NONBLOCK 0x0200 -+#define DRM_MODE_ATOMIC_ALLOW_MODESET 0x0400 -+ -+#define DRM_MODE_ATOMIC_FLAGS (\ -+ DRM_MODE_PAGE_FLIP_EVENT |\ -+ DRM_MODE_PAGE_FLIP_ASYNC |\ -+ DRM_MODE_ATOMIC_TEST_ONLY |\ -+ DRM_MODE_ATOMIC_NONBLOCK |\ -+ DRM_MODE_ATOMIC_ALLOW_MODESET) -+ -+struct drm_mode_atomic { -+ __u32 flags; -+ __u32 count_objs; -+ __u64 objs_ptr; -+ __u64 count_props_ptr; -+ __u64 props_ptr; -+ __u64 prop_values_ptr; -+ __u64 reserved; -+ __u64 user_data; -+}; -+ -+struct drm_format_modifier_blob { -+#define FORMAT_BLOB_CURRENT 1 -+ /* Version of this blob format */ -+ __u32 version; -+ -+ /* Flags */ -+ __u32 flags; -+ -+ /* Number of fourcc formats supported */ -+ __u32 count_formats; -+ -+ /* Where in this blob the formats exist (in bytes) */ -+ __u32 formats_offset; -+ -+ /* Number of drm_format_modifiers */ -+ __u32 count_modifiers; -+ -+ /* Where in this blob the modifiers exist (in bytes) */ -+ __u32 modifiers_offset; -+ -+ /* __u32 formats[] */ -+ /* struct drm_format_modifier modifiers[] */ -+}; -+ -+struct drm_format_modifier { -+ /* Bitmask of formats in get_plane format list this info applies to. The -+ * offset allows a sliding window of which 64 formats (bits). -+ * -+ * Some examples: -+ * In today's world with < 65 formats, and formats 0, and 2 are -+ * supported -+ * 0x0000000000000005 -+ * ^-offset = 0, formats = 5 -+ * -+ * If the number formats grew to 128, and formats 98-102 are -+ * supported with the modifier: -+ * -+ * 0x0000007c00000000 0000000000000000 -+ * ^ -+ * |__offset = 64, formats = 0x7c00000000 -+ * -+ */ -+ __u64 formats; -+ __u32 offset; -+ __u32 pad; -+ -+ /* The modifier that applies to the >get_plane format list bitmask. */ -+ __u64 modifier; -+}; -+ -+/** -+ * struct drm_mode_create_blob - Create New blob property -+ * -+ * Create a new 'blob' data property, copying length bytes from data pointer, -+ * and returning new blob ID. -+ */ -+struct drm_mode_create_blob { -+ /** @data: Pointer to data to copy. */ -+ __u64 data; -+ /** @length: Length of data to copy. */ -+ __u32 length; -+ /** @blob_id: Return: new property ID. */ -+ __u32 blob_id; -+}; -+ -+/** -+ * struct drm_mode_destroy_blob - Destroy user blob -+ * @blob_id: blob_id to destroy -+ * -+ * Destroy a user-created blob property. -+ * -+ * User-space can release blobs as soon as they do not need to refer to them by -+ * their blob object ID. For instance, if you are using a MODE_ID blob in an -+ * atomic commit and you will not make another commit re-using the same ID, you -+ * can destroy the blob as soon as the commit has been issued, without waiting -+ * for it to complete. -+ */ -+struct drm_mode_destroy_blob { -+ __u32 blob_id; -+}; -+ -+/** -+ * struct drm_mode_create_lease - Create lease -+ * -+ * Lease mode resources, creating another drm_master. -+ * -+ * The @object_ids array must reference at least one CRTC, one connector and -+ * one plane if &DRM_CLIENT_CAP_UNIVERSAL_PLANES is enabled. Alternatively, -+ * the lease can be completely empty. -+ */ -+struct drm_mode_create_lease { -+ /** @object_ids: Pointer to array of object ids (__u32) */ -+ __u64 object_ids; -+ /** @object_count: Number of object ids */ -+ __u32 object_count; -+ /** @flags: flags for new FD (O_CLOEXEC, etc) */ -+ __u32 flags; -+ -+ /** @lessee_id: Return: unique identifier for lessee. */ -+ __u32 lessee_id; -+ /** @fd: Return: file descriptor to new drm_master file */ -+ __u32 fd; -+}; -+ -+/** -+ * struct drm_mode_list_lessees - List lessees -+ * -+ * List lesses from a drm_master. -+ */ -+struct drm_mode_list_lessees { -+ /** -+ * @count_lessees: Number of lessees. -+ * -+ * On input, provides length of the array. -+ * On output, provides total number. No -+ * more than the input number will be written -+ * back, so two calls can be used to get -+ * the size and then the data. -+ */ -+ __u32 count_lessees; -+ /** @pad: Padding. */ -+ __u32 pad; -+ -+ /** -+ * @lessees_ptr: Pointer to lessees. -+ * -+ * Pointer to __u64 array of lessee ids -+ */ -+ __u64 lessees_ptr; -+}; -+ -+/** -+ * struct drm_mode_get_lease - Get Lease -+ * -+ * Get leased objects. -+ */ -+struct drm_mode_get_lease { -+ /** -+ * @count_objects: Number of leased objects. -+ * -+ * On input, provides length of the array. -+ * On output, provides total number. No -+ * more than the input number will be written -+ * back, so two calls can be used to get -+ * the size and then the data. -+ */ -+ __u32 count_objects; -+ /** @pad: Padding. */ -+ __u32 pad; -+ -+ /** -+ * @objects_ptr: Pointer to objects. -+ * -+ * Pointer to __u32 array of object ids. -+ */ -+ __u64 objects_ptr; -+}; -+ -+/** -+ * struct drm_mode_revoke_lease - Revoke lease -+ */ -+struct drm_mode_revoke_lease { -+ /** @lessee_id: Unique ID of lessee */ -+ __u32 lessee_id; -+}; -+ -+/** -+ * struct drm_mode_rect - Two dimensional rectangle. -+ * @x1: Horizontal starting coordinate (inclusive). -+ * @y1: Vertical starting coordinate (inclusive). -+ * @x2: Horizontal ending coordinate (exclusive). -+ * @y2: Vertical ending coordinate (exclusive). -+ * -+ * With drm subsystem using struct drm_rect to manage rectangular area this -+ * export it to user-space. -+ * -+ * Currently used by drm_mode_atomic blob property FB_DAMAGE_CLIPS. -+ */ -+struct drm_mode_rect { -+ __s32 x1; -+ __s32 y1; -+ __s32 x2; -+ __s32 y2; -+}; -+ -+#if defined(__cplusplus) -+} -+#endif -+ -+#endif -diff -up firefox-109.0/third_party/drm/drm/xf86drm.h.libwebrtc-screen-cast-sync firefox-109.0/third_party/drm/drm/xf86drm.h ---- firefox-109.0/third_party/drm/drm/xf86drm.h.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.194614122 +0100 -+++ firefox-109.0/third_party/drm/drm/xf86drm.h 2023-01-12 15:16:09.194614122 +0100 -@@ -0,0 +1,966 @@ -+/** -+ * \file xf86drm.h -+ * OS-independent header for DRM user-level library interface. -+ * -+ * \author Rickard E. (Rik) Faith -+ */ -+ -+/* -+ * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas. -+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. -+ * All Rights Reserved. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -+ * DEALINGS IN THE SOFTWARE. -+ * -+ */ -+ -+#ifndef _XF86DRM_H_ -+#define _XF86DRM_H_ -+ -+#include -+#include -+#include -+#include -+ -+#if defined(__cplusplus) -+extern "C" { -+#endif -+ -+#ifndef DRM_MAX_MINOR -+#define DRM_MAX_MINOR 16 -+#endif -+ -+#if defined(__linux__) -+ -+#define DRM_IOCTL_NR(n) _IOC_NR(n) -+#define DRM_IOC_VOID _IOC_NONE -+#define DRM_IOC_READ _IOC_READ -+#define DRM_IOC_WRITE _IOC_WRITE -+#define DRM_IOC_READWRITE _IOC_READ|_IOC_WRITE -+#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size) -+ -+#else /* One of the *BSDs */ -+ -+#include -+#define DRM_IOCTL_NR(n) ((n) & 0xff) -+#define DRM_IOC_VOID IOC_VOID -+#define DRM_IOC_READ IOC_OUT -+#define DRM_IOC_WRITE IOC_IN -+#define DRM_IOC_READWRITE IOC_INOUT -+#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size) -+ -+#endif -+ -+ /* Defaults, if nothing set in xf86config */ -+#define DRM_DEV_UID 0 -+#define DRM_DEV_GID 0 -+/* Default /dev/dri directory permissions 0755 */ -+#define DRM_DEV_DIRMODE \ -+ (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) -+#define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) -+ -+#ifdef __OpenBSD__ -+#define DRM_DIR_NAME "/dev" -+#define DRM_PRIMARY_MINOR_NAME "drm" -+#define DRM_CONTROL_MINOR_NAME "drmC" -+#define DRM_RENDER_MINOR_NAME "drmR" -+#else -+#define DRM_DIR_NAME "/dev/dri" -+#define DRM_PRIMARY_MINOR_NAME "card" -+#define DRM_CONTROL_MINOR_NAME "controlD" -+#define DRM_RENDER_MINOR_NAME "renderD" -+#define DRM_PROC_NAME "/proc/dri/" /* For backward Linux compatibility */ -+#endif -+ -+#define DRM_DEV_NAME "%s/" DRM_PRIMARY_MINOR_NAME "%d" -+#define DRM_CONTROL_DEV_NAME "%s/" DRM_CONTROL_MINOR_NAME "%d" -+#define DRM_RENDER_DEV_NAME "%s/" DRM_RENDER_MINOR_NAME "%d" -+ -+#define DRM_NODE_NAME_MAX \ -+ (sizeof(DRM_DIR_NAME) + 1 /* slash */ \ -+ + MAX3(sizeof(DRM_PRIMARY_MINOR_NAME), \ -+ sizeof(DRM_CONTROL_MINOR_NAME), \ -+ sizeof(DRM_RENDER_MINOR_NAME)) \ -+ + sizeof("144") /* highest possible node number */ \ -+ + 1) /* NULL-terminator */ -+ -+#define DRM_ERR_NO_DEVICE (-1001) -+#define DRM_ERR_NO_ACCESS (-1002) -+#define DRM_ERR_NOT_ROOT (-1003) -+#define DRM_ERR_INVALID (-1004) -+#define DRM_ERR_NO_FD (-1005) -+ -+#define DRM_AGP_NO_HANDLE 0 -+ -+typedef unsigned int drmSize, *drmSizePtr; /**< For mapped regions */ -+typedef void *drmAddress, **drmAddressPtr; /**< For mapped regions */ -+ -+#if (__GNUC__ >= 3) -+#define DRM_PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a))) -+#else -+#define DRM_PRINTFLIKE(f, a) -+#endif -+ -+typedef struct _drmServerInfo { -+ int (*debug_print)(const char *format, va_list ap) DRM_PRINTFLIKE(1,0); -+ int (*load_module)(const char *name); -+ void (*get_perms)(gid_t *, mode_t *); -+} drmServerInfo, *drmServerInfoPtr; -+ -+typedef struct drmHashEntry { -+ int fd; -+ void (*f)(int, void *, void *); -+ void *tagTable; -+} drmHashEntry; -+ -+extern int drmIoctl(int fd, unsigned long request, void *arg); -+extern void *drmGetHashTable(void); -+extern drmHashEntry *drmGetEntry(int fd); -+ -+/** -+ * Driver version information. -+ * -+ * \sa drmGetVersion() and drmSetVersion(). -+ */ -+typedef struct _drmVersion { -+ int version_major; /**< Major version */ -+ int version_minor; /**< Minor version */ -+ int version_patchlevel; /**< Patch level */ -+ int name_len; /**< Length of name buffer */ -+ char *name; /**< Name of driver */ -+ int date_len; /**< Length of date buffer */ -+ char *date; /**< User-space buffer to hold date */ -+ int desc_len; /**< Length of desc buffer */ -+ char *desc; /**< User-space buffer to hold desc */ -+} drmVersion, *drmVersionPtr; -+ -+typedef struct _drmStats { -+ unsigned long count; /**< Number of data */ -+ struct { -+ unsigned long value; /**< Value from kernel */ -+ const char *long_format; /**< Suggested format for long_name */ -+ const char *long_name; /**< Long name for value */ -+ const char *rate_format; /**< Suggested format for rate_name */ -+ const char *rate_name; /**< Short name for value per second */ -+ int isvalue; /**< True if value (vs. counter) */ -+ const char *mult_names; /**< Multiplier names (e.g., "KGM") */ -+ int mult; /**< Multiplier value (e.g., 1024) */ -+ int verbose; /**< Suggest only in verbose output */ -+ } data[15]; -+} drmStatsT; -+ -+ -+ /* All of these enums *MUST* match with the -+ kernel implementation -- so do *NOT* -+ change them! (The drmlib implementation -+ will just copy the flags instead of -+ translating them.) */ -+typedef enum { -+ DRM_FRAME_BUFFER = 0, /**< WC, no caching, no core dump */ -+ DRM_REGISTERS = 1, /**< no caching, no core dump */ -+ DRM_SHM = 2, /**< shared, cached */ -+ DRM_AGP = 3, /**< AGP/GART */ -+ DRM_SCATTER_GATHER = 4, /**< PCI scatter/gather */ -+ DRM_CONSISTENT = 5 /**< PCI consistent */ -+} drmMapType; -+ -+typedef enum { -+ DRM_RESTRICTED = 0x0001, /**< Cannot be mapped to client-virtual */ -+ DRM_READ_ONLY = 0x0002, /**< Read-only in client-virtual */ -+ DRM_LOCKED = 0x0004, /**< Physical pages locked */ -+ DRM_KERNEL = 0x0008, /**< Kernel requires access */ -+ DRM_WRITE_COMBINING = 0x0010, /**< Use write-combining, if available */ -+ DRM_CONTAINS_LOCK = 0x0020, /**< SHM page that contains lock */ -+ DRM_REMOVABLE = 0x0040 /**< Removable mapping */ -+} drmMapFlags; -+ -+/** -+ * \warning These values *MUST* match drm.h -+ */ -+typedef enum { -+ /** \name Flags for DMA buffer dispatch */ -+ /*@{*/ -+ DRM_DMA_BLOCK = 0x01, /**< -+ * Block until buffer dispatched. -+ * -+ * \note the buffer may not yet have been -+ * processed by the hardware -- getting a -+ * hardware lock with the hardware quiescent -+ * will ensure that the buffer has been -+ * processed. -+ */ -+ DRM_DMA_WHILE_LOCKED = 0x02, /**< Dispatch while lock held */ -+ DRM_DMA_PRIORITY = 0x04, /**< High priority dispatch */ -+ /*@}*/ -+ -+ /** \name Flags for DMA buffer request */ -+ /*@{*/ -+ DRM_DMA_WAIT = 0x10, /**< Wait for free buffers */ -+ DRM_DMA_SMALLER_OK = 0x20, /**< Smaller-than-requested buffers OK */ -+ DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */ -+ /*@}*/ -+} drmDMAFlags; -+ -+typedef enum { -+ DRM_PAGE_ALIGN = 0x01, -+ DRM_AGP_BUFFER = 0x02, -+ DRM_SG_BUFFER = 0x04, -+ DRM_FB_BUFFER = 0x08, -+ DRM_PCI_BUFFER_RO = 0x10 -+} drmBufDescFlags; -+ -+typedef enum { -+ DRM_LOCK_READY = 0x01, /**< Wait until hardware is ready for DMA */ -+ DRM_LOCK_QUIESCENT = 0x02, /**< Wait until hardware quiescent */ -+ DRM_LOCK_FLUSH = 0x04, /**< Flush this context's DMA queue first */ -+ DRM_LOCK_FLUSH_ALL = 0x08, /**< Flush all DMA queues first */ -+ /* These *HALT* flags aren't supported yet -+ -- they will be used to support the -+ full-screen DGA-like mode. */ -+ DRM_HALT_ALL_QUEUES = 0x10, /**< Halt all current and future queues */ -+ DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */ -+} drmLockFlags; -+ -+typedef enum { -+ DRM_CONTEXT_PRESERVED = 0x01, /**< This context is preserved and -+ never swapped. */ -+ DRM_CONTEXT_2DONLY = 0x02 /**< This context is for 2D rendering only. */ -+} drm_context_tFlags, *drm_context_tFlagsPtr; -+ -+typedef struct _drmBufDesc { -+ int count; /**< Number of buffers of this size */ -+ int size; /**< Size in bytes */ -+ int low_mark; /**< Low water mark */ -+ int high_mark; /**< High water mark */ -+} drmBufDesc, *drmBufDescPtr; -+ -+typedef struct _drmBufInfo { -+ int count; /**< Number of buffers described in list */ -+ drmBufDescPtr list; /**< List of buffer descriptions */ -+} drmBufInfo, *drmBufInfoPtr; -+ -+typedef struct _drmBuf { -+ int idx; /**< Index into the master buffer list */ -+ int total; /**< Buffer size */ -+ int used; /**< Amount of buffer in use (for DMA) */ -+ drmAddress address; /**< Address */ -+} drmBuf, *drmBufPtr; -+ -+/** -+ * Buffer mapping information. -+ * -+ * Used by drmMapBufs() and drmUnmapBufs() to store information about the -+ * mapped buffers. -+ */ -+typedef struct _drmBufMap { -+ int count; /**< Number of buffers mapped */ -+ drmBufPtr list; /**< Buffers */ -+} drmBufMap, *drmBufMapPtr; -+ -+typedef struct _drmLock { -+ volatile unsigned int lock; -+ char padding[60]; -+ /* This is big enough for most current (and future?) architectures: -+ DEC Alpha: 32 bytes -+ Intel Merced: ? -+ Intel P5/PPro/PII/PIII: 32 bytes -+ Intel StrongARM: 32 bytes -+ Intel i386/i486: 16 bytes -+ MIPS: 32 bytes (?) -+ Motorola 68k: 16 bytes -+ Motorola PowerPC: 32 bytes -+ Sun SPARC: 32 bytes -+ */ -+} drmLock, *drmLockPtr; -+ -+/** -+ * Indices here refer to the offset into -+ * list in drmBufInfo -+ */ -+typedef struct _drmDMAReq { -+ drm_context_t context; /**< Context handle */ -+ int send_count; /**< Number of buffers to send */ -+ int *send_list; /**< List of handles to buffers */ -+ int *send_sizes; /**< Lengths of data to send, in bytes */ -+ drmDMAFlags flags; /**< Flags */ -+ int request_count; /**< Number of buffers requested */ -+ int request_size; /**< Desired size of buffers requested */ -+ int *request_list; /**< Buffer information */ -+ int *request_sizes; /**< Minimum acceptable sizes */ -+ int granted_count; /**< Number of buffers granted at this size */ -+} drmDMAReq, *drmDMAReqPtr; -+ -+typedef struct _drmRegion { -+ drm_handle_t handle; -+ unsigned int offset; -+ drmSize size; -+ drmAddress map; -+} drmRegion, *drmRegionPtr; -+ -+typedef struct _drmTextureRegion { -+ unsigned char next; -+ unsigned char prev; -+ unsigned char in_use; -+ unsigned char padding; /**< Explicitly pad this out */ -+ unsigned int age; -+} drmTextureRegion, *drmTextureRegionPtr; -+ -+ -+typedef enum { -+ DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ -+ DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ -+ /* bits 1-6 are reserved for high crtcs */ -+ DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e, -+ DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */ -+ DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ -+ DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ -+ DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ -+ DRM_VBLANK_SIGNAL = 0x40000000 /* Send signal instead of blocking */ -+} drmVBlankSeqType; -+#define DRM_VBLANK_HIGH_CRTC_SHIFT 1 -+ -+typedef struct _drmVBlankReq { -+ drmVBlankSeqType type; -+ unsigned int sequence; -+ unsigned long signal; -+} drmVBlankReq, *drmVBlankReqPtr; -+ -+typedef struct _drmVBlankReply { -+ drmVBlankSeqType type; -+ unsigned int sequence; -+ long tval_sec; -+ long tval_usec; -+} drmVBlankReply, *drmVBlankReplyPtr; -+ -+typedef union _drmVBlank { -+ drmVBlankReq request; -+ drmVBlankReply reply; -+} drmVBlank, *drmVBlankPtr; -+ -+typedef struct _drmSetVersion { -+ int drm_di_major; -+ int drm_di_minor; -+ int drm_dd_major; -+ int drm_dd_minor; -+} drmSetVersion, *drmSetVersionPtr; -+ -+#define __drm_dummy_lock(lock) (*(__volatile__ unsigned int *)lock) -+ -+#define DRM_LOCK_HELD 0x80000000U /**< Hardware lock is held */ -+#define DRM_LOCK_CONT 0x40000000U /**< Hardware lock is contended */ -+ -+#if defined(__GNUC__) && (__GNUC__ >= 2) -+# if defined(__i386) || defined(__AMD64__) || defined(__x86_64__) || defined(__amd64__) -+ /* Reflect changes here to drmP.h */ -+#define DRM_CAS(lock,old,new,__ret) \ -+ do { \ -+ int __dummy; /* Can't mark eax as clobbered */ \ -+ __asm__ __volatile__( \ -+ "lock ; cmpxchg %4,%1\n\t" \ -+ "setnz %0" \ -+ : "=d" (__ret), \ -+ "=m" (__drm_dummy_lock(lock)), \ -+ "=a" (__dummy) \ -+ : "2" (old), \ -+ "r" (new)); \ -+ } while (0) -+ -+#elif defined(__alpha__) -+ -+#define DRM_CAS(lock, old, new, ret) \ -+ do { \ -+ int tmp, old32; \ -+ __asm__ __volatile__( \ -+ " addl $31, %5, %3\n" \ -+ "1: ldl_l %0, %2\n" \ -+ " cmpeq %0, %3, %1\n" \ -+ " beq %1, 2f\n" \ -+ " mov %4, %0\n" \ -+ " stl_c %0, %2\n" \ -+ " beq %0, 3f\n" \ -+ " mb\n" \ -+ "2: cmpeq %1, 0, %1\n" \ -+ ".subsection 2\n" \ -+ "3: br 1b\n" \ -+ ".previous" \ -+ : "=&r"(tmp), "=&r"(ret), \ -+ "=m"(__drm_dummy_lock(lock)), \ -+ "=&r"(old32) \ -+ : "r"(new), "r"(old) \ -+ : "memory"); \ -+ } while (0) -+ -+#elif defined(__sparc__) -+ -+#define DRM_CAS(lock,old,new,__ret) \ -+do { register unsigned int __old __asm("o0"); \ -+ register unsigned int __new __asm("o1"); \ -+ register volatile unsigned int *__lock __asm("o2"); \ -+ __old = old; \ -+ __new = new; \ -+ __lock = (volatile unsigned int *)lock; \ -+ __asm__ __volatile__( \ -+ /*"cas [%2], %3, %0"*/ \ -+ ".word 0xd3e29008\n\t" \ -+ /*"membar #StoreStore | #StoreLoad"*/ \ -+ ".word 0x8143e00a" \ -+ : "=&r" (__new) \ -+ : "0" (__new), \ -+ "r" (__lock), \ -+ "r" (__old) \ -+ : "memory"); \ -+ __ret = (__new != __old); \ -+} while(0) -+ -+#elif defined(__ia64__) -+ -+#ifdef __INTEL_COMPILER -+/* this currently generates bad code (missing stop bits)... */ -+#include -+ -+#define DRM_CAS(lock,old,new,__ret) \ -+ do { \ -+ unsigned long __result, __old = (old) & 0xffffffff; \ -+ __mf(); \ -+ __result = _InterlockedCompareExchange_acq(&__drm_dummy_lock(lock), (new), __old);\ -+ __ret = (__result) != (__old); \ -+/* __ret = (__sync_val_compare_and_swap(&__drm_dummy_lock(lock), \ -+ (old), (new)) \ -+ != (old)); */\ -+ } while (0) -+ -+#else -+#define DRM_CAS(lock,old,new,__ret) \ -+ do { \ -+ unsigned int __result, __old = (old); \ -+ __asm__ __volatile__( \ -+ "mf\n" \ -+ "mov ar.ccv=%2\n" \ -+ ";;\n" \ -+ "cmpxchg4.acq %0=%1,%3,ar.ccv" \ -+ : "=r" (__result), "=m" (__drm_dummy_lock(lock)) \ -+ : "r" ((unsigned long)__old), "r" (new) \ -+ : "memory"); \ -+ __ret = (__result) != (__old); \ -+ } while (0) -+ -+#endif -+ -+#elif defined(__powerpc__) -+ -+#define DRM_CAS(lock,old,new,__ret) \ -+ do { \ -+ __asm__ __volatile__( \ -+ "sync;" \ -+ "0: lwarx %0,0,%1;" \ -+ " xor. %0,%3,%0;" \ -+ " bne 1f;" \ -+ " stwcx. %2,0,%1;" \ -+ " bne- 0b;" \ -+ "1: " \ -+ "sync;" \ -+ : "=&r"(__ret) \ -+ : "r"(lock), "r"(new), "r"(old) \ -+ : "cr0", "memory"); \ -+ } while (0) -+ -+# elif defined (__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \ -+ || defined (__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \ -+ || defined (__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) \ -+ || defined (__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \ -+ || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \ -+ || defined(__ARM_ARCH_7EM__) -+ /* excluding ARMv4/ARMv5 and lower (lacking ldrex/strex support) */ -+ #undef DRM_DEV_MODE -+ #define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) -+ -+ #define DRM_CAS(lock,old,new,__ret) \ -+ do { \ -+ __asm__ __volatile__ ( \ -+ "1: ldrex %0, [%1]\n" \ -+ " teq %0, %2\n" \ -+ " ite eq\n" \ -+ " strexeq %0, %3, [%1]\n" \ -+ " movne %0, #1\n" \ -+ : "=&r" (__ret) \ -+ : "r" (lock), "r" (old), "r" (new) \ -+ : "cc","memory"); \ -+ } while (0) -+ -+#endif /* architecture */ -+#endif /* __GNUC__ >= 2 */ -+ -+#ifndef DRM_CAS -+#define DRM_CAS(lock,old,new,ret) do { ret=1; } while (0) /* FAST LOCK FAILS */ -+#endif -+ -+#if defined(__alpha__) -+#define DRM_CAS_RESULT(_result) long _result -+#elif defined(__powerpc__) -+#define DRM_CAS_RESULT(_result) int _result -+#else -+#define DRM_CAS_RESULT(_result) char _result -+#endif -+ -+#define DRM_LIGHT_LOCK(fd,lock,context) \ -+ do { \ -+ DRM_CAS_RESULT(__ret); \ -+ DRM_CAS(lock,context,DRM_LOCK_HELD|context,__ret); \ -+ if (__ret) drmGetLock(fd,context,0); \ -+ } while(0) -+ -+ /* This one counts fast locks -- for -+ benchmarking only. */ -+#define DRM_LIGHT_LOCK_COUNT(fd,lock,context,count) \ -+ do { \ -+ DRM_CAS_RESULT(__ret); \ -+ DRM_CAS(lock,context,DRM_LOCK_HELD|context,__ret); \ -+ if (__ret) drmGetLock(fd,context,0); \ -+ else ++count; \ -+ } while(0) -+ -+#define DRM_LOCK(fd,lock,context,flags) \ -+ do { \ -+ if (flags) drmGetLock(fd,context,flags); \ -+ else DRM_LIGHT_LOCK(fd,lock,context); \ -+ } while(0) -+ -+#define DRM_UNLOCK(fd,lock,context) \ -+ do { \ -+ DRM_CAS_RESULT(__ret); \ -+ DRM_CAS(lock,DRM_LOCK_HELD|context,context,__ret); \ -+ if (__ret) drmUnlock(fd,context); \ -+ } while(0) -+ -+ /* Simple spin locks */ -+#define DRM_SPINLOCK(spin,val) \ -+ do { \ -+ DRM_CAS_RESULT(__ret); \ -+ do { \ -+ DRM_CAS(spin,0,val,__ret); \ -+ if (__ret) while ((spin)->lock); \ -+ } while (__ret); \ -+ } while(0) -+ -+#define DRM_SPINLOCK_TAKE(spin,val) \ -+ do { \ -+ DRM_CAS_RESULT(__ret); \ -+ int cur; \ -+ do { \ -+ cur = (*spin).lock; \ -+ DRM_CAS(spin,cur,val,__ret); \ -+ } while (__ret); \ -+ } while(0) -+ -+#define DRM_SPINLOCK_COUNT(spin,val,count,__ret) \ -+ do { \ -+ int __i; \ -+ __ret = 1; \ -+ for (__i = 0; __ret && __i < count; __i++) { \ -+ DRM_CAS(spin,0,val,__ret); \ -+ if (__ret) for (;__i < count && (spin)->lock; __i++); \ -+ } \ -+ } while(0) -+ -+#define DRM_SPINUNLOCK(spin,val) \ -+ do { \ -+ DRM_CAS_RESULT(__ret); \ -+ if ((*spin).lock == val) { /* else server stole lock */ \ -+ do { \ -+ DRM_CAS(spin,val,0,__ret); \ -+ } while (__ret); \ -+ } \ -+ } while(0) -+ -+ -+ -+/* General user-level programmer's API: unprivileged */ -+extern int drmAvailable(void); -+extern int drmOpen(const char *name, const char *busid); -+ -+#define DRM_NODE_PRIMARY 0 -+#define DRM_NODE_CONTROL 1 -+#define DRM_NODE_RENDER 2 -+#define DRM_NODE_MAX 3 -+ -+extern int drmOpenWithType(const char *name, const char *busid, -+ int type); -+ -+extern int drmOpenControl(int minor); -+extern int drmOpenRender(int minor); -+extern int drmClose(int fd); -+extern drmVersionPtr drmGetVersion(int fd); -+extern drmVersionPtr drmGetLibVersion(int fd); -+extern int drmGetCap(int fd, uint64_t capability, uint64_t *value); -+extern void drmFreeVersion(drmVersionPtr); -+extern int drmGetMagic(int fd, drm_magic_t * magic); -+extern char *drmGetBusid(int fd); -+extern int drmGetInterruptFromBusID(int fd, int busnum, int devnum, -+ int funcnum); -+extern int drmGetMap(int fd, int idx, drm_handle_t *offset, -+ drmSize *size, drmMapType *type, -+ drmMapFlags *flags, drm_handle_t *handle, -+ int *mtrr); -+extern int drmGetClient(int fd, int idx, int *auth, int *pid, -+ int *uid, unsigned long *magic, -+ unsigned long *iocs); -+extern int drmGetStats(int fd, drmStatsT *stats); -+extern int drmSetInterfaceVersion(int fd, drmSetVersion *version); -+extern int drmCommandNone(int fd, unsigned long drmCommandIndex); -+extern int drmCommandRead(int fd, unsigned long drmCommandIndex, -+ void *data, unsigned long size); -+extern int drmCommandWrite(int fd, unsigned long drmCommandIndex, -+ void *data, unsigned long size); -+extern int drmCommandWriteRead(int fd, unsigned long drmCommandIndex, -+ void *data, unsigned long size); -+ -+/* General user-level programmer's API: X server (root) only */ -+extern void drmFreeBusid(const char *busid); -+extern int drmSetBusid(int fd, const char *busid); -+extern int drmAuthMagic(int fd, drm_magic_t magic); -+extern int drmAddMap(int fd, -+ drm_handle_t offset, -+ drmSize size, -+ drmMapType type, -+ drmMapFlags flags, -+ drm_handle_t * handle); -+extern int drmRmMap(int fd, drm_handle_t handle); -+extern int drmAddContextPrivateMapping(int fd, drm_context_t ctx_id, -+ drm_handle_t handle); -+ -+extern int drmAddBufs(int fd, int count, int size, -+ drmBufDescFlags flags, -+ int agp_offset); -+extern int drmMarkBufs(int fd, double low, double high); -+extern int drmCreateContext(int fd, drm_context_t * handle); -+extern int drmSetContextFlags(int fd, drm_context_t context, -+ drm_context_tFlags flags); -+extern int drmGetContextFlags(int fd, drm_context_t context, -+ drm_context_tFlagsPtr flags); -+extern int drmAddContextTag(int fd, drm_context_t context, void *tag); -+extern int drmDelContextTag(int fd, drm_context_t context); -+extern void *drmGetContextTag(int fd, drm_context_t context); -+extern drm_context_t * drmGetReservedContextList(int fd, int *count); -+extern void drmFreeReservedContextList(drm_context_t *); -+extern int drmSwitchToContext(int fd, drm_context_t context); -+extern int drmDestroyContext(int fd, drm_context_t handle); -+extern int drmCreateDrawable(int fd, drm_drawable_t * handle); -+extern int drmDestroyDrawable(int fd, drm_drawable_t handle); -+extern int drmUpdateDrawableInfo(int fd, drm_drawable_t handle, -+ drm_drawable_info_type_t type, -+ unsigned int num, void *data); -+extern int drmCtlInstHandler(int fd, int irq); -+extern int drmCtlUninstHandler(int fd); -+extern int drmSetClientCap(int fd, uint64_t capability, -+ uint64_t value); -+ -+extern int drmCrtcGetSequence(int fd, uint32_t crtcId, -+ uint64_t *sequence, uint64_t *ns); -+extern int drmCrtcQueueSequence(int fd, uint32_t crtcId, -+ uint32_t flags, uint64_t sequence, -+ uint64_t *sequence_queued, -+ uint64_t user_data); -+/* General user-level programmer's API: authenticated client and/or X */ -+extern int drmMap(int fd, -+ drm_handle_t handle, -+ drmSize size, -+ drmAddressPtr address); -+extern int drmUnmap(drmAddress address, drmSize size); -+extern drmBufInfoPtr drmGetBufInfo(int fd); -+extern drmBufMapPtr drmMapBufs(int fd); -+extern int drmUnmapBufs(drmBufMapPtr bufs); -+extern int drmDMA(int fd, drmDMAReqPtr request); -+extern int drmFreeBufs(int fd, int count, int *list); -+extern int drmGetLock(int fd, -+ drm_context_t context, -+ drmLockFlags flags); -+extern int drmUnlock(int fd, drm_context_t context); -+extern int drmFinish(int fd, int context, drmLockFlags flags); -+extern int drmGetContextPrivateMapping(int fd, drm_context_t ctx_id, -+ drm_handle_t * handle); -+ -+/* AGP/GART support: X server (root) only */ -+extern int drmAgpAcquire(int fd); -+extern int drmAgpRelease(int fd); -+extern int drmAgpEnable(int fd, unsigned long mode); -+extern int drmAgpAlloc(int fd, unsigned long size, -+ unsigned long type, unsigned long *address, -+ drm_handle_t *handle); -+extern int drmAgpFree(int fd, drm_handle_t handle); -+extern int drmAgpBind(int fd, drm_handle_t handle, -+ unsigned long offset); -+extern int drmAgpUnbind(int fd, drm_handle_t handle); -+ -+/* AGP/GART info: authenticated client and/or X */ -+extern int drmAgpVersionMajor(int fd); -+extern int drmAgpVersionMinor(int fd); -+extern unsigned long drmAgpGetMode(int fd); -+extern unsigned long drmAgpBase(int fd); /* Physical location */ -+extern unsigned long drmAgpSize(int fd); /* Bytes */ -+extern unsigned long drmAgpMemoryUsed(int fd); -+extern unsigned long drmAgpMemoryAvail(int fd); -+extern unsigned int drmAgpVendorId(int fd); -+extern unsigned int drmAgpDeviceId(int fd); -+ -+/* PCI scatter/gather support: X server (root) only */ -+extern int drmScatterGatherAlloc(int fd, unsigned long size, -+ drm_handle_t *handle); -+extern int drmScatterGatherFree(int fd, drm_handle_t handle); -+ -+extern int drmWaitVBlank(int fd, drmVBlankPtr vbl); -+ -+/* Support routines */ -+extern void drmSetServerInfo(drmServerInfoPtr info); -+extern int drmError(int err, const char *label); -+extern void *drmMalloc(int size); -+extern void drmFree(void *pt); -+ -+/* Hash table routines */ -+extern void *drmHashCreate(void); -+extern int drmHashDestroy(void *t); -+extern int drmHashLookup(void *t, unsigned long key, void **value); -+extern int drmHashInsert(void *t, unsigned long key, void *value); -+extern int drmHashDelete(void *t, unsigned long key); -+extern int drmHashFirst(void *t, unsigned long *key, void **value); -+extern int drmHashNext(void *t, unsigned long *key, void **value); -+ -+/* PRNG routines */ -+extern void *drmRandomCreate(unsigned long seed); -+extern int drmRandomDestroy(void *state); -+extern unsigned long drmRandom(void *state); -+extern double drmRandomDouble(void *state); -+ -+/* Skip list routines */ -+ -+extern void *drmSLCreate(void); -+extern int drmSLDestroy(void *l); -+extern int drmSLLookup(void *l, unsigned long key, void **value); -+extern int drmSLInsert(void *l, unsigned long key, void *value); -+extern int drmSLDelete(void *l, unsigned long key); -+extern int drmSLNext(void *l, unsigned long *key, void **value); -+extern int drmSLFirst(void *l, unsigned long *key, void **value); -+extern void drmSLDump(void *l); -+extern int drmSLLookupNeighbors(void *l, unsigned long key, -+ unsigned long *prev_key, void **prev_value, -+ unsigned long *next_key, void **next_value); -+ -+extern int drmOpenOnce(void *unused, const char *BusID, int *newlyopened); -+extern int drmOpenOnceWithType(const char *BusID, int *newlyopened, int type); -+extern void drmCloseOnce(int fd); -+extern void drmMsg(const char *format, ...) DRM_PRINTFLIKE(1, 2); -+ -+extern int drmSetMaster(int fd); -+extern int drmDropMaster(int fd); -+extern int drmIsMaster(int fd); -+ -+#define DRM_EVENT_CONTEXT_VERSION 4 -+ -+typedef struct _drmEventContext { -+ -+ /* This struct is versioned so we can add more pointers if we -+ * add more events. */ -+ int version; -+ -+ void (*vblank_handler)(int fd, -+ unsigned int sequence, -+ unsigned int tv_sec, -+ unsigned int tv_usec, -+ void *user_data); -+ -+ void (*page_flip_handler)(int fd, -+ unsigned int sequence, -+ unsigned int tv_sec, -+ unsigned int tv_usec, -+ void *user_data); -+ -+ void (*page_flip_handler2)(int fd, -+ unsigned int sequence, -+ unsigned int tv_sec, -+ unsigned int tv_usec, -+ unsigned int crtc_id, -+ void *user_data); -+ -+ void (*sequence_handler)(int fd, -+ uint64_t sequence, -+ uint64_t ns, -+ uint64_t user_data); -+} drmEventContext, *drmEventContextPtr; -+ -+extern int drmHandleEvent(int fd, drmEventContextPtr evctx); -+ -+extern char *drmGetDeviceNameFromFd(int fd); -+ -+/* Improved version of drmGetDeviceNameFromFd which attributes for any type of -+ * device/node - card, control or renderD. -+ */ -+extern char *drmGetDeviceNameFromFd2(int fd); -+extern int drmGetNodeTypeFromFd(int fd); -+ -+/* Convert between GEM handles and DMA-BUF file descriptors. -+ * -+ * Warning: since GEM handles are not reference-counted and are unique per -+ * DRM file description, the caller is expected to perform its own reference -+ * counting. drmPrimeFDToHandle is guaranteed to return the same handle for -+ * different FDs if they reference the same underlying buffer object. This -+ * could even be a buffer object originally created on the same DRM FD. -+ * -+ * When sharing a DRM FD with an API such as EGL or GBM, the caller must not -+ * use drmPrimeHandleToFD nor drmPrimeFDToHandle. A single user-space -+ * reference-counting implementation is necessary to avoid double-closing GEM -+ * handles. -+ * -+ * Two processes can't share the same DRM FD and both use it to create or -+ * import GEM handles, even when using a single user-space reference-counting -+ * implementation like GBM, because GBM doesn't share its state between -+ * processes. -+ */ -+extern int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags, int *prime_fd); -+extern int drmPrimeFDToHandle(int fd, int prime_fd, uint32_t *handle); -+ -+extern int drmCloseBufferHandle(int fd, uint32_t handle); -+ -+extern char *drmGetPrimaryDeviceNameFromFd(int fd); -+extern char *drmGetRenderDeviceNameFromFd(int fd); -+ -+#define DRM_BUS_PCI 0 -+#define DRM_BUS_USB 1 -+#define DRM_BUS_PLATFORM 2 -+#define DRM_BUS_HOST1X 3 -+ -+typedef struct _drmPciBusInfo { -+ uint16_t domain; -+ uint8_t bus; -+ uint8_t dev; -+ uint8_t func; -+} drmPciBusInfo, *drmPciBusInfoPtr; -+ -+typedef struct _drmPciDeviceInfo { -+ uint16_t vendor_id; -+ uint16_t device_id; -+ uint16_t subvendor_id; -+ uint16_t subdevice_id; -+ uint8_t revision_id; -+} drmPciDeviceInfo, *drmPciDeviceInfoPtr; -+ -+typedef struct _drmUsbBusInfo { -+ uint8_t bus; -+ uint8_t dev; -+} drmUsbBusInfo, *drmUsbBusInfoPtr; -+ -+typedef struct _drmUsbDeviceInfo { -+ uint16_t vendor; -+ uint16_t product; -+} drmUsbDeviceInfo, *drmUsbDeviceInfoPtr; -+ -+#define DRM_PLATFORM_DEVICE_NAME_LEN 512 -+ -+typedef struct _drmPlatformBusInfo { -+ char fullname[DRM_PLATFORM_DEVICE_NAME_LEN]; -+} drmPlatformBusInfo, *drmPlatformBusInfoPtr; -+ -+typedef struct _drmPlatformDeviceInfo { -+ char **compatible; /* NULL terminated list of compatible strings */ -+} drmPlatformDeviceInfo, *drmPlatformDeviceInfoPtr; -+ -+#define DRM_HOST1X_DEVICE_NAME_LEN 512 -+ -+typedef struct _drmHost1xBusInfo { -+ char fullname[DRM_HOST1X_DEVICE_NAME_LEN]; -+} drmHost1xBusInfo, *drmHost1xBusInfoPtr; -+ -+typedef struct _drmHost1xDeviceInfo { -+ char **compatible; /* NULL terminated list of compatible strings */ -+} drmHost1xDeviceInfo, *drmHost1xDeviceInfoPtr; -+ -+typedef struct _drmDevice { -+ char **nodes; /* DRM_NODE_MAX sized array */ -+ int available_nodes; /* DRM_NODE_* bitmask */ -+ int bustype; -+ union { -+ drmPciBusInfoPtr pci; -+ drmUsbBusInfoPtr usb; -+ drmPlatformBusInfoPtr platform; -+ drmHost1xBusInfoPtr host1x; -+ } businfo; -+ union { -+ drmPciDeviceInfoPtr pci; -+ drmUsbDeviceInfoPtr usb; -+ drmPlatformDeviceInfoPtr platform; -+ drmHost1xDeviceInfoPtr host1x; -+ } deviceinfo; -+} drmDevice, *drmDevicePtr; -+ -+extern int drmGetDevice(int fd, drmDevicePtr *device); -+extern void drmFreeDevice(drmDevicePtr *device); -+ -+extern int drmGetDevices(drmDevicePtr devices[], int max_devices); -+extern void drmFreeDevices(drmDevicePtr devices[], int count); -+ -+#define DRM_DEVICE_GET_PCI_REVISION (1 << 0) -+extern int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr *device); -+extern int drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices); -+ -+extern int drmGetDeviceFromDevId(dev_t dev_id, uint32_t flags, drmDevicePtr *device); -+ -+extern int drmDevicesEqual(drmDevicePtr a, drmDevicePtr b); -+ -+extern int drmSyncobjCreate(int fd, uint32_t flags, uint32_t *handle); -+extern int drmSyncobjDestroy(int fd, uint32_t handle); -+extern int drmSyncobjHandleToFD(int fd, uint32_t handle, int *obj_fd); -+extern int drmSyncobjFDToHandle(int fd, int obj_fd, uint32_t *handle); -+ -+extern int drmSyncobjImportSyncFile(int fd, uint32_t handle, int sync_file_fd); -+extern int drmSyncobjExportSyncFile(int fd, uint32_t handle, int *sync_file_fd); -+extern int drmSyncobjWait(int fd, uint32_t *handles, unsigned num_handles, -+ int64_t timeout_nsec, unsigned flags, -+ uint32_t *first_signaled); -+extern int drmSyncobjReset(int fd, const uint32_t *handles, uint32_t handle_count); -+extern int drmSyncobjSignal(int fd, const uint32_t *handles, uint32_t handle_count); -+extern int drmSyncobjTimelineSignal(int fd, const uint32_t *handles, -+ uint64_t *points, uint32_t handle_count); -+extern int drmSyncobjTimelineWait(int fd, uint32_t *handles, uint64_t *points, -+ unsigned num_handles, -+ int64_t timeout_nsec, unsigned flags, -+ uint32_t *first_signaled); -+extern int drmSyncobjQuery(int fd, uint32_t *handles, uint64_t *points, -+ uint32_t handle_count); -+extern int drmSyncobjQuery2(int fd, uint32_t *handles, uint64_t *points, -+ uint32_t handle_count, uint32_t flags); -+extern int drmSyncobjTransfer(int fd, -+ uint32_t dst_handle, uint64_t dst_point, -+ uint32_t src_handle, uint64_t src_point, -+ uint32_t flags); -+ -+extern char * -+drmGetFormatModifierVendor(uint64_t modifier); -+ -+extern char * -+drmGetFormatModifierName(uint64_t modifier); -+ -+#ifndef fourcc_mod_get_vendor -+#define fourcc_mod_get_vendor(modifier) \ -+ (((modifier) >> 56) & 0xff) -+#endif -+ -+#if defined(__cplusplus) -+} -+#endif -+ -+#endif -diff -up firefox-109.0/third_party/drm/libdrm/moz.build.libwebrtc-screen-cast-sync firefox-109.0/third_party/drm/libdrm/moz.build ---- firefox-109.0/third_party/drm/libdrm/moz.build.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.194614122 +0100 -+++ firefox-109.0/third_party/drm/libdrm/moz.build 2023-01-12 15:16:09.194614122 +0100 -@@ -0,0 +1,16 @@ -+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -+# vim: set filetype=python: -+# This Source Code Form is subject to the terms of the Mozilla Public -+# License, v. 2.0. If a copy of the MPL was not distributed with this -+# file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ -+SOURCES += [ -+ 'mozdrm.cpp', -+] -+ -+if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": -+ CXXFLAGS += CONFIG['MOZ_GTK3_CFLAGS'] -+ -+LOCAL_INCLUDES += ['/third_party/drm'] -+ -+FINAL_LIBRARY = 'xul' -diff -up firefox-109.0/third_party/drm/libdrm/mozdrm.cpp.libwebrtc-screen-cast-sync firefox-109.0/third_party/drm/libdrm/mozdrm.cpp ---- firefox-109.0/third_party/drm/libdrm/mozdrm.cpp.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.194614122 +0100 -+++ firefox-109.0/third_party/drm/libdrm/mozdrm.cpp 2023-01-12 15:16:09.194614122 +0100 -@@ -0,0 +1,66 @@ -+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -+/* vim:expandtab:shiftwidth=4:tabstop=4: -+ */ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+#include "mozilla/Types.h" -+#include "prlink.h" -+ -+#include -+ -+#define GET_FUNC(func, lib) \ -+ func##_fn = \ -+ (decltype(func##_fn))PR_FindFunctionSymbol(lib, #func) \ -+ -+#define IS_FUNC_LOADED(func) \ -+ (func != nullptr) \ -+ -+static int (*drmGetDevices2_fn)(uint32_t flags, drmDevicePtr devices[], int max_devices); -+static void (*drmFreeDevices_fn)(drmDevicePtr devices[], int count); -+ -+bool IsDRMLibraryLoaded() { -+ static bool isLoaded = -+ (IS_FUNC_LOADED(drmGetDevices2_fn) && -+ IS_FUNC_LOADED(drmFreeDevices_fn)); -+ -+ return isLoaded; -+} -+ -+bool LoadDRMLibrary() { -+ static PRLibrary* drmLib = nullptr; -+ static bool drmInitialized = false; -+ -+ //TODO Thread safe -+ if (!drmInitialized) { -+ drmInitialized = true; -+ drmLib = PR_LoadLibrary("libdrm.so.2"); -+ if (!drmLib) { -+ return false; -+ } -+ -+ GET_FUNC(drmGetDevices2, drmLib); -+ GET_FUNC(drmFreeDevices, drmLib); -+ } -+ -+ return IsDRMLibraryLoaded(); -+} -+ -+int -+drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices) -+{ -+ if (!LoadDRMLibrary()) { -+ return 0; -+ } -+ return drmGetDevices2_fn(flags, devices, max_devices); -+} -+ -+void -+drmFreeDevices(drmDevicePtr devices[], int count) -+{ -+ if (!LoadDRMLibrary()) { -+ return; -+ } -+ return drmFreeDevices_fn(devices, count); -+} -diff -up firefox-109.0/third_party/drm/README.libwebrtc-screen-cast-sync firefox-109.0/third_party/drm/README ---- firefox-109.0/third_party/drm/README.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.194614122 +0100 -+++ firefox-109.0/third_party/drm/README 2023-01-12 15:16:09.194614122 +0100 -@@ -0,0 +1,4 @@ -+Libdrm is a drm library wrapper needed to build and run Firefox with -+Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/drm). -+ -+libdrm directory stores headers of libdrm needed for build only. -diff -up firefox-109.0/third_party/gbm/gbm/gbm.h.libwebrtc-screen-cast-sync firefox-109.0/third_party/gbm/gbm/gbm.h ---- firefox-109.0/third_party/gbm/gbm/gbm.h.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.195614155 +0100 -+++ firefox-109.0/third_party/gbm/gbm/gbm.h 2023-01-12 15:16:09.195614155 +0100 -@@ -0,0 +1,452 @@ -+/* -+ * Copyright © 2011 Intel Corporation -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -+ * DEALINGS IN THE SOFTWARE. -+ * -+ * Authors: -+ * Benjamin Franzke -+ */ -+ -+#ifndef _GBM_H_ -+#define _GBM_H_ -+ -+#define __GBM__ 1 -+ -+#include -+#include -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ -+/** -+ * \file gbm.h -+ * \brief Generic Buffer Manager -+ */ -+ -+struct gbm_device; -+struct gbm_bo; -+struct gbm_surface; -+ -+/** -+ * \mainpage The Generic Buffer Manager -+ * -+ * This module provides an abstraction that the caller can use to request a -+ * buffer from the underlying memory management system for the platform. -+ * -+ * This allows the creation of portable code whilst still allowing access to -+ * the underlying memory manager. -+ */ -+ -+/** -+ * Abstraction representing the handle to a buffer allocated by the -+ * manager -+ */ -+union gbm_bo_handle { -+ void *ptr; -+ int32_t s32; -+ uint32_t u32; -+ int64_t s64; -+ uint64_t u64; -+}; -+ -+/** Format of the allocated buffer */ -+enum gbm_bo_format { -+ /** RGB with 8 bits per channel in a 32 bit value */ -+ GBM_BO_FORMAT_XRGB8888, -+ /** ARGB with 8 bits per channel in a 32 bit value */ -+ GBM_BO_FORMAT_ARGB8888 -+}; -+ -+ -+/** -+ * The FourCC format codes are taken from the drm_fourcc.h definition, and -+ * re-namespaced. New GBM formats must not be added, unless they are -+ * identical ports from drm_fourcc. -+ */ -+#define __gbm_fourcc_code(a,b,c,d) ((uint32_t)(a) | ((uint32_t)(b) << 8) | \ -+ ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24)) -+ -+#define GBM_FORMAT_BIG_ENDIAN (1<<31) /* format is big endian instead of little endian */ -+ -+/* color index */ -+#define GBM_FORMAT_C8 __gbm_fourcc_code('C', '8', ' ', ' ') /* [7:0] C */ -+ -+/* 8 bpp Red */ -+#define GBM_FORMAT_R8 __gbm_fourcc_code('R', '8', ' ', ' ') /* [7:0] R */ -+ -+/* 16 bpp Red */ -+#define GBM_FORMAT_R16 __gbm_fourcc_code('R', '1', '6', ' ') /* [15:0] R little endian */ -+ -+/* 16 bpp RG */ -+#define GBM_FORMAT_GR88 __gbm_fourcc_code('G', 'R', '8', '8') /* [15:0] G:R 8:8 little endian */ -+ -+/* 8 bpp RGB */ -+#define GBM_FORMAT_RGB332 __gbm_fourcc_code('R', 'G', 'B', '8') /* [7:0] R:G:B 3:3:2 */ -+#define GBM_FORMAT_BGR233 __gbm_fourcc_code('B', 'G', 'R', '8') /* [7:0] B:G:R 2:3:3 */ -+ -+/* 16 bpp RGB */ -+#define GBM_FORMAT_XRGB4444 __gbm_fourcc_code('X', 'R', '1', '2') /* [15:0] x:R:G:B 4:4:4:4 little endian */ -+#define GBM_FORMAT_XBGR4444 __gbm_fourcc_code('X', 'B', '1', '2') /* [15:0] x:B:G:R 4:4:4:4 little endian */ -+#define GBM_FORMAT_RGBX4444 __gbm_fourcc_code('R', 'X', '1', '2') /* [15:0] R:G:B:x 4:4:4:4 little endian */ -+#define GBM_FORMAT_BGRX4444 __gbm_fourcc_code('B', 'X', '1', '2') /* [15:0] B:G:R:x 4:4:4:4 little endian */ -+ -+#define GBM_FORMAT_ARGB4444 __gbm_fourcc_code('A', 'R', '1', '2') /* [15:0] A:R:G:B 4:4:4:4 little endian */ -+#define GBM_FORMAT_ABGR4444 __gbm_fourcc_code('A', 'B', '1', '2') /* [15:0] A:B:G:R 4:4:4:4 little endian */ -+#define GBM_FORMAT_RGBA4444 __gbm_fourcc_code('R', 'A', '1', '2') /* [15:0] R:G:B:A 4:4:4:4 little endian */ -+#define GBM_FORMAT_BGRA4444 __gbm_fourcc_code('B', 'A', '1', '2') /* [15:0] B:G:R:A 4:4:4:4 little endian */ -+ -+#define GBM_FORMAT_XRGB1555 __gbm_fourcc_code('X', 'R', '1', '5') /* [15:0] x:R:G:B 1:5:5:5 little endian */ -+#define GBM_FORMAT_XBGR1555 __gbm_fourcc_code('X', 'B', '1', '5') /* [15:0] x:B:G:R 1:5:5:5 little endian */ -+#define GBM_FORMAT_RGBX5551 __gbm_fourcc_code('R', 'X', '1', '5') /* [15:0] R:G:B:x 5:5:5:1 little endian */ -+#define GBM_FORMAT_BGRX5551 __gbm_fourcc_code('B', 'X', '1', '5') /* [15:0] B:G:R:x 5:5:5:1 little endian */ -+ -+#define GBM_FORMAT_ARGB1555 __gbm_fourcc_code('A', 'R', '1', '5') /* [15:0] A:R:G:B 1:5:5:5 little endian */ -+#define GBM_FORMAT_ABGR1555 __gbm_fourcc_code('A', 'B', '1', '5') /* [15:0] A:B:G:R 1:5:5:5 little endian */ -+#define GBM_FORMAT_RGBA5551 __gbm_fourcc_code('R', 'A', '1', '5') /* [15:0] R:G:B:A 5:5:5:1 little endian */ -+#define GBM_FORMAT_BGRA5551 __gbm_fourcc_code('B', 'A', '1', '5') /* [15:0] B:G:R:A 5:5:5:1 little endian */ -+ -+#define GBM_FORMAT_RGB565 __gbm_fourcc_code('R', 'G', '1', '6') /* [15:0] R:G:B 5:6:5 little endian */ -+#define GBM_FORMAT_BGR565 __gbm_fourcc_code('B', 'G', '1', '6') /* [15:0] B:G:R 5:6:5 little endian */ -+ -+/* 24 bpp RGB */ -+#define GBM_FORMAT_RGB888 __gbm_fourcc_code('R', 'G', '2', '4') /* [23:0] R:G:B little endian */ -+#define GBM_FORMAT_BGR888 __gbm_fourcc_code('B', 'G', '2', '4') /* [23:0] B:G:R little endian */ -+ -+/* 32 bpp RGB */ -+#define GBM_FORMAT_XRGB8888 __gbm_fourcc_code('X', 'R', '2', '4') /* [31:0] x:R:G:B 8:8:8:8 little endian */ -+#define GBM_FORMAT_XBGR8888 __gbm_fourcc_code('X', 'B', '2', '4') /* [31:0] x:B:G:R 8:8:8:8 little endian */ -+#define GBM_FORMAT_RGBX8888 __gbm_fourcc_code('R', 'X', '2', '4') /* [31:0] R:G:B:x 8:8:8:8 little endian */ -+#define GBM_FORMAT_BGRX8888 __gbm_fourcc_code('B', 'X', '2', '4') /* [31:0] B:G:R:x 8:8:8:8 little endian */ -+ -+#define GBM_FORMAT_ARGB8888 __gbm_fourcc_code('A', 'R', '2', '4') /* [31:0] A:R:G:B 8:8:8:8 little endian */ -+#define GBM_FORMAT_ABGR8888 __gbm_fourcc_code('A', 'B', '2', '4') /* [31:0] A:B:G:R 8:8:8:8 little endian */ -+#define GBM_FORMAT_RGBA8888 __gbm_fourcc_code('R', 'A', '2', '4') /* [31:0] R:G:B:A 8:8:8:8 little endian */ -+#define GBM_FORMAT_BGRA8888 __gbm_fourcc_code('B', 'A', '2', '4') /* [31:0] B:G:R:A 8:8:8:8 little endian */ -+ -+#define GBM_FORMAT_XRGB2101010 __gbm_fourcc_code('X', 'R', '3', '0') /* [31:0] x:R:G:B 2:10:10:10 little endian */ -+#define GBM_FORMAT_XBGR2101010 __gbm_fourcc_code('X', 'B', '3', '0') /* [31:0] x:B:G:R 2:10:10:10 little endian */ -+#define GBM_FORMAT_RGBX1010102 __gbm_fourcc_code('R', 'X', '3', '0') /* [31:0] R:G:B:x 10:10:10:2 little endian */ -+#define GBM_FORMAT_BGRX1010102 __gbm_fourcc_code('B', 'X', '3', '0') /* [31:0] B:G:R:x 10:10:10:2 little endian */ -+ -+#define GBM_FORMAT_ARGB2101010 __gbm_fourcc_code('A', 'R', '3', '0') /* [31:0] A:R:G:B 2:10:10:10 little endian */ -+#define GBM_FORMAT_ABGR2101010 __gbm_fourcc_code('A', 'B', '3', '0') /* [31:0] A:B:G:R 2:10:10:10 little endian */ -+#define GBM_FORMAT_RGBA1010102 __gbm_fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */ -+#define GBM_FORMAT_BGRA1010102 __gbm_fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */ -+ -+/* -+ * Floating point 64bpp RGB -+ * IEEE 754-2008 binary16 half-precision float -+ * [15:0] sign:exponent:mantissa 1:5:10 -+ */ -+#define GBM_FORMAT_XBGR16161616F __gbm_fourcc_code('X', 'B', '4', 'H') /* [63:0] x:B:G:R 16:16:16:16 little endian */ -+ -+#define GBM_FORMAT_ABGR16161616F __gbm_fourcc_code('A', 'B', '4', 'H') /* [63:0] A:B:G:R 16:16:16:16 little endian */ -+ -+/* packed YCbCr */ -+#define GBM_FORMAT_YUYV __gbm_fourcc_code('Y', 'U', 'Y', 'V') /* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */ -+#define GBM_FORMAT_YVYU __gbm_fourcc_code('Y', 'V', 'Y', 'U') /* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */ -+#define GBM_FORMAT_UYVY __gbm_fourcc_code('U', 'Y', 'V', 'Y') /* [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian */ -+#define GBM_FORMAT_VYUY __gbm_fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */ -+ -+#define GBM_FORMAT_AYUV __gbm_fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */ -+ -+/* -+ * 2 plane YCbCr -+ * index 0 = Y plane, [7:0] Y -+ * index 1 = Cr:Cb plane, [15:0] Cr:Cb little endian -+ * or -+ * index 1 = Cb:Cr plane, [15:0] Cb:Cr little endian -+ */ -+#define GBM_FORMAT_NV12 __gbm_fourcc_code('N', 'V', '1', '2') /* 2x2 subsampled Cr:Cb plane */ -+#define GBM_FORMAT_NV21 __gbm_fourcc_code('N', 'V', '2', '1') /* 2x2 subsampled Cb:Cr plane */ -+#define GBM_FORMAT_NV16 __gbm_fourcc_code('N', 'V', '1', '6') /* 2x1 subsampled Cr:Cb plane */ -+#define GBM_FORMAT_NV61 __gbm_fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */ -+ -+/* -+ * 3 plane YCbCr -+ * index 0: Y plane, [7:0] Y -+ * index 1: Cb plane, [7:0] Cb -+ * index 2: Cr plane, [7:0] Cr -+ * or -+ * index 1: Cr plane, [7:0] Cr -+ * index 2: Cb plane, [7:0] Cb -+ */ -+#define GBM_FORMAT_YUV410 __gbm_fourcc_code('Y', 'U', 'V', '9') /* 4x4 subsampled Cb (1) and Cr (2) planes */ -+#define GBM_FORMAT_YVU410 __gbm_fourcc_code('Y', 'V', 'U', '9') /* 4x4 subsampled Cr (1) and Cb (2) planes */ -+#define GBM_FORMAT_YUV411 __gbm_fourcc_code('Y', 'U', '1', '1') /* 4x1 subsampled Cb (1) and Cr (2) planes */ -+#define GBM_FORMAT_YVU411 __gbm_fourcc_code('Y', 'V', '1', '1') /* 4x1 subsampled Cr (1) and Cb (2) planes */ -+#define GBM_FORMAT_YUV420 __gbm_fourcc_code('Y', 'U', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes */ -+#define GBM_FORMAT_YVU420 __gbm_fourcc_code('Y', 'V', '1', '2') /* 2x2 subsampled Cr (1) and Cb (2) planes */ -+#define GBM_FORMAT_YUV422 __gbm_fourcc_code('Y', 'U', '1', '6') /* 2x1 subsampled Cb (1) and Cr (2) planes */ -+#define GBM_FORMAT_YVU422 __gbm_fourcc_code('Y', 'V', '1', '6') /* 2x1 subsampled Cr (1) and Cb (2) planes */ -+#define GBM_FORMAT_YUV444 __gbm_fourcc_code('Y', 'U', '2', '4') /* non-subsampled Cb (1) and Cr (2) planes */ -+#define GBM_FORMAT_YVU444 __gbm_fourcc_code('Y', 'V', '2', '4') /* non-subsampled Cr (1) and Cb (2) planes */ -+ -+struct gbm_format_name_desc { -+ char name[5]; -+}; -+ -+/** -+ * Flags to indicate the intended use for the buffer - these are passed into -+ * gbm_bo_create(). The caller must set the union of all the flags that are -+ * appropriate -+ * -+ * \sa Use gbm_device_is_format_supported() to check if the combination of format -+ * and use flags are supported -+ */ -+enum gbm_bo_flags { -+ /** -+ * Buffer is going to be presented to the screen using an API such as KMS -+ */ -+ GBM_BO_USE_SCANOUT = (1 << 0), -+ /** -+ * Buffer is going to be used as cursor -+ */ -+ GBM_BO_USE_CURSOR = (1 << 1), -+ /** -+ * Deprecated -+ */ -+ GBM_BO_USE_CURSOR_64X64 = GBM_BO_USE_CURSOR, -+ /** -+ * Buffer is to be used for rendering - for example it is going to be used -+ * as the storage for a color buffer -+ */ -+ GBM_BO_USE_RENDERING = (1 << 2), -+ /** -+ * Buffer can be used for gbm_bo_write. This is guaranteed to work -+ * with GBM_BO_USE_CURSOR, but may not work for other combinations. -+ */ -+ GBM_BO_USE_WRITE = (1 << 3), -+ /** -+ * Buffer is linear, i.e. not tiled. -+ */ -+ GBM_BO_USE_LINEAR = (1 << 4), -+ /** -+ * Buffer is protected, i.e. encrypted and not readable by CPU or any -+ * other non-secure / non-trusted components nor by non-trusted OpenGL, -+ * OpenCL, and Vulkan applications. -+ */ -+ GBM_BO_USE_PROTECTED = (1 << 5), -+}; -+ -+int -+gbm_device_get_fd(struct gbm_device *gbm); -+ -+const char * -+gbm_device_get_backend_name(struct gbm_device *gbm); -+ -+int -+gbm_device_is_format_supported(struct gbm_device *gbm, -+ uint32_t format, uint32_t flags); -+ -+int -+gbm_device_get_format_modifier_plane_count(struct gbm_device *gbm, -+ uint32_t format, -+ uint64_t modifier); -+ -+void -+gbm_device_destroy(struct gbm_device *gbm); -+ -+struct gbm_device * -+gbm_create_device(int fd); -+ -+struct gbm_bo * -+gbm_bo_create(struct gbm_device *gbm, -+ uint32_t width, uint32_t height, -+ uint32_t format, uint32_t flags); -+ -+struct gbm_bo * -+gbm_bo_create_with_modifiers(struct gbm_device *gbm, -+ uint32_t width, uint32_t height, -+ uint32_t format, -+ const uint64_t *modifiers, -+ const unsigned int count); -+ -+struct gbm_bo * -+gbm_bo_create_with_modifiers2(struct gbm_device *gbm, -+ uint32_t width, uint32_t height, -+ uint32_t format, -+ const uint64_t *modifiers, -+ const unsigned int count, -+ uint32_t flags); -+ -+#define GBM_BO_IMPORT_WL_BUFFER 0x5501 -+#define GBM_BO_IMPORT_EGL_IMAGE 0x5502 -+#define GBM_BO_IMPORT_FD 0x5503 -+#define GBM_BO_IMPORT_FD_MODIFIER 0x5504 -+ -+struct gbm_import_fd_data { -+ int fd; -+ uint32_t width; -+ uint32_t height; -+ uint32_t stride; -+ uint32_t format; -+}; -+ -+#define GBM_MAX_PLANES 4 -+ -+struct gbm_import_fd_modifier_data { -+ uint32_t width; -+ uint32_t height; -+ uint32_t format; -+ uint32_t num_fds; -+ int fds[GBM_MAX_PLANES]; -+ int strides[GBM_MAX_PLANES]; -+ int offsets[GBM_MAX_PLANES]; -+ uint64_t modifier; -+}; -+ -+struct gbm_bo * -+gbm_bo_import(struct gbm_device *gbm, uint32_t type, -+ void *buffer, uint32_t flags); -+ -+/** -+ * Flags to indicate the type of mapping for the buffer - these are -+ * passed into gbm_bo_map(). The caller must set the union of all the -+ * flags that are appropriate. -+ * -+ * These flags are independent of the GBM_BO_USE_* creation flags. However, -+ * mapping the buffer may require copying to/from a staging buffer. -+ * -+ * See also: pipe_map_flags -+ */ -+enum gbm_bo_transfer_flags { -+ /** -+ * Buffer contents read back (or accessed directly) at transfer -+ * create time. -+ */ -+ GBM_BO_TRANSFER_READ = (1 << 0), -+ /** -+ * Buffer contents will be written back at unmap time -+ * (or modified as a result of being accessed directly). -+ */ -+ GBM_BO_TRANSFER_WRITE = (1 << 1), -+ /** -+ * Read/modify/write -+ */ -+ GBM_BO_TRANSFER_READ_WRITE = (GBM_BO_TRANSFER_READ | GBM_BO_TRANSFER_WRITE), -+}; -+ -+void * -+gbm_bo_map(struct gbm_bo *bo, -+ uint32_t x, uint32_t y, uint32_t width, uint32_t height, -+ uint32_t flags, uint32_t *stride, void **map_data); -+ -+void -+gbm_bo_unmap(struct gbm_bo *bo, void *map_data); -+ -+uint32_t -+gbm_bo_get_width(struct gbm_bo *bo); -+ -+uint32_t -+gbm_bo_get_height(struct gbm_bo *bo); -+ -+uint32_t -+gbm_bo_get_stride(struct gbm_bo *bo); -+ -+uint32_t -+gbm_bo_get_stride_for_plane(struct gbm_bo *bo, int plane); -+ -+uint32_t -+gbm_bo_get_format(struct gbm_bo *bo); -+ -+uint32_t -+gbm_bo_get_bpp(struct gbm_bo *bo); -+ -+uint32_t -+gbm_bo_get_offset(struct gbm_bo *bo, int plane); -+ -+struct gbm_device * -+gbm_bo_get_device(struct gbm_bo *bo); -+ -+union gbm_bo_handle -+gbm_bo_get_handle(struct gbm_bo *bo); -+ -+int -+gbm_bo_get_fd(struct gbm_bo *bo); -+ -+uint64_t -+gbm_bo_get_modifier(struct gbm_bo *bo); -+ -+int -+gbm_bo_get_plane_count(struct gbm_bo *bo); -+ -+union gbm_bo_handle -+gbm_bo_get_handle_for_plane(struct gbm_bo *bo, int plane); -+ -+int -+gbm_bo_get_fd_for_plane(struct gbm_bo *bo, int plane); -+ -+int -+gbm_bo_write(struct gbm_bo *bo, const void *buf, size_t count); -+ -+void -+gbm_bo_set_user_data(struct gbm_bo *bo, void *data, -+ void (*destroy_user_data)(struct gbm_bo *, void *)); -+ -+void * -+gbm_bo_get_user_data(struct gbm_bo *bo); -+ -+void -+gbm_bo_destroy(struct gbm_bo *bo); -+ -+struct gbm_surface * -+gbm_surface_create(struct gbm_device *gbm, -+ uint32_t width, uint32_t height, -+ uint32_t format, uint32_t flags); -+ -+struct gbm_surface * -+gbm_surface_create_with_modifiers(struct gbm_device *gbm, -+ uint32_t width, uint32_t height, -+ uint32_t format, -+ const uint64_t *modifiers, -+ const unsigned int count); -+ -+struct gbm_surface * -+gbm_surface_create_with_modifiers2(struct gbm_device *gbm, -+ uint32_t width, uint32_t height, -+ uint32_t format, -+ const uint64_t *modifiers, -+ const unsigned int count, -+ uint32_t flags); -+ -+struct gbm_bo * -+gbm_surface_lock_front_buffer(struct gbm_surface *surface); -+ -+void -+gbm_surface_release_buffer(struct gbm_surface *surface, struct gbm_bo *bo); -+ -+int -+gbm_surface_has_free_buffers(struct gbm_surface *surface); -+ -+void -+gbm_surface_destroy(struct gbm_surface *surface); -+ -+char * -+gbm_format_get_name(uint32_t gbm_format, struct gbm_format_name_desc *desc); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif -diff -up firefox-109.0/third_party/gbm/libgbm/moz.build.libwebrtc-screen-cast-sync firefox-109.0/third_party/gbm/libgbm/moz.build ---- firefox-109.0/third_party/gbm/libgbm/moz.build.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.195614155 +0100 -+++ firefox-109.0/third_party/gbm/libgbm/moz.build 2023-01-12 15:16:09.195614155 +0100 -@@ -0,0 +1,16 @@ -+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -+# vim: set filetype=python: -+# This Source Code Form is subject to the terms of the Mozilla Public -+# License, v. 2.0. If a copy of the MPL was not distributed with this -+# file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ -+SOURCES += [ -+ 'mozgbm.cpp', -+] -+ -+if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": -+ CXXFLAGS += CONFIG['MOZ_GTK3_CFLAGS'] -+ -+LOCAL_INCLUDES += ['/third_party/gbm'] -+ -+FINAL_LIBRARY = 'xul' -diff -up firefox-109.0/third_party/gbm/libgbm/mozgbm.cpp.libwebrtc-screen-cast-sync firefox-109.0/third_party/gbm/libgbm/mozgbm.cpp ---- firefox-109.0/third_party/gbm/libgbm/mozgbm.cpp.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.195614155 +0100 -+++ firefox-109.0/third_party/gbm/libgbm/mozgbm.cpp 2023-01-12 15:16:09.195614155 +0100 -@@ -0,0 +1,66 @@ -+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -+/* vim:expandtab:shiftwidth=4:tabstop=4: -+ */ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+#include "mozilla/Types.h" -+#include "prlink.h" -+ -+#include -+ -+#define GET_FUNC(func, lib) \ -+ func##_fn = \ -+ (decltype(func##_fn))PR_FindFunctionSymbol(lib, #func) \ -+ -+#define IS_FUNC_LOADED(func) \ -+ (func != nullptr) \ -+ -+static struct gbm_device * (*gbm_create_device_fn)(int fd); -+static void (*gbm_device_destroy_fn)(struct gbm_device* gbm); -+ -+bool IsGBMLibraryLoaded() { -+ static bool isLoaded = -+ (IS_FUNC_LOADED(gbm_create_device_fn) && -+ IS_FUNC_LOADED(gbm_device_destroy_fn)); -+ -+ return isLoaded; -+} -+ -+bool LoadGBMLibrary() { -+ static PRLibrary* gbmLib = nullptr; -+ static bool gbmInitialized = false; -+ -+ //TODO Thread safe -+ if (!gbmInitialized) { -+ gbmInitialized = true; -+ gbmLib = PR_LoadLibrary("libgbm.so.1"); -+ if (!gbmLib) { -+ return false; -+ } -+ -+ GET_FUNC(gbm_create_device, gbmLib); -+ GET_FUNC(gbm_device_destroy, gbmLib); -+ } -+ -+ return IsGBMLibraryLoaded(); -+} -+ -+struct gbm_device * -+gbm_create_device(int fd) -+{ -+ if (!LoadGBMLibrary()) { -+ return nullptr; -+ } -+ return gbm_create_device_fn(fd); -+} -+ -+void -+gbm_device_destroy(struct gbm_device* gbm) -+{ -+ if (!LoadGBMLibrary()) { -+ return; -+ } -+ return gbm_device_destroy_fn(gbm); -+} -diff -up firefox-109.0/third_party/gbm/README.libwebrtc-screen-cast-sync firefox-109.0/third_party/gbm/README ---- firefox-109.0/third_party/gbm/README.libwebrtc-screen-cast-sync 2023-01-12 15:16:09.195614155 +0100 -+++ firefox-109.0/third_party/gbm/README 2023-01-12 15:16:09.195614155 +0100 -@@ -0,0 +1,4 @@ -+Libgbm is a gbm library wrapper needed to build and run Firefox with -+Pipewire support on Linux (https://gitlab.freedesktop.org/mesa/gbm). -+ -+libgbm directory stores headers of libgbm needed for build only. -diff -up firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn/moz.build.libwebrtc-screen-cast-sync firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn/moz.build ---- firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn/moz.build.libwebrtc-screen-cast-sync 2023-01-09 20:34:19.000000000 +0100 -+++ firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn/moz.build 2023-01-13 10:53:01.407572566 +0100 -@@ -8,7 +8,8 @@ - if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": - CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"] - --COMPILE_FLAGS["OS_INCLUDES"] = [] -+# FIXME: No idea why it doesn't pick libdrm from /third_party/drm -+COMPILE_FLAGS["OS_INCLUDES"] = [ "-I/usr/include/libdrm" ] - AllowCompilerWarnings() - - DEFINES["ABSL_ALLOCATOR_NOTHROW"] = "1" -@@ -27,6 +28,8 @@ LOCAL_INCLUDES += [ - "/ipc/chromium/src", - "/media/libyuv/", - "/media/libyuv/libyuv/include/", -+ "/third_party/drm/", -+ "/third_party/gbm/", - "/third_party/libwebrtc/", - "/third_party/libwebrtc/third_party/abseil-cpp/", - "/third_party/pipewire/", -@@ -242,7 +245,16 @@ if CONFIG["CPU_ARCH"] == "arm": - DEFINES["_GNU_SOURCE"] = True - - SOURCES += [ -- "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/moz_base_capturer_pipewire.cc" -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/restore_token_manager.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/scoped_glib.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/xdg_desktop_portal_utils.cc" - ] - - if CONFIG["CPU_ARCH"] == "ppc64": -@@ -297,7 +309,15 @@ if CONFIG["CPU_ARCH"] == "aarch64" and C - DEFINES["_GNU_SOURCE"] = True - - SOURCES += [ -- "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/moz_base_capturer_pipewire.cc" -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/restore_token_manager.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/xdg_desktop_portal_utils.cc" - ] - - if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux": -@@ -307,7 +327,16 @@ if CONFIG["CPU_ARCH"] == "x86" and CONFI - DEFINES["_GNU_SOURCE"] = True - - SOURCES += [ -- "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/moz_base_capturer_pipewire.cc" -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/restore_token_manager.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/scoped_glib.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/xdg_desktop_portal_utils.cc" - ] - - if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "Linux": -@@ -317,7 +346,16 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CO - DEFINES["_GNU_SOURCE"] = True - - SOURCES += [ -- "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/moz_base_capturer_pipewire.cc" -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/restore_token_manager.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/scoped_glib.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_portal.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc", -+ "/third_party/libwebrtc/modules/desktop_capture/linux/wayland/xdg_desktop_portal_utils.cc" - ] - - if CONFIG["CPU_ARCH"] == "aarch64" and CONFIG["MOZ_X11"] == "1" and CONFIG["OS_TARGET"] == "Linux": -diff -up firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc.libwebrtc-screen-cast-sync firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc ---- firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc.libwebrtc-screen-cast-sync 2023-01-09 20:34:20.000000000 +0100 -+++ firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc 2023-01-12 15:16:09.196614189 +0100 -@@ -17,7 +17,7 @@ - #elif defined(WEBRTC_WIN) - #include "modules/desktop_capture/win/full_screen_win_application_handler.h" - #endif --#if defined(WEBRTC_USE_PIPEWIRE) && !defined(WEBRTC_MOZILLA_BUILD) -+#if defined(WEBRTC_USE_PIPEWIRE) - #include "modules/desktop_capture/linux/wayland/shared_screencast_stream.h" - #endif - -@@ -41,7 +41,7 @@ DesktopCaptureOptions DesktopCaptureOpti - #if defined(WEBRTC_USE_X11) - result.set_x_display(SharedXDisplay::CreateDefault()); - #endif --#if defined(WEBRTC_USE_PIPEWIRE) && !defined(WEBRTC_MOZILLA_BUILD) -+#if defined(WEBRTC_USE_PIPEWIRE) - result.set_screencast_stream(SharedScreenCastStream::CreateDefault()); - #endif - #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) -diff -up firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h.libwebrtc-screen-cast-sync firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h ---- firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h.libwebrtc-screen-cast-sync 2023-01-09 20:34:21.000000000 +0100 -+++ firefox-109.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h 2023-01-13 10:00:35.449402964 +0100 -@@ -17,7 +17,7 @@ - #include "modules/desktop_capture/linux/x11/shared_x_display.h" - #endif - --#if defined(WEBRTC_USE_PIPEWIRE) && !defined(WEBRTC_MOZILLA_BUILD) -+#if defined(WEBRTC_USE_PIPEWIRE) - #include "modules/desktop_capture/linux/wayland/shared_screencast_stream.h" - #endif - -@@ -181,7 +181,6 @@ class RTC_EXPORT DesktopCaptureOptions { - bool allow_pipewire() const { return allow_pipewire_; } - void set_allow_pipewire(bool allow) { allow_pipewire_ = allow; } - --#if !defined(WEBRTC_MOZILLA_BUILD) - const rtc::scoped_refptr& screencast_stream() const { - return screencast_stream_; - } -@@ -196,13 +195,12 @@ class RTC_EXPORT DesktopCaptureOptions { - void set_height(uint32_t height) { height_ = height; } - uint32_t get_height() const { return height_; } - #endif --#endif - - private: - #if defined(WEBRTC_USE_X11) - rtc::scoped_refptr x_display_; - #endif --#if defined(WEBRTC_USE_PIPEWIRE) && !defined(WEBRTC_MOZILLA_BUILD) -+#if defined(WEBRTC_USE_PIPEWIRE) - // An instance of shared PipeWire ScreenCast stream we share between - // BaseCapturerPipeWire and MouseCursorMonitorPipeWire as cursor information - // is sent together with screen content. -diff -up firefox-109.0/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc.libwebrtc-screen-cast-sync firefox-109.0/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc ---- firefox-109.0/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc.libwebrtc-screen-cast-sync 2023-01-09 20:34:21.000000000 +0100 -+++ firefox-109.0/third_party/libwebrtc/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc 2023-01-12 15:16:09.196614189 +0100 -@@ -136,7 +136,7 @@ bool BaseCapturerPipeWire::GetSourceList - // is often treated as a null/placeholder id, so we shouldn't use that. - // TODO(https://crbug.com/1297671): Reconsider type of ID when plumbing - // token that will enable stream re-use. -- sources->push_back({source_id_}); -+ sources->push_back({PIPEWIRE_ID, 0, PIPEWIRE_NAME}); - return true; - } - -diff -up firefox-109.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc.libwebrtc-screen-cast-sync firefox-109.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc ---- firefox-109.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc.libwebrtc-screen-cast-sync 2023-01-09 20:34:20.000000000 +0100 -+++ firefox-109.0/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc 2023-01-12 15:16:09.196614189 +0100 -@@ -14,11 +14,7 @@ - #include "modules/desktop_capture/desktop_capturer.h" - - #if defined(WEBRTC_USE_PIPEWIRE) --#if defined(WEBRTC_MOZILLA_BUILD) --#include "modules/desktop_capture/linux/wayland/moz_base_capturer_pipewire.h" --#else - #include "modules/desktop_capture/linux/wayland/base_capturer_pipewire.h" --#endif - #endif // defined(WEBRTC_USE_PIPEWIRE) - - #if defined(WEBRTC_USE_X11) -@@ -32,11 +28,7 @@ std::unique_ptr Desktop - const DesktopCaptureOptions& options) { - #if defined(WEBRTC_USE_PIPEWIRE) - if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { --#if defined(WEBRTC_MOZILLA_BUILD) -- return BaseCapturerPipeWire::CreateRawCapturer(options); --#else - return std::make_unique(options); --#endif - } - #endif // defined(WEBRTC_USE_PIPEWIRE) - -diff -up firefox-109.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc.libwebrtc-screen-cast-sync firefox-109.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc ---- firefox-109.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc.libwebrtc-screen-cast-sync 2023-01-09 20:34:21.000000000 +0100 -+++ firefox-109.0/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc 2023-01-12 15:16:09.196614189 +0100 -@@ -14,11 +14,7 @@ - #include "modules/desktop_capture/desktop_capturer.h" - - #if defined(WEBRTC_USE_PIPEWIRE) --#if defined(WEBRTC_MOZILLA_BUILD) --#include "modules/desktop_capture/linux/wayland/moz_base_capturer_pipewire.h" --#else - #include "modules/desktop_capture/linux/wayland/base_capturer_pipewire.h" --#endif - #endif // defined(WEBRTC_USE_PIPEWIRE) - - #if defined(WEBRTC_USE_X11) -@@ -32,11 +28,7 @@ std::unique_ptr Desktop - const DesktopCaptureOptions& options) { - #if defined(WEBRTC_USE_PIPEWIRE) - if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { --#if defined(WEBRTC_MOZILLA_BUILD) -- return BaseCapturerPipeWire::CreateRawCapturer(options); --#else - return std::make_unique(options); --#endif - } - #endif // defined(WEBRTC_USE_PIPEWIRE) - -diff -up firefox-109.0/third_party/moz.build.libwebrtc-screen-cast-sync firefox-109.0/third_party/moz.build ---- firefox-109.0/third_party/moz.build.libwebrtc-screen-cast-sync 2023-01-09 20:34:21.000000000 +0100 -+++ firefox-109.0/third_party/moz.build 2023-01-12 15:16:09.197614223 +0100 -@@ -61,6 +61,12 @@ with Files("libwebrtc/**"): - with Files("pipewire/**"): - BUG_COMPONENT = ("Core", "WebRTC") - -+with Files("drm/**"): -+ BUG_COMPONENT = ("Core", "WebRTC") -+ -+with Files("gbm/**"): -+ BUG_COMPONENT = ("Core", "WebRTC") -+ - with Files('rlbox_wasm2c_sandbox/**'): - BUG_COMPONENT = ('Firefox Build System', 'General') - -diff -up firefox-109.0/third_party/pipewire/libpipewire/mozpipewire.cpp.libwebrtc-screen-cast-sync firefox-109.0/third_party/pipewire/libpipewire/mozpipewire.cpp ---- firefox-109.0/third_party/pipewire/libpipewire/mozpipewire.cpp.libwebrtc-screen-cast-sync 2023-01-09 20:34:21.000000000 +0100 -+++ firefox-109.0/third_party/pipewire/libpipewire/mozpipewire.cpp 2023-01-12 15:16:09.197614223 +0100 -@@ -69,11 +69,13 @@ static int (*pw_stream_connect_fn)(struc - enum pw_stream_flags flags, - const struct spa_pod **params, - uint32_t n_params); -+static int (*pw_stream_disconnect_fn)(struct pw_stream *stream); - static struct pw_buffer* (*pw_stream_dequeue_buffer_fn)(struct pw_stream *stream); - static void (*pw_stream_destroy_fn)(struct pw_stream *stream); - static struct pw_stream* (*pw_stream_new_fn)(struct pw_core *core, - const char *name, - struct pw_properties *props); -+ - static int (*pw_stream_queue_buffer_fn)(struct pw_stream *stream, - struct pw_buffer *buffer); - static int (*pw_stream_update_params_fn)(struct pw_stream *stream, -@@ -87,7 +89,10 @@ static int (*pw_thread_loop_start_fn)(st - static void (*pw_thread_loop_stop_fn)(struct pw_thread_loop *loop); - static void (*pw_thread_loop_lock_fn)(struct pw_thread_loop *loop); - static void (*pw_thread_loop_unlock_fn)(struct pw_thread_loop *loop); -+static void (*pw_thread_loop_wait_fn)(struct pw_thread_loop *loop); -+static void (*pw_thread_loop_signal_fn)(struct pw_thread_loop *loop, bool wait_for_accept); - static struct pw_properties* (*pw_properties_new_string_fn)(const char *str); -+static const char* (*pw_get_library_version_fn)(); - - bool IsPwLibraryLoaded() { - static bool isLoaded = -@@ -99,6 +104,7 @@ bool IsPwLibraryLoaded() { - IS_FUNC_LOADED(pw_init_fn) && - IS_FUNC_LOADED(pw_stream_add_listener_fn) && - IS_FUNC_LOADED(pw_stream_connect_fn) && -+ IS_FUNC_LOADED(pw_stream_disconnect_fn) && - IS_FUNC_LOADED(pw_stream_dequeue_buffer_fn) && - IS_FUNC_LOADED(pw_stream_destroy_fn) && - IS_FUNC_LOADED(pw_stream_new_fn) && -@@ -111,7 +117,10 @@ bool IsPwLibraryLoaded() { - IS_FUNC_LOADED(pw_thread_loop_stop_fn) && - IS_FUNC_LOADED(pw_thread_loop_lock_fn) && - IS_FUNC_LOADED(pw_thread_loop_unlock_fn) && -- IS_FUNC_LOADED(pw_properties_new_string_fn)); -+ IS_FUNC_LOADED(pw_thread_loop_signal_fn) && -+ IS_FUNC_LOADED(pw_thread_loop_wait_fn) && -+ IS_FUNC_LOADED(pw_properties_new_string_fn) && -+ IS_FUNC_LOADED(pw_get_library_version_fn)); - - return isLoaded; - } -@@ -136,6 +145,7 @@ bool LoadPWLibrary() { - GET_FUNC(pw_init, pwLib); - GET_FUNC(pw_stream_add_listener, pwLib); - GET_FUNC(pw_stream_connect, pwLib); -+ GET_FUNC(pw_stream_disconnect, pwLib); - GET_FUNC(pw_stream_dequeue_buffer, pwLib); - GET_FUNC(pw_stream_destroy, pwLib); - GET_FUNC(pw_stream_new, pwLib); -@@ -148,7 +158,10 @@ bool LoadPWLibrary() { - GET_FUNC(pw_thread_loop_stop, pwLib); - GET_FUNC(pw_thread_loop_lock, pwLib); - GET_FUNC(pw_thread_loop_unlock, pwLib); -+ GET_FUNC(pw_thread_loop_signal, pwLib); -+ GET_FUNC(pw_thread_loop_wait, pwLib); - GET_FUNC(pw_properties_new_string, pwLib); -+ GET_FUNC(pw_get_library_version, pwLib); - } - - return IsPwLibraryLoaded(); -@@ -242,6 +255,15 @@ pw_stream_connect(struct pw_stream *stre - params, n_params); - } - -+int -+pw_stream_disconnect(struct pw_stream *stream) -+{ -+ if (!LoadPWLibrary()) { -+ return 0; -+ } -+ return pw_stream_disconnect_fn(stream); -+} -+ - struct pw_buffer * - pw_stream_dequeue_buffer(struct pw_stream *stream) - { -@@ -356,6 +378,23 @@ pw_thread_loop_unlock(struct pw_thread_l - return pw_thread_loop_unlock_fn(loop); - } - -+void -+pw_thread_loop_signal(struct pw_thread_loop *loop, bool wait_for_accept) -+{ -+ if (!LoadPWLibrary()) { -+ return; -+ } -+ return pw_thread_loop_signal_fn(loop, wait_for_accept); -+} -+ -+void -+pw_thread_loop_wait(struct pw_thread_loop *loop) -+{ -+ if (!LoadPWLibrary()) { -+ return; -+ } -+ return pw_thread_loop_wait_fn(loop); -+} - - struct pw_properties * - pw_properties_new_string(const char *str) -@@ -366,3 +405,12 @@ pw_properties_new_string(const char *str - return pw_properties_new_string_fn(str); - } - -+const char* -+pw_get_library_version() -+{ -+ if (!LoadPWLibrary()) { -+ return nullptr; -+ } -+ return pw_get_library_version_fn(); -+} -+ diff --git a/mozilla-1170092.patch b/mozilla-1170092.patch deleted file mode 100644 index d130dff..0000000 --- a/mozilla-1170092.patch +++ /dev/null @@ -1,99 +0,0 @@ -diff -up firefox-87.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 firefox-87.0/extensions/pref/autoconfig/src/nsReadConfig.cpp ---- firefox-87.0/extensions/pref/autoconfig/src/nsReadConfig.cpp.1170092 2021-03-18 14:48:36.000000000 +0100 -+++ firefox-87.0/extensions/pref/autoconfig/src/nsReadConfig.cpp 2021-03-22 19:20:02.429310184 +0100 -@@ -249,8 +249,20 @@ nsresult nsReadConfig::openAndEvaluateJS - if (NS_FAILED(rv)) return rv; - - rv = NS_NewLocalFileInputStream(getter_AddRefs(inStr), jsFile); -- if (NS_FAILED(rv)) return rv; -+ if (NS_FAILED(rv)) { -+ // Look for cfg file in /etc//pref -+ rv = NS_GetSpecialDirectory(NS_APP_PREFS_SYSTEM_CONFIG_DIR, -+ getter_AddRefs(jsFile)); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ rv = jsFile->AppendNative(nsLiteralCString("pref")); -+ NS_ENSURE_SUCCESS(rv, rv); -+ rv = jsFile->AppendNative(nsDependentCString(aFileName)); -+ NS_ENSURE_SUCCESS(rv, rv); - -+ rv = NS_NewLocalFileInputStream(getter_AddRefs(inStr), jsFile); -+ NS_ENSURE_SUCCESS(rv, rv); -+ } - } else { - nsAutoCString location("resource://gre/defaults/autoconfig/"); - location += aFileName; -diff -up firefox-87.0/modules/libpref/Preferences.cpp.1170092 firefox-87.0/modules/libpref/Preferences.cpp ---- firefox-87.0/modules/libpref/Preferences.cpp.1170092 2021-03-18 14:48:54.000000000 +0100 -+++ firefox-87.0/modules/libpref/Preferences.cpp 2021-03-22 19:20:02.429310184 +0100 -@@ -4499,6 +4499,9 @@ nsresult Preferences::InitInitialObjects - // - // Thus, in the omni.jar case, we always load app-specific default - // preferences from omni.jar, whether or not `$app == $gre`. -+ // -+ // At very end load configuration from system config location: -+ // - /etc/firefox/pref/*.js - - nsresult rv = NS_ERROR_FAILURE; - UniquePtr find; -diff -up firefox-87.0/toolkit/xre/nsXREDirProvider.cpp.1170092 firefox-87.0/toolkit/xre/nsXREDirProvider.cpp ---- firefox-87.0/toolkit/xre/nsXREDirProvider.cpp.1170092 2021-03-18 14:52:00.000000000 +0100 -+++ firefox-87.0/toolkit/xre/nsXREDirProvider.cpp 2021-03-22 19:37:56.574480347 +0100 -@@ -65,6 +65,7 @@ - #endif - #ifdef XP_UNIX - # include -+# include "nsIXULAppInfo.h" - #endif - #ifdef XP_IOS - # include "UIKitDirProvider.h" -@@ -552,6 +553,21 @@ nsXREDirProvider::GetFile(const char* aP - } - } - } -+ -+#if defined(XP_UNIX) -+ if (!strcmp(aProperty, NS_APP_PREFS_SYSTEM_CONFIG_DIR)) { -+ nsCString sysConfigDir = nsLiteralCString("/etc/"); -+ nsCOMPtr appInfo = do_GetService("@mozilla.org/xre/app-info;1"); -+ if (!appInfo) -+ return NS_ERROR_NOT_AVAILABLE; -+ nsCString appName; -+ appInfo->GetName(appName); -+ ToLowerCase(appName); -+ sysConfigDir.Append(appName); -+ return NS_NewNativeLocalFile(sysConfigDir, false, aFile); -+ } -+#endif -+ - if (NS_FAILED(rv) || !file) return NS_ERROR_FAILURE; - - if (ensureFilePermissions) { -@@ -874,6 +890,16 @@ nsresult nsXREDirProvider::GetFilesInter - } - #endif - -+ // Add /etc//pref/ directory if it exists -+ nsCOMPtr systemPrefDir; -+ rv = NS_GetSpecialDirectory(NS_APP_PREFS_SYSTEM_CONFIG_DIR, -+ getter_AddRefs(systemPrefDir)); -+ if (NS_SUCCEEDED(rv)) { -+ rv = systemPrefDir->AppendNative(nsLiteralCString("pref")); -+ if (NS_SUCCEEDED(rv)) -+ directories.AppendObject(systemPrefDir); -+ } -+ - rv = NS_NewArrayEnumerator(aResult, directories, NS_GET_IID(nsIFile)); - } else if (!strcmp(aProperty, NS_APP_CHROME_DIR_LIST)) { - // NS_APP_CHROME_DIR_LIST is only used to get default (native) icons -diff -up firefox-87.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 firefox-87.0/xpcom/io/nsAppDirectoryServiceDefs.h ---- firefox-87.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 2021-03-18 14:51:58.000000000 +0100 -+++ firefox-87.0/xpcom/io/nsAppDirectoryServiceDefs.h 2021-03-22 19:20:02.430310213 +0100 -@@ -59,6 +59,7 @@ - #define NS_APP_PREFS_DEFAULTS_DIR_LIST "PrefDL" - #define NS_APP_PREFS_OVERRIDE_DIR \ - "PrefDOverride" // Directory for per-profile defaults -+#define NS_APP_PREFS_SYSTEM_CONFIG_DIR "PrefSysConf" // Directory with system-wide configuration - - #define NS_APP_USER_PROFILE_50_DIR "ProfD" - #define NS_APP_USER_PROFILE_LOCAL_50_DIR "ProfLD" diff --git a/mozilla-1813500.patch b/mozilla-1813500.patch deleted file mode 100644 index 565d27d..0000000 --- a/mozilla-1813500.patch +++ /dev/null @@ -1,94 +0,0 @@ -changeset: 651243:ff57728124c6 -tag: tip -parent: 651233:dd0fdd1daa69 -user: stransky -date: Tue Jan 31 15:53:38 2023 +0100 -files: widget/gtk/GfxInfo.cpp -description: -Bug 1813500 [Linux] Don't hang Firefox when glxtest process hangs r?emilio,rmader - -Differential Revision: https://phabricator.services.mozilla.com/D168385 - - -diff --git a/widget/gtk/GfxInfo.cpp b/widget/gtk/GfxInfo.cpp ---- a/widget/gtk/GfxInfo.cpp -+++ b/widget/gtk/GfxInfo.cpp -@@ -11,6 +11,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -29,6 +30,9 @@ - #include "WidgetUtilsGtk.h" - #include "MediaCodecsSupport.h" - -+// How long we wait for data from glxtest process in milliseconds. -+#define GLXTEST_TIMEOUT 4000 -+ - #define EXIT_STATUS_BUFFER_TOO_SMALL 2 - #ifdef DEBUG - bool fire_glxtest_process(); -@@ -99,12 +103,28 @@ void GfxInfo::GetData() { - // information in a separate process to protect against bad drivers. - - // if glxtest_pipe == -1, that means that we already read the information -- if (glxtest_pipe == -1) return; -+ if (glxtest_pipe == -1) { -+ return; -+ } -+ -+ const TimeStamp deadline = -+ TimeStamp::Now() + TimeDuration::FromMilliseconds(GLXTEST_TIMEOUT); - - enum { buf_size = 2048 }; - char buf[buf_size]; -- ssize_t bytesread = read(glxtest_pipe, &buf, -- buf_size - 1); // -1 because we'll append a zero -+ ssize_t bytesread = 0; -+ -+ struct pollfd pfd {}; -+ pfd.fd = glxtest_pipe; -+ pfd.events = POLLIN; -+ auto ret = poll(&pfd, 1, GLXTEST_TIMEOUT); -+ if (ret <= 0) { -+ gfxCriticalNote << "glxtest: failed to read data from glxtest, we may " -+ "fallback to software rendering\n"; -+ } else { -+ // -1 because we'll append a zero -+ bytesread = read(glxtest_pipe, &buf, buf_size - 1); -+ } - close(glxtest_pipe); - glxtest_pipe = -1; - -@@ -129,9 +149,9 @@ void GfxInfo::GetData() { - int waitpid_errno = 0; - while (wait_for_glxtest_process) { - wait_for_glxtest_process = false; -- if (waitpid(glxtest_pid, &glxtest_status, 0) == -1) { -+ if (waitpid(glxtest_pid, &glxtest_status, WNOHANG) == -1) { - waitpid_errno = errno; -- if (waitpid_errno == EINTR) { -+ if (waitpid_errno == EAGAIN || waitpid_errno == EINTR) { - wait_for_glxtest_process = true; - } else { - // Bug 718629 -@@ -142,6 +162,15 @@ void GfxInfo::GetData() { - waiting_for_glxtest_process_failed = (waitpid_errno != ECHILD); - } - } -+ if (wait_for_glxtest_process) { -+ if (TimeStamp::Now() > deadline) { -+ gfxCriticalNote << "glxtest: glxtest process hangs\n"; -+ waiting_for_glxtest_process_failed = true; -+ break; -+ } -+ // Wait 100ms to another waitpid() check. -+ usleep(100000); -+ } - } - - int exit_code = EXIT_FAILURE; - diff --git a/sources b/sources index 110b172..5381384 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 -SHA512 (firefox-110.0.source.tar.xz) = 52a37a8f59a694c4790c0a14cd81fba9e2c982f64e00191afd0897c39ae1d5e25f24cff16f74d0a0b5cdf8e93a9a0974b6042b0de605cf1a533ef4e6a3c0dcf9 -SHA512 (firefox-langpacks-110.0-20230214.tar.xz) = 63b8a4428674393cd1d0742708c7c300e9a85d6b294f8fb281b773373db5735208f8d27df7fe769ddba259743f76502e0bf20e953736ebc78a9b3178afa5ecf7 +SHA512 (firefox-111.0.source.tar.xz) = cdb300fdbb2b60068b0fc10a18df587b417e484901d36f52dd174d320d3440a42b02ea000f325c5781fd8853a5171b1a5184562fb535ece90619e4c64d46bb82 +SHA512 (firefox-langpacks-111.0-20230320.tar.xz) = 754bcc39c969c820c395bf5c67132d2468862e7b0638efb48cda6484e32aa18a807400a766b8a28f850e39684a25c4286aa359451d233a62ed0c545d64135209 From 065757c3b41b75a5dccfbd5cf59e85174a8dd64d Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 21 Mar 2023 09:33:42 +0100 Subject: [PATCH 180/545] Disabled arm on F36 --- firefox.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 294e98d..579e0bb 100644 --- a/firefox.spec +++ b/firefox.spec @@ -6,6 +6,9 @@ # https://bugzilla.redhat.com/show_bug.cgi?id=2129720 ExcludeArch: i686 +# Excluded due to build failure on F36 +ExcludeArch: armv7hl + # Run Mozilla test suite as a part of compile rpm section. Turn off when # building locally and don't want to spend 24 hours waiting for results. %global run_firefox_tests 0 @@ -173,7 +176,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 111.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1070,6 +1073,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Mar 21 2023 Martin Stransky - 111.0-2 +- Disabled arm on F36 + * Mon Mar 20 2023 Martin Stransky - 111.0-1 - Updated to 111.0 From 701cde858b35b58826d8c1b9a33900435927e226 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 21 Mar 2023 09:35:08 +0100 Subject: [PATCH 181/545] Disabled arm on F36 --- firefox.spec | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/firefox.spec b/firefox.spec index 579e0bb..1e2beab 100644 --- a/firefox.spec +++ b/firefox.spec @@ -176,7 +176,7 @@ ExcludeArch: armv7hl Summary: Mozilla Firefox Web browser Name: firefox Version: 111.0 -Release: 2%{?pre_tag}%{?dist} +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1073,11 +1073,9 @@ fi #--------------------------------------------------------------------- %changelog -* Tue Mar 21 2023 Martin Stransky - 111.0-2 -- Disabled arm on F36 - * Mon Mar 20 2023 Martin Stransky - 111.0-1 - Updated to 111.0 +- Disabled arm on F36 * Tue Feb 14 2023 Martin Stransky - 110.0-3 - Updated to 110.0 build 3 From b35d0d6682f48da1319bcb0feaa5e269e077af70 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 21 Mar 2023 18:09:42 +0100 Subject: [PATCH 182/545] Added libproxy support (rhbz#2177806), Added build fixes on arm --- D172126.diff | 22 ++++++++++++++++++++++ firefox-mozconfig | 1 + firefox.spec | 12 ++++++++---- 3 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 D172126.diff diff --git a/D172126.diff b/D172126.diff new file mode 100644 index 0000000..b4189c0 --- /dev/null +++ b/D172126.diff @@ -0,0 +1,22 @@ +diff --git a/dom/media/webaudio/AudioNodeEngineGeneric.h b/dom/media/webaudio/AudioNodeEngineGeneric.h +--- a/dom/media/webaudio/AudioNodeEngineGeneric.h ++++ b/dom/media/webaudio/AudioNodeEngineGeneric.h +@@ -203,14 +203,14 @@ + MOZ_ASSERT((aSize % xsimd::batch::size == 0), + "requires tail processing"); + + MOZ_UNROLL(2) + for (unsigned i = 0; i < aSize * 2; +- i += 2 * xsimd::batch>::size) { +- auto in1 = xsimd::batch>::load_aligned( ++ i += 2 * xsimd::batch, Arch>::size) { ++ auto in1 = xsimd::batch, Arch>::load_aligned( + reinterpret_cast*>(&aInput[i])); +- auto in2 = xsimd::batch>::load_aligned( ++ auto in2 = xsimd::batch, Arch>::load_aligned( + reinterpret_cast*>(&aScale[i])); + auto out = in1 * in2; + out.store_aligned(reinterpret_cast*>(&aOutput[i])); + } + }; + diff --git a/firefox-mozconfig b/firefox-mozconfig index 676a0e0..af5d664 100644 --- a/firefox-mozconfig +++ b/firefox-mozconfig @@ -16,6 +16,7 @@ ac_add_options --enable-js-shell ac_add_options --with-unsigned-addon-scopes=app,system ac_add_options --without-sysroot ac_add_options --without-wasm-sandboxed-libraries +ac_add_options --enable-libproxy export BUILD_OFFICIAL=1 export MOZILLA_OFFICIAL=1 diff --git a/firefox.spec b/firefox.spec index 1e2beab..195132a 100644 --- a/firefox.spec +++ b/firefox.spec @@ -6,9 +6,6 @@ # https://bugzilla.redhat.com/show_bug.cgi?id=2129720 ExcludeArch: i686 -# Excluded due to build failure on F36 -ExcludeArch: armv7hl - # Run Mozilla test suite as a part of compile rpm section. Turn off when # building locally and don't want to spend 24 hours waiting for results. %global run_firefox_tests 0 @@ -176,7 +173,7 @@ ExcludeArch: armv7hl Summary: Mozilla Firefox Web browser Name: firefox Version: 111.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -229,6 +226,7 @@ Patch61: firefox-glibc-dynstack.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch78: firefox-i686-build.patch Patch79: firefox-gcc-13-build.patch +Patch80: D172126.diff # Test patches # Generate without context by @@ -416,6 +414,7 @@ BuildRequires: xorg-x11-fonts-misc BuildRequires: make BuildRequires: pciutils-libs BuildRequires: mesa-libgbm-devel +BuildRequires: libproxy-devel Obsoletes: mozilla <= 37:1.7.13 Provides: webclient @@ -503,6 +502,7 @@ This package contains results of tests executed during build. %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch78 -p1 -b .firefox-i686 %patch79 -p1 -b .firefox-gcc-13-build +%patch80 -p1 -b .D172126 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -1073,6 +1073,10 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Mar 21 2023 Martin Stransky - 111.0-2 +- Added libproxy support (rhbz#2177806) +- Added build fixes on arm + * Mon Mar 20 2023 Martin Stransky - 111.0-1 - Updated to 111.0 - Disabled arm on F36 From 255820fae039ac1cf25d8930ef0ba4cbb943efe8 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Tue, 21 Mar 2023 13:02:57 +0100 Subject: [PATCH 183/545] libwebrtc: backport upstream fix/improvement for DmaBuf screen sharing --- firefox.spec | 8 +- ...t-dmabuf-directly-into-desktop-frame.patch | 505 ++++++++++++++++++ 2 files changed, 512 insertions(+), 1 deletion(-) create mode 100644 libwebrtc-pipewire-capturer-import-dmabuf-directly-into-desktop-frame.patch diff --git a/firefox.spec b/firefox.spec index 195132a..7e3c04d 100644 --- a/firefox.spec +++ b/firefox.spec @@ -173,7 +173,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 111.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -251,6 +251,8 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch +# https://phabricator.services.mozilla.com/D173021 +Patch416: libwebrtc-pipewire-capturer-import-dmabuf-directly-into-desktop-frame.patch # PGO/LTO patches Patch600: pgo.patch @@ -525,6 +527,7 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 +%patch416 -p1 -b .libwebrtc-pipewire-capturer-import-dmabuf-directly-into-desktop-frame # PGO patches %if %{build_with_pgo} @@ -1073,6 +1076,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Mar 21 2023 Jan Grulich - 111.0-3 +- libwebrtc: backport upstream fix/improvement for DmaBuf screen sharing + * Tue Mar 21 2023 Martin Stransky - 111.0-2 - Added libproxy support (rhbz#2177806) - Added build fixes on arm diff --git a/libwebrtc-pipewire-capturer-import-dmabuf-directly-into-desktop-frame.patch b/libwebrtc-pipewire-capturer-import-dmabuf-directly-into-desktop-frame.patch new file mode 100644 index 0000000..69f9df2 --- /dev/null +++ b/libwebrtc-pipewire-capturer-import-dmabuf-directly-into-desktop-frame.patch @@ -0,0 +1,505 @@ +From d9faa73cbbc186d7dd0dbfce0589012a0bed9f17 Mon Sep 17 00:00:00 2001 +From: Jan Grulich +Date: Fri, 17 Mar 2023 10:58:10 +0100 +Subject: [PATCH] PipeWire capturer: import DMABufs directly into desktop frame + +Originally DMABufs were imported into a temporary buffer followed by a +copy operation into the desktop frame itself. This is not needed as we +can import them directly into desktop frames and avoid this overhead. + +Also drop support for MemPtr buffers as both Mutter and KWin don't seem +to support them and they are going to be too slow anyway. + +Testing with latest Chromium, I could see two processes with usage around 20% and 40% without this change going down to 10% and 20% with +this change applied. + +Bug: webrtc:13429 +Bug: chrome:1378258 +Change-Id: Ice3292528ff56300931c8638f8e03d4883d5e331 +Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/297501 +Reviewed-by: Alexander Cooper +Commit-Queue: Jan Grulich +Cr-Commit-Position: refs/heads/main@{#39594} +--- + +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc +index 5bbd5d7aba..b529077c6d 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc +@@ -101,11 +101,23 @@ typedef void (*glDeleteTextures_func)(GLsizei n, const GLuint* textures); + typedef void (*glGenTextures_func)(GLsizei n, GLuint* textures); + typedef GLenum (*glGetError_func)(void); + typedef const GLubyte* (*glGetString_func)(GLenum name); +-typedef void (*glGetTexImage_func)(GLenum target, +- GLint level, +- GLenum format, +- GLenum type, +- void* pixels); ++typedef void (*glReadPixels_func)(GLint x, ++ GLint y, ++ GLsizei width, ++ GLsizei height, ++ GLenum format, ++ GLenum type, ++ void* data); ++typedef void (*glGenFramebuffers_func)(GLsizei n, GLuint* ids); ++typedef void (*glDeleteFramebuffers_func)(GLsizei n, ++ const GLuint* framebuffers); ++typedef void (*glBindFramebuffer_func)(GLenum target, GLuint framebuffer); ++typedef void (*glFramebufferTexture2D_func)(GLenum target, ++ GLenum attachment, ++ GLenum textarget, ++ GLuint texture, ++ GLint level); ++typedef GLenum (*glCheckFramebufferStatus_func)(GLenum target); + typedef void (*glTexParameteri_func)(GLenum target, GLenum pname, GLint param); + typedef void* (*glXGetProcAddressARB_func)(const char*); + +@@ -118,7 +130,12 @@ glDeleteTextures_func GlDeleteTextures = nullptr; + glGenTextures_func GlGenTextures = nullptr; + glGetError_func GlGetError = nullptr; + glGetString_func GlGetString = nullptr; +-glGetTexImage_func GlGetTexImage = nullptr; ++glReadPixels_func GlReadPixels = nullptr; ++glGenFramebuffers_func GlGenFramebuffers = nullptr; ++glDeleteFramebuffers_func GlDeleteFramebuffers = nullptr; ++glBindFramebuffer_func GlBindFramebuffer = nullptr; ++glFramebufferTexture2D_func GlFramebufferTexture2D = nullptr; ++glCheckFramebufferStatus_func GlCheckFramebufferStatus = nullptr; + glTexParameteri_func GlTexParameteri = nullptr; + glXGetProcAddressARB_func GlXGetProcAddressARB = nullptr; + +@@ -279,12 +296,26 @@ static bool LoadGL() { + (glDeleteTextures_func)GlXGetProcAddressARB("glDeleteTextures"); + GlGenTextures = (glGenTextures_func)GlXGetProcAddressARB("glGenTextures"); + GlGetError = (glGetError_func)GlXGetProcAddressARB("glGetError"); +- GlGetTexImage = (glGetTexImage_func)GlXGetProcAddressARB("glGetTexImage"); ++ GlReadPixels = (glReadPixels_func)GlXGetProcAddressARB("glReadPixels"); ++ GlGenFramebuffers = ++ (glGenFramebuffers_func)GlXGetProcAddressARB("glGenFramebuffers"); ++ GlDeleteFramebuffers = ++ (glDeleteFramebuffers_func)GlXGetProcAddressARB("glDeleteFramebuffers"); ++ GlBindFramebuffer = ++ (glBindFramebuffer_func)GlXGetProcAddressARB("glBindFramebuffer"); ++ GlFramebufferTexture2D = (glFramebufferTexture2D_func)GlXGetProcAddressARB( ++ "glFramebufferTexture2D"); ++ GlCheckFramebufferStatus = ++ (glCheckFramebufferStatus_func)GlXGetProcAddressARB( ++ "glCheckFramebufferStatus"); ++ + GlTexParameteri = + (glTexParameteri_func)GlXGetProcAddressARB("glTexParameteri"); + + return GlBindTexture && GlDeleteTextures && GlGenTextures && GlGetError && +- GlGetTexImage && GlTexParameteri; ++ GlReadPixels && GlGenFramebuffers && GlDeleteFramebuffers && ++ GlBindFramebuffer && GlFramebufferTexture2D && ++ GlCheckFramebufferStatus && GlTexParameteri; + } + + return false; +@@ -435,6 +466,14 @@ EglDmaBuf::~EglDmaBuf() { + EglTerminate(egl_.display); + } + ++ if (fbo_) { ++ GlDeleteFramebuffers(1, &fbo_); ++ } ++ ++ if (texture_) { ++ GlDeleteTextures(1, &texture_); ++ } ++ + // BUG: crbug.com/1290566 + // Closing libEGL.so.1 when using NVidia drivers causes a crash + // when EglGetPlatformDisplayEXT() is used, at least this one is enough +@@ -466,20 +505,20 @@ bool EglDmaBuf::GetClientExtensions(EGLDisplay dpy, EGLint name) { + } + + RTC_NO_SANITIZE("cfi-icall") +-std::unique_ptr EglDmaBuf::ImageFromDmaBuf( +- const DesktopSize& size, +- uint32_t format, +- const std::vector& plane_datas, +- uint64_t modifier) { +- std::unique_ptr src; +- ++bool EglDmaBuf::ImageFromDmaBuf(const DesktopSize& size, ++ uint32_t format, ++ const std::vector& plane_datas, ++ uint64_t modifier, ++ const DesktopVector& offset, ++ const DesktopSize& buffer_size, ++ uint8_t* data) { + if (!egl_initialized_) { +- return src; ++ return false; + } + + if (plane_datas.size() <= 0) { + RTC_LOG(LS_ERROR) << "Failed to process buffer: invalid number of planes"; +- return src; ++ return false; + } + + EGLint attribs[47]; +@@ -568,20 +607,32 @@ std::unique_ptr EglDmaBuf::ImageFromDmaBuf( + if (image == EGL_NO_IMAGE) { + RTC_LOG(LS_ERROR) << "Failed to record frame: Error creating EGLImage - " + << FormatEGLError(EglGetError()); +- return src; ++ return false; + } + + // create GL 2D texture for framebuffer +- GLuint texture; +- GlGenTextures(1, &texture); +- GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); +- GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); +- GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); +- GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); +- GlBindTexture(GL_TEXTURE_2D, texture); ++ if (!texture_) { ++ GlGenTextures(1, &texture_); ++ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); ++ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); ++ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); ++ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); ++ } ++ GlBindTexture(GL_TEXTURE_2D, texture_); + GlEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image); + +- src = std::make_unique(plane_datas[0].stride * size.height()); ++ if (!fbo_) { ++ GlGenFramebuffers(1, &fbo_); ++ } ++ ++ GlBindFramebuffer(GL_FRAMEBUFFER, fbo_); ++ GlFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, ++ texture_, 0); ++ if (GlCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) { ++ RTC_LOG(LS_ERROR) << "Failed to bind DMA buf framebuffer"; ++ EglDestroyImageKHR(egl_.display, image); ++ return false; ++ } + + GLenum gl_format = GL_BGRA; + switch (format) { +@@ -598,17 +649,18 @@ std::unique_ptr EglDmaBuf::ImageFromDmaBuf( + gl_format = GL_BGRA; + break; + } +- GlGetTexImage(GL_TEXTURE_2D, 0, gl_format, GL_UNSIGNED_BYTE, src.get()); + +- if (GlGetError()) { ++ GlReadPixels(offset.x(), offset.y(), buffer_size.width(), ++ buffer_size.height(), gl_format, GL_UNSIGNED_BYTE, data); ++ ++ const GLenum error = GlGetError(); ++ if (error) { + RTC_LOG(LS_ERROR) << "Failed to get image from DMA buffer."; +- return src; + } + +- GlDeleteTextures(1, &texture); + EglDestroyImageKHR(egl_.display, image); + +- return src; ++ return !error; + } + + RTC_NO_SANITIZE("cfi-icall") +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.h b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.h +index f1d96b2f80..22a8f5ab52 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.h ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.h +@@ -41,11 +41,15 @@ class EglDmaBuf { + EglDmaBuf(); + ~EglDmaBuf(); + +- std::unique_ptr ImageFromDmaBuf( +- const DesktopSize& size, +- uint32_t format, +- const std::vector& plane_datas, +- uint64_t modifiers); ++ // Returns whether the image was successfully imported from ++ // given DmaBuf and its parameters ++ bool ImageFromDmaBuf(const DesktopSize& size, ++ uint32_t format, ++ const std::vector& plane_datas, ++ uint64_t modifiers, ++ const DesktopVector& offset, ++ const DesktopSize& buffer_size, ++ uint8_t* data); + std::vector QueryDmaBufModifiers(uint32_t format); + + bool IsEglInitialized() const { return egl_initialized_; } +@@ -58,6 +62,8 @@ class EglDmaBuf { + int32_t drm_fd_ = -1; // for GBM buffer mmap + gbm_device* gbm_device_ = nullptr; // for passed GBM buffer retrieval + ++ GLuint fbo_ = 0; ++ GLuint texture_ = 0; + EGLStruct egl_; + + absl::optional GetRenderNode(); +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +index 0ca75d00fc..a8879764c7 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +@@ -149,6 +149,12 @@ class SharedScreenCastStreamPrivate { + struct spa_video_info_raw spa_video_format_; + + void ProcessBuffer(pw_buffer* buffer); ++ bool ProcessMemFDBuffer(pw_buffer* buffer, ++ DesktopFrame& frame, ++ const DesktopVector& offset); ++ bool ProcessDMABuffer(pw_buffer* buffer, ++ DesktopFrame& frame, ++ const DesktopVector& offset); + void ConvertRGBxToBGRx(uint8_t* frame, uint32_t size); + + // PipeWire callbacks +@@ -268,9 +274,8 @@ void SharedScreenCastStreamPrivate::OnStreamParamChanged( + std::vector params; + const int buffer_types = + has_modifier || (that->pw_server_version_ >= kDmaBufMinVersion) +- ? (1 << SPA_DATA_DmaBuf) | (1 << SPA_DATA_MemFd) | +- (1 << SPA_DATA_MemPtr) +- : (1 << SPA_DATA_MemFd) | (1 << SPA_DATA_MemPtr); ++ ? (1 << SPA_DATA_DmaBuf) | (1 << SPA_DATA_MemFd) ++ : (1 << SPA_DATA_MemFd); + + params.push_back(reinterpret_cast(spa_pod_builder_add_object( + &builder, SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers, +@@ -605,9 +610,6 @@ DesktopVector SharedScreenCastStreamPrivate::CaptureCursorPosition() { + RTC_NO_SANITIZE("cfi-icall") + void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { + spa_buffer* spa_buffer = buffer->buffer; +- ScopedBuf map; +- std::unique_ptr src_unique_ptr; +- uint8_t* src = nullptr; + + // Try to update the mouse cursor first, because it can be the only + // information carried by the buffer +@@ -641,76 +643,6 @@ void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { + return; + } + +- if (spa_buffer->datas[0].type == SPA_DATA_MemFd) { +- map.initialize( +- static_cast( +- mmap(nullptr, +- spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset, +- PROT_READ, MAP_PRIVATE, spa_buffer->datas[0].fd, 0)), +- spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset, +- spa_buffer->datas[0].fd); +- +- if (!map) { +- RTC_LOG(LS_ERROR) << "Failed to mmap the memory: " +- << std::strerror(errno); +- return; +- } +- +- src = SPA_MEMBER(map.get(), spa_buffer->datas[0].mapoffset, uint8_t); +- } else if (spa_buffer->datas[0].type == SPA_DATA_DmaBuf) { +- const uint n_planes = spa_buffer->n_datas; +- +- if (!n_planes) { +- return; +- } +- +- std::vector plane_datas; +- for (uint32_t i = 0; i < n_planes; ++i) { +- EglDmaBuf::PlaneData data = { +- static_cast(spa_buffer->datas[i].fd), +- static_cast(spa_buffer->datas[i].chunk->stride), +- static_cast(spa_buffer->datas[i].chunk->offset)}; +- plane_datas.push_back(data); +- } +- +- // When importing DMA-BUFs, we use the stride (number of bytes from one row +- // of pixels in the buffer) provided by PipeWire. The stride from PipeWire +- // is given by the graphics driver and some drivers might add some +- // additional padding for memory layout optimizations so not everytime the +- // stride is equal to BYTES_PER_PIXEL x WIDTH. This is fine, because during +- // the import we will use OpenGL and same graphics driver so it will be able +- // to work with the stride it provided, but later on when we work with +- // images we get from DMA-BUFs we will need to update the stride to be equal +- // to BYTES_PER_PIXEL x WIDTH as that's the size of the DesktopFrame we +- // allocate for each captured frame. +- src_unique_ptr = egl_dmabuf_->ImageFromDmaBuf( +- stream_size_, spa_video_format_.format, plane_datas, modifier_); +- if (src_unique_ptr) { +- src = src_unique_ptr.get(); +- } else { +- RTC_LOG(LS_ERROR) << "Dropping DMA-BUF modifier: " << modifier_ +- << " and trying to renegotiate stream parameters"; +- +- if (pw_server_version_ >= kDropSingleModifierMinVersion) { +- modifiers_.erase( +- std::remove(modifiers_.begin(), modifiers_.end(), modifier_), +- modifiers_.end()); +- } else { +- modifiers_.clear(); +- } +- +- pw_loop_signal_event(pw_thread_loop_get_loop(pw_main_loop_), +- renegotiate_); +- return; +- } +- } else if (spa_buffer->datas[0].type == SPA_DATA_MemPtr) { +- src = static_cast(spa_buffer->datas[0].data); +- } +- +- if (!src) { +- return; +- } +- + // Use SPA_META_VideoCrop metadata to get the frame size. KDE and GNOME do + // handle screen/window sharing differently. KDE/KWin doesn't use + // SPA_META_VideoCrop metadata and when sharing a window, it always sets +@@ -763,8 +695,8 @@ void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { + } + + // Get the position of the video crop within the stream. Just double-check +- // that the position doesn't exceed the size of the stream itself. NOTE: +- // Currently it looks there is no implementation using this. ++ // that the position doesn't exceed the size of the stream itself. ++ // NOTE: Currently it looks there is no implementation using this. + uint32_t y_offset = + videocrop_metadata_use && + (videocrop_metadata->region.position.y + frame_size_.height() <= +@@ -777,22 +709,7 @@ void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { + stream_size_.width()) + ? videocrop_metadata->region.position.x + : 0; +- +- const uint32_t stream_stride = kBytesPerPixel * stream_size_.width(); +- uint32_t buffer_stride = spa_buffer->datas[0].chunk->stride; +- uint32_t src_stride = buffer_stride; +- +- if (spa_buffer->datas[0].type == SPA_DATA_DmaBuf && +- buffer_stride > stream_stride) { +- // When DMA-BUFs are used, sometimes spa_buffer->stride we get might +- // contain additional padding, but after we import the buffer, the stride +- // we used is no longer relevant and we should just calculate it based on +- // the stream width. For more context see https://crbug.com/1333304. +- src_stride = stream_stride; +- } +- +- uint8_t* updated_src = +- src + (src_stride * y_offset) + (kBytesPerPixel * x_offset); ++ DesktopVector offset = DesktopVector(x_offset, y_offset); + + webrtc::MutexLock lock(&queue_lock_); + +@@ -813,9 +730,17 @@ void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { + queue_.ReplaceCurrentFrame(SharedDesktopFrame::Wrap(std::move(frame))); + } + +- queue_.current_frame()->CopyPixelsFrom( +- updated_src, (src_stride - (kBytesPerPixel * x_offset)), +- DesktopRect::MakeWH(frame_size_.width(), frame_size_.height())); ++ bool bufferProcessed = false; ++ if (spa_buffer->datas[0].type == SPA_DATA_MemFd) { ++ bufferProcessed = ++ ProcessMemFDBuffer(buffer, *queue_.current_frame(), offset); ++ } else if (spa_buffer->datas[0].type == SPA_DATA_DmaBuf) { ++ bufferProcessed = ProcessDMABuffer(buffer, *queue_.current_frame(), offset); ++ } ++ ++ if (!bufferProcessed) { ++ return; ++ } + + if (spa_video_format_.format == SPA_VIDEO_FORMAT_RGBx || + spa_video_format_.format == SPA_VIDEO_FORMAT_RGBA) { +@@ -832,6 +757,87 @@ void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { + DesktopRect::MakeSize(queue_.current_frame()->size())); + } + ++RTC_NO_SANITIZE("cfi-icall") ++bool SharedScreenCastStreamPrivate::ProcessMemFDBuffer( ++ pw_buffer* buffer, ++ DesktopFrame& frame, ++ const DesktopVector& offset) { ++ spa_buffer* spa_buffer = buffer->buffer; ++ ScopedBuf map; ++ uint8_t* src = nullptr; ++ ++ map.initialize( ++ static_cast( ++ mmap(nullptr, ++ spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset, ++ PROT_READ, MAP_PRIVATE, spa_buffer->datas[0].fd, 0)), ++ spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset, ++ spa_buffer->datas[0].fd); ++ ++ if (!map) { ++ RTC_LOG(LS_ERROR) << "Failed to mmap the memory: " << std::strerror(errno); ++ return false; ++ } ++ ++ src = SPA_MEMBER(map.get(), spa_buffer->datas[0].mapoffset, uint8_t); ++ ++ uint32_t buffer_stride = spa_buffer->datas[0].chunk->stride; ++ uint32_t src_stride = buffer_stride; ++ ++ uint8_t* updated_src = ++ src + (src_stride * offset.y()) + (kBytesPerPixel * offset.x()); ++ ++ frame.CopyPixelsFrom( ++ updated_src, (src_stride - (kBytesPerPixel * offset.x())), ++ DesktopRect::MakeWH(frame.size().width(), frame.size().height())); ++ ++ return true; ++} ++ ++RTC_NO_SANITIZE("cfi-icall") ++bool SharedScreenCastStreamPrivate::ProcessDMABuffer( ++ pw_buffer* buffer, ++ DesktopFrame& frame, ++ const DesktopVector& offset) { ++ spa_buffer* spa_buffer = buffer->buffer; ++ ++ const uint n_planes = spa_buffer->n_datas; ++ ++ if (!n_planes) { ++ return false; ++ } ++ ++ std::vector plane_datas; ++ for (uint32_t i = 0; i < n_planes; ++i) { ++ EglDmaBuf::PlaneData data = { ++ static_cast(spa_buffer->datas[i].fd), ++ static_cast(spa_buffer->datas[i].chunk->stride), ++ static_cast(spa_buffer->datas[i].chunk->offset)}; ++ plane_datas.push_back(data); ++ } ++ ++ const bool imported = egl_dmabuf_->ImageFromDmaBuf( ++ stream_size_, spa_video_format_.format, plane_datas, modifier_, offset, ++ frame.size(), frame.data()); ++ if (!imported) { ++ RTC_LOG(LS_ERROR) << "Dropping DMA-BUF modifier: " << modifier_ ++ << " and trying to renegotiate stream parameters"; ++ ++ if (pw_server_version_ >= kDropSingleModifierMinVersion) { ++ modifiers_.erase( ++ std::remove(modifiers_.begin(), modifiers_.end(), modifier_), ++ modifiers_.end()); ++ } else { ++ modifiers_.clear(); ++ } ++ ++ pw_loop_signal_event(pw_thread_loop_get_loop(pw_main_loop_), renegotiate_); ++ return false; ++ } ++ ++ return true; ++} ++ + void SharedScreenCastStreamPrivate::ConvertRGBxToBGRx(uint8_t* frame, + uint32_t size) { + for (uint32_t i = 0; i < size; i += 4) { From 416ea4ae970b563b9dd9b56069ffb696f73cc8e2 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 22 Mar 2023 11:21:55 +0100 Subject: [PATCH 184/545] Added D172864.diff to build on arm --- D172864.diff | 736 +++++++++++++++++++++++++++++++++++++++++++++++++++ firefox.spec | 2 + 2 files changed, 738 insertions(+) create mode 100644 D172864.diff diff --git a/D172864.diff b/D172864.diff new file mode 100644 index 0000000..ddac7ba --- /dev/null +++ b/D172864.diff @@ -0,0 +1,736 @@ +diff --git a/dom/media/webaudio/AudioNodeEngineGeneric.h b/dom/media/webaudio/AudioNodeEngineGeneric.h +--- a/dom/media/webaudio/AudioNodeEngineGeneric.h ++++ b/dom/media/webaudio/AudioNodeEngineGeneric.h +@@ -5,331 +5,54 @@ + + #ifndef MOZILLA_AUDIONODEENGINEGENERIC_H_ + #define MOZILLA_AUDIONODEENGINEGENERIC_H_ + + #include "AudioNodeEngine.h" +-#include "AlignmentUtils.h" + + #include "xsimd/xsimd.hpp" + +-#if defined(__GNUC__) && __GNUC__ > 7 +-# define MOZ_PRAGMA(tokens) _Pragma(#tokens) +-# define MOZ_UNROLL(factor) MOZ_PRAGMA(GCC unroll factor) +-#elif defined(__INTEL_COMPILER) || (defined(__clang__) && __clang_major__ > 3) +-# define MOZ_PRAGMA(tokens) _Pragma(#tokens) +-# define MOZ_UNROLL(factor) MOZ_PRAGMA(unroll factor) +-#else +-# define MOZ_UNROLL(_) +-#endif +- + namespace mozilla { + + template +-static bool is_aligned(const void* ptr) { +- return (reinterpret_cast(ptr) & +- ~(static_cast(Arch::alignment()) - 1)) == +- reinterpret_cast(ptr); +-}; +- +-template + struct Engine { + static void AudioBufferAddWithScale(const float* aInput, float aScale, +- float* aOutput, uint32_t aSize) { +- if constexpr (Arch::requires_alignment()) { +- if (aScale == 1.0f) { +- while (!is_aligned(aInput) || !is_aligned(aOutput)) { +- if (!aSize) return; +- *aOutput += *aInput; +- ++aOutput; +- ++aInput; +- --aSize; +- } +- } else { +- while (!is_aligned(aInput) || !is_aligned(aOutput)) { +- if (!aSize) return; +- *aOutput += *aInput * aScale; +- ++aOutput; +- ++aInput; +- --aSize; +- } +- } +- } +- MOZ_ASSERT(is_aligned(aInput), "aInput is aligned"); +- MOZ_ASSERT(is_aligned(aOutput), "aOutput is aligned"); +- +- xsimd::batch vgain(aScale); +- +- uint32_t aVSize = aSize & ~(xsimd::batch::size - 1); +- MOZ_UNROLL(4) +- for (unsigned i = 0; i < aVSize; i += xsimd::batch::size) { +- auto vin1 = xsimd::batch::load_aligned(&aInput[i]); +- auto vin2 = xsimd::batch::load_aligned(&aOutput[i]); +- auto vout = xsimd::fma(vin1, vgain, vin2); +- vout.store_aligned(&aOutput[i]); +- } +- +- for (unsigned i = aVSize; i < aSize; ++i) { +- aOutput[i] += aInput[i] * aScale; +- } +- }; ++ float* aOutput, uint32_t aSize); + + static void AudioBlockCopyChannelWithScale(const float* aInput, float aScale, +- float* aOutput) { +- MOZ_ASSERT(is_aligned(aInput), "aInput is aligned"); +- MOZ_ASSERT(is_aligned(aOutput), "aOutput is aligned"); +- +- MOZ_ASSERT((WEBAUDIO_BLOCK_SIZE % xsimd::batch::size == 0), +- "requires tail processing"); +- +- xsimd::batch vgain = (aScale); +- +- MOZ_UNROLL(4) +- for (unsigned i = 0; i < WEBAUDIO_BLOCK_SIZE; +- i += xsimd::batch::size) { +- auto vin = xsimd::batch::load_aligned(&aInput[i]); +- auto vout = vin * vgain; +- vout.store_aligned(&aOutput[i]); +- } +- }; ++ float* aOutput); + + static void AudioBlockCopyChannelWithScale( + const float aInput[WEBAUDIO_BLOCK_SIZE], + const float aScale[WEBAUDIO_BLOCK_SIZE], +- float aOutput[WEBAUDIO_BLOCK_SIZE]) { +- MOZ_ASSERT(is_aligned(aInput), "aInput is aligned"); +- MOZ_ASSERT(is_aligned(aOutput), "aOutput is aligned"); +- MOZ_ASSERT(is_aligned(aScale), "aScale is aligned"); +- +- MOZ_ASSERT((WEBAUDIO_BLOCK_SIZE % xsimd::batch::size == 0), +- "requires tail processing"); +- +- MOZ_UNROLL(4) +- for (unsigned i = 0; i < WEBAUDIO_BLOCK_SIZE; +- i += xsimd::batch::size) { +- auto vscaled = xsimd::batch::load_aligned(&aScale[i]); +- auto vin = xsimd::batch::load_aligned(&aInput[i]); +- auto vout = vin * vscaled; +- vout.store_aligned(&aOutput[i]); +- } +- }; ++ float aOutput[WEBAUDIO_BLOCK_SIZE]); + + static void AudioBufferInPlaceScale(float* aBlock, float aScale, +- uint32_t aSize) { +- MOZ_ASSERT(is_aligned(aBlock), "aBlock is aligned"); +- +- xsimd::batch vgain(aScale); +- +- uint32_t aVSize = aSize & ~(xsimd::batch::size - 1); +- MOZ_UNROLL(4) +- for (unsigned i = 0; i < aVSize; i += xsimd::batch::size) { +- auto vin = xsimd::batch::load_aligned(&aBlock[i]); +- auto vout = vin * vgain; +- vout.store_aligned(&aBlock[i]); +- } +- for (unsigned i = aVSize; i < aSize; ++i) aBlock[i] *= aScale; +- }; ++ uint32_t aSize); + + static void AudioBufferInPlaceScale(float* aBlock, float* aScale, +- uint32_t aSize) { +- MOZ_ASSERT(is_aligned(aBlock), "aBlock is aligned"); +- MOZ_ASSERT(is_aligned(aScale), "aScale is aligned"); +- +- uint32_t aVSize = aSize & ~(xsimd::batch::size - 1); +- MOZ_UNROLL(4) +- for (unsigned i = 0; i < aVSize; i += xsimd::batch::size) { +- auto vin = xsimd::batch::load_aligned(&aBlock[i]); +- auto vgain = xsimd::batch::load_aligned(&aScale[i]); +- auto vout = vin * vgain; +- vout.store_aligned(&aBlock[i]); +- } +- for (uint32_t i = aVSize; i < aSize; ++i) { +- *aBlock++ *= *aScale++; +- } +- }; ++ uint32_t aSize); + + static void AudioBlockPanStereoToStereo( + const float aInputL[WEBAUDIO_BLOCK_SIZE], + const float aInputR[WEBAUDIO_BLOCK_SIZE], float aGainL, float aGainR, + bool aIsOnTheLeft, float aOutputL[WEBAUDIO_BLOCK_SIZE], +- float aOutputR[WEBAUDIO_BLOCK_SIZE]) { +- MOZ_ASSERT(is_aligned(aInputL), "aInputL is aligned"); +- MOZ_ASSERT(is_aligned(aInputR), "aInputR is aligned"); +- MOZ_ASSERT(is_aligned(aOutputL), "aOutputL is aligned"); +- MOZ_ASSERT(is_aligned(aOutputR), "aOutputR is aligned"); +- +- MOZ_ASSERT((WEBAUDIO_BLOCK_SIZE % xsimd::batch::size == 0), +- "requires tail processing"); +- +- xsimd::batch vgainl(aGainL); +- xsimd::batch vgainr(aGainR); +- +- if (aIsOnTheLeft) { +- MOZ_UNROLL(2) +- for (unsigned i = 0; i < WEBAUDIO_BLOCK_SIZE; +- i += xsimd::batch::size) { +- auto vinl = xsimd::batch::load_aligned(&aInputL[i]); +- auto vinr = xsimd::batch::load_aligned(&aInputR[i]); +- +- /* left channel : aOutputL = aInputL + aInputR * gainL */ +- auto vout = xsimd::fma(vinr, vgainl, vinl); +- vout.store_aligned(&aOutputL[i]); +- +- /* right channel : aOutputR = aInputR * gainR */ +- auto vscaled = vinr * vgainr; +- vscaled.store_aligned(&aOutputR[i]); +- } +- } else { +- MOZ_UNROLL(2) +- for (unsigned i = 0; i < WEBAUDIO_BLOCK_SIZE; +- i += xsimd::batch::size) { +- auto vinl = xsimd::batch::load_aligned(&aInputL[i]); +- auto vinr = xsimd::batch::load_aligned(&aInputR[i]); +- +- /* left channel : aInputL * gainL */ +- auto vscaled = vinl * vgainl; +- vscaled.store_aligned(&aOutputL[i]); +- +- /* right channel: aOutputR = aInputR + aInputL * gainR */ +- auto vout = xsimd::fma(vinl, vgainr, vinr); +- vout.store_aligned(&aOutputR[i]); +- } +- } +- }; ++ float aOutputR[WEBAUDIO_BLOCK_SIZE]); + + static void BufferComplexMultiply(const float* aInput, const float* aScale, +- float* aOutput, uint32_t aSize) { +- MOZ_ASSERT(is_aligned(aInput), "aInput is aligned"); +- MOZ_ASSERT(is_aligned(aOutput), "aOutput is aligned"); +- MOZ_ASSERT(is_aligned(aScale), "aScale is aligned"); +- MOZ_ASSERT((aSize % xsimd::batch::size == 0), +- "requires tail processing"); +- +- MOZ_UNROLL(2) +- for (unsigned i = 0; i < aSize * 2; +- i += 2 * xsimd::batch, Arch>::size) { +- auto in1 = xsimd::batch, Arch>::load_aligned( +- reinterpret_cast*>(&aInput[i])); +- auto in2 = xsimd::batch, Arch>::load_aligned( +- reinterpret_cast*>(&aScale[i])); +- auto out = in1 * in2; +- out.store_aligned(reinterpret_cast*>(&aOutput[i])); +- } +- }; +- +- static float AudioBufferSumOfSquares(const float* aInput, uint32_t aLength) { +- float sum = 0.f; +- +- if constexpr (Arch::requires_alignment()) { +- while (!is_aligned(aInput)) { +- if (!aLength) { +- return sum; +- } +- sum += *aInput * *aInput; +- ++aInput; +- --aLength; +- } +- } +- +- MOZ_ASSERT(is_aligned(aInput), "aInput is aligned"); +- +- constexpr uint32_t unroll_factor = 4; +- xsimd::batch accs[unroll_factor] = {0.f, 0.f, 0.f, 0.f}; +- +- uint32_t vLength = +- aLength & ~(unroll_factor * xsimd::batch::size - 1); ++ float* aOutput, uint32_t aSize); + +- for (uint32_t i = 0; i < vLength; +- i += unroll_factor * xsimd::batch::size) { +- MOZ_UNROLL(4) +- for (uint32_t j = 0; j < unroll_factor; ++j) { +- auto in = xsimd::batch::load_aligned( +- &aInput[i + xsimd::batch::size * j]); +- accs[j] = xsimd::fma(in, in, accs[j]); +- } +- } +- +- sum += reduce_add((accs[0] + accs[1]) + (accs[2] + accs[3])); +- for (uint32_t i = vLength; i < aLength; ++i) sum += aInput[i] * aInput[i]; +- return sum; +- }; ++ static float AudioBufferSumOfSquares(const float* aInput, uint32_t aLength); + +- static void NaNToZeroInPlace(float* aSamples, size_t aCount) { +- if constexpr (Arch::requires_alignment()) { +- while (!is_aligned(aSamples)) { +- if (!aCount) { +- return; +- } +- if (*aSamples != *aSamples) { +- *aSamples = 0.0; +- } +- ++aSamples; +- --aCount; +- } +- } +- +- MOZ_ASSERT(is_aligned(aSamples), "aSamples is aligned"); +- +- uint32_t vCount = aCount & ~(xsimd::batch::size - 1); +- +- MOZ_UNROLL(4) +- for (uint32_t i = 0; i < vCount; i += xsimd::batch::size) { +- auto vin = xsimd::batch::load_aligned(&aSamples[i]); +- auto vout = +- xsimd::select(xsimd::isnan(vin), xsimd::batch(0.f), vin); +- vout.store_aligned(&aSamples[i]); +- } +- +- for (uint32_t i = vCount; i < aCount; i++) { +- if (aSamples[i] != aSamples[i]) { +- aSamples[i] = 0.0; +- } +- } +- }; ++ static void NaNToZeroInPlace(float* aSamples, size_t aCount); + + static void AudioBlockPanStereoToStereo( + const float aInputL[WEBAUDIO_BLOCK_SIZE], + const float aInputR[WEBAUDIO_BLOCK_SIZE], + const float aGainL[WEBAUDIO_BLOCK_SIZE], + const float aGainR[WEBAUDIO_BLOCK_SIZE], + const bool aIsOnTheLeft[WEBAUDIO_BLOCK_SIZE], +- float aOutputL[WEBAUDIO_BLOCK_SIZE], +- float aOutputR[WEBAUDIO_BLOCK_SIZE]) { +- MOZ_ASSERT(is_aligned(aInputL), "aInputL is aligned"); +- MOZ_ASSERT(is_aligned(aInputR), "aInputR is aligned"); +- MOZ_ASSERT(is_aligned(aGainL), "aGainL is aligned"); +- MOZ_ASSERT(is_aligned(aGainR), "aGainR is aligned"); +- MOZ_ASSERT(is_aligned(aIsOnTheLeft), "aIsOnTheLeft is aligned"); +- MOZ_ASSERT(is_aligned(aOutputL), "aOutputL is aligned"); +- MOZ_ASSERT(is_aligned(aOutputR), "aOutputR is aligned"); +- +- MOZ_ASSERT((WEBAUDIO_BLOCK_SIZE % xsimd::batch::size == 0), +- "requires tail processing"); +- +- MOZ_UNROLL(2) +- for (uint32_t i = 0; i < WEBAUDIO_BLOCK_SIZE; +- i += xsimd::batch::size) { +- auto mask = +- xsimd::batch_bool::load_aligned(&aIsOnTheLeft[i]); +- +- auto inputL = xsimd::batch::load_aligned(&aInputL[i]); +- auto inputR = xsimd::batch::load_aligned(&aInputR[i]); +- auto gainL = xsimd::batch::load_aligned(&aGainL[i]); +- auto gainR = xsimd::batch::load_aligned(&aGainR[i]); +- +- auto outL_true = xsimd::fma(inputR, gainL, inputL); +- auto outR_true = inputR * gainR; +- +- auto outL_false = inputL * gainL; +- auto outR_false = xsimd::fma(inputL, gainR, inputR); +- +- auto outL = xsimd::select(mask, outL_true, outL_false); +- auto outR = xsimd::select(mask, outR_true, outR_false); +- +- outL.store_aligned(&aOutputL[i]); +- outR.store_aligned(&aOutputR[i]); +- } +- } ++ float aOutputL[WEBAUDIO_BLOCK_SIZE], float aOutputR[WEBAUDIO_BLOCK_SIZE]); + }; + + } // namespace mozilla + + #endif +diff --git a/dom/media/webaudio/AudioNodeEngineGenericImpl.h b/dom/media/webaudio/AudioNodeEngineGenericImpl.h +new file mode 100644 +--- /dev/null ++++ b/dom/media/webaudio/AudioNodeEngineGenericImpl.h +@@ -0,0 +1,341 @@ ++/* -*- mode: c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* this source code form is subject to the terms of the mozilla public ++ * license, v. 2.0. if a copy of the mpl was not distributed with this file, ++ * You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#ifndef MOZILLA_AUDIONODEENGINEGENERICIMPL_H_ ++#define MOZILLA_AUDIONODEENGINEGENERICIMPL_H_ ++ ++#include "AudioNodeEngineGeneric.h" ++#include "AlignmentUtils.h" ++ ++#if defined(__GNUC__) && __GNUC__ > 7 ++# define MOZ_PRAGMA(tokens) _Pragma(#tokens) ++# define MOZ_UNROLL(factor) MOZ_PRAGMA(GCC unroll factor) ++#elif defined(__INTEL_COMPILER) || (defined(__clang__) && __clang_major__ > 3) ++# define MOZ_PRAGMA(tokens) _Pragma(#tokens) ++# define MOZ_UNROLL(factor) MOZ_PRAGMA(unroll factor) ++#else ++# define MOZ_UNROLL(_) ++#endif ++ ++namespace mozilla { ++ ++template ++static bool is_aligned(const void* ptr) { ++ return (reinterpret_cast(ptr) & ++ ~(static_cast(Arch::alignment()) - 1)) == ++ reinterpret_cast(ptr); ++}; ++ ++template ++void Engine::AudioBufferAddWithScale(const float* aInput, float aScale, ++ float* aOutput, uint32_t aSize) { ++ if constexpr (Arch::requires_alignment()) { ++ if (aScale == 1.0f) { ++ while (!is_aligned(aInput) || !is_aligned(aOutput)) { ++ if (!aSize) return; ++ *aOutput += *aInput; ++ ++aOutput; ++ ++aInput; ++ --aSize; ++ } ++ } else { ++ while (!is_aligned(aInput) || !is_aligned(aOutput)) { ++ if (!aSize) return; ++ *aOutput += *aInput * aScale; ++ ++aOutput; ++ ++aInput; ++ --aSize; ++ } ++ } ++ } ++ MOZ_ASSERT(is_aligned(aInput), "aInput is aligned"); ++ MOZ_ASSERT(is_aligned(aOutput), "aOutput is aligned"); ++ ++ xsimd::batch vgain(aScale); ++ ++ uint32_t aVSize = aSize & ~(xsimd::batch::size - 1); ++ MOZ_UNROLL(4) ++ for (unsigned i = 0; i < aVSize; i += xsimd::batch::size) { ++ auto vin1 = xsimd::batch::load_aligned(&aInput[i]); ++ auto vin2 = xsimd::batch::load_aligned(&aOutput[i]); ++ auto vout = xsimd::fma(vin1, vgain, vin2); ++ vout.store_aligned(&aOutput[i]); ++ } ++ ++ for (unsigned i = aVSize; i < aSize; ++i) { ++ aOutput[i] += aInput[i] * aScale; ++ } ++} ++ ++template ++void Engine::AudioBlockCopyChannelWithScale(const float* aInput, ++ float aScale, ++ float* aOutput) { ++ MOZ_ASSERT(is_aligned(aInput), "aInput is aligned"); ++ MOZ_ASSERT(is_aligned(aOutput), "aOutput is aligned"); ++ ++ MOZ_ASSERT((WEBAUDIO_BLOCK_SIZE % xsimd::batch::size == 0), ++ "requires tail processing"); ++ ++ xsimd::batch vgain = (aScale); ++ ++ MOZ_UNROLL(4) ++ for (unsigned i = 0; i < WEBAUDIO_BLOCK_SIZE; ++ i += xsimd::batch::size) { ++ auto vin = xsimd::batch::load_aligned(&aInput[i]); ++ auto vout = vin * vgain; ++ vout.store_aligned(&aOutput[i]); ++ } ++}; ++ ++template ++void Engine::AudioBlockCopyChannelWithScale( ++ const float aInput[WEBAUDIO_BLOCK_SIZE], ++ const float aScale[WEBAUDIO_BLOCK_SIZE], ++ float aOutput[WEBAUDIO_BLOCK_SIZE]) { ++ MOZ_ASSERT(is_aligned(aInput), "aInput is aligned"); ++ MOZ_ASSERT(is_aligned(aOutput), "aOutput is aligned"); ++ MOZ_ASSERT(is_aligned(aScale), "aScale is aligned"); ++ ++ MOZ_ASSERT((WEBAUDIO_BLOCK_SIZE % xsimd::batch::size == 0), ++ "requires tail processing"); ++ ++ MOZ_UNROLL(4) ++ for (unsigned i = 0; i < WEBAUDIO_BLOCK_SIZE; ++ i += xsimd::batch::size) { ++ auto vscaled = xsimd::batch::load_aligned(&aScale[i]); ++ auto vin = xsimd::batch::load_aligned(&aInput[i]); ++ auto vout = vin * vscaled; ++ vout.store_aligned(&aOutput[i]); ++ } ++}; ++ ++template ++void Engine::AudioBufferInPlaceScale(float* aBlock, float aScale, ++ uint32_t aSize) { ++ MOZ_ASSERT(is_aligned(aBlock), "aBlock is aligned"); ++ ++ xsimd::batch vgain(aScale); ++ ++ uint32_t aVSize = aSize & ~(xsimd::batch::size - 1); ++ MOZ_UNROLL(4) ++ for (unsigned i = 0; i < aVSize; i += xsimd::batch::size) { ++ auto vin = xsimd::batch::load_aligned(&aBlock[i]); ++ auto vout = vin * vgain; ++ vout.store_aligned(&aBlock[i]); ++ } ++ for (unsigned i = aVSize; i < aSize; ++i) aBlock[i] *= aScale; ++}; ++ ++template ++void Engine::AudioBufferInPlaceScale(float* aBlock, float* aScale, ++ uint32_t aSize) { ++ MOZ_ASSERT(is_aligned(aBlock), "aBlock is aligned"); ++ MOZ_ASSERT(is_aligned(aScale), "aScale is aligned"); ++ ++ uint32_t aVSize = aSize & ~(xsimd::batch::size - 1); ++ MOZ_UNROLL(4) ++ for (unsigned i = 0; i < aVSize; i += xsimd::batch::size) { ++ auto vin = xsimd::batch::load_aligned(&aBlock[i]); ++ auto vgain = xsimd::batch::load_aligned(&aScale[i]); ++ auto vout = vin * vgain; ++ vout.store_aligned(&aBlock[i]); ++ } ++ for (uint32_t i = aVSize; i < aSize; ++i) { ++ *aBlock++ *= *aScale++; ++ } ++}; ++ ++template ++void Engine::AudioBlockPanStereoToStereo( ++ const float aInputL[WEBAUDIO_BLOCK_SIZE], ++ const float aInputR[WEBAUDIO_BLOCK_SIZE], float aGainL, float aGainR, ++ bool aIsOnTheLeft, float aOutputL[WEBAUDIO_BLOCK_SIZE], ++ float aOutputR[WEBAUDIO_BLOCK_SIZE]) { ++ MOZ_ASSERT(is_aligned(aInputL), "aInputL is aligned"); ++ MOZ_ASSERT(is_aligned(aInputR), "aInputR is aligned"); ++ MOZ_ASSERT(is_aligned(aOutputL), "aOutputL is aligned"); ++ MOZ_ASSERT(is_aligned(aOutputR), "aOutputR is aligned"); ++ ++ MOZ_ASSERT((WEBAUDIO_BLOCK_SIZE % xsimd::batch::size == 0), ++ "requires tail processing"); ++ ++ xsimd::batch vgainl(aGainL); ++ xsimd::batch vgainr(aGainR); ++ ++ if (aIsOnTheLeft) { ++ MOZ_UNROLL(2) ++ for (unsigned i = 0; i < WEBAUDIO_BLOCK_SIZE; ++ i += xsimd::batch::size) { ++ auto vinl = xsimd::batch::load_aligned(&aInputL[i]); ++ auto vinr = xsimd::batch::load_aligned(&aInputR[i]); ++ ++ /* left channel : aOutputL = aInputL + aInputR * gainL */ ++ auto vout = xsimd::fma(vinr, vgainl, vinl); ++ vout.store_aligned(&aOutputL[i]); ++ ++ /* right channel : aOutputR = aInputR * gainR */ ++ auto vscaled = vinr * vgainr; ++ vscaled.store_aligned(&aOutputR[i]); ++ } ++ } else { ++ MOZ_UNROLL(2) ++ for (unsigned i = 0; i < WEBAUDIO_BLOCK_SIZE; ++ i += xsimd::batch::size) { ++ auto vinl = xsimd::batch::load_aligned(&aInputL[i]); ++ auto vinr = xsimd::batch::load_aligned(&aInputR[i]); ++ ++ /* left channel : aInputL * gainL */ ++ auto vscaled = vinl * vgainl; ++ vscaled.store_aligned(&aOutputL[i]); ++ ++ /* right channel: aOutputR = aInputR + aInputL * gainR */ ++ auto vout = xsimd::fma(vinl, vgainr, vinr); ++ vout.store_aligned(&aOutputR[i]); ++ } ++ } ++}; ++ ++template ++void Engine::BufferComplexMultiply(const float* aInput, ++ const float* aScale, float* aOutput, ++ uint32_t aSize) { ++ MOZ_ASSERT(is_aligned(aInput), "aInput is aligned"); ++ MOZ_ASSERT(is_aligned(aOutput), "aOutput is aligned"); ++ MOZ_ASSERT(is_aligned(aScale), "aScale is aligned"); ++ MOZ_ASSERT((aSize % xsimd::batch::size == 0), ++ "requires tail processing"); ++ ++ MOZ_UNROLL(2) ++ for (unsigned i = 0; i < aSize * 2; ++ i += 2 * xsimd::batch, Arch>::size) { ++ auto in1 = xsimd::batch, Arch>::load_aligned( ++ reinterpret_cast*>(&aInput[i])); ++ auto in2 = xsimd::batch, Arch>::load_aligned( ++ reinterpret_cast*>(&aScale[i])); ++ auto out = in1 * in2; ++ out.store_aligned(reinterpret_cast*>(&aOutput[i])); ++ } ++}; ++ ++template ++float Engine::AudioBufferSumOfSquares(const float* aInput, ++ uint32_t aLength) { ++ float sum = 0.f; ++ ++ if constexpr (Arch::requires_alignment()) { ++ while (!is_aligned(aInput)) { ++ if (!aLength) { ++ return sum; ++ } ++ sum += *aInput * *aInput; ++ ++aInput; ++ --aLength; ++ } ++ } ++ ++ MOZ_ASSERT(is_aligned(aInput), "aInput is aligned"); ++ ++ constexpr uint32_t unroll_factor = 4; ++ xsimd::batch accs[unroll_factor] = {0.f, 0.f, 0.f, 0.f}; ++ ++ uint32_t vLength = ++ aLength & ~(unroll_factor * xsimd::batch::size - 1); ++ ++ for (uint32_t i = 0; i < vLength; ++ i += unroll_factor * xsimd::batch::size) { ++ MOZ_UNROLL(4) ++ for (uint32_t j = 0; j < unroll_factor; ++j) { ++ auto in = xsimd::batch::load_aligned( ++ &aInput[i + xsimd::batch::size * j]); ++ accs[j] = xsimd::fma(in, in, accs[j]); ++ } ++ } ++ ++ sum += reduce_add((accs[0] + accs[1]) + (accs[2] + accs[3])); ++ for (uint32_t i = vLength; i < aLength; ++i) sum += aInput[i] * aInput[i]; ++ return sum; ++}; ++ ++template ++void Engine::NaNToZeroInPlace(float* aSamples, size_t aCount) { ++ if constexpr (Arch::requires_alignment()) { ++ while (!is_aligned(aSamples)) { ++ if (!aCount) { ++ return; ++ } ++ if (*aSamples != *aSamples) { ++ *aSamples = 0.0; ++ } ++ ++aSamples; ++ --aCount; ++ } ++ } ++ ++ MOZ_ASSERT(is_aligned(aSamples), "aSamples is aligned"); ++ ++ uint32_t vCount = aCount & ~(xsimd::batch::size - 1); ++ ++ MOZ_UNROLL(4) ++ for (uint32_t i = 0; i < vCount; i += xsimd::batch::size) { ++ auto vin = xsimd::batch::load_aligned(&aSamples[i]); ++ auto vout = ++ xsimd::select(xsimd::isnan(vin), xsimd::batch(0.f), vin); ++ vout.store_aligned(&aSamples[i]); ++ } ++ ++ for (uint32_t i = vCount; i < aCount; i++) { ++ if (aSamples[i] != aSamples[i]) { ++ aSamples[i] = 0.0; ++ } ++ } ++}; ++ ++template ++void Engine::AudioBlockPanStereoToStereo( ++ const float aInputL[WEBAUDIO_BLOCK_SIZE], ++ const float aInputR[WEBAUDIO_BLOCK_SIZE], ++ const float aGainL[WEBAUDIO_BLOCK_SIZE], ++ const float aGainR[WEBAUDIO_BLOCK_SIZE], ++ const bool aIsOnTheLeft[WEBAUDIO_BLOCK_SIZE], ++ float aOutputL[WEBAUDIO_BLOCK_SIZE], float aOutputR[WEBAUDIO_BLOCK_SIZE]) { ++ MOZ_ASSERT(is_aligned(aInputL), "aInputL is aligned"); ++ MOZ_ASSERT(is_aligned(aInputR), "aInputR is aligned"); ++ MOZ_ASSERT(is_aligned(aGainL), "aGainL is aligned"); ++ MOZ_ASSERT(is_aligned(aGainR), "aGainR is aligned"); ++ MOZ_ASSERT(is_aligned(aIsOnTheLeft), "aIsOnTheLeft is aligned"); ++ MOZ_ASSERT(is_aligned(aOutputL), "aOutputL is aligned"); ++ MOZ_ASSERT(is_aligned(aOutputR), "aOutputR is aligned"); ++ ++ MOZ_ASSERT((WEBAUDIO_BLOCK_SIZE % xsimd::batch::size == 0), ++ "requires tail processing"); ++ ++ MOZ_UNROLL(2) ++ for (uint32_t i = 0; i < WEBAUDIO_BLOCK_SIZE; ++ i += xsimd::batch::size) { ++ auto mask = xsimd::batch_bool::load_aligned(&aIsOnTheLeft[i]); ++ ++ auto inputL = xsimd::batch::load_aligned(&aInputL[i]); ++ auto inputR = xsimd::batch::load_aligned(&aInputR[i]); ++ auto gainL = xsimd::batch::load_aligned(&aGainL[i]); ++ auto gainR = xsimd::batch::load_aligned(&aGainR[i]); ++ ++ auto outL_true = xsimd::fma(inputR, gainL, inputL); ++ auto outR_true = inputR * gainR; ++ ++ auto outL_false = inputL * gainL; ++ auto outR_false = xsimd::fma(inputL, gainR, inputR); ++ ++ auto outL = xsimd::select(mask, outL_true, outL_false); ++ auto outR = xsimd::select(mask, outR_true, outR_false); ++ ++ outL.store_aligned(&aOutputL[i]); ++ outR.store_aligned(&aOutputR[i]); ++ } ++} ++ ++} // namespace mozilla ++ ++#endif +diff --git a/dom/media/webaudio/AudioNodeEngineNEON.cpp b/dom/media/webaudio/AudioNodeEngineNEON.cpp +--- a/dom/media/webaudio/AudioNodeEngineNEON.cpp ++++ b/dom/media/webaudio/AudioNodeEngineNEON.cpp +@@ -1,9 +1,9 @@ + /* -*- mode: c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ + /* this source code form is subject to the terms of the mozilla public + * license, v. 2.0. if a copy of the mpl was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +-#include "AudioNodeEngineGeneric.h" ++#include "AudioNodeEngineGenericImpl.h" + namespace mozilla { + template struct Engine; + } // namespace mozilla +diff --git a/dom/media/webaudio/AudioNodeEngineSSE2.cpp b/dom/media/webaudio/AudioNodeEngineSSE2.cpp +--- a/dom/media/webaudio/AudioNodeEngineSSE2.cpp ++++ b/dom/media/webaudio/AudioNodeEngineSSE2.cpp +@@ -1,10 +1,10 @@ + /* -*- mode: c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ + /* this source code form is subject to the terms of the mozilla public + * license, v. 2.0. if a copy of the mpl was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +-#include "AudioNodeEngineGeneric.h" ++#include "AudioNodeEngineGenericImpl.h" + + namespace mozilla { + template struct Engine; + } // namespace mozilla +diff --git a/dom/media/webaudio/AudioNodeEngineSSE4_2_FMA3.cpp b/dom/media/webaudio/AudioNodeEngineSSE4_2_FMA3.cpp +--- a/dom/media/webaudio/AudioNodeEngineSSE4_2_FMA3.cpp ++++ b/dom/media/webaudio/AudioNodeEngineSSE4_2_FMA3.cpp +@@ -1,10 +1,10 @@ + /* -*- mode: c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ + /* this source code form is subject to the terms of the mozilla public + * license, v. 2.0. if a copy of the mpl was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +-#include "AudioNodeEngineGeneric.h" ++#include "AudioNodeEngineGenericImpl.h" + + namespace mozilla { + template struct Engine>; + } // namespace mozilla + diff --git a/firefox.spec b/firefox.spec index 7e3c04d..fd31897 100644 --- a/firefox.spec +++ b/firefox.spec @@ -227,6 +227,7 @@ Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch78: firefox-i686-build.patch Patch79: firefox-gcc-13-build.patch Patch80: D172126.diff +Patch81: D172864.diff # Test patches # Generate without context by @@ -505,6 +506,7 @@ This package contains results of tests executed during build. %patch78 -p1 -b .firefox-i686 %patch79 -p1 -b .firefox-gcc-13-build %patch80 -p1 -b .D172126 +%patch81 -p1 -b .D172864 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell From 7289b9e9a76c4ae942bf793e0499e03daa6394b2 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 22 Mar 2023 14:23:26 +0100 Subject: [PATCH 185/545] Update to 111.0.1 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 8787abe..9ffbab8 100644 --- a/.gitignore +++ b/.gitignore @@ -562,3 +562,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-110.0-20230214.tar.xz /firefox-111.0.source.tar.xz /firefox-langpacks-111.0-20230320.tar.xz +/firefox-langpacks-111.0.1-20230322.tar.xz +/firefox-111.0.1.source.tar.xz diff --git a/firefox.spec b/firefox.spec index fd31897..b1b0151 100644 --- a/firefox.spec +++ b/firefox.spec @@ -172,8 +172,8 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 111.0 -Release: 3%{?pre_tag}%{?dist} +Version: 111.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1078,6 +1078,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Mar 22 2023 Martin Stransky - 111.0.1-1 +- Updated to 111.0.1 + * Tue Mar 21 2023 Jan Grulich - 111.0-3 - libwebrtc: backport upstream fix/improvement for DmaBuf screen sharing diff --git a/sources b/sources index 5381384..e86a461 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 -SHA512 (firefox-111.0.source.tar.xz) = cdb300fdbb2b60068b0fc10a18df587b417e484901d36f52dd174d320d3440a42b02ea000f325c5781fd8853a5171b1a5184562fb535ece90619e4c64d46bb82 -SHA512 (firefox-langpacks-111.0-20230320.tar.xz) = 754bcc39c969c820c395bf5c67132d2468862e7b0638efb48cda6484e32aa18a807400a766b8a28f850e39684a25c4286aa359451d233a62ed0c545d64135209 +SHA512 (firefox-langpacks-111.0.1-20230322.tar.xz) = 31ead897438ef722742b62c141023351875ac1e339409a9eb02ee639984d2f8409cb9c6751f34a2b2df82ccfa78135fb684b9b41112e6c19ec0d8896c19a4586 +SHA512 (firefox-111.0.1.source.tar.xz) = b16c9399a19cb1de2d865a023d54fbe71c23a363ea4d36cd58f41f64f7ad04bc1b9d8a8448943417516e17337e0ee2afd370c29a72b51b0947161f4ffab6935f From a67d903dec04dbc261030b5ef0499fb806f95666 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 23 Mar 2023 12:56:07 +0100 Subject: [PATCH 186/545] Build fix --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index b1b0151..523f3fa 100644 --- a/firefox.spec +++ b/firefox.spec @@ -178,7 +178,7 @@ URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230320.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230322.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig From eaaa442861b3d359a5a3eac80440b92a41683417 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Tue, 4 Apr 2023 20:02:12 -0700 Subject: [PATCH 187/545] Also undefine _package_note_status (#2184553) Only undefining _package_note_flags causes build failure. See https://bugzilla.redhat.com/show_bug.cgi?id=2184553 for more details. Signed-off-by: Adam Williamson --- firefox.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/firefox.spec b/firefox.spec index 523f3fa..c9e6eee 100644 --- a/firefox.spec +++ b/firefox.spec @@ -169,6 +169,8 @@ ExcludeArch: i686 %global __requires_exclude ^(%%(find %{buildroot}%{mozappdir} -name '*.so' | xargs -n1 basename | sort -u | paste -s -d '|' -)) %undefine _package_note_flags +# for https://bugzilla.redhat.com/show_bug.cgi?id=2184553 +%undefine _package_note_status Summary: Mozilla Firefox Web browser Name: firefox From 46be314a6e07c6c2714d60d866e6920bf9c3fd80 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Tue, 4 Apr 2023 20:07:00 -0700 Subject: [PATCH 188/545] Actually, set _package_note_status to 0 --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index c9e6eee..6bb50a4 100644 --- a/firefox.spec +++ b/firefox.spec @@ -170,7 +170,7 @@ ExcludeArch: i686 %undefine _package_note_flags # for https://bugzilla.redhat.com/show_bug.cgi?id=2184553 -%undefine _package_note_status +%global _package_note_status 0 Summary: Mozilla Firefox Web browser Name: firefox From 18483fc2bbfc43bd6dd9896771bf0eadb6bc696c Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 5 Apr 2023 10:46:34 +0200 Subject: [PATCH 189/545] Don't override MOZ_USE_XINPUT2 in startup script (hrbz#2184297) by GalaxyMaster --- firefox.sh.in | 2 +- firefox.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/firefox.sh.in b/firefox.sh.in index 5fef0b2..078627f 100644 --- a/firefox.sh.in +++ b/firefox.sh.in @@ -160,7 +160,7 @@ export G_SLICE=always-malloc ## ## Enable Xinput2 (mozbz#1207973) ## -export MOZ_USE_XINPUT2=1 +export MOZ_USE_XINPUT2=${MOZ_USE_XINPUT2-1} # OK, here's where all the real work gets done diff --git a/firefox.spec b/firefox.spec index 523f3fa..fb264c6 100644 --- a/firefox.spec +++ b/firefox.spec @@ -173,7 +173,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 111.0.1 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1078,6 +1078,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Apr 5 2023 Martin Stransky - 111.0.1-2 +- Don't override MOZ_USE_XINPUT2 in startup script (hrbz#2184297) by GalaxyMaster + * Wed Mar 22 2023 Martin Stransky - 111.0.1-1 - Updated to 111.0.1 From afd2fc66a8a584cf120d04439e2e311fdb60fad7 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 5 Apr 2023 13:04:27 +0200 Subject: [PATCH 190/545] Update to 112.0 --- .gitignore | 2 ++ firefox-enable-vaapi.patch | 14 ++++++-------- firefox.spec | 19 ++++++++++--------- sources | 4 ++-- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 9ffbab8..a2d87d9 100644 --- a/.gitignore +++ b/.gitignore @@ -564,3 +564,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-111.0-20230320.tar.xz /firefox-langpacks-111.0.1-20230322.tar.xz /firefox-111.0.1.source.tar.xz +/firefox-112.0.source.tar.xz +/firefox-langpacks-112.0-20230405.tar.xz diff --git a/firefox-enable-vaapi.patch b/firefox-enable-vaapi.patch index ddf30d1..dbe92bc 100644 --- a/firefox-enable-vaapi.patch +++ b/firefox-enable-vaapi.patch @@ -1,8 +1,7 @@ -diff -up firefox-104.0/gfx/thebes/gfxPlatformGtk.cpp.firefox-enable-vaapi firefox-104.0/gfx/thebes/gfxPlatformGtk.cpp -diff -up firefox-104.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi firefox-104.0/widget/gtk/GfxInfo.cpp ---- firefox-104.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi 2022-08-16 15:14:53.014042400 +0200 -+++ firefox-104.0/widget/gtk/GfxInfo.cpp 2022-08-16 15:15:30.482301677 +0200 -@@ -873,15 +873,6 @@ const nsTArray& GfxInfo:: +diff -up firefox-112.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi firefox-112.0/widget/gtk/GfxInfo.cpp +--- firefox-112.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi 2023-04-05 11:10:14.156695694 +0200 ++++ firefox-112.0/widget/gtk/GfxInfo.cpp 2023-04-05 11:11:40.697665718 +0200 +@@ -810,14 +810,6 @@ const nsTArray& GfxInfo:: nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0), "FEATURE_HARDWARE_VIDEO_DECODING_NO_LINUX_AMD", ""); @@ -14,7 +13,6 @@ diff -up firefox-104.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi firefox-104.0 - DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0), - "FEATURE_HARDWARE_VIDEO_DECODING_DISABLE", ""); -#endif -- //////////////////////////////////// - // FEATURE_WEBRENDER_PARTIAL_PRESENT - APPEND_TO_DRIVER_BLOCKLIST_EXT( + // FEATURE_HW_DECODED_VIDEO_ZERO_COPY - ALLOWLIST + APPEND_TO_DRIVER_BLOCKLIST2(OperatingSystem::Linux, DeviceFamily::All, diff --git a/firefox.spec b/firefox.spec index a37e9f7..2efa325 100644 --- a/firefox.spec +++ b/firefox.spec @@ -174,13 +174,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 111.0.1 -Release: 2%{?pre_tag}%{?dist} +Version: 112.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230322.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230405.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -228,8 +228,8 @@ Patch61: firefox-glibc-dynstack.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch78: firefox-i686-build.patch Patch79: firefox-gcc-13-build.patch -Patch80: D172126.diff -Patch81: D172864.diff +#Patch80: D172126.diff +#Patch81: D172864.diff # Test patches # Generate without context by @@ -242,7 +242,6 @@ Patch102: firefox-tests-xpcshell-freeze.patch # Fedora specific patches Patch215: firefox-enable-addons.patch Patch219: rhbz-1173156.patch -Patch224: D168799.diff #ARM run-time patch Patch226: rhbz-1354671.patch Patch228: disable-openh264-download.patch @@ -507,8 +506,8 @@ This package contains results of tests executed during build. %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch78 -p1 -b .firefox-i686 %patch79 -p1 -b .firefox-gcc-13-build -%patch80 -p1 -b .D172126 -%patch81 -p1 -b .D172864 +#%patch80 -p1 -b .D172126 +#%patch81 -p1 -b .D172864 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -518,7 +517,6 @@ This package contains results of tests executed during build. # Fedora patches %patch215 -p1 -b .addons %patch219 -p1 -b .rhbz-1173156 -%patch224 -p1 -b .D168799.diff #ARM run-time patch %ifarch aarch64 %patch226 -p1 -b .1354671 @@ -1080,6 +1078,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Apr 5 2023 Martin Stransky - 112.0-1 +- Updated to 112.0 + * Wed Apr 5 2023 Martin Stransky - 111.0.1-2 - Don't override MOZ_USE_XINPUT2 in startup script (hrbz#2184297) by GalaxyMaster diff --git a/sources b/sources index e86a461..b02b339 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 -SHA512 (firefox-langpacks-111.0.1-20230322.tar.xz) = 31ead897438ef722742b62c141023351875ac1e339409a9eb02ee639984d2f8409cb9c6751f34a2b2df82ccfa78135fb684b9b41112e6c19ec0d8896c19a4586 -SHA512 (firefox-111.0.1.source.tar.xz) = b16c9399a19cb1de2d865a023d54fbe71c23a363ea4d36cd58f41f64f7ad04bc1b9d8a8448943417516e17337e0ee2afd370c29a72b51b0947161f4ffab6935f +SHA512 (firefox-112.0.source.tar.xz) = 4e394acce877e86282a57da6e9a90b3dc7025aa0bc243dde9f7d5dec20de7e3ed6a330ae8e8d459193b83e1fbf695214b333055815825d5f3fc120287249b387 +SHA512 (firefox-langpacks-112.0-20230405.tar.xz) = 67ac240a3cc079b0b8ffe89268e352cc789f36ba6f1fca5a3872bb1c8cf6f8b3ca3722349f6d2dc853577a4aebfbaa681980b8327369b9a99c2a8091d38340e7 From 24c9accce19c5cae9394430b24eaf938a9c17882 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 5 Apr 2023 09:55:42 -0700 Subject: [PATCH 191/545] Add a patch to fix the RUSTFLAGS parsing issue (#2184743) --- firefox-112.0-commasplit.patch | 76 ++++++++++++++++++++++++++++++++++ firefox.spec | 7 ++++ 2 files changed, 83 insertions(+) create mode 100644 firefox-112.0-commasplit.patch diff --git a/firefox-112.0-commasplit.patch b/firefox-112.0-commasplit.patch new file mode 100644 index 0000000..a56aec4 --- /dev/null +++ b/firefox-112.0-commasplit.patch @@ -0,0 +1,76 @@ +--- firefox-111.0.1/build/moz.configure/rust.configure 2023-03-21 06:16:03.000000000 -0700 ++++ firefox-111.0.1/build/moz.configure/rust.configure.new 2023-04-05 08:57:29.403219120 -0700 +@@ -593,7 +593,7 @@ + + # ============================================================== + +-option(env="RUSTFLAGS", nargs=1, help="Rust compiler flags") ++option(env="RUSTFLAGS", nargs=1, help="Rust compiler flags", comma_split=False) + set_config("RUSTFLAGS", depends("RUSTFLAGS")(lambda flags: flags)) + + +--- firefox-111.0.1/python/mozbuild/mozbuild/configure/options.py 2023-03-21 06:16:09.000000000 -0700 ++++ firefox-111.0.1/python/mozbuild/mozbuild/configure/options.py.new 2023-04-05 08:57:31.270193468 -0700 +@@ -191,6 +191,10 @@ + to instantiate an option indirectly. Set this to a positive integer to + force the script to look into a deeper stack frame when inferring the + `category`. ++ - `comma_split` specifies whether the value string should be split on ++ commas. The default is True. Setting it False is necessary for things ++ like compiler flags which should be a single string that may contain ++ commas. + """ + + __slots__ = ( +@@ -205,6 +209,7 @@ + "possible_origins", + "category", + "define_depth", ++ "comma_split", + ) + + def __init__( +@@ -218,6 +223,7 @@ + category=None, + help=None, + define_depth=0, ++ comma_split=True, + ): + if not name and not env: + raise InvalidOptionError( +@@ -335,9 +341,10 @@ + self.choices = choices + self.help = help + self.category = category or _infer_option_category(define_depth) ++ self.comma_split = comma_split + + @staticmethod +- def split_option(option): ++ def split_option(option, comma_split=True): + """Split a flag or variable into a prefix, a name and values + + Variables come in the form NAME=values (no prefix). +@@ -350,7 +357,13 @@ + + elements = option.split("=", 1) + name = elements[0] +- values = tuple(elements[1].split(",")) if len(elements) == 2 else () ++ if len(elements) == 2: ++ if comma_split: ++ values = tuple(elements[1].split(",")) ++ else: ++ values = (elements[1],) ++ else: ++ values = () + if name.startswith("--"): + name = name[2:] + if not name.islower(): +@@ -426,7 +439,7 @@ + % (option, origin, ", ".join(self.possible_origins)) + ) + +- prefix, name, values = self.split_option(option) ++ prefix, name, values = self.split_option(option, self.comma_split) + option = self._join_option(prefix, name) + + assert name in (self.name, self.env) diff --git a/firefox.spec b/firefox.spec index 2efa325..b5ca352 100644 --- a/firefox.spec +++ b/firefox.spec @@ -266,6 +266,12 @@ Patch990: work-around-GCC-ICE-on-arm.patch # Work around broken moz.build file on ppc64le (mozb#1779545, mozb#1775202) Patch1100: mozilla-1775202.patch +# tentative patch for RUSTFLAGS parsing issue: +# https://bugzilla.redhat.com/show_bug.cgi?id=2184743 +# https://bugzilla.mozilla.org/show_bug.cgi?id=1474486 +# not upstreaming till I'm more sure it's correct +Patch1200: firefox-112.0-commasplit.patch + %if %{?system_nss} BuildRequires: pkgconfig(nspr) >= %{nspr_version} BuildRequires: pkgconfig(nss) >= %{nss_version} @@ -541,6 +547,7 @@ This package contains results of tests executed during build. %patch990 -p1 -b .work-around-GCC-ICE-on-arm %patch1100 -p1 -b .ppc-mobzuild +%patch1200 -p1 -b .rustflags-commasplit rm -f .mozconfig cp %{SOURCE10} .mozconfig From d698bc4eecf286ce88b4ac8d1bb0f5456b60bf7f Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 6 Apr 2023 19:46:36 +0200 Subject: [PATCH 192/545] Updated to build 2, added fix for mzbz#1826583/rhbz#2184842 --- .gitignore | 1 + firefox.spec | 10 ++++++++-- mozilla-1826583.patch | 14 ++++++++++++++ sources | 4 ++-- 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 mozilla-1826583.patch diff --git a/.gitignore b/.gitignore index a2d87d9..9e55811 100644 --- a/.gitignore +++ b/.gitignore @@ -566,3 +566,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-111.0.1.source.tar.xz /firefox-112.0.source.tar.xz /firefox-langpacks-112.0-20230405.tar.xz +/firefox-langpacks-112.0-20230406.tar.xz diff --git a/firefox.spec b/firefox.spec index 2efa325..a3aa983 100644 --- a/firefox.spec +++ b/firefox.spec @@ -175,12 +175,12 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 112.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230405.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230406.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -255,6 +255,7 @@ Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch # https://phabricator.services.mozilla.com/D173021 Patch416: libwebrtc-pipewire-capturer-import-dmabuf-directly-into-desktop-frame.patch +Patch417: mozilla-1826583.patch # PGO/LTO patches Patch600: pgo.patch @@ -530,6 +531,7 @@ This package contains results of tests executed during build. %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 %patch416 -p1 -b .libwebrtc-pipewire-capturer-import-dmabuf-directly-into-desktop-frame +%patch417 -p1 -b .1826583 # PGO patches %if %{build_with_pgo} @@ -1078,6 +1080,10 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Apr 6 2023 Martin Stransky - 112.0-2 +- Updated to 112.0 build 2 +- don't crash on wayland logging (mzbz#1826583/rhbz#2184842). + * Wed Apr 5 2023 Martin Stransky - 112.0-1 - Updated to 112.0 diff --git a/mozilla-1826583.patch b/mozilla-1826583.patch new file mode 100644 index 0000000..52a2947 --- /dev/null +++ b/mozilla-1826583.patch @@ -0,0 +1,14 @@ +diff -up firefox-112.0/widget/gtk/nsWaylandDisplay.cpp.old firefox-112.0/widget/gtk/nsWaylandDisplay.cpp +--- firefox-112.0/widget/gtk/nsWaylandDisplay.cpp.old 2023-04-06 19:35:44.744731593 +0200 ++++ firefox-112.0/widget/gtk/nsWaylandDisplay.cpp 2023-04-06 19:35:23.650016723 +0200 +@@ -271,8 +271,8 @@ bool nsWaylandDisplay::Matches(wl_displa + return mThreadId == PR_GetCurrentThread() && aDisplay == mDisplay; + } + +-static void WlCrashHandler(const char* format, va_list args) { +- MOZ_CRASH_UNSAFE(g_strdup_vprintf(format, args)); ++static void WlCrashHandler(const char* format, va_list args) { ++ vfprintf(stderr, format, args); + } + + nsWaylandDisplay::nsWaylandDisplay(wl_display* aDisplay) diff --git a/sources b/sources index b02b339..9549e8a 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 -SHA512 (firefox-112.0.source.tar.xz) = 4e394acce877e86282a57da6e9a90b3dc7025aa0bc243dde9f7d5dec20de7e3ed6a330ae8e8d459193b83e1fbf695214b333055815825d5f3fc120287249b387 -SHA512 (firefox-langpacks-112.0-20230405.tar.xz) = 67ac240a3cc079b0b8ffe89268e352cc789f36ba6f1fca5a3872bb1c8cf6f8b3ca3722349f6d2dc853577a4aebfbaa681980b8327369b9a99c2a8091d38340e7 +SHA512 (firefox-langpacks-112.0-20230406.tar.xz) = 11870eec9947b11be404016b6426f13c86b37be7d0021bf7ae640151d17df35212bfb4c1c14aef5948dcd49312b47daf582f2367f5ba4d2f81dfc8ce64d9609d +SHA512 (firefox-112.0.source.tar.xz) = 6b2bc8c0c93f3109da27168fe7e8f734c6ab4efb4ca56ff2d5e3a52659da71173bba2104037a000623833be8338621fca482f39f836e3910fe2996e6d0a68b39 From 1449db1d63822d91de268a0ba2d73e72901c9814 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 11 Apr 2023 12:57:42 +0200 Subject: [PATCH 193/545] -m --- pgo.patch | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/pgo.patch b/pgo.patch index eec103c..8d996a2 100644 --- a/pgo.patch +++ b/pgo.patch @@ -1,6 +1,6 @@ -diff -up firefox-99.0/build/moz.configure/lto-pgo.configure.pgo firefox-99.0/build/moz.configure/lto-pgo.configure ---- firefox-99.0/build/moz.configure/lto-pgo.configure.pgo 2022-03-31 01:24:38.000000000 +0200 -+++ firefox-99.0/build/moz.configure/lto-pgo.configure 2022-04-04 10:15:45.387694143 +0200 +diff -up firefox-112.0/build/moz.configure/lto-pgo.configure.pgo firefox-112.0/build/moz.configure/lto-pgo.configure +--- firefox-112.0/build/moz.configure/lto-pgo.configure.pgo 2023-04-06 17:27:38.000000000 +0200 ++++ firefox-112.0/build/moz.configure/lto-pgo.configure 2023-04-06 21:27:32.537089073 +0200 @@ -247,8 +247,8 @@ def lto( cflags.append("-flto") ldflags.append("-flto") @@ -21,15 +21,15 @@ diff -up firefox-99.0/build/moz.configure/lto-pgo.configure.pgo firefox-99.0/bui # With clang-cl, -flto can only be used with -c or -fuse-ld=lld. # AC_TRY_LINKs during configure don't have -c, so pass -fuse-ld=lld. cflags.append("-fuse-ld=lld") -diff -up firefox-99.0/build/pgo/profileserver.py.pgo firefox-99.0/build/pgo/profileserver.py ---- firefox-99.0/build/pgo/profileserver.py.pgo 2022-03-31 01:24:38.000000000 +0200 -+++ firefox-99.0/build/pgo/profileserver.py 2022-04-04 10:15:45.387694143 +0200 -@@ -11,7 +11,7 @@ import glob - import subprocess +diff -up firefox-112.0/build/pgo/profileserver.py.pgo firefox-112.0/build/pgo/profileserver.py +--- firefox-112.0/build/pgo/profileserver.py.pgo 2023-04-06 17:27:40.000000000 +0200 ++++ firefox-112.0/build/pgo/profileserver.py 2023-04-06 21:29:33.772294479 +0200 +@@ -11,7 +11,7 @@ import subprocess + import sys import mozcrash --from mozbuild.base import MozbuildObject, BinaryNotFoundException -+from mozbuild.base import MozbuildObject, BinaryNotFoundException, BuildEnvironmentNotFoundException +-from mozbuild.base import BinaryNotFoundException, MozbuildObject ++from mozbuild.base import BinaryNotFoundException, MozbuildObject, BuildEnvironmentNotFoundException from mozfile import TemporaryDirectory from mozhttpd import MozHttpd from mozprofile import FirefoxProfile, Preferences @@ -59,7 +59,7 @@ diff -up firefox-99.0/build/pgo/profileserver.py.pgo firefox-99.0/build/pgo/prof with TemporaryDirectory() as profilePath: # TODO: refactor this into mozprofile -@@ -212,6 +225,10 @@ if __name__ == "__main__": +@@ -213,6 +226,10 @@ if __name__ == "__main__": print("Firefox exited successfully, but produced a crashreport") sys.exit(1) @@ -70,9 +70,9 @@ diff -up firefox-99.0/build/pgo/profileserver.py.pgo firefox-99.0/build/pgo/prof llvm_profdata = env.get("LLVM_PROFDATA") if llvm_profdata: profraw_files = glob.glob("*.profraw") -diff -up firefox-99.0/build/unix/mozconfig.unix.pgo firefox-99.0/build/unix/mozconfig.unix ---- firefox-99.0/build/unix/mozconfig.unix.pgo 2022-03-31 01:24:38.000000000 +0200 -+++ firefox-99.0/build/unix/mozconfig.unix 2022-04-04 10:15:45.387694143 +0200 +diff -up firefox-112.0/build/unix/mozconfig.unix.pgo firefox-112.0/build/unix/mozconfig.unix +--- firefox-112.0/build/unix/mozconfig.unix.pgo 2023-04-06 21:27:32.537089073 +0200 ++++ firefox-112.0/build/unix/mozconfig.unix 2023-04-06 21:28:54.987949124 +0200 @@ -4,6 +4,15 @@ if [ -n "$FORCE_GCC" ]; then CC="$MOZ_FETCHES_DIR/gcc/bin/gcc" CXX="$MOZ_FETCHES_DIR/gcc/bin/g++" @@ -88,20 +88,20 @@ diff -up firefox-99.0/build/unix/mozconfig.unix.pgo firefox-99.0/build/unix/mozc + # We want to make sure we use binutils and other binaries in the tooltool # package. - mk_add_options "export PATH=$MOZ_FETCHES_DIR/gcc/bin:$PATH" -diff -up firefox-99.0/extensions/spellcheck/src/moz.build.pgo firefox-99.0/extensions/spellcheck/src/moz.build ---- firefox-99.0/extensions/spellcheck/src/moz.build.pgo 2022-03-31 01:24:50.000000000 +0200 -+++ firefox-99.0/extensions/spellcheck/src/moz.build 2022-04-04 10:15:45.387694143 +0200 + mk_add_options "export PATH=$MOZ_FETCHES_DIR/gcc/bin:$MOZ_FETCHES_DIR/binutils/bin:$PATH" +diff -up firefox-112.0/extensions/spellcheck/src/moz.build.pgo firefox-112.0/extensions/spellcheck/src/moz.build +--- firefox-112.0/extensions/spellcheck/src/moz.build.pgo 2023-04-06 17:27:41.000000000 +0200 ++++ firefox-112.0/extensions/spellcheck/src/moz.build 2023-04-06 21:27:32.537089073 +0200 @@ -28,3 +28,5 @@ EXPORTS.mozilla += [ "mozInlineSpellChecker.h", "mozSpellChecker.h", ] + +CXXFLAGS += ['-fno-devirtualize'] -diff -up firefox-99.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-99.0/toolkit/components/terminator/nsTerminator.cpp ---- firefox-99.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2022-04-04 10:15:45.387694143 +0200 -+++ firefox-99.0/toolkit/components/terminator/nsTerminator.cpp 2022-04-04 10:19:07.022239556 +0200 -@@ -466,6 +466,11 @@ void nsTerminator::StartWatchdog() { +diff -up firefox-112.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-112.0/toolkit/components/terminator/nsTerminator.cpp +--- firefox-112.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2023-04-06 17:27:57.000000000 +0200 ++++ firefox-112.0/toolkit/components/terminator/nsTerminator.cpp 2023-04-06 21:27:32.538089108 +0200 +@@ -460,6 +460,11 @@ void nsTerminator::StartWatchdog() { } #endif From 9f85dc3c2560fcf10b5ce349ace9215f88c7ac25 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 11 Apr 2023 16:51:42 +0200 Subject: [PATCH 194/545] Added wayland window fix mzbz#1827429 --- firefox.spec | 7 ++++++- mozilla-1827429.patch | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 mozilla-1827429.patch diff --git a/firefox.spec b/firefox.spec index 7197817..20b52c9 100644 --- a/firefox.spec +++ b/firefox.spec @@ -175,7 +175,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 112.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -256,6 +256,7 @@ Patch415: mozilla-1670333.patch # https://phabricator.services.mozilla.com/D173021 Patch416: libwebrtc-pipewire-capturer-import-dmabuf-directly-into-desktop-frame.patch Patch417: mozilla-1826583.patch +Patch418: mozilla-1827429.patch # PGO/LTO patches Patch600: pgo.patch @@ -538,6 +539,7 @@ This package contains results of tests executed during build. %patch415 -p1 -b .1670333 %patch416 -p1 -b .libwebrtc-pipewire-capturer-import-dmabuf-directly-into-desktop-frame %patch417 -p1 -b .1826583 +%patch418 -p1 -b .1827429 # PGO patches %if %{build_with_pgo} @@ -1087,6 +1089,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Apr 11 2023 Martin Stransky - 112.0-3 +- Added wayland window fix mzbz#1827429 + * Thu Apr 6 2023 Martin Stransky - 112.0-2 - Updated to 112.0 build 2 - don't crash on wayland logging (mzbz#1826583/rhbz#2184842). diff --git a/mozilla-1827429.patch b/mozilla-1827429.patch new file mode 100644 index 0000000..3c908aa --- /dev/null +++ b/mozilla-1827429.patch @@ -0,0 +1,33 @@ +changeset: 659713:2cf85addfa7a +tag: tip +parent: 659711:25045b498bff +user: stransky +date: Tue Apr 11 16:34:42 2023 +0200 +files: widget/gtk/nsWindow.cpp +description: +Bug 1827429 [Wayland] Call NotifyOcclusionState(OcclusionState::VISIBLE) from nsWindow::OnExposeEvent() as we know the window is visible r?emilio + +Differential Revision: https://phabricator.services.mozilla.com/D175138 + + +diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp +--- a/widget/gtk/nsWindow.cpp ++++ b/widget/gtk/nsWindow.cpp +@@ -3730,9 +3730,14 @@ void nsWindow::CreateCompositorVsyncDisp + + gboolean nsWindow::OnExposeEvent(cairo_t* cr) { + // Send any pending resize events so that layout can update. +- // May run event loop. ++ // May run event loop and destroy us. + MaybeDispatchResized(); +- ++ if (mIsDestroyed) { ++ return FALSE; ++ } ++ ++ // This might destroy us. ++ NotifyOcclusionState(OcclusionState::VISIBLE); + if (mIsDestroyed) { + return FALSE; + } + From 33aaf8942f34d38bf621deab577f3e4005ad1391 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 18 Apr 2023 00:22:47 +0200 Subject: [PATCH 195/545] Updated to 112.0.1 --- .gitignore | 2 ++ D173814.diff | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++ firefox.spec | 21 ++++++++++++-- sources | 4 +-- 4 files changed, 104 insertions(+), 5 deletions(-) create mode 100644 D173814.diff diff --git a/.gitignore b/.gitignore index 9e55811..492d3ce 100644 --- a/.gitignore +++ b/.gitignore @@ -567,3 +567,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-112.0.source.tar.xz /firefox-langpacks-112.0-20230405.tar.xz /firefox-langpacks-112.0-20230406.tar.xz +/firefox-langpacks-112.0.1-20230417.tar.xz +/firefox-112.0.1.source.tar.xz diff --git a/D173814.diff b/D173814.diff new file mode 100644 index 0000000..91898aa --- /dev/null +++ b/D173814.diff @@ -0,0 +1,82 @@ +diff --git a/widget/gtk/MozContainerWayland.h b/widget/gtk/MozContainerWayland.h +--- a/widget/gtk/MozContainerWayland.h ++++ b/widget/gtk/MozContainerWayland.h +@@ -83,10 +83,13 @@ + nsIntSize aSize, + int scale); + void moz_container_wayland_set_scale_factor(MozContainer* container); + void moz_container_wayland_set_scale_factor_locked( + const mozilla::MutexAutoLock& aProofOfLock, MozContainer* container); ++bool moz_container_wayland_size_matches_scale_factor_locked( ++ const mozilla::MutexAutoLock& aProofOfLock, MozContainer* container, ++ int aWidth, int aHeight); + + void moz_container_wayland_add_initial_draw_callback_locked( + MozContainer* container, const std::function& initial_draw_cb); + void moz_container_wayland_add_or_fire_initial_draw_callback( + MozContainer* container, const std::function& initial_draw_cb); +diff --git a/widget/gtk/MozContainerWayland.cpp b/widget/gtk/MozContainerWayland.cpp +--- a/widget/gtk/MozContainerWayland.cpp ++++ b/widget/gtk/MozContainerWayland.cpp +@@ -595,10 +595,17 @@ + if (container->wl_container.surface) { + moz_container_wayland_set_scale_factor_locked(lock, container); + } + } + ++bool moz_container_wayland_size_matches_scale_factor_locked( ++ const MutexAutoLock& aProofOfLock, MozContainer* container, int aWidth, ++ int aHeight) { ++ return aWidth % container->wl_container.buffer_scale == 0 && ++ aHeight % container->wl_container.buffer_scale == 0; ++} ++ + static bool moz_container_wayland_surface_create_locked( + const MutexAutoLock& aProofOfLock, MozContainer* container) { + MozContainerWayland* wl_container = &container->wl_container; + + LOGWAYLAND("%s [%p]\n", __FUNCTION__, +diff --git a/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp b/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp +--- a/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp ++++ b/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp +@@ -283,12 +283,12 @@ + return; + } + mFrameInProcess = false; + + MozContainer* container = mWindow->GetMozContainer(); +- MozContainerSurfaceLock lock(container); +- struct wl_surface* waylandSurface = lock.GetSurface(); ++ MozContainerSurfaceLock MozContainerLock(container); ++ struct wl_surface* waylandSurface = MozContainerLock.GetSurface(); + if (!waylandSurface) { + LOGWAYLAND( + "WindowSurfaceWaylandMB::Commit [%p] frame queued: can't lock " + "wl_surface\n", + (void*)mWindow.get()); +@@ -317,12 +317,23 @@ + LayoutDeviceIntRect r = iter.Get(); + wl_surface_damage_buffer(waylandSurface, r.x, r.y, r.width, r.height); + } + } + ++ // aProofOfLock is a kind of substitution of MozContainerSurfaceLock. ++ // MozContainer is locked but MozContainerSurfaceLock doen't convert to ++ // MutexAutoLock& so we use aProofOfLock here. + moz_container_wayland_set_scale_factor_locked(aProofOfLock, container); +- mInProgressBuffer->AttachAndCommit(waylandSurface); ++ ++ // It's possible that scale factor changed between Lock() and Commit() ++ // but window size is the same. ++ // Don't attach such buffer as it may have incorrect size, ++ // we'll paint new content soon. ++ if (moz_container_wayland_size_matches_scale_factor_locked( ++ aProofOfLock, container, mWindowSize.width, mWindowSize.height)) { ++ mInProgressBuffer->AttachAndCommit(waylandSurface); ++ } + + mInProgressBuffer->ResetBufferAge(); + mFrontBuffer = mInProgressBuffer; + mFrontBufferInvalidRegion = aInvalidRegion; + mInProgressBuffer = nullptr; + diff --git a/firefox.spec b/firefox.spec index 20b52c9..8524324 100644 --- a/firefox.spec +++ b/firefox.spec @@ -73,6 +73,7 @@ ExcludeArch: i686 %global system_libvpx 0 %endif %global system_jpeg 1 +%global system_pixman 1 %global use_bundled_cbindgen 1 %if %{debug_build} %global release_build 0 @@ -174,13 +175,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 112.0 -Release: 3%{?pre_tag}%{?dist} +Version: 112.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230406.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230417.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -230,6 +231,7 @@ Patch78: firefox-i686-build.patch Patch79: firefox-gcc-13-build.patch #Patch80: D172126.diff #Patch81: D172864.diff +Patch83: D173814.diff # Test patches # Generate without context by @@ -283,6 +285,9 @@ BuildRequires: pkgconfig(libpng) %if %{?system_jpeg} BuildRequires: libjpeg-devel %endif +%if %{?system_pixman} +BuildRequires: pixman-devel +%endif BuildRequires: zip BuildRequires: bzip2-devel BuildRequires: pkgconfig(zlib) @@ -516,6 +521,7 @@ This package contains results of tests executed during build. %patch79 -p1 -b .firefox-gcc-13-build #%patch80 -p1 -b .D172126 #%patch81 -p1 -b .D172864 +%patch83 -p1 -b .D173814 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -623,6 +629,10 @@ echo "ac_add_options --without-system-jpeg" >> .mozconfig echo "ac_add_options --with-system-jpeg" >> .mozconfig %endif +%if %{?system_pixman} +echo "ac_add_options --enable-system-pixman" >> .mozconfig +%endif + %if %{?system_libvpx} echo "ac_add_options --with-system-libvpx" >> .mozconfig %else @@ -1089,6 +1099,11 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Apr 18 2023 Martin Stransky - 112.0.1-1 +- Updated to 112.0.1 +- Added fix for rhbz#2187000 +- Enabled system pixman (by G.Hojda) + * Tue Apr 11 2023 Martin Stransky - 112.0-3 - Added wayland window fix mzbz#1827429 diff --git a/sources b/sources index 9549e8a..e985a7a 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 -SHA512 (firefox-langpacks-112.0-20230406.tar.xz) = 11870eec9947b11be404016b6426f13c86b37be7d0021bf7ae640151d17df35212bfb4c1c14aef5948dcd49312b47daf582f2367f5ba4d2f81dfc8ce64d9609d -SHA512 (firefox-112.0.source.tar.xz) = 6b2bc8c0c93f3109da27168fe7e8f734c6ab4efb4ca56ff2d5e3a52659da71173bba2104037a000623833be8338621fca482f39f836e3910fe2996e6d0a68b39 +SHA512 (firefox-langpacks-112.0.1-20230417.tar.xz) = 9cee5362c549170568f37e74bab90c18c2540298947d9dd1423839cd11e2f5c0f484665c03fa90924b1c304bfc78b8e5d40a8ed6e08d3c6533d514aa50b8a897 +SHA512 (firefox-112.0.1.source.tar.xz) = 23a5cd9c1f165275d8ca7465bebce86018441c72292421f4ed56d7ad8ada9402dc8d22a08467d9d0ef3ef8c62338006dfa3bcbddf12cb8a59eafa0bd7d0cda50 From ce6d27cc38f8a733954c906c5ea6aaecca0db3de Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 4 Apr 2023 16:30:27 -0400 Subject: [PATCH 196/545] Remove unused gtk2 BuildRequires --- firefox.spec | 4 ---- 1 file changed, 4 deletions(-) diff --git a/firefox.spec b/firefox.spec index 8524324..5f0186a 100644 --- a/firefox.spec +++ b/firefox.spec @@ -292,7 +292,6 @@ BuildRequires: zip BuildRequires: bzip2-devel BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(gtk+-3.0) -BuildRequires: pkgconfig(gtk+-2.0) BuildRequires: pkgconfig(krb5) BuildRequires: pkgconfig(pango) BuildRequires: pkgconfig(freetype2) >= %{freetype_version} @@ -977,9 +976,6 @@ sed -e "s/__VERSION__/%{version}/" \ mkdir -p %{buildroot}%{_datadir}/gnome-shell/search-providers cp %{SOURCE34} %{buildroot}%{_datadir}/gnome-shell/search-providers -# Remove gtk2 support as flash plugin is no longer supported -rm -rf %{buildroot}%{mozappdir}/gtk2/ - # Remove copied libraries to speed up build rm -f %{buildroot}%{mozappdirdev}/sdk/lib/libmozjs.so rm -f %{buildroot}%{mozappdirdev}/sdk/lib/libmozalloc.so From ad7ecb97b86605f5bc03423255d3d38d936a98fc Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 27 Apr 2023 16:26:55 +0200 Subject: [PATCH 197/545] Update to 112.0.2 --- .gitignore | 2 ++ firefox.spec | 11 +++++------ mozilla-1826583.patch | 14 -------------- mozilla-1827429.patch | 33 --------------------------------- sources | 4 ++-- 5 files changed, 9 insertions(+), 55 deletions(-) delete mode 100644 mozilla-1826583.patch delete mode 100644 mozilla-1827429.patch diff --git a/.gitignore b/.gitignore index 492d3ce..9f5203e 100644 --- a/.gitignore +++ b/.gitignore @@ -569,3 +569,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-112.0-20230406.tar.xz /firefox-langpacks-112.0.1-20230417.tar.xz /firefox-112.0.1.source.tar.xz +/firefox-langpacks-112.0.2-20230427.tar.xz +/firefox-112.0.2.source.tar.xz diff --git a/firefox.spec b/firefox.spec index 8524324..fd44f0b 100644 --- a/firefox.spec +++ b/firefox.spec @@ -175,13 +175,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 112.0.1 +Version: 112.0.2 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230417.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230427.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -257,8 +257,6 @@ Patch408: mozilla-1663844.patch Patch415: mozilla-1670333.patch # https://phabricator.services.mozilla.com/D173021 Patch416: libwebrtc-pipewire-capturer-import-dmabuf-directly-into-desktop-frame.patch -Patch417: mozilla-1826583.patch -Patch418: mozilla-1827429.patch # PGO/LTO patches Patch600: pgo.patch @@ -544,8 +542,6 @@ This package contains results of tests executed during build. %patch408 -p1 -b .1663844 %patch415 -p1 -b .1670333 %patch416 -p1 -b .libwebrtc-pipewire-capturer-import-dmabuf-directly-into-desktop-frame -%patch417 -p1 -b .1826583 -%patch418 -p1 -b .1827429 # PGO patches %if %{build_with_pgo} @@ -1099,6 +1095,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Apr 27 2023 Martin Stransky - 112.0.2-1 +- Updated to 112.0.2 + * Tue Apr 18 2023 Martin Stransky - 112.0.1-1 - Updated to 112.0.1 - Added fix for rhbz#2187000 diff --git a/mozilla-1826583.patch b/mozilla-1826583.patch deleted file mode 100644 index 52a2947..0000000 --- a/mozilla-1826583.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -up firefox-112.0/widget/gtk/nsWaylandDisplay.cpp.old firefox-112.0/widget/gtk/nsWaylandDisplay.cpp ---- firefox-112.0/widget/gtk/nsWaylandDisplay.cpp.old 2023-04-06 19:35:44.744731593 +0200 -+++ firefox-112.0/widget/gtk/nsWaylandDisplay.cpp 2023-04-06 19:35:23.650016723 +0200 -@@ -271,8 +271,8 @@ bool nsWaylandDisplay::Matches(wl_displa - return mThreadId == PR_GetCurrentThread() && aDisplay == mDisplay; - } - --static void WlCrashHandler(const char* format, va_list args) { -- MOZ_CRASH_UNSAFE(g_strdup_vprintf(format, args)); -+static void WlCrashHandler(const char* format, va_list args) { -+ vfprintf(stderr, format, args); - } - - nsWaylandDisplay::nsWaylandDisplay(wl_display* aDisplay) diff --git a/mozilla-1827429.patch b/mozilla-1827429.patch deleted file mode 100644 index 3c908aa..0000000 --- a/mozilla-1827429.patch +++ /dev/null @@ -1,33 +0,0 @@ -changeset: 659713:2cf85addfa7a -tag: tip -parent: 659711:25045b498bff -user: stransky -date: Tue Apr 11 16:34:42 2023 +0200 -files: widget/gtk/nsWindow.cpp -description: -Bug 1827429 [Wayland] Call NotifyOcclusionState(OcclusionState::VISIBLE) from nsWindow::OnExposeEvent() as we know the window is visible r?emilio - -Differential Revision: https://phabricator.services.mozilla.com/D175138 - - -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp ---- a/widget/gtk/nsWindow.cpp -+++ b/widget/gtk/nsWindow.cpp -@@ -3730,9 +3730,14 @@ void nsWindow::CreateCompositorVsyncDisp - - gboolean nsWindow::OnExposeEvent(cairo_t* cr) { - // Send any pending resize events so that layout can update. -- // May run event loop. -+ // May run event loop and destroy us. - MaybeDispatchResized(); -- -+ if (mIsDestroyed) { -+ return FALSE; -+ } -+ -+ // This might destroy us. -+ NotifyOcclusionState(OcclusionState::VISIBLE); - if (mIsDestroyed) { - return FALSE; - } - diff --git a/sources b/sources index e985a7a..8d680a8 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 -SHA512 (firefox-langpacks-112.0.1-20230417.tar.xz) = 9cee5362c549170568f37e74bab90c18c2540298947d9dd1423839cd11e2f5c0f484665c03fa90924b1c304bfc78b8e5d40a8ed6e08d3c6533d514aa50b8a897 -SHA512 (firefox-112.0.1.source.tar.xz) = 23a5cd9c1f165275d8ca7465bebce86018441c72292421f4ed56d7ad8ada9402dc8d22a08467d9d0ef3ef8c62338006dfa3bcbddf12cb8a59eafa0bd7d0cda50 +SHA512 (firefox-langpacks-112.0.2-20230427.tar.xz) = 20a1bd9c9de131fd544d379a2867294cd6d9812bf7d66e8e2237c40eb86e1a44a1c5bc194f9f38e1249ded947d00ae9d0c695ea2813a46997ec64ced7b07e89e +SHA512 (firefox-112.0.2.source.tar.xz) = 2cd7adeb6c9a39ad4c5366982e0e58382d7f205e6f2cee02b8ec2867034d1c0c884eeeb870a35db35cba60fa9c84aea73f8c77cfd9f36b5146dde06464aaabd1 From e81ff02c0fcc0fe8b3930f9b858448988603a381 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 9 May 2023 20:44:33 +0200 Subject: [PATCH 198/545] Update to 113.0 --- .gitignore | 2 + D172126.diff | 22 - D172864.diff | 736 ------------------ D173814.diff | 82 -- firefox-enable-vaapi.patch | 10 +- firefox.spec | 24 +- ...t-dmabuf-directly-into-desktop-frame.patch | 505 ------------ mozilla-1663844.patch | 37 - sources | 4 +- 9 files changed, 18 insertions(+), 1404 deletions(-) delete mode 100644 D172126.diff delete mode 100644 D172864.diff delete mode 100644 D173814.diff delete mode 100644 libwebrtc-pipewire-capturer-import-dmabuf-directly-into-desktop-frame.patch delete mode 100644 mozilla-1663844.patch diff --git a/.gitignore b/.gitignore index 9f5203e..b6ba97b 100644 --- a/.gitignore +++ b/.gitignore @@ -571,3 +571,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-112.0.1.source.tar.xz /firefox-langpacks-112.0.2-20230427.tar.xz /firefox-112.0.2.source.tar.xz +/firefox-langpacks-113.0-20230509.tar.xz +/firefox-113.0.source.tar.xz diff --git a/D172126.diff b/D172126.diff deleted file mode 100644 index b4189c0..0000000 --- a/D172126.diff +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/dom/media/webaudio/AudioNodeEngineGeneric.h b/dom/media/webaudio/AudioNodeEngineGeneric.h ---- a/dom/media/webaudio/AudioNodeEngineGeneric.h -+++ b/dom/media/webaudio/AudioNodeEngineGeneric.h -@@ -203,14 +203,14 @@ - MOZ_ASSERT((aSize % xsimd::batch::size == 0), - "requires tail processing"); - - MOZ_UNROLL(2) - for (unsigned i = 0; i < aSize * 2; -- i += 2 * xsimd::batch>::size) { -- auto in1 = xsimd::batch>::load_aligned( -+ i += 2 * xsimd::batch, Arch>::size) { -+ auto in1 = xsimd::batch, Arch>::load_aligned( - reinterpret_cast*>(&aInput[i])); -- auto in2 = xsimd::batch>::load_aligned( -+ auto in2 = xsimd::batch, Arch>::load_aligned( - reinterpret_cast*>(&aScale[i])); - auto out = in1 * in2; - out.store_aligned(reinterpret_cast*>(&aOutput[i])); - } - }; - diff --git a/D172864.diff b/D172864.diff deleted file mode 100644 index ddac7ba..0000000 --- a/D172864.diff +++ /dev/null @@ -1,736 +0,0 @@ -diff --git a/dom/media/webaudio/AudioNodeEngineGeneric.h b/dom/media/webaudio/AudioNodeEngineGeneric.h ---- a/dom/media/webaudio/AudioNodeEngineGeneric.h -+++ b/dom/media/webaudio/AudioNodeEngineGeneric.h -@@ -5,331 +5,54 @@ - - #ifndef MOZILLA_AUDIONODEENGINEGENERIC_H_ - #define MOZILLA_AUDIONODEENGINEGENERIC_H_ - - #include "AudioNodeEngine.h" --#include "AlignmentUtils.h" - - #include "xsimd/xsimd.hpp" - --#if defined(__GNUC__) && __GNUC__ > 7 --# define MOZ_PRAGMA(tokens) _Pragma(#tokens) --# define MOZ_UNROLL(factor) MOZ_PRAGMA(GCC unroll factor) --#elif defined(__INTEL_COMPILER) || (defined(__clang__) && __clang_major__ > 3) --# define MOZ_PRAGMA(tokens) _Pragma(#tokens) --# define MOZ_UNROLL(factor) MOZ_PRAGMA(unroll factor) --#else --# define MOZ_UNROLL(_) --#endif -- - namespace mozilla { - - template --static bool is_aligned(const void* ptr) { -- return (reinterpret_cast(ptr) & -- ~(static_cast(Arch::alignment()) - 1)) == -- reinterpret_cast(ptr); --}; -- --template - struct Engine { - static void AudioBufferAddWithScale(const float* aInput, float aScale, -- float* aOutput, uint32_t aSize) { -- if constexpr (Arch::requires_alignment()) { -- if (aScale == 1.0f) { -- while (!is_aligned(aInput) || !is_aligned(aOutput)) { -- if (!aSize) return; -- *aOutput += *aInput; -- ++aOutput; -- ++aInput; -- --aSize; -- } -- } else { -- while (!is_aligned(aInput) || !is_aligned(aOutput)) { -- if (!aSize) return; -- *aOutput += *aInput * aScale; -- ++aOutput; -- ++aInput; -- --aSize; -- } -- } -- } -- MOZ_ASSERT(is_aligned(aInput), "aInput is aligned"); -- MOZ_ASSERT(is_aligned(aOutput), "aOutput is aligned"); -- -- xsimd::batch vgain(aScale); -- -- uint32_t aVSize = aSize & ~(xsimd::batch::size - 1); -- MOZ_UNROLL(4) -- for (unsigned i = 0; i < aVSize; i += xsimd::batch::size) { -- auto vin1 = xsimd::batch::load_aligned(&aInput[i]); -- auto vin2 = xsimd::batch::load_aligned(&aOutput[i]); -- auto vout = xsimd::fma(vin1, vgain, vin2); -- vout.store_aligned(&aOutput[i]); -- } -- -- for (unsigned i = aVSize; i < aSize; ++i) { -- aOutput[i] += aInput[i] * aScale; -- } -- }; -+ float* aOutput, uint32_t aSize); - - static void AudioBlockCopyChannelWithScale(const float* aInput, float aScale, -- float* aOutput) { -- MOZ_ASSERT(is_aligned(aInput), "aInput is aligned"); -- MOZ_ASSERT(is_aligned(aOutput), "aOutput is aligned"); -- -- MOZ_ASSERT((WEBAUDIO_BLOCK_SIZE % xsimd::batch::size == 0), -- "requires tail processing"); -- -- xsimd::batch vgain = (aScale); -- -- MOZ_UNROLL(4) -- for (unsigned i = 0; i < WEBAUDIO_BLOCK_SIZE; -- i += xsimd::batch::size) { -- auto vin = xsimd::batch::load_aligned(&aInput[i]); -- auto vout = vin * vgain; -- vout.store_aligned(&aOutput[i]); -- } -- }; -+ float* aOutput); - - static void AudioBlockCopyChannelWithScale( - const float aInput[WEBAUDIO_BLOCK_SIZE], - const float aScale[WEBAUDIO_BLOCK_SIZE], -- float aOutput[WEBAUDIO_BLOCK_SIZE]) { -- MOZ_ASSERT(is_aligned(aInput), "aInput is aligned"); -- MOZ_ASSERT(is_aligned(aOutput), "aOutput is aligned"); -- MOZ_ASSERT(is_aligned(aScale), "aScale is aligned"); -- -- MOZ_ASSERT((WEBAUDIO_BLOCK_SIZE % xsimd::batch::size == 0), -- "requires tail processing"); -- -- MOZ_UNROLL(4) -- for (unsigned i = 0; i < WEBAUDIO_BLOCK_SIZE; -- i += xsimd::batch::size) { -- auto vscaled = xsimd::batch::load_aligned(&aScale[i]); -- auto vin = xsimd::batch::load_aligned(&aInput[i]); -- auto vout = vin * vscaled; -- vout.store_aligned(&aOutput[i]); -- } -- }; -+ float aOutput[WEBAUDIO_BLOCK_SIZE]); - - static void AudioBufferInPlaceScale(float* aBlock, float aScale, -- uint32_t aSize) { -- MOZ_ASSERT(is_aligned(aBlock), "aBlock is aligned"); -- -- xsimd::batch vgain(aScale); -- -- uint32_t aVSize = aSize & ~(xsimd::batch::size - 1); -- MOZ_UNROLL(4) -- for (unsigned i = 0; i < aVSize; i += xsimd::batch::size) { -- auto vin = xsimd::batch::load_aligned(&aBlock[i]); -- auto vout = vin * vgain; -- vout.store_aligned(&aBlock[i]); -- } -- for (unsigned i = aVSize; i < aSize; ++i) aBlock[i] *= aScale; -- }; -+ uint32_t aSize); - - static void AudioBufferInPlaceScale(float* aBlock, float* aScale, -- uint32_t aSize) { -- MOZ_ASSERT(is_aligned(aBlock), "aBlock is aligned"); -- MOZ_ASSERT(is_aligned(aScale), "aScale is aligned"); -- -- uint32_t aVSize = aSize & ~(xsimd::batch::size - 1); -- MOZ_UNROLL(4) -- for (unsigned i = 0; i < aVSize; i += xsimd::batch::size) { -- auto vin = xsimd::batch::load_aligned(&aBlock[i]); -- auto vgain = xsimd::batch::load_aligned(&aScale[i]); -- auto vout = vin * vgain; -- vout.store_aligned(&aBlock[i]); -- } -- for (uint32_t i = aVSize; i < aSize; ++i) { -- *aBlock++ *= *aScale++; -- } -- }; -+ uint32_t aSize); - - static void AudioBlockPanStereoToStereo( - const float aInputL[WEBAUDIO_BLOCK_SIZE], - const float aInputR[WEBAUDIO_BLOCK_SIZE], float aGainL, float aGainR, - bool aIsOnTheLeft, float aOutputL[WEBAUDIO_BLOCK_SIZE], -- float aOutputR[WEBAUDIO_BLOCK_SIZE]) { -- MOZ_ASSERT(is_aligned(aInputL), "aInputL is aligned"); -- MOZ_ASSERT(is_aligned(aInputR), "aInputR is aligned"); -- MOZ_ASSERT(is_aligned(aOutputL), "aOutputL is aligned"); -- MOZ_ASSERT(is_aligned(aOutputR), "aOutputR is aligned"); -- -- MOZ_ASSERT((WEBAUDIO_BLOCK_SIZE % xsimd::batch::size == 0), -- "requires tail processing"); -- -- xsimd::batch vgainl(aGainL); -- xsimd::batch vgainr(aGainR); -- -- if (aIsOnTheLeft) { -- MOZ_UNROLL(2) -- for (unsigned i = 0; i < WEBAUDIO_BLOCK_SIZE; -- i += xsimd::batch::size) { -- auto vinl = xsimd::batch::load_aligned(&aInputL[i]); -- auto vinr = xsimd::batch::load_aligned(&aInputR[i]); -- -- /* left channel : aOutputL = aInputL + aInputR * gainL */ -- auto vout = xsimd::fma(vinr, vgainl, vinl); -- vout.store_aligned(&aOutputL[i]); -- -- /* right channel : aOutputR = aInputR * gainR */ -- auto vscaled = vinr * vgainr; -- vscaled.store_aligned(&aOutputR[i]); -- } -- } else { -- MOZ_UNROLL(2) -- for (unsigned i = 0; i < WEBAUDIO_BLOCK_SIZE; -- i += xsimd::batch::size) { -- auto vinl = xsimd::batch::load_aligned(&aInputL[i]); -- auto vinr = xsimd::batch::load_aligned(&aInputR[i]); -- -- /* left channel : aInputL * gainL */ -- auto vscaled = vinl * vgainl; -- vscaled.store_aligned(&aOutputL[i]); -- -- /* right channel: aOutputR = aInputR + aInputL * gainR */ -- auto vout = xsimd::fma(vinl, vgainr, vinr); -- vout.store_aligned(&aOutputR[i]); -- } -- } -- }; -+ float aOutputR[WEBAUDIO_BLOCK_SIZE]); - - static void BufferComplexMultiply(const float* aInput, const float* aScale, -- float* aOutput, uint32_t aSize) { -- MOZ_ASSERT(is_aligned(aInput), "aInput is aligned"); -- MOZ_ASSERT(is_aligned(aOutput), "aOutput is aligned"); -- MOZ_ASSERT(is_aligned(aScale), "aScale is aligned"); -- MOZ_ASSERT((aSize % xsimd::batch::size == 0), -- "requires tail processing"); -- -- MOZ_UNROLL(2) -- for (unsigned i = 0; i < aSize * 2; -- i += 2 * xsimd::batch, Arch>::size) { -- auto in1 = xsimd::batch, Arch>::load_aligned( -- reinterpret_cast*>(&aInput[i])); -- auto in2 = xsimd::batch, Arch>::load_aligned( -- reinterpret_cast*>(&aScale[i])); -- auto out = in1 * in2; -- out.store_aligned(reinterpret_cast*>(&aOutput[i])); -- } -- }; -- -- static float AudioBufferSumOfSquares(const float* aInput, uint32_t aLength) { -- float sum = 0.f; -- -- if constexpr (Arch::requires_alignment()) { -- while (!is_aligned(aInput)) { -- if (!aLength) { -- return sum; -- } -- sum += *aInput * *aInput; -- ++aInput; -- --aLength; -- } -- } -- -- MOZ_ASSERT(is_aligned(aInput), "aInput is aligned"); -- -- constexpr uint32_t unroll_factor = 4; -- xsimd::batch accs[unroll_factor] = {0.f, 0.f, 0.f, 0.f}; -- -- uint32_t vLength = -- aLength & ~(unroll_factor * xsimd::batch::size - 1); -+ float* aOutput, uint32_t aSize); - -- for (uint32_t i = 0; i < vLength; -- i += unroll_factor * xsimd::batch::size) { -- MOZ_UNROLL(4) -- for (uint32_t j = 0; j < unroll_factor; ++j) { -- auto in = xsimd::batch::load_aligned( -- &aInput[i + xsimd::batch::size * j]); -- accs[j] = xsimd::fma(in, in, accs[j]); -- } -- } -- -- sum += reduce_add((accs[0] + accs[1]) + (accs[2] + accs[3])); -- for (uint32_t i = vLength; i < aLength; ++i) sum += aInput[i] * aInput[i]; -- return sum; -- }; -+ static float AudioBufferSumOfSquares(const float* aInput, uint32_t aLength); - -- static void NaNToZeroInPlace(float* aSamples, size_t aCount) { -- if constexpr (Arch::requires_alignment()) { -- while (!is_aligned(aSamples)) { -- if (!aCount) { -- return; -- } -- if (*aSamples != *aSamples) { -- *aSamples = 0.0; -- } -- ++aSamples; -- --aCount; -- } -- } -- -- MOZ_ASSERT(is_aligned(aSamples), "aSamples is aligned"); -- -- uint32_t vCount = aCount & ~(xsimd::batch::size - 1); -- -- MOZ_UNROLL(4) -- for (uint32_t i = 0; i < vCount; i += xsimd::batch::size) { -- auto vin = xsimd::batch::load_aligned(&aSamples[i]); -- auto vout = -- xsimd::select(xsimd::isnan(vin), xsimd::batch(0.f), vin); -- vout.store_aligned(&aSamples[i]); -- } -- -- for (uint32_t i = vCount; i < aCount; i++) { -- if (aSamples[i] != aSamples[i]) { -- aSamples[i] = 0.0; -- } -- } -- }; -+ static void NaNToZeroInPlace(float* aSamples, size_t aCount); - - static void AudioBlockPanStereoToStereo( - const float aInputL[WEBAUDIO_BLOCK_SIZE], - const float aInputR[WEBAUDIO_BLOCK_SIZE], - const float aGainL[WEBAUDIO_BLOCK_SIZE], - const float aGainR[WEBAUDIO_BLOCK_SIZE], - const bool aIsOnTheLeft[WEBAUDIO_BLOCK_SIZE], -- float aOutputL[WEBAUDIO_BLOCK_SIZE], -- float aOutputR[WEBAUDIO_BLOCK_SIZE]) { -- MOZ_ASSERT(is_aligned(aInputL), "aInputL is aligned"); -- MOZ_ASSERT(is_aligned(aInputR), "aInputR is aligned"); -- MOZ_ASSERT(is_aligned(aGainL), "aGainL is aligned"); -- MOZ_ASSERT(is_aligned(aGainR), "aGainR is aligned"); -- MOZ_ASSERT(is_aligned(aIsOnTheLeft), "aIsOnTheLeft is aligned"); -- MOZ_ASSERT(is_aligned(aOutputL), "aOutputL is aligned"); -- MOZ_ASSERT(is_aligned(aOutputR), "aOutputR is aligned"); -- -- MOZ_ASSERT((WEBAUDIO_BLOCK_SIZE % xsimd::batch::size == 0), -- "requires tail processing"); -- -- MOZ_UNROLL(2) -- for (uint32_t i = 0; i < WEBAUDIO_BLOCK_SIZE; -- i += xsimd::batch::size) { -- auto mask = -- xsimd::batch_bool::load_aligned(&aIsOnTheLeft[i]); -- -- auto inputL = xsimd::batch::load_aligned(&aInputL[i]); -- auto inputR = xsimd::batch::load_aligned(&aInputR[i]); -- auto gainL = xsimd::batch::load_aligned(&aGainL[i]); -- auto gainR = xsimd::batch::load_aligned(&aGainR[i]); -- -- auto outL_true = xsimd::fma(inputR, gainL, inputL); -- auto outR_true = inputR * gainR; -- -- auto outL_false = inputL * gainL; -- auto outR_false = xsimd::fma(inputL, gainR, inputR); -- -- auto outL = xsimd::select(mask, outL_true, outL_false); -- auto outR = xsimd::select(mask, outR_true, outR_false); -- -- outL.store_aligned(&aOutputL[i]); -- outR.store_aligned(&aOutputR[i]); -- } -- } -+ float aOutputL[WEBAUDIO_BLOCK_SIZE], float aOutputR[WEBAUDIO_BLOCK_SIZE]); - }; - - } // namespace mozilla - - #endif -diff --git a/dom/media/webaudio/AudioNodeEngineGenericImpl.h b/dom/media/webaudio/AudioNodeEngineGenericImpl.h -new file mode 100644 ---- /dev/null -+++ b/dom/media/webaudio/AudioNodeEngineGenericImpl.h -@@ -0,0 +1,341 @@ -+/* -*- mode: c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -+/* this source code form is subject to the terms of the mozilla public -+ * license, v. 2.0. if a copy of the mpl was not distributed with this file, -+ * You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+#ifndef MOZILLA_AUDIONODEENGINEGENERICIMPL_H_ -+#define MOZILLA_AUDIONODEENGINEGENERICIMPL_H_ -+ -+#include "AudioNodeEngineGeneric.h" -+#include "AlignmentUtils.h" -+ -+#if defined(__GNUC__) && __GNUC__ > 7 -+# define MOZ_PRAGMA(tokens) _Pragma(#tokens) -+# define MOZ_UNROLL(factor) MOZ_PRAGMA(GCC unroll factor) -+#elif defined(__INTEL_COMPILER) || (defined(__clang__) && __clang_major__ > 3) -+# define MOZ_PRAGMA(tokens) _Pragma(#tokens) -+# define MOZ_UNROLL(factor) MOZ_PRAGMA(unroll factor) -+#else -+# define MOZ_UNROLL(_) -+#endif -+ -+namespace mozilla { -+ -+template -+static bool is_aligned(const void* ptr) { -+ return (reinterpret_cast(ptr) & -+ ~(static_cast(Arch::alignment()) - 1)) == -+ reinterpret_cast(ptr); -+}; -+ -+template -+void Engine::AudioBufferAddWithScale(const float* aInput, float aScale, -+ float* aOutput, uint32_t aSize) { -+ if constexpr (Arch::requires_alignment()) { -+ if (aScale == 1.0f) { -+ while (!is_aligned(aInput) || !is_aligned(aOutput)) { -+ if (!aSize) return; -+ *aOutput += *aInput; -+ ++aOutput; -+ ++aInput; -+ --aSize; -+ } -+ } else { -+ while (!is_aligned(aInput) || !is_aligned(aOutput)) { -+ if (!aSize) return; -+ *aOutput += *aInput * aScale; -+ ++aOutput; -+ ++aInput; -+ --aSize; -+ } -+ } -+ } -+ MOZ_ASSERT(is_aligned(aInput), "aInput is aligned"); -+ MOZ_ASSERT(is_aligned(aOutput), "aOutput is aligned"); -+ -+ xsimd::batch vgain(aScale); -+ -+ uint32_t aVSize = aSize & ~(xsimd::batch::size - 1); -+ MOZ_UNROLL(4) -+ for (unsigned i = 0; i < aVSize; i += xsimd::batch::size) { -+ auto vin1 = xsimd::batch::load_aligned(&aInput[i]); -+ auto vin2 = xsimd::batch::load_aligned(&aOutput[i]); -+ auto vout = xsimd::fma(vin1, vgain, vin2); -+ vout.store_aligned(&aOutput[i]); -+ } -+ -+ for (unsigned i = aVSize; i < aSize; ++i) { -+ aOutput[i] += aInput[i] * aScale; -+ } -+} -+ -+template -+void Engine::AudioBlockCopyChannelWithScale(const float* aInput, -+ float aScale, -+ float* aOutput) { -+ MOZ_ASSERT(is_aligned(aInput), "aInput is aligned"); -+ MOZ_ASSERT(is_aligned(aOutput), "aOutput is aligned"); -+ -+ MOZ_ASSERT((WEBAUDIO_BLOCK_SIZE % xsimd::batch::size == 0), -+ "requires tail processing"); -+ -+ xsimd::batch vgain = (aScale); -+ -+ MOZ_UNROLL(4) -+ for (unsigned i = 0; i < WEBAUDIO_BLOCK_SIZE; -+ i += xsimd::batch::size) { -+ auto vin = xsimd::batch::load_aligned(&aInput[i]); -+ auto vout = vin * vgain; -+ vout.store_aligned(&aOutput[i]); -+ } -+}; -+ -+template -+void Engine::AudioBlockCopyChannelWithScale( -+ const float aInput[WEBAUDIO_BLOCK_SIZE], -+ const float aScale[WEBAUDIO_BLOCK_SIZE], -+ float aOutput[WEBAUDIO_BLOCK_SIZE]) { -+ MOZ_ASSERT(is_aligned(aInput), "aInput is aligned"); -+ MOZ_ASSERT(is_aligned(aOutput), "aOutput is aligned"); -+ MOZ_ASSERT(is_aligned(aScale), "aScale is aligned"); -+ -+ MOZ_ASSERT((WEBAUDIO_BLOCK_SIZE % xsimd::batch::size == 0), -+ "requires tail processing"); -+ -+ MOZ_UNROLL(4) -+ for (unsigned i = 0; i < WEBAUDIO_BLOCK_SIZE; -+ i += xsimd::batch::size) { -+ auto vscaled = xsimd::batch::load_aligned(&aScale[i]); -+ auto vin = xsimd::batch::load_aligned(&aInput[i]); -+ auto vout = vin * vscaled; -+ vout.store_aligned(&aOutput[i]); -+ } -+}; -+ -+template -+void Engine::AudioBufferInPlaceScale(float* aBlock, float aScale, -+ uint32_t aSize) { -+ MOZ_ASSERT(is_aligned(aBlock), "aBlock is aligned"); -+ -+ xsimd::batch vgain(aScale); -+ -+ uint32_t aVSize = aSize & ~(xsimd::batch::size - 1); -+ MOZ_UNROLL(4) -+ for (unsigned i = 0; i < aVSize; i += xsimd::batch::size) { -+ auto vin = xsimd::batch::load_aligned(&aBlock[i]); -+ auto vout = vin * vgain; -+ vout.store_aligned(&aBlock[i]); -+ } -+ for (unsigned i = aVSize; i < aSize; ++i) aBlock[i] *= aScale; -+}; -+ -+template -+void Engine::AudioBufferInPlaceScale(float* aBlock, float* aScale, -+ uint32_t aSize) { -+ MOZ_ASSERT(is_aligned(aBlock), "aBlock is aligned"); -+ MOZ_ASSERT(is_aligned(aScale), "aScale is aligned"); -+ -+ uint32_t aVSize = aSize & ~(xsimd::batch::size - 1); -+ MOZ_UNROLL(4) -+ for (unsigned i = 0; i < aVSize; i += xsimd::batch::size) { -+ auto vin = xsimd::batch::load_aligned(&aBlock[i]); -+ auto vgain = xsimd::batch::load_aligned(&aScale[i]); -+ auto vout = vin * vgain; -+ vout.store_aligned(&aBlock[i]); -+ } -+ for (uint32_t i = aVSize; i < aSize; ++i) { -+ *aBlock++ *= *aScale++; -+ } -+}; -+ -+template -+void Engine::AudioBlockPanStereoToStereo( -+ const float aInputL[WEBAUDIO_BLOCK_SIZE], -+ const float aInputR[WEBAUDIO_BLOCK_SIZE], float aGainL, float aGainR, -+ bool aIsOnTheLeft, float aOutputL[WEBAUDIO_BLOCK_SIZE], -+ float aOutputR[WEBAUDIO_BLOCK_SIZE]) { -+ MOZ_ASSERT(is_aligned(aInputL), "aInputL is aligned"); -+ MOZ_ASSERT(is_aligned(aInputR), "aInputR is aligned"); -+ MOZ_ASSERT(is_aligned(aOutputL), "aOutputL is aligned"); -+ MOZ_ASSERT(is_aligned(aOutputR), "aOutputR is aligned"); -+ -+ MOZ_ASSERT((WEBAUDIO_BLOCK_SIZE % xsimd::batch::size == 0), -+ "requires tail processing"); -+ -+ xsimd::batch vgainl(aGainL); -+ xsimd::batch vgainr(aGainR); -+ -+ if (aIsOnTheLeft) { -+ MOZ_UNROLL(2) -+ for (unsigned i = 0; i < WEBAUDIO_BLOCK_SIZE; -+ i += xsimd::batch::size) { -+ auto vinl = xsimd::batch::load_aligned(&aInputL[i]); -+ auto vinr = xsimd::batch::load_aligned(&aInputR[i]); -+ -+ /* left channel : aOutputL = aInputL + aInputR * gainL */ -+ auto vout = xsimd::fma(vinr, vgainl, vinl); -+ vout.store_aligned(&aOutputL[i]); -+ -+ /* right channel : aOutputR = aInputR * gainR */ -+ auto vscaled = vinr * vgainr; -+ vscaled.store_aligned(&aOutputR[i]); -+ } -+ } else { -+ MOZ_UNROLL(2) -+ for (unsigned i = 0; i < WEBAUDIO_BLOCK_SIZE; -+ i += xsimd::batch::size) { -+ auto vinl = xsimd::batch::load_aligned(&aInputL[i]); -+ auto vinr = xsimd::batch::load_aligned(&aInputR[i]); -+ -+ /* left channel : aInputL * gainL */ -+ auto vscaled = vinl * vgainl; -+ vscaled.store_aligned(&aOutputL[i]); -+ -+ /* right channel: aOutputR = aInputR + aInputL * gainR */ -+ auto vout = xsimd::fma(vinl, vgainr, vinr); -+ vout.store_aligned(&aOutputR[i]); -+ } -+ } -+}; -+ -+template -+void Engine::BufferComplexMultiply(const float* aInput, -+ const float* aScale, float* aOutput, -+ uint32_t aSize) { -+ MOZ_ASSERT(is_aligned(aInput), "aInput is aligned"); -+ MOZ_ASSERT(is_aligned(aOutput), "aOutput is aligned"); -+ MOZ_ASSERT(is_aligned(aScale), "aScale is aligned"); -+ MOZ_ASSERT((aSize % xsimd::batch::size == 0), -+ "requires tail processing"); -+ -+ MOZ_UNROLL(2) -+ for (unsigned i = 0; i < aSize * 2; -+ i += 2 * xsimd::batch, Arch>::size) { -+ auto in1 = xsimd::batch, Arch>::load_aligned( -+ reinterpret_cast*>(&aInput[i])); -+ auto in2 = xsimd::batch, Arch>::load_aligned( -+ reinterpret_cast*>(&aScale[i])); -+ auto out = in1 * in2; -+ out.store_aligned(reinterpret_cast*>(&aOutput[i])); -+ } -+}; -+ -+template -+float Engine::AudioBufferSumOfSquares(const float* aInput, -+ uint32_t aLength) { -+ float sum = 0.f; -+ -+ if constexpr (Arch::requires_alignment()) { -+ while (!is_aligned(aInput)) { -+ if (!aLength) { -+ return sum; -+ } -+ sum += *aInput * *aInput; -+ ++aInput; -+ --aLength; -+ } -+ } -+ -+ MOZ_ASSERT(is_aligned(aInput), "aInput is aligned"); -+ -+ constexpr uint32_t unroll_factor = 4; -+ xsimd::batch accs[unroll_factor] = {0.f, 0.f, 0.f, 0.f}; -+ -+ uint32_t vLength = -+ aLength & ~(unroll_factor * xsimd::batch::size - 1); -+ -+ for (uint32_t i = 0; i < vLength; -+ i += unroll_factor * xsimd::batch::size) { -+ MOZ_UNROLL(4) -+ for (uint32_t j = 0; j < unroll_factor; ++j) { -+ auto in = xsimd::batch::load_aligned( -+ &aInput[i + xsimd::batch::size * j]); -+ accs[j] = xsimd::fma(in, in, accs[j]); -+ } -+ } -+ -+ sum += reduce_add((accs[0] + accs[1]) + (accs[2] + accs[3])); -+ for (uint32_t i = vLength; i < aLength; ++i) sum += aInput[i] * aInput[i]; -+ return sum; -+}; -+ -+template -+void Engine::NaNToZeroInPlace(float* aSamples, size_t aCount) { -+ if constexpr (Arch::requires_alignment()) { -+ while (!is_aligned(aSamples)) { -+ if (!aCount) { -+ return; -+ } -+ if (*aSamples != *aSamples) { -+ *aSamples = 0.0; -+ } -+ ++aSamples; -+ --aCount; -+ } -+ } -+ -+ MOZ_ASSERT(is_aligned(aSamples), "aSamples is aligned"); -+ -+ uint32_t vCount = aCount & ~(xsimd::batch::size - 1); -+ -+ MOZ_UNROLL(4) -+ for (uint32_t i = 0; i < vCount; i += xsimd::batch::size) { -+ auto vin = xsimd::batch::load_aligned(&aSamples[i]); -+ auto vout = -+ xsimd::select(xsimd::isnan(vin), xsimd::batch(0.f), vin); -+ vout.store_aligned(&aSamples[i]); -+ } -+ -+ for (uint32_t i = vCount; i < aCount; i++) { -+ if (aSamples[i] != aSamples[i]) { -+ aSamples[i] = 0.0; -+ } -+ } -+}; -+ -+template -+void Engine::AudioBlockPanStereoToStereo( -+ const float aInputL[WEBAUDIO_BLOCK_SIZE], -+ const float aInputR[WEBAUDIO_BLOCK_SIZE], -+ const float aGainL[WEBAUDIO_BLOCK_SIZE], -+ const float aGainR[WEBAUDIO_BLOCK_SIZE], -+ const bool aIsOnTheLeft[WEBAUDIO_BLOCK_SIZE], -+ float aOutputL[WEBAUDIO_BLOCK_SIZE], float aOutputR[WEBAUDIO_BLOCK_SIZE]) { -+ MOZ_ASSERT(is_aligned(aInputL), "aInputL is aligned"); -+ MOZ_ASSERT(is_aligned(aInputR), "aInputR is aligned"); -+ MOZ_ASSERT(is_aligned(aGainL), "aGainL is aligned"); -+ MOZ_ASSERT(is_aligned(aGainR), "aGainR is aligned"); -+ MOZ_ASSERT(is_aligned(aIsOnTheLeft), "aIsOnTheLeft is aligned"); -+ MOZ_ASSERT(is_aligned(aOutputL), "aOutputL is aligned"); -+ MOZ_ASSERT(is_aligned(aOutputR), "aOutputR is aligned"); -+ -+ MOZ_ASSERT((WEBAUDIO_BLOCK_SIZE % xsimd::batch::size == 0), -+ "requires tail processing"); -+ -+ MOZ_UNROLL(2) -+ for (uint32_t i = 0; i < WEBAUDIO_BLOCK_SIZE; -+ i += xsimd::batch::size) { -+ auto mask = xsimd::batch_bool::load_aligned(&aIsOnTheLeft[i]); -+ -+ auto inputL = xsimd::batch::load_aligned(&aInputL[i]); -+ auto inputR = xsimd::batch::load_aligned(&aInputR[i]); -+ auto gainL = xsimd::batch::load_aligned(&aGainL[i]); -+ auto gainR = xsimd::batch::load_aligned(&aGainR[i]); -+ -+ auto outL_true = xsimd::fma(inputR, gainL, inputL); -+ auto outR_true = inputR * gainR; -+ -+ auto outL_false = inputL * gainL; -+ auto outR_false = xsimd::fma(inputL, gainR, inputR); -+ -+ auto outL = xsimd::select(mask, outL_true, outL_false); -+ auto outR = xsimd::select(mask, outR_true, outR_false); -+ -+ outL.store_aligned(&aOutputL[i]); -+ outR.store_aligned(&aOutputR[i]); -+ } -+} -+ -+} // namespace mozilla -+ -+#endif -diff --git a/dom/media/webaudio/AudioNodeEngineNEON.cpp b/dom/media/webaudio/AudioNodeEngineNEON.cpp ---- a/dom/media/webaudio/AudioNodeEngineNEON.cpp -+++ b/dom/media/webaudio/AudioNodeEngineNEON.cpp -@@ -1,9 +1,9 @@ - /* -*- mode: c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ - /* this source code form is subject to the terms of the mozilla public - * license, v. 2.0. if a copy of the mpl was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - --#include "AudioNodeEngineGeneric.h" -+#include "AudioNodeEngineGenericImpl.h" - namespace mozilla { - template struct Engine; - } // namespace mozilla -diff --git a/dom/media/webaudio/AudioNodeEngineSSE2.cpp b/dom/media/webaudio/AudioNodeEngineSSE2.cpp ---- a/dom/media/webaudio/AudioNodeEngineSSE2.cpp -+++ b/dom/media/webaudio/AudioNodeEngineSSE2.cpp -@@ -1,10 +1,10 @@ - /* -*- mode: c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ - /* this source code form is subject to the terms of the mozilla public - * license, v. 2.0. if a copy of the mpl was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - --#include "AudioNodeEngineGeneric.h" -+#include "AudioNodeEngineGenericImpl.h" - - namespace mozilla { - template struct Engine; - } // namespace mozilla -diff --git a/dom/media/webaudio/AudioNodeEngineSSE4_2_FMA3.cpp b/dom/media/webaudio/AudioNodeEngineSSE4_2_FMA3.cpp ---- a/dom/media/webaudio/AudioNodeEngineSSE4_2_FMA3.cpp -+++ b/dom/media/webaudio/AudioNodeEngineSSE4_2_FMA3.cpp -@@ -1,10 +1,10 @@ - /* -*- mode: c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ - /* this source code form is subject to the terms of the mozilla public - * license, v. 2.0. if a copy of the mpl was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - --#include "AudioNodeEngineGeneric.h" -+#include "AudioNodeEngineGenericImpl.h" - - namespace mozilla { - template struct Engine>; - } // namespace mozilla - diff --git a/D173814.diff b/D173814.diff deleted file mode 100644 index 91898aa..0000000 --- a/D173814.diff +++ /dev/null @@ -1,82 +0,0 @@ -diff --git a/widget/gtk/MozContainerWayland.h b/widget/gtk/MozContainerWayland.h ---- a/widget/gtk/MozContainerWayland.h -+++ b/widget/gtk/MozContainerWayland.h -@@ -83,10 +83,13 @@ - nsIntSize aSize, - int scale); - void moz_container_wayland_set_scale_factor(MozContainer* container); - void moz_container_wayland_set_scale_factor_locked( - const mozilla::MutexAutoLock& aProofOfLock, MozContainer* container); -+bool moz_container_wayland_size_matches_scale_factor_locked( -+ const mozilla::MutexAutoLock& aProofOfLock, MozContainer* container, -+ int aWidth, int aHeight); - - void moz_container_wayland_add_initial_draw_callback_locked( - MozContainer* container, const std::function& initial_draw_cb); - void moz_container_wayland_add_or_fire_initial_draw_callback( - MozContainer* container, const std::function& initial_draw_cb); -diff --git a/widget/gtk/MozContainerWayland.cpp b/widget/gtk/MozContainerWayland.cpp ---- a/widget/gtk/MozContainerWayland.cpp -+++ b/widget/gtk/MozContainerWayland.cpp -@@ -595,10 +595,17 @@ - if (container->wl_container.surface) { - moz_container_wayland_set_scale_factor_locked(lock, container); - } - } - -+bool moz_container_wayland_size_matches_scale_factor_locked( -+ const MutexAutoLock& aProofOfLock, MozContainer* container, int aWidth, -+ int aHeight) { -+ return aWidth % container->wl_container.buffer_scale == 0 && -+ aHeight % container->wl_container.buffer_scale == 0; -+} -+ - static bool moz_container_wayland_surface_create_locked( - const MutexAutoLock& aProofOfLock, MozContainer* container) { - MozContainerWayland* wl_container = &container->wl_container; - - LOGWAYLAND("%s [%p]\n", __FUNCTION__, -diff --git a/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp b/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp ---- a/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp -+++ b/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp -@@ -283,12 +283,12 @@ - return; - } - mFrameInProcess = false; - - MozContainer* container = mWindow->GetMozContainer(); -- MozContainerSurfaceLock lock(container); -- struct wl_surface* waylandSurface = lock.GetSurface(); -+ MozContainerSurfaceLock MozContainerLock(container); -+ struct wl_surface* waylandSurface = MozContainerLock.GetSurface(); - if (!waylandSurface) { - LOGWAYLAND( - "WindowSurfaceWaylandMB::Commit [%p] frame queued: can't lock " - "wl_surface\n", - (void*)mWindow.get()); -@@ -317,12 +317,23 @@ - LayoutDeviceIntRect r = iter.Get(); - wl_surface_damage_buffer(waylandSurface, r.x, r.y, r.width, r.height); - } - } - -+ // aProofOfLock is a kind of substitution of MozContainerSurfaceLock. -+ // MozContainer is locked but MozContainerSurfaceLock doen't convert to -+ // MutexAutoLock& so we use aProofOfLock here. - moz_container_wayland_set_scale_factor_locked(aProofOfLock, container); -- mInProgressBuffer->AttachAndCommit(waylandSurface); -+ -+ // It's possible that scale factor changed between Lock() and Commit() -+ // but window size is the same. -+ // Don't attach such buffer as it may have incorrect size, -+ // we'll paint new content soon. -+ if (moz_container_wayland_size_matches_scale_factor_locked( -+ aProofOfLock, container, mWindowSize.width, mWindowSize.height)) { -+ mInProgressBuffer->AttachAndCommit(waylandSurface); -+ } - - mInProgressBuffer->ResetBufferAge(); - mFrontBuffer = mInProgressBuffer; - mFrontBufferInvalidRegion = aInvalidRegion; - mInProgressBuffer = nullptr; - diff --git a/firefox-enable-vaapi.patch b/firefox-enable-vaapi.patch index dbe92bc..e91f376 100644 --- a/firefox-enable-vaapi.patch +++ b/firefox-enable-vaapi.patch @@ -1,9 +1,9 @@ -diff -up firefox-112.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi firefox-112.0/widget/gtk/GfxInfo.cpp ---- firefox-112.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi 2023-04-05 11:10:14.156695694 +0200 -+++ firefox-112.0/widget/gtk/GfxInfo.cpp 2023-04-05 11:11:40.697665718 +0200 -@@ -810,14 +810,6 @@ const nsTArray& GfxInfo:: +diff -up firefox-113.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi firefox-113.0/widget/gtk/GfxInfo.cpp +--- firefox-113.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi 2023-05-09 19:43:38.495868810 +0200 ++++ firefox-113.0/widget/gtk/GfxInfo.cpp 2023-05-09 19:44:30.943597984 +0200 +@@ -818,14 +818,6 @@ const nsTArray& GfxInfo:: nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED, - V(0, 0, 0, 0), "FEATURE_HARDWARE_VIDEO_DECODING_NO_LINUX_AMD", ""); + V(0, 0, 0, 0), "FEATURE_HARDWARE_VIDEO_DECODING_NO_R600", ""); - // Disable on Release/late Beta -#if !defined(EARLY_BETA_OR_EARLIER) diff --git a/firefox.spec b/firefox.spec index a3e02c8..09ac3db 100644 --- a/firefox.spec +++ b/firefox.spec @@ -175,13 +175,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 112.0.2 +Version: 113.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230427.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230509.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -229,9 +229,6 @@ Patch61: firefox-glibc-dynstack.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch78: firefox-i686-build.patch Patch79: firefox-gcc-13-build.patch -#Patch80: D172126.diff -#Patch81: D172864.diff -Patch83: D173814.diff # Test patches # Generate without context by @@ -253,10 +250,8 @@ Patch230: firefox-enable-vaapi.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch -Patch408: mozilla-1663844.patch -Patch415: mozilla-1670333.patch -# https://phabricator.services.mozilla.com/D173021 -Patch416: libwebrtc-pipewire-capturer-import-dmabuf-directly-into-desktop-frame.patch +# TODO: do we need it? +#Patch415: mozilla-1670333.patch # PGO/LTO patches Patch600: pgo.patch @@ -516,9 +511,6 @@ This package contains results of tests executed during build. %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch78 -p1 -b .firefox-i686 %patch79 -p1 -b .firefox-gcc-13-build -#%patch80 -p1 -b .D172126 -#%patch81 -p1 -b .D172864 -%patch83 -p1 -b .D173814 # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell @@ -538,9 +530,8 @@ This package contains results of tests executed during build. %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 -%patch408 -p1 -b .1663844 -%patch415 -p1 -b .1670333 -%patch416 -p1 -b .libwebrtc-pipewire-capturer-import-dmabuf-directly-into-desktop-frame +# TODO: do we need it? +#%patch415 -p1 -b .1670333 # PGO patches %if %{build_with_pgo} @@ -1091,6 +1082,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue May 9 2023 Martin Stransky - 113.0-1 +- Updated to 113.0 + * Thu Apr 27 2023 Martin Stransky - 112.0.2-1 - Updated to 112.0.2 diff --git a/libwebrtc-pipewire-capturer-import-dmabuf-directly-into-desktop-frame.patch b/libwebrtc-pipewire-capturer-import-dmabuf-directly-into-desktop-frame.patch deleted file mode 100644 index 69f9df2..0000000 --- a/libwebrtc-pipewire-capturer-import-dmabuf-directly-into-desktop-frame.patch +++ /dev/null @@ -1,505 +0,0 @@ -From d9faa73cbbc186d7dd0dbfce0589012a0bed9f17 Mon Sep 17 00:00:00 2001 -From: Jan Grulich -Date: Fri, 17 Mar 2023 10:58:10 +0100 -Subject: [PATCH] PipeWire capturer: import DMABufs directly into desktop frame - -Originally DMABufs were imported into a temporary buffer followed by a -copy operation into the desktop frame itself. This is not needed as we -can import them directly into desktop frames and avoid this overhead. - -Also drop support for MemPtr buffers as both Mutter and KWin don't seem -to support them and they are going to be too slow anyway. - -Testing with latest Chromium, I could see two processes with usage around 20% and 40% without this change going down to 10% and 20% with -this change applied. - -Bug: webrtc:13429 -Bug: chrome:1378258 -Change-Id: Ice3292528ff56300931c8638f8e03d4883d5e331 -Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/297501 -Reviewed-by: Alexander Cooper -Commit-Queue: Jan Grulich -Cr-Commit-Position: refs/heads/main@{#39594} ---- - -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc -index 5bbd5d7aba..b529077c6d 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc -@@ -101,11 +101,23 @@ typedef void (*glDeleteTextures_func)(GLsizei n, const GLuint* textures); - typedef void (*glGenTextures_func)(GLsizei n, GLuint* textures); - typedef GLenum (*glGetError_func)(void); - typedef const GLubyte* (*glGetString_func)(GLenum name); --typedef void (*glGetTexImage_func)(GLenum target, -- GLint level, -- GLenum format, -- GLenum type, -- void* pixels); -+typedef void (*glReadPixels_func)(GLint x, -+ GLint y, -+ GLsizei width, -+ GLsizei height, -+ GLenum format, -+ GLenum type, -+ void* data); -+typedef void (*glGenFramebuffers_func)(GLsizei n, GLuint* ids); -+typedef void (*glDeleteFramebuffers_func)(GLsizei n, -+ const GLuint* framebuffers); -+typedef void (*glBindFramebuffer_func)(GLenum target, GLuint framebuffer); -+typedef void (*glFramebufferTexture2D_func)(GLenum target, -+ GLenum attachment, -+ GLenum textarget, -+ GLuint texture, -+ GLint level); -+typedef GLenum (*glCheckFramebufferStatus_func)(GLenum target); - typedef void (*glTexParameteri_func)(GLenum target, GLenum pname, GLint param); - typedef void* (*glXGetProcAddressARB_func)(const char*); - -@@ -118,7 +130,12 @@ glDeleteTextures_func GlDeleteTextures = nullptr; - glGenTextures_func GlGenTextures = nullptr; - glGetError_func GlGetError = nullptr; - glGetString_func GlGetString = nullptr; --glGetTexImage_func GlGetTexImage = nullptr; -+glReadPixels_func GlReadPixels = nullptr; -+glGenFramebuffers_func GlGenFramebuffers = nullptr; -+glDeleteFramebuffers_func GlDeleteFramebuffers = nullptr; -+glBindFramebuffer_func GlBindFramebuffer = nullptr; -+glFramebufferTexture2D_func GlFramebufferTexture2D = nullptr; -+glCheckFramebufferStatus_func GlCheckFramebufferStatus = nullptr; - glTexParameteri_func GlTexParameteri = nullptr; - glXGetProcAddressARB_func GlXGetProcAddressARB = nullptr; - -@@ -279,12 +296,26 @@ static bool LoadGL() { - (glDeleteTextures_func)GlXGetProcAddressARB("glDeleteTextures"); - GlGenTextures = (glGenTextures_func)GlXGetProcAddressARB("glGenTextures"); - GlGetError = (glGetError_func)GlXGetProcAddressARB("glGetError"); -- GlGetTexImage = (glGetTexImage_func)GlXGetProcAddressARB("glGetTexImage"); -+ GlReadPixels = (glReadPixels_func)GlXGetProcAddressARB("glReadPixels"); -+ GlGenFramebuffers = -+ (glGenFramebuffers_func)GlXGetProcAddressARB("glGenFramebuffers"); -+ GlDeleteFramebuffers = -+ (glDeleteFramebuffers_func)GlXGetProcAddressARB("glDeleteFramebuffers"); -+ GlBindFramebuffer = -+ (glBindFramebuffer_func)GlXGetProcAddressARB("glBindFramebuffer"); -+ GlFramebufferTexture2D = (glFramebufferTexture2D_func)GlXGetProcAddressARB( -+ "glFramebufferTexture2D"); -+ GlCheckFramebufferStatus = -+ (glCheckFramebufferStatus_func)GlXGetProcAddressARB( -+ "glCheckFramebufferStatus"); -+ - GlTexParameteri = - (glTexParameteri_func)GlXGetProcAddressARB("glTexParameteri"); - - return GlBindTexture && GlDeleteTextures && GlGenTextures && GlGetError && -- GlGetTexImage && GlTexParameteri; -+ GlReadPixels && GlGenFramebuffers && GlDeleteFramebuffers && -+ GlBindFramebuffer && GlFramebufferTexture2D && -+ GlCheckFramebufferStatus && GlTexParameteri; - } - - return false; -@@ -435,6 +466,14 @@ EglDmaBuf::~EglDmaBuf() { - EglTerminate(egl_.display); - } - -+ if (fbo_) { -+ GlDeleteFramebuffers(1, &fbo_); -+ } -+ -+ if (texture_) { -+ GlDeleteTextures(1, &texture_); -+ } -+ - // BUG: crbug.com/1290566 - // Closing libEGL.so.1 when using NVidia drivers causes a crash - // when EglGetPlatformDisplayEXT() is used, at least this one is enough -@@ -466,20 +505,20 @@ bool EglDmaBuf::GetClientExtensions(EGLDisplay dpy, EGLint name) { - } - - RTC_NO_SANITIZE("cfi-icall") --std::unique_ptr EglDmaBuf::ImageFromDmaBuf( -- const DesktopSize& size, -- uint32_t format, -- const std::vector& plane_datas, -- uint64_t modifier) { -- std::unique_ptr src; -- -+bool EglDmaBuf::ImageFromDmaBuf(const DesktopSize& size, -+ uint32_t format, -+ const std::vector& plane_datas, -+ uint64_t modifier, -+ const DesktopVector& offset, -+ const DesktopSize& buffer_size, -+ uint8_t* data) { - if (!egl_initialized_) { -- return src; -+ return false; - } - - if (plane_datas.size() <= 0) { - RTC_LOG(LS_ERROR) << "Failed to process buffer: invalid number of planes"; -- return src; -+ return false; - } - - EGLint attribs[47]; -@@ -568,20 +607,32 @@ std::unique_ptr EglDmaBuf::ImageFromDmaBuf( - if (image == EGL_NO_IMAGE) { - RTC_LOG(LS_ERROR) << "Failed to record frame: Error creating EGLImage - " - << FormatEGLError(EglGetError()); -- return src; -+ return false; - } - - // create GL 2D texture for framebuffer -- GLuint texture; -- GlGenTextures(1, &texture); -- GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); -- GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); -- GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); -- GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); -- GlBindTexture(GL_TEXTURE_2D, texture); -+ if (!texture_) { -+ GlGenTextures(1, &texture_); -+ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); -+ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); -+ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); -+ GlTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); -+ } -+ GlBindTexture(GL_TEXTURE_2D, texture_); - GlEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image); - -- src = std::make_unique(plane_datas[0].stride * size.height()); -+ if (!fbo_) { -+ GlGenFramebuffers(1, &fbo_); -+ } -+ -+ GlBindFramebuffer(GL_FRAMEBUFFER, fbo_); -+ GlFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, -+ texture_, 0); -+ if (GlCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) { -+ RTC_LOG(LS_ERROR) << "Failed to bind DMA buf framebuffer"; -+ EglDestroyImageKHR(egl_.display, image); -+ return false; -+ } - - GLenum gl_format = GL_BGRA; - switch (format) { -@@ -598,17 +649,18 @@ std::unique_ptr EglDmaBuf::ImageFromDmaBuf( - gl_format = GL_BGRA; - break; - } -- GlGetTexImage(GL_TEXTURE_2D, 0, gl_format, GL_UNSIGNED_BYTE, src.get()); - -- if (GlGetError()) { -+ GlReadPixels(offset.x(), offset.y(), buffer_size.width(), -+ buffer_size.height(), gl_format, GL_UNSIGNED_BYTE, data); -+ -+ const GLenum error = GlGetError(); -+ if (error) { - RTC_LOG(LS_ERROR) << "Failed to get image from DMA buffer."; -- return src; - } - -- GlDeleteTextures(1, &texture); - EglDestroyImageKHR(egl_.display, image); - -- return src; -+ return !error; - } - - RTC_NO_SANITIZE("cfi-icall") -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.h b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.h -index f1d96b2f80..22a8f5ab52 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.h -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.h -@@ -41,11 +41,15 @@ class EglDmaBuf { - EglDmaBuf(); - ~EglDmaBuf(); - -- std::unique_ptr ImageFromDmaBuf( -- const DesktopSize& size, -- uint32_t format, -- const std::vector& plane_datas, -- uint64_t modifiers); -+ // Returns whether the image was successfully imported from -+ // given DmaBuf and its parameters -+ bool ImageFromDmaBuf(const DesktopSize& size, -+ uint32_t format, -+ const std::vector& plane_datas, -+ uint64_t modifiers, -+ const DesktopVector& offset, -+ const DesktopSize& buffer_size, -+ uint8_t* data); - std::vector QueryDmaBufModifiers(uint32_t format); - - bool IsEglInitialized() const { return egl_initialized_; } -@@ -58,6 +62,8 @@ class EglDmaBuf { - int32_t drm_fd_ = -1; // for GBM buffer mmap - gbm_device* gbm_device_ = nullptr; // for passed GBM buffer retrieval - -+ GLuint fbo_ = 0; -+ GLuint texture_ = 0; - EGLStruct egl_; - - absl::optional GetRenderNode(); -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -index 0ca75d00fc..a8879764c7 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -@@ -149,6 +149,12 @@ class SharedScreenCastStreamPrivate { - struct spa_video_info_raw spa_video_format_; - - void ProcessBuffer(pw_buffer* buffer); -+ bool ProcessMemFDBuffer(pw_buffer* buffer, -+ DesktopFrame& frame, -+ const DesktopVector& offset); -+ bool ProcessDMABuffer(pw_buffer* buffer, -+ DesktopFrame& frame, -+ const DesktopVector& offset); - void ConvertRGBxToBGRx(uint8_t* frame, uint32_t size); - - // PipeWire callbacks -@@ -268,9 +274,8 @@ void SharedScreenCastStreamPrivate::OnStreamParamChanged( - std::vector params; - const int buffer_types = - has_modifier || (that->pw_server_version_ >= kDmaBufMinVersion) -- ? (1 << SPA_DATA_DmaBuf) | (1 << SPA_DATA_MemFd) | -- (1 << SPA_DATA_MemPtr) -- : (1 << SPA_DATA_MemFd) | (1 << SPA_DATA_MemPtr); -+ ? (1 << SPA_DATA_DmaBuf) | (1 << SPA_DATA_MemFd) -+ : (1 << SPA_DATA_MemFd); - - params.push_back(reinterpret_cast(spa_pod_builder_add_object( - &builder, SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers, -@@ -605,9 +610,6 @@ DesktopVector SharedScreenCastStreamPrivate::CaptureCursorPosition() { - RTC_NO_SANITIZE("cfi-icall") - void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { - spa_buffer* spa_buffer = buffer->buffer; -- ScopedBuf map; -- std::unique_ptr src_unique_ptr; -- uint8_t* src = nullptr; - - // Try to update the mouse cursor first, because it can be the only - // information carried by the buffer -@@ -641,76 +643,6 @@ void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { - return; - } - -- if (spa_buffer->datas[0].type == SPA_DATA_MemFd) { -- map.initialize( -- static_cast( -- mmap(nullptr, -- spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset, -- PROT_READ, MAP_PRIVATE, spa_buffer->datas[0].fd, 0)), -- spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset, -- spa_buffer->datas[0].fd); -- -- if (!map) { -- RTC_LOG(LS_ERROR) << "Failed to mmap the memory: " -- << std::strerror(errno); -- return; -- } -- -- src = SPA_MEMBER(map.get(), spa_buffer->datas[0].mapoffset, uint8_t); -- } else if (spa_buffer->datas[0].type == SPA_DATA_DmaBuf) { -- const uint n_planes = spa_buffer->n_datas; -- -- if (!n_planes) { -- return; -- } -- -- std::vector plane_datas; -- for (uint32_t i = 0; i < n_planes; ++i) { -- EglDmaBuf::PlaneData data = { -- static_cast(spa_buffer->datas[i].fd), -- static_cast(spa_buffer->datas[i].chunk->stride), -- static_cast(spa_buffer->datas[i].chunk->offset)}; -- plane_datas.push_back(data); -- } -- -- // When importing DMA-BUFs, we use the stride (number of bytes from one row -- // of pixels in the buffer) provided by PipeWire. The stride from PipeWire -- // is given by the graphics driver and some drivers might add some -- // additional padding for memory layout optimizations so not everytime the -- // stride is equal to BYTES_PER_PIXEL x WIDTH. This is fine, because during -- // the import we will use OpenGL and same graphics driver so it will be able -- // to work with the stride it provided, but later on when we work with -- // images we get from DMA-BUFs we will need to update the stride to be equal -- // to BYTES_PER_PIXEL x WIDTH as that's the size of the DesktopFrame we -- // allocate for each captured frame. -- src_unique_ptr = egl_dmabuf_->ImageFromDmaBuf( -- stream_size_, spa_video_format_.format, plane_datas, modifier_); -- if (src_unique_ptr) { -- src = src_unique_ptr.get(); -- } else { -- RTC_LOG(LS_ERROR) << "Dropping DMA-BUF modifier: " << modifier_ -- << " and trying to renegotiate stream parameters"; -- -- if (pw_server_version_ >= kDropSingleModifierMinVersion) { -- modifiers_.erase( -- std::remove(modifiers_.begin(), modifiers_.end(), modifier_), -- modifiers_.end()); -- } else { -- modifiers_.clear(); -- } -- -- pw_loop_signal_event(pw_thread_loop_get_loop(pw_main_loop_), -- renegotiate_); -- return; -- } -- } else if (spa_buffer->datas[0].type == SPA_DATA_MemPtr) { -- src = static_cast(spa_buffer->datas[0].data); -- } -- -- if (!src) { -- return; -- } -- - // Use SPA_META_VideoCrop metadata to get the frame size. KDE and GNOME do - // handle screen/window sharing differently. KDE/KWin doesn't use - // SPA_META_VideoCrop metadata and when sharing a window, it always sets -@@ -763,8 +695,8 @@ void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { - } - - // Get the position of the video crop within the stream. Just double-check -- // that the position doesn't exceed the size of the stream itself. NOTE: -- // Currently it looks there is no implementation using this. -+ // that the position doesn't exceed the size of the stream itself. -+ // NOTE: Currently it looks there is no implementation using this. - uint32_t y_offset = - videocrop_metadata_use && - (videocrop_metadata->region.position.y + frame_size_.height() <= -@@ -777,22 +709,7 @@ void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { - stream_size_.width()) - ? videocrop_metadata->region.position.x - : 0; -- -- const uint32_t stream_stride = kBytesPerPixel * stream_size_.width(); -- uint32_t buffer_stride = spa_buffer->datas[0].chunk->stride; -- uint32_t src_stride = buffer_stride; -- -- if (spa_buffer->datas[0].type == SPA_DATA_DmaBuf && -- buffer_stride > stream_stride) { -- // When DMA-BUFs are used, sometimes spa_buffer->stride we get might -- // contain additional padding, but after we import the buffer, the stride -- // we used is no longer relevant and we should just calculate it based on -- // the stream width. For more context see https://crbug.com/1333304. -- src_stride = stream_stride; -- } -- -- uint8_t* updated_src = -- src + (src_stride * y_offset) + (kBytesPerPixel * x_offset); -+ DesktopVector offset = DesktopVector(x_offset, y_offset); - - webrtc::MutexLock lock(&queue_lock_); - -@@ -813,9 +730,17 @@ void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { - queue_.ReplaceCurrentFrame(SharedDesktopFrame::Wrap(std::move(frame))); - } - -- queue_.current_frame()->CopyPixelsFrom( -- updated_src, (src_stride - (kBytesPerPixel * x_offset)), -- DesktopRect::MakeWH(frame_size_.width(), frame_size_.height())); -+ bool bufferProcessed = false; -+ if (spa_buffer->datas[0].type == SPA_DATA_MemFd) { -+ bufferProcessed = -+ ProcessMemFDBuffer(buffer, *queue_.current_frame(), offset); -+ } else if (spa_buffer->datas[0].type == SPA_DATA_DmaBuf) { -+ bufferProcessed = ProcessDMABuffer(buffer, *queue_.current_frame(), offset); -+ } -+ -+ if (!bufferProcessed) { -+ return; -+ } - - if (spa_video_format_.format == SPA_VIDEO_FORMAT_RGBx || - spa_video_format_.format == SPA_VIDEO_FORMAT_RGBA) { -@@ -832,6 +757,87 @@ void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { - DesktopRect::MakeSize(queue_.current_frame()->size())); - } - -+RTC_NO_SANITIZE("cfi-icall") -+bool SharedScreenCastStreamPrivate::ProcessMemFDBuffer( -+ pw_buffer* buffer, -+ DesktopFrame& frame, -+ const DesktopVector& offset) { -+ spa_buffer* spa_buffer = buffer->buffer; -+ ScopedBuf map; -+ uint8_t* src = nullptr; -+ -+ map.initialize( -+ static_cast( -+ mmap(nullptr, -+ spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset, -+ PROT_READ, MAP_PRIVATE, spa_buffer->datas[0].fd, 0)), -+ spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset, -+ spa_buffer->datas[0].fd); -+ -+ if (!map) { -+ RTC_LOG(LS_ERROR) << "Failed to mmap the memory: " << std::strerror(errno); -+ return false; -+ } -+ -+ src = SPA_MEMBER(map.get(), spa_buffer->datas[0].mapoffset, uint8_t); -+ -+ uint32_t buffer_stride = spa_buffer->datas[0].chunk->stride; -+ uint32_t src_stride = buffer_stride; -+ -+ uint8_t* updated_src = -+ src + (src_stride * offset.y()) + (kBytesPerPixel * offset.x()); -+ -+ frame.CopyPixelsFrom( -+ updated_src, (src_stride - (kBytesPerPixel * offset.x())), -+ DesktopRect::MakeWH(frame.size().width(), frame.size().height())); -+ -+ return true; -+} -+ -+RTC_NO_SANITIZE("cfi-icall") -+bool SharedScreenCastStreamPrivate::ProcessDMABuffer( -+ pw_buffer* buffer, -+ DesktopFrame& frame, -+ const DesktopVector& offset) { -+ spa_buffer* spa_buffer = buffer->buffer; -+ -+ const uint n_planes = spa_buffer->n_datas; -+ -+ if (!n_planes) { -+ return false; -+ } -+ -+ std::vector plane_datas; -+ for (uint32_t i = 0; i < n_planes; ++i) { -+ EglDmaBuf::PlaneData data = { -+ static_cast(spa_buffer->datas[i].fd), -+ static_cast(spa_buffer->datas[i].chunk->stride), -+ static_cast(spa_buffer->datas[i].chunk->offset)}; -+ plane_datas.push_back(data); -+ } -+ -+ const bool imported = egl_dmabuf_->ImageFromDmaBuf( -+ stream_size_, spa_video_format_.format, plane_datas, modifier_, offset, -+ frame.size(), frame.data()); -+ if (!imported) { -+ RTC_LOG(LS_ERROR) << "Dropping DMA-BUF modifier: " << modifier_ -+ << " and trying to renegotiate stream parameters"; -+ -+ if (pw_server_version_ >= kDropSingleModifierMinVersion) { -+ modifiers_.erase( -+ std::remove(modifiers_.begin(), modifiers_.end(), modifier_), -+ modifiers_.end()); -+ } else { -+ modifiers_.clear(); -+ } -+ -+ pw_loop_signal_event(pw_thread_loop_get_loop(pw_main_loop_), renegotiate_); -+ return false; -+ } -+ -+ return true; -+} -+ - void SharedScreenCastStreamPrivate::ConvertRGBxToBGRx(uint8_t* frame, - uint32_t size) { - for (uint32_t i = 0; i < size; i += 4) { diff --git a/mozilla-1663844.patch b/mozilla-1663844.patch deleted file mode 100644 index afa5168..0000000 --- a/mozilla-1663844.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff -up firefox-109.0/dom/media/gmp/GMPSharedMemManager.h.1663844 firefox-109.0/dom/media/gmp/GMPSharedMemManager.h ---- firefox-109.0/dom/media/gmp/GMPSharedMemManager.h.1663844 2023-01-09 20:34:10.000000000 +0100 -+++ firefox-109.0/dom/media/gmp/GMPSharedMemManager.h 2023-01-12 09:28:56.035741438 +0100 -@@ -26,7 +26,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-109.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp.1663844 firefox-109.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp ---- firefox-109.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp.1663844 2023-01-09 20:34:10.000000000 +0100 -+++ firefox-109.0/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp 2023-01-12 09:28:56.036741473 +0100 -@@ -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-109.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp.1663844 firefox-109.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp ---- firefox-109.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp.1663844 2023-01-12 09:28:56.036741473 +0100 -+++ firefox-109.0/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp 2023-01-12 14:18:12.354866405 +0100 -@@ -81,6 +81,8 @@ void GMPVideoDecoder::Decoded(GMPVideoi4 - }); - - mDecodedData.AppendElement(std::move(v)); -+ mDecodePromise.ResolveIfExists(std::move(mDecodedData), __func__); -+ mDecodedData = DecodedData(); - } else { - mDecodedData.Clear(); - mDecodePromise.RejectIfExists( diff --git a/sources b/sources index 8d680a8..6692eda 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 -SHA512 (firefox-langpacks-112.0.2-20230427.tar.xz) = 20a1bd9c9de131fd544d379a2867294cd6d9812bf7d66e8e2237c40eb86e1a44a1c5bc194f9f38e1249ded947d00ae9d0c695ea2813a46997ec64ced7b07e89e -SHA512 (firefox-112.0.2.source.tar.xz) = 2cd7adeb6c9a39ad4c5366982e0e58382d7f205e6f2cee02b8ec2867034d1c0c884eeeb870a35db35cba60fa9c84aea73f8c77cfd9f36b5146dde06464aaabd1 +SHA512 (firefox-langpacks-113.0-20230509.tar.xz) = 090478c1e29540bc99fe1857c83ec93da0dab5b44c5f8765d14e51a30ff5baf2fe8983e997fe0980efc69afbce6dc185899a9bc39826e55294472a327d53efc2 +SHA512 (firefox-113.0.source.tar.xz) = 96b0f0774083270f4fcce06085b177ced25ba05da7291d777f1da1d5bbad30721bc6363b76e06ccb64fc092778c8326a426a8bfdfa3cbaafd4f1169b924744a5 From b44a610b50f237d6151437f6efbac156896f5f24 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 15 May 2023 12:08:17 +0200 Subject: [PATCH 199/545] Updated to 113.0.1 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index b6ba97b..d6f4a01 100644 --- a/.gitignore +++ b/.gitignore @@ -573,3 +573,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-112.0.2.source.tar.xz /firefox-langpacks-113.0-20230509.tar.xz /firefox-113.0.source.tar.xz +/firefox-langpacks-113.0.1-20230515.tar.xz +/firefox-113.0.1.source.tar.xz diff --git a/firefox.spec b/firefox.spec index 09ac3db..792ef2f 100644 --- a/firefox.spec +++ b/firefox.spec @@ -175,13 +175,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 113.0 +Version: 113.0.1 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230509.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230515.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1082,6 +1082,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon May 15 2023 Martin Stransky - 113.0.1-1 +- Updated to 113.0.1 + * Tue May 9 2023 Martin Stransky - 113.0-1 - Updated to 113.0 diff --git a/sources b/sources index 6692eda..ba60730 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 -SHA512 (firefox-langpacks-113.0-20230509.tar.xz) = 090478c1e29540bc99fe1857c83ec93da0dab5b44c5f8765d14e51a30ff5baf2fe8983e997fe0980efc69afbce6dc185899a9bc39826e55294472a327d53efc2 -SHA512 (firefox-113.0.source.tar.xz) = 96b0f0774083270f4fcce06085b177ced25ba05da7291d777f1da1d5bbad30721bc6363b76e06ccb64fc092778c8326a426a8bfdfa3cbaafd4f1169b924744a5 +SHA512 (firefox-langpacks-113.0.1-20230515.tar.xz) = 93ddbcd8c0a98d4ddce356824a3aa305a6c110bd736912d5144253847aa91de80c5e6135f68e79e9c2aea8417225c57bd6328f7c7504accfddaf72fda57881d6 +SHA512 (firefox-113.0.1.source.tar.xz) = 67d6b777d138ef55dd813a15a483d0588181f3b83ba8da52bf6c1f10a58ab1d907a80afcfc1aa90b65405852b50d083f05032b32d3fdb153317f2df7f1f15db3 From 4bb32b239068a3695b2eb4cf94af4b20e9487f2d Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Tue, 16 May 2023 09:44:06 +0200 Subject: [PATCH 200/545] Backport libwebrtc commit 7b0d7f48fb Fix fcntl call when duplicating a file descriptor --- firefox.spec | 8 +++++++- mozilla-1832770.patch | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 mozilla-1832770.patch diff --git a/firefox.spec b/firefox.spec index 792ef2f..6571d5c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -176,7 +176,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 113.0.1 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -250,6 +250,7 @@ Patch230: firefox-enable-vaapi.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch +Patch408: mozilla-1832770.patch # TODO: do we need it? #Patch415: mozilla-1670333.patch @@ -530,6 +531,7 @@ This package contains results of tests executed during build. %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 +%patch408 -p1 -b .1832770 # TODO: do we need it? #%patch415 -p1 -b .1670333 @@ -1082,6 +1084,10 @@ fi #--------------------------------------------------------------------- %changelog +* Tue May 16 2023 Jan Grulich - 113.0.1-2 +- Backport libwebrtc commit 7b0d7f48fb + Fix fcntl call when duplicating a file descriptor + * Mon May 15 2023 Martin Stransky - 113.0.1-1 - Updated to 113.0.1 diff --git a/mozilla-1832770.patch b/mozilla-1832770.patch new file mode 100644 index 0000000..68a2c56 --- /dev/null +++ b/mozilla-1832770.patch @@ -0,0 +1,16 @@ +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +--- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +@@ -434,11 +434,11 @@ + { + PipeWireThreadLoopLock thread_loop_lock(pw_main_loop_); + + if (fd >= 0) { + pw_core_ = pw_context_connect_fd( +- pw_context_, fcntl(fd, F_DUPFD_CLOEXEC), nullptr, 0); ++ pw_context_, fcntl(fd, F_DUPFD_CLOEXEC, 0), nullptr, 0); + } else { + pw_core_ = pw_context_connect(pw_context_, nullptr, 0); + } + + if (!pw_core_) { From d13c7dc2b6f98a138c6dd67d26e891e0b452c319 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 19 May 2023 13:06:14 +0200 Subject: [PATCH 201/545] Disabled libproxy support due to regressions (rhbz#2207469) --- firefox-mozconfig | 1 - firefox.spec | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/firefox-mozconfig b/firefox-mozconfig index af5d664..676a0e0 100644 --- a/firefox-mozconfig +++ b/firefox-mozconfig @@ -16,7 +16,6 @@ ac_add_options --enable-js-shell ac_add_options --with-unsigned-addon-scopes=app,system ac_add_options --without-sysroot ac_add_options --without-wasm-sandboxed-libraries -ac_add_options --enable-libproxy export BUILD_OFFICIAL=1 export MOZILLA_OFFICIAL=1 diff --git a/firefox.spec b/firefox.spec index 6571d5c..a0f11f8 100644 --- a/firefox.spec +++ b/firefox.spec @@ -176,7 +176,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 113.0.1 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1084,6 +1084,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri May 19 2023 Martin Stransky - 113.0.1-3 +- Disabled libproxy support due to regressions (rhbz#2207469) + * Tue May 16 2023 Jan Grulich - 113.0.1-2 - Backport libwebrtc commit 7b0d7f48fb Fix fcntl call when duplicating a file descriptor From fc3b817e29e01a619aee70ea7f927e7a782a5d02 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 24 May 2023 11:08:25 +0200 Subject: [PATCH 202/545] Added rawhide rust fix, added patches from 113.0.2 --- D177258.diff | 181 +++++++++++++++++++++++++++++++++++++++++++++++++++ D177902.diff | 32 +++++++++ D178251.diff | 104 +++++++++++++++++++++++++++++ firefox.spec | 12 +++- 4 files changed, 328 insertions(+), 1 deletion(-) create mode 100644 D177258.diff create mode 100644 D177902.diff create mode 100644 D178251.diff diff --git a/D177258.diff b/D177258.diff new file mode 100644 index 0000000..0317a9d --- /dev/null +++ b/D177258.diff @@ -0,0 +1,181 @@ +diff --git a/layout/reftests/xul/reftest.list b/layout/reftests/xul/reftest.list +--- a/layout/reftests/xul/reftest.list ++++ b/layout/reftests/xul/reftest.list +@@ -70,10 +70,12 @@ + skip == chrome://reftest/content/xul/treecell-image-svg-1b.xhtml chrome://reftest/content/xul/treecell-image-svg-1-ref.xhtml # bug 1218954 + + != chrome://reftest/content/xul/treetwisty-svg-context-paint-1-not-ref.xhtml chrome://reftest/content/xul/treetwisty-svg-context-paint-1-ref.xhtml + test-pref(svg.context-properties.content.enabled,true) fuzzy(0-26,0-2) == chrome://reftest/content/xul/treetwisty-svg-context-paint-1.xhtml chrome://reftest/content/xul/treetwisty-svg-context-paint-1-ref.xhtml + ++== chrome://reftest/content/xul/tree-scrollbar-height-change.xhtml chrome://reftest/content/xul/tree-scrollbar-height-change-ref.xhtml ++ + # resizer (non-native-themed) + + != chrome://reftest/content/xul/resizer-bottomend.xhtml chrome://reftest/content/xul/blank-window.xhtml + == chrome://reftest/content/xul/resizer-bottomend.xhtml chrome://reftest/content/xul/resizer-bottomright.xhtml + != chrome://reftest/content/xul/resizer-bottomend.xhtml chrome://reftest/content/xul/resizer-bottomend-rtl.xhtml +diff --git a/layout/reftests/xul/tree-scrollbar-height-change-ref.xhtml b/layout/reftests/xul/tree-scrollbar-height-change-ref.xhtml +new file mode 100644 +--- /dev/null ++++ b/layout/reftests/xul/tree-scrollbar-height-change-ref.xhtml +@@ -0,0 +1,32 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/layout/reftests/xul/tree-scrollbar-height-change.xhtml b/layout/reftests/xul/tree-scrollbar-height-change.xhtml +new file mode 100644 +--- /dev/null ++++ b/layout/reftests/xul/tree-scrollbar-height-change.xhtml +@@ -0,0 +1,39 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/layout/xul/tree/nsTreeBodyFrame.h b/layout/xul/tree/nsTreeBodyFrame.h +--- a/layout/xul/tree/nsTreeBodyFrame.h ++++ b/layout/xul/tree/nsTreeBodyFrame.h +@@ -114,11 +114,11 @@ + nsresult ClearStyleAndImageCaches(); + void RemoveImageCacheEntry(int32_t aRowIndex, nsTreeColumn* aCol); + + void CancelImageRequests(); + +- void ManageReflowCallback(const nsRect& aRect, nscoord aHorzWidth); ++ void ManageReflowCallback(); + + void DidReflow(nsPresContext*, const ReflowInput*) override; + + // nsIReflowCallback + bool ReflowFinished() override; +@@ -566,10 +566,13 @@ + nscoord mHorzWidth; + // The amount by which to adjust the width of the last cell. + // This depends on whether or not the columnpicker and scrollbars are present. + nscoord mAdjustWidth; + ++ // Our last reflowed rect, used for invalidation, see ManageReflowCallback(). ++ Maybe mLastReflowRect; ++ + // Cached heights and indent info. + nsRect mInnerBox; // 4-byte aligned + int32_t mRowHeight; + int32_t mIndentation; + +diff --git a/layout/xul/tree/nsTreeBodyFrame.cpp b/layout/xul/tree/nsTreeBodyFrame.cpp +--- a/layout/xul/tree/nsTreeBodyFrame.cpp ++++ b/layout/xul/tree/nsTreeBodyFrame.cpp +@@ -363,34 +363,37 @@ + // XXX is this optimal if we haven't laid out yet? + ScrollToRow(rowIndex); + NS_ENSURE_TRUE_VOID(weakFrame.IsAlive()); + } + +-void nsTreeBodyFrame::ManageReflowCallback(const nsRect& aRect, +- nscoord aHorzWidth) { +- if (!mReflowCallbackPosted && +- (!aRect.IsEqualEdges(mRect) || mHorzWidth != aHorzWidth)) { +- PresShell()->PostReflowCallback(this); +- mReflowCallbackPosted = true; +- mOriginalHorzWidth = mHorzWidth; +- } else if (mReflowCallbackPosted && mHorzWidth != aHorzWidth && +- mOriginalHorzWidth == aHorzWidth) { ++void nsTreeBodyFrame::ManageReflowCallback() { ++ const nscoord horzWidth = CalcHorzWidth(GetScrollParts()); ++ if (!mReflowCallbackPosted) { ++ if (!mLastReflowRect || !mLastReflowRect->IsEqualEdges(mRect) || ++ mHorzWidth != horzWidth) { ++ PresShell()->PostReflowCallback(this); ++ mReflowCallbackPosted = true; ++ mOriginalHorzWidth = mHorzWidth; ++ } ++ } else if (mHorzWidth != horzWidth && mOriginalHorzWidth == horzWidth) { ++ // FIXME(emilio): This doesn't seem sound to me, if the rect changes in the ++ // block axis. + PresShell()->CancelReflowCallback(this); + mReflowCallbackPosted = false; + mOriginalHorzWidth = -1; + } ++ mLastReflowRect = Some(mRect); ++ mHorzWidth = horzWidth; + } + + nscoord nsTreeBodyFrame::GetIntrinsicBSize() { + return mHasFixedRowCount ? mRowHeight * mPageLength : 0; + } + + void nsTreeBodyFrame::DidReflow(nsPresContext* aPresContext, + const ReflowInput* aReflowInput) { +- nscoord horzWidth = CalcHorzWidth(GetScrollParts()); +- ManageReflowCallback(GetRect(), horzWidth); +- mHorzWidth = horzWidth; ++ ManageReflowCallback(); + SimpleXULLeafFrame::DidReflow(aPresContext, aReflowInput); + } + + bool nsTreeBodyFrame::ReflowFinished() { + if (!mView) { + diff --git a/D177902.diff b/D177902.diff new file mode 100644 index 0000000..04a8f6f --- /dev/null +++ b/D177902.diff @@ -0,0 +1,32 @@ +diff --git a/devtools/server/actors/resources/console-messages.js b/devtools/server/actors/resources/console-messages.js +--- a/devtools/server/actors/resources/console-messages.js ++++ b/devtools/server/actors/resources/console-messages.js +@@ -64,16 +64,23 @@ + // that process (window and window-less). + // To do that we pass a null window and ConsoleAPIListener will catch everything. + // And also ignore WebExtension as we will filter out only by addonId, which is + // passed via consoleAPIListenerOptions. WebExtension may have multiple windows/documents + // but all of them will be flagged with the same addon ID. +- const window = ++ const messagesShouldMatchWindow = + targetActor.targetType === Targets.TYPES.FRAME && + targetActor.typeName != "parentProcessTarget" && +- targetActor.typeName != "webExtensionTarget" +- ? targetActor.window +- : null; ++ targetActor.typeName != "webExtensionTarget"; ++ const window = messagesShouldMatchWindow ? targetActor.window : null; ++ ++ // If we should match messages for a given window but for some reason, targetActor.window ++ // did not return a window, bail out. Otherwise we wouldn't have anything to match against ++ // and would consume all the messages, which could lead to issue (e.g. infinite loop, ++ // see Bug 1828026). ++ if (messagesShouldMatchWindow && !window) { ++ return; ++ } + + const listener = new ConsoleAPIListener(window, onConsoleAPICall, { + excludeMessagesBoundToWindow: isTargetActorContentProcess, + matchExactWindow: targetActor.ignoreSubFrames, + ...(targetActor.consoleAPIListenerOptions || {}), + diff --git a/D178251.diff b/D178251.diff new file mode 100644 index 0000000..249f9e5 --- /dev/null +++ b/D178251.diff @@ -0,0 +1,104 @@ +diff -up firefox-113.0.1/Cargo.lock.D178251 firefox-113.0.1/Cargo.lock +--- firefox-113.0.1/Cargo.lock.D178251 2023-05-12 00:09:22.000000000 +0200 ++++ firefox-113.0.1/Cargo.lock 2023-05-24 10:55:51.177278597 +0200 +@@ -417,8 +417,6 @@ dependencies = [ + [[package]] + name = "bindgen" + version = "0.64.0" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" + dependencies = [ + "bitflags 1.3.2", + "cexpr", +diff -up firefox-113.0.1/Cargo.toml.D178251 firefox-113.0.1/Cargo.toml +--- firefox-113.0.1/Cargo.toml.D178251 2023-05-12 00:09:22.000000000 +0200 ++++ firefox-113.0.1/Cargo.toml 2023-05-24 10:56:39.836959570 +0200 +@@ -119,7 +119,7 @@ tinyvec = { path = "build/rust/tinyvec" + wasi = { path = "build/rust/wasi" } + + # Patch bindgen 0.63 to 0.64 +-bindgen = { path = "build/rust/bindgen" } ++bindgen_0_63 = { package = "bindgen", path = "build/rust/bindgen" } + + # Patch memoffset 0.6 to 0.8 + memoffset = { path = "build/rust/memoffset" } +@@ -145,6 +145,9 @@ web-sys = { path = "build/rust/dummy-web + # Overrides to allow easier use of common internal crates. + moz_asserts = { path = "mozglue/static/rust/moz_asserts" } + ++# Patch bindgen to work around issues with some unsound transmutes when compiling with LLVM 16+. ++bindgen = { path = "third_party/rust/bindgen" } ++ + # Patch `rure` to disable building the cdylib and staticlib targets + # Cargo has no way to disable building targets your dependencies provide which + # you don't depend on, and linking the cdylib breaks during instrumentation +diff -up firefox-113.0.1/supply-chain/config.toml.D178251 firefox-113.0.1/supply-chain/config.toml +--- firefox-113.0.1/supply-chain/config.toml.D178251 2023-05-12 00:09:23.000000000 +0200 ++++ firefox-113.0.1/supply-chain/config.toml 2023-05-24 10:55:51.178278632 +0200 +@@ -23,6 +23,10 @@ url = "https://raw.githubusercontent.com + audit-as-crates-io = true + notes = "This is the upstream code plus a few local fixes, see bug 1685697." + ++[policy."bindgen:0.64.0"] ++audit-as-crates-io = true ++notes = "This is a local override of the bindgen crate from crates.io, with a small local patch." ++ + [policy.chardetng] + audit-as-crates-io = true + notes = "This is a crate Henri wrote which is also published. We should probably update Firefox to tip and certify that." +diff -up firefox-113.0.1/third_party/rust/bindgen/codegen/mod.rs.D178251 firefox-113.0.1/third_party/rust/bindgen/codegen/mod.rs +--- firefox-113.0.1/third_party/rust/bindgen/codegen/mod.rs.D178251 2023-05-11 23:42:49.000000000 +0200 ++++ firefox-113.0.1/third_party/rust/bindgen/codegen/mod.rs 2023-05-24 10:55:51.178278632 +0200 +@@ -141,12 +141,13 @@ fn derives_of_item( + item: &Item, + ctx: &BindgenContext, + packed: bool, ++ forward_decl: bool, + ) -> DerivableTraits { + let mut derivable_traits = DerivableTraits::empty(); + + let all_template_params = item.all_template_params(ctx); + +- if item.can_derive_copy(ctx) && !item.annotations().disallow_copy() { ++ if item.can_derive_copy(ctx) && !item.annotations().disallow_copy() && !forward_decl { + derivable_traits |= DerivableTraits::COPY; + + if ctx.options().rust_features().builtin_clone_impls || +@@ -991,7 +992,7 @@ impl CodeGenerator for Type { + vec![attributes::repr("transparent")]; + let packed = false; // Types can't be packed in Rust. + let derivable_traits = +- derives_of_item(item, ctx, packed); ++ derives_of_item(item, ctx, packed, false); + if !derivable_traits.is_empty() { + let derives: Vec<_> = derivable_traits.into(); + attributes.push(attributes::derives(&derives)) +@@ -2032,8 +2033,9 @@ impl CodeGenerator for CompInfo { + } + + if forward_decl { ++ let prefix = ctx.trait_prefix(); + fields.push(quote! { +- _unused: [u8; 0], ++ _unused: ::#prefix::cell::UnsafeCell<[u8; 0]>, + }); + } + +@@ -2095,7 +2097,7 @@ impl CodeGenerator for CompInfo { + } + } + +- let derivable_traits = derives_of_item(item, ctx, packed); ++ let derivable_traits = derives_of_item(item, ctx, packed, self.is_forward_declaration()); + if !derivable_traits.contains(DerivableTraits::DEBUG) { + needs_debug_impl = ctx.options().derive_debug && + ctx.options().impl_debug && +@@ -3127,7 +3129,7 @@ impl CodeGenerator for Enum { + + if !variation.is_const() { + let packed = false; // Enums can't be packed in Rust. +- let mut derives = derives_of_item(item, ctx, packed); ++ let mut derives = derives_of_item(item, ctx, packed, false); + // For backwards compat, enums always derive + // Clone/Eq/PartialEq/Hash, even if we don't generate those by + // default. diff --git a/firefox.spec b/firefox.spec index a0f11f8..ed2a8e2 100644 --- a/firefox.spec +++ b/firefox.spec @@ -176,7 +176,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 113.0.1 -Release: 3%{?pre_tag}%{?dist} +Release: 4%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -253,6 +253,9 @@ Patch407: mozilla-1667096.patch Patch408: mozilla-1832770.patch # TODO: do we need it? #Patch415: mozilla-1670333.patch +Patch410: D177258.diff +Patch411: D177902.diff +Patch412: D178251.diff # PGO/LTO patches Patch600: pgo.patch @@ -534,6 +537,9 @@ This package contains results of tests executed during build. %patch408 -p1 -b .1832770 # TODO: do we need it? #%patch415 -p1 -b .1670333 +%patch410 -p1 -b .D177258 +%patch411 -p1 -b .D177902 +%patch412 -p1 -b .D178251 # PGO patches %if %{build_with_pgo} @@ -1084,6 +1090,10 @@ fi #--------------------------------------------------------------------- %changelog +* Wed May 24 2023 Martin Stransky - 113.0.1-4 +- Added patches from 113.0.2 +- Added Rust fix for Rawhide (mzbz#1831242). + * Fri May 19 2023 Martin Stransky - 113.0.1-3 - Disabled libproxy support due to regressions (rhbz#2207469) From fc6d180230a96524529cd5686d4201a68d5daa6c Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Tue, 16 May 2023 13:07:14 +0200 Subject: [PATCH 203/545] Drop arm build conditionals F36 was the last release that supported 32 bit arm architectures and F36 just reached EOL. --- firefox.spec | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/firefox.spec b/firefox.spec index ed2a8e2..50c4701 100644 --- a/firefox.spec +++ b/firefox.spec @@ -40,14 +40,6 @@ ExcludeArch: i686 %global build_with_clang 0 %endif -%ifarch armv7hl -%global create_debuginfo 0 - -# always use clang for arm builds -%global toolchain clang -%global build_with_clang 1 -%endif - # Temporary disabled due to # https://bugzilla.redhat.com/show_bug.cgi?id=1951606 %global enable_mozilla_crashreporter 0 @@ -67,11 +59,7 @@ ExcludeArch: i686 %endif %global system_ffi 1 -%ifarch armv7hl -%global system_libvpx 1 -%else %global system_libvpx 0 -%endif %global system_jpeg 1 %global system_pixman 1 %global use_bundled_cbindgen 1 @@ -148,12 +136,9 @@ ExcludeArch: i686 %if !%{release_build} %global pre_tag .npgo %endif -# Don't use 'clang' suffix on arm -%ifnarch %{arm} %if %{build_with_clang} %global pre_tag .clang %endif -%endif %if %{build_with_asan} %global pre_tag .asan %global build_with_pgo 0 @@ -582,7 +567,7 @@ echo "ac_add_options --with-system-libevent" >> .mozconfig echo "ac_add_options --enable-system-ffi" >> .mozconfig %endif -%ifarch %{arm} aarch64 +%ifarch aarch64 echo "ac_add_options --disable-elf-hack" >> .mozconfig %endif @@ -703,7 +688,7 @@ MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | sed -e 's/-O2//') # If MOZ_DEBUG_FLAGS is empty, firefox's build will default it to "-g" which # overrides the -g1 from line above and breaks building on s390/arm # (OOM when linking, rhbz#1238225) -%ifarch %{arm} %{ix86} +%ifarch %{ix86} MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | sed -e 's/-g/-g0/') export MOZ_DEBUG_FLAGS=" " %endif @@ -712,12 +697,8 @@ MOZ_LINK_FLAGS="%{build_ldflags}" %ifarch aarch64 %{ix86} MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" %endif -%ifarch %{arm} -MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -Wl,--no-keep-memory -Wl,--strip-debug" -echo "ac_add_options --enable-linker=gold" >> .mozconfig %endif -%endif -%ifarch %{arm} %{ix86} s390x +%ifarch %{ix86} s390x export RUSTFLAGS="-Cdebuginfo=0" %endif %if %{build_with_asan} @@ -725,16 +706,6 @@ MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fsanitize=address -Dxmalloc=myxmalloc" MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -fsanitize=address -ldl" %endif -%ifarch %{arm} -# disable hard-coded LTO due to RAM constraints -sed -i '/cargo_rustc_flags += -Clto/d' config/makefiles/rust.mk -sed -i '/RUSTFLAGS += -Cembed-bitcode=yes/d' config/makefiles/rust.mk -sed -i 's/codegen-units=1/codegen-units=16/' config/makefiles/rust.mk - -# make sure "-g0" is the last flag so there's no debug info -MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -g0" -%endif - # We don't wantfirefox to use CK_GCM_PARAMS_V3 in nss MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -DNSS_PKCS11_3_0_STRICT" From 7f69d4c3f08e4485d2b1030095b4d45c606228b5 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Tue, 16 May 2023 13:15:02 +0200 Subject: [PATCH 204/545] Drop an arm-specific patch We don't build for 32 bit arm any more now that F36 is EOL. --- firefox.spec | 4 ---- work-around-GCC-ICE-on-arm.patch | 12 ------------ 2 files changed, 16 deletions(-) delete mode 100644 work-around-GCC-ICE-on-arm.patch diff --git a/firefox.spec b/firefox.spec index 50c4701..5ba0942 100644 --- a/firefox.spec +++ b/firefox.spec @@ -246,9 +246,6 @@ Patch412: D178251.diff Patch600: pgo.patch Patch602: mozilla-1516803.patch -# a patch for compiling with gcc on arm (from debian) -Patch990: work-around-GCC-ICE-on-arm.patch - # Work around broken moz.build file on ppc64le (mozb#1779545, mozb#1775202) Patch1100: mozilla-1775202.patch @@ -534,7 +531,6 @@ This package contains results of tests executed during build. %endif %endif -%patch990 -p1 -b .work-around-GCC-ICE-on-arm %patch1100 -p1 -b .ppc-mobzuild %patch1200 -p1 -b .rustflags-commasplit diff --git a/work-around-GCC-ICE-on-arm.patch b/work-around-GCC-ICE-on-arm.patch deleted file mode 100644 index b65c647..0000000 --- a/work-around-GCC-ICE-on-arm.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur a/gfx/skia/skia/third_party/skcms/src/Transform_inl.h b/gfx/skia/skia/third_party/skcms/src/Transform_inl.h ---- a/gfx/skia/skia/third_party/skcms/src/Transform_inl.h 2022-05-27 08:37:14.642698922 +0300 -+++ b/gfx/skia/skia/third_party/skcms/src/Transform_inl.h 2022-05-27 12:23:43.592185545 +0300 -@@ -683,7 +683,7 @@ - // GCC 7.2.0 hits an internal compiler error with -finline-functions (or -O3) - // when targeting MIPS 64, i386, or s390x, I think attempting to inline clut() into exec_ops(). - #if 1 && defined(__GNUC__) && !defined(__clang__) \ -- && (defined(__mips64) || defined(__i386) || defined(__s390x__)) -+ && (defined(__arm__) || defined(__mips64) || defined(__i386) || defined(__s390x__)) - #define MAYBE_NOINLINE __attribute__((noinline)) - #else - #define MAYBE_NOINLINE From d693ba16a52d779bc76e74c5d6ab02ae5a8866b6 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Tue, 16 May 2023 13:16:17 +0200 Subject: [PATCH 205/545] Drop F37 build conditionals Now that F36 is EOL, we can get rid of ">= 37" conditionals that always evaluate to true. --- firefox.spec | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/firefox.spec b/firefox.spec index 5ba0942..c8f345b 100644 --- a/firefox.spec +++ b/firefox.spec @@ -21,13 +21,9 @@ ExcludeArch: i686 # as the build is *very* slow. %global debug_build 0 -# See rhbz#2134527 - Use portal Gtk file dialog on Fedora 37+ +# See rhbz#2134527 - Use portal Gtk file dialog # Disabled due to various issues now. -%if 0%{?fedora} >= 37 %global use_xdg_file_portal 0 -%else -%global use_xdg_file_portal 0 -%endif %global system_nss 1 %global system_libevent 1 @@ -128,10 +124,8 @@ ExcludeArch: i686 %bcond_without langpacks %if %{with langpacks} -%if 0%{?fedora} >= 37 %bcond_without langpacks_subpkg %endif -%endif %if !%{release_build} %global pre_tag .npgo From 39bb25cd6f56802e2165860bfb74d1cc7df74096 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 5 Jun 2023 13:32:25 +0200 Subject: [PATCH 206/545] Updated to 114.0 --- .gitignore | 2 + D177258.diff | 181 --------------------------------------- D177902.diff | 32 ------- D178251.diff | 104 ---------------------- build-aarch64-skia.patch | 54 ++++-------- firefox.spec | 34 ++------ mozilla-1670333.patch | 68 --------------- mozilla-1775202.patch | 14 --- mozilla-1832770.patch | 16 ---- mozilla-build-arm.patch | 14 --- sources | 4 +- 11 files changed, 30 insertions(+), 493 deletions(-) delete mode 100644 D177258.diff delete mode 100644 D177902.diff delete mode 100644 D178251.diff delete mode 100644 mozilla-1670333.patch delete mode 100644 mozilla-1775202.patch delete mode 100644 mozilla-1832770.patch delete mode 100644 mozilla-build-arm.patch diff --git a/.gitignore b/.gitignore index d6f4a01..214ebb8 100644 --- a/.gitignore +++ b/.gitignore @@ -575,3 +575,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-113.0.source.tar.xz /firefox-langpacks-113.0.1-20230515.tar.xz /firefox-113.0.1.source.tar.xz +/firefox-114.0.source.tar.xz +/firefox-langpacks-114.0-20230605.tar.xz diff --git a/D177258.diff b/D177258.diff deleted file mode 100644 index 0317a9d..0000000 --- a/D177258.diff +++ /dev/null @@ -1,181 +0,0 @@ -diff --git a/layout/reftests/xul/reftest.list b/layout/reftests/xul/reftest.list ---- a/layout/reftests/xul/reftest.list -+++ b/layout/reftests/xul/reftest.list -@@ -70,10 +70,12 @@ - skip == chrome://reftest/content/xul/treecell-image-svg-1b.xhtml chrome://reftest/content/xul/treecell-image-svg-1-ref.xhtml # bug 1218954 - - != chrome://reftest/content/xul/treetwisty-svg-context-paint-1-not-ref.xhtml chrome://reftest/content/xul/treetwisty-svg-context-paint-1-ref.xhtml - test-pref(svg.context-properties.content.enabled,true) fuzzy(0-26,0-2) == chrome://reftest/content/xul/treetwisty-svg-context-paint-1.xhtml chrome://reftest/content/xul/treetwisty-svg-context-paint-1-ref.xhtml - -+== chrome://reftest/content/xul/tree-scrollbar-height-change.xhtml chrome://reftest/content/xul/tree-scrollbar-height-change-ref.xhtml -+ - # resizer (non-native-themed) - - != chrome://reftest/content/xul/resizer-bottomend.xhtml chrome://reftest/content/xul/blank-window.xhtml - == chrome://reftest/content/xul/resizer-bottomend.xhtml chrome://reftest/content/xul/resizer-bottomright.xhtml - != chrome://reftest/content/xul/resizer-bottomend.xhtml chrome://reftest/content/xul/resizer-bottomend-rtl.xhtml -diff --git a/layout/reftests/xul/tree-scrollbar-height-change-ref.xhtml b/layout/reftests/xul/tree-scrollbar-height-change-ref.xhtml -new file mode 100644 ---- /dev/null -+++ b/layout/reftests/xul/tree-scrollbar-height-change-ref.xhtml -@@ -0,0 +1,32 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/layout/reftests/xul/tree-scrollbar-height-change.xhtml b/layout/reftests/xul/tree-scrollbar-height-change.xhtml -new file mode 100644 ---- /dev/null -+++ b/layout/reftests/xul/tree-scrollbar-height-change.xhtml -@@ -0,0 +1,39 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/layout/xul/tree/nsTreeBodyFrame.h b/layout/xul/tree/nsTreeBodyFrame.h ---- a/layout/xul/tree/nsTreeBodyFrame.h -+++ b/layout/xul/tree/nsTreeBodyFrame.h -@@ -114,11 +114,11 @@ - nsresult ClearStyleAndImageCaches(); - void RemoveImageCacheEntry(int32_t aRowIndex, nsTreeColumn* aCol); - - void CancelImageRequests(); - -- void ManageReflowCallback(const nsRect& aRect, nscoord aHorzWidth); -+ void ManageReflowCallback(); - - void DidReflow(nsPresContext*, const ReflowInput*) override; - - // nsIReflowCallback - bool ReflowFinished() override; -@@ -566,10 +566,13 @@ - nscoord mHorzWidth; - // The amount by which to adjust the width of the last cell. - // This depends on whether or not the columnpicker and scrollbars are present. - nscoord mAdjustWidth; - -+ // Our last reflowed rect, used for invalidation, see ManageReflowCallback(). -+ Maybe mLastReflowRect; -+ - // Cached heights and indent info. - nsRect mInnerBox; // 4-byte aligned - int32_t mRowHeight; - int32_t mIndentation; - -diff --git a/layout/xul/tree/nsTreeBodyFrame.cpp b/layout/xul/tree/nsTreeBodyFrame.cpp ---- a/layout/xul/tree/nsTreeBodyFrame.cpp -+++ b/layout/xul/tree/nsTreeBodyFrame.cpp -@@ -363,34 +363,37 @@ - // XXX is this optimal if we haven't laid out yet? - ScrollToRow(rowIndex); - NS_ENSURE_TRUE_VOID(weakFrame.IsAlive()); - } - --void nsTreeBodyFrame::ManageReflowCallback(const nsRect& aRect, -- nscoord aHorzWidth) { -- if (!mReflowCallbackPosted && -- (!aRect.IsEqualEdges(mRect) || mHorzWidth != aHorzWidth)) { -- PresShell()->PostReflowCallback(this); -- mReflowCallbackPosted = true; -- mOriginalHorzWidth = mHorzWidth; -- } else if (mReflowCallbackPosted && mHorzWidth != aHorzWidth && -- mOriginalHorzWidth == aHorzWidth) { -+void nsTreeBodyFrame::ManageReflowCallback() { -+ const nscoord horzWidth = CalcHorzWidth(GetScrollParts()); -+ if (!mReflowCallbackPosted) { -+ if (!mLastReflowRect || !mLastReflowRect->IsEqualEdges(mRect) || -+ mHorzWidth != horzWidth) { -+ PresShell()->PostReflowCallback(this); -+ mReflowCallbackPosted = true; -+ mOriginalHorzWidth = mHorzWidth; -+ } -+ } else if (mHorzWidth != horzWidth && mOriginalHorzWidth == horzWidth) { -+ // FIXME(emilio): This doesn't seem sound to me, if the rect changes in the -+ // block axis. - PresShell()->CancelReflowCallback(this); - mReflowCallbackPosted = false; - mOriginalHorzWidth = -1; - } -+ mLastReflowRect = Some(mRect); -+ mHorzWidth = horzWidth; - } - - nscoord nsTreeBodyFrame::GetIntrinsicBSize() { - return mHasFixedRowCount ? mRowHeight * mPageLength : 0; - } - - void nsTreeBodyFrame::DidReflow(nsPresContext* aPresContext, - const ReflowInput* aReflowInput) { -- nscoord horzWidth = CalcHorzWidth(GetScrollParts()); -- ManageReflowCallback(GetRect(), horzWidth); -- mHorzWidth = horzWidth; -+ ManageReflowCallback(); - SimpleXULLeafFrame::DidReflow(aPresContext, aReflowInput); - } - - bool nsTreeBodyFrame::ReflowFinished() { - if (!mView) { - diff --git a/D177902.diff b/D177902.diff deleted file mode 100644 index 04a8f6f..0000000 --- a/D177902.diff +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/devtools/server/actors/resources/console-messages.js b/devtools/server/actors/resources/console-messages.js ---- a/devtools/server/actors/resources/console-messages.js -+++ b/devtools/server/actors/resources/console-messages.js -@@ -64,16 +64,23 @@ - // that process (window and window-less). - // To do that we pass a null window and ConsoleAPIListener will catch everything. - // And also ignore WebExtension as we will filter out only by addonId, which is - // passed via consoleAPIListenerOptions. WebExtension may have multiple windows/documents - // but all of them will be flagged with the same addon ID. -- const window = -+ const messagesShouldMatchWindow = - targetActor.targetType === Targets.TYPES.FRAME && - targetActor.typeName != "parentProcessTarget" && -- targetActor.typeName != "webExtensionTarget" -- ? targetActor.window -- : null; -+ targetActor.typeName != "webExtensionTarget"; -+ const window = messagesShouldMatchWindow ? targetActor.window : null; -+ -+ // If we should match messages for a given window but for some reason, targetActor.window -+ // did not return a window, bail out. Otherwise we wouldn't have anything to match against -+ // and would consume all the messages, which could lead to issue (e.g. infinite loop, -+ // see Bug 1828026). -+ if (messagesShouldMatchWindow && !window) { -+ return; -+ } - - const listener = new ConsoleAPIListener(window, onConsoleAPICall, { - excludeMessagesBoundToWindow: isTargetActorContentProcess, - matchExactWindow: targetActor.ignoreSubFrames, - ...(targetActor.consoleAPIListenerOptions || {}), - diff --git a/D178251.diff b/D178251.diff deleted file mode 100644 index 249f9e5..0000000 --- a/D178251.diff +++ /dev/null @@ -1,104 +0,0 @@ -diff -up firefox-113.0.1/Cargo.lock.D178251 firefox-113.0.1/Cargo.lock ---- firefox-113.0.1/Cargo.lock.D178251 2023-05-12 00:09:22.000000000 +0200 -+++ firefox-113.0.1/Cargo.lock 2023-05-24 10:55:51.177278597 +0200 -@@ -417,8 +417,6 @@ dependencies = [ - [[package]] - name = "bindgen" - version = "0.64.0" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" - dependencies = [ - "bitflags 1.3.2", - "cexpr", -diff -up firefox-113.0.1/Cargo.toml.D178251 firefox-113.0.1/Cargo.toml ---- firefox-113.0.1/Cargo.toml.D178251 2023-05-12 00:09:22.000000000 +0200 -+++ firefox-113.0.1/Cargo.toml 2023-05-24 10:56:39.836959570 +0200 -@@ -119,7 +119,7 @@ tinyvec = { path = "build/rust/tinyvec" - wasi = { path = "build/rust/wasi" } - - # Patch bindgen 0.63 to 0.64 --bindgen = { path = "build/rust/bindgen" } -+bindgen_0_63 = { package = "bindgen", path = "build/rust/bindgen" } - - # Patch memoffset 0.6 to 0.8 - memoffset = { path = "build/rust/memoffset" } -@@ -145,6 +145,9 @@ web-sys = { path = "build/rust/dummy-web - # Overrides to allow easier use of common internal crates. - moz_asserts = { path = "mozglue/static/rust/moz_asserts" } - -+# Patch bindgen to work around issues with some unsound transmutes when compiling with LLVM 16+. -+bindgen = { path = "third_party/rust/bindgen" } -+ - # Patch `rure` to disable building the cdylib and staticlib targets - # Cargo has no way to disable building targets your dependencies provide which - # you don't depend on, and linking the cdylib breaks during instrumentation -diff -up firefox-113.0.1/supply-chain/config.toml.D178251 firefox-113.0.1/supply-chain/config.toml ---- firefox-113.0.1/supply-chain/config.toml.D178251 2023-05-12 00:09:23.000000000 +0200 -+++ firefox-113.0.1/supply-chain/config.toml 2023-05-24 10:55:51.178278632 +0200 -@@ -23,6 +23,10 @@ url = "https://raw.githubusercontent.com - audit-as-crates-io = true - notes = "This is the upstream code plus a few local fixes, see bug 1685697." - -+[policy."bindgen:0.64.0"] -+audit-as-crates-io = true -+notes = "This is a local override of the bindgen crate from crates.io, with a small local patch." -+ - [policy.chardetng] - audit-as-crates-io = true - notes = "This is a crate Henri wrote which is also published. We should probably update Firefox to tip and certify that." -diff -up firefox-113.0.1/third_party/rust/bindgen/codegen/mod.rs.D178251 firefox-113.0.1/third_party/rust/bindgen/codegen/mod.rs ---- firefox-113.0.1/third_party/rust/bindgen/codegen/mod.rs.D178251 2023-05-11 23:42:49.000000000 +0200 -+++ firefox-113.0.1/third_party/rust/bindgen/codegen/mod.rs 2023-05-24 10:55:51.178278632 +0200 -@@ -141,12 +141,13 @@ fn derives_of_item( - item: &Item, - ctx: &BindgenContext, - packed: bool, -+ forward_decl: bool, - ) -> DerivableTraits { - let mut derivable_traits = DerivableTraits::empty(); - - let all_template_params = item.all_template_params(ctx); - -- if item.can_derive_copy(ctx) && !item.annotations().disallow_copy() { -+ if item.can_derive_copy(ctx) && !item.annotations().disallow_copy() && !forward_decl { - derivable_traits |= DerivableTraits::COPY; - - if ctx.options().rust_features().builtin_clone_impls || -@@ -991,7 +992,7 @@ impl CodeGenerator for Type { - vec![attributes::repr("transparent")]; - let packed = false; // Types can't be packed in Rust. - let derivable_traits = -- derives_of_item(item, ctx, packed); -+ derives_of_item(item, ctx, packed, false); - if !derivable_traits.is_empty() { - let derives: Vec<_> = derivable_traits.into(); - attributes.push(attributes::derives(&derives)) -@@ -2032,8 +2033,9 @@ impl CodeGenerator for CompInfo { - } - - if forward_decl { -+ let prefix = ctx.trait_prefix(); - fields.push(quote! { -- _unused: [u8; 0], -+ _unused: ::#prefix::cell::UnsafeCell<[u8; 0]>, - }); - } - -@@ -2095,7 +2097,7 @@ impl CodeGenerator for CompInfo { - } - } - -- let derivable_traits = derives_of_item(item, ctx, packed); -+ let derivable_traits = derives_of_item(item, ctx, packed, self.is_forward_declaration()); - if !derivable_traits.contains(DerivableTraits::DEBUG) { - needs_debug_impl = ctx.options().derive_debug && - ctx.options().impl_debug && -@@ -3127,7 +3129,7 @@ impl CodeGenerator for Enum { - - if !variation.is_const() { - let packed = false; // Enums can't be packed in Rust. -- let mut derives = derives_of_item(item, ctx, packed); -+ let mut derives = derives_of_item(item, ctx, packed, false); - // For backwards compat, enums always derive - // Clone/Eq/PartialEq/Hash, even if we don't generate those by - // default. diff --git a/build-aarch64-skia.patch b/build-aarch64-skia.patch index a63e3e8..342836f 100644 --- a/build-aarch64-skia.patch +++ b/build-aarch64-skia.patch @@ -1,40 +1,7 @@ -diff -up firefox-72.0/gfx/skia/skia/include/private/SkHalf.h.aarch64-skia firefox-72.0/gfx/skia/skia/include/private/SkHalf.h ---- firefox-72.0/gfx/skia/skia/include/private/SkHalf.h.aarch64-skia 2020-01-02 22:33:02.000000000 +0100 -+++ firefox-72.0/gfx/skia/skia/include/private/SkHalf.h 2020-01-03 09:00:37.537296105 +0100 -@@ -40,7 +40,7 @@ static inline Sk4h SkFloatToHalf_finite_ - - static inline Sk4f SkHalfToFloat_finite_ftz(uint64_t rgba) { - Sk4h hs = Sk4h::Load(&rgba); --#if !defined(SKNX_NO_SIMD) && defined(SK_CPU_ARM64) -+#if 0 // !defined(SKNX_NO_SIMD) && defined(SK_CPU_ARM64) - float32x4_t fs; - asm ("fcvtl %[fs].4s, %[hs].4h \n" // vcvt_f32_f16(...) - : [fs] "=w" (fs) // =w: write-only NEON register -@@ -62,7 +62,7 @@ static inline Sk4f SkHalfToFloat_finite_ - } - - static inline Sk4h SkFloatToHalf_finite_ftz(const Sk4f& fs) { --#if !defined(SKNX_NO_SIMD) && defined(SK_CPU_ARM64) -+#if 0 // !defined(SKNX_NO_SIMD) && defined(SK_CPU_ARM64) - float32x4_t vec = fs.fVec; - asm ("fcvtn %[vec].4h, %[vec].4s \n" // vcvt_f16_f32(vec) - : [vec] "+w" (vec)); // +w: read-write NEON register -diff -up firefox-72.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia firefox-72.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h ---- firefox-72.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia 2020-01-03 09:00:37.538296107 +0100 -+++ firefox-72.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h 2020-01-03 10:11:41.259219508 +0100 -@@ -1087,7 +1087,7 @@ SI F from_half(U16 h) { - } - - SI U16 to_half(F f) { --#if defined(JUMPER_IS_NEON) && defined(SK_CPU_ARM64) \ -+#if 0 //defined(JUMPER_IS_NEON) && defined(SK_CPU_ARM64) \ - && !defined(SK_BUILD_FOR_GOOGLE3) // Temporary workaround for some Google3 builds. - return vcvt_f16_f32(f); - -diff -up firefox-72.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h.aarch64-skia firefox-72.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h ---- firefox-72.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h.aarch64-skia 2020-01-03 09:00:37.538296107 +0100 -+++ firefox-72.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h 2020-01-03 10:11:53.513250979 +0100 -@@ -183,8 +183,6 @@ SI F F_from_Half(U16 half) { +diff -up firefox-114.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h.aarch64-skia firefox-114.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h +--- firefox-114.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h.aarch64-skia 2023-06-02 03:15:22.000000000 +0200 ++++ firefox-114.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h 2023-06-05 10:18:46.942777997 +0200 +@@ -189,8 +189,6 @@ SI F F_from_Half(U16 half) { SI U16 Half_from_F(F f) { #if defined(USING_NEON_FP16) return bit_pun(f); @@ -43,3 +10,16 @@ diff -up firefox-72.0/gfx/skia/skia/third_party/skcms/src/Transform_inl.h.aarch6 #elif defined(USING_AVX512F) return (U16)_mm512_cvtps_ph((__m512 )f, _MM_FROUND_CUR_DIRECTION ); #elif defined(USING_AVX_F16C) +diff -up firefox-114.0/gfx/skia/skia/src/base/SkHalf.h.aarch64-skia firefox-114.0/gfx/skia/skia/src/base/SkHalf.h +diff -up firefox-114.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia firefox-114.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h +--- firefox-114.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia 2023-06-05 10:18:46.941777963 +0200 ++++ firefox-114.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h 2023-06-05 10:20:44.924843847 +0200 +@@ -1128,7 +1128,7 @@ SI F from_half(U16 h) { + } + + SI U16 to_half(F f) { +-#if defined(JUMPER_IS_NEON) && defined(SK_CPU_ARM64) \ ++#if 0 //defined(JUMPER_IS_NEON) && defined(SK_CPU_ARM64) \ + && !defined(SK_BUILD_FOR_GOOGLE3) // Temporary workaround for some Google3 builds. + return sk_bit_cast(vcvt_f16_f32(f)); + diff --git a/firefox.spec b/firefox.spec index ed2a8e2..24c5380 100644 --- a/firefox.spec +++ b/firefox.spec @@ -175,13 +175,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 113.0.1 -Release: 4%{?pre_tag}%{?dist} +Version: 114.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230515.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230605.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -212,7 +212,7 @@ Source44: print-error-reftest Source45: run-wayland-compositor # Build patches -Patch3: mozilla-build-arm.patch +#Patch3: mozilla-build-arm.patch Patch32: build-rust-ppc64le.patch Patch35: build-ppc-jit.patch # Fixing missing cacheFlush when JS_CODEGEN_NONE is used (s390x) @@ -250,23 +250,11 @@ Patch230: firefox-enable-vaapi.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch -Patch408: mozilla-1832770.patch -# TODO: do we need it? -#Patch415: mozilla-1670333.patch -Patch410: D177258.diff -Patch411: D177902.diff -Patch412: D178251.diff # PGO/LTO patches Patch600: pgo.patch Patch602: mozilla-1516803.patch -# a patch for compiling with gcc on arm (from debian) -Patch990: work-around-GCC-ICE-on-arm.patch - -# Work around broken moz.build file on ppc64le (mozb#1779545, mozb#1775202) -Patch1100: mozilla-1775202.patch - # tentative patch for RUSTFLAGS parsing issue: # https://bugzilla.redhat.com/show_bug.cgi?id=2184743 # https://bugzilla.mozilla.org/show_bug.cgi?id=1474486 @@ -506,7 +494,6 @@ This package contains results of tests executed during build. # ignored during this compare. %patch40 -p1 -b .aarch64-skia -%patch3 -p1 -b .arm %patch44 -p1 -b .build-arm-libopus %patch47 -p1 -b .fedora-shebang %patch49 -p1 -b .build-arm-libaom @@ -534,12 +521,6 @@ This package contains results of tests executed during build. %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 -%patch408 -p1 -b .1832770 -# TODO: do we need it? -#%patch415 -p1 -b .1670333 -%patch410 -p1 -b .D177258 -%patch411 -p1 -b .D177902 -%patch412 -p1 -b .D178251 # PGO patches %if %{build_with_pgo} @@ -549,8 +530,6 @@ This package contains results of tests executed during build. %endif %endif -%patch990 -p1 -b .work-around-GCC-ICE-on-arm -%patch1100 -p1 -b .ppc-mobzuild %patch1200 -p1 -b .rustflags-commasplit rm -f .mozconfig @@ -1027,6 +1006,8 @@ fi %{_bindir}/firefox %{mozappdir}/firefox %{mozappdir}/firefox-bin +%{mozappdir}/glxtest +%{mozappdir}/vaapitest %doc %{_mandir}/man1/* %dir %{_sysconfdir}/%{name} %dir %{_sysconfdir}/%{name}/* @@ -1090,6 +1071,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Jun 05 2023 Martin Stransky - 114.0-1 +- Updated to 114.0 + * Wed May 24 2023 Martin Stransky - 113.0.1-4 - Added patches from 113.0.2 - Added Rust fix for Rawhide (mzbz#1831242). diff --git a/mozilla-1670333.patch b/mozilla-1670333.patch deleted file mode 100644 index a1eaa9a..0000000 --- a/mozilla-1670333.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff -up firefox-105.0/dom/media/mp4/MP4Demuxer.cpp.1670333 firefox-105.0/dom/media/mp4/MP4Demuxer.cpp ---- firefox-105.0/dom/media/mp4/MP4Demuxer.cpp.1670333 2022-09-15 20:49:09.000000000 +0200 -+++ firefox-105.0/dom/media/mp4/MP4Demuxer.cpp 2022-09-20 09:16:35.404519249 +0200 -@@ -31,6 +31,8 @@ mozilla::LogModule* GetDemuxerLog() { re - 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 MP4TrackD - [[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 -up firefox-105.0/dom/media/platforms/PDMFactory.cpp.1670333 firefox-105.0/dom/media/platforms/PDMFactory.cpp ---- firefox-105.0/dom/media/platforms/PDMFactory.cpp.1670333 2022-09-15 20:49:09.000000000 +0200 -+++ firefox-105.0/dom/media/platforms/PDMFactory.cpp 2022-09-20 09:20:05.369572900 +0200 -@@ -61,6 +61,8 @@ - - #include - -+bool gUseKeyframeFromContainer = false; -+ - using DecodeSupport = mozilla::media::DecodeSupport; - using DecodeSupportSet = mozilla::media::DecodeSupportSet; - using MediaCodec = mozilla::media::MediaCodec; -@@ -553,7 +555,7 @@ void PDMFactory::CreateRddPDMs() { - #ifdef MOZ_FFMPEG - if (StaticPrefs::media_ffmpeg_enabled() && - StaticPrefs::media_rdd_ffmpeg_enabled() && -- !CreateAndStartupPDM()) { -+ !(mFFmpegUsed = CreateAndStartupPDM())) { - mFailureFlags += GetFailureFlagBasedOnFFmpegStatus( - FFmpegRuntimeLinker::LinkStatusCode()); - } -@@ -653,8 +655,9 @@ void PDMFactory::CreateContentPDMs() { - - CreateAndStartupPDM(); - -- if (StaticPrefs::media_gmp_decoder_enabled() && -+ if (StaticPrefs::media_gmp_decoder_enabled() && !mFFmpegUsed && - !CreateAndStartupPDM()) { -+ gUseKeyframeFromContainer = true; - mFailureFlags += DecoderDoctorDiagnostics::Flags::GMPPDMFailedToStartup; - } - } -diff -up firefox-105.0/dom/media/platforms/PDMFactory.h.1670333 firefox-105.0/dom/media/platforms/PDMFactory.h ---- firefox-105.0/dom/media/platforms/PDMFactory.h.1670333 2022-09-15 20:49:08.000000000 +0200 -+++ firefox-105.0/dom/media/platforms/PDMFactory.h 2022-09-20 09:16:35.404519249 +0200 -@@ -102,6 +102,7 @@ class PDMFactory final { - RefPtr mNullPDM; - - DecoderDoctorDiagnostics::FlagsSet mFailureFlags; -+ bool mFFmpegUsed = false; - - friend class RemoteVideoDecoderParent; - static void EnsureInit(); diff --git a/mozilla-1775202.patch b/mozilla-1775202.patch deleted file mode 100644 index e237f4c..0000000 --- a/mozilla-1775202.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -up firefox-109.0/third_party/libwebrtc/moz.build.ppc-mobzuild firefox-109.0/third_party/libwebrtc/moz.build ---- firefox-109.0/third_party/libwebrtc/moz.build.ppc-mobzuild 2023-01-12 21:02:15.000000000 +0100 -+++ firefox-109.0/third_party/libwebrtc/moz.build 2023-01-16 13:30:28.404450100 +0100 -@@ -621,7 +621,9 @@ if CONFIG["CPU_ARCH"] == "ppc64" and CON - "/third_party/libwebrtc/api/audio_codecs/isac/audio_decoder_isac_float_gn", - "/third_party/libwebrtc/api/audio_codecs/isac/audio_encoder_isac_float_gn", - "/third_party/libwebrtc/modules/audio_coding/isac_c_gn", -- "/third_party/libwebrtc/modules/audio_coding/isac_gn" -+ "/third_party/libwebrtc/modules/audio_coding/isac_gn", -+ "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn", -+ "/third_party/libwebrtc/modules/desktop_capture/primitives_gn" - ] - - if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux": diff --git a/mozilla-1832770.patch b/mozilla-1832770.patch deleted file mode 100644 index 68a2c56..0000000 --- a/mozilla-1832770.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc ---- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -@@ -434,11 +434,11 @@ - { - PipeWireThreadLoopLock thread_loop_lock(pw_main_loop_); - - if (fd >= 0) { - pw_core_ = pw_context_connect_fd( -- pw_context_, fcntl(fd, F_DUPFD_CLOEXEC), nullptr, 0); -+ pw_context_, fcntl(fd, F_DUPFD_CLOEXEC, 0), nullptr, 0); - } else { - pw_core_ = pw_context_connect(pw_context_, nullptr, 0); - } - - if (!pw_core_) { diff --git a/mozilla-build-arm.patch b/mozilla-build-arm.patch deleted file mode 100644 index e390a28..0000000 --- a/mozilla-build-arm.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -up firefox-52.0/gfx/skia/skia/include/core/SkPreConfig.h.arm firefox-52.0/gfx/skia/skia/include/core/SkPreConfig.h ---- firefox-52.0/gfx/skia/skia/include/core/SkPreConfig.h.arm 2017-03-03 13:53:52.480754536 +0100 -+++ firefox-52.0/gfx/skia/skia/include/core/SkPreConfig.h 2017-03-03 13:56:01.476018102 +0100 -@@ -203,6 +203,10 @@ - #define SK_ARM_HAS_CRC32 - #endif - -+#if defined(__aarch64__) -+ #undef SK_ARM_HAS_NEON -+#endif -+ - ////////////////////////////////////////////////////////////////////// - - #if !defined(SKIA_IMPLEMENTATION) diff --git a/sources b/sources index ba60730..91cb74c 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 -SHA512 (firefox-langpacks-113.0.1-20230515.tar.xz) = 93ddbcd8c0a98d4ddce356824a3aa305a6c110bd736912d5144253847aa91de80c5e6135f68e79e9c2aea8417225c57bd6328f7c7504accfddaf72fda57881d6 -SHA512 (firefox-113.0.1.source.tar.xz) = 67d6b777d138ef55dd813a15a483d0588181f3b83ba8da52bf6c1f10a58ab1d907a80afcfc1aa90b65405852b50d083f05032b32d3fdb153317f2df7f1f15db3 +SHA512 (firefox-114.0.source.tar.xz) = c6929d34583f25119738d1c817a24fd358fcada1f0ba5c14bab07c2acd35f18a012f23d054bfe8c6b12c0dda7bd3abdc7a305a36c7a4d36542885abeea3aafec +SHA512 (firefox-langpacks-114.0-20230605.tar.xz) = bb5d61264d5b8c55010da4c7d8884cb9c96ddb75fefef41eff7c81d8784ac46fe79d7f99936f3197a2bfbf0a062e4be494c6f17245c8d4cd9634f92611f7212e From 0e3e51fea7e2c7f1dd8dc0bb41f421437b189c04 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 5 Jun 2023 22:44:04 +0200 Subject: [PATCH 207/545] Disable webrtc on ppc64le --- firefox.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/firefox.spec b/firefox.spec index 7a24dce..a7b0ede 100644 --- a/firefox.spec +++ b/firefox.spec @@ -543,6 +543,9 @@ echo "ac_add_options --enable-system-ffi" >> .mozconfig %ifarch aarch64 echo "ac_add_options --disable-elf-hack" >> .mozconfig %endif +%ifarch ppc64le +echo "ac_add_options --disable-webrtc" >> .mozconfig +%endif %if %{?debug_build} echo "ac_add_options --enable-debug" >> .mozconfig @@ -1038,6 +1041,7 @@ fi %changelog * Mon Jun 05 2023 Martin Stransky - 114.0-1 - Updated to 114.0 +- Disable webrtc on ppc64le * Wed May 24 2023 Martin Stransky - 113.0.1-4 - Added patches from 113.0.2 From e9c16e2628afd9e0d7f0962228bec7b0f56172d4 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 6 Jun 2023 10:52:18 +0200 Subject: [PATCH 208/545] Disabled ppc64le due t build issues (rhbz#2212748) --- firefox.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/firefox.spec b/firefox.spec index a7b0ede..cacefbc 100644 --- a/firefox.spec +++ b/firefox.spec @@ -6,6 +6,9 @@ # https://bugzilla.redhat.com/show_bug.cgi?id=2129720 ExcludeArch: i686 +# Excluded due to https://bugzilla.redhat.com/show_bug.cgi?id=2212748 +ExcludeArch: ppc64le + # Run Mozilla test suite as a part of compile rpm section. Turn off when # building locally and don't want to spend 24 hours waiting for results. %global run_firefox_tests 0 @@ -1042,6 +1045,7 @@ fi * Mon Jun 05 2023 Martin Stransky - 114.0-1 - Updated to 114.0 - Disable webrtc on ppc64le +- Disabled ppc64le due t build issues (rhbz#2212748). * Wed May 24 2023 Martin Stransky - 113.0.1-4 - Added patches from 113.0.2 From 80f05818c31d1e81e32d9bd9dbdeb7cda340f3fc Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 20 Jun 2023 09:53:39 +0200 Subject: [PATCH 209/545] Updated to 114.0.2 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 214ebb8..a40e6bf 100644 --- a/.gitignore +++ b/.gitignore @@ -577,3 +577,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-113.0.1.source.tar.xz /firefox-114.0.source.tar.xz /firefox-langpacks-114.0-20230605.tar.xz +/firefox-langpacks-114.0.2-20230620.tar.xz +/firefox-114.0.2.source.tar.xz diff --git a/firefox.spec b/firefox.spec index cacefbc..9fdd99d 100644 --- a/firefox.spec +++ b/firefox.spec @@ -157,13 +157,13 @@ ExcludeArch: ppc64le Summary: Mozilla Firefox Web browser Name: firefox -Version: 114.0 +Version: 114.0.2 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230605.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230620.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1042,6 +1042,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Jun 20 2023 Martin Stransky - 114.0.2-1 +- Update to 114.0.2 + * Mon Jun 05 2023 Martin Stransky - 114.0-1 - Updated to 114.0 - Disable webrtc on ppc64le diff --git a/sources b/sources index 91cb74c..9105f6e 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 -SHA512 (firefox-114.0.source.tar.xz) = c6929d34583f25119738d1c817a24fd358fcada1f0ba5c14bab07c2acd35f18a012f23d054bfe8c6b12c0dda7bd3abdc7a305a36c7a4d36542885abeea3aafec -SHA512 (firefox-langpacks-114.0-20230605.tar.xz) = bb5d61264d5b8c55010da4c7d8884cb9c96ddb75fefef41eff7c81d8784ac46fe79d7f99936f3197a2bfbf0a062e4be494c6f17245c8d4cd9634f92611f7212e +SHA512 (firefox-langpacks-114.0.2-20230620.tar.xz) = 52f21ce30e0270382633353ea48d2304ea2b01e2a1ce731a095bce33b63b421d698e2549cffa698f5eec3d01f7f069ecc110aa6cf1685e412100eca8b15539d6 +SHA512 (firefox-114.0.2.source.tar.xz) = 1d514d09c6b964b96c6d52d54b89a89a92d53a6fe669e16a6370346c980db4d0ac6c502fa89219c71b680566b9eb982e9b3191c21f81d7326f34f6c837c0a872 From b2c506e3b41e4dc222659d2f81c85672aa47d0d7 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 22 Jun 2023 13:14:14 +0200 Subject: [PATCH 210/545] Enable PGO/LTO --- firefox-gcc-always-inline.patch | 14 ++++++++++++++ firefox.spec | 12 +++++++----- mozilla-1516803.patch | 15 --------------- pgo.patch | 21 ++++++++++++--------- 4 files changed, 33 insertions(+), 29 deletions(-) create mode 100644 firefox-gcc-always-inline.patch delete mode 100644 mozilla-1516803.patch diff --git a/firefox-gcc-always-inline.patch b/firefox-gcc-always-inline.patch new file mode 100644 index 0000000..d7af60f --- /dev/null +++ b/firefox-gcc-always-inline.patch @@ -0,0 +1,14 @@ +diff -up firefox-114.0.2/gfx/wr/swgl/src/gl.cc.inline firefox-114.0.2/gfx/wr/swgl/src/gl.cc +--- firefox-114.0.2/gfx/wr/swgl/src/gl.cc.inline 2023-06-22 11:08:53.294593327 +0200 ++++ firefox-114.0.2/gfx/wr/swgl/src/gl.cc 2023-06-22 11:12:43.663486734 +0200 +@@ -58,9 +58,7 @@ WINBASEAPI BOOL WINAPI QueryPerformanceF + } + + #else +-// GCC is slower when dealing with always_inline, especially in debug builds. +-// When using Clang, use always_inline more aggressively. +-# if defined(__clang__) || defined(NDEBUG) ++# if defined(__clang__) || defined (__GNUC__) || defined(NDEBUG) + # define ALWAYS_INLINE __attribute__((always_inline)) inline + # else + # define ALWAYS_INLINE inline diff --git a/firefox.spec b/firefox.spec index 9fdd99d..6b8c6af 100644 --- a/firefox.spec +++ b/firefox.spec @@ -70,8 +70,7 @@ ExcludeArch: ppc64le %global build_with_pgo 0 %ifarch x86_64 %if %{release_build} -#Disabled PGO build due to rhbz#2136401 -%global build_with_pgo 0 +%global build_with_pgo 1 %endif %endif %if 0%{?flatpak} @@ -158,7 +157,7 @@ ExcludeArch: ppc64le Summary: Mozilla Firefox Web browser Name: firefox Version: 114.0.2 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -235,7 +234,7 @@ Patch407: mozilla-1667096.patch # PGO/LTO patches Patch600: pgo.patch -Patch602: mozilla-1516803.patch +Patch603: firefox-gcc-always-inline.patch # tentative patch for RUSTFLAGS parsing issue: # https://bugzilla.redhat.com/show_bug.cgi?id=2184743 @@ -508,9 +507,9 @@ This package contains results of tests executed during build. %if %{build_with_pgo} %if !%{build_with_clang} %patch600 -p1 -b .pgo -%patch602 -p1 -b .1516803 %endif %endif +%patch603 -p1 -b .inline %patch1200 -p1 -b .rustflags-commasplit @@ -1042,6 +1041,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Jun 22 2023 Martin Stransky - 114.0.2-2 +- Enable PGO/LTO again. + * Tue Jun 20 2023 Martin Stransky - 114.0.2-1 - Update to 114.0.2 diff --git a/mozilla-1516803.patch b/mozilla-1516803.patch deleted file mode 100644 index 5053e51..0000000 --- a/mozilla-1516803.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -up firefox-84.0/security/sandbox/linux/moz.build.1516803 firefox-84.0/security/sandbox/linux/moz.build ---- firefox-84.0/security/sandbox/linux/moz.build.1516803 2020-12-10 16:17:55.425139545 +0100 -+++ firefox-84.0/security/sandbox/linux/moz.build 2020-12-10 16:29:21.945860841 +0100 -@@ -114,9 +114,8 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc") - # gcc lto likes to put the top level asm in syscall.cc in a different partition - # from the function using it which breaks the build. Work around that by - # forcing there to be only one partition. --for f in CONFIG["OS_CXXFLAGS"]: -- if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang": -- LDFLAGS += ["--param lto-partitions=1"] -+if CONFIG['CC_TYPE'] != 'clang': -+ LDFLAGS += ['--param', 'lto-partitions=1'] - - DEFINES["NS_NO_XPCOM"] = True - DisableStlWrapping() diff --git a/pgo.patch b/pgo.patch index 8d996a2..ac3694e 100644 --- a/pgo.patch +++ b/pgo.patch @@ -89,15 +89,6 @@ diff -up firefox-112.0/build/unix/mozconfig.unix.pgo firefox-112.0/build/unix/mo # We want to make sure we use binutils and other binaries in the tooltool # package. mk_add_options "export PATH=$MOZ_FETCHES_DIR/gcc/bin:$MOZ_FETCHES_DIR/binutils/bin:$PATH" -diff -up firefox-112.0/extensions/spellcheck/src/moz.build.pgo firefox-112.0/extensions/spellcheck/src/moz.build ---- firefox-112.0/extensions/spellcheck/src/moz.build.pgo 2023-04-06 17:27:41.000000000 +0200 -+++ firefox-112.0/extensions/spellcheck/src/moz.build 2023-04-06 21:27:32.537089073 +0200 -@@ -28,3 +28,5 @@ EXPORTS.mozilla += [ - "mozInlineSpellChecker.h", - "mozSpellChecker.h", - ] -+ -+CXXFLAGS += ['-fno-devirtualize'] diff -up firefox-112.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-112.0/toolkit/components/terminator/nsTerminator.cpp --- firefox-112.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2023-04-06 17:27:57.000000000 +0200 +++ firefox-112.0/toolkit/components/terminator/nsTerminator.cpp 2023-04-06 21:27:32.538089108 +0200 @@ -113,3 +104,15 @@ diff -up firefox-112.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefo UniquePtr options(new Options()); // crashAfterTicks is guaranteed to be > 0 as // crashAfterMS >= ADDITIONAL_WAIT_BEFORE_CRASH_MS >> HEARTBEAT_INTERVAL_MS +diff -up firefox-114.0.2/build/moz.configure/lto-pgo.configure.pgo firefox-114.0.2/build/moz.configure/lto-pgo.configure +--- firefox-114.0.2/build/moz.configure/lto-pgo.configure.pgo 2023-06-22 11:17:37.428552356 +0200 ++++ firefox-114.0.2/build/moz.configure/lto-pgo.configure 2023-06-22 11:17:51.476033691 +0200 +@@ -86,7 +86,7 @@ def pgo_flags(compiler, profdata, target + return namespace( + gen_cflags=["-fprofile-generate"], + gen_ldflags=["-fprofile-generate"], +- use_cflags=["-fprofile-use", "-fprofile-correction", "-Wcoverage-mismatch"], ++ use_cflags=["-fprofile-use", "-fprofile-correction", "-Wno-coverage-mismatch"], + use_ldflags=["-fprofile-use"], + ) + From 456ad350a83c2707885b540547630022d589d70a Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 23 Jun 2023 11:59:49 +0200 Subject: [PATCH 211/545] Added back mozilla-1516803.patch --- firefox.spec | 2 ++ mozilla-1516803.patch | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 mozilla-1516803.patch diff --git a/firefox.spec b/firefox.spec index 6b8c6af..dc01d45 100644 --- a/firefox.spec +++ b/firefox.spec @@ -234,6 +234,7 @@ Patch407: mozilla-1667096.patch # PGO/LTO patches Patch600: pgo.patch +Patch602: mozilla-1516803.patch Patch603: firefox-gcc-always-inline.patch # tentative patch for RUSTFLAGS parsing issue: @@ -507,6 +508,7 @@ This package contains results of tests executed during build. %if %{build_with_pgo} %if !%{build_with_clang} %patch600 -p1 -b .pgo +%patch602 -p1 -b .1516803 %endif %endif %patch603 -p1 -b .inline diff --git a/mozilla-1516803.patch b/mozilla-1516803.patch new file mode 100644 index 0000000..30d1fdf --- /dev/null +++ b/mozilla-1516803.patch @@ -0,0 +1,15 @@ +diff -up firefox-84.0/security/sandbox/linux/moz.build.1516803 firefox-84.0/security/sandbox/linux/moz.build +--- firefox-84.0/security/sandbox/linux/moz.build.1516803 2020-12-10 16:17:55.425139545 +0100 ++++ firefox-84.0/security/sandbox/linux/moz.build 2020-12-10 16:29:21.945860841 +0100 +@@ -114,9 +114,8 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc") + # gcc lto likes to put the top level asm in syscall.cc in a different partition + # from the function using it which breaks the build. Work around that by + # forcing there to be only one partition. +-for f in CONFIG["OS_CXXFLAGS"]: +- if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang": +- LDFLAGS += ["--param lto-partitions=1"] ++if CONFIG['CC_TYPE'] != 'clang': ++ LDFLAGS += ['--param', 'lto-partitions=1'] + + DEFINES["NS_NO_XPCOM"] = True + DisableStlWrapping() From 2606d6a50cdcd4971b226fd06d58ef31f44b83cb Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 27 Jun 2023 21:23:28 +0200 Subject: [PATCH 212/545] PGO build fixes --- firefox.spec | 17 ++++++++++++----- mozilla-1516803.patch | 15 --------------- pgo.patch | 11 ----------- 3 files changed, 12 insertions(+), 31 deletions(-) delete mode 100644 mozilla-1516803.patch diff --git a/firefox.spec b/firefox.spec index dc01d45..b5f491e 100644 --- a/firefox.spec +++ b/firefox.spec @@ -61,7 +61,9 @@ ExcludeArch: ppc64le %global system_libvpx 0 %global system_jpeg 1 %global system_pixman 1 -%global use_bundled_cbindgen 1 +# Bundled cbindgen makes build slow. +# Enable only if system cbindgen is not available. +%global use_bundled_cbindgen 0 %if %{debug_build} %global release_build 0 %endif @@ -234,7 +236,6 @@ Patch407: mozilla-1667096.patch # PGO/LTO patches Patch600: pgo.patch -Patch602: mozilla-1516803.patch Patch603: firefox-gcc-always-inline.patch # tentative patch for RUSTFLAGS parsing issue: @@ -508,7 +509,6 @@ This package contains results of tests executed during build. %if %{build_with_pgo} %if !%{build_with_clang} %patch600 -p1 -b .pgo -%patch602 -p1 -b .1516803 %endif %endif %patch603 -p1 -b .inline @@ -625,7 +625,8 @@ chmod a-x third_party/rust/ash/src/extensions/nv/*.rs %build # Disable LTO to work around rhbz#1883904 -%define _lto_cflags %{nil} +# Is that already fixed? +# %define _lto_cflags %{nil} %if 0%{?use_bundled_cbindgen} mkdir -p my_rust_vendor @@ -643,6 +644,8 @@ EOL env CARGO_HOME=.cargo cargo install cbindgen export PATH=`pwd`/.cargo/bin:$PATH cd - +%else +export CBINDGEN=/usr/bin/cbindgen %endif mkdir %{_buildrootdir}/bin || : @@ -707,9 +710,13 @@ echo "export NM=\"gcc-nm\"" >> .mozconfig echo "export RANLIB=\"gcc-ranlib\"" >> .mozconfig %endif %if 0%{?build_with_pgo} -echo "ac_add_options MOZ_PGO=1" >> .mozconfig # PGO build doesn't work with ccache export CCACHE_DISABLE=1 +export GCOV_PREFIX=`pwd -P`/objdir +export GCOV_PREFIX_STRIP=$(( $(echo `pwd -P`|tr -c -d '/' |wc -c )+2 )) +env | grep GCOV +echo "ac_add_options --enable-lto" >> .mozconfig +echo "ac_add_options MOZ_PGO=1" >> .mozconfig %endif # Require 2 GB of RAM per CPU core diff --git a/mozilla-1516803.patch b/mozilla-1516803.patch deleted file mode 100644 index 30d1fdf..0000000 --- a/mozilla-1516803.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -up firefox-84.0/security/sandbox/linux/moz.build.1516803 firefox-84.0/security/sandbox/linux/moz.build ---- firefox-84.0/security/sandbox/linux/moz.build.1516803 2020-12-10 16:17:55.425139545 +0100 -+++ firefox-84.0/security/sandbox/linux/moz.build 2020-12-10 16:29:21.945860841 +0100 -@@ -114,9 +114,8 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc") - # gcc lto likes to put the top level asm in syscall.cc in a different partition - # from the function using it which breaks the build. Work around that by - # forcing there to be only one partition. --for f in CONFIG["OS_CXXFLAGS"]: -- if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang": -- LDFLAGS += ["--param lto-partitions=1"] -+if CONFIG['CC_TYPE'] != 'clang': -+ LDFLAGS += ['--param', 'lto-partitions=1'] - - DEFINES["NS_NO_XPCOM"] = True - DisableStlWrapping() diff --git a/pgo.patch b/pgo.patch index ac3694e..cae0648 100644 --- a/pgo.patch +++ b/pgo.patch @@ -59,17 +59,6 @@ diff -up firefox-112.0/build/pgo/profileserver.py.pgo firefox-112.0/build/pgo/pr with TemporaryDirectory() as profilePath: # TODO: refactor this into mozprofile -@@ -213,6 +226,10 @@ if __name__ == "__main__": - print("Firefox exited successfully, but produced a crashreport") - sys.exit(1) - -+ print('Copying profile data....') -+ os.system('pwd'); -+ os.system('tar cf profdata.tar.gz `find . -name "*.gcda"`; cd ..; tar xf instrumented/profdata.tar.gz;'); -+ - llvm_profdata = env.get("LLVM_PROFDATA") - if llvm_profdata: - profraw_files = glob.glob("*.profraw") diff -up firefox-112.0/build/unix/mozconfig.unix.pgo firefox-112.0/build/unix/mozconfig.unix --- firefox-112.0/build/unix/mozconfig.unix.pgo 2023-04-06 21:27:32.537089073 +0200 +++ firefox-112.0/build/unix/mozconfig.unix 2023-04-06 21:28:54.987949124 +0200 From d175d93ecc5633244db18606d9c6b371054161dd Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 28 Jun 2023 08:28:09 +0200 Subject: [PATCH 213/545] PGO update --- firefox.spec | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/firefox.spec b/firefox.spec index b5f491e..b4fc86c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -236,6 +236,7 @@ Patch407: mozilla-1667096.patch # PGO/LTO patches Patch600: pgo.patch +Patch602: mozilla-1516803.patch Patch603: firefox-gcc-always-inline.patch # tentative patch for RUSTFLAGS parsing issue: @@ -509,6 +510,7 @@ This package contains results of tests executed during build. %if %{build_with_pgo} %if !%{build_with_clang} %patch600 -p1 -b .pgo +%patch602 -p1 -b .1516803 %endif %endif %patch603 -p1 -b .inline @@ -626,7 +628,7 @@ chmod a-x third_party/rust/ash/src/extensions/nv/*.rs %build # Disable LTO to work around rhbz#1883904 # Is that already fixed? -# %define _lto_cflags %{nil} +%define _lto_cflags %{nil} %if 0%{?use_bundled_cbindgen} mkdir -p my_rust_vendor @@ -725,13 +727,21 @@ echo "mk_add_options MOZ_MAKE_FLAGS=\"-j%{_smp_build_ncpus}\"" >> .mozconfig echo "mk_add_options MOZ_SERVICES_SYNC=1" >> .mozconfig echo "export STRIP=/bin/true" >> .mozconfig -#export MACH_USE_SYSTEM_PYTHON=1 %if %{launch_wayland_compositor} cp %{SOURCE45} . . ./run-wayland-compositor %endif +export MACH_NATIVE_PACKAGE_SOURCE=system +mkdir -p objdir/_virtualenvs/init_py3 +cat > objdir/_virtualenvs/init_py3/pip.conf << EOF +[global] +find-links=`pwd`/mochitest-python +no-index=true +EOF +tar xf %{SOURCE37} + %if %{build_with_pgo} %if %{test_on_wayland} env | grep "WAYLAND" @@ -746,20 +756,14 @@ xvfb-run ./mach build -v 2>&1 | cat - || exit 1 #--------------------------------------------------------------------- %install # run Firefox test suite -export MACH_USE_SYSTEM_PYTHON=1 +# Do we need it? +export MACH_NATIVE_PACKAGE_SOURCE=system %if %{launch_wayland_compositor} cp %{SOURCE45} . . ./run-wayland-compositor %endif %if 0%{?run_firefox_tests} -mkdir -p objdir/_virtualenvs/init_py3 -cat > objdir/_virtualenvs/init_py3/pip.conf << EOF -[global] -find-links=`pwd`/mochitest-python -no-index=true -EOF -tar xf %{SOURCE37} cp %{SOURCE40} %{SOURCE41} %{SOURCE42} %{SOURCE38} %{SOURCE39} %{SOURCE43} %{SOURCE44} . mkdir -p test_results %if %{test_on_wayland} From b81896fdd81105221d716f4e14193e1852f8b5b1 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 28 Jun 2023 08:29:10 +0200 Subject: [PATCH 214/545] Added missing file --- mozilla-1516803.patch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 mozilla-1516803.patch diff --git a/mozilla-1516803.patch b/mozilla-1516803.patch new file mode 100644 index 0000000..30d1fdf --- /dev/null +++ b/mozilla-1516803.patch @@ -0,0 +1,15 @@ +diff -up firefox-84.0/security/sandbox/linux/moz.build.1516803 firefox-84.0/security/sandbox/linux/moz.build +--- firefox-84.0/security/sandbox/linux/moz.build.1516803 2020-12-10 16:17:55.425139545 +0100 ++++ firefox-84.0/security/sandbox/linux/moz.build 2020-12-10 16:29:21.945860841 +0100 +@@ -114,9 +114,8 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc") + # gcc lto likes to put the top level asm in syscall.cc in a different partition + # from the function using it which breaks the build. Work around that by + # forcing there to be only one partition. +-for f in CONFIG["OS_CXXFLAGS"]: +- if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang": +- LDFLAGS += ["--param lto-partitions=1"] ++if CONFIG['CC_TYPE'] != 'clang': ++ LDFLAGS += ['--param', 'lto-partitions=1'] + + DEFINES["NS_NO_XPCOM"] = True + DisableStlWrapping() From d89dc2293074015c82ea774aa6960011aa873559 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 28 Jun 2023 22:49:38 +0200 Subject: [PATCH 215/545] Updated PGO build setup --- firefox.spec | 3 ++- sources | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index b4fc86c..9064967 100644 --- a/firefox.spec +++ b/firefox.spec @@ -31,7 +31,7 @@ ExcludeArch: ppc64le %global system_nss 1 %global system_libevent 1 %global build_with_asan 0 -%global test_on_wayland 1 +%global test_on_wayland 0 %if "%{toolchain}" == "clang" %global build_with_clang 1 @@ -719,6 +719,7 @@ export GCOV_PREFIX_STRIP=$(( $(echo `pwd -P`|tr -c -d '/' |wc -c )+2 )) env | grep GCOV echo "ac_add_options --enable-lto" >> .mozconfig echo "ac_add_options MOZ_PGO=1" >> .mozconfig +echo "ac_add_options --disable-elf-hack" >> .mozconfig %endif # Require 2 GB of RAM per CPU core diff --git a/sources b/sources index 9105f6e..f0e1885 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 -SHA512 (mochitest-python.tar.gz) = e0a2c569dafe013b6a4c073516388549a8f398d8aa4538a3bc69dcda44737a3a3cf070285e9fa040a15d7a62446665c6158d42a1b6dc3e8d7f4680bc2ef17a16 SHA512 (firefox-langpacks-114.0.2-20230620.tar.xz) = 52f21ce30e0270382633353ea48d2304ea2b01e2a1ce731a095bce33b63b421d698e2549cffa698f5eec3d01f7f069ecc110aa6cf1685e412100eca8b15539d6 SHA512 (firefox-114.0.2.source.tar.xz) = 1d514d09c6b964b96c6d52d54b89a89a92d53a6fe669e16a6370346c980db4d0ac6c502fa89219c71b680566b9eb982e9b3191c21f81d7326f34f6c837c0a872 +SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 From 9baa8f7c2d74d0df2fa55206a87f628360243159 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 29 Jun 2023 11:23:13 +0200 Subject: [PATCH 216/545] Enabled elf-hack for PGO builds --- D182447.diff | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++ firefox.spec | 10 +++-- pgo.patch | 42 ------------------- 3 files changed, 118 insertions(+), 45 deletions(-) create mode 100644 D182447.diff diff --git a/D182447.diff b/D182447.diff new file mode 100644 index 0000000..8163545 --- /dev/null +++ b/D182447.diff @@ -0,0 +1,111 @@ +diff --git a/build/unix/elfhack/elf.cpp b/build/unix/elfhack/elf.cpp +--- a/build/unix/elfhack/elf.cpp ++++ b/build/unix/elfhack/elf.cpp +@@ -347,11 +347,11 @@ + } + } + return sections[index]; + } + +-ElfSection* Elf::getSectionAt(unsigned int offset) { ++ElfSection* Elf::getSectionAt(Elf64_Off offset) { + for (int i = 1; i < ehdr->e_shnum; i++) { + ElfSection* section = getSection(i); + if ((section != nullptr) && (section->getFlags() & SHF_ALLOC) && + !(section->getFlags() & SHF_TLS) && (offset >= section->getAddr()) && + (offset < section->getAddr() + section->getSize())) +@@ -532,11 +532,11 @@ + info.section = shdr.sh_info ? parent->getSection(shdr.sh_info) : nullptr; + else + info.index = shdr.sh_info; + } + +-unsigned int ElfSection::getAddr() { ++Elf64_Addr ElfSection::getAddr() { + if (shdr.sh_addr != (Elf64_Addr)-1) return shdr.sh_addr; + + // It should be safe to adjust sh_addr for all allocated sections that + // are neither SHT_NOBITS nor SHT_PROGBITS + if ((previous != nullptr) && isRelocatable()) { +@@ -548,16 +548,16 @@ + return (shdr.sh_addr = addr); + } + return shdr.sh_addr; + } + +-unsigned int ElfSection::getOffset() { ++Elf64_Off ElfSection::getOffset() { + if (shdr.sh_offset != (Elf64_Off)-1) return shdr.sh_offset; + + if (previous == nullptr) return (shdr.sh_offset = 0); + +- unsigned int offset = previous->getOffset(); ++ Elf64_Off offset = previous->getOffset(); + + ElfSegment* ptload = getSegmentByType(PT_LOAD); + ElfSegment* prev_ptload = previous->getSegmentByType(PT_LOAD); + + if (ptload && (ptload == prev_ptload)) { +diff --git a/build/unix/elfhack/elfhack.cpp b/build/unix/elfhack/elfhack.cpp +--- a/build/unix/elfhack/elfhack.cpp ++++ b/build/unix/elfhack/elfhack.cpp +@@ -1258,12 +1258,12 @@ + second->getAddr() < first_executable->getAddr()) { + // The distance between both sections needs to be preserved because + // eh_frame_hdr contains relative offsets to eh_frame. Well, they could be + // relocated too, but it's not worth the effort for the few number of bytes + // this would save. +- unsigned int distance = second->getAddr() - first->getAddr(); +- unsigned int origAddr = eh_frame->getAddr(); ++ Elf64_Off distance = second->getAddr() - first->getAddr(); ++ Elf64_Addr origAddr = eh_frame->getAddr(); + ElfSection* previous = first->getPrevious(); + first->getShdr().sh_addr = (previous->getAddr() + previous->getSize() + + first->getAddrAlign() - 1) & + ~(first->getAddrAlign() - 1); + second->getShdr().sh_addr = +diff --git a/build/unix/elfhack/elfxx.h b/build/unix/elfhack/elfxx.h +--- a/build/unix/elfhack/elfxx.h ++++ b/build/unix/elfhack/elfxx.h +@@ -283,11 +283,11 @@ + ~Elf(); + + /* index == -1 is treated as index == ehdr.e_shstrndx */ + ElfSection* getSection(int index); + +- ElfSection* getSectionAt(unsigned int offset); ++ ElfSection* getSectionAt(Elf64_Off offset); + + ElfSegment* getSegmentByType(unsigned int type, ElfSegment* last = nullptr); + + ElfDynamic_Section* getDynSection(); + +@@ -332,12 +332,12 @@ + virtual ~ElfSection() { free(data); } + + const char* getName() { return name; } + unsigned int getType() { return shdr.sh_type; } + unsigned int getFlags() { return shdr.sh_flags; } +- unsigned int getAddr(); +- unsigned int getSize() { return shdr.sh_size; } ++ Elf64_Addr getAddr(); ++ Elf64_Off getSize() { return shdr.sh_size; } + unsigned int getAddrAlign() { return shdr.sh_addralign; } + unsigned int getEntSize() { return shdr.sh_entsize; } + const char* getData() { return data; } + ElfSection* getLink() { return link; } + SectionInfo getInfo() { return info; } +@@ -356,11 +356,11 @@ + shdr.sh_size = newsize; + markDirty(); + } + } + +- unsigned int getOffset(); ++ Elf64_Off getOffset(); + int getIndex(); + Elf_Shdr& getShdr(); + + ElfSection* getNext() { return next; } + ElfSection* getPrevious() { return previous; } + diff --git a/firefox.spec b/firefox.spec index 9064967..20fcac7 100644 --- a/firefox.spec +++ b/firefox.spec @@ -159,7 +159,7 @@ ExcludeArch: ppc64le Summary: Mozilla Firefox Web browser Name: firefox Version: 114.0.2 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -233,6 +233,7 @@ Patch230: firefox-enable-vaapi.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch +Patch408: D182447.diff # PGO/LTO patches Patch600: pgo.patch @@ -505,12 +506,13 @@ This package contains results of tests executed during build. %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 +%patch408 -p1 -b .D182447 # PGO patches %if %{build_with_pgo} %if !%{build_with_clang} %patch600 -p1 -b .pgo -%patch602 -p1 -b .1516803 +#%patch602 -p1 -b .1516803 %endif %endif %patch603 -p1 -b .inline @@ -719,7 +721,6 @@ export GCOV_PREFIX_STRIP=$(( $(echo `pwd -P`|tr -c -d '/' |wc -c )+2 )) env | grep GCOV echo "ac_add_options --enable-lto" >> .mozconfig echo "ac_add_options MOZ_PGO=1" >> .mozconfig -echo "ac_add_options --disable-elf-hack" >> .mozconfig %endif # Require 2 GB of RAM per CPU core @@ -1055,6 +1056,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Jun 29 2023 Martin Stransky - 114.0.2-3 +- Enable Elf-hack for PGO builds. + * Thu Jun 22 2023 Martin Stransky - 114.0.2-2 - Enable PGO/LTO again. diff --git a/pgo.patch b/pgo.patch index cae0648..3ac23da 100644 --- a/pgo.patch +++ b/pgo.patch @@ -1,26 +1,3 @@ -diff -up firefox-112.0/build/moz.configure/lto-pgo.configure.pgo firefox-112.0/build/moz.configure/lto-pgo.configure ---- firefox-112.0/build/moz.configure/lto-pgo.configure.pgo 2023-04-06 17:27:38.000000000 +0200 -+++ firefox-112.0/build/moz.configure/lto-pgo.configure 2023-04-06 21:27:32.537089073 +0200 -@@ -247,8 +247,8 @@ def lto( - cflags.append("-flto") - ldflags.append("-flto") - else: -- cflags.append("-flto=thin") -- ldflags.append("-flto=thin") -+ cflags.append("-flto") -+ ldflags.append("-flto") - - if target.os == "Android" and value == "cross": - # Work around https://github.com/rust-lang/rust/issues/90088 -@@ -264,7 +264,7 @@ def lto( - if value == "full": - cflags.append("-flto") - else: -- cflags.append("-flto=thin") -+ cflags.append("-flto") - # With clang-cl, -flto can only be used with -c or -fuse-ld=lld. - # AC_TRY_LINKs during configure don't have -c, so pass -fuse-ld=lld. - cflags.append("-fuse-ld=lld") diff -up firefox-112.0/build/pgo/profileserver.py.pgo firefox-112.0/build/pgo/profileserver.py --- firefox-112.0/build/pgo/profileserver.py.pgo 2023-04-06 17:27:40.000000000 +0200 +++ firefox-112.0/build/pgo/profileserver.py 2023-04-06 21:29:33.772294479 +0200 @@ -59,25 +36,6 @@ diff -up firefox-112.0/build/pgo/profileserver.py.pgo firefox-112.0/build/pgo/pr with TemporaryDirectory() as profilePath: # TODO: refactor this into mozprofile -diff -up firefox-112.0/build/unix/mozconfig.unix.pgo firefox-112.0/build/unix/mozconfig.unix ---- firefox-112.0/build/unix/mozconfig.unix.pgo 2023-04-06 21:27:32.537089073 +0200 -+++ firefox-112.0/build/unix/mozconfig.unix 2023-04-06 21:28:54.987949124 +0200 -@@ -4,6 +4,15 @@ if [ -n "$FORCE_GCC" ]; then - CC="$MOZ_FETCHES_DIR/gcc/bin/gcc" - CXX="$MOZ_FETCHES_DIR/gcc/bin/g++" - -+ if [ -n "$MOZ_PGO" ]; then -+ if [ -z "$USE_ARTIFACT" ]; then -+ ac_add_options --enable-lto -+ fi -+ export AR="$topsrcdir/gcc/bin/gcc-ar" -+ export NM="$topsrcdir/gcc/bin/gcc-nm" -+ export RANLIB="$topsrcdir/gcc/bin/gcc-ranlib" -+ fi -+ - # We want to make sure we use binutils and other binaries in the tooltool - # package. - mk_add_options "export PATH=$MOZ_FETCHES_DIR/gcc/bin:$MOZ_FETCHES_DIR/binutils/bin:$PATH" diff -up firefox-112.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-112.0/toolkit/components/terminator/nsTerminator.cpp --- firefox-112.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2023-04-06 17:27:57.000000000 +0200 +++ firefox-112.0/toolkit/components/terminator/nsTerminator.cpp 2023-04-06 21:27:32.538089108 +0200 From 8f1c30db91af2ea1819a6fd4a37a65b2549e6716 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 29 Jun 2023 12:39:27 +0200 Subject: [PATCH 217/545] Updated to 115.0 --- .gitignore | 2 ++ firefox-enable-vaapi.patch | 12 ++++++------ firefox.spec | 9 ++++++--- sources | 4 ++-- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index a40e6bf..dfe937a 100644 --- a/.gitignore +++ b/.gitignore @@ -579,3 +579,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-114.0-20230605.tar.xz /firefox-langpacks-114.0.2-20230620.tar.xz /firefox-114.0.2.source.tar.xz +/firefox-langpacks-115.0-20230629.tar.xz +/firefox-115.0.source.tar.xz diff --git a/firefox-enable-vaapi.patch b/firefox-enable-vaapi.patch index e91f376..d94d399 100644 --- a/firefox-enable-vaapi.patch +++ b/firefox-enable-vaapi.patch @@ -1,13 +1,13 @@ -diff -up firefox-113.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi firefox-113.0/widget/gtk/GfxInfo.cpp ---- firefox-113.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi 2023-05-09 19:43:38.495868810 +0200 -+++ firefox-113.0/widget/gtk/GfxInfo.cpp 2023-05-09 19:44:30.943597984 +0200 -@@ -818,14 +818,6 @@ const nsTArray& GfxInfo:: +diff -up firefox-115.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi firefox-115.0/widget/gtk/GfxInfo.cpp +--- firefox-115.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi 2023-06-29 12:18:53.179833765 +0200 ++++ firefox-115.0/widget/gtk/GfxInfo.cpp 2023-06-29 12:19:33.256212776 +0200 +@@ -970,14 +970,6 @@ const nsTArray& GfxInfo:: nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0), "FEATURE_HARDWARE_VIDEO_DECODING_NO_R600", ""); -- // Disable on Release/late Beta +- // Disable on Release/late Beta on AMD -#if !defined(EARLY_BETA_OR_EARLIER) -- APPEND_TO_DRIVER_BLOCKLIST(OperatingSystem::Linux, DeviceFamily::All, +- APPEND_TO_DRIVER_BLOCKLIST(OperatingSystem::Linux, DeviceFamily::AtiAll, - nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING, - nsIGfxInfo::FEATURE_BLOCKED_DEVICE, - DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0), diff --git a/firefox.spec b/firefox.spec index 20fcac7..8b25ceb 100644 --- a/firefox.spec +++ b/firefox.spec @@ -158,13 +158,13 @@ ExcludeArch: ppc64le Summary: Mozilla Firefox Web browser Name: firefox -Version: 114.0.2 -Release: 3%{?pre_tag}%{?dist} +Version: 115.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230620.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230629.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1056,6 +1056,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Jun 29 2023 Martin Stransky - 115.0-1 +- Update to 115.0 + * Thu Jun 29 2023 Martin Stransky - 114.0.2-3 - Enable Elf-hack for PGO builds. diff --git a/sources b/sources index f0e1885..94443e1 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 -SHA512 (firefox-langpacks-114.0.2-20230620.tar.xz) = 52f21ce30e0270382633353ea48d2304ea2b01e2a1ce731a095bce33b63b421d698e2549cffa698f5eec3d01f7f069ecc110aa6cf1685e412100eca8b15539d6 -SHA512 (firefox-114.0.2.source.tar.xz) = 1d514d09c6b964b96c6d52d54b89a89a92d53a6fe669e16a6370346c980db4d0ac6c502fa89219c71b680566b9eb982e9b3191c21f81d7326f34f6c837c0a872 SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 +SHA512 (firefox-langpacks-115.0-20230629.tar.xz) = b9c194a5a1f1178a926370a908ad9de71738eb8208e2a757160de2456394f406edac0dd71fcc9e030a7c90821695e5dd2e09ff912e1c8d3dbc82a2123083ad67 +SHA512 (firefox-115.0.source.tar.xz) = 6571ecd1c3ee345598c4eeb75554076ceada6d4ff91e133906dd59a9b2020c4e7b9ac07207da7a147790441c08afcfa5448a9adb679615d8a6712093e619f4a4 From bcb41f508349c1571f1157350f0b1a65ac461d56 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 3 Jul 2023 15:49:52 +0200 Subject: [PATCH 218/545] Update to build 2 --- .gitignore | 1 + firefox-gcc-always-inline.patch | 36 ++++++++++++++++++++------------- firefox.spec | 6 +++--- sources | 4 ++-- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index dfe937a..9a27e6f 100644 --- a/.gitignore +++ b/.gitignore @@ -581,3 +581,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-114.0.2.source.tar.xz /firefox-langpacks-115.0-20230629.tar.xz /firefox-115.0.source.tar.xz +/firefox-langpacks-115.0-20230703.tar.xz diff --git a/firefox-gcc-always-inline.patch b/firefox-gcc-always-inline.patch index d7af60f..d7ce687 100644 --- a/firefox-gcc-always-inline.patch +++ b/firefox-gcc-always-inline.patch @@ -1,14 +1,22 @@ -diff -up firefox-114.0.2/gfx/wr/swgl/src/gl.cc.inline firefox-114.0.2/gfx/wr/swgl/src/gl.cc ---- firefox-114.0.2/gfx/wr/swgl/src/gl.cc.inline 2023-06-22 11:08:53.294593327 +0200 -+++ firefox-114.0.2/gfx/wr/swgl/src/gl.cc 2023-06-22 11:12:43.663486734 +0200 -@@ -58,9 +58,7 @@ WINBASEAPI BOOL WINAPI QueryPerformanceF - } - - #else --// GCC is slower when dealing with always_inline, especially in debug builds. --// When using Clang, use always_inline more aggressively. --# if defined(__clang__) || defined(NDEBUG) -+# if defined(__clang__) || defined (__GNUC__) || defined(NDEBUG) - # define ALWAYS_INLINE __attribute__((always_inline)) inline - # else - # define ALWAYS_INLINE inline +diff -up firefox-115.0/gfx/skia/generate_mozbuild.py.old firefox-115.0/gfx/skia/generate_mozbuild.py +--- firefox-115.0/gfx/skia/generate_mozbuild.py.old 2023-07-03 15:45:48.324343303 +0200 ++++ firefox-115.0/gfx/skia/generate_mozbuild.py 2023-07-03 15:46:03.098854139 +0200 +@@ -54,7 +54,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind + if CONFIG['INTEL_ARCHITECTURE']: + SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-mssse3'] + SOURCES['skia/src/opts/SkOpts_sse42.cpp'].flags += ['-msse4.2'] +- SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-mavx'] + SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-mavx2', '-mf16c', '-mfma'] + if not CONFIG["MOZ_CODE_COVERAGE"]: + SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl'] +diff -up firefox-115.0/gfx/skia/moz.build.old firefox-115.0/gfx/skia/moz.build +--- firefox-115.0/gfx/skia/moz.build.old 2023-07-03 15:45:29.988709343 +0200 ++++ firefox-115.0/gfx/skia/moz.build 2023-07-03 15:45:39.971054486 +0200 +@@ -565,7 +565,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind + if CONFIG['INTEL_ARCHITECTURE']: + SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-mssse3'] + SOURCES['skia/src/opts/SkOpts_sse42.cpp'].flags += ['-msse4.2'] +- SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-mavx'] + SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-mavx2', '-mf16c', '-mfma'] + if not CONFIG["MOZ_CODE_COVERAGE"]: + SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl'] diff --git a/firefox.spec b/firefox.spec index 8b25ceb..60069b6 100644 --- a/firefox.spec +++ b/firefox.spec @@ -159,12 +159,12 @@ ExcludeArch: ppc64le Summary: Mozilla Firefox Web browser Name: firefox Version: 115.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230629.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230703.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1056,7 +1056,7 @@ fi #--------------------------------------------------------------------- %changelog -* Thu Jun 29 2023 Martin Stransky - 115.0-1 +* Thu Jun 29 2023 Martin Stransky - 115.0-2 - Update to 115.0 * Thu Jun 29 2023 Martin Stransky - 114.0.2-3 diff --git a/sources b/sources index 94443e1..e7d32a4 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 -SHA512 (firefox-langpacks-115.0-20230629.tar.xz) = b9c194a5a1f1178a926370a908ad9de71738eb8208e2a757160de2456394f406edac0dd71fcc9e030a7c90821695e5dd2e09ff912e1c8d3dbc82a2123083ad67 -SHA512 (firefox-115.0.source.tar.xz) = 6571ecd1c3ee345598c4eeb75554076ceada6d4ff91e133906dd59a9b2020c4e7b9ac07207da7a147790441c08afcfa5448a9adb679615d8a6712093e619f4a4 +SHA512 (firefox-langpacks-115.0-20230703.tar.xz) = f08362a0cd190526ac89c99b0ed305c77b3264045e15d6deacba13532d57022551154b3615b89dd0d40d8be38d6d209a79743917d73a5d9b65835149fd34ae63 +SHA512 (firefox-115.0.source.tar.xz) = ed5d150e4dfdc01026beb3ae502a0b04321dd130084fdef63afce79a8a7a4898741d08f77716ba720c24f31b9c732c00ad0f1cd408b35b5eb6601a10014fb1a2 From 4dc43e7ccf2457afa3248e5c3927b8176841db13 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 4 Jul 2023 10:04:11 +0200 Subject: [PATCH 219/545] Disabled LTO due to rhbz#2218885 --- firefox-gcc-always-inline.patch | 36 +++++++++++++-------------------- firefox.spec | 7 ++++--- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/firefox-gcc-always-inline.patch b/firefox-gcc-always-inline.patch index d7ce687..d7af60f 100644 --- a/firefox-gcc-always-inline.patch +++ b/firefox-gcc-always-inline.patch @@ -1,22 +1,14 @@ -diff -up firefox-115.0/gfx/skia/generate_mozbuild.py.old firefox-115.0/gfx/skia/generate_mozbuild.py ---- firefox-115.0/gfx/skia/generate_mozbuild.py.old 2023-07-03 15:45:48.324343303 +0200 -+++ firefox-115.0/gfx/skia/generate_mozbuild.py 2023-07-03 15:46:03.098854139 +0200 -@@ -54,7 +54,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind - if CONFIG['INTEL_ARCHITECTURE']: - SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-mssse3'] - SOURCES['skia/src/opts/SkOpts_sse42.cpp'].flags += ['-msse4.2'] -- SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-mavx'] - SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-mavx2', '-mf16c', '-mfma'] - if not CONFIG["MOZ_CODE_COVERAGE"]: - SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl'] -diff -up firefox-115.0/gfx/skia/moz.build.old firefox-115.0/gfx/skia/moz.build ---- firefox-115.0/gfx/skia/moz.build.old 2023-07-03 15:45:29.988709343 +0200 -+++ firefox-115.0/gfx/skia/moz.build 2023-07-03 15:45:39.971054486 +0200 -@@ -565,7 +565,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind - if CONFIG['INTEL_ARCHITECTURE']: - SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-mssse3'] - SOURCES['skia/src/opts/SkOpts_sse42.cpp'].flags += ['-msse4.2'] -- SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-mavx'] - SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-mavx2', '-mf16c', '-mfma'] - if not CONFIG["MOZ_CODE_COVERAGE"]: - SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl'] +diff -up firefox-114.0.2/gfx/wr/swgl/src/gl.cc.inline firefox-114.0.2/gfx/wr/swgl/src/gl.cc +--- firefox-114.0.2/gfx/wr/swgl/src/gl.cc.inline 2023-06-22 11:08:53.294593327 +0200 ++++ firefox-114.0.2/gfx/wr/swgl/src/gl.cc 2023-06-22 11:12:43.663486734 +0200 +@@ -58,9 +58,7 @@ WINBASEAPI BOOL WINAPI QueryPerformanceF + } + + #else +-// GCC is slower when dealing with always_inline, especially in debug builds. +-// When using Clang, use always_inline more aggressively. +-# if defined(__clang__) || defined(NDEBUG) ++# if defined(__clang__) || defined (__GNUC__) || defined(NDEBUG) + # define ALWAYS_INLINE __attribute__((always_inline)) inline + # else + # define ALWAYS_INLINE inline diff --git a/firefox.spec b/firefox.spec index 60069b6..b6d36df 100644 --- a/firefox.spec +++ b/firefox.spec @@ -719,7 +719,8 @@ export CCACHE_DISABLE=1 export GCOV_PREFIX=`pwd -P`/objdir export GCOV_PREFIX_STRIP=$(( $(echo `pwd -P`|tr -c -d '/' |wc -c )+2 )) env | grep GCOV -echo "ac_add_options --enable-lto" >> .mozconfig +# Disabled due to rhbz#2218885 +#echo "ac_add_options --enable-lto" >> .mozconfig echo "ac_add_options MOZ_PGO=1" >> .mozconfig %endif @@ -735,7 +736,6 @@ cp %{SOURCE45} . . ./run-wayland-compositor %endif -export MACH_NATIVE_PACKAGE_SOURCE=system mkdir -p objdir/_virtualenvs/init_py3 cat > objdir/_virtualenvs/init_py3/pip.conf << EOF [global] @@ -759,7 +759,7 @@ xvfb-run ./mach build -v 2>&1 | cat - || exit 1 %install # run Firefox test suite # Do we need it? -export MACH_NATIVE_PACKAGE_SOURCE=system +# export MACH_NATIVE_PACKAGE_SOURCE=system %if %{launch_wayland_compositor} cp %{SOURCE45} . . ./run-wayland-compositor @@ -1058,6 +1058,7 @@ fi %changelog * Thu Jun 29 2023 Martin Stransky - 115.0-2 - Update to 115.0 +- Disabled LTO due to rhbz#2218885 * Thu Jun 29 2023 Martin Stransky - 114.0.2-3 - Enable Elf-hack for PGO builds. From 92435129911fd393c51a61632ac0e6bfd8a9e346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Tue, 11 Jul 2023 10:59:17 +0200 Subject: [PATCH 220/545] - re-enable ppc64le (rhbz#2212748) --- firefox.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/firefox.spec b/firefox.spec index b6d36df..7658d71 100644 --- a/firefox.spec +++ b/firefox.spec @@ -6,9 +6,6 @@ # https://bugzilla.redhat.com/show_bug.cgi?id=2129720 ExcludeArch: i686 -# Excluded due to https://bugzilla.redhat.com/show_bug.cgi?id=2212748 -ExcludeArch: ppc64le - # Run Mozilla test suite as a part of compile rpm section. Turn off when # building locally and don't want to spend 24 hours waiting for results. %global run_firefox_tests 0 @@ -159,7 +156,7 @@ ExcludeArch: ppc64le Summary: Mozilla Firefox Web browser Name: firefox Version: 115.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1056,6 +1053,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Jul 11 2023 Dan Horák - 115.0-3 +- re-enable ppc64le (rhbz#2212748) + * Thu Jun 29 2023 Martin Stransky - 115.0-2 - Update to 115.0 - Disabled LTO due to rhbz#2218885 From c33e16b99e1d8b72b7f7e2170cddda02e1162bd3 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 17 Jul 2023 13:24:28 +0200 Subject: [PATCH 221/545] Update to 115.0.2 --- .gitignore | 2 ++ firefox.spec | 11 +++---- pgo.patch | 87 +++++++++++++++++++++++++++++++++++++++++----------- sources | 2 ++ 4 files changed, 78 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index 9a27e6f..43fa144 100644 --- a/.gitignore +++ b/.gitignore @@ -582,3 +582,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-115.0-20230629.tar.xz /firefox-115.0.source.tar.xz /firefox-langpacks-115.0-20230703.tar.xz +/firefox-115.0.2.source.tar.xz +/firefox-langpacks-115.0.2-20230717.tar.xz diff --git a/firefox.spec b/firefox.spec index 7658d71..d728f52 100644 --- a/firefox.spec +++ b/firefox.spec @@ -155,13 +155,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 115.0 -Release: 3%{?pre_tag}%{?dist} +Version: 115.0.2 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230703.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230717.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -627,7 +627,7 @@ chmod a-x third_party/rust/ash/src/extensions/nv/*.rs %build # Disable LTO to work around rhbz#1883904 # Is that already fixed? -%define _lto_cflags %{nil} +#%define _lto_cflags %{nil} %if 0%{?use_bundled_cbindgen} mkdir -p my_rust_vendor @@ -716,8 +716,7 @@ export CCACHE_DISABLE=1 export GCOV_PREFIX=`pwd -P`/objdir export GCOV_PREFIX_STRIP=$(( $(echo `pwd -P`|tr -c -d '/' |wc -c )+2 )) env | grep GCOV -# Disabled due to rhbz#2218885 -#echo "ac_add_options --enable-lto" >> .mozconfig +echo "ac_add_options --enable-lto" >> .mozconfig echo "ac_add_options MOZ_PGO=1" >> .mozconfig %endif diff --git a/pgo.patch b/pgo.patch index 3ac23da..72c8b87 100644 --- a/pgo.patch +++ b/pgo.patch @@ -1,6 +1,18 @@ -diff -up firefox-112.0/build/pgo/profileserver.py.pgo firefox-112.0/build/pgo/profileserver.py ---- firefox-112.0/build/pgo/profileserver.py.pgo 2023-04-06 17:27:40.000000000 +0200 -+++ firefox-112.0/build/pgo/profileserver.py 2023-04-06 21:29:33.772294479 +0200 +diff -up firefox-115.0.2/build/moz.configure/lto-pgo.configure.pgo firefox-115.0.2/build/moz.configure/lto-pgo.configure +--- firefox-115.0.2/build/moz.configure/lto-pgo.configure.pgo 2023-07-10 21:29:37.000000000 +0200 ++++ firefox-115.0.2/build/moz.configure/lto-pgo.configure 2023-07-17 12:14:11.504155850 +0200 +@@ -86,7 +86,7 @@ def pgo_flags(compiler, profdata, target + return namespace( + gen_cflags=["-fprofile-generate"], + gen_ldflags=["-fprofile-generate"], +- use_cflags=["-fprofile-use", "-fprofile-correction", "-Wcoverage-mismatch"], ++ use_cflags=["-fprofile-use", "-fprofile-correction", "-Wno-coverage-mismatch"], + use_ldflags=["-fprofile-use"], + ) + +diff -up firefox-115.0.2/build/pgo/profileserver.py.pgo firefox-115.0.2/build/pgo/profileserver.py +--- firefox-115.0.2/build/pgo/profileserver.py.pgo 2023-07-10 21:29:38.000000000 +0200 ++++ firefox-115.0.2/build/pgo/profileserver.py 2023-07-17 12:14:11.503155816 +0200 @@ -11,7 +11,7 @@ import subprocess import sys @@ -36,9 +48,60 @@ diff -up firefox-112.0/build/pgo/profileserver.py.pgo firefox-112.0/build/pgo/pr with TemporaryDirectory() as profilePath: # TODO: refactor this into mozprofile -diff -up firefox-112.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-112.0/toolkit/components/terminator/nsTerminator.cpp ---- firefox-112.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2023-04-06 17:27:57.000000000 +0200 -+++ firefox-112.0/toolkit/components/terminator/nsTerminator.cpp 2023-04-06 21:27:32.538089108 +0200 +diff -up firefox-115.0.2/gfx/2d/moz.build.pgo firefox-115.0.2/gfx/2d/moz.build +--- firefox-115.0.2/gfx/2d/moz.build.pgo 2023-07-17 12:37:49.532499847 +0200 ++++ firefox-115.0.2/gfx/2d/moz.build 2023-07-17 12:38:16.378433587 +0200 +@@ -136,11 +136,11 @@ if CONFIG["INTEL_ARCHITECTURE"]: + # The file uses SSE2 intrinsics, so it needs special compile flags on some + # compilers. + SOURCES["BlurSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] +- SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2"] ++ SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2", "-fno-lto"] + SOURCES["ConvolutionFilterSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] + SOURCES["FilterProcessingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] + SOURCES["ImageScalingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] +- SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2"] ++ SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2", "-fno-lto"] + SOURCES["SwizzleSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] + SOURCES["SwizzleSSSE3.cpp"].flags += CONFIG["SSSE3_FLAGS"] + SOURCES["ssse3-scaler.c"].flags += CONFIG["SSSE3_FLAGS"] +diff -up firefox-115.0.2/gfx/skia/generate_mozbuild.py.pgo firefox-115.0.2/gfx/skia/generate_mozbuild.py +--- firefox-115.0.2/gfx/skia/generate_mozbuild.py.pgo 2023-07-10 21:29:41.000000000 +0200 ++++ firefox-115.0.2/gfx/skia/generate_mozbuild.py 2023-07-17 12:35:46.651225829 +0200 +@@ -54,10 +54,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind + if CONFIG['INTEL_ARCHITECTURE']: + SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-mssse3'] + SOURCES['skia/src/opts/SkOpts_sse42.cpp'].flags += ['-msse4.2'] +- SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-mavx'] +- SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-mavx2', '-mf16c', '-mfma'] ++ SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-mavx', '-fno-lto'] ++ SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-mavx2', '-mf16c', '-mfma', '-fno-lto'] + if not CONFIG["MOZ_CODE_COVERAGE"]: +- SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl'] ++ SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl', '-fno-lto'] + elif CONFIG['CPU_ARCH'] == 'aarch64' and CONFIG['CC_TYPE'] in ('clang', 'gcc'): + SOURCES['skia/src/opts/SkOpts_crc32.cpp'].flags += ['-march=armv8-a+crc'] + +diff -up firefox-115.0.2/gfx/skia/moz.build.pgo firefox-115.0.2/gfx/skia/moz.build +--- firefox-115.0.2/gfx/skia/moz.build.pgo 2023-07-10 21:29:41.000000000 +0200 ++++ firefox-115.0.2/gfx/skia/moz.build 2023-07-17 12:37:21.626529230 +0200 +@@ -565,10 +565,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind + if CONFIG['INTEL_ARCHITECTURE']: + SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-mssse3'] + SOURCES['skia/src/opts/SkOpts_sse42.cpp'].flags += ['-msse4.2'] +- SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-mavx'] +- SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-mavx2', '-mf16c', '-mfma'] ++ SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-mavx', '-fno-lto'] ++ SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-mavx2', '-mf16c', '-mfma', '-fno-lto'] + if not CONFIG["MOZ_CODE_COVERAGE"]: +- SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl'] ++ SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl', '-fno-lto'] + elif CONFIG['CPU_ARCH'] == 'aarch64' and CONFIG['CC_TYPE'] in ('clang', 'gcc'): + SOURCES['skia/src/opts/SkOpts_crc32.cpp'].flags += ['-march=armv8-a+crc'] + +diff -up firefox-115.0.2/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-115.0.2/toolkit/components/terminator/nsTerminator.cpp +--- firefox-115.0.2/toolkit/components/terminator/nsTerminator.cpp.pgo 2023-07-10 21:29:58.000000000 +0200 ++++ firefox-115.0.2/toolkit/components/terminator/nsTerminator.cpp 2023-07-17 12:14:11.503155816 +0200 @@ -460,6 +460,11 @@ void nsTerminator::StartWatchdog() { } #endif @@ -51,15 +114,3 @@ diff -up firefox-112.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefo UniquePtr options(new Options()); // crashAfterTicks is guaranteed to be > 0 as // crashAfterMS >= ADDITIONAL_WAIT_BEFORE_CRASH_MS >> HEARTBEAT_INTERVAL_MS -diff -up firefox-114.0.2/build/moz.configure/lto-pgo.configure.pgo firefox-114.0.2/build/moz.configure/lto-pgo.configure ---- firefox-114.0.2/build/moz.configure/lto-pgo.configure.pgo 2023-06-22 11:17:37.428552356 +0200 -+++ firefox-114.0.2/build/moz.configure/lto-pgo.configure 2023-06-22 11:17:51.476033691 +0200 -@@ -86,7 +86,7 @@ def pgo_flags(compiler, profdata, target - return namespace( - gen_cflags=["-fprofile-generate"], - gen_ldflags=["-fprofile-generate"], -- use_cflags=["-fprofile-use", "-fprofile-correction", "-Wcoverage-mismatch"], -+ use_cflags=["-fprofile-use", "-fprofile-correction", "-Wno-coverage-mismatch"], - use_ldflags=["-fprofile-use"], - ) - diff --git a/sources b/sources index e7d32a4..660c10a 100644 --- a/sources +++ b/sources @@ -2,3 +2,5 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2 SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (firefox-langpacks-115.0-20230703.tar.xz) = f08362a0cd190526ac89c99b0ed305c77b3264045e15d6deacba13532d57022551154b3615b89dd0d40d8be38d6d209a79743917d73a5d9b65835149fd34ae63 SHA512 (firefox-115.0.source.tar.xz) = ed5d150e4dfdc01026beb3ae502a0b04321dd130084fdef63afce79a8a7a4898741d08f77716ba720c24f31b9c732c00ad0f1cd408b35b5eb6601a10014fb1a2 +SHA512 (firefox-115.0.2.source.tar.xz) = de6ce8a2512e862c69a7d5c557d6168498d0d40e9c4b54b775f81c444e863a64c43130d57b51b360db4224c34b64a93f3ad263441caee713243b97750ec1eb4b +SHA512 (firefox-langpacks-115.0.2-20230717.tar.xz) = d29693aaaf741af4d55b404711f8d423ebaeb0344cd99ae7f724a7f97953193bf648a05ede1c342db5a12c4835d7dd00766ce0b6718966588f080b027a3e6e44 From 6cd9c47625d71b668dcb404c40b2d05e18faef16 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 17 Jul 2023 15:52:46 +0200 Subject: [PATCH 222/545] Removed old sources --- sources | 2 -- 1 file changed, 2 deletions(-) diff --git a/sources b/sources index 660c10a..f5f96cd 100644 --- a/sources +++ b/sources @@ -1,6 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 -SHA512 (firefox-langpacks-115.0-20230703.tar.xz) = f08362a0cd190526ac89c99b0ed305c77b3264045e15d6deacba13532d57022551154b3615b89dd0d40d8be38d6d209a79743917d73a5d9b65835149fd34ae63 -SHA512 (firefox-115.0.source.tar.xz) = ed5d150e4dfdc01026beb3ae502a0b04321dd130084fdef63afce79a8a7a4898741d08f77716ba720c24f31b9c732c00ad0f1cd408b35b5eb6601a10014fb1a2 SHA512 (firefox-115.0.2.source.tar.xz) = de6ce8a2512e862c69a7d5c557d6168498d0d40e9c4b54b775f81c444e863a64c43130d57b51b360db4224c34b64a93f3ad263441caee713243b97750ec1eb4b SHA512 (firefox-langpacks-115.0.2-20230717.tar.xz) = d29693aaaf741af4d55b404711f8d423ebaeb0344cd99ae7f724a7f97953193bf648a05ede1c342db5a12c4835d7dd00766ce0b6718966588f080b027a3e6e44 From 4eca3ad8d094fac8ac959d6af02c98ad80aec637 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 17 Jul 2023 15:55:01 +0200 Subject: [PATCH 223/545] Added changelog --- firefox.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/firefox.spec b/firefox.spec index d728f52..11a5e80 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1052,6 +1052,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Jul 17 2023 Martin Stransky - 115.0.2-1 +- Update to 115.0.2 + * Tue Jul 11 2023 Dan Horák - 115.0-3 - re-enable ppc64le (rhbz#2212748) From 88e057cc4f22dbfcb52d856efabbdb7aef45c2ba Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 18 Jul 2023 10:25:41 +0200 Subject: [PATCH 224/545] Don't overwrite MOZ_GMP_PATH (rhbz#2221317) --- firefox.sh.in | 4 +++- firefox.spec | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/firefox.sh.in b/firefox.sh.in index 078627f..2c49e79 100644 --- a/firefox.sh.in +++ b/firefox.sh.in @@ -131,7 +131,9 @@ export FONTCONFIG_PATH ## ## We want Firefox to use Openh264 provided by Fedora ## -export MOZ_GMP_PATH=$MOZ_LIB_DIR/mozilla/plugins/gmp-gmpopenh264/system-installed +if [ -z "$MOZ_GMP_PATH" ] + export MOZ_GMP_PATH=$MOZ_LIB_DIR/mozilla/plugins/gmp-gmpopenh264/system-installed +fi ## ## In order to better support certain scripts (such as Indic and some CJK diff --git a/firefox.spec b/firefox.spec index 11a5e80..5acd7b1 100644 --- a/firefox.spec +++ b/firefox.spec @@ -156,7 +156,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 115.0.2 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1052,6 +1052,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Jul 18 2023 Martin Stransky - 115.0.2-2 +- Don't overwrite MOZ_GMP_PATH (rhbz#2221317) + * Mon Jul 17 2023 Martin Stransky - 115.0.2-1 - Update to 115.0.2 From be98fb4794b0c1c03f8d34629f44d16f95be627f Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 19 Jul 2023 15:10:22 +0200 Subject: [PATCH 225/545] Fix the previous fix (rhbz#2221317) --- firefox.sh.in | 2 +- firefox.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/firefox.sh.in b/firefox.sh.in index 2c49e79..73d0b4e 100644 --- a/firefox.sh.in +++ b/firefox.sh.in @@ -131,7 +131,7 @@ export FONTCONFIG_PATH ## ## We want Firefox to use Openh264 provided by Fedora ## -if [ -z "$MOZ_GMP_PATH" ] +if [ -z "$MOZ_GMP_PATH" ]; then export MOZ_GMP_PATH=$MOZ_LIB_DIR/mozilla/plugins/gmp-gmpopenh264/system-installed fi diff --git a/firefox.spec b/firefox.spec index 5acd7b1..102f3e9 100644 --- a/firefox.spec +++ b/firefox.spec @@ -156,7 +156,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 115.0.2 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1052,6 +1052,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Jul 19 2023 Martin Stransky - 115.0.2-3 +- Fix the previous fix (rhbz#2221317) + * Tue Jul 18 2023 Martin Stransky - 115.0.2-2 - Don't overwrite MOZ_GMP_PATH (rhbz#2221317) From a2075ecfbc362a9786e16b2f5542e360d6adb67f Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 20 Jul 2023 11:22:32 +0200 Subject: [PATCH 226/545] Disable LTO for rust again due to build crashes on koji --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 102f3e9..b06dde6 100644 --- a/firefox.spec +++ b/firefox.spec @@ -627,7 +627,7 @@ chmod a-x third_party/rust/ash/src/extensions/nv/*.rs %build # Disable LTO to work around rhbz#1883904 # Is that already fixed? -#%define _lto_cflags %{nil} +%define _lto_cflags %{nil} %if 0%{?use_bundled_cbindgen} mkdir -p my_rust_vendor From 9955d54a564ffc519949863b797d4e919769bb66 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Sun, 9 Jul 2023 22:24:05 -0400 Subject: [PATCH 227/545] Use bundled cbindgen in RHEL builds RHEL does not include cbindgen nor its Rust crate dependencies. --- firefox.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/firefox.spec b/firefox.spec index b06dde6..9f54bbf 100644 --- a/firefox.spec +++ b/firefox.spec @@ -60,7 +60,11 @@ ExcludeArch: i686 %global system_pixman 1 # Bundled cbindgen makes build slow. # Enable only if system cbindgen is not available. +%if 0%{?rhel} +%global use_bundled_cbindgen 1 +%else %global use_bundled_cbindgen 0 +%endif %if %{debug_build} %global release_build 0 %endif From b8e076ae59a170bc1e7fadb715e76d24965d4f06 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 24 Jul 2023 09:48:46 +0200 Subject: [PATCH 228/545] Don't set MOZ_GMP_PATH as it's configured by /etc/profile.d/gmpopenh264.sh from mozilla-openh264 package (rhbz#2221317). --- firefox.sh.in | 11 +++++++---- firefox.spec | 6 +++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/firefox.sh.in b/firefox.sh.in index 73d0b4e..c72daba 100644 --- a/firefox.sh.in +++ b/firefox.sh.in @@ -129,11 +129,14 @@ FONTCONFIG_PATH="/etc/fonts:${MOZILLA_FIVE_HOME}/res/Xft" export FONTCONFIG_PATH ## -## We want Firefox to use Openh264 provided by Fedora +## We want Firefox to use Openh264 provided by Fedora. +## +## We used to configure it here but It's set by /etc/profile.d/gmpopenh264.sh +## script from mozilla-openh264 package now. Let's keep it here just +## for the record. +## +## export MOZ_GMP_PATH=$MOZ_LIB_DIR/mozilla/plugins/gmp-gmpopenh264/system-installed ## -if [ -z "$MOZ_GMP_PATH" ]; then - export MOZ_GMP_PATH=$MOZ_LIB_DIR/mozilla/plugins/gmp-gmpopenh264/system-installed -fi ## ## In order to better support certain scripts (such as Indic and some CJK diff --git a/firefox.spec b/firefox.spec index 9f54bbf..b11e31a 100644 --- a/firefox.spec +++ b/firefox.spec @@ -160,7 +160,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 115.0.2 -Release: 3%{?pre_tag}%{?dist} +Release: 4%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1056,6 +1056,10 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Jul 24 2023 Martin Stransky - 115.0.2-4 +- Don't set MOZ_GMP_PATH as it's configured by /etc/profile.d/gmpopenh264.sh + from mozilla-openh264 package. + * Wed Jul 19 2023 Martin Stransky - 115.0.2-3 - Fix the previous fix (rhbz#2221317) From e1da8d787198565e73ee3ae8b2ed310bd4c9d22c Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 26 Jul 2023 14:27:10 +0200 Subject: [PATCH 229/545] Updated to 116.0 --- .gitignore | 2 + D182447.diff | 111 --------------------------------------------------- firefox.spec | 10 ++--- pgo.patch | 76 +++++++++++++++++------------------ sources | 4 +- 5 files changed, 46 insertions(+), 157 deletions(-) delete mode 100644 D182447.diff diff --git a/.gitignore b/.gitignore index 43fa144..701ace4 100644 --- a/.gitignore +++ b/.gitignore @@ -584,3 +584,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-115.0-20230703.tar.xz /firefox-115.0.2.source.tar.xz /firefox-langpacks-115.0.2-20230717.tar.xz +/firefox-116.0.source.tar.xz +/firefox-langpacks-116.0-20230725.tar.xz diff --git a/D182447.diff b/D182447.diff deleted file mode 100644 index 8163545..0000000 --- a/D182447.diff +++ /dev/null @@ -1,111 +0,0 @@ -diff --git a/build/unix/elfhack/elf.cpp b/build/unix/elfhack/elf.cpp ---- a/build/unix/elfhack/elf.cpp -+++ b/build/unix/elfhack/elf.cpp -@@ -347,11 +347,11 @@ - } - } - return sections[index]; - } - --ElfSection* Elf::getSectionAt(unsigned int offset) { -+ElfSection* Elf::getSectionAt(Elf64_Off offset) { - for (int i = 1; i < ehdr->e_shnum; i++) { - ElfSection* section = getSection(i); - if ((section != nullptr) && (section->getFlags() & SHF_ALLOC) && - !(section->getFlags() & SHF_TLS) && (offset >= section->getAddr()) && - (offset < section->getAddr() + section->getSize())) -@@ -532,11 +532,11 @@ - info.section = shdr.sh_info ? parent->getSection(shdr.sh_info) : nullptr; - else - info.index = shdr.sh_info; - } - --unsigned int ElfSection::getAddr() { -+Elf64_Addr ElfSection::getAddr() { - if (shdr.sh_addr != (Elf64_Addr)-1) return shdr.sh_addr; - - // It should be safe to adjust sh_addr for all allocated sections that - // are neither SHT_NOBITS nor SHT_PROGBITS - if ((previous != nullptr) && isRelocatable()) { -@@ -548,16 +548,16 @@ - return (shdr.sh_addr = addr); - } - return shdr.sh_addr; - } - --unsigned int ElfSection::getOffset() { -+Elf64_Off ElfSection::getOffset() { - if (shdr.sh_offset != (Elf64_Off)-1) return shdr.sh_offset; - - if (previous == nullptr) return (shdr.sh_offset = 0); - -- unsigned int offset = previous->getOffset(); -+ Elf64_Off offset = previous->getOffset(); - - ElfSegment* ptload = getSegmentByType(PT_LOAD); - ElfSegment* prev_ptload = previous->getSegmentByType(PT_LOAD); - - if (ptload && (ptload == prev_ptload)) { -diff --git a/build/unix/elfhack/elfhack.cpp b/build/unix/elfhack/elfhack.cpp ---- a/build/unix/elfhack/elfhack.cpp -+++ b/build/unix/elfhack/elfhack.cpp -@@ -1258,12 +1258,12 @@ - second->getAddr() < first_executable->getAddr()) { - // The distance between both sections needs to be preserved because - // eh_frame_hdr contains relative offsets to eh_frame. Well, they could be - // relocated too, but it's not worth the effort for the few number of bytes - // this would save. -- unsigned int distance = second->getAddr() - first->getAddr(); -- unsigned int origAddr = eh_frame->getAddr(); -+ Elf64_Off distance = second->getAddr() - first->getAddr(); -+ Elf64_Addr origAddr = eh_frame->getAddr(); - ElfSection* previous = first->getPrevious(); - first->getShdr().sh_addr = (previous->getAddr() + previous->getSize() + - first->getAddrAlign() - 1) & - ~(first->getAddrAlign() - 1); - second->getShdr().sh_addr = -diff --git a/build/unix/elfhack/elfxx.h b/build/unix/elfhack/elfxx.h ---- a/build/unix/elfhack/elfxx.h -+++ b/build/unix/elfhack/elfxx.h -@@ -283,11 +283,11 @@ - ~Elf(); - - /* index == -1 is treated as index == ehdr.e_shstrndx */ - ElfSection* getSection(int index); - -- ElfSection* getSectionAt(unsigned int offset); -+ ElfSection* getSectionAt(Elf64_Off offset); - - ElfSegment* getSegmentByType(unsigned int type, ElfSegment* last = nullptr); - - ElfDynamic_Section* getDynSection(); - -@@ -332,12 +332,12 @@ - virtual ~ElfSection() { free(data); } - - const char* getName() { return name; } - unsigned int getType() { return shdr.sh_type; } - unsigned int getFlags() { return shdr.sh_flags; } -- unsigned int getAddr(); -- unsigned int getSize() { return shdr.sh_size; } -+ Elf64_Addr getAddr(); -+ Elf64_Off getSize() { return shdr.sh_size; } - unsigned int getAddrAlign() { return shdr.sh_addralign; } - unsigned int getEntSize() { return shdr.sh_entsize; } - const char* getData() { return data; } - ElfSection* getLink() { return link; } - SectionInfo getInfo() { return info; } -@@ -356,11 +356,11 @@ - shdr.sh_size = newsize; - markDirty(); - } - } - -- unsigned int getOffset(); -+ Elf64_Off getOffset(); - int getIndex(); - Elf_Shdr& getShdr(); - - ElfSection* getNext() { return next; } - ElfSection* getPrevious() { return previous; } - diff --git a/firefox.spec b/firefox.spec index b11e31a..996c289 100644 --- a/firefox.spec +++ b/firefox.spec @@ -159,13 +159,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 115.0.2 -Release: 4%{?pre_tag}%{?dist} +Version: 116.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230717.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230725.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -234,7 +234,6 @@ Patch230: firefox-enable-vaapi.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch -Patch408: D182447.diff # PGO/LTO patches Patch600: pgo.patch @@ -507,13 +506,12 @@ This package contains results of tests executed during build. %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 -%patch408 -p1 -b .D182447 # PGO patches %if %{build_with_pgo} %if !%{build_with_clang} %patch600 -p1 -b .pgo -#%patch602 -p1 -b .1516803 +%patch602 -p1 -b .1516803 %endif %endif %patch603 -p1 -b .inline diff --git a/pgo.patch b/pgo.patch index 72c8b87..3932d34 100644 --- a/pgo.patch +++ b/pgo.patch @@ -1,7 +1,7 @@ -diff -up firefox-115.0.2/build/moz.configure/lto-pgo.configure.pgo firefox-115.0.2/build/moz.configure/lto-pgo.configure ---- firefox-115.0.2/build/moz.configure/lto-pgo.configure.pgo 2023-07-10 21:29:37.000000000 +0200 -+++ firefox-115.0.2/build/moz.configure/lto-pgo.configure 2023-07-17 12:14:11.504155850 +0200 -@@ -86,7 +86,7 @@ def pgo_flags(compiler, profdata, target +diff -up firefox-116.0/build/moz.configure/lto-pgo.configure.pgo firefox-116.0/build/moz.configure/lto-pgo.configure +--- firefox-116.0/build/moz.configure/lto-pgo.configure.pgo 2023-07-24 22:39:09.000000000 +0200 ++++ firefox-116.0/build/moz.configure/lto-pgo.configure 2023-07-25 10:58:24.992687495 +0200 +@@ -93,7 +93,7 @@ def pgo_flags(compiler, profdata, target return namespace( gen_cflags=["-fprofile-generate"], gen_ldflags=["-fprofile-generate"], @@ -10,9 +10,9 @@ diff -up firefox-115.0.2/build/moz.configure/lto-pgo.configure.pgo firefox-115.0 use_ldflags=["-fprofile-use"], ) -diff -up firefox-115.0.2/build/pgo/profileserver.py.pgo firefox-115.0.2/build/pgo/profileserver.py ---- firefox-115.0.2/build/pgo/profileserver.py.pgo 2023-07-10 21:29:38.000000000 +0200 -+++ firefox-115.0.2/build/pgo/profileserver.py 2023-07-17 12:14:11.503155816 +0200 +diff -up firefox-116.0/build/pgo/profileserver.py.pgo firefox-116.0/build/pgo/profileserver.py +--- firefox-116.0/build/pgo/profileserver.py.pgo 2023-07-24 22:39:09.000000000 +0200 ++++ firefox-116.0/build/pgo/profileserver.py 2023-07-25 10:58:24.992687495 +0200 @@ -11,7 +11,7 @@ import subprocess import sys @@ -48,9 +48,9 @@ diff -up firefox-115.0.2/build/pgo/profileserver.py.pgo firefox-115.0.2/build/pg with TemporaryDirectory() as profilePath: # TODO: refactor this into mozprofile -diff -up firefox-115.0.2/gfx/2d/moz.build.pgo firefox-115.0.2/gfx/2d/moz.build ---- firefox-115.0.2/gfx/2d/moz.build.pgo 2023-07-17 12:37:49.532499847 +0200 -+++ firefox-115.0.2/gfx/2d/moz.build 2023-07-17 12:38:16.378433587 +0200 +diff -up firefox-116.0/gfx/2d/moz.build.pgo firefox-116.0/gfx/2d/moz.build +--- firefox-116.0/gfx/2d/moz.build.pgo 2023-07-24 22:39:10.000000000 +0200 ++++ firefox-116.0/gfx/2d/moz.build 2023-07-25 10:58:24.992687495 +0200 @@ -136,11 +136,11 @@ if CONFIG["INTEL_ARCHITECTURE"]: # The file uses SSE2 intrinsics, so it needs special compile flags on some # compilers. @@ -65,43 +65,43 @@ diff -up firefox-115.0.2/gfx/2d/moz.build.pgo firefox-115.0.2/gfx/2d/moz.build SOURCES["SwizzleSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] SOURCES["SwizzleSSSE3.cpp"].flags += CONFIG["SSSE3_FLAGS"] SOURCES["ssse3-scaler.c"].flags += CONFIG["SSSE3_FLAGS"] -diff -up firefox-115.0.2/gfx/skia/generate_mozbuild.py.pgo firefox-115.0.2/gfx/skia/generate_mozbuild.py ---- firefox-115.0.2/gfx/skia/generate_mozbuild.py.pgo 2023-07-10 21:29:41.000000000 +0200 -+++ firefox-115.0.2/gfx/skia/generate_mozbuild.py 2023-07-17 12:35:46.651225829 +0200 +diff -up firefox-116.0/gfx/skia/generate_mozbuild.py.pgo firefox-116.0/gfx/skia/generate_mozbuild.py +--- firefox-116.0/gfx/skia/generate_mozbuild.py.pgo 2023-07-25 10:58:24.993687530 +0200 ++++ firefox-116.0/gfx/skia/generate_mozbuild.py 2023-07-25 10:59:43.428384144 +0200 @@ -54,10 +54,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind if CONFIG['INTEL_ARCHITECTURE']: - SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-mssse3'] - SOURCES['skia/src/opts/SkOpts_sse42.cpp'].flags += ['-msse4.2'] -- SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-mavx'] -- SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-mavx2', '-mf16c', '-mfma'] -+ SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-mavx', '-fno-lto'] -+ SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-mavx2', '-mf16c', '-mfma', '-fno-lto'] + SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3', '-mssse3'] + SOURCES['skia/src/opts/SkOpts_sse42.cpp'].flags += ['-Dskvx=skvx_sse42', '-msse4.2'] +- SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-Dskvx=skvx_avx', '-mavx'] +- SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma'] ++ SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-Dskvx=skvx_avx', '-mavx', '-fno-lto'] ++ SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma', '-fno-lto'] if not CONFIG["MOZ_CODE_COVERAGE"]: -- SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl'] -+ SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl', '-fno-lto'] +- SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-Dskvx=skvx_skx', '-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl'] ++ SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-Dskvx=skvx_skx', '-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl', '-fno-lto'] elif CONFIG['CPU_ARCH'] == 'aarch64' and CONFIG['CC_TYPE'] in ('clang', 'gcc'): - SOURCES['skia/src/opts/SkOpts_crc32.cpp'].flags += ['-march=armv8-a+crc'] + SOURCES['skia/src/opts/SkOpts_crc32.cpp'].flags += ['-Dskvx=skvx_crc32', '-march=armv8-a+crc'] -diff -up firefox-115.0.2/gfx/skia/moz.build.pgo firefox-115.0.2/gfx/skia/moz.build ---- firefox-115.0.2/gfx/skia/moz.build.pgo 2023-07-10 21:29:41.000000000 +0200 -+++ firefox-115.0.2/gfx/skia/moz.build 2023-07-17 12:37:21.626529230 +0200 -@@ -565,10 +565,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind +diff -up firefox-116.0/gfx/skia/moz.build.pgo firefox-116.0/gfx/skia/moz.build +--- firefox-116.0/gfx/skia/moz.build.pgo 2023-07-25 10:58:24.993687530 +0200 ++++ firefox-116.0/gfx/skia/moz.build 2023-07-25 11:00:20.382652180 +0200 +@@ -564,10 +564,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind if CONFIG['INTEL_ARCHITECTURE']: - SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-mssse3'] - SOURCES['skia/src/opts/SkOpts_sse42.cpp'].flags += ['-msse4.2'] -- SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-mavx'] -- SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-mavx2', '-mf16c', '-mfma'] -+ SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-mavx', '-fno-lto'] -+ SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-mavx2', '-mf16c', '-mfma', '-fno-lto'] + SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3', '-mssse3'] + SOURCES['skia/src/opts/SkOpts_sse42.cpp'].flags += ['-Dskvx=skvx_sse42', '-msse4.2'] +- SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-Dskvx=skvx_avx', '-mavx'] +- SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma'] ++ SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-Dskvx=skvx_avx', '-mavx', '-fno-lto'] ++ SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma', '-fno-lto'] if not CONFIG["MOZ_CODE_COVERAGE"]: -- SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl'] -+ SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl', '-fno-lto'] +- SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-Dskvx=skvx_skx', '-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl'] ++ SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-Dskvx=skvx_skx', '-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl', '-fno-lto'] elif CONFIG['CPU_ARCH'] == 'aarch64' and CONFIG['CC_TYPE'] in ('clang', 'gcc'): - SOURCES['skia/src/opts/SkOpts_crc32.cpp'].flags += ['-march=armv8-a+crc'] + SOURCES['skia/src/opts/SkOpts_crc32.cpp'].flags += ['-Dskvx=skvx_crc32', '-march=armv8-a+crc'] -diff -up firefox-115.0.2/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-115.0.2/toolkit/components/terminator/nsTerminator.cpp ---- firefox-115.0.2/toolkit/components/terminator/nsTerminator.cpp.pgo 2023-07-10 21:29:58.000000000 +0200 -+++ firefox-115.0.2/toolkit/components/terminator/nsTerminator.cpp 2023-07-17 12:14:11.503155816 +0200 +diff -up firefox-116.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-116.0/toolkit/components/terminator/nsTerminator.cpp +--- firefox-116.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2023-07-24 22:39:24.000000000 +0200 ++++ firefox-116.0/toolkit/components/terminator/nsTerminator.cpp 2023-07-25 10:58:24.993687530 +0200 @@ -460,6 +460,11 @@ void nsTerminator::StartWatchdog() { } #endif diff --git a/sources b/sources index f5f96cd..4218047 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 -SHA512 (firefox-115.0.2.source.tar.xz) = de6ce8a2512e862c69a7d5c557d6168498d0d40e9c4b54b775f81c444e863a64c43130d57b51b360db4224c34b64a93f3ad263441caee713243b97750ec1eb4b -SHA512 (firefox-langpacks-115.0.2-20230717.tar.xz) = d29693aaaf741af4d55b404711f8d423ebaeb0344cd99ae7f724a7f97953193bf648a05ede1c342db5a12c4835d7dd00766ce0b6718966588f080b027a3e6e44 +SHA512 (firefox-116.0.source.tar.xz) = cf9738e954cc3f2b754ea26b08f93f6296aa0d002a35082404567341d53fe06f17b4faeb0a3fc64a8c782cf8184d6470f31d00d00d9d1bf5d8f5b12cbacc22b4 +SHA512 (firefox-langpacks-116.0-20230725.tar.xz) = 74c44f9dc6f3a9b7b7aa841e7f4c5774d7e2b9d0bdb738922bf675a4b413cf12e64274d594074e33cd499da2e50fe833a36d47ee91458b080b202c1b2dc6913c From ef1b31a8c2a9512155d10a2a1137396d19b99d4a Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 27 Jul 2023 12:12:55 +0200 Subject: [PATCH 230/545] Build fixes - vaapitest and v4l2test --- firefox.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 996c289..97e7df1 100644 --- a/firefox.spec +++ b/firefox.spec @@ -990,7 +990,6 @@ fi %{mozappdir}/firefox %{mozappdir}/firefox-bin %{mozappdir}/glxtest -%{mozappdir}/vaapitest %doc %{_mandir}/man1/* %dir %{_sysconfdir}/%{name} %dir %{_sysconfdir}/%{name}/* @@ -1044,6 +1043,13 @@ fi %{mozappdir}/plugin-container %{mozappdir}/gmp-clearkey %{mozappdir}/fonts/TwemojiMozilla.ttf +%ifarch aarch64 +%{mozappdir}/v4l2test +%{mozappdir}/vaapitest +%endif +%ifarch x86_64 +%{mozappdir}/vaapitest +%endif %if !%{?system_nss} %exclude %{mozappdir}/libnssckbi.so %endif From bd405c0fbd1e7c3f444f20bd10b0db8b89fc16e9 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 27 Jul 2023 13:34:34 +0200 Subject: [PATCH 231/545] Python3.11 build hack by jhorak --- firefox.spec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/firefox.spec b/firefox.spec index 97e7df1..7461f0a 100644 --- a/firefox.spec +++ b/firefox.spec @@ -319,6 +319,7 @@ BuildRequires: pkgconfig(libevent) %endif BuildRequires: python3-devel BuildRequires: python3-setuptools +BuildRequires: python3.11-devel %if !0%{?flatpak} Requires: u2f-hidraw-policy %endif @@ -742,6 +743,9 @@ no-index=true EOF tar xf %{SOURCE37} +#Use python 3.11 for mach +sed -i -e 's|#!/usr/bin/env python3|#!/usr/bin/env python3.11|' mach + %if %{build_with_pgo} %if %{test_on_wayland} env | grep "WAYLAND" @@ -1060,6 +1064,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Jul 27 2023 Martin Stransky - 116.0-1 +- Updated to 116.0 + * Mon Jul 24 2023 Martin Stransky - 115.0.2-4 - Don't set MOZ_GMP_PATH as it's configured by /etc/profile.d/gmpopenh264.sh from mozilla-openh264 package. From 4195044fad53d165bd5ca526a527166eef29337a Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 31 Jul 2023 12:51:27 +0200 Subject: [PATCH 232/545] Updated to build 2, request 4GB / per core --- .gitignore | 1 + firefox.spec | 11 +++++++---- sources | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 701ace4..aeb2d64 100644 --- a/.gitignore +++ b/.gitignore @@ -586,3 +586,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-115.0.2-20230717.tar.xz /firefox-116.0.source.tar.xz /firefox-langpacks-116.0-20230725.tar.xz +/firefox-langpacks-116.0-20230731.tar.xz diff --git a/firefox.spec b/firefox.spec index 7461f0a..23c048c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -160,12 +160,12 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 116.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230725.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230731.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -723,8 +723,8 @@ echo "ac_add_options --enable-lto" >> .mozconfig echo "ac_add_options MOZ_PGO=1" >> .mozconfig %endif -# Require 2 GB of RAM per CPU core -%constrain_build -m 2048 +# Require 4 GB of RAM per CPU core +%constrain_build -m 4096 echo "mk_add_options MOZ_MAKE_FLAGS=\"-j%{_smp_build_ncpus}\"" >> .mozconfig echo "mk_add_options MOZ_SERVICES_SYNC=1" >> .mozconfig @@ -1064,6 +1064,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Jul 31 2023 Martin Stransky - 116.0-2 +- Updated to 116.0 Build 2 + * Thu Jul 27 2023 Martin Stransky - 116.0-1 - Updated to 116.0 diff --git a/sources b/sources index 4218047..e5cb613 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 -SHA512 (firefox-116.0.source.tar.xz) = cf9738e954cc3f2b754ea26b08f93f6296aa0d002a35082404567341d53fe06f17b4faeb0a3fc64a8c782cf8184d6470f31d00d00d9d1bf5d8f5b12cbacc22b4 -SHA512 (firefox-langpacks-116.0-20230725.tar.xz) = 74c44f9dc6f3a9b7b7aa841e7f4c5774d7e2b9d0bdb738922bf675a4b413cf12e64274d594074e33cd499da2e50fe833a36d47ee91458b080b202c1b2dc6913c +SHA512 (firefox-langpacks-116.0-20230731.tar.xz) = d6adc31045637248f8fdb24a22338bf87e4e25979d964067d17a9963b33254a7bbcc0d0ff5bda915d33dfbf910447a00e564c1a257614f53fee5d44e1669aa55 +SHA512 (firefox-116.0.source.tar.xz) = 4370c65a99bf8796524aca11ea8e99fa4f875176a5805ad49f35ae149080eb54be42e7eae84627e87e17b88b262649e48f3b30b317170ac7c208960200d1005d From 60bfa9889d4fea112cfddb6854087f8095d4999c Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 2 Aug 2023 11:51:09 +0200 Subject: [PATCH 233/545] Added Canvas/WebGL VA-API playback patch (D167159 / mzbz#1769747) --- D167159.diff | 132 +++++++++++++++++++++++++++++++++++++++++++++++++++ firefox.spec | 7 ++- 2 files changed, 138 insertions(+), 1 deletion(-) create mode 100644 D167159.diff diff --git a/D167159.diff b/D167159.diff new file mode 100644 index 0000000..a9261b0 --- /dev/null +++ b/D167159.diff @@ -0,0 +1,132 @@ +diff --git a/dom/canvas/ClientWebGLContext.cpp b/dom/canvas/ClientWebGLContext.cpp +--- a/dom/canvas/ClientWebGLContext.cpp ++++ b/dom/canvas/ClientWebGLContext.cpp +@@ -4253,11 +4253,12 @@ + const auto& sd = *(desc->sd); + const auto sdType = sd.type(); + const auto& contextInfo = mNotLost->info; + + const auto fallbackReason = [&]() -> Maybe { +- auto fallbackReason = BlitPreventReason(level, offset, pi, *desc); ++ auto fallbackReason = ++ BlitPreventReason(level, offset, pi, *desc, Limits()); + if (fallbackReason) return fallbackReason; + + const bool canUploadViaSd = contextInfo.uploadableSdTypes[sdType]; + if (!canUploadViaSd) { + const nsPrintfCString msg( +diff --git a/dom/canvas/TexUnpackBlob.h b/dom/canvas/TexUnpackBlob.h +--- a/dom/canvas/TexUnpackBlob.h ++++ b/dom/canvas/TexUnpackBlob.h +@@ -41,11 +41,12 @@ + struct PackingInfo; + struct DriverUnpackInfo; + + Maybe BlitPreventReason(int32_t level, const ivec3& offset, + const webgl::PackingInfo&, +- const TexUnpackBlobDesc&); ++ const TexUnpackBlobDesc&, ++ const Limits& limits); + + class TexUnpackBlob { + public: + const TexUnpackBlobDesc& mDesc; + bool mNeedsExactUpload = true; +diff --git a/dom/canvas/TexUnpackBlob.cpp b/dom/canvas/TexUnpackBlob.cpp +--- a/dom/canvas/TexUnpackBlob.cpp ++++ b/dom/canvas/TexUnpackBlob.cpp +@@ -658,11 +658,12 @@ + return ValidateUnpackPixels(webgl, pi, fullRows, *this); + } + + Maybe BlitPreventReason(const int32_t level, const ivec3& offset, + const webgl::PackingInfo& pi, +- const TexUnpackBlobDesc& desc) { ++ const TexUnpackBlobDesc& desc, ++ const Limits& limits) { + const auto& size = desc.size; + const auto& unpacking = desc.unpacking; + + const auto ret = [&]() -> const char* { + if (size.z != 1) { +@@ -689,12 +690,16 @@ + return "UNPACK_PREMULTIPLY_ALPHA_WEBGL is not false"; + } + }(); + if (premultReason) return premultReason; + +- if (pi.format != LOCAL_GL_RGBA) { +- return "`format` is not RGBA"; ++ if (pi.format != LOCAL_GL_RGBA && pi.format != LOCAL_GL_RGB) { ++ return "`format` is not RGBA or RGB"; ++ } ++ ++ if (pi.format == LOCAL_GL_RGB && !limits.rgbColorRenderable) { ++ return "`format` is RGB, which is not color-renderable"; + } + + if (pi.type != LOCAL_GL_UNSIGNED_BYTE) { + return "`type` is not UNSIGNED_BYTE"; + } +@@ -722,12 +727,12 @@ + + const auto& gl = webgl->GL(); + + // - + +- const auto reason = +- BlitPreventReason(level, {xOffset, yOffset, zOffset}, pi, mDesc); ++ const auto reason = BlitPreventReason(level, {xOffset, yOffset, zOffset}, pi, ++ mDesc, tex->mContext->Limits()); + if (reason) { + webgl->GeneratePerfWarning( + "Failed to hit GPU-copy fast-path." + " (%s) Falling back to CPU upload.", + reason->c_str()); +diff --git a/dom/canvas/WebGLContextValidate.cpp b/dom/canvas/WebGLContextValidate.cpp +--- a/dom/canvas/WebGLContextValidate.cpp ++++ b/dom/canvas/WebGLContextValidate.cpp +@@ -239,10 +239,12 @@ + [WebGLExtensionID::WEBGL_compressed_texture_astc]) { + limits.astcHdr = gl.IsExtensionSupported( + gl::GLContext::KHR_texture_compression_astc_hdr); + } + ++ limits.rgbColorRenderable = webgl.gl->IsRGBColorRenderable(); ++ + if (webgl.IsWebGL2() || + limits.supportedExtensions[WebGLExtensionID::WEBGL_draw_buffers]) { + gl.GetUIntegerv(LOCAL_GL_MAX_DRAW_BUFFERS, &limits.maxColorDrawBuffers); + } + +diff --git a/dom/canvas/WebGLTypes.h b/dom/canvas/WebGLTypes.h +--- a/dom/canvas/WebGLTypes.h ++++ b/dom/canvas/WebGLTypes.h +@@ -663,10 +663,11 @@ + uint32_t maxUniformBufferBindings = 0; + uint32_t uniformBufferOffsetAlignment = 0; + + // Exts + bool astcHdr = false; ++ bool rgbColorRenderable = false; + uint32_t maxColorDrawBuffers = 1; + uint64_t queryCounterBitsTimeElapsed = 0; + uint64_t queryCounterBitsTimestamp = 0; + uint32_t maxMultiviewLayers = 0; + }; +diff --git a/gfx/gl/GLContext.h b/gfx/gl/GLContext.h +--- a/gfx/gl/GLContext.h ++++ b/gfx/gl/GLContext.h +@@ -290,10 +290,11 @@ + mTopError = GetError(); + return IsContextLost(); + } + + bool HasPBOState() const { return (!IsGLES() || Version() >= 300); } ++ bool IsRGBColorRenderable() { return !IsGLES() || Version() >= 300; } + + /** + * If this context is double-buffered, returns TRUE. + */ + virtual bool IsDoubleBuffered() const { return false; } + diff --git a/firefox.spec b/firefox.spec index 23c048c..8859f21 100644 --- a/firefox.spec +++ b/firefox.spec @@ -160,7 +160,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 116.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -234,6 +234,7 @@ Patch230: firefox-enable-vaapi.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch +Patch408: D167159.diff # PGO/LTO patches Patch600: pgo.patch @@ -507,6 +508,7 @@ This package contains results of tests executed during build. %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 +%patch408 -p1 -b .D167159 # PGO patches %if %{build_with_pgo} @@ -1064,6 +1066,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Aug 2 2023 Martin Stransky - 116.0-3 +- Added Canvas/WebGL VA-API playback patch (D167159 / mzbz#1769747) + * Mon Jul 31 2023 Martin Stransky - 116.0-2 - Updated to 116.0 Build 2 From d101b753fbdfa01f5057b17c9882eb9be64ca84d Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 4 Aug 2023 11:13:11 +0200 Subject: [PATCH 234/545] Updated to 116.0.1 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index aeb2d64..a2d9f81 100644 --- a/.gitignore +++ b/.gitignore @@ -587,3 +587,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-116.0.source.tar.xz /firefox-langpacks-116.0-20230725.tar.xz /firefox-langpacks-116.0-20230731.tar.xz +/firefox-116.0.1.source.tar.xz +/firefox-langpacks-116.0.1-20230804.tar.xz diff --git a/firefox.spec b/firefox.spec index 8859f21..0866961 100644 --- a/firefox.spec +++ b/firefox.spec @@ -159,13 +159,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 116.0 -Release: 3%{?pre_tag}%{?dist} +Version: 116.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230731.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230804.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1066,6 +1066,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Aug 4 2023 Martin Stransky - 116.0.1-1 +- Updated to 116.0.1 + * Wed Aug 2 2023 Martin Stransky - 116.0-3 - Added Canvas/WebGL VA-API playback patch (D167159 / mzbz#1769747) diff --git a/sources b/sources index e5cb613..148a3e2 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 -SHA512 (firefox-langpacks-116.0-20230731.tar.xz) = d6adc31045637248f8fdb24a22338bf87e4e25979d964067d17a9963b33254a7bbcc0d0ff5bda915d33dfbf910447a00e564c1a257614f53fee5d44e1669aa55 -SHA512 (firefox-116.0.source.tar.xz) = 4370c65a99bf8796524aca11ea8e99fa4f875176a5805ad49f35ae149080eb54be42e7eae84627e87e17b88b262649e48f3b30b317170ac7c208960200d1005d +SHA512 (firefox-116.0.1.source.tar.xz) = 2f67a129ec3bcb47d66cbf29ab23c1c29bfbe752a4703cb0d95f4f3e5a48044901bb79fea94e35f8a9d4dfbfa71aa6721b2988770c1dc33b4412b993bb88da09 +SHA512 (firefox-langpacks-116.0.1-20230804.tar.xz) = 01de0b5ca1a5ea34f73cc790b16e8963187dfc8f5affbb88349a3a2b0d2d63b8bcfd0c531c55b6cc76927ff84831283a8c9d1f2911af93c1b97b74bd67fc4bed From 105314641629aac6784c28aa81bfd574cc267ae1 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 7 Aug 2023 21:19:21 +0200 Subject: [PATCH 235/545] Updated to 116.0.2 --- .gitignore | 1 + firefox.spec | 7 +++++-- sources | 3 +-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index a2d9f81..1e4e9d8 100644 --- a/.gitignore +++ b/.gitignore @@ -589,3 +589,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-116.0-20230731.tar.xz /firefox-116.0.1.source.tar.xz /firefox-langpacks-116.0.1-20230804.tar.xz +/firefox-langpacks-116.0.2-20230807.tar.xz diff --git a/firefox.spec b/firefox.spec index 0866961..5a093c9 100644 --- a/firefox.spec +++ b/firefox.spec @@ -159,13 +159,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 116.0.1 +Version: 116.0.2 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230804.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230807.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1066,6 +1066,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Aug 7 2023 Martin Stransky - 116.0.2-1 +- Updated to 116.0.2 + * Fri Aug 4 2023 Martin Stransky - 116.0.1-1 - Updated to 116.0.1 diff --git a/sources b/sources index 148a3e2..4cab173 100644 --- a/sources +++ b/sources @@ -1,4 +1,3 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 -SHA512 (firefox-116.0.1.source.tar.xz) = 2f67a129ec3bcb47d66cbf29ab23c1c29bfbe752a4703cb0d95f4f3e5a48044901bb79fea94e35f8a9d4dfbfa71aa6721b2988770c1dc33b4412b993bb88da09 -SHA512 (firefox-langpacks-116.0.1-20230804.tar.xz) = 01de0b5ca1a5ea34f73cc790b16e8963187dfc8f5affbb88349a3a2b0d2d63b8bcfd0c531c55b6cc76927ff84831283a8c9d1f2911af93c1b97b74bd67fc4bed +SHA512 (firefox-langpacks-116.0.2-20230807.tar.xz) = bd2861133b6219a344a45ed01dc0dd3bb3611e38494102c14fe2bf91bd10377c2f300b2408236853c77336dc94e24f9ee7fc48eef98e9db37d86d782d6641a33 From 309cf4ddc202dd49ea9a984a13b0458fd02c34af Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 7 Aug 2023 21:50:03 +0200 Subject: [PATCH 236/545] Updated to 116.0.2 --- .gitignore | 1 + sources | 1 + 2 files changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 1e4e9d8..5ec0e0e 100644 --- a/.gitignore +++ b/.gitignore @@ -590,3 +590,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-116.0.1.source.tar.xz /firefox-langpacks-116.0.1-20230804.tar.xz /firefox-langpacks-116.0.2-20230807.tar.xz +/firefox-116.0.2.source.tar.xz diff --git a/sources b/sources index 4cab173..3dbad48 100644 --- a/sources +++ b/sources @@ -1,3 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (firefox-langpacks-116.0.2-20230807.tar.xz) = bd2861133b6219a344a45ed01dc0dd3bb3611e38494102c14fe2bf91bd10377c2f300b2408236853c77336dc94e24f9ee7fc48eef98e9db37d86d782d6641a33 +SHA512 (firefox-116.0.2.source.tar.xz) = 2c0ae18672fe22c75002744831130e13da764f83726951e5b58cfe74f7f473e22634ce08ebc11a98bac5baec0a4ac099a3a350a8b756af9c5bea6d5f4432da6d From c68eef9fb2df9f546ea37ce5e28f65c64ac6a15b Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 16 Aug 2023 11:02:52 +0200 Subject: [PATCH 237/545] Added Fedora customization patch --- fedora-customization.patch | 34 ++++++++++++++++++++++++++++++++++ firefox.spec | 7 ++++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 fedora-customization.patch diff --git a/fedora-customization.patch b/fedora-customization.patch new file mode 100644 index 0000000..2bcb335 --- /dev/null +++ b/fedora-customization.patch @@ -0,0 +1,34 @@ +diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp +--- a/toolkit/xre/nsAppRunner.cpp ++++ b/toolkit/xre/nsAppRunner.cpp +@@ -5762,6 +5762,12 @@ int XREMain::XRE_main(int argc, char* ar + if (!mAppData->remotingName) { + mAppData->remotingName = mAppData->name; + } ++ ++ const char* appRemotingName = getenv("MOZ_APP_REMOTINGNAME"); ++ if (appRemotingName) { ++ mAppData->remotingName = strdup(appRemotingName); ++ } ++ + // used throughout this file + gAppData = mAppData.get(); + +diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp +--- a/widget/gtk/nsWindow.cpp ++++ b/widget/gtk/nsWindow.cpp +@@ -3448,7 +3448,13 @@ void* nsWindow::GetNativeData(uint32_t a + nsresult nsWindow::SetTitle(const nsAString& aTitle) { + if (!mShell) return NS_OK; + +- // convert the string into utf8 and set the title. ++ const char* appTitle = getenv("MOZ_APP_TITLE"); ++ if (appTitle) { ++ gtk_window_set_title(GTK_WINDOW(mShell), appTitle); ++ return NS_OK; ++ } ++ ++ // convert the string into utf8 and set the title. + #define UTF8_FOLLOWBYTE(ch) (((ch)&0xC0) == 0x80) + NS_ConvertUTF16toUTF8 titleUTF8(aTitle); + if (titleUTF8.Length() > NS_WINDOW_TITLE_MAX_LENGTH) { diff --git a/firefox.spec b/firefox.spec index 5a093c9..56c613c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -160,7 +160,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 116.0.2 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -230,6 +230,7 @@ Patch226: rhbz-1354671.patch Patch228: disable-openh264-download.patch Patch229: firefox-nss-addon-hack.patch Patch230: firefox-enable-vaapi.patch +Patch231: fedora-customization.patch # Upstream patches Patch402: mozilla-1196777.patch @@ -505,6 +506,7 @@ This package contains results of tests executed during build. %patch228 -p1 -b .disable-openh264-download %patch229 -p1 -b .firefox-nss-addon-hack %patch230 -p1 -b .firefox-enable-vaapi +%patch231 -p1 -b .fedora-customization %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 @@ -1066,6 +1068,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Aug 16 2023 Martin Stransky - 116.0.2-2 +- Added Fedora customization patch + * Mon Aug 7 2023 Martin Stransky - 116.0.2-1 - Updated to 116.0.2 From a35e8720bbeb75f3790a208523f0466da15bf598 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 16 Aug 2023 11:05:23 +0200 Subject: [PATCH 238/545] Fixed changelog --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 56c613c..d57575e 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1068,7 +1068,7 @@ fi #--------------------------------------------------------------------- %changelog -* Mon Aug 16 2023 Martin Stransky - 116.0.2-2 +* Wed Aug 16 2023 Martin Stransky - 116.0.2-2 - Added Fedora customization patch * Mon Aug 7 2023 Martin Stransky - 116.0.2-1 From 8089009cb49523f1106c332ef8846ffe9d36b0d3 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 17 Aug 2023 12:21:23 +0200 Subject: [PATCH 239/545] Updated to 116.0.3 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 5ec0e0e..0422628 100644 --- a/.gitignore +++ b/.gitignore @@ -591,3 +591,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-116.0.1-20230804.tar.xz /firefox-langpacks-116.0.2-20230807.tar.xz /firefox-116.0.2.source.tar.xz +/firefox-langpacks-116.0.3-20230817.tar.xz +/firefox-116.0.3.source.tar.xz diff --git a/firefox.spec b/firefox.spec index d57575e..b0ba422 100644 --- a/firefox.spec +++ b/firefox.spec @@ -159,13 +159,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 116.0.2 -Release: 2%{?pre_tag}%{?dist} +Version: 116.0.3 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230807.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230817.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1068,6 +1068,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Aug 17 2023 Martin Stransky - 116.0.3-1 +- Updated to 116.0.3 + * Wed Aug 16 2023 Martin Stransky - 116.0.2-2 - Added Fedora customization patch diff --git a/sources b/sources index 3dbad48..63d25c2 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 -SHA512 (firefox-langpacks-116.0.2-20230807.tar.xz) = bd2861133b6219a344a45ed01dc0dd3bb3611e38494102c14fe2bf91bd10377c2f300b2408236853c77336dc94e24f9ee7fc48eef98e9db37d86d782d6641a33 -SHA512 (firefox-116.0.2.source.tar.xz) = 2c0ae18672fe22c75002744831130e13da764f83726951e5b58cfe74f7f473e22634ce08ebc11a98bac5baec0a4ac099a3a350a8b756af9c5bea6d5f4432da6d +SHA512 (firefox-langpacks-116.0.3-20230817.tar.xz) = 88709c9fa9395e7bcd58d0f9c2ffd3cf0d5c45a9b5f74451ce2534eec8e1e4e621a29a8a9910ce76465481f0abd506301eb6eacec5fb2779bfe1acac80d8fee9 +SHA512 (firefox-116.0.3.source.tar.xz) = 194c50e9ba5a918c37fbef8cd72ffb98e5e9f51955d8172b6666a758b5f20777ca0a7f79dff0328305fb6dafefb102ab002e326f47d0965a4dc6d3e9287c42b9 From fce974e85f7697d9ee756ac2176dfbd70718770d Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 28 Aug 2023 11:26:02 +0200 Subject: [PATCH 240/545] Update to 117.0 --- build-arm-libaom.patch | 12 ------------ firefox-enable-vaapi.patch | 12 ++++++------ firefox.spec | 9 +++++---- 3 files changed, 11 insertions(+), 22 deletions(-) delete mode 100644 build-arm-libaom.patch diff --git a/build-arm-libaom.patch b/build-arm-libaom.patch deleted file mode 100644 index 985f01d..0000000 --- a/build-arm-libaom.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up firefox-73.0/media/libaom/moz.build.old firefox-73.0/media/libaom/moz.build ---- firefox-73.0/media/libaom/moz.build.old 2020-02-07 23:13:28.000000000 +0200 -+++ firefox-73.0/media/libaom/moz.build 2020-02-17 10:30:08.509805092 +0200 -@@ -55,7 +55,7 @@ elif CONFIG['CPU_ARCH'] == 'arm': - - for f in SOURCES: - if f.endswith('neon.c'): -- SOURCES[f].flags += CONFIG['VPX_ASFLAGS'] -+ SOURCES[f].flags += CONFIG['NEON_FLAGS'] - - if CONFIG['OS_TARGET'] == 'Android': - # For cpu-features.h diff --git a/firefox-enable-vaapi.patch b/firefox-enable-vaapi.patch index d94d399..5f25bc1 100644 --- a/firefox-enable-vaapi.patch +++ b/firefox-enable-vaapi.patch @@ -1,9 +1,9 @@ -diff -up firefox-115.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi firefox-115.0/widget/gtk/GfxInfo.cpp ---- firefox-115.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi 2023-06-29 12:18:53.179833765 +0200 -+++ firefox-115.0/widget/gtk/GfxInfo.cpp 2023-06-29 12:19:33.256212776 +0200 -@@ -970,14 +970,6 @@ const nsTArray& GfxInfo:: - nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED, - V(0, 0, 0, 0), "FEATURE_HARDWARE_VIDEO_DECODING_NO_R600", ""); +diff -up firefox-117.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi firefox-117.0/widget/gtk/GfxInfo.cpp +--- firefox-117.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi 2023-08-28 11:20:54.324211945 +0200 ++++ firefox-117.0/widget/gtk/GfxInfo.cpp 2023-08-28 11:24:01.700666843 +0200 +@@ -1095,14 +1095,6 @@ const nsTArray& GfxInfo:: + nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_LESS_THAN, V(23, 1, 1, 0), + "FEATURE_HARDWARE_VIDEO_DECODING_AMD_DISABLE", "Mesa 23.1.1.0"); - // Disable on Release/late Beta on AMD -#if !defined(EARLY_BETA_OR_EARLIER) diff --git a/firefox.spec b/firefox.spec index b0ba422..1bc9345 100644 --- a/firefox.spec +++ b/firefox.spec @@ -159,13 +159,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 116.0.3 +Version: 117.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230817.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230828.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -205,7 +205,6 @@ Patch40: build-aarch64-skia.patch Patch44: build-arm-libopus.patch Patch46: firefox-nss-version.patch Patch47: fedora-shebang-build.patch -Patch49: build-arm-libaom.patch Patch53: firefox-gcc-build.patch Patch54: mozilla-1669639.patch Patch55: firefox-testing.patch @@ -484,7 +483,6 @@ This package contains results of tests executed during build. %patch40 -p1 -b .aarch64-skia %patch44 -p1 -b .build-arm-libopus %patch47 -p1 -b .fedora-shebang -%patch49 -p1 -b .build-arm-libaom %patch53 -p1 -b .firefox-gcc-build %patch54 -p1 -b .1669639 %patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 @@ -1068,6 +1066,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Aug 28 2023 Martin Stransky - 117.0-1 +- Updated to 117.0 + * Thu Aug 17 2023 Martin Stransky - 116.0.3-1 - Updated to 116.0.3 From 5fa8b8e9eb48ed57fed735516033d650cc529498 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 28 Aug 2023 14:07:43 +0200 Subject: [PATCH 241/545] Updated sources --- .gitignore | 2 ++ sources | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 0422628..c5c089b 100644 --- a/.gitignore +++ b/.gitignore @@ -593,3 +593,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-116.0.2.source.tar.xz /firefox-langpacks-116.0.3-20230817.tar.xz /firefox-116.0.3.source.tar.xz +/firefox-117.0.source.tar.xz +/firefox-langpacks-117.0-20230828.tar.xz diff --git a/sources b/sources index 63d25c2..33976a3 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 -SHA512 (firefox-langpacks-116.0.3-20230817.tar.xz) = 88709c9fa9395e7bcd58d0f9c2ffd3cf0d5c45a9b5f74451ce2534eec8e1e4e621a29a8a9910ce76465481f0abd506301eb6eacec5fb2779bfe1acac80d8fee9 -SHA512 (firefox-116.0.3.source.tar.xz) = 194c50e9ba5a918c37fbef8cd72ffb98e5e9f51955d8172b6666a758b5f20777ca0a7f79dff0328305fb6dafefb102ab002e326f47d0965a4dc6d3e9287c42b9 +SHA512 (firefox-117.0.source.tar.xz) = 4d2afa9bac9d0724fb3568f77a8103d75e90635802f47f2023127de07d70ff145fb0c19e6a4fd37bfe93a7bbb1ec506955c0d4fe3b07057561ebea82b8d6c8d2 +SHA512 (firefox-langpacks-117.0-20230828.tar.xz) = 0e0a60929cfc9e3c2ca90450053f3f9e919262643be0092016701c0f1a373ae7021050d3a26d31bb7afb5970bf9f187448d6b268f5bd7e3833ff11d3804e73b0 From 34b0ea8714ccaed6f6036f7c770f365598956753 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 30 Aug 2023 13:23:38 +0200 Subject: [PATCH 242/545] Added fix for rhbz#2235654 --- firefox.spec | 7 +++++- rhbz-2235654.patch | 59 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 rhbz-2235654.patch diff --git a/firefox.spec b/firefox.spec index 1bc9345..4abf465 100644 --- a/firefox.spec +++ b/firefox.spec @@ -160,7 +160,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 117.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -235,6 +235,7 @@ Patch231: fedora-customization.patch Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: D167159.diff +Patch409: rhbz-2235654.patch # PGO/LTO patches Patch600: pgo.patch @@ -509,6 +510,7 @@ This package contains results of tests executed during build. %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 %patch408 -p1 -b .D167159 +%patch409 -p1 -b .rhbz-2235654 # PGO patches %if %{build_with_pgo} @@ -1066,6 +1068,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Aug 30 2023 Martin Stransky - 117.0-2 +- Added fix for rhbz#2235654 + * Mon Aug 28 2023 Martin Stransky - 117.0-1 - Updated to 117.0 diff --git a/rhbz-2235654.patch b/rhbz-2235654.patch new file mode 100644 index 0000000..0c3780c --- /dev/null +++ b/rhbz-2235654.patch @@ -0,0 +1,59 @@ +diff -up firefox-117.0/media/ffvpx/libavcodec/x86/mathops.h.gccfailure firefox-117.0/media/ffvpx/libavcodec/x86/mathops.h +--- firefox-117.0/media/ffvpx/libavcodec/x86/mathops.h.gccfailure 2023-08-24 20:33:54.000000000 +0200 ++++ firefox-117.0/media/ffvpx/libavcodec/x86/mathops.h 2023-08-30 13:04:56.174949736 +0200 +@@ -35,12 +35,20 @@ + static av_always_inline av_const int MULL(int a, int b, unsigned shift) + { + int rt, dummy; ++ if (__builtin_constant_p(shift)) + __asm__ ( + "imull %3 \n\t" + "shrdl %4, %%edx, %%eax \n\t" + :"=a"(rt), "=d"(dummy) +- :"a"(a), "rm"(b), "ci"((uint8_t)shift) ++ :"a"(a), "rm"(b), "i"(shift & 0x1F) + ); ++ else ++ __asm__ ( ++ "imull %3 \n\t" ++ "shrdl %4, %%edx, %%eax \n\t" ++ :"=a"(rt), "=d"(dummy) ++ :"a"(a), "rm"(b), "c"((uint8_t)shift) ++ ); + return rt; + } + +@@ -113,19 +121,31 @@ __asm__ volatile(\ + // avoid +32 for shift optimization (gcc should do that ...) + #define NEG_SSR32 NEG_SSR32 + static inline int32_t NEG_SSR32( int32_t a, int8_t s){ ++ if (__builtin_constant_p(s)) + __asm__ ("sarl %1, %0\n\t" + : "+r" (a) +- : "ic" ((uint8_t)(-s)) ++ : "i" (-s & 0x1F) + ); ++ else ++ __asm__ ("sarl %1, %0\n\t" ++ : "+r" (a) ++ : "c" ((uint8_t)(-s)) ++ ); + return a; + } + + #define NEG_USR32 NEG_USR32 + static inline uint32_t NEG_USR32(uint32_t a, int8_t s){ ++ if (__builtin_constant_p(s)) + __asm__ ("shrl %1, %0\n\t" + : "+r" (a) +- : "ic" ((uint8_t)(-s)) ++ : "i" (-s & 0x1F) + ); ++ else ++ __asm__ ("shrl %1, %0\n\t" ++ : "+r" (a) ++ : "c" ((uint8_t)(-s)) ++ ); + return a; + } + From 5c11948fd0eaabce504cf5bcf9a1ad5d6b1870bb Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 13 Sep 2023 12:13:03 +0200 Subject: [PATCH 243/545] Updated to 117.0.1 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index c5c089b..b05d5e0 100644 --- a/.gitignore +++ b/.gitignore @@ -595,3 +595,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-116.0.3.source.tar.xz /firefox-117.0.source.tar.xz /firefox-langpacks-117.0-20230828.tar.xz +/firefox-117.0.1.source.tar.xz +/firefox-langpacks-117.0.1-20230913.tar.xz diff --git a/firefox.spec b/firefox.spec index 4abf465..81f56c7 100644 --- a/firefox.spec +++ b/firefox.spec @@ -159,13 +159,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 117.0 -Release: 2%{?pre_tag}%{?dist} +Version: 117.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230828.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230913.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1068,6 +1068,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Sep 13 2023 Martin Stransky - 117.0.1-1 +- Updated to 117.0.1 + * Wed Aug 30 2023 Martin Stransky - 117.0-2 - Added fix for rhbz#2235654 diff --git a/sources b/sources index 33976a3..faef187 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 -SHA512 (firefox-117.0.source.tar.xz) = 4d2afa9bac9d0724fb3568f77a8103d75e90635802f47f2023127de07d70ff145fb0c19e6a4fd37bfe93a7bbb1ec506955c0d4fe3b07057561ebea82b8d6c8d2 -SHA512 (firefox-langpacks-117.0-20230828.tar.xz) = 0e0a60929cfc9e3c2ca90450053f3f9e919262643be0092016701c0f1a373ae7021050d3a26d31bb7afb5970bf9f187448d6b268f5bd7e3833ff11d3804e73b0 +SHA512 (firefox-117.0.1.source.tar.xz) = 1583b0ad3b3b17c59bfbfb3e416074766327d0b926ef4f6c6b1e3b2d7cf6a18dec592b7d17fab9493ba1506f3540a02277096d28616dd29b6e7b9e93905f2071 +SHA512 (firefox-langpacks-117.0.1-20230913.tar.xz) = 0481c91bf1d99bf2cb76bb26903b95e23582d57f67b03f356663fbdfdeeec462088ca8b7316c7557b10da0ec7c58c0fb26e3ebe489085043a676b2376f55506b From c10a044ca5ef0d272fc0c06f5ab1aa8aec610282 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 14 Sep 2023 17:03:57 -0700 Subject: [PATCH 244/545] Pass --with-clang-path to fix build with clang 17 (rhbz#2239047) --- firefox.spec | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 81f56c7..4db5090 100644 --- a/firefox.spec +++ b/firefox.spec @@ -160,7 +160,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 117.0.1 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -621,6 +621,11 @@ echo "ac_add_options --with-mozilla-api-keyfile=`pwd`/mozilla-api-key" >> .mozco echo "ac_add_options --with-google-location-service-api-keyfile=`pwd`/google-loc-api-key" >> .mozconfig echo "ac_add_options --with-google-safebrowsing-api-keyfile=`pwd`/google-api-key" >> .mozconfig +# https://bugzilla.redhat.com/show_bug.cgi?id=2239046 +# with clang 17 upstream's detection fails, so let's just tell it +# where to look +echo "ac_add_options --with-clang-path=%{_libdir}" >> .mozconfig + echo 'export NODEJS="%{_buildrootdir}/bin/node-stdout-nonblocking-wrapper"' >> .mozconfig # Remove executable bit to make brp-mangle-shebangs happy. @@ -1068,6 +1073,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Sep 14 2023 Adam Williamson - 117.0.1-2 +- Pass --with-clang-path to fix build with clang 17 (rhbz#2239047) + * Wed Sep 13 2023 Martin Stransky - 117.0.1-1 - Updated to 117.0.1 From 230a3cfdd7bb0a2f8ad5f994800a04937f0fa263 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 14 Sep 2023 17:15:27 -0700 Subject: [PATCH 245/545] Whoops, we need to set --with-libclang-path, not --with-clang-path Signed-off-by: Adam Williamson --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 4db5090..1bfba1a 100644 --- a/firefox.spec +++ b/firefox.spec @@ -624,7 +624,7 @@ echo "ac_add_options --with-google-safebrowsing-api-keyfile=`pwd`/google-api-key # https://bugzilla.redhat.com/show_bug.cgi?id=2239046 # with clang 17 upstream's detection fails, so let's just tell it # where to look -echo "ac_add_options --with-clang-path=%{_libdir}" >> .mozconfig +echo "ac_add_options --with-libclang-path=%{_libdir}" >> .mozconfig echo 'export NODEJS="%{_buildrootdir}/bin/node-stdout-nonblocking-wrapper"' >> .mozconfig From e78a18fe12dad9f8764a154ea836099918398a79 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 25 Sep 2023 15:14:40 +0200 Subject: [PATCH 246/545] Update to 118.0 --- .gitignore | 2 ++ firefox.spec | 11 +++++---- rhbz-2235654.patch | 59 ---------------------------------------------- sources | 4 ++-- 4 files changed, 10 insertions(+), 66 deletions(-) delete mode 100644 rhbz-2235654.patch diff --git a/.gitignore b/.gitignore index b05d5e0..fae9006 100644 --- a/.gitignore +++ b/.gitignore @@ -597,3 +597,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-117.0-20230828.tar.xz /firefox-117.0.1.source.tar.xz /firefox-langpacks-117.0.1-20230913.tar.xz +/firefox-118.0.source.tar.xz +/firefox-langpacks-118.0-20230925.tar.xz diff --git a/firefox.spec b/firefox.spec index 1bfba1a..81d814f 100644 --- a/firefox.spec +++ b/firefox.spec @@ -159,13 +159,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 117.0.1 -Release: 2%{?pre_tag}%{?dist} +Version: 118.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230913.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230925.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -235,7 +235,6 @@ Patch231: fedora-customization.patch Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: D167159.diff -Patch409: rhbz-2235654.patch # PGO/LTO patches Patch600: pgo.patch @@ -510,7 +509,6 @@ This package contains results of tests executed during build. %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 %patch408 -p1 -b .D167159 -%patch409 -p1 -b .rhbz-2235654 # PGO patches %if %{build_with_pgo} @@ -1073,6 +1071,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Sep 25 2023 Martin Stransky - 118.0-1 +- Updated to 118.0 + * Thu Sep 14 2023 Adam Williamson - 117.0.1-2 - Pass --with-clang-path to fix build with clang 17 (rhbz#2239047) diff --git a/rhbz-2235654.patch b/rhbz-2235654.patch deleted file mode 100644 index 0c3780c..0000000 --- a/rhbz-2235654.patch +++ /dev/null @@ -1,59 +0,0 @@ -diff -up firefox-117.0/media/ffvpx/libavcodec/x86/mathops.h.gccfailure firefox-117.0/media/ffvpx/libavcodec/x86/mathops.h ---- firefox-117.0/media/ffvpx/libavcodec/x86/mathops.h.gccfailure 2023-08-24 20:33:54.000000000 +0200 -+++ firefox-117.0/media/ffvpx/libavcodec/x86/mathops.h 2023-08-30 13:04:56.174949736 +0200 -@@ -35,12 +35,20 @@ - static av_always_inline av_const int MULL(int a, int b, unsigned shift) - { - int rt, dummy; -+ if (__builtin_constant_p(shift)) - __asm__ ( - "imull %3 \n\t" - "shrdl %4, %%edx, %%eax \n\t" - :"=a"(rt), "=d"(dummy) -- :"a"(a), "rm"(b), "ci"((uint8_t)shift) -+ :"a"(a), "rm"(b), "i"(shift & 0x1F) - ); -+ else -+ __asm__ ( -+ "imull %3 \n\t" -+ "shrdl %4, %%edx, %%eax \n\t" -+ :"=a"(rt), "=d"(dummy) -+ :"a"(a), "rm"(b), "c"((uint8_t)shift) -+ ); - return rt; - } - -@@ -113,19 +121,31 @@ __asm__ volatile(\ - // avoid +32 for shift optimization (gcc should do that ...) - #define NEG_SSR32 NEG_SSR32 - static inline int32_t NEG_SSR32( int32_t a, int8_t s){ -+ if (__builtin_constant_p(s)) - __asm__ ("sarl %1, %0\n\t" - : "+r" (a) -- : "ic" ((uint8_t)(-s)) -+ : "i" (-s & 0x1F) - ); -+ else -+ __asm__ ("sarl %1, %0\n\t" -+ : "+r" (a) -+ : "c" ((uint8_t)(-s)) -+ ); - return a; - } - - #define NEG_USR32 NEG_USR32 - static inline uint32_t NEG_USR32(uint32_t a, int8_t s){ -+ if (__builtin_constant_p(s)) - __asm__ ("shrl %1, %0\n\t" - : "+r" (a) -- : "ic" ((uint8_t)(-s)) -+ : "i" (-s & 0x1F) - ); -+ else -+ __asm__ ("shrl %1, %0\n\t" -+ : "+r" (a) -+ : "c" ((uint8_t)(-s)) -+ ); - return a; - } - diff --git a/sources b/sources index faef187..66c6ff0 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 -SHA512 (firefox-117.0.1.source.tar.xz) = 1583b0ad3b3b17c59bfbfb3e416074766327d0b926ef4f6c6b1e3b2d7cf6a18dec592b7d17fab9493ba1506f3540a02277096d28616dd29b6e7b9e93905f2071 -SHA512 (firefox-langpacks-117.0.1-20230913.tar.xz) = 0481c91bf1d99bf2cb76bb26903b95e23582d57f67b03f356663fbdfdeeec462088ca8b7316c7557b10da0ec7c58c0fb26e3ebe489085043a676b2376f55506b +SHA512 (firefox-118.0.source.tar.xz) = 7c34c43930bda84d17a241fe7e0f8e6ca262410423ae7e7cc8444224aea2d25a52acc9079064ba57f3350e3573eb23aeaf7a2d98136d17e6fa89a61aaf57155d +SHA512 (firefox-langpacks-118.0-20230925.tar.xz) = 5a51a9843fba00779e718649154ea484ec3787fffcbb787a2f172bd7a1be99a87588abae17c1b38f9fb76c1d0e27fb453d1766285107a5b363bba047daae2579 From 85de885472621621af497b204a2f45f7122e8a23 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 27 Sep 2023 12:12:28 +0200 Subject: [PATCH 247/545] Fixed Gnome search provider --- firefox-search-provider.ini | 5 ----- firefox.desktop | 1 + firefox.spec | 11 +++++++++-- org.mozilla.firefox.SearchProvider.service | 3 +++ org.mozilla.firefox.search-provider.ini | 5 +++++ 5 files changed, 18 insertions(+), 7 deletions(-) delete mode 100644 firefox-search-provider.ini create mode 100644 org.mozilla.firefox.SearchProvider.service create mode 100644 org.mozilla.firefox.search-provider.ini diff --git a/firefox-search-provider.ini b/firefox-search-provider.ini deleted file mode 100644 index 3868e3d..0000000 --- a/firefox-search-provider.ini +++ /dev/null @@ -1,5 +0,0 @@ -[Shell Search Provider] -DesktopId=firefox.desktop -BusName=org.mozilla.Firefox.SearchProvider -ObjectPath=/org/mozilla/Firefox/SearchProvider -Version=2 diff --git a/firefox.desktop b/firefox.desktop index 02e156d..66c22dd 100644 --- a/firefox.desktop +++ b/firefox.desktop @@ -51,6 +51,7 @@ StartupNotify=true Categories=Network;WebBrowser; Keywords=web;browser;internet; Actions=new-window;new-private-window;profile-manager-window; +DBusActivatable=true [Desktop Action new-window] Name=Open a New Window diff --git a/firefox.spec b/firefox.spec index 81d814f..1d33140 100644 --- a/firefox.spec +++ b/firefox.spec @@ -160,7 +160,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 118.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -183,7 +183,7 @@ Source30: firefox-x11.sh.in Source31: firefox-x11.desktop Source32: node-stdout-nonblocking-wrapper Source33: firefox.appdata.xml.in -Source34: firefox-search-provider.ini +Source34: org.mozilla.firefox.search-provider.ini Source35: google-loc-api-key Source37: mochitest-python.tar.gz Source38: print_results @@ -194,6 +194,7 @@ Source42: psummary Source43: print_failures Source44: print-error-reftest Source45: run-wayland-compositor +Source46: org.mozilla.firefox.SearchProvider.service # Build patches #Patch3: mozilla-build-arm.patch @@ -943,6 +944,8 @@ sed -e "s/__VERSION__/%{version}/" \ # Install Gnome search provider files mkdir -p %{buildroot}%{_datadir}/gnome-shell/search-providers cp %{SOURCE34} %{buildroot}%{_datadir}/gnome-shell/search-providers +mkdir -p %{buildroot}%{_datadir}/dbus-1/services +cp %{SOURCE46} %{buildroot}%{_datadir}/dbus-1/services # Remove copied libraries to speed up build rm -f %{buildroot}%{mozappdirdev}/sdk/lib/libmozjs.so @@ -1009,6 +1012,7 @@ fi %{_datadir}/applications/%{name}.desktop %{_datadir}/metainfo/*.appdata.xml %{_datadir}/gnome-shell/search-providers/*.ini +%{_datadir}/dbus-1/services/* %dir %{mozappdir} %license %{mozappdir}/LICENSE %{mozappdir}/browser/chrome @@ -1071,6 +1075,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Sep 27 2023 Martin Stransky - 118.0-2 +- Fixed Gnome search provider + * Mon Sep 25 2023 Martin Stransky - 118.0-1 - Updated to 118.0 diff --git a/org.mozilla.firefox.SearchProvider.service b/org.mozilla.firefox.SearchProvider.service new file mode 100644 index 0000000..967b990 --- /dev/null +++ b/org.mozilla.firefox.SearchProvider.service @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=org.mozilla.firefox.SearchProvider +Exec=/usr/bin/firefox diff --git a/org.mozilla.firefox.search-provider.ini b/org.mozilla.firefox.search-provider.ini new file mode 100644 index 0000000..b2a0460 --- /dev/null +++ b/org.mozilla.firefox.search-provider.ini @@ -0,0 +1,5 @@ +[Shell Search Provider] +DesktopId=firefox.desktop +BusName=org.mozilla.firefox.SearchProvider +ObjectPath=/org/mozilla/firefox/SearchProvider +Version=2 From 36a09da5bc1a14f6af3fe163c84f9852e23c44c8 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 29 Sep 2023 11:00:18 +0200 Subject: [PATCH 248/545] build fix --- firefox.spec | 4 ++-- firefox.desktop => org.mozilla.firefox.desktop | 0 org.mozilla.firefox.search-provider.ini | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename firefox.desktop => org.mozilla.firefox.desktop (100%) diff --git a/firefox.spec b/firefox.spec index 1d33140..1d563a6 100644 --- a/firefox.spec +++ b/firefox.spec @@ -170,7 +170,7 @@ Source1: firefox-langpacks-%{version}%{?pre_version}-20230925.tar.xz Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig Source12: firefox-redhat-default-prefs.js -Source20: firefox.desktop +Source20: org.mozilla.firefox.desktop Source21: firefox.sh.in Source23: firefox.1 Source24: mozilla-api-key @@ -1009,7 +1009,7 @@ fi %dir %{_sysconfdir}/%{name}/* %dir %{_datadir}/mozilla/extensions/* %dir %{_libdir}/mozilla/extensions/* -%{_datadir}/applications/%{name}.desktop +%{_datadir}/applications/*.desktop %{_datadir}/metainfo/*.appdata.xml %{_datadir}/gnome-shell/search-providers/*.ini %{_datadir}/dbus-1/services/* diff --git a/firefox.desktop b/org.mozilla.firefox.desktop similarity index 100% rename from firefox.desktop rename to org.mozilla.firefox.desktop diff --git a/org.mozilla.firefox.search-provider.ini b/org.mozilla.firefox.search-provider.ini index b2a0460..0211665 100644 --- a/org.mozilla.firefox.search-provider.ini +++ b/org.mozilla.firefox.search-provider.ini @@ -1,5 +1,5 @@ [Shell Search Provider] -DesktopId=firefox.desktop +DesktopId=org.mozilla.firefox.desktop BusName=org.mozilla.firefox.SearchProvider ObjectPath=/org/mozilla/firefox/SearchProvider Version=2 From 6c0e8c39491e969e6cd85457f4eaf32a7c55dd60 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 29 Sep 2023 11:43:29 +0200 Subject: [PATCH 249/545] Updated to 118.0.1, Use system libraries for AV1, VP8, VP9, and WebP --- .gitignore | 2 + bmo-1559213-Support-system-av1.patch | 114 ++++++++++++++++++++++++++ bmo-1559213-fix-system-av1-libs.patch | 22 +++++ firefox.spec | 52 ++++++++++-- sources | 2 + 5 files changed, 187 insertions(+), 5 deletions(-) create mode 100644 bmo-1559213-Support-system-av1.patch create mode 100644 bmo-1559213-fix-system-av1-libs.patch diff --git a/.gitignore b/.gitignore index fae9006..5cf3781 100644 --- a/.gitignore +++ b/.gitignore @@ -599,3 +599,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-117.0.1-20230913.tar.xz /firefox-118.0.source.tar.xz /firefox-langpacks-118.0-20230925.tar.xz +/firefox-langpacks-118.0.1-20230929.tar.xz +/firefox-118.0.1.source.tar.xz diff --git a/bmo-1559213-Support-system-av1.patch b/bmo-1559213-Support-system-av1.patch new file mode 100644 index 0000000..e894258 --- /dev/null +++ b/bmo-1559213-Support-system-av1.patch @@ -0,0 +1,114 @@ +From 8a4627c0c910415b00bebeb976dc6ea8c3e0d5d0 Mon Sep 17 00:00:00 2001 +From: Thomas Deutschmann +Date: Mon, 6 Apr 2020 19:36:02 +0200 +Subject: [PATCH 06/30] bmo#1559213: Support system av1 + +Allow building against system-wide av1. + +Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1559213 +Signed-off-by: Thomas Deutschmann +--- + config/external/moz.build | 5 +++-- + config/system-headers.mozbuild | 8 ++++++++ + dom/media/platforms/moz.build | 5 +++++ + toolkit/moz.configure | 20 ++++++++++++++++++-- + 4 files changed, 34 insertions(+), 4 deletions(-) + +diff --git a/config/external/moz.build b/config/external/moz.build +index ab771212bf..75595d999c 100644 +--- a/config/external/moz.build ++++ b/config/external/moz.build +@@ -49,8 +49,9 @@ if not CONFIG["MOZ_SYSTEM_LIBVPX"]: + external_dirs += ["media/libvpx"] + + if CONFIG["MOZ_AV1"]: +- external_dirs += ["media/libaom"] +- external_dirs += ["media/libdav1d"] ++ if not CONFIG["MOZ_SYSTEM_AV1"]: ++ external_dirs += ["media/libaom"] ++ external_dirs += ["media/libdav1d"] + + if not CONFIG["MOZ_SYSTEM_PNG"]: + external_dirs += ["media/libpng"] +diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild +index 2f7ae39515..96ab3a6466 100644 +--- a/config/system-headers.mozbuild ++++ b/config/system-headers.mozbuild +@@ -1301,6 +1301,14 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']: + 'proxy.h', + ] + ++if CONFIG['MOZ_SYSTEM_AV1']: ++ system_headers += [ ++ 'aom/aom_decoder.h', ++ 'aom/aomdx.h', ++ 'aom/aom_image.h', ++ 'dav1d/dav1d.h', ++ ] ++ + if CONFIG['MOZ_SYSTEM_LIBVPX']: + system_headers += [ + 'vpx_mem/vpx_mem.h', +diff --git a/dom/media/platforms/moz.build b/dom/media/platforms/moz.build +index 8509aec6ef..7c5a1df63d 100644 +--- a/dom/media/platforms/moz.build ++++ b/dom/media/platforms/moz.build +@@ -78,6 +78,11 @@ if CONFIG["MOZ_AV1"]: + "agnostic/AOMDecoder.cpp", + "agnostic/DAV1DDecoder.cpp", + ] ++ if CONFIG["MOZ_SYSTEM_AV1"]: ++ CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"] ++ OS_LIBS += CONFIG["MOZ_SYSTEM_LIBAOM_LIBS"] ++ CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBDAV1D_CFLAGS"] ++ OS_LIBS += CONFIG["MOZ_SYSTEM_LIBDAV1D_LIBS"] + + if CONFIG["MOZ_OMX"]: + EXPORTS += [ +diff --git a/toolkit/moz.configure b/toolkit/moz.configure +index a68e1b347d..7b7975bd12 100644 +--- a/toolkit/moz.configure ++++ b/toolkit/moz.configure +@@ -544,14 +544,29 @@ def av1(value): + if value: + return True + ++option("--with-system-av1", help="Use system av1 (located with pkg-config)") + +-@depends(target, when=av1 & compile_environment) ++system_libaom_info = pkg_check_modules('MOZ_SYSTEM_LIBAOM', 'aom >= 1.0.0', ++ when='--with-system-av1') ++ ++system_libdav1d_info = pkg_check_modules('MOZ_SYSTEM_LIBDAV1D', 'dav1d >= 0.1.1', ++ when='--with-system-av1') ++ ++@depends(system_libaom_info, system_libdav1d_info) ++def system_av1(system_libaom_info, system_libdav1d_info): ++ has_av1_libs = False ++ if system_libaom_info and system_libdav1d_info: ++ has_av1_libs = True ++ return has_av1_libs ++ ++ ++@depends(target, when=av1 & depends(system_av1)(lambda v: not v) & compile_environment) + def dav1d_asm(target): + if target.cpu in ("aarch64", "x86", "x86_64"): + return True + + +-@depends(target, when=av1 & compile_environment) ++@depends(target, when=av1 & depends(system_av1)(lambda v: not v) & compile_environment) + def dav1d_nasm(target): + if target.cpu in ("x86", "x86_64"): + return namespace(version="2.14", what="AV1") +@@ -561,6 +576,7 @@ set_config("MOZ_DAV1D_ASM", dav1d_asm) + set_define("MOZ_DAV1D_ASM", dav1d_asm) + set_config("MOZ_AV1", av1) + set_define("MOZ_AV1", av1) ++set_config("MOZ_SYSTEM_AV1", depends_if(system_av1)(lambda _: True)) + + # JXL Image Codec Support + # ============================================================== +-- +2.34.1 + diff --git a/bmo-1559213-fix-system-av1-libs.patch b/bmo-1559213-fix-system-av1-libs.patch new file mode 100644 index 0000000..d687e8f --- /dev/null +++ b/bmo-1559213-fix-system-av1-libs.patch @@ -0,0 +1,22 @@ +diff -Naur a/media/ffvpx/libavcodec/moz.build b/media/ffvpx/libavcodec/moz.build +--- a/media/ffvpx/libavcodec/moz.build 2023-08-01 09:34:20.242044722 +0300 ++++ b/media/ffvpx/libavcodec/moz.build 2023-08-01 09:36:01.445808739 +0300 +@@ -109,10 +109,14 @@ + 'vp9recon.c', + 'vpx_rac.c', + ] +- USE_LIBS += [ +- 'dav1d', +- 'media_libdav1d_asm', +- ] ++ 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', ++ ] + if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": + LOCAL_INCLUDES += ['/media/mozva'] + SOURCES += [ diff --git a/firefox.spec b/firefox.spec index 1d563a6..e4bca18 100644 --- a/firefox.spec +++ b/firefox.spec @@ -55,9 +55,11 @@ ExcludeArch: i686 %endif %global system_ffi 1 -%global system_libvpx 0 +%global system_av1 1 +%global system_libvpx 1 %global system_jpeg 1 %global system_pixman 1 +%global system_webp 1 # Bundled cbindgen makes build slow. # Enable only if system cbindgen is not available. %if 0%{?rhel} @@ -108,8 +110,15 @@ ExcludeArch: i686 %global cairo_version 1.13.1 %global freetype_version 2.1.9 %global libnotify_version 0.7.0 +%if %{?system_av1} +%global aom_version 1.0.0 +%global dav1d_version 1.0.0 +%endif %if %{?system_libvpx} -%global libvpx_version 1.8.2 +%global libvpx_version 1.10.0 +%endif +%if %{?system_webp} +%global libwebp_version 1.1.0 %endif %if %{?system_nss} @@ -159,13 +168,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 118.0 -Release: 2%{?pre_tag}%{?dist} +Version: 118.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230925.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20230929.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -242,6 +251,10 @@ Patch600: pgo.patch Patch602: mozilla-1516803.patch Patch603: firefox-gcc-always-inline.patch +# system AV1 patches (from Gentoo) +Patch800: bmo-1559213-Support-system-av1.patch +Patch801: bmo-1559213-fix-system-av1-libs.patch + # tentative patch for RUSTFLAGS parsing issue: # https://bugzilla.redhat.com/show_bug.cgi?id=2184743 # https://bugzilla.mozilla.org/show_bug.cgi?id=1474486 @@ -275,9 +288,17 @@ BuildRequires: pkgconfig(dri) BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(alsa) BuildRequires: dbus-glib-devel +%if %{?system_av1} +BuildRequires: pkgconfig(aom) >= %{aom_version} +BuildRequires: pkgconfig(dav1d) >= %{dav1d_version} +%endif %if %{?system_libvpx} BuildRequires: libvpx-devel >= %{libvpx_version} %endif +%if %{?system_webp} +BuildRequires: pkgconfig(libwebp) >= %{libwebp_version} +BuildRequires: pkgconfig(libwebpdemux) >= %{libwebp_version} +%endif BuildRequires: autoconf213 BuildRequires: pkgconfig(libpulse) BuildRequires: yasm @@ -520,6 +541,9 @@ This package contains results of tests executed during build. %endif %patch603 -p1 -b .inline +%patch800 -p1 -b .system-av1 +%patch801 -p1 -b .system-av1-fixup + %patch1200 -p1 -b .rustflags-commasplit rm -f .mozconfig @@ -599,12 +623,24 @@ echo "ac_add_options --with-system-jpeg" >> .mozconfig echo "ac_add_options --enable-system-pixman" >> .mozconfig %endif +%if %{?system_av1} +echo "ac_add_options --with-system-av1" >> .mozconfig +%else +echo "ac_add_options --without-system-av1" >> .mozconfig +%endif + %if %{?system_libvpx} echo "ac_add_options --with-system-libvpx" >> .mozconfig %else echo "ac_add_options --without-system-libvpx" >> .mozconfig %endif +%if %{?system_webp} +echo "ac_add_options --with-system-webp" >> .mozconfig +%else +echo "ac_add_options --without-system-webp" >> .mozconfig +%endif + %ifarch s390x echo "ac_add_options --disable-jit" >> .mozconfig %endif @@ -1075,6 +1111,12 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Sep 27 2023 Neal Gompa - 118.0.1-1 +- Use system libraries for AV1, VP8, VP9, and WebP + +* Fri Sep 29 2023 Martin Stransky - 118.0.1-1 +- Updated to 118.0.1 + * Wed Sep 27 2023 Martin Stransky - 118.0-2 - Fixed Gnome search provider diff --git a/sources b/sources index 66c6ff0..0f9c15f 100644 --- a/sources +++ b/sources @@ -2,3 +2,5 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2 SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (firefox-118.0.source.tar.xz) = 7c34c43930bda84d17a241fe7e0f8e6ca262410423ae7e7cc8444224aea2d25a52acc9079064ba57f3350e3573eb23aeaf7a2d98136d17e6fa89a61aaf57155d SHA512 (firefox-langpacks-118.0-20230925.tar.xz) = 5a51a9843fba00779e718649154ea484ec3787fffcbb787a2f172bd7a1be99a87588abae17c1b38f9fb76c1d0e27fb453d1766285107a5b363bba047daae2579 +SHA512 (firefox-langpacks-118.0.1-20230929.tar.xz) = ea3923d854bce960b3a8ec859145fc7dcc878f389be5ed9f837a28268fc0f03482e7e073fe9a5207e7cccb6b7e6c4a8151ed409821e3ca38b795574354227013 +SHA512 (firefox-118.0.1.source.tar.xz) = b1efa1afea70434dc2a18d335bb8b526883cde200f1503b8c5fd2e7db8285e6a999cfa3aac354ea1c15a91d13a46d68db37023235314240b59eb8f55e01554ad From 1548005c0d70ccfe844550d775602c8ef3ad94c8 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 29 Sep 2023 12:14:17 +0200 Subject: [PATCH 250/545] Removed old sources --- sources | 2 -- 1 file changed, 2 deletions(-) diff --git a/sources b/sources index 0f9c15f..d70a6ef 100644 --- a/sources +++ b/sources @@ -1,6 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 -SHA512 (firefox-118.0.source.tar.xz) = 7c34c43930bda84d17a241fe7e0f8e6ca262410423ae7e7cc8444224aea2d25a52acc9079064ba57f3350e3573eb23aeaf7a2d98136d17e6fa89a61aaf57155d -SHA512 (firefox-langpacks-118.0-20230925.tar.xz) = 5a51a9843fba00779e718649154ea484ec3787fffcbb787a2f172bd7a1be99a87588abae17c1b38f9fb76c1d0e27fb453d1766285107a5b363bba047daae2579 SHA512 (firefox-langpacks-118.0.1-20230929.tar.xz) = ea3923d854bce960b3a8ec859145fc7dcc878f389be5ed9f837a28268fc0f03482e7e073fe9a5207e7cccb6b7e6c4a8151ed409821e3ca38b795574354227013 SHA512 (firefox-118.0.1.source.tar.xz) = b1efa1afea70434dc2a18d335bb8b526883cde200f1503b8c5fd2e7db8285e6a999cfa3aac354ea1c15a91d13a46d68db37023235314240b59eb8f55e01554ad From edd5f80c82dc6f38a19788ef85cdc84bc3449289 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 29 Sep 2023 14:17:56 +0200 Subject: [PATCH 251/545] Updated changelog order --- firefox.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/firefox.spec b/firefox.spec index e4bca18..37c4890 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1111,12 +1111,12 @@ fi #--------------------------------------------------------------------- %changelog -* Wed Sep 27 2023 Neal Gompa - 118.0.1-1 -- Use system libraries for AV1, VP8, VP9, and WebP - * Fri Sep 29 2023 Martin Stransky - 118.0.1-1 - Updated to 118.0.1 +* Wed Sep 27 2023 Neal Gompa - 118.0.1-1 +- Use system libraries for AV1, VP8, VP9, and WebP + * Wed Sep 27 2023 Martin Stransky - 118.0-2 - Fixed Gnome search provider From 86e26c4189a0192cd1185839e03a9ffcb4fbde75 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 29 Sep 2023 22:27:15 +0200 Subject: [PATCH 252/545] Use firefox.desktop again --- org.mozilla.firefox.desktop => firefox.desktop | 0 firefox.spec | 15 ++++++++++++--- org.mozilla.firefox.search-provider.ini | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) rename org.mozilla.firefox.desktop => firefox.desktop (100%) diff --git a/org.mozilla.firefox.desktop b/firefox.desktop similarity index 100% rename from org.mozilla.firefox.desktop rename to firefox.desktop diff --git a/firefox.spec b/firefox.spec index 37c4890..09cb02b 100644 --- a/firefox.spec +++ b/firefox.spec @@ -169,7 +169,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 118.0.1 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -179,7 +179,7 @@ Source1: firefox-langpacks-%{version}%{?pre_version}-20230929.tar.xz Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig Source12: firefox-redhat-default-prefs.js -Source20: org.mozilla.firefox.desktop +Source20: firefox.desktop Source21: firefox.sh.in Source23: firefox.1 Source24: mozilla-api-key @@ -837,7 +837,13 @@ DESTDIR=%{buildroot} make -C objdir install mkdir -p %{buildroot}{%{_libdir},%{_bindir},%{_datadir}/applications} -desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE20} +# TODO +# We can't use desktop-file-install as it refuses to install firefox.desktop file. +# We need to change it to org.mozilla.firefox.desktop and also update +# gnome shell default applications. +# +#desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE20} +cp %{SOURCE20} %{buildroot}%{_datadir}/applications desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE31} desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE29} @@ -1111,6 +1117,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Sep 29 2023 Martin Stransky - 118.0.1-2 +- Use firefox.desktop again + * Fri Sep 29 2023 Martin Stransky - 118.0.1-1 - Updated to 118.0.1 diff --git a/org.mozilla.firefox.search-provider.ini b/org.mozilla.firefox.search-provider.ini index 0211665..b2a0460 100644 --- a/org.mozilla.firefox.search-provider.ini +++ b/org.mozilla.firefox.search-provider.ini @@ -1,5 +1,5 @@ [Shell Search Provider] -DesktopId=org.mozilla.firefox.desktop +DesktopId=firefox.desktop BusName=org.mozilla.firefox.SearchProvider ObjectPath=/org/mozilla/firefox/SearchProvider Version=2 From cd32c2e28f8026d26bbed93100e16c144f86415c Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 2 Oct 2023 08:07:55 +0200 Subject: [PATCH 253/545] Avoid to launch Firefox by gnome-shell search --- firefox.spec | 5 ++++- org.mozilla.firefox.SearchProvider.service | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index 09cb02b..fc40ac1 100644 --- a/firefox.spec +++ b/firefox.spec @@ -169,7 +169,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 118.0.1 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1117,6 +1117,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Oct 1 2023 Martin Stransky - 118.0.1-3 +- Avoid to launch Firefox by gnome-shell search + * Fri Sep 29 2023 Martin Stransky - 118.0.1-2 - Use firefox.desktop again diff --git a/org.mozilla.firefox.SearchProvider.service b/org.mozilla.firefox.SearchProvider.service index 967b990..40e8259 100644 --- a/org.mozilla.firefox.SearchProvider.service +++ b/org.mozilla.firefox.SearchProvider.service @@ -1,3 +1,3 @@ [D-BUS Service] Name=org.mozilla.firefox.SearchProvider -Exec=/usr/bin/firefox +Exec=/usr/bin/false From 6bd9bbbb1559543bf36a7c65e299723c4a6e7a15 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 2 Oct 2023 08:13:47 +0200 Subject: [PATCH 254/545] Fixed changelog --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index fc40ac1..d56ae47 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1117,7 +1117,7 @@ fi #--------------------------------------------------------------------- %changelog -* Mon Oct 1 2023 Martin Stransky - 118.0.1-3 +* Mon Oct 2 2023 Martin Stransky - 118.0.1-3 - Avoid to launch Firefox by gnome-shell search * Fri Sep 29 2023 Martin Stransky - 118.0.1-2 From 0115959c8cac259f99a83013bf9e6df7dd827f51 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 2 Oct 2023 08:23:25 +0200 Subject: [PATCH 255/545] Updated man page --- firefox.1 | 31 ++++++++++++++++++++----------- firefox.spec | 5 ++++- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/firefox.1 b/firefox.1 index 556cf07..9228231 100644 --- a/firefox.1 +++ b/firefox.1 @@ -1,4 +1,4 @@ -.TH FIREFOX 1 "November 30, 2017" firefox "Linux User's Manual" +.TH FIREFOX 1 "July 10, 2019" firefox "Linux User's Manual" .SH NAME firefox \- a Web browser for X11 derived from the Mozilla browser @@ -33,10 +33,10 @@ Make all warnings fatal .SS "Firefox options" .TP -.B \-h, \-help +.B \-h, \--help Show summary of options. .TP -.B \-v, \-version +.B \-v, \--version Print Firefox version. .TP \fB\-P\fR \fIprofile\fR @@ -63,11 +63,22 @@ Start with \fIlocale\fR resources as UI Locale. \fB\-\-safe\-mode\fR Disables extensions and themes for this session. .TP +\fB\--allow-downgrade\fR +Allows downgrading a profile. +.TP +\fB\--MOZ_LOG\fR=\fImodules\fR +Treated as \fBMOZ_LOG\fR=\fImodules\fR environment variable, overrides it. +.TP +\fB\--MOZ_LOG_FILE\fR=\fIfile\fR +Treated as \fBMOZ_LOG_FILE\fR=\fIfile\fR environment variable, overrides it. If +MOZ_LOG_FILE is not specified as an argument or as an environment variable, +logging will be written to stdout. +.TP \fB\-\-headless\fR Run without a GUI. .TP -\fB\-\-marionette\fR -Enable remote control server. +\fB\-\-save-recordings\fR +Save recordings for all content processes to a directory. .TP \fB\-\-browser\fR Open a browser window. @@ -93,8 +104,9 @@ Width and optionally height of screenshot. \fB\-\-search\fR \fIterm\fR Search \fIterm\fR with your default search engine. .TP - - +\fB\-\-setDefaultBrowser\fR +Set this app as the default browser. +.TP \fB\-\-jsconsole\fR Open the Browser Console. .TP @@ -115,9 +127,6 @@ Record drawing for a given URL. .TP \fB\-\-recording-output\fR \fIfile\fR Specify destination file for a drawing recording. -.TP -\fB\-\-setDefaultBrowser\fR -Set this app as the default browser. .SH FILES \fI/usr/bin/firefox\fR - shell script wrapping @@ -127,7 +136,7 @@ Set this app as the default browser. executable .SH VERSION -57.0 +68.0 .SH BUGS To report a bug, please visit \fIhttp://bugzilla.mozilla.org/\fR diff --git a/firefox.spec b/firefox.spec index d56ae47..9fa0894 100644 --- a/firefox.spec +++ b/firefox.spec @@ -169,7 +169,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 118.0.1 -Release: 3%{?pre_tag}%{?dist} +Release: 4%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1117,6 +1117,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Oct 2 2023 Martin Stransky - 118.0.1-4 +- Updated man page + * Mon Oct 2 2023 Martin Stransky - 118.0.1-3 - Avoid to launch Firefox by gnome-shell search From 35e6001e2e95ca941a5afd0ccc3d87e68dd1a673 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 4 Oct 2023 10:47:03 -0700 Subject: [PATCH 256/545] Limit cores used for find-debuginfo (thanks kalev) As suggested by Kalev Lember: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/7CX676QRC2QVZATX34WTCF2GL26AAWCL/ try using %limit_build to use only one CPU core per 32G of RAM for find-debuginfo, to try and avoid builds failing due to lack of memory: https://bugzilla.redhat.com/show_bug.cgi?id=2241690 --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 9fa0894..b35deb4 100644 --- a/firefox.spec +++ b/firefox.spec @@ -450,7 +450,7 @@ and translations langpack add-ons. %global uname_m %(uname -m) %global symbols_file_name %{name}-%{version}.en-US.%{_os}-%{uname_m}.crashreporter-symbols.zip %global symbols_file_path %{moz_debug_dir}/%{symbols_file_name} -%global _find_debuginfo_opts -p %{symbols_file_path} -o debugcrashreporter.list +%global _find_debuginfo_opts %{limit_build -m 32768} -p %{symbols_file_path} -o debugcrashreporter.list %global crashreporter_pkg_name mozilla-crashreporter-%{name}-debuginfo %package -n %{crashreporter_pkg_name} Summary: Debugging symbols used by Mozilla's crash reporter servers From a5727f905469ce48416077e38a0fcdc02fa01817 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 4 Oct 2023 17:26:43 -0700 Subject: [PATCH 257/545] Always apply the find-debuginfo opts from previous commit Whoops, missed that this was in a conditional. Signed-off-by: Adam Williamson --- firefox.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/firefox.spec b/firefox.spec index b35deb4..761d241 100644 --- a/firefox.spec +++ b/firefox.spec @@ -459,6 +459,8 @@ This package provides debug information for Firefox, for use by Mozilla's crash reporter servers. If you are trying to locally debug %{name}, you want to install %{name}-debuginfo instead. %files -n %{crashreporter_pkg_name} -f debugcrashreporter.list +%else +%global _find_debuginfo_opts %{limit_build -m 32768} %endif %package x11 From 66f31e3216c790695cd7daa54b7f99d08984fb4c Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Thu, 5 Oct 2023 18:43:55 +0200 Subject: [PATCH 258/545] Fix flatpak build Don't assume libclang is going to be in the same prefix as firefox - in flatpak builds, libclang is in /usr and firefox is in /app. As a fix, use 'llvm-config --libdir' to find out the actual libclang path during the build. --- firefox.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index 761d241..309c3d5 100644 --- a/firefox.spec +++ b/firefox.spec @@ -169,7 +169,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 118.0.1 -Release: 4%{?pre_tag}%{?dist} +Release: 5%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -661,7 +661,7 @@ echo "ac_add_options --with-google-safebrowsing-api-keyfile=`pwd`/google-api-key # https://bugzilla.redhat.com/show_bug.cgi?id=2239046 # with clang 17 upstream's detection fails, so let's just tell it # where to look -echo "ac_add_options --with-libclang-path=%{_libdir}" >> .mozconfig +echo "ac_add_options --with-libclang-path=`llvm-config --libdir`" >> .mozconfig echo 'export NODEJS="%{_buildrootdir}/bin/node-stdout-nonblocking-wrapper"' >> .mozconfig @@ -1119,6 +1119,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Oct 05 2023 Kalev Lember - 118.0.1-5 +- Fix flatpak build + * Mon Oct 2 2023 Martin Stransky - 118.0.1-4 - Updated man page From 4135db16cc4bc2ea25859fa8702878ea49335524 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 6 Oct 2023 17:09:30 +0200 Subject: [PATCH 259/545] Removed DBusActivatable flag from desktop file as it crashes KDE (rhbz#2242454) --- firefox.desktop | 3 ++- firefox.spec | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/firefox.desktop b/firefox.desktop index 66c22dd..566c8d9 100644 --- a/firefox.desktop +++ b/firefox.desktop @@ -51,7 +51,8 @@ StartupNotify=true Categories=Network;WebBrowser; Keywords=web;browser;internet; Actions=new-window;new-private-window;profile-manager-window; -DBusActivatable=true +# Activable desktop file crashes KDE so remove it for now +# DBusActivatable=true [Desktop Action new-window] Name=Open a New Window diff --git a/firefox.spec b/firefox.spec index 9fa0894..6a0b9d7 100644 --- a/firefox.spec +++ b/firefox.spec @@ -169,7 +169,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 118.0.1 -Release: 4%{?pre_tag}%{?dist} +Release: 5%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1117,6 +1117,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Oct 6 2023 Martin Stransky - 118.0.1-5 +- Removed DBusActivatable flag from desktop file as it crashes KDE (rhbz#2242454). + * Mon Oct 2 2023 Martin Stransky - 118.0.1-4 - Updated man page From b85953896b4c0099084baa03c64ecd4aeb52d0c9 Mon Sep 17 00:00:00 2001 From: Alessandro Astone Date: Fri, 6 Oct 2023 19:00:21 +0200 Subject: [PATCH 260/545] Don't include -x11 and -wayland desktop files in the main package (rhbz#2242523) Regression caused by 36a09da5bc1a14f6af3fe163c84f9852e23c44c8 --- firefox.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index 1c06295..8c932ea 100644 --- a/firefox.spec +++ b/firefox.spec @@ -169,7 +169,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 118.0.1 -Release: 6%{?pre_tag}%{?dist} +Release: 7%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1053,7 +1053,7 @@ fi %dir %{_sysconfdir}/%{name}/* %dir %{_datadir}/mozilla/extensions/* %dir %{_libdir}/mozilla/extensions/* -%{_datadir}/applications/*.desktop +%{_datadir}/applications/firefox.desktop %{_datadir}/metainfo/*.appdata.xml %{_datadir}/gnome-shell/search-providers/*.ini %{_datadir}/dbus-1/services/* @@ -1119,6 +1119,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Oct 06 2023 Alessandro Astone - 118.0.1-7 +- Don't include -x11 and -wayland desktop files in the main package (rhbz#2242523) + * Fri Oct 6 2023 Martin Stransky - 118.0.1-6 - Removed DBusActivatable flag from desktop file as it crashes KDE (rhbz#2242454). From d551f9cd183031c9b9ef0704695dc9fcd669bbe2 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Sat, 7 Oct 2023 08:15:46 -0700 Subject: [PATCH 261/545] Add -g1 to find-debuginfo flags to try and get builds through F38 and F39 builds are failing a lot on x86_64 with gdb-add-index being killed, even with the %limit_build thing I added previously, so we'll have to try this. This is a big hammer which reduces the quality of backtraces a lot, but we really need to get builds through right now to fix major bugs. --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 8c932ea..38e9b27 100644 --- a/firefox.spec +++ b/firefox.spec @@ -460,7 +460,7 @@ Mozilla's crash reporter servers. If you are trying to locally debug %{name}, you want to install %{name}-debuginfo instead. %files -n %{crashreporter_pkg_name} -f debugcrashreporter.list %else -%global _find_debuginfo_opts %{limit_build -m 32768} +%global _find_debuginfo_opts %{limit_build -m 32768} -g1 %endif %package x11 From 06172c51b48e84f7e91a96a0f957044e6ba96877 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Sat, 7 Oct 2023 10:00:24 -0700 Subject: [PATCH 262/545] Looks like it should be -g, not -g1 --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 38e9b27..0f69b3e 100644 --- a/firefox.spec +++ b/firefox.spec @@ -460,7 +460,7 @@ Mozilla's crash reporter servers. If you are trying to locally debug %{name}, you want to install %{name}-debuginfo instead. %files -n %{crashreporter_pkg_name} -f debugcrashreporter.list %else -%global _find_debuginfo_opts %{limit_build -m 32768} -g1 +%global _find_debuginfo_opts %{limit_build -m 32768} -g %endif %package x11 From 5cdf6fcd2dc94433b7b4be9757f562489372c600 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Sat, 7 Oct 2023 13:44:14 -0700 Subject: [PATCH 263/545] Sigh: per Kalev, -g1 is for gcc, not find-debuginfo --- firefox.spec | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index 0f69b3e..fe86f07 100644 --- a/firefox.spec +++ b/firefox.spec @@ -460,7 +460,7 @@ Mozilla's crash reporter servers. If you are trying to locally debug %{name}, you want to install %{name}-debuginfo instead. %files -n %{crashreporter_pkg_name} -f debugcrashreporter.list %else -%global _find_debuginfo_opts %{limit_build -m 32768} -g +%global _find_debuginfo_opts %{limit_build -m 32768} %endif %package x11 @@ -723,8 +723,13 @@ MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | sed -e 's/-O2//') # (OOM when linking, rhbz#1238225) %ifarch %{ix86} MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | sed -e 's/-g/-g0/') -export MOZ_DEBUG_FLAGS=" " +%else +# this reduces backtrace quality substantially, but seems to be needed +# to prevent various OOM conditions during build +# https://bugzilla.redhat.com/show_bug.cgi?id=2241690 +MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | sed -e 's/-g/-g1/') %endif +export MOZ_DEBUG_FLAGS=" " MOZ_LINK_FLAGS="%{build_ldflags}" %if !%{build_with_clang} %ifarch aarch64 %{ix86} From 8be16df6398a4a27646ec842365a3142c47d7151 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 10 Oct 2023 11:46:35 +0200 Subject: [PATCH 264/545] Updated to 118.0.2 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 5cf3781..c3a766a 100644 --- a/.gitignore +++ b/.gitignore @@ -601,3 +601,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-118.0-20230925.tar.xz /firefox-langpacks-118.0.1-20230929.tar.xz /firefox-118.0.1.source.tar.xz +/firefox-118.0.2.source.tar.xz +/firefox-langpacks-118.0.2-20231010.tar.xz diff --git a/firefox.spec b/firefox.spec index fe86f07..c9d04ad 100644 --- a/firefox.spec +++ b/firefox.spec @@ -168,13 +168,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 118.0.1 -Release: 7%{?pre_tag}%{?dist} +Version: 118.0.2 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20230929.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20231010.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1124,6 +1124,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Oct 10 2023 Martin Stransky - 118.0.2-1 +- Updated to 118.0.2 + * Fri Oct 06 2023 Alessandro Astone - 118.0.1-7 - Don't include -x11 and -wayland desktop files in the main package (rhbz#2242523) diff --git a/sources b/sources index d70a6ef..df14284 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 -SHA512 (firefox-langpacks-118.0.1-20230929.tar.xz) = ea3923d854bce960b3a8ec859145fc7dcc878f389be5ed9f837a28268fc0f03482e7e073fe9a5207e7cccb6b7e6c4a8151ed409821e3ca38b795574354227013 -SHA512 (firefox-118.0.1.source.tar.xz) = b1efa1afea70434dc2a18d335bb8b526883cde200f1503b8c5fd2e7db8285e6a999cfa3aac354ea1c15a91d13a46d68db37023235314240b59eb8f55e01554ad +SHA512 (firefox-118.0.2.source.tar.xz) = fe9d7951927e44aee98a15840820251b779cc427f27597951497bd01fde3c3f2857942535c64c9d1a64f877c43802771304ed97254bffd9216f554e1af9efbf4 +SHA512 (firefox-langpacks-118.0.2-20231010.tar.xz) = e3e3ced2204b9f91e43e87baa98938f682b803ee224142c1c58da7c31734b9ec63202185590cd3b2648c8cc900a302d1fbb39514fddcbe21841c8f4b1b9b5425 From be149410b9c82c9acd69c0f7b0eb00bb9941c612 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Tue, 24 Oct 2023 09:08:36 +0200 Subject: [PATCH 265/545] Enable crashreporter --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index c9d04ad..a9ae100 100644 --- a/firefox.spec +++ b/firefox.spec @@ -40,7 +40,7 @@ ExcludeArch: i686 # https://bugzilla.redhat.com/show_bug.cgi?id=1951606 %global enable_mozilla_crashreporter 0 %ifarch x86_64 %{ix86} -%global enable_mozilla_crashreporter 0 +%global enable_mozilla_crashreporter 1 %endif %if %{build_with_asan} %global enable_mozilla_crashreporter 0 From bf2835c53da0b2551a6c3048dc75f7bd0e846611 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Tue, 24 Oct 2023 09:09:22 +0200 Subject: [PATCH 266/545] Bump release --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index a9ae100..1c60882 100644 --- a/firefox.spec +++ b/firefox.spec @@ -169,7 +169,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 118.0.2 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz From 875665f62d08badd2d225f5d24a9f20b80e8c926 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 24 Oct 2023 10:59:21 +0200 Subject: [PATCH 267/545] Update to 119.0 --- firefox.spec | 7 +++---- gen_cbindgen-vendor.sh | 2 +- sources | 6 +++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/firefox.spec b/firefox.spec index c9d04ad..c913b23 100644 --- a/firefox.spec +++ b/firefox.spec @@ -65,7 +65,7 @@ ExcludeArch: i686 %if 0%{?rhel} %global use_bundled_cbindgen 1 %else -%global use_bundled_cbindgen 0 +%global use_bundled_cbindgen 1 %endif %if %{debug_build} %global release_build 0 @@ -168,13 +168,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 118.0.2 +Version: 119.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20231010.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20231023.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source10: firefox-mozconfig @@ -1104,7 +1104,6 @@ fi %{mozappdir}/dictionaries %{mozappdir}/omni.ja %{mozappdir}/platform.ini -%{mozappdir}/plugin-container %{mozappdir}/gmp-clearkey %{mozappdir}/fonts/TwemojiMozilla.ttf %ifarch aarch64 diff --git a/gen_cbindgen-vendor.sh b/gen_cbindgen-vendor.sh index c2b60f0..4e8aded 100755 --- a/gen_cbindgen-vendor.sh +++ b/gen_cbindgen-vendor.sh @@ -12,7 +12,7 @@ to be used with 'cargo vendor' commmand. """ [dependencies] -cbindgen = "0.24.3" +cbindgen = "0.26.0" [[bin]] name = "dummy" diff --git a/sources b/sources index df14284..2657de5 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ -SHA512 (cbindgen-vendor.tar.xz) = 0d45c1decfd7aaee853748745c9f5a907c0c6a0cf809c2387aac1cdcf680b0844b1ef4d05148e0527de4ff6e4d4666110bea317bd00b7d73a1210eb58a815563 SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 -SHA512 (firefox-118.0.2.source.tar.xz) = fe9d7951927e44aee98a15840820251b779cc427f27597951497bd01fde3c3f2857942535c64c9d1a64f877c43802771304ed97254bffd9216f554e1af9efbf4 -SHA512 (firefox-langpacks-118.0.2-20231010.tar.xz) = e3e3ced2204b9f91e43e87baa98938f682b803ee224142c1c58da7c31734b9ec63202185590cd3b2648c8cc900a302d1fbb39514fddcbe21841c8f4b1b9b5425 +SHA512 (firefox-119.0.source.tar.xz) = 4b555c444add36567fd538752b122f227cf78bb70b72c79e6d8ae8d9c2e61c3cdacfae79c37970753b8b5c7716b28c686071eb7b551773c30a76852f3550676c +SHA512 (firefox-langpacks-119.0-20231023.tar.xz) = f23a71aa3d5d0dab7d38a2c10bab9943034a7b858df07f49d29baadb8df74a679597621e491b5f011a471bee0efb9e368b7e7664f793637a78169cd6483a94be +SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 From 8ddd19880ed2ad925eedce38a25ddaf590c5ec86 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 24 Oct 2023 14:46:15 +0200 Subject: [PATCH 268/545] Updated requested NSS version --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 5249cdd..c96993d 100644 --- a/firefox.spec +++ b/firefox.spec @@ -124,7 +124,7 @@ ExcludeArch: i686 %if %{?system_nss} %global nspr_version 4.32 %global nspr_build_version %{nspr_version} -%global nss_version 3.88 +%global nss_version 3.94 %global nss_build_version %{nss_version} %endif From 29b8dda20b756a56485d967488f97d33b5ec1d89 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 24 Oct 2023 17:18:08 +0200 Subject: [PATCH 269/545] Temporary disable crashreporter --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index c96993d..c23dca5 100644 --- a/firefox.spec +++ b/firefox.spec @@ -40,7 +40,7 @@ ExcludeArch: i686 # https://bugzilla.redhat.com/show_bug.cgi?id=1951606 %global enable_mozilla_crashreporter 0 %ifarch x86_64 %{ix86} -%global enable_mozilla_crashreporter 1 +%global enable_mozilla_crashreporter 0 %endif %if %{build_with_asan} %global enable_mozilla_crashreporter 0 From b896e22d66240855a4b04c1aef2a460c37b88365 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 27 Oct 2023 12:10:26 +0200 Subject: [PATCH 270/545] Added fix for mzbz#1861615 --- D192061.1698487416.diff | 107 ++++++++++++++++++++++++++++++++++++++++ firefox.spec | 7 ++- 2 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 D192061.1698487416.diff diff --git a/D192061.1698487416.diff b/D192061.1698487416.diff new file mode 100644 index 0000000..b7a06b4 --- /dev/null +++ b/D192061.1698487416.diff @@ -0,0 +1,107 @@ +diff --git a/widget/gtk/nsUserIdleServiceGTK.cpp b/widget/gtk/nsUserIdleServiceGTK.cpp +--- a/widget/gtk/nsUserIdleServiceGTK.cpp ++++ b/widget/gtk/nsUserIdleServiceGTK.cpp +@@ -149,48 +149,56 @@ + + #ifdef MOZ_ENABLE_DBUS + class UserIdleServiceMutter : public UserIdleServiceImpl { + public: + bool PollIdleTime(uint32_t* aIdleTime) override { +- MOZ_LOG(sIdleLog, LogLevel::Info, +- ("UserIdleServiceMutter::PollIdleTime()\n")); +- +- MOZ_ASSERT(mProxy); +- GUniquePtr error; ++ MOZ_LOG(sIdleLog, LogLevel::Info, ("PollIdleTime() request\n")); + +- RefPtr result = dont_AddRef(g_dbus_proxy_call_sync( +- mProxy, "GetIdletime", nullptr, G_DBUS_CALL_FLAGS_NONE, -1, +- mCancellable, getter_Transfers(error))); +- if (!result) { +- MOZ_LOG(sIdleLog, LogLevel::Info, +- ("UserIdleServiceMutter::PollIdleTime() failed, message: %s\n", +- error->message)); ++ // We're not ready yet ++ if (!mProxy) { + return false; + } +- if (!g_variant_is_of_type(result, G_VARIANT_TYPE_TUPLE) || +- g_variant_n_children(result) != 1) { +- MOZ_LOG( +- sIdleLog, LogLevel::Info, +- ("UserIdleServiceMutter::PollIdleTime() Unexpected params type: %s\n", +- g_variant_get_type_string(result))); +- return false; +- } +- RefPtr iTime = dont_AddRef(g_variant_get_child_value(result, 0)); +- if (!g_variant_is_of_type(iTime, G_VARIANT_TYPE_UINT64)) { +- MOZ_LOG( +- sIdleLog, LogLevel::Info, +- ("UserIdleServiceMutter::PollIdleTime() Unexpected params type: %s\n", +- g_variant_get_type_string(result))); +- return false; +- } +- uint64_t idleTime = g_variant_get_uint64(iTime); +- if (idleTime > std::numeric_limits::max()) { +- idleTime = std::numeric_limits::max(); +- } +- *aIdleTime = idleTime; ++ ++ DBusProxyCall(mProxy, "GetIdletime", nullptr, G_DBUS_CALL_FLAGS_NONE, -1, ++ mCancellable) ++ ->Then( ++ GetCurrentSerialEventTarget(), __func__, ++ // It's safe to capture this as we use mCancellable to stop ++ // listening. ++ [this](RefPtr&& aResult) { ++ if (!g_variant_is_of_type(aResult, G_VARIANT_TYPE_TUPLE) || ++ g_variant_n_children(aResult) != 1) { ++ MOZ_LOG(sIdleLog, LogLevel::Info, ++ ("PollIdleTime() Unexpected params type: %s\n", ++ g_variant_get_type_string(aResult))); ++ mLastIdleTime = 0; ++ return; ++ } ++ RefPtr iTime = ++ dont_AddRef(g_variant_get_child_value(aResult, 0)); ++ if (!g_variant_is_of_type(iTime, G_VARIANT_TYPE_UINT64)) { ++ MOZ_LOG(sIdleLog, LogLevel::Info, ++ ("PollIdleTime() Unexpected params type: %s\n", ++ g_variant_get_type_string(aResult))); ++ mLastIdleTime = 0; ++ return; ++ } ++ uint64_t idleTime = g_variant_get_uint64(iTime); ++ if (idleTime > std::numeric_limits::max()) { ++ idleTime = std::numeric_limits::max(); ++ } ++ mLastIdleTime = idleTime; ++ MOZ_LOG(sIdleLog, LogLevel::Info, ++ ("Async handler got %d\n", mLastIdleTime)); ++ }, ++ [](GUniquePtr&& aError) { ++ g_warning("Failed to call GetIdletime(): %s\n", aError->message); ++ }); ++ ++ *aIdleTime = mLastIdleTime; + MOZ_LOG(sIdleLog, LogLevel::Info, +- ("UserIdleServiceMutter::PollIdleTime() %d\n", *aIdleTime)); ++ ("PollIdleTime() returns %d\n", *aIdleTime)); + return true; + } + + bool ProbeImplementation( + RefPtr aUserIdleServiceGTK) override { +@@ -229,10 +237,11 @@ + } + + private: + RefPtr mProxy; + RefPtr mCancellable; ++ uint32_t mLastIdleTime = 0; + }; + #endif + + void nsUserIdleServiceGTK::ProbeService() { + MOZ_LOG(sIdleLog, LogLevel::Info, + diff --git a/firefox.spec b/firefox.spec index c23dca5..e6a1a70 100644 --- a/firefox.spec +++ b/firefox.spec @@ -169,7 +169,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 119.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -245,6 +245,7 @@ Patch231: fedora-customization.patch Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: D167159.diff +Patch409: D192061.1698487416.diff # PGO/LTO patches Patch600: pgo.patch @@ -533,6 +534,7 @@ This package contains results of tests executed during build. %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 %patch408 -p1 -b .D167159 +%patch409 -p1 -b .D192061 # PGO patches %if %{build_with_pgo} @@ -1123,6 +1125,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Oct 27 2023 Martin Stransky - 119.0-2 +- Added fix for mzbz#1861615 + * Tue Oct 24 2023 Martin Stransky - 119.0-1 - Updated to 119.0 From 118a6c91ecafe644b685e8dc247ccce9b86a8e4a Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Mon, 30 Oct 2023 08:50:43 +0100 Subject: [PATCH 271/545] Enable crash reporter --- .gitignore | 1 + firefox.spec | 24 +++++++++++++++++++++++- gen_dump_syms-vendor.sh | 32 ++++++++++++++++++++++++++++++++ sources | 1 + 4 files changed, 57 insertions(+), 1 deletion(-) create mode 100755 gen_dump_syms-vendor.sh diff --git a/.gitignore b/.gitignore index c3a766a..a491972 100644 --- a/.gitignore +++ b/.gitignore @@ -603,3 +603,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-118.0.1.source.tar.xz /firefox-118.0.2.source.tar.xz /firefox-langpacks-118.0.2-20231010.tar.xz +/dump_syms-vendor.tar.xz diff --git a/firefox.spec b/firefox.spec index e6a1a70..b88609e 100644 --- a/firefox.spec +++ b/firefox.spec @@ -169,7 +169,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 119.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -177,6 +177,7 @@ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pr Source1: firefox-langpacks-%{version}%{?pre_version}-20231023.tar.xz %endif Source2: cbindgen-vendor.tar.xz +Source3: dump_syms-vendor.tar.xz Source10: firefox-mozconfig Source12: firefox-redhat-default-prefs.js Source20: firefox.desktop @@ -700,6 +701,24 @@ cd - export CBINDGEN=/usr/bin/cbindgen %endif +%if %{enable_mozilla_crashreporter} +mkdir -p my_rust_vendor +cd my_rust_vendor +tar xf %{SOURCE3} +mkdir -p .cargo +cat > .cargo/config < - 119.0-3 +- Enable mozilla crash reporter + * Fri Oct 27 2023 Martin Stransky - 119.0-2 - Added fix for mzbz#1861615 diff --git a/gen_dump_syms-vendor.sh b/gen_dump_syms-vendor.sh new file mode 100755 index 0000000..d14888f --- /dev/null +++ b/gen_dump_syms-vendor.sh @@ -0,0 +1,32 @@ +#!/bin/bash +set -x + +# Dummy Cargo.toml file with cbindgen dependency +cat > Cargo.toml < Date: Mon, 6 Nov 2023 10:28:24 +0100 Subject: [PATCH 272/545] Added fix for mzbz#1762816 --- ...integration-to-Firefox-toolkit-parts.patch | 1343 +++++++++++++++++ 0026-Add-KDE-integration-to-Firefox.patch | 279 ++++ firefox.spec | 12 +- mozilla-1762816.patch | 121 ++ 4 files changed, 1754 insertions(+), 1 deletion(-) create mode 100644 0025-Add-KDE-integration-to-Firefox-toolkit-parts.patch create mode 100644 0026-Add-KDE-integration-to-Firefox.patch create mode 100644 mozilla-1762816.patch diff --git a/0025-Add-KDE-integration-to-Firefox-toolkit-parts.patch b/0025-Add-KDE-integration-to-Firefox-toolkit-parts.patch new file mode 100644 index 0000000..bd543b3 --- /dev/null +++ b/0025-Add-KDE-integration-to-Firefox-toolkit-parts.patch @@ -0,0 +1,1343 @@ +diff -up firefox-119.0/modules/libpref/moz.build.integration firefox-119.0/modules/libpref/moz.build +--- firefox-119.0/modules/libpref/moz.build.integration 2023-10-19 21:54:34.000000000 +0200 ++++ firefox-119.0/modules/libpref/moz.build 2023-10-31 08:59:03.719124766 +0100 +@@ -126,6 +126,10 @@ UNIFIED_SOURCES += [ + "SharedPrefMap.cpp", + ] + ++LOCAL_INCLUDES += [ ++ '/toolkit/xre' ++] ++ + gen_all_tuple = tuple(gen_h + gen_cpp + gen_rs) + + GeneratedFile( +diff -up firefox-119.0/modules/libpref/Preferences.cpp.integration firefox-119.0/modules/libpref/Preferences.cpp +--- firefox-119.0/modules/libpref/Preferences.cpp.integration 2023-10-19 21:54:34.000000000 +0200 ++++ firefox-119.0/modules/libpref/Preferences.cpp 2023-10-31 08:59:03.719124766 +0100 +@@ -95,6 +95,7 @@ + #ifdef MOZ_BACKGROUNDTASKS + # include "mozilla/BackgroundTasks.h" + #endif ++#include "nsKDEUtils.h" + + #ifdef DEBUG + # include +diff -up firefox-119.0/python/mozbuild/mozpack/chrome/flags.py.integration firefox-119.0/python/mozbuild/mozpack/chrome/flags.py +--- firefox-119.0/python/mozbuild/mozpack/chrome/flags.py.integration 2023-10-19 21:54:34.000000000 +0200 ++++ firefox-119.0/python/mozbuild/mozpack/chrome/flags.py 2023-10-31 08:59:03.719124766 +0100 +@@ -234,6 +234,7 @@ class Flags(OrderedDict): + "tablet": Flag, + "process": StringFlag, + "backgroundtask": StringFlag, ++ "desktop": StringFlag, + } + RE = re.compile(r"([!<>=]+)") + +diff -up firefox-119.0/python/mozbuild/mozpack/chrome/manifest.py.integration firefox-119.0/python/mozbuild/mozpack/chrome/manifest.py +--- firefox-119.0/python/mozbuild/mozpack/chrome/manifest.py.integration 2023-10-19 21:54:34.000000000 +0200 ++++ firefox-119.0/python/mozbuild/mozpack/chrome/manifest.py 2023-10-31 08:59:03.719124766 +0100 +@@ -43,6 +43,7 @@ class ManifestEntry(object): + "process", + "contentaccessible", + "backgroundtask", ++ "desktop", + ] + + def __init__(self, base, *flags): +diff -up firefox-119.0/toolkit/components/downloads/moz.build.integration firefox-119.0/toolkit/components/downloads/moz.build +--- firefox-119.0/toolkit/components/downloads/moz.build.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/toolkit/components/downloads/moz.build 2023-10-31 08:59:03.720124801 +0100 +@@ -51,5 +51,9 @@ if CONFIG["MOZ_PLACES"]: + + FINAL_LIBRARY = "xul" + ++LOCAL_INCLUDES += [ ++ '/toolkit/xre' ++] ++ + with Files("**"): + BUG_COMPONENT = ("Toolkit", "Downloads API") +diff -up firefox-119.0/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs.integration firefox-119.0/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs +--- firefox-119.0/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs 2023-10-31 08:59:03.720124801 +0100 +@@ -1246,26 +1246,56 @@ nsUnknownContentTypeDialog.prototype = { + this.chosenApp = params.handlerApp; + } + } else if ("@mozilla.org/applicationchooser;1" in Cc) { +- var nsIApplicationChooser = Ci.nsIApplicationChooser; +- var appChooser = Cc["@mozilla.org/applicationchooser;1"].createInstance( +- nsIApplicationChooser +- ); +- appChooser.init( +- this.mDialog, +- this.dialogElement("strings").getString("chooseAppFilePickerTitle") +- ); +- var contentTypeDialogObj = this; +- let appChooserCallback = function appChooserCallback_done(aResult) { +- if (aResult) { +- contentTypeDialogObj.chosenApp = aResult.QueryInterface( +- Ci.nsILocalHandlerApp +- ); +- } +- contentTypeDialogObj.finishChooseApp(); +- }; +- appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback); +- // The finishChooseApp is called from appChooserCallback +- return; ++ // handle the KDE case which is implemented in the filepicker ++ // therefore falling back to Gtk2 like behaviour if KDE is running ++ // FIXME this should be better handled in the nsIApplicationChooser ++ // interface ++ var env = Components.classes["@mozilla.org/process/environment;1"] ++ .getService(Components.interfaces.nsIEnvironment); ++ if (env.get('KDE_FULL_SESSION') == "true") ++ { ++ var nsIFilePicker = Ci.nsIFilePicker; ++ var fp = Cc["@mozilla.org/filepicker;1"] ++ .createInstance(nsIFilePicker); ++ fp.init(this.mDialog, ++ this.dialogElement("strings").getString("chooseAppFilePickerTitle"), ++ nsIFilePicker.modeOpen); ++ ++ fp.appendFilters(nsIFilePicker.filterApps); ++ ++ fp.open(aResult => { ++ if (aResult == nsIFilePicker.returnOK && fp.file) { ++ // Remember the file they chose to run. ++ var localHandlerApp = ++ Cc["@mozilla.org/uriloader/local-handler-app;1"]. ++ createInstance(Ci.nsILocalHandlerApp); ++ localHandlerApp.executable = fp.file; ++ this.chosenApp = localHandlerApp; ++ } ++ this.finishChooseApp(); ++ }); ++ } else { ++ var nsIApplicationChooser = Ci.nsIApplicationChooser; ++ var appChooser = Cc["@mozilla.org/applicationchooser;1"].createInstance( ++ nsIApplicationChooser ++ ); ++ appChooser.init( ++ this.mDialog, ++ this.dialogElement("strings").getString("chooseAppFilePickerTitle") ++ ); ++ var contentTypeDialogObj = this; ++ let appChooserCallback = function appChooserCallback_done(aResult) { ++ if (aResult) { ++ contentTypeDialogObj.chosenApp = aResult.QueryInterface( ++ Ci.nsILocalHandlerApp ++ ); ++ } ++ contentTypeDialogObj.finishChooseApp(); ++ }; ++ appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback); ++ // The finishChooseApp is called from appChooserCallback ++ return; ++ } + } else { + var nsIFilePicker = Ci.nsIFilePicker; + var fp = Cc["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker); +diff -up firefox-119.0/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp.integration firefox-119.0/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp +--- firefox-119.0/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp 2023-10-31 08:59:03.720124801 +0100 +@@ -16,6 +16,8 @@ + #include "nsISupportsPrimitives.h" + #include "nsIGSettingsService.h" + #include "nsReadableUtils.h" ++#include "nsPrintfCString.h" ++#include "nsKDEUtils.h" + + using namespace mozilla; + +@@ -39,6 +41,8 @@ class nsUnixSystemProxySettings final : + nsACString& aResult); + nsresult SetProxyResultFromGSettings(const char* aKeyBase, const char* aType, + nsACString& aResult); ++ nsresult GetProxyFromKDE(const nsACString& aScheme, const nsACString& aHost, ++ PRInt32 aPort, nsACString& aResult); + }; + + NS_IMPL_ISUPPORTS(nsUnixSystemProxySettings, nsISystemProxySettings) +@@ -393,6 +397,9 @@ nsresult nsUnixSystemProxySettings::GetP + const nsACString& aHost, + const int32_t aPort, + nsACString& aResult) { ++ if (nsKDEUtils::kdeSupport()) ++ return GetProxyFromKDE(aScheme, aHost, aPort, aResult); ++ + if (mProxySettings) { + nsresult rv = GetProxyFromGSettings(aScheme, aHost, aPort, aResult); + if (NS_SUCCEEDED(rv)) return rv; +@@ -401,6 +408,28 @@ nsresult nsUnixSystemProxySettings::GetP + return GetProxyFromEnvironment(aScheme, aHost, aPort, aResult); + } + ++nsresult nsUnixSystemProxySettings::GetProxyFromKDE(const nsACString& aScheme, ++ const nsACString& aHost, ++ PRInt32 aPort, ++ nsACString& aResult) { ++ nsAutoCString url; ++ url = aScheme; ++ url += "://"; ++ url += aHost; ++ if (aPort >= 0) { ++ url += ":"; ++ url += nsPrintfCString("%d", aPort); ++ } ++ nsTArray command; ++ command.AppendElement("GETPROXY"_ns); ++ command.AppendElement(url); ++ nsTArray result; ++ if (!nsKDEUtils::command(command, &result) || result.Length() != 1) ++ return NS_ERROR_FAILURE; ++ aResult = result[0]; ++ return NS_OK; ++} ++ + NS_IMPL_COMPONENT_FACTORY(nsUnixSystemProxySettings) { + auto result = MakeRefPtr(); + result->Init(); +diff -up firefox-119.0/toolkit/xre/moz.build.integration firefox-119.0/toolkit/xre/moz.build +--- firefox-119.0/toolkit/xre/moz.build.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/toolkit/xre/moz.build 2023-10-31 08:59:03.720124801 +0100 +@@ -96,7 +96,9 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "ui + "UIKitDirProvider.mm", + ] + elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": ++ EXPORTS += ['nsKDEUtils.h'] + UNIFIED_SOURCES += [ ++ "nsKDEUtils.cpp", + "nsNativeAppSupportUnix.cpp", + ] + CXXFLAGS += CONFIG["MOZ_X11_SM_CFLAGS"] +diff -up firefox-119.0/toolkit/xre/nsKDEUtils.cpp.integration firefox-119.0/toolkit/xre/nsKDEUtils.cpp +--- firefox-119.0/toolkit/xre/nsKDEUtils.cpp.integration 2023-10-31 08:59:03.721124836 +0100 ++++ firefox-119.0/toolkit/xre/nsKDEUtils.cpp 2023-10-31 08:59:03.721124836 +0100 +@@ -0,0 +1,286 @@ ++/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#include "nsKDEUtils.h" ++#include "nsIWidget.h" ++#include "nsISupportsPrimitives.h" ++#include "nsIMutableArray.h" ++#include "nsComponentManagerUtils.h" ++#include "nsArrayUtils.h" ++ ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++// copied from X11/X.h as a hack since for an unknown ++// reason it's not picked up from X11/X.h ++#ifndef None ++# define None 0L /* universal null resource or null atom */ ++#endif ++ ++// #define DEBUG_KDE ++#ifdef DEBUG_KDE ++# define KMOZILLAHELPER "kmozillahelper" ++#else ++// not need for lib64, it's a binary ++# define KMOZILLAHELPER "/usr/lib/mozilla/kmozillahelper" ++#endif ++ ++#define KMOZILLAHELPER_VERSION 6 ++#define MAKE_STR2(n) #n ++#define MAKE_STR(n) MAKE_STR2(n) ++ ++static bool getKdeSession() { ++ if (PR_GetEnv("KDE_FULL_SESSION")) { ++ return true; ++ } ++ return false; ++} ++ ++static bool getKdeSupport() { ++ nsTArray command; ++ command.AppendElement("CHECK"_ns); ++ command.AppendElement("KMOZILLAHELPER_VERSION"_ns); ++ bool kde = nsKDEUtils::command(command); ++#ifdef DEBUG_KDE ++ fprintf(stderr, "KDE RUNNING %d\n", kde); ++#endif ++ return kde; ++} ++ ++nsKDEUtils::nsKDEUtils() : commandFile(NULL), replyFile(NULL) {} ++ ++nsKDEUtils::~nsKDEUtils() { ++ // closeHelper(); not actually useful, exiting will close the fd too ++} ++ ++nsKDEUtils* nsKDEUtils::self() { ++ static nsKDEUtils s; ++ return &s; ++} ++ ++static bool helperRunning = false; ++static bool helperFailed = false; ++ ++bool nsKDEUtils::kdeSession() { ++ static bool session = getKdeSession(); ++ return session; ++} ++ ++bool nsKDEUtils::kdeSupport() { ++ static bool support = kdeSession() && getKdeSupport(); ++ return support && helperRunning; ++} ++ ++struct nsKDECommandData { ++ FILE* file; ++ nsTArray* output; ++ GMainLoop* loop; ++ bool success; ++}; ++ ++static gboolean kdeReadFunc(GIOChannel*, GIOCondition, gpointer data) { ++ nsKDECommandData* p = static_cast(data); ++ char buf[8192]; // TODO big enough ++ bool command_done = false; ++ bool command_failed = false; ++ while (!command_done && !command_failed && ++ fgets(buf, 8192, p->file) != ++ NULL) { // TODO what if the kernel splits a line into two chunks? ++ // #ifdef DEBUG_KDE ++ // fprintf( stderr, "READ: %s %d\n", buf, feof( p->file )); ++ // #endif ++ if (char* eol = strchr(buf, '\n')) *eol = '\0'; ++ command_done = (strcmp(buf, "\\1") == 0); ++ command_failed = (strcmp(buf, "\\0") == 0); ++ nsAutoCString line(buf); ++ line.ReplaceSubstring("\\n", "\n"); ++ line.ReplaceSubstring( ++ "\\" ++ "\\", ++ "\\"); // \\ -> \ , i.e. unescape ++ if (p->output && !(command_done || command_failed)) ++ p->output->AppendElement(nsCString(buf)); // TODO utf8? ++ } ++ bool quit = false; ++ if (feof(p->file) || command_failed) { ++ quit = true; ++ p->success = false; ++ } ++ if (command_done) { // reading one reply finished ++ quit = true; ++ p->success = true; ++ } ++ if (quit) { ++ if (p->loop) g_main_loop_quit(p->loop); ++ return FALSE; ++ } ++ return TRUE; ++} ++ ++bool nsKDEUtils::command(const nsTArray& command, ++ nsTArray* output) { ++ return self()->internalCommand(command, NULL, false, output); ++} ++ ++bool nsKDEUtils::command(nsIArray* command, nsIArray** output) { ++ nsTArray in; ++ PRUint32 length; ++ command->GetLength(&length); ++ for (PRUint32 i = 0; i < length; i++) { ++ nsCOMPtr str = do_QueryElementAt(command, i); ++ if (str) { ++ nsAutoCString s; ++ str->GetData(s); ++ in.AppendElement(s); ++ } ++ } ++ ++ nsTArray out; ++ bool ret = self()->internalCommand(in, NULL, false, &out); ++ ++ if (!output) return ret; ++ ++ nsCOMPtr result = do_CreateInstance(NS_ARRAY_CONTRACTID); ++ if (!result) return false; ++ ++ for (PRUint32 i = 0; i < out.Length(); i++) { ++ nsCOMPtr rstr = ++ do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID); ++ if (!rstr) return false; ++ ++ rstr->SetData(out[i]); ++ result->AppendElement(rstr); ++ } ++ ++ NS_ADDREF(*output = result); ++ return ret; ++} ++ ++bool nsKDEUtils::commandBlockUi(const nsTArray& command, ++ GtkWindow* parent, ++ nsTArray* output) { ++ return self()->internalCommand(command, parent, true, output); ++} ++ ++bool nsKDEUtils::internalCommand(const nsTArray& command, ++ GtkWindow* parent, bool blockUi, ++ nsTArray* output) { ++ if (!startHelper()) return false; ++ feedCommand(command); ++ // do not store the data in 'this' but in extra structure, just in case there ++ // is reentrancy (can there be? the event loop is re-entered) ++ nsKDECommandData data; ++ data.file = replyFile; ++ data.output = output; ++ data.success = false; ++ if (blockUi) { ++ data.loop = g_main_loop_new(NULL, FALSE); ++ GtkWidget* window = gtk_window_new(GTK_WINDOW_TOPLEVEL); ++ if (parent && gtk_window_get_group(parent)) ++ gtk_window_group_add_window(gtk_window_get_group(parent), ++ GTK_WINDOW(window)); ++ gtk_widget_realize(window); ++ gtk_widget_set_sensitive(window, TRUE); ++ gtk_grab_add(window); ++ GIOChannel* channel = g_io_channel_unix_new(fileno(data.file)); ++ g_io_add_watch(channel, ++ static_cast(G_IO_IN | G_IO_ERR | G_IO_HUP), ++ kdeReadFunc, &data); ++ g_io_channel_unref(channel); ++ g_main_loop_run(data.loop); ++ g_main_loop_unref(data.loop); ++ gtk_grab_remove(window); ++ gtk_widget_destroy(window); ++ } else { ++ data.loop = NULL; ++ while (kdeReadFunc(NULL, static_cast(0), &data)) ++ ; ++ } ++ return data.success; ++} ++ ++bool nsKDEUtils::startHelper() { ++ if (helperRunning) return true; ++ if (helperFailed) return false; ++ helperFailed = true; ++ int fdcommand[2]; ++ int fdreply[2]; ++ if (pipe(fdcommand) < 0) return false; ++ if (pipe(fdreply) < 0) { ++ close(fdcommand[0]); ++ close(fdcommand[1]); ++ return false; ++ } ++ char* args[2] = {const_cast(KMOZILLAHELPER), NULL}; ++ switch (fork()) { ++ case -1: { ++ close(fdcommand[0]); ++ close(fdcommand[1]); ++ close(fdreply[0]); ++ close(fdreply[1]); ++ return false; ++ } ++ case 0: // child ++ { ++ if (dup2(fdcommand[0], STDIN_FILENO) < 0) _exit(1); ++ if (dup2(fdreply[1], STDOUT_FILENO) < 0) _exit(1); ++ int maxfd = 1024; // close all other fds ++ struct rlimit rl; ++ if (getrlimit(RLIMIT_NOFILE, &rl) == 0) maxfd = rl.rlim_max; ++ for (int i = 3; i < maxfd; ++i) close(i); ++#ifdef DEBUG_KDE ++ execvp(KMOZILLAHELPER, args); ++#else ++ execv(KMOZILLAHELPER, args); ++#endif ++ _exit(1); // failed ++ } ++ default: // parent ++ { ++ commandFile = fdopen(fdcommand[1], "w"); ++ replyFile = fdopen(fdreply[0], "r"); ++ close(fdcommand[0]); ++ close(fdreply[1]); ++ if (commandFile == NULL || replyFile == NULL) { ++ closeHelper(); ++ return false; ++ } ++ // ok, helper ready, getKdeRunning() will check if it works ++ } ++ } ++ helperFailed = false; ++ helperRunning = true; ++ return true; ++} ++ ++void nsKDEUtils::closeHelper() { ++ if (commandFile != NULL) ++ fclose(commandFile); // this will also make the helper quit ++ if (replyFile != NULL) fclose(replyFile); ++ helperRunning = false; ++} ++ ++void nsKDEUtils::feedCommand(const nsTArray& command) { ++ for (int i = 0; i < command.Length(); ++i) { ++ nsCString line = command[i]; ++ line.ReplaceSubstring("\\", ++ "\\" ++ "\\"); // \ -> \\ , i.e. escape ++ line.ReplaceSubstring("\n", "\\n"); ++#ifdef DEBUG_KDE ++ fprintf(stderr, "COMM: %s\n", line.get()); ++#endif ++ fputs(line.get(), commandFile); ++ fputs("\n", commandFile); ++ } ++ fputs("\\E\n", ++ commandFile); // done as \E, so it cannot happen in normal data ++ fflush(commandFile); ++} +diff -up firefox-119.0/toolkit/xre/nsKDEUtils.h.integration firefox-119.0/toolkit/xre/nsKDEUtils.h +--- firefox-119.0/toolkit/xre/nsKDEUtils.h.integration 2023-10-31 08:59:03.721124836 +0100 ++++ firefox-119.0/toolkit/xre/nsKDEUtils.h 2023-10-31 08:59:03.721124836 +0100 +@@ -0,0 +1,53 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#ifndef nsKDEUtils_h__ ++#define nsKDEUtils_h__ ++ ++#include "nsString.h" ++#include "nsTArray.h" ++#include ++ ++typedef struct _GtkWindow GtkWindow; ++ ++class nsIArray; ++ ++class NS_EXPORT nsKDEUtils { ++ public: ++ /* Returns true if running inside a KDE session (regardless of whether there ++ is KDE support available for Firefox). This should be used e.g. when ++ determining dialog button order but not for code that requires the KDE ++ support. */ ++ static bool kdeSession(); ++ /* Returns true if running inside a KDE session and KDE support is available ++ for Firefox. This should be used everywhere where the external helper is ++ needed. */ ++ static bool kdeSupport(); ++ /* Executes the given helper command, returns true if helper returned success. ++ */ ++ static bool command(const nsTArray& command, ++ nsTArray* output = NULL); ++ static bool command(nsIArray* command, nsIArray** output = NULL); ++ /* Like command(), but additionally blocks the parent widget like if there was ++ a modal dialog shown and enters the event loop (i.e. there are still paint ++ updates, this is for commands that take long). */ ++ static bool commandBlockUi(const nsTArray& command, ++ GtkWindow* parent, ++ nsTArray* output = NULL); ++ ++ private: ++ nsKDEUtils(); ++ ~nsKDEUtils(); ++ static nsKDEUtils* self(); ++ bool startHelper(); ++ void closeHelper(); ++ void feedCommand(const nsTArray& command); ++ bool internalCommand(const nsTArray& command, GtkWindow* parent, ++ bool isParent, nsTArray* output); ++ FILE* commandFile; ++ FILE* replyFile; ++}; ++ ++#endif // nsKDEUtils +diff -up firefox-119.0/uriloader/exthandler/HandlerServiceParent.cpp.integration firefox-119.0/uriloader/exthandler/HandlerServiceParent.cpp +--- firefox-119.0/uriloader/exthandler/HandlerServiceParent.cpp.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/uriloader/exthandler/HandlerServiceParent.cpp 2023-10-31 08:59:03.721124836 +0100 +@@ -18,7 +18,7 @@ + #include "nsComponentManagerUtils.h" + #include "nsServiceManagerUtils.h" + #ifdef MOZ_WIDGET_GTK +-# include "unix/nsGNOMERegistry.h" ++# include "unix/nsCommonRegistry.h" + #endif + + using mozilla::dom::ContentHandlerService; +@@ -310,8 +310,8 @@ mozilla::ipc::IPCResult HandlerServicePa + } + #ifdef MOZ_WIDGET_GTK + // Check the GNOME registry for a protocol handler +- *aHandlerExists = +- nsGNOMERegistry::HandlerExists(PromiseFlatCString(aProtocolScheme).get()); ++ *aHandlerExists = nsCommonRegistry::HandlerExists( ++ PromiseFlatCString(aProtocolScheme).get()); + #else + *aHandlerExists = false; + #endif +diff -up firefox-119.0/uriloader/exthandler/moz.build.integration firefox-119.0/uriloader/exthandler/moz.build +--- firefox-119.0/uriloader/exthandler/moz.build.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/uriloader/exthandler/moz.build 2023-10-31 08:59:03.721124836 +0100 +@@ -86,7 +86,9 @@ else: + + if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": + UNIFIED_SOURCES += [ ++ "unix/nsCommonRegistry.cpp", + "unix/nsGNOMERegistry.cpp", ++ "unix/nsKDERegistry.cpp", + "unix/nsMIMEInfoUnix.cpp", + ] + elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android": +@@ -134,6 +136,7 @@ LOCAL_INCLUDES += [ + "/dom/ipc", + "/netwerk/base", + "/netwerk/protocol/http", ++ "/toolkit/xre", + ] + + if CONFIG["MOZ_ENABLE_DBUS"]: +diff -up firefox-119.0/uriloader/exthandler/unix/nsCommonRegistry.cpp.integration firefox-119.0/uriloader/exthandler/unix/nsCommonRegistry.cpp +--- firefox-119.0/uriloader/exthandler/unix/nsCommonRegistry.cpp.integration 2023-10-31 08:59:03.721124836 +0100 ++++ firefox-119.0/uriloader/exthandler/unix/nsCommonRegistry.cpp 2023-10-31 08:59:03.721124836 +0100 +@@ -0,0 +1,42 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#include "nsCommonRegistry.h" ++ ++#include "nsGNOMERegistry.h" ++#include "nsKDERegistry.h" ++#include "nsString.h" ++#include "nsKDEUtils.h" ++ ++/* static */ bool nsCommonRegistry::HandlerExists(const char* aProtocolScheme) { ++ if (nsKDEUtils::kdeSupport()) ++ return nsKDERegistry::HandlerExists(aProtocolScheme); ++ return nsGNOMERegistry::HandlerExists(aProtocolScheme); ++} ++ ++/* static */ nsresult nsCommonRegistry::LoadURL(nsIURI* aURL) { ++ if (nsKDEUtils::kdeSupport()) return nsKDERegistry::LoadURL(aURL); ++ return nsGNOMERegistry::LoadURL(aURL); ++} ++ ++/* static */ void nsCommonRegistry::GetAppDescForScheme( ++ const nsACString& aScheme, nsAString& aDesc) { ++ if (nsKDEUtils::kdeSupport()) ++ return nsKDERegistry::GetAppDescForScheme(aScheme, aDesc); ++ return nsGNOMERegistry::GetAppDescForScheme(aScheme, aDesc); ++} ++ ++/* static */ already_AddRefed ++nsCommonRegistry::GetFromExtension(const nsACString& aFileExt) { ++ if (nsKDEUtils::kdeSupport()) ++ return nsKDERegistry::GetFromExtension(aFileExt); ++ return nsGNOMERegistry::GetFromExtension(aFileExt); ++} ++ ++/* static */ already_AddRefed nsCommonRegistry::GetFromType( ++ const nsACString& aMIMEType) { ++ if (nsKDEUtils::kdeSupport()) return nsKDERegistry::GetFromType(aMIMEType); ++ return nsGNOMERegistry::GetFromType(aMIMEType); ++} +diff -up firefox-119.0/uriloader/exthandler/unix/nsCommonRegistry.h.integration firefox-119.0/uriloader/exthandler/unix/nsCommonRegistry.h +--- firefox-119.0/uriloader/exthandler/unix/nsCommonRegistry.h.integration 2023-10-31 08:59:03.721124836 +0100 ++++ firefox-119.0/uriloader/exthandler/unix/nsCommonRegistry.h 2023-10-31 08:59:03.721124836 +0100 +@@ -0,0 +1,28 @@ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#ifndef nsCommonRegistry_h__ ++#define nsCommonRegistry_h__ ++ ++#include "nsIURI.h" ++#include "nsCOMPtr.h" ++ ++class nsMIMEInfoBase; ++ ++class nsCommonRegistry { ++ public: ++ static bool HandlerExists(const char* aProtocolScheme); ++ ++ static nsresult LoadURL(nsIURI* aURL); ++ ++ static void GetAppDescForScheme(const nsACString& aScheme, nsAString& aDesc); ++ ++ static already_AddRefed GetFromExtension( ++ const nsACString& aFileExt); ++ ++ static already_AddRefed GetFromType( ++ const nsACString& aMIMEType); ++}; ++ ++#endif +diff -up firefox-119.0/uriloader/exthandler/unix/nsKDERegistry.cpp.integration firefox-119.0/uriloader/exthandler/unix/nsKDERegistry.cpp +--- firefox-119.0/uriloader/exthandler/unix/nsKDERegistry.cpp.integration 2023-10-31 08:59:03.722124870 +0100 ++++ firefox-119.0/uriloader/exthandler/unix/nsKDERegistry.cpp 2023-10-31 08:59:03.722124870 +0100 +@@ -0,0 +1,75 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#include "mozilla/StaticPrefs_browser.h" ++#include "nsKDERegistry.h" ++#include "prlink.h" ++#include "prmem.h" ++#include "nsString.h" ++#include "nsMIMEInfoUnix.h" ++#include "nsKDEUtils.h" ++ ++/* static */ bool nsKDERegistry::HandlerExists(const char* aProtocolScheme) { ++ nsTArray command; ++ command.AppendElement("HANDLEREXISTS"_ns); ++ command.AppendElement(nsAutoCString(aProtocolScheme)); ++ return nsKDEUtils::command(command); ++} ++ ++/* static */ nsresult nsKDERegistry::LoadURL(nsIURI* aURL) { ++ nsTArray command; ++ command.AppendElement("OPEN"_ns); ++ nsCString url; ++ aURL->GetSpec(url); ++ command.AppendElement(url); ++ bool rv = nsKDEUtils::command(command); ++ if (!rv) return NS_ERROR_FAILURE; ++ ++ return NS_OK; ++} ++ ++/* static */ void nsKDERegistry::GetAppDescForScheme(const nsACString& aScheme, ++ nsAString& aDesc) { ++ nsTArray command; ++ command.AppendElement("GETAPPDESCFORSCHEME"_ns); ++ command.AppendElement(aScheme); ++ nsTArray output; ++ if (nsKDEUtils::command(command, &output) && output.Length() == 1) ++ CopyUTF8toUTF16(output[0], aDesc); ++} ++ ++/* static */ already_AddRefed nsKDERegistry::GetFromExtension( ++ const nsACString& aFileExt) { ++ NS_ASSERTION(aFileExt[0] != '.', "aFileExt shouldn't start with a dot"); ++ nsTArray command; ++ command.AppendElement("GETFROMEXTENSION"_ns); ++ command.AppendElement(aFileExt); ++ return GetFromHelper(command); ++} ++ ++/* static */ already_AddRefed nsKDERegistry::GetFromType( ++ const nsACString& aMIMEType) { ++ nsTArray command; ++ command.AppendElement("GETFROMTYPE"_ns); ++ command.AppendElement(aMIMEType); ++ return GetFromHelper(command); ++} ++ ++/* static */ already_AddRefed nsKDERegistry::GetFromHelper( ++ const nsTArray& command) { ++ nsTArray output; ++ if (nsKDEUtils::command(command, &output) && output.Length() == 3) { ++ nsCString mimetype = output[0]; ++ RefPtr mimeInfo = new nsMIMEInfoUnix(mimetype); ++ NS_ENSURE_TRUE(mimeInfo, nullptr); ++ nsCString description = output[1]; ++ mimeInfo->SetDescription(NS_ConvertUTF8toUTF16(description)); ++ nsCString handlerAppName = output[2]; ++ mimeInfo->SetPreferredAction(nsIMIMEInfo::saveToDisk); ++ mimeInfo->SetDefaultDescription(NS_ConvertUTF8toUTF16(handlerAppName)); ++ return mimeInfo.forget(); ++ } ++ return nullptr; ++} +diff -up firefox-119.0/uriloader/exthandler/unix/nsKDERegistry.h.integration firefox-119.0/uriloader/exthandler/unix/nsKDERegistry.h +--- firefox-119.0/uriloader/exthandler/unix/nsKDERegistry.h.integration 2023-10-31 08:59:03.722124870 +0100 ++++ firefox-119.0/uriloader/exthandler/unix/nsKDERegistry.h 2023-10-31 08:59:03.722124870 +0100 +@@ -0,0 +1,35 @@ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#ifndef nsKDERegistry_h__ ++#define nsKDERegistry_h__ ++ ++#include "nsIURI.h" ++#include "nsCOMPtr.h" ++#include "nsTArray.h" ++ ++class nsMIMEInfoBase; ++// class nsAutoCString; ++// class nsCString; ++ ++class nsKDERegistry { ++ public: ++ static bool HandlerExists(const char* aProtocolScheme); ++ ++ static nsresult LoadURL(nsIURI* aURL); ++ ++ static void GetAppDescForScheme(const nsACString& aScheme, nsAString& aDesc); ++ ++ static already_AddRefed GetFromExtension( ++ const nsACString& aFileExt); ++ ++ static already_AddRefed GetFromType( ++ const nsACString& aMIMEType); ++ ++ private: ++ static already_AddRefed GetFromHelper( ++ const nsTArray& command); ++}; ++ ++#endif // nsKDERegistry_h__ +diff -up firefox-119.0/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp.integration firefox-119.0/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp +--- firefox-119.0/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp 2023-10-31 08:59:03.722124870 +0100 +@@ -5,16 +5,19 @@ + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + #include "nsMIMEInfoUnix.h" +-#include "nsGNOMERegistry.h" ++#include "nsCommonRegistry.h" + #include "nsIGIOService.h" + #include "nsNetCID.h" + #include "nsIIOService.h" + #ifdef MOZ_ENABLE_DBUS + # include "nsDBusHandlerApp.h" + #endif ++#if defined(XP_UNIX) && !defined(XP_MACOSX) ++# include "nsKDEUtils.h" ++#endif + + nsresult nsMIMEInfoUnix::LoadUriInternal(nsIURI* aURI) { +- return nsGNOMERegistry::LoadURL(aURI); ++ return nsCommonRegistry::LoadURL(aURI); + } + + NS_IMETHODIMP +@@ -29,15 +32,15 @@ nsMIMEInfoUnix::GetHasDefaultHandler(boo + *_retval = false; + + if (mClass == eProtocolInfo) { +- *_retval = nsGNOMERegistry::HandlerExists(mSchemeOrType.get()); ++ *_retval = nsCommonRegistry::HandlerExists(mSchemeOrType.get()); + } else { + RefPtr mimeInfo = +- nsGNOMERegistry::GetFromType(mSchemeOrType); ++ nsCommonRegistry::GetFromType(mSchemeOrType); + if (!mimeInfo) { + nsAutoCString ext; + nsresult rv = GetPrimaryExtension(ext); + if (NS_SUCCEEDED(rv)) { +- mimeInfo = nsGNOMERegistry::GetFromExtension(ext); ++ mimeInfo = nsCommonRegistry::GetFromExtension(ext); + } + } + if (mimeInfo) *_retval = true; +@@ -59,6 +62,21 @@ nsresult nsMIMEInfoUnix::LaunchDefaultWi + nsAutoCString nativePath; + aFile->GetNativePath(nativePath); + ++ if (nsKDEUtils::kdeSupport()) { ++ bool supports; ++ if (NS_SUCCEEDED(GetHasDefaultHandler(&supports)) && supports) { ++ nsTArray command; ++ command.AppendElement("OPEN"_ns); ++ command.AppendElement(nativePath); ++ command.AppendElement("MIMETYPE"_ns); ++ command.AppendElement(mSchemeOrType); ++ if (nsKDEUtils::command(command)) return NS_OK; ++ } ++ if (!GetDefaultApplication()) return NS_ERROR_FILE_NOT_FOUND; ++ ++ return LaunchWithIProcess(GetDefaultApplication(), nativePath); ++ } ++ + nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); + if (!giovfs) { + return NS_ERROR_FAILURE; +diff -up firefox-119.0/uriloader/exthandler/unix/nsOSHelperAppService.cpp.integration firefox-119.0/uriloader/exthandler/unix/nsOSHelperAppService.cpp +--- firefox-119.0/uriloader/exthandler/unix/nsOSHelperAppService.cpp.integration 2023-10-19 21:54:42.000000000 +0200 ++++ firefox-119.0/uriloader/exthandler/unix/nsOSHelperAppService.cpp 2023-10-31 08:59:03.722124870 +0100 +@@ -10,7 +10,7 @@ + #include "nsOSHelperAppService.h" + #include "nsMIMEInfoUnix.h" + #ifdef MOZ_WIDGET_GTK +-# include "nsGNOMERegistry.h" ++# include "nsCommonRegistry.h" + # ifdef MOZ_BUILD_APP_IS_BROWSER + # include "nsIToolkitShellService.h" + # include "nsIGNOMEShellService.h" +@@ -1106,7 +1106,7 @@ nsresult nsOSHelperAppService::OSProtoco + if (!XRE_IsContentProcess()) { + #ifdef MOZ_WIDGET_GTK + // Check the GNOME registry for a protocol handler +- *aHandlerExists = nsGNOMERegistry::HandlerExists(aProtocolScheme); ++ *aHandlerExists = nsCommonRegistry::HandlerExists(aProtocolScheme); + #else + *aHandlerExists = false; + #endif +@@ -1126,7 +1126,7 @@ nsresult nsOSHelperAppService::OSProtoco + NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription( + const nsACString& aScheme, nsAString& _retval) { + #ifdef MOZ_WIDGET_GTK +- nsGNOMERegistry::GetAppDescForScheme(aScheme, _retval); ++ nsCommonRegistry::GetAppDescForScheme(aScheme, _retval); + return _retval.IsEmpty() ? NS_ERROR_NOT_AVAILABLE : NS_OK; + #else + return NS_ERROR_NOT_AVAILABLE; +@@ -1231,7 +1231,7 @@ already_AddRefed nsOSHel + #ifdef MOZ_WIDGET_GTK + LOG("Looking in GNOME registry\n"); + RefPtr gnomeInfo = +- nsGNOMERegistry::GetFromExtension(aFileExt); ++ nsCommonRegistry::GetFromExtension(aFileExt); + if (gnomeInfo) { + LOG("Got MIMEInfo from GNOME registry\n"); + return gnomeInfo.forget(); +@@ -1344,7 +1344,7 @@ already_AddRefed nsOSHel + + #ifdef MOZ_WIDGET_GTK + if (handler.IsEmpty()) { +- RefPtr gnomeInfo = nsGNOMERegistry::GetFromType(aMIMEType); ++ RefPtr gnomeInfo = nsCommonRegistry::GetFromType(aMIMEType); + if (gnomeInfo) { + LOG("Got MIMEInfo from GNOME registry without extensions; setting them " + "to %s\n", +diff -up firefox-119.0/widget/gtk/moz.build.integration firefox-119.0/widget/gtk/moz.build +--- firefox-119.0/widget/gtk/moz.build.integration 2023-10-31 08:59:03.704124244 +0100 ++++ firefox-119.0/widget/gtk/moz.build 2023-10-31 08:59:03.723124906 +0100 +@@ -161,6 +161,7 @@ LOCAL_INCLUDES += [ + "/layout/xul", + "/other-licenses/atk-1.0", + "/third_party/cups/include", ++ "/toolkit/xre", + "/widget", + "/widget/headless", + "/widget/x11", +diff -up firefox-119.0/widget/gtk/nsFilePicker.cpp.integration firefox-119.0/widget/gtk/nsFilePicker.cpp +--- firefox-119.0/widget/gtk/nsFilePicker.cpp.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/widget/gtk/nsFilePicker.cpp 2023-10-31 08:59:03.723124906 +0100 +@@ -5,6 +5,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -30,6 +31,8 @@ + #include "WidgetUtilsGtk.h" + + #include "nsFilePicker.h" ++#include "nsKDEUtils.h" ++#include "nsURLHelper.h" + + #undef LOG + #ifdef MOZ_LOGGING +@@ -310,7 +313,8 @@ NS_IMETHODIMP + nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter) { + if (aFilter.EqualsLiteral("..apps")) { + // No platform specific thing we can do here, really.... +- return NS_OK; ++ // Unless it's KDE. ++ if (mMode != modeOpen || !nsKDEUtils::kdeSupport()) return NS_OK; + } + + nsAutoCString filter, name; +@@ -420,6 +424,31 @@ nsFilePicker::Open(nsIFilePickerShownCal + // Can't show two dialogs concurrently with the same filepicker + if (mRunning) return NS_ERROR_NOT_AVAILABLE; + ++ // KDE file picker is not handled via callback ++ if (nsKDEUtils::kdeSupport()) { ++ mCallback = aCallback; ++ mRunning = true; ++ NS_ADDREF_THIS(); ++ g_idle_add( ++ [](gpointer data) -> gboolean { ++ nsFilePicker* queuedPicker = (nsFilePicker*)data; ++ nsIFilePicker::ResultCode result; ++ queuedPicker->kdeFileDialog(&result); ++ if (queuedPicker->mCallback) { ++ queuedPicker->mCallback->Done(result); ++ queuedPicker->mCallback = nullptr; ++ } else { ++ queuedPicker->mResult = result; ++ } ++ queuedPicker->mRunning = false; ++ NS_RELEASE(queuedPicker); ++ return G_SOURCE_REMOVE; ++ }, ++ this); ++ ++ return NS_OK; ++ } ++ + NS_ConvertUTF16toUTF8 title(mTitle); + + GtkWindow* parent_widget = +@@ -701,6 +730,205 @@ void nsFilePicker::Done(void* file_choos + NS_RELEASE_THIS(); + } + ++nsCString nsFilePicker::kdeMakeFilter(int index) { ++ nsCString buf = mFilters[index]; ++ for (PRUint32 i = 0; i < buf.Length(); ++i) ++ if (buf[i] == ';') // KDE separates just using spaces ++ buf.SetCharAt(' ', i); ++ if (!mFilterNames[index].IsEmpty()) { ++ buf += "|"; ++ buf += mFilterNames[index].get(); ++ } ++ return buf; ++} ++ ++static PRInt32 windowToXid(nsIWidget* widget) { ++ GtkWindow* parent_widget = ++ GTK_WINDOW(widget->GetNativeData(NS_NATIVE_SHELLWIDGET)); ++ GdkWindow* gdk_window = ++ gtk_widget_get_window(gtk_widget_get_toplevel(GTK_WIDGET(parent_widget))); ++ return GDK_WINDOW_XID(gdk_window); ++} ++ ++NS_IMETHODIMP nsFilePicker::kdeFileDialog(nsIFilePicker::ResultCode* aReturn) { ++ NS_ENSURE_ARG_POINTER(aReturn); ++ ++ if (mMode == modeOpen && mFilters.Length() == 1 && ++ mFilters[0].EqualsLiteral("..apps")) ++ return kdeAppsDialog(aReturn); ++ ++ nsCString title; ++ title.Adopt(ToNewUTF8String(mTitle)); ++ ++ const char* arg = NULL; ++ if (mAllowURLs) { ++ switch (mMode) { ++ case nsIFilePicker::modeOpen: ++ case nsIFilePicker::modeOpenMultiple: ++ arg = "GETOPENURL"; ++ break; ++ case nsIFilePicker::modeSave: ++ arg = "GETSAVEURL"; ++ break; ++ case nsIFilePicker::modeGetFolder: ++ arg = "GETDIRECTORYURL"; ++ break; ++ } ++ } else { ++ switch (mMode) { ++ case nsIFilePicker::modeOpen: ++ case nsIFilePicker::modeOpenMultiple: ++ arg = "GETOPENFILENAME"; ++ break; ++ case nsIFilePicker::modeSave: ++ arg = "GETSAVEFILENAME"; ++ break; ++ case nsIFilePicker::modeGetFolder: ++ arg = "GETDIRECTORYFILENAME"; ++ break; ++ } ++ } ++ ++ nsAutoCString directory; ++ if (mDisplayDirectory) { ++ mDisplayDirectory->GetNativePath(directory); ++ } else if (mPrevDisplayDirectory) { ++ mPrevDisplayDirectory->GetNativePath(directory); ++ } ++ ++ nsAutoCString startdir; ++ if (!directory.IsEmpty()) { ++ startdir = directory; ++ } ++ if (mMode == nsIFilePicker::modeSave) { ++ if (!startdir.IsEmpty()) { ++ startdir += "/"; ++ startdir += ToNewUTF8String(mDefault); ++ } else ++ startdir = ToNewUTF8String(mDefault); ++ } ++ ++ nsAutoCString filters; ++ PRInt32 count = mFilters.Length(); ++ if (count == 0) // just in case ++ filters = "*"; ++ else { ++ filters = kdeMakeFilter(0); ++ for (PRInt32 i = 1; i < count; ++i) { ++ filters += "\n"; ++ filters += kdeMakeFilter(i); ++ } ++ } ++ ++ nsTArray command; ++ command.AppendElement(nsAutoCString(arg)); ++ command.AppendElement(startdir); ++ if (mMode != nsIFilePicker::modeGetFolder) { ++ command.AppendElement(filters); ++ nsAutoCString selected; ++ selected.AppendInt(mSelectedType); ++ command.AppendElement(selected); ++ } ++ command.AppendElement(title); ++ if (mMode == nsIFilePicker::modeOpenMultiple) ++ command.AppendElement("MULTIPLE"_ns); ++ if (PRInt32 xid = windowToXid(mParentWidget)) { ++ command.AppendElement("PARENT"_ns); ++ nsAutoCString parent; ++ parent.AppendInt(xid); ++ command.AppendElement(parent); ++ } ++ ++ nsTArray output; ++ if (nsKDEUtils::commandBlockUi( ++ command, ++ GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)), ++ &output)) { ++ *aReturn = nsIFilePicker::returnOK; ++ mFiles.Clear(); ++ if (mMode != nsIFilePicker::modeGetFolder) { ++ mSelectedType = atoi(output[0].get()); ++ output.RemoveElementAt(0); ++ } ++ if (mMode == nsIFilePicker::modeOpenMultiple) { ++ mFileURL.Truncate(); ++ PRUint32 count = output.Length(); ++ for (PRUint32 i = 0; i < count; ++i) { ++ nsCOMPtr localfile; ++ nsresult rv = NS_NewNativeLocalFile(output[i], PR_FALSE, ++ getter_AddRefs(localfile)); ++ if (NS_SUCCEEDED(rv)) mFiles.AppendObject(localfile); ++ } ++ } else { ++ if (output.Length() == 0) ++ mFileURL = nsCString(); ++ else if (mAllowURLs) ++ mFileURL = output[0]; ++ else // GetFile() actually requires it to be url even for local files :-/ ++ { ++ nsCOMPtr localfile; ++ nsresult rv = NS_NewNativeLocalFile(output[0], PR_FALSE, ++ getter_AddRefs(localfile)); ++ if (NS_SUCCEEDED(rv)) ++ rv = net_GetURLSpecFromActualFile(localfile, mFileURL); ++ } ++ } ++ // Remember last used directory. ++ nsCOMPtr file; ++ GetFile(getter_AddRefs(file)); ++ if (file) { ++ nsCOMPtr dir; ++ file->GetParent(getter_AddRefs(dir)); ++ nsCOMPtr localDir(dir); ++ if (localDir) { ++ localDir.swap(mPrevDisplayDirectory); ++ } ++ } ++ if (mMode == nsIFilePicker::modeSave) { ++ nsCOMPtr file; ++ GetFile(getter_AddRefs(file)); ++ if (file) { ++ bool exists = false; ++ file->Exists(&exists); ++ if (exists) // TODO do overwrite check in the helper app ++ *aReturn = nsIFilePicker::returnReplace; ++ } ++ } ++ } else { ++ *aReturn = nsIFilePicker::returnCancel; ++ } ++ return NS_OK; ++} ++ ++NS_IMETHODIMP nsFilePicker::kdeAppsDialog(nsIFilePicker::ResultCode* aReturn) { ++ NS_ENSURE_ARG_POINTER(aReturn); ++ ++ nsCString title; ++ title.Adopt(ToNewUTF8String(mTitle)); ++ ++ nsTArray command; ++ command.AppendElement("APPSDIALOG"_ns); ++ command.AppendElement(title); ++ if (PRInt32 xid = windowToXid(mParentWidget)) { ++ command.AppendElement("PARENT"_ns); ++ nsAutoCString parent; ++ parent.AppendInt(xid); ++ command.AppendElement(parent); ++ } ++ ++ nsTArray output; ++ if (nsKDEUtils::commandBlockUi( ++ command, ++ GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)), ++ &output)) { ++ *aReturn = nsIFilePicker::returnOK; ++ mFileURL = output.Length() > 0 ? output[0] : nsCString(); ++ } else { ++ *aReturn = nsIFilePicker::returnCancel; ++ } ++ return NS_OK; ++} ++ + // All below functions available as of GTK 3.20+ + void* nsFilePicker::GtkFileChooserNew(const gchar* title, GtkWindow* parent, + GtkFileChooserAction action, +diff -up firefox-119.0/widget/gtk/nsFilePicker.h.integration firefox-119.0/widget/gtk/nsFilePicker.h +--- firefox-119.0/widget/gtk/nsFilePicker.h.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/widget/gtk/nsFilePicker.h 2023-10-31 08:59:03.723124906 +0100 +@@ -76,6 +76,12 @@ class nsFilePicker : public nsBaseFilePi + private: + static nsIFile* mPrevDisplayDirectory; + ++ bool kdeRunning(); ++ bool getKdeRunning(); ++ NS_IMETHODIMP kdeFileDialog(nsIFilePicker::ResultCode* aReturn); ++ NS_IMETHODIMP kdeAppsDialog(nsIFilePicker::ResultCode* aReturn); ++ nsCString kdeMakeFilter(int index); ++ + void* GtkFileChooserNew(const gchar* title, GtkWindow* parent, + GtkFileChooserAction action, + const gchar* accept_label); +diff -up firefox-119.0/xpcom/components/ManifestParser.cpp.integration firefox-119.0/xpcom/components/ManifestParser.cpp +--- firefox-119.0/xpcom/components/ManifestParser.cpp.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/xpcom/components/ManifestParser.cpp 2023-10-31 08:59:03.723124906 +0100 +@@ -43,6 +43,7 @@ + #include "nsIScriptError.h" + #include "nsIXULAppInfo.h" + #include "nsIXULRuntime.h" ++#include "nsKDEUtils.h" + + using namespace mozilla; + +@@ -394,6 +395,7 @@ void ParseManifest(NSLocationType aType, + constexpr auto kOs = u"os"_ns; + constexpr auto kOsVersion = u"osversion"_ns; + constexpr auto kABI = u"abi"_ns; ++ constexpr auto kDesktop = u"desktop"_ns; + constexpr auto kProcess = u"process"_ns; + #if defined(MOZ_WIDGET_ANDROID) + constexpr auto kTablet = u"tablet"_ns; +@@ -453,6 +455,7 @@ void ParseManifest(NSLocationType aType, + } + + nsAutoString osVersion; ++ nsAutoString desktop; + #if defined(XP_WIN) + # pragma warning(push) + # pragma warning(disable : 4996) // VC12+ deprecates GetVersionEx +@@ -461,14 +464,17 @@ void ParseManifest(NSLocationType aType, + nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", info.dwMajorVersion, + info.dwMinorVersion); + } ++ desktop = u"win"_ns; + # pragma warning(pop) + #elif defined(MOZ_WIDGET_COCOA) + SInt32 majorVersion = nsCocoaFeatures::macOSVersionMajor(); + SInt32 minorVersion = nsCocoaFeatures::macOSVersionMinor(); + nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", majorVersion, minorVersion); ++ desktop = u"macosx"_ns); + #elif defined(MOZ_WIDGET_GTK) + nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", gtk_major_version, + gtk_minor_version); ++ desktop = nsKDEUtils::kdeSession() ? u"kde"_ns : u"gnome"_ns; + #elif defined(MOZ_WIDGET_ANDROID) + bool isTablet = false; + if (jni::IsAvailable()) { +@@ -476,6 +482,7 @@ void ParseManifest(NSLocationType aType, + osVersion.Assign(release->ToString()); + isTablet = java::GeckoAppShell::IsTablet(); + } ++ desktop = u"android"_ns; + #endif + + if (XRE_IsContentProcess()) { +@@ -576,6 +583,7 @@ void ParseManifest(NSLocationType aType, + : eUnspecified; + #endif + int flags = 0; ++ TriState stDesktop = eUnspecified; + + while ((token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) && + ok) { +@@ -585,6 +593,7 @@ void ParseManifest(NSLocationType aType, + if (CheckStringFlag(kApplication, wtoken, appID, stApp) || + CheckOsFlag(kOs, wtoken, osTarget, stOs) || + CheckStringFlag(kABI, wtoken, abi, stABI) || ++ CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || + CheckStringFlag(kProcess, wtoken, process, stProcess) || + CheckVersionFlag(kOsVersion, wtoken, osVersion, stOsVersion) || + CheckVersionFlag(kAppVersion, wtoken, appVersion, stAppVersion) || +@@ -644,6 +653,7 @@ void ParseManifest(NSLocationType aType, + + if (!ok || stApp == eBad || stAppVersion == eBad || + stGeckoVersion == eBad || stOs == eBad || stOsVersion == eBad || ++ stDesktop == eBad || + #ifdef MOZ_WIDGET_ANDROID + stTablet == eBad || + #endif +diff -up firefox-119.0/xpcom/components/moz.build.integration firefox-119.0/xpcom/components/moz.build +--- firefox-119.0/xpcom/components/moz.build.integration 2023-10-19 21:54:44.000000000 +0200 ++++ firefox-119.0/xpcom/components/moz.build 2023-10-31 08:59:03.723124906 +0100 +@@ -71,6 +71,7 @@ LOCAL_INCLUDES += [ + "/js/xpconnect/loader", + "/layout/build", + "/modules/libjar", ++ "/toolkit/xre", + ] + + if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": +diff -up firefox-119.0/xpcom/io/nsLocalFileUnix.cpp.integration firefox-119.0/xpcom/io/nsLocalFileUnix.cpp +--- firefox-119.0/xpcom/io/nsLocalFileUnix.cpp.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/xpcom/io/nsLocalFileUnix.cpp 2023-10-31 08:59:03.724124940 +0100 +@@ -51,6 +51,7 @@ + + #ifdef MOZ_WIDGET_GTK + # include "nsIGIOService.h" ++# include "nsKDEUtils.h" + #endif + + #ifdef MOZ_WIDGET_COCOA +@@ -2172,10 +2173,18 @@ nsLocalFile::Reveal() { + } + + #ifdef MOZ_WIDGET_GTK ++ nsAutoCString url; + nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); +- if (!giovfs) { +- return NS_ERROR_FAILURE; ++ url = mPath; ++ if (nsKDEUtils::kdeSupport()) { ++ nsTArray command; ++ command.AppendElement("REVEAL"_ns); ++ command.AppendElement(mPath); ++ return nsKDEUtils::command(command) ? NS_OK : NS_ERROR_FAILURE; + } ++ ++ if (!giovfs) return NS_ERROR_FAILURE; ++ + return giovfs->RevealFile(this); + #elif defined(MOZ_WIDGET_COCOA) + CFURLRef url; +@@ -2197,6 +2206,13 @@ nsLocalFile::Launch() { + } + + #ifdef MOZ_WIDGET_GTK ++ if (nsKDEUtils::kdeSupport()) { ++ nsTArray command; ++ command.AppendElement("OPEN"_ns); ++ command.AppendElement(mPath); ++ return nsKDEUtils::command(command) ? NS_OK : NS_ERROR_FAILURE; ++ } ++ + nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); + if (!giovfs) { + return NS_ERROR_FAILURE; diff --git a/0026-Add-KDE-integration-to-Firefox.patch b/0026-Add-KDE-integration-to-Firefox.patch new file mode 100644 index 0000000..1e2e938 --- /dev/null +++ b/0026-Add-KDE-integration-to-Firefox.patch @@ -0,0 +1,279 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Sirringhaus +Date: Tue, 8 Aug 2023 16:18:24 +0300 +Subject: [PATCH] Add KDE integration to Firefox + +Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751 +Bug: https://bugzilla.suse.com/show_bug.cgi?id=170055 + +How to apply this patch: + +1. Import and apply it +2. cp browser/base/content/browser.xul browser/base/content/browser-kde.xul +3. Find editBookmarkPanelDoneButton +4. Replace #ifndef with #ifdef in the line above (this hanges the button order from Gnome-style to KDE-style) +5. hg qrefresh +--- + browser/components/preferences/main.js | 18 +++ + browser/components/shell/moz.build | 2 + + .../components/shell/nsKDEShellService.cpp | 109 ++++++++++++++++++ + browser/components/shell/nsKDEShellService.h | 32 +++++ + .../components/shell/nsUnixShellService.cpp | 22 ++++ + browser/components/shell/nsUnixShellService.h | 15 +++ + 6 files changed, 198 insertions(+) + create mode 100644 browser/components/shell/nsKDEShellService.cpp + create mode 100644 browser/components/shell/nsKDEShellService.h + create mode 100644 browser/components/shell/nsUnixShellService.cpp + create mode 100644 browser/components/shell/nsUnixShellService.h + +diff --git a/browser/components/preferences/main.js b/browser/components/preferences/main.js +index 820e46fb006567bfdf93e2a46da5e3c07d42bf10..57d1c21bdecc2d55d0bed30246e684d3b97ad7fa 100644 +--- a/browser/components/preferences/main.js ++++ b/browser/components/preferences/main.js +@@ -294,6 +294,13 @@ var gMainPane = { + }, backoffTimes[this._backoffIndex]); + } + ++ var env = Components.classes["@mozilla.org/process/environment;1"] ++ .getService(Components.interfaces.nsIEnvironment); ++ var kde_session = 0; ++ if (env.get('KDE_FULL_SESSION') == "true") { ++ kde_session = 1; ++ } ++ + this.initBrowserContainers(); + this.buildContentProcessCountMenuList(); + +@@ -1727,6 +1734,17 @@ var gMainPane = { + } + try { + shellSvc.setDefaultBrowser(true, false); ++ if (kde_session == 1) { ++ var shellObj = Components.classes["@mozilla.org/file/local;1"] ++ .createInstance(Components.interfaces.nsILocalFile); ++ shellObj.initWithPath("/usr/bin/kwriteconfig"); ++ var process = Components.classes["@mozilla.org/process/util;1"] ++ .createInstance(Components.interfaces.nsIProcess); ++ process.init(shellObj); ++ var args = ["--file", "kdeglobals", "--group", "General", "--key", ++ "BrowserApplication", "firefox"]; ++ process.run(false, args, args.length); ++ } + } catch (ex) { + console.error(ex); + return; +diff --git a/browser/components/shell/moz.build b/browser/components/shell/moz.build +index eb88cb287dc3f04022b74b978666118bbd5fa6b2..95277533781a7224d108e3c45731a6d9a89ba1a0 100644 +--- a/browser/components/shell/moz.build ++++ b/browser/components/shell/moz.build +@@ -36,6 +36,8 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": + + SOURCES += [ + "nsGNOMEShellService.cpp", ++ "nsKDEShellService.cpp", ++ "nsUnixShellService.cpp", + ] + if CONFIG["MOZ_ENABLE_DBUS"]: + SOURCES += [ +diff --git a/browser/components/shell/nsKDEShellService.cpp b/browser/components/shell/nsKDEShellService.cpp +new file mode 100644 +index 0000000000000000000000000000000000000000..152a3aca87ea73477bc75c4e93c01e5a52dda102 +--- /dev/null ++++ b/browser/components/shell/nsKDEShellService.cpp +@@ -0,0 +1,109 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#include "mozilla/ArrayUtils.h" ++ ++#include "nsCOMPtr.h" ++#include "nsKDEShellService.h" ++#include "nsShellService.h" ++#include "nsKDEUtils.h" ++#include "nsIPrefService.h" ++#include "nsIProcess.h" ++#include "nsIFile.h" ++#include "nsServiceManagerUtils.h" ++#include "nsComponentManagerUtils.h" ++#include "nsIMutableArray.h" ++#include "nsISupportsPrimitives.h" ++#include "nsArrayUtils.h" ++ ++using namespace mozilla; ++ ++nsresult ++nsKDEShellService::Init() ++{ ++ if( !nsKDEUtils::kdeSupport()) ++ return NS_ERROR_NOT_AVAILABLE; ++ return NS_OK; ++} ++ ++NS_IMPL_ISUPPORTS(nsKDEShellService, nsIGNOMEShellService, nsIShellService) ++ ++NS_IMETHODIMP ++nsKDEShellService::IsDefaultBrowser(bool aForAllTypes, ++ bool* aIsDefaultBrowser) ++{ ++ *aIsDefaultBrowser = false; ++ ++ nsCOMPtr command = do_CreateInstance( NS_ARRAY_CONTRACTID ); ++ if (!command) ++ return NS_ERROR_FAILURE; ++ ++ nsCOMPtr str = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID ); ++ if (!str) ++ return NS_ERROR_FAILURE; ++ ++ str->SetData("ISDEFAULTBROWSER"_ns); ++ command->AppendElement( str ); ++ ++ if( nsKDEUtils::command( command )) ++ *aIsDefaultBrowser = true; ++ return NS_OK; ++} ++ ++NS_IMETHODIMP ++nsKDEShellService::SetDefaultBrowser(bool aClaimAllTypes, ++ bool aForAllUsers) ++{ ++ nsCOMPtr command = do_CreateInstance( NS_ARRAY_CONTRACTID ); ++ if (!command) ++ return NS_ERROR_FAILURE; ++ ++ nsCOMPtr cmdstr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID ); ++ nsCOMPtr paramstr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID ); ++ if (!cmdstr || !paramstr) ++ return NS_ERROR_FAILURE; ++ ++ cmdstr->SetData("SETDEFAULTBROWSER"_ns); ++ command->AppendElement( cmdstr ); ++ ++ paramstr->SetData( aClaimAllTypes ? "ALLTYPES"_ns : "NORMAL"_ns ); ++ command->AppendElement( paramstr ); ++ ++ return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE; ++} ++ ++NS_IMETHODIMP ++nsKDEShellService::GetCanSetDesktopBackground(bool* aResult) ++{ ++ *aResult = true; ++ return NS_OK; ++} ++ ++NS_IMETHODIMP ++nsKDEShellService::SetDesktopBackground(dom::Element* aElement, ++ int32_t aPosition, ++ const nsACString& aImageName) ++{ ++ return NS_ERROR_NOT_IMPLEMENTED; ++} ++ ++NS_IMETHODIMP ++nsKDEShellService::GetDesktopBackgroundColor(PRUint32 *aColor) ++{ ++ return NS_ERROR_NOT_IMPLEMENTED; ++} ++ ++NS_IMETHODIMP ++nsKDEShellService::SetDesktopBackgroundColor(PRUint32 aColor) ++{ ++ return NS_ERROR_NOT_IMPLEMENTED; ++} ++ ++NS_IMETHODIMP ++nsKDEShellService::IsDefaultForScheme(nsTSubstring const& aScheme, bool* aIsDefaultBrowser) ++{ ++ return NS_ERROR_NOT_IMPLEMENTED; ++} ++ +diff --git a/browser/components/shell/nsKDEShellService.h b/browser/components/shell/nsKDEShellService.h +new file mode 100644 +index 0000000000000000000000000000000000000000..8b0bb19164352453cfa453dd87c19263160b9ad8 +--- /dev/null ++++ b/browser/components/shell/nsKDEShellService.h +@@ -0,0 +1,32 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#ifndef nskdeshellservice_h____ ++#define nskdeshellservice_h____ ++ ++#include "nsIGNOMEShellService.h" ++#include "nsToolkitShellService.h" ++#include "nsString.h" ++#include "mozilla/Attributes.h" ++ ++class nsKDEShellService final : public nsIGNOMEShellService, ++ public nsToolkitShellService ++{ ++public: ++ nsKDEShellService() : mCheckedThisSession(false) { } ++ ++ NS_DECL_ISUPPORTS ++ NS_DECL_NSISHELLSERVICE ++ NS_DECL_NSIGNOMESHELLSERVICE ++ ++ nsresult Init(); ++ ++private: ++ ~nsKDEShellService() {} ++ ++ bool mCheckedThisSession; ++}; ++ ++#endif // nskdeshellservice_h____ +diff --git a/browser/components/shell/nsUnixShellService.cpp b/browser/components/shell/nsUnixShellService.cpp +new file mode 100644 +index 0000000000000000000000000000000000000000..abf266ebdc52e136f495911da3454e69c770c6db +--- /dev/null ++++ b/browser/components/shell/nsUnixShellService.cpp +@@ -0,0 +1,22 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++ ++#include "nsUnixShellService.h" ++#include "nsGNOMEShellService.h" ++#include "nsKDEShellService.h" ++#include "nsKDEUtils.h" ++#include "mozilla/ModuleUtils.h" ++ ++NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init) ++NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsKDEShellService, Init) ++ ++NS_IMETHODIMP ++nsUnixShellServiceConstructor(REFNSIID aIID, void **aResult) ++{ ++ if( nsKDEUtils::kdeSupport()) ++ return nsKDEShellServiceConstructor( aIID, aResult ); ++ return nsGNOMEShellServiceConstructor( aIID, aResult ); ++} +diff --git a/browser/components/shell/nsUnixShellService.h b/browser/components/shell/nsUnixShellService.h +new file mode 100644 +index 0000000000000000000000000000000000000000..26b5dbac47dd9a8ec1fcb6c93575cca750692735 +--- /dev/null ++++ b/browser/components/shell/nsUnixShellService.h +@@ -0,0 +1,15 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++ ++#ifndef nsunixshellservice_h____ ++#define nsunixshellservice_h____ ++ ++#include "nsIGNOMEShellService.h" ++ ++NS_IMETHODIMP ++nsUnixShellServiceConstructor(nsISupports *aOuter, REFNSIID aIID, void **aResult); ++ ++#endif // nsunixshellservice_h____ diff --git a/firefox.spec b/firefox.spec index b88609e..eec28df 100644 --- a/firefox.spec +++ b/firefox.spec @@ -169,7 +169,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 119.0 -Release: 3%{?pre_tag}%{?dist} +Release: 4%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -241,12 +241,15 @@ Patch228: disable-openh264-download.patch Patch229: firefox-nss-addon-hack.patch Patch230: firefox-enable-vaapi.patch Patch231: fedora-customization.patch +Patch241: 0025-Add-KDE-integration-to-Firefox-toolkit-parts.patch +Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: D167159.diff Patch409: D192061.1698487416.diff +Patch410: mozilla-1762816.patch # PGO/LTO patches Patch600: pgo.patch @@ -532,10 +535,14 @@ This package contains results of tests executed during build. %patch230 -p1 -b .firefox-enable-vaapi %patch231 -p1 -b .fedora-customization +#%patch241 -p1 -b .kde-integration-toolkit +#%patch242 -p1 -b .kde-integration + %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 %patch408 -p1 -b .D167159 %patch409 -p1 -b .D192061 +%patch410 -p1 -b .mozilla-1762816 # PGO patches %if %{build_with_pgo} @@ -1144,6 +1151,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Nov 06 2023 Martin Stransky - 119.0-3 +- Added fix for mzbz#1762816 + * Mon Oct 30 2023 Jan Horak - 119.0-3 - Enable mozilla crash reporter diff --git a/mozilla-1762816.patch b/mozilla-1762816.patch new file mode 100644 index 0000000..8d302df --- /dev/null +++ b/mozilla-1762816.patch @@ -0,0 +1,121 @@ +changeset: 688555:933a3df01cfa +tag: tip +parent: 688549:db8c28afe588 +user: stransky +date: Tue Oct 31 15:27:05 2023 +0100 +files: widget/gtk/nsLookAndFeel.cpp widget/gtk/nsLookAndFeel.h +description: +Bug 1762816 [Linux] Watch org.freedesktop.portal.Desktop DBus name and get session data only if it's running r?emilio + +Don't autostart org.freedesktop.portal.Desktop by g_dbus_proxy_new_for_bus_sync(), that may block Firefox start for 30~ seconds after desktop start. +Use g_bus_watch_name() and get session data only if org.freedesktop.portal.Desktop is available. + +Differential Revision: https://phabricator.services.mozilla.com/D192335 + + +diff --git a/widget/gtk/nsLookAndFeel.cpp b/widget/gtk/nsLookAndFeel.cpp +--- a/widget/gtk/nsLookAndFeel.cpp ++++ b/widget/gtk/nsLookAndFeel.cpp +@@ -134,6 +134,35 @@ static void settings_changed_signal_cb(G + } + } + ++void nsLookAndFeel::WatchDBus() { ++ GUniquePtr error; ++ mDBusSettingsProxy = dont_AddRef(g_dbus_proxy_new_for_bus_sync( ++ G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, nullptr, ++ "org.freedesktop.portal.Desktop", "/org/freedesktop/portal/desktop", ++ "org.freedesktop.portal.Settings", nullptr, getter_Transfers(error))); ++ if (mDBusSettingsProxy) { ++ g_signal_connect(mDBusSettingsProxy, "g-signal", ++ G_CALLBACK(settings_changed_signal_cb), this); ++ } else { ++ LOGLNF("Can't create DBus proxy for settings: %s\n", error->message); ++ return; ++ } ++ ++ // DBus interface was started after L&F init so we need to load ++ // our settings from DBus explicitly. ++ if (!sIgnoreChangedSettings) { ++ OnColorSchemeSettingChanged(); ++ } ++} ++ ++void nsLookAndFeel::UnwatchDBus() { ++ if (mDBusSettingsProxy) { ++ g_signal_handlers_disconnect_by_func( ++ mDBusSettingsProxy, FuncToGpointer(settings_changed_signal_cb), this); ++ mDBusSettingsProxy = nullptr; ++ } ++} ++ + nsLookAndFeel::nsLookAndFeel() { + static constexpr nsLiteralCString kObservedSettings[] = { + // Affects system font sizes. +@@ -172,27 +201,29 @@ nsLookAndFeel::nsLookAndFeel() { + nsWindow::GetSystemGtkWindowDecoration() != nsWindow::GTK_DECORATION_NONE; + + if (ShouldUsePortal(PortalKind::Settings)) { +- GUniquePtr error; +- mDBusSettingsProxy = dont_AddRef(g_dbus_proxy_new_for_bus_sync( +- G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, nullptr, +- "org.freedesktop.portal.Desktop", "/org/freedesktop/portal/desktop", +- "org.freedesktop.portal.Settings", nullptr, getter_Transfers(error))); +- if (mDBusSettingsProxy) { +- g_signal_connect(mDBusSettingsProxy, "g-signal", +- G_CALLBACK(settings_changed_signal_cb), this); +- } else { +- LOGLNF("Can't create DBus proxy for settings: %s\n", error->message); +- } ++ mDBusID = g_bus_watch_name( ++ G_BUS_TYPE_SESSION, "org.freedesktop.portal.Desktop", ++ G_BUS_NAME_WATCHER_FLAGS_AUTO_START, ++ [](GDBusConnection*, const gchar*, const gchar*, ++ gpointer data) -> void { ++ auto* lnf = static_cast(data); ++ lnf->WatchDBus(); ++ }, ++ [](GDBusConnection*, const gchar*, gpointer data) -> void { ++ auto* lnf = static_cast(data); ++ lnf->UnwatchDBus(); ++ }, ++ this, nullptr); + } + } + + nsLookAndFeel::~nsLookAndFeel() { + ClearRoundedCornerProvider(); +- if (mDBusSettingsProxy) { +- g_signal_handlers_disconnect_by_func( +- mDBusSettingsProxy, FuncToGpointer(settings_changed_signal_cb), this); +- mDBusSettingsProxy = nullptr; ++ if (mDBusID) { ++ g_bus_unwatch_name(mDBusID); ++ mDBusID = 0; + } ++ UnwatchDBus(); + g_signal_handlers_disconnect_by_func( + gtk_settings_get_default(), FuncToGpointer(settings_changed_cb), nullptr); + } +diff --git a/widget/gtk/nsLookAndFeel.h b/widget/gtk/nsLookAndFeel.h +--- a/widget/gtk/nsLookAndFeel.h ++++ b/widget/gtk/nsLookAndFeel.h +@@ -53,6 +53,9 @@ class nsLookAndFeel final : public nsXPL + static bool ShouldHonorThemeScrollbarColors(); + mozilla::Maybe ComputeColorSchemeSetting(); + ++ void WatchDBus(); ++ void UnwatchDBus(); ++ + enum class ThemeFamily : uint8_t { + // Adwaita, the default GTK theme. + Adwaita, +@@ -160,6 +163,7 @@ class nsLookAndFeel final : public nsXPL + return mSystemThemeOverridden ? mAltTheme : mSystemTheme; + } + ++ uint32_t mDBusID = 0; + RefPtr mDBusSettingsProxy; + mozilla::Maybe mColorSchemePreference; + int32_t mCaretBlinkTime = 0; + From 5364193d8d26ebe4e333a4e2a36a5483edff6ea1 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 7 Nov 2023 13:07:16 +0100 Subject: [PATCH 273/545] Added fix for rhbz#2247665 --- ...1698487416.diff => D192061.1699444912.diff | 84 ++++---- D192208.1699444906.diff | 201 ++++++++++++++++++ firefox.spec | 15 +- 3 files changed, 256 insertions(+), 44 deletions(-) rename D192061.1698487416.diff => D192061.1699444912.diff (54%) create mode 100644 D192208.1699444906.diff diff --git a/D192061.1698487416.diff b/D192061.1699444912.diff similarity index 54% rename from D192061.1698487416.diff rename to D192061.1699444912.diff index b7a06b4..a7c4e85 100644 --- a/D192061.1698487416.diff +++ b/D192061.1699444912.diff @@ -1,7 +1,7 @@ diff --git a/widget/gtk/nsUserIdleServiceGTK.cpp b/widget/gtk/nsUserIdleServiceGTK.cpp --- a/widget/gtk/nsUserIdleServiceGTK.cpp +++ b/widget/gtk/nsUserIdleServiceGTK.cpp -@@ -149,48 +149,56 @@ +@@ -149,48 +149,62 @@ #ifdef MOZ_ENABLE_DBUS class UserIdleServiceMutter : public UserIdleServiceImpl { @@ -32,7 +32,48 @@ diff --git a/widget/gtk/nsUserIdleServiceGTK.cpp b/widget/gtk/nsUserIdleServiceG - ("UserIdleServiceMutter::PollIdleTime() Unexpected params type: %s\n", - g_variant_get_type_string(result))); - return false; -- } ++ ++ if (!mPollInProgress) { ++ mPollInProgress = true; ++ DBusProxyCall(mProxy, "GetIdletime", nullptr, G_DBUS_CALL_FLAGS_NONE, -1, ++ mCancellable) ++ ->Then( ++ GetCurrentSerialEventTarget(), __func__, ++ // It's safe to capture this as we use mCancellable to stop ++ // listening. ++ [self = RefPtr{this}, this](RefPtr&& aResult) { ++ if (!g_variant_is_of_type(aResult, G_VARIANT_TYPE_TUPLE) || ++ g_variant_n_children(aResult) != 1) { ++ MOZ_LOG(sIdleLog, LogLevel::Info, ++ ("PollIdleTime() Unexpected params type: %s\n", ++ g_variant_get_type_string(aResult))); ++ mLastIdleTime = 0; ++ return; ++ } ++ RefPtr iTime = ++ dont_AddRef(g_variant_get_child_value(aResult, 0)); ++ if (!g_variant_is_of_type(iTime, G_VARIANT_TYPE_UINT64)) { ++ MOZ_LOG(sIdleLog, LogLevel::Info, ++ ("PollIdleTime() Unexpected params type: %s\n", ++ g_variant_get_type_string(aResult))); ++ mLastIdleTime = 0; ++ return; ++ } ++ uint64_t idleTime = g_variant_get_uint64(iTime); ++ if (idleTime > std::numeric_limits::max()) { ++ idleTime = std::numeric_limits::max(); ++ } ++ mLastIdleTime = idleTime; ++ mPollInProgress = false; ++ MOZ_LOG(sIdleLog, LogLevel::Info, ++ ("Async handler got %d\n", mLastIdleTime)); ++ }, ++ [self = RefPtr{this}, this](GUniquePtr&& aError) { ++ mPollInProgress = false; ++ g_warning("Failed to call GetIdletime(): %s\n", ++ aError->message); ++ }); + } - RefPtr iTime = dont_AddRef(g_variant_get_child_value(result, 0)); - if (!g_variant_is_of_type(iTime, G_VARIANT_TYPE_UINT64)) { - MOZ_LOG( @@ -47,42 +88,6 @@ diff --git a/widget/gtk/nsUserIdleServiceGTK.cpp b/widget/gtk/nsUserIdleServiceG - } - *aIdleTime = idleTime; + -+ DBusProxyCall(mProxy, "GetIdletime", nullptr, G_DBUS_CALL_FLAGS_NONE, -1, -+ mCancellable) -+ ->Then( -+ GetCurrentSerialEventTarget(), __func__, -+ // It's safe to capture this as we use mCancellable to stop -+ // listening. -+ [this](RefPtr&& aResult) { -+ if (!g_variant_is_of_type(aResult, G_VARIANT_TYPE_TUPLE) || -+ g_variant_n_children(aResult) != 1) { -+ MOZ_LOG(sIdleLog, LogLevel::Info, -+ ("PollIdleTime() Unexpected params type: %s\n", -+ g_variant_get_type_string(aResult))); -+ mLastIdleTime = 0; -+ return; -+ } -+ RefPtr iTime = -+ dont_AddRef(g_variant_get_child_value(aResult, 0)); -+ if (!g_variant_is_of_type(iTime, G_VARIANT_TYPE_UINT64)) { -+ MOZ_LOG(sIdleLog, LogLevel::Info, -+ ("PollIdleTime() Unexpected params type: %s\n", -+ g_variant_get_type_string(aResult))); -+ mLastIdleTime = 0; -+ return; -+ } -+ uint64_t idleTime = g_variant_get_uint64(iTime); -+ if (idleTime > std::numeric_limits::max()) { -+ idleTime = std::numeric_limits::max(); -+ } -+ mLastIdleTime = idleTime; -+ MOZ_LOG(sIdleLog, LogLevel::Info, -+ ("Async handler got %d\n", mLastIdleTime)); -+ }, -+ [](GUniquePtr&& aError) { -+ g_warning("Failed to call GetIdletime(): %s\n", aError->message); -+ }); -+ + *aIdleTime = mLastIdleTime; MOZ_LOG(sIdleLog, LogLevel::Info, - ("UserIdleServiceMutter::PollIdleTime() %d\n", *aIdleTime)); @@ -92,13 +97,14 @@ diff --git a/widget/gtk/nsUserIdleServiceGTK.cpp b/widget/gtk/nsUserIdleServiceG bool ProbeImplementation( RefPtr aUserIdleServiceGTK) override { -@@ -229,10 +237,11 @@ +@@ -229,10 +243,12 @@ } private: RefPtr mProxy; RefPtr mCancellable; + uint32_t mLastIdleTime = 0; ++ bool mPollInProgress = false; }; #endif diff --git a/D192208.1699444906.diff b/D192208.1699444906.diff new file mode 100644 index 0000000..f77a357 --- /dev/null +++ b/D192208.1699444906.diff @@ -0,0 +1,201 @@ +diff --git a/widget/gtk/nsUserIdleServiceGTK.h b/widget/gtk/nsUserIdleServiceGTK.h +--- a/widget/gtk/nsUserIdleServiceGTK.h ++++ b/widget/gtk/nsUserIdleServiceGTK.h +@@ -14,18 +14,20 @@ + + class nsUserIdleServiceGTK; + + class UserIdleServiceImpl { + public: +- NS_INLINE_DECL_REFCOUNTING(UserIdleServiceImpl); ++ explicit UserIdleServiceImpl(nsUserIdleServiceGTK* aUserIdleService) ++ : mUserIdleServiceGTK(aUserIdleService){}; + + virtual bool PollIdleTime(uint32_t* aIdleTime) = 0; +- virtual bool ProbeImplementation( +- RefPtr aUserIdleServiceGTK) = 0; ++ virtual bool ProbeImplementation() = 0; ++ ++ virtual ~UserIdleServiceImpl() = default; + + protected: +- virtual ~UserIdleServiceImpl() = default; ++ nsUserIdleServiceGTK* mUserIdleServiceGTK; + }; + + #define IDLE_SERVICE_MUTTER 0 + #define IDLE_SERVICE_XSCREENSAVER 1 + #define IDLE_SERVICE_NONE 2 +@@ -61,11 +63,11 @@ + nsUserIdleServiceGTK() = default; + + private: + ~nsUserIdleServiceGTK() = default; + +- RefPtr mIdleService; ++ mozilla::UniquePtr mIdleService; + #ifdef MOZ_ENABLE_DBUS + int mIdleServiceType = IDLE_SERVICE_MUTTER; + #else + int mIdleServiceType = IDLE_SERVICE_XSCREENSAVER; + #endif +diff --git a/widget/gtk/nsUserIdleServiceGTK.cpp b/widget/gtk/nsUserIdleServiceGTK.cpp +--- a/widget/gtk/nsUserIdleServiceGTK.cpp ++++ b/widget/gtk/nsUserIdleServiceGTK.cpp +@@ -74,12 +74,11 @@ + MOZ_LOG(sIdleLog, LogLevel::Warning, + ("XSSQueryExtension returned false!\n")); + return false; + } + +- bool ProbeImplementation( +- RefPtr aUserIdleServiceGTK) override { ++ bool ProbeImplementation() override { + MOZ_LOG(sIdleLog, LogLevel::Info, + ("UserIdleServiceX11::UserIdleServiceX11()\n")); + + if (!mozilla::widget::GdkIsX11Display()) { + return false; +@@ -114,15 +113,17 @@ + // We're missing X11 symbols + return false; + } + + // UserIdleServiceX11 uses sync init, confirm it now. +- aUserIdleServiceGTK->AcceptServiceCallback(); ++ mUserIdleServiceGTK->AcceptServiceCallback(); + return true; + } + +- protected: ++ explicit UserIdleServiceX11(nsUserIdleServiceGTK* aUserIdleService) ++ : UserIdleServiceImpl(aUserIdleService){}; ++ + ~UserIdleServiceX11() { + # ifdef MOZ_X11 + if (mXssInfo) { + XFree(mXssInfo); + } +@@ -164,11 +165,11 @@ + mCancellable) + ->Then( + GetCurrentSerialEventTarget(), __func__, + // It's safe to capture this as we use mCancellable to stop + // listening. +- [self = RefPtr{this}, this](RefPtr&& aResult) { ++ [this](RefPtr&& aResult) { + if (!g_variant_is_of_type(aResult, G_VARIANT_TYPE_TUPLE) || + g_variant_n_children(aResult) != 1) { + MOZ_LOG(sIdleLog, LogLevel::Info, + ("PollIdleTime() Unexpected params type: %s\n", + g_variant_get_type_string(aResult))); +@@ -191,25 +192,25 @@ + mLastIdleTime = idleTime; + mPollInProgress = false; + MOZ_LOG(sIdleLog, LogLevel::Info, + ("Async handler got %d\n", mLastIdleTime)); + }, +- [self = RefPtr{this}, this](GUniquePtr&& aError) { ++ [this](GUniquePtr&& aError) { + mPollInProgress = false; + g_warning("Failed to call GetIdletime(): %s\n", + aError->message); ++ mUserIdleServiceGTK->RejectAndTryNextServiceCallback(); + }); + } + + *aIdleTime = mLastIdleTime; + MOZ_LOG(sIdleLog, LogLevel::Info, + ("PollIdleTime() returns %d\n", *aIdleTime)); + return true; + } + +- bool ProbeImplementation( +- RefPtr aUserIdleServiceGTK) override { ++ bool ProbeImplementation() override { + MOZ_LOG(sIdleLog, LogLevel::Info, + ("UserIdleServiceMutter::UserIdleServiceMutter()\n")); + + mCancellable = dont_AddRef(g_cancellable_new()); + CreateDBusProxyForBus( +@@ -219,23 +220,23 @@ + nullptr, "org.gnome.Mutter.IdleMonitor", + "/org/gnome/Mutter/IdleMonitor/Core", "org.gnome.Mutter.IdleMonitor", + mCancellable) + ->Then( + GetCurrentSerialEventTarget(), __func__, +- [self = RefPtr{this}, service = RefPtr{aUserIdleServiceGTK}]( +- RefPtr&& aProxy) { +- self->mProxy = std::move(aProxy); +- service->AcceptServiceCallback(); ++ [this](RefPtr&& aProxy) { ++ mProxy = std::move(aProxy); ++ mUserIdleServiceGTK->AcceptServiceCallback(); + }, +- [self = RefPtr{this}, service = RefPtr{aUserIdleServiceGTK}]( +- GUniquePtr&& aError) { +- service->RejectAndTryNextServiceCallback(); ++ [this](GUniquePtr&& aError) { ++ mUserIdleServiceGTK->RejectAndTryNextServiceCallback(); + }); + return true; + } + +- protected: ++ explicit UserIdleServiceMutter(nsUserIdleServiceGTK* aUserIdleService) ++ : UserIdleServiceImpl(aUserIdleService){}; ++ + ~UserIdleServiceMutter() { + if (mCancellable) { + g_cancellable_cancel(mCancellable); + mCancellable = nullptr; + } +@@ -257,23 +258,23 @@ + MOZ_ASSERT(!mIdleService); + + switch (mIdleServiceType) { + #ifdef MOZ_ENABLE_DBUS + case IDLE_SERVICE_MUTTER: +- mIdleService = new UserIdleServiceMutter(); ++ mIdleService = MakeUnique(this); + break; + #endif + #ifdef MOZ_X11 + case IDLE_SERVICE_XSCREENSAVER: +- mIdleService = new UserIdleServiceX11(); ++ mIdleService = MakeUnique(this); + break; + #endif + default: + return; + } + +- if (!mIdleService->ProbeImplementation(this)) { ++ if (!mIdleService->ProbeImplementation()) { + RejectAndTryNextServiceCallback(); + } + } + + void nsUserIdleServiceGTK::AcceptServiceCallback() { +@@ -289,19 +290,19 @@ + mIdleServiceType)); + + // Delete recent non-working service + MOZ_ASSERT(mIdleService, "Nothing to reject?"); + mIdleService = nullptr; ++ mIdleServiceInitialized = false; + + mIdleServiceType++; + if (mIdleServiceType < IDLE_SERVICE_NONE) { + MOZ_LOG(sIdleLog, LogLevel::Info, + ("nsUserIdleServiceGTK try next idle service\n")); + ProbeService(); + } else { + MOZ_LOG(sIdleLog, LogLevel::Info, ("nsUserIdleServiceGTK failed\n")); +- mIdleServiceInitialized = false; + } + } + + bool nsUserIdleServiceGTK::PollIdleTime(uint32_t* aIdleTime) { + if (!mIdleServiceInitialized) { + diff --git a/firefox.spec b/firefox.spec index eec28df..41d431c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -169,7 +169,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 119.0 -Release: 4%{?pre_tag}%{?dist} +Release: 5%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -248,8 +248,9 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: D167159.diff -Patch409: D192061.1698487416.diff -Patch410: mozilla-1762816.patch +Patch409: D192061.1699444912.diff +Patch410: D192208.1699444906.diff +Patch411: mozilla-1762816.patch # PGO/LTO patches Patch600: pgo.patch @@ -542,7 +543,8 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .D167159 %patch409 -p1 -b .D192061 -%patch410 -p1 -b .mozilla-1762816 +%patch410 -p1 -b .D192208 +%patch411 -p1 -b .mozilla-1762816 # PGO patches %if %{build_with_pgo} @@ -1151,7 +1153,10 @@ fi #--------------------------------------------------------------------- %changelog -* Mon Nov 06 2023 Martin Stransky - 119.0-3 +* Tue Nov 07 2023 Martin Stransky - 119.0-5 +- Added fix for rhbz#2247665 + +* Mon Nov 06 2023 Martin Stransky - 119.0-4 - Added fix for mzbz#1762816 * Mon Oct 30 2023 Jan Horak - 119.0-3 From 712736a21533ca890e9491e3efa5b509c1e1e05f Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Wed, 8 Nov 2023 14:50:24 +0100 Subject: [PATCH 274/545] Enable crash reporter --- firefox.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index 41d431c..6003c50 100644 --- a/firefox.spec +++ b/firefox.spec @@ -40,7 +40,7 @@ ExcludeArch: i686 # https://bugzilla.redhat.com/show_bug.cgi?id=1951606 %global enable_mozilla_crashreporter 0 %ifarch x86_64 %{ix86} -%global enable_mozilla_crashreporter 0 +%global enable_mozilla_crashreporter 1 %endif %if %{build_with_asan} %global enable_mozilla_crashreporter 0 @@ -169,7 +169,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 119.0 -Release: 5%{?pre_tag}%{?dist} +Release: 6%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz From a0d8cf6efb5d4af1afcc96bc7af3c8ee29670d86 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 10 Nov 2023 10:02:57 +0100 Subject: [PATCH 275/545] Updated to 119.0.1 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index a491972..914c049 100644 --- a/.gitignore +++ b/.gitignore @@ -604,3 +604,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-118.0.2.source.tar.xz /firefox-langpacks-118.0.2-20231010.tar.xz /dump_syms-vendor.tar.xz +/firefox-langpacks-119.0.1-20231110.tar.xz +/firefox-119.0.1.source.tar.xz diff --git a/firefox.spec b/firefox.spec index 41d431c..c55f6e6 100644 --- a/firefox.spec +++ b/firefox.spec @@ -169,12 +169,12 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 119.0 -Release: 5%{?pre_tag}%{?dist} +Release: 6%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20231023.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20231110.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1153,6 +1153,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Nov 10 2023 Martin Stransky - 119.0-6 +- Updated to 119.0.1 + * Tue Nov 07 2023 Martin Stransky - 119.0-5 - Added fix for rhbz#2247665 diff --git a/sources b/sources index b11d47e..99133cf 100644 --- a/sources +++ b/sources @@ -1,5 +1,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 -SHA512 (firefox-119.0.source.tar.xz) = 4b555c444add36567fd538752b122f227cf78bb70b72c79e6d8ae8d9c2e61c3cdacfae79c37970753b8b5c7716b28c686071eb7b551773c30a76852f3550676c -SHA512 (firefox-langpacks-119.0-20231023.tar.xz) = f23a71aa3d5d0dab7d38a2c10bab9943034a7b858df07f49d29baadb8df74a679597621e491b5f011a471bee0efb9e368b7e7664f793637a78169cd6483a94be SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 +SHA512 (firefox-langpacks-119.0.1-20231110.tar.xz) = e1afd9529a4584c553bbd0def42b24a7aeed5c8dba6c3cc8965608a7aa90c1cf053e6b8ea885b9f2ee3d56351e9970d3ed5e0ee551bbbac441c00798c8d217ca +SHA512 (firefox-119.0.1.source.tar.xz) = 4f3201aee10e7b831cc384b2c7430a24f4de81f703115a917f9eb7acecb2ae1725f11af56c41257a056bb9d7a4d749d590cc9baffcd6e13852be45aaecf8163a From 48e82ba9fbd0ddd8ec4816b6b82009fa1ef3e837 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 10 Nov 2023 10:09:58 +0100 Subject: [PATCH 276/545] Disable crashreporter --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 3e63341..c55f6e6 100644 --- a/firefox.spec +++ b/firefox.spec @@ -40,7 +40,7 @@ ExcludeArch: i686 # https://bugzilla.redhat.com/show_bug.cgi?id=1951606 %global enable_mozilla_crashreporter 0 %ifarch x86_64 %{ix86} -%global enable_mozilla_crashreporter 1 +%global enable_mozilla_crashreporter 0 %endif %if %{build_with_asan} %global enable_mozilla_crashreporter 0 From 8b2f340656864b9b67caa21b136b1e5d932e65ba Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 10 Nov 2023 10:12:20 +0100 Subject: [PATCH 277/545] Release up --- firefox.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index c55f6e6..1136f05 100644 --- a/firefox.spec +++ b/firefox.spec @@ -169,7 +169,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 119.0 -Release: 6%{?pre_tag}%{?dist} +Release: 7%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1153,7 +1153,7 @@ fi #--------------------------------------------------------------------- %changelog -* Fri Nov 10 2023 Martin Stransky - 119.0-6 +* Fri Nov 10 2023 Martin Stransky - 119.0-7 - Updated to 119.0.1 * Tue Nov 07 2023 Martin Stransky - 119.0-5 From cb96cce64fdec30b361c86ca864604b839b28fa7 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 10 Nov 2023 12:52:26 +0100 Subject: [PATCH 278/545] Fixed version-release --- firefox.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/firefox.spec b/firefox.spec index 1136f05..8d1209d 100644 --- a/firefox.spec +++ b/firefox.spec @@ -168,8 +168,8 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 119.0 -Release: 7%{?pre_tag}%{?dist} +Version: 119.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1153,7 +1153,7 @@ fi #--------------------------------------------------------------------- %changelog -* Fri Nov 10 2023 Martin Stransky - 119.0-7 +* Fri Nov 10 2023 Martin Stransky - 119.0.1-1 - Updated to 119.0.1 * Tue Nov 07 2023 Martin Stransky - 119.0-5 From 8bc6287eb941f98364d43cb80213e4f813c5bb98 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Fri, 10 Nov 2023 14:56:28 +0100 Subject: [PATCH 279/545] We need to build dump_syms into separate vendored sources - to avoid collision with cbindgen --- firefox.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/firefox.spec b/firefox.spec index 8d1209d..4407487 100644 --- a/firefox.spec +++ b/firefox.spec @@ -40,7 +40,7 @@ ExcludeArch: i686 # https://bugzilla.redhat.com/show_bug.cgi?id=1951606 %global enable_mozilla_crashreporter 0 %ifarch x86_64 %{ix86} -%global enable_mozilla_crashreporter 0 +%global enable_mozilla_crashreporter 1 %endif %if %{build_with_asan} %global enable_mozilla_crashreporter 0 @@ -711,8 +711,8 @@ export CBINDGEN=/usr/bin/cbindgen %endif %if %{enable_mozilla_crashreporter} -mkdir -p my_rust_vendor -cd my_rust_vendor +mkdir -p my_rust_vendor_dump_syms +cd my_rust_vendor_dump_syms tar xf %{SOURCE3} mkdir -p .cargo cat > .cargo/config < Date: Mon, 13 Nov 2023 09:04:53 +0100 Subject: [PATCH 280/545] Enable crash reporter again --- firefox.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index 4407487..76e922a 100644 --- a/firefox.spec +++ b/firefox.spec @@ -169,7 +169,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 119.0.1 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1153,7 +1153,7 @@ fi #--------------------------------------------------------------------- %changelog -* Fri Nov 10 2023 Martin Stransky - 119.0.1-1 +* Fri Nov 10 2023 Martin Stransky - 119.0.1-2 - Updated to 119.0.1 * Tue Nov 07 2023 Martin Stransky - 119.0-5 From ba397925f8cd8976f959a8a0bf8e3f713ebc3c0a Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 14 Nov 2023 10:59:36 +0100 Subject: [PATCH 281/545] Updated to 120.0 --- .gitignore | 2 ++ fedora-customization.patch | 23 ++++++++++------------- firefox.spec | 13 ++++++------- sources | 4 ++-- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index 914c049..2a2c136 100644 --- a/.gitignore +++ b/.gitignore @@ -606,3 +606,5 @@ firefox-3.6.4.source.tar.bz2 /dump_syms-vendor.tar.xz /firefox-langpacks-119.0.1-20231110.tar.xz /firefox-119.0.1.source.tar.xz +/firefox-120.0.source.tar.xz +/firefox-langpacks-120.0-20231114.tar.xz diff --git a/fedora-customization.patch b/fedora-customization.patch index 2bcb335..e1d54b0 100644 --- a/fedora-customization.patch +++ b/fedora-customization.patch @@ -1,7 +1,7 @@ -diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp ---- a/toolkit/xre/nsAppRunner.cpp -+++ b/toolkit/xre/nsAppRunner.cpp -@@ -5762,6 +5762,12 @@ int XREMain::XRE_main(int argc, char* ar +diff -up firefox-120.0/toolkit/xre/nsAppRunner.cpp.fedora-customization firefox-120.0/toolkit/xre/nsAppRunner.cpp +--- firefox-120.0/toolkit/xre/nsAppRunner.cpp.fedora-customization 2023-11-13 21:48:38.000000000 +0100 ++++ firefox-120.0/toolkit/xre/nsAppRunner.cpp 2023-11-14 10:39:13.001603081 +0100 +@@ -5765,6 +5765,12 @@ int XREMain::XRE_main(int argc, char* ar if (!mAppData->remotingName) { mAppData->remotingName = mAppData->name; } @@ -14,21 +14,18 @@ diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp // used throughout this file gAppData = mAppData.get(); -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp ---- a/widget/gtk/nsWindow.cpp -+++ b/widget/gtk/nsWindow.cpp -@@ -3448,7 +3448,13 @@ void* nsWindow::GetNativeData(uint32_t a +diff -up firefox-120.0/widget/gtk/nsWindow.cpp.fedora-customization firefox-120.0/widget/gtk/nsWindow.cpp +--- firefox-120.0/widget/gtk/nsWindow.cpp.fedora-customization 2023-11-14 10:39:13.003603150 +0100 ++++ firefox-120.0/widget/gtk/nsWindow.cpp 2023-11-14 10:41:06.339532735 +0100 +@@ -3457,6 +3457,11 @@ void* nsWindow::GetNativeData(uint32_t a nsresult nsWindow::SetTitle(const nsAString& aTitle) { if (!mShell) return NS_OK; -- // convert the string into utf8 and set the title. + const char* appTitle = getenv("MOZ_APP_TITLE"); + if (appTitle) { + gtk_window_set_title(GTK_WINDOW(mShell), appTitle); + return NS_OK; + } -+ -+ // convert the string into utf8 and set the title. - #define UTF8_FOLLOWBYTE(ch) (((ch)&0xC0) == 0x80) + // convert the string into utf8 and set the title. + #define UTF8_FOLLOWBYTE(ch) (((ch) & 0xC0) == 0x80) NS_ConvertUTF16toUTF8 titleUTF8(aTitle); - if (titleUTF8.Length() > NS_WINDOW_TITLE_MAX_LENGTH) { diff --git a/firefox.spec b/firefox.spec index 8d1209d..c125071 100644 --- a/firefox.spec +++ b/firefox.spec @@ -168,13 +168,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 119.0.1 +Version: 120.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20231110.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20231114.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -248,8 +248,6 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: D167159.diff -Patch409: D192061.1699444912.diff -Patch410: D192208.1699444906.diff Patch411: mozilla-1762816.patch # PGO/LTO patches @@ -522,7 +520,7 @@ This package contains results of tests executed during build. # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell #%patch101 -p1 -b .firefox-tests-reftest -%patch102 -p1 -b .firefox-tests-xpcshell-freeze +#%patch102 -p1 -b .firefox-tests-xpcshell-freeze # Fedora patches %patch215 -p1 -b .addons @@ -542,8 +540,6 @@ This package contains results of tests executed during build. %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 %patch408 -p1 -b .D167159 -%patch409 -p1 -b .D192061 -%patch410 -p1 -b .D192208 %patch411 -p1 -b .mozilla-1762816 # PGO patches @@ -1153,6 +1149,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Nov 14 2023 Martin Stransky - 120.0-1 +- Updated to 120.0 + * Fri Nov 10 2023 Martin Stransky - 119.0.1-1 - Updated to 119.0.1 diff --git a/sources b/sources index 99133cf..081f4b1 100644 --- a/sources +++ b/sources @@ -1,5 +1,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 -SHA512 (firefox-langpacks-119.0.1-20231110.tar.xz) = e1afd9529a4584c553bbd0def42b24a7aeed5c8dba6c3cc8965608a7aa90c1cf053e6b8ea885b9f2ee3d56351e9970d3ed5e0ee551bbbac441c00798c8d217ca -SHA512 (firefox-119.0.1.source.tar.xz) = 4f3201aee10e7b831cc384b2c7430a24f4de81f703115a917f9eb7acecb2ae1725f11af56c41257a056bb9d7a4d749d590cc9baffcd6e13852be45aaecf8163a +SHA512 (firefox-120.0.source.tar.xz) = 3c6f7de5e3b79883b6f92bbc5c0ad36e2e7961981d59ce8495e92cdf310a74b94bfa1dae80737970d15eeaafbe886e53bd7bfd99a71ae0ec4a7175f12079529f +SHA512 (firefox-langpacks-120.0-20231114.tar.xz) = 61e52b3f21f8f66ed08b87d4093987e9459830702c622be63bb94e1148d8daa9bdbfe68a5f4c67b9a2b199290f4f48418cfdd893ad1dba78c7825008a6bf4259 From ada751ca274f8865517fa00cd9c216423fec0c6a Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 20 Nov 2023 09:20:40 +0100 Subject: [PATCH 282/545] Updated to 120.0 Build 2 --- .gitignore | 1 + firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 2a2c136..eb69f6a 100644 --- a/.gitignore +++ b/.gitignore @@ -608,3 +608,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-119.0.1.source.tar.xz /firefox-120.0.source.tar.xz /firefox-langpacks-120.0-20231114.tar.xz +/firefox-langpacks-120.0-20231120.tar.xz diff --git a/firefox.spec b/firefox.spec index 750e928..ad79a6a 100644 --- a/firefox.spec +++ b/firefox.spec @@ -169,12 +169,12 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 120.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20231114.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20231120.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1149,6 +1149,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Nov 20 2023 Martin Stransky - 120.0-2 +- Updated to 120.0 Build 2 + * Tue Nov 14 2023 Martin Stransky - 120.0-1 - Updated to 120.0 diff --git a/sources b/sources index 081f4b1..690da10 100644 --- a/sources +++ b/sources @@ -1,5 +1,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 -SHA512 (firefox-120.0.source.tar.xz) = 3c6f7de5e3b79883b6f92bbc5c0ad36e2e7961981d59ce8495e92cdf310a74b94bfa1dae80737970d15eeaafbe886e53bd7bfd99a71ae0ec4a7175f12079529f -SHA512 (firefox-langpacks-120.0-20231114.tar.xz) = 61e52b3f21f8f66ed08b87d4093987e9459830702c622be63bb94e1148d8daa9bdbfe68a5f4c67b9a2b199290f4f48418cfdd893ad1dba78c7825008a6bf4259 +SHA512 (firefox-120.0.source.tar.xz) = 31d5f9e1d4173280c8de6d9b8551bc6bba5e2c49b84f944f50d42002d5b39c2fb743bc130f26c81160388a102b8301b94a0a378ecdfa6f943860f971a860df8c +SHA512 (firefox-langpacks-120.0-20231120.tar.xz) = a97c4120e38e8fa2ed6c06957a9f8d29b40e4c4697438cc513e10f9fadbd23aab2e9f6f870ca3f21abe48a62e47e609f99437770ca0c5a562d26c9953b29b881 From 911eba94d0dd70cb89b0d52eadbea8b7ad8264d1 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 27 Nov 2023 11:56:19 +0100 Subject: [PATCH 283/545] Added fix for rhbz#2251202 --- D194727.1701168293.diff | 17 +++++++++++++++++ firefox.spec | 7 ++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 D194727.1701168293.diff diff --git a/D194727.1701168293.diff b/D194727.1701168293.diff new file mode 100644 index 0000000..0e85981 --- /dev/null +++ b/D194727.1701168293.diff @@ -0,0 +1,17 @@ +diff --git a/toolkit/components/resistfingerprinting/nsRFPService.cpp b/toolkit/components/resistfingerprinting/nsRFPService.cpp +--- a/toolkit/components/resistfingerprinting/nsRFPService.cpp ++++ b/toolkit/components/resistfingerprinting/nsRFPService.cpp +@@ -1375,11 +1375,11 @@ + } + #ifdef __clang__ + # pragma clang diagnostic pop + #endif + +- for (uint8_t i = 0; i <= numNoises; i++) { ++ while (numNoises--) { + // Choose which RGB channel to add a noise. The pixel data is in either + // the BGRA or the ARGB format depending on the endianess. To choose the + // color channel we need to add the offset according the endianess. + uint32_t channel; + if (aSurfaceFormat == gfx::SurfaceFormat::B8G8R8A8) { + diff --git a/firefox.spec b/firefox.spec index ad79a6a..5316635 100644 --- a/firefox.spec +++ b/firefox.spec @@ -169,7 +169,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 120.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -249,6 +249,7 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: D167159.diff Patch411: mozilla-1762816.patch +Patch412: D194727.1701168293.diff # PGO/LTO patches Patch600: pgo.patch @@ -541,6 +542,7 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .D167159 %patch411 -p1 -b .mozilla-1762816 +%patch412 -p1 -b .D194727 # PGO patches %if %{build_with_pgo} @@ -1149,6 +1151,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Nov 27 2023 Martin Stransky - 120.0-3 +- Add fix for rhbz#2251202 + * Mon Nov 20 2023 Martin Stransky - 120.0-2 - Updated to 120.0 Build 2 From 203cb80595cfdf719e4ade92e7b29d1dcf9b78bf Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 1 Dec 2023 10:16:14 +0100 Subject: [PATCH 284/545] Updated to 120.0.1 --- .gitignore | 1 + D194727.1701168293.diff | 17 ----------------- firefox.spec | 13 +++++++------ sources | 2 +- 4 files changed, 9 insertions(+), 24 deletions(-) delete mode 100644 D194727.1701168293.diff diff --git a/.gitignore b/.gitignore index eb69f6a..fbef04e 100644 --- a/.gitignore +++ b/.gitignore @@ -609,3 +609,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-120.0.source.tar.xz /firefox-langpacks-120.0-20231114.tar.xz /firefox-langpacks-120.0-20231120.tar.xz +/firefox-120.0.1.source.tar.xz diff --git a/D194727.1701168293.diff b/D194727.1701168293.diff deleted file mode 100644 index 0e85981..0000000 --- a/D194727.1701168293.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/toolkit/components/resistfingerprinting/nsRFPService.cpp b/toolkit/components/resistfingerprinting/nsRFPService.cpp ---- a/toolkit/components/resistfingerprinting/nsRFPService.cpp -+++ b/toolkit/components/resistfingerprinting/nsRFPService.cpp -@@ -1375,11 +1375,11 @@ - } - #ifdef __clang__ - # pragma clang diagnostic pop - #endif - -- for (uint8_t i = 0; i <= numNoises; i++) { -+ while (numNoises--) { - // Choose which RGB channel to add a noise. The pixel data is in either - // the BGRA or the ARGB format depending on the endianess. To choose the - // color channel we need to add the offset according the endianess. - uint32_t channel; - if (aSurfaceFormat == gfx::SurfaceFormat::B8G8R8A8) { - diff --git a/firefox.spec b/firefox.spec index 5316635..3f90120 100644 --- a/firefox.spec +++ b/firefox.spec @@ -168,13 +168,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 120.0 -Release: 3%{?pre_tag}%{?dist} +Version: 120.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20231120.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20231201.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -249,7 +249,6 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: D167159.diff Patch411: mozilla-1762816.patch -Patch412: D194727.1701168293.diff # PGO/LTO patches Patch600: pgo.patch @@ -542,7 +541,6 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .D167159 %patch411 -p1 -b .mozilla-1762816 -%patch412 -p1 -b .D194727 # PGO patches %if %{build_with_pgo} @@ -876,7 +874,7 @@ mkdir -p %{buildroot}{%{_libdir},%{_bindir},%{_datadir}/applications} # We can't use desktop-file-install as it refuses to install firefox.desktop file. # We need to change it to org.mozilla.firefox.desktop and also update # gnome shell default applications. -# +# #desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE20} cp %{SOURCE20} %{buildroot}%{_datadir}/applications desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE31} @@ -1151,6 +1149,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Dec 01 2023 Martin Stransky - 120.0.1-1 +- Updated to 120.0.1 + * Mon Nov 27 2023 Martin Stransky - 120.0-3 - Add fix for rhbz#2251202 diff --git a/sources b/sources index 690da10..8fd4375 100644 --- a/sources +++ b/sources @@ -1,5 +1,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 -SHA512 (firefox-120.0.source.tar.xz) = 31d5f9e1d4173280c8de6d9b8551bc6bba5e2c49b84f944f50d42002d5b39c2fb743bc130f26c81160388a102b8301b94a0a378ecdfa6f943860f971a860df8c SHA512 (firefox-langpacks-120.0-20231120.tar.xz) = a97c4120e38e8fa2ed6c06957a9f8d29b40e4c4697438cc513e10f9fadbd23aab2e9f6f870ca3f21abe48a62e47e609f99437770ca0c5a562d26c9953b29b881 +SHA512 (firefox-120.0.1.source.tar.xz) = dd0e3eb234d58c39431d1f100834ef4bcc8cfb89ff471a37b948eda4dd3874b63b1979cda39a0db0dd3b4a579b5f09a7d2d1f39d26fd9f2b8d5635e4b8738b6c From 91f5d4fe1b3fbf627eff5630934106653668bb4a Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 1 Dec 2023 10:22:53 +0100 Subject: [PATCH 285/545] Uploaded langpacks --- .gitignore | 1 + sources | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index fbef04e..23d01e2 100644 --- a/.gitignore +++ b/.gitignore @@ -610,3 +610,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-120.0-20231114.tar.xz /firefox-langpacks-120.0-20231120.tar.xz /firefox-120.0.1.source.tar.xz +/firefox-langpacks-120.0.1-20231201.tar.xz diff --git a/sources b/sources index 8fd4375..58f60ce 100644 --- a/sources +++ b/sources @@ -1,5 +1,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 -SHA512 (firefox-langpacks-120.0-20231120.tar.xz) = a97c4120e38e8fa2ed6c06957a9f8d29b40e4c4697438cc513e10f9fadbd23aab2e9f6f870ca3f21abe48a62e47e609f99437770ca0c5a562d26c9953b29b881 SHA512 (firefox-120.0.1.source.tar.xz) = dd0e3eb234d58c39431d1f100834ef4bcc8cfb89ff471a37b948eda4dd3874b63b1979cda39a0db0dd3b4a579b5f09a7d2d1f39d26fd9f2b8d5635e4b8738b6c +SHA512 (firefox-langpacks-120.0.1-20231201.tar.xz) = 83252744496ef23bac310e680e8e2de0a8e9a68008f9295c5f2cbe37a86b59b0d06108d98cef5ee6c86e9c17efa6e0f69fa237ad40254e3d057a04d220a37ec1 From e302fd714c50f74110a0240fc9ee9467dfff2676 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 18 Dec 2023 20:28:57 +0100 Subject: [PATCH 286/545] Updated to 121.0 --- .gitignore | 2 + disable-openh264-download.patch | 46 ++++++------ firefox.spec | 9 +-- mozilla-1762816.patch | 121 -------------------------------- sources | 4 +- 5 files changed, 31 insertions(+), 151 deletions(-) delete mode 100644 mozilla-1762816.patch diff --git a/.gitignore b/.gitignore index 23d01e2..1a92e2c 100644 --- a/.gitignore +++ b/.gitignore @@ -611,3 +611,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-120.0-20231120.tar.xz /firefox-120.0.1.source.tar.xz /firefox-langpacks-120.0.1-20231201.tar.xz +/firefox-121.0.source.tar.xz +/firefox-langpacks-121.0-20231218.tar.xz diff --git a/disable-openh264-download.patch b/disable-openh264-download.patch index 01fa2da..0631850 100644 --- a/disable-openh264-download.patch +++ b/disable-openh264-download.patch @@ -1,32 +1,30 @@ -diff -up firefox-81.0/toolkit/modules/GMPInstallManager.sys.mjs.old firefox-81.0/toolkit/modules/GMPInstallManager.sys.mjs ---- firefox-81.0/toolkit/modules/GMPInstallManager.sys.mjs.old 2020-09-25 10:39:04.769458703 +0200 -+++ firefox-81.0/toolkit/modules/GMPInstallManager.sys.mjs 2020-09-25 10:39:22.038504747 +0200 -@@ -54,10 +54,6 @@ function getScopedLogger(prefix) { - - const LOCAL_GMP_SOURCES = [ - { -- id: "gmp-gmpopenh264", -- src: "chrome://global/content/gmp-sources/openh264.json", -- }, -- { - id: "gmp-widevinecdm", - src: "chrome://global/content/gmp-sources/widevinecdm.json", - }, -diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn ---- a/toolkit/content/jar.mn -+++ b/toolkit/content/jar.mn -@@ -108,7 +108,6 @@ toolkit.jar: +diff -up firefox-121.0/toolkit/content/jar.mn.disable-openh264-download firefox-121.0/toolkit/content/jar.mn +--- firefox-121.0/toolkit/content/jar.mn.disable-openh264-download 2023-12-18 20:15:04.352014249 +0100 ++++ firefox-121.0/toolkit/content/jar.mn 2023-12-18 20:19:26.857929200 +0100 +@@ -130,7 +130,6 @@ toolkit.jar: #ifdef XP_MACOSX content/global/macWindowMenu.js #endif - content/global/gmp-sources/openh264.json (gmp-sources/openh264.json) content/global/gmp-sources/widevinecdm.json (gmp-sources/widevinecdm.json) - - # Third party files -diff --git a/toolkit/modules/GMPInstallManager.sys.mjs b/toolkit/modules/GMPInstallManager.sys.mjs ---- a/toolkit/modules/GMPInstallManager.sys.mjs -+++ b/toolkit/modules/GMPInstallManager.sys.mjs -@@ -238,6 +234,9 @@ GMPInstallManager.prototype = { + content/global/gmp-sources/widevinecdm_l1.json (gmp-sources/widevinecdm_l1.json) + +diff -up firefox-121.0/toolkit/modules/GMPInstallManager.sys.mjs.disable-openh264-download firefox-121.0/toolkit/modules/GMPInstallManager.sys.mjs +--- firefox-121.0/toolkit/modules/GMPInstallManager.sys.mjs.disable-openh264-download 2023-12-11 21:42:21.000000000 +0100 ++++ firefox-121.0/toolkit/modules/GMPInstallManager.sys.mjs 2023-12-18 20:18:52.665768579 +0100 +@@ -35,11 +35,6 @@ function getScopedLogger(prefix) { + + const LOCAL_GMP_SOURCES = [ + { +- id: "gmp-gmpopenh264", +- src: "chrome://global/content/gmp-sources/openh264.json", +- installByDefault: true, +- }, +- { + id: "gmp-widevinecdm", + src: "chrome://global/content/gmp-sources/widevinecdm.json", + installByDefault: true, +@@ -421,6 +416,9 @@ GMPInstallManager.prototype = { * downloaderr, verifyerr or previouserrorencountered */ installAddon(gmpAddon) { diff --git a/firefox.spec b/firefox.spec index 3f90120..c9082b9 100644 --- a/firefox.spec +++ b/firefox.spec @@ -168,13 +168,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 120.0.1 +Version: 121.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20231201.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20231218.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -248,7 +248,6 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: D167159.diff -Patch411: mozilla-1762816.patch # PGO/LTO patches Patch600: pgo.patch @@ -540,7 +539,6 @@ This package contains results of tests executed during build. %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 %patch408 -p1 -b .D167159 -%patch411 -p1 -b .mozilla-1762816 # PGO patches %if %{build_with_pgo} @@ -1149,6 +1147,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Dec 18 2023 Martin Stransky - 121.0-1 +- Updated to 121.0 + * Fri Dec 01 2023 Martin Stransky - 120.0.1-1 - Updated to 120.0.1 diff --git a/mozilla-1762816.patch b/mozilla-1762816.patch deleted file mode 100644 index 8d302df..0000000 --- a/mozilla-1762816.patch +++ /dev/null @@ -1,121 +0,0 @@ -changeset: 688555:933a3df01cfa -tag: tip -parent: 688549:db8c28afe588 -user: stransky -date: Tue Oct 31 15:27:05 2023 +0100 -files: widget/gtk/nsLookAndFeel.cpp widget/gtk/nsLookAndFeel.h -description: -Bug 1762816 [Linux] Watch org.freedesktop.portal.Desktop DBus name and get session data only if it's running r?emilio - -Don't autostart org.freedesktop.portal.Desktop by g_dbus_proxy_new_for_bus_sync(), that may block Firefox start for 30~ seconds after desktop start. -Use g_bus_watch_name() and get session data only if org.freedesktop.portal.Desktop is available. - -Differential Revision: https://phabricator.services.mozilla.com/D192335 - - -diff --git a/widget/gtk/nsLookAndFeel.cpp b/widget/gtk/nsLookAndFeel.cpp ---- a/widget/gtk/nsLookAndFeel.cpp -+++ b/widget/gtk/nsLookAndFeel.cpp -@@ -134,6 +134,35 @@ static void settings_changed_signal_cb(G - } - } - -+void nsLookAndFeel::WatchDBus() { -+ GUniquePtr error; -+ mDBusSettingsProxy = dont_AddRef(g_dbus_proxy_new_for_bus_sync( -+ G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, nullptr, -+ "org.freedesktop.portal.Desktop", "/org/freedesktop/portal/desktop", -+ "org.freedesktop.portal.Settings", nullptr, getter_Transfers(error))); -+ if (mDBusSettingsProxy) { -+ g_signal_connect(mDBusSettingsProxy, "g-signal", -+ G_CALLBACK(settings_changed_signal_cb), this); -+ } else { -+ LOGLNF("Can't create DBus proxy for settings: %s\n", error->message); -+ return; -+ } -+ -+ // DBus interface was started after L&F init so we need to load -+ // our settings from DBus explicitly. -+ if (!sIgnoreChangedSettings) { -+ OnColorSchemeSettingChanged(); -+ } -+} -+ -+void nsLookAndFeel::UnwatchDBus() { -+ if (mDBusSettingsProxy) { -+ g_signal_handlers_disconnect_by_func( -+ mDBusSettingsProxy, FuncToGpointer(settings_changed_signal_cb), this); -+ mDBusSettingsProxy = nullptr; -+ } -+} -+ - nsLookAndFeel::nsLookAndFeel() { - static constexpr nsLiteralCString kObservedSettings[] = { - // Affects system font sizes. -@@ -172,27 +201,29 @@ nsLookAndFeel::nsLookAndFeel() { - nsWindow::GetSystemGtkWindowDecoration() != nsWindow::GTK_DECORATION_NONE; - - if (ShouldUsePortal(PortalKind::Settings)) { -- GUniquePtr error; -- mDBusSettingsProxy = dont_AddRef(g_dbus_proxy_new_for_bus_sync( -- G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, nullptr, -- "org.freedesktop.portal.Desktop", "/org/freedesktop/portal/desktop", -- "org.freedesktop.portal.Settings", nullptr, getter_Transfers(error))); -- if (mDBusSettingsProxy) { -- g_signal_connect(mDBusSettingsProxy, "g-signal", -- G_CALLBACK(settings_changed_signal_cb), this); -- } else { -- LOGLNF("Can't create DBus proxy for settings: %s\n", error->message); -- } -+ mDBusID = g_bus_watch_name( -+ G_BUS_TYPE_SESSION, "org.freedesktop.portal.Desktop", -+ G_BUS_NAME_WATCHER_FLAGS_AUTO_START, -+ [](GDBusConnection*, const gchar*, const gchar*, -+ gpointer data) -> void { -+ auto* lnf = static_cast(data); -+ lnf->WatchDBus(); -+ }, -+ [](GDBusConnection*, const gchar*, gpointer data) -> void { -+ auto* lnf = static_cast(data); -+ lnf->UnwatchDBus(); -+ }, -+ this, nullptr); - } - } - - nsLookAndFeel::~nsLookAndFeel() { - ClearRoundedCornerProvider(); -- if (mDBusSettingsProxy) { -- g_signal_handlers_disconnect_by_func( -- mDBusSettingsProxy, FuncToGpointer(settings_changed_signal_cb), this); -- mDBusSettingsProxy = nullptr; -+ if (mDBusID) { -+ g_bus_unwatch_name(mDBusID); -+ mDBusID = 0; - } -+ UnwatchDBus(); - g_signal_handlers_disconnect_by_func( - gtk_settings_get_default(), FuncToGpointer(settings_changed_cb), nullptr); - } -diff --git a/widget/gtk/nsLookAndFeel.h b/widget/gtk/nsLookAndFeel.h ---- a/widget/gtk/nsLookAndFeel.h -+++ b/widget/gtk/nsLookAndFeel.h -@@ -53,6 +53,9 @@ class nsLookAndFeel final : public nsXPL - static bool ShouldHonorThemeScrollbarColors(); - mozilla::Maybe ComputeColorSchemeSetting(); - -+ void WatchDBus(); -+ void UnwatchDBus(); -+ - enum class ThemeFamily : uint8_t { - // Adwaita, the default GTK theme. - Adwaita, -@@ -160,6 +163,7 @@ class nsLookAndFeel final : public nsXPL - return mSystemThemeOverridden ? mAltTheme : mSystemTheme; - } - -+ uint32_t mDBusID = 0; - RefPtr mDBusSettingsProxy; - mozilla::Maybe mColorSchemePreference; - int32_t mCaretBlinkTime = 0; - diff --git a/sources b/sources index 58f60ce..b336129 100644 --- a/sources +++ b/sources @@ -1,5 +1,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 -SHA512 (firefox-120.0.1.source.tar.xz) = dd0e3eb234d58c39431d1f100834ef4bcc8cfb89ff471a37b948eda4dd3874b63b1979cda39a0db0dd3b4a579b5f09a7d2d1f39d26fd9f2b8d5635e4b8738b6c -SHA512 (firefox-langpacks-120.0.1-20231201.tar.xz) = 83252744496ef23bac310e680e8e2de0a8e9a68008f9295c5f2cbe37a86b59b0d06108d98cef5ee6c86e9c17efa6e0f69fa237ad40254e3d057a04d220a37ec1 +SHA512 (firefox-121.0.source.tar.xz) = 52e9e21ce825c4e58f09fd2c7347f1ac4efbca47e119136a712f0d4ee80c769ef80a43bad74a4c88cd377f804f5780b07f7af5b779f3fb5d244fa095e6b3b18a +SHA512 (firefox-langpacks-121.0-20231218.tar.xz) = 7e83b550cfdaeb876b1e65fdd8d7178f990805884d95ccf4b273730a417ea0b51db822a89064fdf67158e6f57f6bd4e2387570c33680c20a924ac872ec4bdec9 From 2714c26204582b6a9e3058c26f4c4caecabbe31b Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 18 Dec 2023 20:30:44 +0100 Subject: [PATCH 287/545] Updated changelog --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index c9082b9..2c65540 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1147,7 +1147,7 @@ fi #--------------------------------------------------------------------- %changelog -* Fri Dec 18 2023 Martin Stransky - 121.0-1 +* Mon Dec 18 2023 Martin Stransky - 121.0-1 - Updated to 121.0 * Fri Dec 01 2023 Martin Stransky - 120.0.1-1 From 722aeaae74946e9f01599ebbe088a7dd99aef2c1 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 18 Dec 2023 22:05:27 +0100 Subject: [PATCH 288/545] Enable Gnome Shell Search provider for Fedora 40+, Don't ship firefox-x11 and firefox-wayland on Fedora 40+ --- firefox.spec | 52 +++-- org.mozilla.firefox.desktop | 277 ++++++++++++++++++++++++ org.mozilla.firefox.search-provider.ini | 2 +- 3 files changed, 315 insertions(+), 16 deletions(-) create mode 100644 org.mozilla.firefox.desktop diff --git a/firefox.spec b/firefox.spec index 2c65540..9468954 100644 --- a/firefox.spec +++ b/firefox.spec @@ -36,6 +36,11 @@ ExcludeArch: i686 %global build_with_clang 0 %endif +%global gnome_shell_search_provider 0 +%if 0%{?fedora} >= 40 +%global gnome_shell_search_provider 1 +%endif + # Temporary disabled due to # https://bugzilla.redhat.com/show_bug.cgi?id=1951606 %global enable_mozilla_crashreporter 0 @@ -124,7 +129,7 @@ ExcludeArch: i686 %if %{?system_nss} %global nspr_version 4.32 %global nspr_build_version %{nspr_version} -%global nss_version 3.94 +%global nss_version 3.95 %global nss_build_version %{nss_version} %endif @@ -205,6 +210,7 @@ Source43: print_failures Source44: print-error-reftest Source45: run-wayland-compositor Source46: org.mozilla.firefox.SearchProvider.service +Source47: org.mozilla.firefox.desktop # Build patches #Patch3: mozilla-build-arm.patch @@ -466,6 +472,7 @@ debug %{name}, you want to install %{name}-debuginfo instead. %global _find_debuginfo_opts %{limit_build -m 32768} %endif +%if 0%{?fedora} < 40 %package x11 Summary: Firefox X11 launcher. Requires: %{name} @@ -485,6 +492,7 @@ to run Firefox explicitly on Wayland. %files wayland %{_bindir}/firefox-wayland %{_datadir}/applications/firefox-wayland.desktop +%endif %if 0%{?run_firefox_tests} %global testsuite_pkg_name %{name}-testresults @@ -868,15 +876,25 @@ DESTDIR=%{buildroot} make -C objdir install mkdir -p %{buildroot}{%{_libdir},%{_bindir},%{_datadir}/applications} -# TODO +%if %{gnome_shell_search_provider} +# Install Gnome search provider files +mkdir -p %{buildroot}%{_datadir}/gnome-shell/search-providers +cp %{SOURCE34} %{buildroot}%{_datadir}/gnome-shell/search-providers +mkdir -p %{buildroot}%{_datadir}/dbus-1/services +cp %{SOURCE46} %{buildroot}%{_datadir}/dbus-1/services +%endif + +%if %{gnome_shell_search_provider} +desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE47} +%else # We can't use desktop-file-install as it refuses to install firefox.desktop file. -# We need to change it to org.mozilla.firefox.desktop and also update -# gnome shell default applications. -# -#desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE20} cp %{SOURCE20} %{buildroot}%{_datadir}/applications +%endif + +%if 0%{?fedora} < 40 desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE31} desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE29} +%endif # set up the firefox start script rm -rf %{buildroot}%{_bindir}/firefox @@ -889,10 +907,12 @@ sed -i -e 's|%FLATPAK_ENV_VARS%|export TMPDIR="$XDG_CACHE_HOME/tmp"|' %{buildroo sed -i -e 's|%FLATPAK_ENV_VARS%||' %{buildroot}%{_bindir}/firefox %endif +%if 0%{?fedora} < 40 sed -e 's,/__PREFIX__,%{_prefix},g' %{SOURCE30} > %{buildroot}%{_bindir}/firefox-x11 chmod 755 %{buildroot}%{_bindir}/firefox-x11 sed -e 's,/__PREFIX__,%{_prefix},g' %{SOURCE28} > %{buildroot}%{_bindir}/firefox-wayland chmod 755 %{buildroot}%{_bindir}/firefox-wayland +%endif install -p -D -m 644 %{SOURCE23} %{buildroot}%{_mandir}/man1/firefox.1 @@ -1014,12 +1034,6 @@ sed -e "s/__VERSION__/%{version}/" \ -e "s/__DATE__/$(date '+%F')/" \ %{SOURCE33} > %{buildroot}%{_datadir}/metainfo/firefox.appdata.xml -# Install Gnome search provider files -mkdir -p %{buildroot}%{_datadir}/gnome-shell/search-providers -cp %{SOURCE34} %{buildroot}%{_datadir}/gnome-shell/search-providers -mkdir -p %{buildroot}%{_datadir}/dbus-1/services -cp %{SOURCE46} %{buildroot}%{_datadir}/dbus-1/services - # Remove copied libraries to speed up build rm -f %{buildroot}%{mozappdirdev}/sdk/lib/libmozjs.so rm -f %{buildroot}%{mozappdirdev}/sdk/lib/libmozalloc.so @@ -1082,10 +1096,14 @@ fi %dir %{_sysconfdir}/%{name}/* %dir %{_datadir}/mozilla/extensions/* %dir %{_libdir}/mozilla/extensions/* -%{_datadir}/applications/firefox.desktop -%{_datadir}/metainfo/*.appdata.xml -%{_datadir}/gnome-shell/search-providers/*.ini +%if %{gnome_shell_search_provider} +%{_datadir}/applications/org.mozilla.firefox.desktop %{_datadir}/dbus-1/services/* +%{_datadir}/gnome-shell/search-providers/*.ini +%else +%{_datadir}/applications/firefox.desktop +%endif +%{_datadir}/metainfo/*.appdata.xml %dir %{mozappdir} %license %{mozappdir}/LICENSE %{mozappdir}/browser/chrome @@ -1147,6 +1165,10 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Dec 18 2023 Martin Stransky - 121.0-2 +- Enable Gnome Shell Search provider for Fedora 40+ +- Don't ship firefox-x11 and firefox-wayland on Fedora 40+ + * Mon Dec 18 2023 Martin Stransky - 121.0-1 - Updated to 121.0 diff --git a/org.mozilla.firefox.desktop b/org.mozilla.firefox.desktop new file mode 100644 index 0000000..66c22dd --- /dev/null +++ b/org.mozilla.firefox.desktop @@ -0,0 +1,277 @@ +[Desktop Entry] +Version=1.0 +Name=Firefox +GenericName=Web Browser +GenericName[ca]=Navegador web +GenericName[cs]=Webový prohlížeč +GenericName[es]=Navegador web +GenericName[fa]=مرورگر اینترنتی +GenericName[fi]=WWW-selain +GenericName[fr]=Navigateur Web +GenericName[hu]=Webböngésző +GenericName[it]=Browser Web +GenericName[ja]=ウェブ・ブラウザ +GenericName[ko]=웹 브라우저 +GenericName[nb]=Nettleser +GenericName[nl]=Webbrowser +GenericName[nn]=Nettlesar +GenericName[no]=Nettleser +GenericName[pl]=Przeglądarka WWW +GenericName[pt]=Navegador Web +GenericName[pt_BR]=Navegador Web +GenericName[sk]=Internetový prehliadač +GenericName[sv]=Webbläsare +Comment=Browse the Web +Comment[ca]=Navegueu per el web +Comment[cs]=Prohlížení stránek World Wide Webu +Comment[de]=Im Internet surfen +Comment[es]=Navegue por la web +Comment[fa]=صفحات شبکه جهانی اینترنت را مرور نمایید +Comment[fi]=Selaa Internetin WWW-sivuja +Comment[fr]=Navigue sur Internet +Comment[hu]=A világháló böngészése +Comment[it]=Esplora il web +Comment[ja]=ウェブを閲覧します +Comment[ko]=웹을 돌아 다닙니다 +Comment[nb]=Surf på nettet +Comment[nl]=Verken het internet +Comment[nn]=Surf på nettet +Comment[no]=Surf på nettet +Comment[pl]=Przeglądanie stron WWW +Comment[pt]=Navegue na Internet +Comment[pt_BR]=Navegue na Internet +Comment[sk]=Prehliadanie internetu +Comment[sv]=Surfa på webben +Exec=firefox %u +Icon=firefox +Terminal=false +Type=Application +MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https; +StartupNotify=true +Categories=Network;WebBrowser; +Keywords=web;browser;internet; +Actions=new-window;new-private-window;profile-manager-window; +DBusActivatable=true + +[Desktop Action new-window] +Name=Open a New Window +Name[ach]=Dirica manyen +Name[af]=Nuwe venster +Name[an]=Nueva finestra +Name[ar]=نافذة جديدة +Name[as]=নতুন উইন্ডো +Name[ast]=Ventana nueva +Name[az]=Yeni Pəncərə +Name[be]=Новае акно +Name[bg]=Нов прозорец +Name[bn_BD]=নতুন উইন্ডো (N) +Name[bn_IN]=নতুন উইন্ডো +Name[br]=Prenestr nevez +Name[brx]=गोदान उइन्ड'(N) +Name[bs]=Novi prozor +Name[ca]=Finestra nova +Name[cak]=K'ak'a' tzuwäch +Name[cs]=Nové okno +Name[cy]=Ffenestr Newydd +Name[da]=Nyt vindue +Name[de]=Neues Fenster +Name[dsb]=Nowe wokno +Name[el]=Νέο παράθυρο +Name[en_GB]=New Window +Name[en_US]=New Window +Name[en_ZA]=New Window +Name[eo]=Nova fenestro +Name[es_AR]=Nueva ventana +Name[es_CL]=Nueva ventana +Name[es_ES]=Nueva ventana +Name[es_MX]=Nueva ventana +Name[et]=Uus aken +Name[eu]=Leiho berria +Name[fa]=پنجره جدید‌ +Name[ff]=Henorde Hesere +Name[fi]=Uusi ikkuna +Name[fr]=Nouvelle fenêtre +Name[fy_NL]=Nij finster +Name[ga_IE]=Fuinneog Nua +Name[gd]=Uinneag ùr +Name[gl]=Nova xanela +Name[gn]=Ovetã pyahu +Name[gu_IN]=નવી વિન્ડો +Name[he]=חלון חדש +Name[hi_IN]=नया विंडो +Name[hr]=Novi prozor +Name[hsb]=Nowe wokno +Name[hu]=Új ablak +Name[hy_AM]=Նոր Պատուհան +Name[id]=Jendela Baru +Name[is]=Nýr gluggi +Name[it]=Nuova finestra +Name[ja]=新しいウィンドウ +Name[ja_JP-mac]=新規ウインドウ +Name[ka]=ახალი ფანჯარა +Name[kk]=Жаңа терезе +Name[km]=បង្អួច​​​ថ្មី +Name[kn]=ಹೊಸ ಕಿಟಕಿ +Name[ko]=새 창 +Name[kok]=नवें जनेल +Name[ks]=نئئ وِنڈو +Name[lij]=Neuvo barcon +Name[lo]=ຫນ້າຕ່າງໃຫມ່ +Name[lt]=Naujas langas +Name[ltg]=Jauns lūgs +Name[lv]=Jauns logs +Name[mai]=नव विंडो +Name[mk]=Нов прозорец +Name[ml]=പുതിയ ജാലകം +Name[mr]=नवीन पटल +Name[ms]=Tetingkap Baru +Name[my]=ဝင်းဒိုးအသစ် +Name[nb_NO]=Nytt vindu +Name[ne_NP]=नयाँ सञ्झ्याल +Name[nl]=Nieuw venster +Name[nn_NO]=Nytt vindauge +Name[or]=ନୂତନ ୱିଣ୍ଡୋ +Name[pa_IN]=ਨਵੀਂ ਵਿੰਡੋ +Name[pl]=Nowe okno +Name[pt_BR]=Nova janela +Name[pt_PT]=Nova janela +Name[rm]=Nova fanestra +Name[ro]=Fereastră nouă +Name[ru]=Новое окно +Name[sat]=नावा विंडो (N) +Name[si]=නව කවුළුවක් +Name[sk]=Nové okno +Name[sl]=Novo okno +Name[son]=Zanfun taaga +Name[sq]=Dritare e Re +Name[sr]=Нови прозор +Name[sv_SE]=Nytt fönster +Name[ta]=புதிய சாளரம் +Name[te]=కొత్త విండో +Name[th]=หน้าต่างใหม่ +Name[tr]=Yeni pencere +Name[tsz]=Eraatarakua jimpani +Name[uk]=Нове вікно +Name[ur]=نیا دریچہ +Name[uz]=Yangi oyna +Name[vi]=Cửa sổ mới +Name[wo]=Palanteer bu bees +Name[xh]=Ifestile entsha +Name[zh_CN]=新建窗口 +Name[zh_TW]=開新視窗 +Exec=firefox --new-window %u + +[Desktop Action new-private-window] +Name=Open a New Private Window +Name[ach]=Dirica manyen me mung +Name[af]=Nuwe privaatvenster +Name[an]=Nueva finestra privada +Name[ar]=نافذة خاصة جديدة +Name[as]=নতুন ব্যক্তিগত উইন্ডো +Name[ast]=Ventana privada nueva +Name[az]=Yeni Məxfi Pəncərə +Name[be]=Новае акно адасаблення +Name[bg]=Нов прозорец за поверително сърфиране +Name[bn_BD]=নতুন ব্যক্তিগত উইন্ডো +Name[bn_IN]=নতুন ব্যক্তিগত উইন্ডো +Name[br]=Prenestr merdeiñ prevez nevez +Name[brx]=गोदान प्राइभेट उइन्ड' +Name[bs]=Novi privatni prozor +Name[ca]=Finestra privada nova +Name[cak]=K'ak'a' ichinan tzuwäch +Name[cs]=Nové anonymní okno +Name[cy]=Ffenestr Breifat Newydd +Name[da]=Nyt privat vindue +Name[de]=Neues privates Fenster +Name[dsb]=Nowe priwatne wokno +Name[el]=Νέο παράθυρο ιδιωτικής περιήγησης +Name[en_GB]=New Private Window +Name[en_US]=New Private Window +Name[en_ZA]=New Private Window +Name[eo]=Nova privata fenestro +Name[es_AR]=Nueva ventana privada +Name[es_CL]=Nueva ventana privada +Name[es_ES]=Nueva ventana privada +Name[es_MX]=Nueva ventana privada +Name[et]=Uus privaatne aken +Name[eu]=Leiho pribatu berria +Name[fa]=پنجره ناشناس جدید +Name[ff]=Henorde Suturo Hesere +Name[fi]=Uusi yksityinen ikkuna +Name[fr]=Nouvelle fenêtre de navigation privée +Name[fy_NL]=Nij priveefinster +Name[ga_IE]=Fuinneog Nua Phríobháideach +Name[gd]=Uinneag phrìobhaideach ùr +Name[gl]=Nova xanela privada +Name[gn]=Ovetã ñemi pyahu +Name[gu_IN]=નવી ખાનગી વિન્ડો +Name[he]=חלון פרטי חדש +Name[hi_IN]=नयी निजी विंडो +Name[hr]=Novi privatni prozor +Name[hsb]=Nowe priwatne wokno +Name[hu]=Új privát ablak +Name[hy_AM]=Սկսել Գաղտնի դիտարկում +Name[id]=Jendela Mode Pribadi Baru +Name[is]=Nýr huliðsgluggi +Name[it]=Nuova finestra anonima +Name[ja]=新しいプライベートウィンドウ +Name[ja_JP-mac]=新規プライベートウインドウ +Name[ka]=ახალი პირადი ფანჯარა +Name[kk]=Жаңа жекелік терезе +Name[km]=បង្អួច​ឯកជន​ថ្មី +Name[kn]=ಹೊಸ ಖಾಸಗಿ ಕಿಟಕಿ +Name[ko]=새 사생활 보호 모드 +Name[kok]=नवो खाजगी विंडो +Name[ks]=نْو پرایوٹ وینڈو& +Name[lij]=Neuvo barcon privou +Name[lo]=ເປີດຫນ້າຕ່າງສວນຕົວຂື້ນມາໃຫມ່ +Name[lt]=Naujas privataus naršymo langas +Name[ltg]=Jauns privatais lūgs +Name[lv]=Jauns privātais logs +Name[mai]=नया निज विंडो (W) +Name[mk]=Нов приватен прозорец +Name[ml]=പുതിയ സ്വകാര്യ ജാലകം +Name[mr]=नवीन वैयक्तिक पटल +Name[ms]=Tetingkap Persendirian Baharu +Name[my]=New Private Window +Name[nb_NO]=Nytt privat vindu +Name[ne_NP]=नयाँ निजी सञ्झ्याल +Name[nl]=Nieuw privévenster +Name[nn_NO]=Nytt privat vindauge +Name[or]=ନୂତନ ବ୍ୟକ୍ତିଗତ ୱିଣ୍ଡୋ +Name[pa_IN]=ਨਵੀਂ ਪ੍ਰਾਈਵੇਟ ਵਿੰਡੋ +Name[pl]=Nowe okno prywatne +Name[pt_BR]=Nova janela privativa +Name[pt_PT]=Nova janela privada +Name[rm]=Nova fanestra privata +Name[ro]=Fereastră privată nouă +Name[ru]=Новое приватное окно +Name[sat]=नावा निजेराक् विंडो (W ) +Name[si]=නව පුද්ගලික කවුළුව (W) +Name[sk]=Nové okno v režime Súkromné prehliadanie +Name[sl]=Novo zasebno okno +Name[son]=Sutura zanfun taaga +Name[sq]=Dritare e Re Private +Name[sr]=Нови приватан прозор +Name[sv_SE]=Nytt privat fönster +Name[ta]=புதிய தனிப்பட்ட சாளரம் +Name[te]=కొత్త ఆంతరంగిక విండో +Name[th]=หน้าต่างส่วนตัวใหม่ +Name[tr]=Yeni gizli pencere +Name[tsz]=Juchiiti eraatarakua jimpani +Name[uk]=Приватне вікно +Name[ur]=نیا نجی دریچہ +Name[uz]=Yangi maxfiy oyna +Name[vi]=Cửa sổ riêng tư mới +Name[wo]=Panlanteeru biir bu bees +Name[xh]=Ifestile yangasese entsha +Name[zh_CN]=新建隐私浏览窗口 +Name[zh_TW]=新增隱私視窗 +Exec=firefox --private-window %u + +[Desktop Action profile-manager-window] +Name=Open the Profile Manager +Name[cs]=Správa profilů +Name[de]=Profilverwaltung öffnen +Name[fr]=Ouvrir le gestionnaire de profils +Exec=firefox --ProfileManager diff --git a/org.mozilla.firefox.search-provider.ini b/org.mozilla.firefox.search-provider.ini index b2a0460..0211665 100644 --- a/org.mozilla.firefox.search-provider.ini +++ b/org.mozilla.firefox.search-provider.ini @@ -1,5 +1,5 @@ [Shell Search Provider] -DesktopId=firefox.desktop +DesktopId=org.mozilla.firefox.desktop BusName=org.mozilla.firefox.SearchProvider ObjectPath=/org/mozilla/firefox/SearchProvider Version=2 From d14fa011f0cb5f7294e888be6a66ebc32b216a20 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 19 Dec 2023 09:56:23 +0100 Subject: [PATCH 289/545] Added Wayland proxy cache (mzbz#1743144) --- D196554.diff | 834 +++++++++++++++++++++++++++++++++++++++++++++++++++ D196555.diff | 109 +++++++ D196556.diff | 29 ++ firefox.spec | 8 +- 4 files changed, 979 insertions(+), 1 deletion(-) create mode 100644 D196554.diff create mode 100644 D196555.diff create mode 100644 D196556.diff diff --git a/D196554.diff b/D196554.diff new file mode 100644 index 0000000..b971f28 --- /dev/null +++ b/D196554.diff @@ -0,0 +1,834 @@ +diff --git a/third_party/wayland-proxy/moz.build b/third_party/wayland-proxy/moz.build +new file mode 100644 +--- /dev/null ++++ b/third_party/wayland-proxy/moz.build +@@ -0,0 +1,16 @@ ++# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- ++# vim: set filetype=python: ++# This Source Code Form is subject to the terms of the Mozilla Public ++# License, v. 2.0. If a copy of the MPL was not distributed with this ++# file, You can obtain one at http://mozilla.org/MPL/2.0/. ++ ++with Files("**"): ++ BUG_COMPONENT = ("Core", "Widget: Gtk") ++ ++SOURCES += [ ++ "wayland-proxy.cpp", ++] ++EXPORTS += [ ++ "wayland-proxy.h", ++] ++FINAL_LIBRARY = "xul" +diff --git a/third_party/wayland-proxy/wayland-proxy.h b/third_party/wayland-proxy/wayland-proxy.h +new file mode 100644 +--- /dev/null ++++ b/third_party/wayland-proxy/wayland-proxy.h +@@ -0,0 +1,54 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- ++ * This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#ifndef _wayland_proxy_h_ ++#define _wayland_proxy_h_ ++ ++#include ++#include ++#include ++#include ++ ++typedef unsigned char byte; ++ ++class ProxiedConnection; ++ ++class WaylandProxy { ++ public: ++ ++ static std::unique_ptr Create(); ++ ++ bool RunChildApplication(char* argv[]); ++ bool RunThread(); ++ ++ void SetWaylandDisplay(); ++ void SetVerbose(bool aVerbose); ++ ++ ~WaylandProxy(); ++ ++ private: ++ bool Init(); ++ void Run(); ++ ++ void SetWaylandProxyDisplay(); ++ static void* RunProxyThread(WaylandProxy* aProxy); ++ ++ bool SetupWaylandDisplays(); ++ bool StartProxyServer(); ++ bool IsChildAppTerminated(); ++ ++ bool PollConnections(); ++ bool ProcessConnections(); ++ ++ private: ++ // List of all Compositor <-> Application connections ++ std::vector> mConnections; ++ int mProxyServerSocket = -1; ++ pid_t mApplicationPID = 0; ++ std::atomic mThreadRunning = false; ++ pthread_t mThread; ++}; ++ ++#endif // _wayland_proxy_h_ +diff --git a/third_party/wayland-proxy/wayland-proxy.cpp b/third_party/wayland-proxy/wayland-proxy.cpp +new file mode 100644 +--- /dev/null ++++ b/third_party/wayland-proxy/wayland-proxy.cpp +@@ -0,0 +1,731 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- ++ * This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++// This code is based on Rust implementation at ++// https://github.com/the8472/weyland-p5000 ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "wayland-proxy.h" ++ ++// The maximum number of fds libwayland can recvmsg at once ++#define MAX_LIBWAY_FDS 28 ++#define MAX_DATA_SIZE 4096 ++#define POLL_TIMEOUT 30000 ++ ++// sockaddr_un has hardcoded max len of sun_path ++#define MAX_WAYLAND_DISPLAY_NAME_LEN 108 ++ ++// Name of Wayland display provided by compositor ++char sWaylandDisplay[MAX_WAYLAND_DISPLAY_NAME_LEN]; ++ ++// Name of Wayland display provided by us ++char sWaylandProxy[MAX_WAYLAND_DISPLAY_NAME_LEN]; ++ ++bool sPrintInfo = false; ++ ++void Info(const char* aFormat, ...) { ++ if (!sPrintInfo) { ++ return; ++ } ++ va_list args; ++ va_start(args, aFormat); ++ vfprintf(stderr, aFormat, args); ++ va_end(args); ++} ++ ++void Warning(const char* aOperation, bool aPrintErrno = true) { ++ fprintf(stderr, "Wayland Proxy warning: %s : %s\n", aOperation, ++ aPrintErrno ? strerror(errno) : ""); ++} ++ ++void Error(const char* aOperation, bool aPrintErrno = true) { ++ fprintf(stderr, "Wayland Proxy error: %s : %s\n", aOperation, ++ aPrintErrno ? strerror(errno) : ""); ++} ++ ++void ErrorPlain(const char* aFormat, ...) { ++ va_list args; ++ va_start(args, aFormat); ++ vfprintf(stderr, aFormat, args); ++ va_end(args); ++} ++ ++class WaylandMessage { ++ public: ++ bool Write(int aSocket); ++ ++ bool Loaded() { return mLoaded && (mFds.size() || mData.size()); } ++ bool Failed() { return mFailed; } ++ ++ explicit WaylandMessage(int aSocket) { Read(aSocket); } ++ ~WaylandMessage(); ++ ++ private: ++ bool Read(int aSocket); ++ ++ private: ++ bool mLoaded = false; ++ bool mFailed = false; ++ ++ std::vector mFds; ++ std::vector mData; ++}; ++ ++class ProxiedConnection { ++ public: ++ bool Init(int aChildSocket); ++ ++ struct pollfd* AddToPollFd(struct pollfd* aPfds); ++ struct pollfd* LoadPollFd(struct pollfd* aPfds); ++ ++ // Process this connection (send/receive data). ++ // Returns false if connection is broken and should be removed. ++ bool Process(); ++ ++ ~ProxiedConnection(); ++ ++ private: ++ // Try to connect to compositor. Returns false in case of fatal error. ++ bool ConnectToCompositor(); ++ ++ bool TransferOrQueue( ++ int aSourceSocket, int aSourcePollFlags, int aDestSocket, ++ std::vector>* aMessageQueue); ++ bool FlushQueue(int aDestSocket, int aDestPollFlags, ++ std::vector>& aMessageQueue); ++ ++ // We don't have connected compositor yet. Try to connect ++ bool mCompositorConnected = false; ++ ++ // We're disconnected from app or compositor. We will close this connection. ++ bool mFailed = false; ++ ++ int mCompositorSocket = -1; ++ int mCompositorFlags = 0; ++ ++ int mApplicationSocket = -1; ++ int mApplicationFlags = 0; ++ ++ // Stored proxied data ++ std::vector> mToCompositorQueue; ++ std::vector> mToApplicationQueue; ++}; ++ ++WaylandMessage::~WaylandMessage() { ++ for (auto const fd : mFds) { ++ close(fd); ++ } ++} ++ ++bool WaylandMessage::Read(int aSocket) { ++ // We don't expect WaylandMessage re-read ++ assert(!mLoaded && !mFailed); ++ ++ mData.resize(MAX_DATA_SIZE); ++ ++ struct msghdr msg = {0}; ++ struct iovec iov = {mData.data(), mData.size()}; ++ msg.msg_iov = &iov; ++ msg.msg_iovlen = 1; ++ ++ char cmsgdata[(CMSG_LEN(MAX_LIBWAY_FDS * sizeof(int32_t)))] = {0}; ++ msg.msg_control = &cmsgdata; ++ msg.msg_controllen = sizeof(cmsgdata); ++ ++ ssize_t ret = recvmsg(aSocket, &msg, MSG_CMSG_CLOEXEC | MSG_DONTWAIT); ++ if (msg.msg_flags & (MSG_CTRUNC | MSG_TRUNC)) { ++ Error("WaylandMessage::Read() data truncated, small buffer?"); ++ mFailed = true; ++ return false; ++ } ++ ++ if (ret < 1) { ++ switch (errno) { ++ case EAGAIN: ++ case EINTR: ++ // Neither loaded nor failed, we'll try again later ++ Info("WaylandMessage::Write() failed %s\n", strerror(errno)); ++ return false; ++ default: ++ Error("WaylandMessage::Write() failed"); ++ mFailed = true; ++ return false; ++ } ++ } ++ ++ // Set correct data size ++ mData.resize(ret); ++ ++ // Read cmsg ++ struct cmsghdr* header = CMSG_FIRSTHDR(&msg); ++ while (header) { ++ struct cmsghdr* next = CMSG_NXTHDR(&msg, header); ++ if (header->cmsg_level != SOL_SOCKET || header->cmsg_type != SCM_RIGHTS) { ++ header = next; ++ continue; ++ } ++ ++ int* data = (int*)CMSG_DATA(header); ++ int filenum = (int)((header->cmsg_len - CMSG_LEN(0)) / sizeof(int)); ++ for (int i = 0; i < filenum; i++) { ++#ifdef DEBUG ++ int flags = fcntl(data[i], F_GETFL, 0); ++ if (flags == -1 && errno == EBADF) { ++ Error("WaylandMessage::Read() invalid fd"); ++ } ++#endif ++ mFds.push_back(data[i]); ++ } ++ header = next; ++ } ++ ++ mLoaded = true; ++ return true; ++} ++ ++bool WaylandMessage::Write(int aSocket) { ++ if (!mLoaded || mFailed) { ++ return false; ++ } ++ ++ struct msghdr msg = {0}; ++ struct iovec iov = {mData.data(), mData.size()}; ++ msg.msg_iov = &iov; ++ msg.msg_iovlen = 1; ++ ++ int filenum = mFds.size(); ++ if (filenum) { ++ if (filenum >= MAX_LIBWAY_FDS) { ++ Error("WaylandMessage::Write() too many files to send\n", false); ++ return false; ++ } ++#ifdef DEBUG ++ for (int i = 0; i < filenum; i++) { ++ int flags = fcntl(mFds[i], F_GETFL, 0); ++ if (flags == -1 && errno == EBADF) { ++ Error("WaylandMessage::Write() invalid fd\n"); ++ } ++ } ++#endif ++ union { ++ char buf[CMSG_SPACE(sizeof(int) * MAX_LIBWAY_FDS)]; ++ struct cmsghdr align; ++ } cmsgu; ++ memset(cmsgu.buf, 0, sizeof(cmsgu.buf)); ++ ++ msg.msg_control = cmsgu.buf; ++ msg.msg_controllen = sizeof(cmsgu.buf); ++ msg.msg_controllen = CMSG_SPACE(filenum * sizeof(int)); ++ ++ struct cmsghdr* cmsg = CMSG_FIRSTHDR(&msg); ++ cmsg->cmsg_level = SOL_SOCKET; ++ cmsg->cmsg_type = SCM_RIGHTS; ++ cmsg->cmsg_len = CMSG_LEN(filenum * sizeof(int)); ++ memcpy(CMSG_DATA(cmsg), mFds.data(), filenum * sizeof(int)); ++ } ++ ++ ssize_t ret = sendmsg(aSocket, &msg, MSG_CMSG_CLOEXEC | MSG_DONTWAIT); ++ if (ret < 1) { ++ switch (errno) { ++ case EAGAIN: ++ case EINTR: ++ // Neither loaded nor failed, we'll try again later ++ Info("WaylandMessage::Write() failed %s\n", strerror(errno)); ++ return false; ++ default: ++ Warning("WaylandMessage::Write() failed"); ++ mFailed = true; ++ return false; ++ } ++ } ++ ++ if (ret != (ssize_t)mData.size()) { ++ Info("WaylandMessage::Write() failed to write all data! (%d vs. %d)\n", ret, ++ mData.size()); ++ } ++ return true; ++} ++ ++ProxiedConnection::~ProxiedConnection() { ++ if (mCompositorSocket != -1) { ++ close(mCompositorSocket); ++ } ++ if (mApplicationSocket != -1) { ++ close(mApplicationSocket); ++ } ++} ++ ++bool ProxiedConnection::Init(int aApplicationSocket) { ++ mApplicationSocket = aApplicationSocket; ++ mCompositorSocket = ++ socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK | SOCK_CLOEXEC, 0); ++ if (mCompositorSocket == -1) { ++ Error("ConnectToCompositor() socket()"); ++ } ++ return mApplicationSocket > 0 && mCompositorSocket > 0; ++} ++ ++struct pollfd* ProxiedConnection::AddToPollFd(struct pollfd* aPfds) { ++ // Listen application's requests ++ aPfds->fd = mApplicationSocket; ++ aPfds->events = POLLIN; ++ ++ // We're connected and we have data for appplication from compositor. ++ // Add POLLOUT to request write to app socket. ++ if (mCompositorConnected && mToApplicationQueue.size()) { ++ aPfds->events |= POLLOUT; ++ } ++ aPfds++; ++ ++ aPfds->fd = mCompositorSocket; ++ // We're waiting for connection or we have data for compositor ++ if (!mCompositorConnected || mToCompositorQueue.size()) { ++ aPfds->events |= POLLOUT; ++ } ++ if (mCompositorConnected) { ++ aPfds->events = POLLIN; ++ } ++ aPfds++; ++ ++ return aPfds; ++} ++ ++struct pollfd* ProxiedConnection::LoadPollFd(struct pollfd* aPfds) { ++ if (aPfds->fd != mApplicationSocket) { ++ return aPfds; ++ } ++ mApplicationFlags = aPfds->revents; ++ aPfds++; ++ mCompositorFlags = aPfds->revents; ++ aPfds++; ++ return aPfds; ++} ++ ++bool ProxiedConnection::ConnectToCompositor() { ++ if (!(mCompositorFlags & POLLOUT)) { ++ // Try again later ++ return true; ++ } ++ ++ struct sockaddr_un addr = {}; ++ addr.sun_family = AF_UNIX; ++ strcpy(addr.sun_path, sWaylandDisplay); ++ ++ mCompositorConnected = ++ connect(mCompositorSocket, (const struct sockaddr*)&addr, ++ sizeof(struct sockaddr_un)) != -1; ++ if (!mCompositorConnected) { ++ switch (errno) { ++ case EAGAIN: ++ case EALREADY: ++ case ECONNREFUSED: ++ case EINPROGRESS: ++ case EINTR: ++ case EISCONN: ++ case ETIMEDOUT: ++ // We can recover from these errors and try again ++ Warning("ConnectToCompositor() try again"); ++ return true; ++ default: ++ Error("ConnectToCompositor() connect()"); ++ return false; ++ } ++ } ++ return true; ++} ++ ++// Read data from aSourceSocket and try to twite them to aDestSocket. ++// If data write fails, append them to aMessageQueue. ++// Return ++bool ProxiedConnection::TransferOrQueue( ++ int aSourceSocket, int aSourcePollFlags, int aDestSocket, ++ std::vector>* aMessageQueue) { ++ // Don't read if we don't have any data ready ++ if (!(aSourcePollFlags & POLLIN)) { ++ return true; ++ } ++ ++ while (1) { ++ int availableData = 0; ++ if (ioctl(aSourceSocket, FIONREAD, &availableData) < 0) { ++ // Broken connection, we're finished here ++ Warning("ProxiedConnection::TransferOrQueue() broken source socket %s\n"); ++ return false; ++ } ++ if (availableData == 0) { ++ return true; ++ } ++ ++ auto message = std::make_unique(aSourceSocket); ++ if (message->Failed()) { ++ // Failed to read message due to error ++ return false; ++ } ++ if (!message->Loaded()) { ++ // Let's try again ++ return true; ++ } ++ if (!message->Write(aDestSocket)) { ++ if (message->Failed()) { ++ // Failed to write and we can't recover ++ return false; ++ } ++ aMessageQueue->push_back(std::move(message)); ++ } ++ } ++} ++ ++// Try to flush all data to aMessageQueue. ++bool ProxiedConnection::FlushQueue( ++ int aDestSocket, int aDestPollFlags, ++ std::vector>& aMessageQueue) { ++ // Can't write to destination yet ++ if (!(aDestPollFlags & POLLOUT)) { ++ return true; ++ } ++ ++ while (aMessageQueue.size()) { ++ if (!aMessageQueue[0]->Write(aDestSocket)) { ++ return !aMessageQueue[0]->Failed(); ++ } ++ aMessageQueue.erase(aMessageQueue.begin()); ++ } ++ return true; ++} ++ ++bool ProxiedConnection::Process() { ++ if (mFailed) { ++ return false; ++ } ++ ++ // Check if appplication is still listening ++ if (mApplicationFlags & (POLLHUP | POLLERR)) { ++ return false; ++ } ++ ++ // Check if compositor is still listening ++ if (mCompositorConnected) { ++ if (mCompositorFlags & (POLLHUP | POLLERR)) { ++ return false; ++ } ++ } else { ++ // Try to reconnect to compositor. ++ if (!ConnectToCompositor()) { ++ return false; ++ } ++ // We're not connected yet but ConnectToCompositor() didn't return ++ // fatal error. Try again later. ++ if (!mCompositorConnected) { ++ return true; ++ } ++ } ++ ++ mFailed = ++ !TransferOrQueue(mCompositorSocket, mCompositorFlags, mApplicationSocket, ++ &mToApplicationQueue) || ++ !TransferOrQueue(mApplicationSocket, mApplicationFlags, mCompositorSocket, ++ &mToCompositorQueue) || ++ !FlushQueue(mCompositorSocket, mCompositorFlags, mToCompositorQueue) || ++ !FlushQueue(mApplicationSocket, mApplicationFlags, mToApplicationQueue); ++ ++ return !mFailed; ++} ++ ++bool WaylandProxy::SetupWaylandDisplays() { ++ char* waylandDisplay = getenv("WAYLAND_DISPLAY"); ++ if (!waylandDisplay) { ++ Error("Init(), Missing Wayland display, WAYLAND_DISPLAY is empty.", false); ++ return false; ++ } ++ ++ char* XDGRuntimeDir = getenv("XDG_RUNTIME_DIR"); ++ if (!XDGRuntimeDir) { ++ Error("Init() Missing XDG_RUNTIME_DIR", false); ++ return false; ++ } ++ ++ // WAYLAND_DISPLAY can be absolute path ++ if (waylandDisplay[0] == '/') { ++ if (strlen(sWaylandDisplay) >= MAX_WAYLAND_DISPLAY_NAME_LEN) { ++ Error("Init() WAYLAND_DISPLAY is too large.", false); ++ return false; ++ } ++ strcpy(sWaylandDisplay, waylandDisplay); ++ } else { ++ int ret = snprintf(sWaylandDisplay, MAX_WAYLAND_DISPLAY_NAME_LEN, "%s/%s", ++ XDGRuntimeDir, waylandDisplay); ++ if (ret < 0 || ret >= MAX_WAYLAND_DISPLAY_NAME_LEN) { ++ Error("Init() WAYLAND_DISPLAY/XDG_RUNTIME_DIR is too large.", false); ++ return false; ++ } ++ } ++ int ret = snprintf(sWaylandProxy, MAX_WAYLAND_DISPLAY_NAME_LEN, ++ "%s/wayland-proxy-%d", XDGRuntimeDir, getpid()); ++ if (ret < 0 || ret >= MAX_WAYLAND_DISPLAY_NAME_LEN) { ++ Error("Init() WAYLAND_DISPLAY/XDG_RUNTIME_DIR is too large.", false); ++ return false; ++ } ++ ++ return true; ++} ++ ++bool WaylandProxy::StartProxyServer() { ++ mProxyServerSocket = ++ socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK | SOCK_CLOEXEC, 0); ++ if (mProxyServerSocket == -1) { ++ Error("StartProxyServer(): failed to create socket"); ++ return false; ++ } ++ ++ struct sockaddr_un serverName = {0}; ++ serverName.sun_family = AF_UNIX; ++ strcpy(serverName.sun_path, sWaylandProxy); ++ ++ if (bind(mProxyServerSocket, (struct sockaddr*)&serverName, ++ sizeof(serverName)) == -1) { ++ Error("StartProxyServer(): bind() error"); ++ return false; ++ } ++ if (listen(mProxyServerSocket, 128) == -1) { ++ Error("StartProxyServer(): listen() error"); ++ return false; ++ } ++ ++ return true; ++} ++ ++bool WaylandProxy::Init() { ++ if (!SetupWaylandDisplays()) { ++ return false; ++ } ++ ++ if (!StartProxyServer()) { ++ return false; ++ } ++ return true; ++} ++ ++void WaylandProxy::SetWaylandProxyDisplay() { ++ setenv("WAYLAND_DISPLAY", sWaylandProxy, true); ++} ++ ++void WaylandProxy::SetWaylandDisplay() { ++ setenv("WAYLAND_DISPLAY", sWaylandDisplay, true); ++} ++ ++bool WaylandProxy::IsChildAppTerminated() { ++ if (!mApplicationPID) { ++ return false; ++ } ++ int status = 0; ++ int ret = waitpid(mApplicationPID, &status, WNOHANG | WUNTRACED | WCONTINUED); ++ if (ret == 0) { ++ return false; ++ } ++ if (ret == mApplicationPID) { ++ // Child application is terminated, so quit too. ++ return true; ++ } ++ bool terminate = (errno == ECHILD); ++ Error("IsChildAppTerminated: waitpid() error"); ++ return terminate; ++} ++ ++bool WaylandProxy::PollConnections() { ++ int nfds_max = mConnections.size() * 2 + 1; ++ ++ struct pollfd pollfds[nfds_max]; ++ struct pollfd* addedPollfd = pollfds; ++ ++ for (auto const& connection : mConnections) { ++ addedPollfd = connection->AddToPollFd(addedPollfd); ++ } ++ ++ // Add extra listening socket ++ addedPollfd->fd = mProxyServerSocket; ++ addedPollfd->events = POLLIN; ++ assert(addedPollfd < pollfds + nfds_max); ++ ++ int nfds = (addedPollfd - pollfds) + 1; ++ ++ while (1) { ++ int ret = poll(pollfds, nfds, POLL_TIMEOUT); ++ if (ret == 0) { ++ // No change on fds ++ continue; ++ } else if (ret > 0) { ++ // We have FD to read ++ break; ++ } else if (ret == -1) { ++ switch (errno) { ++ case EINTR: ++ case EAGAIN: ++ if (IsChildAppTerminated()) { ++ return false; ++ } ++ continue; ++ default: ++ Error("Run: poll() error"); ++ return false; ++ } ++ } ++ } ++ ++ struct pollfd* loadedPollfd = pollfds; ++ for (auto const& connection : mConnections) { ++ loadedPollfd = connection->LoadPollFd(loadedPollfd); ++ } ++ ++ assert(loadedPollfd == addedPollfd); ++ assert(loadedPollfd < pollfds + nfds_max); ++ ++ // Create a new connection if there's a new client waiting ++ if (loadedPollfd->revents & POLLIN) { ++ Info("WaylandProxy: new child connection\n"); ++ int applicationSocket = accept4(loadedPollfd->fd, nullptr, nullptr, ++ SOCK_NONBLOCK | SOCK_CLOEXEC); ++ if (applicationSocket == -1) { ++ switch (errno) { ++ case EAGAIN: ++ case EINTR: ++ // Try again later ++ break; ++ default: ++ Error("Faild to accept connection from application"); ++ return false; ++ } ++ } else { ++ auto connection = std::make_unique(); ++ if (connection->Init(applicationSocket)) { ++ mConnections.push_back(std::move(connection)); ++ } ++ } ++ } ++ ++ return true; ++} ++ ++bool WaylandProxy::ProcessConnections() { ++ std::vector>::iterator connection; ++ for (connection = mConnections.begin(); connection != mConnections.end();) { ++ if (!(*connection)->Process()) { ++ Info("WaylandProxy: remove connection\n"); ++ connection = mConnections.erase(connection); ++ if (!mConnections.size()) { ++ // We removed last connection - quit. ++ Info("WaylandProxy: removed last connection, quit\n"); ++ return false; ++ } ++ } else { ++ connection++; ++ } ++ } ++ return true; ++} ++ ++void WaylandProxy::Run() { ++ while (!IsChildAppTerminated() && PollConnections() && ProcessConnections()) ++ ; ++} ++ ++WaylandProxy::~WaylandProxy() { ++ Info("WaylandProxy terminated\n"); ++ if (mThreadRunning) { ++ Info("WaylandProxy thread is still running, terminating.\n"); ++ pthread_cancel(mThread); ++ pthread_join(mThread, nullptr); ++ } ++ unlink(sWaylandProxy); ++ if (mProxyServerSocket != -1) { ++ close(mProxyServerSocket); ++ } ++} ++ ++void* WaylandProxy::RunProxyThread(WaylandProxy* aProxy) { ++#ifdef __linux__ ++ pthread_setname_np(pthread_self(), "WaylandProxy"); ++#endif ++ aProxy->Run(); ++ aProxy->mThreadRunning = false; ++ Info("WaylandProxy thread exited\n"); ++ return nullptr; ++} ++ ++std::unique_ptr WaylandProxy::Create() { ++ auto proxy = std::make_unique(); ++ if (!proxy->Init()) { ++ return nullptr; ++ } ++ ++ Info("WaylandProxyCreated, display %s\n", sWaylandProxy); ++ return proxy; ++} ++ ++bool WaylandProxy::RunChildApplication(char* argv[]) { ++ if (!argv[0]) { ++ Error("WaylandProxy::RunChildApplication: missing application to run", false); ++ return false; ++ } ++ ++ mApplicationPID = fork(); ++ if (mApplicationPID == -1) { ++ Error("WaylandProxy::RunChildApplication: fork() error"); ++ return false; ++ } ++ if (mApplicationPID == 0) { ++ SetWaylandProxyDisplay(); ++ if (execv(argv[0], argv) == -1) { ++ ErrorPlain("WaylandProxy::RunChildApplication: failed to run %s error %s\n", argv[0], strerror(errno)); ++ exit(1); ++ } ++ } ++ ++ Run(); ++ return true; ++} ++ ++bool WaylandProxy::RunThread() { ++ pthread_attr_t attr; ++ if (pthread_attr_init(&attr) != 0) { ++ return false; ++ } ++ ++ sched_param param; ++ if (pthread_attr_getschedparam(&attr, ¶m) == 0) { ++ param.sched_priority = sched_get_priority_min(SCHED_RR); ++ pthread_attr_setschedparam(&attr, ¶m); ++ } ++ ++ SetWaylandProxyDisplay(); ++ ++ mThreadRunning = pthread_create(&mThread, nullptr, (void* (*)(void*))RunProxyThread, this) == 0; ++ if (!mThreadRunning) { ++ // If we failed to run proxy thread, set WAYLAND_DISPLAY back. ++ SetWaylandDisplay(); ++ } ++ ++ pthread_attr_destroy(&attr); ++ return mThreadRunning; ++} ++ ++void WaylandProxy::SetVerbose(bool aVerbose) { sPrintInfo = aVerbose; } +diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build +--- a/widget/gtk/moz.build ++++ b/widget/gtk/moz.build +@@ -23,10 +23,13 @@ + DIRS += ["mozgtk"] + + if CONFIG["MOZ_WAYLAND"]: + DIRS += ["wayland", "mozwayland"] + ++if CONFIG["MOZ_WAYLAND_PROXY"]: ++ DIRS += ["../../third_party/wayland-proxy"] ++ + if CONFIG["MOZ_ENABLE_VAAPI"]: + DIRS += ["vaapitest"] + + if CONFIG["MOZ_ENABLE_V4L2"]: + DIRS += ["v4l2test"] + diff --git a/D196555.diff b/D196555.diff new file mode 100644 index 0000000..8d22b29 --- /dev/null +++ b/D196555.diff @@ -0,0 +1,109 @@ +diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp +--- a/toolkit/xre/nsAppRunner.cpp ++++ b/toolkit/xre/nsAppRunner.cpp +@@ -343,16 +343,24 @@ + # include + # ifdef MOZ_WAYLAND + # include + # include "mozilla/widget/nsWaylandDisplay.h" + # endif ++# ifdef MOZ_WAYLAND_PROXY ++# include "wayland-proxy.h" ++# endif + # ifdef MOZ_X11 + # include + # endif /* MOZ_X11 */ + #endif + #include "BinaryPath.h" + ++#ifdef MOZ_LOGGING ++# include "mozilla/Logging.h" ++extern mozilla::LazyLogModule gWidgetWaylandLog; ++#endif /* MOZ_LOGGING */ ++ + #ifdef FUZZING + # include "FuzzerRunner.h" + + namespace mozilla { + FuzzerRunner* fuzzerRunner = 0; +@@ -3670,10 +3678,13 @@ + class XREMain { + public: + XREMain() = default; + + ~XREMain() { ++#if defined(MOZ_WAYLAND_PROXY) ++ mWaylandProxy = nullptr; ++#endif + mScopedXPCOM = nullptr; + mAppData = nullptr; + } + + int XRE_main(int argc, char* argv[], const BootstrapConfig& aConfig); +@@ -3689,10 +3700,13 @@ + nsCOMPtr mProfLD; + nsCOMPtr mProfileLock; + #if defined(MOZ_HAS_REMOTE) + RefPtr mRemoteService; + #endif ++#if defined(MOZ_WAYLAND_PROXY) ++ std::unique_ptr mWaylandProxy; ++#endif + + UniquePtr mScopedXPCOM; + UniquePtr mAppData; + + nsXREDirProvider mDirProvider; +@@ -4709,20 +4723,34 @@ + #if defined(MOZ_WIDGET_GTK) + if (!isBackgroundTaskMode && !gfxPlatform::IsHeadless()) { + const char* display_name = nullptr; + bool saveDisplayArg = false; + ++ bool waylandEnabled = IsWaylandEnabled(); ++# ifdef MOZ_WAYLAND_PROXY ++ auto* proxyEnv = getenv("MOZ_DISABLE_WAYLAND_PROXY"); ++ bool disableWaylandProxy = proxyEnv && *proxyEnv; ++ if (!disableWaylandProxy && XRE_IsParentProcess() && waylandEnabled) { ++ mWaylandProxy = WaylandProxy::Create(); ++ mWaylandProxy->RunThread(); ++# ifdef MOZ_LOGGING ++ if (MOZ_LOG_TEST(gWidgetWaylandLog, mozilla::LogLevel::Debug)) { ++ mWaylandProxy->SetVerbose(true); ++ } ++# endif ++ } ++# endif ++ + // display_name is owned by gdk. + display_name = gdk_get_display_arg_name(); + // if --display argument is given make sure it's + // also passed to ContentChild::Init() by MOZ_GDK_DISPLAY. + if (display_name) { + SaveWordToEnv("MOZ_GDK_DISPLAY", nsDependentCString(display_name)); + saveDisplayArg = true; + } + +- bool waylandEnabled = IsWaylandEnabled(); + // On Wayland disabled builds read X11 DISPLAY env exclusively + // and don't care about different displays. + if (!waylandEnabled && !display_name) { + display_name = PR_GetEnv("DISPLAY"); + if (!display_name) { +@@ -5953,10 +5981,15 @@ + // appropriately when necessary. + if (!gfxPlatform::IsHeadless()) { + # ifdef MOZ_WAYLAND + WaylandDisplayRelease(); + # endif ++# ifdef MOZ_WAYLAND_PROXY ++ if (mWaylandProxy) { ++ mWaylandProxy = nullptr; ++ } ++# endif + } + #endif + + XRE_DeinitCommandLine(); + + diff --git a/D196556.diff b/D196556.diff new file mode 100644 index 0000000..344c373 --- /dev/null +++ b/D196556.diff @@ -0,0 +1,29 @@ +diff --git a/toolkit/moz.configure b/toolkit/moz.configure +--- a/toolkit/moz.configure ++++ b/toolkit/moz.configure +@@ -532,10 +532,24 @@ + + + set_config("MOZ_WAYLAND", depends_if(wayland_headers)(lambda _: True)) + set_define("MOZ_WAYLAND", depends_if(wayland_headers)(lambda _: True)) + ++# Wayland proxy is used as load balancer between Firefox and Wayland ++# compositor. ++# ============================================================== ++option("--disable-wayland-proxy", help="Disable Wayland load balancer") ++ ++ ++@depends("--enable-wayland-proxy", when=toolkit_gtk_wayland) ++def wayland_proxy(value): ++ if value: ++ return True ++ ++ ++set_config("MOZ_WAYLAND_PROXY", wayland_proxy) ++set_define("MOZ_WAYLAND_PROXY", wayland_proxy) + + # Hardware-accelerated video decode with VAAPI and V4L2 on Linux + # ============================================================== + set_config("MOZ_ENABLE_VAAPI", True, when=toolkit_gtk) + set_define("MOZ_ENABLE_VAAPI", True, when=toolkit_gtk) + diff --git a/firefox.spec b/firefox.spec index 9468954..e0d80af 100644 --- a/firefox.spec +++ b/firefox.spec @@ -174,7 +174,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 121.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -254,6 +254,9 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: D167159.diff +Patch409: D196554.diff +Patch410: D196555.diff +Patch411: D196556.diff # PGO/LTO patches Patch600: pgo.patch @@ -1165,6 +1168,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Dec 19 2023 Martin Stransky - 121.0-2 +- Added Wayland proxy cache (mzbz#1743144) + * Mon Dec 18 2023 Martin Stransky - 121.0-2 - Enable Gnome Shell Search provider for Fedora 40+ - Don't ship firefox-x11 and firefox-wayland on Fedora 40+ From 82ad299a883f3b3e16932bf5a3f6b1cb8fc303ef Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 20 Dec 2023 10:47:30 +0100 Subject: [PATCH 290/545] Wayland is enabled by default now --- firefox.sh.in | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/firefox.sh.in b/firefox.sh.in index c72daba..0ab39e9 100644 --- a/firefox.sh.in +++ b/firefox.sh.in @@ -67,20 +67,6 @@ MOZ_PROGRAM="$MOZ_DIST_BIN/$MOZ_FIREFOX_FILE" MOZ_LAUNCHER="$MOZ_DIST_BIN/run-mozilla.sh" GETENFORCE_FILE="/usr/sbin/getenforce" -## -## Enable Wayland backend? -## -if ! [ $MOZ_DISABLE_WAYLAND ] && [ "$WAYLAND_DISPLAY" ]; then - if [ "$XDG_CURRENT_DESKTOP" == "GNOME" ]; then - export MOZ_ENABLE_WAYLAND=1 - fi -## Enable Wayland on KDE/Sway -## - if [ "$XDG_SESSION_TYPE" == "wayland" ]; then - export MOZ_ENABLE_WAYLAND=1 - fi -fi - ## ## Use D-Bus remote exclusively when there's Wayland display. ## From 6b33407501dc542833a5dd69915dd8d714a2dcab Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 22 Dec 2023 12:37:57 +0100 Subject: [PATCH 291/545] Disabled DBus activations --- firefox.spec | 5 ++++- org.mozilla.firefox.desktop | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index e0d80af..d305236 100644 --- a/firefox.spec +++ b/firefox.spec @@ -174,7 +174,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 121.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1168,6 +1168,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Dec 22 2023 Martin Stransky - 121.0-3 +- Disabled DBus activations + * Tue Dec 19 2023 Martin Stransky - 121.0-2 - Added Wayland proxy cache (mzbz#1743144) diff --git a/org.mozilla.firefox.desktop b/org.mozilla.firefox.desktop index 66c22dd..7ac44d7 100644 --- a/org.mozilla.firefox.desktop +++ b/org.mozilla.firefox.desktop @@ -51,7 +51,7 @@ StartupNotify=true Categories=Network;WebBrowser; Keywords=web;browser;internet; Actions=new-window;new-private-window;profile-manager-window; -DBusActivatable=true +DBusActivatable=false [Desktop Action new-window] Name=Open a New Window From 55e1497866bdc762b4fe89569d93bdc01a16b5ab Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 2 Jan 2024 15:08:13 +0100 Subject: [PATCH 292/545] Updated proxy cache --- D196556.diff | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 D196556.diff diff --git a/D196556.diff b/D196556.diff deleted file mode 100644 index 344c373..0000000 --- a/D196556.diff +++ /dev/null @@ -1,29 +0,0 @@ -diff --git a/toolkit/moz.configure b/toolkit/moz.configure ---- a/toolkit/moz.configure -+++ b/toolkit/moz.configure -@@ -532,10 +532,24 @@ - - - set_config("MOZ_WAYLAND", depends_if(wayland_headers)(lambda _: True)) - set_define("MOZ_WAYLAND", depends_if(wayland_headers)(lambda _: True)) - -+# Wayland proxy is used as load balancer between Firefox and Wayland -+# compositor. -+# ============================================================== -+option("--disable-wayland-proxy", help="Disable Wayland load balancer") -+ -+ -+@depends("--enable-wayland-proxy", when=toolkit_gtk_wayland) -+def wayland_proxy(value): -+ if value: -+ return True -+ -+ -+set_config("MOZ_WAYLAND_PROXY", wayland_proxy) -+set_define("MOZ_WAYLAND_PROXY", wayland_proxy) - - # Hardware-accelerated video decode with VAAPI and V4L2 on Linux - # ============================================================== - set_config("MOZ_ENABLE_VAAPI", True, when=toolkit_gtk) - set_define("MOZ_ENABLE_VAAPI", True, when=toolkit_gtk) - From 5d26feb54833974e37fbf31d07d2ddf59538a157 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 2 Jan 2024 15:22:55 +0100 Subject: [PATCH 293/545] Really enable proxy cache --- D196554.diff | 47 +++++++++++++++++++---------- D196555.diff | 84 +++++++++++++++++++++++++++------------------------- firefox.spec | 8 +++-- 3 files changed, 80 insertions(+), 59 deletions(-) diff --git a/D196554.diff b/D196554.diff index b971f28..158b7c1 100644 --- a/D196554.diff +++ b/D196554.diff @@ -23,7 +23,7 @@ diff --git a/third_party/wayland-proxy/wayland-proxy.h b/third_party/wayland-pro new file mode 100644 --- /dev/null +++ b/third_party/wayland-proxy/wayland-proxy.h -@@ -0,0 +1,54 @@ +@@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -36,6 +36,7 @@ new file mode 100644 +#include +#include +#include ++#include + +typedef unsigned char byte; + @@ -50,7 +51,7 @@ new file mode 100644 + bool RunThread(); + + void SetWaylandDisplay(); -+ void SetVerbose(bool aVerbose); ++ static void SetVerbose(bool aVerbose); + + ~WaylandProxy(); + @@ -82,7 +83,7 @@ diff --git a/third_party/wayland-proxy/wayland-proxy.cpp b/third_party/wayland-p new file mode 100644 --- /dev/null +++ b/third_party/wayland-proxy/wayland-proxy.cpp -@@ -0,0 +1,731 @@ +@@ -0,0 +1,742 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -91,6 +92,8 @@ new file mode 100644 +// This code is based on Rust implementation at +// https://github.com/the8472/weyland-p5000 + ++// Version 1.0 ++ +#include +#include +#include @@ -179,6 +182,7 @@ new file mode 100644 +class ProxiedConnection { + public: + bool Init(int aChildSocket); ++ bool IsConnected() { return mCompositorConnected; } + + struct pollfd* AddToPollFd(struct pollfd* aPfds); + struct pollfd* LoadPollFd(struct pollfd* aPfds); @@ -365,7 +369,7 @@ new file mode 100644 + mCompositorSocket = + socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK | SOCK_CLOEXEC, 0); + if (mCompositorSocket == -1) { -+ Error("ConnectToCompositor() socket()"); ++ Error("ProxiedConnection::Init() socket()"); + } + return mApplicationSocket > 0 && mCompositorSocket > 0; +} @@ -516,6 +520,7 @@ new file mode 100644 + } else { + // Try to reconnect to compositor. + if (!ConnectToCompositor()) { ++ Info("Failed to connect to compositor\n"); + return false; + } + // We're not connected yet but ConnectToCompositor() didn't return @@ -571,6 +576,7 @@ new file mode 100644 + return false; + } + ++ Info("WaylandProxy Wayland '%s' proxy '%s'\n", sWaylandDisplay, sWaylandProxy); + return true; +} + @@ -645,14 +651,19 @@ new file mode 100644 + for (auto const& connection : mConnections) { + addedPollfd = connection->AddToPollFd(addedPollfd); + } ++ int nfds = (addedPollfd - pollfds); + -+ // Add extra listening socket -+ addedPollfd->fd = mProxyServerSocket; -+ addedPollfd->events = POLLIN; ++ // If all connections are attached to compositor, add another one ++ // for new potential connection from application. ++ bool addNewConnection = mConnections.empty() || ++ mConnections.back()->IsConnected(); ++ if (addNewConnection) { ++ addedPollfd->fd = mProxyServerSocket; ++ addedPollfd->events = POLLIN; ++ nfds++; ++ } + assert(addedPollfd < pollfds + nfds_max); + -+ int nfds = (addedPollfd - pollfds) + 1; -+ + while (1) { + int ret = poll(pollfds, nfds, POLL_TIMEOUT); + if (ret == 0) { @@ -685,7 +696,7 @@ new file mode 100644 + assert(loadedPollfd < pollfds + nfds_max); + + // Create a new connection if there's a new client waiting -+ if (loadedPollfd->revents & POLLIN) { ++ if (addNewConnection && (loadedPollfd->revents & POLLIN)) { + Info("WaylandProxy: new child connection\n"); + int applicationSocket = accept4(loadedPollfd->fd, nullptr, nullptr, + SOCK_NONBLOCK | SOCK_CLOEXEC); @@ -744,6 +755,7 @@ new file mode 100644 + if (mProxyServerSocket != -1) { + close(mProxyServerSocket); + } ++ SetWaylandDisplay(); +} + +void* WaylandProxy::RunProxyThread(WaylandProxy* aProxy) { @@ -817,18 +829,21 @@ new file mode 100644 diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build --- a/widget/gtk/moz.build +++ b/widget/gtk/moz.build -@@ -23,10 +23,13 @@ +@@ -21,11 +21,15 @@ + + if CONFIG["COMPILE_ENVIRONMENT"]: DIRS += ["mozgtk"] if CONFIG["MOZ_WAYLAND"]: - DIRS += ["wayland", "mozwayland"] +- DIRS += ["wayland", "mozwayland"] ++ DIRS += [ ++ "wayland", ++ "mozwayland", ++ "../../third_party/wayland-proxy" ++ ] -+if CONFIG["MOZ_WAYLAND_PROXY"]: -+ DIRS += ["../../third_party/wayland-proxy"] -+ if CONFIG["MOZ_ENABLE_VAAPI"]: DIRS += ["vaapitest"] if CONFIG["MOZ_ENABLE_V4L2"]: - DIRS += ["v4l2test"] diff --git a/D196555.diff b/D196555.diff index 8d22b29..6a8d6dd 100644 --- a/D196555.diff +++ b/D196555.diff @@ -1,19 +1,23 @@ diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp -@@ -343,16 +343,24 @@ +@@ -342,17 +342,28 @@ + # include "mozilla/WidgetUtilsGtk.h" # include # ifdef MOZ_WAYLAND # include # include "mozilla/widget/nsWaylandDisplay.h" - # endif -+# ifdef MOZ_WAYLAND_PROXY +# include "wayland-proxy.h" -+# endif + # endif # ifdef MOZ_X11 # include # endif /* MOZ_X11 */ #endif ++ ++#if defined(MOZ_WAYLAND) ++std::unique_ptr gWaylandProxy; ++#endif ++ #include "BinaryPath.h" +#ifdef MOZ_LOGGING @@ -26,52 +30,54 @@ diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp namespace mozilla { FuzzerRunner* fuzzerRunner = 0; -@@ -3670,10 +3678,13 @@ - class XREMain { - public: - XREMain() = default; - - ~XREMain() { -+#if defined(MOZ_WAYLAND_PROXY) -+ mWaylandProxy = nullptr; -+#endif - mScopedXPCOM = nullptr; - mAppData = nullptr; - } - - int XRE_main(int argc, char* argv[], const BootstrapConfig& aConfig); -@@ -3689,10 +3700,13 @@ - nsCOMPtr mProfLD; - nsCOMPtr mProfileLock; - #if defined(MOZ_HAS_REMOTE) - RefPtr mRemoteService; +@@ -2790,10 +2801,13 @@ + if (gRemoteService) { + gRemoteService->UnlockStartup(); + gRemoteService = nullptr; + } #endif -+#if defined(MOZ_WAYLAND_PROXY) -+ std::unique_ptr mWaylandProxy; ++#if defined(MOZ_WAYLAND) ++ gWaylandProxy = nullptr; +#endif + return LaunchChild(false, true); + } + } else { + rv = ps->Alert(nullptr, killTitle.get(), killMessage.get()); + NS_ENSURE_SUCCESS_LOG(rv, rv); +@@ -2904,10 +2918,13 @@ + if (gRemoteService) { + gRemoteService->UnlockStartup(); + gRemoteService = nullptr; + } + #endif ++#if defined(MOZ_WAYLAND) ++ gWaylandProxy = nullptr; ++#endif + return LaunchChild(false, true); + } - UniquePtr mScopedXPCOM; - UniquePtr mAppData; - - nsXREDirProvider mDirProvider; -@@ -4709,20 +4723,34 @@ + static bool gDoMigration = false; + static bool gDoProfileReset = false; +@@ -4709,20 +4726,36 @@ #if defined(MOZ_WIDGET_GTK) if (!isBackgroundTaskMode && !gfxPlatform::IsHeadless()) { const char* display_name = nullptr; bool saveDisplayArg = false; + bool waylandEnabled = IsWaylandEnabled(); -+# ifdef MOZ_WAYLAND_PROXY ++# ifdef MOZ_WAYLAND + auto* proxyEnv = getenv("MOZ_DISABLE_WAYLAND_PROXY"); + bool disableWaylandProxy = proxyEnv && *proxyEnv; + if (!disableWaylandProxy && XRE_IsParentProcess() && waylandEnabled) { -+ mWaylandProxy = WaylandProxy::Create(); -+ mWaylandProxy->RunThread(); +# ifdef MOZ_LOGGING + if (MOZ_LOG_TEST(gWidgetWaylandLog, mozilla::LogLevel::Debug)) { -+ mWaylandProxy->SetVerbose(true); ++ WaylandProxy::SetVerbose(true); + } +# endif ++ gWaylandProxy = WaylandProxy::Create(); ++ if (gWaylandProxy) { ++ gWaylandProxy->RunThread(); ++ } + } +# endif + @@ -90,20 +96,16 @@ diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp if (!waylandEnabled && !display_name) { display_name = PR_GetEnv("DISPLAY"); if (!display_name) { -@@ -5953,10 +5981,15 @@ +@@ -5952,10 +5985,11 @@ + // gdk_display_close also calls gdk_display_manager_set_default_display // appropriately when necessary. if (!gfxPlatform::IsHeadless()) { # ifdef MOZ_WAYLAND WaylandDisplayRelease(); ++ gWaylandProxy = nullptr; # endif -+# ifdef MOZ_WAYLAND_PROXY -+ if (mWaylandProxy) { -+ mWaylandProxy = nullptr; -+ } -+# endif } #endif XRE_DeinitCommandLine(); - diff --git a/firefox.spec b/firefox.spec index d305236..84c0eb8 100644 --- a/firefox.spec +++ b/firefox.spec @@ -174,7 +174,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 121.0 -Release: 3%{?pre_tag}%{?dist} +Release: 4%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -256,7 +256,6 @@ Patch407: mozilla-1667096.patch Patch408: D167159.diff Patch409: D196554.diff Patch410: D196555.diff -Patch411: D196556.diff # PGO/LTO patches Patch600: pgo.patch @@ -550,6 +549,8 @@ This package contains results of tests executed during build. %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 %patch408 -p1 -b .D167159 +%patch409 -p1 -b .D196554 +%patch410 -p1 -b .D196555 # PGO patches %if %{build_with_pgo} @@ -1168,6 +1169,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Jan 24 2023 Martin Stransky - 121.0-4 +- Really enable proxy cache + * Fri Dec 22 2023 Martin Stransky - 121.0-3 - Disabled DBus activations From 2eaa0458a5e2aa1fc6dcf97b1e42ac74569495d2 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 12 Jan 2024 12:33:00 +0100 Subject: [PATCH 294/545] Update to 121.0.1, Fixed Firefox icon on Rawhide --- .gitignore | 2 ++ firefox.sh.in | 6 ++++++ firefox.spec | 18 +++++++++++++----- sources | 4 ++-- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 1a92e2c..3184ea6 100644 --- a/.gitignore +++ b/.gitignore @@ -613,3 +613,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-120.0.1-20231201.tar.xz /firefox-121.0.source.tar.xz /firefox-langpacks-121.0-20231218.tar.xz +/firefox-121.0.1.source.tar.xz +/firefox-langpacks-121.0.1-20240112.tar.xz diff --git a/firefox.sh.in b/firefox.sh.in index 0ab39e9..2012c58 100644 --- a/firefox.sh.in +++ b/firefox.sh.in @@ -265,6 +265,12 @@ do esac done +# We need to link Firefox with desktop file name +if [ -z "$MOZ_APP_REMOTINGNAME" ] +then + export MOZ_APP_REMOTINGNAME=__APP_NAME__ +fi + # Flatpak specific environment variables %FLATPAK_ENV_VARS% diff --git a/firefox.spec b/firefox.spec index 84c0eb8..c4de2e6 100644 --- a/firefox.spec +++ b/firefox.spec @@ -173,13 +173,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 121.0 -Release: 4%{?pre_tag}%{?dist} +Version: 121.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20231218.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240112.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -902,7 +902,11 @@ desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE29} # set up the firefox start script rm -rf %{buildroot}%{_bindir}/firefox -sed -e 's,/__PREFIX__,%{_prefix},g' %{SOURCE21} > %{buildroot}%{_bindir}/firefox +%if 0%{?fedora} < 40 +sed -e 's,/__PREFIX__,%{_prefix},g' -e 's,__APP_NAME__,firefox,g' %{SOURCE21} > %{buildroot}%{_bindir}/firefox +%else +sed -e 's,/__PREFIX__,%{_prefix},g' -e 's,__APP_NAME__,org.mozilla.firefox,g' %{SOURCE21} > %{buildroot}%{_bindir}/firefox +%endif chmod 755 %{buildroot}%{_bindir}/firefox %if 0%{?flatpak} @@ -1169,7 +1173,11 @@ fi #--------------------------------------------------------------------- %changelog -* Tue Jan 24 2023 Martin Stransky - 121.0-4 +* Fri Jan 12 2024 Martin Stransky - 121.0.1-1 +- Update to 121.0.1 +- Fixed Firefox icon on Rawhide + +* Tue Jan 02 2024 Martin Stransky - 121.0-4 - Really enable proxy cache * Fri Dec 22 2023 Martin Stransky - 121.0-3 diff --git a/sources b/sources index b336129..14733b1 100644 --- a/sources +++ b/sources @@ -1,5 +1,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 -SHA512 (firefox-121.0.source.tar.xz) = 52e9e21ce825c4e58f09fd2c7347f1ac4efbca47e119136a712f0d4ee80c769ef80a43bad74a4c88cd377f804f5780b07f7af5b779f3fb5d244fa095e6b3b18a -SHA512 (firefox-langpacks-121.0-20231218.tar.xz) = 7e83b550cfdaeb876b1e65fdd8d7178f990805884d95ccf4b273730a417ea0b51db822a89064fdf67158e6f57f6bd4e2387570c33680c20a924ac872ec4bdec9 +SHA512 (firefox-121.0.1.source.tar.xz) = 7810850a922cb4a274ced6556e14256d3ff518a96f10a0f86d1f8e40daa0a8b1a5cfcc9cbf1391029d920944e94a9149951ee107a0e718a294954bb50b6ced2e +SHA512 (firefox-langpacks-121.0.1-20240112.tar.xz) = 45c8ca9dcb5da0e3b282c060697487600eab71c0f6147006267407608cc9745daa69fc5948487644040b2b38d1b65404860f3ba406334648b9f4b31f9bd5df0a From e7f0cbc6ca158f2958d89af360dbb97076c5cab8 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Fri, 12 Jan 2024 19:13:58 +0100 Subject: [PATCH 295/545] Rebuild for dav1d 1.3.0 --- firefox.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index c4de2e6..54a402e 100644 --- a/firefox.spec +++ b/firefox.spec @@ -174,7 +174,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 121.0.1 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1173,6 +1173,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Jan 12 2024 Fabio Valentini - 121.0.1-2 +- Rebuild for dav1d 1.3.0 + * Fri Jan 12 2024 Martin Stransky - 121.0.1-1 - Update to 121.0.1 - Fixed Firefox icon on Rawhide From 588e3b01fb7467b97e71f7e1c04832e690a1d36c Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Fri, 19 Jan 2024 13:46:45 +0100 Subject: [PATCH 296/545] Fixed bug for langpack loading under Fedora Silverblue --- firefox.sh.in | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/firefox.sh.in b/firefox.sh.in index 2012c58..286f1aa 100644 --- a/firefox.sh.in +++ b/firefox.sh.in @@ -221,8 +221,17 @@ if [ $MOZILLA_DOWN -ne 0 ]; then if [ -h $MOZ_LANGPACKS_DIR/$langpack ]; then langpack=`readlink $MOZ_LANGPACKS_DIR/$langpack` fi - ln -s $MOZ_LANGPACKS_DIR/$langpack \ - $MOZ_EXTENSIONS_PROFILE_DIR/$langpack + if [ -e "/run/ostree-booted" ]; then + # Files on Silverblue has file create time set to 0, + # so in case the langpack is updated Firefox does not + # check for changes because it compares the file + # creation date to do so. + cp -f $MOZ_LANGPACKS_DIR/$langpack \ + $MOZ_EXTENSIONS_PROFILE_DIR/$langpack + else + ln -s $MOZ_LANGPACKS_DIR/$langpack \ + $MOZ_EXTENSIONS_PROFILE_DIR/$langpack + fi echo $MOZ_EXTENSIONS_PROFILE_DIR/$langpack > $FEDORA_LANGPACK_CONFIG return 0 fi From b469d44cd52c5f57e8beafce9d6e8d9b27ad51f5 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 19 Jan 2024 19:21:07 +0000 Subject: [PATCH 297/545] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- firefox.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 54a402e..f81c44b 100644 --- a/firefox.spec +++ b/firefox.spec @@ -174,7 +174,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 121.0.1 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1173,6 +1173,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Jan 19 2024 Fedora Release Engineering - 121.0.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Fri Jan 12 2024 Fabio Valentini - 121.0.1-2 - Rebuild for dav1d 1.3.0 From 8454fdf13f9d4103e4881e17754538f642612b54 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 22 Jan 2024 16:52:36 +0100 Subject: [PATCH 298/545] Updated to 122.0 --- .gitignore | 2 + bmo-1559213-Support-system-av1.patch | 63 +++++++++------------------- firefox.spec | 9 ++-- pgo.patch | 46 ++++++++++---------- sources | 4 +- 5 files changed, 53 insertions(+), 71 deletions(-) diff --git a/.gitignore b/.gitignore index 3184ea6..6d411f0 100644 --- a/.gitignore +++ b/.gitignore @@ -615,3 +615,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-121.0-20231218.tar.xz /firefox-121.0.1.source.tar.xz /firefox-langpacks-121.0.1-20240112.tar.xz +/firefox-122.0.source.tar.xz +/firefox-langpacks-122.0-20240119.tar.xz diff --git a/bmo-1559213-Support-system-av1.patch b/bmo-1559213-Support-system-av1.patch index e894258..1d50290 100644 --- a/bmo-1559213-Support-system-av1.patch +++ b/bmo-1559213-Support-system-av1.patch @@ -1,24 +1,7 @@ -From 8a4627c0c910415b00bebeb976dc6ea8c3e0d5d0 Mon Sep 17 00:00:00 2001 -From: Thomas Deutschmann -Date: Mon, 6 Apr 2020 19:36:02 +0200 -Subject: [PATCH 06/30] bmo#1559213: Support system av1 - -Allow building against system-wide av1. - -Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1559213 -Signed-off-by: Thomas Deutschmann ---- - config/external/moz.build | 5 +++-- - config/system-headers.mozbuild | 8 ++++++++ - dom/media/platforms/moz.build | 5 +++++ - toolkit/moz.configure | 20 ++++++++++++++++++-- - 4 files changed, 34 insertions(+), 4 deletions(-) - -diff --git a/config/external/moz.build b/config/external/moz.build -index ab771212bf..75595d999c 100644 ---- a/config/external/moz.build -+++ b/config/external/moz.build -@@ -49,8 +49,9 @@ if not CONFIG["MOZ_SYSTEM_LIBVPX"]: +diff -up firefox-122.0/config/external/moz.build.system-av1 firefox-122.0/config/external/moz.build +--- firefox-122.0/config/external/moz.build.system-av1 2024-01-18 21:41:20.000000000 +0100 ++++ firefox-122.0/config/external/moz.build 2024-01-19 18:27:03.512034790 +0100 +@@ -40,8 +40,9 @@ if not CONFIG["MOZ_SYSTEM_LIBVPX"]: external_dirs += ["media/libvpx"] if CONFIG["MOZ_AV1"]: @@ -30,12 +13,11 @@ index ab771212bf..75595d999c 100644 if not CONFIG["MOZ_SYSTEM_PNG"]: external_dirs += ["media/libpng"] -diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild -index 2f7ae39515..96ab3a6466 100644 ---- a/config/system-headers.mozbuild -+++ b/config/system-headers.mozbuild -@@ -1301,6 +1301,14 @@ if CONFIG['MOZ_ENABLE_LIBPROXY']: - 'proxy.h', +diff -up firefox-122.0/config/system-headers.mozbuild.system-av1 firefox-122.0/config/system-headers.mozbuild +--- firefox-122.0/config/system-headers.mozbuild.system-av1 2024-01-19 18:27:03.513034826 +0100 ++++ firefox-122.0/config/system-headers.mozbuild 2024-01-19 19:02:54.515493457 +0100 +@@ -1304,6 +1304,14 @@ if CONFIG["MOZ_ENABLE_LIBPROXY"]: + "proxy.h", ] +if CONFIG['MOZ_SYSTEM_AV1']: @@ -46,14 +28,13 @@ index 2f7ae39515..96ab3a6466 100644 + 'dav1d/dav1d.h', + ] + - if CONFIG['MOZ_SYSTEM_LIBVPX']: + if CONFIG["MOZ_SYSTEM_ICU"]: system_headers += [ - 'vpx_mem/vpx_mem.h', -diff --git a/dom/media/platforms/moz.build b/dom/media/platforms/moz.build -index 8509aec6ef..7c5a1df63d 100644 ---- a/dom/media/platforms/moz.build -+++ b/dom/media/platforms/moz.build -@@ -78,6 +78,11 @@ if CONFIG["MOZ_AV1"]: + "unicode/calendar.h", +diff -up firefox-122.0/dom/media/platforms/moz.build.system-av1 firefox-122.0/dom/media/platforms/moz.build +--- firefox-122.0/dom/media/platforms/moz.build.system-av1 2024-01-18 21:41:21.000000000 +0100 ++++ firefox-122.0/dom/media/platforms/moz.build 2024-01-19 18:27:03.513034826 +0100 +@@ -81,6 +81,11 @@ if CONFIG["MOZ_AV1"]: "agnostic/AOMDecoder.cpp", "agnostic/DAV1DDecoder.cpp", ] @@ -65,11 +46,10 @@ index 8509aec6ef..7c5a1df63d 100644 if CONFIG["MOZ_OMX"]: EXPORTS += [ -diff --git a/toolkit/moz.configure b/toolkit/moz.configure -index a68e1b347d..7b7975bd12 100644 ---- a/toolkit/moz.configure -+++ b/toolkit/moz.configure -@@ -544,14 +544,29 @@ def av1(value): +diff -up firefox-122.0/toolkit/moz.configure.system-av1 firefox-122.0/toolkit/moz.configure +--- firefox-122.0/toolkit/moz.configure.system-av1 2024-01-19 18:27:03.495034173 +0100 ++++ firefox-122.0/toolkit/moz.configure 2024-01-19 18:27:03.514034863 +0100 +@@ -743,14 +743,29 @@ def av1(value): if value: return True @@ -101,7 +81,7 @@ index a68e1b347d..7b7975bd12 100644 def dav1d_nasm(target): if target.cpu in ("x86", "x86_64"): return namespace(version="2.14", what="AV1") -@@ -561,6 +576,7 @@ set_config("MOZ_DAV1D_ASM", dav1d_asm) +@@ -760,6 +775,7 @@ set_config("MOZ_DAV1D_ASM", dav1d_asm) set_define("MOZ_DAV1D_ASM", dav1d_asm) set_config("MOZ_AV1", av1) set_define("MOZ_AV1", av1) @@ -109,6 +89,3 @@ index a68e1b347d..7b7975bd12 100644 # JXL Image Codec Support # ============================================================== --- -2.34.1 - diff --git a/firefox.spec b/firefox.spec index 54a402e..b44471a 100644 --- a/firefox.spec +++ b/firefox.spec @@ -173,13 +173,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 121.0.1 -Release: 2%{?pre_tag}%{?dist} +Version: 122.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240112.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240119.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1173,6 +1173,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Jan 19 2024 Martin Stransky - 122.0-1 +- Update to 122.0 + * Fri Jan 12 2024 Fabio Valentini - 121.0.1-2 - Rebuild for dav1d 1.3.0 diff --git a/pgo.patch b/pgo.patch index 3932d34..b99616f 100644 --- a/pgo.patch +++ b/pgo.patch @@ -1,7 +1,7 @@ -diff -up firefox-116.0/build/moz.configure/lto-pgo.configure.pgo firefox-116.0/build/moz.configure/lto-pgo.configure ---- firefox-116.0/build/moz.configure/lto-pgo.configure.pgo 2023-07-24 22:39:09.000000000 +0200 -+++ firefox-116.0/build/moz.configure/lto-pgo.configure 2023-07-25 10:58:24.992687495 +0200 -@@ -93,7 +93,7 @@ def pgo_flags(compiler, profdata, target +diff -up firefox-122.0/build/moz.configure/lto-pgo.configure.pgo firefox-122.0/build/moz.configure/lto-pgo.configure +--- firefox-122.0/build/moz.configure/lto-pgo.configure.pgo 2024-01-18 21:41:19.000000000 +0100 ++++ firefox-122.0/build/moz.configure/lto-pgo.configure 2024-01-19 18:21:17.974681504 +0100 +@@ -86,7 +86,7 @@ def pgo_flags(compiler, profdata, target return namespace( gen_cflags=["-fprofile-generate"], gen_ldflags=["-fprofile-generate"], @@ -10,9 +10,9 @@ diff -up firefox-116.0/build/moz.configure/lto-pgo.configure.pgo firefox-116.0/b use_ldflags=["-fprofile-use"], ) -diff -up firefox-116.0/build/pgo/profileserver.py.pgo firefox-116.0/build/pgo/profileserver.py ---- firefox-116.0/build/pgo/profileserver.py.pgo 2023-07-24 22:39:09.000000000 +0200 -+++ firefox-116.0/build/pgo/profileserver.py 2023-07-25 10:58:24.992687495 +0200 +diff -up firefox-122.0/build/pgo/profileserver.py.pgo firefox-122.0/build/pgo/profileserver.py +--- firefox-122.0/build/pgo/profileserver.py.pgo 2024-01-18 21:41:20.000000000 +0100 ++++ firefox-122.0/build/pgo/profileserver.py 2024-01-19 18:21:17.974681504 +0100 @@ -11,7 +11,7 @@ import subprocess import sys @@ -22,7 +22,7 @@ diff -up firefox-116.0/build/pgo/profileserver.py.pgo firefox-116.0/build/pgo/pr from mozfile import TemporaryDirectory from mozhttpd import MozHttpd from mozprofile import FirefoxProfile, Preferences -@@ -87,9 +87,22 @@ if __name__ == "__main__": +@@ -98,9 +98,22 @@ if __name__ == "__main__": locations = ServerLocations() locations.add_host(host="127.0.0.1", port=PORT, options="primary,privileged") @@ -48,10 +48,10 @@ diff -up firefox-116.0/build/pgo/profileserver.py.pgo firefox-116.0/build/pgo/pr with TemporaryDirectory() as profilePath: # TODO: refactor this into mozprofile -diff -up firefox-116.0/gfx/2d/moz.build.pgo firefox-116.0/gfx/2d/moz.build ---- firefox-116.0/gfx/2d/moz.build.pgo 2023-07-24 22:39:10.000000000 +0200 -+++ firefox-116.0/gfx/2d/moz.build 2023-07-25 10:58:24.992687495 +0200 -@@ -136,11 +136,11 @@ if CONFIG["INTEL_ARCHITECTURE"]: +diff -up firefox-122.0/gfx/2d/moz.build.pgo firefox-122.0/gfx/2d/moz.build +--- firefox-122.0/gfx/2d/moz.build.pgo 2024-01-18 21:41:22.000000000 +0100 ++++ firefox-122.0/gfx/2d/moz.build 2024-01-19 18:21:17.974681504 +0100 +@@ -137,11 +137,11 @@ if CONFIG["INTEL_ARCHITECTURE"]: # The file uses SSE2 intrinsics, so it needs special compile flags on some # compilers. SOURCES["BlurSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] @@ -65,9 +65,9 @@ diff -up firefox-116.0/gfx/2d/moz.build.pgo firefox-116.0/gfx/2d/moz.build SOURCES["SwizzleSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] SOURCES["SwizzleSSSE3.cpp"].flags += CONFIG["SSSE3_FLAGS"] SOURCES["ssse3-scaler.c"].flags += CONFIG["SSSE3_FLAGS"] -diff -up firefox-116.0/gfx/skia/generate_mozbuild.py.pgo firefox-116.0/gfx/skia/generate_mozbuild.py ---- firefox-116.0/gfx/skia/generate_mozbuild.py.pgo 2023-07-25 10:58:24.993687530 +0200 -+++ firefox-116.0/gfx/skia/generate_mozbuild.py 2023-07-25 10:59:43.428384144 +0200 +diff -up firefox-122.0/gfx/skia/generate_mozbuild.py.pgo firefox-122.0/gfx/skia/generate_mozbuild.py +--- firefox-122.0/gfx/skia/generate_mozbuild.py.pgo 2024-01-19 18:21:17.975681537 +0100 ++++ firefox-122.0/gfx/skia/generate_mozbuild.py 2024-01-19 18:24:15.494934133 +0100 @@ -54,10 +54,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind if CONFIG['INTEL_ARCHITECTURE']: SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3', '-mssse3'] @@ -79,12 +79,12 @@ diff -up firefox-116.0/gfx/skia/generate_mozbuild.py.pgo firefox-116.0/gfx/skia/ if not CONFIG["MOZ_CODE_COVERAGE"]: - SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-Dskvx=skvx_skx', '-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl'] + SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-Dskvx=skvx_skx', '-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl', '-fno-lto'] - elif CONFIG['CPU_ARCH'] == 'aarch64' and CONFIG['CC_TYPE'] in ('clang', 'gcc'): + elif CONFIG['TARGET_CPU'] == 'aarch64' and CONFIG['CC_TYPE'] in ('clang', 'gcc'): SOURCES['skia/src/opts/SkOpts_crc32.cpp'].flags += ['-Dskvx=skvx_crc32', '-march=armv8-a+crc'] -diff -up firefox-116.0/gfx/skia/moz.build.pgo firefox-116.0/gfx/skia/moz.build ---- firefox-116.0/gfx/skia/moz.build.pgo 2023-07-25 10:58:24.993687530 +0200 -+++ firefox-116.0/gfx/skia/moz.build 2023-07-25 11:00:20.382652180 +0200 +diff -up firefox-122.0/gfx/skia/moz.build.pgo firefox-122.0/gfx/skia/moz.build +--- firefox-122.0/gfx/skia/moz.build.pgo 2024-01-19 18:21:17.975681537 +0100 ++++ firefox-122.0/gfx/skia/moz.build 2024-01-19 18:25:13.472039275 +0100 @@ -564,10 +564,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind if CONFIG['INTEL_ARCHITECTURE']: SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3', '-mssse3'] @@ -96,12 +96,12 @@ diff -up firefox-116.0/gfx/skia/moz.build.pgo firefox-116.0/gfx/skia/moz.build if not CONFIG["MOZ_CODE_COVERAGE"]: - SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-Dskvx=skvx_skx', '-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl'] + SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-Dskvx=skvx_skx', '-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl', '-fno-lto'] - elif CONFIG['CPU_ARCH'] == 'aarch64' and CONFIG['CC_TYPE'] in ('clang', 'gcc'): + elif CONFIG['TARGET_CPU'] == 'aarch64' and CONFIG['CC_TYPE'] in ('clang', 'gcc'): SOURCES['skia/src/opts/SkOpts_crc32.cpp'].flags += ['-Dskvx=skvx_crc32', '-march=armv8-a+crc'] -diff -up firefox-116.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-116.0/toolkit/components/terminator/nsTerminator.cpp ---- firefox-116.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2023-07-24 22:39:24.000000000 +0200 -+++ firefox-116.0/toolkit/components/terminator/nsTerminator.cpp 2023-07-25 10:58:24.993687530 +0200 +diff -up firefox-122.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-122.0/toolkit/components/terminator/nsTerminator.cpp +--- firefox-122.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2024-01-18 21:41:36.000000000 +0100 ++++ firefox-122.0/toolkit/components/terminator/nsTerminator.cpp 2024-01-19 18:21:17.976681572 +0100 @@ -460,6 +460,11 @@ void nsTerminator::StartWatchdog() { } #endif diff --git a/sources b/sources index 14733b1..2601ca9 100644 --- a/sources +++ b/sources @@ -1,5 +1,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 -SHA512 (firefox-121.0.1.source.tar.xz) = 7810850a922cb4a274ced6556e14256d3ff518a96f10a0f86d1f8e40daa0a8b1a5cfcc9cbf1391029d920944e94a9149951ee107a0e718a294954bb50b6ced2e -SHA512 (firefox-langpacks-121.0.1-20240112.tar.xz) = 45c8ca9dcb5da0e3b282c060697487600eab71c0f6147006267407608cc9745daa69fc5948487644040b2b38d1b65404860f3ba406334648b9f4b31f9bd5df0a +SHA512 (firefox-122.0.source.tar.xz) = 619b735c16970207f3f8fb31dd2350a5e665a802c30501c89aee4817b8b0f7f466da93c66ab238e94967587e538e6858934b18164ff312dbdbfbc3b2bf8bd824 +SHA512 (firefox-langpacks-122.0-20240119.tar.xz) = 04b5a912f0c1bfaeaf33995f491df861aa12b8134f5b2dada52649f82b5fb224c1d696c521c2665eb93813b9015bdaf71a7a0f7aee1dc6ebed1836073e9c71c8 From 331eced30e3309ab5186b40a001e02c712288ee5 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 22 Jan 2024 23:39:00 +0100 Subject: [PATCH 299/545] Include vaapitest on ppc64le and s390x --- firefox.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/firefox.spec b/firefox.spec index 37549a6..b37802b 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1158,11 +1158,8 @@ fi %{mozappdir}/fonts/TwemojiMozilla.ttf %ifarch aarch64 %{mozappdir}/v4l2test -%{mozappdir}/vaapitest %endif -%ifarch x86_64 %{mozappdir}/vaapitest -%endif %if !%{?system_nss} %exclude %{mozappdir}/libnssckbi.so %endif From 919e30e38fad68ea0ae59954f09ae5b833cab02a Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 29 Jan 2024 09:55:29 +0100 Subject: [PATCH 300/545] Obsolete firefox-wayland and firefox-x11 on Fedora 40+ --- firefox.spec | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index b37802b..f446894 100644 --- a/firefox.spec +++ b/firefox.spec @@ -174,7 +174,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 122.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -496,6 +496,13 @@ to run Firefox explicitly on Wayland. %{_datadir}/applications/firefox-wayland.desktop %endif +# Don't ship firefox-x11 and firefox-wayland on Fedora 40. +# Wayland backend is considered as mature enough now. +%if 0%{?fedora} >= 40 +Obsoletes: firefox-wayland +Obsoletes: firefox-x11 +%endif + %if 0%{?run_firefox_tests} %global testsuite_pkg_name %{name}-testresults %package -n %{testsuite_pkg_name} @@ -1170,6 +1177,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Jan 29 2024 Martin Stransky - 122.0-2 +- Obsolete firefox-wayland and firefox-x11 on Fedora 40+ + * Fri Jan 19 2024 Martin Stransky - 122.0-1 - Update to 122.0 From 0f5857cb6363c8072bb0cd53cf7f371872fdc832 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 30 Jan 2024 11:08:42 +0100 Subject: [PATCH 301/545] Added version to obsolete firefox-wayland/x11 --- firefox.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/firefox.spec b/firefox.spec index f446894..52e220d 100644 --- a/firefox.spec +++ b/firefox.spec @@ -174,7 +174,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 122.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -499,8 +499,8 @@ to run Firefox explicitly on Wayland. # Don't ship firefox-x11 and firefox-wayland on Fedora 40. # Wayland backend is considered as mature enough now. %if 0%{?fedora} >= 40 -Obsoletes: firefox-wayland -Obsoletes: firefox-x11 +Obsoletes: firefox-wayland < 122.0-2 +Obsoletes: firefox-x11 < 122.0-2 %endif %if 0%{?run_firefox_tests} @@ -1177,6 +1177,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Jan 30 2024 Martin Stransky - 122.0-3 +- Added version to obsolete firefox-wayland/x11 + * Mon Jan 29 2024 Martin Stransky - 122.0-2 - Obsolete firefox-wayland and firefox-x11 on Fedora 40+ From fc0a23427b1fc5cc7f88ef11859106ea410c744b Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 30 Jan 2024 13:13:27 +0100 Subject: [PATCH 302/545] Build with --enable-replace-malloc (rhbz#2260766) --- firefox-mozconfig | 1 + firefox.spec | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/firefox-mozconfig b/firefox-mozconfig index 676a0e0..cac0e76 100644 --- a/firefox-mozconfig +++ b/firefox-mozconfig @@ -16,6 +16,7 @@ ac_add_options --enable-js-shell ac_add_options --with-unsigned-addon-scopes=app,system ac_add_options --without-sysroot ac_add_options --without-wasm-sandboxed-libraries +ac_add_options --enable-replace-malloc export BUILD_OFFICIAL=1 export MOZILLA_OFFICIAL=1 diff --git a/firefox.spec b/firefox.spec index 52e220d..802c0f7 100644 --- a/firefox.spec +++ b/firefox.spec @@ -174,7 +174,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 122.0 -Release: 3%{?pre_tag}%{?dist} +Release: 4%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1177,6 +1177,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Jan 30 2024 Martin Stransky - 122.0-4 +- Build with --enable-replace-malloc (rhbz#2260766) + * Tue Jan 30 2024 Martin Stransky - 122.0-3 - Added version to obsolete firefox-wayland/x11 From fce8323a2437bb37c9f5e5cc8cc942e5a8f61990 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 30 Jan 2024 13:24:09 +0100 Subject: [PATCH 303/545] fix obsoletes --- firefox.spec | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/firefox.spec b/firefox.spec index 802c0f7..70f6d41 100644 --- a/firefox.spec +++ b/firefox.spec @@ -440,6 +440,13 @@ BuildRequires: libproxy-devel Obsoletes: mozilla <= 37:1.7.13 Provides: webclient +# Don't ship firefox-x11 and firefox-wayland on Fedora 40. +# Wayland backend is considered as mature enough now. +%if 0%{?fedora} >= 40 +Obsoletes: firefox-wayland < 122.0-2 +Obsoletes: firefox-x11 < 122.0-2 +%endif + %description Mozilla Firefox is an open-source web browser, designed for standards compliance, performance and portability. @@ -496,13 +503,6 @@ to run Firefox explicitly on Wayland. %{_datadir}/applications/firefox-wayland.desktop %endif -# Don't ship firefox-x11 and firefox-wayland on Fedora 40. -# Wayland backend is considered as mature enough now. -%if 0%{?fedora} >= 40 -Obsoletes: firefox-wayland < 122.0-2 -Obsoletes: firefox-x11 < 122.0-2 -%endif - %if 0%{?run_firefox_tests} %global testsuite_pkg_name %{name}-testresults %package -n %{testsuite_pkg_name} From 76471413b26043286290f43020ae4efdcfd6af40 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 31 Jan 2024 21:17:31 +0100 Subject: [PATCH 304/545] Disabled system libvpx due to WebRTC/camera issues (mzbz#1875201) --- firefox.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index 70f6d41..2b15d4d 100644 --- a/firefox.spec +++ b/firefox.spec @@ -61,7 +61,7 @@ ExcludeArch: i686 %global system_ffi 1 %global system_av1 1 -%global system_libvpx 1 +%global system_libvpx 0 %global system_jpeg 1 %global system_pixman 1 %global system_webp 1 @@ -174,7 +174,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 122.0 -Release: 4%{?pre_tag}%{?dist} +Release: 5%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1177,6 +1177,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Jan 31 2024 Martin Stransky - 122.0-5 +- Disabled system libvpx due to WebRTC/camera issues (mzbz#1875201) + * Tue Jan 30 2024 Martin Stransky - 122.0-4 - Build with --enable-replace-malloc (rhbz#2260766) From 7609d4e357bfe08c8688c40cbe0788043e3ee664 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 1 Feb 2024 11:50:42 +0100 Subject: [PATCH 305/545] Build against static libstdc++ --- firefox.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/firefox.spec b/firefox.spec index 2b15d4d..0912a62 100644 --- a/firefox.spec +++ b/firefox.spec @@ -436,6 +436,8 @@ BuildRequires: make BuildRequires: pciutils-libs BuildRequires: mesa-libgbm-devel BuildRequires: libproxy-devel +# Required for --enable-replace-malloc +BuildRequires: libstdc++-static Obsoletes: mozilla <= 37:1.7.13 Provides: webclient From 69510db0506067e3b711bdd4bef180812009286d Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 1 Feb 2024 14:25:58 +0100 Subject: [PATCH 306/545] Build with enable-replace-malloc on intel only --- firefox-mozconfig | 1 - firefox.spec | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/firefox-mozconfig b/firefox-mozconfig index cac0e76..676a0e0 100644 --- a/firefox-mozconfig +++ b/firefox-mozconfig @@ -16,7 +16,6 @@ ac_add_options --enable-js-shell ac_add_options --with-unsigned-addon-scopes=app,system ac_add_options --without-sysroot ac_add_options --without-wasm-sandboxed-libraries -ac_add_options --enable-replace-malloc export BUILD_OFFICIAL=1 export MOZILLA_OFFICIAL=1 diff --git a/firefox.spec b/firefox.spec index 0912a62..ee54f8a 100644 --- a/firefox.spec +++ b/firefox.spec @@ -29,6 +29,11 @@ ExcludeArch: i686 %global system_libevent 1 %global build_with_asan 0 %global test_on_wayland 0 +%ifarch x86_64 %{ix86} +%global enable_replace_malloc 1 +%else +%global enable_replace_malloc 0 +%endif %if "%{toolchain}" == "clang" %global build_with_clang 1 @@ -437,7 +442,9 @@ BuildRequires: pciutils-libs BuildRequires: mesa-libgbm-devel BuildRequires: libproxy-devel # Required for --enable-replace-malloc +%if %{enable_replace_malloc} BuildRequires: libstdc++-static +%endif Obsoletes: mozilla <= 37:1.7.13 Provides: webclient @@ -690,6 +697,10 @@ echo "ac_add_options --with-google-safebrowsing-api-keyfile=`pwd`/google-api-key # where to look echo "ac_add_options --with-libclang-path=`llvm-config --libdir`" >> .mozconfig +%if %{enable_replace_malloc} +ac_add_options --enable-replace-malloc +%endif + echo 'export NODEJS="%{_buildrootdir}/bin/node-stdout-nonblocking-wrapper"' >> .mozconfig # Remove executable bit to make brp-mangle-shebangs happy. From bdd9cac34e190fa9f7f6d00c70b131409b69a8a2 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 1 Feb 2024 14:41:51 +0100 Subject: [PATCH 307/545] build fix --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index ee54f8a..c7e4eec 100644 --- a/firefox.spec +++ b/firefox.spec @@ -698,7 +698,7 @@ echo "ac_add_options --with-google-safebrowsing-api-keyfile=`pwd`/google-api-key echo "ac_add_options --with-libclang-path=`llvm-config --libdir`" >> .mozconfig %if %{enable_replace_malloc} -ac_add_options --enable-replace-malloc +echo "ac_add_options --enable-replace-malloc" >> .mozconfig %endif echo 'export NODEJS="%{_buildrootdir}/bin/node-stdout-nonblocking-wrapper"' >> .mozconfig From 7658746ef7ccd9b5417ee7be11952f621baa4cfa Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 12 Feb 2024 09:50:52 +0100 Subject: [PATCH 308/545] Temporary removed proxy cache (rhbz#2262959) --- D196554.diff | 849 --------------------------------------------------- D196555.diff | 111 ------- firefox.spec | 9 +- 3 files changed, 4 insertions(+), 965 deletions(-) delete mode 100644 D196554.diff delete mode 100644 D196555.diff diff --git a/D196554.diff b/D196554.diff deleted file mode 100644 index 158b7c1..0000000 --- a/D196554.diff +++ /dev/null @@ -1,849 +0,0 @@ -diff --git a/third_party/wayland-proxy/moz.build b/third_party/wayland-proxy/moz.build -new file mode 100644 ---- /dev/null -+++ b/third_party/wayland-proxy/moz.build -@@ -0,0 +1,16 @@ -+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -+# vim: set filetype=python: -+# This Source Code Form is subject to the terms of the Mozilla Public -+# License, v. 2.0. If a copy of the MPL was not distributed with this -+# file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ -+with Files("**"): -+ BUG_COMPONENT = ("Core", "Widget: Gtk") -+ -+SOURCES += [ -+ "wayland-proxy.cpp", -+] -+EXPORTS += [ -+ "wayland-proxy.h", -+] -+FINAL_LIBRARY = "xul" -diff --git a/third_party/wayland-proxy/wayland-proxy.h b/third_party/wayland-proxy/wayland-proxy.h -new file mode 100644 ---- /dev/null -+++ b/third_party/wayland-proxy/wayland-proxy.h -@@ -0,0 +1,55 @@ -+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- -+ * This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+#ifndef _wayland_proxy_h_ -+#define _wayland_proxy_h_ -+ -+#include -+#include -+#include -+#include -+#include -+ -+typedef unsigned char byte; -+ -+class ProxiedConnection; -+ -+class WaylandProxy { -+ public: -+ -+ static std::unique_ptr Create(); -+ -+ bool RunChildApplication(char* argv[]); -+ bool RunThread(); -+ -+ void SetWaylandDisplay(); -+ static void SetVerbose(bool aVerbose); -+ -+ ~WaylandProxy(); -+ -+ private: -+ bool Init(); -+ void Run(); -+ -+ void SetWaylandProxyDisplay(); -+ static void* RunProxyThread(WaylandProxy* aProxy); -+ -+ bool SetupWaylandDisplays(); -+ bool StartProxyServer(); -+ bool IsChildAppTerminated(); -+ -+ bool PollConnections(); -+ bool ProcessConnections(); -+ -+ private: -+ // List of all Compositor <-> Application connections -+ std::vector> mConnections; -+ int mProxyServerSocket = -1; -+ pid_t mApplicationPID = 0; -+ std::atomic mThreadRunning = false; -+ pthread_t mThread; -+}; -+ -+#endif // _wayland_proxy_h_ -diff --git a/third_party/wayland-proxy/wayland-proxy.cpp b/third_party/wayland-proxy/wayland-proxy.cpp -new file mode 100644 ---- /dev/null -+++ b/third_party/wayland-proxy/wayland-proxy.cpp -@@ -0,0 +1,742 @@ -+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- -+ * This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+// This code is based on Rust implementation at -+// https://github.com/the8472/weyland-p5000 -+ -+// Version 1.0 -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "wayland-proxy.h" -+ -+// The maximum number of fds libwayland can recvmsg at once -+#define MAX_LIBWAY_FDS 28 -+#define MAX_DATA_SIZE 4096 -+#define POLL_TIMEOUT 30000 -+ -+// sockaddr_un has hardcoded max len of sun_path -+#define MAX_WAYLAND_DISPLAY_NAME_LEN 108 -+ -+// Name of Wayland display provided by compositor -+char sWaylandDisplay[MAX_WAYLAND_DISPLAY_NAME_LEN]; -+ -+// Name of Wayland display provided by us -+char sWaylandProxy[MAX_WAYLAND_DISPLAY_NAME_LEN]; -+ -+bool sPrintInfo = false; -+ -+void Info(const char* aFormat, ...) { -+ if (!sPrintInfo) { -+ return; -+ } -+ va_list args; -+ va_start(args, aFormat); -+ vfprintf(stderr, aFormat, args); -+ va_end(args); -+} -+ -+void Warning(const char* aOperation, bool aPrintErrno = true) { -+ fprintf(stderr, "Wayland Proxy warning: %s : %s\n", aOperation, -+ aPrintErrno ? strerror(errno) : ""); -+} -+ -+void Error(const char* aOperation, bool aPrintErrno = true) { -+ fprintf(stderr, "Wayland Proxy error: %s : %s\n", aOperation, -+ aPrintErrno ? strerror(errno) : ""); -+} -+ -+void ErrorPlain(const char* aFormat, ...) { -+ va_list args; -+ va_start(args, aFormat); -+ vfprintf(stderr, aFormat, args); -+ va_end(args); -+} -+ -+class WaylandMessage { -+ public: -+ bool Write(int aSocket); -+ -+ bool Loaded() { return mLoaded && (mFds.size() || mData.size()); } -+ bool Failed() { return mFailed; } -+ -+ explicit WaylandMessage(int aSocket) { Read(aSocket); } -+ ~WaylandMessage(); -+ -+ private: -+ bool Read(int aSocket); -+ -+ private: -+ bool mLoaded = false; -+ bool mFailed = false; -+ -+ std::vector mFds; -+ std::vector mData; -+}; -+ -+class ProxiedConnection { -+ public: -+ bool Init(int aChildSocket); -+ bool IsConnected() { return mCompositorConnected; } -+ -+ struct pollfd* AddToPollFd(struct pollfd* aPfds); -+ struct pollfd* LoadPollFd(struct pollfd* aPfds); -+ -+ // Process this connection (send/receive data). -+ // Returns false if connection is broken and should be removed. -+ bool Process(); -+ -+ ~ProxiedConnection(); -+ -+ private: -+ // Try to connect to compositor. Returns false in case of fatal error. -+ bool ConnectToCompositor(); -+ -+ bool TransferOrQueue( -+ int aSourceSocket, int aSourcePollFlags, int aDestSocket, -+ std::vector>* aMessageQueue); -+ bool FlushQueue(int aDestSocket, int aDestPollFlags, -+ std::vector>& aMessageQueue); -+ -+ // We don't have connected compositor yet. Try to connect -+ bool mCompositorConnected = false; -+ -+ // We're disconnected from app or compositor. We will close this connection. -+ bool mFailed = false; -+ -+ int mCompositorSocket = -1; -+ int mCompositorFlags = 0; -+ -+ int mApplicationSocket = -1; -+ int mApplicationFlags = 0; -+ -+ // Stored proxied data -+ std::vector> mToCompositorQueue; -+ std::vector> mToApplicationQueue; -+}; -+ -+WaylandMessage::~WaylandMessage() { -+ for (auto const fd : mFds) { -+ close(fd); -+ } -+} -+ -+bool WaylandMessage::Read(int aSocket) { -+ // We don't expect WaylandMessage re-read -+ assert(!mLoaded && !mFailed); -+ -+ mData.resize(MAX_DATA_SIZE); -+ -+ struct msghdr msg = {0}; -+ struct iovec iov = {mData.data(), mData.size()}; -+ msg.msg_iov = &iov; -+ msg.msg_iovlen = 1; -+ -+ char cmsgdata[(CMSG_LEN(MAX_LIBWAY_FDS * sizeof(int32_t)))] = {0}; -+ msg.msg_control = &cmsgdata; -+ msg.msg_controllen = sizeof(cmsgdata); -+ -+ ssize_t ret = recvmsg(aSocket, &msg, MSG_CMSG_CLOEXEC | MSG_DONTWAIT); -+ if (msg.msg_flags & (MSG_CTRUNC | MSG_TRUNC)) { -+ Error("WaylandMessage::Read() data truncated, small buffer?"); -+ mFailed = true; -+ return false; -+ } -+ -+ if (ret < 1) { -+ switch (errno) { -+ case EAGAIN: -+ case EINTR: -+ // Neither loaded nor failed, we'll try again later -+ Info("WaylandMessage::Write() failed %s\n", strerror(errno)); -+ return false; -+ default: -+ Error("WaylandMessage::Write() failed"); -+ mFailed = true; -+ return false; -+ } -+ } -+ -+ // Set correct data size -+ mData.resize(ret); -+ -+ // Read cmsg -+ struct cmsghdr* header = CMSG_FIRSTHDR(&msg); -+ while (header) { -+ struct cmsghdr* next = CMSG_NXTHDR(&msg, header); -+ if (header->cmsg_level != SOL_SOCKET || header->cmsg_type != SCM_RIGHTS) { -+ header = next; -+ continue; -+ } -+ -+ int* data = (int*)CMSG_DATA(header); -+ int filenum = (int)((header->cmsg_len - CMSG_LEN(0)) / sizeof(int)); -+ for (int i = 0; i < filenum; i++) { -+#ifdef DEBUG -+ int flags = fcntl(data[i], F_GETFL, 0); -+ if (flags == -1 && errno == EBADF) { -+ Error("WaylandMessage::Read() invalid fd"); -+ } -+#endif -+ mFds.push_back(data[i]); -+ } -+ header = next; -+ } -+ -+ mLoaded = true; -+ return true; -+} -+ -+bool WaylandMessage::Write(int aSocket) { -+ if (!mLoaded || mFailed) { -+ return false; -+ } -+ -+ struct msghdr msg = {0}; -+ struct iovec iov = {mData.data(), mData.size()}; -+ msg.msg_iov = &iov; -+ msg.msg_iovlen = 1; -+ -+ int filenum = mFds.size(); -+ if (filenum) { -+ if (filenum >= MAX_LIBWAY_FDS) { -+ Error("WaylandMessage::Write() too many files to send\n", false); -+ return false; -+ } -+#ifdef DEBUG -+ for (int i = 0; i < filenum; i++) { -+ int flags = fcntl(mFds[i], F_GETFL, 0); -+ if (flags == -1 && errno == EBADF) { -+ Error("WaylandMessage::Write() invalid fd\n"); -+ } -+ } -+#endif -+ union { -+ char buf[CMSG_SPACE(sizeof(int) * MAX_LIBWAY_FDS)]; -+ struct cmsghdr align; -+ } cmsgu; -+ memset(cmsgu.buf, 0, sizeof(cmsgu.buf)); -+ -+ msg.msg_control = cmsgu.buf; -+ msg.msg_controllen = sizeof(cmsgu.buf); -+ msg.msg_controllen = CMSG_SPACE(filenum * sizeof(int)); -+ -+ struct cmsghdr* cmsg = CMSG_FIRSTHDR(&msg); -+ cmsg->cmsg_level = SOL_SOCKET; -+ cmsg->cmsg_type = SCM_RIGHTS; -+ cmsg->cmsg_len = CMSG_LEN(filenum * sizeof(int)); -+ memcpy(CMSG_DATA(cmsg), mFds.data(), filenum * sizeof(int)); -+ } -+ -+ ssize_t ret = sendmsg(aSocket, &msg, MSG_CMSG_CLOEXEC | MSG_DONTWAIT); -+ if (ret < 1) { -+ switch (errno) { -+ case EAGAIN: -+ case EINTR: -+ // Neither loaded nor failed, we'll try again later -+ Info("WaylandMessage::Write() failed %s\n", strerror(errno)); -+ return false; -+ default: -+ Warning("WaylandMessage::Write() failed"); -+ mFailed = true; -+ return false; -+ } -+ } -+ -+ if (ret != (ssize_t)mData.size()) { -+ Info("WaylandMessage::Write() failed to write all data! (%d vs. %d)\n", ret, -+ mData.size()); -+ } -+ return true; -+} -+ -+ProxiedConnection::~ProxiedConnection() { -+ if (mCompositorSocket != -1) { -+ close(mCompositorSocket); -+ } -+ if (mApplicationSocket != -1) { -+ close(mApplicationSocket); -+ } -+} -+ -+bool ProxiedConnection::Init(int aApplicationSocket) { -+ mApplicationSocket = aApplicationSocket; -+ mCompositorSocket = -+ socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK | SOCK_CLOEXEC, 0); -+ if (mCompositorSocket == -1) { -+ Error("ProxiedConnection::Init() socket()"); -+ } -+ return mApplicationSocket > 0 && mCompositorSocket > 0; -+} -+ -+struct pollfd* ProxiedConnection::AddToPollFd(struct pollfd* aPfds) { -+ // Listen application's requests -+ aPfds->fd = mApplicationSocket; -+ aPfds->events = POLLIN; -+ -+ // We're connected and we have data for appplication from compositor. -+ // Add POLLOUT to request write to app socket. -+ if (mCompositorConnected && mToApplicationQueue.size()) { -+ aPfds->events |= POLLOUT; -+ } -+ aPfds++; -+ -+ aPfds->fd = mCompositorSocket; -+ // We're waiting for connection or we have data for compositor -+ if (!mCompositorConnected || mToCompositorQueue.size()) { -+ aPfds->events |= POLLOUT; -+ } -+ if (mCompositorConnected) { -+ aPfds->events = POLLIN; -+ } -+ aPfds++; -+ -+ return aPfds; -+} -+ -+struct pollfd* ProxiedConnection::LoadPollFd(struct pollfd* aPfds) { -+ if (aPfds->fd != mApplicationSocket) { -+ return aPfds; -+ } -+ mApplicationFlags = aPfds->revents; -+ aPfds++; -+ mCompositorFlags = aPfds->revents; -+ aPfds++; -+ return aPfds; -+} -+ -+bool ProxiedConnection::ConnectToCompositor() { -+ if (!(mCompositorFlags & POLLOUT)) { -+ // Try again later -+ return true; -+ } -+ -+ struct sockaddr_un addr = {}; -+ addr.sun_family = AF_UNIX; -+ strcpy(addr.sun_path, sWaylandDisplay); -+ -+ mCompositorConnected = -+ connect(mCompositorSocket, (const struct sockaddr*)&addr, -+ sizeof(struct sockaddr_un)) != -1; -+ if (!mCompositorConnected) { -+ switch (errno) { -+ case EAGAIN: -+ case EALREADY: -+ case ECONNREFUSED: -+ case EINPROGRESS: -+ case EINTR: -+ case EISCONN: -+ case ETIMEDOUT: -+ // We can recover from these errors and try again -+ Warning("ConnectToCompositor() try again"); -+ return true; -+ default: -+ Error("ConnectToCompositor() connect()"); -+ return false; -+ } -+ } -+ return true; -+} -+ -+// Read data from aSourceSocket and try to twite them to aDestSocket. -+// If data write fails, append them to aMessageQueue. -+// Return -+bool ProxiedConnection::TransferOrQueue( -+ int aSourceSocket, int aSourcePollFlags, int aDestSocket, -+ std::vector>* aMessageQueue) { -+ // Don't read if we don't have any data ready -+ if (!(aSourcePollFlags & POLLIN)) { -+ return true; -+ } -+ -+ while (1) { -+ int availableData = 0; -+ if (ioctl(aSourceSocket, FIONREAD, &availableData) < 0) { -+ // Broken connection, we're finished here -+ Warning("ProxiedConnection::TransferOrQueue() broken source socket %s\n"); -+ return false; -+ } -+ if (availableData == 0) { -+ return true; -+ } -+ -+ auto message = std::make_unique(aSourceSocket); -+ if (message->Failed()) { -+ // Failed to read message due to error -+ return false; -+ } -+ if (!message->Loaded()) { -+ // Let's try again -+ return true; -+ } -+ if (!message->Write(aDestSocket)) { -+ if (message->Failed()) { -+ // Failed to write and we can't recover -+ return false; -+ } -+ aMessageQueue->push_back(std::move(message)); -+ } -+ } -+} -+ -+// Try to flush all data to aMessageQueue. -+bool ProxiedConnection::FlushQueue( -+ int aDestSocket, int aDestPollFlags, -+ std::vector>& aMessageQueue) { -+ // Can't write to destination yet -+ if (!(aDestPollFlags & POLLOUT)) { -+ return true; -+ } -+ -+ while (aMessageQueue.size()) { -+ if (!aMessageQueue[0]->Write(aDestSocket)) { -+ return !aMessageQueue[0]->Failed(); -+ } -+ aMessageQueue.erase(aMessageQueue.begin()); -+ } -+ return true; -+} -+ -+bool ProxiedConnection::Process() { -+ if (mFailed) { -+ return false; -+ } -+ -+ // Check if appplication is still listening -+ if (mApplicationFlags & (POLLHUP | POLLERR)) { -+ return false; -+ } -+ -+ // Check if compositor is still listening -+ if (mCompositorConnected) { -+ if (mCompositorFlags & (POLLHUP | POLLERR)) { -+ return false; -+ } -+ } else { -+ // Try to reconnect to compositor. -+ if (!ConnectToCompositor()) { -+ Info("Failed to connect to compositor\n"); -+ return false; -+ } -+ // We're not connected yet but ConnectToCompositor() didn't return -+ // fatal error. Try again later. -+ if (!mCompositorConnected) { -+ return true; -+ } -+ } -+ -+ mFailed = -+ !TransferOrQueue(mCompositorSocket, mCompositorFlags, mApplicationSocket, -+ &mToApplicationQueue) || -+ !TransferOrQueue(mApplicationSocket, mApplicationFlags, mCompositorSocket, -+ &mToCompositorQueue) || -+ !FlushQueue(mCompositorSocket, mCompositorFlags, mToCompositorQueue) || -+ !FlushQueue(mApplicationSocket, mApplicationFlags, mToApplicationQueue); -+ -+ return !mFailed; -+} -+ -+bool WaylandProxy::SetupWaylandDisplays() { -+ char* waylandDisplay = getenv("WAYLAND_DISPLAY"); -+ if (!waylandDisplay) { -+ Error("Init(), Missing Wayland display, WAYLAND_DISPLAY is empty.", false); -+ return false; -+ } -+ -+ char* XDGRuntimeDir = getenv("XDG_RUNTIME_DIR"); -+ if (!XDGRuntimeDir) { -+ Error("Init() Missing XDG_RUNTIME_DIR", false); -+ return false; -+ } -+ -+ // WAYLAND_DISPLAY can be absolute path -+ if (waylandDisplay[0] == '/') { -+ if (strlen(sWaylandDisplay) >= MAX_WAYLAND_DISPLAY_NAME_LEN) { -+ Error("Init() WAYLAND_DISPLAY is too large.", false); -+ return false; -+ } -+ strcpy(sWaylandDisplay, waylandDisplay); -+ } else { -+ int ret = snprintf(sWaylandDisplay, MAX_WAYLAND_DISPLAY_NAME_LEN, "%s/%s", -+ XDGRuntimeDir, waylandDisplay); -+ if (ret < 0 || ret >= MAX_WAYLAND_DISPLAY_NAME_LEN) { -+ Error("Init() WAYLAND_DISPLAY/XDG_RUNTIME_DIR is too large.", false); -+ return false; -+ } -+ } -+ int ret = snprintf(sWaylandProxy, MAX_WAYLAND_DISPLAY_NAME_LEN, -+ "%s/wayland-proxy-%d", XDGRuntimeDir, getpid()); -+ if (ret < 0 || ret >= MAX_WAYLAND_DISPLAY_NAME_LEN) { -+ Error("Init() WAYLAND_DISPLAY/XDG_RUNTIME_DIR is too large.", false); -+ return false; -+ } -+ -+ Info("WaylandProxy Wayland '%s' proxy '%s'\n", sWaylandDisplay, sWaylandProxy); -+ return true; -+} -+ -+bool WaylandProxy::StartProxyServer() { -+ mProxyServerSocket = -+ socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK | SOCK_CLOEXEC, 0); -+ if (mProxyServerSocket == -1) { -+ Error("StartProxyServer(): failed to create socket"); -+ return false; -+ } -+ -+ struct sockaddr_un serverName = {0}; -+ serverName.sun_family = AF_UNIX; -+ strcpy(serverName.sun_path, sWaylandProxy); -+ -+ if (bind(mProxyServerSocket, (struct sockaddr*)&serverName, -+ sizeof(serverName)) == -1) { -+ Error("StartProxyServer(): bind() error"); -+ return false; -+ } -+ if (listen(mProxyServerSocket, 128) == -1) { -+ Error("StartProxyServer(): listen() error"); -+ return false; -+ } -+ -+ return true; -+} -+ -+bool WaylandProxy::Init() { -+ if (!SetupWaylandDisplays()) { -+ return false; -+ } -+ -+ if (!StartProxyServer()) { -+ return false; -+ } -+ return true; -+} -+ -+void WaylandProxy::SetWaylandProxyDisplay() { -+ setenv("WAYLAND_DISPLAY", sWaylandProxy, true); -+} -+ -+void WaylandProxy::SetWaylandDisplay() { -+ setenv("WAYLAND_DISPLAY", sWaylandDisplay, true); -+} -+ -+bool WaylandProxy::IsChildAppTerminated() { -+ if (!mApplicationPID) { -+ return false; -+ } -+ int status = 0; -+ int ret = waitpid(mApplicationPID, &status, WNOHANG | WUNTRACED | WCONTINUED); -+ if (ret == 0) { -+ return false; -+ } -+ if (ret == mApplicationPID) { -+ // Child application is terminated, so quit too. -+ return true; -+ } -+ bool terminate = (errno == ECHILD); -+ Error("IsChildAppTerminated: waitpid() error"); -+ return terminate; -+} -+ -+bool WaylandProxy::PollConnections() { -+ int nfds_max = mConnections.size() * 2 + 1; -+ -+ struct pollfd pollfds[nfds_max]; -+ struct pollfd* addedPollfd = pollfds; -+ -+ for (auto const& connection : mConnections) { -+ addedPollfd = connection->AddToPollFd(addedPollfd); -+ } -+ int nfds = (addedPollfd - pollfds); -+ -+ // If all connections are attached to compositor, add another one -+ // for new potential connection from application. -+ bool addNewConnection = mConnections.empty() || -+ mConnections.back()->IsConnected(); -+ if (addNewConnection) { -+ addedPollfd->fd = mProxyServerSocket; -+ addedPollfd->events = POLLIN; -+ nfds++; -+ } -+ assert(addedPollfd < pollfds + nfds_max); -+ -+ while (1) { -+ int ret = poll(pollfds, nfds, POLL_TIMEOUT); -+ if (ret == 0) { -+ // No change on fds -+ continue; -+ } else if (ret > 0) { -+ // We have FD to read -+ break; -+ } else if (ret == -1) { -+ switch (errno) { -+ case EINTR: -+ case EAGAIN: -+ if (IsChildAppTerminated()) { -+ return false; -+ } -+ continue; -+ default: -+ Error("Run: poll() error"); -+ return false; -+ } -+ } -+ } -+ -+ struct pollfd* loadedPollfd = pollfds; -+ for (auto const& connection : mConnections) { -+ loadedPollfd = connection->LoadPollFd(loadedPollfd); -+ } -+ -+ assert(loadedPollfd == addedPollfd); -+ assert(loadedPollfd < pollfds + nfds_max); -+ -+ // Create a new connection if there's a new client waiting -+ if (addNewConnection && (loadedPollfd->revents & POLLIN)) { -+ Info("WaylandProxy: new child connection\n"); -+ int applicationSocket = accept4(loadedPollfd->fd, nullptr, nullptr, -+ SOCK_NONBLOCK | SOCK_CLOEXEC); -+ if (applicationSocket == -1) { -+ switch (errno) { -+ case EAGAIN: -+ case EINTR: -+ // Try again later -+ break; -+ default: -+ Error("Faild to accept connection from application"); -+ return false; -+ } -+ } else { -+ auto connection = std::make_unique(); -+ if (connection->Init(applicationSocket)) { -+ mConnections.push_back(std::move(connection)); -+ } -+ } -+ } -+ -+ return true; -+} -+ -+bool WaylandProxy::ProcessConnections() { -+ std::vector>::iterator connection; -+ for (connection = mConnections.begin(); connection != mConnections.end();) { -+ if (!(*connection)->Process()) { -+ Info("WaylandProxy: remove connection\n"); -+ connection = mConnections.erase(connection); -+ if (!mConnections.size()) { -+ // We removed last connection - quit. -+ Info("WaylandProxy: removed last connection, quit\n"); -+ return false; -+ } -+ } else { -+ connection++; -+ } -+ } -+ return true; -+} -+ -+void WaylandProxy::Run() { -+ while (!IsChildAppTerminated() && PollConnections() && ProcessConnections()) -+ ; -+} -+ -+WaylandProxy::~WaylandProxy() { -+ Info("WaylandProxy terminated\n"); -+ if (mThreadRunning) { -+ Info("WaylandProxy thread is still running, terminating.\n"); -+ pthread_cancel(mThread); -+ pthread_join(mThread, nullptr); -+ } -+ unlink(sWaylandProxy); -+ if (mProxyServerSocket != -1) { -+ close(mProxyServerSocket); -+ } -+ SetWaylandDisplay(); -+} -+ -+void* WaylandProxy::RunProxyThread(WaylandProxy* aProxy) { -+#ifdef __linux__ -+ pthread_setname_np(pthread_self(), "WaylandProxy"); -+#endif -+ aProxy->Run(); -+ aProxy->mThreadRunning = false; -+ Info("WaylandProxy thread exited\n"); -+ return nullptr; -+} -+ -+std::unique_ptr WaylandProxy::Create() { -+ auto proxy = std::make_unique(); -+ if (!proxy->Init()) { -+ return nullptr; -+ } -+ -+ Info("WaylandProxyCreated, display %s\n", sWaylandProxy); -+ return proxy; -+} -+ -+bool WaylandProxy::RunChildApplication(char* argv[]) { -+ if (!argv[0]) { -+ Error("WaylandProxy::RunChildApplication: missing application to run", false); -+ return false; -+ } -+ -+ mApplicationPID = fork(); -+ if (mApplicationPID == -1) { -+ Error("WaylandProxy::RunChildApplication: fork() error"); -+ return false; -+ } -+ if (mApplicationPID == 0) { -+ SetWaylandProxyDisplay(); -+ if (execv(argv[0], argv) == -1) { -+ ErrorPlain("WaylandProxy::RunChildApplication: failed to run %s error %s\n", argv[0], strerror(errno)); -+ exit(1); -+ } -+ } -+ -+ Run(); -+ return true; -+} -+ -+bool WaylandProxy::RunThread() { -+ pthread_attr_t attr; -+ if (pthread_attr_init(&attr) != 0) { -+ return false; -+ } -+ -+ sched_param param; -+ if (pthread_attr_getschedparam(&attr, ¶m) == 0) { -+ param.sched_priority = sched_get_priority_min(SCHED_RR); -+ pthread_attr_setschedparam(&attr, ¶m); -+ } -+ -+ SetWaylandProxyDisplay(); -+ -+ mThreadRunning = pthread_create(&mThread, nullptr, (void* (*)(void*))RunProxyThread, this) == 0; -+ if (!mThreadRunning) { -+ // If we failed to run proxy thread, set WAYLAND_DISPLAY back. -+ SetWaylandDisplay(); -+ } -+ -+ pthread_attr_destroy(&attr); -+ return mThreadRunning; -+} -+ -+void WaylandProxy::SetVerbose(bool aVerbose) { sPrintInfo = aVerbose; } -diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build ---- a/widget/gtk/moz.build -+++ b/widget/gtk/moz.build -@@ -21,11 +21,15 @@ - - if CONFIG["COMPILE_ENVIRONMENT"]: - DIRS += ["mozgtk"] - - if CONFIG["MOZ_WAYLAND"]: -- DIRS += ["wayland", "mozwayland"] -+ DIRS += [ -+ "wayland", -+ "mozwayland", -+ "../../third_party/wayland-proxy" -+ ] - - if CONFIG["MOZ_ENABLE_VAAPI"]: - DIRS += ["vaapitest"] - - if CONFIG["MOZ_ENABLE_V4L2"]: - diff --git a/D196555.diff b/D196555.diff deleted file mode 100644 index 6a8d6dd..0000000 --- a/D196555.diff +++ /dev/null @@ -1,111 +0,0 @@ -diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp ---- a/toolkit/xre/nsAppRunner.cpp -+++ b/toolkit/xre/nsAppRunner.cpp -@@ -342,17 +342,28 @@ - # include "mozilla/WidgetUtilsGtk.h" - # include - # ifdef MOZ_WAYLAND - # include - # include "mozilla/widget/nsWaylandDisplay.h" -+# include "wayland-proxy.h" - # endif - # ifdef MOZ_X11 - # include - # endif /* MOZ_X11 */ - #endif -+ -+#if defined(MOZ_WAYLAND) -+std::unique_ptr gWaylandProxy; -+#endif -+ - #include "BinaryPath.h" - -+#ifdef MOZ_LOGGING -+# include "mozilla/Logging.h" -+extern mozilla::LazyLogModule gWidgetWaylandLog; -+#endif /* MOZ_LOGGING */ -+ - #ifdef FUZZING - # include "FuzzerRunner.h" - - namespace mozilla { - FuzzerRunner* fuzzerRunner = 0; -@@ -2790,10 +2801,13 @@ - if (gRemoteService) { - gRemoteService->UnlockStartup(); - gRemoteService = nullptr; - } - #endif -+#if defined(MOZ_WAYLAND) -+ gWaylandProxy = nullptr; -+#endif - return LaunchChild(false, true); - } - } else { - rv = ps->Alert(nullptr, killTitle.get(), killMessage.get()); - NS_ENSURE_SUCCESS_LOG(rv, rv); -@@ -2904,10 +2918,13 @@ - if (gRemoteService) { - gRemoteService->UnlockStartup(); - gRemoteService = nullptr; - } - #endif -+#if defined(MOZ_WAYLAND) -+ gWaylandProxy = nullptr; -+#endif - return LaunchChild(false, true); - } - - static bool gDoMigration = false; - static bool gDoProfileReset = false; -@@ -4709,20 +4726,36 @@ - #if defined(MOZ_WIDGET_GTK) - if (!isBackgroundTaskMode && !gfxPlatform::IsHeadless()) { - const char* display_name = nullptr; - bool saveDisplayArg = false; - -+ bool waylandEnabled = IsWaylandEnabled(); -+# ifdef MOZ_WAYLAND -+ auto* proxyEnv = getenv("MOZ_DISABLE_WAYLAND_PROXY"); -+ bool disableWaylandProxy = proxyEnv && *proxyEnv; -+ if (!disableWaylandProxy && XRE_IsParentProcess() && waylandEnabled) { -+# ifdef MOZ_LOGGING -+ if (MOZ_LOG_TEST(gWidgetWaylandLog, mozilla::LogLevel::Debug)) { -+ WaylandProxy::SetVerbose(true); -+ } -+# endif -+ gWaylandProxy = WaylandProxy::Create(); -+ if (gWaylandProxy) { -+ gWaylandProxy->RunThread(); -+ } -+ } -+# endif -+ - // display_name is owned by gdk. - display_name = gdk_get_display_arg_name(); - // if --display argument is given make sure it's - // also passed to ContentChild::Init() by MOZ_GDK_DISPLAY. - if (display_name) { - SaveWordToEnv("MOZ_GDK_DISPLAY", nsDependentCString(display_name)); - saveDisplayArg = true; - } - -- bool waylandEnabled = IsWaylandEnabled(); - // On Wayland disabled builds read X11 DISPLAY env exclusively - // and don't care about different displays. - if (!waylandEnabled && !display_name) { - display_name = PR_GetEnv("DISPLAY"); - if (!display_name) { -@@ -5952,10 +5985,11 @@ - // gdk_display_close also calls gdk_display_manager_set_default_display - // appropriately when necessary. - if (!gfxPlatform::IsHeadless()) { - # ifdef MOZ_WAYLAND - WaylandDisplayRelease(); -+ gWaylandProxy = nullptr; - # endif - } - #endif - - XRE_DeinitCommandLine(); - diff --git a/firefox.spec b/firefox.spec index c7e4eec..a5f7f51 100644 --- a/firefox.spec +++ b/firefox.spec @@ -179,7 +179,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 122.0 -Release: 5%{?pre_tag}%{?dist} +Release: 6%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -259,8 +259,6 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: D167159.diff -Patch409: D196554.diff -Patch410: D196555.diff # PGO/LTO patches Patch600: pgo.patch @@ -565,8 +563,6 @@ This package contains results of tests executed during build. %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 %patch408 -p1 -b .D167159 -%patch409 -p1 -b .D196554 -%patch410 -p1 -b .D196555 # PGO patches %if %{build_with_pgo} @@ -1190,6 +1186,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Feb 12 2024 Martin Stransky - 122.0-6 +- Temporary removed proxy cache (rhbz#2262959) + * Wed Jan 31 2024 Martin Stransky - 122.0-5 - Disabled system libvpx due to WebRTC/camera issues (mzbz#1875201) From 879253503bd1f176a77fccb52662ea0a4359a63a Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Fri, 2 Feb 2024 13:05:59 +0100 Subject: [PATCH 309/545] Backport upstream fixes to PipeWire camera support --- firefox.spec | 18 ++- ...pewire-be-shared-with-more-consumers.patch | 66 ++++++++ ...alization-of-cameraaccessstatus-enum.patch | 17 +++ ...simplify-thread-and-lock-annotations.patch | 144 ++++++++++++++++++ 4 files changed, 244 insertions(+), 1 deletion(-) create mode 100644 libwebrtc-allow-videocapturemodulepipewire-be-shared-with-more-consumers.patch create mode 100644 libwebrtc-fix-serialization-of-cameraaccessstatus-enum.patch create mode 100644 libwebrtc-simplify-thread-and-lock-annotations.patch diff --git a/firefox.spec b/firefox.spec index a5f7f51..240a055 100644 --- a/firefox.spec +++ b/firefox.spec @@ -179,7 +179,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 122.0 -Release: 6%{?pre_tag}%{?dist} +Release: 7%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -260,6 +260,15 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: D167159.diff +# Firefox 123 patches for PipeWire camera support +# https://phabricator.services.mozilla.com/D200147 +Patch420: libwebrtc-fix-serialization-of-cameraaccessstatus-enum.patch +# Firefox 124 patches for PipeWire camera support +# https://phabricator.services.mozilla.com/D200142 +Patch421: libwebrtc-allow-videocapturemodulepipewire-be-shared-with-more-consumers.patch +# https://phabricator.services.mozilla.com/D201328 +Patch422: libwebrtc-simplify-thread-and-lock-annotations.patch + # PGO/LTO patches Patch600: pgo.patch Patch602: mozilla-1516803.patch @@ -564,6 +573,10 @@ This package contains results of tests executed during build. %patch407 -p1 -b .1667096 %patch408 -p1 -b .D167159 +%patch420 -p1 -b .libwebrtc-fix-serialization-of-cameraaccessstatus-enum +%patch421 -p1 -b .libwebrtc-allow-videocapturemodulepipewire-be-shared-with-more-consumers +%patch422 -p1 -b .libwebrtc-simplify-thread-and-lock-annotations + # PGO patches %if %{build_with_pgo} %if !%{build_with_clang} @@ -1186,6 +1199,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Feb 12 2024 Jan Grulich - 122.0-7 +- Backport upstream fixes to PipeWire camera support + * Mon Feb 12 2024 Martin Stransky - 122.0-6 - Temporary removed proxy cache (rhbz#2262959) diff --git a/libwebrtc-allow-videocapturemodulepipewire-be-shared-with-more-consumers.patch b/libwebrtc-allow-videocapturemodulepipewire-be-shared-with-more-consumers.patch new file mode 100644 index 0000000..71f65e5 --- /dev/null +++ b/libwebrtc-allow-videocapturemodulepipewire-be-shared-with-more-consumers.patch @@ -0,0 +1,66 @@ +diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h +--- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h ++++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h +@@ -48,10 +48,11 @@ + const rtc::scoped_refptr session_ + RTC_GUARDED_BY(capture_checker_); + int node_id_ RTC_GUARDED_BY(capture_checker_); + VideoCaptureCapability configured_capability_ + RTC_GUARDED_BY(pipewire_checker_); ++ bool initialized_ RTC_GUARDED_BY(capture_checker_); + bool started_ RTC_GUARDED_BY(api_lock_); + + struct pw_stream* stream_ RTC_GUARDED_BY(pipewire_checker_) = nullptr; + struct spa_hook stream_listener_ RTC_GUARDED_BY(pipewire_checker_); + }; +diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc +--- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc ++++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc +@@ -46,11 +46,14 @@ + return VideoType::kUnknown; + } + + VideoCaptureModulePipeWire::VideoCaptureModulePipeWire( + VideoCaptureOptions* options) +- : VideoCaptureImpl(), session_(options->pipewire_session()) {} ++ : VideoCaptureImpl(), ++ session_(options->pipewire_session()), ++ initialized_(false), ++ started_(false) {} + + VideoCaptureModulePipeWire::~VideoCaptureModulePipeWire() { + RTC_DCHECK_RUN_ON(&api_checker_); + + StopCapture(); +@@ -119,10 +122,18 @@ + int32_t VideoCaptureModulePipeWire::StartCapture( + const VideoCaptureCapability& capability) { + RTC_CHECK_RUNS_SERIALIZED(&capture_checker_); + RTC_DCHECK_RUN_ON(&api_checker_); + ++ if (initialized_) { ++ if (capability == _requestedCapability) { ++ return 0; ++ } else { ++ StopCapture(); ++ } ++ } ++ + uint8_t buffer[1024] = {}; + + RTC_LOG(LS_VERBOSE) << "Creating new PipeWire stream for node " << node_id_; + + PipeWireThreadLoopLock thread_loop_lock(session_->pw_main_loop_); +@@ -169,10 +180,12 @@ + << spa_strerror(res); + return -1; + } + + _requestedCapability = capability; ++ initialized_ = true; ++ + return 0; + } + + int32_t VideoCaptureModulePipeWire::StopCapture() { + RTC_CHECK_RUNS_SERIALIZED(&capture_checker_); diff --git a/libwebrtc-fix-serialization-of-cameraaccessstatus-enum.patch b/libwebrtc-fix-serialization-of-cameraaccessstatus-enum.patch new file mode 100644 index 0000000..7334caa --- /dev/null +++ b/libwebrtc-fix-serialization-of-cameraaccessstatus-enum.patch @@ -0,0 +1,17 @@ +diff --git a/dom/media/systemservices/CamerasTypes.h b/dom/media/systemservices/CamerasTypes.h +--- a/dom/media/systemservices/CamerasTypes.h ++++ b/dom/media/systemservices/CamerasTypes.h +@@ -50,11 +50,11 @@ + mozilla::camera::CaptureEngine::InvalidEngine, + mozilla::camera::CaptureEngine::MaxEngine> {}; + + template <> + struct ParamTraits +- : public ContiguousEnumSerializer< ++ : public ContiguousEnumSerializerInclusive< + mozilla::camera::CamerasAccessStatus, + mozilla::camera::CamerasAccessStatus::Granted, + mozilla::camera::CamerasAccessStatus::Error> {}; + } // namespace IPC + + diff --git a/libwebrtc-simplify-thread-and-lock-annotations.patch b/libwebrtc-simplify-thread-and-lock-annotations.patch new file mode 100644 index 0000000..82f542b --- /dev/null +++ b/libwebrtc-simplify-thread-and-lock-annotations.patch @@ -0,0 +1,144 @@ +diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h +--- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h ++++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h +@@ -41,22 +41,20 @@ + static void OnStreamProcess(void* data); + + void OnFormatChanged(const struct spa_pod* format); + void ProcessBuffers(); + +- rtc::RaceChecker pipewire_checker_; +- + const rtc::scoped_refptr session_ +- RTC_GUARDED_BY(capture_checker_); ++ RTC_GUARDED_BY(api_checker_); ++ bool initialized_ RTC_GUARDED_BY(api_checker_); ++ bool started_ RTC_GUARDED_BY(api_lock_); + int node_id_ RTC_GUARDED_BY(capture_checker_); + VideoCaptureCapability configured_capability_ +- RTC_GUARDED_BY(pipewire_checker_); +- bool initialized_ RTC_GUARDED_BY(capture_checker_); +- bool started_ RTC_GUARDED_BY(api_lock_); ++ RTC_GUARDED_BY(capture_checker_); + +- struct pw_stream* stream_ RTC_GUARDED_BY(pipewire_checker_) = nullptr; +- struct spa_hook stream_listener_ RTC_GUARDED_BY(pipewire_checker_); ++ struct pw_stream* stream_ RTC_GUARDED_BY(capture_checker_) = nullptr; ++ struct spa_hook stream_listener_ RTC_GUARDED_BY(capture_checker_); + }; + } // namespace videocapturemodule + } // namespace webrtc + + #endif // MODULES_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_PIPEWIRE_H_ +diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc +--- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc ++++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc +@@ -119,11 +119,10 @@ + return static_cast(spa_pod_builder_pop(builder, &frames[0])); + } + + int32_t VideoCaptureModulePipeWire::StartCapture( + const VideoCaptureCapability& capability) { +- RTC_CHECK_RUNS_SERIALIZED(&capture_checker_); + RTC_DCHECK_RUN_ON(&api_checker_); + + if (initialized_) { + if (capability == _requestedCapability) { + return 0; +@@ -132,14 +131,21 @@ + } + } + + uint8_t buffer[1024] = {}; + ++ // We don't want members above to be guarded by capture_checker_ as ++ // it's meant to be for members that are accessed on the API thread ++ // only when we are not capturing. The code above can be called many ++ // times while sharing instance of VideoCapturePipeWire between ++ // websites and therefore it would not follow the requirements of this ++ // checker. ++ RTC_CHECK_RUNS_SERIALIZED(&capture_checker_); ++ PipeWireThreadLoopLock thread_loop_lock(session_->pw_main_loop_); ++ + RTC_LOG(LS_VERBOSE) << "Creating new PipeWire stream for node " << node_id_; + +- PipeWireThreadLoopLock thread_loop_lock(session_->pw_main_loop_); +- RTC_CHECK_RUNS_SERIALIZED(&pipewire_checker_); + pw_properties* reuse_props = + pw_properties_new_string("pipewire.client.reuse=1"); + stream_ = pw_stream_new(session_->pw_core_, "camera-stream", reuse_props); + + if (!stream_) { +@@ -186,15 +192,17 @@ + + return 0; + } + + int32_t VideoCaptureModulePipeWire::StopCapture() { +- RTC_CHECK_RUNS_SERIALIZED(&capture_checker_); + RTC_DCHECK_RUN_ON(&api_checker_); + + PipeWireThreadLoopLock thread_loop_lock(session_->pw_main_loop_); +- RTC_CHECK_RUNS_SERIALIZED(&pipewire_checker_); ++ // PipeWireSession is guarded by API checker so just make sure we do ++ // race detection when the PipeWire loop is locked/stopped to not run ++ // any callback at this point. ++ RTC_CHECK_RUNS_SERIALIZED(&capture_checker_); + if (stream_) { + pw_stream_destroy(stream_); + stream_ = nullptr; + } + +@@ -223,18 +231,18 @@ + uint32_t id, + const struct spa_pod* format) { + VideoCaptureModulePipeWire* that = + static_cast(data); + RTC_DCHECK(that); +- RTC_CHECK_RUNS_SERIALIZED(&that->pipewire_checker_); ++ RTC_CHECK_RUNS_SERIALIZED(&that->capture_checker_); + + if (format && id == SPA_PARAM_Format) + that->OnFormatChanged(format); + } + + void VideoCaptureModulePipeWire::OnFormatChanged(const struct spa_pod* format) { +- RTC_CHECK_RUNS_SERIALIZED(&pipewire_checker_); ++ RTC_CHECK_RUNS_SERIALIZED(&capture_checker_); + + uint32_t media_type, media_subtype; + + if (spa_format_parse(format, &media_type, &media_subtype) < 0) { + RTC_LOG(LS_ERROR) << "Failed to parse video format."; +@@ -329,11 +337,10 @@ + pw_stream_state state, + const char* error_message) { + VideoCaptureModulePipeWire* that = + static_cast(data); + RTC_DCHECK(that); +- RTC_CHECK_RUNS_SERIALIZED(&that->capture_checker_); + + MutexLock lock(&that->api_lock_); + switch (state) { + case PW_STREAM_STATE_STREAMING: + that->started_ = true; +@@ -372,11 +379,11 @@ + return kVideoRotation_0; + } + } + + void VideoCaptureModulePipeWire::ProcessBuffers() { +- RTC_CHECK_RUNS_SERIALIZED(&pipewire_checker_); ++ RTC_CHECK_RUNS_SERIALIZED(&capture_checker_); + + while (pw_buffer* buffer = pw_stream_dequeue_buffer(stream_)) { + struct spa_meta_header* h; + h = static_cast( + spa_buffer_find_meta_data(buffer->buffer, SPA_META_Header, sizeof(*h))); +diff --git a/third_party/libwebrtc/moz-patch-stack/541f202354.no-op-cherry-pick-msg b/third_party/libwebrtc/moz-patch-stack/541f202354.no-op-cherry-pick-msg +new file mode 100644 +--- /dev/null ++++ b/third_party/libwebrtc/moz-patch-stack/541f202354.no-op-cherry-pick-msg +@@ -0,0 +1 @@ ++We cherry-picked this in bug 1879752. + From aa5399618e1506934c195c296809ed865e2b7015 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 13 Feb 2024 14:20:27 +0100 Subject: [PATCH 310/545] Updated to 122.0.1 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 6d411f0..f7f1e8c 100644 --- a/.gitignore +++ b/.gitignore @@ -617,3 +617,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-121.0.1-20240112.tar.xz /firefox-122.0.source.tar.xz /firefox-langpacks-122.0-20240119.tar.xz +/firefox-langpacks-122.0.1-20240213.tar.xz +/firefox-122.0.1.source.tar.xz diff --git a/firefox.spec b/firefox.spec index 240a055..964b63a 100644 --- a/firefox.spec +++ b/firefox.spec @@ -178,8 +178,8 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 122.0 -Release: 7%{?pre_tag}%{?dist} +Version: 122.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1199,6 +1199,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Feb 13 2024 Martin Stransky - 122.0.1-1 +- Update to 122.0.1 + * Mon Feb 12 2024 Jan Grulich - 122.0-7 - Backport upstream fixes to PipeWire camera support diff --git a/sources b/sources index 2601ca9..315ce2d 100644 --- a/sources +++ b/sources @@ -1,5 +1,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 -SHA512 (firefox-122.0.source.tar.xz) = 619b735c16970207f3f8fb31dd2350a5e665a802c30501c89aee4817b8b0f7f466da93c66ab238e94967587e538e6858934b18164ff312dbdbfbc3b2bf8bd824 -SHA512 (firefox-langpacks-122.0-20240119.tar.xz) = 04b5a912f0c1bfaeaf33995f491df861aa12b8134f5b2dada52649f82b5fb224c1d696c521c2665eb93813b9015bdaf71a7a0f7aee1dc6ebed1836073e9c71c8 +SHA512 (firefox-langpacks-122.0.1-20240213.tar.xz) = b4e68b028e9cab4328bd0975f6d8d687add0933f23fa45db4b3e97f56c6585ec2b7d0e2e43eca5c57c79451993a15463fb88b3f7ff69412f52ee89115420487e +SHA512 (firefox-122.0.1.source.tar.xz) = 1d4fe1ed351edd748ede2ef6448798a32de9ed7a075a54a7ed5f7baa7b0c4c7f932c2e29f443c9066829e39f22a1dc94be5d00cc994193e949b72aa4a1c8ba41 From 922c11b957fb5f080ddac54ef9703d56cb35cf7c Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 14 Feb 2024 09:30:11 +0100 Subject: [PATCH 311/545] langpack fix --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 964b63a..c3d12a2 100644 --- a/firefox.spec +++ b/firefox.spec @@ -184,7 +184,7 @@ URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240119.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240213.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz From 51ab1ccbbcaa8582748a890de22e5462db89dd8c Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 19 Feb 2024 11:00:46 +0100 Subject: [PATCH 312/545] Update to 123.0 --- .gitignore | 2 + D167159.diff | 132 ------------------ firefox.spec | 13 +- ...alization-of-cameraaccessstatus-enum.patch | 17 --- pgo.patch | 42 +++--- sources | 4 +- 6 files changed, 30 insertions(+), 180 deletions(-) delete mode 100644 D167159.diff delete mode 100644 libwebrtc-fix-serialization-of-cameraaccessstatus-enum.patch diff --git a/.gitignore b/.gitignore index f7f1e8c..82558d2 100644 --- a/.gitignore +++ b/.gitignore @@ -619,3 +619,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-122.0-20240119.tar.xz /firefox-langpacks-122.0.1-20240213.tar.xz /firefox-122.0.1.source.tar.xz +/firefox-langpacks-123.0-20240219.tar.xz +/firefox-123.0.source.tar.xz diff --git a/D167159.diff b/D167159.diff deleted file mode 100644 index a9261b0..0000000 --- a/D167159.diff +++ /dev/null @@ -1,132 +0,0 @@ -diff --git a/dom/canvas/ClientWebGLContext.cpp b/dom/canvas/ClientWebGLContext.cpp ---- a/dom/canvas/ClientWebGLContext.cpp -+++ b/dom/canvas/ClientWebGLContext.cpp -@@ -4253,11 +4253,12 @@ - const auto& sd = *(desc->sd); - const auto sdType = sd.type(); - const auto& contextInfo = mNotLost->info; - - const auto fallbackReason = [&]() -> Maybe { -- auto fallbackReason = BlitPreventReason(level, offset, pi, *desc); -+ auto fallbackReason = -+ BlitPreventReason(level, offset, pi, *desc, Limits()); - if (fallbackReason) return fallbackReason; - - const bool canUploadViaSd = contextInfo.uploadableSdTypes[sdType]; - if (!canUploadViaSd) { - const nsPrintfCString msg( -diff --git a/dom/canvas/TexUnpackBlob.h b/dom/canvas/TexUnpackBlob.h ---- a/dom/canvas/TexUnpackBlob.h -+++ b/dom/canvas/TexUnpackBlob.h -@@ -41,11 +41,12 @@ - struct PackingInfo; - struct DriverUnpackInfo; - - Maybe BlitPreventReason(int32_t level, const ivec3& offset, - const webgl::PackingInfo&, -- const TexUnpackBlobDesc&); -+ const TexUnpackBlobDesc&, -+ const Limits& limits); - - class TexUnpackBlob { - public: - const TexUnpackBlobDesc& mDesc; - bool mNeedsExactUpload = true; -diff --git a/dom/canvas/TexUnpackBlob.cpp b/dom/canvas/TexUnpackBlob.cpp ---- a/dom/canvas/TexUnpackBlob.cpp -+++ b/dom/canvas/TexUnpackBlob.cpp -@@ -658,11 +658,12 @@ - return ValidateUnpackPixels(webgl, pi, fullRows, *this); - } - - Maybe BlitPreventReason(const int32_t level, const ivec3& offset, - const webgl::PackingInfo& pi, -- const TexUnpackBlobDesc& desc) { -+ const TexUnpackBlobDesc& desc, -+ const Limits& limits) { - const auto& size = desc.size; - const auto& unpacking = desc.unpacking; - - const auto ret = [&]() -> const char* { - if (size.z != 1) { -@@ -689,12 +690,16 @@ - return "UNPACK_PREMULTIPLY_ALPHA_WEBGL is not false"; - } - }(); - if (premultReason) return premultReason; - -- if (pi.format != LOCAL_GL_RGBA) { -- return "`format` is not RGBA"; -+ if (pi.format != LOCAL_GL_RGBA && pi.format != LOCAL_GL_RGB) { -+ return "`format` is not RGBA or RGB"; -+ } -+ -+ if (pi.format == LOCAL_GL_RGB && !limits.rgbColorRenderable) { -+ return "`format` is RGB, which is not color-renderable"; - } - - if (pi.type != LOCAL_GL_UNSIGNED_BYTE) { - return "`type` is not UNSIGNED_BYTE"; - } -@@ -722,12 +727,12 @@ - - const auto& gl = webgl->GL(); - - // - - -- const auto reason = -- BlitPreventReason(level, {xOffset, yOffset, zOffset}, pi, mDesc); -+ const auto reason = BlitPreventReason(level, {xOffset, yOffset, zOffset}, pi, -+ mDesc, tex->mContext->Limits()); - if (reason) { - webgl->GeneratePerfWarning( - "Failed to hit GPU-copy fast-path." - " (%s) Falling back to CPU upload.", - reason->c_str()); -diff --git a/dom/canvas/WebGLContextValidate.cpp b/dom/canvas/WebGLContextValidate.cpp ---- a/dom/canvas/WebGLContextValidate.cpp -+++ b/dom/canvas/WebGLContextValidate.cpp -@@ -239,10 +239,12 @@ - [WebGLExtensionID::WEBGL_compressed_texture_astc]) { - limits.astcHdr = gl.IsExtensionSupported( - gl::GLContext::KHR_texture_compression_astc_hdr); - } - -+ limits.rgbColorRenderable = webgl.gl->IsRGBColorRenderable(); -+ - if (webgl.IsWebGL2() || - limits.supportedExtensions[WebGLExtensionID::WEBGL_draw_buffers]) { - gl.GetUIntegerv(LOCAL_GL_MAX_DRAW_BUFFERS, &limits.maxColorDrawBuffers); - } - -diff --git a/dom/canvas/WebGLTypes.h b/dom/canvas/WebGLTypes.h ---- a/dom/canvas/WebGLTypes.h -+++ b/dom/canvas/WebGLTypes.h -@@ -663,10 +663,11 @@ - uint32_t maxUniformBufferBindings = 0; - uint32_t uniformBufferOffsetAlignment = 0; - - // Exts - bool astcHdr = false; -+ bool rgbColorRenderable = false; - uint32_t maxColorDrawBuffers = 1; - uint64_t queryCounterBitsTimeElapsed = 0; - uint64_t queryCounterBitsTimestamp = 0; - uint32_t maxMultiviewLayers = 0; - }; -diff --git a/gfx/gl/GLContext.h b/gfx/gl/GLContext.h ---- a/gfx/gl/GLContext.h -+++ b/gfx/gl/GLContext.h -@@ -290,10 +290,11 @@ - mTopError = GetError(); - return IsContextLost(); - } - - bool HasPBOState() const { return (!IsGLES() || Version() >= 300); } -+ bool IsRGBColorRenderable() { return !IsGLES() || Version() >= 300; } - - /** - * If this context is double-buffered, returns TRUE. - */ - virtual bool IsDoubleBuffered() const { return false; } - diff --git a/firefox.spec b/firefox.spec index c3d12a2..7e46fa8 100644 --- a/firefox.spec +++ b/firefox.spec @@ -178,13 +178,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 122.0.1 +Version: 123.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240213.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240219.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -258,11 +258,7 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch -Patch408: D167159.diff -# Firefox 123 patches for PipeWire camera support -# https://phabricator.services.mozilla.com/D200147 -Patch420: libwebrtc-fix-serialization-of-cameraaccessstatus-enum.patch # Firefox 124 patches for PipeWire camera support # https://phabricator.services.mozilla.com/D200142 Patch421: libwebrtc-allow-videocapturemodulepipewire-be-shared-with-more-consumers.patch @@ -571,9 +567,7 @@ This package contains results of tests executed during build. %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 -%patch408 -p1 -b .D167159 -%patch420 -p1 -b .libwebrtc-fix-serialization-of-cameraaccessstatus-enum %patch421 -p1 -b .libwebrtc-allow-videocapturemodulepipewire-be-shared-with-more-consumers %patch422 -p1 -b .libwebrtc-simplify-thread-and-lock-annotations @@ -1199,6 +1193,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Feb 19 2024 Martin Stransky - 123.0-1 +- Update to 123.0 + * Tue Feb 13 2024 Martin Stransky - 122.0.1-1 - Update to 122.0.1 diff --git a/libwebrtc-fix-serialization-of-cameraaccessstatus-enum.patch b/libwebrtc-fix-serialization-of-cameraaccessstatus-enum.patch deleted file mode 100644 index 7334caa..0000000 --- a/libwebrtc-fix-serialization-of-cameraaccessstatus-enum.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/dom/media/systemservices/CamerasTypes.h b/dom/media/systemservices/CamerasTypes.h ---- a/dom/media/systemservices/CamerasTypes.h -+++ b/dom/media/systemservices/CamerasTypes.h -@@ -50,11 +50,11 @@ - mozilla::camera::CaptureEngine::InvalidEngine, - mozilla::camera::CaptureEngine::MaxEngine> {}; - - template <> - struct ParamTraits -- : public ContiguousEnumSerializer< -+ : public ContiguousEnumSerializerInclusive< - mozilla::camera::CamerasAccessStatus, - mozilla::camera::CamerasAccessStatus::Granted, - mozilla::camera::CamerasAccessStatus::Error> {}; - } // namespace IPC - - diff --git a/pgo.patch b/pgo.patch index b99616f..5a092bf 100644 --- a/pgo.patch +++ b/pgo.patch @@ -1,7 +1,7 @@ -diff -up firefox-122.0/build/moz.configure/lto-pgo.configure.pgo firefox-122.0/build/moz.configure/lto-pgo.configure ---- firefox-122.0/build/moz.configure/lto-pgo.configure.pgo 2024-01-18 21:41:19.000000000 +0100 -+++ firefox-122.0/build/moz.configure/lto-pgo.configure 2024-01-19 18:21:17.974681504 +0100 -@@ -86,7 +86,7 @@ def pgo_flags(compiler, profdata, target +diff -up firefox-123.0/build/moz.configure/lto-pgo.configure.pgo firefox-123.0/build/moz.configure/lto-pgo.configure +--- firefox-123.0/build/moz.configure/lto-pgo.configure.pgo 2024-02-14 08:18:40.000000000 +0100 ++++ firefox-123.0/build/moz.configure/lto-pgo.configure 2024-02-19 10:51:40.900650193 +0100 +@@ -130,7 +130,7 @@ def pgo_flags(compiler, linker, profdata return namespace( gen_cflags=["-fprofile-generate"], gen_ldflags=["-fprofile-generate"], @@ -10,9 +10,9 @@ diff -up firefox-122.0/build/moz.configure/lto-pgo.configure.pgo firefox-122.0/b use_ldflags=["-fprofile-use"], ) -diff -up firefox-122.0/build/pgo/profileserver.py.pgo firefox-122.0/build/pgo/profileserver.py ---- firefox-122.0/build/pgo/profileserver.py.pgo 2024-01-18 21:41:20.000000000 +0100 -+++ firefox-122.0/build/pgo/profileserver.py 2024-01-19 18:21:17.974681504 +0100 +diff -up firefox-123.0/build/pgo/profileserver.py.pgo firefox-123.0/build/pgo/profileserver.py +--- firefox-123.0/build/pgo/profileserver.py.pgo 2024-02-14 08:18:40.000000000 +0100 ++++ firefox-123.0/build/pgo/profileserver.py 2024-02-19 10:51:40.900650193 +0100 @@ -11,7 +11,7 @@ import subprocess import sys @@ -48,10 +48,10 @@ diff -up firefox-122.0/build/pgo/profileserver.py.pgo firefox-122.0/build/pgo/pr with TemporaryDirectory() as profilePath: # TODO: refactor this into mozprofile -diff -up firefox-122.0/gfx/2d/moz.build.pgo firefox-122.0/gfx/2d/moz.build ---- firefox-122.0/gfx/2d/moz.build.pgo 2024-01-18 21:41:22.000000000 +0100 -+++ firefox-122.0/gfx/2d/moz.build 2024-01-19 18:21:17.974681504 +0100 -@@ -137,11 +137,11 @@ if CONFIG["INTEL_ARCHITECTURE"]: +diff -up firefox-123.0/gfx/2d/moz.build.pgo firefox-123.0/gfx/2d/moz.build +--- firefox-123.0/gfx/2d/moz.build.pgo 2024-02-19 10:51:40.900650193 +0100 ++++ firefox-123.0/gfx/2d/moz.build 2024-02-19 10:57:34.770832810 +0100 +@@ -134,11 +134,11 @@ if CONFIG["INTEL_ARCHITECTURE"]: # The file uses SSE2 intrinsics, so it needs special compile flags on some # compilers. SOURCES["BlurSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] @@ -64,10 +64,10 @@ diff -up firefox-122.0/gfx/2d/moz.build.pgo firefox-122.0/gfx/2d/moz.build + SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2", "-fno-lto"] SOURCES["SwizzleSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] SOURCES["SwizzleSSSE3.cpp"].flags += CONFIG["SSSE3_FLAGS"] - SOURCES["ssse3-scaler.c"].flags += CONFIG["SSSE3_FLAGS"] -diff -up firefox-122.0/gfx/skia/generate_mozbuild.py.pgo firefox-122.0/gfx/skia/generate_mozbuild.py ---- firefox-122.0/gfx/skia/generate_mozbuild.py.pgo 2024-01-19 18:21:17.975681537 +0100 -+++ firefox-122.0/gfx/skia/generate_mozbuild.py 2024-01-19 18:24:15.494934133 +0100 + elif CONFIG["TARGET_CPU"].startswith("mips"): +diff -up firefox-123.0/gfx/skia/generate_mozbuild.py.pgo firefox-123.0/gfx/skia/generate_mozbuild.py +--- firefox-123.0/gfx/skia/generate_mozbuild.py.pgo 2024-02-14 08:18:42.000000000 +0100 ++++ firefox-123.0/gfx/skia/generate_mozbuild.py 2024-02-19 10:51:40.901650227 +0100 @@ -54,10 +54,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind if CONFIG['INTEL_ARCHITECTURE']: SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3', '-mssse3'] @@ -82,9 +82,9 @@ diff -up firefox-122.0/gfx/skia/generate_mozbuild.py.pgo firefox-122.0/gfx/skia/ elif CONFIG['TARGET_CPU'] == 'aarch64' and CONFIG['CC_TYPE'] in ('clang', 'gcc'): SOURCES['skia/src/opts/SkOpts_crc32.cpp'].flags += ['-Dskvx=skvx_crc32', '-march=armv8-a+crc'] -diff -up firefox-122.0/gfx/skia/moz.build.pgo firefox-122.0/gfx/skia/moz.build ---- firefox-122.0/gfx/skia/moz.build.pgo 2024-01-19 18:21:17.975681537 +0100 -+++ firefox-122.0/gfx/skia/moz.build 2024-01-19 18:25:13.472039275 +0100 +diff -up firefox-123.0/gfx/skia/moz.build.pgo firefox-123.0/gfx/skia/moz.build +--- firefox-123.0/gfx/skia/moz.build.pgo 2024-02-14 08:18:42.000000000 +0100 ++++ firefox-123.0/gfx/skia/moz.build 2024-02-19 10:51:40.901650227 +0100 @@ -564,10 +564,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind if CONFIG['INTEL_ARCHITECTURE']: SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3', '-mssse3'] @@ -99,9 +99,9 @@ diff -up firefox-122.0/gfx/skia/moz.build.pgo firefox-122.0/gfx/skia/moz.build elif CONFIG['TARGET_CPU'] == 'aarch64' and CONFIG['CC_TYPE'] in ('clang', 'gcc'): SOURCES['skia/src/opts/SkOpts_crc32.cpp'].flags += ['-Dskvx=skvx_crc32', '-march=armv8-a+crc'] -diff -up firefox-122.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-122.0/toolkit/components/terminator/nsTerminator.cpp ---- firefox-122.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2024-01-18 21:41:36.000000000 +0100 -+++ firefox-122.0/toolkit/components/terminator/nsTerminator.cpp 2024-01-19 18:21:17.976681572 +0100 +diff -up firefox-123.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-123.0/toolkit/components/terminator/nsTerminator.cpp +--- firefox-123.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2024-02-14 08:18:56.000000000 +0100 ++++ firefox-123.0/toolkit/components/terminator/nsTerminator.cpp 2024-02-19 10:51:40.901650227 +0100 @@ -460,6 +460,11 @@ void nsTerminator::StartWatchdog() { } #endif diff --git a/sources b/sources index 315ce2d..107e4b8 100644 --- a/sources +++ b/sources @@ -1,5 +1,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 -SHA512 (firefox-langpacks-122.0.1-20240213.tar.xz) = b4e68b028e9cab4328bd0975f6d8d687add0933f23fa45db4b3e97f56c6585ec2b7d0e2e43eca5c57c79451993a15463fb88b3f7ff69412f52ee89115420487e -SHA512 (firefox-122.0.1.source.tar.xz) = 1d4fe1ed351edd748ede2ef6448798a32de9ed7a075a54a7ed5f7baa7b0c4c7f932c2e29f443c9066829e39f22a1dc94be5d00cc994193e949b72aa4a1c8ba41 +SHA512 (firefox-langpacks-123.0-20240219.tar.xz) = 01d81f8bdf71ba294896e2d3b6f328e2e493dd8b230f7772ae862286328f9b83d7d94b504e11ae9a9636ae6e8c06e90ce3198c1473f9be2698a588a9da10621e +SHA512 (firefox-123.0.source.tar.xz) = a19567a13e1b663e538c4af17491146adad1f0ab977995e8da9ce9ed428008ad20902dee4efb82d54e1319a0e31768609696bc822563d75732b622760129d8bb From 2075e765ccd405932d7a2dad7d439155df4e66ba Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 19 Feb 2024 14:41:27 +0100 Subject: [PATCH 313/545] Updated NSS version --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 7e46fa8..c62a3bc 100644 --- a/firefox.spec +++ b/firefox.spec @@ -134,7 +134,7 @@ ExcludeArch: i686 %if %{?system_nss} %global nspr_version 4.32 %global nspr_build_version %{nspr_version} -%global nss_version 3.95 +%global nss_version 3.97 %global nss_build_version %{nss_version} %endif From d7219ad705eb41bd94b744cbcf149985e8439400 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 20 Feb 2024 12:15:44 +0100 Subject: [PATCH 314/545] disabled system AV1 due to build issues. --- firefox.spec | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/firefox.spec b/firefox.spec index c62a3bc..96dcb30 100644 --- a/firefox.spec +++ b/firefox.spec @@ -65,8 +65,8 @@ ExcludeArch: i686 %endif %global system_ffi 1 -%global system_av1 1 -%global system_libvpx 0 +%global system_av1 0 +%global system_libvpx 1 %global system_jpeg 1 %global system_pixman 1 %global system_webp 1 @@ -580,8 +580,8 @@ This package contains results of tests executed during build. %endif %patch603 -p1 -b .inline -%patch800 -p1 -b .system-av1 -%patch801 -p1 -b .system-av1-fixup +#%patch800 -p1 -b .system-av1 +#%patch801 -p1 -b .system-av1-fixup %patch1200 -p1 -b .rustflags-commasplit @@ -663,9 +663,9 @@ echo "ac_add_options --enable-system-pixman" >> .mozconfig %endif %if %{?system_av1} -echo "ac_add_options --with-system-av1" >> .mozconfig +#echo "ac_add_options --with-system-av1" >> .mozconfig %else -echo "ac_add_options --without-system-av1" >> .mozconfig +#echo "ac_add_options --without-system-av1" >> .mozconfig %endif %if %{?system_libvpx} @@ -1195,6 +1195,7 @@ fi %changelog * Mon Feb 19 2024 Martin Stransky - 123.0-1 - Update to 123.0 +- disabled system AV1 due to build issues. * Tue Feb 13 2024 Martin Stransky - 122.0.1-1 - Update to 122.0.1 From 6411e9e37788448993f6be62400bb6a27f9c94cc Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 21 Feb 2024 20:25:14 +0100 Subject: [PATCH 315/545] Disabled PGO --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 96dcb30..9b221ba 100644 --- a/firefox.spec +++ b/firefox.spec @@ -85,7 +85,7 @@ ExcludeArch: i686 %global build_with_pgo 0 %ifarch x86_64 %if %{release_build} -%global build_with_pgo 1 +%global build_with_pgo 0 %endif %endif %if 0%{?flatpak} From 79c81d26294f8953aefe0d2209b9017895b4e5ca Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 22 Feb 2024 09:17:33 +0100 Subject: [PATCH 316/545] Add matching AppStream metadata for org.mozilla.firefox.desktop --- firefox.spec | 22 ++++++++--- org.mozilla.firefox.appdata.xml.in | 60 ++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 5 deletions(-) create mode 100644 org.mozilla.firefox.appdata.xml.in diff --git a/firefox.spec b/firefox.spec index 9b221ba..4acb082 100644 --- a/firefox.spec +++ b/firefox.spec @@ -179,7 +179,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 123.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -216,6 +216,7 @@ Source44: print-error-reftest Source45: run-wayland-compositor Source46: org.mozilla.firefox.SearchProvider.service Source47: org.mozilla.firefox.desktop +Source48: org.mozilla.firefox.appdata.xml.in # Build patches #Patch3: mozilla-build-arm.patch @@ -911,7 +912,7 @@ mkdir -p %{buildroot}%{_datadir}/dbus-1/services cp %{SOURCE46} %{buildroot}%{_datadir}/dbus-1/services %endif -%if %{gnome_shell_search_provider} +%if 0%{?fedora} >= 40 desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE47} %else # We can't use desktop-file-install as it refuses to install firefox.desktop file. @@ -1061,9 +1062,15 @@ cp %{SOURCE26} %{buildroot}%{mozappdir}/distribution # Install appdata file mkdir -p %{buildroot}%{_datadir}/metainfo +%if 0%{?fedora} >= 40 +sed -e "s/__VERSION__/%{version}/" \ + -e "s/__DATE__/$(date '+%F')/" \ + %{SOURCE48} > %{buildroot}%{_datadir}/metainfo/org.mozilla.firefox.appdata.xml +%else sed -e "s/__VERSION__/%{version}/" \ -e "s/__DATE__/$(date '+%F')/" \ %{SOURCE33} > %{buildroot}%{_datadir}/metainfo/firefox.appdata.xml +%endif # Remove copied libraries to speed up build rm -f %{buildroot}%{mozappdirdev}/sdk/lib/libmozjs.so @@ -1127,13 +1134,15 @@ fi %dir %{_sysconfdir}/%{name}/* %dir %{_datadir}/mozilla/extensions/* %dir %{_libdir}/mozilla/extensions/* -%if %{gnome_shell_search_provider} +%if 0%{?fedora} >= 40 %{_datadir}/applications/org.mozilla.firefox.desktop -%{_datadir}/dbus-1/services/* -%{_datadir}/gnome-shell/search-providers/*.ini %else %{_datadir}/applications/firefox.desktop %endif +%if %{gnome_shell_search_provider} +%{_datadir}/dbus-1/services/* +%{_datadir}/gnome-shell/search-providers/*.ini +%endif %{_datadir}/metainfo/*.appdata.xml %dir %{mozappdir} %license %{mozappdir}/LICENSE @@ -1193,6 +1202,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Feb 21 2024 Daniel Rusek - 123.0-2 +- Add matching AppStream metadata for org.mozilla.firefox.desktop + * Mon Feb 19 2024 Martin Stransky - 123.0-1 - Update to 123.0 - disabled system AV1 due to build issues. diff --git a/org.mozilla.firefox.appdata.xml.in b/org.mozilla.firefox.appdata.xml.in new file mode 100644 index 0000000..bd2acae --- /dev/null +++ b/org.mozilla.firefox.appdata.xml.in @@ -0,0 +1,60 @@ + + + + org.mozilla.firefox.desktop + CC0-1.0 + Firefox + Web Browser + Navegador web + Webový prohlížeč + Navegador web + مرورگر اینترنتی + WWW-selain + Navigateur Web + Webböngésző + Browser Web + ウェブ・ブラウザ + 웹 브라우저 + Nettleser + Webbrowser + Nettlesar + Nettleser + Przeglądarka WWW + Navegador Web + Navegador Web + Internetový prehliadač + Webbläsare + +

+ Bringing together all kinds of awesomeness to make browsing better for you. + Get to your favorite sites quickly – even if you don’t remember the URLs. + Type your term into the location bar (aka the Awesome Bar) and the autocomplete + function will include possible matches from your browsing history, bookmarked + sites and open tabs. +

+
+ https://www.mozilla.org + stransky@redhat.com + + ModernToolkit + SearchProvider + + Mozilla + GPL-3.0+ + Mozilla Corporation + https://bugzilla.mozilla.org/ + https://support.mozilla.org/ + firefox + org.mozilla.firefox.desktop + + firefox.desktop + + + https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/a.png + https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/b.png + https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/c.png + + + + +
From c7916c91f8b77c127f312e6d17aa6360f82f3d63 Mon Sep 17 00:00:00 2001 From: Daniel Rusek Date: Thu, 22 Feb 2024 12:26:08 +0000 Subject: [PATCH 317/545] Add OARS rating to AppStream metadata --- org.mozilla.firefox.appdata.xml.in | 1 + 1 file changed, 1 insertion(+) diff --git a/org.mozilla.firefox.appdata.xml.in b/org.mozilla.firefox.appdata.xml.in index bd2acae..9ac4f36 100644 --- a/org.mozilla.firefox.appdata.xml.in +++ b/org.mozilla.firefox.appdata.xml.in @@ -54,6 +54,7 @@ https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/b.png https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/c.png + From eacd934cf3cf693bbf08c27a2761b00f29359bc2 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 23 Feb 2024 19:31:52 +0100 Subject: [PATCH 318/545] Fixed & enabled PGO builds --- firefox.spec | 35 ++++++++++++++--------------------- pgo.patch | 36 +++++++++++++++++++++++++++--------- run-wayland-compositor | 22 ++++++++++++++-------- 3 files changed, 55 insertions(+), 38 deletions(-) diff --git a/firefox.spec b/firefox.spec index 4acb082..d74abe6 100644 --- a/firefox.spec +++ b/firefox.spec @@ -28,7 +28,6 @@ ExcludeArch: i686 %global system_nss 1 %global system_libevent 1 %global build_with_asan 0 -%global test_on_wayland 0 %ifarch x86_64 %{ix86} %global enable_replace_malloc 1 %else @@ -85,7 +84,7 @@ ExcludeArch: i686 %global build_with_pgo 0 %ifarch x86_64 %if %{release_build} -%global build_with_pgo 0 +%global build_with_pgo 1 %endif %endif %if 0%{?flatpak} @@ -107,10 +106,10 @@ ExcludeArch: i686 %endif %global launch_wayland_compositor 0 -%if %{build_with_pgo} && %{test_on_wayland} +%if %{build_with_pgo} %global launch_wayland_compositor 1 %endif -%if %{run_firefox_tests} && %{test_on_wayland} +%if %{run_firefox_tests} %global launch_wayland_compositor 1 %endif @@ -390,7 +389,7 @@ BuildRequires: libasan-static %endif BuildRequires: perl-interpreter BuildRequires: fdk-aac-free-devel -%if 0%{?test_on_wayland} +%if 0%{?launch_wayland_compositor} BuildRequires: mutter BuildRequires: gsettings-desktop-schemas BuildRequires: gnome-settings-daemon @@ -841,7 +840,7 @@ echo "mk_add_options MOZ_MAKE_FLAGS=\"-j%{_smp_build_ncpus}\"" >> .mozconfig echo "mk_add_options MOZ_SERVICES_SYNC=1" >> .mozconfig echo "export STRIP=/bin/true" >> .mozconfig -%if %{launch_wayland_compositor} +%if %{build_with_pgo} cp %{SOURCE45} . . ./run-wayland-compositor %endif @@ -857,15 +856,10 @@ tar xf %{SOURCE37} #Use python 3.11 for mach sed -i -e 's|#!/usr/bin/env python3|#!/usr/bin/env python3.11|' mach -%if %{build_with_pgo} -%if %{test_on_wayland} -env | grep "WAYLAND" -MOZ_ENABLE_WAYLAND=1 ./mach build -v 2>&1 | cat - || exit 1 -%else -xvfb-run ./mach build -v 2>&1 | cat - || exit 1 -%endif -%else ./mach build -v 2>&1 | cat - || exit 1 + +%if %{build_with_pgo} +kill $MUTTER_PID %endif #--------------------------------------------------------------------- @@ -873,21 +867,17 @@ xvfb-run ./mach build -v 2>&1 | cat - || exit 1 # run Firefox test suite # Do we need it? # export MACH_NATIVE_PACKAGE_SOURCE=system -%if %{launch_wayland_compositor} +%if %{run_firefox_tests} cp %{SOURCE45} . . ./run-wayland-compositor -%endif -%if 0%{?run_firefox_tests} cp %{SOURCE40} %{SOURCE41} %{SOURCE42} %{SOURCE38} %{SOURCE39} %{SOURCE43} %{SOURCE44} . mkdir -p test_results -%if %{test_on_wayland} ./run-tests-wayland || true -%else -./run-tests-x11 || true -%endif ./print_results > test_summary.txt 2>&1 || true ./print_failures || true + +kill $MUTTER_PID %endif # set up our default bookmarks @@ -1202,6 +1192,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Feb 23 2024 Martin Stransky - 123.0-2 +- Fixed PGO builds and enabled it again. + * Wed Feb 21 2024 Daniel Rusek - 123.0-2 - Add matching AppStream metadata for org.mozilla.firefox.desktop diff --git a/pgo.patch b/pgo.patch index 5a092bf..6499434 100644 --- a/pgo.patch +++ b/pgo.patch @@ -1,7 +1,25 @@ diff -up firefox-123.0/build/moz.configure/lto-pgo.configure.pgo firefox-123.0/build/moz.configure/lto-pgo.configure ---- firefox-123.0/build/moz.configure/lto-pgo.configure.pgo 2024-02-14 08:18:40.000000000 +0100 -+++ firefox-123.0/build/moz.configure/lto-pgo.configure 2024-02-19 10:51:40.900650193 +0100 -@@ -130,7 +130,7 @@ def pgo_flags(compiler, linker, profdata +--- firefox-123.0/build/moz.configure/lto-pgo.configure.pgo 2024-02-22 10:53:12.608509264 +0100 ++++ firefox-123.0/build/moz.configure/lto-pgo.configure 2024-02-22 10:56:14.911881765 +0100 +@@ -90,12 +90,16 @@ set_config("PGO_PROFILE_PATH", pgo_profi + + @depends( + "--enable-profile-use", ++ c_compiler, + pgo_profile_path, + llvm_profdata, + llvm_profdata_order, + build_environment, + ) +-def orderfile_path(profile_use, path, profdata, profdata_order, build_env): ++def orderfile_path(profile_use, compiler, path, profdata, profdata_order, build_env): ++ if compiler.type == "gcc": ++ return None ++ + if not profile_use: + return None + +@@ -130,7 +134,7 @@ def pgo_flags(compiler, linker, profdata return namespace( gen_cflags=["-fprofile-generate"], gen_ldflags=["-fprofile-generate"], @@ -12,7 +30,7 @@ diff -up firefox-123.0/build/moz.configure/lto-pgo.configure.pgo firefox-123.0/b diff -up firefox-123.0/build/pgo/profileserver.py.pgo firefox-123.0/build/pgo/profileserver.py --- firefox-123.0/build/pgo/profileserver.py.pgo 2024-02-14 08:18:40.000000000 +0100 -+++ firefox-123.0/build/pgo/profileserver.py 2024-02-19 10:51:40.900650193 +0100 ++++ firefox-123.0/build/pgo/profileserver.py 2024-02-22 10:06:42.665963053 +0100 @@ -11,7 +11,7 @@ import subprocess import sys @@ -49,8 +67,8 @@ diff -up firefox-123.0/build/pgo/profileserver.py.pgo firefox-123.0/build/pgo/pr with TemporaryDirectory() as profilePath: # TODO: refactor this into mozprofile diff -up firefox-123.0/gfx/2d/moz.build.pgo firefox-123.0/gfx/2d/moz.build ---- firefox-123.0/gfx/2d/moz.build.pgo 2024-02-19 10:51:40.900650193 +0100 -+++ firefox-123.0/gfx/2d/moz.build 2024-02-19 10:57:34.770832810 +0100 +--- firefox-123.0/gfx/2d/moz.build.pgo 2024-02-14 08:18:41.000000000 +0100 ++++ firefox-123.0/gfx/2d/moz.build 2024-02-22 10:06:42.665963053 +0100 @@ -134,11 +134,11 @@ if CONFIG["INTEL_ARCHITECTURE"]: # The file uses SSE2 intrinsics, so it needs special compile flags on some # compilers. @@ -67,7 +85,7 @@ diff -up firefox-123.0/gfx/2d/moz.build.pgo firefox-123.0/gfx/2d/moz.build elif CONFIG["TARGET_CPU"].startswith("mips"): diff -up firefox-123.0/gfx/skia/generate_mozbuild.py.pgo firefox-123.0/gfx/skia/generate_mozbuild.py --- firefox-123.0/gfx/skia/generate_mozbuild.py.pgo 2024-02-14 08:18:42.000000000 +0100 -+++ firefox-123.0/gfx/skia/generate_mozbuild.py 2024-02-19 10:51:40.901650227 +0100 ++++ firefox-123.0/gfx/skia/generate_mozbuild.py 2024-02-22 10:06:42.665963053 +0100 @@ -54,10 +54,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind if CONFIG['INTEL_ARCHITECTURE']: SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3', '-mssse3'] @@ -84,7 +102,7 @@ diff -up firefox-123.0/gfx/skia/generate_mozbuild.py.pgo firefox-123.0/gfx/skia/ diff -up firefox-123.0/gfx/skia/moz.build.pgo firefox-123.0/gfx/skia/moz.build --- firefox-123.0/gfx/skia/moz.build.pgo 2024-02-14 08:18:42.000000000 +0100 -+++ firefox-123.0/gfx/skia/moz.build 2024-02-19 10:51:40.901650227 +0100 ++++ firefox-123.0/gfx/skia/moz.build 2024-02-22 10:06:42.666963088 +0100 @@ -564,10 +564,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind if CONFIG['INTEL_ARCHITECTURE']: SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3', '-mssse3'] @@ -101,7 +119,7 @@ diff -up firefox-123.0/gfx/skia/moz.build.pgo firefox-123.0/gfx/skia/moz.build diff -up firefox-123.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-123.0/toolkit/components/terminator/nsTerminator.cpp --- firefox-123.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2024-02-14 08:18:56.000000000 +0100 -+++ firefox-123.0/toolkit/components/terminator/nsTerminator.cpp 2024-02-19 10:51:40.901650227 +0100 ++++ firefox-123.0/toolkit/components/terminator/nsTerminator.cpp 2024-02-22 10:06:42.666963088 +0100 @@ -460,6 +460,11 @@ void nsTerminator::StartWatchdog() { } #endif diff --git a/run-wayland-compositor b/run-wayland-compositor index 0480ed2..7290d5c 100755 --- a/run-wayland-compositor +++ b/run-wayland-compositor @@ -26,15 +26,19 @@ if [ -z "$XDG_RUNTIME_DIR" ]; then export XDG_RUNTIME_DIR=$HOME fi -. xvfb-run -s "-screen 0 1600x1200x24" -n 80 mutter --display=:80 --wayland --nested & -export DISPLAY=:80 +export WAYLAND_DISPLAY=firefox-wayland-0 -if [ -z "$WAYLAND_DISPLAY" ] ; then - export WAYLAND_DISPLAY=wayland-0 -else - export WAYLAND_DISPLAY=wayland-1 +if [ -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]; then + rm -f $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY fi -sleep 10 + +echo "Launch mutter for $WAYLAND_DISPLAY" +mutter --wayland --wayland-display=$WAYLAND_DISPLAY --headless --virtual-monitor=1600x1200 & MUTTER_PID=$! +export MUTTER_PID +echo "Mutter PID $MUTTER_PID" + +echo "Waiting for mutter to start..." +sleep 5 retry_count=0 max_retries=5 until [ $retry_count -gt $max_retries ]; do @@ -47,4 +51,6 @@ until [ $retry_count -gt $max_retries ]; do fi done -env | grep "DISPLAY" +if [ -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]; then + echo "Mutter is running, $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY is here." +fi From 529383b5e0d017df8424de99ba21d31561be5059 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 27 Feb 2024 12:37:56 +0100 Subject: [PATCH 319/545] Fixed PGO/wayland compositor run --- run-wayland-compositor | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/run-wayland-compositor b/run-wayland-compositor index 7290d5c..cc993dd 100755 --- a/run-wayland-compositor +++ b/run-wayland-compositor @@ -26,14 +26,14 @@ if [ -z "$XDG_RUNTIME_DIR" ]; then export XDG_RUNTIME_DIR=$HOME fi -export WAYLAND_DISPLAY=firefox-wayland-0 - +export WAYLAND_DISPLAY=firefox-pgo-wayland-0 if [ -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]; then rm -f $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY + rm -f $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY.lock fi echo "Launch mutter for $WAYLAND_DISPLAY" -mutter --wayland --wayland-display=$WAYLAND_DISPLAY --headless --virtual-monitor=1600x1200 & MUTTER_PID=$! +xvfb-run -s "-screen 0 1600x1200x24" mutter --nested --wayland --wayland-display=$WAYLAND_DISPLAY & MUTTER_PID=$! export MUTTER_PID echo "Mutter PID $MUTTER_PID" @@ -51,6 +51,10 @@ until [ $retry_count -gt $max_retries ]; do fi done -if [ -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]; then - echo "Mutter is running, $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY is here." +if [ ! -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]; then + echo "Mutter failed to start!" + exit 1 fi + +echo "Mutter is running, $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY is here." + From 2ff39423899fd294536a76141938d397d1a6b029 Mon Sep 17 00:00:00 2001 From: Daniel Rusek Date: Tue, 27 Feb 2024 22:32:08 +0000 Subject: [PATCH 320/545] Remove the .desktop suffix from AppStream id --- org.mozilla.firefox.appdata.xml.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.mozilla.firefox.appdata.xml.in b/org.mozilla.firefox.appdata.xml.in index 9ac4f36..3c086a1 100644 --- a/org.mozilla.firefox.appdata.xml.in +++ b/org.mozilla.firefox.appdata.xml.in @@ -1,7 +1,7 @@ - org.mozilla.firefox.desktop + org.mozilla.firefox CC0-1.0 Firefox Web Browser From 7a484647f4e8d25c6161431689bc2c2b3627c110 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 7 Mar 2024 13:14:49 +0100 Subject: [PATCH 321/545] Updated to 123.0.1 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 82558d2..0735c25 100644 --- a/.gitignore +++ b/.gitignore @@ -621,3 +621,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-122.0.1.source.tar.xz /firefox-langpacks-123.0-20240219.tar.xz /firefox-123.0.source.tar.xz +/firefox-123.0.1.source.tar.xz +/firefox-langpacks-123.0.1-20240307.tar.xz diff --git a/firefox.spec b/firefox.spec index d74abe6..9c45fa7 100644 --- a/firefox.spec +++ b/firefox.spec @@ -177,13 +177,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 123.0 -Release: 2%{?pre_tag}%{?dist} +Version: 123.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240219.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240307.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1192,6 +1192,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Mar 07 2024 Martin Stransky - 123.0.1-1 +- Updated to 123.0.1 + * Fri Feb 23 2024 Martin Stransky - 123.0-2 - Fixed PGO builds and enabled it again. diff --git a/sources b/sources index 107e4b8..e942c98 100644 --- a/sources +++ b/sources @@ -1,5 +1,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 -SHA512 (firefox-langpacks-123.0-20240219.tar.xz) = 01d81f8bdf71ba294896e2d3b6f328e2e493dd8b230f7772ae862286328f9b83d7d94b504e11ae9a9636ae6e8c06e90ce3198c1473f9be2698a588a9da10621e -SHA512 (firefox-123.0.source.tar.xz) = a19567a13e1b663e538c4af17491146adad1f0ab977995e8da9ce9ed428008ad20902dee4efb82d54e1319a0e31768609696bc822563d75732b622760129d8bb +SHA512 (firefox-123.0.1.source.tar.xz) = e9af61c1ca800edd16ab7a0d24c9a36bbb34813ed0a11ff62389aa38fa83deba394bca5d95cdaad55ad29ffa3c0e5d3dd15ac1099f7fa3649f4b6c835b7498c2 +SHA512 (firefox-langpacks-123.0.1-20240307.tar.xz) = 1e79f5f286d6e7f72f95965935339a6176b57ebad1c96eb824a2922963058dcb7bf9299bb4edee4fd00e86425fb89ff926da41c030e25c2b322168dc3e33a2e7 From 8e2f33c0dc3c3003c63e2b2cb321b2ee408dd5c9 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 13 Mar 2024 12:54:43 +0100 Subject: [PATCH 322/545] Updated to 124.0 --- .gitignore | 2 ++ fedora-customization.patch | 30 ++++++++---------------------- firefox.spec | 16 +++++----------- sources | 4 ++-- 4 files changed, 17 insertions(+), 35 deletions(-) diff --git a/.gitignore b/.gitignore index 0735c25..e094908 100644 --- a/.gitignore +++ b/.gitignore @@ -623,3 +623,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-123.0.source.tar.xz /firefox-123.0.1.source.tar.xz /firefox-langpacks-123.0.1-20240307.tar.xz +/firefox-124.0.source.tar.xz +/firefox-langpacks-124.0-20240313.tar.xz diff --git a/fedora-customization.patch b/fedora-customization.patch index e1d54b0..395f48d 100644 --- a/fedora-customization.patch +++ b/fedora-customization.patch @@ -1,31 +1,17 @@ -diff -up firefox-120.0/toolkit/xre/nsAppRunner.cpp.fedora-customization firefox-120.0/toolkit/xre/nsAppRunner.cpp ---- firefox-120.0/toolkit/xre/nsAppRunner.cpp.fedora-customization 2023-11-13 21:48:38.000000000 +0100 -+++ firefox-120.0/toolkit/xre/nsAppRunner.cpp 2023-11-14 10:39:13.001603081 +0100 -@@ -5765,6 +5765,12 @@ int XREMain::XRE_main(int argc, char* ar - if (!mAppData->remotingName) { - mAppData->remotingName = mAppData->name; +diff -up firefox-124.0/toolkit/xre/nsAppRunner.cpp.fedora-customization firefox-124.0/toolkit/xre/nsAppRunner.cpp +diff -up firefox-124.0/widget/gtk/nsWindow.cpp.fedora-customization firefox-124.0/widget/gtk/nsWindow.cpp +--- firefox-124.0/widget/gtk/nsWindow.cpp.fedora-customization 2024-03-13 12:35:57.098591719 +0100 ++++ firefox-124.0/widget/gtk/nsWindow.cpp 2024-03-13 12:43:17.375928494 +0100 +@@ -3459,6 +3459,12 @@ nsresult nsWindow::SetTitle(const nsAStr + return NS_OK; } -+ -+ const char* appRemotingName = getenv("MOZ_APP_REMOTINGNAME"); -+ if (appRemotingName) { -+ mAppData->remotingName = strdup(appRemotingName); -+ } -+ - // used throughout this file - gAppData = mAppData.get(); - -diff -up firefox-120.0/widget/gtk/nsWindow.cpp.fedora-customization firefox-120.0/widget/gtk/nsWindow.cpp ---- firefox-120.0/widget/gtk/nsWindow.cpp.fedora-customization 2023-11-14 10:39:13.003603150 +0100 -+++ firefox-120.0/widget/gtk/nsWindow.cpp 2023-11-14 10:41:06.339532735 +0100 -@@ -3457,6 +3457,11 @@ void* nsWindow::GetNativeData(uint32_t a - nsresult nsWindow::SetTitle(const nsAString& aTitle) { - if (!mShell) return NS_OK; + const char* appTitle = getenv("MOZ_APP_TITLE"); + if (appTitle) { + gtk_window_set_title(GTK_WINDOW(mShell), appTitle); + return NS_OK; + } - // convert the string into utf8 and set the title. ++ + // convert the string into utf8 and set the title. #define UTF8_FOLLOWBYTE(ch) (((ch) & 0xC0) == 0x80) NS_ConvertUTF16toUTF8 titleUTF8(aTitle); diff --git a/firefox.spec b/firefox.spec index 9c45fa7..23d22ba 100644 --- a/firefox.spec +++ b/firefox.spec @@ -177,13 +177,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 123.0.1 +Version: 124.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240307.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240313.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -259,12 +259,6 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch -# Firefox 124 patches for PipeWire camera support -# https://phabricator.services.mozilla.com/D200142 -Patch421: libwebrtc-allow-videocapturemodulepipewire-be-shared-with-more-consumers.patch -# https://phabricator.services.mozilla.com/D201328 -Patch422: libwebrtc-simplify-thread-and-lock-annotations.patch - # PGO/LTO patches Patch600: pgo.patch Patch602: mozilla-1516803.patch @@ -568,9 +562,6 @@ This package contains results of tests executed during build. %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 -%patch421 -p1 -b .libwebrtc-allow-videocapturemodulepipewire-be-shared-with-more-consumers -%patch422 -p1 -b .libwebrtc-simplify-thread-and-lock-annotations - # PGO patches %if %{build_with_pgo} %if !%{build_with_clang} @@ -1192,6 +1183,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Mar 13 2024 Martin Stransky - 124.0-1 +- Updated to 124.0 + * Thu Mar 07 2024 Martin Stransky - 123.0.1-1 - Updated to 123.0.1 diff --git a/sources b/sources index e942c98..77c0fde 100644 --- a/sources +++ b/sources @@ -1,5 +1,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 -SHA512 (firefox-123.0.1.source.tar.xz) = e9af61c1ca800edd16ab7a0d24c9a36bbb34813ed0a11ff62389aa38fa83deba394bca5d95cdaad55ad29ffa3c0e5d3dd15ac1099f7fa3649f4b6c835b7498c2 -SHA512 (firefox-langpacks-123.0.1-20240307.tar.xz) = 1e79f5f286d6e7f72f95965935339a6176b57ebad1c96eb824a2922963058dcb7bf9299bb4edee4fd00e86425fb89ff926da41c030e25c2b322168dc3e33a2e7 +SHA512 (firefox-124.0.source.tar.xz) = 028c1a447bc2e608e1ba06cc66b1a33e0a4179744f0e8406d6f2b7317bf99fdd84eb97de0e96d4adcef9f2498b083bac38ccbf2d55e213a4a7e8ff6d94974cfc +SHA512 (firefox-langpacks-124.0-20240313.tar.xz) = 60cb79fc9e8acf34030d6e0b1ea6c119583f9332a424cb551644c89aa074fe7cdb336e53e5f9abc38ac1cfd489fadc697c1cd8e8d7e2020f5372ba861e8650ab From 43f91b3884f5a4dc95c8138dcb188fcec99c32a0 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 22 Mar 2024 21:03:03 +0100 Subject: [PATCH 323/545] Updated to 124.0.1 --- .gitignore | 2 ++ firefox.spec | 4 ++-- sources | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index e094908..9620ab5 100644 --- a/.gitignore +++ b/.gitignore @@ -625,3 +625,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-123.0.1-20240307.tar.xz /firefox-124.0.source.tar.xz /firefox-langpacks-124.0-20240313.tar.xz +/firefox-124.0.1.source.tar.xz +/firefox-langpacks-124.0.1-20240322.tar.xz diff --git a/firefox.spec b/firefox.spec index 23d22ba..25e10c3 100644 --- a/firefox.spec +++ b/firefox.spec @@ -177,13 +177,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 124.0 +Version: 124.0.1 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240313.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240322.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz diff --git a/sources b/sources index 77c0fde..5511afe 100644 --- a/sources +++ b/sources @@ -1,5 +1,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 -SHA512 (firefox-124.0.source.tar.xz) = 028c1a447bc2e608e1ba06cc66b1a33e0a4179744f0e8406d6f2b7317bf99fdd84eb97de0e96d4adcef9f2498b083bac38ccbf2d55e213a4a7e8ff6d94974cfc -SHA512 (firefox-langpacks-124.0-20240313.tar.xz) = 60cb79fc9e8acf34030d6e0b1ea6c119583f9332a424cb551644c89aa074fe7cdb336e53e5f9abc38ac1cfd489fadc697c1cd8e8d7e2020f5372ba861e8650ab +SHA512 (firefox-124.0.1.source.tar.xz) = 282c45e5c468419536dd8b81c8ea687b10d8002d7521403330e6eeef49207143bee88a44c3785748d461ed9a72687606f5da14f4dfb98eb40a5cd08a4a12722b +SHA512 (firefox-langpacks-124.0.1-20240322.tar.xz) = bc7f93493636cc4d9845df2583cdd6cc941e284e35afb2bfe2e0ad32c05dc554c4af22e3d9703ce03a48f30e6858e300dea1c892d2f896be1db58581c81339fd From 364db1a5532f1fbd16716113d97b3a6ed0896c55 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 25 Mar 2024 21:43:22 +0100 Subject: [PATCH 324/545] everted IM patch --- firefox.spec | 8 +++- im-patch.patch | 122 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 im-patch.patch diff --git a/firefox.spec b/firefox.spec index 25e10c3..12e050f 100644 --- a/firefox.spec +++ b/firefox.spec @@ -178,7 +178,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 124.0.1 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -254,6 +254,7 @@ Patch230: firefox-enable-vaapi.patch Patch231: fedora-customization.patch Patch241: 0025-Add-KDE-integration-to-Firefox-toolkit-parts.patch Patch242: 0026-Add-KDE-integration-to-Firefox.patch +Patch243: im-patch.patch # Upstream patches Patch402: mozilla-1196777.patch @@ -555,9 +556,9 @@ This package contains results of tests executed during build. %patch229 -p1 -b .firefox-nss-addon-hack %patch230 -p1 -b .firefox-enable-vaapi %patch231 -p1 -b .fedora-customization - #%patch241 -p1 -b .kde-integration-toolkit #%patch242 -p1 -b .kde-integration +%patch243 -p1 -b .im-patch %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 @@ -1183,6 +1184,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Mar 25 2024 Martin Stransky - 124.0-2 +- Reverted IM patch + * Wed Mar 13 2024 Martin Stransky - 124.0-1 - Updated to 124.0 diff --git a/im-patch.patch b/im-patch.patch new file mode 100644 index 0000000..1fa871d --- /dev/null +++ b/im-patch.patch @@ -0,0 +1,122 @@ +diff -up firefox-124.0.1/widget/gtk/IMContextWrapper.cpp.im-patch firefox-124.0.1/widget/gtk/IMContextWrapper.cpp +--- firefox-124.0.1/widget/gtk/IMContextWrapper.cpp.im-patch 2024-03-22 05:00:19.000000000 +0100 ++++ firefox-124.0.1/widget/gtk/IMContextWrapper.cpp 2024-03-25 21:39:58.961947576 +0100 +@@ -232,11 +232,18 @@ class SelectionStyleProvider final { + sHasShutDown = true; + } + +- // mContainer associated with an IM context. +- void AttachTo(MozContainer* aContainer) { +- gtk_style_context_add_provider( +- gtk_widget_get_style_context(GTK_WIDGET(aContainer)), +- GTK_STYLE_PROVIDER(mProvider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); ++ // aGDKWindow is a GTK window which will be associated with an IM context. ++ void AttachTo(GdkWindow* aGDKWindow) { ++ GtkWidget* widget = nullptr; ++ // gdk_window_get_user_data() typically returns pointer to widget that ++ // window belongs to. If it's widget, fcitx retrieves selection colors ++ // of them. So, we need to overwrite its style. ++ gdk_window_get_user_data(aGDKWindow, (gpointer*)&widget); ++ if (GTK_IS_WIDGET(widget)) { ++ gtk_style_context_add_provider(gtk_widget_get_style_context(widget), ++ GTK_STYLE_PROVIDER(mProvider), ++ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); ++ } + } + + void OnThemeChanged() { +@@ -410,17 +417,21 @@ nsDependentCSubstring IMContextWrapper:: + } + + void IMContextWrapper::Init() { ++ MozContainer* container = mOwnerWindow->GetMozContainer(); ++ MOZ_ASSERT(container, "container is null"); ++ GdkWindow* gdkWindow = gtk_widget_get_window(GTK_WIDGET(container)); ++ + // Overwrite selection colors of the window before associating the window + // with IM context since IME may look up selection colors via IM context + // to support any colored widgets. +- SelectionStyleProvider::GetInstance()->AttachTo( +- mOwnerWindow->GetMozContainer()); ++ SelectionStyleProvider::GetInstance()->AttachTo(gdkWindow); + + // NOTE: gtk_im_*_new() abort (kill) the whole process when it fails. + // So, we don't need to check the result. + + // Normal context. + mContext = gtk_im_multicontext_new(); ++ gtk_im_context_set_client_window(mContext, gdkWindow); + g_signal_connect(mContext, "preedit_changed", + G_CALLBACK(IMContextWrapper::OnChangeCompositionCallback), + this); +@@ -492,6 +503,7 @@ void IMContextWrapper::Init() { + // Simple context + if (sUseSimpleContext) { + mSimpleContext = gtk_im_context_simple_new(); ++ gtk_im_context_set_client_window(mSimpleContext, gdkWindow); + g_signal_connect(mSimpleContext, "preedit_changed", + G_CALLBACK(&IMContextWrapper::OnChangeCompositionCallback), + this); +@@ -514,6 +526,7 @@ void IMContextWrapper::Init() { + + // Dummy context + mDummyContext = gtk_im_multicontext_new(); ++ gtk_im_context_set_client_window(mDummyContext, gdkWindow); + + MOZ_LOG(gIMELog, LogLevel::Info, + ("0x%p Init(), mOwnerWindow=%p, mContext=%p (im=\"%s\"), " +@@ -540,17 +553,6 @@ IMContextWrapper::~IMContextWrapper() { + MOZ_LOG(gIMELog, LogLevel::Info, ("0x%p ~IMContextWrapper()", this)); + } + +-void IMContextWrapper::SetGdkWindow(GdkWindow* aGdkWindow) { +- MOZ_LOG(gIMELog, LogLevel::Info, +- ("0x%p GdkWindowChanged(%p)", this, aGdkWindow)); +- MOZ_ASSERT(!aGdkWindow || mOwnerWindow->GetGdkWindow() == aGdkWindow); +- gtk_im_context_set_client_window(mContext, aGdkWindow); +- if (mSimpleContext) { +- gtk_im_context_set_client_window(mSimpleContext, aGdkWindow); +- } +- gtk_im_context_set_client_window(mDummyContext, aGdkWindow); +-} +- + NS_IMETHODIMP + IMContextWrapper::NotifyIME(TextEventDispatcher* aTextEventDispatcher, + const IMENotification& aNotification) { +diff -up firefox-124.0.1/widget/gtk/IMContextWrapper.h.im-patch firefox-124.0.1/widget/gtk/IMContextWrapper.h +--- firefox-124.0.1/widget/gtk/IMContextWrapper.h.im-patch 2024-03-22 05:00:19.000000000 +0100 ++++ firefox-124.0.1/widget/gtk/IMContextWrapper.h 2024-03-25 21:39:58.961947576 +0100 +@@ -117,10 +117,6 @@ class IMContextWrapper final : public Te + void OnUpdateComposition(); + void OnLayoutChange(); + +- // Set GdkWindow associated with IM context. +- // It can be null which disables context operations. +- void SetGdkWindow(GdkWindow* aGdkWindow); +- + TextEventDispatcher* GetTextEventDispatcher(); + + // TODO: Typically, new IM comes every several years. And now, our code +diff -up firefox-124.0.1/widget/gtk/nsWindow.cpp.im-patch firefox-124.0.1/widget/gtk/nsWindow.cpp +--- firefox-124.0.1/widget/gtk/nsWindow.cpp.im-patch 2024-03-25 21:39:58.959947505 +0100 ++++ firefox-124.0.1/widget/gtk/nsWindow.cpp 2024-03-25 21:41:09.178439036 +0100 +@@ -5822,9 +5822,6 @@ void nsWindow::EnsureGdkWindow() { + if (!mGdkWindow) { + mGdkWindow = gtk_widget_get_window(GTK_WIDGET(mContainer)); + g_object_set_data(G_OBJECT(mGdkWindow), "nsWindow", this); +- if (mIMContext) { +- mIMContext->SetGdkWindow(mGdkWindow); +- } + } + } + +@@ -9933,9 +9930,6 @@ void nsWindow::DisableRendering() { + LOG("nsWindow::DisableRendering()"); + + if (mGdkWindow) { +- if (mIMContext) { +- mIMContext->SetGdkWindow(nullptr); +- } + g_object_set_data(G_OBJECT(mGdkWindow), "nsWindow", nullptr); + mGdkWindow = nullptr; + } From 45608f24008ef257db6414e9131491050a5f0e49 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Thu, 28 Mar 2024 07:44:58 +0100 Subject: [PATCH 325/545] Enable wasi rlbox --- .gitignore | 1 + firefox-mozconfig | 2 -- firefox.spec | 65 ++++++++++++++++++++++++++++++++++++++++++++- sources | 1 + wasi.patch | 12 +++++++++ wasi.patch.template | 12 +++++++++ 6 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 wasi.patch create mode 100644 wasi.patch.template diff --git a/.gitignore b/.gitignore index 9620ab5..f812fa4 100644 --- a/.gitignore +++ b/.gitignore @@ -627,3 +627,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-124.0-20240313.tar.xz /firefox-124.0.1.source.tar.xz /firefox-langpacks-124.0.1-20240322.tar.xz +/wasi-sdk-20.tar.gz diff --git a/firefox-mozconfig b/firefox-mozconfig index 676a0e0..272b265 100644 --- a/firefox-mozconfig +++ b/firefox-mozconfig @@ -14,8 +14,6 @@ ac_add_options --allow-addon-sideload ac_add_options --with-system-fdk-aac ac_add_options --enable-js-shell ac_add_options --with-unsigned-addon-scopes=app,system -ac_add_options --without-sysroot -ac_add_options --without-wasm-sandboxed-libraries export BUILD_OFFICIAL=1 export MOZILLA_OFFICIAL=1 diff --git a/firefox.spec b/firefox.spec index 12e050f..d2e8b42 100644 --- a/firefox.spec +++ b/firefox.spec @@ -33,6 +33,12 @@ ExcludeArch: i686 %else %global enable_replace_malloc 0 %endif ++# wasi_sdk is for sandboxing third party c/c++ libs by using rlbox ++%ifarch s390x ++%bcond wasi_sdk 0 ++%else ++%bcond wasi_sdk 1 ++%endif %if "%{toolchain}" == "clang" %global build_with_clang 1 @@ -216,6 +222,8 @@ Source45: run-wayland-compositor Source46: org.mozilla.firefox.SearchProvider.service Source47: org.mozilla.firefox.desktop Source48: org.mozilla.firefox.appdata.xml.in +Source49: wasi.patch.template +Source50: wasi-sdk-20-1.fc39.src.rpm # Build patches #Patch3: mozilla-build-arm.patch @@ -234,6 +242,7 @@ Patch61: firefox-glibc-dynstack.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch78: firefox-i686-build.patch Patch79: firefox-gcc-13-build.patch +Patch80: wasi.patch # Test patches # Generate without context by @@ -320,7 +329,7 @@ BuildRequires: llvm BuildRequires: llvm-devel BuildRequires: clang BuildRequires: clang-libs -%if %{build_with_clang} +%if %{build_with_clang} || %{with wasi_sdk} BuildRequires: lld %endif @@ -443,6 +452,9 @@ BuildRequires: libproxy-devel %if %{enable_replace_malloc} BuildRequires: libstdc++-static %endif +%if %{with wasi_sdk} +BuildRequires: clang cmake ninja-build +%endif Obsoletes: mozilla <= 37:1.7.13 Provides: webclient @@ -540,6 +552,13 @@ This package contains results of tests executed during build. %patch78 -p1 -b .firefox-i686 %patch79 -p1 -b .firefox-gcc-13-build +# We need to create the wasi.patch with the correct path to the wasm libclang_rt. +%if %{with wasi_sdk} +export LIBCLANG_RT=%{_topdir}/BUILDROOT/usr/share/wasi-sysroot/lib/libclang_rt.builtins-wasm32.a; cat %{SOURCE49} | envsubst > %{_sourcedir}/wasi.patch +cat %{_sourcedir}/wasi.patch +%patch80 -p1 -b .wasi +%endif + # Test patches #%patch100 -p1 -b .firefox-tests-xpcshell #%patch101 -p1 -b .firefox-tests-reftest @@ -711,6 +730,43 @@ chmod a-x third_party/rust/ash/src/extensions/nv/*.rs # Is that already fixed? %define _lto_cflags %{nil} +#WASI SDK +%if %{with wasi_sdk} +function install_rpms_to_current_dir() { + PACKAGE_RPM=$(eval echo $1) + #PACKAGE_DIR=%{_rpmdir} + PACKAGE_DIR=%{_topdir}/RPMS + + if [ ! -f $PACKAGE_DIR/$PACKAGE_RPM ]; then + # Hack for tps tests + ARCH_STR=%{_arch} + %ifarch %{ix86} + ARCH_STR="i?86" + %endif + PACKAGE_DIR="$PACKAGE_DIR/$ARCH_STR" + fi + + for package in $(ls $PACKAGE_DIR/$PACKAGE_RPM) + do + echo "$package" + rpm2cpio "$package" | cpio -idu + rm -f "$package" + done +} + +rpm -ivh %{SOURCE50} +#export CC="clang" +#export CXX="clang++" +#eport AR="clang-ar" +#export NM="clang-nm" +#export RANLIB="clang-ranlib" +rpmbuild --nodeps -bb --noclean %{_topdir}/SPECS/wasi-sdk.spec +pushd %{_buildrootdir} +install_rpms_to_current_dir wasi-sdk-20*.rpm +popd +%endif +# ^ with wasi_sdk + %if 0%{?use_bundled_cbindgen} mkdir -p my_rust_vendor cd my_rust_vendor @@ -824,6 +880,13 @@ env | grep GCOV echo "ac_add_options --enable-lto" >> .mozconfig echo "ac_add_options MOZ_PGO=1" >> .mozconfig %endif + +%if %{with wasi_sdk} +echo "ac_add_options --with-wasi-sysroot=%{_topdir}/BUILDROOT/usr/share/wasi-sysroot" >> .mozconfig +%else +echo "ac_add_options --without-sysroot" >> .mozconfig +echo "ac_add_options --without-wasm-sandboxed-libraries" >> .mozconfig +%endif # Require 4 GB of RAM per CPU core %constrain_build -m 4096 diff --git a/sources b/sources index 5511afe..72d52ad 100644 --- a/sources +++ b/sources @@ -3,3 +3,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 SHA512 (firefox-124.0.1.source.tar.xz) = 282c45e5c468419536dd8b81c8ea687b10d8002d7521403330e6eeef49207143bee88a44c3785748d461ed9a72687606f5da14f4dfb98eb40a5cd08a4a12722b SHA512 (firefox-langpacks-124.0.1-20240322.tar.xz) = bc7f93493636cc4d9845df2583cdd6cc941e284e35afb2bfe2e0ad32c05dc554c4af22e3d9703ce03a48f30e6858e300dea1c892d2f896be1db58581c81339fd +SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 diff --git a/wasi.patch b/wasi.patch new file mode 100644 index 0000000..b47b496 --- /dev/null +++ b/wasi.patch @@ -0,0 +1,12 @@ +diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz.configure +--- firefox-121.0.1/toolkit/moz.configure.wasi 2024-02-01 09:14:33.816548952 +0100 ++++ firefox-121.0.1/toolkit/moz.configure 2024-02-01 09:15:53.264684309 +0100 +@@ -2663,7 +2663,7 @@ with only_when(requires_wasm_sandboxing + def wasi_sysroot_flags(wasi_sysroot): + if wasi_sysroot: + log.info("Using wasi sysroot in %s", wasi_sysroot) +- return ["--sysroot=%s" % wasi_sysroot] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/home/jhorak/rpmbuild/BUILDROOT/usr/share/wasi-sysroot/lib/libclang_rt.builtins-wasm32.a"] + return [] + + set_config("WASI_SYSROOT", wasi_sysroot) diff --git a/wasi.patch.template b/wasi.patch.template new file mode 100644 index 0000000..aa2838e --- /dev/null +++ b/wasi.patch.template @@ -0,0 +1,12 @@ +diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz.configure +--- firefox-121.0.1/toolkit/moz.configure.wasi 2024-02-01 09:14:33.816548952 +0100 ++++ firefox-121.0.1/toolkit/moz.configure 2024-02-01 09:15:53.264684309 +0100 +@@ -2663,7 +2663,7 @@ with only_when(requires_wasm_sandboxing + def wasi_sysroot_flags(wasi_sysroot): + if wasi_sysroot: + log.info("Using wasi sysroot in %s", wasi_sysroot) +- return ["--sysroot=%s" % wasi_sysroot] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "$LIBCLANG_RT"] + return [] + + set_config("WASI_SYSROOT", wasi_sysroot) From 60fdd5abb45f063207214aa3edab58e7764196f1 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Thu, 28 Mar 2024 09:00:12 +0100 Subject: [PATCH 326/545] Enable wasi rlbox --- firefox.spec | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/firefox.spec b/firefox.spec index d2e8b42..3e5ab2b 100644 --- a/firefox.spec +++ b/firefox.spec @@ -33,12 +33,12 @@ ExcludeArch: i686 %else %global enable_replace_malloc 0 %endif -+# wasi_sdk is for sandboxing third party c/c++ libs by using rlbox -+%ifarch s390x -+%bcond wasi_sdk 0 -+%else -+%bcond wasi_sdk 1 -+%endif +# wasi_sdk is for sandboxing third party c/c++ libs by using rlbox +%ifarch s390x +%bcond wasi_sdk 0 +%else +%bcond wasi_sdk 1 +%endif %if "%{toolchain}" == "clang" %global build_with_clang 1 @@ -184,7 +184,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 124.0.1 -Release: 2%{?pre_tag}%{?dist} +Release: 4%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1247,6 +1247,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Mar 28 2024 Jan Horak - 124.0.1-4 +- Enable rlbox sandboxing + * Mon Mar 25 2024 Martin Stransky - 124.0-2 - Reverted IM patch From b929e7a15e800e5e49a2677eb64a48ad24bfee27 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Thu, 28 Mar 2024 09:39:19 +0100 Subject: [PATCH 327/545] fixed sources --- .gitignore | 1 + sources | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f812fa4..6760a13 100644 --- a/.gitignore +++ b/.gitignore @@ -628,3 +628,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-124.0.1.source.tar.xz /firefox-langpacks-124.0.1-20240322.tar.xz /wasi-sdk-20.tar.gz +/wasi-sdk-20-1.fc39.src.rpm diff --git a/sources b/sources index 72d52ad..79de622 100644 --- a/sources +++ b/sources @@ -3,4 +3,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 SHA512 (firefox-124.0.1.source.tar.xz) = 282c45e5c468419536dd8b81c8ea687b10d8002d7521403330e6eeef49207143bee88a44c3785748d461ed9a72687606f5da14f4dfb98eb40a5cd08a4a12722b SHA512 (firefox-langpacks-124.0.1-20240322.tar.xz) = bc7f93493636cc4d9845df2583cdd6cc941e284e35afb2bfe2e0ad32c05dc554c4af22e3d9703ce03a48f30e6858e300dea1c892d2f896be1db58581c81339fd -SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 +SHA512 (wasi-sdk-20-1.fc39.src.rpm) = 5aa19b02bc42092d360a8d8d4704fe4a8646fc0908bc170786d88599653708985d76baf21294a972757c9ed6514d6984c2bdd364c8d3b2c86f4dc2decc819b83 From 36ab0cac6d6bb41c4782fbb6fa30c4f8895e2897 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Tue, 2 Apr 2024 08:27:58 +0200 Subject: [PATCH 328/545] Trying to use clang for the wasi-sdk --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 3e5ab2b..23f3980 100644 --- a/firefox.spec +++ b/firefox.spec @@ -760,7 +760,7 @@ rpm -ivh %{SOURCE50} #eport AR="clang-ar" #export NM="clang-nm" #export RANLIB="clang-ranlib" -rpmbuild --nodeps -bb --noclean %{_topdir}/SPECS/wasi-sdk.spec +rpmbuild -D "toolchain clang" --nodeps -bb --noclean %{_topdir}/SPECS/wasi-sdk.spec pushd %{_buildrootdir} install_rpms_to_current_dir wasi-sdk-20*.rpm popd From 996d1164437e1a331204d6de986ef9b6c5e24740 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Tue, 2 Apr 2024 11:27:49 +0200 Subject: [PATCH 329/545] Updated wasi-sdk subpackage --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 79de622..d127964 100644 --- a/sources +++ b/sources @@ -3,4 +3,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 SHA512 (firefox-124.0.1.source.tar.xz) = 282c45e5c468419536dd8b81c8ea687b10d8002d7521403330e6eeef49207143bee88a44c3785748d461ed9a72687606f5da14f4dfb98eb40a5cd08a4a12722b SHA512 (firefox-langpacks-124.0.1-20240322.tar.xz) = bc7f93493636cc4d9845df2583cdd6cc941e284e35afb2bfe2e0ad32c05dc554c4af22e3d9703ce03a48f30e6858e300dea1c892d2f896be1db58581c81339fd -SHA512 (wasi-sdk-20-1.fc39.src.rpm) = 5aa19b02bc42092d360a8d8d4704fe4a8646fc0908bc170786d88599653708985d76baf21294a972757c9ed6514d6984c2bdd364c8d3b2c86f4dc2decc819b83 +SHA512 (wasi-sdk-20-1.fc39.src.rpm) = 95fd05659f649d0abe07743b16f09c2bb2ea43bc1f274b54a92de79fcbf83ce41f481c712cfdc388fa1df9854cc1747ff6917266efc9519dbc6ffc0ebe7c80aa From 8d607f862e163a7050fb5753465b5c206d50231b Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Tue, 2 Apr 2024 12:23:34 +0200 Subject: [PATCH 330/545] Trying to use clang for the wasi-sdk --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index d127964..409b162 100644 --- a/sources +++ b/sources @@ -3,4 +3,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 SHA512 (firefox-124.0.1.source.tar.xz) = 282c45e5c468419536dd8b81c8ea687b10d8002d7521403330e6eeef49207143bee88a44c3785748d461ed9a72687606f5da14f4dfb98eb40a5cd08a4a12722b SHA512 (firefox-langpacks-124.0.1-20240322.tar.xz) = bc7f93493636cc4d9845df2583cdd6cc941e284e35afb2bfe2e0ad32c05dc554c4af22e3d9703ce03a48f30e6858e300dea1c892d2f896be1db58581c81339fd -SHA512 (wasi-sdk-20-1.fc39.src.rpm) = 95fd05659f649d0abe07743b16f09c2bb2ea43bc1f274b54a92de79fcbf83ce41f481c712cfdc388fa1df9854cc1747ff6917266efc9519dbc6ffc0ebe7c80aa +SHA512 (wasi-sdk-20-1.fc39.src.rpm) = 5803f9cbd66ec031dc7183b45cd4f10c5be221ce5a02a8ca4c66e03e89893bb3a0fdab87217aabfc3a66052f7550f48425cc59fa55947edeb015200b0c7de4ac From b4332c158a8fb1c24211948f815555e21904c918 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Wed, 3 Apr 2024 08:35:55 +0200 Subject: [PATCH 331/545] Trying to use clang for the wasi-sdk --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 409b162..df28dff 100644 --- a/sources +++ b/sources @@ -3,4 +3,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 SHA512 (firefox-124.0.1.source.tar.xz) = 282c45e5c468419536dd8b81c8ea687b10d8002d7521403330e6eeef49207143bee88a44c3785748d461ed9a72687606f5da14f4dfb98eb40a5cd08a4a12722b SHA512 (firefox-langpacks-124.0.1-20240322.tar.xz) = bc7f93493636cc4d9845df2583cdd6cc941e284e35afb2bfe2e0ad32c05dc554c4af22e3d9703ce03a48f30e6858e300dea1c892d2f896be1db58581c81339fd -SHA512 (wasi-sdk-20-1.fc39.src.rpm) = 5803f9cbd66ec031dc7183b45cd4f10c5be221ce5a02a8ca4c66e03e89893bb3a0fdab87217aabfc3a66052f7550f48425cc59fa55947edeb015200b0c7de4ac +SHA512 (wasi-sdk-20-1.fc39.src.rpm) = fddcc5acf1dcbe50af6d282688388ac156c1fae4da1468e428fb2e6313298e24ea652d25c617d56d7b8dc6bd259cf8f2449dbca8d52ceb614e407c2130aeece1 From fc9a1bf3906fbb937e64bce28c90802c411ede95 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Wed, 3 Apr 2024 11:48:18 +0200 Subject: [PATCH 332/545] Don't define clang --- firefox.spec | 8 ++------ sources | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/firefox.spec b/firefox.spec index 23f3980..2b0b5b3 100644 --- a/firefox.spec +++ b/firefox.spec @@ -754,13 +754,9 @@ function install_rpms_to_current_dir() { done } + rpm -ivh %{SOURCE50} -#export CC="clang" -#export CXX="clang++" -#eport AR="clang-ar" -#export NM="clang-nm" -#export RANLIB="clang-ranlib" -rpmbuild -D "toolchain clang" --nodeps -bb --noclean %{_topdir}/SPECS/wasi-sdk.spec +rpmbuild --nodeps -bb --noclean %{_topdir}/SPECS/wasi-sdk.spec pushd %{_buildrootdir} install_rpms_to_current_dir wasi-sdk-20*.rpm popd diff --git a/sources b/sources index df28dff..5e61e2c 100644 --- a/sources +++ b/sources @@ -3,4 +3,4 @@ SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 SHA512 (firefox-124.0.1.source.tar.xz) = 282c45e5c468419536dd8b81c8ea687b10d8002d7521403330e6eeef49207143bee88a44c3785748d461ed9a72687606f5da14f4dfb98eb40a5cd08a4a12722b SHA512 (firefox-langpacks-124.0.1-20240322.tar.xz) = bc7f93493636cc4d9845df2583cdd6cc941e284e35afb2bfe2e0ad32c05dc554c4af22e3d9703ce03a48f30e6858e300dea1c892d2f896be1db58581c81339fd -SHA512 (wasi-sdk-20-1.fc39.src.rpm) = fddcc5acf1dcbe50af6d282688388ac156c1fae4da1468e428fb2e6313298e24ea652d25c617d56d7b8dc6bd259cf8f2449dbca8d52ceb614e407c2130aeece1 +SHA512 (wasi-sdk-20-1.fc39.src.rpm) = a640db0a431657e134ab2bf6fe5ef1c32ccf9e4268e81e8d8da3c111bfb93ea8ec5c7185519601b05649f3343b61278afc8e0de89a7d059628c419aa50b279eb From 5075171b4ce49dda2f881751ceaec7c0993fed9b Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Wed, 3 Apr 2024 15:39:37 +0200 Subject: [PATCH 333/545] Enable wasi rlbox for s390x on f40+ --- firefox.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 2b0b5b3..ba9d9d9 100644 --- a/firefox.spec +++ b/firefox.spec @@ -33,12 +33,17 @@ ExcludeArch: i686 %else %global enable_replace_malloc 0 %endif -# wasi_sdk is for sandboxing third party c/c++ libs by using rlbox + +# wasi_sdk is for sandboxing third party c/c++ libs by using rlbox, exclude s390x on the f39. +%if 0%{?fedora} < 40 %ifarch s390x %bcond wasi_sdk 0 %else %bcond wasi_sdk 1 %endif +%else +%bcond wasi_sdk 1 +%endif %if "%{toolchain}" == "clang" %global build_with_clang 1 From 920cc52641ad52b10fdb3447b0a84d1ecf2f3452 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 4 Apr 2024 14:04:05 +0200 Subject: [PATCH 334/545] Updated to 124.0.2 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 6760a13..e3669fb 100644 --- a/.gitignore +++ b/.gitignore @@ -629,3 +629,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-124.0.1-20240322.tar.xz /wasi-sdk-20.tar.gz /wasi-sdk-20-1.fc39.src.rpm +/firefox-124.0.2.source.tar.xz +/firefox-langpacks-124.0.2-20240404.tar.xz diff --git a/firefox.spec b/firefox.spec index ba9d9d9..4412717 100644 --- a/firefox.spec +++ b/firefox.spec @@ -188,13 +188,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 124.0.1 -Release: 4%{?pre_tag}%{?dist} +Version: 124.0.2 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240322.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240404.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1248,6 +1248,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Apr 4 2024 Martin Stransky - 124.0.2-1 +- Updated to 124.0.2 + * Thu Mar 28 2024 Jan Horak - 124.0.1-4 - Enable rlbox sandboxing diff --git a/sources b/sources index 5e61e2c..7fe770a 100644 --- a/sources +++ b/sources @@ -1,6 +1,6 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 -SHA512 (firefox-124.0.1.source.tar.xz) = 282c45e5c468419536dd8b81c8ea687b10d8002d7521403330e6eeef49207143bee88a44c3785748d461ed9a72687606f5da14f4dfb98eb40a5cd08a4a12722b -SHA512 (firefox-langpacks-124.0.1-20240322.tar.xz) = bc7f93493636cc4d9845df2583cdd6cc941e284e35afb2bfe2e0ad32c05dc554c4af22e3d9703ce03a48f30e6858e300dea1c892d2f896be1db58581c81339fd SHA512 (wasi-sdk-20-1.fc39.src.rpm) = a640db0a431657e134ab2bf6fe5ef1c32ccf9e4268e81e8d8da3c111bfb93ea8ec5c7185519601b05649f3343b61278afc8e0de89a7d059628c419aa50b279eb +SHA512 (firefox-124.0.2.source.tar.xz) = 8cf340de6e34812f8ae3363265859a263330af770d981c3dd1ca1e7e0cfe513604d3e68184d4aa1446569aefbdf359d561fbc200faf19a5ed020a1709d9ef10e +SHA512 (firefox-langpacks-124.0.2-20240404.tar.xz) = ac50445a026eb6515b9d891fde22eb41659417ee1daea3d941e370108861349edbceae4ab5ed8947c03c3202eb802d01d051de1a98603243568f755d62b9eab3 From ca2c47155352983fdeb608eb13b2fcc809b074d6 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Thu, 4 Apr 2024 21:04:06 +0200 Subject: [PATCH 335/545] Don't use rpm for the wasi-sdk but build it as bundled --- firefox.spec | 42 +++++++++++------------------------------- sources | 2 +- wasi.patch | 25 ++++++++++++++++++++++++- wasi.patch.template | 23 +++++++++++++++++++++++ 4 files changed, 59 insertions(+), 33 deletions(-) diff --git a/firefox.spec b/firefox.spec index 4412717..04c2962 100644 --- a/firefox.spec +++ b/firefox.spec @@ -228,7 +228,10 @@ Source46: org.mozilla.firefox.SearchProvider.service Source47: org.mozilla.firefox.desktop Source48: org.mozilla.firefox.appdata.xml.in Source49: wasi.patch.template -Source50: wasi-sdk-20-1.fc39.src.rpm +# Created by: +# git clone --recursive https://github.com/WebAssembly/wasi-sdk.git +# cd wasi-sdk && git-archive-all --force-submodules wasi-sdk-20.tar.gz +Source50: wasi-sdk-20.tar.gz # Build patches #Patch3: mozilla-build-arm.patch @@ -543,6 +546,9 @@ This package contains results of tests executed during build. %prep %setup -q -n %{tarballdir} +%if %{with wasi_sdk} +%setup -q -T -D -a 50 +%endif # Build patches, can't change backup suffix from default because during build # there is a compare of config and js/config directories and .orig suffix is @@ -559,8 +565,7 @@ This package contains results of tests executed during build. # We need to create the wasi.patch with the correct path to the wasm libclang_rt. %if %{with wasi_sdk} -export LIBCLANG_RT=%{_topdir}/BUILDROOT/usr/share/wasi-sysroot/lib/libclang_rt.builtins-wasm32.a; cat %{SOURCE49} | envsubst > %{_sourcedir}/wasi.patch -cat %{_sourcedir}/wasi.patch +export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a; cat %{SOURCE49} | envsubst > %{_sourcedir}/wasi.patch %patch80 -p1 -b .wasi %endif @@ -737,33 +742,8 @@ chmod a-x third_party/rust/ash/src/extensions/nv/*.rs #WASI SDK %if %{with wasi_sdk} -function install_rpms_to_current_dir() { - PACKAGE_RPM=$(eval echo $1) - #PACKAGE_DIR=%{_rpmdir} - PACKAGE_DIR=%{_topdir}/RPMS - - if [ ! -f $PACKAGE_DIR/$PACKAGE_RPM ]; then - # Hack for tps tests - ARCH_STR=%{_arch} - %ifarch %{ix86} - ARCH_STR="i?86" - %endif - PACKAGE_DIR="$PACKAGE_DIR/$ARCH_STR" - fi - - for package in $(ls $PACKAGE_DIR/$PACKAGE_RPM) - do - echo "$package" - rpm2cpio "$package" | cpio -idu - rm -f "$package" - done -} - - -rpm -ivh %{SOURCE50} -rpmbuild --nodeps -bb --noclean %{_topdir}/SPECS/wasi-sdk.spec -pushd %{_buildrootdir} -install_rpms_to_current_dir wasi-sdk-20*.rpm +pushd wasi-sdk-20 +NINJA_FLAGS=-v CC=clang CXX=clang++ env -u CFLAGS -u CXXFLAGS -u FFLAGS -u VALFLAGS -u RUSTFLAGS -u LDFLAGS -u LT_SYS_LIBRARY_PATH make package popd %endif # ^ with wasi_sdk @@ -883,7 +863,7 @@ echo "ac_add_options MOZ_PGO=1" >> .mozconfig %endif %if %{with wasi_sdk} -echo "ac_add_options --with-wasi-sysroot=%{_topdir}/BUILDROOT/usr/share/wasi-sysroot" >> .mozconfig +echo "ac_add_options --with-wasi-sysroot=`pwd`/wasi-sdk-20/build/install/opt/wasi-sdk/share/wasi-sysroot" >> .mozconfig %else echo "ac_add_options --without-sysroot" >> .mozconfig echo "ac_add_options --without-wasm-sandboxed-libraries" >> .mozconfig diff --git a/sources b/sources index 7fe770a..8df460d 100644 --- a/sources +++ b/sources @@ -1,6 +1,6 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 -SHA512 (wasi-sdk-20-1.fc39.src.rpm) = a640db0a431657e134ab2bf6fe5ef1c32ccf9e4268e81e8d8da3c111bfb93ea8ec5c7185519601b05649f3343b61278afc8e0de89a7d059628c419aa50b279eb SHA512 (firefox-124.0.2.source.tar.xz) = 8cf340de6e34812f8ae3363265859a263330af770d981c3dd1ca1e7e0cfe513604d3e68184d4aa1446569aefbdf359d561fbc200faf19a5ed020a1709d9ef10e SHA512 (firefox-langpacks-124.0.2-20240404.tar.xz) = ac50445a026eb6515b9d891fde22eb41659417ee1daea3d941e370108861349edbceae4ab5ed8947c03c3202eb802d01d051de1a98603243568f755d62b9eab3 +SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 diff --git a/wasi.patch b/wasi.patch index b47b496..33ab037 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,30 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/home/jhorak/rpmbuild/BUILDROOT/usr/share/wasi-sysroot/lib/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/home/jhorak/f/firefox/firefox-124.0.2/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) +diff -up firefox-121.0.1/wasi-sdk-20/Makefile.fedora firefox-121.0.1/wasi-sdk-20/Makefile +--- firefox-121.0.1/wasi-sdk-20/Makefile.fedora 2024-03-04 13:20:56.903403496 +0100 ++++ firefox-121.0.1/wasi-sdk-20/Makefile 2024-03-04 13:19:59.381140045 +0100 +@@ -44,7 +44,7 @@ endif + + # Only the major version is needed for Clang, see https://reviews.llvm.org/D125860. + CLANG_VERSION=$(shell $(BASH) ./llvm_version_major.sh $(LLVM_PROJ_DIR)) +-VERSION:=$(shell $(BASH) ./version.sh) ++VERSION:=20 #$(shell $(BASH) ./version.sh) + DEBUG_PREFIX_MAP=-fdebug-prefix-map=$(ROOT_DIR)=wasisdk://v$(VERSION) + + default: build +@@ -262,8 +262,8 @@ package: build/package.BUILT + + build/package.BUILT: build strip + mkdir -p dist +- ./deb_from_installation.sh $(shell pwd)/dist "$(VERSION)" "$(BUILD_PREFIX)" +- ./tar_from_installation.sh "$(shell pwd)/dist" "$(VERSION)" "$(BUILD_PREFIX)" ++ #./deb_from_installation.sh $(shell pwd)/dist "$(VERSION)" "$(BUILD_PREFIX)" ++ #./tar_from_installation.sh "$(shell pwd)/dist" "$(VERSION)" "$(BUILD_PREFIX)" + touch build/package.BUILT + + .PHONY: default clean build strip package check diff --git a/wasi.patch.template b/wasi.patch.template index aa2838e..daaad77 100644 --- a/wasi.patch.template +++ b/wasi.patch.template @@ -10,3 +10,26 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. return [] set_config("WASI_SYSROOT", wasi_sysroot) +diff -up firefox-121.0.1/wasi-sdk-20/Makefile.fedora firefox-121.0.1/wasi-sdk-20/Makefile +--- firefox-121.0.1/wasi-sdk-20/Makefile.fedora 2024-03-04 13:20:56.903403496 +0100 ++++ firefox-121.0.1/wasi-sdk-20/Makefile 2024-03-04 13:19:59.381140045 +0100 +@@ -44,7 +44,7 @@ endif + + # Only the major version is needed for Clang, see https://reviews.llvm.org/D125860. + CLANG_VERSION=$(shell $(BASH) ./llvm_version_major.sh $(LLVM_PROJ_DIR)) +-VERSION:=$(shell $(BASH) ./version.sh) ++VERSION:=20 #$(shell $(BASH) ./version.sh) + DEBUG_PREFIX_MAP=-fdebug-prefix-map=$(ROOT_DIR)=wasisdk://v$(VERSION) + + default: build +@@ -262,8 +262,8 @@ package: build/package.BUILT + + build/package.BUILT: build strip + mkdir -p dist +- ./deb_from_installation.sh $(shell pwd)/dist "$(VERSION)" "$(BUILD_PREFIX)" +- ./tar_from_installation.sh "$(shell pwd)/dist" "$(VERSION)" "$(BUILD_PREFIX)" ++ #./deb_from_installation.sh $(shell pwd)/dist "$(VERSION)" "$(BUILD_PREFIX)" ++ #./tar_from_installation.sh "$(shell pwd)/dist" "$(VERSION)" "$(BUILD_PREFIX)" + touch build/package.BUILT + + .PHONY: default clean build strip package check From c000da176ca3f33587ff8af4ced2f37be98a17f9 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Thu, 4 Apr 2024 21:06:39 +0200 Subject: [PATCH 336/545] bump release --- firefox.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index 04c2962..7b48e09 100644 --- a/firefox.spec +++ b/firefox.spec @@ -189,7 +189,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 124.0.2 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1228,7 +1228,7 @@ fi #--------------------------------------------------------------------- %changelog -* Thu Apr 4 2024 Martin Stransky - 124.0.2-1 +* Thu Apr 4 2024 Martin Stransky - 124.0.2-2 - Updated to 124.0.2 * Thu Mar 28 2024 Jan Horak - 124.0.1-4 From 60b823914a991448f5a85b02ae7a3d3fa953c3b8 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 9 Apr 2024 11:31:06 +0200 Subject: [PATCH 337/545] Update to 125.0 --- .gitignore | 2 + firefox-enable-addons.patch | 10 +-- firefox.spec | 11 ++-- im-patch.patch | 122 ------------------------------------ mozilla-1667096.patch | 32 +++++----- sources | 4 +- wasi.patch | 2 +- 7 files changed, 32 insertions(+), 151 deletions(-) delete mode 100644 im-patch.patch diff --git a/.gitignore b/.gitignore index e3669fb..79026f1 100644 --- a/.gitignore +++ b/.gitignore @@ -631,3 +631,5 @@ firefox-3.6.4.source.tar.bz2 /wasi-sdk-20-1.fc39.src.rpm /firefox-124.0.2.source.tar.xz /firefox-langpacks-124.0.2-20240404.tar.xz +/firefox-langpacks-125.0-20240409.tar.xz +/firefox-125.0.source.tar.xz diff --git a/firefox-enable-addons.patch b/firefox-enable-addons.patch index 15d0707..75e1403 100644 --- a/firefox-enable-addons.patch +++ b/firefox-enable-addons.patch @@ -1,10 +1,10 @@ -diff -up firefox-55.0/browser/app/profile/firefox.js.addons firefox-55.0/browser/app/profile/firefox.js ---- firefox-55.0/browser/app/profile/firefox.js.addons 2017-08-02 10:58:30.566363833 +0200 -+++ firefox-55.0/browser/app/profile/firefox.js 2017-08-02 10:59:15.377216959 +0200 -@@ -65,7 +65,8 @@ pref("extensions.systemAddon.update.url" +diff -up firefox-125.0/browser/app/profile/firefox.js.addons firefox-125.0/browser/app/profile/firefox.js +--- firefox-125.0/browser/app/profile/firefox.js.addons 2024-04-09 10:34:30.728405003 +0200 ++++ firefox-125.0/browser/app/profile/firefox.js 2024-04-09 10:36:01.444584632 +0200 +@@ -58,7 +58,8 @@ pref("extensions.systemAddon.update.enab // Disable add-ons that are not installed by the user in all scopes by default. - // See the SCOPE constants in AddonManager.jsm for values to use here. + // See the SCOPE constants in AddonManager.sys.mjs for values to use here. -pref("extensions.autoDisableScopes", 15); +pref("extensions.autoDisableScopes", 0); +pref("extensions.showMismatchUI", false); diff --git a/firefox.spec b/firefox.spec index 7b48e09..d16ec1e 100644 --- a/firefox.spec +++ b/firefox.spec @@ -188,13 +188,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 124.0.2 -Release: 2%{?pre_tag}%{?dist} +Version: 125.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240404.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240409.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -271,7 +271,6 @@ Patch230: firefox-enable-vaapi.patch Patch231: fedora-customization.patch Patch241: 0025-Add-KDE-integration-to-Firefox-toolkit-parts.patch Patch242: 0026-Add-KDE-integration-to-Firefox.patch -Patch243: im-patch.patch # Upstream patches Patch402: mozilla-1196777.patch @@ -587,7 +586,6 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch231 -p1 -b .fedora-customization #%patch241 -p1 -b .kde-integration-toolkit #%patch242 -p1 -b .kde-integration -%patch243 -p1 -b .im-patch %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 @@ -1228,6 +1226,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Apr 9 2024 Martin Stransky - 125.0-1 +- Updated to 125.0 + * Thu Apr 4 2024 Martin Stransky - 124.0.2-2 - Updated to 124.0.2 diff --git a/im-patch.patch b/im-patch.patch deleted file mode 100644 index 1fa871d..0000000 --- a/im-patch.patch +++ /dev/null @@ -1,122 +0,0 @@ -diff -up firefox-124.0.1/widget/gtk/IMContextWrapper.cpp.im-patch firefox-124.0.1/widget/gtk/IMContextWrapper.cpp ---- firefox-124.0.1/widget/gtk/IMContextWrapper.cpp.im-patch 2024-03-22 05:00:19.000000000 +0100 -+++ firefox-124.0.1/widget/gtk/IMContextWrapper.cpp 2024-03-25 21:39:58.961947576 +0100 -@@ -232,11 +232,18 @@ class SelectionStyleProvider final { - sHasShutDown = true; - } - -- // mContainer associated with an IM context. -- void AttachTo(MozContainer* aContainer) { -- gtk_style_context_add_provider( -- gtk_widget_get_style_context(GTK_WIDGET(aContainer)), -- GTK_STYLE_PROVIDER(mProvider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); -+ // aGDKWindow is a GTK window which will be associated with an IM context. -+ void AttachTo(GdkWindow* aGDKWindow) { -+ GtkWidget* widget = nullptr; -+ // gdk_window_get_user_data() typically returns pointer to widget that -+ // window belongs to. If it's widget, fcitx retrieves selection colors -+ // of them. So, we need to overwrite its style. -+ gdk_window_get_user_data(aGDKWindow, (gpointer*)&widget); -+ if (GTK_IS_WIDGET(widget)) { -+ gtk_style_context_add_provider(gtk_widget_get_style_context(widget), -+ GTK_STYLE_PROVIDER(mProvider), -+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); -+ } - } - - void OnThemeChanged() { -@@ -410,17 +417,21 @@ nsDependentCSubstring IMContextWrapper:: - } - - void IMContextWrapper::Init() { -+ MozContainer* container = mOwnerWindow->GetMozContainer(); -+ MOZ_ASSERT(container, "container is null"); -+ GdkWindow* gdkWindow = gtk_widget_get_window(GTK_WIDGET(container)); -+ - // Overwrite selection colors of the window before associating the window - // with IM context since IME may look up selection colors via IM context - // to support any colored widgets. -- SelectionStyleProvider::GetInstance()->AttachTo( -- mOwnerWindow->GetMozContainer()); -+ SelectionStyleProvider::GetInstance()->AttachTo(gdkWindow); - - // NOTE: gtk_im_*_new() abort (kill) the whole process when it fails. - // So, we don't need to check the result. - - // Normal context. - mContext = gtk_im_multicontext_new(); -+ gtk_im_context_set_client_window(mContext, gdkWindow); - g_signal_connect(mContext, "preedit_changed", - G_CALLBACK(IMContextWrapper::OnChangeCompositionCallback), - this); -@@ -492,6 +503,7 @@ void IMContextWrapper::Init() { - // Simple context - if (sUseSimpleContext) { - mSimpleContext = gtk_im_context_simple_new(); -+ gtk_im_context_set_client_window(mSimpleContext, gdkWindow); - g_signal_connect(mSimpleContext, "preedit_changed", - G_CALLBACK(&IMContextWrapper::OnChangeCompositionCallback), - this); -@@ -514,6 +526,7 @@ void IMContextWrapper::Init() { - - // Dummy context - mDummyContext = gtk_im_multicontext_new(); -+ gtk_im_context_set_client_window(mDummyContext, gdkWindow); - - MOZ_LOG(gIMELog, LogLevel::Info, - ("0x%p Init(), mOwnerWindow=%p, mContext=%p (im=\"%s\"), " -@@ -540,17 +553,6 @@ IMContextWrapper::~IMContextWrapper() { - MOZ_LOG(gIMELog, LogLevel::Info, ("0x%p ~IMContextWrapper()", this)); - } - --void IMContextWrapper::SetGdkWindow(GdkWindow* aGdkWindow) { -- MOZ_LOG(gIMELog, LogLevel::Info, -- ("0x%p GdkWindowChanged(%p)", this, aGdkWindow)); -- MOZ_ASSERT(!aGdkWindow || mOwnerWindow->GetGdkWindow() == aGdkWindow); -- gtk_im_context_set_client_window(mContext, aGdkWindow); -- if (mSimpleContext) { -- gtk_im_context_set_client_window(mSimpleContext, aGdkWindow); -- } -- gtk_im_context_set_client_window(mDummyContext, aGdkWindow); --} -- - NS_IMETHODIMP - IMContextWrapper::NotifyIME(TextEventDispatcher* aTextEventDispatcher, - const IMENotification& aNotification) { -diff -up firefox-124.0.1/widget/gtk/IMContextWrapper.h.im-patch firefox-124.0.1/widget/gtk/IMContextWrapper.h ---- firefox-124.0.1/widget/gtk/IMContextWrapper.h.im-patch 2024-03-22 05:00:19.000000000 +0100 -+++ firefox-124.0.1/widget/gtk/IMContextWrapper.h 2024-03-25 21:39:58.961947576 +0100 -@@ -117,10 +117,6 @@ class IMContextWrapper final : public Te - void OnUpdateComposition(); - void OnLayoutChange(); - -- // Set GdkWindow associated with IM context. -- // It can be null which disables context operations. -- void SetGdkWindow(GdkWindow* aGdkWindow); -- - TextEventDispatcher* GetTextEventDispatcher(); - - // TODO: Typically, new IM comes every several years. And now, our code -diff -up firefox-124.0.1/widget/gtk/nsWindow.cpp.im-patch firefox-124.0.1/widget/gtk/nsWindow.cpp ---- firefox-124.0.1/widget/gtk/nsWindow.cpp.im-patch 2024-03-25 21:39:58.959947505 +0100 -+++ firefox-124.0.1/widget/gtk/nsWindow.cpp 2024-03-25 21:41:09.178439036 +0100 -@@ -5822,9 +5822,6 @@ void nsWindow::EnsureGdkWindow() { - if (!mGdkWindow) { - mGdkWindow = gtk_widget_get_window(GTK_WIDGET(mContainer)); - g_object_set_data(G_OBJECT(mGdkWindow), "nsWindow", this); -- if (mIMContext) { -- mIMContext->SetGdkWindow(mGdkWindow); -- } - } - } - -@@ -9933,9 +9930,6 @@ void nsWindow::DisableRendering() { - LOG("nsWindow::DisableRendering()"); - - if (mGdkWindow) { -- if (mIMContext) { -- mIMContext->SetGdkWindow(nullptr); -- } - g_object_set_data(G_OBJECT(mGdkWindow), "nsWindow", nullptr); - mGdkWindow = nullptr; - } diff --git a/mozilla-1667096.patch b/mozilla-1667096.patch index 85dd729..924705f 100644 --- a/mozilla-1667096.patch +++ b/mozilla-1667096.patch @@ -1,6 +1,6 @@ -diff -up firefox-108.0/media/ffvpx/libavcodec/codec_list.c.1667096 firefox-108.0/media/ffvpx/libavcodec/codec_list.c ---- firefox-108.0/media/ffvpx/libavcodec/codec_list.c.1667096 2022-12-05 21:18:00.000000000 +0100 -+++ firefox-108.0/media/ffvpx/libavcodec/codec_list.c 2022-12-08 08:29:54.513562296 +0100 +diff -up firefox-125.0/media/ffvpx/libavcodec/codec_list.c.1667096 firefox-125.0/media/ffvpx/libavcodec/codec_list.c +--- firefox-125.0/media/ffvpx/libavcodec/codec_list.c.1667096 2024-04-08 22:17:52.000000000 +0200 ++++ firefox-125.0/media/ffvpx/libavcodec/codec_list.c 2024-04-09 10:40:58.727006437 +0200 @@ -11,6 +11,9 @@ static const FFCodec * const codec_list[ #if CONFIG_MP3_DECODER &ff_mp3_decoder, @@ -11,9 +11,9 @@ diff -up firefox-108.0/media/ffvpx/libavcodec/codec_list.c.1667096 firefox-108.0 #if CONFIG_LIBDAV1D &ff_libdav1d_decoder, #endif -diff -up firefox-108.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-108.0/media/ffvpx/libavcodec/libfdk-aacdec.c ---- firefox-108.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 2022-12-08 08:29:54.514562328 +0100 -+++ firefox-108.0/media/ffvpx/libavcodec/libfdk-aacdec.c 2022-09-03 18:20:04.000000000 +0200 +diff -up firefox-125.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-125.0/media/ffvpx/libavcodec/libfdk-aacdec.c +--- firefox-125.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 2024-04-09 10:40:58.727006437 +0200 ++++ firefox-125.0/media/ffvpx/libavcodec/libfdk-aacdec.c 2024-04-09 10:40:58.727006437 +0200 @@ -0,0 +1,497 @@ +/* + * AAC decoder wrapper @@ -512,12 +512,12 @@ diff -up firefox-108.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-10 + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .p.wrapper_name = "libfdk", +}; -diff -up firefox-108.0/media/ffvpx/libavcodec/moz.build.1667096 firefox-108.0/media/ffvpx/libavcodec/moz.build ---- firefox-108.0/media/ffvpx/libavcodec/moz.build.1667096 2022-12-05 21:18:01.000000000 +0100 -+++ firefox-108.0/media/ffvpx/libavcodec/moz.build 2022-12-08 08:29:54.514562328 +0100 -@@ -130,6 +130,12 @@ if CONFIG['MOZ_LIBAV_FFT']: - 'avfft.c', - ] +diff -up firefox-125.0/media/ffvpx/libavcodec/moz.build.1667096 firefox-125.0/media/ffvpx/libavcodec/moz.build +--- firefox-125.0/media/ffvpx/libavcodec/moz.build.1667096 2024-04-09 10:40:58.727006437 +0200 ++++ firefox-125.0/media/ffvpx/libavcodec/moz.build 2024-04-09 10:57:10.584104658 +0200 +@@ -146,6 +146,12 @@ else: + CXXFLAGS += CONFIG["MOZ_LIBVPX_CFLAGS"] + OS_LIBS += CONFIG["MOZ_LIBVPX_LIBS"] +if CONFIG['MOZ_FDK_AAC']: + SOURCES += [ @@ -528,10 +528,10 @@ diff -up firefox-108.0/media/ffvpx/libavcodec/moz.build.1667096 firefox-108.0/me SYMBOLS_FILE = 'avcodec.symbols' NoVisibilityFlags() -diff -up firefox-108.0/toolkit/moz.configure.1667096 firefox-108.0/toolkit/moz.configure ---- firefox-108.0/toolkit/moz.configure.1667096 2022-12-05 21:21:08.000000000 +0100 -+++ firefox-108.0/toolkit/moz.configure 2022-12-08 08:29:54.514562328 +0100 -@@ -2134,6 +2134,15 @@ with only_when(compile_environment): +diff -up firefox-125.0/toolkit/moz.configure.1667096 firefox-125.0/toolkit/moz.configure +--- firefox-125.0/toolkit/moz.configure.1667096 2024-04-09 10:40:58.711005876 +0200 ++++ firefox-125.0/toolkit/moz.configure 2024-04-09 10:40:58.728006472 +0200 +@@ -2395,6 +2395,15 @@ with only_when(compile_environment): set_config("MOZ_SYSTEM_PNG", True, when="--with-system-png") diff --git a/sources b/sources index 8df460d..a7b8059 100644 --- a/sources +++ b/sources @@ -1,6 +1,6 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 -SHA512 (firefox-124.0.2.source.tar.xz) = 8cf340de6e34812f8ae3363265859a263330af770d981c3dd1ca1e7e0cfe513604d3e68184d4aa1446569aefbdf359d561fbc200faf19a5ed020a1709d9ef10e -SHA512 (firefox-langpacks-124.0.2-20240404.tar.xz) = ac50445a026eb6515b9d891fde22eb41659417ee1daea3d941e370108861349edbceae4ab5ed8947c03c3202eb802d01d051de1a98603243568f755d62b9eab3 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 +SHA512 (firefox-langpacks-125.0-20240409.tar.xz) = 4789675ba8677d7ef4746e68928d7a125c7db95eeb8184264b2294f380c4aca1343ff30c238bba43378c6c9cb3ccd7768355f2cee6a18ec9499d6372e3f0b539 +SHA512 (firefox-125.0.source.tar.xz) = c520070e5a8872f3df4f5e35b9a605eef95f61254f6242040f02b2b68d6c8eef993885a18144353326a7488ac27115fa4ad2ef5615885e5155ab3f8194a61977 diff --git a/wasi.patch b/wasi.patch index 33ab037..aaa5337 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/home/jhorak/f/firefox/firefox-124.0.2/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-125.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 48f9b0fcc9c70f849cd9aa9e8f2aee7f4e5e9476 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 11 Apr 2024 13:03:39 +0200 Subject: [PATCH 338/545] buid config - disable bootstrap --- firefox-mozconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/firefox-mozconfig b/firefox-mozconfig index 272b265..2736abc 100644 --- a/firefox-mozconfig +++ b/firefox-mozconfig @@ -14,6 +14,7 @@ ac_add_options --allow-addon-sideload ac_add_options --with-system-fdk-aac ac_add_options --enable-js-shell ac_add_options --with-unsigned-addon-scopes=app,system +ac_add_options --disable-bootstrap export BUILD_OFFICIAL=1 export MOZILLA_OFFICIAL=1 From 1ab10546122ac3e24bdc4bdace3c43b15591950e Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Sat, 20 Apr 2024 10:48:16 +0200 Subject: [PATCH 339/545] Update to 125.0.2 --- .gitignore | 2 ++ firefox.spec | 4 ++-- sources | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 79026f1..d96cf7a 100644 --- a/.gitignore +++ b/.gitignore @@ -633,3 +633,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-124.0.2-20240404.tar.xz /firefox-langpacks-125.0-20240409.tar.xz /firefox-125.0.source.tar.xz +/firefox-125.0.2.source.tar.xz +/firefox-langpacks-125.0.2-20240420.tar.xz diff --git a/firefox.spec b/firefox.spec index d16ec1e..5e413e6 100644 --- a/firefox.spec +++ b/firefox.spec @@ -188,13 +188,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 125.0 +Version: 125.0.2 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240409.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240420.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz diff --git a/sources b/sources index a7b8059..9c82ea3 100644 --- a/sources +++ b/sources @@ -2,5 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 -SHA512 (firefox-langpacks-125.0-20240409.tar.xz) = 4789675ba8677d7ef4746e68928d7a125c7db95eeb8184264b2294f380c4aca1343ff30c238bba43378c6c9cb3ccd7768355f2cee6a18ec9499d6372e3f0b539 -SHA512 (firefox-125.0.source.tar.xz) = c520070e5a8872f3df4f5e35b9a605eef95f61254f6242040f02b2b68d6c8eef993885a18144353326a7488ac27115fa4ad2ef5615885e5155ab3f8194a61977 +SHA512 (firefox-125.0.2.source.tar.xz) = f6d5fff7c5c532d2e41a246d0403bdd746981cfcb7c43f9d3d8ec85a7acc3310a52043d1e18848475cef1b63c24769e81b2b06d68ae007b68016ee51436032f1 +SHA512 (firefox-langpacks-125.0.2-20240420.tar.xz) = 8bd427b559efb174a56367ee28d47ed8b268cb8dcc659c67418ddfb5f124e9299b396bfd6c1651e55deca77e9ab067f4da6f8c423688c0109c2b532a9ac5dba9 From 4b6a0d9ad64b6fc7571343f9c0e45ce603262822 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 29 Apr 2024 12:10:20 +0200 Subject: [PATCH 340/545] Updated to 125.0.3 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- wasi.patch | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index d96cf7a..f32cde1 100644 --- a/.gitignore +++ b/.gitignore @@ -635,3 +635,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-125.0.source.tar.xz /firefox-125.0.2.source.tar.xz /firefox-langpacks-125.0.2-20240420.tar.xz +/firefox-125.0.3.source.tar.xz +/firefox-langpacks-125.0.3-20240429.tar.xz diff --git a/firefox.spec b/firefox.spec index 5e413e6..0f03988 100644 --- a/firefox.spec +++ b/firefox.spec @@ -188,13 +188,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 125.0.2 +Version: 125.0.3 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240420.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240429.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1226,6 +1226,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Apr 29 2024 Martin Stransky - 125.0.3-1 +- Updated to 125.0.3 + * Tue Apr 9 2024 Martin Stransky - 125.0-1 - Updated to 125.0 diff --git a/sources b/sources index 9c82ea3..7fcfca4 100644 --- a/sources +++ b/sources @@ -2,5 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 -SHA512 (firefox-125.0.2.source.tar.xz) = f6d5fff7c5c532d2e41a246d0403bdd746981cfcb7c43f9d3d8ec85a7acc3310a52043d1e18848475cef1b63c24769e81b2b06d68ae007b68016ee51436032f1 -SHA512 (firefox-langpacks-125.0.2-20240420.tar.xz) = 8bd427b559efb174a56367ee28d47ed8b268cb8dcc659c67418ddfb5f124e9299b396bfd6c1651e55deca77e9ab067f4da6f8c423688c0109c2b532a9ac5dba9 +SHA512 (firefox-125.0.3.source.tar.xz) = 18e705a3093290311ccb5f27f01e43fe243ece94c1769a9ccc4fa53d370e32a1ec6a107cdeb531e9468b9aca1a1fe668161adb7acc1ec65fd383837882c7d484 +SHA512 (firefox-langpacks-125.0.3-20240429.tar.xz) = 8e7bd843dde8331b28445639355cf36c203ced7a675186ac9fc5680c0dcae10a59039d3f6b9c1029f0816a95b3a776c5d0aec64ee3638b522463fb7a0dd1825d diff --git a/wasi.patch b/wasi.patch index aaa5337..9bf6ffd 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-125.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-125.0.3/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From f4c7885a695292c6b3cdffa4239455f1b336307a Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 7 May 2024 09:14:25 +0200 Subject: [PATCH 341/545] Added ffmpeg-free to recommends (rhbz#2023833) --- firefox.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 0f03988..cf5f5b0 100644 --- a/firefox.spec +++ b/firefox.spec @@ -189,7 +189,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 125.0.3 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -360,6 +360,7 @@ Recommends: firefox-langpacks = %{version}-%{release} %else Obsoletes: firefox-langpacks < %{version}-%{release} %endif +Recommends: ffmpeg-free Recommends: libva Requires: p11-kit-trust Requires: pciutils-libs @@ -1226,6 +1227,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue May 7 2024 Martin Stransky - 125.0.3-2 +- Added ffmpeg-free to recommends (rhbz#2023833). + * Mon Apr 29 2024 Martin Stransky - 125.0.3-1 - Updated to 125.0.3 From ba88b344ea6a8c33b410abb405b5c9c48779ec2b Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 9 May 2024 09:28:12 +0200 Subject: [PATCH 342/545] Updated to 126.0 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- wasi.patch | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index f32cde1..6b4d1ad 100644 --- a/.gitignore +++ b/.gitignore @@ -637,3 +637,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-125.0.2-20240420.tar.xz /firefox-125.0.3.source.tar.xz /firefox-langpacks-125.0.3-20240429.tar.xz +/firefox-126.0.source.tar.xz +/firefox-langpacks-126.0-20240507.tar.xz diff --git a/firefox.spec b/firefox.spec index cf5f5b0..8725893 100644 --- a/firefox.spec +++ b/firefox.spec @@ -188,13 +188,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 125.0.3 -Release: 2%{?pre_tag}%{?dist} +Version: 126.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240429.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240507.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1227,6 +1227,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu May 9 2024 Martin Stransky - 126.0-1 +- Updated to 126.0 + * Tue May 7 2024 Martin Stransky - 125.0.3-2 - Added ffmpeg-free to recommends (rhbz#2023833). diff --git a/sources b/sources index 7fcfca4..23bdfff 100644 --- a/sources +++ b/sources @@ -2,5 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 -SHA512 (firefox-125.0.3.source.tar.xz) = 18e705a3093290311ccb5f27f01e43fe243ece94c1769a9ccc4fa53d370e32a1ec6a107cdeb531e9468b9aca1a1fe668161adb7acc1ec65fd383837882c7d484 -SHA512 (firefox-langpacks-125.0.3-20240429.tar.xz) = 8e7bd843dde8331b28445639355cf36c203ced7a675186ac9fc5680c0dcae10a59039d3f6b9c1029f0816a95b3a776c5d0aec64ee3638b522463fb7a0dd1825d +SHA512 (firefox-126.0.source.tar.xz) = e158e9f1514012cfe4e2052053896f74f75dd4588fd0b89cd672463d79622e75077fd5fe4cb8dfa7cad7ae69ffc3e0320e12106b2bb86dc8f017aeae7758cb23 +SHA512 (firefox-langpacks-126.0-20240507.tar.xz) = e4fb6422fd62334ec47daac402c0e838a71c32f46c0951abf329f5c068c29fb08848a5b8090cc19b797e5b06f0f22910f3f1b582bb20620e4259a745e34bffb6 diff --git a/wasi.patch b/wasi.patch index 9bf6ffd..6be5e56 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-125.0.3/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-126.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 2dda7f8609eb8a4a6d8c672bef4462f6ed52063d Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Thu, 9 May 2024 16:52:13 +0200 Subject: [PATCH 343/545] Update dump_syms --- gen_dump_syms-vendor.sh | 2 +- sources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gen_dump_syms-vendor.sh b/gen_dump_syms-vendor.sh index d14888f..f34ce8e 100755 --- a/gen_dump_syms-vendor.sh +++ b/gen_dump_syms-vendor.sh @@ -12,7 +12,7 @@ to be used with 'cargo vendor' commmand. """ [dependencies] -dump_syms = "2.2.2" +dump_syms = "2.3.1" [[bin]] name = "dummy" diff --git a/sources b/sources index 23bdfff..9737bf3 100644 --- a/sources +++ b/sources @@ -1,6 +1,6 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 -SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (firefox-126.0.source.tar.xz) = e158e9f1514012cfe4e2052053896f74f75dd4588fd0b89cd672463d79622e75077fd5fe4cb8dfa7cad7ae69ffc3e0320e12106b2bb86dc8f017aeae7758cb23 SHA512 (firefox-langpacks-126.0-20240507.tar.xz) = e4fb6422fd62334ec47daac402c0e838a71c32f46c0951abf329f5c068c29fb08848a5b8090cc19b797e5b06f0f22910f3f1b582bb20620e4259a745e34bffb6 +SHA512 (dump_syms-vendor.tar.xz) = 58d4ac9556dcf408f04429bf6300e0eef8b554763d5dc45e0dc150465f714fb43b8a44fa20c7e92ad462d4af9b26cb63ec584b34551f536fc61b6340ad55bb8d From cc170dd2bb5abaeefd89adf98861bf805c01c4e9 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Fri, 10 May 2024 11:23:27 +0200 Subject: [PATCH 344/545] Removed no longer shipped files for crashreporter --- firefox.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/firefox.spec b/firefox.spec index 8725893..f733fee 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1200,10 +1200,7 @@ fi %{_datadir}/icons/hicolor/symbolic/apps/firefox-symbolic.svg %if %{enable_mozilla_crashreporter} %{mozappdir}/crashreporter -%{mozappdir}/crashreporter.ini %{mozappdir}/minidump-analyzer -%{mozappdir}/Throbber-small.gif -%{mozappdir}/browser/crashreporter-override.ini %endif %{mozappdir}/*.so %{mozappdir}/defaults/pref/channel-prefs.js From ff7edcafc6b994a26bcf2e9f23fae915108ed6c9 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 10 May 2024 13:11:54 +0200 Subject: [PATCH 345/545] Fix Gnome search provider for Fedora 40+, Backport WebRTC fix for screen cast glitches in KDE --- D209910.diff | 385 ++++++++++++++++++ D209911.diff | 54 +++ firefox.spec | 23 +- ...pewire-be-shared-with-more-consumers.patch | 66 --- ...simplify-thread-and-lock-annotations.patch | 144 ------- ...ture-pipewire-drop-corrupted-buffers.patch | 51 +++ org.mozilla.firefox.SearchProvider.service | 3 - org.mozilla.firefox.desktop | 2 +- org.mozilla.firefox.service | 3 + sources | 2 +- 10 files changed, 513 insertions(+), 220 deletions(-) create mode 100644 D209910.diff create mode 100644 D209911.diff delete mode 100644 libwebrtc-allow-videocapturemodulepipewire-be-shared-with-more-consumers.patch delete mode 100644 libwebrtc-simplify-thread-and-lock-annotations.patch create mode 100644 libwebrtc-video-capture-pipewire-drop-corrupted-buffers.patch delete mode 100644 org.mozilla.firefox.SearchProvider.service create mode 100644 org.mozilla.firefox.service diff --git a/D209910.diff b/D209910.diff new file mode 100644 index 0000000..5b7b571 --- /dev/null +++ b/D209910.diff @@ -0,0 +1,385 @@ +diff -up firefox-126.0/toolkit/xre/DBusService.cpp.D209910 firefox-126.0/toolkit/xre/DBusService.cpp +--- firefox-126.0/toolkit/xre/DBusService.cpp.D209910 2024-05-09 12:20:44.081565311 +0200 ++++ firefox-126.0/toolkit/xre/DBusService.cpp 2024-05-09 12:59:43.865983543 +0200 +@@ -0,0 +1,299 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#include ++#include ++#include ++#include ++#include ++#include "DBusService.h" ++#include "nsAppRunner.h" ++#include "mozilla/Unused.h" ++#include "mozilla/GUniquePtr.h" ++#include "mozilla/WidgetUtils.h" ++#include ++#include "nsIObserverService.h" ++#include "WidgetUtilsGtk.h" ++#include "prproces.h" ++#include "nsPrintfCString.h" ++ ++using namespace mozilla; ++using namespace mozilla::widget; ++ ++DBusService::~DBusService() { StopFreedesktopListener(); } ++ ++bool DBusService::Init() { return StartFreedesktopListener(); } ++ ++void DBusService::Run() { ++ GMainLoop* loop = g_main_loop_new(nullptr, false); ++ g_main_loop_run(loop); ++ g_main_loop_unref(loop); ++} ++ ++// Mozilla has old GIO version in build roots ++#define G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE GBusNameOwnerFlags(1 << 2) ++ ++#define DBUS_BUS_NAME_TEMPLATE "org.mozilla.%s" ++#define DBUS_OBJECT_PATH_TEMPLATE "/org/mozilla/%s" ++ ++static const char* GetDBusBusName() { ++ static const char* name = []() { ++ nsAutoCString appName; ++ gAppData->GetDBusAppName(appName); ++ return ToNewCString(nsPrintfCString(DBUS_BUS_NAME_TEMPLATE, ++ appName.get())); // Intentionally leak ++ }(); ++ return name; ++} ++ ++static const char* GetDBusObjectPath() { ++ static const char* path = []() { ++ nsAutoCString appName; ++ gAppData->GetDBusAppName(appName); ++ return ToNewCString(nsPrintfCString(DBUS_OBJECT_PATH_TEMPLATE, ++ appName.get())); // Intentionally leak ++ }(); ++ return path; ++} ++ ++static const char* introspect_template = ++ "\n" ++ "\n" ++ "\n" ++ "\n" ++ " \n" ++ " \n" ++ " \n" ++ " \n" ++ " \n" ++ "\n" ++ "\n" ++ " \n" ++ " \n" ++ " \n" ++ "\n" ++ "\n" ++ "\n"; ++ ++void DBusService::LaunchApp(const char* aCommand, const char** aURIList, ++ int aURIListLen) { ++ // Allocate space for all uris, executable name, command if supplied and ++ // null terminator ++ int paramsNum = aURIListLen + 2; ++ if (aCommand) { ++ paramsNum++; ++ } ++ ++ char** argv = (char**)moz_xmalloc(sizeof(char*) * (paramsNum)); ++ int argc = 0; ++ argv[argc++] = strdup(mAppFile); ++ if (aCommand) { ++ argv[argc++] = strdup(aCommand); ++ } ++ for (int i = 0; aURIList && i < aURIListLen; i++) { ++ argv[argc++] = strdup(aURIList[i]); ++ } ++ argv[argc++] = nullptr; ++ ++ nsAutoCString exePath; ++ nsCOMPtr lf; ++ if (NS_SUCCEEDED(XRE_GetBinaryPath(getter_AddRefs(lf)))) { ++ if (NS_SUCCEEDED(lf->GetNativePath(exePath))) { ++ PR_CreateProcessDetached(exePath.get(), argv, nullptr, nullptr); ++ } ++ } ++ ++ for (int i = 0; i < argc; i++) { ++ free(argv[i]); ++ } ++ free(argv); ++} ++ ++// The Activate method is called when the application is started without ++// files to open. ++// Open :: (a{sv}) → () ++void DBusService::HandleFreedesktopActivate(GVariant* aParameters, ++ GDBusMethodInvocation* aReply) { ++ LaunchApp(nullptr, nullptr, 0); ++ g_dbus_method_invocation_return_value(aReply, nullptr); ++} ++ ++// The Open method is called when the application is started with files. ++// The array of strings is an array of URIs, in UTF-8. ++// Open :: (as,a{sv}) → () ++void DBusService::HandleFreedesktopOpen(GVariant* aParameters, ++ GDBusMethodInvocation* aReply) { ++ RefPtr variant = ++ dont_AddRef(g_variant_get_child_value(aParameters, 0)); ++ gsize uriNum = 0; ++ const char** uriArray = g_variant_get_strv(variant, &uriNum); ++ LaunchApp(nullptr, uriArray, uriNum); ++ g_dbus_method_invocation_return_value(aReply, nullptr); ++} ++ ++// The ActivateAction method is called when Desktop Actions are activated. ++// The action-name parameter is the name of the action. ++// ActivateAction :: (s,av,a{sv}) → () ++void DBusService::HandleFreedesktopActivateAction( ++ GVariant* aParameters, GDBusMethodInvocation* aReply) { ++ const char* actionName; ++ ++ // aParameters is "(s,av,a{sv})" type ++ RefPtr r = dont_AddRef(g_variant_get_child_value(aParameters, 0)); ++ if (!(actionName = g_variant_get_string(r, nullptr))) { ++ g_dbus_method_invocation_return_error( ++ aReply, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "Wrong params!"); ++ return; ++ } ++ ++ // TODO: Read av params and pass them to LaunchApp? ++ ++ // actionName matches desktop action defined in .desktop file. ++ // We implement it for .desktop file shipped by flatpak ++ // (taskcluster/docker/firefox-flatpak/org.mozilla.firefox.desktop) ++ if (!strcmp(actionName, "new-window")) { ++ LaunchApp(nullptr, nullptr, 0); ++ } else if (!strcmp(actionName, "new-private-window")) { ++ LaunchApp("--private-window", nullptr, 0); ++ } else if (!strcmp(actionName, "profile-manager-window")) { ++ LaunchApp("--ProfileManager", nullptr, 0); ++ } ++ ++ g_dbus_method_invocation_return_value(aReply, nullptr); ++} ++ ++static void HandleMethodCall(GDBusConnection* aConnection, const gchar* aSender, ++ const gchar* aObjectPath, ++ const gchar* aInterfaceName, ++ const gchar* aMethodName, GVariant* aParameters, ++ GDBusMethodInvocation* aInvocation, ++ gpointer aUserData) { ++ MOZ_ASSERT(aUserData); ++ MOZ_ASSERT(NS_IsMainThread()); ++ ++ if (strcmp("org.freedesktop.Application", aInterfaceName) == 0) { ++ if (strcmp("Activate", aMethodName) == 0) { ++ static_cast(aUserData)->HandleFreedesktopActivate( ++ aParameters, aInvocation); ++ } else if (strcmp("Open", aMethodName) == 0) { ++ static_cast(aUserData)->HandleFreedesktopOpen(aParameters, ++ aInvocation); ++ } else if (strcmp("ActivateAction", aMethodName) == 0) { ++ static_cast(aUserData)->HandleFreedesktopActivateAction( ++ aParameters, aInvocation); ++ } else { ++ g_warning("DBusService: HandleMethodCall() wrong method %s", aMethodName); ++ } ++ } ++} ++ ++static GVariant* HandleGetProperty(GDBusConnection* aConnection, ++ const gchar* aSender, ++ const gchar* aObjectPath, ++ const gchar* aInterfaceName, ++ const gchar* aPropertyName, GError** aError, ++ gpointer aUserData) { ++ MOZ_ASSERT(aUserData); ++ MOZ_ASSERT(NS_IsMainThread()); ++ g_set_error(aError, G_IO_ERROR, G_IO_ERROR_FAILED, ++ "%s:%s setting is not supported", aInterfaceName, aPropertyName); ++ return nullptr; ++} ++ ++static gboolean HandleSetProperty(GDBusConnection* aConnection, ++ const gchar* aSender, ++ const gchar* aObjectPath, ++ const gchar* aInterfaceName, ++ const gchar* aPropertyName, GVariant* aValue, ++ GError** aError, gpointer aUserData) { ++ MOZ_ASSERT(aUserData); ++ MOZ_ASSERT(NS_IsMainThread()); ++ g_set_error(aError, G_IO_ERROR, G_IO_ERROR_FAILED, ++ "%s:%s setting is not supported", aInterfaceName, aPropertyName); ++ return false; ++} ++ ++static const GDBusInterfaceVTable gInterfaceVTable = { ++ HandleMethodCall, HandleGetProperty, HandleSetProperty}; ++ ++void DBusService::OnBusAcquired(GDBusConnection* aConnection) { ++ GUniquePtr error; ++ mIntrospectionData = dont_AddRef(g_dbus_node_info_new_for_xml( ++ introspect_template, getter_Transfers(error))); ++ if (!mIntrospectionData) { ++ g_warning("DBusService: g_dbus_node_info_new_for_xml() failed! %s", ++ error->message); ++ return; ++ } ++ ++ mRegistrationId = g_dbus_connection_register_object( ++ aConnection, GetDBusObjectPath(), mIntrospectionData->interfaces[0], ++ &gInterfaceVTable, this, /* user_data */ ++ nullptr, /* user_data_free_func */ ++ getter_Transfers(error)); /* GError** */ ++ ++ if (mRegistrationId == 0) { ++ g_warning( ++ "DBusService: g_dbus_connection_register_object() " ++ "failed! %s", ++ error->message); ++ return; ++ } ++} ++ ++void DBusService::OnNameAcquired(GDBusConnection* aConnection) { ++ mConnection = aConnection; ++} ++ ++void DBusService::OnNameLost(GDBusConnection* aConnection) { ++ mConnection = nullptr; ++ if (!mRegistrationId) { ++ return; ++ } ++ if (g_dbus_connection_unregister_object(aConnection, mRegistrationId)) { ++ mRegistrationId = 0; ++ } ++} ++ ++bool DBusService::StartFreedesktopListener() { ++ if (mDBusID) { ++ // We're already connected so we don't need to reconnect ++ return false; ++ } ++ ++ mDBusID = g_bus_own_name( ++ G_BUS_TYPE_SESSION, GetDBusBusName(), G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE, ++ [](GDBusConnection* aConnection, const gchar*, ++ gpointer aUserData) -> void { ++ static_cast(aUserData)->OnBusAcquired(aConnection); ++ }, ++ [](GDBusConnection* aConnection, const gchar*, ++ gpointer aUserData) -> void { ++ static_cast(aUserData)->OnNameAcquired(aConnection); ++ }, ++ [](GDBusConnection* aConnection, const gchar*, ++ gpointer aUserData) -> void { ++ static_cast(aUserData)->OnNameLost(aConnection); ++ }, ++ this, nullptr); ++ ++ if (!mDBusID) { ++ g_warning("DBusService: g_bus_own_name() failed!"); ++ return false; ++ } ++ ++ return true; ++} ++ ++void DBusService::StopFreedesktopListener() { ++ OnNameLost(mConnection); ++ if (mDBusID) { ++ g_bus_unown_name(mDBusID); ++ mDBusID = 0; ++ } ++ mIntrospectionData = nullptr; ++} +diff -up firefox-126.0/toolkit/xre/DBusService.h.D209910 firefox-126.0/toolkit/xre/DBusService.h +--- firefox-126.0/toolkit/xre/DBusService.h.D209910 2024-05-09 12:20:44.081565311 +0200 ++++ firefox-126.0/toolkit/xre/DBusService.h 2024-05-09 12:20:44.081565311 +0200 +@@ -0,0 +1,64 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#ifndef DBusService_h__ ++#define DBusService_h__ ++ ++#include ++#include ++#include "mozilla/RefPtr.h" ++#include "mozilla/GRefPtr.h" ++ ++class DBusService final { ++ public: ++ DBusService(const char* aAppFile) : mAppFile(aAppFile){}; ++ ++ // nsBaseAppShell overrides: ++ bool Init(); ++ void Run(); ++ ++ void StartDBusListening(); ++ void StopDBusListening(); ++ ++ static void DBusSessionSleepCallback(GDBusProxy* aProxy, gchar* aSenderName, ++ gchar* aSignalName, ++ GVariant* aParameters, ++ gpointer aUserData); ++ static void DBusTimedatePropertiesChangedCallback(GDBusProxy* aProxy, ++ gchar* aSenderName, ++ gchar* aSignalName, ++ GVariant* aParameters, ++ gpointer aUserData); ++ static void DBusConnectClientResponse(GObject* aObject, GAsyncResult* aResult, ++ gpointer aUserData); ++ ++ void LaunchApp(const char* aCommand, const char** aURIList, int aURIListLen); ++ ++ void HandleFreedesktopActivate(GVariant* aParameters, ++ GDBusMethodInvocation* aReply); ++ void HandleFreedesktopOpen(GVariant* aParameters, ++ GDBusMethodInvocation* aReply); ++ void HandleFreedesktopActivateAction(GVariant* aParameters, ++ GDBusMethodInvocation* aReply); ++ ++ bool StartFreedesktopListener(); ++ void StopFreedesktopListener(); ++ ++ void OnBusAcquired(GDBusConnection* aConnection); ++ void OnNameAcquired(GDBusConnection* aConnection); ++ void OnNameLost(GDBusConnection* aConnection); ++ ++ private: ++ virtual ~DBusService(); ++ ++ // The connection is owned by DBus library ++ uint mDBusID = 0; ++ uint mRegistrationId = 0; ++ GDBusConnection* mConnection = nullptr; ++ RefPtr mIntrospectionData; ++ const char* mAppFile = nullptr; ++}; ++ ++#endif // DBusService_h__ +diff -up firefox-126.0/toolkit/xre/moz.build.D209910 firefox-126.0/toolkit/xre/moz.build +--- firefox-126.0/toolkit/xre/moz.build.D209910 2024-05-06 22:50:25.000000000 +0200 ++++ firefox-126.0/toolkit/xre/moz.build 2024-05-09 12:20:44.081565311 +0200 +@@ -99,6 +99,10 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gt + UNIFIED_SOURCES += [ + "nsNativeAppSupportUnix.cpp", + ] ++ if CONFIG["MOZ_ENABLE_DBUS"]: ++ UNIFIED_SOURCES += [ ++ "DBusService.cpp", ++ ] + CXXFLAGS += CONFIG["MOZ_X11_SM_CFLAGS"] + else: + UNIFIED_SOURCES += [ diff --git a/D209911.diff b/D209911.diff new file mode 100644 index 0000000..397cf43 --- /dev/null +++ b/D209911.diff @@ -0,0 +1,54 @@ +changeset: 743537:1bf2a3b85d0a +tag: tip +parent: 743535:29f24b1fbada +user: stransky +date: Thu May 09 10:38:21 2024 +0200 +files: toolkit/xre/nsAppRunner.cpp +description: +Bug 1894912 [Linux] Launch DBusService on --dbus-service param r?emilio + +Differential Revision: https://phabricator.services.mozilla.com/D209911 + + +diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp +--- a/toolkit/xre/nsAppRunner.cpp ++++ b/toolkit/xre/nsAppRunner.cpp +@@ -267,6 +267,9 @@ + #ifdef MOZ_WIDGET_GTK + # include "nsAppShell.h" + #endif ++#ifdef MOZ_ENABLE_DBUS ++# include "DBusService.h" ++#endif + + extern uint32_t gRestartMode; + extern void InstallSignalHandlers(const char* ProgramName); +@@ -2134,6 +2137,10 @@ static void DumpHelp() { + printf(" --headless Run without a GUI.\n"); + #endif + ++#if defined(MOZ_ENABLE_DBUS) ++ printf(" --dbus-service Run as DBus service.\n"); ++#endif ++ + // this works, but only after the components have registered. so if you drop + // in a new command line handler, --help won't not until the second run. out + // of the bug, because we ship a component.reg file, it works correctly. +@@ -4372,6 +4379,16 @@ int XREMain::XRE_mainInit(bool* aExitFla + return 0; + } + ++#ifdef MOZ_ENABLE_DBUS ++ if (CheckArg("dbus-service")) { ++ DBusService* dbusService = new DBusService(gArgv[0]); ++ if (dbusService->Init()) { ++ dbusService->Run(); ++ } ++ return 1; ++ } ++#endif ++ + rv = XRE_InitCommandLine(gArgc, gArgv); + NS_ENSURE_SUCCESS(rv, 1); + + diff --git a/firefox.spec b/firefox.spec index 8725893..76f251e 100644 --- a/firefox.spec +++ b/firefox.spec @@ -60,7 +60,7 @@ ExcludeArch: i686 # https://bugzilla.redhat.com/show_bug.cgi?id=1951606 %global enable_mozilla_crashreporter 0 %ifarch x86_64 %{ix86} -%global enable_mozilla_crashreporter 1 +%global enable_mozilla_crashreporter 0 %endif %if %{build_with_asan} %global enable_mozilla_crashreporter 0 @@ -189,7 +189,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 126.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -224,7 +224,7 @@ Source42: psummary Source43: print_failures Source44: print-error-reftest Source45: run-wayland-compositor -Source46: org.mozilla.firefox.SearchProvider.service +Source46: org.mozilla.firefox.service Source47: org.mozilla.firefox.desktop Source48: org.mozilla.firefox.appdata.xml.in Source49: wasi.patch.template @@ -275,6 +275,10 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch +Patch408: D209910.diff +Patch409: D209911.diff +# https://webrtc-review.googlesource.com/c/src/+/349881 +Patch410: libwebrtc-video-capture-pipewire-drop-corrupted-buffers.patch # PGO/LTO patches Patch600: pgo.patch @@ -590,6 +594,9 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 +%patch408 -p1 -b .D209910 +%patch409 -p1 -b .D209911 +%patch410 -p1 -b .libwebrtc-video-capture-pipewire-drop-corrupted-buffers # PGO patches %if %{build_with_pgo} @@ -744,7 +751,7 @@ chmod a-x third_party/rust/ash/src/extensions/nv/*.rs pushd wasi-sdk-20 NINJA_FLAGS=-v CC=clang CXX=clang++ env -u CFLAGS -u CXXFLAGS -u FFLAGS -u VALFLAGS -u RUSTFLAGS -u LDFLAGS -u LT_SYS_LIBRARY_PATH make package popd -%endif +%endif # ^ with wasi_sdk %if 0%{?use_bundled_cbindgen} @@ -860,7 +867,7 @@ env | grep GCOV echo "ac_add_options --enable-lto" >> .mozconfig echo "ac_add_options MOZ_PGO=1" >> .mozconfig %endif - + %if %{with wasi_sdk} echo "ac_add_options --with-wasi-sysroot=`pwd`/wasi-sdk-20/build/install/opt/wasi-sdk/share/wasi-sysroot" >> .mozconfig %else @@ -1227,6 +1234,12 @@ fi #--------------------------------------------------------------------- %changelog +* Fri May 10 2024 Martin Stransky - 126.0-2 +- Fix Gnome search provider for Fedora 40+ + +* Fri May 10 2024 Jan Grulich - 126.0-1 +- Backport WebRTC fix for screen cast glitches in KDE + * Thu May 9 2024 Martin Stransky - 126.0-1 - Updated to 126.0 diff --git a/libwebrtc-allow-videocapturemodulepipewire-be-shared-with-more-consumers.patch b/libwebrtc-allow-videocapturemodulepipewire-be-shared-with-more-consumers.patch deleted file mode 100644 index 71f65e5..0000000 --- a/libwebrtc-allow-videocapturemodulepipewire-be-shared-with-more-consumers.patch +++ /dev/null @@ -1,66 +0,0 @@ -diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h ---- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h -+++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h -@@ -48,10 +48,11 @@ - const rtc::scoped_refptr session_ - RTC_GUARDED_BY(capture_checker_); - int node_id_ RTC_GUARDED_BY(capture_checker_); - VideoCaptureCapability configured_capability_ - RTC_GUARDED_BY(pipewire_checker_); -+ bool initialized_ RTC_GUARDED_BY(capture_checker_); - bool started_ RTC_GUARDED_BY(api_lock_); - - struct pw_stream* stream_ RTC_GUARDED_BY(pipewire_checker_) = nullptr; - struct spa_hook stream_listener_ RTC_GUARDED_BY(pipewire_checker_); - }; -diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc ---- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc -+++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc -@@ -46,11 +46,14 @@ - return VideoType::kUnknown; - } - - VideoCaptureModulePipeWire::VideoCaptureModulePipeWire( - VideoCaptureOptions* options) -- : VideoCaptureImpl(), session_(options->pipewire_session()) {} -+ : VideoCaptureImpl(), -+ session_(options->pipewire_session()), -+ initialized_(false), -+ started_(false) {} - - VideoCaptureModulePipeWire::~VideoCaptureModulePipeWire() { - RTC_DCHECK_RUN_ON(&api_checker_); - - StopCapture(); -@@ -119,10 +122,18 @@ - int32_t VideoCaptureModulePipeWire::StartCapture( - const VideoCaptureCapability& capability) { - RTC_CHECK_RUNS_SERIALIZED(&capture_checker_); - RTC_DCHECK_RUN_ON(&api_checker_); - -+ if (initialized_) { -+ if (capability == _requestedCapability) { -+ return 0; -+ } else { -+ StopCapture(); -+ } -+ } -+ - uint8_t buffer[1024] = {}; - - RTC_LOG(LS_VERBOSE) << "Creating new PipeWire stream for node " << node_id_; - - PipeWireThreadLoopLock thread_loop_lock(session_->pw_main_loop_); -@@ -169,10 +180,12 @@ - << spa_strerror(res); - return -1; - } - - _requestedCapability = capability; -+ initialized_ = true; -+ - return 0; - } - - int32_t VideoCaptureModulePipeWire::StopCapture() { - RTC_CHECK_RUNS_SERIALIZED(&capture_checker_); diff --git a/libwebrtc-simplify-thread-and-lock-annotations.patch b/libwebrtc-simplify-thread-and-lock-annotations.patch deleted file mode 100644 index 82f542b..0000000 --- a/libwebrtc-simplify-thread-and-lock-annotations.patch +++ /dev/null @@ -1,144 +0,0 @@ -diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h ---- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h -+++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h -@@ -41,22 +41,20 @@ - static void OnStreamProcess(void* data); - - void OnFormatChanged(const struct spa_pod* format); - void ProcessBuffers(); - -- rtc::RaceChecker pipewire_checker_; -- - const rtc::scoped_refptr session_ -- RTC_GUARDED_BY(capture_checker_); -+ RTC_GUARDED_BY(api_checker_); -+ bool initialized_ RTC_GUARDED_BY(api_checker_); -+ bool started_ RTC_GUARDED_BY(api_lock_); - int node_id_ RTC_GUARDED_BY(capture_checker_); - VideoCaptureCapability configured_capability_ -- RTC_GUARDED_BY(pipewire_checker_); -- bool initialized_ RTC_GUARDED_BY(capture_checker_); -- bool started_ RTC_GUARDED_BY(api_lock_); -+ RTC_GUARDED_BY(capture_checker_); - -- struct pw_stream* stream_ RTC_GUARDED_BY(pipewire_checker_) = nullptr; -- struct spa_hook stream_listener_ RTC_GUARDED_BY(pipewire_checker_); -+ struct pw_stream* stream_ RTC_GUARDED_BY(capture_checker_) = nullptr; -+ struct spa_hook stream_listener_ RTC_GUARDED_BY(capture_checker_); - }; - } // namespace videocapturemodule - } // namespace webrtc - - #endif // MODULES_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_PIPEWIRE_H_ -diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc ---- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc -+++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc -@@ -119,11 +119,10 @@ - return static_cast(spa_pod_builder_pop(builder, &frames[0])); - } - - int32_t VideoCaptureModulePipeWire::StartCapture( - const VideoCaptureCapability& capability) { -- RTC_CHECK_RUNS_SERIALIZED(&capture_checker_); - RTC_DCHECK_RUN_ON(&api_checker_); - - if (initialized_) { - if (capability == _requestedCapability) { - return 0; -@@ -132,14 +131,21 @@ - } - } - - uint8_t buffer[1024] = {}; - -+ // We don't want members above to be guarded by capture_checker_ as -+ // it's meant to be for members that are accessed on the API thread -+ // only when we are not capturing. The code above can be called many -+ // times while sharing instance of VideoCapturePipeWire between -+ // websites and therefore it would not follow the requirements of this -+ // checker. -+ RTC_CHECK_RUNS_SERIALIZED(&capture_checker_); -+ PipeWireThreadLoopLock thread_loop_lock(session_->pw_main_loop_); -+ - RTC_LOG(LS_VERBOSE) << "Creating new PipeWire stream for node " << node_id_; - -- PipeWireThreadLoopLock thread_loop_lock(session_->pw_main_loop_); -- RTC_CHECK_RUNS_SERIALIZED(&pipewire_checker_); - pw_properties* reuse_props = - pw_properties_new_string("pipewire.client.reuse=1"); - stream_ = pw_stream_new(session_->pw_core_, "camera-stream", reuse_props); - - if (!stream_) { -@@ -186,15 +192,17 @@ - - return 0; - } - - int32_t VideoCaptureModulePipeWire::StopCapture() { -- RTC_CHECK_RUNS_SERIALIZED(&capture_checker_); - RTC_DCHECK_RUN_ON(&api_checker_); - - PipeWireThreadLoopLock thread_loop_lock(session_->pw_main_loop_); -- RTC_CHECK_RUNS_SERIALIZED(&pipewire_checker_); -+ // PipeWireSession is guarded by API checker so just make sure we do -+ // race detection when the PipeWire loop is locked/stopped to not run -+ // any callback at this point. -+ RTC_CHECK_RUNS_SERIALIZED(&capture_checker_); - if (stream_) { - pw_stream_destroy(stream_); - stream_ = nullptr; - } - -@@ -223,18 +231,18 @@ - uint32_t id, - const struct spa_pod* format) { - VideoCaptureModulePipeWire* that = - static_cast(data); - RTC_DCHECK(that); -- RTC_CHECK_RUNS_SERIALIZED(&that->pipewire_checker_); -+ RTC_CHECK_RUNS_SERIALIZED(&that->capture_checker_); - - if (format && id == SPA_PARAM_Format) - that->OnFormatChanged(format); - } - - void VideoCaptureModulePipeWire::OnFormatChanged(const struct spa_pod* format) { -- RTC_CHECK_RUNS_SERIALIZED(&pipewire_checker_); -+ RTC_CHECK_RUNS_SERIALIZED(&capture_checker_); - - uint32_t media_type, media_subtype; - - if (spa_format_parse(format, &media_type, &media_subtype) < 0) { - RTC_LOG(LS_ERROR) << "Failed to parse video format."; -@@ -329,11 +337,10 @@ - pw_stream_state state, - const char* error_message) { - VideoCaptureModulePipeWire* that = - static_cast(data); - RTC_DCHECK(that); -- RTC_CHECK_RUNS_SERIALIZED(&that->capture_checker_); - - MutexLock lock(&that->api_lock_); - switch (state) { - case PW_STREAM_STATE_STREAMING: - that->started_ = true; -@@ -372,11 +379,11 @@ - return kVideoRotation_0; - } - } - - void VideoCaptureModulePipeWire::ProcessBuffers() { -- RTC_CHECK_RUNS_SERIALIZED(&pipewire_checker_); -+ RTC_CHECK_RUNS_SERIALIZED(&capture_checker_); - - while (pw_buffer* buffer = pw_stream_dequeue_buffer(stream_)) { - struct spa_meta_header* h; - h = static_cast( - spa_buffer_find_meta_data(buffer->buffer, SPA_META_Header, sizeof(*h))); -diff --git a/third_party/libwebrtc/moz-patch-stack/541f202354.no-op-cherry-pick-msg b/third_party/libwebrtc/moz-patch-stack/541f202354.no-op-cherry-pick-msg -new file mode 100644 ---- /dev/null -+++ b/third_party/libwebrtc/moz-patch-stack/541f202354.no-op-cherry-pick-msg -@@ -0,0 +1 @@ -+We cherry-picked this in bug 1879752. - diff --git a/libwebrtc-video-capture-pipewire-drop-corrupted-buffers.patch b/libwebrtc-video-capture-pipewire-drop-corrupted-buffers.patch new file mode 100644 index 0000000..2e91759 --- /dev/null +++ b/libwebrtc-video-capture-pipewire-drop-corrupted-buffers.patch @@ -0,0 +1,51 @@ +From b7653310766909158a4781fe9def5fb8e9414d1a Mon Sep 17 00:00:00 2001 +From: Jan Grulich +Date: Mon, 06 May 2024 11:20:27 +0200 +Subject: [PATCH] Video capture PipeWire: drop corrupted PipeWire buffers + +Use SPA_CHUNK_FLAG_CORRUPTED and SPA_META_HEADER_FLAG_CORRUPTED flags to +determine corrupted buffers or corrupted buffer data. We used to only +rely on compositors setting chunk->size, but this doesn't make sense for +dmabufs where they have to make up arbitrary values. It also looks this +is not reliable and can cause glitches as we end up processing corrupted buffers. + +Bug: webrtc:338232699 +Change-Id: Ida0c6a5e7a37e19598c6d5884726200f81b94962 +--- + +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +index 6998d65..f7feddd 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +@@ -323,6 +323,15 @@ + return; + } + ++ struct spa_meta_header* header = ++ static_cast(spa_buffer_find_meta_data( ++ buffer->buffer, SPA_META_Header, sizeof(*header))); ++ if (header && (header->flags & SPA_META_HEADER_FLAG_CORRUPTED)) { ++ RTC_LOG(LS_WARNING) << "Dropping corrupted buffer"; ++ pw_stream_queue_buffer(that->pw_stream_, buffer); ++ return; ++ } ++ + that->ProcessBuffer(buffer); + + pw_stream_queue_buffer(that->pw_stream_, buffer); +@@ -709,7 +718,14 @@ + } + } + +- if (spa_buffer->datas[0].chunk->size == 0) { ++ if (spa_buffer->datas[0].chunk->flags & SPA_CHUNK_FLAG_CORRUPTED) { ++ RTC_LOG(LS_WARNING) << "Dropping buffer with corrupted data"; ++ return; ++ } ++ ++ if (spa_buffer->datas[0].type == SPA_DATA_MemFd && ++ spa_buffer->datas[0].chunk->size == 0) { ++ RTC_LOG(LS_WARNING) << "Dropping buffer with empty data"; + return; + } + diff --git a/org.mozilla.firefox.SearchProvider.service b/org.mozilla.firefox.SearchProvider.service deleted file mode 100644 index 40e8259..0000000 --- a/org.mozilla.firefox.SearchProvider.service +++ /dev/null @@ -1,3 +0,0 @@ -[D-BUS Service] -Name=org.mozilla.firefox.SearchProvider -Exec=/usr/bin/false diff --git a/org.mozilla.firefox.desktop b/org.mozilla.firefox.desktop index 7ac44d7..66c22dd 100644 --- a/org.mozilla.firefox.desktop +++ b/org.mozilla.firefox.desktop @@ -51,7 +51,7 @@ StartupNotify=true Categories=Network;WebBrowser; Keywords=web;browser;internet; Actions=new-window;new-private-window;profile-manager-window; -DBusActivatable=false +DBusActivatable=true [Desktop Action new-window] Name=Open a New Window diff --git a/org.mozilla.firefox.service b/org.mozilla.firefox.service new file mode 100644 index 0000000..fa5f856 --- /dev/null +++ b/org.mozilla.firefox.service @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=org.mozilla.firefox +Exec=/usr/lib64/firefox/firefox --dbus-service diff --git a/sources b/sources index 23bdfff..976deb5 100644 --- a/sources +++ b/sources @@ -2,5 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (dump_syms-vendor.tar.xz) = 5769c052fa874a965eb8837776b01fb097e8930f45d0d0d2a93997c4fae8726184a192aee52302bde62e62897801b1463cae9283563d9d60e8b8ee80a250f2a3 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 -SHA512 (firefox-126.0.source.tar.xz) = e158e9f1514012cfe4e2052053896f74f75dd4588fd0b89cd672463d79622e75077fd5fe4cb8dfa7cad7ae69ffc3e0320e12106b2bb86dc8f017aeae7758cb23 SHA512 (firefox-langpacks-126.0-20240507.tar.xz) = e4fb6422fd62334ec47daac402c0e838a71c32f46c0951abf329f5c068c29fb08848a5b8090cc19b797e5b06f0f22910f3f1b582bb20620e4259a745e34bffb6 +SHA512 (firefox-126.0.source.tar.xz) = 56025b051d544ca294911a1d6a66f09945f71012131881b64313dafb579730810a4b091950c90a21d4fd3f393ba23670d8409086e1677d80d0bbbe347c303527 From 96d904afbd404955bf222dfa0cebc933ad6cf7a8 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 13 May 2024 13:25:18 +0200 Subject: [PATCH 346/545] More upstream patches for Gnome search provider. --- D209910.diff => D209910.1715685533.diff | 252 ++++++++++++++---------- D209911.diff => D209911.1715685535.diff | 33 ++-- D210158.1715685536.diff | 58 ++++++ D210159.1715685538.diff | 49 +++++ firefox.spec | 19 +- org.mozilla.firefox.service | 2 +- 6 files changed, 282 insertions(+), 131 deletions(-) rename D209910.diff => D209910.1715685533.diff (78%) rename D209911.diff => D209911.1715685535.diff (64%) create mode 100644 D210158.1715685536.diff create mode 100644 D210159.1715685538.diff diff --git a/D209910.diff b/D209910.1715685533.diff similarity index 78% rename from D209910.diff rename to D209910.1715685533.diff index 5b7b571..c94d88e 100644 --- a/D209910.diff +++ b/D209910.1715685533.diff @@ -1,7 +1,80 @@ -diff -up firefox-126.0/toolkit/xre/DBusService.cpp.D209910 firefox-126.0/toolkit/xre/DBusService.cpp ---- firefox-126.0/toolkit/xre/DBusService.cpp.D209910 2024-05-09 12:20:44.081565311 +0200 -+++ firefox-126.0/toolkit/xre/DBusService.cpp 2024-05-09 12:59:43.865983543 +0200 -@@ -0,0 +1,299 @@ +diff --git a/widget/gtk/DBusService.h b/widget/gtk/DBusService.h +new file mode 100644 +--- /dev/null ++++ b/widget/gtk/DBusService.h +@@ -0,0 +1,67 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#ifndef DBusService_h__ ++#define DBusService_h__ ++ ++#include ++#include ++#include "mozilla/RefPtr.h" ++#include "mozilla/GRefPtr.h" ++ ++namespace mozilla::widget { ++ ++class DBusService final { ++ public: ++ explicit DBusService(const char* aAppFile) : mAppFile(aAppFile) {} ++ ~DBusService(); ++ ++ // nsBaseAppShell overrides: ++ bool Init(); ++ void Run(); ++ ++ void StartDBusListening(); ++ void StopDBusListening(); ++ ++ static void DBusSessionSleepCallback(GDBusProxy* aProxy, gchar* aSenderName, ++ gchar* aSignalName, ++ GVariant* aParameters, ++ gpointer aUserData); ++ static void DBusTimedatePropertiesChangedCallback(GDBusProxy* aProxy, ++ gchar* aSenderName, ++ gchar* aSignalName, ++ GVariant* aParameters, ++ gpointer aUserData); ++ static void DBusConnectClientResponse(GObject* aObject, GAsyncResult* aResult, ++ gpointer aUserData); ++ ++ bool LaunchApp(const char* aCommand, const char** aURIList, int aURIListLen); ++ ++ void HandleFreedesktopActivate(GVariant* aParameters, ++ GDBusMethodInvocation* aReply); ++ void HandleFreedesktopOpen(GVariant* aParameters, ++ GDBusMethodInvocation* aReply); ++ void HandleFreedesktopActivateAction(GVariant* aParameters, ++ GDBusMethodInvocation* aReply); ++ ++ bool StartFreedesktopListener(); ++ void StopFreedesktopListener(); ++ ++ void OnBusAcquired(GDBusConnection* aConnection); ++ void OnNameAcquired(GDBusConnection* aConnection); ++ void OnNameLost(GDBusConnection* aConnection); ++ ++ private: ++ // The connection is owned by DBus library ++ uint mDBusID = 0; ++ uint mRegistrationId = 0; ++ GDBusConnection* mConnection = nullptr; ++ RefPtr mIntrospectionData; ++ const char* mAppFile = nullptr; ++}; ++ ++} // namespace mozilla::widget ++ ++#endif // DBusService_h__ +diff --git a/widget/gtk/DBusService.cpp b/widget/gtk/DBusService.cpp +new file mode 100644 +--- /dev/null ++++ b/widget/gtk/DBusService.cpp +@@ -0,0 +1,327 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -21,6 +94,7 @@ diff -up firefox-126.0/toolkit/xre/DBusService.cpp.D209910 firefox-126.0/toolkit +#include "nsIObserverService.h" +#include "WidgetUtilsGtk.h" +#include "prproces.h" ++#include "mozilla/XREAppData.h" +#include "nsPrintfCString.h" + +using namespace mozilla; @@ -62,7 +136,10 @@ diff -up firefox-126.0/toolkit/xre/DBusService.cpp.D209910 firefox-126.0/toolkit + return path; +} + -+static const char* introspect_template = ++// See ++// https://specifications.freedesktop.org/desktop-entry-spec/1.1/ar01s07.html ++// for details ++static const char* kIntrospectTemplate = + "\n" @@ -83,7 +160,7 @@ diff -up firefox-126.0/toolkit/xre/DBusService.cpp.D209910 firefox-126.0/toolkit + "\n" + "\n"; + -+void DBusService::LaunchApp(const char* aCommand, const char** aURIList, ++bool DBusService::LaunchApp(const char* aCommand, const char** aURIList, + int aURIListLen) { + // Allocate space for all uris, executable name, command if supplied and + // null terminator @@ -92,7 +169,7 @@ diff -up firefox-126.0/toolkit/xre/DBusService.cpp.D209910 firefox-126.0/toolkit + paramsNum++; + } + -+ char** argv = (char**)moz_xmalloc(sizeof(char*) * (paramsNum)); ++ char** argv = (char**)moz_xmalloc(sizeof(char*) * paramsNum); + int argc = 0; + argv[argc++] = strdup(mAppFile); + if (aCommand) { @@ -105,9 +182,11 @@ diff -up firefox-126.0/toolkit/xre/DBusService.cpp.D209910 firefox-126.0/toolkit + + nsAutoCString exePath; + nsCOMPtr lf; ++ bool ret = false; + if (NS_SUCCEEDED(XRE_GetBinaryPath(getter_AddRefs(lf)))) { + if (NS_SUCCEEDED(lf->GetNativePath(exePath))) { -+ PR_CreateProcessDetached(exePath.get(), argv, nullptr, nullptr); ++ ret = (PR_CreateProcessDetached(exePath.get(), argv, nullptr, nullptr) != ++ PR_FAILURE); + } + } + @@ -115,6 +194,7 @@ diff -up firefox-126.0/toolkit/xre/DBusService.cpp.D209910 firefox-126.0/toolkit + free(argv[i]); + } + free(argv); ++ return ret; +} + +// The Activate method is called when the application is started without @@ -122,7 +202,12 @@ diff -up firefox-126.0/toolkit/xre/DBusService.cpp.D209910 firefox-126.0/toolkit +// Open :: (a{sv}) → () +void DBusService::HandleFreedesktopActivate(GVariant* aParameters, + GDBusMethodInvocation* aReply) { -+ LaunchApp(nullptr, nullptr, 0); ++ if (!LaunchApp(nullptr, nullptr, 0)) { ++ g_dbus_method_invocation_return_error(aReply, G_DBUS_ERROR, ++ G_DBUS_ERROR_FAILED, ++ "Failed to run target application."); ++ return; ++ } + g_dbus_method_invocation_return_value(aReply, nullptr); +} + @@ -134,8 +219,13 @@ diff -up firefox-126.0/toolkit/xre/DBusService.cpp.D209910 firefox-126.0/toolkit + RefPtr variant = + dont_AddRef(g_variant_get_child_value(aParameters, 0)); + gsize uriNum = 0; -+ const char** uriArray = g_variant_get_strv(variant, &uriNum); -+ LaunchApp(nullptr, uriArray, uriNum); ++ GUniquePtr uriArray(g_variant_get_strv(variant, &uriNum)); ++ if (!LaunchApp(nullptr, uriArray.get(), uriNum)) { ++ g_dbus_method_invocation_return_error(aReply, G_DBUS_ERROR, ++ G_DBUS_ERROR_FAILED, ++ "Failed to run target application."); ++ return; ++ } + g_dbus_method_invocation_return_value(aReply, nullptr); +} + @@ -159,14 +249,20 @@ diff -up firefox-126.0/toolkit/xre/DBusService.cpp.D209910 firefox-126.0/toolkit + // actionName matches desktop action defined in .desktop file. + // We implement it for .desktop file shipped by flatpak + // (taskcluster/docker/firefox-flatpak/org.mozilla.firefox.desktop) ++ bool ret = false; + if (!strcmp(actionName, "new-window")) { -+ LaunchApp(nullptr, nullptr, 0); ++ ret = LaunchApp(nullptr, nullptr, 0); + } else if (!strcmp(actionName, "new-private-window")) { -+ LaunchApp("--private-window", nullptr, 0); ++ ret = LaunchApp("--private-window", nullptr, 0); + } else if (!strcmp(actionName, "profile-manager-window")) { -+ LaunchApp("--ProfileManager", nullptr, 0); ++ ret = LaunchApp("--ProfileManager", nullptr, 0); ++ } ++ if (!ret) { ++ g_dbus_method_invocation_return_error(aReply, G_DBUS_ERROR, ++ G_DBUS_ERROR_FAILED, ++ "Failed to run target application."); ++ return; + } -+ + g_dbus_method_invocation_return_value(aReply, nullptr); +} + @@ -179,19 +275,22 @@ diff -up firefox-126.0/toolkit/xre/DBusService.cpp.D209910 firefox-126.0/toolkit + MOZ_ASSERT(aUserData); + MOZ_ASSERT(NS_IsMainThread()); + -+ if (strcmp("org.freedesktop.Application", aInterfaceName) == 0) { -+ if (strcmp("Activate", aMethodName) == 0) { -+ static_cast(aUserData)->HandleFreedesktopActivate( -+ aParameters, aInvocation); -+ } else if (strcmp("Open", aMethodName) == 0) { -+ static_cast(aUserData)->HandleFreedesktopOpen(aParameters, -+ aInvocation); -+ } else if (strcmp("ActivateAction", aMethodName) == 0) { -+ static_cast(aUserData)->HandleFreedesktopActivateAction( -+ aParameters, aInvocation); -+ } else { -+ g_warning("DBusService: HandleMethodCall() wrong method %s", aMethodName); -+ } ++ if (strcmp("org.freedesktop.Application", aInterfaceName) != 0) { ++ g_warning("DBusService: HandleMethodCall() wrong interface name %s", ++ aInterfaceName); ++ return; ++ } ++ if (strcmp("Activate", aMethodName) == 0) { ++ static_cast(aUserData)->HandleFreedesktopActivate( ++ aParameters, aInvocation); ++ } else if (strcmp("Open", aMethodName) == 0) { ++ static_cast(aUserData)->HandleFreedesktopOpen(aParameters, ++ aInvocation); ++ } else if (strcmp("ActivateAction", aMethodName) == 0) { ++ static_cast(aUserData)->HandleFreedesktopActivateAction( ++ aParameters, aInvocation); ++ } else { ++ g_warning("DBusService: HandleMethodCall() wrong method %s", aMethodName); + } +} + @@ -227,7 +326,7 @@ diff -up firefox-126.0/toolkit/xre/DBusService.cpp.D209910 firefox-126.0/toolkit +void DBusService::OnBusAcquired(GDBusConnection* aConnection) { + GUniquePtr error; + mIntrospectionData = dont_AddRef(g_dbus_node_info_new_for_xml( -+ introspect_template, getter_Transfers(error))); ++ kIntrospectTemplate, getter_Transfers(error))); + if (!mIntrospectionData) { + g_warning("DBusService: g_dbus_node_info_new_for_xml() failed! %s", + error->message); @@ -270,6 +369,8 @@ diff -up firefox-126.0/toolkit/xre/DBusService.cpp.D209910 firefox-126.0/toolkit + } + + mDBusID = g_bus_own_name( ++ // if org.mozilla.Firefox is taken it means we're already running ++ // so use G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE and quit. + G_BUS_TYPE_SESSION, GetDBusBusName(), G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE, + [](GDBusConnection* aConnection, const gchar*, + gpointer aUserData) -> void { @@ -301,85 +402,18 @@ diff -up firefox-126.0/toolkit/xre/DBusService.cpp.D209910 firefox-126.0/toolkit + } + mIntrospectionData = nullptr; +} -diff -up firefox-126.0/toolkit/xre/DBusService.h.D209910 firefox-126.0/toolkit/xre/DBusService.h ---- firefox-126.0/toolkit/xre/DBusService.h.D209910 2024-05-09 12:20:44.081565311 +0200 -+++ firefox-126.0/toolkit/xre/DBusService.h 2024-05-09 12:20:44.081565311 +0200 -@@ -0,0 +1,64 @@ -+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+#ifndef DBusService_h__ -+#define DBusService_h__ -+ -+#include -+#include -+#include "mozilla/RefPtr.h" -+#include "mozilla/GRefPtr.h" -+ -+class DBusService final { -+ public: -+ DBusService(const char* aAppFile) : mAppFile(aAppFile){}; -+ -+ // nsBaseAppShell overrides: -+ bool Init(); -+ void Run(); -+ -+ void StartDBusListening(); -+ void StopDBusListening(); -+ -+ static void DBusSessionSleepCallback(GDBusProxy* aProxy, gchar* aSenderName, -+ gchar* aSignalName, -+ GVariant* aParameters, -+ gpointer aUserData); -+ static void DBusTimedatePropertiesChangedCallback(GDBusProxy* aProxy, -+ gchar* aSenderName, -+ gchar* aSignalName, -+ GVariant* aParameters, -+ gpointer aUserData); -+ static void DBusConnectClientResponse(GObject* aObject, GAsyncResult* aResult, -+ gpointer aUserData); -+ -+ void LaunchApp(const char* aCommand, const char** aURIList, int aURIListLen); -+ -+ void HandleFreedesktopActivate(GVariant* aParameters, -+ GDBusMethodInvocation* aReply); -+ void HandleFreedesktopOpen(GVariant* aParameters, -+ GDBusMethodInvocation* aReply); -+ void HandleFreedesktopActivateAction(GVariant* aParameters, -+ GDBusMethodInvocation* aReply); -+ -+ bool StartFreedesktopListener(); -+ void StopFreedesktopListener(); -+ -+ void OnBusAcquired(GDBusConnection* aConnection); -+ void OnNameAcquired(GDBusConnection* aConnection); -+ void OnNameLost(GDBusConnection* aConnection); -+ -+ private: -+ virtual ~DBusService(); -+ -+ // The connection is owned by DBus library -+ uint mDBusID = 0; -+ uint mRegistrationId = 0; -+ GDBusConnection* mConnection = nullptr; -+ RefPtr mIntrospectionData; -+ const char* mAppFile = nullptr; -+}; -+ -+#endif // DBusService_h__ -diff -up firefox-126.0/toolkit/xre/moz.build.D209910 firefox-126.0/toolkit/xre/moz.build ---- firefox-126.0/toolkit/xre/moz.build.D209910 2024-05-06 22:50:25.000000000 +0200 -+++ firefox-126.0/toolkit/xre/moz.build 2024-05-09 12:20:44.081565311 +0200 -@@ -99,6 +99,10 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gt - UNIFIED_SOURCES += [ - "nsNativeAppSupportUnix.cpp", +diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build +--- a/widget/gtk/moz.build ++++ b/widget/gtk/moz.build +@@ -172,9 +172,10 @@ + "AsyncDBus.h", ] -+ if CONFIG["MOZ_ENABLE_DBUS"]: -+ UNIFIED_SOURCES += [ -+ "DBusService.cpp", -+ ] - CXXFLAGS += CONFIG["MOZ_X11_SM_CFLAGS"] - else: UNIFIED_SOURCES += [ + "AsyncDBus.cpp", + "DBusMenu.cpp", ++ "DBusService.cpp", + ] + CXXFLAGS += CONFIG["MOZ_DBUS_CFLAGS"] + + CXXFLAGS += ["-Werror=switch"] + diff --git a/D209911.diff b/D209911.1715685535.diff similarity index 64% rename from D209911.diff rename to D209911.1715685535.diff index 397cf43..67bb1f9 100644 --- a/D209911.diff +++ b/D209911.1715685535.diff @@ -1,19 +1,9 @@ -changeset: 743537:1bf2a3b85d0a -tag: tip -parent: 743535:29f24b1fbada -user: stransky -date: Thu May 09 10:38:21 2024 +0200 -files: toolkit/xre/nsAppRunner.cpp -description: -Bug 1894912 [Linux] Launch DBusService on --dbus-service param r?emilio - -Differential Revision: https://phabricator.services.mozilla.com/D209911 - - diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp -@@ -267,6 +267,9 @@ +@@ -265,10 +265,13 @@ + #endif + #ifdef MOZ_WIDGET_GTK # include "nsAppShell.h" #endif @@ -23,7 +13,11 @@ diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp extern uint32_t gRestartMode; extern void InstallSignalHandlers(const char* ProgramName); -@@ -2134,6 +2137,10 @@ static void DumpHelp() { + + #define FILE_COMPATIBILITY_INFO "compatibility.ini"_ns +@@ -2132,10 +2135,14 @@ + + #if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) || defined(XP_MACOSX) printf(" --headless Run without a GUI.\n"); #endif @@ -34,16 +28,21 @@ diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp // this works, but only after the components have registered. so if you drop // in a new command line handler, --help won't not until the second run. out // of the bug, because we ship a component.reg file, it works correctly. -@@ -4372,6 +4379,16 @@ int XREMain::XRE_mainInit(bool* aExitFla + DumpArbitraryHelp(); + } +@@ -4370,10 +4377,21 @@ + DumpFullVersion(); + *aExitFlag = true; return 0; } +#ifdef MOZ_ENABLE_DBUS + if (CheckArg("dbus-service")) { -+ DBusService* dbusService = new DBusService(gArgv[0]); ++ UniquePtr dbusService = MakeUnique(gArgv[0]); + if (dbusService->Init()) { + dbusService->Run(); + } ++ *aExitFlag = true; + return 1; + } +#endif @@ -51,4 +50,6 @@ diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp rv = XRE_InitCommandLine(gArgc, gArgv); NS_ENSURE_SUCCESS(rv, 1); + return 0; + } diff --git a/D210158.1715685536.diff b/D210158.1715685536.diff new file mode 100644 index 0000000..0d764ec --- /dev/null +++ b/D210158.1715685536.diff @@ -0,0 +1,58 @@ +diff --git a/widget/gtk/DBusService.cpp b/widget/gtk/DBusService.cpp +--- a/widget/gtk/DBusService.cpp ++++ b/widget/gtk/DBusService.cpp +@@ -83,42 +83,27 @@ + "\n" + "\n"; + + bool DBusService::LaunchApp(const char* aCommand, const char** aURIList, + int aURIListLen) { +- // Allocate space for all uris, executable name, command if supplied and +- // null terminator +- int paramsNum = aURIListLen + 2; ++ nsAutoCString param(mAppFile); + if (aCommand) { +- paramsNum++; +- } +- +- char** argv = (char**)moz_xmalloc(sizeof(char*) * paramsNum); +- int argc = 0; +- argv[argc++] = strdup(mAppFile); +- if (aCommand) { +- argv[argc++] = strdup(aCommand); ++ param.Append(" "); ++ param.Append(aCommand); + } + for (int i = 0; aURIList && i < aURIListLen; i++) { +- argv[argc++] = strdup(aURIList[i]); +- } +- argv[argc++] = nullptr; +- +- nsAutoCString exePath; +- nsCOMPtr lf; +- bool ret = false; +- if (NS_SUCCEEDED(XRE_GetBinaryPath(getter_AddRefs(lf)))) { +- if (NS_SUCCEEDED(lf->GetNativePath(exePath))) { +- ret = (PR_CreateProcessDetached(exePath.get(), argv, nullptr, nullptr) != +- PR_FAILURE); +- } ++ param.Append(" "); ++ param.Append(aURIList[i]); + } + +- for (int i = 0; i < argc; i++) { +- free(argv[i]); ++ char* argv[] = {strdup("/bin/sh"), strdup("-c"), strdup(param.get()), ++ nullptr}; ++ int ret = ++ PR_CreateProcessDetached("/bin/sh", argv, nullptr, nullptr) != PR_FAILURE; ++ for (auto str : argv) { ++ free(str); + } +- free(argv); + return ret; + } + + // The Activate method is called when the application is started without + // files to open. + diff --git a/D210159.1715685538.diff b/D210159.1715685538.diff new file mode 100644 index 0000000..c0f8552 --- /dev/null +++ b/D210159.1715685538.diff @@ -0,0 +1,49 @@ +diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp +--- a/toolkit/xre/nsAppRunner.cpp ++++ b/toolkit/xre/nsAppRunner.cpp +@@ -2136,11 +2136,15 @@ + #if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) || defined(XP_MACOSX) + printf(" --headless Run without a GUI.\n"); + #endif + + #if defined(MOZ_ENABLE_DBUS) +- printf(" --dbus-service Run as DBus service.\n"); ++ printf( ++ " --dbus-service Run as DBus service for " ++ "org.freedesktop.Application and\n" ++ " set a launcher (usually /usr/bin/appname " ++ "script) for it."); + #endif + + // this works, but only after the components have registered. so if you drop + // in a new command line handler, --help won't not until the second run. out + // of the bug, because we ship a component.reg file, it works correctly. +@@ -4378,17 +4382,24 @@ + *aExitFlag = true; + return 0; + } + + #ifdef MOZ_ENABLE_DBUS +- if (CheckArg("dbus-service")) { +- UniquePtr dbusService = MakeUnique(gArgv[0]); ++ const char* dbusServiceLauncher = nullptr; ++ ar = CheckArg("dbus-service", &dbusServiceLauncher, CheckArgFlag::None); ++ if (ar == ARG_BAD) { ++ Output(true, "Missing launcher param for --dbus-service\n"); ++ return 1; ++ } ++ if (ar == ARG_FOUND) { ++ UniquePtr dbusService = ++ MakeUnique(dbusServiceLauncher); + if (dbusService->Init()) { + dbusService->Run(); + } + *aExitFlag = true; +- return 1; ++ return 0; + } + #endif + + rv = XRE_InitCommandLine(gArgc, gArgv); + NS_ENSURE_SUCCESS(rv, 1); + diff --git a/firefox.spec b/firefox.spec index afecfeb..15cd9e1 100644 --- a/firefox.spec +++ b/firefox.spec @@ -189,7 +189,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 126.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -275,11 +275,14 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch -Patch408: D209910.diff -Patch409: D209911.diff # https://webrtc-review.googlesource.com/c/src/+/349881 Patch410: libwebrtc-video-capture-pipewire-drop-corrupted-buffers.patch +Patch420: D209910.1715685533.diff +Patch421: D209911.1715685535.diff +Patch422: D210158.1715685536.diff +Patch423: D210159.1715685538.diff + # PGO/LTO patches Patch600: pgo.patch Patch602: mozilla-1516803.patch @@ -594,10 +597,13 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch402 -p1 -b .1196777 %patch407 -p1 -b .1667096 -%patch408 -p1 -b .D209910 -%patch409 -p1 -b .D209911 %patch410 -p1 -b .libwebrtc-video-capture-pipewire-drop-corrupted-buffers +%patch420 -p1 -b .D209910.1715685533 +%patch421 -p1 -b .D209911.1715685535 +%patch422 -p1 -b .D210158.1715685536 +%patch423 -p1 -b .D210159.1715685538 + # PGO patches %if %{build_with_pgo} %if !%{build_with_clang} @@ -1231,6 +1237,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon May 13 2024 Martin Stransky - 126.0-3 +- More upstream patches for Gnome search provider. + * Fri May 10 2024 Martin Stransky - 126.0-2 - Fix Gnome search provider for Fedora 40+ diff --git a/org.mozilla.firefox.service b/org.mozilla.firefox.service index fa5f856..1442ca4 100644 --- a/org.mozilla.firefox.service +++ b/org.mozilla.firefox.service @@ -1,3 +1,3 @@ [D-BUS Service] Name=org.mozilla.firefox -Exec=/usr/lib64/firefox/firefox --dbus-service +Exec=/usr/lib64/firefox/firefox --dbus-service /usr/bin/firefox From ae36299595b19c3d72c9ffb4e73410d3c7d37e2a Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 13 May 2024 14:58:22 +0200 Subject: [PATCH 347/545] Fixed launch script --- firefox.sh.in | 1 + 1 file changed, 1 insertion(+) diff --git a/firefox.sh.in b/firefox.sh.in index 286f1aa..82825d4 100644 --- a/firefox.sh.in +++ b/firefox.sh.in @@ -279,6 +279,7 @@ if [ -z "$MOZ_APP_REMOTINGNAME" ] then export MOZ_APP_REMOTINGNAME=__APP_NAME__ fi +export MOZ_DBUS_APP_NAME=firefox # Flatpak specific environment variables %FLATPAK_ENV_VARS% From d585e605def4623aa49ec61fa8f04f02d3c74233 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 13 May 2024 20:40:27 +0200 Subject: [PATCH 348/545] Rebuild --- firefox.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 15cd9e1..01bd57a 100644 --- a/firefox.spec +++ b/firefox.spec @@ -189,7 +189,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 126.0 -Release: 3%{?pre_tag}%{?dist} +Release: 4%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1237,6 +1237,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon May 13 2024 Martin Stransky - 126.0-4 +- Rebuild + * Mon May 13 2024 Martin Stransky - 126.0-3 - More upstream patches for Gnome search provider. From ebf9521d9c53dd962da5e8d6c1cac1401db94a48 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 14 May 2024 11:29:26 +0200 Subject: [PATCH 349/545] Update upstream patches --- D210158.1715685536.diff | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/D210158.1715685536.diff b/D210158.1715685536.diff index 0d764ec..4228f3a 100644 --- a/D210158.1715685536.diff +++ b/D210158.1715685536.diff @@ -1,9 +1,7 @@ -diff --git a/widget/gtk/DBusService.cpp b/widget/gtk/DBusService.cpp ---- a/widget/gtk/DBusService.cpp -+++ b/widget/gtk/DBusService.cpp -@@ -83,42 +83,27 @@ - "\n" - "\n"; +diff -up firefox-126.0/widget/gtk/DBusService.cpp.D210158.1715685536 firefox-126.0/widget/gtk/DBusService.cpp +--- firefox-126.0/widget/gtk/DBusService.cpp.D210158.1715685536 2024-05-14 11:19:02.098199593 +0200 ++++ firefox-126.0/widget/gtk/DBusService.cpp 2024-05-14 11:24:44.236939835 +0200 +@@ -85,38 +85,24 @@ static const char* kIntrospectTemplate = bool DBusService::LaunchApp(const char* aCommand, const char** aURIList, int aURIListLen) { @@ -37,7 +35,8 @@ diff --git a/widget/gtk/DBusService.cpp b/widget/gtk/DBusService.cpp - PR_FAILURE); - } + param.Append(" "); -+ param.Append(aURIList[i]); ++ GUniquePtr escUri(g_shell_quote(aURIList[i])); ++ param.Append(escUri.get()); } - for (int i = 0; i < argc; i++) { @@ -53,6 +52,3 @@ diff --git a/widget/gtk/DBusService.cpp b/widget/gtk/DBusService.cpp return ret; } - // The Activate method is called when the application is started without - // files to open. - From 7d1a9652e5a386ba1ff46834f785c3ceb908200e Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 14 May 2024 11:31:37 +0200 Subject: [PATCH 350/545] Release up, added changelog entry --- firefox.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 01bd57a..ee22163 100644 --- a/firefox.spec +++ b/firefox.spec @@ -189,7 +189,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 126.0 -Release: 4%{?pre_tag}%{?dist} +Release: 5%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1237,6 +1237,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue May 14 2024 Martin Stransky - 126.0-5 +- Updated upstream patches + * Mon May 13 2024 Martin Stransky - 126.0-4 - Rebuild From 4fa72a11636af802f282038efbbd31ba442da4cf Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 15 May 2024 10:46:18 +0200 Subject: [PATCH 351/545] Added fix for mzbz#1896846 --- D210430.1715848796.diff | 121 ++++++++++++++++++++++++++++++++++++++++ firefox.spec | 7 ++- 2 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 D210430.1715848796.diff diff --git a/D210430.1715848796.diff b/D210430.1715848796.diff new file mode 100644 index 0000000..18e3d4e --- /dev/null +++ b/D210430.1715848796.diff @@ -0,0 +1,121 @@ +diff --git a/toolkit/components/remote/nsDBusRemoteClient.h b/toolkit/components/remote/nsDBusRemoteClient.h +--- a/toolkit/components/remote/nsDBusRemoteClient.h ++++ b/toolkit/components/remote/nsDBusRemoteClient.h +@@ -29,10 +29,10 @@ + void Shutdown(); + + private: + bool GetRemoteDestinationName(const char* aProgram, const char* aProfile, + nsCString& aDestinationName); +- nsresult DoSendDBusCommandLine(const char* aProgram, const char* aProfile, +- const char* aBuffer, int aLength); ++ nsresult DoSendDBusCommandLine(const char* aProfile, const char* aBuffer, ++ int aLength); + }; + + #endif // DBusRemoteClient_h__ +diff --git a/toolkit/components/remote/nsDBusRemoteClient.cpp b/toolkit/components/remote/nsDBusRemoteClient.cpp +--- a/toolkit/components/remote/nsDBusRemoteClient.cpp ++++ b/toolkit/components/remote/nsDBusRemoteClient.cpp +@@ -6,10 +6,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 "nsDBusRemoteClient.h" + #include "RemoteUtils.h" ++#include "nsAppRunner.h" + #include "mozilla/XREAppData.h" + #include "mozilla/Logging.h" + #include "mozilla/Base64.h" + #include "nsPrintfCString.h" + #include "mozilla/GUniquePtr.h" +@@ -36,11 +37,11 @@ + } + + nsresult nsDBusRemoteClient::SendCommandLine( + const char* aProgram, const char* aProfile, int32_t argc, char** argv, + const char* aStartupToken, char** aResponse, bool* aWindowFound) { +- NS_ENSURE_TRUE(aProgram, NS_ERROR_INVALID_ARG); ++ NS_ENSURE_TRUE(aProfile, NS_ERROR_INVALID_ARG); + + LOG("nsDBusRemoteClient::SendCommandLine"); + + int commandLineLength; + char* commandLine = +@@ -48,12 +49,11 @@ + if (!commandLine) { + LOG(" failed to create command line"); + return NS_ERROR_FAILURE; + } + +- nsresult rv = +- DoSendDBusCommandLine(aProgram, aProfile, commandLine, commandLineLength); ++ nsresult rv = DoSendDBusCommandLine(aProfile, commandLine, commandLineLength); + free(commandLine); + + *aWindowFound = NS_SUCCEEDED(rv); + + LOG("DoSendDBusCommandLine %s", NS_SUCCEEDED(rv) ? "OK" : "FAILED"); +@@ -97,18 +97,17 @@ + } + + return true; + } + +-nsresult nsDBusRemoteClient::DoSendDBusCommandLine(const char* aProgram, +- const char* aProfile, ++nsresult nsDBusRemoteClient::DoSendDBusCommandLine(const char* aProfile, + const char* aBuffer, + int aLength) { + LOG("nsDBusRemoteClient::DoSendDBusCommandLine()"); + +- nsAutoCString appName(aProgram); +- mozilla::XREAppData::SanitizeNameForDBus(appName); ++ nsAutoCString appName; ++ gAppData->GetDBusAppName(appName); + + nsAutoCString destinationName; + if (!GetRemoteDestinationName(appName.get(), aProfile, destinationName)) { + LOG(" failed to get remote destination name"); + return NS_ERROR_FAILURE; +diff --git a/toolkit/components/remote/nsDBusRemoteServer.cpp b/toolkit/components/remote/nsDBusRemoteServer.cpp +--- a/toolkit/components/remote/nsDBusRemoteServer.cpp ++++ b/toolkit/components/remote/nsDBusRemoteServer.cpp +@@ -6,10 +6,11 @@ + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + #include "nsDBusRemoteServer.h" + + #include "nsCOMPtr.h" ++#include "nsAppRunner.h" + #include "mozilla/XREAppData.h" + #include "mozilla/Base64.h" + #include "mozilla/ScopeExit.h" + #include "mozilla/GUniquePtr.h" + #include "MainThreadUtils.h" +@@ -186,17 +187,18 @@ + + nsresult nsDBusRemoteServer::Startup(const char* aAppName, + const char* aProfileName) { + MOZ_DIAGNOSTIC_ASSERT(!mDBusID); + +- // Don't even try to start without any application/profile name +- if (!aAppName || aAppName[0] == '\0' || !aProfileName || +- aProfileName[0] == '\0') +- return NS_ERROR_INVALID_ARG; ++ // Don't even try to start without any profile name ++ if (!aProfileName || aProfileName[0] == '\0') return NS_ERROR_INVALID_ARG; + +- mAppName = aAppName; +- mozilla::XREAppData::SanitizeNameForDBus(mAppName); ++ // aAppName is remoting name which can be something like org.mozilla.appname ++ // or so. ++ // For DBus service we rather use general application DBus identifier ++ // which is shared by all DBus services. ++ gAppData->GetDBusAppName(mAppName); + + nsAutoCString profileName; + MOZ_TRY( + mozilla::Base64Encode(aProfileName, strlen(aProfileName), profileName)); + + diff --git a/firefox.spec b/firefox.spec index ee22163..4b76ad6 100644 --- a/firefox.spec +++ b/firefox.spec @@ -189,7 +189,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 126.0 -Release: 5%{?pre_tag}%{?dist} +Release: 6%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -282,6 +282,7 @@ Patch420: D209910.1715685533.diff Patch421: D209911.1715685535.diff Patch422: D210158.1715685536.diff Patch423: D210159.1715685538.diff +Patch424: D210430.1715848796.diff # PGO/LTO patches Patch600: pgo.patch @@ -603,6 +604,7 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch421 -p1 -b .D209911.1715685535 %patch422 -p1 -b .D210158.1715685536 %patch423 -p1 -b .D210159.1715685538 +%patch424 -p1 -b .D210430.1715848796 # PGO patches %if %{build_with_pgo} @@ -1237,6 +1239,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed May 15 2024 Martin Stransky - 126.0-6 +- Added fix for mzbz#1896846 + * Tue May 14 2024 Martin Stransky - 126.0-5 - Updated upstream patches From 7710155d798920b3aba364923529527dcc610a73 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 20 May 2024 14:10:22 +0200 Subject: [PATCH 352/545] Gnome search service tweak --- firefox.spec | 5 ++++- ...fox.service => org.mozilla.firefox.SearchProvider.service | 2 +- org.mozilla.firefox.desktop | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) rename org.mozilla.firefox.service => org.mozilla.firefox.SearchProvider.service (66%) diff --git a/firefox.spec b/firefox.spec index 4b76ad6..f501f22 100644 --- a/firefox.spec +++ b/firefox.spec @@ -189,7 +189,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 126.0 -Release: 6%{?pre_tag}%{?dist} +Release: 7%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1239,6 +1239,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon May 20 2024 Martin Stransky - 126.0-7 +- Gnome search service tweak + * Wed May 15 2024 Martin Stransky - 126.0-6 - Added fix for mzbz#1896846 diff --git a/org.mozilla.firefox.service b/org.mozilla.firefox.SearchProvider.service similarity index 66% rename from org.mozilla.firefox.service rename to org.mozilla.firefox.SearchProvider.service index 1442ca4..6b2bd1b 100644 --- a/org.mozilla.firefox.service +++ b/org.mozilla.firefox.SearchProvider.service @@ -1,3 +1,3 @@ [D-BUS Service] -Name=org.mozilla.firefox +Name=org.mozilla.firefox.SearchProvider Exec=/usr/lib64/firefox/firefox --dbus-service /usr/bin/firefox diff --git a/org.mozilla.firefox.desktop b/org.mozilla.firefox.desktop index 66c22dd..02e156d 100644 --- a/org.mozilla.firefox.desktop +++ b/org.mozilla.firefox.desktop @@ -51,7 +51,6 @@ StartupNotify=true Categories=Network;WebBrowser; Keywords=web;browser;internet; Actions=new-window;new-private-window;profile-manager-window; -DBusActivatable=true [Desktop Action new-window] Name=Open a New Window From 950f3eea1541acd7da5440adcc0d576a422197e9 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 20 May 2024 15:29:36 +0200 Subject: [PATCH 353/545] build fix --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index f501f22..5382c1c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -224,7 +224,7 @@ Source42: psummary Source43: print_failures Source44: print-error-reftest Source45: run-wayland-compositor -Source46: org.mozilla.firefox.service +Source46: org.mozilla.firefox.SearchProvider.service Source47: org.mozilla.firefox.desktop Source48: org.mozilla.firefox.appdata.xml.in Source49: wasi.patch.template From 21fb2dda8979289e5bfd080e598f08d55ed40439 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Tue, 21 May 2024 12:04:56 +0200 Subject: [PATCH 354/545] Enable crashreporter again --- firefox.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index 5382c1c..5c3244c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -60,7 +60,7 @@ ExcludeArch: i686 # https://bugzilla.redhat.com/show_bug.cgi?id=1951606 %global enable_mozilla_crashreporter 0 %ifarch x86_64 %{ix86} -%global enable_mozilla_crashreporter 0 +%global enable_mozilla_crashreporter 1 %endif %if %{build_with_asan} %global enable_mozilla_crashreporter 0 @@ -189,7 +189,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 126.0 -Release: 7%{?pre_tag}%{?dist} +Release: 8%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1239,6 +1239,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue May 21 2024 Jan Horak - 126.0-8 +- Enabled crashreporter again + * Mon May 20 2024 Martin Stransky - 126.0-7 - Gnome search service tweak From e909cb26bee439708833790bb092ea2c9dd9cef6 Mon Sep 17 00:00:00 2001 From: Software Management Team Date: Thu, 30 May 2024 12:46:46 +0200 Subject: [PATCH 355/545] Eliminate use of obsolete %patchN syntax (#2283636) --- firefox.spec | 56 ++++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/firefox.spec b/firefox.spec index 5c3244c..c2898ee 100644 --- a/firefox.spec +++ b/firefox.spec @@ -562,19 +562,19 @@ This package contains results of tests executed during build. # there is a compare of config and js/config directories and .orig suffix is # ignored during this compare. -%patch40 -p1 -b .aarch64-skia -%patch44 -p1 -b .build-arm-libopus -%patch47 -p1 -b .fedora-shebang -%patch53 -p1 -b .firefox-gcc-build -%patch54 -p1 -b .1669639 -%patch71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 -%patch78 -p1 -b .firefox-i686 -%patch79 -p1 -b .firefox-gcc-13-build +%patch -P40 -p1 -b .aarch64-skia +%patch -P44 -p1 -b .build-arm-libopus +%patch -P47 -p1 -b .fedora-shebang +%patch -P53 -p1 -b .firefox-gcc-build +%patch -P54 -p1 -b .1669639 +%patch -P71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 +%patch -P78 -p1 -b .firefox-i686 +%patch -P79 -p1 -b .firefox-gcc-13-build # We need to create the wasi.patch with the correct path to the wasm libclang_rt. %if %{with wasi_sdk} export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a; cat %{SOURCE49} | envsubst > %{_sourcedir}/wasi.patch -%patch80 -p1 -b .wasi +%patch -P80 -p1 -b .wasi %endif # Test patches @@ -583,42 +583,42 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil #%patch102 -p1 -b .firefox-tests-xpcshell-freeze # Fedora patches -%patch215 -p1 -b .addons -%patch219 -p1 -b .rhbz-1173156 +%patch -P215 -p1 -b .addons +%patch -P219 -p1 -b .rhbz-1173156 #ARM run-time patch %ifarch aarch64 -%patch226 -p1 -b .1354671 +%patch -P226 -p1 -b .1354671 %endif -%patch228 -p1 -b .disable-openh264-download -%patch229 -p1 -b .firefox-nss-addon-hack -%patch230 -p1 -b .firefox-enable-vaapi -%patch231 -p1 -b .fedora-customization +%patch -P228 -p1 -b .disable-openh264-download +%patch -P229 -p1 -b .firefox-nss-addon-hack +%patch -P230 -p1 -b .firefox-enable-vaapi +%patch -P231 -p1 -b .fedora-customization #%patch241 -p1 -b .kde-integration-toolkit #%patch242 -p1 -b .kde-integration -%patch402 -p1 -b .1196777 -%patch407 -p1 -b .1667096 -%patch410 -p1 -b .libwebrtc-video-capture-pipewire-drop-corrupted-buffers +%patch -P402 -p1 -b .1196777 +%patch -P407 -p1 -b .1667096 +%patch -P410 -p1 -b .libwebrtc-video-capture-pipewire-drop-corrupted-buffers -%patch420 -p1 -b .D209910.1715685533 -%patch421 -p1 -b .D209911.1715685535 -%patch422 -p1 -b .D210158.1715685536 -%patch423 -p1 -b .D210159.1715685538 -%patch424 -p1 -b .D210430.1715848796 +%patch -P420 -p1 -b .D209910.1715685533 +%patch -P421 -p1 -b .D209911.1715685535 +%patch -P422 -p1 -b .D210158.1715685536 +%patch -P423 -p1 -b .D210159.1715685538 +%patch -P424 -p1 -b .D210430.1715848796 # PGO patches %if %{build_with_pgo} %if !%{build_with_clang} -%patch600 -p1 -b .pgo -%patch602 -p1 -b .1516803 +%patch -P600 -p1 -b .pgo +%patch -P602 -p1 -b .1516803 %endif %endif -%patch603 -p1 -b .inline +%patch -P603 -p1 -b .inline #%patch800 -p1 -b .system-av1 #%patch801 -p1 -b .system-av1-fixup -%patch1200 -p1 -b .rustflags-commasplit +%patch -P1200 -p1 -b .rustflags-commasplit rm -f .mozconfig cp %{SOURCE10} .mozconfig From 2b5068734c7323d0f5925ef21e32a663ed8386da Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Mon, 10 Jun 2024 09:16:40 +0200 Subject: [PATCH 356/545] Update to 127.0 --- .gitignore | 2 ++ firefox.spec | 11 ++++++----- mozilla-1669639.patch | 14 -------------- sources | 8 ++------ 4 files changed, 10 insertions(+), 25 deletions(-) delete mode 100644 mozilla-1669639.patch diff --git a/.gitignore b/.gitignore index 6b4d1ad..6cbb9a6 100644 --- a/.gitignore +++ b/.gitignore @@ -639,3 +639,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-125.0.3-20240429.tar.xz /firefox-126.0.source.tar.xz /firefox-langpacks-126.0-20240507.tar.xz +/firefox-127.0.source.tar.xz +/firefox-langpacks-127.0-20240610.tar.xz diff --git a/firefox.spec b/firefox.spec index c2898ee..c15874c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -188,13 +188,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 126.0 -Release: 8%{?pre_tag}%{?dist} +Version: 127.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240507.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240610.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -244,7 +244,6 @@ Patch44: build-arm-libopus.patch Patch46: firefox-nss-version.patch Patch47: fedora-shebang-build.patch Patch53: firefox-gcc-build.patch -Patch54: mozilla-1669639.patch Patch55: firefox-testing.patch Patch61: firefox-glibc-dynstack.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch @@ -566,7 +565,6 @@ This package contains results of tests executed during build. %patch -P44 -p1 -b .build-arm-libopus %patch -P47 -p1 -b .fedora-shebang %patch -P53 -p1 -b .firefox-gcc-build -%patch -P54 -p1 -b .1669639 %patch -P71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch -P78 -p1 -b .firefox-i686 %patch -P79 -p1 -b .firefox-gcc-13-build @@ -1239,6 +1237,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Jun 10 2024 Jan Horak - 127.0-1 +- Update to 127.0 + * Tue May 21 2024 Jan Horak - 126.0-8 - Enabled crashreporter again diff --git a/mozilla-1669639.patch b/mozilla-1669639.patch deleted file mode 100644 index cd04aab..0000000 --- a/mozilla-1669639.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- firefox-81.0.1/build/mach_initialize.py.old 2020-10-06 14:16:06.212974910 +0200 -+++ firefox-81.0.1/build/mach_initialize.py 2020-10-06 14:19:03.313179557 +0200 -@@ -507,7 +507,10 @@ class ImportHook(object): - # doesn't happen or because it doesn't matter). - if not os.path.exists(module.__file__[:-1]): - if os.path.exists(module.__file__): -- os.remove(module.__file__) -+ try: -+ os.remove(module.__file__) -+ except: -+ pass - del sys.modules[module.__name__] - module = self(name, globals, locals, fromlist, level) - diff --git a/sources b/sources index 2a2db25..9a9e4b9 100644 --- a/sources +++ b/sources @@ -1,6 +1,2 @@ -SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 -SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 -SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 -SHA512 (firefox-langpacks-126.0-20240507.tar.xz) = e4fb6422fd62334ec47daac402c0e838a71c32f46c0951abf329f5c068c29fb08848a5b8090cc19b797e5b06f0f22910f3f1b582bb20620e4259a745e34bffb6 -SHA512 (firefox-126.0.source.tar.xz) = 56025b051d544ca294911a1d6a66f09945f71012131881b64313dafb579730810a4b091950c90a21d4fd3f393ba23670d8409086e1677d80d0bbbe347c303527 -SHA512 (dump_syms-vendor.tar.xz) = 58d4ac9556dcf408f04429bf6300e0eef8b554763d5dc45e0dc150465f714fb43b8a44fa20c7e92ad462d4af9b26cb63ec584b34551f536fc61b6340ad55bb8d +SHA512 (firefox-127.0.source.tar.xz) = 5a17bce357e7f445c37540115f2c131ad5a055c0cf04f20bc2eaca18f8d241a99ac76739d172b38f2ad2681633f901a0a15893801082ac5db9e20e31fc8b8291 +SHA512 (firefox-langpacks-127.0-20240610.tar.xz) = 0d99817084715bd766f46c1b7f7535f2c626b410d3e71dfb5d29b291fd6933525a698175f8dfe55ef6a2fe4f4796a432b75fa9f49d805f14e5448a834fde1182 From b8f11afb6d22f7713cc7a48cbd380d8bb7d641b4 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Mon, 10 Jun 2024 09:22:23 +0200 Subject: [PATCH 357/545] Fixed sources --- sources | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sources b/sources index 9a9e4b9..1adcd7d 100644 --- a/sources +++ b/sources @@ -1,2 +1,6 @@ +SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 +SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 +SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 +SHA512 (dump_syms-vendor.tar.xz) = 58d4ac9556dcf408f04429bf6300e0eef8b554763d5dc45e0dc150465f714fb43b8a44fa20c7e92ad462d4af9b26cb63ec584b34551f536fc61b6340ad55bb8d SHA512 (firefox-127.0.source.tar.xz) = 5a17bce357e7f445c37540115f2c131ad5a055c0cf04f20bc2eaca18f8d241a99ac76739d172b38f2ad2681633f901a0a15893801082ac5db9e20e31fc8b8291 SHA512 (firefox-langpacks-127.0-20240610.tar.xz) = 0d99817084715bd766f46c1b7f7535f2c626b410d3e71dfb5d29b291fd6933525a698175f8dfe55ef6a2fe4f4796a432b75fa9f49d805f14e5448a834fde1182 From ccaca8ccc5eca0f6e2819742df78527f1a990b76 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Mon, 10 Jun 2024 16:35:18 +0200 Subject: [PATCH 358/545] Updated nss version, fixed mozilla-1667096 patch --- firefox.spec | 2 +- mozilla-1667096.patch | 31 ++++++++++++++++--------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/firefox.spec b/firefox.spec index c15874c..09967d7 100644 --- a/firefox.spec +++ b/firefox.spec @@ -144,7 +144,7 @@ ExcludeArch: i686 %if %{?system_nss} %global nspr_version 4.32 %global nspr_build_version %{nspr_version} -%global nss_version 3.97 +%global nss_version 3.100 %global nss_build_version %{nss_version} %endif diff --git a/mozilla-1667096.patch b/mozilla-1667096.patch index 924705f..d26be4d 100644 --- a/mozilla-1667096.patch +++ b/mozilla-1667096.patch @@ -1,6 +1,6 @@ -diff -up firefox-125.0/media/ffvpx/libavcodec/codec_list.c.1667096 firefox-125.0/media/ffvpx/libavcodec/codec_list.c ---- firefox-125.0/media/ffvpx/libavcodec/codec_list.c.1667096 2024-04-08 22:17:52.000000000 +0200 -+++ firefox-125.0/media/ffvpx/libavcodec/codec_list.c 2024-04-09 10:40:58.727006437 +0200 +diff -up firefox-127.0/media/ffvpx/libavcodec/codec_list.c.1667096 firefox-127.0/media/ffvpx/libavcodec/codec_list.c +--- firefox-127.0/media/ffvpx/libavcodec/codec_list.c.1667096 2024-06-06 23:33:57.000000000 +0200 ++++ firefox-127.0/media/ffvpx/libavcodec/codec_list.c 2024-06-10 12:42:39.353913204 +0200 @@ -11,6 +11,9 @@ static const FFCodec * const codec_list[ #if CONFIG_MP3_DECODER &ff_mp3_decoder, @@ -11,10 +11,10 @@ diff -up firefox-125.0/media/ffvpx/libavcodec/codec_list.c.1667096 firefox-125.0 #if CONFIG_LIBDAV1D &ff_libdav1d_decoder, #endif -diff -up firefox-125.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-125.0/media/ffvpx/libavcodec/libfdk-aacdec.c ---- firefox-125.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 2024-04-09 10:40:58.727006437 +0200 -+++ firefox-125.0/media/ffvpx/libavcodec/libfdk-aacdec.c 2024-04-09 10:40:58.727006437 +0200 -@@ -0,0 +1,497 @@ +diff -up firefox-127.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-127.0/media/ffvpx/libavcodec/libfdk-aacdec.c +--- firefox-127.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 2024-06-10 12:42:39.354913201 +0200 ++++ firefox-127.0/media/ffvpx/libavcodec/libfdk-aacdec.c 2024-06-10 16:28:30.332367814 +0200 +@@ -0,0 +1,498 @@ +/* + * AAC decoder wrapper + * Copyright (c) 2012 Martin Storsjo @@ -39,6 +39,7 @@ diff -up firefox-125.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-12 +#include "libavutil/channel_layout.h" +#include "libavutil/common.h" +#include "libavutil/opt.h" ++#include "libavutil/mem.h" +#include "avcodec.h" +#include "codec_internal.h" +#include "decode.h" @@ -512,10 +513,10 @@ diff -up firefox-125.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-12 + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .p.wrapper_name = "libfdk", +}; -diff -up firefox-125.0/media/ffvpx/libavcodec/moz.build.1667096 firefox-125.0/media/ffvpx/libavcodec/moz.build ---- firefox-125.0/media/ffvpx/libavcodec/moz.build.1667096 2024-04-09 10:40:58.727006437 +0200 -+++ firefox-125.0/media/ffvpx/libavcodec/moz.build 2024-04-09 10:57:10.584104658 +0200 -@@ -146,6 +146,12 @@ else: +diff -up firefox-127.0/media/ffvpx/libavcodec/moz.build.1667096 firefox-127.0/media/ffvpx/libavcodec/moz.build +--- firefox-127.0/media/ffvpx/libavcodec/moz.build.1667096 2024-06-06 23:33:58.000000000 +0200 ++++ firefox-127.0/media/ffvpx/libavcodec/moz.build 2024-06-10 12:42:39.354913201 +0200 +@@ -151,6 +151,12 @@ else: CXXFLAGS += CONFIG["MOZ_LIBVPX_CFLAGS"] OS_LIBS += CONFIG["MOZ_LIBVPX_LIBS"] @@ -528,10 +529,10 @@ diff -up firefox-125.0/media/ffvpx/libavcodec/moz.build.1667096 firefox-125.0/me SYMBOLS_FILE = 'avcodec.symbols' NoVisibilityFlags() -diff -up firefox-125.0/toolkit/moz.configure.1667096 firefox-125.0/toolkit/moz.configure ---- firefox-125.0/toolkit/moz.configure.1667096 2024-04-09 10:40:58.711005876 +0200 -+++ firefox-125.0/toolkit/moz.configure 2024-04-09 10:40:58.728006472 +0200 -@@ -2395,6 +2395,15 @@ with only_when(compile_environment): +diff -up firefox-127.0/toolkit/moz.configure.1667096 firefox-127.0/toolkit/moz.configure +--- firefox-127.0/toolkit/moz.configure.1667096 2024-06-10 12:42:39.312913316 +0200 ++++ firefox-127.0/toolkit/moz.configure 2024-06-10 12:42:39.355913199 +0200 +@@ -2412,6 +2412,15 @@ with only_when(compile_environment): set_config("MOZ_SYSTEM_PNG", True, when="--with-system-png") From 74a3220fcc39ca432e642cec4c8573ca4d812246 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Fri, 14 Jun 2024 14:27:02 +0200 Subject: [PATCH 359/545] Fix duplicated camera entries with PipeWire --- firefox.spec | 8 +++- ...ebrtc-fix-pipewire-camera-duplicates.patch | 41 +++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 libwebrtc-fix-pipewire-camera-duplicates.patch diff --git a/firefox.spec b/firefox.spec index 09967d7..1e8c572 100644 --- a/firefox.spec +++ b/firefox.spec @@ -189,7 +189,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 127.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -276,6 +276,8 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch # https://webrtc-review.googlesource.com/c/src/+/349881 Patch410: libwebrtc-video-capture-pipewire-drop-corrupted-buffers.patch +# https://phabricator.services.mozilla.com/D213749 +Patch411: libwebrtc-fix-pipewire-camera-duplicates.patch Patch420: D209910.1715685533.diff Patch421: D209911.1715685535.diff @@ -597,6 +599,7 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch -P402 -p1 -b .1196777 %patch -P407 -p1 -b .1667096 %patch -P410 -p1 -b .libwebrtc-video-capture-pipewire-drop-corrupted-buffers +%patch -P411 -p1 -b .libwebrtc-fix-pipewire-camera-duplicates %patch -P420 -p1 -b .D209910.1715685533 %patch -P421 -p1 -b .D209911.1715685535 @@ -1237,6 +1240,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Jun 14 2024 Jan Grulich - 127.0-2 +- Fix duplicated camera entries with PipeWire + * Mon Jun 10 2024 Jan Horak - 127.0-1 - Update to 127.0 diff --git a/libwebrtc-fix-pipewire-camera-duplicates.patch b/libwebrtc-fix-pipewire-camera-duplicates.patch new file mode 100644 index 0000000..867ea92 --- /dev/null +++ b/libwebrtc-fix-pipewire-camera-duplicates.patch @@ -0,0 +1,41 @@ +diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc +--- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc ++++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc +@@ -352,10 +352,17 @@ + const char* type, + uint32_t version, + const spa_dict* props) { + PipeWireSession* that = static_cast(data); + ++ // Skip already added nodes to avoid duplicate camera entries ++ if (std::find_if(that->nodes_.begin(), that->nodes_.end(), ++ [id](const PipeWireNode& node) { ++ return node.id() == id; ++ }) != that->nodes_.end()) ++ return; ++ + if (type != absl::string_view(PW_TYPE_INTERFACE_Node)) + return; + + if (!spa_dict_lookup(props, PW_KEY_NODE_DESCRIPTION)) + return; +@@ -370,16 +377,14 @@ + + // static + void PipeWireSession::OnRegistryGlobalRemove(void* data, uint32_t id) { + PipeWireSession* that = static_cast(data); + +- for (auto it = that->nodes_.begin(); it != that->nodes().end(); ++it) { +- if ((*it).id() == id) { +- that->nodes_.erase(it); +- break; +- } +- } ++ auto it = std::remove_if( ++ that->nodes_.begin(), that->nodes_.end(), ++ [id](const PipeWireNode& node) { return node.id() == id; }); ++ that->nodes_.erase(it, that->nodes_.end()); + } + + void PipeWireSession::Finish(VideoCaptureOptions::Status status) { + webrtc::MutexLock lock(&callback_lock_); From fec72bef9f44cb4ccec4aed514edafaec8d125d8 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 25 Jun 2024 11:57:25 +0200 Subject: [PATCH 360/545] Update to 127.0.2 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- wasi.patch | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 6cbb9a6..f1a94d5 100644 --- a/.gitignore +++ b/.gitignore @@ -641,3 +641,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-126.0-20240507.tar.xz /firefox-127.0.source.tar.xz /firefox-langpacks-127.0-20240610.tar.xz +/firefox-langpacks-127.0.2-20240625.tar.xz +/firefox-127.0.2.source.tar.xz diff --git a/firefox.spec b/firefox.spec index 1e8c572..b7927a2 100644 --- a/firefox.spec +++ b/firefox.spec @@ -188,13 +188,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 127.0 -Release: 2%{?pre_tag}%{?dist} +Version: 127.0.2 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240610.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240625.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1240,6 +1240,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Jun 25 2024 Martin Stransky - 127.0.2-1 +- Update to 127.0.2 + * Fri Jun 14 2024 Jan Grulich - 127.0-2 - Fix duplicated camera entries with PipeWire diff --git a/sources b/sources index 1adcd7d..ae1f065 100644 --- a/sources +++ b/sources @@ -2,5 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (dump_syms-vendor.tar.xz) = 58d4ac9556dcf408f04429bf6300e0eef8b554763d5dc45e0dc150465f714fb43b8a44fa20c7e92ad462d4af9b26cb63ec584b34551f536fc61b6340ad55bb8d -SHA512 (firefox-127.0.source.tar.xz) = 5a17bce357e7f445c37540115f2c131ad5a055c0cf04f20bc2eaca18f8d241a99ac76739d172b38f2ad2681633f901a0a15893801082ac5db9e20e31fc8b8291 -SHA512 (firefox-langpacks-127.0-20240610.tar.xz) = 0d99817084715bd766f46c1b7f7535f2c626b410d3e71dfb5d29b291fd6933525a698175f8dfe55ef6a2fe4f4796a432b75fa9f49d805f14e5448a834fde1182 +SHA512 (firefox-langpacks-127.0.2-20240625.tar.xz) = 16f38bfe8a831a57a199a3c8f997bba699e716896cc45645e9c5d17cb5defd6957f8c746a6ff812db9055daf138cfc1d8f8d1972b9e663992e327626b23e7b63 +SHA512 (firefox-127.0.2.source.tar.xz) = d5a959a032309b8a42690b7f5afd5110c2e6ca7de426e1529d50f59cf065e67623ed98bf3aab39ce4d345ccfad2a273b24ce4f87c7ba7e6eccf2e9dfe3008d8b diff --git a/wasi.patch b/wasi.patch index 6be5e56..d2c9c32 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-126.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-127.0.2/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From b7cf17c51a27dbc608480e59aba271a2ec900828 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 2 Jul 2024 08:56:10 +0200 Subject: [PATCH 361/545] Allow to override MOZ_DBUS_APP_NAME --- firefox.sh.in | 11 +++++++++-- firefox.spec | 5 ++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/firefox.sh.in b/firefox.sh.in index 82825d4..c5a85fa 100644 --- a/firefox.sh.in +++ b/firefox.sh.in @@ -274,12 +274,19 @@ do esac done -# We need to link Firefox with desktop file name +# MOZ_APP_REMOTINGNAME links Firefox with desktop file name if [ -z "$MOZ_APP_REMOTINGNAME" ] then export MOZ_APP_REMOTINGNAME=__APP_NAME__ fi -export MOZ_DBUS_APP_NAME=firefox + +# MOZ_DBUS_APP_NAME sets app name for DBus services like Gnome Shell +# search provider or remote launcher +# DBus interface name (or prefix) is org.mozilla.MOZ_DBUS_APP_NAME +if [ -z "$MOZ_DBUS_APP_NAME" ] +then + export MOZ_DBUS_APP_NAME=firefox +fi # Flatpak specific environment variables %FLATPAK_ENV_VARS% diff --git a/firefox.spec b/firefox.spec index b7927a2..65a1672 100644 --- a/firefox.spec +++ b/firefox.spec @@ -189,7 +189,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 127.0.2 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1240,6 +1240,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Jul 2 2024 Martin Stransky - 127.0.2-2 +- Allow to override MOZ_DBUS_APP_NAME + * Tue Jun 25 2024 Martin Stransky - 127.0.2-1 - Update to 127.0.2 From cd5314efb389f4847072afa23518b451987c8082 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 9 Jul 2024 13:56:03 +0200 Subject: [PATCH 362/545] Updated to 128.0 --- .gitignore | 3 + build-aarch64-skia.patch | 46 ++-- firefox.sh.in | 34 +-- firefox.spec | 31 +-- ...ebrtc-fix-pipewire-camera-duplicates.patch | 41 --- ...ture-pipewire-drop-corrupted-buffers.patch | 51 ---- mozilla-1898476-sync.patch | 238 ++++++++++++++++++ pgo.patch | 90 ++++--- sources | 5 +- wasi.patch | 2 +- 10 files changed, 327 insertions(+), 214 deletions(-) delete mode 100644 libwebrtc-fix-pipewire-camera-duplicates.patch delete mode 100644 libwebrtc-video-capture-pipewire-drop-corrupted-buffers.patch create mode 100644 mozilla-1898476-sync.patch diff --git a/.gitignore b/.gitignore index f1a94d5..1031950 100644 --- a/.gitignore +++ b/.gitignore @@ -643,3 +643,6 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-127.0-20240610.tar.xz /firefox-langpacks-127.0.2-20240625.tar.xz /firefox-127.0.2.source.tar.xz +/firefox-128.0.source.tar.xz +/firefox-langpacks-128.0-20240702.tar.xz +/firefox-langpacks-128.0-20240708.tar.xz diff --git a/build-aarch64-skia.patch b/build-aarch64-skia.patch index 342836f..b3abe7a 100644 --- a/build-aarch64-skia.patch +++ b/build-aarch64-skia.patch @@ -1,25 +1,35 @@ -diff -up firefox-114.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h.aarch64-skia firefox-114.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h ---- firefox-114.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h.aarch64-skia 2023-06-02 03:15:22.000000000 +0200 -+++ firefox-114.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h 2023-06-05 10:18:46.942777997 +0200 -@@ -189,8 +189,6 @@ SI F F_from_Half(U16 half) { +diff -up firefox-128.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h.aarch64-skia firefox-128.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h +--- firefox-128.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h.aarch64-skia 2024-07-02 11:10:25.047099913 +0200 ++++ firefox-128.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h 2024-07-02 11:15:43.855410571 +0200 +@@ -151,7 +151,7 @@ SI U32 to_fixed(F f) { return (U32)cast + + + SI F F_from_Half(U16 half) { +-#if defined(USING_NEON_F16C) ++#if 0 // defined(USING_NEON_F16C) + return vcvt_f32_f16((float16x4_t)half); + #elif defined(USING_AVX512F) + return (F)_mm512_cvtph_ps((__m256i)half); +@@ -178,7 +178,7 @@ SI F F_from_Half(U16 half) { + __attribute__((no_sanitize("unsigned-integer-overflow"))) + #endif SI U16 Half_from_F(F f) { - #if defined(USING_NEON_FP16) - return bit_pun(f); --#elif defined(USING_NEON_F16C) -- return (U16)vcvt_f16_f32(f); +-#if defined(USING_NEON_F16C) ++#if 0 //defined(USING_NEON_F16C) + return (U16)vcvt_f16_f32(f); #elif defined(USING_AVX512F) return (U16)_mm512_cvtps_ph((__m512 )f, _MM_FROUND_CUR_DIRECTION ); - #elif defined(USING_AVX_F16C) -diff -up firefox-114.0/gfx/skia/skia/src/base/SkHalf.h.aarch64-skia firefox-114.0/gfx/skia/skia/src/base/SkHalf.h -diff -up firefox-114.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia firefox-114.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h ---- firefox-114.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia 2023-06-05 10:18:46.941777963 +0200 -+++ firefox-114.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h 2023-06-05 10:20:44.924843847 +0200 -@@ -1128,7 +1128,7 @@ SI F from_half(U16 h) { +diff -up firefox-128.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia firefox-128.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h +--- firefox-128.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia 2024-07-02 11:10:25.048099949 +0200 ++++ firefox-128.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h 2024-07-02 11:13:33.384783413 +0200 +@@ -1425,8 +1425,8 @@ SI F from_half(U16 h) { } SI U16 to_half(F f) { --#if defined(JUMPER_IS_NEON) && defined(SK_CPU_ARM64) \ -+#if 0 //defined(JUMPER_IS_NEON) && defined(SK_CPU_ARM64) \ - && !defined(SK_BUILD_FOR_GOOGLE3) // Temporary workaround for some Google3 builds. - return sk_bit_cast(vcvt_f16_f32(f)); +-#if defined(JUMPER_IS_NEON) && defined(SK_CPU_ARM64) +- return (U16)vcvt_f16_f32(f); ++#if 0 //defined(JUMPER_IS_NEON) && defined(SK_CPU_ARM64) ++ return (U16)vcvt_f16_f32(f); + #elif defined(JUMPER_IS_SKX) + return (U16)_mm512_cvtps_ph(f, _MM_FROUND_CUR_DIRECTION); diff --git a/firefox.sh.in b/firefox.sh.in index c5a85fa..a6b92c0 100644 --- a/firefox.sh.in +++ b/firefox.sh.in @@ -64,7 +64,6 @@ MOZ_DIST_BIN="$MOZ_LIB_DIR/firefox" MOZ_LANGPACKS_DIR="$MOZ_DIST_BIN/langpacks" MOZ_EXTENSIONS_PROFILE_DIR="$HOME/.mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" MOZ_PROGRAM="$MOZ_DIST_BIN/$MOZ_FIREFOX_FILE" -MOZ_LAUNCHER="$MOZ_DIST_BIN/run-mozilla.sh" GETENFORCE_FILE="/usr/sbin/getenforce" ## @@ -245,35 +244,6 @@ fi NSS_SSL_CBC_RANDOM_IV=${NSS_SSL_CBC_RANDOM_IV-1} export NSS_SSL_CBC_RANDOM_IV -# Prepare command line arguments -script_args="" -pass_arg_count=0 -while [ $# -gt $pass_arg_count ] -do - case "$1" in - -g | --debug) - script_args="$script_args -g" - debugging=1 - shift - ;; - -d | --debugger) - if [ $# -gt 1 ]; then - script_args="$script_args -d $2" - shift 2 - else - shift - fi - ;; - *) - # Move the unrecognized argument to the end of the list. - arg="$1" - shift - set -- "$@" "$arg" - pass_arg_count=`expr $pass_arg_count + 1` - ;; - esac -done - # MOZ_APP_REMOTINGNAME links Firefox with desktop file name if [ -z "$MOZ_APP_REMOTINGNAME" ] then @@ -298,7 +268,7 @@ export MOZ_ALLOW_DOWNGRADE=1 debugging=0 if [ $debugging = 1 ] then - echo $MOZ_LAUNCHER $script_args $MOZ_PROGRAM "$@" + echo $MOZ_PROGRAM "$@" fi -exec $MOZ_LAUNCHER $script_args $MOZ_PROGRAM "$@" +exec $MOZ_PROGRAM "$@" diff --git a/firefox.spec b/firefox.spec index 65a1672..12b6970 100644 --- a/firefox.spec +++ b/firefox.spec @@ -188,13 +188,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 127.0.2 -Release: 2%{?pre_tag}%{?dist} +Version: 128.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240625.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240708.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -242,7 +242,6 @@ Patch38: build-cacheFlush-missing.patch Patch40: build-aarch64-skia.patch Patch44: build-arm-libopus.patch Patch46: firefox-nss-version.patch -Patch47: fedora-shebang-build.patch Patch53: firefox-gcc-build.patch Patch55: firefox-testing.patch Patch61: firefox-glibc-dynstack.patch @@ -274,16 +273,12 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch -# https://webrtc-review.googlesource.com/c/src/+/349881 -Patch410: libwebrtc-video-capture-pipewire-drop-corrupted-buffers.patch -# https://phabricator.services.mozilla.com/D213749 -Patch411: libwebrtc-fix-pipewire-camera-duplicates.patch - Patch420: D209910.1715685533.diff Patch421: D209911.1715685535.diff Patch422: D210158.1715685536.diff Patch423: D210159.1715685538.diff Patch424: D210430.1715848796.diff +Patch450: mozilla-1898476-sync.patch # PGO/LTO patches Patch600: pgo.patch @@ -565,7 +560,6 @@ This package contains results of tests executed during build. %patch -P40 -p1 -b .aarch64-skia %patch -P44 -p1 -b .build-arm-libopus -%patch -P47 -p1 -b .fedora-shebang %patch -P53 -p1 -b .firefox-gcc-build %patch -P71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch -P78 -p1 -b .firefox-i686 @@ -598,14 +592,8 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch -P402 -p1 -b .1196777 %patch -P407 -p1 -b .1667096 -%patch -P410 -p1 -b .libwebrtc-video-capture-pipewire-drop-corrupted-buffers -%patch -P411 -p1 -b .libwebrtc-fix-pipewire-camera-duplicates -%patch -P420 -p1 -b .D209910.1715685533 -%patch -P421 -p1 -b .D209911.1715685535 -%patch -P422 -p1 -b .D210158.1715685536 -%patch -P423 -p1 -b .D210159.1715685538 -%patch -P424 -p1 -b .D210430.1715848796 +%patch -P450 -p1 -b mozilla-1898476-sync # PGO patches %if %{build_with_pgo} @@ -809,6 +797,8 @@ cp %{SOURCE32} %{_buildrootdir}/bin || : find ./ -path ./third_party/rust -prune -o -name config.guess -exec cp /usr/lib/rpm/config.guess {} ';' MOZ_OPT_FLAGS=$(echo "%{optflags}" | sed -e 's/-Wall//') +# Firefox is not supposed to build with exceptions globally enabled +MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | sed -e 's/-fexceptions//') #rhbz#1037063 # -Werror=format-security causes build failures when -Wno-format is explicitly given # for some sources @@ -1094,9 +1084,6 @@ cp %{SOURCE12} %{buildroot}%{mozappdir}/browser/defaults/preferences echo 'pref("widget.use-xdg-desktop-portal.file-picker", 1);' >> %{buildroot}%{mozappdir}/browser/defaults/preferences/firefox-redhat-default-prefs.js %endif -# Copy over run-mozilla.sh -cp build/unix/run-mozilla.sh %{buildroot}%{mozappdir} - # Add distribution.ini mkdir -p %{buildroot}%{mozappdir}/distribution cp %{SOURCE26} %{buildroot}%{mozappdir}/distribution @@ -1199,7 +1186,6 @@ fi %endif %endif %{mozappdir}/browser/omni.ja -%{mozappdir}/run-mozilla.sh %{mozappdir}/application.ini %{mozappdir}/pingsender %exclude %{mozappdir}/removed-files @@ -1240,6 +1226,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Jul 2 2024 Martin Stransky - 128.0-1 +- Update to 128.0 + * Tue Jul 2 2024 Martin Stransky - 127.0.2-2 - Allow to override MOZ_DBUS_APP_NAME diff --git a/libwebrtc-fix-pipewire-camera-duplicates.patch b/libwebrtc-fix-pipewire-camera-duplicates.patch deleted file mode 100644 index 867ea92..0000000 --- a/libwebrtc-fix-pipewire-camera-duplicates.patch +++ /dev/null @@ -1,41 +0,0 @@ -diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc ---- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc -+++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc -@@ -352,10 +352,17 @@ - const char* type, - uint32_t version, - const spa_dict* props) { - PipeWireSession* that = static_cast(data); - -+ // Skip already added nodes to avoid duplicate camera entries -+ if (std::find_if(that->nodes_.begin(), that->nodes_.end(), -+ [id](const PipeWireNode& node) { -+ return node.id() == id; -+ }) != that->nodes_.end()) -+ return; -+ - if (type != absl::string_view(PW_TYPE_INTERFACE_Node)) - return; - - if (!spa_dict_lookup(props, PW_KEY_NODE_DESCRIPTION)) - return; -@@ -370,16 +377,14 @@ - - // static - void PipeWireSession::OnRegistryGlobalRemove(void* data, uint32_t id) { - PipeWireSession* that = static_cast(data); - -- for (auto it = that->nodes_.begin(); it != that->nodes().end(); ++it) { -- if ((*it).id() == id) { -- that->nodes_.erase(it); -- break; -- } -- } -+ auto it = std::remove_if( -+ that->nodes_.begin(), that->nodes_.end(), -+ [id](const PipeWireNode& node) { return node.id() == id; }); -+ that->nodes_.erase(it, that->nodes_.end()); - } - - void PipeWireSession::Finish(VideoCaptureOptions::Status status) { - webrtc::MutexLock lock(&callback_lock_); diff --git a/libwebrtc-video-capture-pipewire-drop-corrupted-buffers.patch b/libwebrtc-video-capture-pipewire-drop-corrupted-buffers.patch deleted file mode 100644 index 2e91759..0000000 --- a/libwebrtc-video-capture-pipewire-drop-corrupted-buffers.patch +++ /dev/null @@ -1,51 +0,0 @@ -From b7653310766909158a4781fe9def5fb8e9414d1a Mon Sep 17 00:00:00 2001 -From: Jan Grulich -Date: Mon, 06 May 2024 11:20:27 +0200 -Subject: [PATCH] Video capture PipeWire: drop corrupted PipeWire buffers - -Use SPA_CHUNK_FLAG_CORRUPTED and SPA_META_HEADER_FLAG_CORRUPTED flags to -determine corrupted buffers or corrupted buffer data. We used to only -rely on compositors setting chunk->size, but this doesn't make sense for -dmabufs where they have to make up arbitrary values. It also looks this -is not reliable and can cause glitches as we end up processing corrupted buffers. - -Bug: webrtc:338232699 -Change-Id: Ida0c6a5e7a37e19598c6d5884726200f81b94962 ---- - -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -index 6998d65..f7feddd 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -@@ -323,6 +323,15 @@ - return; - } - -+ struct spa_meta_header* header = -+ static_cast(spa_buffer_find_meta_data( -+ buffer->buffer, SPA_META_Header, sizeof(*header))); -+ if (header && (header->flags & SPA_META_HEADER_FLAG_CORRUPTED)) { -+ RTC_LOG(LS_WARNING) << "Dropping corrupted buffer"; -+ pw_stream_queue_buffer(that->pw_stream_, buffer); -+ return; -+ } -+ - that->ProcessBuffer(buffer); - - pw_stream_queue_buffer(that->pw_stream_, buffer); -@@ -709,7 +718,14 @@ - } - } - -- if (spa_buffer->datas[0].chunk->size == 0) { -+ if (spa_buffer->datas[0].chunk->flags & SPA_CHUNK_FLAG_CORRUPTED) { -+ RTC_LOG(LS_WARNING) << "Dropping buffer with corrupted data"; -+ return; -+ } -+ -+ if (spa_buffer->datas[0].type == SPA_DATA_MemFd && -+ spa_buffer->datas[0].chunk->size == 0) { -+ RTC_LOG(LS_WARNING) << "Dropping buffer with empty data"; - return; - } - diff --git a/mozilla-1898476-sync.patch b/mozilla-1898476-sync.patch new file mode 100644 index 0000000..cc937ec --- /dev/null +++ b/mozilla-1898476-sync.patch @@ -0,0 +1,238 @@ +diff --git a/gfx/webrender_bindings/RenderCompositorEGL.cpp b/gfx/webrender_bindings/RenderCompositorEGL.cpp +--- a/gfx/webrender_bindings/RenderCompositorEGL.cpp ++++ b/gfx/webrender_bindings/RenderCompositorEGL.cpp +@@ -154,6 +154,13 @@ RenderedFrameId RenderCompositorEGL::End + } + gl()->SetDamage(bufferInvalid); + } ++ ++#ifdef MOZ_WIDGET_GTK ++ UniquePtr lock; ++ if (mWidget->AsGTK()) { ++ lock = mWidget->AsGTK()->LockSurface(); ++ } ++#endif + gl()->SwapBuffers(); + return frameId; + } +diff --git a/widget/gtk/GtkCompositorWidget.cpp b/widget/gtk/GtkCompositorWidget.cpp +--- a/widget/gtk/GtkCompositorWidget.cpp ++++ b/widget/gtk/GtkCompositorWidget.cpp +@@ -211,5 +211,11 @@ bool GtkCompositorWidget::IsPopup() { + } + #endif + ++#if defined(MOZ_WAYLAND) ++UniquePtr GtkCompositorWidget::LockSurface() { ++ return mWidget->LockSurface(); ++} ++#endif ++ + } // namespace widget + } // namespace mozilla +diff --git a/widget/gtk/GtkCompositorWidget.h b/widget/gtk/GtkCompositorWidget.h +--- a/widget/gtk/GtkCompositorWidget.h ++++ b/widget/gtk/GtkCompositorWidget.h +@@ -10,6 +10,10 @@ + #include "mozilla/DataMutex.h" + #include "mozilla/widget/CompositorWidget.h" + #include "WindowSurfaceProvider.h" ++#if defined(MOZ_WAYLAND) ++# include "mozilla/UniquePtr.h" ++# include "MozContainerSurfaceLock.h" ++#endif + + class nsIWidget; + class nsWindow; +@@ -96,6 +100,8 @@ class GtkCompositorWidget : public Compo + void NotifyClientSizeChanged(const LayoutDeviceIntSize& aClientSize) override; + GtkCompositorWidget* AsGtkCompositorWidget() override { return this; } + ++ UniquePtr LockSurface(); ++ + private: + #if defined(MOZ_WAYLAND) + void ConfigureWaylandBackend(); +diff --git a/widget/gtk/MozContainerSurfaceLock.cpp b/widget/gtk/MozContainerSurfaceLock.cpp +new file mode 100644 +--- /dev/null ++++ b/widget/gtk/MozContainerSurfaceLock.cpp +@@ -0,0 +1,27 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#include "MozContainerSurfaceLock.h" ++#include "MozContainer.h" ++#include "WidgetUtilsGtk.h" ++ ++MozContainerSurfaceLock::MozContainerSurfaceLock(MozContainer* aContainer) { ++ mContainer = aContainer; ++#ifdef MOZ_WAYLAND ++ if (GdkIsWaylandDisplay()) { ++ mSurface = moz_container_wayland_surface_lock(aContainer); ++ } ++#endif ++} ++ ++MozContainerSurfaceLock::~MozContainerSurfaceLock() { ++#ifdef MOZ_WAYLAND ++ if (GdkIsWaylandDisplay()) { ++ moz_container_wayland_surface_unlock(mContainer, &mSurface); ++ } ++#endif ++} ++ ++struct wl_surface* MozContainerSurfaceLock::GetSurface() { return mSurface; } +diff --git a/widget/gtk/MozContainerSurfaceLock.h b/widget/gtk/MozContainerSurfaceLock.h +new file mode 100644 +--- /dev/null ++++ b/widget/gtk/MozContainerSurfaceLock.h +@@ -0,0 +1,25 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#ifndef widget_gtk_MozContainerSurfaceLock_h ++#define widget_gtk_MozContainerSurfaceLock_h ++ ++struct wl_surface; ++struct _MozContainer; ++typedef struct _MozContainer MozContainer; ++ ++class MozContainerSurfaceLock { ++ public: ++ explicit MozContainerSurfaceLock(MozContainer* aContainer); ++ ~MozContainerSurfaceLock(); ++ ++ struct wl_surface* GetSurface(); ++ ++ private: ++ MozContainer* mContainer = nullptr; ++ struct wl_surface* mSurface = nullptr; ++}; ++ ++#endif // widget_gtk_MozContainerSurfaceLock_h +diff --git a/widget/gtk/MozContainerWayland.cpp b/widget/gtk/MozContainerWayland.cpp +--- a/widget/gtk/MozContainerWayland.cpp ++++ b/widget/gtk/MozContainerWayland.cpp +@@ -87,23 +87,6 @@ static void moz_container_wayland_set_op + const MutexAutoLock& aProofOfLock, MozContainer* container, + const LayoutDeviceIntRegion&); + +-// Lock mozcontainer and get wayland surface of it. You need to pair with +-// moz_container_wayland_surface_unlock() even +-// if moz_container_wayland_surface_lock() fails and returns nullptr. +-static struct wl_surface* moz_container_wayland_surface_lock( +- MozContainer* container); +-static void moz_container_wayland_surface_unlock(MozContainer* container, +- struct wl_surface** surface); +- +-MozContainerSurfaceLock::MozContainerSurfaceLock(MozContainer* aContainer) { +- mContainer = aContainer; +- mSurface = moz_container_wayland_surface_lock(aContainer); +-} +-MozContainerSurfaceLock::~MozContainerSurfaceLock() { +- moz_container_wayland_surface_unlock(mContainer, &mSurface); +-} +-struct wl_surface* MozContainerSurfaceLock::GetSurface() { return mSurface; } +- + // Invalidate gtk wl_surface to commit changes to wl_subsurface. + // wl_subsurface changes are effective when parent surface is commited. + static void moz_container_wayland_invalidate(MozContainer* container) { +diff --git a/widget/gtk/MozContainerWayland.h b/widget/gtk/MozContainerWayland.h +--- a/widget/gtk/MozContainerWayland.h ++++ b/widget/gtk/MozContainerWayland.h +@@ -13,6 +13,7 @@ + #include + #include "mozilla/Mutex.h" + #include "WindowSurface.h" ++#include "MozContainerSurfaceLock.h" + + /* + * MozContainer +@@ -61,15 +62,12 @@ struct _MozContainerClass; + typedef struct _MozContainer MozContainer; + typedef struct _MozContainerClass MozContainerClass; + +-class MozContainerSurfaceLock { +- MozContainer* mContainer; +- struct wl_surface* mSurface; +- +- public: +- explicit MozContainerSurfaceLock(MozContainer* aContainer); +- ~MozContainerSurfaceLock(); +- struct wl_surface* GetSurface(); +-}; ++// Lock mozcontainer and get wayland surface of it. You need to pair with ++// moz_container_wayland_surface_unlock() even ++// if moz_container_wayland_surface_lock() fails and returns nullptr. ++struct wl_surface* moz_container_wayland_surface_lock(MozContainer* container); ++void moz_container_wayland_surface_unlock(MozContainer* container, ++ struct wl_surface** surface); + + void moz_container_wayland_map(GtkWidget*); + gboolean moz_container_wayland_map_event(GtkWidget*, GdkEventAny*); +diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build +--- a/widget/gtk/moz.build ++++ b/widget/gtk/moz.build +@@ -33,6 +33,7 @@ if CONFIG["MOZ_ENABLE_V4L2"]: + + EXPORTS += [ + "MozContainer.h", ++ "MozContainerSurfaceLock.h", + "nsGTKToolkit.h", + "nsGtkUtils.h", + "nsImageToPixbuf.h", +@@ -71,6 +72,7 @@ UNIFIED_SOURCES += [ + "IMContextWrapper.cpp", + "InProcessGtkCompositorWidget.cpp", + "MozContainer.cpp", ++ "MozContainerSurfaceLock.cpp", + "MPRISServiceHandler.cpp", + "NativeKeyBindings.cpp", + "NativeMenuGtk.cpp", +@@ -114,6 +116,7 @@ if CONFIG["MOZ_WAYLAND"]: + "WindowSurfaceWaylandMultiBuffer.cpp", + ] + EXPORTS.mozilla.widget += [ ++ "MozContainerSurfaceLock.h", + "MozContainerWayland.h", + "nsWaylandDisplay.h", + "WaylandBuffer.h", +diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp +--- a/widget/gtk/nsWindow.cpp ++++ b/widget/gtk/nsWindow.cpp +@@ -10196,3 +10196,10 @@ void nsWindow::SetDragSource(GdkDragCont + } + } + } ++ ++UniquePtr nsWindow::LockSurface() { ++ if (mIsDestroyed) { ++ return nullptr; ++ } ++ return MakeUnique(mContainer); ++} +diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h +--- a/widget/gtk/nsWindow.h ++++ b/widget/gtk/nsWindow.h +@@ -42,6 +42,7 @@ + # include "base/thread.h" + # include "WaylandVsyncSource.h" + # include "nsClipboardWayland.h" ++# include "MozContainerSurfaceLock.h" + #endif + + #ifdef MOZ_LOGGING +@@ -421,6 +422,8 @@ class nsWindow final : public nsBaseWidg + + static nsWindow* GetFocusedWindow(); + ++ mozilla::UniquePtr LockSurface(); ++ + #ifdef MOZ_WAYLAND + // Use xdg-activation protocol to transfer focus from gFocusWindow to aWindow. + static void TransferFocusToWaylandWindow(nsWindow* aWindow); diff --git a/pgo.patch b/pgo.patch index 6499434..3d8a0b1 100644 --- a/pgo.patch +++ b/pgo.patch @@ -1,6 +1,6 @@ -diff -up firefox-123.0/build/moz.configure/lto-pgo.configure.pgo firefox-123.0/build/moz.configure/lto-pgo.configure ---- firefox-123.0/build/moz.configure/lto-pgo.configure.pgo 2024-02-22 10:53:12.608509264 +0100 -+++ firefox-123.0/build/moz.configure/lto-pgo.configure 2024-02-22 10:56:14.911881765 +0100 +diff -up firefox-128.0/build/moz.configure/lto-pgo.configure.pgo firefox-128.0/build/moz.configure/lto-pgo.configure +--- firefox-128.0/build/moz.configure/lto-pgo.configure.pgo 2024-07-02 00:34:14.000000000 +0200 ++++ firefox-128.0/build/moz.configure/lto-pgo.configure 2024-07-02 17:59:44.425650444 +0200 @@ -90,12 +90,16 @@ set_config("PGO_PROFILE_PATH", pgo_profi @depends( @@ -19,7 +19,7 @@ diff -up firefox-123.0/build/moz.configure/lto-pgo.configure.pgo firefox-123.0/b if not profile_use: return None -@@ -130,7 +134,7 @@ def pgo_flags(compiler, linker, profdata +@@ -133,7 +137,7 @@ def pgo_flags( return namespace( gen_cflags=["-fprofile-generate"], gen_ldflags=["-fprofile-generate"], @@ -28,9 +28,9 @@ diff -up firefox-123.0/build/moz.configure/lto-pgo.configure.pgo firefox-123.0/b use_ldflags=["-fprofile-use"], ) -diff -up firefox-123.0/build/pgo/profileserver.py.pgo firefox-123.0/build/pgo/profileserver.py ---- firefox-123.0/build/pgo/profileserver.py.pgo 2024-02-14 08:18:40.000000000 +0100 -+++ firefox-123.0/build/pgo/profileserver.py 2024-02-22 10:06:42.665963053 +0100 +diff -up firefox-128.0/build/pgo/profileserver.py.pgo firefox-128.0/build/pgo/profileserver.py +--- firefox-128.0/build/pgo/profileserver.py.pgo 2024-07-02 00:34:15.000000000 +0200 ++++ firefox-128.0/build/pgo/profileserver.py 2024-07-02 17:59:44.425650444 +0200 @@ -11,7 +11,7 @@ import subprocess import sys @@ -40,7 +40,7 @@ diff -up firefox-123.0/build/pgo/profileserver.py.pgo firefox-123.0/build/pgo/pr from mozfile import TemporaryDirectory from mozhttpd import MozHttpd from mozprofile import FirefoxProfile, Preferences -@@ -98,9 +98,22 @@ if __name__ == "__main__": +@@ -97,9 +97,22 @@ if __name__ == "__main__": locations = ServerLocations() locations.add_host(host="127.0.0.1", port=PORT, options="primary,privileged") @@ -66,10 +66,10 @@ diff -up firefox-123.0/build/pgo/profileserver.py.pgo firefox-123.0/build/pgo/pr with TemporaryDirectory() as profilePath: # TODO: refactor this into mozprofile -diff -up firefox-123.0/gfx/2d/moz.build.pgo firefox-123.0/gfx/2d/moz.build ---- firefox-123.0/gfx/2d/moz.build.pgo 2024-02-14 08:18:41.000000000 +0100 -+++ firefox-123.0/gfx/2d/moz.build 2024-02-22 10:06:42.665963053 +0100 -@@ -134,11 +134,11 @@ if CONFIG["INTEL_ARCHITECTURE"]: +diff -up firefox-128.0/gfx/2d/moz.build.pgo firefox-128.0/gfx/2d/moz.build +--- firefox-128.0/gfx/2d/moz.build.pgo 2024-07-02 00:34:17.000000000 +0200 ++++ firefox-128.0/gfx/2d/moz.build 2024-07-02 17:59:44.425650444 +0200 +@@ -135,11 +135,11 @@ if CONFIG["INTEL_ARCHITECTURE"]: # The file uses SSE2 intrinsics, so it needs special compile flags on some # compilers. SOURCES["BlurSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] @@ -83,44 +83,38 @@ diff -up firefox-123.0/gfx/2d/moz.build.pgo firefox-123.0/gfx/2d/moz.build SOURCES["SwizzleSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] SOURCES["SwizzleSSSE3.cpp"].flags += CONFIG["SSSE3_FLAGS"] elif CONFIG["TARGET_CPU"].startswith("mips"): -diff -up firefox-123.0/gfx/skia/generate_mozbuild.py.pgo firefox-123.0/gfx/skia/generate_mozbuild.py ---- firefox-123.0/gfx/skia/generate_mozbuild.py.pgo 2024-02-14 08:18:42.000000000 +0100 -+++ firefox-123.0/gfx/skia/generate_mozbuild.py 2024-02-22 10:06:42.665963053 +0100 -@@ -54,10 +54,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind +diff -up firefox-128.0/gfx/skia/generate_mozbuild.py.pgo firefox-128.0/gfx/skia/generate_mozbuild.py +--- firefox-128.0/gfx/skia/generate_mozbuild.py.pgo 2024-07-02 17:59:44.425650444 +0200 ++++ firefox-128.0/gfx/skia/generate_mozbuild.py 2024-07-02 18:17:40.973081400 +0200 +@@ -54,8 +54,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind if CONFIG['INTEL_ARCHITECTURE']: - SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3', '-mssse3'] - SOURCES['skia/src/opts/SkOpts_sse42.cpp'].flags += ['-Dskvx=skvx_sse42', '-msse4.2'] -- SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-Dskvx=skvx_avx', '-mavx'] -- SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma'] -+ SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-Dskvx=skvx_avx', '-mavx', '-fno-lto'] -+ SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma', '-fno-lto'] - if not CONFIG["MOZ_CODE_COVERAGE"]: -- SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-Dskvx=skvx_skx', '-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl'] -+ SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-Dskvx=skvx_skx', '-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl', '-fno-lto'] - elif CONFIG['TARGET_CPU'] == 'aarch64' and CONFIG['CC_TYPE'] in ('clang', 'gcc'): - SOURCES['skia/src/opts/SkOpts_crc32.cpp'].flags += ['-Dskvx=skvx_crc32', '-march=armv8-a+crc'] - -diff -up firefox-123.0/gfx/skia/moz.build.pgo firefox-123.0/gfx/skia/moz.build ---- firefox-123.0/gfx/skia/moz.build.pgo 2024-02-14 08:18:42.000000000 +0100 -+++ firefox-123.0/gfx/skia/moz.build 2024-02-22 10:06:42.666963088 +0100 -@@ -564,10 +564,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind + SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX'] + skia_ssse3_flags = ['-Dskvx=skvx_ssse3', '-mssse3'] +- skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx'] +- skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma'] ++ skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx', '-fno-lto'] ++ skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma', '-fno-lto'] + SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags += skia_ssse3_flags + SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags += skia_ssse3_flags + SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3'] +diff -up firefox-128.0/gfx/skia/moz.build.pgo firefox-128.0/gfx/skia/moz.build +--- firefox-128.0/gfx/skia/moz.build.pgo 2024-07-02 17:59:44.425650444 +0200 ++++ firefox-128.0/gfx/skia/moz.build 2024-07-02 18:19:21.092831537 +0200 +@@ -582,8 +582,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind if CONFIG['INTEL_ARCHITECTURE']: - SOURCES['skia/src/opts/SkOpts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3', '-mssse3'] - SOURCES['skia/src/opts/SkOpts_sse42.cpp'].flags += ['-Dskvx=skvx_sse42', '-msse4.2'] -- SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-Dskvx=skvx_avx', '-mavx'] -- SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma'] -+ SOURCES['skia/src/opts/SkOpts_avx.cpp'].flags += ['-Dskvx=skvx_avx', '-mavx', '-fno-lto'] -+ SOURCES['skia/src/opts/SkOpts_hsw.cpp'].flags += ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma', '-fno-lto'] - if not CONFIG["MOZ_CODE_COVERAGE"]: -- SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-Dskvx=skvx_skx', '-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl'] -+ SOURCES['skia/src/opts/SkOpts_skx.cpp'].flags += ['-Dskvx=skvx_skx', '-mavx512f', '-mavx512dq', '-mavx512cd', '-mavx512bw', '-mavx512vl', '-fno-lto'] - elif CONFIG['TARGET_CPU'] == 'aarch64' and CONFIG['CC_TYPE'] in ('clang', 'gcc'): - SOURCES['skia/src/opts/SkOpts_crc32.cpp'].flags += ['-Dskvx=skvx_crc32', '-march=armv8-a+crc'] - -diff -up firefox-123.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-123.0/toolkit/components/terminator/nsTerminator.cpp ---- firefox-123.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2024-02-14 08:18:56.000000000 +0100 -+++ firefox-123.0/toolkit/components/terminator/nsTerminator.cpp 2024-02-22 10:06:42.666963088 +0100 -@@ -460,6 +460,11 @@ void nsTerminator::StartWatchdog() { + SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX'] + skia_ssse3_flags = ['-Dskvx=skvx_ssse3', '-mssse3'] +- skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx'] +- skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma'] ++ skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx', '-fno-lto'] ++ skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma', '-fno-lto'] + SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags += skia_ssse3_flags + SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags += skia_ssse3_flags + SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3'] +diff -up firefox-128.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-128.0/toolkit/components/terminator/nsTerminator.cpp +--- firefox-128.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2024-07-02 00:34:32.000000000 +0200 ++++ firefox-128.0/toolkit/components/terminator/nsTerminator.cpp 2024-07-02 17:59:44.425650444 +0200 +@@ -332,6 +332,11 @@ void nsTerminator::StartWatchdog() { } #endif diff --git a/sources b/sources index ae1f065..e6c078c 100644 --- a/sources +++ b/sources @@ -2,5 +2,6 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (dump_syms-vendor.tar.xz) = 58d4ac9556dcf408f04429bf6300e0eef8b554763d5dc45e0dc150465f714fb43b8a44fa20c7e92ad462d4af9b26cb63ec584b34551f536fc61b6340ad55bb8d -SHA512 (firefox-langpacks-127.0.2-20240625.tar.xz) = 16f38bfe8a831a57a199a3c8f997bba699e716896cc45645e9c5d17cb5defd6957f8c746a6ff812db9055daf138cfc1d8f8d1972b9e663992e327626b23e7b63 -SHA512 (firefox-127.0.2.source.tar.xz) = d5a959a032309b8a42690b7f5afd5110c2e6ca7de426e1529d50f59cf065e67623ed98bf3aab39ce4d345ccfad2a273b24ce4f87c7ba7e6eccf2e9dfe3008d8b +SHA512 (firefox-langpacks-128.0-20240702.tar.xz) = 9c30d7cbd665baa9221d22a63aa21f8198c402989e82724009b10e4c456543b87fce1d9d4d0a2f311c0ddf549060d582d437f25fb40eac7aa070217d63783c33 +SHA512 (firefox-128.0.source.tar.xz) = 309c0e2a0bea5699e6daf4fa02300ad7fd118d2c02c35cb5fa97a5fcc6e250cc7aec34e50fe872b8fd516436bfcfe37ddf33c9d0f9291860388cd6f3f08ea9f1 +SHA512 (firefox-langpacks-128.0-20240708.tar.xz) = 1502d8a3c5a7dc79adbc4236685fac9d298ef98b50decc38a35c4ab7a74798642f102e5fa7315f2314af808374781dd155835d485f2224f81526d61dbcc012d6 diff --git a/wasi.patch b/wasi.patch index d2c9c32..6783282 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-127.0.2/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-128.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 93268d4de0653331f3eb8abc8288eddeda6f0e61 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 9 Jul 2024 13:58:37 +0200 Subject: [PATCH 363/545] Removed old langpack --- sources | 1 - 1 file changed, 1 deletion(-) diff --git a/sources b/sources index e6c078c..b241e0f 100644 --- a/sources +++ b/sources @@ -2,6 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (dump_syms-vendor.tar.xz) = 58d4ac9556dcf408f04429bf6300e0eef8b554763d5dc45e0dc150465f714fb43b8a44fa20c7e92ad462d4af9b26cb63ec584b34551f536fc61b6340ad55bb8d -SHA512 (firefox-langpacks-128.0-20240702.tar.xz) = 9c30d7cbd665baa9221d22a63aa21f8198c402989e82724009b10e4c456543b87fce1d9d4d0a2f311c0ddf549060d582d437f25fb40eac7aa070217d63783c33 SHA512 (firefox-128.0.source.tar.xz) = 309c0e2a0bea5699e6daf4fa02300ad7fd118d2c02c35cb5fa97a5fcc6e250cc7aec34e50fe872b8fd516436bfcfe37ddf33c9d0f9291860388cd6f3f08ea9f1 SHA512 (firefox-langpacks-128.0-20240708.tar.xz) = 1502d8a3c5a7dc79adbc4236685fac9d298ef98b50decc38a35c4ab7a74798642f102e5fa7315f2314af808374781dd155835d485f2224f81526d61dbcc012d6 From 31c4cad2a2f60467949f702c23907d99a53d0e0e Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 12 Jul 2024 11:58:06 +0200 Subject: [PATCH 364/545] Added fix for mzbz#1907511 --- firefox.spec | 7 ++++++- mozilla-1907511.patch | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 mozilla-1907511.patch diff --git a/firefox.spec b/firefox.spec index 12b6970..0e42468 100644 --- a/firefox.spec +++ b/firefox.spec @@ -189,7 +189,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 128.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -279,6 +279,7 @@ Patch422: D210158.1715685536.diff Patch423: D210159.1715685538.diff Patch424: D210430.1715848796.diff Patch450: mozilla-1898476-sync.patch +Patch451: mozilla-1907511.patch # PGO/LTO patches Patch600: pgo.patch @@ -594,6 +595,7 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch -P407 -p1 -b .1667096 %patch -P450 -p1 -b mozilla-1898476-sync +%patch -P451 -b1 -b mozilla-1907511 # PGO patches %if %{build_with_pgo} @@ -1226,6 +1228,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Jul 12 2024 Martin Stransky - 128.0-2 +- Added fix for mzbz#1907511 + * Tue Jul 2 2024 Martin Stransky - 128.0-1 - Update to 128.0 diff --git a/mozilla-1907511.patch b/mozilla-1907511.patch new file mode 100644 index 0000000..2601bd0 --- /dev/null +++ b/mozilla-1907511.patch @@ -0,0 +1,25 @@ +changeset: 751907:6bc8793df6c5 +tag: tip +parent: 751905:a52fa2f14d1d +user: stransky +date: Fri Jul 12 11:26:34 2024 +0200 +files: widget/gtk/GtkCompositorWidget.cpp +description: +Bug 1907511 [Linux/X11] Check mWindow at GtkCompositorWidget::LockSurface() r?emilio + +Differential Revision: https://phabricator.services.mozilla.com/D216380 + + +diff --git a/widget/gtk/GtkCompositorWidget.cpp b/widget/gtk/GtkCompositorWidget.cpp +--- a/widget/gtk/GtkCompositorWidget.cpp ++++ b/widget/gtk/GtkCompositorWidget.cpp +@@ -212,7 +212,7 @@ bool GtkCompositorWidget::IsPopup() { + #endif + + UniquePtr GtkCompositorWidget::LockSurface() { +- return mWidget->LockSurface(); ++ return mWidget ? mWidget->LockSurface() : nullptr; + } + + } // namespace widget + From 8fb032492e40eee60ceb57e7c79fe0830c26619e Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 12 Jul 2024 20:48:34 +0200 Subject: [PATCH 365/545] Merged mozilla-1907511.patch to mozilla-1898476-sync.patch --- firefox.spec | 2 -- mozilla-1898476-sync.patch | 2 +- mozilla-1907511.patch | 25 ------------------------- 3 files changed, 1 insertion(+), 28 deletions(-) delete mode 100644 mozilla-1907511.patch diff --git a/firefox.spec b/firefox.spec index 0e42468..d71cf42 100644 --- a/firefox.spec +++ b/firefox.spec @@ -279,7 +279,6 @@ Patch422: D210158.1715685536.diff Patch423: D210159.1715685538.diff Patch424: D210430.1715848796.diff Patch450: mozilla-1898476-sync.patch -Patch451: mozilla-1907511.patch # PGO/LTO patches Patch600: pgo.patch @@ -595,7 +594,6 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch -P407 -p1 -b .1667096 %patch -P450 -p1 -b mozilla-1898476-sync -%patch -P451 -b1 -b mozilla-1907511 # PGO patches %if %{build_with_pgo} diff --git a/mozilla-1898476-sync.patch b/mozilla-1898476-sync.patch index cc937ec..565b670 100644 --- a/mozilla-1898476-sync.patch +++ b/mozilla-1898476-sync.patch @@ -24,7 +24,7 @@ diff --git a/widget/gtk/GtkCompositorWidget.cpp b/widget/gtk/GtkCompositorWidget +#if defined(MOZ_WAYLAND) +UniquePtr GtkCompositorWidget::LockSurface() { -+ return mWidget->LockSurface(); ++ return mWidget ? mWidget->LockSurface() : nullptr; +} +#endif + diff --git a/mozilla-1907511.patch b/mozilla-1907511.patch deleted file mode 100644 index 2601bd0..0000000 --- a/mozilla-1907511.patch +++ /dev/null @@ -1,25 +0,0 @@ -changeset: 751907:6bc8793df6c5 -tag: tip -parent: 751905:a52fa2f14d1d -user: stransky -date: Fri Jul 12 11:26:34 2024 +0200 -files: widget/gtk/GtkCompositorWidget.cpp -description: -Bug 1907511 [Linux/X11] Check mWindow at GtkCompositorWidget::LockSurface() r?emilio - -Differential Revision: https://phabricator.services.mozilla.com/D216380 - - -diff --git a/widget/gtk/GtkCompositorWidget.cpp b/widget/gtk/GtkCompositorWidget.cpp ---- a/widget/gtk/GtkCompositorWidget.cpp -+++ b/widget/gtk/GtkCompositorWidget.cpp -@@ -212,7 +212,7 @@ bool GtkCompositorWidget::IsPopup() { - #endif - - UniquePtr GtkCompositorWidget::LockSurface() { -- return mWidget->LockSurface(); -+ return mWidget ? mWidget->LockSurface() : nullptr; - } - - } // namespace widget - From f6632082a98d9bc4c301839642a5031a2933abef Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 17 Jul 2024 23:10:08 +0000 Subject: [PATCH 366/545] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- firefox.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index d71cf42..2bdad1f 100644 --- a/firefox.spec +++ b/firefox.spec @@ -189,7 +189,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 128.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1226,6 +1226,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Jul 17 2024 Fedora Release Engineering - 128.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Fri Jul 12 2024 Martin Stransky - 128.0-2 - Added fix for mzbz#1907511 From 51a20c156bf24f56aa672049d5d7a14563acb1c4 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 29 Jul 2024 15:52:50 +0200 Subject: [PATCH 367/545] Update to 128.0.3 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- wasi.patch | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 1031950..ecd5239 100644 --- a/.gitignore +++ b/.gitignore @@ -646,3 +646,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-128.0.source.tar.xz /firefox-langpacks-128.0-20240702.tar.xz /firefox-langpacks-128.0-20240708.tar.xz +/firefox-128.0.3.source.tar.xz +/firefox-langpacks-128.0.3-20240729.tar.xz diff --git a/firefox.spec b/firefox.spec index 2bdad1f..7eebb16 100644 --- a/firefox.spec +++ b/firefox.spec @@ -188,13 +188,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 128.0 -Release: 3%{?pre_tag}%{?dist} +Version: 128.0.3 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240708.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240729.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1226,6 +1226,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Jul 29 2024 Martin Stransky - 128.0.3-1 +- Update to 128.0.3 + * Wed Jul 17 2024 Fedora Release Engineering - 128.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild diff --git a/sources b/sources index b241e0f..d09204f 100644 --- a/sources +++ b/sources @@ -2,5 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (dump_syms-vendor.tar.xz) = 58d4ac9556dcf408f04429bf6300e0eef8b554763d5dc45e0dc150465f714fb43b8a44fa20c7e92ad462d4af9b26cb63ec584b34551f536fc61b6340ad55bb8d -SHA512 (firefox-128.0.source.tar.xz) = 309c0e2a0bea5699e6daf4fa02300ad7fd118d2c02c35cb5fa97a5fcc6e250cc7aec34e50fe872b8fd516436bfcfe37ddf33c9d0f9291860388cd6f3f08ea9f1 -SHA512 (firefox-langpacks-128.0-20240708.tar.xz) = 1502d8a3c5a7dc79adbc4236685fac9d298ef98b50decc38a35c4ab7a74798642f102e5fa7315f2314af808374781dd155835d485f2224f81526d61dbcc012d6 +SHA512 (firefox-128.0.3.source.tar.xz) = 52a0a1a6fa653f5a621a9e16e1937760c05a5ebc81a058ecc16b2c3d29d09d418dc5129deabed86ad2f82abdb3100969478a67f48b11616dc3b3e3698a1acf51 +SHA512 (firefox-langpacks-128.0.3-20240729.tar.xz) = 2cba04cfccb3b1bbec90caf69041456e9fc90a5656bc28e7ccebd25e392e4231f886d3e2526d35791dc9145a2764e24d851b5dfc5c8d8815549245a0a8c429aa diff --git a/wasi.patch b/wasi.patch index 6783282..37b08f7 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-128.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-128.0.3/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 72a09761662f5d49235a24508d3e642353957371 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 30 Jul 2024 11:31:03 +0200 Subject: [PATCH 368/545] Update to 129.0 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- wasi.patch | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index ecd5239..5314297 100644 --- a/.gitignore +++ b/.gitignore @@ -648,3 +648,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-128.0-20240708.tar.xz /firefox-128.0.3.source.tar.xz /firefox-langpacks-128.0.3-20240729.tar.xz +/firefox-129.0.source.tar.xz +/firefox-langpacks-129.0-20240730.tar.xz diff --git a/firefox.spec b/firefox.spec index 7eebb16..1e0e401 100644 --- a/firefox.spec +++ b/firefox.spec @@ -188,13 +188,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 128.0.3 +Version: 129.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240729.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240730.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1226,6 +1226,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Jul 30 2024 Martin Stransky - 129.0-1 +- Update to 129.0 + * Mon Jul 29 2024 Martin Stransky - 128.0.3-1 - Update to 128.0.3 diff --git a/sources b/sources index d09204f..8daaaed 100644 --- a/sources +++ b/sources @@ -2,5 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (dump_syms-vendor.tar.xz) = 58d4ac9556dcf408f04429bf6300e0eef8b554763d5dc45e0dc150465f714fb43b8a44fa20c7e92ad462d4af9b26cb63ec584b34551f536fc61b6340ad55bb8d -SHA512 (firefox-128.0.3.source.tar.xz) = 52a0a1a6fa653f5a621a9e16e1937760c05a5ebc81a058ecc16b2c3d29d09d418dc5129deabed86ad2f82abdb3100969478a67f48b11616dc3b3e3698a1acf51 -SHA512 (firefox-langpacks-128.0.3-20240729.tar.xz) = 2cba04cfccb3b1bbec90caf69041456e9fc90a5656bc28e7ccebd25e392e4231f886d3e2526d35791dc9145a2764e24d851b5dfc5c8d8815549245a0a8c429aa +SHA512 (firefox-129.0.source.tar.xz) = 5138ac9b057d22d16abd3ea6c5d25f170af934da7567af238ec131acb986207635e93a3f62311e14108e383c1e1f5c7f33c7b645114aedacb1e9ce93fb991164 +SHA512 (firefox-langpacks-129.0-20240730.tar.xz) = a2b0815844f9a2ffb5abd4f40757ec4554cf5cdf8051d1314d169281f559c3bd24dca940570db347bb7870e2d1a9335dd64118968bd086485b546447dcbd3787 diff --git a/wasi.patch b/wasi.patch index 37b08f7..685cc4a 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-128.0.3/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-129.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 70d0fad2399e61d62cd45c13f7f10fa513fe321c Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 30 Jul 2024 15:34:07 +0200 Subject: [PATCH 369/545] Updated cbindgen --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 8daaaed..c2b584d 100644 --- a/sources +++ b/sources @@ -1,6 +1,6 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 -SHA512 (cbindgen-vendor.tar.xz) = 3e7eaff088db918e95f5505e5feeb06e8b7b95cc62042a6d163a708fc76baea43d21bf49cf7e02bc64fdfc61e8d7704057dbb225098de56e110783104d166c54 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (dump_syms-vendor.tar.xz) = 58d4ac9556dcf408f04429bf6300e0eef8b554763d5dc45e0dc150465f714fb43b8a44fa20c7e92ad462d4af9b26cb63ec584b34551f536fc61b6340ad55bb8d SHA512 (firefox-129.0.source.tar.xz) = 5138ac9b057d22d16abd3ea6c5d25f170af934da7567af238ec131acb986207635e93a3f62311e14108e383c1e1f5c7f33c7b645114aedacb1e9ce93fb991164 SHA512 (firefox-langpacks-129.0-20240730.tar.xz) = a2b0815844f9a2ffb5abd4f40757ec4554cf5cdf8051d1314d169281f559c3bd24dca940570db347bb7870e2d1a9335dd64118968bd086485b546447dcbd3787 +SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e From 30c6d64afbad953f6c0e3024f4d858faa0af92c0 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Wed, 31 Jul 2024 11:35:37 +0200 Subject: [PATCH 370/545] Updated dump_sys --- gen_dump_syms-vendor.sh | 2 +- sources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gen_dump_syms-vendor.sh b/gen_dump_syms-vendor.sh index f34ce8e..89136fb 100755 --- a/gen_dump_syms-vendor.sh +++ b/gen_dump_syms-vendor.sh @@ -12,7 +12,7 @@ to be used with 'cargo vendor' commmand. """ [dependencies] -dump_syms = "2.3.1" +dump_syms = "2.3.3" [[bin]] name = "dummy" diff --git a/sources b/sources index c2b584d..e944644 100644 --- a/sources +++ b/sources @@ -1,6 +1,6 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 -SHA512 (dump_syms-vendor.tar.xz) = 58d4ac9556dcf408f04429bf6300e0eef8b554763d5dc45e0dc150465f714fb43b8a44fa20c7e92ad462d4af9b26cb63ec584b34551f536fc61b6340ad55bb8d SHA512 (firefox-129.0.source.tar.xz) = 5138ac9b057d22d16abd3ea6c5d25f170af934da7567af238ec131acb986207635e93a3f62311e14108e383c1e1f5c7f33c7b645114aedacb1e9ce93fb991164 SHA512 (firefox-langpacks-129.0-20240730.tar.xz) = a2b0815844f9a2ffb5abd4f40757ec4554cf5cdf8051d1314d169281f559c3bd24dca940570db347bb7870e2d1a9335dd64118968bd086485b546447dcbd3787 SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e +SHA512 (dump_syms-vendor.tar.xz) = 52b7b38c42b38f6c478498d3632bdea597839497feca2f1a7423c23c1e8d165cdc35af03bbc0aaff71182ed29266ea8b8f271836d39bc7b2c4da6d4c31232ec1 From 8e79cd605a6f5e0ea4d4339622dae94c347bbd4d Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 2 Aug 2024 11:05:39 +0200 Subject: [PATCH 371/545] new sources --- .gitignore | 1 + sources | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 5314297..fac73f9 100644 --- a/.gitignore +++ b/.gitignore @@ -650,3 +650,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-128.0.3-20240729.tar.xz /firefox-129.0.source.tar.xz /firefox-langpacks-129.0-20240730.tar.xz +/firefox-langpacks-129.0-20240802.tar.xz diff --git a/sources b/sources index e944644..42e5b01 100644 --- a/sources +++ b/sources @@ -1,6 +1,6 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 -SHA512 (firefox-129.0.source.tar.xz) = 5138ac9b057d22d16abd3ea6c5d25f170af934da7567af238ec131acb986207635e93a3f62311e14108e383c1e1f5c7f33c7b645114aedacb1e9ce93fb991164 -SHA512 (firefox-langpacks-129.0-20240730.tar.xz) = a2b0815844f9a2ffb5abd4f40757ec4554cf5cdf8051d1314d169281f559c3bd24dca940570db347bb7870e2d1a9335dd64118968bd086485b546447dcbd3787 SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e SHA512 (dump_syms-vendor.tar.xz) = 52b7b38c42b38f6c478498d3632bdea597839497feca2f1a7423c23c1e8d165cdc35af03bbc0aaff71182ed29266ea8b8f271836d39bc7b2c4da6d4c31232ec1 +SHA512 (firefox-129.0.source.tar.xz) = e406d00dc53c66a1ee6b56e7001efcdd8b323caa3676d66d874d39a99f44ac7cebf4c60d76b5d239ebcf834a75cecabf801a74a1d08a97a66ea5e8ec6c8f7c5b +SHA512 (firefox-langpacks-129.0-20240802.tar.xz) = 5ebbe9f69ffe3550a3b538dbbcb06f7f99e445e1256c48c8ecb3f1da8595863649113d6b92edf58ac79d8d12631d5424dd9f68de4e08d782e8baa5f395d09894 From a8de0be71e81cdd715a7889374a9a2ff489c8edd Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Mon, 5 Aug 2024 15:45:52 +0200 Subject: [PATCH 372/545] Update dump_syms rust crate --- gen_dump_syms-vendor.sh | 3 ++- sources | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gen_dump_syms-vendor.sh b/gen_dump_syms-vendor.sh index 89136fb..3854ad8 100755 --- a/gen_dump_syms-vendor.sh +++ b/gen_dump_syms-vendor.sh @@ -12,7 +12,8 @@ to be used with 'cargo vendor' commmand. """ [dependencies] -dump_syms = "2.3.3" +dump_syms = "=2.3.2" +time = "0.3.36" [[bin]] name = "dummy" diff --git a/sources b/sources index 42e5b01..450e5d0 100644 --- a/sources +++ b/sources @@ -1,6 +1,6 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e -SHA512 (dump_syms-vendor.tar.xz) = 52b7b38c42b38f6c478498d3632bdea597839497feca2f1a7423c23c1e8d165cdc35af03bbc0aaff71182ed29266ea8b8f271836d39bc7b2c4da6d4c31232ec1 SHA512 (firefox-129.0.source.tar.xz) = e406d00dc53c66a1ee6b56e7001efcdd8b323caa3676d66d874d39a99f44ac7cebf4c60d76b5d239ebcf834a75cecabf801a74a1d08a97a66ea5e8ec6c8f7c5b SHA512 (firefox-langpacks-129.0-20240802.tar.xz) = 5ebbe9f69ffe3550a3b538dbbcb06f7f99e445e1256c48c8ecb3f1da8595863649113d6b92edf58ac79d8d12631d5424dd9f68de4e08d782e8baa5f395d09894 +SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a From 25615f169ee817c831a29e7e985c35680f9d3d93 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 6 Aug 2024 09:07:20 +0200 Subject: [PATCH 373/545] Updated langpacks --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 1e0e401..2aab9ca 100644 --- a/firefox.spec +++ b/firefox.spec @@ -194,7 +194,7 @@ URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240730.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240802.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz From 1b229e9131671387bd1519cab80f287f21f5a200 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 6 Aug 2024 11:29:07 +0200 Subject: [PATCH 374/545] Updated NSS version --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 2aab9ca..27a2cec 100644 --- a/firefox.spec +++ b/firefox.spec @@ -144,7 +144,7 @@ ExcludeArch: i686 %if %{?system_nss} %global nspr_version 4.32 %global nspr_build_version %{nspr_version} -%global nss_version 3.100 +%global nss_version 3.102 %global nss_build_version %{nss_version} %endif From b9b254a4f7d4ab4f5692008c110f21c5348a4163 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 14 Aug 2024 13:18:24 +0200 Subject: [PATCH 375/545] Enable PipeWire camera support for F41+ --- firefox.spec | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 27a2cec..be387ad 100644 --- a/firefox.spec +++ b/firefox.spec @@ -25,6 +25,14 @@ ExcludeArch: i686 # Disabled due to various issues now. %global use_xdg_file_portal 0 +# PipeWire camera is needed for IPU6 camera support in Fedora 41+ +# https://fedoraproject.org/wiki/Changes/IPU6_Camera_support +%if 0%{?fedora} >= 41 +%global use_pipewire_camera 1 +%else +%global use_pipewire_camera 0 +%endif + %global system_nss 1 %global system_libevent 1 %global build_with_asan 0 @@ -189,7 +197,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 129.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -1084,6 +1092,10 @@ cp %{SOURCE12} %{buildroot}%{mozappdir}/browser/defaults/preferences echo 'pref("widget.use-xdg-desktop-portal.file-picker", 1);' >> %{buildroot}%{mozappdir}/browser/defaults/preferences/firefox-redhat-default-prefs.js %endif +%if %{?use_pipewire_camera} +echo 'pref("media.webrtc.camera.allow-pipewire", 1);' >> %{buildroot}%{mozappdir}/browser/defaults/preferences/firefox-redhat-default-prefs.js +%endif + # Add distribution.ini mkdir -p %{buildroot}%{mozappdir}/distribution cp %{SOURCE26} %{buildroot}%{mozappdir}/distribution @@ -1226,6 +1238,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Aug 13 2024 Jan Grulich - 129.0-2 +- Enable PipeWire camera support for F41+ + * Tue Jul 30 2024 Martin Stransky - 129.0-1 - Update to 129.0 From ca4f6b008082024e1977baff1d732988b42bd9c4 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Thu, 15 Aug 2024 14:58:13 -0500 Subject: [PATCH 376/545] Add conditional hard dependency on mozilla-openh264, always required if openh264 is installed --- firefox.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index be387ad..dd1a053 100644 --- a/firefox.spec +++ b/firefox.spec @@ -366,7 +366,7 @@ BuildRequires: icu %endif Requires: mozilla-filesystem -Recommends: mozilla-openh264 >= 2.1.1 +Requires: (mozilla-openh264 >= 2.1.1 if openh264) %if %{with langpacks_subpkg} Recommends: firefox-langpacks = %{version}-%{release} %else @@ -1238,6 +1238,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Aug 15 2024 Michael Catanzaro - 129.0-3 +- Add conditional hard dependency on mozilla-openh264, always required if openh264 is installed + * Tue Aug 13 2024 Jan Grulich - 129.0-2 - Enable PipeWire camera support for F41+ From b541b31554c9b117ba707470d01d5fd7abc09068 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 19 Aug 2024 16:56:17 +0200 Subject: [PATCH 377/545] WebRTC backport: Filter out camera devices with no capabilities --- firefox.spec | 10 +- ...ter-out-devices-with-no-capabilities.patch | 249 ++++++++++++++++++ 2 files changed, 258 insertions(+), 1 deletion(-) create mode 100644 libwebrtc-pipewire-camera-filter-out-devices-with-no-capabilities.patch diff --git a/firefox.spec b/firefox.spec index dd1a053..3972c58 100644 --- a/firefox.spec +++ b/firefox.spec @@ -197,7 +197,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 129.0 -Release: 2%{?pre_tag}%{?dist} +Release: 4%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -288,6 +288,11 @@ Patch423: D210159.1715685538.diff Patch424: D210430.1715848796.diff Patch450: mozilla-1898476-sync.patch +# PipeWire camera upstream patches +# https://phabricator.services.mozilla.com/D219224 +# Part of Firefox 131 +Patch500: libwebrtc-pipewire-camera-filter-out-devices-with-no-capabilities.patch + # PGO/LTO patches Patch600: pgo.patch Patch602: mozilla-1516803.patch @@ -1238,6 +1243,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Aug 19 2024 Jan Grulich - 129.0-4 +- WebRTC backport: Filter out camera devices with no capabilities + * Thu Aug 15 2024 Michael Catanzaro - 129.0-3 - Add conditional hard dependency on mozilla-openh264, always required if openh264 is installed diff --git a/libwebrtc-pipewire-camera-filter-out-devices-with-no-capabilities.patch b/libwebrtc-pipewire-camera-filter-out-devices-with-no-capabilities.patch new file mode 100644 index 0000000..8ce30b5 --- /dev/null +++ b/libwebrtc-pipewire-camera-filter-out-devices-with-no-capabilities.patch @@ -0,0 +1,249 @@ +diff --git a/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc b/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc +--- a/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc ++++ b/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc +@@ -55,50 +55,50 @@ + RTC_CHECK(pipewire_session_); + + if (deviceNumber >= NumberOfDevices()) + return -1; + +- const PipeWireNode& node = pipewire_session_->nodes().at(deviceNumber); ++ const auto& node = pipewire_session_->nodes().at(deviceNumber); + +- if (deviceNameLength <= node.display_name().length()) { ++ if (deviceNameLength <= node->display_name().length()) { + RTC_LOG(LS_INFO) << "deviceNameUTF8 buffer passed is too small"; + return -1; + } +- if (deviceUniqueIdUTF8Length <= node.unique_id().length()) { ++ if (deviceUniqueIdUTF8Length <= node->unique_id().length()) { + RTC_LOG(LS_INFO) << "deviceUniqueIdUTF8 buffer passed is too small"; + return -1; + } + if (productUniqueIdUTF8 && +- productUniqueIdUTF8Length <= node.model_id().length()) { ++ productUniqueIdUTF8Length <= node->model_id().length()) { + RTC_LOG(LS_INFO) << "productUniqueIdUTF8 buffer passed is too small"; + return -1; + } + + memset(deviceNameUTF8, 0, deviceNameLength); +- node.display_name().copy(deviceNameUTF8, deviceNameLength); ++ node->display_name().copy(deviceNameUTF8, deviceNameLength); + + memset(deviceUniqueIdUTF8, 0, deviceUniqueIdUTF8Length); +- node.unique_id().copy(deviceUniqueIdUTF8, deviceUniqueIdUTF8Length); ++ node->unique_id().copy(deviceUniqueIdUTF8, deviceUniqueIdUTF8Length); + + if (productUniqueIdUTF8) { + memset(productUniqueIdUTF8, 0, productUniqueIdUTF8Length); +- node.model_id().copy(productUniqueIdUTF8, productUniqueIdUTF8Length); ++ node->model_id().copy(productUniqueIdUTF8, productUniqueIdUTF8Length); + } + + return 0; + } + + int32_t DeviceInfoPipeWire::CreateCapabilityMap( + const char* deviceUniqueIdUTF8) { + RTC_CHECK(pipewire_session_); + + for (auto& node : pipewire_session_->nodes()) { +- if (node.unique_id().compare(deviceUniqueIdUTF8) != 0) ++ if (node->unique_id().compare(deviceUniqueIdUTF8) != 0) + continue; + +- _captureCapabilities = node.capabilities(); +- _lastUsedDeviceNameLength = node.unique_id().length(); ++ _captureCapabilities = node->capabilities(); ++ _lastUsedDeviceNameLength = node->unique_id().length(); + _lastUsedDeviceName = static_cast( + realloc(_lastUsedDeviceName, _lastUsedDeviceNameLength + 1)); + memcpy(_lastUsedDeviceName, deviceUniqueIdUTF8, + _lastUsedDeviceNameLength + 1); + return _captureCapabilities.size(); +diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h +--- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h ++++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h +@@ -35,21 +35,31 @@ + // PipeWireNode objects are the local representation of PipeWire node objects. + // The portal API ensured that only camera nodes are visible to the client. + // So they all represent one camera that is available via PipeWire. + class PipeWireNode { + public: +- PipeWireNode(PipeWireSession* session, uint32_t id, const spa_dict* props); +- ~PipeWireNode(); ++ struct PipeWireNodeDeleter { ++ void operator()(PipeWireNode* node) const noexcept; ++ }; ++ ++ using PipeWireNodePtr = ++ std::unique_ptr; ++ static PipeWireNodePtr Create(PipeWireSession* session, ++ uint32_t id, ++ const spa_dict* props); + + uint32_t id() const { return id_; } + std::string display_name() const { return display_name_; } + std::string unique_id() const { return unique_id_; } + std::string model_id() const { return model_id_; } + std::vector capabilities() const { + return capabilities_; + } + ++ protected: ++ PipeWireNode(PipeWireSession* session, uint32_t id, const spa_dict* props); ++ + private: + static void OnNodeInfo(void* data, const pw_node_info* info); + static void OnNodeParam(void* data, + int seq, + uint32_t id, +@@ -85,12 +95,13 @@ + PipeWireSession(); + ~PipeWireSession(); + + void Init(VideoCaptureOptions::Callback* callback, + int fd = kInvalidPipeWireFd); +- +- const std::deque& nodes() const { return nodes_; } ++ const std::deque& nodes() const { ++ return nodes_; ++ } + + friend class CameraPortalNotifier; + friend class PipeWireNode; + friend class VideoCaptureModulePipeWire; + +@@ -132,11 +143,11 @@ + struct pw_registry* pw_registry_ = nullptr; + struct spa_hook registry_listener_; + + int sync_seq_ = 0; + +- std::deque nodes_; ++ std::deque nodes_; + std::unique_ptr portal_; + std::unique_ptr portal_notifier_; + }; + + } // namespace videocapturemodule +diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc +--- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc ++++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc +@@ -50,10 +50,23 @@ + default: + return VideoType::kUnknown; + } + } + ++void PipeWireNode::PipeWireNodeDeleter::operator()( ++ PipeWireNode* node) const noexcept { ++ pw_proxy_destroy(node->proxy_); ++ spa_hook_remove(&node->node_listener_); ++} ++ ++// static ++PipeWireNode::PipeWireNodePtr PipeWireNode::Create(PipeWireSession* session, ++ uint32_t id, ++ const spa_dict* props) { ++ return PipeWireNodePtr(new PipeWireNode(session, id, props)); ++} ++ + PipeWireNode::PipeWireNode(PipeWireSession* session, + uint32_t id, + const spa_dict* props) + : session_(session), + id_(id), +@@ -71,15 +84,10 @@ + }; + + pw_node_add_listener(proxy_, &node_listener_, &node_events, this); + } + +-PipeWireNode::~PipeWireNode() { +- pw_proxy_destroy(proxy_); +- spa_hook_remove(&node_listener_); +-} +- + // static + void PipeWireNode::OnNodeInfo(void* data, const pw_node_info* info) { + PipeWireNode* that = static_cast(data); + + if (info->change_mask & PW_NODE_CHANGE_MASK_PROPS) { +@@ -97,11 +105,13 @@ + char model_str[10]; + snprintf(model_str, sizeof(model_str), "%04x:%04x", vid.value(), + pid.value()); + that->model_id_ = model_str; + } +- } else if (info->change_mask & PW_NODE_CHANGE_MASK_PARAMS) { ++ } ++ ++ if (info->change_mask & PW_NODE_CHANGE_MASK_PARAMS) { + for (uint32_t i = 0; i < info->n_params; i++) { + uint32_t id = info->params[i].id; + if (id == SPA_PARAM_EnumFormat && + info->params[i].flags & SPA_PARAM_INFO_READ) { + pw_node_enum_params(that->proxy_, 0, id, 0, UINT32_MAX, nullptr); +@@ -348,10 +358,18 @@ + PipeWireSession* that = static_cast(data); + + if (id == PW_ID_CORE) { + if (seq == that->sync_seq_) { + RTC_LOG(LS_VERBOSE) << "Enumerating PipeWire camera devices complete."; ++ ++ // Remove camera devices with no capabilities ++ auto it = std::remove_if(that->nodes_.begin(), that->nodes_.end(), ++ [](const PipeWireNode::PipeWireNodePtr& node) { ++ return node->capabilities().empty(); ++ }); ++ that->nodes_.erase(it, that->nodes_.end()); ++ + that->Finish(VideoCaptureOptions::Status::SUCCESS); + } + } + } + +@@ -364,12 +382,12 @@ + const spa_dict* props) { + PipeWireSession* that = static_cast(data); + + // Skip already added nodes to avoid duplicate camera entries + if (std::find_if(that->nodes_.begin(), that->nodes_.end(), +- [id](const PipeWireNode& node) { +- return node.id() == id; ++ [id](const PipeWireNode::PipeWireNodePtr& node) { ++ return node->id() == id; + }) != that->nodes_.end()) + return; + + if (type != absl::string_view(PW_TYPE_INTERFACE_Node)) + return; +@@ -379,21 +397,22 @@ + + auto node_role = spa_dict_lookup(props, PW_KEY_MEDIA_ROLE); + if (!node_role || strcmp(node_role, "Camera")) + return; + +- that->nodes_.emplace_back(that, id, props); ++ that->nodes_.push_back(PipeWireNode::Create(that, id, props)); + that->PipeWireSync(); + } + + // static + void PipeWireSession::OnRegistryGlobalRemove(void* data, uint32_t id) { + PipeWireSession* that = static_cast(data); + +- auto it = std::remove_if( +- that->nodes_.begin(), that->nodes_.end(), +- [id](const PipeWireNode& node) { return node.id() == id; }); ++ auto it = std::remove_if(that->nodes_.begin(), that->nodes_.end(), ++ [id](const PipeWireNode::PipeWireNodePtr& node) { ++ return node->id() == id; ++ }); + that->nodes_.erase(it, that->nodes_.end()); + } + + void PipeWireSession::Finish(VideoCaptureOptions::Status status) { + webrtc::MutexLock lock(&callback_lock_); From 9fca49bffaac80352f4600b983458dcd1f0442a9 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 20 Aug 2024 20:59:33 +0200 Subject: [PATCH 378/545] Updated to 129.0.2 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 2 ++ wasi.patch | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index fac73f9..b624ff8 100644 --- a/.gitignore +++ b/.gitignore @@ -651,3 +651,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-129.0.source.tar.xz /firefox-langpacks-129.0-20240730.tar.xz /firefox-langpacks-129.0-20240802.tar.xz +/firefox-129.0.2.source.tar.xz +/firefox-langpacks-192.0.2-20240820.tar.xz diff --git a/firefox.spec b/firefox.spec index 3972c58..d549cbb 100644 --- a/firefox.spec +++ b/firefox.spec @@ -196,13 +196,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 129.0 -Release: 4%{?pre_tag}%{?dist} +Version: 129.0.2 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240802.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240820.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1243,6 +1243,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Jul 20 2024 Martin Stransky - 129.0.2-1 +- Update to 129.0.2 + * Mon Aug 19 2024 Jan Grulich - 129.0-4 - WebRTC backport: Filter out camera devices with no capabilities diff --git a/sources b/sources index 450e5d0..86b1322 100644 --- a/sources +++ b/sources @@ -4,3 +4,5 @@ SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125 SHA512 (firefox-129.0.source.tar.xz) = e406d00dc53c66a1ee6b56e7001efcdd8b323caa3676d66d874d39a99f44ac7cebf4c60d76b5d239ebcf834a75cecabf801a74a1d08a97a66ea5e8ec6c8f7c5b SHA512 (firefox-langpacks-129.0-20240802.tar.xz) = 5ebbe9f69ffe3550a3b538dbbcb06f7f99e445e1256c48c8ecb3f1da8595863649113d6b92edf58ac79d8d12631d5424dd9f68de4e08d782e8baa5f395d09894 SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a +SHA512 (firefox-129.0.2.source.tar.xz) = f6805a87e5cb4e437583916e3ec1b312dc73eec5fc06ce7a038b13bd7c6827b18cf383c30645d96623ce41675351f3023ec6b9f89d676f1c889994eae79f2c13 +SHA512 (firefox-langpacks-192.0.2-20240820.tar.xz) = 8deb5a11ba8a5c404a6bb57795b3be02e3f9eeea108bbcd968b7dcdc8f5c3726be074f50c549c21753b35970fa3802865823c144dea5b10495c3640f0bb4a3d1 diff --git a/wasi.patch b/wasi.patch index 685cc4a..226f150 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-129.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-129.0.2/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From d2d1f52e7caa746530501e1d3711889c46cb9a90 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 20 Aug 2024 21:04:38 +0200 Subject: [PATCH 379/545] Changelog fix --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index d549cbb..a812814 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1243,7 +1243,7 @@ fi #--------------------------------------------------------------------- %changelog -* Tue Jul 20 2024 Martin Stransky - 129.0.2-1 +* Tue Aug 20 2024 Martin Stransky - 129.0.2-1 - Update to 129.0.2 * Mon Aug 19 2024 Jan Grulich - 129.0-4 From e889d7b8926784b786a91482e9f1e8b90aa502d7 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 21 Aug 2024 13:12:22 +0200 Subject: [PATCH 380/545] Updated sources --- sources | 2 -- 1 file changed, 2 deletions(-) diff --git a/sources b/sources index 86b1322..2b5f6d8 100644 --- a/sources +++ b/sources @@ -1,8 +1,6 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e -SHA512 (firefox-129.0.source.tar.xz) = e406d00dc53c66a1ee6b56e7001efcdd8b323caa3676d66d874d39a99f44ac7cebf4c60d76b5d239ebcf834a75cecabf801a74a1d08a97a66ea5e8ec6c8f7c5b -SHA512 (firefox-langpacks-129.0-20240802.tar.xz) = 5ebbe9f69ffe3550a3b538dbbcb06f7f99e445e1256c48c8ecb3f1da8595863649113d6b92edf58ac79d8d12631d5424dd9f68de4e08d782e8baa5f395d09894 SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a SHA512 (firefox-129.0.2.source.tar.xz) = f6805a87e5cb4e437583916e3ec1b312dc73eec5fc06ce7a038b13bd7c6827b18cf383c30645d96623ce41675351f3023ec6b9f89d676f1c889994eae79f2c13 SHA512 (firefox-langpacks-192.0.2-20240820.tar.xz) = 8deb5a11ba8a5c404a6bb57795b3be02e3f9eeea108bbcd968b7dcdc8f5c3726be074f50c549c21753b35970fa3802865823c144dea5b10495c3640f0bb4a3d1 From a2c2654dd73accef0d1a6d3ffce953b7e8e393a6 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 21 Aug 2024 13:47:59 +0200 Subject: [PATCH 381/545] Updated sources --- .gitignore | 1 + sources | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b624ff8..94362f0 100644 --- a/.gitignore +++ b/.gitignore @@ -653,3 +653,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-129.0-20240802.tar.xz /firefox-129.0.2.source.tar.xz /firefox-langpacks-192.0.2-20240820.tar.xz +/firefox-langpacks-129.0.2-20240820.tar.xz diff --git a/sources b/sources index 2b5f6d8..fd52d8c 100644 --- a/sources +++ b/sources @@ -3,4 +3,4 @@ SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89 SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a SHA512 (firefox-129.0.2.source.tar.xz) = f6805a87e5cb4e437583916e3ec1b312dc73eec5fc06ce7a038b13bd7c6827b18cf383c30645d96623ce41675351f3023ec6b9f89d676f1c889994eae79f2c13 -SHA512 (firefox-langpacks-192.0.2-20240820.tar.xz) = 8deb5a11ba8a5c404a6bb57795b3be02e3f9eeea108bbcd968b7dcdc8f5c3726be074f50c549c21753b35970fa3802865823c144dea5b10495c3640f0bb4a3d1 +SHA512 (firefox-langpacks-129.0.2-20240820.tar.xz) = 8deb5a11ba8a5c404a6bb57795b3be02e3f9eeea108bbcd968b7dcdc8f5c3726be074f50c549c21753b35970fa3802865823c144dea5b10495c3640f0bb4a3d1 From d495cf86172ee4148ebc6973dfd485312f1695b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Wed, 28 Aug 2024 09:36:35 +0200 Subject: [PATCH 382/545] convert license to SPDX This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4 --- firefox.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index a812814..a0d5af0 100644 --- a/firefox.spec +++ b/firefox.spec @@ -197,9 +197,10 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 129.0.2 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ -License: MPLv1.1 or GPLv2+ or LGPLv2+ +# Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. +License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} Source1: firefox-langpacks-%{version}%{?pre_version}-20240820.tar.xz @@ -1243,6 +1244,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Aug 28 2024 Miroslav Suchý - 129.0.2-2 +- convert license to SPDX + * Tue Aug 20 2024 Martin Stransky - 129.0.2-1 - Update to 129.0.2 From 78eab9ed2c7315fdb884932524a6c94c35a0b762 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 28 Aug 2024 11:22:30 +0200 Subject: [PATCH 383/545] Update to 130.0 --- firefox.spec | 15 ++- mozilla-1898476-sync.patch | 238 ------------------------------------- wasi.patch | 2 +- 3 files changed, 10 insertions(+), 245 deletions(-) delete mode 100644 mozilla-1898476-sync.patch diff --git a/firefox.spec b/firefox.spec index a812814..e51741c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -196,13 +196,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 129.0.2 +Version: 130.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240820.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240828.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -286,7 +286,6 @@ Patch421: D209911.1715685535.diff Patch422: D210158.1715685536.diff Patch423: D210159.1715685538.diff Patch424: D210430.1715848796.diff -Patch450: mozilla-1898476-sync.patch # PipeWire camera upstream patches # https://phabricator.services.mozilla.com/D219224 @@ -480,6 +479,8 @@ BuildRequires: libstdc++-static %if %{with wasi_sdk} BuildRequires: clang cmake ninja-build %endif +Recommends: speech-dispatcher +Recommends: speech-dispatcher-utils Obsoletes: mozilla <= 37:1.7.13 Provides: webclient @@ -606,8 +607,6 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch -P402 -p1 -b .1196777 %patch -P407 -p1 -b .1667096 -%patch -P450 -p1 -b mozilla-1898476-sync - # PGO patches %if %{build_with_pgo} %if !%{build_with_clang} @@ -620,7 +619,8 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil #%patch800 -p1 -b .system-av1 #%patch801 -p1 -b .system-av1-fixup -%patch -P1200 -p1 -b .rustflags-commasplit +# TODO? +#%patch -P1200 -p1 -b .rustflags-commasplit rm -f .mozconfig cp %{SOURCE10} .mozconfig @@ -1243,6 +1243,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Aug 28 2024 Martin Stransky - 130.0-1 +- Update to 130.0 + * Tue Aug 20 2024 Martin Stransky - 129.0.2-1 - Update to 129.0.2 diff --git a/mozilla-1898476-sync.patch b/mozilla-1898476-sync.patch deleted file mode 100644 index 565b670..0000000 --- a/mozilla-1898476-sync.patch +++ /dev/null @@ -1,238 +0,0 @@ -diff --git a/gfx/webrender_bindings/RenderCompositorEGL.cpp b/gfx/webrender_bindings/RenderCompositorEGL.cpp ---- a/gfx/webrender_bindings/RenderCompositorEGL.cpp -+++ b/gfx/webrender_bindings/RenderCompositorEGL.cpp -@@ -154,6 +154,13 @@ RenderedFrameId RenderCompositorEGL::End - } - gl()->SetDamage(bufferInvalid); - } -+ -+#ifdef MOZ_WIDGET_GTK -+ UniquePtr lock; -+ if (mWidget->AsGTK()) { -+ lock = mWidget->AsGTK()->LockSurface(); -+ } -+#endif - gl()->SwapBuffers(); - return frameId; - } -diff --git a/widget/gtk/GtkCompositorWidget.cpp b/widget/gtk/GtkCompositorWidget.cpp ---- a/widget/gtk/GtkCompositorWidget.cpp -+++ b/widget/gtk/GtkCompositorWidget.cpp -@@ -211,5 +211,11 @@ bool GtkCompositorWidget::IsPopup() { - } - #endif - -+#if defined(MOZ_WAYLAND) -+UniquePtr GtkCompositorWidget::LockSurface() { -+ return mWidget ? mWidget->LockSurface() : nullptr; -+} -+#endif -+ - } // namespace widget - } // namespace mozilla -diff --git a/widget/gtk/GtkCompositorWidget.h b/widget/gtk/GtkCompositorWidget.h ---- a/widget/gtk/GtkCompositorWidget.h -+++ b/widget/gtk/GtkCompositorWidget.h -@@ -10,6 +10,10 @@ - #include "mozilla/DataMutex.h" - #include "mozilla/widget/CompositorWidget.h" - #include "WindowSurfaceProvider.h" -+#if defined(MOZ_WAYLAND) -+# include "mozilla/UniquePtr.h" -+# include "MozContainerSurfaceLock.h" -+#endif - - class nsIWidget; - class nsWindow; -@@ -96,6 +100,8 @@ class GtkCompositorWidget : public Compo - void NotifyClientSizeChanged(const LayoutDeviceIntSize& aClientSize) override; - GtkCompositorWidget* AsGtkCompositorWidget() override { return this; } - -+ UniquePtr LockSurface(); -+ - private: - #if defined(MOZ_WAYLAND) - void ConfigureWaylandBackend(); -diff --git a/widget/gtk/MozContainerSurfaceLock.cpp b/widget/gtk/MozContainerSurfaceLock.cpp -new file mode 100644 ---- /dev/null -+++ b/widget/gtk/MozContainerSurfaceLock.cpp -@@ -0,0 +1,27 @@ -+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+#include "MozContainerSurfaceLock.h" -+#include "MozContainer.h" -+#include "WidgetUtilsGtk.h" -+ -+MozContainerSurfaceLock::MozContainerSurfaceLock(MozContainer* aContainer) { -+ mContainer = aContainer; -+#ifdef MOZ_WAYLAND -+ if (GdkIsWaylandDisplay()) { -+ mSurface = moz_container_wayland_surface_lock(aContainer); -+ } -+#endif -+} -+ -+MozContainerSurfaceLock::~MozContainerSurfaceLock() { -+#ifdef MOZ_WAYLAND -+ if (GdkIsWaylandDisplay()) { -+ moz_container_wayland_surface_unlock(mContainer, &mSurface); -+ } -+#endif -+} -+ -+struct wl_surface* MozContainerSurfaceLock::GetSurface() { return mSurface; } -diff --git a/widget/gtk/MozContainerSurfaceLock.h b/widget/gtk/MozContainerSurfaceLock.h -new file mode 100644 ---- /dev/null -+++ b/widget/gtk/MozContainerSurfaceLock.h -@@ -0,0 +1,25 @@ -+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+#ifndef widget_gtk_MozContainerSurfaceLock_h -+#define widget_gtk_MozContainerSurfaceLock_h -+ -+struct wl_surface; -+struct _MozContainer; -+typedef struct _MozContainer MozContainer; -+ -+class MozContainerSurfaceLock { -+ public: -+ explicit MozContainerSurfaceLock(MozContainer* aContainer); -+ ~MozContainerSurfaceLock(); -+ -+ struct wl_surface* GetSurface(); -+ -+ private: -+ MozContainer* mContainer = nullptr; -+ struct wl_surface* mSurface = nullptr; -+}; -+ -+#endif // widget_gtk_MozContainerSurfaceLock_h -diff --git a/widget/gtk/MozContainerWayland.cpp b/widget/gtk/MozContainerWayland.cpp ---- a/widget/gtk/MozContainerWayland.cpp -+++ b/widget/gtk/MozContainerWayland.cpp -@@ -87,23 +87,6 @@ static void moz_container_wayland_set_op - const MutexAutoLock& aProofOfLock, MozContainer* container, - const LayoutDeviceIntRegion&); - --// Lock mozcontainer and get wayland surface of it. You need to pair with --// moz_container_wayland_surface_unlock() even --// if moz_container_wayland_surface_lock() fails and returns nullptr. --static struct wl_surface* moz_container_wayland_surface_lock( -- MozContainer* container); --static void moz_container_wayland_surface_unlock(MozContainer* container, -- struct wl_surface** surface); -- --MozContainerSurfaceLock::MozContainerSurfaceLock(MozContainer* aContainer) { -- mContainer = aContainer; -- mSurface = moz_container_wayland_surface_lock(aContainer); --} --MozContainerSurfaceLock::~MozContainerSurfaceLock() { -- moz_container_wayland_surface_unlock(mContainer, &mSurface); --} --struct wl_surface* MozContainerSurfaceLock::GetSurface() { return mSurface; } -- - // Invalidate gtk wl_surface to commit changes to wl_subsurface. - // wl_subsurface changes are effective when parent surface is commited. - static void moz_container_wayland_invalidate(MozContainer* container) { -diff --git a/widget/gtk/MozContainerWayland.h b/widget/gtk/MozContainerWayland.h ---- a/widget/gtk/MozContainerWayland.h -+++ b/widget/gtk/MozContainerWayland.h -@@ -13,6 +13,7 @@ - #include - #include "mozilla/Mutex.h" - #include "WindowSurface.h" -+#include "MozContainerSurfaceLock.h" - - /* - * MozContainer -@@ -61,15 +62,12 @@ struct _MozContainerClass; - typedef struct _MozContainer MozContainer; - typedef struct _MozContainerClass MozContainerClass; - --class MozContainerSurfaceLock { -- MozContainer* mContainer; -- struct wl_surface* mSurface; -- -- public: -- explicit MozContainerSurfaceLock(MozContainer* aContainer); -- ~MozContainerSurfaceLock(); -- struct wl_surface* GetSurface(); --}; -+// Lock mozcontainer and get wayland surface of it. You need to pair with -+// moz_container_wayland_surface_unlock() even -+// if moz_container_wayland_surface_lock() fails and returns nullptr. -+struct wl_surface* moz_container_wayland_surface_lock(MozContainer* container); -+void moz_container_wayland_surface_unlock(MozContainer* container, -+ struct wl_surface** surface); - - void moz_container_wayland_map(GtkWidget*); - gboolean moz_container_wayland_map_event(GtkWidget*, GdkEventAny*); -diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build ---- a/widget/gtk/moz.build -+++ b/widget/gtk/moz.build -@@ -33,6 +33,7 @@ if CONFIG["MOZ_ENABLE_V4L2"]: - - EXPORTS += [ - "MozContainer.h", -+ "MozContainerSurfaceLock.h", - "nsGTKToolkit.h", - "nsGtkUtils.h", - "nsImageToPixbuf.h", -@@ -71,6 +72,7 @@ UNIFIED_SOURCES += [ - "IMContextWrapper.cpp", - "InProcessGtkCompositorWidget.cpp", - "MozContainer.cpp", -+ "MozContainerSurfaceLock.cpp", - "MPRISServiceHandler.cpp", - "NativeKeyBindings.cpp", - "NativeMenuGtk.cpp", -@@ -114,6 +116,7 @@ if CONFIG["MOZ_WAYLAND"]: - "WindowSurfaceWaylandMultiBuffer.cpp", - ] - EXPORTS.mozilla.widget += [ -+ "MozContainerSurfaceLock.h", - "MozContainerWayland.h", - "nsWaylandDisplay.h", - "WaylandBuffer.h", -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp ---- a/widget/gtk/nsWindow.cpp -+++ b/widget/gtk/nsWindow.cpp -@@ -10196,3 +10196,10 @@ void nsWindow::SetDragSource(GdkDragCont - } - } - } -+ -+UniquePtr nsWindow::LockSurface() { -+ if (mIsDestroyed) { -+ return nullptr; -+ } -+ return MakeUnique(mContainer); -+} -diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h ---- a/widget/gtk/nsWindow.h -+++ b/widget/gtk/nsWindow.h -@@ -42,6 +42,7 @@ - # include "base/thread.h" - # include "WaylandVsyncSource.h" - # include "nsClipboardWayland.h" -+# include "MozContainerSurfaceLock.h" - #endif - - #ifdef MOZ_LOGGING -@@ -421,6 +422,8 @@ class nsWindow final : public nsBaseWidg - - static nsWindow* GetFocusedWindow(); - -+ mozilla::UniquePtr LockSurface(); -+ - #ifdef MOZ_WAYLAND - // Use xdg-activation protocol to transfer focus from gFocusWindow to aWindow. - static void TransferFocusToWaylandWindow(nsWindow* aWindow); diff --git a/wasi.patch b/wasi.patch index 226f150..f1d6bb4 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-129.0.2/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-130.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From bd69cace7421b4ce671eb523afa8d542a87fd0bc Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 28 Aug 2024 13:08:11 +0200 Subject: [PATCH 384/545] Updated to 130.0 --- .gitignore | 2 ++ sources | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 94362f0..5e59402 100644 --- a/.gitignore +++ b/.gitignore @@ -654,3 +654,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-129.0.2.source.tar.xz /firefox-langpacks-192.0.2-20240820.tar.xz /firefox-langpacks-129.0.2-20240820.tar.xz +/firefox-langpacks-130.0-20240828.tar.xz +/firefox-130.0.source.tar.xz diff --git a/sources b/sources index fd52d8c..3d68f15 100644 --- a/sources +++ b/sources @@ -2,5 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a -SHA512 (firefox-129.0.2.source.tar.xz) = f6805a87e5cb4e437583916e3ec1b312dc73eec5fc06ce7a038b13bd7c6827b18cf383c30645d96623ce41675351f3023ec6b9f89d676f1c889994eae79f2c13 -SHA512 (firefox-langpacks-129.0.2-20240820.tar.xz) = 8deb5a11ba8a5c404a6bb57795b3be02e3f9eeea108bbcd968b7dcdc8f5c3726be074f50c549c21753b35970fa3802865823c144dea5b10495c3640f0bb4a3d1 +SHA512 (firefox-langpacks-130.0-20240828.tar.xz) = d42679fbfa7178b924b927057316c5655b77e372d750b1038c43580f9137f9d12efc940b274d06b859791ab01f0689f36df40b96d200a4fa83a540a9ec1634a1 +SHA512 (firefox-130.0.source.tar.xz) = 79ae9695d2dbc8955002b48ee639b2463bcde16183ae151e743ddf6619b073a2c8ce45b16d8e8a29c845f10af0880f8aa5247b99cd765b8a7989e332e5293183 From cfa2ac01f55ff8f414f390a6d2b8892af6660feb Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 29 Aug 2024 12:29:31 +0200 Subject: [PATCH 385/545] Removed unused patch --- firefox-112.0-commasplit.patch | 76 ---------------------------------- firefox.spec | 9 ---- wasi.patch | 2 +- 3 files changed, 1 insertion(+), 86 deletions(-) delete mode 100644 firefox-112.0-commasplit.patch diff --git a/firefox-112.0-commasplit.patch b/firefox-112.0-commasplit.patch deleted file mode 100644 index a56aec4..0000000 --- a/firefox-112.0-commasplit.patch +++ /dev/null @@ -1,76 +0,0 @@ ---- firefox-111.0.1/build/moz.configure/rust.configure 2023-03-21 06:16:03.000000000 -0700 -+++ firefox-111.0.1/build/moz.configure/rust.configure.new 2023-04-05 08:57:29.403219120 -0700 -@@ -593,7 +593,7 @@ - - # ============================================================== - --option(env="RUSTFLAGS", nargs=1, help="Rust compiler flags") -+option(env="RUSTFLAGS", nargs=1, help="Rust compiler flags", comma_split=False) - set_config("RUSTFLAGS", depends("RUSTFLAGS")(lambda flags: flags)) - - ---- firefox-111.0.1/python/mozbuild/mozbuild/configure/options.py 2023-03-21 06:16:09.000000000 -0700 -+++ firefox-111.0.1/python/mozbuild/mozbuild/configure/options.py.new 2023-04-05 08:57:31.270193468 -0700 -@@ -191,6 +191,10 @@ - to instantiate an option indirectly. Set this to a positive integer to - force the script to look into a deeper stack frame when inferring the - `category`. -+ - `comma_split` specifies whether the value string should be split on -+ commas. The default is True. Setting it False is necessary for things -+ like compiler flags which should be a single string that may contain -+ commas. - """ - - __slots__ = ( -@@ -205,6 +209,7 @@ - "possible_origins", - "category", - "define_depth", -+ "comma_split", - ) - - def __init__( -@@ -218,6 +223,7 @@ - category=None, - help=None, - define_depth=0, -+ comma_split=True, - ): - if not name and not env: - raise InvalidOptionError( -@@ -335,9 +341,10 @@ - self.choices = choices - self.help = help - self.category = category or _infer_option_category(define_depth) -+ self.comma_split = comma_split - - @staticmethod -- def split_option(option): -+ def split_option(option, comma_split=True): - """Split a flag or variable into a prefix, a name and values - - Variables come in the form NAME=values (no prefix). -@@ -350,7 +357,13 @@ - - elements = option.split("=", 1) - name = elements[0] -- values = tuple(elements[1].split(",")) if len(elements) == 2 else () -+ if len(elements) == 2: -+ if comma_split: -+ values = tuple(elements[1].split(",")) -+ else: -+ values = (elements[1],) -+ else: -+ values = () - if name.startswith("--"): - name = name[2:] - if not name.islower(): -@@ -426,7 +439,7 @@ - % (option, origin, ", ".join(self.possible_origins)) - ) - -- prefix, name, values = self.split_option(option) -+ prefix, name, values = self.split_option(option, self.comma_split) - option = self._join_option(prefix, name) - - assert name in (self.name, self.env) diff --git a/firefox.spec b/firefox.spec index b9cfbfd..e33914e 100644 --- a/firefox.spec +++ b/firefox.spec @@ -302,12 +302,6 @@ Patch603: firefox-gcc-always-inline.patch Patch800: bmo-1559213-Support-system-av1.patch Patch801: bmo-1559213-fix-system-av1-libs.patch -# tentative patch for RUSTFLAGS parsing issue: -# https://bugzilla.redhat.com/show_bug.cgi?id=2184743 -# https://bugzilla.mozilla.org/show_bug.cgi?id=1474486 -# not upstreaming till I'm more sure it's correct -Patch1200: firefox-112.0-commasplit.patch - %if %{?system_nss} BuildRequires: pkgconfig(nspr) >= %{nspr_version} BuildRequires: pkgconfig(nss) >= %{nss_version} @@ -620,9 +614,6 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil #%patch800 -p1 -b .system-av1 #%patch801 -p1 -b .system-av1-fixup -# TODO? -#%patch -P1200 -p1 -b .rustflags-commasplit - rm -f .mozconfig cp %{SOURCE10} .mozconfig echo "ac_add_options --enable-default-toolkit=cairo-gtk3-wayland" >> .mozconfig diff --git a/wasi.patch b/wasi.patch index f1d6bb4..51600e7 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-130.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/home/komat/CVS/firefox/firefox-130.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From c287985714fe7dde088a81f903c3dabdbefc0b74 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 30 Aug 2024 13:02:34 +0200 Subject: [PATCH 386/545] Updated to 130.0 build 2 --- firefox.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index e33914e..fe10a1b 100644 --- a/firefox.spec +++ b/firefox.spec @@ -197,13 +197,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 130.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240828.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240830.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1235,6 +1235,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Aug 30 2024 Martin Stransky - 130.0-2 +- Updated to 130.0 build 2 + * Wed Aug 28 2024 Martin Stransky - 130.0-1 - Update to 130.0 From eeb1bbaed3842eb34e4fb7e2e9f281145084458e Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 5 Sep 2024 12:02:46 +0200 Subject: [PATCH 387/545] Downgrade libyuv to fix AVIF image rendering --- firefox.spec | 9 +- libyuv-downgrade.patch | 33672 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 33680 insertions(+), 1 deletion(-) create mode 100644 libyuv-downgrade.patch diff --git a/firefox.spec b/firefox.spec index fe10a1b..fd5c6d2 100644 --- a/firefox.spec +++ b/firefox.spec @@ -197,7 +197,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 130.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -302,6 +302,8 @@ Patch603: firefox-gcc-always-inline.patch Patch800: bmo-1559213-Support-system-av1.patch Patch801: bmo-1559213-fix-system-av1-libs.patch +Patch802: libyuv-downgrade.patch + %if %{?system_nss} BuildRequires: pkgconfig(nspr) >= %{nspr_version} BuildRequires: pkgconfig(nss) >= %{nss_version} @@ -611,6 +613,8 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %endif %patch -P603 -p1 -b .inline +%patch -P802 -p1 -b .libyuv-downgrade + #%patch800 -p1 -b .system-av1 #%patch801 -p1 -b .system-av1-fixup @@ -1235,6 +1239,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Sep 5 2024 Martin Stransky - 130.0-3 +- Downgrade libyuv to fix AVIF image rendering + * Fri Aug 30 2024 Martin Stransky - 130.0-2 - Updated to 130.0 build 2 diff --git a/libyuv-downgrade.patch b/libyuv-downgrade.patch new file mode 100644 index 0000000..f047285 --- /dev/null +++ b/libyuv-downgrade.patch @@ -0,0 +1,33672 @@ +diff --git a/media/libyuv/libyuv/AUTHORS b/media/libyuv/libyuv/AUTHORS +--- a/media/libyuv/libyuv/AUTHORS ++++ b/media/libyuv/libyuv/AUTHORS +@@ -3,5 +3,4 @@ + + Google Inc. + +-Ho Cheung + Ivan Pavlotskiy +diff --git a/media/libyuv/libyuv/Android.bp b/media/libyuv/libyuv/Android.bp +--- a/media/libyuv/libyuv/Android.bp ++++ b/media/libyuv/libyuv/Android.bp +@@ -1,5 +1,5 @@ + package { +- default_applicable_licenses: ["external_libyuv_license"], ++ default_applicable_licenses: ["external_libyuv_files_license"], + } + + // Added automatically by a large-scale-change +@@ -10,7 +10,7 @@ package { + // Please consider removing redundant or irrelevant files from 'license_text:'. + // See: http://go/android-license-faq + license { +- name: "external_libyuv_license", ++ name: "external_libyuv_files_license", + visibility: [":__subpackages__"], + license_kinds: [ + "SPDX-license-identifier-BSD", +@@ -62,7 +62,6 @@ cc_library { + "source/row_msa.cc", + "source/row_neon.cc", + "source/row_neon64.cc", +- "source/row_rvv.cc", + "source/scale.cc", + "source/scale_any.cc", + "source/scale_argb.cc", +@@ -72,7 +71,6 @@ cc_library { + "source/scale_neon.cc", + "source/scale_neon64.cc", + "source/scale_rgb.cc", +- "source/scale_rvv.cc", + "source/scale_uv.cc", + "source/video_common.cc", + ], +@@ -83,7 +81,6 @@ cc_library { + "-Wno-unused-parameter", + "-fexceptions", + "-DHAVE_JPEG", +- "-DLIBYUV_UNLIMITED_DATA", + ], + + arch: { +@@ -133,7 +130,6 @@ cc_test { + "unit_test/rotate_argb_test.cc", + "unit_test/rotate_test.cc", + "unit_test/scale_argb_test.cc", +- "unit_test/scale_plane_test.cc", + "unit_test/scale_rgb_test.cc", + "unit_test/scale_test.cc", + "unit_test/scale_uv_test.cc", +diff --git a/media/libyuv/libyuv/Android.mk b/media/libyuv/libyuv/Android.mk +--- a/media/libyuv/libyuv/Android.mk ++++ b/media/libyuv/libyuv/Android.mk +@@ -87,23 +87,21 @@ LOCAL_MODULE_TAGS := tests + LOCAL_CPP_EXTENSION := .cc + LOCAL_C_INCLUDES += $(LOCAL_PATH)/include + LOCAL_SRC_FILES := \ +- unit_test/basictypes_test.cc \ +- unit_test/color_test.cc \ +- unit_test/compare_test.cc \ +- unit_test/convert_argb_test.cc \ +- unit_test/convert_test.cc \ +- unit_test/cpu_test.cc \ +- unit_test/cpu_thread_test.cc \ +- unit_test/math_test.cc \ +- unit_test/planar_test.cc \ +- unit_test/rotate_argb_test.cc \ +- unit_test/rotate_test.cc \ +- unit_test/scale_argb_test.cc \ +- unit_test/scale_plane_test.cc \ +- unit_test/scale_rgb_test.cc \ +- unit_test/scale_test.cc \ +- unit_test/scale_uv_test.cc \ +- unit_test/unit_test.cc \ ++ unit_test/basictypes_test.cc \ ++ unit_test/color_test.cc \ ++ unit_test/compare_test.cc \ ++ unit_test/convert_test.cc \ ++ unit_test/cpu_test.cc \ ++ unit_test/cpu_thread_test.cc \ ++ unit_test/math_test.cc \ ++ unit_test/planar_test.cc \ ++ unit_test/rotate_argb_test.cc \ ++ unit_test/rotate_test.cc \ ++ unit_test/scale_argb_test.cc \ ++ unit_test/scale_rgb_test.cc \ ++ unit_test/scale_test.cc \ ++ unit_test/scale_uv_test.cc \ ++ unit_test/unit_test.cc \ + unit_test/video_common_test.cc + + LOCAL_MODULE := libyuv_unittest +diff --git a/media/libyuv/libyuv/BUILD.gn b/media/libyuv/libyuv/BUILD.gn +--- a/media/libyuv/libyuv/BUILD.gn ++++ b/media/libyuv/libyuv/BUILD.gn +@@ -6,7 +6,6 @@ + # in the file PATENTS. All contributing project authors may + # be found in the AUTHORS file in the root of the source tree. + +-import("//build/config/features.gni") + import("//testing/test.gni") + import("libyuv.gni") + +@@ -22,33 +21,15 @@ declare_args() { + + config("libyuv_config") { + include_dirs = [ "include" ] +- if (is_android) { +- if (target_cpu == "arm" || target_cpu == "x86" || target_cpu == "mipsel") { +- ldflags = [ "-Wl,--dynamic-linker,/system/bin/linker" ] +- } else { +- ldflags = [ "-Wl,--dynamic-linker,/system/bin/linker64" ] +- } ++ if (is_android && current_cpu == "arm64") { ++ ldflags = [ "-Wl,--dynamic-linker,/system/bin/linker64" ] ++ } ++ if (is_android && current_cpu != "arm64") { ++ ldflags = [ "-Wl,--dynamic-linker,/system/bin/linker" ] + } + +- # Define CHROMIUM to tell cpu_id to avoid sandbox unsafe system calls. +- defines = [ "CHROMIUM" ] + if (!libyuv_use_neon) { +- defines += [ "LIBYUV_DISABLE_NEON" ] +- } +- if (!libyuv_use_sve) { +- defines += [ "LIBYUV_DISABLE_SVE" ] +- } +- if (!libyuv_use_sme) { +- defines += [ "LIBYUV_DISABLE_SME" ] +- } +- if (libyuv_disable_rvv) { +- defines += [ "LIBYUV_DISABLE_RVV" ] +- } +- if (!libyuv_use_lsx) { +- defines += [ "LIBYUV_DISABLE_LSX" ] +- } +- if (!libyuv_use_lasx) { +- defines += [ "LIBYUV_DISABLE_LASX" ] ++ defines = [ "LIBYUV_DISABLE_NEON" ] + } + } + +@@ -84,22 +65,10 @@ group("libyuv") { + deps += [ ":libyuv_neon" ] + } + +- if (libyuv_use_sve) { +- deps += [ ":libyuv_sve" ] +- } +- + if (libyuv_use_msa) { + deps += [ ":libyuv_msa" ] + } + +- if (libyuv_use_lsx) { +- deps += [ ":libyuv_lsx" ] +- } +- +- if (libyuv_use_lasx) { +- deps += [ ":libyuv_lasx" ] +- } +- + if (!is_ios && !libyuv_disable_jpeg) { + # Make sure that clients of libyuv link with libjpeg. This can't go in + # libyuv_internal because in Windows x64 builds that will generate a clang +@@ -116,14 +85,11 @@ static_library("libyuv_internal") { + "include/libyuv.h", + "include/libyuv/basic_types.h", + "include/libyuv/compare.h", +- "include/libyuv/compare_row.h", + "include/libyuv/convert.h", + "include/libyuv/convert_argb.h", + "include/libyuv/convert_from.h", + "include/libyuv/convert_from_argb.h", + "include/libyuv/cpu_id.h", +- "include/libyuv/loongson_intrinsics.h", +- "include/libyuv/macros_msa.h", + "include/libyuv/mjpeg_decoder.h", + "include/libyuv/planar_functions.h", + "include/libyuv/rotate.h", +@@ -163,7 +129,6 @@ static_library("libyuv_internal") { + "source/row_any.cc", + "source/row_common.cc", + "source/row_gcc.cc", +- "source/row_rvv.cc", + "source/row_win.cc", + "source/scale.cc", + "source/scale_any.cc", +@@ -171,7 +136,6 @@ static_library("libyuv_internal") { + "source/scale_common.cc", + "source/scale_gcc.cc", + "source/scale_rgb.cc", +- "source/scale_rvv.cc", + "source/scale_uv.cc", + "source/scale_win.cc", + "source/video_common.cc", +@@ -186,7 +150,7 @@ static_library("libyuv_internal") { + configs += [ "//build/config/gcc:symbol_visibility_default" ] + } + +- if ((!is_ios || use_blink) && !libyuv_disable_jpeg) { ++ if (!is_ios && !libyuv_disable_jpeg) { + defines += [ "HAVE_JPEG" ] + + # Needed to pull in libjpeg headers. Can't add //third_party:jpeg to deps +@@ -232,45 +196,23 @@ if (libyuv_use_neon) { + + public_configs = [ ":libyuv_config" ] + +- if (current_cpu == "arm64") { +- cflags = [ "-march=armv8-a+dotprod+i8mm" ] +- } else { ++ # Always enable optimization for Release and NaCl builds (to workaround ++ # crbug.com/538243). ++ if (!is_debug) { ++ configs -= [ "//build/config/compiler:default_optimization" ] ++ ++ # Enable optimize for speed (-O2) over size (-Os). ++ # TODO(fbarchard): Consider optimize_speed which is O3. ++ configs += [ "//build/config/compiler:optimize_max" ] ++ } ++ ++ if (current_cpu != "arm64") { + configs -= [ "//build/config/compiler:compiler_arm_fpu" ] + cflags = [ "-mfpu=neon" ] + } + } + } + +-if (libyuv_use_sve) { +- static_library("libyuv_sve") { +- sources = [ +- "source/row_sve.cc", +- ] +- +- deps = [ ":libyuv_internal" ] +- +- public_configs = [ ":libyuv_config" ] +- +- # SVE2 is an Armv9-A feature. +- cflags = [ "-march=armv9-a+sve2" ] +- } +-} +- +-if (libyuv_use_sme) { +- static_library("libyuv_sme") { +- sources = [ +- "source/rotate_sme.cc", +- ] +- +- deps = [ ":libyuv_internal" ] +- +- public_configs = [ ":libyuv_config" ] +- +- # SME is an Armv9-A feature. +- cflags = [ "-march=armv9-a+sme" ] +- } +-} +- + if (libyuv_use_msa) { + static_library("libyuv_msa") { + sources = [ +@@ -287,44 +229,6 @@ if (libyuv_use_msa) { + } + } + +-if (libyuv_use_lsx) { +- static_library("libyuv_lsx") { +- sources = [ +- # LSX Source Files +- "source/rotate_lsx.cc", +- "source/row_lsx.cc", +- "source/scale_lsx.cc", +- ] +- +- cflags_cc = [ +- "-mlsx", +- "-Wno-c++11-narrowing", +- ] +- +- deps = [ ":libyuv_internal" ] +- +- public_configs = [ ":libyuv_config" ] +- } +-} +- +-if (libyuv_use_lasx) { +- static_library("libyuv_lasx") { +- sources = [ +- # LASX Source Files +- "source/row_lasx.cc", +- ] +- +- cflags_cc = [ +- "-mlasx", +- "-Wno-c++11-narrowing", +- ] +- +- deps = [ ":libyuv_internal" ] +- +- public_configs = [ ":libyuv_config" ] +- } +-} +- + if (libyuv_include_tests) { + config("libyuv_unittest_warnings_config") { + if (!is_win) { +@@ -352,7 +256,6 @@ if (libyuv_include_tests) { + "unit_test/basictypes_test.cc", + "unit_test/color_test.cc", + "unit_test/compare_test.cc", +- "unit_test/convert_argb_test.cc", + "unit_test/convert_test.cc", + "unit_test/cpu_test.cc", + "unit_test/cpu_thread_test.cc", +@@ -361,7 +264,6 @@ if (libyuv_include_tests) { + "unit_test/rotate_argb_test.cc", + "unit_test/rotate_test.cc", + "unit_test/scale_argb_test.cc", +- "unit_test/scale_plane_test.cc", + "unit_test/scale_rgb_test.cc", + "unit_test/scale_test.cc", + "unit_test/scale_uv_test.cc", +diff --git a/media/libyuv/libyuv/CMakeLists.txt b/media/libyuv/libyuv/CMakeLists.txt +--- a/media/libyuv/libyuv/CMakeLists.txt ++++ b/media/libyuv/libyuv/CMakeLists.txt +@@ -4,7 +4,7 @@ + + PROJECT ( YUV C CXX ) # "C" is required even for C++ projects + CMAKE_MINIMUM_REQUIRED( VERSION 2.8.12 ) +-OPTION( UNIT_TEST "Built unit tests" OFF ) ++OPTION( TEST "Built unit tests" OFF ) + + SET ( ly_base_dir ${PROJECT_SOURCE_DIR} ) + SET ( ly_src_dir ${ly_base_dir}/source ) +@@ -14,54 +14,8 @@ SET ( ly_lib_name yuv ) + SET ( ly_lib_static ${ly_lib_name} ) + SET ( ly_lib_shared ${ly_lib_name}_shared ) + +-# We cannot use GLOB here since we want to be able to separate out files that +-# need particular flags to enable architecture extensions like AArch64's SVE. +-# TODO: More of these files could be separated out for different architectures. +-SET ( ly_common_source_files +- ${ly_src_dir}/compare.cc +- ${ly_src_dir}/compare_common.cc +- ${ly_src_dir}/compare_gcc.cc +- ${ly_src_dir}/compare_msa.cc +- ${ly_src_dir}/compare_win.cc +- ${ly_src_dir}/convert_argb.cc +- ${ly_src_dir}/convert.cc +- ${ly_src_dir}/convert_from_argb.cc +- ${ly_src_dir}/convert_from.cc +- ${ly_src_dir}/convert_jpeg.cc +- ${ly_src_dir}/convert_to_argb.cc +- ${ly_src_dir}/convert_to_i420.cc +- ${ly_src_dir}/cpu_id.cc +- ${ly_src_dir}/mjpeg_decoder.cc +- ${ly_src_dir}/mjpeg_validate.cc +- ${ly_src_dir}/planar_functions.cc +- ${ly_src_dir}/rotate_any.cc +- ${ly_src_dir}/rotate_argb.cc +- ${ly_src_dir}/rotate.cc +- ${ly_src_dir}/rotate_common.cc +- ${ly_src_dir}/rotate_gcc.cc +- ${ly_src_dir}/rotate_lsx.cc +- ${ly_src_dir}/rotate_msa.cc +- ${ly_src_dir}/rotate_win.cc +- ${ly_src_dir}/row_any.cc +- ${ly_src_dir}/row_common.cc +- ${ly_src_dir}/row_gcc.cc +- ${ly_src_dir}/row_lasx.cc +- ${ly_src_dir}/row_lsx.cc +- ${ly_src_dir}/row_msa.cc +- ${ly_src_dir}/row_rvv.cc +- ${ly_src_dir}/row_win.cc +- ${ly_src_dir}/scale_any.cc +- ${ly_src_dir}/scale_argb.cc +- ${ly_src_dir}/scale.cc +- ${ly_src_dir}/scale_common.cc +- ${ly_src_dir}/scale_gcc.cc +- ${ly_src_dir}/scale_lsx.cc +- ${ly_src_dir}/scale_msa.cc +- ${ly_src_dir}/scale_rgb.cc +- ${ly_src_dir}/scale_rvv.cc +- ${ly_src_dir}/scale_uv.cc +- ${ly_src_dir}/scale_win.cc +- ${ly_src_dir}/video_common.cc) ++FILE ( GLOB_RECURSE ly_source_files ${ly_src_dir}/*.cc ) ++LIST ( SORT ly_source_files ) + + FILE ( GLOB_RECURSE ly_unittest_sources ${ly_tst_dir}/*.cc ) + LIST ( SORT ly_unittest_sources ) +@@ -72,68 +26,17 @@ if(MSVC) + ADD_DEFINITIONS ( -D_CRT_SECURE_NO_WARNINGS ) + endif() + +-# Need to set PIC to allow creating shared libraries from object file libraries. +-SET(CMAKE_POSITION_INDEPENDENT_CODE ON) +- +-# Build the set of objects that do not need to be compiled with flags to enable +-# particular architecture features. +-ADD_LIBRARY( ${ly_lib_name}_common_objects OBJECT ${ly_common_source_files} ) +-SET(ly_lib_parts $) +- +-if(NOT MSVC) +- STRING(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" arch_lowercase) +- +- if(arch_lowercase MATCHES "^arm" AND NOT arch_lowercase STREQUAL "arm64") +- # Enable Arm Neon kernels. +- ADD_DEFINITIONS(-DLIBYUV_NEON=1) +- ADD_LIBRARY(${ly_lib_name}_neon OBJECT +- ${ly_src_dir}/compare_neon.cc +- ${ly_src_dir}/rotate_neon.cc +- ${ly_src_dir}/row_neon.cc +- ${ly_src_dir}/scale_neon.cc) +- TARGET_COMPILE_OPTIONS(${ly_lib_name}_neon PRIVATE -mfpu=neon) +- LIST(APPEND ly_lib_parts $) +- endif() +- +- if(arch_lowercase STREQUAL "aarch64" OR arch_lowercase STREQUAL "arm64") +- # Enable AArch64 Neon dot-product and i8mm kernels. +- ADD_LIBRARY(${ly_lib_name}_neon64 OBJECT +- ${ly_src_dir}/compare_neon64.cc +- ${ly_src_dir}/rotate_neon64.cc +- ${ly_src_dir}/row_neon64.cc +- ${ly_src_dir}/scale_neon64.cc) +- TARGET_COMPILE_OPTIONS(${ly_lib_name}_neon64 PRIVATE -march=armv8-a+dotprod+i8mm) +- LIST(APPEND ly_lib_parts $) +- +- # Enable AArch64 SVE kernels. +- ADD_LIBRARY(${ly_lib_name}_sve OBJECT +- ${ly_src_dir}/row_sve.cc) +- TARGET_COMPILE_OPTIONS(${ly_lib_name}_sve PRIVATE -march=armv9-a+sve2) +- LIST(APPEND ly_lib_parts $) +- +- # Enable AArch64 SME kernels. +- ADD_LIBRARY(${ly_lib_name}_sme OBJECT +- ${ly_src_dir}/rotate_sme.cc) +- TARGET_COMPILE_OPTIONS(${ly_lib_name}_sme PRIVATE -march=armv9-a+sme) +- LIST(APPEND ly_lib_parts $) +- endif() +-endif() +- + # this creates the static library (.a) +-ADD_LIBRARY( ${ly_lib_static} STATIC ${ly_lib_parts}) ++ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} ) + + # this creates the shared library (.so) +-ADD_LIBRARY( ${ly_lib_shared} SHARED ${ly_lib_parts}) +-SET_TARGET_PROPERTIES( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" ) +-SET_TARGET_PROPERTIES( ${ly_lib_shared} PROPERTIES PREFIX "lib" ) ++ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} ) ++SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" ) ++SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES PREFIX "lib" ) + if(WIN32) +- SET_TARGET_PROPERTIES( ${ly_lib_shared} PROPERTIES IMPORT_PREFIX "lib" ) ++ SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES IMPORT_PREFIX "lib" ) + endif() + +-# this creates the cpuid tool +-ADD_EXECUTABLE ( cpuid ${ly_base_dir}/util/cpuid.c ) +-TARGET_LINK_LIBRARIES ( cpuid ${ly_lib_static} ) +- + # this creates the conversion tool + ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc ) + TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} ) +@@ -149,14 +52,10 @@ if (JPEG_FOUND) + add_definitions( -DHAVE_JPEG ) + endif() + +-if(UNIT_TEST) ++if(TEST) + find_library(GTEST_LIBRARY gtest) + if(GTEST_LIBRARY STREQUAL "GTEST_LIBRARY-NOTFOUND") +- set(GTEST_SRC_DIR_DEFAULT /usr/src/gtest) +- if (CMAKE_CROSSCOMPILING) +- set(GTEST_SRC_DIR_DEFAULT ${CMAKE_SOURCE_DIR}/third_party/googletest/src/googletest) +- endif() +- set(GTEST_SRC_DIR ${GTEST_SRC_DIR_DEFAULT} CACHE STRING "Location of gtest sources") ++ set(GTEST_SRC_DIR /usr/src/gtest CACHE STRING "Location of gtest sources") + if(EXISTS ${GTEST_SRC_DIR}/src/gtest-all.cc) + message(STATUS "building gtest from sources in ${GTEST_SRC_DIR}") + set(gtest_sources ${GTEST_SRC_DIR}/src/gtest-all.cc) +@@ -165,7 +64,7 @@ if(UNIT_TEST) + include_directories(${GTEST_SRC_DIR}/include) + set(GTEST_LIBRARY gtest) + else() +- message(FATAL_ERROR "UNIT_TEST is set but unable to find gtest library") ++ message(FATAL_ERROR "TEST is set but unable to find gtest library") + endif() + endif() + +diff --git a/media/libyuv/libyuv/DEPS b/media/libyuv/libyuv/DEPS +--- a/media/libyuv/libyuv/DEPS ++++ b/media/libyuv/libyuv/DEPS +@@ -5,62 +5,60 @@ gclient_gn_args = [ + + vars = { + 'chromium_git': 'https://chromium.googlesource.com', +- 'chromium_revision': 'af3d01376bec75a68f90160bfd38057d60510a2b', +- 'gn_version': 'git_revision:fae280eabe5d31accc53100137459ece19a7a295', ++ 'chromium_revision': '504c0697552240028c5412dafd2a7306a7cd4be7', ++ 'gn_version': 'git_revision:6f13aaac55a977e1948910942675c69f2b4f7a94', + # ninja CIPD package version. + # https://chrome-infra-packages.appspot.com/p/infra/3pp/tools/ninja +- 'ninja_version': 'version:2@1.11.1.chromium.6', ++ 'ninja_version': 'version:2@1.8.2.chromium.3', + # reclient CIPD package version +- 'reclient_version': 're_client_version:0.110.0.43ec6b1-gomaip', ++ 'reclient_version': 're_client_version:0.81.1.0853992-gomaip', + + # Keep the Chromium default of generating location tags. + 'generate_location_tags': True, + + # By default, download the fuchsia sdk from the public sdk directory. +- 'fuchsia_sdk_cipd_prefix': 'fuchsia/sdk/core/', +- 'fuchsia_version': 'version:15.20230909.2.1', ++ 'fuchsia_sdk_cipd_prefix': 'fuchsia/sdk/gn/', ++ 'fuchsia_version': 'version:10.20221110.2.1', + # By default, download the fuchsia images from the fuchsia GCS bucket. + 'fuchsia_images_bucket': 'fuchsia', + 'checkout_fuchsia': False, + # Since the images are hundreds of MB, default to only downloading the image + # most commonly useful for developers. Bots and developers that need to use + # other images can override this with additional images. +- 'checkout_fuchsia_boot_images': "terminal.qemu-x64,terminal.x64", ++ 'checkout_fuchsia_boot_images': "terminal.qemu-x64", + 'checkout_fuchsia_product_bundles': '"{checkout_fuchsia_boot_images}" != ""', + } + + deps = { + 'src/build': +- Var('chromium_git') + '/chromium/src/build' + '@' + '5885d3c24833ad72845a52a1b913a2b8bc651b56', ++ Var('chromium_git') + '/chromium/src/build' + '@' + 'fe1231e1da1e95acb006f53d06caaad16756a376', + 'src/buildtools': +- Var('chromium_git') + '/chromium/src/buildtools' + '@' + '79ab87fa54614258c4c95891e873223371194525', ++ Var('chromium_git') + '/chromium/src/buildtools' + '@' + '3c8fef071edb88facb7508060e978c5fb8608dd5', + 'src/testing': +- Var('chromium_git') + '/chromium/src/testing' + '@' + '51e9a02297057cc0e917763a51e16680b7d16fb6', ++ Var('chromium_git') + '/chromium/src/testing' + '@' + 'b4dc828e84ae95e1f5bf855f040c065287dac335', + 'src/third_party': +- Var('chromium_git') + '/chromium/src/third_party' + '@' + '2dc4b18abd1003ce7b1eda509dc96f12d49a9667', ++ Var('chromium_git') + '/chromium/src/third_party' + '@' + '73f7282fa28ca1fbe8401e391207fb6ccf34767f', + + 'src/buildtools/linux64': { + 'packages': [ + { +- 'package': 'gn/gn/linux-${{arch}}', ++ 'package': 'gn/gn/linux-amd64', + 'version': Var('gn_version'), + } + ], + 'dep_type': 'cipd', +- 'condition': 'host_os == "linux"', ++ 'condition': 'checkout_linux', + }, +- + 'src/buildtools/mac': { + 'packages': [ + { +- 'package': 'gn/gn/mac-${{arch}}', ++ 'package': 'gn/gn/mac-amd64', + 'version': Var('gn_version'), + } + ], + 'dep_type': 'cipd', +- 'condition': 'host_os == "mac"', ++ 'condition': 'checkout_mac', + }, +- + 'src/buildtools/win': { + 'packages': [ + { +@@ -69,7 +67,7 @@ deps = { + } + ], + 'dep_type': 'cipd', +- 'condition': 'host_os == "win"', ++ 'condition': 'checkout_win', + }, + + 'src/buildtools/reclient': { +@@ -82,40 +80,33 @@ deps = { + 'dep_type': 'cipd', + }, + ++ 'src/buildtools/clang_format/script': ++ Var('chromium_git') + '/external/github.com/llvm/llvm-project/clang/tools/clang-format.git' + '@' + '8b525d2747f2584fc35d8c7e612e66f377858df7', ++ 'src/buildtools/third_party/libc++/trunk': ++ Var('chromium_git') + '/external/github.com/llvm/llvm-project/libcxx.git' + '@' + 'cd0a05047451dfbdef5ba85f97ac4888e432a377', ++ 'src/buildtools/third_party/libc++abi/trunk': ++ Var('chromium_git') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + '1a32724f721e1c3b6c590a07fe4a954344f15e48', ++ 'src/buildtools/third_party/libunwind/trunk': ++ Var('chromium_git') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + '5870472fdd17f33d923b02e3e0acb9cbb18dbc9a', ++ + 'src/third_party/catapult': +- Var('chromium_git') + '/catapult.git' + '@' + 'fa05d995e152efdae488a2aeba397cd609fdbc9d', +- 'src/third_party/clang-format/script': +- Var('chromium_git') + '/external/github.com/llvm/llvm-project/clang/tools/clang-format.git' + '@' + 'f97059df7f8b205064625cdb5f97b56668a125ef', ++ Var('chromium_git') + '/catapult.git' + '@' + '4efb51be8574f2969273012958eaae85d01ede0b', + 'src/third_party/colorama/src': +- Var('chromium_git') + '/external/colorama.git' + '@' + '3de9f013df4b470069d03d250224062e8cf15c49', +- 'src/third_party/cpu_features/src': { +- 'url': Var('chromium_git') + '/external/github.com/google/cpu_features.git' + '@' + '936b9ab5515dead115606559502e3864958f7f6e', +- 'condition': 'checkout_android', +- }, ++ Var('chromium_git') + '/external/colorama.git' + '@' + '799604a1041e9b3bc5d2789ecbd7e8db2e18e6b8', + 'src/third_party/depot_tools': +- Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'd3e43dd4319ba169c0aaf44547eecf861f2fe5da', ++ Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '2fc7e1ffd58b00601b47a5126201e5162911e244', + 'src/third_party/freetype/src': +- Var('chromium_git') + '/chromium/src/third_party/freetype2.git' + '@' + '9e3c5d7e183c1a8d5ed8868d7d28ef18d3ec9ec8', +- 'third_party/fuchsia-gn-sdk': { +- 'url': Var('chromium_git') + '/chromium/src/third_party/fuchsia-gn-sdk.git' + '@' + '0d6902558d92fe3d49ba9a8f638ddea829be595b', +- 'condition': 'checkout_fuchsia', +- }, ++ Var('chromium_git') + '/chromium/src/third_party/freetype2.git' + '@' + '1c44de209cb465d175279dc30cd95f9857f703dd', + 'src/third_party/googletest/src': + Var('chromium_git') + '/external/github.com/google/googletest.git' + '@' + 'af29db7ec28d6df1c7f0f745186884091e602e07', + 'src/third_party/harfbuzz-ng/src': +- Var('chromium_git') + '/external/github.com/harfbuzz/harfbuzz.git' + '@' + 'db700b5670d9475cc8ed4880cc9447b232c5e432', +- 'src/third_party/libc++/src': +- Var('chromium_git') + '/external/github.com/llvm/llvm-project/libcxx.git' + '@' + '84fb809dd6dae36d556dc0bb702c6cc2ce9d4b80', +- 'src/third_party/libc++abi/src': +- Var('chromium_git') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + '8d21803b9076b16d46c32e2f10da191ee758520c', +- 'src/third_party/libunwind/src': +- Var('chromium_git') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + 'f1c687e0aaf0d70b9a53a150e9be5cb63af9215f', ++ Var('chromium_git') + '/external/github.com/harfbuzz/harfbuzz.git' + '@' + '2822b589bc837fae6f66233e2cf2eef0f6ce8470', + 'src/third_party/libjpeg_turbo': +- Var('chromium_git') + '/chromium/deps/libjpeg_turbo.git' + '@' + '30bdb85e302ecfc52593636b2f44af438e05e784', ++ Var('chromium_git') + '/chromium/deps/libjpeg_turbo.git' + '@' + 'ed683925e4897a84b3bffc5c1414c85b97a129a3', + 'src/third_party/nasm': +- Var('chromium_git') + '/chromium/deps/nasm.git' + '@' + '7fc833e889d1afda72c06220e5bed8fb43b2e5ce', ++ Var('chromium_git') + '/chromium/deps/nasm.git' + '@' + '0873b2bae6a5388a1c55deac8456e3c60a47ca08', + 'src/tools': +- Var('chromium_git') + '/chromium/src/tools' + '@' + 'a76c0dbb64c603a0d45e0c6dfae3a351b6e1adf1', ++ Var('chromium_git') + '/chromium/src/tools' + '@' + 'a20d904d021175f221bf58921a5a67fd48420ed9', + + # libyuv-only dependencies (not present in Chromium). + 'src/third_party/gtest-parallel': +@@ -137,32 +128,10 @@ deps = { + 'condition': 'checkout_android', + 'dep_type': 'cipd', + }, +- +- 'src/third_party/kotlin_stdlib': { +- 'packages': [ +- { +- 'package': 'chromium/third_party/kotlin_stdlib', +- 'version': 'Z1gsqhL967kFQecxKrRwXHbl-vwQjpv0l7PMUZ0EVO8C', +- }, +- ], +- 'condition': 'checkout_android', +- 'dep_type': 'cipd', +- }, +- 'src/third_party/kotlinc/current': { +- 'packages': [ +- { +- 'package': 'chromium/third_party/kotlinc', +- 'version': 'Rr02Gf2EkaeSs3EhSUHhPqDHSd1AzimrM6cRYUJCPjQC', +- }, +- ], +- 'condition': 'checkout_android', +- 'dep_type': 'cipd', +- }, +- + 'src/third_party/boringssl/src': +- 'https://boringssl.googlesource.com/boringssl.git' + '@' + '20a06474c0b4a16779311bfe98ba69dc2402101d', ++ 'https://boringssl.googlesource.com/boringssl.git' + '@' + 'f0518d45119dd4dd322a884669daf8247bc3c992', + 'src/base': { +- 'url': Var('chromium_git') + '/chromium/src/base' + '@' + 'd407b7061bce341bb6e11b539ea86c46c949ac4c', ++ 'url': Var('chromium_git') + '/chromium/src/base' + '@' + 'f80120ff3265ba9bcb27416cc489343cfdc8bc61', + 'condition': 'checkout_android', + }, + 'src/third_party/bazel': { +@@ -185,28 +154,20 @@ deps = { + 'condition': 'checkout_android', + 'dep_type': 'cipd', + }, +- 'src/third_party/android_toolchain': { +- 'packages': [ +- { +- 'package': 'chromium/third_party/android_toolchain/android_toolchain', +- 'version': 'R_8suM8m0oHbZ1awdxGXvKEFpAOETscbfZxkkMthyk8C', +- }, +- ], +- 'condition': 'checkout_android', +- 'dep_type': 'cipd', ++ 'src/third_party/android_ndk': { ++ 'url': Var('chromium_git') + '/android_ndk.git' + '@' + '8388a2be5421311dc75c5f937aae13d821a27f3d', ++ 'condition': 'checkout_android', + }, +- + 'src/third_party/androidx': { + 'packages': [ + { + 'package': 'chromium/third_party/androidx', +- 'version': 'y7rF_rx56mD3FGhMiqnlbQ6HOqHJ95xUFNX1m-_a988C', ++ 'version': 'DRqe-W5-XlO2ZySLCwsYKy7iqIaQ77O-Y91txXGY_hMC', + }, + ], + 'condition': 'checkout_android', + 'dep_type': 'cipd', + }, +- + 'src/third_party/android_support_test_runner': { + 'packages': [ + { +@@ -220,8 +181,8 @@ deps = { + 'src/third_party/android_sdk/public': { + 'packages': [ + { +- 'package': 'chromium/third_party/android_sdk/public/build-tools/34.0.0', +- 'version': 'YK9Rzw3fDzMHVzatNN6VlyoD_81amLZpN1AbmkdOd6AC', ++ 'package': 'chromium/third_party/android_sdk/public/build-tools/33.0.0', ++ 'version': '-VRKr36Uw8L_iFqqo9nevIBgNMggND5iWxjidyjnCgsC', + }, + { + 'package': 'chromium/third_party/android_sdk/public/emulator', +@@ -233,15 +194,11 @@ deps = { + }, + { + 'package': 'chromium/third_party/android_sdk/public/platform-tools', +- 'version': 'HWVsGs2HCKgSVv41FsOcsfJbNcB0UFiNrF6Tc4yRArYC', ++ 'version': 'RSI3iwryh7URLGRgJHsCvUxj092woTPnKt4pwFcJ6L8C', + }, + { +- 'package': 'chromium/third_party/android_sdk/public/platforms/android-34', +- 'version': 'u-bhWbTME6u-DjypTgr3ZikCyeAeU6txkR9ET6Uudc8C', +- }, +- { +- 'package': 'chromium/third_party/android_sdk/public/platforms/android-tiramisuprivacysandbox', +- 'version': 'YWMYkzyxGBgVsty0GhXL1oxbY0pGXQIgFc0Rh7ZMRPYC', ++ 'package': 'chromium/third_party/android_sdk/public/platforms/android-33', ++ 'version': 'eo5KvW6UVor92LwZai8Zulc624BQZoCu-yn7wa1z_YcC', + }, + { + 'package': 'chromium/third_party/android_sdk/public/sources/android-31', +@@ -249,7 +206,7 @@ deps = { + }, + { + 'package': 'chromium/third_party/android_sdk/public/cmdline-tools', +- 'version': 'EWnL2r7oV5GtE9Ef7GyohyFam42wtMtEKYU4dCb3U1YC', ++ 'version': 'IPzAG-uU5zVMxohpg9-7-N0tQC1TCSW1VbrBFw7Ld04C', + }, + ], + 'condition': 'checkout_android', +@@ -269,7 +226,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_build_tools/aapt2', +- 'version': 'STY0BXlZxsEhudnlXQFed-B5UpwehcoM0sYqor6qRqsC', ++ 'version': 'version:3.6.0-alpha03-5516695-cr0', + }, + ], + 'condition': 'checkout_android', +@@ -339,7 +296,7 @@ deps = { + }, + + 'src/third_party/icu': { +- 'url': Var('chromium_git') + '/chromium/deps/icu.git' + '@' + 'e8c3bc9ea97d4423ad0515e5f1c064f486dae8b1', ++ 'url': Var('chromium_git') + '/chromium/deps/icu.git' + '@' + '1b7d391f0528fb3a4976b7541b387ee04f915f83', + }, + 'src/third_party/icu4j': { + 'packages': [ +@@ -365,7 +322,11 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/jdk', +- 'version': 'GCFtf5t6M4HlrHj6NXedHbpHp2xjgognF8ptNci4478C', ++ 'version': 'PfRSnxe8Od6WU4zBXomq-zsgcJgWmm3z4gMQNB-r2QcC', ++ }, ++ { ++ 'package': 'chromium/third_party/jdk/extras', ++ 'version': 'fkhuOQ3r-zKtWEdKplpo6k0vKkjl-LY_rJTmtzFCQN4C', + }, + ], + 'condition': 'checkout_android', +@@ -393,14 +354,14 @@ deps = { + 'dep_type': 'cipd', + }, + 'src/third_party/mockito/src': { +- 'url': Var('chromium_git') + '/external/mockito/mockito.git' + '@' + '7c3641bcef717ffa7d765f2c86b847d0aab1aac9', ++ 'url': Var('chromium_git') + '/external/mockito/mockito.git' + '@' + '04a2a289a4222f80ad20717c25144981210d2eac', + 'condition': 'checkout_android', + }, + 'src/third_party/objenesis': { + 'packages': [ + { + 'package': 'chromium/third_party/objenesis', +- 'version': 'tknDblENYi8IaJYyD6tUahUyHYZlzJ_Y74_QZSz4DpIC', ++ 'version': '9e367f55e5a65781ee77bfcbaa88fb82b30e75c0', + }, + ], + 'condition': 'checkout_android', +@@ -420,7 +381,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/r8', +- 'version': 'O1BBWiBTIeNUcraX8STMtQXVaCleu6SJJjWCcnfhPLkC', ++ 'version': 'szXK3tCGU7smsNs4r2mGqxme7d9KWLaOk0_ghbCJxUQC', + }, + ], + 'condition': 'checkout_android', +@@ -433,7 +394,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/r8', +- 'version': 'vw5kLlW3-suSlCKSO9OQpFWpR8oDnvQ8k1RgKNUapQYC', ++ 'version': 'Qn31g4m2cofkyvGgm46Uzkzds5DKdNYrdPePwRkVnv4C', + }, + ], + 'condition': 'checkout_android', +@@ -450,14 +411,14 @@ deps = { + 'dep_type': 'cipd', + }, + 'src/third_party/requests/src': { +- 'url': Var('chromium_git') + '/external/github.com/kennethreitz/requests.git' + '@' + 'c7e0fc087ceeadb8b4c84a0953a422c474093d6d', ++ 'url': Var('chromium_git') + '/external/github.com/kennethreitz/requests.git' + '@' + 'refs/tags/v2.23.0', + 'condition': 'checkout_android', + }, + 'src/third_party/robolectric': { + 'packages': [ + { + 'package': 'chromium/third_party/robolectric', +- 'version': 'hzetqh1qFI32FOgQroZvGcGdomrgVBJ6WKRnl1KFw6EC', ++ 'version': 'iC6RDM5EH3GEAzR-1shW_Mg0FeeNE5shq1okkFfuuNQC', + }, + ], + 'condition': 'checkout_android', +@@ -467,7 +428,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/sqlite4java', +- 'version': 'LofjKH9dgXIAJhRYCPQlMFywSwxYimrfDeBmaHc-Z5EC', ++ 'version': '889660698187baa7c8b0d79f7bf58563125fbd66', + }, + ], + 'condition': 'checkout_android', +@@ -477,7 +438,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/turbine', +- 'version': '2I2Nz480QsuCxpQ1lMfbigX8l5HAhX3_ykWU4TKRGo4C', ++ 'version': 'Om6yIEXgJxuqghErK29h9RcMH6VaymMbxwScwXmcN6EC', + }, + ], + 'condition': 'checkout_android', +@@ -490,7 +451,7 @@ deps = { + + # iOS deps: + 'src/ios': { +- 'url': Var('chromium_git') + '/chromium/src/ios' + '@' + 'ddd58e86cf4ebdc0db60a5d0f3c323de49bb295c', ++ 'url': Var('chromium_git') + '/chromium/src/ios' + '@' + '866ec86ecb27dad8a3ac7957590df7765a13834f', + 'condition': 'checkout_ios' + }, + +@@ -926,6 +887,28 @@ deps = { + 'dep_type': 'cipd', + }, + ++ 'src/third_party/android_deps/libs/com_android_tools_desugar_jdk_libs': { ++ 'packages': [ ++ { ++ 'package': 'chromium/third_party/android_deps/libs/com_android_tools_desugar_jdk_libs', ++ 'version': 'version:2@1.1.5.cr1', ++ }, ++ ], ++ 'condition': 'checkout_android', ++ 'dep_type': 'cipd', ++ }, ++ ++ 'src/third_party/android_deps/libs/com_android_tools_desugar_jdk_libs_configuration': { ++ 'packages': [ ++ { ++ 'package': 'chromium/third_party/android_deps/libs/com_android_tools_desugar_jdk_libs_configuration', ++ 'version': 'version:2@1.1.5.cr1', ++ }, ++ ], ++ 'condition': 'checkout_android', ++ 'dep_type': 'cipd', ++ }, ++ + 'src/third_party/android_deps/libs/com_android_tools_layoutlib_layoutlib_api': { + 'packages': [ + { +@@ -970,17 +953,6 @@ deps = { + 'dep_type': 'cipd', + }, + +- 'src/third_party/android_deps/libs/com_google_android_annotations': { +- 'packages': [ +- { +- 'package': 'chromium/third_party/android_deps/libs/com_google_android_annotations', +- 'version': 'version:2@4.1.1.4.cr1', +- }, +- ], +- 'condition': 'checkout_android', +- 'dep_type': 'cipd', +- }, +- + 'src/third_party/android_deps/libs/com_google_android_apps_common_testing_accessibility_framework_accessibility_test_framework': { + 'packages': [ + { +@@ -1051,7 +1023,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_basement', +- 'version': 'version:2@18.1.0.cr1', ++ 'version': 'version:2@18.0.1.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -1102,6 +1074,17 @@ deps = { + 'dep_type': 'cipd', + }, + ++ 'src/third_party/android_deps/libs/com_google_android_gms_play_services_fido': { ++ 'packages': [ ++ { ++ 'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_fido', ++ 'version': 'version:2@19.0.0-beta.cr1', ++ }, ++ ], ++ 'condition': 'checkout_android', ++ 'dep_type': 'cipd', ++ }, ++ + 'src/third_party/android_deps/libs/com_google_android_gms_play_services_flags': { + 'packages': [ + { +@@ -1194,7 +1177,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_tasks', +- 'version': 'version:2@18.0.2.cr1', ++ 'version': 'version:2@18.0.1.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -1234,22 +1217,11 @@ deps = { + 'dep_type': 'cipd', + }, + +- 'src/third_party/android_deps/libs/com_google_android_play_core_common': { ++ 'src/third_party/android_deps/libs/com_google_android_play_core': { + 'packages': [ + { +- 'package': 'chromium/third_party/android_deps/libs/com_google_android_play_core_common', +- 'version': 'version:2@2.0.2.cr1', +- }, +- ], +- 'condition': 'checkout_android', +- 'dep_type': 'cipd', +- }, +- +- 'src/third_party/android_deps/libs/com_google_android_play_feature_delivery': { +- 'packages': [ +- { +- 'package': 'chromium/third_party/android_deps/libs/com_google_android_play_feature_delivery', +- 'version': 'version:2@2.0.1.cr1', ++ 'package': 'chromium/third_party/android_deps/libs/com_google_android_play_core', ++ 'version': 'version:2@1.10.0.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -1293,7 +1265,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/com_google_auto_value_auto_value_annotations', +- 'version': 'version:2@1.10.1.cr1', ++ 'version': 'version:2@1.9.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -1315,7 +1287,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/com_google_code_gson_gson', +- 'version': 'version:2@2.9.0.cr1', ++ 'version': 'version:2@2.8.0.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -1381,7 +1353,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/com_google_errorprone_error_prone_annotations', +- 'version': 'version:2@2.18.0.cr1', ++ 'version': 'version:2@2.14.0.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -1564,6 +1536,17 @@ deps = { + 'dep_type': 'cipd', + }, + ++ 'src/third_party/android_deps/libs/com_google_flatbuffers_flatbuffers_java': { ++ 'packages': [ ++ { ++ 'package': 'chromium/third_party/android_deps/libs/com_google_flatbuffers_flatbuffers_java', ++ 'version': 'version:2@2.0.3.cr1', ++ }, ++ ], ++ 'condition': 'checkout_android', ++ 'dep_type': 'cipd', ++ }, ++ + 'src/third_party/android_deps/libs/com_google_googlejavaformat_google_java_format': { + 'packages': [ + { +@@ -1590,7 +1573,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/com_google_guava_guava', +- 'version': 'version:2@31.1-jre.cr1', ++ 'version': 'version:2@31.0.1-jre.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -1601,7 +1584,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/com_google_guava_guava_android', +- 'version': 'version:2@31.1-android.cr1', ++ 'version': 'version:2@31.0-android.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -1645,7 +1628,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/com_google_protobuf_protobuf_javalite', +- 'version': 'version:2@3.21.1.cr1', ++ 'version': 'version:2@3.19.3.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -1685,28 +1668,6 @@ deps = { + 'dep_type': 'cipd', + }, + +- 'src/third_party/android_deps/libs/com_squareup_okio_okio_jvm': { +- 'packages': [ +- { +- 'package': 'chromium/third_party/android_deps/libs/com_squareup_okio_okio_jvm', +- 'version': 'version:2@3.3.0.cr1', +- }, +- ], +- 'condition': 'checkout_android', +- 'dep_type': 'cipd', +- }, +- +- 'src/third_party/android_deps/libs/com_squareup_wire_wire_runtime_jvm': { +- 'packages': [ +- { +- 'package': 'chromium/third_party/android_deps/libs/com_squareup_wire_wire_runtime_jvm', +- 'version': 'version:2@4.7.0.cr1', +- }, +- ], +- 'condition': 'checkout_android', +- 'dep_type': 'cipd', +- }, +- + 'src/third_party/android_deps/libs/io_github_java_diff_utils_java_diff_utils': { + 'packages': [ + { +@@ -1718,83 +1679,6 @@ deps = { + 'dep_type': 'cipd', + }, + +- 'src/third_party/android_deps/libs/io_grpc_grpc_api': { +- 'packages': [ +- { +- 'package': 'chromium/third_party/android_deps/libs/io_grpc_grpc_api', +- 'version': 'version:2@1.49.0.cr1', +- }, +- ], +- 'condition': 'checkout_android', +- 'dep_type': 'cipd', +- }, +- +- 'src/third_party/android_deps/libs/io_grpc_grpc_binder': { +- 'packages': [ +- { +- 'package': 'chromium/third_party/android_deps/libs/io_grpc_grpc_binder', +- 'version': 'version:2@1.49.0.cr1', +- }, +- ], +- 'condition': 'checkout_android', +- 'dep_type': 'cipd', +- }, +- +- 'src/third_party/android_deps/libs/io_grpc_grpc_context': { +- 'packages': [ +- { +- 'package': 'chromium/third_party/android_deps/libs/io_grpc_grpc_context', +- 'version': 'version:2@1.49.0.cr1', +- }, +- ], +- 'condition': 'checkout_android', +- 'dep_type': 'cipd', +- }, +- +- 'src/third_party/android_deps/libs/io_grpc_grpc_core': { +- 'packages': [ +- { +- 'package': 'chromium/third_party/android_deps/libs/io_grpc_grpc_core', +- 'version': 'version:2@1.49.0.cr1', +- }, +- ], +- 'condition': 'checkout_android', +- 'dep_type': 'cipd', +- }, +- +- 'src/third_party/android_deps/libs/io_grpc_grpc_protobuf_lite': { +- 'packages': [ +- { +- 'package': 'chromium/third_party/android_deps/libs/io_grpc_grpc_protobuf_lite', +- 'version': 'version:2@1.49.0.cr1', +- }, +- ], +- 'condition': 'checkout_android', +- 'dep_type': 'cipd', +- }, +- +- 'src/third_party/android_deps/libs/io_grpc_grpc_stub': { +- 'packages': [ +- { +- 'package': 'chromium/third_party/android_deps/libs/io_grpc_grpc_stub', +- 'version': 'version:2@1.49.0.cr1', +- }, +- ], +- 'condition': 'checkout_android', +- 'dep_type': 'cipd', +- }, +- +- 'src/third_party/android_deps/libs/io_perfmark_perfmark_api': { +- 'packages': [ +- { +- 'package': 'chromium/third_party/android_deps/libs/io_perfmark_perfmark_api', +- 'version': 'version:2@0.25.0.cr1', +- }, +- ], +- 'condition': 'checkout_android', +- 'dep_type': 'cipd', +- }, +- + 'src/third_party/android_deps/libs/javax_annotation_javax_annotation_api': { + 'packages': [ + { +@@ -1832,7 +1716,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/net_bytebuddy_byte_buddy', +- 'version': 'version:2@1.14.5.cr1', ++ 'version': 'version:2@1.12.13.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -1843,7 +1727,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/net_bytebuddy_byte_buddy_agent', +- 'version': 'version:2@1.14.5.cr1', ++ 'version': 'version:2@1.12.13.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -1861,11 +1745,22 @@ deps = { + 'dep_type': 'cipd', + }, + +- 'src/third_party/android_deps/libs/org_bouncycastle_bcprov_jdk18on': { ++ 'src/third_party/android_deps/libs/net_sf_kxml_kxml2': { + 'packages': [ + { +- 'package': 'chromium/third_party/android_deps/libs/org_bouncycastle_bcprov_jdk18on', +- 'version': 'version:2@1.72.cr1', ++ 'package': 'chromium/third_party/android_deps/libs/net_sf_kxml_kxml2', ++ 'version': 'version:2@2.3.0.cr1', ++ }, ++ ], ++ 'condition': 'checkout_android', ++ 'dep_type': 'cipd', ++ }, ++ ++ 'src/third_party/android_deps/libs/org_bouncycastle_bcprov_jdk15on': { ++ 'packages': [ ++ { ++ 'package': 'chromium/third_party/android_deps/libs/org_bouncycastle_bcprov_jdk15on', ++ 'version': 'version:2@1.68.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -1905,17 +1800,6 @@ deps = { + 'dep_type': 'cipd', + }, + +- 'src/third_party/android_deps/libs/org_checkerframework_checker_util': { +- 'packages': [ +- { +- 'package': 'chromium/third_party/android_deps/libs/org_checkerframework_checker_util', +- 'version': 'version:2@3.25.0.cr1', +- }, +- ], +- 'condition': 'checkout_android', +- 'dep_type': 'cipd', +- }, +- + 'src/third_party/android_deps/libs/org_checkerframework_dataflow_errorprone': { + 'packages': [ + { +@@ -1931,18 +1815,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_codehaus_mojo_animal_sniffer_annotations', +- 'version': 'version:2@1.21.cr1', +- }, +- ], +- 'condition': 'checkout_android', +- 'dep_type': 'cipd', +- }, +- +- 'src/third_party/android_deps/libs/org_conscrypt_conscrypt_openjdk_uber': { +- 'packages': [ +- { +- 'package': 'chromium/third_party/android_deps/libs/org_conscrypt_conscrypt_openjdk_uber', +- 'version': 'version:2@2.5.2.cr1', ++ 'version': 'version:2@1.17.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -1971,11 +1844,44 @@ deps = { + 'dep_type': 'cipd', + }, + ++ 'src/third_party/android_deps/libs/org_jetbrains_annotations': { ++ 'packages': [ ++ { ++ 'package': 'chromium/third_party/android_deps/libs/org_jetbrains_annotations', ++ 'version': 'version:2@13.0.cr1', ++ }, ++ ], ++ 'condition': 'checkout_android', ++ 'dep_type': 'cipd', ++ }, ++ ++ 'src/third_party/android_deps/libs/org_jetbrains_kotlin_kotlin_stdlib': { ++ 'packages': [ ++ { ++ 'package': 'chromium/third_party/android_deps/libs/org_jetbrains_kotlin_kotlin_stdlib', ++ 'version': 'version:2@1.7.10.cr1', ++ }, ++ ], ++ 'condition': 'checkout_android', ++ 'dep_type': 'cipd', ++ }, ++ ++ 'src/third_party/android_deps/libs/org_jetbrains_kotlin_kotlin_stdlib_common': { ++ 'packages': [ ++ { ++ 'package': 'chromium/third_party/android_deps/libs/org_jetbrains_kotlin_kotlin_stdlib_common', ++ 'version': 'version:2@1.7.10.cr1', ++ }, ++ ], ++ 'condition': 'checkout_android', ++ 'dep_type': 'cipd', ++ }, ++ + 'src/third_party/android_deps/libs/org_jetbrains_kotlin_kotlin_stdlib_jdk7': { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_jetbrains_kotlin_kotlin_stdlib_jdk7', +- 'version': 'version:2@1.8.20.cr1', ++ 'version': 'version:2@1.6.20.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -1986,7 +1892,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_jetbrains_kotlin_kotlin_stdlib_jdk8', +- 'version': 'version:2@1.8.20.cr1', ++ 'version': 'version:2@1.6.20.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -1997,7 +1903,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_jetbrains_kotlinx_kotlinx_coroutines_android', +- 'version': 'version:2@1.6.4.cr1', ++ 'version': 'version:2@1.6.1.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2008,18 +1914,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_jetbrains_kotlinx_kotlinx_coroutines_core_jvm', +- 'version': 'version:2@1.6.4.cr1', +- }, +- ], +- 'condition': 'checkout_android', +- 'dep_type': 'cipd', +- }, +- +- 'src/third_party/android_deps/libs/org_jetbrains_kotlinx_kotlinx_coroutines_guava': { +- 'packages': [ +- { +- 'package': 'chromium/third_party/android_deps/libs/org_jetbrains_kotlinx_kotlinx_coroutines_guava', +- 'version': 'version:2@1.6.4.cr1', ++ 'version': 'version:2@1.6.1.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2048,33 +1943,11 @@ deps = { + 'dep_type': 'cipd', + }, + +- 'src/third_party/android_deps/libs/org_mockito_mockito_android': { +- 'packages': [ +- { +- 'package': 'chromium/third_party/android_deps/libs/org_mockito_mockito_android', +- 'version': 'version:2@5.4.0.cr1', +- }, +- ], +- 'condition': 'checkout_android', +- 'dep_type': 'cipd', +- }, +- + 'src/third_party/android_deps/libs/org_mockito_mockito_core': { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_mockito_mockito_core', +- 'version': 'version:2@5.4.0.cr1', +- }, +- ], +- 'condition': 'checkout_android', +- 'dep_type': 'cipd', +- }, +- +- 'src/third_party/android_deps/libs/org_mockito_mockito_subclass': { +- 'packages': [ +- { +- 'package': 'chromium/third_party/android_deps/libs/org_mockito_mockito_subclass', +- 'version': 'version:2@5.4.0.cr1', ++ 'version': 'version:2@4.7.0.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2085,7 +1958,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_objenesis_objenesis', +- 'version': 'version:2@3.3.cr1', ++ 'version': 'version:2@3.2.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2096,7 +1969,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_ow2_asm_asm', +- 'version': 'version:2@9.5.cr1', ++ 'version': 'version:2@9.2.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2107,7 +1980,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_ow2_asm_asm_analysis', +- 'version': 'version:2@9.5.cr1', ++ 'version': 'version:2@9.2.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2118,7 +1991,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_ow2_asm_asm_commons', +- 'version': 'version:2@9.5.cr1', ++ 'version': 'version:2@9.2.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2129,7 +2002,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_ow2_asm_asm_tree', +- 'version': 'version:2@9.5.cr1', ++ 'version': 'version:2@9.2.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2140,7 +2013,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_ow2_asm_asm_util', +- 'version': 'version:2@9.5.cr1', ++ 'version': 'version:2@9.2.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2162,7 +2035,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_robolectric_annotations', +- 'version': 'version:2@4.10.3.cr1', ++ 'version': 'version:2@4.8.1.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2173,7 +2046,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_robolectric_junit', +- 'version': 'version:2@4.10.3.cr1', ++ 'version': 'version:2@4.8.1.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2184,18 +2057,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_robolectric_nativeruntime', +- 'version': 'version:2@4.10.3.cr1', +- }, +- ], +- 'condition': 'checkout_android', +- 'dep_type': 'cipd', +- }, +- +- 'src/third_party/android_deps/libs/org_robolectric_nativeruntime_dist_compat': { +- 'packages': [ +- { +- 'package': 'chromium/third_party/android_deps/libs/org_robolectric_nativeruntime_dist_compat', +- 'version': 'version:2@1.0.1.cr1', ++ 'version': 'version:2@4.8.1.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2206,7 +2068,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_robolectric_pluginapi', +- 'version': 'version:2@4.10.3.cr1', ++ 'version': 'version:2@4.8.1.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2217,7 +2079,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_robolectric_plugins_maven_dependency_resolver', +- 'version': 'version:2@4.10.3.cr1', ++ 'version': 'version:2@4.8.1.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2228,7 +2090,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_robolectric_resources', +- 'version': 'version:2@4.10.3.cr1', ++ 'version': 'version:2@4.8.1.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2239,7 +2101,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_robolectric_robolectric', +- 'version': 'version:2@4.10.3.cr1', ++ 'version': 'version:2@4.8.1.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2250,7 +2112,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_robolectric_sandbox', +- 'version': 'version:2@4.10.3.cr1', ++ 'version': 'version:2@4.8.1.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2261,7 +2123,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_robolectric_shadowapi', +- 'version': 'version:2@4.10.3.cr1', ++ 'version': 'version:2@4.8.1.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2272,7 +2134,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_robolectric_shadows_framework', +- 'version': 'version:2@4.10.3.cr1', ++ 'version': 'version:2@4.8.1.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2283,7 +2145,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_robolectric_shadows_playservices', +- 'version': 'version:2@4.10.3.cr1', ++ 'version': 'version:2@4.8.1.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2294,7 +2156,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_robolectric_utils', +- 'version': 'version:2@4.10.3.cr1', ++ 'version': 'version:2@4.8.1.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2305,7 +2167,7 @@ deps = { + 'packages': [ + { + 'package': 'chromium/third_party/android_deps/libs/org_robolectric_utils_reflector', +- 'version': 'version:2@4.10.3.cr1', ++ 'version': 'version:2@4.8.1.cr1', + }, + ], + 'condition': 'checkout_android', +@@ -2315,6 +2177,16 @@ deps = { + # === ANDROID_DEPS Generated Code End === + } + ++pre_deps_hooks = [ ++ { ++ # Remove any symlinks from before 177567c518b121731e507e9b9c4049c4dc96e4c8. ++ # TODO(kjellander): Remove this in March 2017. ++ 'name': 'cleanup_links', ++ 'pattern': '.', ++ 'action': ['python3', 'src/cleanup_links.py'], ++ }, ++] ++ + hooks = [ + { + # This clobbers when necessary (based on get_landmines.py). It should be +@@ -2405,7 +2277,7 @@ hooks = [ + ], + }, + { +- 'name': 'msan_chained_origins_focal', ++ 'name': 'msan_chained_origins_xenial', + 'pattern': '.', + 'condition': 'checkout_instrumented_libraries', + 'action': [ 'python3', +@@ -2413,11 +2285,11 @@ hooks = [ + '--no_resume', + '--no_auth', + '--bucket', 'chromium-instrumented-libraries', +- '-s', 'src/third_party/instrumented_libraries/binaries/msan-chained-origins-focal.tgz.sha1', ++ '-s', 'src/third_party/instrumented_libraries/binaries/msan-chained-origins-xenial.tgz.sha1', + ], + }, + { +- 'name': 'msan_no_origins_focal', ++ 'name': 'msan_no_origins_xenial', + 'pattern': '.', + 'condition': 'checkout_instrumented_libraries', + 'action': [ 'python3', +@@ -2425,7 +2297,7 @@ hooks = [ + '--no_resume', + '--no_auth', + '--bucket', 'chromium-instrumented-libraries', +- '-s', 'src/third_party/instrumented_libraries/binaries/msan-no-origins-focal.tgz.sha1', ++ '-s', 'src/third_party/instrumented_libraries/binaries/msan-no-origins-xenial.tgz.sha1', + ], + }, + { +diff --git a/media/libyuv/libyuv/README.chromium b/media/libyuv/libyuv/README.chromium +--- a/media/libyuv/libyuv/README.chromium ++++ b/media/libyuv/libyuv/README.chromium +@@ -1,9 +1,8 @@ + Name: libyuv +-URL: https://chromium.googlesource.com/libyuv/libyuv/ +-Version: 1889 ++URL: http://code.google.com/p/libyuv/ ++Version: 1860 + License: BSD + License File: LICENSE +-Shipped: yes + + Description: + libyuv is an open source project that includes YUV conversion and scaling functionality. +diff --git a/media/libyuv/libyuv/README.md b/media/libyuv/libyuv/README.md +--- a/media/libyuv/libyuv/README.md ++++ b/media/libyuv/libyuv/README.md +@@ -7,7 +7,6 @@ + * Optimized for SSSE3/AVX2 on x86/x64. + * Optimized for Neon on Arm. + * Optimized for MSA on Mips. +-* Optimized for RVV on RISC-V. + + ### Development + +diff --git a/media/libyuv/libyuv/build_overrides/build.gni b/media/libyuv/libyuv/build_overrides/build.gni +--- a/media/libyuv/libyuv/build_overrides/build.gni ++++ b/media/libyuv/libyuv/build_overrides/build.gni +@@ -13,9 +13,6 @@ build_with_chromium = false + # Some non-Chromium builds don't support building java targets. + enable_java_templates = true + +-# Enables assertions on safety checks in libc++. +-enable_safe_libcxx = true +- + # Allow using custom suppressions files (currently not used by libyuv). + asan_suppressions_file = "//build/sanitizers/asan_suppressions.cc" + lsan_suppressions_file = "//build/sanitizers/lsan_suppressions.cc" +diff --git a/media/libyuv/libyuv/docs/deprecated_builds.md b/media/libyuv/libyuv/docs/deprecated_builds.md +--- a/media/libyuv/libyuv/docs/deprecated_builds.md ++++ b/media/libyuv/libyuv/docs/deprecated_builds.md +@@ -165,11 +165,11 @@ mipsel + + arm32 disassembly: + +- llvm-objdump -d out/Release/obj/source/libyuv.row_neon.o ++ third_party/android_ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-objdump -d out/Release/obj/source/libyuv.row_neon.o + + arm64 disassembly: + +- llvm-objdump -d out/Release/obj/source/libyuv.row_neon64.o ++ third_party/android_ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-objdump -d out/Release/obj/source/libyuv.row_neon64.o + + Running tests: + +diff --git a/media/libyuv/libyuv/docs/environment_variables.md b/media/libyuv/libyuv/docs/environment_variables.md +--- a/media/libyuv/libyuv/docs/environment_variables.md ++++ b/media/libyuv/libyuv/docs/environment_variables.md +@@ -26,10 +26,8 @@ By default the cpu is detected and the m + LIBYUV_DISABLE_AVX512VBMI + LIBYUV_DISABLE_AVX512VBMI2 + LIBYUV_DISABLE_AVX512VBITALG +- LIBYUV_DISABLE_AVX10 +- LIBYUV_DISABLE_AVXVNNI +- LIBYUV_DISABLE_AVXVNNIINT8 +- LIBYUV_DISABLE_AMXINT8 ++ LIBYUV_DISABLE_AVX512VPOPCNTDQ ++ LIBYUV_DISABLE_GFNI + + ## ARM CPUs + +@@ -42,9 +40,6 @@ By default the cpu is detected and the m + LIBYUV_DISABLE_LSX + LIBYUV_DISABLE_LASX + +-## RISCV CPUs +- LIBYUV_DISABLE_RVV +- + # Test Width/Height/Repeat + + The unittests default to a small image (128x72) to run fast. This can be set by environment variable to test a specific resolutions. +diff --git a/media/libyuv/libyuv/docs/getting_started.md b/media/libyuv/libyuv/docs/getting_started.md +--- a/media/libyuv/libyuv/docs/getting_started.md ++++ b/media/libyuv/libyuv/docs/getting_started.md +@@ -139,11 +139,11 @@ mips + + arm disassembly: + +- llvm-objdump -d ./out/Release/obj/libyuv/row_common.o >row_common.txt ++ third_party/android_ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-objdump -d ./out/Release/obj/libyuv/row_common.o >row_common.txt + +- llvm-objdump -d ./out/Release/obj/libyuv_neon/row_neon.o >row_neon.txt ++ third_party/android_ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-objdump -d ./out/Release/obj/libyuv_neon/row_neon.o >row_neon.txt + +- llvm-objdump -d ./out/Release/obj/libyuv_neon/row_neon64.o >row_neon64.txt ++ third_party/android_ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-objdump -d ./out/Release/obj/libyuv_neon/row_neon64.o >row_neon64.txt + + Caveat: Disassembly may require optimize_max be disabled in BUILD.gn + +@@ -220,47 +220,6 @@ Install cmake: http://www.cmake.org/ + make -j4 + make package + +-## Building RISC-V target with cmake +- +-### Prerequisite: build risc-v clang toolchain and qemu +- +-If you don't have prebuilt clang and riscv64 qemu, run the script to download source and build them. +- +- ./riscv_script/prepare_toolchain_qemu.sh +- +-After running script, clang & qemu are built in `build-toolchain-qemu/riscv-clang/` & `build-toolchain-qemu/riscv-qemu/`. +- +-### Cross-compile for RISC-V target +- cmake -B out/Release/ -DUNIT_TEST=ON \ +- -DCMAKE_BUILD_TYPE=Release \ +- -DCMAKE_TOOLCHAIN_FILE="./riscv_script/riscv-clang.cmake" \ +- -DTOOLCHAIN_PATH={TOOLCHAIN_PATH} \ +- -DUSE_RVV=ON . +- cmake --build out/Release/ +- +-#### Customized Compiler Flags +- +-Customized compiler flags are supported by `-DRISCV_COMPILER_FLAGS="xxx"`. +-If `-DRISCV_COMPILER_FLAGS="xxx"` is manually assigned, other compile flags(e.g disable -march=xxx) will not be appended. +- +-Example: +- +- cmake -B out/Release/ -DUNIT_TEST=ON \ +- -DCMAKE_BUILD_TYPE=Release \ +- -DCMAKE_TOOLCHAIN_FILE="./riscv_script/riscv-clang.cmake" \ +- -DRISCV_COMPILER_FLAGS="-mcpu=sifive-x280" \ +- . +- +-### Run on QEMU +- +-#### Run libyuv_unittest on QEMU +- cd out/Release/ +- USE_RVV=ON \ +- TOOLCHAIN_PATH={TOOLCHAIN_PATH} \ +- QEMU_PREFIX_PATH={QEMU_PREFIX_PATH} \ +- ../../riscv_script/run_qemu.sh libyuv_unittest +- +- + ## Setup for Arm Cross compile + + See also https://www.ccoderun.ca/programming/2015-12-20_CrossCompiling/index.html +diff --git a/media/libyuv/libyuv/include/libyuv/compare_row.h b/media/libyuv/libyuv/include/libyuv/compare_row.h +--- a/media/libyuv/libyuv/include/libyuv/compare_row.h ++++ b/media/libyuv/libyuv/include/libyuv/compare_row.h +@@ -28,10 +28,7 @@ extern "C" { + #endif + // MemorySanitizer does not support assembly code yet. http://crbug.com/344505 + #if defined(__has_feature) +-#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_NEON) +-#define LIBYUV_DISABLE_NEON +-#endif +-#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_X86) ++#if __has_feature(memory_sanitizer) + #define LIBYUV_DISABLE_X86 + #endif + #endif +@@ -78,16 +75,8 @@ extern "C" { + // The following are available for Neon: + #if !defined(LIBYUV_DISABLE_NEON) && \ + (defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__)) ++#define HAS_SUMSQUAREERROR_NEON + #define HAS_HAMMINGDISTANCE_NEON +-#define HAS_SUMSQUAREERROR_NEON +-#endif +- +-// The following are available for AArch64 Neon: +-#if !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__) +-#define HAS_HASHDJB2_NEON +- +-#define HAS_HAMMINGDISTANCE_NEON_DOTPROD +-#define HAS_SUMSQUAREERROR_NEON_DOTPROD + #endif + + #if !defined(LIBYUV_DISABLE_MSA) && defined(__mips_msa) +@@ -110,9 +99,6 @@ uint32_t HammingDistance_AVX2(const uint + uint32_t HammingDistance_NEON(const uint8_t* src_a, + const uint8_t* src_b, + int count); +-uint32_t HammingDistance_NEON_DotProd(const uint8_t* src_a, +- const uint8_t* src_b, +- int count); + uint32_t HammingDistance_MSA(const uint8_t* src_a, + const uint8_t* src_b, + int count); +@@ -128,9 +114,6 @@ uint32_t SumSquareError_AVX2(const uint8 + uint32_t SumSquareError_NEON(const uint8_t* src_a, + const uint8_t* src_b, + int count); +-uint32_t SumSquareError_NEON_DotProd(const uint8_t* src_a, +- const uint8_t* src_b, +- int count); + uint32_t SumSquareError_MSA(const uint8_t* src_a, + const uint8_t* src_b, + int count); +@@ -138,7 +121,6 @@ uint32_t SumSquareError_MSA(const uint8_ + uint32_t HashDjb2_C(const uint8_t* src, int count, uint32_t seed); + uint32_t HashDjb2_SSE41(const uint8_t* src, int count, uint32_t seed); + uint32_t HashDjb2_AVX2(const uint8_t* src, int count, uint32_t seed); +-uint32_t HashDjb2_NEON(const uint8_t* src, int count, uint32_t seed); + + #ifdef __cplusplus + } // extern "C" +diff --git a/media/libyuv/libyuv/include/libyuv/convert.h b/media/libyuv/libyuv/include/libyuv/convert.h +--- a/media/libyuv/libyuv/include/libyuv/convert.h ++++ b/media/libyuv/libyuv/include/libyuv/convert.h +@@ -367,23 +367,6 @@ int I212ToI422(const uint16_t* src_y, + int width, + int height); + +-#define H212ToH420 I212ToI420 +-LIBYUV_API +-int I212ToI420(const uint16_t* src_y, +- int src_stride_y, +- const uint16_t* src_u, +- int src_stride_u, +- const uint16_t* src_v, +- int src_stride_v, +- uint8_t* dst_y, +- int dst_stride_y, +- uint8_t* dst_u, +- int dst_stride_u, +- uint8_t* dst_v, +- int dst_stride_v, +- int width, +- int height); +- + #define H412ToH444 I412ToI444 + LIBYUV_API + int I412ToI444(const uint16_t* src_y, +@@ -401,23 +384,6 @@ int I412ToI444(const uint16_t* src_y, + int width, + int height); + +-#define H412ToH420 I412ToI420 +-LIBYUV_API +-int I412ToI420(const uint16_t* src_y, +- int src_stride_y, +- const uint16_t* src_u, +- int src_stride_u, +- const uint16_t* src_v, +- int src_stride_v, +- uint8_t* dst_y, +- int dst_stride_y, +- uint8_t* dst_u, +- int dst_stride_u, +- uint8_t* dst_v, +- int dst_stride_v, +- int width, +- int height); +- + #define I412ToI012 I410ToI010 + #define H410ToH010 I410ToI010 + #define H412ToH012 I410ToI010 +@@ -785,21 +751,6 @@ int ARGBToI420(const uint8_t* src_argb, + int width, + int height); + +-// Convert ARGB to I420 with Alpha +-LIBYUV_API +-int ARGBToI420Alpha(const uint8_t* src_argb, +- int src_stride_argb, +- uint8_t* dst_y, +- int dst_stride_y, +- uint8_t* dst_u, +- int dst_stride_u, +- uint8_t* dst_v, +- int dst_stride_v, +- uint8_t* dst_a, +- int dst_stride_a, +- int width, +- int height); +- + // BGRA little endian (argb in memory) to I420. + LIBYUV_API + int BGRAToI420(const uint8_t* src_bgra, +diff --git a/media/libyuv/libyuv/include/libyuv/convert_argb.h b/media/libyuv/libyuv/include/libyuv/convert_argb.h +--- a/media/libyuv/libyuv/include/libyuv/convert_argb.h ++++ b/media/libyuv/libyuv/include/libyuv/convert_argb.h +@@ -67,8 +67,6 @@ LIBYUV_API extern const struct YuvConsta + I210ToAR30Matrix(a, b, e, f, c, d, g, h, i##VU, j, k) + #define I410ToAB30Matrix(a, b, c, d, e, f, g, h, i, j, k) \ + I410ToAR30Matrix(a, b, e, f, c, d, g, h, i##VU, j, k) +-#define I012ToAB30Matrix(a, b, c, d, e, f, g, h, i, j, k) \ +- I012ToAR30Matrix(a, b, e, f, c, d, g, h, i##VU, j, k) + #define I420AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, k, l, m, n) \ + I420AlphaToARGBMatrix(a, b, e, f, c, d, g, h, i, j, k##VU, l, m, n) + #define I422AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, k, l, m, n) \ +@@ -1904,26 +1902,6 @@ int NV21ToRGB24Matrix(const uint8_t* src + int width, + int height); + +-// Convert YUY2 to ARGB with matrix. +-LIBYUV_API +-int YUY2ToARGBMatrix(const uint8_t* src_yuy2, +- int src_stride_yuy2, +- uint8_t* dst_argb, +- int dst_stride_argb, +- const struct YuvConstants* yuvconstants, +- int width, +- int height); +- +-// Convert UYVY to ARGB with matrix. +-LIBYUV_API +-int UYVYToARGBMatrix(const uint8_t* src_uyvy, +- int src_stride_uyvy, +- uint8_t* dst_argb, +- int dst_stride_argb, +- const struct YuvConstants* yuvconstants, +- int width, +- int height); +- + // Convert Android420 to ARGB with matrix. + LIBYUV_API + int Android420ToARGBMatrix(const uint8_t* src_y, +diff --git a/media/libyuv/libyuv/include/libyuv/cpu_id.h b/media/libyuv/libyuv/include/libyuv/cpu_id.h +--- a/media/libyuv/libyuv/include/libyuv/cpu_id.h ++++ b/media/libyuv/libyuv/include/libyuv/cpu_id.h +@@ -21,52 +21,40 @@ extern "C" { + // Internal flag to indicate cpuid requires initialization. + static const int kCpuInitialized = 0x1; + +-// These flags are only valid on Arm processors. ++// These flags are only valid on ARM processors. + static const int kCpuHasARM = 0x2; + static const int kCpuHasNEON = 0x4; +-// Leave a gap to avoid setting kCpuHasX86. +-static const int kCpuHasNeonDotProd = 0x10; +-static const int kCpuHasNeonI8MM = 0x20; +-static const int kCpuHasSVE = 0x40; +-static const int kCpuHasSVE2 = 0x80; +-static const int kCpuHasSME = 0x100; ++// 0x8 reserved for future ARM flag. + + // These flags are only valid on x86 processors. +-static const int kCpuHasX86 = 0x8; +-static const int kCpuHasSSE2 = 0x10; +-static const int kCpuHasSSSE3 = 0x20; +-static const int kCpuHasSSE41 = 0x40; +-static const int kCpuHasSSE42 = 0x80; +-static const int kCpuHasAVX = 0x100; +-static const int kCpuHasAVX2 = 0x200; +-static const int kCpuHasERMS = 0x400; +-static const int kCpuHasFMA3 = 0x800; +-static const int kCpuHasF16C = 0x1000; +-static const int kCpuHasAVX512BW = 0x2000; +-static const int kCpuHasAVX512VL = 0x4000; +-static const int kCpuHasAVX512VNNI = 0x8000; +-static const int kCpuHasAVX512VBMI = 0x10000; +-static const int kCpuHasAVX512VBMI2 = 0x20000; +-static const int kCpuHasAVX512VBITALG = 0x40000; +-static const int kCpuHasAVX10 = 0x80000; +-static const int kCpuHasAVXVNNI = 0x100000; +-static const int kCpuHasAVXVNNIINT8 = 0x200000; +-static const int kCpuHasAMXINT8 = 0x400000; ++static const int kCpuHasX86 = 0x10; ++static const int kCpuHasSSE2 = 0x20; ++static const int kCpuHasSSSE3 = 0x40; ++static const int kCpuHasSSE41 = 0x80; ++static const int kCpuHasSSE42 = 0x100; // unused at this time. ++static const int kCpuHasAVX = 0x200; ++static const int kCpuHasAVX2 = 0x400; ++static const int kCpuHasERMS = 0x800; ++static const int kCpuHasFMA3 = 0x1000; ++static const int kCpuHasF16C = 0x2000; ++static const int kCpuHasGFNI = 0x4000; ++static const int kCpuHasAVX512BW = 0x8000; ++static const int kCpuHasAVX512VL = 0x10000; ++static const int kCpuHasAVX512VNNI = 0x20000; ++static const int kCpuHasAVX512VBMI = 0x40000; ++static const int kCpuHasAVX512VBMI2 = 0x80000; ++static const int kCpuHasAVX512VBITALG = 0x100000; ++static const int kCpuHasAVX512VPOPCNTDQ = 0x200000; + + // These flags are only valid on MIPS processors. +-static const int kCpuHasMIPS = 0x800000; +-static const int kCpuHasMSA = 0x1000000; ++static const int kCpuHasMIPS = 0x400000; ++static const int kCpuHasMSA = 0x800000; + + // These flags are only valid on LOONGARCH processors. + static const int kCpuHasLOONGARCH = 0x2000000; + static const int kCpuHasLSX = 0x4000000; + static const int kCpuHasLASX = 0x8000000; + +-// These flags are only valid on RISCV processors. +-static const int kCpuHasRISCV = 0x10000000; +-static const int kCpuHasRVV = 0x20000000; +-static const int kCpuHasRVVZVFH = 0x40000000; +- + // Optional init function. TestCpuFlag does an auto-init. + // Returns cpu_info flags. + LIBYUV_API +@@ -90,19 +78,6 @@ LIBYUV_API + int ArmCpuCaps(const char* cpuinfo_name); + LIBYUV_API + int MipsCpuCaps(const char* cpuinfo_name); +-LIBYUV_API +-int RiscvCpuCaps(const char* cpuinfo_name); +- +-#ifdef __aarch64__ +-#if __linux__ +-// On Linux, parse AArch64 features from getauxval(AT_HWCAP{,2}). +-LIBYUV_API +-int AArch64CpuCaps(unsigned long hwcap, unsigned long hwcap2); +-#else +-LIBYUV_API +-int AArch64CpuCaps(); +-#endif +-#endif + + // For testing, allow CPU flags to be disabled. + // ie MaskCpuFlags(~kCpuHasSSSE3) to disable SSSE3. +diff --git a/media/libyuv/libyuv/include/libyuv/macros_msa.h b/media/libyuv/libyuv/include/libyuv/macros_msa.h +--- a/media/libyuv/libyuv/include/libyuv/macros_msa.h ++++ b/media/libyuv/libyuv/include/libyuv/macros_msa.h +@@ -20,9 +20,9 @@ + ({ \ + const uint8_t* psrc_lw_m = (const uint8_t*)(psrc); \ + uint32_t val_m; \ +- asm("lw %[val_m], %[psrc_lw_m] \n" \ +- : [val_m] "=r"(val_m) \ +- : [psrc_lw_m] "m"(*psrc_lw_m)); \ ++ asm volatile("lw %[val_m], %[psrc_lw_m] \n" \ ++ : [val_m] "=r"(val_m) \ ++ : [psrc_lw_m] "m"(*psrc_lw_m)); \ + val_m; \ + }) + +@@ -31,9 +31,9 @@ + ({ \ + const uint8_t* psrc_ld_m = (const uint8_t*)(psrc); \ + uint64_t val_m = 0; \ +- asm("ld %[val_m], %[psrc_ld_m] \n" \ +- : [val_m] "=r"(val_m) \ +- : [psrc_ld_m] "m"(*psrc_ld_m)); \ ++ asm volatile("ld %[val_m], %[psrc_ld_m] \n" \ ++ : [val_m] "=r"(val_m) \ ++ : [psrc_ld_m] "m"(*psrc_ld_m)); \ + val_m; \ + }) + #else // !(__mips == 64) +@@ -55,9 +55,9 @@ + ({ \ + uint8_t* pdst_sw_m = (uint8_t*)(pdst); /* NOLINT */ \ + uint32_t val_m = (val); \ +- asm("sw %[val_m], %[pdst_sw_m] \n" \ +- : [pdst_sw_m] "=m"(*pdst_sw_m) \ +- : [val_m] "r"(val_m)); \ ++ asm volatile("sw %[val_m], %[pdst_sw_m] \n" \ ++ : [pdst_sw_m] "=m"(*pdst_sw_m) \ ++ : [val_m] "r"(val_m)); \ + }) + + #if (__mips == 64) +@@ -65,9 +65,9 @@ + ({ \ + uint8_t* pdst_sd_m = (uint8_t*)(pdst); /* NOLINT */ \ + uint64_t val_m = (val); \ +- asm("sd %[val_m], %[pdst_sd_m] \n" \ +- : [pdst_sd_m] "=m"(*pdst_sd_m) \ +- : [val_m] "r"(val_m)); \ ++ asm volatile("sd %[val_m], %[pdst_sd_m] \n" \ ++ : [pdst_sd_m] "=m"(*pdst_sd_m) \ ++ : [val_m] "r"(val_m)); \ + }) + #else // !(__mips == 64) + #define SD(val, pdst) \ +@@ -86,7 +86,8 @@ + uint8_t* psrc_lw_m = (uint8_t*)(psrc); \ + uint32_t val_lw_m; \ + \ +- asm("lwr %[val_lw_m], 0(%[psrc_lw_m]) \n\t" \ ++ __asm__ volatile( \ ++ "lwr %[val_lw_m], 0(%[psrc_lw_m]) \n\t" \ + "lwl %[val_lw_m], 3(%[psrc_lw_m]) \n\t" \ + \ + : [val_lw_m] "=&r"(val_lw_m) \ +@@ -101,7 +102,8 @@ + uint8_t* psrc_ld_m = (uint8_t*)(psrc); \ + uint64_t val_ld_m = 0; \ + \ +- asm("ldr %[val_ld_m], 0(%[psrc_ld_m]) \n\t" \ ++ __asm__ volatile( \ ++ "ldr %[val_ld_m], 0(%[psrc_ld_m]) \n\t" \ + "ldl %[val_ld_m], 7(%[psrc_ld_m]) \n\t" \ + \ + : [val_ld_m] "=&r"(val_ld_m) \ +@@ -128,9 +130,9 @@ + ({ \ + uint8_t* pdst_sw_m = (uint8_t*)(pdst); /* NOLINT */ \ + uint32_t val_m = (val); \ +- asm("usw %[val_m], %[pdst_sw_m] \n" \ +- : [pdst_sw_m] "=m"(*pdst_sw_m) \ +- : [val_m] "r"(val_m)); \ ++ asm volatile("usw %[val_m], %[pdst_sw_m] \n" \ ++ : [pdst_sw_m] "=m"(*pdst_sw_m) \ ++ : [val_m] "r"(val_m)); \ + }) + + #define SD(val, pdst) \ +diff --git a/media/libyuv/libyuv/include/libyuv/planar_functions.h b/media/libyuv/libyuv/include/libyuv/planar_functions.h +--- a/media/libyuv/libyuv/include/libyuv/planar_functions.h ++++ b/media/libyuv/libyuv/include/libyuv/planar_functions.h +@@ -30,10 +30,7 @@ extern "C" { + #endif + // MemorySanitizer does not support assembly code yet. http://crbug.com/344505 + #if defined(__has_feature) +-#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_NEON) +-#define LIBYUV_DISABLE_NEON +-#endif +-#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_X86) ++#if __has_feature(memory_sanitizer) + #define LIBYUV_DISABLE_X86 + #endif + #endif +@@ -830,6 +827,15 @@ int ARGBCopyYToAlpha(const uint8_t* src_ + int width, + int height); + ++typedef void (*ARGBBlendRow)(const uint8_t* src_argb0, ++ const uint8_t* src_argb1, ++ uint8_t* dst_argb, ++ int width); ++ ++// Get function to Alpha Blend ARGB pixels and store to destination. ++LIBYUV_API ++ARGBBlendRow GetARGBBlend(); ++ + // Alpha Blend ARGB images and store to destination. + // Source is pre-multiplied by alpha using ARGBAttenuate. + // Alpha of destination is set to 255. +diff --git a/media/libyuv/libyuv/include/libyuv/rotate_row.h b/media/libyuv/libyuv/include/libyuv/rotate_row.h +--- a/media/libyuv/libyuv/include/libyuv/rotate_row.h ++++ b/media/libyuv/libyuv/include/libyuv/rotate_row.h +@@ -28,10 +28,7 @@ extern "C" { + #endif + // MemorySanitizer does not support assembly code yet. http://crbug.com/344505 + #if defined(__has_feature) +-#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_NEON) +-#define LIBYUV_DISABLE_NEON +-#endif +-#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_X86) ++#if __has_feature(memory_sanitizer) + #define LIBYUV_DISABLE_X86 + #endif + #endif +@@ -45,8 +42,6 @@ extern "C" { + // The following are available for GCC 32 or 64 bit: + #if !defined(LIBYUV_DISABLE_X86) && (defined(__i386__) || defined(__x86_64__)) + #define HAS_TRANSPOSEWX8_SSSE3 +-#define HAS_TRANSPOSE4X4_32_SSE2 +-#define HAS_TRANSPOSE4X4_32_AVX2 + #endif + + // The following are available for 64 bit GCC: +@@ -57,13 +52,8 @@ extern "C" { + + #if !defined(LIBYUV_DISABLE_NEON) && \ + (defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__)) +-#if defined(__aarch64__) +-#define HAS_TRANSPOSEWX16_NEON +-#else + #define HAS_TRANSPOSEWX8_NEON +-#endif + #define HAS_TRANSPOSEUVWX8_NEON +-#define HAS_TRANSPOSE4X4_32_NEON + #endif + + #if !defined(LIBYUV_DISABLE_MSA) && defined(__mips_msa) +@@ -98,11 +88,6 @@ void TransposeWx8_NEON(const uint8_t* sr + uint8_t* dst, + int dst_stride, + int width); +-void TransposeWx16_NEON(const uint8_t* src, +- int src_stride, +- uint8_t* dst, +- int dst_stride, +- int width); + void TransposeWx8_SSSE3(const uint8_t* src, + int src_stride, + uint8_t* dst, +@@ -129,11 +114,6 @@ void TransposeWx8_Any_NEON(const uint8_t + uint8_t* dst, + int dst_stride, + int width); +-void TransposeWx16_Any_NEON(const uint8_t* src, +- int src_stride, +- uint8_t* dst, +- int dst_stride, +- int width); + void TransposeWx8_Any_SSSE3(const uint8_t* src, + int src_stride, + uint8_t* dst, +@@ -260,24 +240,19 @@ void Transpose4x4_32_NEON(const uint8_t* + int dst_stride, + int width); + +-void Transpose4x4_32_SSE2(const uint8_t* src, +- int src_stride, +- uint8_t* dst, +- int dst_stride, +- int width); +- +-void Transpose4x4_32_AVX2(const uint8_t* src, +- int src_stride, +- uint8_t* dst, +- int dst_stride, +- int width); +- + void Transpose4x4_32_C(const uint8_t* src, + int src_stride, + uint8_t* dst, + int dst_stride, + int width); + ++// Transpose 32 bit values (ARGB) ++void Transpose8x8_32_NEON(const uint8_t* src, ++ int src_stride, ++ uint8_t* dst, ++ int dst_stride, ++ int width); ++ + #ifdef __cplusplus + } // extern "C" + } // namespace libyuv +diff --git a/media/libyuv/libyuv/include/libyuv/row.h b/media/libyuv/libyuv/include/libyuv/row.h +--- a/media/libyuv/libyuv/include/libyuv/row.h ++++ b/media/libyuv/libyuv/include/libyuv/row.h +@@ -31,10 +31,7 @@ extern "C" { + #endif + // MemorySanitizer does not support assembly code yet. http://crbug.com/344505 + #if defined(__has_feature) +-#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_NEON) +-#define LIBYUV_DISABLE_NEON +-#endif +-#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_X86) ++#if __has_feature(memory_sanitizer) + #define LIBYUV_DISABLE_X86 + #endif + #endif +@@ -164,6 +161,7 @@ extern "C" { + #define HAS_ARGBSEPIAROW_SSSE3 + #define HAS_ARGBSHADEROW_SSE2 + #define HAS_ARGBSUBTRACTROW_SSE2 ++#define HAS_ARGBUNATTENUATEROW_SSE2 + #define HAS_BLENDPLANEROW_SSSE3 + #define HAS_COMPUTECUMULATIVESUMROW_SSE2 + #define HAS_CUMULATIVESUMTOAVERAGEROW_SSE2 +@@ -173,6 +171,9 @@ extern "C" { + #define HAS_SOBELXROW_SSE2 + #define HAS_SOBELXYROW_SSE2 + #define HAS_SOBELYROW_SSE2 ++#if !defined(LIBYUV_BIT_EXACT) ++#define HAS_ARGBATTENUATEROW_SSSE3 ++#endif + + // The following functions fail on gcc/clang 32 bit with fpic and framepointer. + // caveat: clangcl uses row_win.cc which works. +@@ -241,7 +242,11 @@ extern "C" { + #define HAS_ARGBADDROW_AVX2 + #define HAS_ARGBMULTIPLYROW_AVX2 + #define HAS_ARGBSUBTRACTROW_AVX2 ++#define HAS_ARGBUNATTENUATEROW_AVX2 + #define HAS_BLENDPLANEROW_AVX2 ++#if !defined(LIBYUV_BIT_EXACT) ++#define HAS_ARGBATTENUATEROW_AVX2 ++#endif + + #if !defined(MOZ_PROFILING) && \ + (defined(__x86_64__) || !defined(__pic__) || defined(__clang__) || \ +@@ -282,15 +287,14 @@ extern "C" { + #define HAS_ABGRTOAR30ROW_SSSE3 + #define HAS_ABGRTOYJROW_SSSE3 + #define HAS_AR64TOARGBROW_SSSE3 +-#define HAS_ARGBATTENUATEROW_SSSE3 + #define HAS_ARGBTOAB64ROW_SSSE3 + #define HAS_ARGBTOAR30ROW_SSSE3 + #define HAS_ARGBTOAR64ROW_SSSE3 +-#define HAS_ARGBUNATTENUATEROW_SSE2 + #define HAS_CONVERT16TO8ROW_SSSE3 + #define HAS_CONVERT8TO16ROW_SSE2 ++#define HAS_DETILEROW_SSE2 + #define HAS_DETILEROW_16_SSE2 +-#define HAS_DETILEROW_SSE2 ++#define HAS_DETILEROW_16_AVX + #define HAS_DETILESPLITUVROW_SSSE3 + #define HAS_DETILETOYUY2_SSE2 + #define HAS_HALFMERGEUVROW_SSSE3 +@@ -343,16 +347,13 @@ extern "C" { + #define HAS_ABGRTOYJROW_AVX2 + #define HAS_ABGRTOYROW_AVX2 + #define HAS_AR64TOARGBROW_AVX2 +-#define HAS_ARGBATTENUATEROW_AVX2 + #define HAS_ARGBTOAB64ROW_AVX2 + #define HAS_ARGBTOAR30ROW_AVX2 + #define HAS_ARGBTOAR64ROW_AVX2 + #define HAS_ARGBTORAWROW_AVX2 + #define HAS_ARGBTORGB24ROW_AVX2 +-#define HAS_ARGBUNATTENUATEROW_AVX2 + #define HAS_CONVERT16TO8ROW_AVX2 + #define HAS_CONVERT8TO16ROW_AVX2 +-#define HAS_DETILEROW_16_AVX + #define HAS_DIVIDEROW_16_AVX2 + #define HAS_HALFMERGEUVROW_AVX2 + #define HAS_I210TOAR30ROW_AVX2 +@@ -403,8 +404,9 @@ extern "C" { + // The following are available for AVX512 clang x86 platforms: + // TODO(fbarchard): Port to GCC and Visual C + // TODO(fbarchard): re-enable HAS_ARGBTORGB24ROW_AVX512VBMI. Issue libyuv:789 ++// TODO(fbarchard): Port MERGEUV to assembly + #if !defined(LIBYUV_DISABLE_X86) && \ +- (defined(__x86_64__) || defined(__i386__)) && defined(CLANG_HAS_AVX512) ++ (defined(__x86_64__) || defined(__i386__)) && (defined(CLANG_HAS_AVX512) && !defined(_MSC_VER)) + #define HAS_ARGBTORGB24ROW_AVX512VBMI + #define HAS_MERGEUVROW_AVX512BW + #endif +@@ -555,53 +557,6 @@ extern "C" { + + // The following are available on AArch64 platforms: + #if !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__) +-#define HAS_ARGBTOAR30ROW_NEON +-#define HAS_ABGRTOAR30ROW_NEON +-#define HAS_I210ALPHATOARGBROW_NEON +-#define HAS_I410ALPHATOARGBROW_NEON +-#define HAS_I210TOARGBROW_NEON +-#define HAS_I410TOARGBROW_NEON +-#define HAS_I210TOAR30ROW_NEON +-#define HAS_I410TOAR30ROW_NEON +- +-#define HAS_ABGRTOYJROW_NEON_DOTPROD +-#define HAS_ABGRTOYROW_NEON_DOTPROD +-#define HAS_ARGBTOYJROW_NEON_DOTPROD +-#define HAS_ARGBTOYROW_NEON_DOTPROD +-#define HAS_BGRATOYROW_NEON_DOTPROD +-#define HAS_RGBATOYJROW_NEON_DOTPROD +-#define HAS_RGBATOYROW_NEON_DOTPROD +- +-#define HAS_ARGBCOLORMATRIXROW_NEON_I8MM +-#endif +- +-// The following are available on AArch64 SVE platforms: +-#if !defined(LIBYUV_DISABLE_SVE) && defined(__aarch64__) +-#define HAS_ABGRTOUVJROW_SVE2 +-#define HAS_ABGRTOUVROW_SVE2 +-#define HAS_ARGB1555TOARGBROW_SVE2 +-#define HAS_ARGBTORGB565DITHERROW_SVE2 +-#define HAS_ARGBTORGB565ROW_SVE2 +-#define HAS_ARGBTOUVJROW_SVE2 +-#define HAS_ARGBTOUVROW_SVE2 +-#define HAS_AYUVTOUVROW_SVE2 +-#define HAS_AYUVTOVUROW_SVE2 +-#define HAS_BGRATOUVROW_SVE2 +-#define HAS_I400TOARGBROW_SVE2 +-#define HAS_I422ALPHATOARGBROW_SVE2 +-#define HAS_I422TOARGBROW_SVE2 +-#define HAS_I422TORGBAROW_SVE2 +-#define HAS_I444ALPHATOARGBROW_SVE2 +-#define HAS_I444TOARGBROW_SVE2 +-#define HAS_NV12TOARGBROW_SVE2 +-#define HAS_NV21TOARGBROW_SVE2 +-#define HAS_RGBATOUVROW_SVE2 +-#define HAS_UYVYTOARGBROW_SVE2 +-#define HAS_YUY2TOARGBROW_SVE2 +-#endif +- +-// The following are available on AArch64 platforms: +-#if !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__) + #define HAS_GAUSSCOL_F32_NEON + #define HAS_GAUSSROW_F32_NEON + #define HAS_INTERPOLATEROW_16TO8_NEON +@@ -698,47 +653,20 @@ extern "C" { + #define HAS_ARGB1555TOUVROW_LSX + #define HAS_ARGB1555TOYROW_LSX + #define HAS_ARGB4444TOARGBROW_LSX +-#define HAS_ARGBADDROW_LSX +-#define HAS_ARGBATTENUATEROW_LSX + #define HAS_ARGBBLENDROW_LSX + #define HAS_ARGBCOLORMATRIXROW_LSX + #define HAS_ARGBEXTRACTALPHAROW_LSX +-#define HAS_ARGBGRAYROW_LSX +-#define HAS_ARGBSEPIAROW_LSX +-#define HAS_ARGBSHADEROW_LSX +-#define HAS_ARGBSHUFFLEROW_LSX +-#define HAS_ARGBSUBTRACTROW_LSX + #define HAS_ARGBQUANTIZEROW_LSX + #define HAS_ARGBSETROW_LSX +-#define HAS_ARGBTOARGB1555ROW_LSX +-#define HAS_ARGBTOARGB4444ROW_LSX +-#define HAS_ARGBTORAWROW_LSX +-#define HAS_ARGBTORGB24ROW_LSX +-#define HAS_ARGBTORGB565ROW_LSX +-#define HAS_ARGBTORGB565DITHERROW_LSX + #define HAS_ARGBTOUVJROW_LSX +-#define HAS_ARGBTOUV444ROW_LSX +-#define HAS_ARGBTOUVROW_LSX + #define HAS_ARGBTOYJROW_LSX +-#define HAS_ARGBMIRRORROW_LSX +-#define HAS_ARGBMULTIPLYROW_LSX + #define HAS_BGRATOUVROW_LSX + #define HAS_BGRATOYROW_LSX + #define HAS_I400TOARGBROW_LSX + #define HAS_I444TOARGBROW_LSX + #define HAS_INTERPOLATEROW_LSX +-#define HAS_I422ALPHATOARGBROW_LSX +-#define HAS_I422TOARGB1555ROW_LSX +-#define HAS_I422TOARGB4444ROW_LSX +-#define HAS_I422TORGB24ROW_LSX +-#define HAS_I422TORGB565ROW_LSX +-#define HAS_I422TORGBAROW_LSX +-#define HAS_I422TOUYVYROW_LSX +-#define HAS_I422TOYUY2ROW_LSX + #define HAS_J400TOARGBROW_LSX + #define HAS_MERGEUVROW_LSX +-#define HAS_MIRRORROW_LSX +-#define HAS_MIRRORUVROW_LSX + #define HAS_MIRRORSPLITUVROW_LSX + #define HAS_NV12TOARGBROW_LSX + #define HAS_NV12TORGB565ROW_LSX +@@ -761,13 +689,7 @@ extern "C" { + #define HAS_SOBELXYROW_LSX + #define HAS_SPLITUVROW_LSX + #define HAS_UYVYTOARGBROW_LSX +-#define HAS_UYVYTOUV422ROW_LSX +-#define HAS_UYVYTOUVROW_LSX +-#define HAS_UYVYTOYROW_LSX + #define HAS_YUY2TOARGBROW_LSX +-#define HAS_YUY2TOUVROW_LSX +-#define HAS_YUY2TOUV422ROW_LSX +-#define HAS_YUY2TOYROW_LSX + #define HAS_ARGBTOYROW_LSX + #define HAS_ABGRTOYJROW_LSX + #define HAS_RGBATOYJROW_LSX +@@ -775,10 +697,6 @@ extern "C" { + #define HAS_RAWTOYJROW_LSX + #endif + +-#if !defined(LIBYUV_DISABLE_LSX) && defined(__loongarch_sx) +-#define HAS_I422TOARGBROW_LSX +-#endif +- + #if !defined(LIBYUV_DISABLE_LASX) && defined(__loongarch_asx) + #define HAS_ARGB1555TOARGBROW_LASX + #define HAS_ARGB1555TOUVROW_LASX +@@ -842,74 +760,6 @@ extern "C" { + #define HAS_RAWTOYJROW_LASX + #endif + +-#if !defined(LIBYUV_DISABLE_RVV) && defined(__riscv_vector) +-#if __riscv_v_intrinsic > 11000 +-// Since v0.12, TUPLE_TYPE is introduced for segment load and store. +-#define LIBYUV_RVV_HAS_TUPLE_TYPE +-// Since v0.12, VXRM(fixed-point rounding mode) is included in arguments of +-// fixed-point intrinsics. +-#define LIBYUV_RVV_HAS_VXRM_ARG +-#endif +- +-#define HAS_COPYROW_RVV +-#define HAS_AB64TOARGBROW_RVV +-#define HAS_ABGRTOYJROW_RVV +-#define HAS_ABGRTOYROW_RVV +-#define HAS_AR64TOARGBROW_RVV +-#define HAS_AR64TOAB64ROW_RVV +-#define HAS_ARGBATTENUATEROW_RVV +-#define HAS_ARGBBLENDROW_RVV +-#define HAS_ARGBCOPYYTOALPHAROW_RVV +-#define HAS_ARGBEXTRACTALPHAROW_RVV +-#define HAS_ARGBTOAB64ROW_RVV +-#define HAS_ARGBTOABGRROW_RVV +-#define HAS_ARGBTOAR64ROW_RVV +-#define HAS_ARGBTOBGRAROW_RVV +-#define HAS_ARGBTORAWROW_RVV +-#define HAS_ARGBTORGB24ROW_RVV +-#define HAS_ARGBTORGBAROW_RVV +-#define HAS_ARGBTOYJROW_RVV +-#define HAS_ARGBTOYMATRIXROW_RVV +-#define HAS_ARGBTOYROW_RVV +-#define HAS_BGRATOYROW_RVV +-#define HAS_BLENDPLANEROW_RVV +-#define HAS_I400TOARGBROW_RVV +-#define HAS_I422ALPHATOARGBROW_RVV +-#define HAS_I422TOARGBROW_RVV +-#define HAS_I422TORGB24ROW_RVV +-#define HAS_I422TORGBAROW_RVV +-#define HAS_I444ALPHATOARGBROW_RVV +-#define HAS_I444TOARGBROW_RVV +-#define HAS_I444TORGB24ROW_RVV +-#define HAS_INTERPOLATEROW_RVV +-#define HAS_J400TOARGBROW_RVV +-#define HAS_MERGEARGBROW_RVV +-#define HAS_MERGERGBROW_RVV +-#define HAS_MERGEUVROW_RVV +-#define HAS_MERGEXRGBROW_RVV +-#define HAS_NV12TOARGBROW_RVV +-#define HAS_NV12TORGB24ROW_RVV +-#define HAS_NV21TOARGBROW_RVV +-#define HAS_NV21TORGB24ROW_RVV +-#define HAS_RAWTOARGBROW_RVV +-#define HAS_RAWTORGB24ROW_RVV +-#define HAS_RAWTORGBAROW_RVV +-#define HAS_RAWTOYJROW_RVV +-#define HAS_RAWTOYROW_RVV +-#define HAS_RGB24TOARGBROW_RVV +-#define HAS_RGB24TOYJROW_RVV +-#define HAS_RGB24TOYROW_RVV +-#define HAS_RGBATOARGBROW_RVV +-#define HAS_RGBATOYJROW_RVV +-#define HAS_RGBATOYMATRIXROW_RVV +-#define HAS_RGBATOYROW_RVV +-#define HAS_RGBTOYMATRIXROW_RVV +-#define HAS_SPLITARGBROW_RVV +-#define HAS_SPLITRGBROW_RVV +-#define HAS_SPLITUVROW_RVV +-#define HAS_SPLITXRGBROW_RVV +-#endif +- + #if defined(_MSC_VER) && !defined(__CLR_VER) && !defined(__clang__) + #if defined(VISUALC_HAS_AVX2) + #define SIMD_ALIGNED(var) __declspec(align(32)) var +@@ -969,8 +819,8 @@ typedef uint32_t ulvec32[8]; + typedef uint8_t ulvec8[32]; + #endif + +-#if defined(__aarch64__) || defined(__arm__) || defined(__riscv) +-// This struct is for ARM and RISC-V color conversion. ++#if defined(__aarch64__) || defined(__arm__) ++// This struct is for ARM color conversion. + struct YuvConstants { + uvec8 kUVCoeff; + vec16 kRGBCoeffBias; +@@ -1004,6 +854,14 @@ struct YuvConstants { + free(var##_mem); \ + var = NULL + ++#define align_buffer_64_16(var, size) \ ++ void* var##_mem = malloc((size)*2 + 63); /* NOLINT */ \ ++ uint16_t* var = (uint16_t*)(((intptr_t)var##_mem + 63) & ~63) /* NOLINT */ ++ ++#define free_aligned_buffer_64_16(var) \ ++ free(var##_mem); \ ++ var = NULL ++ + #if defined(__APPLE__) || defined(__x86_64__) || defined(__llvm__) + #define OMITFP + #else +@@ -1068,74 +926,24 @@ struct YuvConstants { + IACA_UD_BYTES \ + } + +-void I210AlphaToARGBRow_NEON(const uint16_t* src_y, +- const uint16_t* src_u, +- const uint16_t* src_v, +- const uint16_t* src_a, +- uint8_t* rgb_buf, +- const struct YuvConstants* yuvconstants, +- int width); +-void I410AlphaToARGBRow_NEON(const uint16_t* src_y, +- const uint16_t* src_u, +- const uint16_t* src_v, +- const uint16_t* src_a, +- uint8_t* rgb_buf, +- const struct YuvConstants* yuvconstants, +- int width); + void I444ToARGBRow_NEON(const uint8_t* src_y, + const uint8_t* src_u, + const uint8_t* src_v, + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +-void I444ToARGBRow_SVE2(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width); + void I444ToRGB24Row_NEON(const uint8_t* src_y, + const uint8_t* src_u, + const uint8_t* src_v, + uint8_t* dst_rgb24, + const struct YuvConstants* yuvconstants, + int width); +-void I210ToARGBRow_NEON(const uint16_t* src_y, +- const uint16_t* src_u, +- const uint16_t* src_v, +- uint8_t* rgb_buf, +- const struct YuvConstants* yuvconstants, +- int width); +-void I410ToARGBRow_NEON(const uint16_t* src_y, +- const uint16_t* src_u, +- const uint16_t* src_v, +- uint8_t* rgb_buf, +- const struct YuvConstants* yuvconstants, +- int width); +-void I210ToAR30Row_NEON(const uint16_t* src_y, +- const uint16_t* src_u, +- const uint16_t* src_v, +- uint8_t* rgb_buf, +- const struct YuvConstants* yuvconstants, +- int width); +-void I410ToAR30Row_NEON(const uint16_t* src_y, +- const uint16_t* src_u, +- const uint16_t* src_v, +- uint8_t* rgb_buf, +- const struct YuvConstants* yuvconstants, +- int width); + void I422ToARGBRow_NEON(const uint8_t* src_y, + const uint8_t* src_u, + const uint8_t* src_v, + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +-void I422ToARGBRow_SVE2(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width); + void I444AlphaToARGBRow_NEON(const uint8_t* src_y, + const uint8_t* src_u, + const uint8_t* src_v, +@@ -1143,13 +951,6 @@ void I444AlphaToARGBRow_NEON(const uint8 + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +-void I444AlphaToARGBRow_SVE2(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- const uint8_t* src_a, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width); + void I422AlphaToARGBRow_NEON(const uint8_t* src_y, + const uint8_t* src_u, + const uint8_t* src_v, +@@ -1157,25 +958,12 @@ void I422AlphaToARGBRow_NEON(const uint8 + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +-void I422AlphaToARGBRow_SVE2(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- const uint8_t* src_a, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width); + void I422ToRGBARow_NEON(const uint8_t* src_y, + const uint8_t* src_u, + const uint8_t* src_v, + uint8_t* dst_rgba, + const struct YuvConstants* yuvconstants, + int width); +-void I422ToRGBARow_SVE2(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_rgba, +- const struct YuvConstants* yuvconstants, +- int width); + void I422ToRGB24Row_NEON(const uint8_t* src_y, + const uint8_t* src_u, + const uint8_t* src_v, +@@ -1205,11 +993,6 @@ void NV12ToARGBRow_NEON(const uint8_t* s + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +-void NV12ToARGBRow_SVE2(const uint8_t* src_y, +- const uint8_t* src_uv, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width); + void NV12ToRGB565Row_NEON(const uint8_t* src_y, + const uint8_t* src_uv, + uint8_t* dst_rgb565, +@@ -1220,11 +1003,6 @@ void NV21ToARGBRow_NEON(const uint8_t* s + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +-void NV21ToARGBRow_SVE2(const uint8_t* src_y, +- const uint8_t* src_vu, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width); + void NV12ToRGB24Row_NEON(const uint8_t* src_y, + const uint8_t* src_uv, + uint8_t* dst_rgb24, +@@ -1243,62 +1021,10 @@ void YUY2ToARGBRow_NEON(const uint8_t* s + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +-void YUY2ToARGBRow_SVE2(const uint8_t* src_yuy2, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width); + void UYVYToARGBRow_NEON(const uint8_t* src_uyvy, + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +-void UYVYToARGBRow_SVE2(const uint8_t* src_uyvy, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width); +-void I444ToARGBRow_RVV(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width); +-void I444AlphaToARGBRow_RVV(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- const uint8_t* src_a, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width); +-void I444ToRGB24Row_RVV(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_rgb24, +- const struct YuvConstants* yuvconstants, +- int width); +-void I422ToARGBRow_RVV(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width); +-void I422AlphaToARGBRow_RVV(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- const uint8_t* src_a, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width); +-void I422ToRGBARow_RVV(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_rgba, +- const struct YuvConstants* yuvconstants, +- int width); +-void I422ToRGB24Row_RVV(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_rgb24, +- const struct YuvConstants* yuvconstants, +- int width); + void I444ToARGBRow_MSA(const uint8_t* src_y, + const uint8_t* src_u, + const uint8_t* src_v, +@@ -1318,12 +1044,6 @@ void I422ToARGBRow_MSA(const uint8_t* sr + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +-void I422ToARGBRow_LSX(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width); + void I422ToARGBRow_LASX(const uint8_t* src_y, + const uint8_t* src_u, + const uint8_t* src_v, +@@ -1336,12 +1056,6 @@ void I422ToRGBARow_MSA(const uint8_t* sr + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +-void I422ToRGBARow_LSX(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width); + void I422ToRGBARow_LASX(const uint8_t* src_y, + const uint8_t* src_u, + const uint8_t* src_v, +@@ -1355,13 +1069,6 @@ void I422AlphaToARGBRow_MSA(const uint8_ + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +-void I422AlphaToARGBRow_LSX(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- const uint8_t* src_a, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width); + void I422AlphaToARGBRow_LASX(const uint8_t* src_y, + const uint8_t* src_u, + const uint8_t* src_v, +@@ -1375,12 +1082,6 @@ void I422ToRGB24Row_MSA(const uint8_t* s + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +-void I422ToRGB24Row_LSX(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width); + void I422ToRGB24Row_LASX(const uint8_t* src_y, + const uint8_t* src_u, + const uint8_t* src_v, +@@ -1393,12 +1094,6 @@ void I422ToRGB565Row_MSA(const uint8_t* + uint8_t* dst_rgb565, + const struct YuvConstants* yuvconstants, + int width); +-void I422ToRGB565Row_LSX(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_rgb565, +- const struct YuvConstants* yuvconstants, +- int width); + void I422ToRGB565Row_LASX(const uint8_t* src_y, + const uint8_t* src_u, + const uint8_t* src_v, +@@ -1411,12 +1106,6 @@ void I422ToARGB4444Row_MSA(const uint8_t + uint8_t* dst_argb4444, + const struct YuvConstants* yuvconstants, + int width); +-void I422ToARGB4444Row_LSX(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_argb4444, +- const struct YuvConstants* yuvconstants, +- int width); + void I422ToARGB4444Row_LASX(const uint8_t* src_y, + const uint8_t* src_u, + const uint8_t* src_v, +@@ -1429,12 +1118,6 @@ void I422ToARGB1555Row_MSA(const uint8_t + uint8_t* dst_argb1555, + const struct YuvConstants* yuvconstants, + int width); +-void I422ToARGB1555Row_LSX(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_argb1555, +- const struct YuvConstants* yuvconstants, +- int width); + void I422ToARGB1555Row_LASX(const uint8_t* src_y, + const uint8_t* src_u, + const uint8_t* src_v, +@@ -1503,26 +1186,6 @@ void UYVYToARGBRow_LSX(const uint8_t* sr + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +-void NV12ToARGBRow_RVV(const uint8_t* src_y, +- const uint8_t* src_uv, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width); +-void NV21ToARGBRow_RVV(const uint8_t* src_y, +- const uint8_t* src_vu, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width); +-void NV12ToRGB24Row_RVV(const uint8_t* src_y, +- const uint8_t* src_uv, +- uint8_t* dst_rgb24, +- const struct YuvConstants* yuvconstants, +- int width); +-void NV21ToRGB24Row_RVV(const uint8_t* src_y, +- const uint8_t* src_vu, +- uint8_t* dst_rgb24, +- const struct YuvConstants* yuvconstants, +- int width); + + void ARGBToYRow_AVX2(const uint8_t* src_argb, uint8_t* dst_y, int width); + void ARGBToYRow_Any_AVX2(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); +@@ -1552,22 +1215,6 @@ void ARGBToYRow_NEON(const uint8_t* src_ + void ARGBToYJRow_NEON(const uint8_t* src_argb, uint8_t* dst_yj, int width); + void ABGRToYJRow_NEON(const uint8_t* src_abgr, uint8_t* dst_yj, int width); + void RGBAToYJRow_NEON(const uint8_t* src_rgba, uint8_t* dst_yj, int width); +-void ARGBToYRow_NEON_DotProd(const uint8_t* src_argb, +- uint8_t* dst_y, +- int width); +-void ARGBToYJRow_NEON_DotProd(const uint8_t* src_argb, +- uint8_t* dst_yj, +- int width); +-void ABGRToYJRow_NEON_DotProd(const uint8_t* src_abgr, +- uint8_t* dst_yj, +- int width); +-void RGBAToYJRow_NEON_DotProd(const uint8_t* src_rgba, +- uint8_t* dst_yj, +- int width); +-void ARGBToYRow_RVV(const uint8_t* src_argb, uint8_t* dst_y, int width); +-void ARGBToYJRow_RVV(const uint8_t* src_argb, uint8_t* dst_yj, int width); +-void ABGRToYJRow_RVV(const uint8_t* src_rgba, uint8_t* dst_yj, int width); +-void RGBAToYJRow_RVV(const uint8_t* src_rgba, uint8_t* dst_yj, int width); + void ARGBToYRow_MSA(const uint8_t* src_argb0, uint8_t* dst_y, int width); + void ARGBToYJRow_MSA(const uint8_t* src_argb0, uint8_t* dst_y, int width); + void ARGBToYRow_LSX(const uint8_t* src_argb0, uint8_t* dst_y, int width); +@@ -1587,11 +1234,6 @@ void ARGBToUVRow_NEON(const uint8_t* src + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void ARGBToUVRow_SVE2(const uint8_t* src_argb, +- int src_stride_argb, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void ARGBToUV444Row_MSA(const uint8_t* src_argb, + uint8_t* dst_u, + uint8_t* dst_v, +@@ -1601,20 +1243,11 @@ void ARGBToUVRow_MSA(const uint8_t* src_ + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void ARGBToUVRow_LSX(const uint8_t* src_argb, +- int src_stride_argb, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void ARGBToUVRow_LASX(const uint8_t* src_argb, + int src_stride_argb, + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void ARGBToUV444Row_LSX(const uint8_t* src_argb, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void ARGBToUV444Row_LASX(const uint8_t* src_argb, + uint8_t* dst_u, + uint8_t* dst_v, +@@ -1624,51 +1257,26 @@ void ARGBToUVJRow_NEON(const uint8_t* sr + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void ARGBToUVJRow_SVE2(const uint8_t* src_argb, +- int src_stride_argb, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void ABGRToUVJRow_NEON(const uint8_t* src_abgr, + int src_stride_abgr, + uint8_t* dst_uj, + uint8_t* dst_vj, + int width); +-void ABGRToUVJRow_SVE2(const uint8_t* src_abgr, +- int src_stride_abgr, +- uint8_t* dst_uj, +- uint8_t* dst_vj, +- int width); + void BGRAToUVRow_NEON(const uint8_t* src_bgra, + int src_stride_bgra, + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void BGRAToUVRow_SVE2(const uint8_t* src_bgra, +- int src_stride_bgra, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void ABGRToUVRow_NEON(const uint8_t* src_abgr, + int src_stride_abgr, + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void ABGRToUVRow_SVE2(const uint8_t* src_abgr, +- int src_stride_abgr, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void RGBAToUVRow_NEON(const uint8_t* src_rgba, + int src_stride_rgba, + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void RGBAToUVRow_SVE2(const uint8_t* src_rgba, +- int src_stride_rgba, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void RGB24ToUVRow_NEON(const uint8_t* src_rgb24, + int src_stride_rgb24, + uint8_t* dst_u, +@@ -1817,15 +1425,6 @@ void RAWToUVRow_LASX(const uint8_t* src_ + void BGRAToYRow_NEON(const uint8_t* src_bgra, uint8_t* dst_y, int width); + void ABGRToYRow_NEON(const uint8_t* src_abgr, uint8_t* dst_y, int width); + void RGBAToYRow_NEON(const uint8_t* src_rgba, uint8_t* dst_y, int width); +-void BGRAToYRow_NEON_DotProd(const uint8_t* src_bgra, +- uint8_t* dst_y, +- int width); +-void ABGRToYRow_NEON_DotProd(const uint8_t* src_abgr, +- uint8_t* dst_y, +- int width); +-void RGBAToYRow_NEON_DotProd(const uint8_t* src_rgba, +- uint8_t* dst_y, +- int width); + void RGB24ToYRow_NEON(const uint8_t* src_rgb24, uint8_t* dst_y, int width); + void RGB24ToYJRow_NEON(const uint8_t* src_rgb24, uint8_t* dst_yj, int width); + void RAWToYRow_NEON(const uint8_t* src_raw, uint8_t* dst_y, int width); +@@ -1837,13 +1436,6 @@ void ARGB1555ToYRow_NEON(const uint8_t* + void ARGB4444ToYRow_NEON(const uint8_t* src_argb4444, + uint8_t* dst_y, + int width); +-void BGRAToYRow_RVV(const uint8_t* src_bgra, uint8_t* dst_y, int width); +-void ABGRToYRow_RVV(const uint8_t* src_abgr, uint8_t* dst_y, int width); +-void RGBAToYRow_RVV(const uint8_t* src_rgba, uint8_t* dst_y, int width); +-void RGB24ToYRow_RVV(const uint8_t* src_rgb24, uint8_t* dst_y, int width); +-void RGB24ToYJRow_RVV(const uint8_t* src_rgb24, uint8_t* dst_yj, int width); +-void RAWToYRow_RVV(const uint8_t* src_raw, uint8_t* dst_y, int width); +-void RAWToYJRow_RVV(const uint8_t* src_raw, uint8_t* dst_yj, int width); + void BGRAToYRow_MSA(const uint8_t* src_argb, uint8_t* dst_y, int width); + void ABGRToYRow_MSA(const uint8_t* src_argb, uint8_t* dst_y, int width); + void RGBAToYRow_MSA(const uint8_t* src_argb, uint8_t* dst_y, int width); +@@ -1903,33 +1495,12 @@ void RAWToYJRow_Any_SSSE3(const uint8_t* + void RGB24ToYJRow_Any_AVX2(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); + void RAWToYJRow_Any_AVX2(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); + void ARGBToYRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); +-void ARGBToYRow_Any_NEON_DotProd(const uint8_t* src_ptr, +- uint8_t* dst_ptr, +- int width); + void ARGBToYJRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); +-void ARGBToYJRow_Any_NEON_DotProd(const uint8_t* src_ptr, +- uint8_t* dst_ptr, +- int width); + void ABGRToYJRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); +-void ABGRToYJRow_Any_NEON_DotProd(const uint8_t* src_ptr, +- uint8_t* dst_ptr, +- int width); + void RGBAToYJRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); +-void RGBAToYJRow_Any_NEON_DotProd(const uint8_t* src_ptr, +- uint8_t* dst_ptr, +- int width); + void BGRAToYRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); +-void BGRAToYRow_Any_NEON_DotProd(const uint8_t* src_ptr, +- uint8_t* dst_ptr, +- int width); + void ABGRToYRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); +-void ABGRToYRow_Any_NEON_DotProd(const uint8_t* src_ptr, +- uint8_t* dst_ptr, +- int width); + void RGBAToYRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); +-void RGBAToYRow_Any_NEON_DotProd(const uint8_t* src_ptr, +- uint8_t* dst_ptr, +- int width); + void RGB24ToYRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); + void RGB24ToYJRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); + void RAWToYRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); +@@ -2094,11 +1665,6 @@ void ARGBToUVRow_Any_NEON(const uint8_t* + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void ARGBToUVRow_Any_SVE2(const uint8_t* src_ptr, +- int src_stride, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void ARGBToUV444Row_Any_MSA(const uint8_t* src_ptr, + uint8_t* dst_u, + uint8_t* dst_v, +@@ -2108,20 +1674,11 @@ void ARGBToUVRow_Any_MSA(const uint8_t* + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void ARGBToUVRow_Any_LSX(const uint8_t* src_ptr, +- int src_stride_ptr, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void ARGBToUVRow_Any_LASX(const uint8_t* src_ptr, + int src_stride_ptr, + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void ARGBToUV444Row_Any_LSX(const uint8_t* src_ptr, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void ARGBToUV444Row_Any_LASX(const uint8_t* src_ptr, + uint8_t* dst_u, + uint8_t* dst_v, +@@ -2131,51 +1688,26 @@ void ARGBToUVJRow_Any_NEON(const uint8_t + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void ARGBToUVJRow_Any_SVE2(const uint8_t* src_ptr, +- int src_stride, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void ABGRToUVJRow_Any_NEON(const uint8_t* src_ptr, + int src_stride, + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void ABGRToUVJRow_Any_SVE2(const uint8_t* src_ptr, +- int src_stride, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void BGRAToUVRow_Any_NEON(const uint8_t* src_ptr, + int src_stride, + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void BGRAToUVRow_Any_SVE2(const uint8_t* src_ptr, +- int src_stride, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void ABGRToUVRow_Any_NEON(const uint8_t* src_ptr, + int src_stride, + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void ABGRToUVRow_Any_SVE2(const uint8_t* src_ptr, +- int src_stride, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void RGBAToUVRow_Any_NEON(const uint8_t* src_ptr, + int src_stride, + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void RGBAToUVRow_Any_SVE2(const uint8_t* src_ptr, +- int src_stride, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void RGB24ToUVRow_Any_NEON(const uint8_t* src_ptr, + int src_stride, + uint8_t* dst_u, +@@ -2410,7 +1942,6 @@ void MirrorRow_AVX2(const uint8_t* src, + void MirrorRow_SSSE3(const uint8_t* src, uint8_t* dst, int width); + void MirrorRow_NEON(const uint8_t* src, uint8_t* dst, int width); + void MirrorRow_MSA(const uint8_t* src, uint8_t* dst, int width); +-void MirrorRow_LSX(const uint8_t* src, uint8_t* dst, int width); + void MirrorRow_LASX(const uint8_t* src, uint8_t* dst, int width); + void MirrorRow_C(const uint8_t* src, uint8_t* dst, int width); + void MirrorRow_Any_AVX2(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); +@@ -2418,20 +1949,17 @@ void MirrorRow_Any_SSSE3(const uint8_t* + void MirrorRow_Any_SSE2(const uint8_t* src, uint8_t* dst, int width); + void MirrorRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); + void MirrorRow_Any_MSA(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); +-void MirrorRow_Any_LSX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); + void MirrorRow_Any_LASX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); + void MirrorUVRow_AVX2(const uint8_t* src_uv, uint8_t* dst_uv, int width); + void MirrorUVRow_SSSE3(const uint8_t* src_uv, uint8_t* dst_uv, int width); + void MirrorUVRow_NEON(const uint8_t* src_uv, uint8_t* dst_uv, int width); + void MirrorUVRow_MSA(const uint8_t* src_uv, uint8_t* dst_uv, int width); +-void MirrorUVRow_LSX(const uint8_t* src_uv, uint8_t* dst_uv, int width); + void MirrorUVRow_LASX(const uint8_t* src_uv, uint8_t* dst_uv, int width); + void MirrorUVRow_C(const uint8_t* src_uv, uint8_t* dst_uv, int width); + void MirrorUVRow_Any_AVX2(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); + void MirrorUVRow_Any_SSSE3(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); + void MirrorUVRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); + void MirrorUVRow_Any_MSA(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); +-void MirrorUVRow_Any_LSX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); + void MirrorUVRow_Any_LASX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); + + void MirrorSplitUVRow_SSSE3(const uint8_t* src, +@@ -2461,7 +1989,6 @@ void ARGBMirrorRow_AVX2(const uint8_t* s + void ARGBMirrorRow_SSE2(const uint8_t* src, uint8_t* dst, int width); + void ARGBMirrorRow_NEON(const uint8_t* src_argb, uint8_t* dst_argb, int width); + void ARGBMirrorRow_MSA(const uint8_t* src, uint8_t* dst, int width); +-void ARGBMirrorRow_LSX(const uint8_t* src, uint8_t* dst, int width); + void ARGBMirrorRow_LASX(const uint8_t* src, uint8_t* dst, int width); + void ARGBMirrorRow_C(const uint8_t* src, uint8_t* dst, int width); + void ARGBMirrorRow_Any_AVX2(const uint8_t* src_ptr, +@@ -2474,7 +2001,6 @@ void ARGBMirrorRow_Any_NEON(const uint8_ + uint8_t* dst_ptr, + int width); + void ARGBMirrorRow_Any_MSA(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); +-void ARGBMirrorRow_Any_LSX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); + void ARGBMirrorRow_Any_LASX(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int width); +@@ -2517,10 +2043,6 @@ void SplitUVRow_LSX(const uint8_t* src_u + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void SplitUVRow_RVV(const uint8_t* src_uv, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void SplitUVRow_Any_SSE2(const uint8_t* src_ptr, + uint8_t* dst_u, + uint8_t* dst_v, +@@ -2682,10 +2204,6 @@ void MergeUVRow_LSX(const uint8_t* src_u + const uint8_t* src_v, + uint8_t* dst_uv, + int width); +-void MergeUVRow_RVV(const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_uv, +- int width); + void MergeUVRow_Any_SSE2(const uint8_t* y_buf, + const uint8_t* uv_buf, + uint8_t* dst_ptr, +@@ -2754,11 +2272,6 @@ void SplitRGBRow_NEON(const uint8_t* src + uint8_t* dst_g, + uint8_t* dst_b, + int width); +-void SplitRGBRow_RVV(const uint8_t* src_rgb, +- uint8_t* dst_r, +- uint8_t* dst_g, +- uint8_t* dst_b, +- int width); + void SplitRGBRow_Any_SSSE3(const uint8_t* src_ptr, + uint8_t* dst_r, + uint8_t* dst_g, +@@ -2785,11 +2298,6 @@ void MergeRGBRow_NEON(const uint8_t* src + const uint8_t* src_b, + uint8_t* dst_rgb, + int width); +-void MergeRGBRow_RVV(const uint8_t* src_r, +- const uint8_t* src_g, +- const uint8_t* src_b, +- uint8_t* dst_rgb, +- int width); + void MergeRGBRow_Any_SSSE3(const uint8_t* y_buf, + const uint8_t* u_buf, + const uint8_t* v_buf, +@@ -2824,12 +2332,6 @@ void MergeARGBRow_NEON(const uint8_t* sr + const uint8_t* src_a, + uint8_t* dst_argb, + int width); +-void MergeARGBRow_RVV(const uint8_t* src_r, +- const uint8_t* src_g, +- const uint8_t* src_b, +- const uint8_t* src_a, +- uint8_t* dst_argb, +- int width); + void MergeARGBRow_Any_SSE2(const uint8_t* y_buf, + const uint8_t* u_buf, + const uint8_t* v_buf, +@@ -2878,12 +2380,6 @@ void SplitARGBRow_NEON(const uint8_t* sr + uint8_t* dst_b, + uint8_t* dst_a, + int width); +-void SplitARGBRow_RVV(const uint8_t* src_rgba, +- uint8_t* dst_r, +- uint8_t* dst_g, +- uint8_t* dst_b, +- uint8_t* dst_a, +- int width); + void SplitARGBRow_Any_SSE2(const uint8_t* src_ptr, + uint8_t* dst_r, + uint8_t* dst_g, +@@ -2928,11 +2424,6 @@ void MergeXRGBRow_NEON(const uint8_t* sr + const uint8_t* src_b, + uint8_t* dst_argb, + int width); +-void MergeXRGBRow_RVV(const uint8_t* src_r, +- const uint8_t* src_g, +- const uint8_t* src_b, +- uint8_t* dst_argb, +- int width); + void MergeXRGBRow_Any_SSE2(const uint8_t* y_buf, + const uint8_t* u_buf, + const uint8_t* v_buf, +@@ -2973,11 +2464,6 @@ void SplitXRGBRow_NEON(const uint8_t* sr + uint8_t* dst_g, + uint8_t* dst_b, + int width); +-void SplitXRGBRow_RVV(const uint8_t* src_rgba, +- uint8_t* dst_r, +- uint8_t* dst_g, +- uint8_t* dst_b, +- int width); + void SplitXRGBRow_Any_SSE2(const uint8_t* src_ptr, + uint8_t* dst_r, + uint8_t* dst_g, +@@ -3321,7 +2807,6 @@ void CopyRow_AVX(const uint8_t* src, uin + void CopyRow_ERMS(const uint8_t* src, uint8_t* dst, int width); + void CopyRow_NEON(const uint8_t* src, uint8_t* dst, int width); + void CopyRow_MIPS(const uint8_t* src, uint8_t* dst, int count); +-void CopyRow_RVV(const uint8_t* src, uint8_t* dst, int count); + void CopyRow_C(const uint8_t* src, uint8_t* dst, int count); + void CopyRow_Any_SSE2(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); + void CopyRow_Any_AVX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); +@@ -3355,9 +2840,6 @@ void ARGBExtractAlphaRow_MSA(const uint8 + void ARGBExtractAlphaRow_LSX(const uint8_t* src_argb, + uint8_t* dst_a, + int width); +-void ARGBExtractAlphaRow_RVV(const uint8_t* src_argb, +- uint8_t* dst_a, +- int width); + void ARGBExtractAlphaRow_Any_SSE2(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int width); +@@ -3377,7 +2859,6 @@ void ARGBExtractAlphaRow_Any_LSX(const u + void ARGBCopyYToAlphaRow_C(const uint8_t* src, uint8_t* dst, int width); + void ARGBCopyYToAlphaRow_SSE2(const uint8_t* src, uint8_t* dst, int width); + void ARGBCopyYToAlphaRow_AVX2(const uint8_t* src, uint8_t* dst, int width); +-void ARGBCopyYToAlphaRow_RVV(const uint8_t* src, uint8_t* dst, int width); + void ARGBCopyYToAlphaRow_Any_SSE2(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int width); +@@ -3425,10 +2906,6 @@ void ARGBShuffleRow_MSA(const uint8_t* s + uint8_t* dst_argb, + const uint8_t* shuffler, + int width); +-void ARGBShuffleRow_LSX(const uint8_t* src_argb, +- uint8_t* dst_argb, +- const uint8_t* shuffler, +- int width); + void ARGBShuffleRow_LASX(const uint8_t* src_argb, + uint8_t* dst_argb, + const uint8_t* shuffler, +@@ -3449,10 +2926,6 @@ void ARGBShuffleRow_Any_MSA(const uint8_ + uint8_t* dst_ptr, + const uint8_t* param, + int width); +-void ARGBShuffleRow_Any_LSX(const uint8_t* src_ptr, +- uint8_t* dst_ptr, +- const uint8_t* param, +- int width); + void ARGBShuffleRow_Any_LASX(const uint8_t* src_ptr, + uint8_t* dst_ptr, + const uint8_t* param, +@@ -3485,18 +2958,14 @@ void RGB24ToARGBRow_LSX(const uint8_t* s + void RGB24ToARGBRow_LASX(const uint8_t* src_rgb24, + uint8_t* dst_argb, + int width); +-void RGB24ToARGBRow_RVV(const uint8_t* src_rgb24, uint8_t* dst_argb, int width); + void RAWToARGBRow_NEON(const uint8_t* src_raw, uint8_t* dst_argb, int width); + void RAWToRGBARow_NEON(const uint8_t* src_raw, uint8_t* dst_rgba, int width); + void RAWToARGBRow_MSA(const uint8_t* src_raw, uint8_t* dst_argb, int width); + void RAWToARGBRow_LSX(const uint8_t* src_raw, uint8_t* dst_argb, int width); + void RAWToARGBRow_LASX(const uint8_t* src_raw, uint8_t* dst_argb, int width); +-void RAWToARGBRow_RVV(const uint8_t* src_raw, uint8_t* dst_argb, int width); +-void RAWToRGBARow_RVV(const uint8_t* src_raw, uint8_t* dst_rgba, int width); + void RAWToRGB24Row_NEON(const uint8_t* src_raw, uint8_t* dst_rgb24, int width); + void RAWToRGB24Row_MSA(const uint8_t* src_raw, uint8_t* dst_rgb24, int width); + void RAWToRGB24Row_LSX(const uint8_t* src_raw, uint8_t* dst_rgb24, int width); +-void RAWToRGB24Row_RVV(const uint8_t* src_raw, uint8_t* dst_rgb24, int width); + void RGB565ToARGBRow_NEON(const uint8_t* src_rgb565, + uint8_t* dst_argb, + int width); +@@ -3512,9 +2981,6 @@ void RGB565ToARGBRow_LASX(const uint8_t* + void ARGB1555ToARGBRow_NEON(const uint8_t* src_argb1555, + uint8_t* dst_argb, + int width); +-void ARGB1555ToARGBRow_SVE2(const uint8_t* src_argb1555, +- uint8_t* dst_argb, +- int width); + void ARGB1555ToARGBRow_MSA(const uint8_t* src_argb1555, + uint8_t* dst_argb, + int width); +@@ -3659,15 +3125,15 @@ void ARGBToRGB24Row_AVX512VBMI(const uin + + void ARGBToRGB565DitherRow_C(const uint8_t* src_argb, + uint8_t* dst_rgb, +- uint32_t dither4, ++ const uint32_t dither4, + int width); + void ARGBToRGB565DitherRow_SSE2(const uint8_t* src, + uint8_t* dst, +- uint32_t dither4, ++ const uint32_t dither4, + int width); + void ARGBToRGB565DitherRow_AVX2(const uint8_t* src, + uint8_t* dst, +- uint32_t dither4, ++ const uint32_t dither4, + int width); + + void ARGBToRGB565Row_AVX2(const uint8_t* src_argb, uint8_t* dst_rgb, int width); +@@ -3687,9 +3153,6 @@ void ARGBToRAWRow_NEON(const uint8_t* sr + void ARGBToRGB565Row_NEON(const uint8_t* src_argb, + uint8_t* dst_rgb565, + int width); +-void ARGBToRGB565Row_SVE2(const uint8_t* src_argb, +- uint8_t* dst_rgb565, +- int width); + void ARGBToARGB1555Row_NEON(const uint8_t* src_argb, + uint8_t* dst_argb1555, + int width); +@@ -3698,11 +3161,7 @@ void ARGBToARGB4444Row_NEON(const uint8_ + int width); + void ARGBToRGB565DitherRow_NEON(const uint8_t* src_argb, + uint8_t* dst_rgb, +- uint32_t dither4, +- int width); +-void ARGBToRGB565DitherRow_SVE2(const uint8_t* src_argb, +- uint8_t* dst_rgb, +- uint32_t dither4, ++ const uint32_t dither4, + int width); + void ARGBToRGB24Row_MSA(const uint8_t* src_argb, uint8_t* dst_rgb, int width); + void ARGBToRAWRow_MSA(const uint8_t* src_argb, uint8_t* dst_rgb, int width); +@@ -3715,44 +3174,23 @@ void ARGBToARGB4444Row_MSA(const uint8_t + int width); + void ARGBToRGB565DitherRow_MSA(const uint8_t* src_argb, + uint8_t* dst_rgb, +- uint32_t dither4, +- int width); +-void ARGBToRGB565DitherRow_LSX(const uint8_t* src_argb, +- uint8_t* dst_rgb, +- uint32_t dither4, ++ const uint32_t dither4, + int width); + void ARGBToRGB565DitherRow_LASX(const uint8_t* src_argb, + uint8_t* dst_rgb, +- uint32_t dither4, ++ const uint32_t dither4, + int width); + +-void ARGBToRGB24Row_LSX(const uint8_t* src_argb, uint8_t* dst_rgb, int width); + void ARGBToRGB24Row_LASX(const uint8_t* src_argb, uint8_t* dst_rgb, int width); +-void ARGBToRAWRow_LSX(const uint8_t* src_argb, uint8_t* dst_rgb, int width); + void ARGBToRAWRow_LASX(const uint8_t* src_argb, uint8_t* dst_rgb, int width); +-void ARGBToRGB565Row_LSX(const uint8_t* src_argb, uint8_t* dst_rgb, int width); + void ARGBToRGB565Row_LASX(const uint8_t* src_argb, uint8_t* dst_rgb, int width); +-void ARGBToARGB1555Row_LSX(const uint8_t* src_argb, +- uint8_t* dst_rgb, +- int width); + void ARGBToARGB1555Row_LASX(const uint8_t* src_argb, + uint8_t* dst_rgb, + int width); +-void ARGBToARGB4444Row_LSX(const uint8_t* src_argb, +- uint8_t* dst_rgb, +- int width); + void ARGBToARGB4444Row_LASX(const uint8_t* src_argb, + uint8_t* dst_rgb, + int width); + +-void ARGBToRAWRow_RVV(const uint8_t* src_argb, uint8_t* dst_raw, int width); +-void ARGBToABGRRow_RVV(const uint8_t* src_argb, uint8_t* dst_abgr, int width); +-void ARGBToBGRARow_RVV(const uint8_t* src_argb, uint8_t* dst_rgba, int width); +-void ARGBToRGBARow_RVV(const uint8_t* src_argb, uint8_t* dst_rgb, int width); +-void ARGBToRGB24Row_RVV(const uint8_t* src_argb, uint8_t* dst_rgb24, int width); +- +-void ARGBToABGRRow_C(const uint8_t* src_argb, uint8_t* dst_abgr, int width); +-void ARGBToBGRARow_C(const uint8_t* src_argb, uint8_t* dst_bgra, int width); + void ARGBToRGBARow_C(const uint8_t* src_argb, uint8_t* dst_rgb, int width); + void ARGBToRGB24Row_C(const uint8_t* src_argb, uint8_t* dst_rgb, int width); + void ARGBToRAWRow_C(const uint8_t* src_argb, uint8_t* dst_rgb, int width); +@@ -3766,8 +3204,6 @@ void ARGBToAR64Row_C(const uint8_t* src_ + void ARGBToAB64Row_C(const uint8_t* src_argb, uint16_t* dst_ab64, int width); + void AR64ToARGBRow_C(const uint16_t* src_ar64, uint8_t* dst_argb, int width); + void AB64ToARGBRow_C(const uint16_t* src_ab64, uint8_t* dst_argb, int width); +-void AR64ToAB64Row_C(const uint16_t* src_ar64, uint16_t* dst_ab64, int width); +-void RGBAToARGBRow_C(const uint8_t* src_rgba, uint8_t* dst_argb, int width); + void AR64ShuffleRow_C(const uint8_t* src_ar64, + uint8_t* dst_ar64, + const uint8_t* shuffler, +@@ -3792,12 +3228,6 @@ void ARGBToAR64Row_NEON(const uint8_t* s + void ARGBToAB64Row_NEON(const uint8_t* src_argb, uint16_t* dst_ab64, int width); + void AR64ToARGBRow_NEON(const uint16_t* src_ar64, uint8_t* dst_argb, int width); + void AB64ToARGBRow_NEON(const uint16_t* src_ab64, uint8_t* dst_argb, int width); +-void ARGBToAR64Row_RVV(const uint8_t* src_argb, uint16_t* dst_ar64, int width); +-void ARGBToAB64Row_RVV(const uint8_t* src_argb, uint16_t* dst_ab64, int width); +-void AR64ToARGBRow_RVV(const uint16_t* src_ar64, uint8_t* dst_argb, int width); +-void AB64ToARGBRow_RVV(const uint16_t* src_ab64, uint8_t* dst_argb, int width); +-void AR64ToAB64Row_RVV(const uint16_t* src_ar64, uint16_t* dst_ab64, int width); +-void RGBAToARGBRow_RVV(const uint8_t* src_rgba, uint8_t* dst_argb, int width); + void ARGBToAR64Row_Any_SSSE3(const uint8_t* src_ptr, + uint16_t* dst_ptr, + int width); +@@ -3840,7 +3270,6 @@ void J400ToARGBRow_AVX2(const uint8_t* s + void J400ToARGBRow_NEON(const uint8_t* src_y, uint8_t* dst_argb, int width); + void J400ToARGBRow_MSA(const uint8_t* src_y, uint8_t* dst_argb, int width); + void J400ToARGBRow_LSX(const uint8_t* src_y, uint8_t* dst_argb, int width); +-void J400ToARGBRow_RVV(const uint8_t* src_y, uint8_t* dst_argb, int width); + void J400ToARGBRow_C(const uint8_t* src_y, uint8_t* dst_argb, int width); + void J400ToARGBRow_Any_SSE2(const uint8_t* src_ptr, + uint8_t* dst_ptr, +@@ -4762,10 +4191,6 @@ void I400ToARGBRow_NEON(const uint8_t* s + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +-void I400ToARGBRow_SVE2(const uint8_t* src_y, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width); + void I400ToARGBRow_MSA(const uint8_t* src_y, + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, +@@ -4774,10 +4199,6 @@ void I400ToARGBRow_LSX(const uint8_t* sr + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width); +-void I400ToARGBRow_RVV(const uint8_t* src_y, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width); + void I400ToARGBRow_Any_SSE2(const uint8_t* src_ptr, + uint8_t* dst_ptr, + const struct YuvConstants* param, +@@ -4816,10 +4237,6 @@ void ARGBBlendRow_LSX(const uint8_t* src + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width); +-void ARGBBlendRow_RVV(const uint8_t* src_argb0, +- const uint8_t* src_argb1, +- uint8_t* dst_argb, +- int width); + void ARGBBlendRow_C(const uint8_t* src_argb, + const uint8_t* src_argb1, + uint8_t* dst_argb, +@@ -4846,11 +4263,6 @@ void BlendPlaneRow_Any_AVX2(const uint8_ + const uint8_t* v_buf, + uint8_t* dst_ptr, + int width); +-void BlendPlaneRow_RVV(const uint8_t* src0, +- const uint8_t* src1, +- const uint8_t* alpha, +- uint8_t* dst, +- int width); + void BlendPlaneRow_C(const uint8_t* src0, + const uint8_t* src1, + const uint8_t* alpha, +@@ -4895,18 +4307,10 @@ void ARGBMultiplyRow_Any_MSA(const uint8 + const uint8_t* uv_buf, + uint8_t* dst_ptr, + int width); +-void ARGBMultiplyRow_LSX(const uint8_t* src_argb0, +- const uint8_t* src_argb1, +- uint8_t* dst_argb, +- int width); + void ARGBMultiplyRow_LASX(const uint8_t* src_argb0, + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width); +-void ARGBMultiplyRow_Any_LSX(const uint8_t* y_buf, +- const uint8_t* uv_buf, +- uint8_t* dst_ptr, +- int width); + void ARGBMultiplyRow_Any_LASX(const uint8_t* y_buf, + const uint8_t* uv_buf, + uint8_t* dst_ptr, +@@ -4949,18 +4353,10 @@ void ARGBAddRow_Any_MSA(const uint8_t* y + const uint8_t* uv_buf, + uint8_t* dst_ptr, + int width); +-void ARGBAddRow_LSX(const uint8_t* src_argb0, +- const uint8_t* src_argb1, +- uint8_t* dst_argb, +- int width); + void ARGBAddRow_LASX(const uint8_t* src_argb0, + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width); +-void ARGBAddRow_Any_LSX(const uint8_t* y_buf, +- const uint8_t* uv_buf, +- uint8_t* dst_ptr, +- int width); + void ARGBAddRow_Any_LASX(const uint8_t* y_buf, + const uint8_t* uv_buf, + uint8_t* dst_ptr, +@@ -5004,18 +4400,10 @@ void ARGBSubtractRow_Any_MSA(const uint8 + const uint8_t* uv_buf, + uint8_t* dst_ptr, + int width); +-void ARGBSubtractRow_LSX(const uint8_t* src_argb0, +- const uint8_t* src_argb1, +- uint8_t* dst_argb, +- int width); + void ARGBSubtractRow_LASX(const uint8_t* src_argb0, + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width); +-void ARGBSubtractRow_Any_LSX(const uint8_t* y_buf, +- const uint8_t* uv_buf, +- uint8_t* dst_ptr, +- int width); + void ARGBSubtractRow_Any_LASX(const uint8_t* y_buf, + const uint8_t* uv_buf, + uint8_t* dst_ptr, +@@ -5108,37 +4496,21 @@ void ARGBToRGB565DitherRow_Any_MSA(const + uint8_t* dst_ptr, + const uint32_t param, + int width); +-void ARGBToRGB565DitherRow_Any_LSX(const uint8_t* src_ptr, +- uint8_t* dst_ptr, +- const uint32_t param, +- int width); + void ARGBToRGB565DitherRow_Any_LASX(const uint8_t* src_ptr, + uint8_t* dst_ptr, + const uint32_t param, + int width); +-void ARGBToRGB24Row_Any_LSX(const uint8_t* src_ptr, +- uint8_t* dst_ptr, +- int width); ++ + void ARGBToRGB24Row_Any_LASX(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int width); +-void ARGBToRAWRow_Any_LSX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); + void ARGBToRAWRow_Any_LASX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); +-void ARGBToRGB565Row_Any_LSX(const uint8_t* src_ptr, +- uint8_t* dst_ptr, +- int width); + void ARGBToRGB565Row_Any_LASX(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int width); +-void ARGBToARGB1555Row_Any_LSX(const uint8_t* src_ptr, +- uint8_t* dst_ptr, +- int width); + void ARGBToARGB1555Row_Any_LASX(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int width); +-void ARGBToARGB4444Row_Any_LSX(const uint8_t* src_ptr, +- uint8_t* dst_ptr, +- int width); + void ARGBToARGB4444Row_Any_LASX(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int width); +@@ -5161,30 +4533,6 @@ void I422ToARGBRow_Any_NEON(const uint8_ + uint8_t* dst_ptr, + const struct YuvConstants* yuvconstants, + int width); +-void I210ToARGBRow_Any_NEON(const uint16_t* y_buf, +- const uint16_t* u_buf, +- const uint16_t* v_buf, +- uint8_t* dst_ptr, +- const struct YuvConstants* yuvconstants, +- int width); +-void I410ToARGBRow_Any_NEON(const uint16_t* y_buf, +- const uint16_t* u_buf, +- const uint16_t* v_buf, +- uint8_t* dst_ptr, +- const struct YuvConstants* yuvconstants, +- int width); +-void I210ToAR30Row_Any_NEON(const uint16_t* y_buf, +- const uint16_t* u_buf, +- const uint16_t* v_buf, +- uint8_t* dst_ptr, +- const struct YuvConstants* yuvconstants, +- int width); +-void I410ToAR30Row_Any_NEON(const uint16_t* y_buf, +- const uint16_t* u_buf, +- const uint16_t* v_buf, +- uint8_t* dst_ptr, +- const struct YuvConstants* yuvconstants, +- int width); + void I444AlphaToARGBRow_Any_NEON(const uint8_t* y_buf, + const uint8_t* u_buf, + const uint8_t* v_buf, +@@ -5199,20 +4547,6 @@ void I422AlphaToARGBRow_Any_NEON(const u + uint8_t* dst_ptr, + const struct YuvConstants* yuvconstants, + int width); +-void I410AlphaToARGBRow_Any_NEON(const uint16_t* y_buf, +- const uint16_t* u_buf, +- const uint16_t* v_buf, +- const uint16_t* a_buf, +- uint8_t* dst_ptr, +- const struct YuvConstants* yuvconstants, +- int width); +-void I210AlphaToARGBRow_Any_NEON(const uint16_t* y_buf, +- const uint16_t* u_buf, +- const uint16_t* v_buf, +- const uint16_t* a_buf, +- uint8_t* dst_ptr, +- const struct YuvConstants* yuvconstants, +- int width); + void I422ToRGBARow_Any_NEON(const uint8_t* y_buf, + const uint8_t* u_buf, + const uint8_t* v_buf, +@@ -5280,13 +4614,45 @@ void UYVYToARGBRow_Any_NEON(const uint8_ + uint8_t* dst_ptr, + const struct YuvConstants* yuvconstants, + int width); +-void ARGBToAR30Row_NEON(const uint8_t* src, uint8_t* dst, int width); +-void ABGRToAR30Row_NEON(const uint8_t* src, uint8_t* dst, int width); +-void ABGRToAR30Row_Any_NEON(const uint8_t* src_ptr, +- uint8_t* dst_ptr, ++void P210ToARGBRow_NEON(const uint16_t* y_buf, ++ const uint16_t* uv_buf, ++ uint8_t* dst_argb, ++ const struct YuvConstants* yuvconstants, ++ int width); ++void P410ToARGBRow_NEON(const uint16_t* y_buf, ++ const uint16_t* uv_buf, ++ uint8_t* dst_argb, ++ const struct YuvConstants* yuvconstants, ++ int width); ++void P210ToAR30Row_NEON(const uint16_t* y_buf, ++ const uint16_t* uv_buf, ++ uint8_t* dst_ar30, ++ const struct YuvConstants* yuvconstants, ++ int width); ++void P410ToAR30Row_NEON(const uint16_t* y_buf, ++ const uint16_t* uv_buf, ++ uint8_t* dst_ar30, ++ const struct YuvConstants* yuvconstants, ++ int width); ++void P210ToARGBRow_Any_NEON(const uint16_t* y_buf, ++ const uint16_t* uv_buf, ++ uint8_t* dst_argb, ++ const struct YuvConstants* yuvconstants, + int width); +-void ARGBToAR30Row_Any_NEON(const uint8_t* src_ptr, +- uint8_t* dst_ptr, ++void P410ToARGBRow_Any_NEON(const uint16_t* y_buf, ++ const uint16_t* uv_buf, ++ uint8_t* dst_argb, ++ const struct YuvConstants* yuvconstants, ++ int width); ++void P210ToAR30Row_Any_NEON(const uint16_t* y_buf, ++ const uint16_t* uv_buf, ++ uint8_t* dst_ar30, ++ const struct YuvConstants* yuvconstants, ++ int width); ++void P410ToAR30Row_Any_NEON(const uint16_t* y_buf, ++ const uint16_t* uv_buf, ++ uint8_t* dst_ar30, ++ const struct YuvConstants* yuvconstants, + int width); + void I444ToARGBRow_Any_MSA(const uint8_t* y_buf, + const uint8_t* u_buf, +@@ -5306,12 +4672,6 @@ void I422ToARGBRow_Any_MSA(const uint8_t + uint8_t* dst_ptr, + const struct YuvConstants* yuvconstants, + int width); +-void I422ToARGBRow_Any_LSX(const uint8_t* y_buf, +- const uint8_t* u_buf, +- const uint8_t* v_buf, +- uint8_t* dst_ptr, +- const struct YuvConstants* yuvconstants, +- int width); + void I422ToARGBRow_Any_LASX(const uint8_t* y_buf, + const uint8_t* u_buf, + const uint8_t* v_buf, +@@ -5324,12 +4684,6 @@ void I422ToRGBARow_Any_MSA(const uint8_t + uint8_t* dst_ptr, + const struct YuvConstants* yuvconstants, + int width); +-void I422ToRGBARow_Any_LSX(const uint8_t* y_buf, +- const uint8_t* u_buf, +- const uint8_t* v_buf, +- uint8_t* dst_ptr, +- const struct YuvConstants* yuvconstants, +- int width); + void I422ToRGBARow_Any_LASX(const uint8_t* y_buf, + const uint8_t* u_buf, + const uint8_t* v_buf, +@@ -5343,13 +4697,6 @@ void I422AlphaToARGBRow_Any_MSA(const ui + uint8_t* dst_ptr, + const struct YuvConstants* yuvconstants, + int width); +-void I422AlphaToARGBRow_Any_LSX(const uint8_t* y_buf, +- const uint8_t* u_buf, +- const uint8_t* v_buf, +- const uint8_t* a_buf, +- uint8_t* dst_ptr, +- const struct YuvConstants* yuvconstants, +- int width); + void I422AlphaToARGBRow_Any_LASX(const uint8_t* y_buf, + const uint8_t* u_buf, + const uint8_t* v_buf, +@@ -5363,12 +4710,6 @@ void I422ToRGB24Row_Any_MSA(const uint8_ + uint8_t* dst_ptr, + const struct YuvConstants* yuvconstants, + int width); +-void I422ToRGB24Row_Any_LSX(const uint8_t* y_buf, +- const uint8_t* u_buf, +- const uint8_t* v_buf, +- uint8_t* dst_ptr, +- const struct YuvConstants* yuvconstants, +- int width); + void I422ToRGB24Row_Any_LASX(const uint8_t* y_buf, + const uint8_t* u_buf, + const uint8_t* v_buf, +@@ -5381,12 +4722,6 @@ void I422ToRGB565Row_Any_MSA(const uint8 + uint8_t* dst_ptr, + const struct YuvConstants* yuvconstants, + int width); +-void I422ToRGB565Row_Any_LSX(const uint8_t* y_buf, +- const uint8_t* u_buf, +- const uint8_t* v_buf, +- uint8_t* dst_ptr, +- const struct YuvConstants* yuvconstants, +- int width); + void I422ToRGB565Row_Any_LASX(const uint8_t* y_buf, + const uint8_t* u_buf, + const uint8_t* v_buf, +@@ -5399,12 +4734,6 @@ void I422ToARGB4444Row_Any_MSA(const uin + uint8_t* dst_ptr, + const struct YuvConstants* yuvconstants, + int width); +-void I422ToARGB4444Row_Any_LSX(const uint8_t* y_buf, +- const uint8_t* u_buf, +- const uint8_t* v_buf, +- uint8_t* dst_ptr, +- const struct YuvConstants* yuvconstants, +- int width); + void I422ToARGB4444Row_Any_LASX(const uint8_t* y_buf, + const uint8_t* u_buf, + const uint8_t* v_buf, +@@ -5417,12 +4746,6 @@ void I422ToARGB1555Row_Any_MSA(const uin + uint8_t* dst_ptr, + const struct YuvConstants* yuvconstants, + int width); +-void I422ToARGB1555Row_Any_LSX(const uint8_t* y_buf, +- const uint8_t* u_buf, +- const uint8_t* v_buf, +- uint8_t* dst_ptr, +- const struct YuvConstants* yuvconstants, +- int width); + void I422ToARGB1555Row_Any_LASX(const uint8_t* y_buf, + const uint8_t* u_buf, + const uint8_t* v_buf, +@@ -5535,18 +4858,12 @@ void YUY2ToUV422Row_NEON(const uint8_t* + uint8_t* dst_v, + int width); + void YUY2ToYRow_MSA(const uint8_t* src_yuy2, uint8_t* dst_y, int width); +-void YUY2ToYRow_LSX(const uint8_t* src_yuy2, uint8_t* dst_y, int width); + void YUY2ToYRow_LASX(const uint8_t* src_yuy2, uint8_t* dst_y, int width); + void YUY2ToUVRow_MSA(const uint8_t* src_yuy2, + int src_stride_yuy2, + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void YUY2ToUVRow_LSX(const uint8_t* src_yuy2, +- int src_stride_yuy2, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void YUY2ToUVRow_LASX(const uint8_t* src_yuy2, + int src_stride_yuy2, + uint8_t* dst_u, +@@ -5556,10 +4873,6 @@ void YUY2ToUV422Row_MSA(const uint8_t* s + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void YUY2ToUV422Row_LSX(const uint8_t* src_yuy2, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void YUY2ToUV422Row_LASX(const uint8_t* src_yuy2, + uint8_t* dst_u, + uint8_t* dst_v, +@@ -5621,18 +4934,12 @@ void YUY2ToUV422Row_Any_NEON(const uint8 + uint8_t* dst_v, + int width); + void YUY2ToYRow_Any_MSA(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); +-void YUY2ToYRow_Any_LSX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); + void YUY2ToYRow_Any_LASX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); + void YUY2ToUVRow_Any_MSA(const uint8_t* src_ptr, + int src_stride_ptr, + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void YUY2ToUVRow_Any_LSX(const uint8_t* src_ptr, +- int src_stride_ptr, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void YUY2ToUVRow_Any_LASX(const uint8_t* src_ptr, + int src_stride_ptr, + uint8_t* dst_u, +@@ -5642,10 +4949,6 @@ void YUY2ToUV422Row_Any_MSA(const uint8_ + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void YUY2ToUV422Row_Any_LSX(const uint8_t* src_ptr, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void YUY2ToUV422Row_Any_LASX(const uint8_t* src_ptr, + uint8_t* dst_u, + uint8_t* dst_v, +@@ -5691,18 +4994,12 @@ void UYVYToUV422Row_NEON(const uint8_t* + uint8_t* dst_v, + int width); + void UYVYToYRow_MSA(const uint8_t* src_uyvy, uint8_t* dst_y, int width); +-void UYVYToYRow_LSX(const uint8_t* src_uyvy, uint8_t* dst_y, int width); + void UYVYToYRow_LASX(const uint8_t* src_uyvy, uint8_t* dst_y, int width); + void UYVYToUVRow_MSA(const uint8_t* src_uyvy, + int src_stride_uyvy, + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void UYVYToUVRow_LSX(const uint8_t* src_uyvy, +- int src_stride_uyvy, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void UYVYToUVRow_LASX(const uint8_t* src_uyvy, + int src_stride_uyvy, + uint8_t* dst_u, +@@ -5712,10 +5009,6 @@ void UYVYToUV422Row_MSA(const uint8_t* s + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void UYVYToUV422Row_LSX(const uint8_t* src_uyvy, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void UYVYToUV422Row_LASX(const uint8_t* src_uyvy, + uint8_t* dst_u, + uint8_t* dst_v, +@@ -5762,18 +5055,12 @@ void UYVYToUV422Row_Any_NEON(const uint8 + uint8_t* dst_v, + int width); + void UYVYToYRow_Any_MSA(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); +-void UYVYToYRow_Any_LSX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); + void UYVYToYRow_Any_LASX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); + void UYVYToUVRow_Any_MSA(const uint8_t* src_ptr, + int src_stride_ptr, + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void UYVYToUVRow_Any_LSX(const uint8_t* src_ptr, +- int src_stride_ptr, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void UYVYToUVRow_Any_LASX(const uint8_t* src_ptr, + int src_stride_ptr, + uint8_t* dst_u, +@@ -5783,10 +5070,6 @@ void UYVYToUV422Row_Any_MSA(const uint8_ + uint8_t* dst_u, + uint8_t* dst_v, + int width); +-void UYVYToUV422Row_Any_LSX(const uint8_t* src_ptr, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width); + void UYVYToUV422Row_Any_LASX(const uint8_t* src_ptr, + uint8_t* dst_u, + uint8_t* dst_v, +@@ -5812,35 +5095,19 @@ void AYUVToUVRow_NEON(const uint8_t* src + int src_stride_ayuv, + uint8_t* dst_uv, + int width); +-void AYUVToUVRow_SVE2(const uint8_t* src_ayuv, +- int src_stride_ayuv, +- uint8_t* dst_uv, +- int width); + void AYUVToVURow_NEON(const uint8_t* src_ayuv, + int src_stride_ayuv, + uint8_t* dst_vu, + int width); +-void AYUVToVURow_SVE2(const uint8_t* src_ayuv, +- int src_stride_ayuv, +- uint8_t* dst_vu, +- int width); + void AYUVToYRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); + void AYUVToUVRow_Any_NEON(const uint8_t* src_ptr, + int src_stride, + uint8_t* dst_vu, + int width); +-void AYUVToUVRow_Any_SVE2(const uint8_t* src_ptr, +- int src_stride, +- uint8_t* dst_vu, +- int width); + void AYUVToVURow_Any_NEON(const uint8_t* src_ptr, + int src_stride, + uint8_t* dst_vu, + int width); +-void AYUVToVURow_Any_SVE2(const uint8_t* src_ptr, +- int src_stride, +- uint8_t* dst_vu, +- int width); + + void I422ToYUY2Row_C(const uint8_t* src_y, + const uint8_t* src_u, +@@ -5917,11 +5184,6 @@ void I422ToYUY2Row_MSA(const uint8_t* sr + const uint8_t* src_v, + uint8_t* dst_yuy2, + int width); +-void I422ToYUY2Row_LSX(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_yuy2, +- int width); + void I422ToYUY2Row_LASX(const uint8_t* src_y, + const uint8_t* src_u, + const uint8_t* src_v, +@@ -5932,11 +5194,6 @@ void I422ToUYVYRow_MSA(const uint8_t* sr + const uint8_t* src_v, + uint8_t* dst_uyvy, + int width); +-void I422ToUYVYRow_LSX(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_uyvy, +- int width); + void I422ToUYVYRow_LASX(const uint8_t* src_y, + const uint8_t* src_u, + const uint8_t* src_v, +@@ -5947,11 +5204,6 @@ void I422ToYUY2Row_Any_MSA(const uint8_t + const uint8_t* v_buf, + uint8_t* dst_ptr, + int width); +-void I422ToYUY2Row_Any_LSX(const uint8_t* y_buf, +- const uint8_t* u_buf, +- const uint8_t* v_buf, +- uint8_t* dst_ptr, +- int width); + void I422ToYUY2Row_Any_LASX(const uint8_t* y_buf, + const uint8_t* u_buf, + const uint8_t* v_buf, +@@ -5962,11 +5214,6 @@ void I422ToUYVYRow_Any_MSA(const uint8_t + const uint8_t* v_buf, + uint8_t* dst_ptr, + int width); +-void I422ToUYVYRow_Any_LSX(const uint8_t* y_buf, +- const uint8_t* u_buf, +- const uint8_t* v_buf, +- uint8_t* dst_ptr, +- int width); + void I422ToUYVYRow_Any_LASX(const uint8_t* y_buf, + const uint8_t* u_buf, + const uint8_t* v_buf, +@@ -5987,15 +5234,9 @@ void ARGBAttenuateRow_NEON(const uint8_t + void ARGBAttenuateRow_MSA(const uint8_t* src_argb, + uint8_t* dst_argb, + int width); +-void ARGBAttenuateRow_LSX(const uint8_t* src_argb, +- uint8_t* dst_argb, +- int width); + void ARGBAttenuateRow_LASX(const uint8_t* src_argb, + uint8_t* dst_argb, + int width); +-void ARGBAttenuateRow_RVV(const uint8_t* src_argb, +- uint8_t* dst_argb, +- int width); + void ARGBAttenuateRow_Any_SSSE3(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int width); +@@ -6008,9 +5249,6 @@ void ARGBAttenuateRow_Any_NEON(const uin + void ARGBAttenuateRow_Any_MSA(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int width); +-void ARGBAttenuateRow_Any_LSX(const uint8_t* src_ptr, +- uint8_t* dst_ptr, +- int width); + void ARGBAttenuateRow_Any_LASX(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int width); +@@ -6037,14 +5275,12 @@ void ARGBGrayRow_C(const uint8_t* src_ar + void ARGBGrayRow_SSSE3(const uint8_t* src_argb, uint8_t* dst_argb, int width); + void ARGBGrayRow_NEON(const uint8_t* src_argb, uint8_t* dst_argb, int width); + void ARGBGrayRow_MSA(const uint8_t* src_argb, uint8_t* dst_argb, int width); +-void ARGBGrayRow_LSX(const uint8_t* src_argb, uint8_t* dst_argb, int width); + void ARGBGrayRow_LASX(const uint8_t* src_argb, uint8_t* dst_argb, int width); + + void ARGBSepiaRow_C(uint8_t* dst_argb, int width); + void ARGBSepiaRow_SSSE3(uint8_t* dst_argb, int width); + void ARGBSepiaRow_NEON(uint8_t* dst_argb, int width); + void ARGBSepiaRow_MSA(uint8_t* dst_argb, int width); +-void ARGBSepiaRow_LSX(uint8_t* dst_argb, int width); + void ARGBSepiaRow_LASX(uint8_t* dst_argb, int width); + + void ARGBColorMatrixRow_C(const uint8_t* src_argb, +@@ -6059,10 +5295,6 @@ void ARGBColorMatrixRow_NEON(const uint8 + uint8_t* dst_argb, + const int8_t* matrix_argb, + int width); +-void ARGBColorMatrixRow_NEON_I8MM(const uint8_t* src_argb, +- uint8_t* dst_argb, +- const int8_t* matrix_argb, +- int width); + void ARGBColorMatrixRow_MSA(const uint8_t* src_argb, + uint8_t* dst_argb, + const int8_t* matrix_argb, +@@ -6128,10 +5360,6 @@ void ARGBShadeRow_MSA(const uint8_t* src + uint8_t* dst_argb, + int width, + uint32_t value); +-void ARGBShadeRow_LSX(const uint8_t* src_argb, +- uint8_t* dst_argb, +- int width, +- uint32_t value); + void ARGBShadeRow_LASX(const uint8_t* src_argb, + uint8_t* dst_argb, + int width, +@@ -6204,11 +5432,6 @@ void InterpolateRow_LSX(uint8_t* dst_ptr + ptrdiff_t src_stride, + int width, + int source_y_fraction); +-void InterpolateRow_RVV(uint8_t* dst_ptr, +- const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- int width, +- int source_y_fraction); + void InterpolateRow_Any_NEON(uint8_t* dst_ptr, + const uint8_t* src_ptr, + ptrdiff_t src_stride_ptr, +@@ -6516,19 +5739,7 @@ void ByteToFloatRow_Any_NEON(const uint8 + float* dst_ptr, + float param, + int width); +-// Convert FP16 Half Floats to FP32 Floats +-void ConvertFP16ToFP32Row_NEON(const uint16_t* src, // fp16 +- float* dst, +- int width); +-// Convert a column of FP16 Half Floats to a row of FP32 Floats +-void ConvertFP16ToFP32Column_NEON(const uint16_t* src, // fp16 +- int src_stride, // stride in elements +- float* dst, +- int width); +-// Convert FP32 Floats to FP16 Half Floats +-void ConvertFP32ToFP16Row_NEON(const float* src, +- uint16_t* dst, // fp16 +- int width); ++ + void ARGBLumaColorTableRow_C(const uint8_t* src_argb, + uint8_t* dst_argb, + int width, +diff --git a/media/libyuv/libyuv/include/libyuv/scale.h b/media/libyuv/libyuv/include/libyuv/scale.h +--- a/media/libyuv/libyuv/include/libyuv/scale.h ++++ b/media/libyuv/libyuv/include/libyuv/scale.h +@@ -27,40 +27,39 @@ typedef enum FilterMode { + } FilterModeEnum; + + // Scale a YUV plane. +-// Returns 0 if successful. + LIBYUV_API +-int ScalePlane(const uint8_t* src, +- int src_stride, +- int src_width, +- int src_height, +- uint8_t* dst, +- int dst_stride, +- int dst_width, +- int dst_height, +- enum FilterMode filtering); ++void ScalePlane(const uint8_t* src, ++ int src_stride, ++ int src_width, ++ int src_height, ++ uint8_t* dst, ++ int dst_stride, ++ int dst_width, ++ int dst_height, ++ enum FilterMode filtering); + + LIBYUV_API +-int ScalePlane_16(const uint16_t* src, +- int src_stride, +- int src_width, +- int src_height, +- uint16_t* dst, +- int dst_stride, +- int dst_width, +- int dst_height, +- enum FilterMode filtering); ++void ScalePlane_16(const uint16_t* src, ++ int src_stride, ++ int src_width, ++ int src_height, ++ uint16_t* dst, ++ int dst_stride, ++ int dst_width, ++ int dst_height, ++ enum FilterMode filtering); + + // Sample is expected to be in the low 12 bits. + LIBYUV_API +-int ScalePlane_12(const uint16_t* src, +- int src_stride, +- int src_width, +- int src_height, +- uint16_t* dst, +- int dst_stride, +- int dst_width, +- int dst_height, +- enum FilterMode filtering); ++void ScalePlane_12(const uint16_t* src, ++ int src_stride, ++ int src_width, ++ int src_height, ++ uint16_t* dst, ++ int dst_stride, ++ int dst_width, ++ int dst_height, ++ enum FilterMode filtering); + + // Scales a YUV 4:2:0 image from the src width and height to the + // dst width and height. +diff --git a/media/libyuv/libyuv/include/libyuv/scale_row.h b/media/libyuv/libyuv/include/libyuv/scale_row.h +--- a/media/libyuv/libyuv/include/libyuv/scale_row.h ++++ b/media/libyuv/libyuv/include/libyuv/scale_row.h +@@ -29,10 +29,7 @@ extern "C" { + #endif + // MemorySanitizer does not support assembly code yet. http://crbug.com/344505 + #if defined(__has_feature) +-#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_NEON) +-#define LIBYUV_DISABLE_NEON +-#endif +-#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_X86) ++#if __has_feature(memory_sanitizer) + #define LIBYUV_DISABLE_X86 + #endif + #endif +@@ -136,8 +133,6 @@ extern "C" { + #define HAS_SCALEROWDOWN34_NEON + #define HAS_SCALEROWDOWN38_NEON + #define HAS_SCALEROWDOWN4_NEON +-#define HAS_SCALEUVROWDOWN2_NEON +-#define HAS_SCALEUVROWDOWN2LINEAR_NEON + #define HAS_SCALEUVROWDOWN2BOX_NEON + #define HAS_SCALEUVROWDOWNEVEN_NEON + #define HAS_SCALEROWUP2_LINEAR_NEON +@@ -178,38 +173,6 @@ extern "C" { + #define HAS_SCALEROWDOWN34_LSX + #endif + +-#if !defined(LIBYUV_DISABLE_RVV) && defined(__riscv_vector) +-#define HAS_SCALEADDROW_RVV +-// TODO: Test ScaleARGBRowDownEven_RVV and enable it +-// #define HAS_SCALEARGBROWDOWNEVEN_RVV +-#if defined(__riscv_zve64x) +-#define HAS_SCALEUVROWDOWN4_RVV +-#endif +-#define HAS_SCALEUVROWDOWNEVEN_RVV +-#define HAS_SCALEARGBROWDOWN2_RVV +-#define HAS_SCALEARGBROWDOWN2BOX_RVV +-#define HAS_SCALEARGBROWDOWN2LINEAR_RVV +-#define HAS_SCALEARGBROWDOWNEVENBOX_RVV +-#define HAS_SCALEROWDOWN2_RVV +-#define HAS_SCALEROWDOWN2BOX_RVV +-#define HAS_SCALEROWDOWN2LINEAR_RVV +-#define HAS_SCALEROWDOWN34_0_BOX_RVV +-#define HAS_SCALEROWDOWN34_1_BOX_RVV +-#define HAS_SCALEROWDOWN34_RVV +-#define HAS_SCALEROWDOWN38_2_BOX_RVV +-#define HAS_SCALEROWDOWN38_3_BOX_RVV +-#define HAS_SCALEROWDOWN38_RVV +-#define HAS_SCALEROWDOWN4_RVV +-#define HAS_SCALEROWDOWN4BOX_RVV +-#define HAS_SCALEROWUP2_BILINEAR_RVV +-#define HAS_SCALEROWUP2_LINEAR_RVV +-#define HAS_SCALEUVROWDOWN2_RVV +-#define HAS_SCALEUVROWDOWN2BOX_RVV +-#define HAS_SCALEUVROWDOWN2LINEAR_RVV +-#define HAS_SCALEUVROWUP2_BILINEAR_RVV +-#define HAS_SCALEUVROWUP2_LINEAR_RVV +-#endif +- + // Scale ARGB vertically with bilinear interpolation. + void ScalePlaneVertical(int src_height, + int dst_width, +@@ -984,18 +947,6 @@ void ScaleARGBRowDown2Box_NEON(const uin + ptrdiff_t src_stride, + uint8_t* dst, + int dst_width); +-void ScaleARGBRowDown2_RVV(const uint8_t* src_argb, +- ptrdiff_t src_stride, +- uint8_t* dst_argb, +- int dst_width); +-void ScaleARGBRowDown2Linear_RVV(const uint8_t* src_argb, +- ptrdiff_t src_stride, +- uint8_t* dst_argb, +- int dst_width); +-void ScaleARGBRowDown2Box_RVV(const uint8_t* src_argb, +- ptrdiff_t src_stride, +- uint8_t* dst_argb, +- int dst_width); + void ScaleARGBRowDown2_MSA(const uint8_t* src_argb, + ptrdiff_t src_stride, + uint8_t* dst_argb, +@@ -1108,16 +1059,6 @@ void ScaleARGBRowDownEvenBox_LSX(const u + int src_stepx, + uint8_t* dst_argb, + int dst_width); +-void ScaleARGBRowDownEven_RVV(const uint8_t* src_argb, +- ptrdiff_t src_stride, +- int32_t src_stepx, +- uint8_t* dst_argb, +- int dst_width); +-void ScaleARGBRowDownEvenBox_RVV(const uint8_t* src_argb, +- ptrdiff_t src_stride, +- int src_stepx, +- uint8_t* dst_argb, +- int dst_width); + void ScaleARGBRowDownEven_Any_SSE2(const uint8_t* src_ptr, + ptrdiff_t src_stride, + int src_stepx, +@@ -1200,18 +1141,6 @@ void ScaleUVRowDown2Box_MSA(const uint8_ + ptrdiff_t src_stride, + uint8_t* dst_uv, + int dst_width); +-void ScaleUVRowDown2_RVV(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- uint8_t* dst_uv, +- int dst_width); +-void ScaleUVRowDown2Linear_RVV(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- uint8_t* dst_uv, +- int dst_width); +-void ScaleUVRowDown2Box_RVV(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- uint8_t* dst, +- int dst_width); + void ScaleUVRowDown2_Any_SSSE3(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, +@@ -1272,16 +1201,6 @@ void ScaleUVRowDownEvenBox_NEON(const ui + int src_stepx, + uint8_t* dst_uv, + int dst_width); +-void ScaleUVRowDown4_RVV(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- int32_t src_stepx, +- uint8_t* dst_uv, +- int dst_width); +-void ScaleUVRowDownEven_RVV(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- int32_t src_stepx, +- uint8_t* dst_uv, +- int dst_width); + void ScaleUVRowDownEven_MSA(const uint8_t* src_ptr, + ptrdiff_t src_stride, + int32_t src_stepx, +@@ -1371,14 +1290,6 @@ void ScaleUVRowUp2_Bilinear_Any_NEON(con + uint8_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width); +-void ScaleUVRowUp2_Linear_RVV(const uint8_t* src_ptr, +- uint8_t* dst_ptr, +- int dst_width); +-void ScaleUVRowUp2_Bilinear_RVV(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- uint8_t* dst_ptr, +- ptrdiff_t dst_stride, +- int dst_width); + void ScaleUVRowUp2_Linear_16_SSE41(const uint16_t* src_ptr, + uint16_t* dst_ptr, + int dst_width); +@@ -1831,61 +1742,6 @@ void ScaleRowDown34_1_Box_Any_LSX(const + uint8_t* dst_ptr, + int dst_width); + +-void ScaleAddRow_RVV(const uint8_t* src_ptr, uint16_t* dst_ptr, int src_width); +-void ScaleRowDown2_RVV(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- uint8_t* dst, +- int dst_width); +-void ScaleRowDown2Linear_RVV(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- uint8_t* dst, +- int dst_width); +-void ScaleRowDown2Box_RVV(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- uint8_t* dst, +- int dst_width); +- +-void ScaleRowDown4_RVV(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- uint8_t* dst_ptr, +- int dst_width); +-void ScaleRowDown4Box_RVV(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- uint8_t* dst_ptr, +- int dst_width); +-void ScaleRowDown34_RVV(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- uint8_t* dst_ptr, +- int dst_width); +-void ScaleRowDown34_0_Box_RVV(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- uint8_t* dst_ptr, +- int dst_width); +-void ScaleRowDown34_1_Box_RVV(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- uint8_t* dst_ptr, +- int dst_width); +-void ScaleRowDown38_RVV(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- uint8_t* dst, +- int dst_width); +-void ScaleRowDown38_3_Box_RVV(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- uint8_t* dst_ptr, +- int dst_width); +-void ScaleRowDown38_2_Box_RVV(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- uint8_t* dst_ptr, +- int dst_width); +- +-void ScaleRowUp2_Linear_RVV(const uint8_t* src_ptr, +- uint8_t* dst_ptr, +- int dst_width); +-void ScaleRowUp2_Bilinear_RVV(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- uint8_t* dst_ptr, +- ptrdiff_t dst_stride, +- int dst_width); + #ifdef __cplusplus + } // extern "C" + } // namespace libyuv +diff --git a/media/libyuv/libyuv/include/libyuv/version.h b/media/libyuv/libyuv/include/libyuv/version.h +--- a/media/libyuv/libyuv/include/libyuv/version.h ++++ b/media/libyuv/libyuv/include/libyuv/version.h +@@ -11,6 +11,6 @@ + #ifndef INCLUDE_LIBYUV_VERSION_H_ + #define INCLUDE_LIBYUV_VERSION_H_ + +-#define LIBYUV_VERSION 1889 ++#define LIBYUV_VERSION 1860 + + #endif // INCLUDE_LIBYUV_VERSION_H_ +diff --git a/media/libyuv/libyuv/infra/config/commit-queue.cfg b/media/libyuv/libyuv/infra/config/commit-queue.cfg +--- a/media/libyuv/libyuv/infra/config/commit-queue.cfg ++++ b/media/libyuv/libyuv/infra/config/commit-queue.cfg +@@ -2,7 +2,7 @@ + # Do not modify manually. + # + # For the schema of this file, see Config message: +-# https://config.luci.app/schemas/projects:commit-queue.cfg ++# https://luci-config.appspot.com/schemas/projects:commit-queue.cfg + + cq_status_host: "chromium-cq-status.appspot.com" + submit_options { +diff --git a/media/libyuv/libyuv/infra/config/cr-buildbucket.cfg b/media/libyuv/libyuv/infra/config/cr-buildbucket.cfg +--- a/media/libyuv/libyuv/infra/config/cr-buildbucket.cfg ++++ b/media/libyuv/libyuv/infra/config/cr-buildbucket.cfg +@@ -2,7 +2,7 @@ + # Do not modify manually. + # + # For the schema of this file, see BuildbucketCfg message: +-# https://config.luci.app/schemas/projects:buildbucket.cfg ++# https://luci-config.appspot.com/schemas/projects:buildbucket.cfg + + buckets { + name: "ci" +@@ -20,7 +20,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -29,6 +29,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -50,7 +55,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -59,6 +64,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -80,7 +90,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -89,6 +99,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -108,7 +123,7 @@ buckets { + name: "Android Tester ARM32 Debug (Nexus 5X)" + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" +- dimensions: "device_type:walleye" ++ dimensions: "device_type:bullhead" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -117,6 +132,10 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -136,7 +155,7 @@ buckets { + name: "Android Tester ARM32 Release (Nexus 5X)" + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" +- dimensions: "device_type:walleye" ++ dimensions: "device_type:bullhead" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -145,6 +164,10 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -164,7 +187,7 @@ buckets { + name: "Android Tester ARM64 Debug (Nexus 5X)" + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" +- dimensions: "device_type:walleye" ++ dimensions: "device_type:bullhead" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -173,6 +196,10 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -194,7 +221,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -203,6 +230,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -224,7 +256,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -233,6 +265,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -254,7 +291,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -263,6 +300,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -284,7 +326,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -293,6 +335,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -314,7 +361,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -323,6 +370,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -344,7 +396,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -353,6 +405,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -374,7 +431,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -383,6 +440,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -404,7 +466,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -413,6 +475,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -434,7 +501,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -443,6 +510,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -464,7 +536,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -473,6 +545,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -494,7 +571,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -503,6 +580,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -523,7 +605,7 @@ buckets { + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cpu:x86-64" +- dimensions: "os:Mac-12" ++ dimensions: "os:Mac-10.15" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -532,6 +614,10 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -552,7 +638,7 @@ buckets { + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cpu:x86-64" +- dimensions: "os:Mac-12" ++ dimensions: "os:Mac-10.15" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -561,6 +647,10 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -581,7 +671,7 @@ buckets { + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cpu:x86-64" +- dimensions: "os:Mac-12" ++ dimensions: "os:Mac-10.15" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -590,6 +680,10 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -620,6 +714,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -650,6 +749,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -680,6 +784,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -710,6 +819,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -740,6 +854,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -770,6 +889,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -800,6 +924,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -830,6 +959,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -850,7 +984,7 @@ buckets { + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cpu:x86-64" +- dimensions: "os:Mac-12" ++ dimensions: "os:Mac-10.15" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -859,6 +993,10 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -879,7 +1017,7 @@ buckets { + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cpu:x86-64" +- dimensions: "os:Mac-12" ++ dimensions: "os:Mac-10.15" + dimensions: "pool:luci.flex.ci" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -888,6 +1026,10 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-trusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -963,7 +1105,7 @@ buckets { + name: "android" + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" +- dimensions: "device_type:walleye" ++ dimensions: "device_type:bullhead" + dimensions: "pool:luci.flex.try" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -972,6 +1114,10 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -991,7 +1137,7 @@ buckets { + name: "android_arm64" + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" +- dimensions: "device_type:walleye" ++ dimensions: "device_type:bullhead" + dimensions: "pool:luci.flex.try" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -1000,6 +1146,10 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1019,7 +1169,7 @@ buckets { + name: "android_rel" + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" +- dimensions: "device_type:walleye" ++ dimensions: "device_type:bullhead" + dimensions: "pool:luci.flex.try" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -1028,6 +1178,10 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1049,7 +1203,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.try" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -1058,6 +1212,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1079,7 +1238,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.try" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -1088,6 +1247,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1108,7 +1272,7 @@ buckets { + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cpu:x86-64" +- dimensions: "os:Mac-12" ++ dimensions: "os:Mac-10.15" + dimensions: "pool:luci.flex.try" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -1117,6 +1281,10 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1137,7 +1305,7 @@ buckets { + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cpu:x86-64" +- dimensions: "os:Mac-12" ++ dimensions: "os:Mac-10.15" + dimensions: "pool:luci.flex.try" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -1146,6 +1314,10 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1167,7 +1339,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.try" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -1176,6 +1348,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1197,7 +1374,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.try" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -1206,6 +1383,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1227,7 +1409,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.try" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -1236,6 +1418,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1257,7 +1444,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.try" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -1266,6 +1453,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1287,7 +1479,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.try" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -1296,6 +1488,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1317,7 +1514,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.try" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -1326,6 +1523,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1347,7 +1549,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.try" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -1356,6 +1558,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1377,7 +1584,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.try" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -1386,6 +1593,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1406,7 +1618,7 @@ buckets { + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cpu:x86-64" +- dimensions: "os:Mac-12" ++ dimensions: "os:Mac-10.15" + dimensions: "pool:luci.flex.try" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -1415,6 +1627,10 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1435,7 +1651,7 @@ buckets { + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cpu:x86-64" +- dimensions: "os:Mac-12" ++ dimensions: "os:Mac-10.15" + dimensions: "pool:luci.flex.try" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -1444,6 +1660,10 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1464,7 +1684,7 @@ buckets { + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cpu:x86-64" +- dimensions: "os:Mac-12" ++ dimensions: "os:Mac-10.15" + dimensions: "pool:luci.flex.try" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -1473,6 +1693,10 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1494,7 +1718,7 @@ buckets { + swarming_tags: "vpython:native-python-wrapper" + dimensions: "cores:8" + dimensions: "cpu:x86-64" +- dimensions: "os:Ubuntu-22.04" ++ dimensions: "os:Ubuntu-18.04" + dimensions: "pool:luci.flex.try" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" +@@ -1503,6 +1727,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": true,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1535,6 +1764,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": false,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1565,6 +1799,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": false,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1595,6 +1834,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": false,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1625,6 +1869,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": false,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1655,6 +1904,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": false,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +@@ -1685,6 +1939,11 @@ buckets { + } + properties: + '{' ++ ' "$build/goma": {' ++ ' "enable_ats": false,' ++ ' "server_host": "goma.chromium.org",' ++ ' "use_luci_auth": true' ++ ' },' + ' "$build/reclient": {' + ' "instance": "rbe-webrtc-untrusted",' + ' "metrics_project": "chromium-reclient-metrics"' +diff --git a/media/libyuv/libyuv/infra/config/luci-logdog.cfg b/media/libyuv/libyuv/infra/config/luci-logdog.cfg +--- a/media/libyuv/libyuv/infra/config/luci-logdog.cfg ++++ b/media/libyuv/libyuv/infra/config/luci-logdog.cfg +@@ -2,7 +2,7 @@ + # Do not modify manually. + # + # For the schema of this file, see ProjectConfig message: +-# https://config.luci.app/schemas/projects:luci-logdog.cfg ++# https://luci-config.appspot.com/schemas/projects:luci-logdog.cfg + + reader_auth_groups: "all" + writer_auth_groups: "luci-logdog-chromium-writers" +diff --git a/media/libyuv/libyuv/infra/config/luci-milo.cfg b/media/libyuv/libyuv/infra/config/luci-milo.cfg +--- a/media/libyuv/libyuv/infra/config/luci-milo.cfg ++++ b/media/libyuv/libyuv/infra/config/luci-milo.cfg +@@ -2,7 +2,7 @@ + # Do not modify manually. + # + # For the schema of this file, see Project message: +-# https://config.luci.app/schemas/projects:luci-milo.cfg ++# https://luci-config.appspot.com/schemas/projects:luci-milo.cfg + + consoles { + id: "main" +diff --git a/media/libyuv/libyuv/infra/config/luci-scheduler.cfg b/media/libyuv/libyuv/infra/config/luci-scheduler.cfg +--- a/media/libyuv/libyuv/infra/config/luci-scheduler.cfg ++++ b/media/libyuv/libyuv/infra/config/luci-scheduler.cfg +@@ -2,7 +2,7 @@ + # Do not modify manually. + # + # For the schema of this file, see ProjectConfig message: +-# https://config.luci.app/schemas/projects:luci-scheduler.cfg ++# https://luci-config.appspot.com/schemas/projects:luci-scheduler.cfg + + job { + id: "Android ARM64 Debug" +diff --git a/media/libyuv/libyuv/infra/config/main.star b/media/libyuv/libyuv/infra/config/main.star +--- a/media/libyuv/libyuv/infra/config/main.star ++++ b/media/libyuv/libyuv/infra/config/main.star +@@ -8,6 +8,24 @@ lucicfg.check_version("1.30.9") + LIBYUV_GIT = "https://chromium.googlesource.com/libyuv/libyuv" + LIBYUV_GERRIT = "https://chromium-review.googlesource.com/libyuv/libyuv" + ++GOMA_BACKEND_RBE_PROD = { ++ "server_host": "goma.chromium.org", ++ "use_luci_auth": True, ++} ++ ++GOMA_BACKEND_RBE_ATS_PROD = { ++ "server_host": "goma.chromium.org", ++ "use_luci_auth": True, ++ "enable_ats": True, ++} ++ ++# Disable ATS on Windows CQ/try. ++GOMA_BACKEND_RBE_NO_ATS_PROD = { ++ "server_host": "goma.chromium.org", ++ "use_luci_auth": True, ++ "enable_ats": False, ++} ++ + RECLIENT_CI = { + "instance": "rbe-webrtc-trusted", + "metrics_project": "chromium-reclient-metrics", +@@ -62,7 +80,7 @@ luci.project( + ], + bindings = [ + luci.binding( +- roles = "role/swarming.taskTriggerer", # for LED tasks. ++ roles = "role/swarming.taskTriggerer", # for LED tasks. + groups = "project-libyuv-admins", + ), + luci.binding( +@@ -191,13 +209,26 @@ luci.bucket( + + def get_os_dimensions(os): + if os == "android": +- return {"device_type": "walleye"} ++ return {"device_type": "bullhead"} + if os == "ios" or os == "mac": +- return {"os": "Mac-12", "cpu": "x86-64"} ++ return {"os": "Mac-10.15", "cpu": "x86-64"} + elif os == "win": + return {"os": "Windows-10", "cores": "8", "cpu": "x86-64"} + elif os == "linux": +- return {"os": "Ubuntu-22.04", "cores": "8", "cpu": "x86-64"} ++ return {"os": "Ubuntu-18.04", "cores": "8", "cpu": "x86-64"} ++ return {} ++ ++def get_os_properties(os, try_builder = False): ++ if os == "android": ++ return {"$build/goma": GOMA_BACKEND_RBE_PROD} ++ elif os in ("ios", "mac"): ++ return {"$build/goma": GOMA_BACKEND_RBE_PROD} ++ elif os == "win" and try_builder: ++ return {"$build/goma": GOMA_BACKEND_RBE_NO_ATS_PROD} ++ elif os == "win": ++ return {"$build/goma": GOMA_BACKEND_RBE_ATS_PROD} ++ elif os == "linux": ++ return {"$build/goma": GOMA_BACKEND_RBE_ATS_PROD} + return {} + + def libyuv_ci_builder(name, dimensions, properties, triggered_by): +@@ -237,7 +268,8 @@ def libyuv_try_builder(name, dimensions, + + def ci_builder(name, os, category, short_name = None): + dimensions = get_os_dimensions(os) +- properties = {"$build/reclient": RECLIENT_CI} ++ properties = get_os_properties(os) ++ properties["$build/reclient"] = RECLIENT_CI + + dimensions["pool"] = "luci.flex.ci" + properties["builder_group"] = "client.libyuv" +@@ -248,7 +280,8 @@ def ci_builder(name, os, category, short + + def try_builder(name, os, experiment_percentage = None): + dimensions = get_os_dimensions(os) +- properties = {"$build/reclient": RECLIENT_CQ} ++ properties = get_os_properties(os, try_builder = True) ++ properties["$build/reclient"] = RECLIENT_CQ + + dimensions["pool"] = "luci.flex.try" + properties["builder_group"] = "tryserver.libyuv" +diff --git a/media/libyuv/libyuv/infra/config/project.cfg b/media/libyuv/libyuv/infra/config/project.cfg +--- a/media/libyuv/libyuv/infra/config/project.cfg ++++ b/media/libyuv/libyuv/infra/config/project.cfg +@@ -2,12 +2,12 @@ + # Do not modify manually. + # + # For the schema of this file, see ProjectCfg message: +-# https://config.luci.app/schemas/projects:project.cfg ++# https://luci-config.appspot.com/schemas/projects:project.cfg + + name: "libyuv" + access: "group:all" + lucicfg { +- version: "1.43.6" ++ version: "1.32.1" + package_dir: "." + config_dir: "." + entry_point: "main.star" +diff --git a/media/libyuv/libyuv/infra/config/realms.cfg b/media/libyuv/libyuv/infra/config/realms.cfg +--- a/media/libyuv/libyuv/infra/config/realms.cfg ++++ b/media/libyuv/libyuv/infra/config/realms.cfg +@@ -2,7 +2,7 @@ + # Do not modify manually. + # + # For the schema of this file, see RealmsCfg message: +-# https://config.luci.app/schemas/projects:realms.cfg ++# https://luci-config.appspot.com/schemas/projects:realms.cfg + + realms { + name: "@root" +diff --git a/media/libyuv/libyuv/libyuv.gni b/media/libyuv/libyuv/libyuv.gni +--- a/media/libyuv/libyuv/libyuv.gni ++++ b/media/libyuv/libyuv/libyuv.gni +@@ -7,25 +7,17 @@ + # be found in the AUTHORS file in the root of the source tree. + + import("//build/config/arm.gni") +-import("//build/config/loongarch64.gni") + import("//build/config/mips.gni") + import("//build_overrides/build.gni") + + declare_args() { + libyuv_include_tests = !build_with_chromium + libyuv_disable_jpeg = false +- libyuv_disable_rvv = false + libyuv_use_neon = + current_cpu == "arm64" || + (current_cpu == "arm" && (arm_use_neon || arm_optionally_use_neon)) +- libyuv_use_sve = current_cpu == "arm64" +- libyuv_use_sme = current_cpu == "arm64" + libyuv_use_msa = + (current_cpu == "mips64el" || current_cpu == "mipsel") && mips_use_msa + libyuv_use_mmi = + (current_cpu == "mips64el" || current_cpu == "mipsel") && mips_use_mmi +- libyuv_use_lsx = +- (current_cpu == "loong64") && loongarch64_use_lsx +- libyuv_use_lasx = +- (current_cpu == "loong64") && loongarch64_use_lasx + } +diff --git a/media/libyuv/libyuv/libyuv.gyp b/media/libyuv/libyuv/libyuv.gyp +--- a/media/libyuv/libyuv/libyuv.gyp ++++ b/media/libyuv/libyuv/libyuv.gyp +@@ -71,7 +71,9 @@ + # '-mthumb', # arm32 not thumb + ], + 'cflags_mozilla!': [ +- '<@(moz_neon_cflags_block_list)', ++ '-mfpu=vfp', ++ '-mfpu=vfpv3', ++ '-mfpu=vfpv3-d16', + ], + 'conditions': [ + # Disable LTO in libyuv_neon target due to gcc 4.9 compiler bug. +@@ -160,95 +162,12 @@ + '-Wl,--dynamic-linker,/system/bin/linker', + ], + }], +- ['target_arch == "armv7" or target_arch == "arm64" and moz_have_arm_i8mm_and_dot_prod == 1 and build_with_mozilla == 1', { +- 'dependencies': [ +- ':libyuv_neon', +- ], +- }], +- ['target_arch == "arm64" and moz_have_arm_sve2 == 1 and build_with_mozilla == 1', { +- 'dependencies': [ +- ':libyuv_sve', +- ], +- 'defines' :[ +- 'LIBYUV_SVE', +- ] +- }], +- ['target_arch == "arm64" and moz_have_arm_sve2 == 1 and build_with_mozilla == 1', { +- 'dependencies': [ +- ':libyuv_sve', +- ], +- 'defines' :[ +- 'LIBYUV_SVE', +- ] +- }], + ], #conditions + }, + 'sources': [ + '<@(libyuv_sources)', + ], + }, +- { +- 'target_name': 'libyuv_neon', +- 'type': 'static_library', +- 'variables': { +- 'optimize': 'max', # enable O2 and ltcg. +- }, +- 'conditions': [ +- ['target_arch == "arm64" and moz_have_arm_i8mm_and_dot_prod == 1 and build_with_mozilla == 1', { +- 'cflags_mozilla': [ +- '-march=armv8.2-a+dotprod+i8mm', +- ], +- }], +- ['build_neon != 0', { +- 'cflags_mozilla!': [ +- '<@(moz_neon_cflags_block_list)', +- ], +- 'sources': [ +- '<@(libyuv_neon_sources)', +- ], +- }], +- ], #conditions +- 'include_dirs': [ +- 'include', +- '.', +- ], +- 'direct_dependent_settings': { +- 'include_dirs': [ +- 'include', +- '.', +- ], #conditions +- }, +- }, +- { +- 'target_name': 'libyuv_sve', +- 'type': 'static_library', +- 'variables': { +- 'optimize': 'max', # enable O2 and ltcg. +- }, +- 'conditions': [ +- ['target_arch == "arm64" and moz_have_arm_sve2 == 1 and build_with_mozilla == 1', { +- 'cflags_mozilla!': [ +- '<@(moz_neon_cflags_block_list)', +- ], +- 'cflags_mozilla': [ +- '-march=armv9-a+dotprod+sve2+i8mm', +- ], +- 'sources': [ +- '<@(libyuv_sve_sources)', +- ], +- }], +- ], #conditions +- 'include_dirs': [ +- 'include', +- '.', +- ], +- 'direct_dependent_settings': { +- 'include_dirs': [ +- 'include', +- '.', +- ], #conditions +- }, +- }, + ], # targets. + } + +diff --git a/media/libyuv/libyuv/libyuv.gypi b/media/libyuv/libyuv/libyuv.gypi +--- a/media/libyuv/libyuv/libyuv.gypi ++++ b/media/libyuv/libyuv/libyuv.gypi +@@ -8,41 +8,16 @@ + + { + 'variables': { +- 'moz_have_arm_sve2%': '<(moz_have_arm_sve2)', +- 'moz_have_arm_i8mm_and_dot_prod%': '<(moz_have_arm_i8mm_and_dot_prod)', +- 'moz_neon_cflags_block_list': [ +- '-mfpu=vfp', +- '-mfpu=vfpv3', +- '-mfpu=vfpv3-d16', +- ], +- # Needs to be reflected in upstream gyp file. +- 'libyuv_sve_sources': [ +- # sources. +- 'source/row_sve.cc', +- ], +- 'libyuv_neon_sources': [ +- # ARM Source Files +- "source/compare_neon.cc", +- "source/compare_neon64.cc", +- "source/rotate_neon.cc", +- "source/rotate_neon64.cc", +- "source/row_neon.cc", +- "source/row_neon64.cc", +- "source/scale_neon.cc", +- "source/scale_neon64.cc", +- ], + 'libyuv_sources': [ + # includes. + 'include/libyuv.h', + 'include/libyuv/basic_types.h', + 'include/libyuv/compare.h', +- 'include/libyuv/compare_row.h', + 'include/libyuv/convert.h', + 'include/libyuv/convert_argb.h', + 'include/libyuv/convert_from.h', + 'include/libyuv/convert_from_argb.h', + 'include/libyuv/cpu_id.h', +- 'include/libyuv/loongson_intrinsics.h', + 'include/libyuv/macros_msa.h', + 'include/libyuv/mjpeg_decoder.h', + 'include/libyuv/planar_functions.h', +@@ -63,6 +38,8 @@ + 'source/compare_common.cc', + 'source/compare_gcc.cc', + 'source/compare_msa.cc', ++ 'source/compare_neon.cc', ++ 'source/compare_neon64.cc', + 'source/compare_win.cc', + 'source/convert.cc', + 'source/convert_argb.cc', +@@ -81,11 +58,15 @@ + 'source/rotate_common.cc', + 'source/rotate_gcc.cc', + 'source/rotate_msa.cc', ++ 'source/rotate_neon.cc', ++ 'source/rotate_neon64.cc', + 'source/rotate_win.cc', + 'source/row_any.cc', + 'source/row_common.cc', + 'source/row_gcc.cc', + 'source/row_msa.cc', ++ 'source/row_neon.cc', ++ 'source/row_neon64.cc', + 'source/row_win.cc', + 'source/scale.cc', + 'source/scale_any.cc', +@@ -93,6 +74,8 @@ + 'source/scale_common.cc', + 'source/scale_gcc.cc', + 'source/scale_msa.cc', ++ 'source/scale_neon.cc', ++ 'source/scale_neon64.cc', + 'source/scale_rgb.cc', + 'source/scale_uv.cc', + 'source/scale_win.cc', +diff --git a/media/libyuv/libyuv/linux.mk b/media/libyuv/libyuv/linux.mk +--- a/media/libyuv/libyuv/linux.mk ++++ b/media/libyuv/libyuv/linux.mk +@@ -33,7 +33,6 @@ LOCAL_OBJ_FILES := \ + source/rotate_argb.o \ + source/rotate_common.o \ + source/rotate_gcc.o \ +- source/rotate_lsx.o \ + source/rotate_msa.o \ + source/rotate_neon.o \ + source/rotate_neon64.o \ +@@ -41,24 +40,19 @@ LOCAL_OBJ_FILES := \ + source/row_any.o \ + source/row_common.o \ + source/row_gcc.o \ +- source/row_lasx.o \ +- source/row_lsx.o \ + source/row_msa.o \ + source/row_neon.o \ + source/row_neon64.o \ +- source/row_rvv.o \ + source/row_win.o \ + source/scale.o \ + source/scale_any.o \ + source/scale_argb.o \ + source/scale_common.o \ + source/scale_gcc.o \ +- source/scale_lsx.o \ + source/scale_msa.o \ + source/scale_neon.o \ + source/scale_neon64.o \ + source/scale_rgb.o \ +- source/scale_rvv.o \ + source/scale_uv.o \ + source/scale_win.o \ + source/video_common.o +diff --git a/media/libyuv/libyuv/source/compare.cc b/media/libyuv/libyuv/source/compare.cc +--- a/media/libyuv/libyuv/source/compare.cc ++++ b/media/libyuv/libyuv/source/compare.cc +@@ -44,11 +44,6 @@ uint32_t HashDjb2(const uint8_t* src, ui + HashDjb2_SSE = HashDjb2_AVX2; + } + #endif +-#if defined(HAS_HASHDJB2_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- HashDjb2_SSE = HashDjb2_NEON; +- } +-#endif + + while (count >= (uint64_t)kBlockSize) { + seed = HashDjb2_SSE(src, kBlockSize, seed); +@@ -139,11 +134,6 @@ uint64_t ComputeHammingDistance(const ui + HammingDistance = HammingDistance_NEON; + } + #endif +-#if defined(HAS_HAMMINGDISTANCE_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- HammingDistance = HammingDistance_NEON_DotProd; +- } +-#endif + #if defined(HAS_HAMMINGDISTANCE_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + HammingDistance = HammingDistance_SSSE3; +@@ -204,11 +194,6 @@ uint64_t ComputeSumSquareError(const uin + SumSquareError = SumSquareError_NEON; + } + #endif +-#if defined(HAS_SUMSQUAREERROR_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- SumSquareError = SumSquareError_NEON_DotProd; +- } +-#endif + #if defined(HAS_SUMSQUAREERROR_SSE2) + if (TestCpuFlag(kCpuHasSSE2)) { + // Note only used for multiples of 16 so count is not checked. +diff --git a/media/libyuv/libyuv/source/compare_gcc.cc b/media/libyuv/libyuv/source/compare_gcc.cc +--- a/media/libyuv/libyuv/source/compare_gcc.cc ++++ b/media/libyuv/libyuv/source/compare_gcc.cc +@@ -21,15 +21,13 @@ extern "C" { + // This module is for GCC x86 and x64. + #if !defined(LIBYUV_DISABLE_X86) && (defined(__x86_64__) || defined(__i386__)) + +-// "memory" clobber prevents the reads from being removed +- + #if defined(__x86_64__) + uint32_t HammingDistance_SSE42(const uint8_t* src_a, + const uint8_t* src_b, + int count) { +- uint64_t diff; ++ uint64_t diff = 0u; + +- asm volatile ( ++ asm volatile( + "xor %3,%3 \n" + "xor %%r8,%%r8 \n" + "xor %%r9,%%r9 \n" +@@ -65,9 +63,9 @@ uint32_t HammingDistance_SSE42(const uin + : "+r"(src_a), // %0 + "+r"(src_b), // %1 + "+r"(count), // %2 +- "=&r"(diff) // %3 ++ "=r"(diff) // %3 + : +- : "cc", "memory", "rcx", "rdx", "rsi", "rdi", "r8", "r9", "r10"); ++ : "memory", "cc", "rcx", "rdx", "rsi", "rdi", "r8", "r9", "r10"); + + return (uint32_t)(diff); + } +@@ -77,7 +75,7 @@ uint32_t HammingDistance_SSE42(const uin + int count) { + uint32_t diff = 0u; + +- asm volatile ( ++ asm volatile( + // Process 16 bytes per loop. + LABELALIGN + "1: \n" +@@ -106,7 +104,7 @@ uint32_t HammingDistance_SSE42(const uin + "+r"(count), // %2 + "+r"(diff) // %3 + : +- : "cc", "memory", "ecx", "edx"); ++ : "memory", "cc", "ecx", "edx"); + + return diff; + } +@@ -119,9 +117,9 @@ static const vec8 kBitCount = {0, 1, 1, + uint32_t HammingDistance_SSSE3(const uint8_t* src_a, + const uint8_t* src_b, + int count) { +- uint32_t diff; ++ uint32_t diff = 0u; + +- asm volatile ( ++ asm volatile( + "movdqa %4,%%xmm2 \n" + "movdqa %5,%%xmm3 \n" + "pxor %%xmm0,%%xmm0 \n" +@@ -168,7 +166,7 @@ uint32_t HammingDistance_SSSE3(const uin + "=r"(diff) // %3 + : "m"(kNibbleMask), // %4 + "m"(kBitCount) // %5 +- : "cc", "memory", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", ++ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", + "xmm7"); + + return diff; +@@ -178,9 +176,9 @@ uint32_t HammingDistance_SSSE3(const uin + uint32_t HammingDistance_AVX2(const uint8_t* src_a, + const uint8_t* src_b, + int count) { +- uint32_t diff; ++ uint32_t diff = 0u; + +- asm volatile ( ++ asm volatile( + "vbroadcastf128 %4,%%ymm2 \n" + "vbroadcastf128 %5,%%ymm3 \n" + "vpxor %%ymm0,%%ymm0,%%ymm0 \n" +@@ -216,7 +214,7 @@ uint32_t HammingDistance_AVX2(const uint + "vpaddd %%ymm1,%%ymm0,%%ymm0 \n" + "vpermq $0xaa,%%ymm0,%%ymm1 \n" + "vpaddd %%ymm1,%%ymm0,%%ymm0 \n" +- "vmovd %%xmm0,%3 \n" ++ "vmovd %%xmm0, %3 \n" + "vzeroupper \n" + : "+r"(src_a), // %0 + "+r"(src_b), // %1 +@@ -224,7 +222,7 @@ uint32_t HammingDistance_AVX2(const uint + "=r"(diff) // %3 + : "m"(kNibbleMask), // %4 + "m"(kBitCount) // %5 +- : "cc", "memory", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6"); ++ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6"); + + return diff; + } +@@ -234,7 +232,7 @@ uint32_t SumSquareError_SSE2(const uint8 + const uint8_t* src_b, + int count) { + uint32_t sse; +- asm volatile ( ++ asm volatile( + "pxor %%xmm0,%%xmm0 \n" + "pxor %%xmm5,%%xmm5 \n" + +@@ -263,12 +261,13 @@ uint32_t SumSquareError_SSE2(const uint8 + "pshufd $0x1,%%xmm0,%%xmm1 \n" + "paddd %%xmm1,%%xmm0 \n" + "movd %%xmm0,%3 \n" ++ + : "+r"(src_a), // %0 + "+r"(src_b), // %1 + "+r"(count), // %2 +- "=r"(sse) // %3 +- : +- : "cc", "memory", "xmm0", "xmm1", "xmm2", "xmm3", "xmm5"); ++ "=g"(sse) // %3 ++ ::"memory", ++ "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm5"); + return sse; + } + +@@ -300,7 +299,7 @@ static const uvec32 kHashMul3 = { + + uint32_t HashDjb2_SSE41(const uint8_t* src, int count, uint32_t seed) { + uint32_t hash; +- asm volatile ( ++ asm volatile( + "movd %2,%%xmm0 \n" + "pxor %%xmm7,%%xmm7 \n" + "movdqa %4,%%xmm6 \n" +@@ -342,13 +341,13 @@ uint32_t HashDjb2_SSE41(const uint8_t* s + : "+r"(src), // %0 + "+r"(count), // %1 + "+rm"(seed), // %2 +- "=r"(hash) // %3 ++ "=g"(hash) // %3 + : "m"(kHash16x33), // %4 + "m"(kHashMul0), // %5 + "m"(kHashMul1), // %6 + "m"(kHashMul2), // %7 + "m"(kHashMul3) // %8 +- : "cc", "memory", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", ++ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", + "xmm7"); + return hash; + } +diff --git a/media/libyuv/libyuv/source/compare_neon.cc b/media/libyuv/libyuv/source/compare_neon.cc +--- a/media/libyuv/libyuv/source/compare_neon.cc ++++ b/media/libyuv/libyuv/source/compare_neon.cc +@@ -28,7 +28,7 @@ uint32_t HammingDistance_NEON(const uint + int count) { + uint32_t diff; + +- asm volatile ( ++ asm volatile( + "vmov.u16 q4, #0 \n" // accumulator + + "1: \n" +@@ -58,7 +58,7 @@ uint32_t SumSquareError_NEON(const uint8 + const uint8_t* src_b, + int count) { + uint32_t sse; +- asm volatile ( ++ asm volatile( + "vmov.u8 q8, #0 \n" + "vmov.u8 q10, #0 \n" + "vmov.u8 q9, #0 \n" +diff --git a/media/libyuv/libyuv/source/compare_neon64.cc b/media/libyuv/libyuv/source/compare_neon64.cc +--- a/media/libyuv/libyuv/source/compare_neon64.cc ++++ b/media/libyuv/libyuv/source/compare_neon64.cc +@@ -26,7 +26,7 @@ uint32_t HammingDistance_NEON(const uint + const uint8_t* src_b, + int count) { + uint32_t diff; +- asm volatile ( ++ asm volatile( + "movi v4.8h, #0 \n" + + "1: \n" +@@ -47,7 +47,7 @@ uint32_t HammingDistance_NEON(const uint + "fmov %w3, s4 \n" + : "+r"(src_a), "+r"(src_b), "+r"(count), "=r"(diff) + : +- : "memory", "cc", "v0", "v1", "v2", "v3", "v4"); ++ : "cc", "v0", "v1", "v2", "v3", "v4"); + return diff; + } + +@@ -55,11 +55,11 @@ uint32_t SumSquareError_NEON(const uint8 + const uint8_t* src_b, + int count) { + uint32_t sse; +- asm volatile ( +- "movi v16.16b, #0 \n" +- "movi v17.16b, #0 \n" +- "movi v18.16b, #0 \n" +- "movi v19.16b, #0 \n" ++ asm volatile( ++ "eor v16.16b, v16.16b, v16.16b \n" ++ "eor v18.16b, v18.16b, v18.16b \n" ++ "eor v17.16b, v17.16b, v17.16b \n" ++ "eor v19.16b, v19.16b, v19.16b \n" + + "1: \n" + "ld1 {v0.16b}, [%0], #16 \n" +@@ -82,136 +82,7 @@ uint32_t SumSquareError_NEON(const uint8 + "fmov %w3, s0 \n" + : "+r"(src_a), "+r"(src_b), "+r"(count), "=r"(sse) + : +- : "memory", "cc", "v0", "v1", "v2", "v3", "v16", "v17", "v18", "v19"); +- return sse; +-} +- +-static const uvec32 kDjb2Multiplicands[] = { +- {0x0c3525e1, // 33^15 +- 0xa3476dc1, // 33^14 +- 0x3b4039a1, // 33^13 +- 0x4f5f0981}, // 33^12 +- {0x30f35d61, // 33^11 +- 0x855cb541, // 33^10 +- 0x040a9121, // 33^9 +- 0x747c7101}, // 33^8 +- {0xec41d4e1, // 33^7 +- 0x4cfa3cc1, // 33^6 +- 0x025528a1, // 33^5 +- 0x00121881}, // 33^4 +- {0x00008c61, // 33^3 +- 0x00000441, // 33^2 +- 0x00000021, // 33^1 +- 0x00000001}, // 33^0 +-}; +- +-static const uvec32 kDjb2WidenIndices[] = { +- {0xffffff00U, 0xffffff01U, 0xffffff02U, 0xffffff03U}, +- {0xffffff04U, 0xffffff05U, 0xffffff06U, 0xffffff07U}, +- {0xffffff08U, 0xffffff09U, 0xffffff0aU, 0xffffff0bU}, +- {0xffffff0cU, 0xffffff0dU, 0xffffff0eU, 0xffffff0fU}, +-}; +- +-uint32_t HashDjb2_NEON(const uint8_t* src, int count, uint32_t seed) { +- uint32_t hash = seed; +- const uint32_t c16 = 0x92d9e201; // 33^16 +- uint32_t tmp, tmp2; +- asm("ld1 {v16.4s, v17.4s, v18.4s, v19.4s}, [%[kIdx]] \n" +- "ld1 {v4.4s, v5.4s, v6.4s, v7.4s}, [%[kMuls]] \n" +- +- // count is always a multiple of 16. +- // maintain two accumulators, reduce and then final sum in scalar since +- // this has better performance on little cores. +- "1: \n" +- "ldr q0, [%[src]], #16 \n" +- "subs %w[count], %w[count], #16 \n" +- "tbl v3.16b, {v0.16b}, v19.16b \n" +- "tbl v2.16b, {v0.16b}, v18.16b \n" +- "tbl v1.16b, {v0.16b}, v17.16b \n" +- "tbl v0.16b, {v0.16b}, v16.16b \n" +- "mul v3.4s, v3.4s, v7.4s \n" +- "mul v2.4s, v2.4s, v6.4s \n" +- "mla v3.4s, v1.4s, v5.4s \n" +- "mla v2.4s, v0.4s, v4.4s \n" +- "addv s1, v3.4s \n" +- "addv s0, v2.4s \n" +- "fmov %w[tmp2], s1 \n" +- "fmov %w[tmp], s0 \n" +- "add %w[tmp], %w[tmp], %w[tmp2] \n" +- "madd %w[hash], %w[hash], %w[c16], %w[tmp] \n" +- "b.gt 1b \n" +- : [hash] "+r"(hash), // %[hash] +- [count] "+r"(count), // %[count] +- [tmp] "=&r"(tmp), // %[tmp] +- [tmp2] "=&r"(tmp2) // %[tmp2] +- : [src] "r"(src), // %[src] +- [kMuls] "r"(kDjb2Multiplicands), // %[kMuls] +- [kIdx] "r"(kDjb2WidenIndices), // %[kIdx] +- [c16] "r"(c16) // %[c16] +- : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", +- "v17", "v18", "v19"); +- return hash; +-} +- +-uint32_t HammingDistance_NEON_DotProd(const uint8_t* src_a, +- const uint8_t* src_b, +- int count) { +- uint32_t diff; +- asm volatile ( +- "movi v4.4s, #0 \n" +- "movi v5.4s, #0 \n" +- "movi v6.16b, #1 \n" +- +- "1: \n" +- "ldp q0, q1, [%0], #32 \n" +- "ldp q2, q3, [%1], #32 \n" +- "eor v0.16b, v0.16b, v2.16b \n" +- "prfm pldl1keep, [%0, 448] \n" // prefetch 7 lines ahead +- "eor v1.16b, v1.16b, v3.16b \n" +- "cnt v0.16b, v0.16b \n" +- "prfm pldl1keep, [%1, 448] \n" +- "cnt v1.16b, v1.16b \n" +- "subs %w2, %w2, #32 \n" +- "udot v4.4s, v0.16b, v6.16b \n" +- "udot v5.4s, v1.16b, v6.16b \n" +- "b.gt 1b \n" +- +- "add v0.4s, v4.4s, v5.4s \n" +- "addv s0, v0.4s \n" +- "fmov %w3, s0 \n" +- : "+r"(src_a), "+r"(src_b), "+r"(count), "=r"(diff) +- : +- : "memory", "cc", "v0", "v1", "v2", "v3", "v4", "v5", "v6"); +- return diff; +-} +- +-uint32_t SumSquareError_NEON_DotProd(const uint8_t* src_a, +- const uint8_t* src_b, +- int count) { +- // count is guaranteed to be a multiple of 32. +- uint32_t sse; +- asm volatile ( +- "movi v4.4s, #0 \n" +- "movi v5.4s, #0 \n" +- +- "1: \n" +- "ldp q0, q2, [%0], #32 \n" +- "ldp q1, q3, [%1], #32 \n" +- "subs %w2, %w2, #32 \n" +- "uabd v0.16b, v0.16b, v1.16b \n" +- "uabd v1.16b, v2.16b, v3.16b \n" +- "prfm pldl1keep, [%0, 448] \n" // prefetch 7 lines ahead +- "udot v4.4s, v0.16b, v0.16b \n" +- "udot v5.4s, v1.16b, v1.16b \n" +- "prfm pldl1keep, [%1, 448] \n" +- "b.gt 1b \n" +- +- "add v0.4s, v4.4s, v5.4s \n" +- "addv s0, v0.4s \n" +- "fmov %w3, s0 \n" +- : "+r"(src_a), "+r"(src_b), "+r"(count), "=r"(sse) +- : +- : "memory", "cc", "v0", "v1", "v2", "v3", "v4", "v5"); ++ : "cc", "v0", "v1", "v2", "v3", "v16", "v17", "v18", "v19"); + return sse; + } + +diff --git a/media/libyuv/libyuv/source/convert.cc b/media/libyuv/libyuv/source/convert.cc +--- a/media/libyuv/libyuv/source/convert.cc ++++ b/media/libyuv/libyuv/source/convert.cc +@@ -54,27 +54,18 @@ static int I4xxToI420(const uint8_t* src + const int dst_y_height = Abs(src_y_height); + const int dst_uv_width = SUBSAMPLE(dst_y_width, 1, 1); + const int dst_uv_height = SUBSAMPLE(dst_y_height, 1, 1); +- int r; +- if ((!src_y && dst_y) || !src_u || !src_v || !dst_u || !dst_v || +- src_y_width <= 0 || src_y_height == 0 || src_uv_width <= 0 || +- src_uv_height == 0) { ++ if (src_uv_width <= 0 || src_uv_height == 0) { + return -1; + } + if (dst_y) { +- r = ScalePlane(src_y, src_stride_y, src_y_width, src_y_height, dst_y, +- dst_stride_y, dst_y_width, dst_y_height, kFilterBilinear); +- if (r != 0) { +- return r; +- } ++ ScalePlane(src_y, src_stride_y, src_y_width, src_y_height, dst_y, ++ dst_stride_y, dst_y_width, dst_y_height, kFilterBilinear); + } +- r = ScalePlane(src_u, src_stride_u, src_uv_width, src_uv_height, dst_u, +- dst_stride_u, dst_uv_width, dst_uv_height, kFilterBilinear); +- if (r != 0) { +- return r; +- } +- r = ScalePlane(src_v, src_stride_v, src_uv_width, src_uv_height, dst_v, +- dst_stride_v, dst_uv_width, dst_uv_height, kFilterBilinear); +- return r; ++ ScalePlane(src_u, src_stride_u, src_uv_width, src_uv_height, dst_u, ++ dst_stride_u, dst_uv_width, dst_uv_height, kFilterBilinear); ++ ScalePlane(src_v, src_stride_v, src_uv_width, src_uv_height, dst_v, ++ dst_stride_v, dst_uv_width, dst_uv_height, kFilterBilinear); ++ return 0; + } + + // Copy I420 with optional flipping. +@@ -212,99 +203,6 @@ static int Planar16bitTo8bit(const uint1 + return 0; + } + +-static int I41xToI420(const uint16_t* src_y, +- int src_stride_y, +- const uint16_t* src_u, +- int src_stride_u, +- const uint16_t* src_v, +- int src_stride_v, +- uint8_t* dst_y, +- int dst_stride_y, +- uint8_t* dst_u, +- int dst_stride_u, +- uint8_t* dst_v, +- int dst_stride_v, +- int width, +- int height, +- int depth) { +- const int scale = 1 << (24 - depth); +- +- if (width <= 0 || height == 0) { +- return -1; +- } +- // Negative height means invert the image. +- if (height < 0) { +- height = -height; +- src_y = src_y + (height - 1) * src_stride_y; +- src_u = src_u + (height - 1) * src_stride_u; +- src_v = src_v + (height - 1) * src_stride_v; +- src_stride_y = -src_stride_y; +- src_stride_u = -src_stride_u; +- src_stride_v = -src_stride_v; +- } +- +- { +- const int uv_width = SUBSAMPLE(width, 1, 1); +- const int uv_height = SUBSAMPLE(height, 1, 1); +- +- Convert16To8Plane(src_y, src_stride_y, dst_y, dst_stride_y, scale, width, +- height); +- ScalePlaneDown2_16To8(width, height, uv_width, uv_height, src_stride_u, +- dst_stride_u, src_u, dst_u, scale, kFilterBilinear); +- ScalePlaneDown2_16To8(width, height, uv_width, uv_height, src_stride_v, +- dst_stride_v, src_v, dst_v, scale, kFilterBilinear); +- } +- return 0; +-} +- +-static int I21xToI420(const uint16_t* src_y, +- int src_stride_y, +- const uint16_t* src_u, +- int src_stride_u, +- const uint16_t* src_v, +- int src_stride_v, +- uint8_t* dst_y, +- int dst_stride_y, +- uint8_t* dst_u, +- int dst_stride_u, +- uint8_t* dst_v, +- int dst_stride_v, +- int width, +- int height, +- int depth) { +- const int scale = 1 << (24 - depth); +- +- if (width <= 0 || height == 0) { +- return -1; +- } +- // Negative height means invert the image. +- if (height < 0) { +- height = -height; +- src_y = src_y + (height - 1) * src_stride_y; +- src_u = src_u + (height - 1) * src_stride_u; +- src_v = src_v + (height - 1) * src_stride_v; +- src_stride_y = -src_stride_y; +- src_stride_u = -src_stride_u; +- src_stride_v = -src_stride_v; +- } +- +- { +- const int uv_width = SUBSAMPLE(width, 1, 1); +- const int uv_height = SUBSAMPLE(height, 1, 1); +- const int dy = FixedDiv(height, uv_height); +- +- Convert16To8Plane(src_y, src_stride_y, dst_y, dst_stride_y, scale, width, +- height); +- ScalePlaneVertical_16To8(height, uv_width, uv_height, src_stride_u, +- dst_stride_u, src_u, dst_u, 0, 32768, dy, +- /*bpp=*/1, scale, kFilterBilinear); +- ScalePlaneVertical_16To8(height, uv_width, uv_height, src_stride_v, +- dst_stride_v, src_v, dst_v, 0, 32768, dy, +- /*bpp=*/1, scale, kFilterBilinear); +- } +- return 0; +-} +- + // Convert 10 bit YUV to 8 bit. + LIBYUV_API + int I010ToI420(const uint16_t* src_y, +@@ -342,9 +240,38 @@ int I210ToI420(const uint16_t* src_y, + int dst_stride_v, + int width, + int height) { +- return I21xToI420(src_y, src_stride_y, src_u, src_stride_u, src_v, +- src_stride_v, dst_y, dst_stride_y, dst_u, dst_stride_u, +- dst_v, dst_stride_v, width, height, 10); ++ const int depth = 10; ++ const int scale = 1 << (24 - depth); ++ ++ if (width <= 0 || height == 0) { ++ return -1; ++ } ++ // Negative height means invert the image. ++ if (height < 0) { ++ height = -height; ++ src_y = src_y + (height - 1) * src_stride_y; ++ src_u = src_u + (height - 1) * src_stride_u; ++ src_v = src_v + (height - 1) * src_stride_v; ++ src_stride_y = -src_stride_y; ++ src_stride_u = -src_stride_u; ++ src_stride_v = -src_stride_v; ++ } ++ ++ { ++ const int uv_width = SUBSAMPLE(width, 1, 1); ++ const int uv_height = SUBSAMPLE(height, 1, 1); ++ const int dy = FixedDiv(height, uv_height); ++ ++ Convert16To8Plane(src_y, src_stride_y, dst_y, dst_stride_y, scale, width, ++ height); ++ ScalePlaneVertical_16To8(height, uv_width, uv_height, src_stride_u, ++ dst_stride_u, src_u, dst_u, 0, 32768, dy, ++ /*bpp=*/1, scale, kFilterBilinear); ++ ScalePlaneVertical_16To8(height, uv_width, uv_height, src_stride_v, ++ dst_stride_v, src_v, dst_v, 0, 32768, dy, ++ /*bpp=*/1, scale, kFilterBilinear); ++ } ++ return 0; + } + + LIBYUV_API +@@ -383,9 +310,35 @@ int I410ToI420(const uint16_t* src_y, + int dst_stride_v, + int width, + int height) { +- return I41xToI420(src_y, src_stride_y, src_u, src_stride_u, src_v, +- src_stride_v, dst_y, dst_stride_y, dst_u, dst_stride_u, +- dst_v, dst_stride_v, width, height, 10); ++ const int depth = 10; ++ const int scale = 1 << (24 - depth); ++ ++ if (width <= 0 || height == 0) { ++ return -1; ++ } ++ // Negative height means invert the image. ++ if (height < 0) { ++ height = -height; ++ src_y = src_y + (height - 1) * src_stride_y; ++ src_u = src_u + (height - 1) * src_stride_u; ++ src_v = src_v + (height - 1) * src_stride_v; ++ src_stride_y = -src_stride_y; ++ src_stride_u = -src_stride_u; ++ src_stride_v = -src_stride_v; ++ } ++ ++ { ++ const int uv_width = SUBSAMPLE(width, 1, 1); ++ const int uv_height = SUBSAMPLE(height, 1, 1); ++ ++ Convert16To8Plane(src_y, src_stride_y, dst_y, dst_stride_y, scale, width, ++ height); ++ ScalePlaneDown2_16To8(width, height, uv_width, uv_height, src_stride_u, ++ dst_stride_u, src_u, dst_u, scale, kFilterBilinear); ++ ScalePlaneDown2_16To8(width, height, uv_width, uv_height, src_stride_v, ++ dst_stride_v, src_v, dst_v, scale, kFilterBilinear); ++ } ++ return 0; + } + + LIBYUV_API +@@ -452,26 +405,6 @@ int I212ToI422(const uint16_t* src_y, + } + + LIBYUV_API +-int I212ToI420(const uint16_t* src_y, +- int src_stride_y, +- const uint16_t* src_u, +- int src_stride_u, +- const uint16_t* src_v, +- int src_stride_v, +- uint8_t* dst_y, +- int dst_stride_y, +- uint8_t* dst_u, +- int dst_stride_u, +- uint8_t* dst_v, +- int dst_stride_v, +- int width, +- int height) { +- return I21xToI420(src_y, src_stride_y, src_u, src_stride_u, src_v, +- src_stride_v, dst_y, dst_stride_y, dst_u, dst_stride_u, +- dst_v, dst_stride_v, width, height, 12); +-} +- +-LIBYUV_API + int I412ToI444(const uint16_t* src_y, + int src_stride_y, + const uint16_t* src_u, +@@ -492,26 +425,6 @@ int I412ToI444(const uint16_t* src_y, + 0, 12); + } + +-LIBYUV_API +-int I412ToI420(const uint16_t* src_y, +- int src_stride_y, +- const uint16_t* src_u, +- int src_stride_u, +- const uint16_t* src_v, +- int src_stride_v, +- uint8_t* dst_y, +- int dst_stride_y, +- uint8_t* dst_u, +- int dst_stride_u, +- uint8_t* dst_v, +- int dst_stride_v, +- int width, +- int height) { +- return I41xToI420(src_y, src_stride_y, src_u, src_stride_u, src_v, +- src_stride_v, dst_y, dst_stride_y, dst_u, dst_stride_u, +- dst_v, dst_stride_v, width, height, 12); +-} +- + // Any Ix10 To I010 format with mirroring. + static int Ix10ToI010(const uint16_t* src_y, + int src_stride_y, +@@ -535,25 +448,18 @@ static int Ix10ToI010(const uint16_t* sr + const int src_uv_height = SUBSAMPLE(height, subsample_y, subsample_y); + const int dst_uv_width = SUBSAMPLE(dst_y_width, 1, 1); + const int dst_uv_height = SUBSAMPLE(dst_y_height, 1, 1); +- int r; + if (width <= 0 || height == 0) { + return -1; + } + if (dst_y) { +- r = ScalePlane_12(src_y, src_stride_y, width, height, dst_y, dst_stride_y, +- dst_y_width, dst_y_height, kFilterBilinear); +- if (r != 0) { +- return r; +- } ++ ScalePlane_12(src_y, src_stride_y, width, height, dst_y, dst_stride_y, ++ dst_y_width, dst_y_height, kFilterBilinear); + } +- r = ScalePlane_12(src_u, src_stride_u, src_uv_width, src_uv_height, dst_u, +- dst_stride_u, dst_uv_width, dst_uv_height, kFilterBilinear); +- if (r != 0) { +- return r; +- } +- r = ScalePlane_12(src_v, src_stride_v, src_uv_width, src_uv_height, dst_v, +- dst_stride_v, dst_uv_width, dst_uv_height, kFilterBilinear); +- return r; ++ ScalePlane_12(src_u, src_stride_u, src_uv_width, src_uv_height, dst_u, ++ dst_stride_u, dst_uv_width, dst_uv_height, kFilterBilinear); ++ ScalePlane_12(src_v, src_stride_v, src_uv_width, src_uv_height, dst_v, ++ dst_stride_v, dst_uv_width, dst_uv_height, kFilterBilinear); ++ return 0; + } + + LIBYUV_API +@@ -793,8 +699,6 @@ int I422ToNV21(const uint8_t* src_y, + // Allocate u and v buffers + align_buffer_64(plane_u, halfwidth * halfheight * 2); + uint8_t* plane_v = plane_u + halfwidth * halfheight; +- if (!plane_u) +- return 1; + + I422ToI420(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, + dst_y, dst_stride_y, plane_u, halfwidth, plane_v, halfwidth, width, +@@ -897,9 +801,10 @@ int MT2TToP010(const uint8_t* src_y, + } + + { +- int uv_width = (width + 1) & ~1; +- int uv_height = (height + 1) / 2; ++ int u_width = (width + 1) / 2; ++ int uv_width = 2 * u_width; + int y = 0; ++ int uv_height = uv_height = (height + 1) / 2; + const int tile_width = 16; + const int y_tile_height = 32; + const int uv_tile_height = 16; +@@ -910,8 +815,6 @@ int MT2TToP010(const uint8_t* src_y, + void (*UnpackMT2T)(const uint8_t* src, uint16_t* dst, size_t size) = + UnpackMT2T_C; + align_buffer_64(row_buf, row_buf_size); +- if (!row_buf) +- return 1; + + #if defined(HAS_UNPACKMT2T_NEON) + if (TestCpuFlag(kCpuHasNEON)) { +@@ -1016,7 +919,7 @@ int I422ToNV21(const uint8_t* src_y, + #if defined(HAS_MERGEUVROW_AVX2) + if (TestCpuFlag(kCpuHasAVX2)) { + MergeUVRow = MergeUVRow_Any_AVX2; +- if (IS_ALIGNED(halfwidth, 16)) { ++ if (IS_ALIGNED(halfwidth, 32)) { + MergeUVRow = MergeUVRow_AVX2; + } + } +@@ -1053,11 +956,6 @@ int I422ToNV21(const uint8_t* src_y, + } + } + #endif +-#if defined(HAS_MERGEUVROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- MergeUVRow = MergeUVRow_RVV; +- } +-#endif + #if defined(HAS_INTERPOLATEROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + InterpolateRow = InterpolateRow_Any_SSSE3; +@@ -1098,11 +996,6 @@ int I422ToNV21(const uint8_t* src_y, + } + } + #endif +-#if defined(HAS_INTERPOLATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- InterpolateRow = InterpolateRow_RVV; +- } +-#endif + + if (dst_y) { + CopyPlane(src_y, src_stride_y, dst_y, dst_stride_y, halfwidth, height); +@@ -1112,8 +1005,6 @@ int I422ToNV21(const uint8_t* src_y, + int awidth = halfwidth * 2; + align_buffer_64(row_vu_0, awidth * 2); + uint8_t* row_vu_1 = row_vu_0 + awidth; +- if (!row_vu_0) +- return 1; + + for (y = 0; y < height - 1; y += 2) { + MergeUVRow(src_v, src_u, row_vu_0, halfwidth); +@@ -1352,22 +1243,18 @@ int NV12ToNV24(const uint8_t* src_y, + int dst_stride_uv, + int width, + int height) { +- int r; + if (width <= 0 || height == 0) { + return -1; + } + + if (dst_y) { +- r = ScalePlane(src_y, src_stride_y, width, height, dst_y, dst_stride_y, +- Abs(width), Abs(height), kFilterBilinear); +- if (r != 0) { +- return r; +- } ++ ScalePlane(src_y, src_stride_y, width, height, dst_y, dst_stride_y, ++ Abs(width), Abs(height), kFilterBilinear); + } +- r = UVScale(src_uv, src_stride_uv, SUBSAMPLE(width, 1, 1), +- SUBSAMPLE(height, 1, 1), dst_uv, dst_stride_uv, Abs(width), +- Abs(height), kFilterBilinear); +- return r; ++ UVScale(src_uv, src_stride_uv, SUBSAMPLE(width, 1, 1), ++ SUBSAMPLE(height, 1, 1), dst_uv, dst_stride_uv, Abs(width), ++ Abs(height), kFilterBilinear); ++ return 0; + } + + LIBYUV_API +@@ -1381,21 +1268,17 @@ int NV16ToNV24(const uint8_t* src_y, + int dst_stride_uv, + int width, + int height) { +- int r; + if (width <= 0 || height == 0) { + return -1; + } + + if (dst_y) { +- r = ScalePlane(src_y, src_stride_y, width, height, dst_y, dst_stride_y, +- Abs(width), Abs(height), kFilterBilinear); +- if (r != 0) { +- return r; +- } ++ ScalePlane(src_y, src_stride_y, width, height, dst_y, dst_stride_y, ++ Abs(width), Abs(height), kFilterBilinear); + } +- r = UVScale(src_uv, src_stride_uv, SUBSAMPLE(width, 1, 1), height, dst_uv, +- dst_stride_uv, Abs(width), Abs(height), kFilterBilinear); +- return r; ++ UVScale(src_uv, src_stride_uv, SUBSAMPLE(width, 1, 1), height, dst_uv, ++ dst_stride_uv, Abs(width), Abs(height), kFilterBilinear); ++ return 0; + } + + // Any P[420]1[02] to I[420]1[02] format with mirroring. +@@ -1473,22 +1356,18 @@ int P010ToP410(const uint16_t* src_y, + int dst_stride_uv, + int width, + int height) { +- int r; + if (width <= 0 || height == 0) { + return -1; + } + + if (dst_y) { +- r = ScalePlane_16(src_y, src_stride_y, width, height, dst_y, dst_stride_y, +- Abs(width), Abs(height), kFilterBilinear); +- if (r != 0) { +- return r; +- } ++ ScalePlane_16(src_y, src_stride_y, width, height, dst_y, dst_stride_y, ++ Abs(width), Abs(height), kFilterBilinear); + } +- r = UVScale_16(src_uv, src_stride_uv, SUBSAMPLE(width, 1, 1), +- SUBSAMPLE(height, 1, 1), dst_uv, dst_stride_uv, Abs(width), +- Abs(height), kFilterBilinear); +- return r; ++ UVScale_16(src_uv, src_stride_uv, SUBSAMPLE(width, 1, 1), ++ SUBSAMPLE(height, 1, 1), dst_uv, dst_stride_uv, Abs(width), ++ Abs(height), kFilterBilinear); ++ return 0; + } + + LIBYUV_API +@@ -1502,21 +1381,17 @@ int P210ToP410(const uint16_t* src_y, + int dst_stride_uv, + int width, + int height) { +- int r; + if (width <= 0 || height == 0) { + return -1; + } + + if (dst_y) { +- r = ScalePlane_16(src_y, src_stride_y, width, height, dst_y, dst_stride_y, +- Abs(width), Abs(height), kFilterBilinear); +- if (r != 0) { +- return r; +- } ++ ScalePlane_16(src_y, src_stride_y, width, height, dst_y, dst_stride_y, ++ Abs(width), Abs(height), kFilterBilinear); + } +- r = UVScale_16(src_uv, src_stride_uv, SUBSAMPLE(width, 1, 1), height, dst_uv, +- dst_stride_uv, Abs(width), Abs(height), kFilterBilinear); +- return r; ++ UVScale_16(src_uv, src_stride_uv, SUBSAMPLE(width, 1, 1), height, dst_uv, ++ dst_stride_uv, Abs(width), Abs(height), kFilterBilinear); ++ return 0; + } + + // Convert YUY2 to I420. +@@ -1583,16 +1458,6 @@ int YUY2ToI420(const uint8_t* src_yuy2, + } + } + #endif +-#if defined(HAS_YUY2TOYROW_LSX) && defined(HAS_YUY2TOUVROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- YUY2ToYRow = YUY2ToYRow_Any_LSX; +- YUY2ToUVRow = YUY2ToUVRow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- YUY2ToYRow = YUY2ToYRow_LSX; +- YUY2ToUVRow = YUY2ToUVRow_LSX; +- } +- } +-#endif + #if defined(HAS_YUY2TOYROW_LASX) && defined(HAS_YUY2TOUVROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + YUY2ToYRow = YUY2ToYRow_Any_LASX; +@@ -1684,26 +1549,6 @@ int UYVYToI420(const uint8_t* src_uyvy, + } + } + #endif +-#if defined(HAS_UYVYTOYROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- UYVYToYRow = UYVYToYRow_Any_LSX; +- UYVYToUVRow = UYVYToUVRow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- UYVYToYRow = UYVYToYRow_LSX; +- UYVYToUVRow = UYVYToUVRow_LSX; +- } +- } +-#endif +-#if defined(HAS_UYVYTOYROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- UYVYToYRow = UYVYToYRow_Any_LSX; +- UYVYToUVRow = UYVYToUVRow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- UYVYToYRow = UYVYToYRow_LSX; +- UYVYToUVRow = UYVYToUVRow_LSX; +- } +- } +-#endif + #if defined(HAS_UYVYTOYROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + UYVYToYRow = UYVYToYRow_Any_LASX; +@@ -1784,14 +1629,6 @@ int AYUVToNV12(const uint8_t* src_ayuv, + } + } + #endif +-#if defined(HAS_AYUVTOUVROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- AYUVToUVRow = AYUVToUVRow_Any_SVE2; +- if (IS_ALIGNED(width, 2)) { +- AYUVToUVRow = AYUVToUVRow_SVE2; +- } +- } +-#endif + + for (y = 0; y < height - 1; y += 2) { + AYUVToUVRow(src_ayuv, src_stride_ayuv, dst_uv, width); +@@ -1861,14 +1698,6 @@ int AYUVToNV21(const uint8_t* src_ayuv, + } + } + #endif +-#if defined(HAS_AYUVTOVUROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- AYUVToVURow = AYUVToVURow_Any_SVE2; +- if (IS_ALIGNED(width, 2)) { +- AYUVToVURow = AYUVToVURow_SVE2; +- } +- } +-#endif + + for (y = 0; y < height - 1; y += 2) { + AYUVToVURow(src_ayuv, src_stride_ayuv, dst_vu, width); +@@ -1920,14 +1749,6 @@ int ARGBToI420(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYROW_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- ARGBToYRow = ARGBToYRow_Any_NEON_DotProd; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYRow = ARGBToYRow_NEON_DotProd; +- } +- } +-#endif + #if defined(HAS_ARGBTOUVROW_NEON) + if (TestCpuFlag(kCpuHasNEON)) { + ARGBToUVRow = ARGBToUVRow_Any_NEON; +@@ -1936,192 +1757,6 @@ int ARGBToI420(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOUVROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- ARGBToUVRow = ARGBToUVRow_Any_SVE2; +- if (IS_ALIGNED(width, 2)) { +- ARGBToUVRow = ARGBToUVRow_SVE2; +- } +- } +-#endif +-#if defined(HAS_ARGBTOYROW_SSSE3) +- if (TestCpuFlag(kCpuHasSSSE3)) { +- ARGBToYRow = ARGBToYRow_Any_SSSE3; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYRow = ARGBToYRow_SSSE3; +- } +- } +-#endif +-#if defined(HAS_ARGBTOUVROW_SSSE3) +- if (TestCpuFlag(kCpuHasSSSE3)) { +- ARGBToUVRow = ARGBToUVRow_Any_SSSE3; +- if (IS_ALIGNED(width, 16)) { +- ARGBToUVRow = ARGBToUVRow_SSSE3; +- } +- } +-#endif +-#if defined(HAS_ARGBTOYROW_AVX2) +- if (TestCpuFlag(kCpuHasAVX2)) { +- ARGBToYRow = ARGBToYRow_Any_AVX2; +- if (IS_ALIGNED(width, 32)) { +- ARGBToYRow = ARGBToYRow_AVX2; +- } +- } +-#endif +-#if defined(HAS_ARGBTOUVROW_AVX2) +- if (TestCpuFlag(kCpuHasAVX2)) { +- ARGBToUVRow = ARGBToUVRow_Any_AVX2; +- if (IS_ALIGNED(width, 32)) { +- ARGBToUVRow = ARGBToUVRow_AVX2; +- } +- } +-#endif +-#if defined(HAS_ARGBTOYROW_MSA) && defined(HAS_ARGBTOUVROW_MSA) +- if (TestCpuFlag(kCpuHasMSA)) { +- ARGBToYRow = ARGBToYRow_Any_MSA; +- ARGBToUVRow = ARGBToUVRow_Any_MSA; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYRow = ARGBToYRow_MSA; +- } +- if (IS_ALIGNED(width, 32)) { +- ARGBToUVRow = ARGBToUVRow_MSA; +- } +- } +-#endif +-#if defined(HAS_ARGBTOYROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBToYRow = ARGBToYRow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYRow = ARGBToYRow_LSX; +- } +- } +-#endif +-#if defined(HAS_ARGBTOYROW_LSX) && defined(HAS_ARGBTOUVROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBToYRow = ARGBToYRow_Any_LSX; +- ARGBToUVRow = ARGBToUVRow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYRow = ARGBToYRow_LSX; +- ARGBToUVRow = ARGBToUVRow_LSX; +- } +- } +-#endif +-#if defined(HAS_ARGBTOYROW_LASX) && defined(HAS_ARGBTOUVROW_LASX) +- if (TestCpuFlag(kCpuHasLASX)) { +- ARGBToYRow = ARGBToYRow_Any_LASX; +- ARGBToUVRow = ARGBToUVRow_Any_LASX; +- if (IS_ALIGNED(width, 32)) { +- ARGBToYRow = ARGBToYRow_LASX; +- ARGBToUVRow = ARGBToUVRow_LASX; +- } +- } +-#endif +- +- for (y = 0; y < height - 1; y += 2) { +- ARGBToUVRow(src_argb, src_stride_argb, dst_u, dst_v, width); +- ARGBToYRow(src_argb, dst_y, width); +- ARGBToYRow(src_argb + src_stride_argb, dst_y + dst_stride_y, width); +- src_argb += src_stride_argb * 2; +- dst_y += dst_stride_y * 2; +- dst_u += dst_stride_u; +- dst_v += dst_stride_v; +- } +- if (height & 1) { +- ARGBToUVRow(src_argb, 0, dst_u, dst_v, width); +- ARGBToYRow(src_argb, dst_y, width); +- } +- return 0; +-} +- +-#ifdef USE_EXTRACTALPHA +-// Convert ARGB to I420 with Alpha +-// The following version calls ARGBExtractAlpha on the full image. +-LIBYUV_API +-int ARGBToI420Alpha(const uint8_t* src_argb, +- int src_stride_argb, +- uint8_t* dst_y, +- int dst_stride_y, +- uint8_t* dst_u, +- int dst_stride_u, +- uint8_t* dst_v, +- int dst_stride_v, +- uint8_t* dst_a, +- int dst_stride_a, +- int width, +- int height) { +- int r = ARGBToI420(src_argb, src_stride_argb, dst_y, dst_stride_y, dst_u, +- dst_stride_u, dst_v, dst_stride_v, width, height); +- if (r == 0) { +- r = ARGBExtractAlpha(src_argb, src_stride_argb, dst_a, dst_stride_a, width, +- height); +- } +- return r; +-} +-#else // USE_EXTRACTALPHA +-// Convert ARGB to I420 with Alpha +-LIBYUV_API +-int ARGBToI420Alpha(const uint8_t* src_argb, +- int src_stride_argb, +- uint8_t* dst_y, +- int dst_stride_y, +- uint8_t* dst_u, +- int dst_stride_u, +- uint8_t* dst_v, +- int dst_stride_v, +- uint8_t* dst_a, +- int dst_stride_a, +- int width, +- int height) { +- int y; +- void (*ARGBToUVRow)(const uint8_t* src_argb0, int src_stride_argb, +- uint8_t* dst_u, uint8_t* dst_v, int width) = +- ARGBToUVRow_C; +- void (*ARGBToYRow)(const uint8_t* src_argb, uint8_t* dst_y, int width) = +- ARGBToYRow_C; +- void (*ARGBExtractAlphaRow)(const uint8_t* src_argb, uint8_t* dst_a, +- int width) = ARGBExtractAlphaRow_C; +- if (!src_argb || !dst_y || !dst_u || !dst_v || !dst_a || width <= 0 || +- height == 0) { +- return -1; +- } +- // Negative height means invert the image. +- if (height < 0) { +- height = -height; +- src_argb = src_argb + (height - 1) * src_stride_argb; +- src_stride_argb = -src_stride_argb; +- } +-#if defined(HAS_ARGBTOYROW_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- ARGBToYRow = ARGBToYRow_Any_NEON; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYRow = ARGBToYRow_NEON; +- } +- } +-#endif +-#if defined(HAS_ARGBTOYROW_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- ARGBToYRow = ARGBToYRow_Any_NEON_DotProd; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYRow = ARGBToYRow_NEON_DotProd; +- } +- } +-#endif +-#if defined(HAS_ARGBTOUVROW_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- ARGBToUVRow = ARGBToUVRow_Any_NEON; +- if (IS_ALIGNED(width, 16)) { +- ARGBToUVRow = ARGBToUVRow_NEON; +- } +- } +-#endif +-#if defined(HAS_ARGBTOUVROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- ARGBToUVRow = ARGBToUVRow_Any_SVE2; +- if (IS_ALIGNED(width, 2)) { +- ARGBToUVRow = ARGBToUVRow_SVE2; +- } +- } +-#endif + #if defined(HAS_ARGBTOYROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + ARGBToYRow = ARGBToYRow_Any_SSSE3; +@@ -2184,63 +1819,22 @@ int ARGBToI420Alpha(const uint8_t* src_a + } + } + #endif +-#if defined(HAS_ARGBEXTRACTALPHAROW_SSE2) +- if (TestCpuFlag(kCpuHasSSE2)) { +- ARGBExtractAlphaRow = IS_ALIGNED(width, 8) ? ARGBExtractAlphaRow_SSE2 +- : ARGBExtractAlphaRow_Any_SSE2; +- } +-#endif +-#if defined(HAS_ARGBEXTRACTALPHAROW_AVX2) +- if (TestCpuFlag(kCpuHasAVX2)) { +- ARGBExtractAlphaRow = IS_ALIGNED(width, 32) ? ARGBExtractAlphaRow_AVX2 +- : ARGBExtractAlphaRow_Any_AVX2; +- } +-#endif +-#if defined(HAS_ARGBEXTRACTALPHAROW_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- ARGBExtractAlphaRow = IS_ALIGNED(width, 16) ? ARGBExtractAlphaRow_NEON +- : ARGBExtractAlphaRow_Any_NEON; +- } +-#endif +-#if defined(HAS_ARGBEXTRACTALPHAROW_MSA) +- if (TestCpuFlag(kCpuHasMSA)) { +- ARGBExtractAlphaRow = IS_ALIGNED(width, 16) ? ARGBExtractAlphaRow_MSA +- : ARGBExtractAlphaRow_Any_MSA; +- } +-#endif +-#if defined(HAS_ARGBEXTRACTALPHAROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBExtractAlphaRow = IS_ALIGNED(width, 16) ? ARGBExtractAlphaRow_LSX +- : ARGBExtractAlphaRow_Any_LSX; +- } +-#endif +-#if defined(HAS_ARGBEXTRACTALPHAROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBExtractAlphaRow = ARGBExtractAlphaRow_RVV; +- } +-#endif + + for (y = 0; y < height - 1; y += 2) { + ARGBToUVRow(src_argb, src_stride_argb, dst_u, dst_v, width); + ARGBToYRow(src_argb, dst_y, width); + ARGBToYRow(src_argb + src_stride_argb, dst_y + dst_stride_y, width); +- ARGBExtractAlphaRow(src_argb, dst_a, width); +- ARGBExtractAlphaRow(src_argb + src_stride_argb, dst_a + dst_stride_a, +- width); + src_argb += src_stride_argb * 2; + dst_y += dst_stride_y * 2; + dst_u += dst_stride_u; + dst_v += dst_stride_v; +- dst_a += dst_stride_a * 2; + } + if (height & 1) { + ARGBToUVRow(src_argb, 0, dst_u, dst_v, width); + ARGBToYRow(src_argb, dst_y, width); +- ARGBExtractAlphaRow(src_argb, dst_a, width); + } + return 0; + } +-#endif // USE_EXTRACTALPHA + + // Convert BGRA to I420. + LIBYUV_API +@@ -2277,14 +1871,6 @@ int BGRAToI420(const uint8_t* src_bgra, + } + } + #endif +-#if defined(HAS_BGRATOYROW_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- BGRAToYRow = BGRAToYRow_Any_NEON_DotProd; +- if (IS_ALIGNED(width, 16)) { +- BGRAToYRow = BGRAToYRow_NEON_DotProd; +- } +- } +-#endif + #if defined(HAS_BGRATOUVROW_NEON) + if (TestCpuFlag(kCpuHasNEON)) { + BGRAToUVRow = BGRAToUVRow_Any_NEON; +@@ -2293,14 +1879,6 @@ int BGRAToI420(const uint8_t* src_bgra, + } + } + #endif +-#if defined(HAS_BGRATOUVROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- BGRAToUVRow = BGRAToUVRow_Any_SVE2; +- if (IS_ALIGNED(width, 2)) { +- BGRAToUVRow = BGRAToUVRow_SVE2; +- } +- } +-#endif + #if defined(HAS_BGRATOYROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + BGRAToYRow = BGRAToYRow_Any_SSSE3; +@@ -2363,11 +1941,6 @@ int BGRAToI420(const uint8_t* src_bgra, + } + } + #endif +-#if defined(HAS_BGRATOYROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- BGRAToYRow = BGRAToYRow_RVV; +- } +-#endif + + for (y = 0; y < height - 1; y += 2) { + BGRAToUVRow(src_bgra, src_stride_bgra, dst_u, dst_v, width); +@@ -2452,14 +2025,6 @@ int ABGRToI420(const uint8_t* src_abgr, + } + } + #endif +-#if defined(HAS_ABGRTOYROW_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- ABGRToYRow = ABGRToYRow_Any_NEON_DotProd; +- if (IS_ALIGNED(width, 16)) { +- ABGRToYRow = ABGRToYRow_NEON_DotProd; +- } +- } +-#endif + #if defined(HAS_ABGRTOUVROW_NEON) + if (TestCpuFlag(kCpuHasNEON)) { + ABGRToUVRow = ABGRToUVRow_Any_NEON; +@@ -2468,14 +2033,6 @@ int ABGRToI420(const uint8_t* src_abgr, + } + } + #endif +-#if defined(HAS_ABGRTOUVROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- ABGRToUVRow = ABGRToUVRow_Any_SVE2; +- if (IS_ALIGNED(width, 2)) { +- ABGRToUVRow = ABGRToUVRow_SVE2; +- } +- } +-#endif + #if defined(HAS_ABGRTOYROW_MSA) && defined(HAS_ABGRTOUVROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + ABGRToYRow = ABGRToYRow_Any_MSA; +@@ -2504,11 +2061,6 @@ int ABGRToI420(const uint8_t* src_abgr, + } + } + #endif +-#if defined(HAS_ABGRTOYROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ABGRToYRow = ABGRToYRow_RVV; +- } +-#endif + + for (y = 0; y < height - 1; y += 2) { + ABGRToUVRow(src_abgr, src_stride_abgr, dst_u, dst_v, width); +@@ -2577,14 +2129,6 @@ int RGBAToI420(const uint8_t* src_rgba, + } + } + #endif +-#if defined(HAS_RGBATOYROW_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- RGBAToYRow = RGBAToYRow_Any_NEON_DotProd; +- if (IS_ALIGNED(width, 16)) { +- RGBAToYRow = RGBAToYRow_NEON_DotProd; +- } +- } +-#endif + #if defined(HAS_RGBATOUVROW_NEON) + if (TestCpuFlag(kCpuHasNEON)) { + RGBAToUVRow = RGBAToUVRow_Any_NEON; +@@ -2593,14 +2137,6 @@ int RGBAToI420(const uint8_t* src_rgba, + } + } + #endif +-#if defined(HAS_RGBATOUVROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- RGBAToUVRow = RGBAToUVRow_Any_SVE2; +- if (IS_ALIGNED(width, 2)) { +- RGBAToUVRow = RGBAToUVRow_SVE2; +- } +- } +-#endif + #if defined(HAS_RGBATOYROW_MSA) && defined(HAS_RGBATOUVROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + RGBAToYRow = RGBAToYRow_Any_MSA; +@@ -2629,11 +2165,6 @@ int RGBAToI420(const uint8_t* src_rgba, + } + } + #endif +-#if defined(HAS_RGBATOYROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- RGBAToYRow = RGBAToYRow_RVV; +- } +-#endif + + for (y = 0; y < height - 1; y += 2) { + RGBAToUVRow(src_rgba, src_stride_rgba, dst_u, dst_v, width); +@@ -2653,7 +2184,7 @@ int RGBAToI420(const uint8_t* src_rgba, + + // Enabled if 1 pass is available + #if (defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA) || \ +- defined(HAS_RGB24TOYROW_LSX) || defined(HAS_RGB24TOYROW_RVV)) ++ defined(HAS_RGB24TOYROW_LSX)) + #define HAS_RGB24TOYROW + #endif + +@@ -2738,11 +2269,6 @@ int RGB24ToI420(const uint8_t* src_rgb24 + } + } + #endif +-#if defined(HAS_RGB24TOYROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- RGB24ToYRow = RGB24ToYRow_RVV; +- } +-#endif + + // Other platforms do intermediate conversion from RGB24 to ARGB. + #else // HAS_RGB24TOYROW +@@ -2794,8 +2320,6 @@ int RGB24ToI420(const uint8_t* src_rgb24 + // Allocate 2 rows of ARGB. + const int row_size = (width * 4 + 31) & ~31; + align_buffer_64(row, row_size * 2); +- if (!row) +- return 1; + #endif + + for (y = 0; y < height - 1; y += 2) { +@@ -2834,8 +2358,7 @@ int RGB24ToI420(const uint8_t* src_rgb24 + #undef HAS_RGB24TOYROW + + // Enabled if 1 pass is available +-#if defined(HAS_RGB24TOYJROW_NEON) || defined(HAS_RGB24TOYJROW_MSA) || \ +- defined(HAS_RGB24TOYJROW_RVV) ++#if defined(HAS_RGB24TOYJROW_NEON) || defined(HAS_RGB24TOYJROW_MSA) + #define HAS_RGB24TOYJROW + #endif + +@@ -2916,11 +2439,6 @@ int RGB24ToJ420(const uint8_t* src_rgb24 + } + } + #endif +-#if defined(HAS_RGB24TOYJROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- RGB24ToYJRow = RGB24ToYJRow_RVV; +- } +-#endif + + // Other platforms do intermediate conversion from RGB24 to ARGB. + #else // HAS_RGB24TOYJROW +@@ -2972,8 +2490,6 @@ int RGB24ToJ420(const uint8_t* src_rgb24 + // Allocate 2 rows of ARGB. + const int row_size = (width * 4 + 31) & ~31; + align_buffer_64(row, row_size * 2); +- if (!row) +- return 1; + #endif + + for (y = 0; y < height - 1; y += 2) { +@@ -3013,7 +2529,7 @@ int RGB24ToJ420(const uint8_t* src_rgb24 + + // Enabled if 1 pass is available + #if (defined(HAS_RAWTOYROW_NEON) || defined(HAS_RAWTOYROW_MSA) || \ +- defined(HAS_RAWTOYROW_LSX) || defined(HAS_RAWTOYROW_RVV)) ++ defined(HAS_RAWTOYROW_LSX)) + #define HAS_RAWTOYROW + #endif + +@@ -3097,11 +2613,6 @@ int RAWToI420(const uint8_t* src_raw, + } + } + #endif +-#if defined(HAS_RAWTOYROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- RAWToYRow = RAWToYRow_RVV; +- } +-#endif + + // Other platforms do intermediate conversion from RAW to ARGB. + #else // HAS_RAWTOYROW +@@ -3153,8 +2664,6 @@ int RAWToI420(const uint8_t* src_raw, + // Allocate 2 rows of ARGB. + const int row_size = (width * 4 + 31) & ~31; + align_buffer_64(row, row_size * 2); +- if (!row) +- return 1; + #endif + + for (y = 0; y < height - 1; y += 2) { +@@ -3193,8 +2702,7 @@ int RAWToI420(const uint8_t* src_raw, + #undef HAS_RAWTOYROW + + // Enabled if 1 pass is available +-#if defined(HAS_RAWTOYJROW_NEON) || defined(HAS_RAWTOYJROW_MSA) || \ +- defined(HAS_RAWTOYJROW_RVV) ++#if defined(HAS_RAWTOYJROW_NEON) || defined(HAS_RAWTOYJROW_MSA) + #define HAS_RAWTOYJROW + #endif + +@@ -3275,11 +2783,6 @@ int RAWToJ420(const uint8_t* src_raw, + } + } + #endif +-#if defined(HAS_RAWTOYJROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- RAWToYJRow = RAWToYJRow_RVV; +- } +-#endif + + // Other platforms do intermediate conversion from RAW to ARGB. + #else // HAS_RAWTOYJROW +@@ -3331,8 +2834,6 @@ int RAWToJ420(const uint8_t* src_raw, + // Allocate 2 rows of ARGB. + const int row_size = (width * 4 + 31) & ~31; + align_buffer_64(row, row_size * 2); +- if (!row) +- return 1; + #endif + + for (y = 0; y < height - 1; y += 2) { +@@ -3511,8 +3012,6 @@ int RGB565ToI420(const uint8_t* src_rgb5 + // Allocate 2 rows of ARGB. + const int row_size = (width * 4 + 31) & ~31; + align_buffer_64(row, row_size * 2); +- if (!row) +- return 1; + #endif + for (y = 0; y < height - 1; y += 2) { + #if (defined(HAS_RGB565TOYROW_NEON) || defined(HAS_RGB565TOYROW_MSA) || \ +@@ -3693,8 +3192,6 @@ int ARGB1555ToI420(const uint8_t* src_ar + // Allocate 2 rows of ARGB. + const int row_size = (width * 4 + 31) & ~31; + align_buffer_64(row, row_size * 2); +- if (!row) +- return 1; + #endif + + for (y = 0; y < height - 1; y += 2) { +@@ -3881,16 +3378,6 @@ int ARGB4444ToI420(const uint8_t* src_ar + } + } + #endif +-#if defined(HAS_ARGBTOYROW_LSX) && defined(HAS_ARGBTOUVROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBToYRow = ARGBToYRow_Any_LSX; +- ARGBToUVRow = ARGBToUVRow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYRow = ARGBToYRow_LSX; +- ARGBToUVRow = ARGBToUVRow_LSX; +- } +- } +-#endif + #if defined(HAS_ARGBTOYROW_LASX) && defined(HAS_ARGBTOUVROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + ARGBToYRow = ARGBToYRow_Any_LASX; +@@ -3908,8 +3395,6 @@ int ARGB4444ToI420(const uint8_t* src_ar + // Allocate 2 rows of ARGB. + const int row_size = (width * 4 + 31) & ~31; + align_buffer_64(row, row_size * 2); +- if (!row) +- return 1; + #endif + + for (y = 0; y < height - 1; y += 2) { +@@ -4021,11 +3506,6 @@ int RGB24ToJ400(const uint8_t* src_rgb24 + } + } + #endif +-#if defined(HAS_RGB24TOYJROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- RGB24ToYJRow = RGB24ToYJRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + RGB24ToYJRow(src_rgb24, dst_yj, width); +@@ -4110,11 +3590,6 @@ int RAWToJ400(const uint8_t* src_raw, + } + } + #endif +-#if defined(HAS_RAWTOYJROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- RAWToYJRow = RAWToYJRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + RAWToYJRow(src_raw, dst_yj, width); +diff --git a/media/libyuv/libyuv/source/convert_argb.cc b/media/libyuv/libyuv/source/convert_argb.cc +--- a/media/libyuv/libyuv/source/convert_argb.cc ++++ b/media/libyuv/libyuv/source/convert_argb.cc +@@ -14,6 +14,9 @@ + + #include "libyuv/convert_from_argb.h" + #include "libyuv/cpu_id.h" ++#ifdef HAVE_JPEG ++#include "libyuv/mjpeg_decoder.h" ++#endif + #include "libyuv/planar_functions.h" // For CopyPlane and ARGBShuffle. + #include "libyuv/rotate_argb.h" + #include "libyuv/row.h" +@@ -109,11 +112,6 @@ int I420ToARGBMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_I422TOARGBROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- I422ToARGBRow = I422ToARGBRow_SVE2; +- } +-#endif + #if defined(HAS_I422TOARGBROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + I422ToARGBRow = I422ToARGBRow_Any_MSA; +@@ -122,14 +120,6 @@ int I420ToARGBMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_I422TOARGBROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- I422ToARGBRow = I422ToARGBRow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- I422ToARGBRow = I422ToARGBRow_LSX; +- } +- } +-#endif + #if defined(HAS_I422TOARGBROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + I422ToARGBRow = I422ToARGBRow_Any_LASX; +@@ -138,11 +128,6 @@ int I420ToARGBMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_I422TOARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- I422ToARGBRow = I422ToARGBRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + I422ToARGBRow(src_y, src_u, src_v, dst_argb, yuvconstants, width); +@@ -368,11 +353,6 @@ int I422ToARGBMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_I422TOARGBROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- I422ToARGBRow = I422ToARGBRow_SVE2; +- } +-#endif + #if defined(HAS_I422TOARGBROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + I422ToARGBRow = I422ToARGBRow_Any_MSA; +@@ -381,14 +361,6 @@ int I422ToARGBMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_I422TOARGBROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- I422ToARGBRow = I422ToARGBRow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- I422ToARGBRow = I422ToARGBRow_LSX; +- } +- } +-#endif + #if defined(HAS_I422TOARGBROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + I422ToARGBRow = I422ToARGBRow_Any_LASX; +@@ -397,11 +369,6 @@ int I422ToARGBMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_I422TOARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- I422ToARGBRow = I422ToARGBRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + I422ToARGBRow(src_y, src_u, src_v, dst_argb, yuvconstants, width); +@@ -616,11 +583,6 @@ int I444ToARGBMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_I444TOARGBROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- I444ToARGBRow = I444ToARGBRow_SVE2; +- } +-#endif + #if defined(HAS_I444TOARGBROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + I444ToARGBRow = I444ToARGBRow_Any_MSA; +@@ -637,11 +599,6 @@ int I444ToARGBMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_I444TOARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- I444ToARGBRow = I444ToARGBRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + I444ToARGBRow(src_y, src_u, src_v, dst_argb, yuvconstants, width); +@@ -872,11 +829,6 @@ int I444ToRGB24Matrix(const uint8_t* src + } + } + #endif +-#if defined(HAS_I444TORGB24ROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- I444ToRGB24Row = I444ToRGB24Row_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + I444ToRGB24Row(src_y, src_u, src_v, dst_rgb24, yuvconstants, width); +@@ -954,14 +906,6 @@ int I010ToAR30Matrix(const uint16_t* src + dst_ar30 = dst_ar30 + (height - 1) * dst_stride_ar30; + dst_stride_ar30 = -dst_stride_ar30; + } +-#if defined(HAS_I210TOAR30ROW_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- I210ToAR30Row = I210ToAR30Row_Any_NEON; +- if (IS_ALIGNED(width, 8)) { +- I210ToAR30Row = I210ToAR30Row_NEON; +- } +- } +-#endif + #if defined(HAS_I210TOAR30ROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + I210ToAR30Row = I210ToAR30Row_Any_SSSE3; +@@ -1180,14 +1124,6 @@ int I210ToAR30Matrix(const uint16_t* src + dst_ar30 = dst_ar30 + (height - 1) * dst_stride_ar30; + dst_stride_ar30 = -dst_stride_ar30; + } +-#if defined(HAS_I210TOAR30ROW_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- I210ToAR30Row = I210ToAR30Row_Any_NEON; +- if (IS_ALIGNED(width, 8)) { +- I210ToAR30Row = I210ToAR30Row_NEON; +- } +- } +-#endif + #if defined(HAS_I210TOAR30ROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + I210ToAR30Row = I210ToAR30Row_Any_SSSE3; +@@ -1343,14 +1279,6 @@ int I410ToAR30Matrix(const uint16_t* src + dst_ar30 = dst_ar30 + (height - 1) * dst_stride_ar30; + dst_stride_ar30 = -dst_stride_ar30; + } +-#if defined(HAS_I410TOAR30ROW_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- I410ToAR30Row = I410ToAR30Row_Any_NEON; +- if (IS_ALIGNED(width, 8)) { +- I410ToAR30Row = I410ToAR30Row_NEON; +- } +- } +-#endif + #if defined(HAS_I410TOAR30ROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + I410ToAR30Row = I410ToAR30Row_Any_SSSE3; +@@ -1413,14 +1341,6 @@ int I010ToARGBMatrix(const uint16_t* src + } + } + #endif +-#if defined(HAS_I210TOARGBROW_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- I210ToARGBRow = I210ToARGBRow_Any_NEON; +- if (IS_ALIGNED(width, 8)) { +- I210ToARGBRow = I210ToARGBRow_NEON; +- } +- } +-#endif + #if defined(HAS_I210TOARGBROW_AVX2) + if (TestCpuFlag(kCpuHasAVX2)) { + I210ToARGBRow = I210ToARGBRow_Any_AVX2; +@@ -1641,14 +1561,6 @@ int I210ToARGBMatrix(const uint16_t* src + } + } + #endif +-#if defined(HAS_I210TOARGBROW_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- I210ToARGBRow = I210ToARGBRow_Any_NEON; +- if (IS_ALIGNED(width, 8)) { +- I210ToARGBRow = I210ToARGBRow_NEON; +- } +- } +-#endif + #if defined(HAS_I210TOARGBROW_AVX2) + if (TestCpuFlag(kCpuHasAVX2)) { + I210ToARGBRow = I210ToARGBRow_Any_AVX2; +@@ -1810,14 +1722,6 @@ int I410ToARGBMatrix(const uint16_t* src + } + } + #endif +-#if defined(HAS_I410TOARGBROW_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- I410ToARGBRow = I410ToARGBRow_Any_NEON; +- if (IS_ALIGNED(width, 8)) { +- I410ToARGBRow = I410ToARGBRow_NEON; +- } +- } +-#endif + #if defined(HAS_I410TOARGBROW_AVX2) + if (TestCpuFlag(kCpuHasAVX2)) { + I410ToARGBRow = I410ToARGBRow_Any_AVX2; +@@ -2095,11 +1999,6 @@ int I420AlphaToARGBMatrix(const uint8_t* + } + } + #endif +-#if defined(HAS_I422ALPHATOARGBROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- I422AlphaToARGBRow = I422AlphaToARGBRow_SVE2; +- } +-#endif + #if defined(HAS_I422ALPHATOARGBROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + I422AlphaToARGBRow = I422AlphaToARGBRow_Any_MSA; +@@ -2108,14 +2007,6 @@ int I420AlphaToARGBMatrix(const uint8_t* + } + } + #endif +-#if defined(HAS_I422ALPHATOARGBROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- I422AlphaToARGBRow = I422AlphaToARGBRow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- I422AlphaToARGBRow = I422AlphaToARGBRow_LSX; +- } +- } +-#endif + #if defined(HAS_I422ALPHATOARGBROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + I422AlphaToARGBRow = I422AlphaToARGBRow_Any_LASX; +@@ -2124,11 +2015,6 @@ int I420AlphaToARGBMatrix(const uint8_t* + } + } + #endif +-#if defined(HAS_I422ALPHATOARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- I422AlphaToARGBRow = I422AlphaToARGBRow_RVV; +- } +-#endif + #if defined(HAS_ARGBATTENUATEROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + ARGBAttenuateRow = ARGBAttenuateRow_Any_SSSE3; +@@ -2161,11 +2047,6 @@ int I420AlphaToARGBMatrix(const uint8_t* + } + } + #endif +-#if defined(HAS_ARGBATTENUATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBAttenuateRow = ARGBAttenuateRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + I422AlphaToARGBRow(src_y, src_u, src_v, src_a, dst_argb, yuvconstants, +@@ -2243,11 +2124,6 @@ int I422AlphaToARGBMatrix(const uint8_t* + } + } + #endif +-#if defined(HAS_I422ALPHATOARGBROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- I422AlphaToARGBRow = I422AlphaToARGBRow_SVE2; +- } +-#endif + #if defined(HAS_I422ALPHATOARGBROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + I422AlphaToARGBRow = I422AlphaToARGBRow_Any_MSA; +@@ -2256,14 +2132,6 @@ int I422AlphaToARGBMatrix(const uint8_t* + } + } + #endif +-#if defined(HAS_I422ALPHATOARGBROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- I422AlphaToARGBRow = I422AlphaToARGBRow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- I422AlphaToARGBRow = I422AlphaToARGBRow_LSX; +- } +- } +-#endif + #if defined(HAS_I422ALPHATOARGBROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + I422AlphaToARGBRow = I422AlphaToARGBRow_Any_LASX; +@@ -2272,11 +2140,6 @@ int I422AlphaToARGBMatrix(const uint8_t* + } + } + #endif +-#if defined(HAS_I422ALPHATOARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- I422AlphaToARGBRow = I422AlphaToARGBRow_RVV; +- } +-#endif + #if defined(HAS_ARGBATTENUATEROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + ARGBAttenuateRow = ARGBAttenuateRow_Any_SSSE3; +@@ -2309,11 +2172,6 @@ int I422AlphaToARGBMatrix(const uint8_t* + } + } + #endif +-#if defined(HAS_ARGBATTENUATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBAttenuateRow = ARGBAttenuateRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + I422AlphaToARGBRow(src_y, src_u, src_v, src_a, dst_argb, yuvconstants, +@@ -2389,11 +2247,6 @@ int I444AlphaToARGBMatrix(const uint8_t* + } + } + #endif +-#if defined(HAS_I444ALPHATOARGBROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- I444AlphaToARGBRow = I444AlphaToARGBRow_SVE2; +- } +-#endif + #if defined(HAS_I444ALPHATOARGBROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + I444AlphaToARGBRow = I444AlphaToARGBRow_Any_MSA; +@@ -2402,11 +2255,6 @@ int I444AlphaToARGBMatrix(const uint8_t* + } + } + #endif +-#if defined(HAS_I444ALPHATOARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- I444AlphaToARGBRow = I444AlphaToARGBRow_RVV; +- } +-#endif + #if defined(HAS_ARGBATTENUATEROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + ARGBAttenuateRow = ARGBAttenuateRow_Any_SSSE3; +@@ -2439,11 +2287,6 @@ int I444AlphaToARGBMatrix(const uint8_t* + } + } + #endif +-#if defined(HAS_ARGBATTENUATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBAttenuateRow = ARGBAttenuateRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + I444AlphaToARGBRow(src_y, src_u, src_v, src_a, dst_argb, yuvconstants, +@@ -2624,14 +2467,6 @@ int I010AlphaToARGBMatrix(const uint16_t + dst_argb = dst_argb + (height - 1) * dst_stride_argb; + dst_stride_argb = -dst_stride_argb; + } +-#if defined(HAS_I210ALPHATOARGBROW_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- I210AlphaToARGBRow = I210AlphaToARGBRow_Any_NEON; +- if (IS_ALIGNED(width, 8)) { +- I210AlphaToARGBRow = I210AlphaToARGBRow_NEON; +- } +- } +-#endif + #if defined(HAS_I210ALPHATOARGBROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + I210AlphaToARGBRow = I210AlphaToARGBRow_Any_SSSE3; +@@ -2680,11 +2515,6 @@ int I010AlphaToARGBMatrix(const uint16_t + } + } + #endif +-#if defined(HAS_ARGBATTENUATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBAttenuateRow = ARGBAttenuateRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + I210AlphaToARGBRow(src_y, src_u, src_v, src_a, dst_argb, yuvconstants, +@@ -2738,14 +2568,6 @@ int I210AlphaToARGBMatrix(const uint16_t + dst_argb = dst_argb + (height - 1) * dst_stride_argb; + dst_stride_argb = -dst_stride_argb; + } +-#if defined(HAS_I210ALPHATOARGBROW_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- I210AlphaToARGBRow = I210AlphaToARGBRow_Any_NEON; +- if (IS_ALIGNED(width, 8)) { +- I210AlphaToARGBRow = I210AlphaToARGBRow_NEON; +- } +- } +-#endif + #if defined(HAS_I210ALPHATOARGBROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + I210AlphaToARGBRow = I210AlphaToARGBRow_Any_SSSE3; +@@ -2794,11 +2616,6 @@ int I210AlphaToARGBMatrix(const uint16_t + } + } + #endif +-#if defined(HAS_ARGBATTENUATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBAttenuateRow = ARGBAttenuateRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + I210AlphaToARGBRow(src_y, src_u, src_v, src_a, dst_argb, yuvconstants, +@@ -2850,14 +2667,6 @@ int I410AlphaToARGBMatrix(const uint16_t + dst_argb = dst_argb + (height - 1) * dst_stride_argb; + dst_stride_argb = -dst_stride_argb; + } +-#if defined(HAS_I410ALPHATOARGBROW_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- I410AlphaToARGBRow = I410AlphaToARGBRow_Any_NEON; +- if (IS_ALIGNED(width, 8)) { +- I410AlphaToARGBRow = I410AlphaToARGBRow_NEON; +- } +- } +-#endif + #if defined(HAS_I410ALPHATOARGBROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + I410AlphaToARGBRow = I410AlphaToARGBRow_Any_SSSE3; +@@ -2906,11 +2715,6 @@ int I410AlphaToARGBMatrix(const uint16_t + } + } + #endif +-#if defined(HAS_ARGBATTENUATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBAttenuateRow = ARGBAttenuateRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + I410AlphaToARGBRow(src_y, src_u, src_v, src_a, dst_argb, yuvconstants, +@@ -2980,11 +2784,6 @@ int I400ToARGBMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_I400TOARGBROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- I400ToARGBRow = I400ToARGBRow_SVE2; +- } +-#endif + #if defined(HAS_I400TOARGBROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + I400ToARGBRow = I400ToARGBRow_Any_MSA; +@@ -3001,11 +2800,6 @@ int I400ToARGBMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_I400TOARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- I400ToARGBRow = I400ToARGBRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + I400ToARGBRow(src_y, dst_argb, yuvconstants, width); +@@ -3093,12 +2887,6 @@ int J400ToARGB(const uint8_t* src_y, + } + } + #endif +-#if defined(HAS_J400TOARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- J400ToARGBRow = J400ToARGBRow_RVV; +- } +-#endif +- + for (y = 0; y < height; ++y) { + J400ToARGBRow(src_y, dst_argb, width); + src_y += src_stride_y; +@@ -3107,7 +2895,6 @@ int J400ToARGB(const uint8_t* src_y, + return 0; + } + +-#ifndef __riscv + // Shuffle table for converting BGRA to ARGB. + static const uvec8 kShuffleMaskBGRAToARGB = { + 3u, 2u, 1u, 0u, 7u, 6u, 5u, 4u, 11u, 10u, 9u, 8u, 15u, 14u, 13u, 12u}; +@@ -3195,195 +2982,6 @@ int AR64ToAB64(const uint16_t* src_ar64, + return AR64Shuffle(src_ar64, src_stride_ar64, dst_ab64, dst_stride_ab64, + (const uint8_t*)&kShuffleMaskAR64ToAB64, width, height); + } +-#else +-// Convert BGRA to ARGB (same as ARGBToBGRA). +-LIBYUV_API +-int BGRAToARGB(const uint8_t* src_bgra, +- int src_stride_bgra, +- uint8_t* dst_argb, +- int dst_stride_argb, +- int width, +- int height) { +- return ARGBToBGRA(src_bgra, src_stride_bgra, dst_argb, dst_stride_argb, width, +- height); +-} +- +-// Convert ARGB to BGRA. +-LIBYUV_API +-int ARGBToBGRA(const uint8_t* src_argb, +- int src_stride_argb, +- uint8_t* dst_bgra, +- int dst_stride_bgra, +- int width, +- int height) { +- int y; +- void (*ARGBToBGRARow)(const uint8_t* src_argb, uint8_t* dst_bgra, int width) = +- ARGBToBGRARow_C; +- if (!src_argb || !dst_bgra || width <= 0 || height == 0) { +- return -1; +- } +- // Negative height means invert the image. +- if (height < 0) { +- height = -height; +- src_argb = src_argb + (height - 1) * src_stride_argb; +- src_stride_argb = -src_stride_argb; +- } +- // Coalesce rows. +- if (src_stride_argb == width * 4 && dst_stride_bgra == width * 4) { +- width *= height; +- height = 1; +- src_stride_argb = dst_stride_bgra = 0; +- } +- +-#if defined(HAS_ARGBTOBGRAROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBToBGRARow = ARGBToBGRARow_RVV; +- } +-#endif +- +- for (y = 0; y < height; ++y) { +- ARGBToBGRARow(src_argb, dst_bgra, width); +- src_argb += src_stride_argb; +- dst_bgra += dst_stride_bgra; +- } +- return 0; +-} +- +-// Convert ARGB to ABGR. +-LIBYUV_API +-int ARGBToABGR(const uint8_t* src_argb, +- int src_stride_argb, +- uint8_t* dst_abgr, +- int dst_stride_abgr, +- int width, +- int height) { +- int y; +- void (*ARGBToABGRRow)(const uint8_t* src_argb, uint8_t* dst_abgr, int width) = +- ARGBToABGRRow_C; +- if (!src_argb || !dst_abgr || width <= 0 || height == 0) { +- return -1; +- } +- // Negative height means invert the image. +- if (height < 0) { +- height = -height; +- src_argb = src_argb + (height - 1) * src_stride_argb; +- src_stride_argb = -src_stride_argb; +- } +- // Coalesce rows. +- if (src_stride_argb == width * 4 && dst_stride_abgr == width * 4) { +- width *= height; +- height = 1; +- src_stride_argb = dst_stride_abgr = 0; +- } +- +-#if defined(HAS_ARGBTOABGRROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBToABGRRow = ARGBToABGRRow_RVV; +- } +-#endif +- +- for (y = 0; y < height; ++y) { +- ARGBToABGRRow(src_argb, dst_abgr, width); +- src_argb += src_stride_argb; +- dst_abgr += dst_stride_abgr; +- } +- return 0; +-} +- +-// Convert ABGR to ARGB (same as ARGBToABGR). +-LIBYUV_API +-int ABGRToARGB(const uint8_t* src_abgr, +- int src_stride_abgr, +- uint8_t* dst_argb, +- int dst_stride_argb, +- int width, +- int height) { +- return ARGBToABGR(src_abgr, src_stride_abgr, dst_argb, dst_stride_argb, width, +- height); +-} +- +-// Convert RGBA to ARGB. +-LIBYUV_API +-int RGBAToARGB(const uint8_t* src_rgba, +- int src_stride_rgba, +- uint8_t* dst_argb, +- int dst_stride_argb, +- int width, +- int height) { +- int y; +- void (*RGBAToARGBRow)(const uint8_t* src_rgba, uint8_t* dst_argb, int width) = +- RGBAToARGBRow_C; +- if (!src_rgba || !dst_argb || width <= 0 || height == 0) { +- return -1; +- } +- // Negative height means invert the image. +- if (height < 0) { +- height = -height; +- src_rgba = src_rgba + (height - 1) * src_stride_rgba; +- src_stride_rgba = -src_stride_rgba; +- } +- // Coalesce rows. +- if (src_stride_rgba == width * 4 && dst_stride_argb == width * 4) { +- width *= height; +- height = 1; +- src_stride_rgba = dst_stride_argb = 0; +- } +- +-#if defined(HAS_RGBATOARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- RGBAToARGBRow = RGBAToARGBRow_RVV; +- } +-#endif +- +- for (y = 0; y < height; ++y) { +- RGBAToARGBRow(src_rgba, dst_argb, width); +- src_rgba += src_stride_rgba; +- dst_argb += dst_stride_argb; +- } +- return 0; +-} +- +-// Convert AR64 To AB64. +-LIBYUV_API +-int AR64ToAB64(const uint16_t* src_ar64, +- int src_stride_ar64, +- uint16_t* dst_ab64, +- int dst_stride_ab64, +- int width, +- int height) { +- int y; +- void (*AR64ToAB64Row)(const uint16_t* src_ar64, uint16_t* dst_ab64, +- int width) = AR64ToAB64Row_C; +- if (!src_ar64 || !dst_ab64 || width <= 0 || height == 0) { +- return -1; +- } +- // Negative height means invert the image. +- if (height < 0) { +- height = -height; +- src_ar64 = src_ar64 + (height - 1) * src_stride_ar64; +- src_stride_ar64 = -src_stride_ar64; +- } +- // Coalesce rows. +- if (src_stride_ar64 == width * 4 && dst_stride_ab64 == width * 4) { +- width *= height; +- height = 1; +- src_stride_ar64 = dst_stride_ab64 = 0; +- } +- +-#if defined(HAS_AR64TOAB64ROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- AR64ToAB64Row = AR64ToAB64Row_RVV; +- } +-#endif +- +- for (y = 0; y < height; ++y) { +- AR64ToAB64Row(src_ar64, dst_ab64, width); +- src_ar64 += src_stride_ar64; +- dst_ab64 += dst_stride_ab64; +- } +- return 0; +-} +-#endif + + // Convert RGB24 to ARGB. + LIBYUV_API +@@ -3451,11 +3049,6 @@ int RGB24ToARGB(const uint8_t* src_rgb24 + } + } + #endif +-#if defined(HAS_RGB24TOARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- RGB24ToARGBRow = RGB24ToARGBRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + RGB24ToARGBRow(src_rgb24, dst_argb, width); +@@ -3531,11 +3124,6 @@ int RAWToARGB(const uint8_t* src_raw, + } + } + #endif +-#if defined(HAS_RAWTOARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- RAWToARGBRow = RAWToARGBRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + RAWToARGBRow(src_raw, dst_argb, width); +@@ -3587,11 +3175,6 @@ int RAWToRGBA(const uint8_t* src_raw, + } + } + #endif +-#if defined(HAS_RAWTORGBAROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- RAWToRGBARow = RAWToRGBARow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + RAWToRGBARow(src_raw, dst_rgba, width); +@@ -3734,11 +3317,6 @@ int ARGB1555ToARGB(const uint8_t* src_ar + } + } + #endif +-#if defined(HAS_ARGB1555TOARGBROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- ARGB1555ToARGBRow = ARGB1555ToARGBRow_SVE2; +- } +-#endif + #if defined(HAS_ARGB1555TOARGBROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + ARGB1555ToARGBRow = ARGB1555ToARGBRow_Any_MSA; +@@ -4001,11 +3579,6 @@ int AR64ToARGB(const uint16_t* src_ar64, + } + } + #endif +-#if defined(HAS_AR64TOARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- AR64ToARGBRow = AR64ToARGBRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + AR64ToARGBRow(src_ar64, dst_argb, width); +@@ -4065,11 +3638,6 @@ int AB64ToARGB(const uint16_t* src_ab64, + } + } + #endif +-#if defined(HAS_AB64TOARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- AB64ToARGBRow = AB64ToARGBRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + AB64ToARGBRow(src_ab64, dst_argb, width); +@@ -4128,11 +3696,6 @@ int NV12ToARGBMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_NV12TOARGBROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- NV12ToARGBRow = NV12ToARGBRow_SVE2; +- } +-#endif + #if defined(HAS_NV12TOARGBROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + NV12ToARGBRow = NV12ToARGBRow_Any_MSA; +@@ -4157,11 +3720,6 @@ int NV12ToARGBMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_NV12TOARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- NV12ToARGBRow = NV12ToARGBRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + NV12ToARGBRow(src_y, src_uv, dst_argb, yuvconstants, width); +@@ -4223,11 +3781,6 @@ int NV21ToARGBMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_NV21TOARGBROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- NV21ToARGBRow = NV21ToARGBRow_SVE2; +- } +-#endif + #if defined(HAS_NV21TOARGBROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + NV21ToARGBRow = NV21ToARGBRow_Any_MSA; +@@ -4252,11 +3805,6 @@ int NV21ToARGBMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_NV21TOARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- NV21ToARGBRow = NV21ToARGBRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + NV21ToARGBRow(src_y, src_vu, dst_argb, yuvconstants, width); +@@ -4377,11 +3925,6 @@ int NV12ToRGB24Matrix(const uint8_t* src + } + } + #endif +-#if defined(HAS_NV12TORGB24ROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- NV12ToRGB24Row = NV12ToRGB24Row_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + NV12ToRGB24Row(src_y, src_uv, dst_rgb24, yuvconstants, width); +@@ -4443,11 +3986,6 @@ int NV21ToRGB24Matrix(const uint8_t* src + } + } + #endif +-#if defined(HAS_NV21TORGB24ROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- NV21ToRGB24Row = NV21ToRGB24Row_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + NV21ToRGB24Row(src_y, src_vu, dst_rgb24, yuvconstants, width); +@@ -4574,15 +4112,14 @@ int NV21ToYUV24(const uint8_t* src_y, + return 0; + } + +-// Convert YUY2 to ARGB with matrix. +-LIBYUV_API +-int YUY2ToARGBMatrix(const uint8_t* src_yuy2, +- int src_stride_yuy2, +- uint8_t* dst_argb, +- int dst_stride_argb, +- const struct YuvConstants* yuvconstants, +- int width, +- int height) { ++// Convert YUY2 to ARGB. ++LIBYUV_API ++int YUY2ToARGB(const uint8_t* src_yuy2, ++ int src_stride_yuy2, ++ uint8_t* dst_argb, ++ int dst_stride_argb, ++ int width, ++ int height) { + int y; + void (*YUY2ToARGBRow)(const uint8_t* src_yuy2, uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, int width) = +@@ -4626,11 +4163,6 @@ int YUY2ToARGBMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_YUY2TOARGBROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- YUY2ToARGBRow = YUY2ToARGBRow_SVE2; +- } +-#endif + #if defined(HAS_YUY2TOARGBROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + YUY2ToARGBRow = YUY2ToARGBRow_Any_MSA; +@@ -4648,34 +4180,21 @@ int YUY2ToARGBMatrix(const uint8_t* src_ + } + #endif + for (y = 0; y < height; ++y) { +- YUY2ToARGBRow(src_yuy2, dst_argb, yuvconstants, width); ++ YUY2ToARGBRow(src_yuy2, dst_argb, &kYuvI601Constants, width); + src_yuy2 += src_stride_yuy2; + dst_argb += dst_stride_argb; + } + return 0; + } + +-// Convert YUY2 to ARGB. +-LIBYUV_API +-int YUY2ToARGB(const uint8_t* src_yuy2, +- int src_stride_yuy2, ++// Convert UYVY to ARGB. ++LIBYUV_API ++int UYVYToARGB(const uint8_t* src_uyvy, ++ int src_stride_uyvy, + uint8_t* dst_argb, + int dst_stride_argb, + int width, + int height) { +- return YUY2ToARGBMatrix(src_yuy2, src_stride_yuy2, dst_argb, dst_stride_argb, +- &kYuvI601Constants, width, height); +-} +- +-// Convert UYVY to ARGB with matrix. +-LIBYUV_API +-int UYVYToARGBMatrix(const uint8_t* src_uyvy, +- int src_stride_uyvy, +- uint8_t* dst_argb, +- int dst_stride_argb, +- const struct YuvConstants* yuvconstants, +- int width, +- int height) { + int y; + void (*UYVYToARGBRow)(const uint8_t* src_uyvy, uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, int width) = +@@ -4719,11 +4238,6 @@ int UYVYToARGBMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_UYVYTOARGBROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- UYVYToARGBRow = UYVYToARGBRow_SVE2; +- } +-#endif + #if defined(HAS_UYVYTOARGBROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + UYVYToARGBRow = UYVYToARGBRow_Any_MSA; +@@ -4741,25 +4255,12 @@ int UYVYToARGBMatrix(const uint8_t* src_ + } + #endif + for (y = 0; y < height; ++y) { +- UYVYToARGBRow(src_uyvy, dst_argb, yuvconstants, width); ++ UYVYToARGBRow(src_uyvy, dst_argb, &kYuvI601Constants, width); + src_uyvy += src_stride_uyvy; + dst_argb += dst_stride_argb; + } + return 0; + } +- +-// Convert UYVY to ARGB. +-LIBYUV_API +-int UYVYToARGB(const uint8_t* src_uyvy, +- int src_stride_uyvy, +- uint8_t* dst_argb, +- int dst_stride_argb, +- int width, +- int height) { +- return UYVYToARGBMatrix(src_uyvy, src_stride_uyvy, dst_argb, dst_stride_argb, +- &kYuvI601Constants, width, height); +-} +- + static void WeavePixels(const uint8_t* src_u, + const uint8_t* src_v, + int src_pixel_stride_uv, +@@ -4826,8 +4327,6 @@ int Android420ToARGBMatrix(const uint8_t + + // General case fallback creates NV12 + align_buffer_64(plane_uv, halfwidth * 2 * halfheight); +- if (!plane_uv) +- return 1; + dst_uv = plane_uv; + for (y = 0; y < halfheight; ++y) { + WeavePixels(src_u, src_v, src_pixel_stride_uv, dst_uv, halfwidth); +@@ -4931,11 +4430,6 @@ int I422ToRGBAMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_I422TORGBAROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- I422ToRGBARow = I422ToRGBARow_SVE2; +- } +-#endif + #if defined(HAS_I422TORGBAROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + I422ToRGBARow = I422ToRGBARow_Any_MSA; +@@ -4944,14 +4438,6 @@ int I422ToRGBAMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_I422TORGBAROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- I422ToRGBARow = I422ToRGBARow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- I422ToRGBARow = I422ToRGBARow_LSX; +- } +- } +-#endif + #if defined(HAS_I422TORGBAROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + I422ToRGBARow = I422ToRGBARow_Any_LASX; +@@ -4960,11 +4446,6 @@ int I422ToRGBAMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_I422TORGBAROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- I422ToRGBARow = I422ToRGBARow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + I422ToRGBARow(src_y, src_u, src_v, dst_rgba, yuvconstants, width); +@@ -5164,11 +4645,6 @@ int I420ToRGBAMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_I422TORGBAROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- I422ToRGBARow = I422ToRGBARow_SVE2; +- } +-#endif + #if defined(HAS_I422TORGBAROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + I422ToRGBARow = I422ToRGBARow_Any_MSA; +@@ -5177,14 +4653,6 @@ int I420ToRGBAMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_I422TORGBAROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- I422ToRGBARow = I422ToRGBARow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- I422ToRGBARow = I422ToRGBARow_LSX; +- } +- } +-#endif + #if defined(HAS_I422TORGBAROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + I422ToRGBARow = I422ToRGBARow_Any_LASX; +@@ -5193,11 +4661,6 @@ int I420ToRGBAMatrix(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_I422TORGBAROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- I422ToRGBARow = I422ToRGBARow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + I422ToRGBARow(src_y, src_u, src_v, dst_rgba, yuvconstants, width); +@@ -5307,14 +4770,6 @@ int I420ToRGB24Matrix(const uint8_t* src + } + } + #endif +-#if defined(HAS_I422TORGB24ROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- I422ToRGB24Row = I422ToRGB24Row_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- I422ToRGB24Row = I422ToRGB24Row_LSX; +- } +- } +-#endif + #if defined(HAS_I422TORGB24ROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + I422ToRGB24Row = I422ToRGB24Row_Any_LASX; +@@ -5323,11 +4778,6 @@ int I420ToRGB24Matrix(const uint8_t* src + } + } + #endif +-#if defined(HAS_I422TORGB24ROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- I422ToRGB24Row = I422ToRGB24Row_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + I422ToRGB24Row(src_y, src_u, src_v, dst_rgb24, yuvconstants, width); +@@ -5509,14 +4959,6 @@ int I422ToRGB24Matrix(const uint8_t* src + } + } + #endif +-#if defined(HAS_I422TORGB24ROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- I422ToRGB24Row = I422ToRGB24Row_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- I422ToRGB24Row = I422ToRGB24Row_LSX; +- } +- } +-#endif + #if defined(HAS_I422TORGB24ROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + I422ToRGB24Row = I422ToRGB24Row_Any_LASX; +@@ -5525,11 +4967,6 @@ int I422ToRGB24Matrix(const uint8_t* src + } + } + #endif +-#if defined(HAS_I422TORGB24ROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- I422ToRGB24Row = I422ToRGB24Row_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + I422ToRGB24Row(src_y, src_u, src_v, dst_rgb24, yuvconstants, width); +@@ -5636,14 +5073,6 @@ int I420ToARGB1555(const uint8_t* src_y, + } + } + #endif +-#if defined(HAS_I422TOARGB1555ROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- I422ToARGB1555Row = I422ToARGB1555Row_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- I422ToARGB1555Row = I422ToARGB1555Row_LSX; +- } +- } +-#endif + #if defined(HAS_I422TOARGB1555ROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + I422ToARGB1555Row = I422ToARGB1555Row_Any_LASX; +@@ -5725,14 +5154,6 @@ int I420ToARGB4444(const uint8_t* src_y, + } + } + #endif +-#if defined(HAS_I422TOARGB4444ROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- I422ToARGB4444Row = I422ToARGB4444Row_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- I422ToARGB4444Row = I422ToARGB4444Row_LSX; +- } +- } +-#endif + #if defined(HAS_I422TOARGB4444ROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + I422ToARGB4444Row = I422ToARGB4444Row_Any_LASX; +@@ -5815,14 +5236,6 @@ int I420ToRGB565Matrix(const uint8_t* sr + } + } + #endif +-#if defined(HAS_I422TORGB565ROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- I422ToRGB565Row = I422ToRGB565Row_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- I422ToRGB565Row = I422ToRGB565Row_LSX; +- } +- } +-#endif + #if defined(HAS_I422TORGB565ROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + I422ToRGB565Row = I422ToRGB565Row_Any_LASX; +@@ -5955,14 +5368,6 @@ int I422ToRGB565Matrix(const uint8_t* sr + } + } + #endif +-#if defined(HAS_I422TORGB565ROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- I422ToRGB565Row = I422ToRGB565Row_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- I422ToRGB565Row = I422ToRGB565Row_LSX; +- } +- } +-#endif + #if defined(HAS_I422TORGB565ROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + I422ToRGB565Row = I422ToRGB565Row_Any_LASX; +@@ -6023,7 +5428,7 @@ int I420ToRGB565Dither(const uint8_t* sr + const struct YuvConstants* yuvconstants, int width) = + I422ToARGBRow_C; + void (*ARGBToRGB565DitherRow)(const uint8_t* src_argb, uint8_t* dst_rgb, +- uint32_t dither4, int width) = ++ const uint32_t dither4, int width) = + ARGBToRGB565DitherRow_C; + if (!src_y || !src_u || !src_v || !dst_rgb565 || width <= 0 || height == 0) { + return -1; +@@ -6070,11 +5475,6 @@ int I420ToRGB565Dither(const uint8_t* sr + } + } + #endif +-#if defined(HAS_I422TOARGBROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- I422ToARGBRow = I422ToARGBRow_SVE2; +- } +-#endif + #if defined(HAS_I422TOARGBROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + I422ToARGBRow = I422ToARGBRow_Any_MSA; +@@ -6083,14 +5483,6 @@ int I420ToRGB565Dither(const uint8_t* sr + } + } + #endif +-#if defined(HAS_I422TOARGBROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- I422ToARGBRow = I422ToARGBRow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- I422ToARGBRow = I422ToARGBRow_LSX; +- } +- } +-#endif + #if defined(HAS_I422TOARGBROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + I422ToARGBRow = I422ToARGBRow_Any_LASX; +@@ -6099,11 +5491,6 @@ int I420ToRGB565Dither(const uint8_t* sr + } + } + #endif +-#if defined(HAS_I422TOARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- I422ToARGBRow = I422ToARGBRow_RVV; +- } +-#endif + #if defined(HAS_ARGBTORGB565DITHERROW_SSE2) + if (TestCpuFlag(kCpuHasSSE2)) { + ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_Any_SSE2; +@@ -6128,11 +5515,6 @@ int I420ToRGB565Dither(const uint8_t* sr + } + } + #endif +-#if defined(HAS_ARGBTORGB565DITHERROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_SVE2; +- } +-#endif + #if defined(HAS_ARGBTORGB565DITHERROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_Any_MSA; +@@ -6141,14 +5523,6 @@ int I420ToRGB565Dither(const uint8_t* sr + } + } + #endif +-#if defined(HAS_ARGBTORGB565DITHERROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_Any_LSX; +- if (IS_ALIGNED(width, 8)) { +- ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_LSX; +- } +- } +-#endif + #if defined(HAS_ARGBTORGB565DITHERROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_Any_LASX; +@@ -6160,8 +5534,6 @@ int I420ToRGB565Dither(const uint8_t* sr + { + // Allocate a row of argb. + align_buffer_64(row_argb, width * 4); +- if (!row_argb) +- return 1; + for (y = 0; y < height; ++y) { + I422ToARGBRow(src_y, src_u, src_v, row_argb, &kYuvI601Constants, width); + ARGBToRGB565DitherRow(row_argb, dst_rgb565, +@@ -6361,11 +5733,6 @@ static int I420ToARGBMatrixBilinear(cons + } + } + #endif +-#if defined(HAS_I444TOARGBROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- I444ToARGBRow = I444ToARGBRow_SVE2; +- } +-#endif + #if defined(HAS_I444TOARGBROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + I444ToARGBRow = I444ToARGBRow_Any_MSA; +@@ -6382,11 +5749,6 @@ static int I420ToARGBMatrixBilinear(cons + } + } + #endif +-#if defined(HAS_I444TOARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- I444ToARGBRow = I444ToARGBRow_RVV; +- } +-#endif + + #if defined(HAS_SCALEROWUP2_BILINEAR_SSE2) + if (TestCpuFlag(kCpuHasSSE2)) { +@@ -6415,12 +5777,6 @@ static int I420ToARGBMatrixBilinear(cons + ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_NEON; + } + #endif +-#if defined(HAS_SCALEROWUP2_BILINEAR_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- Scale2RowUp_Bilinear = ScaleRowUp2_Bilinear_RVV; +- ScaleRowUp2_Linear = ScaleRowUp2_Linear_RVV; +- } +-#endif + + // alloc 4 lines temp + const int row_size = (width + 31) & ~31; +@@ -6429,8 +5785,6 @@ static int I420ToARGBMatrixBilinear(cons + uint8_t* temp_u_2 = row + row_size; + uint8_t* temp_v_1 = row + row_size * 2; + uint8_t* temp_v_2 = row + row_size * 3; +- if (!row) +- return 1; + + ScaleRowUp2_Linear(src_u, temp_u_1, width); + ScaleRowUp2_Linear(src_v, temp_v_1, width); +@@ -6513,11 +5867,6 @@ static int I422ToARGBMatrixLinear(const + } + } + #endif +-#if defined(HAS_I444TOARGBROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- I444ToARGBRow = I444ToARGBRow_SVE2; +- } +-#endif + #if defined(HAS_I444TOARGBROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + I444ToARGBRow = I444ToARGBRow_Any_MSA; +@@ -6534,11 +5883,6 @@ static int I422ToARGBMatrixLinear(const + } + } + #endif +-#if defined(HAS_I444TOARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- I444ToARGBRow = I444ToARGBRow_RVV; +- } +-#endif + #if defined(HAS_SCALEROWUP2_LINEAR_SSE2) + if (TestCpuFlag(kCpuHasSSE2)) { + ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_SSE2; +@@ -6559,19 +5903,12 @@ static int I422ToARGBMatrixLinear(const + ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_NEON; + } + #endif +-#if defined(HAS_SCALEROWUP2_LINEAR_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ScaleRowUp2_Linear = ScaleRowUp2_Linear_RVV; +- } +-#endif + + // alloc 2 lines temp + const int row_size = (width + 31) & ~31; + align_buffer_64(row, row_size * 2); + uint8_t* temp_u = row; + uint8_t* temp_v = row + row_size; +- if (!row) +- return 1; + + for (y = 0; y < height; ++y) { + ScaleRowUp2_Linear(src_u, temp_u, width); +@@ -6658,11 +5995,6 @@ static int I420ToRGB24MatrixBilinear(con + } + } + #endif +-#if defined(HAS_I444TORGB24ROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- I444ToRGB24Row = I444ToRGB24Row_RVV; +- } +-#endif + + #if defined(HAS_SCALEROWUP2_BILINEAR_SSE2) + if (TestCpuFlag(kCpuHasSSE2)) { +@@ -6691,12 +6023,6 @@ static int I420ToRGB24MatrixBilinear(con + ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_NEON; + } + #endif +-#if defined(HAS_SCALEROWUP2_BILINEAR_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- Scale2RowUp_Bilinear = ScaleRowUp2_Bilinear_RVV; +- ScaleRowUp2_Linear = ScaleRowUp2_Linear_RVV; +- } +-#endif + + // alloc 4 lines temp + const int row_size = (width + 31) & ~31; +@@ -6705,8 +6031,6 @@ static int I420ToRGB24MatrixBilinear(con + uint8_t* temp_u_2 = row + row_size; + uint8_t* temp_v_1 = row + row_size * 2; + uint8_t* temp_v_2 = row + row_size * 3; +- if (!row) +- return 1; + + ScaleRowUp2_Linear(src_u, temp_u_1, width); + ScaleRowUp2_Linear(src_v, temp_v_1, width); +@@ -6768,14 +6092,6 @@ static int I010ToAR30MatrixBilinear(cons + dst_ar30 = dst_ar30 + (height - 1) * dst_stride_ar30; + dst_stride_ar30 = -dst_stride_ar30; + } +-#if defined(HAS_I410TOAR30ROW_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- I410ToAR30Row = I410ToAR30Row_Any_NEON; +- if (IS_ALIGNED(width, 8)) { +- I410ToAR30Row = I410ToAR30Row_NEON; +- } +- } +-#endif + #if defined(HAS_I410TOAR30ROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + I410ToAR30Row = I410ToAR30Row_Any_SSSE3; +@@ -6821,8 +6137,6 @@ static int I010ToAR30MatrixBilinear(cons + uint16_t* temp_u_2 = (uint16_t*)(row) + row_size; + uint16_t* temp_v_1 = (uint16_t*)(row) + row_size * 2; + uint16_t* temp_v_2 = (uint16_t*)(row) + row_size * 3; +- if (!row) +- return 1; + + ScaleRowUp2_Linear_12(src_u, temp_u_1, width); + ScaleRowUp2_Linear_12(src_v, temp_v_1, width); +@@ -6882,14 +6196,6 @@ static int I210ToAR30MatrixLinear(const + dst_ar30 = dst_ar30 + (height - 1) * dst_stride_ar30; + dst_stride_ar30 = -dst_stride_ar30; + } +-#if defined(HAS_I410TOAR30ROW_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- I410ToAR30Row = I410ToAR30Row_Any_NEON; +- if (IS_ALIGNED(width, 8)) { +- I410ToAR30Row = I410ToAR30Row_NEON; +- } +- } +-#endif + #if defined(HAS_I410TOAR30ROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + I410ToAR30Row = I410ToAR30Row_Any_SSSE3; +@@ -6928,8 +6234,6 @@ static int I210ToAR30MatrixLinear(const + align_buffer_64(row, row_size * 2 * sizeof(uint16_t)); + uint16_t* temp_u = (uint16_t*)(row); + uint16_t* temp_v = (uint16_t*)(row) + row_size; +- if (!row) +- return 1; + + for (y = 0; y < height; ++y) { + ScaleRowUp2_Linear_12(src_u, temp_u, width); +@@ -6983,14 +6287,6 @@ static int I010ToARGBMatrixBilinear(cons + } + } + #endif +-#if defined(HAS_I410TOARGBROW_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- I410ToARGBRow = I410ToARGBRow_Any_NEON; +- if (IS_ALIGNED(width, 8)) { +- I410ToARGBRow = I410ToARGBRow_NEON; +- } +- } +-#endif + #if defined(HAS_I410TOARGBROW_AVX2) + if (TestCpuFlag(kCpuHasAVX2)) { + I410ToARGBRow = I410ToARGBRow_Any_AVX2; +@@ -7028,8 +6324,6 @@ static int I010ToARGBMatrixBilinear(cons + uint16_t* temp_u_2 = (uint16_t*)(row) + row_size; + uint16_t* temp_v_1 = (uint16_t*)(row) + row_size * 2; + uint16_t* temp_v_2 = (uint16_t*)(row) + row_size * 3; +- if (!row) +- return 1; + + ScaleRowUp2_Linear_12(src_u, temp_u_1, width); + ScaleRowUp2_Linear_12(src_v, temp_v_1, width); +@@ -7096,14 +6390,6 @@ static int I210ToARGBMatrixLinear(const + } + } + #endif +-#if defined(HAS_I410TOARGBROW_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- I410ToARGBRow = I410ToARGBRow_Any_NEON; +- if (IS_ALIGNED(width, 8)) { +- I410ToARGBRow = I410ToARGBRow_NEON; +- } +- } +-#endif + #if defined(HAS_I410TOARGBROW_AVX2) + if (TestCpuFlag(kCpuHasAVX2)) { + I410ToARGBRow = I410ToARGBRow_Any_AVX2; +@@ -7134,8 +6420,6 @@ static int I210ToARGBMatrixLinear(const + align_buffer_64(row, row_size * 2 * sizeof(uint16_t)); + uint16_t* temp_u = (uint16_t*)(row); + uint16_t* temp_v = (uint16_t*)(row) + row_size; +- if (!row) +- return 1; + + for (y = 0; y < height; ++y) { + ScaleRowUp2_Linear_12(src_u, temp_u, width); +@@ -7214,11 +6498,6 @@ static int I420AlphaToARGBMatrixBilinear + } + } + #endif +-#if defined(HAS_I444ALPHATOARGBROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- I444AlphaToARGBRow = I444AlphaToARGBRow_SVE2; +- } +-#endif + #if defined(HAS_I444ALPHATOARGBROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + I444AlphaToARGBRow = I444AlphaToARGBRow_Any_MSA; +@@ -7235,11 +6514,6 @@ static int I420AlphaToARGBMatrixBilinear + } + } + #endif +-#if defined(HAS_I444ALPHATOARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- I444AlphaToARGBRow = I444AlphaToARGBRow_RVV; +- } +-#endif + #if defined(HAS_ARGBATTENUATEROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + ARGBAttenuateRow = ARGBAttenuateRow_Any_SSSE3; +@@ -7272,11 +6546,6 @@ static int I420AlphaToARGBMatrixBilinear + } + } + #endif +-#if defined(HAS_ARGBATTENUATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBAttenuateRow = ARGBAttenuateRow_RVV; +- } +-#endif + + #if defined(HAS_SCALEROWUP2_BILINEAR_SSE2) + if (TestCpuFlag(kCpuHasSSE2)) { +@@ -7305,12 +6574,6 @@ static int I420AlphaToARGBMatrixBilinear + ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_NEON; + } + #endif +-#if defined(HAS_SCALEROWUP2_BILINEAR_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- Scale2RowUp_Bilinear = ScaleRowUp2_Bilinear_RVV; +- ScaleRowUp2_Linear = ScaleRowUp2_Linear_RVV; +- } +-#endif + + // alloc 4 lines temp + const int row_size = (width + 31) & ~31; +@@ -7319,8 +6582,6 @@ static int I420AlphaToARGBMatrixBilinear + uint8_t* temp_u_2 = row + row_size; + uint8_t* temp_v_1 = row + row_size * 2; + uint8_t* temp_v_2 = row + row_size * 3; +- if (!row) +- return 1; + + ScaleRowUp2_Linear(src_u, temp_u_1, width); + ScaleRowUp2_Linear(src_v, temp_v_1, width); +@@ -7429,11 +6690,6 @@ static int I422AlphaToARGBMatrixLinear(c + } + } + #endif +-#if defined(HAS_I444ALPHATOARGBROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- I444AlphaToARGBRow = I444AlphaToARGBRow_SVE2; +- } +-#endif + #if defined(HAS_I444ALPHATOARGBROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + I444AlphaToARGBRow = I444AlphaToARGBRow_Any_MSA; +@@ -7450,11 +6706,6 @@ static int I422AlphaToARGBMatrixLinear(c + } + } + #endif +-#if defined(HAS_I444ALPHATOARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- I444AlphaToARGBRow = I444AlphaToARGBRow_RVV; +- } +-#endif + #if defined(HAS_ARGBATTENUATEROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + ARGBAttenuateRow = ARGBAttenuateRow_Any_SSSE3; +@@ -7487,12 +6738,6 @@ static int I422AlphaToARGBMatrixLinear(c + } + } + #endif +-#if defined(HAS_ARGBATTENUATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBAttenuateRow = ARGBAttenuateRow_RVV; +- } +-#endif +- + #if defined(HAS_SCALEROWUP2_LINEAR_SSE2) + if (TestCpuFlag(kCpuHasSSE2)) { + ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_SSE2; +@@ -7513,19 +6758,12 @@ static int I422AlphaToARGBMatrixLinear(c + ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_NEON; + } + #endif +-#if defined(HAS_SCALEROWUP2_LINEAR_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ScaleRowUp2_Linear = ScaleRowUp2_Linear_RVV; +- } +-#endif + + // alloc 2 lines temp + const int row_size = (width + 31) & ~31; + align_buffer_64(row, row_size * 2); + uint8_t* temp_u = row; + uint8_t* temp_v = row + row_size; +- if (!row) +- return 1; + + for (y = 0; y < height; ++y) { + ScaleRowUp2_Linear(src_u, temp_u, width); +@@ -7585,14 +6823,6 @@ static int I010AlphaToARGBMatrixBilinear + dst_argb = dst_argb + (height - 1) * dst_stride_argb; + dst_stride_argb = -dst_stride_argb; + } +-#if defined(HAS_I410ALPHATOARGBROW_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- I410AlphaToARGBRow = I410AlphaToARGBRow_Any_NEON; +- if (IS_ALIGNED(width, 8)) { +- I410AlphaToARGBRow = I410AlphaToARGBRow_NEON; +- } +- } +-#endif + #if defined(HAS_I410ALPHATOARGBROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + I410AlphaToARGBRow = I410AlphaToARGBRow_Any_SSSE3; +@@ -7641,11 +6871,6 @@ static int I010AlphaToARGBMatrixBilinear + } + } + #endif +-#if defined(HAS_ARGBATTENUATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBAttenuateRow = ARGBAttenuateRow_RVV; +- } +-#endif + + #if defined(HAS_SCALEROWUP2_BILINEAR_12_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { +@@ -7675,8 +6900,6 @@ static int I010AlphaToARGBMatrixBilinear + uint16_t* temp_u_2 = (uint16_t*)(row) + row_size; + uint16_t* temp_v_1 = (uint16_t*)(row) + row_size * 2; + uint16_t* temp_v_2 = (uint16_t*)(row) + row_size * 3; +- if (!row) +- return 1; + + ScaleRowUp2_Linear_12(src_u, temp_u_1, width); + ScaleRowUp2_Linear_12(src_v, temp_v_1, width); +@@ -7761,14 +6984,6 @@ static int I210AlphaToARGBMatrixLinear(c + dst_argb = dst_argb + (height - 1) * dst_stride_argb; + dst_stride_argb = -dst_stride_argb; + } +-#if defined(HAS_I410ALPHATOARGBROW_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- I410AlphaToARGBRow = I410AlphaToARGBRow_Any_NEON; +- if (IS_ALIGNED(width, 8)) { +- I410AlphaToARGBRow = I410AlphaToARGBRow_NEON; +- } +- } +-#endif + #if defined(HAS_I410ALPHATOARGBROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + I410AlphaToARGBRow = I410AlphaToARGBRow_Any_SSSE3; +@@ -7817,11 +7032,6 @@ static int I210AlphaToARGBMatrixLinear(c + } + } + #endif +-#if defined(HAS_ARGBATTENUATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBAttenuateRow = ARGBAttenuateRow_RVV; +- } +-#endif + + #if defined(HAS_SCALEROWUP2_LINEAR_12_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { +@@ -7844,8 +7054,6 @@ static int I210AlphaToARGBMatrixLinear(c + align_buffer_64(row, row_size * 2 * sizeof(uint16_t)); + uint16_t* temp_u = (uint16_t*)(row); + uint16_t* temp_v = (uint16_t*)(row) + row_size; +- if (!row) +- return 1; + + for (y = 0; y < height; ++y) { + ScaleRowUp2_Linear(src_u, temp_u, width); +@@ -7931,8 +7139,6 @@ static int P010ToARGBMatrixBilinear(cons + align_buffer_64(row, row_size * 2 * sizeof(uint16_t)); + uint16_t* temp_uv_1 = (uint16_t*)(row); + uint16_t* temp_uv_2 = (uint16_t*)(row) + row_size; +- if (!row) +- return 1; + + Scale2RowUp_Bilinear_16(src_uv, 0, temp_uv_1, row_size, width); + P410ToARGBRow(src_y, temp_uv_1, dst_argb, yuvconstants, width); +@@ -8022,8 +7228,6 @@ static int P210ToARGBMatrixLinear(const + const int row_size = (2 * width + 31) & ~31; + align_buffer_64(row, row_size * sizeof(uint16_t)); + uint16_t* temp_uv = (uint16_t*)(row); +- if (!row) +- return 1; + + for (y = 0; y < height; ++y) { + ScaleRowUp2_Linear(src_uv, temp_uv, width); +@@ -8103,8 +7307,6 @@ static int P010ToAR30MatrixBilinear(cons + align_buffer_64(row, row_size * 2 * sizeof(uint16_t)); + uint16_t* temp_uv_1 = (uint16_t*)(row); + uint16_t* temp_uv_2 = (uint16_t*)(row) + row_size; +- if (!row) +- return 1; + + Scale2RowUp_Bilinear_16(src_uv, 0, temp_uv_1, row_size, width); + P410ToAR30Row(src_y, temp_uv_1, dst_ar30, yuvconstants, width); +@@ -8194,8 +7396,6 @@ static int P210ToAR30MatrixLinear(const + const int row_size = (2 * width + 31) & ~31; + align_buffer_64(row, row_size * sizeof(uint16_t)); + uint16_t* temp_uv = (uint16_t*)(row); +- if (!row) +- return 1; + + for (y = 0; y < height; ++y) { + ScaleRowUp2_Linear(src_uv, temp_uv, width); +@@ -8261,11 +7461,6 @@ static int I422ToRGB24MatrixLinear(const + } + } + #endif +-#if defined(HAS_I444TORGB24ROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- I444ToRGB24Row = I444ToRGB24Row_RVV; +- } +-#endif + #if defined(HAS_SCALEROWUP2_LINEAR_SSE2) + if (TestCpuFlag(kCpuHasSSE2)) { + ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_SSE2; +@@ -8286,19 +7481,12 @@ static int I422ToRGB24MatrixLinear(const + ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_NEON; + } + #endif +-#if defined(HAS_SCALEROWUP2_LINEAR_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ScaleRowUp2_Linear = ScaleRowUp2_Linear_RVV; +- } +-#endif + + // alloc 2 lines temp + const int row_size = (width + 31) & ~31; + align_buffer_64(row, row_size * 2); + uint8_t* temp_u = row; + uint8_t* temp_v = row + row_size; +- if (!row) +- return 1; + + for (y = 0; y < height; ++y) { + ScaleRowUp2_Linear(src_u, temp_u, width); +diff --git a/media/libyuv/libyuv/source/convert_from.cc b/media/libyuv/libyuv/source/convert_from.cc +--- a/media/libyuv/libyuv/source/convert_from.cc ++++ b/media/libyuv/libyuv/source/convert_from.cc +@@ -52,26 +52,19 @@ static int I420ToI4xx(const uint8_t* src + const int dst_y_height = Abs(src_y_height); + const int src_uv_width = SUBSAMPLE(src_y_width, 1, 1); + const int src_uv_height = SUBSAMPLE(src_y_height, 1, 1); +- int r; + if (src_y_width == 0 || src_y_height == 0 || dst_uv_width <= 0 || + dst_uv_height <= 0) { + return -1; + } + if (dst_y) { +- r = ScalePlane(src_y, src_stride_y, src_y_width, src_y_height, dst_y, +- dst_stride_y, dst_y_width, dst_y_height, kFilterBilinear); +- if (r != 0) { +- return r; +- } ++ ScalePlane(src_y, src_stride_y, src_y_width, src_y_height, dst_y, ++ dst_stride_y, dst_y_width, dst_y_height, kFilterBilinear); + } +- r = ScalePlane(src_u, src_stride_u, src_uv_width, src_uv_height, dst_u, +- dst_stride_u, dst_uv_width, dst_uv_height, kFilterBilinear); +- if (r != 0) { +- return r; +- } +- r = ScalePlane(src_v, src_stride_v, src_uv_width, src_uv_height, dst_v, +- dst_stride_v, dst_uv_width, dst_uv_height, kFilterBilinear); +- return r; ++ ScalePlane(src_u, src_stride_u, src_uv_width, src_uv_height, dst_u, ++ dst_stride_u, dst_uv_width, dst_uv_height, kFilterBilinear); ++ ScalePlane(src_v, src_stride_v, src_uv_width, src_uv_height, dst_v, ++ dst_stride_v, dst_uv_width, dst_uv_height, kFilterBilinear); ++ return 0; + } + + // Convert 8 bit YUV to 10 bit. +@@ -230,28 +223,21 @@ int I010ToI410(const uint16_t* src_y, + int dst_stride_v, + int width, + int height) { +- int r; + if (width == 0 || height == 0) { + return -1; + } + + if (dst_y) { +- r = ScalePlane_12(src_y, src_stride_y, width, height, dst_y, dst_stride_y, +- Abs(width), Abs(height), kFilterBilinear); +- if (r != 0) { +- return r; +- } ++ ScalePlane_12(src_y, src_stride_y, width, height, dst_y, dst_stride_y, ++ Abs(width), Abs(height), kFilterBilinear); + } +- r = ScalePlane_12(src_u, src_stride_u, SUBSAMPLE(width, 1, 1), +- SUBSAMPLE(height, 1, 1), dst_u, dst_stride_u, Abs(width), +- Abs(height), kFilterBilinear); +- if (r != 0) { +- return r; +- } +- r = ScalePlane_12(src_v, src_stride_v, SUBSAMPLE(width, 1, 1), +- SUBSAMPLE(height, 1, 1), dst_v, dst_stride_v, Abs(width), +- Abs(height), kFilterBilinear); +- return r; ++ ScalePlane_12(src_u, src_stride_u, SUBSAMPLE(width, 1, 1), ++ SUBSAMPLE(height, 1, 1), dst_u, dst_stride_u, Abs(width), ++ Abs(height), kFilterBilinear); ++ ScalePlane_12(src_v, src_stride_v, SUBSAMPLE(width, 1, 1), ++ SUBSAMPLE(height, 1, 1), dst_v, dst_stride_v, Abs(width), ++ Abs(height), kFilterBilinear); ++ return 0; + } + + // 422 chroma to 444 chroma, 10/12 bit version +@@ -270,26 +256,19 @@ int I210ToI410(const uint16_t* src_y, + int dst_stride_v, + int width, + int height) { +- int r; + if (width == 0 || height == 0) { + return -1; + } + + if (dst_y) { +- r = ScalePlane_12(src_y, src_stride_y, width, height, dst_y, dst_stride_y, +- Abs(width), Abs(height), kFilterBilinear); +- if (r != 0) { +- return r; +- } ++ ScalePlane_12(src_y, src_stride_y, width, height, dst_y, dst_stride_y, ++ Abs(width), Abs(height), kFilterBilinear); + } +- r = ScalePlane_12(src_u, src_stride_u, SUBSAMPLE(width, 1, 1), height, dst_u, +- dst_stride_u, Abs(width), Abs(height), kFilterBilinear); +- if (r != 0) { +- return r; +- } +- r = ScalePlane_12(src_v, src_stride_v, SUBSAMPLE(width, 1, 1), height, dst_v, +- dst_stride_v, Abs(width), Abs(height), kFilterBilinear); +- return r; ++ ScalePlane_12(src_u, src_stride_u, SUBSAMPLE(width, 1, 1), height, dst_u, ++ dst_stride_u, Abs(width), Abs(height), kFilterBilinear); ++ ScalePlane_12(src_v, src_stride_v, SUBSAMPLE(width, 1, 1), height, dst_v, ++ dst_stride_v, Abs(width), Abs(height), kFilterBilinear); ++ return 0; + } + + // 422 chroma is 1/2 width, 1x height +@@ -309,26 +288,19 @@ int I422ToI444(const uint8_t* src_y, + int dst_stride_v, + int width, + int height) { +- int r; + if (width == 0 || height == 0) { + return -1; + } + + if (dst_y) { +- r = ScalePlane(src_y, src_stride_y, width, height, dst_y, dst_stride_y, +- Abs(width), Abs(height), kFilterBilinear); +- if (r != 0) { +- return r; +- } ++ ScalePlane(src_y, src_stride_y, width, height, dst_y, dst_stride_y, ++ Abs(width), Abs(height), kFilterBilinear); + } +- r = ScalePlane(src_u, src_stride_u, SUBSAMPLE(width, 1, 1), height, dst_u, +- dst_stride_u, Abs(width), Abs(height), kFilterBilinear); +- if (r != 0) { +- return r; +- } +- r = ScalePlane(src_v, src_stride_v, SUBSAMPLE(width, 1, 1), height, dst_v, +- dst_stride_v, Abs(width), Abs(height), kFilterBilinear); +- return r; ++ ScalePlane(src_u, src_stride_u, SUBSAMPLE(width, 1, 1), height, dst_u, ++ dst_stride_u, Abs(width), Abs(height), kFilterBilinear); ++ ScalePlane(src_v, src_stride_v, SUBSAMPLE(width, 1, 1), height, dst_v, ++ dst_stride_v, Abs(width), Abs(height), kFilterBilinear); ++ return 0; + } + + // Copy to I400. Source can be I420,422,444,400,NV12,NV21 +@@ -474,14 +446,6 @@ int I420ToYUY2(const uint8_t* src_y, + } + } + #endif +-#if defined(HAS_I422TOYUY2ROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- I422ToYUY2Row = I422ToYUY2Row_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- I422ToYUY2Row = I422ToYUY2Row_LSX; +- } +- } +-#endif + #if defined(HAS_I422TOYUY2ROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + I422ToYUY2Row = I422ToYUY2Row_Any_LASX; +@@ -569,14 +533,6 @@ int I422ToUYVY(const uint8_t* src_y, + } + } + #endif +-#if defined(HAS_I422TOUYVYROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- I422ToUYVYRow = I422ToUYVYRow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- I422ToUYVYRow = I422ToUYVYRow_LSX; +- } +- } +-#endif + #if defined(HAS_I422TOUYVYROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + I422ToUYVYRow = I422ToUYVYRow_Any_LASX; +@@ -652,14 +608,6 @@ int I420ToUYVY(const uint8_t* src_y, + } + } + #endif +-#if defined(HAS_I422TOUYVYROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- I422ToUYVYRow = I422ToUYVYRow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- I422ToUYVYRow = I422ToUYVYRow_LSX; +- } +- } +-#endif + #if defined(HAS_I422TOUYVYROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + I422ToUYVYRow = I422ToUYVYRow_Any_LASX; +diff --git a/media/libyuv/libyuv/source/convert_from_argb.cc b/media/libyuv/libyuv/source/convert_from_argb.cc +--- a/media/libyuv/libyuv/source/convert_from_argb.cc ++++ b/media/libyuv/libyuv/source/convert_from_argb.cc +@@ -76,14 +76,6 @@ int ARGBToI444(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOUV444ROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBToUV444Row = ARGBToUV444Row_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- ARGBToUV444Row = ARGBToUV444Row_LSX; +- } +- } +-#endif + #if defined(HAS_ARGBTOUV444ROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + ARGBToUV444Row = ARGBToUV444Row_Any_LASX; +@@ -116,14 +108,6 @@ int ARGBToI444(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYROW_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- ARGBToYRow = ARGBToYRow_Any_NEON_DotProd; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYRow = ARGBToYRow_NEON_DotProd; +- } +- } +-#endif + #if defined(HAS_ARGBTOYROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + ARGBToYRow = ARGBToYRow_Any_MSA; +@@ -148,11 +132,6 @@ int ARGBToI444(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBToYRow = ARGBToYRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + ARGBToUV444Row(src_argb, dst_u, dst_v, width); +@@ -239,14 +218,6 @@ int ARGBToI422(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYROW_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- ARGBToYRow = ARGBToYRow_Any_NEON_DotProd; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYRow = ARGBToYRow_NEON_DotProd; +- } +- } +-#endif + #if defined(HAS_ARGBTOUVROW_NEON) + if (TestCpuFlag(kCpuHasNEON)) { + ARGBToUVRow = ARGBToUVRow_Any_NEON; +@@ -255,14 +226,6 @@ int ARGBToI422(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOUVROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- ARGBToUVRow = ARGBToUVRow_Any_SVE2; +- if (IS_ALIGNED(width, 2)) { +- ARGBToUVRow = ARGBToUVRow_SVE2; +- } +- } +-#endif + #if defined(HAS_ARGBTOYROW_MSA) && defined(HAS_ARGBTOUVROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + ARGBToYRow = ARGBToYRow_Any_MSA; +@@ -283,16 +246,6 @@ int ARGBToI422(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYROW_LSX) && defined(HAS_ARGBTOUVROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBToYRow = ARGBToYRow_Any_LSX; +- ARGBToUVRow = ARGBToUVRow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYRow = ARGBToYRow_LSX; +- ARGBToUVRow = ARGBToUVRow_LSX; +- } +- } +-#endif + #if defined(HAS_ARGBTOYROW_LASX) && defined(HAS_ARGBTOUVROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + ARGBToYRow = ARGBToYRow_Any_LASX; +@@ -303,11 +256,6 @@ int ARGBToI422(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBToYRow = ARGBToYRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + ARGBToUVRow(src_argb, 0, dst_u, dst_v, width); +@@ -355,14 +303,6 @@ int ARGBToNV12(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYROW_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- ARGBToYRow = ARGBToYRow_Any_NEON_DotProd; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYRow = ARGBToYRow_NEON_DotProd; +- } +- } +-#endif + #if defined(HAS_ARGBTOUVROW_NEON) + if (TestCpuFlag(kCpuHasNEON)) { + ARGBToUVRow = ARGBToUVRow_Any_NEON; +@@ -371,14 +311,6 @@ int ARGBToNV12(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOUVROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- ARGBToUVRow = ARGBToUVRow_Any_SVE2; +- if (IS_ALIGNED(width, 2)) { +- ARGBToUVRow = ARGBToUVRow_SVE2; +- } +- } +-#endif + #if defined(HAS_ARGBTOYROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + ARGBToYRow = ARGBToYRow_Any_SSSE3; +@@ -441,11 +373,6 @@ int ARGBToNV12(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBToYRow = ARGBToYRow_RVV; +- } +-#endif + #if defined(HAS_MERGEUVROW_SSE2) + if (TestCpuFlag(kCpuHasSSE2)) { + MergeUVRow_ = MergeUVRow_Any_SSE2; +@@ -457,7 +384,7 @@ int ARGBToNV12(const uint8_t* src_argb, + #if defined(HAS_MERGEUVROW_AVX2) + if (TestCpuFlag(kCpuHasAVX2)) { + MergeUVRow_ = MergeUVRow_Any_AVX2; +- if (IS_ALIGNED(halfwidth, 16)) { ++ if (IS_ALIGNED(halfwidth, 32)) { + MergeUVRow_ = MergeUVRow_AVX2; + } + } +@@ -494,17 +421,10 @@ int ARGBToNV12(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_MERGEUVROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- MergeUVRow_ = MergeUVRow_RVV; +- } +-#endif + { + // Allocate a rows of uv. + align_buffer_64(row_u, ((halfwidth + 31) & ~31) * 2); + uint8_t* row_v = row_u + ((halfwidth + 31) & ~31); +- if (!row_u) +- return 1; + + for (y = 0; y < height - 1; y += 2) { + ARGBToUVRow(src_argb, src_stride_argb, row_u, row_v, width); +@@ -593,14 +513,6 @@ int ARGBToNV21(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYROW_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- ARGBToYRow = ARGBToYRow_Any_NEON_DotProd; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYRow = ARGBToYRow_NEON_DotProd; +- } +- } +-#endif + #if defined(HAS_ARGBTOUVROW_NEON) + if (TestCpuFlag(kCpuHasNEON)) { + ARGBToUVRow = ARGBToUVRow_Any_NEON; +@@ -609,14 +521,6 @@ int ARGBToNV21(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOUVROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- ARGBToUVRow = ARGBToUVRow_Any_SVE2; +- if (IS_ALIGNED(width, 2)) { +- ARGBToUVRow = ARGBToUVRow_SVE2; +- } +- } +-#endif + #if defined(HAS_ARGBTOYROW_MSA) && defined(HAS_ARGBTOUVROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + ARGBToYRow = ARGBToYRow_Any_MSA; +@@ -637,16 +541,6 @@ int ARGBToNV21(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYROW_LSX) && defined(HAS_ARGBTOUVROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBToYRow = ARGBToYRow_Any_LSX; +- ARGBToUVRow = ARGBToUVRow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYRow = ARGBToYRow_LSX; +- ARGBToUVRow = ARGBToUVRow_LSX; +- } +- } +-#endif + #if defined(HAS_ARGBTOYROW_LASX) && defined(HAS_ARGBTOUVROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + ARGBToYRow = ARGBToYRow_Any_LASX; +@@ -657,11 +551,6 @@ int ARGBToNV21(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBToYRow = ARGBToYRow_RVV; +- } +-#endif + #if defined(HAS_MERGEUVROW_SSE2) + if (TestCpuFlag(kCpuHasSSE2)) { + MergeUVRow_ = MergeUVRow_Any_SSE2; +@@ -673,7 +562,7 @@ int ARGBToNV21(const uint8_t* src_argb, + #if defined(HAS_MERGEUVROW_AVX2) + if (TestCpuFlag(kCpuHasAVX2)) { + MergeUVRow_ = MergeUVRow_Any_AVX2; +- if (IS_ALIGNED(halfwidth, 16)) { ++ if (IS_ALIGNED(halfwidth, 32)) { + MergeUVRow_ = MergeUVRow_AVX2; + } + } +@@ -710,17 +599,10 @@ int ARGBToNV21(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_MERGEUVROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- MergeUVRow_ = MergeUVRow_RVV; +- } +-#endif + { + // Allocate a rows of uv. + align_buffer_64(row_u, ((halfwidth + 31) & ~31) * 2); + uint8_t* row_v = row_u + ((halfwidth + 31) & ~31); +- if (!row_u) +- return 1; + + for (y = 0; y < height - 1; y += 2) { + ARGBToUVRow(src_argb, src_stride_argb, row_u, row_v, width); +@@ -808,14 +690,6 @@ int ABGRToNV12(const uint8_t* src_abgr, + } + } + #endif +-#if defined(HAS_ABGRTOYROW_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- ABGRToYRow = ABGRToYRow_Any_NEON_DotProd; +- if (IS_ALIGNED(width, 16)) { +- ABGRToYRow = ABGRToYRow_NEON_DotProd; +- } +- } +-#endif + #if defined(HAS_ABGRTOUVROW_NEON) + if (TestCpuFlag(kCpuHasNEON)) { + ABGRToUVRow = ABGRToUVRow_Any_NEON; +@@ -824,14 +698,6 @@ int ABGRToNV12(const uint8_t* src_abgr, + } + } + #endif +-#if defined(HAS_ABGRTOUVROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- ABGRToUVRow = ABGRToUVRow_Any_SVE2; +- if (IS_ALIGNED(width, 2)) { +- ABGRToUVRow = ABGRToUVRow_SVE2; +- } +- } +-#endif + #if defined(HAS_ABGRTOYROW_MSA) && defined(HAS_ABGRTOUVROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + ABGRToYRow = ABGRToYRow_Any_MSA; +@@ -860,11 +726,6 @@ int ABGRToNV12(const uint8_t* src_abgr, + } + } + #endif +-#if defined(HAS_ABGRTOYROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ABGRToYRow = ABGRToYRow_RVV; +- } +-#endif + #if defined(HAS_MERGEUVROW_SSE2) + if (TestCpuFlag(kCpuHasSSE2)) { + MergeUVRow_ = MergeUVRow_Any_SSE2; +@@ -876,7 +737,7 @@ int ABGRToNV12(const uint8_t* src_abgr, + #if defined(HAS_MERGEUVROW_AVX2) + if (TestCpuFlag(kCpuHasAVX2)) { + MergeUVRow_ = MergeUVRow_Any_AVX2; +- if (IS_ALIGNED(halfwidth, 16)) { ++ if (IS_ALIGNED(halfwidth, 32)) { + MergeUVRow_ = MergeUVRow_AVX2; + } + } +@@ -913,17 +774,10 @@ int ABGRToNV12(const uint8_t* src_abgr, + } + } + #endif +-#if defined(HAS_MERGEUVROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- MergeUVRow_ = MergeUVRow_RVV; +- } +-#endif + { + // Allocate a rows of uv. + align_buffer_64(row_u, ((halfwidth + 31) & ~31) * 2); + uint8_t* row_v = row_u + ((halfwidth + 31) & ~31); +- if (!row_u) +- return 1; + + for (y = 0; y < height - 1; y += 2) { + ABGRToUVRow(src_abgr, src_stride_abgr, row_u, row_v, width); +@@ -1012,14 +866,6 @@ int ABGRToNV21(const uint8_t* src_abgr, + } + } + #endif +-#if defined(HAS_ABGRTOYROW_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- ABGRToYRow = ABGRToYRow_Any_NEON_DotProd; +- if (IS_ALIGNED(width, 16)) { +- ABGRToYRow = ABGRToYRow_NEON_DotProd; +- } +- } +-#endif + #if defined(HAS_ABGRTOUVROW_NEON) + if (TestCpuFlag(kCpuHasNEON)) { + ABGRToUVRow = ABGRToUVRow_Any_NEON; +@@ -1028,14 +874,6 @@ int ABGRToNV21(const uint8_t* src_abgr, + } + } + #endif +-#if defined(HAS_ABGRTOUVROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- ABGRToUVRow = ABGRToUVRow_Any_SVE2; +- if (IS_ALIGNED(width, 2)) { +- ABGRToUVRow = ABGRToUVRow_SVE2; +- } +- } +-#endif + #if defined(HAS_ABGRTOYROW_MSA) && defined(HAS_ABGRTOUVROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + ABGRToYRow = ABGRToYRow_Any_MSA; +@@ -1064,11 +902,6 @@ int ABGRToNV21(const uint8_t* src_abgr, + } + } + #endif +-#if defined(HAS_ABGRTOYROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ABGRToYRow = ABGRToYRow_RVV; +- } +-#endif + #if defined(HAS_MERGEUVROW_SSE2) + if (TestCpuFlag(kCpuHasSSE2)) { + MergeUVRow_ = MergeUVRow_Any_SSE2; +@@ -1080,7 +913,7 @@ int ABGRToNV21(const uint8_t* src_abgr, + #if defined(HAS_MERGEUVROW_AVX2) + if (TestCpuFlag(kCpuHasAVX2)) { + MergeUVRow_ = MergeUVRow_Any_AVX2; +- if (IS_ALIGNED(halfwidth, 16)) { ++ if (IS_ALIGNED(halfwidth, 32)) { + MergeUVRow_ = MergeUVRow_AVX2; + } + } +@@ -1117,17 +950,10 @@ int ABGRToNV21(const uint8_t* src_abgr, + } + } + #endif +-#if defined(HAS_MERGEUVROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- MergeUVRow_ = MergeUVRow_RVV; +- } +-#endif + { + // Allocate a rows of uv. + align_buffer_64(row_u, ((halfwidth + 31) & ~31) * 2); + uint8_t* row_v = row_u + ((halfwidth + 31) & ~31); +- if (!row_u) +- return 1; + + for (y = 0; y < height - 1; y += 2) { + ABGRToUVRow(src_abgr, src_stride_abgr, row_u, row_v, width); +@@ -1221,14 +1047,6 @@ int ARGBToYUY2(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYROW_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- ARGBToYRow = ARGBToYRow_Any_NEON_DotProd; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYRow = ARGBToYRow_NEON_DotProd; +- } +- } +-#endif + #if defined(HAS_ARGBTOUVROW_NEON) + if (TestCpuFlag(kCpuHasNEON)) { + ARGBToUVRow = ARGBToUVRow_Any_NEON; +@@ -1237,14 +1055,6 @@ int ARGBToYUY2(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOUVROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- ARGBToUVRow = ARGBToUVRow_Any_SVE2; +- if (IS_ALIGNED(width, 2)) { +- ARGBToUVRow = ARGBToUVRow_SVE2; +- } +- } +-#endif + #if defined(HAS_ARGBTOYROW_MSA) && defined(HAS_ARGBTOUVROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + ARGBToYRow = ARGBToYRow_Any_MSA; +@@ -1265,16 +1075,6 @@ int ARGBToYUY2(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYROW_LSX) && defined(HAS_ARGBTOUVROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBToYRow = ARGBToYRow_Any_LSX; +- ARGBToUVRow = ARGBToUVRow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYRow = ARGBToYRow_LSX; +- ARGBToUVRow = ARGBToUVRow_LSX; +- } +- } +-#endif + #if defined(HAS_ARGBTOYROW_LASX) && defined(HAS_ARGBTOUVROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + ARGBToYRow = ARGBToYRow_Any_LASX; +@@ -1285,11 +1085,6 @@ int ARGBToYUY2(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBToYRow = ARGBToYRow_RVV; +- } +-#endif + #if defined(HAS_I422TOYUY2ROW_SSE2) + if (TestCpuFlag(kCpuHasSSE2)) { + I422ToYUY2Row = I422ToYUY2Row_Any_SSE2; +@@ -1322,14 +1117,6 @@ int ARGBToYUY2(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_I422TOYUY2ROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- I422ToYUY2Row = I422ToYUY2Row_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- I422ToYUY2Row = I422ToYUY2Row_LSX; +- } +- } +-#endif + #if defined(HAS_I422TOYUY2ROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + I422ToYUY2Row = I422ToYUY2Row_Any_LASX; +@@ -1344,8 +1131,6 @@ int ARGBToYUY2(const uint8_t* src_argb, + align_buffer_64(row_y, ((width + 63) & ~63) * 2); + uint8_t* row_u = row_y + ((width + 63) & ~63); + uint8_t* row_v = row_u + ((width + 63) & ~63) / 2; +- if (!row_y) +- return 1; + + for (y = 0; y < height; ++y) { + ARGBToUVRow(src_argb, 0, row_u, row_v, width); +@@ -1433,14 +1218,6 @@ int ARGBToUYVY(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYROW_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- ARGBToYRow = ARGBToYRow_Any_NEON_DotProd; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYRow = ARGBToYRow_NEON_DotProd; +- } +- } +-#endif + #if defined(HAS_ARGBTOUVROW_NEON) + if (TestCpuFlag(kCpuHasNEON)) { + ARGBToUVRow = ARGBToUVRow_Any_NEON; +@@ -1449,14 +1226,6 @@ int ARGBToUYVY(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOUVROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- ARGBToUVRow = ARGBToUVRow_Any_SVE2; +- if (IS_ALIGNED(width, 2)) { +- ARGBToUVRow = ARGBToUVRow_SVE2; +- } +- } +-#endif + #if defined(HAS_ARGBTOYROW_MSA) && defined(HAS_ARGBTOUVROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + ARGBToYRow = ARGBToYRow_Any_MSA; +@@ -1477,16 +1246,6 @@ int ARGBToUYVY(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYROW_LSX) && defined(HAS_ARGBTOUVROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBToYRow = ARGBToYRow_Any_LSX; +- ARGBToUVRow = ARGBToUVRow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYRow = ARGBToYRow_LSX; +- ARGBToUVRow = ARGBToUVRow_LSX; +- } +- } +-#endif + #if defined(HAS_ARGBTOYROW_LASX) && defined(HAS_ARGBTOUVROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + ARGBToYRow = ARGBToYRow_Any_LASX; +@@ -1497,11 +1256,6 @@ int ARGBToUYVY(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBToYRow = ARGBToYRow_RVV; +- } +-#endif + #if defined(HAS_I422TOUYVYROW_SSE2) + if (TestCpuFlag(kCpuHasSSE2)) { + I422ToUYVYRow = I422ToUYVYRow_Any_SSE2; +@@ -1534,14 +1288,6 @@ int ARGBToUYVY(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_I422TOUYVYROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- I422ToUYVYRow = I422ToUYVYRow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- I422ToUYVYRow = I422ToUYVYRow_LSX; +- } +- } +-#endif + #if defined(HAS_I422TOUYVYROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + I422ToUYVYRow = I422ToUYVYRow_Any_LASX; +@@ -1556,8 +1302,6 @@ int ARGBToUYVY(const uint8_t* src_argb, + align_buffer_64(row_y, ((width + 63) & ~63) * 2); + uint8_t* row_u = row_y + ((width + 63) & ~63); + uint8_t* row_v = row_u + ((width + 63) & ~63) / 2; +- if (!row_y) +- return 1; + + for (y = 0; y < height; ++y) { + ARGBToUVRow(src_argb, 0, row_u, row_v, width); +@@ -1621,14 +1365,6 @@ int ARGBToI400(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYROW_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- ARGBToYRow = ARGBToYRow_Any_NEON_DotProd; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYRow = ARGBToYRow_NEON_DotProd; +- } +- } +-#endif + #if defined(HAS_ARGBTOYROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + ARGBToYRow = ARGBToYRow_Any_MSA; +@@ -1653,11 +1389,6 @@ int ARGBToI400(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBToYRow = ARGBToYRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + ARGBToYRow(src_argb, dst_y, width); +@@ -1667,7 +1398,6 @@ int ARGBToI400(const uint8_t* src_argb, + return 0; + } + +-#ifndef __riscv + // Shuffle table for converting ARGB to RGBA. + static const uvec8 kShuffleMaskARGBToRGBA = { + 3u, 0u, 1u, 2u, 7u, 4u, 5u, 6u, 11u, 8u, 9u, 10u, 15u, 12u, 13u, 14u}; +@@ -1683,47 +1413,6 @@ int ARGBToRGBA(const uint8_t* src_argb, + return ARGBShuffle(src_argb, src_stride_argb, dst_rgba, dst_stride_rgba, + (const uint8_t*)(&kShuffleMaskARGBToRGBA), width, height); + } +-#else +-// Convert ARGB to RGBA. +-LIBYUV_API +-int ARGBToRGBA(const uint8_t* src_argb, +- int src_stride_argb, +- uint8_t* dst_rgba, +- int dst_stride_rgba, +- int width, +- int height) { +- int y; +- void (*ARGBToRGBARow)(const uint8_t* src_argb, uint8_t* dst_rgba, int width) = +- ARGBToRGBARow_C; +- if (!src_argb || !dst_rgba || width <= 0 || height == 0) { +- return -1; +- } +- if (height < 0) { +- height = -height; +- src_argb = src_argb + (height - 1) * src_stride_argb; +- src_stride_argb = -src_stride_argb; +- } +- // Coalesce rows. +- if (src_stride_argb == width * 4 && dst_stride_rgba == width * 4) { +- width *= height; +- height = 1; +- src_stride_argb = dst_stride_rgba = 0; +- } +- +-#if defined(HAS_ARGBTORGBAROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBToRGBARow = ARGBToRGBARow_RVV; +- } +-#endif +- +- for (y = 0; y < height; ++y) { +- ARGBToRGBARow(src_argb, dst_rgba, width); +- src_argb += src_stride_argb; +- dst_rgba += dst_stride_rgba; +- } +- return 0; +-} +-#endif + + // Convert ARGB To RGB24. + LIBYUV_API +@@ -1790,14 +1479,6 @@ int ARGBToRGB24(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTORGB24ROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBToRGB24Row = ARGBToRGB24Row_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- ARGBToRGB24Row = ARGBToRGB24Row_LSX; +- } +- } +-#endif + #if defined(HAS_ARGBTORGB24ROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + ARGBToRGB24Row = ARGBToRGB24Row_Any_LASX; +@@ -1806,11 +1487,6 @@ int ARGBToRGB24(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTORGB24ROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBToRGB24Row = ARGBToRGB24Row_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + ARGBToRGB24Row(src_argb, dst_rgb24, width); +@@ -1877,14 +1553,6 @@ int ARGBToRAW(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTORAWROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBToRAWRow = ARGBToRAWRow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- ARGBToRAWRow = ARGBToRAWRow_LSX; +- } +- } +-#endif + #if defined(HAS_ARGBTORAWROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + ARGBToRAWRow = ARGBToRAWRow_Any_LASX; +@@ -1893,11 +1561,6 @@ int ARGBToRAW(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTORAWROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBToRAWRow = ARGBToRAWRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + ARGBToRAWRow(src_argb, dst_raw, width); +@@ -1923,7 +1586,7 @@ int ARGBToRGB565Dither(const uint8_t* sr + int height) { + int y; + void (*ARGBToRGB565DitherRow)(const uint8_t* src_argb, uint8_t* dst_rgb, +- uint32_t dither4, int width) = ++ const uint32_t dither4, int width) = + ARGBToRGB565DitherRow_C; + if (!src_argb || !dst_rgb565 || width <= 0 || height == 0) { + return -1; +@@ -1960,11 +1623,6 @@ int ARGBToRGB565Dither(const uint8_t* sr + } + } + #endif +-#if defined(HAS_ARGBTORGB565DITHERROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_SVE2; +- } +-#endif + #if defined(HAS_ARGBTORGB565DITHERROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_Any_MSA; +@@ -1973,14 +1631,6 @@ int ARGBToRGB565Dither(const uint8_t* sr + } + } + #endif +-#if defined(HAS_ARGBTORGB565DITHERROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_Any_LSX; +- if (IS_ALIGNED(width, 8)) { +- ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_LSX; +- } +- } +-#endif + #if defined(HAS_ARGBTORGB565DITHERROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_Any_LASX; +@@ -2050,11 +1700,6 @@ int ARGBToRGB565(const uint8_t* src_argb + } + } + #endif +-#if defined(HAS_ARGBTORGB565ROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- ARGBToRGB565Row = ARGBToRGB565Row_SVE2; +- } +-#endif + #if defined(HAS_ARGBTORGB565ROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + ARGBToRGB565Row = ARGBToRGB565Row_Any_MSA; +@@ -2063,15 +1708,6 @@ int ARGBToRGB565(const uint8_t* src_argb + } + } + #endif +-#if defined(HAS_ARGBTORGB565ROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBToRGB565Row = ARGBToRGB565Row_Any_LSX; +- if (IS_ALIGNED(width, 8)) { +- ARGBToRGB565Row = ARGBToRGB565Row_LSX; +- } +- } +-#endif +- + #if defined(HAS_ARGBTORGB565ROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + ARGBToRGB565Row = ARGBToRGB565Row_Any_LASX; +@@ -2146,14 +1782,6 @@ int ARGBToARGB1555(const uint8_t* src_ar + } + } + #endif +-#if defined(HAS_ARGBTOARGB1555ROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBToARGB1555Row = ARGBToARGB1555Row_Any_LSX; +- if (IS_ALIGNED(width, 8)) { +- ARGBToARGB1555Row = ARGBToARGB1555Row_LSX; +- } +- } +-#endif + #if defined(HAS_ARGBTOARGB1555ROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + ARGBToARGB1555Row = ARGBToARGB1555Row_Any_LASX; +@@ -2228,14 +1856,6 @@ int ARGBToARGB4444(const uint8_t* src_ar + } + } + #endif +-#if defined(HAS_ARGBTOARGB4444ROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBToARGB4444Row = ARGBToARGB4444Row_Any_LSX; +- if (IS_ALIGNED(width, 8)) { +- ARGBToARGB4444Row = ARGBToARGB4444Row_LSX; +- } +- } +-#endif + #if defined(HAS_ARGBTOARGB4444ROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + ARGBToARGB4444Row = ARGBToARGB4444Row_Any_LASX; +@@ -2278,14 +1898,6 @@ int ABGRToAR30(const uint8_t* src_abgr, + height = 1; + src_stride_abgr = dst_stride_ar30 = 0; + } +-#if defined(HAS_ABGRTOAR30ROW_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- ABGRToAR30Row = ABGRToAR30Row_Any_NEON; +- if (IS_ALIGNED(width, 8)) { +- ABGRToAR30Row = ABGRToAR30Row_NEON; +- } +- } +-#endif + #if defined(HAS_ABGRTOAR30ROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + ABGRToAR30Row = ABGRToAR30Row_Any_SSSE3; +@@ -2335,14 +1947,6 @@ int ARGBToAR30(const uint8_t* src_argb, + height = 1; + src_stride_argb = dst_stride_ar30 = 0; + } +-#if defined(HAS_ARGBTOAR30ROW_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- ARGBToAR30Row = ARGBToAR30Row_Any_NEON; +- if (IS_ALIGNED(width, 8)) { +- ARGBToAR30Row = ARGBToAR30Row_NEON; +- } +- } +-#endif + #if defined(HAS_ARGBTOAR30ROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + ARGBToAR30Row = ARGBToAR30Row_Any_SSSE3; +@@ -2402,14 +2006,6 @@ int ARGBToJ420(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYJROW_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- ARGBToYJRow = ARGBToYJRow_Any_NEON_DotProd; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYJRow = ARGBToYJRow_NEON_DotProd; +- } +- } +-#endif + #if defined(HAS_ARGBTOUVJROW_NEON) + if (TestCpuFlag(kCpuHasNEON)) { + ARGBToUVJRow = ARGBToUVJRow_Any_NEON; +@@ -2418,14 +2014,6 @@ int ARGBToJ420(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOUVJROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- ARGBToUVJRow = ARGBToUVJRow_Any_SVE2; +- if (IS_ALIGNED(width, 2)) { +- ARGBToUVJRow = ARGBToUVJRow_SVE2; +- } +- } +-#endif + #if defined(HAS_ARGBTOYJROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + ARGBToYJRow = ARGBToYJRow_Any_SSSE3; +@@ -2490,11 +2078,6 @@ int ARGBToJ420(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYJROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBToYJRow = ARGBToYJRow_RVV; +- } +-#endif + + for (y = 0; y < height - 1; y += 2) { + ARGBToUVJRow(src_argb, src_stride_argb, dst_uj, dst_vj, width); +@@ -2586,14 +2169,6 @@ int ARGBToJ422(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYJROW_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- ARGBToYJRow = ARGBToYJRow_Any_NEON_DotProd; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYJRow = ARGBToYJRow_NEON_DotProd; +- } +- } +-#endif + #if defined(HAS_ARGBTOUVJROW_NEON) + if (TestCpuFlag(kCpuHasNEON)) { + ARGBToUVJRow = ARGBToUVJRow_Any_NEON; +@@ -2602,14 +2177,6 @@ int ARGBToJ422(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOUVJROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- ARGBToUVJRow = ARGBToUVJRow_Any_SVE2; +- if (IS_ALIGNED(width, 2)) { +- ARGBToUVJRow = ARGBToUVJRow_SVE2; +- } +- } +-#endif + #if defined(HAS_ARGBTOYJROW_MSA) && defined(HAS_ARGBTOUVJROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + ARGBToYJRow = ARGBToYJRow_Any_MSA; +@@ -2642,11 +2209,6 @@ int ARGBToJ422(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYJROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBToYJRow = ARGBToYJRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + ARGBToUVJRow(src_argb, 0, dst_uj, dst_vj, width); +@@ -2708,14 +2270,6 @@ int ARGBToJ400(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYJROW_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- ARGBToYJRow = ARGBToYJRow_Any_NEON_DotProd; +- if (IS_ALIGNED(width, 16)) { +- ARGBToYJRow = ARGBToYJRow_NEON_DotProd; +- } +- } +-#endif + #if defined(HAS_ARGBTOYJROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + ARGBToYJRow = ARGBToYJRow_Any_MSA; +@@ -2724,11 +2278,6 @@ int ARGBToJ400(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOYJROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBToYJRow = ARGBToYJRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + ARGBToYJRow(src_argb, dst_yj, width); +@@ -2787,14 +2336,6 @@ int RGBAToJ400(const uint8_t* src_rgba, + } + } + #endif +-#if defined(HAS_RGBATOYJROW_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- RGBAToYJRow = RGBAToYJRow_Any_NEON_DotProd; +- if (IS_ALIGNED(width, 16)) { +- RGBAToYJRow = RGBAToYJRow_NEON_DotProd; +- } +- } +-#endif + #if defined(HAS_RGBATOYJROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + RGBAToYJRow = RGBAToYJRow_Any_MSA; +@@ -2819,11 +2360,6 @@ int RGBAToJ400(const uint8_t* src_rgba, + } + } + #endif +-#if defined(HAS_RGBATOYJROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- RGBAToYJRow = RGBAToYJRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + RGBAToYJRow(src_rgba, dst_yj, width); +@@ -2900,14 +2436,6 @@ int ABGRToJ420(const uint8_t* src_abgr, + } + } + #endif +-#if defined(HAS_ABGRTOYJROW_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- ABGRToYJRow = ABGRToYJRow_Any_NEON_DotProd; +- if (IS_ALIGNED(width, 16)) { +- ABGRToYJRow = ABGRToYJRow_NEON_DotProd; +- } +- } +-#endif + #if defined(HAS_ABGRTOUVJROW_NEON) + if (TestCpuFlag(kCpuHasNEON)) { + ABGRToUVJRow = ABGRToUVJRow_Any_NEON; +@@ -2916,14 +2444,6 @@ int ABGRToJ420(const uint8_t* src_abgr, + } + } + #endif +-#if defined(HAS_ABGRTOUVJROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- ABGRToUVJRow = ABGRToUVJRow_Any_SVE2; +- if (IS_ALIGNED(width, 2)) { +- ABGRToUVJRow = ABGRToUVJRow_SVE2; +- } +- } +-#endif + #if defined(HAS_ABGRTOYJROW_MSA) && defined(HAS_ABGRTOUVJROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + ABGRToYJRow = ABGRToYJRow_Any_MSA; +@@ -2950,11 +2470,6 @@ int ABGRToJ420(const uint8_t* src_abgr, + } + } + #endif +-#if defined(HAS_ABGRTOYJROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ABGRToYJRow = ABGRToYJRow_RVV; +- } +-#endif + + for (y = 0; y < height - 1; y += 2) { + ABGRToUVJRow(src_abgr, src_stride_abgr, dst_uj, dst_vj, width); +@@ -3046,14 +2561,6 @@ int ABGRToJ422(const uint8_t* src_abgr, + } + } + #endif +-#if defined(HAS_ABGRTOYJROW_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- ABGRToYJRow = ABGRToYJRow_Any_NEON_DotProd; +- if (IS_ALIGNED(width, 16)) { +- ABGRToYJRow = ABGRToYJRow_NEON_DotProd; +- } +- } +-#endif + #if defined(HAS_ABGRTOUVJROW_NEON) + if (TestCpuFlag(kCpuHasNEON)) { + ABGRToUVJRow = ABGRToUVJRow_Any_NEON; +@@ -3062,14 +2569,6 @@ int ABGRToJ422(const uint8_t* src_abgr, + } + } + #endif +-#if defined(HAS_ABGRTOUVJROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- ABGRToUVJRow = ABGRToUVJRow_Any_SVE2; +- if (IS_ALIGNED(width, 2)) { +- ABGRToUVJRow = ABGRToUVJRow_SVE2; +- } +- } +-#endif + #if defined(HAS_ABGRTOYJROW_MSA) && defined(HAS_ABGRTOUVJROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + ABGRToYJRow = ABGRToYJRow_Any_MSA; +@@ -3098,11 +2597,6 @@ int ABGRToJ422(const uint8_t* src_abgr, + } + } + #endif +-#if defined(HAS_ABGRTOYJROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ABGRToYJRow = ABGRToYJRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + ABGRToUVJRow(src_abgr, 0, dst_uj, dst_vj, width); +@@ -3164,14 +2658,6 @@ int ABGRToJ400(const uint8_t* src_abgr, + } + } + #endif +-#if defined(HAS_ABGRTOYJROW_NEON_DOTPROD) +- if (TestCpuFlag(kCpuHasNeonDotProd)) { +- ABGRToYJRow = ABGRToYJRow_Any_NEON_DotProd; +- if (IS_ALIGNED(width, 16)) { +- ABGRToYJRow = ABGRToYJRow_NEON_DotProd; +- } +- } +-#endif + #if defined(HAS_ABGRTOYJROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + ABGRToYJRow = ABGRToYJRow_Any_MSA; +@@ -3196,11 +2682,6 @@ int ABGRToJ400(const uint8_t* src_abgr, + } + } + #endif +-#if defined(HAS_ABGRTOYJROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ABGRToYJRow = ABGRToYJRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + ABGRToYJRow(src_abgr, dst_yj, width); +@@ -3260,11 +2741,6 @@ int ARGBToAR64(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOAR64ROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBToAR64Row = ARGBToAR64Row_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + ARGBToAR64Row(src_argb, dst_ar64, width); +@@ -3324,11 +2800,6 @@ int ARGBToAB64(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBTOAB64ROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBToAB64Row = ARGBToAB64Row_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + ARGBToAB64Row(src_argb, dst_ab64, width); +@@ -3339,8 +2810,7 @@ int ARGBToAB64(const uint8_t* src_argb, + } + + // Enabled if 1 pass is available +-#if defined(HAS_RAWTOYJROW_NEON) || defined(HAS_RAWTOYJROW_MSA) || \ +- defined(HAS_RAWTOYJROW_RVV) ++#if defined(HAS_RAWTOYJROW_NEON) || defined(HAS_RAWTOYJROW_MSA) + #define HAS_RAWTOYJROW + #endif + +@@ -3422,11 +2892,6 @@ int RAWToJNV21(const uint8_t* src_raw, + } + } + #endif +-#if defined(HAS_RAWTOYJROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- RAWToYJRow = RAWToYJRow_RVV; +- } +-#endif + + // Other platforms do intermediate conversion from RAW to ARGB. + #else // HAS_RAWTOYJROW +@@ -3483,7 +2948,7 @@ int RAWToJNV21(const uint8_t* src_raw, + #if defined(HAS_MERGEUVROW_AVX2) + if (TestCpuFlag(kCpuHasAVX2)) { + MergeUVRow_ = MergeUVRow_Any_AVX2; +- if (IS_ALIGNED(halfwidth, 16)) { ++ if (IS_ALIGNED(halfwidth, 32)) { + MergeUVRow_ = MergeUVRow_AVX2; + } + } +@@ -3520,27 +2985,15 @@ int RAWToJNV21(const uint8_t* src_raw, + } + } + #endif +-#if defined(HAS_MERGEUVROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- MergeUVRow_ = MergeUVRow_RVV; +- } +-#endif + { +-#if defined(HAS_RAWTOYJROW) + // Allocate a row of uv. +- const int row_uv_size = ((halfwidth + 31) & ~31); +- align_buffer_64(row_uj, row_uv_size * 2); +- uint8_t* row_vj = row_uj + row_uv_size; +-#else +- // Allocate row of uv and 2 rows of ARGB. +- const int row_size = ((width * 4 + 31) & ~31); +- const int row_uv_size = ((halfwidth + 31) & ~31); +- align_buffer_64(row_uj, row_uv_size * 2 + row_size * 2); +- uint8_t* row_vj = row_uj + row_uv_size; +- uint8_t* row = row_vj + row_uv_size; ++ align_buffer_64(row_uj, ((halfwidth + 31) & ~31) * 2); ++ uint8_t* row_vj = row_uj + ((halfwidth + 31) & ~31); ++#if !defined(HAS_RAWTOYJROW) ++ // Allocate 2 rows of ARGB. ++ const int row_size = (width * 4 + 31) & ~31; ++ align_buffer_64(row, row_size * 2); + #endif +- if (!row_uj) +- return 1; + + for (y = 0; y < height - 1; y += 2) { + #if defined(HAS_RAWTOYJROW) +@@ -3572,6 +3025,9 @@ int RAWToJNV21(const uint8_t* src_raw, + ARGBToYJRow(row, dst_y, width); + #endif + } ++#if !defined(HAS_RAWTOYJROW) ++ free_aligned_buffer_64(row); ++#endif + free_aligned_buffer_64(row_uj); + } + return 0; +diff --git a/media/libyuv/libyuv/source/cpu_id.cc b/media/libyuv/libyuv/source/cpu_id.cc +--- a/media/libyuv/libyuv/source/cpu_id.cc ++++ b/media/libyuv/libyuv/source/cpu_id.cc +@@ -23,22 +23,6 @@ + #include // For fopen() + #include + +-#if defined(__linux__) && defined(__aarch64__) +-#include // For getauxval() +-#endif +- +-#if defined(_WIN32) && defined(__aarch64__) +-#undef WIN32_LEAN_AND_MEAN +-#define WIN32_LEAN_AND_MEAN +-#undef WIN32_EXTRA_LEAN +-#define WIN32_EXTRA_LEAN +-#include // For IsProcessorFeaturePresent() +-#endif +- +-#if defined(__APPLE__) && defined(__aarch64__) +-#include // For sysctlbyname() +-#endif +- + #ifdef __cplusplus + namespace libyuv { + extern "C" { +@@ -56,6 +40,7 @@ extern "C" { + // cpu_info_ variable for SIMD instruction sets detected. + LIBYUV_API int cpu_info_ = 0; + ++// TODO(fbarchard): Consider using int for cpuid so casting is not needed. + // Low level cpuid for X86. + #if (defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || \ + defined(__x86_64__)) && \ +@@ -148,217 +133,46 @@ static int GetXCR0() { + #pragma optimize("g", on) + #endif + +-static int cpuinfo_search(const char* cpuinfo_line, +- const char* needle, +- int needle_len) { +- const char* p = strstr(cpuinfo_line, needle); +- return p && (p[needle_len] == ' ' || p[needle_len] == '\n'); +-} +- + // Based on libvpx arm_cpudetect.c + // For Arm, but public to allow testing on any CPU + LIBYUV_API SAFEBUFFERS int ArmCpuCaps(const char* cpuinfo_name) { + char cpuinfo_line[512]; +- FILE* f = fopen(cpuinfo_name, "re"); ++ FILE* f = fopen(cpuinfo_name, "r"); + if (!f) { + // Assume Neon if /proc/cpuinfo is unavailable. + // This will occur for Chrome sandbox for Pepper or Render process. + return kCpuHasNEON; + } +- memset(cpuinfo_line, 0, sizeof(cpuinfo_line)); +- int features = 0; +- while (fgets(cpuinfo_line, sizeof(cpuinfo_line), f)) { ++ while (fgets(cpuinfo_line, sizeof(cpuinfo_line) - 1, f)) { + if (memcmp(cpuinfo_line, "Features", 8) == 0) { +- if (cpuinfo_search(cpuinfo_line, " neon", 5)) { +- features |= kCpuHasNEON; ++ char* p = strstr(cpuinfo_line, " neon"); ++ if (p && (p[5] == ' ' || p[5] == '\n')) { ++ fclose(f); ++ return kCpuHasNEON; ++ } ++ // aarch64 uses asimd for Neon. ++ p = strstr(cpuinfo_line, " asimd"); ++ if (p) { ++ fclose(f); ++ return kCpuHasNEON; + } + } + } + fclose(f); +- return features; +-} +- +-#ifdef __aarch64__ +-#ifdef __linux__ +-// Define hwcap values ourselves: building with an old auxv header where these +-// hwcap values are not defined should not prevent features from being enabled. +-#define YUV_AARCH64_HWCAP_ASIMDDP (1 << 20) +-#define YUV_AARCH64_HWCAP_SVE (1 << 22) +-#define YUV_AARCH64_HWCAP2_SVE2 (1 << 1) +-#define YUV_AARCH64_HWCAP2_I8MM (1 << 13) +-#define YUV_AARCH64_HWCAP2_SME (1 << 23) +- +-// For AArch64, but public to allow testing on any CPU. +-LIBYUV_API SAFEBUFFERS int AArch64CpuCaps(unsigned long hwcap, +- unsigned long hwcap2) { +- // Neon is mandatory on AArch64, so enable regardless of hwcaps. +- int features = kCpuHasNEON; +- +- // Don't try to enable later extensions unless earlier extensions are also +- // reported available. Some of these constraints aren't strictly required by +- // the architecture, but are satisfied by all micro-architectures of +- // interest. This also avoids an issue on some emulators where true +- // architectural constraints are not satisfied, e.g. SVE2 may be reported as +- // available while SVE is not. +- if (hwcap & YUV_AARCH64_HWCAP_ASIMDDP) { +- features |= kCpuHasNeonDotProd; +- if (hwcap2 & YUV_AARCH64_HWCAP2_I8MM) { +- features |= kCpuHasNeonI8MM; +- if (hwcap & YUV_AARCH64_HWCAP_SVE) { +- features |= kCpuHasSVE; +- if (hwcap2 & YUV_AARCH64_HWCAP2_SVE2) { +- features |= kCpuHasSVE2; +- if (hwcap2 & YUV_AARCH64_HWCAP2_SME) { +- features |= kCpuHasSME; +- } +- } +- } +- } +- } +- return features; +-} +- +-#elif defined(_WIN32) +-// For AArch64, but public to allow testing on any CPU. +-LIBYUV_API SAFEBUFFERS int AArch64CpuCaps() { +- // Neon is mandatory on AArch64, so enable unconditionally. +- int features = kCpuHasNEON; +- +- // For more information on IsProcessorFeaturePresent(), see: +- // https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-isprocessorfeaturepresent#parameters +-#ifdef PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE +- if (IsProcessorFeaturePresent(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE)) { +- features |= kCpuHasNeonDotProd; +- } +-#endif +- // No Neon I8MM or SVE feature detection available here at time of writing. +- return features; +-} +- +-#elif defined(__APPLE__) +-static bool have_feature(const char* feature) { +- // For more information on sysctlbyname(), see: +- // https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics +- int64_t feature_present = 0; +- size_t size = sizeof(feature_present); +- if (sysctlbyname(feature, &feature_present, &size, NULL, 0) != 0) { +- return false; +- } +- return feature_present; +-} +- +-// For AArch64, but public to allow testing on any CPU. +-LIBYUV_API SAFEBUFFERS int AArch64CpuCaps() { +- // Neon is mandatory on AArch64, so enable unconditionally. +- int features = kCpuHasNEON; +- +- if (have_feature("hw.optional.arm.FEAT_DotProd")) { +- features |= kCpuHasNeonDotProd; +- if (have_feature("hw.optional.arm.FEAT_I8MM")) { +- features |= kCpuHasNeonI8MM; +- } +- } +- // No SVE feature detection available here at time of writing. +- return features; ++ return 0; + } + +-#else // !defined(__linux__) && !defined(_WIN32) && !defined(__APPLE__) +-// For AArch64, but public to allow testing on any CPU. +-LIBYUV_API SAFEBUFFERS int AArch64CpuCaps() { +- // Neon is mandatory on AArch64, so enable unconditionally. +- int features = kCpuHasNEON; +- +- // TODO(libyuv:980) support feature detection on other platforms. +- +- return features; +-} +-#endif +-#endif // defined(__aarch64__) +- +-LIBYUV_API SAFEBUFFERS int RiscvCpuCaps(const char* cpuinfo_name) { +- char cpuinfo_line[512]; +- int flag = 0; +- FILE* f = fopen(cpuinfo_name, "re"); +- if (!f) { +-#if defined(__riscv_vector) +- // Assume RVV if /proc/cpuinfo is unavailable. +- // This will occur for Chrome sandbox for Pepper or Render process. +- return kCpuHasRVV; +-#else +- return 0; +-#endif +- } +- memset(cpuinfo_line, 0, sizeof(cpuinfo_line)); +- while (fgets(cpuinfo_line, sizeof(cpuinfo_line), f)) { +- if (memcmp(cpuinfo_line, "isa", 3) == 0) { +- // ISA string must begin with rv64{i,e,g} for a 64-bit processor. +- char* isa = strstr(cpuinfo_line, "rv64"); +- if (isa) { +- size_t isa_len = strlen(isa); +- char* extensions; +- size_t extensions_len = 0; +- size_t std_isa_len; +- // Remove the new-line character at the end of string +- if (isa[isa_len - 1] == '\n') { +- isa[--isa_len] = '\0'; +- } +- // 5 ISA characters +- if (isa_len < 5) { +- fclose(f); +- return 0; +- } +- // Skip {i,e,g} canonical checking. +- // Skip rvxxx +- isa += 5; +- // Find the very first occurrence of 's', 'x' or 'z'. +- // To detect multi-letter standard, non-standard, and +- // supervisor-level extensions. +- extensions = strpbrk(isa, "zxs"); +- if (extensions) { +- // Multi-letter extensions are seperated by a single underscore +- // as described in RISC-V User-Level ISA V2.2. +- char* ext = strtok(extensions, "_"); +- extensions_len = strlen(extensions); +- while (ext) { +- // Search for the ZVFH (Vector FP16) extension. +- if (!strcmp(ext, "zvfh")) { +- flag |= kCpuHasRVVZVFH; +- } +- ext = strtok(NULL, "_"); +- } +- } +- std_isa_len = isa_len - extensions_len - 5; +- // Detect the v in the standard single-letter extensions. +- if (memchr(isa, 'v', std_isa_len)) { +- // The RVV implied the F extension. +- flag |= kCpuHasRVV; +- } +- } +- } +-#if defined(__riscv_vector) +- // Assume RVV if /proc/cpuinfo is from x86 host running QEMU. +- else if ((memcmp(cpuinfo_line, "vendor_id\t: GenuineIntel", 24) == 0) || +- (memcmp(cpuinfo_line, "vendor_id\t: AuthenticAMD", 24) == 0)) { +- fclose(f); +- return kCpuHasRVV; +- } +-#endif +- } +- fclose(f); +- return flag; +-} +- ++// TODO(fbarchard): Consider read_msa_ir(). + LIBYUV_API SAFEBUFFERS int MipsCpuCaps(const char* cpuinfo_name) { + char cpuinfo_line[512]; +- int flag = 0; +- FILE* f = fopen(cpuinfo_name, "re"); ++ int flag = 0x0; ++ FILE* f = fopen(cpuinfo_name, "r"); + if (!f) { + // Assume nothing if /proc/cpuinfo is unavailable. + // This will occur for Chrome sandbox for Pepper or Render process. + return 0; + } +- memset(cpuinfo_line, 0, sizeof(cpuinfo_line)); +- while (fgets(cpuinfo_line, sizeof(cpuinfo_line), f)) { ++ while (fgets(cpuinfo_line, sizeof(cpuinfo_line) - 1, f)) { + if (memcmp(cpuinfo_line, "cpu model", 9) == 0) { + // Workaround early kernel without MSA in ASEs line. + if (strstr(cpuinfo_line, "Loongson-2K")) { +@@ -377,13 +191,14 @@ LIBYUV_API SAFEBUFFERS int MipsCpuCaps(c + return flag; + } + ++// TODO(fbarchard): Consider read_loongarch_ir(). + #define LOONGARCH_CFG2 0x2 + #define LOONGARCH_CFG2_LSX (1 << 6) + #define LOONGARCH_CFG2_LASX (1 << 7) + + #if defined(__loongarch__) + LIBYUV_API SAFEBUFFERS int LoongarchCpuCaps(void) { +- int flag = 0; ++ int flag = 0x0; + uint32_t cfg2 = 0; + + __asm__ volatile("cpucfg %0, %1 \n\t" : "+&r"(cfg2) : "r"(LOONGARCH_CFG2)); +@@ -405,12 +220,10 @@ static SAFEBUFFERS int GetCpuFlags(void) + int cpu_info0[4] = {0, 0, 0, 0}; + int cpu_info1[4] = {0, 0, 0, 0}; + int cpu_info7[4] = {0, 0, 0, 0}; +- int cpu_einfo7[4] = {0, 0, 0, 0}; + CpuId(0, 0, cpu_info0); + CpuId(1, 0, cpu_info1); + if (cpu_info0[0] >= 7) { + CpuId(7, 0, cpu_info7); +- CpuId(7, 1, cpu_einfo7); + } + cpu_info = kCpuHasX86 | ((cpu_info1[3] & 0x04000000) ? kCpuHasSSE2 : 0) | + ((cpu_info1[2] & 0x00000200) ? kCpuHasSSSE3 : 0) | +@@ -423,9 +236,7 @@ static SAFEBUFFERS int GetCpuFlags(void) + ((GetXCR0() & 6) == 6)) { // Test OS saves YMM registers + cpu_info |= kCpuHasAVX | ((cpu_info7[1] & 0x00000020) ? kCpuHasAVX2 : 0) | + ((cpu_info1[2] & 0x00001000) ? kCpuHasFMA3 : 0) | +- ((cpu_info1[2] & 0x20000000) ? kCpuHasF16C : 0) | +- ((cpu_einfo7[0] & 0x00000010) ? kCpuHasAVXVNNI : 0) | +- ((cpu_einfo7[3] & 0x00000010) ? kCpuHasAVXVNNIINT8 : 0); ++ ((cpu_info1[2] & 0x20000000) ? kCpuHasF16C : 0); + + // Detect AVX512bw + if ((GetXCR0() & 0xe0) == 0xe0) { +@@ -435,8 +246,8 @@ static SAFEBUFFERS int GetCpuFlags(void) + cpu_info |= (cpu_info7[2] & 0x00000040) ? kCpuHasAVX512VBMI2 : 0; + cpu_info |= (cpu_info7[2] & 0x00000800) ? kCpuHasAVX512VNNI : 0; + cpu_info |= (cpu_info7[2] & 0x00001000) ? kCpuHasAVX512VBITALG : 0; +- cpu_info |= (cpu_einfo7[3] & 0x00080000) ? kCpuHasAVX10 : 0; +- cpu_info |= (cpu_info7[3] & 0x02000000) ? kCpuHasAMXINT8 : 0; ++ cpu_info |= (cpu_info7[2] & 0x00004000) ? kCpuHasAVX512VPOPCNTDQ : 0; ++ cpu_info |= (cpu_info7[2] & 0x00000100) ? kCpuHasGFNI : 0; + } + } + #endif +@@ -449,29 +260,23 @@ static SAFEBUFFERS int GetCpuFlags(void) + cpu_info |= kCpuHasLOONGARCH; + #endif + #if defined(__arm__) || defined(__aarch64__) +-#if defined(__aarch64__) && defined(__linux__) +- // getauxval is supported since Android SDK version 18, minimum at time of +- // writing is 21, so should be safe to always use this. If getauxval is +- // somehow disabled then getauxval returns 0, which will leave Neon enabled +- // since Neon is mandatory on AArch64. +- unsigned long hwcap = getauxval(AT_HWCAP); +- unsigned long hwcap2 = getauxval(AT_HWCAP2); +- cpu_info = AArch64CpuCaps(hwcap, hwcap2); +-#elif defined(__aarch64__) +- cpu_info = AArch64CpuCaps(); ++// gcc -mfpu=neon defines __ARM_NEON__ ++// __ARM_NEON__ generates code that requires Neon. NaCL also requires Neon. ++// For Linux, /proc/cpuinfo can be tested but without that assume Neon. ++#if defined(__ARM_NEON__) || defined(__native_client__) || !defined(__linux__) ++ cpu_info = kCpuHasNEON; ++// For aarch64(arm64), /proc/cpuinfo's feature is not complete, e.g. no neon ++// flag in it. ++// So for aarch64, neon enabling is hard coded here. ++#endif ++#if defined(__aarch64__) ++ cpu_info = kCpuHasNEON; + #else +- // gcc -mfpu=neon defines __ARM_NEON__ +- // __ARM_NEON__ generates code that requires Neon. NaCL also requires Neon. +- // For Linux, /proc/cpuinfo can be tested but without that assume Neon. + // Linux arm parse text file for neon detect. + cpu_info = ArmCpuCaps("/proc/cpuinfo"); + #endif + cpu_info |= kCpuHasARM; + #endif // __arm__ +-#if defined(__riscv) && defined(__linux__) +- cpu_info = RiscvCpuCaps("/proc/cpuinfo"); +- cpu_info |= kCpuHasRISCV; +-#endif // __riscv + cpu_info |= kCpuInitialized; + return cpu_info; + } +diff --git a/media/libyuv/libyuv/source/mjpeg_decoder.cc b/media/libyuv/libyuv/source/mjpeg_decoder.cc +--- a/media/libyuv/libyuv/source/mjpeg_decoder.cc ++++ b/media/libyuv/libyuv/source/mjpeg_decoder.cc +@@ -13,7 +13,8 @@ + #ifdef HAVE_JPEG + #include + +-#if !defined(__pnacl__) && !defined(__CLR_VER) && !defined(COVERAGE_ENABLED) ++#if !defined(__pnacl__) && !defined(__CLR_VER) && \ ++ !defined(COVERAGE_ENABLED) && !defined(TARGET_IPHONE_SIMULATOR) + // Must be included before jpeglib. + #include + #define HAVE_SETJMP +diff --git a/media/libyuv/libyuv/source/planar_functions.cc b/media/libyuv/libyuv/source/planar_functions.cc +--- a/media/libyuv/libyuv/source/planar_functions.cc ++++ b/media/libyuv/libyuv/source/planar_functions.cc +@@ -14,6 +14,9 @@ + #include // for memset() + + #include "libyuv/cpu_id.h" ++#ifdef HAVE_JPEG ++#include "libyuv/mjpeg_decoder.h" ++#endif + #include "libyuv/row.h" + #include "libyuv/scale_row.h" // for ScaleRowDown2 + +@@ -72,11 +75,6 @@ void CopyPlane(const uint8_t* src_y, + CopyRow = IS_ALIGNED(width, 32) ? CopyRow_NEON : CopyRow_Any_NEON; + } + #endif +-#if defined(HAS_COPYROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- CopyRow = CopyRow_RVV; +- } +-#endif + + // Copy plane + for (y = 0; y < height; ++y) { +@@ -164,7 +162,7 @@ void Convert8To16Plane(const uint8_t* sr + int src_stride_y, + uint16_t* dst_y, + int dst_stride_y, +- int scale, // 1024 for 10 bits ++ int scale, // 16384 for 10 bits + int width, + int height) { + int y; +@@ -547,11 +545,6 @@ void SplitUVPlane(const uint8_t* src_uv, + } + } + #endif +-#if defined(HAS_SPLITUVROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- SplitUVRow = SplitUVRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + // Copy a row of UV. +@@ -601,7 +594,7 @@ void MergeUVPlane(const uint8_t* src_u, + #if defined(HAS_MERGEUVROW_AVX2) + if (TestCpuFlag(kCpuHasAVX2)) { + MergeUVRow = MergeUVRow_Any_AVX2; +- if (IS_ALIGNED(width, 16)) { ++ if (IS_ALIGNED(width, 32)) { + MergeUVRow = MergeUVRow_AVX2; + } + } +@@ -638,11 +631,6 @@ void MergeUVPlane(const uint8_t* src_u, + } + } + #endif +-#if defined(HAS_MERGEUVROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- MergeUVRow = MergeUVRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + // Merge a row of U and V into a row of UV. +@@ -748,7 +736,7 @@ void MergeUVPlane_16(const uint16_t* src + #if defined(HAS_MERGEUVROW_16_AVX2) + if (TestCpuFlag(kCpuHasAVX2)) { + MergeUVRow_16 = MergeUVRow_16_Any_AVX2; +- if (IS_ALIGNED(width, 8)) { ++ if (IS_ALIGNED(width, 16)) { + MergeUVRow_16 = MergeUVRow_16_AVX2; + } + } +@@ -1280,11 +1268,6 @@ void SplitRGBPlane(const uint8_t* src_rg + } + } + #endif +-#if defined(HAS_SPLITRGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- SplitRGBRow = SplitRGBRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + // Copy a row of RGB. +@@ -1344,11 +1327,6 @@ void MergeRGBPlane(const uint8_t* src_r, + } + } + #endif +-#if defined(HAS_MERGERGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- MergeRGBRow = MergeRGBRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + // Merge a row of U and V into a row of RGB. +@@ -1380,9 +1358,6 @@ static void SplitARGBPlaneAlpha(const ui + + assert(height > 0); + +- if (width <= 0 || height == 0) { +- return; +- } + if (src_stride_argb == width * 4 && dst_stride_r == width && + dst_stride_g == width && dst_stride_b == width && dst_stride_a == width) { + width *= height; +@@ -1423,11 +1398,6 @@ static void SplitARGBPlaneAlpha(const ui + } + } + #endif +-#if defined(HAS_SPLITARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- SplitARGBRow = SplitARGBRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + SplitARGBRow(src_argb, dst_r, dst_g, dst_b, dst_a, width); +@@ -1455,9 +1425,6 @@ static void SplitARGBPlaneOpaque(const u + uint8_t* dst_b, int width) = SplitXRGBRow_C; + assert(height > 0); + +- if (width <= 0 || height == 0) { +- return; +- } + if (src_stride_argb == width * 4 && dst_stride_r == width && + dst_stride_g == width && dst_stride_b == width) { + width *= height; +@@ -1497,11 +1464,6 @@ static void SplitARGBPlaneOpaque(const u + } + } + #endif +-#if defined(HAS_SPLITXRGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- SplitXRGBRow = SplitXRGBRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + SplitXRGBRow(src_argb, dst_r, dst_g, dst_b, width); +@@ -1568,9 +1530,6 @@ static void MergeARGBPlaneAlpha(const ui + + assert(height > 0); + +- if (width <= 0 || height == 0) { +- return; +- } + if (src_stride_r == width && src_stride_g == width && src_stride_b == width && + src_stride_a == width && dst_stride_argb == width * 4) { + width *= height; +@@ -1602,11 +1561,6 @@ static void MergeARGBPlaneAlpha(const ui + } + } + #endif +-#if defined(HAS_MERGEARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- MergeARGBRow = MergeARGBRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + MergeARGBRow(src_r, src_g, src_b, src_a, dst_argb, width); +@@ -1636,9 +1590,6 @@ static void MergeARGBPlaneOpaque(const u + + assert(height > 0); + +- if (width <= 0 || height == 0) { +- return; +- } + if (src_stride_r == width && src_stride_g == width && src_stride_b == width && + dst_stride_argb == width * 4) { + width *= height; +@@ -1669,11 +1620,6 @@ static void MergeARGBPlaneOpaque(const u + } + } + #endif +-#if defined(HAS_MERGEXRGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- MergeXRGBRow = MergeXRGBRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + MergeXRGBRow(src_r, src_g, src_b, dst_argb, width); +@@ -2125,16 +2071,6 @@ int YUY2ToI422(const uint8_t* src_yuy2, + } + } + #endif +-#if defined(HAS_YUY2TOYROW_LSX) && defined(HAS_YUY2TOUV422ROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- YUY2ToYRow = YUY2ToYRow_Any_LSX; +- YUY2ToUV422Row = YUY2ToUV422Row_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- YUY2ToYRow = YUY2ToYRow_LSX; +- YUY2ToUV422Row = YUY2ToUV422Row_LSX; +- } +- } +-#endif + #if defined(HAS_YUY2TOYROW_LASX) && defined(HAS_YUY2TOUV422ROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + YUY2ToYRow = YUY2ToYRow_Any_LASX; +@@ -2231,16 +2167,6 @@ int UYVYToI422(const uint8_t* src_uyvy, + } + } + #endif +-#if defined(HAS_UYVYTOYROW_LSX) && defined(HAS_UYVYTOUV422ROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- UYVYToYRow = UYVYToYRow_Any_LSX; +- UYVYToUV422Row = UYVYToUV422Row_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- UYVYToYRow = UYVYToYRow_LSX; +- UYVYToUV422Row = UYVYToUV422Row_LSX; +- } +- } +-#endif + #if defined(HAS_UYVYTOYROW_LASX) && defined(HAS_UYVYTOUV422ROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + UYVYToYRow = UYVYToYRow_Any_LASX; +@@ -2388,14 +2314,6 @@ int UYVYToY(const uint8_t* src_uyvy, + } + } + #endif +-#if defined(HAS_UYVYTOYROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- UYVYToYRow = UYVYToYRow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- UYVYToYRow = UYVYToYRow_LSX; +- } +- } +-#endif + + for (y = 0; y < height; ++y) { + UYVYToYRow(src_uyvy, dst_y, width); +@@ -2454,14 +2372,6 @@ void MirrorPlane(const uint8_t* src_y, + } + } + #endif +-#if defined(HAS_MIRRORROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- MirrorRow = MirrorRow_Any_LSX; +- if (IS_ALIGNED(width, 32)) { +- MirrorRow = MirrorRow_LSX; +- } +- } +-#endif + #if defined(HAS_MIRRORROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + MirrorRow = MirrorRow_Any_LASX; +@@ -2528,14 +2438,6 @@ void MirrorUVPlane(const uint8_t* src_uv + } + } + #endif +-#if defined(HAS_MIRRORUVROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- MirrorUVRow = MirrorUVRow_Any_LSX; +- if (IS_ALIGNED(width, 8)) { +- MirrorUVRow = MirrorUVRow_LSX; +- } +- } +-#endif + #if defined(HAS_MIRRORUVROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + MirrorUVRow = MirrorUVRow_Any_LASX; +@@ -2708,14 +2610,6 @@ int ARGBMirror(const uint8_t* src_argb, + } + } + #endif +-#if defined(HAS_ARGBMIRRORROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBMirrorRow = ARGBMirrorRow_Any_LSX; +- if (IS_ALIGNED(width, 8)) { +- ARGBMirrorRow = ARGBMirrorRow_LSX; +- } +- } +-#endif + #if defined(HAS_ARGBMIRRORROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + ARGBMirrorRow = ARGBMirrorRow_Any_LASX; +@@ -2780,6 +2674,37 @@ int RGB24Mirror(const uint8_t* src_rgb24 + return 0; + } + ++// Get a blender that optimized for the CPU and pixel count. ++// As there are 6 blenders to choose from, the caller should try to use ++// the same blend function for all pixels if possible. ++LIBYUV_API ++ARGBBlendRow GetARGBBlend() { ++ void (*ARGBBlendRow)(const uint8_t* src_argb, const uint8_t* src_argb1, ++ uint8_t* dst_argb, int width) = ARGBBlendRow_C; ++#if defined(HAS_ARGBBLENDROW_SSSE3) ++ if (TestCpuFlag(kCpuHasSSSE3)) { ++ ARGBBlendRow = ARGBBlendRow_SSSE3; ++ return ARGBBlendRow; ++ } ++#endif ++#if defined(HAS_ARGBBLENDROW_NEON) ++ if (TestCpuFlag(kCpuHasNEON)) { ++ ARGBBlendRow = ARGBBlendRow_NEON; ++ } ++#endif ++#if defined(HAS_ARGBBLENDROW_MSA) ++ if (TestCpuFlag(kCpuHasMSA)) { ++ ARGBBlendRow = ARGBBlendRow_MSA; ++ } ++#endif ++#if defined(HAS_ARGBBLENDROW_LSX) ++ if (TestCpuFlag(kCpuHasLSX)) { ++ ARGBBlendRow = ARGBBlendRow_LSX; ++ } ++#endif ++ return ARGBBlendRow; ++} ++ + // Alpha Blend 2 ARGB images and store to destination. + LIBYUV_API + int ARGBBlend(const uint8_t* src_argb0, +@@ -2792,7 +2717,7 @@ int ARGBBlend(const uint8_t* src_argb0, + int height) { + int y; + void (*ARGBBlendRow)(const uint8_t* src_argb, const uint8_t* src_argb1, +- uint8_t* dst_argb, int width) = ARGBBlendRow_C; ++ uint8_t* dst_argb, int width) = GetARGBBlend(); + if (!src_argb0 || !src_argb1 || !dst_argb || width <= 0 || height == 0) { + return -1; + } +@@ -2809,31 +2734,7 @@ int ARGBBlend(const uint8_t* src_argb0, + height = 1; + src_stride_argb0 = src_stride_argb1 = dst_stride_argb = 0; + } +-#if defined(HAS_ARGBBLENDROW_SSSE3) +- if (TestCpuFlag(kCpuHasSSSE3)) { +- ARGBBlendRow = ARGBBlendRow_SSSE3; +- } +-#endif +-#if defined(HAS_ARGBBLENDROW_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- ARGBBlendRow = ARGBBlendRow_NEON; +- } +-#endif +-#if defined(HAS_ARGBBLENDROW_MSA) +- if (TestCpuFlag(kCpuHasMSA)) { +- ARGBBlendRow = ARGBBlendRow_MSA; +- } +-#endif +-#if defined(HAS_ARGBBLENDROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBBlendRow = ARGBBlendRow_LSX; +- } +-#endif +-#if defined(HAS_ARGBBLENDROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBBlendRow = ARGBBlendRow_RVV; +- } +-#endif ++ + for (y = 0; y < height; ++y) { + ARGBBlendRow(src_argb0, src_argb1, dst_argb, width); + src_argb0 += src_stride_argb0; +@@ -2893,11 +2794,6 @@ int BlendPlane(const uint8_t* src_y0, + } + } + #endif +-#if defined(HAS_BLENDPLANEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- BlendPlaneRow = BlendPlaneRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + BlendPlaneRow(src_y0, src_y1, alpha, dst_y, width); +@@ -2975,11 +2871,6 @@ int I420Blend(const uint8_t* src_y0, + } + } + #endif +-#if defined(HAS_BLENDPLANEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- BlendPlaneRow = BlendPlaneRow_RVV; +- } +-#endif + if (!IS_ALIGNED(width, 2)) { + ScaleRowDown2 = ScaleRowDown2Box_Odd_C; + } +@@ -3016,16 +2907,9 @@ int I420Blend(const uint8_t* src_y0, + } + } + #endif +-#if defined(HAS_SCALEROWDOWN2_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ScaleRowDown2 = ScaleRowDown2Box_RVV; +- } +-#endif + + // Row buffer for intermediate alpha pixels. + align_buffer_64(halfalpha, halfwidth); +- if (!halfalpha) +- return 1; + for (y = 0; y < height; y += 2) { + // last row of odd height image use 1 row of alpha instead of 2. + if (y == (height - 1)) { +@@ -3108,14 +2992,6 @@ int ARGBMultiply(const uint8_t* src_argb + } + } + #endif +-#if defined(HAS_ARGBMULTIPLYROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBMultiplyRow = ARGBMultiplyRow_Any_LSX; +- if (IS_ALIGNED(width, 4)) { +- ARGBMultiplyRow = ARGBMultiplyRow_LSX; +- } +- } +-#endif + #if defined(HAS_ARGBMULTIPLYROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + ARGBMultiplyRow = ARGBMultiplyRow_Any_LASX; +@@ -3201,14 +3077,6 @@ int ARGBAdd(const uint8_t* src_argb0, + } + } + #endif +-#if defined(HAS_ARGBADDROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBAddRow = ARGBAddRow_Any_LSX; +- if (IS_ALIGNED(width, 4)) { +- ARGBAddRow = ARGBAddRow_LSX; +- } +- } +-#endif + #if defined(HAS_ARGBADDROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + ARGBAddRow = ARGBAddRow_Any_LASX; +@@ -3289,14 +3157,6 @@ int ARGBSubtract(const uint8_t* src_argb + } + } + #endif +-#if defined(HAS_ARGBSUBTRACTROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBSubtractRow = ARGBSubtractRow_Any_LSX; +- if (IS_ALIGNED(width, 4)) { +- ARGBSubtractRow = ARGBSubtractRow_LSX; +- } +- } +-#endif + #if defined(HAS_ARGBSUBTRACTROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + ARGBSubtractRow = ARGBSubtractRow_Any_LASX; +@@ -3374,11 +3234,6 @@ int RAWToRGB24(const uint8_t* src_raw, + } + } + #endif +-#if defined(HAS_RAWTORGB24ROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- RAWToRGB24Row = RAWToRGB24Row_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + RAWToRGB24Row(src_raw, dst_rgb24, width); +@@ -3622,14 +3477,6 @@ int ARGBAttenuate(const uint8_t* src_arg + } + } + #endif +-#if defined(HAS_ARGBATTENUATEROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBAttenuateRow = ARGBAttenuateRow_Any_LSX; +- if (IS_ALIGNED(width, 8)) { +- ARGBAttenuateRow = ARGBAttenuateRow_LSX; +- } +- } +-#endif + #if defined(HAS_ARGBATTENUATEROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + ARGBAttenuateRow = ARGBAttenuateRow_Any_LASX; +@@ -3638,11 +3485,6 @@ int ARGBAttenuate(const uint8_t* src_arg + } + } + #endif +-#if defined(HAS_ARGBATTENUATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBAttenuateRow = ARGBAttenuateRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + ARGBAttenuateRow(src_argb, dst_argb, width); +@@ -3743,11 +3585,6 @@ int ARGBGrayTo(const uint8_t* src_argb, + ARGBGrayRow = ARGBGrayRow_MSA; + } + #endif +-#if defined(HAS_ARGBGRAYROW_LSX) +- if (TestCpuFlag(kCpuHasLSX) && IS_ALIGNED(width, 8)) { +- ARGBGrayRow = ARGBGrayRow_LSX; +- } +-#endif + #if defined(HAS_ARGBGRAYROW_LASX) + if (TestCpuFlag(kCpuHasLASX) && IS_ALIGNED(width, 16)) { + ARGBGrayRow = ARGBGrayRow_LASX; +@@ -3798,11 +3635,6 @@ int ARGBGray(uint8_t* dst_argb, + ARGBGrayRow = ARGBGrayRow_MSA; + } + #endif +-#if defined(HAS_ARGBGRAYROW_LSX) +- if (TestCpuFlag(kCpuHasLSX) && IS_ALIGNED(width, 8)) { +- ARGBGrayRow = ARGBGrayRow_LSX; +- } +-#endif + #if defined(HAS_ARGBGRAYROW_LASX) + if (TestCpuFlag(kCpuHasLASX) && IS_ALIGNED(width, 16)) { + ARGBGrayRow = ARGBGrayRow_LASX; +@@ -3851,11 +3683,6 @@ int ARGBSepia(uint8_t* dst_argb, + ARGBSepiaRow = ARGBSepiaRow_MSA; + } + #endif +-#if defined(HAS_ARGBSEPIAROW_LSX) +- if (TestCpuFlag(kCpuHasLSX) && IS_ALIGNED(width, 8)) { +- ARGBSepiaRow = ARGBSepiaRow_LSX; +- } +-#endif + #if defined(HAS_ARGBSEPIAROW_LASX) + if (TestCpuFlag(kCpuHasLASX) && IS_ALIGNED(width, 16)) { + ARGBSepiaRow = ARGBSepiaRow_LASX; +@@ -3907,11 +3734,6 @@ int ARGBColorMatrix(const uint8_t* src_a + ARGBColorMatrixRow = ARGBColorMatrixRow_NEON; + } + #endif +-#if defined(HAS_ARGBCOLORMATRIXROW_NEON_I8MM) +- if (TestCpuFlag(kCpuHasNeonI8MM) && IS_ALIGNED(width, 8)) { +- ARGBColorMatrixRow = ARGBColorMatrixRow_NEON_I8MM; +- } +-#endif + #if defined(HAS_ARGBCOLORMATRIXROW_MSA) + if (TestCpuFlag(kCpuHasMSA) && IS_ALIGNED(width, 8)) { + ARGBColorMatrixRow = ARGBColorMatrixRow_MSA; +@@ -4286,11 +4108,6 @@ int ARGBShade(const uint8_t* src_argb, + ARGBShadeRow = ARGBShadeRow_MSA; + } + #endif +-#if defined(HAS_ARGBSHADEROW_LSX) +- if (TestCpuFlag(kCpuHasLSX) && IS_ALIGNED(width, 4)) { +- ARGBShadeRow = ARGBShadeRow_LSX; +- } +-#endif + #if defined(HAS_ARGBSHADEROW_LASX) + if (TestCpuFlag(kCpuHasLASX) && IS_ALIGNED(width, 8)) { + ARGBShadeRow = ARGBShadeRow_LASX; +@@ -4375,11 +4192,6 @@ int InterpolatePlane(const uint8_t* src0 + } + } + #endif +-#if defined(HAS_INTERPOLATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- InterpolateRow = InterpolateRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + InterpolateRow(dst, src0, src1 - src0, width, interpolation); +@@ -4585,14 +4397,6 @@ int ARGBShuffle(const uint8_t* src_bgra, + } + } + #endif +-#if defined(HAS_ARGBSHUFFLEROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBShuffleRow = ARGBShuffleRow_Any_LSX; +- if (IS_ALIGNED(width, 8)) { +- ARGBShuffleRow = ARGBShuffleRow_LSX; +- } +- } +-#endif + #if defined(HAS_ARGBSHUFFLEROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + ARGBShuffleRow = ARGBShuffleRow_Any_LASX; +@@ -4714,8 +4518,6 @@ int GaussPlane_F32(const float* src, + { + // 2 pixels on each side, but aligned out to 16 bytes. + align_buffer_64(rowbuf, (4 + width + 4) * 4); +- if (!rowbuf) +- return 1; + memset(rowbuf, 0, 16); + memset(rowbuf + (4 + width) * 4, 0, 16); + float* row = (float*)(rowbuf + 16); +@@ -4826,11 +4628,6 @@ static int ARGBSobelize(const uint8_t* s + } + } + #endif +-#if defined(HAS_ARGBTOYJROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBToYJRow = ARGBToYJRow_RVV; +- } +-#endif + + #if defined(HAS_SOBELYROW_SSE2) + if (TestCpuFlag(kCpuHasSSE2)) { +@@ -4874,8 +4671,6 @@ static int ARGBSobelize(const uint8_t* s + uint8_t* row_y0 = row_y + kEdge; + uint8_t* row_y1 = row_y0 + row_size; + uint8_t* row_y2 = row_y1 + row_size; +- if (!rows) +- return 1; + ARGBToYJRow(src_argb, row_y0, width); + row_y0[-1] = row_y0[0]; + memset(row_y0 + width, row_y0[width - 1], 16); // Extrude 16 for valgrind. +@@ -5356,11 +5151,6 @@ int ARGBExtractAlpha(const uint8_t* src_ + : ARGBExtractAlphaRow_Any_LSX; + } + #endif +-#if defined(HAS_ARGBEXTRACTALPHAROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBExtractAlphaRow = ARGBExtractAlphaRow_RVV; +- } +-#endif + + for (int y = 0; y < height; ++y) { + ARGBExtractAlphaRow(src_argb, dst_a, width); +@@ -5412,11 +5202,6 @@ int ARGBCopyYToAlpha(const uint8_t* src_ + } + } + #endif +-#if defined(HAS_ARGBCOPYYTOALPHAROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ARGBCopyYToAlphaRow = ARGBCopyYToAlphaRow_RVV; +- } +-#endif + + for (y = 0; y < height; ++y) { + ARGBCopyYToAlphaRow(src_y, dst_argb, width); +@@ -5482,14 +5267,6 @@ int YUY2ToNV12(const uint8_t* src_yuy2, + } + } + #endif +-#if defined(HAS_YUY2TOYROW_LSX) && defined(HAS_YUY2TOUV422ROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- YUY2ToYRow = YUY2ToYRow_Any_LSX; +- if (IS_ALIGNED(width, 16)) { +- YUY2ToYRow = YUY2ToYRow_LSX; +- } +- } +-#endif + #if defined(HAS_YUY2TOYROW_LASX) && defined(HAS_YUY2TOUV422ROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + YUY2ToYRow = YUY2ToYRow_Any_LASX; +@@ -5606,12 +5383,6 @@ int UYVYToNV12(const uint8_t* src_uyvy, + } + } + #endif +-#if defined(HAS_SPLITUVROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- SplitUVRow = SplitUVRow_RVV; +- } +-#endif +- + #if defined(HAS_INTERPOLATEROW_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + InterpolateRow = InterpolateRow_Any_SSSE3; +@@ -5652,18 +5423,11 @@ int UYVYToNV12(const uint8_t* src_uyvy, + } + } + #endif +-#if defined(HAS_INTERPOLATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- InterpolateRow = InterpolateRow_RVV; +- } +-#endif + + { + int awidth = halfwidth * 2; + // row of y and 2 rows of uv + align_buffer_64(rows, awidth * 3); +- if (!rows) +- return 1; + + for (y = 0; y < height - 1; y += 2) { + // Split Y from UV. +@@ -5724,7 +5488,6 @@ void HalfMergeUVPlane(const uint8_t* src + HalfMergeUVRow = HalfMergeUVRow_AVX2; + } + #endif +- + for (y = 0; y < height - 1; y += 2) { + // Merge a row of U and V into a row of UV. + HalfMergeUVRow(src_u, src_stride_u, src_v, src_stride_v, dst_uv, width); +diff --git a/media/libyuv/libyuv/source/rotate.cc b/media/libyuv/libyuv/source/rotate.cc +--- a/media/libyuv/libyuv/source/rotate.cc ++++ b/media/libyuv/libyuv/source/rotate.cc +@@ -8,8 +8,6 @@ + * be found in the AUTHORS file in the root of the source tree. + */ + +-#include +- + #include "libyuv/rotate.h" + + #include "libyuv/convert.h" +@@ -31,8 +29,7 @@ void TransposePlane(const uint8_t* src, + int width, + int height) { + int i = height; +-#if defined(HAS_TRANSPOSEWX16_MSA) || defined(HAS_TRANSPOSEWX16_LSX) || \ +- defined(HAS_TRANSPOSEWX16_NEON) ++#if defined(HAS_TRANSPOSEWX16_MSA) || defined(HAS_TRANSPOSEWX16_LSX) + void (*TransposeWx16)(const uint8_t* src, int src_stride, uint8_t* dst, + int dst_stride, int width) = TransposeWx16_C; + #else +@@ -48,14 +45,6 @@ void TransposePlane(const uint8_t* src, + } + } + #endif +-#if defined(HAS_TRANSPOSEWX16_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- TransposeWx16 = TransposeWx16_Any_NEON; +- if (IS_ALIGNED(width, 16)) { +- TransposeWx16 = TransposeWx16_NEON; +- } +- } +-#endif + #if defined(HAS_TRANSPOSEWX8_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3)) { + TransposeWx8 = TransposeWx8_Any_SSSE3; +@@ -89,8 +78,7 @@ void TransposePlane(const uint8_t* src, + } + #endif + +-#if defined(HAS_TRANSPOSEWX16_MSA) || defined(HAS_TRANSPOSEWX16_LSX) || \ +- defined(HAS_TRANSPOSEWX16_NEON) ++#if defined(HAS_TRANSPOSEWX16_MSA) || defined(HAS_TRANSPOSEWX16_LSX) + // Work across the source in 16x16 tiles + while (i >= 16) { + TransposeWx16(src, src_stride, dst, dst_stride, width); +@@ -152,9 +140,6 @@ void RotatePlane180(const uint8_t* src, + int height) { + // Swap top and bottom row and mirror the content. Uses a temporary row. + align_buffer_64(row, width); +- assert(row); +- if (!row) +- return; + const uint8_t* src_bot = src + src_stride * (height - 1); + uint8_t* dst_bot = dst + dst_stride * (height - 1); + int half_height = (height + 1) >> 1; +@@ -193,14 +178,6 @@ void RotatePlane180(const uint8_t* src, + } + } + #endif +-#if defined(HAS_MIRRORROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- MirrorRow = MirrorRow_Any_LSX; +- if (IS_ALIGNED(width, 32)) { +- MirrorRow = MirrorRow_LSX; +- } +- } +-#endif + #if defined(HAS_MIRRORROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + MirrorRow = MirrorRow_Any_LASX; +@@ -229,11 +206,6 @@ void RotatePlane180(const uint8_t* src, + CopyRow = IS_ALIGNED(width, 32) ? CopyRow_NEON : CopyRow_Any_NEON; + } + #endif +-#if defined(HAS_COPYROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- CopyRow = CopyRow_RVV; +- } +-#endif + + // Odd height will harmlessly mirror the middle row twice. + for (y = 0; y < half_height; ++y) { +@@ -289,10 +261,7 @@ void SplitTransposeUV(const uint8_t* src + #else + #if defined(HAS_TRANSPOSEUVWX8_NEON) + if (TestCpuFlag(kCpuHasNEON)) { +- TransposeUVWx8 = TransposeUVWx8_Any_NEON; +- if (IS_ALIGNED(width, 8)) { +- TransposeUVWx8 = TransposeUVWx8_NEON; +- } ++ TransposeUVWx8 = TransposeUVWx8_NEON; + } + #endif + #if defined(HAS_TRANSPOSEUVWX8_SSE2) +@@ -507,12 +476,13 @@ int RotatePlane(const uint8_t* src, + return -1; + } + +-static void TransposePlane_16(const uint16_t* src, +- int src_stride, +- uint16_t* dst, +- int dst_stride, +- int width, +- int height) { ++LIBYUV_API ++void TransposePlane_16(const uint16_t* src, ++ int src_stride, ++ uint16_t* dst, ++ int dst_stride, ++ int width, ++ int height) { + int i = height; + // Work across the source in 8x8 tiles + while (i >= 8) { +@@ -561,29 +531,24 @@ static void RotatePlane180_16(const uint + int dst_stride, + int width, + int height) { ++ // Swap top and bottom row and mirror the content. Uses a temporary row. ++ align_buffer_64_16(row, width); + const uint16_t* src_bot = src + src_stride * (height - 1); + uint16_t* dst_bot = dst + dst_stride * (height - 1); + int half_height = (height + 1) >> 1; + int y; + +- // Swap top and bottom row and mirror the content. Uses a temporary row. +- align_buffer_64(row, width * 2); +- uint16_t* row_tmp = (uint16_t*)row; +- assert(row); +- if (!row) +- return; +- + // Odd height will harmlessly mirror the middle row twice. + for (y = 0; y < half_height; ++y) { +- CopyRow_16_C(src, row_tmp, width); // Copy top row into buffer +- MirrorRow_16_C(src_bot, dst, width); // Mirror bottom row into top row +- MirrorRow_16_C(row_tmp, dst_bot, width); // Mirror buffer into bottom row ++ CopyRow_16_C(src, row, width); // Copy top row into buffer ++ MirrorRow_16_C(src_bot, dst, width); // Mirror bottom row into top row ++ MirrorRow_16_C(row, dst_bot, width); // Mirror buffer into bottom row + src += src_stride; + dst += dst_stride; + src_bot -= src_stride; + dst_bot -= dst_stride; + } +- free_aligned_buffer_64(row); ++ free_aligned_buffer_64_16(row); + } + + LIBYUV_API +@@ -713,7 +678,6 @@ int I422Rotate(const uint8_t* src_y, + enum RotationMode mode) { + int halfwidth = (width + 1) >> 1; + int halfheight = (height + 1) >> 1; +- int r; + if (!src_y || !src_u || !src_v || width <= 0 || height == 0 || !dst_y || + !dst_u || !dst_v) { + return -1; +@@ -749,35 +713,23 @@ int I422Rotate(const uint8_t* src_y, + case kRotate90: + RotatePlane90(src_u, src_stride_u, dst_y, dst_stride_y, halfwidth, + height); +- r = ScalePlane(dst_y, dst_stride_y, height, halfwidth, dst_u, +- dst_stride_u, halfheight, width, kFilterBilinear); +- if (r != 0) { +- return r; +- } ++ ScalePlane(dst_y, dst_stride_y, height, halfwidth, dst_u, dst_stride_u, ++ halfheight, width, kFilterBilinear); + RotatePlane90(src_v, src_stride_v, dst_y, dst_stride_y, halfwidth, + height); +- r = ScalePlane(dst_y, dst_stride_y, height, halfwidth, dst_v, +- dst_stride_v, halfheight, width, kFilterLinear); +- if (r != 0) { +- return r; +- } ++ ScalePlane(dst_y, dst_stride_y, height, halfwidth, dst_v, dst_stride_v, ++ halfheight, width, kFilterLinear); + RotatePlane90(src_y, src_stride_y, dst_y, dst_stride_y, width, height); + return 0; + case kRotate270: + RotatePlane270(src_u, src_stride_u, dst_y, dst_stride_y, halfwidth, + height); +- r = ScalePlane(dst_y, dst_stride_y, height, halfwidth, dst_u, +- dst_stride_u, halfheight, width, kFilterBilinear); +- if (r != 0) { +- return r; +- } ++ ScalePlane(dst_y, dst_stride_y, height, halfwidth, dst_u, dst_stride_u, ++ halfheight, width, kFilterBilinear); + RotatePlane270(src_v, src_stride_v, dst_y, dst_stride_y, halfwidth, + height); +- r = ScalePlane(dst_y, dst_stride_y, height, halfwidth, dst_v, +- dst_stride_v, halfheight, width, kFilterLinear); +- if (r != 0) { +- return r; +- } ++ ScalePlane(dst_y, dst_stride_y, height, halfwidth, dst_v, dst_stride_v, ++ halfheight, width, kFilterLinear); + RotatePlane270(src_y, src_stride_y, dst_y, dst_stride_y, width, height); + return 0; + case kRotate180: +@@ -1091,7 +1043,6 @@ int I210Rotate(const uint16_t* src_y, + enum RotationMode mode) { + int halfwidth = (width + 1) >> 1; + int halfheight = (height + 1) >> 1; +- int r; + if (!src_y || !src_u || !src_v || width <= 0 || height == 0 || !dst_y || + !dst_u || !dst_v) { + return -1; +@@ -1127,35 +1078,23 @@ int I210Rotate(const uint16_t* src_y, + case kRotate90: + RotatePlane90_16(src_u, src_stride_u, dst_y, dst_stride_y, halfwidth, + height); +- r = ScalePlane_16(dst_y, dst_stride_y, height, halfwidth, dst_u, +- dst_stride_u, halfheight, width, kFilterBilinear); +- if (r != 0) { +- return r; +- } ++ ScalePlane_16(dst_y, dst_stride_y, height, halfwidth, dst_u, dst_stride_u, ++ halfheight, width, kFilterBilinear); + RotatePlane90_16(src_v, src_stride_v, dst_y, dst_stride_y, halfwidth, + height); +- r = ScalePlane_16(dst_y, dst_stride_y, height, halfwidth, dst_v, +- dst_stride_v, halfheight, width, kFilterLinear); +- if (r != 0) { +- return r; +- } ++ ScalePlane_16(dst_y, dst_stride_y, height, halfwidth, dst_v, dst_stride_v, ++ halfheight, width, kFilterLinear); + RotatePlane90_16(src_y, src_stride_y, dst_y, dst_stride_y, width, height); + return 0; + case kRotate270: + RotatePlane270_16(src_u, src_stride_u, dst_y, dst_stride_y, halfwidth, + height); +- r = ScalePlane_16(dst_y, dst_stride_y, height, halfwidth, dst_u, +- dst_stride_u, halfheight, width, kFilterBilinear); +- if (r != 0) { +- return r; +- } ++ ScalePlane_16(dst_y, dst_stride_y, height, halfwidth, dst_u, dst_stride_u, ++ halfheight, width, kFilterBilinear); + RotatePlane270_16(src_v, src_stride_v, dst_y, dst_stride_y, halfwidth, + height); +- r = ScalePlane_16(dst_y, dst_stride_y, height, halfwidth, dst_v, +- dst_stride_v, halfheight, width, kFilterLinear); +- if (r != 0) { +- return r; +- } ++ ScalePlane_16(dst_y, dst_stride_y, height, halfwidth, dst_v, dst_stride_v, ++ halfheight, width, kFilterLinear); + RotatePlane270_16(src_y, src_stride_y, dst_y, dst_stride_y, width, + height); + return 0; +diff --git a/media/libyuv/libyuv/source/rotate_any.cc b/media/libyuv/libyuv/source/rotate_any.cc +--- a/media/libyuv/libyuv/source/rotate_any.cc ++++ b/media/libyuv/libyuv/source/rotate_any.cc +@@ -32,9 +32,6 @@ extern "C" { + #ifdef HAS_TRANSPOSEWX8_NEON + TANY(TransposeWx8_Any_NEON, TransposeWx8_NEON, 7) + #endif +-#ifdef HAS_TRANSPOSEWX16_NEON +-TANY(TransposeWx16_Any_NEON, TransposeWx16_NEON, 15) +-#endif + #ifdef HAS_TRANSPOSEWX8_SSSE3 + TANY(TransposeWx8_Any_SSSE3, TransposeWx8_SSSE3, 7) + #endif +diff --git a/media/libyuv/libyuv/source/rotate_argb.cc b/media/libyuv/libyuv/source/rotate_argb.cc +--- a/media/libyuv/libyuv/source/rotate_argb.cc ++++ b/media/libyuv/libyuv/source/rotate_argb.cc +@@ -69,11 +69,6 @@ static int ARGBTranspose(const uint8_t* + } + } + #endif +-#if defined(HAS_SCALEARGBROWDOWNEVEN_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ScaleARGBRowDownEven = ScaleARGBRowDownEven_RVV; +- } +-#endif + + for (i = 0; i < width; ++i) { // column of source to row of dest. + ScaleARGBRowDownEven(src_argb, 0, src_pixel_step, dst_argb, height); +@@ -120,6 +115,7 @@ static int ARGBRotate180(const uint8_t* + int width, + int height) { + // Swap first and last row and mirror the content. Uses a temporary row. ++ align_buffer_64(row, width * 4); + const uint8_t* src_bot = src_argb + src_stride_argb * (height - 1); + uint8_t* dst_bot = dst_argb + dst_stride_argb * (height - 1); + int half_height = (height + 1) >> 1; +@@ -128,9 +124,6 @@ static int ARGBRotate180(const uint8_t* + ARGBMirrorRow_C; + void (*CopyRow)(const uint8_t* src_argb, uint8_t* dst_argb, int width) = + CopyRow_C; +- align_buffer_64(row, width * 4); +- if (!row) +- return 1; + #if defined(HAS_ARGBMIRRORROW_NEON) + if (TestCpuFlag(kCpuHasNEON)) { + ARGBMirrorRow = ARGBMirrorRow_Any_NEON; +@@ -163,14 +156,6 @@ static int ARGBRotate180(const uint8_t* + } + } + #endif +-#if defined(HAS_ARGBMIRRORROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- ARGBMirrorRow = ARGBMirrorRow_Any_LSX; +- if (IS_ALIGNED(width, 8)) { +- ARGBMirrorRow = ARGBMirrorRow_LSX; +- } +- } +-#endif + #if defined(HAS_ARGBMIRRORROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + ARGBMirrorRow = ARGBMirrorRow_Any_LASX; +@@ -199,11 +184,6 @@ static int ARGBRotate180(const uint8_t* + CopyRow = IS_ALIGNED(width * 4, 32) ? CopyRow_NEON : CopyRow_Any_NEON; + } + #endif +-#if defined(HAS_COPYROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- CopyRow = CopyRow_RVV; +- } +-#endif + + // Odd height will harmlessly mirror the middle row twice. + for (y = 0; y < half_height; ++y) { +diff --git a/media/libyuv/libyuv/source/rotate_common.cc b/media/libyuv/libyuv/source/rotate_common.cc +--- a/media/libyuv/libyuv/source/rotate_common.cc ++++ b/media/libyuv/libyuv/source/rotate_common.cc +@@ -36,16 +36,6 @@ void TransposeWx8_C(const uint8_t* src, + } + } + +-void TransposeWx16_C(const uint8_t* src, +- int src_stride, +- uint8_t* dst, +- int dst_stride, +- int width) { +- TransposeWx8_C(src, src_stride, dst, dst_stride, width); +- TransposeWx8_C((src + 8 * src_stride), src_stride, (dst + 8), dst_stride, +- width); +-} +- + void TransposeUVWx8_C(const uint8_t* src, + int src_stride, + uint8_t* dst_a, +@@ -130,6 +120,37 @@ void TransposeWx8_16_C(const uint16_t* s + } + } + ++void TransposeUVWx8_16_C(const uint16_t* src, ++ int src_stride, ++ uint16_t* dst_a, ++ int dst_stride_a, ++ uint16_t* dst_b, ++ int dst_stride_b, ++ int width) { ++ int i; ++ for (i = 0; i < width; ++i) { ++ dst_a[0] = src[0 * src_stride + 0]; ++ dst_b[0] = src[0 * src_stride + 1]; ++ dst_a[1] = src[1 * src_stride + 0]; ++ dst_b[1] = src[1 * src_stride + 1]; ++ dst_a[2] = src[2 * src_stride + 0]; ++ dst_b[2] = src[2 * src_stride + 1]; ++ dst_a[3] = src[3 * src_stride + 0]; ++ dst_b[3] = src[3 * src_stride + 1]; ++ dst_a[4] = src[4 * src_stride + 0]; ++ dst_b[4] = src[4 * src_stride + 1]; ++ dst_a[5] = src[5 * src_stride + 0]; ++ dst_b[5] = src[5 * src_stride + 1]; ++ dst_a[6] = src[6 * src_stride + 0]; ++ dst_b[6] = src[6 * src_stride + 1]; ++ dst_a[7] = src[7 * src_stride + 0]; ++ dst_b[7] = src[7 * src_stride + 1]; ++ src += 2; ++ dst_a += dst_stride_a; ++ dst_b += dst_stride_b; ++ } ++} ++ + void TransposeWxH_16_C(const uint16_t* src, + int src_stride, + uint16_t* dst, +diff --git a/media/libyuv/libyuv/source/rotate_gcc.cc b/media/libyuv/libyuv/source/rotate_gcc.cc +--- a/media/libyuv/libyuv/source/rotate_gcc.cc ++++ b/media/libyuv/libyuv/source/rotate_gcc.cc +@@ -26,7 +26,7 @@ void TransposeWx8_SSSE3(const uint8_t* s + uint8_t* dst, + int dst_stride, + int width) { +- asm volatile ( ++ asm volatile( + // Read in the data from the source pointer. + // First round of bit swap. + LABELALIGN +@@ -116,7 +116,7 @@ void TransposeWx8_Fast_SSSE3(const uint8 + uint8_t* dst, + int dst_stride, + int width) { +- asm volatile ( ++ asm volatile( + // Read in the data from the source pointer. + // First round of bit swap. + LABELALIGN +@@ -261,7 +261,7 @@ void TransposeUVWx8_SSE2(const uint8_t* + uint8_t* dst_b, + int dst_stride_b, + int width) { +- asm volatile ( ++ asm volatile( + // Read in the data from the source pointer. + // First round of bit swap. + LABELALIGN +@@ -365,136 +365,6 @@ void TransposeUVWx8_SSE2(const uint8_t* + "xmm7", "xmm8", "xmm9"); + } + #endif // defined(HAS_TRANSPOSEUVWX8_SSE2) +- +-#if defined(HAS_TRANSPOSE4X4_32_SSE2) +-// 4 values, little endian view +-// a b c d +-// e f g h +-// i j k l +-// m n o p +- +-// transpose 2x2 +-// a e b f from row 0, 1 +-// i m j n from row 2, 3 +-// c g d h from row 0, 1 +-// k o l p from row 2, 3 +- +-// transpose 4x4 +-// a e i m from row 0, 1 +-// b f j n from row 0, 1 +-// c g k o from row 2, 3 +-// d h l p from row 2, 3 +- +-// Transpose 32 bit values (ARGB) +-void Transpose4x4_32_SSE2(const uint8_t* src, +- int src_stride, +- uint8_t* dst, +- int dst_stride, +- int width) { +- asm volatile ( +- // Main loop transpose 4x4. Read a column, write a row. +- "1: \n" +- "movdqu (%0),%%xmm0 \n" // a b c d +- "movdqu (%0,%3),%%xmm1 \n" // e f g h +- "lea (%0,%3,2),%0 \n" // src += stride * 2 +- "movdqu (%0),%%xmm2 \n" // i j k l +- "movdqu (%0,%3),%%xmm3 \n" // m n o p +- "lea (%0,%3,2),%0 \n" // src += stride * 2 +- +- // Transpose 2x2 +- "movdqa %%xmm0,%%xmm4 \n" +- "movdqa %%xmm2,%%xmm5 \n" +- "movdqa %%xmm0,%%xmm6 \n" +- "movdqa %%xmm2,%%xmm7 \n" +- "punpckldq %%xmm1,%%xmm4 \n" // a e b f from row 0, 1 +- "punpckldq %%xmm3,%%xmm5 \n" // i m j n from row 2, 3 +- "punpckhdq %%xmm1,%%xmm6 \n" // c g d h from row 0, 1 +- "punpckhdq %%xmm3,%%xmm7 \n" // k o l p from row 2, 3 +- +- // Transpose 4x4 +- "movdqa %%xmm4,%%xmm0 \n" +- "movdqa %%xmm4,%%xmm1 \n" +- "movdqa %%xmm6,%%xmm2 \n" +- "movdqa %%xmm6,%%xmm3 \n" +- "punpcklqdq %%xmm5,%%xmm0 \n" // a e i m from row 0, 1 +- "punpckhqdq %%xmm5,%%xmm1 \n" // b f j n from row 0, 1 +- "punpcklqdq %%xmm7,%%xmm2 \n" // c g k o from row 2, 3 +- "punpckhqdq %%xmm7,%%xmm3 \n" // d h l p from row 2, 3 +- +- "movdqu %%xmm0,(%1) \n" +- "lea 16(%1,%4),%1 \n" // dst += stride + 16 +- "movdqu %%xmm1,-16(%1) \n" +- "movdqu %%xmm2,-16(%1,%4) \n" +- "movdqu %%xmm3,-16(%1,%4,2) \n" +- "sub %4,%1 \n" +- "sub $0x4,%2 \n" +- "jg 1b \n" +- : "+r"(src), // %0 +- "+r"(dst), // %1 +- "+rm"(width) // %2 +- : "r"((ptrdiff_t)(src_stride)), // %3 +- "r"((ptrdiff_t)(dst_stride)) // %4 +- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", +- "xmm7"); +-} +-#endif // defined(HAS_TRANSPOSE4X4_32_SSE2) +- +-#if defined(HAS_TRANSPOSE4X4_32_AVX2) +- +-// Transpose 32 bit values (ARGB) +-void Transpose4x4_32_AVX2(const uint8_t* src, +- int src_stride, +- uint8_t* dst, +- int dst_stride, +- int width) { +- asm volatile ( +- // Main loop transpose 2 blocks of 4x4. Read a column, write a row. +- "1: \n" +- "vmovdqu (%0),%%xmm0 \n" // a b c d +- "vmovdqu (%0,%3),%%xmm1 \n" // e f g h +- "lea (%0,%3,2),%0 \n" // src += stride * 2 +- "vmovdqu (%0),%%xmm2 \n" // i j k l +- "vmovdqu (%0,%3),%%xmm3 \n" // m n o p +- "lea (%0,%3,2),%0 \n" // src += stride * 2 +- +- "vinserti128 $1,(%0),%%ymm0,%%ymm0 \n" // a b c d +- "vinserti128 $1,(%0,%3),%%ymm1,%%ymm1 \n" // e f g h +- "lea (%0,%3,2),%0 \n" // src += stride * 2 +- "vinserti128 $1,(%0),%%ymm2,%%ymm2 \n" // i j k l +- "vinserti128 $1,(%0,%3),%%ymm3,%%ymm3 \n" // m n o p +- "lea (%0,%3,2),%0 \n" // src += stride * 2 +- +- // Transpose 2x2 +- "vpunpckldq %%ymm1,%%ymm0,%%ymm4 \n" // a e b f from row 0, 1 +- "vpunpckldq %%ymm3,%%ymm2,%%ymm5 \n" // i m j n from row 2, 3 +- "vpunpckhdq %%ymm1,%%ymm0,%%ymm6 \n" // c g d h from row 0, 1 +- "vpunpckhdq %%ymm3,%%ymm2,%%ymm7 \n" // k o l p from row 2, 3 +- +- // Transpose 4x4 +- "vpunpcklqdq %%ymm5,%%ymm4,%%ymm0 \n" // a e i m from row 0, 1 +- "vpunpckhqdq %%ymm5,%%ymm4,%%ymm1 \n" // b f j n from row 0, 1 +- "vpunpcklqdq %%ymm7,%%ymm6,%%ymm2 \n" // c g k o from row 2, 3 +- "vpunpckhqdq %%ymm7,%%ymm6,%%ymm3 \n" // d h l p from row 2, 3 +- +- "vmovdqu %%ymm0,(%1) \n" +- "lea 32(%1,%4),%1 \n" // dst += stride + 32 +- "vmovdqu %%ymm1,-32(%1) \n" +- "vmovdqu %%ymm2,-32(%1,%4) \n" +- "vmovdqu %%ymm3,-32(%1,%4,2) \n" +- "sub %4,%1 \n" +- "sub $0x8,%2 \n" +- "jg 1b \n" +- "vzeroupper \n" +- : "+r"(src), // %0 +- "+r"(dst), // %1 +- "+rm"(width) // %2 +- : "r"((ptrdiff_t)(src_stride)), // %3 +- "r"((ptrdiff_t)(dst_stride)) // %4 +- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", +- "xmm7"); +-} +-#endif // defined(HAS_TRANSPOSE4X4_32_AVX2) +- + #endif // defined(__x86_64__) || defined(__i386__) + + #ifdef __cplusplus +diff --git a/media/libyuv/libyuv/source/rotate_lsx.cc b/media/libyuv/libyuv/source/rotate_lsx.cc +--- a/media/libyuv/libyuv/source/rotate_lsx.cc ++++ b/media/libyuv/libyuv/source/rotate_lsx.cc +@@ -61,6 +61,16 @@ extern "C" { + _dst += _stride2; \ + } + ++void TransposeWx16_C(const uint8_t* src, ++ int src_stride, ++ uint8_t* dst, ++ int dst_stride, ++ int width) { ++ TransposeWx8_C(src, src_stride, dst, dst_stride, width); ++ TransposeWx8_C((src + 8 * src_stride), src_stride, (dst + 8), dst_stride, ++ width); ++} ++ + void TransposeUVWx16_C(const uint8_t* src, + int src_stride, + uint8_t* dst_a, +diff --git a/media/libyuv/libyuv/source/rotate_neon.cc b/media/libyuv/libyuv/source/rotate_neon.cc +--- a/media/libyuv/libyuv/source/rotate_neon.cc ++++ b/media/libyuv/libyuv/source/rotate_neon.cc +@@ -21,72 +21,177 @@ extern "C" { + #if !defined(LIBYUV_DISABLE_NEON) && defined(__ARM_NEON__) && \ + !defined(__aarch64__) + ++static const uvec8 kVTbl4x4Transpose = {0, 4, 8, 12, 1, 5, 9, 13, ++ 2, 6, 10, 14, 3, 7, 11, 15}; ++ + void TransposeWx8_NEON(const uint8_t* src, + int src_stride, + uint8_t* dst, + int dst_stride, + int width) { +- const uint8_t* temp; +- asm volatile ( ++ const uint8_t* src_temp; ++ asm volatile( + // loops are on blocks of 8. loop will stop when + // counter gets to or below 0. starting the counter + // at w-8 allow for this +- "sub %[width], #8 \n" ++ "sub %5, #8 \n" ++ ++ // handle 8x8 blocks. this should be the majority of the plane ++ "1: \n" ++ "mov %0, %1 \n" ++ ++ "vld1.8 {d0}, [%0], %2 \n" ++ "vld1.8 {d1}, [%0], %2 \n" ++ "vld1.8 {d2}, [%0], %2 \n" ++ "vld1.8 {d3}, [%0], %2 \n" ++ "vld1.8 {d4}, [%0], %2 \n" ++ "vld1.8 {d5}, [%0], %2 \n" ++ "vld1.8 {d6}, [%0], %2 \n" ++ "vld1.8 {d7}, [%0] \n" ++ ++ "vtrn.8 d1, d0 \n" ++ "vtrn.8 d3, d2 \n" ++ "vtrn.8 d5, d4 \n" ++ "vtrn.8 d7, d6 \n" ++ ++ "vtrn.16 d1, d3 \n" ++ "vtrn.16 d0, d2 \n" ++ "vtrn.16 d5, d7 \n" ++ "vtrn.16 d4, d6 \n" ++ ++ "vtrn.32 d1, d5 \n" ++ "vtrn.32 d0, d4 \n" ++ "vtrn.32 d3, d7 \n" ++ "vtrn.32 d2, d6 \n" ++ ++ "vrev16.8 q0, q0 \n" ++ "vrev16.8 q1, q1 \n" ++ "vrev16.8 q2, q2 \n" ++ "vrev16.8 q3, q3 \n" ++ ++ "mov %0, %3 \n" + +- "1: \n" +- "mov %[temp], %[src] \n" +- "vld1.8 {d0}, [%[temp]], %[src_stride] \n" +- "vld1.8 {d1}, [%[temp]], %[src_stride] \n" +- "vld1.8 {d2}, [%[temp]], %[src_stride] \n" +- "vld1.8 {d3}, [%[temp]], %[src_stride] \n" +- "vld1.8 {d4}, [%[temp]], %[src_stride] \n" +- "vld1.8 {d5}, [%[temp]], %[src_stride] \n" +- "vld1.8 {d6}, [%[temp]], %[src_stride] \n" +- "vld1.8 {d7}, [%[temp]] \n" +- "add %[src], #8 \n" ++ "vst1.8 {d1}, [%0], %4 \n" ++ "vst1.8 {d0}, [%0], %4 \n" ++ "vst1.8 {d3}, [%0], %4 \n" ++ "vst1.8 {d2}, [%0], %4 \n" ++ "vst1.8 {d5}, [%0], %4 \n" ++ "vst1.8 {d4}, [%0], %4 \n" ++ "vst1.8 {d7}, [%0], %4 \n" ++ "vst1.8 {d6}, [%0] \n" ++ ++ "add %1, #8 \n" // src += 8 ++ "add %3, %3, %4, lsl #3 \n" // dst += 8 * dst_stride ++ "subs %5, #8 \n" // w -= 8 ++ "bge 1b \n" ++ ++ // add 8 back to counter. if the result is 0 there are ++ // no residuals. ++ "adds %5, #8 \n" ++ "beq 4f \n" + +- "vtrn.8 d1, d0 \n" +- "vtrn.8 d3, d2 \n" +- "vtrn.8 d5, d4 \n" +- "vtrn.8 d7, d6 \n" +- "subs %[width], #8 \n" ++ // some residual, so between 1 and 7 lines left to transpose ++ "cmp %5, #2 \n" ++ "blt 3f \n" ++ ++ "cmp %5, #4 \n" ++ "blt 2f \n" + +- "vtrn.16 d1, d3 \n" +- "vtrn.16 d0, d2 \n" +- "vtrn.16 d5, d7 \n" +- "vtrn.16 d4, d6 \n" ++ // 4x8 block ++ "mov %0, %1 \n" ++ "vld1.32 {d0[0]}, [%0], %2 \n" ++ "vld1.32 {d0[1]}, [%0], %2 \n" ++ "vld1.32 {d1[0]}, [%0], %2 \n" ++ "vld1.32 {d1[1]}, [%0], %2 \n" ++ "vld1.32 {d2[0]}, [%0], %2 \n" ++ "vld1.32 {d2[1]}, [%0], %2 \n" ++ "vld1.32 {d3[0]}, [%0], %2 \n" ++ "vld1.32 {d3[1]}, [%0] \n" ++ ++ "mov %0, %3 \n" + +- "vtrn.32 d1, d5 \n" +- "vtrn.32 d0, d4 \n" +- "vtrn.32 d3, d7 \n" +- "vtrn.32 d2, d6 \n" ++ "vld1.8 {q3}, [%6] \n" ++ ++ "vtbl.8 d4, {d0, d1}, d6 \n" ++ "vtbl.8 d5, {d0, d1}, d7 \n" ++ "vtbl.8 d0, {d2, d3}, d6 \n" ++ "vtbl.8 d1, {d2, d3}, d7 \n" ++ ++ // TODO(frkoenig): Rework shuffle above to ++ // write out with 4 instead of 8 writes. ++ "vst1.32 {d4[0]}, [%0], %4 \n" ++ "vst1.32 {d4[1]}, [%0], %4 \n" ++ "vst1.32 {d5[0]}, [%0], %4 \n" ++ "vst1.32 {d5[1]}, [%0] \n" + +- "vrev16.8 q0, q0 \n" +- "vrev16.8 q1, q1 \n" +- "vrev16.8 q2, q2 \n" +- "vrev16.8 q3, q3 \n" ++ "add %0, %3, #4 \n" ++ "vst1.32 {d0[0]}, [%0], %4 \n" ++ "vst1.32 {d0[1]}, [%0], %4 \n" ++ "vst1.32 {d1[0]}, [%0], %4 \n" ++ "vst1.32 {d1[1]}, [%0] \n" ++ ++ "add %1, #4 \n" // src += 4 ++ "add %3, %3, %4, lsl #2 \n" // dst += 4 * dst_stride ++ "subs %5, #4 \n" // w -= 4 ++ "beq 4f \n" ++ ++ // some residual, check to see if it includes a 2x8 block, ++ // or less ++ "cmp %5, #2 \n" ++ "blt 3f \n" + +- "mov %[temp], %[dst] \n" +- "vst1.8 {d1}, [%[temp]], %[dst_stride] \n" +- "vst1.8 {d0}, [%[temp]], %[dst_stride] \n" +- "vst1.8 {d3}, [%[temp]], %[dst_stride] \n" +- "vst1.8 {d2}, [%[temp]], %[dst_stride] \n" +- "vst1.8 {d5}, [%[temp]], %[dst_stride] \n" +- "vst1.8 {d4}, [%[temp]], %[dst_stride] \n" +- "vst1.8 {d7}, [%[temp]], %[dst_stride] \n" +- "vst1.8 {d6}, [%[temp]] \n" +- "add %[dst], %[dst], %[dst_stride], lsl #3 \n" ++ // 2x8 block ++ "2: \n" ++ "mov %0, %1 \n" ++ "vld1.16 {d0[0]}, [%0], %2 \n" ++ "vld1.16 {d1[0]}, [%0], %2 \n" ++ "vld1.16 {d0[1]}, [%0], %2 \n" ++ "vld1.16 {d1[1]}, [%0], %2 \n" ++ "vld1.16 {d0[2]}, [%0], %2 \n" ++ "vld1.16 {d1[2]}, [%0], %2 \n" ++ "vld1.16 {d0[3]}, [%0], %2 \n" ++ "vld1.16 {d1[3]}, [%0] \n" ++ ++ "vtrn.8 d0, d1 \n" ++ ++ "mov %0, %3 \n" ++ ++ "vst1.64 {d0}, [%0], %4 \n" ++ "vst1.64 {d1}, [%0] \n" + +- "bge 1b \n" +- : [temp] "=&r"(temp), // %[temp] +- [src] "+r"(src), // %[src] +- [dst] "+r"(dst), // %[dst] +- [width] "+r"(width) // %[width] +- : [src_stride] "r"(src_stride), // %[src_stride] +- [dst_stride] "r"(dst_stride) // %[dst_stride] ++ "add %1, #2 \n" // src += 2 ++ "add %3, %3, %4, lsl #1 \n" // dst += 2 * dst_stride ++ "subs %5, #2 \n" // w -= 2 ++ "beq 4f \n" ++ ++ // 1x8 block ++ "3: \n" ++ "vld1.8 {d0[0]}, [%1], %2 \n" ++ "vld1.8 {d0[1]}, [%1], %2 \n" ++ "vld1.8 {d0[2]}, [%1], %2 \n" ++ "vld1.8 {d0[3]}, [%1], %2 \n" ++ "vld1.8 {d0[4]}, [%1], %2 \n" ++ "vld1.8 {d0[5]}, [%1], %2 \n" ++ "vld1.8 {d0[6]}, [%1], %2 \n" ++ "vld1.8 {d0[7]}, [%1] \n" ++ ++ "vst1.64 {d0}, [%3] \n" ++ ++ "4: \n" ++ ++ : "=&r"(src_temp), // %0 ++ "+r"(src), // %1 ++ "+r"(src_stride), // %2 ++ "+r"(dst), // %3 ++ "+r"(dst_stride), // %4 ++ "+r"(width) // %5 ++ : "r"(&kVTbl4x4Transpose) // %6 + : "memory", "cc", "q0", "q1", "q2", "q3"); + } + ++static const uvec8 kVTbl4x4TransposeDi = {0, 8, 1, 9, 2, 10, 3, 11, ++ 4, 12, 5, 13, 6, 14, 7, 15}; ++ + void TransposeUVWx8_NEON(const uint8_t* src, + int src_stride, + uint8_t* dst_a, +@@ -94,123 +199,217 @@ void TransposeUVWx8_NEON(const uint8_t* + uint8_t* dst_b, + int dst_stride_b, + int width) { +- const uint8_t* temp; +- asm volatile ( ++ const uint8_t* src_temp; ++ asm volatile( + // loops are on blocks of 8. loop will stop when + // counter gets to or below 0. starting the counter + // at w-8 allow for this +- "sub %[width], #8 \n" ++ "sub %7, #8 \n" ++ ++ // handle 8x8 blocks. this should be the majority of the plane ++ "1: \n" ++ "mov %0, %1 \n" ++ ++ "vld2.8 {d0, d1}, [%0], %2 \n" ++ "vld2.8 {d2, d3}, [%0], %2 \n" ++ "vld2.8 {d4, d5}, [%0], %2 \n" ++ "vld2.8 {d6, d7}, [%0], %2 \n" ++ "vld2.8 {d16, d17}, [%0], %2 \n" ++ "vld2.8 {d18, d19}, [%0], %2 \n" ++ "vld2.8 {d20, d21}, [%0], %2 \n" ++ "vld2.8 {d22, d23}, [%0] \n" ++ ++ "vtrn.8 q1, q0 \n" ++ "vtrn.8 q3, q2 \n" ++ "vtrn.8 q9, q8 \n" ++ "vtrn.8 q11, q10 \n" + +- "1: \n" +- "mov %[temp], %[src] \n" +- "vld2.8 {d0, d1}, [%[temp]], %[src_stride] \n" +- "vld2.8 {d2, d3}, [%[temp]], %[src_stride] \n" +- "vld2.8 {d4, d5}, [%[temp]], %[src_stride] \n" +- "vld2.8 {d6, d7}, [%[temp]], %[src_stride] \n" +- "vld2.8 {d16, d17}, [%[temp]], %[src_stride] \n" +- "vld2.8 {d18, d19}, [%[temp]], %[src_stride] \n" +- "vld2.8 {d20, d21}, [%[temp]], %[src_stride] \n" +- "vld2.8 {d22, d23}, [%[temp]] \n" +- "add %[src], #8*2 \n" ++ "vtrn.16 q1, q3 \n" ++ "vtrn.16 q0, q2 \n" ++ "vtrn.16 q9, q11 \n" ++ "vtrn.16 q8, q10 \n" ++ ++ "vtrn.32 q1, q9 \n" ++ "vtrn.32 q0, q8 \n" ++ "vtrn.32 q3, q11 \n" ++ "vtrn.32 q2, q10 \n" ++ ++ "vrev16.8 q0, q0 \n" ++ "vrev16.8 q1, q1 \n" ++ "vrev16.8 q2, q2 \n" ++ "vrev16.8 q3, q3 \n" ++ "vrev16.8 q8, q8 \n" ++ "vrev16.8 q9, q9 \n" ++ "vrev16.8 q10, q10 \n" ++ "vrev16.8 q11, q11 \n" ++ ++ "mov %0, %3 \n" + +- "vtrn.8 q1, q0 \n" +- "vtrn.8 q3, q2 \n" +- "vtrn.8 q9, q8 \n" +- "vtrn.8 q11, q10 \n" +- "subs %[width], #8 \n" ++ "vst1.8 {d2}, [%0], %4 \n" ++ "vst1.8 {d0}, [%0], %4 \n" ++ "vst1.8 {d6}, [%0], %4 \n" ++ "vst1.8 {d4}, [%0], %4 \n" ++ "vst1.8 {d18}, [%0], %4 \n" ++ "vst1.8 {d16}, [%0], %4 \n" ++ "vst1.8 {d22}, [%0], %4 \n" ++ "vst1.8 {d20}, [%0] \n" ++ ++ "mov %0, %5 \n" ++ ++ "vst1.8 {d3}, [%0], %6 \n" ++ "vst1.8 {d1}, [%0], %6 \n" ++ "vst1.8 {d7}, [%0], %6 \n" ++ "vst1.8 {d5}, [%0], %6 \n" ++ "vst1.8 {d19}, [%0], %6 \n" ++ "vst1.8 {d17}, [%0], %6 \n" ++ "vst1.8 {d23}, [%0], %6 \n" ++ "vst1.8 {d21}, [%0] \n" ++ ++ "add %1, #8*2 \n" // src += 8*2 ++ "add %3, %3, %4, lsl #3 \n" // dst_a += 8 * ++ // dst_stride_a ++ "add %5, %5, %6, lsl #3 \n" // dst_b += 8 * ++ // dst_stride_b ++ "subs %7, #8 \n" // w -= 8 ++ "bge 1b \n" + +- "vtrn.16 q1, q3 \n" +- "vtrn.16 q0, q2 \n" +- "vtrn.16 q9, q11 \n" +- "vtrn.16 q8, q10 \n" ++ // add 8 back to counter. if the result is 0 there are ++ // no residuals. ++ "adds %7, #8 \n" ++ "beq 4f \n" ++ ++ // some residual, so between 1 and 7 lines left to transpose ++ "cmp %7, #2 \n" ++ "blt 3f \n" ++ ++ "cmp %7, #4 \n" ++ "blt 2f \n" + +- "vtrn.32 q1, q9 \n" +- "vtrn.32 q0, q8 \n" +- "vtrn.32 q3, q11 \n" +- "vtrn.32 q2, q10 \n" ++ // TODO(frkoenig): Clean this up ++ // 4x8 block ++ "mov %0, %1 \n" ++ "vld1.64 {d0}, [%0], %2 \n" ++ "vld1.64 {d1}, [%0], %2 \n" ++ "vld1.64 {d2}, [%0], %2 \n" ++ "vld1.64 {d3}, [%0], %2 \n" ++ "vld1.64 {d4}, [%0], %2 \n" ++ "vld1.64 {d5}, [%0], %2 \n" ++ "vld1.64 {d6}, [%0], %2 \n" ++ "vld1.64 {d7}, [%0] \n" ++ ++ "vld1.8 {q15}, [%8] \n" ++ ++ "vtrn.8 q0, q1 \n" ++ "vtrn.8 q2, q3 \n" + +- "vrev16.8 q0, q0 \n" +- "vrev16.8 q1, q1 \n" +- "vrev16.8 q2, q2 \n" +- "vrev16.8 q3, q3 \n" +- "vrev16.8 q8, q8 \n" +- "vrev16.8 q9, q9 \n" +- "vrev16.8 q10, q10 \n" +- "vrev16.8 q11, q11 \n" ++ "vtbl.8 d16, {d0, d1}, d30 \n" ++ "vtbl.8 d17, {d0, d1}, d31 \n" ++ "vtbl.8 d18, {d2, d3}, d30 \n" ++ "vtbl.8 d19, {d2, d3}, d31 \n" ++ "vtbl.8 d20, {d4, d5}, d30 \n" ++ "vtbl.8 d21, {d4, d5}, d31 \n" ++ "vtbl.8 d22, {d6, d7}, d30 \n" ++ "vtbl.8 d23, {d6, d7}, d31 \n" ++ ++ "mov %0, %3 \n" ++ ++ "vst1.32 {d16[0]}, [%0], %4 \n" ++ "vst1.32 {d16[1]}, [%0], %4 \n" ++ "vst1.32 {d17[0]}, [%0], %4 \n" ++ "vst1.32 {d17[1]}, [%0], %4 \n" ++ ++ "add %0, %3, #4 \n" ++ "vst1.32 {d20[0]}, [%0], %4 \n" ++ "vst1.32 {d20[1]}, [%0], %4 \n" ++ "vst1.32 {d21[0]}, [%0], %4 \n" ++ "vst1.32 {d21[1]}, [%0] \n" ++ ++ "mov %0, %5 \n" + +- "mov %[temp], %[dst_a] \n" +- "vst1.8 {d2}, [%[temp]], %[dst_stride_a] \n" +- "vst1.8 {d0}, [%[temp]], %[dst_stride_a] \n" +- "vst1.8 {d6}, [%[temp]], %[dst_stride_a] \n" +- "vst1.8 {d4}, [%[temp]], %[dst_stride_a] \n" +- "vst1.8 {d18}, [%[temp]], %[dst_stride_a] \n" +- "vst1.8 {d16}, [%[temp]], %[dst_stride_a] \n" +- "vst1.8 {d22}, [%[temp]], %[dst_stride_a] \n" +- "vst1.8 {d20}, [%[temp]] \n" +- "add %[dst_a], %[dst_a], %[dst_stride_a], lsl #3 \n" ++ "vst1.32 {d18[0]}, [%0], %6 \n" ++ "vst1.32 {d18[1]}, [%0], %6 \n" ++ "vst1.32 {d19[0]}, [%0], %6 \n" ++ "vst1.32 {d19[1]}, [%0], %6 \n" ++ ++ "add %0, %5, #4 \n" ++ "vst1.32 {d22[0]}, [%0], %6 \n" ++ "vst1.32 {d22[1]}, [%0], %6 \n" ++ "vst1.32 {d23[0]}, [%0], %6 \n" ++ "vst1.32 {d23[1]}, [%0] \n" ++ ++ "add %1, #4*2 \n" // src += 4 * 2 ++ "add %3, %3, %4, lsl #2 \n" // dst_a += 4 * ++ // dst_stride_a ++ "add %5, %5, %6, lsl #2 \n" // dst_b += 4 * ++ // dst_stride_b ++ "subs %7, #4 \n" // w -= 4 ++ "beq 4f \n" ++ ++ // some residual, check to see if it includes a 2x8 block, ++ // or less ++ "cmp %7, #2 \n" ++ "blt 3f \n" + +- "mov %[temp], %[dst_b] \n" +- "vst1.8 {d3}, [%[temp]], %[dst_stride_b] \n" +- "vst1.8 {d1}, [%[temp]], %[dst_stride_b] \n" +- "vst1.8 {d7}, [%[temp]], %[dst_stride_b] \n" +- "vst1.8 {d5}, [%[temp]], %[dst_stride_b] \n" +- "vst1.8 {d19}, [%[temp]], %[dst_stride_b] \n" +- "vst1.8 {d17}, [%[temp]], %[dst_stride_b] \n" +- "vst1.8 {d23}, [%[temp]], %[dst_stride_b] \n" +- "vst1.8 {d21}, [%[temp]] \n" +- "add %[dst_b], %[dst_b], %[dst_stride_b], lsl #3 \n" ++ // 2x8 block ++ "2: \n" ++ "mov %0, %1 \n" ++ "vld2.16 {d0[0], d2[0]}, [%0], %2 \n" ++ "vld2.16 {d1[0], d3[0]}, [%0], %2 \n" ++ "vld2.16 {d0[1], d2[1]}, [%0], %2 \n" ++ "vld2.16 {d1[1], d3[1]}, [%0], %2 \n" ++ "vld2.16 {d0[2], d2[2]}, [%0], %2 \n" ++ "vld2.16 {d1[2], d3[2]}, [%0], %2 \n" ++ "vld2.16 {d0[3], d2[3]}, [%0], %2 \n" ++ "vld2.16 {d1[3], d3[3]}, [%0] \n" ++ ++ "vtrn.8 d0, d1 \n" ++ "vtrn.8 d2, d3 \n" ++ ++ "mov %0, %3 \n" ++ ++ "vst1.64 {d0}, [%0], %4 \n" ++ "vst1.64 {d2}, [%0] \n" ++ ++ "mov %0, %5 \n" ++ ++ "vst1.64 {d1}, [%0], %6 \n" ++ "vst1.64 {d3}, [%0] \n" + +- "bge 1b \n" +- : [temp] "=&r"(temp), // %[temp] +- [src] "+r"(src), // %[src] +- [dst_a] "+r"(dst_a), // %[dst_a] +- [dst_b] "+r"(dst_b), // %[dst_b] +- [width] "+r"(width) // %[width] +- : [src_stride] "r"(src_stride), // %[src_stride] +- [dst_stride_a] "r"(dst_stride_a), // %[dst_stride_a] +- [dst_stride_b] "r"(dst_stride_b) // %[dst_stride_b] ++ "add %1, #2*2 \n" // src += 2 * 2 ++ "add %3, %3, %4, lsl #1 \n" // dst_a += 2 * ++ // dst_stride_a ++ "add %5, %5, %6, lsl #1 \n" // dst_b += 2 * ++ // dst_stride_b ++ "subs %7, #2 \n" // w -= 2 ++ "beq 4f \n" ++ ++ // 1x8 block ++ "3: \n" ++ "vld2.8 {d0[0], d1[0]}, [%1], %2 \n" ++ "vld2.8 {d0[1], d1[1]}, [%1], %2 \n" ++ "vld2.8 {d0[2], d1[2]}, [%1], %2 \n" ++ "vld2.8 {d0[3], d1[3]}, [%1], %2 \n" ++ "vld2.8 {d0[4], d1[4]}, [%1], %2 \n" ++ "vld2.8 {d0[5], d1[5]}, [%1], %2 \n" ++ "vld2.8 {d0[6], d1[6]}, [%1], %2 \n" ++ "vld2.8 {d0[7], d1[7]}, [%1] \n" ++ ++ "vst1.64 {d0}, [%3] \n" ++ "vst1.64 {d1}, [%5] \n" ++ ++ "4: \n" ++ ++ : "=&r"(src_temp), // %0 ++ "+r"(src), // %1 ++ "+r"(src_stride), // %2 ++ "+r"(dst_a), // %3 ++ "+r"(dst_stride_a), // %4 ++ "+r"(dst_b), // %5 ++ "+r"(dst_stride_b), // %6 ++ "+r"(width) // %7 ++ : "r"(&kVTbl4x4TransposeDi) // %8 + : "memory", "cc", "q0", "q1", "q2", "q3", "q8", "q9", "q10", "q11"); + } +- +-// Transpose 32 bit values (ARGB) +-void Transpose4x4_32_NEON(const uint8_t* src, +- int src_stride, +- uint8_t* dst, +- int dst_stride, +- int width) { +- const uint8_t* src1 = src + src_stride; +- const uint8_t* src2 = src1 + src_stride; +- const uint8_t* src3 = src2 + src_stride; +- uint8_t* dst1 = dst + dst_stride; +- uint8_t* dst2 = dst1 + dst_stride; +- uint8_t* dst3 = dst2 + dst_stride; +- asm volatile ( +- // Main loop transpose 4x4. Read a column, write a row. +- "1: \n" +- "vld4.32 {d0[0], d2[0], d4[0], d6[0]}, [%0], %9 \n" +- "vld4.32 {d0[1], d2[1], d4[1], d6[1]}, [%1], %9 \n" +- "vld4.32 {d1[0], d3[0], d5[0], d7[0]}, [%2], %9 \n" +- "vld4.32 {d1[1], d3[1], d5[1], d7[1]}, [%3], %9 \n" +- "subs %8, %8, #4 \n" // w -= 4 +- "vst1.8 {q0}, [%4]! \n" +- "vst1.8 {q1}, [%5]! \n" +- "vst1.8 {q2}, [%6]! \n" +- "vst1.8 {q3}, [%7]! \n" +- "bgt 1b \n" +- +- : "+r"(src), // %0 +- "+r"(src1), // %1 +- "+r"(src2), // %2 +- "+r"(src3), // %3 +- "+r"(dst), // %4 +- "+r"(dst1), // %5 +- "+r"(dst2), // %6 +- "+r"(dst3), // %7 +- "+r"(width) // %8 +- : "r"((ptrdiff_t)(src_stride * 4)) // %9 +- : "memory", "cc", "q0", "q1", "q2", "q3"); +-} +- + #endif // defined(__ARM_NEON__) && !defined(__aarch64__) + + #ifdef __cplusplus +diff --git a/media/libyuv/libyuv/source/rotate_neon64.cc b/media/libyuv/libyuv/source/rotate_neon64.cc +--- a/media/libyuv/libyuv/source/rotate_neon64.cc ++++ b/media/libyuv/libyuv/source/rotate_neon64.cc +@@ -21,122 +21,201 @@ extern "C" { + // This module is for GCC Neon armv8 64 bit. + #if !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__) + +-void TransposeWx16_NEON(const uint8_t* src, +- int src_stride, +- uint8_t* dst, +- int dst_stride, +- int width) { ++static const uvec8 kVTbl4x4Transpose = {0, 4, 8, 12, 1, 5, 9, 13, ++ 2, 6, 10, 14, 3, 7, 11, 15}; ++ ++void TransposeWx8_NEON(const uint8_t* src, ++ int src_stride, ++ uint8_t* dst, ++ int dst_stride, ++ int width) { + const uint8_t* src_temp; +- asm volatile ( +- "1: \n" +- "mov %[src_temp], %[src] \n" ++ asm volatile( ++ // loops are on blocks of 8. loop will stop when ++ // counter gets to or below 0. starting the counter ++ // at w-8 allow for this ++ "sub %w3, %w3, #8 \n" ++ ++ // handle 8x8 blocks. this should be the majority of the plane ++ "1: \n" ++ "mov %0, %1 \n" ++ ++ "ld1 {v0.8b}, [%0], %5 \n" ++ "ld1 {v1.8b}, [%0], %5 \n" ++ "ld1 {v2.8b}, [%0], %5 \n" ++ "ld1 {v3.8b}, [%0], %5 \n" ++ "ld1 {v4.8b}, [%0], %5 \n" ++ "ld1 {v5.8b}, [%0], %5 \n" ++ "ld1 {v6.8b}, [%0], %5 \n" ++ "ld1 {v7.8b}, [%0] \n" ++ "mov %0, %1 \n" ++ ++ "trn2 v16.8b, v0.8b, v1.8b \n" ++ "prfm pldl1keep, [%0, 448] \n" // prefetch 7 lines ahead ++ "trn1 v17.8b, v0.8b, v1.8b \n" ++ "add %0, %0, %5 \n" ++ "trn2 v18.8b, v2.8b, v3.8b \n" ++ "prfm pldl1keep, [%0, 448] \n" // row 1 ++ "trn1 v19.8b, v2.8b, v3.8b \n" ++ "add %0, %0, %5 \n" ++ "trn2 v20.8b, v4.8b, v5.8b \n" ++ "prfm pldl1keep, [%0, 448] \n" // row 2 ++ "trn1 v21.8b, v4.8b, v5.8b \n" ++ "add %0, %0, %5 \n" ++ "trn2 v22.8b, v6.8b, v7.8b \n" ++ "prfm pldl1keep, [%0, 448] \n" // row 3 ++ "trn1 v23.8b, v6.8b, v7.8b \n" ++ "add %0, %0, %5 \n" + +- "ld1 {v16.16b}, [%[src_temp]], %[src_stride] \n" +- "ld1 {v17.16b}, [%[src_temp]], %[src_stride] \n" +- "ld1 {v18.16b}, [%[src_temp]], %[src_stride] \n" +- "ld1 {v19.16b}, [%[src_temp]], %[src_stride] \n" +- "ld1 {v20.16b}, [%[src_temp]], %[src_stride] \n" +- "ld1 {v21.16b}, [%[src_temp]], %[src_stride] \n" +- "ld1 {v22.16b}, [%[src_temp]], %[src_stride] \n" +- "ld1 {v23.16b}, [%[src_temp]], %[src_stride] \n" +- "ld1 {v24.16b}, [%[src_temp]], %[src_stride] \n" +- "ld1 {v25.16b}, [%[src_temp]], %[src_stride] \n" +- "ld1 {v26.16b}, [%[src_temp]], %[src_stride] \n" +- "ld1 {v27.16b}, [%[src_temp]], %[src_stride] \n" +- "ld1 {v28.16b}, [%[src_temp]], %[src_stride] \n" +- "ld1 {v29.16b}, [%[src_temp]], %[src_stride] \n" +- "ld1 {v30.16b}, [%[src_temp]], %[src_stride] \n" +- "ld1 {v31.16b}, [%[src_temp]], %[src_stride] \n" ++ "trn2 v3.4h, v17.4h, v19.4h \n" ++ "prfm pldl1keep, [%0, 448] \n" // row 4 ++ "trn1 v1.4h, v17.4h, v19.4h \n" ++ "add %0, %0, %5 \n" ++ "trn2 v2.4h, v16.4h, v18.4h \n" ++ "prfm pldl1keep, [%0, 448] \n" // row 5 ++ "trn1 v0.4h, v16.4h, v18.4h \n" ++ "add %0, %0, %5 \n" ++ "trn2 v7.4h, v21.4h, v23.4h \n" ++ "prfm pldl1keep, [%0, 448] \n" // row 6 ++ "trn1 v5.4h, v21.4h, v23.4h \n" ++ "add %0, %0, %5 \n" ++ "trn2 v6.4h, v20.4h, v22.4h \n" ++ "prfm pldl1keep, [%0, 448] \n" // row 7 ++ "trn1 v4.4h, v20.4h, v22.4h \n" ++ ++ "trn2 v21.2s, v1.2s, v5.2s \n" ++ "trn1 v17.2s, v1.2s, v5.2s \n" ++ "trn2 v20.2s, v0.2s, v4.2s \n" ++ "trn1 v16.2s, v0.2s, v4.2s \n" ++ "trn2 v23.2s, v3.2s, v7.2s \n" ++ "trn1 v19.2s, v3.2s, v7.2s \n" ++ "trn2 v22.2s, v2.2s, v6.2s \n" ++ "trn1 v18.2s, v2.2s, v6.2s \n" + +- "add %[src], %[src], #16 \n" ++ "mov %0, %2 \n" ++ ++ "st1 {v17.8b}, [%0], %6 \n" ++ "st1 {v16.8b}, [%0], %6 \n" ++ "st1 {v19.8b}, [%0], %6 \n" ++ "st1 {v18.8b}, [%0], %6 \n" ++ "st1 {v21.8b}, [%0], %6 \n" ++ "st1 {v20.8b}, [%0], %6 \n" ++ "st1 {v23.8b}, [%0], %6 \n" ++ "st1 {v22.8b}, [%0] \n" + +- // Transpose bytes within each 2x2 block. +- "trn1 v0.16b, v16.16b, v17.16b \n" +- "trn2 v1.16b, v16.16b, v17.16b \n" +- "trn1 v2.16b, v18.16b, v19.16b \n" +- "trn2 v3.16b, v18.16b, v19.16b \n" +- "trn1 v4.16b, v20.16b, v21.16b \n" +- "trn2 v5.16b, v20.16b, v21.16b \n" +- "trn1 v6.16b, v22.16b, v23.16b \n" +- "trn2 v7.16b, v22.16b, v23.16b \n" +- "trn1 v8.16b, v24.16b, v25.16b \n" +- "trn2 v9.16b, v24.16b, v25.16b \n" +- "trn1 v10.16b, v26.16b, v27.16b \n" +- "trn2 v11.16b, v26.16b, v27.16b \n" +- "trn1 v12.16b, v28.16b, v29.16b \n" +- "trn2 v13.16b, v28.16b, v29.16b \n" +- "trn1 v14.16b, v30.16b, v31.16b \n" +- "trn2 v15.16b, v30.16b, v31.16b \n" ++ "add %1, %1, #8 \n" // src += 8 ++ "add %2, %2, %6, lsl #3 \n" // dst += 8 * dst_stride ++ "subs %w3, %w3, #8 \n" // w -= 8 ++ "b.ge 1b \n" ++ ++ // add 8 back to counter. if the result is 0 there are ++ // no residuals. ++ "adds %w3, %w3, #8 \n" ++ "b.eq 4f \n" ++ ++ // some residual, so between 1 and 7 lines left to transpose ++ "cmp %w3, #2 \n" ++ "b.lt 3f \n" + +- // Transpose 2x2-byte blocks within each 4x4 block. +- "trn1 v16.8h, v0.8h, v2.8h \n" +- "trn1 v17.8h, v1.8h, v3.8h \n" +- "trn2 v18.8h, v0.8h, v2.8h \n" +- "trn2 v19.8h, v1.8h, v3.8h \n" +- "trn1 v20.8h, v4.8h, v6.8h \n" +- "trn1 v21.8h, v5.8h, v7.8h \n" +- "trn2 v22.8h, v4.8h, v6.8h \n" +- "trn2 v23.8h, v5.8h, v7.8h \n" +- "trn1 v24.8h, v8.8h, v10.8h \n" +- "trn1 v25.8h, v9.8h, v11.8h \n" +- "trn2 v26.8h, v8.8h, v10.8h \n" +- "trn2 v27.8h, v9.8h, v11.8h \n" +- "trn1 v28.8h, v12.8h, v14.8h \n" +- "trn1 v29.8h, v13.8h, v15.8h \n" +- "trn2 v30.8h, v12.8h, v14.8h \n" +- "trn2 v31.8h, v13.8h, v15.8h \n" ++ "cmp %w3, #4 \n" ++ "b.lt 2f \n" ++ ++ // 4x8 block ++ "mov %0, %1 \n" ++ "ld1 {v0.s}[0], [%0], %5 \n" ++ "ld1 {v0.s}[1], [%0], %5 \n" ++ "ld1 {v0.s}[2], [%0], %5 \n" ++ "ld1 {v0.s}[3], [%0], %5 \n" ++ "ld1 {v1.s}[0], [%0], %5 \n" ++ "ld1 {v1.s}[1], [%0], %5 \n" ++ "ld1 {v1.s}[2], [%0], %5 \n" ++ "ld1 {v1.s}[3], [%0] \n" ++ ++ "mov %0, %2 \n" ++ ++ "ld1 {v2.16b}, [%4] \n" ++ ++ "tbl v3.16b, {v0.16b}, v2.16b \n" ++ "tbl v0.16b, {v1.16b}, v2.16b \n" + +- "subs %w[width], %w[width], #16 \n" ++ // TODO(frkoenig): Rework shuffle above to ++ // write out with 4 instead of 8 writes. ++ "st1 {v3.s}[0], [%0], %6 \n" ++ "st1 {v3.s}[1], [%0], %6 \n" ++ "st1 {v3.s}[2], [%0], %6 \n" ++ "st1 {v3.s}[3], [%0] \n" ++ ++ "add %0, %2, #4 \n" ++ "st1 {v0.s}[0], [%0], %6 \n" ++ "st1 {v0.s}[1], [%0], %6 \n" ++ "st1 {v0.s}[2], [%0], %6 \n" ++ "st1 {v0.s}[3], [%0] \n" ++ ++ "add %1, %1, #4 \n" // src += 4 ++ "add %2, %2, %6, lsl #2 \n" // dst += 4 * dst_stride ++ "subs %w3, %w3, #4 \n" // w -= 4 ++ "b.eq 4f \n" ++ ++ // some residual, check to see if it includes a 2x8 block, ++ // or less ++ "cmp %w3, #2 \n" ++ "b.lt 3f \n" + +- // Transpose 4x4-byte blocks within each 8x8 block. +- "trn1 v0.4s, v16.4s, v20.4s \n" +- "trn1 v2.4s, v17.4s, v21.4s \n" +- "trn1 v4.4s, v18.4s, v22.4s \n" +- "trn1 v6.4s, v19.4s, v23.4s \n" +- "trn2 v8.4s, v16.4s, v20.4s \n" +- "trn2 v10.4s, v17.4s, v21.4s \n" +- "trn2 v12.4s, v18.4s, v22.4s \n" +- "trn2 v14.4s, v19.4s, v23.4s \n" +- "trn1 v1.4s, v24.4s, v28.4s \n" +- "trn1 v3.4s, v25.4s, v29.4s \n" +- "trn1 v5.4s, v26.4s, v30.4s \n" +- "trn1 v7.4s, v27.4s, v31.4s \n" +- "trn2 v9.4s, v24.4s, v28.4s \n" +- "trn2 v11.4s, v25.4s, v29.4s \n" +- "trn2 v13.4s, v26.4s, v30.4s \n" +- "trn2 v15.4s, v27.4s, v31.4s \n" ++ // 2x8 block ++ "2: \n" ++ "mov %0, %1 \n" ++ "ld1 {v0.h}[0], [%0], %5 \n" ++ "ld1 {v1.h}[0], [%0], %5 \n" ++ "ld1 {v0.h}[1], [%0], %5 \n" ++ "ld1 {v1.h}[1], [%0], %5 \n" ++ "ld1 {v0.h}[2], [%0], %5 \n" ++ "ld1 {v1.h}[2], [%0], %5 \n" ++ "ld1 {v0.h}[3], [%0], %5 \n" ++ "ld1 {v1.h}[3], [%0] \n" ++ ++ "trn2 v2.8b, v0.8b, v1.8b \n" ++ "trn1 v3.8b, v0.8b, v1.8b \n" ++ ++ "mov %0, %2 \n" ++ ++ "st1 {v3.8b}, [%0], %6 \n" ++ "st1 {v2.8b}, [%0] \n" ++ ++ "add %1, %1, #2 \n" // src += 2 ++ "add %2, %2, %6, lsl #1 \n" // dst += 2 * dst_stride ++ "subs %w3, %w3, #2 \n" // w -= 2 ++ "b.eq 4f \n" + +- // Transpose 8x8-byte blocks and store. +- "st2 {v0.d, v1.d}[0], [%[dst]], %[dst_stride] \n" +- "st2 {v2.d, v3.d}[0], [%[dst]], %[dst_stride] \n" +- "st2 {v4.d, v5.d}[0], [%[dst]], %[dst_stride] \n" +- "st2 {v6.d, v7.d}[0], [%[dst]], %[dst_stride] \n" +- "st2 {v8.d, v9.d}[0], [%[dst]], %[dst_stride] \n" +- "st2 {v10.d, v11.d}[0], [%[dst]], %[dst_stride] \n" +- "st2 {v12.d, v13.d}[0], [%[dst]], %[dst_stride] \n" +- "st2 {v14.d, v15.d}[0], [%[dst]], %[dst_stride] \n" +- "st2 {v0.d, v1.d}[1], [%[dst]], %[dst_stride] \n" +- "st2 {v2.d, v3.d}[1], [%[dst]], %[dst_stride] \n" +- "st2 {v4.d, v5.d}[1], [%[dst]], %[dst_stride] \n" +- "st2 {v6.d, v7.d}[1], [%[dst]], %[dst_stride] \n" +- "st2 {v8.d, v9.d}[1], [%[dst]], %[dst_stride] \n" +- "st2 {v10.d, v11.d}[1], [%[dst]], %[dst_stride] \n" +- "st2 {v12.d, v13.d}[1], [%[dst]], %[dst_stride] \n" +- "st2 {v14.d, v15.d}[1], [%[dst]], %[dst_stride] \n" ++ // 1x8 block ++ "3: \n" ++ "ld1 {v0.b}[0], [%1], %5 \n" ++ "ld1 {v0.b}[1], [%1], %5 \n" ++ "ld1 {v0.b}[2], [%1], %5 \n" ++ "ld1 {v0.b}[3], [%1], %5 \n" ++ "ld1 {v0.b}[4], [%1], %5 \n" ++ "ld1 {v0.b}[5], [%1], %5 \n" ++ "ld1 {v0.b}[6], [%1], %5 \n" ++ "ld1 {v0.b}[7], [%1] \n" ++ ++ "st1 {v0.8b}, [%2] \n" ++ ++ "4: \n" + +- "b.gt 1b \n" +- : [src] "+r"(src), // %[src] +- [src_temp] "=&r"(src_temp), // %[src_temp] +- [dst] "+r"(dst), // %[dst] +- [width] "+r"(width) // %[width] +- : [src_stride] "r"((ptrdiff_t)src_stride), // %[src_stride] +- [dst_stride] "r"((ptrdiff_t)dst_stride) // %[dst_stride] +- : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", +- "v9", "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", "v18", +- "v19", "v20", "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", +- "v29", "v30", "v31"); ++ : "=&r"(src_temp), // %0 ++ "+r"(src), // %1 ++ "+r"(dst), // %2 ++ "+r"(width) // %3 ++ : "r"(&kVTbl4x4Transpose), // %4 ++ "r"((ptrdiff_t)src_stride), // %5 ++ "r"((ptrdiff_t)dst_stride) // %6 ++ : "memory", "cc", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", ++ "v17", "v18", "v19", "v20", "v21", "v22", "v23"); + } + ++static const uint8_t kVTbl4x4TransposeDi[32] = { ++ 0, 16, 32, 48, 2, 18, 34, 50, 4, 20, 36, 52, 6, 22, 38, 54, ++ 1, 17, 33, 49, 3, 19, 35, 51, 5, 21, 37, 53, 7, 23, 39, 55}; ++ + void TransposeUVWx8_NEON(const uint8_t* src, + int src_stride, + uint8_t* dst_a, +@@ -144,85 +223,215 @@ void TransposeUVWx8_NEON(const uint8_t* + uint8_t* dst_b, + int dst_stride_b, + int width) { +- const uint8_t* temp; +- asm volatile ( ++ const uint8_t* src_temp; ++ asm volatile( + // loops are on blocks of 8. loop will stop when + // counter gets to or below 0. starting the counter + // at w-8 allow for this +- "sub %w[width], %w[width], #8 \n" ++ "sub %w4, %w4, #8 \n" ++ ++ // handle 8x8 blocks. this should be the majority of the plane ++ "1: \n" ++ "mov %0, %1 \n" ++ ++ "ld1 {v0.16b}, [%0], %5 \n" ++ "ld1 {v1.16b}, [%0], %5 \n" ++ "ld1 {v2.16b}, [%0], %5 \n" ++ "ld1 {v3.16b}, [%0], %5 \n" ++ "ld1 {v4.16b}, [%0], %5 \n" ++ "ld1 {v5.16b}, [%0], %5 \n" ++ "ld1 {v6.16b}, [%0], %5 \n" ++ "ld1 {v7.16b}, [%0] \n" ++ "mov %0, %1 \n" + +- "1: \n" +- "mov %[temp], %[src] \n" +- "ld1 {v0.16b}, [%[temp]], %[src_stride] \n" +- "ld1 {v1.16b}, [%[temp]], %[src_stride] \n" +- "ld1 {v2.16b}, [%[temp]], %[src_stride] \n" +- "ld1 {v3.16b}, [%[temp]], %[src_stride] \n" +- "ld1 {v4.16b}, [%[temp]], %[src_stride] \n" +- "ld1 {v5.16b}, [%[temp]], %[src_stride] \n" +- "ld1 {v6.16b}, [%[temp]], %[src_stride] \n" +- "ld1 {v7.16b}, [%[temp]] \n" +- "add %[src], %[src], #16 \n" ++ "trn1 v16.16b, v0.16b, v1.16b \n" ++ "trn2 v17.16b, v0.16b, v1.16b \n" ++ "trn1 v18.16b, v2.16b, v3.16b \n" ++ "trn2 v19.16b, v2.16b, v3.16b \n" ++ "trn1 v20.16b, v4.16b, v5.16b \n" ++ "trn2 v21.16b, v4.16b, v5.16b \n" ++ "trn1 v22.16b, v6.16b, v7.16b \n" ++ "trn2 v23.16b, v6.16b, v7.16b \n" ++ ++ "trn1 v0.8h, v16.8h, v18.8h \n" ++ "trn2 v1.8h, v16.8h, v18.8h \n" ++ "trn1 v2.8h, v20.8h, v22.8h \n" ++ "trn2 v3.8h, v20.8h, v22.8h \n" ++ "trn1 v4.8h, v17.8h, v19.8h \n" ++ "trn2 v5.8h, v17.8h, v19.8h \n" ++ "trn1 v6.8h, v21.8h, v23.8h \n" ++ "trn2 v7.8h, v21.8h, v23.8h \n" ++ ++ "trn1 v16.4s, v0.4s, v2.4s \n" ++ "trn2 v17.4s, v0.4s, v2.4s \n" ++ "trn1 v18.4s, v1.4s, v3.4s \n" ++ "trn2 v19.4s, v1.4s, v3.4s \n" ++ "trn1 v20.4s, v4.4s, v6.4s \n" ++ "trn2 v21.4s, v4.4s, v6.4s \n" ++ "trn1 v22.4s, v5.4s, v7.4s \n" ++ "trn2 v23.4s, v5.4s, v7.4s \n" ++ ++ "mov %0, %2 \n" + +- "trn1 v16.16b, v0.16b, v1.16b \n" +- "trn2 v17.16b, v0.16b, v1.16b \n" +- "trn1 v18.16b, v2.16b, v3.16b \n" +- "trn2 v19.16b, v2.16b, v3.16b \n" +- "trn1 v20.16b, v4.16b, v5.16b \n" +- "trn2 v21.16b, v4.16b, v5.16b \n" +- "trn1 v22.16b, v6.16b, v7.16b \n" +- "trn2 v23.16b, v6.16b, v7.16b \n" ++ "st1 {v16.d}[0], [%0], %6 \n" ++ "st1 {v18.d}[0], [%0], %6 \n" ++ "st1 {v17.d}[0], [%0], %6 \n" ++ "st1 {v19.d}[0], [%0], %6 \n" ++ "st1 {v16.d}[1], [%0], %6 \n" ++ "st1 {v18.d}[1], [%0], %6 \n" ++ "st1 {v17.d}[1], [%0], %6 \n" ++ "st1 {v19.d}[1], [%0] \n" ++ ++ "mov %0, %3 \n" ++ ++ "st1 {v20.d}[0], [%0], %7 \n" ++ "st1 {v22.d}[0], [%0], %7 \n" ++ "st1 {v21.d}[0], [%0], %7 \n" ++ "st1 {v23.d}[0], [%0], %7 \n" ++ "st1 {v20.d}[1], [%0], %7 \n" ++ "st1 {v22.d}[1], [%0], %7 \n" ++ "st1 {v21.d}[1], [%0], %7 \n" ++ "st1 {v23.d}[1], [%0] \n" + +- "subs %w[width], %w[width], #8 \n" ++ "add %1, %1, #16 \n" // src += 8*2 ++ "add %2, %2, %6, lsl #3 \n" // dst_a += 8 * ++ // dst_stride_a ++ "add %3, %3, %7, lsl #3 \n" // dst_b += 8 * ++ // dst_stride_b ++ "subs %w4, %w4, #8 \n" // w -= 8 ++ "b.ge 1b \n" ++ ++ // add 8 back to counter. if the result is 0 there are ++ // no residuals. ++ "adds %w4, %w4, #8 \n" ++ "b.eq 4f \n" ++ ++ // some residual, so between 1 and 7 lines left to transpose ++ "cmp %w4, #2 \n" ++ "b.lt 3f \n" + +- "trn1 v0.8h, v16.8h, v18.8h \n" +- "trn2 v1.8h, v16.8h, v18.8h \n" +- "trn1 v2.8h, v20.8h, v22.8h \n" +- "trn2 v3.8h, v20.8h, v22.8h \n" +- "trn1 v4.8h, v17.8h, v19.8h \n" +- "trn2 v5.8h, v17.8h, v19.8h \n" +- "trn1 v6.8h, v21.8h, v23.8h \n" +- "trn2 v7.8h, v21.8h, v23.8h \n" ++ "cmp %w4, #4 \n" ++ "b.lt 2f \n" ++ ++ // TODO(frkoenig): Clean this up ++ // 4x8 block ++ "mov %0, %1 \n" ++ "ld1 {v0.8b}, [%0], %5 \n" ++ "ld1 {v1.8b}, [%0], %5 \n" ++ "ld1 {v2.8b}, [%0], %5 \n" ++ "ld1 {v3.8b}, [%0], %5 \n" ++ "ld1 {v4.8b}, [%0], %5 \n" ++ "ld1 {v5.8b}, [%0], %5 \n" ++ "ld1 {v6.8b}, [%0], %5 \n" ++ "ld1 {v7.8b}, [%0] \n" ++ ++ "ld1 {v30.16b}, [%8], #16 \n" ++ "ld1 {v31.16b}, [%8] \n" + +- "trn1 v16.4s, v0.4s, v2.4s \n" +- "trn2 v17.4s, v0.4s, v2.4s \n" +- "trn1 v18.4s, v1.4s, v3.4s \n" +- "trn2 v19.4s, v1.4s, v3.4s \n" +- "trn1 v20.4s, v4.4s, v6.4s \n" +- "trn2 v21.4s, v4.4s, v6.4s \n" +- "trn1 v22.4s, v5.4s, v7.4s \n" +- "trn2 v23.4s, v5.4s, v7.4s \n" ++ "tbl v16.16b, {v0.16b, v1.16b, v2.16b, v3.16b}, v30.16b \n" ++ "tbl v17.16b, {v0.16b, v1.16b, v2.16b, v3.16b}, v31.16b \n" ++ "tbl v18.16b, {v4.16b, v5.16b, v6.16b, v7.16b}, v30.16b \n" ++ "tbl v19.16b, {v4.16b, v5.16b, v6.16b, v7.16b}, v31.16b \n" ++ ++ "mov %0, %2 \n" ++ ++ "st1 {v16.s}[0], [%0], %6 \n" ++ "st1 {v16.s}[1], [%0], %6 \n" ++ "st1 {v16.s}[2], [%0], %6 \n" ++ "st1 {v16.s}[3], [%0], %6 \n" ++ ++ "add %0, %2, #4 \n" ++ "st1 {v18.s}[0], [%0], %6 \n" ++ "st1 {v18.s}[1], [%0], %6 \n" ++ "st1 {v18.s}[2], [%0], %6 \n" ++ "st1 {v18.s}[3], [%0] \n" ++ ++ "mov %0, %3 \n" + +- "mov %[temp], %[dst_a] \n" +- "st1 {v16.d}[0], [%[temp]], %[dst_stride_a] \n" +- "st1 {v18.d}[0], [%[temp]], %[dst_stride_a] \n" +- "st1 {v17.d}[0], [%[temp]], %[dst_stride_a] \n" +- "st1 {v19.d}[0], [%[temp]], %[dst_stride_a] \n" +- "st1 {v16.d}[1], [%[temp]], %[dst_stride_a] \n" +- "st1 {v18.d}[1], [%[temp]], %[dst_stride_a] \n" +- "st1 {v17.d}[1], [%[temp]], %[dst_stride_a] \n" +- "st1 {v19.d}[1], [%[temp]] \n" +- "add %[dst_a], %[dst_a], %[dst_stride_a], lsl #3 \n" ++ "st1 {v17.s}[0], [%0], %7 \n" ++ "st1 {v17.s}[1], [%0], %7 \n" ++ "st1 {v17.s}[2], [%0], %7 \n" ++ "st1 {v17.s}[3], [%0], %7 \n" ++ ++ "add %0, %3, #4 \n" ++ "st1 {v19.s}[0], [%0], %7 \n" ++ "st1 {v19.s}[1], [%0], %7 \n" ++ "st1 {v19.s}[2], [%0], %7 \n" ++ "st1 {v19.s}[3], [%0] \n" ++ ++ "add %1, %1, #8 \n" // src += 4 * 2 ++ "add %2, %2, %6, lsl #2 \n" // dst_a += 4 * ++ // dst_stride_a ++ "add %3, %3, %7, lsl #2 \n" // dst_b += 4 * ++ // dst_stride_b ++ "subs %w4, %w4, #4 \n" // w -= 4 ++ "b.eq 4f \n" ++ ++ // some residual, check to see if it includes a 2x8 block, ++ // or less ++ "cmp %w4, #2 \n" ++ "b.lt 3f \n" + +- "mov %[temp], %[dst_b] \n" +- "st1 {v20.d}[0], [%[temp]], %[dst_stride_b] \n" +- "st1 {v22.d}[0], [%[temp]], %[dst_stride_b] \n" +- "st1 {v21.d}[0], [%[temp]], %[dst_stride_b] \n" +- "st1 {v23.d}[0], [%[temp]], %[dst_stride_b] \n" +- "st1 {v20.d}[1], [%[temp]], %[dst_stride_b] \n" +- "st1 {v22.d}[1], [%[temp]], %[dst_stride_b] \n" +- "st1 {v21.d}[1], [%[temp]], %[dst_stride_b] \n" +- "st1 {v23.d}[1], [%[temp]] \n" +- "add %[dst_b], %[dst_b], %[dst_stride_b], lsl #3 \n" ++ // 2x8 block ++ "2: \n" ++ "mov %0, %1 \n" ++ "ld2 {v0.h, v1.h}[0], [%0], %5 \n" ++ "ld2 {v2.h, v3.h}[0], [%0], %5 \n" ++ "ld2 {v0.h, v1.h}[1], [%0], %5 \n" ++ "ld2 {v2.h, v3.h}[1], [%0], %5 \n" ++ "ld2 {v0.h, v1.h}[2], [%0], %5 \n" ++ "ld2 {v2.h, v3.h}[2], [%0], %5 \n" ++ "ld2 {v0.h, v1.h}[3], [%0], %5 \n" ++ "ld2 {v2.h, v3.h}[3], [%0] \n" ++ ++ "trn1 v4.8b, v0.8b, v2.8b \n" ++ "trn2 v5.8b, v0.8b, v2.8b \n" ++ "trn1 v6.8b, v1.8b, v3.8b \n" ++ "trn2 v7.8b, v1.8b, v3.8b \n" ++ ++ "mov %0, %2 \n" ++ ++ "st1 {v4.d}[0], [%0], %6 \n" ++ "st1 {v6.d}[0], [%0] \n" ++ ++ "mov %0, %3 \n" ++ ++ "st1 {v5.d}[0], [%0], %7 \n" ++ "st1 {v7.d}[0], [%0] \n" + +- "b.ge 1b \n" +- : [temp] "=&r"(temp), // %[temp] +- [src] "+r"(src), // %[src] +- [dst_a] "+r"(dst_a), // %[dst_a] +- [dst_b] "+r"(dst_b), // %[dst_b] +- [width] "+r"(width) // %[width] +- : [src_stride] "r"((ptrdiff_t)src_stride), // %[src_stride] +- [dst_stride_a] "r"((ptrdiff_t)dst_stride_a), // %[dst_stride_a] +- [dst_stride_b] "r"((ptrdiff_t)dst_stride_b) // %[dst_stride_b] ++ "add %1, %1, #4 \n" // src += 2 * 2 ++ "add %2, %2, %6, lsl #1 \n" // dst_a += 2 * ++ // dst_stride_a ++ "add %3, %3, %7, lsl #1 \n" // dst_b += 2 * ++ // dst_stride_b ++ "subs %w4, %w4, #2 \n" // w -= 2 ++ "b.eq 4f \n" ++ ++ // 1x8 block ++ "3: \n" ++ "ld2 {v0.b, v1.b}[0], [%1], %5 \n" ++ "ld2 {v0.b, v1.b}[1], [%1], %5 \n" ++ "ld2 {v0.b, v1.b}[2], [%1], %5 \n" ++ "ld2 {v0.b, v1.b}[3], [%1], %5 \n" ++ "ld2 {v0.b, v1.b}[4], [%1], %5 \n" ++ "ld2 {v0.b, v1.b}[5], [%1], %5 \n" ++ "ld2 {v0.b, v1.b}[6], [%1], %5 \n" ++ "ld2 {v0.b, v1.b}[7], [%1] \n" ++ ++ "st1 {v0.d}[0], [%2] \n" ++ "st1 {v1.d}[0], [%3] \n" ++ ++ "4: \n" ++ ++ : "=&r"(src_temp), // %0 ++ "+r"(src), // %1 ++ "+r"(dst_a), // %2 ++ "+r"(dst_b), // %3 ++ "+r"(width) // %4 ++ : "r"((ptrdiff_t)src_stride), // %5 ++ "r"((ptrdiff_t)dst_stride_a), // %6 ++ "r"((ptrdiff_t)dst_stride_b), // %7 ++ "r"(&kVTbl4x4TransposeDi) // %8 + : "memory", "cc", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", + "v17", "v18", "v19", "v20", "v21", "v22", "v23", "v30", "v31"); + } +@@ -239,7 +448,7 @@ void Transpose4x4_32_NEON(const uint8_t* + uint8_t* dst1 = dst + dst_stride; + uint8_t* dst2 = dst1 + dst_stride; + uint8_t* dst3 = dst2 + dst_stride; +- asm volatile ( ++ asm volatile( + // Main loop transpose 4x4. Read a column, write a row. + "1: \n" + "ld4 {v0.s, v1.s, v2.s, v3.s}[0], [%0], %9 \n" +diff --git a/media/libyuv/libyuv/source/row_any.cc b/media/libyuv/libyuv/source/row_any.cc +--- a/media/libyuv/libyuv/source/row_any.cc ++++ b/media/libyuv/libyuv/source/row_any.cc +@@ -19,7 +19,7 @@ namespace libyuv { + extern "C" { + #endif + +-// memset for vin is meant to clear the source buffer so that ++// memset for temp is meant to clear the source buffer (not dest) so that + // SIMD that reads full multiple of 16 bytes will not trigger msan errors. + // memset is not needed for production, as the garbage values are processed but + // not used, although there may be edge cases for subsampling. +@@ -35,20 +35,20 @@ extern "C" { + void NAMEANY(const uint8_t* y_buf, const uint8_t* u_buf, \ + const uint8_t* v_buf, const uint8_t* a_buf, uint8_t* dst_ptr, \ + int width) { \ +- SIMD_ALIGNED(uint8_t vin[64 * 4]); \ +- SIMD_ALIGNED(uint8_t vout[64]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ ++ SIMD_ALIGNED(uint8_t temp[64 * 5]); \ ++ memset(temp, 0, 64 * 4); /* for msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(y_buf, u_buf, v_buf, a_buf, dst_ptr, n); \ + } \ +- memcpy(vin, y_buf + n, r); \ +- memcpy(vin + 64, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ +- memcpy(vin + 128, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ +- memcpy(vin + 192, a_buf + n, r); \ +- ANY_SIMD(vin, vin + 64, vin + 128, vin + 192, vout, MASK + 1); \ +- memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, vout, SS(r, DUVSHIFT) * BPP); \ ++ memcpy(temp, y_buf + n, r); \ ++ memcpy(temp + 64, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ ++ memcpy(temp + 128, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ ++ memcpy(temp + 192, a_buf + n, r); \ ++ ANY_SIMD(temp, temp + 64, temp + 128, temp + 192, temp + 256, MASK + 1); \ ++ memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, temp + 256, \ ++ SS(r, DUVSHIFT) * BPP); \ + } + + #ifdef HAS_MERGEARGBROW_SSE2 +@@ -68,25 +68,25 @@ ANY41(MergeARGBRow_Any_NEON, MergeARGBRo + void NAMEANY(const uint8_t* y_buf, const uint8_t* u_buf, \ + const uint8_t* v_buf, const uint8_t* a_buf, uint8_t* dst_ptr, \ + const struct YuvConstants* yuvconstants, int width) { \ +- SIMD_ALIGNED(uint8_t vin[64 * 4]); \ +- SIMD_ALIGNED(uint8_t vout[64]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ ++ SIMD_ALIGNED(uint8_t temp[64 * 5]); \ ++ memset(temp, 0, 64 * 4); /* for msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(y_buf, u_buf, v_buf, a_buf, dst_ptr, yuvconstants, n); \ + } \ +- memcpy(vin, y_buf + n, r); \ +- memcpy(vin + 64, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ +- memcpy(vin + 128, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ +- memcpy(vin + 192, a_buf + n, r); \ ++ memcpy(temp, y_buf + n, r); \ ++ memcpy(temp + 64, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ ++ memcpy(temp + 128, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ ++ memcpy(temp + 192, a_buf + n, r); \ + if (width & 1) { \ +- vin[64 + SS(r, UVSHIFT)] = vin[64 + SS(r, UVSHIFT) - 1]; \ +- vin[128 + SS(r, UVSHIFT)] = vin[128 + SS(r, UVSHIFT) - 1]; \ ++ temp[64 + SS(r, UVSHIFT)] = temp[64 + SS(r, UVSHIFT) - 1]; \ ++ temp[128 + SS(r, UVSHIFT)] = temp[128 + SS(r, UVSHIFT) - 1]; \ + } \ +- ANY_SIMD(vin, vin + 64, vin + 128, vin + 192, vout, yuvconstants, \ +- MASK + 1); \ +- memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, vout, SS(r, DUVSHIFT) * BPP); \ ++ ANY_SIMD(temp, temp + 64, temp + 128, temp + 192, temp + 256, \ ++ yuvconstants, MASK + 1); \ ++ memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, temp + 256, \ ++ SS(r, DUVSHIFT) * BPP); \ + } + + #ifdef HAS_I444ALPHATOARGBROW_SSSE3 +@@ -113,9 +113,6 @@ ANY41C(I444AlphaToARGBRow_Any_MSA, I444A + #ifdef HAS_I422ALPHATOARGBROW_MSA + ANY41C(I422AlphaToARGBRow_Any_MSA, I422AlphaToARGBRow_MSA, 1, 0, 4, 7) + #endif +-#ifdef HAS_I422ALPHATOARGBROW_LSX +-ANY41C(I422AlphaToARGBRow_Any_LSX, I422AlphaToARGBRow_LSX, 1, 0, 4, 15) +-#endif + #ifdef HAS_I422ALPHATOARGBROW_LASX + ANY41C(I422AlphaToARGBRow_Any_LASX, I422AlphaToARGBRow_LASX, 1, 0, 4, 15) + #endif +@@ -126,43 +123,23 @@ ANY41C(I422AlphaToARGBRow_Any_LASX, I422 + void NAMEANY(const T* y_buf, const T* u_buf, const T* v_buf, const T* a_buf, \ + uint8_t* dst_ptr, const struct YuvConstants* yuvconstants, \ + int width) { \ +- SIMD_ALIGNED(T vin[16 * 4]); \ +- SIMD_ALIGNED(uint8_t vout[64]); \ +- memset(vin, 0, sizeof(vin)); /* for YUY2 and msan */ \ ++ SIMD_ALIGNED(T temp[16 * 4]); \ ++ SIMD_ALIGNED(uint8_t out[64]); \ ++ memset(temp, 0, 16 * 4 * SBPP); /* for YUY2 and msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(y_buf, u_buf, v_buf, a_buf, dst_ptr, yuvconstants, n); \ + } \ +- memcpy(vin, y_buf + n, r * SBPP); \ +- memcpy(vin + 16, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT) * SBPP); \ +- memcpy(vin + 32, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT) * SBPP); \ +- memcpy(vin + 48, a_buf + n, r * SBPP); \ +- ANY_SIMD(vin, vin + 16, vin + 32, vin + 48, vout, yuvconstants, MASK + 1); \ +- memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, vout, SS(r, DUVSHIFT) * BPP); \ ++ memcpy(temp, y_buf + n, r * SBPP); \ ++ memcpy(temp + 16, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT) * SBPP); \ ++ memcpy(temp + 32, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT) * SBPP); \ ++ memcpy(temp + 48, a_buf + n, r * SBPP); \ ++ ANY_SIMD(temp, temp + 16, temp + 32, temp + 48, out, yuvconstants, \ ++ MASK + 1); \ ++ memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, out, SS(r, DUVSHIFT) * BPP); \ + } + +-#ifdef HAS_I210ALPHATOARGBROW_NEON +-ANY41CT(I210AlphaToARGBRow_Any_NEON, +- I210AlphaToARGBRow_NEON, +- 1, +- 0, +- uint16_t, +- 2, +- 4, +- 7) +-#endif +-#ifdef HAS_I410ALPHATOARGBROW_NEON +-ANY41CT(I410AlphaToARGBRow_Any_NEON, +- I410AlphaToARGBRow_NEON, +- 0, +- 0, +- uint16_t, +- 2, +- 4, +- 7) +-#endif +- + #ifdef HAS_I210ALPHATOARGBROW_SSSE3 + ANY41CT(I210AlphaToARGBRow_Any_SSSE3, + I210AlphaToARGBRow_SSSE3, +@@ -213,20 +190,20 @@ ANY41CT(I410AlphaToARGBRow_Any_AVX2, + #define ANY41PT(NAMEANY, ANY_SIMD, STYPE, SBPP, DTYPE, BPP, MASK) \ + void NAMEANY(const STYPE* r_buf, const STYPE* g_buf, const STYPE* b_buf, \ + const STYPE* a_buf, DTYPE* dst_ptr, int depth, int width) { \ +- SIMD_ALIGNED(STYPE vin[16 * 4]); \ +- SIMD_ALIGNED(DTYPE vout[64]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ ++ SIMD_ALIGNED(STYPE temp[16 * 4]); \ ++ SIMD_ALIGNED(DTYPE out[64]); \ ++ memset(temp, 0, 16 * 4 * SBPP); /* for YUY2 and msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(r_buf, g_buf, b_buf, a_buf, dst_ptr, depth, n); \ + } \ +- memcpy(vin, r_buf + n, r * SBPP); \ +- memcpy(vin + 16, g_buf + n, r * SBPP); \ +- memcpy(vin + 32, b_buf + n, r * SBPP); \ +- memcpy(vin + 48, a_buf + n, r * SBPP); \ +- ANY_SIMD(vin, vin + 16, vin + 32, vin + 48, vout, depth, MASK + 1); \ +- memcpy((uint8_t*)dst_ptr + n * BPP, vout, r * BPP); \ ++ memcpy(temp, r_buf + n, r * SBPP); \ ++ memcpy(temp + 16, g_buf + n, r * SBPP); \ ++ memcpy(temp + 32, b_buf + n, r * SBPP); \ ++ memcpy(temp + 48, a_buf + n, r * SBPP); \ ++ ANY_SIMD(temp, temp + 16, temp + 32, temp + 48, out, depth, MASK + 1); \ ++ memcpy((uint8_t*)dst_ptr + n * BPP, out, r * BPP); \ + } + + #ifdef HAS_MERGEAR64ROW_AVX2 +@@ -260,22 +237,22 @@ ANY41PT(MergeARGB16To8Row_Any_NEON, + #undef ANY41PT + + // Any 3 planes to 1. +-#define ANY31(NAMEANY, ANY_SIMD, UVSHIFT, DUVSHIFT, BPP, MASK) \ +- void NAMEANY(const uint8_t* y_buf, const uint8_t* u_buf, \ +- const uint8_t* v_buf, uint8_t* dst_ptr, int width) { \ +- SIMD_ALIGNED(uint8_t vin[64 * 3]); \ +- SIMD_ALIGNED(uint8_t vout[64]); \ +- memset(vin, 0, sizeof(vin)); /* for YUY2 and msan */ \ +- int r = width & MASK; \ +- int n = width & ~MASK; \ +- if (n > 0) { \ +- ANY_SIMD(y_buf, u_buf, v_buf, dst_ptr, n); \ +- } \ +- memcpy(vin, y_buf + n, r); \ +- memcpy(vin + 64, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ +- memcpy(vin + 128, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ +- ANY_SIMD(vin, vin + 64, vin + 128, vout, MASK + 1); \ +- memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, vout, SS(r, DUVSHIFT) * BPP); \ ++#define ANY31(NAMEANY, ANY_SIMD, UVSHIFT, DUVSHIFT, BPP, MASK) \ ++ void NAMEANY(const uint8_t* y_buf, const uint8_t* u_buf, \ ++ const uint8_t* v_buf, uint8_t* dst_ptr, int width) { \ ++ SIMD_ALIGNED(uint8_t temp[64 * 4]); \ ++ memset(temp, 0, 64 * 3); /* for YUY2 and msan */ \ ++ int r = width & MASK; \ ++ int n = width & ~MASK; \ ++ if (n > 0) { \ ++ ANY_SIMD(y_buf, u_buf, v_buf, dst_ptr, n); \ ++ } \ ++ memcpy(temp, y_buf + n, r); \ ++ memcpy(temp + 64, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ ++ memcpy(temp + 128, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ ++ ANY_SIMD(temp, temp + 64, temp + 128, temp + 192, MASK + 1); \ ++ memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, temp + 192, \ ++ SS(r, DUVSHIFT) * BPP); \ + } + + // Merge functions. +@@ -308,9 +285,6 @@ ANY31(I422ToYUY2Row_Any_NEON, I422ToYUY2 + #ifdef HAS_I422TOYUY2ROW_MSA + ANY31(I422ToYUY2Row_Any_MSA, I422ToYUY2Row_MSA, 1, 1, 4, 31) + #endif +-#ifdef HAS_I422TOYUY2ROW_LSX +-ANY31(I422ToYUY2Row_Any_LSX, I422ToYUY2Row_LSX, 1, 1, 4, 15) +-#endif + #ifdef HAS_I422TOYUY2ROW_LASX + ANY31(I422ToYUY2Row_Any_LASX, I422ToYUY2Row_LASX, 1, 1, 4, 31) + #endif +@@ -320,9 +294,6 @@ ANY31(I422ToUYVYRow_Any_NEON, I422ToUYVY + #ifdef HAS_I422TOUYVYROW_MSA + ANY31(I422ToUYVYRow_Any_MSA, I422ToUYVYRow_MSA, 1, 1, 4, 31) + #endif +-#ifdef HAS_I422TOUYVYROW_LSX +-ANY31(I422ToUYVYRow_Any_LSX, I422ToUYVYRow_LSX, 1, 1, 4, 15) +-#endif + #ifdef HAS_I422TOUYVYROW_LASX + ANY31(I422ToUYVYRow_Any_LASX, I422ToUYVYRow_LASX, 1, 1, 4, 31) + #endif +@@ -337,27 +308,28 @@ ANY31(BlendPlaneRow_Any_SSSE3, BlendPlan + // Note that odd width replication includes 444 due to implementation + // on arm that subsamples 444 to 422 internally. + // Any 3 planes to 1 with yuvconstants +-#define ANY31C(NAMEANY, ANY_SIMD, UVSHIFT, DUVSHIFT, BPP, MASK) \ +- void NAMEANY(const uint8_t* y_buf, const uint8_t* u_buf, \ +- const uint8_t* v_buf, uint8_t* dst_ptr, \ +- const struct YuvConstants* yuvconstants, int width) { \ +- SIMD_ALIGNED(uint8_t vin[128 * 3]); \ +- SIMD_ALIGNED(uint8_t vout[128]); \ +- memset(vin, 0, sizeof(vin)); /* for YUY2 and msan */ \ +- int r = width & MASK; \ +- int n = width & ~MASK; \ +- if (n > 0) { \ +- ANY_SIMD(y_buf, u_buf, v_buf, dst_ptr, yuvconstants, n); \ +- } \ +- memcpy(vin, y_buf + n, r); \ +- memcpy(vin + 128, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ +- memcpy(vin + 256, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ +- if (width & 1) { \ +- vin[128 + SS(r, UVSHIFT)] = vin[128 + SS(r, UVSHIFT) - 1]; \ +- vin[256 + SS(r, UVSHIFT)] = vin[256 + SS(r, UVSHIFT) - 1]; \ +- } \ +- ANY_SIMD(vin, vin + 128, vin + 256, vout, yuvconstants, MASK + 1); \ +- memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, vout, SS(r, DUVSHIFT) * BPP); \ ++#define ANY31C(NAMEANY, ANY_SIMD, UVSHIFT, DUVSHIFT, BPP, MASK) \ ++ void NAMEANY(const uint8_t* y_buf, const uint8_t* u_buf, \ ++ const uint8_t* v_buf, uint8_t* dst_ptr, \ ++ const struct YuvConstants* yuvconstants, int width) { \ ++ SIMD_ALIGNED(uint8_t temp[128 * 4]); \ ++ memset(temp, 0, 128 * 3); /* for YUY2 and msan */ \ ++ int r = width & MASK; \ ++ int n = width & ~MASK; \ ++ if (n > 0) { \ ++ ANY_SIMD(y_buf, u_buf, v_buf, dst_ptr, yuvconstants, n); \ ++ } \ ++ memcpy(temp, y_buf + n, r); \ ++ memcpy(temp + 128, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ ++ memcpy(temp + 256, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ ++ if (width & 1) { \ ++ temp[128 + SS(r, UVSHIFT)] = temp[128 + SS(r, UVSHIFT) - 1]; \ ++ temp[256 + SS(r, UVSHIFT)] = temp[256 + SS(r, UVSHIFT) - 1]; \ ++ } \ ++ ANY_SIMD(temp, temp + 128, temp + 256, temp + 384, yuvconstants, \ ++ MASK + 1); \ ++ memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, temp + 384, \ ++ SS(r, DUVSHIFT) * BPP); \ + } + + #ifdef HAS_I422TOARGBROW_SSSE3 +@@ -438,14 +410,6 @@ ANY31C(I422ToARGB4444Row_Any_MSA, I422To + ANY31C(I422ToARGB1555Row_Any_MSA, I422ToARGB1555Row_MSA, 1, 0, 2, 7) + ANY31C(I422ToRGB565Row_Any_MSA, I422ToRGB565Row_MSA, 1, 0, 2, 7) + #endif +-#ifdef HAS_I422TOARGBROW_LSX +-ANY31C(I422ToARGBRow_Any_LSX, I422ToARGBRow_LSX, 1, 0, 4, 15) +-ANY31C(I422ToRGBARow_Any_LSX, I422ToRGBARow_LSX, 1, 0, 4, 15) +-ANY31C(I422ToRGB24Row_Any_LSX, I422ToRGB24Row_LSX, 1, 0, 3, 15) +-ANY31C(I422ToRGB565Row_Any_LSX, I422ToRGB565Row_LSX, 1, 0, 2, 15) +-ANY31C(I422ToARGB4444Row_Any_LSX, I422ToARGB4444Row_LSX, 1, 0, 2, 15) +-ANY31C(I422ToARGB1555Row_Any_LSX, I422ToARGB1555Row_LSX, 1, 0, 2, 15) +-#endif + #ifdef HAS_I422TOARGBROW_LASX + ANY31C(I422ToARGBRow_Any_LASX, I422ToARGBRow_LASX, 1, 0, 4, 31) + ANY31C(I422ToRGBARow_Any_LASX, I422ToRGBARow_LASX, 1, 0, 4, 31) +@@ -465,19 +429,19 @@ ANY31C(I444ToARGBRow_Any_LSX, I444ToARGB + void NAMEANY(const T* y_buf, const T* u_buf, const T* v_buf, \ + uint8_t* dst_ptr, const struct YuvConstants* yuvconstants, \ + int width) { \ +- SIMD_ALIGNED(T vin[16 * 3]); \ +- SIMD_ALIGNED(uint8_t vout[64]); \ +- memset(vin, 0, sizeof(vin)); /* for YUY2 and msan */ \ ++ SIMD_ALIGNED(T temp[16 * 3]); \ ++ SIMD_ALIGNED(uint8_t out[64]); \ ++ memset(temp, 0, 16 * 3 * SBPP); /* for YUY2 and msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(y_buf, u_buf, v_buf, dst_ptr, yuvconstants, n); \ + } \ +- memcpy(vin, y_buf + n, r * SBPP); \ +- memcpy(vin + 16, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT) * SBPP); \ +- memcpy(vin + 32, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT) * SBPP); \ +- ANY_SIMD(vin, vin + 16, vin + 32, vout, yuvconstants, MASK + 1); \ +- memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, vout, SS(r, DUVSHIFT) * BPP); \ ++ memcpy(temp, y_buf + n, r * SBPP); \ ++ memcpy(temp + 16, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT) * SBPP); \ ++ memcpy(temp + 32, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT) * SBPP); \ ++ ANY_SIMD(temp, temp + 16, temp + 32, out, yuvconstants, MASK + 1); \ ++ memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, out, SS(r, DUVSHIFT) * BPP); \ + } + + #ifdef HAS_I210TOAR30ROW_SSSE3 +@@ -516,37 +480,25 @@ ANY31CT(I212ToARGBRow_Any_AVX2, I212ToAR + #ifdef HAS_I212TOAR30ROW_AVX2 + ANY31CT(I212ToAR30Row_Any_AVX2, I212ToAR30Row_AVX2, 1, 0, uint16_t, 2, 4, 15) + #endif +-#ifdef HAS_I210TOARGBROW_NEON +-ANY31CT(I210ToARGBRow_Any_NEON, I210ToARGBRow_NEON, 1, 0, uint16_t, 2, 4, 7) +-#endif +-#ifdef HAS_I410TOARGBROW_NEON +-ANY31CT(I410ToARGBRow_Any_NEON, I410ToARGBRow_NEON, 0, 0, uint16_t, 2, 4, 7) +-#endif +-#ifdef HAS_I210TOAR30ROW_NEON +-ANY31CT(I210ToAR30Row_Any_NEON, I210ToAR30Row_NEON, 1, 0, uint16_t, 2, 4, 7) +-#endif +-#ifdef HAS_I410TOAR30ROW_NEON +-ANY31CT(I410ToAR30Row_Any_NEON, I410ToAR30Row_NEON, 0, 0, uint16_t, 2, 4, 7) +-#endif + #undef ANY31CT + + // Any 3 planes to 1 plane with parameter + #define ANY31PT(NAMEANY, ANY_SIMD, STYPE, SBPP, DTYPE, BPP, MASK) \ + void NAMEANY(const STYPE* r_buf, const STYPE* g_buf, const STYPE* b_buf, \ + DTYPE* dst_ptr, int depth, int width) { \ +- SIMD_ALIGNED(STYPE vin[16 * 3]); \ +- SIMD_ALIGNED(DTYPE vout[64]); \ +- memset(vin, 0, sizeof(vin)); /* for YUY2 and msan */ \ ++ SIMD_ALIGNED(STYPE temp[16 * 3]); \ ++ SIMD_ALIGNED(DTYPE out[64]); \ ++ memset(temp, 0, 16 * 3 * SBPP); /* for YUY2 and msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(r_buf, g_buf, b_buf, dst_ptr, depth, n); \ + } \ +- memcpy(vin, r_buf + n, r * SBPP); \ +- memcpy(vin + 16, g_buf + n, r * SBPP); \ +- memcpy(vin + 32, b_buf + n, r * SBPP); \ +- ANY_SIMD(vin, vin + 16, vin + 32, vout, depth, MASK + 1); \ +- memcpy((uint8_t*)dst_ptr + n * BPP, vout, r * BPP); \ ++ memcpy(temp, r_buf + n, r * SBPP); \ ++ memcpy(temp + 16, g_buf + n, r * SBPP); \ ++ memcpy(temp + 32, b_buf + n, r * SBPP); \ ++ ANY_SIMD(temp, temp + 16, temp + 32, out, depth, MASK + 1); \ ++ memcpy((uint8_t*)dst_ptr + n * BPP, out, r * BPP); \ + } + + #ifdef HAS_MERGEXR30ROW_AVX2 +@@ -561,7 +513,7 @@ ANY31PT(MergeXR30Row_10_Any_NEON, + 2, + uint8_t, + 4, +- 7) ++ 3) + #endif + + #ifdef HAS_MERGEXR64ROW_AVX2 +@@ -598,19 +550,18 @@ ANY31PT(MergeXRGB16To8Row_Any_NEON, + #define ANY21(NAMEANY, ANY_SIMD, UVSHIFT, SBPP, SBPP2, BPP, MASK) \ + void NAMEANY(const uint8_t* y_buf, const uint8_t* uv_buf, uint8_t* dst_ptr, \ + int width) { \ +- SIMD_ALIGNED(uint8_t vin[128 * 2]); \ +- SIMD_ALIGNED(uint8_t vout[128]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ ++ SIMD_ALIGNED(uint8_t temp[128 * 3]); \ ++ memset(temp, 0, 128 * 2); /* for msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(y_buf, uv_buf, dst_ptr, n); \ + } \ +- memcpy(vin, y_buf + n * SBPP, r * SBPP); \ +- memcpy(vin + 128, uv_buf + (n >> UVSHIFT) * SBPP2, \ ++ memcpy(temp, y_buf + n * SBPP, r * SBPP); \ ++ memcpy(temp + 128, uv_buf + (n >> UVSHIFT) * SBPP2, \ + SS(r, UVSHIFT) * SBPP2); \ +- ANY_SIMD(vin, vin + 128, vout, MASK + 1); \ +- memcpy(dst_ptr + n * BPP, vout, r * BPP); \ ++ ANY_SIMD(temp, temp + 128, temp + 256, MASK + 1); \ ++ memcpy(dst_ptr + n * BPP, temp + 256, r * BPP); \ + } + + // Merge functions. +@@ -618,7 +569,7 @@ ANY31PT(MergeXRGB16To8Row_Any_NEON, + ANY21(MergeUVRow_Any_SSE2, MergeUVRow_SSE2, 0, 1, 1, 2, 15) + #endif + #ifdef HAS_MERGEUVROW_AVX2 +-ANY21(MergeUVRow_Any_AVX2, MergeUVRow_AVX2, 0, 1, 1, 2, 15) ++ANY21(MergeUVRow_Any_AVX2, MergeUVRow_AVX2, 0, 1, 1, 2, 31) + #endif + #ifdef HAS_MERGEUVROW_AVX512BW + ANY21(MergeUVRow_Any_AVX512BW, MergeUVRow_AVX512BW, 0, 1, 1, 2, 31) +@@ -672,27 +623,18 @@ ANY21(ARGBSubtractRow_Any_NEON, ARGBSubt + #ifdef HAS_ARGBMULTIPLYROW_MSA + ANY21(ARGBMultiplyRow_Any_MSA, ARGBMultiplyRow_MSA, 0, 4, 4, 4, 3) + #endif +-#ifdef HAS_ARGBMULTIPLYROW_LSX +-ANY21(ARGBMultiplyRow_Any_LSX, ARGBMultiplyRow_LSX, 0, 4, 4, 4, 3) +-#endif + #ifdef HAS_ARGBMULTIPLYROW_LASX + ANY21(ARGBMultiplyRow_Any_LASX, ARGBMultiplyRow_LASX, 0, 4, 4, 4, 7) + #endif + #ifdef HAS_ARGBADDROW_MSA + ANY21(ARGBAddRow_Any_MSA, ARGBAddRow_MSA, 0, 4, 4, 4, 7) + #endif +-#ifdef HAS_ARGBADDROW_LSX +-ANY21(ARGBAddRow_Any_LSX, ARGBAddRow_LSX, 0, 4, 4, 4, 3) +-#endif + #ifdef HAS_ARGBADDROW_LASX + ANY21(ARGBAddRow_Any_LASX, ARGBAddRow_LASX, 0, 4, 4, 4, 7) + #endif + #ifdef HAS_ARGBSUBTRACTROW_MSA + ANY21(ARGBSubtractRow_Any_MSA, ARGBSubtractRow_MSA, 0, 4, 4, 4, 7) + #endif +-#ifdef HAS_ARGBSUBTRACTROW_LSX +-ANY21(ARGBSubtractRow_Any_LSX, ARGBSubtractRow_LSX, 0, 4, 4, 4, 3) +-#endif + #ifdef HAS_ARGBSUBTRACTROW_LASX + ANY21(ARGBSubtractRow_Any_LASX, ARGBSubtractRow_LASX, 0, 4, 4, 4, 7) + #endif +@@ -739,19 +681,18 @@ ANY21(SobelXYRow_Any_LSX, SobelXYRow_LSX + #define ANY21S(NAMEANY, ANY_SIMD, SBPP, BPP, MASK) \ + void NAMEANY(const uint8_t* src_yuy2, int stride_yuy2, uint8_t* dst_uv, \ + int width) { \ +- SIMD_ALIGNED(uint8_t vin[32 * 2]); \ +- SIMD_ALIGNED(uint8_t vout[32]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ ++ SIMD_ALIGNED(uint8_t temp[32 * 3]); \ ++ memset(temp, 0, 32 * 2); /* for msan */ \ + int awidth = (width + 1) / 2; \ + int r = awidth & MASK; \ + int n = awidth & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(src_yuy2, stride_yuy2, dst_uv, n * 2); \ + } \ +- memcpy(vin, src_yuy2 + n * SBPP, r * SBPP); \ +- memcpy(vin + 32, src_yuy2 + stride_yuy2 + n * SBPP, r * SBPP); \ +- ANY_SIMD(vin, 32, vout, MASK + 1); \ +- memcpy(dst_uv + n * BPP, vout, r * BPP); \ ++ memcpy(temp, src_yuy2 + n * SBPP, r * SBPP); \ ++ memcpy(temp + 32, src_yuy2 + stride_yuy2 + n * SBPP, r * SBPP); \ ++ ANY_SIMD(temp, 32, temp + 64, MASK + 1); \ ++ memcpy(dst_uv + n * BPP, temp + 64, r * BPP); \ + } + + #ifdef HAS_YUY2TONVUVROW_NEON +@@ -768,19 +709,18 @@ ANY21S(YUY2ToNVUVRow_Any_AVX2, YUY2ToNVU + #define ANY21C(NAMEANY, ANY_SIMD, UVSHIFT, SBPP, SBPP2, BPP, MASK) \ + void NAMEANY(const uint8_t* y_buf, const uint8_t* uv_buf, uint8_t* dst_ptr, \ + const struct YuvConstants* yuvconstants, int width) { \ +- SIMD_ALIGNED(uint8_t vin[128 * 2]); \ +- SIMD_ALIGNED(uint8_t vout[128]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ ++ SIMD_ALIGNED(uint8_t temp[128 * 3]); \ ++ memset(temp, 0, 128 * 2); /* for msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(y_buf, uv_buf, dst_ptr, yuvconstants, n); \ + } \ +- memcpy(vin, y_buf + n * SBPP, r * SBPP); \ +- memcpy(vin + 128, uv_buf + (n >> UVSHIFT) * SBPP2, \ ++ memcpy(temp, y_buf + n * SBPP, r * SBPP); \ ++ memcpy(temp + 128, uv_buf + (n >> UVSHIFT) * SBPP2, \ + SS(r, UVSHIFT) * SBPP2); \ +- ANY_SIMD(vin, vin + 128, vout, yuvconstants, MASK + 1); \ +- memcpy(dst_ptr + n * BPP, vout, r * BPP); \ ++ ANY_SIMD(temp, temp + 128, temp + 256, yuvconstants, MASK + 1); \ ++ memcpy(dst_ptr + n * BPP, temp + 256, r * BPP); \ + } + + // Biplanar to RGB. +@@ -859,21 +799,21 @@ ANY21C(NV12ToRGB565Row_Any_LASX, NV12ToR + #undef ANY21C + + // Any 2 planes of 16 bit to 1 with yuvconstants +-#define ANY21CT(NAMEANY, ANY_SIMD, UVSHIFT, DUVSHIFT, T, SBPP, BPP, MASK) \ +- void NAMEANY(const T* y_buf, const T* uv_buf, uint8_t* dst_ptr, \ +- const struct YuvConstants* yuvconstants, int width) { \ +- SIMD_ALIGNED(T vin[16 * 2]); \ +- SIMD_ALIGNED(uint8_t vout[64]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ +- int r = width & MASK; \ +- int n = width & ~MASK; \ +- if (n > 0) { \ +- ANY_SIMD(y_buf, uv_buf, dst_ptr, yuvconstants, n); \ +- } \ +- memcpy(vin, y_buf + n, r * SBPP); \ +- memcpy(vin + 16, uv_buf + 2 * (n >> UVSHIFT), SS(r, UVSHIFT) * SBPP * 2); \ +- ANY_SIMD(vin, vin + 16, vout, yuvconstants, MASK + 1); \ +- memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, vout, SS(r, DUVSHIFT) * BPP); \ ++#define ANY21CT(NAMEANY, ANY_SIMD, UVSHIFT, DUVSHIFT, T, SBPP, BPP, MASK) \ ++ void NAMEANY(const T* y_buf, const T* uv_buf, uint8_t* dst_ptr, \ ++ const struct YuvConstants* yuvconstants, int width) { \ ++ SIMD_ALIGNED(T temp[16 * 3]); \ ++ SIMD_ALIGNED(uint8_t out[64]); \ ++ memset(temp, 0, 16 * 3 * SBPP); /* for YUY2 and msan */ \ ++ int r = width & MASK; \ ++ int n = width & ~MASK; \ ++ if (n > 0) { \ ++ ANY_SIMD(y_buf, uv_buf, dst_ptr, yuvconstants, n); \ ++ } \ ++ memcpy(temp, y_buf + n, r * SBPP); \ ++ memcpy(temp + 16, uv_buf + 2 * (n >> UVSHIFT), SS(r, UVSHIFT) * SBPP * 2); \ ++ ANY_SIMD(temp, temp + 16, out, yuvconstants, MASK + 1); \ ++ memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, out, SS(r, DUVSHIFT) * BPP); \ + } + + #ifdef HAS_P210TOAR30ROW_SSSE3 +@@ -907,22 +847,21 @@ ANY21CT(P410ToAR30Row_Any_AVX2, P410ToAR + #define ANY21PT(NAMEANY, ANY_SIMD, T, BPP, MASK) \ + void NAMEANY(const T* src_u, const T* src_v, T* dst_uv, int depth, \ + int width) { \ +- SIMD_ALIGNED(T vin[16 * 2]); \ +- SIMD_ALIGNED(T vout[16]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ ++ SIMD_ALIGNED(T temp[16 * 4]); \ ++ memset(temp, 0, 16 * 4 * BPP); /* for msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(src_u, src_v, dst_uv, depth, n); \ + } \ +- memcpy(vin, src_u + n, r * BPP); \ +- memcpy(vin + 16, src_v + n, r * BPP); \ +- ANY_SIMD(vin, vin + 16, vout, depth, MASK + 1); \ +- memcpy(dst_uv + n * 2, vout, r * BPP * 2); \ ++ memcpy(temp, src_u + n, r * BPP); \ ++ memcpy(temp + 16, src_v + n, r * BPP); \ ++ ANY_SIMD(temp, temp + 16, temp + 32, depth, MASK + 1); \ ++ memcpy(dst_uv + n * 2, temp + 32, r * BPP * 2); \ + } + + #ifdef HAS_MERGEUVROW_16_AVX2 +-ANY21PT(MergeUVRow_16_Any_AVX2, MergeUVRow_16_AVX2, uint16_t, 2, 7) ++ANY21PT(MergeUVRow_16_Any_AVX2, MergeUVRow_16_AVX2, uint16_t, 2, 15) + #endif + #ifdef HAS_MERGEUVROW_16_NEON + ANY21PT(MergeUVRow_16_Any_NEON, MergeUVRow_16_NEON, uint16_t, 2, 7) +@@ -931,19 +870,18 @@ ANY21PT(MergeUVRow_16_Any_NEON, MergeUVR + #undef ANY21CT + + // Any 1 to 1. +-#define ANY11(NAMEANY, ANY_SIMD, UVSHIFT, SBPP, BPP, MASK) \ +- void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_ptr, int width) { \ +- SIMD_ALIGNED(uint8_t vin[128]); \ +- SIMD_ALIGNED(uint8_t vout[128]); \ +- memset(vin, 0, sizeof(vin)); /* for YUY2 and msan */ \ +- int r = width & MASK; \ +- int n = width & ~MASK; \ +- if (n > 0) { \ +- ANY_SIMD(src_ptr, dst_ptr, n); \ +- } \ +- memcpy(vin, src_ptr + (n >> UVSHIFT) * SBPP, SS(r, UVSHIFT) * SBPP); \ +- ANY_SIMD(vin, vout, MASK + 1); \ +- memcpy(dst_ptr + n * BPP, vout, r * BPP); \ ++#define ANY11(NAMEANY, ANY_SIMD, UVSHIFT, SBPP, BPP, MASK) \ ++ void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_ptr, int width) { \ ++ SIMD_ALIGNED(uint8_t temp[128 * 2]); \ ++ memset(temp, 0, 128); /* for YUY2 and msan */ \ ++ int r = width & MASK; \ ++ int n = width & ~MASK; \ ++ if (n > 0) { \ ++ ANY_SIMD(src_ptr, dst_ptr, n); \ ++ } \ ++ memcpy(temp, src_ptr + (n >> UVSHIFT) * SBPP, SS(r, UVSHIFT) * SBPP); \ ++ ANY_SIMD(temp, temp + 128, MASK + 1); \ ++ memcpy(dst_ptr + n * BPP, temp + 128, r * BPP); \ + } + + #ifdef HAS_COPYROW_AVX +@@ -981,12 +919,6 @@ ANY11(ARGBToARGB4444Row_Any_AVX2, ARGBTo + #if defined(HAS_ABGRTOAR30ROW_SSSE3) + ANY11(ABGRToAR30Row_Any_SSSE3, ABGRToAR30Row_SSSE3, 0, 4, 4, 3) + #endif +-#if defined(HAS_ABGRTOAR30ROW_NEON) +-ANY11(ABGRToAR30Row_Any_NEON, ABGRToAR30Row_NEON, 0, 4, 4, 7) +-#endif +-#if defined(HAS_ARGBTOAR30ROW_NEON) +-ANY11(ARGBToAR30Row_Any_NEON, ARGBToAR30Row_NEON, 0, 4, 4, 7) +-#endif + #if defined(HAS_ARGBTOAR30ROW_SSSE3) + ANY11(ARGBToAR30Row_Any_SSSE3, ARGBToAR30Row_SSSE3, 0, 4, 4, 3) + #endif +@@ -1040,13 +972,6 @@ ANY11(ARGBToARGB1555Row_Any_MSA, ARGBToA + ANY11(ARGBToARGB4444Row_Any_MSA, ARGBToARGB4444Row_MSA, 0, 4, 2, 7) + ANY11(J400ToARGBRow_Any_MSA, J400ToARGBRow_MSA, 0, 1, 4, 15) + #endif +-#if defined(HAS_ARGBTORGB24ROW_LSX) +-ANY11(ARGBToRGB24Row_Any_LSX, ARGBToRGB24Row_LSX, 0, 4, 3, 15) +-ANY11(ARGBToRAWRow_Any_LSX, ARGBToRAWRow_LSX, 0, 4, 3, 15) +-ANY11(ARGBToRGB565Row_Any_LSX, ARGBToRGB565Row_LSX, 0, 4, 2, 7) +-ANY11(ARGBToARGB1555Row_Any_LSX, ARGBToARGB1555Row_LSX, 0, 4, 2, 7) +-ANY11(ARGBToARGB4444Row_Any_LSX, ARGBToARGB4444Row_LSX, 0, 4, 2, 7) +-#endif + #if defined(HAS_ARGBTORGB24ROW_LASX) + ANY11(ARGBToRGB24Row_Any_LASX, ARGBToRGB24Row_LASX, 0, 4, 3, 31) + ANY11(ARGBToRAWRow_Any_LASX, ARGBToRAWRow_LASX, 0, 4, 3, 31) +@@ -1111,9 +1036,6 @@ ANY11(RGBAToYJRow_Any_SSSE3, RGBAToYJRow + #ifdef HAS_ARGBTOYROW_NEON + ANY11(ARGBToYRow_Any_NEON, ARGBToYRow_NEON, 0, 4, 1, 15) + #endif +-#ifdef HAS_ARGBTOYROW_NEON_DOTPROD +-ANY11(ARGBToYRow_Any_NEON_DotProd, ARGBToYRow_NEON_DotProd, 0, 4, 1, 15) +-#endif + #ifdef HAS_ARGBTOYROW_MSA + ANY11(ARGBToYRow_Any_MSA, ARGBToYRow_MSA, 0, 4, 1, 15) + #endif +@@ -1126,21 +1048,12 @@ ANY11(ARGBToYRow_Any_LASX, ARGBToYRow_LA + #ifdef HAS_ARGBTOYJROW_NEON + ANY11(ARGBToYJRow_Any_NEON, ARGBToYJRow_NEON, 0, 4, 1, 15) + #endif +-#ifdef HAS_ARGBTOYJROW_NEON_DOTPROD +-ANY11(ARGBToYJRow_Any_NEON_DotProd, ARGBToYJRow_NEON_DotProd, 0, 4, 1, 15) +-#endif + #ifdef HAS_ABGRTOYJROW_NEON + ANY11(ABGRToYJRow_Any_NEON, ABGRToYJRow_NEON, 0, 4, 1, 15) + #endif +-#ifdef HAS_ABGRTOYJROW_NEON_DOTPROD +-ANY11(ABGRToYJRow_Any_NEON_DotProd, ABGRToYJRow_NEON_DotProd, 0, 4, 1, 15) +-#endif + #ifdef HAS_RGBATOYJROW_NEON + ANY11(RGBAToYJRow_Any_NEON, RGBAToYJRow_NEON, 0, 4, 1, 15) + #endif +-#ifdef HAS_RGBATOYJROW_NEON_DOTPROD +-ANY11(RGBAToYJRow_Any_NEON_DotProd, RGBAToYJRow_NEON_DotProd, 0, 4, 1, 15) +-#endif + #ifdef HAS_ARGBTOYJROW_MSA + ANY11(ARGBToYJRow_Any_MSA, ARGBToYJRow_MSA, 0, 4, 1, 15) + #endif +@@ -1165,9 +1078,6 @@ ANY11(ABGRToYJRow_Any_LASX, ABGRToYJRow_ + #ifdef HAS_BGRATOYROW_NEON + ANY11(BGRAToYRow_Any_NEON, BGRAToYRow_NEON, 0, 4, 1, 15) + #endif +-#ifdef HAS_BGRATOYROW_NEON_DOTPROD +-ANY11(BGRAToYRow_Any_NEON_DotProd, BGRAToYRow_NEON_DotProd, 0, 4, 1, 15) +-#endif + #ifdef HAS_BGRATOYROW_MSA + ANY11(BGRAToYRow_Any_MSA, BGRAToYRow_MSA, 0, 4, 1, 15) + #endif +@@ -1180,9 +1090,6 @@ ANY11(BGRAToYRow_Any_LASX, BGRAToYRow_LA + #ifdef HAS_ABGRTOYROW_NEON + ANY11(ABGRToYRow_Any_NEON, ABGRToYRow_NEON, 0, 4, 1, 15) + #endif +-#ifdef HAS_ABGRTOYROW_NEON_DOTPROD +-ANY11(ABGRToYRow_Any_NEON_DotProd, ABGRToYRow_NEON_DotProd, 0, 4, 1, 15) +-#endif + #ifdef HAS_ABGRTOYROW_MSA + ANY11(ABGRToYRow_Any_MSA, ABGRToYRow_MSA, 0, 4, 1, 7) + #endif +@@ -1195,9 +1102,6 @@ ANY11(ABGRToYRow_Any_LASX, ABGRToYRow_LA + #ifdef HAS_RGBATOYROW_NEON + ANY11(RGBAToYRow_Any_NEON, RGBAToYRow_NEON, 0, 4, 1, 15) + #endif +-#ifdef HAS_RGBATOYROW_NEON_DOTPROD +-ANY11(RGBAToYRow_Any_NEON_DotProd, RGBAToYRow_NEON_DotProd, 0, 4, 1, 15) +-#endif + #ifdef HAS_RGBATOYROW_MSA + ANY11(RGBAToYRow_Any_MSA, RGBAToYRow_MSA, 0, 4, 1, 15) + #endif +@@ -1297,18 +1201,12 @@ ANY11(UYVYToYRow_Any_NEON, UYVYToYRow_NE + #ifdef HAS_YUY2TOYROW_MSA + ANY11(YUY2ToYRow_Any_MSA, YUY2ToYRow_MSA, 1, 4, 1, 31) + #endif +-#ifdef HAS_YUY2TOYROW_LSX +-ANY11(YUY2ToYRow_Any_LSX, YUY2ToYRow_LSX, 1, 4, 1, 15) +-#endif + #ifdef HAS_YUY2TOYROW_LASX + ANY11(YUY2ToYRow_Any_LASX, YUY2ToYRow_LASX, 1, 4, 1, 31) + #endif + #ifdef HAS_UYVYTOYROW_MSA + ANY11(UYVYToYRow_Any_MSA, UYVYToYRow_MSA, 1, 4, 1, 31) + #endif +-#ifdef HAS_UYVYTOYROW_LSX +-ANY11(UYVYToYRow_Any_LSX, UYVYToYRow_LSX, 1, 4, 1, 15) +-#endif + #ifdef HAS_UYVYTOYROW_LASX + ANY11(UYVYToYRow_Any_LASX, UYVYToYRow_LASX, 1, 4, 1, 31) + #endif +@@ -1405,9 +1303,6 @@ ANY11(ARGBAttenuateRow_Any_NEON, ARGBAtt + #ifdef HAS_ARGBATTENUATEROW_MSA + ANY11(ARGBAttenuateRow_Any_MSA, ARGBAttenuateRow_MSA, 0, 4, 4, 7) + #endif +-#ifdef HAS_ARGBATTENUATEROW_LSX +-ANY11(ARGBAttenuateRow_Any_LSX, ARGBAttenuateRow_LSX, 0, 4, 4, 7) +-#endif + #ifdef HAS_ARGBATTENUATEROW_LASX + ANY11(ARGBAttenuateRow_Any_LASX, ARGBAttenuateRow_LASX, 0, 4, 4, 15) + #endif +@@ -1429,21 +1324,19 @@ ANY11(ARGBExtractAlphaRow_Any_LSX, ARGBE + #undef ANY11 + + // Any 1 to 1 blended. Destination is read, modify, write. +-#define ANY11B(NAMEANY, ANY_SIMD, UVSHIFT, SBPP, BPP, MASK) \ +- void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_ptr, int width) { \ +- SIMD_ALIGNED(uint8_t vin[64]); \ +- SIMD_ALIGNED(uint8_t vout[64]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ +- memset(vout, 0, sizeof(vout)); /* for msan */ \ +- int r = width & MASK; \ +- int n = width & ~MASK; \ +- if (n > 0) { \ +- ANY_SIMD(src_ptr, dst_ptr, n); \ +- } \ +- memcpy(vin, src_ptr + (n >> UVSHIFT) * SBPP, SS(r, UVSHIFT) * SBPP); \ +- memcpy(vout, dst_ptr + n * BPP, r * BPP); \ +- ANY_SIMD(vin, vout, MASK + 1); \ +- memcpy(dst_ptr + n * BPP, vout, r * BPP); \ ++#define ANY11B(NAMEANY, ANY_SIMD, UVSHIFT, SBPP, BPP, MASK) \ ++ void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_ptr, int width) { \ ++ SIMD_ALIGNED(uint8_t temp[64 * 2]); \ ++ memset(temp, 0, 64 * 2); /* for msan */ \ ++ int r = width & MASK; \ ++ int n = width & ~MASK; \ ++ if (n > 0) { \ ++ ANY_SIMD(src_ptr, dst_ptr, n); \ ++ } \ ++ memcpy(temp, src_ptr + (n >> UVSHIFT) * SBPP, SS(r, UVSHIFT) * SBPP); \ ++ memcpy(temp + 64, dst_ptr + n * BPP, r * BPP); \ ++ ANY_SIMD(temp, temp + 64, MASK + 1); \ ++ memcpy(dst_ptr + n * BPP, temp + 64, r * BPP); \ + } + + #ifdef HAS_ARGBCOPYALPHAROW_AVX2 +@@ -1463,17 +1356,16 @@ ANY11B(ARGBCopyYToAlphaRow_Any_SSE2, ARG + // Any 1 to 1 with parameter. + #define ANY11P(NAMEANY, ANY_SIMD, T, SBPP, BPP, MASK) \ + void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_ptr, T param, int width) { \ +- SIMD_ALIGNED(uint8_t vin[64]); \ +- SIMD_ALIGNED(uint8_t vout[64]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ ++ SIMD_ALIGNED(uint8_t temp[64 * 2]); \ ++ memset(temp, 0, 64); /* for msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(src_ptr, dst_ptr, param, n); \ + } \ +- memcpy(vin, src_ptr + n * SBPP, r * SBPP); \ +- ANY_SIMD(vin, vout, param, MASK + 1); \ +- memcpy(dst_ptr + n * BPP, vout, r * BPP); \ ++ memcpy(temp, src_ptr + n * SBPP, r * SBPP); \ ++ ANY_SIMD(temp, temp + 64, param, MASK + 1); \ ++ memcpy(dst_ptr + n * BPP, temp + 64, r * BPP); \ + } + + #if defined(HAS_I400TOARGBROW_SSE2) +@@ -1549,14 +1441,6 @@ ANY11P(ARGBToRGB565DitherRow_Any_MSA, + 2, + 7) + #endif +-#if defined(HAS_ARGBTORGB565DITHERROW_LSX) +-ANY11P(ARGBToRGB565DitherRow_Any_LSX, +- ARGBToRGB565DitherRow_LSX, +- const uint32_t, +- 4, +- 2, +- 7) +-#endif + #if defined(HAS_ARGBTORGB565DITHERROW_LASX) + ANY11P(ARGBToRGB565DitherRow_Any_LASX, + ARGBToRGB565DitherRow_LASX, +@@ -1577,9 +1461,6 @@ ANY11P(ARGBShuffleRow_Any_NEON, ARGBShuf + #ifdef HAS_ARGBSHUFFLEROW_MSA + ANY11P(ARGBShuffleRow_Any_MSA, ARGBShuffleRow_MSA, const uint8_t*, 4, 4, 7) + #endif +-#ifdef HAS_ARGBSHUFFLEROW_LSX +-ANY11P(ARGBShuffleRow_Any_LSX, ARGBShuffleRow_LSX, const uint8_t*, 4, 4, 7) +-#endif + #ifdef HAS_ARGBSHUFFLEROW_LASX + ANY11P(ARGBShuffleRow_Any_LASX, ARGBShuffleRow_LASX, const uint8_t*, 4, 4, 15) + #endif +@@ -1589,17 +1470,17 @@ ANY11P(ARGBShuffleRow_Any_LASX, ARGBShuf + // Any 1 to 1 with type + #define ANY11T(NAMEANY, ANY_SIMD, SBPP, BPP, STYPE, DTYPE, MASK) \ + void NAMEANY(const STYPE* src_ptr, DTYPE* dst_ptr, int width) { \ +- SIMD_ALIGNED(uint8_t vin[(MASK + 1) * SBPP]); \ +- SIMD_ALIGNED(uint8_t vout[(MASK + 1) * BPP]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ ++ SIMD_ALIGNED(uint8_t temp[(MASK + 1) * SBPP]); \ ++ SIMD_ALIGNED(uint8_t out[(MASK + 1) * BPP]); \ ++ memset(temp, 0, (MASK + 1) * SBPP); /* for msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(src_ptr, dst_ptr, n); \ + } \ +- memcpy(vin, (uint8_t*)(src_ptr) + n * SBPP, r * SBPP); \ +- ANY_SIMD((STYPE*)vin, (DTYPE*)vout, MASK + 1); \ +- memcpy((uint8_t*)(dst_ptr) + n * BPP, vout, r * BPP); \ ++ memcpy(temp, (uint8_t*)(src_ptr) + n * SBPP, r * SBPP); \ ++ ANY_SIMD((STYPE*)temp, (DTYPE*)out, MASK + 1); \ ++ memcpy((uint8_t*)(dst_ptr) + n * BPP, out, r * BPP); \ + } + + #ifdef HAS_ARGBTOAR64ROW_SSSE3 +@@ -1655,17 +1536,17 @@ ANY11T(AB64ToARGBRow_Any_NEON, AB64ToARG + // Any 1 to 1 with parameter and shorts. BPP measures in shorts. + #define ANY11C(NAMEANY, ANY_SIMD, SBPP, BPP, STYPE, DTYPE, MASK) \ + void NAMEANY(const STYPE* src_ptr, DTYPE* dst_ptr, int scale, int width) { \ +- SIMD_ALIGNED(STYPE vin[32]); \ +- SIMD_ALIGNED(DTYPE vout[32]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ ++ SIMD_ALIGNED(STYPE temp[32]); \ ++ SIMD_ALIGNED(DTYPE out[32]); \ ++ memset(temp, 0, 32 * SBPP); /* for msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(src_ptr, dst_ptr, scale, n); \ + } \ +- memcpy(vin, src_ptr + n, r * SBPP); \ +- ANY_SIMD(vin, vout, scale, MASK + 1); \ +- memcpy(dst_ptr + n, vout, r * BPP); \ ++ memcpy(temp, src_ptr + n, r * SBPP); \ ++ ANY_SIMD(temp, out, scale, MASK + 1); \ ++ memcpy(dst_ptr + n, out, r * BPP); \ + } + + #ifdef HAS_CONVERT16TO8ROW_SSSE3 +@@ -1742,17 +1623,17 @@ ANY11C(DivideRow_16_Any_NEON, DivideRow_ + // Any 1 to 1 with parameter and shorts to byte. BPP measures in shorts. + #define ANY11P16(NAMEANY, ANY_SIMD, ST, T, SBPP, BPP, MASK) \ + void NAMEANY(const ST* src_ptr, T* dst_ptr, float param, int width) { \ +- SIMD_ALIGNED(ST vin[32]); \ +- SIMD_ALIGNED(T vout[32]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ ++ SIMD_ALIGNED(ST temp[32]); \ ++ SIMD_ALIGNED(T out[32]); \ ++ memset(temp, 0, SBPP * 32); /* for msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(src_ptr, dst_ptr, param, n); \ + } \ +- memcpy(vin, src_ptr + n, r * SBPP); \ +- ANY_SIMD(vin, vout, param, MASK + 1); \ +- memcpy(dst_ptr + n, vout, r * BPP); \ ++ memcpy(temp, src_ptr + n, r * SBPP); \ ++ ANY_SIMD(temp, out, param, MASK + 1); \ ++ memcpy(dst_ptr + n, out, r * BPP); \ + } + + #ifdef HAS_HALFFLOATROW_SSE2 +@@ -1793,22 +1674,20 @@ ANY11P16(HalfFloatRow_Any_LSX, HalfFloat + #undef ANY11P16 + + // Any 1 to 1 with yuvconstants +-#define ANY11C(NAMEANY, ANY_SIMD, UVSHIFT, SBPP, BPP, MASK) \ +- void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_ptr, \ +- const struct YuvConstants* yuvconstants, int width) { \ +- SIMD_ALIGNED(uint8_t vin[128]); \ +- SIMD_ALIGNED(uint8_t vout[128]); \ +- memset(vin, 0, sizeof(vin)); /* for YUY2 and msan */ \ +- int r = width & MASK; \ +- int n = width & ~MASK; \ +- if (n > 0) { \ +- ANY_SIMD(src_ptr, dst_ptr, yuvconstants, n); \ +- } \ +- memcpy(vin, src_ptr + (n >> UVSHIFT) * SBPP, SS(r, UVSHIFT) * SBPP); \ +- ANY_SIMD(vin, vout, yuvconstants, MASK + 1); \ +- memcpy(dst_ptr + n * BPP, vout, r * BPP); \ ++#define ANY11C(NAMEANY, ANY_SIMD, UVSHIFT, SBPP, BPP, MASK) \ ++ void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_ptr, \ ++ const struct YuvConstants* yuvconstants, int width) { \ ++ SIMD_ALIGNED(uint8_t temp[128 * 2]); \ ++ memset(temp, 0, 128); /* for YUY2 and msan */ \ ++ int r = width & MASK; \ ++ int n = width & ~MASK; \ ++ if (n > 0) { \ ++ ANY_SIMD(src_ptr, dst_ptr, yuvconstants, n); \ ++ } \ ++ memcpy(temp, src_ptr + (n >> UVSHIFT) * SBPP, SS(r, UVSHIFT) * SBPP); \ ++ ANY_SIMD(temp, temp + 128, yuvconstants, MASK + 1); \ ++ memcpy(dst_ptr + n * BPP, temp + 128, r * BPP); \ + } +- + #if defined(HAS_YUY2TOARGBROW_SSSE3) + ANY11C(YUY2ToARGBRow_Any_SSSE3, YUY2ToARGBRow_SSSE3, 1, 4, 4, 15) + ANY11C(UYVYToARGBRow_Any_SSSE3, UYVYToARGBRow_SSSE3, 1, 4, 4, 15) +@@ -1835,21 +1714,21 @@ ANY11C(UYVYToARGBRow_Any_LSX, UYVYToARGB + #define ANY11I(NAMEANY, ANY_SIMD, TD, TS, SBPP, BPP, MASK) \ + void NAMEANY(TD* dst_ptr, const TS* src_ptr, ptrdiff_t src_stride, \ + int width, int source_y_fraction) { \ +- SIMD_ALIGNED(TS vin[64 * 2]); \ +- SIMD_ALIGNED(TD vout[64]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ ++ SIMD_ALIGNED(TS temps[64 * 2]); \ ++ SIMD_ALIGNED(TD tempd[64]); \ ++ memset(temps, 0, sizeof(temps)); /* for msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(dst_ptr, src_ptr, src_stride, n, source_y_fraction); \ + } \ +- memcpy(vin, src_ptr + n * SBPP, r * SBPP * sizeof(TS)); \ ++ memcpy(temps, src_ptr + n * SBPP, r * SBPP * sizeof(TS)); \ + if (source_y_fraction) { \ +- memcpy(vin + 64, src_ptr + src_stride + n * SBPP, \ ++ memcpy(temps + 64, src_ptr + src_stride + n * SBPP, \ + r * SBPP * sizeof(TS)); \ + } \ +- ANY_SIMD(vout, vin, 64, MASK + 1, source_y_fraction); \ +- memcpy(dst_ptr + n * BPP, vout, r * BPP * sizeof(TD)); \ ++ ANY_SIMD(tempd, temps, 64, MASK + 1, source_y_fraction); \ ++ memcpy(dst_ptr + n * BPP, tempd, r * BPP * sizeof(TD)); \ + } + + #ifdef HAS_INTERPOLATEROW_AVX2 +@@ -1889,21 +1768,21 @@ ANY11I(InterpolateRow_16_Any_NEON, + #define ANY11IS(NAMEANY, ANY_SIMD, TD, TS, SBPP, BPP, MASK) \ + void NAMEANY(TD* dst_ptr, const TS* src_ptr, ptrdiff_t src_stride, \ + int scale, int width, int source_y_fraction) { \ +- SIMD_ALIGNED(TS vin[64 * 2]); \ +- SIMD_ALIGNED(TD vout[64]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ ++ SIMD_ALIGNED(TS temps[64 * 2]); \ ++ SIMD_ALIGNED(TD tempd[64]); \ ++ memset(temps, 0, sizeof(temps)); /* for msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(dst_ptr, src_ptr, src_stride, scale, n, source_y_fraction); \ + } \ +- memcpy(vin, src_ptr + n * SBPP, r * SBPP * sizeof(TS)); \ ++ memcpy(temps, src_ptr + n * SBPP, r * SBPP * sizeof(TS)); \ + if (source_y_fraction) { \ +- memcpy(vin + 64, src_ptr + src_stride + n * SBPP, \ ++ memcpy(temps + 64, src_ptr + src_stride + n * SBPP, \ + r * SBPP * sizeof(TS)); \ + } \ +- ANY_SIMD(vout, vin, 64, scale, MASK + 1, source_y_fraction); \ +- memcpy(dst_ptr + n * BPP, vout, r * BPP * sizeof(TD)); \ ++ ANY_SIMD(tempd, temps, 64, scale, MASK + 1, source_y_fraction); \ ++ memcpy(dst_ptr + n * BPP, tempd, r * BPP * sizeof(TD)); \ + } + + #ifdef HAS_INTERPOLATEROW_16TO8_NEON +@@ -1928,19 +1807,18 @@ ANY11IS(InterpolateRow_16To8_Any_AVX2, + #undef ANY11IS + + // Any 1 to 1 mirror. +-#define ANY11M(NAMEANY, ANY_SIMD, BPP, MASK) \ +- void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_ptr, int width) { \ +- SIMD_ALIGNED(uint8_t vin[64]); \ +- SIMD_ALIGNED(uint8_t vout[64]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ +- int r = width & MASK; \ +- int n = width & ~MASK; \ +- if (n > 0) { \ +- ANY_SIMD(src_ptr + r * BPP, dst_ptr, n); \ +- } \ +- memcpy(vin, src_ptr, r* BPP); \ +- ANY_SIMD(vin, vout, MASK + 1); \ +- memcpy(dst_ptr + n * BPP, vout + (MASK + 1 - r) * BPP, r * BPP); \ ++#define ANY11M(NAMEANY, ANY_SIMD, BPP, MASK) \ ++ void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_ptr, int width) { \ ++ SIMD_ALIGNED(uint8_t temp[64 * 2]); \ ++ memset(temp, 0, 64); /* for msan */ \ ++ int r = width & MASK; \ ++ int n = width & ~MASK; \ ++ if (n > 0) { \ ++ ANY_SIMD(src_ptr + r * BPP, dst_ptr, n); \ ++ } \ ++ memcpy(temp, src_ptr, r* BPP); \ ++ ANY_SIMD(temp, temp + 64, MASK + 1); \ ++ memcpy(dst_ptr + n * BPP, temp + 64 + (MASK + 1 - r) * BPP, r * BPP); \ + } + + #ifdef HAS_MIRRORROW_AVX2 +@@ -1955,9 +1833,6 @@ ANY11M(MirrorRow_Any_NEON, MirrorRow_NEO + #ifdef HAS_MIRRORROW_MSA + ANY11M(MirrorRow_Any_MSA, MirrorRow_MSA, 1, 63) + #endif +-#ifdef HAS_MIRRORROW_LSX +-ANY11M(MirrorRow_Any_LSX, MirrorRow_LSX, 1, 31) +-#endif + #ifdef HAS_MIRRORROW_LASX + ANY11M(MirrorRow_Any_LASX, MirrorRow_LASX, 1, 63) + #endif +@@ -1973,9 +1848,6 @@ ANY11M(MirrorUVRow_Any_NEON, MirrorUVRow + #ifdef HAS_MIRRORUVROW_MSA + ANY11M(MirrorUVRow_Any_MSA, MirrorUVRow_MSA, 2, 7) + #endif +-#ifdef HAS_MIRRORUVROW_LSX +-ANY11M(MirrorUVRow_Any_LSX, MirrorUVRow_LSX, 2, 7) +-#endif + #ifdef HAS_MIRRORUVROW_LASX + ANY11M(MirrorUVRow_Any_LASX, MirrorUVRow_LASX, 2, 15) + #endif +@@ -1991,9 +1863,6 @@ ANY11M(ARGBMirrorRow_Any_NEON, ARGBMirro + #ifdef HAS_ARGBMIRRORROW_MSA + ANY11M(ARGBMirrorRow_Any_MSA, ARGBMirrorRow_MSA, 4, 15) + #endif +-#ifdef HAS_ARGBMIRRORROW_LSX +-ANY11M(ARGBMirrorRow_Any_LSX, ARGBMirrorRow_LSX, 4, 7) +-#endif + #ifdef HAS_ARGBMIRRORROW_LASX + ANY11M(ARGBMirrorRow_Any_LASX, ARGBMirrorRow_LASX, 4, 15) + #endif +@@ -2008,14 +1877,15 @@ ANY11M(RGB24MirrorRow_Any_NEON, RGB24Mir + // Any 1 plane. (memset) + #define ANY1(NAMEANY, ANY_SIMD, T, BPP, MASK) \ + void NAMEANY(uint8_t* dst_ptr, T v32, int width) { \ +- SIMD_ALIGNED(uint8_t vout[64]); \ ++ SIMD_ALIGNED(uint8_t temp[64]); \ ++ memset(temp, 0, 64); /* for msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(dst_ptr, v32, n); \ + } \ +- ANY_SIMD(vout, v32, MASK + 1); \ +- memcpy(dst_ptr + n * BPP, vout, r * BPP); \ ++ ANY_SIMD(temp, v32, MASK + 1); \ ++ memcpy(dst_ptr + n * BPP, temp, r * BPP); \ + } + + #ifdef HAS_SETROW_X86 +@@ -2039,21 +1909,20 @@ ANY1(ARGBSetRow_Any_LSX, ARGBSetRow_LSX, + #undef ANY1 + + // Any 1 to 2. Outputs UV planes. +-#define ANY12(NAMEANY, ANY_SIMD, UVSHIFT, BPP, DUVSHIFT, MASK) \ +- void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_u, uint8_t* dst_v, \ +- int width) { \ +- SIMD_ALIGNED(uint8_t vin[128]); \ +- SIMD_ALIGNED(uint8_t vout[128 * 2]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ +- int r = width & MASK; \ +- int n = width & ~MASK; \ +- if (n > 0) { \ +- ANY_SIMD(src_ptr, dst_u, dst_v, n); \ +- } \ +- memcpy(vin, src_ptr + (n >> UVSHIFT) * BPP, SS(r, UVSHIFT) * BPP); \ +- ANY_SIMD(vin, vout, vout + 128, MASK + 1); \ +- memcpy(dst_u + (n >> DUVSHIFT), vout, SS(r, DUVSHIFT)); \ +- memcpy(dst_v + (n >> DUVSHIFT), vout + 128, SS(r, DUVSHIFT)); \ ++#define ANY12(NAMEANY, ANY_SIMD, UVSHIFT, BPP, DUVSHIFT, MASK) \ ++ void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_u, uint8_t* dst_v, \ ++ int width) { \ ++ SIMD_ALIGNED(uint8_t temp[128 * 3]); \ ++ memset(temp, 0, 128); /* for msan */ \ ++ int r = width & MASK; \ ++ int n = width & ~MASK; \ ++ if (n > 0) { \ ++ ANY_SIMD(src_ptr, dst_u, dst_v, n); \ ++ } \ ++ memcpy(temp, src_ptr + (n >> UVSHIFT) * BPP, SS(r, UVSHIFT) * BPP); \ ++ ANY_SIMD(temp, temp + 128, temp + 256, MASK + 1); \ ++ memcpy(dst_u + (n >> DUVSHIFT), temp + 128, SS(r, DUVSHIFT)); \ ++ memcpy(dst_v + (n >> DUVSHIFT), temp + 256, SS(r, DUVSHIFT)); \ + } + + #ifdef HAS_SPLITUVROW_SSE2 +@@ -2092,11 +1961,6 @@ ANY12(ARGBToUV444Row_Any_MSA, ARGBToUV44 + ANY12(YUY2ToUV422Row_Any_MSA, YUY2ToUV422Row_MSA, 1, 4, 1, 31) + ANY12(UYVYToUV422Row_Any_MSA, UYVYToUV422Row_MSA, 1, 4, 1, 31) + #endif +-#ifdef HAS_YUY2TOUV422ROW_LSX +-ANY12(ARGBToUV444Row_Any_LSX, ARGBToUV444Row_LSX, 0, 4, 0, 15) +-ANY12(YUY2ToUV422Row_Any_LSX, YUY2ToUV422Row_LSX, 1, 4, 1, 15) +-ANY12(UYVYToUV422Row_Any_LSX, UYVYToUV422Row_LSX, 1, 4, 1, 15) +-#endif + #ifdef HAS_YUY2TOUV422ROW_LASX + ANY12(ARGBToUV444Row_Any_LASX, ARGBToUV444Row_LASX, 0, 4, 0, 31) + ANY12(YUY2ToUV422Row_Any_LASX, YUY2ToUV422Row_LASX, 1, 4, 1, 31) +@@ -2107,18 +1971,17 @@ ANY12(UYVYToUV422Row_Any_LASX, UYVYToUV4 + // Any 2 16 bit planes with parameter to 1 + #define ANY12PT(NAMEANY, ANY_SIMD, T, BPP, MASK) \ + void NAMEANY(const T* src_uv, T* dst_u, T* dst_v, int depth, int width) { \ +- SIMD_ALIGNED(T vin[16 * 2]); \ +- SIMD_ALIGNED(T vout[16 * 2]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ ++ SIMD_ALIGNED(T temp[16 * 4]); \ ++ memset(temp, 0, 16 * 4 * BPP); /* for msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(src_uv, dst_u, dst_v, depth, n); \ + } \ +- memcpy(vin, src_uv + n * 2, r * BPP * 2); \ +- ANY_SIMD(vin, vout, vout + 16, depth, MASK + 1); \ +- memcpy(dst_u + n, vout, r * BPP); \ +- memcpy(dst_v + n, vout + 16, r * BPP); \ ++ memcpy(temp, src_uv + n * 2, r * BPP * 2); \ ++ ANY_SIMD(temp, temp + 32, temp + 48, depth, MASK + 1); \ ++ memcpy(dst_u + n, temp + 32, r * BPP); \ ++ memcpy(dst_v + n, temp + 48, r * BPP); \ + } + + #ifdef HAS_SPLITUVROW_16_AVX2 +@@ -2132,22 +1995,21 @@ ANY12PT(SplitUVRow_16_Any_NEON, SplitUVR + #undef ANY21CT + + // Any 1 to 3. Outputs RGB planes. +-#define ANY13(NAMEANY, ANY_SIMD, BPP, MASK) \ +- void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_r, uint8_t* dst_g, \ +- uint8_t* dst_b, int width) { \ +- SIMD_ALIGNED(uint8_t vin[16 * 3]); \ +- SIMD_ALIGNED(uint8_t vout[16 * 3]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ +- int r = width & MASK; \ +- int n = width & ~MASK; \ +- if (n > 0) { \ +- ANY_SIMD(src_ptr, dst_r, dst_g, dst_b, n); \ +- } \ +- memcpy(vin, src_ptr + n * BPP, r * BPP); \ +- ANY_SIMD(vin, vout, vout + 16, vout + 32, MASK + 1); \ +- memcpy(dst_r + n, vout, r); \ +- memcpy(dst_g + n, vout + 16, r); \ +- memcpy(dst_b + n, vout + 32, r); \ ++#define ANY13(NAMEANY, ANY_SIMD, BPP, MASK) \ ++ void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_r, uint8_t* dst_g, \ ++ uint8_t* dst_b, int width) { \ ++ SIMD_ALIGNED(uint8_t temp[16 * 6]); \ ++ memset(temp, 0, 16 * 3); /* for msan */ \ ++ int r = width & MASK; \ ++ int n = width & ~MASK; \ ++ if (n > 0) { \ ++ ANY_SIMD(src_ptr, dst_r, dst_g, dst_b, n); \ ++ } \ ++ memcpy(temp, src_ptr + n * BPP, r * BPP); \ ++ ANY_SIMD(temp, temp + 16 * 3, temp + 16 * 4, temp + 16 * 5, MASK + 1); \ ++ memcpy(dst_r + n, temp + 16 * 3, r); \ ++ memcpy(dst_g + n, temp + 16 * 4, r); \ ++ memcpy(dst_b + n, temp + 16 * 5, r); \ + } + + #ifdef HAS_SPLITRGBROW_SSSE3 +@@ -2170,23 +2032,23 @@ ANY13(SplitXRGBRow_Any_NEON, SplitXRGBRo + #endif + + // Any 1 to 4. Outputs ARGB planes. +-#define ANY14(NAMEANY, ANY_SIMD, BPP, MASK) \ +- void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_r, uint8_t* dst_g, \ +- uint8_t* dst_b, uint8_t* dst_a, int width) { \ +- SIMD_ALIGNED(uint8_t vin[16 * 4]); \ +- SIMD_ALIGNED(uint8_t vout[16 * 4]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ +- int r = width & MASK; \ +- int n = width & ~MASK; \ +- if (n > 0) { \ +- ANY_SIMD(src_ptr, dst_r, dst_g, dst_b, dst_a, n); \ +- } \ +- memcpy(vin, src_ptr + n * BPP, r * BPP); \ +- ANY_SIMD(vin, vout, vout + 16, vout + 32, vout + 48, MASK + 1); \ +- memcpy(dst_r + n, vout, r); \ +- memcpy(dst_g + n, vout + 16, r); \ +- memcpy(dst_b + n, vout + 32, r); \ +- memcpy(dst_a + n, vout + 48, r); \ ++#define ANY14(NAMEANY, ANY_SIMD, BPP, MASK) \ ++ void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_r, uint8_t* dst_g, \ ++ uint8_t* dst_b, uint8_t* dst_a, int width) { \ ++ SIMD_ALIGNED(uint8_t temp[16 * 8]); \ ++ memset(temp, 0, 16 * 4); /* for msan */ \ ++ int r = width & MASK; \ ++ int n = width & ~MASK; \ ++ if (n > 0) { \ ++ ANY_SIMD(src_ptr, dst_r, dst_g, dst_b, dst_a, n); \ ++ } \ ++ memcpy(temp, src_ptr + n * BPP, r * BPP); \ ++ ANY_SIMD(temp, temp + 16 * 4, temp + 16 * 5, temp + 16 * 6, temp + 16 * 7, \ ++ MASK + 1); \ ++ memcpy(dst_r + n, temp + 16 * 4, r); \ ++ memcpy(dst_g + n, temp + 16 * 5, r); \ ++ memcpy(dst_b + n, temp + 16 * 6, r); \ ++ memcpy(dst_a + n, temp + 16 * 7, r); \ + } + + #ifdef HAS_SPLITARGBROW_SSE2 +@@ -2207,26 +2069,25 @@ ANY14(SplitARGBRow_Any_NEON, SplitARGBRo + #define ANY12S(NAMEANY, ANY_SIMD, UVSHIFT, BPP, MASK) \ + void NAMEANY(const uint8_t* src_ptr, int src_stride, uint8_t* dst_u, \ + uint8_t* dst_v, int width) { \ +- SIMD_ALIGNED(uint8_t vin[128 * 2]); \ +- SIMD_ALIGNED(uint8_t vout[128 * 2]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ ++ SIMD_ALIGNED(uint8_t temp[128 * 4]); \ ++ memset(temp, 0, 128 * 2); /* for msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(src_ptr, src_stride, dst_u, dst_v, n); \ + } \ +- memcpy(vin, src_ptr + (n >> UVSHIFT) * BPP, SS(r, UVSHIFT) * BPP); \ +- memcpy(vin + 128, src_ptr + src_stride + (n >> UVSHIFT) * BPP, \ ++ memcpy(temp, src_ptr + (n >> UVSHIFT) * BPP, SS(r, UVSHIFT) * BPP); \ ++ memcpy(temp + 128, src_ptr + src_stride + (n >> UVSHIFT) * BPP, \ + SS(r, UVSHIFT) * BPP); \ + if ((width & 1) && UVSHIFT == 0) { /* repeat last pixel for subsample */ \ +- memcpy(vin + SS(r, UVSHIFT) * BPP, vin + SS(r, UVSHIFT) * BPP - BPP, \ ++ memcpy(temp + SS(r, UVSHIFT) * BPP, temp + SS(r, UVSHIFT) * BPP - BPP, \ + BPP); \ +- memcpy(vin + 128 + SS(r, UVSHIFT) * BPP, \ +- vin + 128 + SS(r, UVSHIFT) * BPP - BPP, BPP); \ ++ memcpy(temp + 128 + SS(r, UVSHIFT) * BPP, \ ++ temp + 128 + SS(r, UVSHIFT) * BPP - BPP, BPP); \ + } \ +- ANY_SIMD(vin, 128, vout, vout + 128, MASK + 1); \ +- memcpy(dst_u + (n >> 1), vout, SS(r, 1)); \ +- memcpy(dst_v + (n >> 1), vout + 128, SS(r, 1)); \ ++ ANY_SIMD(temp, 128, temp + 256, temp + 384, MASK + 1); \ ++ memcpy(dst_u + (n >> 1), temp + 256, SS(r, 1)); \ ++ memcpy(dst_v + (n >> 1), temp + 384, SS(r, 1)); \ + } + + #ifdef HAS_ARGBTOUVROW_AVX2 +@@ -2264,30 +2125,18 @@ ANY12S(UYVYToUVRow_Any_SSE2, UYVYToUVRow + #ifdef HAS_ARGBTOUVROW_NEON + ANY12S(ARGBToUVRow_Any_NEON, ARGBToUVRow_NEON, 0, 4, 15) + #endif +-#ifdef HAS_ARGBTOUVROW_SVE2 +-ANY12S(ARGBToUVRow_Any_SVE2, ARGBToUVRow_SVE2, 0, 4, 1) +-#endif + #ifdef HAS_ARGBTOUVROW_MSA + ANY12S(ARGBToUVRow_Any_MSA, ARGBToUVRow_MSA, 0, 4, 31) + #endif +-#ifdef HAS_ARGBTOUVROW_LSX +-ANY12S(ARGBToUVRow_Any_LSX, ARGBToUVRow_LSX, 0, 4, 15) +-#endif + #ifdef HAS_ARGBTOUVROW_LASX + ANY12S(ARGBToUVRow_Any_LASX, ARGBToUVRow_LASX, 0, 4, 31) + #endif + #ifdef HAS_ARGBTOUVJROW_NEON + ANY12S(ARGBToUVJRow_Any_NEON, ARGBToUVJRow_NEON, 0, 4, 15) + #endif +-#ifdef HAS_ARGBTOUVJROW_SVE2 +-ANY12S(ARGBToUVJRow_Any_SVE2, ARGBToUVJRow_SVE2, 0, 4, 1) +-#endif + #ifdef HAS_ABGRTOUVJROW_NEON + ANY12S(ABGRToUVJRow_Any_NEON, ABGRToUVJRow_NEON, 0, 4, 15) + #endif +-#ifdef HAS_ABGRTOUVJROW_SVE2 +-ANY12S(ABGRToUVJRow_Any_SVE2, ABGRToUVJRow_SVE2, 0, 4, 1) +-#endif + #ifdef HAS_ARGBTOUVJROW_MSA + ANY12S(ARGBToUVJRow_Any_MSA, ARGBToUVJRow_MSA, 0, 4, 31) + #endif +@@ -2300,9 +2149,6 @@ ANY12S(ARGBToUVJRow_Any_LASX, ARGBToUVJR + #ifdef HAS_BGRATOUVROW_NEON + ANY12S(BGRAToUVRow_Any_NEON, BGRAToUVRow_NEON, 0, 4, 15) + #endif +-#ifdef HAS_BGRATOUVROW_SVE2 +-ANY12S(BGRAToUVRow_Any_SVE2, BGRAToUVRow_SVE2, 0, 4, 1) +-#endif + #ifdef HAS_BGRATOUVROW_MSA + ANY12S(BGRAToUVRow_Any_MSA, BGRAToUVRow_MSA, 0, 4, 15) + #endif +@@ -2312,9 +2158,6 @@ ANY12S(BGRAToUVRow_Any_LSX, BGRAToUVRow_ + #ifdef HAS_ABGRTOUVROW_NEON + ANY12S(ABGRToUVRow_Any_NEON, ABGRToUVRow_NEON, 0, 4, 15) + #endif +-#ifdef HAS_ABGRTOUVROW_SVE2 +-ANY12S(ABGRToUVRow_Any_SVE2, ABGRToUVRow_SVE2, 0, 4, 1) +-#endif + #ifdef HAS_ABGRTOUVROW_MSA + ANY12S(ABGRToUVRow_Any_MSA, ABGRToUVRow_MSA, 0, 4, 15) + #endif +@@ -2324,9 +2167,6 @@ ANY12S(ABGRToUVRow_Any_LSX, ABGRToUVRow_ + #ifdef HAS_RGBATOUVROW_NEON + ANY12S(RGBAToUVRow_Any_NEON, RGBAToUVRow_NEON, 0, 4, 15) + #endif +-#ifdef HAS_RGBATOUVROW_SVE2 +-ANY12S(RGBAToUVRow_Any_SVE2, RGBAToUVRow_SVE2, 0, 4, 1) +-#endif + #ifdef HAS_RGBATOUVROW_MSA + ANY12S(RGBAToUVRow_Any_MSA, RGBAToUVRow_MSA, 0, 4, 15) + #endif +@@ -2399,18 +2239,12 @@ ANY12S(UYVYToUVRow_Any_NEON, UYVYToUVRow + #ifdef HAS_YUY2TOUVROW_MSA + ANY12S(YUY2ToUVRow_Any_MSA, YUY2ToUVRow_MSA, 1, 4, 31) + #endif +-#ifdef HAS_YUY2TOUVROW_LSX +-ANY12S(YUY2ToUVRow_Any_LSX, YUY2ToUVRow_LSX, 1, 4, 15) +-#endif + #ifdef HAS_YUY2TOUVROW_LASX + ANY12S(YUY2ToUVRow_Any_LASX, YUY2ToUVRow_LASX, 1, 4, 31) + #endif + #ifdef HAS_UYVYTOUVROW_MSA + ANY12S(UYVYToUVRow_Any_MSA, UYVYToUVRow_MSA, 1, 4, 31) + #endif +-#ifdef HAS_UYVYTOUVROW_LSX +-ANY12S(UYVYToUVRow_Any_LSX, UYVYToUVRow_LSX, 1, 4, 15) +-#endif + #ifdef HAS_UYVYTOUVROW_LASX + ANY12S(UYVYToUVRow_Any_LASX, UYVYToUVRow_LASX, 1, 4, 31) + #endif +@@ -2421,52 +2255,44 @@ ANY12S(UYVYToUVRow_Any_LASX, UYVYToUVRow + #define ANY11S(NAMEANY, ANY_SIMD, UVSHIFT, BPP, MASK) \ + void NAMEANY(const uint8_t* src_ptr, int src_stride, uint8_t* dst_vu, \ + int width) { \ +- SIMD_ALIGNED(uint8_t vin[128 * 2]); \ +- SIMD_ALIGNED(uint8_t vout[128]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ ++ SIMD_ALIGNED(uint8_t temp[128 * 3]); \ ++ memset(temp, 0, 128 * 2); /* for msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(src_ptr, src_stride, dst_vu, n); \ + } \ +- memcpy(vin, src_ptr + (n >> UVSHIFT) * BPP, SS(r, UVSHIFT) * BPP); \ +- memcpy(vin + 128, src_ptr + src_stride + (n >> UVSHIFT) * BPP, \ ++ memcpy(temp, src_ptr + (n >> UVSHIFT) * BPP, SS(r, UVSHIFT) * BPP); \ ++ memcpy(temp + 128, src_ptr + src_stride + (n >> UVSHIFT) * BPP, \ + SS(r, UVSHIFT) * BPP); \ + if ((width & 1) && UVSHIFT == 0) { /* repeat last pixel for subsample */ \ +- memcpy(vin + SS(r, UVSHIFT) * BPP, vin + SS(r, UVSHIFT) * BPP - BPP, \ ++ memcpy(temp + SS(r, UVSHIFT) * BPP, temp + SS(r, UVSHIFT) * BPP - BPP, \ + BPP); \ +- memcpy(vin + 128 + SS(r, UVSHIFT) * BPP, \ +- vin + 128 + SS(r, UVSHIFT) * BPP - BPP, BPP); \ ++ memcpy(temp + 128 + SS(r, UVSHIFT) * BPP, \ ++ temp + 128 + SS(r, UVSHIFT) * BPP - BPP, BPP); \ + } \ +- ANY_SIMD(vin, 128, vout, MASK + 1); \ +- memcpy(dst_vu + (n >> 1) * 2, vout, SS(r, 1) * 2); \ ++ ANY_SIMD(temp, 128, temp + 256, MASK + 1); \ ++ memcpy(dst_vu + (n >> 1) * 2, temp + 256, SS(r, 1) * 2); \ + } + + #ifdef HAS_AYUVTOVUROW_NEON + ANY11S(AYUVToUVRow_Any_NEON, AYUVToUVRow_NEON, 0, 4, 15) + ANY11S(AYUVToVURow_Any_NEON, AYUVToVURow_NEON, 0, 4, 15) + #endif +-#ifdef HAS_AYUVTOUVROW_SVE2 +-ANY11S(AYUVToUVRow_Any_SVE2, AYUVToUVRow_SVE2, 0, 4, 1) +-#endif +-#ifdef HAS_AYUVTOVUROW_SVE2 +-ANY11S(AYUVToVURow_Any_SVE2, AYUVToVURow_SVE2, 0, 4, 1) +-#endif + #undef ANY11S + + #define ANYDETILE(NAMEANY, ANY_SIMD, T, BPP, MASK) \ + void NAMEANY(const T* src, ptrdiff_t src_tile_stride, T* dst, int width) { \ +- SIMD_ALIGNED(T vin[16]); \ +- SIMD_ALIGNED(T vout[16]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ ++ SIMD_ALIGNED(T temp[16 * 2]); \ ++ memset(temp, 0, 16 * BPP); /* for msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(src, src_tile_stride, dst, n); \ + } \ +- memcpy(vin, src + (n / 16) * src_tile_stride, r * BPP); \ +- ANY_SIMD(vin, src_tile_stride, vout, MASK + 1); \ +- memcpy(dst + n, vout, r * BPP); \ ++ memcpy(temp, src + (n / 16) * src_tile_stride, r * BPP); \ ++ ANY_SIMD(temp, src_tile_stride, temp + 16, MASK + 1); \ ++ memcpy(dst + n, temp + 16, r * BPP); \ + } + + #ifdef HAS_DETILEROW_NEON +@@ -2485,22 +2311,20 @@ ANYDETILE(DetileRow_16_Any_SSE2, DetileR + ANYDETILE(DetileRow_16_Any_AVX, DetileRow_16_AVX, uint16_t, 2, 15) + #endif + +-// DetileSplitUVRow width is in bytes + #define ANYDETILESPLITUV(NAMEANY, ANY_SIMD, MASK) \ + void NAMEANY(const uint8_t* src_uv, ptrdiff_t src_tile_stride, \ + uint8_t* dst_u, uint8_t* dst_v, int width) { \ +- SIMD_ALIGNED(uint8_t vin[16]); \ +- SIMD_ALIGNED(uint8_t vout[8 * 2]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ ++ SIMD_ALIGNED(uint8_t temp[16 * 2]); \ ++ memset(temp, 0, 16 * 2); /* for msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(src_uv, src_tile_stride, dst_u, dst_v, n); \ + } \ +- memcpy(vin, src_uv + (n / 16) * src_tile_stride, r); \ +- ANY_SIMD(vin, src_tile_stride, vout, vout + 8, r); \ +- memcpy(dst_u + n / 2, vout, (r + 1) / 2); \ +- memcpy(dst_v + n / 2, vout + 8, (r + 1) / 2); \ ++ memcpy(temp, src_uv + (n / 16) * src_tile_stride, r); \ ++ ANY_SIMD(temp, src_tile_stride, temp + 16, temp + 24, r); \ ++ memcpy(dst_u + n / 2, temp + 16, (r + 1) / 2); \ ++ memcpy(dst_v + n / 2, temp + 24, (r + 1) / 2); \ + } + + #ifdef HAS_DETILESPLITUVROW_NEON +@@ -2514,19 +2338,19 @@ ANYDETILESPLITUV(DetileSplitUVRow_Any_SS + void NAMEANY(const uint8_t* src_y, ptrdiff_t src_y_tile_stride, \ + const uint8_t* src_uv, ptrdiff_t src_uv_tile_stride, \ + uint8_t* dst_yuy2, int width) { \ +- SIMD_ALIGNED(uint8_t vin[16 * 2]); \ +- SIMD_ALIGNED(uint8_t vout[16 * 2]); \ +- memset(vin, 0, sizeof(vin)); /* for msan */ \ ++ SIMD_ALIGNED(uint8_t temp[16 * 4]); \ ++ memset(temp, 0, 16 * 4); /* for msan */ \ + int r = width & MASK; \ + int n = width & ~MASK; \ + if (n > 0) { \ + ANY_SIMD(src_y, src_y_tile_stride, src_uv, src_uv_tile_stride, dst_yuy2, \ + n); \ + } \ +- memcpy(vin, src_y + (n / 16) * src_y_tile_stride, r); \ +- memcpy(vin + 16, src_uv + (n / 16) * src_uv_tile_stride, r); \ +- ANY_SIMD(vin, src_y_tile_stride, vin + 16, src_uv_tile_stride, vout, r); \ +- memcpy(dst_yuy2 + 2 * n, vout, 2 * r); \ ++ memcpy(temp, src_y + (n / 16) * src_y_tile_stride, r); \ ++ memcpy(temp + 16, src_uv + (n / 16) * src_uv_tile_stride, r); \ ++ ANY_SIMD(temp, src_y_tile_stride, temp + 16, src_uv_tile_stride, \ ++ temp + 32, r); \ ++ memcpy(dst_yuy2 + 2 * n, temp + 32, 2 * r); \ + } + + #ifdef HAS_DETILETOYUY2_NEON +diff --git a/media/libyuv/libyuv/source/row_common.cc b/media/libyuv/libyuv/source/row_common.cc +--- a/media/libyuv/libyuv/source/row_common.cc ++++ b/media/libyuv/libyuv/source/row_common.cc +@@ -48,6 +48,7 @@ extern "C" { + defined(__i386__) || defined(_M_IX86)) + #define LIBYUV_ARGBTOUV_PAVGB 1 + #define LIBYUV_RGBTOU_TRUNCATE 1 ++#define LIBYUV_ATTENUATE_DUP 1 + #endif + #if defined(LIBYUV_BIT_EXACT) + #define LIBYUV_UNATTENUATE_DUP 1 +@@ -281,54 +282,6 @@ void AR30ToAB30Row_C(const uint8_t* src_ + } + } + +-void ARGBToABGRRow_C(const uint8_t* src_argb, uint8_t* dst_abgr, int width) { +- int x; +- for (x = 0; x < width; ++x) { +- uint8_t b = src_argb[0]; +- uint8_t g = src_argb[1]; +- uint8_t r = src_argb[2]; +- uint8_t a = src_argb[3]; +- dst_abgr[0] = r; +- dst_abgr[1] = g; +- dst_abgr[2] = b; +- dst_abgr[3] = a; +- dst_abgr += 4; +- src_argb += 4; +- } +-} +- +-void ARGBToBGRARow_C(const uint8_t* src_argb, uint8_t* dst_bgra, int width) { +- int x; +- for (x = 0; x < width; ++x) { +- uint8_t b = src_argb[0]; +- uint8_t g = src_argb[1]; +- uint8_t r = src_argb[2]; +- uint8_t a = src_argb[3]; +- dst_bgra[0] = a; +- dst_bgra[1] = r; +- dst_bgra[2] = g; +- dst_bgra[3] = b; +- dst_bgra += 4; +- src_argb += 4; +- } +-} +- +-void ARGBToRGBARow_C(const uint8_t* src_argb, uint8_t* dst_rgba, int width) { +- int x; +- for (x = 0; x < width; ++x) { +- uint8_t b = src_argb[0]; +- uint8_t g = src_argb[1]; +- uint8_t r = src_argb[2]; +- uint8_t a = src_argb[3]; +- dst_rgba[0] = a; +- dst_rgba[1] = b; +- dst_rgba[2] = g; +- dst_rgba[3] = r; +- dst_rgba += 4; +- src_argb += 4; +- } +-} +- + void ARGBToRGB24Row_C(const uint8_t* src_argb, uint8_t* dst_rgb, int width) { + int x; + for (x = 0; x < width; ++x) { +@@ -357,22 +310,6 @@ void ARGBToRAWRow_C(const uint8_t* src_a + } + } + +-void RGBAToARGBRow_C(const uint8_t* src_rgba, uint8_t* dst_argb, int width) { +- int x; +- for (x = 0; x < width; ++x) { +- uint8_t a = src_rgba[0]; +- uint8_t b = src_rgba[1]; +- uint8_t g = src_rgba[2]; +- uint8_t r = src_rgba[3]; +- dst_argb[0] = b; +- dst_argb[1] = g; +- dst_argb[2] = r; +- dst_argb[3] = a; +- dst_argb += 4; +- src_rgba += 4; +- } +-} +- + void ARGBToRGB565Row_C(const uint8_t* src_argb, uint8_t* dst_rgb, int width) { + int x; + for (x = 0; x < width - 1; x += 2) { +@@ -405,7 +342,7 @@ void ARGBToRGB565Row_C(const uint8_t* sr + // or the upper byte for big endian. + void ARGBToRGB565DitherRow_C(const uint8_t* src_argb, + uint8_t* dst_rgb, +- uint32_t dither4, ++ const uint32_t dither4, + int width) { + int x; + for (x = 0; x < width - 1; x += 2) { +@@ -492,12 +429,12 @@ void ARGBToARGB4444Row_C(const uint8_t* + void ABGRToAR30Row_C(const uint8_t* src_abgr, uint8_t* dst_ar30, int width) { + int x; + for (x = 0; x < width; ++x) { +- uint32_t r0 = (src_abgr[0] >> 6) | ((uint32_t)(src_abgr[0]) << 2); ++ uint32_t b0 = (src_abgr[0] >> 6) | ((uint32_t)(src_abgr[0]) << 2); + uint32_t g0 = (src_abgr[1] >> 6) | ((uint32_t)(src_abgr[1]) << 2); +- uint32_t b0 = (src_abgr[2] >> 6) | ((uint32_t)(src_abgr[2]) << 2); ++ uint32_t r0 = (src_abgr[2] >> 6) | ((uint32_t)(src_abgr[2]) << 2); + uint32_t a0 = (src_abgr[3] >> 6); + *(uint32_t*)(dst_ar30) = +- STATIC_CAST(uint32_t, b0 | (g0 << 10) | (r0 << 20) | (a0 << 30)); ++ STATIC_CAST(uint32_t, r0 | (g0 << 10) | (b0 << 20) | (a0 << 30)); + dst_ar30 += 4; + src_abgr += 4; + } +@@ -581,22 +518,6 @@ void AB64ToARGBRow_C(const uint16_t* src + } + } + +-void AR64ToAB64Row_C(const uint16_t* src_ar64, uint16_t* dst_ab64, int width) { +- int x; +- for (x = 0; x < width; ++x) { +- uint16_t b = src_ar64[0]; +- uint16_t g = src_ar64[1]; +- uint16_t r = src_ar64[2]; +- uint16_t a = src_ar64[3]; +- dst_ab64[0] = r; +- dst_ab64[1] = g; +- dst_ab64[2] = b; +- dst_ab64[3] = a; +- dst_ab64 += 4; +- src_ar64 += 4; +- } +-} +- + // TODO(fbarchard): Make shuffle compatible with SIMD versions + void AR64ShuffleRow_C(const uint8_t* src_ar64, + uint8_t* dst_ar64, +@@ -1563,7 +1484,7 @@ void J400ToARGBRow_C(const uint8_t* src_ + + // clang-format off + +-#if defined(__aarch64__) || defined(__arm__) || defined(__riscv) ++#if defined(__aarch64__) || defined(__arm__) + // Bias values include subtract 128 from U and V, bias from Y and rounding. + // For B and R bias is negative. For G bias is positive. + #define YUVCONSTANTSBODY(YG, YB, UB, UG, VG, VR) \ +@@ -1759,7 +1680,7 @@ MAKEYUVCONSTANTS(V2020, YG, YB, UB, UG, + + #undef MAKEYUVCONSTANTS + +-#if defined(__aarch64__) || defined(__arm__) || defined(__riscv) ++#if defined(__aarch64__) || defined(__arm__) + #define LOAD_YUV_CONSTANTS \ + int ub = yuvconstants->kUVCoeff[0]; \ + int vr = yuvconstants->kUVCoeff[1]; \ +@@ -1947,7 +1868,7 @@ static __inline void YPixel(uint8_t y, + uint8_t* g, + uint8_t* r, + const struct YuvConstants* yuvconstants) { +-#if defined(__aarch64__) || defined(__arm__) || defined(__riscv) ++#if defined(__aarch64__) || defined(__arm__) + int yg = yuvconstants->kRGBCoeffBias[0]; + int ygb = yuvconstants->kRGBCoeffBias[4]; + #else +@@ -1955,10 +1876,9 @@ static __inline void YPixel(uint8_t y, + int yg = yuvconstants->kYToRgb[0]; + #endif + uint32_t y1 = (uint32_t)(y * 0x0101 * yg) >> 16; +- uint8_t b8 = STATIC_CAST(uint8_t, Clamp(((int32_t)(y1) + ygb) >> 6)); +- *b = b8; +- *g = b8; +- *r = b8; ++ *b = STATIC_CAST(uint8_t, Clamp(((int32_t)(y1) + ygb) >> 6)); ++ *g = STATIC_CAST(uint8_t, Clamp(((int32_t)(y1) + ygb) >> 6)); ++ *r = STATIC_CAST(uint8_t, Clamp(((int32_t)(y1) + ygb) >> 6)); + } + + void I444ToARGBRow_C(const uint8_t* src_y, +@@ -2948,21 +2868,24 @@ void DetileToYUY2_C(const uint8_t* src_y + // Unpack MT2T into tiled P010 64 pixels at a time. MT2T's bitstream is encoded + // in 80 byte blocks representing 64 pixels each. The first 16 bytes of the + // block contain all of the lower 2 bits of each pixel packed together, and the +-// next 64 bytes represent all the upper 8 bits of the pixel. The lower bits are +-// packed into 1x4 blocks, whereas the upper bits are packed in normal raster +-// order. ++// next 64 bytes represent all the upper 8 bits of the pixel. + void UnpackMT2T_C(const uint8_t* src, uint16_t* dst, size_t size) { + for (size_t i = 0; i < size; i += 80) { + const uint8_t* src_lower_bits = src; + const uint8_t* src_upper_bits = src + 16; + +- for (int j = 0; j < 4; j++) { +- for (int k = 0; k < 16; k++) { +- *dst++ = ((src_lower_bits[k] >> (j * 2)) & 0x3) << 6 | +- (uint16_t)*src_upper_bits << 8 | +- (uint16_t)*src_upper_bits >> 2; +- src_upper_bits++; +- } ++ for (int j = 0; j < 16; j++) { ++ uint8_t lower_bits = src_lower_bits[j]; ++ *dst++ = (lower_bits & 0x03) << 6 | (uint16_t)src_upper_bits[j * 4] << 8 | ++ (uint16_t)src_upper_bits[j * 4] >> 2; ++ *dst++ = (lower_bits & 0x0C) << 4 | ++ (uint16_t)src_upper_bits[j * 4 + 1] << 8 | ++ (uint16_t)src_upper_bits[j * 4 + 1] >> 2; ++ *dst++ = (lower_bits & 0x30) << 2 | ++ (uint16_t)src_upper_bits[j * 4 + 2] << 8 | ++ (uint16_t)src_upper_bits[j * 4 + 2] >> 2; ++ *dst++ = (lower_bits & 0xC0) | (uint16_t)src_upper_bits[j * 4 + 3] << 8 | ++ (uint16_t)src_upper_bits[j * 4 + 3] >> 2; + } + + src += 80; +@@ -3449,7 +3372,12 @@ void BlendPlaneRow_C(const uint8_t* src0 + } + #undef UBLEND + +-#define ATTENUATE(f, a) (f * a + 255) >> 8 ++#if LIBYUV_ATTENUATE_DUP ++// This code mimics the SSSE3 version for better testability. ++#define ATTENUATE(f, a) (a | (a << 8)) * (f | (f << 8)) >> 24 ++#else ++#define ATTENUATE(f, a) (f * a + 128) >> 8 ++#endif + + // Multiply source RGB by alpha and store to destination. + void ARGBAttenuateRow_C(const uint8_t* src_argb, uint8_t* dst_argb, int width) { +@@ -4619,4 +4547,4 @@ void HalfMergeUVRow_C(const uint8_t* src + #ifdef __cplusplus + } // extern "C" + } // namespace libyuv +-#endif ++#endif +\ No newline at end of file +diff --git a/media/libyuv/libyuv/source/row_gcc.cc b/media/libyuv/libyuv/source/row_gcc.cc +--- a/media/libyuv/libyuv/source/row_gcc.cc ++++ b/media/libyuv/libyuv/source/row_gcc.cc +@@ -17,6 +17,8 @@ extern "C" { + // This module is for GCC x86 and x64. + #if !defined(LIBYUV_DISABLE_X86) && (defined(__x86_64__) || defined(__i386__)) + ++#include ++ + #if defined(HAS_ARGBTOYROW_SSSE3) || defined(HAS_ARGBGRAYROW_SSSE3) + + // Constants for ARGB +@@ -137,20 +139,24 @@ static const uvec8 kShuffleMaskARGBToRGB + 0u, 1u, 2u, 4u, 5u, 6u, 8u, 9u, 128u, 128u, 128u, 128u, 10u, 12u, 13u, 14u}; + + // YUY2 shuf 16 Y to 32 Y. +-static const vec8 kShuffleYUY2Y = {0, 0, 2, 2, 4, 4, 6, 6, +- 8, 8, 10, 10, 12, 12, 14, 14}; ++static const lvec8 kShuffleYUY2Y = {0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, ++ 10, 12, 12, 14, 14, 0, 0, 2, 2, 4, 4, ++ 6, 6, 8, 8, 10, 10, 12, 12, 14, 14}; + + // YUY2 shuf 8 UV to 16 UV. +-static const vec8 kShuffleYUY2UV = {1, 3, 1, 3, 5, 7, 5, 7, +- 9, 11, 9, 11, 13, 15, 13, 15}; ++static const lvec8 kShuffleYUY2UV = {1, 3, 1, 3, 5, 7, 5, 7, 9, 11, 9, ++ 11, 13, 15, 13, 15, 1, 3, 1, 3, 5, 7, ++ 5, 7, 9, 11, 9, 11, 13, 15, 13, 15}; + + // UYVY shuf 16 Y to 32 Y. +-static const vec8 kShuffleUYVYY = {1, 1, 3, 3, 5, 5, 7, 7, +- 9, 9, 11, 11, 13, 13, 15, 15}; ++static const lvec8 kShuffleUYVYY = {1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, ++ 11, 13, 13, 15, 15, 1, 1, 3, 3, 5, 5, ++ 7, 7, 9, 9, 11, 11, 13, 13, 15, 15}; + + // UYVY shuf 8 UV to 16 UV. +-static const vec8 kShuffleUYVYUV = {0, 2, 0, 2, 4, 6, 4, 6, +- 8, 10, 8, 10, 12, 14, 12, 14}; ++static const lvec8 kShuffleUYVYUV = {0, 2, 0, 2, 4, 6, 4, 6, 8, 10, 8, ++ 10, 12, 14, 12, 14, 0, 2, 0, 2, 4, 6, ++ 4, 6, 8, 10, 8, 10, 12, 14, 12, 14}; + + // NV21 shuf 8 VU to 16 UV. + static const lvec8 kShuffleNV21 = { +@@ -161,7 +167,7 @@ static const lvec8 kShuffleNV21 = { + + #ifdef HAS_J400TOARGBROW_SSE2 + void J400ToARGBRow_SSE2(const uint8_t* src_y, uint8_t* dst_argb, int width) { +- asm volatile ( ++ asm volatile( + "pcmpeqb %%xmm5,%%xmm5 \n" + "pslld $0x18,%%xmm5 \n" + +@@ -192,7 +198,7 @@ void J400ToARGBRow_SSE2(const uint8_t* s + void RGB24ToARGBRow_SSSE3(const uint8_t* src_rgb24, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "pcmpeqb %%xmm5,%%xmm5 \n" // 0xff000000 + "pslld $0x18,%%xmm5 \n" + "movdqa %3,%%xmm4 \n" +@@ -230,7 +236,7 @@ void RGB24ToARGBRow_SSSE3(const uint8_t* + } + + void RAWToARGBRow_SSSE3(const uint8_t* src_raw, uint8_t* dst_argb, int width) { +- asm volatile ( ++ asm volatile( + "pcmpeqb %%xmm5,%%xmm5 \n" // 0xff000000 + "pslld $0x18,%%xmm5 \n" + "movdqa %3,%%xmm4 \n" +@@ -269,7 +275,7 @@ void RAWToARGBRow_SSSE3(const uint8_t* s + + // Same code as RAWToARGB with different shuffler and A in low bits + void RAWToRGBARow_SSSE3(const uint8_t* src_raw, uint8_t* dst_rgba, int width) { +- asm volatile ( ++ asm volatile( + "pcmpeqb %%xmm5,%%xmm5 \n" // 0x000000ff + "psrld $0x18,%%xmm5 \n" + "movdqa %3,%%xmm4 \n" +@@ -309,7 +315,7 @@ void RAWToRGBARow_SSSE3(const uint8_t* s + void RAWToRGB24Row_SSSE3(const uint8_t* src_raw, + uint8_t* dst_rgb24, + int width) { +- asm volatile ( ++ asm volatile( + "movdqa %3,%%xmm3 \n" + "movdqa %4,%%xmm4 \n" + "movdqa %5,%%xmm5 \n" +@@ -339,7 +345,7 @@ void RAWToRGB24Row_SSSE3(const uint8_t* + } + + void RGB565ToARGBRow_SSE2(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + "mov $0x1080108,%%eax \n" + "movd %%eax,%%xmm5 \n" + "pshufd $0x0,%%xmm5,%%xmm5 \n" +@@ -387,7 +393,7 @@ void RGB565ToARGBRow_SSE2(const uint8_t* + } + + void ARGB1555ToARGBRow_SSE2(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + "mov $0x1080108,%%eax \n" + "movd %%eax,%%xmm5 \n" + "pshufd $0x0,%%xmm5,%%xmm5 \n" +@@ -438,7 +444,7 @@ void ARGB1555ToARGBRow_SSE2(const uint8_ + } + + void ARGB4444ToARGBRow_SSE2(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + "mov $0xf0f0f0f,%%eax \n" + "movd %%eax,%%xmm4 \n" + "pshufd $0x0,%%xmm4,%%xmm4 \n" +@@ -475,7 +481,8 @@ void ARGB4444ToARGBRow_SSE2(const uint8_ + } + + void ARGBToRGB24Row_SSSE3(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( ++ + "movdqa %3,%%xmm6 \n" + + LABELALIGN +@@ -513,7 +520,8 @@ void ARGBToRGB24Row_SSSE3(const uint8_t* + } + + void ARGBToRAWRow_SSSE3(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( ++ + "movdqa %3,%%xmm6 \n" + + LABELALIGN +@@ -555,7 +563,7 @@ void ARGBToRAWRow_SSSE3(const uint8_t* s + static const lvec32 kPermdRGB24_AVX = {0, 1, 2, 4, 5, 6, 3, 7}; + + void ARGBToRGB24Row_AVX2(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + "vbroadcastf128 %3,%%ymm6 \n" + "vmovdqa %4,%%ymm7 \n" + +@@ -615,7 +623,7 @@ static const ulvec8 kPermARGBToRGB24_2 = + 50u, 52u, 53u, 54u, 56u, 57u, 58u, 60u, 61u, 62u}; + + void ARGBToRGB24Row_AVX512VBMI(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + "vmovdqa %3,%%ymm5 \n" + "vmovdqa %4,%%ymm6 \n" + "vmovdqa %5,%%ymm7 \n" +@@ -649,7 +657,7 @@ void ARGBToRGB24Row_AVX512VBMI(const uin + + #ifdef HAS_ARGBTORAWROW_AVX2 + void ARGBToRAWRow_AVX2(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + "vbroadcastf128 %3,%%ymm6 \n" + "vmovdqa %4,%%ymm7 \n" + +@@ -694,7 +702,7 @@ void ARGBToRAWRow_AVX2(const uint8_t* sr + #endif + + void ARGBToRGB565Row_SSE2(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + "pcmpeqb %%xmm3,%%xmm3 \n" + "psrld $0x1b,%%xmm3 \n" + "pcmpeqb %%xmm4,%%xmm4 \n" +@@ -732,9 +740,9 @@ void ARGBToRGB565Row_SSE2(const uint8_t* + + void ARGBToRGB565DitherRow_SSE2(const uint8_t* src, + uint8_t* dst, +- uint32_t dither4, ++ const uint32_t dither4, + int width) { +- asm volatile ( ++ asm volatile( + "movd %3,%%xmm6 \n" + "punpcklbw %%xmm6,%%xmm6 \n" + "movdqa %%xmm6,%%xmm7 \n" +@@ -780,9 +788,9 @@ void ARGBToRGB565DitherRow_SSE2(const ui + #ifdef HAS_ARGBTORGB565DITHERROW_AVX2 + void ARGBToRGB565DitherRow_AVX2(const uint8_t* src, + uint8_t* dst, +- uint32_t dither4, ++ const uint32_t dither4, + int width) { +- asm volatile ( ++ asm volatile( + "vbroadcastss %3,%%xmm6 \n" + "vpunpcklbw %%xmm6,%%xmm6,%%xmm6 \n" + "vpermq $0xd8,%%ymm6,%%ymm6 \n" +@@ -824,7 +832,7 @@ void ARGBToRGB565DitherRow_AVX2(const ui + #endif // HAS_ARGBTORGB565DITHERROW_AVX2 + + void ARGBToARGB1555Row_SSE2(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + "pcmpeqb %%xmm4,%%xmm4 \n" + "psrld $0x1b,%%xmm4 \n" + "movdqa %%xmm4,%%xmm5 \n" +@@ -865,7 +873,7 @@ void ARGBToARGB1555Row_SSE2(const uint8_ + } + + void ARGBToARGB4444Row_SSE2(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + "pcmpeqb %%xmm4,%%xmm4 \n" + "psllw $0xc,%%xmm4 \n" + "movdqa %%xmm4,%%xmm3 \n" +@@ -928,7 +936,7 @@ static const uint32_t kMaskAG10 = 0xc000 + static const uint32_t kMulAG10 = 64 * 65536 + 1028; + + void ARGBToAR30Row_SSSE3(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + "movdqa %3,%%xmm2 \n" // shuffler for RB + "movd %4,%%xmm3 \n" // multipler for RB + "movd %5,%%xmm4 \n" // mask for R10 B10 +@@ -967,7 +975,7 @@ void ARGBToAR30Row_SSSE3(const uint8_t* + } + + void ABGRToAR30Row_SSSE3(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + "movdqa %3,%%xmm2 \n" // shuffler for RB + "movd %4,%%xmm3 \n" // multipler for RB + "movd %5,%%xmm4 \n" // mask for R10 B10 +@@ -1007,7 +1015,7 @@ void ABGRToAR30Row_SSSE3(const uint8_t* + + #ifdef HAS_ARGBTOAR30ROW_AVX2 + void ARGBToAR30Row_AVX2(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + "vbroadcastf128 %3,%%ymm2 \n" // shuffler for RB + "vbroadcastss %4,%%ymm3 \n" // multipler for RB + "vbroadcastss %5,%%ymm4 \n" // mask for R10 B10 +@@ -1044,7 +1052,7 @@ void ARGBToAR30Row_AVX2(const uint8_t* s + + #ifdef HAS_ABGRTOAR30ROW_AVX2 + void ABGRToAR30Row_AVX2(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + "vbroadcastf128 %3,%%ymm2 \n" // shuffler for RB + "vbroadcastss %4,%%ymm3 \n" // multipler for RB + "vbroadcastss %5,%%ymm4 \n" // mask for R10 B10 +@@ -1090,7 +1098,9 @@ static const uvec8 kShuffleARGBToAB64Hi + void ARGBToAR64Row_SSSE3(const uint8_t* src_argb, + uint16_t* dst_ar64, + int width) { +- asm volatile (LABELALIGN ++ asm volatile( ++ ++ LABELALIGN + "1: \n" + "movdqu (%0),%%xmm0 \n" + "movdqa %%xmm0,%%xmm1 \n" +@@ -1105,14 +1115,15 @@ void ARGBToAR64Row_SSSE3(const uint8_t* + : "+r"(src_argb), // %0 + "+r"(dst_ar64), // %1 + "+r"(width) // %2 +- ::"memory", +- "cc", "xmm0", "xmm1"); ++ : ++ : "memory", "cc", "xmm0", "xmm1"); + } + + void ARGBToAB64Row_SSSE3(const uint8_t* src_argb, + uint16_t* dst_ab64, + int width) { +- asm volatile ( ++ asm volatile( ++ + "movdqa %3,%%xmm2 \n" + "movdqa %4,%%xmm3 \n" LABELALIGN + "1: \n" +@@ -1137,7 +1148,9 @@ void ARGBToAB64Row_SSSE3(const uint8_t* + void AR64ToARGBRow_SSSE3(const uint16_t* src_ar64, + uint8_t* dst_argb, + int width) { +- asm volatile (LABELALIGN ++ asm volatile( ++ ++ LABELALIGN + "1: \n" + "movdqu (%0),%%xmm0 \n" + "movdqu 0x10(%0),%%xmm1 \n" +@@ -1152,17 +1165,16 @@ void AR64ToARGBRow_SSSE3(const uint16_t* + : "+r"(src_ar64), // %0 + "+r"(dst_argb), // %1 + "+r"(width) // %2 +- ::"memory", +- "cc", "xmm0", "xmm1"); ++ : ++ : "memory", "cc", "xmm0", "xmm1"); + } + + void AB64ToARGBRow_SSSE3(const uint16_t* src_ab64, + uint8_t* dst_argb, + int width) { +- asm volatile ( +- "movdqa %3,%%xmm2 \n" +- +- LABELALIGN ++ asm volatile( ++ ++ "movdqa %3,%%xmm2 \n" LABELALIGN + "1: \n" + "movdqu (%0),%%xmm0 \n" + "movdqu 0x10(%0),%%xmm1 \n" +@@ -1186,7 +1198,9 @@ void AB64ToARGBRow_SSSE3(const uint16_t* + void ARGBToAR64Row_AVX2(const uint8_t* src_argb, + uint16_t* dst_ar64, + int width) { +- asm volatile (LABELALIGN ++ asm volatile( ++ ++ LABELALIGN + "1: \n" + "vmovdqu (%0),%%ymm0 \n" + "vpermq $0xd8,%%ymm0,%%ymm0 \n" +@@ -1202,8 +1216,8 @@ void ARGBToAR64Row_AVX2(const uint8_t* s + : "+r"(src_argb), // %0 + "+r"(dst_ar64), // %1 + "+r"(width) // %2 +- ::"memory", +- "cc", "xmm0", "xmm1"); ++ : ++ : "memory", "cc", "xmm0", "xmm1"); + } + #endif + +@@ -1211,7 +1225,8 @@ void ARGBToAR64Row_AVX2(const uint8_t* s + void ARGBToAB64Row_AVX2(const uint8_t* src_argb, + uint16_t* dst_ab64, + int width) { +- asm volatile ( ++ asm volatile( ++ + "vbroadcastf128 %3,%%ymm2 \n" + "vbroadcastf128 %4,%%ymm3 \n" LABELALIGN + "1: \n" +@@ -1239,7 +1254,9 @@ void ARGBToAB64Row_AVX2(const uint8_t* s + void AR64ToARGBRow_AVX2(const uint16_t* src_ar64, + uint8_t* dst_argb, + int width) { +- asm volatile (LABELALIGN ++ asm volatile( ++ ++ LABELALIGN + "1: \n" + "vmovdqu (%0),%%ymm0 \n" + "vmovdqu 0x20(%0),%%ymm1 \n" +@@ -1256,8 +1273,8 @@ void AR64ToARGBRow_AVX2(const uint16_t* + : "+r"(src_ar64), // %0 + "+r"(dst_argb), // %1 + "+r"(width) // %2 +- ::"memory", +- "cc", "xmm0", "xmm1"); ++ : ++ : "memory", "cc", "xmm0", "xmm1"); + } + #endif + +@@ -1265,7 +1282,8 @@ void AR64ToARGBRow_AVX2(const uint16_t* + void AB64ToARGBRow_AVX2(const uint16_t* src_ab64, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( ++ + "vbroadcastf128 %3,%%ymm2 \n" LABELALIGN + "1: \n" + "vmovdqu (%0),%%ymm0 \n" +@@ -1289,6 +1307,8 @@ void AB64ToARGBRow_AVX2(const uint16_t* + } + #endif + ++// clang-format off ++ + // TODO(mraptis): Consider passing R, G, B multipliers as parameter. + // round parameter is register containing value to add before shift. + #define RGBTOY(round) \ +@@ -1313,10 +1333,8 @@ void AB64ToARGBRow_AVX2(const uint16_t* + "phaddw %%xmm0,%%xmm6 \n" \ + "phaddw %%xmm2,%%xmm1 \n" \ + "prefetcht0 1280(%0) \n" \ +- "paddw %%" #round \ +- ",%%xmm6 \n" \ +- "paddw %%" #round \ +- ",%%xmm1 \n" \ ++ "paddw %%" #round ",%%xmm6 \n" \ ++ "paddw %%" #round ",%%xmm1 \n" \ + "psrlw $0x8,%%xmm6 \n" \ + "psrlw $0x8,%%xmm1 \n" \ + "packuswb %%xmm1,%%xmm6 \n" \ +@@ -1343,10 +1361,8 @@ void AB64ToARGBRow_AVX2(const uint16_t* + "vphaddw %%ymm1,%%ymm0,%%ymm0 \n" /* mutates. */ \ + "vphaddw %%ymm3,%%ymm2,%%ymm2 \n" \ + "prefetcht0 1280(%0) \n" \ +- "vpaddw %%" #round \ +- ",%%ymm0,%%ymm0 \n" /* Add .5 for rounding. */ \ +- "vpaddw %%" #round \ +- ",%%ymm2,%%ymm2 \n" \ ++ "vpaddw %%" #round ",%%ymm0,%%ymm0 \n" /* Add .5 for rounding. */ \ ++ "vpaddw %%" #round ",%%ymm2,%%ymm2 \n" \ + "vpsrlw $0x8,%%ymm0,%%ymm0 \n" \ + "vpsrlw $0x8,%%ymm2,%%ymm2 \n" \ + "vpackuswb %%ymm2,%%ymm0,%%ymm0 \n" /* mutates. */ \ +@@ -1357,10 +1373,12 @@ void AB64ToARGBRow_AVX2(const uint16_t* + "jg 1b \n" \ + "vzeroupper \n" + ++// clang-format on ++ + #ifdef HAS_ARGBTOYROW_SSSE3 + // Convert 16 ARGB pixels (64 bytes) to 16 Y values. + void ARGBToYRow_SSSE3(const uint8_t* src_argb, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "movdqa %3,%%xmm4 \n" + "movdqa %4,%%xmm5 \n" + "movdqa %5,%%xmm7 \n" +@@ -1381,7 +1399,7 @@ void ARGBToYRow_SSSE3(const uint8_t* src + // Convert 16 ARGB pixels (64 bytes) to 16 YJ values. + // Same as ARGBToYRow but different coefficients, no add 16. + void ARGBToYJRow_SSSE3(const uint8_t* src_argb, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "movdqa %3,%%xmm4 \n" + "movdqa %4,%%xmm5 \n" + +@@ -1399,7 +1417,7 @@ void ARGBToYJRow_SSSE3(const uint8_t* sr + // Convert 16 ABGR pixels (64 bytes) to 16 YJ values. + // Same as ABGRToYRow but different coefficients, no add 16. + void ABGRToYJRow_SSSE3(const uint8_t* src_abgr, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "movdqa %3,%%xmm4 \n" + "movdqa %4,%%xmm5 \n" + +@@ -1417,7 +1435,7 @@ void ABGRToYJRow_SSSE3(const uint8_t* sr + // Convert 16 ARGB pixels (64 bytes) to 16 YJ values. + // Same as ARGBToYRow but different coefficients, no add 16. + void RGBAToYJRow_SSSE3(const uint8_t* src_rgba, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "movdqa %3,%%xmm4 \n" + "movdqa %4,%%xmm5 \n" + +@@ -1441,7 +1459,7 @@ static const lvec32 kPermdARGBToY_AVX = + + // Convert 32 ARGB pixels (128 bytes) to 32 Y values. + void ARGBToYRow_AVX2(const uint8_t* src_argb, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "vbroadcastf128 %3,%%ymm4 \n" + "vbroadcastf128 %4,%%ymm5 \n" + "vbroadcastf128 %5,%%ymm7 \n" +@@ -1462,7 +1480,7 @@ void ARGBToYRow_AVX2(const uint8_t* src_ + #ifdef HAS_ABGRTOYROW_AVX2 + // Convert 32 ABGR pixels (128 bytes) to 32 Y values. + void ABGRToYRow_AVX2(const uint8_t* src_abgr, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "vbroadcastf128 %3,%%ymm4 \n" + "vbroadcastf128 %4,%%ymm5 \n" + "vbroadcastf128 %5,%%ymm7 \n" +@@ -1483,7 +1501,7 @@ void ABGRToYRow_AVX2(const uint8_t* src_ + #ifdef HAS_ARGBTOYJROW_AVX2 + // Convert 32 ARGB pixels (128 bytes) to 32 Y values. + void ARGBToYJRow_AVX2(const uint8_t* src_argb, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "vbroadcastf128 %3,%%ymm4 \n" + "vbroadcastf128 %4,%%ymm5 \n" + "vmovdqu %5,%%ymm6 \n" LABELALIGN RGBTOY_AVX2( +@@ -1502,7 +1520,7 @@ void ARGBToYJRow_AVX2(const uint8_t* src + #ifdef HAS_ABGRTOYJROW_AVX2 + // Convert 32 ABGR pixels (128 bytes) to 32 Y values. + void ABGRToYJRow_AVX2(const uint8_t* src_abgr, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "vbroadcastf128 %3,%%ymm4 \n" + "vbroadcastf128 %4,%%ymm5 \n" + "vmovdqu %5,%%ymm6 \n" LABELALIGN RGBTOY_AVX2( +@@ -1521,7 +1539,7 @@ void ABGRToYJRow_AVX2(const uint8_t* src + #ifdef HAS_RGBATOYJROW_AVX2 + // Convert 32 ARGB pixels (128 bytes) to 32 Y values. + void RGBAToYJRow_AVX2(const uint8_t* src_rgba, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "vbroadcastf128 %3,%%ymm4 \n" + "vbroadcastf128 %4,%%ymm5 \n" + "vmovdqu %5,%%ymm6 \n" LABELALIGN RGBTOY_AVX2( +@@ -1542,7 +1560,7 @@ void ARGBToUVRow_SSSE3(const uint8_t* sr + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "movdqa %5,%%xmm3 \n" + "movdqa %6,%%xmm4 \n" + "movdqa %7,%%xmm5 \n" +@@ -1615,7 +1633,7 @@ void ARGBToUVRow_AVX2(const uint8_t* src + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "vbroadcastf128 %5,%%ymm5 \n" + "vbroadcastf128 %6,%%ymm6 \n" + "vbroadcastf128 %7,%%ymm7 \n" +@@ -1678,7 +1696,7 @@ void ABGRToUVRow_AVX2(const uint8_t* src + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "vbroadcastf128 %5,%%ymm5 \n" + "vbroadcastf128 %6,%%ymm6 \n" + "vbroadcastf128 %7,%%ymm7 \n" +@@ -1741,7 +1759,7 @@ void ARGBToUVJRow_AVX2(const uint8_t* sr + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "vbroadcastf128 %5,%%ymm5 \n" + "vbroadcastf128 %6,%%ymm6 \n" + "vbroadcastf128 %7,%%ymm7 \n" +@@ -1806,7 +1824,7 @@ void ABGRToUVJRow_AVX2(const uint8_t* sr + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "vbroadcastf128 %5,%%ymm5 \n" + "vbroadcastf128 %6,%%ymm6 \n" + "vbroadcastf128 %7,%%ymm7 \n" +@@ -1870,7 +1888,7 @@ void ARGBToUVJRow_SSSE3(const uint8_t* s + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "movdqa %5,%%xmm3 \n" + "movdqa %6,%%xmm4 \n" + "movdqa %7,%%xmm5 \n" +@@ -1936,7 +1954,7 @@ void ABGRToUVJRow_SSSE3(const uint8_t* s + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "movdqa %5,%%xmm3 \n" + "movdqa %6,%%xmm4 \n" + "movdqa %7,%%xmm5 \n" +@@ -2001,7 +2019,7 @@ void ARGBToUV444Row_SSSE3(const uint8_t* + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "movdqa %4,%%xmm3 \n" + "movdqa %5,%%xmm4 \n" + "movdqa %6,%%xmm5 \n" +@@ -2055,7 +2073,7 @@ void ARGBToUV444Row_SSSE3(const uint8_t* + #endif // HAS_ARGBTOUV444ROW_SSSE3 + + void BGRAToYRow_SSSE3(const uint8_t* src_bgra, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "movdqa %3,%%xmm4 \n" + "movdqa %4,%%xmm5 \n" + "movdqa %5,%%xmm7 \n" +@@ -2076,7 +2094,7 @@ void BGRAToUVRow_SSSE3(const uint8_t* sr + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "movdqa %5,%%xmm3 \n" + "movdqa %6,%%xmm4 \n" + "movdqa %7,%%xmm5 \n" +@@ -2135,7 +2153,7 @@ void BGRAToUVRow_SSSE3(const uint8_t* sr + } + + void ABGRToYRow_SSSE3(const uint8_t* src_abgr, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "movdqa %3,%%xmm4 \n" + "movdqa %4,%%xmm5 \n" + "movdqa %5,%%xmm7 \n" +@@ -2152,7 +2170,7 @@ void ABGRToYRow_SSSE3(const uint8_t* src + } + + void RGBAToYRow_SSSE3(const uint8_t* src_rgba, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "movdqa %3,%%xmm4 \n" + "movdqa %4,%%xmm5 \n" + "movdqa %5,%%xmm7 \n" +@@ -2173,7 +2191,7 @@ void ABGRToUVRow_SSSE3(const uint8_t* sr + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "movdqa %5,%%xmm3 \n" + "movdqa %6,%%xmm4 \n" + "movdqa %7,%%xmm5 \n" +@@ -2236,7 +2254,7 @@ void RGBAToUVRow_SSSE3(const uint8_t* sr + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "movdqa %5,%%xmm3 \n" + "movdqa %6,%%xmm4 \n" + "movdqa %7,%%xmm5 \n" +@@ -2451,25 +2469,21 @@ void RGBAToUVRow_SSSE3(const uint8_t* sr + "punpcklbw %%xmm4,%%xmm4 \n" \ + "lea 0x8(%[y_buf]),%[y_buf] \n" + +-// Read 4 YUY2 with 8 Y and upsample 4 UV to 8 UV. +-// xmm6 kShuffleYUY2Y, +-// xmm7 kShuffleYUY2UV ++// Read 4 YUY2 with 8 Y and update 4 UV to 8 UV. + #define READYUY2 \ + "movdqu (%[yuy2_buf]),%%xmm4 \n" \ +- "lea 0x10(%[yuy2_buf]),%[yuy2_buf] \n" \ +- "movdqa %%xmm4,%%xmm3 \n" \ +- "pshufb %%xmm6,%%xmm4 \n" \ +- "pshufb %%xmm7,%%xmm3 \n" +- +-// Read 4 UYVY with 8 Y and upsample 4 UV to 8 UV. +-// xmm6 kShuffleUYVYY, +-// xmm7 kShuffleUYVYUV ++ "pshufb %[kShuffleYUY2Y], %%xmm4 \n" \ ++ "movdqu (%[yuy2_buf]),%%xmm3 \n" \ ++ "pshufb %[kShuffleYUY2UV], %%xmm3 \n" \ ++ "lea 0x10(%[yuy2_buf]),%[yuy2_buf] \n" ++ ++// Read 4 UYVY with 8 Y and update 4 UV to 8 UV. + #define READUYVY \ + "movdqu (%[uyvy_buf]),%%xmm4 \n" \ +- "lea 0x10(%[uyvy_buf]),%[uyvy_buf] \n" \ +- "movdqa %%xmm4,%%xmm3 \n" \ +- "pshufb %%xmm6,%%xmm4 \n" \ +- "pshufb %%xmm7,%%xmm3 \n" ++ "pshufb %[kShuffleUYVYY], %%xmm4 \n" \ ++ "movdqu (%[uyvy_buf]),%%xmm3 \n" \ ++ "pshufb %[kShuffleUYVYUV], %%xmm3 \n" \ ++ "lea 0x10(%[uyvy_buf]),%[uyvy_buf] \n" + + // Read 4 UV from P210, upsample to 8 UV + #define READP210 \ +@@ -2626,7 +2640,7 @@ void OMITFP I444ToARGBRow_SSSE3(const ui + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "pcmpeqb %%xmm5,%%xmm5 \n" +@@ -2657,26 +2671,33 @@ void OMITFP I444AlphaToARGBRow_SSSE3(con + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile (YUVTORGB_SETUP( +- yuvconstants) "sub %[u_buf],%[v_buf] \n" +- +- LABELALIGN "1: \n" READYUVA444 +- YUVTORGB(yuvconstants) STOREARGB ++ // clang-format off ++ asm volatile ( ++ YUVTORGB_SETUP(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ ++ LABELALIGN ++ "1: \n" ++ READYUVA444 ++ YUVTORGB(yuvconstants) ++ STOREARGB + "subl $0x8,%[width] \n" + "jg 1b \n" +- : [y_buf] "+r"(y_buf), // %[y_buf] +- [u_buf] "+r"(u_buf), // %[u_buf] +- [v_buf] "+r"(v_buf), // %[v_buf] +- [a_buf] "+r"(a_buf), // %[a_buf] +- [dst_argb] "+r"(dst_argb), // %[dst_argb] ++ : [y_buf]"+r"(y_buf), // %[y_buf] ++ [u_buf]"+r"(u_buf), // %[u_buf] ++ [v_buf]"+r"(v_buf), // %[v_buf] ++ [a_buf]"+r"(a_buf), // %[a_buf] ++ [dst_argb]"+r"(dst_argb), // %[dst_argb] + #if defined(__i386__) +- [width] "+m"(width) // %[width] ++ [width]"+m"(width) // %[width] + #else +- [width] "+rm"(width) // %[width] ++ [width]"+rm"(width) // %[width] + #endif +- : [yuvconstants] "r"(yuvconstants) // %[yuvconstants] +- : "memory", "cc", YUVTORGB_REGS "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", +- "xmm5"); ++ : [yuvconstants]"r"(yuvconstants) // %[yuvconstants] ++ : "memory", "cc", YUVTORGB_REGS ++ "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" ++ ); ++ // clang-format on + } + #endif // HAS_I444ALPHATOARGBROW_SSSE3 + +@@ -2686,7 +2707,7 @@ void OMITFP I422ToRGB24Row_SSSE3(const u + uint8_t* dst_rgb24, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "movdqa %[kShuffleMaskARGBToRGB24_0],%%xmm5 \n" + "movdqa %[kShuffleMaskARGBToRGB24],%%xmm6 \n" +@@ -2722,7 +2743,7 @@ void OMITFP I444ToRGB24Row_SSSE3(const u + uint8_t* dst_rgb24, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "movdqa %[kShuffleMaskARGBToRGB24_0],%%xmm5 \n" + "movdqa %[kShuffleMaskARGBToRGB24],%%xmm6 \n" +@@ -2758,7 +2779,7 @@ void OMITFP I422ToARGBRow_SSSE3(const ui + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "pcmpeqb %%xmm5,%%xmm5 \n" +@@ -2787,7 +2808,7 @@ void OMITFP I422ToAR30Row_SSSE3(const ui + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "pcmpeqb %%xmm5,%%xmm5 \n" // AR30 constants +@@ -2822,7 +2843,7 @@ void OMITFP I210ToARGBRow_SSSE3(const ui + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "pcmpeqb %%xmm5,%%xmm5 \n" +@@ -2852,7 +2873,7 @@ void OMITFP I212ToARGBRow_SSSE3(const ui + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "pcmpeqb %%xmm5,%%xmm5 \n" +@@ -2882,7 +2903,7 @@ void OMITFP I210ToAR30Row_SSSE3(const ui + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "pcmpeqb %%xmm5,%%xmm5 \n" +@@ -2917,7 +2938,7 @@ void OMITFP I212ToAR30Row_SSSE3(const ui + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "pcmpeqb %%xmm5,%%xmm5 \n" +@@ -2952,7 +2973,7 @@ void OMITFP I410ToARGBRow_SSSE3(const ui + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "pcmpeqb %%xmm5,%%xmm5 \n" +@@ -2983,7 +3004,8 @@ void OMITFP I210AlphaToARGBRow_SSSE3(con + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile (YUVTORGB_SETUP( ++ asm volatile( ++ YUVTORGB_SETUP( + yuvconstants) "sub %[u_buf],%[v_buf] \n" + + LABELALIGN "1: \n" READYUVA210 +@@ -3015,26 +3037,32 @@ void OMITFP I410AlphaToARGBRow_SSSE3(con + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile (YUVTORGB_SETUP( +- yuvconstants) "sub %[u_buf],%[v_buf] \n" +- +- LABELALIGN "1: \n" READYUVA410 +- YUVTORGB(yuvconstants) STOREARGB ++ // clang-format off ++ asm volatile( ++ YUVTORGB_SETUP(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ ++ LABELALIGN ++ "1: \n" ++ READYUVA410 ++ YUVTORGB(yuvconstants) ++ STOREARGB + "subl $0x8,%[width] \n" + "jg 1b \n" +- : [y_buf] "+r"(y_buf), // %[y_buf] +- [u_buf] "+r"(u_buf), // %[u_buf] +- [v_buf] "+r"(v_buf), // %[v_buf] +- [a_buf] "+r"(a_buf), +- [dst_argb] "+r"(dst_argb), // %[dst_argb] ++ : [y_buf] "+r"(y_buf), // %[y_buf] ++ [u_buf] "+r"(u_buf), // %[u_buf] ++ [v_buf] "+r"(v_buf), // %[v_buf] ++ [a_buf] "+r"(a_buf), ++ [dst_argb] "+r"(dst_argb), // %[dst_argb] + #if defined(__i386__) +- [width] "+m"(width) // %[width] ++ [width] "+m"(width) // %[width] + #else +- [width] "+rm"(width) // %[width] ++ [width] "+rm"(width) // %[width] + #endif +- : [yuvconstants] "r"(yuvconstants) // %[yuvconstants] +- : "memory", "cc", YUVTORGB_REGS "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", +- "xmm5"); ++ : [yuvconstants] "r"(yuvconstants) // %[yuvconstants] ++ : "memory", "cc", YUVTORGB_REGS "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", ++ "xmm5"); ++ // clang-format on + } + #endif + +@@ -3045,7 +3073,7 @@ void OMITFP I410ToAR30Row_SSSE3(const ui + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "pcmpeqb %%xmm5,%%xmm5 \n" +@@ -3081,26 +3109,33 @@ void OMITFP I422AlphaToARGBRow_SSSE3(con + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile (YUVTORGB_SETUP( +- yuvconstants) "sub %[u_buf],%[v_buf] \n" +- +- LABELALIGN "1: \n" READYUVA422 +- YUVTORGB(yuvconstants) STOREARGB ++ // clang-format off ++ asm volatile ( ++ YUVTORGB_SETUP(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ ++ LABELALIGN ++ "1: \n" ++ READYUVA422 ++ YUVTORGB(yuvconstants) ++ STOREARGB + "subl $0x8,%[width] \n" + "jg 1b \n" +- : [y_buf] "+r"(y_buf), // %[y_buf] +- [u_buf] "+r"(u_buf), // %[u_buf] +- [v_buf] "+r"(v_buf), // %[v_buf] +- [a_buf] "+r"(a_buf), // %[a_buf] +- [dst_argb] "+r"(dst_argb), // %[dst_argb] ++ : [y_buf]"+r"(y_buf), // %[y_buf] ++ [u_buf]"+r"(u_buf), // %[u_buf] ++ [v_buf]"+r"(v_buf), // %[v_buf] ++ [a_buf]"+r"(a_buf), // %[a_buf] ++ [dst_argb]"+r"(dst_argb), // %[dst_argb] + #if defined(__i386__) +- [width] "+m"(width) // %[width] ++ [width]"+m"(width) // %[width] + #else +- [width] "+rm"(width) // %[width] ++ [width]"+rm"(width) // %[width] + #endif +- : [yuvconstants] "r"(yuvconstants) // %[yuvconstants] +- : "memory", "cc", YUVTORGB_REGS "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", +- "xmm5"); ++ : [yuvconstants]"r"(yuvconstants) // %[yuvconstants] ++ : "memory", "cc", YUVTORGB_REGS ++ "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" ++ ); ++ // clang-format on + } + #endif // HAS_I422ALPHATOARGBROW_SSSE3 + +@@ -3109,20 +3144,27 @@ void OMITFP NV12ToARGBRow_SSSE3(const ui + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile (YUVTORGB_SETUP( +- yuvconstants) "pcmpeqb %%xmm5,%%xmm5 \n" +- +- LABELALIGN "1: \n" READNV12 +- YUVTORGB(yuvconstants) STOREARGB ++ // clang-format off ++ asm volatile ( ++ YUVTORGB_SETUP(yuvconstants) ++ "pcmpeqb %%xmm5,%%xmm5 \n" ++ ++ LABELALIGN ++ "1: \n" ++ READNV12 ++ YUVTORGB(yuvconstants) ++ STOREARGB + "sub $0x8,%[width] \n" + "jg 1b \n" +- : [y_buf] "+r"(y_buf), // %[y_buf] +- [uv_buf] "+r"(uv_buf), // %[uv_buf] +- [dst_argb] "+r"(dst_argb), // %[dst_argb] +- [width] "+rm"(width) // %[width] +- : [yuvconstants] "r"(yuvconstants) // %[yuvconstants] +- : "memory", "cc", YUVTORGB_REGS "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", +- "xmm5"); ++ : [y_buf]"+r"(y_buf), // %[y_buf] ++ [uv_buf]"+r"(uv_buf), // %[uv_buf] ++ [dst_argb]"+r"(dst_argb), // %[dst_argb] ++ [width]"+rm"(width) // %[width] ++ : [yuvconstants]"r"(yuvconstants) // %[yuvconstants] ++ : "memory", "cc", YUVTORGB_REGS ++ "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" ++ ); ++ // clang-format on + } + + void OMITFP NV21ToARGBRow_SSSE3(const uint8_t* y_buf, +@@ -3130,65 +3172,84 @@ void OMITFP NV21ToARGBRow_SSSE3(const ui + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile (YUVTORGB_SETUP( +- yuvconstants) "pcmpeqb %%xmm5,%%xmm5 \n" +- +- LABELALIGN "1: \n" READNV21 +- YUVTORGB(yuvconstants) STOREARGB ++ // clang-format off ++ asm volatile ( ++ YUVTORGB_SETUP(yuvconstants) ++ "pcmpeqb %%xmm5,%%xmm5 \n" ++ ++ LABELALIGN ++ "1: \n" ++ READNV21 ++ YUVTORGB(yuvconstants) ++ STOREARGB + "sub $0x8,%[width] \n" + "jg 1b \n" +- : [y_buf] "+r"(y_buf), // %[y_buf] +- [vu_buf] "+r"(vu_buf), // %[vu_buf] +- [dst_argb] "+r"(dst_argb), // %[dst_argb] +- [width] "+rm"(width) // %[width] +- : [yuvconstants] "r"(yuvconstants), // %[yuvconstants] +- [kShuffleNV21] "m"(kShuffleNV21) +- : "memory", "cc", YUVTORGB_REGS "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", +- "xmm5"); ++ : [y_buf]"+r"(y_buf), // %[y_buf] ++ [vu_buf]"+r"(vu_buf), // %[vu_buf] ++ [dst_argb]"+r"(dst_argb), // %[dst_argb] ++ [width]"+rm"(width) // %[width] ++ : [yuvconstants]"r"(yuvconstants), // %[yuvconstants] ++ [kShuffleNV21]"m"(kShuffleNV21) ++ : "memory", "cc", YUVTORGB_REGS ++ "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" ++ ); ++ // clang-format on + } + + void OMITFP YUY2ToARGBRow_SSSE3(const uint8_t* yuy2_buf, + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { ++ // clang-format off + asm volatile ( +- "movdqa %[kShuffleYUY2Y],%%xmm6 \n" +- "movdqa %[kShuffleYUY2UV],%%xmm7 \n" YUVTORGB_SETUP( +- yuvconstants) "pcmpeqb %%xmm5,%%xmm5 \n" +- +- LABELALIGN "1: \n" READYUY2 +- YUVTORGB(yuvconstants) STOREARGB ++ YUVTORGB_SETUP(yuvconstants) ++ "pcmpeqb %%xmm5,%%xmm5 \n" ++ ++ LABELALIGN ++ "1: \n" ++ READYUY2 ++ YUVTORGB(yuvconstants) ++ STOREARGB + "sub $0x8,%[width] \n" + "jg 1b \n" +- : [yuy2_buf] "+r"(yuy2_buf), // %[yuy2_buf] +- [dst_argb] "+r"(dst_argb), // %[dst_argb] +- [width] "+rm"(width) // %[width] +- : [yuvconstants] "r"(yuvconstants), // %[yuvconstants] +- [kShuffleYUY2Y] "m"(kShuffleYUY2Y), [kShuffleYUY2UV] "m"(kShuffleYUY2UV) +- : "memory", "cc", YUVTORGB_REGS "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", +- "xmm5", "xmm6", "xmm7"); ++ : [yuy2_buf]"+r"(yuy2_buf), // %[yuy2_buf] ++ [dst_argb]"+r"(dst_argb), // %[dst_argb] ++ [width]"+rm"(width) // %[width] ++ : [yuvconstants]"r"(yuvconstants), // %[yuvconstants] ++ [kShuffleYUY2Y]"m"(kShuffleYUY2Y), ++ [kShuffleYUY2UV]"m"(kShuffleYUY2UV) ++ : "memory", "cc", YUVTORGB_REGS ++ "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" ++ ); ++ // clang-format on + } + + void OMITFP UYVYToARGBRow_SSSE3(const uint8_t* uyvy_buf, + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { ++ // clang-format off + asm volatile ( +- "movdqa %[kShuffleUYVYY],%%xmm6 \n" +- "movdqa %[kShuffleUYVYUV],%%xmm7 \n" YUVTORGB_SETUP( +- yuvconstants) "pcmpeqb %%xmm5,%%xmm5 \n" +- +- LABELALIGN "1: \n" READUYVY +- YUVTORGB(yuvconstants) STOREARGB ++ YUVTORGB_SETUP(yuvconstants) ++ "pcmpeqb %%xmm5,%%xmm5 \n" ++ ++ LABELALIGN ++ "1: \n" ++ READUYVY ++ YUVTORGB(yuvconstants) ++ STOREARGB + "sub $0x8,%[width] \n" + "jg 1b \n" +- : [uyvy_buf] "+r"(uyvy_buf), // %[uyvy_buf] +- [dst_argb] "+r"(dst_argb), // %[dst_argb] +- [width] "+rm"(width) // %[width] +- : [yuvconstants] "r"(yuvconstants), // %[yuvconstants] +- [kShuffleUYVYY] "m"(kShuffleUYVYY), [kShuffleUYVYUV] "m"(kShuffleUYVYUV) +- : "memory", "cc", YUVTORGB_REGS "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", +- "xmm5"); ++ : [uyvy_buf]"+r"(uyvy_buf), // %[uyvy_buf] ++ [dst_argb]"+r"(dst_argb), // %[dst_argb] ++ [width]"+rm"(width) // %[width] ++ : [yuvconstants]"r"(yuvconstants), // %[yuvconstants] ++ [kShuffleUYVYY]"m"(kShuffleUYVYY), ++ [kShuffleUYVYUV]"m"(kShuffleUYVYUV) ++ : "memory", "cc", YUVTORGB_REGS ++ "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" ++ ); ++ // clang-format on + } + + void OMITFP P210ToARGBRow_SSSE3(const uint16_t* y_buf, +@@ -3196,7 +3257,8 @@ void OMITFP P210ToARGBRow_SSSE3(const ui + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile (YUVTORGB_SETUP( ++ asm volatile( ++ YUVTORGB_SETUP( + yuvconstants) "pcmpeqb %%xmm5,%%xmm5 \n" + + LABELALIGN "1: \n" READP210 +@@ -3217,7 +3279,8 @@ void OMITFP P410ToARGBRow_SSSE3(const ui + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile (YUVTORGB_SETUP( ++ asm volatile( ++ YUVTORGB_SETUP( + yuvconstants) "pcmpeqb %%xmm5,%%xmm5 \n" + + LABELALIGN "1: \n" READP410 +@@ -3238,7 +3301,7 @@ void OMITFP P210ToAR30Row_SSSE3(const ui + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "pcmpeqb %%xmm5,%%xmm5 \n" + "psrlw $14,%%xmm5 \n" +@@ -3269,7 +3332,7 @@ void OMITFP P410ToAR30Row_SSSE3(const ui + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "pcmpeqb %%xmm5,%%xmm5 \n" + "psrlw $14,%%xmm5 \n" +@@ -3301,7 +3364,7 @@ void OMITFP I422ToRGBARow_SSSE3(const ui + uint8_t* dst_rgba, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "pcmpeqb %%xmm5,%%xmm5 \n" +@@ -3537,21 +3600,19 @@ void OMITFP I422ToRGBARow_SSSE3(const ui + "lea 0x20(%[y_buf]),%[y_buf] \n" + + // Read 8 YUY2 with 16 Y and upsample 8 UV to 16 UV. +-// ymm6 kShuffleYUY2Y, +-// ymm7 kShuffleYUY2UV + #define READYUY2_AVX2 \ +- "vmovdqu (%[yuy2_buf]),%%ymm1 \n" \ +- "vpshufb %%ymm6,%%ymm1,%%ymm4 \n" \ +- "vpshufb %%ymm7,%%ymm1,%%ymm3 \n" \ ++ "vmovdqu (%[yuy2_buf]),%%ymm4 \n" \ ++ "vpshufb %[kShuffleYUY2Y], %%ymm4, %%ymm4 \n" \ ++ "vmovdqu (%[yuy2_buf]),%%ymm3 \n" \ ++ "vpshufb %[kShuffleYUY2UV], %%ymm3, %%ymm3 \n" \ + "lea 0x20(%[yuy2_buf]),%[yuy2_buf] \n" + + // Read 8 UYVY with 16 Y and upsample 8 UV to 16 UV. +-// ymm6 kShuffleUYVYY, +-// ymm7 kShuffleUYVYUV + #define READUYVY_AVX2 \ +- "vmovdqu (%[uyvy_buf]),%%ymm1 \n" \ +- "vpshufb %%ymm6,%%ymm1,%%ymm4 \n" \ +- "vpshufb %%ymm7,%%ymm1,%%ymm3 \n" \ ++ "vmovdqu (%[uyvy_buf]),%%ymm4 \n" \ ++ "vpshufb %[kShuffleUYVYY], %%ymm4, %%ymm4 \n" \ ++ "vmovdqu (%[uyvy_buf]),%%ymm3 \n" \ ++ "vpshufb %[kShuffleUYVYUV], %%ymm3, %%ymm3 \n" \ + "lea 0x20(%[uyvy_buf]),%[uyvy_buf] \n" + + // TODO(fbarchard): Remove broadcastb +@@ -3712,7 +3773,7 @@ void OMITFP I444ToARGBRow_AVX2(const uin + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" +@@ -3746,7 +3807,7 @@ void OMITFP I422ToARGBRow_AVX2(const uin + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" +@@ -3786,7 +3847,7 @@ void OMITFP I422ToARGBRow_AVX512BW(const + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX512BW(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%xmm5,%%xmm5,%%xmm5 \n" +@@ -3825,7 +3886,7 @@ void OMITFP I422ToAR30Row_AVX2(const uin + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants +@@ -3865,7 +3926,7 @@ void OMITFP I210ToARGBRow_AVX2(const uin + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" +@@ -3900,7 +3961,7 @@ void OMITFP I212ToARGBRow_AVX2(const uin + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" +@@ -3935,7 +3996,7 @@ void OMITFP I210ToAR30Row_AVX2(const uin + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants +@@ -3975,7 +4036,7 @@ void OMITFP I212ToAR30Row_AVX2(const uin + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants +@@ -4015,7 +4076,7 @@ void OMITFP I410ToARGBRow_AVX2(const uin + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" +@@ -4051,7 +4112,8 @@ void OMITFP I210AlphaToARGBRow_AVX2(cons + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile (YUVTORGB_SETUP_AVX2( ++ asm volatile( ++ YUVTORGB_SETUP_AVX2( + yuvconstants) "sub %[u_buf],%[v_buf] \n" + + LABELALIGN "1: \n" READYUVA210_AVX2 +@@ -4086,7 +4148,8 @@ void OMITFP I410AlphaToARGBRow_AVX2(cons + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile (YUVTORGB_SETUP_AVX2( ++ asm volatile( ++ YUVTORGB_SETUP_AVX2( + yuvconstants) "sub %[u_buf],%[v_buf] \n" + + LABELALIGN "1: \n" READYUVA410_AVX2 +@@ -4120,7 +4183,7 @@ void OMITFP I410ToAR30Row_AVX2(const uin + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants +@@ -4161,27 +4224,34 @@ void OMITFP I444AlphaToARGBRow_AVX2(cons + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile (YUVTORGB_SETUP_AVX2( +- yuvconstants) "sub %[u_buf],%[v_buf] \n" +- +- LABELALIGN "1: \n" READYUVA444_AVX2 +- YUVTORGB_AVX2(yuvconstants) STOREARGB_AVX2 ++ // clang-format off ++ asm volatile ( ++ YUVTORGB_SETUP_AVX2(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ ++ LABELALIGN ++ "1: \n" ++ READYUVA444_AVX2 ++ YUVTORGB_AVX2(yuvconstants) ++ STOREARGB_AVX2 + "subl $0x10,%[width] \n" + "jg 1b \n" + "vzeroupper \n" +- : [y_buf] "+r"(y_buf), // %[y_buf] +- [u_buf] "+r"(u_buf), // %[u_buf] +- [v_buf] "+r"(v_buf), // %[v_buf] +- [a_buf] "+r"(a_buf), // %[a_buf] +- [dst_argb] "+r"(dst_argb), // %[dst_argb] ++ : [y_buf]"+r"(y_buf), // %[y_buf] ++ [u_buf]"+r"(u_buf), // %[u_buf] ++ [v_buf]"+r"(v_buf), // %[v_buf] ++ [a_buf]"+r"(a_buf), // %[a_buf] ++ [dst_argb]"+r"(dst_argb), // %[dst_argb] + #if defined(__i386__) +- [width] "+m"(width) // %[width] ++ [width]"+m"(width) // %[width] + #else +- [width] "+rm"(width) // %[width] ++ [width]"+rm"(width) // %[width] + #endif +- : [yuvconstants] "r"(yuvconstants) // %[yuvconstants] +- : "memory", "cc", YUVTORGB_REGS_AVX2 "xmm0", "xmm1", "xmm2", "xmm3", +- "xmm4", "xmm5"); ++ : [yuvconstants]"r"(yuvconstants) // %[yuvconstants] ++ : "memory", "cc", YUVTORGB_REGS_AVX2 ++ "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" ++ ); ++ // clang-format on + } + #endif // HAS_I444ALPHATOARGBROW_AVX2 + +@@ -4195,27 +4265,34 @@ void OMITFP I422AlphaToARGBRow_AVX2(cons + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile (YUVTORGB_SETUP_AVX2( +- yuvconstants) "sub %[u_buf],%[v_buf] \n" +- +- LABELALIGN "1: \n" READYUVA422_AVX2 +- YUVTORGB_AVX2(yuvconstants) STOREARGB_AVX2 ++ // clang-format off ++ asm volatile ( ++ YUVTORGB_SETUP_AVX2(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ ++ LABELALIGN ++ "1: \n" ++ READYUVA422_AVX2 ++ YUVTORGB_AVX2(yuvconstants) ++ STOREARGB_AVX2 + "subl $0x10,%[width] \n" + "jg 1b \n" + "vzeroupper \n" +- : [y_buf] "+r"(y_buf), // %[y_buf] +- [u_buf] "+r"(u_buf), // %[u_buf] +- [v_buf] "+r"(v_buf), // %[v_buf] +- [a_buf] "+r"(a_buf), // %[a_buf] +- [dst_argb] "+r"(dst_argb), // %[dst_argb] ++ : [y_buf]"+r"(y_buf), // %[y_buf] ++ [u_buf]"+r"(u_buf), // %[u_buf] ++ [v_buf]"+r"(v_buf), // %[v_buf] ++ [a_buf]"+r"(a_buf), // %[a_buf] ++ [dst_argb]"+r"(dst_argb), // %[dst_argb] + #if defined(__i386__) +- [width] "+m"(width) // %[width] ++ [width]"+m"(width) // %[width] + #else +- [width] "+rm"(width) // %[width] ++ [width]"+rm"(width) // %[width] + #endif +- : [yuvconstants] "r"(yuvconstants) // %[yuvconstants] +- : "memory", "cc", YUVTORGB_REGS_AVX2 "xmm0", "xmm1", "xmm2", "xmm3", +- "xmm4", "xmm5"); ++ : [yuvconstants]"r"(yuvconstants) // %[yuvconstants] ++ : "memory", "cc", YUVTORGB_REGS_AVX2 ++ "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" ++ ); ++ // clang-format on + } + #endif // HAS_I422ALPHATOARGBROW_AVX2 + +@@ -4228,7 +4305,7 @@ void OMITFP I422ToRGBARow_AVX2(const uin + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" +@@ -4271,21 +4348,28 @@ void OMITFP NV12ToARGBRow_AVX2(const uin + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile (YUVTORGB_SETUP_AVX2( +- yuvconstants) "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" +- +- LABELALIGN "1: \n" READNV12_AVX2 +- YUVTORGB_AVX2(yuvconstants) STOREARGB_AVX2 ++ // clang-format off ++ asm volatile ( ++ YUVTORGB_SETUP_AVX2(yuvconstants) ++ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" ++ ++ LABELALIGN ++ "1: \n" ++ READNV12_AVX2 ++ YUVTORGB_AVX2(yuvconstants) ++ STOREARGB_AVX2 + "sub $0x10,%[width] \n" + "jg 1b \n" + "vzeroupper \n" +- : [y_buf] "+r"(y_buf), // %[y_buf] +- [uv_buf] "+r"(uv_buf), // %[uv_buf] +- [dst_argb] "+r"(dst_argb), // %[dst_argb] +- [width] "+rm"(width) // %[width] +- : [yuvconstants] "r"(yuvconstants) // %[yuvconstants] +- : "memory", "cc", YUVTORGB_REGS_AVX2 "xmm0", "xmm0", "xmm1", "xmm2", +- "xmm3", "xmm4", "xmm5"); ++ : [y_buf]"+r"(y_buf), // %[y_buf] ++ [uv_buf]"+r"(uv_buf), // %[uv_buf] ++ [dst_argb]"+r"(dst_argb), // %[dst_argb] ++ [width]"+rm"(width) // %[width] ++ : [yuvconstants]"r"(yuvconstants) // %[yuvconstants] ++ : "memory", "cc", YUVTORGB_REGS_AVX2 ++ "xmm0", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" ++ ); ++ // clang-format on + } + #endif // HAS_NV12TOARGBROW_AVX2 + +@@ -4297,22 +4381,29 @@ void OMITFP NV21ToARGBRow_AVX2(const uin + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile (YUVTORGB_SETUP_AVX2( +- yuvconstants) "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" +- +- LABELALIGN "1: \n" READNV21_AVX2 +- YUVTORGB_AVX2(yuvconstants) STOREARGB_AVX2 ++ // clang-format off ++ asm volatile ( ++ YUVTORGB_SETUP_AVX2(yuvconstants) ++ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" ++ ++ LABELALIGN ++ "1: \n" ++ READNV21_AVX2 ++ YUVTORGB_AVX2(yuvconstants) ++ STOREARGB_AVX2 + "sub $0x10,%[width] \n" + "jg 1b \n" + "vzeroupper \n" +- : [y_buf] "+r"(y_buf), // %[y_buf] +- [vu_buf] "+r"(vu_buf), // %[vu_buf] +- [dst_argb] "+r"(dst_argb), // %[dst_argb] +- [width] "+rm"(width) // %[width] +- : [yuvconstants] "r"(yuvconstants), // %[yuvconstants] +- [kShuffleNV21] "m"(kShuffleNV21) +- : "memory", "cc", YUVTORGB_REGS_AVX2 "xmm0", "xmm0", "xmm1", "xmm2", +- "xmm3", "xmm4", "xmm5"); ++ : [y_buf]"+r"(y_buf), // %[y_buf] ++ [vu_buf]"+r"(vu_buf), // %[vu_buf] ++ [dst_argb]"+r"(dst_argb), // %[dst_argb] ++ [width]"+rm"(width) // %[width] ++ : [yuvconstants]"r"(yuvconstants), // %[yuvconstants] ++ [kShuffleNV21]"m"(kShuffleNV21) ++ : "memory", "cc", YUVTORGB_REGS_AVX2 ++ "xmm0", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" ++ ); ++ // clang-format on + } + #endif // HAS_NV21TOARGBROW_AVX2 + +@@ -4323,23 +4414,29 @@ void OMITFP YUY2ToARGBRow_AVX2(const uin + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { ++ // clang-format off + asm volatile ( +- "vbroadcastf128 %[kShuffleYUY2Y],%%ymm6 \n" +- "vbroadcastf128 %[kShuffleYUY2UV],%%ymm7 \n" YUVTORGB_SETUP_AVX2( +- yuvconstants) "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" +- +- LABELALIGN "1: \n" READYUY2_AVX2 +- YUVTORGB_AVX2(yuvconstants) STOREARGB_AVX2 ++ YUVTORGB_SETUP_AVX2(yuvconstants) ++ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" ++ ++ LABELALIGN ++ "1: \n" ++ READYUY2_AVX2 ++ YUVTORGB_AVX2(yuvconstants) ++ STOREARGB_AVX2 + "sub $0x10,%[width] \n" + "jg 1b \n" + "vzeroupper \n" +- : [yuy2_buf] "+r"(yuy2_buf), // %[yuy2_buf] +- [dst_argb] "+r"(dst_argb), // %[dst_argb] +- [width] "+rm"(width) // %[width] +- : [yuvconstants] "r"(yuvconstants), // %[yuvconstants] +- [kShuffleYUY2Y] "m"(kShuffleYUY2Y), [kShuffleYUY2UV] "m"(kShuffleYUY2UV) +- : "memory", "cc", YUVTORGB_REGS_AVX2 "xmm0", "xmm0", "xmm1", "xmm2", +- "xmm3", "xmm4", "xmm5", "xmm6", "xmm7"); ++ : [yuy2_buf]"+r"(yuy2_buf), // %[yuy2_buf] ++ [dst_argb]"+r"(dst_argb), // %[dst_argb] ++ [width]"+rm"(width) // %[width] ++ : [yuvconstants]"r"(yuvconstants), // %[yuvconstants] ++ [kShuffleYUY2Y]"m"(kShuffleYUY2Y), ++ [kShuffleYUY2UV]"m"(kShuffleYUY2UV) ++ : "memory", "cc", YUVTORGB_REGS_AVX2 ++ "xmm0", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" ++ ); ++ // clang-format on + } + #endif // HAS_YUY2TOARGBROW_AVX2 + +@@ -4350,23 +4447,29 @@ void OMITFP UYVYToARGBRow_AVX2(const uin + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { ++ // clang-format off + asm volatile ( +- "vbroadcastf128 %[kShuffleUYVYY],%%ymm6 \n" +- "vbroadcastf128 %[kShuffleUYVYUV],%%ymm7 \n" YUVTORGB_SETUP_AVX2( +- yuvconstants) "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" +- +- LABELALIGN "1: \n" READUYVY_AVX2 +- YUVTORGB_AVX2(yuvconstants) STOREARGB_AVX2 ++ YUVTORGB_SETUP_AVX2(yuvconstants) ++ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" ++ ++ LABELALIGN ++ "1: \n" ++ READUYVY_AVX2 ++ YUVTORGB_AVX2(yuvconstants) ++ STOREARGB_AVX2 + "sub $0x10,%[width] \n" + "jg 1b \n" + "vzeroupper \n" +- : [uyvy_buf] "+r"(uyvy_buf), // %[uyvy_buf] +- [dst_argb] "+r"(dst_argb), // %[dst_argb] +- [width] "+rm"(width) // %[width] +- : [yuvconstants] "r"(yuvconstants), // %[yuvconstants] +- [kShuffleUYVYY] "m"(kShuffleUYVYY), [kShuffleUYVYUV] "m"(kShuffleUYVYUV) +- : "memory", "cc", YUVTORGB_REGS_AVX2 "xmm0", "xmm1", "xmm2", "xmm3", +- "xmm4", "xmm5", "xmm6", "xmm7"); ++ : [uyvy_buf]"+r"(uyvy_buf), // %[uyvy_buf] ++ [dst_argb]"+r"(dst_argb), // %[dst_argb] ++ [width]"+rm"(width) // %[width] ++ : [yuvconstants]"r"(yuvconstants), // %[yuvconstants] ++ [kShuffleUYVYY]"m"(kShuffleUYVYY), ++ [kShuffleUYVYUV]"m"(kShuffleUYVYUV) ++ : "memory", "cc", YUVTORGB_REGS_AVX2 ++ "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" ++ ); ++ // clang-format on + } + #endif // HAS_UYVYTOARGBROW_AVX2 + +@@ -4378,21 +4481,28 @@ void OMITFP P210ToARGBRow_AVX2(const uin + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile (YUVTORGB_SETUP_AVX2( +- yuvconstants) "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" +- +- LABELALIGN "1: \n" READP210_AVX2 +- YUVTORGB_AVX2(yuvconstants) STOREARGB_AVX2 ++ // clang-format off ++ asm volatile ( ++ YUVTORGB_SETUP_AVX2(yuvconstants) ++ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" ++ ++ LABELALIGN ++ "1: \n" ++ READP210_AVX2 ++ YUVTORGB_AVX2(yuvconstants) ++ STOREARGB_AVX2 + "sub $0x10,%[width] \n" + "jg 1b \n" + "vzeroupper \n" +- : [y_buf] "+r"(y_buf), // %[y_buf] +- [uv_buf] "+r"(uv_buf), // %[uv_buf] +- [dst_argb] "+r"(dst_argb), // %[dst_argb] +- [width] "+rm"(width) // %[width] +- : [yuvconstants] "r"(yuvconstants) // %[yuvconstants] +- : "memory", "cc", YUVTORGB_REGS_AVX2 "xmm0", "xmm0", "xmm1", "xmm2", +- "xmm3", "xmm4", "xmm5"); ++ : [y_buf]"+r"(y_buf), // %[y_buf] ++ [uv_buf]"+r"(uv_buf), // %[uv_buf] ++ [dst_argb]"+r"(dst_argb), // %[dst_argb] ++ [width]"+rm"(width) // %[width] ++ : [yuvconstants]"r"(yuvconstants) // %[yuvconstants] ++ : "memory", "cc", YUVTORGB_REGS_AVX2 ++ "xmm0", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" ++ ); ++ // clang-format on + } + #endif // HAS_P210TOARGBROW_AVX2 + +@@ -4404,21 +4514,28 @@ void OMITFP P410ToARGBRow_AVX2(const uin + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile (YUVTORGB_SETUP_AVX2( +- yuvconstants) "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" +- +- LABELALIGN "1: \n" READP410_AVX2 +- YUVTORGB_AVX2(yuvconstants) STOREARGB_AVX2 ++ // clang-format off ++ asm volatile ( ++ YUVTORGB_SETUP_AVX2(yuvconstants) ++ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" ++ ++ LABELALIGN ++ "1: \n" ++ READP410_AVX2 ++ YUVTORGB_AVX2(yuvconstants) ++ STOREARGB_AVX2 + "sub $0x10,%[width] \n" + "jg 1b \n" + "vzeroupper \n" +- : [y_buf] "+r"(y_buf), // %[y_buf] +- [uv_buf] "+r"(uv_buf), // %[uv_buf] +- [dst_argb] "+r"(dst_argb), // %[dst_argb] +- [width] "+rm"(width) // %[width] +- : [yuvconstants] "r"(yuvconstants) // %[yuvconstants] +- : "memory", "cc", YUVTORGB_REGS_AVX2 "xmm0", "xmm0", "xmm1", "xmm2", +- "xmm3", "xmm4", "xmm5"); ++ : [y_buf]"+r"(y_buf), // %[y_buf] ++ [uv_buf]"+r"(uv_buf), // %[uv_buf] ++ [dst_argb]"+r"(dst_argb), // %[dst_argb] ++ [width]"+rm"(width) // %[width] ++ : [yuvconstants]"r"(yuvconstants) // %[yuvconstants] ++ : "memory", "cc", YUVTORGB_REGS_AVX2 ++ "xmm0", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" ++ ); ++ // clang-format on + } + #endif // HAS_P410TOARGBROW_AVX2 + +@@ -4430,7 +4547,7 @@ void OMITFP P210ToAR30Row_AVX2(const uin + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants + "vpsrlw $14,%%ymm5,%%ymm5 \n" +@@ -4467,7 +4584,7 @@ void OMITFP P410ToAR30Row_AVX2(const uin + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants + "vpsrlw $14,%%ymm5,%%ymm5 \n" +@@ -4501,7 +4618,7 @@ void I400ToARGBRow_SSE2(const uint8_t* y + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + "movdqa 96(%3),%%xmm2 \n" // yg = 18997 = 1.164 + "movdqa 128(%3),%%xmm3 \n" // ygb = 1160 = 1.164 * 16 + "pcmpeqb %%xmm4,%%xmm4 \n" // 0xff000000 +@@ -4546,7 +4663,7 @@ void I400ToARGBRow_AVX2(const uint8_t* y + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + "vmovdqa 96(%3),%%ymm2 \n" // yg = 18997 = 1.164 + "vmovdqa 128(%3),%%ymm3 \n" // ygb = -1160 = 1.164*16 + "vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" // 0xff000000 +@@ -4590,7 +4707,8 @@ static const uvec8 kShuffleMirror = {15u + + void MirrorRow_SSSE3(const uint8_t* src, uint8_t* dst, int width) { + intptr_t temp_width = (intptr_t)(width); +- asm volatile ( ++ asm volatile( ++ + "movdqa %3,%%xmm5 \n" + + LABELALIGN +@@ -4612,7 +4730,8 @@ void MirrorRow_SSSE3(const uint8_t* src, + #ifdef HAS_MIRRORROW_AVX2 + void MirrorRow_AVX2(const uint8_t* src, uint8_t* dst, int width) { + intptr_t temp_width = (intptr_t)(width); +- asm volatile ( ++ asm volatile( ++ + "vbroadcastf128 %3,%%ymm5 \n" + + LABELALIGN +@@ -4640,7 +4759,8 @@ static const uvec8 kShuffleMirrorUV = {1 + + void MirrorUVRow_SSSE3(const uint8_t* src_uv, uint8_t* dst_uv, int width) { + intptr_t temp_width = (intptr_t)(width); +- asm volatile ( ++ asm volatile( ++ + "movdqa %3,%%xmm5 \n" + + LABELALIGN +@@ -4662,7 +4782,8 @@ void MirrorUVRow_SSSE3(const uint8_t* sr + #ifdef HAS_MIRRORUVROW_AVX2 + void MirrorUVRow_AVX2(const uint8_t* src_uv, uint8_t* dst_uv, int width) { + intptr_t temp_width = (intptr_t)(width); +- asm volatile ( ++ asm volatile( ++ + "vbroadcastf128 %3,%%ymm5 \n" + + LABELALIGN +@@ -4692,7 +4813,7 @@ void MirrorSplitUVRow_SSSE3(const uint8_ + uint8_t* dst_v, + int width) { + intptr_t temp_width = (intptr_t)(width); +- asm volatile ( ++ asm volatile( + "movdqa %4,%%xmm1 \n" + "lea -0x10(%0,%3,2),%0 \n" + "sub %1,%2 \n" +@@ -4732,7 +4853,7 @@ void RGB24MirrorRow_SSSE3(const uint8_t* + int width) { + intptr_t temp_width = (intptr_t)(width); + src_rgb24 += width * 3 - 48; +- asm volatile ( ++ asm volatile( + "movdqa %3,%%xmm4 \n" + "movdqa %4,%%xmm5 \n" + +@@ -4767,7 +4888,8 @@ void RGB24MirrorRow_SSSE3(const uint8_t* + + void ARGBMirrorRow_SSE2(const uint8_t* src, uint8_t* dst, int width) { + intptr_t temp_width = (intptr_t)(width); +- asm volatile ( ++ asm volatile( ++ + "lea -0x10(%0,%2,4),%0 \n" + + LABELALIGN +@@ -4792,7 +4914,8 @@ void ARGBMirrorRow_SSE2(const uint8_t* s + static const ulvec32 kARGBShuffleMirror_AVX2 = {7u, 6u, 5u, 4u, 3u, 2u, 1u, 0u}; + void ARGBMirrorRow_AVX2(const uint8_t* src, uint8_t* dst, int width) { + intptr_t temp_width = (intptr_t)(width); +- asm volatile ( ++ asm volatile( ++ + "vmovdqu %3,%%ymm5 \n" + + LABELALIGN +@@ -4816,7 +4939,7 @@ void SplitUVRow_AVX2(const uint8_t* src_ + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" + "vpsrlw $0x8,%%ymm5,%%ymm5 \n" + "sub %1,%2 \n" +@@ -4854,7 +4977,7 @@ void SplitUVRow_SSE2(const uint8_t* src_ + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "pcmpeqb %%xmm5,%%xmm5 \n" + "psrlw $0x8,%%xmm5 \n" + "sub %1,%2 \n" +@@ -4891,7 +5014,7 @@ void DetileRow_SSE2(const uint8_t* src, + ptrdiff_t src_tile_stride, + uint8_t* dst, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "movdqu (%0),%%xmm0 \n" + "sub $0x10,%2 \n" +@@ -4912,7 +5035,7 @@ void DetileRow_16_SSE2(const uint16_t* s + ptrdiff_t src_tile_stride, + uint16_t* dst, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "movdqu (%0),%%xmm0 \n" + "movdqu 0x10(%0),%%xmm1 \n" +@@ -4935,7 +5058,7 @@ void DetileRow_16_AVX(const uint16_t* sr + ptrdiff_t src_tile_stride, + uint16_t* dst, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vmovdqu (%0),%%ymm0 \n" + "lea (%0,%3,2),%0 \n" +@@ -4960,7 +5083,7 @@ void DetileToYUY2_SSE2(const uint8_t* sr + ptrdiff_t src_uv_tile_stride, + uint8_t* dst_yuy2, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "movdqu (%0),%%xmm0 \n" // Load 16 Y + "sub $0x10,%3 \n" +@@ -4999,7 +5122,7 @@ void DetileSplitUVRow_SSSE3(const uint8_ + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "movdqu %4,%%xmm1 \n" + "1: \n" + "movdqu (%0),%%xmm0 \n" +@@ -5022,31 +5145,21 @@ void DetileSplitUVRow_SSSE3(const uint8_ + #endif // HAS_DETILESPLITUVROW_SSSE3 + + #ifdef HAS_MERGEUVROW_AVX512BW ++__attribute__ ((target("avx512vl,avx512bw"))) + void MergeUVRow_AVX512BW(const uint8_t* src_u, + const uint8_t* src_v, + uint8_t* dst_uv, + int width) { +- asm volatile ( +- "sub %0,%1 \n" +- +- LABELALIGN +- "1: \n" +- "vpmovzxbw (%0),%%zmm0 \n" +- "vpmovzxbw 0x00(%0,%1,1),%%zmm1 \n" +- "lea 0x20(%0),%0 \n" +- "vpsllw $0x8,%%zmm1,%%zmm1 \n" +- "vporq %%zmm0,%%zmm1,%%zmm2 \n" +- "vmovdqu64 %%zmm2,(%2) \n" +- "lea 0x40(%2),%2 \n" +- "sub $0x20,%3 \n" +- "jg 1b \n" +- "vzeroupper \n" +- : "+r"(src_u), // %0 +- "+r"(src_v), // %1 +- "+r"(dst_uv), // %2 +- "+r"(width) // %3 +- : +- : "memory", "cc", "xmm0", "xmm1", "xmm2"); ++ do { ++ const __m512i u = _mm512_cvtepu8_epi16(_mm256_loadu_epi8(src_u)); ++ const __m512i v = _mm512_slli_epi64(_mm512_cvtepu8_epi16(_mm256_loadu_epi8(src_v)), 8); ++ const __m512i uv = _mm512_or_si512(u, v); ++ _mm512_storeu_epi8(dst_uv, uv); ++ src_u += 32; ++ src_v += 32; ++ dst_uv += 64; ++ width -= 32; ++ } while (width > 0); + } + #endif // HAS_MERGEUVROW_AVX512BW + +@@ -5055,19 +5168,23 @@ void MergeUVRow_AVX2(const uint8_t* src_ + const uint8_t* src_v, + uint8_t* dst_uv, + int width) { +- asm volatile ( ++ asm volatile( ++ + "sub %0,%1 \n" + + LABELALIGN + "1: \n" +- "vpmovzxbw (%0),%%ymm0 \n" +- "vpmovzxbw 0x00(%0,%1,1),%%ymm1 \n" +- "lea 0x10(%0),%0 \n" +- "vpsllw $0x8,%%ymm1,%%ymm1 \n" +- "vpor %%ymm0,%%ymm1,%%ymm2 \n" +- "vmovdqu %%ymm2,(%2) \n" +- "lea 0x20(%2),%2 \n" +- "sub $0x10,%3 \n" ++ "vmovdqu (%0),%%ymm0 \n" ++ "vmovdqu 0x00(%0,%1,1),%%ymm1 \n" ++ "lea 0x20(%0),%0 \n" ++ "vpunpcklbw %%ymm1,%%ymm0,%%ymm2 \n" ++ "vpunpckhbw %%ymm1,%%ymm0,%%ymm0 \n" ++ "vextractf128 $0x0,%%ymm2,(%2) \n" ++ "vextractf128 $0x0,%%ymm0,0x10(%2) \n" ++ "vextractf128 $0x1,%%ymm2,0x20(%2) \n" ++ "vextractf128 $0x1,%%ymm0,0x30(%2) \n" ++ "lea 0x40(%2),%2 \n" ++ "sub $0x20,%3 \n" + "jg 1b \n" + "vzeroupper \n" + : "+r"(src_u), // %0 +@@ -5084,7 +5201,8 @@ void MergeUVRow_SSE2(const uint8_t* src_ + const uint8_t* src_v, + uint8_t* dst_uv, + int width) { +- asm volatile ( ++ asm volatile( ++ + "sub %0,%1 \n" + + LABELALIGN +@@ -5115,33 +5233,38 @@ void MergeUVRow_16_AVX2(const uint16_t* + uint16_t* dst_uv, + int depth, + int width) { ++ depth = 16 - depth; ++ // clang-format off + asm volatile ( + "vmovd %4,%%xmm3 \n" +- "vmovd %5,%%xmm4 \n" +- + "sub %0,%1 \n" +- // 8 pixels per loop. +- +- LABELALIGN +- "1: \n" +- "vpmovzxwd (%0),%%ymm0 \n" +- "vpmovzxwd 0x00(%0,%1,1),%%ymm1 \n" +- "lea 0x10(%0),%0 \n" ++ ++ // 16 pixels per loop. ++ LABELALIGN ++ "1: \n" ++ "vmovdqu (%0),%%ymm0 \n" ++ "vmovdqu (%0,%1,1),%%ymm1 \n" ++ "add $0x20,%0 \n" ++ + "vpsllw %%xmm3,%%ymm0,%%ymm0 \n" +- "vpslld %%xmm4,%%ymm1,%%ymm1 \n" +- "vpor %%ymm0,%%ymm1,%%ymm2 \n" +- "vmovdqu %%ymm2,(%2) \n" +- "lea 0x20(%2),%2 \n" +- "sub $0x8,%3 \n" ++ "vpsllw %%xmm3,%%ymm1,%%ymm1 \n" ++ "vpunpcklwd %%ymm1,%%ymm0,%%ymm2 \n" // mutates ++ "vpunpckhwd %%ymm1,%%ymm0,%%ymm0 \n" ++ "vextractf128 $0x0,%%ymm2,(%2) \n" ++ "vextractf128 $0x0,%%ymm0,0x10(%2) \n" ++ "vextractf128 $0x1,%%ymm2,0x20(%2) \n" ++ "vextractf128 $0x1,%%ymm0,0x30(%2) \n" ++ "add $0x40,%2 \n" ++ "sub $0x10,%3 \n" + "jg 1b \n" + "vzeroupper \n" +- : "+r"(src_u), // %0 +- "+r"(src_v), // %1 +- "+r"(dst_uv), // %2 +- "+r"(width) // %3 +- : "r"(16 - depth), // %4 +- "r"(32 - depth) // %5 +- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4"); ++ : "+r"(src_u), // %0 ++ "+r"(src_v), // %1 ++ "+r"(dst_uv), // %2 ++ "+r"(width) // %3 ++ : "r"(depth) // %4 ++ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3"); ++ // clang-format on + } + #endif // HAS_MERGEUVROW_AVX2 + +@@ -5154,13 +5277,14 @@ void SplitUVRow_16_AVX2(const uint16_t* + int depth, + int width) { + depth = 16 - depth; ++ // clang-format off + asm volatile ( + "vmovd %4,%%xmm3 \n" + "vbroadcastf128 %5,%%ymm4 \n" + "sub %1,%2 \n" + +- // 16 pixels per loop. +- LABELALIGN ++ // 16 pixels per loop. ++ LABELALIGN + "1: \n" + "vmovdqu (%0),%%ymm0 \n" + "vmovdqu 0x20(%0),%%ymm1 \n" +@@ -5180,13 +5304,14 @@ void SplitUVRow_16_AVX2(const uint16_t* + "sub $0x10,%3 \n" + "jg 1b \n" + "vzeroupper \n" +- : "+r"(src_uv), // %0 +- "+r"(dst_u), // %1 +- "+r"(dst_v), // %2 +- "+r"(width) // %3 +- : "r"(depth), // %4 +- "m"(kSplitUVShuffle16) // %5 +- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4"); ++ : "+r"(src_uv), // %0 ++ "+r"(dst_u), // %1 ++ "+r"(dst_v), // %2 ++ "+r"(width) // %3 ++ : "r"(depth), // %4 ++ "m"(kSplitUVShuffle16) // %5 ++ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4"); ++ // clang-format on + } + #endif // HAS_SPLITUVROW_16_AVX2 + +@@ -5200,14 +5325,15 @@ void MultiplyRow_16_AVX2(const uint16_t* + uint16_t* dst_y, + int scale, + int width) { ++ // clang-format off + asm volatile ( + "vmovd %3,%%xmm3 \n" + "vpunpcklwd %%xmm3,%%xmm3,%%xmm3 \n" + "vbroadcastss %%xmm3,%%ymm3 \n" + "sub %0,%1 \n" + +- // 32 pixels per loop. +- LABELALIGN ++ // 32 pixels per loop. ++ LABELALIGN + "1: \n" + "vmovdqu (%0),%%ymm0 \n" + "vmovdqu 0x20(%0),%%ymm1 \n" +@@ -5219,11 +5345,12 @@ void MultiplyRow_16_AVX2(const uint16_t* + "sub $0x20,%2 \n" + "jg 1b \n" + "vzeroupper \n" +- : "+r"(src_y), // %0 +- "+r"(dst_y), // %1 +- "+r"(width) // %2 +- : "r"(scale) // %3 +- : "memory", "cc", "xmm0", "xmm1", "xmm3"); ++ : "+r"(src_y), // %0 ++ "+r"(dst_y), // %1 ++ "+r"(width) // %2 ++ : "r"(scale) // %3 ++ : "memory", "cc", "xmm0", "xmm1", "xmm3"); ++ // clang-format on + } + #endif // HAS_MULTIPLYROW_16_AVX2 + +@@ -5237,14 +5364,15 @@ void DivideRow_16_AVX2(const uint16_t* s + uint16_t* dst_y, + int scale, + int width) { ++ // clang-format off + asm volatile ( + "vmovd %3,%%xmm3 \n" + "vpunpcklwd %%xmm3,%%xmm3,%%xmm3 \n" + "vbroadcastss %%xmm3,%%ymm3 \n" + "sub %0,%1 \n" + +- // 32 pixels per loop. +- LABELALIGN ++ // 32 pixels per loop. ++ LABELALIGN + "1: \n" + "vmovdqu (%0),%%ymm0 \n" + "vmovdqu 0x20(%0),%%ymm1 \n" +@@ -5256,12 +5384,13 @@ void DivideRow_16_AVX2(const uint16_t* s + "sub $0x20,%2 \n" + "jg 1b \n" + "vzeroupper \n" +- : "+r"(src_y), // %0 +- "+r"(dst_y), // %1 +- "+r"(width), // %2 +- "+r"(scale) // %3 +- : +- : "memory", "cc", "xmm0", "xmm1", "xmm3"); ++ : "+r"(src_y), // %0 ++ "+r"(dst_y), // %1 ++ "+r"(width), // %2 ++ "+r"(scale) // %3 ++ : ++ : "memory", "cc", "xmm0", "xmm1", "xmm3"); ++ // clang-format on + } + #endif // HAS_MULTIPLYROW_16_AVX2 + +@@ -5274,13 +5403,14 @@ void Convert16To8Row_SSSE3(const uint16_ + uint8_t* dst_y, + int scale, + int width) { ++ // clang-format off + asm volatile ( + "movd %3,%%xmm2 \n" + "punpcklwd %%xmm2,%%xmm2 \n" + "pshufd $0x0,%%xmm2,%%xmm2 \n" + +- // 32 pixels per loop. +- LABELALIGN ++ // 32 pixels per loop. ++ LABELALIGN + "1: \n" + "movdqu (%0),%%xmm0 \n" + "movdqu 0x10(%0),%%xmm1 \n" +@@ -5292,11 +5422,12 @@ void Convert16To8Row_SSSE3(const uint16_ + "add $0x10,%1 \n" + "sub $0x10,%2 \n" + "jg 1b \n" +- : "+r"(src_y), // %0 +- "+r"(dst_y), // %1 +- "+r"(width) // %2 +- : "r"(scale) // %3 +- : "memory", "cc", "xmm0", "xmm1", "xmm2"); ++ : "+r"(src_y), // %0 ++ "+r"(dst_y), // %1 ++ "+r"(width) // %2 ++ : "r"(scale) // %3 ++ : "memory", "cc", "xmm0", "xmm1", "xmm2"); ++ // clang-format on + } + + #ifdef HAS_CONVERT16TO8ROW_AVX2 +@@ -5304,13 +5435,14 @@ void Convert16To8Row_AVX2(const uint16_t + uint8_t* dst_y, + int scale, + int width) { ++ // clang-format off + asm volatile ( + "vmovd %3,%%xmm2 \n" + "vpunpcklwd %%xmm2,%%xmm2,%%xmm2 \n" + "vbroadcastss %%xmm2,%%ymm2 \n" + +- // 32 pixels per loop. +- LABELALIGN ++ // 32 pixels per loop. ++ LABELALIGN + "1: \n" + "vmovdqu (%0),%%ymm0 \n" + "vmovdqu 0x20(%0),%%ymm1 \n" +@@ -5324,11 +5456,12 @@ void Convert16To8Row_AVX2(const uint16_t + "sub $0x20,%2 \n" + "jg 1b \n" + "vzeroupper \n" +- : "+r"(src_y), // %0 +- "+r"(dst_y), // %1 +- "+r"(width) // %2 +- : "r"(scale) // %3 +- : "memory", "cc", "xmm0", "xmm1", "xmm2"); ++ : "+r"(src_y), // %0 ++ "+r"(dst_y), // %1 ++ "+r"(width) // %2 ++ : "r"(scale) // %3 ++ : "memory", "cc", "xmm0", "xmm1", "xmm2"); ++ // clang-format on + } + #endif // HAS_CONVERT16TO8ROW_AVX2 + +@@ -5336,17 +5469,19 @@ void Convert16To8Row_AVX2(const uint16_t + // 512 = 9 bits + // 1024 = 10 bits + // 4096 = 12 bits ++// TODO(fbarchard): reduce to SSE2 + void Convert8To16Row_SSE2(const uint8_t* src_y, + uint16_t* dst_y, + int scale, + int width) { ++ // clang-format off + asm volatile ( + "movd %3,%%xmm2 \n" + "punpcklwd %%xmm2,%%xmm2 \n" + "pshufd $0x0,%%xmm2,%%xmm2 \n" + +- // 32 pixels per loop. +- LABELALIGN ++ // 32 pixels per loop. ++ LABELALIGN + "1: \n" + "movdqu (%0),%%xmm0 \n" + "movdqa %%xmm0,%%xmm1 \n" +@@ -5360,11 +5495,12 @@ void Convert8To16Row_SSE2(const uint8_t* + "add $0x20,%1 \n" + "sub $0x10,%2 \n" + "jg 1b \n" +- : "+r"(src_y), // %0 +- "+r"(dst_y), // %1 +- "+r"(width) // %2 +- : "r"(scale) // %3 +- : "memory", "cc", "xmm0", "xmm1", "xmm2"); ++ : "+r"(src_y), // %0 ++ "+r"(dst_y), // %1 ++ "+r"(width) // %2 ++ : "r"(scale) // %3 ++ : "memory", "cc", "xmm0", "xmm1", "xmm2"); ++ // clang-format on + } + + #ifdef HAS_CONVERT8TO16ROW_AVX2 +@@ -5372,13 +5508,14 @@ void Convert8To16Row_AVX2(const uint8_t* + uint16_t* dst_y, + int scale, + int width) { ++ // clang-format off + asm volatile ( + "vmovd %3,%%xmm2 \n" + "vpunpcklwd %%xmm2,%%xmm2,%%xmm2 \n" + "vbroadcastss %%xmm2,%%ymm2 \n" + +- // 32 pixels per loop. +- LABELALIGN ++ // 32 pixels per loop. ++ LABELALIGN + "1: \n" + "vmovdqu (%0),%%ymm0 \n" + "vpermq $0xd8,%%ymm0,%%ymm0 \n" +@@ -5393,11 +5530,12 @@ void Convert8To16Row_AVX2(const uint8_t* + "sub $0x20,%2 \n" + "jg 1b \n" + "vzeroupper \n" +- : "+r"(src_y), // %0 +- "+r"(dst_y), // %1 +- "+r"(width) // %2 +- : "r"(scale) // %3 +- : "memory", "cc", "xmm0", "xmm1", "xmm2"); ++ : "+r"(src_y), // %0 ++ "+r"(dst_y), // %1 ++ "+r"(width) // %2 ++ : "r"(scale) // %3 ++ : "memory", "cc", "xmm0", "xmm1", "xmm2"); ++ // clang-format on + } + #endif // HAS_CONVERT8TO16ROW_AVX2 + +@@ -5428,7 +5566,9 @@ void SplitRGBRow_SSSE3(const uint8_t* sr + uint8_t* dst_g, + uint8_t* dst_b, + int width) { +- asm volatile (LABELALIGN ++ asm volatile( ++ ++ LABELALIGN + "1: \n" + "movdqu (%0),%%xmm0 \n" + "movdqu 0x10(%0),%%xmm1 \n" +@@ -5502,7 +5642,9 @@ void MergeRGBRow_SSSE3(const uint8_t* sr + const uint8_t* src_b, + uint8_t* dst_rgb, + int width) { +- asm volatile (LABELALIGN ++ asm volatile( ++ ++ LABELALIGN + "1: \n" + "movdqu (%0),%%xmm0 \n" + "movdqu (%1),%%xmm1 \n" +@@ -5557,7 +5699,8 @@ void MergeARGBRow_SSE2(const uint8_t* sr + const uint8_t* src_a, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( ++ + "sub %0,%1 \n" + "sub %0,%2 \n" + "sub %0,%3 \n" +@@ -5598,7 +5741,9 @@ void MergeXRGBRow_SSE2(const uint8_t* sr + const uint8_t* src_b, + uint8_t* dst_argb, + int width) { +- asm volatile (LABELALIGN ++ asm volatile( ++ ++ LABELALIGN + "1: \n" + + "movq (%2),%%xmm0 \n" // B +@@ -5636,7 +5781,8 @@ void MergeARGBRow_AVX2(const uint8_t* sr + const uint8_t* src_a, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( ++ + "sub %0,%1 \n" + "sub %0,%2 \n" + "sub %0,%3 \n" +@@ -5681,13 +5827,13 @@ void MergeXRGBRow_AVX2(const uint8_t* sr + const uint8_t* src_b, + uint8_t* dst_argb, + int width) { +- asm( ++ asm volatile( + + LABELALIGN + "1: \n" + + "vmovdqu (%2),%%xmm0 \n" // B +- "vpcmpeqb %%ymm1,%%ymm1,%%ymm1 \n" // A(255) ++ "vpcmpeqd %%ymm1,%%ymm1,%%ymm1 \n" // A(255) + "vinserti128 $0,(%1),%%ymm1,%%ymm1 \n" // R + "vinserti128 $1,(%0),%%ymm0,%%ymm0 \n" // G + "vpunpckhbw %%ymm1,%%ymm0,%%ymm2 \n" +@@ -5713,8 +5859,8 @@ void MergeXRGBRow_AVX2(const uint8_t* sr + "+r"(src_b), // %2 + "+r"(dst_argb), // %3 + "+rm"(width) // %4 +- ::"memory", +- "cc", "xmm0", "xmm1", "xmm2"); ++ : ++ : "memory", "cc", "xmm0", "xmm1", "xmm2"); + } + #endif // HAS_MERGEARGBROW_AVX2 + +@@ -5725,7 +5871,8 @@ void SplitARGBRow_SSE2(const uint8_t* sr + uint8_t* dst_b, + uint8_t* dst_a, + int width) { +- asm volatile ( ++ asm volatile( ++ + "sub %1,%2 \n" + "sub %1,%3 \n" + "sub %1,%4 \n" +@@ -5776,7 +5923,9 @@ void SplitXRGBRow_SSE2(const uint8_t* sr + uint8_t* dst_g, + uint8_t* dst_b, + int width) { +- asm volatile (LABELALIGN ++ asm volatile( ++ ++ LABELALIGN + "1: \n" + + "movdqu (%0),%%xmm0 \n" // 00-0F +@@ -5825,7 +5974,8 @@ void SplitARGBRow_SSSE3(const uint8_t* s + uint8_t* dst_b, + uint8_t* dst_a, + int width) { +- asm volatile ( ++ asm volatile( ++ + "movdqa %6,%%xmm3 \n" + "sub %1,%2 \n" + "sub %1,%3 \n" +@@ -5871,7 +6021,8 @@ void SplitXRGBRow_SSSE3(const uint8_t* s + uint8_t* dst_g, + uint8_t* dst_b, + int width) { +- asm volatile ( ++ asm volatile( ++ + "movdqa %5,%%xmm3 \n" + + LABELALIGN +@@ -5912,7 +6063,8 @@ void SplitARGBRow_AVX2(const uint8_t* sr + uint8_t* dst_b, + uint8_t* dst_a, + int width) { +- asm volatile ( ++ asm volatile( ++ + "sub %1,%2 \n" + "sub %1,%3 \n" + "sub %1,%4 \n" +@@ -5963,7 +6115,8 @@ void SplitXRGBRow_AVX2(const uint8_t* sr + uint8_t* dst_g, + uint8_t* dst_b, + int width) { +- asm volatile ( ++ asm volatile( ++ + "vmovdqa %6,%%ymm3 \n" + "vbroadcastf128 %5,%%ymm4 \n" + +@@ -6010,7 +6163,8 @@ void MergeXR30Row_AVX2(const uint16_t* s + int depth, + int width) { + int shift = depth - 10; +- asm volatile ( ++ asm volatile( ++ + "sub %0,%1 \n" + "sub %0,%2 \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants +@@ -6076,7 +6230,8 @@ void MergeAR64Row_AVX2(const uint16_t* s + int shift = 16 - depth; + int mask = (1 << depth) - 1; + mask = (mask << 16) + mask; +- asm volatile ( ++ asm volatile( ++ + "sub %0,%1 \n" + "sub %0,%2 \n" + "sub %0,%3 \n" +@@ -6147,7 +6302,8 @@ void MergeXR64Row_AVX2(const uint16_t* s + int shift = 16 - depth; + int mask = (1 << depth) - 1; + mask = (mask << 16) + mask; +- asm volatile ( ++ asm volatile( ++ + "sub %0,%1 \n" + "sub %0,%2 \n" + "vmovdqa %7,%%ymm5 \n" +@@ -6210,7 +6366,8 @@ void MergeARGB16To8Row_AVX2(const uint16 + int depth, + int width) { + int shift = depth - 8; +- asm volatile ( ++ asm volatile( ++ + "sub %0,%1 \n" + "sub %0,%2 \n" + "sub %0,%3 \n" +@@ -6266,7 +6423,8 @@ void MergeXRGB16To8Row_AVX2(const uint16 + int depth, + int width) { + int shift = depth - 8; +- asm volatile ( ++ asm volatile( ++ + "sub %0,%1 \n" + "sub %0,%2 \n" + "vbroadcastf128 %6,%%ymm5 \n" +@@ -6310,7 +6468,7 @@ void MergeXRGB16To8Row_AVX2(const uint16 + + #ifdef HAS_COPYROW_SSE2 + void CopyRow_SSE2(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + "test $0xf,%0 \n" + "jne 2f \n" + "test $0xf,%1 \n" +@@ -6350,7 +6508,9 @@ void CopyRow_SSE2(const uint8_t* src, ui + + #ifdef HAS_COPYROW_AVX + void CopyRow_AVX(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile (LABELALIGN ++ asm volatile( ++ ++ LABELALIGN + "1: \n" + "vmovdqu (%0),%%ymm0 \n" + "vmovdqu 0x20(%0),%%ymm1 \n" +@@ -6373,7 +6533,8 @@ void CopyRow_AVX(const uint8_t* src, uin + // Multiple of 1. + void CopyRow_ERMS(const uint8_t* src, uint8_t* dst, int width) { + size_t width_tmp = (size_t)(width); +- asm volatile ( ++ asm volatile( ++ + "rep movsb \n" + : "+S"(src), // %0 + "+D"(dst), // %1 +@@ -6386,7 +6547,7 @@ void CopyRow_ERMS(const uint8_t* src, ui + #ifdef HAS_ARGBCOPYALPHAROW_SSE2 + // width in pixels + void ARGBCopyAlphaRow_SSE2(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + "pcmpeqb %%xmm0,%%xmm0 \n" + "pslld $0x18,%%xmm0 \n" + "pcmpeqb %%xmm1,%%xmm1 \n" +@@ -6421,7 +6582,7 @@ void ARGBCopyAlphaRow_SSE2(const uint8_t + #ifdef HAS_ARGBCOPYALPHAROW_AVX2 + // width in pixels + void ARGBCopyAlphaRow_AVX2(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + "vpcmpeqb %%ymm0,%%ymm0,%%ymm0 \n" + "vpsrld $0x8,%%ymm0,%%ymm0 \n" + +@@ -6451,7 +6612,9 @@ void ARGBCopyAlphaRow_AVX2(const uint8_t + void ARGBExtractAlphaRow_SSE2(const uint8_t* src_argb, + uint8_t* dst_a, + int width) { +- asm volatile (LABELALIGN ++ asm volatile( ++ ++ LABELALIGN + "1: \n" + "movdqu (%0), %%xmm0 \n" + "movdqu 0x10(%0), %%xmm1 \n" +@@ -6480,7 +6643,7 @@ static const uvec8 kShuffleAlphaShort_AV + void ARGBExtractAlphaRow_AVX2(const uint8_t* src_argb, + uint8_t* dst_a, + int width) { +- asm volatile ( ++ asm volatile( + "vmovdqa %3,%%ymm4 \n" + "vbroadcastf128 %4,%%ymm5 \n" + +@@ -6516,7 +6679,7 @@ void ARGBExtractAlphaRow_AVX2(const uint + #ifdef HAS_ARGBCOPYYTOALPHAROW_SSE2 + // width in pixels + void ARGBCopyYToAlphaRow_SSE2(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + "pcmpeqb %%xmm0,%%xmm0 \n" + "pslld $0x18,%%xmm0 \n" + "pcmpeqb %%xmm1,%%xmm1 \n" +@@ -6553,7 +6716,7 @@ void ARGBCopyYToAlphaRow_SSE2(const uint + #ifdef HAS_ARGBCOPYYTOALPHAROW_AVX2 + // width in pixels + void ARGBCopyYToAlphaRow_AVX2(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + "vpcmpeqb %%ymm0,%%ymm0,%%ymm0 \n" + "vpsrld $0x8,%%ymm0,%%ymm0 \n" + +@@ -6584,7 +6747,8 @@ void ARGBCopyYToAlphaRow_AVX2(const uint + void SetRow_X86(uint8_t* dst, uint8_t v8, int width) { + size_t width_tmp = (size_t)(width >> 2); + const uint32_t v32 = v8 * 0x01010101u; // Duplicate byte to all bytes. +- asm volatile ( ++ asm volatile( ++ + "rep stosl \n" + : "+D"(dst), // %0 + "+c"(width_tmp) // %1 +@@ -6594,7 +6758,8 @@ void SetRow_X86(uint8_t* dst, uint8_t v8 + + void SetRow_ERMS(uint8_t* dst, uint8_t v8, int width) { + size_t width_tmp = (size_t)(width); +- asm volatile ( ++ asm volatile( ++ + "rep stosb \n" + : "+D"(dst), // %0 + "+c"(width_tmp) // %1 +@@ -6604,7 +6769,8 @@ void SetRow_ERMS(uint8_t* dst, uint8_t v + + void ARGBSetRow_X86(uint8_t* dst_argb, uint32_t v32, int width) { + size_t width_tmp = (size_t)(width); +- asm volatile ( ++ asm volatile( ++ + "rep stosl \n" + : "+D"(dst_argb), // %0 + "+c"(width_tmp) // %1 +@@ -6615,7 +6781,7 @@ void ARGBSetRow_X86(uint8_t* dst_argb, u + + #ifdef HAS_YUY2TOYROW_SSE2 + void YUY2ToYRow_SSE2(const uint8_t* src_yuy2, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "pcmpeqb %%xmm5,%%xmm5 \n" + "psrlw $0x8,%%xmm5 \n" + +@@ -6642,7 +6808,7 @@ void YUY2ToNVUVRow_SSE2(const uint8_t* s + int stride_yuy2, + uint8_t* dst_uv, + int width) { +- asm volatile (LABELALIGN ++ asm volatile(LABELALIGN + "1: \n" + "movdqu (%0),%%xmm0 \n" + "movdqu 0x10(%0),%%xmm1 \n" +@@ -6658,11 +6824,11 @@ void YUY2ToNVUVRow_SSE2(const uint8_t* s + "lea 0x10(%1),%1 \n" + "sub $0x10,%2 \n" + "jg 1b \n" +- : "+r"(src_yuy2), // %0 +- "+r"(dst_uv), // %1 +- "+r"(width) // %2 +- : "r"((intptr_t)(stride_yuy2)) // %3 +- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3"); ++ : "+r"(src_yuy2), // %0 ++ "+r"(dst_uv), // %1 ++ "+r"(width) // %2 ++ : "r"((intptr_t)(stride_yuy2)) // %3 ++ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3"); + } + + void YUY2ToUVRow_SSE2(const uint8_t* src_yuy2, +@@ -6670,7 +6836,7 @@ void YUY2ToUVRow_SSE2(const uint8_t* src + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "pcmpeqb %%xmm5,%%xmm5 \n" + "psrlw $0x8,%%xmm5 \n" + "sub %1,%2 \n" +@@ -6709,7 +6875,7 @@ void YUY2ToUV422Row_SSE2(const uint8_t* + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "pcmpeqb %%xmm5,%%xmm5 \n" + "psrlw $0x8,%%xmm5 \n" + "sub %1,%2 \n" +@@ -6741,7 +6907,9 @@ void YUY2ToUV422Row_SSE2(const uint8_t* + } + + void UYVYToYRow_SSE2(const uint8_t* src_uyvy, uint8_t* dst_y, int width) { +- asm volatile (LABELALIGN ++ asm volatile( ++ ++ LABELALIGN + "1: \n" + "movdqu (%0),%%xmm0 \n" + "movdqu 0x10(%0),%%xmm1 \n" +@@ -6765,7 +6933,7 @@ void UYVYToUVRow_SSE2(const uint8_t* src + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "pcmpeqb %%xmm5,%%xmm5 \n" + "psrlw $0x8,%%xmm5 \n" + "sub %1,%2 \n" +@@ -6804,7 +6972,7 @@ void UYVYToUV422Row_SSE2(const uint8_t* + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "pcmpeqb %%xmm5,%%xmm5 \n" + "psrlw $0x8,%%xmm5 \n" + "sub %1,%2 \n" +@@ -6838,7 +7006,7 @@ void UYVYToUV422Row_SSE2(const uint8_t* + + #ifdef HAS_YUY2TOYROW_AVX2 + void YUY2ToYRow_AVX2(const uint8_t* src_yuy2, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" + "vpsrlw $0x8,%%ymm5,%%ymm5 \n" + +@@ -6867,7 +7035,9 @@ void YUY2ToNVUVRow_AVX2(const uint8_t* s + int stride_yuy2, + uint8_t* dst_uv, + int width) { +- asm volatile (LABELALIGN ++ asm volatile( ++ ++ LABELALIGN + "1: \n" + "vmovdqu (%0),%%ymm0 \n" + "vmovdqu 0x20(%0),%%ymm1 \n" +@@ -6895,7 +7065,7 @@ void YUY2ToUVRow_AVX2(const uint8_t* src + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" + "vpsrlw $0x8,%%ymm5,%%ymm5 \n" + "sub %1,%2 \n" +@@ -6935,7 +7105,7 @@ void YUY2ToUV422Row_AVX2(const uint8_t* + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" + "vpsrlw $0x8,%%ymm5,%%ymm5 \n" + "sub %1,%2 \n" +@@ -6970,7 +7140,9 @@ void YUY2ToUV422Row_AVX2(const uint8_t* + } + + void UYVYToYRow_AVX2(const uint8_t* src_uyvy, uint8_t* dst_y, int width) { +- asm volatile (LABELALIGN ++ asm volatile( ++ ++ LABELALIGN + "1: \n" + "vmovdqu (%0),%%ymm0 \n" + "vmovdqu 0x20(%0),%%ymm1 \n" +@@ -6995,7 +7167,7 @@ void UYVYToUVRow_AVX2(const uint8_t* src + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" + "vpsrlw $0x8,%%ymm5,%%ymm5 \n" + "sub %1,%2 \n" +@@ -7035,7 +7207,7 @@ void UYVYToUV422Row_AVX2(const uint8_t* + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" + "vpsrlw $0x8,%%ymm5,%%ymm5 \n" + "sub %1,%2 \n" +@@ -7080,7 +7252,7 @@ void ARGBBlendRow_SSSE3(const uint8_t* s + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "pcmpeqb %%xmm7,%%xmm7 \n" + "psrlw $0xf,%%xmm7 \n" + "pcmpeqb %%xmm6,%%xmm6 \n" +@@ -7168,7 +7340,7 @@ void BlendPlaneRow_SSSE3(const uint8_t* + const uint8_t* alpha, + uint8_t* dst, + int width) { +- asm volatile ( ++ asm volatile( + "pcmpeqb %%xmm5,%%xmm5 \n" + "psllw $0x8,%%xmm5 \n" + "mov $0x80808080,%%eax \n" +@@ -7220,7 +7392,7 @@ void BlendPlaneRow_AVX2(const uint8_t* s + const uint8_t* alpha, + uint8_t* dst, + int width) { +- asm volatile ( ++ asm volatile( + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" + "vpsllw $0x8,%%ymm5,%%ymm5 \n" + "mov $0x80808080,%%eax \n" +@@ -7272,106 +7444,93 @@ void BlendPlaneRow_AVX2(const uint8_t* s + + #ifdef HAS_ARGBATTENUATEROW_SSSE3 + // Shuffle table duplicating alpha. +-static const vec8 kAttenuateShuffle = {6, -128, 6, -128, 6, -128, +- -128, -128, 14, -128, 14, -128, +- 14, -128, -128, -128}; +- ++static const uvec8 kShuffleAlpha0 = {3u, 3u, 3u, 3u, 3u, 3u, 128u, 128u, ++ 7u, 7u, 7u, 7u, 7u, 7u, 128u, 128u}; ++static const uvec8 kShuffleAlpha1 = {11u, 11u, 11u, 11u, 11u, 11u, 128u, 128u, ++ 15u, 15u, 15u, 15u, 15u, 15u, 128u, 128u}; + // Attenuate 4 pixels at a time. + void ARGBAttenuateRow_SSSE3(const uint8_t* src_argb, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( ++ "pcmpeqb %%xmm3,%%xmm3 \n" ++ "pslld $0x18,%%xmm3 \n" + "movdqa %3,%%xmm4 \n" +- "pcmpeqb %%xmm5,%%xmm5 \n" +- "pslld $0x18,%%xmm5 \n" +- "pxor %%xmm6,%%xmm6 \n" +- "pcmpeqb %%xmm7,%%xmm7 \n" +- "punpcklbw %%xmm6,%%xmm7 \n" +- "sub %0,%1 \n" ++ "movdqa %4,%%xmm5 \n" + + // 4 pixel loop. + LABELALIGN + "1: \n" +- "movdqu (%0),%%xmm6 \n" +- "movdqa %%xmm6,%%xmm0 \n" +- "movdqa %%xmm6,%%xmm1 \n" +- "punpcklbw %%xmm5,%%xmm0 \n" +- "punpckhbw %%xmm5,%%xmm1 \n" +- "movdqa %%xmm0,%%xmm2 \n" +- "movdqa %%xmm1,%%xmm3 \n" +- "pshufb %%xmm4,%%xmm2 \n" // a,a,a,0 +- "pshufb %%xmm4,%%xmm3 \n" +- "pmullw %%xmm2,%%xmm0 \n" // rgb * alpha +- "pmullw %%xmm3,%%xmm1 \n" +- "paddw %%xmm7,%%xmm0 \n" // + 255 +- "paddw %%xmm7,%%xmm1 \n" ++ "movdqu (%0),%%xmm0 \n" ++ "pshufb %%xmm4,%%xmm0 \n" ++ "movdqu (%0),%%xmm1 \n" ++ "punpcklbw %%xmm1,%%xmm1 \n" ++ "pmulhuw %%xmm1,%%xmm0 \n" ++ "movdqu (%0),%%xmm1 \n" ++ "pshufb %%xmm5,%%xmm1 \n" ++ "movdqu (%0),%%xmm2 \n" ++ "punpckhbw %%xmm2,%%xmm2 \n" ++ "pmulhuw %%xmm2,%%xmm1 \n" ++ "movdqu (%0),%%xmm2 \n" ++ "lea 0x10(%0),%0 \n" ++ "pand %%xmm3,%%xmm2 \n" + "psrlw $0x8,%%xmm0 \n" + "psrlw $0x8,%%xmm1 \n" + "packuswb %%xmm1,%%xmm0 \n" +- "pand %%xmm5,%%xmm6 \n" +- "por %%xmm6,%%xmm0 \n" +- "movdqu %%xmm0,(%0,%1) \n" +- "lea 0x10(%0),%0 \n" ++ "por %%xmm2,%%xmm0 \n" ++ "movdqu %%xmm0,(%1) \n" ++ "lea 0x10(%1),%1 \n" + "sub $0x4,%2 \n" + "jg 1b \n" +- : "+r"(src_argb), // %0 +- "+r"(dst_argb), // %1 +- "+r"(width) // %2 +- : "m"(kAttenuateShuffle) // %3 +- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", +- "xmm7"); ++ : "+r"(src_argb), // %0 ++ "+r"(dst_argb), // %1 ++ "+r"(width) // %2 ++ : "m"(kShuffleAlpha0), // %3 ++ "m"(kShuffleAlpha1) // %4 ++ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5"); + } + #endif // HAS_ARGBATTENUATEROW_SSSE3 + + #ifdef HAS_ARGBATTENUATEROW_AVX2 +- + // Shuffle table duplicating alpha. +-static const lvec8 kAttenuateShuffle_AVX2 = { +- 6, -128, 6, -128, 6, -128, -128, -128, 14, -128, 14, +- -128, 14, -128, -128, -128, 22, -128, 22, -128, 22, -128, +- -128, -128, 30, -128, 30, -128, 30, -128, -128, -128}; +- ++static const uvec8 kShuffleAlpha_AVX2 = {6u, 7u, 6u, 7u, 6u, 7u, ++ 128u, 128u, 14u, 15u, 14u, 15u, ++ 14u, 15u, 128u, 128u}; + // Attenuate 8 pixels at a time. + void ARGBAttenuateRow_AVX2(const uint8_t* src_argb, + uint8_t* dst_argb, + int width) { +- asm volatile ( +- "vmovdqa %3,%%ymm4 \n" ++ asm volatile( ++ "vbroadcastf128 %3,%%ymm4 \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" + "vpslld $0x18,%%ymm5,%%ymm5 \n" +- "vpxor %%ymm6,%%ymm6,%%ymm6 \n" +- "vpcmpeqb %%ymm7,%%ymm7,%%ymm7 \n" +- "vpunpcklbw %%ymm6,%%ymm7,%%ymm7 \n" + "sub %0,%1 \n" + + // 8 pixel loop. + LABELALIGN + "1: \n" + "vmovdqu (%0),%%ymm6 \n" +- "vpunpcklbw %%ymm5,%%ymm6,%%ymm0 \n" +- "vpunpckhbw %%ymm5,%%ymm6,%%ymm1 \n" ++ "vpunpcklbw %%ymm6,%%ymm6,%%ymm0 \n" ++ "vpunpckhbw %%ymm6,%%ymm6,%%ymm1 \n" + "vpshufb %%ymm4,%%ymm0,%%ymm2 \n" + "vpshufb %%ymm4,%%ymm1,%%ymm3 \n" +- "vpmullw %%ymm2,%%ymm0,%%ymm0 \n" +- "vpmullw %%ymm3,%%ymm1,%%ymm1 \n" +- "vpaddw %%ymm7,%%ymm0,%%ymm0 \n" +- "vpaddw %%ymm7,%%ymm1,%%ymm1 \n" ++ "vpmulhuw %%ymm2,%%ymm0,%%ymm0 \n" ++ "vpmulhuw %%ymm3,%%ymm1,%%ymm1 \n" ++ "vpand %%ymm5,%%ymm6,%%ymm6 \n" + "vpsrlw $0x8,%%ymm0,%%ymm0 \n" + "vpsrlw $0x8,%%ymm1,%%ymm1 \n" + "vpackuswb %%ymm1,%%ymm0,%%ymm0 \n" +- "vpand %%ymm5,%%ymm6,%%ymm1 \n" +- "vpor %%ymm1,%%ymm0,%%ymm0 \n" ++ "vpor %%ymm6,%%ymm0,%%ymm0 \n" + "vmovdqu %%ymm0,0x00(%0,%1,1) \n" + "lea 0x20(%0),%0 \n" + "sub $0x8,%2 \n" + "jg 1b \n" + "vzeroupper \n" +- : "+r"(src_argb), // %0 +- "+r"(dst_argb), // %1 +- "+r"(width) // %2 +- : "m"(kAttenuateShuffle_AVX2) // %3 +- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", +- "xmm7"); ++ : "+r"(src_argb), // %0 ++ "+r"(dst_argb), // %1 ++ "+r"(width) // %2 ++ : "m"(kShuffleAlpha_AVX2) // %3 ++ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6"); + } + #endif // HAS_ARGBATTENUATEROW_AVX2 + +@@ -7381,7 +7540,7 @@ void ARGBUnattenuateRow_SSE2(const uint8 + uint8_t* dst_argb, + int width) { + uintptr_t alpha; +- asm( ++ asm volatile( + // 4 pixel loop. + LABELALIGN + "1: \n" +@@ -7429,7 +7588,7 @@ void ARGBUnattenuateRow_AVX2(const uint8 + uint8_t* dst_argb, + int width) { + uintptr_t alpha; +- asm volatile ( ++ asm volatile( + "sub %0,%1 \n" + "vbroadcastf128 %5,%%ymm5 \n" + +@@ -7491,7 +7650,7 @@ void ARGBUnattenuateRow_AVX2(const uint8 + #ifdef HAS_ARGBGRAYROW_SSSE3 + // Convert 8 ARGB pixels (64 bytes) to 8 Gray ARGB pixels + void ARGBGrayRow_SSSE3(const uint8_t* src_argb, uint8_t* dst_argb, int width) { +- asm volatile ( ++ asm volatile( + "movdqa %3,%%xmm4 \n" + "movdqa %4,%%xmm5 \n" + +@@ -7553,7 +7712,7 @@ static const vec8 kARGBToSepiaR = {24, 9 + + // Convert 8 ARGB pixels (32 bytes) to 8 Sepia ARGB pixels. + void ARGBSepiaRow_SSSE3(uint8_t* dst_argb, int width) { +- asm volatile ( ++ asm volatile( + "movdqa %2,%%xmm2 \n" + "movdqa %3,%%xmm3 \n" + "movdqa %4,%%xmm4 \n" +@@ -7614,7 +7773,7 @@ void ARGBColorMatrixRow_SSSE3(const uint + uint8_t* dst_argb, + const int8_t* matrix_argb, + int width) { +- asm volatile ( ++ asm volatile( + "movdqu (%3),%%xmm5 \n" + "pshufd $0x00,%%xmm5,%%xmm2 \n" + "pshufd $0x55,%%xmm5,%%xmm3 \n" +@@ -7679,7 +7838,7 @@ void ARGBQuantizeRow_SSE2(uint8_t* dst_a + int interval_size, + int interval_offset, + int width) { +- asm volatile ( ++ asm volatile( + "movd %2,%%xmm2 \n" + "movd %3,%%xmm3 \n" + "movd %4,%%xmm4 \n" +@@ -7730,7 +7889,7 @@ void ARGBShadeRow_SSE2(const uint8_t* sr + uint8_t* dst_argb, + int width, + uint32_t value) { +- asm volatile ( ++ asm volatile( + "movd %3,%%xmm2 \n" + "punpcklbw %%xmm2,%%xmm2 \n" + "punpcklqdq %%xmm2,%%xmm2 \n" +@@ -7766,7 +7925,8 @@ void ARGBMultiplyRow_SSE2(const uint8_t* + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( ++ + "pxor %%xmm5,%%xmm5 \n" + + // 4 pixel loop. +@@ -7804,7 +7964,8 @@ void ARGBMultiplyRow_AVX2(const uint8_t* + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( ++ + "vpxor %%ymm5,%%ymm5,%%ymm5 \n" + + // 4 pixel loop. +@@ -7841,7 +8002,7 @@ void ARGBAddRow_SSE2(const uint8_t* src_ + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width) { +- asm( ++ asm volatile( + // 4 pixel loop. + LABELALIGN + "1: \n" +@@ -7869,7 +8030,7 @@ void ARGBAddRow_AVX2(const uint8_t* src_ + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width) { +- asm( ++ asm volatile( + // 4 pixel loop. + LABELALIGN + "1: \n" +@@ -7897,7 +8058,7 @@ void ARGBSubtractRow_SSE2(const uint8_t* + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width) { +- asm( ++ asm volatile( + // 4 pixel loop. + LABELALIGN + "1: \n" +@@ -7925,7 +8086,7 @@ void ARGBSubtractRow_AVX2(const uint8_t* + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width) { +- asm( ++ asm volatile( + // 4 pixel loop. + LABELALIGN + "1: \n" +@@ -7957,7 +8118,7 @@ void SobelXRow_SSE2(const uint8_t* src_y + const uint8_t* src_y2, + uint8_t* dst_sobelx, + int width) { +- asm volatile ( ++ asm volatile( + "sub %0,%1 \n" + "sub %0,%2 \n" + "sub %0,%3 \n" +@@ -8011,7 +8172,7 @@ void SobelYRow_SSE2(const uint8_t* src_y + const uint8_t* src_y1, + uint8_t* dst_sobely, + int width) { +- asm volatile ( ++ asm volatile( + "sub %0,%1 \n" + "sub %0,%2 \n" + "pxor %%xmm5,%%xmm5 \n" +@@ -8064,7 +8225,7 @@ void SobelRow_SSE2(const uint8_t* src_so + const uint8_t* src_sobely, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "sub %0,%1 \n" + "pcmpeqb %%xmm5,%%xmm5 \n" + "pslld $0x18,%%xmm5 \n" +@@ -8111,7 +8272,7 @@ void SobelToPlaneRow_SSE2(const uint8_t* + const uint8_t* src_sobely, + uint8_t* dst_y, + int width) { +- asm volatile ( ++ asm volatile( + "sub %0,%1 \n" + "pcmpeqb %%xmm5,%%xmm5 \n" + "pslld $0x18,%%xmm5 \n" +@@ -8146,7 +8307,7 @@ void SobelXYRow_SSE2(const uint8_t* src_ + const uint8_t* src_sobely, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "sub %0,%1 \n" + "pcmpeqb %%xmm5,%%xmm5 \n" + +@@ -8194,7 +8355,7 @@ void ComputeCumulativeSumRow_SSE2(const + int32_t* cumsum, + const int32_t* previous_cumsum, + int width) { +- asm volatile ( ++ asm volatile( + "pxor %%xmm0,%%xmm0 \n" + "pxor %%xmm1,%%xmm1 \n" + "sub $0x4,%3 \n" +@@ -8274,7 +8435,7 @@ void CumulativeSumToAverageRow_SSE2(cons + int area, + uint8_t* dst, + int count) { +- asm volatile ( ++ asm volatile( + "movd %5,%%xmm5 \n" + "cvtdq2ps %%xmm5,%%xmm5 \n" + "rcpss %%xmm5,%%xmm4 \n" +@@ -8409,7 +8570,7 @@ void ARGBAffineRow_SSE2(const uint8_t* s + int width) { + intptr_t src_argb_stride_temp = src_argb_stride; + intptr_t temp; +- asm volatile ( ++ asm volatile( + "movq (%3),%%xmm2 \n" + "movq 0x08(%3),%%xmm7 \n" + "shl $0x10,%1 \n" +@@ -8494,7 +8655,7 @@ void InterpolateRow_SSSE3(uint8_t* dst_p + ptrdiff_t src_stride, + int width, + int source_y_fraction) { +- asm volatile ( ++ asm volatile( + "sub %1,%0 \n" + "cmp $0x0,%3 \n" + "je 100f \n" +@@ -8575,7 +8736,7 @@ void InterpolateRow_AVX2(uint8_t* dst_pt + ptrdiff_t src_stride, + int width, + int source_y_fraction) { +- asm volatile ( ++ asm volatile( + "sub %1,%0 \n" + "cmp $0x0,%3 \n" + "je 100f \n" +@@ -8652,7 +8813,8 @@ void ARGBShuffleRow_SSSE3(const uint8_t* + uint8_t* dst_argb, + const uint8_t* shuffler, + int width) { +- asm volatile ( ++ asm volatile( ++ + "movdqu (%3),%%xmm5 \n" + + LABELALIGN +@@ -8681,7 +8843,8 @@ void ARGBShuffleRow_AVX2(const uint8_t* + uint8_t* dst_argb, + const uint8_t* shuffler, + int width) { +- asm volatile ( ++ asm volatile( ++ + "vbroadcastf128 (%3),%%ymm5 \n" + + LABELALIGN +@@ -8711,7 +8874,8 @@ void I422ToYUY2Row_SSE2(const uint8_t* s + const uint8_t* src_v, + uint8_t* dst_yuy2, + int width) { +- asm volatile ( ++ asm volatile( ++ + "sub %1,%2 \n" + + LABELALIGN +@@ -8746,7 +8910,8 @@ void I422ToUYVYRow_SSE2(const uint8_t* s + const uint8_t* src_v, + uint8_t* dst_uyvy, + int width) { +- asm volatile ( ++ asm volatile( ++ + "sub %1,%2 \n" + + LABELALIGN +@@ -8781,7 +8946,8 @@ void I422ToYUY2Row_AVX2(const uint8_t* s + const uint8_t* src_v, + uint8_t* dst_yuy2, + int width) { +- asm volatile ( ++ asm volatile( ++ + "sub %1,%2 \n" + + LABELALIGN +@@ -8819,7 +8985,8 @@ void I422ToUYVYRow_AVX2(const uint8_t* s + const uint8_t* src_v, + uint8_t* dst_uyvy, + int width) { +- asm volatile ( ++ asm volatile( ++ + "sub %1,%2 \n" + + LABELALIGN +@@ -8856,7 +9023,8 @@ void ARGBPolynomialRow_SSE2(const uint8_ + uint8_t* dst_argb, + const float* poly, + int width) { +- asm volatile ( ++ asm volatile( ++ + "pxor %%xmm3,%%xmm3 \n" + + // 2 pixel loop. +@@ -8911,7 +9079,7 @@ void ARGBPolynomialRow_AVX2(const uint8_ + uint8_t* dst_argb, + const float* poly, + int width) { +- asm volatile ( ++ asm volatile( + "vbroadcastf128 (%3),%%ymm4 \n" + "vbroadcastf128 0x10(%3),%%ymm5 \n" + "vbroadcastf128 0x20(%3),%%ymm6 \n" +@@ -8954,7 +9122,7 @@ void HalfFloatRow_SSE2(const uint16_t* s + float scale, + int width) { + scale *= kScaleBias; +- asm volatile ( ++ asm volatile( + "movd %3,%%xmm4 \n" + "pshufd $0x0,%%xmm4,%%xmm4 \n" + "pxor %%xmm5,%%xmm5 \n" +@@ -8992,7 +9160,7 @@ void HalfFloatRow_AVX2(const uint16_t* s + float scale, + int width) { + scale *= kScaleBias; +- asm volatile ( ++ asm volatile( + "vbroadcastss %3, %%ymm4 \n" + "vpxor %%ymm5,%%ymm5,%%ymm5 \n" + "sub %0,%1 \n" +@@ -9033,7 +9201,7 @@ void HalfFloatRow_F16C(const uint16_t* s + uint16_t* dst, + float scale, + int width) { +- asm volatile ( ++ asm volatile( + "vbroadcastss %3, %%ymm4 \n" + "sub %0,%1 \n" + +@@ -9068,7 +9236,7 @@ void HalfFloatRow_F16C(const uint16_t* s + + #ifdef HAS_HALFFLOATROW_F16C + void HalfFloat1Row_F16C(const uint16_t* src, uint16_t* dst, float, int width) { +- asm volatile ( ++ asm volatile( + "sub %0,%1 \n" + // 16 pixel loop. + LABELALIGN +@@ -9099,7 +9267,7 @@ void ARGBColorTableRow_X86(uint8_t* dst_ + const uint8_t* table_argb, + int width) { + uintptr_t pixel_temp; +- asm( ++ asm volatile( + // 1 pixel loop. + LABELALIGN + "1: \n" +@@ -9132,7 +9300,7 @@ void RGBColorTableRow_X86(uint8_t* dst_a + const uint8_t* table_argb, + int width) { + uintptr_t pixel_temp; +- asm( ++ asm volatile( + // 1 pixel loop. + LABELALIGN + "1: \n" +@@ -9165,7 +9333,7 @@ void ARGBLumaColorTableRow_SSSE3(const u + uint32_t lumacoeff) { + uintptr_t pixel_temp; + uintptr_t table_temp; +- asm volatile ( ++ asm volatile( + "movd %6,%%xmm3 \n" + "pshufd $0x0,%%xmm3,%%xmm3 \n" + "pcmpeqb %%xmm4,%%xmm4 \n" +@@ -9269,7 +9437,7 @@ void NV21ToYUV24Row_SSSE3(const uint8_t* + const uint8_t* src_vu, + uint8_t* dst_yuv24, + int width) { +- asm volatile ( ++ asm volatile( + "sub %0,%1 \n" + "movdqa (%4),%%xmm4 \n" // 3 shuffler constants + "movdqa 16(%4),%%xmm5 \n" +@@ -9307,7 +9475,7 @@ void NV21ToYUV24Row_AVX2(const uint8_t* + const uint8_t* src_vu, + uint8_t* dst_yuv24, + int width) { +- asm volatile ( ++ asm volatile( + "sub %0,%1 \n" + "vbroadcastf128 (%4),%%ymm4 \n" // 3 shuffler constants + "vbroadcastf128 16(%4),%%ymm5 \n" +@@ -9355,7 +9523,7 @@ void NV21ToYUV24Row_AVX512(const uint8_t + const uint8_t* src_vu, + uint8_t* dst_yuv24, + int width) { +- asm volatile ( ++ asm volatile( + "sub %0,%1 \n" + "vmovdqa (%4),%%ymm4 \n" // 3 shuffler constants + "vmovdqa 32(%4),%%ymm5 \n" +@@ -9394,7 +9562,8 @@ static const uvec8 kShuffleUVToVU = {1u, + + // Convert UV plane of NV12 to VU of NV21. + void SwapUVRow_SSSE3(const uint8_t* src_uv, uint8_t* dst_vu, int width) { +- asm volatile ( ++ asm volatile( ++ + "movdqu %3,%%xmm5 \n" + + LABELALIGN +@@ -9419,7 +9588,8 @@ void SwapUVRow_SSSE3(const uint8_t* src_ + + #ifdef HAS_SWAPUVROW_AVX2 + void SwapUVRow_AVX2(const uint8_t* src_uv, uint8_t* dst_vu, int width) { +- asm volatile ( ++ asm volatile( ++ + "vbroadcastf128 %3,%%ymm5 \n" + + LABELALIGN +@@ -9449,7 +9619,7 @@ void HalfMergeUVRow_SSSE3(const uint8_t* + int src_stride_v, + uint8_t* dst_uv, + int width) { +- asm volatile ( ++ asm volatile( + "pcmpeqb %%xmm4,%%xmm4 \n" + "psrlw $0xf,%%xmm4 \n" + "packuswb %%xmm4,%%xmm4 \n" +@@ -9495,7 +9665,7 @@ void HalfMergeUVRow_AVX2(const uint8_t* + int src_stride_v, + uint8_t* dst_uv, + int width) { +- asm volatile ( ++ asm volatile( + "vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" + "vpsrlw $0xf,%%ymm4,%%ymm4 \n" + "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" +@@ -9537,7 +9707,7 @@ void HalfMergeUVRow_AVX2(const uint8_t* + } + + void ClampFloatToZero_SSE2(const float* src_x, float* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "pxor %%xmm1,%%xmm1 \n" + + LABELALIGN +diff --git a/media/libyuv/libyuv/source/row_lasx.cc b/media/libyuv/libyuv/source/row_lasx.cc +--- a/media/libyuv/libyuv/source/row_lasx.cc ++++ b/media/libyuv/libyuv/source/row_lasx.cc +@@ -543,8 +543,8 @@ void I422ToARGB4444Row_LASX(const uint8_ + __m256i vec_yb, vec_yg, vec_ub, vec_vr, vec_ug, vec_vg; + __m256i vec_ubvr, vec_ugvg; + __m256i const_0x80 = __lasx_xvldi(0x80); +- __m256i alpha = (__m256i)v4u64{0xF000F000F000F000, 0xF000F000F000F000, +- 0xF000F000F000F000, 0xF000F000F000F000}; ++ __m256i alpha = {0xF000F000F000F000, 0xF000F000F000F000, 0xF000F000F000F000, ++ 0xF000F000F000F000}; + __m256i mask = {0x00F000F000F000F0, 0x00F000F000F000F0, 0x00F000F000F000F0, + 0x00F000F000F000F0}; + +@@ -595,8 +595,8 @@ void I422ToARGB1555Row_LASX(const uint8_ + __m256i vec_yb, vec_yg, vec_ub, vec_vr, vec_ug, vec_vg; + __m256i vec_ubvr, vec_ugvg; + __m256i const_0x80 = __lasx_xvldi(0x80); +- __m256i alpha = (__m256i)v4u64{0x8000800080008000, 0x8000800080008000, +- 0x8000800080008000, 0x8000800080008000}; ++ __m256i alpha = {0x8000800080008000, 0x8000800080008000, 0x8000800080008000, ++ 0x8000800080008000}; + + YUVTORGB_SETUP(yuvconstants, vec_ub, vec_vr, vec_ug, vec_vg, vec_yg, vec_yb); + vec_ubvr = __lasx_xvilvl_h(vec_ub, vec_vr); +@@ -799,8 +799,8 @@ void ARGBToUVRow_LASX(const uint8_t* src + 0x0009000900090009, 0x0009000900090009}; + __m256i control = {0x0000000400000000, 0x0000000500000001, 0x0000000600000002, + 0x0000000700000003}; +- __m256i const_0x8080 = (__m256i)v4u64{0x8080808080808080, 0x8080808080808080, +- 0x8080808080808080, 0x8080808080808080}; ++ __m256i const_0x8080 = {0x8080808080808080, 0x8080808080808080, ++ 0x8080808080808080, 0x8080808080808080}; + + for (x = 0; x < len; x++) { + DUP4_ARG2(__lasx_xvld, src_argb0, 0, src_argb0, 32, src_argb0, 64, +@@ -1037,8 +1037,8 @@ void ARGBToUV444Row_LASX(const uint8_t* + __m256i const_38 = __lasx_xvldi(38); + __m256i const_94 = __lasx_xvldi(94); + __m256i const_18 = __lasx_xvldi(18); +- __m256i const_0x8080 = (__m256i)v4u64{0x8080808080808080, 0x8080808080808080, +- 0x8080808080808080, 0x8080808080808080}; ++ __m256i const_0x8080 = {0x8080808080808080, 0x8080808080808080, ++ 0x8080808080808080, 0x8080808080808080}; + __m256i control = {0x0000000400000000, 0x0000000500000001, 0x0000000600000002, + 0x0000000700000003}; + for (x = 0; x < len; x++) { +@@ -1182,7 +1182,7 @@ void ARGBAttenuateRow_LASX(const uint8_t + + void ARGBToRGB565DitherRow_LASX(const uint8_t* src_argb, + uint8_t* dst_rgb, +- uint32_t dither4, ++ const uint32_t dither4, + int width) { + int x; + int len = width / 16; +@@ -1609,8 +1609,8 @@ void ARGB1555ToUVRow_LASX(const uint8_t* + __m256i const_38 = __lasx_xvldi(0x413); + __m256i const_94 = __lasx_xvldi(0x42F); + __m256i const_18 = __lasx_xvldi(0x409); +- __m256i const_8080 = (__m256i)v4u64{0x8080808080808080, 0x8080808080808080, +- 0x8080808080808080, 0x8080808080808080}; ++ __m256i const_8080 = {0x8080808080808080, 0x8080808080808080, ++ 0x8080808080808080, 0x8080808080808080}; + + for (x = 0; x < len; x++) { + DUP4_ARG2(__lasx_xvld, src_argb1555, 0, src_argb1555, 32, next_argb1555, 0, +@@ -1726,8 +1726,8 @@ void RGB565ToUVRow_LASX(const uint8_t* s + __m256i const_38 = __lasx_xvldi(0x413); + __m256i const_94 = __lasx_xvldi(0x42F); + __m256i const_18 = __lasx_xvldi(0x409); +- __m256i const_8080 = (__m256i)v4u64{0x8080808080808080, 0x8080808080808080, +- 0x8080808080808080, 0x8080808080808080}; ++ __m256i const_8080 = {0x8080808080808080, 0x8080808080808080, ++ 0x8080808080808080, 0x8080808080808080}; + + for (x = 0; x < len; x++) { + DUP4_ARG2(__lasx_xvld, src_rgb565, 0, src_rgb565, 32, next_rgb565, 0, +@@ -1793,8 +1793,8 @@ void RGB24ToUVRow_LASX(const uint8_t* sr + __m256i const_38 = __lasx_xvldi(0x413); + __m256i const_94 = __lasx_xvldi(0x42F); + __m256i const_18 = __lasx_xvldi(0x409); +- __m256i const_8080 = (__m256i)v4u64{0x8080808080808080, 0x8080808080808080, +- 0x8080808080808080, 0x8080808080808080}; ++ __m256i const_8080 = {0x8080808080808080, 0x8080808080808080, ++ 0x8080808080808080, 0x8080808080808080}; + __m256i shuff0_b = {0x15120F0C09060300, 0x00000000001E1B18, + 0x15120F0C09060300, 0x00000000001E1B18}; + __m256i shuff1_b = {0x0706050403020100, 0x1D1A1714110A0908, +@@ -1856,8 +1856,8 @@ void RAWToUVRow_LASX(const uint8_t* src_ + __m256i const_38 = __lasx_xvldi(0x413); + __m256i const_94 = __lasx_xvldi(0x42F); + __m256i const_18 = __lasx_xvldi(0x409); +- __m256i const_8080 = (__m256i)v4u64{0x8080808080808080, 0x8080808080808080, +- 0x8080808080808080, 0x8080808080808080}; ++ __m256i const_8080 = {0x8080808080808080, 0x8080808080808080, ++ 0x8080808080808080, 0x8080808080808080}; + __m256i shuff0_r = {0x15120F0C09060300, 0x00000000001E1B18, + 0x15120F0C09060300, 0x00000000001E1B18}; + __m256i shuff1_r = {0x0706050403020100, 0x1D1A1714110A0908, +@@ -2037,7 +2037,7 @@ static void ARGBToYMatrixRow_LASX(const + int width, + const struct RgbConstants* rgbconstants) { + int32_t shuff[8] = {0, 4, 1, 5, 2, 6, 3, 7}; +- asm volatile ( ++ asm volatile( + "xvldrepl.b $xr0, %3, 0 \n\t" // load rgbconstants + "xvldrepl.b $xr1, %3, 1 \n\t" // load rgbconstants + "xvldrepl.b $xr2, %3, 2 \n\t" // load rgbconstants +@@ -2099,7 +2099,7 @@ static void RGBAToYMatrixRow_LASX(const + int width, + const struct RgbConstants* rgbconstants) { + int32_t shuff[8] = {0, 4, 1, 5, 2, 6, 3, 7}; +- asm volatile ( ++ asm volatile( + "xvldrepl.b $xr0, %3, 0 \n\t" // load rgbconstants + "xvldrepl.b $xr1, %3, 1 \n\t" // load rgbconstants + "xvldrepl.b $xr2, %3, 2 \n\t" // load rgbconstants +@@ -2163,7 +2163,7 @@ static void RGBToYMatrixRow_LASX(const u + 1, 0, 4, 0, 7, 0, 10, 0, 13, 0, 16, 0, 19, 0, 22, 0, + 25, 0, 28, 0, 31, 0, 2, 0, 5, 0, 8, 0, 11, 0, 14, 0, + 25, 0, 28, 0, 31, 0, 2, 0, 5, 0, 8, 0, 11, 0, 14, 0}; +- asm volatile ( ++ asm volatile( + "xvldrepl.b $xr0, %3, 0 \n\t" // load rgbconstants + "xvldrepl.b $xr1, %3, 1 \n\t" // load rgbconstants + "xvldrepl.b $xr2, %3, 2 \n\t" // load rgbconstants +@@ -2242,8 +2242,8 @@ void ARGBToUVJRow_LASX(const uint8_t* sr + __m256i const_21 = __lasx_xvldi(0x415); + __m256i const_53 = __lasx_xvldi(0x435); + __m256i const_10 = __lasx_xvldi(0x40A); +- __m256i const_8080 = (__m256i)v4u64{0x8080808080808080, 0x8080808080808080, +- 0x8080808080808080, 0x8080808080808080}; ++ __m256i const_8080 = {0x8080808080808080, 0x8080808080808080, ++ 0x8080808080808080, 0x8080808080808080}; + __m256i shuff = {0x1614060412100200, 0x1E1C0E0C1A180A08, 0x1715070513110301, + 0x1F1D0F0D1B190B09}; + +diff --git a/media/libyuv/libyuv/source/row_lsx.cc b/media/libyuv/libyuv/source/row_lsx.cc +--- a/media/libyuv/libyuv/source/row_lsx.cc ++++ b/media/libyuv/libyuv/source/row_lsx.cc +@@ -31,91 +31,6 @@ extern "C" { + yb = __lsx_vreplgr2vr_w(yuvconst->kYBiasToRgb[0]); \ + } + +-// Load 32 YUV422 pixel data +-#define READYUV422_D(psrc_y, psrc_u, psrc_v, out_y, uv_l, uv_h) \ +- { \ +- __m128i temp0, temp1; \ +- \ +- DUP2_ARG2(__lsx_vld, psrc_y, 0, psrc_u, 0, out_y, temp0); \ +- temp1 = __lsx_vld(psrc_v, 0); \ +- temp0 = __lsx_vsub_b(temp0, const_80); \ +- temp1 = __lsx_vsub_b(temp1, const_80); \ +- temp0 = __lsx_vsllwil_h_b(temp0, 0); \ +- temp1 = __lsx_vsllwil_h_b(temp1, 0); \ +- uv_l = __lsx_vilvl_h(temp0, temp1); \ +- uv_h = __lsx_vilvh_h(temp0, temp1); \ +- } +- +-// Load 16 YUV422 pixel data +-#define READYUV422(psrc_y, psrc_u, psrc_v, out_y, uv) \ +- { \ +- __m128i temp0, temp1; \ +- \ +- out_y = __lsx_vld(psrc_y, 0); \ +- temp0 = __lsx_vldrepl_d(psrc_u, 0); \ +- temp1 = __lsx_vldrepl_d(psrc_v, 0); \ +- uv = __lsx_vilvl_b(temp0, temp1); \ +- uv = __lsx_vsub_b(uv, const_80); \ +- uv = __lsx_vsllwil_h_b(uv, 0); \ +- } +- +-// Convert 16 pixels of YUV420 to RGB. +-#define YUVTORGB_D(in_y, in_uvl, in_uvh, ubvr, ugvg, yg, yb, b_l, b_h, g_l, \ +- g_h, r_l, r_h) \ +- { \ +- __m128i u_l, u_h, v_l, v_h; \ +- __m128i yl_ev, yl_od, yh_ev, yh_od; \ +- __m128i temp0, temp1, temp2, temp3; \ +- \ +- temp0 = __lsx_vilvl_b(in_y, in_y); \ +- temp1 = __lsx_vilvh_b(in_y, in_y); \ +- yl_ev = __lsx_vmulwev_w_hu_h(temp0, yg); \ +- yl_od = __lsx_vmulwod_w_hu_h(temp0, yg); \ +- yh_ev = __lsx_vmulwev_w_hu_h(temp1, yg); \ +- yh_od = __lsx_vmulwod_w_hu_h(temp1, yg); \ +- DUP4_ARG2(__lsx_vsrai_w, yl_ev, 16, yl_od, 16, yh_ev, 16, yh_od, 16, \ +- yl_ev, yl_od, yh_ev, yh_od); \ +- yl_ev = __lsx_vadd_w(yl_ev, yb); \ +- yl_od = __lsx_vadd_w(yl_od, yb); \ +- yh_ev = __lsx_vadd_w(yh_ev, yb); \ +- yh_od = __lsx_vadd_w(yh_od, yb); \ +- v_l = __lsx_vmulwev_w_h(in_uvl, ubvr); \ +- u_l = __lsx_vmulwod_w_h(in_uvl, ubvr); \ +- v_h = __lsx_vmulwev_w_h(in_uvh, ubvr); \ +- u_h = __lsx_vmulwod_w_h(in_uvh, ubvr); \ +- temp0 = __lsx_vadd_w(yl_ev, u_l); \ +- temp1 = __lsx_vadd_w(yl_od, u_l); \ +- temp2 = __lsx_vadd_w(yh_ev, u_h); \ +- temp3 = __lsx_vadd_w(yh_od, u_h); \ +- DUP4_ARG2(__lsx_vsrai_w, temp0, 6, temp1, 6, temp2, 6, temp3, 6, temp0, \ +- temp1, temp2, temp3); \ +- DUP4_ARG1(__lsx_vclip255_w, temp0, temp1, temp2, temp3, temp0, temp1, \ +- temp2, temp3); \ +- b_l = __lsx_vpackev_h(temp1, temp0); \ +- b_h = __lsx_vpackev_h(temp3, temp2); \ +- temp0 = __lsx_vadd_w(yl_ev, v_l); \ +- temp1 = __lsx_vadd_w(yl_od, v_l); \ +- temp2 = __lsx_vadd_w(yh_ev, v_h); \ +- temp3 = __lsx_vadd_w(yh_od, v_h); \ +- DUP4_ARG2(__lsx_vsrai_w, temp0, 6, temp1, 6, temp2, 6, temp3, 6, temp0, \ +- temp1, temp2, temp3); \ +- DUP4_ARG1(__lsx_vclip255_w, temp0, temp1, temp2, temp3, temp0, temp1, \ +- temp2, temp3); \ +- r_l = __lsx_vpackev_h(temp1, temp0); \ +- r_h = __lsx_vpackev_h(temp3, temp2); \ +- DUP2_ARG2(__lsx_vdp2_w_h, in_uvl, ugvg, in_uvh, ugvg, u_l, u_h); \ +- temp0 = __lsx_vsub_w(yl_ev, u_l); \ +- temp1 = __lsx_vsub_w(yl_od, u_l); \ +- temp2 = __lsx_vsub_w(yh_ev, u_h); \ +- temp3 = __lsx_vsub_w(yh_od, u_h); \ +- DUP4_ARG2(__lsx_vsrai_w, temp0, 6, temp1, 6, temp2, 6, temp3, 6, temp0, \ +- temp1, temp2, temp3); \ +- DUP4_ARG1(__lsx_vclip255_w, temp0, temp1, temp2, temp3, temp0, temp1, \ +- temp2, temp3); \ +- g_l = __lsx_vpackev_h(temp1, temp0); \ +- g_h = __lsx_vpackev_h(temp3, temp2); \ +- } +- + // Convert 8 pixels of YUV420 to RGB. + #define YUVTORGB(in_y, in_vu, vrub, vgug, yg, yb, out_b, out_g, out_r) \ + { \ +@@ -203,25 +118,6 @@ extern "C" { + out_g = __lsx_vpackev_h(tmp1, tmp0); \ + } + +-// Pack and Store 16 ARGB values. +-#define STOREARGB_D(a_l, a_h, r_l, r_h, g_l, g_h, b_l, b_h, pdst_argb) \ +- { \ +- __m128i temp0, temp1, temp2, temp3; \ +- temp0 = __lsx_vpackev_b(g_l, b_l); \ +- temp1 = __lsx_vpackev_b(a_l, r_l); \ +- temp2 = __lsx_vpackev_b(g_h, b_h); \ +- temp3 = __lsx_vpackev_b(a_h, r_h); \ +- r_l = __lsx_vilvl_h(temp1, temp0); \ +- r_h = __lsx_vilvh_h(temp1, temp0); \ +- g_l = __lsx_vilvl_h(temp3, temp2); \ +- g_h = __lsx_vilvh_h(temp3, temp2); \ +- __lsx_vst(r_l, pdst_argb, 0); \ +- __lsx_vst(r_h, pdst_argb, 16); \ +- __lsx_vst(g_l, pdst_argb, 32); \ +- __lsx_vst(g_h, pdst_argb, 48); \ +- pdst_argb += 64; \ +- } +- + // Pack and Store 8 ARGB values. + #define STOREARGB(in_a, in_r, in_g, in_b, pdst_argb) \ + { \ +@@ -259,1028 +155,6 @@ extern "C" { + _dst0 = __lsx_vpickod_b(_reg1, _reg0); \ + } + +-void MirrorRow_LSX(const uint8_t* src, uint8_t* dst, int width) { +- int x; +- int len = width / 32; +- __m128i src0, src1; +- __m128i shuffler = {0x08090A0B0C0D0E0F, 0x0001020304050607}; +- src += width - 32; +- for (x = 0; x < len; x++) { +- DUP2_ARG2(__lsx_vld, src, 0, src, 16, src0, src1); +- DUP2_ARG3(__lsx_vshuf_b, src0, src0, shuffler, src1, src1, shuffler, src0, +- src1); +- __lsx_vst(src1, dst, 0); +- __lsx_vst(src0, dst, 16); +- dst += 32; +- src -= 32; +- } +-} +- +-void MirrorUVRow_LSX(const uint8_t* src_uv, uint8_t* dst_uv, int width) { +- int x; +- int len = width / 8; +- __m128i src, dst; +- __m128i shuffler = {0x0004000500060007, 0x0000000100020003}; +- +- src_uv += (width - 8) << 1; +- for (x = 0; x < len; x++) { +- src = __lsx_vld(src_uv, 0); +- dst = __lsx_vshuf_h(shuffler, src, src); +- __lsx_vst(dst, dst_uv, 0); +- src_uv -= 16; +- dst_uv += 16; +- } +-} +- +-void ARGBMirrorRow_LSX(const uint8_t* src, uint8_t* dst, int width) { +- int x; +- int len = width / 8; +- __m128i src0, src1; +- __m128i shuffler = {0x0B0A09080F0E0D0C, 0x0302010007060504}; +- +- src += (width * 4) - 32; +- for (x = 0; x < len; x++) { +- DUP2_ARG2(__lsx_vld, src, 0, src, 16, src0, src1); +- DUP2_ARG3(__lsx_vshuf_b, src0, src0, shuffler, src1, src1, shuffler, src0, +- src1); +- __lsx_vst(src1, dst, 0); +- __lsx_vst(src0, dst, 16); +- dst += 32; +- src -= 32; +- } +-} +- +-void I422ToYUY2Row_LSX(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_yuy2, +- int width) { +- int x; +- int len = width / 16; +- __m128i src_u0, src_v0, src_y0, vec_uv0; +- __m128i vec_yuy2_0, vec_yuy2_1; +- +- for (x = 0; x < len; x++) { +- DUP2_ARG2(__lsx_vld, src_u, 0, src_v, 0, src_u0, src_v0); +- src_y0 = __lsx_vld(src_y, 0); +- vec_uv0 = __lsx_vilvl_b(src_v0, src_u0); +- vec_yuy2_0 = __lsx_vilvl_b(vec_uv0, src_y0); +- vec_yuy2_1 = __lsx_vilvh_b(vec_uv0, src_y0); +- __lsx_vst(vec_yuy2_0, dst_yuy2, 0); +- __lsx_vst(vec_yuy2_1, dst_yuy2, 16); +- src_u += 8; +- src_v += 8; +- src_y += 16; +- dst_yuy2 += 32; +- } +-} +- +-void I422ToUYVYRow_LSX(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_uyvy, +- int width) { +- int x; +- int len = width / 16; +- __m128i src_u0, src_v0, src_y0, vec_uv0; +- __m128i vec_uyvy0, vec_uyvy1; +- +- for (x = 0; x < len; x++) { +- DUP2_ARG2(__lsx_vld, src_u, 0, src_v, 0, src_u0, src_v0); +- src_y0 = __lsx_vld(src_y, 0); +- vec_uv0 = __lsx_vilvl_b(src_v0, src_u0); +- vec_uyvy0 = __lsx_vilvl_b(src_y0, vec_uv0); +- vec_uyvy1 = __lsx_vilvh_b(src_y0, vec_uv0); +- __lsx_vst(vec_uyvy0, dst_uyvy, 0); +- __lsx_vst(vec_uyvy1, dst_uyvy, 16); +- src_u += 8; +- src_v += 8; +- src_y += 16; +- dst_uyvy += 32; +- } +-} +- +-void I422ToARGBRow_LSX(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width) { +- int x; +- int len = width / 16; +- __m128i vec_yb, vec_yg, vec_ub, vec_ug, vec_vr, vec_vg; +- __m128i vec_ubvr, vec_ugvg; +- __m128i alpha = __lsx_vldi(0xFF); +- __m128i const_80 = __lsx_vldi(0x80); +- +- YUVTORGB_SETUP(yuvconstants, vec_vr, vec_ub, vec_vg, vec_ug, vec_yg, vec_yb); +- vec_ubvr = __lsx_vilvl_h(vec_ub, vec_vr); +- vec_ugvg = __lsx_vilvl_h(vec_ug, vec_vg); +- +- for (x = 0; x < len; x++) { +- __m128i y, uv_l, uv_h, b_l, b_h, g_l, g_h, r_l, r_h; +- +- READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h); +- YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l, +- g_h, r_l, r_h); +- STOREARGB_D(alpha, alpha, r_l, r_h, g_l, g_h, b_l, b_h, dst_argb); +- src_y += 16; +- src_u += 8; +- src_v += 8; +- } +-} +- +-void I422ToRGBARow_LSX(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width) { +- int x; +- int len = width / 16; +- __m128i vec_yb, vec_yg, vec_ub, vec_vr, vec_ug, vec_vg; +- __m128i vec_ubvr, vec_ugvg; +- __m128i alpha = __lsx_vldi(0xFF); +- __m128i const_80 = __lsx_vldi(0x80); +- +- YUVTORGB_SETUP(yuvconstants, vec_vr, vec_ub, vec_vg, vec_ug, vec_yg, vec_yb); +- vec_ubvr = __lsx_vilvl_h(vec_ub, vec_vr); +- vec_ugvg = __lsx_vilvl_h(vec_ug, vec_vg); +- +- for (x = 0; x < len; x++) { +- __m128i y, uv_l, uv_h, b_l, b_h, g_l, g_h, r_l, r_h; +- +- READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h); +- YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l, +- g_h, r_l, r_h); +- STOREARGB_D(r_l, r_h, g_l, g_h, b_l, b_h, alpha, alpha, dst_argb); +- src_y += 16; +- src_u += 8; +- src_v += 8; +- } +-} +- +-void I422AlphaToARGBRow_LSX(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- const uint8_t* src_a, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width) { +- int x; +- int len = width / 16; +- int res = width & 15; +- __m128i vec_yb, vec_yg, vec_ub, vec_vr, vec_ug, vec_vg; +- __m128i vec_ubvr, vec_ugvg; +- __m128i zero = __lsx_vldi(0); +- __m128i const_80 = __lsx_vldi(0x80); +- +- YUVTORGB_SETUP(yuvconstants, vec_vr, vec_ub, vec_vg, vec_ug, vec_yg, vec_yb); +- vec_ubvr = __lsx_vilvl_h(vec_ub, vec_vr); +- vec_ugvg = __lsx_vilvl_h(vec_ug, vec_vg); +- +- for (x = 0; x < len; x++) { +- __m128i y, uv_l, uv_h, b_l, b_h, g_l, g_h, r_l, r_h, a_l, a_h; +- +- y = __lsx_vld(src_a, 0); +- a_l = __lsx_vilvl_b(zero, y); +- a_h = __lsx_vilvh_b(zero, y); +- READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h); +- YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l, +- g_h, r_l, r_h); +- STOREARGB_D(a_l, a_h, r_l, r_h, g_l, g_h, b_l, b_h, dst_argb); +- src_y += 16; +- src_u += 8; +- src_v += 8; +- src_a += 16; +- } +- if (res) { +- __m128i y, uv, r, g, b, a; +- a = __lsx_vld(src_a, 0); +- a = __lsx_vsllwil_hu_bu(a, 0); +- READYUV422(src_y, src_u, src_v, y, uv); +- YUVTORGB(y, uv, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b, g, r); +- STOREARGB(a, r, g, b, dst_argb); +- } +-} +- +-void I422ToRGB24Row_LSX(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int32_t width) { +- int x; +- int len = width / 16; +- __m128i vec_yb, vec_yg, vec_ub, vec_vr, vec_ug, vec_vg; +- __m128i vec_ubvr, vec_ugvg; +- __m128i const_80 = __lsx_vldi(0x80); +- __m128i shuffler0 = {0x0504120302100100, 0x0A18090816070614}; +- __m128i shuffler1 = {0x1E0F0E1C0D0C1A0B, 0x1E0F0E1C0D0C1A0B}; +- +- YUVTORGB_SETUP(yuvconstants, vec_vr, vec_ub, vec_vg, vec_ug, vec_yg, vec_yb); +- vec_ubvr = __lsx_vilvl_h(vec_ub, vec_vr); +- vec_ugvg = __lsx_vilvl_h(vec_ug, vec_vg); +- +- for (x = 0; x < len; x++) { +- __m128i y, uv_l, uv_h, b_l, b_h, g_l, g_h, r_l, r_h; +- __m128i temp0, temp1, temp2, temp3; +- +- READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h); +- YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l, +- g_h, r_l, r_h); +- temp0 = __lsx_vpackev_b(g_l, b_l); +- temp1 = __lsx_vpackev_b(g_h, b_h); +- DUP4_ARG3(__lsx_vshuf_b, r_l, temp0, shuffler1, r_h, temp1, shuffler1, r_l, +- temp0, shuffler0, r_h, temp1, shuffler0, temp2, temp3, temp0, +- temp1); +- +- b_l = __lsx_vilvl_d(temp1, temp2); +- b_h = __lsx_vilvh_d(temp3, temp1); +- __lsx_vst(temp0, dst_argb, 0); +- __lsx_vst(b_l, dst_argb, 16); +- __lsx_vst(b_h, dst_argb, 32); +- dst_argb += 48; +- src_y += 16; +- src_u += 8; +- src_v += 8; +- } +-} +- +-// TODO(fbarchard): Consider AND instead of shift to isolate 5 upper bits of R. +-void I422ToRGB565Row_LSX(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_rgb565, +- const struct YuvConstants* yuvconstants, +- int width) { +- int x; +- int len = width / 16; +- __m128i vec_yb, vec_yg, vec_ub, vec_vr, vec_ug, vec_vg; +- __m128i vec_ubvr, vec_ugvg; +- __m128i const_80 = __lsx_vldi(0x80); +- +- YUVTORGB_SETUP(yuvconstants, vec_vr, vec_ub, vec_vg, vec_ug, vec_yg, vec_yb); +- vec_ubvr = __lsx_vilvl_h(vec_ub, vec_vr); +- vec_ugvg = __lsx_vilvl_h(vec_ug, vec_vg); +- +- for (x = 0; x < len; x++) { +- __m128i y, uv_l, uv_h, b_l, b_h, g_l, g_h, r_l, r_h; +- +- READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h); +- YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l, +- g_h, r_l, r_h); +- b_l = __lsx_vsrli_h(b_l, 3); +- b_h = __lsx_vsrli_h(b_h, 3); +- g_l = __lsx_vsrli_h(g_l, 2); +- g_h = __lsx_vsrli_h(g_h, 2); +- r_l = __lsx_vsrli_h(r_l, 3); +- r_h = __lsx_vsrli_h(r_h, 3); +- r_l = __lsx_vslli_h(r_l, 11); +- r_h = __lsx_vslli_h(r_h, 11); +- g_l = __lsx_vslli_h(g_l, 5); +- g_h = __lsx_vslli_h(g_h, 5); +- r_l = __lsx_vor_v(r_l, g_l); +- r_l = __lsx_vor_v(r_l, b_l); +- r_h = __lsx_vor_v(r_h, g_h); +- r_h = __lsx_vor_v(r_h, b_h); +- __lsx_vst(r_l, dst_rgb565, 0); +- __lsx_vst(r_h, dst_rgb565, 16); +- dst_rgb565 += 32; +- src_y += 16; +- src_u += 8; +- src_v += 8; +- } +-} +- +-// TODO(fbarchard): Consider AND instead of shift to isolate 4 upper bits of G. +-void I422ToARGB4444Row_LSX(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_argb4444, +- const struct YuvConstants* yuvconstants, +- int width) { +- int x; +- int len = width / 16; +- __m128i vec_yb, vec_yg, vec_ub, vec_vr, vec_ug, vec_vg; +- __m128i vec_ubvr, vec_ugvg; +- __m128i const_80 = __lsx_vldi(0x80); +- __m128i alpha = (__m128i)v2u64{0xF000F000F000F000, 0xF000F000F000F000}; +- __m128i mask = {0x00F000F000F000F0, 0x00F000F000F000F0}; +- +- YUVTORGB_SETUP(yuvconstants, vec_vr, vec_ub, vec_vg, vec_ug, vec_yg, vec_yb); +- vec_ubvr = __lsx_vilvl_h(vec_ub, vec_vr); +- vec_ugvg = __lsx_vilvl_h(vec_ug, vec_vg); +- +- for (x = 0; x < len; x++) { +- __m128i y, uv_l, uv_h, b_l, b_h, g_l, g_h, r_l, r_h; +- +- READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h); +- YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l, +- g_h, r_l, r_h); +- b_l = __lsx_vsrli_h(b_l, 4); +- b_h = __lsx_vsrli_h(b_h, 4); +- r_l = __lsx_vsrli_h(r_l, 4); +- r_h = __lsx_vsrli_h(r_h, 4); +- g_l = __lsx_vand_v(g_l, mask); +- g_h = __lsx_vand_v(g_h, mask); +- r_l = __lsx_vslli_h(r_l, 8); +- r_h = __lsx_vslli_h(r_h, 8); +- r_l = __lsx_vor_v(r_l, alpha); +- r_h = __lsx_vor_v(r_h, alpha); +- r_l = __lsx_vor_v(r_l, g_l); +- r_h = __lsx_vor_v(r_h, g_h); +- r_l = __lsx_vor_v(r_l, b_l); +- r_h = __lsx_vor_v(r_h, b_h); +- __lsx_vst(r_l, dst_argb4444, 0); +- __lsx_vst(r_h, dst_argb4444, 16); +- dst_argb4444 += 32; +- src_y += 16; +- src_u += 8; +- src_v += 8; +- } +-} +- +-void I422ToARGB1555Row_LSX(const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_argb1555, +- const struct YuvConstants* yuvconstants, +- int width) { +- int x; +- int len = width / 16; +- __m128i vec_yb, vec_yg, vec_ub, vec_vr, vec_ug, vec_vg; +- __m128i vec_ubvr, vec_ugvg; +- __m128i const_80 = __lsx_vldi(0x80); +- __m128i alpha = (__m128i)v2u64{0x8000800080008000, 0x8000800080008000}; +- +- YUVTORGB_SETUP(yuvconstants, vec_vr, vec_ub, vec_vg, vec_ug, vec_yg, vec_yb); +- vec_ubvr = __lsx_vilvl_h(vec_ub, vec_vr); +- vec_ugvg = __lsx_vilvl_h(vec_ug, vec_vg); +- +- for (x = 0; x < len; x++) { +- __m128i y, uv_l, uv_h, b_l, b_h, g_l, g_h, r_l, r_h; +- +- READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h); +- YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l, +- g_h, r_l, r_h); +- b_l = __lsx_vsrli_h(b_l, 3); +- b_h = __lsx_vsrli_h(b_h, 3); +- g_l = __lsx_vsrli_h(g_l, 3); +- +- g_h = __lsx_vsrli_h(g_h, 3); +- g_l = __lsx_vslli_h(g_l, 5); +- g_h = __lsx_vslli_h(g_h, 5); +- r_l = __lsx_vsrli_h(r_l, 3); +- r_h = __lsx_vsrli_h(r_h, 3); +- r_l = __lsx_vslli_h(r_l, 10); +- r_h = __lsx_vslli_h(r_h, 10); +- r_l = __lsx_vor_v(r_l, alpha); +- r_h = __lsx_vor_v(r_h, alpha); +- r_l = __lsx_vor_v(r_l, g_l); +- r_h = __lsx_vor_v(r_h, g_h); +- r_l = __lsx_vor_v(r_l, b_l); +- r_h = __lsx_vor_v(r_h, b_h); +- __lsx_vst(r_l, dst_argb1555, 0); +- __lsx_vst(r_h, dst_argb1555, 16); +- dst_argb1555 += 32; +- src_y += 16; +- src_u += 8; +- src_v += 8; +- } +-} +- +-void YUY2ToYRow_LSX(const uint8_t* src_yuy2, uint8_t* dst_y, int width) { +- int x; +- int len = width / 16; +- __m128i src0, src1, dst0; +- +- for (x = 0; x < len; x++) { +- DUP2_ARG2(__lsx_vld, src_yuy2, 0, src_yuy2, 16, src0, src1); +- dst0 = __lsx_vpickev_b(src1, src0); +- __lsx_vst(dst0, dst_y, 0); +- src_yuy2 += 32; +- dst_y += 16; +- } +-} +- +-void YUY2ToUVRow_LSX(const uint8_t* src_yuy2, +- int src_stride_yuy2, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width) { +- const uint8_t* src_yuy2_next = src_yuy2 + src_stride_yuy2; +- int x; +- int len = width / 16; +- __m128i src0, src1, src2, src3; +- __m128i tmp0, dst0, dst1; +- +- for (x = 0; x < len; x++) { +- DUP4_ARG2(__lsx_vld, src_yuy2, 0, src_yuy2, 16, src_yuy2_next, 0, +- src_yuy2_next, 16, src0, src1, src2, src3); +- src0 = __lsx_vpickod_b(src1, src0); +- src1 = __lsx_vpickod_b(src3, src2); +- tmp0 = __lsx_vavgr_bu(src1, src0); +- dst0 = __lsx_vpickev_b(tmp0, tmp0); +- dst1 = __lsx_vpickod_b(tmp0, tmp0); +- __lsx_vstelm_d(dst0, dst_u, 0, 0); +- __lsx_vstelm_d(dst1, dst_v, 0, 0); +- src_yuy2 += 32; +- src_yuy2_next += 32; +- dst_u += 8; +- dst_v += 8; +- } +-} +- +-void YUY2ToUV422Row_LSX(const uint8_t* src_yuy2, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width) { +- int x; +- int len = width / 16; +- __m128i src0, src1, tmp0, dst0, dst1; +- +- for (x = 0; x < len; x++) { +- DUP2_ARG2(__lsx_vld, src_yuy2, 0, src_yuy2, 16, src0, src1); +- tmp0 = __lsx_vpickod_b(src1, src0); +- dst0 = __lsx_vpickev_b(tmp0, tmp0); +- dst1 = __lsx_vpickod_b(tmp0, tmp0); +- __lsx_vstelm_d(dst0, dst_u, 0, 0); +- __lsx_vstelm_d(dst1, dst_v, 0, 0); +- src_yuy2 += 32; +- dst_u += 8; +- dst_v += 8; +- } +-} +- +-void UYVYToYRow_LSX(const uint8_t* src_uyvy, uint8_t* dst_y, int width) { +- int x; +- int len = width / 16; +- __m128i src0, src1, dst0; +- +- for (x = 0; x < len; x++) { +- DUP2_ARG2(__lsx_vld, src_uyvy, 0, src_uyvy, 16, src0, src1); +- dst0 = __lsx_vpickod_b(src1, src0); +- __lsx_vst(dst0, dst_y, 0); +- src_uyvy += 32; +- dst_y += 16; +- } +-} +- +-void UYVYToUVRow_LSX(const uint8_t* src_uyvy, +- int src_stride_uyvy, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width) { +- const uint8_t* src_uyvy_next = src_uyvy + src_stride_uyvy; +- int x; +- int len = width / 16; +- __m128i src0, src1, src2, src3, tmp0, dst0, dst1; +- +- for (x = 0; x < len; x++) { +- DUP4_ARG2(__lsx_vld, src_uyvy, 0, src_uyvy, 16, src_uyvy_next, 0, +- src_uyvy_next, 16, src0, src1, src2, src3); +- src0 = __lsx_vpickev_b(src1, src0); +- src1 = __lsx_vpickev_b(src3, src2); +- tmp0 = __lsx_vavgr_bu(src1, src0); +- dst0 = __lsx_vpickev_b(tmp0, tmp0); +- dst1 = __lsx_vpickod_b(tmp0, tmp0); +- __lsx_vstelm_d(dst0, dst_u, 0, 0); +- __lsx_vstelm_d(dst1, dst_v, 0, 0); +- src_uyvy += 32; +- src_uyvy_next += 32; +- dst_u += 8; +- dst_v += 8; +- } +-} +- +-void UYVYToUV422Row_LSX(const uint8_t* src_uyvy, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width) { +- int x; +- int len = width / 16; +- __m128i src0, src1, tmp0, dst0, dst1; +- +- for (x = 0; x < len; x++) { +- DUP2_ARG2(__lsx_vld, src_uyvy, 0, src_uyvy, 16, src0, src1); +- tmp0 = __lsx_vpickev_b(src1, src0); +- dst0 = __lsx_vpickev_b(tmp0, tmp0); +- dst1 = __lsx_vpickod_b(tmp0, tmp0); +- __lsx_vstelm_d(dst0, dst_u, 0, 0); +- __lsx_vstelm_d(dst1, dst_v, 0, 0); +- src_uyvy += 32; +- dst_u += 8; +- dst_v += 8; +- } +-} +- +-void ARGBToUVRow_LSX(const uint8_t* src_argb0, +- int src_stride_argb, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width) { +- int x; +- int len = width / 16; +- const uint8_t* src_argb1 = src_argb0 + src_stride_argb; +- +- __m128i src0, src1, src2, src3, src4, src5, src6, src7; +- __m128i vec0, vec1, vec2, vec3; +- __m128i tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, dst0, dst1; +- __m128i const_0x70 = {0x0038003800380038, 0x0038003800380038}; +- __m128i const_0x4A = {0x0025002500250025, 0x0025002500250025}; +- __m128i const_0x26 = {0x0013001300130013, 0x0013001300130013}; +- __m128i const_0x5E = {0x002f002f002f002f, 0x002f002f002f002f}; +- __m128i const_0x12 = {0x0009000900090009, 0x0009000900090009}; +- __m128i const_0x8080 = (__m128i)v2u64{0x8080808080808080, 0x8080808080808080}; +- for (x = 0; x < len; x++) { +- DUP4_ARG2(__lsx_vld, src_argb0, 0, src_argb0, 16, src_argb0, 32, src_argb0, +- 48, src0, src1, src2, src3); +- DUP4_ARG2(__lsx_vld, src_argb1, 0, src_argb1, 16, src_argb1, 32, src_argb1, +- 48, src4, src5, src6, src7); +- vec0 = __lsx_vaddwev_h_bu(src0, src4); +- vec1 = __lsx_vaddwev_h_bu(src1, src5); +- vec2 = __lsx_vaddwev_h_bu(src2, src6); +- vec3 = __lsx_vaddwev_h_bu(src3, src7); +- tmp0 = __lsx_vpickev_h(vec1, vec0); +- tmp1 = __lsx_vpickev_h(vec3, vec2); +- tmp2 = __lsx_vpickod_h(vec1, vec0); +- tmp3 = __lsx_vpickod_h(vec3, vec2); +- vec0 = __lsx_vaddwod_h_bu(src0, src4); +- vec1 = __lsx_vaddwod_h_bu(src1, src5); +- vec2 = __lsx_vaddwod_h_bu(src2, src6); +- vec3 = __lsx_vaddwod_h_bu(src3, src7); +- tmp4 = __lsx_vpickev_h(vec1, vec0); +- tmp5 = __lsx_vpickev_h(vec3, vec2); +- vec0 = __lsx_vpickev_h(tmp1, tmp0); +- vec1 = __lsx_vpickod_h(tmp1, tmp0); +- src0 = __lsx_vavgr_h(vec0, vec1); +- vec0 = __lsx_vpickev_h(tmp3, tmp2); +- vec1 = __lsx_vpickod_h(tmp3, tmp2); +- src1 = __lsx_vavgr_h(vec0, vec1); +- vec0 = __lsx_vpickev_h(tmp5, tmp4); +- vec1 = __lsx_vpickod_h(tmp5, tmp4); +- src2 = __lsx_vavgr_h(vec0, vec1); +- dst0 = __lsx_vmadd_h(const_0x8080, src0, const_0x70); +- dst0 = __lsx_vmsub_h(dst0, src2, const_0x4A); +- dst0 = __lsx_vmsub_h(dst0, src1, const_0x26); +- dst1 = __lsx_vmadd_h(const_0x8080, src1, const_0x70); +- dst1 = __lsx_vmsub_h(dst1, src2, const_0x5E); +- dst1 = __lsx_vmsub_h(dst1, src0, const_0x12); +- dst0 = __lsx_vsrai_h(dst0, 8); +- dst1 = __lsx_vsrai_h(dst1, 8); +- dst0 = __lsx_vpickev_b(dst1, dst0); +- __lsx_vstelm_d(dst0, dst_u, 0, 0); +- __lsx_vstelm_d(dst0, dst_v, 0, 1); +- src_argb0 += 64; +- src_argb1 += 64; +- dst_u += 8; +- dst_v += 8; +- } +-} +- +-void ARGBToRGB24Row_LSX(const uint8_t* src_argb, uint8_t* dst_rgb, int width) { +- int x; +- int len = (width / 16) - 1; +- __m128i src0, src1, src2, src3; +- __m128i tmp0, tmp1, tmp2, tmp3; +- __m128i shuf = {0x0908060504020100, 0x000000000E0D0C0A}; +- for (x = 0; x < len; x++) { +- DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32, src_argb, 48, +- src0, src1, src2, src3); +- tmp0 = __lsx_vshuf_b(src0, src0, shuf); +- tmp1 = __lsx_vshuf_b(src1, src1, shuf); +- tmp2 = __lsx_vshuf_b(src2, src2, shuf); +- tmp3 = __lsx_vshuf_b(src3, src3, shuf); +- __lsx_vst(tmp0, dst_rgb, 0); +- __lsx_vst(tmp1, dst_rgb, 12); +- __lsx_vst(tmp2, dst_rgb, 24); +- __lsx_vst(tmp3, dst_rgb, 36); +- dst_rgb += 48; +- src_argb += 64; +- } +- DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32, src_argb, 48, +- src0, src1, src2, src3); +- tmp0 = __lsx_vshuf_b(src0, src0, shuf); +- tmp1 = __lsx_vshuf_b(src1, src1, shuf); +- tmp2 = __lsx_vshuf_b(src2, src2, shuf); +- tmp3 = __lsx_vshuf_b(src3, src3, shuf); +- __lsx_vst(tmp0, dst_rgb, 0); +- __lsx_vst(tmp1, dst_rgb, 12); +- __lsx_vst(tmp2, dst_rgb, 24); +- dst_rgb += 36; +- __lsx_vst(tmp3, dst_rgb, 0); +-} +- +-void ARGBToRAWRow_LSX(const uint8_t* src_argb, uint8_t* dst_rgb, int width) { +- int x; +- int len = (width / 16) - 1; +- __m128i src0, src1, src2, src3; +- __m128i tmp0, tmp1, tmp2, tmp3; +- __m128i shuf = {0x090A040506000102, 0x000000000C0D0E08}; +- for (x = 0; x < len; x++) { +- DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32, src_argb, 48, +- src0, src1, src2, src3); +- tmp0 = __lsx_vshuf_b(src0, src0, shuf); +- tmp1 = __lsx_vshuf_b(src1, src1, shuf); +- tmp2 = __lsx_vshuf_b(src2, src2, shuf); +- tmp3 = __lsx_vshuf_b(src3, src3, shuf); +- __lsx_vst(tmp0, dst_rgb, 0); +- __lsx_vst(tmp1, dst_rgb, 12); +- __lsx_vst(tmp2, dst_rgb, 24); +- __lsx_vst(tmp3, dst_rgb, 36); +- dst_rgb += 48; +- src_argb += 64; +- } +- DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32, src_argb, 48, +- src0, src1, src2, src3); +- tmp0 = __lsx_vshuf_b(src0, src0, shuf); +- tmp1 = __lsx_vshuf_b(src1, src1, shuf); +- tmp2 = __lsx_vshuf_b(src2, src2, shuf); +- tmp3 = __lsx_vshuf_b(src3, src3, shuf); +- __lsx_vst(tmp0, dst_rgb, 0); +- __lsx_vst(tmp1, dst_rgb, 12); +- __lsx_vst(tmp2, dst_rgb, 24); +- dst_rgb += 36; +- __lsx_vst(tmp3, dst_rgb, 0); +-} +- +-void ARGBToRGB565Row_LSX(const uint8_t* src_argb, uint8_t* dst_rgb, int width) { +- int x; +- int len = width / 8; +- __m128i zero = __lsx_vldi(0); +- __m128i src0, src1, tmp0, tmp1, dst0; +- __m128i shift = {0x0300030003000300, 0x0300030003000300}; +- +- for (x = 0; x < len; x++) { +- DUP2_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src0, src1); +- tmp0 = __lsx_vpickev_b(src1, src0); +- tmp1 = __lsx_vpickod_b(src1, src0); +- tmp0 = __lsx_vsrli_b(tmp0, 3); +- tmp1 = __lsx_vpackev_b(zero, tmp1); +- tmp1 = __lsx_vsrli_h(tmp1, 2); +- tmp0 = __lsx_vsll_b(tmp0, shift); +- tmp1 = __lsx_vslli_h(tmp1, 5); +- dst0 = __lsx_vor_v(tmp0, tmp1); +- __lsx_vst(dst0, dst_rgb, 0); +- dst_rgb += 16; +- src_argb += 32; +- } +-} +- +-void ARGBToARGB1555Row_LSX(const uint8_t* src_argb, +- uint8_t* dst_rgb, +- int width) { +- int x; +- int len = width / 8; +- __m128i zero = __lsx_vldi(0); +- __m128i src0, src1, tmp0, tmp1, tmp2, tmp3, dst0; +- __m128i shift1 = {0x0703070307030703, 0x0703070307030703}; +- __m128i shift2 = {0x0200020002000200, 0x0200020002000200}; +- +- for (x = 0; x < len; x++) { +- DUP2_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src0, src1); +- tmp0 = __lsx_vpickev_b(src1, src0); +- tmp1 = __lsx_vpickod_b(src1, src0); +- tmp0 = __lsx_vsrli_b(tmp0, 3); +- tmp1 = __lsx_vsrl_b(tmp1, shift1); +- tmp0 = __lsx_vsll_b(tmp0, shift2); +- tmp2 = __lsx_vpackev_b(zero, tmp1); +- tmp3 = __lsx_vpackod_b(zero, tmp1); +- tmp2 = __lsx_vslli_h(tmp2, 5); +- tmp3 = __lsx_vslli_h(tmp3, 15); +- dst0 = __lsx_vor_v(tmp0, tmp2); +- dst0 = __lsx_vor_v(dst0, tmp3); +- __lsx_vst(dst0, dst_rgb, 0); +- dst_rgb += 16; +- src_argb += 32; +- } +-} +- +-void ARGBToARGB4444Row_LSX(const uint8_t* src_argb, +- uint8_t* dst_rgb, +- int width) { +- int x; +- int len = width / 8; +- __m128i src0, src1, tmp0, tmp1, dst0; +- +- for (x = 0; x < len; x++) { +- DUP2_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src0, src1); +- tmp0 = __lsx_vpickev_b(src1, src0); +- tmp1 = __lsx_vpickod_b(src1, src0); +- tmp1 = __lsx_vandi_b(tmp1, 0xF0); +- tmp0 = __lsx_vsrli_b(tmp0, 4); +- dst0 = __lsx_vor_v(tmp1, tmp0); +- __lsx_vst(dst0, dst_rgb, 0); +- dst_rgb += 16; +- src_argb += 32; +- } +-} +- +-void ARGBToUV444Row_LSX(const uint8_t* src_argb, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int32_t width) { +- int x; +- int len = width / 16; +- __m128i src0, src1, src2, src3; +- __m128i tmp0, tmp1, tmp2, tmp3; +- __m128i reg0, reg1, reg2, reg3, dst0, dst1; +- __m128i const_112 = __lsx_vldi(112); +- __m128i const_74 = __lsx_vldi(74); +- __m128i const_38 = __lsx_vldi(38); +- __m128i const_94 = __lsx_vldi(94); +- __m128i const_18 = __lsx_vldi(18); +- __m128i const_0x8080 = (__m128i)v2u64{0x8080808080808080, 0x8080808080808080}; +- for (x = 0; x < len; x++) { +- DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32, src_argb, 48, +- src0, src1, src2, src3); +- tmp0 = __lsx_vpickev_h(src1, src0); +- tmp1 = __lsx_vpickod_h(src1, src0); +- tmp2 = __lsx_vpickev_h(src3, src2); +- tmp3 = __lsx_vpickod_h(src3, src2); +- reg0 = __lsx_vmaddwev_h_bu(const_0x8080, tmp0, const_112); +- reg1 = __lsx_vmaddwev_h_bu(const_0x8080, tmp2, const_112); +- reg2 = __lsx_vmulwod_h_bu(tmp0, const_74); +- reg3 = __lsx_vmulwod_h_bu(tmp2, const_74); +- reg2 = __lsx_vmaddwev_h_bu(reg2, tmp1, const_38); +- reg3 = __lsx_vmaddwev_h_bu(reg3, tmp3, const_38); +- reg0 = __lsx_vsub_h(reg0, reg2); +- reg1 = __lsx_vsub_h(reg1, reg3); +- reg0 = __lsx_vsrai_h(reg0, 8); +- reg1 = __lsx_vsrai_h(reg1, 8); +- dst0 = __lsx_vpickev_b(reg1, reg0); +- +- reg0 = __lsx_vmaddwev_h_bu(const_0x8080, tmp1, const_112); +- reg1 = __lsx_vmaddwev_h_bu(const_0x8080, tmp3, const_112); +- reg2 = __lsx_vmulwev_h_bu(tmp0, const_18); +- reg3 = __lsx_vmulwev_h_bu(tmp2, const_18); +- reg2 = __lsx_vmaddwod_h_bu(reg2, tmp0, const_94); +- reg3 = __lsx_vmaddwod_h_bu(reg3, tmp2, const_94); +- reg0 = __lsx_vsub_h(reg0, reg2); +- reg1 = __lsx_vsub_h(reg1, reg3); +- reg0 = __lsx_vsrai_h(reg0, 8); +- reg1 = __lsx_vsrai_h(reg1, 8); +- dst1 = __lsx_vpickev_b(reg1, reg0); +- +- __lsx_vst(dst0, dst_u, 0); +- __lsx_vst(dst1, dst_v, 0); +- dst_u += 16; +- dst_v += 16; +- src_argb += 64; +- } +-} +- +-void ARGBMultiplyRow_LSX(const uint8_t* src_argb0, +- const uint8_t* src_argb1, +- uint8_t* dst_argb, +- int width) { +- int x; +- int len = width / 4; +- __m128i zero = __lsx_vldi(0); +- __m128i src0, src1, dst0, dst1; +- __m128i tmp0, tmp1, tmp2, tmp3; +- +- for (x = 0; x < len; x++) { +- DUP2_ARG2(__lsx_vld, src_argb0, 0, src_argb1, 0, src0, src1); +- tmp0 = __lsx_vilvl_b(src0, src0); +- tmp1 = __lsx_vilvh_b(src0, src0); +- tmp2 = __lsx_vilvl_b(zero, src1); +- tmp3 = __lsx_vilvh_b(zero, src1); +- dst0 = __lsx_vmuh_hu(tmp0, tmp2); +- dst1 = __lsx_vmuh_hu(tmp1, tmp3); +- dst0 = __lsx_vpickev_b(dst1, dst0); +- __lsx_vst(dst0, dst_argb, 0); +- src_argb0 += 16; +- src_argb1 += 16; +- dst_argb += 16; +- } +-} +- +-void ARGBAddRow_LSX(const uint8_t* src_argb0, +- const uint8_t* src_argb1, +- uint8_t* dst_argb, +- int width) { +- int x; +- int len = width / 4; +- __m128i src0, src1, dst0; +- +- for (x = 0; x < len; x++) { +- DUP2_ARG2(__lsx_vld, src_argb0, 0, src_argb1, 0, src0, src1); +- dst0 = __lsx_vsadd_bu(src0, src1); +- __lsx_vst(dst0, dst_argb, 0); +- src_argb0 += 16; +- src_argb1 += 16; +- dst_argb += 16; +- } +-} +- +-void ARGBSubtractRow_LSX(const uint8_t* src_argb0, +- const uint8_t* src_argb1, +- uint8_t* dst_argb, +- int width) { +- int x; +- int len = width / 4; +- __m128i src0, src1, dst0; +- +- for (x = 0; x < len; x++) { +- DUP2_ARG2(__lsx_vld, src_argb0, 0, src_argb1, 0, src0, src1); +- dst0 = __lsx_vssub_bu(src0, src1); +- __lsx_vst(dst0, dst_argb, 0); +- src_argb0 += 16; +- src_argb1 += 16; +- dst_argb += 16; +- } +-} +- +-void ARGBAttenuateRow_LSX(const uint8_t* src_argb, +- uint8_t* dst_argb, +- int width) { +- int x; +- int len = width / 8; +- __m128i src0, src1, tmp0, tmp1; +- __m128i reg0, reg1, reg2, reg3, reg4, reg5; +- __m128i b, g, r, a, dst0, dst1; +- __m128i control = {0x0005000100040000, 0x0007000300060002}; +- +- for (x = 0; x < len; x++) { +- DUP2_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src0, src1); +- tmp0 = __lsx_vpickev_b(src1, src0); +- tmp1 = __lsx_vpickod_b(src1, src0); +- b = __lsx_vpackev_b(tmp0, tmp0); +- r = __lsx_vpackod_b(tmp0, tmp0); +- g = __lsx_vpackev_b(tmp1, tmp1); +- a = __lsx_vpackod_b(tmp1, tmp1); +- reg0 = __lsx_vmulwev_w_hu(b, a); +- reg1 = __lsx_vmulwod_w_hu(b, a); +- reg2 = __lsx_vmulwev_w_hu(r, a); +- reg3 = __lsx_vmulwod_w_hu(r, a); +- reg4 = __lsx_vmulwev_w_hu(g, a); +- reg5 = __lsx_vmulwod_w_hu(g, a); +- reg0 = __lsx_vssrani_h_w(reg1, reg0, 24); +- reg2 = __lsx_vssrani_h_w(reg3, reg2, 24); +- reg4 = __lsx_vssrani_h_w(reg5, reg4, 24); +- reg0 = __lsx_vshuf_h(control, reg0, reg0); +- reg2 = __lsx_vshuf_h(control, reg2, reg2); +- reg4 = __lsx_vshuf_h(control, reg4, reg4); +- tmp0 = __lsx_vpackev_b(reg4, reg0); +- tmp1 = __lsx_vpackev_b(a, reg2); +- dst0 = __lsx_vilvl_h(tmp1, tmp0); +- dst1 = __lsx_vilvh_h(tmp1, tmp0); +- __lsx_vst(dst0, dst_argb, 0); +- __lsx_vst(dst1, dst_argb, 16); +- dst_argb += 32; +- src_argb += 32; +- } +-} +- +-void ARGBToRGB565DitherRow_LSX(const uint8_t* src_argb, +- uint8_t* dst_rgb, +- uint32_t dither4, +- int width) { +- int x; +- int len = width / 8; +- __m128i src0, src1, tmp0, tmp1, dst0; +- __m128i b, g, r; +- __m128i zero = __lsx_vldi(0); +- __m128i vec_dither = __lsx_vldrepl_w(&dither4, 0); +- +- vec_dither = __lsx_vilvl_b(zero, vec_dither); +- for (x = 0; x < len; x++) { +- DUP2_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src0, src1); +- tmp0 = __lsx_vpickev_b(src1, src0); +- tmp1 = __lsx_vpickod_b(src1, src0); +- b = __lsx_vpackev_b(zero, tmp0); +- r = __lsx_vpackod_b(zero, tmp0); +- g = __lsx_vpackev_b(zero, tmp1); +- b = __lsx_vadd_h(b, vec_dither); +- g = __lsx_vadd_h(g, vec_dither); +- r = __lsx_vadd_h(r, vec_dither); +- DUP2_ARG1(__lsx_vclip255_h, b, g, b, g); +- r = __lsx_vclip255_h(r); +- b = __lsx_vsrai_h(b, 3); +- g = __lsx_vsrai_h(g, 2); +- r = __lsx_vsrai_h(r, 3); +- g = __lsx_vslli_h(g, 5); +- r = __lsx_vslli_h(r, 11); +- dst0 = __lsx_vor_v(b, g); +- dst0 = __lsx_vor_v(dst0, r); +- __lsx_vst(dst0, dst_rgb, 0); +- src_argb += 32; +- dst_rgb += 16; +- } +-} +- +-void ARGBShuffleRow_LSX(const uint8_t* src_argb, +- uint8_t* dst_argb, +- const uint8_t* shuffler, +- int width) { +- int x; +- int len = width / 8; +- __m128i src0, src1, dst0, dst1; +- __m128i shuf = {0x0404040400000000, 0x0C0C0C0C08080808}; +- __m128i temp = __lsx_vldrepl_w(shuffler, 0); +- +- shuf = __lsx_vadd_b(shuf, temp); +- for (x = 0; x < len; x++) { +- DUP2_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src0, src1); +- dst0 = __lsx_vshuf_b(src0, src0, shuf); +- dst1 = __lsx_vshuf_b(src1, src1, shuf); +- __lsx_vst(dst0, dst_argb, 0); +- __lsx_vst(dst1, dst_argb, 16); +- src_argb += 32; +- dst_argb += 32; +- } +-} +- +-void ARGBShadeRow_LSX(const uint8_t* src_argb, +- uint8_t* dst_argb, +- int width, +- uint32_t value) { +- int x; +- int len = width / 4; +- __m128i src0, dst0, tmp0, tmp1; +- __m128i vec_value = __lsx_vreplgr2vr_w(value); +- +- vec_value = __lsx_vilvl_b(vec_value, vec_value); +- for (x = 0; x < len; x++) { +- src0 = __lsx_vld(src_argb, 0); +- tmp0 = __lsx_vilvl_b(src0, src0); +- tmp1 = __lsx_vilvh_b(src0, src0); +- tmp0 = __lsx_vmuh_hu(tmp0, vec_value); +- tmp1 = __lsx_vmuh_hu(tmp1, vec_value); +- dst0 = __lsx_vpickod_b(tmp1, tmp0); +- __lsx_vst(dst0, dst_argb, 0); +- src_argb += 16; +- dst_argb += 16; +- } +-} +- +-void ARGBGrayRow_LSX(const uint8_t* src_argb, uint8_t* dst_argb, int width) { +- int x; +- int len = width / 8; +- __m128i src0, src1, tmp0, tmp1; +- __m128i reg0, reg1, reg2, dst0, dst1; +- __m128i const_128 = __lsx_vldi(0x480); +- __m128i const_150 = __lsx_vldi(0x96); +- __m128i const_br = {0x4D1D4D1D4D1D4D1D, 0x4D1D4D1D4D1D4D1D}; +- +- for (x = 0; x < len; x++) { +- DUP2_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src0, src1); +- tmp0 = __lsx_vpickev_b(src1, src0); +- tmp1 = __lsx_vpickod_b(src1, src0); +- reg0 = __lsx_vdp2_h_bu(tmp0, const_br); +- reg1 = __lsx_vmaddwev_h_bu(const_128, tmp1, const_150); +- reg2 = __lsx_vadd_h(reg0, reg1); +- tmp0 = __lsx_vpackod_b(reg2, reg2); +- tmp1 = __lsx_vpackod_b(tmp1, reg2); +- dst0 = __lsx_vilvl_h(tmp1, tmp0); +- dst1 = __lsx_vilvh_h(tmp1, tmp0); +- __lsx_vst(dst0, dst_argb, 0); +- __lsx_vst(dst1, dst_argb, 16); +- src_argb += 32; +- dst_argb += 32; +- } +-} +- +-void ARGBSepiaRow_LSX(uint8_t* dst_argb, int width) { +- int x; +- int len = width / 8; +- __m128i src0, src1, tmp0, tmp1; +- __m128i reg0, reg1, spb, spg, spr; +- __m128i dst0, dst1; +- __m128i spb_g = __lsx_vldi(68); +- __m128i spg_g = __lsx_vldi(88); +- __m128i spr_g = __lsx_vldi(98); +- __m128i spb_br = {0x2311231123112311, 0x2311231123112311}; +- __m128i spg_br = {0x2D162D162D162D16, 0x2D162D162D162D16}; +- __m128i spr_br = {0x3218321832183218, 0x3218321832183218}; +- __m128i shuff = {0x1706150413021100, 0x1F0E1D0C1B0A1908}; +- +- for (x = 0; x < len; x++) { +- DUP2_ARG2(__lsx_vld, dst_argb, 0, dst_argb, 16, src0, src1); +- tmp0 = __lsx_vpickev_b(src1, src0); +- tmp1 = __lsx_vpickod_b(src1, src0); +- DUP2_ARG2(__lsx_vdp2_h_bu, tmp0, spb_br, tmp0, spg_br, spb, spg); +- spr = __lsx_vdp2_h_bu(tmp0, spr_br); +- spb = __lsx_vmaddwev_h_bu(spb, tmp1, spb_g); +- spg = __lsx_vmaddwev_h_bu(spg, tmp1, spg_g); +- spr = __lsx_vmaddwev_h_bu(spr, tmp1, spr_g); +- spb = __lsx_vsrli_h(spb, 7); +- spg = __lsx_vsrli_h(spg, 7); +- spr = __lsx_vsrli_h(spr, 7); +- spg = __lsx_vsat_hu(spg, 7); +- spr = __lsx_vsat_hu(spr, 7); +- reg0 = __lsx_vpackev_b(spg, spb); +- reg1 = __lsx_vshuf_b(tmp1, spr, shuff); +- dst0 = __lsx_vilvl_h(reg1, reg0); +- dst1 = __lsx_vilvh_h(reg1, reg0); +- __lsx_vst(dst0, dst_argb, 0); +- __lsx_vst(dst1, dst_argb, 16); +- dst_argb += 32; +- } +-} +- + void ARGB4444ToARGBRow_LSX(const uint8_t* src_argb4444, + uint8_t* dst_argb, + int width) { +@@ -1533,7 +407,7 @@ void ARGB1555ToUVRow_LSX(const uint8_t* + __m128i const_38 = __lsx_vldi(0x413); + __m128i const_94 = __lsx_vldi(0x42F); + __m128i const_18 = __lsx_vldi(0x409); +- __m128i const_8080 = (__m128i)v2u64{0x8080808080808080, 0x8080808080808080}; ++ __m128i const_8080 = {0x8080808080808080, 0x8080808080808080}; + + for (x = 0; x < len; x++) { + DUP4_ARG2(__lsx_vld, src_argb1555, 0, src_argb1555, 16, next_argb1555, 0, +@@ -1642,7 +516,7 @@ void RGB565ToUVRow_LSX(const uint8_t* sr + __m128i const_38 = __lsx_vldi(0x413); + __m128i const_94 = __lsx_vldi(0x42F); + __m128i const_18 = __lsx_vldi(0x409); +- __m128i const_8080 = (__m128i)v2u64{0x8080808080808080, 0x8080808080808080}; ++ __m128i const_8080 = {0x8080808080808080, 0x8080808080808080}; + + for (x = 0; x < len; x++) { + DUP4_ARG2(__lsx_vld, src_rgb565, 0, src_rgb565, 16, next_rgb565, 0, +@@ -1703,7 +577,7 @@ void RGB24ToUVRow_LSX(const uint8_t* src + __m128i const_38 = __lsx_vldi(0x413); + __m128i const_94 = __lsx_vldi(0x42F); + __m128i const_18 = __lsx_vldi(0x409); +- __m128i const_8080 = (__m128i)v2u64{0x8080808080808080, 0x8080808080808080}; ++ __m128i const_8080 = {0x8080808080808080, 0x8080808080808080}; + __m128i shuff0_b = {0x15120F0C09060300, 0x00000000001E1B18}; + __m128i shuff1_b = {0x0706050403020100, 0x1D1A1714110A0908}; + __m128i shuff0_g = {0x1613100D0A070401, 0x00000000001F1C19}; +@@ -1756,7 +630,7 @@ void RAWToUVRow_LSX(const uint8_t* src_r + __m128i const_38 = __lsx_vldi(0x413); + __m128i const_94 = __lsx_vldi(0x42F); + __m128i const_18 = __lsx_vldi(0x409); +- __m128i const_8080 = (__m128i)v2u64{0x8080808080808080, 0x8080808080808080}; ++ __m128i const_8080 = {0x8080808080808080, 0x8080808080808080}; + __m128i shuff0_r = {0x15120F0C09060300, 0x00000000001E1B18}; + __m128i shuff1_r = {0x0706050403020100, 0x1D1A1714110A0908}; + __m128i shuff0_g = {0x1613100D0A070401, 0x00000000001F1C19}; +@@ -1991,7 +865,7 @@ void BGRAToUVRow_LSX(const uint8_t* src_ + __m128i const_38 = __lsx_vldi(0x413); + __m128i const_94 = __lsx_vldi(0x42F); + __m128i const_18 = __lsx_vldi(0x409); +- __m128i const_8080 = (__m128i)v2u64{0x8080808080808080, 0x8080808080808080}; ++ __m128i const_8080 = {0x8080808080808080, 0x8080808080808080}; + + for (x = 0; x < len; x++) { + DUP4_ARG2(__lsx_vld, src_bgra, 0, src_bgra, 16, src_bgra, 32, src_bgra, 48, +@@ -2039,7 +913,7 @@ void ABGRToUVRow_LSX(const uint8_t* src_ + __m128i const_38 = __lsx_vldi(0x413); + __m128i const_94 = __lsx_vldi(0x42F); + __m128i const_18 = __lsx_vldi(0x409); +- __m128i const_8080 = (__m128i)v2u64{0x8080808080808080, 0x8080808080808080}; ++ __m128i const_8080 = {0x8080808080808080, 0x8080808080808080}; + + for (x = 0; x < len; x++) { + DUP4_ARG2(__lsx_vld, src_abgr, 0, src_abgr, 16, src_abgr, 32, src_abgr, 48, +@@ -2087,7 +961,7 @@ void RGBAToUVRow_LSX(const uint8_t* src_ + __m128i const_38 = __lsx_vldi(0x413); + __m128i const_94 = __lsx_vldi(0x42F); + __m128i const_18 = __lsx_vldi(0x409); +- __m128i const_8080 = (__m128i)v2u64{0x8080808080808080, 0x8080808080808080}; ++ __m128i const_8080 = {0x8080808080808080, 0x8080808080808080}; + + for (x = 0; x < len; x++) { + DUP4_ARG2(__lsx_vld, src_rgba, 0, src_rgba, 16, src_rgba, 32, src_rgba, 48, +@@ -2136,7 +1010,7 @@ void ARGBToUVJRow_LSX(const uint8_t* src + __m128i const_21 = __lsx_vldi(0x415); + __m128i const_53 = __lsx_vldi(0x435); + __m128i const_10 = __lsx_vldi(0x40A); +- __m128i const_8080 = (__m128i)v2u64{0x8080808080808080, 0x8080808080808080}; ++ __m128i const_8080 = {0x8080808080808080, 0x8080808080808080}; + + for (x = 0; x < len; x++) { + DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32, src_argb, 48, +@@ -2514,7 +1388,7 @@ void ARGBBlendRow_LSX(const uint8_t* src + __m128i const_256 = __lsx_vldi(0x500); + __m128i zero = __lsx_vldi(0); + __m128i alpha = __lsx_vldi(0xFF); +- __m128i control = (__m128i)v2u64{0xFF000000FF000000, 0xFF000000FF000000}; ++ __m128i control = {0xFF000000FF000000, 0xFF000000FF000000}; + + for (x = 0; x < len; x++) { + DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb1, 0, src_argb1, 16, +@@ -2560,7 +1434,7 @@ void ARGBQuantizeRow_LSX(uint8_t* dst_ar + __m128i vec_offset = __lsx_vreplgr2vr_b(interval_offset); + __m128i vec_scale = __lsx_vreplgr2vr_w(scale); + __m128i zero = __lsx_vldi(0); +- __m128i control = (__m128i)v2u64{0xFF000000FF000000, 0xFF000000FF000000}; ++ __m128i control = {0xFF000000FF000000, 0xFF000000FF000000}; + + for (x = 0; x < len; x++) { + DUP4_ARG2(__lsx_vld, dst_argb, 0, dst_argb, 16, dst_argb, 32, dst_argb, 48, +@@ -2805,7 +1679,8 @@ static void ARGBToYMatrixRow_LSX(const u + uint8_t* dst_y, + int width, + const struct RgbConstants* rgbconstants) { +- asm("vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants ++ asm volatile( ++ "vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants + "vldrepl.b $vr1, %3, 1 \n\t" // load rgbconstants + "vldrepl.b $vr2, %3, 2 \n\t" // load rgbconstants + "vldrepl.h $vr3, %3, 4 \n\t" // load rgbconstants +@@ -2863,7 +1738,8 @@ static void RGBAToYMatrixRow_LSX(const u + uint8_t* dst_y, + int width, + const struct RgbConstants* rgbconstants) { +- asm("vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants ++ asm volatile( ++ "vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants + "vldrepl.b $vr1, %3, 1 \n\t" // load rgbconstants + "vldrepl.b $vr2, %3, 2 \n\t" // load rgbconstants + "vldrepl.h $vr3, %3, 4 \n\t" // load rgbconstants +@@ -2920,7 +1796,8 @@ static void RGBToYMatrixRow_LSX(const ui + 7, 9, 10, 12, 13, 15, 1, 0, 4, 0, 7, 0, 10, + 0, 13, 0, 16, 0, 19, 0, 22, 0, 25, 0, 28, 0, + 31, 0, 2, 0, 5, 0, 8, 0, 11, 0, 14, 0}; +- asm("vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants ++ asm volatile( ++ "vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants + "vldrepl.b $vr1, %3, 1 \n\t" // load rgbconstants + "vldrepl.b $vr2, %3, 2 \n\t" // load rgbconstants + "vldrepl.h $vr3, %3, 4 \n\t" // load rgbconstants +diff --git a/media/libyuv/libyuv/source/row_neon.cc b/media/libyuv/libyuv/source/row_neon.cc +--- a/media/libyuv/libyuv/source/row_neon.cc ++++ b/media/libyuv/libyuv/source/row_neon.cc +@@ -89,14 +89,12 @@ extern "C" { + "vsli.u16 d2, d2, #8 \n" \ + "vsri.u16 d3, d3, #8 \n" + +-// TODO: Use single register for kUVCoeff and multiply by lane + #define YUVTORGB_SETUP \ +- "vld1.16 {d31}, [%[kRGBCoeffBias]] \n" \ + "vld4.8 {d26[], d27[], d28[], d29[]}, [%[kUVCoeff]] \n" \ +- "vdup.u16 q10, d31[1] \n" \ +- "vdup.u16 q11, d31[2] \n" \ +- "vdup.u16 q12, d31[3] \n" \ +- "vdup.u16 d31, d31[0] \n" ++ "vld1.16 {d31[]}, [%[kRGBCoeffBias]]! \n" \ ++ "vld1.16 {d20[], d21[]}, [%[kRGBCoeffBias]]! \n" \ ++ "vld1.16 {d22[], d23[]}, [%[kRGBCoeffBias]]! \n" \ ++ "vld1.16 {d24[], d25[]}, [%[kRGBCoeffBias]] \n" + + // q0: B uint16x8_t + // q1: G uint16x8_t +@@ -140,7 +138,7 @@ void I444ToARGBRow_NEON(const uint8_t* s + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "vmov.u8 d6, #255 \n" + "1: \n" READYUV444 YUVTORGB +@@ -164,7 +162,7 @@ void I444ToRGB24Row_NEON(const uint8_t* + uint8_t* dst_rgb24, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "1: \n" READYUV444 YUVTORGB + RGBTORGB8 +@@ -187,7 +185,7 @@ void I422ToARGBRow_NEON(const uint8_t* s + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "vmov.u8 d6, #255 \n" + "1: \n" READYUV422 YUVTORGB +@@ -212,7 +210,7 @@ void I444AlphaToARGBRow_NEON(const uint8 + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "1: \n" READYUV444 YUVTORGB + RGBTORGB8 +@@ -238,7 +236,7 @@ void I422AlphaToARGBRow_NEON(const uint8 + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "1: \n" READYUV422 YUVTORGB + RGBTORGB8 +@@ -263,7 +261,7 @@ void I422ToRGBARow_NEON(const uint8_t* s + uint8_t* dst_rgba, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "vmov.u8 d6, #255 \n" + "1: \n" READYUV422 YUVTORGB +@@ -285,7 +283,7 @@ void I422ToRGB24Row_NEON(const uint8_t* + uint8_t* dst_rgb24, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "vmov.u8 d6, #255 \n" + "1: \n" READYUV422 YUVTORGB +@@ -316,7 +314,7 @@ void I422ToRGB565Row_NEON(const uint8_t* + uint8_t* dst_rgb565, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "vmov.u8 d6, #255 \n" + "1: \n" READYUV422 YUVTORGB +@@ -348,7 +346,7 @@ void I422ToARGB1555Row_NEON(const uint8_ + uint8_t* dst_argb1555, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "1: \n" READYUV422 YUVTORGB + RGBTORGB8 +@@ -381,7 +379,7 @@ void I422ToARGB4444Row_NEON(const uint8_ + uint8_t* dst_argb4444, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "vmov.u8 d6, #255 \n" + "vmov.u8 d7, #0x0f \n" // vbic bits to clear +@@ -404,7 +402,7 @@ void I400ToARGBRow_NEON(const uint8_t* s + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "vmov.u8 d6, #255 \n" + "1: \n" READYUV400 YUVTORGB +@@ -421,7 +419,7 @@ void I400ToARGBRow_NEON(const uint8_t* s + } + + void J400ToARGBRow_NEON(const uint8_t* src_y, uint8_t* dst_argb, int width) { +- asm volatile ( ++ asm volatile( + "vmov.u8 d23, #255 \n" + "1: \n" + "vld1.8 {d20}, [%0]! \n" +@@ -442,7 +440,7 @@ void NV12ToARGBRow_NEON(const uint8_t* s + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "vmov.u8 d6, #255 \n" + "1: \n" READNV12 YUVTORGB RGBTORGB8 +@@ -463,7 +461,7 @@ void NV21ToARGBRow_NEON(const uint8_t* s + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "vmov.u8 d6, #255 \n" + "1: \n" READNV21 YUVTORGB RGBTORGB8 +@@ -484,7 +482,7 @@ void NV12ToRGB24Row_NEON(const uint8_t* + uint8_t* dst_rgb24, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "vmov.u8 d6, #255 \n" + "1: \n" READNV12 YUVTORGB RGBTORGB8 +@@ -505,7 +503,7 @@ void NV21ToRGB24Row_NEON(const uint8_t* + uint8_t* dst_rgb24, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "vmov.u8 d6, #255 \n" + "1: \n" READNV21 YUVTORGB RGBTORGB8 +@@ -526,7 +524,7 @@ void NV12ToRGB565Row_NEON(const uint8_t* + uint8_t* dst_rgb565, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "vmov.u8 d6, #255 \n" + "1: \n" READNV12 YUVTORGB RGBTORGB8 +@@ -546,7 +544,7 @@ void YUY2ToARGBRow_NEON(const uint8_t* s + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "vmov.u8 d6, #255 \n" + "1: \n" READYUY2 YUVTORGB RGBTORGB8 +@@ -565,7 +563,7 @@ void UYVYToARGBRow_NEON(const uint8_t* s + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "vmov.u8 d6, #255 \n" + "1: \n" READUYVY YUVTORGB RGBTORGB8 +@@ -585,7 +583,7 @@ void SplitUVRow_NEON(const uint8_t* src_ + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld2.8 {q0, q1}, [%0]! \n" // load 16 pairs of UV + "subs %3, %3, #16 \n" // 16 processed per loop +@@ -609,7 +607,7 @@ void DetileRow_NEON(const uint8_t* src, + ptrdiff_t src_tile_stride, + uint8_t* dst, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld1.8 {q0}, [%0], %3 \n" // load 16 bytes + "subs %2, %2, #16 \n" // 16 processed per loop +@@ -629,7 +627,7 @@ void DetileRow_16_NEON(const uint16_t* s + ptrdiff_t src_tile_stride, + uint16_t* dst, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld1.16 {q0, q1}, [%0], %3 \n" // load 16 pixels + "subs %2, %2, #16 \n" // 16 processed per loop +@@ -650,7 +648,7 @@ void DetileSplitUVRow_NEON(const uint8_t + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld2.8 {d0, d1}, [%0], %4 \n" + "subs %3, %3, #16 \n" +@@ -675,7 +673,7 @@ void DetileToYUY2_NEON(const uint8_t* sr + ptrdiff_t src_uv_tile_stride, + uint8_t* dst_yuy2, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld1.8 {q0}, [%0], %4 \n" // Load 16 Y + "pld [%0, #1792] \n" +@@ -701,7 +699,7 @@ void DetileToYUY2_NEON(const uint8_t* sr + ptrdiff_t src_uv_tile_stride, + uint8_t* dst_yuy2, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld1.8 {q0}, [%0], %4 \n" // Load 16 Y + "vld1.8 {q1}, [%1], %5 \n" // Load 8 UV +@@ -723,43 +721,57 @@ void DetileToYUY2_NEON(const uint8_t* sr + #endif + + void UnpackMT2T_NEON(const uint8_t* src, uint16_t* dst, size_t size) { +- asm volatile ( ++ const uint8_t* src_lower_bits = src; ++ const uint8_t* src_upper_bits = src + 16; ++ asm volatile( + "1: \n" +- "vld1.8 {q14}, [%0]! \n" // Load lower bits. +- "vld1.8 {q9}, [%0]! \n" // Load upper bits row +- // by row. +- "vld1.8 {q11}, [%0]! \n" +- "vld1.8 {q13}, [%0]! \n" +- "vld1.8 {q15}, [%0]! \n" +- "vshl.u8 q8, q14, #6 \n" // Shift lower bit data +- // appropriately. +- "vshl.u8 q10, q14, #4 \n" +- "vshl.u8 q12, q14, #2 \n" +- "vzip.u8 q8, q9 \n" // Interleave upper and +- // lower bits. +- "vzip.u8 q10, q11 \n" +- "vzip.u8 q12, q13 \n" +- "vzip.u8 q14, q15 \n" +- "vsri.u16 q8, q8, #10 \n" // Copy upper 6 bits +- // into lower 6 bits for +- // better accuracy in ++ "vld4.8 {d1, d3, d5, d7}, [%1]! \n" // Load 32 bytes of upper ++ // bits. ++ "vld1.8 {d6}, [%0]! \n" // Load 8 bytes of lower ++ // bits. ++ "vshl.u8 d4, d6, #2 \n" // Align lower bits. ++ "vshl.u8 d2, d6, #4 \n" ++ "vshl.u8 d0, d6, #6 \n" ++ "vzip.u8 d0, d1 \n" // Zip lower and upper ++ // bits together. ++ "vzip.u8 d2, d3 \n" ++ "vzip.u8 d4, d5 \n" ++ "vzip.u8 d6, d7 \n" ++ "vsri.u16 q0, q0, #10 \n" // Copy upper 6 bits into ++ // lower 6 bits for better ++ // accuracy in + // conversions. +- "vsri.u16 q9, q9, #10 \n" +- "vsri.u16 q10, q10, #10 \n" +- "vsri.u16 q11, q11, #10 \n" +- "vsri.u16 q12, q12, #10 \n" +- "vsri.u16 q13, q13, #10 \n" +- "vsri.u16 q14, q14, #10 \n" +- "vsri.u16 q15, q15, #10 \n" +- "vstmia %1!, {q8-q15} \n" // Store pixel block (64 +- // pixels). +- "subs %2, %2, #80 \n" ++ "vsri.u16 q1, q1, #10 \n" ++ "vsri.u16 q2, q2, #10 \n" ++ "vsri.u16 q3, q3, #10 \n" ++ "vst4.16 {d0, d2, d4, d6}, [%2]! \n" // Store 32 pixels ++ "vst4.16 {d1, d3, d5, d7}, [%2]! \n" ++ "vld4.8 {d1, d3, d5, d7}, [%1]! \n" // Process last 32 pixels ++ // in the block ++ "vld1.8 {d6}, [%0]! \n" ++ "vshl.u8 d4, d6, #2 \n" ++ "vshl.u8 d2, d6, #4 \n" ++ "vshl.u8 d0, d6, #6 \n" ++ "vzip.u8 d0, d1 \n" ++ "vzip.u8 d2, d3 \n" ++ "vzip.u8 d4, d5 \n" ++ "vzip.u8 d6, d7 \n" ++ "vsri.u16 q0, q0, #10 \n" ++ "vsri.u16 q1, q1, #10 \n" ++ "vsri.u16 q2, q2, #10 \n" ++ "vsri.u16 q3, q3, #10 \n" ++ "vst4.16 {d0, d2, d4, d6}, [%2]! \n" ++ "vst4.16 {d1, d3, d5, d7}, [%2]! \n" ++ "mov %0, %1 \n" ++ "add %1, %0, #16 \n" ++ "subs %3, %3, #80 \n" + "bgt 1b \n" +- : "+r"(src), // %0 +- "+r"(dst), // %1 +- "+r"(size) // %2 ++ : "+r"(src_lower_bits), // %0 ++ "+r"(src_upper_bits), // %1 ++ "+r"(dst), // %2 ++ "+r"(size) // %3 + : +- : "cc", "memory", "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15"); ++ : "cc", "memory", "q0", "q1", "q2", "q3"); + } + + // Reads 16 U's and V's and writes out 16 pairs of UV. +@@ -767,7 +779,7 @@ void MergeUVRow_NEON(const uint8_t* src_ + const uint8_t* src_v, + uint8_t* dst_uv, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld1.8 {q0}, [%0]! \n" // load U + "vld1.8 {q1}, [%1]! \n" // load V +@@ -789,7 +801,7 @@ void SplitRGBRow_NEON(const uint8_t* src + uint8_t* dst_g, + uint8_t* dst_b, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld3.8 {d0, d2, d4}, [%0]! \n" // load 8 RGB + "vld3.8 {d1, d3, d5}, [%0]! \n" // next 8 RGB +@@ -804,7 +816,7 @@ void SplitRGBRow_NEON(const uint8_t* src + "+r"(dst_b), // %3 + "+r"(width) // %4 + : // Input registers +- : "cc", "memory", "q0", "q1", "q2" // Clobber List ++ : "cc", "memory", "d0", "d1", "d2" // Clobber List + ); + } + +@@ -814,7 +826,7 @@ void MergeRGBRow_NEON(const uint8_t* src + const uint8_t* src_b, + uint8_t* dst_rgb, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld1.8 {q0}, [%0]! \n" // load R + "vld1.8 {q1}, [%1]! \n" // load G +@@ -840,7 +852,7 @@ void SplitARGBRow_NEON(const uint8_t* sr + uint8_t* dst_b, + uint8_t* dst_a, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld4.8 {d0, d2, d4, d6}, [%0]! \n" // load 8 ARGB + "vld4.8 {d1, d3, d5, d7}, [%0]! \n" // next 8 ARGB +@@ -868,7 +880,7 @@ void MergeARGBRow_NEON(const uint8_t* sr + const uint8_t* src_a, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld1.8 {q2}, [%0]! \n" // load R + "vld1.8 {q1}, [%1]! \n" // load G +@@ -895,7 +907,7 @@ void SplitXRGBRow_NEON(const uint8_t* sr + uint8_t* dst_g, + uint8_t* dst_b, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld4.8 {d0, d2, d4, d6}, [%0]! \n" // load 8 ARGB + "vld4.8 {d1, d3, d5, d7}, [%0]! \n" // next 8 ARGB +@@ -920,7 +932,7 @@ void MergeXRGBRow_NEON(const uint8_t* sr + const uint8_t* src_b, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "vmov.u8 q3, #255 \n" // load A(255) + "1: \n" + "vld1.8 {q2}, [%0]! \n" // load R +@@ -947,7 +959,7 @@ void MergeXR30Row_NEON(const uint16_t* s + int depth, + int width) { + int shift = 10 - depth; +- asm volatile ( ++ asm volatile( + "vmov.u32 q14, #1023 \n" + "vdup.32 q15, %5 \n" + "1: \n" +@@ -984,7 +996,7 @@ void MergeXR30Row_10_NEON(const uint16_t + uint8_t* dst_ar30, + int /* depth */, + int width) { +- asm volatile ( ++ asm volatile( + "vmov.u32 q14, #1023 \n" + "1: \n" + "vld1.16 {d4}, [%2]! \n" // B +@@ -1021,7 +1033,7 @@ void MergeAR64Row_NEON(const uint16_t* s + int width) { + int shift = 16 - depth; + int mask = (1 << depth) - 1; +- asm volatile ( ++ asm volatile( + + "vdup.u16 q15, %6 \n" + "vdup.u16 q14, %7 \n" +@@ -1061,7 +1073,7 @@ void MergeXR64Row_NEON(const uint16_t* s + int width) { + int shift = 16 - depth; + int mask = (1 << depth) - 1; +- asm volatile ( ++ asm volatile( + + "vmov.u8 q3, #0xff \n" // A (0xffff) + "vdup.u16 q15, %5 \n" +@@ -1098,7 +1110,7 @@ void MergeARGB16To8Row_NEON(const uint16 + int depth, + int width) { + int shift = 8 - depth; +- asm volatile ( ++ asm volatile( + + "vdup.16 q15, %6 \n" + "1: \n" +@@ -1134,7 +1146,7 @@ void MergeXRGB16To8Row_NEON(const uint16 + int depth, + int width) { + int shift = 8 - depth; +- asm volatile ( ++ asm volatile( + + "vdup.16 q15, %5 \n" + "vmov.u8 d6, #0xff \n" // A (0xff) +@@ -1162,7 +1174,7 @@ void MergeXRGB16To8Row_NEON(const uint16 + + // Copy multiple of 32. vld4.8 allow unaligned and is fastest on a15. + void CopyRow_NEON(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld1.8 {d0, d1, d2, d3}, [%0]! \n" // load 32 + "subs %2, %2, #32 \n" // 32 processed per loop +@@ -1178,7 +1190,7 @@ void CopyRow_NEON(const uint8_t* src, ui + + // SetRow writes 'width' bytes using an 8 bit value repeated. + void SetRow_NEON(uint8_t* dst, uint8_t v8, int width) { +- asm volatile ( ++ asm volatile( + "vdup.8 q0, %2 \n" // duplicate 16 bytes + "1: \n" + "subs %1, %1, #16 \n" // 16 bytes per loop +@@ -1192,7 +1204,7 @@ void SetRow_NEON(uint8_t* dst, uint8_t v + + // ARGBSetRow writes 'width' pixels using an 32 bit value repeated. + void ARGBSetRow_NEON(uint8_t* dst, uint32_t v32, int width) { +- asm volatile ( ++ asm volatile( + "vdup.u32 q0, %2 \n" // duplicate 4 ints + "1: \n" + "subs %1, %1, #4 \n" // 4 pixels per loop +@@ -1205,7 +1217,7 @@ void ARGBSetRow_NEON(uint8_t* dst, uint3 + } + + void MirrorRow_NEON(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + // Start at end of source row. + "add %0, %0, %2 \n" + "sub %0, %0, #32 \n" // 32 bytes per loop +@@ -1227,7 +1239,7 @@ void MirrorRow_NEON(const uint8_t* src, + } + + void MirrorUVRow_NEON(const uint8_t* src_uv, uint8_t* dst_uv, int width) { +- asm volatile ( ++ asm volatile( + // Start at end of source row. + "mov r12, #-16 \n" + "add %0, %0, %2, lsl #1 \n" +@@ -1250,7 +1262,7 @@ void MirrorSplitUVRow_NEON(const uint8_t + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + // Start at end of source row. + "mov r12, #-16 \n" + "add %0, %0, %3, lsl #1 \n" +@@ -1272,7 +1284,7 @@ void MirrorSplitUVRow_NEON(const uint8_t + } + + void ARGBMirrorRow_NEON(const uint8_t* src_argb, uint8_t* dst_argb, int width) { +- asm volatile ( ++ asm volatile( + "add %0, %0, %2, lsl #2 \n" + "sub %0, #32 \n" + +@@ -1296,7 +1308,7 @@ void RGB24MirrorRow_NEON(const uint8_t* + uint8_t* dst_rgb24, + int width) { + src_rgb24 += width * 3 - 24; +- asm volatile ( ++ asm volatile( + "1: \n" + "vld3.8 {d0, d1, d2}, [%0], %3 \n" // src -= 24 + "subs %2, #8 \n" // 8 pixels per loop. +@@ -1315,7 +1327,7 @@ void RGB24MirrorRow_NEON(const uint8_t* + void RGB24ToARGBRow_NEON(const uint8_t* src_rgb24, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "vmov.u8 d4, #255 \n" // Alpha + "1: \n" + "vld3.8 {d1, d2, d3}, [%0]! \n" // load 8 pixels of RGB24. +@@ -1331,7 +1343,7 @@ void RGB24ToARGBRow_NEON(const uint8_t* + } + + void RAWToARGBRow_NEON(const uint8_t* src_raw, uint8_t* dst_argb, int width) { +- asm volatile ( ++ asm volatile( + "vmov.u8 d4, #255 \n" // Alpha + "1: \n" + "vld3.8 {d1, d2, d3}, [%0]! \n" // load 8 pixels of RAW. +@@ -1348,7 +1360,7 @@ void RAWToARGBRow_NEON(const uint8_t* sr + } + + void RAWToRGBARow_NEON(const uint8_t* src_raw, uint8_t* dst_rgba, int width) { +- asm volatile ( ++ asm volatile( + "vmov.u8 d0, #255 \n" // Alpha + "1: \n" + "vld3.8 {d1, d2, d3}, [%0]! \n" // load 8 pixels of RAW. +@@ -1364,7 +1376,7 @@ void RAWToRGBARow_NEON(const uint8_t* sr + ); + } + void RAWToRGB24Row_NEON(const uint8_t* src_raw, uint8_t* dst_rgb24, int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld3.8 {d1, d2, d3}, [%0]! \n" // load 8 pixels of RAW. + "subs %2, %2, #8 \n" // 8 processed per loop. +@@ -1395,7 +1407,7 @@ void RAWToRGB24Row_NEON(const uint8_t* s + void RGB565ToARGBRow_NEON(const uint8_t* src_rgb565, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "vmov.u8 d3, #255 \n" // Alpha + "1: \n" + "vld1.8 {q0}, [%0]! \n" // load 8 RGB565 pixels. +@@ -1441,7 +1453,7 @@ void RGB565ToARGBRow_NEON(const uint8_t* + void ARGB1555ToARGBRow_NEON(const uint8_t* src_argb1555, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "vmov.u8 d3, #255 \n" // Alpha + "1: \n" + "vld1.8 {q0}, [%0]! \n" // load 8 ARGB1555 pixels. +@@ -1470,7 +1482,7 @@ void ARGB1555ToARGBRow_NEON(const uint8_ + void ARGB4444ToARGBRow_NEON(const uint8_t* src_argb4444, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "vmov.u8 d3, #255 \n" // Alpha + "1: \n" + "vld1.8 {q0}, [%0]! \n" // load 8 ARGB4444 pixels. +@@ -1489,7 +1501,7 @@ void ARGB4444ToARGBRow_NEON(const uint8_ + void ARGBToRGB24Row_NEON(const uint8_t* src_argb, + uint8_t* dst_rgb24, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld4.8 {d0, d2, d4, d6}, [%0]! \n" // load 16 pixels of ARGB. + "vld4.8 {d1, d3, d5, d7}, [%0]! \n" +@@ -1506,7 +1518,7 @@ void ARGBToRGB24Row_NEON(const uint8_t* + } + + void ARGBToRAWRow_NEON(const uint8_t* src_argb, uint8_t* dst_raw, int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld4.8 {d1, d2, d3, d4}, [%0]! \n" // load 8 pixels of ARGB. + "subs %2, %2, #8 \n" // 8 processed per loop. +@@ -1522,7 +1534,7 @@ void ARGBToRAWRow_NEON(const uint8_t* sr + } + + void YUY2ToYRow_NEON(const uint8_t* src_yuy2, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld2.8 {q0, q1}, [%0]! \n" // load 16 pixels of YUY2. + "subs %2, %2, #16 \n" // 16 processed per loop. +@@ -1537,7 +1549,7 @@ void YUY2ToYRow_NEON(const uint8_t* src_ + } + + void UYVYToYRow_NEON(const uint8_t* src_uyvy, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld2.8 {q0, q1}, [%0]! \n" // load 16 pixels of UYVY. + "subs %2, %2, #16 \n" // 16 processed per loop. +@@ -1555,7 +1567,7 @@ void YUY2ToUV422Row_NEON(const uint8_t* + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // load 16 pixels of YUY2. + "subs %3, %3, #16 \n" // 16 pixels = 8 UVs. +@@ -1575,7 +1587,7 @@ void UYVYToUV422Row_NEON(const uint8_t* + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // load 16 pixels of UYVY. + "subs %3, %3, #16 \n" // 16 pixels = 8 UVs. +@@ -1596,7 +1608,7 @@ void YUY2ToUVRow_NEON(const uint8_t* src + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "add %1, %0, %1 \n" // stride + src_yuy2 + "1: \n" + "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // load 16 pixels of YUY2. +@@ -1623,7 +1635,7 @@ void UYVYToUVRow_NEON(const uint8_t* src + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "add %1, %0, %1 \n" // stride + src_uyvy + "1: \n" + "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // load 16 pixels of UYVY. +@@ -1649,7 +1661,7 @@ void YUY2ToNVUVRow_NEON(const uint8_t* s + int stride_yuy2, + uint8_t* dst_uv, + int width) { +- asm volatile ( ++ asm volatile( + "add %1, %0, %1 \n" // stride + src_yuy2 + "1: \n" + "vld2.8 {q0, q1}, [%0]! \n" // load 16 pixels of YUY2. +@@ -1673,7 +1685,7 @@ void ARGBShuffleRow_NEON(const uint8_t* + uint8_t* dst_argb, + const uint8_t* shuffler, + int width) { +- asm volatile ( ++ asm volatile( + "vld1.8 {q2}, [%3] \n" // shuffler + "1: \n" + "vld1.8 {q0}, [%0]! \n" // load 4 pixels. +@@ -1695,7 +1707,7 @@ void I422ToYUY2Row_NEON(const uint8_t* s + const uint8_t* src_v, + uint8_t* dst_yuy2, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld2.8 {d0, d2}, [%0]! \n" // load 16 Ys + "vld1.8 {d1}, [%1]! \n" // load 8 Us +@@ -1717,7 +1729,7 @@ void I422ToUYVYRow_NEON(const uint8_t* s + const uint8_t* src_v, + uint8_t* dst_uyvy, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld2.8 {d1, d3}, [%0]! \n" // load 16 Ys + "vld1.8 {d0}, [%1]! \n" // load 8 Us +@@ -1737,7 +1749,7 @@ void I422ToUYVYRow_NEON(const uint8_t* s + void ARGBToRGB565Row_NEON(const uint8_t* src_argb, + uint8_t* dst_rgb565, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld4.8 {d0, d2, d4, d6}, [%0]! \n" // load 8 pixels of ARGB. + "subs %2, %2, #8 \n" // 8 processed per loop. +@@ -1753,9 +1765,9 @@ void ARGBToRGB565Row_NEON(const uint8_t* + + void ARGBToRGB565DitherRow_NEON(const uint8_t* src_argb, + uint8_t* dst_rgb, +- uint32_t dither4, ++ const uint32_t dither4, + int width) { +- asm volatile ( ++ asm volatile( + "vdup.32 d7, %2 \n" // dither4 + "1: \n" + "vld4.8 {d0, d2, d4, d6}, [%1]! \n" // load 8 pixels of ARGB. +@@ -1776,7 +1788,7 @@ void ARGBToRGB565DitherRow_NEON(const ui + void ARGBToARGB1555Row_NEON(const uint8_t* src_argb, + uint8_t* dst_argb1555, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld4.8 {d0, d2, d4, d6}, [%0]! \n" // load 8 pixels of ARGB. + "subs %2, %2, #8 \n" // 8 processed per loop. +@@ -1793,7 +1805,7 @@ void ARGBToARGB1555Row_NEON(const uint8_ + void ARGBToARGB4444Row_NEON(const uint8_t* src_argb, + uint8_t* dst_argb4444, + int width) { +- asm volatile ( ++ asm volatile( + "vmov.u8 d7, #0x0f \n" // bits to clear with + // vbic. + "1: \n" +@@ -1812,7 +1824,7 @@ void ARGBToARGB4444Row_NEON(const uint8_ + void ARGBExtractAlphaRow_NEON(const uint8_t* src_argb, + uint8_t* dst_a, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld4.8 {d0, d2, d4, d6}, [%0]! \n" // load 8 ARGB pixels + "vld4.8 {d1, d3, d5, d7}, [%0]! \n" // load next 8 ARGB pixels +@@ -1827,27 +1839,19 @@ void ARGBExtractAlphaRow_NEON(const uint + ); + } + +-struct RgbUVConstants { +- uint8_t kRGBToU[4]; +- uint8_t kRGBToV[4]; +-}; +- + // 8x1 pixels. +-void ARGBToUV444MatrixRow_NEON(const uint8_t* src_argb, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width, +- const struct RgbUVConstants* rgbuvconstants) { +- asm volatile ( +- +- "vld1.8 {d0}, [%4] \n" // load rgbuvconstants +- "vdup.u8 d24, d0[0] \n" // UB 0.875 coefficient +- "vdup.u8 d25, d0[1] \n" // UG -0.5781 coefficient +- "vdup.u8 d26, d0[2] \n" // UR -0.2969 coefficient +- "vdup.u8 d27, d0[4] \n" // VB -0.1406 coefficient +- "vdup.u8 d28, d0[5] \n" // VG -0.7344 coefficient ++void ARGBToUV444Row_NEON(const uint8_t* src_argb, ++ uint8_t* dst_u, ++ uint8_t* dst_v, ++ int width) { ++ asm volatile( ++ "vmov.u8 d24, #112 \n" // UB / VR 0.875 ++ // coefficient ++ "vmov.u8 d25, #74 \n" // UG -0.5781 coefficient ++ "vmov.u8 d26, #38 \n" // UR -0.2969 coefficient ++ "vmov.u8 d27, #18 \n" // VB -0.1406 coefficient ++ "vmov.u8 d28, #94 \n" // VG -0.7344 coefficient + "vmov.u16 q15, #0x8080 \n" // 128.5 +- + "1: \n" + "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // load 8 ARGB pixels. + "subs %3, %3, #8 \n" // 8 processed per loop. +@@ -1865,34 +1869,15 @@ void ARGBToUV444MatrixRow_NEON(const uin + "vst1.8 {d0}, [%1]! \n" // store 8 pixels U. + "vst1.8 {d1}, [%2]! \n" // store 8 pixels V. + "bgt 1b \n" +- : "+r"(src_argb), // %0 +- "+r"(dst_u), // %1 +- "+r"(dst_v), // %2 +- "+r"(width) // %3 +- : "r"(rgbuvconstants) // %4 ++ : "+r"(src_argb), // %0 ++ "+r"(dst_u), // %1 ++ "+r"(dst_v), // %2 ++ "+r"(width) // %3 ++ : + : "cc", "memory", "q0", "q1", "q2", "q3", "q4", "q12", "q13", "q14", + "q15"); + } + +-// RGB to bt601 coefficients +-// UB 0.875 coefficient = 112 +-// UG -0.5781 coefficient = 74 +-// UR -0.2969 coefficient = 38 +-// VB -0.1406 coefficient = 18 +-// VG -0.7344 coefficient = 94 +-// VR 0.875 coefficient = 112 (ignored) +- +-static const struct RgbUVConstants kRgb24I601UVConstants = {{112, 74, 38, 0}, +- {18, 94, 112, 0}}; +- +-void ARGBToUV444Row_NEON(const uint8_t* src_argb, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width) { +- ARGBToUV444MatrixRow_NEON(src_argb, dst_u, dst_v, width, +- &kRgb24I601UVConstants); +-} +- + // clang-format off + // 16x2 pixels -> 8x1. width is number of argb pixels. e.g. 16. + #define RGBTOUV(QB, QG, QR) \ +@@ -2366,7 +2351,7 @@ void RGB565ToUVRow_NEON(const uint8_t* s + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "add %1, %0, %1 \n" // src_stride + src_argb + "vmov.s16 q10, #112 / 2 \n" // UB / VR 0.875 + // coefficient +@@ -2432,7 +2417,7 @@ void ARGB1555ToUVRow_NEON(const uint8_t* + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "add %1, %0, %1 \n" // src_stride + src_argb + "vmov.s16 q10, #112 / 2 \n" // UB / VR 0.875 + // coefficient +@@ -2498,7 +2483,7 @@ void ARGB4444ToUVRow_NEON(const uint8_t* + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "add %1, %0, %1 \n" // src_stride + src_argb + "vmov.s16 q10, #112 / 2 \n" // UB / VR 0.875 + // coefficient +@@ -2550,7 +2535,7 @@ void ARGB4444ToUVRow_NEON(const uint8_t* + } + + void RGB565ToYRow_NEON(const uint8_t* src_rgb565, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "vmov.u8 d24, #25 \n" // B * 0.1016 coefficient + "vmov.u8 d25, #129 \n" // G * 0.5078 coefficient + "vmov.u8 d26, #66 \n" // R * 0.2578 coefficient +@@ -2576,7 +2561,7 @@ void RGB565ToYRow_NEON(const uint8_t* sr + void ARGB1555ToYRow_NEON(const uint8_t* src_argb1555, + uint8_t* dst_y, + int width) { +- asm volatile ( ++ asm volatile( + "vmov.u8 d24, #25 \n" // B * 0.1016 coefficient + "vmov.u8 d25, #129 \n" // G * 0.5078 coefficient + "vmov.u8 d26, #66 \n" // R * 0.2578 coefficient +@@ -2602,7 +2587,7 @@ void ARGB1555ToYRow_NEON(const uint8_t* + void ARGB4444ToYRow_NEON(const uint8_t* src_argb4444, + uint8_t* dst_y, + int width) { +- asm volatile ( ++ asm volatile( + "vmov.u8 d24, #25 \n" // B * 0.1016 coefficient + "vmov.u8 d25, #129 \n" // G * 0.5078 coefficient + "vmov.u8 d26, #66 \n" // R * 0.2578 coefficient +@@ -2628,7 +2613,7 @@ void ARGB4444ToYRow_NEON(const uint8_t* + void ARGBToAR64Row_NEON(const uint8_t* src_argb, + uint16_t* dst_ar64, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld1.8 {q0}, [%0]! \n" + "vld1.8 {q2}, [%0]! \n" +@@ -2651,7 +2636,7 @@ static const uvec8 kShuffleARGBToABGR = + void ARGBToAB64Row_NEON(const uint8_t* src_argb, + uint16_t* dst_ab64, + int width) { +- asm volatile ( ++ asm volatile( + "vld1.8 {q4}, [%3] \n" // shuffler + + "1: \n" +@@ -2677,7 +2662,7 @@ void ARGBToAB64Row_NEON(const uint8_t* s + void AR64ToARGBRow_NEON(const uint16_t* src_ar64, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld1.16 {q0}, [%0]! \n" + "vld1.16 {q1}, [%0]! \n" +@@ -2703,7 +2688,7 @@ static const uvec8 kShuffleAB64ToARGB = + void AB64ToARGBRow_NEON(const uint16_t* src_ab64, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "vld1.8 {d8}, [%3] \n" // shuffler + + "1: \n" +@@ -2729,6 +2714,7 @@ void AB64ToARGBRow_NEON(const uint16_t* + struct RgbConstants { + uint8_t kRGBToY[4]; + uint16_t kAddY; ++ uint16_t pad; + }; + + // RGB to JPeg coefficients +@@ -2736,9 +2722,11 @@ struct RgbConstants { + // G * 0.5870 coefficient = 150 + // R * 0.2990 coefficient = 77 + // Add 0.5 = 0x80 +-static const struct RgbConstants kRgb24JPEGConstants = {{29, 150, 77, 0}, 128}; ++static const struct RgbConstants kRgb24JPEGConstants = {{29, 150, 77, 0}, ++ 128, ++ 0}; + +-static const struct RgbConstants kRawJPEGConstants = {{77, 150, 29, 0}, 128}; ++static const struct RgbConstants kRawJPEGConstants = {{77, 150, 29, 0}, 128, 0}; + + // RGB to BT.601 coefficients + // B * 0.1016 coefficient = 25 +@@ -2747,16 +2735,19 @@ static const struct RgbConstants kRawJPE + // Add 16.5 = 0x1080 + + static const struct RgbConstants kRgb24I601Constants = {{25, 129, 66, 0}, +- 0x1080}; ++ 0x1080, ++ 0}; + +-static const struct RgbConstants kRawI601Constants = {{66, 129, 25, 0}, 0x1080}; ++static const struct RgbConstants kRawI601Constants = {{66, 129, 25, 0}, ++ 0x1080, ++ 0}; + + // ARGB expects first 3 values to contain RGB and 4th value is ignored. + void ARGBToYMatrixRow_NEON(const uint8_t* src_argb, + uint8_t* dst_y, + int width, + const struct RgbConstants* rgbconstants) { +- asm volatile ( ++ asm volatile( + "vld1.8 {d0}, [%3] \n" // load rgbconstants + "vdup.u8 d20, d0[0] \n" + "vdup.u8 d21, d0[1] \n" +@@ -2806,7 +2797,7 @@ void RGBAToYMatrixRow_NEON(const uint8_t + uint8_t* dst_y, + int width, + const struct RgbConstants* rgbconstants) { +- asm volatile ( ++ asm volatile( + "vld1.8 {d0}, [%3] \n" // load rgbconstants + "vdup.u8 d20, d0[0] \n" + "vdup.u8 d21, d0[1] \n" +@@ -2850,7 +2841,7 @@ void RGBToYMatrixRow_NEON(const uint8_t* + uint8_t* dst_y, + int width, + const struct RgbConstants* rgbconstants) { +- asm volatile ( ++ asm volatile( + "vld1.8 {d0}, [%3] \n" // load rgbconstants + "vdup.u8 d20, d0[0] \n" + "vdup.u8 d21, d0[1] \n" +@@ -2902,7 +2893,7 @@ void InterpolateRow_NEON(uint8_t* dst_pt + int dst_width, + int source_y_fraction) { + int y1_fraction = source_y_fraction; +- asm volatile ( ++ asm volatile( + "cmp %4, #0 \n" + "beq 100f \n" + "add %2, %1 \n" +@@ -2964,7 +2955,7 @@ void InterpolateRow_16_NEON(uint16_t* ds + int y0_fraction = 256 - y1_fraction; + const uint16_t* src_ptr1 = src_ptr + src_stride; + +- asm volatile ( ++ asm volatile( + "cmp %4, #0 \n" + "beq 100f \n" + "cmp %4, #128 \n" +@@ -3019,7 +3010,7 @@ void ARGBBlendRow_NEON(const uint8_t* sr + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "subs %3, #8 \n" + "blt 89f \n" + // Blend 8 pixels. +@@ -3078,9 +3069,7 @@ void ARGBBlendRow_NEON(const uint8_t* sr + void ARGBAttenuateRow_NEON(const uint8_t* src_argb, + uint8_t* dst_argb, + int width) { +- asm volatile ( +- "vmov.u16 q15, #0x00ff \n" // 255 for rounding up +- ++ asm volatile( + // Attenuate 8 pixels. + "1: \n" + "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // load 8 pixels of ARGB. +@@ -3088,16 +3077,16 @@ void ARGBAttenuateRow_NEON(const uint8_t + "vmull.u8 q10, d0, d3 \n" // b * a + "vmull.u8 q11, d1, d3 \n" // g * a + "vmull.u8 q12, d2, d3 \n" // r * a +- "vaddhn.u16 d0, q10, q15 \n" // (b + 255) >> 8 +- "vaddhn.u16 d1, q11, q15 \n" // (g + 255) >> 8 +- "vaddhn.u16 d2, q12, q15 \n" // (r + 255) >> 8 ++ "vqrshrn.u16 d0, q10, #8 \n" // b >>= 8 ++ "vqrshrn.u16 d1, q11, #8 \n" // g >>= 8 ++ "vqrshrn.u16 d2, q12, #8 \n" // r >>= 8 + "vst4.8 {d0, d1, d2, d3}, [%1]! \n" // store 8 pixels of ARGB. + "bgt 1b \n" + : "+r"(src_argb), // %0 + "+r"(dst_argb), // %1 + "+r"(width) // %2 + : +- : "cc", "memory", "q0", "q1", "q10", "q11", "q12", "q15"); ++ : "cc", "memory", "q0", "q1", "q10", "q11", "q12"); + } + + // Quantize 8 ARGB pixels (32 bytes). +@@ -3107,7 +3096,7 @@ void ARGBQuantizeRow_NEON(uint8_t* dst_a + int interval_size, + int interval_offset, + int width) { +- asm volatile ( ++ asm volatile( + "vdup.u16 q8, %2 \n" + "vshr.u16 q8, q8, #1 \n" // scale >>= 1 + "vdup.u16 q9, %3 \n" // interval multiply. +@@ -3149,7 +3138,7 @@ void ARGBShadeRow_NEON(const uint8_t* sr + uint8_t* dst_argb, + int width, + uint32_t value) { +- asm volatile ( ++ asm volatile( + "vdup.u32 q0, %3 \n" // duplicate scale value. + "vzip.u8 d0, d1 \n" // d0 aarrggbb. + "vshr.u16 q0, q0, #1 \n" // scale / 2. +@@ -3183,7 +3172,7 @@ void ARGBShadeRow_NEON(const uint8_t* sr + // Similar to ARGBToYJ but stores ARGB. + // C code is (29 * b + 150 * g + 77 * r + 128) >> 8; + void ARGBGrayRow_NEON(const uint8_t* src_argb, uint8_t* dst_argb, int width) { +- asm volatile ( ++ asm volatile( + "vmov.u8 d24, #29 \n" // B * 0.1140 coefficient + "vmov.u8 d25, #150 \n" // G * 0.5870 coefficient + "vmov.u8 d26, #77 \n" // R * 0.2990 coefficient +@@ -3210,7 +3199,7 @@ void ARGBGrayRow_NEON(const uint8_t* src + // g = (r * 45 + g * 88 + b * 22) >> 7 + // r = (r * 50 + g * 98 + b * 24) >> 7 + void ARGBSepiaRow_NEON(uint8_t* dst_argb, int width) { +- asm volatile ( ++ asm volatile( + "vmov.u8 d20, #17 \n" // BB coefficient + "vmov.u8 d21, #68 \n" // BG coefficient + "vmov.u8 d22, #35 \n" // BR coefficient +@@ -3251,7 +3240,7 @@ void ARGBColorMatrixRow_NEON(const uint8 + uint8_t* dst_argb, + const int8_t* matrix_argb, + int width) { +- asm volatile ( ++ asm volatile( + "vld1.8 {q2}, [%3] \n" // load 3 ARGB vectors. + "vmovl.s8 q0, d4 \n" // B,G coefficients s16. + "vmovl.s8 q1, d5 \n" // R,A coefficients s16. +@@ -3310,7 +3299,7 @@ void ARGBMultiplyRow_NEON(const uint8_t* + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + // 8 pixel loop. + "1: \n" + "vld4.8 {d0, d2, d4, d6}, [%0]! \n" // load 8 ARGB pixels. +@@ -3339,7 +3328,7 @@ void ARGBAddRow_NEON(const uint8_t* src_ + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + // 8 pixel loop. + "1: \n" + "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // load 8 ARGB pixels. +@@ -3362,7 +3351,7 @@ void ARGBSubtractRow_NEON(const uint8_t* + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + // 8 pixel loop. + "1: \n" + "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // load 8 ARGB pixels. +@@ -3389,7 +3378,7 @@ void SobelRow_NEON(const uint8_t* src_so + const uint8_t* src_sobely, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "vmov.u8 d3, #255 \n" // alpha + // 8 pixel loop. + "1: \n" +@@ -3414,7 +3403,7 @@ void SobelToPlaneRow_NEON(const uint8_t* + const uint8_t* src_sobely, + uint8_t* dst_y, + int width) { +- asm volatile ( ++ asm volatile( + // 16 pixel loop. + "1: \n" + "vld1.8 {q0}, [%0]! \n" // load 16 sobelx. +@@ -3440,7 +3429,7 @@ void SobelXYRow_NEON(const uint8_t* src_ + const uint8_t* src_sobely, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "vmov.u8 d3, #255 \n" // alpha + // 8 pixel loop. + "1: \n" +@@ -3467,7 +3456,7 @@ void SobelXRow_NEON(const uint8_t* src_y + const uint8_t* src_y2, + uint8_t* dst_sobelx, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld1.8 {d0}, [%0],%5 \n" // top + "vld1.8 {d1}, [%0],%6 \n" +@@ -3505,7 +3494,7 @@ void SobelYRow_NEON(const uint8_t* src_y + const uint8_t* src_y1, + uint8_t* dst_sobely, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld1.8 {d0}, [%0],%4 \n" // left + "vld1.8 {d1}, [%1],%4 \n" +@@ -3542,7 +3531,7 @@ void HalfFloat1Row_NEON(const uint16_t* + uint16_t* dst, + float /*unused*/, + int width) { +- asm volatile ( ++ asm volatile( + + "1: \n" + "vld1.8 {q1}, [%0]! \n" // load 8 shorts +@@ -3568,7 +3557,7 @@ void HalfFloatRow_NEON(const uint16_t* s + uint16_t* dst, + float scale, + int width) { +- asm volatile ( ++ asm volatile( + + "1: \n" + "vld1.8 {q1}, [%0]! \n" // load 8 shorts +@@ -3594,7 +3583,7 @@ void ByteToFloatRow_NEON(const uint8_t* + float* dst, + float scale, + int width) { +- asm volatile ( ++ asm volatile( + + "1: \n" + "vld1.8 {d2}, [%0]! \n" // load 8 bytes +@@ -3623,7 +3612,7 @@ void GaussCol_NEON(const uint16_t* src0, + const uint16_t* src4, + uint32_t* dst, + int width) { +- asm volatile ( ++ asm volatile( + "vmov.u16 d6, #4 \n" // constant 4 + "vmov.u16 d7, #6 \n" // constant 6 + +@@ -3660,7 +3649,7 @@ void GaussRow_NEON(const uint32_t* src, + const uint32_t* src1 = src + 1; + const uint32_t* src2 = src + 2; + const uint32_t* src3 = src + 3; +- asm volatile ( ++ asm volatile( + "vmov.u32 q10, #4 \n" // constant 4 + "vmov.u32 q11, #6 \n" // constant 6 + +@@ -3698,7 +3687,7 @@ void NV21ToYUV24Row_NEON(const uint8_t* + const uint8_t* src_vu, + uint8_t* dst_yuv24, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld1.8 {q2}, [%0]! \n" // load 16 Y values + "vld2.8 {d0, d2}, [%1]! \n" // load 8 VU values +@@ -3722,7 +3711,7 @@ void AYUVToUVRow_NEON(const uint8_t* src + int src_stride_ayuv, + uint8_t* dst_uv, + int width) { +- asm volatile ( ++ asm volatile( + "add %1, %0, %1 \n" // src_stride + src_AYUV + "1: \n" + "vld4.8 {d0, d2, d4, d6}, [%0]! \n" // load 8 AYUV pixels. +@@ -3753,7 +3742,7 @@ void AYUVToVURow_NEON(const uint8_t* src + int src_stride_ayuv, + uint8_t* dst_vu, + int width) { +- asm volatile ( ++ asm volatile( + "add %1, %0, %1 \n" // src_stride + src_AYUV + "1: \n" + "vld4.8 {d0, d2, d4, d6}, [%0]! \n" // load 8 AYUV pixels. +@@ -3783,7 +3772,7 @@ void AYUVToVURow_NEON(const uint8_t* src + // Copy row of AYUV Y's into Y. + // Similar to ARGBExtractAlphaRow_NEON + void AYUVToYRow_NEON(const uint8_t* src_ayuv, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld4.8 {d0, d2, d4, d6}, [%0]! \n" // load 8 AYUV pixels + "vld4.8 {d1, d3, d5, d7}, [%0]! \n" // load next 8 AYUV pixels +@@ -3799,11 +3788,11 @@ void AYUVToYRow_NEON(const uint8_t* src_ + + // Convert UV plane of NV12 to VU of NV21. + void SwapUVRow_NEON(const uint8_t* src_uv, uint8_t* dst_vu, int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld2.8 {d0, d2}, [%0]! \n" // load 16 UV values + "vld2.8 {d1, d3}, [%0]! \n" +- "vmov.u8 q2, q0 \n" // move U after V ++ "vorr.u8 q2, q0, q0 \n" // move U after V + "subs %2, %2, #16 \n" // 16 pixels per loop + "vst2.8 {q1, q2}, [%1]! \n" // store 16 VU pixels + "bgt 1b \n" +@@ -3822,7 +3811,7 @@ void HalfMergeUVRow_NEON(const uint8_t* + int width) { + const uint8_t* src_u_1 = src_u + src_stride_u; + const uint8_t* src_v_1 = src_v + src_stride_v; +- asm volatile ( ++ asm volatile( + "1: \n" + "vld1.8 {q0}, [%0]! \n" // load 16 U values + "vld1.8 {q1}, [%2]! \n" // load 16 V values +@@ -3853,7 +3842,7 @@ void SplitUVRow_16_NEON(const uint16_t* + int depth, + int width) { + int shift = depth - 16; // Negative for right shift. +- asm volatile ( ++ asm volatile( + "vdup.16 q2, %4 \n" + "1: \n" + "vld2.16 {q0, q1}, [%0]! \n" // load 8 UV +@@ -3868,7 +3857,7 @@ void SplitUVRow_16_NEON(const uint16_t* + "+r"(dst_v), // %2 + "+r"(width) // %3 + : "r"(shift) // %4 +- : "cc", "memory", "q0", "q1", "q2"); ++ : "cc", "memory", "q0", "q1", "q2", "q3", "q4"); + } + + void MergeUVRow_16_NEON(const uint16_t* src_u, +@@ -3877,7 +3866,7 @@ void MergeUVRow_16_NEON(const uint16_t* + int depth, + int width) { + int shift = 16 - depth; +- asm volatile ( ++ asm volatile( + "vdup.16 q2, %4 \n" + "1: \n" + "vld1.16 {q0}, [%0]! \n" // load 8 U +@@ -3899,7 +3888,7 @@ void MultiplyRow_16_NEON(const uint16_t* + uint16_t* dst_y, + int scale, + int width) { +- asm volatile ( ++ asm volatile( + "vdup.16 q2, %3 \n" + "1: \n" + "vld1.16 {q0}, [%0]! \n" +@@ -3921,7 +3910,7 @@ void DivideRow_16_NEON(const uint16_t* s + uint16_t* dst_y, + int scale, + int width) { +- asm volatile ( ++ asm volatile( + "vdup.16 d8, %3 \n" + "1: \n" + "vld1.16 {q2, q3}, [%0]! \n" +@@ -3953,7 +3942,7 @@ void Convert16To8Row_NEON(const uint16_t + int scale, + int width) { + int shift = 15 - __builtin_clz((int32_t)scale); // Negative shl is shr +- asm volatile ( ++ asm volatile( + "vdup.16 q2, %3 \n" + "1: \n" + "vld1.16 {q0}, [%0]! \n" +diff --git a/media/libyuv/libyuv/source/row_neon64.cc b/media/libyuv/libyuv/source/row_neon64.cc +--- a/media/libyuv/libyuv/source/row_neon64.cc ++++ b/media/libyuv/libyuv/source/row_neon64.cc +@@ -28,67 +28,35 @@ extern "C" { + // Read 8 Y, 4 U and 4 V from 422 + #define READYUV422 \ + "ldr d0, [%[src_y]], #8 \n" \ +- "ldr s1, [%[src_u]], #4 \n" \ +- "ldr s2, [%[src_v]], #4 \n" \ ++ "ld1 {v1.s}[0], [%[src_u]], #4 \n" \ ++ "ld1 {v1.s}[1], [%[src_v]], #4 \n" \ + "zip1 v0.16b, v0.16b, v0.16b \n" \ + "prfm pldl1keep, [%[src_y], 448] \n" \ +- "zip1 v1.8b, v1.8b, v1.8b \n" \ +- "zip1 v2.8b, v2.8b, v2.8b \n" \ +- "prfm pldl1keep, [%[src_u], 128] \n" \ +- "prfm pldl1keep, [%[src_v], 128] \n" +- +-// Read 8 Y, 4 U and 4 V from 210 +-#define READYUV210 \ +- "ldr q2, [%[src_y]], #16 \n" \ +- "ldr d1, [%[src_u]], #8 \n" \ +- "ldr d3, [%[src_v]], #8 \n" \ +- "shl v0.8h, v2.8h, #6 \n" \ +- "usra v0.8h, v2.8h, #4 \n" \ +- "prfm pldl1keep, [%[src_y], 448] \n" \ +- "zip1 v2.8h, v3.8h, v3.8h \n" \ +- "zip1 v3.8h, v1.8h, v1.8h \n" \ +- "uqshrn v1.8b, v3.8h, #2 \n" \ +- "uqshrn2 v1.16b, v2.8h, #2 \n" \ +- "prfm pldl1keep, [%[src_u], 128] \n" \ +- "prfm pldl1keep, [%[src_v], 128] \n" +- +-// Read 8 Y, 8 U and 8 V from 410 +-#define READYUV410 \ +- "ldr q1, [%[src_y]], #16 \n" \ +- "ldr q2, [%[src_u]], #16 \n" \ +- "ldr q3, [%[src_v]], #16 \n" \ +- "shl v0.8h, v1.8h, #6 \n" \ +- "usra v0.8h, v1.8h, #4 \n" \ +- "prfm pldl1keep, [%[src_y], 448] \n" \ +- "uqshrn v1.8b, v2.8h, #2 \n" \ +- "uqshrn2 v1.16b, v3.8h, #2 \n" \ ++ "zip1 v1.16b, v1.16b, v1.16b \n" \ + "prfm pldl1keep, [%[src_u], 128] \n" \ + "prfm pldl1keep, [%[src_v], 128] \n" + + // Read 8 Y, 8 U and 8 V from 444 + #define READYUV444 \ + "ldr d0, [%[src_y]], #8 \n" \ +- "ldr d1, [%[src_u]], #8 \n" \ +- "ldr d2, [%[src_v]], #8 \n" \ ++ "ld1 {v1.d}[0], [%[src_u]], #8 \n" \ + "prfm pldl1keep, [%[src_y], 448] \n" \ ++ "ld1 {v1.d}[1], [%[src_v]], #8 \n" \ + "prfm pldl1keep, [%[src_u], 448] \n" \ + "zip1 v0.16b, v0.16b, v0.16b \n" \ + "prfm pldl1keep, [%[src_v], 448] \n" + +-// Read 8 Y ++// Read 8 Y, and set 4 U and 4 V to 128 + #define READYUV400 \ + "ldr d0, [%[src_y]], #8 \n" \ ++ "movi v1.16b, #128 \n" \ + "prfm pldl1keep, [%[src_y], 448] \n" \ + "zip1 v0.16b, v0.16b, v0.16b \n" + + static const uvec8 kNV12Table = {0, 0, 2, 2, 4, 4, 6, 6, + 1, 1, 3, 3, 5, 5, 7, 7}; +-static const uvec8 kNV12InterleavedTable = {0, 0, 4, 4, 8, 8, 12, 12, +- 2, 2, 6, 6, 10, 10, 14, 14}; + static const uvec8 kNV21Table = {1, 1, 3, 3, 5, 5, 7, 7, + 0, 0, 2, 2, 4, 4, 6, 6}; +-static const uvec8 kNV21InterleavedTable = {1, 1, 5, 5, 9, 9, 13, 13, +- 3, 3, 7, 7, 11, 11, 15, 15}; + + // Read 8 Y and 4 UV from NV12 or NV21 + #define READNV12 \ +@@ -100,17 +68,17 @@ static const uvec8 kNV21InterleavedTable + "prfm pldl1keep, [%[src_uv], 448] \n" + + // Read 8 YUY2 +-#define READYUY2 \ +- "ld1 {v3.16b}, [%[src_yuy2]], #16 \n" \ +- "trn1 v0.16b, v3.16b, v3.16b \n" \ +- "prfm pldl1keep, [%[src_yuy2], 448] \n" \ +- "tbl v1.16b, {v3.16b}, v2.16b \n" ++#define READYUY2 \ ++ "ld2 {v0.8b, v1.8b}, [%[src_yuy2]], #16 \n" \ ++ "zip1 v0.16b, v0.16b, v0.16b \n" \ ++ "prfm pldl1keep, [%[src_yuy2], 448] \n" \ ++ "tbl v1.16b, {v1.16b}, v2.16b \n" + + // Read 8 UYVY +-#define READUYVY \ +- "ld1 {v3.16b}, [%[src_uyvy]], #16 \n" \ +- "trn2 v0.16b, v3.16b, v3.16b \n" \ +- "prfm pldl1keep, [%[src_uyvy], 448] \n" \ ++#define READUYVY \ ++ "ld2 {v3.8b, v4.8b}, [%[src_uyvy]], #16 \n" \ ++ "zip1 v0.16b, v4.16b, v4.16b \n" \ ++ "prfm pldl1keep, [%[src_uyvy], 448] \n" \ + "tbl v1.16b, {v3.16b}, v2.16b \n" + + // UB VR UG VG +@@ -123,14 +91,14 @@ static const uvec8 kNV21InterleavedTable + // v17.8h: G + // v18.8h: R + +-// Convert from YUV (NV12 or NV21) to 2.14 fixed point RGB. +-// Similar to I4XXTORGB but U/V components are in the low/high halves of v1. +-#define NVTORGB \ ++// Convert from YUV to 2.14 fixed point RGB ++#define YUVTORGB \ + "umull2 v3.4s, v0.8h, v24.8h \n" \ + "umull v6.8h, v1.8b, v30.8b \n" \ + "umull v0.4s, v0.4h, v24.4h \n" \ + "umlal2 v6.8h, v1.16b, v31.16b \n" /* DG */ \ +- "uzp2 v0.8h, v0.8h, v3.8h \n" /* Y */ \ ++ "uqshrn v0.4h, v0.4s, #16 \n" \ ++ "uqshrn2 v0.8h, v3.4s, #16 \n" /* Y */ \ + "umull v4.8h, v1.8b, v28.8b \n" /* DB */ \ + "umull2 v5.8h, v1.16b, v29.16b \n" /* DR */ \ + "add v17.8h, v0.8h, v26.8h \n" /* G */ \ +@@ -140,69 +108,15 @@ static const uvec8 kNV21InterleavedTable + "uqsub v16.8h, v16.8h, v25.8h \n" /* B */ \ + "uqsub v18.8h, v18.8h, v27.8h \n" /* R */ + +-// Convert from YUV (I444 or I420) to 2.14 fixed point RGB. +-// Similar to NVTORGB but U/V components are in v1/v2. +-#define I4XXTORGB \ +- "umull2 v3.4s, v0.8h, v24.8h \n" \ +- "umull v6.8h, v1.8b, v30.8b \n" \ +- "umull v0.4s, v0.4h, v24.4h \n" \ +- "umlal v6.8h, v2.8b, v31.8b \n" /* DG */ \ +- "uzp2 v0.8h, v0.8h, v3.8h \n" /* Y */ \ +- "umull v4.8h, v1.8b, v28.8b \n" /* DB */ \ +- "umull v5.8h, v2.8b, v29.8b \n" /* DR */ \ +- "add v17.8h, v0.8h, v26.8h \n" /* G */ \ +- "add v16.8h, v0.8h, v4.8h \n" /* B */ \ +- "add v18.8h, v0.8h, v5.8h \n" /* R */ \ +- "uqsub v17.8h, v17.8h, v6.8h \n" /* G */ \ +- "uqsub v16.8h, v16.8h, v25.8h \n" /* B */ \ +- "uqsub v18.8h, v18.8h, v27.8h \n" /* R */ +- +-// Convert from YUV I400 to 2.14 fixed point RGB +-#define I400TORGB \ +- "umull2 v3.4s, v0.8h, v24.8h \n" \ +- "umull v0.4s, v0.4h, v24.4h \n" \ +- "uzp2 v0.8h, v0.8h, v3.8h \n" /* Y */ \ +- "add v17.8h, v0.8h, v26.8h \n" /* G */ \ +- "add v16.8h, v0.8h, v4.8h \n" /* B */ \ +- "add v18.8h, v0.8h, v5.8h \n" /* R */ \ +- "uqsub v17.8h, v17.8h, v6.8h \n" /* G */ \ +- "uqsub v16.8h, v16.8h, v25.8h \n" /* B */ \ +- "uqsub v18.8h, v18.8h, v27.8h \n" /* R */ +- + // Convert from 2.14 fixed point RGB To 8 bit RGB + #define RGBTORGB8 \ + "uqshrn v17.8b, v17.8h, #6 \n" \ + "uqshrn v16.8b, v16.8h, #6 \n" \ + "uqshrn v18.8b, v18.8h, #6 \n" + +-// Convert from 2.14 fixed point RGB to 8 bit RGB, placing the results in the +-// top half of each lane. +-#define RGBTORGB8_TOP \ +- "uqshl v17.8h, v17.8h, #2 \n" \ +- "uqshl v16.8h, v16.8h, #2 \n" \ +- "uqshl v18.8h, v18.8h, #2 \n" +- +-// Store 2.14 fixed point RGB as AR30 elements +-#define STOREAR30 \ +- /* Inputs: \ +- * v16.8h: xxbbbbbbbbbbxxxx \ +- * v17.8h: xxggggggggggxxxx \ +- * v18.8h: xxrrrrrrrrrrxxxx \ +- * v22.8h: 0011111111110000 (umin limit) \ +- * v23.8h: 1100000000000000 (alpha) \ +- */ \ +- "uqshl v0.8h, v16.8h, #2 \n" /* bbbbbbbbbbxxxxxx */ \ +- "uqshl v1.8h, v17.8h, #2 \n" /* ggggggggggxxxxxx */ \ +- "umin v2.8h, v18.8h, v22.8h \n" /* 00rrrrrrrrrrxxxx */ \ +- "shl v4.8h, v1.8h, #4 \n" /* ggggggxxxxxx0000 */ \ +- "orr v5.16b, v2.16b, v23.16b \n" /* 11rrrrrrrrrrxxxx */ \ +- "sri v4.8h, v0.8h, #6 \n" /* ggggggbbbbbbbbbb */ \ +- "sri v5.8h, v1.8h, #12 \n" /* 11rrrrrrrrrrgggg */ \ +- "st2 {v4.8h, v5.8h}, [%[dst_ar30]], #32 \n" +- +-#define YUVTORGB_REGS \ +- "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", "v17", "v18", "v24", \ +- "v25", "v26", "v27", "v28", "v29", "v30", "v31" ++#define YUVTORGB_REGS \ ++ "v0", "v1", "v3", "v4", "v5", "v6", "v7", "v16", "v17", "v18", "v24", "v25", \ ++ "v26", "v27", "v28", "v29", "v30", "v31" + + void I444ToARGBRow_NEON(const uint8_t* src_y, + const uint8_t* src_u, +@@ -210,10 +124,10 @@ void I444ToARGBRow_NEON(const uint8_t* s + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "movi v19.8b, #255 \n" /* A */ +- "1: \n" READYUV444 I4XXTORGB ++ "1: \n" READYUV444 YUVTORGB + RGBTORGB8 + "subs %w[width], %w[width], #8 \n" + "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" +@@ -234,9 +148,9 @@ void I444ToRGB24Row_NEON(const uint8_t* + uint8_t* dst_rgb24, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP +- "1: \n" READYUV444 I4XXTORGB ++ "1: \n" READYUV444 YUVTORGB + RGBTORGB8 + "subs %w[width], %w[width], #8 \n" + "st3 {v16.8b,v17.8b,v18.8b}, [%[dst_rgb24]], #24 \n" +@@ -251,116 +165,16 @@ void I444ToRGB24Row_NEON(const uint8_t* + : "cc", "memory", YUVTORGB_REGS); + } + +-void I210ToAR30Row_NEON(const uint16_t* src_y, +- const uint16_t* src_u, +- const uint16_t* src_v, +- uint8_t* dst_ar30, +- const struct YuvConstants* yuvconstants, +- int width) { +- const uvec8* uv_coeff = &yuvconstants->kUVCoeff; +- const vec16* rgb_coeff = &yuvconstants->kRGBCoeffBias; +- uint16_t limit = 0x3ff0; +- uint16_t alpha = 0xc000; +- asm volatile (YUVTORGB_SETUP +- "dup v22.8h, %w[limit] \n" +- "dup v23.8h, %w[alpha] \n" +- "1: \n" READYUV210 NVTORGB +- "subs %w[width], %w[width], #8 \n" STOREAR30 +- "b.gt 1b \n" +- : [src_y] "+r"(src_y), // %[src_y] +- [src_u] "+r"(src_u), // %[src_u] +- [src_v] "+r"(src_v), // %[src_v] +- [dst_ar30] "+r"(dst_ar30), // %[dst_ar30] +- [width] "+r"(width) // %[width] +- : [kUVCoeff] "r"(uv_coeff), // %[kUVCoeff] +- [kRGBCoeffBias] "r"(rgb_coeff), // %[kRGBCoeffBias] +- [limit] "r"(limit), // %[limit] +- [alpha] "r"(alpha) // %[alpha] +- : "cc", "memory", YUVTORGB_REGS, "v22", "v23"); +-} +- +-void I410ToAR30Row_NEON(const uint16_t* src_y, +- const uint16_t* src_u, +- const uint16_t* src_v, +- uint8_t* dst_ar30, +- const struct YuvConstants* yuvconstants, +- int width) { +- const uvec8* uv_coeff = &yuvconstants->kUVCoeff; +- const vec16* rgb_coeff = &yuvconstants->kRGBCoeffBias; +- uint16_t limit = 0x3ff0; +- uint16_t alpha = 0xc000; +- asm volatile (YUVTORGB_SETUP +- "dup v22.8h, %w[limit] \n" +- "dup v23.8h, %w[alpha] \n" +- "1: \n" READYUV410 NVTORGB +- "subs %w[width], %w[width], #8 \n" STOREAR30 +- "b.gt 1b \n" +- : [src_y] "+r"(src_y), // %[src_y] +- [src_u] "+r"(src_u), // %[src_u] +- [src_v] "+r"(src_v), // %[src_v] +- [dst_ar30] "+r"(dst_ar30), // %[dst_ar30] +- [width] "+r"(width) // %[width] +- : [kUVCoeff] "r"(uv_coeff), // %[kUVCoeff] +- [kRGBCoeffBias] "r"(rgb_coeff), // %[kRGBCoeffBias] +- [limit] "r"(limit), // %[limit] +- [alpha] "r"(alpha) // %[alpha] +- : "cc", "memory", YUVTORGB_REGS, "v22", "v23"); +-} +- +-void I210ToARGBRow_NEON(const uint16_t* src_y, +- const uint16_t* src_u, +- const uint16_t* src_v, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width) { +- asm volatile (YUVTORGB_SETUP +- "movi v19.8b, #255 \n" +- "1: \n" READYUV210 NVTORGB RGBTORGB8 +- "subs %w[width], %w[width], #8 \n" +- "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" +- "b.gt 1b \n" +- : [src_y] "+r"(src_y), // %[src_y] +- [src_u] "+r"(src_u), // %[src_u] +- [src_v] "+r"(src_v), // %[src_v] +- [dst_argb] "+r"(dst_argb), // %[dst_argb] +- [width] "+r"(width) // %[width] +- : [kUVCoeff] "r"(&yuvconstants->kUVCoeff), // %[kUVCoeff] +- [kRGBCoeffBias] "r"(&yuvconstants->kRGBCoeffBias) // %[kRGBCoeffBias] +- : "cc", "memory", YUVTORGB_REGS, "v19"); +-} +- +-void I410ToARGBRow_NEON(const uint16_t* src_y, +- const uint16_t* src_u, +- const uint16_t* src_v, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width) { +- asm volatile (YUVTORGB_SETUP +- "movi v19.8b, #255 \n" +- "1: \n" READYUV410 NVTORGB RGBTORGB8 +- "subs %w[width], %w[width], #8 \n" +- "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" +- "b.gt 1b \n" +- : [src_y] "+r"(src_y), // %[src_y] +- [src_u] "+r"(src_u), // %[src_u] +- [src_v] "+r"(src_v), // %[src_v] +- [dst_argb] "+r"(dst_argb), // %[dst_argb] +- [width] "+r"(width) // %[width] +- : [kUVCoeff] "r"(&yuvconstants->kUVCoeff), // %[kUVCoeff] +- [kRGBCoeffBias] "r"(&yuvconstants->kRGBCoeffBias) // %[kRGBCoeffBias] +- : "cc", "memory", YUVTORGB_REGS, "v19"); +-} +- + void I422ToARGBRow_NEON(const uint8_t* src_y, + const uint8_t* src_u, + const uint8_t* src_v, + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "movi v19.8b, #255 \n" /* A */ +- "1: \n" READYUV422 I4XXTORGB ++ "1: \n" READYUV422 YUVTORGB + RGBTORGB8 + "subs %w[width], %w[width], #8 \n" + "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" +@@ -382,61 +196,11 @@ void I444AlphaToARGBRow_NEON(const uint8 + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "1: \n" + "ld1 {v19.8b}, [%[src_a]], #8 \n" READYUV444 +- "prfm pldl1keep, [%[src_a], 448] \n" I4XXTORGB RGBTORGB8 +- "subs %w[width], %w[width], #8 \n" +- "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" +- "b.gt 1b \n" +- : [src_y] "+r"(src_y), // %[src_y] +- [src_u] "+r"(src_u), // %[src_u] +- [src_v] "+r"(src_v), // %[src_v] +- [src_a] "+r"(src_a), // %[src_a] +- [dst_argb] "+r"(dst_argb), // %[dst_argb] +- [width] "+r"(width) // %[width] +- : [kUVCoeff] "r"(&yuvconstants->kUVCoeff), // %[kUVCoeff] +- [kRGBCoeffBias] "r"(&yuvconstants->kRGBCoeffBias) // %[kRGBCoeffBias] +- : "cc", "memory", YUVTORGB_REGS, "v19"); +-} +- +-void I410AlphaToARGBRow_NEON(const uint16_t* src_y, +- const uint16_t* src_u, +- const uint16_t* src_v, +- const uint16_t* src_a, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width) { +- asm volatile (YUVTORGB_SETUP +- "1: \n" +- "ld1 {v19.16b}, [%[src_a]], #16 \n" READYUV410 +- "uqshrn v19.8b, v19.8h, #2 \n" NVTORGB RGBTORGB8 +- "subs %w[width], %w[width], #8 \n" +- "st4 {v16.8b, v17.8b, v18.8b, v19.8b}, [%[dst_argb]], #32 \n" +- "b.gt 1b \n" +- : [src_y] "+r"(src_y), // %[src_y] +- [src_u] "+r"(src_u), // %[src_u] +- [src_v] "+r"(src_v), // %[src_v] +- [src_a] "+r"(src_a), // %[src_a] +- [dst_argb] "+r"(dst_argb), // %[dst_argb] +- [width] "+r"(width) // %[width] +- : [kUVCoeff] "r"(&yuvconstants->kUVCoeff), // %[kUVCoeff] +- [kRGBCoeffBias] "r"(&yuvconstants->kRGBCoeffBias) // %[kRGBCoeffBias] +- : "cc", "memory", YUVTORGB_REGS, "v19"); +-} +- +-void I210AlphaToARGBRow_NEON(const uint16_t* src_y, +- const uint16_t* src_u, +- const uint16_t* src_v, +- const uint16_t* src_a, +- uint8_t* dst_argb, +- const struct YuvConstants* yuvconstants, +- int width) { +- asm volatile (YUVTORGB_SETUP +- "1: \n" +- "ld1 {v19.16b}, [%[src_a]], #16 \n" READYUV210 +- "uqshrn v19.8b, v19.8h, #2 \n" NVTORGB RGBTORGB8 ++ "prfm pldl1keep, [%[src_a], 448] \n" YUVTORGB RGBTORGB8 + "subs %w[width], %w[width], #8 \n" + "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" + "b.gt 1b \n" +@@ -458,11 +222,11 @@ void I422AlphaToARGBRow_NEON(const uint8 + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "1: \n" + "ld1 {v19.8b}, [%[src_a]], #8 \n" READYUV422 +- "prfm pldl1keep, [%[src_a], 448] \n" I4XXTORGB RGBTORGB8 ++ "prfm pldl1keep, [%[src_a], 448] \n" YUVTORGB RGBTORGB8 + "subs %w[width], %w[width], #8 \n" + "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" + "b.gt 1b \n" +@@ -483,10 +247,10 @@ void I422ToRGBARow_NEON(const uint8_t* s + uint8_t* dst_rgba, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "movi v15.8b, #255 \n" /* A */ +- "1: \n" READYUV422 I4XXTORGB ++ "1: \n" READYUV422 YUVTORGB + RGBTORGB8 + "subs %w[width], %w[width], #8 \n" + "st4 {v15.8b,v16.8b,v17.8b,v18.8b}, [%[dst_rgba]], #32 \n" +@@ -507,9 +271,9 @@ void I422ToRGB24Row_NEON(const uint8_t* + uint8_t* dst_rgb24, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP +- "1: \n" READYUV422 I4XXTORGB ++ "1: \n" READYUV422 YUVTORGB + RGBTORGB8 + "subs %w[width], %w[width], #8 \n" + "st3 {v16.8b,v17.8b,v18.8b}, [%[dst_rgb24]], #24 \n" +@@ -524,24 +288,12 @@ void I422ToRGB24Row_NEON(const uint8_t* + : "cc", "memory", YUVTORGB_REGS); + } + +-#define ARGBTORGB565 \ +- /* Inputs: \ +- * v16: bbbbbxxx \ +- * v17: ggggggxx \ +- * v18: rrrrrxxx */ \ +- "shll v18.8h, v18.8b, #8 \n" /* rrrrrrxx00000000 */ \ +- "shll v17.8h, v17.8b, #8 \n" /* gggggxxx00000000 */ \ +- "shll v16.8h, v16.8b, #8 \n" /* bbbbbbxx00000000 */ \ +- "sri v18.8h, v17.8h, #5 \n" /* rrrrrgggggg00000 */ \ +- "sri v18.8h, v16.8h, #11 \n" /* rrrrrggggggbbbbb */ +- +-#define ARGBTORGB565_FROM_TOP \ +- /* Inputs: \ +- * v16: bbbbbxxxxxxxxxxx \ +- * v17: ggggggxxxxxxxxxx \ +- * v18: rrrrrxxxxxxxxxxx */ \ +- "sri v18.8h, v17.8h, #5 \n" /* rrrrrgggggg00000 */ \ +- "sri v18.8h, v16.8h, #11 \n" /* rrrrrggggggbbbbb */ ++#define ARGBTORGB565 \ ++ "shll v18.8h, v18.8b, #8 \n" /* R */ \ ++ "shll v17.8h, v17.8b, #8 \n" /* G */ \ ++ "shll v16.8h, v16.8b, #8 \n" /* B */ \ ++ "sri v18.8h, v17.8h, #5 \n" /* RG */ \ ++ "sri v18.8h, v16.8h, #11 \n" /* RGB */ + + void I422ToRGB565Row_NEON(const uint8_t* src_y, + const uint8_t* src_u, +@@ -549,11 +301,10 @@ void I422ToRGB565Row_NEON(const uint8_t* + uint8_t* dst_rgb565, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP +- "1: \n" READYUV422 I4XXTORGB +- RGBTORGB8_TOP +- "subs %w[width], %w[width], #8 \n" ARGBTORGB565_FROM_TOP ++ "1: \n" READYUV422 YUVTORGB ++ RGBTORGB8 "subs %w[width], %w[width], #8 \n" ARGBTORGB565 + "st1 {v18.8h}, [%[dst_rgb565]], #16 \n" // store 8 pixels RGB565. + "b.gt 1b \n" + : [src_y] "+r"(src_y), // %[src_y] +@@ -566,24 +317,14 @@ void I422ToRGB565Row_NEON(const uint8_t* + : "cc", "memory", YUVTORGB_REGS); + } + +-#define ARGBTOARGB1555 \ +- /* Inputs: \ +- * v16: bbbbbxxx v17: gggggxxx v18: rrrrrxxx v19: axxxxxxx */ \ +- "shll v0.8h, v19.8b, #8 \n" /* axxxxxxx00000000 */ \ +- "shll v18.8h, v18.8b, #8 \n" /* rrrrrxxx00000000 */ \ +- "shll v17.8h, v17.8b, #8 \n" /* gggggxxx00000000 */ \ +- "shll v16.8h, v16.8b, #8 \n" /* bbbbbxxx00000000 */ \ +- "sri v0.8h, v18.8h, #1 \n" /* arrrrrxxx0000000 */ \ +- "sri v0.8h, v17.8h, #6 \n" /* arrrrrgggggxxx00 */ \ +- "sri v0.8h, v16.8h, #11 \n" /* arrrrrgggggbbbbb */ +- +-#define ARGBTOARGB1555_FROM_TOP \ +- /* Inputs: \ +- * v16: bbbbbxxxxxxxxxxx v17: gggggxxxxxxxxxxx \ +- * v18: rrrrrxxxxxxxxxxx v19: axxxxxxxxxxxxxxx */ \ +- "sri v19.8h, v18.8h, #1 \n" /* arrrrrxxxxxxxxxx */ \ +- "sri v19.8h, v17.8h, #6 \n" /* arrrrrgggggxxxxx */ \ +- "sri v19.8h, v16.8h, #11 \n" /* arrrrrgggggbbbbb */ ++#define ARGBTOARGB1555 \ ++ "shll v0.8h, v19.8b, #8 \n" /* A */ \ ++ "shll v18.8h, v18.8b, #8 \n" /* R */ \ ++ "shll v17.8h, v17.8b, #8 \n" /* G */ \ ++ "shll v16.8h, v16.8b, #8 \n" /* B */ \ ++ "sri v0.8h, v18.8h, #1 \n" /* AR */ \ ++ "sri v0.8h, v17.8h, #6 \n" /* ARG */ \ ++ "sri v0.8h, v16.8h, #11 \n" /* ARGB */ + + void I422ToARGB1555Row_NEON(const uint8_t* src_y, + const uint8_t* src_u, +@@ -591,14 +332,15 @@ void I422ToARGB1555Row_NEON(const uint8_ + uint8_t* dst_argb1555, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile (YUVTORGB_SETUP +- "movi v19.8h, #0x80, lsl #8 \n" +- "1: \n" // +- READYUV422 I4XXTORGB RGBTORGB8_TOP +- "subs %w[width], %w[width], #8 \n" // +- ARGBTOARGB1555_FROM_TOP +- "st1 {v19.8h}, [%[dst_argb1555]], #16 \n" // store 8 pixels RGB1555. +- "b.gt 1b \n" ++ asm volatile( ++ YUVTORGB_SETUP ++ "movi v19.8b, #255 \n" ++ "1: \n" READYUV422 YUVTORGB ++ RGBTORGB8 ++ "subs %w[width], %w[width], #8 \n" ARGBTOARGB1555 ++ "st1 {v0.8h}, [%[dst_argb1555]], #16 \n" // store 8 pixels ++ // RGB565. ++ "b.gt 1b \n" + : [src_y] "+r"(src_y), // %[src_y] + [src_u] "+r"(src_u), // %[src_u] + [src_v] "+r"(src_v), // %[src_v] +@@ -609,11 +351,15 @@ void I422ToARGB1555Row_NEON(const uint8_ + : "cc", "memory", YUVTORGB_REGS, "v19"); + } + +-#define ARGBTOARGB4444 \ +- /* Input v16.8b<=B, v17.8b<=G, v18.8b<=R, v19.8b<=A */ \ +- "sri v17.8b, v16.8b, #4 \n" /* BG */ \ +- "sri v19.8b, v18.8b, #4 \n" /* RA */ \ +- "zip1 v0.16b, v17.16b, v19.16b \n" /* BGRA */ ++#define ARGBTOARGB4444 \ ++ /* Input v16.8b<=B, v17.8b<=G, v18.8b<=R, v19.8b<=A, v23.8b<=0x0f */ \ ++ "ushr v16.8b, v16.8b, #4 \n" /* B */ \ ++ "bic v17.8b, v17.8b, v23.8b \n" /* G */ \ ++ "ushr v18.8b, v18.8b, #4 \n" /* R */ \ ++ "bic v19.8b, v19.8b, v23.8b \n" /* A */ \ ++ "orr v0.8b, v16.8b, v17.8b \n" /* BG */ \ ++ "orr v1.8b, v18.8b, v19.8b \n" /* RA */ \ ++ "zip1 v0.16b, v0.16b, v1.16b \n" /* BGRA */ + + void I422ToARGB4444Row_NEON(const uint8_t* src_y, + const uint8_t* src_u, +@@ -621,9 +367,11 @@ void I422ToARGB4444Row_NEON(const uint8_ + uint8_t* dst_argb4444, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP +- "1: \n" READYUV422 I4XXTORGB ++ "movi v23.16b, #0x0f \n" // bits to clear with ++ // vbic. ++ "1: \n" READYUV422 YUVTORGB + RGBTORGB8 + "subs %w[width], %w[width], #8 \n" + "movi v19.8b, #255 \n" ARGBTOARGB4444 +@@ -638,22 +386,17 @@ void I422ToARGB4444Row_NEON(const uint8_ + [width] "+r"(width) // %[width] + : [kUVCoeff] "r"(&yuvconstants->kUVCoeff), // %[kUVCoeff] + [kRGBCoeffBias] "r"(&yuvconstants->kRGBCoeffBias) // %[kRGBCoeffBias] +- : "cc", "memory", YUVTORGB_REGS, "v19"); ++ : "cc", "memory", YUVTORGB_REGS, "v19", "v23"); + } + + void I400ToARGBRow_NEON(const uint8_t* src_y, + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP +- "movi v1.16b, #128 \n" + "movi v19.8b, #255 \n" +- "umull v6.8h, v1.8b, v30.8b \n" +- "umlal2 v6.8h, v1.16b, v31.16b \n" /* DG */ +- "umull v4.8h, v1.8b, v28.8b \n" /* DB */ +- "umull2 v5.8h, v1.16b, v29.16b \n" /* DR */ +- "1: \n" READYUV400 I400TORGB ++ "1: \n" READYUV400 YUVTORGB + RGBTORGB8 + "subs %w[width], %w[width], #8 \n" + "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" +@@ -668,13 +411,13 @@ void I400ToARGBRow_NEON(const uint8_t* s + + #if LIBYUV_USE_ST4 + void J400ToARGBRow_NEON(const uint8_t* src_y, uint8_t* dst_argb, int width) { +- asm volatile ( ++ asm volatile( + "movi v23.8b, #255 \n" + "1: \n" + "ld1 {v20.8b}, [%0], #8 \n" + "prfm pldl1keep, [%0, 448] \n" +- "mov v21.8b, v20.8b \n" +- "mov v22.8b, v20.8b \n" ++ "orr v21.8b, v20.8b, v20.8b \n" ++ "orr v22.8b, v20.8b, v20.8b \n" + "subs %w2, %w2, #8 \n" + "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%1], #32 \n" + "b.gt 1b \n" +@@ -686,7 +429,7 @@ void J400ToARGBRow_NEON(const uint8_t* s + } + #else + void J400ToARGBRow_NEON(const uint8_t* src_y, uint8_t* dst_argb, int width) { +- asm volatile ( ++ asm volatile( + "movi v20.8b, #255 \n" + "1: \n" + "ldr d16, [%0], #8 \n" +@@ -711,11 +454,11 @@ void NV12ToARGBRow_NEON(const uint8_t* s + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "movi v19.8b, #255 \n" + "ldr q2, [%[kNV12Table]] \n" +- "1: \n" READNV12 NVTORGB RGBTORGB8 ++ "1: \n" READNV12 YUVTORGB RGBTORGB8 + "subs %w[width], %w[width], #8 \n" + "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" + "b.gt 1b \n" +@@ -734,11 +477,11 @@ void NV21ToARGBRow_NEON(const uint8_t* s + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "movi v19.8b, #255 \n" + "ldr q2, [%[kNV12Table]] \n" +- "1: \n" READNV12 NVTORGB RGBTORGB8 ++ "1: \n" READNV12 YUVTORGB RGBTORGB8 + "subs %w[width], %w[width], #8 \n" + "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" + "b.gt 1b \n" +@@ -757,10 +500,10 @@ void NV12ToRGB24Row_NEON(const uint8_t* + uint8_t* dst_rgb24, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "ldr q2, [%[kNV12Table]] \n" +- "1: \n" READNV12 NVTORGB RGBTORGB8 ++ "1: \n" READNV12 YUVTORGB RGBTORGB8 + "subs %w[width], %w[width], #8 \n" + "st3 {v16.8b,v17.8b,v18.8b}, [%[dst_rgb24]], #24 \n" + "b.gt 1b \n" +@@ -779,10 +522,10 @@ void NV21ToRGB24Row_NEON(const uint8_t* + uint8_t* dst_rgb24, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "ldr q2, [%[kNV12Table]] \n" +- "1: \n" READNV12 NVTORGB RGBTORGB8 ++ "1: \n" READNV12 YUVTORGB RGBTORGB8 + "subs %w[width], %w[width], #8 \n" + "st3 {v16.8b,v17.8b,v18.8b}, [%[dst_rgb24]], #24 \n" + "b.gt 1b \n" +@@ -801,12 +544,11 @@ void NV12ToRGB565Row_NEON(const uint8_t* + uint8_t* dst_rgb565, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP + "ldr q2, [%[kNV12Table]] \n" +- "1: \n" READNV12 NVTORGB +- RGBTORGB8_TOP +- "subs %w[width], %w[width], #8 \n" ARGBTORGB565_FROM_TOP ++ "1: \n" READNV12 YUVTORGB RGBTORGB8 ++ "subs %w[width], %w[width], #8 \n" ARGBTORGB565 + "st1 {v18.8h}, [%[dst_rgb565]], #16 \n" // store 8 + // pixels + // RGB565. +@@ -825,20 +567,20 @@ void YUY2ToARGBRow_NEON(const uint8_t* s + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP +- "movi v19.8b, #255 \n" +- "ldr q2, [%[kNV21InterleavedTable]] \n" +- "1: \n" READYUY2 NVTORGB RGBTORGB8 +- "subs %w[width], %w[width], #8 \n" ++ "movi v19.8b, #255 \n" ++ "ldr q2, [%[kNV12Table]] \n" ++ "1: \n" READYUY2 YUVTORGB RGBTORGB8 ++ "subs %w[width], %w[width], #8 \n" + "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" +- "b.gt 1b \n" ++ "b.gt 1b \n" + : [src_yuy2] "+r"(src_yuy2), // %[src_yuy2] + [dst_argb] "+r"(dst_argb), // %[dst_argb] + [width] "+r"(width) // %[width] + : [kUVCoeff] "r"(&yuvconstants->kUVCoeff), // %[kUVCoeff] + [kRGBCoeffBias] "r"(&yuvconstants->kRGBCoeffBias), // %[kRGBCoeffBias] +- [kNV21InterleavedTable] "r"(&kNV21InterleavedTable) ++ [kNV12Table] "r"(&kNV12Table) + : "cc", "memory", YUVTORGB_REGS, "v2", "v19"); + } + +@@ -846,20 +588,20 @@ void UYVYToARGBRow_NEON(const uint8_t* s + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm volatile ( ++ asm volatile( + YUVTORGB_SETUP +- "movi v19.8b, #255 \n" +- "ldr q2, [%[kNV12InterleavedTable]] \n" +- "1: \n" READUYVY NVTORGB RGBTORGB8 +- "subs %w[width], %w[width], #8 \n" ++ "movi v19.8b, #255 \n" ++ "ldr q2, [%[kNV12Table]] \n" ++ "1: \n" READUYVY YUVTORGB RGBTORGB8 ++ "subs %w[width], %w[width], #8 \n" + "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" +- "b.gt 1b \n" ++ "b.gt 1b \n" + : [src_uyvy] "+r"(src_uyvy), // %[src_yuy2] + [dst_argb] "+r"(dst_argb), // %[dst_argb] + [width] "+r"(width) // %[width] + : [kUVCoeff] "r"(&yuvconstants->kUVCoeff), // %[kUVCoeff] + [kRGBCoeffBias] "r"(&yuvconstants->kRGBCoeffBias), // %[kRGBCoeffBias] +- [kNV12InterleavedTable] "r"(&kNV12InterleavedTable) ++ [kNV12Table] "r"(&kNV12Table) + : "cc", "memory", YUVTORGB_REGS, "v2", "v19"); + } + +@@ -868,7 +610,7 @@ void SplitUVRow_NEON(const uint8_t* src_ + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld2 {v0.16b,v1.16b}, [%0], #32 \n" // load 16 pairs of UV + "subs %w3, %w3, #16 \n" // 16 processed per loop +@@ -893,7 +635,7 @@ void DetileRow_NEON(const uint8_t* src, + ptrdiff_t src_tile_stride, + uint8_t* dst, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld1 {v0.16b}, [%0], %3 \n" // load 16 bytes + "subs %w2, %w2, #16 \n" // 16 processed per loop +@@ -913,7 +655,7 @@ void DetileRow_16_NEON(const uint16_t* s + ptrdiff_t src_tile_stride, + uint16_t* dst, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld1 {v0.8h,v1.8h}, [%0], %3 \n" // load 16 pixels + "subs %w2, %w2, #16 \n" // 16 processed per loop +@@ -934,7 +676,7 @@ void DetileSplitUVRow_NEON(const uint8_t + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld2 {v0.8b,v1.8b}, [%0], %4 \n" + "subs %w3, %w3, #16 \n" +@@ -959,7 +701,7 @@ void DetileToYUY2_NEON(const uint8_t* sr + ptrdiff_t src_uv_tile_stride, + uint8_t* dst_yuy2, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld1 {v0.16b}, [%0], %4 \n" // load 16 Ys + "prfm pldl1keep, [%0, 1792] \n" +@@ -985,7 +727,7 @@ void DetileToYUY2_NEON(const uint8_t* sr + ptrdiff_t src_uv_tile_stride, + uint8_t* dst_yuy2, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld1 {v0.16b}, [%0], %4 \n" // load 16 Ys + "ld1 {v1.16b}, [%1], %5 \n" // load 8 UVs +@@ -1010,39 +752,49 @@ void DetileToYUY2_NEON(const uint8_t* sr + // Unpack MT2T into tiled P010 64 pixels at a time. See + // tinyurl.com/mtk-10bit-video-format for format documentation. + void UnpackMT2T_NEON(const uint8_t* src, uint16_t* dst, size_t size) { +- asm volatile ( ++ const uint8_t* src_lower_bits = src; ++ const uint8_t* src_upper_bits = src + 16; ++ asm volatile( + "1: \n" +- "ld1 {v7.16b}, [%0], #16 \n" +- "ld1 {v0.16b-v3.16b}, [%0], #64 \n" +- "shl v4.16b, v7.16b, #6 \n" +- "shl v5.16b, v7.16b, #4 \n" +- "shl v6.16b, v7.16b, #2 \n" +- "subs %2, %2, #80 \n" +- "zip1 v16.16b, v4.16b, v0.16b \n" +- "zip1 v18.16b, v5.16b, v1.16b \n" +- "zip1 v20.16b, v6.16b, v2.16b \n" +- "zip1 v22.16b, v7.16b, v3.16b \n" +- "zip2 v17.16b, v4.16b, v0.16b \n" +- "zip2 v19.16b, v5.16b, v1.16b \n" +- "zip2 v21.16b, v6.16b, v2.16b \n" +- "zip2 v23.16b, v7.16b, v3.16b \n" +- "sri v16.8h, v16.8h, #10 \n" +- "sri v17.8h, v17.8h, #10 \n" +- "sri v18.8h, v18.8h, #10 \n" +- "sri v19.8h, v19.8h, #10 \n" +- "st1 {v16.8h-v19.8h}, [%1], #64 \n" +- "sri v20.8h, v20.8h, #10 \n" +- "sri v21.8h, v21.8h, #10 \n" +- "sri v22.8h, v22.8h, #10 \n" +- "sri v23.8h, v23.8h, #10 \n" +- "st1 {v20.8h-v23.8h}, [%1], #64 \n" ++ "ld4 {v0.8b, v1.8b, v2.8b, v3.8b}, [%1], #32 \n" ++ "ld1 {v7.8b}, [%0], #8 \n" ++ "shl v6.8b, v7.8b, #2 \n" ++ "shl v5.8b, v7.8b, #4 \n" ++ "shl v4.8b, v7.8b, #6 \n" ++ "zip1 v0.16b, v4.16b, v0.16b \n" ++ "zip1 v1.16b, v5.16b, v1.16b \n" ++ "zip1 v2.16b, v6.16b, v2.16b \n" ++ "zip1 v3.16b, v7.16b, v3.16b \n" ++ "sri v0.8h, v0.8h, #10 \n" ++ "sri v1.8h, v1.8h, #10 \n" ++ "sri v2.8h, v2.8h, #10 \n" ++ "sri v3.8h, v3.8h, #10 \n" ++ "st4 {v0.8h, v1.8h, v2.8h, v3.8h}, [%2], #64 \n" ++ "ld4 {v0.8b, v1.8b, v2.8b, v3.8b}, [%1], #32 \n" ++ "ld1 {v7.8b}, [%0], #8 \n" ++ "shl v6.8b, v7.8b, #2 \n" ++ "shl v5.8b, v7.8b, #4 \n" ++ "shl v4.8b, v7.8b, #6 \n" ++ "zip1 v0.16b, v4.16b, v0.16b \n" ++ "zip1 v1.16b, v5.16b, v1.16b \n" ++ "zip1 v2.16b, v6.16b, v2.16b \n" ++ "zip1 v3.16b, v7.16b, v3.16b \n" ++ "sri v0.8h, v0.8h, #10 \n" ++ "sri v1.8h, v1.8h, #10 \n" ++ "sri v2.8h, v2.8h, #10 \n" ++ "sri v3.8h, v3.8h, #10 \n" ++ "st4 {v0.8h, v1.8h, v2.8h, v3.8h}, [%2], #64 \n" ++ "mov %0, %1 \n" ++ "add %1, %0, #16 \n" ++ "subs %3, %3, #80 \n" + "b.gt 1b \n" +- : "+r"(src), // %0 +- "+r"(dst), // %1 +- "+r"(size) // %2 ++ : "+r"(src_lower_bits), // %0 ++ "+r"(src_upper_bits), // %1 ++ "+r"(dst), // %2 ++ "+r"(size) // %3 + : + : "cc", "memory", "w0", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", +- "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23"); ++ "v8", "v9", "v10", "v11", "v12"); + } + + #if LIBYUV_USE_ST2 +@@ -1051,7 +803,7 @@ void MergeUVRow_NEON(const uint8_t* src_ + const uint8_t* src_v, + uint8_t* dst_uv, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld1 {v0.16b}, [%0], #16 \n" // load U + "ld1 {v1.16b}, [%1], #16 \n" // load V +@@ -1068,6 +820,28 @@ void MergeUVRow_NEON(const uint8_t* src_ + : "cc", "memory", "v0", "v1" // Clobber List + ); + } ++// Reads 16 U's and V's and writes out 16 pairs of UV. ++void MergeUVRow_NEON1(const uint8_t* src_u, ++ const uint8_t* src_v, ++ uint8_t* dst_uv, ++ int width) { ++ asm volatile( ++ "1: \n" ++ "ld1 {v0.16b,v2.16b}, [%0], #32 \n" // load U ++ "ld1 {v1.16b,v3.16b}, [%1], #32 \n" // load V ++ "subs %w3, %w3, #32 \n" // 32 processed per loop ++ "prfm pldl1keep, [%0, 448] \n" ++ "prfm pldl1keep, [%1, 448] \n" ++ "st2 {v0.16b,v1.16b,v2.16b,v3.16b}, [%2], #64 \n" // store 32 UV ++ "b.gt 1b \n" ++ : "+r"(src_u), // %0 ++ "+r"(src_v), // %1 ++ "+r"(dst_uv), // %2 ++ "+r"(width) // %3 // Output registers ++ : // Input registers ++ : "cc", "memory", "v0", "v1" // Clobber List ++ ); ++} + + void MergeUVRow_16_NEON(const uint16_t* src_u, + const uint16_t* src_v, +@@ -1075,7 +849,7 @@ void MergeUVRow_16_NEON(const uint16_t* + int depth, + int width) { + int shift = 16 - depth; +- asm volatile ( ++ asm volatile( + "dup v2.8h, %w4 \n" + "1: \n" + "ld1 {v0.8h}, [%0], #16 \n" // load 8 U +@@ -1100,7 +874,7 @@ void MergeUVRow_NEON(const uint8_t* src_ + const uint8_t* src_v, + uint8_t* dst_uv, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld1 {v0.16b}, [%0], #16 \n" // load U + "ld1 {v1.16b}, [%1], #16 \n" // load V +@@ -1126,7 +900,7 @@ void MergeUVRow_16_NEON(const uint16_t* + int depth, + int width) { + int shift = 16 - depth; +- asm volatile ( ++ asm volatile( + "dup v4.8h, %w4 \n" + "1: \n" + "ld1 {v0.8h}, [%0], #16 \n" // load 8 U +@@ -1155,7 +929,7 @@ void SplitRGBRow_NEON(const uint8_t* src + uint8_t* dst_g, + uint8_t* dst_b, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld3 {v0.16b,v1.16b,v2.16b}, [%0], #48 \n" // load 16 RGB + "subs %w4, %w4, #16 \n" // 16 processed per loop +@@ -1180,7 +954,7 @@ void MergeRGBRow_NEON(const uint8_t* src + const uint8_t* src_b, + uint8_t* dst_rgb, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld1 {v0.16b}, [%0], #16 \n" // load R + "ld1 {v1.16b}, [%1], #16 \n" // load G +@@ -1208,7 +982,7 @@ void SplitARGBRow_NEON(const uint8_t* sr + uint8_t* dst_b, + uint8_t* dst_a, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld4 {v0.16b,v1.16b,v2.16b,v3.16b}, [%0], #64 \n" // load 16 ARGB + "subs %w5, %w5, #16 \n" // 16 processed per loop +@@ -1237,7 +1011,7 @@ void MergeARGBRow_NEON(const uint8_t* sr + const uint8_t* src_a, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld1 {v0.16b}, [%2], #16 \n" // load B + "ld1 {v1.16b}, [%1], #16 \n" // load G +@@ -1268,7 +1042,7 @@ void MergeARGBRow_NEON(const uint8_t* sr + const uint8_t* src_a, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld1 {v0.16b}, [%2], #16 \n" // load B + "ld1 {v1.16b}, [%1], #16 \n" // load G +@@ -1308,7 +1082,7 @@ void SplitXRGBRow_NEON(const uint8_t* sr + uint8_t* dst_g, + uint8_t* dst_b, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld4 {v0.16b,v1.16b,v2.16b,v3.16b}, [%0], #64 \n" // load 16 ARGB + "subs %w4, %w4, #16 \n" // 16 processed per loop +@@ -1333,7 +1107,7 @@ void MergeXRGBRow_NEON(const uint8_t* sr + const uint8_t* src_b, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "movi v3.16b, #255 \n" // load A(255) + "1: \n" + "ld1 {v2.16b}, [%0], #16 \n" // load R +@@ -1362,7 +1136,7 @@ void MergeXR30Row_NEON(const uint16_t* s + int depth, + int width) { + int shift = 10 - depth; +- asm volatile ( ++ asm volatile( + "movi v30.16b, #255 \n" + "ushr v30.4s, v30.4s, #22 \n" // 1023 + "dup v31.4s, %w5 \n" +@@ -1400,34 +1174,32 @@ void MergeXR30Row_10_NEON(const uint16_t + uint8_t* dst_ar30, + int /* depth */, + int width) { +- // Neon has no "shift left and accumulate/orr", so use a multiply-add to +- // perform the shift instead. +- int limit = 1023; +- asm volatile ( +- "dup v5.8h, %w[limit] \n" +- "movi v6.8h, #16 \n" // 1 << 4 +- "movi v7.8h, #4, lsl #8 \n" // 1 << 10 +- "1: \n" +- "ldr q0, [%0], #16 \n" // xxxxxxRrrrrrrrrr +- "ldr q1, [%1], #16 \n" // xxxxxxGggggggggg +- "ldr q2, [%2], #16 \n" // xxxxxxBbbbbbbbbb +- "umin v0.8h, v0.8h, v5.8h \n" // 000000Rrrrrrrrrr +- "umin v1.8h, v1.8h, v5.8h \n" // 000000Gggggggggg +- "movi v4.8h, #0xc0, lsl #8 \n" // 1100000000000000 +- "umin v3.8h, v2.8h, v5.8h \n" // 000000Bbbbbbbbbb +- "mla v4.8h, v0.8h, v6.8h \n" // 11Rrrrrrrrrr0000 +- "mla v3.8h, v1.8h, v7.8h \n" // ggggggBbbbbbbbbb +- "usra v4.8h, v1.8h, #6 \n" // 11RrrrrrrrrrGggg +- "subs %w4, %w4, #8 \n" +- "st2 {v3.8h, v4.8h}, [%3], #32 \n" +- "b.gt 1b \n" ++ asm volatile( ++ "movi v30.16b, #255 \n" ++ "ushr v30.4s, v30.4s, #22 \n" // 1023 ++ "1: \n" ++ "ldr d2, [%2], #8 \n" // B ++ "ldr d1, [%1], #8 \n" // G ++ "ldr d0, [%0], #8 \n" // R ++ "ushll v2.4s, v2.4h, #0 \n" // 000B ++ "ushll v1.4s, v1.4h, #0 \n" // G ++ "ushll v0.4s, v0.4h, #0 \n" // R ++ "umin v2.4s, v2.4s, v30.4s \n" ++ "umin v1.4s, v1.4s, v30.4s \n" ++ "umin v0.4s, v0.4s, v30.4s \n" ++ "sli v2.4s, v1.4s, #10 \n" // 00GB ++ "sli v2.4s, v0.4s, #20 \n" // 0RGB ++ "orr v2.4s, #0xc0, lsl #24 \n" // ARGB (AR30) ++ "subs %w4, %w4, #4 \n" ++ "str q2, [%3], #16 \n" ++ "b.gt 1b \n" + : "+r"(src_r), // %0 + "+r"(src_g), // %1 + "+r"(src_b), // %2 + "+r"(dst_ar30), // %3 + "+r"(width) // %4 +- : [limit] "r"(limit) +- : "memory", "cc", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7"); ++ : ++ : "memory", "cc", "v0", "v1", "v2", "v30"); + } + + void MergeAR64Row_NEON(const uint16_t* src_r, +@@ -1439,7 +1211,7 @@ void MergeAR64Row_NEON(const uint16_t* s + int width) { + int shift = 16 - depth; + int mask = (1 << depth) - 1; +- asm volatile ( ++ asm volatile( + + "dup v30.8h, %w7 \n" + "dup v31.8h, %w6 \n" +@@ -1482,7 +1254,7 @@ void MergeXR64Row_NEON(const uint16_t* s + int width) { + int shift = 16 - depth; + int mask = (1 << depth) - 1; +- asm volatile ( ++ asm volatile( + + "movi v3.16b, #0xff \n" // A (0xffff) + "dup v30.8h, %w6 \n" +@@ -1521,31 +1293,33 @@ void MergeARGB16To8Row_NEON(const uint16 + uint8_t* dst_argb, + int depth, + int width) { +- // Shift is 8 - depth, +8 so the result is in the top half of each lane. +- int shift = 16 - depth; +- asm volatile ( ++ int shift = 8 - depth; ++ asm volatile( ++ + "dup v31.8h, %w6 \n" + "1: \n" +- "ldr q0, [%0], #16 \n" // B ++ "ldr q2, [%0], #16 \n" // R + "ldr q1, [%1], #16 \n" // G +- "ldr q2, [%2], #16 \n" // R ++ "ldr q0, [%2], #16 \n" // B + "ldr q3, [%3], #16 \n" // A +- "uqshl v0.8h, v0.8h, v31.8h \n" ++ "ushl v2.8h, v2.8h, v31.8h \n" + "prfm pldl1keep, [%0, 448] \n" +- "uqshl v1.8h, v1.8h, v31.8h \n" ++ "ushl v1.8h, v1.8h, v31.8h \n" + "prfm pldl1keep, [%1, 448] \n" +- "uqshl v2.8h, v2.8h, v31.8h \n" ++ "ushl v0.8h, v0.8h, v31.8h \n" + "prfm pldl1keep, [%2, 448] \n" +- "uqshl v3.8h, v3.8h, v31.8h \n" ++ "ushl v3.8h, v3.8h, v31.8h \n" + "prfm pldl1keep, [%3, 448] \n" +- "trn2 v0.16b, v0.16b, v1.16b \n" +- "trn2 v1.16b, v2.16b, v3.16b \n" ++ "uqxtn v2.8b, v2.8h \n" ++ "uqxtn v1.8b, v1.8h \n" ++ "uqxtn v0.8b, v0.8h \n" ++ "uqxtn v3.8b, v3.8h \n" + "subs %w5, %w5, #8 \n" +- "st2 {v0.8h, v1.8h}, [%4], #32 \n" ++ "st4 {v0.8b, v1.8b, v2.8b, v3.8b}, [%4], #32 \n" + "b.gt 1b \n" +- : "+r"(src_b), // %0 ++ : "+r"(src_r), // %0 + "+r"(src_g), // %1 +- "+r"(src_r), // %2 ++ "+r"(src_b), // %2 + "+r"(src_a), // %3 + "+r"(dst_argb), // %4 + "+r"(width) // %5 +@@ -1559,29 +1333,30 @@ void MergeXRGB16To8Row_NEON(const uint16 + uint8_t* dst_argb, + int depth, + int width) { +- // Shift is 8 - depth, +8 so the result is in the top half of each lane. +- int shift = 16 - depth; +- asm volatile ( ++ int shift = 8 - depth; ++ asm volatile( ++ + "dup v31.8h, %w5 \n" +- "movi v3.16b, #0xff \n" // A (0xff) ++ "movi v3.8b, #0xff \n" // A (0xff) + "1: \n" +- "ldr q0, [%0], #16 \n" // B ++ "ldr q2, [%0], #16 \n" // R + "ldr q1, [%1], #16 \n" // G +- "ldr q2, [%2], #16 \n" // R +- "uqshl v0.8h, v0.8h, v31.8h \n" ++ "ldr q0, [%2], #16 \n" // B ++ "ushl v2.8h, v2.8h, v31.8h \n" + "prfm pldl1keep, [%0, 448] \n" +- "uqshl v1.8h, v1.8h, v31.8h \n" ++ "ushl v1.8h, v1.8h, v31.8h \n" + "prfm pldl1keep, [%1, 448] \n" +- "uqshl v2.8h, v2.8h, v31.8h \n" ++ "ushl v0.8h, v0.8h, v31.8h \n" + "prfm pldl1keep, [%2, 448] \n" +- "trn2 v0.16b, v0.16b, v1.16b \n" +- "trn2 v1.16b, v2.16b, v3.16b \n" ++ "uqxtn v2.8b, v2.8h \n" ++ "uqxtn v1.8b, v1.8h \n" ++ "uqxtn v0.8b, v0.8h \n" + "subs %w4, %w4, #8 \n" +- "st2 {v0.8h, v1.8h}, [%3], #32 \n" ++ "st4 {v0.8b, v1.8b, v2.8b, v3.8b}, [%3], #32 \n" + "b.gt 1b \n" +- : "+r"(src_b), // %0 ++ : "+r"(src_r), // %0 + "+r"(src_g), // %1 +- "+r"(src_r), // %2 ++ "+r"(src_b), // %2 + "+r"(dst_argb), // %3 + "+r"(width) // %4 + : "r"(shift) // %5 +@@ -1590,7 +1365,7 @@ void MergeXRGB16To8Row_NEON(const uint16 + + // Copy multiple of 32. + void CopyRow_NEON(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ldp q0, q1, [%0], #32 \n" + "prfm pldl1keep, [%0, 448] \n" +@@ -1607,7 +1382,7 @@ void CopyRow_NEON(const uint8_t* src, ui + + // SetRow writes 'width' bytes using an 8 bit value repeated. + void SetRow_NEON(uint8_t* dst, uint8_t v8, int width) { +- asm volatile ( ++ asm volatile( + "dup v0.16b, %w2 \n" // duplicate 16 bytes + "1: \n" + "subs %w1, %w1, #16 \n" // 16 bytes per loop +@@ -1620,7 +1395,7 @@ void SetRow_NEON(uint8_t* dst, uint8_t v + } + + void ARGBSetRow_NEON(uint8_t* dst, uint32_t v32, int width) { +- asm volatile ( ++ asm volatile( + "dup v0.4s, %w2 \n" // duplicate 4 ints + "1: \n" + "subs %w1, %w1, #4 \n" // 4 ints per loop +@@ -1637,7 +1412,7 @@ static const uvec8 kShuffleMirror = {15u + 7u, 6u, 5u, 4u, 3u, 2u, 1u, 0u}; + + void MirrorRow_NEON(const uint8_t* src, uint8_t* dst, int width) { +- asm volatile ( ++ asm volatile( + // Start at end of source row. + "ld1 {v3.16b}, [%3] \n" // shuffler + "add %0, %0, %w2, sxtw \n" +@@ -1662,7 +1437,7 @@ static const uvec8 kShuffleMirrorUV = {1 + 6u, 7u, 4u, 5u, 2u, 3u, 0u, 1u}; + + void MirrorUVRow_NEON(const uint8_t* src_uv, uint8_t* dst_uv, int width) { +- asm volatile ( ++ asm volatile( + // Start at end of source row. + "ld1 {v4.16b}, [%3] \n" // shuffler + "add %0, %0, %w2, sxtw #1 \n" +@@ -1686,7 +1461,7 @@ void MirrorSplitUVRow_NEON(const uint8_t + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + // Start at end of source row. + "ld1 {v4.16b}, [%4] \n" // shuffler + "add %0, %0, %w3, sxtw #1 \n" +@@ -1715,7 +1490,7 @@ static const uvec8 kShuffleMirrorARGB = + 4u, 5u, 6u, 7u, 0u, 1u, 2u, 3u}; + + void ARGBMirrorRow_NEON(const uint8_t* src_argb, uint8_t* dst_argb, int width) { +- asm volatile ( ++ asm volatile( + // Start at end of source row. + "ld1 {v4.16b}, [%3] \n" // shuffler + "add %0, %0, %w2, sxtw #2 \n" +@@ -1738,7 +1513,7 @@ void ARGBMirrorRow_NEON(const uint8_t* s + void RGB24MirrorRow_NEON(const uint8_t* src_rgb24, + uint8_t* dst_rgb24, + int width) { +- asm volatile ( ++ asm volatile( + "ld1 {v3.16b}, [%4] \n" // shuffler + "add %0, %0, %w2, sxtw #1 \n" // Start at end of row. + "add %0, %0, %w2, sxtw \n" +@@ -1763,7 +1538,7 @@ void RGB24MirrorRow_NEON(const uint8_t* + void RGB24ToARGBRow_NEON(const uint8_t* src_rgb24, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "movi v4.8b, #255 \n" // Alpha + "1: \n" + "ld3 {v1.8b,v2.8b,v3.8b}, [%0], #24 \n" // load 8 pixels of +@@ -1781,14 +1556,14 @@ void RGB24ToARGBRow_NEON(const uint8_t* + } + + void RAWToARGBRow_NEON(const uint8_t* src_raw, uint8_t* dst_argb, int width) { +- asm volatile ( ++ asm volatile( + "movi v5.8b, #255 \n" // Alpha + "1: \n" + "ld3 {v0.8b,v1.8b,v2.8b}, [%0], #24 \n" // read r g b + "subs %w2, %w2, #8 \n" // 8 processed per loop. +- "mov v3.8b, v1.8b \n" // move g ++ "orr v3.8b, v1.8b, v1.8b \n" // move g + "prfm pldl1keep, [%0, 448] \n" +- "mov v4.8b, v0.8b \n" // move r ++ "orr v4.8b, v0.8b, v0.8b \n" // move r + "st4 {v2.8b,v3.8b,v4.8b,v5.8b}, [%1], #32 \n" // store b g r a + "b.gt 1b \n" + : "+r"(src_raw), // %0 +@@ -1800,14 +1575,14 @@ void RAWToARGBRow_NEON(const uint8_t* sr + } + + void RAWToRGBARow_NEON(const uint8_t* src_raw, uint8_t* dst_rgba, int width) { +- asm volatile ( ++ asm volatile( + "movi v0.8b, #255 \n" // Alpha + "1: \n" + "ld3 {v3.8b,v4.8b,v5.8b}, [%0], #24 \n" // read r g b + "subs %w2, %w2, #8 \n" // 8 processed per loop. +- "mov v2.8b, v4.8b \n" // move g ++ "orr v2.8b, v4.8b, v4.8b \n" // move g + "prfm pldl1keep, [%0, 448] \n" +- "mov v1.8b, v5.8b \n" // move r ++ "orr v1.8b, v5.8b, v5.8b \n" // move r + "st4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%1], #32 \n" // store a b g r + "b.gt 1b \n" + : "+r"(src_raw), // %0 +@@ -1819,13 +1594,13 @@ void RAWToRGBARow_NEON(const uint8_t* sr + } + + void RAWToRGB24Row_NEON(const uint8_t* src_raw, uint8_t* dst_rgb24, int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld3 {v0.8b,v1.8b,v2.8b}, [%0], #24 \n" // read r g b + "subs %w2, %w2, #8 \n" // 8 processed per loop. +- "mov v3.8b, v1.8b \n" // move g ++ "orr v3.8b, v1.8b, v1.8b \n" // move g + "prfm pldl1keep, [%0, 448] \n" +- "mov v4.8b, v0.8b \n" // move r ++ "orr v4.8b, v0.8b, v0.8b \n" // move r + "st3 {v2.8b,v3.8b,v4.8b}, [%1], #24 \n" // store b g r + "b.gt 1b \n" + : "+r"(src_raw), // %0 +@@ -1836,20 +1611,23 @@ void RAWToRGB24Row_NEON(const uint8_t* s + ); + } + +-#define RGB565TOARGB \ +- /* Input: v0.8h: RRRRRGGGGGGBBBBB */ \ +- "shrn v1.8b, v0.8h, #3 \n" /* G GGGGGGxx */ \ +- "shrn v2.8b, v0.8h, #8 \n" /* R RRRRRxxx */ \ +- "xtn v0.8b, v0.8h \n" /* B xxxBBBBB */ \ +- "sri v1.8b, v1.8b, #6 \n" /* G GGGGGGGG, fill 2 */ \ +- "shl v0.8b, v0.8b, #3 \n" /* B BBBBB000 */ \ +- "sri v2.8b, v2.8b, #5 \n" /* R RRRRRRRR, fill 3 */ \ +- "sri v0.8b, v0.8b, #5 \n" /* R BBBBBBBB, fill 3 */ ++#define RGB565TOARGB \ ++ "shrn v6.8b, v0.8h, #5 \n" /* G xxGGGGGG */ \ ++ "shl v6.8b, v6.8b, #2 \n" /* G GGGGGG00 upper 6 */ \ ++ "ushr v4.8b, v6.8b, #6 \n" /* G 000000GG lower 2 */ \ ++ "orr v1.8b, v4.8b, v6.8b \n" /* G */ \ ++ "xtn v2.8b, v0.8h \n" /* B xxxBBBBB */ \ ++ "ushr v0.8h, v0.8h, #11 \n" /* R 000RRRRR */ \ ++ "xtn2 v2.16b,v0.8h \n" /* R in upper part */ \ ++ "shl v2.16b, v2.16b, #3 \n" /* R,B BBBBB000 upper 5 */ \ ++ "ushr v0.16b, v2.16b, #5 \n" /* R,B 00000BBB lower 3 */ \ ++ "orr v0.16b, v0.16b, v2.16b \n" /* R,B */ \ ++ "dup v2.2D, v0.D[1] \n" /* R */ + + void RGB565ToARGBRow_NEON(const uint8_t* src_rgb565, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "movi v3.8b, #255 \n" // Alpha + "1: \n" + "ld1 {v0.16b}, [%0], #16 \n" // load 8 RGB565 pixels. +@@ -1865,34 +1643,48 @@ void RGB565ToARGBRow_NEON(const uint8_t* + ); + } + +-#define ARGB1555TOARGB \ +- /* Input: ARRRRRGGGGGBBBBB */ \ +- "xtn v29.8b, v0.8h \n" /* xxxBBBBB */ \ +- "shrn v3.8b, v0.8h, #8 \n" /* Axxxxxxx */ \ +- "shrn v2.8b, v0.8h, #7 \n" /* RRRRRxxx */ \ +- "shrn v1.8b, v0.8h, #2 \n" /* GGGGGxxx */ \ +- "shl v0.8b, v29.8b, #3 \n" /* BBBBB000 */ \ +- "sshr v3.8b, v3.8b, #7 \n" /* AAAAAAAA */ \ +- "sri v2.8b, v2.8b, #5 \n" /* RRRRRRRR */ \ +- "sri v1.8b, v1.8b, #5 \n" /* GGGGGGGG */ \ +- "sri v0.8b, v0.8b, #5 \n" /* BBBBBBBB */ ++#define ARGB1555TOARGB \ ++ "ushr v2.8h, v0.8h, #10 \n" /* R xxxRRRRR */ \ ++ "shl v2.8h, v2.8h, #3 \n" /* R RRRRR000 upper 5 */ \ ++ "xtn v3.8b, v2.8h \n" /* RRRRR000 AAAAAAAA */ \ ++ \ ++ "sshr v2.8h, v0.8h, #15 \n" /* A AAAAAAAA */ \ ++ "xtn2 v3.16b, v2.8h \n" \ ++ \ ++ "xtn v2.8b, v0.8h \n" /* B xxxBBBBB */ \ ++ "shrn2 v2.16b,v0.8h, #5 \n" /* G xxxGGGGG */ \ ++ \ ++ "ushr v1.16b, v3.16b, #5 \n" /* R,A 00000RRR lower 3 */ \ ++ "shl v0.16b, v2.16b, #3 \n" /* B,G BBBBB000 upper 5 */ \ ++ "ushr v2.16b, v0.16b, #5 \n" /* B,G 00000BBB lower 3 */ \ ++ \ ++ "orr v0.16b, v0.16b, v2.16b \n" /* B,G */ \ ++ "orr v2.16b, v1.16b, v3.16b \n" /* R,A */ \ ++ "dup v1.2D, v0.D[1] \n" \ ++ "dup v3.2D, v2.D[1] \n" + + // RGB555TOARGB is same as ARGB1555TOARGB but ignores alpha. +-#define RGB555TOARGB \ +- /* Input: xRRRRRGGGGGBBBBB */ \ +- "xtn v29.8b, v0.8h \n" /* xxxBBBBB */ \ +- "shrn v2.8b, v0.8h, #7 \n" /* RRRRRxxx */ \ +- "shrn v1.8b, v0.8h, #2 \n" /* GGGGGxxx */ \ +- "shl v0.8b, v29.8b, #3 \n" /* BBBBB000 */ \ +- \ +- "sri v2.8b, v2.8b, #5 \n" /* RRRRRRRR */ \ +- "sri v1.8b, v1.8b, #5 \n" /* GGGGGGGG */ \ +- "sri v0.8b, v0.8b, #5 \n" /* BBBBBBBB */ ++#define RGB555TOARGB \ ++ "ushr v2.8h, v0.8h, #10 \n" /* R xxxRRRRR */ \ ++ "shl v2.8h, v2.8h, #3 \n" /* R RRRRR000 upper 5 */ \ ++ "xtn v3.8b, v2.8h \n" /* RRRRR000 */ \ ++ \ ++ "xtn v2.8b, v0.8h \n" /* B xxxBBBBB */ \ ++ "shrn2 v2.16b,v0.8h, #5 \n" /* G xxxGGGGG */ \ ++ \ ++ "ushr v1.16b, v3.16b, #5 \n" /* R 00000RRR lower 3 */ \ ++ "shl v0.16b, v2.16b, #3 \n" /* B,G BBBBB000 upper 5 */ \ ++ "ushr v2.16b, v0.16b, #5 \n" /* B,G 00000BBB lower 3 */ \ ++ \ ++ "orr v0.16b, v0.16b, v2.16b \n" /* B,G */ \ ++ "orr v2.16b, v1.16b, v3.16b \n" /* R */ \ ++ "dup v1.2D, v0.D[1] \n" /* G */ + + void ARGB1555ToARGBRow_NEON(const uint8_t* src_argb1555, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( ++ "movi v3.8b, #255 \n" // Alpha + "1: \n" + "ld1 {v0.16b}, [%0], #16 \n" // load 8 ARGB1555 pixels. + "prfm pldl1keep, [%0, 448] \n" +@@ -1904,34 +1696,33 @@ void ARGB1555ToARGBRow_NEON(const uint8_ + "+r"(dst_argb), // %1 + "+r"(width) // %2 + : +- : "cc", "memory", "v0", "v1", "v2", "v3", "v29" // Clobber List ++ : "cc", "memory", "v0", "v1", "v2", "v3" // Clobber List + ); + } + +-#define ARGB4444TOARGB \ +- /* Input: v1.8h = AAAARRRR_GGGGBBBB */ \ +- "shl v0.16b, v1.16b, #4 \n" /* RRRR0000_BBBB0000 */ \ +- "sri v1.16b, v1.16b, #4 \n" /* AAAAAAAA_GGGGGGGG */ \ +- "sri v0.16b, v0.16b, #4 \n" /* RRRRRRRR_BBBBBBBB */ +- +-#define ARGB4444TORGB \ +- /* Input: v0.8h = xxxxRRRRGGGGBBBB */ \ +- "xtn v1.8b, v0.8h \n" /* GGGGBBBB */ \ +- "shrn v2.8b, v0.8h, #4 \n" /* RRRRxxxx */ \ +- "shl v0.8b, v1.8b, #4 \n" /* BBBB0000 */ \ +- "sri v1.8b, v1.8b, #4 \n" /* GGGGGGGG */ \ +- "sri v2.8b, v2.8b, #4 \n" /* RRRRRRRR */ \ +- "sri v0.8b, v0.8b, #4 \n" /* BBBBBBBB */ ++// Convert v0.8h to b = v0.8b g = v1.8b r = v2.8b ++// clobbers v3 ++#define ARGB4444TOARGB \ ++ "shrn v1.8b, v0.8h, #8 \n" /* v1(l) AR */ \ ++ "xtn2 v1.16b, v0.8h \n" /* v1(h) GB */ \ ++ "shl v2.16b, v1.16b, #4 \n" /* B,R BBBB0000 */ \ ++ "ushr v3.16b, v1.16b, #4 \n" /* G,A 0000GGGG */ \ ++ "ushr v0.16b, v2.16b, #4 \n" /* B,R 0000BBBB */ \ ++ "shl v1.16b, v3.16b, #4 \n" /* G,A GGGG0000 */ \ ++ "orr v2.16b, v0.16b, v2.16b \n" /* B,R BBBBBBBB */ \ ++ "orr v3.16b, v1.16b, v3.16b \n" /* G,A GGGGGGGG */ \ ++ "dup v0.2D, v2.D[1] \n" \ ++ "dup v1.2D, v3.D[1] \n" + + void ARGB4444ToARGBRow_NEON(const uint8_t* src_argb4444, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" +- "ld1 {v1.16b}, [%0], #16 \n" // load 8 ARGB4444 pixels. ++ "ld1 {v0.16b}, [%0], #16 \n" // load 8 ARGB4444 pixels. + "subs %w2, %w2, #8 \n" // 8 processed per loop. + "prfm pldl1keep, [%0, 448] \n" ARGB4444TOARGB +- "st2 {v0.16b, v1.16b}, [%1], #32 \n" // store 8 ARGB. ++ "st4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%1], #32 \n" // store 8 ARGB + "b.gt 1b \n" + : "+r"(src_argb4444), // %0 + "+r"(dst_argb), // %1 +@@ -1941,63 +1732,10 @@ void ARGB4444ToARGBRow_NEON(const uint8_ + ); + } + +-static const int16_t kAR30Row_BoxShifts[] = {0, -6, 0, -6, 0, -6, 0, -6}; +- +-static const uint8_t kABGRToAR30Row_BoxIndices[] = { +- 2, 2, 1, 1, 6, 6, 5, 5, 10, 10, 9, 9, 14, 14, 13, 13, +- 0, 0, 3, 3, 4, 4, 7, 7, 8, 8, 11, 11, 12, 12, 15, 15}; +-static const uint8_t kARGBToAR30Row_BoxIndices[] = { +- 0, 0, 1, 1, 4, 4, 5, 5, 8, 8, 9, 9, 12, 12, 13, 13, +- 2, 2, 3, 3, 6, 6, 7, 7, 10, 10, 11, 11, 14, 14, 15, 15}; +- +-// ARGB or ABGR as input, reordering based on TBL indices parameter. +-static void ABCDToAR30Row_NEON(const uint8_t* src_abcd, +- uint8_t* dst_ar30, +- int width, +- const uint8_t* indices) { +- asm volatile ( +- "movi v2.4s, #0xf, msl 16 \n" // 0xfffff +- "ldr q3, [%[kAR30Row_BoxShifts]] \n" +- "ldp q4, q5, [%[indices]] \n" +- "1: \n" +- "ldp q0, q20, [%[src]], #32 \n" +- "subs %w[width], %w[width], #8 \n" +- "tbl v1.16b, {v0.16b}, v5.16b \n" +- "tbl v21.16b, {v20.16b}, v5.16b \n" +- "tbl v0.16b, {v0.16b}, v4.16b \n" +- "tbl v20.16b, {v20.16b}, v4.16b \n" +- "ushl v0.8h, v0.8h, v3.8h \n" +- "ushl v20.8h, v20.8h, v3.8h \n" +- "ushl v1.8h, v1.8h, v3.8h \n" +- "ushl v21.8h, v21.8h, v3.8h \n" +- "ushr v0.4s, v0.4s, #6 \n" +- "ushr v20.4s, v20.4s, #6 \n" +- "shl v1.4s, v1.4s, #14 \n" +- "shl v21.4s, v21.4s, #14 \n" +- "bif v0.16b, v1.16b, v2.16b \n" +- "bif v20.16b, v21.16b, v2.16b \n" +- "stp q0, q20, [%[dst]], #32 \n" +- "b.gt 1b \n" +- : [src] "+r"(src_abcd), // %[src] +- [dst] "+r"(dst_ar30), // %[dst] +- [width] "+r"(width) // %[width] +- : [kAR30Row_BoxShifts] "r"(kAR30Row_BoxShifts), // %[kAR30Row_BoxShifts] +- [indices] "r"(indices) // %[indices] +- : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v20", "v21"); +-} +- +-void ABGRToAR30Row_NEON(const uint8_t* src_abgr, uint8_t* dst_ar30, int width) { +- ABCDToAR30Row_NEON(src_abgr, dst_ar30, width, kABGRToAR30Row_BoxIndices); +-} +- +-void ARGBToAR30Row_NEON(const uint8_t* src_argb, uint8_t* dst_ar30, int width) { +- ABCDToAR30Row_NEON(src_argb, dst_ar30, width, kARGBToAR30Row_BoxIndices); +-} +- + void ARGBToRGB24Row_NEON(const uint8_t* src_argb, + uint8_t* dst_rgb24, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld4 {v0.16b,v1.16b,v2.16b,v3.16b}, [%0], #64 \n" // load 16 ARGB + "subs %w2, %w2, #16 \n" // 16 pixels per loop. +@@ -2013,13 +1751,13 @@ void ARGBToRGB24Row_NEON(const uint8_t* + } + + void ARGBToRAWRow_NEON(const uint8_t* src_argb, uint8_t* dst_raw, int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld4 {v1.8b,v2.8b,v3.8b,v4.8b}, [%0], #32 \n" // load b g r a + "subs %w2, %w2, #8 \n" // 8 processed per loop. +- "mov v4.8b, v2.8b \n" // mov g ++ "orr v4.8b, v2.8b, v2.8b \n" // mov g + "prfm pldl1keep, [%0, 448] \n" +- "mov v5.8b, v1.8b \n" // mov b ++ "orr v5.8b, v1.8b, v1.8b \n" // mov b + "st3 {v3.8b,v4.8b,v5.8b}, [%1], #24 \n" // store r g b + "b.gt 1b \n" + : "+r"(src_argb), // %0 +@@ -2031,7 +1769,7 @@ void ARGBToRAWRow_NEON(const uint8_t* sr + } + + void YUY2ToYRow_NEON(const uint8_t* src_yuy2, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld2 {v0.16b,v1.16b}, [%0], #32 \n" // load 16 pixels of YUY2. + "subs %w2, %w2, #16 \n" // 16 processed per loop. +@@ -2047,7 +1785,7 @@ void YUY2ToYRow_NEON(const uint8_t* src_ + } + + void UYVYToYRow_NEON(const uint8_t* src_uyvy, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld2 {v0.16b,v1.16b}, [%0], #32 \n" // load 16 pixels of UYVY. + "subs %w2, %w2, #16 \n" // 16 processed per loop. +@@ -2066,7 +1804,7 @@ void YUY2ToUV422Row_NEON(const uint8_t* + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // load 16 YUY2 + "subs %w3, %w3, #16 \n" // 16 pixels = 8 UVs. +@@ -2087,7 +1825,7 @@ void UYVYToUV422Row_NEON(const uint8_t* + uint8_t* dst_u, + uint8_t* dst_v, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // load 16 UYVY + "subs %w3, %w3, #16 \n" // 16 pixels = 8 UVs. +@@ -2110,7 +1848,7 @@ void YUY2ToUVRow_NEON(const uint8_t* src + uint8_t* dst_v, + int width) { + const uint8_t* src_yuy2b = src_yuy2 + stride_yuy2; +- asm volatile ( ++ asm volatile( + "1: \n" + "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // load 16 pixels + "subs %w4, %w4, #16 \n" // 16 pixels = 8 UVs. +@@ -2138,7 +1876,7 @@ void UYVYToUVRow_NEON(const uint8_t* src + uint8_t* dst_v, + int width) { + const uint8_t* src_uyvyb = src_uyvy + stride_uyvy; +- asm volatile ( ++ asm volatile( + "1: \n" + "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // load 16 pixels + "subs %w4, %w4, #16 \n" // 16 pixels = 8 UVs. +@@ -2165,7 +1903,7 @@ void YUY2ToNVUVRow_NEON(const uint8_t* s + uint8_t* dst_uv, + int width) { + const uint8_t* src_yuy2b = src_yuy2 + stride_yuy2; +- asm volatile ( ++ asm volatile( + "1: \n" + "ld2 {v0.16b,v1.16b}, [%0], #32 \n" // load 16 pixels + "subs %w3, %w3, #16 \n" // 16 pixels = 8 UVs. +@@ -2188,7 +1926,7 @@ void ARGBShuffleRow_NEON(const uint8_t* + uint8_t* dst_argb, + const uint8_t* shuffler, + int width) { +- asm volatile ( ++ asm volatile( + "ld1 {v2.16b}, [%3] \n" // shuffler + "1: \n" + "ld1 {v0.16b}, [%0], #16 \n" // load 4 pixels. +@@ -2210,11 +1948,11 @@ void I422ToYUY2Row_NEON(const uint8_t* s + const uint8_t* src_v, + uint8_t* dst_yuy2, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld2 {v0.8b, v1.8b}, [%0], #16 \n" // load 16 Ys + "subs %w4, %w4, #16 \n" // 16 pixels +- "mov v2.8b, v1.8b \n" ++ "orr v2.8b, v1.8b, v1.8b \n" + "prfm pldl1keep, [%0, 448] \n" + "ld1 {v1.8b}, [%1], #8 \n" // load 8 Us + "ld1 {v3.8b}, [%2], #8 \n" // load 8 Vs +@@ -2234,10 +1972,10 @@ void I422ToUYVYRow_NEON(const uint8_t* s + const uint8_t* src_v, + uint8_t* dst_uyvy, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld2 {v1.8b,v2.8b}, [%0], #16 \n" // load 16 Ys +- "mov v3.8b, v2.8b \n" ++ "orr v3.8b, v2.8b, v2.8b \n" + "prfm pldl1keep, [%0, 448] \n" + "ld1 {v0.8b}, [%1], #8 \n" // load 8 Us + "ld1 {v2.8b}, [%2], #8 \n" // load 8 Vs +@@ -2256,7 +1994,7 @@ void I422ToUYVYRow_NEON(const uint8_t* s + void ARGBToRGB565Row_NEON(const uint8_t* src_argb, + uint8_t* dst_rgb565, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%0], #32 \n" // load 8 + // pixels +@@ -2273,30 +2011,31 @@ void ARGBToRGB565Row_NEON(const uint8_t* + + void ARGBToRGB565DitherRow_NEON(const uint8_t* src_argb, + uint8_t* dst_rgb, +- uint32_t dither4, ++ const uint32_t dither4, + int width) { +- asm volatile ( +- "dup v1.4s, %w3 \n" // dither4 ++ asm volatile( ++ "dup v1.4s, %w2 \n" // dither4 + "1: \n" +- "ld4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%0], #32 \n" // load 8 ARGB +- "subs %w2, %w2, #8 \n" // 8 processed per loop. ++ "ld4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%1], #32 \n" // load 8 ++ // pixels ++ "subs %w3, %w3, #8 \n" // 8 processed per loop. + "uqadd v16.8b, v16.8b, v1.8b \n" + "prfm pldl1keep, [%0, 448] \n" + "uqadd v17.8b, v17.8b, v1.8b \n" + "uqadd v18.8b, v18.8b, v1.8b \n" ARGBTORGB565 +- "st1 {v18.16b}, [%1], #16 \n" // store 8 pixels RGB565. ++ "st1 {v18.16b}, [%0], #16 \n" // store 8 pixels RGB565. + "b.gt 1b \n" +- : "+r"(src_argb), // %0 +- "+r"(dst_rgb), // %1 +- "+r"(width) // %2 +- : "r"(dither4) // %3 ++ : "+r"(dst_rgb) // %0 ++ : "r"(src_argb), // %1 ++ "r"(dither4), // %2 ++ "r"(width) // %3 + : "cc", "memory", "v1", "v16", "v17", "v18", "v19"); + } + + void ARGBToARGB1555Row_NEON(const uint8_t* src_argb, + uint8_t* dst_argb1555, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%0], #32 \n" // load 8 + // pixels +@@ -2314,7 +2053,9 @@ void ARGBToARGB1555Row_NEON(const uint8_ + void ARGBToARGB4444Row_NEON(const uint8_t* src_argb, + uint8_t* dst_argb4444, + int width) { +- asm volatile ( ++ asm volatile( ++ "movi v23.16b, #0x0f \n" // bits to clear with ++ // vbic. + "1: \n" + "ld4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%0], #32 \n" // load 8 + // pixels +@@ -2326,14 +2067,14 @@ void ARGBToARGB4444Row_NEON(const uint8_ + "+r"(dst_argb4444), // %1 + "+r"(width) // %2 + : +- : "cc", "memory", "v0", "v1", "v16", "v17", "v18", "v19"); ++ : "cc", "memory", "v0", "v1", "v16", "v17", "v18", "v19", "v23"); + } + + #if LIBYUV_USE_ST2 + void ARGBToAR64Row_NEON(const uint8_t* src_argb, + uint16_t* dst_ar64, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ldp q0, q2, [%0], #32 \n" // load 8 pixels + "mov v1.16b, v0.16b \n" +@@ -2356,7 +2097,7 @@ static const uvec8 kShuffleARGBToABGR = + void ARGBToAB64Row_NEON(const uint8_t* src_argb, + uint16_t* dst_ab64, + int width) { +- asm volatile ( ++ asm volatile( + "ldr q4, [%3] \n" // shuffler + "1: \n" + "ldp q0, q2, [%0], #32 \n" // load 8 pixels +@@ -2379,7 +2120,7 @@ void ARGBToAB64Row_NEON(const uint8_t* s + void ARGBToAR64Row_NEON(const uint8_t* src_argb, + uint16_t* dst_ar64, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ldp q0, q1, [%0], #32 \n" // load 8 ARGB pixels + "subs %w2, %w2, #8 \n" // 8 processed per loop. +@@ -2404,7 +2145,7 @@ static const uvec8 kShuffleARGBToAB64[2] + void ARGBToAB64Row_NEON(const uint8_t* src_argb, + uint16_t* dst_ab64, + int width) { +- asm volatile ( ++ asm volatile( + "ldp q6, q7, [%3] \n" // 2 shufflers + "1: \n" + "ldp q0, q1, [%0], #32 \n" // load 8 pixels +@@ -2430,7 +2171,7 @@ static const uvec8 kShuffleAR64ToARGB = + void AR64ToARGBRow_NEON(const uint16_t* src_ar64, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "ldr q4, [%3] \n" // shuffler + "1: \n" + "ldp q0, q1, [%0], #32 \n" // load 4 pixels +@@ -2454,7 +2195,7 @@ static const uvec8 kShuffleAB64ToARGB = + void AB64ToARGBRow_NEON(const uint16_t* src_ab64, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "ldr q4, [%3] \n" // shuffler + "1: \n" + "ldp q0, q1, [%0], #32 \n" // load 4 pixels +@@ -2475,7 +2216,7 @@ void AB64ToARGBRow_NEON(const uint16_t* + void ARGBExtractAlphaRow_NEON(const uint8_t* src_argb, + uint8_t* dst_a, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld4 {v0.16b,v1.16b,v2.16b,v3.16b}, [%0], #64 \n" // load 16 + "prfm pldl1keep, [%0, 448] \n" +@@ -2490,26 +2231,19 @@ void ARGBExtractAlphaRow_NEON(const uint + ); + } + +-struct RgbUVConstants { +- uint8_t kRGBToU[4]; +- uint8_t kRGBToV[4]; +-}; +- + // 8x1 pixels. +-void ARGBToUV444MatrixRow_NEON(const uint8_t* src_argb, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width, +- const struct RgbUVConstants* rgbuvconstants) { +- asm volatile ( +- "ldr d0, [%4] \n" // load rgbuvconstants +- "dup v24.16b, v0.b[0] \n" // UB 0.875 coefficient +- "dup v25.16b, v0.b[1] \n" // UG -0.5781 coefficient +- "dup v26.16b, v0.b[2] \n" // UR -0.2969 coefficient +- "dup v27.16b, v0.b[4] \n" // VB -0.1406 coefficient +- "dup v28.16b, v0.b[5] \n" // VG -0.7344 coefficient +- "movi v29.16b, #0x80 \n" // 128.5 +- ++void ARGBToUV444Row_NEON(const uint8_t* src_argb, ++ uint8_t* dst_u, ++ uint8_t* dst_v, ++ int width) { ++ asm volatile( ++ "movi v24.8b, #112 \n" // UB / VR 0.875 ++ // coefficient ++ "movi v25.8b, #74 \n" // UG -0.5781 coefficient ++ "movi v26.8b, #38 \n" // UR -0.2969 coefficient ++ "movi v27.8b, #18 \n" // VB -0.1406 coefficient ++ "movi v28.8b, #94 \n" // VG -0.7344 coefficient ++ "movi v29.16b,#0x80 \n" // 128.5 + "1: \n" + "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // load 8 ARGB + "subs %w3, %w3, #8 \n" // 8 processed per loop. +@@ -2528,34 +2262,15 @@ void ARGBToUV444MatrixRow_NEON(const uin + "st1 {v0.8b}, [%1], #8 \n" // store 8 pixels U. + "st1 {v1.8b}, [%2], #8 \n" // store 8 pixels V. + "b.gt 1b \n" +- : "+r"(src_argb), // %0 +- "+r"(dst_u), // %1 +- "+r"(dst_v), // %2 +- "+r"(width) // %3 +- : "r"(rgbuvconstants) // %4 ++ : "+r"(src_argb), // %0 ++ "+r"(dst_u), // %1 ++ "+r"(dst_v), // %2 ++ "+r"(width) // %3 ++ : + : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v24", "v25", "v26", + "v27", "v28", "v29"); + } + +-// RGB to bt601 coefficients +-// UB 0.875 coefficient = 112 +-// UG -0.5781 coefficient = 74 +-// UR -0.2969 coefficient = 38 +-// VB -0.1406 coefficient = 18 +-// VG -0.7344 coefficient = 94 +-// VR 0.875 coefficient = 112 (ignored) +- +-static const struct RgbUVConstants kRgb24I601UVConstants = {{112, 74, 38, 0}, +- {18, 94, 112, 0}}; +- +-void ARGBToUV444Row_NEON(const uint8_t* src_argb, +- uint8_t* dst_u, +- uint8_t* dst_v, +- int width) { +- ARGBToUV444MatrixRow_NEON(src_argb, dst_u, dst_v, width, +- &kRgb24I601UVConstants); +-} +- + #define RGBTOUV_SETUP_REG \ + "movi v20.8h, #56, lsl #0 \n" /* UB/VR coefficient (0.875) / 2 */ \ + "movi v21.8h, #37, lsl #0 \n" /* UG coefficient (-0.5781) / 2 */ \ +@@ -3009,7 +2724,7 @@ void RGB565ToUVRow_NEON(const uint8_t* s + uint8_t* dst_v, + int width) { + const uint8_t* src_rgb565_1 = src_rgb565 + src_stride_rgb565; +- asm volatile ( ++ asm volatile( + RGBTOUV_SETUP_REG + "1: \n" + "ld1 {v0.16b}, [%0], #16 \n" // load 8 RGB565 pixels. +@@ -3067,7 +2782,7 @@ void ARGB1555ToUVRow_NEON(const uint8_t* + uint8_t* dst_v, + int width) { + const uint8_t* src_argb1555_1 = src_argb1555 + src_stride_argb1555; +- asm volatile ( ++ asm volatile( + RGBTOUV_SETUP_REG + "1: \n" + "ld1 {v0.16b}, [%0], #16 \n" // load 8 ARGB1555 pixels. +@@ -3115,7 +2830,7 @@ void ARGB1555ToUVRow_NEON(const uint8_t* + : + : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v16", "v17", + "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", "v26", "v27", +- "v28", "v29"); ++ "v28"); + } + + // 16x2 pixels -> 8x1. width is number of argb pixels. e.g. 16. +@@ -3125,29 +2840,29 @@ void ARGB4444ToUVRow_NEON(const uint8_t* + uint8_t* dst_v, + int width) { + const uint8_t* src_argb4444_1 = src_argb4444 + src_stride_argb4444; +- asm volatile ( ++ asm volatile( + RGBTOUV_SETUP_REG // sets v20-v25 + "1: \n" + "ld1 {v0.16b}, [%0], #16 \n" // load 8 ARGB4444 pixels. +- ARGB4444TORGB ++ ARGB4444TOARGB + "uaddlp v16.4h, v0.8b \n" // B 8 bytes -> 4 shorts. + "prfm pldl1keep, [%0, 448] \n" + "uaddlp v17.4h, v1.8b \n" // G 8 bytes -> 4 shorts. + "uaddlp v18.4h, v2.8b \n" // R 8 bytes -> 4 shorts. + "ld1 {v0.16b}, [%0], #16 \n" // next 8 ARGB4444 pixels. +- ARGB4444TORGB ++ ARGB4444TOARGB + "uaddlp v26.4h, v0.8b \n" // B 8 bytes -> 4 shorts. + "uaddlp v27.4h, v1.8b \n" // G 8 bytes -> 4 shorts. + "uaddlp v28.4h, v2.8b \n" // R 8 bytes -> 4 shorts. + + "ld1 {v0.16b}, [%1], #16 \n" // load 8 ARGB4444 pixels. +- ARGB4444TORGB ++ ARGB4444TOARGB + "uadalp v16.4h, v0.8b \n" // B 8 bytes -> 4 shorts. + "prfm pldl1keep, [%1, 448] \n" + "uadalp v17.4h, v1.8b \n" // G 8 bytes -> 4 shorts. + "uadalp v18.4h, v2.8b \n" // R 8 bytes -> 4 shorts. + "ld1 {v0.16b}, [%1], #16 \n" // next 8 ARGB4444 pixels. +- ARGB4444TORGB ++ ARGB4444TOARGB + "uadalp v26.4h, v0.8b \n" // B 8 bytes -> 4 shorts. + "uadalp v27.4h, v1.8b \n" // G 8 bytes -> 4 shorts. + "uadalp v28.4h, v2.8b \n" // R 8 bytes -> 4 shorts. +@@ -3179,7 +2894,7 @@ void ARGB4444ToUVRow_NEON(const uint8_t* + } + + void RGB565ToYRow_NEON(const uint8_t* src_rgb565, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "movi v24.8b, #25 \n" // B * 0.1016 coefficient + "movi v25.8b, #129 \n" // G * 0.5078 coefficient + "movi v26.8b, #66 \n" // R * 0.2578 coefficient +@@ -3207,7 +2922,7 @@ void RGB565ToYRow_NEON(const uint8_t* sr + void ARGB1555ToYRow_NEON(const uint8_t* src_argb1555, + uint8_t* dst_y, + int width) { +- asm volatile ( ++ asm volatile( + "movi v4.8b, #25 \n" // B * 0.1016 coefficient + "movi v5.8b, #129 \n" // G * 0.5078 coefficient + "movi v6.8b, #66 \n" // R * 0.2578 coefficient +@@ -3215,7 +2930,7 @@ void ARGB1555ToYRow_NEON(const uint8_t* + "1: \n" + "ld1 {v0.16b}, [%0], #16 \n" // load 8 ARGB1555 pixels. + "subs %w2, %w2, #8 \n" // 8 processed per loop. +- RGB555TOARGB ++ ARGB1555TOARGB + "umull v3.8h, v0.8b, v4.8b \n" // B + "prfm pldl1keep, [%0, 448] \n" + "umlal v3.8h, v1.8b, v5.8b \n" // G +@@ -3228,13 +2943,13 @@ void ARGB1555ToYRow_NEON(const uint8_t* + "+r"(dst_y), // %1 + "+r"(width) // %2 + : +- : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v29"); ++ : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7"); + } + + void ARGB4444ToYRow_NEON(const uint8_t* src_argb4444, + uint8_t* dst_y, + int width) { +- asm volatile ( ++ asm volatile( + "movi v24.8b, #25 \n" // B * 0.1016 coefficient + "movi v25.8b, #129 \n" // G * 0.5078 coefficient + "movi v26.8b, #66 \n" // R * 0.2578 coefficient +@@ -3242,7 +2957,7 @@ void ARGB4444ToYRow_NEON(const uint8_t* + "1: \n" + "ld1 {v0.16b}, [%0], #16 \n" // load 8 ARGB4444 pixels. + "subs %w2, %w2, #8 \n" // 8 processed per loop. +- ARGB4444TORGB ++ ARGB4444TOARGB + "umull v3.8h, v0.8b, v24.8b \n" // B + "prfm pldl1keep, [%0, 448] \n" + "umlal v3.8h, v1.8b, v25.8b \n" // G +@@ -3261,14 +2976,40 @@ void ARGB4444ToYRow_NEON(const uint8_t* + struct RgbConstants { + uint8_t kRGBToY[4]; + uint16_t kAddY; ++ uint16_t pad; + }; + ++// RGB to JPeg coefficients ++// B * 0.1140 coefficient = 29 ++// G * 0.5870 coefficient = 150 ++// R * 0.2990 coefficient = 77 ++// Add 0.5 = 0x80 ++static const struct RgbConstants kRgb24JPEGConstants = {{29, 150, 77, 0}, ++ 128, ++ 0}; ++ ++static const struct RgbConstants kRawJPEGConstants = {{77, 150, 29, 0}, 128, 0}; ++ ++// RGB to BT.601 coefficients ++// B * 0.1016 coefficient = 25 ++// G * 0.5078 coefficient = 129 ++// R * 0.2578 coefficient = 66 ++// Add 16.5 = 0x1080 ++ ++static const struct RgbConstants kRgb24I601Constants = {{25, 129, 66, 0}, ++ 0x1080, ++ 0}; ++ ++static const struct RgbConstants kRawI601Constants = {{66, 129, 25, 0}, ++ 0x1080, ++ 0}; ++ + // ARGB expects first 3 values to contain RGB and 4th value is ignored. + void ARGBToYMatrixRow_NEON(const uint8_t* src_argb, + uint8_t* dst_y, + int width, + const struct RgbConstants* rgbconstants) { +- asm volatile ( ++ asm volatile( + "ldr d0, [%3] \n" // load rgbconstants + "dup v6.16b, v0.b[0] \n" + "dup v7.16b, v0.b[1] \n" +@@ -3297,67 +3038,6 @@ void ARGBToYMatrixRow_NEON(const uint8_t + "v17"); + } + +-void +-ARGBToYMatrixRow_NEON_DotProd(const uint8_t* src_argb, +- uint8_t* dst_y, +- int width, +- const struct RgbConstants* rgbconstants) { +- asm volatile ( +- "ldr d0, [%3] \n" // load rgbconstants +- "dup v16.4s, v0.s[0] \n" +- "dup v17.8h, v0.h[2] \n" +- "1: \n" +- "ld1 {v4.16b, v5.16b, v6.16b, v7.16b}, [%0], #64 \n" // load 16 +- // pixels. +- "subs %w2, %w2, #16 \n" // 16 processed per loop. +- "movi v0.16b, #0 \n" +- "movi v1.16b, #0 \n" +- "movi v2.16b, #0 \n" +- "movi v3.16b, #0 \n" +- "udot v0.4s, v4.16b, v16.16b \n" +- "udot v1.4s, v5.16b, v16.16b \n" +- "udot v2.4s, v6.16b, v16.16b \n" +- "udot v3.4s, v7.16b, v16.16b \n" +- "uzp1 v0.8h, v0.8h, v1.8h \n" +- "uzp1 v1.8h, v2.8h, v3.8h \n" +- "addhn v0.8b, v0.8h, v17.8h \n" +- "addhn v1.8b, v1.8h, v17.8h \n" +- "st1 {v0.8b, v1.8b}, [%1], #16 \n" // store 16 pixels Y. +- "b.gt 1b \n" +- : "+r"(src_argb), // %0 +- "+r"(dst_y), // %1 +- "+r"(width) // %2 +- : "r"(rgbconstants) // %3 +- : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", +- "v17"); +-} +- +-// RGB to JPeg coefficients +-// B * 0.1140 coefficient = 29 +-// G * 0.5870 coefficient = 150 +-// R * 0.2990 coefficient = 77 +-// Add 0.5 = 0x80 +-static const struct RgbConstants kRgb24JPEGConstants = {{29, 150, 77, 0}, 128}; +-static const struct RgbConstants kRgb24JPEGDotProdConstants = {{0, 29, 150, 77}, +- 128}; +- +-static const struct RgbConstants kRawJPEGConstants = {{77, 150, 29, 0}, 128}; +- +-// RGB to BT.601 coefficients +-// B * 0.1016 coefficient = 25 +-// G * 0.5078 coefficient = 129 +-// R * 0.2578 coefficient = 66 +-// Add 16.5 = 0x1080 +- +-static const struct RgbConstants kRgb24I601Constants = {{25, 129, 66, 0}, +- 0x1080}; +-static const struct RgbConstants kRgb24I601DotProdConstants = {{0, 25, 129, 66}, +- 0x1080}; +- +-static const struct RgbConstants kRawI601Constants = {{66, 129, 25, 0}, 0x1080}; +-static const struct RgbConstants kRawI601DotProdConstants = {{0, 66, 129, 25}, +- 0x1080}; +- + void ARGBToYRow_NEON(const uint8_t* src_argb, uint8_t* dst_y, int width) { + ARGBToYMatrixRow_NEON(src_argb, dst_y, width, &kRgb24I601Constants); + } +@@ -3374,37 +3054,13 @@ void ABGRToYJRow_NEON(const uint8_t* src + ARGBToYMatrixRow_NEON(src_abgr, dst_yj, width, &kRawJPEGConstants); + } + +-void ARGBToYRow_NEON_DotProd(const uint8_t* src_argb, +- uint8_t* dst_y, +- int width) { +- ARGBToYMatrixRow_NEON_DotProd(src_argb, dst_y, width, &kRgb24I601Constants); +-} +- +-void ARGBToYJRow_NEON_DotProd(const uint8_t* src_argb, +- uint8_t* dst_yj, +- int width) { +- ARGBToYMatrixRow_NEON_DotProd(src_argb, dst_yj, width, &kRgb24JPEGConstants); +-} +- +-void ABGRToYRow_NEON_DotProd(const uint8_t* src_abgr, +- uint8_t* dst_y, +- int width) { +- ARGBToYMatrixRow_NEON_DotProd(src_abgr, dst_y, width, &kRawI601Constants); +-} +- +-void ABGRToYJRow_NEON_DotProd(const uint8_t* src_abgr, +- uint8_t* dst_yj, +- int width) { +- ARGBToYMatrixRow_NEON_DotProd(src_abgr, dst_yj, width, &kRawJPEGConstants); +-} +- + // RGBA expects first value to be A and ignored, then 3 values to contain RGB. + // Same code as ARGB, except the LD4 + void RGBAToYMatrixRow_NEON(const uint8_t* src_rgba, + uint8_t* dst_y, + int width, + const struct RgbConstants* rgbconstants) { +- asm volatile ( ++ asm volatile( + "ldr d0, [%3] \n" // load rgbconstants + "dup v6.16b, v0.b[0] \n" + "dup v7.16b, v0.b[1] \n" +@@ -3445,38 +3101,11 @@ void BGRAToYRow_NEON(const uint8_t* src_ + RGBAToYMatrixRow_NEON(src_bgra, dst_y, width, &kRawI601Constants); + } + +-void RGBAToYRow_NEON_DotProd(const uint8_t* src_rgba, +- uint8_t* dst_y, +- int width) { +- // No need for a separate implementation for RGBA inputs, just permute the +- // RGB constants. +- ARGBToYMatrixRow_NEON_DotProd(src_rgba, dst_y, width, +- &kRgb24I601DotProdConstants); +-} +- +-void RGBAToYJRow_NEON_DotProd(const uint8_t* src_rgba, +- uint8_t* dst_yj, +- int width) { +- // No need for a separate implementation for RGBA inputs, just permute the +- // RGB constants. +- ARGBToYMatrixRow_NEON_DotProd(src_rgba, dst_yj, width, +- &kRgb24JPEGDotProdConstants); +-} +- +-void BGRAToYRow_NEON_DotProd(const uint8_t* src_bgra, +- uint8_t* dst_y, +- int width) { +- // No need for a separate implementation for RGBA inputs, just permute the +- // RGB constants. +- ARGBToYMatrixRow_NEON_DotProd(src_bgra, dst_y, width, +- &kRawI601DotProdConstants); +-} +- + void RGBToYMatrixRow_NEON(const uint8_t* src_rgb, + uint8_t* dst_y, + int width, + const struct RgbConstants* rgbconstants) { +- asm volatile ( ++ asm volatile( + "ldr d0, [%3] \n" // load rgbconstants + "dup v5.16b, v0.b[0] \n" + "dup v6.16b, v0.b[1] \n" +@@ -3528,7 +3157,7 @@ void InterpolateRow_NEON(uint8_t* dst_pt + int y1_fraction = source_y_fraction; + int y0_fraction = 256 - y1_fraction; + const uint8_t* src_ptr1 = src_ptr + src_stride; +- asm volatile ( ++ asm volatile( + "cmp %w4, #0 \n" + "b.eq 100f \n" + "cmp %w4, #128 \n" +@@ -3594,7 +3223,7 @@ void InterpolateRow_16_NEON(uint16_t* ds + int y0_fraction = 256 - y1_fraction; + const uint16_t* src_ptr1 = src_ptr + src_stride; + +- asm volatile ( ++ asm volatile( + "cmp %w4, #0 \n" + "b.eq 100f \n" + "cmp %w4, #128 \n" +@@ -3666,7 +3295,7 @@ void InterpolateRow_16To8_NEON(uint8_t* + const uint16_t* src_ptr1 = src_ptr + src_stride; + int shift = 15 - __builtin_clz((int32_t)scale); // Negative shl is shr + +- asm volatile ( ++ asm volatile( + "dup v6.8h, %w6 \n" + "cmp %w4, #0 \n" + "b.eq 100f \n" +@@ -3734,7 +3363,7 @@ void ARGBBlendRow_NEON(const uint8_t* sr + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "subs %w3, %w3, #8 \n" + "b.lt 89f \n" + // Blend 8 pixels. +@@ -3805,9 +3434,7 @@ void ARGBBlendRow_NEON(const uint8_t* sr + void ARGBAttenuateRow_NEON(const uint8_t* src_argb, + uint8_t* dst_argb, + int width) { +- asm volatile ( +- "movi v7.8h, #0x00ff \n" // 255 for rounding up +- ++ asm volatile( + // Attenuate 8 pixels. + "1: \n" + "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // load 8 ARGB +@@ -3816,16 +3443,16 @@ void ARGBAttenuateRow_NEON(const uint8_t + "prfm pldl1keep, [%0, 448] \n" + "umull v5.8h, v1.8b, v3.8b \n" // g * a + "umull v6.8h, v2.8b, v3.8b \n" // r * a +- "addhn v0.8b, v4.8h, v7.8h \n" // (b + 255) >> 8 +- "addhn v1.8b, v5.8h, v7.8h \n" // (g + 255) >> 8 +- "addhn v2.8b, v6.8h, v7.8h \n" // (r + 255) >> 8 ++ "uqrshrn v0.8b, v4.8h, #8 \n" // b >>= 8 ++ "uqrshrn v1.8b, v5.8h, #8 \n" // g >>= 8 ++ "uqrshrn v2.8b, v6.8h, #8 \n" // r >>= 8 + "st4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%1], #32 \n" // store 8 ARGB + "b.gt 1b \n" + : "+r"(src_argb), // %0 + "+r"(dst_argb), // %1 + "+r"(width) // %2 + : +- : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7"); ++ : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6"); + } + + // Quantize 8 ARGB pixels (32 bytes). +@@ -3835,7 +3462,7 @@ void ARGBQuantizeRow_NEON(uint8_t* dst_a + int interval_size, + int interval_offset, + int width) { +- asm volatile ( ++ asm volatile( + "dup v4.8h, %w2 \n" + "ushr v4.8h, v4.8h, #1 \n" // scale >>= 1 + "dup v5.8h, %w3 \n" // interval multiply. +@@ -3872,36 +3499,36 @@ void ARGBQuantizeRow_NEON(uint8_t* dst_a + } + + // Shade 8 pixels at a time by specified value. +-// sqrdmulh is a rounding instruction, so +1 if high bit of low half of +-// multiply result is set. ++// NOTE vqrdmulh.s16 q10, q10, d0[0] must use a scaler register from 0 to 8. ++// Rounding in vqrdmulh does +1 to high if high bit of low s16 is set. + void ARGBShadeRow_NEON(const uint8_t* src_argb, + uint8_t* dst_argb, + int width, + uint32_t value) { +- asm volatile ( +- "dup v0.4s, %w3 \n" // duplicate scale value. +- "zip1 v0.16b, v0.16b, v0.16b \n" // v0.16b aarrggbbaarrggbb. +- "ushr v0.8h, v0.8h, #1 \n" // scale / 2. ++ asm volatile( ++ "dup v0.4s, %w3 \n" // duplicate scale value. ++ "zip1 v0.8b, v0.8b, v0.8b \n" // v0.8b aarrggbb. ++ "ushr v0.8h, v0.8h, #1 \n" // scale / 2. + + // 8 pixel loop. +- "1: \n" +- "ld1 {v4.8b,v5.8b,v6.8b,v7.8b}, [%0], #32 \n" // load 8 ARGB +- "subs %w2, %w2, #8 \n" // 8 processed per loop. +- "uxtl v4.8h, v4.8b \n" +- "prfm pldl1keep, [%0, 448] \n" +- "uxtl v5.8h, v5.8b \n" +- "uxtl v6.8h, v6.8b \n" +- "uxtl v7.8h, v7.8b \n" +- "sqrdmulh v4.8h, v4.8h, v0.8h \n" // argb * scale * 2 +- "sqrdmulh v5.8h, v5.8h, v0.8h \n" +- "sqrdmulh v6.8h, v6.8h, v0.8h \n" +- "sqrdmulh v7.8h, v7.8h, v0.8h \n" +- "uqxtn v4.8b, v4.8h \n" +- "uqxtn v5.8b, v5.8h \n" +- "uqxtn v6.8b, v6.8h \n" +- "uqxtn v7.8b, v7.8h \n" +- "st1 {v4.8b,v5.8b,v6.8b,v7.8b}, [%1], #32 \n" // store 8 ARGB +- "b.gt 1b \n" ++ "1: \n" ++ "ld4 {v4.8b,v5.8b,v6.8b,v7.8b}, [%0], #32 \n" // load 8 ARGB ++ "subs %w2, %w2, #8 \n" // 8 processed per loop. ++ "uxtl v4.8h, v4.8b \n" // b (0 .. 255) ++ "prfm pldl1keep, [%0, 448] \n" ++ "uxtl v5.8h, v5.8b \n" ++ "uxtl v6.8h, v6.8b \n" ++ "uxtl v7.8h, v7.8b \n" ++ "sqrdmulh v4.8h, v4.8h, v0.h[0] \n" // b * scale * 2 ++ "sqrdmulh v5.8h, v5.8h, v0.h[1] \n" // g ++ "sqrdmulh v6.8h, v6.8h, v0.h[2] \n" // r ++ "sqrdmulh v7.8h, v7.8h, v0.h[3] \n" // a ++ "uqxtn v4.8b, v4.8h \n" ++ "uqxtn v5.8b, v5.8h \n" ++ "uqxtn v6.8b, v6.8h \n" ++ "uqxtn v7.8b, v7.8h \n" ++ "st4 {v4.8b,v5.8b,v6.8b,v7.8b}, [%1], #32 \n" // store 8 ARGB ++ "b.gt 1b \n" + : "+r"(src_argb), // %0 + "+r"(dst_argb), // %1 + "+r"(width) // %2 +@@ -3913,7 +3540,7 @@ void ARGBShadeRow_NEON(const uint8_t* sr + // Similar to ARGBToYJ but stores ARGB. + // C code is (29 * b + 150 * g + 77 * r + 128) >> 8; + void ARGBGrayRow_NEON(const uint8_t* src_argb, uint8_t* dst_argb, int width) { +- asm volatile ( ++ asm volatile( + "movi v24.8b, #29 \n" // B * 0.1140 coefficient + "movi v25.8b, #150 \n" // G * 0.5870 coefficient + "movi v26.8b, #77 \n" // R * 0.2990 coefficient +@@ -3925,8 +3552,8 @@ void ARGBGrayRow_NEON(const uint8_t* src + "umlal v4.8h, v1.8b, v25.8b \n" // G + "umlal v4.8h, v2.8b, v26.8b \n" // R + "uqrshrn v0.8b, v4.8h, #8 \n" // 16 bit to 8 bit B +- "mov v1.8b, v0.8b \n" // G +- "mov v2.8b, v0.8b \n" // R ++ "orr v1.8b, v0.8b, v0.8b \n" // G ++ "orr v2.8b, v0.8b, v0.8b \n" // R + "st4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%1], #32 \n" // store 8 pixels. + "b.gt 1b \n" + : "+r"(src_argb), // %0 +@@ -3942,7 +3569,7 @@ void ARGBGrayRow_NEON(const uint8_t* src + // r = (r * 50 + g * 98 + b * 24) >> 7 + + void ARGBSepiaRow_NEON(uint8_t* dst_argb, int width) { +- asm volatile ( ++ asm volatile( + "movi v20.8b, #17 \n" // BB coefficient + "movi v21.8b, #68 \n" // BG coefficient + "movi v22.8b, #35 \n" // BR coefficient +@@ -3984,7 +3611,7 @@ void ARGBColorMatrixRow_NEON(const uint8 + uint8_t* dst_argb, + const int8_t* matrix_argb, + int width) { +- asm volatile ( ++ asm volatile( + "ld1 {v2.16b}, [%3] \n" // load 3 ARGB vectors. + "sxtl v0.8h, v2.8b \n" // B,G coefficients s16. + "sxtl2 v1.8h, v2.16b \n" // R,A coefficients s16. +@@ -4039,72 +3666,17 @@ void ARGBColorMatrixRow_NEON(const uint8 + "v17", "v18", "v19", "v22", "v23", "v24", "v25"); + } + +-void ARGBColorMatrixRow_NEON_I8MM(const uint8_t* src_argb, +- uint8_t* dst_argb, +- const int8_t* matrix_argb, +- int width) { +- asm("ld1 {v31.16b}, [%[matrix_argb]] \n" +- +- "1: \n" +- "ld1 {v0.16b, v1.16b}, [%[src_argb]], #32 \n" +- +- "movi v16.4s, #0 \n" +- "movi v17.4s, #0 \n" +- "movi v18.4s, #0 \n" +- "movi v19.4s, #0 \n" +- "movi v20.4s, #0 \n" +- "movi v21.4s, #0 \n" +- "movi v22.4s, #0 \n" +- "movi v23.4s, #0 \n" +- +- // 8 processed per loop. +- "subs %w2, %w2, #8 \n" +- "prfm pldl1keep, [%[src_argb], 448] \n" +- +- "sudot v16.4s, v31.16b, v0.4b[0] \n" +- "sudot v17.4s, v31.16b, v0.4b[1] \n" +- "sudot v18.4s, v31.16b, v0.4b[2] \n" +- "sudot v19.4s, v31.16b, v0.4b[3] \n" +- "sudot v20.4s, v31.16b, v1.4b[0] \n" +- "sudot v21.4s, v31.16b, v1.4b[1] \n" +- "sudot v22.4s, v31.16b, v1.4b[2] \n" +- "sudot v23.4s, v31.16b, v1.4b[3] \n" +- +- "shrn v16.4h, v16.4s, #6 \n" +- "shrn v18.4h, v18.4s, #6 \n" +- "shrn v20.4h, v20.4s, #6 \n" +- "shrn v22.4h, v22.4s, #6 \n" +- "shrn2 v16.8h, v17.4s, #6 \n" +- "shrn2 v18.8h, v19.4s, #6 \n" +- "shrn2 v20.8h, v21.4s, #6 \n" +- "shrn2 v22.8h, v23.4s, #6 \n" +- +- "uqxtn v16.8b, v16.8h \n" +- "uqxtn v18.8b, v18.8h \n" +- "uqxtn v20.8b, v20.8h \n" +- "uqxtn v22.8b, v22.8h \n" +- +- "stp d16, d18, [%[dst_argb]], #16 \n" +- "stp d20, d22, [%[dst_argb]], #16 \n" +- "b.gt 1b \n" +- : [src_argb] "+r"(src_argb), // %[src_argb] +- [dst_argb] "+r"(dst_argb), // %[dst_argb] +- [width] "+r"(width) // %[width] +- : [matrix_argb] "r"(matrix_argb) // %[matrix_argb] +- : "cc", "memory", "v0", "v1", "v16", "v17", "v18", "v19", "v20", "v21", +- "v22", "v23", "v31"); +-} +- ++// TODO(fbarchard): fix vqshrun in ARGBMultiplyRow_NEON and reenable. + // Multiply 2 rows of ARGB pixels together, 8 pixels at a time. + void ARGBMultiplyRow_NEON(const uint8_t* src_argb, + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + // 8 pixel loop. + "1: \n" +- "ld1 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // load 8 ARGB +- "ld1 {v4.8b,v5.8b,v6.8b,v7.8b}, [%1], #32 \n" // load 8 more ++ "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // load 8 ARGB ++ "ld4 {v4.8b,v5.8b,v6.8b,v7.8b}, [%1], #32 \n" // load 8 more + "subs %w3, %w3, #8 \n" // 8 processed per loop. + "umull v0.8h, v0.8b, v4.8b \n" // multiply B + "prfm pldl1keep, [%0, 448] \n" +@@ -4116,7 +3688,7 @@ void ARGBMultiplyRow_NEON(const uint8_t* + "rshrn v1.8b, v1.8h, #8 \n" // 16 bit to 8 bit G + "rshrn v2.8b, v2.8h, #8 \n" // 16 bit to 8 bit R + "rshrn v3.8b, v3.8h, #8 \n" // 16 bit to 8 bit A +- "st1 {v0.8b,v1.8b,v2.8b,v3.8b}, [%2], #32 \n" // store 8 ARGB ++ "st4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%2], #32 \n" // store 8 ARGB + "b.gt 1b \n" + : "+r"(src_argb), // %0 + "+r"(src_argb1), // %1 +@@ -4131,17 +3703,19 @@ void ARGBAddRow_NEON(const uint8_t* src_ + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + // 8 pixel loop. + "1: \n" +- "ldp q0, q1, [%0], #32 \n" // load 8 ARGB +- "ldp q4, q5, [%1], #32 \n" // load 8 more ++ "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // load 8 ARGB ++ "ld4 {v4.8b,v5.8b,v6.8b,v7.8b}, [%1], #32 \n" // load 8 more + "subs %w3, %w3, #8 \n" // 8 processed per loop. ++ "uqadd v0.8b, v0.8b, v4.8b \n" + "prfm pldl1keep, [%0, 448] \n" ++ "uqadd v1.8b, v1.8b, v5.8b \n" + "prfm pldl1keep, [%1, 448] \n" +- "uqadd v0.16b, v0.16b, v4.16b \n" +- "uqadd v1.16b, v1.16b, v5.16b \n" +- "stp q0, q1, [%2], #32 \n" // store 8 ARGB ++ "uqadd v2.8b, v2.8b, v6.8b \n" ++ "uqadd v3.8b, v3.8b, v7.8b \n" ++ "st4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%2], #32 \n" // store 8 ARGB + "b.gt 1b \n" + : "+r"(src_argb), // %0 + "+r"(src_argb1), // %1 +@@ -4156,17 +3730,19 @@ void ARGBSubtractRow_NEON(const uint8_t* + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + // 8 pixel loop. + "1: \n" +- "ldp q0, q1, [%0], #32 \n" // load 8 ARGB +- "ldp q4, q5, [%1], #32 \n" // load 8 more ++ "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // load 8 ARGB ++ "ld4 {v4.8b,v5.8b,v6.8b,v7.8b}, [%1], #32 \n" // load 8 more + "subs %w3, %w3, #8 \n" // 8 processed per loop. ++ "uqsub v0.8b, v0.8b, v4.8b \n" + "prfm pldl1keep, [%0, 448] \n" ++ "uqsub v1.8b, v1.8b, v5.8b \n" + "prfm pldl1keep, [%1, 448] \n" +- "uqsub v0.16b, v0.16b, v4.16b \n" +- "uqsub v1.16b, v1.16b, v5.16b \n" +- "stp q0, q1, [%2], #32 \n" // store 8 ARGB ++ "uqsub v2.8b, v2.8b, v6.8b \n" ++ "uqsub v3.8b, v3.8b, v7.8b \n" ++ "st4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%2], #32 \n" // store 8 ARGB + "b.gt 1b \n" + : "+r"(src_argb), // %0 + "+r"(src_argb1), // %1 +@@ -4185,7 +3761,7 @@ void SobelRow_NEON(const uint8_t* src_so + const uint8_t* src_sobely, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "movi v3.8b, #255 \n" // alpha + // 8 pixel loop. + "1: \n" +@@ -4194,9 +3770,9 @@ void SobelRow_NEON(const uint8_t* src_so + "subs %w3, %w3, #8 \n" // 8 processed per loop. + "uqadd v0.8b, v0.8b, v1.8b \n" // add + "prfm pldl1keep, [%0, 448] \n" +- "mov v1.8b, v0.8b \n" ++ "orr v1.8b, v0.8b, v0.8b \n" + "prfm pldl1keep, [%1, 448] \n" +- "mov v2.8b, v0.8b \n" ++ "orr v2.8b, v0.8b, v0.8b \n" + "st4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%2], #32 \n" // store 8 ARGB + "b.gt 1b \n" + : "+r"(src_sobelx), // %0 +@@ -4212,7 +3788,7 @@ void SobelToPlaneRow_NEON(const uint8_t* + const uint8_t* src_sobely, + uint8_t* dst_y, + int width) { +- asm volatile ( ++ asm volatile( + // 16 pixel loop. + "1: \n" + "ld1 {v0.16b}, [%0], #16 \n" // load 16 sobelx. +@@ -4240,7 +3816,7 @@ void SobelXYRow_NEON(const uint8_t* src_ + const uint8_t* src_sobely, + uint8_t* dst_argb, + int width) { +- asm volatile ( ++ asm volatile( + "movi v3.8b, #255 \n" // alpha + // 8 pixel loop. + "1: \n" +@@ -4269,7 +3845,7 @@ void SobelXRow_NEON(const uint8_t* src_y + const uint8_t* src_y2, + uint8_t* dst_sobelx, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld1 {v0.8b}, [%0],%5 \n" // top + "ld1 {v1.8b}, [%0],%6 \n" +@@ -4310,7 +3886,7 @@ void SobelYRow_NEON(const uint8_t* src_y + const uint8_t* src_y1, + uint8_t* dst_sobely, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld1 {v0.8b}, [%0],%4 \n" // left + "ld1 {v1.8b}, [%1],%4 \n" +@@ -4346,7 +3922,7 @@ void HalfFloat1Row_NEON(const uint16_t* + uint16_t* dst, + float /*unused*/, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld1 {v1.16b}, [%0], #16 \n" // load 8 shorts + "subs %w2, %w2, #8 \n" // 8 pixels per loop +@@ -4370,7 +3946,7 @@ void HalfFloatRow_NEON(const uint16_t* s + uint16_t* dst, + float scale, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld1 {v1.16b}, [%0], #16 \n" // load 8 shorts + "subs %w2, %w2, #8 \n" // 8 pixels per loop +@@ -4396,7 +3972,7 @@ void ByteToFloatRow_NEON(const uint8_t* + float* dst, + float scale, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld1 {v1.8b}, [%0], #8 \n" // load 8 bytes + "subs %w2, %w2, #8 \n" // 8 pixels per loop +@@ -4417,92 +3993,12 @@ void ByteToFloatRow_NEON(const uint8_t* + : "cc", "memory", "v1", "v2", "v3"); + } + +-// Convert FP16 Half Floats to FP32 Floats +-void ConvertFP16ToFP32Row_NEON(const uint16_t* src, // fp16 +- float* dst, +- int width) { +- asm volatile ( +- "1: \n" +- "ld1 {v1.8h}, [%0], #16 \n" // load 8 halffloats +- "subs %w2, %w2, #8 \n" // 8 floats per loop +- "prfm pldl1keep, [%0, 448] \n" +- "fcvtl v2.4s, v1.4h \n" // 8 floats +- "fcvtl2 v3.4s, v1.8h \n" +- "stp q2, q3, [%1], #32 \n" // store 8 floats +- "b.gt 1b \n" +- : "+r"(src), // %0 +- "+r"(dst), // %1 +- "+r"(width) // %2 +- : +- : "cc", "memory", "v1", "v2", "v3"); +-} +- +-// Convert FP16 Half Floats to FP32 Floats +-// Read a column and write a row +-void ConvertFP16ToFP32Column_NEON(const uint16_t* src, // fp16 +- int src_stride, // stride in elements +- float* dst, +- int width) { +- asm volatile ( +- "cmp %w2, #8 \n" // Is there 8 rows? +- "b.lo 2f \n" +- "1: \n" +- "ld1 {v0.h}[0], [%0], %3 \n" // load 8 halffloats +- "ld1 {v0.h}[1], [%0], %3 \n" +- "ld1 {v0.h}[2], [%0], %3 \n" +- "ld1 {v0.h}[3], [%0], %3 \n" +- "ld1 {v1.h}[0], [%0], %3 \n" +- "ld1 {v1.h}[1], [%0], %3 \n" +- "ld1 {v1.h}[2], [%0], %3 \n" +- "ld1 {v1.h}[3], [%0], %3 \n" +- "subs %w2, %w2, #8 \n" // 8 rows per loop +- "prfm pldl1keep, [%0, 448] \n" +- "fcvtl v2.4s, v0.4h \n" // 4 floats +- "fcvtl v3.4s, v1.4h \n" // 4 more floats +- "stp q2, q3, [%1], #32 \n" // store 8 floats +- "b.gt 1b \n" +- "cmp %w2, #1 \n" // Is there 1 value? +- "b.lo 3f \n" +- "2: \n" +- "ld1 {v1.h}[0], [%0], %3 \n" // load 1 halffloats +- "subs %w2, %w2, #1 \n" // 1 floats per loop +- "fcvtl v2.4s, v1.4h \n" // 1 floats +- "str s2, [%1], #4 \n" // store 1 floats +- "b.gt 2b \n" +- "3: \n" +- : "+r"(src), // %0 +- "+r"(dst), // %1 +- "+r"(width) // %2 +- : "r"((ptrdiff_t)(src_stride * 2)) // %3 +- : "cc", "memory", "v0", "v1", "v2", "v3"); +-} +- +-// Convert FP32 Floats to FP16 Half Floats +-void ConvertFP32ToFP16Row_NEON(const float* src, +- uint16_t* dst, // fp16 +- int width) { +- asm volatile ( +- "1: \n" +- "ldp q2, q3, [%0], #32 \n" // load 8 floats +- "subs %w2, %w2, #8 \n" // 8 floats per loop +- "prfm pldl1keep, [%0, 448] \n" +- "fcvtn v1.4h, v2.4s \n" // 8 fp16 halffloats +- "fcvtn2 v1.8h, v3.4s \n" +- "str q1, [%1], #16 \n" // store 8 fp16 halffloats +- "b.gt 1b \n" +- : "+r"(src), // %0 +- "+r"(dst), // %1 +- "+r"(width) // %2 +- : +- : "cc", "memory", "v1", "v2", "v3"); +-} +- + float ScaleMaxSamples_NEON(const float* src, + float* dst, + float scale, + int width) { + float fmax; +- asm volatile ( ++ asm volatile( + "movi v5.4s, #0 \n" // max + "movi v6.4s, #0 \n" + +@@ -4532,7 +4028,7 @@ float ScaleSumSamples_NEON(const float* + float scale, + int width) { + float fsum; +- asm volatile ( ++ asm volatile( + "movi v5.4s, #0 \n" // max + "movi v6.4s, #0 \n" // max + +@@ -4559,7 +4055,7 @@ float ScaleSumSamples_NEON(const float* + } + + void ScaleSamples_NEON(const float* src, float* dst, float scale, int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld1 {v1.4s, v2.4s}, [%0], #32 \n" // load 8 samples + "prfm pldl1keep, [%0, 448] \n" +@@ -4583,7 +4079,7 @@ void GaussCol_NEON(const uint16_t* src0, + const uint16_t* src4, + uint32_t* dst, + int width) { +- asm volatile ( ++ asm volatile( + "movi v6.8h, #4 \n" // constant 4 + "movi v7.8h, #6 \n" // constant 6 + +@@ -4625,7 +4121,7 @@ void GaussRow_NEON(const uint32_t* src, + const uint32_t* src1 = src + 1; + const uint32_t* src2 = src + 2; + const uint32_t* src3 = src + 3; +- asm volatile ( ++ asm volatile( + "movi v6.4s, #4 \n" // constant 4 + "movi v7.4s, #6 \n" // constant 6 + +@@ -4668,7 +4164,7 @@ void GaussCol_F32_NEON(const float* src0 + const float* src4, + float* dst, + int width) { +- asm volatile ( ++ asm volatile( + "ld2r {v6.4s, v7.4s}, [%7] \n" // constants 4 and 6 + + "1: \n" +@@ -4706,7 +4202,7 @@ void GaussCol_F32_NEON(const float* src0 + + // filter 5 rows with 1, 4, 6, 4, 1 coefficients to produce 1 row. + void GaussRow_F32_NEON(const float* src, float* dst, int width) { +- asm volatile ( ++ asm volatile( + "ld3r {v6.4s, v7.4s, v8.4s}, [%3] \n" // constants 4, 6, 1/256 + + "1: \n" +@@ -4745,7 +4241,7 @@ void NV21ToYUV24Row_NEON(const uint8_t* + const uint8_t* src_vu, + uint8_t* dst_yuv24, + int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld1 {v2.16b}, [%0], #16 \n" // load 16 Y values + "ld2 {v0.8b, v1.8b}, [%1], #16 \n" // load 8 VU values +@@ -4776,7 +4272,7 @@ void NV21ToYUV24Row_NEON(const uint8_t* + const uint8_t* src_vu, + uint8_t* dst_yuv24, + int width) { +- asm volatile ( ++ asm volatile( + "ld1 {v5.16b,v6.16b,v7.16b}, [%4] \n" // 3 shuffler constants + "1: \n" + "ld1 {v0.16b}, [%0], #16 \n" // load 16 Y values +@@ -4806,7 +4302,7 @@ void AYUVToUVRow_NEON(const uint8_t* src + uint8_t* dst_uv, + int width) { + const uint8_t* src_ayuv_1 = src_ayuv + src_stride_ayuv; +- asm volatile ( ++ asm volatile( + + "1: \n" + "ld4 {v0.16b,v1.16b,v2.16b,v3.16b}, [%0], #64 \n" // load 16 ayuv +@@ -4835,7 +4331,7 @@ void AYUVToVURow_NEON(const uint8_t* src + uint8_t* dst_vu, + int width) { + const uint8_t* src_ayuv_1 = src_ayuv + src_stride_ayuv; +- asm volatile ( ++ asm volatile( + + "1: \n" + "ld4 {v0.16b,v1.16b,v2.16b,v3.16b}, [%0], #64 \n" // load 16 ayuv +@@ -4861,7 +4357,7 @@ void AYUVToVURow_NEON(const uint8_t* src + + // Copy row of AYUV Y's into Y + void AYUVToYRow_NEON(const uint8_t* src_ayuv, uint8_t* dst_y, int width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld4 {v0.16b,v1.16b,v2.16b,v3.16b}, [%0], #64 \n" // load 16 + "subs %w2, %w2, #16 \n" // 16 pixels per loop +@@ -4875,23 +4371,28 @@ void AYUVToYRow_NEON(const uint8_t* src_ + : "cc", "memory", "v0", "v1", "v2", "v3"); + } + ++// Shuffle table for swapping UV bytes. ++static const uvec8 kShuffleSwapUV = {1u, 0u, 3u, 2u, 5u, 4u, 7u, 6u, ++ 9u, 8u, 11u, 10u, 13u, 12u, 15u, 14u}; ++ + // Convert UV plane of NV12 to VU of NV21. + void SwapUVRow_NEON(const uint8_t* src_uv, uint8_t* dst_vu, int width) { +- asm volatile ( ++ asm volatile( ++ "ld1 {v2.16b}, [%3] \n" // shuffler + "1: \n" + "ld1 {v0.16b}, [%0], 16 \n" // load 16 UV values + "ld1 {v1.16b}, [%0], 16 \n" + "subs %w2, %w2, #16 \n" // 16 pixels per loop +- "rev16 v0.16b, v0.16b \n" ++ "tbl v0.16b, {v0.16b}, v2.16b \n" + "prfm pldl1keep, [%0, 448] \n" +- "rev16 v1.16b, v1.16b \n" ++ "tbl v1.16b, {v1.16b}, v2.16b \n" + "stp q0, q1, [%1], 32 \n" // store 16 VU pixels + "b.gt 1b \n" +- : "+r"(src_uv), // %0 +- "+r"(dst_vu), // %1 +- "+r"(width) // %2 +- : +- : "cc", "memory", "v0", "v1"); ++ : "+r"(src_uv), // %0 ++ "+r"(dst_vu), // %1 ++ "+r"(width) // %2 ++ : "r"(&kShuffleSwapUV) // %3 ++ : "cc", "memory", "v0", "v1", "v2"); + } + + void HalfMergeUVRow_NEON(const uint8_t* src_u, +@@ -4902,7 +4403,7 @@ void HalfMergeUVRow_NEON(const uint8_t* + int width) { + const uint8_t* src_u_1 = src_u + src_stride_u; + const uint8_t* src_v_1 = src_v + src_stride_v; +- asm volatile ( ++ asm volatile( + "1: \n" + "ld1 {v0.16b}, [%0], #16 \n" // load 16 U values + "ld1 {v1.16b}, [%2], #16 \n" // load 16 V values +@@ -4937,7 +4438,7 @@ void SplitUVRow_16_NEON(const uint16_t* + int depth, + int width) { + int shift = depth - 16; // Negative for right shift. +- asm volatile ( ++ asm volatile( + "dup v2.8h, %w4 \n" + "1: \n" + "ld2 {v0.8h, v1.8h}, [%0], #32 \n" // load 8 UV +@@ -4960,7 +4461,7 @@ void MultiplyRow_16_NEON(const uint16_t* + uint16_t* dst_y, + int scale, + int width) { +- asm volatile ( ++ asm volatile( + "dup v2.8h, %w3 \n" + "1: \n" + "ldp q0, q1, [%0], #32 \n" +@@ -4981,7 +4482,7 @@ void DivideRow_16_NEON(const uint16_t* s + uint16_t* dst_y, + int scale, + int width) { +- asm volatile ( ++ asm volatile( + "dup v4.8h, %w3 \n" + "1: \n" + "ldp q2, q3, [%0], #32 \n" +@@ -4990,8 +4491,10 @@ void DivideRow_16_NEON(const uint16_t* s + "umull v2.4s, v3.4h, v4.4h \n" + "umull2 v3.4s, v3.8h, v4.8h \n" + "prfm pldl1keep, [%0, 448] \n" +- "uzp2 v0.8h, v0.8h, v1.8h \n" +- "uzp2 v1.8h, v2.8h, v3.8h \n" ++ "shrn v0.4h, v0.4s, #16 \n" ++ "shrn2 v0.8h, v1.4s, #16 \n" ++ "shrn v1.4h, v2.4s, #16 \n" ++ "shrn2 v1.8h, v3.4s, #16 \n" + "stp q0, q1, [%1], #32 \n" // store 16 pixels + "subs %w2, %w2, #16 \n" // 16 src pixels per loop + "b.gt 1b \n" +@@ -5011,18 +4514,16 @@ void Convert16To8Row_NEON(const uint16_t + uint8_t* dst_y, + int scale, + int width) { +- // 15 - clz(scale), + 8 to shift result into the high half of the lane to +- // saturate, then we can just use UZP2 to narrow rather than a pair of +- // saturating narrow instructions. +- int shift = 23 - __builtin_clz((int32_t)scale); +- asm volatile ( ++ int shift = 15 - __builtin_clz((int32_t)scale); // Negative shl is shr ++ asm volatile( + "dup v2.8h, %w3 \n" + "1: \n" + "ldp q0, q1, [%0], #32 \n" +- "uqshl v0.8h, v0.8h, v2.8h \n" +- "uqshl v1.8h, v1.8h, v2.8h \n" ++ "ushl v0.8h, v0.8h, v2.8h \n" // shr = v2 is negative ++ "ushl v1.8h, v1.8h, v2.8h \n" + "prfm pldl1keep, [%0, 448] \n" +- "uzp2 v0.16b, v0.16b, v1.16b \n" ++ "uqxtn v0.8b, v0.8h \n" ++ "uqxtn2 v0.16b, v1.8h \n" + "subs %w2, %w2, #16 \n" // 16 src pixels per loop + "str q0, [%1], #16 \n" // store 16 pixels + "b.gt 1b \n" +diff --git a/media/libyuv/libyuv/source/row_win.cc b/media/libyuv/libyuv/source/row_win.cc +--- a/media/libyuv/libyuv/source/row_win.cc ++++ b/media/libyuv/libyuv/source/row_win.cc +@@ -14,9 +14,7 @@ + #if !defined(LIBYUV_DISABLE_X86) && defined(_MSC_VER) && \ + !defined(__clang__) && (defined(_M_IX86) || defined(_M_X64)) + +-#if defined(_M_ARM64EC) +-#include +-#elif defined(_M_X64) ++#if defined(_M_X64) + #include + #include // For _mm_maddubs_epi16 + #endif +@@ -895,7 +893,7 @@ static const lvec8 kShuffleNV21 = { + + __declspec(naked) void ARGBToRGB565DitherRow_SSE2(const uint8_t* src_argb, + uint8_t* dst_rgb, +- uint32_t dither4, ++ const uint32_t dither4, + int width) { + __asm { + +@@ -942,7 +940,7 @@ static const lvec8 kShuffleNV21 = { + #ifdef HAS_ARGBTORGB565DITHERROW_AVX2 + __declspec(naked) void ARGBToRGB565DitherRow_AVX2(const uint8_t* src_argb, + uint8_t* dst_rgb, +- uint32_t dither4, ++ const uint32_t dither4, + int width) { + __asm { + mov eax, [esp + 4] // src_argb +@@ -3463,14 +3461,17 @@ static const ulvec32 kARGBShuffleMirror_ + sub edx, eax + + convertloop: +- vpmovzxbw ymm0, [eax] +- vpmovzxbw ymm1, [eax + edx] +- lea eax, [eax + 16] +- vpsllw ymm1, ymm1, 8 +- vpor ymm2, ymm1, ymm0 +- vmovdqu [edi], ymm2 +- lea edi, [edi + 32] +- sub ecx, 16 ++ vmovdqu ymm0, [eax] // read 32 U's ++ vmovdqu ymm1, [eax + edx] // and 32 V's ++ lea eax, [eax + 32] ++ vpunpcklbw ymm2, ymm0, ymm1 // low 16 UV pairs. mutated qqword 0,2 ++ vpunpckhbw ymm0, ymm0, ymm1 // high 16 UV pairs. mutated qqword 1,3 ++ vextractf128 [edi], ymm2, 0 // bytes 0..15 ++ vextractf128 [edi + 16], ymm0, 0 // bytes 16..31 ++ vextractf128 [edi + 32], ymm2, 1 // bytes 32..47 ++ vextractf128 [edi + 48], ymm0, 1 // bytes 47..63 ++ lea edi, [edi + 64] ++ sub ecx, 32 + jg convertloop + + pop edi +diff --git a/media/libyuv/libyuv/source/scale.cc b/media/libyuv/libyuv/source/scale.cc +--- a/media/libyuv/libyuv/source/scale.cc ++++ b/media/libyuv/libyuv/source/scale.cc +@@ -135,14 +135,6 @@ static void ScalePlaneDown2(int src_widt + } + } + #endif +-#if defined(HAS_SCALEROWDOWN2_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ScaleRowDown2 = filtering == kFilterNone +- ? ScaleRowDown2_RVV +- : (filtering == kFilterLinear ? ScaleRowDown2Linear_RVV +- : ScaleRowDown2Box_RVV); +- } +-#endif + + if (filtering == kFilterLinear) { + src_stride = 0; +@@ -320,11 +312,6 @@ static void ScalePlaneDown4(int src_widt + } + } + #endif +-#if defined(HAS_SCALEROWDOWN4_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ScaleRowDown4 = filtering ? ScaleRowDown4Box_RVV : ScaleRowDown4_RVV; +- } +-#endif + + if (filtering == kFilterLinear) { + src_stride = 0; +@@ -485,17 +472,6 @@ static void ScalePlaneDown34(int src_wid + } + } + #endif +-#if defined(HAS_SCALEROWDOWN34_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- if (!filtering) { +- ScaleRowDown34_0 = ScaleRowDown34_RVV; +- ScaleRowDown34_1 = ScaleRowDown34_RVV; +- } else { +- ScaleRowDown34_0 = ScaleRowDown34_0_Box_RVV; +- ScaleRowDown34_1 = ScaleRowDown34_1_Box_RVV; +- } +- } +-#endif + + for (y = 0; y < dst_height - 2; y += 3) { + ScaleRowDown34_0(src_ptr, filter_stride, dst_ptr, dst_width); +@@ -711,17 +687,6 @@ static void ScalePlaneDown38(int src_wid + } + } + #endif +-#if defined(HAS_SCALEROWDOWN38_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- if (!filtering) { +- ScaleRowDown38_3 = ScaleRowDown38_RVV; +- ScaleRowDown38_2 = ScaleRowDown38_RVV; +- } else { +- ScaleRowDown38_3 = ScaleRowDown38_3_Box_RVV; +- ScaleRowDown38_2 = ScaleRowDown38_2_Box_RVV; +- } +- } +-#endif + + for (y = 0; y < dst_height - 2; y += 3) { + ScaleRowDown38_3(src_ptr, filter_stride, dst_ptr, dst_width); +@@ -855,10 +820,8 @@ static void ScaleAddCols2_C(int dst_widt + int ix = x >> 16; + x += dx; + boxwidth = MIN1((x >> 16) - ix); +- int scaletbl_index = boxwidth - minboxwidth; +- assert((scaletbl_index == 0) || (scaletbl_index == 1)); + *dst_ptr++ = (uint8_t)(SumPixels(boxwidth, src_ptr + ix) * +- scaletbl[scaletbl_index] >> ++ scaletbl[boxwidth - minboxwidth] >> + 16); + } + } +@@ -879,10 +842,9 @@ static void ScaleAddCols2_16_C(int dst_w + int ix = x >> 16; + x += dx; + boxwidth = MIN1((x >> 16) - ix); +- int scaletbl_index = boxwidth - minboxwidth; +- assert((scaletbl_index == 0) || (scaletbl_index == 1)); +- *dst_ptr++ = +- SumPixels_16(boxwidth, src_ptr + ix) * scaletbl[scaletbl_index] >> 16; ++ *dst_ptr++ = SumPixels_16(boxwidth, src_ptr + ix) * ++ scaletbl[boxwidth - minboxwidth] >> ++ 16; + } + } + +@@ -939,14 +901,14 @@ static void ScaleAddCols1_16_C(int dst_w + // one pixel of destination using fixed point (16.16) to step + // through source, sampling a box of pixel with simple + // averaging. +-static int ScalePlaneBox(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint8_t* src_ptr, +- uint8_t* dst_ptr) { ++static void ScalePlaneBox(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint8_t* src_ptr, ++ uint8_t* dst_ptr) { + int j, k; + // Initial source x/y coordinate and step values as 16.16 fixed point. + int x = 0; +@@ -960,8 +922,6 @@ static int ScalePlaneBox(int src_width, + { + // Allocate a row buffer of uint16_t. + align_buffer_64(row16, src_width * 2); +- if (!row16) +- return 1; + void (*ScaleAddCols)(int dst_width, int boxheight, int x, int dx, + const uint16_t* src_ptr, uint8_t* dst_ptr) = + (dx & 0xffff) ? ScaleAddCols2_C +@@ -1008,11 +968,6 @@ static int ScalePlaneBox(int src_width, + } + } + #endif +-#if defined(HAS_SCALEADDROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ScaleAddRow = ScaleAddRow_RVV; +- } +-#endif + + for (j = 0; j < dst_height; ++j) { + int boxheight; +@@ -1033,17 +988,16 @@ static int ScalePlaneBox(int src_width, + } + free_aligned_buffer_64(row16); + } +- return 0; + } + +-static int ScalePlaneBox_16(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint16_t* src_ptr, +- uint16_t* dst_ptr) { ++static void ScalePlaneBox_16(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint16_t* src_ptr, ++ uint16_t* dst_ptr) { + int j, k; + // Initial source x/y coordinate and step values as 16.16 fixed point. + int x = 0; +@@ -1057,8 +1011,6 @@ static int ScalePlaneBox_16(int src_widt + { + // Allocate a row buffer of uint32_t. + align_buffer_64(row32, src_width * 4); +- if (!row32) +- return 1; + void (*ScaleAddCols)(int dst_width, int boxheight, int x, int dx, + const uint32_t* src_ptr, uint16_t* dst_ptr) = + (dx & 0xffff) ? ScaleAddCols2_16_C : ScaleAddCols1_16_C; +@@ -1090,19 +1042,18 @@ static int ScalePlaneBox_16(int src_widt + } + free_aligned_buffer_64(row32); + } +- return 0; + } + + // Scale plane down with bilinear interpolation. +-static int ScalePlaneBilinearDown(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint8_t* src_ptr, +- uint8_t* dst_ptr, +- enum FilterMode filtering) { ++void ScalePlaneBilinearDown(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint8_t* src_ptr, ++ uint8_t* dst_ptr, ++ enum FilterMode filtering) { + // Initial source x/y coordinate and step values as 16.16 fixed point. + int x = 0; + int y = 0; +@@ -1111,8 +1062,6 @@ static int ScalePlaneBilinearDown(int sr + // TODO(fbarchard): Consider not allocating row buffer for kFilterLinear. + // Allocate a row buffer. + align_buffer_64(row, src_width); +- if (!row) +- return 1; + + const int max_y = (src_height - 1) << 16; + int j; +@@ -1166,11 +1115,6 @@ static int ScalePlaneBilinearDown(int sr + } + } + #endif +-#if defined(HAS_INTERPOLATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- InterpolateRow = InterpolateRow_RVV; +- } +-#endif + + #if defined(HAS_SCALEFILTERCOLS_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3) && src_width < 32768) { +@@ -1222,18 +1166,17 @@ static int ScalePlaneBilinearDown(int sr + } + } + free_aligned_buffer_64(row); +- return 0; + } + +-static int ScalePlaneBilinearDown_16(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint16_t* src_ptr, +- uint16_t* dst_ptr, +- enum FilterMode filtering) { ++void ScalePlaneBilinearDown_16(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint16_t* src_ptr, ++ uint16_t* dst_ptr, ++ enum FilterMode filtering) { + // Initial source x/y coordinate and step values as 16.16 fixed point. + int x = 0; + int y = 0; +@@ -1242,8 +1185,6 @@ static int ScalePlaneBilinearDown_16(int + // TODO(fbarchard): Consider not allocating row buffer for kFilterLinear. + // Allocate a row buffer. + align_buffer_64(row, src_width * 2); +- if (!row) +- return 1; + + const int max_y = (src_height - 1) << 16; + int j; +@@ -1316,19 +1257,18 @@ static int ScalePlaneBilinearDown_16(int + } + } + free_aligned_buffer_64(row); +- return 0; + } + + // Scale up down with bilinear interpolation. +-static int ScalePlaneBilinearUp(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint8_t* src_ptr, +- uint8_t* dst_ptr, +- enum FilterMode filtering) { ++void ScalePlaneBilinearUp(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint8_t* src_ptr, ++ uint8_t* dst_ptr, ++ enum FilterMode filtering) { + int j; + // Initial source x/y coordinate and step values as 16.16 fixed point. + int x = 0; +@@ -1370,11 +1310,6 @@ static int ScalePlaneBilinearUp(int src_ + } + } + #endif +-#if defined(HAS_INTERPOLATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- InterpolateRow = InterpolateRow_RVV; +- } +-#endif + + if (filtering && src_width >= 32768) { + ScaleFilterCols = ScaleFilterCols64_C; +@@ -1427,8 +1362,6 @@ static int ScalePlaneBilinearUp(int src_ + // Allocate 2 row buffers. + const int row_size = (dst_width + 31) & ~31; + align_buffer_64(row, row_size * 2); +- if (!row) +- return 1; + + uint8_t* rowptr = row; + int rowstride = row_size; +@@ -1472,7 +1405,6 @@ static int ScalePlaneBilinearUp(int src_ + } + free_aligned_buffer_64(row); + } +- return 0; + } + + // Scale plane, horizontally up by 2 times. +@@ -1480,21 +1412,20 @@ static int ScalePlaneBilinearUp(int src_ + // This is an optimized version for scaling up a plane to 2 times of + // its original width, using linear interpolation. + // This is used to scale U and V planes of I422 to I444. +-static void ScalePlaneUp2_Linear(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint8_t* src_ptr, +- uint8_t* dst_ptr) { ++void ScalePlaneUp2_Linear(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint8_t* src_ptr, ++ uint8_t* dst_ptr) { + void (*ScaleRowUp)(const uint8_t* src_ptr, uint8_t* dst_ptr, int dst_width) = + ScaleRowUp2_Linear_Any_C; + int i; + int y; + int dy; + +- (void)src_width; + // This function can only scale up by 2 times horizontally. + assert(src_width == ((dst_width + 1) / 2)); + +@@ -1521,11 +1452,6 @@ static void ScalePlaneUp2_Linear(int src + ScaleRowUp = ScaleRowUp2_Linear_Any_NEON; + } + #endif +-#ifdef HAS_SCALEROWUP2_LINEAR_RVV +- if (TestCpuFlag(kCpuHasRVV)) { +- ScaleRowUp = ScaleRowUp2_Linear_RVV; +- } +-#endif + + if (dst_height == 1) { + ScaleRowUp(src_ptr + ((src_height - 1) / 2) * (int64_t)src_stride, dst_ptr, +@@ -1545,20 +1471,19 @@ static void ScalePlaneUp2_Linear(int src + // This is an optimized version for scaling up a plane to 2 times of + // its original size, using bilinear interpolation. + // This is used to scale U and V planes of I420 to I444. +-static void ScalePlaneUp2_Bilinear(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint8_t* src_ptr, +- uint8_t* dst_ptr) { ++void ScalePlaneUp2_Bilinear(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint8_t* src_ptr, ++ uint8_t* dst_ptr) { + void (*Scale2RowUp)(const uint8_t* src_ptr, ptrdiff_t src_stride, + uint8_t* dst_ptr, ptrdiff_t dst_stride, int dst_width) = + ScaleRowUp2_Bilinear_Any_C; + int x; + +- (void)src_width; + // This function can only scale up by 2 times. + assert(src_width == ((dst_width + 1) / 2)); + assert(src_height == ((dst_height + 1) / 2)); +@@ -1586,11 +1511,6 @@ static void ScalePlaneUp2_Bilinear(int s + Scale2RowUp = ScaleRowUp2_Bilinear_Any_NEON; + } + #endif +-#ifdef HAS_SCALEROWUP2_BILINEAR_RVV +- if (TestCpuFlag(kCpuHasRVV)) { +- Scale2RowUp = ScaleRowUp2_Bilinear_RVV; +- } +-#endif + + Scale2RowUp(src_ptr, 0, dst_ptr, 0, dst_width); + dst_ptr += dst_stride; +@@ -1611,21 +1531,20 @@ static void ScalePlaneUp2_Bilinear(int s + // its original width, using linear interpolation. + // stride is in count of uint16_t. + // This is used to scale U and V planes of I210 to I410 and I212 to I412. +-static void ScalePlaneUp2_12_Linear(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint16_t* src_ptr, +- uint16_t* dst_ptr) { ++void ScalePlaneUp2_12_Linear(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint16_t* src_ptr, ++ uint16_t* dst_ptr) { + void (*ScaleRowUp)(const uint16_t* src_ptr, uint16_t* dst_ptr, + int dst_width) = ScaleRowUp2_Linear_16_Any_C; + int i; + int y; + int dy; + +- (void)src_width; + // This function can only scale up by 2 times horizontally. + assert(src_width == ((dst_width + 1) / 2)); + +@@ -1666,20 +1585,19 @@ static void ScalePlaneUp2_12_Linear(int + // its original size, using bilinear interpolation. + // stride is in count of uint16_t. + // This is used to scale U and V planes of I010 to I410 and I012 to I412. +-static void ScalePlaneUp2_12_Bilinear(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint16_t* src_ptr, +- uint16_t* dst_ptr) { ++void ScalePlaneUp2_12_Bilinear(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint16_t* src_ptr, ++ uint16_t* dst_ptr) { + void (*Scale2RowUp)(const uint16_t* src_ptr, ptrdiff_t src_stride, + uint16_t* dst_ptr, ptrdiff_t dst_stride, int dst_width) = + ScaleRowUp2_Bilinear_16_Any_C; + int x; + +- (void)src_width; + // This function can only scale up by 2 times. + assert(src_width == ((dst_width + 1) / 2)); + assert(src_height == ((dst_height + 1) / 2)); +@@ -1714,21 +1632,20 @@ static void ScalePlaneUp2_12_Bilinear(in + } + } + +-static void ScalePlaneUp2_16_Linear(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint16_t* src_ptr, +- uint16_t* dst_ptr) { ++void ScalePlaneUp2_16_Linear(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint16_t* src_ptr, ++ uint16_t* dst_ptr) { + void (*ScaleRowUp)(const uint16_t* src_ptr, uint16_t* dst_ptr, + int dst_width) = ScaleRowUp2_Linear_16_Any_C; + int i; + int y; + int dy; + +- (void)src_width; + // This function can only scale up by 2 times horizontally. + assert(src_width == ((dst_width + 1) / 2)); + +@@ -1764,20 +1681,19 @@ static void ScalePlaneUp2_16_Linear(int + } + } + +-static void ScalePlaneUp2_16_Bilinear(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint16_t* src_ptr, +- uint16_t* dst_ptr) { ++void ScalePlaneUp2_16_Bilinear(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint16_t* src_ptr, ++ uint16_t* dst_ptr) { + void (*Scale2RowUp)(const uint16_t* src_ptr, ptrdiff_t src_stride, + uint16_t* dst_ptr, ptrdiff_t dst_stride, int dst_width) = + ScaleRowUp2_Bilinear_16_Any_C; + int x; + +- (void)src_width; + // This function can only scale up by 2 times. + assert(src_width == ((dst_width + 1) / 2)); + assert(src_height == ((dst_height + 1) / 2)); +@@ -1812,15 +1728,15 @@ static void ScalePlaneUp2_16_Bilinear(in + } + } + +-static int ScalePlaneBilinearUp_16(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint16_t* src_ptr, +- uint16_t* dst_ptr, +- enum FilterMode filtering) { ++void ScalePlaneBilinearUp_16(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint16_t* src_ptr, ++ uint16_t* dst_ptr, ++ enum FilterMode filtering) { + int j; + // Initial source x/y coordinate and step values as 16.16 fixed point. + int x = 0; +@@ -1897,11 +1813,10 @@ static int ScalePlaneBilinearUp_16(int s + // Allocate 2 row buffers. + const int row_size = (dst_width + 31) & ~31; + align_buffer_64(row, row_size * 4); ++ ++ uint16_t* rowptr = (uint16_t*)row; + int rowstride = row_size; + int lasty = yi; +- uint16_t* rowptr = (uint16_t*)row; +- if (!row) +- return 1; + + ScaleFilterCols(rowptr, src, dst_width, x, dx); + if (src_height > 1) { +@@ -1941,7 +1856,6 @@ static int ScalePlaneBilinearUp_16(int s + } + free_aligned_buffer_64(row); + } +- return 0; + } + + // Scale Plane to/from any dimensions, without interpolation. +@@ -2026,15 +1940,15 @@ static void ScalePlaneSimple_16(int src_ + // Scale a plane. + // This function dispatches to a specialized scaler based on scale factor. + LIBYUV_API +-int ScalePlane(const uint8_t* src, +- int src_stride, +- int src_width, +- int src_height, +- uint8_t* dst, +- int dst_stride, +- int dst_width, +- int dst_height, +- enum FilterMode filtering) { ++void ScalePlane(const uint8_t* src, ++ int src_stride, ++ int src_width, ++ int src_height, ++ uint8_t* dst, ++ int dst_stride, ++ int dst_width, ++ int dst_height, ++ enum FilterMode filtering) { + // Simplify filtering when possible. + filtering = ScaleFilterReduce(src_width, src_height, dst_width, dst_height, + filtering); +@@ -2050,7 +1964,7 @@ int ScalePlane(const uint8_t* src, + if (dst_width == src_width && dst_height == src_height) { + // Straight copy. + CopyPlane(src, src_stride, dst, dst_stride, dst_width, dst_height); +- return 0; ++ return; + } + if (dst_width == src_width && filtering != kFilterBox) { + int dy = 0; +@@ -2066,7 +1980,7 @@ int ScalePlane(const uint8_t* src, + // Arbitrary scale vertically, but unscaled horizontally. + ScalePlaneVertical(src_height, dst_width, dst_height, src_stride, + dst_stride, src, dst, 0, y, dy, /*bpp=*/1, filtering); +- return 0; ++ return; + } + if (dst_width <= Abs(src_width) && dst_height <= src_height) { + // Scale down. +@@ -2074,67 +1988,69 @@ int ScalePlane(const uint8_t* src, + // optimized, 3/4 + ScalePlaneDown34(src_width, src_height, dst_width, dst_height, src_stride, + dst_stride, src, dst, filtering); +- return 0; ++ return; + } + if (2 * dst_width == src_width && 2 * dst_height == src_height) { + // optimized, 1/2 + ScalePlaneDown2(src_width, src_height, dst_width, dst_height, src_stride, + dst_stride, src, dst, filtering); +- return 0; ++ return; + } + // 3/8 rounded up for odd sized chroma height. + if (8 * dst_width == 3 * src_width && 8 * dst_height == 3 * src_height) { + // optimized, 3/8 + ScalePlaneDown38(src_width, src_height, dst_width, dst_height, src_stride, + dst_stride, src, dst, filtering); +- return 0; ++ return; + } + if (4 * dst_width == src_width && 4 * dst_height == src_height && + (filtering == kFilterBox || filtering == kFilterNone)) { + // optimized, 1/4 + ScalePlaneDown4(src_width, src_height, dst_width, dst_height, src_stride, + dst_stride, src, dst, filtering); +- return 0; ++ return; + } + } + if (filtering == kFilterBox && dst_height * 2 < src_height) { +- return ScalePlaneBox(src_width, src_height, dst_width, dst_height, +- src_stride, dst_stride, src, dst); ++ ScalePlaneBox(src_width, src_height, dst_width, dst_height, src_stride, ++ dst_stride, src, dst); ++ return; + } + if ((dst_width + 1) / 2 == src_width && filtering == kFilterLinear) { + ScalePlaneUp2_Linear(src_width, src_height, dst_width, dst_height, + src_stride, dst_stride, src, dst); +- return 0; ++ return; + } + if ((dst_height + 1) / 2 == src_height && (dst_width + 1) / 2 == src_width && + (filtering == kFilterBilinear || filtering == kFilterBox)) { + ScalePlaneUp2_Bilinear(src_width, src_height, dst_width, dst_height, + src_stride, dst_stride, src, dst); +- return 0; ++ return; + } + if (filtering && dst_height > src_height) { +- return ScalePlaneBilinearUp(src_width, src_height, dst_width, dst_height, +- src_stride, dst_stride, src, dst, filtering); ++ ScalePlaneBilinearUp(src_width, src_height, dst_width, dst_height, ++ src_stride, dst_stride, src, dst, filtering); ++ return; + } + if (filtering) { +- return ScalePlaneBilinearDown(src_width, src_height, dst_width, dst_height, +- src_stride, dst_stride, src, dst, filtering); ++ ScalePlaneBilinearDown(src_width, src_height, dst_width, dst_height, ++ src_stride, dst_stride, src, dst, filtering); ++ return; + } + ScalePlaneSimple(src_width, src_height, dst_width, dst_height, src_stride, + dst_stride, src, dst); +- return 0; + } + + LIBYUV_API +-int ScalePlane_16(const uint16_t* src, +- int src_stride, +- int src_width, +- int src_height, +- uint16_t* dst, +- int dst_stride, +- int dst_width, +- int dst_height, +- enum FilterMode filtering) { ++void ScalePlane_16(const uint16_t* src, ++ int src_stride, ++ int src_width, ++ int src_height, ++ uint16_t* dst, ++ int dst_stride, ++ int dst_width, ++ int dst_height, ++ enum FilterMode filtering) { + // Simplify filtering when possible. + filtering = ScaleFilterReduce(src_width, src_height, dst_width, dst_height, + filtering); +@@ -2150,7 +2066,7 @@ int ScalePlane_16(const uint16_t* src, + if (dst_width == src_width && dst_height == src_height) { + // Straight copy. + CopyPlane_16(src, src_stride, dst, dst_stride, dst_width, dst_height); +- return 0; ++ return; + } + if (dst_width == src_width && filtering != kFilterBox) { + int dy = 0; +@@ -2169,7 +2085,7 @@ int ScalePlane_16(const uint16_t* src, + // Arbitrary scale vertically, but unscaled horizontally. + ScalePlaneVertical_16(src_height, dst_width, dst_height, src_stride, + dst_stride, src, dst, 0, y, dy, /*bpp=*/1, filtering); +- return 0; ++ return; + } + if (dst_width <= Abs(src_width) && dst_height <= src_height) { + // Scale down. +@@ -2177,68 +2093,69 @@ int ScalePlane_16(const uint16_t* src, + // optimized, 3/4 + ScalePlaneDown34_16(src_width, src_height, dst_width, dst_height, + src_stride, dst_stride, src, dst, filtering); +- return 0; ++ return; + } + if (2 * dst_width == src_width && 2 * dst_height == src_height) { + // optimized, 1/2 + ScalePlaneDown2_16(src_width, src_height, dst_width, dst_height, + src_stride, dst_stride, src, dst, filtering); +- return 0; ++ return; + } + // 3/8 rounded up for odd sized chroma height. + if (8 * dst_width == 3 * src_width && 8 * dst_height == 3 * src_height) { + // optimized, 3/8 + ScalePlaneDown38_16(src_width, src_height, dst_width, dst_height, + src_stride, dst_stride, src, dst, filtering); +- return 0; ++ return; + } + if (4 * dst_width == src_width && 4 * dst_height == src_height && + (filtering == kFilterBox || filtering == kFilterNone)) { + // optimized, 1/4 + ScalePlaneDown4_16(src_width, src_height, dst_width, dst_height, + src_stride, dst_stride, src, dst, filtering); +- return 0; ++ return; + } + } + if (filtering == kFilterBox && dst_height * 2 < src_height) { +- return ScalePlaneBox_16(src_width, src_height, dst_width, dst_height, +- src_stride, dst_stride, src, dst); ++ ScalePlaneBox_16(src_width, src_height, dst_width, dst_height, src_stride, ++ dst_stride, src, dst); ++ return; + } + if ((dst_width + 1) / 2 == src_width && filtering == kFilterLinear) { + ScalePlaneUp2_16_Linear(src_width, src_height, dst_width, dst_height, + src_stride, dst_stride, src, dst); +- return 0; ++ return; + } + if ((dst_height + 1) / 2 == src_height && (dst_width + 1) / 2 == src_width && + (filtering == kFilterBilinear || filtering == kFilterBox)) { + ScalePlaneUp2_16_Bilinear(src_width, src_height, dst_width, dst_height, + src_stride, dst_stride, src, dst); +- return 0; ++ return; + } + if (filtering && dst_height > src_height) { +- return ScalePlaneBilinearUp_16(src_width, src_height, dst_width, dst_height, +- src_stride, dst_stride, src, dst, filtering); ++ ScalePlaneBilinearUp_16(src_width, src_height, dst_width, dst_height, ++ src_stride, dst_stride, src, dst, filtering); ++ return; + } + if (filtering) { +- return ScalePlaneBilinearDown_16(src_width, src_height, dst_width, +- dst_height, src_stride, dst_stride, src, +- dst, filtering); ++ ScalePlaneBilinearDown_16(src_width, src_height, dst_width, dst_height, ++ src_stride, dst_stride, src, dst, filtering); ++ return; + } + ScalePlaneSimple_16(src_width, src_height, dst_width, dst_height, src_stride, + dst_stride, src, dst); +- return 0; + } + + LIBYUV_API +-int ScalePlane_12(const uint16_t* src, +- int src_stride, +- int src_width, +- int src_height, +- uint16_t* dst, +- int dst_stride, +- int dst_width, +- int dst_height, +- enum FilterMode filtering) { ++void ScalePlane_12(const uint16_t* src, ++ int src_stride, ++ int src_width, ++ int src_height, ++ uint16_t* dst, ++ int dst_stride, ++ int dst_width, ++ int dst_height, ++ enum FilterMode filtering) { + // Simplify filtering when possible. + filtering = ScaleFilterReduce(src_width, src_height, dst_width, dst_height, + filtering); +@@ -2253,17 +2170,17 @@ int ScalePlane_12(const uint16_t* src, + if ((dst_width + 1) / 2 == src_width && filtering == kFilterLinear) { + ScalePlaneUp2_12_Linear(src_width, src_height, dst_width, dst_height, + src_stride, dst_stride, src, dst); +- return 0; ++ return; + } + if ((dst_height + 1) / 2 == src_height && (dst_width + 1) / 2 == src_width && + (filtering == kFilterBilinear || filtering == kFilterBox)) { + ScalePlaneUp2_12_Bilinear(src_width, src_height, dst_width, dst_height, + src_stride, dst_stride, src, dst); +- return 0; ++ return; + } + +- return ScalePlane_16(src, src_stride, src_width, src_height, dst, dst_stride, +- dst_width, dst_height, filtering); ++ ScalePlane_16(src, src_stride, src_width, src_height, dst, dst_stride, ++ dst_width, dst_height, filtering); + } + + // Scale an I420 image. +@@ -2291,7 +2208,6 @@ int I420Scale(const uint8_t* src_y, + int src_halfheight = SUBSAMPLE(src_height, 1, 1); + int dst_halfwidth = SUBSAMPLE(dst_width, 1, 1); + int dst_halfheight = SUBSAMPLE(dst_height, 1, 1); +- int r; + + if (!src_y || !src_u || !src_v || src_width <= 0 || src_height == 0 || + src_width > 32768 || src_height > 32768 || !dst_y || !dst_u || !dst_v || +@@ -2299,19 +2215,13 @@ int I420Scale(const uint8_t* src_y, + return -1; + } + +- r = ScalePlane(src_y, src_stride_y, src_width, src_height, dst_y, +- dst_stride_y, dst_width, dst_height, filtering); +- if (r != 0) { +- return r; +- } +- r = ScalePlane(src_u, src_stride_u, src_halfwidth, src_halfheight, dst_u, +- dst_stride_u, dst_halfwidth, dst_halfheight, filtering); +- if (r != 0) { +- return r; +- } +- r = ScalePlane(src_v, src_stride_v, src_halfwidth, src_halfheight, dst_v, +- dst_stride_v, dst_halfwidth, dst_halfheight, filtering); +- return r; ++ ScalePlane(src_y, src_stride_y, src_width, src_height, dst_y, dst_stride_y, ++ dst_width, dst_height, filtering); ++ ScalePlane(src_u, src_stride_u, src_halfwidth, src_halfheight, dst_u, ++ dst_stride_u, dst_halfwidth, dst_halfheight, filtering); ++ ScalePlane(src_v, src_stride_v, src_halfwidth, src_halfheight, dst_v, ++ dst_stride_v, dst_halfwidth, dst_halfheight, filtering); ++ return 0; + } + + LIBYUV_API +@@ -2336,7 +2246,6 @@ int I420Scale_16(const uint16_t* src_y, + int src_halfheight = SUBSAMPLE(src_height, 1, 1); + int dst_halfwidth = SUBSAMPLE(dst_width, 1, 1); + int dst_halfheight = SUBSAMPLE(dst_height, 1, 1); +- int r; + + if (!src_y || !src_u || !src_v || src_width <= 0 || src_height == 0 || + src_width > 32768 || src_height > 32768 || !dst_y || !dst_u || !dst_v || +@@ -2344,19 +2253,13 @@ int I420Scale_16(const uint16_t* src_y, + return -1; + } + +- r = ScalePlane_16(src_y, src_stride_y, src_width, src_height, dst_y, +- dst_stride_y, dst_width, dst_height, filtering); +- if (r != 0) { +- return r; +- } +- r = ScalePlane_16(src_u, src_stride_u, src_halfwidth, src_halfheight, dst_u, +- dst_stride_u, dst_halfwidth, dst_halfheight, filtering); +- if (r != 0) { +- return r; +- } +- r = ScalePlane_16(src_v, src_stride_v, src_halfwidth, src_halfheight, dst_v, +- dst_stride_v, dst_halfwidth, dst_halfheight, filtering); +- return r; ++ ScalePlane_16(src_y, src_stride_y, src_width, src_height, dst_y, dst_stride_y, ++ dst_width, dst_height, filtering); ++ ScalePlane_16(src_u, src_stride_u, src_halfwidth, src_halfheight, dst_u, ++ dst_stride_u, dst_halfwidth, dst_halfheight, filtering); ++ ScalePlane_16(src_v, src_stride_v, src_halfwidth, src_halfheight, dst_v, ++ dst_stride_v, dst_halfwidth, dst_halfheight, filtering); ++ return 0; + } + + LIBYUV_API +@@ -2381,7 +2284,6 @@ int I420Scale_12(const uint16_t* src_y, + int src_halfheight = SUBSAMPLE(src_height, 1, 1); + int dst_halfwidth = SUBSAMPLE(dst_width, 1, 1); + int dst_halfheight = SUBSAMPLE(dst_height, 1, 1); +- int r; + + if (!src_y || !src_u || !src_v || src_width <= 0 || src_height == 0 || + src_width > 32768 || src_height > 32768 || !dst_y || !dst_u || !dst_v || +@@ -2389,19 +2291,13 @@ int I420Scale_12(const uint16_t* src_y, + return -1; + } + +- r = ScalePlane_12(src_y, src_stride_y, src_width, src_height, dst_y, +- dst_stride_y, dst_width, dst_height, filtering); +- if (r != 0) { +- return r; +- } +- r = ScalePlane_12(src_u, src_stride_u, src_halfwidth, src_halfheight, dst_u, +- dst_stride_u, dst_halfwidth, dst_halfheight, filtering); +- if (r != 0) { +- return r; +- } +- r = ScalePlane_12(src_v, src_stride_v, src_halfwidth, src_halfheight, dst_v, +- dst_stride_v, dst_halfwidth, dst_halfheight, filtering); +- return r; ++ ScalePlane_12(src_y, src_stride_y, src_width, src_height, dst_y, dst_stride_y, ++ dst_width, dst_height, filtering); ++ ScalePlane_12(src_u, src_stride_u, src_halfwidth, src_halfheight, dst_u, ++ dst_stride_u, dst_halfwidth, dst_halfheight, filtering); ++ ScalePlane_12(src_v, src_stride_v, src_halfwidth, src_halfheight, dst_v, ++ dst_stride_v, dst_halfwidth, dst_halfheight, filtering); ++ return 0; + } + + // Scale an I444 image. +@@ -2425,27 +2321,19 @@ int I444Scale(const uint8_t* src_y, + int dst_width, + int dst_height, + enum FilterMode filtering) { +- int r; +- + if (!src_y || !src_u || !src_v || src_width <= 0 || src_height == 0 || + src_width > 32768 || src_height > 32768 || !dst_y || !dst_u || !dst_v || + dst_width <= 0 || dst_height <= 0) { + return -1; + } + +- r = ScalePlane(src_y, src_stride_y, src_width, src_height, dst_y, +- dst_stride_y, dst_width, dst_height, filtering); +- if (r != 0) { +- return r; +- } +- r = ScalePlane(src_u, src_stride_u, src_width, src_height, dst_u, +- dst_stride_u, dst_width, dst_height, filtering); +- if (r != 0) { +- return r; +- } +- r = ScalePlane(src_v, src_stride_v, src_width, src_height, dst_v, +- dst_stride_v, dst_width, dst_height, filtering); +- return r; ++ ScalePlane(src_y, src_stride_y, src_width, src_height, dst_y, dst_stride_y, ++ dst_width, dst_height, filtering); ++ ScalePlane(src_u, src_stride_u, src_width, src_height, dst_u, dst_stride_u, ++ dst_width, dst_height, filtering); ++ ScalePlane(src_v, src_stride_v, src_width, src_height, dst_v, dst_stride_v, ++ dst_width, dst_height, filtering); ++ return 0; + } + + LIBYUV_API +@@ -2466,27 +2354,19 @@ int I444Scale_16(const uint16_t* src_y, + int dst_width, + int dst_height, + enum FilterMode filtering) { +- int r; +- + if (!src_y || !src_u || !src_v || src_width <= 0 || src_height == 0 || + src_width > 32768 || src_height > 32768 || !dst_y || !dst_u || !dst_v || + dst_width <= 0 || dst_height <= 0) { + return -1; + } + +- r = ScalePlane_16(src_y, src_stride_y, src_width, src_height, dst_y, +- dst_stride_y, dst_width, dst_height, filtering); +- if (r != 0) { +- return r; +- } +- r = ScalePlane_16(src_u, src_stride_u, src_width, src_height, dst_u, +- dst_stride_u, dst_width, dst_height, filtering); +- if (r != 0) { +- return r; +- } +- r = ScalePlane_16(src_v, src_stride_v, src_width, src_height, dst_v, +- dst_stride_v, dst_width, dst_height, filtering); +- return r; ++ ScalePlane_16(src_y, src_stride_y, src_width, src_height, dst_y, dst_stride_y, ++ dst_width, dst_height, filtering); ++ ScalePlane_16(src_u, src_stride_u, src_width, src_height, dst_u, dst_stride_u, ++ dst_width, dst_height, filtering); ++ ScalePlane_16(src_v, src_stride_v, src_width, src_height, dst_v, dst_stride_v, ++ dst_width, dst_height, filtering); ++ return 0; + } + + LIBYUV_API +@@ -2507,27 +2387,19 @@ int I444Scale_12(const uint16_t* src_y, + int dst_width, + int dst_height, + enum FilterMode filtering) { +- int r; +- + if (!src_y || !src_u || !src_v || src_width <= 0 || src_height == 0 || + src_width > 32768 || src_height > 32768 || !dst_y || !dst_u || !dst_v || + dst_width <= 0 || dst_height <= 0) { + return -1; + } + +- r = ScalePlane_12(src_y, src_stride_y, src_width, src_height, dst_y, +- dst_stride_y, dst_width, dst_height, filtering); +- if (r != 0) { +- return r; +- } +- r = ScalePlane_12(src_u, src_stride_u, src_width, src_height, dst_u, +- dst_stride_u, dst_width, dst_height, filtering); +- if (r != 0) { +- return r; +- } +- r = ScalePlane_12(src_v, src_stride_v, src_width, src_height, dst_v, +- dst_stride_v, dst_width, dst_height, filtering); +- return r; ++ ScalePlane_12(src_y, src_stride_y, src_width, src_height, dst_y, dst_stride_y, ++ dst_width, dst_height, filtering); ++ ScalePlane_12(src_u, src_stride_u, src_width, src_height, dst_u, dst_stride_u, ++ dst_width, dst_height, filtering); ++ ScalePlane_12(src_v, src_stride_v, src_width, src_height, dst_v, dst_stride_v, ++ dst_width, dst_height, filtering); ++ return 0; + } + + // Scale an I422 image. +@@ -2553,7 +2425,6 @@ int I422Scale(const uint8_t* src_y, + enum FilterMode filtering) { + int src_halfwidth = SUBSAMPLE(src_width, 1, 1); + int dst_halfwidth = SUBSAMPLE(dst_width, 1, 1); +- int r; + + if (!src_y || !src_u || !src_v || src_width <= 0 || src_height == 0 || + src_width > 32768 || src_height > 32768 || !dst_y || !dst_u || !dst_v || +@@ -2561,19 +2432,13 @@ int I422Scale(const uint8_t* src_y, + return -1; + } + +- r = ScalePlane(src_y, src_stride_y, src_width, src_height, dst_y, +- dst_stride_y, dst_width, dst_height, filtering); +- if (r != 0) { +- return r; +- } +- r = ScalePlane(src_u, src_stride_u, src_halfwidth, src_height, dst_u, +- dst_stride_u, dst_halfwidth, dst_height, filtering); +- if (r != 0) { +- return r; +- } +- r = ScalePlane(src_v, src_stride_v, src_halfwidth, src_height, dst_v, +- dst_stride_v, dst_halfwidth, dst_height, filtering); +- return r; ++ ScalePlane(src_y, src_stride_y, src_width, src_height, dst_y, dst_stride_y, ++ dst_width, dst_height, filtering); ++ ScalePlane(src_u, src_stride_u, src_halfwidth, src_height, dst_u, ++ dst_stride_u, dst_halfwidth, dst_height, filtering); ++ ScalePlane(src_v, src_stride_v, src_halfwidth, src_height, dst_v, ++ dst_stride_v, dst_halfwidth, dst_height, filtering); ++ return 0; + } + + LIBYUV_API +@@ -2596,7 +2461,6 @@ int I422Scale_16(const uint16_t* src_y, + enum FilterMode filtering) { + int src_halfwidth = SUBSAMPLE(src_width, 1, 1); + int dst_halfwidth = SUBSAMPLE(dst_width, 1, 1); +- int r; + + if (!src_y || !src_u || !src_v || src_width <= 0 || src_height == 0 || + src_width > 32768 || src_height > 32768 || !dst_y || !dst_u || !dst_v || +@@ -2604,19 +2468,13 @@ int I422Scale_16(const uint16_t* src_y, + return -1; + } + +- r = ScalePlane_16(src_y, src_stride_y, src_width, src_height, dst_y, +- dst_stride_y, dst_width, dst_height, filtering); +- if (r != 0) { +- return r; +- } +- r = ScalePlane_16(src_u, src_stride_u, src_halfwidth, src_height, dst_u, +- dst_stride_u, dst_halfwidth, dst_height, filtering); +- if (r != 0) { +- return r; +- } +- r = ScalePlane_16(src_v, src_stride_v, src_halfwidth, src_height, dst_v, +- dst_stride_v, dst_halfwidth, dst_height, filtering); +- return r; ++ ScalePlane_16(src_y, src_stride_y, src_width, src_height, dst_y, dst_stride_y, ++ dst_width, dst_height, filtering); ++ ScalePlane_16(src_u, src_stride_u, src_halfwidth, src_height, dst_u, ++ dst_stride_u, dst_halfwidth, dst_height, filtering); ++ ScalePlane_16(src_v, src_stride_v, src_halfwidth, src_height, dst_v, ++ dst_stride_v, dst_halfwidth, dst_height, filtering); ++ return 0; + } + + LIBYUV_API +@@ -2639,7 +2497,6 @@ int I422Scale_12(const uint16_t* src_y, + enum FilterMode filtering) { + int src_halfwidth = SUBSAMPLE(src_width, 1, 1); + int dst_halfwidth = SUBSAMPLE(dst_width, 1, 1); +- int r; + + if (!src_y || !src_u || !src_v || src_width <= 0 || src_height == 0 || + src_width > 32768 || src_height > 32768 || !dst_y || !dst_u || !dst_v || +@@ -2647,19 +2504,13 @@ int I422Scale_12(const uint16_t* src_y, + return -1; + } + +- r = ScalePlane_12(src_y, src_stride_y, src_width, src_height, dst_y, +- dst_stride_y, dst_width, dst_height, filtering); +- if (r != 0) { +- return r; +- } +- r = ScalePlane_12(src_u, src_stride_u, src_halfwidth, src_height, dst_u, +- dst_stride_u, dst_halfwidth, dst_height, filtering); +- if (r != 0) { +- return r; +- } +- r = ScalePlane_12(src_v, src_stride_v, src_halfwidth, src_height, dst_v, +- dst_stride_v, dst_halfwidth, dst_height, filtering); +- return r; ++ ScalePlane_12(src_y, src_stride_y, src_width, src_height, dst_y, dst_stride_y, ++ dst_width, dst_height, filtering); ++ ScalePlane_12(src_u, src_stride_u, src_halfwidth, src_height, dst_u, ++ dst_stride_u, dst_halfwidth, dst_height, filtering); ++ ScalePlane_12(src_v, src_stride_v, src_halfwidth, src_height, dst_v, ++ dst_stride_v, dst_halfwidth, dst_height, filtering); ++ return 0; + } + + // Scale an NV12 image. +@@ -2683,7 +2534,6 @@ int NV12Scale(const uint8_t* src_y, + int src_halfheight = SUBSAMPLE(src_height, 1, 1); + int dst_halfwidth = SUBSAMPLE(dst_width, 1, 1); + int dst_halfheight = SUBSAMPLE(dst_height, 1, 1); +- int r; + + if (!src_y || !src_uv || src_width <= 0 || src_height == 0 || + src_width > 32768 || src_height > 32768 || !dst_y || !dst_uv || +@@ -2691,14 +2541,11 @@ int NV12Scale(const uint8_t* src_y, + return -1; + } + +- r = ScalePlane(src_y, src_stride_y, src_width, src_height, dst_y, +- dst_stride_y, dst_width, dst_height, filtering); +- if (r != 0) { +- return r; +- } +- r = UVScale(src_uv, src_stride_uv, src_halfwidth, src_halfheight, dst_uv, +- dst_stride_uv, dst_halfwidth, dst_halfheight, filtering); +- return r; ++ ScalePlane(src_y, src_stride_y, src_width, src_height, dst_y, dst_stride_y, ++ dst_width, dst_height, filtering); ++ UVScale(src_uv, src_stride_uv, src_halfwidth, src_halfheight, dst_uv, ++ dst_stride_uv, dst_halfwidth, dst_halfheight, filtering); ++ return 0; + } + + // Deprecated api +diff --git a/media/libyuv/libyuv/source/scale_any.cc b/media/libyuv/libyuv/source/scale_any.cc +--- a/media/libyuv/libyuv/source/scale_any.cc ++++ b/media/libyuv/libyuv/source/scale_any.cc +@@ -128,22 +128,6 @@ SDODD(ScaleRowDown2Box_Odd_NEON, + 1, + 15) + #endif +-#ifdef HAS_SCALEUVROWDOWN2_NEON +-SDANY(ScaleUVRowDown2_Any_NEON, +- ScaleUVRowDown2_NEON, +- ScaleUVRowDown2_C, +- 2, +- 2, +- 7) +-#endif +-#ifdef HAS_SCALEUVROWDOWN2LINEAR_NEON +-SDANY(ScaleUVRowDown2Linear_Any_NEON, +- ScaleUVRowDown2Linear_NEON, +- ScaleUVRowDown2Linear_C, +- 2, +- 2, +- 7) +-#endif + #ifdef HAS_SCALEUVROWDOWN2BOX_NEON + SDANY(ScaleUVRowDown2Box_Any_NEON, + ScaleUVRowDown2Box_NEON, +diff --git a/media/libyuv/libyuv/source/scale_argb.cc b/media/libyuv/libyuv/source/scale_argb.cc +--- a/media/libyuv/libyuv/source/scale_argb.cc ++++ b/media/libyuv/libyuv/source/scale_argb.cc +@@ -16,7 +16,6 @@ + #include "libyuv/cpu_id.h" + #include "libyuv/planar_functions.h" // For CopyARGB + #include "libyuv/row.h" +-#include "libyuv/scale_argb.h" + #include "libyuv/scale_row.h" + + #ifdef __cplusplus +@@ -128,15 +127,6 @@ static void ScaleARGBDown2(int src_width + } + } + #endif +-#if defined(HAS_SCALEARGBROWDOWN2_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ScaleARGBRowDown2 = +- filtering == kFilterNone +- ? ScaleARGBRowDown2_RVV +- : (filtering == kFilterLinear ? ScaleARGBRowDown2Linear_RVV +- : ScaleARGBRowDown2Box_RVV); +- } +-#endif + + if (filtering == kFilterLinear) { + src_stride = 0; +@@ -151,27 +141,22 @@ static void ScaleARGBDown2(int src_width + // ScaleARGB ARGB, 1/4 + // This is an optimized version for scaling down a ARGB to 1/4 of + // its original size. +-static int ScaleARGBDown4Box(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint8_t* src_argb, +- uint8_t* dst_argb, +- int x, +- int dx, +- int y, +- int dy) { ++static void ScaleARGBDown4Box(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint8_t* src_argb, ++ uint8_t* dst_argb, ++ int x, ++ int dx, ++ int y, ++ int dy) { + int j; + // Allocate 2 rows of ARGB. + const int row_size = (dst_width * 2 * 4 + 31) & ~31; +- // TODO(fbarchard): Remove this row buffer and implement a ScaleARGBRowDown4 +- // but implemented via a 2 pass wrapper that uses a very small array on the +- // stack with a horizontal loop. + align_buffer_64(row, row_size * 2); +- if (!row) +- return 1; + int row_stride = src_stride * (dy >> 16); + void (*ScaleARGBRowDown2)(const uint8_t* src_argb, ptrdiff_t src_stride, + uint8_t* dst_argb, int dst_width) = +@@ -199,11 +184,6 @@ static int ScaleARGBDown4Box(int src_wid + } + } + #endif +-#if defined(HAS_SCALEARGBROWDOWN2_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ScaleARGBRowDown2 = ScaleARGBRowDown2Box_RVV; +- } +-#endif + + for (j = 0; j < dst_height; ++j) { + ScaleARGBRowDown2(src_argb, src_stride, row, dst_width * 2); +@@ -214,7 +194,6 @@ static int ScaleARGBDown4Box(int src_wid + dst_argb += dst_stride; + } + free_aligned_buffer_64(row); +- return 0; + } + + // ScaleARGB ARGB Even +@@ -284,16 +263,6 @@ static void ScaleARGBDownEven(int src_wi + } + } + #endif +-#if defined(HAS_SCALEARGBROWDOWNEVENBOX_RVV) +- if (filtering && TestCpuFlag(kCpuHasRVV)) { +- ScaleARGBRowDownEven = ScaleARGBRowDownEvenBox_RVV; +- } +-#endif +-#if defined(HAS_SCALEARGBROWDOWNEVEN_RVV) +- if (!filtering && TestCpuFlag(kCpuHasRVV)) { +- ScaleARGBRowDownEven = ScaleARGBRowDownEven_RVV; +- } +-#endif + + if (filtering == kFilterLinear) { + src_stride = 0; +@@ -306,19 +275,19 @@ static void ScaleARGBDownEven(int src_wi + } + + // Scale ARGB down with bilinear interpolation. +-static int ScaleARGBBilinearDown(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint8_t* src_argb, +- uint8_t* dst_argb, +- int x, +- int dx, +- int y, +- int dy, +- enum FilterMode filtering) { ++static void ScaleARGBBilinearDown(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint8_t* src_argb, ++ uint8_t* dst_argb, ++ int x, ++ int dx, ++ int y, ++ int dy, ++ enum FilterMode filtering) { + int j; + void (*InterpolateRow)(uint8_t* dst_argb, const uint8_t* src_argb, + ptrdiff_t src_stride, int dst_width, +@@ -379,11 +348,6 @@ static int ScaleARGBBilinearDown(int src + } + } + #endif +-#if defined(HAS_INTERPOLATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- InterpolateRow = InterpolateRow_RVV; +- } +-#endif + #if defined(HAS_SCALEARGBFILTERCOLS_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3) && src_width < 32768) { + ScaleARGBFilterCols = ScaleARGBFilterCols_SSSE3; +@@ -417,8 +381,6 @@ static int ScaleARGBBilinearDown(int src + // Allocate a row of ARGB. + { + align_buffer_64(row, clip_src_width * 4); +- if (!row) +- return 1; + + const int max_y = (src_height - 1) << 16; + if (y > max_y) { +@@ -442,23 +404,22 @@ static int ScaleARGBBilinearDown(int src + } + free_aligned_buffer_64(row); + } +- return 0; + } + + // Scale ARGB up with bilinear interpolation. +-static int ScaleARGBBilinearUp(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint8_t* src_argb, +- uint8_t* dst_argb, +- int x, +- int dx, +- int y, +- int dy, +- enum FilterMode filtering) { ++static void ScaleARGBBilinearUp(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint8_t* src_argb, ++ uint8_t* dst_argb, ++ int x, ++ int dx, ++ int y, ++ int dy, ++ enum FilterMode filtering) { + int j; + void (*InterpolateRow)(uint8_t* dst_argb, const uint8_t* src_argb, + ptrdiff_t src_stride, int dst_width, +@@ -507,11 +468,6 @@ static int ScaleARGBBilinearUp(int src_w + } + } + #endif +-#if defined(HAS_INTERPOLATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- InterpolateRow = InterpolateRow_RVV; +- } +-#endif + if (src_width >= 32768) { + ScaleARGBFilterCols = + filtering ? ScaleARGBFilterCols64_C : ScaleARGBCols64_C; +@@ -594,8 +550,6 @@ static int ScaleARGBBilinearUp(int src_w + // Allocate 2 rows of ARGB. + const int row_size = (dst_width * 4 + 31) & ~31; + align_buffer_64(row, row_size * 2); +- if (!row) +- return 1; + + uint8_t* rowptr = row; + int rowstride = row_size; +@@ -639,28 +593,27 @@ static int ScaleARGBBilinearUp(int src_w + } + free_aligned_buffer_64(row); + } +- return 0; + } + + #ifdef YUVSCALEUP + // Scale YUV to ARGB up with bilinear interpolation. +-static int ScaleYUVToARGBBilinearUp(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride_y, +- int src_stride_u, +- int src_stride_v, +- int dst_stride_argb, +- const uint8_t* src_y, +- const uint8_t* src_u, +- const uint8_t* src_v, +- uint8_t* dst_argb, +- int x, +- int dx, +- int y, +- int dy, +- enum FilterMode filtering) { ++static void ScaleYUVToARGBBilinearUp(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride_y, ++ int src_stride_u, ++ int src_stride_v, ++ int dst_stride_argb, ++ const uint8_t* src_y, ++ const uint8_t* src_u, ++ const uint8_t* src_v, ++ uint8_t* dst_argb, ++ int x, ++ int dx, ++ int y, ++ int dy, ++ enum FilterMode filtering) { + int j; + void (*I422ToARGBRow)(const uint8_t* y_buf, const uint8_t* u_buf, + const uint8_t* v_buf, uint8_t* rgb_buf, int width) = +@@ -698,11 +651,6 @@ static int ScaleYUVToARGBBilinearUp(int + } + } + #endif +-#if defined(HAS_I422TOARGBROW_SVE2) +- if (TestCpuFlag(kCpuHasSVE2)) { +- I422ToARGBRow = I422ToARGBRow_SVE2; +- } +-#endif + #if defined(HAS_I422TOARGBROW_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + I422ToARGBRow = I422ToARGBRow_Any_MSA; +@@ -711,14 +659,6 @@ static int ScaleYUVToARGBBilinearUp(int + } + } + #endif +-#if defined(HAS_I422TOARGBROW_LSX) +- if (TestCpuFlag(kCpuHasLSX)) { +- I422ToARGBRow = I422ToARGBRow_Any_LSX; +- if (IS_ALIGNED(src_width, 16)) { +- I422ToARGBRow = I422ToARGBRow_LSX; +- } +- } +-#endif + #if defined(HAS_I422TOARGBROW_LASX) + if (TestCpuFlag(kCpuHasLASX)) { + I422ToARGBRow = I422ToARGBRow_Any_LASX; +@@ -727,11 +667,6 @@ static int ScaleYUVToARGBBilinearUp(int + } + } + #endif +-#if defined(HAS_I422TOARGBROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- I422ToARGBRow = I422ToARGBRow_RVV; +- } +-#endif + + void (*InterpolateRow)(uint8_t* dst_argb, const uint8_t* src_argb, + ptrdiff_t src_stride, int dst_width, +@@ -776,11 +711,6 @@ static int ScaleYUVToARGBBilinearUp(int + } + } + #endif +-#if defined(HAS_INTERPOLATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- InterpolateRow = InterpolateRow_RVV; +- } +-#endif + + void (*ScaleARGBFilterCols)(uint8_t* dst_argb, const uint8_t* src_argb, + int dst_width, int x, int dx) = +@@ -867,17 +797,16 @@ static int ScaleYUVToARGBBilinearUp(int + const uint8_t* src_row_u = src_u + uv_yi * (intptr_t)src_stride_u; + const uint8_t* src_row_v = src_v + uv_yi * (intptr_t)src_stride_v; + +- // Allocate 1 row of ARGB for source conversion and 2 rows of ARGB +- // scaled horizontally to the destination width. ++ // Allocate 2 rows of ARGB. + const int row_size = (dst_width * 4 + 31) & ~31; +- align_buffer_64(row, row_size * 2 + src_width * 4); ++ align_buffer_64(row, row_size * 2); + +- uint8_t* argb_row = row + row_size * 2; ++ // Allocate 1 row of ARGB for source conversion. ++ align_buffer_64(argb_row, src_width * 4); ++ + uint8_t* rowptr = row; + int rowstride = row_size; + int lasty = yi; +- if (!row) +- return 1; + + // TODO(fbarchard): Convert first 2 rows of YUV to ARGB. + ScaleARGBFilterCols(rowptr, src_row_y, dst_width, x, dx); +@@ -932,7 +861,7 @@ static int ScaleYUVToARGBBilinearUp(int + y += dy; + } + free_aligned_buffer_64(row); +- return 0; ++ free_aligned_buffer_64(row_argb); + } + #endif + +@@ -1007,19 +936,19 @@ static void ScaleARGBSimple(int src_widt + // ScaleARGB a ARGB. + // This function in turn calls a scaling function + // suitable for handling the desired resolutions. +-static int ScaleARGB(const uint8_t* src, +- int src_stride, +- int src_width, +- int src_height, +- uint8_t* dst, +- int dst_stride, +- int dst_width, +- int dst_height, +- int clip_x, +- int clip_y, +- int clip_width, +- int clip_height, +- enum FilterMode filtering) { ++static void ScaleARGB(const uint8_t* src, ++ int src_stride, ++ int src_width, ++ int src_height, ++ uint8_t* dst, ++ int dst_stride, ++ int dst_width, ++ int dst_height, ++ int clip_x, ++ int clip_y, ++ int clip_width, ++ int clip_height, ++ enum FilterMode filtering) { + // Initial source x/y coordinate and step values as 16.16 fixed point. + int x = 0; + int y = 0; +@@ -1064,18 +993,18 @@ static int ScaleARGB(const uint8_t* src, + ScaleARGBDown2(src_width, src_height, clip_width, clip_height, + src_stride, dst_stride, src, dst, x, dx, y, dy, + filtering); +- return 0; ++ return; + } + if (dx == 0x40000 && filtering == kFilterBox) { + // Optimized 1/4 box downsample. +- return ScaleARGBDown4Box(src_width, src_height, clip_width, +- clip_height, src_stride, dst_stride, src, +- dst, x, dx, y, dy); ++ ScaleARGBDown4Box(src_width, src_height, clip_width, clip_height, ++ src_stride, dst_stride, src, dst, x, dx, y, dy); ++ return; + } + ScaleARGBDownEven(src_width, src_height, clip_width, clip_height, + src_stride, dst_stride, src, dst, x, dx, y, dy, + filtering); +- return 0; ++ return; + } + // Optimized odd scale down. ie 3, 5, 7, 9x. + if ((dx & 0x10000) && (dy & 0x10000)) { +@@ -1084,7 +1013,7 @@ static int ScaleARGB(const uint8_t* src, + // Straight copy. + ARGBCopy(src + (y >> 16) * (intptr_t)src_stride + (x >> 16) * 4, + src_stride, dst, dst_stride, clip_width, clip_height); +- return 0; ++ return; + } + } + } +@@ -1093,21 +1022,22 @@ static int ScaleARGB(const uint8_t* src, + // Arbitrary scale vertically, but unscaled horizontally. + ScalePlaneVertical(src_height, clip_width, clip_height, src_stride, + dst_stride, src, dst, x, y, dy, /*bpp=*/4, filtering); +- return 0; ++ return; + } + if (filtering && dy < 65536) { +- return ScaleARGBBilinearUp(src_width, src_height, clip_width, clip_height, +- src_stride, dst_stride, src, dst, x, dx, y, dy, +- filtering); ++ ScaleARGBBilinearUp(src_width, src_height, clip_width, clip_height, ++ src_stride, dst_stride, src, dst, x, dx, y, dy, ++ filtering); ++ return; + } + if (filtering) { +- return ScaleARGBBilinearDown(src_width, src_height, clip_width, clip_height, +- src_stride, dst_stride, src, dst, x, dx, y, dy, +- filtering); ++ ScaleARGBBilinearDown(src_width, src_height, clip_width, clip_height, ++ src_stride, dst_stride, src, dst, x, dx, y, dy, ++ filtering); ++ return; + } + ScaleARGBSimple(src_width, src_height, clip_width, clip_height, src_stride, + dst_stride, src, dst, x, dx, y, dy); +- return 0; + } + + LIBYUV_API +@@ -1131,9 +1061,10 @@ int ARGBScaleClip(const uint8_t* src_arg + (clip_y + clip_height) > dst_height) { + return -1; + } +- return ScaleARGB(src_argb, src_stride_argb, src_width, src_height, dst_argb, +- dst_stride_argb, dst_width, dst_height, clip_x, clip_y, +- clip_width, clip_height, filtering); ++ ScaleARGB(src_argb, src_stride_argb, src_width, src_height, dst_argb, ++ dst_stride_argb, dst_width, dst_height, clip_x, clip_y, clip_width, ++ clip_height, filtering); ++ return 0; + } + + // Scale an ARGB image. +@@ -1151,9 +1082,10 @@ int ARGBScale(const uint8_t* src_argb, + src_height > 32768 || !dst_argb || dst_width <= 0 || dst_height <= 0) { + return -1; + } +- return ScaleARGB(src_argb, src_stride_argb, src_width, src_height, dst_argb, +- dst_stride_argb, dst_width, dst_height, 0, 0, dst_width, +- dst_height, filtering); ++ ScaleARGB(src_argb, src_stride_argb, src_width, src_height, dst_argb, ++ dst_stride_argb, dst_width, dst_height, 0, 0, dst_width, dst_height, ++ filtering); ++ return 0; + } + + // Scale with YUV conversion to ARGB and clipping. +@@ -1177,11 +1109,8 @@ int YUVToARGBScaleClip(const uint8_t* sr + int clip_width, + int clip_height, + enum FilterMode filtering) { ++ uint8_t* argb_buffer = (uint8_t*)malloc(src_width * src_height * 4); + int r; +- uint8_t* argb_buffer = (uint8_t*)malloc(src_width * src_height * 4); +- if (!argb_buffer) { +- return 1; // Out of memory runtime error. +- } + (void)src_fourcc; // TODO(fbarchard): implement and/or assert. + (void)dst_fourcc; + I420ToARGB(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, +diff --git a/media/libyuv/libyuv/source/scale_common.cc b/media/libyuv/libyuv/source/scale_common.cc +--- a/media/libyuv/libyuv/source/scale_common.cc ++++ b/media/libyuv/libyuv/source/scale_common.cc +@@ -1280,13 +1280,18 @@ void ScaleUVRowDown2_C(const uint8_t* sr + ptrdiff_t src_stride, + uint8_t* dst_uv, + int dst_width) { ++ const uint16_t* src = (const uint16_t*)(src_uv); ++ uint16_t* dst = (uint16_t*)(dst_uv); + int x; + (void)src_stride; +- for (x = 0; x < dst_width; ++x) { +- dst_uv[0] = src_uv[2]; // Store the 2nd UV +- dst_uv[1] = src_uv[3]; +- src_uv += 4; +- dst_uv += 2; ++ for (x = 0; x < dst_width - 1; x += 2) { ++ dst[0] = src[1]; ++ dst[1] = src[3]; ++ src += 2; ++ dst += 2; ++ } ++ if (dst_width & 1) { ++ dst[0] = src[1]; + } + } + +@@ -1678,12 +1683,6 @@ void ScalePlaneVertical(int src_height, + } + } + #endif +-#if defined(HAS_INTERPOLATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- InterpolateRow = InterpolateRow_RVV; +- } +-#endif +- + for (j = 0; j < dst_height; ++j) { + int yi; + int yf; +@@ -1964,6 +1963,35 @@ void ScaleSlope(int src_width, + } + #undef CENTERSTART + ++// Read 8x2 upsample with filtering and write 16x1. ++// actually reads an extra pixel, so 9x2. ++void ScaleRowUp2_16_C(const uint16_t* src_ptr, ++ ptrdiff_t src_stride, ++ uint16_t* dst, ++ int dst_width) { ++ const uint16_t* src2 = src_ptr + src_stride; ++ ++ int x; ++ for (x = 0; x < dst_width - 1; x += 2) { ++ uint16_t p0 = src_ptr[0]; ++ uint16_t p1 = src_ptr[1]; ++ uint16_t p2 = src2[0]; ++ uint16_t p3 = src2[1]; ++ dst[0] = (p0 * 9 + p1 * 3 + p2 * 3 + p3 + 8) >> 4; ++ dst[1] = (p0 * 3 + p1 * 9 + p2 + p3 * 3 + 8) >> 4; ++ ++src_ptr; ++ ++src2; ++ dst += 2; ++ } ++ if (dst_width & 1) { ++ uint16_t p0 = src_ptr[0]; ++ uint16_t p1 = src_ptr[1]; ++ uint16_t p2 = src2[0]; ++ uint16_t p3 = src2[1]; ++ dst[0] = (p0 * 9 + p1 * 3 + p2 * 3 + p3 + 8) >> 4; ++ } ++} ++ + #ifdef __cplusplus + } // extern "C" + } // namespace libyuv +diff --git a/media/libyuv/libyuv/source/scale_gcc.cc b/media/libyuv/libyuv/source/scale_gcc.cc +--- a/media/libyuv/libyuv/source/scale_gcc.cc ++++ b/media/libyuv/libyuv/source/scale_gcc.cc +@@ -97,7 +97,7 @@ void ScaleRowDown2_SSSE3(const uint8_t* + uint8_t* dst_ptr, + int dst_width) { + (void)src_stride; +- asm( ++ asm volatile( + // 16 pixel loop. + LABELALIGN + "1: \n" +@@ -114,8 +114,8 @@ void ScaleRowDown2_SSSE3(const uint8_t* + : "+r"(src_ptr), // %0 + "+r"(dst_ptr), // %1 + "+r"(dst_width) // %2 +- : +- : "memory", "cc", "xmm0", "xmm1"); ++ ::"memory", ++ "cc", "xmm0", "xmm1"); + } + + void ScaleRowDown2Linear_SSSE3(const uint8_t* src_ptr, +@@ -123,7 +123,8 @@ void ScaleRowDown2Linear_SSSE3(const uin + uint8_t* dst_ptr, + int dst_width) { + (void)src_stride; +- asm("pcmpeqb %%xmm4,%%xmm4 \n" ++ asm volatile( ++ "pcmpeqb %%xmm4,%%xmm4 \n" + "psrlw $0xf,%%xmm4 \n" + "packuswb %%xmm4,%%xmm4 \n" + "pxor %%xmm5,%%xmm5 \n" +@@ -145,15 +146,16 @@ void ScaleRowDown2Linear_SSSE3(const uin + : "+r"(src_ptr), // %0 + "+r"(dst_ptr), // %1 + "+r"(dst_width) // %2 +- : +- : "memory", "cc", "xmm0", "xmm1", "xmm4", "xmm5"); ++ ::"memory", ++ "cc", "xmm0", "xmm1", "xmm4", "xmm5"); + } + + void ScaleRowDown2Box_SSSE3(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm("pcmpeqb %%xmm4,%%xmm4 \n" ++ asm volatile( ++ "pcmpeqb %%xmm4,%%xmm4 \n" + "psrlw $0xf,%%xmm4 \n" + "packuswb %%xmm4,%%xmm4 \n" + "pxor %%xmm5,%%xmm5 \n" +@@ -193,7 +195,7 @@ void ScaleRowDown2_AVX2(const uint8_t* s + uint8_t* dst_ptr, + int dst_width) { + (void)src_stride; +- asm volatile (LABELALIGN ++ asm volatile(LABELALIGN + "1: \n" + "vmovdqu (%0),%%ymm0 \n" + "vmovdqu 0x20(%0),%%ymm1 \n" +@@ -207,11 +209,11 @@ void ScaleRowDown2_AVX2(const uint8_t* s + "sub $0x20,%2 \n" + "jg 1b \n" + "vzeroupper \n" +- : "+r"(src_ptr), // %0 +- "+r"(dst_ptr), // %1 +- "+r"(dst_width) // %2 +- : +- : "memory", "cc", "xmm0", "xmm1"); ++ : "+r"(src_ptr), // %0 ++ "+r"(dst_ptr), // %1 ++ "+r"(dst_width) // %2 ++ ::"memory", ++ "cc", "xmm0", "xmm1"); + } + + void ScaleRowDown2Linear_AVX2(const uint8_t* src_ptr, +@@ -219,7 +221,8 @@ void ScaleRowDown2Linear_AVX2(const uint + uint8_t* dst_ptr, + int dst_width) { + (void)src_stride; +- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" ++ asm volatile( ++ "vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" + "vpsrlw $0xf,%%ymm4,%%ymm4 \n" + "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" + "vpxor %%ymm5,%%ymm5,%%ymm5 \n" +@@ -243,15 +246,16 @@ void ScaleRowDown2Linear_AVX2(const uint + : "+r"(src_ptr), // %0 + "+r"(dst_ptr), // %1 + "+r"(dst_width) // %2 +- : +- : "memory", "cc", "xmm0", "xmm1", "xmm4", "xmm5"); ++ ::"memory", ++ "cc", "xmm0", "xmm1", "xmm4", "xmm5"); + } + + void ScaleRowDown2Box_AVX2(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" ++ asm volatile( ++ "vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" + "vpsrlw $0xf,%%ymm4,%%ymm4 \n" + "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" + "vpxor %%ymm5,%%ymm5,%%ymm5 \n" +@@ -293,7 +297,8 @@ void ScaleRowDown4_SSSE3(const uint8_t* + uint8_t* dst_ptr, + int dst_width) { + (void)src_stride; +- asm("pcmpeqb %%xmm5,%%xmm5 \n" ++ asm volatile( ++ "pcmpeqb %%xmm5,%%xmm5 \n" + "psrld $0x18,%%xmm5 \n" + "pslld $0x10,%%xmm5 \n" + +@@ -314,8 +319,8 @@ void ScaleRowDown4_SSSE3(const uint8_t* + : "+r"(src_ptr), // %0 + "+r"(dst_ptr), // %1 + "+r"(dst_width) // %2 +- : +- : "memory", "cc", "xmm0", "xmm1", "xmm5"); ++ ::"memory", ++ "cc", "xmm0", "xmm1", "xmm5"); + } + + void ScaleRowDown4Box_SSSE3(const uint8_t* src_ptr, +@@ -323,7 +328,8 @@ void ScaleRowDown4Box_SSSE3(const uint8_ + uint8_t* dst_ptr, + int dst_width) { + intptr_t stridex3; +- asm("pcmpeqb %%xmm4,%%xmm4 \n" ++ asm volatile( ++ "pcmpeqb %%xmm4,%%xmm4 \n" + "psrlw $0xf,%%xmm4 \n" + "movdqa %%xmm4,%%xmm5 \n" + "packuswb %%xmm4,%%xmm4 \n" +@@ -377,7 +383,8 @@ void ScaleRowDown4_AVX2(const uint8_t* s + uint8_t* dst_ptr, + int dst_width) { + (void)src_stride; +- asm("vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" ++ asm volatile( ++ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" + "vpsrld $0x18,%%ymm5,%%ymm5 \n" + "vpslld $0x10,%%ymm5,%%ymm5 \n" + +@@ -401,15 +408,16 @@ void ScaleRowDown4_AVX2(const uint8_t* s + : "+r"(src_ptr), // %0 + "+r"(dst_ptr), // %1 + "+r"(dst_width) // %2 +- : +- : "memory", "cc", "xmm0", "xmm1", "xmm5"); ++ ::"memory", ++ "cc", "xmm0", "xmm1", "xmm5"); + } + + void ScaleRowDown4Box_AVX2(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" ++ asm volatile( ++ "vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" + "vpsrlw $0xf,%%ymm4,%%ymm4 \n" + "vpsllw $0x3,%%ymm4,%%ymm5 \n" + "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" +@@ -464,7 +472,8 @@ void ScaleRowDown34_SSSE3(const uint8_t* + uint8_t* dst_ptr, + int dst_width) { + (void)src_stride; +- asm("movdqa %0,%%xmm3 \n" ++ asm volatile( ++ "movdqa %0,%%xmm3 \n" + "movdqa %1,%%xmm4 \n" + "movdqa %2,%%xmm5 \n" + : +@@ -472,7 +481,7 @@ void ScaleRowDown34_SSSE3(const uint8_t* + "m"(kShuf1), // %1 + "m"(kShuf2) // %2 + ); +- asm volatile (LABELALIGN ++ asm volatile(LABELALIGN + "1: \n" + "movdqu (%0),%%xmm0 \n" + "movdqu 0x10(%0),%%xmm2 \n" +@@ -488,18 +497,19 @@ void ScaleRowDown34_SSSE3(const uint8_t* + "lea 0x18(%1),%1 \n" + "sub $0x18,%2 \n" + "jg 1b \n" +- : "+r"(src_ptr), // %0 +- "+r"(dst_ptr), // %1 +- "+r"(dst_width) // %2 +- : +- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5"); ++ : "+r"(src_ptr), // %0 ++ "+r"(dst_ptr), // %1 ++ "+r"(dst_width) // %2 ++ ::"memory", ++ "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5"); + } + + void ScaleRowDown34_1_Box_SSSE3(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm("movdqa %0,%%xmm2 \n" // kShuf01 ++ asm volatile( ++ "movdqa %0,%%xmm2 \n" // kShuf01 + "movdqa %1,%%xmm3 \n" // kShuf11 + "movdqa %2,%%xmm4 \n" // kShuf21 + : +@@ -507,7 +517,8 @@ void ScaleRowDown34_1_Box_SSSE3(const ui + "m"(kShuf11), // %1 + "m"(kShuf21) // %2 + ); +- asm("movdqa %0,%%xmm5 \n" // kMadd01 ++ asm volatile( ++ "movdqa %0,%%xmm5 \n" // kMadd01 + "movdqa %1,%%xmm0 \n" // kMadd11 + "movdqa %2,%%xmm1 \n" // kRound34 + : +@@ -515,7 +526,7 @@ void ScaleRowDown34_1_Box_SSSE3(const ui + "m"(kMadd11), // %1 + "m"(kRound34) // %2 + ); +- asm volatile (LABELALIGN ++ asm volatile(LABELALIGN + "1: \n" + "movdqu (%0),%%xmm6 \n" + "movdqu 0x00(%0,%3,1),%%xmm7 \n" +@@ -548,20 +559,21 @@ void ScaleRowDown34_1_Box_SSSE3(const ui + "lea 0x18(%1),%1 \n" + "sub $0x18,%2 \n" + "jg 1b \n" +- : "+r"(src_ptr), // %0 +- "+r"(dst_ptr), // %1 +- "+r"(dst_width) // %2 +- : "r"((intptr_t)(src_stride)), // %3 +- "m"(kMadd21) // %4 +- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", +- "xmm7"); ++ : "+r"(src_ptr), // %0 ++ "+r"(dst_ptr), // %1 ++ "+r"(dst_width) // %2 ++ : "r"((intptr_t)(src_stride)), // %3 ++ "m"(kMadd21) // %4 ++ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", ++ "xmm6", "xmm7"); + } + + void ScaleRowDown34_0_Box_SSSE3(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm("movdqa %0,%%xmm2 \n" // kShuf01 ++ asm volatile( ++ "movdqa %0,%%xmm2 \n" // kShuf01 + "movdqa %1,%%xmm3 \n" // kShuf11 + "movdqa %2,%%xmm4 \n" // kShuf21 + : +@@ -569,7 +581,8 @@ void ScaleRowDown34_0_Box_SSSE3(const ui + "m"(kShuf11), // %1 + "m"(kShuf21) // %2 + ); +- asm("movdqa %0,%%xmm5 \n" // kMadd01 ++ asm volatile( ++ "movdqa %0,%%xmm5 \n" // kMadd01 + "movdqa %1,%%xmm0 \n" // kMadd11 + "movdqa %2,%%xmm1 \n" // kRound34 + : +@@ -578,7 +591,7 @@ void ScaleRowDown34_0_Box_SSSE3(const ui + "m"(kRound34) // %2 + ); + +- asm volatile (LABELALIGN ++ asm volatile(LABELALIGN + "1: \n" + "movdqu (%0),%%xmm6 \n" + "movdqu 0x00(%0,%3,1),%%xmm7 \n" +@@ -614,13 +627,13 @@ void ScaleRowDown34_0_Box_SSSE3(const ui + "lea 0x18(%1),%1 \n" + "sub $0x18,%2 \n" + "jg 1b \n" +- : "+r"(src_ptr), // %0 +- "+r"(dst_ptr), // %1 +- "+r"(dst_width) // %2 +- : "r"((intptr_t)(src_stride)), // %3 +- "m"(kMadd21) // %4 +- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", +- "xmm7"); ++ : "+r"(src_ptr), // %0 ++ "+r"(dst_ptr), // %1 ++ "+r"(dst_width) // %2 ++ : "r"((intptr_t)(src_stride)), // %3 ++ "m"(kMadd21) // %4 ++ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", ++ "xmm6", "xmm7"); + } + + void ScaleRowDown38_SSSE3(const uint8_t* src_ptr, +@@ -628,7 +641,8 @@ void ScaleRowDown38_SSSE3(const uint8_t* + uint8_t* dst_ptr, + int dst_width) { + (void)src_stride; +- asm("movdqa %3,%%xmm4 \n" ++ asm volatile( ++ "movdqa %3,%%xmm4 \n" + "movdqa %4,%%xmm5 \n" + + LABELALIGN +@@ -657,7 +671,8 @@ void ScaleRowDown38_2_Box_SSSE3(const ui + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm("movdqa %0,%%xmm2 \n" ++ asm volatile( ++ "movdqa %0,%%xmm2 \n" + "movdqa %1,%%xmm3 \n" + "movdqa %2,%%xmm4 \n" + "movdqa %3,%%xmm5 \n" +@@ -667,7 +682,7 @@ void ScaleRowDown38_2_Box_SSSE3(const ui + "m"(kShufAb2), // %2 + "m"(kScaleAb2) // %3 + ); +- asm volatile (LABELALIGN ++ asm volatile(LABELALIGN + "1: \n" + "movdqu (%0),%%xmm0 \n" + "movdqu 0x00(%0,%3,1),%%xmm1 \n" +@@ -688,18 +703,20 @@ void ScaleRowDown38_2_Box_SSSE3(const ui + "lea 0x6(%1),%1 \n" + "sub $0x6,%2 \n" + "jg 1b \n" +- : "+r"(src_ptr), // %0 +- "+r"(dst_ptr), // %1 +- "+r"(dst_width) // %2 +- : "r"((intptr_t)(src_stride)) // %3 +- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6"); ++ : "+r"(src_ptr), // %0 ++ "+r"(dst_ptr), // %1 ++ "+r"(dst_width) // %2 ++ : "r"((intptr_t)(src_stride)) // %3 ++ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", ++ "xmm6"); + } + + void ScaleRowDown38_3_Box_SSSE3(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm("movdqa %0,%%xmm2 \n" ++ asm volatile( ++ "movdqa %0,%%xmm2 \n" + "movdqa %1,%%xmm3 \n" + "movdqa %2,%%xmm4 \n" + "pxor %%xmm5,%%xmm5 \n" +@@ -708,7 +725,7 @@ void ScaleRowDown38_3_Box_SSSE3(const ui + "m"(kShufAc3), // %1 + "m"(kScaleAc33) // %2 + ); +- asm volatile (LABELALIGN ++ asm volatile(LABELALIGN + "1: \n" + "movdqu (%0),%%xmm0 \n" + "movdqu 0x00(%0,%3,1),%%xmm6 \n" +@@ -748,12 +765,12 @@ void ScaleRowDown38_3_Box_SSSE3(const ui + "lea 0x6(%1),%1 \n" + "sub $0x6,%2 \n" + "jg 1b \n" +- : "+r"(src_ptr), // %0 +- "+r"(dst_ptr), // %1 +- "+r"(dst_width) // %2 +- : "r"((intptr_t)(src_stride)) // %3 +- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", +- "xmm7"); ++ : "+r"(src_ptr), // %0 ++ "+r"(dst_ptr), // %1 ++ "+r"(dst_width) // %2 ++ : "r"((intptr_t)(src_stride)) // %3 ++ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", ++ "xmm6", "xmm7"); + } + + static const uvec8 kLinearShuffleFar = {2, 3, 0, 1, 6, 7, 4, 5, +@@ -766,7 +783,8 @@ static const uvec8 kLinearMadd31 = {3, 1 + void ScaleRowUp2_Linear_SSE2(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int dst_width) { +- asm("pxor %%xmm0,%%xmm0 \n" // 0 ++ asm volatile( ++ "pxor %%xmm0,%%xmm0 \n" // 0 + "pcmpeqw %%xmm6,%%xmm6 \n" + "psrlw $15,%%xmm6 \n" + "psllw $1,%%xmm6 \n" // all 2 +@@ -821,7 +839,8 @@ void ScaleRowUp2_Bilinear_SSE2(const uin + uint8_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width) { +- asm volatile (LABELALIGN ++ asm volatile( ++ LABELALIGN + "1: \n" + "pxor %%xmm0,%%xmm0 \n" // 0 + // above line +@@ -934,7 +953,8 @@ void ScaleRowUp2_Bilinear_SSE2(const uin + void ScaleRowUp2_Linear_12_SSSE3(const uint16_t* src_ptr, + uint16_t* dst_ptr, + int dst_width) { +- asm("movdqa %3,%%xmm5 \n" ++ asm volatile( ++ "movdqa %3,%%xmm5 \n" + "pcmpeqw %%xmm4,%%xmm4 \n" + "psrlw $15,%%xmm4 \n" + "psllw $1,%%xmm4 \n" // all 2 +@@ -985,7 +1005,8 @@ void ScaleRowUp2_Bilinear_12_SSSE3(const + uint16_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width) { +- asm("pcmpeqw %%xmm7,%%xmm7 \n" ++ asm volatile( ++ "pcmpeqw %%xmm7,%%xmm7 \n" + "psrlw $15,%%xmm7 \n" + "psllw $3,%%xmm7 \n" // all 8 + "movdqa %5,%%xmm6 \n" +@@ -1082,7 +1103,8 @@ void ScaleRowUp2_Bilinear_12_SSSE3(const + void ScaleRowUp2_Linear_16_SSE2(const uint16_t* src_ptr, + uint16_t* dst_ptr, + int dst_width) { +- asm("pxor %%xmm5,%%xmm5 \n" ++ asm volatile( ++ "pxor %%xmm5,%%xmm5 \n" + "pcmpeqd %%xmm4,%%xmm4 \n" + "psrld $31,%%xmm4 \n" + "pslld $1,%%xmm4 \n" // all 2 +@@ -1134,7 +1156,8 @@ void ScaleRowUp2_Bilinear_16_SSE2(const + uint16_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width) { +- asm("pxor %%xmm7,%%xmm7 \n" ++ asm volatile( ++ "pxor %%xmm7,%%xmm7 \n" + "pcmpeqd %%xmm6,%%xmm6 \n" + "psrld $31,%%xmm6 \n" + "pslld $3,%%xmm6 \n" // all 8 +@@ -1241,7 +1264,8 @@ void ScaleRowUp2_Bilinear_16_SSE2(const + void ScaleRowUp2_Linear_SSSE3(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int dst_width) { +- asm("pcmpeqw %%xmm4,%%xmm4 \n" ++ asm volatile( ++ "pcmpeqw %%xmm4,%%xmm4 \n" + "psrlw $15,%%xmm4 \n" + "psllw $1,%%xmm4 \n" // all 2 + "movdqa %3,%%xmm3 \n" +@@ -1281,7 +1305,8 @@ void ScaleRowUp2_Bilinear_SSSE3(const ui + uint8_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width) { +- asm("pcmpeqw %%xmm6,%%xmm6 \n" ++ asm volatile( ++ "pcmpeqw %%xmm6,%%xmm6 \n" + "psrlw $15,%%xmm6 \n" + "psllw $3,%%xmm6 \n" // all 8 + "movdqa %5,%%xmm7 \n" +@@ -1365,7 +1390,8 @@ void ScaleRowUp2_Bilinear_SSSE3(const ui + void ScaleRowUp2_Linear_AVX2(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int dst_width) { +- asm("vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" ++ asm volatile( ++ "vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" + "vpsrlw $15,%%ymm4,%%ymm4 \n" + "vpsllw $1,%%ymm4,%%ymm4 \n" // all 2 + "vbroadcastf128 %3,%%ymm3 \n" +@@ -1408,7 +1434,8 @@ void ScaleRowUp2_Bilinear_AVX2(const uin + uint8_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width) { +- asm("vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" ++ asm volatile( ++ "vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" + "vpsrlw $15,%%ymm6,%%ymm6 \n" + "vpsllw $3,%%ymm6,%%ymm6 \n" // all 8 + "vbroadcastf128 %5,%%ymm7 \n" +@@ -1489,7 +1516,8 @@ void ScaleRowUp2_Bilinear_AVX2(const uin + void ScaleRowUp2_Linear_12_AVX2(const uint16_t* src_ptr, + uint16_t* dst_ptr, + int dst_width) { +- asm("vbroadcastf128 %3,%%ymm5 \n" ++ asm volatile( ++ "vbroadcastf128 %3,%%ymm5 \n" + "vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" + "vpsrlw $15,%%ymm4,%%ymm4 \n" + "vpsllw $1,%%ymm4,%%ymm4 \n" // all 2 +@@ -1540,7 +1568,8 @@ void ScaleRowUp2_Bilinear_12_AVX2(const + uint16_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width) { +- asm("vbroadcastf128 %5,%%ymm5 \n" ++ asm volatile( ++ "vbroadcastf128 %5,%%ymm5 \n" + "vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" + "vpsrlw $15,%%ymm4,%%ymm4 \n" + "vpsllw $3,%%ymm4,%%ymm4 \n" // all 8 +@@ -1601,7 +1630,8 @@ void ScaleRowUp2_Bilinear_12_AVX2(const + void ScaleRowUp2_Linear_16_AVX2(const uint16_t* src_ptr, + uint16_t* dst_ptr, + int dst_width) { +- asm("vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" ++ asm volatile( ++ "vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" + "vpsrld $31,%%ymm4,%%ymm4 \n" + "vpslld $1,%%ymm4,%%ymm4 \n" // all 2 + +@@ -1650,7 +1680,8 @@ void ScaleRowUp2_Bilinear_16_AVX2(const + uint16_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width) { +- asm("vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" ++ asm volatile( ++ "vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" + "vpsrld $31,%%ymm6,%%ymm6 \n" + "vpslld $3,%%ymm6,%%ymm6 \n" // all 8 + +@@ -1732,10 +1763,10 @@ void ScaleRowUp2_Bilinear_16_AVX2(const + void ScaleAddRow_SSE2(const uint8_t* src_ptr, + uint16_t* dst_ptr, + int src_width) { +- asm("pxor %%xmm5,%%xmm5 \n" ++ asm volatile("pxor %%xmm5,%%xmm5 \n" + +- // 16 pixel loop. +- LABELALIGN ++ // 16 pixel loop. ++ LABELALIGN + "1: \n" + "movdqu (%0),%%xmm3 \n" + "lea 0x10(%0),%0 \n" // src_ptr += 16 +@@ -1751,11 +1782,11 @@ void ScaleAddRow_SSE2(const uint8_t* src + "lea 0x20(%1),%1 \n" + "sub $0x10,%2 \n" + "jg 1b \n" +- : "+r"(src_ptr), // %0 +- "+r"(dst_ptr), // %1 +- "+r"(src_width) // %2 +- : +- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm5"); ++ : "+r"(src_ptr), // %0 ++ "+r"(dst_ptr), // %1 ++ "+r"(src_width) // %2 ++ : ++ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm5"); + } + + #ifdef HAS_SCALEADDROW_AVX2 +@@ -1763,9 +1794,9 @@ void ScaleAddRow_SSE2(const uint8_t* src + void ScaleAddRow_AVX2(const uint8_t* src_ptr, + uint16_t* dst_ptr, + int src_width) { +- asm("vpxor %%ymm5,%%ymm5,%%ymm5 \n" ++ asm volatile("vpxor %%ymm5,%%ymm5,%%ymm5 \n" + +- LABELALIGN ++ LABELALIGN + "1: \n" + "vmovdqu (%0),%%ymm3 \n" + "lea 0x20(%0),%0 \n" // src_ptr += 32 +@@ -1780,11 +1811,11 @@ void ScaleAddRow_AVX2(const uint8_t* src + "sub $0x20,%2 \n" + "jg 1b \n" + "vzeroupper \n" +- : "+r"(src_ptr), // %0 +- "+r"(dst_ptr), // %1 +- "+r"(src_width) // %2 +- : +- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm5"); ++ : "+r"(src_ptr), // %0 ++ "+r"(dst_ptr), // %1 ++ "+r"(src_width) // %2 ++ : ++ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm5"); + } + #endif // HAS_SCALEADDROW_AVX2 + +@@ -1804,7 +1835,8 @@ void ScaleFilterCols_SSSE3(uint8_t* dst_ + int x, + int dx) { + intptr_t x0, x1, temp_pixel; +- asm("movd %6,%%xmm2 \n" ++ asm volatile( ++ "movd %6,%%xmm2 \n" + "movd %7,%%xmm3 \n" + "movl $0x04040000,%k2 \n" + "movd %k2,%%xmm5 \n" +@@ -1900,7 +1932,7 @@ void ScaleColsUp2_SSE2(uint8_t* dst_ptr, + int dx) { + (void)x; + (void)dx; +- asm volatile (LABELALIGN ++ asm volatile(LABELALIGN + "1: \n" + "movdqu (%1),%%xmm0 \n" + "lea 0x10(%1),%1 \n" +@@ -1913,11 +1945,11 @@ void ScaleColsUp2_SSE2(uint8_t* dst_ptr, + "sub $0x20,%2 \n" + "jg 1b \n" + +- : "+r"(dst_ptr), // %0 +- "+r"(src_ptr), // %1 +- "+r"(dst_width) // %2 +- : +- : "memory", "cc", "xmm0", "xmm1"); ++ : "+r"(dst_ptr), // %0 ++ "+r"(src_ptr), // %1 ++ "+r"(dst_width) // %2 ++ ::"memory", ++ "cc", "xmm0", "xmm1"); + } + + void ScaleARGBRowDown2_SSE2(const uint8_t* src_argb, +@@ -1925,7 +1957,7 @@ void ScaleARGBRowDown2_SSE2(const uint8_ + uint8_t* dst_argb, + int dst_width) { + (void)src_stride; +- asm volatile (LABELALIGN ++ asm volatile(LABELALIGN + "1: \n" + "movdqu (%0),%%xmm0 \n" + "movdqu 0x10(%0),%%xmm1 \n" +@@ -1935,11 +1967,11 @@ void ScaleARGBRowDown2_SSE2(const uint8_ + "lea 0x10(%1),%1 \n" + "sub $0x4,%2 \n" + "jg 1b \n" +- : "+r"(src_argb), // %0 +- "+r"(dst_argb), // %1 +- "+r"(dst_width) // %2 +- : +- : "memory", "cc", "xmm0", "xmm1"); ++ : "+r"(src_argb), // %0 ++ "+r"(dst_argb), // %1 ++ "+r"(dst_width) // %2 ++ ::"memory", ++ "cc", "xmm0", "xmm1"); + } + + void ScaleARGBRowDown2Linear_SSE2(const uint8_t* src_argb, +@@ -1947,7 +1979,7 @@ void ScaleARGBRowDown2Linear_SSE2(const + uint8_t* dst_argb, + int dst_width) { + (void)src_stride; +- asm volatile (LABELALIGN ++ asm volatile(LABELALIGN + "1: \n" + "movdqu (%0),%%xmm0 \n" + "movdqu 0x10(%0),%%xmm1 \n" +@@ -1960,18 +1992,18 @@ void ScaleARGBRowDown2Linear_SSE2(const + "lea 0x10(%1),%1 \n" + "sub $0x4,%2 \n" + "jg 1b \n" +- : "+r"(src_argb), // %0 +- "+r"(dst_argb), // %1 +- "+r"(dst_width) // %2 +- : +- : "memory", "cc", "xmm0", "xmm1"); ++ : "+r"(src_argb), // %0 ++ "+r"(dst_argb), // %1 ++ "+r"(dst_width) // %2 ++ ::"memory", ++ "cc", "xmm0", "xmm1"); + } + + void ScaleARGBRowDown2Box_SSE2(const uint8_t* src_argb, + ptrdiff_t src_stride, + uint8_t* dst_argb, + int dst_width) { +- asm volatile (LABELALIGN ++ asm volatile(LABELALIGN + "1: \n" + "movdqu (%0),%%xmm0 \n" + "movdqu 0x10(%0),%%xmm1 \n" +@@ -1988,11 +2020,11 @@ void ScaleARGBRowDown2Box_SSE2(const uin + "lea 0x10(%1),%1 \n" + "sub $0x4,%2 \n" + "jg 1b \n" +- : "+r"(src_argb), // %0 +- "+r"(dst_argb), // %1 +- "+r"(dst_width) // %2 +- : "r"((intptr_t)(src_stride)) // %3 +- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3"); ++ : "+r"(src_argb), // %0 ++ "+r"(dst_argb), // %1 ++ "+r"(dst_width) // %2 ++ : "r"((intptr_t)(src_stride)) // %3 ++ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3"); + } + + // Reads 4 pixels at a time. +@@ -2005,7 +2037,8 @@ void ScaleARGBRowDownEven_SSE2(const uin + intptr_t src_stepx_x4 = (intptr_t)(src_stepx); + intptr_t src_stepx_x12; + (void)src_stride; +- asm("lea 0x00(,%1,4),%1 \n" ++ asm volatile( ++ "lea 0x00(,%1,4),%1 \n" + "lea 0x00(%1,%1,2),%4 \n" + + LABELALIGN +@@ -2027,8 +2060,8 @@ void ScaleARGBRowDownEven_SSE2(const uin + "+r"(dst_argb), // %2 + "+r"(dst_width), // %3 + "=&r"(src_stepx_x12) // %4 +- : +- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3"); ++ ::"memory", ++ "cc", "xmm0", "xmm1", "xmm2", "xmm3"); + } + + // Blends four 2x2 to 4x1. +@@ -2041,7 +2074,8 @@ void ScaleARGBRowDownEvenBox_SSE2(const + intptr_t src_stepx_x4 = (intptr_t)(src_stepx); + intptr_t src_stepx_x12; + intptr_t row1 = (intptr_t)(src_stride); +- asm("lea 0x00(,%1,4),%1 \n" ++ asm volatile( ++ "lea 0x00(,%1,4),%1 \n" + "lea 0x00(%1,%1,2),%4 \n" + "lea 0x00(%0,%5,1),%5 \n" + +@@ -2073,8 +2107,8 @@ void ScaleARGBRowDownEvenBox_SSE2(const + "+rm"(dst_width), // %3 + "=&r"(src_stepx_x12), // %4 + "+r"(row1) // %5 +- : +- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3"); ++ ::"memory", ++ "cc", "xmm0", "xmm1", "xmm2", "xmm3"); + } + + void ScaleARGBCols_SSE2(uint8_t* dst_argb, +@@ -2083,7 +2117,8 @@ void ScaleARGBCols_SSE2(uint8_t* dst_arg + int x, + int dx) { + intptr_t x0, x1; +- asm("movd %5,%%xmm2 \n" ++ asm volatile( ++ "movd %5,%%xmm2 \n" + "movd %6,%%xmm3 \n" + "pshufd $0x0,%%xmm2,%%xmm2 \n" + "pshufd $0x11,%%xmm3,%%xmm0 \n" +@@ -2153,7 +2188,7 @@ void ScaleARGBColsUp2_SSE2(uint8_t* dst_ + int dx) { + (void)x; + (void)dx; +- asm volatile (LABELALIGN ++ asm volatile(LABELALIGN + "1: \n" + "movdqu (%1),%%xmm0 \n" + "lea 0x10(%1),%1 \n" +@@ -2166,11 +2201,11 @@ void ScaleARGBColsUp2_SSE2(uint8_t* dst_ + "sub $0x8,%2 \n" + "jg 1b \n" + +- : "+r"(dst_argb), // %0 +- "+r"(src_argb), // %1 +- "+r"(dst_width) // %2 +- : +- : "memory", "cc", "xmm0", "xmm1"); ++ : "+r"(dst_argb), // %0 ++ "+r"(src_argb), // %1 ++ "+r"(dst_width) // %2 ++ ::"memory", ++ "cc", "xmm0", "xmm1"); + } + + // Shuffle table for arranging 2 pixels into pairs for pmaddubsw +@@ -2191,14 +2226,16 @@ void ScaleARGBFilterCols_SSSE3(uint8_t* + int x, + int dx) { + intptr_t x0, x1; +- asm("movdqa %0,%%xmm4 \n" ++ asm volatile( ++ "movdqa %0,%%xmm4 \n" + "movdqa %1,%%xmm5 \n" + : + : "m"(kShuffleColARGB), // %0 + "m"(kShuffleFractions) // %1 + ); + +- asm("movd %5,%%xmm2 \n" ++ asm volatile( ++ "movd %5,%%xmm2 \n" + "movd %6,%%xmm3 \n" + "pcmpeqb %%xmm6,%%xmm6 \n" + "psrlw $0x9,%%xmm6 \n" +@@ -2246,7 +2283,8 @@ void ScaleARGBFilterCols_SSSE3(uint8_t* + "packuswb %%xmm0,%%xmm0 \n" + "movd %%xmm0,(%0) \n" + +- LABELALIGN "99: \n" ++ LABELALIGN ++ "99: \n" // clang-format error. + + : "+r"(dst_argb), // %0 + "+r"(src_argb), // %1 +@@ -2260,7 +2298,8 @@ void ScaleARGBFilterCols_SSSE3(uint8_t* + + // Divide num by div and return as 16.16 fixed point result. + int FixedDiv_X86(int num, int div) { +- asm("cdq \n" ++ asm volatile( ++ "cdq \n" + "shld $0x10,%%eax,%%edx \n" + "shl $0x10,%%eax \n" + "idiv %1 \n" +@@ -2273,7 +2312,8 @@ int FixedDiv_X86(int num, int div) { + + // Divide num - 1 by div - 1 and return as 16.16 fixed point result. + int FixedDiv1_X86(int num, int div) { +- asm("cdq \n" ++ asm volatile( ++ "cdq \n" + "shld $0x10,%%eax,%%edx \n" + "shl $0x10,%%eax \n" + "sub $0x10001,%%eax \n" +@@ -2304,7 +2344,8 @@ void ScaleUVRowDown2Box_SSSE3(const uint + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm("pcmpeqb %%xmm4,%%xmm4 \n" // 01010101 ++ asm volatile( ++ "pcmpeqb %%xmm4,%%xmm4 \n" // 01010101 + "psrlw $0xf,%%xmm4 \n" + "packuswb %%xmm4,%%xmm4 \n" + "pxor %%xmm5, %%xmm5 \n" // zero +@@ -2343,7 +2384,8 @@ void ScaleUVRowDown2Box_AVX2(const uint8 + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" // 01010101 ++ asm volatile( ++ "vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" // 01010101 + "vpsrlw $0xf,%%ymm4,%%ymm4 \n" + "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" + "vpxor %%ymm5,%%ymm5,%%ymm5 \n" // zero +@@ -2386,7 +2428,8 @@ static const uvec8 kUVLinearMadd31 = {3, + void ScaleUVRowUp2_Linear_SSSE3(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int dst_width) { +- asm("pcmpeqw %%xmm4,%%xmm4 \n" ++ asm volatile( ++ "pcmpeqw %%xmm4,%%xmm4 \n" + "psrlw $15,%%xmm4 \n" + "psllw $1,%%xmm4 \n" // all 2 + "movdqa %3,%%xmm3 \n" +@@ -2426,7 +2469,8 @@ void ScaleUVRowUp2_Bilinear_SSSE3(const + uint8_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width) { +- asm("pcmpeqw %%xmm6,%%xmm6 \n" ++ asm volatile( ++ "pcmpeqw %%xmm6,%%xmm6 \n" + "psrlw $15,%%xmm6 \n" + "psllw $3,%%xmm6 \n" // all 8 + "movdqa %5,%%xmm7 \n" +@@ -2509,7 +2553,8 @@ void ScaleUVRowUp2_Bilinear_SSSE3(const + void ScaleUVRowUp2_Linear_AVX2(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int dst_width) { +- asm("vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" ++ asm volatile( ++ "vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" + "vpsrlw $15,%%ymm4,%%ymm4 \n" + "vpsllw $1,%%ymm4,%%ymm4 \n" // all 2 + "vbroadcastf128 %3,%%ymm3 \n" +@@ -2551,7 +2596,8 @@ void ScaleUVRowUp2_Bilinear_AVX2(const u + uint8_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width) { +- asm("vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" ++ asm volatile( ++ "vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" + "vpsrlw $15,%%ymm6,%%ymm6 \n" + "vpsllw $3,%%ymm6,%%ymm6 \n" // all 8 + "vbroadcastf128 %5,%%ymm7 \n" +@@ -2630,7 +2676,8 @@ void ScaleUVRowUp2_Bilinear_AVX2(const u + void ScaleUVRowUp2_Linear_16_SSE41(const uint16_t* src_ptr, + uint16_t* dst_ptr, + int dst_width) { +- asm("pxor %%xmm5,%%xmm5 \n" ++ asm volatile( ++ "pxor %%xmm5,%%xmm5 \n" + "pcmpeqd %%xmm4,%%xmm4 \n" + "psrld $31,%%xmm4 \n" + "pslld $1,%%xmm4 \n" // all 2 +@@ -2681,7 +2728,8 @@ void ScaleUVRowUp2_Bilinear_16_SSE41(con + uint16_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width) { +- asm("pxor %%xmm7,%%xmm7 \n" ++ asm volatile( ++ "pxor %%xmm7,%%xmm7 \n" + "pcmpeqd %%xmm6,%%xmm6 \n" + "psrld $31,%%xmm6 \n" + "pslld $3,%%xmm6 \n" // all 8 +@@ -2771,7 +2819,8 @@ void ScaleUVRowUp2_Bilinear_16_SSE41(con + void ScaleUVRowUp2_Linear_16_AVX2(const uint16_t* src_ptr, + uint16_t* dst_ptr, + int dst_width) { +- asm("vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" ++ asm volatile( ++ "vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" + "vpsrld $31,%%ymm4,%%ymm4 \n" + "vpslld $1,%%ymm4,%%ymm4 \n" // all 2 + +@@ -2819,7 +2868,8 @@ void ScaleUVRowUp2_Bilinear_16_AVX2(cons + uint16_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width) { +- asm("vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" ++ asm volatile( ++ "vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" + "vpsrld $31,%%ymm6,%%ymm6 \n" + "vpslld $3,%%ymm6,%%ymm6 \n" // all 8 + +diff --git a/media/libyuv/libyuv/source/scale_neon.cc b/media/libyuv/libyuv/source/scale_neon.cc +--- a/media/libyuv/libyuv/source/scale_neon.cc ++++ b/media/libyuv/libyuv/source/scale_neon.cc +@@ -28,7 +28,7 @@ void ScaleRowDown2_NEON(const uint8_t* s + uint8_t* dst, + int dst_width) { + (void)src_stride; +- asm volatile ( ++ asm volatile( + "1: \n" + // load even pixels into q0, odd into q1 + "vld2.8 {q0, q1}, [%0]! \n" +@@ -49,7 +49,7 @@ void ScaleRowDown2Linear_NEON(const uint + uint8_t* dst, + int dst_width) { + (void)src_stride; +- asm volatile ( ++ asm volatile( + "1: \n" + "vld2.8 {q0, q1}, [%0]! \n" // load 32 pixels + "subs %2, %2, #16 \n" // 16 processed per loop +@@ -69,7 +69,7 @@ void ScaleRowDown2Box_NEON(const uint8_t + ptrdiff_t src_stride, + uint8_t* dst, + int dst_width) { +- asm volatile ( ++ asm volatile( + // change the stride to row 2 pointer + "add %1, %0 \n" + "1: \n" +@@ -100,7 +100,7 @@ void ScaleRowDown4_NEON(const uint8_t* s + uint8_t* dst_ptr, + int dst_width) { + (void)src_stride; +- asm volatile ( ++ asm volatile( + "1: \n" + "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // src line 0 + "subs %2, %2, #8 \n" // 8 processed per loop +@@ -120,7 +120,7 @@ void ScaleRowDown4Box_NEON(const uint8_t + const uint8_t* src_ptr1 = src_ptr + src_stride; + const uint8_t* src_ptr2 = src_ptr + src_stride * 2; + const uint8_t* src_ptr3 = src_ptr + src_stride * 3; +- asm volatile ( ++ asm volatile( + "1: \n" + "vld1.8 {q0}, [%0]! \n" // load up 16x4 + "vld1.8 {q1}, [%3]! \n" +@@ -154,7 +154,7 @@ void ScaleRowDown34_NEON(const uint8_t* + uint8_t* dst_ptr, + int dst_width) { + (void)src_stride; +- asm volatile ( ++ asm volatile( + "1: \n" + "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // src line 0 + "subs %2, %2, #24 \n" +@@ -172,7 +172,7 @@ void ScaleRowDown34_0_Box_NEON(const uin + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm volatile ( ++ asm volatile( + "vmov.u8 d24, #3 \n" + "add %3, %0 \n" + "1: \n" +@@ -229,7 +229,7 @@ void ScaleRowDown34_1_Box_NEON(const uin + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm volatile ( ++ asm volatile( + "vmov.u8 d24, #3 \n" + "add %3, %0 \n" + "1: \n" +@@ -281,7 +281,7 @@ void ScaleRowDown38_NEON(const uint8_t* + uint8_t* dst_ptr, + int dst_width) { + (void)src_stride; +- asm volatile ( ++ asm volatile( + "vld1.8 {q3}, [%3] \n" + "1: \n" + "vld1.8 {d0, d1, d2, d3}, [%0]! \n" +@@ -305,7 +305,7 @@ void OMITFP ScaleRowDown38_3_Box_NEON(co + int dst_width) { + const uint8_t* src_ptr1 = src_ptr + src_stride * 2; + +- asm volatile ( ++ asm volatile( + "vld1.16 {q13}, [%5] \n" + "vld1.8 {q14}, [%6] \n" + "vld1.8 {q15}, [%7] \n" +@@ -415,7 +415,7 @@ void ScaleRowDown38_2_Box_NEON(const uin + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm volatile ( ++ asm volatile( + "vld1.16 {q13}, [%4] \n" + "vld1.8 {q14}, [%5] \n" + "add %3, %0 \n" +@@ -508,7 +508,7 @@ void ScaleRowUp2_Linear_NEON(const uint8 + uint8_t* dst_ptr, + int dst_width) { + const uint8_t* src_temp = src_ptr + 1; +- asm volatile ( ++ asm volatile( + "vmov.u8 d30, #3 \n" + + "1: \n" +@@ -545,7 +545,7 @@ void ScaleRowUp2_Bilinear_NEON(const uin + const uint8_t* src_temp = src_ptr + 1; + const uint8_t* src_temp1 = src_ptr1 + 1; + +- asm volatile ( ++ asm volatile( + "vmov.u16 q15, #3 \n" + "vmov.u8 d28, #3 \n" + +@@ -607,7 +607,7 @@ void ScaleRowUp2_Linear_12_NEON(const ui + uint16_t* dst_ptr, + int dst_width) { + const uint16_t* src_temp = src_ptr + 1; +- asm volatile ( ++ asm volatile( + "vmov.u16 q15, #3 \n" + + "1: \n" +@@ -643,7 +643,7 @@ void ScaleRowUp2_Bilinear_12_NEON(const + const uint16_t* src_temp = src_ptr + 1; + const uint16_t* src_temp1 = src_ptr1 + 1; + +- asm volatile ( ++ asm volatile( + "vmov.u16 q15, #3 \n" + + "1: \n" +@@ -694,7 +694,7 @@ void ScaleRowUp2_Linear_16_NEON(const ui + uint16_t* dst_ptr, + int dst_width) { + const uint16_t* src_temp = src_ptr + 1; +- asm volatile ( ++ asm volatile( + "vmov.u16 d31, #3 \n" + + "1: \n" +@@ -738,7 +738,7 @@ void ScaleRowUp2_Bilinear_16_NEON(const + const uint16_t* src_temp = src_ptr + 1; + const uint16_t* src_temp1 = src_ptr1 + 1; + +- asm volatile ( ++ asm volatile( + "vmov.u16 d31, #3 \n" + "vmov.u32 q14, #3 \n" + +@@ -790,7 +790,7 @@ void ScaleUVRowUp2_Linear_NEON(const uin + uint8_t* dst_ptr, + int dst_width) { + const uint8_t* src_temp = src_ptr + 2; +- asm volatile ( ++ asm volatile( + "vmov.u8 d30, #3 \n" + + "1: \n" +@@ -827,7 +827,7 @@ void ScaleUVRowUp2_Bilinear_NEON(const u + const uint8_t* src_temp = src_ptr + 2; + const uint8_t* src_temp1 = src_ptr1 + 2; + +- asm volatile ( ++ asm volatile( + "vmov.u16 q15, #3 \n" + "vmov.u8 d28, #3 \n" + +@@ -889,7 +889,7 @@ void ScaleUVRowUp2_Linear_16_NEON(const + uint16_t* dst_ptr, + int dst_width) { + const uint16_t* src_temp = src_ptr + 2; +- asm volatile ( ++ asm volatile( + "vmov.u16 d30, #3 \n" + + "1: \n" +@@ -934,7 +934,7 @@ void ScaleUVRowUp2_Bilinear_16_NEON(cons + const uint16_t* src_temp = src_ptr + 2; + const uint16_t* src_temp1 = src_ptr1 + 2; + +- asm volatile ( ++ asm volatile( + "vmov.u16 d30, #3 \n" + "vmov.u32 q14, #3 \n" + +@@ -987,7 +987,7 @@ void ScaleUVRowUp2_Bilinear_16_NEON(cons + void ScaleAddRow_NEON(const uint8_t* src_ptr, + uint16_t* dst_ptr, + int src_width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "vld1.16 {q1, q2}, [%1] \n" // load accumulator + "vld1.8 {q0}, [%0]! \n" // load 16 bytes +@@ -1086,7 +1086,7 @@ void ScaleFilterRows_NEON(uint8_t* dst_p + ptrdiff_t src_stride, + int dst_width, + int source_y_fraction) { +- asm volatile ( ++ asm volatile( + "cmp %4, #0 \n" + "beq 100f \n" + "add %2, %1 \n" +@@ -1170,7 +1170,7 @@ void ScaleARGBRowDown2_NEON(const uint8_ + uint8_t* dst, + int dst_width) { + (void)src_stride; +- asm volatile ( ++ asm volatile( + "1: \n" + "vld4.32 {d0, d2, d4, d6}, [%0]! \n" // load 8 ARGB pixels. + "vld4.32 {d1, d3, d5, d7}, [%0]! \n" // load next 8 ARGB +@@ -1198,7 +1198,7 @@ void ScaleARGBRowDown2Linear_NEON(const + uint8_t* dst_argb, + int dst_width) { + (void)src_stride; +- asm volatile ( ++ asm volatile( + "1: \n" + "vld4.32 {d0, d2, d4, d6}, [%0]! \n" // load 8 ARGB pixels. + "vld4.32 {d1, d3, d5, d7}, [%0]! \n" // load next 8 ARGB +@@ -1219,7 +1219,7 @@ void ScaleARGBRowDown2Box_NEON(const uin + ptrdiff_t src_stride, + uint8_t* dst, + int dst_width) { +- asm volatile ( ++ asm volatile( + // change the stride to row 2 pointer + "add %1, %1, %0 \n" + "1: \n" +@@ -1258,7 +1258,7 @@ void ScaleARGBRowDownEven_NEON(const uin + uint8_t* dst_argb, + int dst_width) { + (void)src_stride; +- asm volatile ( ++ asm volatile( + "mov r12, %3, lsl #2 \n" + "1: \n" + "vld1.32 {d0[0]}, [%0], r12 \n" +@@ -1282,7 +1282,7 @@ void ScaleARGBRowDownEvenBox_NEON(const + int src_stepx, + uint8_t* dst_argb, + int dst_width) { +- asm volatile ( ++ asm volatile( + "mov r12, %4, lsl #2 \n" + "add %1, %1, %0 \n" + "1: \n" +@@ -1330,7 +1330,7 @@ void ScaleARGBCols_NEON(uint8_t* dst_arg + int dx) { + int tmp; + const uint8_t* src_tmp = src_argb; +- asm volatile ( ++ asm volatile( + "1: \n" + // clang-format off + LOAD1_DATA32_LANE(d0, 0) +@@ -1428,50 +1428,11 @@ void ScaleARGBFilterCols_NEON(uint8_t* d + + #undef LOAD2_DATA32_LANE + +-void ScaleUVRowDown2_NEON(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- uint8_t* dst, +- int dst_width) { +- (void)src_stride; +- asm volatile ( +- "1: \n" +- "vld2.16 {d0, d2}, [%0]! \n" // load 8 UV pixels. +- "vld2.16 {d1, d3}, [%0]! \n" // load next 8 UV +- "subs %2, %2, #8 \n" // 8 processed per loop. +- "vst1.16 {q1}, [%1]! \n" // store 8 UV +- "bgt 1b \n" +- : "+r"(src_ptr), // %0 +- "+r"(dst), // %1 +- "+r"(dst_width) // %2 +- : +- : "memory", "cc", "q0", "q1"); +-} +- +-void ScaleUVRowDown2Linear_NEON(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- uint8_t* dst, +- int dst_width) { +- (void)src_stride; +- asm volatile ( +- "1: \n" +- "vld2.16 {d0, d2}, [%0]! \n" // load 8 UV pixels. +- "vld2.16 {d1, d3}, [%0]! \n" // load next 8 UV +- "subs %2, %2, #8 \n" // 8 processed per loop. +- "vrhadd.u8 q0, q0, q1 \n" // rounding half add +- "vst1.16 {q0}, [%1]! \n" // store 8 UV +- "bgt 1b \n" +- : "+r"(src_ptr), // %0 +- "+r"(dst), // %1 +- "+r"(dst_width) // %2 +- : +- : "memory", "cc", "q0", "q1"); +-} +- + void ScaleUVRowDown2Box_NEON(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst, + int dst_width) { +- asm volatile ( ++ asm volatile( + // change the stride to row 2 pointer + "add %1, %1, %0 \n" + "1: \n" +@@ -1506,7 +1467,7 @@ void ScaleUVRowDownEven_NEON(const uint8 + const uint8_t* src2_ptr = src_ptr + src_stepx * 4; + const uint8_t* src3_ptr = src_ptr + src_stepx * 6; + (void)src_stride; +- asm volatile ( ++ asm volatile( + "1: \n" + "vld1.16 {d0[0]}, [%0], %6 \n" + "vld1.16 {d0[1]}, [%1], %6 \n" +diff --git a/media/libyuv/libyuv/source/scale_neon64.cc b/media/libyuv/libyuv/source/scale_neon64.cc +--- a/media/libyuv/libyuv/source/scale_neon64.cc ++++ b/media/libyuv/libyuv/source/scale_neon64.cc +@@ -26,7 +26,7 @@ void ScaleRowDown2_NEON(const uint8_t* s + uint8_t* dst, + int dst_width) { + (void)src_stride; +- asm volatile ( ++ asm volatile( + "1: \n" + // load even pixels into v0, odd into v1 + "ld2 {v0.16b,v1.16b}, [%0], #32 \n" +@@ -38,7 +38,7 @@ void ScaleRowDown2_NEON(const uint8_t* s + "+r"(dst), // %1 + "+r"(dst_width) // %2 + : +- : "memory", "cc", "v0", "v1" // Clobber List ++ : "v0", "v1" // Clobber List + ); + } + +@@ -48,7 +48,7 @@ void ScaleRowDown2Linear_NEON(const uint + uint8_t* dst, + int dst_width) { + (void)src_stride; +- asm volatile ( ++ asm volatile( + "1: \n" + // load even pixels into v0, odd into v1 + "ld2 {v0.16b,v1.16b}, [%0], #32 \n" +@@ -61,7 +61,7 @@ void ScaleRowDown2Linear_NEON(const uint + "+r"(dst), // %1 + "+r"(dst_width) // %2 + : +- : "memory", "cc", "v0", "v1" // Clobber List ++ : "v0", "v1" // Clobber List + ); + } + +@@ -70,7 +70,7 @@ void ScaleRowDown2Box_NEON(const uint8_t + ptrdiff_t src_stride, + uint8_t* dst, + int dst_width) { +- asm volatile ( ++ asm volatile( + // change the stride to row 2 pointer + "add %1, %1, %0 \n" + "1: \n" +@@ -92,7 +92,7 @@ void ScaleRowDown2Box_NEON(const uint8_t + "+r"(dst), // %2 + "+r"(dst_width) // %3 + : +- : "memory", "cc", "v0", "v1", "v2", "v3" // Clobber List ++ : "v0", "v1", "v2", "v3" // Clobber List + ); + } + +@@ -101,7 +101,7 @@ void ScaleRowDown4_NEON(const uint8_t* s + uint8_t* dst_ptr, + int dst_width) { + (void)src_stride; +- asm volatile ( ++ asm volatile( + "1: \n" + "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // src line 0 + "subs %w2, %w2, #8 \n" // 8 processed per loop +@@ -112,7 +112,7 @@ void ScaleRowDown4_NEON(const uint8_t* s + "+r"(dst_ptr), // %1 + "+r"(dst_width) // %2 + : +- : "memory", "cc", "v0", "v1", "v2", "v3"); ++ : "v0", "v1", "v2", "v3", "memory", "cc"); + } + + void ScaleRowDown4Box_NEON(const uint8_t* src_ptr, +@@ -122,7 +122,7 @@ void ScaleRowDown4Box_NEON(const uint8_t + const uint8_t* src_ptr1 = src_ptr + src_stride; + const uint8_t* src_ptr2 = src_ptr + src_stride * 2; + const uint8_t* src_ptr3 = src_ptr + src_stride * 3; +- asm volatile ( ++ asm volatile( + "1: \n" + "ld1 {v0.16b}, [%0], #16 \n" // load up 16x4 + "ld1 {v1.16b}, [%2], #16 \n" +@@ -148,7 +148,7 @@ void ScaleRowDown4Box_NEON(const uint8_t + "+r"(src_ptr3), // %4 + "+r"(dst_width) // %5 + : +- : "memory", "cc", "v0", "v1", "v2", "v3"); ++ : "v0", "v1", "v2", "v3", "memory", "cc"); + } + + // Down scale from 4 to 3 pixels. Use the neon multilane read/write +@@ -159,11 +159,11 @@ void ScaleRowDown34_NEON(const uint8_t* + uint8_t* dst_ptr, + int dst_width) { + (void)src_stride; +- asm volatile ( ++ asm volatile( + "1: \n" + "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // src line 0 + "subs %w2, %w2, #24 \n" +- "mov v2.16b, v3.16b \n" // order v0,v1,v2 ++ "orr v2.16b, v3.16b, v3.16b \n" // order v0,v1,v2 + "prfm pldl1keep, [%0, 448] \n" // prefetch 7 lines ahead + "st3 {v0.8b,v1.8b,v2.8b}, [%1], #24 \n" + "b.gt 1b \n" +@@ -171,14 +171,14 @@ void ScaleRowDown34_NEON(const uint8_t* + "+r"(dst_ptr), // %1 + "+r"(dst_width) // %2 + : +- : "memory", "cc", "v0", "v1", "v2", "v3"); ++ : "v0", "v1", "v2", "v3", "memory", "cc"); + } + + void ScaleRowDown34_0_Box_NEON(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm volatile ( ++ asm volatile( + "movi v20.8b, #3 \n" + "add %3, %3, %0 \n" + "1: \n" +@@ -229,15 +229,15 @@ void ScaleRowDown34_0_Box_NEON(const uin + "+r"(dst_width), // %2 + "+r"(src_stride) // %3 + : +- : "memory", "cc", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", +- "v17", "v18", "v19", "v20"); ++ : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", "v17", "v18", ++ "v19", "v20", "memory", "cc"); + } + + void ScaleRowDown34_1_Box_NEON(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm volatile ( ++ asm volatile( + "movi v20.8b, #3 \n" + "add %3, %3, %0 \n" + "1: \n" +@@ -272,7 +272,7 @@ void ScaleRowDown34_1_Box_NEON(const uin + "+r"(dst_width), // %2 + "+r"(src_stride) // %3 + : +- : "memory", "cc", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v20"); ++ : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v20", "memory", "cc"); + } + + static const uvec8 kShuf38 = {0, 3, 6, 8, 11, 14, 16, 19, +@@ -292,7 +292,7 @@ void ScaleRowDown38_NEON(const uint8_t* + uint8_t* dst_ptr, + int dst_width) { + (void)src_stride; +- asm volatile ( ++ asm volatile( + "ld1 {v3.16b}, [%3] \n" + "1: \n" + "ld1 {v0.16b,v1.16b}, [%0], #32 \n" +@@ -306,7 +306,7 @@ void ScaleRowDown38_NEON(const uint8_t* + "+r"(dst_ptr), // %1 + "+r"(dst_width) // %2 + : "r"(&kShuf38) // %3 +- : "memory", "cc", "v0", "v1", "v2", "v3"); ++ : "v0", "v1", "v2", "v3", "memory", "cc"); + } + + // 32x3 -> 12x1 +@@ -317,7 +317,7 @@ void OMITFP ScaleRowDown38_3_Box_NEON(co + const uint8_t* src_ptr1 = src_ptr + src_stride * 2; + ptrdiff_t tmp_src_stride = src_stride; + +- asm volatile ( ++ asm volatile( + "ld1 {v29.8h}, [%5] \n" + "ld1 {v30.16b}, [%6] \n" + "ld1 {v31.8h}, [%7] \n" +@@ -427,9 +427,9 @@ void OMITFP ScaleRowDown38_3_Box_NEON(co + : "r"(&kMult38_Div6), // %5 + "r"(&kShuf38_2), // %6 + "r"(&kMult38_Div9) // %7 +- : "memory", "cc", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", +- "v17", "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", "v29", +- "v30", "v31"); ++ : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", "v17", "v18", ++ "v19", "v20", "v21", "v22", "v23", "v24", "v25", "v29", "v30", "v31", ++ "memory", "cc"); + } + + // 32x2 -> 12x1 +@@ -439,7 +439,7 @@ void ScaleRowDown38_2_Box_NEON(const uin + int dst_width) { + // TODO(fbarchard): use src_stride directly for clang 3.5+. + ptrdiff_t tmp_src_stride = src_stride; +- asm volatile ( ++ asm volatile( + "ld1 {v30.8h}, [%4] \n" + "ld1 {v31.16b}, [%5] \n" + "add %2, %2, %0 \n" +@@ -531,15 +531,15 @@ void ScaleRowDown38_2_Box_NEON(const uin + "+r"(dst_width) // %3 + : "r"(&kMult38_Div6), // %4 + "r"(&kShuf38_2) // %5 +- : "memory", "cc", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", +- "v17", "v18", "v19", "v30", "v31"); ++ : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", "v17", "v18", ++ "v19", "v30", "v31", "memory", "cc"); + } + + void ScaleRowUp2_Linear_NEON(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int dst_width) { + const uint8_t* src_temp = src_ptr + 1; +- asm volatile ( ++ asm volatile( + "movi v31.8b, #3 \n" + + "1: \n" +@@ -578,7 +578,7 @@ void ScaleRowUp2_Bilinear_NEON(const uin + const uint8_t* src_temp = src_ptr + 1; + const uint8_t* src_temp1 = src_ptr1 + 1; + +- asm volatile ( ++ asm volatile( + "movi v31.8b, #3 \n" + "movi v30.8h, #3 \n" + +@@ -634,7 +634,7 @@ void ScaleRowUp2_Linear_12_NEON(const ui + uint16_t* dst_ptr, + int dst_width) { + const uint16_t* src_temp = src_ptr + 1; +- asm volatile ( ++ asm volatile( + "movi v31.8h, #3 \n" + + "1: \n" +@@ -671,7 +671,7 @@ void ScaleRowUp2_Bilinear_12_NEON(const + const uint16_t* src_temp = src_ptr + 1; + const uint16_t* src_temp1 = src_ptr1 + 1; + +- asm volatile ( ++ asm volatile( + "movi v31.8h, #3 \n" + + "1: \n" +@@ -725,7 +725,7 @@ void ScaleRowUp2_Linear_16_NEON(const ui + uint16_t* dst_ptr, + int dst_width) { + const uint16_t* src_temp = src_ptr + 1; +- asm volatile ( ++ asm volatile( + "movi v31.8h, #3 \n" + + "1: \n" +@@ -770,7 +770,7 @@ void ScaleRowUp2_Bilinear_16_NEON(const + const uint16_t* src_temp = src_ptr + 1; + const uint16_t* src_temp1 = src_ptr1 + 1; + +- asm volatile ( ++ asm volatile( + "movi v31.4h, #3 \n" + "movi v30.4s, #3 \n" + +@@ -825,7 +825,7 @@ void ScaleUVRowUp2_Linear_NEON(const uin + uint8_t* dst_ptr, + int dst_width) { + const uint8_t* src_temp = src_ptr + 2; +- asm volatile ( ++ asm volatile( + "movi v31.8b, #3 \n" + + "1: \n" +@@ -864,7 +864,7 @@ void ScaleUVRowUp2_Bilinear_NEON(const u + const uint8_t* src_temp = src_ptr + 2; + const uint8_t* src_temp1 = src_ptr1 + 2; + +- asm volatile ( ++ asm volatile( + "movi v31.8b, #3 \n" + "movi v30.8h, #3 \n" + +@@ -920,7 +920,7 @@ void ScaleUVRowUp2_Linear_16_NEON(const + uint16_t* dst_ptr, + int dst_width) { + const uint16_t* src_temp = src_ptr + 2; +- asm volatile ( ++ asm volatile( + "movi v31.8h, #3 \n" + + "1: \n" +@@ -967,7 +967,7 @@ void ScaleUVRowUp2_Bilinear_16_NEON(cons + const uint16_t* src_temp = src_ptr + 2; + const uint16_t* src_temp1 = src_ptr1 + 2; + +- asm volatile ( ++ asm volatile( + "movi v31.4h, #3 \n" + "movi v30.4s, #3 \n" + +@@ -1022,7 +1022,7 @@ void ScaleUVRowUp2_Bilinear_16_NEON(cons + void ScaleAddRow_NEON(const uint8_t* src_ptr, + uint16_t* dst_ptr, + int src_width) { +- asm volatile ( ++ asm volatile( + "1: \n" + "ld1 {v1.8h, v2.8h}, [%1] \n" // load accumulator + "ld1 {v0.16b}, [%0], #16 \n" // load 16 bytes +@@ -1118,12 +1118,107 @@ void ScaleFilterCols_NEON(uint8_t* dst_p + + #undef LOAD2_DATA8_LANE + ++// 16x2 -> 16x1 ++void ScaleFilterRows_NEON(uint8_t* dst_ptr, ++ const uint8_t* src_ptr, ++ ptrdiff_t src_stride, ++ int dst_width, ++ int source_y_fraction) { ++ int y_fraction = 256 - source_y_fraction; ++ asm volatile( ++ "cmp %w4, #0 \n" ++ "b.eq 100f \n" ++ "add %2, %2, %1 \n" ++ "cmp %w4, #64 \n" ++ "b.eq 75f \n" ++ "cmp %w4, #128 \n" ++ "b.eq 50f \n" ++ "cmp %w4, #192 \n" ++ "b.eq 25f \n" ++ ++ "dup v5.8b, %w4 \n" ++ "dup v4.8b, %w5 \n" ++ // General purpose row blend. ++ "1: \n" ++ "ld1 {v0.16b}, [%1], #16 \n" ++ "ld1 {v1.16b}, [%2], #16 \n" ++ "subs %w3, %w3, #16 \n" ++ "umull v6.8h, v0.8b, v4.8b \n" ++ "umull2 v7.8h, v0.16b, v4.16b \n" ++ "prfm pldl1keep, [%1, 448] \n" // prefetch 7 lines ahead ++ "umlal v6.8h, v1.8b, v5.8b \n" ++ "umlal2 v7.8h, v1.16b, v5.16b \n" ++ "prfm pldl1keep, [%2, 448] \n" ++ "rshrn v0.8b, v6.8h, #8 \n" ++ "rshrn2 v0.16b, v7.8h, #8 \n" ++ "st1 {v0.16b}, [%0], #16 \n" ++ "b.gt 1b \n" ++ "b 99f \n" ++ ++ // Blend 25 / 75. ++ "25: \n" ++ "ld1 {v0.16b}, [%1], #16 \n" ++ "ld1 {v1.16b}, [%2], #16 \n" ++ "subs %w3, %w3, #16 \n" ++ "urhadd v0.16b, v0.16b, v1.16b \n" ++ "prfm pldl1keep, [%1, 448] \n" // prefetch 7 lines ahead ++ "urhadd v0.16b, v0.16b, v1.16b \n" ++ "prfm pldl1keep, [%2, 448] \n" ++ "st1 {v0.16b}, [%0], #16 \n" ++ "b.gt 25b \n" ++ "b 99f \n" ++ ++ // Blend 50 / 50. ++ "50: \n" ++ "ld1 {v0.16b}, [%1], #16 \n" ++ "ld1 {v1.16b}, [%2], #16 \n" ++ "subs %w3, %w3, #16 \n" ++ "prfm pldl1keep, [%1, 448] \n" // prefetch 7 lines ahead ++ "urhadd v0.16b, v0.16b, v1.16b \n" ++ "prfm pldl1keep, [%2, 448] \n" ++ "st1 {v0.16b}, [%0], #16 \n" ++ "b.gt 50b \n" ++ "b 99f \n" ++ ++ // Blend 75 / 25. ++ "75: \n" ++ "ld1 {v1.16b}, [%1], #16 \n" ++ "ld1 {v0.16b}, [%2], #16 \n" ++ "subs %w3, %w3, #16 \n" ++ "urhadd v0.16b, v0.16b, v1.16b \n" ++ "prfm pldl1keep, [%1, 448] \n" // prefetch 7 lines ahead ++ "urhadd v0.16b, v0.16b, v1.16b \n" ++ "prfm pldl1keep, [%2, 448] \n" ++ "st1 {v0.16b}, [%0], #16 \n" ++ "b.gt 75b \n" ++ "b 99f \n" ++ ++ // Blend 100 / 0 - Copy row unchanged. ++ "100: \n" ++ "ld1 {v0.16b}, [%1], #16 \n" ++ "subs %w3, %w3, #16 \n" ++ "prfm pldl1keep, [%1, 448] \n" // prefetch 7 lines ahead ++ "st1 {v0.16b}, [%0], #16 \n" ++ "b.gt 100b \n" ++ ++ "99: \n" ++ "st1 {v0.b}[15], [%0] \n" ++ : "+r"(dst_ptr), // %0 ++ "+r"(src_ptr), // %1 ++ "+r"(src_stride), // %2 ++ "+r"(dst_width), // %3 ++ "+r"(source_y_fraction), // %4 ++ "+r"(y_fraction) // %5 ++ : ++ : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "memory", "cc"); ++} ++ + void ScaleARGBRowDown2_NEON(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst, + int dst_width) { + (void)src_stride; +- asm volatile ( ++ asm volatile( + "1: \n" + // load 16 ARGB pixels with even pixels into q0/q2, odd into q1/q3 + "ld4 {v0.4s,v1.4s,v2.4s,v3.4s}, [%0], #64 \n" +@@ -1145,7 +1240,7 @@ void ScaleARGBRowDown2Linear_NEON(const + uint8_t* dst_argb, + int dst_width) { + (void)src_stride; +- asm volatile ( ++ asm volatile( + "1: \n" + // load 16 ARGB pixels with even pixels into q0/q2, odd into q1/q3 + "ld4 {v0.4s,v1.4s,v2.4s,v3.4s}, [%0], #64 \n" +@@ -1168,59 +1263,60 @@ void ScaleARGBRowDown2Box_NEON(const uin + ptrdiff_t src_stride, + uint8_t* dst, + int dst_width) { +- const uint8_t* src_ptr1 = src_ptr + src_stride; +- asm volatile ( +- "1: \n" +- "ld2 {v0.4s, v1.4s}, [%[src]], #32 \n" +- "ld2 {v20.4s, v21.4s}, [%[src1]], #32 \n" +- "uaddl v2.8h, v0.8b, v1.8b \n" +- "uaddl2 v3.8h, v0.16b, v1.16b \n" +- "uaddl v22.8h, v20.8b, v21.8b \n" +- "uaddl2 v23.8h, v20.16b, v21.16b \n" +- "add v0.8h, v2.8h, v22.8h \n" +- "add v1.8h, v3.8h, v23.8h \n" +- "rshrn v0.8b, v0.8h, #2 \n" +- "rshrn v1.8b, v1.8h, #2 \n" +- "subs %w[width], %w[width], #4 \n" +- "stp d0, d1, [%[dst]], #16 \n" +- "b.gt 1b \n" +- : [src] "+r"(src_ptr), [src1] "+r"(src_ptr1), [dst] "+r"(dst), +- [width] "+r"(dst_width) ++ asm volatile( ++ // change the stride to row 2 pointer ++ "add %1, %1, %0 \n" ++ "1: \n" ++ "ld4 {v0.16b,v1.16b,v2.16b,v3.16b}, [%0], #64 \n" // load 16 ARGB ++ "subs %w3, %w3, #8 \n" // 8 processed per loop. ++ "uaddlp v0.8h, v0.16b \n" // B 16 bytes -> 8 shorts. ++ "uaddlp v1.8h, v1.16b \n" // G 16 bytes -> 8 shorts. ++ "uaddlp v2.8h, v2.16b \n" // R 16 bytes -> 8 shorts. ++ "uaddlp v3.8h, v3.16b \n" // A 16 bytes -> 8 shorts. ++ "ld4 {v16.16b,v17.16b,v18.16b,v19.16b}, [%1], #64 \n" // load 8 ++ "uadalp v0.8h, v16.16b \n" // B 16 bytes -> 8 shorts. ++ "uadalp v1.8h, v17.16b \n" // G 16 bytes -> 8 shorts. ++ "prfm pldl1keep, [%0, 448] \n" // prefetch 7 lines ahead ++ "uadalp v2.8h, v18.16b \n" // R 16 bytes -> 8 shorts. ++ "uadalp v3.8h, v19.16b \n" // A 16 bytes -> 8 shorts. ++ "prfm pldl1keep, [%1, 448] \n" ++ "rshrn v0.8b, v0.8h, #2 \n" // round and pack ++ "rshrn v1.8b, v1.8h, #2 \n" ++ "rshrn v2.8b, v2.8h, #2 \n" ++ "rshrn v3.8b, v3.8h, #2 \n" ++ "st4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%2], #32 \n" ++ "b.gt 1b \n" ++ : "+r"(src_ptr), // %0 ++ "+r"(src_stride), // %1 ++ "+r"(dst), // %2 ++ "+r"(dst_width) // %3 + : +- : "memory", "cc", "v0", "v1", "v2", "v3", "v20", "v21", "v22", "v23"); ++ : "memory", "cc", "v0", "v1", "v2", "v3", "v16", "v17", "v18", "v19"); + } + ++// Reads 4 pixels at a time. ++// Alignment requirement: src_argb 4 byte aligned. + void ScaleARGBRowDownEven_NEON(const uint8_t* src_argb, + ptrdiff_t src_stride, + int src_stepx, + uint8_t* dst_argb, + int dst_width) { +- const uint8_t* src_argb1 = src_argb + src_stepx * 4; +- const uint8_t* src_argb2 = src_argb + src_stepx * 8; +- const uint8_t* src_argb3 = src_argb + src_stepx * 12; +- int64_t i = 0; + (void)src_stride; +- asm volatile ( +- "1: \n" +- "ldr w10, [%[src], %[i]] \n" +- "ldr w11, [%[src1], %[i]] \n" +- "ldr w12, [%[src2], %[i]] \n" +- "ldr w13, [%[src3], %[i]] \n" +- "add %[i], %[i], %[step] \n" +- "subs %w[width], %w[width], #4 \n" +- "prfm pldl1keep, [%[src], 448] \n" +- "stp w10, w11, [%[dst]], #8 \n" +- "stp w12, w13, [%[dst]], #8 \n" +- "b.gt 1b \n" +- : [src]"+r"(src_argb), +- [src1]"+r"(src_argb1), +- [src2]"+r"(src_argb2), +- [src3]"+r"(src_argb3), +- [dst]"+r"(dst_argb), +- [width]"+r"(dst_width), +- [i]"+r"(i) +- : [step]"r"((int64_t)(src_stepx * 16)) +- : "memory", "cc", "w10", "w11", "w12", "w13"); ++ asm volatile( ++ "1: \n" ++ "ld1 {v0.s}[0], [%0], %3 \n" ++ "ld1 {v0.s}[1], [%0], %3 \n" ++ "ld1 {v0.s}[2], [%0], %3 \n" ++ "ld1 {v0.s}[3], [%0], %3 \n" ++ "subs %w2, %w2, #4 \n" // 4 pixels per loop. ++ "prfm pldl1keep, [%0, 448] \n" // prefetch 7 lines ahead ++ "st1 {v0.16b}, [%1], #16 \n" ++ "b.gt 1b \n" ++ : "+r"(src_argb), // %0 ++ "+r"(dst_argb), // %1 ++ "+r"(dst_width) // %2 ++ : "r"((int64_t)(src_stepx * 4)) // %3 ++ : "memory", "cc", "v0"); + } + + // Reads 4 pixels at a time. +@@ -1232,7 +1328,7 @@ void ScaleARGBRowDownEvenBox_NEON(const + int src_stepx, + uint8_t* dst_argb, + int dst_width) { +- asm volatile ( ++ asm volatile( + "add %1, %1, %0 \n" + "1: \n" + "ld1 {v0.8b}, [%0], %4 \n" // Read 4 2x2 -> 2x1 +@@ -1287,7 +1383,7 @@ void ScaleARGBCols_NEON(uint8_t* dst_arg + int64_t x64 = (int64_t)x; // NOLINT + int64_t dx64 = (int64_t)dx; // NOLINT + int64_t tmp64; +- asm volatile ( ++ asm volatile( + "1: \n" + // clang-format off + LOAD1_DATA32_LANE(v0, 0) +@@ -1394,7 +1490,7 @@ void ScaleRowDown2Box_16_NEON(const uint + ptrdiff_t src_stride, + uint16_t* dst, + int dst_width) { +- asm volatile ( ++ asm volatile( + // change the stride to row 2 pointer + "add %1, %0, %1, lsl #1 \n" // ptr + stide * 2 + "1: \n" +@@ -1416,7 +1512,7 @@ void ScaleRowDown2Box_16_NEON(const uint + "+r"(dst), // %2 + "+r"(dst_width) // %3 + : +- : "memory", "cc", "v0", "v1", "v2", "v3" // Clobber List ++ : "v0", "v1", "v2", "v3" // Clobber List + ); + } + +@@ -1426,7 +1522,7 @@ void ScaleRowUp2_16_NEON(const uint16_t* + ptrdiff_t src_stride, + uint16_t* dst, + int dst_width) { +- asm volatile ( ++ asm volatile( + "add %1, %0, %1, lsl #1 \n" // ptr + stide * 2 + "movi v0.8h, #9 \n" // constants + "movi v1.4s, #3 \n" +@@ -1467,55 +1563,16 @@ void ScaleRowUp2_16_NEON(const uint16_t* + "+r"(dst_width) // %3 + : "r"(2LL), // %4 + "r"(14LL) // %5 +- : "memory", "cc", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", +- "v17", "v18", "v19" // Clobber List ++ : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", "v17", "v18", ++ "v19" // Clobber List + ); + } + +-void ScaleUVRowDown2_NEON(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- uint8_t* dst, +- int dst_width) { +- (void)src_stride; +- asm volatile ( +- "1: \n" +- "ld2 {v0.8h,v1.8h}, [%0], #32 \n" // load 16 UV +- "subs %w2, %w2, #8 \n" // 8 processed per loop. +- "prfm pldl1keep, [%0, 448] \n" // prefetch 7 lines ahead +- "st1 {v1.8h}, [%1], #16 \n" // store 8 UV +- "b.gt 1b \n" +- : "+r"(src_ptr), // %0 +- "+r"(dst), // %1 +- "+r"(dst_width) // %2 +- : +- : "memory", "cc", "v0", "v1"); +-} +- +-void ScaleUVRowDown2Linear_NEON(const uint8_t* src_ptr, +- ptrdiff_t src_stride, +- uint8_t* dst, +- int dst_width) { +- (void)src_stride; +- asm volatile ( +- "1: \n" +- "ld2 {v0.8h,v1.8h}, [%0], #32 \n" // load 16 UV +- "subs %w2, %w2, #8 \n" // 8 processed per loop. +- "urhadd v0.16b, v0.16b, v1.16b \n" // rounding half add +- "prfm pldl1keep, [%0, 448] \n" // prefetch 7 lines ahead +- "st1 {v0.8h}, [%1], #16 \n" // store 8 UV +- "b.gt 1b \n" +- : "+r"(src_ptr), // %0 +- "+r"(dst), // %1 +- "+r"(dst_width) // %2 +- : +- : "memory", "cc", "v0", "v1"); +-} +- + void ScaleUVRowDown2Box_NEON(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst, + int dst_width) { +- asm volatile ( ++ asm volatile( + // change the stride to row 2 pointer + "add %1, %1, %0 \n" + "1: \n" +@@ -1550,7 +1607,7 @@ void ScaleUVRowDownEven_NEON(const uint8 + const uint8_t* src2_ptr = src_ptr + src_stepx * 4; + const uint8_t* src3_ptr = src_ptr + src_stepx * 6; + (void)src_stride; +- asm volatile ( ++ asm volatile( + "1: \n" + "ld1 {v0.h}[0], [%0], %6 \n" + "ld1 {v1.h}[0], [%1], %6 \n" +diff --git a/media/libyuv/libyuv/source/scale_uv.cc b/media/libyuv/libyuv/source/scale_uv.cc +--- a/media/libyuv/libyuv/source/scale_uv.cc ++++ b/media/libyuv/libyuv/source/scale_uv.cc +@@ -112,31 +112,6 @@ static void ScaleUVDown2(int src_width, + } + } + #endif +-#if defined(HAS_SCALEUVROWDOWN2_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- ScaleUVRowDown2 = +- filtering == kFilterNone +- ? ScaleUVRowDown2_Any_NEON +- : (filtering == kFilterLinear ? ScaleUVRowDown2Linear_Any_NEON +- : ScaleUVRowDown2Box_Any_NEON); +- if (IS_ALIGNED(dst_width, 8)) { +- ScaleUVRowDown2 = +- filtering == kFilterNone +- ? ScaleUVRowDown2_NEON +- : (filtering == kFilterLinear ? ScaleUVRowDown2Linear_NEON +- : ScaleUVRowDown2Box_NEON); +- } +- } +-#endif +-#if defined(HAS_SCALEUVROWDOWN2_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ScaleUVRowDown2 = +- filtering == kFilterNone +- ? ScaleUVRowDown2_RVV +- : (filtering == kFilterLinear ? ScaleUVRowDown2Linear_RVV +- : ScaleUVRowDown2Box_RVV); +- } +-#endif + + // This code is not enabled. Only box filter is available at this time. + #if defined(HAS_SCALEUVROWDOWN2_SSSE3) +@@ -155,7 +130,23 @@ static void ScaleUVDown2(int src_width, + } + } + #endif +- ++// This code is not enabled. Only box filter is available at this time. ++#if defined(HAS_SCALEUVROWDOWN2_NEON) ++ if (TestCpuFlag(kCpuHasNEON)) { ++ ScaleUVRowDown2 = ++ filtering == kFilterNone ++ ? ScaleUVRowDown2_Any_NEON ++ : (filtering == kFilterLinear ? ScaleUVRowDown2Linear_Any_NEON ++ : ScaleUVRowDown2Box_Any_NEON); ++ if (IS_ALIGNED(dst_width, 8)) { ++ ScaleUVRowDown2 = ++ filtering == kFilterNone ++ ? ScaleUVRowDown2_NEON ++ : (filtering == kFilterLinear ? ScaleUVRowDown2Linear_NEON ++ : ScaleUVRowDown2Box_NEON); ++ } ++ } ++#endif + #if defined(HAS_SCALEUVROWDOWN2_MSA) + if (TestCpuFlag(kCpuHasMSA)) { + ScaleUVRowDown2 = +@@ -188,24 +179,22 @@ static void ScaleUVDown2(int src_width, + // This is an optimized version for scaling down a UV to 1/4 of + // its original size. + #if HAS_SCALEUVDOWN4BOX +-static int ScaleUVDown4Box(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint8_t* src_uv, +- uint8_t* dst_uv, +- int x, +- int dx, +- int y, +- int dy) { ++static void ScaleUVDown4Box(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint8_t* src_uv, ++ uint8_t* dst_uv, ++ int x, ++ int dx, ++ int y, ++ int dy) { + int j; + // Allocate 2 rows of UV. + const int row_size = (dst_width * 2 * 2 + 15) & ~15; + align_buffer_64(row, row_size * 2); +- if (!row) +- return 1; + int row_stride = src_stride * (dy >> 16); + void (*ScaleUVRowDown2)(const uint8_t* src_uv, ptrdiff_t src_stride, + uint8_t* dst_uv, int dst_width) = +@@ -242,11 +231,6 @@ static int ScaleUVDown4Box(int src_width + } + } + #endif +-#if defined(HAS_SCALEUVROWDOWN2BOX_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- ScaleUVRowDown2 = ScaleUVRowDown2Box_RVV; +- } +-#endif + + for (j = 0; j < dst_height; ++j) { + ScaleUVRowDown2(src_uv, src_stride, row, dst_width * 2); +@@ -257,7 +241,6 @@ static int ScaleUVDown4Box(int src_width + dst_uv += dst_stride; + } + free_aligned_buffer_64(row); +- return 0; + } + #endif // HAS_SCALEUVDOWN4BOX + +@@ -327,18 +310,6 @@ static void ScaleUVDownEven(int src_widt + } + } + #endif +-#if defined(HAS_SCALEUVROWDOWNEVEN_RVV) || defined(HAS_SCALEUVROWDOWN4_RVV) +- if (TestCpuFlag(kCpuHasRVV) && !filtering) { +- #if defined(HAS_SCALEUVROWDOWNEVEN_RVV) +- ScaleUVRowDownEven = ScaleUVRowDownEven_RVV; +- #endif +- #if defined(HAS_SCALEUVROWDOWN4_RVV) +- if (col_step == 4) { +- ScaleUVRowDownEven = ScaleUVRowDown4_RVV; +- } +- #endif +- } +-#endif + + if (filtering == kFilterLinear) { + src_stride = 0; +@@ -353,19 +324,19 @@ static void ScaleUVDownEven(int src_widt + + // Scale UV down with bilinear interpolation. + #if HAS_SCALEUVBILINEARDOWN +-static int ScaleUVBilinearDown(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint8_t* src_uv, +- uint8_t* dst_uv, +- int x, +- int dx, +- int y, +- int dy, +- enum FilterMode filtering) { ++static void ScaleUVBilinearDown(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint8_t* src_uv, ++ uint8_t* dst_uv, ++ int x, ++ int dx, ++ int y, ++ int dy, ++ enum FilterMode filtering) { + int j; + void (*InterpolateRow)(uint8_t* dst_uv, const uint8_t* src_uv, + ptrdiff_t src_stride, int dst_width, +@@ -426,11 +397,6 @@ static int ScaleUVBilinearDown(int src_w + } + } + #endif +-#if defined(HAS_INTERPOLATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- InterpolateRow = InterpolateRow_RVV; +- } +-#endif + #if defined(HAS_SCALEUVFILTERCOLS_SSSE3) + if (TestCpuFlag(kCpuHasSSSE3) && src_width < 32768) { + ScaleUVFilterCols = ScaleUVFilterCols_SSSE3; +@@ -455,10 +421,9 @@ static int ScaleUVBilinearDown(int src_w + // TODO(fbarchard): Consider not allocating row buffer for kFilterLinear. + // Allocate a row of UV. + { ++ align_buffer_64(row, clip_src_width * 2); ++ + const int max_y = (src_height - 1) << 16; +- align_buffer_64(row, clip_src_width * 2); +- if (!row) +- return 1; + if (y > max_y) { + y = max_y; + } +@@ -480,25 +445,24 @@ static int ScaleUVBilinearDown(int src_w + } + free_aligned_buffer_64(row); + } +- return 0; + } + #endif + + // Scale UV up with bilinear interpolation. + #if HAS_SCALEUVBILINEARUP +-static int ScaleUVBilinearUp(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint8_t* src_uv, +- uint8_t* dst_uv, +- int x, +- int dx, +- int y, +- int dy, +- enum FilterMode filtering) { ++static void ScaleUVBilinearUp(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint8_t* src_uv, ++ uint8_t* dst_uv, ++ int x, ++ int dx, ++ int y, ++ int dy, ++ enum FilterMode filtering) { + int j; + void (*InterpolateRow)(uint8_t* dst_uv, const uint8_t* src_uv, + ptrdiff_t src_stride, int dst_width, +@@ -547,11 +511,6 @@ static int ScaleUVBilinearUp(int src_wid + } + } + #endif +-#if defined(HAS_INTERPOLATEROW_RVV) +- if (TestCpuFlag(kCpuHasRVV)) { +- InterpolateRow = InterpolateRow_RVV; +- } +-#endif + if (src_width >= 32768) { + ScaleUVFilterCols = filtering ? ScaleUVFilterCols64_C : ScaleUVCols64_C; + } +@@ -617,8 +576,6 @@ static int ScaleUVBilinearUp(int src_wid + // Allocate 2 rows of UV. + const int row_size = (dst_width * 2 + 15) & ~15; + align_buffer_64(row, row_size * 2); +- if (!row) +- return 1; + + uint8_t* rowptr = row; + int rowstride = row_size; +@@ -662,7 +619,6 @@ static int ScaleUVBilinearUp(int src_wid + } + free_aligned_buffer_64(row); + } +- return 0; + } + #endif // HAS_SCALEUVBILINEARUP + +@@ -671,14 +627,14 @@ static int ScaleUVBilinearUp(int src_wid + // This is an optimized version for scaling up a plane to 2 times of + // its original width, using linear interpolation. + // This is used to scale U and V planes of NV16 to NV24. +-static void ScaleUVLinearUp2(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint8_t* src_uv, +- uint8_t* dst_uv) { ++void ScaleUVLinearUp2(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint8_t* src_uv, ++ uint8_t* dst_uv) { + void (*ScaleRowUp)(const uint8_t* src_uv, uint8_t* dst_uv, int dst_width) = + ScaleUVRowUp2_Linear_Any_C; + int i; +@@ -688,30 +644,24 @@ static void ScaleUVLinearUp2(int src_wid + // This function can only scale up by 2 times horizontally. + assert(src_width == ((dst_width + 1) / 2)); + +-#ifdef HAS_SCALEUVROWUP2_LINEAR_SSSE3 ++#ifdef HAS_SCALEUVROWUP2LINEAR_SSSE3 + if (TestCpuFlag(kCpuHasSSSE3)) { + ScaleRowUp = ScaleUVRowUp2_Linear_Any_SSSE3; + } + #endif + +-#ifdef HAS_SCALEUVROWUP2_LINEAR_AVX2 ++#ifdef HAS_SCALEUVROWUP2LINEAR_AVX2 + if (TestCpuFlag(kCpuHasAVX2)) { + ScaleRowUp = ScaleUVRowUp2_Linear_Any_AVX2; + } + #endif + +-#ifdef HAS_SCALEUVROWUP2_LINEAR_NEON ++#ifdef HAS_SCALEUVROWUP2LINEAR_NEON + if (TestCpuFlag(kCpuHasNEON)) { + ScaleRowUp = ScaleUVRowUp2_Linear_Any_NEON; + } + #endif + +-#ifdef HAS_SCALEUVROWUP2_LINEAR_RVV +- if (TestCpuFlag(kCpuHasRVV)) { +- ScaleRowUp = ScaleUVRowUp2_Linear_RVV; +- } +-#endif +- + if (dst_height == 1) { + ScaleRowUp(src_uv + ((src_height - 1) / 2) * (intptr_t)src_stride, dst_uv, + dst_width); +@@ -730,14 +680,14 @@ static void ScaleUVLinearUp2(int src_wid + // This is an optimized version for scaling up a plane to 2 times of + // its original size, using bilinear interpolation. + // This is used to scale U and V planes of NV12 to NV24. +-static void ScaleUVBilinearUp2(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint8_t* src_ptr, +- uint8_t* dst_ptr) { ++void ScaleUVBilinearUp2(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint8_t* src_ptr, ++ uint8_t* dst_ptr) { + void (*Scale2RowUp)(const uint8_t* src_ptr, ptrdiff_t src_stride, + uint8_t* dst_ptr, ptrdiff_t dst_stride, int dst_width) = + ScaleUVRowUp2_Bilinear_Any_C; +@@ -747,30 +697,24 @@ static void ScaleUVBilinearUp2(int src_w + assert(src_width == ((dst_width + 1) / 2)); + assert(src_height == ((dst_height + 1) / 2)); + +-#ifdef HAS_SCALEUVROWUP2_BILINEAR_SSSE3 ++#ifdef HAS_SCALEUVROWUP2BILINEAR_SSSE3 + if (TestCpuFlag(kCpuHasSSSE3)) { + Scale2RowUp = ScaleUVRowUp2_Bilinear_Any_SSSE3; + } + #endif + +-#ifdef HAS_SCALEUVROWUP2_BILINEAR_AVX2 ++#ifdef HAS_SCALEUVROWUP2BILINEAR_AVX2 + if (TestCpuFlag(kCpuHasAVX2)) { + Scale2RowUp = ScaleUVRowUp2_Bilinear_Any_AVX2; + } + #endif + +-#ifdef HAS_SCALEUVROWUP2_BILINEAR_NEON ++#ifdef HAS_SCALEUVROWUP2BILINEAR_NEON + if (TestCpuFlag(kCpuHasNEON)) { + Scale2RowUp = ScaleUVRowUp2_Bilinear_Any_NEON; + } + #endif + +-#ifdef HAS_SCALEUVROWUP2_BILINEAR_RVV +- if (TestCpuFlag(kCpuHasRVV)) { +- Scale2RowUp = ScaleUVRowUp2_Bilinear_RVV; +- } +-#endif +- + Scale2RowUp(src_ptr, 0, dst_ptr, 0, dst_width); + dst_ptr += dst_stride; + for (x = 0; x < src_height - 1; ++x) { +@@ -790,14 +734,14 @@ static void ScaleUVBilinearUp2(int src_w + // This is an optimized version for scaling up a plane to 2 times of + // its original width, using linear interpolation. + // This is used to scale U and V planes of P210 to P410. +-static void ScaleUVLinearUp2_16(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint16_t* src_uv, +- uint16_t* dst_uv) { ++void ScaleUVLinearUp2_16(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint16_t* src_uv, ++ uint16_t* dst_uv) { + void (*ScaleRowUp)(const uint16_t* src_uv, uint16_t* dst_uv, int dst_width) = + ScaleUVRowUp2_Linear_16_Any_C; + int i; +@@ -807,19 +751,19 @@ static void ScaleUVLinearUp2_16(int src_ + // This function can only scale up by 2 times horizontally. + assert(src_width == ((dst_width + 1) / 2)); + +-#ifdef HAS_SCALEUVROWUP2_LINEAR_16_SSE41 ++#ifdef HAS_SCALEUVROWUP2LINEAR_16_SSE41 + if (TestCpuFlag(kCpuHasSSE41)) { + ScaleRowUp = ScaleUVRowUp2_Linear_16_Any_SSE41; + } + #endif + +-#ifdef HAS_SCALEUVROWUP2_LINEAR_16_AVX2 ++#ifdef HAS_SCALEUVROWUP2LINEAR_16_AVX2 + if (TestCpuFlag(kCpuHasAVX2)) { + ScaleRowUp = ScaleUVRowUp2_Linear_16_Any_AVX2; + } + #endif + +-#ifdef HAS_SCALEUVROWUP2_LINEAR_16_NEON ++#ifdef HAS_SCALEUVROWUP2LINEAR_16_NEON + if (TestCpuFlag(kCpuHasNEON)) { + ScaleRowUp = ScaleUVRowUp2_Linear_16_Any_NEON; + } +@@ -843,14 +787,14 @@ static void ScaleUVLinearUp2_16(int src_ + // This is an optimized version for scaling up a plane to 2 times of + // its original size, using bilinear interpolation. + // This is used to scale U and V planes of P010 to P410. +-static void ScaleUVBilinearUp2_16(int src_width, +- int src_height, +- int dst_width, +- int dst_height, +- int src_stride, +- int dst_stride, +- const uint16_t* src_ptr, +- uint16_t* dst_ptr) { ++void ScaleUVBilinearUp2_16(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ int src_stride, ++ int dst_stride, ++ const uint16_t* src_ptr, ++ uint16_t* dst_ptr) { + void (*Scale2RowUp)(const uint16_t* src_ptr, ptrdiff_t src_stride, + uint16_t* dst_ptr, ptrdiff_t dst_stride, int dst_width) = + ScaleUVRowUp2_Bilinear_16_Any_C; +@@ -860,19 +804,19 @@ static void ScaleUVBilinearUp2_16(int sr + assert(src_width == ((dst_width + 1) / 2)); + assert(src_height == ((dst_height + 1) / 2)); + +-#ifdef HAS_SCALEUVROWUP2_BILINEAR_16_SSE41 ++#ifdef HAS_SCALEUVROWUP2BILINEAR_16_SSE41 + if (TestCpuFlag(kCpuHasSSE41)) { + Scale2RowUp = ScaleUVRowUp2_Bilinear_16_Any_SSE41; + } + #endif + +-#ifdef HAS_SCALEUVROWUP2_BILINEAR_16_AVX2 ++#ifdef HAS_SCALEUVROWUP2BILINEAR_16_AVX2 + if (TestCpuFlag(kCpuHasAVX2)) { + Scale2RowUp = ScaleUVRowUp2_Bilinear_16_Any_AVX2; + } + #endif + +-#ifdef HAS_SCALEUVROWUP2_BILINEAR_16_NEON ++#ifdef HAS_SCALEUVROWUP2BILINEAR_16_NEON + if (TestCpuFlag(kCpuHasNEON)) { + Scale2RowUp = ScaleUVRowUp2_Bilinear_16_Any_NEON; + } +@@ -998,19 +942,19 @@ static int UVCopy_16(const uint16_t* src + // Scale a UV plane (from NV12) + // This function in turn calls a scaling function + // suitable for handling the desired resolutions. +-static int ScaleUV(const uint8_t* src, +- int src_stride, +- int src_width, +- int src_height, +- uint8_t* dst, +- int dst_stride, +- int dst_width, +- int dst_height, +- int clip_x, +- int clip_y, +- int clip_width, +- int clip_height, +- enum FilterMode filtering) { ++static void ScaleUV(const uint8_t* src, ++ int src_stride, ++ int src_width, ++ int src_height, ++ uint8_t* dst, ++ int dst_stride, ++ int dst_width, ++ int dst_height, ++ int clip_x, ++ int clip_y, ++ int clip_width, ++ int clip_height, ++ enum FilterMode filtering) { + // Initial source x/y coordinate and step values as 16.16 fixed point. + int x = 0; + int y = 0; +@@ -1056,22 +1000,22 @@ static int ScaleUV(const uint8_t* src, + ScaleUVDown2(src_width, src_height, clip_width, clip_height, + src_stride, dst_stride, src, dst, x, dx, y, dy, + filtering); +- return 0; ++ return; + } + #endif + #if HAS_SCALEUVDOWN4BOX + if (dx == 0x40000 && filtering == kFilterBox) { + // Optimized 1/4 box downsample. +- return ScaleUVDown4Box(src_width, src_height, clip_width, clip_height, +- src_stride, dst_stride, src, dst, x, dx, y, +- dy); ++ ScaleUVDown4Box(src_width, src_height, clip_width, clip_height, ++ src_stride, dst_stride, src, dst, x, dx, y, dy); ++ return; + } + #endif + #if HAS_SCALEUVDOWNEVEN + ScaleUVDownEven(src_width, src_height, clip_width, clip_height, + src_stride, dst_stride, src, dst, x, dx, y, dy, + filtering); +- return 0; ++ return; + #endif + } + // Optimized odd scale down. ie 3, 5, 7, 9x. +@@ -1082,7 +1026,7 @@ static int ScaleUV(const uint8_t* src, + // Straight copy. + UVCopy(src + (y >> 16) * (intptr_t)src_stride + (x >> 16) * 2, + src_stride, dst, dst_stride, clip_width, clip_height); +- return 0; ++ return; + } + #endif + } +@@ -1093,37 +1037,38 @@ static int ScaleUV(const uint8_t* src, + // Arbitrary scale vertically, but unscaled horizontally. + ScalePlaneVertical(src_height, clip_width, clip_height, src_stride, + dst_stride, src, dst, x, y, dy, /*bpp=*/2, filtering); +- return 0; ++ return; + } +- if ((filtering == kFilterLinear) && ((dst_width + 1) / 2 == src_width)) { ++ if (filtering && (dst_width + 1) / 2 == src_width) { + ScaleUVLinearUp2(src_width, src_height, clip_width, clip_height, src_stride, + dst_stride, src, dst); +- return 0; ++ return; + } + if ((clip_height + 1) / 2 == src_height && + (clip_width + 1) / 2 == src_width && + (filtering == kFilterBilinear || filtering == kFilterBox)) { + ScaleUVBilinearUp2(src_width, src_height, clip_width, clip_height, + src_stride, dst_stride, src, dst); +- return 0; ++ return; + } + #if HAS_SCALEUVBILINEARUP + if (filtering && dy < 65536) { +- return ScaleUVBilinearUp(src_width, src_height, clip_width, clip_height, +- src_stride, dst_stride, src, dst, x, dx, y, dy, +- filtering); ++ ScaleUVBilinearUp(src_width, src_height, clip_width, clip_height, ++ src_stride, dst_stride, src, dst, x, dx, y, dy, ++ filtering); ++ return; + } + #endif + #if HAS_SCALEUVBILINEARDOWN + if (filtering) { +- return ScaleUVBilinearDown(src_width, src_height, clip_width, clip_height, +- src_stride, dst_stride, src, dst, x, dx, y, dy, +- filtering); ++ ScaleUVBilinearDown(src_width, src_height, clip_width, clip_height, ++ src_stride, dst_stride, src, dst, x, dx, y, dy, ++ filtering); ++ return; + } + #endif + ScaleUVSimple(src_width, src_height, clip_width, clip_height, src_stride, + dst_stride, src, dst, x, dx, y, dy); +- return 0; + } + + // Scale an UV image. +@@ -1141,9 +1086,9 @@ int UVScale(const uint8_t* src_uv, + src_height > 32768 || !dst_uv || dst_width <= 0 || dst_height <= 0) { + return -1; + } +- return ScaleUV(src_uv, src_stride_uv, src_width, src_height, dst_uv, +- dst_stride_uv, dst_width, dst_height, 0, 0, dst_width, +- dst_height, filtering); ++ ScaleUV(src_uv, src_stride_uv, src_width, src_height, dst_uv, dst_stride_uv, ++ dst_width, dst_height, 0, 0, dst_width, dst_height, filtering); ++ return 0; + } + + // Scale a 16 bit UV image. +@@ -1194,7 +1139,7 @@ int UVScale_16(const uint16_t* src_uv, + } + #endif + +- if ((filtering == kFilterLinear) && ((dst_width + 1) / 2 == src_width)) { ++ if (filtering && (dst_width + 1) / 2 == src_width) { + ScaleUVLinearUp2_16(src_width, src_height, dst_width, dst_height, + src_stride_uv, dst_stride_uv, src_uv, dst_uv); + return 0; +diff --git a/media/libyuv/libyuv/tools_libyuv/autoroller/roll_deps.py b/media/libyuv/libyuv/tools_libyuv/autoroller/roll_deps.py +--- a/media/libyuv/libyuv/tools_libyuv/autoroller/roll_deps.py ++++ b/media/libyuv/libyuv/tools_libyuv/autoroller/roll_deps.py +@@ -1,14 +1,18 @@ + #!/usr/bin/env vpython3 + +-# Copyright (c) 2017 The LibYUV project authors. All Rights Reserved. ++# Copyright 2017 The LibYuv Project Authors. All rights reserved. + # + # Use of this source code is governed by a BSD-style license + # that can be found in the LICENSE file in the root of the source + # tree. An additional intellectual property rights grant can be found +-# in the file PATENTS. All contributing project authors may ++# in the file PATENTS. All contributing project authors may + # be found in the AUTHORS file in the root of the source tree. +-"""Script to automatically roll dependencies in the LibYUV DEPS file.""" + ++# This is a modified copy of the script in ++# https://webrtc.googlesource.com/src/+/master/tools_webrtc/autoroller/roll_deps.py ++# customized for libyuv. ++ ++"""Script to automatically roll dependencies in the libyuv DEPS file.""" + + import argparse + import base64 +@@ -21,47 +25,9 @@ import sys + import urllib.request + + +-def FindSrcDirPath(): +- """Returns the abs path to the src/ dir of the project.""" +- src_dir = os.path.dirname(os.path.abspath(__file__)) +- while os.path.basename(src_dir) != 'src': +- src_dir = os.path.normpath(os.path.join(src_dir, os.pardir)) +- return src_dir +- +- + # Skip these dependencies (list without solution name prefix). + DONT_AUTOROLL_THESE = [ +- 'third_party/fuchsia-gn-sdk', +- 'src/third_party/gflags/src', +- 'src/third_party/mockito/src', +-] +- +-# These dependencies are missing in chromium/src/DEPS, either unused or already +-# in-tree. For instance, src/base is a part of the Chromium source git repo, +-# but we pull it through a subtree mirror, so therefore it isn't listed in +-# Chromium's deps but it is in ours. +-LIBYUV_ONLY_DEPS = [ +- 'src/base', +- 'src/build', +- 'src/buildtools', +- 'src/ios', +- 'src/testing', +- 'src/third_party', +- 'src/third_party/android_support_test_runner', +- 'src/third_party/bazel', +- 'src/third_party/bouncycastle', +- 'src/third_party/errorprone/lib', +- 'src/third_party/findbugs', +- 'src/third_party/gson', +- 'src/third_party/gtest-parallel', +- 'src/third_party/guava', +- 'src/third_party/intellij', +- 'src/third_party/jsr-305/src', +- 'src/third_party/ow2_asm', +- 'src/third_party/proguard', +- 'src/third_party/ub-uiautomator/lib', +- 'src/tools', +- 'src/tools/clang/dsymutil', ++ 'src/third_party/gflags/src', + ] + + LIBYUV_URL = 'https://chromium.googlesource.com/libyuv/libyuv' +@@ -71,22 +37,16 @@ CHROMIUM_LOG_TEMPLATE = CHROMIUM_SRC_URL + CHROMIUM_FILE_TEMPLATE = CHROMIUM_SRC_URL + '/+/%s/%s' + + COMMIT_POSITION_RE = re.compile('^Cr-Commit-Position: .*#([0-9]+).*$') +-CLANG_REVISION_RE = re.compile(r'^CLANG_REVISION = \'([-0-9a-z]+)\'$') ++CLANG_REVISION_RE = re.compile(r'^CLANG_REVISION = \'([0-9a-z-]+)\'$') + ROLL_BRANCH_NAME = 'roll_chromium_revision' + + SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) +-CHECKOUT_SRC_DIR = FindSrcDirPath() ++CHECKOUT_SRC_DIR = os.path.realpath(os.path.join(SCRIPT_DIR, os.pardir, ++ os.pardir)) + CHECKOUT_ROOT_DIR = os.path.realpath(os.path.join(CHECKOUT_SRC_DIR, os.pardir)) + +-# Copied from tools/android/roll/android_deps/.../BuildConfigGenerator.groovy. +-ANDROID_DEPS_START = r'=== ANDROID_DEPS Generated Code Start ===' +-ANDROID_DEPS_END = r'=== ANDROID_DEPS Generated Code End ===' +-# Location of automically gathered android deps. +-ANDROID_DEPS_PATH = 'src/third_party/android_deps/' +- + sys.path.append(os.path.join(CHECKOUT_SRC_DIR, 'build')) +-import find_depot_tools +- ++import find_depot_tools # pylint: disable=wrong-import-position + find_depot_tools.add_depot_tools_to_path() + + CLANG_UPDATE_SCRIPT_URL_PATH = 'tools/clang/scripts/update.py' +@@ -96,26 +56,11 @@ CLANG_UPDATE_SCRIPT_LOCAL_PATH = os.path + DepsEntry = collections.namedtuple('DepsEntry', 'path url revision') + ChangedDep = collections.namedtuple('ChangedDep', + 'path url current_rev new_rev') +-CipdDepsEntry = collections.namedtuple('CipdDepsEntry', 'path packages') +-VersionEntry = collections.namedtuple('VersionEntry', 'version') +-ChangedCipdPackage = collections.namedtuple( +- 'ChangedCipdPackage', 'path package current_version new_version') +-ChangedVersionEntry = collections.namedtuple( +- 'ChangedVersionEntry', 'path current_version new_version') +- +-ChromiumRevisionUpdate = collections.namedtuple('ChromiumRevisionUpdate', +- ('current_chromium_rev ' +- 'new_chromium_rev ')) +- + + class RollError(Exception): + pass + + +-def StrExpansion(): +- return lambda str_value: str_value +- +- + def VarLookup(local_scope): + return lambda var_name: local_scope['vars'][var_name] + +@@ -123,9 +68,9 @@ def VarLookup(local_scope): + def ParseDepsDict(deps_content): + local_scope = {} + global_scope = { +- 'Str': StrExpansion(), +- 'Var': VarLookup(local_scope), +- 'deps_os': {}, ++ 'Var': VarLookup(local_scope), ++ 'Str': lambda s: s, ++ 'deps_os': {}, + } + exec(deps_content, global_scope, local_scope) + return local_scope +@@ -137,6 +82,11 @@ def ParseLocalDepsFile(filename): + return ParseDepsDict(deps_content) + + ++def ParseRemoteCrDepsFile(revision): ++ deps_content = ReadRemoteCrFile('DEPS', revision) ++ return ParseDepsDict(deps_content) ++ ++ + def ParseCommitPosition(commit_message): + for line in reversed(commit_message.splitlines()): + m = COMMIT_POSITION_RE.match(line.strip()) +@@ -147,18 +97,15 @@ def ParseCommitPosition(commit_message): + sys.exit(-1) + + +-def _RunCommand(command, +- working_dir=None, +- ignore_exit_code=False, +- extra_env=None, +- input_data=None): ++def _RunCommand(command, working_dir=None, ignore_exit_code=False, ++ extra_env=None, input_data=None): + """Runs a command and returns the output from that command. + +- If the command fails (exit code != 0), the function will exit the process. ++ If the command fails (exit code != 0), the function will exit the process. + +- Returns: +- A tuple containing the stdout and stderr outputs as strings. +- """ ++ Returns: ++ A tuple containing the stdout and stderr outputs as strings. ++ """ + working_dir = working_dir or CHECKOUT_SRC_DIR + logging.debug('CMD: %s CWD: %s', ' '.join(command), working_dir) + env = os.environ.copy() +@@ -187,9 +134,9 @@ def _RunCommand(command, + def _GetBranches(): + """Returns a tuple of active,branches. + +- The 'active' is the name of the currently active branch and 'branches' is a +- list of all branches. +- """ ++ The 'active' is the name of the currently active branch and 'branches' is a ++ list of all branches. ++ """ + lines = _RunCommand(['git', 'branch'])[0].split('\n') + branches = [] + active = '' +@@ -213,16 +160,9 @@ def _ReadGitilesContent(url): + + + def ReadRemoteCrFile(path_below_src, revision): +- """Reads a remote Chromium file of a specific revision. +- +- Args: +- path_below_src: A path to the target file relative to src dir. +- revision: Revision to read. +- Returns: +- A string with file content. +- """ +- return _ReadGitilesContent(CHROMIUM_FILE_TEMPLATE % +- (revision, path_below_src)) ++ """Reads a remote Chromium file of a specific revision. Returns a string.""" ++ return _ReadGitilesContent(CHROMIUM_FILE_TEMPLATE % (revision, ++ path_below_src)) + + + def ReadRemoteCrCommit(revision): +@@ -231,13 +171,7 @@ def ReadRemoteCrCommit(revision): + + + def ReadUrlContent(url): +- """Connect to a remote host and read the contents. +- +- Args: +- url: URL to connect to. +- Returns: +- A list of lines. +- """ ++ """Connect to a remote host and read the contents. Returns a list of lines.""" + conn = urllib.request.urlopen(url) + try: + return conn.readlines() +@@ -251,172 +185,52 @@ def ReadUrlContent(url): + def GetMatchingDepsEntries(depsentry_dict, dir_path): + """Gets all deps entries matching the provided path. + +- This list may contain more than one DepsEntry object. +- Example: dir_path='src/testing' would give results containing both +- 'src/testing/gtest' and 'src/testing/gmock' deps entries for Chromium's +- DEPS. +- Example 2: dir_path='src/build' should return 'src/build' but not +- 'src/buildtools'. ++ This list may contain more than one DepsEntry object. ++ Example: dir_path='src/testing' would give results containing both ++ 'src/testing/gtest' and 'src/testing/gmock' deps entries for Chromium's DEPS. ++ Example 2: dir_path='src/build' should return 'src/build' but not ++ 'src/buildtools'. + +- Returns: +- A list of DepsEntry objects. +- """ ++ Returns: ++ A list of DepsEntry objects. ++ """ + result = [] + for path, depsentry in depsentry_dict.items(): + if path == dir_path: + result.append(depsentry) + else: + parts = path.split('/') +- if all(part == parts[i] for i, part in enumerate(dir_path.split('/'))): ++ if all(part == parts[i] ++ for i, part in enumerate(dir_path.split('/'))): + result.append(depsentry) + return result + +- + def BuildDepsentryDict(deps_dict): + """Builds a dict of paths to DepsEntry objects from a raw deps dict.""" + result = {} + + def AddDepsEntries(deps_subdict): +- for path, dep in deps_subdict.items(): +- if path in result: +- continue +- if not isinstance(dep, dict): +- dep = {'url': dep} +- if dep.get('dep_type') == 'cipd': +- result[path] = CipdDepsEntry(path, dep['packages']) +- else: +- if '@' not in dep['url']: ++ for path, deps_url_spec in deps_subdict.items(): ++ if isinstance(deps_url_spec, dict): ++ if deps_url_spec.get('dep_type') == 'cipd': + continue +- url, revision = dep['url'].split('@') ++ deps_url = deps_url_spec['url'] ++ else: ++ deps_url = deps_url_spec ++ if not path in result: ++ url, revision = deps_url.split('@') if deps_url else (None, None) + result[path] = DepsEntry(path, url, revision) + +- def AddVersionEntry(vars_subdict): +- for key, value in vars_subdict.items(): +- if key in result: +- continue +- if not key.endswith('_version'): +- continue +- key = re.sub('_version$', '', key) +- result[key] = VersionEntry(value) +- + AddDepsEntries(deps_dict['deps']) +- for deps_os in ['win', 'mac', 'unix', 'android', 'ios', 'unix']: ++ for deps_os in ['win', 'mac', 'linux', 'android', 'ios', 'unix']: + AddDepsEntries(deps_dict.get('deps_os', {}).get(deps_os, {})) +- AddVersionEntry(deps_dict.get('vars', {})) + return result + + +-def _FindChangedCipdPackages(path, old_pkgs, new_pkgs): +- old_pkgs_names = {p['package'] for p in old_pkgs} +- new_pkgs_names = {p['package'] for p in new_pkgs} +- pkgs_equal = (old_pkgs_names == new_pkgs_names) +- added_pkgs = [p for p in new_pkgs_names if p not in old_pkgs_names] +- removed_pkgs = [p for p in old_pkgs_names if p not in new_pkgs_names] +- +- assert pkgs_equal, ('Old: %s\n New: %s.\nYou need to do a manual roll ' +- 'and remove/add entries in DEPS so the old and new ' +- 'list match.\nMost likely, you should add \"%s\" and ' +- 'remove \"%s\"' % +- (old_pkgs, new_pkgs, added_pkgs, removed_pkgs)) +- +- for old_pkg in old_pkgs: +- for new_pkg in new_pkgs: +- old_version = old_pkg['version'] +- new_version = new_pkg['version'] +- if (old_pkg['package'] == new_pkg['package'] +- and old_version != new_version): +- logging.debug('Roll dependency %s to %s', path, new_version) +- yield ChangedCipdPackage(path, old_pkg['package'], old_version, +- new_version) +- +- +-def _FindChangedVars(name, old_version, new_version): +- if old_version != new_version: +- logging.debug('Roll dependency %s to %s', name, new_version) +- yield ChangedVersionEntry(name, old_version, new_version) +- +- +-def _FindNewDeps(old, new): +- """ Gather dependencies only in `new` and return corresponding paths. """ +- old_entries = set(BuildDepsentryDict(old)) +- new_entries = set(BuildDepsentryDict(new)) +- return [ +- path for path in new_entries - old_entries +- if path not in DONT_AUTOROLL_THESE +- ] +- +- +-def FindAddedDeps(libyuv_deps, new_cr_deps): +- """ +- Calculate new deps entries of interest. +- +- Ideally, that would mean: only appearing in chromium DEPS +- but transitively used in LibYUV. +- +- Since it's hard to compute, we restrict ourselves to a well defined subset: +- deps sitting in `ANDROID_DEPS_PATH`. +- Otherwise, assumes that's a Chromium-only dependency. +- +- Args: +- libyuv_deps: dict of deps as defined in the LibYUV DEPS file. +- new_cr_deps: dict of deps as defined in the chromium DEPS file. +- +- Caveat: Doesn't detect a new package in existing dep. +- +- Returns: +- A tuple consisting of: +- A list of paths added dependencies sitting in `ANDROID_DEPS_PATH`. +- A list of paths for other added dependencies. +- """ +- all_added_deps = _FindNewDeps(libyuv_deps, new_cr_deps) +- generated_android_deps = [ +- path for path in all_added_deps if path.startswith(ANDROID_DEPS_PATH) +- ] +- other_deps = [ +- path for path in all_added_deps if path not in generated_android_deps +- ] +- return generated_android_deps, other_deps +- +- +-def FindRemovedDeps(libyuv_deps, new_cr_deps): +- """ +- Calculate obsolete deps entries. +- +- Ideally, that would mean: no more appearing in chromium DEPS +- and not used in LibYUV. +- +- Since it's hard to compute: +- 1/ We restrict ourselves to a well defined subset: +- deps sitting in `ANDROID_DEPS_PATH`. +- 2/ We rely on existing behavior of CalculateChangeDeps. +- I.e. Assumes non-CIPD dependencies are LibYUV-only, don't remove them. +- +- Args: +- libyuv_deps: dict of deps as defined in the LibYUV DEPS file. +- new_cr_deps: dict of deps as defined in the chromium DEPS file. +- +- Caveat: Doesn't detect a deleted package in existing dep. +- +- Returns: +- A tuple consisting of: +- A list of paths of dependencies removed from `ANDROID_DEPS_PATH`. +- A list of paths of unexpected disappearing dependencies. +- """ +- all_removed_deps = _FindNewDeps(new_cr_deps, libyuv_deps) +- generated_android_deps = sorted( +- [path for path in all_removed_deps if path.startswith(ANDROID_DEPS_PATH)]) +- # Webrtc-only dependencies are handled in CalculateChangedDeps. +- other_deps = sorted([ +- path for path in all_removed_deps +- if path not in generated_android_deps and path not in LIBYUV_ONLY_DEPS +- ]) +- return generated_android_deps, other_deps +- +- + def CalculateChangedDeps(libyuv_deps, new_cr_deps): + """ +- Calculate changed deps entries based on entries defined in the LibYUV DEPS +- file: ++ Calculate changed deps entries based on entries defined in the libyuv DEPS ++ file: + - If a shared dependency with the Chromium DEPS file: roll it to the same + revision as Chromium (i.e. entry in the new_cr_deps dict) + - If it's a Chromium sub-directory, roll it to the HEAD revision (notice +@@ -425,9 +239,9 @@ def CalculateChangedDeps(libyuv_deps, ne + - If it's another DEPS entry (not shared with Chromium), roll it to HEAD + unless it's configured to be skipped. + +- Returns: +- A list of ChangedDep objects representing the changed deps. +- """ ++ Returns: ++ A list of ChangedDep objects representing the changed deps. ++ """ + result = [] + libyuv_entries = BuildDepsentryDict(libyuv_deps) + new_cr_entries = BuildDepsentryDict(new_cr_deps) +@@ -436,117 +250,68 @@ def CalculateChangedDeps(libyuv_deps, ne + continue + cr_deps_entry = new_cr_entries.get(path) + if cr_deps_entry: +- assert type(cr_deps_entry) is type(libyuv_deps_entry) +- +- if isinstance(cr_deps_entry, CipdDepsEntry): +- result.extend( +- _FindChangedCipdPackages(path, libyuv_deps_entry.packages, +- cr_deps_entry.packages)) +- continue +- +- if isinstance(cr_deps_entry, VersionEntry): +- result.extend( +- _FindChangedVars(path, libyuv_deps_entry.version, +- cr_deps_entry.version)) +- continue +- + # Use the revision from Chromium's DEPS file. + new_rev = cr_deps_entry.revision + assert libyuv_deps_entry.url == cr_deps_entry.url, ( +- 'LibYUV DEPS entry %s has a different URL %s than Chromium %s.' % +- (path, libyuv_deps_entry.url, cr_deps_entry.url)) ++ 'Libyuv DEPS entry %s has a different URL (%s) than Chromium (%s).' % ++ (path, libyuv_deps_entry.url, cr_deps_entry.url)) + else: +- if isinstance(libyuv_deps_entry, DepsEntry): +- # Use the HEAD of the deps repo. +- stdout, _ = _RunCommand( +- ['git', 'ls-remote', libyuv_deps_entry.url, 'HEAD']) +- new_rev = stdout.strip().split('\t')[0] +- else: +- # The dependency has been removed from chromium. +- # This is handled by FindRemovedDeps. +- continue ++ # Use the HEAD of the deps repo. ++ stdout, _ = _RunCommand(['git', 'ls-remote', libyuv_deps_entry.url, ++ 'HEAD']) ++ new_rev = stdout.strip().split('\t')[0] + + # Check if an update is necessary. + if libyuv_deps_entry.revision != new_rev: + logging.debug('Roll dependency %s to %s', path, new_rev) +- result.append( +- ChangedDep(path, libyuv_deps_entry.url, libyuv_deps_entry.revision, +- new_rev)) ++ result.append(ChangedDep(path, libyuv_deps_entry.url, ++ libyuv_deps_entry.revision, new_rev)) + return sorted(result) + + + def CalculateChangedClang(new_cr_rev): +- + def GetClangRev(lines): + for line in lines: + match = CLANG_REVISION_RE.match(line) + if match: + return match.group(1) +- raise RollError('Could not parse Clang revision!') ++ raise RollError('Could not parse Clang revision from:\n' + '\n'.join(' ' + l for l in lines)) + + with open(CLANG_UPDATE_SCRIPT_LOCAL_PATH, 'r') as f: + current_lines = f.readlines() + current_rev = GetClangRev(current_lines) + + new_clang_update_py = ReadRemoteCrFile(CLANG_UPDATE_SCRIPT_URL_PATH, +- new_cr_rev).splitlines() ++ new_cr_rev).splitlines() + new_rev = GetClangRev(new_clang_update_py) + return ChangedDep(CLANG_UPDATE_SCRIPT_LOCAL_PATH, None, current_rev, new_rev) + + +-def GenerateCommitMessage( +- rev_update, +- current_commit_pos, +- new_commit_pos, +- changed_deps_list, +- added_deps_paths=None, +- removed_deps_paths=None, +- clang_change=None, +-): +- current_cr_rev = rev_update.current_chromium_rev[0:10] +- new_cr_rev = rev_update.new_chromium_rev[0:10] ++def GenerateCommitMessage(current_cr_rev, new_cr_rev, current_commit_pos, ++ new_commit_pos, changed_deps_list, clang_change): ++ current_cr_rev = current_cr_rev[0:10] ++ new_cr_rev = new_cr_rev[0:10] + rev_interval = '%s..%s' % (current_cr_rev, new_cr_rev) + git_number_interval = '%s:%s' % (current_commit_pos, new_commit_pos) + +- commit_msg = [ +- 'Roll chromium_revision %s (%s)\n' % (rev_interval, git_number_interval), +- 'Change log: %s' % (CHROMIUM_LOG_TEMPLATE % rev_interval), +- 'Full diff: %s\n' % (CHROMIUM_COMMIT_TEMPLATE % rev_interval) +- ] +- +- def Section(adjective, deps): +- noun = 'dependency' if len(deps) == 1 else 'dependencies' +- commit_msg.append('%s %s' % (adjective, noun)) +- ++ commit_msg = ['Roll chromium_revision %s (%s)\n' % (rev_interval, ++ git_number_interval)] ++ commit_msg.append('Change log: %s' % (CHROMIUM_LOG_TEMPLATE % rev_interval)) ++ commit_msg.append('Full diff: %s\n' % (CHROMIUM_COMMIT_TEMPLATE % ++ rev_interval)) + if changed_deps_list: +- Section('Changed', changed_deps_list) ++ commit_msg.append('Changed dependencies:') + + for c in changed_deps_list: +- if isinstance(c, ChangedCipdPackage): +- commit_msg.append('* %s: %s..%s' % +- (c.path, c.current_version, c.new_version)) +- elif isinstance(c, ChangedVersionEntry): +- commit_msg.append('* %s_vesion: %s..%s' % +- (c.path, c.current_version, c.new_version)) +- else: +- commit_msg.append('* %s: %s/+log/%s..%s' % +- (c.path, c.url, c.current_rev[0:10], c.new_rev[0:10])) +- +- if added_deps_paths: +- Section('Added', added_deps_paths) +- commit_msg.extend('* %s' % p for p in added_deps_paths) +- +- if removed_deps_paths: +- Section('Removed', removed_deps_paths) +- commit_msg.extend('* %s' % p for p in removed_deps_paths) +- +- if any([changed_deps_list, added_deps_paths, removed_deps_paths]): ++ commit_msg.append('* %s: %s/+log/%s..%s' % (c.path, c.url, ++ c.current_rev[0:10], ++ c.new_rev[0:10])) + change_url = CHROMIUM_FILE_TEMPLATE % (rev_interval, 'DEPS') + commit_msg.append('DEPS diff: %s\n' % change_url) + else: + commit_msg.append('No dependencies changed.') + +- if clang_change and clang_change.current_rev != clang_change.new_rev: ++ if clang_change.current_rev != clang_change.new_rev: + commit_msg.append('Clang version changed %s:%s' % + (clang_change.current_rev, clang_change.new_rev)) + change_url = CHROMIUM_FILE_TEMPLATE % (rev_interval, +@@ -555,61 +320,38 @@ def GenerateCommitMessage( + else: + commit_msg.append('No update to Clang.\n') + ++ # TBR needs to be non-empty for Gerrit to process it. ++ git_author = _RunCommand(['git', 'config', 'user.email'], ++ working_dir=CHECKOUT_SRC_DIR)[0].strip() ++ commit_msg.append('TBR=%s' % git_author) ++ + commit_msg.append('BUG=None') + return '\n'.join(commit_msg) + + +-def UpdateDepsFile(deps_filename, rev_update, changed_deps, new_cr_content): ++def UpdateDepsFile(deps_filename, old_cr_revision, new_cr_revision, ++ changed_deps): + """Update the DEPS file with the new revision.""" + +- with open(deps_filename, 'rb') as deps_file: +- deps_content = deps_file.read().decode('utf-8') +- + # Update the chromium_revision variable. +- deps_content = deps_content.replace(rev_update.current_chromium_rev, +- rev_update.new_chromium_rev) +- +- # Add and remove dependencies. For now: only generated android deps. +- # Since gclient cannot add or remove deps, we on the fact that +- # these android deps are located in one place we can copy/paste. +- deps_re = re.compile(ANDROID_DEPS_START + '.*' + ANDROID_DEPS_END, re.DOTALL) +- new_deps = deps_re.search(new_cr_content) +- old_deps = deps_re.search(deps_content) +- if not new_deps or not old_deps: +- faulty = 'Chromium' if not new_deps else 'LibYUV' +- raise RollError('Was expecting to find "%s" and "%s"\n' +- 'in %s DEPS' % +- (ANDROID_DEPS_START, ANDROID_DEPS_END, faulty)) +- deps_content = deps_re.sub(new_deps.group(0), deps_content) +- +- for dep in changed_deps: +- if isinstance(dep, ChangedVersionEntry): +- deps_content = deps_content.replace(dep.current_version, dep.new_version) +- ++ with open(deps_filename, 'rb') as deps_file: ++ deps_content = deps_file.read().decode('utf-8') ++ deps_content = deps_content.replace(old_cr_revision, new_cr_revision) + with open(deps_filename, 'wb') as deps_file: + deps_file.write(deps_content.encode('utf-8')) + + # Update each individual DEPS entry. + for dep in changed_deps: +- # ChangedVersionEntry types are already been processed. +- if isinstance(dep, ChangedVersionEntry): +- continue + local_dep_dir = os.path.join(CHECKOUT_ROOT_DIR, dep.path) + if not os.path.isdir(local_dep_dir): + raise RollError( +- 'Cannot find local directory %s. Either run\n' +- 'gclient sync --deps=all\n' +- 'or make sure the .gclient file for your solution contains all ' +- 'platforms in the target_os list, i.e.\n' ++ 'Cannot find local directory %s. Make sure the .gclient file\n' ++ 'contains all platforms in the target_os list, i.e.\n' + 'target_os = ["android", "unix", "mac", "ios", "win"];\n' + 'Then run "gclient sync" again.' % local_dep_dir) +- if isinstance(dep, ChangedCipdPackage): +- package = dep.package.format() # Eliminate double curly brackets +- update = '%s:%s@%s' % (dep.path, package, dep.new_version) +- else: +- update = '%s@%s' % (dep.path, dep.new_rev) +- _RunCommand(['gclient', 'setdep', '--revision', update], +- working_dir=CHECKOUT_SRC_DIR) ++ _RunCommand( ++ ['gclient', 'setdep', '--revision', '%s@%s' % (dep.path, dep.new_rev)], ++ working_dir=CHECKOUT_SRC_DIR) + + + def _IsTreeClean(): +@@ -621,9 +363,9 @@ def _IsTreeClean(): + return False + + +-def _EnsureUpdatedMainBranch(dry_run): +- current_branch = _RunCommand(['git', 'rev-parse', '--abbrev-ref', +- 'HEAD'])[0].splitlines()[0] ++def _EnsureUpdatedMasterBranch(dry_run): ++ current_branch = _RunCommand( ++ ['git', 'rev-parse', '--abbrev-ref', 'HEAD'])[0].splitlines()[0] + if current_branch != 'main': + logging.error('Please checkout the main branch and re-run this script.') + if not dry_run: +@@ -665,34 +407,19 @@ def ChooseCQMode(skip_cq, cq_over, curre + return 2 + + +-def _GetCcRecipients(changed_deps_list): +- """Returns a list of emails to notify based on the changed deps list. +- """ +- cc_recipients = [] +- for c in changed_deps_list: +- pass +- return cc_recipients +- +- +-def _UploadCL(commit_queue_mode, add_cc=None): ++def _UploadCL(commit_queue_mode): + """Upload the committed changes as a changelist to Gerrit. + +- commit_queue_mode: +- - 2: Submit to commit queue. +- - 1: Run trybots but do not submit to CQ. +- - 0: Skip CQ, upload only. +- +- add_cc: A list of email addresses to add as CC recipients. +- """ +- cc_recipients = [] +- if add_cc: +- cc_recipients.extend(add_cc) ++ commit_queue_mode: ++ - 2: Submit to commit queue. ++ - 1: Run trybots but do not submit to CQ. ++ - 0: Skip CQ, upload only. ++ """ + cmd = ['git', 'cl', 'upload', '--force', '--bypass-hooks'] + if commit_queue_mode >= 2: + logging.info('Sending the CL to the CQ...') + cmd.extend(['-o', 'label=Bot-Commit+1']) + cmd.extend(['-o', 'label=Commit-Queue+2']) +- cmd.extend(['--send-mail', '--cc', ','.join(cc_recipients)]) + elif commit_queue_mode >= 1: + logging.info('Starting CQ dry run...') + cmd.extend(['-o', 'label=Commit-Queue+1']) +@@ -702,57 +429,31 @@ def _UploadCL(commit_queue_mode, add_cc= + } + stdout, stderr = _RunCommand(cmd, extra_env=extra_env) + logging.debug('Output from "git cl upload":\nstdout:\n%s\n\nstderr:\n%s', +- stdout, stderr) +- +- +-def GetRollRevisionRanges(opts, libyuv_deps): +- current_cr_rev = libyuv_deps['vars']['chromium_revision'] +- new_cr_rev = opts.revision +- if not new_cr_rev: +- stdout, _ = _RunCommand(['git', 'ls-remote', CHROMIUM_SRC_URL, 'HEAD']) +- head_rev = stdout.strip().split('\t')[0] +- logging.info('No revision specified. Using HEAD: %s', head_rev) +- new_cr_rev = head_rev +- +- return ChromiumRevisionUpdate(current_cr_rev, new_cr_rev) ++ stdout, stderr) + + + def main(): + p = argparse.ArgumentParser() +- p.add_argument('--clean', +- action='store_true', +- default=False, ++ p.add_argument('--clean', action='store_true', default=False, + help='Removes any previous local roll branch.') +- p.add_argument('-r', +- '--revision', ++ p.add_argument('-r', '--revision', + help=('Chromium Git revision to roll to. Defaults to the ' + 'Chromium HEAD revision if omitted.')) +- p.add_argument('--dry-run', +- action='store_true', +- default=False, ++ p.add_argument('--dry-run', action='store_true', default=False, + help=('Calculate changes and modify DEPS, but don\'t create ' + 'any local branch, commit, upload CL or send any ' + 'tryjobs.')) +- p.add_argument('-i', +- '--ignore-unclean-workdir', +- action='store_true', ++ p.add_argument('-i', '--ignore-unclean-workdir', action='store_true', + default=False, + help=('Ignore if the current branch is not main or if there ' + 'are uncommitted changes (default: %(default)s).')) + grp = p.add_mutually_exclusive_group() +- grp.add_argument('--skip-cq', +- action='store_true', +- default=False, ++ grp.add_argument('--skip-cq', action='store_true', default=False, + help='Skip sending the CL to the CQ (default: %(default)s)') +- grp.add_argument('--cq-over', +- type=int, +- default=1, ++ grp.add_argument('--cq-over', type=int, default=1, + help=('Commit queue dry run if the revision difference ' + 'is below this number (default: %(default)s)')) +- p.add_argument('-v', +- '--verbose', +- action='store_true', +- default=False, ++ p.add_argument('-v', '--verbose', action='store_true', default=False, + help='Be extra verbose in printing of log messages.') + opts = p.parse_args() + +@@ -769,52 +470,38 @@ def main(): + _RemovePreviousRollBranch(opts.dry_run) + + if not opts.ignore_unclean_workdir: +- _EnsureUpdatedMainBranch(opts.dry_run) ++ _EnsureUpdatedMasterBranch(opts.dry_run) ++ ++ new_cr_rev = opts.revision ++ if not new_cr_rev: ++ stdout, _ = _RunCommand(['git', 'ls-remote', CHROMIUM_SRC_URL, 'HEAD']) ++ head_rev = stdout.strip().split('\t')[0] ++ logging.info('No revision specified. Using HEAD: %s', head_rev) ++ new_cr_rev = head_rev + + deps_filename = os.path.join(CHECKOUT_SRC_DIR, 'DEPS') + libyuv_deps = ParseLocalDepsFile(deps_filename) +- +- rev_update = GetRollRevisionRanges(opts, libyuv_deps) ++ current_cr_rev = libyuv_deps['vars']['chromium_revision'] + +- current_commit_pos = ParseCommitPosition( +- ReadRemoteCrCommit(rev_update.current_chromium_rev)) +- new_commit_pos = ParseCommitPosition( +- ReadRemoteCrCommit(rev_update.new_chromium_rev)) ++ current_commit_pos = ParseCommitPosition(ReadRemoteCrCommit(current_cr_rev)) ++ new_commit_pos = ParseCommitPosition(ReadRemoteCrCommit(new_cr_rev)) + +- new_cr_content = ReadRemoteCrFile('DEPS', rev_update.new_chromium_rev) +- new_cr_deps = ParseDepsDict(new_cr_content) ++ new_cr_deps = ParseRemoteCrDepsFile(new_cr_rev) + changed_deps = CalculateChangedDeps(libyuv_deps, new_cr_deps) +- # Discard other deps, assumed to be chromium-only dependencies. +- new_generated_android_deps, _ = FindAddedDeps(libyuv_deps, new_cr_deps) +- removed_generated_android_deps, other_deps = FindRemovedDeps( +- libyuv_deps, new_cr_deps) +- if other_deps: +- raise RollError('LibYUV DEPS entries are missing from Chromium: %s.\n' +- 'Remove them or add them to either ' +- 'LIBYUV_ONLY_DEPS or DONT_AUTOROLL_THESE.' % other_deps) +- clang_change = CalculateChangedClang(rev_update.new_chromium_rev) +- commit_msg = GenerateCommitMessage( +- rev_update, +- current_commit_pos, +- new_commit_pos, +- changed_deps, +- added_deps_paths=new_generated_android_deps, +- removed_deps_paths=removed_generated_android_deps, +- clang_change=clang_change) ++ clang_change = CalculateChangedClang(new_cr_rev) ++ commit_msg = GenerateCommitMessage(current_cr_rev, new_cr_rev, ++ current_commit_pos, new_commit_pos, ++ changed_deps, clang_change) + logging.debug('Commit message:\n%s', commit_msg) + + _CreateRollBranch(opts.dry_run) ++ UpdateDepsFile(deps_filename, current_cr_rev, new_cr_rev, changed_deps) ++ _LocalCommit(commit_msg, opts.dry_run) ++ commit_queue_mode = ChooseCQMode(opts.skip_cq, opts.cq_over, ++ current_commit_pos, new_commit_pos) ++ logging.info('Uploading CL...') + if not opts.dry_run: +- UpdateDepsFile(deps_filename, rev_update, changed_deps, new_cr_content) +- if _IsTreeClean(): +- logging.info("No DEPS changes detected, skipping CL creation.") +- else: +- _LocalCommit(commit_msg, opts.dry_run) +- commit_queue_mode = ChooseCQMode(opts.skip_cq, opts.cq_over, +- current_commit_pos, new_commit_pos) +- logging.info('Uploading CL...') +- if not opts.dry_run: +- _UploadCL(commit_queue_mode, _GetCcRecipients(changed_deps)) ++ _UploadCL(commit_queue_mode) + return 0 + + +diff --git a/media/libyuv/libyuv/unit_test/convert_test.cc b/media/libyuv/libyuv/unit_test/convert_test.cc +--- a/media/libyuv/libyuv/unit_test/convert_test.cc ++++ b/media/libyuv/libyuv/unit_test/convert_test.cc +@@ -31,13 +31,6 @@ + #include "libyuv/row.h" /* For ARGBToAR30Row_AVX2 */ + #endif + +-#if defined(__riscv) && !defined(__clang__) +-#define DISABLE_SLOW_TESTS +-#undef ENABLE_FULL_TESTS +-#undef ENABLE_ROW_TESTS +-#define LEAN_TESTS +-#endif +- + // Some functions fail on big endian. Enable these tests on all cpus except + // PowerPC, but they are not optimized so disabled by default. + #if !defined(DISABLE_SLOW_TESTS) && !defined(__powerpc__) +@@ -58,8 +51,6 @@ namespace libyuv { + // subsample amount uses a divide. + #define SUBSAMPLE(v, a) ((((v) + (a)-1)) / (a)) + +-#define ALIGNINT(V, ALIGN) (((V) + (ALIGN)-1) / (ALIGN) * (ALIGN)) +- + // Planar test + + #define TESTPLANARTOPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ +@@ -147,7 +138,6 @@ namespace libyuv { + free_aligned_buffer_page_end(src_v); \ + } + +-#if defined(ENABLE_FULL_TESTS) + #define TESTPLANARTOP(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ + SRC_SUBSAMP_Y, FMT_PLANAR, DST_T, DST_BPC, \ + DST_SUBSAMP_X, DST_SUBSAMP_Y, SRC_DEPTH) \ +@@ -163,14 +153,6 @@ namespace libyuv { + TESTPLANARTOPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, SRC_SUBSAMP_Y, \ + FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, DST_SUBSAMP_Y, \ + benchmark_width_, _Opt, +, 0, SRC_DEPTH) +-#else +-#define TESTPLANARTOP(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ +- SRC_SUBSAMP_Y, FMT_PLANAR, DST_T, DST_BPC, \ +- DST_SUBSAMP_X, DST_SUBSAMP_Y, SRC_DEPTH) \ +- TESTPLANARTOPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, SRC_SUBSAMP_Y, \ +- FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, DST_SUBSAMP_Y, \ +- benchmark_width_, _Opt, +, 0, SRC_DEPTH) +-#endif + + TESTPLANARTOP(I420, uint8_t, 1, 2, 2, I420, uint8_t, 1, 2, 2, 8) + TESTPLANARTOP(I422, uint8_t, 1, 2, 1, I420, uint8_t, 1, 2, 2, 8) +@@ -202,9 +184,7 @@ TESTPLANARTOP(I210, uint16_t, 2, 2, 1, I + TESTPLANARTOP(I410, uint16_t, 2, 1, 1, I420, uint8_t, 1, 2, 2, 10) + TESTPLANARTOP(I410, uint16_t, 2, 1, 1, I444, uint8_t, 1, 1, 1, 10) + TESTPLANARTOP(I012, uint16_t, 2, 2, 2, I420, uint8_t, 1, 2, 2, 12) +-TESTPLANARTOP(I212, uint16_t, 2, 2, 1, I420, uint8_t, 1, 2, 2, 12) + TESTPLANARTOP(I212, uint16_t, 2, 2, 1, I422, uint8_t, 1, 2, 1, 12) +-TESTPLANARTOP(I412, uint16_t, 2, 1, 1, I420, uint8_t, 1, 2, 2, 12) + TESTPLANARTOP(I412, uint16_t, 2, 1, 1, I444, uint8_t, 1, 1, 1, 12) + + // Test Android 420 to I420 +@@ -294,7 +274,6 @@ TESTPLANARTOP(I412, uint16_t, 2, 1, 1, I + free_aligned_buffer_page_end(src_uv); \ + } + +-#if defined(ENABLE_FULL_TESTS) + #define TESTAPLANARTOP(SRC_FMT_PLANAR, PN, PIXEL_STRIDE, OFF_U, OFF_V, \ + SRC_SUBSAMP_X, SRC_SUBSAMP_Y, FMT_PLANAR, SUBSAMP_X, \ + SUBSAMP_Y) \ +@@ -310,14 +289,6 @@ TESTPLANARTOP(I412, uint16_t, 2, 1, 1, I + TESTAPLANARTOPI(SRC_FMT_PLANAR, PIXEL_STRIDE, SRC_SUBSAMP_X, SRC_SUBSAMP_Y, \ + FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, benchmark_width_, _Opt, +, \ + 0, PN, OFF_U, OFF_V) +-#else +-#define TESTAPLANARTOP(SRC_FMT_PLANAR, PN, PIXEL_STRIDE, OFF_U, OFF_V, \ +- SRC_SUBSAMP_X, SRC_SUBSAMP_Y, FMT_PLANAR, SUBSAMP_X, \ +- SUBSAMP_Y) \ +- TESTAPLANARTOPI(SRC_FMT_PLANAR, PIXEL_STRIDE, SRC_SUBSAMP_X, SRC_SUBSAMP_Y, \ +- FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, benchmark_width_, _Opt, +, \ +- 0, PN, OFF_U, OFF_V) +-#endif + + TESTAPLANARTOP(Android420, I420, 1, 0, 0, 2, 2, I420, 2, 2) + TESTAPLANARTOP(Android420, NV12, 2, 0, 1, 2, 2, I420, 2, 2) +@@ -420,7 +391,6 @@ int I400ToNV21(const uint8_t* src_y, + free_aligned_buffer_page_end(src_v); \ + } + +-#if defined(ENABLE_FULL_TESTS) + #define TESTPLANARTOBP(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ + SRC_SUBSAMP_Y, FMT_PLANAR, DST_T, DST_BPC, \ + DST_SUBSAMP_X, DST_SUBSAMP_Y, SRC_DEPTH) \ +@@ -437,14 +407,6 @@ int I400ToNV21(const uint8_t* src_y, + TESTPLANARTOBPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ + SRC_SUBSAMP_Y, FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, \ + DST_SUBSAMP_Y, benchmark_width_, _Opt, +, 0, SRC_DEPTH) +-#else +-#define TESTPLANARTOBP(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ +- SRC_SUBSAMP_Y, FMT_PLANAR, DST_T, DST_BPC, \ +- DST_SUBSAMP_X, DST_SUBSAMP_Y, SRC_DEPTH) \ +- TESTPLANARTOBPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ +- SRC_SUBSAMP_Y, FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, \ +- DST_SUBSAMP_Y, benchmark_width_, _Opt, +, 0, SRC_DEPTH) +-#endif + + TESTPLANARTOBP(I420, uint8_t, 1, 2, 2, NV12, uint8_t, 1, 2, 2, 8) + TESTPLANARTOBP(I420, uint8_t, 1, 2, 2, NV21, uint8_t, 1, 2, 2, 8) +@@ -546,7 +508,6 @@ TESTPLANARTOBP(I212, uint16_t, 2, 2, 1, + free_aligned_buffer_page_end(src_uv); \ + } + +-#if defined(ENABLE_FULL_TESTS) + #define TESTBPTOBP(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ + SRC_SUBSAMP_Y, FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, \ + DST_SUBSAMP_Y, SRC_DEPTH, TILE_WIDTH, TILE_HEIGHT) \ +@@ -570,15 +531,6 @@ TESTPLANARTOBP(I212, uint16_t, 2, 2, 1, + FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, DST_SUBSAMP_Y, \ + benchmark_width_, _NullY, +, 0, 0, SRC_DEPTH, TILE_WIDTH, \ + TILE_HEIGHT) +-#else +-#define TESTBPTOBP(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ +- SRC_SUBSAMP_Y, FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, \ +- DST_SUBSAMP_Y, SRC_DEPTH, TILE_WIDTH, TILE_HEIGHT) \ +- TESTBPTOBPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, SRC_SUBSAMP_Y, \ +- FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, DST_SUBSAMP_Y, \ +- benchmark_width_, _NullY, +, 0, 0, SRC_DEPTH, TILE_WIDTH, \ +- TILE_HEIGHT) +-#endif + + TESTBPTOBP(NV21, uint8_t, 1, 2, 2, NV12, uint8_t, 1, 2, 2, 8, 1, 1) + TESTBPTOBP(NV12, uint8_t, 1, 2, 2, NV12Mirror, uint8_t, 1, 2, 2, 8, 1, 1) +@@ -593,6 +545,645 @@ TESTBPTOBP(P216, uint16_t, 2, 2, 1, P416 + TESTBPTOBP(MM21, uint8_t, 1, 2, 2, NV12, uint8_t, 1, 2, 2, 8, 16, 32) + TESTBPTOBP(MT2T, uint8_t, 10 / 8, 2, 2, P010, uint16_t, 2, 2, 2, 10, 16, 32) + ++#define TESTBPTOPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ ++ SRC_SUBSAMP_Y, FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, \ ++ DST_SUBSAMP_Y, W1280, N, NEG, OFF, SRC_DEPTH, TILE_WIDTH, \ ++ TILE_HEIGHT) \ ++ TEST_F(LibYUVConvertTest, SRC_FMT_PLANAR##To##FMT_PLANAR##N) { \ ++ static_assert(SRC_BPC == 1 || SRC_BPC == 2, "SRC BPC unsupported"); \ ++ static_assert(DST_BPC == 1 || DST_BPC == 2, "DST BPC unsupported"); \ ++ static_assert(SRC_SUBSAMP_X == 1 || SRC_SUBSAMP_X == 2, \ ++ "SRC_SUBSAMP_X unsupported"); \ ++ static_assert(SRC_SUBSAMP_Y == 1 || SRC_SUBSAMP_Y == 2, \ ++ "SRC_SUBSAMP_Y unsupported"); \ ++ static_assert(DST_SUBSAMP_X == 1 || DST_SUBSAMP_X == 2, \ ++ "DST_SUBSAMP_X unsupported"); \ ++ static_assert(DST_SUBSAMP_Y == 1 || DST_SUBSAMP_Y == 2, \ ++ "DST_SUBSAMP_Y unsupported"); \ ++ const int kWidth = W1280; \ ++ const int kHeight = benchmark_height_; \ ++ const int kSrcHalfWidth = SUBSAMPLE(kWidth, SRC_SUBSAMP_X); \ ++ const int kDstHalfWidth = SUBSAMPLE(kWidth, DST_SUBSAMP_X); \ ++ const int kDstHalfHeight = SUBSAMPLE(kHeight, DST_SUBSAMP_Y); \ ++ const int kPaddedWidth = (kWidth + (TILE_WIDTH - 1)) & ~(TILE_WIDTH - 1); \ ++ const int kPaddedHeight = \ ++ (kHeight + (TILE_HEIGHT - 1)) & ~(TILE_HEIGHT - 1); \ ++ const int kSrcHalfPaddedWidth = SUBSAMPLE(kPaddedWidth, SRC_SUBSAMP_X); \ ++ const int kSrcHalfPaddedHeight = SUBSAMPLE(kPaddedHeight, SRC_SUBSAMP_Y); \ ++ align_buffer_page_end(src_y, kPaddedWidth* kPaddedHeight* SRC_BPC + OFF); \ ++ align_buffer_page_end( \ ++ src_uv, kSrcHalfPaddedWidth* kSrcHalfPaddedHeight* SRC_BPC * 2 + OFF); \ ++ align_buffer_page_end(dst_y_c, kWidth* kHeight* DST_BPC); \ ++ align_buffer_page_end(dst_u_c, kDstHalfWidth* kDstHalfHeight* DST_BPC); \ ++ align_buffer_page_end(dst_v_c, kDstHalfWidth* kDstHalfHeight* DST_BPC); \ ++ align_buffer_page_end(dst_y_opt, kWidth* kHeight* DST_BPC); \ ++ align_buffer_page_end(dst_u_opt, kDstHalfWidth* kDstHalfHeight* DST_BPC); \ ++ align_buffer_page_end(dst_v_opt, kDstHalfWidth* kDstHalfHeight* DST_BPC); \ ++ SRC_T* src_y_p = reinterpret_cast(src_y + OFF); \ ++ SRC_T* src_uv_p = reinterpret_cast(src_uv + OFF); \ ++ for (int i = 0; i < kPaddedWidth * kPaddedHeight; ++i) { \ ++ src_y_p[i] = \ ++ (fastrand() & (((SRC_T)(-1)) << ((8 * SRC_BPC) - SRC_DEPTH))); \ ++ } \ ++ for (int i = 0; i < kSrcHalfPaddedWidth * kSrcHalfPaddedHeight * 2; ++i) { \ ++ src_uv_p[i] = \ ++ (fastrand() & (((SRC_T)(-1)) << ((8 * SRC_BPC) - SRC_DEPTH))); \ ++ } \ ++ memset(dst_y_c, 1, kWidth* kHeight* DST_BPC); \ ++ memset(dst_u_c, 2, kDstHalfWidth* kDstHalfHeight* DST_BPC); \ ++ memset(dst_v_c, 3, kDstHalfWidth* kDstHalfHeight* DST_BPC); \ ++ memset(dst_y_opt, 101, kWidth* kHeight* DST_BPC); \ ++ memset(dst_u_opt, 102, kDstHalfWidth* kDstHalfHeight* DST_BPC); \ ++ memset(dst_v_opt, 103, kDstHalfWidth* kDstHalfHeight* DST_BPC); \ ++ MaskCpuFlags(disable_cpu_flags_); \ ++ SRC_FMT_PLANAR##To##FMT_PLANAR( \ ++ src_y_p, kWidth, src_uv_p, kSrcHalfWidth * 2, \ ++ reinterpret_cast(dst_y_c), kWidth, \ ++ reinterpret_cast(dst_u_c), kDstHalfWidth, \ ++ reinterpret_cast(dst_v_c), kDstHalfWidth, kWidth, \ ++ NEG kHeight); \ ++ MaskCpuFlags(benchmark_cpu_info_); \ ++ for (int i = 0; i < benchmark_iterations_; ++i) { \ ++ SRC_FMT_PLANAR##To##FMT_PLANAR( \ ++ src_y_p, kWidth, src_uv_p, kSrcHalfWidth * 2, \ ++ reinterpret_cast(dst_y_opt), kWidth, \ ++ reinterpret_cast(dst_u_opt), kDstHalfWidth, \ ++ reinterpret_cast(dst_v_opt), kDstHalfWidth, kWidth, \ ++ NEG kHeight); \ ++ } \ ++ for (int i = 0; i < kHeight * kWidth * DST_BPC; ++i) { \ ++ EXPECT_EQ(dst_y_c[i], dst_y_opt[i]); \ ++ } \ ++ for (int i = 0; i < kDstHalfWidth * kDstHalfHeight * DST_BPC; ++i) { \ ++ EXPECT_EQ(dst_u_c[i], dst_u_opt[i]); \ ++ EXPECT_EQ(dst_v_c[i], dst_v_opt[i]); \ ++ } \ ++ free_aligned_buffer_page_end(dst_y_c); \ ++ free_aligned_buffer_page_end(dst_u_c); \ ++ free_aligned_buffer_page_end(dst_v_c); \ ++ free_aligned_buffer_page_end(dst_y_opt); \ ++ free_aligned_buffer_page_end(dst_u_opt); \ ++ free_aligned_buffer_page_end(dst_v_opt); \ ++ free_aligned_buffer_page_end(src_y); \ ++ free_aligned_buffer_page_end(src_uv); \ ++ } ++ ++#define TESTBPTOP(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ ++ SRC_SUBSAMP_Y, FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, \ ++ DST_SUBSAMP_Y, SRC_DEPTH, TILE_WIDTH, TILE_HEIGHT) \ ++ TESTBPTOPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, SRC_SUBSAMP_Y, \ ++ FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, DST_SUBSAMP_Y, \ ++ benchmark_width_ + 1, _Any, +, 0, SRC_DEPTH, TILE_WIDTH, \ ++ TILE_HEIGHT) \ ++ TESTBPTOPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, SRC_SUBSAMP_Y, \ ++ FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, DST_SUBSAMP_Y, \ ++ benchmark_width_, _Unaligned, +, 2, SRC_DEPTH, TILE_WIDTH, \ ++ TILE_HEIGHT) \ ++ TESTBPTOPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, SRC_SUBSAMP_Y, \ ++ FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, DST_SUBSAMP_Y, \ ++ benchmark_width_, _Invert, -, 0, SRC_DEPTH, TILE_WIDTH, \ ++ TILE_HEIGHT) \ ++ TESTBPTOPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, SRC_SUBSAMP_Y, \ ++ FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, DST_SUBSAMP_Y, \ ++ benchmark_width_, _Opt, +, 0, SRC_DEPTH, TILE_WIDTH, TILE_HEIGHT) ++ ++TESTBPTOP(NV12, uint8_t, 1, 2, 2, I420, uint8_t, 1, 2, 2, 8, 1, 1) ++TESTBPTOP(NV21, uint8_t, 1, 2, 2, I420, uint8_t, 1, 2, 2, 8, 1, 1) ++TESTBPTOP(MM21, uint8_t, 1, 2, 2, I420, uint8_t, 1, 2, 2, 8, 16, 32) ++TESTBPTOP(P010, uint16_t, 2, 2, 2, I010, uint16_t, 2, 2, 2, 10, 1, 1) ++TESTBPTOP(P012, uint16_t, 2, 2, 2, I012, uint16_t, 2, 2, 2, 12, 1, 1) ++ ++// Provide matrix wrappers for full range bt.709 ++#define F420ToABGR(a, b, c, d, e, f, g, h, i, j) \ ++ I420ToARGBMatrix(a, b, e, f, c, d, g, h, &kYvuF709Constants, i, j) ++#define F420ToARGB(a, b, c, d, e, f, g, h, i, j) \ ++ I420ToARGBMatrix(a, b, c, d, e, f, g, h, &kYuvF709Constants, i, j) ++#define F422ToABGR(a, b, c, d, e, f, g, h, i, j) \ ++ I422ToARGBMatrix(a, b, e, f, c, d, g, h, &kYvuF709Constants, i, j) ++#define F422ToARGB(a, b, c, d, e, f, g, h, i, j) \ ++ I422ToARGBMatrix(a, b, c, d, e, f, g, h, &kYuvF709Constants, i, j) ++#define F444ToABGR(a, b, c, d, e, f, g, h, i, j) \ ++ I444ToARGBMatrix(a, b, e, f, c, d, g, h, &kYvuF709Constants, i, j) ++#define F444ToARGB(a, b, c, d, e, f, g, h, i, j) \ ++ I444ToARGBMatrix(a, b, c, d, e, f, g, h, &kYuvF709Constants, i, j) ++ ++// Provide matrix wrappers for full range bt.2020 ++#define V420ToABGR(a, b, c, d, e, f, g, h, i, j) \ ++ I420ToARGBMatrix(a, b, e, f, c, d, g, h, &kYvuV2020Constants, i, j) ++#define V420ToARGB(a, b, c, d, e, f, g, h, i, j) \ ++ I420ToARGBMatrix(a, b, c, d, e, f, g, h, &kYuvV2020Constants, i, j) ++#define V422ToABGR(a, b, c, d, e, f, g, h, i, j) \ ++ I422ToARGBMatrix(a, b, e, f, c, d, g, h, &kYvuV2020Constants, i, j) ++#define V422ToARGB(a, b, c, d, e, f, g, h, i, j) \ ++ I422ToARGBMatrix(a, b, c, d, e, f, g, h, &kYuvV2020Constants, i, j) ++#define V444ToABGR(a, b, c, d, e, f, g, h, i, j) \ ++ I444ToARGBMatrix(a, b, e, f, c, d, g, h, &kYvuV2020Constants, i, j) ++#define V444ToARGB(a, b, c, d, e, f, g, h, i, j) \ ++ I444ToARGBMatrix(a, b, c, d, e, f, g, h, &kYuvV2020Constants, i, j) ++ ++#define I420ToARGBFilter(a, b, c, d, e, f, g, h, i, j) \ ++ I420ToARGBMatrixFilter(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j, \ ++ kFilterBilinear) ++#define I422ToARGBFilter(a, b, c, d, e, f, g, h, i, j) \ ++ I422ToARGBMatrixFilter(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j, \ ++ kFilterBilinear) ++#define I420ToRGB24Filter(a, b, c, d, e, f, g, h, i, j) \ ++ I420ToRGB24MatrixFilter(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j, \ ++ kFilterBilinear) ++#define I422ToRGB24Filter(a, b, c, d, e, f, g, h, i, j) \ ++ I420ToRGB24MatrixFilter(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j, \ ++ kFilterBilinear) ++ ++#define ALIGNINT(V, ALIGN) (((V) + (ALIGN)-1) / (ALIGN) * (ALIGN)) ++ ++#define TESTPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, W1280, N, NEG, OFF) \ ++ TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##N) { \ ++ const int kWidth = W1280; \ ++ const int kHeight = ALIGNINT(benchmark_height_, YALIGN); \ ++ const int kStrideB = ALIGNINT(kWidth * BPP_B, ALIGN); \ ++ const int kStrideUV = SUBSAMPLE(kWidth, SUBSAMP_X); \ ++ const int kSizeUV = kStrideUV * SUBSAMPLE(kHeight, SUBSAMP_Y); \ ++ align_buffer_page_end(src_y, kWidth* kHeight + OFF); \ ++ align_buffer_page_end(src_u, kSizeUV + OFF); \ ++ align_buffer_page_end(src_v, kSizeUV + OFF); \ ++ align_buffer_page_end(dst_argb_c, kStrideB* kHeight + OFF); \ ++ align_buffer_page_end(dst_argb_opt, kStrideB* kHeight + OFF); \ ++ for (int i = 0; i < kWidth * kHeight; ++i) { \ ++ src_y[i + OFF] = (fastrand() & 0xff); \ ++ } \ ++ for (int i = 0; i < kSizeUV; ++i) { \ ++ src_u[i + OFF] = (fastrand() & 0xff); \ ++ src_v[i + OFF] = (fastrand() & 0xff); \ ++ } \ ++ memset(dst_argb_c + OFF, 1, kStrideB * kHeight); \ ++ memset(dst_argb_opt + OFF, 101, kStrideB * kHeight); \ ++ MaskCpuFlags(disable_cpu_flags_); \ ++ double time0 = get_time(); \ ++ FMT_PLANAR##To##FMT_B(src_y + OFF, kWidth, src_u + OFF, kStrideUV, \ ++ src_v + OFF, kStrideUV, dst_argb_c + OFF, kStrideB, \ ++ kWidth, NEG kHeight); \ ++ double time1 = get_time(); \ ++ MaskCpuFlags(benchmark_cpu_info_); \ ++ for (int i = 0; i < benchmark_iterations_; ++i) { \ ++ FMT_PLANAR##To##FMT_B(src_y + OFF, kWidth, src_u + OFF, kStrideUV, \ ++ src_v + OFF, kStrideUV, dst_argb_opt + OFF, \ ++ kStrideB, kWidth, NEG kHeight); \ ++ } \ ++ double time2 = get_time(); \ ++ printf(" %8d us C - %8d us OPT\n", \ ++ static_cast((time1 - time0) * 1e6), \ ++ static_cast((time2 - time1) * 1e6 / benchmark_iterations_)); \ ++ for (int i = 0; i < kWidth * BPP_B * kHeight; ++i) { \ ++ EXPECT_EQ(dst_argb_c[i + OFF], dst_argb_opt[i + OFF]); \ ++ } \ ++ free_aligned_buffer_page_end(src_y); \ ++ free_aligned_buffer_page_end(src_u); \ ++ free_aligned_buffer_page_end(src_v); \ ++ free_aligned_buffer_page_end(dst_argb_c); \ ++ free_aligned_buffer_page_end(dst_argb_opt); \ ++ } ++ ++#if defined(ENABLE_FULL_TESTS) ++#define TESTPLANARTOB(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN) \ ++ TESTPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_ + 1, _Any, +, 0) \ ++ TESTPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_, _Unaligned, +, 4) \ ++ TESTPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_, _Invert, -, 0) \ ++ TESTPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_, _Opt, +, 0) ++#else ++#define TESTPLANARTOB(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN) \ ++ TESTPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_ + 1, _Any, +, 0) \ ++ TESTPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_, _Opt, +, 0) ++#endif ++ ++#if defined(ENABLE_FULL_TESTS) ++TESTPLANARTOB(I420, 2, 2, ARGB, 4, 4, 1) ++TESTPLANARTOB(I420, 2, 2, ABGR, 4, 4, 1) ++TESTPLANARTOB(J420, 2, 2, ARGB, 4, 4, 1) ++TESTPLANARTOB(J420, 2, 2, ABGR, 4, 4, 1) ++TESTPLANARTOB(F420, 2, 2, ARGB, 4, 4, 1) ++TESTPLANARTOB(F420, 2, 2, ABGR, 4, 4, 1) ++TESTPLANARTOB(H420, 2, 2, ARGB, 4, 4, 1) ++TESTPLANARTOB(H420, 2, 2, ABGR, 4, 4, 1) ++TESTPLANARTOB(U420, 2, 2, ARGB, 4, 4, 1) ++TESTPLANARTOB(U420, 2, 2, ABGR, 4, 4, 1) ++TESTPLANARTOB(V420, 2, 2, ARGB, 4, 4, 1) ++TESTPLANARTOB(V420, 2, 2, ABGR, 4, 4, 1) ++TESTPLANARTOB(I420, 2, 2, BGRA, 4, 4, 1) ++TESTPLANARTOB(I420, 2, 2, RGBA, 4, 4, 1) ++TESTPLANARTOB(I420, 2, 2, RAW, 3, 3, 1) ++TESTPLANARTOB(I420, 2, 2, RGB24, 3, 3, 1) ++TESTPLANARTOB(J420, 2, 2, RAW, 3, 3, 1) ++TESTPLANARTOB(J420, 2, 2, RGB24, 3, 3, 1) ++TESTPLANARTOB(H420, 2, 2, RAW, 3, 3, 1) ++TESTPLANARTOB(H420, 2, 2, RGB24, 3, 3, 1) ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTPLANARTOB(I420, 2, 2, RGB565, 2, 2, 1) ++TESTPLANARTOB(J420, 2, 2, RGB565, 2, 2, 1) ++TESTPLANARTOB(H420, 2, 2, RGB565, 2, 2, 1) ++TESTPLANARTOB(I420, 2, 2, ARGB1555, 2, 2, 1) ++TESTPLANARTOB(I420, 2, 2, ARGB4444, 2, 2, 1) ++TESTPLANARTOB(I422, 2, 1, RGB565, 2, 2, 1) ++#endif ++TESTPLANARTOB(I422, 2, 1, ARGB, 4, 4, 1) ++TESTPLANARTOB(I422, 2, 1, ABGR, 4, 4, 1) ++TESTPLANARTOB(J422, 2, 1, ARGB, 4, 4, 1) ++TESTPLANARTOB(J422, 2, 1, ABGR, 4, 4, 1) ++TESTPLANARTOB(H422, 2, 1, ARGB, 4, 4, 1) ++TESTPLANARTOB(H422, 2, 1, ABGR, 4, 4, 1) ++TESTPLANARTOB(U422, 2, 1, ARGB, 4, 4, 1) ++TESTPLANARTOB(U422, 2, 1, ABGR, 4, 4, 1) ++TESTPLANARTOB(V422, 2, 1, ARGB, 4, 4, 1) ++TESTPLANARTOB(V422, 2, 1, ABGR, 4, 4, 1) ++TESTPLANARTOB(I422, 2, 1, BGRA, 4, 4, 1) ++TESTPLANARTOB(I422, 2, 1, RGBA, 4, 4, 1) ++TESTPLANARTOB(I422, 1, 1, RGB24, 3, 3, 1) ++TESTPLANARTOB(I422, 1, 1, RAW, 3, 3, 1) ++TESTPLANARTOB(I444, 1, 1, ARGB, 4, 4, 1) ++TESTPLANARTOB(I444, 1, 1, ABGR, 4, 4, 1) ++TESTPLANARTOB(I444, 1, 1, RGB24, 3, 3, 1) ++TESTPLANARTOB(I444, 1, 1, RAW, 3, 3, 1) ++TESTPLANARTOB(J444, 1, 1, ARGB, 4, 4, 1) ++TESTPLANARTOB(J444, 1, 1, ABGR, 4, 4, 1) ++TESTPLANARTOB(H444, 1, 1, ARGB, 4, 4, 1) ++TESTPLANARTOB(H444, 1, 1, ABGR, 4, 4, 1) ++TESTPLANARTOB(U444, 1, 1, ARGB, 4, 4, 1) ++TESTPLANARTOB(U444, 1, 1, ABGR, 4, 4, 1) ++TESTPLANARTOB(V444, 1, 1, ARGB, 4, 4, 1) ++TESTPLANARTOB(V444, 1, 1, ABGR, 4, 4, 1) ++TESTPLANARTOB(I420, 2, 2, YUY2, 2, 4, 1) ++TESTPLANARTOB(I420, 2, 2, UYVY, 2, 4, 1) ++TESTPLANARTOB(I422, 2, 1, YUY2, 2, 4, 1) ++TESTPLANARTOB(I422, 2, 1, UYVY, 2, 4, 1) ++TESTPLANARTOB(I420, 2, 2, I400, 1, 1, 1) ++TESTPLANARTOB(J420, 2, 2, J400, 1, 1, 1) ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTPLANARTOB(I420, 2, 2, AR30, 4, 4, 1) ++TESTPLANARTOB(H420, 2, 2, AR30, 4, 4, 1) ++TESTPLANARTOB(I420, 2, 2, AB30, 4, 4, 1) ++TESTPLANARTOB(H420, 2, 2, AB30, 4, 4, 1) ++#endif ++TESTPLANARTOB(I420, 2, 2, ARGBFilter, 4, 4, 1) ++TESTPLANARTOB(I422, 2, 1, ARGBFilter, 4, 4, 1) ++TESTPLANARTOB(I420, 2, 2, RGB24Filter, 3, 3, 1) ++TESTPLANARTOB(I422, 2, 2, RGB24Filter, 3, 3, 1) ++#else ++TESTPLANARTOB(I420, 2, 2, ABGR, 4, 4, 1) ++TESTPLANARTOB(I420, 2, 2, ARGB, 4, 4, 1) ++TESTPLANARTOB(I420, 2, 2, BGRA, 4, 4, 1) ++TESTPLANARTOB(I420, 2, 2, RAW, 3, 3, 1) ++TESTPLANARTOB(I420, 2, 2, RGB24, 3, 3, 1) ++TESTPLANARTOB(I420, 2, 2, RGBA, 4, 4, 1) ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTPLANARTOB(I420, 2, 2, RGB565, 2, 2, 1) ++TESTPLANARTOB(I420, 2, 2, ARGB1555, 2, 2, 1) ++TESTPLANARTOB(I420, 2, 2, ARGB4444, 2, 2, 1) ++TESTPLANARTOB(I422, 2, 1, RGB565, 2, 2, 1) ++#endif ++TESTPLANARTOB(I420, 2, 2, I400, 1, 1, 1) ++TESTPLANARTOB(I420, 2, 2, UYVY, 2, 4, 1) ++TESTPLANARTOB(I420, 2, 2, YUY2, 2, 4, 1) ++TESTPLANARTOB(I422, 2, 1, ABGR, 4, 4, 1) ++TESTPLANARTOB(I422, 2, 1, ARGB, 4, 4, 1) ++TESTPLANARTOB(I422, 2, 1, BGRA, 4, 4, 1) ++TESTPLANARTOB(I422, 2, 1, RGBA, 4, 4, 1) ++TESTPLANARTOB(I422, 2, 1, UYVY, 2, 4, 1) ++TESTPLANARTOB(I422, 2, 1, YUY2, 2, 4, 1) ++TESTPLANARTOB(I420, 2, 2, ARGBFilter, 4, 4, 1) ++TESTPLANARTOB(I422, 2, 1, ARGBFilter, 4, 4, 1) ++TESTPLANARTOB(I420, 2, 2, RGB24Filter, 3, 3, 1) ++TESTPLANARTOB(I444, 1, 1, ABGR, 4, 4, 1) ++TESTPLANARTOB(I444, 1, 1, ARGB, 4, 4, 1) ++#endif ++ ++#define TESTQPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, W1280, N, NEG, OFF, ATTEN) \ ++ TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##N) { \ ++ const int kWidth = W1280; \ ++ const int kHeight = ALIGNINT(benchmark_height_, YALIGN); \ ++ const int kStrideB = ALIGNINT(kWidth * BPP_B, ALIGN); \ ++ const int kStrideUV = SUBSAMPLE(kWidth, SUBSAMP_X); \ ++ const int kSizeUV = kStrideUV * SUBSAMPLE(kHeight, SUBSAMP_Y); \ ++ align_buffer_page_end(src_y, kWidth* kHeight + OFF); \ ++ align_buffer_page_end(src_u, kSizeUV + OFF); \ ++ align_buffer_page_end(src_v, kSizeUV + OFF); \ ++ align_buffer_page_end(src_a, kWidth* kHeight + OFF); \ ++ align_buffer_page_end(dst_argb_c, kStrideB* kHeight + OFF); \ ++ align_buffer_page_end(dst_argb_opt, kStrideB* kHeight + OFF); \ ++ for (int i = 0; i < kWidth * kHeight; ++i) { \ ++ src_y[i + OFF] = (fastrand() & 0xff); \ ++ src_a[i + OFF] = (fastrand() & 0xff); \ ++ } \ ++ for (int i = 0; i < kSizeUV; ++i) { \ ++ src_u[i + OFF] = (fastrand() & 0xff); \ ++ src_v[i + OFF] = (fastrand() & 0xff); \ ++ } \ ++ memset(dst_argb_c + OFF, 1, kStrideB * kHeight); \ ++ memset(dst_argb_opt + OFF, 101, kStrideB * kHeight); \ ++ MaskCpuFlags(disable_cpu_flags_); \ ++ FMT_PLANAR##To##FMT_B(src_y + OFF, kWidth, src_u + OFF, kStrideUV, \ ++ src_v + OFF, kStrideUV, src_a + OFF, kWidth, \ ++ dst_argb_c + OFF, kStrideB, kWidth, NEG kHeight, \ ++ ATTEN); \ ++ MaskCpuFlags(benchmark_cpu_info_); \ ++ for (int i = 0; i < benchmark_iterations_; ++i) { \ ++ FMT_PLANAR##To##FMT_B(src_y + OFF, kWidth, src_u + OFF, kStrideUV, \ ++ src_v + OFF, kStrideUV, src_a + OFF, kWidth, \ ++ dst_argb_opt + OFF, kStrideB, kWidth, NEG kHeight, \ ++ ATTEN); \ ++ } \ ++ for (int i = 0; i < kWidth * BPP_B * kHeight; ++i) { \ ++ EXPECT_EQ(dst_argb_c[i + OFF], dst_argb_opt[i + OFF]); \ ++ } \ ++ free_aligned_buffer_page_end(src_y); \ ++ free_aligned_buffer_page_end(src_u); \ ++ free_aligned_buffer_page_end(src_v); \ ++ free_aligned_buffer_page_end(src_a); \ ++ free_aligned_buffer_page_end(dst_argb_c); \ ++ free_aligned_buffer_page_end(dst_argb_opt); \ ++ } ++ ++#if defined(ENABLE_FULL_TESTS) ++#define TESTQPLANARTOB(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN) \ ++ TESTQPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_ + 1, _Any, +, 0, 0) \ ++ TESTQPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_, _Unaligned, +, 2, 0) \ ++ TESTQPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_, _Invert, -, 0, 0) \ ++ TESTQPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_, _Opt, +, 0, 0) \ ++ TESTQPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_, _Premult, +, 0, 1) ++#else ++#define TESTQPLANARTOB(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN) \ ++ TESTQPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_, _Opt, +, 0, 0) ++#endif ++ ++#define J420AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I420AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ ++ l, m) ++#define J420AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I420AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ ++ l, m) ++#define F420AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I420AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ ++ l, m) ++#define F420AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I420AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ ++ l, m) ++#define H420AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I420AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ ++ l, m) ++#define H420AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I420AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ ++ l, m) ++#define U420AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I420AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ ++ l, m) ++#define U420AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I420AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ ++ l, m) ++#define V420AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I420AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ ++ l, m) ++#define V420AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I420AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ ++ l, m) ++#define J422AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I422AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ ++ l, m) ++#define J422AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I422AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ ++ l, m) ++#define F422AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I422AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ ++ l, m) ++#define F422AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I422AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ ++ l, m) ++#define H422AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I422AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ ++ l, m) ++#define H422AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I422AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ ++ l, m) ++#define U422AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I422AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ ++ l, m) ++#define U422AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I422AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ ++ l, m) ++#define V422AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I422AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ ++ l, m) ++#define V422AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I422AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ ++ l, m) ++#define J444AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I444AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ ++ l, m) ++#define J444AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I444AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ ++ l, m) ++#define F444AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I444AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ ++ l, m) ++#define F444AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I444AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ ++ l, m) ++#define H444AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I444AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ ++ l, m) ++#define H444AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I444AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ ++ l, m) ++#define U444AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I444AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ ++ l, m) ++#define U444AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I444AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ ++ l, m) ++#define V444AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I444AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ ++ l, m) ++#define V444AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I444AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ ++ l, m) ++ ++#define I420AlphaToARGBFilter(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I420AlphaToARGBMatrixFilter(a, b, c, d, e, f, g, h, i, j, \ ++ &kYuvI601Constants, k, l, m, kFilterBilinear) ++#define I422AlphaToARGBFilter(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I422AlphaToARGBMatrixFilter(a, b, c, d, e, f, g, h, i, j, \ ++ &kYuvI601Constants, k, l, m, kFilterBilinear) ++ ++#if defined(ENABLE_FULL_TESTS) ++TESTQPLANARTOB(I420Alpha, 2, 2, ARGB, 4, 4, 1) ++TESTQPLANARTOB(I420Alpha, 2, 2, ABGR, 4, 4, 1) ++TESTQPLANARTOB(J420Alpha, 2, 2, ARGB, 4, 4, 1) ++TESTQPLANARTOB(J420Alpha, 2, 2, ABGR, 4, 4, 1) ++TESTQPLANARTOB(H420Alpha, 2, 2, ARGB, 4, 4, 1) ++TESTQPLANARTOB(H420Alpha, 2, 2, ABGR, 4, 4, 1) ++TESTQPLANARTOB(F420Alpha, 2, 2, ARGB, 4, 4, 1) ++TESTQPLANARTOB(F420Alpha, 2, 2, ABGR, 4, 4, 1) ++TESTQPLANARTOB(U420Alpha, 2, 2, ARGB, 4, 4, 1) ++TESTQPLANARTOB(U420Alpha, 2, 2, ABGR, 4, 4, 1) ++TESTQPLANARTOB(V420Alpha, 2, 2, ARGB, 4, 4, 1) ++TESTQPLANARTOB(V420Alpha, 2, 2, ABGR, 4, 4, 1) ++TESTQPLANARTOB(I422Alpha, 2, 1, ARGB, 4, 4, 1) ++TESTQPLANARTOB(I422Alpha, 2, 1, ABGR, 4, 4, 1) ++TESTQPLANARTOB(J422Alpha, 2, 1, ARGB, 4, 4, 1) ++TESTQPLANARTOB(J422Alpha, 2, 1, ABGR, 4, 4, 1) ++TESTQPLANARTOB(H422Alpha, 2, 1, ARGB, 4, 4, 1) ++TESTQPLANARTOB(H422Alpha, 2, 1, ABGR, 4, 4, 1) ++TESTQPLANARTOB(F422Alpha, 2, 1, ARGB, 4, 4, 1) ++TESTQPLANARTOB(F422Alpha, 2, 1, ABGR, 4, 4, 1) ++TESTQPLANARTOB(U422Alpha, 2, 1, ARGB, 4, 4, 1) ++TESTQPLANARTOB(U422Alpha, 2, 1, ABGR, 4, 4, 1) ++TESTQPLANARTOB(V422Alpha, 2, 1, ARGB, 4, 4, 1) ++TESTQPLANARTOB(V422Alpha, 2, 1, ABGR, 4, 4, 1) ++TESTQPLANARTOB(I444Alpha, 1, 1, ARGB, 4, 4, 1) ++TESTQPLANARTOB(I444Alpha, 1, 1, ABGR, 4, 4, 1) ++TESTQPLANARTOB(J444Alpha, 1, 1, ARGB, 4, 4, 1) ++TESTQPLANARTOB(J444Alpha, 1, 1, ABGR, 4, 4, 1) ++TESTQPLANARTOB(H444Alpha, 1, 1, ARGB, 4, 4, 1) ++TESTQPLANARTOB(H444Alpha, 1, 1, ABGR, 4, 4, 1) ++TESTQPLANARTOB(F444Alpha, 1, 1, ARGB, 4, 4, 1) ++TESTQPLANARTOB(F444Alpha, 1, 1, ABGR, 4, 4, 1) ++TESTQPLANARTOB(U444Alpha, 1, 1, ARGB, 4, 4, 1) ++TESTQPLANARTOB(U444Alpha, 1, 1, ABGR, 4, 4, 1) ++TESTQPLANARTOB(V444Alpha, 1, 1, ARGB, 4, 4, 1) ++TESTQPLANARTOB(V444Alpha, 1, 1, ABGR, 4, 4, 1) ++TESTQPLANARTOB(I420Alpha, 2, 2, ARGBFilter, 4, 4, 1) ++TESTQPLANARTOB(I422Alpha, 2, 1, ARGBFilter, 4, 4, 1) ++#else ++TESTQPLANARTOB(I420Alpha, 2, 2, ARGB, 4, 4, 1) ++TESTQPLANARTOB(I422Alpha, 2, 1, ARGB, 4, 4, 1) ++TESTQPLANARTOB(I444Alpha, 1, 1, ARGB, 4, 4, 1) ++TESTQPLANARTOB(I420Alpha, 2, 2, ARGBFilter, 4, 4, 1) ++TESTQPLANARTOB(I422Alpha, 2, 1, ARGBFilter, 4, 4, 1) ++#endif ++ ++#define TESTBPTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, FMT_C, BPP_B, \ ++ W1280, N, NEG, OFF) \ ++ TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##N) { \ ++ const int kWidth = W1280; \ ++ const int kHeight = benchmark_height_; \ ++ const int kStrideB = kWidth * BPP_B; \ ++ const int kStrideUV = SUBSAMPLE(kWidth, SUBSAMP_X); \ ++ align_buffer_page_end(src_y, kWidth* kHeight + OFF); \ ++ align_buffer_page_end(src_uv, \ ++ kStrideUV* SUBSAMPLE(kHeight, SUBSAMP_Y) * 2 + OFF); \ ++ align_buffer_page_end(dst_argb_c, kStrideB* kHeight); \ ++ align_buffer_page_end(dst_argb_opt, kStrideB* kHeight); \ ++ for (int i = 0; i < kHeight; ++i) \ ++ for (int j = 0; j < kWidth; ++j) \ ++ src_y[i * kWidth + j + OFF] = (fastrand() & 0xff); \ ++ for (int i = 0; i < SUBSAMPLE(kHeight, SUBSAMP_Y); ++i) { \ ++ for (int j = 0; j < kStrideUV * 2; ++j) { \ ++ src_uv[i * kStrideUV * 2 + j + OFF] = (fastrand() & 0xff); \ ++ } \ ++ } \ ++ memset(dst_argb_c, 1, kStrideB* kHeight); \ ++ memset(dst_argb_opt, 101, kStrideB* kHeight); \ ++ MaskCpuFlags(disable_cpu_flags_); \ ++ FMT_PLANAR##To##FMT_B(src_y + OFF, kWidth, src_uv + OFF, kStrideUV * 2, \ ++ dst_argb_c, kWidth * BPP_B, kWidth, NEG kHeight); \ ++ MaskCpuFlags(benchmark_cpu_info_); \ ++ for (int i = 0; i < benchmark_iterations_; ++i) { \ ++ FMT_PLANAR##To##FMT_B(src_y + OFF, kWidth, src_uv + OFF, kStrideUV * 2, \ ++ dst_argb_opt, kWidth * BPP_B, kWidth, \ ++ NEG kHeight); \ ++ } \ ++ /* Convert to ARGB so 565 is expanded to bytes that can be compared. */ \ ++ align_buffer_page_end(dst_argb32_c, kWidth * 4 * kHeight); \ ++ align_buffer_page_end(dst_argb32_opt, kWidth * 4 * kHeight); \ ++ memset(dst_argb32_c, 2, kWidth * 4 * kHeight); \ ++ memset(dst_argb32_opt, 102, kWidth * 4 * kHeight); \ ++ FMT_C##ToARGB(dst_argb_c, kStrideB, dst_argb32_c, kWidth * 4, kWidth, \ ++ kHeight); \ ++ FMT_C##ToARGB(dst_argb_opt, kStrideB, dst_argb32_opt, kWidth * 4, kWidth, \ ++ kHeight); \ ++ for (int i = 0; i < kHeight; ++i) { \ ++ for (int j = 0; j < kWidth * 4; ++j) { \ ++ EXPECT_EQ(dst_argb32_c[i * kWidth * 4 + j], \ ++ dst_argb32_opt[i * kWidth * 4 + j]); \ ++ } \ ++ } \ ++ free_aligned_buffer_page_end(src_y); \ ++ free_aligned_buffer_page_end(src_uv); \ ++ free_aligned_buffer_page_end(dst_argb_c); \ ++ free_aligned_buffer_page_end(dst_argb_opt); \ ++ free_aligned_buffer_page_end(dst_argb32_c); \ ++ free_aligned_buffer_page_end(dst_argb32_opt); \ ++ } ++ ++#define TESTBPTOB(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, FMT_C, BPP_B) \ ++ TESTBPTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, FMT_C, BPP_B, \ ++ benchmark_width_ + 1, _Any, +, 0) \ ++ TESTBPTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, FMT_C, BPP_B, \ ++ benchmark_width_, _Unaligned, +, 2) \ ++ TESTBPTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, FMT_C, BPP_B, \ ++ benchmark_width_, _Invert, -, 0) \ ++ TESTBPTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, FMT_C, BPP_B, \ ++ benchmark_width_, _Opt, +, 0) ++ ++#define JNV12ToARGB(a, b, c, d, e, f, g, h) \ ++ NV12ToARGBMatrix(a, b, c, d, e, f, &kYuvJPEGConstants, g, h) ++#define JNV21ToARGB(a, b, c, d, e, f, g, h) \ ++ NV21ToARGBMatrix(a, b, c, d, e, f, &kYuvJPEGConstants, g, h) ++#define JNV12ToABGR(a, b, c, d, e, f, g, h) \ ++ NV21ToARGBMatrix(a, b, c, d, e, f, &kYvuJPEGConstants, g, h) ++#define JNV21ToABGR(a, b, c, d, e, f, g, h) \ ++ NV12ToARGBMatrix(a, b, c, d, e, f, &kYvuJPEGConstants, g, h) ++#define JNV12ToRGB24(a, b, c, d, e, f, g, h) \ ++ NV12ToRGB24Matrix(a, b, c, d, e, f, &kYuvJPEGConstants, g, h) ++#define JNV21ToRGB24(a, b, c, d, e, f, g, h) \ ++ NV21ToRGB24Matrix(a, b, c, d, e, f, &kYuvJPEGConstants, g, h) ++#define JNV12ToRAW(a, b, c, d, e, f, g, h) \ ++ NV21ToRGB24Matrix(a, b, c, d, e, f, &kYvuJPEGConstants, g, h) ++#define JNV21ToRAW(a, b, c, d, e, f, g, h) \ ++ NV12ToRGB24Matrix(a, b, c, d, e, f, &kYvuJPEGConstants, g, h) ++#define JNV12ToRGB565(a, b, c, d, e, f, g, h) \ ++ NV12ToRGB565Matrix(a, b, c, d, e, f, &kYuvJPEGConstants, g, h) ++ ++TESTBPTOB(JNV12, 2, 2, ARGB, ARGB, 4) ++TESTBPTOB(JNV21, 2, 2, ARGB, ARGB, 4) ++TESTBPTOB(JNV12, 2, 2, ABGR, ABGR, 4) ++TESTBPTOB(JNV21, 2, 2, ABGR, ABGR, 4) ++TESTBPTOB(JNV12, 2, 2, RGB24, RGB24, 3) ++TESTBPTOB(JNV21, 2, 2, RGB24, RGB24, 3) ++TESTBPTOB(JNV12, 2, 2, RAW, RAW, 3) ++TESTBPTOB(JNV21, 2, 2, RAW, RAW, 3) ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTBPTOB(JNV12, 2, 2, RGB565, RGB565, 2) ++#endif ++ ++TESTBPTOB(NV12, 2, 2, ARGB, ARGB, 4) ++TESTBPTOB(NV21, 2, 2, ARGB, ARGB, 4) ++TESTBPTOB(NV12, 2, 2, ABGR, ABGR, 4) ++TESTBPTOB(NV21, 2, 2, ABGR, ABGR, 4) ++TESTBPTOB(NV12, 2, 2, RGB24, RGB24, 3) ++TESTBPTOB(NV21, 2, 2, RGB24, RGB24, 3) ++TESTBPTOB(NV12, 2, 2, RAW, RAW, 3) ++TESTBPTOB(NV21, 2, 2, RAW, RAW, 3) ++TESTBPTOB(NV21, 2, 2, YUV24, RAW, 3) ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTBPTOB(NV12, 2, 2, RGB565, RGB565, 2) ++#endif ++ + #define TESTATOPLANARI(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ + W1280, N, NEG, OFF) \ + TEST_F(LibYUVConvertTest, FMT_A##To##FMT_PLANAR##N) { \ +@@ -654,6 +1245,8 @@ TESTBPTOBP(MT2T, uint8_t, 10 / 8, 2, 2, + #else + #define TESTATOPLANAR(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y) \ + TESTATOPLANARI(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ ++ benchmark_width_ + 1, _Any, +, 0) \ ++ TESTATOPLANARI(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ + benchmark_width_, _Opt, +, 0) + #endif + +@@ -683,80 +1276,6 @@ TESTATOPLANAR(UYVY, 2, 1, I422, 2, 1) + TESTATOPLANAR(YUY2, 2, 1, I420, 2, 2) + TESTATOPLANAR(YUY2, 2, 1, I422, 2, 1) + +-#define TESTATOPLANARAI(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, \ +- SUBSAMP_Y, W1280, N, NEG, OFF) \ +- TEST_F(LibYUVConvertTest, FMT_A##To##FMT_PLANAR##N) { \ +- const int kWidth = W1280; \ +- const int kHeight = ALIGNINT(benchmark_height_, YALIGN); \ +- const int kStrideUV = SUBSAMPLE(kWidth, SUBSAMP_X); \ +- const int kStride = (kStrideUV * SUBSAMP_X * 8 * BPP_A + 7) / 8; \ +- align_buffer_page_end(src_argb, kStride* kHeight + OFF); \ +- align_buffer_page_end(dst_a_c, kWidth* kHeight); \ +- align_buffer_page_end(dst_y_c, kWidth* kHeight); \ +- align_buffer_page_end(dst_uv_c, \ +- kStrideUV * 2 * SUBSAMPLE(kHeight, SUBSAMP_Y)); \ +- align_buffer_page_end(dst_a_opt, kWidth* kHeight); \ +- align_buffer_page_end(dst_y_opt, kWidth* kHeight); \ +- align_buffer_page_end(dst_uv_opt, \ +- kStrideUV * 2 * SUBSAMPLE(kHeight, SUBSAMP_Y)); \ +- memset(dst_a_c, 1, kWidth* kHeight); \ +- memset(dst_y_c, 2, kWidth* kHeight); \ +- memset(dst_uv_c, 3, kStrideUV * 2 * SUBSAMPLE(kHeight, SUBSAMP_Y)); \ +- memset(dst_a_opt, 101, kWidth* kHeight); \ +- memset(dst_y_opt, 102, kWidth* kHeight); \ +- memset(dst_uv_opt, 103, kStrideUV * 2 * SUBSAMPLE(kHeight, SUBSAMP_Y)); \ +- for (int i = 0; i < kHeight; ++i) \ +- for (int j = 0; j < kStride; ++j) \ +- src_argb[(i * kStride) + j + OFF] = (fastrand() & 0xff); \ +- MaskCpuFlags(disable_cpu_flags_); \ +- FMT_A##To##FMT_PLANAR(src_argb + OFF, kStride, dst_y_c, kWidth, dst_uv_c, \ +- kStrideUV * 2, dst_uv_c + kStrideUV, kStrideUV * 2, \ +- dst_a_c, kWidth, kWidth, NEG kHeight); \ +- MaskCpuFlags(benchmark_cpu_info_); \ +- for (int i = 0; i < benchmark_iterations_; ++i) { \ +- FMT_A##To##FMT_PLANAR(src_argb + OFF, kStride, dst_y_opt, kWidth, \ +- dst_uv_opt, kStrideUV * 2, dst_uv_opt + kStrideUV, \ +- kStrideUV * 2, dst_a_opt, kWidth, kWidth, \ +- NEG kHeight); \ +- } \ +- for (int i = 0; i < kHeight; ++i) { \ +- for (int j = 0; j < kWidth; ++j) { \ +- EXPECT_EQ(dst_y_c[i * kWidth + j], dst_y_opt[i * kWidth + j]); \ +- EXPECT_EQ(dst_a_c[i * kWidth + j], dst_a_opt[i * kWidth + j]); \ +- } \ +- } \ +- for (int i = 0; i < SUBSAMPLE(kHeight, SUBSAMP_Y) * 2; ++i) { \ +- for (int j = 0; j < kStrideUV; ++j) { \ +- EXPECT_EQ(dst_uv_c[i * kStrideUV + j], dst_uv_opt[i * kStrideUV + j]); \ +- } \ +- } \ +- free_aligned_buffer_page_end(dst_a_c); \ +- free_aligned_buffer_page_end(dst_y_c); \ +- free_aligned_buffer_page_end(dst_uv_c); \ +- free_aligned_buffer_page_end(dst_a_opt); \ +- free_aligned_buffer_page_end(dst_y_opt); \ +- free_aligned_buffer_page_end(dst_uv_opt); \ +- free_aligned_buffer_page_end(src_argb); \ +- } +- +-#if defined(ENABLE_FULL_TESTS) +-#define TESTATOPLANARA(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y) \ +- TESTATOPLANARAI(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ +- benchmark_width_ + 1, _Any, +, 0) \ +- TESTATOPLANARAI(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ +- benchmark_width_, _Unaligned, +, 2) \ +- TESTATOPLANARAI(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ +- benchmark_width_, _Invert, -, 0) \ +- TESTATOPLANARAI(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ +- benchmark_width_, _Opt, +, 0) +-#else +-#define TESTATOPLANARA(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y) \ +- TESTATOPLANARAI(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ +- benchmark_width_, _Opt, +, 0) +-#endif +- +-TESTATOPLANARA(ARGB, 4, 1, I420Alpha, 2, 2) +- + #define TESTATOBPI(FMT_A, SUB_A, BPP_A, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ + W1280, N, NEG, OFF) \ + TEST_F(LibYUVConvertTest, FMT_A##To##FMT_PLANAR##N) { \ +@@ -804,7 +1323,6 @@ TESTATOPLANARA(ARGB, 4, 1, I420Alpha, 2, + free_aligned_buffer_page_end(src_argb); \ + } + +-#if defined(ENABLE_FULL_TESTS) + #define TESTATOBP(FMT_A, SUB_A, BPP_A, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y) \ + TESTATOBPI(FMT_A, SUB_A, BPP_A, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ + benchmark_width_ + 1, _Any, +, 0) \ +@@ -814,11 +1332,6 @@ TESTATOPLANARA(ARGB, 4, 1, I420Alpha, 2, + benchmark_width_, _Invert, -, 0) \ + TESTATOBPI(FMT_A, SUB_A, BPP_A, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ + benchmark_width_, _Opt, +, 0) +-#else +-#define TESTATOBP(FMT_A, SUB_A, BPP_A, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y) \ +- TESTATOBPI(FMT_A, SUB_A, BPP_A, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ +- benchmark_width_, _Opt, +, 0) +-#endif + + TESTATOBP(ARGB, 1, 4, NV12, 2, 2) + TESTATOBP(ARGB, 1, 4, NV21, 2, 2) +@@ -830,7 +1343,440 @@ TESTATOBP(UYVY, 2, 4, NV12, 2, 2) + TESTATOBP(AYUV, 1, 4, NV12, 2, 2) + TESTATOBP(AYUV, 1, 4, NV21, 2, 2) + +-#if !defined(LEAN_TESTS) ++#define TESTATOBI(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, \ ++ EPP_B, STRIDE_B, HEIGHT_B, W1280, N, NEG, OFF) \ ++ TEST_F(LibYUVConvertTest, FMT_A##To##FMT_B##N) { \ ++ const int kWidth = W1280; \ ++ const int kHeight = benchmark_height_; \ ++ const int kHeightA = (kHeight + HEIGHT_A - 1) / HEIGHT_A * HEIGHT_A; \ ++ const int kHeightB = (kHeight + HEIGHT_B - 1) / HEIGHT_B * HEIGHT_B; \ ++ const int kStrideA = \ ++ (kWidth * EPP_A + STRIDE_A - 1) / STRIDE_A * STRIDE_A; \ ++ const int kStrideB = \ ++ (kWidth * EPP_B + STRIDE_B - 1) / STRIDE_B * STRIDE_B; \ ++ align_buffer_page_end(src_argb, \ ++ kStrideA* kHeightA*(int)sizeof(TYPE_A) + OFF); \ ++ align_buffer_page_end(dst_argb_c, kStrideB* kHeightB*(int)sizeof(TYPE_B)); \ ++ align_buffer_page_end(dst_argb_opt, \ ++ kStrideB* kHeightB*(int)sizeof(TYPE_B)); \ ++ for (int i = 0; i < kStrideA * kHeightA * (int)sizeof(TYPE_A); ++i) { \ ++ src_argb[i + OFF] = (fastrand() & 0xff); \ ++ } \ ++ memset(dst_argb_c, 1, kStrideB* kHeightB); \ ++ memset(dst_argb_opt, 101, kStrideB* kHeightB); \ ++ MaskCpuFlags(disable_cpu_flags_); \ ++ FMT_A##To##FMT_B((TYPE_A*)(src_argb + OFF), kStrideA, (TYPE_B*)dst_argb_c, \ ++ kStrideB, kWidth, NEG kHeight); \ ++ MaskCpuFlags(benchmark_cpu_info_); \ ++ for (int i = 0; i < benchmark_iterations_; ++i) { \ ++ FMT_A##To##FMT_B((TYPE_A*)(src_argb + OFF), kStrideA, \ ++ (TYPE_B*)dst_argb_opt, kStrideB, kWidth, NEG kHeight); \ ++ } \ ++ for (int i = 0; i < kStrideB * kHeightB * (int)sizeof(TYPE_B); ++i) { \ ++ EXPECT_EQ(dst_argb_c[i], dst_argb_opt[i]); \ ++ } \ ++ free_aligned_buffer_page_end(src_argb); \ ++ free_aligned_buffer_page_end(dst_argb_c); \ ++ free_aligned_buffer_page_end(dst_argb_opt); \ ++ } ++ ++#define TESTATOBRANDOM(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, \ ++ TYPE_B, EPP_B, STRIDE_B, HEIGHT_B) \ ++ TEST_F(LibYUVConvertTest, FMT_A##To##FMT_B##_Random) { \ ++ for (int times = 0; times < benchmark_iterations_; ++times) { \ ++ const int kWidth = (fastrand() & 63) + 1; \ ++ const int kHeight = (fastrand() & 31) + 1; \ ++ const int kHeightA = (kHeight + HEIGHT_A - 1) / HEIGHT_A * HEIGHT_A; \ ++ const int kHeightB = (kHeight + HEIGHT_B - 1) / HEIGHT_B * HEIGHT_B; \ ++ const int kStrideA = \ ++ (kWidth * EPP_A + STRIDE_A - 1) / STRIDE_A * STRIDE_A; \ ++ const int kStrideB = \ ++ (kWidth * EPP_B + STRIDE_B - 1) / STRIDE_B * STRIDE_B; \ ++ align_buffer_page_end(src_argb, kStrideA* kHeightA*(int)sizeof(TYPE_A)); \ ++ align_buffer_page_end(dst_argb_c, \ ++ kStrideB* kHeightB*(int)sizeof(TYPE_B)); \ ++ align_buffer_page_end(dst_argb_opt, \ ++ kStrideB* kHeightB*(int)sizeof(TYPE_B)); \ ++ for (int i = 0; i < kStrideA * kHeightA * (int)sizeof(TYPE_A); ++i) { \ ++ src_argb[i] = 0xfe; \ ++ } \ ++ memset(dst_argb_c, 123, kStrideB* kHeightB); \ ++ memset(dst_argb_opt, 123, kStrideB* kHeightB); \ ++ MaskCpuFlags(disable_cpu_flags_); \ ++ FMT_A##To##FMT_B((TYPE_A*)src_argb, kStrideA, (TYPE_B*)dst_argb_c, \ ++ kStrideB, kWidth, kHeight); \ ++ MaskCpuFlags(benchmark_cpu_info_); \ ++ FMT_A##To##FMT_B((TYPE_A*)src_argb, kStrideA, (TYPE_B*)dst_argb_opt, \ ++ kStrideB, kWidth, kHeight); \ ++ for (int i = 0; i < kStrideB * kHeightB * (int)sizeof(TYPE_B); ++i) { \ ++ EXPECT_EQ(dst_argb_c[i], dst_argb_opt[i]); \ ++ } \ ++ free_aligned_buffer_page_end(src_argb); \ ++ free_aligned_buffer_page_end(dst_argb_c); \ ++ free_aligned_buffer_page_end(dst_argb_opt); \ ++ } \ ++ } ++ ++#if defined(ENABLE_FULL_TESTS) ++#define TESTATOB(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, \ ++ EPP_B, STRIDE_B, HEIGHT_B) \ ++ TESTATOBI(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, EPP_B, \ ++ STRIDE_B, HEIGHT_B, benchmark_width_ + 1, _Any, +, 0) \ ++ TESTATOBI(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, EPP_B, \ ++ STRIDE_B, HEIGHT_B, benchmark_width_, _Unaligned, +, 4) \ ++ TESTATOBI(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, EPP_B, \ ++ STRIDE_B, HEIGHT_B, benchmark_width_, _Invert, -, 0) \ ++ TESTATOBI(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, EPP_B, \ ++ STRIDE_B, HEIGHT_B, benchmark_width_, _Opt, +, 0) \ ++ TESTATOBRANDOM(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, \ ++ EPP_B, STRIDE_B, HEIGHT_B) ++#else ++#define TESTATOB(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, \ ++ EPP_B, STRIDE_B, HEIGHT_B) \ ++ TESTATOBI(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, EPP_B, \ ++ STRIDE_B, HEIGHT_B, benchmark_width_, _Opt, +, 0) ++#endif ++ ++TESTATOB(AB30, uint8_t, 4, 4, 1, ABGR, uint8_t, 4, 4, 1) ++TESTATOB(AB30, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTATOB(ABGR, uint8_t, 4, 4, 1, AR30, uint8_t, 4, 4, 1) ++#endif ++TESTATOB(ABGR, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTATOB(AR30, uint8_t, 4, 4, 1, AB30, uint8_t, 4, 4, 1) ++#endif ++TESTATOB(AR30, uint8_t, 4, 4, 1, ABGR, uint8_t, 4, 4, 1) ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTATOB(AR30, uint8_t, 4, 4, 1, AR30, uint8_t, 4, 4, 1) ++TESTATOB(AR30, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) ++#endif ++TESTATOB(ARGB, uint8_t, 4, 4, 1, ABGR, uint8_t, 4, 4, 1) ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTATOB(ARGB, uint8_t, 4, 4, 1, AR30, uint8_t, 4, 4, 1) ++#endif ++TESTATOB(ARGB, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) ++TESTATOB(ARGB, uint8_t, 4, 4, 1, ARGB1555, uint8_t, 2, 2, 1) ++TESTATOB(ARGB, uint8_t, 4, 4, 1, ARGB4444, uint8_t, 2, 2, 1) ++TESTATOB(ARGB, uint8_t, 4, 4, 1, ARGBMirror, uint8_t, 4, 4, 1) ++TESTATOB(ARGB, uint8_t, 4, 4, 1, BGRA, uint8_t, 4, 4, 1) ++TESTATOB(ARGB, uint8_t, 4, 4, 1, I400, uint8_t, 1, 1, 1) ++TESTATOB(ARGB, uint8_t, 4, 4, 1, J400, uint8_t, 1, 1, 1) ++TESTATOB(ABGR, uint8_t, 4, 4, 1, J400, uint8_t, 1, 1, 1) ++TESTATOB(RGBA, uint8_t, 4, 4, 1, J400, uint8_t, 1, 1, 1) ++TESTATOB(ARGB, uint8_t, 4, 4, 1, RAW, uint8_t, 3, 3, 1) ++TESTATOB(ARGB, uint8_t, 4, 4, 1, RGB24, uint8_t, 3, 3, 1) ++TESTATOB(ABGR, uint8_t, 4, 4, 1, RAW, uint8_t, 3, 3, 1) ++TESTATOB(ABGR, uint8_t, 4, 4, 1, RGB24, uint8_t, 3, 3, 1) ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTATOB(ARGB, uint8_t, 4, 4, 1, RGB565, uint8_t, 2, 2, 1) ++#endif ++TESTATOB(ARGB, uint8_t, 4, 4, 1, RGBA, uint8_t, 4, 4, 1) ++TESTATOB(ARGB, uint8_t, 4, 4, 1, UYVY, uint8_t, 2, 4, 1) ++TESTATOB(ARGB, uint8_t, 4, 4, 1, YUY2, uint8_t, 2, 4, 1) ++TESTATOB(ARGB1555, uint8_t, 2, 2, 1, ARGB, uint8_t, 4, 4, 1) ++TESTATOB(ARGB4444, uint8_t, 2, 2, 1, ARGB, uint8_t, 4, 4, 1) ++TESTATOB(BGRA, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) ++TESTATOB(I400, uint8_t, 1, 1, 1, ARGB, uint8_t, 4, 4, 1) ++TESTATOB(I400, uint8_t, 1, 1, 1, I400, uint8_t, 1, 1, 1) ++TESTATOB(I400, uint8_t, 1, 1, 1, I400Mirror, uint8_t, 1, 1, 1) ++TESTATOB(J400, uint8_t, 1, 1, 1, ARGB, uint8_t, 4, 4, 1) ++TESTATOB(J400, uint8_t, 1, 1, 1, J400, uint8_t, 1, 1, 1) ++TESTATOB(RAW, uint8_t, 3, 3, 1, ARGB, uint8_t, 4, 4, 1) ++TESTATOB(RAW, uint8_t, 3, 3, 1, RGBA, uint8_t, 4, 4, 1) ++TESTATOB(RAW, uint8_t, 3, 3, 1, RGB24, uint8_t, 3, 3, 1) ++TESTATOB(RGB24, uint8_t, 3, 3, 1, ARGB, uint8_t, 4, 4, 1) ++TESTATOB(RGB24, uint8_t, 3, 3, 1, J400, uint8_t, 1, 1, 1) ++TESTATOB(RGB24, uint8_t, 3, 3, 1, RGB24Mirror, uint8_t, 3, 3, 1) ++TESTATOB(RAW, uint8_t, 3, 3, 1, J400, uint8_t, 1, 1, 1) ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTATOB(RGB565, uint8_t, 2, 2, 1, ARGB, uint8_t, 4, 4, 1) ++#endif ++TESTATOB(RGBA, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) ++TESTATOB(UYVY, uint8_t, 2, 4, 1, ARGB, uint8_t, 4, 4, 1) ++TESTATOB(YUY2, uint8_t, 2, 4, 1, ARGB, uint8_t, 4, 4, 1) ++TESTATOB(YUY2, uint8_t, 2, 4, 1, Y, uint8_t, 1, 1, 1) ++TESTATOB(ARGB, uint8_t, 4, 4, 1, AR64, uint16_t, 4, 4, 1) ++TESTATOB(ARGB, uint8_t, 4, 4, 1, AB64, uint16_t, 4, 4, 1) ++TESTATOB(ABGR, uint8_t, 4, 4, 1, AR64, uint16_t, 4, 4, 1) ++TESTATOB(ABGR, uint8_t, 4, 4, 1, AB64, uint16_t, 4, 4, 1) ++TESTATOB(AR64, uint16_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) ++TESTATOB(AB64, uint16_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) ++TESTATOB(AR64, uint16_t, 4, 4, 1, ABGR, uint8_t, 4, 4, 1) ++TESTATOB(AB64, uint16_t, 4, 4, 1, ABGR, uint8_t, 4, 4, 1) ++TESTATOB(AR64, uint16_t, 4, 4, 1, AB64, uint16_t, 4, 4, 1) ++TESTATOB(AB64, uint16_t, 4, 4, 1, AR64, uint16_t, 4, 4, 1) ++ ++// in place test ++#define TESTATOAI(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, \ ++ EPP_B, STRIDE_B, HEIGHT_B, W1280, N, NEG, OFF) \ ++ TEST_F(LibYUVConvertTest, FMT_A##To##FMT_B##N) { \ ++ const int kWidth = W1280; \ ++ const int kHeight = benchmark_height_; \ ++ const int kHeightA = (kHeight + HEIGHT_A - 1) / HEIGHT_A * HEIGHT_A; \ ++ const int kHeightB = (kHeight + HEIGHT_B - 1) / HEIGHT_B * HEIGHT_B; \ ++ const int kStrideA = \ ++ (kWidth * EPP_A + STRIDE_A - 1) / STRIDE_A * STRIDE_A; \ ++ const int kStrideB = \ ++ (kWidth * EPP_B + STRIDE_B - 1) / STRIDE_B * STRIDE_B; \ ++ align_buffer_page_end(src_argb, \ ++ kStrideA* kHeightA*(int)sizeof(TYPE_A) + OFF); \ ++ align_buffer_page_end(dst_argb_c, \ ++ kStrideA* kHeightA*(int)sizeof(TYPE_A) + OFF); \ ++ align_buffer_page_end(dst_argb_opt, \ ++ kStrideA* kHeightA*(int)sizeof(TYPE_A) + OFF); \ ++ for (int i = 0; i < kStrideA * kHeightA * (int)sizeof(TYPE_A); ++i) { \ ++ src_argb[i + OFF] = (fastrand() & 0xff); \ ++ } \ ++ memcpy(dst_argb_c + OFF, src_argb, \ ++ kStrideA * kHeightA * (int)sizeof(TYPE_A)); \ ++ memcpy(dst_argb_opt + OFF, src_argb, \ ++ kStrideA * kHeightA * (int)sizeof(TYPE_A)); \ ++ MaskCpuFlags(disable_cpu_flags_); \ ++ FMT_A##To##FMT_B((TYPE_A*)(dst_argb_c /* src */ + OFF), kStrideA, \ ++ (TYPE_B*)dst_argb_c, kStrideB, kWidth, NEG kHeight); \ ++ MaskCpuFlags(benchmark_cpu_info_); \ ++ for (int i = 0; i < benchmark_iterations_; ++i) { \ ++ FMT_A##To##FMT_B((TYPE_A*)(dst_argb_opt /* src */ + OFF), kStrideA, \ ++ (TYPE_B*)dst_argb_opt, kStrideB, kWidth, NEG kHeight); \ ++ } \ ++ memcpy(dst_argb_opt + OFF, src_argb, \ ++ kStrideA * kHeightA * (int)sizeof(TYPE_A)); \ ++ FMT_A##To##FMT_B((TYPE_A*)(dst_argb_opt /* src */ + OFF), kStrideA, \ ++ (TYPE_B*)dst_argb_opt, kStrideB, kWidth, NEG kHeight); \ ++ for (int i = 0; i < kStrideB * kHeightB * (int)sizeof(TYPE_B); ++i) { \ ++ EXPECT_EQ(dst_argb_c[i], dst_argb_opt[i]); \ ++ } \ ++ free_aligned_buffer_page_end(src_argb); \ ++ free_aligned_buffer_page_end(dst_argb_c); \ ++ free_aligned_buffer_page_end(dst_argb_opt); \ ++ } ++ ++#define TESTATOA(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, \ ++ EPP_B, STRIDE_B, HEIGHT_B) \ ++ TESTATOAI(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, EPP_B, \ ++ STRIDE_B, HEIGHT_B, benchmark_width_, _Inplace, +, 0) ++ ++TESTATOA(AB30, uint8_t, 4, 4, 1, ABGR, uint8_t, 4, 4, 1) ++TESTATOA(AB30, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTATOA(ABGR, uint8_t, 4, 4, 1, AR30, uint8_t, 4, 4, 1) ++#endif ++TESTATOA(ABGR, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTATOA(AR30, uint8_t, 4, 4, 1, AB30, uint8_t, 4, 4, 1) ++#endif ++TESTATOA(AR30, uint8_t, 4, 4, 1, ABGR, uint8_t, 4, 4, 1) ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTATOA(AR30, uint8_t, 4, 4, 1, AR30, uint8_t, 4, 4, 1) ++TESTATOA(AR30, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) ++#endif ++TESTATOA(ARGB, uint8_t, 4, 4, 1, ABGR, uint8_t, 4, 4, 1) ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTATOA(ARGB, uint8_t, 4, 4, 1, AR30, uint8_t, 4, 4, 1) ++#endif ++TESTATOA(ARGB, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) ++TESTATOA(ARGB, uint8_t, 4, 4, 1, ARGB1555, uint8_t, 2, 2, 1) ++TESTATOA(ARGB, uint8_t, 4, 4, 1, ARGB4444, uint8_t, 2, 2, 1) ++// TODO(fbarchard): Support in place for mirror. ++// TESTATOA(ARGB, uint8_t, 4, 4, 1, ARGBMirror, uint8_t, 4, 4, 1) ++TESTATOA(ARGB, uint8_t, 4, 4, 1, BGRA, uint8_t, 4, 4, 1) ++TESTATOA(ARGB, uint8_t, 4, 4, 1, I400, uint8_t, 1, 1, 1) ++TESTATOA(ARGB, uint8_t, 4, 4, 1, J400, uint8_t, 1, 1, 1) ++TESTATOA(RGBA, uint8_t, 4, 4, 1, J400, uint8_t, 1, 1, 1) ++TESTATOA(ARGB, uint8_t, 4, 4, 1, RAW, uint8_t, 3, 3, 1) ++TESTATOA(ARGB, uint8_t, 4, 4, 1, RGB24, uint8_t, 3, 3, 1) ++TESTATOA(ABGR, uint8_t, 4, 4, 1, RAW, uint8_t, 3, 3, 1) ++TESTATOA(ABGR, uint8_t, 4, 4, 1, RGB24, uint8_t, 3, 3, 1) ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTATOA(ARGB, uint8_t, 4, 4, 1, RGB565, uint8_t, 2, 2, 1) ++#endif ++TESTATOA(ARGB, uint8_t, 4, 4, 1, RGBA, uint8_t, 4, 4, 1) ++TESTATOA(ARGB, uint8_t, 4, 4, 1, UYVY, uint8_t, 2, 4, 1) ++TESTATOA(ARGB, uint8_t, 4, 4, 1, YUY2, uint8_t, 2, 4, 1) ++// TODO(fbarchard): Support in place for conversions that increase bpp. ++// TESTATOA(ARGB1555, uint8_t, 2, 2, 1, ARGB, uint8_t, 4, 4, 1) ++// TESTATOA(ARGB4444, uint8_t, 2, 2, 1, ARGB, uint8_t, 4, 4, 1) ++TESTATOA(BGRA, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) ++// TESTATOA(I400, uint8_t, 1, 1, 1, ARGB, uint8_t, 4, 4, 1) ++TESTATOA(I400, uint8_t, 1, 1, 1, I400, uint8_t, 1, 1, 1) ++// TESTATOA(I400, uint8_t, 1, 1, 1, I400Mirror, uint8_t, 1, 1, 1) ++// TESTATOA(J400, uint8_t, 1, 1, 1, ARGB, uint8_t, 4, 4, 1) ++TESTATOA(J400, uint8_t, 1, 1, 1, J400, uint8_t, 1, 1, 1) ++// TESTATOA(RAW, uint8_t, 3, 3, 1, ARGB, uint8_t, 4, 4, 1) ++// TESTATOA(RAW, uint8_t, 3, 3, 1, RGBA, uint8_t, 4, 4, 1) ++TESTATOA(RAW, uint8_t, 3, 3, 1, RGB24, uint8_t, 3, 3, 1) ++// TESTATOA(RGB24, uint8_t, 3, 3, 1, ARGB, uint8_t, 4, 4, 1) ++TESTATOA(RGB24, uint8_t, 3, 3, 1, J400, uint8_t, 1, 1, 1) ++// TESTATOA(RGB24, uint8_t, 3, 3, 1, RGB24Mirror, uint8_t, 3, 3, 1) ++TESTATOA(RAW, uint8_t, 3, 3, 1, J400, uint8_t, 1, 1, 1) ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++// TESTATOA(RGB565, uint8_t, 2, 2, 1, ARGB, uint8_t, 4, 4, 1) ++#endif ++TESTATOA(RGBA, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) ++// TESTATOA(UYVY, uint8_t, 2, 4, 1, ARGB, uint8_t, 4, 4, 1) ++// TESTATOA(YUY2, uint8_t, 2, 4, 1, ARGB, uint8_t, 4, 4, 1) ++TESTATOA(YUY2, uint8_t, 2, 4, 1, Y, uint8_t, 1, 1, 1) ++// TESTATOA(ARGB, uint8_t, 4, 4, 1, AR64, uint16_t, 4, 4, 1) ++// TESTATOA(ARGB, uint8_t, 4, 4, 1, AB64, uint16_t, 4, 4, 1) ++// TESTATOA(ABGR, uint8_t, 4, 4, 1, AR64, uint16_t, 4, 4, 1) ++// TESTATOA(ABGR, uint8_t, 4, 4, 1, AB64, uint16_t, 4, 4, 1) ++TESTATOA(AR64, uint16_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) ++TESTATOA(AB64, uint16_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) ++TESTATOA(AR64, uint16_t, 4, 4, 1, ABGR, uint8_t, 4, 4, 1) ++TESTATOA(AB64, uint16_t, 4, 4, 1, ABGR, uint8_t, 4, 4, 1) ++TESTATOA(AR64, uint16_t, 4, 4, 1, AB64, uint16_t, 4, 4, 1) ++TESTATOA(AB64, uint16_t, 4, 4, 1, AR64, uint16_t, 4, 4, 1) ++ ++#define TESTATOBDI(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, FMT_B, BPP_B, STRIDE_B, \ ++ HEIGHT_B, W1280, N, NEG, OFF) \ ++ TEST_F(LibYUVConvertTest, FMT_A##To##FMT_B##Dither##N) { \ ++ const int kWidth = W1280; \ ++ const int kHeight = benchmark_height_; \ ++ const int kHeightA = (kHeight + HEIGHT_A - 1) / HEIGHT_A * HEIGHT_A; \ ++ const int kHeightB = (kHeight + HEIGHT_B - 1) / HEIGHT_B * HEIGHT_B; \ ++ const int kStrideA = \ ++ (kWidth * BPP_A + STRIDE_A - 1) / STRIDE_A * STRIDE_A; \ ++ const int kStrideB = \ ++ (kWidth * BPP_B + STRIDE_B - 1) / STRIDE_B * STRIDE_B; \ ++ align_buffer_page_end(src_argb, kStrideA* kHeightA + OFF); \ ++ align_buffer_page_end(dst_argb_c, kStrideB* kHeightB); \ ++ align_buffer_page_end(dst_argb_opt, kStrideB* kHeightB); \ ++ for (int i = 0; i < kStrideA * kHeightA; ++i) { \ ++ src_argb[i + OFF] = (fastrand() & 0xff); \ ++ } \ ++ memset(dst_argb_c, 1, kStrideB* kHeightB); \ ++ memset(dst_argb_opt, 101, kStrideB* kHeightB); \ ++ MaskCpuFlags(disable_cpu_flags_); \ ++ FMT_A##To##FMT_B##Dither(src_argb + OFF, kStrideA, dst_argb_c, kStrideB, \ ++ NULL, kWidth, NEG kHeight); \ ++ MaskCpuFlags(benchmark_cpu_info_); \ ++ for (int i = 0; i < benchmark_iterations_; ++i) { \ ++ FMT_A##To##FMT_B##Dither(src_argb + OFF, kStrideA, dst_argb_opt, \ ++ kStrideB, NULL, kWidth, NEG kHeight); \ ++ } \ ++ for (int i = 0; i < kStrideB * kHeightB; ++i) { \ ++ EXPECT_EQ(dst_argb_c[i], dst_argb_opt[i]); \ ++ } \ ++ free_aligned_buffer_page_end(src_argb); \ ++ free_aligned_buffer_page_end(dst_argb_c); \ ++ free_aligned_buffer_page_end(dst_argb_opt); \ ++ } ++ ++#define TESTATOBDRANDOM(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, FMT_B, BPP_B, \ ++ STRIDE_B, HEIGHT_B) \ ++ TEST_F(LibYUVConvertTest, FMT_A##To##FMT_B##Dither_Random) { \ ++ for (int times = 0; times < benchmark_iterations_; ++times) { \ ++ const int kWidth = (fastrand() & 63) + 1; \ ++ const int kHeight = (fastrand() & 31) + 1; \ ++ const int kHeightA = (kHeight + HEIGHT_A - 1) / HEIGHT_A * HEIGHT_A; \ ++ const int kHeightB = (kHeight + HEIGHT_B - 1) / HEIGHT_B * HEIGHT_B; \ ++ const int kStrideA = \ ++ (kWidth * BPP_A + STRIDE_A - 1) / STRIDE_A * STRIDE_A; \ ++ const int kStrideB = \ ++ (kWidth * BPP_B + STRIDE_B - 1) / STRIDE_B * STRIDE_B; \ ++ align_buffer_page_end(src_argb, kStrideA* kHeightA); \ ++ align_buffer_page_end(dst_argb_c, kStrideB* kHeightB); \ ++ align_buffer_page_end(dst_argb_opt, kStrideB* kHeightB); \ ++ for (int i = 0; i < kStrideA * kHeightA; ++i) { \ ++ src_argb[i] = (fastrand() & 0xff); \ ++ } \ ++ memset(dst_argb_c, 123, kStrideB* kHeightB); \ ++ memset(dst_argb_opt, 123, kStrideB* kHeightB); \ ++ MaskCpuFlags(disable_cpu_flags_); \ ++ FMT_A##To##FMT_B##Dither(src_argb, kStrideA, dst_argb_c, kStrideB, NULL, \ ++ kWidth, kHeight); \ ++ MaskCpuFlags(benchmark_cpu_info_); \ ++ FMT_A##To##FMT_B##Dither(src_argb, kStrideA, dst_argb_opt, kStrideB, \ ++ NULL, kWidth, kHeight); \ ++ for (int i = 0; i < kStrideB * kHeightB; ++i) { \ ++ EXPECT_EQ(dst_argb_c[i], dst_argb_opt[i]); \ ++ } \ ++ free_aligned_buffer_page_end(src_argb); \ ++ free_aligned_buffer_page_end(dst_argb_c); \ ++ free_aligned_buffer_page_end(dst_argb_opt); \ ++ } \ ++ } ++ ++#define TESTATOBD(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, FMT_B, BPP_B, STRIDE_B, \ ++ HEIGHT_B) \ ++ TESTATOBDI(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, FMT_B, BPP_B, STRIDE_B, \ ++ HEIGHT_B, benchmark_width_ + 1, _Any, +, 0) \ ++ TESTATOBDI(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, FMT_B, BPP_B, STRIDE_B, \ ++ HEIGHT_B, benchmark_width_, _Unaligned, +, 2) \ ++ TESTATOBDI(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, FMT_B, BPP_B, STRIDE_B, \ ++ HEIGHT_B, benchmark_width_, _Invert, -, 0) \ ++ TESTATOBDI(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, FMT_B, BPP_B, STRIDE_B, \ ++ HEIGHT_B, benchmark_width_, _Opt, +, 0) \ ++ TESTATOBDRANDOM(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, FMT_B, BPP_B, STRIDE_B, \ ++ HEIGHT_B) ++ ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTATOBD(ARGB, 4, 4, 1, RGB565, 2, 2, 1) ++#endif ++ ++// These conversions called twice, produce the original result. ++// e.g. endian swap twice. ++#define TESTENDI(FMT_ATOB, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, W1280, N, NEG, \ ++ OFF) \ ++ TEST_F(LibYUVConvertTest, FMT_ATOB##_Endswap##N) { \ ++ const int kWidth = W1280; \ ++ const int kHeight = benchmark_height_; \ ++ const int kHeightA = (kHeight + HEIGHT_A - 1) / HEIGHT_A * HEIGHT_A; \ ++ const int kStrideA = \ ++ (kWidth * EPP_A + STRIDE_A - 1) / STRIDE_A * STRIDE_A; \ ++ align_buffer_page_end(src_argb, \ ++ kStrideA* kHeightA*(int)sizeof(TYPE_A) + OFF); \ ++ align_buffer_page_end(dst_argb_c, kStrideA* kHeightA*(int)sizeof(TYPE_A)); \ ++ align_buffer_page_end(dst_argb_opt, \ ++ kStrideA* kHeightA*(int)sizeof(TYPE_A)); \ ++ for (int i = 0; i < kStrideA * kHeightA * (int)sizeof(TYPE_A); ++i) { \ ++ src_argb[i + OFF] = (fastrand() & 0xff); \ ++ } \ ++ memset(dst_argb_c, 1, kStrideA* kHeightA); \ ++ memset(dst_argb_opt, 101, kStrideA* kHeightA); \ ++ MaskCpuFlags(disable_cpu_flags_); \ ++ FMT_ATOB((TYPE_A*)(src_argb + OFF), kStrideA, (TYPE_A*)dst_argb_c, \ ++ kStrideA, kWidth, NEG kHeight); \ ++ MaskCpuFlags(benchmark_cpu_info_); \ ++ for (int i = 0; i < benchmark_iterations_; ++i) { \ ++ FMT_ATOB((TYPE_A*)(src_argb + OFF), kStrideA, (TYPE_A*)dst_argb_opt, \ ++ kStrideA, kWidth, NEG kHeight); \ ++ } \ ++ MaskCpuFlags(disable_cpu_flags_); \ ++ FMT_ATOB((TYPE_A*)dst_argb_c, kStrideA, (TYPE_A*)dst_argb_c, kStrideA, \ ++ kWidth, NEG kHeight); \ ++ MaskCpuFlags(benchmark_cpu_info_); \ ++ FMT_ATOB((TYPE_A*)dst_argb_opt, kStrideA, (TYPE_A*)dst_argb_opt, kStrideA, \ ++ kWidth, NEG kHeight); \ ++ for (int i = 0; i < kStrideA * kHeightA * (int)sizeof(TYPE_A); ++i) { \ ++ EXPECT_EQ(src_argb[i + OFF], dst_argb_opt[i]); \ ++ EXPECT_EQ(dst_argb_c[i], dst_argb_opt[i]); \ ++ } \ ++ free_aligned_buffer_page_end(src_argb); \ ++ free_aligned_buffer_page_end(dst_argb_c); \ ++ free_aligned_buffer_page_end(dst_argb_opt); \ ++ } ++ ++#if defined(ENABLE_FULL_TESTS) ++#define TESTEND(FMT_ATOB, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A) \ ++ TESTENDI(FMT_ATOB, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, benchmark_width_ + 1, \ ++ _Any, +, 0) \ ++ TESTENDI(FMT_ATOB, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, benchmark_width_, \ ++ _Unaligned, +, 2) \ ++ TESTENDI(FMT_ATOB, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, benchmark_width_, \ ++ _Opt, +, 0) ++#else ++#define TESTEND(FMT_ATOB, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A) \ ++ TESTENDI(FMT_ATOB, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, benchmark_width_, \ ++ _Opt, +, 0) ++#endif ++ ++TESTEND(ARGBToBGRA, uint8_t, 4, 4, 1) ++TESTEND(ARGBToABGR, uint8_t, 4, 4, 1) ++TESTEND(BGRAToARGB, uint8_t, 4, 4, 1) ++TESTEND(ABGRToARGB, uint8_t, 4, 4, 1) ++TESTEND(AB64ToAR64, uint16_t, 4, 4, 1) + + #ifdef HAVE_JPEG + TEST_F(LibYUVConvertTest, ValidateJpeg) { +@@ -1263,9 +2209,6 @@ TEST_F(LibYUVConvertTest, TestMJPGToI420 + int half_height = (height + 1) / 2; + int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * + benchmark_height_ / (width * height); +- if (benchmark_iterations < 1) { +- benchmark_iterations = 1; +- } + + align_buffer_page_end(dst_y, width * height); + align_buffer_page_end(dst_u, half_width * half_height); +@@ -1300,9 +2243,6 @@ TEST_F(LibYUVConvertTest, TestMJPGToI420 + int half_height = (height + 1) / 2; + int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * + benchmark_height_ / (width * height); +- if (benchmark_iterations < 1) { +- benchmark_iterations = 1; +- } + + // Convert to NV21 + align_buffer_page_end(dst_y, width * height); +@@ -1362,9 +2302,6 @@ TEST_F(LibYUVConvertTest, TestMJPGToI420 + int half_height = (height + 1) / 2; + int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * + benchmark_height_ / (width * height); +- if (benchmark_iterations < 1) { +- benchmark_iterations = 1; +- } + + // Convert to NV12 + align_buffer_page_end(dst_y, width * height); +@@ -1424,9 +2361,6 @@ TEST_F(LibYUVConvertTest, TestMJPGToNV21 + int half_height = (height + 1) / 2; + int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * + benchmark_height_ / (width * height); +- if (benchmark_iterations < 1) { +- benchmark_iterations = 1; +- } + + align_buffer_page_end(dst_y, width * height); + align_buffer_page_end(dst_uv, half_width * half_height * 2); +@@ -1457,9 +2391,6 @@ TEST_F(LibYUVConvertTest, TestMJPGToNV12 + int half_height = (height + 1) / 2; + int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * + benchmark_height_ / (width * height); +- if (benchmark_iterations < 1) { +- benchmark_iterations = 1; +- } + + align_buffer_page_end(dst_y, width * height); + align_buffer_page_end(dst_uv, half_width * half_height * 2); +@@ -1495,9 +2426,6 @@ TEST_F(LibYUVConvertTest, DISABLED_TestM + int half_height = (height + 1) / 2; + int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * + benchmark_height_ / (width * height); +- if (benchmark_iterations < 1) { +- benchmark_iterations = 1; +- } + + align_buffer_page_end(dst_y, width * height); + align_buffer_page_end(dst_uv, half_width * half_height * 2); +@@ -1528,9 +2456,6 @@ TEST_F(LibYUVConvertTest, DISABLED_TestM + int half_height = (height + 1) / 2; + int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * + benchmark_height_ / (width * height); +- if (benchmark_iterations < 1) { +- benchmark_iterations = 1; +- } + + align_buffer_page_end(dst_y, width * height); + align_buffer_page_end(dst_uv, half_width * half_height * 2); +@@ -1565,9 +2490,6 @@ TEST_F(LibYUVConvertTest, TestMJPGToNV21 + int half_height = (height + 1) / 2; + int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * + benchmark_height_ / (width * height); +- if (benchmark_iterations < 1) { +- benchmark_iterations = 1; +- } + + align_buffer_page_end(dst_y, width * height); + align_buffer_page_end(dst_uv, half_width * half_height * 2); +@@ -1598,9 +2520,6 @@ TEST_F(LibYUVConvertTest, TestMJPGToNV12 + int half_height = (height + 1) / 2; + int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * + benchmark_height_ / (width * height); +- if (benchmark_iterations < 1) { +- benchmark_iterations = 1; +- } + + align_buffer_page_end(dst_y, width * height); + align_buffer_page_end(dst_uv, half_width * half_height * 2); +@@ -1635,9 +2554,6 @@ TEST_F(LibYUVConvertTest, TestMJPGToNV21 + int half_height = (height + 1) / 2; + int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * + benchmark_height_ / (width * height); +- if (benchmark_iterations < 1) { +- benchmark_iterations = 1; +- } + + align_buffer_page_end(dst_y, width * height); + align_buffer_page_end(dst_uv, half_width * half_height * 2); +@@ -1668,9 +2584,6 @@ TEST_F(LibYUVConvertTest, TestMJPGToNV12 + int half_height = (height + 1) / 2; + int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * + benchmark_height_ / (width * height); +- if (benchmark_iterations < 1) { +- benchmark_iterations = 1; +- } + + align_buffer_page_end(dst_y, width * height); + align_buffer_page_end(dst_uv, half_width * half_height * 2); +@@ -1703,9 +2616,6 @@ TEST_F(LibYUVConvertTest, TestMJPGToARGB + + int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * + benchmark_height_ / (width * height); +- if (benchmark_iterations < 1) { +- benchmark_iterations = 1; +- } + + align_buffer_page_end(dst_argb, width * height * 4); + for (int times = 0; times < benchmark_iterations; ++times) { +@@ -1944,6 +2854,157 @@ TEST_F(LibYUVConvertTest, I420CropOddY) + free_aligned_buffer_page_end(src_y); + } + ++TEST_F(LibYUVConvertTest, TestYToARGB) { ++ uint8_t y[32]; ++ uint8_t expectedg[32]; ++ for (int i = 0; i < 32; ++i) { ++ y[i] = i * 5 + 17; ++ expectedg[i] = static_cast((y[i] - 16) * 1.164f + 0.5f); ++ } ++ uint8_t argb[32 * 4]; ++ YToARGB(y, 0, argb, 0, 32, 1); ++ ++ for (int i = 0; i < 32; ++i) { ++ printf("%2d %d: %d <-> %d,%d,%d,%d\n", i, y[i], expectedg[i], ++ argb[i * 4 + 0], argb[i * 4 + 1], argb[i * 4 + 2], argb[i * 4 + 3]); ++ } ++ for (int i = 0; i < 32; ++i) { ++ EXPECT_EQ(expectedg[i], argb[i * 4 + 0]); ++ } ++} ++ ++static const uint8_t kNoDither4x4[16] = { ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++}; ++ ++TEST_F(LibYUVConvertTest, TestNoDither) { ++ align_buffer_page_end(src_argb, benchmark_width_ * benchmark_height_ * 4); ++ align_buffer_page_end(dst_rgb565, benchmark_width_ * benchmark_height_ * 2); ++ align_buffer_page_end(dst_rgb565dither, ++ benchmark_width_ * benchmark_height_ * 2); ++ MemRandomize(src_argb, benchmark_width_ * benchmark_height_ * 4); ++ MemRandomize(dst_rgb565, benchmark_width_ * benchmark_height_ * 2); ++ MemRandomize(dst_rgb565dither, benchmark_width_ * benchmark_height_ * 2); ++ ARGBToRGB565(src_argb, benchmark_width_ * 4, dst_rgb565, benchmark_width_ * 2, ++ benchmark_width_, benchmark_height_); ++ ARGBToRGB565Dither(src_argb, benchmark_width_ * 4, dst_rgb565dither, ++ benchmark_width_ * 2, kNoDither4x4, benchmark_width_, ++ benchmark_height_); ++ for (int i = 0; i < benchmark_width_ * benchmark_height_ * 2; ++i) { ++ EXPECT_EQ(dst_rgb565[i], dst_rgb565dither[i]); ++ } ++ ++ free_aligned_buffer_page_end(src_argb); ++ free_aligned_buffer_page_end(dst_rgb565); ++ free_aligned_buffer_page_end(dst_rgb565dither); ++} ++ ++// Ordered 4x4 dither for 888 to 565. Values from 0 to 7. ++static const uint8_t kDither565_4x4[16] = { ++ 0, 4, 1, 5, 6, 2, 7, 3, 1, 5, 0, 4, 7, 3, 6, 2, ++}; ++ ++TEST_F(LibYUVConvertTest, TestDither) { ++ align_buffer_page_end(src_argb, benchmark_width_ * benchmark_height_ * 4); ++ align_buffer_page_end(dst_rgb565, benchmark_width_ * benchmark_height_ * 2); ++ align_buffer_page_end(dst_rgb565dither, ++ benchmark_width_ * benchmark_height_ * 2); ++ align_buffer_page_end(dst_argb, benchmark_width_ * benchmark_height_ * 4); ++ align_buffer_page_end(dst_argbdither, ++ benchmark_width_ * benchmark_height_ * 4); ++ MemRandomize(src_argb, benchmark_width_ * benchmark_height_ * 4); ++ MemRandomize(dst_rgb565, benchmark_width_ * benchmark_height_ * 2); ++ MemRandomize(dst_rgb565dither, benchmark_width_ * benchmark_height_ * 2); ++ MemRandomize(dst_argb, benchmark_width_ * benchmark_height_ * 4); ++ MemRandomize(dst_argbdither, benchmark_width_ * benchmark_height_ * 4); ++ ARGBToRGB565(src_argb, benchmark_width_ * 4, dst_rgb565, benchmark_width_ * 2, ++ benchmark_width_, benchmark_height_); ++ ARGBToRGB565Dither(src_argb, benchmark_width_ * 4, dst_rgb565dither, ++ benchmark_width_ * 2, kDither565_4x4, benchmark_width_, ++ benchmark_height_); ++ RGB565ToARGB(dst_rgb565, benchmark_width_ * 2, dst_argb, benchmark_width_ * 4, ++ benchmark_width_, benchmark_height_); ++ RGB565ToARGB(dst_rgb565dither, benchmark_width_ * 2, dst_argbdither, ++ benchmark_width_ * 4, benchmark_width_, benchmark_height_); ++ ++ for (int i = 0; i < benchmark_width_ * benchmark_height_ * 4; ++i) { ++ EXPECT_NEAR(dst_argb[i], dst_argbdither[i], 9); ++ } ++ free_aligned_buffer_page_end(src_argb); ++ free_aligned_buffer_page_end(dst_rgb565); ++ free_aligned_buffer_page_end(dst_rgb565dither); ++ free_aligned_buffer_page_end(dst_argb); ++ free_aligned_buffer_page_end(dst_argbdither); ++} ++ ++#define TESTPLANARTOBID(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, W1280, N, NEG, OFF, FMT_C, BPP_C) \ ++ TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##Dither##N) { \ ++ const int kWidth = W1280; \ ++ const int kHeight = ALIGNINT(benchmark_height_, YALIGN); \ ++ const int kStrideB = ALIGNINT(kWidth * BPP_B, ALIGN); \ ++ const int kStrideUV = SUBSAMPLE(kWidth, SUBSAMP_X); \ ++ const int kSizeUV = kStrideUV * SUBSAMPLE(kHeight, SUBSAMP_Y); \ ++ align_buffer_page_end(src_y, kWidth* kHeight + OFF); \ ++ align_buffer_page_end(src_u, kSizeUV + OFF); \ ++ align_buffer_page_end(src_v, kSizeUV + OFF); \ ++ align_buffer_page_end(dst_argb_c, kStrideB* kHeight + OFF); \ ++ align_buffer_page_end(dst_argb_opt, kStrideB* kHeight + OFF); \ ++ for (int i = 0; i < kWidth * kHeight; ++i) { \ ++ src_y[i + OFF] = (fastrand() & 0xff); \ ++ } \ ++ for (int i = 0; i < kSizeUV; ++i) { \ ++ src_u[i + OFF] = (fastrand() & 0xff); \ ++ src_v[i + OFF] = (fastrand() & 0xff); \ ++ } \ ++ memset(dst_argb_c + OFF, 1, kStrideB * kHeight); \ ++ memset(dst_argb_opt + OFF, 101, kStrideB * kHeight); \ ++ MaskCpuFlags(disable_cpu_flags_); \ ++ FMT_PLANAR##To##FMT_B##Dither(src_y + OFF, kWidth, src_u + OFF, kStrideUV, \ ++ src_v + OFF, kStrideUV, dst_argb_c + OFF, \ ++ kStrideB, NULL, kWidth, NEG kHeight); \ ++ MaskCpuFlags(benchmark_cpu_info_); \ ++ for (int i = 0; i < benchmark_iterations_; ++i) { \ ++ FMT_PLANAR##To##FMT_B##Dither( \ ++ src_y + OFF, kWidth, src_u + OFF, kStrideUV, src_v + OFF, kStrideUV, \ ++ dst_argb_opt + OFF, kStrideB, NULL, kWidth, NEG kHeight); \ ++ } \ ++ /* Convert to ARGB so 565 is expanded to bytes that can be compared. */ \ ++ align_buffer_page_end(dst_argb32_c, kWidth* BPP_C* kHeight); \ ++ align_buffer_page_end(dst_argb32_opt, kWidth* BPP_C* kHeight); \ ++ memset(dst_argb32_c, 2, kWidth* BPP_C* kHeight); \ ++ memset(dst_argb32_opt, 102, kWidth* BPP_C* kHeight); \ ++ FMT_B##To##FMT_C(dst_argb_c + OFF, kStrideB, dst_argb32_c, kWidth * BPP_C, \ ++ kWidth, kHeight); \ ++ FMT_B##To##FMT_C(dst_argb_opt + OFF, kStrideB, dst_argb32_opt, \ ++ kWidth * BPP_C, kWidth, kHeight); \ ++ for (int i = 0; i < kWidth * BPP_C * kHeight; ++i) { \ ++ EXPECT_EQ(dst_argb32_c[i], dst_argb32_opt[i]); \ ++ } \ ++ free_aligned_buffer_page_end(src_y); \ ++ free_aligned_buffer_page_end(src_u); \ ++ free_aligned_buffer_page_end(src_v); \ ++ free_aligned_buffer_page_end(dst_argb_c); \ ++ free_aligned_buffer_page_end(dst_argb_opt); \ ++ free_aligned_buffer_page_end(dst_argb32_c); \ ++ free_aligned_buffer_page_end(dst_argb32_opt); \ ++ } ++ ++#define TESTPLANARTOBD(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, FMT_C, BPP_C) \ ++ TESTPLANARTOBID(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_ + 1, _Any, +, 0, FMT_C, BPP_C) \ ++ TESTPLANARTOBID(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_, _Unaligned, +, 2, FMT_C, BPP_C) \ ++ TESTPLANARTOBID(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_, _Invert, -, 0, FMT_C, BPP_C) \ ++ TESTPLANARTOBID(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_, _Opt, +, 0, FMT_C, BPP_C) ++ ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTPLANARTOBD(I420, 2, 2, RGB565, 2, 2, 1, ARGB, 4) ++#endif ++ + #define TESTPTOB(NAME, UYVYTOI420, UYVYTONV12) \ + TEST_F(LibYUVConvertTest, NAME) { \ + const int kWidth = benchmark_width_; \ +@@ -2049,6 +3110,1367 @@ TEST_F(LibYUVConvertTest, MM21ToYUY2) { + free_aligned_buffer_page_end(golden_yuyv); + } + ++// Transitive test. A to B to C is same as A to C. ++// Benchmarks A To B to C for comparison to 1 step, benchmarked elsewhere. ++#define TESTPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ ++ W1280, N, NEG, OFF, FMT_C, BPP_C) \ ++ TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##To##FMT_C##N) { \ ++ const int kWidth = W1280; \ ++ const int kHeight = benchmark_height_; \ ++ const int kStrideB = SUBSAMPLE(kWidth, SUB_B) * BPP_B; \ ++ const int kStrideUV = SUBSAMPLE(kWidth, SUBSAMP_X); \ ++ const int kSizeUV = kStrideUV * SUBSAMPLE(kHeight, SUBSAMP_Y); \ ++ align_buffer_page_end(src_y, kWidth* kHeight + OFF); \ ++ align_buffer_page_end(src_u, kSizeUV + OFF); \ ++ align_buffer_page_end(src_v, kSizeUV + OFF); \ ++ align_buffer_page_end(dst_argb_b, kStrideB* kHeight + OFF); \ ++ for (int i = 0; i < kWidth * kHeight; ++i) { \ ++ src_y[i + OFF] = (fastrand() & 0xff); \ ++ } \ ++ for (int i = 0; i < kSizeUV; ++i) { \ ++ src_u[i + OFF] = (fastrand() & 0xff); \ ++ src_v[i + OFF] = (fastrand() & 0xff); \ ++ } \ ++ memset(dst_argb_b + OFF, 1, kStrideB * kHeight); \ ++ FMT_PLANAR##To##FMT_B(src_y + OFF, kWidth, src_u + OFF, kStrideUV, \ ++ src_v + OFF, kStrideUV, dst_argb_b + OFF, kStrideB, \ ++ kWidth, NEG kHeight); \ ++ /* Convert to a 3rd format in 1 step and 2 steps and compare */ \ ++ const int kStrideC = kWidth * BPP_C; \ ++ align_buffer_page_end(dst_argb_c, kStrideC* kHeight + OFF); \ ++ align_buffer_page_end(dst_argb_bc, kStrideC* kHeight + OFF); \ ++ memset(dst_argb_c + OFF, 2, kStrideC * kHeight); \ ++ memset(dst_argb_bc + OFF, 3, kStrideC * kHeight); \ ++ for (int i = 0; i < benchmark_iterations_; ++i) { \ ++ FMT_PLANAR##To##FMT_C(src_y + OFF, kWidth, src_u + OFF, kStrideUV, \ ++ src_v + OFF, kStrideUV, dst_argb_c + OFF, \ ++ kStrideC, kWidth, NEG kHeight); \ ++ /* Convert B to C */ \ ++ FMT_B##To##FMT_C(dst_argb_b + OFF, kStrideB, dst_argb_bc + OFF, \ ++ kStrideC, kWidth, kHeight); \ ++ } \ ++ for (int i = 0; i < kStrideC * kHeight; ++i) { \ ++ EXPECT_EQ(dst_argb_c[i + OFF], dst_argb_bc[i + OFF]); \ ++ } \ ++ free_aligned_buffer_page_end(src_y); \ ++ free_aligned_buffer_page_end(src_u); \ ++ free_aligned_buffer_page_end(src_v); \ ++ free_aligned_buffer_page_end(dst_argb_b); \ ++ free_aligned_buffer_page_end(dst_argb_c); \ ++ free_aligned_buffer_page_end(dst_argb_bc); \ ++ } ++ ++#if defined(ENABLE_FULL_TESTS) ++#define TESTPLANARTOE(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ ++ FMT_C, BPP_C) \ ++ TESTPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ ++ benchmark_width_ + 1, _Any, +, 0, FMT_C, BPP_C) \ ++ TESTPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ ++ benchmark_width_, _Unaligned, +, 2, FMT_C, BPP_C) \ ++ TESTPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ ++ benchmark_width_, _Invert, -, 0, FMT_C, BPP_C) \ ++ TESTPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ ++ benchmark_width_, _Opt, +, 0, FMT_C, BPP_C) ++#else ++#define TESTPLANARTOE(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ ++ FMT_C, BPP_C) \ ++ TESTPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ ++ benchmark_width_, _Opt, +, 0, FMT_C, BPP_C) ++#endif ++ ++#if defined(ENABLE_FULL_TESTS) ++TESTPLANARTOE(I420, 2, 2, ABGR, 1, 4, ARGB, 4) ++TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, ABGR, 4) ++TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, RAW, 3) ++TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, RGB24, 3) ++TESTPLANARTOE(I420, 2, 2, BGRA, 1, 4, ARGB, 4) ++TESTPLANARTOE(I420, 2, 2, RAW, 1, 3, ARGB, 4) ++TESTPLANARTOE(I420, 2, 2, RAW, 1, 3, RGB24, 3) ++TESTPLANARTOE(I420, 2, 2, RGB24, 1, 3, ARGB, 4) ++TESTPLANARTOE(I420, 2, 2, RGB24, 1, 3, RAW, 3) ++TESTPLANARTOE(I420, 2, 2, RGBA, 1, 4, ARGB, 4) ++TESTPLANARTOE(H420, 2, 2, ABGR, 1, 4, ARGB, 4) ++TESTPLANARTOE(H420, 2, 2, ARGB, 1, 4, ABGR, 4) ++TESTPLANARTOE(H420, 2, 2, ARGB, 1, 4, RAW, 3) ++TESTPLANARTOE(H420, 2, 2, ARGB, 1, 4, RGB24, 3) ++TESTPLANARTOE(H420, 2, 2, RAW, 1, 3, ARGB, 4) ++TESTPLANARTOE(H420, 2, 2, RAW, 1, 3, RGB24, 3) ++TESTPLANARTOE(H420, 2, 2, RGB24, 1, 3, ARGB, 4) ++TESTPLANARTOE(H420, 2, 2, RGB24, 1, 3, RAW, 3) ++TESTPLANARTOE(J420, 2, 2, ABGR, 1, 4, ARGB, 4) ++TESTPLANARTOE(J420, 2, 2, ARGB, 1, 4, ARGB, 4) ++TESTPLANARTOE(U420, 2, 2, ABGR, 1, 4, ARGB, 4) ++TESTPLANARTOE(U420, 2, 2, ARGB, 1, 4, ARGB, 4) ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, RGB565, 2) ++TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, ARGB1555, 2) ++TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, ARGB4444, 2) ++TESTPLANARTOE(I422, 2, 1, ARGB, 1, 4, RGB565, 2) ++#endif ++TESTPLANARTOE(I422, 2, 1, ARGB, 1, 4, ABGR, 4) ++TESTPLANARTOE(I422, 2, 1, ABGR, 1, 4, ARGB, 4) ++TESTPLANARTOE(J422, 2, 1, ARGB, 1, 4, ARGB, 4) ++TESTPLANARTOE(J422, 2, 1, ABGR, 1, 4, ARGB, 4) ++TESTPLANARTOE(H422, 2, 1, ARGB, 1, 4, ARGB, 4) ++TESTPLANARTOE(H422, 2, 1, ABGR, 1, 4, ARGB, 4) ++TESTPLANARTOE(U422, 2, 1, ARGB, 1, 4, ARGB, 4) ++TESTPLANARTOE(U422, 2, 1, ABGR, 1, 4, ARGB, 4) ++TESTPLANARTOE(V422, 2, 1, ARGB, 1, 4, ARGB, 4) ++TESTPLANARTOE(V422, 2, 1, ABGR, 1, 4, ARGB, 4) ++TESTPLANARTOE(I422, 2, 1, BGRA, 1, 4, ARGB, 4) ++TESTPLANARTOE(I422, 2, 1, RGBA, 1, 4, ARGB, 4) ++TESTPLANARTOE(I444, 1, 1, ARGB, 1, 4, ABGR, 4) ++TESTPLANARTOE(I444, 1, 1, ABGR, 1, 4, ARGB, 4) ++TESTPLANARTOE(J444, 1, 1, ARGB, 1, 4, ARGB, 4) ++TESTPLANARTOE(J444, 1, 1, ABGR, 1, 4, ARGB, 4) ++TESTPLANARTOE(H444, 1, 1, ARGB, 1, 4, ARGB, 4) ++TESTPLANARTOE(H444, 1, 1, ABGR, 1, 4, ARGB, 4) ++TESTPLANARTOE(U444, 1, 1, ARGB, 1, 4, ARGB, 4) ++TESTPLANARTOE(U444, 1, 1, ABGR, 1, 4, ARGB, 4) ++TESTPLANARTOE(V444, 1, 1, ARGB, 1, 4, ARGB, 4) ++TESTPLANARTOE(V444, 1, 1, ABGR, 1, 4, ARGB, 4) ++TESTPLANARTOE(I420, 2, 2, YUY2, 2, 4, ARGB, 4) ++TESTPLANARTOE(I420, 2, 2, UYVY, 2, 4, ARGB, 4) ++TESTPLANARTOE(I422, 2, 1, YUY2, 2, 4, ARGB, 4) ++TESTPLANARTOE(I422, 2, 1, UYVY, 2, 4, ARGB, 4) ++#else ++TESTPLANARTOE(I420, 2, 2, ABGR, 1, 4, ARGB, 4) ++TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, ARGB1555, 2) ++TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, ARGB4444, 2) ++TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, RAW, 3) ++TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, RGB24, 3) ++TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, RGB565, 2) ++TESTPLANARTOE(I420, 2, 2, BGRA, 1, 4, ARGB, 4) ++TESTPLANARTOE(I420, 2, 2, RAW, 1, 3, ARGB, 4) ++TESTPLANARTOE(I420, 2, 2, RAW, 1, 3, RGB24, 3) ++TESTPLANARTOE(I420, 2, 2, RGB24, 1, 3, ARGB, 4) ++TESTPLANARTOE(I420, 2, 2, RGB24, 1, 3, RAW, 3) ++TESTPLANARTOE(I420, 2, 2, RGBA, 1, 4, ARGB, 4) ++TESTPLANARTOE(I420, 2, 2, UYVY, 2, 4, ARGB, 4) ++TESTPLANARTOE(I420, 2, 2, YUY2, 2, 4, ARGB, 4) ++TESTPLANARTOE(I422, 2, 1, ABGR, 1, 4, ARGB, 4) ++TESTPLANARTOE(I422, 2, 1, ARGB, 1, 4, RGB565, 2) ++TESTPLANARTOE(I422, 2, 1, BGRA, 1, 4, ARGB, 4) ++TESTPLANARTOE(I422, 2, 1, RGBA, 1, 4, ARGB, 4) ++TESTPLANARTOE(I422, 2, 1, UYVY, 2, 4, ARGB, 4) ++TESTPLANARTOE(I422, 2, 1, YUY2, 2, 4, ARGB, 4) ++TESTPLANARTOE(I444, 1, 1, ABGR, 1, 4, ARGB, 4) ++#endif ++ ++// Transitive test: Compare 1 step vs 2 step conversion for YUVA to ARGB. ++// Benchmark 2 step conversion for comparison to 1 step conversion. ++#define TESTQPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ ++ W1280, N, NEG, OFF, FMT_C, BPP_C, ATTEN) \ ++ TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##To##FMT_C##N) { \ ++ const int kWidth = W1280; \ ++ const int kHeight = benchmark_height_; \ ++ const int kStrideB = SUBSAMPLE(kWidth, SUB_B) * BPP_B; \ ++ const int kSizeUV = \ ++ SUBSAMPLE(kWidth, SUBSAMP_X) * SUBSAMPLE(kHeight, SUBSAMP_Y); \ ++ align_buffer_page_end(src_y, kWidth* kHeight + OFF); \ ++ align_buffer_page_end(src_u, kSizeUV + OFF); \ ++ align_buffer_page_end(src_v, kSizeUV + OFF); \ ++ align_buffer_page_end(src_a, kWidth* kHeight + OFF); \ ++ align_buffer_page_end(dst_argb_b, kStrideB* kHeight + OFF); \ ++ const int kStrideC = kWidth * BPP_C; \ ++ align_buffer_page_end(dst_argb_c, kStrideC* kHeight + OFF); \ ++ align_buffer_page_end(dst_argb_bc, kStrideC* kHeight + OFF); \ ++ memset(dst_argb_c + OFF, 2, kStrideC * kHeight); \ ++ memset(dst_argb_b + OFF, 1, kStrideB * kHeight); \ ++ memset(dst_argb_bc + OFF, 3, kStrideC * kHeight); \ ++ for (int i = 0; i < kWidth * kHeight; ++i) { \ ++ src_y[i + OFF] = (fastrand() & 0xff); \ ++ src_a[i + OFF] = (fastrand() & 0xff); \ ++ } \ ++ for (int i = 0; i < kSizeUV; ++i) { \ ++ src_u[i + OFF] = (fastrand() & 0xff); \ ++ src_v[i + OFF] = (fastrand() & 0xff); \ ++ } \ ++ for (int i = 0; i < benchmark_iterations_; ++i) { \ ++ /* Convert A to B */ \ ++ FMT_PLANAR##To##FMT_B( \ ++ src_y + OFF, kWidth, src_u + OFF, SUBSAMPLE(kWidth, SUBSAMP_X), \ ++ src_v + OFF, SUBSAMPLE(kWidth, SUBSAMP_X), src_a + OFF, kWidth, \ ++ dst_argb_b + OFF, kStrideB, kWidth, NEG kHeight, ATTEN); \ ++ /* Convert B to C */ \ ++ FMT_B##To##FMT_C(dst_argb_b + OFF, kStrideB, dst_argb_bc + OFF, \ ++ kStrideC, kWidth, kHeight); \ ++ } \ ++ /* Convert A to C */ \ ++ FMT_PLANAR##To##FMT_C( \ ++ src_y + OFF, kWidth, src_u + OFF, SUBSAMPLE(kWidth, SUBSAMP_X), \ ++ src_v + OFF, SUBSAMPLE(kWidth, SUBSAMP_X), src_a + OFF, kWidth, \ ++ dst_argb_c + OFF, kStrideC, kWidth, NEG kHeight, ATTEN); \ ++ for (int i = 0; i < kStrideC * kHeight; ++i) { \ ++ EXPECT_EQ(dst_argb_c[i + OFF], dst_argb_bc[i + OFF]); \ ++ } \ ++ free_aligned_buffer_page_end(src_y); \ ++ free_aligned_buffer_page_end(src_u); \ ++ free_aligned_buffer_page_end(src_v); \ ++ free_aligned_buffer_page_end(src_a); \ ++ free_aligned_buffer_page_end(dst_argb_b); \ ++ free_aligned_buffer_page_end(dst_argb_c); \ ++ free_aligned_buffer_page_end(dst_argb_bc); \ ++ } ++ ++#if defined(ENABLE_FULL_TESTS) ++#define TESTQPLANARTOE(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ ++ FMT_C, BPP_C) \ ++ TESTQPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ ++ benchmark_width_ + 1, _Any, +, 0, FMT_C, BPP_C, 0) \ ++ TESTQPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ ++ benchmark_width_, _Unaligned, +, 2, FMT_C, BPP_C, 0) \ ++ TESTQPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ ++ benchmark_width_, _Invert, -, 0, FMT_C, BPP_C, 0) \ ++ TESTQPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ ++ benchmark_width_, _Opt, +, 0, FMT_C, BPP_C, 0) \ ++ TESTQPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ ++ benchmark_width_, _Premult, +, 0, FMT_C, BPP_C, 1) ++#else ++#define TESTQPLANARTOE(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ ++ FMT_C, BPP_C) \ ++ TESTQPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ ++ benchmark_width_, _Opt, +, 0, FMT_C, BPP_C, 0) ++#endif ++ ++#if defined(ENABLE_FULL_TESTS) ++TESTQPLANARTOE(I420Alpha, 2, 2, ARGB, 1, 4, ABGR, 4) ++TESTQPLANARTOE(I420Alpha, 2, 2, ABGR, 1, 4, ARGB, 4) ++TESTQPLANARTOE(J420Alpha, 2, 2, ARGB, 1, 4, ABGR, 4) ++TESTQPLANARTOE(J420Alpha, 2, 2, ABGR, 1, 4, ARGB, 4) ++TESTQPLANARTOE(H420Alpha, 2, 2, ARGB, 1, 4, ABGR, 4) ++TESTQPLANARTOE(H420Alpha, 2, 2, ABGR, 1, 4, ARGB, 4) ++TESTQPLANARTOE(F420Alpha, 2, 2, ARGB, 1, 4, ABGR, 4) ++TESTQPLANARTOE(F420Alpha, 2, 2, ABGR, 1, 4, ARGB, 4) ++TESTQPLANARTOE(U420Alpha, 2, 2, ARGB, 1, 4, ABGR, 4) ++TESTQPLANARTOE(U420Alpha, 2, 2, ABGR, 1, 4, ARGB, 4) ++TESTQPLANARTOE(V420Alpha, 2, 2, ARGB, 1, 4, ABGR, 4) ++TESTQPLANARTOE(V420Alpha, 2, 2, ABGR, 1, 4, ARGB, 4) ++TESTQPLANARTOE(I422Alpha, 2, 1, ARGB, 1, 4, ABGR, 4) ++TESTQPLANARTOE(I422Alpha, 2, 1, ABGR, 1, 4, ARGB, 4) ++TESTQPLANARTOE(J422Alpha, 2, 1, ARGB, 1, 4, ABGR, 4) ++TESTQPLANARTOE(J422Alpha, 2, 1, ABGR, 1, 4, ARGB, 4) ++TESTQPLANARTOE(F422Alpha, 2, 1, ARGB, 1, 4, ABGR, 4) ++TESTQPLANARTOE(F422Alpha, 2, 1, ABGR, 1, 4, ARGB, 4) ++TESTQPLANARTOE(H422Alpha, 2, 1, ARGB, 1, 4, ABGR, 4) ++TESTQPLANARTOE(H422Alpha, 2, 1, ABGR, 1, 4, ARGB, 4) ++TESTQPLANARTOE(U422Alpha, 2, 1, ARGB, 1, 4, ABGR, 4) ++TESTQPLANARTOE(U422Alpha, 2, 1, ABGR, 1, 4, ARGB, 4) ++TESTQPLANARTOE(V422Alpha, 2, 1, ARGB, 1, 4, ABGR, 4) ++TESTQPLANARTOE(V422Alpha, 2, 1, ABGR, 1, 4, ARGB, 4) ++TESTQPLANARTOE(I444Alpha, 1, 1, ARGB, 1, 4, ABGR, 4) ++TESTQPLANARTOE(I444Alpha, 1, 1, ABGR, 1, 4, ARGB, 4) ++TESTQPLANARTOE(J444Alpha, 1, 1, ARGB, 1, 4, ABGR, 4) ++TESTQPLANARTOE(J444Alpha, 1, 1, ABGR, 1, 4, ARGB, 4) ++TESTQPLANARTOE(H444Alpha, 1, 1, ARGB, 1, 4, ABGR, 4) ++TESTQPLANARTOE(H444Alpha, 1, 1, ABGR, 1, 4, ARGB, 4) ++TESTQPLANARTOE(U444Alpha, 1, 1, ARGB, 1, 4, ABGR, 4) ++TESTQPLANARTOE(U444Alpha, 1, 1, ABGR, 1, 4, ARGB, 4) ++TESTQPLANARTOE(V444Alpha, 1, 1, ARGB, 1, 4, ABGR, 4) ++TESTQPLANARTOE(V444Alpha, 1, 1, ABGR, 1, 4, ARGB, 4) ++#else ++TESTQPLANARTOE(I420Alpha, 2, 2, ABGR, 1, 4, ARGB, 4) ++TESTQPLANARTOE(I422Alpha, 2, 1, ABGR, 1, 4, ARGB, 4) ++TESTQPLANARTOE(I444Alpha, 1, 1, ABGR, 1, 4, ARGB, 4) ++#endif ++ ++#define TESTPLANETOEI(FMT_A, SUB_A, BPP_A, FMT_B, SUB_B, BPP_B, W1280, N, NEG, \ ++ OFF, FMT_C, BPP_C) \ ++ TEST_F(LibYUVConvertTest, FMT_A##To##FMT_B##To##FMT_C##N) { \ ++ const int kWidth = W1280; \ ++ const int kHeight = benchmark_height_; \ ++ const int kStrideA = SUBSAMPLE(kWidth, SUB_A) * BPP_A; \ ++ const int kStrideB = SUBSAMPLE(kWidth, SUB_B) * BPP_B; \ ++ align_buffer_page_end(src_argb_a, kStrideA* kHeight + OFF); \ ++ align_buffer_page_end(dst_argb_b, kStrideB* kHeight + OFF); \ ++ MemRandomize(src_argb_a + OFF, kStrideA * kHeight); \ ++ memset(dst_argb_b + OFF, 1, kStrideB * kHeight); \ ++ FMT_A##To##FMT_B(src_argb_a + OFF, kStrideA, dst_argb_b + OFF, kStrideB, \ ++ kWidth, NEG kHeight); \ ++ /* Convert to a 3rd format in 1 step and 2 steps and compare */ \ ++ const int kStrideC = kWidth * BPP_C; \ ++ align_buffer_page_end(dst_argb_c, kStrideC* kHeight + OFF); \ ++ align_buffer_page_end(dst_argb_bc, kStrideC* kHeight + OFF); \ ++ memset(dst_argb_c + OFF, 2, kStrideC * kHeight); \ ++ memset(dst_argb_bc + OFF, 3, kStrideC * kHeight); \ ++ for (int i = 0; i < benchmark_iterations_; ++i) { \ ++ FMT_A##To##FMT_C(src_argb_a + OFF, kStrideA, dst_argb_c + OFF, kStrideC, \ ++ kWidth, NEG kHeight); \ ++ /* Convert B to C */ \ ++ FMT_B##To##FMT_C(dst_argb_b + OFF, kStrideB, dst_argb_bc + OFF, \ ++ kStrideC, kWidth, kHeight); \ ++ } \ ++ for (int i = 0; i < kStrideC * kHeight; i += 4) { \ ++ EXPECT_EQ(dst_argb_c[i + OFF + 0], dst_argb_bc[i + OFF + 0]); \ ++ EXPECT_EQ(dst_argb_c[i + OFF + 1], dst_argb_bc[i + OFF + 1]); \ ++ EXPECT_EQ(dst_argb_c[i + OFF + 2], dst_argb_bc[i + OFF + 2]); \ ++ EXPECT_NEAR(dst_argb_c[i + OFF + 3], dst_argb_bc[i + OFF + 3], 64); \ ++ } \ ++ free_aligned_buffer_page_end(src_argb_a); \ ++ free_aligned_buffer_page_end(dst_argb_b); \ ++ free_aligned_buffer_page_end(dst_argb_c); \ ++ free_aligned_buffer_page_end(dst_argb_bc); \ ++ } ++ ++#define TESTPLANETOE(FMT_A, SUB_A, BPP_A, FMT_B, SUB_B, BPP_B, FMT_C, BPP_C) \ ++ TESTPLANETOEI(FMT_A, SUB_A, BPP_A, FMT_B, SUB_B, BPP_B, \ ++ benchmark_width_ + 1, _Any, +, 0, FMT_C, BPP_C) \ ++ TESTPLANETOEI(FMT_A, SUB_A, BPP_A, FMT_B, SUB_B, BPP_B, benchmark_width_, \ ++ _Unaligned, +, 4, FMT_C, BPP_C) \ ++ TESTPLANETOEI(FMT_A, SUB_A, BPP_A, FMT_B, SUB_B, BPP_B, benchmark_width_, \ ++ _Invert, -, 0, FMT_C, BPP_C) \ ++ TESTPLANETOEI(FMT_A, SUB_A, BPP_A, FMT_B, SUB_B, BPP_B, benchmark_width_, \ ++ _Opt, +, 0, FMT_C, BPP_C) ++ ++// Caveat: Destination needs to be 4 bytes ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTPLANETOE(ARGB, 1, 4, AR30, 1, 4, ARGB, 4) ++TESTPLANETOE(ABGR, 1, 4, AR30, 1, 4, ABGR, 4) ++TESTPLANETOE(AR30, 1, 4, ARGB, 1, 4, ABGR, 4) ++TESTPLANETOE(AR30, 1, 4, ABGR, 1, 4, ARGB, 4) ++TESTPLANETOE(ARGB, 1, 4, AB30, 1, 4, ARGB, 4) ++TESTPLANETOE(ABGR, 1, 4, AB30, 1, 4, ABGR, 4) ++TESTPLANETOE(AB30, 1, 4, ARGB, 1, 4, ABGR, 4) ++TESTPLANETOE(AB30, 1, 4, ABGR, 1, 4, ARGB, 4) ++#endif ++ ++TEST_F(LibYUVConvertTest, RotateWithARGBSource) { ++ // 2x2 frames ++ uint32_t src[4]; ++ uint32_t dst[4]; ++ // some random input ++ src[0] = 0x11000000; ++ src[1] = 0x00450000; ++ src[2] = 0x00009f00; ++ src[3] = 0x000000ff; ++ // zeros on destination ++ dst[0] = 0x00000000; ++ dst[1] = 0x00000000; ++ dst[2] = 0x00000000; ++ dst[3] = 0x00000000; ++ ++ int r = ConvertToARGB(reinterpret_cast(src), ++ 16, // input size ++ reinterpret_cast(dst), ++ 8, // destination stride ++ 0, // crop_x ++ 0, // crop_y ++ 2, // width ++ 2, // height ++ 2, // crop width ++ 2, // crop height ++ kRotate90, FOURCC_ARGB); ++ ++ EXPECT_EQ(r, 0); ++ // 90 degrees rotation, no conversion ++ EXPECT_EQ(dst[0], src[2]); ++ EXPECT_EQ(dst[1], src[0]); ++ EXPECT_EQ(dst[2], src[3]); ++ EXPECT_EQ(dst[3], src[1]); ++} ++ ++#ifdef HAS_ARGBTOAR30ROW_AVX2 ++TEST_F(LibYUVConvertTest, ARGBToAR30Row_Opt) { ++ // ARGBToAR30Row_AVX2 expects a multiple of 8 pixels. ++ const int kPixels = (benchmark_width_ * benchmark_height_ + 7) & ~7; ++ align_buffer_page_end(src, kPixels * 4); ++ align_buffer_page_end(dst_opt, kPixels * 4); ++ align_buffer_page_end(dst_c, kPixels * 4); ++ MemRandomize(src, kPixels * 4); ++ memset(dst_opt, 0, kPixels * 4); ++ memset(dst_c, 1, kPixels * 4); ++ ++ ARGBToAR30Row_C(src, dst_c, kPixels); ++ ++ int has_avx2 = TestCpuFlag(kCpuHasAVX2); ++ int has_ssse3 = TestCpuFlag(kCpuHasSSSE3); ++ for (int i = 0; i < benchmark_iterations_; ++i) { ++ if (has_avx2) { ++ ARGBToAR30Row_AVX2(src, dst_opt, kPixels); ++ } else if (has_ssse3) { ++ ARGBToAR30Row_SSSE3(src, dst_opt, kPixels); ++ } else { ++ ARGBToAR30Row_C(src, dst_opt, kPixels); ++ } ++ } ++ for (int i = 0; i < kPixels * 4; ++i) { ++ EXPECT_EQ(dst_opt[i], dst_c[i]); ++ } ++ ++ free_aligned_buffer_page_end(src); ++ free_aligned_buffer_page_end(dst_opt); ++ free_aligned_buffer_page_end(dst_c); ++} ++#endif // HAS_ARGBTOAR30ROW_AVX2 ++ ++#ifdef HAS_ABGRTOAR30ROW_AVX2 ++TEST_F(LibYUVConvertTest, ABGRToAR30Row_Opt) { ++ // ABGRToAR30Row_AVX2 expects a multiple of 8 pixels. ++ const int kPixels = (benchmark_width_ * benchmark_height_ + 7) & ~7; ++ align_buffer_page_end(src, kPixels * 4); ++ align_buffer_page_end(dst_opt, kPixels * 4); ++ align_buffer_page_end(dst_c, kPixels * 4); ++ MemRandomize(src, kPixels * 4); ++ memset(dst_opt, 0, kPixels * 4); ++ memset(dst_c, 1, kPixels * 4); ++ ++ ABGRToAR30Row_C(src, dst_c, kPixels); ++ ++ int has_avx2 = TestCpuFlag(kCpuHasAVX2); ++ int has_ssse3 = TestCpuFlag(kCpuHasSSSE3); ++ for (int i = 0; i < benchmark_iterations_; ++i) { ++ if (has_avx2) { ++ ABGRToAR30Row_AVX2(src, dst_opt, kPixels); ++ } else if (has_ssse3) { ++ ABGRToAR30Row_SSSE3(src, dst_opt, kPixels); ++ } else { ++ ABGRToAR30Row_C(src, dst_opt, kPixels); ++ } ++ } ++ for (int i = 0; i < kPixels * 4; ++i) { ++ EXPECT_EQ(dst_opt[i], dst_c[i]); ++ } ++ ++ free_aligned_buffer_page_end(src); ++ free_aligned_buffer_page_end(dst_opt); ++ free_aligned_buffer_page_end(dst_c); ++} ++#endif // HAS_ABGRTOAR30ROW_AVX2 ++ ++// Provide matrix wrappers for 12 bit YUV ++#define I012ToARGB(a, b, c, d, e, f, g, h, i, j) \ ++ I012ToARGBMatrix(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j) ++#define I012ToAR30(a, b, c, d, e, f, g, h, i, j) \ ++ I012ToAR30Matrix(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j) ++ ++#define I410ToARGB(a, b, c, d, e, f, g, h, i, j) \ ++ I410ToARGBMatrix(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j) ++#define I410ToABGR(a, b, c, d, e, f, g, h, i, j) \ ++ I410ToABGRMatrix(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j) ++#define H410ToARGB(a, b, c, d, e, f, g, h, i, j) \ ++ I410ToARGBMatrix(a, b, c, d, e, f, g, h, &kYuvH709Constants, i, j) ++#define H410ToABGR(a, b, c, d, e, f, g, h, i, j) \ ++ I410ToABGRMatrix(a, b, c, d, e, f, g, h, &kYuvH709Constants, i, j) ++#define U410ToARGB(a, b, c, d, e, f, g, h, i, j) \ ++ I410ToARGBMatrix(a, b, c, d, e, f, g, h, &kYuv2020Constants, i, j) ++#define U410ToABGR(a, b, c, d, e, f, g, h, i, j) \ ++ I410ToABGRMatrix(a, b, c, d, e, f, g, h, &kYuv2020Constants, i, j) ++#define I410ToAR30(a, b, c, d, e, f, g, h, i, j) \ ++ I410ToAR30Matrix(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j) ++#define I410ToAB30(a, b, c, d, e, f, g, h, i, j) \ ++ I410ToAB30Matrix(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j) ++#define H410ToAR30(a, b, c, d, e, f, g, h, i, j) \ ++ I410ToAR30Matrix(a, b, c, d, e, f, g, h, &kYuvH709Constants, i, j) ++#define H410ToAB30(a, b, c, d, e, f, g, h, i, j) \ ++ I410ToAB30Matrix(a, b, c, d, e, f, g, h, &kYuvH709Constants, i, j) ++#define U410ToAR30(a, b, c, d, e, f, g, h, i, j) \ ++ I410ToAR30Matrix(a, b, c, d, e, f, g, h, &kYuv2020Constants, i, j) ++#define U410ToAB30(a, b, c, d, e, f, g, h, i, j) \ ++ I410ToAB30Matrix(a, b, c, d, e, f, g, h, &kYuv2020Constants, i, j) ++ ++#define I010ToARGBFilter(a, b, c, d, e, f, g, h, i, j) \ ++ I010ToARGBMatrixFilter(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j, \ ++ kFilterBilinear) ++#define I010ToAR30Filter(a, b, c, d, e, f, g, h, i, j) \ ++ I010ToAR30MatrixFilter(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j, \ ++ kFilterBilinear) ++#define I210ToARGBFilter(a, b, c, d, e, f, g, h, i, j) \ ++ I210ToARGBMatrixFilter(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j, \ ++ kFilterBilinear) ++#define I210ToAR30Filter(a, b, c, d, e, f, g, h, i, j) \ ++ I210ToAR30MatrixFilter(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j, \ ++ kFilterBilinear) ++ ++// TODO(fbarchard): Fix clamping issue affected by U channel. ++#define TESTPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_MASK, FMT_B, \ ++ BPP_B, ALIGN, YALIGN, W1280, N, NEG, SOFF, DOFF) \ ++ TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##N) { \ ++ const int kWidth = W1280; \ ++ const int kHeight = ALIGNINT(benchmark_height_, YALIGN); \ ++ const int kStrideB = ALIGNINT(kWidth * BPP_B, ALIGN); \ ++ const int kStrideUV = SUBSAMPLE(kWidth, SUBSAMP_X); \ ++ const int kSizeUV = kStrideUV * SUBSAMPLE(kHeight, SUBSAMP_Y); \ ++ const int kBpc = 2; \ ++ align_buffer_page_end(src_y, kWidth* kHeight* kBpc + SOFF); \ ++ align_buffer_page_end(src_u, kSizeUV* kBpc + SOFF); \ ++ align_buffer_page_end(src_v, kSizeUV* kBpc + SOFF); \ ++ align_buffer_page_end(dst_argb_c, kStrideB* kHeight + DOFF); \ ++ align_buffer_page_end(dst_argb_opt, kStrideB* kHeight + DOFF); \ ++ for (int i = 0; i < kWidth * kHeight; ++i) { \ ++ reinterpret_cast(src_y + SOFF)[i] = (fastrand() & FMT_MASK); \ ++ } \ ++ for (int i = 0; i < kSizeUV; ++i) { \ ++ reinterpret_cast(src_u + SOFF)[i] = (fastrand() & FMT_MASK); \ ++ reinterpret_cast(src_v + SOFF)[i] = (fastrand() & FMT_MASK); \ ++ } \ ++ memset(dst_argb_c + DOFF, 1, kStrideB * kHeight); \ ++ memset(dst_argb_opt + DOFF, 101, kStrideB * kHeight); \ ++ MaskCpuFlags(disable_cpu_flags_); \ ++ FMT_PLANAR##To##FMT_B( \ ++ reinterpret_cast(src_y + SOFF), kWidth, \ ++ reinterpret_cast(src_u + SOFF), kStrideUV, \ ++ reinterpret_cast(src_v + SOFF), kStrideUV, \ ++ dst_argb_c + DOFF, kStrideB, kWidth, NEG kHeight); \ ++ MaskCpuFlags(benchmark_cpu_info_); \ ++ for (int i = 0; i < benchmark_iterations_; ++i) { \ ++ FMT_PLANAR##To##FMT_B( \ ++ reinterpret_cast(src_y + SOFF), kWidth, \ ++ reinterpret_cast(src_u + SOFF), kStrideUV, \ ++ reinterpret_cast(src_v + SOFF), kStrideUV, \ ++ dst_argb_opt + DOFF, kStrideB, kWidth, NEG kHeight); \ ++ } \ ++ for (int i = 0; i < kWidth * BPP_B * kHeight; ++i) { \ ++ EXPECT_EQ(dst_argb_c[i + DOFF], dst_argb_opt[i + DOFF]); \ ++ } \ ++ free_aligned_buffer_page_end(src_y); \ ++ free_aligned_buffer_page_end(src_u); \ ++ free_aligned_buffer_page_end(src_v); \ ++ free_aligned_buffer_page_end(dst_argb_c); \ ++ free_aligned_buffer_page_end(dst_argb_opt); \ ++ } ++ ++#define TESTPLANAR16TOB(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_MASK, FMT_B, \ ++ BPP_B, ALIGN, YALIGN) \ ++ TESTPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_MASK, FMT_B, BPP_B, \ ++ ALIGN, YALIGN, benchmark_width_ + 1, _Any, +, 0, 0) \ ++ TESTPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_MASK, FMT_B, BPP_B, \ ++ ALIGN, YALIGN, benchmark_width_, _Unaligned, +, 4, 4) \ ++ TESTPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_MASK, FMT_B, BPP_B, \ ++ ALIGN, YALIGN, benchmark_width_, _Invert, -, 0, 0) \ ++ TESTPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_MASK, FMT_B, BPP_B, \ ++ ALIGN, YALIGN, benchmark_width_, _Opt, +, 0, 0) ++ ++// These conversions are only optimized for x86 ++#if !defined(DISABLE_SLOW_TESTS) || defined(__x86_64__) || defined(__i386__) ++TESTPLANAR16TOB(I010, 2, 2, 0x3ff, ARGB, 4, 4, 1) ++TESTPLANAR16TOB(I010, 2, 2, 0x3ff, ABGR, 4, 4, 1) ++TESTPLANAR16TOB(H010, 2, 2, 0x3ff, ARGB, 4, 4, 1) ++TESTPLANAR16TOB(H010, 2, 2, 0x3ff, ABGR, 4, 4, 1) ++TESTPLANAR16TOB(U010, 2, 2, 0x3ff, ARGB, 4, 4, 1) ++TESTPLANAR16TOB(U010, 2, 2, 0x3ff, ABGR, 4, 4, 1) ++TESTPLANAR16TOB(I210, 2, 1, 0x3ff, ARGB, 4, 4, 1) ++TESTPLANAR16TOB(I210, 2, 1, 0x3ff, ABGR, 4, 4, 1) ++TESTPLANAR16TOB(H210, 2, 1, 0x3ff, ARGB, 4, 4, 1) ++TESTPLANAR16TOB(H210, 2, 1, 0x3ff, ABGR, 4, 4, 1) ++TESTPLANAR16TOB(U210, 2, 1, 0x3ff, ARGB, 4, 4, 1) ++TESTPLANAR16TOB(U210, 2, 1, 0x3ff, ABGR, 4, 4, 1) ++TESTPLANAR16TOB(I410, 1, 1, 0x3ff, ARGB, 4, 4, 1) ++TESTPLANAR16TOB(I410, 1, 1, 0x3ff, ABGR, 4, 4, 1) ++TESTPLANAR16TOB(H410, 1, 1, 0x3ff, ARGB, 4, 4, 1) ++TESTPLANAR16TOB(H410, 1, 1, 0x3ff, ABGR, 4, 4, 1) ++TESTPLANAR16TOB(U410, 1, 1, 0x3ff, ARGB, 4, 4, 1) ++TESTPLANAR16TOB(U410, 1, 1, 0x3ff, ABGR, 4, 4, 1) ++TESTPLANAR16TOB(I012, 2, 2, 0xfff, ARGB, 4, 4, 1) ++TESTPLANAR16TOB(I010, 2, 2, 0x3ff, ARGBFilter, 4, 4, 1) ++TESTPLANAR16TOB(I210, 2, 1, 0x3ff, ARGBFilter, 4, 4, 1) ++ ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTPLANAR16TOB(I010, 2, 2, 0x3ff, AR30, 4, 4, 1) ++TESTPLANAR16TOB(I010, 2, 2, 0x3ff, AB30, 4, 4, 1) ++TESTPLANAR16TOB(H010, 2, 2, 0x3ff, AR30, 4, 4, 1) ++TESTPLANAR16TOB(H010, 2, 2, 0x3ff, AB30, 4, 4, 1) ++TESTPLANAR16TOB(U010, 2, 2, 0x3ff, AR30, 4, 4, 1) ++TESTPLANAR16TOB(U010, 2, 2, 0x3ff, AB30, 4, 4, 1) ++TESTPLANAR16TOB(I210, 2, 1, 0x3ff, AR30, 4, 4, 1) ++TESTPLANAR16TOB(I210, 2, 1, 0x3ff, AB30, 4, 4, 1) ++TESTPLANAR16TOB(H210, 2, 1, 0x3ff, AR30, 4, 4, 1) ++TESTPLANAR16TOB(H210, 2, 1, 0x3ff, AB30, 4, 4, 1) ++TESTPLANAR16TOB(U210, 2, 1, 0x3ff, AR30, 4, 4, 1) ++TESTPLANAR16TOB(U210, 2, 1, 0x3ff, AB30, 4, 4, 1) ++TESTPLANAR16TOB(I410, 1, 1, 0x3ff, AR30, 4, 4, 1) ++TESTPLANAR16TOB(I410, 1, 1, 0x3ff, AB30, 4, 4, 1) ++TESTPLANAR16TOB(H410, 1, 1, 0x3ff, AR30, 4, 4, 1) ++TESTPLANAR16TOB(H410, 1, 1, 0x3ff, AB30, 4, 4, 1) ++TESTPLANAR16TOB(U410, 1, 1, 0x3ff, AR30, 4, 4, 1) ++TESTPLANAR16TOB(U410, 1, 1, 0x3ff, AB30, 4, 4, 1) ++TESTPLANAR16TOB(I012, 2, 2, 0xfff, AR30, 4, 4, 1) ++TESTPLANAR16TOB(I010, 2, 2, 0x3ff, AR30Filter, 4, 4, 1) ++TESTPLANAR16TOB(I210, 2, 1, 0x3ff, AR30Filter, 4, 4, 1) ++#endif // LITTLE_ENDIAN_ONLY_TEST ++#endif // DISABLE_SLOW_TESTS ++ ++#define TESTQPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, \ ++ ALIGN, YALIGN, W1280, N, NEG, OFF, ATTEN, S_DEPTH) \ ++ TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##N) { \ ++ const int kWidth = W1280; \ ++ const int kHeight = ALIGNINT(benchmark_height_, YALIGN); \ ++ const int kStrideB = ALIGNINT(kWidth * BPP_B, ALIGN); \ ++ const int kStrideUV = SUBSAMPLE(kWidth, SUBSAMP_X); \ ++ const int kSizeUV = kStrideUV * SUBSAMPLE(kHeight, SUBSAMP_Y); \ ++ const int kBpc = 2; \ ++ align_buffer_page_end(src_y, kWidth* kHeight* kBpc + OFF); \ ++ align_buffer_page_end(src_u, kSizeUV* kBpc + OFF); \ ++ align_buffer_page_end(src_v, kSizeUV* kBpc + OFF); \ ++ align_buffer_page_end(src_a, kWidth* kHeight* kBpc + OFF); \ ++ align_buffer_page_end(dst_argb_c, kStrideB* kHeight + OFF); \ ++ align_buffer_page_end(dst_argb_opt, kStrideB* kHeight + OFF); \ ++ for (int i = 0; i < kWidth * kHeight; ++i) { \ ++ reinterpret_cast(src_y + OFF)[i] = \ ++ (fastrand() & ((1 << S_DEPTH) - 1)); \ ++ reinterpret_cast(src_a + OFF)[i] = \ ++ (fastrand() & ((1 << S_DEPTH) - 1)); \ ++ } \ ++ for (int i = 0; i < kSizeUV; ++i) { \ ++ reinterpret_cast(src_u + OFF)[i] = \ ++ (fastrand() & ((1 << S_DEPTH) - 1)); \ ++ reinterpret_cast(src_v + OFF)[i] = \ ++ (fastrand() & ((1 << S_DEPTH) - 1)); \ ++ } \ ++ memset(dst_argb_c + OFF, 1, kStrideB * kHeight); \ ++ memset(dst_argb_opt + OFF, 101, kStrideB * kHeight); \ ++ MaskCpuFlags(disable_cpu_flags_); \ ++ FMT_PLANAR##To##FMT_B(reinterpret_cast(src_y + OFF), kWidth, \ ++ reinterpret_cast(src_u + OFF), kStrideUV, \ ++ reinterpret_cast(src_v + OFF), kStrideUV, \ ++ reinterpret_cast(src_a + OFF), kWidth, \ ++ dst_argb_c + OFF, kStrideB, kWidth, NEG kHeight, \ ++ ATTEN); \ ++ MaskCpuFlags(benchmark_cpu_info_); \ ++ for (int i = 0; i < benchmark_iterations_; ++i) { \ ++ FMT_PLANAR##To##FMT_B( \ ++ reinterpret_cast(src_y + OFF), kWidth, \ ++ reinterpret_cast(src_u + OFF), kStrideUV, \ ++ reinterpret_cast(src_v + OFF), kStrideUV, \ ++ reinterpret_cast(src_a + OFF), kWidth, \ ++ dst_argb_opt + OFF, kStrideB, kWidth, NEG kHeight, ATTEN); \ ++ } \ ++ for (int i = 0; i < kWidth * BPP_B * kHeight; ++i) { \ ++ EXPECT_EQ(dst_argb_c[i + OFF], dst_argb_opt[i + OFF]); \ ++ } \ ++ free_aligned_buffer_page_end(src_y); \ ++ free_aligned_buffer_page_end(src_u); \ ++ free_aligned_buffer_page_end(src_v); \ ++ free_aligned_buffer_page_end(src_a); \ ++ free_aligned_buffer_page_end(dst_argb_c); \ ++ free_aligned_buffer_page_end(dst_argb_opt); \ ++ } ++ ++#if defined(ENABLE_FULL_TESTS) ++#define TESTQPLANAR16TOB(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, \ ++ ALIGN, YALIGN, S_DEPTH) \ ++ TESTQPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_ + 1, _Any, +, 0, 0, S_DEPTH) \ ++ TESTQPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_, _Unaligned, +, 2, 0, S_DEPTH) \ ++ TESTQPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_, _Invert, -, 0, 0, S_DEPTH) \ ++ TESTQPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_, _Opt, +, 0, 0, S_DEPTH) \ ++ TESTQPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_, _Premult, +, 0, 1, S_DEPTH) ++#else ++#define TESTQPLANAR16TOB(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, \ ++ ALIGN, YALIGN, S_DEPTH) \ ++ TESTQPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, benchmark_width_, _Opt, +, 0, 0, S_DEPTH) ++#endif ++ ++#define I010AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I010AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvI601Constants, k, \ ++ l, m) ++#define I010AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I010AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvI601Constants, k, \ ++ l, m) ++#define J010AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I010AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ ++ l, m) ++#define J010AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I010AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ ++ l, m) ++#define F010AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I010AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ ++ l, m) ++#define F010AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I010AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ ++ l, m) ++#define H010AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I010AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ ++ l, m) ++#define H010AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I010AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ ++ l, m) ++#define U010AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I010AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ ++ l, m) ++#define U010AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I010AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ ++ l, m) ++#define V010AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I010AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ ++ l, m) ++#define V010AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I010AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ ++ l, m) ++#define I210AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I210AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvI601Constants, k, \ ++ l, m) ++#define I210AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I210AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvI601Constants, k, \ ++ l, m) ++#define J210AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I210AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ ++ l, m) ++#define J210AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I210AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ ++ l, m) ++#define F210AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I210AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ ++ l, m) ++#define F210AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I210AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ ++ l, m) ++#define H210AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I210AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ ++ l, m) ++#define H210AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I210AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ ++ l, m) ++#define U210AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I210AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ ++ l, m) ++#define U210AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I210AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ ++ l, m) ++#define V210AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I210AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ ++ l, m) ++#define V210AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I210AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ ++ l, m) ++#define I410AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I410AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvI601Constants, k, \ ++ l, m) ++#define I410AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I410AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvI601Constants, k, \ ++ l, m) ++#define J410AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I410AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ ++ l, m) ++#define J410AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I410AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ ++ l, m) ++#define F410AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I410AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ ++ l, m) ++#define F410AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I410AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ ++ l, m) ++#define H410AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I410AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ ++ l, m) ++#define H410AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I410AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ ++ l, m) ++#define U410AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I410AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ ++ l, m) ++#define U410AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I410AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ ++ l, m) ++#define V410AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I410AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ ++ l, m) ++#define V410AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I410AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ ++ l, m) ++#define I010AlphaToARGBFilter(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I010AlphaToARGBMatrixFilter(a, b, c, d, e, f, g, h, i, j, \ ++ &kYuvI601Constants, k, l, m, kFilterBilinear) ++#define I210AlphaToARGBFilter(a, b, c, d, e, f, g, h, i, j, k, l, m) \ ++ I010AlphaToARGBMatrixFilter(a, b, c, d, e, f, g, h, i, j, \ ++ &kYuvI601Constants, k, l, m, kFilterBilinear) ++ ++// These conversions are only optimized for x86 ++#if !defined(DISABLE_SLOW_TESTS) || defined(__x86_64__) || defined(__i386__) ++TESTQPLANAR16TOB(I010Alpha, 2, 2, ARGB, 4, 4, 1, 10) ++TESTQPLANAR16TOB(I010Alpha, 2, 2, ABGR, 4, 4, 1, 10) ++TESTQPLANAR16TOB(J010Alpha, 2, 2, ARGB, 4, 4, 1, 10) ++TESTQPLANAR16TOB(J010Alpha, 2, 2, ABGR, 4, 4, 1, 10) ++TESTQPLANAR16TOB(H010Alpha, 2, 2, ARGB, 4, 4, 1, 10) ++TESTQPLANAR16TOB(H010Alpha, 2, 2, ABGR, 4, 4, 1, 10) ++TESTQPLANAR16TOB(F010Alpha, 2, 2, ARGB, 4, 4, 1, 10) ++TESTQPLANAR16TOB(F010Alpha, 2, 2, ABGR, 4, 4, 1, 10) ++TESTQPLANAR16TOB(U010Alpha, 2, 2, ARGB, 4, 4, 1, 10) ++TESTQPLANAR16TOB(U010Alpha, 2, 2, ABGR, 4, 4, 1, 10) ++TESTQPLANAR16TOB(V010Alpha, 2, 2, ARGB, 4, 4, 1, 10) ++TESTQPLANAR16TOB(V010Alpha, 2, 2, ABGR, 4, 4, 1, 10) ++TESTQPLANAR16TOB(I210Alpha, 2, 1, ARGB, 4, 4, 1, 10) ++TESTQPLANAR16TOB(I210Alpha, 2, 1, ABGR, 4, 4, 1, 10) ++TESTQPLANAR16TOB(J210Alpha, 2, 1, ARGB, 4, 4, 1, 10) ++TESTQPLANAR16TOB(J210Alpha, 2, 1, ABGR, 4, 4, 1, 10) ++TESTQPLANAR16TOB(H210Alpha, 2, 1, ARGB, 4, 4, 1, 10) ++TESTQPLANAR16TOB(H210Alpha, 2, 1, ABGR, 4, 4, 1, 10) ++TESTQPLANAR16TOB(F210Alpha, 2, 1, ARGB, 4, 4, 1, 10) ++TESTQPLANAR16TOB(F210Alpha, 2, 1, ABGR, 4, 4, 1, 10) ++TESTQPLANAR16TOB(U210Alpha, 2, 1, ARGB, 4, 4, 1, 10) ++TESTQPLANAR16TOB(U210Alpha, 2, 1, ABGR, 4, 4, 1, 10) ++TESTQPLANAR16TOB(V210Alpha, 2, 1, ARGB, 4, 4, 1, 10) ++TESTQPLANAR16TOB(V210Alpha, 2, 1, ABGR, 4, 4, 1, 10) ++TESTQPLANAR16TOB(I410Alpha, 1, 1, ARGB, 4, 4, 1, 10) ++TESTQPLANAR16TOB(I410Alpha, 1, 1, ABGR, 4, 4, 1, 10) ++TESTQPLANAR16TOB(J410Alpha, 1, 1, ARGB, 4, 4, 1, 10) ++TESTQPLANAR16TOB(J410Alpha, 1, 1, ABGR, 4, 4, 1, 10) ++TESTQPLANAR16TOB(H410Alpha, 1, 1, ARGB, 4, 4, 1, 10) ++TESTQPLANAR16TOB(H410Alpha, 1, 1, ABGR, 4, 4, 1, 10) ++TESTQPLANAR16TOB(F410Alpha, 1, 1, ARGB, 4, 4, 1, 10) ++TESTQPLANAR16TOB(F410Alpha, 1, 1, ABGR, 4, 4, 1, 10) ++TESTQPLANAR16TOB(U410Alpha, 1, 1, ARGB, 4, 4, 1, 10) ++TESTQPLANAR16TOB(U410Alpha, 1, 1, ABGR, 4, 4, 1, 10) ++TESTQPLANAR16TOB(V410Alpha, 1, 1, ARGB, 4, 4, 1, 10) ++TESTQPLANAR16TOB(V410Alpha, 1, 1, ABGR, 4, 4, 1, 10) ++TESTQPLANAR16TOB(I010Alpha, 2, 2, ARGBFilter, 4, 4, 1, 10) ++TESTQPLANAR16TOB(I210Alpha, 2, 1, ARGBFilter, 4, 4, 1, 10) ++#endif // DISABLE_SLOW_TESTS ++ ++#define TESTBP16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, W1280, N, NEG, SOFF, DOFF, S_DEPTH) \ ++ TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##N) { \ ++ const int kWidth = W1280; \ ++ const int kHeight = ALIGNINT(benchmark_height_, YALIGN); \ ++ const int kStrideB = ALIGNINT(kWidth * BPP_B, ALIGN); \ ++ const int kStrideUV = SUBSAMPLE(kWidth, SUBSAMP_X) * 2; \ ++ const int kSizeUV = kStrideUV * SUBSAMPLE(kHeight, SUBSAMP_Y) * 2; \ ++ const int kBpc = 2; \ ++ align_buffer_page_end(src_y, kWidth* kHeight* kBpc + SOFF); \ ++ align_buffer_page_end(src_uv, kSizeUV* kBpc + SOFF); \ ++ align_buffer_page_end(dst_argb_c, kStrideB* kHeight + DOFF); \ ++ align_buffer_page_end(dst_argb_opt, kStrideB* kHeight + DOFF); \ ++ for (int i = 0; i < kWidth * kHeight; ++i) { \ ++ reinterpret_cast(src_y + SOFF)[i] = \ ++ (fastrand() & (((uint16_t)(-1)) << (16 - S_DEPTH))); \ ++ } \ ++ for (int i = 0; i < kSizeUV; ++i) { \ ++ reinterpret_cast(src_uv + SOFF)[i] = \ ++ (fastrand() & (((uint16_t)(-1)) << (16 - S_DEPTH))); \ ++ } \ ++ memset(dst_argb_c + DOFF, 1, kStrideB * kHeight); \ ++ memset(dst_argb_opt + DOFF, 101, kStrideB * kHeight); \ ++ MaskCpuFlags(disable_cpu_flags_); \ ++ FMT_PLANAR##To##FMT_B(reinterpret_cast(src_y + SOFF), kWidth, \ ++ reinterpret_cast(src_uv + SOFF), \ ++ kStrideUV, dst_argb_c + DOFF, kStrideB, kWidth, \ ++ NEG kHeight); \ ++ MaskCpuFlags(benchmark_cpu_info_); \ ++ for (int i = 0; i < benchmark_iterations_; ++i) { \ ++ FMT_PLANAR##To##FMT_B(reinterpret_cast(src_y + SOFF), kWidth, \ ++ reinterpret_cast(src_uv + SOFF), \ ++ kStrideUV, dst_argb_opt + DOFF, kStrideB, kWidth, \ ++ NEG kHeight); \ ++ } \ ++ for (int i = 0; i < kWidth * BPP_B * kHeight; ++i) { \ ++ EXPECT_EQ(dst_argb_c[i + DOFF], dst_argb_opt[i + DOFF]); \ ++ } \ ++ free_aligned_buffer_page_end(src_y); \ ++ free_aligned_buffer_page_end(src_uv); \ ++ free_aligned_buffer_page_end(dst_argb_c); \ ++ free_aligned_buffer_page_end(dst_argb_opt); \ ++ } ++ ++#define TESTBP16TOB(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ ++ YALIGN, S_DEPTH) \ ++ TESTBP16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, YALIGN, \ ++ benchmark_width_ + 1, _Any, +, 0, 0, S_DEPTH) \ ++ TESTBP16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, YALIGN, \ ++ benchmark_width_, _Unaligned, +, 4, 4, S_DEPTH) \ ++ TESTBP16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, YALIGN, \ ++ benchmark_width_, _Invert, -, 0, 0, S_DEPTH) \ ++ TESTBP16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, YALIGN, \ ++ benchmark_width_, _Opt, +, 0, 0, S_DEPTH) ++ ++#define P010ToARGB(a, b, c, d, e, f, g, h) \ ++ P010ToARGBMatrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) ++#define P210ToARGB(a, b, c, d, e, f, g, h) \ ++ P210ToARGBMatrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) ++#define P010ToAR30(a, b, c, d, e, f, g, h) \ ++ P010ToAR30Matrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) ++#define P210ToAR30(a, b, c, d, e, f, g, h) \ ++ P210ToAR30Matrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) ++ ++#define P012ToARGB(a, b, c, d, e, f, g, h) \ ++ P012ToARGBMatrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) ++#define P212ToARGB(a, b, c, d, e, f, g, h) \ ++ P212ToARGBMatrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) ++#define P012ToAR30(a, b, c, d, e, f, g, h) \ ++ P012ToAR30Matrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) ++#define P212ToAR30(a, b, c, d, e, f, g, h) \ ++ P212ToAR30Matrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) ++ ++#define P016ToARGB(a, b, c, d, e, f, g, h) \ ++ P016ToARGBMatrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) ++#define P216ToARGB(a, b, c, d, e, f, g, h) \ ++ P216ToARGBMatrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) ++#define P016ToAR30(a, b, c, d, e, f, g, h) \ ++ P016ToAR30Matrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) ++#define P216ToAR30(a, b, c, d, e, f, g, h) \ ++ P216ToAR30Matrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) ++ ++#define P010ToARGBFilter(a, b, c, d, e, f, g, h) \ ++ P010ToARGBMatrixFilter(a, b, c, d, e, f, &kYuvH709Constants, g, h, \ ++ kFilterBilinear) ++#define P210ToARGBFilter(a, b, c, d, e, f, g, h) \ ++ P210ToARGBMatrixFilter(a, b, c, d, e, f, &kYuvH709Constants, g, h, \ ++ kFilterBilinear) ++#define P010ToAR30Filter(a, b, c, d, e, f, g, h) \ ++ P010ToAR30MatrixFilter(a, b, c, d, e, f, &kYuvH709Constants, g, h, \ ++ kFilterBilinear) ++#define P210ToAR30Filter(a, b, c, d, e, f, g, h) \ ++ P210ToAR30MatrixFilter(a, b, c, d, e, f, &kYuvH709Constants, g, h, \ ++ kFilterBilinear) ++ ++#if !defined(DISABLE_SLOW_TESTS) || defined(__x86_64__) || defined(__i386__) ++TESTBP16TOB(P010, 2, 2, ARGB, 4, 4, 1, 10) ++TESTBP16TOB(P210, 2, 1, ARGB, 4, 4, 1, 10) ++TESTBP16TOB(P012, 2, 2, ARGB, 4, 4, 1, 12) ++TESTBP16TOB(P212, 2, 1, ARGB, 4, 4, 1, 12) ++TESTBP16TOB(P016, 2, 2, ARGB, 4, 4, 1, 16) ++TESTBP16TOB(P216, 2, 1, ARGB, 4, 4, 1, 16) ++TESTBP16TOB(P010, 2, 2, ARGBFilter, 4, 4, 1, 10) ++TESTBP16TOB(P210, 2, 1, ARGBFilter, 4, 4, 1, 10) ++#ifdef LITTLE_ENDIAN_ONLY_TEST ++TESTBP16TOB(P010, 2, 2, AR30, 4, 4, 1, 10) ++TESTBP16TOB(P210, 2, 1, AR30, 4, 4, 1, 10) ++TESTBP16TOB(P012, 2, 2, AR30, 4, 4, 1, 12) ++TESTBP16TOB(P212, 2, 1, AR30, 4, 4, 1, 12) ++TESTBP16TOB(P016, 2, 2, AR30, 4, 4, 1, 16) ++TESTBP16TOB(P216, 2, 1, AR30, 4, 4, 1, 16) ++TESTBP16TOB(P010, 2, 2, AR30Filter, 4, 4, 1, 10) ++TESTBP16TOB(P210, 2, 1, AR30Filter, 4, 4, 1, 10) ++#endif // LITTLE_ENDIAN_ONLY_TEST ++#endif // DISABLE_SLOW_TESTS ++ ++static int Clamp(int y) { ++ if (y < 0) { ++ y = 0; ++ } ++ if (y > 255) { ++ y = 255; ++ } ++ return y; ++} ++ ++static int Clamp10(int y) { ++ if (y < 0) { ++ y = 0; ++ } ++ if (y > 1023) { ++ y = 1023; ++ } ++ return y; ++} ++ ++// Test 8 bit YUV to 8 bit RGB ++TEST_F(LibYUVConvertTest, TestH420ToARGB) { ++ const int kSize = 256; ++ int histogram_b[256]; ++ int histogram_g[256]; ++ int histogram_r[256]; ++ memset(histogram_b, 0, sizeof(histogram_b)); ++ memset(histogram_g, 0, sizeof(histogram_g)); ++ memset(histogram_r, 0, sizeof(histogram_r)); ++ align_buffer_page_end(orig_yuv, kSize + kSize / 2 * 2); ++ align_buffer_page_end(argb_pixels, kSize * 4); ++ uint8_t* orig_y = orig_yuv; ++ uint8_t* orig_u = orig_y + kSize; ++ uint8_t* orig_v = orig_u + kSize / 2; ++ ++ // Test grey scale ++ for (int i = 0; i < kSize; ++i) { ++ orig_y[i] = i; ++ } ++ for (int i = 0; i < kSize / 2; ++i) { ++ orig_u[i] = 128; // 128 is 0. ++ orig_v[i] = 128; ++ } ++ ++ H420ToARGB(orig_y, 0, orig_u, 0, orig_v, 0, argb_pixels, 0, kSize, 1); ++ ++ for (int i = 0; i < kSize; ++i) { ++ int b = argb_pixels[i * 4 + 0]; ++ int g = argb_pixels[i * 4 + 1]; ++ int r = argb_pixels[i * 4 + 2]; ++ int a = argb_pixels[i * 4 + 3]; ++ ++histogram_b[b]; ++ ++histogram_g[g]; ++ ++histogram_r[r]; ++ // Reference formula for Y channel contribution in YUV to RGB conversions: ++ int expected_y = Clamp(static_cast((i - 16) * 1.164f + 0.5f)); ++ EXPECT_EQ(b, expected_y); ++ EXPECT_EQ(g, expected_y); ++ EXPECT_EQ(r, expected_y); ++ EXPECT_EQ(a, 255); ++ } ++ ++ int count_b = 0; ++ int count_g = 0; ++ int count_r = 0; ++ for (int i = 0; i < kSize; ++i) { ++ if (histogram_b[i]) { ++ ++count_b; ++ } ++ if (histogram_g[i]) { ++ ++count_g; ++ } ++ if (histogram_r[i]) { ++ ++count_r; ++ } ++ } ++ printf("uniques: B %d, G, %d, R %d\n", count_b, count_g, count_r); ++ ++ free_aligned_buffer_page_end(orig_yuv); ++ free_aligned_buffer_page_end(argb_pixels); ++} ++ ++// Test 10 bit YUV to 8 bit RGB ++TEST_F(LibYUVConvertTest, TestH010ToARGB) { ++ const int kSize = 1024; ++ int histogram_b[1024]; ++ int histogram_g[1024]; ++ int histogram_r[1024]; ++ memset(histogram_b, 0, sizeof(histogram_b)); ++ memset(histogram_g, 0, sizeof(histogram_g)); ++ memset(histogram_r, 0, sizeof(histogram_r)); ++ align_buffer_page_end(orig_yuv, kSize * 2 + kSize / 2 * 2 * 2); ++ align_buffer_page_end(argb_pixels, kSize * 4); ++ uint16_t* orig_y = reinterpret_cast(orig_yuv); ++ uint16_t* orig_u = orig_y + kSize; ++ uint16_t* orig_v = orig_u + kSize / 2; ++ ++ // Test grey scale ++ for (int i = 0; i < kSize; ++i) { ++ orig_y[i] = i; ++ } ++ for (int i = 0; i < kSize / 2; ++i) { ++ orig_u[i] = 512; // 512 is 0. ++ orig_v[i] = 512; ++ } ++ ++ H010ToARGB(orig_y, 0, orig_u, 0, orig_v, 0, argb_pixels, 0, kSize, 1); ++ ++ for (int i = 0; i < kSize; ++i) { ++ int b = argb_pixels[i * 4 + 0]; ++ int g = argb_pixels[i * 4 + 1]; ++ int r = argb_pixels[i * 4 + 2]; ++ int a = argb_pixels[i * 4 + 3]; ++ ++histogram_b[b]; ++ ++histogram_g[g]; ++ ++histogram_r[r]; ++ int expected_y = Clamp(static_cast((i - 64) * 1.164f / 4)); ++ EXPECT_NEAR(b, expected_y, 1); ++ EXPECT_NEAR(g, expected_y, 1); ++ EXPECT_NEAR(r, expected_y, 1); ++ EXPECT_EQ(a, 255); ++ } ++ ++ int count_b = 0; ++ int count_g = 0; ++ int count_r = 0; ++ for (int i = 0; i < kSize; ++i) { ++ if (histogram_b[i]) { ++ ++count_b; ++ } ++ if (histogram_g[i]) { ++ ++count_g; ++ } ++ if (histogram_r[i]) { ++ ++count_r; ++ } ++ } ++ printf("uniques: B %d, G, %d, R %d\n", count_b, count_g, count_r); ++ ++ free_aligned_buffer_page_end(orig_yuv); ++ free_aligned_buffer_page_end(argb_pixels); ++} ++ ++// Test 10 bit YUV to 10 bit RGB ++// Caveat: Result is near due to float rounding in expected ++// result. ++TEST_F(LibYUVConvertTest, TestH010ToAR30) { ++ const int kSize = 1024; ++ int histogram_b[1024]; ++ int histogram_g[1024]; ++ int histogram_r[1024]; ++ memset(histogram_b, 0, sizeof(histogram_b)); ++ memset(histogram_g, 0, sizeof(histogram_g)); ++ memset(histogram_r, 0, sizeof(histogram_r)); ++ ++ align_buffer_page_end(orig_yuv, kSize * 2 + kSize / 2 * 2 * 2); ++ align_buffer_page_end(ar30_pixels, kSize * 4); ++ uint16_t* orig_y = reinterpret_cast(orig_yuv); ++ uint16_t* orig_u = orig_y + kSize; ++ uint16_t* orig_v = orig_u + kSize / 2; ++ ++ // Test grey scale ++ for (int i = 0; i < kSize; ++i) { ++ orig_y[i] = i; ++ } ++ for (int i = 0; i < kSize / 2; ++i) { ++ orig_u[i] = 512; // 512 is 0. ++ orig_v[i] = 512; ++ } ++ ++ H010ToAR30(orig_y, 0, orig_u, 0, orig_v, 0, ar30_pixels, 0, kSize, 1); ++ ++ for (int i = 0; i < kSize; ++i) { ++ int b10 = reinterpret_cast(ar30_pixels)[i] & 1023; ++ int g10 = (reinterpret_cast(ar30_pixels)[i] >> 10) & 1023; ++ int r10 = (reinterpret_cast(ar30_pixels)[i] >> 20) & 1023; ++ int a2 = (reinterpret_cast(ar30_pixels)[i] >> 30) & 3; ++ ++histogram_b[b10]; ++ ++histogram_g[g10]; ++ ++histogram_r[r10]; ++ int expected_y = Clamp10(static_cast((i - 64) * 1.164f + 0.5)); ++ EXPECT_NEAR(b10, expected_y, 4); ++ EXPECT_NEAR(g10, expected_y, 4); ++ EXPECT_NEAR(r10, expected_y, 4); ++ EXPECT_EQ(a2, 3); ++ } ++ ++ int count_b = 0; ++ int count_g = 0; ++ int count_r = 0; ++ for (int i = 0; i < kSize; ++i) { ++ if (histogram_b[i]) { ++ ++count_b; ++ } ++ if (histogram_g[i]) { ++ ++count_g; ++ } ++ if (histogram_r[i]) { ++ ++count_r; ++ } ++ } ++ printf("uniques: B %d, G, %d, R %d\n", count_b, count_g, count_r); ++ ++ free_aligned_buffer_page_end(orig_yuv); ++ free_aligned_buffer_page_end(ar30_pixels); ++} ++ ++// Test 10 bit YUV to 10 bit RGB ++// Caveat: Result is near due to float rounding in expected ++// result. ++TEST_F(LibYUVConvertTest, TestH010ToAB30) { ++ const int kSize = 1024; ++ int histogram_b[1024]; ++ int histogram_g[1024]; ++ int histogram_r[1024]; ++ memset(histogram_b, 0, sizeof(histogram_b)); ++ memset(histogram_g, 0, sizeof(histogram_g)); ++ memset(histogram_r, 0, sizeof(histogram_r)); ++ ++ align_buffer_page_end(orig_yuv, kSize * 2 + kSize / 2 * 2 * 2); ++ align_buffer_page_end(ab30_pixels, kSize * 4); ++ uint16_t* orig_y = reinterpret_cast(orig_yuv); ++ uint16_t* orig_u = orig_y + kSize; ++ uint16_t* orig_v = orig_u + kSize / 2; ++ ++ // Test grey scale ++ for (int i = 0; i < kSize; ++i) { ++ orig_y[i] = i; ++ } ++ for (int i = 0; i < kSize / 2; ++i) { ++ orig_u[i] = 512; // 512 is 0. ++ orig_v[i] = 512; ++ } ++ ++ H010ToAB30(orig_y, 0, orig_u, 0, orig_v, 0, ab30_pixels, 0, kSize, 1); ++ ++ for (int i = 0; i < kSize; ++i) { ++ int r10 = reinterpret_cast(ab30_pixels)[i] & 1023; ++ int g10 = (reinterpret_cast(ab30_pixels)[i] >> 10) & 1023; ++ int b10 = (reinterpret_cast(ab30_pixels)[i] >> 20) & 1023; ++ int a2 = (reinterpret_cast(ab30_pixels)[i] >> 30) & 3; ++ ++histogram_b[b10]; ++ ++histogram_g[g10]; ++ ++histogram_r[r10]; ++ int expected_y = Clamp10(static_cast((i - 64) * 1.164f)); ++ EXPECT_NEAR(b10, expected_y, 4); ++ EXPECT_NEAR(g10, expected_y, 4); ++ EXPECT_NEAR(r10, expected_y, 4); ++ EXPECT_EQ(a2, 3); ++ } ++ ++ int count_b = 0; ++ int count_g = 0; ++ int count_r = 0; ++ for (int i = 0; i < kSize; ++i) { ++ if (histogram_b[i]) { ++ ++count_b; ++ } ++ if (histogram_g[i]) { ++ ++count_g; ++ } ++ if (histogram_r[i]) { ++ ++count_r; ++ } ++ } ++ printf("uniques: B %d, G, %d, R %d\n", count_b, count_g, count_r); ++ ++ free_aligned_buffer_page_end(orig_yuv); ++ free_aligned_buffer_page_end(ab30_pixels); ++} ++ ++// Test 8 bit YUV to 10 bit RGB ++TEST_F(LibYUVConvertTest, TestH420ToAR30) { ++ const int kSize = 256; ++ const int kHistSize = 1024; ++ int histogram_b[kHistSize]; ++ int histogram_g[kHistSize]; ++ int histogram_r[kHistSize]; ++ memset(histogram_b, 0, sizeof(histogram_b)); ++ memset(histogram_g, 0, sizeof(histogram_g)); ++ memset(histogram_r, 0, sizeof(histogram_r)); ++ align_buffer_page_end(orig_yuv, kSize + kSize / 2 * 2); ++ align_buffer_page_end(ar30_pixels, kSize * 4); ++ uint8_t* orig_y = orig_yuv; ++ uint8_t* orig_u = orig_y + kSize; ++ uint8_t* orig_v = orig_u + kSize / 2; ++ ++ // Test grey scale ++ for (int i = 0; i < kSize; ++i) { ++ orig_y[i] = i; ++ } ++ for (int i = 0; i < kSize / 2; ++i) { ++ orig_u[i] = 128; // 128 is 0. ++ orig_v[i] = 128; ++ } ++ ++ H420ToAR30(orig_y, 0, orig_u, 0, orig_v, 0, ar30_pixels, 0, kSize, 1); ++ ++ for (int i = 0; i < kSize; ++i) { ++ int b10 = reinterpret_cast(ar30_pixels)[i] & 1023; ++ int g10 = (reinterpret_cast(ar30_pixels)[i] >> 10) & 1023; ++ int r10 = (reinterpret_cast(ar30_pixels)[i] >> 20) & 1023; ++ int a2 = (reinterpret_cast(ar30_pixels)[i] >> 30) & 3; ++ ++histogram_b[b10]; ++ ++histogram_g[g10]; ++ ++histogram_r[r10]; ++ int expected_y = Clamp10(static_cast((i - 16) * 1.164f * 4.f)); ++ EXPECT_NEAR(b10, expected_y, 4); ++ EXPECT_NEAR(g10, expected_y, 4); ++ EXPECT_NEAR(r10, expected_y, 4); ++ EXPECT_EQ(a2, 3); ++ } ++ ++ int count_b = 0; ++ int count_g = 0; ++ int count_r = 0; ++ for (int i = 0; i < kHistSize; ++i) { ++ if (histogram_b[i]) { ++ ++count_b; ++ } ++ if (histogram_g[i]) { ++ ++count_g; ++ } ++ if (histogram_r[i]) { ++ ++count_r; ++ } ++ } ++ printf("uniques: B %d, G, %d, R %d\n", count_b, count_g, count_r); ++ ++ free_aligned_buffer_page_end(orig_yuv); ++ free_aligned_buffer_page_end(ar30_pixels); ++} ++ ++// Test I400 with jpeg matrix is same as J400 ++TEST_F(LibYUVConvertTest, TestI400) { ++ const int kSize = 256; ++ align_buffer_page_end(orig_i400, kSize); ++ align_buffer_page_end(argb_pixels_i400, kSize * 4); ++ align_buffer_page_end(argb_pixels_j400, kSize * 4); ++ align_buffer_page_end(argb_pixels_jpeg_i400, kSize * 4); ++ align_buffer_page_end(argb_pixels_h709_i400, kSize * 4); ++ align_buffer_page_end(argb_pixels_2020_i400, kSize * 4); ++ ++ // Test grey scale ++ for (int i = 0; i < kSize; ++i) { ++ orig_i400[i] = i; ++ } ++ ++ J400ToARGB(orig_i400, 0, argb_pixels_j400, 0, kSize, 1); ++ I400ToARGB(orig_i400, 0, argb_pixels_i400, 0, kSize, 1); ++ I400ToARGBMatrix(orig_i400, 0, argb_pixels_jpeg_i400, 0, &kYuvJPEGConstants, ++ kSize, 1); ++ I400ToARGBMatrix(orig_i400, 0, argb_pixels_h709_i400, 0, &kYuvH709Constants, ++ kSize, 1); ++ I400ToARGBMatrix(orig_i400, 0, argb_pixels_2020_i400, 0, &kYuv2020Constants, ++ kSize, 1); ++ ++ EXPECT_EQ(0, argb_pixels_i400[0]); ++ EXPECT_EQ(0, argb_pixels_j400[0]); ++ EXPECT_EQ(0, argb_pixels_jpeg_i400[0]); ++ EXPECT_EQ(0, argb_pixels_h709_i400[0]); ++ EXPECT_EQ(0, argb_pixels_2020_i400[0]); ++ EXPECT_EQ(0, argb_pixels_i400[16 * 4]); ++ EXPECT_EQ(16, argb_pixels_j400[16 * 4]); ++ EXPECT_EQ(16, argb_pixels_jpeg_i400[16 * 4]); ++ EXPECT_EQ(0, argb_pixels_h709_i400[16 * 4]); ++ EXPECT_EQ(0, argb_pixels_2020_i400[16 * 4]); ++ EXPECT_EQ(130, argb_pixels_i400[128 * 4]); ++ EXPECT_EQ(128, argb_pixels_j400[128 * 4]); ++ EXPECT_EQ(128, argb_pixels_jpeg_i400[128 * 4]); ++ EXPECT_EQ(130, argb_pixels_h709_i400[128 * 4]); ++ EXPECT_EQ(130, argb_pixels_2020_i400[128 * 4]); ++ EXPECT_EQ(255, argb_pixels_i400[255 * 4]); ++ EXPECT_EQ(255, argb_pixels_j400[255 * 4]); ++ EXPECT_EQ(255, argb_pixels_jpeg_i400[255 * 4]); ++ EXPECT_EQ(255, argb_pixels_h709_i400[255 * 4]); ++ EXPECT_EQ(255, argb_pixels_2020_i400[255 * 4]); ++ ++ for (int i = 0; i < kSize * 4; ++i) { ++ if ((i & 3) == 3) { ++ EXPECT_EQ(255, argb_pixels_j400[i]); ++ } else { ++ EXPECT_EQ(i / 4, argb_pixels_j400[i]); ++ } ++ EXPECT_EQ(argb_pixels_jpeg_i400[i], argb_pixels_j400[i]); ++ } ++ ++ free_aligned_buffer_page_end(orig_i400); ++ free_aligned_buffer_page_end(argb_pixels_i400); ++ free_aligned_buffer_page_end(argb_pixels_j400); ++ free_aligned_buffer_page_end(argb_pixels_jpeg_i400); ++ free_aligned_buffer_page_end(argb_pixels_h709_i400); ++ free_aligned_buffer_page_end(argb_pixels_2020_i400); ++} ++ ++// Test RGB24 to ARGB and back to RGB24 ++TEST_F(LibYUVConvertTest, TestARGBToRGB24) { ++ const int kSize = 256; ++ align_buffer_page_end(orig_rgb24, kSize * 3); ++ align_buffer_page_end(argb_pixels, kSize * 4); ++ align_buffer_page_end(dest_rgb24, kSize * 3); ++ ++ // Test grey scale ++ for (int i = 0; i < kSize * 3; ++i) { ++ orig_rgb24[i] = i; ++ } ++ ++ RGB24ToARGB(orig_rgb24, 0, argb_pixels, 0, kSize, 1); ++ ARGBToRGB24(argb_pixels, 0, dest_rgb24, 0, kSize, 1); ++ ++ for (int i = 0; i < kSize * 3; ++i) { ++ EXPECT_EQ(orig_rgb24[i], dest_rgb24[i]); ++ } ++ ++ free_aligned_buffer_page_end(orig_rgb24); ++ free_aligned_buffer_page_end(argb_pixels); ++ free_aligned_buffer_page_end(dest_rgb24); ++} ++ ++TEST_F(LibYUVConvertTest, Test565) { ++ SIMD_ALIGNED(uint8_t orig_pixels[256][4]); ++ SIMD_ALIGNED(uint8_t pixels565[256][2]); ++ ++ for (int i = 0; i < 256; ++i) { ++ for (int j = 0; j < 4; ++j) { ++ orig_pixels[i][j] = i; ++ } ++ } ++ ARGBToRGB565(&orig_pixels[0][0], 0, &pixels565[0][0], 0, 256, 1); ++ uint32_t checksum = HashDjb2(&pixels565[0][0], sizeof(pixels565), 5381); ++ EXPECT_EQ(610919429u, checksum); ++} ++ + // Test RGB24 to J420 is exact + #if defined(LIBYUV_BIT_EXACT) + TEST_F(LibYUVConvertTest, TestRGB24ToJ420) { +@@ -2105,6 +4527,4 @@ TEST_F(LibYUVConvertTest, TestRGB24ToI42 + } + #endif + +-#endif // !defined(LEAN_TESTS) +- + } // namespace libyuv +diff --git a/media/libyuv/libyuv/unit_test/cpu_test.cc b/media/libyuv/libyuv/unit_test/cpu_test.cc +--- a/media/libyuv/libyuv/unit_test/cpu_test.cc ++++ b/media/libyuv/libyuv/unit_test/cpu_test.cc +@@ -20,23 +20,13 @@ namespace libyuv { + + TEST_F(LibYUVBaseTest, TestCpuHas) { + int cpu_flags = TestCpuFlag(-1); +- printf("Cpu Flags 0x%x\n", cpu_flags); ++ printf("Cpu Flags %d\n", cpu_flags); + #if defined(__arm__) || defined(__aarch64__) + int has_arm = TestCpuFlag(kCpuHasARM); +- printf("Has ARM 0x%x\n", has_arm); ++ printf("Has ARM %d\n", has_arm); + int has_neon = TestCpuFlag(kCpuHasNEON); +- printf("Has NEON 0x%x\n", has_neon); ++ printf("Has NEON %d\n", has_neon); + #endif +-#if defined(__riscv) && defined(__linux__) +- int has_riscv = TestCpuFlag(kCpuHasRISCV); +- printf("Has RISCV 0x%x\n", has_riscv); +- int has_rvv = TestCpuFlag(kCpuHasRVV); +- printf("Has RVV 0x%x\n", has_rvv); +- int has_rvvzvfh = TestCpuFlag(kCpuHasRVVZVFH); +- printf("Has RVVZVFH 0x%x\n", has_rvvzvfh); +-#endif +-#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || \ +- defined(_M_X64) + int has_x86 = TestCpuFlag(kCpuHasX86); + int has_sse2 = TestCpuFlag(kCpuHasSSE2); + int has_ssse3 = TestCpuFlag(kCpuHasSSSE3); +@@ -47,50 +37,47 @@ TEST_F(LibYUVBaseTest, TestCpuHas) { + int has_erms = TestCpuFlag(kCpuHasERMS); + int has_fma3 = TestCpuFlag(kCpuHasFMA3); + int has_f16c = TestCpuFlag(kCpuHasF16C); ++ int has_gfni = TestCpuFlag(kCpuHasGFNI); + int has_avx512bw = TestCpuFlag(kCpuHasAVX512BW); + int has_avx512vl = TestCpuFlag(kCpuHasAVX512VL); + int has_avx512vnni = TestCpuFlag(kCpuHasAVX512VNNI); + int has_avx512vbmi = TestCpuFlag(kCpuHasAVX512VBMI); + int has_avx512vbmi2 = TestCpuFlag(kCpuHasAVX512VBMI2); + int has_avx512vbitalg = TestCpuFlag(kCpuHasAVX512VBITALG); +- int has_avx10 = TestCpuFlag(kCpuHasAVX10); +- int has_avxvnni = TestCpuFlag(kCpuHasAVXVNNI); +- int has_avxvnniint8 = TestCpuFlag(kCpuHasAVXVNNIINT8); +- int has_amxint8 = TestCpuFlag(kCpuHasAMXINT8); +- printf("Has X86 0x%x\n", has_x86); +- printf("Has SSE2 0x%x\n", has_sse2); +- printf("Has SSSE3 0x%x\n", has_ssse3); +- printf("Has SSE41 0x%x\n", has_sse41); +- printf("Has SSE42 0x%x\n", has_sse42); +- printf("Has AVX 0x%x\n", has_avx); +- printf("Has AVX2 0x%x\n", has_avx2); +- printf("Has ERMS 0x%x\n", has_erms); +- printf("Has FMA3 0x%x\n", has_fma3); +- printf("Has F16C 0x%x\n", has_f16c); +- printf("Has AVX512BW 0x%x\n", has_avx512bw); +- printf("Has AVX512VL 0x%x\n", has_avx512vl); +- printf("Has AVX512VNNI 0x%x\n", has_avx512vnni); +- printf("Has AVX512VBMI 0x%x\n", has_avx512vbmi); +- printf("Has AVX512VBMI2 0x%x\n", has_avx512vbmi2); +- printf("Has AVX512VBITALG 0x%x\n", has_avx512vbitalg); +- printf("Has AVX10 0x%x\n", has_avx10); +- printf("HAS AVXVNNI 0x%x\n", has_avxvnni); +- printf("Has AVXVNNIINT8 0x%x\n", has_avxvnniint8); +- printf("Has AMXINT8 0x%x\n", has_amxint8); +-#endif ++ int has_avx512vpopcntdq = TestCpuFlag(kCpuHasAVX512VPOPCNTDQ); ++ printf("Has X86 %d\n", has_x86); ++ printf("Has SSE2 %d\n", has_sse2); ++ printf("Has SSSE3 %d\n", has_ssse3); ++ printf("Has SSE41 %d\n", has_sse41); ++ printf("Has SSE42 %d\n", has_sse42); ++ printf("Has AVX %d\n", has_avx); ++ printf("Has AVX2 %d\n", has_avx2); ++ printf("Has ERMS %d\n", has_erms); ++ printf("Has FMA3 %d\n", has_fma3); ++ printf("Has F16C %d\n", has_f16c); ++ printf("Has GFNI %d\n", has_gfni); ++ printf("Has AVX512BW %d\n", has_avx512bw); ++ printf("Has AVX512VL %d\n", has_avx512vl); ++ printf("Has AVX512VNNI %d\n", has_avx512vnni); ++ printf("Has AVX512VBMI %d\n", has_avx512vbmi); ++ printf("Has AVX512VBMI2 %d\n", has_avx512vbmi2); ++ printf("Has AVX512VBITALG %d\n", has_avx512vbitalg); ++ printf("Has AVX512VPOPCNTDQ %d\n", has_avx512vpopcntdq); ++ + #if defined(__mips__) + int has_mips = TestCpuFlag(kCpuHasMIPS); +- printf("Has MIPS 0x%x\n", has_mips); ++ printf("Has MIPS %d\n", has_mips); + int has_msa = TestCpuFlag(kCpuHasMSA); +- printf("Has MSA 0x%x\n", has_msa); ++ printf("Has MSA %d\n", has_msa); + #endif ++ + #if defined(__loongarch__) + int has_loongarch = TestCpuFlag(kCpuHasLOONGARCH); +- printf("Has LOONGARCH 0x%x\n", has_loongarch); ++ printf("Has LOONGARCH %d\n", has_loongarch); + int has_lsx = TestCpuFlag(kCpuHasLSX); +- printf("Has LSX 0x%x\n", has_lsx); ++ printf("Has LSX %d\n", has_lsx); + int has_lasx = TestCpuFlag(kCpuHasLASX); +- printf("Has LASX 0x%x\n", has_lasx); ++ printf("Has LASX %d\n", has_lasx); + #endif + } + +@@ -117,39 +104,27 @@ TEST_F(LibYUVBaseTest, TestCompilerMacro + #ifdef __i386__ + printf("__i386__ %d\n", __i386__); + #endif ++#ifdef __mips ++ printf("__mips %d\n", __mips); ++#endif ++#ifdef __mips_isa_rev ++ printf("__mips_isa_rev %d\n", __mips_isa_rev); ++#endif + #ifdef __x86_64__ + printf("__x86_64__ %d\n", __x86_64__); + #endif +-#ifdef _M_IX86 +- printf("_M_IX86 %d\n", _M_IX86); +-#endif +-#ifdef _M_X64 +- printf("_M_X64 %d\n", _M_X64); +-#endif + #ifdef _MSC_VER + printf("_MSC_VER %d\n", _MSC_VER); + #endif + #ifdef __aarch64__ + printf("__aarch64__ %d\n", __aarch64__); + #endif ++#ifdef __APPLE__ ++ printf("__APPLE__ %d\n", __APPLE__); ++#endif + #ifdef __arm__ + printf("__arm__ %d\n", __arm__); + #endif +-#ifdef __riscv +- printf("__riscv %d\n", __riscv); +-#endif +-#ifdef __riscv_vector +- printf("__riscv_vector %d\n", __riscv_vector); +-#endif +-#ifdef __riscv_v_intrinsic +- printf("__riscv_v_intrinsic %d\n", __riscv_v_intrinsic); +-#endif +-#ifdef __riscv_zve64x +- printf("__riscv_zve64x %d\n", __riscv_zve64x); +-#endif +-#ifdef __APPLE__ +- printf("__APPLE__ %d\n", __APPLE__); +-#endif + #ifdef __clang__ + printf("__clang__ %d\n", __clang__); + #endif +@@ -165,11 +140,20 @@ TEST_F(LibYUVBaseTest, TestCompilerMacro + #ifdef __mips_msa + printf("__mips_msa %d\n", __mips_msa); + #endif +-#ifdef __mips +- printf("__mips %d\n", __mips); ++#ifdef __native_client__ ++ printf("__native_client__ %d\n", __native_client__); ++#endif ++#ifdef __pic__ ++ printf("__pic__ %d\n", __pic__); + #endif +-#ifdef __mips_isa_rev +- printf("__mips_isa_rev %d\n", __mips_isa_rev); ++#ifdef __pnacl__ ++ printf("__pnacl__ %d\n", __pnacl__); ++#endif ++#ifdef _M_IX86 ++ printf("_M_IX86 %d\n", _M_IX86); ++#endif ++#ifdef _M_X64 ++ printf("_M_X64 %d\n", _M_X64); + #endif + #ifdef _MIPS_ARCH_LOONGSON3A + printf("_MIPS_ARCH_LOONGSON3A %d\n", _MIPS_ARCH_LOONGSON3A); +@@ -180,17 +164,8 @@ TEST_F(LibYUVBaseTest, TestCompilerMacro + #ifdef _WIN32 + printf("_WIN32 %d\n", _WIN32); + #endif +-#ifdef __native_client__ +- printf("__native_client__ %d\n", __native_client__); +-#endif +-#ifdef __pic__ +- printf("__pic__ %d\n", __pic__); +-#endif +-#ifdef __pnacl__ +- printf("__pnacl__ %d\n", __pnacl__); +-#endif + #ifdef GG_LONGLONG +- printf("GG_LONGLONG %lld\n", GG_LONGLONG(1)); ++ printf("GG_LONGLONG %d\n", GG_LONGLONG); + #endif + #ifdef INT_TYPES_DEFINED + printf("INT_TYPES_DEFINED\n"); +@@ -225,9 +200,8 @@ TEST_F(LibYUVBaseTest, TestCpuId) { + cpu_info[0] = cpu_info[1]; // Reorder output + cpu_info[1] = cpu_info[3]; + cpu_info[3] = 0; +- printf("Cpu Vendor: %s 0x%x 0x%x 0x%x\n", +- reinterpret_cast(&cpu_info[0]), cpu_info[0], cpu_info[1], +- cpu_info[2]); ++ printf("Cpu Vendor: %s %x %x %x\n", reinterpret_cast(&cpu_info[0]), ++ cpu_info[0], cpu_info[1], cpu_info[2]); + EXPECT_EQ(12u, strlen(reinterpret_cast(&cpu_info[0]))); + + // CPU Family and Model +@@ -255,20 +229,21 @@ static int FileExists(const char* file_n + return 1; + } + +-TEST_F(LibYUVBaseTest, TestLinuxArm) { ++TEST_F(LibYUVBaseTest, TestLinuxNeon) { + if (FileExists("../../unit_test/testdata/arm_v7.txt")) { + printf("Note: testing to load \"../../unit_test/testdata/arm_v7.txt\"\n"); + + EXPECT_EQ(0, ArmCpuCaps("../../unit_test/testdata/arm_v7.txt")); + EXPECT_EQ(kCpuHasNEON, ArmCpuCaps("../../unit_test/testdata/tegra3.txt")); ++ EXPECT_EQ(kCpuHasNEON, ArmCpuCaps("../../unit_test/testdata/juno.txt")); + } else { + printf("WARNING: unable to load \"../../unit_test/testdata/arm_v7.txt\"\n"); + } +-#if defined(__linux__) && defined(__ARM_NEON__) && !defined(__aarch64__) ++#if defined(__linux__) && defined(__ARM_NEON__) + if (FileExists("/proc/cpuinfo")) { + if (kCpuHasNEON != ArmCpuCaps("/proc/cpuinfo")) { +- // This can happen on Arm emulator but /proc/cpuinfo is from host. +- printf("WARNING: Neon build enabled but CPU does not have Neon\n"); ++ // This can happen on ARM emulator but /proc/cpuinfo is from host. ++ printf("WARNING: Neon build enabled but CPU does not have NEON\n"); + } + } else { + printf("WARNING: unable to load \"/proc/cpuinfo\"\n"); +@@ -276,29 +251,6 @@ TEST_F(LibYUVBaseTest, TestLinuxArm) { + #endif + } + +-#if defined(__linux__) && defined(__aarch64__) +-TEST_F(LibYUVBaseTest, TestLinuxAArch64) { +- // Values taken from a Cortex-A57 machine, only Neon available. +- EXPECT_EQ(kCpuHasNEON, AArch64CpuCaps(0xffU, 0x0U)); +- +- // Values taken from a Google Pixel 7. +- int expected = kCpuHasNEON | kCpuHasNeonDotProd; +- EXPECT_EQ(expected, AArch64CpuCaps(0x119fffU, 0x0U)); +- +- // Values taken from a Google Pixel 8. +- expected = kCpuHasNEON | kCpuHasNeonDotProd | kCpuHasNeonI8MM | kCpuHasSVE | +- kCpuHasSVE2; +- EXPECT_EQ(expected, AArch64CpuCaps(0x3fffffffU, 0x2f33fU)); +- +- // Values taken from a Neoverse N2 machine. +- EXPECT_EQ(expected, AArch64CpuCaps(0x3fffffffU, 0x2f3ffU)); +- +- // Check for SME feature detection. +- expected |= kCpuHasSME; +- EXPECT_EQ(expected, AArch64CpuCaps(0x3fffffffU, 0x82f3ffU)); +-} +-#endif +- + TEST_F(LibYUVBaseTest, TestLinuxMipsMsa) { + if (FileExists("../../unit_test/testdata/mips.txt")) { + printf("Note: testing to load \"../../unit_test/testdata/mips.txt\"\n"); +@@ -312,32 +264,6 @@ TEST_F(LibYUVBaseTest, TestLinuxMipsMsa) + } + } + +-TEST_F(LibYUVBaseTest, TestLinuxRVV) { +- if (FileExists("../../unit_test/testdata/riscv64.txt")) { +- printf("Note: testing to load \"../../unit_test/testdata/riscv64.txt\"\n"); +- +- EXPECT_EQ(0, RiscvCpuCaps("../../unit_test/testdata/riscv64.txt")); +- EXPECT_EQ(kCpuHasRVV, +- RiscvCpuCaps("../../unit_test/testdata/riscv64_rvv.txt")); +- EXPECT_EQ(kCpuHasRVV | kCpuHasRVVZVFH, +- RiscvCpuCaps("../../unit_test/testdata/riscv64_rvv_zvfh.txt")); +- } else { +- printf( +- "WARNING: unable to load " +- "\"../../unit_test/testdata/riscv64.txt\"\n"); +- } +-#if defined(__linux__) && defined(__riscv) +- if (FileExists("/proc/cpuinfo")) { +- if (!(kCpuHasRVV & RiscvCpuCaps("/proc/cpuinfo"))) { +- // This can happen on RVV emulator but /proc/cpuinfo is from host. +- printf("WARNING: RVV build enabled but CPU does not have RVV\n"); +- } +- } else { +- printf("WARNING: unable to load \"/proc/cpuinfo\"\n"); +- } +-#endif +-} +- + // TODO(fbarchard): Fix clangcl test of cpuflags. + #ifdef _MSC_VER + TEST_F(LibYUVBaseTest, DISABLED_TestSetCpuFlags) { +diff --git a/media/libyuv/libyuv/unit_test/planar_test.cc b/media/libyuv/libyuv/unit_test/planar_test.cc +--- a/media/libyuv/libyuv/unit_test/planar_test.cc ++++ b/media/libyuv/libyuv/unit_test/planar_test.cc +@@ -30,9 +30,9 @@ + #endif + + #if defined(LIBYUV_BIT_EXACT) +-#define EXPECTED_UNATTENUATE_DIFF 0 ++#define EXPECTED_ATTENUATE_DIFF 0 + #else +-#define EXPECTED_UNATTENUATE_DIFF 2 ++#define EXPECTED_ATTENUATE_DIFF 2 + #endif + + namespace libyuv { +@@ -57,17 +57,12 @@ TEST_F(LibYUVPlanarTest, TestAttenuate) + orig_pixels[2 * 4 + 0] = 16u; + orig_pixels[2 * 4 + 1] = 64u; + orig_pixels[2 * 4 + 2] = 192u; +- orig_pixels[2 * 4 + 3] = 128u; ++ orig_pixels[2 * 4 + 3] = 255u; + orig_pixels[3 * 4 + 0] = 16u; + orig_pixels[3 * 4 + 1] = 64u; + orig_pixels[3 * 4 + 2] = 192u; +- orig_pixels[3 * 4 + 3] = 255u; +- orig_pixels[4 * 4 + 0] = 255u; +- orig_pixels[4 * 4 + 1] = 255u; +- orig_pixels[4 * 4 + 2] = 255u; +- orig_pixels[4 * 4 + 3] = 255u; +- +- ARGBUnattenuate(orig_pixels, 0, unatten_pixels, 0, 5, 1); ++ orig_pixels[3 * 4 + 3] = 128u; ++ ARGBUnattenuate(orig_pixels, 0, unatten_pixels, 0, 4, 1); + EXPECT_EQ(255u, unatten_pixels[0 * 4 + 0]); + EXPECT_EQ(255u, unatten_pixels[0 * 4 + 1]); + EXPECT_EQ(254u, unatten_pixels[0 * 4 + 2]); +@@ -76,55 +71,14 @@ TEST_F(LibYUVPlanarTest, TestAttenuate) + EXPECT_EQ(0u, unatten_pixels[1 * 4 + 1]); + EXPECT_EQ(0u, unatten_pixels[1 * 4 + 2]); + EXPECT_EQ(0u, unatten_pixels[1 * 4 + 3]); +- EXPECT_EQ(32u, unatten_pixels[2 * 4 + 0]); +- EXPECT_EQ(128u, unatten_pixels[2 * 4 + 1]); +- EXPECT_EQ(255u, unatten_pixels[2 * 4 + 2]); +- EXPECT_EQ(128u, unatten_pixels[2 * 4 + 3]); +- EXPECT_EQ(16u, unatten_pixels[3 * 4 + 0]); +- EXPECT_EQ(64u, unatten_pixels[3 * 4 + 1]); +- EXPECT_EQ(192u, unatten_pixels[3 * 4 + 2]); +- EXPECT_EQ(255u, unatten_pixels[3 * 4 + 3]); +- EXPECT_EQ(255u, unatten_pixels[4 * 4 + 0]); +- EXPECT_EQ(255u, unatten_pixels[4 * 4 + 1]); +- EXPECT_EQ(255u, unatten_pixels[4 * 4 + 2]); +- EXPECT_EQ(255u, unatten_pixels[4 * 4 + 3]); +- +- ARGBAttenuate(orig_pixels, 0, atten_pixels, 0, 5, 1); +- EXPECT_EQ(100u, atten_pixels[0 * 4 + 0]); +- EXPECT_EQ(65u, atten_pixels[0 * 4 + 1]); +- EXPECT_EQ(64u, atten_pixels[0 * 4 + 2]); +- EXPECT_EQ(128u, atten_pixels[0 * 4 + 3]); +- EXPECT_EQ(0u, atten_pixels[1 * 4 + 0]); +- EXPECT_EQ(0u, atten_pixels[1 * 4 + 1]); +- EXPECT_EQ(0u, atten_pixels[1 * 4 + 2]); +- EXPECT_EQ(0u, atten_pixels[1 * 4 + 3]); +- EXPECT_EQ(8u, atten_pixels[2 * 4 + 0]); +- EXPECT_EQ(32u, atten_pixels[2 * 4 + 1]); +- EXPECT_EQ(96u, atten_pixels[2 * 4 + 2]); +- EXPECT_EQ(128u, atten_pixels[2 * 4 + 3]); +- EXPECT_EQ(16u, atten_pixels[3 * 4 + 0]); +- EXPECT_EQ(64u, atten_pixels[3 * 4 + 1]); +- EXPECT_EQ(192u, atten_pixels[3 * 4 + 2]); +- EXPECT_EQ(255u, atten_pixels[3 * 4 + 3]); +- EXPECT_EQ(255u, atten_pixels[4 * 4 + 0]); +- EXPECT_EQ(255u, atten_pixels[4 * 4 + 1]); +- EXPECT_EQ(255u, atten_pixels[4 * 4 + 2]); +- EXPECT_EQ(255u, atten_pixels[4 * 4 + 3]); +- +- // test 255 +- for (int i = 0; i < 256; ++i) { +- orig_pixels[i * 4 + 0] = i; +- orig_pixels[i * 4 + 1] = 0; +- orig_pixels[i * 4 + 2] = 0; +- orig_pixels[i * 4 + 3] = 255; +- } +- ARGBAttenuate(orig_pixels, 0, atten_pixels, 0, 256, 1); +- for (int i = 0; i < 256; ++i) { +- EXPECT_EQ(orig_pixels[i * 4 + 0], atten_pixels[i * 4 + 0]); +- EXPECT_EQ(0, atten_pixels[i * 4 + 1]); +- EXPECT_EQ(0, atten_pixels[i * 4 + 2]); +- EXPECT_EQ(255, atten_pixels[i * 4 + 3]); +- } ++ EXPECT_EQ(16u, unatten_pixels[2 * 4 + 0]); ++ EXPECT_EQ(64u, unatten_pixels[2 * 4 + 1]); ++ EXPECT_EQ(192u, unatten_pixels[2 * 4 + 2]); ++ EXPECT_EQ(255u, unatten_pixels[2 * 4 + 3]); ++ EXPECT_EQ(32u, unatten_pixels[3 * 4 + 0]); ++ EXPECT_EQ(128u, unatten_pixels[3 * 4 + 1]); ++ EXPECT_EQ(255u, unatten_pixels[3 * 4 + 2]); ++ EXPECT_EQ(128u, unatten_pixels[3 * 4 + 3]); + + for (int i = 0; i < 1280; ++i) { + orig_pixels[i * 4 + 0] = i; +@@ -138,10 +92,10 @@ TEST_F(LibYUVPlanarTest, TestAttenuate) + ARGBAttenuate(unatten_pixels, 0, atten2_pixels, 0, 1280, 1); + } + for (int i = 0; i < 1280; ++i) { +- EXPECT_NEAR(atten_pixels[i * 4 + 0], atten2_pixels[i * 4 + 0], 1); +- EXPECT_NEAR(atten_pixels[i * 4 + 1], atten2_pixels[i * 4 + 1], 1); +- EXPECT_NEAR(atten_pixels[i * 4 + 2], atten2_pixels[i * 4 + 2], 1); +- EXPECT_NEAR(atten_pixels[i * 4 + 3], atten2_pixels[i * 4 + 3], 1); ++ EXPECT_NEAR(atten_pixels[i * 4 + 0], atten2_pixels[i * 4 + 0], 2); ++ EXPECT_NEAR(atten_pixels[i * 4 + 1], atten2_pixels[i * 4 + 1], 2); ++ EXPECT_NEAR(atten_pixels[i * 4 + 2], atten2_pixels[i * 4 + 2], 2); ++ EXPECT_NEAR(atten_pixels[i * 4 + 3], atten2_pixels[i * 4 + 3], 2); + } + // Make sure transparent, 50% and opaque are fully accurate. + EXPECT_EQ(0, atten_pixels[0 * 4 + 0]); +@@ -152,9 +106,9 @@ TEST_F(LibYUVPlanarTest, TestAttenuate) + EXPECT_EQ(32, atten_pixels[128 * 4 + 1]); + EXPECT_EQ(21, atten_pixels[128 * 4 + 2]); + EXPECT_EQ(128, atten_pixels[128 * 4 + 3]); +- EXPECT_EQ(255, atten_pixels[255 * 4 + 0]); +- EXPECT_EQ(127, atten_pixels[255 * 4 + 1]); +- EXPECT_EQ(85, atten_pixels[255 * 4 + 2]); ++ EXPECT_NEAR(254, atten_pixels[255 * 4 + 0], EXPECTED_ATTENUATE_DIFF); ++ EXPECT_NEAR(127, atten_pixels[255 * 4 + 1], EXPECTED_ATTENUATE_DIFF); ++ EXPECT_NEAR(85, atten_pixels[255 * 4 + 2], EXPECTED_ATTENUATE_DIFF); + EXPECT_EQ(255, atten_pixels[255 * 4 + 3]); + + free_aligned_buffer_page_end(atten2_pixels); +@@ -211,28 +165,28 @@ TEST_F(LibYUVPlanarTest, ARGBAttenuate_A + benchmark_iterations_, disable_cpu_flags_, + benchmark_cpu_info_, +1, 0); + +- EXPECT_EQ(max_diff, 0); ++ EXPECT_LE(max_diff, EXPECTED_ATTENUATE_DIFF); + } + + TEST_F(LibYUVPlanarTest, ARGBAttenuate_Unaligned) { + int max_diff = + TestAttenuateI(benchmark_width_, benchmark_height_, benchmark_iterations_, + disable_cpu_flags_, benchmark_cpu_info_, +1, 1); +- EXPECT_EQ(max_diff, 0); ++ EXPECT_LE(max_diff, EXPECTED_ATTENUATE_DIFF); + } + + TEST_F(LibYUVPlanarTest, ARGBAttenuate_Invert) { + int max_diff = + TestAttenuateI(benchmark_width_, benchmark_height_, benchmark_iterations_, + disable_cpu_flags_, benchmark_cpu_info_, -1, 0); +- EXPECT_EQ(max_diff, 0); ++ EXPECT_LE(max_diff, EXPECTED_ATTENUATE_DIFF); + } + + TEST_F(LibYUVPlanarTest, ARGBAttenuate_Opt) { + int max_diff = + TestAttenuateI(benchmark_width_, benchmark_height_, benchmark_iterations_, + disable_cpu_flags_, benchmark_cpu_info_, +1, 0); +- EXPECT_EQ(max_diff, 0); ++ EXPECT_LE(max_diff, EXPECTED_ATTENUATE_DIFF); + } + + static int TestUnattenuateI(int width, +@@ -284,28 +238,28 @@ TEST_F(LibYUVPlanarTest, ARGBUnattenuate + int max_diff = TestUnattenuateI(benchmark_width_ + 1, benchmark_height_, + benchmark_iterations_, disable_cpu_flags_, + benchmark_cpu_info_, +1, 0); +- EXPECT_LE(max_diff, EXPECTED_UNATTENUATE_DIFF); ++ EXPECT_LE(max_diff, EXPECTED_ATTENUATE_DIFF); + } + + TEST_F(LibYUVPlanarTest, ARGBUnattenuate_Unaligned) { + int max_diff = TestUnattenuateI(benchmark_width_, benchmark_height_, + benchmark_iterations_, disable_cpu_flags_, + benchmark_cpu_info_, +1, 1); +- EXPECT_LE(max_diff, EXPECTED_UNATTENUATE_DIFF); ++ EXPECT_LE(max_diff, EXPECTED_ATTENUATE_DIFF); + } + + TEST_F(LibYUVPlanarTest, ARGBUnattenuate_Invert) { + int max_diff = TestUnattenuateI(benchmark_width_, benchmark_height_, + benchmark_iterations_, disable_cpu_flags_, + benchmark_cpu_info_, -1, 0); +- EXPECT_LE(max_diff, EXPECTED_UNATTENUATE_DIFF); ++ EXPECT_LE(max_diff, EXPECTED_ATTENUATE_DIFF); + } + + TEST_F(LibYUVPlanarTest, ARGBUnattenuate_Opt) { + int max_diff = TestUnattenuateI(benchmark_width_, benchmark_height_, + benchmark_iterations_, disable_cpu_flags_, + benchmark_cpu_info_, +1, 0); +- EXPECT_LE(max_diff, EXPECTED_UNATTENUATE_DIFF); ++ EXPECT_LE(max_diff, EXPECTED_ATTENUATE_DIFF); + } + + TEST_F(LibYUVPlanarTest, TestARGBComputeCumulativeSum) { +@@ -2551,12 +2505,11 @@ int TestHalfFloatPlane(int benchmark_wid + #if defined(__arm__) + static void EnableFlushDenormalToZero(void) { + uint32_t cw; +- asm volatile ( +- "vmrs %0, fpscr \n" +- "orr %0, %0, #0x1000000 \n" +- "vmsr fpscr, %0 \n" +- : "=r"(cw) +- ::"memory", "cc"); // Clobber List ++ __asm__ __volatile__( ++ "vmrs %0, fpscr \n" ++ "orr %0, %0, #0x1000000 \n" ++ "vmsr fpscr, %0 \n" ++ : "=r"(cw)::"memory"); + } + #endif + +@@ -2796,23 +2749,12 @@ TEST_F(LibYUVPlanarTest, TestARGBExtract + MaskCpuFlags(disable_cpu_flags_); + ARGBExtractAlpha(src_pixels, benchmark_width_ * 4, dst_pixels_c, + benchmark_width_, benchmark_width_, benchmark_height_); +- double c_time = get_time(); +- ARGBExtractAlpha(src_pixels, benchmark_width_ * 4, dst_pixels_c, +- benchmark_width_, benchmark_width_, benchmark_height_); +- c_time = (get_time() - c_time); +- + MaskCpuFlags(benchmark_cpu_info_); +- ARGBExtractAlpha(src_pixels, benchmark_width_ * 4, dst_pixels_opt, +- benchmark_width_, benchmark_width_, benchmark_height_); +- double opt_time = get_time(); ++ + for (int i = 0; i < benchmark_iterations_; ++i) { + ARGBExtractAlpha(src_pixels, benchmark_width_ * 4, dst_pixels_opt, + benchmark_width_, benchmark_width_, benchmark_height_); + } +- opt_time = (get_time() - opt_time) / benchmark_iterations_; +- // Report performance of C vs OPT +- printf("%8d us C - %8d us OPT\n", static_cast(c_time * 1e6), +- static_cast(opt_time * 1e6)); + for (int i = 0; i < kPixels; ++i) { + EXPECT_EQ(dst_pixels_c[i], dst_pixels_opt[i]); + } +@@ -2835,24 +2777,12 @@ TEST_F(LibYUVPlanarTest, TestARGBCopyYTo + MaskCpuFlags(disable_cpu_flags_); + ARGBCopyYToAlpha(orig_pixels, benchmark_width_, dst_pixels_c, + benchmark_width_ * 4, benchmark_width_, benchmark_height_); +- double c_time = get_time(); +- ARGBCopyYToAlpha(orig_pixels, benchmark_width_, dst_pixels_c, +- benchmark_width_ * 4, benchmark_width_, benchmark_height_); +- c_time = (get_time() - c_time); +- + MaskCpuFlags(benchmark_cpu_info_); +- ARGBCopyYToAlpha(orig_pixels, benchmark_width_, dst_pixels_opt, +- benchmark_width_ * 4, benchmark_width_, benchmark_height_); +- double opt_time = get_time(); ++ + for (int i = 0; i < benchmark_iterations_; ++i) { + ARGBCopyYToAlpha(orig_pixels, benchmark_width_, dst_pixels_opt, + benchmark_width_ * 4, benchmark_width_, benchmark_height_); + } +- opt_time = (get_time() - opt_time) / benchmark_iterations_; +- +- // Report performance of C vs OPT +- printf("%8d us C - %8d us OPT\n", static_cast(c_time * 1e6), +- static_cast(opt_time * 1e6)); + for (int i = 0; i < kPixels * 4; ++i) { + EXPECT_EQ(dst_pixels_c[i], dst_pixels_opt[i]); + } +@@ -3604,8 +3534,8 @@ TESTTPLANARTOP(MergeXR30, uint16_t, uint + // TODO(fbarchard): improve test for platforms and cpu detect + #ifdef HAS_MERGEUVROW_16_AVX2 + TEST_F(LibYUVPlanarTest, MergeUVRow_16_Opt) { +- // Round count up to multiple of 8 +- const int kPixels = (benchmark_width_ * benchmark_height_ + 7) & ~7; ++ // Round count up to multiple of 16 ++ const int kPixels = (benchmark_width_ * benchmark_height_ + 15) & ~15; + + align_buffer_page_end(src_pixels_u, kPixels * 2); + align_buffer_page_end(src_pixels_v, kPixels * 2); +@@ -4538,83 +4468,4 @@ TEST_F(LibYUVPlanarTest, NV21Copy) { + free_aligned_buffer_page_end(dst_vu); + } + +-#if defined(ENABLE_ROW_TESTS) && !defined(LIBYUV_DISABLE_NEON) && \ +- defined(__aarch64__) +- +-TEST_F(LibYUVPlanarTest, TestConvertFP16ToFP32) { +- int i, j; +- const int y_plane_size = benchmark_width_ * benchmark_height_; +- +- align_buffer_page_end(orig_f, y_plane_size * 4); +- align_buffer_page_end(orig_y, y_plane_size * 2); +- align_buffer_page_end(dst_opt, y_plane_size * 4); +- align_buffer_page_end(rec_opt, y_plane_size * 2); +- +- for (i = 0; i < y_plane_size; ++i) { +- ((float*)orig_f)[i] = (float)(i % 10000) * 3.14f; +- } +- memset(orig_y, 1, y_plane_size * 2); +- memset(dst_opt, 2, y_plane_size * 4); +- memset(rec_opt, 3, y_plane_size * 2); +- +- ConvertFP32ToFP16Row_NEON((const float*)orig_f, (uint16_t*)orig_y, +- y_plane_size); +- +- for (j = 0; j < benchmark_iterations_; j++) { +- ConvertFP16ToFP32Row_NEON((const uint16_t*)orig_y, (float*)dst_opt, +- y_plane_size); +- } +- +- ConvertFP32ToFP16Row_NEON((const float*)dst_opt, (uint16_t*)rec_opt, +- y_plane_size); +- +- for (i = 0; i < y_plane_size; ++i) { +- EXPECT_EQ(((const uint16_t*)orig_y)[i], ((const uint16_t*)rec_opt)[i]); +- } +- +- free_aligned_buffer_page_end(orig_f); +- free_aligned_buffer_page_end(orig_y); +- free_aligned_buffer_page_end(dst_opt); +- free_aligned_buffer_page_end(rec_opt); +-} +- +-TEST_F(LibYUVPlanarTest, TestConvertFP16ToFP32Column) { +- int i, j; +- const int y_plane_size = benchmark_width_ * benchmark_height_; +- +- align_buffer_page_end(orig_f, y_plane_size * 4); +- align_buffer_page_end(orig_y, y_plane_size * 2); +- align_buffer_page_end(dst_opt, y_plane_size * 4); +- align_buffer_page_end(rec_opt, y_plane_size * 2); +- +- for (i = 0; i < y_plane_size; ++i) { +- ((float*)orig_f)[i] = (float)(i % 10000) * 3.14f; +- } +- memset(orig_y, 1, y_plane_size * 2); +- memset(dst_opt, 2, y_plane_size * 4); +- memset(rec_opt, 3, y_plane_size * 2); +- +- ConvertFP32ToFP16Row_NEON((const float*)orig_f, (uint16_t*)orig_y, +- y_plane_size); +- +- for (j = 0; j < benchmark_iterations_; j++) { +- ConvertFP16ToFP32Column_NEON((const uint16_t*)orig_y, 1, (float*)dst_opt, +- y_plane_size); +- } +- +- ConvertFP32ToFP16Row_NEON((const float*)dst_opt, (uint16_t*)rec_opt, +- y_plane_size); +- +- for (i = 0; i < y_plane_size; ++i) { +- EXPECT_EQ(((const uint16_t*)orig_y)[i], ((const uint16_t*)rec_opt)[i]); +- } +- +- free_aligned_buffer_page_end(orig_f); +- free_aligned_buffer_page_end(orig_y); +- free_aligned_buffer_page_end(dst_opt); +- free_aligned_buffer_page_end(rec_opt); +-} +- +-#endif // defined(ENABLE_ROW_TESTS) && defined(__aarch64__) +- + } // namespace libyuv +diff --git a/media/libyuv/libyuv/unit_test/rotate_test.cc b/media/libyuv/libyuv/unit_test/rotate_test.cc +--- a/media/libyuv/libyuv/unit_test/rotate_test.cc ++++ b/media/libyuv/libyuv/unit_test/rotate_test.cc +@@ -864,55 +864,7 @@ TEST_F(LibYUVRotateTest, I410Rotate270_O + + #if defined(ENABLE_ROW_TESTS) + +-TEST_F(LibYUVRotateTest, Transpose4x4_Test) { +- // dst width and height +- const int width = 4; +- const int height = 4; +- int src_pixels[4][4]; +- int dst_pixels_c[4][4]; +- int dst_pixels_opt[4][4]; +- +- for (int i = 0; i < 4; ++i) { +- for (int j = 0; j < 4; ++j) { +- src_pixels[i][j] = i * 10 + j; +- } +- } +- memset(dst_pixels_c, 1, width * height * 4); +- memset(dst_pixels_opt, 2, width * height * 4); +- +- Transpose4x4_32_C((const uint8_t*)src_pixels, height * 4, +- (uint8_t*)dst_pixels_c, width * 4, width); +- +- const int benchmark_iterations = +- (benchmark_iterations_ * benchmark_width_ * benchmark_height_ + 15) / +- (4 * 4); +- for (int i = 0; i < benchmark_iterations; ++i) { +-#if defined(HAS_TRANSPOSE4X4_32_NEON) +- if (TestCpuFlag(kCpuHasNEON)) { +- Transpose4x4_32_NEON((const uint8_t*)src_pixels, height * 4, +- (uint8_t*)dst_pixels_opt, width * 4, width); +- } else +-#elif defined(HAS_TRANSPOSE4X4_32_SSE2) +- if (TestCpuFlag(kCpuHasSSE2)) { +- Transpose4x4_32_SSE2((const uint8_t*)src_pixels, height * 4, +- (uint8_t*)dst_pixels_opt, width * 4, width); +- } else +-#endif +- { +- Transpose4x4_32_C((const uint8_t*)src_pixels, height * 4, +- (uint8_t*)dst_pixels_opt, width * 4, width); +- } +- } +- +- for (int i = 0; i < 4; ++i) { +- for (int j = 0; j < 4; ++j) { +- EXPECT_EQ(dst_pixels_c[i][j], src_pixels[j][i]); +- EXPECT_EQ(dst_pixels_c[i][j], dst_pixels_opt[i][j]); +- } +- } +-} +- +-TEST_F(LibYUVRotateTest, Transpose4x4_Opt) { ++TEST_F(LibYUVRotateTest, Transpose4x4) { + // dst width and height + const int width = ((benchmark_width_ * benchmark_height_ + 3) / 4 + 3) & ~3; + const int height = 4; +@@ -922,35 +874,29 @@ TEST_F(LibYUVRotateTest, Transpose4x4_Op + + MemRandomize(src_pixels, height * width * 4); + memset(dst_pixels_c, 1, width * height * 4); +- memset(dst_pixels_opt, 2, width * height * 4); ++ memset(dst_pixels_opt, 1, width * height * 4); + + Transpose4x4_32_C((const uint8_t*)src_pixels, height * 4, + (uint8_t*)dst_pixels_c, width * 4, width); + + for (int i = 0; i < benchmark_iterations_; ++i) { +-#if defined(HAS_TRANSPOSE4X4_32_NEON) ++#if defined(__aarch64__) + if (TestCpuFlag(kCpuHasNEON)) { + Transpose4x4_32_NEON((const uint8_t*)src_pixels, height * 4, + (uint8_t*)dst_pixels_opt, width * 4, width); +- } else +-#elif defined(HAS_TRANSPOSE4X4_32_AVX2) +- if (TestCpuFlag(kCpuHasAVX2)) { +- Transpose4x4_32_AVX2((const uint8_t*)src_pixels, height * 4, +- (uint8_t*)dst_pixels_opt, width * 4, width); +- } else if (TestCpuFlag(kCpuHasSSE2)) { +- Transpose4x4_32_SSE2((const uint8_t*)src_pixels, height * 4, +- (uint8_t*)dst_pixels_opt, width * 4, width); +- } else +-#endif +- { ++ } else { + Transpose4x4_32_C((const uint8_t*)src_pixels, height * 4, + (uint8_t*)dst_pixels_opt, width * 4, width); + } ++#else ++ Transpose4x4_32_C((const uint8_t*)src_pixels, height * 4, ++ (uint8_t*)dst_pixels_opt, width * 4, width); ++#endif + } + +- for (int i = 0; i < width * height; ++i) { +- EXPECT_EQ(dst_pixels_c[i], dst_pixels_opt[i]); +- } ++ // for (int i = 0; i < width * height; ++i) { ++ // EXPECT_EQ(dst_pixels_c[i], dst_pixels_opt[i]); ++ // } + + free_aligned_buffer_page_end(src_pixels); + free_aligned_buffer_page_end(dst_pixels_c); +diff --git a/media/libyuv/libyuv/unit_test/scale_test.cc b/media/libyuv/libyuv/unit_test/scale_test.cc +--- a/media/libyuv/libyuv/unit_test/scale_test.cc ++++ b/media/libyuv/libyuv/unit_test/scale_test.cc +@@ -22,11 +22,6 @@ + #define STRINGIZE(line) #line + #define FILELINESTR(file, line) file ":" STRINGIZE(line) + +-#if defined(__riscv) && !defined(__clang__) +-#define DISABLE_SLOW_TESTS +-#undef ENABLE_FULL_TESTS +-#endif +- + #if !defined(DISABLE_SLOW_TESTS) || defined(__x86_64__) || defined(__i386__) + // SLOW TESTS are those that are unoptimized C code. + // FULL TESTS are optimized but test many variations of the same code. +@@ -1128,6 +1123,479 @@ TEST_SCALESWAPXY1(DISABLED_, Scale, Bili + TEST_SCALESWAPXY1(DISABLED_, Scale, Box, 3) + #endif + #endif ++ + #undef TEST_SCALESWAPXY1 + ++#ifdef ENABLE_ROW_TESTS ++#ifdef HAS_SCALEROWDOWN2_SSSE3 ++TEST_F(LibYUVScaleTest, TestScaleRowDown2Box_Odd_SSSE3) { ++ SIMD_ALIGNED(uint8_t orig_pixels[128 * 2]); ++ SIMD_ALIGNED(uint8_t dst_pixels_opt[64]); ++ SIMD_ALIGNED(uint8_t dst_pixels_c[64]); ++ memset(orig_pixels, 0, sizeof(orig_pixels)); ++ memset(dst_pixels_opt, 0, sizeof(dst_pixels_opt)); ++ memset(dst_pixels_c, 0, sizeof(dst_pixels_c)); ++ ++ int has_ssse3 = TestCpuFlag(kCpuHasSSSE3); ++ if (!has_ssse3) { ++ printf("Warning SSSE3 not detected; Skipping test.\n"); ++ } else { ++ // TL. ++ orig_pixels[0] = 255u; ++ orig_pixels[1] = 0u; ++ orig_pixels[128 + 0] = 0u; ++ orig_pixels[128 + 1] = 0u; ++ // TR. ++ orig_pixels[2] = 0u; ++ orig_pixels[3] = 100u; ++ orig_pixels[128 + 2] = 0u; ++ orig_pixels[128 + 3] = 0u; ++ // BL. ++ orig_pixels[4] = 0u; ++ orig_pixels[5] = 0u; ++ orig_pixels[128 + 4] = 50u; ++ orig_pixels[128 + 5] = 0u; ++ // BR. ++ orig_pixels[6] = 0u; ++ orig_pixels[7] = 0u; ++ orig_pixels[128 + 6] = 0u; ++ orig_pixels[128 + 7] = 20u; ++ // Odd. ++ orig_pixels[126] = 4u; ++ orig_pixels[127] = 255u; ++ orig_pixels[128 + 126] = 16u; ++ orig_pixels[128 + 127] = 255u; ++ ++ // Test regular half size. ++ ScaleRowDown2Box_C(orig_pixels, 128, dst_pixels_c, 64); ++ ++ EXPECT_EQ(64u, dst_pixels_c[0]); ++ EXPECT_EQ(25u, dst_pixels_c[1]); ++ EXPECT_EQ(13u, dst_pixels_c[2]); ++ EXPECT_EQ(5u, dst_pixels_c[3]); ++ EXPECT_EQ(0u, dst_pixels_c[4]); ++ EXPECT_EQ(133u, dst_pixels_c[63]); ++ ++ // Test Odd width version - Last pixel is just 1 horizontal pixel. ++ ScaleRowDown2Box_Odd_C(orig_pixels, 128, dst_pixels_c, 64); ++ ++ EXPECT_EQ(64u, dst_pixels_c[0]); ++ EXPECT_EQ(25u, dst_pixels_c[1]); ++ EXPECT_EQ(13u, dst_pixels_c[2]); ++ EXPECT_EQ(5u, dst_pixels_c[3]); ++ EXPECT_EQ(0u, dst_pixels_c[4]); ++ EXPECT_EQ(10u, dst_pixels_c[63]); ++ ++ // Test one pixel less, should skip the last pixel. ++ memset(dst_pixels_c, 0, sizeof(dst_pixels_c)); ++ ScaleRowDown2Box_Odd_C(orig_pixels, 128, dst_pixels_c, 63); ++ ++ EXPECT_EQ(64u, dst_pixels_c[0]); ++ EXPECT_EQ(25u, dst_pixels_c[1]); ++ EXPECT_EQ(13u, dst_pixels_c[2]); ++ EXPECT_EQ(5u, dst_pixels_c[3]); ++ EXPECT_EQ(0u, dst_pixels_c[4]); ++ EXPECT_EQ(0u, dst_pixels_c[63]); ++ ++ // Test regular half size SSSE3. ++ ScaleRowDown2Box_SSSE3(orig_pixels, 128, dst_pixels_opt, 64); ++ ++ EXPECT_EQ(64u, dst_pixels_opt[0]); ++ EXPECT_EQ(25u, dst_pixels_opt[1]); ++ EXPECT_EQ(13u, dst_pixels_opt[2]); ++ EXPECT_EQ(5u, dst_pixels_opt[3]); ++ EXPECT_EQ(0u, dst_pixels_opt[4]); ++ EXPECT_EQ(133u, dst_pixels_opt[63]); ++ ++ // Compare C and SSSE3 match. ++ ScaleRowDown2Box_Odd_C(orig_pixels, 128, dst_pixels_c, 64); ++ ScaleRowDown2Box_Odd_SSSE3(orig_pixels, 128, dst_pixels_opt, 64); ++ for (int i = 0; i < 64; ++i) { ++ EXPECT_EQ(dst_pixels_c[i], dst_pixels_opt[i]); ++ } ++ } ++} ++#endif // HAS_SCALEROWDOWN2_SSSE3 ++ ++extern "C" void ScaleRowUp2_16_NEON(const uint16_t* src_ptr, ++ ptrdiff_t src_stride, ++ uint16_t* dst, ++ int dst_width); ++extern "C" void ScaleRowUp2_16_C(const uint16_t* src_ptr, ++ ptrdiff_t src_stride, ++ uint16_t* dst, ++ int dst_width); ++ ++TEST_F(LibYUVScaleTest, TestScaleRowUp2_16) { ++ SIMD_ALIGNED(uint16_t orig_pixels[640 * 2 + 1]); // 2 rows + 1 pixel overrun. ++ SIMD_ALIGNED(uint16_t dst_pixels_opt[1280]); ++ SIMD_ALIGNED(uint16_t dst_pixels_c[1280]); ++ ++ memset(orig_pixels, 0, sizeof(orig_pixels)); ++ memset(dst_pixels_opt, 1, sizeof(dst_pixels_opt)); ++ memset(dst_pixels_c, 2, sizeof(dst_pixels_c)); ++ ++ for (int i = 0; i < 640 * 2 + 1; ++i) { ++ orig_pixels[i] = i; ++ } ++ ScaleRowUp2_16_C(&orig_pixels[0], 640, &dst_pixels_c[0], 1280); ++ for (int i = 0; i < benchmark_pixels_div1280_; ++i) { ++#if !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__) ++ int has_neon = TestCpuFlag(kCpuHasNEON); ++ if (has_neon) { ++ ScaleRowUp2_16_NEON(&orig_pixels[0], 640, &dst_pixels_opt[0], 1280); ++ } else { ++ ScaleRowUp2_16_C(&orig_pixels[0], 640, &dst_pixels_opt[0], 1280); ++ } ++#else ++ ScaleRowUp2_16_C(&orig_pixels[0], 640, &dst_pixels_opt[0], 1280); ++#endif ++ } ++ ++ for (int i = 0; i < 1280; ++i) { ++ EXPECT_EQ(dst_pixels_c[i], dst_pixels_opt[i]); ++ } ++ EXPECT_EQ(dst_pixels_c[0], (0 * 9 + 1 * 3 + 640 * 3 + 641 * 1 + 8) / 16); ++ EXPECT_EQ(dst_pixels_c[1279], 800); ++} ++ ++extern "C" void ScaleRowDown2Box_16_NEON(const uint16_t* src_ptr, ++ ptrdiff_t src_stride, ++ uint16_t* dst, ++ int dst_width); ++ ++TEST_F(LibYUVScaleTest, TestScaleRowDown2Box_16) { ++ SIMD_ALIGNED(uint16_t orig_pixels[2560 * 2]); ++ SIMD_ALIGNED(uint16_t dst_pixels_c[1280]); ++ SIMD_ALIGNED(uint16_t dst_pixels_opt[1280]); ++ ++ memset(orig_pixels, 0, sizeof(orig_pixels)); ++ memset(dst_pixels_c, 1, sizeof(dst_pixels_c)); ++ memset(dst_pixels_opt, 2, sizeof(dst_pixels_opt)); ++ ++ for (int i = 0; i < 2560 * 2; ++i) { ++ orig_pixels[i] = i; ++ } ++ ScaleRowDown2Box_16_C(&orig_pixels[0], 2560, &dst_pixels_c[0], 1280); ++ for (int i = 0; i < benchmark_pixels_div1280_; ++i) { ++#if !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__) ++ int has_neon = TestCpuFlag(kCpuHasNEON); ++ if (has_neon) { ++ ScaleRowDown2Box_16_NEON(&orig_pixels[0], 2560, &dst_pixels_opt[0], 1280); ++ } else { ++ ScaleRowDown2Box_16_C(&orig_pixels[0], 2560, &dst_pixels_opt[0], 1280); ++ } ++#else ++ ScaleRowDown2Box_16_C(&orig_pixels[0], 2560, &dst_pixels_opt[0], 1280); ++#endif ++ } ++ ++ for (int i = 0; i < 1280; ++i) { ++ EXPECT_EQ(dst_pixels_c[i], dst_pixels_opt[i]); ++ } ++ ++ EXPECT_EQ(dst_pixels_c[0], (0 + 1 + 2560 + 2561 + 2) / 4); ++ EXPECT_EQ(dst_pixels_c[1279], 3839); ++} ++#endif // ENABLE_ROW_TESTS ++ ++// Test scaling plane with 8 bit C vs 12 bit C and return maximum pixel ++// difference. ++// 0 = exact. ++static int TestPlaneFilter_16(int src_width, ++ int src_height, ++ int dst_width, ++ int dst_height, ++ FilterMode f, ++ int benchmark_iterations, ++ int disable_cpu_flags, ++ int benchmark_cpu_info) { ++ if (!SizeValid(src_width, src_height, dst_width, dst_height)) { ++ return 0; ++ } ++ ++ int i; ++ int64_t src_y_plane_size = (Abs(src_width)) * (Abs(src_height)); ++ int src_stride_y = Abs(src_width); ++ int dst_y_plane_size = dst_width * dst_height; ++ int dst_stride_y = dst_width; ++ ++ align_buffer_page_end(src_y, src_y_plane_size); ++ align_buffer_page_end(src_y_16, src_y_plane_size * 2); ++ align_buffer_page_end(dst_y_8, dst_y_plane_size); ++ align_buffer_page_end(dst_y_16, dst_y_plane_size * 2); ++ uint16_t* p_src_y_16 = reinterpret_cast(src_y_16); ++ uint16_t* p_dst_y_16 = reinterpret_cast(dst_y_16); ++ ++ MemRandomize(src_y, src_y_plane_size); ++ memset(dst_y_8, 0, dst_y_plane_size); ++ memset(dst_y_16, 1, dst_y_plane_size * 2); ++ ++ for (i = 0; i < src_y_plane_size; ++i) { ++ p_src_y_16[i] = src_y[i] & 255; ++ } ++ ++ MaskCpuFlags(disable_cpu_flags); // Disable all CPU optimization. ++ ScalePlane(src_y, src_stride_y, src_width, src_height, dst_y_8, dst_stride_y, ++ dst_width, dst_height, f); ++ MaskCpuFlags(benchmark_cpu_info); // Enable all CPU optimization. ++ ++ for (i = 0; i < benchmark_iterations; ++i) { ++ ScalePlane_16(p_src_y_16, src_stride_y, src_width, src_height, p_dst_y_16, ++ dst_stride_y, dst_width, dst_height, f); ++ } ++ ++ // Expect an exact match. ++ int max_diff = 0; ++ for (i = 0; i < dst_y_plane_size; ++i) { ++ int abs_diff = Abs(dst_y_8[i] - p_dst_y_16[i]); ++ if (abs_diff > max_diff) { ++ max_diff = abs_diff; ++ } ++ } ++ ++ free_aligned_buffer_page_end(dst_y_8); ++ free_aligned_buffer_page_end(dst_y_16); ++ free_aligned_buffer_page_end(src_y); ++ free_aligned_buffer_page_end(src_y_16); ++ ++ return max_diff; ++} ++ ++// The following adjustments in dimensions ensure the scale factor will be ++// exactly achieved. ++// 2 is chroma subsample. ++#define DX(x, nom, denom) static_cast(((Abs(x) / nom + 1) / 2) * nom * 2) ++#define SX(x, nom, denom) static_cast(((x / nom + 1) / 2) * denom * 2) ++ ++#define TEST_FACTOR1(name, filter, nom, denom, max_diff) \ ++ TEST_F(LibYUVScaleTest, DISABLED_##ScalePlaneDownBy##name##_##filter##_16) { \ ++ int diff = TestPlaneFilter_16( \ ++ SX(benchmark_width_, nom, denom), SX(benchmark_height_, nom, denom), \ ++ DX(benchmark_width_, nom, denom), DX(benchmark_height_, nom, denom), \ ++ kFilter##filter, benchmark_iterations_, disable_cpu_flags_, \ ++ benchmark_cpu_info_); \ ++ EXPECT_LE(diff, max_diff); \ ++ } ++ ++// Test a scale factor with all 4 filters. Expect unfiltered to be exact, but ++// filtering is different fixed point implementations for SSSE3, Neon and C. ++#define TEST_FACTOR(name, nom, denom, boxdiff) \ ++ TEST_FACTOR1(name, None, nom, denom, 0) \ ++ TEST_FACTOR1(name, Linear, nom, denom, boxdiff) \ ++ TEST_FACTOR1(name, Bilinear, nom, denom, boxdiff) \ ++ TEST_FACTOR1(name, Box, nom, denom, boxdiff) ++ ++TEST_FACTOR(2, 1, 2, 0) ++TEST_FACTOR(4, 1, 4, 0) ++// TEST_FACTOR(8, 1, 8, 0) Disable for benchmark performance. Takes 90 seconds. ++TEST_FACTOR(3by4, 3, 4, 1) ++TEST_FACTOR(3by8, 3, 8, 1) ++TEST_FACTOR(3, 1, 3, 0) ++#undef TEST_FACTOR1 ++#undef TEST_FACTOR ++#undef SX ++#undef DX ++ ++TEST_F(LibYUVScaleTest, PlaneTest3x) { ++ const int kSrcStride = 480; ++ const int kDstStride = 160; ++ const int kSize = kSrcStride * 3; ++ align_buffer_page_end(orig_pixels, kSize); ++ for (int i = 0; i < 480 * 3; ++i) { ++ orig_pixels[i] = i; ++ } ++ align_buffer_page_end(dest_pixels, kDstStride); ++ ++ int iterations160 = (benchmark_width_ * benchmark_height_ + (160 - 1)) / 160 * ++ benchmark_iterations_; ++ for (int i = 0; i < iterations160; ++i) { ++ ScalePlane(orig_pixels, kSrcStride, 480, 3, dest_pixels, kDstStride, 160, 1, ++ kFilterBilinear); ++ } ++ ++ EXPECT_EQ(225, dest_pixels[0]); ++ ++ ScalePlane(orig_pixels, kSrcStride, 480, 3, dest_pixels, kDstStride, 160, 1, ++ kFilterNone); ++ ++ EXPECT_EQ(225, dest_pixels[0]); ++ ++ free_aligned_buffer_page_end(dest_pixels); ++ free_aligned_buffer_page_end(orig_pixels); ++} ++ ++TEST_F(LibYUVScaleTest, PlaneTest4x) { ++ const int kSrcStride = 640; ++ const int kDstStride = 160; ++ const int kSize = kSrcStride * 4; ++ align_buffer_page_end(orig_pixels, kSize); ++ for (int i = 0; i < 640 * 4; ++i) { ++ orig_pixels[i] = i; ++ } ++ align_buffer_page_end(dest_pixels, kDstStride); ++ ++ int iterations160 = (benchmark_width_ * benchmark_height_ + (160 - 1)) / 160 * ++ benchmark_iterations_; ++ for (int i = 0; i < iterations160; ++i) { ++ ScalePlane(orig_pixels, kSrcStride, 640, 4, dest_pixels, kDstStride, 160, 1, ++ kFilterBilinear); ++ } ++ ++ EXPECT_EQ(66, dest_pixels[0]); ++ ++ ScalePlane(orig_pixels, kSrcStride, 640, 4, dest_pixels, kDstStride, 160, 1, ++ kFilterNone); ++ ++ EXPECT_EQ(2, dest_pixels[0]); // expect the 3rd pixel of the 3rd row ++ ++ free_aligned_buffer_page_end(dest_pixels); ++ free_aligned_buffer_page_end(orig_pixels); ++} ++ ++// Intent is to test 200x50 to 50x200 but width and height can be parameters. ++TEST_F(LibYUVScaleTest, PlaneTestRotate_None) { ++ const int kSize = benchmark_width_ * benchmark_height_; ++ align_buffer_page_end(orig_pixels, kSize); ++ for (int i = 0; i < kSize; ++i) { ++ orig_pixels[i] = i; ++ } ++ align_buffer_page_end(dest_opt_pixels, kSize); ++ align_buffer_page_end(dest_c_pixels, kSize); ++ ++ MaskCpuFlags(disable_cpu_flags_); // Disable all CPU optimization. ++ ScalePlane(orig_pixels, benchmark_width_, benchmark_width_, benchmark_height_, ++ dest_c_pixels, benchmark_height_, benchmark_height_, ++ benchmark_width_, kFilterNone); ++ MaskCpuFlags(benchmark_cpu_info_); // Enable all CPU optimization. ++ ++ for (int i = 0; i < benchmark_iterations_; ++i) { ++ ScalePlane(orig_pixels, benchmark_width_, benchmark_width_, ++ benchmark_height_, dest_opt_pixels, benchmark_height_, ++ benchmark_height_, benchmark_width_, kFilterNone); ++ } ++ ++ for (int i = 0; i < kSize; ++i) { ++ EXPECT_EQ(dest_c_pixels[i], dest_opt_pixels[i]); ++ } ++ ++ free_aligned_buffer_page_end(dest_c_pixels); ++ free_aligned_buffer_page_end(dest_opt_pixels); ++ free_aligned_buffer_page_end(orig_pixels); ++} ++ ++TEST_F(LibYUVScaleTest, PlaneTestRotate_Bilinear) { ++ const int kSize = benchmark_width_ * benchmark_height_; ++ align_buffer_page_end(orig_pixels, kSize); ++ for (int i = 0; i < kSize; ++i) { ++ orig_pixels[i] = i; ++ } ++ align_buffer_page_end(dest_opt_pixels, kSize); ++ align_buffer_page_end(dest_c_pixels, kSize); ++ ++ MaskCpuFlags(disable_cpu_flags_); // Disable all CPU optimization. ++ ScalePlane(orig_pixels, benchmark_width_, benchmark_width_, benchmark_height_, ++ dest_c_pixels, benchmark_height_, benchmark_height_, ++ benchmark_width_, kFilterBilinear); ++ MaskCpuFlags(benchmark_cpu_info_); // Enable all CPU optimization. ++ ++ for (int i = 0; i < benchmark_iterations_; ++i) { ++ ScalePlane(orig_pixels, benchmark_width_, benchmark_width_, ++ benchmark_height_, dest_opt_pixels, benchmark_height_, ++ benchmark_height_, benchmark_width_, kFilterBilinear); ++ } ++ ++ for (int i = 0; i < kSize; ++i) { ++ EXPECT_EQ(dest_c_pixels[i], dest_opt_pixels[i]); ++ } ++ ++ free_aligned_buffer_page_end(dest_c_pixels); ++ free_aligned_buffer_page_end(dest_opt_pixels); ++ free_aligned_buffer_page_end(orig_pixels); ++} ++ ++// Intent is to test 200x50 to 50x200 but width and height can be parameters. ++TEST_F(LibYUVScaleTest, PlaneTestRotate_Box) { ++ const int kSize = benchmark_width_ * benchmark_height_; ++ align_buffer_page_end(orig_pixels, kSize); ++ for (int i = 0; i < kSize; ++i) { ++ orig_pixels[i] = i; ++ } ++ align_buffer_page_end(dest_opt_pixels, kSize); ++ align_buffer_page_end(dest_c_pixels, kSize); ++ ++ MaskCpuFlags(disable_cpu_flags_); // Disable all CPU optimization. ++ ScalePlane(orig_pixels, benchmark_width_, benchmark_width_, benchmark_height_, ++ dest_c_pixels, benchmark_height_, benchmark_height_, ++ benchmark_width_, kFilterBox); ++ MaskCpuFlags(benchmark_cpu_info_); // Enable all CPU optimization. ++ ++ for (int i = 0; i < benchmark_iterations_; ++i) { ++ ScalePlane(orig_pixels, benchmark_width_, benchmark_width_, ++ benchmark_height_, dest_opt_pixels, benchmark_height_, ++ benchmark_height_, benchmark_width_, kFilterBox); ++ } ++ ++ for (int i = 0; i < kSize; ++i) { ++ EXPECT_EQ(dest_c_pixels[i], dest_opt_pixels[i]); ++ } ++ ++ free_aligned_buffer_page_end(dest_c_pixels); ++ free_aligned_buffer_page_end(dest_opt_pixels); ++ free_aligned_buffer_page_end(orig_pixels); ++} ++ ++TEST_F(LibYUVScaleTest, PlaneTest1_Box) { ++ align_buffer_page_end(orig_pixels, 3); ++ align_buffer_page_end(dst_pixels, 3); ++ ++ // Pad the 1x1 byte image with invalid values before and after in case libyuv ++ // reads outside the memory boundaries. ++ orig_pixels[0] = 0; ++ orig_pixels[1] = 1; // scale this pixel ++ orig_pixels[2] = 2; ++ dst_pixels[0] = 3; ++ dst_pixels[1] = 3; ++ dst_pixels[2] = 3; ++ ++ libyuv::ScalePlane(orig_pixels + 1, /* src_stride= */ 1, /* src_width= */ 1, ++ /* src_height= */ 1, dst_pixels, /* dst_stride= */ 1, ++ /* dst_width= */ 1, /* dst_height= */ 2, ++ libyuv::kFilterBox); ++ ++ EXPECT_EQ(dst_pixels[0], 1); ++ EXPECT_EQ(dst_pixels[1], 1); ++ EXPECT_EQ(dst_pixels[2], 3); ++ ++ free_aligned_buffer_page_end(dst_pixels); ++ free_aligned_buffer_page_end(orig_pixels); ++} ++ ++TEST_F(LibYUVScaleTest, PlaneTest1_16_Box) { ++ align_buffer_page_end(orig_pixels_alloc, 3 * 2); ++ align_buffer_page_end(dst_pixels_alloc, 3 * 2); ++ uint16_t* orig_pixels = (uint16_t*)orig_pixels_alloc; ++ uint16_t* dst_pixels = (uint16_t*)dst_pixels_alloc; ++ ++ // Pad the 1x1 byte image with invalid values before and after in case libyuv ++ // reads outside the memory boundaries. ++ orig_pixels[0] = 0; ++ orig_pixels[1] = 1; // scale this pixel ++ orig_pixels[2] = 2; ++ dst_pixels[0] = 3; ++ dst_pixels[1] = 3; ++ dst_pixels[2] = 3; ++ ++ libyuv::ScalePlane_16( ++ orig_pixels + 1, /* src_stride= */ 1, /* src_width= */ 1, ++ /* src_height= */ 1, dst_pixels, /* dst_stride= */ 1, ++ /* dst_width= */ 1, /* dst_height= */ 2, libyuv::kFilterNone); ++ ++ EXPECT_EQ(dst_pixels[0], 1); ++ EXPECT_EQ(dst_pixels[1], 1); ++ EXPECT_EQ(dst_pixels[2], 3); ++ ++ free_aligned_buffer_page_end(dst_pixels_alloc); ++ free_aligned_buffer_page_end(orig_pixels_alloc); ++} + } // namespace libyuv +diff --git a/media/libyuv/libyuv/unit_test/scale_uv_test.cc b/media/libyuv/libyuv/unit_test/scale_uv_test.cc +--- a/media/libyuv/libyuv/unit_test/scale_uv_test.cc ++++ b/media/libyuv/libyuv/unit_test/scale_uv_test.cc +@@ -39,35 +39,55 @@ static int UVTestFilter(int src_width, + return 0; + } + +- int i; +- int64_t src_uv_plane_size = Abs(src_width) * Abs(src_height) * 2LL; +- int src_stride_uv = Abs(src_width) * 2; +- int64_t dst_uv_plane_size = dst_width * dst_height * 2LL; +- int dst_stride_uv = dst_width * 2; ++ int i, j; ++ const int b = 0; // 128 to test for padding/stride. ++ int64_t src_uv_plane_size = ++ (Abs(src_width) + b * 2) * (Abs(src_height) + b * 2) * 2LL; ++ int src_stride_uv = (b * 2 + Abs(src_width)) * 2; + + align_buffer_page_end(src_uv, src_uv_plane_size); +- align_buffer_page_end(dst_uv_c, dst_uv_plane_size); +- align_buffer_page_end(dst_uv_opt, dst_uv_plane_size); +- +- if (!src_uv || !dst_uv_c || !dst_uv_opt) { ++ if (!src_uv) { + printf("Skipped. Alloc failed " FILELINESTR(__FILE__, __LINE__) "\n"); + return 0; + } + MemRandomize(src_uv, src_uv_plane_size); ++ ++ int64_t dst_uv_plane_size = (dst_width + b * 2) * (dst_height + b * 2) * 2LL; ++ int dst_stride_uv = (b * 2 + dst_width) * 2; ++ ++ align_buffer_page_end(dst_uv_c, dst_uv_plane_size); ++ align_buffer_page_end(dst_uv_opt, dst_uv_plane_size); ++ if (!dst_uv_c || !dst_uv_opt) { ++ printf("Skipped. Alloc failed " FILELINESTR(__FILE__, __LINE__) "\n"); ++ return 0; ++ } + memset(dst_uv_c, 2, dst_uv_plane_size); +- memset(dst_uv_opt, 123, dst_uv_plane_size); ++ memset(dst_uv_opt, 3, dst_uv_plane_size); ++ ++ // Warm up both versions for consistent benchmarks. ++ MaskCpuFlags(disable_cpu_flags); // Disable all CPU optimization. ++ UVScale(src_uv + (src_stride_uv * b) + b * 2, src_stride_uv, src_width, ++ src_height, dst_uv_c + (dst_stride_uv * b) + b * 2, dst_stride_uv, ++ dst_width, dst_height, f); ++ MaskCpuFlags(benchmark_cpu_info); // Enable all CPU optimization. ++ UVScale(src_uv + (src_stride_uv * b) + b * 2, src_stride_uv, src_width, ++ src_height, dst_uv_opt + (dst_stride_uv * b) + b * 2, dst_stride_uv, ++ dst_width, dst_height, f); + + MaskCpuFlags(disable_cpu_flags); // Disable all CPU optimization. + double c_time = get_time(); +- UVScale(src_uv, src_stride_uv, src_width, src_height, dst_uv_c, dst_stride_uv, ++ UVScale(src_uv + (src_stride_uv * b) + b * 2, src_stride_uv, src_width, ++ src_height, dst_uv_c + (dst_stride_uv * b) + b * 2, dst_stride_uv, + dst_width, dst_height, f); ++ + c_time = (get_time() - c_time); + + MaskCpuFlags(benchmark_cpu_info); // Enable all CPU optimization. + double opt_time = get_time(); + for (i = 0; i < benchmark_iterations; ++i) { +- UVScale(src_uv, src_stride_uv, src_width, src_height, dst_uv_opt, +- dst_stride_uv, dst_width, dst_height, f); ++ UVScale(src_uv + (src_stride_uv * b) + b * 2, src_stride_uv, src_width, ++ src_height, dst_uv_opt + (dst_stride_uv * b) + b * 2, dst_stride_uv, ++ dst_width, dst_height, f); + } + opt_time = (get_time() - opt_time) / benchmark_iterations; + +@@ -75,11 +95,18 @@ static int UVTestFilter(int src_width, + printf("filter %d - %8d us C - %8d us OPT\n", f, + static_cast(c_time * 1e6), static_cast(opt_time * 1e6)); + ++ // C version may be a little off from the optimized. Order of ++ // operations may introduce rounding somewhere. So do a difference ++ // of the buffers and look to see that the max difference isn't ++ // over 2. + int max_diff = 0; +- for (i = 0; i < dst_uv_plane_size; ++i) { +- int abs_diff = Abs(dst_uv_c[i] - dst_uv_opt[i]); +- if (abs_diff > max_diff) { +- max_diff = abs_diff; ++ for (i = b; i < (dst_height + b); ++i) { ++ for (j = b * 2; j < (dst_width + b) * 2; ++j) { ++ int abs_diff = Abs(dst_uv_c[(i * dst_stride_uv) + j] - ++ dst_uv_opt[(i * dst_stride_uv) + j]); ++ if (abs_diff > max_diff) { ++ max_diff = abs_diff; ++ } + } + } + +@@ -94,26 +121,28 @@ static int UVTestFilter(int src_width, + #define DX(x, nom, denom) static_cast((Abs(x) / nom) * nom) + #define SX(x, nom, denom) static_cast((x / nom) * denom) + +-#define TEST_FACTOR1(name, filter, nom, denom) \ ++#define TEST_FACTOR1(name, filter, nom, denom, max_diff) \ + TEST_F(LibYUVScaleTest, UVScaleDownBy##name##_##filter) { \ + int diff = UVTestFilter( \ + SX(benchmark_width_, nom, denom), SX(benchmark_height_, nom, denom), \ + DX(benchmark_width_, nom, denom), DX(benchmark_height_, nom, denom), \ + kFilter##filter, benchmark_iterations_, disable_cpu_flags_, \ + benchmark_cpu_info_); \ +- EXPECT_EQ(0, diff); \ ++ EXPECT_LE(diff, max_diff); \ + } + + #if defined(ENABLE_FULL_TESTS) +-// Test a scale factor with all 4 filters. Expect exact for SIMD vs C. +-#define TEST_FACTOR(name, nom, denom) \ +- TEST_FACTOR1(name, None, nom, denom) \ +- TEST_FACTOR1(name, Linear, nom, denom) \ +- TEST_FACTOR1(name, Bilinear, nom, denom) \ +- TEST_FACTOR1(name, Box, nom, denom) ++// Test a scale factor with all 4 filters. Expect unfiltered to be exact, but ++// filtering is different fixed point implementations for SSSE3, Neon and C. ++#define TEST_FACTOR(name, nom, denom) \ ++ TEST_FACTOR1(name, None, nom, denom, 0) \ ++ TEST_FACTOR1(name, Linear, nom, denom, 3) \ ++ TEST_FACTOR1(name, Bilinear, nom, denom, 3) \ ++ TEST_FACTOR1(name, Box, nom, denom, 3) + #else + // Test a scale factor with Bilinear. +-#define TEST_FACTOR(name, nom, denom) TEST_FACTOR1(name, Bilinear, nom, denom) ++#define TEST_FACTOR(name, nom, denom) \ ++ TEST_FACTOR1(name, Bilinear, nom, denom, 3) + #endif + + TEST_FACTOR(2, 1, 2) +diff --git a/media/libyuv/libyuv/unit_test/unit_test.cc b/media/libyuv/libyuv/unit_test/unit_test.cc +--- a/media/libyuv/libyuv/unit_test/unit_test.cc ++++ b/media/libyuv/libyuv/unit_test/unit_test.cc +@@ -88,11 +88,6 @@ int TestCpuEnv(int cpu_info) { + cpu_info &= ~libyuv::kCpuHasLASX; + } + #endif +-#if defined(__riscv) && defined(__linux__) +- if (TestEnv("LIBYUV_DISABLE_RVV")) { +- cpu_info &= ~libyuv::kCpuHasRVV; +- } +-#endif + #if !defined(__pnacl__) && !defined(__CLR_VER) && \ + (defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || \ + defined(_M_IX86)) +@@ -144,17 +139,11 @@ int TestCpuEnv(int cpu_info) { + if (TestEnv("LIBYUV_DISABLE_AVX512VBITALG")) { + cpu_info &= ~libyuv::kCpuHasAVX512VBITALG; + } +- if (TestEnv("LIBYUV_DISABLE_AVX10")) { +- cpu_info &= ~libyuv::kCpuHasAVX10; +- } +- if (TestEnv("LIBYUV_DISABLE_AVXVNNI")) { +- cpu_info &= ~libyuv::kCpuHasAVXVNNI; ++ if (TestEnv("LIBYUV_DISABLE_AVX512VPOPCNTDQ")) { ++ cpu_info &= ~libyuv::kCpuHasAVX512VPOPCNTDQ; + } +- if (TestEnv("LIBYUV_DISABLE_AVXVNNIINT8")) { +- cpu_info &= ~libyuv::kCpuHasAVXVNNIINT8; +- } +- if (TestEnv("LIBYUV_DISABLE_AMXINT8")) { +- cpu_info &= ~libyuv::kCpuHasAMXINT8; ++ if (TestEnv("LIBYUV_DISABLE_GFNI")) { ++ cpu_info &= ~libyuv::kCpuHasGFNI; + } + #endif + if (TestEnv("LIBYUV_DISABLE_ASM")) { +@@ -207,7 +196,7 @@ LibYUVConvertTest::LibYUVConvertTest() + } + const char* cpu_info = getenv("LIBYUV_CPU_INFO"); + if (cpu_info) { +- benchmark_cpu_info_ = atoi(cpu_info); // NOLINT ++ benchmark_cpu_info_ = atoi(cpu_flags); // NOLINT + } + if (LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info)) { + benchmark_cpu_info_ = LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info); +@@ -263,7 +252,7 @@ LibYUVColorTest::LibYUVColorTest() + } + const char* cpu_info = getenv("LIBYUV_CPU_INFO"); + if (cpu_info) { +- benchmark_cpu_info_ = atoi(cpu_info); // NOLINT ++ benchmark_cpu_info_ = atoi(cpu_flags); // NOLINT + } + if (LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info)) { + benchmark_cpu_info_ = LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info); +@@ -319,7 +308,7 @@ LibYUVScaleTest::LibYUVScaleTest() + } + const char* cpu_info = getenv("LIBYUV_CPU_INFO"); + if (cpu_info) { +- benchmark_cpu_info_ = atoi(cpu_info); // NOLINT ++ benchmark_cpu_info_ = atoi(cpu_flags); // NOLINT + } + if (LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info)) { + benchmark_cpu_info_ = LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info); +@@ -375,7 +364,7 @@ LibYUVRotateTest::LibYUVRotateTest() + } + const char* cpu_info = getenv("LIBYUV_CPU_INFO"); + if (cpu_info) { +- benchmark_cpu_info_ = atoi(cpu_info); // NOLINT ++ benchmark_cpu_info_ = atoi(cpu_flags); // NOLINT + } + if (LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info)) { + benchmark_cpu_info_ = LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info); +@@ -431,7 +420,7 @@ LibYUVPlanarTest::LibYUVPlanarTest() + } + const char* cpu_info = getenv("LIBYUV_CPU_INFO"); + if (cpu_info) { +- benchmark_cpu_info_ = atoi(cpu_info); // NOLINT ++ benchmark_cpu_info_ = atoi(cpu_flags); // NOLINT + } + if (LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info)) { + benchmark_cpu_info_ = LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info); +@@ -487,7 +476,7 @@ LibYUVBaseTest::LibYUVBaseTest() + } + const char* cpu_info = getenv("LIBYUV_CPU_INFO"); + if (cpu_info) { +- benchmark_cpu_info_ = atoi(cpu_info); // NOLINT ++ benchmark_cpu_info_ = atoi(cpu_flags); // NOLINT + } + if (LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info)) { + benchmark_cpu_info_ = LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info); +@@ -543,7 +532,7 @@ LibYUVCompareTest::LibYUVCompareTest() + } + const char* cpu_info = getenv("LIBYUV_CPU_INFO"); + if (cpu_info) { +- benchmark_cpu_info_ = atoi(cpu_info); // NOLINT ++ benchmark_cpu_info_ = atoi(cpu_flags); // NOLINT + } + if (LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info)) { + benchmark_cpu_info_ = LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info); +diff --git a/media/libyuv/libyuv/util/cpuid.c b/media/libyuv/libyuv/util/cpuid.c +--- a/media/libyuv/libyuv/util/cpuid.c ++++ b/media/libyuv/libyuv/util/cpuid.c +@@ -12,51 +12,21 @@ + #include + #include + +-#ifdef __linux__ +-#include +-#include +-#endif +- + #include "libyuv/cpu_id.h" + + #ifdef __cplusplus + using namespace libyuv; + #endif + +-#ifdef __linux__ +-static void KernelVersion(int *version) { +- struct utsname buffer; +- int i = 0; +- +- version[0] = version[1] = 0; +- if (uname(&buffer) == 0) { +- char *v = buffer.release; +- for (i = 0; *v && i < 2; ++v) { +- if (isdigit(*v)) { +- version[i++] = (int) strtol(v, &v, 10); +- } +- } +- } +-} +-#endif +- + int main(int argc, const char* argv[]) { + int cpu_flags = TestCpuFlag(-1); + int has_arm = TestCpuFlag(kCpuHasARM); +- int has_riscv = TestCpuFlag(kCpuHasRISCV); ++ int has_mips = TestCpuFlag(kCpuHasMIPS); + int has_x86 = TestCpuFlag(kCpuHasX86); +- int has_mips = TestCpuFlag(kCpuHasMIPS); + int has_loongarch = TestCpuFlag(kCpuHasLOONGARCH); + (void)argc; + (void)argv; + +-#ifdef __linux__ +- { +- int kernelversion[2]; +- KernelVersion(kernelversion); +- printf("Kernel Version %d.%d\n", kernelversion[0], kernelversion[1]); +- } +-#endif + #if defined(__i386__) || defined(__x86_64__) || \ + defined(_M_IX86) || defined(_M_X64) + if (has_x86) { +@@ -92,54 +62,24 @@ int main(int argc, const char* argv[]) { + model, model); + } + #endif +- printf("Cpu Flags 0x%x\n", cpu_flags); ++ printf("Cpu Flags %x\n", cpu_flags); ++ printf("Has ARM %x\n", has_arm); ++ printf("Has MIPS %x\n", has_mips); ++ printf("Has X86 %x\n", has_x86); ++ printf("Has LOONGARCH %x\n", has_loongarch); + if (has_arm) { + int has_neon = TestCpuFlag(kCpuHasNEON); +- int has_neon_dotprod = TestCpuFlag(kCpuHasNeonDotProd); +- int has_neon_i8mm = TestCpuFlag(kCpuHasNeonI8MM); +- int has_sve = TestCpuFlag(kCpuHasSVE); +- int has_sve2 = TestCpuFlag(kCpuHasSVE2); +- int has_sme = TestCpuFlag(kCpuHasSME); +- printf("Has Arm 0x%x\n", has_arm); +- printf("Has Neon 0x%x\n", has_neon); +- printf("Has Neon DotProd 0x%x\n", has_neon_dotprod); +- printf("Has Neon I8MM 0x%x\n", has_neon_i8mm); +- printf("Has SVE 0x%x\n", has_sve); +- printf("Has SVE2 0x%x\n", has_sve2); +- printf("Has SME 0x%x\n", has_sme); +- +-#if __aarch64__ +- // Read and print the SVE and SME vector lengths. +- if (has_sve) { +- int sve_vl; +- // rdvl x0, #1 +- asm(".inst 0x04bf5020; mov %w0, w0" : "=r"(sve_vl)::"x0"); +- printf("SVE vector length: %d bytes\n", sve_vl); +- } +- if (has_sme) { +- int sme_vl; +- // rdsvl x0, #1 +- asm(".inst 0x04bf5820; mov %w0, w0" : "=r"(sme_vl)::"x0"); +- printf("SME vector length: %d bytes\n", sme_vl); +- } +-#endif +- } +- if (has_riscv) { +- int has_rvv = TestCpuFlag(kCpuHasRVV); +- printf("Has RISCV 0x%x\n", has_riscv); +- printf("Has RVV 0x%x\n", has_rvv); ++ printf("Has NEON %x\n", has_neon); + } + if (has_mips) { + int has_msa = TestCpuFlag(kCpuHasMSA); +- printf("Has MIPS 0x%x\n", has_mips); +- printf("Has MSA 0x%x\n", has_msa); ++ printf("Has MSA %x\n", has_msa); + } + if (has_loongarch) { + int has_lsx = TestCpuFlag(kCpuHasLSX); ++ printf("Has LSX %x\n", has_lsx); + int has_lasx = TestCpuFlag(kCpuHasLASX); +- printf("Has LOONGARCH 0x%x\n", has_loongarch); +- printf("Has LSX 0x%x\n", has_lsx); +- printf("Has LASX 0x%x\n", has_lasx); ++ printf("Has LASX %x\n", has_lasx); + } + if (has_x86) { + int has_sse2 = TestCpuFlag(kCpuHasSSE2); +@@ -151,36 +91,31 @@ int main(int argc, const char* argv[]) { + int has_erms = TestCpuFlag(kCpuHasERMS); + int has_fma3 = TestCpuFlag(kCpuHasFMA3); + int has_f16c = TestCpuFlag(kCpuHasF16C); ++ int has_gfni = TestCpuFlag(kCpuHasGFNI); + int has_avx512bw = TestCpuFlag(kCpuHasAVX512BW); + int has_avx512vl = TestCpuFlag(kCpuHasAVX512VL); + int has_avx512vnni = TestCpuFlag(kCpuHasAVX512VNNI); + int has_avx512vbmi = TestCpuFlag(kCpuHasAVX512VBMI); + int has_avx512vbmi2 = TestCpuFlag(kCpuHasAVX512VBMI2); + int has_avx512vbitalg = TestCpuFlag(kCpuHasAVX512VBITALG); +- int has_avx10 = TestCpuFlag(kCpuHasAVX10); +- int has_avxvnni = TestCpuFlag(kCpuHasAVXVNNI); +- int has_avxvnniint8 = TestCpuFlag(kCpuHasAVXVNNIINT8); +- int has_amxint8 = TestCpuFlag(kCpuHasAMXINT8); +- printf("Has X86 0x%x\n", has_x86); +- printf("Has SSE2 0x%x\n", has_sse2); +- printf("Has SSSE3 0x%x\n", has_ssse3); +- printf("Has SSE4.1 0x%x\n", has_sse41); +- printf("Has SSE4.2 0x%x\n", has_sse42); +- printf("Has AVX 0x%x\n", has_avx); +- printf("Has AVX2 0x%x\n", has_avx2); +- printf("Has ERMS 0x%x\n", has_erms); +- printf("Has FMA3 0x%x\n", has_fma3); +- printf("Has F16C 0x%x\n", has_f16c); +- printf("Has AVX512BW 0x%x\n", has_avx512bw); +- printf("Has AVX512VL 0x%x\n", has_avx512vl); +- printf("Has AVX512VNNI 0x%x\n", has_avx512vnni); +- printf("Has AVX512VBMI 0x%x\n", has_avx512vbmi); +- printf("Has AVX512VBMI2 0x%x\n", has_avx512vbmi2); +- printf("Has AVX512VBITALG 0x%x\n", has_avx512vbitalg); +- printf("Has AVX10 0x%x\n", has_avx10); +- printf("HAS AVXVNNI 0x%x\n", has_avxvnni); +- printf("Has AVXVNNIINT8 0x%x\n", has_avxvnniint8); +- printf("Has AMXINT8 0x%x\n", has_amxint8); ++ int has_avx512vpopcntdq = TestCpuFlag(kCpuHasAVX512VPOPCNTDQ); ++ printf("Has SSE2 %x\n", has_sse2); ++ printf("Has SSSE3 %x\n", has_ssse3); ++ printf("Has SSE4.1 %x\n", has_sse41); ++ printf("Has SSE4.2 %x\n", has_sse42); ++ printf("Has AVX %x\n", has_avx); ++ printf("Has AVX2 %x\n", has_avx2); ++ printf("Has ERMS %x\n", has_erms); ++ printf("Has FMA3 %x\n", has_fma3); ++ printf("Has F16C %x\n", has_f16c); ++ printf("Has GFNI %x\n", has_gfni); ++ printf("Has AVX512BW %x\n", has_avx512bw); ++ printf("Has AVX512VL %x\n", has_avx512vl); ++ printf("Has AVX512VNNI %x\n", has_avx512vnni); ++ printf("Has AVX512VBMI %x\n", has_avx512vbmi); ++ printf("Has AVX512VBMI2 %x\n", has_avx512vbmi2); ++ printf("Has AVX512VBITALG %x\n", has_avx512vbitalg); ++ printf("Has AVX512VPOPCNTDQ %x\n", has_avx512vpopcntdq); + } + return 0; + } +diff --git a/media/libyuv/libyuv/util/yuvconstants.c b/media/libyuv/libyuv/util/yuvconstants.c +--- a/media/libyuv/libyuv/util/yuvconstants.c ++++ b/media/libyuv/libyuv/util/yuvconstants.c +@@ -54,8 +54,8 @@ int main(int argc, const char* argv[]) { + printf(" 9 BT.2020 KR = 0.2627; KB = 0.0593\n"); + return -1; + } +- float kr = (float)atof(argv[1]); +- float kb = (float)atof(argv[2]); ++ float kr = atof(argv[1]); ++ float kb = atof(argv[2]); + float kg = 1 - kr - kb; + + float vr = 2 * (1 - kr); +diff --git a/media/libyuv/moz.build b/media/libyuv/moz.build +--- a/media/libyuv/moz.build ++++ b/media/libyuv/moz.build +@@ -30,7 +30,6 @@ libyuv_non_unified_sources = [ + 'libyuv/source/row_common.cc', + 'libyuv/source/scale.cc', + 'libyuv/source/scale_common.cc', +- 'libyuv/source/scale_uv.cc', + ] + + GYP_DIRS += ['libyuv'] +diff --git a/media/libyuv/moz.yaml b/media/libyuv/moz.yaml +--- a/media/libyuv/moz.yaml ++++ b/media/libyuv/moz.yaml +@@ -23,7 +23,7 @@ origin: + + # Revision to pull in + # Must be a long or short commit SHA (long preferred) +- revision: 616bee5420b62a7be09fda0252034e8be85f91b0 ++ revision: 2bdc210be9eb11ded16bf3ef1f6cadb0d4dcb0c2 + + # The package's license, where possible using the mnemonic from + # https://spdx.org/licenses/ +@@ -34,24 +34,23 @@ origin: + license-file: LICENSE + + updatebot: +- maintainer-phab: ng +- maintainer-bz: na-g@nostrum.com +- tasks: +- - type: vendoring +- enabled: true +- frequency: release ++ maintainer-phab: ng ++ maintainer-bz: na-g@nostrum.com ++ tasks: ++ - type: vendoring ++ enabled: true ++ frequency: release + + vendoring: + url: https://chromium.googlesource.com/libyuv/libyuv/ + source-hosting: googlesource + vendor-directory: media/libyuv/libyuv/ +- skip-vendoring-steps: ["update-moz-build"] ++ skip-vendoring-steps: ['update-moz-build'] + + exclude: + - ".*" + + patches: +- - 00_fix_build_errors.patch +- - 01_make_mjpeg_printfs_optional.patch +- - 02_update_gyp.patch +- - 03_add_neon64_and_sve_gyp_targets.patch ++ - fix_build_errors.patch ++ - make_mjpeg_printfs_optional.patch ++ - update_gyp.patch From 54317224b265013730882f4923ed0cf74cdbea9f Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 5 Sep 2024 12:35:26 +0200 Subject: [PATCH 388/545] Updated sources to build 2 --- sources | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources b/sources index 3d68f15..d6d4d22 100644 --- a/sources +++ b/sources @@ -2,5 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a -SHA512 (firefox-langpacks-130.0-20240828.tar.xz) = d42679fbfa7178b924b927057316c5655b77e372d750b1038c43580f9137f9d12efc940b274d06b859791ab01f0689f36df40b96d200a4fa83a540a9ec1634a1 -SHA512 (firefox-130.0.source.tar.xz) = 79ae9695d2dbc8955002b48ee639b2463bcde16183ae151e743ddf6619b073a2c8ce45b16d8e8a29c845f10af0880f8aa5247b99cd765b8a7989e332e5293183 +SHA512 (firefox-130.0.source.tar.xz) = d0d11b38d9e02fa15298ec13336bb086668b4f36b3ce9ced218a265327fd4822b9fea4303402631947ea3c20490c414de87f8df3e7c23d2e02b70f0456b9af40 +SHA512 (firefox-langpacks-130.0-20240830.tar.xz) = 71f3c555acde5b55bce4b95972524f6a5d47477771ff36ad8b3d39c5b68228004401c4082fa0cd95f6701500b8c402af2a764817e626faa9e41200d801337f45 From a67afa06c9e83aa4b073f56593e43a9625be62ea Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 6 Sep 2024 12:38:53 +0200 Subject: [PATCH 389/545] Added fix for mzbz#1916038 --- D221275.1725700750.diff | 2127 +++ firefox.spec | 9 +- libyuv-downgrade.patch | 33672 -------------------------------------- wasi.patch | 2 +- 4 files changed, 2134 insertions(+), 33676 deletions(-) create mode 100644 D221275.1725700750.diff delete mode 100644 libyuv-downgrade.patch diff --git a/D221275.1725700750.diff b/D221275.1725700750.diff new file mode 100644 index 0000000..c999a5f --- /dev/null +++ b/D221275.1725700750.diff @@ -0,0 +1,2127 @@ +diff --git a/media/libyuv/04_add_missing_volatile.patch b/media/libyuv/04_add_missing_volatile.patch +new file mode 100644 +--- /dev/null ++++ b/media/libyuv/04_add_missing_volatile.patch +@@ -0,0 +1,875 @@ ++diff --git a/include/libyuv/macros_msa.h b/include/libyuv/macros_msa.h ++index 6434a4da0537c..08e8c82927dd0 100644 ++--- a/include/libyuv/macros_msa.h +++++ b/include/libyuv/macros_msa.h ++@@ -20,7 +20,7 @@ ++ ({ \ ++ const uint8_t* psrc_lw_m = (const uint8_t*)(psrc); \ ++ uint32_t val_m; \ ++- asm("lw %[val_m], %[psrc_lw_m] \n" \ +++ asm volatile("lw %[val_m], %[psrc_lw_m] \n" \ ++ : [val_m] "=r"(val_m) \ ++ : [psrc_lw_m] "m"(*psrc_lw_m)); \ ++ val_m; \ ++@@ -31,7 +31,7 @@ ++ ({ \ ++ const uint8_t* psrc_ld_m = (const uint8_t*)(psrc); \ ++ uint64_t val_m = 0; \ ++- asm("ld %[val_m], %[psrc_ld_m] \n" \ +++ asm volatile("ld %[val_m], %[psrc_ld_m] \n" \ ++ : [val_m] "=r"(val_m) \ ++ : [psrc_ld_m] "m"(*psrc_ld_m)); \ ++ val_m; \ ++@@ -55,7 +55,7 @@ ++ ({ \ ++ uint8_t* pdst_sw_m = (uint8_t*)(pdst); /* NOLINT */ \ ++ uint32_t val_m = (val); \ ++- asm("sw %[val_m], %[pdst_sw_m] \n" \ +++ asm volatile("sw %[val_m], %[pdst_sw_m] \n" \ ++ : [pdst_sw_m] "=m"(*pdst_sw_m) \ ++ : [val_m] "r"(val_m)); \ ++ }) ++@@ -65,7 +65,7 @@ ++ ({ \ ++ uint8_t* pdst_sd_m = (uint8_t*)(pdst); /* NOLINT */ \ ++ uint64_t val_m = (val); \ ++- asm("sd %[val_m], %[pdst_sd_m] \n" \ +++ asm volatile("sd %[val_m], %[pdst_sd_m] \n" \ ++ : [pdst_sd_m] "=m"(*pdst_sd_m) \ ++ : [val_m] "r"(val_m)); \ ++ }) ++@@ -86,7 +86,8 @@ ++ uint8_t* psrc_lw_m = (uint8_t*)(psrc); \ ++ uint32_t val_lw_m; \ ++ \ ++- asm("lwr %[val_lw_m], 0(%[psrc_lw_m]) \n\t" \ +++ asm volatile( \ +++ "lwr %[val_lw_m], 0(%[psrc_lw_m]) \n\t" \ ++ "lwl %[val_lw_m], 3(%[psrc_lw_m]) \n\t" \ ++ \ ++ : [val_lw_m] "=&r"(val_lw_m) \ ++@@ -101,7 +102,8 @@ ++ uint8_t* psrc_ld_m = (uint8_t*)(psrc); \ ++ uint64_t val_ld_m = 0; \ ++ \ ++- asm("ldr %[val_ld_m], 0(%[psrc_ld_m]) \n\t" \ +++ asm volatile( \ +++ "ldr %[val_ld_m], 0(%[psrc_ld_m]) \n\t" \ ++ "ldl %[val_ld_m], 7(%[psrc_ld_m]) \n\t" \ ++ \ ++ : [val_ld_m] "=&r"(val_ld_m) \ ++@@ -128,7 +130,7 @@ ++ ({ \ ++ uint8_t* pdst_sw_m = (uint8_t*)(pdst); /* NOLINT */ \ ++ uint32_t val_m = (val); \ ++- asm("usw %[val_m], %[pdst_sw_m] \n" \ +++ asm volatile("usw %[val_m], %[pdst_sw_m] \n" \ ++ : [pdst_sw_m] "=m"(*pdst_sw_m) \ ++ : [val_m] "r"(val_m)); \ ++ }) ++diff --git a/source/row_gcc.cc b/source/row_gcc.cc ++index f8f41860ab7c5..6eb3286b053ad 100644 ++--- a/source/row_gcc.cc +++++ b/source/row_gcc.cc ++@@ -2626,7 +2626,7 @@ void OMITFP I444ToARGBRow_SSSE3(const uint8_t* y_buf, ++ uint8_t* dst_argb, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ "pcmpeqb %%xmm5,%%xmm5 \n" ++@@ -2686,7 +2686,7 @@ void OMITFP I422ToRGB24Row_SSSE3(const uint8_t* y_buf, ++ uint8_t* dst_rgb24, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP(yuvconstants) ++ "movdqa %[kShuffleMaskARGBToRGB24_0],%%xmm5 \n" ++ "movdqa %[kShuffleMaskARGBToRGB24],%%xmm6 \n" ++@@ -2722,7 +2722,7 @@ void OMITFP I444ToRGB24Row_SSSE3(const uint8_t* y_buf, ++ uint8_t* dst_rgb24, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP(yuvconstants) ++ "movdqa %[kShuffleMaskARGBToRGB24_0],%%xmm5 \n" ++ "movdqa %[kShuffleMaskARGBToRGB24],%%xmm6 \n" ++@@ -2758,7 +2758,7 @@ void OMITFP I422ToARGBRow_SSSE3(const uint8_t* y_buf, ++ uint8_t* dst_argb, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ "pcmpeqb %%xmm5,%%xmm5 \n" ++@@ -2787,7 +2787,7 @@ void OMITFP I422ToAR30Row_SSSE3(const uint8_t* y_buf, ++ uint8_t* dst_ar30, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ "pcmpeqb %%xmm5,%%xmm5 \n" // AR30 constants ++@@ -2822,7 +2822,7 @@ void OMITFP I210ToARGBRow_SSSE3(const uint16_t* y_buf, ++ uint8_t* dst_argb, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ "pcmpeqb %%xmm5,%%xmm5 \n" ++@@ -2852,7 +2852,7 @@ void OMITFP I212ToARGBRow_SSSE3(const uint16_t* y_buf, ++ uint8_t* dst_argb, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ "pcmpeqb %%xmm5,%%xmm5 \n" ++@@ -2882,7 +2882,7 @@ void OMITFP I210ToAR30Row_SSSE3(const uint16_t* y_buf, ++ uint8_t* dst_ar30, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ "pcmpeqb %%xmm5,%%xmm5 \n" ++@@ -2917,7 +2917,7 @@ void OMITFP I212ToAR30Row_SSSE3(const uint16_t* y_buf, ++ uint8_t* dst_ar30, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ "pcmpeqb %%xmm5,%%xmm5 \n" ++@@ -2952,7 +2952,7 @@ void OMITFP I410ToARGBRow_SSSE3(const uint16_t* y_buf, ++ uint8_t* dst_argb, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ "pcmpeqb %%xmm5,%%xmm5 \n" ++@@ -3045,7 +3045,7 @@ void OMITFP I410ToAR30Row_SSSE3(const uint16_t* y_buf, ++ uint8_t* dst_ar30, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ "pcmpeqb %%xmm5,%%xmm5 \n" ++@@ -3238,7 +3238,7 @@ void OMITFP P210ToAR30Row_SSSE3(const uint16_t* y_buf, ++ uint8_t* dst_ar30, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP(yuvconstants) ++ "pcmpeqb %%xmm5,%%xmm5 \n" ++ "psrlw $14,%%xmm5 \n" ++@@ -3269,7 +3269,7 @@ void OMITFP P410ToAR30Row_SSSE3(const uint16_t* y_buf, ++ uint8_t* dst_ar30, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP(yuvconstants) ++ "pcmpeqb %%xmm5,%%xmm5 \n" ++ "psrlw $14,%%xmm5 \n" ++@@ -3301,7 +3301,7 @@ void OMITFP I422ToRGBARow_SSSE3(const uint8_t* y_buf, ++ uint8_t* dst_rgba, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ "pcmpeqb %%xmm5,%%xmm5 \n" ++@@ -3712,7 +3712,7 @@ void OMITFP I444ToARGBRow_AVX2(const uint8_t* y_buf, ++ uint8_t* dst_argb, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP_AVX2(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" ++@@ -3746,7 +3746,7 @@ void OMITFP I422ToARGBRow_AVX2(const uint8_t* y_buf, ++ uint8_t* dst_argb, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP_AVX2(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" ++@@ -3786,7 +3786,7 @@ void OMITFP I422ToARGBRow_AVX512BW(const uint8_t* y_buf, ++ uint8_t* dst_argb, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP_AVX512BW(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ "vpcmpeqb %%xmm5,%%xmm5,%%xmm5 \n" ++@@ -3825,7 +3825,7 @@ void OMITFP I422ToAR30Row_AVX2(const uint8_t* y_buf, ++ uint8_t* dst_ar30, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP_AVX2(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants ++@@ -3865,7 +3865,7 @@ void OMITFP I210ToARGBRow_AVX2(const uint16_t* y_buf, ++ uint8_t* dst_argb, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP_AVX2(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" ++@@ -3900,7 +3900,7 @@ void OMITFP I212ToARGBRow_AVX2(const uint16_t* y_buf, ++ uint8_t* dst_argb, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP_AVX2(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" ++@@ -3935,7 +3935,7 @@ void OMITFP I210ToAR30Row_AVX2(const uint16_t* y_buf, ++ uint8_t* dst_ar30, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP_AVX2(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants ++@@ -3975,7 +3975,7 @@ void OMITFP I212ToAR30Row_AVX2(const uint16_t* y_buf, ++ uint8_t* dst_ar30, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP_AVX2(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants ++@@ -4015,7 +4015,7 @@ void OMITFP I410ToARGBRow_AVX2(const uint16_t* y_buf, ++ uint8_t* dst_argb, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP_AVX2(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" ++@@ -4120,7 +4120,7 @@ void OMITFP I410ToAR30Row_AVX2(const uint16_t* y_buf, ++ uint8_t* dst_ar30, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP_AVX2(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants ++@@ -4228,7 +4228,7 @@ void OMITFP I422ToRGBARow_AVX2(const uint8_t* y_buf, ++ uint8_t* dst_argb, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP_AVX2(yuvconstants) ++ "sub %[u_buf],%[v_buf] \n" ++ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" ++@@ -4430,7 +4430,7 @@ void OMITFP P210ToAR30Row_AVX2(const uint16_t* y_buf, ++ uint8_t* dst_ar30, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP_AVX2(yuvconstants) ++ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants ++ "vpsrlw $14,%%ymm5,%%ymm5 \n" ++@@ -4467,7 +4467,7 @@ void OMITFP P410ToAR30Row_AVX2(const uint16_t* y_buf, ++ uint8_t* dst_ar30, ++ const struct YuvConstants* yuvconstants, ++ int width) { ++- asm ( +++ asm volatile ( ++ YUVTORGB_SETUP_AVX2(yuvconstants) ++ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants ++ "vpsrlw $14,%%ymm5,%%ymm5 \n" ++@@ -5681,7 +5681,7 @@ void MergeXRGBRow_AVX2(const uint8_t* src_r, ++ const uint8_t* src_b, ++ uint8_t* dst_argb, ++ int width) { ++- asm( +++ asm volatile( ++ ++ LABELALIGN ++ "1: \n" ++@@ -7381,7 +7381,7 @@ void ARGBUnattenuateRow_SSE2(const uint8_t* src_argb, ++ uint8_t* dst_argb, ++ int width) { ++ uintptr_t alpha; ++- asm( +++ asm volatile( ++ // 4 pixel loop. ++ LABELALIGN ++ "1: \n" ++@@ -7841,7 +7841,7 @@ void ARGBAddRow_SSE2(const uint8_t* src_argb, ++ const uint8_t* src_argb1, ++ uint8_t* dst_argb, ++ int width) { ++- asm( +++ asm volatile( ++ // 4 pixel loop. ++ LABELALIGN ++ "1: \n" ++@@ -7869,7 +7869,7 @@ void ARGBAddRow_AVX2(const uint8_t* src_argb, ++ const uint8_t* src_argb1, ++ uint8_t* dst_argb, ++ int width) { ++- asm( +++ asm volatile( ++ // 4 pixel loop. ++ LABELALIGN ++ "1: \n" ++@@ -7897,7 +7897,7 @@ void ARGBSubtractRow_SSE2(const uint8_t* src_argb, ++ const uint8_t* src_argb1, ++ uint8_t* dst_argb, ++ int width) { ++- asm( +++ asm volatile( ++ // 4 pixel loop. ++ LABELALIGN ++ "1: \n" ++@@ -7925,7 +7925,7 @@ void ARGBSubtractRow_AVX2(const uint8_t* src_argb, ++ const uint8_t* src_argb1, ++ uint8_t* dst_argb, ++ int width) { ++- asm( +++ asm volatile( ++ // 4 pixel loop. ++ LABELALIGN ++ "1: \n" ++@@ -9099,7 +9099,7 @@ void ARGBColorTableRow_X86(uint8_t* dst_argb, ++ const uint8_t* table_argb, ++ int width) { ++ uintptr_t pixel_temp; ++- asm( +++ asm volatile( ++ // 1 pixel loop. ++ LABELALIGN ++ "1: \n" ++@@ -9132,7 +9132,7 @@ void RGBColorTableRow_X86(uint8_t* dst_argb, ++ const uint8_t* table_argb, ++ int width) { ++ uintptr_t pixel_temp; ++- asm( +++ asm volatile( ++ // 1 pixel loop. ++ LABELALIGN ++ "1: \n" ++diff --git a/source/row_lsx.cc b/source/row_lsx.cc ++index 09f206cab93f2..fa088c9e78a94 100644 ++--- a/source/row_lsx.cc +++++ b/source/row_lsx.cc ++@@ -2805,7 +2805,8 @@ static void ARGBToYMatrixRow_LSX(const uint8_t* src_argb, ++ uint8_t* dst_y, ++ int width, ++ const struct RgbConstants* rgbconstants) { ++- asm("vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants +++ asm volatile( +++ "vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants ++ "vldrepl.b $vr1, %3, 1 \n\t" // load rgbconstants ++ "vldrepl.b $vr2, %3, 2 \n\t" // load rgbconstants ++ "vldrepl.h $vr3, %3, 4 \n\t" // load rgbconstants ++@@ -2863,7 +2864,8 @@ static void RGBAToYMatrixRow_LSX(const uint8_t* src_rgba, ++ uint8_t* dst_y, ++ int width, ++ const struct RgbConstants* rgbconstants) { ++- asm("vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants +++ asm volatile( +++ "vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants ++ "vldrepl.b $vr1, %3, 1 \n\t" // load rgbconstants ++ "vldrepl.b $vr2, %3, 2 \n\t" // load rgbconstants ++ "vldrepl.h $vr3, %3, 4 \n\t" // load rgbconstants ++@@ -2920,7 +2922,8 @@ static void RGBToYMatrixRow_LSX(const uint8_t* src_rgba, ++ 7, 9, 10, 12, 13, 15, 1, 0, 4, 0, 7, 0, 10, ++ 0, 13, 0, 16, 0, 19, 0, 22, 0, 25, 0, 28, 0, ++ 31, 0, 2, 0, 5, 0, 8, 0, 11, 0, 14, 0}; ++- asm("vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants +++ asm volatile( +++ "vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants ++ "vldrepl.b $vr1, %3, 1 \n\t" // load rgbconstants ++ "vldrepl.b $vr2, %3, 2 \n\t" // load rgbconstants ++ "vldrepl.h $vr3, %3, 4 \n\t" // load rgbconstants ++diff --git a/source/scale_gcc.cc b/source/scale_gcc.cc ++index 9dfe64a931808..7556bcb4c1d62 100644 ++--- a/source/scale_gcc.cc +++++ b/source/scale_gcc.cc ++@@ -97,7 +97,7 @@ void ScaleRowDown2_SSSE3(const uint8_t* src_ptr, ++ uint8_t* dst_ptr, ++ int dst_width) { ++ (void)src_stride; ++- asm( +++ asm volatile( ++ // 16 pixel loop. ++ LABELALIGN ++ "1: \n" ++@@ -123,7 +123,7 @@ void ScaleRowDown2Linear_SSSE3(const uint8_t* src_ptr, ++ uint8_t* dst_ptr, ++ int dst_width) { ++ (void)src_stride; ++- asm("pcmpeqb %%xmm4,%%xmm4 \n" +++ asm volatile("pcmpeqb %%xmm4,%%xmm4 \n" ++ "psrlw $0xf,%%xmm4 \n" ++ "packuswb %%xmm4,%%xmm4 \n" ++ "pxor %%xmm5,%%xmm5 \n" ++@@ -153,7 +153,7 @@ void ScaleRowDown2Box_SSSE3(const uint8_t* src_ptr, ++ ptrdiff_t src_stride, ++ uint8_t* dst_ptr, ++ int dst_width) { ++- asm("pcmpeqb %%xmm4,%%xmm4 \n" +++ asm volatile("pcmpeqb %%xmm4,%%xmm4 \n" ++ "psrlw $0xf,%%xmm4 \n" ++ "packuswb %%xmm4,%%xmm4 \n" ++ "pxor %%xmm5,%%xmm5 \n" ++@@ -219,7 +219,7 @@ void ScaleRowDown2Linear_AVX2(const uint8_t* src_ptr, ++ uint8_t* dst_ptr, ++ int dst_width) { ++ (void)src_stride; ++- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" +++ asm volatile("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" ++ "vpsrlw $0xf,%%ymm4,%%ymm4 \n" ++ "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" ++ "vpxor %%ymm5,%%ymm5,%%ymm5 \n" ++@@ -251,7 +251,7 @@ void ScaleRowDown2Box_AVX2(const uint8_t* src_ptr, ++ ptrdiff_t src_stride, ++ uint8_t* dst_ptr, ++ int dst_width) { ++- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" +++ asm volatile("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" ++ "vpsrlw $0xf,%%ymm4,%%ymm4 \n" ++ "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" ++ "vpxor %%ymm5,%%ymm5,%%ymm5 \n" ++@@ -293,7 +293,7 @@ void ScaleRowDown4_SSSE3(const uint8_t* src_ptr, ++ uint8_t* dst_ptr, ++ int dst_width) { ++ (void)src_stride; ++- asm("pcmpeqb %%xmm5,%%xmm5 \n" +++ asm volatile("pcmpeqb %%xmm5,%%xmm5 \n" ++ "psrld $0x18,%%xmm5 \n" ++ "pslld $0x10,%%xmm5 \n" ++ ++@@ -323,7 +323,7 @@ void ScaleRowDown4Box_SSSE3(const uint8_t* src_ptr, ++ uint8_t* dst_ptr, ++ int dst_width) { ++ intptr_t stridex3; ++- asm("pcmpeqb %%xmm4,%%xmm4 \n" +++ asm volatile("pcmpeqb %%xmm4,%%xmm4 \n" ++ "psrlw $0xf,%%xmm4 \n" ++ "movdqa %%xmm4,%%xmm5 \n" ++ "packuswb %%xmm4,%%xmm4 \n" ++@@ -377,7 +377,7 @@ void ScaleRowDown4_AVX2(const uint8_t* src_ptr, ++ uint8_t* dst_ptr, ++ int dst_width) { ++ (void)src_stride; ++- asm("vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" +++ asm volatile("vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" ++ "vpsrld $0x18,%%ymm5,%%ymm5 \n" ++ "vpslld $0x10,%%ymm5,%%ymm5 \n" ++ ++@@ -409,7 +409,7 @@ void ScaleRowDown4Box_AVX2(const uint8_t* src_ptr, ++ ptrdiff_t src_stride, ++ uint8_t* dst_ptr, ++ int dst_width) { ++- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" +++ asm volatile("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" ++ "vpsrlw $0xf,%%ymm4,%%ymm4 \n" ++ "vpsllw $0x3,%%ymm4,%%ymm5 \n" ++ "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" ++@@ -464,7 +464,7 @@ void ScaleRowDown34_SSSE3(const uint8_t* src_ptr, ++ uint8_t* dst_ptr, ++ int dst_width) { ++ (void)src_stride; ++- asm("movdqa %0,%%xmm3 \n" +++ asm volatile("movdqa %0,%%xmm3 \n" ++ "movdqa %1,%%xmm4 \n" ++ "movdqa %2,%%xmm5 \n" ++ : ++@@ -499,7 +499,7 @@ void ScaleRowDown34_1_Box_SSSE3(const uint8_t* src_ptr, ++ ptrdiff_t src_stride, ++ uint8_t* dst_ptr, ++ int dst_width) { ++- asm("movdqa %0,%%xmm2 \n" // kShuf01 +++ asm volatile("movdqa %0,%%xmm2 \n" // kShuf01 ++ "movdqa %1,%%xmm3 \n" // kShuf11 ++ "movdqa %2,%%xmm4 \n" // kShuf21 ++ : ++@@ -507,7 +507,7 @@ void ScaleRowDown34_1_Box_SSSE3(const uint8_t* src_ptr, ++ "m"(kShuf11), // %1 ++ "m"(kShuf21) // %2 ++ ); ++- asm("movdqa %0,%%xmm5 \n" // kMadd01 +++ asm volatile("movdqa %0,%%xmm5 \n" // kMadd01 ++ "movdqa %1,%%xmm0 \n" // kMadd11 ++ "movdqa %2,%%xmm1 \n" // kRound34 ++ : ++@@ -561,7 +561,7 @@ void ScaleRowDown34_0_Box_SSSE3(const uint8_t* src_ptr, ++ ptrdiff_t src_stride, ++ uint8_t* dst_ptr, ++ int dst_width) { ++- asm("movdqa %0,%%xmm2 \n" // kShuf01 +++ asm volatile("movdqa %0,%%xmm2 \n" // kShuf01 ++ "movdqa %1,%%xmm3 \n" // kShuf11 ++ "movdqa %2,%%xmm4 \n" // kShuf21 ++ : ++@@ -569,7 +569,7 @@ void ScaleRowDown34_0_Box_SSSE3(const uint8_t* src_ptr, ++ "m"(kShuf11), // %1 ++ "m"(kShuf21) // %2 ++ ); ++- asm("movdqa %0,%%xmm5 \n" // kMadd01 +++ asm volatile("movdqa %0,%%xmm5 \n" // kMadd01 ++ "movdqa %1,%%xmm0 \n" // kMadd11 ++ "movdqa %2,%%xmm1 \n" // kRound34 ++ : ++@@ -628,7 +628,7 @@ void ScaleRowDown38_SSSE3(const uint8_t* src_ptr, ++ uint8_t* dst_ptr, ++ int dst_width) { ++ (void)src_stride; ++- asm("movdqa %3,%%xmm4 \n" +++ asm volatile("movdqa %3,%%xmm4 \n" ++ "movdqa %4,%%xmm5 \n" ++ ++ LABELALIGN ++@@ -657,7 +657,7 @@ void ScaleRowDown38_2_Box_SSSE3(const uint8_t* src_ptr, ++ ptrdiff_t src_stride, ++ uint8_t* dst_ptr, ++ int dst_width) { ++- asm("movdqa %0,%%xmm2 \n" +++ asm volatile("movdqa %0,%%xmm2 \n" ++ "movdqa %1,%%xmm3 \n" ++ "movdqa %2,%%xmm4 \n" ++ "movdqa %3,%%xmm5 \n" ++@@ -699,7 +699,7 @@ void ScaleRowDown38_3_Box_SSSE3(const uint8_t* src_ptr, ++ ptrdiff_t src_stride, ++ uint8_t* dst_ptr, ++ int dst_width) { ++- asm("movdqa %0,%%xmm2 \n" +++ asm volatile("movdqa %0,%%xmm2 \n" ++ "movdqa %1,%%xmm3 \n" ++ "movdqa %2,%%xmm4 \n" ++ "pxor %%xmm5,%%xmm5 \n" ++@@ -766,7 +766,7 @@ static const uvec8 kLinearMadd31 = {3, 1, 1, 3, 3, 1, 1, 3, ++ void ScaleRowUp2_Linear_SSE2(const uint8_t* src_ptr, ++ uint8_t* dst_ptr, ++ int dst_width) { ++- asm("pxor %%xmm0,%%xmm0 \n" // 0 +++ asm volatile("pxor %%xmm0,%%xmm0 \n" // 0 ++ "pcmpeqw %%xmm6,%%xmm6 \n" ++ "psrlw $15,%%xmm6 \n" ++ "psllw $1,%%xmm6 \n" // all 2 ++@@ -934,7 +934,7 @@ void ScaleRowUp2_Bilinear_SSE2(const uint8_t* src_ptr, ++ void ScaleRowUp2_Linear_12_SSSE3(const uint16_t* src_ptr, ++ uint16_t* dst_ptr, ++ int dst_width) { ++- asm("movdqa %3,%%xmm5 \n" +++ asm volatile("movdqa %3,%%xmm5 \n" ++ "pcmpeqw %%xmm4,%%xmm4 \n" ++ "psrlw $15,%%xmm4 \n" ++ "psllw $1,%%xmm4 \n" // all 2 ++@@ -985,7 +985,7 @@ void ScaleRowUp2_Bilinear_12_SSSE3(const uint16_t* src_ptr, ++ uint16_t* dst_ptr, ++ ptrdiff_t dst_stride, ++ int dst_width) { ++- asm("pcmpeqw %%xmm7,%%xmm7 \n" +++ asm volatile("pcmpeqw %%xmm7,%%xmm7 \n" ++ "psrlw $15,%%xmm7 \n" ++ "psllw $3,%%xmm7 \n" // all 8 ++ "movdqa %5,%%xmm6 \n" ++@@ -1082,7 +1082,7 @@ void ScaleRowUp2_Bilinear_12_SSSE3(const uint16_t* src_ptr, ++ void ScaleRowUp2_Linear_16_SSE2(const uint16_t* src_ptr, ++ uint16_t* dst_ptr, ++ int dst_width) { ++- asm("pxor %%xmm5,%%xmm5 \n" +++ asm volatile("pxor %%xmm5,%%xmm5 \n" ++ "pcmpeqd %%xmm4,%%xmm4 \n" ++ "psrld $31,%%xmm4 \n" ++ "pslld $1,%%xmm4 \n" // all 2 ++@@ -1134,7 +1134,7 @@ void ScaleRowUp2_Bilinear_16_SSE2(const uint16_t* src_ptr, ++ uint16_t* dst_ptr, ++ ptrdiff_t dst_stride, ++ int dst_width) { ++- asm("pxor %%xmm7,%%xmm7 \n" +++ asm volatile("pxor %%xmm7,%%xmm7 \n" ++ "pcmpeqd %%xmm6,%%xmm6 \n" ++ "psrld $31,%%xmm6 \n" ++ "pslld $3,%%xmm6 \n" // all 8 ++@@ -1241,7 +1241,7 @@ void ScaleRowUp2_Bilinear_16_SSE2(const uint16_t* src_ptr, ++ void ScaleRowUp2_Linear_SSSE3(const uint8_t* src_ptr, ++ uint8_t* dst_ptr, ++ int dst_width) { ++- asm("pcmpeqw %%xmm4,%%xmm4 \n" +++ asm volatile("pcmpeqw %%xmm4,%%xmm4 \n" ++ "psrlw $15,%%xmm4 \n" ++ "psllw $1,%%xmm4 \n" // all 2 ++ "movdqa %3,%%xmm3 \n" ++@@ -1281,7 +1281,7 @@ void ScaleRowUp2_Bilinear_SSSE3(const uint8_t* src_ptr, ++ uint8_t* dst_ptr, ++ ptrdiff_t dst_stride, ++ int dst_width) { ++- asm("pcmpeqw %%xmm6,%%xmm6 \n" +++ asm volatile("pcmpeqw %%xmm6,%%xmm6 \n" ++ "psrlw $15,%%xmm6 \n" ++ "psllw $3,%%xmm6 \n" // all 8 ++ "movdqa %5,%%xmm7 \n" ++@@ -1365,7 +1365,7 @@ void ScaleRowUp2_Bilinear_SSSE3(const uint8_t* src_ptr, ++ void ScaleRowUp2_Linear_AVX2(const uint8_t* src_ptr, ++ uint8_t* dst_ptr, ++ int dst_width) { ++- asm("vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" +++ asm volatile("vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" ++ "vpsrlw $15,%%ymm4,%%ymm4 \n" ++ "vpsllw $1,%%ymm4,%%ymm4 \n" // all 2 ++ "vbroadcastf128 %3,%%ymm3 \n" ++@@ -1408,7 +1408,7 @@ void ScaleRowUp2_Bilinear_AVX2(const uint8_t* src_ptr, ++ uint8_t* dst_ptr, ++ ptrdiff_t dst_stride, ++ int dst_width) { ++- asm("vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" +++ asm volatile("vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" ++ "vpsrlw $15,%%ymm6,%%ymm6 \n" ++ "vpsllw $3,%%ymm6,%%ymm6 \n" // all 8 ++ "vbroadcastf128 %5,%%ymm7 \n" ++@@ -1489,7 +1489,7 @@ void ScaleRowUp2_Bilinear_AVX2(const uint8_t* src_ptr, ++ void ScaleRowUp2_Linear_12_AVX2(const uint16_t* src_ptr, ++ uint16_t* dst_ptr, ++ int dst_width) { ++- asm("vbroadcastf128 %3,%%ymm5 \n" +++ asm volatile("vbroadcastf128 %3,%%ymm5 \n" ++ "vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" ++ "vpsrlw $15,%%ymm4,%%ymm4 \n" ++ "vpsllw $1,%%ymm4,%%ymm4 \n" // all 2 ++@@ -1540,7 +1540,7 @@ void ScaleRowUp2_Bilinear_12_AVX2(const uint16_t* src_ptr, ++ uint16_t* dst_ptr, ++ ptrdiff_t dst_stride, ++ int dst_width) { ++- asm("vbroadcastf128 %5,%%ymm5 \n" +++ asm volatile("vbroadcastf128 %5,%%ymm5 \n" ++ "vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" ++ "vpsrlw $15,%%ymm4,%%ymm4 \n" ++ "vpsllw $3,%%ymm4,%%ymm4 \n" // all 8 ++@@ -1601,7 +1601,7 @@ void ScaleRowUp2_Bilinear_12_AVX2(const uint16_t* src_ptr, ++ void ScaleRowUp2_Linear_16_AVX2(const uint16_t* src_ptr, ++ uint16_t* dst_ptr, ++ int dst_width) { ++- asm("vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" +++ asm volatile("vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" ++ "vpsrld $31,%%ymm4,%%ymm4 \n" ++ "vpslld $1,%%ymm4,%%ymm4 \n" // all 2 ++ ++@@ -1650,7 +1650,7 @@ void ScaleRowUp2_Bilinear_16_AVX2(const uint16_t* src_ptr, ++ uint16_t* dst_ptr, ++ ptrdiff_t dst_stride, ++ int dst_width) { ++- asm("vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" +++ asm volatile("vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" ++ "vpsrld $31,%%ymm6,%%ymm6 \n" ++ "vpslld $3,%%ymm6,%%ymm6 \n" // all 8 ++ ++@@ -1732,7 +1732,7 @@ void ScaleRowUp2_Bilinear_16_AVX2(const uint16_t* src_ptr, ++ void ScaleAddRow_SSE2(const uint8_t* src_ptr, ++ uint16_t* dst_ptr, ++ int src_width) { ++- asm("pxor %%xmm5,%%xmm5 \n" +++ asm volatile("pxor %%xmm5,%%xmm5 \n" ++ ++ // 16 pixel loop. ++ LABELALIGN ++@@ -1763,7 +1763,7 @@ void ScaleAddRow_SSE2(const uint8_t* src_ptr, ++ void ScaleAddRow_AVX2(const uint8_t* src_ptr, ++ uint16_t* dst_ptr, ++ int src_width) { ++- asm("vpxor %%ymm5,%%ymm5,%%ymm5 \n" +++ asm volatile("vpxor %%ymm5,%%ymm5,%%ymm5 \n" ++ ++ LABELALIGN ++ "1: \n" ++@@ -1804,7 +1804,7 @@ void ScaleFilterCols_SSSE3(uint8_t* dst_ptr, ++ int x, ++ int dx) { ++ intptr_t x0, x1, temp_pixel; ++- asm("movd %6,%%xmm2 \n" +++ asm volatile("movd %6,%%xmm2 \n" ++ "movd %7,%%xmm3 \n" ++ "movl $0x04040000,%k2 \n" ++ "movd %k2,%%xmm5 \n" ++@@ -2005,7 +2005,7 @@ void ScaleARGBRowDownEven_SSE2(const uint8_t* src_argb, ++ intptr_t src_stepx_x4 = (intptr_t)(src_stepx); ++ intptr_t src_stepx_x12; ++ (void)src_stride; ++- asm("lea 0x00(,%1,4),%1 \n" +++ asm volatile("lea 0x00(,%1,4),%1 \n" ++ "lea 0x00(%1,%1,2),%4 \n" ++ ++ LABELALIGN ++@@ -2041,7 +2041,7 @@ void ScaleARGBRowDownEvenBox_SSE2(const uint8_t* src_argb, ++ intptr_t src_stepx_x4 = (intptr_t)(src_stepx); ++ intptr_t src_stepx_x12; ++ intptr_t row1 = (intptr_t)(src_stride); ++- asm("lea 0x00(,%1,4),%1 \n" +++ asm volatile("lea 0x00(,%1,4),%1 \n" ++ "lea 0x00(%1,%1,2),%4 \n" ++ "lea 0x00(%0,%5,1),%5 \n" ++ ++@@ -2083,7 +2083,7 @@ void ScaleARGBCols_SSE2(uint8_t* dst_argb, ++ int x, ++ int dx) { ++ intptr_t x0, x1; ++- asm("movd %5,%%xmm2 \n" +++ asm volatile("movd %5,%%xmm2 \n" ++ "movd %6,%%xmm3 \n" ++ "pshufd $0x0,%%xmm2,%%xmm2 \n" ++ "pshufd $0x11,%%xmm3,%%xmm0 \n" ++@@ -2191,14 +2191,14 @@ void ScaleARGBFilterCols_SSSE3(uint8_t* dst_argb, ++ int x, ++ int dx) { ++ intptr_t x0, x1; ++- asm("movdqa %0,%%xmm4 \n" +++ asm volatile("movdqa %0,%%xmm4 \n" ++ "movdqa %1,%%xmm5 \n" ++ : ++ : "m"(kShuffleColARGB), // %0 ++ "m"(kShuffleFractions) // %1 ++ ); ++ ++- asm("movd %5,%%xmm2 \n" +++ asm volatile("movd %5,%%xmm2 \n" ++ "movd %6,%%xmm3 \n" ++ "pcmpeqb %%xmm6,%%xmm6 \n" ++ "psrlw $0x9,%%xmm6 \n" ++@@ -2260,7 +2260,7 @@ void ScaleARGBFilterCols_SSSE3(uint8_t* dst_argb, ++ ++ // Divide num by div and return as 16.16 fixed point result. ++ int FixedDiv_X86(int num, int div) { ++- asm("cdq \n" +++ asm volatile("cdq \n" ++ "shld $0x10,%%eax,%%edx \n" ++ "shl $0x10,%%eax \n" ++ "idiv %1 \n" ++@@ -2273,7 +2273,7 @@ int FixedDiv_X86(int num, int div) { ++ ++ // Divide num - 1 by div - 1 and return as 16.16 fixed point result. ++ int FixedDiv1_X86(int num, int div) { ++- asm("cdq \n" +++ asm volatile("cdq \n" ++ "shld $0x10,%%eax,%%edx \n" ++ "shl $0x10,%%eax \n" ++ "sub $0x10001,%%eax \n" ++@@ -2304,7 +2304,7 @@ void ScaleUVRowDown2Box_SSSE3(const uint8_t* src_ptr, ++ ptrdiff_t src_stride, ++ uint8_t* dst_ptr, ++ int dst_width) { ++- asm("pcmpeqb %%xmm4,%%xmm4 \n" // 01010101 +++ asm volatile("pcmpeqb %%xmm4,%%xmm4 \n" // 01010101 ++ "psrlw $0xf,%%xmm4 \n" ++ "packuswb %%xmm4,%%xmm4 \n" ++ "pxor %%xmm5, %%xmm5 \n" // zero ++@@ -2343,7 +2343,7 @@ void ScaleUVRowDown2Box_AVX2(const uint8_t* src_ptr, ++ ptrdiff_t src_stride, ++ uint8_t* dst_ptr, ++ int dst_width) { ++- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" // 01010101 +++ asm volatile("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" // 01010101 ++ "vpsrlw $0xf,%%ymm4,%%ymm4 \n" ++ "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" ++ "vpxor %%ymm5,%%ymm5,%%ymm5 \n" // zero ++@@ -2386,7 +2386,7 @@ static const uvec8 kUVLinearMadd31 = {3, 1, 3, 1, 1, 3, 1, 3, ++ void ScaleUVRowUp2_Linear_SSSE3(const uint8_t* src_ptr, ++ uint8_t* dst_ptr, ++ int dst_width) { ++- asm("pcmpeqw %%xmm4,%%xmm4 \n" +++ asm volatile("pcmpeqw %%xmm4,%%xmm4 \n" ++ "psrlw $15,%%xmm4 \n" ++ "psllw $1,%%xmm4 \n" // all 2 ++ "movdqa %3,%%xmm3 \n" ++@@ -2426,7 +2426,7 @@ void ScaleUVRowUp2_Bilinear_SSSE3(const uint8_t* src_ptr, ++ uint8_t* dst_ptr, ++ ptrdiff_t dst_stride, ++ int dst_width) { ++- asm("pcmpeqw %%xmm6,%%xmm6 \n" +++ asm volatile("pcmpeqw %%xmm6,%%xmm6 \n" ++ "psrlw $15,%%xmm6 \n" ++ "psllw $3,%%xmm6 \n" // all 8 ++ "movdqa %5,%%xmm7 \n" ++@@ -2509,7 +2509,7 @@ void ScaleUVRowUp2_Bilinear_SSSE3(const uint8_t* src_ptr, ++ void ScaleUVRowUp2_Linear_AVX2(const uint8_t* src_ptr, ++ uint8_t* dst_ptr, ++ int dst_width) { ++- asm("vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" +++ asm volatile("vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" ++ "vpsrlw $15,%%ymm4,%%ymm4 \n" ++ "vpsllw $1,%%ymm4,%%ymm4 \n" // all 2 ++ "vbroadcastf128 %3,%%ymm3 \n" ++@@ -2551,7 +2551,7 @@ void ScaleUVRowUp2_Bilinear_AVX2(const uint8_t* src_ptr, ++ uint8_t* dst_ptr, ++ ptrdiff_t dst_stride, ++ int dst_width) { ++- asm("vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" +++ asm volatile("vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" ++ "vpsrlw $15,%%ymm6,%%ymm6 \n" ++ "vpsllw $3,%%ymm6,%%ymm6 \n" // all 8 ++ "vbroadcastf128 %5,%%ymm7 \n" ++@@ -2630,7 +2630,7 @@ void ScaleUVRowUp2_Bilinear_AVX2(const uint8_t* src_ptr, ++ void ScaleUVRowUp2_Linear_16_SSE41(const uint16_t* src_ptr, ++ uint16_t* dst_ptr, ++ int dst_width) { ++- asm("pxor %%xmm5,%%xmm5 \n" +++ asm volatile("pxor %%xmm5,%%xmm5 \n" ++ "pcmpeqd %%xmm4,%%xmm4 \n" ++ "psrld $31,%%xmm4 \n" ++ "pslld $1,%%xmm4 \n" // all 2 ++@@ -2681,7 +2681,7 @@ void ScaleUVRowUp2_Bilinear_16_SSE41(const uint16_t* src_ptr, ++ uint16_t* dst_ptr, ++ ptrdiff_t dst_stride, ++ int dst_width) { ++- asm("pxor %%xmm7,%%xmm7 \n" +++ asm volatile("pxor %%xmm7,%%xmm7 \n" ++ "pcmpeqd %%xmm6,%%xmm6 \n" ++ "psrld $31,%%xmm6 \n" ++ "pslld $3,%%xmm6 \n" // all 8 ++@@ -2771,7 +2771,7 @@ void ScaleUVRowUp2_Bilinear_16_SSE41(const uint16_t* src_ptr, ++ void ScaleUVRowUp2_Linear_16_AVX2(const uint16_t* src_ptr, ++ uint16_t* dst_ptr, ++ int dst_width) { ++- asm("vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" +++ asm volatile("vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" ++ "vpsrld $31,%%ymm4,%%ymm4 \n" ++ "vpslld $1,%%ymm4,%%ymm4 \n" // all 2 ++ ++@@ -2819,7 +2819,7 @@ void ScaleUVRowUp2_Bilinear_16_AVX2(const uint16_t* src_ptr, ++ uint16_t* dst_ptr, ++ ptrdiff_t dst_stride, ++ int dst_width) { ++- asm("vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" +++ asm volatile("vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" ++ "vpsrld $31,%%ymm6,%%ymm6 \n" ++ "vpslld $3,%%ymm6,%%ymm6 \n" // all 8 ++ +diff --git a/media/libyuv/libyuv/include/libyuv/macros_msa.h b/media/libyuv/libyuv/include/libyuv/macros_msa.h +--- a/media/libyuv/libyuv/include/libyuv/macros_msa.h ++++ b/media/libyuv/libyuv/include/libyuv/macros_msa.h +@@ -18,22 +18,22 @@ + #if (__mips_isa_rev >= 6) + #define LW(psrc) \ + ({ \ + const uint8_t* psrc_lw_m = (const uint8_t*)(psrc); \ + uint32_t val_m; \ +- asm("lw %[val_m], %[psrc_lw_m] \n" \ ++ asm volatile("lw %[val_m], %[psrc_lw_m] \n" \ + : [val_m] "=r"(val_m) \ + : [psrc_lw_m] "m"(*psrc_lw_m)); \ + val_m; \ + }) + + #if (__mips == 64) + #define LD(psrc) \ + ({ \ + const uint8_t* psrc_ld_m = (const uint8_t*)(psrc); \ + uint64_t val_m = 0; \ +- asm("ld %[val_m], %[psrc_ld_m] \n" \ ++ asm volatile("ld %[val_m], %[psrc_ld_m] \n" \ + : [val_m] "=r"(val_m) \ + : [psrc_ld_m] "m"(*psrc_ld_m)); \ + val_m; \ + }) + #else // !(__mips == 64) +@@ -53,21 +53,21 @@ + + #define SW(val, pdst) \ + ({ \ + uint8_t* pdst_sw_m = (uint8_t*)(pdst); /* NOLINT */ \ + uint32_t val_m = (val); \ +- asm("sw %[val_m], %[pdst_sw_m] \n" \ ++ asm volatile("sw %[val_m], %[pdst_sw_m] \n" \ + : [pdst_sw_m] "=m"(*pdst_sw_m) \ + : [val_m] "r"(val_m)); \ + }) + + #if (__mips == 64) + #define SD(val, pdst) \ + ({ \ + uint8_t* pdst_sd_m = (uint8_t*)(pdst); /* NOLINT */ \ + uint64_t val_m = (val); \ +- asm("sd %[val_m], %[pdst_sd_m] \n" \ ++ asm volatile("sd %[val_m], %[pdst_sd_m] \n" \ + : [pdst_sd_m] "=m"(*pdst_sd_m) \ + : [val_m] "r"(val_m)); \ + }) + #else // !(__mips == 64) + #define SD(val, pdst) \ +@@ -84,11 +84,12 @@ + #define LW(psrc) \ + ({ \ + uint8_t* psrc_lw_m = (uint8_t*)(psrc); \ + uint32_t val_lw_m; \ + \ +- asm("lwr %[val_lw_m], 0(%[psrc_lw_m]) \n\t" \ ++ asm volatile( \ ++ "lwr %[val_lw_m], 0(%[psrc_lw_m]) \n\t" \ + "lwl %[val_lw_m], 3(%[psrc_lw_m]) \n\t" \ + \ + : [val_lw_m] "=&r"(val_lw_m) \ + : [psrc_lw_m] "r"(psrc_lw_m)); \ + \ +@@ -99,11 +100,12 @@ + #define LD(psrc) \ + ({ \ + uint8_t* psrc_ld_m = (uint8_t*)(psrc); \ + uint64_t val_ld_m = 0; \ + \ +- asm("ldr %[val_ld_m], 0(%[psrc_ld_m]) \n\t" \ ++ asm volatile( \ ++ "ldr %[val_ld_m], 0(%[psrc_ld_m]) \n\t" \ + "ldl %[val_ld_m], 7(%[psrc_ld_m]) \n\t" \ + \ + : [val_ld_m] "=&r"(val_ld_m) \ + : [psrc_ld_m] "r"(psrc_ld_m)); \ + \ +@@ -126,11 +128,11 @@ + + #define SW(val, pdst) \ + ({ \ + uint8_t* pdst_sw_m = (uint8_t*)(pdst); /* NOLINT */ \ + uint32_t val_m = (val); \ +- asm("usw %[val_m], %[pdst_sw_m] \n" \ ++ asm volatile("usw %[val_m], %[pdst_sw_m] \n" \ + : [pdst_sw_m] "=m"(*pdst_sw_m) \ + : [val_m] "r"(val_m)); \ + }) + + #define SD(val, pdst) \ +diff --git a/media/libyuv/libyuv/source/row_gcc.cc b/media/libyuv/libyuv/source/row_gcc.cc +--- a/media/libyuv/libyuv/source/row_gcc.cc ++++ b/media/libyuv/libyuv/source/row_gcc.cc +@@ -2624,11 +2624,11 @@ + const uint8_t* u_buf, + const uint8_t* v_buf, + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "pcmpeqb %%xmm5,%%xmm5 \n" + + LABELALIGN +@@ -2684,11 +2684,11 @@ + const uint8_t* u_buf, + const uint8_t* v_buf, + uint8_t* dst_rgb24, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "movdqa %[kShuffleMaskARGBToRGB24_0],%%xmm5 \n" + "movdqa %[kShuffleMaskARGBToRGB24],%%xmm6 \n" + "sub %[u_buf],%[v_buf] \n" + +@@ -2720,11 +2720,11 @@ + const uint8_t* u_buf, + const uint8_t* v_buf, + uint8_t* dst_rgb24, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "movdqa %[kShuffleMaskARGBToRGB24_0],%%xmm5 \n" + "movdqa %[kShuffleMaskARGBToRGB24],%%xmm6 \n" + "sub %[u_buf],%[v_buf] \n" + +@@ -2756,11 +2756,11 @@ + const uint8_t* u_buf, + const uint8_t* v_buf, + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "pcmpeqb %%xmm5,%%xmm5 \n" + + LABELALIGN +@@ -2785,11 +2785,11 @@ + const uint8_t* u_buf, + const uint8_t* v_buf, + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "pcmpeqb %%xmm5,%%xmm5 \n" // AR30 constants + "psrlw $14,%%xmm5 \n" + "psllw $4,%%xmm5 \n" // 2 alpha bits +@@ -2820,11 +2820,11 @@ + const uint16_t* u_buf, + const uint16_t* v_buf, + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "pcmpeqb %%xmm5,%%xmm5 \n" + + LABELALIGN +@@ -2850,11 +2850,11 @@ + const uint16_t* u_buf, + const uint16_t* v_buf, + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "pcmpeqb %%xmm5,%%xmm5 \n" + + LABELALIGN +@@ -2880,11 +2880,11 @@ + const uint16_t* u_buf, + const uint16_t* v_buf, + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "pcmpeqb %%xmm5,%%xmm5 \n" + "psrlw $14,%%xmm5 \n" + "psllw $4,%%xmm5 \n" // 2 alpha bits +@@ -2915,11 +2915,11 @@ + const uint16_t* u_buf, + const uint16_t* v_buf, + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "pcmpeqb %%xmm5,%%xmm5 \n" + "psrlw $14,%%xmm5 \n" + "psllw $4,%%xmm5 \n" // 2 alpha bits +@@ -2950,11 +2950,11 @@ + const uint16_t* u_buf, + const uint16_t* v_buf, + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "pcmpeqb %%xmm5,%%xmm5 \n" + + LABELALIGN +@@ -3043,11 +3043,11 @@ + const uint16_t* u_buf, + const uint16_t* v_buf, + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "pcmpeqb %%xmm5,%%xmm5 \n" + "psrlw $14,%%xmm5 \n" + "psllw $4,%%xmm5 \n" // 2 alpha bits +@@ -3236,11 +3236,11 @@ + void OMITFP P210ToAR30Row_SSSE3(const uint16_t* y_buf, + const uint16_t* uv_buf, + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "pcmpeqb %%xmm5,%%xmm5 \n" + "psrlw $14,%%xmm5 \n" + "psllw $4,%%xmm5 \n" // 2 alpha bits + "pxor %%xmm6,%%xmm6 \n" // 0 for min +@@ -3267,11 +3267,11 @@ + void OMITFP P410ToAR30Row_SSSE3(const uint16_t* y_buf, + const uint16_t* uv_buf, + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "pcmpeqb %%xmm5,%%xmm5 \n" + "psrlw $14,%%xmm5 \n" + "psllw $4,%%xmm5 \n" // 2 alpha bits + "pxor %%xmm6,%%xmm6 \n" // 0 for min +@@ -3299,11 +3299,11 @@ + const uint8_t* u_buf, + const uint8_t* v_buf, + uint8_t* dst_rgba, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "pcmpeqb %%xmm5,%%xmm5 \n" + + LABELALIGN +@@ -3710,11 +3710,11 @@ + const uint8_t* u_buf, + const uint8_t* v_buf, + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" + + LABELALIGN +@@ -3744,11 +3744,11 @@ + const uint8_t* u_buf, + const uint8_t* v_buf, + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" + + LABELALIGN +@@ -3784,11 +3784,11 @@ + const uint8_t* u_buf, + const uint8_t* v_buf, + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX512BW(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%xmm5,%%xmm5,%%xmm5 \n" + "vpbroadcastq %%xmm5,%%zmm5 \n" + +@@ -3823,11 +3823,11 @@ + const uint8_t* u_buf, + const uint8_t* v_buf, + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants + "vpsrlw $14,%%ymm5,%%ymm5 \n" + "vpsllw $4,%%ymm5,%%ymm5 \n" // 2 alpha bits +@@ -3863,11 +3863,11 @@ + const uint16_t* u_buf, + const uint16_t* v_buf, + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" + + LABELALIGN +@@ -3898,11 +3898,11 @@ + const uint16_t* u_buf, + const uint16_t* v_buf, + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" + + LABELALIGN +@@ -3933,11 +3933,11 @@ + const uint16_t* u_buf, + const uint16_t* v_buf, + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants + "vpsrlw $14,%%ymm5,%%ymm5 \n" + "vpsllw $4,%%ymm5,%%ymm5 \n" // 2 alpha bits +@@ -3973,11 +3973,11 @@ + const uint16_t* u_buf, + const uint16_t* v_buf, + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants + "vpsrlw $14,%%ymm5,%%ymm5 \n" + "vpsllw $4,%%ymm5,%%ymm5 \n" // 2 alpha bits +@@ -4013,11 +4013,11 @@ + const uint16_t* u_buf, + const uint16_t* v_buf, + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" + + LABELALIGN +@@ -4118,11 +4118,11 @@ + const uint16_t* u_buf, + const uint16_t* v_buf, + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants + "vpsrlw $14,%%ymm5,%%ymm5 \n" + "vpsllw $4,%%ymm5,%%ymm5 \n" // 2 alpha bits +@@ -4226,11 +4226,11 @@ + const uint8_t* u_buf, + const uint8_t* v_buf, + uint8_t* dst_argb, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "sub %[u_buf],%[v_buf] \n" + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" + + LABELALIGN +@@ -4428,11 +4428,11 @@ + void OMITFP P210ToAR30Row_AVX2(const uint16_t* y_buf, + const uint16_t* uv_buf, + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants + "vpsrlw $14,%%ymm5,%%ymm5 \n" + "vpsllw $4,%%ymm5,%%ymm5 \n" // 2 alpha bits + "vpxor %%ymm6,%%ymm6,%%ymm6 \n" // 0 for min +@@ -4465,11 +4465,11 @@ + void OMITFP P410ToAR30Row_AVX2(const uint16_t* y_buf, + const uint16_t* uv_buf, + uint8_t* dst_ar30, + const struct YuvConstants* yuvconstants, + int width) { +- asm ( ++ asm volatile ( + YUVTORGB_SETUP_AVX2(yuvconstants) + "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants + "vpsrlw $14,%%ymm5,%%ymm5 \n" + "vpsllw $4,%%ymm5,%%ymm5 \n" // 2 alpha bits + "vpxor %%ymm6,%%ymm6,%%ymm6 \n" // 0 for min +@@ -5679,11 +5679,11 @@ + void MergeXRGBRow_AVX2(const uint8_t* src_r, + const uint8_t* src_g, + const uint8_t* src_b, + uint8_t* dst_argb, + int width) { +- asm( ++ asm volatile( + + LABELALIGN + "1: \n" + + "vmovdqu (%2),%%xmm0 \n" // B +@@ -7379,11 +7379,11 @@ + // Unattenuate 4 pixels at a time. + void ARGBUnattenuateRow_SSE2(const uint8_t* src_argb, + uint8_t* dst_argb, + int width) { + uintptr_t alpha; +- asm( ++ asm volatile( + // 4 pixel loop. + LABELALIGN + "1: \n" + "movdqu (%0),%%xmm0 \n" + "movzb 0x03(%0),%3 \n" +@@ -7839,11 +7839,11 @@ + // Add 2 rows of ARGB pixels together, 4 pixels at a time. + void ARGBAddRow_SSE2(const uint8_t* src_argb, + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width) { +- asm( ++ asm volatile( + // 4 pixel loop. + LABELALIGN + "1: \n" + "movdqu (%0),%%xmm0 \n" + "lea 0x10(%0),%0 \n" +@@ -7867,11 +7867,11 @@ + // Add 2 rows of ARGB pixels together, 4 pixels at a time. + void ARGBAddRow_AVX2(const uint8_t* src_argb, + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width) { +- asm( ++ asm volatile( + // 4 pixel loop. + LABELALIGN + "1: \n" + "vmovdqu (%0),%%ymm0 \n" + "lea 0x20(%0),%0 \n" +@@ -7895,11 +7895,11 @@ + // Subtract 2 rows of ARGB pixels, 4 pixels at a time. + void ARGBSubtractRow_SSE2(const uint8_t* src_argb, + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width) { +- asm( ++ asm volatile( + // 4 pixel loop. + LABELALIGN + "1: \n" + "movdqu (%0),%%xmm0 \n" + "lea 0x10(%0),%0 \n" +@@ -7923,11 +7923,11 @@ + // Subtract 2 rows of ARGB pixels, 8 pixels at a time. + void ARGBSubtractRow_AVX2(const uint8_t* src_argb, + const uint8_t* src_argb1, + uint8_t* dst_argb, + int width) { +- asm( ++ asm volatile( + // 4 pixel loop. + LABELALIGN + "1: \n" + "vmovdqu (%0),%%ymm0 \n" + "lea 0x20(%0),%0 \n" +@@ -9097,11 +9097,11 @@ + // Tranform ARGB pixels with color table. + void ARGBColorTableRow_X86(uint8_t* dst_argb, + const uint8_t* table_argb, + int width) { + uintptr_t pixel_temp; +- asm( ++ asm volatile( + // 1 pixel loop. + LABELALIGN + "1: \n" + "movzb (%0),%1 \n" + "lea 0x4(%0),%0 \n" +@@ -9130,11 +9130,11 @@ + // Tranform RGB pixels with color table. + void RGBColorTableRow_X86(uint8_t* dst_argb, + const uint8_t* table_argb, + int width) { + uintptr_t pixel_temp; +- asm( ++ asm volatile( + // 1 pixel loop. + LABELALIGN + "1: \n" + "movzb (%0),%1 \n" + "lea 0x4(%0),%0 \n" +diff --git a/media/libyuv/libyuv/source/row_lsx.cc b/media/libyuv/libyuv/source/row_lsx.cc +--- a/media/libyuv/libyuv/source/row_lsx.cc ++++ b/media/libyuv/libyuv/source/row_lsx.cc +@@ -2803,11 +2803,12 @@ + // ARGB expects first 3 values to contain RGB and 4th value is ignored. + static void ARGBToYMatrixRow_LSX(const uint8_t* src_argb, + uint8_t* dst_y, + int width, + const struct RgbConstants* rgbconstants) { +- asm("vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants ++ asm volatile( ++ "vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants + "vldrepl.b $vr1, %3, 1 \n\t" // load rgbconstants + "vldrepl.b $vr2, %3, 2 \n\t" // load rgbconstants + "vldrepl.h $vr3, %3, 4 \n\t" // load rgbconstants + "1: \n\t" + "vld $vr4, %0, 0 \n\t" +@@ -2861,11 +2862,12 @@ + // Same code as ARGB, except the LD4 + static void RGBAToYMatrixRow_LSX(const uint8_t* src_rgba, + uint8_t* dst_y, + int width, + const struct RgbConstants* rgbconstants) { +- asm("vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants ++ asm volatile( ++ "vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants + "vldrepl.b $vr1, %3, 1 \n\t" // load rgbconstants + "vldrepl.b $vr2, %3, 2 \n\t" // load rgbconstants + "vldrepl.h $vr3, %3, 4 \n\t" // load rgbconstants + "1: \n\t" + "vld $vr4, %0, 0 \n\t" +@@ -2918,11 +2920,12 @@ + int8_t shuff[64] = {0, 2, 3, 5, 6, 8, 9, 11, 12, 14, 15, 17, 18, + 20, 21, 23, 24, 26, 27, 29, 30, 0, 1, 3, 4, 6, + 7, 9, 10, 12, 13, 15, 1, 0, 4, 0, 7, 0, 10, + 0, 13, 0, 16, 0, 19, 0, 22, 0, 25, 0, 28, 0, + 31, 0, 2, 0, 5, 0, 8, 0, 11, 0, 14, 0}; +- asm("vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants ++ asm volatile( ++ "vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants + "vldrepl.b $vr1, %3, 1 \n\t" // load rgbconstants + "vldrepl.b $vr2, %3, 2 \n\t" // load rgbconstants + "vldrepl.h $vr3, %3, 4 \n\t" // load rgbconstants + "vld $vr4, %4, 0 \n\t" // load shuff + "vld $vr5, %4, 16 \n\t" +diff --git a/media/libyuv/libyuv/source/scale_gcc.cc b/media/libyuv/libyuv/source/scale_gcc.cc +--- a/media/libyuv/libyuv/source/scale_gcc.cc ++++ b/media/libyuv/libyuv/source/scale_gcc.cc +@@ -95,11 +95,11 @@ + void ScaleRowDown2_SSSE3(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { + (void)src_stride; +- asm( ++ asm volatile( + // 16 pixel loop. + LABELALIGN + "1: \n" + "movdqu (%0),%%xmm0 \n" + "movdqu 0x10(%0),%%xmm1 \n" +@@ -121,11 +121,11 @@ + void ScaleRowDown2Linear_SSSE3(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { + (void)src_stride; +- asm("pcmpeqb %%xmm4,%%xmm4 \n" ++ asm volatile("pcmpeqb %%xmm4,%%xmm4 \n" + "psrlw $0xf,%%xmm4 \n" + "packuswb %%xmm4,%%xmm4 \n" + "pxor %%xmm5,%%xmm5 \n" + + LABELALIGN +@@ -151,11 +151,11 @@ + + void ScaleRowDown2Box_SSSE3(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm("pcmpeqb %%xmm4,%%xmm4 \n" ++ asm volatile("pcmpeqb %%xmm4,%%xmm4 \n" + "psrlw $0xf,%%xmm4 \n" + "packuswb %%xmm4,%%xmm4 \n" + "pxor %%xmm5,%%xmm5 \n" + + LABELALIGN +@@ -217,11 +217,11 @@ + void ScaleRowDown2Linear_AVX2(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { + (void)src_stride; +- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" ++ asm volatile("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" + "vpsrlw $0xf,%%ymm4,%%ymm4 \n" + "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" + "vpxor %%ymm5,%%ymm5,%%ymm5 \n" + + LABELALIGN +@@ -249,11 +249,11 @@ + + void ScaleRowDown2Box_AVX2(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" ++ asm volatile("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" + "vpsrlw $0xf,%%ymm4,%%ymm4 \n" + "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" + "vpxor %%ymm5,%%ymm5,%%ymm5 \n" + + LABELALIGN +@@ -291,11 +291,11 @@ + void ScaleRowDown4_SSSE3(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { + (void)src_stride; +- asm("pcmpeqb %%xmm5,%%xmm5 \n" ++ asm volatile("pcmpeqb %%xmm5,%%xmm5 \n" + "psrld $0x18,%%xmm5 \n" + "pslld $0x10,%%xmm5 \n" + + LABELALIGN + "1: \n" +@@ -321,11 +321,11 @@ + void ScaleRowDown4Box_SSSE3(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { + intptr_t stridex3; +- asm("pcmpeqb %%xmm4,%%xmm4 \n" ++ asm volatile("pcmpeqb %%xmm4,%%xmm4 \n" + "psrlw $0xf,%%xmm4 \n" + "movdqa %%xmm4,%%xmm5 \n" + "packuswb %%xmm4,%%xmm4 \n" + "psllw $0x3,%%xmm5 \n" + "lea 0x00(%4,%4,2),%3 \n" +@@ -375,11 +375,11 @@ + void ScaleRowDown4_AVX2(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { + (void)src_stride; +- asm("vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" ++ asm volatile("vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" + "vpsrld $0x18,%%ymm5,%%ymm5 \n" + "vpslld $0x10,%%ymm5,%%ymm5 \n" + + LABELALIGN + "1: \n" +@@ -407,11 +407,11 @@ + + void ScaleRowDown4Box_AVX2(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" ++ asm volatile("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" + "vpsrlw $0xf,%%ymm4,%%ymm4 \n" + "vpsllw $0x3,%%ymm4,%%ymm5 \n" + "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" + + LABELALIGN +@@ -462,11 +462,11 @@ + void ScaleRowDown34_SSSE3(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { + (void)src_stride; +- asm("movdqa %0,%%xmm3 \n" ++ asm volatile("movdqa %0,%%xmm3 \n" + "movdqa %1,%%xmm4 \n" + "movdqa %2,%%xmm5 \n" + : + : "m"(kShuf0), // %0 + "m"(kShuf1), // %1 +@@ -497,19 +497,19 @@ + + void ScaleRowDown34_1_Box_SSSE3(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm("movdqa %0,%%xmm2 \n" // kShuf01 ++ asm volatile("movdqa %0,%%xmm2 \n" // kShuf01 + "movdqa %1,%%xmm3 \n" // kShuf11 + "movdqa %2,%%xmm4 \n" // kShuf21 + : + : "m"(kShuf01), // %0 + "m"(kShuf11), // %1 + "m"(kShuf21) // %2 + ); +- asm("movdqa %0,%%xmm5 \n" // kMadd01 ++ asm volatile("movdqa %0,%%xmm5 \n" // kMadd01 + "movdqa %1,%%xmm0 \n" // kMadd11 + "movdqa %2,%%xmm1 \n" // kRound34 + : + : "m"(kMadd01), // %0 + "m"(kMadd11), // %1 +@@ -559,19 +559,19 @@ + + void ScaleRowDown34_0_Box_SSSE3(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm("movdqa %0,%%xmm2 \n" // kShuf01 ++ asm volatile("movdqa %0,%%xmm2 \n" // kShuf01 + "movdqa %1,%%xmm3 \n" // kShuf11 + "movdqa %2,%%xmm4 \n" // kShuf21 + : + : "m"(kShuf01), // %0 + "m"(kShuf11), // %1 + "m"(kShuf21) // %2 + ); +- asm("movdqa %0,%%xmm5 \n" // kMadd01 ++ asm volatile("movdqa %0,%%xmm5 \n" // kMadd01 + "movdqa %1,%%xmm0 \n" // kMadd11 + "movdqa %2,%%xmm1 \n" // kRound34 + : + : "m"(kMadd01), // %0 + "m"(kMadd11), // %1 +@@ -626,11 +626,11 @@ + void ScaleRowDown38_SSSE3(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { + (void)src_stride; +- asm("movdqa %3,%%xmm4 \n" ++ asm volatile("movdqa %3,%%xmm4 \n" + "movdqa %4,%%xmm5 \n" + + LABELALIGN + "1: \n" + "movdqu (%0),%%xmm0 \n" +@@ -655,11 +655,11 @@ + + void ScaleRowDown38_2_Box_SSSE3(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm("movdqa %0,%%xmm2 \n" ++ asm volatile("movdqa %0,%%xmm2 \n" + "movdqa %1,%%xmm3 \n" + "movdqa %2,%%xmm4 \n" + "movdqa %3,%%xmm5 \n" + : + : "m"(kShufAb0), // %0 +@@ -697,11 +697,11 @@ + + void ScaleRowDown38_3_Box_SSSE3(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm("movdqa %0,%%xmm2 \n" ++ asm volatile("movdqa %0,%%xmm2 \n" + "movdqa %1,%%xmm3 \n" + "movdqa %2,%%xmm4 \n" + "pxor %%xmm5,%%xmm5 \n" + : + : "m"(kShufAc), // %0 +@@ -764,11 +764,11 @@ + + #ifdef HAS_SCALEROWUP2_LINEAR_SSE2 + void ScaleRowUp2_Linear_SSE2(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int dst_width) { +- asm("pxor %%xmm0,%%xmm0 \n" // 0 ++ asm volatile("pxor %%xmm0,%%xmm0 \n" // 0 + "pcmpeqw %%xmm6,%%xmm6 \n" + "psrlw $15,%%xmm6 \n" + "psllw $1,%%xmm6 \n" // all 2 + + LABELALIGN +@@ -932,11 +932,11 @@ + + #ifdef HAS_SCALEROWUP2_LINEAR_12_SSSE3 + void ScaleRowUp2_Linear_12_SSSE3(const uint16_t* src_ptr, + uint16_t* dst_ptr, + int dst_width) { +- asm("movdqa %3,%%xmm5 \n" ++ asm volatile("movdqa %3,%%xmm5 \n" + "pcmpeqw %%xmm4,%%xmm4 \n" + "psrlw $15,%%xmm4 \n" + "psllw $1,%%xmm4 \n" // all 2 + + LABELALIGN +@@ -983,11 +983,11 @@ + void ScaleRowUp2_Bilinear_12_SSSE3(const uint16_t* src_ptr, + ptrdiff_t src_stride, + uint16_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width) { +- asm("pcmpeqw %%xmm7,%%xmm7 \n" ++ asm volatile("pcmpeqw %%xmm7,%%xmm7 \n" + "psrlw $15,%%xmm7 \n" + "psllw $3,%%xmm7 \n" // all 8 + "movdqa %5,%%xmm6 \n" + + LABELALIGN +@@ -1080,11 +1080,11 @@ + + #ifdef HAS_SCALEROWUP2_LINEAR_16_SSE2 + void ScaleRowUp2_Linear_16_SSE2(const uint16_t* src_ptr, + uint16_t* dst_ptr, + int dst_width) { +- asm("pxor %%xmm5,%%xmm5 \n" ++ asm volatile("pxor %%xmm5,%%xmm5 \n" + "pcmpeqd %%xmm4,%%xmm4 \n" + "psrld $31,%%xmm4 \n" + "pslld $1,%%xmm4 \n" // all 2 + + LABELALIGN +@@ -1132,11 +1132,11 @@ + void ScaleRowUp2_Bilinear_16_SSE2(const uint16_t* src_ptr, + ptrdiff_t src_stride, + uint16_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width) { +- asm("pxor %%xmm7,%%xmm7 \n" ++ asm volatile("pxor %%xmm7,%%xmm7 \n" + "pcmpeqd %%xmm6,%%xmm6 \n" + "psrld $31,%%xmm6 \n" + "pslld $3,%%xmm6 \n" // all 8 + + LABELALIGN +@@ -1239,11 +1239,11 @@ + + #ifdef HAS_SCALEROWUP2_LINEAR_SSSE3 + void ScaleRowUp2_Linear_SSSE3(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int dst_width) { +- asm("pcmpeqw %%xmm4,%%xmm4 \n" ++ asm volatile("pcmpeqw %%xmm4,%%xmm4 \n" + "psrlw $15,%%xmm4 \n" + "psllw $1,%%xmm4 \n" // all 2 + "movdqa %3,%%xmm3 \n" + + LABELALIGN +@@ -1279,11 +1279,11 @@ + void ScaleRowUp2_Bilinear_SSSE3(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width) { +- asm("pcmpeqw %%xmm6,%%xmm6 \n" ++ asm volatile("pcmpeqw %%xmm6,%%xmm6 \n" + "psrlw $15,%%xmm6 \n" + "psllw $3,%%xmm6 \n" // all 8 + "movdqa %5,%%xmm7 \n" + + LABELALIGN +@@ -1363,11 +1363,11 @@ + + #ifdef HAS_SCALEROWUP2_LINEAR_AVX2 + void ScaleRowUp2_Linear_AVX2(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int dst_width) { +- asm("vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" ++ asm volatile("vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" + "vpsrlw $15,%%ymm4,%%ymm4 \n" + "vpsllw $1,%%ymm4,%%ymm4 \n" // all 2 + "vbroadcastf128 %3,%%ymm3 \n" + + LABELALIGN +@@ -1406,11 +1406,11 @@ + void ScaleRowUp2_Bilinear_AVX2(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width) { +- asm("vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" ++ asm volatile("vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" + "vpsrlw $15,%%ymm6,%%ymm6 \n" + "vpsllw $3,%%ymm6,%%ymm6 \n" // all 8 + "vbroadcastf128 %5,%%ymm7 \n" + + LABELALIGN +@@ -1487,11 +1487,11 @@ + + #ifdef HAS_SCALEROWUP2_LINEAR_12_AVX2 + void ScaleRowUp2_Linear_12_AVX2(const uint16_t* src_ptr, + uint16_t* dst_ptr, + int dst_width) { +- asm("vbroadcastf128 %3,%%ymm5 \n" ++ asm volatile("vbroadcastf128 %3,%%ymm5 \n" + "vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" + "vpsrlw $15,%%ymm4,%%ymm4 \n" + "vpsllw $1,%%ymm4,%%ymm4 \n" // all 2 + + LABELALIGN +@@ -1538,11 +1538,11 @@ + void ScaleRowUp2_Bilinear_12_AVX2(const uint16_t* src_ptr, + ptrdiff_t src_stride, + uint16_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width) { +- asm("vbroadcastf128 %5,%%ymm5 \n" ++ asm volatile("vbroadcastf128 %5,%%ymm5 \n" + "vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" + "vpsrlw $15,%%ymm4,%%ymm4 \n" + "vpsllw $3,%%ymm4,%%ymm4 \n" // all 8 + + LABELALIGN +@@ -1599,11 +1599,11 @@ + + #ifdef HAS_SCALEROWUP2_LINEAR_16_AVX2 + void ScaleRowUp2_Linear_16_AVX2(const uint16_t* src_ptr, + uint16_t* dst_ptr, + int dst_width) { +- asm("vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" ++ asm volatile("vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" + "vpsrld $31,%%ymm4,%%ymm4 \n" + "vpslld $1,%%ymm4,%%ymm4 \n" // all 2 + + LABELALIGN + "1: \n" +@@ -1648,11 +1648,11 @@ + void ScaleRowUp2_Bilinear_16_AVX2(const uint16_t* src_ptr, + ptrdiff_t src_stride, + uint16_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width) { +- asm("vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" ++ asm volatile("vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" + "vpsrld $31,%%ymm6,%%ymm6 \n" + "vpslld $3,%%ymm6,%%ymm6 \n" // all 8 + + LABELALIGN + "1: \n" +@@ -1730,11 +1730,11 @@ + + // Reads 16xN bytes and produces 16 shorts at a time. + void ScaleAddRow_SSE2(const uint8_t* src_ptr, + uint16_t* dst_ptr, + int src_width) { +- asm("pxor %%xmm5,%%xmm5 \n" ++ asm volatile("pxor %%xmm5,%%xmm5 \n" + + // 16 pixel loop. + LABELALIGN + "1: \n" + "movdqu (%0),%%xmm3 \n" +@@ -1761,11 +1761,11 @@ + #ifdef HAS_SCALEADDROW_AVX2 + // Reads 32 bytes and accumulates to 32 shorts at a time. + void ScaleAddRow_AVX2(const uint8_t* src_ptr, + uint16_t* dst_ptr, + int src_width) { +- asm("vpxor %%ymm5,%%ymm5,%%ymm5 \n" ++ asm volatile("vpxor %%ymm5,%%ymm5,%%ymm5 \n" + + LABELALIGN + "1: \n" + "vmovdqu (%0),%%ymm3 \n" + "lea 0x20(%0),%0 \n" // src_ptr += 32 +@@ -1802,11 +1802,11 @@ + const uint8_t* src_ptr, + int dst_width, + int x, + int dx) { + intptr_t x0, x1, temp_pixel; +- asm("movd %6,%%xmm2 \n" ++ asm volatile("movd %6,%%xmm2 \n" + "movd %7,%%xmm3 \n" + "movl $0x04040000,%k2 \n" + "movd %k2,%%xmm5 \n" + "pcmpeqb %%xmm6,%%xmm6 \n" + "psrlw $0x9,%%xmm6 \n" // 0x007f007f +@@ -2003,11 +2003,11 @@ + uint8_t* dst_argb, + int dst_width) { + intptr_t src_stepx_x4 = (intptr_t)(src_stepx); + intptr_t src_stepx_x12; + (void)src_stride; +- asm("lea 0x00(,%1,4),%1 \n" ++ asm volatile("lea 0x00(,%1,4),%1 \n" + "lea 0x00(%1,%1,2),%4 \n" + + LABELALIGN + "1: \n" + "movd (%0),%%xmm0 \n" +@@ -2039,11 +2039,11 @@ + uint8_t* dst_argb, + int dst_width) { + intptr_t src_stepx_x4 = (intptr_t)(src_stepx); + intptr_t src_stepx_x12; + intptr_t row1 = (intptr_t)(src_stride); +- asm("lea 0x00(,%1,4),%1 \n" ++ asm volatile("lea 0x00(,%1,4),%1 \n" + "lea 0x00(%1,%1,2),%4 \n" + "lea 0x00(%0,%5,1),%5 \n" + + LABELALIGN + "1: \n" +@@ -2081,11 +2081,11 @@ + const uint8_t* src_argb, + int dst_width, + int x, + int dx) { + intptr_t x0, x1; +- asm("movd %5,%%xmm2 \n" ++ asm volatile("movd %5,%%xmm2 \n" + "movd %6,%%xmm3 \n" + "pshufd $0x0,%%xmm2,%%xmm2 \n" + "pshufd $0x11,%%xmm3,%%xmm0 \n" + "paddd %%xmm0,%%xmm2 \n" + "paddd %%xmm3,%%xmm3 \n" +@@ -2189,18 +2189,18 @@ + const uint8_t* src_argb, + int dst_width, + int x, + int dx) { + intptr_t x0, x1; +- asm("movdqa %0,%%xmm4 \n" ++ asm volatile("movdqa %0,%%xmm4 \n" + "movdqa %1,%%xmm5 \n" + : + : "m"(kShuffleColARGB), // %0 + "m"(kShuffleFractions) // %1 + ); + +- asm("movd %5,%%xmm2 \n" ++ asm volatile("movd %5,%%xmm2 \n" + "movd %6,%%xmm3 \n" + "pcmpeqb %%xmm6,%%xmm6 \n" + "psrlw $0x9,%%xmm6 \n" + "pextrw $0x1,%%xmm2,%k3 \n" + "sub $0x2,%2 \n" +@@ -2258,11 +2258,11 @@ + : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6"); + } + + // Divide num by div and return as 16.16 fixed point result. + int FixedDiv_X86(int num, int div) { +- asm("cdq \n" ++ asm volatile("cdq \n" + "shld $0x10,%%eax,%%edx \n" + "shl $0x10,%%eax \n" + "idiv %1 \n" + "mov %0, %%eax \n" + : "+a"(num) // %0 +@@ -2271,11 +2271,11 @@ + return num; + } + + // Divide num - 1 by div - 1 and return as 16.16 fixed point result. + int FixedDiv1_X86(int num, int div) { +- asm("cdq \n" ++ asm volatile("cdq \n" + "shld $0x10,%%eax,%%edx \n" + "shl $0x10,%%eax \n" + "sub $0x10001,%%eax \n" + "sbb $0x0,%%edx \n" + "sub $0x1,%1 \n" +@@ -2302,11 +2302,11 @@ + + void ScaleUVRowDown2Box_SSSE3(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm("pcmpeqb %%xmm4,%%xmm4 \n" // 01010101 ++ asm volatile("pcmpeqb %%xmm4,%%xmm4 \n" // 01010101 + "psrlw $0xf,%%xmm4 \n" + "packuswb %%xmm4,%%xmm4 \n" + "pxor %%xmm5, %%xmm5 \n" // zero + "movdqa %4,%%xmm1 \n" // split shuffler + "movdqa %5,%%xmm3 \n" // merge shuffler +@@ -2341,11 +2341,11 @@ + #ifdef HAS_SCALEUVROWDOWN2BOX_AVX2 + void ScaleUVRowDown2Box_AVX2(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + int dst_width) { +- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" // 01010101 ++ asm volatile("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" // 01010101 + "vpsrlw $0xf,%%ymm4,%%ymm4 \n" + "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" + "vpxor %%ymm5,%%ymm5,%%ymm5 \n" // zero + "vbroadcastf128 %4,%%ymm1 \n" // split shuffler + "vbroadcastf128 %5,%%ymm3 \n" // merge shuffler +@@ -2384,11 +2384,11 @@ + + #ifdef HAS_SCALEUVROWUP2_LINEAR_SSSE3 + void ScaleUVRowUp2_Linear_SSSE3(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int dst_width) { +- asm("pcmpeqw %%xmm4,%%xmm4 \n" ++ asm volatile("pcmpeqw %%xmm4,%%xmm4 \n" + "psrlw $15,%%xmm4 \n" + "psllw $1,%%xmm4 \n" // all 2 + "movdqa %3,%%xmm3 \n" + + LABELALIGN +@@ -2424,11 +2424,11 @@ + void ScaleUVRowUp2_Bilinear_SSSE3(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width) { +- asm("pcmpeqw %%xmm6,%%xmm6 \n" ++ asm volatile("pcmpeqw %%xmm6,%%xmm6 \n" + "psrlw $15,%%xmm6 \n" + "psllw $3,%%xmm6 \n" // all 8 + "movdqa %5,%%xmm7 \n" + + LABELALIGN +@@ -2507,11 +2507,11 @@ + #ifdef HAS_SCALEUVROWUP2_LINEAR_AVX2 + + void ScaleUVRowUp2_Linear_AVX2(const uint8_t* src_ptr, + uint8_t* dst_ptr, + int dst_width) { +- asm("vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" ++ asm volatile("vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" + "vpsrlw $15,%%ymm4,%%ymm4 \n" + "vpsllw $1,%%ymm4,%%ymm4 \n" // all 2 + "vbroadcastf128 %3,%%ymm3 \n" + + LABELALIGN +@@ -2549,11 +2549,11 @@ + void ScaleUVRowUp2_Bilinear_AVX2(const uint8_t* src_ptr, + ptrdiff_t src_stride, + uint8_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width) { +- asm("vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" ++ asm volatile("vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" + "vpsrlw $15,%%ymm6,%%ymm6 \n" + "vpsllw $3,%%ymm6,%%ymm6 \n" // all 8 + "vbroadcastf128 %5,%%ymm7 \n" + + LABELALIGN +@@ -2628,11 +2628,11 @@ + + #ifdef HAS_SCALEUVROWUP2_LINEAR_16_SSE41 + void ScaleUVRowUp2_Linear_16_SSE41(const uint16_t* src_ptr, + uint16_t* dst_ptr, + int dst_width) { +- asm("pxor %%xmm5,%%xmm5 \n" ++ asm volatile("pxor %%xmm5,%%xmm5 \n" + "pcmpeqd %%xmm4,%%xmm4 \n" + "psrld $31,%%xmm4 \n" + "pslld $1,%%xmm4 \n" // all 2 + + LABELALIGN +@@ -2679,11 +2679,11 @@ + void ScaleUVRowUp2_Bilinear_16_SSE41(const uint16_t* src_ptr, + ptrdiff_t src_stride, + uint16_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width) { +- asm("pxor %%xmm7,%%xmm7 \n" ++ asm volatile("pxor %%xmm7,%%xmm7 \n" + "pcmpeqd %%xmm6,%%xmm6 \n" + "psrld $31,%%xmm6 \n" + "pslld $3,%%xmm6 \n" // all 8 + + LABELALIGN +@@ -2769,11 +2769,11 @@ + + #ifdef HAS_SCALEUVROWUP2_LINEAR_16_AVX2 + void ScaleUVRowUp2_Linear_16_AVX2(const uint16_t* src_ptr, + uint16_t* dst_ptr, + int dst_width) { +- asm("vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" ++ asm volatile("vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" + "vpsrld $31,%%ymm4,%%ymm4 \n" + "vpslld $1,%%ymm4,%%ymm4 \n" // all 2 + + LABELALIGN + "1: \n" +@@ -2817,11 +2817,11 @@ + void ScaleUVRowUp2_Bilinear_16_AVX2(const uint16_t* src_ptr, + ptrdiff_t src_stride, + uint16_t* dst_ptr, + ptrdiff_t dst_stride, + int dst_width) { +- asm("vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" ++ asm volatile("vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" + "vpsrld $31,%%ymm6,%%ymm6 \n" + "vpslld $3,%%ymm6,%%ymm6 \n" // all 8 + + LABELALIGN + "1: \n" +diff --git a/media/libyuv/moz.yaml b/media/libyuv/moz.yaml +--- a/media/libyuv/moz.yaml ++++ b/media/libyuv/moz.yaml +@@ -53,5 +53,6 @@ + patches: + - 00_fix_build_errors.patch + - 01_make_mjpeg_printfs_optional.patch + - 02_update_gyp.patch + - 03_add_neon64_and_sve_gyp_targets.patch ++ - 04_add_missing_volatile.patch + diff --git a/firefox.spec b/firefox.spec index fd5c6d2..95eed97 100644 --- a/firefox.spec +++ b/firefox.spec @@ -197,7 +197,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 130.0 -Release: 3%{?pre_tag}%{?dist} +Release: 4%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -302,7 +302,7 @@ Patch603: firefox-gcc-always-inline.patch Patch800: bmo-1559213-Support-system-av1.patch Patch801: bmo-1559213-fix-system-av1-libs.patch -Patch802: libyuv-downgrade.patch +Patch802: D221275.1725700750.diff %if %{?system_nss} BuildRequires: pkgconfig(nspr) >= %{nspr_version} @@ -613,7 +613,7 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %endif %patch -P603 -p1 -b .inline -%patch -P802 -p1 -b .libyuv-downgrade +%patch -P802 -p1 -b .libyuv #%patch800 -p1 -b .system-av1 #%patch801 -p1 -b .system-av1-fixup @@ -1239,6 +1239,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Sep 6 2024 Martin Stransky - 130.0-4 +- Added fix for mzbz#1916038 + * Thu Sep 5 2024 Martin Stransky - 130.0-3 - Downgrade libyuv to fix AVIF image rendering diff --git a/libyuv-downgrade.patch b/libyuv-downgrade.patch deleted file mode 100644 index f047285..0000000 --- a/libyuv-downgrade.patch +++ /dev/null @@ -1,33672 +0,0 @@ -diff --git a/media/libyuv/libyuv/AUTHORS b/media/libyuv/libyuv/AUTHORS ---- a/media/libyuv/libyuv/AUTHORS -+++ b/media/libyuv/libyuv/AUTHORS -@@ -3,5 +3,4 @@ - - Google Inc. - --Ho Cheung - Ivan Pavlotskiy -diff --git a/media/libyuv/libyuv/Android.bp b/media/libyuv/libyuv/Android.bp ---- a/media/libyuv/libyuv/Android.bp -+++ b/media/libyuv/libyuv/Android.bp -@@ -1,5 +1,5 @@ - package { -- default_applicable_licenses: ["external_libyuv_license"], -+ default_applicable_licenses: ["external_libyuv_files_license"], - } - - // Added automatically by a large-scale-change -@@ -10,7 +10,7 @@ package { - // Please consider removing redundant or irrelevant files from 'license_text:'. - // See: http://go/android-license-faq - license { -- name: "external_libyuv_license", -+ name: "external_libyuv_files_license", - visibility: [":__subpackages__"], - license_kinds: [ - "SPDX-license-identifier-BSD", -@@ -62,7 +62,6 @@ cc_library { - "source/row_msa.cc", - "source/row_neon.cc", - "source/row_neon64.cc", -- "source/row_rvv.cc", - "source/scale.cc", - "source/scale_any.cc", - "source/scale_argb.cc", -@@ -72,7 +71,6 @@ cc_library { - "source/scale_neon.cc", - "source/scale_neon64.cc", - "source/scale_rgb.cc", -- "source/scale_rvv.cc", - "source/scale_uv.cc", - "source/video_common.cc", - ], -@@ -83,7 +81,6 @@ cc_library { - "-Wno-unused-parameter", - "-fexceptions", - "-DHAVE_JPEG", -- "-DLIBYUV_UNLIMITED_DATA", - ], - - arch: { -@@ -133,7 +130,6 @@ cc_test { - "unit_test/rotate_argb_test.cc", - "unit_test/rotate_test.cc", - "unit_test/scale_argb_test.cc", -- "unit_test/scale_plane_test.cc", - "unit_test/scale_rgb_test.cc", - "unit_test/scale_test.cc", - "unit_test/scale_uv_test.cc", -diff --git a/media/libyuv/libyuv/Android.mk b/media/libyuv/libyuv/Android.mk ---- a/media/libyuv/libyuv/Android.mk -+++ b/media/libyuv/libyuv/Android.mk -@@ -87,23 +87,21 @@ LOCAL_MODULE_TAGS := tests - LOCAL_CPP_EXTENSION := .cc - LOCAL_C_INCLUDES += $(LOCAL_PATH)/include - LOCAL_SRC_FILES := \ -- unit_test/basictypes_test.cc \ -- unit_test/color_test.cc \ -- unit_test/compare_test.cc \ -- unit_test/convert_argb_test.cc \ -- unit_test/convert_test.cc \ -- unit_test/cpu_test.cc \ -- unit_test/cpu_thread_test.cc \ -- unit_test/math_test.cc \ -- unit_test/planar_test.cc \ -- unit_test/rotate_argb_test.cc \ -- unit_test/rotate_test.cc \ -- unit_test/scale_argb_test.cc \ -- unit_test/scale_plane_test.cc \ -- unit_test/scale_rgb_test.cc \ -- unit_test/scale_test.cc \ -- unit_test/scale_uv_test.cc \ -- unit_test/unit_test.cc \ -+ unit_test/basictypes_test.cc \ -+ unit_test/color_test.cc \ -+ unit_test/compare_test.cc \ -+ unit_test/convert_test.cc \ -+ unit_test/cpu_test.cc \ -+ unit_test/cpu_thread_test.cc \ -+ unit_test/math_test.cc \ -+ unit_test/planar_test.cc \ -+ unit_test/rotate_argb_test.cc \ -+ unit_test/rotate_test.cc \ -+ unit_test/scale_argb_test.cc \ -+ unit_test/scale_rgb_test.cc \ -+ unit_test/scale_test.cc \ -+ unit_test/scale_uv_test.cc \ -+ unit_test/unit_test.cc \ - unit_test/video_common_test.cc - - LOCAL_MODULE := libyuv_unittest -diff --git a/media/libyuv/libyuv/BUILD.gn b/media/libyuv/libyuv/BUILD.gn ---- a/media/libyuv/libyuv/BUILD.gn -+++ b/media/libyuv/libyuv/BUILD.gn -@@ -6,7 +6,6 @@ - # in the file PATENTS. All contributing project authors may - # be found in the AUTHORS file in the root of the source tree. - --import("//build/config/features.gni") - import("//testing/test.gni") - import("libyuv.gni") - -@@ -22,33 +21,15 @@ declare_args() { - - config("libyuv_config") { - include_dirs = [ "include" ] -- if (is_android) { -- if (target_cpu == "arm" || target_cpu == "x86" || target_cpu == "mipsel") { -- ldflags = [ "-Wl,--dynamic-linker,/system/bin/linker" ] -- } else { -- ldflags = [ "-Wl,--dynamic-linker,/system/bin/linker64" ] -- } -+ if (is_android && current_cpu == "arm64") { -+ ldflags = [ "-Wl,--dynamic-linker,/system/bin/linker64" ] -+ } -+ if (is_android && current_cpu != "arm64") { -+ ldflags = [ "-Wl,--dynamic-linker,/system/bin/linker" ] - } - -- # Define CHROMIUM to tell cpu_id to avoid sandbox unsafe system calls. -- defines = [ "CHROMIUM" ] - if (!libyuv_use_neon) { -- defines += [ "LIBYUV_DISABLE_NEON" ] -- } -- if (!libyuv_use_sve) { -- defines += [ "LIBYUV_DISABLE_SVE" ] -- } -- if (!libyuv_use_sme) { -- defines += [ "LIBYUV_DISABLE_SME" ] -- } -- if (libyuv_disable_rvv) { -- defines += [ "LIBYUV_DISABLE_RVV" ] -- } -- if (!libyuv_use_lsx) { -- defines += [ "LIBYUV_DISABLE_LSX" ] -- } -- if (!libyuv_use_lasx) { -- defines += [ "LIBYUV_DISABLE_LASX" ] -+ defines = [ "LIBYUV_DISABLE_NEON" ] - } - } - -@@ -84,22 +65,10 @@ group("libyuv") { - deps += [ ":libyuv_neon" ] - } - -- if (libyuv_use_sve) { -- deps += [ ":libyuv_sve" ] -- } -- - if (libyuv_use_msa) { - deps += [ ":libyuv_msa" ] - } - -- if (libyuv_use_lsx) { -- deps += [ ":libyuv_lsx" ] -- } -- -- if (libyuv_use_lasx) { -- deps += [ ":libyuv_lasx" ] -- } -- - if (!is_ios && !libyuv_disable_jpeg) { - # Make sure that clients of libyuv link with libjpeg. This can't go in - # libyuv_internal because in Windows x64 builds that will generate a clang -@@ -116,14 +85,11 @@ static_library("libyuv_internal") { - "include/libyuv.h", - "include/libyuv/basic_types.h", - "include/libyuv/compare.h", -- "include/libyuv/compare_row.h", - "include/libyuv/convert.h", - "include/libyuv/convert_argb.h", - "include/libyuv/convert_from.h", - "include/libyuv/convert_from_argb.h", - "include/libyuv/cpu_id.h", -- "include/libyuv/loongson_intrinsics.h", -- "include/libyuv/macros_msa.h", - "include/libyuv/mjpeg_decoder.h", - "include/libyuv/planar_functions.h", - "include/libyuv/rotate.h", -@@ -163,7 +129,6 @@ static_library("libyuv_internal") { - "source/row_any.cc", - "source/row_common.cc", - "source/row_gcc.cc", -- "source/row_rvv.cc", - "source/row_win.cc", - "source/scale.cc", - "source/scale_any.cc", -@@ -171,7 +136,6 @@ static_library("libyuv_internal") { - "source/scale_common.cc", - "source/scale_gcc.cc", - "source/scale_rgb.cc", -- "source/scale_rvv.cc", - "source/scale_uv.cc", - "source/scale_win.cc", - "source/video_common.cc", -@@ -186,7 +150,7 @@ static_library("libyuv_internal") { - configs += [ "//build/config/gcc:symbol_visibility_default" ] - } - -- if ((!is_ios || use_blink) && !libyuv_disable_jpeg) { -+ if (!is_ios && !libyuv_disable_jpeg) { - defines += [ "HAVE_JPEG" ] - - # Needed to pull in libjpeg headers. Can't add //third_party:jpeg to deps -@@ -232,45 +196,23 @@ if (libyuv_use_neon) { - - public_configs = [ ":libyuv_config" ] - -- if (current_cpu == "arm64") { -- cflags = [ "-march=armv8-a+dotprod+i8mm" ] -- } else { -+ # Always enable optimization for Release and NaCl builds (to workaround -+ # crbug.com/538243). -+ if (!is_debug) { -+ configs -= [ "//build/config/compiler:default_optimization" ] -+ -+ # Enable optimize for speed (-O2) over size (-Os). -+ # TODO(fbarchard): Consider optimize_speed which is O3. -+ configs += [ "//build/config/compiler:optimize_max" ] -+ } -+ -+ if (current_cpu != "arm64") { - configs -= [ "//build/config/compiler:compiler_arm_fpu" ] - cflags = [ "-mfpu=neon" ] - } - } - } - --if (libyuv_use_sve) { -- static_library("libyuv_sve") { -- sources = [ -- "source/row_sve.cc", -- ] -- -- deps = [ ":libyuv_internal" ] -- -- public_configs = [ ":libyuv_config" ] -- -- # SVE2 is an Armv9-A feature. -- cflags = [ "-march=armv9-a+sve2" ] -- } --} -- --if (libyuv_use_sme) { -- static_library("libyuv_sme") { -- sources = [ -- "source/rotate_sme.cc", -- ] -- -- deps = [ ":libyuv_internal" ] -- -- public_configs = [ ":libyuv_config" ] -- -- # SME is an Armv9-A feature. -- cflags = [ "-march=armv9-a+sme" ] -- } --} -- - if (libyuv_use_msa) { - static_library("libyuv_msa") { - sources = [ -@@ -287,44 +229,6 @@ if (libyuv_use_msa) { - } - } - --if (libyuv_use_lsx) { -- static_library("libyuv_lsx") { -- sources = [ -- # LSX Source Files -- "source/rotate_lsx.cc", -- "source/row_lsx.cc", -- "source/scale_lsx.cc", -- ] -- -- cflags_cc = [ -- "-mlsx", -- "-Wno-c++11-narrowing", -- ] -- -- deps = [ ":libyuv_internal" ] -- -- public_configs = [ ":libyuv_config" ] -- } --} -- --if (libyuv_use_lasx) { -- static_library("libyuv_lasx") { -- sources = [ -- # LASX Source Files -- "source/row_lasx.cc", -- ] -- -- cflags_cc = [ -- "-mlasx", -- "-Wno-c++11-narrowing", -- ] -- -- deps = [ ":libyuv_internal" ] -- -- public_configs = [ ":libyuv_config" ] -- } --} -- - if (libyuv_include_tests) { - config("libyuv_unittest_warnings_config") { - if (!is_win) { -@@ -352,7 +256,6 @@ if (libyuv_include_tests) { - "unit_test/basictypes_test.cc", - "unit_test/color_test.cc", - "unit_test/compare_test.cc", -- "unit_test/convert_argb_test.cc", - "unit_test/convert_test.cc", - "unit_test/cpu_test.cc", - "unit_test/cpu_thread_test.cc", -@@ -361,7 +264,6 @@ if (libyuv_include_tests) { - "unit_test/rotate_argb_test.cc", - "unit_test/rotate_test.cc", - "unit_test/scale_argb_test.cc", -- "unit_test/scale_plane_test.cc", - "unit_test/scale_rgb_test.cc", - "unit_test/scale_test.cc", - "unit_test/scale_uv_test.cc", -diff --git a/media/libyuv/libyuv/CMakeLists.txt b/media/libyuv/libyuv/CMakeLists.txt ---- a/media/libyuv/libyuv/CMakeLists.txt -+++ b/media/libyuv/libyuv/CMakeLists.txt -@@ -4,7 +4,7 @@ - - PROJECT ( YUV C CXX ) # "C" is required even for C++ projects - CMAKE_MINIMUM_REQUIRED( VERSION 2.8.12 ) --OPTION( UNIT_TEST "Built unit tests" OFF ) -+OPTION( TEST "Built unit tests" OFF ) - - SET ( ly_base_dir ${PROJECT_SOURCE_DIR} ) - SET ( ly_src_dir ${ly_base_dir}/source ) -@@ -14,54 +14,8 @@ SET ( ly_lib_name yuv ) - SET ( ly_lib_static ${ly_lib_name} ) - SET ( ly_lib_shared ${ly_lib_name}_shared ) - --# We cannot use GLOB here since we want to be able to separate out files that --# need particular flags to enable architecture extensions like AArch64's SVE. --# TODO: More of these files could be separated out for different architectures. --SET ( ly_common_source_files -- ${ly_src_dir}/compare.cc -- ${ly_src_dir}/compare_common.cc -- ${ly_src_dir}/compare_gcc.cc -- ${ly_src_dir}/compare_msa.cc -- ${ly_src_dir}/compare_win.cc -- ${ly_src_dir}/convert_argb.cc -- ${ly_src_dir}/convert.cc -- ${ly_src_dir}/convert_from_argb.cc -- ${ly_src_dir}/convert_from.cc -- ${ly_src_dir}/convert_jpeg.cc -- ${ly_src_dir}/convert_to_argb.cc -- ${ly_src_dir}/convert_to_i420.cc -- ${ly_src_dir}/cpu_id.cc -- ${ly_src_dir}/mjpeg_decoder.cc -- ${ly_src_dir}/mjpeg_validate.cc -- ${ly_src_dir}/planar_functions.cc -- ${ly_src_dir}/rotate_any.cc -- ${ly_src_dir}/rotate_argb.cc -- ${ly_src_dir}/rotate.cc -- ${ly_src_dir}/rotate_common.cc -- ${ly_src_dir}/rotate_gcc.cc -- ${ly_src_dir}/rotate_lsx.cc -- ${ly_src_dir}/rotate_msa.cc -- ${ly_src_dir}/rotate_win.cc -- ${ly_src_dir}/row_any.cc -- ${ly_src_dir}/row_common.cc -- ${ly_src_dir}/row_gcc.cc -- ${ly_src_dir}/row_lasx.cc -- ${ly_src_dir}/row_lsx.cc -- ${ly_src_dir}/row_msa.cc -- ${ly_src_dir}/row_rvv.cc -- ${ly_src_dir}/row_win.cc -- ${ly_src_dir}/scale_any.cc -- ${ly_src_dir}/scale_argb.cc -- ${ly_src_dir}/scale.cc -- ${ly_src_dir}/scale_common.cc -- ${ly_src_dir}/scale_gcc.cc -- ${ly_src_dir}/scale_lsx.cc -- ${ly_src_dir}/scale_msa.cc -- ${ly_src_dir}/scale_rgb.cc -- ${ly_src_dir}/scale_rvv.cc -- ${ly_src_dir}/scale_uv.cc -- ${ly_src_dir}/scale_win.cc -- ${ly_src_dir}/video_common.cc) -+FILE ( GLOB_RECURSE ly_source_files ${ly_src_dir}/*.cc ) -+LIST ( SORT ly_source_files ) - - FILE ( GLOB_RECURSE ly_unittest_sources ${ly_tst_dir}/*.cc ) - LIST ( SORT ly_unittest_sources ) -@@ -72,68 +26,17 @@ if(MSVC) - ADD_DEFINITIONS ( -D_CRT_SECURE_NO_WARNINGS ) - endif() - --# Need to set PIC to allow creating shared libraries from object file libraries. --SET(CMAKE_POSITION_INDEPENDENT_CODE ON) -- --# Build the set of objects that do not need to be compiled with flags to enable --# particular architecture features. --ADD_LIBRARY( ${ly_lib_name}_common_objects OBJECT ${ly_common_source_files} ) --SET(ly_lib_parts $) -- --if(NOT MSVC) -- STRING(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" arch_lowercase) -- -- if(arch_lowercase MATCHES "^arm" AND NOT arch_lowercase STREQUAL "arm64") -- # Enable Arm Neon kernels. -- ADD_DEFINITIONS(-DLIBYUV_NEON=1) -- ADD_LIBRARY(${ly_lib_name}_neon OBJECT -- ${ly_src_dir}/compare_neon.cc -- ${ly_src_dir}/rotate_neon.cc -- ${ly_src_dir}/row_neon.cc -- ${ly_src_dir}/scale_neon.cc) -- TARGET_COMPILE_OPTIONS(${ly_lib_name}_neon PRIVATE -mfpu=neon) -- LIST(APPEND ly_lib_parts $) -- endif() -- -- if(arch_lowercase STREQUAL "aarch64" OR arch_lowercase STREQUAL "arm64") -- # Enable AArch64 Neon dot-product and i8mm kernels. -- ADD_LIBRARY(${ly_lib_name}_neon64 OBJECT -- ${ly_src_dir}/compare_neon64.cc -- ${ly_src_dir}/rotate_neon64.cc -- ${ly_src_dir}/row_neon64.cc -- ${ly_src_dir}/scale_neon64.cc) -- TARGET_COMPILE_OPTIONS(${ly_lib_name}_neon64 PRIVATE -march=armv8-a+dotprod+i8mm) -- LIST(APPEND ly_lib_parts $) -- -- # Enable AArch64 SVE kernels. -- ADD_LIBRARY(${ly_lib_name}_sve OBJECT -- ${ly_src_dir}/row_sve.cc) -- TARGET_COMPILE_OPTIONS(${ly_lib_name}_sve PRIVATE -march=armv9-a+sve2) -- LIST(APPEND ly_lib_parts $) -- -- # Enable AArch64 SME kernels. -- ADD_LIBRARY(${ly_lib_name}_sme OBJECT -- ${ly_src_dir}/rotate_sme.cc) -- TARGET_COMPILE_OPTIONS(${ly_lib_name}_sme PRIVATE -march=armv9-a+sme) -- LIST(APPEND ly_lib_parts $) -- endif() --endif() -- - # this creates the static library (.a) --ADD_LIBRARY( ${ly_lib_static} STATIC ${ly_lib_parts}) -+ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} ) - - # this creates the shared library (.so) --ADD_LIBRARY( ${ly_lib_shared} SHARED ${ly_lib_parts}) --SET_TARGET_PROPERTIES( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" ) --SET_TARGET_PROPERTIES( ${ly_lib_shared} PROPERTIES PREFIX "lib" ) -+ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} ) -+SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" ) -+SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES PREFIX "lib" ) - if(WIN32) -- SET_TARGET_PROPERTIES( ${ly_lib_shared} PROPERTIES IMPORT_PREFIX "lib" ) -+ SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES IMPORT_PREFIX "lib" ) - endif() - --# this creates the cpuid tool --ADD_EXECUTABLE ( cpuid ${ly_base_dir}/util/cpuid.c ) --TARGET_LINK_LIBRARIES ( cpuid ${ly_lib_static} ) -- - # this creates the conversion tool - ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc ) - TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} ) -@@ -149,14 +52,10 @@ if (JPEG_FOUND) - add_definitions( -DHAVE_JPEG ) - endif() - --if(UNIT_TEST) -+if(TEST) - find_library(GTEST_LIBRARY gtest) - if(GTEST_LIBRARY STREQUAL "GTEST_LIBRARY-NOTFOUND") -- set(GTEST_SRC_DIR_DEFAULT /usr/src/gtest) -- if (CMAKE_CROSSCOMPILING) -- set(GTEST_SRC_DIR_DEFAULT ${CMAKE_SOURCE_DIR}/third_party/googletest/src/googletest) -- endif() -- set(GTEST_SRC_DIR ${GTEST_SRC_DIR_DEFAULT} CACHE STRING "Location of gtest sources") -+ set(GTEST_SRC_DIR /usr/src/gtest CACHE STRING "Location of gtest sources") - if(EXISTS ${GTEST_SRC_DIR}/src/gtest-all.cc) - message(STATUS "building gtest from sources in ${GTEST_SRC_DIR}") - set(gtest_sources ${GTEST_SRC_DIR}/src/gtest-all.cc) -@@ -165,7 +64,7 @@ if(UNIT_TEST) - include_directories(${GTEST_SRC_DIR}/include) - set(GTEST_LIBRARY gtest) - else() -- message(FATAL_ERROR "UNIT_TEST is set but unable to find gtest library") -+ message(FATAL_ERROR "TEST is set but unable to find gtest library") - endif() - endif() - -diff --git a/media/libyuv/libyuv/DEPS b/media/libyuv/libyuv/DEPS ---- a/media/libyuv/libyuv/DEPS -+++ b/media/libyuv/libyuv/DEPS -@@ -5,62 +5,60 @@ gclient_gn_args = [ - - vars = { - 'chromium_git': 'https://chromium.googlesource.com', -- 'chromium_revision': 'af3d01376bec75a68f90160bfd38057d60510a2b', -- 'gn_version': 'git_revision:fae280eabe5d31accc53100137459ece19a7a295', -+ 'chromium_revision': '504c0697552240028c5412dafd2a7306a7cd4be7', -+ 'gn_version': 'git_revision:6f13aaac55a977e1948910942675c69f2b4f7a94', - # ninja CIPD package version. - # https://chrome-infra-packages.appspot.com/p/infra/3pp/tools/ninja -- 'ninja_version': 'version:2@1.11.1.chromium.6', -+ 'ninja_version': 'version:2@1.8.2.chromium.3', - # reclient CIPD package version -- 'reclient_version': 're_client_version:0.110.0.43ec6b1-gomaip', -+ 'reclient_version': 're_client_version:0.81.1.0853992-gomaip', - - # Keep the Chromium default of generating location tags. - 'generate_location_tags': True, - - # By default, download the fuchsia sdk from the public sdk directory. -- 'fuchsia_sdk_cipd_prefix': 'fuchsia/sdk/core/', -- 'fuchsia_version': 'version:15.20230909.2.1', -+ 'fuchsia_sdk_cipd_prefix': 'fuchsia/sdk/gn/', -+ 'fuchsia_version': 'version:10.20221110.2.1', - # By default, download the fuchsia images from the fuchsia GCS bucket. - 'fuchsia_images_bucket': 'fuchsia', - 'checkout_fuchsia': False, - # Since the images are hundreds of MB, default to only downloading the image - # most commonly useful for developers. Bots and developers that need to use - # other images can override this with additional images. -- 'checkout_fuchsia_boot_images': "terminal.qemu-x64,terminal.x64", -+ 'checkout_fuchsia_boot_images': "terminal.qemu-x64", - 'checkout_fuchsia_product_bundles': '"{checkout_fuchsia_boot_images}" != ""', - } - - deps = { - 'src/build': -- Var('chromium_git') + '/chromium/src/build' + '@' + '5885d3c24833ad72845a52a1b913a2b8bc651b56', -+ Var('chromium_git') + '/chromium/src/build' + '@' + 'fe1231e1da1e95acb006f53d06caaad16756a376', - 'src/buildtools': -- Var('chromium_git') + '/chromium/src/buildtools' + '@' + '79ab87fa54614258c4c95891e873223371194525', -+ Var('chromium_git') + '/chromium/src/buildtools' + '@' + '3c8fef071edb88facb7508060e978c5fb8608dd5', - 'src/testing': -- Var('chromium_git') + '/chromium/src/testing' + '@' + '51e9a02297057cc0e917763a51e16680b7d16fb6', -+ Var('chromium_git') + '/chromium/src/testing' + '@' + 'b4dc828e84ae95e1f5bf855f040c065287dac335', - 'src/third_party': -- Var('chromium_git') + '/chromium/src/third_party' + '@' + '2dc4b18abd1003ce7b1eda509dc96f12d49a9667', -+ Var('chromium_git') + '/chromium/src/third_party' + '@' + '73f7282fa28ca1fbe8401e391207fb6ccf34767f', - - 'src/buildtools/linux64': { - 'packages': [ - { -- 'package': 'gn/gn/linux-${{arch}}', -+ 'package': 'gn/gn/linux-amd64', - 'version': Var('gn_version'), - } - ], - 'dep_type': 'cipd', -- 'condition': 'host_os == "linux"', -+ 'condition': 'checkout_linux', - }, -- - 'src/buildtools/mac': { - 'packages': [ - { -- 'package': 'gn/gn/mac-${{arch}}', -+ 'package': 'gn/gn/mac-amd64', - 'version': Var('gn_version'), - } - ], - 'dep_type': 'cipd', -- 'condition': 'host_os == "mac"', -+ 'condition': 'checkout_mac', - }, -- - 'src/buildtools/win': { - 'packages': [ - { -@@ -69,7 +67,7 @@ deps = { - } - ], - 'dep_type': 'cipd', -- 'condition': 'host_os == "win"', -+ 'condition': 'checkout_win', - }, - - 'src/buildtools/reclient': { -@@ -82,40 +80,33 @@ deps = { - 'dep_type': 'cipd', - }, - -+ 'src/buildtools/clang_format/script': -+ Var('chromium_git') + '/external/github.com/llvm/llvm-project/clang/tools/clang-format.git' + '@' + '8b525d2747f2584fc35d8c7e612e66f377858df7', -+ 'src/buildtools/third_party/libc++/trunk': -+ Var('chromium_git') + '/external/github.com/llvm/llvm-project/libcxx.git' + '@' + 'cd0a05047451dfbdef5ba85f97ac4888e432a377', -+ 'src/buildtools/third_party/libc++abi/trunk': -+ Var('chromium_git') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + '1a32724f721e1c3b6c590a07fe4a954344f15e48', -+ 'src/buildtools/third_party/libunwind/trunk': -+ Var('chromium_git') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + '5870472fdd17f33d923b02e3e0acb9cbb18dbc9a', -+ - 'src/third_party/catapult': -- Var('chromium_git') + '/catapult.git' + '@' + 'fa05d995e152efdae488a2aeba397cd609fdbc9d', -- 'src/third_party/clang-format/script': -- Var('chromium_git') + '/external/github.com/llvm/llvm-project/clang/tools/clang-format.git' + '@' + 'f97059df7f8b205064625cdb5f97b56668a125ef', -+ Var('chromium_git') + '/catapult.git' + '@' + '4efb51be8574f2969273012958eaae85d01ede0b', - 'src/third_party/colorama/src': -- Var('chromium_git') + '/external/colorama.git' + '@' + '3de9f013df4b470069d03d250224062e8cf15c49', -- 'src/third_party/cpu_features/src': { -- 'url': Var('chromium_git') + '/external/github.com/google/cpu_features.git' + '@' + '936b9ab5515dead115606559502e3864958f7f6e', -- 'condition': 'checkout_android', -- }, -+ Var('chromium_git') + '/external/colorama.git' + '@' + '799604a1041e9b3bc5d2789ecbd7e8db2e18e6b8', - 'src/third_party/depot_tools': -- Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'd3e43dd4319ba169c0aaf44547eecf861f2fe5da', -+ Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '2fc7e1ffd58b00601b47a5126201e5162911e244', - 'src/third_party/freetype/src': -- Var('chromium_git') + '/chromium/src/third_party/freetype2.git' + '@' + '9e3c5d7e183c1a8d5ed8868d7d28ef18d3ec9ec8', -- 'third_party/fuchsia-gn-sdk': { -- 'url': Var('chromium_git') + '/chromium/src/third_party/fuchsia-gn-sdk.git' + '@' + '0d6902558d92fe3d49ba9a8f638ddea829be595b', -- 'condition': 'checkout_fuchsia', -- }, -+ Var('chromium_git') + '/chromium/src/third_party/freetype2.git' + '@' + '1c44de209cb465d175279dc30cd95f9857f703dd', - 'src/third_party/googletest/src': - Var('chromium_git') + '/external/github.com/google/googletest.git' + '@' + 'af29db7ec28d6df1c7f0f745186884091e602e07', - 'src/third_party/harfbuzz-ng/src': -- Var('chromium_git') + '/external/github.com/harfbuzz/harfbuzz.git' + '@' + 'db700b5670d9475cc8ed4880cc9447b232c5e432', -- 'src/third_party/libc++/src': -- Var('chromium_git') + '/external/github.com/llvm/llvm-project/libcxx.git' + '@' + '84fb809dd6dae36d556dc0bb702c6cc2ce9d4b80', -- 'src/third_party/libc++abi/src': -- Var('chromium_git') + '/external/github.com/llvm/llvm-project/libcxxabi.git' + '@' + '8d21803b9076b16d46c32e2f10da191ee758520c', -- 'src/third_party/libunwind/src': -- Var('chromium_git') + '/external/github.com/llvm/llvm-project/libunwind.git' + '@' + 'f1c687e0aaf0d70b9a53a150e9be5cb63af9215f', -+ Var('chromium_git') + '/external/github.com/harfbuzz/harfbuzz.git' + '@' + '2822b589bc837fae6f66233e2cf2eef0f6ce8470', - 'src/third_party/libjpeg_turbo': -- Var('chromium_git') + '/chromium/deps/libjpeg_turbo.git' + '@' + '30bdb85e302ecfc52593636b2f44af438e05e784', -+ Var('chromium_git') + '/chromium/deps/libjpeg_turbo.git' + '@' + 'ed683925e4897a84b3bffc5c1414c85b97a129a3', - 'src/third_party/nasm': -- Var('chromium_git') + '/chromium/deps/nasm.git' + '@' + '7fc833e889d1afda72c06220e5bed8fb43b2e5ce', -+ Var('chromium_git') + '/chromium/deps/nasm.git' + '@' + '0873b2bae6a5388a1c55deac8456e3c60a47ca08', - 'src/tools': -- Var('chromium_git') + '/chromium/src/tools' + '@' + 'a76c0dbb64c603a0d45e0c6dfae3a351b6e1adf1', -+ Var('chromium_git') + '/chromium/src/tools' + '@' + 'a20d904d021175f221bf58921a5a67fd48420ed9', - - # libyuv-only dependencies (not present in Chromium). - 'src/third_party/gtest-parallel': -@@ -137,32 +128,10 @@ deps = { - 'condition': 'checkout_android', - 'dep_type': 'cipd', - }, -- -- 'src/third_party/kotlin_stdlib': { -- 'packages': [ -- { -- 'package': 'chromium/third_party/kotlin_stdlib', -- 'version': 'Z1gsqhL967kFQecxKrRwXHbl-vwQjpv0l7PMUZ0EVO8C', -- }, -- ], -- 'condition': 'checkout_android', -- 'dep_type': 'cipd', -- }, -- 'src/third_party/kotlinc/current': { -- 'packages': [ -- { -- 'package': 'chromium/third_party/kotlinc', -- 'version': 'Rr02Gf2EkaeSs3EhSUHhPqDHSd1AzimrM6cRYUJCPjQC', -- }, -- ], -- 'condition': 'checkout_android', -- 'dep_type': 'cipd', -- }, -- - 'src/third_party/boringssl/src': -- 'https://boringssl.googlesource.com/boringssl.git' + '@' + '20a06474c0b4a16779311bfe98ba69dc2402101d', -+ 'https://boringssl.googlesource.com/boringssl.git' + '@' + 'f0518d45119dd4dd322a884669daf8247bc3c992', - 'src/base': { -- 'url': Var('chromium_git') + '/chromium/src/base' + '@' + 'd407b7061bce341bb6e11b539ea86c46c949ac4c', -+ 'url': Var('chromium_git') + '/chromium/src/base' + '@' + 'f80120ff3265ba9bcb27416cc489343cfdc8bc61', - 'condition': 'checkout_android', - }, - 'src/third_party/bazel': { -@@ -185,28 +154,20 @@ deps = { - 'condition': 'checkout_android', - 'dep_type': 'cipd', - }, -- 'src/third_party/android_toolchain': { -- 'packages': [ -- { -- 'package': 'chromium/third_party/android_toolchain/android_toolchain', -- 'version': 'R_8suM8m0oHbZ1awdxGXvKEFpAOETscbfZxkkMthyk8C', -- }, -- ], -- 'condition': 'checkout_android', -- 'dep_type': 'cipd', -+ 'src/third_party/android_ndk': { -+ 'url': Var('chromium_git') + '/android_ndk.git' + '@' + '8388a2be5421311dc75c5f937aae13d821a27f3d', -+ 'condition': 'checkout_android', - }, -- - 'src/third_party/androidx': { - 'packages': [ - { - 'package': 'chromium/third_party/androidx', -- 'version': 'y7rF_rx56mD3FGhMiqnlbQ6HOqHJ95xUFNX1m-_a988C', -+ 'version': 'DRqe-W5-XlO2ZySLCwsYKy7iqIaQ77O-Y91txXGY_hMC', - }, - ], - 'condition': 'checkout_android', - 'dep_type': 'cipd', - }, -- - 'src/third_party/android_support_test_runner': { - 'packages': [ - { -@@ -220,8 +181,8 @@ deps = { - 'src/third_party/android_sdk/public': { - 'packages': [ - { -- 'package': 'chromium/third_party/android_sdk/public/build-tools/34.0.0', -- 'version': 'YK9Rzw3fDzMHVzatNN6VlyoD_81amLZpN1AbmkdOd6AC', -+ 'package': 'chromium/third_party/android_sdk/public/build-tools/33.0.0', -+ 'version': '-VRKr36Uw8L_iFqqo9nevIBgNMggND5iWxjidyjnCgsC', - }, - { - 'package': 'chromium/third_party/android_sdk/public/emulator', -@@ -233,15 +194,11 @@ deps = { - }, - { - 'package': 'chromium/third_party/android_sdk/public/platform-tools', -- 'version': 'HWVsGs2HCKgSVv41FsOcsfJbNcB0UFiNrF6Tc4yRArYC', -+ 'version': 'RSI3iwryh7URLGRgJHsCvUxj092woTPnKt4pwFcJ6L8C', - }, - { -- 'package': 'chromium/third_party/android_sdk/public/platforms/android-34', -- 'version': 'u-bhWbTME6u-DjypTgr3ZikCyeAeU6txkR9ET6Uudc8C', -- }, -- { -- 'package': 'chromium/third_party/android_sdk/public/platforms/android-tiramisuprivacysandbox', -- 'version': 'YWMYkzyxGBgVsty0GhXL1oxbY0pGXQIgFc0Rh7ZMRPYC', -+ 'package': 'chromium/third_party/android_sdk/public/platforms/android-33', -+ 'version': 'eo5KvW6UVor92LwZai8Zulc624BQZoCu-yn7wa1z_YcC', - }, - { - 'package': 'chromium/third_party/android_sdk/public/sources/android-31', -@@ -249,7 +206,7 @@ deps = { - }, - { - 'package': 'chromium/third_party/android_sdk/public/cmdline-tools', -- 'version': 'EWnL2r7oV5GtE9Ef7GyohyFam42wtMtEKYU4dCb3U1YC', -+ 'version': 'IPzAG-uU5zVMxohpg9-7-N0tQC1TCSW1VbrBFw7Ld04C', - }, - ], - 'condition': 'checkout_android', -@@ -269,7 +226,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_build_tools/aapt2', -- 'version': 'STY0BXlZxsEhudnlXQFed-B5UpwehcoM0sYqor6qRqsC', -+ 'version': 'version:3.6.0-alpha03-5516695-cr0', - }, - ], - 'condition': 'checkout_android', -@@ -339,7 +296,7 @@ deps = { - }, - - 'src/third_party/icu': { -- 'url': Var('chromium_git') + '/chromium/deps/icu.git' + '@' + 'e8c3bc9ea97d4423ad0515e5f1c064f486dae8b1', -+ 'url': Var('chromium_git') + '/chromium/deps/icu.git' + '@' + '1b7d391f0528fb3a4976b7541b387ee04f915f83', - }, - 'src/third_party/icu4j': { - 'packages': [ -@@ -365,7 +322,11 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/jdk', -- 'version': 'GCFtf5t6M4HlrHj6NXedHbpHp2xjgognF8ptNci4478C', -+ 'version': 'PfRSnxe8Od6WU4zBXomq-zsgcJgWmm3z4gMQNB-r2QcC', -+ }, -+ { -+ 'package': 'chromium/third_party/jdk/extras', -+ 'version': 'fkhuOQ3r-zKtWEdKplpo6k0vKkjl-LY_rJTmtzFCQN4C', - }, - ], - 'condition': 'checkout_android', -@@ -393,14 +354,14 @@ deps = { - 'dep_type': 'cipd', - }, - 'src/third_party/mockito/src': { -- 'url': Var('chromium_git') + '/external/mockito/mockito.git' + '@' + '7c3641bcef717ffa7d765f2c86b847d0aab1aac9', -+ 'url': Var('chromium_git') + '/external/mockito/mockito.git' + '@' + '04a2a289a4222f80ad20717c25144981210d2eac', - 'condition': 'checkout_android', - }, - 'src/third_party/objenesis': { - 'packages': [ - { - 'package': 'chromium/third_party/objenesis', -- 'version': 'tknDblENYi8IaJYyD6tUahUyHYZlzJ_Y74_QZSz4DpIC', -+ 'version': '9e367f55e5a65781ee77bfcbaa88fb82b30e75c0', - }, - ], - 'condition': 'checkout_android', -@@ -420,7 +381,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/r8', -- 'version': 'O1BBWiBTIeNUcraX8STMtQXVaCleu6SJJjWCcnfhPLkC', -+ 'version': 'szXK3tCGU7smsNs4r2mGqxme7d9KWLaOk0_ghbCJxUQC', - }, - ], - 'condition': 'checkout_android', -@@ -433,7 +394,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/r8', -- 'version': 'vw5kLlW3-suSlCKSO9OQpFWpR8oDnvQ8k1RgKNUapQYC', -+ 'version': 'Qn31g4m2cofkyvGgm46Uzkzds5DKdNYrdPePwRkVnv4C', - }, - ], - 'condition': 'checkout_android', -@@ -450,14 +411,14 @@ deps = { - 'dep_type': 'cipd', - }, - 'src/third_party/requests/src': { -- 'url': Var('chromium_git') + '/external/github.com/kennethreitz/requests.git' + '@' + 'c7e0fc087ceeadb8b4c84a0953a422c474093d6d', -+ 'url': Var('chromium_git') + '/external/github.com/kennethreitz/requests.git' + '@' + 'refs/tags/v2.23.0', - 'condition': 'checkout_android', - }, - 'src/third_party/robolectric': { - 'packages': [ - { - 'package': 'chromium/third_party/robolectric', -- 'version': 'hzetqh1qFI32FOgQroZvGcGdomrgVBJ6WKRnl1KFw6EC', -+ 'version': 'iC6RDM5EH3GEAzR-1shW_Mg0FeeNE5shq1okkFfuuNQC', - }, - ], - 'condition': 'checkout_android', -@@ -467,7 +428,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/sqlite4java', -- 'version': 'LofjKH9dgXIAJhRYCPQlMFywSwxYimrfDeBmaHc-Z5EC', -+ 'version': '889660698187baa7c8b0d79f7bf58563125fbd66', - }, - ], - 'condition': 'checkout_android', -@@ -477,7 +438,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/turbine', -- 'version': '2I2Nz480QsuCxpQ1lMfbigX8l5HAhX3_ykWU4TKRGo4C', -+ 'version': 'Om6yIEXgJxuqghErK29h9RcMH6VaymMbxwScwXmcN6EC', - }, - ], - 'condition': 'checkout_android', -@@ -490,7 +451,7 @@ deps = { - - # iOS deps: - 'src/ios': { -- 'url': Var('chromium_git') + '/chromium/src/ios' + '@' + 'ddd58e86cf4ebdc0db60a5d0f3c323de49bb295c', -+ 'url': Var('chromium_git') + '/chromium/src/ios' + '@' + '866ec86ecb27dad8a3ac7957590df7765a13834f', - 'condition': 'checkout_ios' - }, - -@@ -926,6 +887,28 @@ deps = { - 'dep_type': 'cipd', - }, - -+ 'src/third_party/android_deps/libs/com_android_tools_desugar_jdk_libs': { -+ 'packages': [ -+ { -+ 'package': 'chromium/third_party/android_deps/libs/com_android_tools_desugar_jdk_libs', -+ 'version': 'version:2@1.1.5.cr1', -+ }, -+ ], -+ 'condition': 'checkout_android', -+ 'dep_type': 'cipd', -+ }, -+ -+ 'src/third_party/android_deps/libs/com_android_tools_desugar_jdk_libs_configuration': { -+ 'packages': [ -+ { -+ 'package': 'chromium/third_party/android_deps/libs/com_android_tools_desugar_jdk_libs_configuration', -+ 'version': 'version:2@1.1.5.cr1', -+ }, -+ ], -+ 'condition': 'checkout_android', -+ 'dep_type': 'cipd', -+ }, -+ - 'src/third_party/android_deps/libs/com_android_tools_layoutlib_layoutlib_api': { - 'packages': [ - { -@@ -970,17 +953,6 @@ deps = { - 'dep_type': 'cipd', - }, - -- 'src/third_party/android_deps/libs/com_google_android_annotations': { -- 'packages': [ -- { -- 'package': 'chromium/third_party/android_deps/libs/com_google_android_annotations', -- 'version': 'version:2@4.1.1.4.cr1', -- }, -- ], -- 'condition': 'checkout_android', -- 'dep_type': 'cipd', -- }, -- - 'src/third_party/android_deps/libs/com_google_android_apps_common_testing_accessibility_framework_accessibility_test_framework': { - 'packages': [ - { -@@ -1051,7 +1023,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_basement', -- 'version': 'version:2@18.1.0.cr1', -+ 'version': 'version:2@18.0.1.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -1102,6 +1074,17 @@ deps = { - 'dep_type': 'cipd', - }, - -+ 'src/third_party/android_deps/libs/com_google_android_gms_play_services_fido': { -+ 'packages': [ -+ { -+ 'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_fido', -+ 'version': 'version:2@19.0.0-beta.cr1', -+ }, -+ ], -+ 'condition': 'checkout_android', -+ 'dep_type': 'cipd', -+ }, -+ - 'src/third_party/android_deps/libs/com_google_android_gms_play_services_flags': { - 'packages': [ - { -@@ -1194,7 +1177,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/com_google_android_gms_play_services_tasks', -- 'version': 'version:2@18.0.2.cr1', -+ 'version': 'version:2@18.0.1.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -1234,22 +1217,11 @@ deps = { - 'dep_type': 'cipd', - }, - -- 'src/third_party/android_deps/libs/com_google_android_play_core_common': { -+ 'src/third_party/android_deps/libs/com_google_android_play_core': { - 'packages': [ - { -- 'package': 'chromium/third_party/android_deps/libs/com_google_android_play_core_common', -- 'version': 'version:2@2.0.2.cr1', -- }, -- ], -- 'condition': 'checkout_android', -- 'dep_type': 'cipd', -- }, -- -- 'src/third_party/android_deps/libs/com_google_android_play_feature_delivery': { -- 'packages': [ -- { -- 'package': 'chromium/third_party/android_deps/libs/com_google_android_play_feature_delivery', -- 'version': 'version:2@2.0.1.cr1', -+ 'package': 'chromium/third_party/android_deps/libs/com_google_android_play_core', -+ 'version': 'version:2@1.10.0.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -1293,7 +1265,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/com_google_auto_value_auto_value_annotations', -- 'version': 'version:2@1.10.1.cr1', -+ 'version': 'version:2@1.9.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -1315,7 +1287,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/com_google_code_gson_gson', -- 'version': 'version:2@2.9.0.cr1', -+ 'version': 'version:2@2.8.0.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -1381,7 +1353,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/com_google_errorprone_error_prone_annotations', -- 'version': 'version:2@2.18.0.cr1', -+ 'version': 'version:2@2.14.0.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -1564,6 +1536,17 @@ deps = { - 'dep_type': 'cipd', - }, - -+ 'src/third_party/android_deps/libs/com_google_flatbuffers_flatbuffers_java': { -+ 'packages': [ -+ { -+ 'package': 'chromium/third_party/android_deps/libs/com_google_flatbuffers_flatbuffers_java', -+ 'version': 'version:2@2.0.3.cr1', -+ }, -+ ], -+ 'condition': 'checkout_android', -+ 'dep_type': 'cipd', -+ }, -+ - 'src/third_party/android_deps/libs/com_google_googlejavaformat_google_java_format': { - 'packages': [ - { -@@ -1590,7 +1573,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/com_google_guava_guava', -- 'version': 'version:2@31.1-jre.cr1', -+ 'version': 'version:2@31.0.1-jre.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -1601,7 +1584,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/com_google_guava_guava_android', -- 'version': 'version:2@31.1-android.cr1', -+ 'version': 'version:2@31.0-android.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -1645,7 +1628,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/com_google_protobuf_protobuf_javalite', -- 'version': 'version:2@3.21.1.cr1', -+ 'version': 'version:2@3.19.3.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -1685,28 +1668,6 @@ deps = { - 'dep_type': 'cipd', - }, - -- 'src/third_party/android_deps/libs/com_squareup_okio_okio_jvm': { -- 'packages': [ -- { -- 'package': 'chromium/third_party/android_deps/libs/com_squareup_okio_okio_jvm', -- 'version': 'version:2@3.3.0.cr1', -- }, -- ], -- 'condition': 'checkout_android', -- 'dep_type': 'cipd', -- }, -- -- 'src/third_party/android_deps/libs/com_squareup_wire_wire_runtime_jvm': { -- 'packages': [ -- { -- 'package': 'chromium/third_party/android_deps/libs/com_squareup_wire_wire_runtime_jvm', -- 'version': 'version:2@4.7.0.cr1', -- }, -- ], -- 'condition': 'checkout_android', -- 'dep_type': 'cipd', -- }, -- - 'src/third_party/android_deps/libs/io_github_java_diff_utils_java_diff_utils': { - 'packages': [ - { -@@ -1718,83 +1679,6 @@ deps = { - 'dep_type': 'cipd', - }, - -- 'src/third_party/android_deps/libs/io_grpc_grpc_api': { -- 'packages': [ -- { -- 'package': 'chromium/third_party/android_deps/libs/io_grpc_grpc_api', -- 'version': 'version:2@1.49.0.cr1', -- }, -- ], -- 'condition': 'checkout_android', -- 'dep_type': 'cipd', -- }, -- -- 'src/third_party/android_deps/libs/io_grpc_grpc_binder': { -- 'packages': [ -- { -- 'package': 'chromium/third_party/android_deps/libs/io_grpc_grpc_binder', -- 'version': 'version:2@1.49.0.cr1', -- }, -- ], -- 'condition': 'checkout_android', -- 'dep_type': 'cipd', -- }, -- -- 'src/third_party/android_deps/libs/io_grpc_grpc_context': { -- 'packages': [ -- { -- 'package': 'chromium/third_party/android_deps/libs/io_grpc_grpc_context', -- 'version': 'version:2@1.49.0.cr1', -- }, -- ], -- 'condition': 'checkout_android', -- 'dep_type': 'cipd', -- }, -- -- 'src/third_party/android_deps/libs/io_grpc_grpc_core': { -- 'packages': [ -- { -- 'package': 'chromium/third_party/android_deps/libs/io_grpc_grpc_core', -- 'version': 'version:2@1.49.0.cr1', -- }, -- ], -- 'condition': 'checkout_android', -- 'dep_type': 'cipd', -- }, -- -- 'src/third_party/android_deps/libs/io_grpc_grpc_protobuf_lite': { -- 'packages': [ -- { -- 'package': 'chromium/third_party/android_deps/libs/io_grpc_grpc_protobuf_lite', -- 'version': 'version:2@1.49.0.cr1', -- }, -- ], -- 'condition': 'checkout_android', -- 'dep_type': 'cipd', -- }, -- -- 'src/third_party/android_deps/libs/io_grpc_grpc_stub': { -- 'packages': [ -- { -- 'package': 'chromium/third_party/android_deps/libs/io_grpc_grpc_stub', -- 'version': 'version:2@1.49.0.cr1', -- }, -- ], -- 'condition': 'checkout_android', -- 'dep_type': 'cipd', -- }, -- -- 'src/third_party/android_deps/libs/io_perfmark_perfmark_api': { -- 'packages': [ -- { -- 'package': 'chromium/third_party/android_deps/libs/io_perfmark_perfmark_api', -- 'version': 'version:2@0.25.0.cr1', -- }, -- ], -- 'condition': 'checkout_android', -- 'dep_type': 'cipd', -- }, -- - 'src/third_party/android_deps/libs/javax_annotation_javax_annotation_api': { - 'packages': [ - { -@@ -1832,7 +1716,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/net_bytebuddy_byte_buddy', -- 'version': 'version:2@1.14.5.cr1', -+ 'version': 'version:2@1.12.13.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -1843,7 +1727,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/net_bytebuddy_byte_buddy_agent', -- 'version': 'version:2@1.14.5.cr1', -+ 'version': 'version:2@1.12.13.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -1861,11 +1745,22 @@ deps = { - 'dep_type': 'cipd', - }, - -- 'src/third_party/android_deps/libs/org_bouncycastle_bcprov_jdk18on': { -+ 'src/third_party/android_deps/libs/net_sf_kxml_kxml2': { - 'packages': [ - { -- 'package': 'chromium/third_party/android_deps/libs/org_bouncycastle_bcprov_jdk18on', -- 'version': 'version:2@1.72.cr1', -+ 'package': 'chromium/third_party/android_deps/libs/net_sf_kxml_kxml2', -+ 'version': 'version:2@2.3.0.cr1', -+ }, -+ ], -+ 'condition': 'checkout_android', -+ 'dep_type': 'cipd', -+ }, -+ -+ 'src/third_party/android_deps/libs/org_bouncycastle_bcprov_jdk15on': { -+ 'packages': [ -+ { -+ 'package': 'chromium/third_party/android_deps/libs/org_bouncycastle_bcprov_jdk15on', -+ 'version': 'version:2@1.68.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -1905,17 +1800,6 @@ deps = { - 'dep_type': 'cipd', - }, - -- 'src/third_party/android_deps/libs/org_checkerframework_checker_util': { -- 'packages': [ -- { -- 'package': 'chromium/third_party/android_deps/libs/org_checkerframework_checker_util', -- 'version': 'version:2@3.25.0.cr1', -- }, -- ], -- 'condition': 'checkout_android', -- 'dep_type': 'cipd', -- }, -- - 'src/third_party/android_deps/libs/org_checkerframework_dataflow_errorprone': { - 'packages': [ - { -@@ -1931,18 +1815,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_codehaus_mojo_animal_sniffer_annotations', -- 'version': 'version:2@1.21.cr1', -- }, -- ], -- 'condition': 'checkout_android', -- 'dep_type': 'cipd', -- }, -- -- 'src/third_party/android_deps/libs/org_conscrypt_conscrypt_openjdk_uber': { -- 'packages': [ -- { -- 'package': 'chromium/third_party/android_deps/libs/org_conscrypt_conscrypt_openjdk_uber', -- 'version': 'version:2@2.5.2.cr1', -+ 'version': 'version:2@1.17.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -1971,11 +1844,44 @@ deps = { - 'dep_type': 'cipd', - }, - -+ 'src/third_party/android_deps/libs/org_jetbrains_annotations': { -+ 'packages': [ -+ { -+ 'package': 'chromium/third_party/android_deps/libs/org_jetbrains_annotations', -+ 'version': 'version:2@13.0.cr1', -+ }, -+ ], -+ 'condition': 'checkout_android', -+ 'dep_type': 'cipd', -+ }, -+ -+ 'src/third_party/android_deps/libs/org_jetbrains_kotlin_kotlin_stdlib': { -+ 'packages': [ -+ { -+ 'package': 'chromium/third_party/android_deps/libs/org_jetbrains_kotlin_kotlin_stdlib', -+ 'version': 'version:2@1.7.10.cr1', -+ }, -+ ], -+ 'condition': 'checkout_android', -+ 'dep_type': 'cipd', -+ }, -+ -+ 'src/third_party/android_deps/libs/org_jetbrains_kotlin_kotlin_stdlib_common': { -+ 'packages': [ -+ { -+ 'package': 'chromium/third_party/android_deps/libs/org_jetbrains_kotlin_kotlin_stdlib_common', -+ 'version': 'version:2@1.7.10.cr1', -+ }, -+ ], -+ 'condition': 'checkout_android', -+ 'dep_type': 'cipd', -+ }, -+ - 'src/third_party/android_deps/libs/org_jetbrains_kotlin_kotlin_stdlib_jdk7': { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_jetbrains_kotlin_kotlin_stdlib_jdk7', -- 'version': 'version:2@1.8.20.cr1', -+ 'version': 'version:2@1.6.20.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -1986,7 +1892,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_jetbrains_kotlin_kotlin_stdlib_jdk8', -- 'version': 'version:2@1.8.20.cr1', -+ 'version': 'version:2@1.6.20.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -1997,7 +1903,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_jetbrains_kotlinx_kotlinx_coroutines_android', -- 'version': 'version:2@1.6.4.cr1', -+ 'version': 'version:2@1.6.1.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2008,18 +1914,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_jetbrains_kotlinx_kotlinx_coroutines_core_jvm', -- 'version': 'version:2@1.6.4.cr1', -- }, -- ], -- 'condition': 'checkout_android', -- 'dep_type': 'cipd', -- }, -- -- 'src/third_party/android_deps/libs/org_jetbrains_kotlinx_kotlinx_coroutines_guava': { -- 'packages': [ -- { -- 'package': 'chromium/third_party/android_deps/libs/org_jetbrains_kotlinx_kotlinx_coroutines_guava', -- 'version': 'version:2@1.6.4.cr1', -+ 'version': 'version:2@1.6.1.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2048,33 +1943,11 @@ deps = { - 'dep_type': 'cipd', - }, - -- 'src/third_party/android_deps/libs/org_mockito_mockito_android': { -- 'packages': [ -- { -- 'package': 'chromium/third_party/android_deps/libs/org_mockito_mockito_android', -- 'version': 'version:2@5.4.0.cr1', -- }, -- ], -- 'condition': 'checkout_android', -- 'dep_type': 'cipd', -- }, -- - 'src/third_party/android_deps/libs/org_mockito_mockito_core': { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_mockito_mockito_core', -- 'version': 'version:2@5.4.0.cr1', -- }, -- ], -- 'condition': 'checkout_android', -- 'dep_type': 'cipd', -- }, -- -- 'src/third_party/android_deps/libs/org_mockito_mockito_subclass': { -- 'packages': [ -- { -- 'package': 'chromium/third_party/android_deps/libs/org_mockito_mockito_subclass', -- 'version': 'version:2@5.4.0.cr1', -+ 'version': 'version:2@4.7.0.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2085,7 +1958,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_objenesis_objenesis', -- 'version': 'version:2@3.3.cr1', -+ 'version': 'version:2@3.2.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2096,7 +1969,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_ow2_asm_asm', -- 'version': 'version:2@9.5.cr1', -+ 'version': 'version:2@9.2.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2107,7 +1980,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_ow2_asm_asm_analysis', -- 'version': 'version:2@9.5.cr1', -+ 'version': 'version:2@9.2.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2118,7 +1991,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_ow2_asm_asm_commons', -- 'version': 'version:2@9.5.cr1', -+ 'version': 'version:2@9.2.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2129,7 +2002,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_ow2_asm_asm_tree', -- 'version': 'version:2@9.5.cr1', -+ 'version': 'version:2@9.2.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2140,7 +2013,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_ow2_asm_asm_util', -- 'version': 'version:2@9.5.cr1', -+ 'version': 'version:2@9.2.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2162,7 +2035,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_robolectric_annotations', -- 'version': 'version:2@4.10.3.cr1', -+ 'version': 'version:2@4.8.1.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2173,7 +2046,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_robolectric_junit', -- 'version': 'version:2@4.10.3.cr1', -+ 'version': 'version:2@4.8.1.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2184,18 +2057,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_robolectric_nativeruntime', -- 'version': 'version:2@4.10.3.cr1', -- }, -- ], -- 'condition': 'checkout_android', -- 'dep_type': 'cipd', -- }, -- -- 'src/third_party/android_deps/libs/org_robolectric_nativeruntime_dist_compat': { -- 'packages': [ -- { -- 'package': 'chromium/third_party/android_deps/libs/org_robolectric_nativeruntime_dist_compat', -- 'version': 'version:2@1.0.1.cr1', -+ 'version': 'version:2@4.8.1.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2206,7 +2068,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_robolectric_pluginapi', -- 'version': 'version:2@4.10.3.cr1', -+ 'version': 'version:2@4.8.1.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2217,7 +2079,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_robolectric_plugins_maven_dependency_resolver', -- 'version': 'version:2@4.10.3.cr1', -+ 'version': 'version:2@4.8.1.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2228,7 +2090,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_robolectric_resources', -- 'version': 'version:2@4.10.3.cr1', -+ 'version': 'version:2@4.8.1.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2239,7 +2101,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_robolectric_robolectric', -- 'version': 'version:2@4.10.3.cr1', -+ 'version': 'version:2@4.8.1.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2250,7 +2112,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_robolectric_sandbox', -- 'version': 'version:2@4.10.3.cr1', -+ 'version': 'version:2@4.8.1.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2261,7 +2123,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_robolectric_shadowapi', -- 'version': 'version:2@4.10.3.cr1', -+ 'version': 'version:2@4.8.1.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2272,7 +2134,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_robolectric_shadows_framework', -- 'version': 'version:2@4.10.3.cr1', -+ 'version': 'version:2@4.8.1.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2283,7 +2145,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_robolectric_shadows_playservices', -- 'version': 'version:2@4.10.3.cr1', -+ 'version': 'version:2@4.8.1.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2294,7 +2156,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_robolectric_utils', -- 'version': 'version:2@4.10.3.cr1', -+ 'version': 'version:2@4.8.1.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2305,7 +2167,7 @@ deps = { - 'packages': [ - { - 'package': 'chromium/third_party/android_deps/libs/org_robolectric_utils_reflector', -- 'version': 'version:2@4.10.3.cr1', -+ 'version': 'version:2@4.8.1.cr1', - }, - ], - 'condition': 'checkout_android', -@@ -2315,6 +2177,16 @@ deps = { - # === ANDROID_DEPS Generated Code End === - } - -+pre_deps_hooks = [ -+ { -+ # Remove any symlinks from before 177567c518b121731e507e9b9c4049c4dc96e4c8. -+ # TODO(kjellander): Remove this in March 2017. -+ 'name': 'cleanup_links', -+ 'pattern': '.', -+ 'action': ['python3', 'src/cleanup_links.py'], -+ }, -+] -+ - hooks = [ - { - # This clobbers when necessary (based on get_landmines.py). It should be -@@ -2405,7 +2277,7 @@ hooks = [ - ], - }, - { -- 'name': 'msan_chained_origins_focal', -+ 'name': 'msan_chained_origins_xenial', - 'pattern': '.', - 'condition': 'checkout_instrumented_libraries', - 'action': [ 'python3', -@@ -2413,11 +2285,11 @@ hooks = [ - '--no_resume', - '--no_auth', - '--bucket', 'chromium-instrumented-libraries', -- '-s', 'src/third_party/instrumented_libraries/binaries/msan-chained-origins-focal.tgz.sha1', -+ '-s', 'src/third_party/instrumented_libraries/binaries/msan-chained-origins-xenial.tgz.sha1', - ], - }, - { -- 'name': 'msan_no_origins_focal', -+ 'name': 'msan_no_origins_xenial', - 'pattern': '.', - 'condition': 'checkout_instrumented_libraries', - 'action': [ 'python3', -@@ -2425,7 +2297,7 @@ hooks = [ - '--no_resume', - '--no_auth', - '--bucket', 'chromium-instrumented-libraries', -- '-s', 'src/third_party/instrumented_libraries/binaries/msan-no-origins-focal.tgz.sha1', -+ '-s', 'src/third_party/instrumented_libraries/binaries/msan-no-origins-xenial.tgz.sha1', - ], - }, - { -diff --git a/media/libyuv/libyuv/README.chromium b/media/libyuv/libyuv/README.chromium ---- a/media/libyuv/libyuv/README.chromium -+++ b/media/libyuv/libyuv/README.chromium -@@ -1,9 +1,8 @@ - Name: libyuv --URL: https://chromium.googlesource.com/libyuv/libyuv/ --Version: 1889 -+URL: http://code.google.com/p/libyuv/ -+Version: 1860 - License: BSD - License File: LICENSE --Shipped: yes - - Description: - libyuv is an open source project that includes YUV conversion and scaling functionality. -diff --git a/media/libyuv/libyuv/README.md b/media/libyuv/libyuv/README.md ---- a/media/libyuv/libyuv/README.md -+++ b/media/libyuv/libyuv/README.md -@@ -7,7 +7,6 @@ - * Optimized for SSSE3/AVX2 on x86/x64. - * Optimized for Neon on Arm. - * Optimized for MSA on Mips. --* Optimized for RVV on RISC-V. - - ### Development - -diff --git a/media/libyuv/libyuv/build_overrides/build.gni b/media/libyuv/libyuv/build_overrides/build.gni ---- a/media/libyuv/libyuv/build_overrides/build.gni -+++ b/media/libyuv/libyuv/build_overrides/build.gni -@@ -13,9 +13,6 @@ build_with_chromium = false - # Some non-Chromium builds don't support building java targets. - enable_java_templates = true - --# Enables assertions on safety checks in libc++. --enable_safe_libcxx = true -- - # Allow using custom suppressions files (currently not used by libyuv). - asan_suppressions_file = "//build/sanitizers/asan_suppressions.cc" - lsan_suppressions_file = "//build/sanitizers/lsan_suppressions.cc" -diff --git a/media/libyuv/libyuv/docs/deprecated_builds.md b/media/libyuv/libyuv/docs/deprecated_builds.md ---- a/media/libyuv/libyuv/docs/deprecated_builds.md -+++ b/media/libyuv/libyuv/docs/deprecated_builds.md -@@ -165,11 +165,11 @@ mipsel - - arm32 disassembly: - -- llvm-objdump -d out/Release/obj/source/libyuv.row_neon.o -+ third_party/android_ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-objdump -d out/Release/obj/source/libyuv.row_neon.o - - arm64 disassembly: - -- llvm-objdump -d out/Release/obj/source/libyuv.row_neon64.o -+ third_party/android_ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-objdump -d out/Release/obj/source/libyuv.row_neon64.o - - Running tests: - -diff --git a/media/libyuv/libyuv/docs/environment_variables.md b/media/libyuv/libyuv/docs/environment_variables.md ---- a/media/libyuv/libyuv/docs/environment_variables.md -+++ b/media/libyuv/libyuv/docs/environment_variables.md -@@ -26,10 +26,8 @@ By default the cpu is detected and the m - LIBYUV_DISABLE_AVX512VBMI - LIBYUV_DISABLE_AVX512VBMI2 - LIBYUV_DISABLE_AVX512VBITALG -- LIBYUV_DISABLE_AVX10 -- LIBYUV_DISABLE_AVXVNNI -- LIBYUV_DISABLE_AVXVNNIINT8 -- LIBYUV_DISABLE_AMXINT8 -+ LIBYUV_DISABLE_AVX512VPOPCNTDQ -+ LIBYUV_DISABLE_GFNI - - ## ARM CPUs - -@@ -42,9 +40,6 @@ By default the cpu is detected and the m - LIBYUV_DISABLE_LSX - LIBYUV_DISABLE_LASX - --## RISCV CPUs -- LIBYUV_DISABLE_RVV -- - # Test Width/Height/Repeat - - The unittests default to a small image (128x72) to run fast. This can be set by environment variable to test a specific resolutions. -diff --git a/media/libyuv/libyuv/docs/getting_started.md b/media/libyuv/libyuv/docs/getting_started.md ---- a/media/libyuv/libyuv/docs/getting_started.md -+++ b/media/libyuv/libyuv/docs/getting_started.md -@@ -139,11 +139,11 @@ mips - - arm disassembly: - -- llvm-objdump -d ./out/Release/obj/libyuv/row_common.o >row_common.txt -+ third_party/android_ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-objdump -d ./out/Release/obj/libyuv/row_common.o >row_common.txt - -- llvm-objdump -d ./out/Release/obj/libyuv_neon/row_neon.o >row_neon.txt -+ third_party/android_ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-objdump -d ./out/Release/obj/libyuv_neon/row_neon.o >row_neon.txt - -- llvm-objdump -d ./out/Release/obj/libyuv_neon/row_neon64.o >row_neon64.txt -+ third_party/android_ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-objdump -d ./out/Release/obj/libyuv_neon/row_neon64.o >row_neon64.txt - - Caveat: Disassembly may require optimize_max be disabled in BUILD.gn - -@@ -220,47 +220,6 @@ Install cmake: http://www.cmake.org/ - make -j4 - make package - --## Building RISC-V target with cmake -- --### Prerequisite: build risc-v clang toolchain and qemu -- --If you don't have prebuilt clang and riscv64 qemu, run the script to download source and build them. -- -- ./riscv_script/prepare_toolchain_qemu.sh -- --After running script, clang & qemu are built in `build-toolchain-qemu/riscv-clang/` & `build-toolchain-qemu/riscv-qemu/`. -- --### Cross-compile for RISC-V target -- cmake -B out/Release/ -DUNIT_TEST=ON \ -- -DCMAKE_BUILD_TYPE=Release \ -- -DCMAKE_TOOLCHAIN_FILE="./riscv_script/riscv-clang.cmake" \ -- -DTOOLCHAIN_PATH={TOOLCHAIN_PATH} \ -- -DUSE_RVV=ON . -- cmake --build out/Release/ -- --#### Customized Compiler Flags -- --Customized compiler flags are supported by `-DRISCV_COMPILER_FLAGS="xxx"`. --If `-DRISCV_COMPILER_FLAGS="xxx"` is manually assigned, other compile flags(e.g disable -march=xxx) will not be appended. -- --Example: -- -- cmake -B out/Release/ -DUNIT_TEST=ON \ -- -DCMAKE_BUILD_TYPE=Release \ -- -DCMAKE_TOOLCHAIN_FILE="./riscv_script/riscv-clang.cmake" \ -- -DRISCV_COMPILER_FLAGS="-mcpu=sifive-x280" \ -- . -- --### Run on QEMU -- --#### Run libyuv_unittest on QEMU -- cd out/Release/ -- USE_RVV=ON \ -- TOOLCHAIN_PATH={TOOLCHAIN_PATH} \ -- QEMU_PREFIX_PATH={QEMU_PREFIX_PATH} \ -- ../../riscv_script/run_qemu.sh libyuv_unittest -- -- - ## Setup for Arm Cross compile - - See also https://www.ccoderun.ca/programming/2015-12-20_CrossCompiling/index.html -diff --git a/media/libyuv/libyuv/include/libyuv/compare_row.h b/media/libyuv/libyuv/include/libyuv/compare_row.h ---- a/media/libyuv/libyuv/include/libyuv/compare_row.h -+++ b/media/libyuv/libyuv/include/libyuv/compare_row.h -@@ -28,10 +28,7 @@ extern "C" { - #endif - // MemorySanitizer does not support assembly code yet. http://crbug.com/344505 - #if defined(__has_feature) --#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_NEON) --#define LIBYUV_DISABLE_NEON --#endif --#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_X86) -+#if __has_feature(memory_sanitizer) - #define LIBYUV_DISABLE_X86 - #endif - #endif -@@ -78,16 +75,8 @@ extern "C" { - // The following are available for Neon: - #if !defined(LIBYUV_DISABLE_NEON) && \ - (defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__)) -+#define HAS_SUMSQUAREERROR_NEON - #define HAS_HAMMINGDISTANCE_NEON --#define HAS_SUMSQUAREERROR_NEON --#endif -- --// The following are available for AArch64 Neon: --#if !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__) --#define HAS_HASHDJB2_NEON -- --#define HAS_HAMMINGDISTANCE_NEON_DOTPROD --#define HAS_SUMSQUAREERROR_NEON_DOTPROD - #endif - - #if !defined(LIBYUV_DISABLE_MSA) && defined(__mips_msa) -@@ -110,9 +99,6 @@ uint32_t HammingDistance_AVX2(const uint - uint32_t HammingDistance_NEON(const uint8_t* src_a, - const uint8_t* src_b, - int count); --uint32_t HammingDistance_NEON_DotProd(const uint8_t* src_a, -- const uint8_t* src_b, -- int count); - uint32_t HammingDistance_MSA(const uint8_t* src_a, - const uint8_t* src_b, - int count); -@@ -128,9 +114,6 @@ uint32_t SumSquareError_AVX2(const uint8 - uint32_t SumSquareError_NEON(const uint8_t* src_a, - const uint8_t* src_b, - int count); --uint32_t SumSquareError_NEON_DotProd(const uint8_t* src_a, -- const uint8_t* src_b, -- int count); - uint32_t SumSquareError_MSA(const uint8_t* src_a, - const uint8_t* src_b, - int count); -@@ -138,7 +121,6 @@ uint32_t SumSquareError_MSA(const uint8_ - uint32_t HashDjb2_C(const uint8_t* src, int count, uint32_t seed); - uint32_t HashDjb2_SSE41(const uint8_t* src, int count, uint32_t seed); - uint32_t HashDjb2_AVX2(const uint8_t* src, int count, uint32_t seed); --uint32_t HashDjb2_NEON(const uint8_t* src, int count, uint32_t seed); - - #ifdef __cplusplus - } // extern "C" -diff --git a/media/libyuv/libyuv/include/libyuv/convert.h b/media/libyuv/libyuv/include/libyuv/convert.h ---- a/media/libyuv/libyuv/include/libyuv/convert.h -+++ b/media/libyuv/libyuv/include/libyuv/convert.h -@@ -367,23 +367,6 @@ int I212ToI422(const uint16_t* src_y, - int width, - int height); - --#define H212ToH420 I212ToI420 --LIBYUV_API --int I212ToI420(const uint16_t* src_y, -- int src_stride_y, -- const uint16_t* src_u, -- int src_stride_u, -- const uint16_t* src_v, -- int src_stride_v, -- uint8_t* dst_y, -- int dst_stride_y, -- uint8_t* dst_u, -- int dst_stride_u, -- uint8_t* dst_v, -- int dst_stride_v, -- int width, -- int height); -- - #define H412ToH444 I412ToI444 - LIBYUV_API - int I412ToI444(const uint16_t* src_y, -@@ -401,23 +384,6 @@ int I412ToI444(const uint16_t* src_y, - int width, - int height); - --#define H412ToH420 I412ToI420 --LIBYUV_API --int I412ToI420(const uint16_t* src_y, -- int src_stride_y, -- const uint16_t* src_u, -- int src_stride_u, -- const uint16_t* src_v, -- int src_stride_v, -- uint8_t* dst_y, -- int dst_stride_y, -- uint8_t* dst_u, -- int dst_stride_u, -- uint8_t* dst_v, -- int dst_stride_v, -- int width, -- int height); -- - #define I412ToI012 I410ToI010 - #define H410ToH010 I410ToI010 - #define H412ToH012 I410ToI010 -@@ -785,21 +751,6 @@ int ARGBToI420(const uint8_t* src_argb, - int width, - int height); - --// Convert ARGB to I420 with Alpha --LIBYUV_API --int ARGBToI420Alpha(const uint8_t* src_argb, -- int src_stride_argb, -- uint8_t* dst_y, -- int dst_stride_y, -- uint8_t* dst_u, -- int dst_stride_u, -- uint8_t* dst_v, -- int dst_stride_v, -- uint8_t* dst_a, -- int dst_stride_a, -- int width, -- int height); -- - // BGRA little endian (argb in memory) to I420. - LIBYUV_API - int BGRAToI420(const uint8_t* src_bgra, -diff --git a/media/libyuv/libyuv/include/libyuv/convert_argb.h b/media/libyuv/libyuv/include/libyuv/convert_argb.h ---- a/media/libyuv/libyuv/include/libyuv/convert_argb.h -+++ b/media/libyuv/libyuv/include/libyuv/convert_argb.h -@@ -67,8 +67,6 @@ LIBYUV_API extern const struct YuvConsta - I210ToAR30Matrix(a, b, e, f, c, d, g, h, i##VU, j, k) - #define I410ToAB30Matrix(a, b, c, d, e, f, g, h, i, j, k) \ - I410ToAR30Matrix(a, b, e, f, c, d, g, h, i##VU, j, k) --#define I012ToAB30Matrix(a, b, c, d, e, f, g, h, i, j, k) \ -- I012ToAR30Matrix(a, b, e, f, c, d, g, h, i##VU, j, k) - #define I420AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, k, l, m, n) \ - I420AlphaToARGBMatrix(a, b, e, f, c, d, g, h, i, j, k##VU, l, m, n) - #define I422AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, k, l, m, n) \ -@@ -1904,26 +1902,6 @@ int NV21ToRGB24Matrix(const uint8_t* src - int width, - int height); - --// Convert YUY2 to ARGB with matrix. --LIBYUV_API --int YUY2ToARGBMatrix(const uint8_t* src_yuy2, -- int src_stride_yuy2, -- uint8_t* dst_argb, -- int dst_stride_argb, -- const struct YuvConstants* yuvconstants, -- int width, -- int height); -- --// Convert UYVY to ARGB with matrix. --LIBYUV_API --int UYVYToARGBMatrix(const uint8_t* src_uyvy, -- int src_stride_uyvy, -- uint8_t* dst_argb, -- int dst_stride_argb, -- const struct YuvConstants* yuvconstants, -- int width, -- int height); -- - // Convert Android420 to ARGB with matrix. - LIBYUV_API - int Android420ToARGBMatrix(const uint8_t* src_y, -diff --git a/media/libyuv/libyuv/include/libyuv/cpu_id.h b/media/libyuv/libyuv/include/libyuv/cpu_id.h ---- a/media/libyuv/libyuv/include/libyuv/cpu_id.h -+++ b/media/libyuv/libyuv/include/libyuv/cpu_id.h -@@ -21,52 +21,40 @@ extern "C" { - // Internal flag to indicate cpuid requires initialization. - static const int kCpuInitialized = 0x1; - --// These flags are only valid on Arm processors. -+// These flags are only valid on ARM processors. - static const int kCpuHasARM = 0x2; - static const int kCpuHasNEON = 0x4; --// Leave a gap to avoid setting kCpuHasX86. --static const int kCpuHasNeonDotProd = 0x10; --static const int kCpuHasNeonI8MM = 0x20; --static const int kCpuHasSVE = 0x40; --static const int kCpuHasSVE2 = 0x80; --static const int kCpuHasSME = 0x100; -+// 0x8 reserved for future ARM flag. - - // These flags are only valid on x86 processors. --static const int kCpuHasX86 = 0x8; --static const int kCpuHasSSE2 = 0x10; --static const int kCpuHasSSSE3 = 0x20; --static const int kCpuHasSSE41 = 0x40; --static const int kCpuHasSSE42 = 0x80; --static const int kCpuHasAVX = 0x100; --static const int kCpuHasAVX2 = 0x200; --static const int kCpuHasERMS = 0x400; --static const int kCpuHasFMA3 = 0x800; --static const int kCpuHasF16C = 0x1000; --static const int kCpuHasAVX512BW = 0x2000; --static const int kCpuHasAVX512VL = 0x4000; --static const int kCpuHasAVX512VNNI = 0x8000; --static const int kCpuHasAVX512VBMI = 0x10000; --static const int kCpuHasAVX512VBMI2 = 0x20000; --static const int kCpuHasAVX512VBITALG = 0x40000; --static const int kCpuHasAVX10 = 0x80000; --static const int kCpuHasAVXVNNI = 0x100000; --static const int kCpuHasAVXVNNIINT8 = 0x200000; --static const int kCpuHasAMXINT8 = 0x400000; -+static const int kCpuHasX86 = 0x10; -+static const int kCpuHasSSE2 = 0x20; -+static const int kCpuHasSSSE3 = 0x40; -+static const int kCpuHasSSE41 = 0x80; -+static const int kCpuHasSSE42 = 0x100; // unused at this time. -+static const int kCpuHasAVX = 0x200; -+static const int kCpuHasAVX2 = 0x400; -+static const int kCpuHasERMS = 0x800; -+static const int kCpuHasFMA3 = 0x1000; -+static const int kCpuHasF16C = 0x2000; -+static const int kCpuHasGFNI = 0x4000; -+static const int kCpuHasAVX512BW = 0x8000; -+static const int kCpuHasAVX512VL = 0x10000; -+static const int kCpuHasAVX512VNNI = 0x20000; -+static const int kCpuHasAVX512VBMI = 0x40000; -+static const int kCpuHasAVX512VBMI2 = 0x80000; -+static const int kCpuHasAVX512VBITALG = 0x100000; -+static const int kCpuHasAVX512VPOPCNTDQ = 0x200000; - - // These flags are only valid on MIPS processors. --static const int kCpuHasMIPS = 0x800000; --static const int kCpuHasMSA = 0x1000000; -+static const int kCpuHasMIPS = 0x400000; -+static const int kCpuHasMSA = 0x800000; - - // These flags are only valid on LOONGARCH processors. - static const int kCpuHasLOONGARCH = 0x2000000; - static const int kCpuHasLSX = 0x4000000; - static const int kCpuHasLASX = 0x8000000; - --// These flags are only valid on RISCV processors. --static const int kCpuHasRISCV = 0x10000000; --static const int kCpuHasRVV = 0x20000000; --static const int kCpuHasRVVZVFH = 0x40000000; -- - // Optional init function. TestCpuFlag does an auto-init. - // Returns cpu_info flags. - LIBYUV_API -@@ -90,19 +78,6 @@ LIBYUV_API - int ArmCpuCaps(const char* cpuinfo_name); - LIBYUV_API - int MipsCpuCaps(const char* cpuinfo_name); --LIBYUV_API --int RiscvCpuCaps(const char* cpuinfo_name); -- --#ifdef __aarch64__ --#if __linux__ --// On Linux, parse AArch64 features from getauxval(AT_HWCAP{,2}). --LIBYUV_API --int AArch64CpuCaps(unsigned long hwcap, unsigned long hwcap2); --#else --LIBYUV_API --int AArch64CpuCaps(); --#endif --#endif - - // For testing, allow CPU flags to be disabled. - // ie MaskCpuFlags(~kCpuHasSSSE3) to disable SSSE3. -diff --git a/media/libyuv/libyuv/include/libyuv/macros_msa.h b/media/libyuv/libyuv/include/libyuv/macros_msa.h ---- a/media/libyuv/libyuv/include/libyuv/macros_msa.h -+++ b/media/libyuv/libyuv/include/libyuv/macros_msa.h -@@ -20,9 +20,9 @@ - ({ \ - const uint8_t* psrc_lw_m = (const uint8_t*)(psrc); \ - uint32_t val_m; \ -- asm("lw %[val_m], %[psrc_lw_m] \n" \ -- : [val_m] "=r"(val_m) \ -- : [psrc_lw_m] "m"(*psrc_lw_m)); \ -+ asm volatile("lw %[val_m], %[psrc_lw_m] \n" \ -+ : [val_m] "=r"(val_m) \ -+ : [psrc_lw_m] "m"(*psrc_lw_m)); \ - val_m; \ - }) - -@@ -31,9 +31,9 @@ - ({ \ - const uint8_t* psrc_ld_m = (const uint8_t*)(psrc); \ - uint64_t val_m = 0; \ -- asm("ld %[val_m], %[psrc_ld_m] \n" \ -- : [val_m] "=r"(val_m) \ -- : [psrc_ld_m] "m"(*psrc_ld_m)); \ -+ asm volatile("ld %[val_m], %[psrc_ld_m] \n" \ -+ : [val_m] "=r"(val_m) \ -+ : [psrc_ld_m] "m"(*psrc_ld_m)); \ - val_m; \ - }) - #else // !(__mips == 64) -@@ -55,9 +55,9 @@ - ({ \ - uint8_t* pdst_sw_m = (uint8_t*)(pdst); /* NOLINT */ \ - uint32_t val_m = (val); \ -- asm("sw %[val_m], %[pdst_sw_m] \n" \ -- : [pdst_sw_m] "=m"(*pdst_sw_m) \ -- : [val_m] "r"(val_m)); \ -+ asm volatile("sw %[val_m], %[pdst_sw_m] \n" \ -+ : [pdst_sw_m] "=m"(*pdst_sw_m) \ -+ : [val_m] "r"(val_m)); \ - }) - - #if (__mips == 64) -@@ -65,9 +65,9 @@ - ({ \ - uint8_t* pdst_sd_m = (uint8_t*)(pdst); /* NOLINT */ \ - uint64_t val_m = (val); \ -- asm("sd %[val_m], %[pdst_sd_m] \n" \ -- : [pdst_sd_m] "=m"(*pdst_sd_m) \ -- : [val_m] "r"(val_m)); \ -+ asm volatile("sd %[val_m], %[pdst_sd_m] \n" \ -+ : [pdst_sd_m] "=m"(*pdst_sd_m) \ -+ : [val_m] "r"(val_m)); \ - }) - #else // !(__mips == 64) - #define SD(val, pdst) \ -@@ -86,7 +86,8 @@ - uint8_t* psrc_lw_m = (uint8_t*)(psrc); \ - uint32_t val_lw_m; \ - \ -- asm("lwr %[val_lw_m], 0(%[psrc_lw_m]) \n\t" \ -+ __asm__ volatile( \ -+ "lwr %[val_lw_m], 0(%[psrc_lw_m]) \n\t" \ - "lwl %[val_lw_m], 3(%[psrc_lw_m]) \n\t" \ - \ - : [val_lw_m] "=&r"(val_lw_m) \ -@@ -101,7 +102,8 @@ - uint8_t* psrc_ld_m = (uint8_t*)(psrc); \ - uint64_t val_ld_m = 0; \ - \ -- asm("ldr %[val_ld_m], 0(%[psrc_ld_m]) \n\t" \ -+ __asm__ volatile( \ -+ "ldr %[val_ld_m], 0(%[psrc_ld_m]) \n\t" \ - "ldl %[val_ld_m], 7(%[psrc_ld_m]) \n\t" \ - \ - : [val_ld_m] "=&r"(val_ld_m) \ -@@ -128,9 +130,9 @@ - ({ \ - uint8_t* pdst_sw_m = (uint8_t*)(pdst); /* NOLINT */ \ - uint32_t val_m = (val); \ -- asm("usw %[val_m], %[pdst_sw_m] \n" \ -- : [pdst_sw_m] "=m"(*pdst_sw_m) \ -- : [val_m] "r"(val_m)); \ -+ asm volatile("usw %[val_m], %[pdst_sw_m] \n" \ -+ : [pdst_sw_m] "=m"(*pdst_sw_m) \ -+ : [val_m] "r"(val_m)); \ - }) - - #define SD(val, pdst) \ -diff --git a/media/libyuv/libyuv/include/libyuv/planar_functions.h b/media/libyuv/libyuv/include/libyuv/planar_functions.h ---- a/media/libyuv/libyuv/include/libyuv/planar_functions.h -+++ b/media/libyuv/libyuv/include/libyuv/planar_functions.h -@@ -30,10 +30,7 @@ extern "C" { - #endif - // MemorySanitizer does not support assembly code yet. http://crbug.com/344505 - #if defined(__has_feature) --#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_NEON) --#define LIBYUV_DISABLE_NEON --#endif --#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_X86) -+#if __has_feature(memory_sanitizer) - #define LIBYUV_DISABLE_X86 - #endif - #endif -@@ -830,6 +827,15 @@ int ARGBCopyYToAlpha(const uint8_t* src_ - int width, - int height); - -+typedef void (*ARGBBlendRow)(const uint8_t* src_argb0, -+ const uint8_t* src_argb1, -+ uint8_t* dst_argb, -+ int width); -+ -+// Get function to Alpha Blend ARGB pixels and store to destination. -+LIBYUV_API -+ARGBBlendRow GetARGBBlend(); -+ - // Alpha Blend ARGB images and store to destination. - // Source is pre-multiplied by alpha using ARGBAttenuate. - // Alpha of destination is set to 255. -diff --git a/media/libyuv/libyuv/include/libyuv/rotate_row.h b/media/libyuv/libyuv/include/libyuv/rotate_row.h ---- a/media/libyuv/libyuv/include/libyuv/rotate_row.h -+++ b/media/libyuv/libyuv/include/libyuv/rotate_row.h -@@ -28,10 +28,7 @@ extern "C" { - #endif - // MemorySanitizer does not support assembly code yet. http://crbug.com/344505 - #if defined(__has_feature) --#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_NEON) --#define LIBYUV_DISABLE_NEON --#endif --#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_X86) -+#if __has_feature(memory_sanitizer) - #define LIBYUV_DISABLE_X86 - #endif - #endif -@@ -45,8 +42,6 @@ extern "C" { - // The following are available for GCC 32 or 64 bit: - #if !defined(LIBYUV_DISABLE_X86) && (defined(__i386__) || defined(__x86_64__)) - #define HAS_TRANSPOSEWX8_SSSE3 --#define HAS_TRANSPOSE4X4_32_SSE2 --#define HAS_TRANSPOSE4X4_32_AVX2 - #endif - - // The following are available for 64 bit GCC: -@@ -57,13 +52,8 @@ extern "C" { - - #if !defined(LIBYUV_DISABLE_NEON) && \ - (defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__)) --#if defined(__aarch64__) --#define HAS_TRANSPOSEWX16_NEON --#else - #define HAS_TRANSPOSEWX8_NEON --#endif - #define HAS_TRANSPOSEUVWX8_NEON --#define HAS_TRANSPOSE4X4_32_NEON - #endif - - #if !defined(LIBYUV_DISABLE_MSA) && defined(__mips_msa) -@@ -98,11 +88,6 @@ void TransposeWx8_NEON(const uint8_t* sr - uint8_t* dst, - int dst_stride, - int width); --void TransposeWx16_NEON(const uint8_t* src, -- int src_stride, -- uint8_t* dst, -- int dst_stride, -- int width); - void TransposeWx8_SSSE3(const uint8_t* src, - int src_stride, - uint8_t* dst, -@@ -129,11 +114,6 @@ void TransposeWx8_Any_NEON(const uint8_t - uint8_t* dst, - int dst_stride, - int width); --void TransposeWx16_Any_NEON(const uint8_t* src, -- int src_stride, -- uint8_t* dst, -- int dst_stride, -- int width); - void TransposeWx8_Any_SSSE3(const uint8_t* src, - int src_stride, - uint8_t* dst, -@@ -260,24 +240,19 @@ void Transpose4x4_32_NEON(const uint8_t* - int dst_stride, - int width); - --void Transpose4x4_32_SSE2(const uint8_t* src, -- int src_stride, -- uint8_t* dst, -- int dst_stride, -- int width); -- --void Transpose4x4_32_AVX2(const uint8_t* src, -- int src_stride, -- uint8_t* dst, -- int dst_stride, -- int width); -- - void Transpose4x4_32_C(const uint8_t* src, - int src_stride, - uint8_t* dst, - int dst_stride, - int width); - -+// Transpose 32 bit values (ARGB) -+void Transpose8x8_32_NEON(const uint8_t* src, -+ int src_stride, -+ uint8_t* dst, -+ int dst_stride, -+ int width); -+ - #ifdef __cplusplus - } // extern "C" - } // namespace libyuv -diff --git a/media/libyuv/libyuv/include/libyuv/row.h b/media/libyuv/libyuv/include/libyuv/row.h ---- a/media/libyuv/libyuv/include/libyuv/row.h -+++ b/media/libyuv/libyuv/include/libyuv/row.h -@@ -31,10 +31,7 @@ extern "C" { - #endif - // MemorySanitizer does not support assembly code yet. http://crbug.com/344505 - #if defined(__has_feature) --#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_NEON) --#define LIBYUV_DISABLE_NEON --#endif --#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_X86) -+#if __has_feature(memory_sanitizer) - #define LIBYUV_DISABLE_X86 - #endif - #endif -@@ -164,6 +161,7 @@ extern "C" { - #define HAS_ARGBSEPIAROW_SSSE3 - #define HAS_ARGBSHADEROW_SSE2 - #define HAS_ARGBSUBTRACTROW_SSE2 -+#define HAS_ARGBUNATTENUATEROW_SSE2 - #define HAS_BLENDPLANEROW_SSSE3 - #define HAS_COMPUTECUMULATIVESUMROW_SSE2 - #define HAS_CUMULATIVESUMTOAVERAGEROW_SSE2 -@@ -173,6 +171,9 @@ extern "C" { - #define HAS_SOBELXROW_SSE2 - #define HAS_SOBELXYROW_SSE2 - #define HAS_SOBELYROW_SSE2 -+#if !defined(LIBYUV_BIT_EXACT) -+#define HAS_ARGBATTENUATEROW_SSSE3 -+#endif - - // The following functions fail on gcc/clang 32 bit with fpic and framepointer. - // caveat: clangcl uses row_win.cc which works. -@@ -241,7 +242,11 @@ extern "C" { - #define HAS_ARGBADDROW_AVX2 - #define HAS_ARGBMULTIPLYROW_AVX2 - #define HAS_ARGBSUBTRACTROW_AVX2 -+#define HAS_ARGBUNATTENUATEROW_AVX2 - #define HAS_BLENDPLANEROW_AVX2 -+#if !defined(LIBYUV_BIT_EXACT) -+#define HAS_ARGBATTENUATEROW_AVX2 -+#endif - - #if !defined(MOZ_PROFILING) && \ - (defined(__x86_64__) || !defined(__pic__) || defined(__clang__) || \ -@@ -282,15 +287,14 @@ extern "C" { - #define HAS_ABGRTOAR30ROW_SSSE3 - #define HAS_ABGRTOYJROW_SSSE3 - #define HAS_AR64TOARGBROW_SSSE3 --#define HAS_ARGBATTENUATEROW_SSSE3 - #define HAS_ARGBTOAB64ROW_SSSE3 - #define HAS_ARGBTOAR30ROW_SSSE3 - #define HAS_ARGBTOAR64ROW_SSSE3 --#define HAS_ARGBUNATTENUATEROW_SSE2 - #define HAS_CONVERT16TO8ROW_SSSE3 - #define HAS_CONVERT8TO16ROW_SSE2 -+#define HAS_DETILEROW_SSE2 - #define HAS_DETILEROW_16_SSE2 --#define HAS_DETILEROW_SSE2 -+#define HAS_DETILEROW_16_AVX - #define HAS_DETILESPLITUVROW_SSSE3 - #define HAS_DETILETOYUY2_SSE2 - #define HAS_HALFMERGEUVROW_SSSE3 -@@ -343,16 +347,13 @@ extern "C" { - #define HAS_ABGRTOYJROW_AVX2 - #define HAS_ABGRTOYROW_AVX2 - #define HAS_AR64TOARGBROW_AVX2 --#define HAS_ARGBATTENUATEROW_AVX2 - #define HAS_ARGBTOAB64ROW_AVX2 - #define HAS_ARGBTOAR30ROW_AVX2 - #define HAS_ARGBTOAR64ROW_AVX2 - #define HAS_ARGBTORAWROW_AVX2 - #define HAS_ARGBTORGB24ROW_AVX2 --#define HAS_ARGBUNATTENUATEROW_AVX2 - #define HAS_CONVERT16TO8ROW_AVX2 - #define HAS_CONVERT8TO16ROW_AVX2 --#define HAS_DETILEROW_16_AVX - #define HAS_DIVIDEROW_16_AVX2 - #define HAS_HALFMERGEUVROW_AVX2 - #define HAS_I210TOAR30ROW_AVX2 -@@ -403,8 +404,9 @@ extern "C" { - // The following are available for AVX512 clang x86 platforms: - // TODO(fbarchard): Port to GCC and Visual C - // TODO(fbarchard): re-enable HAS_ARGBTORGB24ROW_AVX512VBMI. Issue libyuv:789 -+// TODO(fbarchard): Port MERGEUV to assembly - #if !defined(LIBYUV_DISABLE_X86) && \ -- (defined(__x86_64__) || defined(__i386__)) && defined(CLANG_HAS_AVX512) -+ (defined(__x86_64__) || defined(__i386__)) && (defined(CLANG_HAS_AVX512) && !defined(_MSC_VER)) - #define HAS_ARGBTORGB24ROW_AVX512VBMI - #define HAS_MERGEUVROW_AVX512BW - #endif -@@ -555,53 +557,6 @@ extern "C" { - - // The following are available on AArch64 platforms: - #if !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__) --#define HAS_ARGBTOAR30ROW_NEON --#define HAS_ABGRTOAR30ROW_NEON --#define HAS_I210ALPHATOARGBROW_NEON --#define HAS_I410ALPHATOARGBROW_NEON --#define HAS_I210TOARGBROW_NEON --#define HAS_I410TOARGBROW_NEON --#define HAS_I210TOAR30ROW_NEON --#define HAS_I410TOAR30ROW_NEON -- --#define HAS_ABGRTOYJROW_NEON_DOTPROD --#define HAS_ABGRTOYROW_NEON_DOTPROD --#define HAS_ARGBTOYJROW_NEON_DOTPROD --#define HAS_ARGBTOYROW_NEON_DOTPROD --#define HAS_BGRATOYROW_NEON_DOTPROD --#define HAS_RGBATOYJROW_NEON_DOTPROD --#define HAS_RGBATOYROW_NEON_DOTPROD -- --#define HAS_ARGBCOLORMATRIXROW_NEON_I8MM --#endif -- --// The following are available on AArch64 SVE platforms: --#if !defined(LIBYUV_DISABLE_SVE) && defined(__aarch64__) --#define HAS_ABGRTOUVJROW_SVE2 --#define HAS_ABGRTOUVROW_SVE2 --#define HAS_ARGB1555TOARGBROW_SVE2 --#define HAS_ARGBTORGB565DITHERROW_SVE2 --#define HAS_ARGBTORGB565ROW_SVE2 --#define HAS_ARGBTOUVJROW_SVE2 --#define HAS_ARGBTOUVROW_SVE2 --#define HAS_AYUVTOUVROW_SVE2 --#define HAS_AYUVTOVUROW_SVE2 --#define HAS_BGRATOUVROW_SVE2 --#define HAS_I400TOARGBROW_SVE2 --#define HAS_I422ALPHATOARGBROW_SVE2 --#define HAS_I422TOARGBROW_SVE2 --#define HAS_I422TORGBAROW_SVE2 --#define HAS_I444ALPHATOARGBROW_SVE2 --#define HAS_I444TOARGBROW_SVE2 --#define HAS_NV12TOARGBROW_SVE2 --#define HAS_NV21TOARGBROW_SVE2 --#define HAS_RGBATOUVROW_SVE2 --#define HAS_UYVYTOARGBROW_SVE2 --#define HAS_YUY2TOARGBROW_SVE2 --#endif -- --// The following are available on AArch64 platforms: --#if !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__) - #define HAS_GAUSSCOL_F32_NEON - #define HAS_GAUSSROW_F32_NEON - #define HAS_INTERPOLATEROW_16TO8_NEON -@@ -698,47 +653,20 @@ extern "C" { - #define HAS_ARGB1555TOUVROW_LSX - #define HAS_ARGB1555TOYROW_LSX - #define HAS_ARGB4444TOARGBROW_LSX --#define HAS_ARGBADDROW_LSX --#define HAS_ARGBATTENUATEROW_LSX - #define HAS_ARGBBLENDROW_LSX - #define HAS_ARGBCOLORMATRIXROW_LSX - #define HAS_ARGBEXTRACTALPHAROW_LSX --#define HAS_ARGBGRAYROW_LSX --#define HAS_ARGBSEPIAROW_LSX --#define HAS_ARGBSHADEROW_LSX --#define HAS_ARGBSHUFFLEROW_LSX --#define HAS_ARGBSUBTRACTROW_LSX - #define HAS_ARGBQUANTIZEROW_LSX - #define HAS_ARGBSETROW_LSX --#define HAS_ARGBTOARGB1555ROW_LSX --#define HAS_ARGBTOARGB4444ROW_LSX --#define HAS_ARGBTORAWROW_LSX --#define HAS_ARGBTORGB24ROW_LSX --#define HAS_ARGBTORGB565ROW_LSX --#define HAS_ARGBTORGB565DITHERROW_LSX - #define HAS_ARGBTOUVJROW_LSX --#define HAS_ARGBTOUV444ROW_LSX --#define HAS_ARGBTOUVROW_LSX - #define HAS_ARGBTOYJROW_LSX --#define HAS_ARGBMIRRORROW_LSX --#define HAS_ARGBMULTIPLYROW_LSX - #define HAS_BGRATOUVROW_LSX - #define HAS_BGRATOYROW_LSX - #define HAS_I400TOARGBROW_LSX - #define HAS_I444TOARGBROW_LSX - #define HAS_INTERPOLATEROW_LSX --#define HAS_I422ALPHATOARGBROW_LSX --#define HAS_I422TOARGB1555ROW_LSX --#define HAS_I422TOARGB4444ROW_LSX --#define HAS_I422TORGB24ROW_LSX --#define HAS_I422TORGB565ROW_LSX --#define HAS_I422TORGBAROW_LSX --#define HAS_I422TOUYVYROW_LSX --#define HAS_I422TOYUY2ROW_LSX - #define HAS_J400TOARGBROW_LSX - #define HAS_MERGEUVROW_LSX --#define HAS_MIRRORROW_LSX --#define HAS_MIRRORUVROW_LSX - #define HAS_MIRRORSPLITUVROW_LSX - #define HAS_NV12TOARGBROW_LSX - #define HAS_NV12TORGB565ROW_LSX -@@ -761,13 +689,7 @@ extern "C" { - #define HAS_SOBELXYROW_LSX - #define HAS_SPLITUVROW_LSX - #define HAS_UYVYTOARGBROW_LSX --#define HAS_UYVYTOUV422ROW_LSX --#define HAS_UYVYTOUVROW_LSX --#define HAS_UYVYTOYROW_LSX - #define HAS_YUY2TOARGBROW_LSX --#define HAS_YUY2TOUVROW_LSX --#define HAS_YUY2TOUV422ROW_LSX --#define HAS_YUY2TOYROW_LSX - #define HAS_ARGBTOYROW_LSX - #define HAS_ABGRTOYJROW_LSX - #define HAS_RGBATOYJROW_LSX -@@ -775,10 +697,6 @@ extern "C" { - #define HAS_RAWTOYJROW_LSX - #endif - --#if !defined(LIBYUV_DISABLE_LSX) && defined(__loongarch_sx) --#define HAS_I422TOARGBROW_LSX --#endif -- - #if !defined(LIBYUV_DISABLE_LASX) && defined(__loongarch_asx) - #define HAS_ARGB1555TOARGBROW_LASX - #define HAS_ARGB1555TOUVROW_LASX -@@ -842,74 +760,6 @@ extern "C" { - #define HAS_RAWTOYJROW_LASX - #endif - --#if !defined(LIBYUV_DISABLE_RVV) && defined(__riscv_vector) --#if __riscv_v_intrinsic > 11000 --// Since v0.12, TUPLE_TYPE is introduced for segment load and store. --#define LIBYUV_RVV_HAS_TUPLE_TYPE --// Since v0.12, VXRM(fixed-point rounding mode) is included in arguments of --// fixed-point intrinsics. --#define LIBYUV_RVV_HAS_VXRM_ARG --#endif -- --#define HAS_COPYROW_RVV --#define HAS_AB64TOARGBROW_RVV --#define HAS_ABGRTOYJROW_RVV --#define HAS_ABGRTOYROW_RVV --#define HAS_AR64TOARGBROW_RVV --#define HAS_AR64TOAB64ROW_RVV --#define HAS_ARGBATTENUATEROW_RVV --#define HAS_ARGBBLENDROW_RVV --#define HAS_ARGBCOPYYTOALPHAROW_RVV --#define HAS_ARGBEXTRACTALPHAROW_RVV --#define HAS_ARGBTOAB64ROW_RVV --#define HAS_ARGBTOABGRROW_RVV --#define HAS_ARGBTOAR64ROW_RVV --#define HAS_ARGBTOBGRAROW_RVV --#define HAS_ARGBTORAWROW_RVV --#define HAS_ARGBTORGB24ROW_RVV --#define HAS_ARGBTORGBAROW_RVV --#define HAS_ARGBTOYJROW_RVV --#define HAS_ARGBTOYMATRIXROW_RVV --#define HAS_ARGBTOYROW_RVV --#define HAS_BGRATOYROW_RVV --#define HAS_BLENDPLANEROW_RVV --#define HAS_I400TOARGBROW_RVV --#define HAS_I422ALPHATOARGBROW_RVV --#define HAS_I422TOARGBROW_RVV --#define HAS_I422TORGB24ROW_RVV --#define HAS_I422TORGBAROW_RVV --#define HAS_I444ALPHATOARGBROW_RVV --#define HAS_I444TOARGBROW_RVV --#define HAS_I444TORGB24ROW_RVV --#define HAS_INTERPOLATEROW_RVV --#define HAS_J400TOARGBROW_RVV --#define HAS_MERGEARGBROW_RVV --#define HAS_MERGERGBROW_RVV --#define HAS_MERGEUVROW_RVV --#define HAS_MERGEXRGBROW_RVV --#define HAS_NV12TOARGBROW_RVV --#define HAS_NV12TORGB24ROW_RVV --#define HAS_NV21TOARGBROW_RVV --#define HAS_NV21TORGB24ROW_RVV --#define HAS_RAWTOARGBROW_RVV --#define HAS_RAWTORGB24ROW_RVV --#define HAS_RAWTORGBAROW_RVV --#define HAS_RAWTOYJROW_RVV --#define HAS_RAWTOYROW_RVV --#define HAS_RGB24TOARGBROW_RVV --#define HAS_RGB24TOYJROW_RVV --#define HAS_RGB24TOYROW_RVV --#define HAS_RGBATOARGBROW_RVV --#define HAS_RGBATOYJROW_RVV --#define HAS_RGBATOYMATRIXROW_RVV --#define HAS_RGBATOYROW_RVV --#define HAS_RGBTOYMATRIXROW_RVV --#define HAS_SPLITARGBROW_RVV --#define HAS_SPLITRGBROW_RVV --#define HAS_SPLITUVROW_RVV --#define HAS_SPLITXRGBROW_RVV --#endif -- - #if defined(_MSC_VER) && !defined(__CLR_VER) && !defined(__clang__) - #if defined(VISUALC_HAS_AVX2) - #define SIMD_ALIGNED(var) __declspec(align(32)) var -@@ -969,8 +819,8 @@ typedef uint32_t ulvec32[8]; - typedef uint8_t ulvec8[32]; - #endif - --#if defined(__aarch64__) || defined(__arm__) || defined(__riscv) --// This struct is for ARM and RISC-V color conversion. -+#if defined(__aarch64__) || defined(__arm__) -+// This struct is for ARM color conversion. - struct YuvConstants { - uvec8 kUVCoeff; - vec16 kRGBCoeffBias; -@@ -1004,6 +854,14 @@ struct YuvConstants { - free(var##_mem); \ - var = NULL - -+#define align_buffer_64_16(var, size) \ -+ void* var##_mem = malloc((size)*2 + 63); /* NOLINT */ \ -+ uint16_t* var = (uint16_t*)(((intptr_t)var##_mem + 63) & ~63) /* NOLINT */ -+ -+#define free_aligned_buffer_64_16(var) \ -+ free(var##_mem); \ -+ var = NULL -+ - #if defined(__APPLE__) || defined(__x86_64__) || defined(__llvm__) - #define OMITFP - #else -@@ -1068,74 +926,24 @@ struct YuvConstants { - IACA_UD_BYTES \ - } - --void I210AlphaToARGBRow_NEON(const uint16_t* src_y, -- const uint16_t* src_u, -- const uint16_t* src_v, -- const uint16_t* src_a, -- uint8_t* rgb_buf, -- const struct YuvConstants* yuvconstants, -- int width); --void I410AlphaToARGBRow_NEON(const uint16_t* src_y, -- const uint16_t* src_u, -- const uint16_t* src_v, -- const uint16_t* src_a, -- uint8_t* rgb_buf, -- const struct YuvConstants* yuvconstants, -- int width); - void I444ToARGBRow_NEON(const uint8_t* src_y, - const uint8_t* src_u, - const uint8_t* src_v, - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width); --void I444ToARGBRow_SVE2(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width); - void I444ToRGB24Row_NEON(const uint8_t* src_y, - const uint8_t* src_u, - const uint8_t* src_v, - uint8_t* dst_rgb24, - const struct YuvConstants* yuvconstants, - int width); --void I210ToARGBRow_NEON(const uint16_t* src_y, -- const uint16_t* src_u, -- const uint16_t* src_v, -- uint8_t* rgb_buf, -- const struct YuvConstants* yuvconstants, -- int width); --void I410ToARGBRow_NEON(const uint16_t* src_y, -- const uint16_t* src_u, -- const uint16_t* src_v, -- uint8_t* rgb_buf, -- const struct YuvConstants* yuvconstants, -- int width); --void I210ToAR30Row_NEON(const uint16_t* src_y, -- const uint16_t* src_u, -- const uint16_t* src_v, -- uint8_t* rgb_buf, -- const struct YuvConstants* yuvconstants, -- int width); --void I410ToAR30Row_NEON(const uint16_t* src_y, -- const uint16_t* src_u, -- const uint16_t* src_v, -- uint8_t* rgb_buf, -- const struct YuvConstants* yuvconstants, -- int width); - void I422ToARGBRow_NEON(const uint8_t* src_y, - const uint8_t* src_u, - const uint8_t* src_v, - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width); --void I422ToARGBRow_SVE2(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width); - void I444AlphaToARGBRow_NEON(const uint8_t* src_y, - const uint8_t* src_u, - const uint8_t* src_v, -@@ -1143,13 +951,6 @@ void I444AlphaToARGBRow_NEON(const uint8 - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width); --void I444AlphaToARGBRow_SVE2(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- const uint8_t* src_a, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width); - void I422AlphaToARGBRow_NEON(const uint8_t* src_y, - const uint8_t* src_u, - const uint8_t* src_v, -@@ -1157,25 +958,12 @@ void I422AlphaToARGBRow_NEON(const uint8 - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width); --void I422AlphaToARGBRow_SVE2(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- const uint8_t* src_a, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width); - void I422ToRGBARow_NEON(const uint8_t* src_y, - const uint8_t* src_u, - const uint8_t* src_v, - uint8_t* dst_rgba, - const struct YuvConstants* yuvconstants, - int width); --void I422ToRGBARow_SVE2(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_rgba, -- const struct YuvConstants* yuvconstants, -- int width); - void I422ToRGB24Row_NEON(const uint8_t* src_y, - const uint8_t* src_u, - const uint8_t* src_v, -@@ -1205,11 +993,6 @@ void NV12ToARGBRow_NEON(const uint8_t* s - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width); --void NV12ToARGBRow_SVE2(const uint8_t* src_y, -- const uint8_t* src_uv, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width); - void NV12ToRGB565Row_NEON(const uint8_t* src_y, - const uint8_t* src_uv, - uint8_t* dst_rgb565, -@@ -1220,11 +1003,6 @@ void NV21ToARGBRow_NEON(const uint8_t* s - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width); --void NV21ToARGBRow_SVE2(const uint8_t* src_y, -- const uint8_t* src_vu, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width); - void NV12ToRGB24Row_NEON(const uint8_t* src_y, - const uint8_t* src_uv, - uint8_t* dst_rgb24, -@@ -1243,62 +1021,10 @@ void YUY2ToARGBRow_NEON(const uint8_t* s - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width); --void YUY2ToARGBRow_SVE2(const uint8_t* src_yuy2, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width); - void UYVYToARGBRow_NEON(const uint8_t* src_uyvy, - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width); --void UYVYToARGBRow_SVE2(const uint8_t* src_uyvy, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width); --void I444ToARGBRow_RVV(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width); --void I444AlphaToARGBRow_RVV(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- const uint8_t* src_a, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width); --void I444ToRGB24Row_RVV(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_rgb24, -- const struct YuvConstants* yuvconstants, -- int width); --void I422ToARGBRow_RVV(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width); --void I422AlphaToARGBRow_RVV(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- const uint8_t* src_a, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width); --void I422ToRGBARow_RVV(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_rgba, -- const struct YuvConstants* yuvconstants, -- int width); --void I422ToRGB24Row_RVV(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_rgb24, -- const struct YuvConstants* yuvconstants, -- int width); - void I444ToARGBRow_MSA(const uint8_t* src_y, - const uint8_t* src_u, - const uint8_t* src_v, -@@ -1318,12 +1044,6 @@ void I422ToARGBRow_MSA(const uint8_t* sr - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width); --void I422ToARGBRow_LSX(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width); - void I422ToARGBRow_LASX(const uint8_t* src_y, - const uint8_t* src_u, - const uint8_t* src_v, -@@ -1336,12 +1056,6 @@ void I422ToRGBARow_MSA(const uint8_t* sr - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width); --void I422ToRGBARow_LSX(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width); - void I422ToRGBARow_LASX(const uint8_t* src_y, - const uint8_t* src_u, - const uint8_t* src_v, -@@ -1355,13 +1069,6 @@ void I422AlphaToARGBRow_MSA(const uint8_ - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width); --void I422AlphaToARGBRow_LSX(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- const uint8_t* src_a, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width); - void I422AlphaToARGBRow_LASX(const uint8_t* src_y, - const uint8_t* src_u, - const uint8_t* src_v, -@@ -1375,12 +1082,6 @@ void I422ToRGB24Row_MSA(const uint8_t* s - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width); --void I422ToRGB24Row_LSX(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width); - void I422ToRGB24Row_LASX(const uint8_t* src_y, - const uint8_t* src_u, - const uint8_t* src_v, -@@ -1393,12 +1094,6 @@ void I422ToRGB565Row_MSA(const uint8_t* - uint8_t* dst_rgb565, - const struct YuvConstants* yuvconstants, - int width); --void I422ToRGB565Row_LSX(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_rgb565, -- const struct YuvConstants* yuvconstants, -- int width); - void I422ToRGB565Row_LASX(const uint8_t* src_y, - const uint8_t* src_u, - const uint8_t* src_v, -@@ -1411,12 +1106,6 @@ void I422ToARGB4444Row_MSA(const uint8_t - uint8_t* dst_argb4444, - const struct YuvConstants* yuvconstants, - int width); --void I422ToARGB4444Row_LSX(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_argb4444, -- const struct YuvConstants* yuvconstants, -- int width); - void I422ToARGB4444Row_LASX(const uint8_t* src_y, - const uint8_t* src_u, - const uint8_t* src_v, -@@ -1429,12 +1118,6 @@ void I422ToARGB1555Row_MSA(const uint8_t - uint8_t* dst_argb1555, - const struct YuvConstants* yuvconstants, - int width); --void I422ToARGB1555Row_LSX(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_argb1555, -- const struct YuvConstants* yuvconstants, -- int width); - void I422ToARGB1555Row_LASX(const uint8_t* src_y, - const uint8_t* src_u, - const uint8_t* src_v, -@@ -1503,26 +1186,6 @@ void UYVYToARGBRow_LSX(const uint8_t* sr - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width); --void NV12ToARGBRow_RVV(const uint8_t* src_y, -- const uint8_t* src_uv, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width); --void NV21ToARGBRow_RVV(const uint8_t* src_y, -- const uint8_t* src_vu, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width); --void NV12ToRGB24Row_RVV(const uint8_t* src_y, -- const uint8_t* src_uv, -- uint8_t* dst_rgb24, -- const struct YuvConstants* yuvconstants, -- int width); --void NV21ToRGB24Row_RVV(const uint8_t* src_y, -- const uint8_t* src_vu, -- uint8_t* dst_rgb24, -- const struct YuvConstants* yuvconstants, -- int width); - - void ARGBToYRow_AVX2(const uint8_t* src_argb, uint8_t* dst_y, int width); - void ARGBToYRow_Any_AVX2(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); -@@ -1552,22 +1215,6 @@ void ARGBToYRow_NEON(const uint8_t* src_ - void ARGBToYJRow_NEON(const uint8_t* src_argb, uint8_t* dst_yj, int width); - void ABGRToYJRow_NEON(const uint8_t* src_abgr, uint8_t* dst_yj, int width); - void RGBAToYJRow_NEON(const uint8_t* src_rgba, uint8_t* dst_yj, int width); --void ARGBToYRow_NEON_DotProd(const uint8_t* src_argb, -- uint8_t* dst_y, -- int width); --void ARGBToYJRow_NEON_DotProd(const uint8_t* src_argb, -- uint8_t* dst_yj, -- int width); --void ABGRToYJRow_NEON_DotProd(const uint8_t* src_abgr, -- uint8_t* dst_yj, -- int width); --void RGBAToYJRow_NEON_DotProd(const uint8_t* src_rgba, -- uint8_t* dst_yj, -- int width); --void ARGBToYRow_RVV(const uint8_t* src_argb, uint8_t* dst_y, int width); --void ARGBToYJRow_RVV(const uint8_t* src_argb, uint8_t* dst_yj, int width); --void ABGRToYJRow_RVV(const uint8_t* src_rgba, uint8_t* dst_yj, int width); --void RGBAToYJRow_RVV(const uint8_t* src_rgba, uint8_t* dst_yj, int width); - void ARGBToYRow_MSA(const uint8_t* src_argb0, uint8_t* dst_y, int width); - void ARGBToYJRow_MSA(const uint8_t* src_argb0, uint8_t* dst_y, int width); - void ARGBToYRow_LSX(const uint8_t* src_argb0, uint8_t* dst_y, int width); -@@ -1587,11 +1234,6 @@ void ARGBToUVRow_NEON(const uint8_t* src - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void ARGBToUVRow_SVE2(const uint8_t* src_argb, -- int src_stride_argb, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void ARGBToUV444Row_MSA(const uint8_t* src_argb, - uint8_t* dst_u, - uint8_t* dst_v, -@@ -1601,20 +1243,11 @@ void ARGBToUVRow_MSA(const uint8_t* src_ - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void ARGBToUVRow_LSX(const uint8_t* src_argb, -- int src_stride_argb, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void ARGBToUVRow_LASX(const uint8_t* src_argb, - int src_stride_argb, - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void ARGBToUV444Row_LSX(const uint8_t* src_argb, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void ARGBToUV444Row_LASX(const uint8_t* src_argb, - uint8_t* dst_u, - uint8_t* dst_v, -@@ -1624,51 +1257,26 @@ void ARGBToUVJRow_NEON(const uint8_t* sr - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void ARGBToUVJRow_SVE2(const uint8_t* src_argb, -- int src_stride_argb, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void ABGRToUVJRow_NEON(const uint8_t* src_abgr, - int src_stride_abgr, - uint8_t* dst_uj, - uint8_t* dst_vj, - int width); --void ABGRToUVJRow_SVE2(const uint8_t* src_abgr, -- int src_stride_abgr, -- uint8_t* dst_uj, -- uint8_t* dst_vj, -- int width); - void BGRAToUVRow_NEON(const uint8_t* src_bgra, - int src_stride_bgra, - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void BGRAToUVRow_SVE2(const uint8_t* src_bgra, -- int src_stride_bgra, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void ABGRToUVRow_NEON(const uint8_t* src_abgr, - int src_stride_abgr, - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void ABGRToUVRow_SVE2(const uint8_t* src_abgr, -- int src_stride_abgr, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void RGBAToUVRow_NEON(const uint8_t* src_rgba, - int src_stride_rgba, - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void RGBAToUVRow_SVE2(const uint8_t* src_rgba, -- int src_stride_rgba, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void RGB24ToUVRow_NEON(const uint8_t* src_rgb24, - int src_stride_rgb24, - uint8_t* dst_u, -@@ -1817,15 +1425,6 @@ void RAWToUVRow_LASX(const uint8_t* src_ - void BGRAToYRow_NEON(const uint8_t* src_bgra, uint8_t* dst_y, int width); - void ABGRToYRow_NEON(const uint8_t* src_abgr, uint8_t* dst_y, int width); - void RGBAToYRow_NEON(const uint8_t* src_rgba, uint8_t* dst_y, int width); --void BGRAToYRow_NEON_DotProd(const uint8_t* src_bgra, -- uint8_t* dst_y, -- int width); --void ABGRToYRow_NEON_DotProd(const uint8_t* src_abgr, -- uint8_t* dst_y, -- int width); --void RGBAToYRow_NEON_DotProd(const uint8_t* src_rgba, -- uint8_t* dst_y, -- int width); - void RGB24ToYRow_NEON(const uint8_t* src_rgb24, uint8_t* dst_y, int width); - void RGB24ToYJRow_NEON(const uint8_t* src_rgb24, uint8_t* dst_yj, int width); - void RAWToYRow_NEON(const uint8_t* src_raw, uint8_t* dst_y, int width); -@@ -1837,13 +1436,6 @@ void ARGB1555ToYRow_NEON(const uint8_t* - void ARGB4444ToYRow_NEON(const uint8_t* src_argb4444, - uint8_t* dst_y, - int width); --void BGRAToYRow_RVV(const uint8_t* src_bgra, uint8_t* dst_y, int width); --void ABGRToYRow_RVV(const uint8_t* src_abgr, uint8_t* dst_y, int width); --void RGBAToYRow_RVV(const uint8_t* src_rgba, uint8_t* dst_y, int width); --void RGB24ToYRow_RVV(const uint8_t* src_rgb24, uint8_t* dst_y, int width); --void RGB24ToYJRow_RVV(const uint8_t* src_rgb24, uint8_t* dst_yj, int width); --void RAWToYRow_RVV(const uint8_t* src_raw, uint8_t* dst_y, int width); --void RAWToYJRow_RVV(const uint8_t* src_raw, uint8_t* dst_yj, int width); - void BGRAToYRow_MSA(const uint8_t* src_argb, uint8_t* dst_y, int width); - void ABGRToYRow_MSA(const uint8_t* src_argb, uint8_t* dst_y, int width); - void RGBAToYRow_MSA(const uint8_t* src_argb, uint8_t* dst_y, int width); -@@ -1903,33 +1495,12 @@ void RAWToYJRow_Any_SSSE3(const uint8_t* - void RGB24ToYJRow_Any_AVX2(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); - void RAWToYJRow_Any_AVX2(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); - void ARGBToYRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); --void ARGBToYRow_Any_NEON_DotProd(const uint8_t* src_ptr, -- uint8_t* dst_ptr, -- int width); - void ARGBToYJRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); --void ARGBToYJRow_Any_NEON_DotProd(const uint8_t* src_ptr, -- uint8_t* dst_ptr, -- int width); - void ABGRToYJRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); --void ABGRToYJRow_Any_NEON_DotProd(const uint8_t* src_ptr, -- uint8_t* dst_ptr, -- int width); - void RGBAToYJRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); --void RGBAToYJRow_Any_NEON_DotProd(const uint8_t* src_ptr, -- uint8_t* dst_ptr, -- int width); - void BGRAToYRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); --void BGRAToYRow_Any_NEON_DotProd(const uint8_t* src_ptr, -- uint8_t* dst_ptr, -- int width); - void ABGRToYRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); --void ABGRToYRow_Any_NEON_DotProd(const uint8_t* src_ptr, -- uint8_t* dst_ptr, -- int width); - void RGBAToYRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); --void RGBAToYRow_Any_NEON_DotProd(const uint8_t* src_ptr, -- uint8_t* dst_ptr, -- int width); - void RGB24ToYRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); - void RGB24ToYJRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); - void RAWToYRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); -@@ -2094,11 +1665,6 @@ void ARGBToUVRow_Any_NEON(const uint8_t* - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void ARGBToUVRow_Any_SVE2(const uint8_t* src_ptr, -- int src_stride, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void ARGBToUV444Row_Any_MSA(const uint8_t* src_ptr, - uint8_t* dst_u, - uint8_t* dst_v, -@@ -2108,20 +1674,11 @@ void ARGBToUVRow_Any_MSA(const uint8_t* - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void ARGBToUVRow_Any_LSX(const uint8_t* src_ptr, -- int src_stride_ptr, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void ARGBToUVRow_Any_LASX(const uint8_t* src_ptr, - int src_stride_ptr, - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void ARGBToUV444Row_Any_LSX(const uint8_t* src_ptr, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void ARGBToUV444Row_Any_LASX(const uint8_t* src_ptr, - uint8_t* dst_u, - uint8_t* dst_v, -@@ -2131,51 +1688,26 @@ void ARGBToUVJRow_Any_NEON(const uint8_t - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void ARGBToUVJRow_Any_SVE2(const uint8_t* src_ptr, -- int src_stride, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void ABGRToUVJRow_Any_NEON(const uint8_t* src_ptr, - int src_stride, - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void ABGRToUVJRow_Any_SVE2(const uint8_t* src_ptr, -- int src_stride, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void BGRAToUVRow_Any_NEON(const uint8_t* src_ptr, - int src_stride, - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void BGRAToUVRow_Any_SVE2(const uint8_t* src_ptr, -- int src_stride, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void ABGRToUVRow_Any_NEON(const uint8_t* src_ptr, - int src_stride, - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void ABGRToUVRow_Any_SVE2(const uint8_t* src_ptr, -- int src_stride, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void RGBAToUVRow_Any_NEON(const uint8_t* src_ptr, - int src_stride, - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void RGBAToUVRow_Any_SVE2(const uint8_t* src_ptr, -- int src_stride, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void RGB24ToUVRow_Any_NEON(const uint8_t* src_ptr, - int src_stride, - uint8_t* dst_u, -@@ -2410,7 +1942,6 @@ void MirrorRow_AVX2(const uint8_t* src, - void MirrorRow_SSSE3(const uint8_t* src, uint8_t* dst, int width); - void MirrorRow_NEON(const uint8_t* src, uint8_t* dst, int width); - void MirrorRow_MSA(const uint8_t* src, uint8_t* dst, int width); --void MirrorRow_LSX(const uint8_t* src, uint8_t* dst, int width); - void MirrorRow_LASX(const uint8_t* src, uint8_t* dst, int width); - void MirrorRow_C(const uint8_t* src, uint8_t* dst, int width); - void MirrorRow_Any_AVX2(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); -@@ -2418,20 +1949,17 @@ void MirrorRow_Any_SSSE3(const uint8_t* - void MirrorRow_Any_SSE2(const uint8_t* src, uint8_t* dst, int width); - void MirrorRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); - void MirrorRow_Any_MSA(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); --void MirrorRow_Any_LSX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); - void MirrorRow_Any_LASX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); - void MirrorUVRow_AVX2(const uint8_t* src_uv, uint8_t* dst_uv, int width); - void MirrorUVRow_SSSE3(const uint8_t* src_uv, uint8_t* dst_uv, int width); - void MirrorUVRow_NEON(const uint8_t* src_uv, uint8_t* dst_uv, int width); - void MirrorUVRow_MSA(const uint8_t* src_uv, uint8_t* dst_uv, int width); --void MirrorUVRow_LSX(const uint8_t* src_uv, uint8_t* dst_uv, int width); - void MirrorUVRow_LASX(const uint8_t* src_uv, uint8_t* dst_uv, int width); - void MirrorUVRow_C(const uint8_t* src_uv, uint8_t* dst_uv, int width); - void MirrorUVRow_Any_AVX2(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); - void MirrorUVRow_Any_SSSE3(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); - void MirrorUVRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); - void MirrorUVRow_Any_MSA(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); --void MirrorUVRow_Any_LSX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); - void MirrorUVRow_Any_LASX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); - - void MirrorSplitUVRow_SSSE3(const uint8_t* src, -@@ -2461,7 +1989,6 @@ void ARGBMirrorRow_AVX2(const uint8_t* s - void ARGBMirrorRow_SSE2(const uint8_t* src, uint8_t* dst, int width); - void ARGBMirrorRow_NEON(const uint8_t* src_argb, uint8_t* dst_argb, int width); - void ARGBMirrorRow_MSA(const uint8_t* src, uint8_t* dst, int width); --void ARGBMirrorRow_LSX(const uint8_t* src, uint8_t* dst, int width); - void ARGBMirrorRow_LASX(const uint8_t* src, uint8_t* dst, int width); - void ARGBMirrorRow_C(const uint8_t* src, uint8_t* dst, int width); - void ARGBMirrorRow_Any_AVX2(const uint8_t* src_ptr, -@@ -2474,7 +2001,6 @@ void ARGBMirrorRow_Any_NEON(const uint8_ - uint8_t* dst_ptr, - int width); - void ARGBMirrorRow_Any_MSA(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); --void ARGBMirrorRow_Any_LSX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); - void ARGBMirrorRow_Any_LASX(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int width); -@@ -2517,10 +2043,6 @@ void SplitUVRow_LSX(const uint8_t* src_u - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void SplitUVRow_RVV(const uint8_t* src_uv, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void SplitUVRow_Any_SSE2(const uint8_t* src_ptr, - uint8_t* dst_u, - uint8_t* dst_v, -@@ -2682,10 +2204,6 @@ void MergeUVRow_LSX(const uint8_t* src_u - const uint8_t* src_v, - uint8_t* dst_uv, - int width); --void MergeUVRow_RVV(const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_uv, -- int width); - void MergeUVRow_Any_SSE2(const uint8_t* y_buf, - const uint8_t* uv_buf, - uint8_t* dst_ptr, -@@ -2754,11 +2272,6 @@ void SplitRGBRow_NEON(const uint8_t* src - uint8_t* dst_g, - uint8_t* dst_b, - int width); --void SplitRGBRow_RVV(const uint8_t* src_rgb, -- uint8_t* dst_r, -- uint8_t* dst_g, -- uint8_t* dst_b, -- int width); - void SplitRGBRow_Any_SSSE3(const uint8_t* src_ptr, - uint8_t* dst_r, - uint8_t* dst_g, -@@ -2785,11 +2298,6 @@ void MergeRGBRow_NEON(const uint8_t* src - const uint8_t* src_b, - uint8_t* dst_rgb, - int width); --void MergeRGBRow_RVV(const uint8_t* src_r, -- const uint8_t* src_g, -- const uint8_t* src_b, -- uint8_t* dst_rgb, -- int width); - void MergeRGBRow_Any_SSSE3(const uint8_t* y_buf, - const uint8_t* u_buf, - const uint8_t* v_buf, -@@ -2824,12 +2332,6 @@ void MergeARGBRow_NEON(const uint8_t* sr - const uint8_t* src_a, - uint8_t* dst_argb, - int width); --void MergeARGBRow_RVV(const uint8_t* src_r, -- const uint8_t* src_g, -- const uint8_t* src_b, -- const uint8_t* src_a, -- uint8_t* dst_argb, -- int width); - void MergeARGBRow_Any_SSE2(const uint8_t* y_buf, - const uint8_t* u_buf, - const uint8_t* v_buf, -@@ -2878,12 +2380,6 @@ void SplitARGBRow_NEON(const uint8_t* sr - uint8_t* dst_b, - uint8_t* dst_a, - int width); --void SplitARGBRow_RVV(const uint8_t* src_rgba, -- uint8_t* dst_r, -- uint8_t* dst_g, -- uint8_t* dst_b, -- uint8_t* dst_a, -- int width); - void SplitARGBRow_Any_SSE2(const uint8_t* src_ptr, - uint8_t* dst_r, - uint8_t* dst_g, -@@ -2928,11 +2424,6 @@ void MergeXRGBRow_NEON(const uint8_t* sr - const uint8_t* src_b, - uint8_t* dst_argb, - int width); --void MergeXRGBRow_RVV(const uint8_t* src_r, -- const uint8_t* src_g, -- const uint8_t* src_b, -- uint8_t* dst_argb, -- int width); - void MergeXRGBRow_Any_SSE2(const uint8_t* y_buf, - const uint8_t* u_buf, - const uint8_t* v_buf, -@@ -2973,11 +2464,6 @@ void SplitXRGBRow_NEON(const uint8_t* sr - uint8_t* dst_g, - uint8_t* dst_b, - int width); --void SplitXRGBRow_RVV(const uint8_t* src_rgba, -- uint8_t* dst_r, -- uint8_t* dst_g, -- uint8_t* dst_b, -- int width); - void SplitXRGBRow_Any_SSE2(const uint8_t* src_ptr, - uint8_t* dst_r, - uint8_t* dst_g, -@@ -3321,7 +2807,6 @@ void CopyRow_AVX(const uint8_t* src, uin - void CopyRow_ERMS(const uint8_t* src, uint8_t* dst, int width); - void CopyRow_NEON(const uint8_t* src, uint8_t* dst, int width); - void CopyRow_MIPS(const uint8_t* src, uint8_t* dst, int count); --void CopyRow_RVV(const uint8_t* src, uint8_t* dst, int count); - void CopyRow_C(const uint8_t* src, uint8_t* dst, int count); - void CopyRow_Any_SSE2(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); - void CopyRow_Any_AVX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); -@@ -3355,9 +2840,6 @@ void ARGBExtractAlphaRow_MSA(const uint8 - void ARGBExtractAlphaRow_LSX(const uint8_t* src_argb, - uint8_t* dst_a, - int width); --void ARGBExtractAlphaRow_RVV(const uint8_t* src_argb, -- uint8_t* dst_a, -- int width); - void ARGBExtractAlphaRow_Any_SSE2(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int width); -@@ -3377,7 +2859,6 @@ void ARGBExtractAlphaRow_Any_LSX(const u - void ARGBCopyYToAlphaRow_C(const uint8_t* src, uint8_t* dst, int width); - void ARGBCopyYToAlphaRow_SSE2(const uint8_t* src, uint8_t* dst, int width); - void ARGBCopyYToAlphaRow_AVX2(const uint8_t* src, uint8_t* dst, int width); --void ARGBCopyYToAlphaRow_RVV(const uint8_t* src, uint8_t* dst, int width); - void ARGBCopyYToAlphaRow_Any_SSE2(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int width); -@@ -3425,10 +2906,6 @@ void ARGBShuffleRow_MSA(const uint8_t* s - uint8_t* dst_argb, - const uint8_t* shuffler, - int width); --void ARGBShuffleRow_LSX(const uint8_t* src_argb, -- uint8_t* dst_argb, -- const uint8_t* shuffler, -- int width); - void ARGBShuffleRow_LASX(const uint8_t* src_argb, - uint8_t* dst_argb, - const uint8_t* shuffler, -@@ -3449,10 +2926,6 @@ void ARGBShuffleRow_Any_MSA(const uint8_ - uint8_t* dst_ptr, - const uint8_t* param, - int width); --void ARGBShuffleRow_Any_LSX(const uint8_t* src_ptr, -- uint8_t* dst_ptr, -- const uint8_t* param, -- int width); - void ARGBShuffleRow_Any_LASX(const uint8_t* src_ptr, - uint8_t* dst_ptr, - const uint8_t* param, -@@ -3485,18 +2958,14 @@ void RGB24ToARGBRow_LSX(const uint8_t* s - void RGB24ToARGBRow_LASX(const uint8_t* src_rgb24, - uint8_t* dst_argb, - int width); --void RGB24ToARGBRow_RVV(const uint8_t* src_rgb24, uint8_t* dst_argb, int width); - void RAWToARGBRow_NEON(const uint8_t* src_raw, uint8_t* dst_argb, int width); - void RAWToRGBARow_NEON(const uint8_t* src_raw, uint8_t* dst_rgba, int width); - void RAWToARGBRow_MSA(const uint8_t* src_raw, uint8_t* dst_argb, int width); - void RAWToARGBRow_LSX(const uint8_t* src_raw, uint8_t* dst_argb, int width); - void RAWToARGBRow_LASX(const uint8_t* src_raw, uint8_t* dst_argb, int width); --void RAWToARGBRow_RVV(const uint8_t* src_raw, uint8_t* dst_argb, int width); --void RAWToRGBARow_RVV(const uint8_t* src_raw, uint8_t* dst_rgba, int width); - void RAWToRGB24Row_NEON(const uint8_t* src_raw, uint8_t* dst_rgb24, int width); - void RAWToRGB24Row_MSA(const uint8_t* src_raw, uint8_t* dst_rgb24, int width); - void RAWToRGB24Row_LSX(const uint8_t* src_raw, uint8_t* dst_rgb24, int width); --void RAWToRGB24Row_RVV(const uint8_t* src_raw, uint8_t* dst_rgb24, int width); - void RGB565ToARGBRow_NEON(const uint8_t* src_rgb565, - uint8_t* dst_argb, - int width); -@@ -3512,9 +2981,6 @@ void RGB565ToARGBRow_LASX(const uint8_t* - void ARGB1555ToARGBRow_NEON(const uint8_t* src_argb1555, - uint8_t* dst_argb, - int width); --void ARGB1555ToARGBRow_SVE2(const uint8_t* src_argb1555, -- uint8_t* dst_argb, -- int width); - void ARGB1555ToARGBRow_MSA(const uint8_t* src_argb1555, - uint8_t* dst_argb, - int width); -@@ -3659,15 +3125,15 @@ void ARGBToRGB24Row_AVX512VBMI(const uin - - void ARGBToRGB565DitherRow_C(const uint8_t* src_argb, - uint8_t* dst_rgb, -- uint32_t dither4, -+ const uint32_t dither4, - int width); - void ARGBToRGB565DitherRow_SSE2(const uint8_t* src, - uint8_t* dst, -- uint32_t dither4, -+ const uint32_t dither4, - int width); - void ARGBToRGB565DitherRow_AVX2(const uint8_t* src, - uint8_t* dst, -- uint32_t dither4, -+ const uint32_t dither4, - int width); - - void ARGBToRGB565Row_AVX2(const uint8_t* src_argb, uint8_t* dst_rgb, int width); -@@ -3687,9 +3153,6 @@ void ARGBToRAWRow_NEON(const uint8_t* sr - void ARGBToRGB565Row_NEON(const uint8_t* src_argb, - uint8_t* dst_rgb565, - int width); --void ARGBToRGB565Row_SVE2(const uint8_t* src_argb, -- uint8_t* dst_rgb565, -- int width); - void ARGBToARGB1555Row_NEON(const uint8_t* src_argb, - uint8_t* dst_argb1555, - int width); -@@ -3698,11 +3161,7 @@ void ARGBToARGB4444Row_NEON(const uint8_ - int width); - void ARGBToRGB565DitherRow_NEON(const uint8_t* src_argb, - uint8_t* dst_rgb, -- uint32_t dither4, -- int width); --void ARGBToRGB565DitherRow_SVE2(const uint8_t* src_argb, -- uint8_t* dst_rgb, -- uint32_t dither4, -+ const uint32_t dither4, - int width); - void ARGBToRGB24Row_MSA(const uint8_t* src_argb, uint8_t* dst_rgb, int width); - void ARGBToRAWRow_MSA(const uint8_t* src_argb, uint8_t* dst_rgb, int width); -@@ -3715,44 +3174,23 @@ void ARGBToARGB4444Row_MSA(const uint8_t - int width); - void ARGBToRGB565DitherRow_MSA(const uint8_t* src_argb, - uint8_t* dst_rgb, -- uint32_t dither4, -- int width); --void ARGBToRGB565DitherRow_LSX(const uint8_t* src_argb, -- uint8_t* dst_rgb, -- uint32_t dither4, -+ const uint32_t dither4, - int width); - void ARGBToRGB565DitherRow_LASX(const uint8_t* src_argb, - uint8_t* dst_rgb, -- uint32_t dither4, -+ const uint32_t dither4, - int width); - --void ARGBToRGB24Row_LSX(const uint8_t* src_argb, uint8_t* dst_rgb, int width); - void ARGBToRGB24Row_LASX(const uint8_t* src_argb, uint8_t* dst_rgb, int width); --void ARGBToRAWRow_LSX(const uint8_t* src_argb, uint8_t* dst_rgb, int width); - void ARGBToRAWRow_LASX(const uint8_t* src_argb, uint8_t* dst_rgb, int width); --void ARGBToRGB565Row_LSX(const uint8_t* src_argb, uint8_t* dst_rgb, int width); - void ARGBToRGB565Row_LASX(const uint8_t* src_argb, uint8_t* dst_rgb, int width); --void ARGBToARGB1555Row_LSX(const uint8_t* src_argb, -- uint8_t* dst_rgb, -- int width); - void ARGBToARGB1555Row_LASX(const uint8_t* src_argb, - uint8_t* dst_rgb, - int width); --void ARGBToARGB4444Row_LSX(const uint8_t* src_argb, -- uint8_t* dst_rgb, -- int width); - void ARGBToARGB4444Row_LASX(const uint8_t* src_argb, - uint8_t* dst_rgb, - int width); - --void ARGBToRAWRow_RVV(const uint8_t* src_argb, uint8_t* dst_raw, int width); --void ARGBToABGRRow_RVV(const uint8_t* src_argb, uint8_t* dst_abgr, int width); --void ARGBToBGRARow_RVV(const uint8_t* src_argb, uint8_t* dst_rgba, int width); --void ARGBToRGBARow_RVV(const uint8_t* src_argb, uint8_t* dst_rgb, int width); --void ARGBToRGB24Row_RVV(const uint8_t* src_argb, uint8_t* dst_rgb24, int width); -- --void ARGBToABGRRow_C(const uint8_t* src_argb, uint8_t* dst_abgr, int width); --void ARGBToBGRARow_C(const uint8_t* src_argb, uint8_t* dst_bgra, int width); - void ARGBToRGBARow_C(const uint8_t* src_argb, uint8_t* dst_rgb, int width); - void ARGBToRGB24Row_C(const uint8_t* src_argb, uint8_t* dst_rgb, int width); - void ARGBToRAWRow_C(const uint8_t* src_argb, uint8_t* dst_rgb, int width); -@@ -3766,8 +3204,6 @@ void ARGBToAR64Row_C(const uint8_t* src_ - void ARGBToAB64Row_C(const uint8_t* src_argb, uint16_t* dst_ab64, int width); - void AR64ToARGBRow_C(const uint16_t* src_ar64, uint8_t* dst_argb, int width); - void AB64ToARGBRow_C(const uint16_t* src_ab64, uint8_t* dst_argb, int width); --void AR64ToAB64Row_C(const uint16_t* src_ar64, uint16_t* dst_ab64, int width); --void RGBAToARGBRow_C(const uint8_t* src_rgba, uint8_t* dst_argb, int width); - void AR64ShuffleRow_C(const uint8_t* src_ar64, - uint8_t* dst_ar64, - const uint8_t* shuffler, -@@ -3792,12 +3228,6 @@ void ARGBToAR64Row_NEON(const uint8_t* s - void ARGBToAB64Row_NEON(const uint8_t* src_argb, uint16_t* dst_ab64, int width); - void AR64ToARGBRow_NEON(const uint16_t* src_ar64, uint8_t* dst_argb, int width); - void AB64ToARGBRow_NEON(const uint16_t* src_ab64, uint8_t* dst_argb, int width); --void ARGBToAR64Row_RVV(const uint8_t* src_argb, uint16_t* dst_ar64, int width); --void ARGBToAB64Row_RVV(const uint8_t* src_argb, uint16_t* dst_ab64, int width); --void AR64ToARGBRow_RVV(const uint16_t* src_ar64, uint8_t* dst_argb, int width); --void AB64ToARGBRow_RVV(const uint16_t* src_ab64, uint8_t* dst_argb, int width); --void AR64ToAB64Row_RVV(const uint16_t* src_ar64, uint16_t* dst_ab64, int width); --void RGBAToARGBRow_RVV(const uint8_t* src_rgba, uint8_t* dst_argb, int width); - void ARGBToAR64Row_Any_SSSE3(const uint8_t* src_ptr, - uint16_t* dst_ptr, - int width); -@@ -3840,7 +3270,6 @@ void J400ToARGBRow_AVX2(const uint8_t* s - void J400ToARGBRow_NEON(const uint8_t* src_y, uint8_t* dst_argb, int width); - void J400ToARGBRow_MSA(const uint8_t* src_y, uint8_t* dst_argb, int width); - void J400ToARGBRow_LSX(const uint8_t* src_y, uint8_t* dst_argb, int width); --void J400ToARGBRow_RVV(const uint8_t* src_y, uint8_t* dst_argb, int width); - void J400ToARGBRow_C(const uint8_t* src_y, uint8_t* dst_argb, int width); - void J400ToARGBRow_Any_SSE2(const uint8_t* src_ptr, - uint8_t* dst_ptr, -@@ -4762,10 +4191,6 @@ void I400ToARGBRow_NEON(const uint8_t* s - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width); --void I400ToARGBRow_SVE2(const uint8_t* src_y, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width); - void I400ToARGBRow_MSA(const uint8_t* src_y, - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, -@@ -4774,10 +4199,6 @@ void I400ToARGBRow_LSX(const uint8_t* sr - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width); --void I400ToARGBRow_RVV(const uint8_t* src_y, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width); - void I400ToARGBRow_Any_SSE2(const uint8_t* src_ptr, - uint8_t* dst_ptr, - const struct YuvConstants* param, -@@ -4816,10 +4237,6 @@ void ARGBBlendRow_LSX(const uint8_t* src - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width); --void ARGBBlendRow_RVV(const uint8_t* src_argb0, -- const uint8_t* src_argb1, -- uint8_t* dst_argb, -- int width); - void ARGBBlendRow_C(const uint8_t* src_argb, - const uint8_t* src_argb1, - uint8_t* dst_argb, -@@ -4846,11 +4263,6 @@ void BlendPlaneRow_Any_AVX2(const uint8_ - const uint8_t* v_buf, - uint8_t* dst_ptr, - int width); --void BlendPlaneRow_RVV(const uint8_t* src0, -- const uint8_t* src1, -- const uint8_t* alpha, -- uint8_t* dst, -- int width); - void BlendPlaneRow_C(const uint8_t* src0, - const uint8_t* src1, - const uint8_t* alpha, -@@ -4895,18 +4307,10 @@ void ARGBMultiplyRow_Any_MSA(const uint8 - const uint8_t* uv_buf, - uint8_t* dst_ptr, - int width); --void ARGBMultiplyRow_LSX(const uint8_t* src_argb0, -- const uint8_t* src_argb1, -- uint8_t* dst_argb, -- int width); - void ARGBMultiplyRow_LASX(const uint8_t* src_argb0, - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width); --void ARGBMultiplyRow_Any_LSX(const uint8_t* y_buf, -- const uint8_t* uv_buf, -- uint8_t* dst_ptr, -- int width); - void ARGBMultiplyRow_Any_LASX(const uint8_t* y_buf, - const uint8_t* uv_buf, - uint8_t* dst_ptr, -@@ -4949,18 +4353,10 @@ void ARGBAddRow_Any_MSA(const uint8_t* y - const uint8_t* uv_buf, - uint8_t* dst_ptr, - int width); --void ARGBAddRow_LSX(const uint8_t* src_argb0, -- const uint8_t* src_argb1, -- uint8_t* dst_argb, -- int width); - void ARGBAddRow_LASX(const uint8_t* src_argb0, - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width); --void ARGBAddRow_Any_LSX(const uint8_t* y_buf, -- const uint8_t* uv_buf, -- uint8_t* dst_ptr, -- int width); - void ARGBAddRow_Any_LASX(const uint8_t* y_buf, - const uint8_t* uv_buf, - uint8_t* dst_ptr, -@@ -5004,18 +4400,10 @@ void ARGBSubtractRow_Any_MSA(const uint8 - const uint8_t* uv_buf, - uint8_t* dst_ptr, - int width); --void ARGBSubtractRow_LSX(const uint8_t* src_argb0, -- const uint8_t* src_argb1, -- uint8_t* dst_argb, -- int width); - void ARGBSubtractRow_LASX(const uint8_t* src_argb0, - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width); --void ARGBSubtractRow_Any_LSX(const uint8_t* y_buf, -- const uint8_t* uv_buf, -- uint8_t* dst_ptr, -- int width); - void ARGBSubtractRow_Any_LASX(const uint8_t* y_buf, - const uint8_t* uv_buf, - uint8_t* dst_ptr, -@@ -5108,37 +4496,21 @@ void ARGBToRGB565DitherRow_Any_MSA(const - uint8_t* dst_ptr, - const uint32_t param, - int width); --void ARGBToRGB565DitherRow_Any_LSX(const uint8_t* src_ptr, -- uint8_t* dst_ptr, -- const uint32_t param, -- int width); - void ARGBToRGB565DitherRow_Any_LASX(const uint8_t* src_ptr, - uint8_t* dst_ptr, - const uint32_t param, - int width); --void ARGBToRGB24Row_Any_LSX(const uint8_t* src_ptr, -- uint8_t* dst_ptr, -- int width); -+ - void ARGBToRGB24Row_Any_LASX(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int width); --void ARGBToRAWRow_Any_LSX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); - void ARGBToRAWRow_Any_LASX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); --void ARGBToRGB565Row_Any_LSX(const uint8_t* src_ptr, -- uint8_t* dst_ptr, -- int width); - void ARGBToRGB565Row_Any_LASX(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int width); --void ARGBToARGB1555Row_Any_LSX(const uint8_t* src_ptr, -- uint8_t* dst_ptr, -- int width); - void ARGBToARGB1555Row_Any_LASX(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int width); --void ARGBToARGB4444Row_Any_LSX(const uint8_t* src_ptr, -- uint8_t* dst_ptr, -- int width); - void ARGBToARGB4444Row_Any_LASX(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int width); -@@ -5161,30 +4533,6 @@ void I422ToARGBRow_Any_NEON(const uint8_ - uint8_t* dst_ptr, - const struct YuvConstants* yuvconstants, - int width); --void I210ToARGBRow_Any_NEON(const uint16_t* y_buf, -- const uint16_t* u_buf, -- const uint16_t* v_buf, -- uint8_t* dst_ptr, -- const struct YuvConstants* yuvconstants, -- int width); --void I410ToARGBRow_Any_NEON(const uint16_t* y_buf, -- const uint16_t* u_buf, -- const uint16_t* v_buf, -- uint8_t* dst_ptr, -- const struct YuvConstants* yuvconstants, -- int width); --void I210ToAR30Row_Any_NEON(const uint16_t* y_buf, -- const uint16_t* u_buf, -- const uint16_t* v_buf, -- uint8_t* dst_ptr, -- const struct YuvConstants* yuvconstants, -- int width); --void I410ToAR30Row_Any_NEON(const uint16_t* y_buf, -- const uint16_t* u_buf, -- const uint16_t* v_buf, -- uint8_t* dst_ptr, -- const struct YuvConstants* yuvconstants, -- int width); - void I444AlphaToARGBRow_Any_NEON(const uint8_t* y_buf, - const uint8_t* u_buf, - const uint8_t* v_buf, -@@ -5199,20 +4547,6 @@ void I422AlphaToARGBRow_Any_NEON(const u - uint8_t* dst_ptr, - const struct YuvConstants* yuvconstants, - int width); --void I410AlphaToARGBRow_Any_NEON(const uint16_t* y_buf, -- const uint16_t* u_buf, -- const uint16_t* v_buf, -- const uint16_t* a_buf, -- uint8_t* dst_ptr, -- const struct YuvConstants* yuvconstants, -- int width); --void I210AlphaToARGBRow_Any_NEON(const uint16_t* y_buf, -- const uint16_t* u_buf, -- const uint16_t* v_buf, -- const uint16_t* a_buf, -- uint8_t* dst_ptr, -- const struct YuvConstants* yuvconstants, -- int width); - void I422ToRGBARow_Any_NEON(const uint8_t* y_buf, - const uint8_t* u_buf, - const uint8_t* v_buf, -@@ -5280,13 +4614,45 @@ void UYVYToARGBRow_Any_NEON(const uint8_ - uint8_t* dst_ptr, - const struct YuvConstants* yuvconstants, - int width); --void ARGBToAR30Row_NEON(const uint8_t* src, uint8_t* dst, int width); --void ABGRToAR30Row_NEON(const uint8_t* src, uint8_t* dst, int width); --void ABGRToAR30Row_Any_NEON(const uint8_t* src_ptr, -- uint8_t* dst_ptr, -+void P210ToARGBRow_NEON(const uint16_t* y_buf, -+ const uint16_t* uv_buf, -+ uint8_t* dst_argb, -+ const struct YuvConstants* yuvconstants, -+ int width); -+void P410ToARGBRow_NEON(const uint16_t* y_buf, -+ const uint16_t* uv_buf, -+ uint8_t* dst_argb, -+ const struct YuvConstants* yuvconstants, -+ int width); -+void P210ToAR30Row_NEON(const uint16_t* y_buf, -+ const uint16_t* uv_buf, -+ uint8_t* dst_ar30, -+ const struct YuvConstants* yuvconstants, -+ int width); -+void P410ToAR30Row_NEON(const uint16_t* y_buf, -+ const uint16_t* uv_buf, -+ uint8_t* dst_ar30, -+ const struct YuvConstants* yuvconstants, -+ int width); -+void P210ToARGBRow_Any_NEON(const uint16_t* y_buf, -+ const uint16_t* uv_buf, -+ uint8_t* dst_argb, -+ const struct YuvConstants* yuvconstants, - int width); --void ARGBToAR30Row_Any_NEON(const uint8_t* src_ptr, -- uint8_t* dst_ptr, -+void P410ToARGBRow_Any_NEON(const uint16_t* y_buf, -+ const uint16_t* uv_buf, -+ uint8_t* dst_argb, -+ const struct YuvConstants* yuvconstants, -+ int width); -+void P210ToAR30Row_Any_NEON(const uint16_t* y_buf, -+ const uint16_t* uv_buf, -+ uint8_t* dst_ar30, -+ const struct YuvConstants* yuvconstants, -+ int width); -+void P410ToAR30Row_Any_NEON(const uint16_t* y_buf, -+ const uint16_t* uv_buf, -+ uint8_t* dst_ar30, -+ const struct YuvConstants* yuvconstants, - int width); - void I444ToARGBRow_Any_MSA(const uint8_t* y_buf, - const uint8_t* u_buf, -@@ -5306,12 +4672,6 @@ void I422ToARGBRow_Any_MSA(const uint8_t - uint8_t* dst_ptr, - const struct YuvConstants* yuvconstants, - int width); --void I422ToARGBRow_Any_LSX(const uint8_t* y_buf, -- const uint8_t* u_buf, -- const uint8_t* v_buf, -- uint8_t* dst_ptr, -- const struct YuvConstants* yuvconstants, -- int width); - void I422ToARGBRow_Any_LASX(const uint8_t* y_buf, - const uint8_t* u_buf, - const uint8_t* v_buf, -@@ -5324,12 +4684,6 @@ void I422ToRGBARow_Any_MSA(const uint8_t - uint8_t* dst_ptr, - const struct YuvConstants* yuvconstants, - int width); --void I422ToRGBARow_Any_LSX(const uint8_t* y_buf, -- const uint8_t* u_buf, -- const uint8_t* v_buf, -- uint8_t* dst_ptr, -- const struct YuvConstants* yuvconstants, -- int width); - void I422ToRGBARow_Any_LASX(const uint8_t* y_buf, - const uint8_t* u_buf, - const uint8_t* v_buf, -@@ -5343,13 +4697,6 @@ void I422AlphaToARGBRow_Any_MSA(const ui - uint8_t* dst_ptr, - const struct YuvConstants* yuvconstants, - int width); --void I422AlphaToARGBRow_Any_LSX(const uint8_t* y_buf, -- const uint8_t* u_buf, -- const uint8_t* v_buf, -- const uint8_t* a_buf, -- uint8_t* dst_ptr, -- const struct YuvConstants* yuvconstants, -- int width); - void I422AlphaToARGBRow_Any_LASX(const uint8_t* y_buf, - const uint8_t* u_buf, - const uint8_t* v_buf, -@@ -5363,12 +4710,6 @@ void I422ToRGB24Row_Any_MSA(const uint8_ - uint8_t* dst_ptr, - const struct YuvConstants* yuvconstants, - int width); --void I422ToRGB24Row_Any_LSX(const uint8_t* y_buf, -- const uint8_t* u_buf, -- const uint8_t* v_buf, -- uint8_t* dst_ptr, -- const struct YuvConstants* yuvconstants, -- int width); - void I422ToRGB24Row_Any_LASX(const uint8_t* y_buf, - const uint8_t* u_buf, - const uint8_t* v_buf, -@@ -5381,12 +4722,6 @@ void I422ToRGB565Row_Any_MSA(const uint8 - uint8_t* dst_ptr, - const struct YuvConstants* yuvconstants, - int width); --void I422ToRGB565Row_Any_LSX(const uint8_t* y_buf, -- const uint8_t* u_buf, -- const uint8_t* v_buf, -- uint8_t* dst_ptr, -- const struct YuvConstants* yuvconstants, -- int width); - void I422ToRGB565Row_Any_LASX(const uint8_t* y_buf, - const uint8_t* u_buf, - const uint8_t* v_buf, -@@ -5399,12 +4734,6 @@ void I422ToARGB4444Row_Any_MSA(const uin - uint8_t* dst_ptr, - const struct YuvConstants* yuvconstants, - int width); --void I422ToARGB4444Row_Any_LSX(const uint8_t* y_buf, -- const uint8_t* u_buf, -- const uint8_t* v_buf, -- uint8_t* dst_ptr, -- const struct YuvConstants* yuvconstants, -- int width); - void I422ToARGB4444Row_Any_LASX(const uint8_t* y_buf, - const uint8_t* u_buf, - const uint8_t* v_buf, -@@ -5417,12 +4746,6 @@ void I422ToARGB1555Row_Any_MSA(const uin - uint8_t* dst_ptr, - const struct YuvConstants* yuvconstants, - int width); --void I422ToARGB1555Row_Any_LSX(const uint8_t* y_buf, -- const uint8_t* u_buf, -- const uint8_t* v_buf, -- uint8_t* dst_ptr, -- const struct YuvConstants* yuvconstants, -- int width); - void I422ToARGB1555Row_Any_LASX(const uint8_t* y_buf, - const uint8_t* u_buf, - const uint8_t* v_buf, -@@ -5535,18 +4858,12 @@ void YUY2ToUV422Row_NEON(const uint8_t* - uint8_t* dst_v, - int width); - void YUY2ToYRow_MSA(const uint8_t* src_yuy2, uint8_t* dst_y, int width); --void YUY2ToYRow_LSX(const uint8_t* src_yuy2, uint8_t* dst_y, int width); - void YUY2ToYRow_LASX(const uint8_t* src_yuy2, uint8_t* dst_y, int width); - void YUY2ToUVRow_MSA(const uint8_t* src_yuy2, - int src_stride_yuy2, - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void YUY2ToUVRow_LSX(const uint8_t* src_yuy2, -- int src_stride_yuy2, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void YUY2ToUVRow_LASX(const uint8_t* src_yuy2, - int src_stride_yuy2, - uint8_t* dst_u, -@@ -5556,10 +4873,6 @@ void YUY2ToUV422Row_MSA(const uint8_t* s - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void YUY2ToUV422Row_LSX(const uint8_t* src_yuy2, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void YUY2ToUV422Row_LASX(const uint8_t* src_yuy2, - uint8_t* dst_u, - uint8_t* dst_v, -@@ -5621,18 +4934,12 @@ void YUY2ToUV422Row_Any_NEON(const uint8 - uint8_t* dst_v, - int width); - void YUY2ToYRow_Any_MSA(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); --void YUY2ToYRow_Any_LSX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); - void YUY2ToYRow_Any_LASX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); - void YUY2ToUVRow_Any_MSA(const uint8_t* src_ptr, - int src_stride_ptr, - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void YUY2ToUVRow_Any_LSX(const uint8_t* src_ptr, -- int src_stride_ptr, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void YUY2ToUVRow_Any_LASX(const uint8_t* src_ptr, - int src_stride_ptr, - uint8_t* dst_u, -@@ -5642,10 +4949,6 @@ void YUY2ToUV422Row_Any_MSA(const uint8_ - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void YUY2ToUV422Row_Any_LSX(const uint8_t* src_ptr, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void YUY2ToUV422Row_Any_LASX(const uint8_t* src_ptr, - uint8_t* dst_u, - uint8_t* dst_v, -@@ -5691,18 +4994,12 @@ void UYVYToUV422Row_NEON(const uint8_t* - uint8_t* dst_v, - int width); - void UYVYToYRow_MSA(const uint8_t* src_uyvy, uint8_t* dst_y, int width); --void UYVYToYRow_LSX(const uint8_t* src_uyvy, uint8_t* dst_y, int width); - void UYVYToYRow_LASX(const uint8_t* src_uyvy, uint8_t* dst_y, int width); - void UYVYToUVRow_MSA(const uint8_t* src_uyvy, - int src_stride_uyvy, - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void UYVYToUVRow_LSX(const uint8_t* src_uyvy, -- int src_stride_uyvy, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void UYVYToUVRow_LASX(const uint8_t* src_uyvy, - int src_stride_uyvy, - uint8_t* dst_u, -@@ -5712,10 +5009,6 @@ void UYVYToUV422Row_MSA(const uint8_t* s - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void UYVYToUV422Row_LSX(const uint8_t* src_uyvy, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void UYVYToUV422Row_LASX(const uint8_t* src_uyvy, - uint8_t* dst_u, - uint8_t* dst_v, -@@ -5762,18 +5055,12 @@ void UYVYToUV422Row_Any_NEON(const uint8 - uint8_t* dst_v, - int width); - void UYVYToYRow_Any_MSA(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); --void UYVYToYRow_Any_LSX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); - void UYVYToYRow_Any_LASX(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); - void UYVYToUVRow_Any_MSA(const uint8_t* src_ptr, - int src_stride_ptr, - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void UYVYToUVRow_Any_LSX(const uint8_t* src_ptr, -- int src_stride_ptr, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void UYVYToUVRow_Any_LASX(const uint8_t* src_ptr, - int src_stride_ptr, - uint8_t* dst_u, -@@ -5783,10 +5070,6 @@ void UYVYToUV422Row_Any_MSA(const uint8_ - uint8_t* dst_u, - uint8_t* dst_v, - int width); --void UYVYToUV422Row_Any_LSX(const uint8_t* src_ptr, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width); - void UYVYToUV422Row_Any_LASX(const uint8_t* src_ptr, - uint8_t* dst_u, - uint8_t* dst_v, -@@ -5812,35 +5095,19 @@ void AYUVToUVRow_NEON(const uint8_t* src - int src_stride_ayuv, - uint8_t* dst_uv, - int width); --void AYUVToUVRow_SVE2(const uint8_t* src_ayuv, -- int src_stride_ayuv, -- uint8_t* dst_uv, -- int width); - void AYUVToVURow_NEON(const uint8_t* src_ayuv, - int src_stride_ayuv, - uint8_t* dst_vu, - int width); --void AYUVToVURow_SVE2(const uint8_t* src_ayuv, -- int src_stride_ayuv, -- uint8_t* dst_vu, -- int width); - void AYUVToYRow_Any_NEON(const uint8_t* src_ptr, uint8_t* dst_ptr, int width); - void AYUVToUVRow_Any_NEON(const uint8_t* src_ptr, - int src_stride, - uint8_t* dst_vu, - int width); --void AYUVToUVRow_Any_SVE2(const uint8_t* src_ptr, -- int src_stride, -- uint8_t* dst_vu, -- int width); - void AYUVToVURow_Any_NEON(const uint8_t* src_ptr, - int src_stride, - uint8_t* dst_vu, - int width); --void AYUVToVURow_Any_SVE2(const uint8_t* src_ptr, -- int src_stride, -- uint8_t* dst_vu, -- int width); - - void I422ToYUY2Row_C(const uint8_t* src_y, - const uint8_t* src_u, -@@ -5917,11 +5184,6 @@ void I422ToYUY2Row_MSA(const uint8_t* sr - const uint8_t* src_v, - uint8_t* dst_yuy2, - int width); --void I422ToYUY2Row_LSX(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_yuy2, -- int width); - void I422ToYUY2Row_LASX(const uint8_t* src_y, - const uint8_t* src_u, - const uint8_t* src_v, -@@ -5932,11 +5194,6 @@ void I422ToUYVYRow_MSA(const uint8_t* sr - const uint8_t* src_v, - uint8_t* dst_uyvy, - int width); --void I422ToUYVYRow_LSX(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_uyvy, -- int width); - void I422ToUYVYRow_LASX(const uint8_t* src_y, - const uint8_t* src_u, - const uint8_t* src_v, -@@ -5947,11 +5204,6 @@ void I422ToYUY2Row_Any_MSA(const uint8_t - const uint8_t* v_buf, - uint8_t* dst_ptr, - int width); --void I422ToYUY2Row_Any_LSX(const uint8_t* y_buf, -- const uint8_t* u_buf, -- const uint8_t* v_buf, -- uint8_t* dst_ptr, -- int width); - void I422ToYUY2Row_Any_LASX(const uint8_t* y_buf, - const uint8_t* u_buf, - const uint8_t* v_buf, -@@ -5962,11 +5214,6 @@ void I422ToUYVYRow_Any_MSA(const uint8_t - const uint8_t* v_buf, - uint8_t* dst_ptr, - int width); --void I422ToUYVYRow_Any_LSX(const uint8_t* y_buf, -- const uint8_t* u_buf, -- const uint8_t* v_buf, -- uint8_t* dst_ptr, -- int width); - void I422ToUYVYRow_Any_LASX(const uint8_t* y_buf, - const uint8_t* u_buf, - const uint8_t* v_buf, -@@ -5987,15 +5234,9 @@ void ARGBAttenuateRow_NEON(const uint8_t - void ARGBAttenuateRow_MSA(const uint8_t* src_argb, - uint8_t* dst_argb, - int width); --void ARGBAttenuateRow_LSX(const uint8_t* src_argb, -- uint8_t* dst_argb, -- int width); - void ARGBAttenuateRow_LASX(const uint8_t* src_argb, - uint8_t* dst_argb, - int width); --void ARGBAttenuateRow_RVV(const uint8_t* src_argb, -- uint8_t* dst_argb, -- int width); - void ARGBAttenuateRow_Any_SSSE3(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int width); -@@ -6008,9 +5249,6 @@ void ARGBAttenuateRow_Any_NEON(const uin - void ARGBAttenuateRow_Any_MSA(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int width); --void ARGBAttenuateRow_Any_LSX(const uint8_t* src_ptr, -- uint8_t* dst_ptr, -- int width); - void ARGBAttenuateRow_Any_LASX(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int width); -@@ -6037,14 +5275,12 @@ void ARGBGrayRow_C(const uint8_t* src_ar - void ARGBGrayRow_SSSE3(const uint8_t* src_argb, uint8_t* dst_argb, int width); - void ARGBGrayRow_NEON(const uint8_t* src_argb, uint8_t* dst_argb, int width); - void ARGBGrayRow_MSA(const uint8_t* src_argb, uint8_t* dst_argb, int width); --void ARGBGrayRow_LSX(const uint8_t* src_argb, uint8_t* dst_argb, int width); - void ARGBGrayRow_LASX(const uint8_t* src_argb, uint8_t* dst_argb, int width); - - void ARGBSepiaRow_C(uint8_t* dst_argb, int width); - void ARGBSepiaRow_SSSE3(uint8_t* dst_argb, int width); - void ARGBSepiaRow_NEON(uint8_t* dst_argb, int width); - void ARGBSepiaRow_MSA(uint8_t* dst_argb, int width); --void ARGBSepiaRow_LSX(uint8_t* dst_argb, int width); - void ARGBSepiaRow_LASX(uint8_t* dst_argb, int width); - - void ARGBColorMatrixRow_C(const uint8_t* src_argb, -@@ -6059,10 +5295,6 @@ void ARGBColorMatrixRow_NEON(const uint8 - uint8_t* dst_argb, - const int8_t* matrix_argb, - int width); --void ARGBColorMatrixRow_NEON_I8MM(const uint8_t* src_argb, -- uint8_t* dst_argb, -- const int8_t* matrix_argb, -- int width); - void ARGBColorMatrixRow_MSA(const uint8_t* src_argb, - uint8_t* dst_argb, - const int8_t* matrix_argb, -@@ -6128,10 +5360,6 @@ void ARGBShadeRow_MSA(const uint8_t* src - uint8_t* dst_argb, - int width, - uint32_t value); --void ARGBShadeRow_LSX(const uint8_t* src_argb, -- uint8_t* dst_argb, -- int width, -- uint32_t value); - void ARGBShadeRow_LASX(const uint8_t* src_argb, - uint8_t* dst_argb, - int width, -@@ -6204,11 +5432,6 @@ void InterpolateRow_LSX(uint8_t* dst_ptr - ptrdiff_t src_stride, - int width, - int source_y_fraction); --void InterpolateRow_RVV(uint8_t* dst_ptr, -- const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- int width, -- int source_y_fraction); - void InterpolateRow_Any_NEON(uint8_t* dst_ptr, - const uint8_t* src_ptr, - ptrdiff_t src_stride_ptr, -@@ -6516,19 +5739,7 @@ void ByteToFloatRow_Any_NEON(const uint8 - float* dst_ptr, - float param, - int width); --// Convert FP16 Half Floats to FP32 Floats --void ConvertFP16ToFP32Row_NEON(const uint16_t* src, // fp16 -- float* dst, -- int width); --// Convert a column of FP16 Half Floats to a row of FP32 Floats --void ConvertFP16ToFP32Column_NEON(const uint16_t* src, // fp16 -- int src_stride, // stride in elements -- float* dst, -- int width); --// Convert FP32 Floats to FP16 Half Floats --void ConvertFP32ToFP16Row_NEON(const float* src, -- uint16_t* dst, // fp16 -- int width); -+ - void ARGBLumaColorTableRow_C(const uint8_t* src_argb, - uint8_t* dst_argb, - int width, -diff --git a/media/libyuv/libyuv/include/libyuv/scale.h b/media/libyuv/libyuv/include/libyuv/scale.h ---- a/media/libyuv/libyuv/include/libyuv/scale.h -+++ b/media/libyuv/libyuv/include/libyuv/scale.h -@@ -27,40 +27,39 @@ typedef enum FilterMode { - } FilterModeEnum; - - // Scale a YUV plane. --// Returns 0 if successful. - LIBYUV_API --int ScalePlane(const uint8_t* src, -- int src_stride, -- int src_width, -- int src_height, -- uint8_t* dst, -- int dst_stride, -- int dst_width, -- int dst_height, -- enum FilterMode filtering); -+void ScalePlane(const uint8_t* src, -+ int src_stride, -+ int src_width, -+ int src_height, -+ uint8_t* dst, -+ int dst_stride, -+ int dst_width, -+ int dst_height, -+ enum FilterMode filtering); - - LIBYUV_API --int ScalePlane_16(const uint16_t* src, -- int src_stride, -- int src_width, -- int src_height, -- uint16_t* dst, -- int dst_stride, -- int dst_width, -- int dst_height, -- enum FilterMode filtering); -+void ScalePlane_16(const uint16_t* src, -+ int src_stride, -+ int src_width, -+ int src_height, -+ uint16_t* dst, -+ int dst_stride, -+ int dst_width, -+ int dst_height, -+ enum FilterMode filtering); - - // Sample is expected to be in the low 12 bits. - LIBYUV_API --int ScalePlane_12(const uint16_t* src, -- int src_stride, -- int src_width, -- int src_height, -- uint16_t* dst, -- int dst_stride, -- int dst_width, -- int dst_height, -- enum FilterMode filtering); -+void ScalePlane_12(const uint16_t* src, -+ int src_stride, -+ int src_width, -+ int src_height, -+ uint16_t* dst, -+ int dst_stride, -+ int dst_width, -+ int dst_height, -+ enum FilterMode filtering); - - // Scales a YUV 4:2:0 image from the src width and height to the - // dst width and height. -diff --git a/media/libyuv/libyuv/include/libyuv/scale_row.h b/media/libyuv/libyuv/include/libyuv/scale_row.h ---- a/media/libyuv/libyuv/include/libyuv/scale_row.h -+++ b/media/libyuv/libyuv/include/libyuv/scale_row.h -@@ -29,10 +29,7 @@ extern "C" { - #endif - // MemorySanitizer does not support assembly code yet. http://crbug.com/344505 - #if defined(__has_feature) --#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_NEON) --#define LIBYUV_DISABLE_NEON --#endif --#if __has_feature(memory_sanitizer) && !defined(LIBYUV_DISABLE_X86) -+#if __has_feature(memory_sanitizer) - #define LIBYUV_DISABLE_X86 - #endif - #endif -@@ -136,8 +133,6 @@ extern "C" { - #define HAS_SCALEROWDOWN34_NEON - #define HAS_SCALEROWDOWN38_NEON - #define HAS_SCALEROWDOWN4_NEON --#define HAS_SCALEUVROWDOWN2_NEON --#define HAS_SCALEUVROWDOWN2LINEAR_NEON - #define HAS_SCALEUVROWDOWN2BOX_NEON - #define HAS_SCALEUVROWDOWNEVEN_NEON - #define HAS_SCALEROWUP2_LINEAR_NEON -@@ -178,38 +173,6 @@ extern "C" { - #define HAS_SCALEROWDOWN34_LSX - #endif - --#if !defined(LIBYUV_DISABLE_RVV) && defined(__riscv_vector) --#define HAS_SCALEADDROW_RVV --// TODO: Test ScaleARGBRowDownEven_RVV and enable it --// #define HAS_SCALEARGBROWDOWNEVEN_RVV --#if defined(__riscv_zve64x) --#define HAS_SCALEUVROWDOWN4_RVV --#endif --#define HAS_SCALEUVROWDOWNEVEN_RVV --#define HAS_SCALEARGBROWDOWN2_RVV --#define HAS_SCALEARGBROWDOWN2BOX_RVV --#define HAS_SCALEARGBROWDOWN2LINEAR_RVV --#define HAS_SCALEARGBROWDOWNEVENBOX_RVV --#define HAS_SCALEROWDOWN2_RVV --#define HAS_SCALEROWDOWN2BOX_RVV --#define HAS_SCALEROWDOWN2LINEAR_RVV --#define HAS_SCALEROWDOWN34_0_BOX_RVV --#define HAS_SCALEROWDOWN34_1_BOX_RVV --#define HAS_SCALEROWDOWN34_RVV --#define HAS_SCALEROWDOWN38_2_BOX_RVV --#define HAS_SCALEROWDOWN38_3_BOX_RVV --#define HAS_SCALEROWDOWN38_RVV --#define HAS_SCALEROWDOWN4_RVV --#define HAS_SCALEROWDOWN4BOX_RVV --#define HAS_SCALEROWUP2_BILINEAR_RVV --#define HAS_SCALEROWUP2_LINEAR_RVV --#define HAS_SCALEUVROWDOWN2_RVV --#define HAS_SCALEUVROWDOWN2BOX_RVV --#define HAS_SCALEUVROWDOWN2LINEAR_RVV --#define HAS_SCALEUVROWUP2_BILINEAR_RVV --#define HAS_SCALEUVROWUP2_LINEAR_RVV --#endif -- - // Scale ARGB vertically with bilinear interpolation. - void ScalePlaneVertical(int src_height, - int dst_width, -@@ -984,18 +947,6 @@ void ScaleARGBRowDown2Box_NEON(const uin - ptrdiff_t src_stride, - uint8_t* dst, - int dst_width); --void ScaleARGBRowDown2_RVV(const uint8_t* src_argb, -- ptrdiff_t src_stride, -- uint8_t* dst_argb, -- int dst_width); --void ScaleARGBRowDown2Linear_RVV(const uint8_t* src_argb, -- ptrdiff_t src_stride, -- uint8_t* dst_argb, -- int dst_width); --void ScaleARGBRowDown2Box_RVV(const uint8_t* src_argb, -- ptrdiff_t src_stride, -- uint8_t* dst_argb, -- int dst_width); - void ScaleARGBRowDown2_MSA(const uint8_t* src_argb, - ptrdiff_t src_stride, - uint8_t* dst_argb, -@@ -1108,16 +1059,6 @@ void ScaleARGBRowDownEvenBox_LSX(const u - int src_stepx, - uint8_t* dst_argb, - int dst_width); --void ScaleARGBRowDownEven_RVV(const uint8_t* src_argb, -- ptrdiff_t src_stride, -- int32_t src_stepx, -- uint8_t* dst_argb, -- int dst_width); --void ScaleARGBRowDownEvenBox_RVV(const uint8_t* src_argb, -- ptrdiff_t src_stride, -- int src_stepx, -- uint8_t* dst_argb, -- int dst_width); - void ScaleARGBRowDownEven_Any_SSE2(const uint8_t* src_ptr, - ptrdiff_t src_stride, - int src_stepx, -@@ -1200,18 +1141,6 @@ void ScaleUVRowDown2Box_MSA(const uint8_ - ptrdiff_t src_stride, - uint8_t* dst_uv, - int dst_width); --void ScaleUVRowDown2_RVV(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- uint8_t* dst_uv, -- int dst_width); --void ScaleUVRowDown2Linear_RVV(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- uint8_t* dst_uv, -- int dst_width); --void ScaleUVRowDown2Box_RVV(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- uint8_t* dst, -- int dst_width); - void ScaleUVRowDown2_Any_SSSE3(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, -@@ -1272,16 +1201,6 @@ void ScaleUVRowDownEvenBox_NEON(const ui - int src_stepx, - uint8_t* dst_uv, - int dst_width); --void ScaleUVRowDown4_RVV(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- int32_t src_stepx, -- uint8_t* dst_uv, -- int dst_width); --void ScaleUVRowDownEven_RVV(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- int32_t src_stepx, -- uint8_t* dst_uv, -- int dst_width); - void ScaleUVRowDownEven_MSA(const uint8_t* src_ptr, - ptrdiff_t src_stride, - int32_t src_stepx, -@@ -1371,14 +1290,6 @@ void ScaleUVRowUp2_Bilinear_Any_NEON(con - uint8_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width); --void ScaleUVRowUp2_Linear_RVV(const uint8_t* src_ptr, -- uint8_t* dst_ptr, -- int dst_width); --void ScaleUVRowUp2_Bilinear_RVV(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- uint8_t* dst_ptr, -- ptrdiff_t dst_stride, -- int dst_width); - void ScaleUVRowUp2_Linear_16_SSE41(const uint16_t* src_ptr, - uint16_t* dst_ptr, - int dst_width); -@@ -1831,61 +1742,6 @@ void ScaleRowDown34_1_Box_Any_LSX(const - uint8_t* dst_ptr, - int dst_width); - --void ScaleAddRow_RVV(const uint8_t* src_ptr, uint16_t* dst_ptr, int src_width); --void ScaleRowDown2_RVV(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- uint8_t* dst, -- int dst_width); --void ScaleRowDown2Linear_RVV(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- uint8_t* dst, -- int dst_width); --void ScaleRowDown2Box_RVV(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- uint8_t* dst, -- int dst_width); -- --void ScaleRowDown4_RVV(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- uint8_t* dst_ptr, -- int dst_width); --void ScaleRowDown4Box_RVV(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- uint8_t* dst_ptr, -- int dst_width); --void ScaleRowDown34_RVV(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- uint8_t* dst_ptr, -- int dst_width); --void ScaleRowDown34_0_Box_RVV(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- uint8_t* dst_ptr, -- int dst_width); --void ScaleRowDown34_1_Box_RVV(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- uint8_t* dst_ptr, -- int dst_width); --void ScaleRowDown38_RVV(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- uint8_t* dst, -- int dst_width); --void ScaleRowDown38_3_Box_RVV(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- uint8_t* dst_ptr, -- int dst_width); --void ScaleRowDown38_2_Box_RVV(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- uint8_t* dst_ptr, -- int dst_width); -- --void ScaleRowUp2_Linear_RVV(const uint8_t* src_ptr, -- uint8_t* dst_ptr, -- int dst_width); --void ScaleRowUp2_Bilinear_RVV(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- uint8_t* dst_ptr, -- ptrdiff_t dst_stride, -- int dst_width); - #ifdef __cplusplus - } // extern "C" - } // namespace libyuv -diff --git a/media/libyuv/libyuv/include/libyuv/version.h b/media/libyuv/libyuv/include/libyuv/version.h ---- a/media/libyuv/libyuv/include/libyuv/version.h -+++ b/media/libyuv/libyuv/include/libyuv/version.h -@@ -11,6 +11,6 @@ - #ifndef INCLUDE_LIBYUV_VERSION_H_ - #define INCLUDE_LIBYUV_VERSION_H_ - --#define LIBYUV_VERSION 1889 -+#define LIBYUV_VERSION 1860 - - #endif // INCLUDE_LIBYUV_VERSION_H_ -diff --git a/media/libyuv/libyuv/infra/config/commit-queue.cfg b/media/libyuv/libyuv/infra/config/commit-queue.cfg ---- a/media/libyuv/libyuv/infra/config/commit-queue.cfg -+++ b/media/libyuv/libyuv/infra/config/commit-queue.cfg -@@ -2,7 +2,7 @@ - # Do not modify manually. - # - # For the schema of this file, see Config message: --# https://config.luci.app/schemas/projects:commit-queue.cfg -+# https://luci-config.appspot.com/schemas/projects:commit-queue.cfg - - cq_status_host: "chromium-cq-status.appspot.com" - submit_options { -diff --git a/media/libyuv/libyuv/infra/config/cr-buildbucket.cfg b/media/libyuv/libyuv/infra/config/cr-buildbucket.cfg ---- a/media/libyuv/libyuv/infra/config/cr-buildbucket.cfg -+++ b/media/libyuv/libyuv/infra/config/cr-buildbucket.cfg -@@ -2,7 +2,7 @@ - # Do not modify manually. - # - # For the schema of this file, see BuildbucketCfg message: --# https://config.luci.app/schemas/projects:buildbucket.cfg -+# https://luci-config.appspot.com/schemas/projects:buildbucket.cfg - - buckets { - name: "ci" -@@ -20,7 +20,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -29,6 +29,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -50,7 +55,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -59,6 +64,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -80,7 +90,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -89,6 +99,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -108,7 +123,7 @@ buckets { - name: "Android Tester ARM32 Debug (Nexus 5X)" - swarming_host: "chromium-swarm.appspot.com" - swarming_tags: "vpython:native-python-wrapper" -- dimensions: "device_type:walleye" -+ dimensions: "device_type:bullhead" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -117,6 +132,10 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -136,7 +155,7 @@ buckets { - name: "Android Tester ARM32 Release (Nexus 5X)" - swarming_host: "chromium-swarm.appspot.com" - swarming_tags: "vpython:native-python-wrapper" -- dimensions: "device_type:walleye" -+ dimensions: "device_type:bullhead" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -145,6 +164,10 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -164,7 +187,7 @@ buckets { - name: "Android Tester ARM64 Debug (Nexus 5X)" - swarming_host: "chromium-swarm.appspot.com" - swarming_tags: "vpython:native-python-wrapper" -- dimensions: "device_type:walleye" -+ dimensions: "device_type:bullhead" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -173,6 +196,10 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -194,7 +221,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -203,6 +230,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -224,7 +256,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -233,6 +265,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -254,7 +291,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -263,6 +300,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -284,7 +326,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -293,6 +335,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -314,7 +361,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -323,6 +370,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -344,7 +396,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -353,6 +405,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -374,7 +431,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -383,6 +440,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -404,7 +466,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -413,6 +475,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -434,7 +501,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -443,6 +510,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -464,7 +536,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -473,6 +545,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -494,7 +571,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -503,6 +580,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -523,7 +605,7 @@ buckets { - swarming_host: "chromium-swarm.appspot.com" - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cpu:x86-64" -- dimensions: "os:Mac-12" -+ dimensions: "os:Mac-10.15" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -532,6 +614,10 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -552,7 +638,7 @@ buckets { - swarming_host: "chromium-swarm.appspot.com" - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cpu:x86-64" -- dimensions: "os:Mac-12" -+ dimensions: "os:Mac-10.15" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -561,6 +647,10 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -581,7 +671,7 @@ buckets { - swarming_host: "chromium-swarm.appspot.com" - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cpu:x86-64" -- dimensions: "os:Mac-12" -+ dimensions: "os:Mac-10.15" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -590,6 +680,10 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -620,6 +714,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -650,6 +749,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -680,6 +784,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -710,6 +819,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -740,6 +854,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -770,6 +889,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -800,6 +924,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -830,6 +959,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -850,7 +984,7 @@ buckets { - swarming_host: "chromium-swarm.appspot.com" - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cpu:x86-64" -- dimensions: "os:Mac-12" -+ dimensions: "os:Mac-10.15" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -859,6 +993,10 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -879,7 +1017,7 @@ buckets { - swarming_host: "chromium-swarm.appspot.com" - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cpu:x86-64" -- dimensions: "os:Mac-12" -+ dimensions: "os:Mac-10.15" - dimensions: "pool:luci.flex.ci" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -888,6 +1026,10 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-trusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -963,7 +1105,7 @@ buckets { - name: "android" - swarming_host: "chromium-swarm.appspot.com" - swarming_tags: "vpython:native-python-wrapper" -- dimensions: "device_type:walleye" -+ dimensions: "device_type:bullhead" - dimensions: "pool:luci.flex.try" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -972,6 +1114,10 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -991,7 +1137,7 @@ buckets { - name: "android_arm64" - swarming_host: "chromium-swarm.appspot.com" - swarming_tags: "vpython:native-python-wrapper" -- dimensions: "device_type:walleye" -+ dimensions: "device_type:bullhead" - dimensions: "pool:luci.flex.try" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -1000,6 +1146,10 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1019,7 +1169,7 @@ buckets { - name: "android_rel" - swarming_host: "chromium-swarm.appspot.com" - swarming_tags: "vpython:native-python-wrapper" -- dimensions: "device_type:walleye" -+ dimensions: "device_type:bullhead" - dimensions: "pool:luci.flex.try" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -1028,6 +1178,10 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1049,7 +1203,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.try" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -1058,6 +1212,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1079,7 +1238,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.try" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -1088,6 +1247,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1108,7 +1272,7 @@ buckets { - swarming_host: "chromium-swarm.appspot.com" - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cpu:x86-64" -- dimensions: "os:Mac-12" -+ dimensions: "os:Mac-10.15" - dimensions: "pool:luci.flex.try" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -1117,6 +1281,10 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1137,7 +1305,7 @@ buckets { - swarming_host: "chromium-swarm.appspot.com" - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cpu:x86-64" -- dimensions: "os:Mac-12" -+ dimensions: "os:Mac-10.15" - dimensions: "pool:luci.flex.try" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -1146,6 +1314,10 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1167,7 +1339,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.try" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -1176,6 +1348,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1197,7 +1374,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.try" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -1206,6 +1383,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1227,7 +1409,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.try" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -1236,6 +1418,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1257,7 +1444,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.try" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -1266,6 +1453,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1287,7 +1479,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.try" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -1296,6 +1488,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1317,7 +1514,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.try" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -1326,6 +1523,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1347,7 +1549,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.try" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -1356,6 +1558,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1377,7 +1584,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.try" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -1386,6 +1593,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1406,7 +1618,7 @@ buckets { - swarming_host: "chromium-swarm.appspot.com" - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cpu:x86-64" -- dimensions: "os:Mac-12" -+ dimensions: "os:Mac-10.15" - dimensions: "pool:luci.flex.try" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -1415,6 +1627,10 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1435,7 +1651,7 @@ buckets { - swarming_host: "chromium-swarm.appspot.com" - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cpu:x86-64" -- dimensions: "os:Mac-12" -+ dimensions: "os:Mac-10.15" - dimensions: "pool:luci.flex.try" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -1444,6 +1660,10 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1464,7 +1684,7 @@ buckets { - swarming_host: "chromium-swarm.appspot.com" - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cpu:x86-64" -- dimensions: "os:Mac-12" -+ dimensions: "os:Mac-10.15" - dimensions: "pool:luci.flex.try" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -1473,6 +1693,10 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1494,7 +1718,7 @@ buckets { - swarming_tags: "vpython:native-python-wrapper" - dimensions: "cores:8" - dimensions: "cpu:x86-64" -- dimensions: "os:Ubuntu-22.04" -+ dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.flex.try" - exe { - cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" -@@ -1503,6 +1727,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": true,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1535,6 +1764,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": false,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1565,6 +1799,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": false,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1595,6 +1834,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": false,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1625,6 +1869,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": false,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1655,6 +1904,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": false,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -@@ -1685,6 +1939,11 @@ buckets { - } - properties: - '{' -+ ' "$build/goma": {' -+ ' "enable_ats": false,' -+ ' "server_host": "goma.chromium.org",' -+ ' "use_luci_auth": true' -+ ' },' - ' "$build/reclient": {' - ' "instance": "rbe-webrtc-untrusted",' - ' "metrics_project": "chromium-reclient-metrics"' -diff --git a/media/libyuv/libyuv/infra/config/luci-logdog.cfg b/media/libyuv/libyuv/infra/config/luci-logdog.cfg ---- a/media/libyuv/libyuv/infra/config/luci-logdog.cfg -+++ b/media/libyuv/libyuv/infra/config/luci-logdog.cfg -@@ -2,7 +2,7 @@ - # Do not modify manually. - # - # For the schema of this file, see ProjectConfig message: --# https://config.luci.app/schemas/projects:luci-logdog.cfg -+# https://luci-config.appspot.com/schemas/projects:luci-logdog.cfg - - reader_auth_groups: "all" - writer_auth_groups: "luci-logdog-chromium-writers" -diff --git a/media/libyuv/libyuv/infra/config/luci-milo.cfg b/media/libyuv/libyuv/infra/config/luci-milo.cfg ---- a/media/libyuv/libyuv/infra/config/luci-milo.cfg -+++ b/media/libyuv/libyuv/infra/config/luci-milo.cfg -@@ -2,7 +2,7 @@ - # Do not modify manually. - # - # For the schema of this file, see Project message: --# https://config.luci.app/schemas/projects:luci-milo.cfg -+# https://luci-config.appspot.com/schemas/projects:luci-milo.cfg - - consoles { - id: "main" -diff --git a/media/libyuv/libyuv/infra/config/luci-scheduler.cfg b/media/libyuv/libyuv/infra/config/luci-scheduler.cfg ---- a/media/libyuv/libyuv/infra/config/luci-scheduler.cfg -+++ b/media/libyuv/libyuv/infra/config/luci-scheduler.cfg -@@ -2,7 +2,7 @@ - # Do not modify manually. - # - # For the schema of this file, see ProjectConfig message: --# https://config.luci.app/schemas/projects:luci-scheduler.cfg -+# https://luci-config.appspot.com/schemas/projects:luci-scheduler.cfg - - job { - id: "Android ARM64 Debug" -diff --git a/media/libyuv/libyuv/infra/config/main.star b/media/libyuv/libyuv/infra/config/main.star ---- a/media/libyuv/libyuv/infra/config/main.star -+++ b/media/libyuv/libyuv/infra/config/main.star -@@ -8,6 +8,24 @@ lucicfg.check_version("1.30.9") - LIBYUV_GIT = "https://chromium.googlesource.com/libyuv/libyuv" - LIBYUV_GERRIT = "https://chromium-review.googlesource.com/libyuv/libyuv" - -+GOMA_BACKEND_RBE_PROD = { -+ "server_host": "goma.chromium.org", -+ "use_luci_auth": True, -+} -+ -+GOMA_BACKEND_RBE_ATS_PROD = { -+ "server_host": "goma.chromium.org", -+ "use_luci_auth": True, -+ "enable_ats": True, -+} -+ -+# Disable ATS on Windows CQ/try. -+GOMA_BACKEND_RBE_NO_ATS_PROD = { -+ "server_host": "goma.chromium.org", -+ "use_luci_auth": True, -+ "enable_ats": False, -+} -+ - RECLIENT_CI = { - "instance": "rbe-webrtc-trusted", - "metrics_project": "chromium-reclient-metrics", -@@ -62,7 +80,7 @@ luci.project( - ], - bindings = [ - luci.binding( -- roles = "role/swarming.taskTriggerer", # for LED tasks. -+ roles = "role/swarming.taskTriggerer", # for LED tasks. - groups = "project-libyuv-admins", - ), - luci.binding( -@@ -191,13 +209,26 @@ luci.bucket( - - def get_os_dimensions(os): - if os == "android": -- return {"device_type": "walleye"} -+ return {"device_type": "bullhead"} - if os == "ios" or os == "mac": -- return {"os": "Mac-12", "cpu": "x86-64"} -+ return {"os": "Mac-10.15", "cpu": "x86-64"} - elif os == "win": - return {"os": "Windows-10", "cores": "8", "cpu": "x86-64"} - elif os == "linux": -- return {"os": "Ubuntu-22.04", "cores": "8", "cpu": "x86-64"} -+ return {"os": "Ubuntu-18.04", "cores": "8", "cpu": "x86-64"} -+ return {} -+ -+def get_os_properties(os, try_builder = False): -+ if os == "android": -+ return {"$build/goma": GOMA_BACKEND_RBE_PROD} -+ elif os in ("ios", "mac"): -+ return {"$build/goma": GOMA_BACKEND_RBE_PROD} -+ elif os == "win" and try_builder: -+ return {"$build/goma": GOMA_BACKEND_RBE_NO_ATS_PROD} -+ elif os == "win": -+ return {"$build/goma": GOMA_BACKEND_RBE_ATS_PROD} -+ elif os == "linux": -+ return {"$build/goma": GOMA_BACKEND_RBE_ATS_PROD} - return {} - - def libyuv_ci_builder(name, dimensions, properties, triggered_by): -@@ -237,7 +268,8 @@ def libyuv_try_builder(name, dimensions, - - def ci_builder(name, os, category, short_name = None): - dimensions = get_os_dimensions(os) -- properties = {"$build/reclient": RECLIENT_CI} -+ properties = get_os_properties(os) -+ properties["$build/reclient"] = RECLIENT_CI - - dimensions["pool"] = "luci.flex.ci" - properties["builder_group"] = "client.libyuv" -@@ -248,7 +280,8 @@ def ci_builder(name, os, category, short - - def try_builder(name, os, experiment_percentage = None): - dimensions = get_os_dimensions(os) -- properties = {"$build/reclient": RECLIENT_CQ} -+ properties = get_os_properties(os, try_builder = True) -+ properties["$build/reclient"] = RECLIENT_CQ - - dimensions["pool"] = "luci.flex.try" - properties["builder_group"] = "tryserver.libyuv" -diff --git a/media/libyuv/libyuv/infra/config/project.cfg b/media/libyuv/libyuv/infra/config/project.cfg ---- a/media/libyuv/libyuv/infra/config/project.cfg -+++ b/media/libyuv/libyuv/infra/config/project.cfg -@@ -2,12 +2,12 @@ - # Do not modify manually. - # - # For the schema of this file, see ProjectCfg message: --# https://config.luci.app/schemas/projects:project.cfg -+# https://luci-config.appspot.com/schemas/projects:project.cfg - - name: "libyuv" - access: "group:all" - lucicfg { -- version: "1.43.6" -+ version: "1.32.1" - package_dir: "." - config_dir: "." - entry_point: "main.star" -diff --git a/media/libyuv/libyuv/infra/config/realms.cfg b/media/libyuv/libyuv/infra/config/realms.cfg ---- a/media/libyuv/libyuv/infra/config/realms.cfg -+++ b/media/libyuv/libyuv/infra/config/realms.cfg -@@ -2,7 +2,7 @@ - # Do not modify manually. - # - # For the schema of this file, see RealmsCfg message: --# https://config.luci.app/schemas/projects:realms.cfg -+# https://luci-config.appspot.com/schemas/projects:realms.cfg - - realms { - name: "@root" -diff --git a/media/libyuv/libyuv/libyuv.gni b/media/libyuv/libyuv/libyuv.gni ---- a/media/libyuv/libyuv/libyuv.gni -+++ b/media/libyuv/libyuv/libyuv.gni -@@ -7,25 +7,17 @@ - # be found in the AUTHORS file in the root of the source tree. - - import("//build/config/arm.gni") --import("//build/config/loongarch64.gni") - import("//build/config/mips.gni") - import("//build_overrides/build.gni") - - declare_args() { - libyuv_include_tests = !build_with_chromium - libyuv_disable_jpeg = false -- libyuv_disable_rvv = false - libyuv_use_neon = - current_cpu == "arm64" || - (current_cpu == "arm" && (arm_use_neon || arm_optionally_use_neon)) -- libyuv_use_sve = current_cpu == "arm64" -- libyuv_use_sme = current_cpu == "arm64" - libyuv_use_msa = - (current_cpu == "mips64el" || current_cpu == "mipsel") && mips_use_msa - libyuv_use_mmi = - (current_cpu == "mips64el" || current_cpu == "mipsel") && mips_use_mmi -- libyuv_use_lsx = -- (current_cpu == "loong64") && loongarch64_use_lsx -- libyuv_use_lasx = -- (current_cpu == "loong64") && loongarch64_use_lasx - } -diff --git a/media/libyuv/libyuv/libyuv.gyp b/media/libyuv/libyuv/libyuv.gyp ---- a/media/libyuv/libyuv/libyuv.gyp -+++ b/media/libyuv/libyuv/libyuv.gyp -@@ -71,7 +71,9 @@ - # '-mthumb', # arm32 not thumb - ], - 'cflags_mozilla!': [ -- '<@(moz_neon_cflags_block_list)', -+ '-mfpu=vfp', -+ '-mfpu=vfpv3', -+ '-mfpu=vfpv3-d16', - ], - 'conditions': [ - # Disable LTO in libyuv_neon target due to gcc 4.9 compiler bug. -@@ -160,95 +162,12 @@ - '-Wl,--dynamic-linker,/system/bin/linker', - ], - }], -- ['target_arch == "armv7" or target_arch == "arm64" and moz_have_arm_i8mm_and_dot_prod == 1 and build_with_mozilla == 1', { -- 'dependencies': [ -- ':libyuv_neon', -- ], -- }], -- ['target_arch == "arm64" and moz_have_arm_sve2 == 1 and build_with_mozilla == 1', { -- 'dependencies': [ -- ':libyuv_sve', -- ], -- 'defines' :[ -- 'LIBYUV_SVE', -- ] -- }], -- ['target_arch == "arm64" and moz_have_arm_sve2 == 1 and build_with_mozilla == 1', { -- 'dependencies': [ -- ':libyuv_sve', -- ], -- 'defines' :[ -- 'LIBYUV_SVE', -- ] -- }], - ], #conditions - }, - 'sources': [ - '<@(libyuv_sources)', - ], - }, -- { -- 'target_name': 'libyuv_neon', -- 'type': 'static_library', -- 'variables': { -- 'optimize': 'max', # enable O2 and ltcg. -- }, -- 'conditions': [ -- ['target_arch == "arm64" and moz_have_arm_i8mm_and_dot_prod == 1 and build_with_mozilla == 1', { -- 'cflags_mozilla': [ -- '-march=armv8.2-a+dotprod+i8mm', -- ], -- }], -- ['build_neon != 0', { -- 'cflags_mozilla!': [ -- '<@(moz_neon_cflags_block_list)', -- ], -- 'sources': [ -- '<@(libyuv_neon_sources)', -- ], -- }], -- ], #conditions -- 'include_dirs': [ -- 'include', -- '.', -- ], -- 'direct_dependent_settings': { -- 'include_dirs': [ -- 'include', -- '.', -- ], #conditions -- }, -- }, -- { -- 'target_name': 'libyuv_sve', -- 'type': 'static_library', -- 'variables': { -- 'optimize': 'max', # enable O2 and ltcg. -- }, -- 'conditions': [ -- ['target_arch == "arm64" and moz_have_arm_sve2 == 1 and build_with_mozilla == 1', { -- 'cflags_mozilla!': [ -- '<@(moz_neon_cflags_block_list)', -- ], -- 'cflags_mozilla': [ -- '-march=armv9-a+dotprod+sve2+i8mm', -- ], -- 'sources': [ -- '<@(libyuv_sve_sources)', -- ], -- }], -- ], #conditions -- 'include_dirs': [ -- 'include', -- '.', -- ], -- 'direct_dependent_settings': { -- 'include_dirs': [ -- 'include', -- '.', -- ], #conditions -- }, -- }, - ], # targets. - } - -diff --git a/media/libyuv/libyuv/libyuv.gypi b/media/libyuv/libyuv/libyuv.gypi ---- a/media/libyuv/libyuv/libyuv.gypi -+++ b/media/libyuv/libyuv/libyuv.gypi -@@ -8,41 +8,16 @@ - - { - 'variables': { -- 'moz_have_arm_sve2%': '<(moz_have_arm_sve2)', -- 'moz_have_arm_i8mm_and_dot_prod%': '<(moz_have_arm_i8mm_and_dot_prod)', -- 'moz_neon_cflags_block_list': [ -- '-mfpu=vfp', -- '-mfpu=vfpv3', -- '-mfpu=vfpv3-d16', -- ], -- # Needs to be reflected in upstream gyp file. -- 'libyuv_sve_sources': [ -- # sources. -- 'source/row_sve.cc', -- ], -- 'libyuv_neon_sources': [ -- # ARM Source Files -- "source/compare_neon.cc", -- "source/compare_neon64.cc", -- "source/rotate_neon.cc", -- "source/rotate_neon64.cc", -- "source/row_neon.cc", -- "source/row_neon64.cc", -- "source/scale_neon.cc", -- "source/scale_neon64.cc", -- ], - 'libyuv_sources': [ - # includes. - 'include/libyuv.h', - 'include/libyuv/basic_types.h', - 'include/libyuv/compare.h', -- 'include/libyuv/compare_row.h', - 'include/libyuv/convert.h', - 'include/libyuv/convert_argb.h', - 'include/libyuv/convert_from.h', - 'include/libyuv/convert_from_argb.h', - 'include/libyuv/cpu_id.h', -- 'include/libyuv/loongson_intrinsics.h', - 'include/libyuv/macros_msa.h', - 'include/libyuv/mjpeg_decoder.h', - 'include/libyuv/planar_functions.h', -@@ -63,6 +38,8 @@ - 'source/compare_common.cc', - 'source/compare_gcc.cc', - 'source/compare_msa.cc', -+ 'source/compare_neon.cc', -+ 'source/compare_neon64.cc', - 'source/compare_win.cc', - 'source/convert.cc', - 'source/convert_argb.cc', -@@ -81,11 +58,15 @@ - 'source/rotate_common.cc', - 'source/rotate_gcc.cc', - 'source/rotate_msa.cc', -+ 'source/rotate_neon.cc', -+ 'source/rotate_neon64.cc', - 'source/rotate_win.cc', - 'source/row_any.cc', - 'source/row_common.cc', - 'source/row_gcc.cc', - 'source/row_msa.cc', -+ 'source/row_neon.cc', -+ 'source/row_neon64.cc', - 'source/row_win.cc', - 'source/scale.cc', - 'source/scale_any.cc', -@@ -93,6 +74,8 @@ - 'source/scale_common.cc', - 'source/scale_gcc.cc', - 'source/scale_msa.cc', -+ 'source/scale_neon.cc', -+ 'source/scale_neon64.cc', - 'source/scale_rgb.cc', - 'source/scale_uv.cc', - 'source/scale_win.cc', -diff --git a/media/libyuv/libyuv/linux.mk b/media/libyuv/libyuv/linux.mk ---- a/media/libyuv/libyuv/linux.mk -+++ b/media/libyuv/libyuv/linux.mk -@@ -33,7 +33,6 @@ LOCAL_OBJ_FILES := \ - source/rotate_argb.o \ - source/rotate_common.o \ - source/rotate_gcc.o \ -- source/rotate_lsx.o \ - source/rotate_msa.o \ - source/rotate_neon.o \ - source/rotate_neon64.o \ -@@ -41,24 +40,19 @@ LOCAL_OBJ_FILES := \ - source/row_any.o \ - source/row_common.o \ - source/row_gcc.o \ -- source/row_lasx.o \ -- source/row_lsx.o \ - source/row_msa.o \ - source/row_neon.o \ - source/row_neon64.o \ -- source/row_rvv.o \ - source/row_win.o \ - source/scale.o \ - source/scale_any.o \ - source/scale_argb.o \ - source/scale_common.o \ - source/scale_gcc.o \ -- source/scale_lsx.o \ - source/scale_msa.o \ - source/scale_neon.o \ - source/scale_neon64.o \ - source/scale_rgb.o \ -- source/scale_rvv.o \ - source/scale_uv.o \ - source/scale_win.o \ - source/video_common.o -diff --git a/media/libyuv/libyuv/source/compare.cc b/media/libyuv/libyuv/source/compare.cc ---- a/media/libyuv/libyuv/source/compare.cc -+++ b/media/libyuv/libyuv/source/compare.cc -@@ -44,11 +44,6 @@ uint32_t HashDjb2(const uint8_t* src, ui - HashDjb2_SSE = HashDjb2_AVX2; - } - #endif --#if defined(HAS_HASHDJB2_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- HashDjb2_SSE = HashDjb2_NEON; -- } --#endif - - while (count >= (uint64_t)kBlockSize) { - seed = HashDjb2_SSE(src, kBlockSize, seed); -@@ -139,11 +134,6 @@ uint64_t ComputeHammingDistance(const ui - HammingDistance = HammingDistance_NEON; - } - #endif --#if defined(HAS_HAMMINGDISTANCE_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- HammingDistance = HammingDistance_NEON_DotProd; -- } --#endif - #if defined(HAS_HAMMINGDISTANCE_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - HammingDistance = HammingDistance_SSSE3; -@@ -204,11 +194,6 @@ uint64_t ComputeSumSquareError(const uin - SumSquareError = SumSquareError_NEON; - } - #endif --#if defined(HAS_SUMSQUAREERROR_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- SumSquareError = SumSquareError_NEON_DotProd; -- } --#endif - #if defined(HAS_SUMSQUAREERROR_SSE2) - if (TestCpuFlag(kCpuHasSSE2)) { - // Note only used for multiples of 16 so count is not checked. -diff --git a/media/libyuv/libyuv/source/compare_gcc.cc b/media/libyuv/libyuv/source/compare_gcc.cc ---- a/media/libyuv/libyuv/source/compare_gcc.cc -+++ b/media/libyuv/libyuv/source/compare_gcc.cc -@@ -21,15 +21,13 @@ extern "C" { - // This module is for GCC x86 and x64. - #if !defined(LIBYUV_DISABLE_X86) && (defined(__x86_64__) || defined(__i386__)) - --// "memory" clobber prevents the reads from being removed -- - #if defined(__x86_64__) - uint32_t HammingDistance_SSE42(const uint8_t* src_a, - const uint8_t* src_b, - int count) { -- uint64_t diff; -+ uint64_t diff = 0u; - -- asm volatile ( -+ asm volatile( - "xor %3,%3 \n" - "xor %%r8,%%r8 \n" - "xor %%r9,%%r9 \n" -@@ -65,9 +63,9 @@ uint32_t HammingDistance_SSE42(const uin - : "+r"(src_a), // %0 - "+r"(src_b), // %1 - "+r"(count), // %2 -- "=&r"(diff) // %3 -+ "=r"(diff) // %3 - : -- : "cc", "memory", "rcx", "rdx", "rsi", "rdi", "r8", "r9", "r10"); -+ : "memory", "cc", "rcx", "rdx", "rsi", "rdi", "r8", "r9", "r10"); - - return (uint32_t)(diff); - } -@@ -77,7 +75,7 @@ uint32_t HammingDistance_SSE42(const uin - int count) { - uint32_t diff = 0u; - -- asm volatile ( -+ asm volatile( - // Process 16 bytes per loop. - LABELALIGN - "1: \n" -@@ -106,7 +104,7 @@ uint32_t HammingDistance_SSE42(const uin - "+r"(count), // %2 - "+r"(diff) // %3 - : -- : "cc", "memory", "ecx", "edx"); -+ : "memory", "cc", "ecx", "edx"); - - return diff; - } -@@ -119,9 +117,9 @@ static const vec8 kBitCount = {0, 1, 1, - uint32_t HammingDistance_SSSE3(const uint8_t* src_a, - const uint8_t* src_b, - int count) { -- uint32_t diff; -+ uint32_t diff = 0u; - -- asm volatile ( -+ asm volatile( - "movdqa %4,%%xmm2 \n" - "movdqa %5,%%xmm3 \n" - "pxor %%xmm0,%%xmm0 \n" -@@ -168,7 +166,7 @@ uint32_t HammingDistance_SSSE3(const uin - "=r"(diff) // %3 - : "m"(kNibbleMask), // %4 - "m"(kBitCount) // %5 -- : "cc", "memory", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", -+ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", - "xmm7"); - - return diff; -@@ -178,9 +176,9 @@ uint32_t HammingDistance_SSSE3(const uin - uint32_t HammingDistance_AVX2(const uint8_t* src_a, - const uint8_t* src_b, - int count) { -- uint32_t diff; -+ uint32_t diff = 0u; - -- asm volatile ( -+ asm volatile( - "vbroadcastf128 %4,%%ymm2 \n" - "vbroadcastf128 %5,%%ymm3 \n" - "vpxor %%ymm0,%%ymm0,%%ymm0 \n" -@@ -216,7 +214,7 @@ uint32_t HammingDistance_AVX2(const uint - "vpaddd %%ymm1,%%ymm0,%%ymm0 \n" - "vpermq $0xaa,%%ymm0,%%ymm1 \n" - "vpaddd %%ymm1,%%ymm0,%%ymm0 \n" -- "vmovd %%xmm0,%3 \n" -+ "vmovd %%xmm0, %3 \n" - "vzeroupper \n" - : "+r"(src_a), // %0 - "+r"(src_b), // %1 -@@ -224,7 +222,7 @@ uint32_t HammingDistance_AVX2(const uint - "=r"(diff) // %3 - : "m"(kNibbleMask), // %4 - "m"(kBitCount) // %5 -- : "cc", "memory", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6"); -+ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6"); - - return diff; - } -@@ -234,7 +232,7 @@ uint32_t SumSquareError_SSE2(const uint8 - const uint8_t* src_b, - int count) { - uint32_t sse; -- asm volatile ( -+ asm volatile( - "pxor %%xmm0,%%xmm0 \n" - "pxor %%xmm5,%%xmm5 \n" - -@@ -263,12 +261,13 @@ uint32_t SumSquareError_SSE2(const uint8 - "pshufd $0x1,%%xmm0,%%xmm1 \n" - "paddd %%xmm1,%%xmm0 \n" - "movd %%xmm0,%3 \n" -+ - : "+r"(src_a), // %0 - "+r"(src_b), // %1 - "+r"(count), // %2 -- "=r"(sse) // %3 -- : -- : "cc", "memory", "xmm0", "xmm1", "xmm2", "xmm3", "xmm5"); -+ "=g"(sse) // %3 -+ ::"memory", -+ "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm5"); - return sse; - } - -@@ -300,7 +299,7 @@ static const uvec32 kHashMul3 = { - - uint32_t HashDjb2_SSE41(const uint8_t* src, int count, uint32_t seed) { - uint32_t hash; -- asm volatile ( -+ asm volatile( - "movd %2,%%xmm0 \n" - "pxor %%xmm7,%%xmm7 \n" - "movdqa %4,%%xmm6 \n" -@@ -342,13 +341,13 @@ uint32_t HashDjb2_SSE41(const uint8_t* s - : "+r"(src), // %0 - "+r"(count), // %1 - "+rm"(seed), // %2 -- "=r"(hash) // %3 -+ "=g"(hash) // %3 - : "m"(kHash16x33), // %4 - "m"(kHashMul0), // %5 - "m"(kHashMul1), // %6 - "m"(kHashMul2), // %7 - "m"(kHashMul3) // %8 -- : "cc", "memory", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", -+ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", - "xmm7"); - return hash; - } -diff --git a/media/libyuv/libyuv/source/compare_neon.cc b/media/libyuv/libyuv/source/compare_neon.cc ---- a/media/libyuv/libyuv/source/compare_neon.cc -+++ b/media/libyuv/libyuv/source/compare_neon.cc -@@ -28,7 +28,7 @@ uint32_t HammingDistance_NEON(const uint - int count) { - uint32_t diff; - -- asm volatile ( -+ asm volatile( - "vmov.u16 q4, #0 \n" // accumulator - - "1: \n" -@@ -58,7 +58,7 @@ uint32_t SumSquareError_NEON(const uint8 - const uint8_t* src_b, - int count) { - uint32_t sse; -- asm volatile ( -+ asm volatile( - "vmov.u8 q8, #0 \n" - "vmov.u8 q10, #0 \n" - "vmov.u8 q9, #0 \n" -diff --git a/media/libyuv/libyuv/source/compare_neon64.cc b/media/libyuv/libyuv/source/compare_neon64.cc ---- a/media/libyuv/libyuv/source/compare_neon64.cc -+++ b/media/libyuv/libyuv/source/compare_neon64.cc -@@ -26,7 +26,7 @@ uint32_t HammingDistance_NEON(const uint - const uint8_t* src_b, - int count) { - uint32_t diff; -- asm volatile ( -+ asm volatile( - "movi v4.8h, #0 \n" - - "1: \n" -@@ -47,7 +47,7 @@ uint32_t HammingDistance_NEON(const uint - "fmov %w3, s4 \n" - : "+r"(src_a), "+r"(src_b), "+r"(count), "=r"(diff) - : -- : "memory", "cc", "v0", "v1", "v2", "v3", "v4"); -+ : "cc", "v0", "v1", "v2", "v3", "v4"); - return diff; - } - -@@ -55,11 +55,11 @@ uint32_t SumSquareError_NEON(const uint8 - const uint8_t* src_b, - int count) { - uint32_t sse; -- asm volatile ( -- "movi v16.16b, #0 \n" -- "movi v17.16b, #0 \n" -- "movi v18.16b, #0 \n" -- "movi v19.16b, #0 \n" -+ asm volatile( -+ "eor v16.16b, v16.16b, v16.16b \n" -+ "eor v18.16b, v18.16b, v18.16b \n" -+ "eor v17.16b, v17.16b, v17.16b \n" -+ "eor v19.16b, v19.16b, v19.16b \n" - - "1: \n" - "ld1 {v0.16b}, [%0], #16 \n" -@@ -82,136 +82,7 @@ uint32_t SumSquareError_NEON(const uint8 - "fmov %w3, s0 \n" - : "+r"(src_a), "+r"(src_b), "+r"(count), "=r"(sse) - : -- : "memory", "cc", "v0", "v1", "v2", "v3", "v16", "v17", "v18", "v19"); -- return sse; --} -- --static const uvec32 kDjb2Multiplicands[] = { -- {0x0c3525e1, // 33^15 -- 0xa3476dc1, // 33^14 -- 0x3b4039a1, // 33^13 -- 0x4f5f0981}, // 33^12 -- {0x30f35d61, // 33^11 -- 0x855cb541, // 33^10 -- 0x040a9121, // 33^9 -- 0x747c7101}, // 33^8 -- {0xec41d4e1, // 33^7 -- 0x4cfa3cc1, // 33^6 -- 0x025528a1, // 33^5 -- 0x00121881}, // 33^4 -- {0x00008c61, // 33^3 -- 0x00000441, // 33^2 -- 0x00000021, // 33^1 -- 0x00000001}, // 33^0 --}; -- --static const uvec32 kDjb2WidenIndices[] = { -- {0xffffff00U, 0xffffff01U, 0xffffff02U, 0xffffff03U}, -- {0xffffff04U, 0xffffff05U, 0xffffff06U, 0xffffff07U}, -- {0xffffff08U, 0xffffff09U, 0xffffff0aU, 0xffffff0bU}, -- {0xffffff0cU, 0xffffff0dU, 0xffffff0eU, 0xffffff0fU}, --}; -- --uint32_t HashDjb2_NEON(const uint8_t* src, int count, uint32_t seed) { -- uint32_t hash = seed; -- const uint32_t c16 = 0x92d9e201; // 33^16 -- uint32_t tmp, tmp2; -- asm("ld1 {v16.4s, v17.4s, v18.4s, v19.4s}, [%[kIdx]] \n" -- "ld1 {v4.4s, v5.4s, v6.4s, v7.4s}, [%[kMuls]] \n" -- -- // count is always a multiple of 16. -- // maintain two accumulators, reduce and then final sum in scalar since -- // this has better performance on little cores. -- "1: \n" -- "ldr q0, [%[src]], #16 \n" -- "subs %w[count], %w[count], #16 \n" -- "tbl v3.16b, {v0.16b}, v19.16b \n" -- "tbl v2.16b, {v0.16b}, v18.16b \n" -- "tbl v1.16b, {v0.16b}, v17.16b \n" -- "tbl v0.16b, {v0.16b}, v16.16b \n" -- "mul v3.4s, v3.4s, v7.4s \n" -- "mul v2.4s, v2.4s, v6.4s \n" -- "mla v3.4s, v1.4s, v5.4s \n" -- "mla v2.4s, v0.4s, v4.4s \n" -- "addv s1, v3.4s \n" -- "addv s0, v2.4s \n" -- "fmov %w[tmp2], s1 \n" -- "fmov %w[tmp], s0 \n" -- "add %w[tmp], %w[tmp], %w[tmp2] \n" -- "madd %w[hash], %w[hash], %w[c16], %w[tmp] \n" -- "b.gt 1b \n" -- : [hash] "+r"(hash), // %[hash] -- [count] "+r"(count), // %[count] -- [tmp] "=&r"(tmp), // %[tmp] -- [tmp2] "=&r"(tmp2) // %[tmp2] -- : [src] "r"(src), // %[src] -- [kMuls] "r"(kDjb2Multiplicands), // %[kMuls] -- [kIdx] "r"(kDjb2WidenIndices), // %[kIdx] -- [c16] "r"(c16) // %[c16] -- : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", -- "v17", "v18", "v19"); -- return hash; --} -- --uint32_t HammingDistance_NEON_DotProd(const uint8_t* src_a, -- const uint8_t* src_b, -- int count) { -- uint32_t diff; -- asm volatile ( -- "movi v4.4s, #0 \n" -- "movi v5.4s, #0 \n" -- "movi v6.16b, #1 \n" -- -- "1: \n" -- "ldp q0, q1, [%0], #32 \n" -- "ldp q2, q3, [%1], #32 \n" -- "eor v0.16b, v0.16b, v2.16b \n" -- "prfm pldl1keep, [%0, 448] \n" // prefetch 7 lines ahead -- "eor v1.16b, v1.16b, v3.16b \n" -- "cnt v0.16b, v0.16b \n" -- "prfm pldl1keep, [%1, 448] \n" -- "cnt v1.16b, v1.16b \n" -- "subs %w2, %w2, #32 \n" -- "udot v4.4s, v0.16b, v6.16b \n" -- "udot v5.4s, v1.16b, v6.16b \n" -- "b.gt 1b \n" -- -- "add v0.4s, v4.4s, v5.4s \n" -- "addv s0, v0.4s \n" -- "fmov %w3, s0 \n" -- : "+r"(src_a), "+r"(src_b), "+r"(count), "=r"(diff) -- : -- : "memory", "cc", "v0", "v1", "v2", "v3", "v4", "v5", "v6"); -- return diff; --} -- --uint32_t SumSquareError_NEON_DotProd(const uint8_t* src_a, -- const uint8_t* src_b, -- int count) { -- // count is guaranteed to be a multiple of 32. -- uint32_t sse; -- asm volatile ( -- "movi v4.4s, #0 \n" -- "movi v5.4s, #0 \n" -- -- "1: \n" -- "ldp q0, q2, [%0], #32 \n" -- "ldp q1, q3, [%1], #32 \n" -- "subs %w2, %w2, #32 \n" -- "uabd v0.16b, v0.16b, v1.16b \n" -- "uabd v1.16b, v2.16b, v3.16b \n" -- "prfm pldl1keep, [%0, 448] \n" // prefetch 7 lines ahead -- "udot v4.4s, v0.16b, v0.16b \n" -- "udot v5.4s, v1.16b, v1.16b \n" -- "prfm pldl1keep, [%1, 448] \n" -- "b.gt 1b \n" -- -- "add v0.4s, v4.4s, v5.4s \n" -- "addv s0, v0.4s \n" -- "fmov %w3, s0 \n" -- : "+r"(src_a), "+r"(src_b), "+r"(count), "=r"(sse) -- : -- : "memory", "cc", "v0", "v1", "v2", "v3", "v4", "v5"); -+ : "cc", "v0", "v1", "v2", "v3", "v16", "v17", "v18", "v19"); - return sse; - } - -diff --git a/media/libyuv/libyuv/source/convert.cc b/media/libyuv/libyuv/source/convert.cc ---- a/media/libyuv/libyuv/source/convert.cc -+++ b/media/libyuv/libyuv/source/convert.cc -@@ -54,27 +54,18 @@ static int I4xxToI420(const uint8_t* src - const int dst_y_height = Abs(src_y_height); - const int dst_uv_width = SUBSAMPLE(dst_y_width, 1, 1); - const int dst_uv_height = SUBSAMPLE(dst_y_height, 1, 1); -- int r; -- if ((!src_y && dst_y) || !src_u || !src_v || !dst_u || !dst_v || -- src_y_width <= 0 || src_y_height == 0 || src_uv_width <= 0 || -- src_uv_height == 0) { -+ if (src_uv_width <= 0 || src_uv_height == 0) { - return -1; - } - if (dst_y) { -- r = ScalePlane(src_y, src_stride_y, src_y_width, src_y_height, dst_y, -- dst_stride_y, dst_y_width, dst_y_height, kFilterBilinear); -- if (r != 0) { -- return r; -- } -+ ScalePlane(src_y, src_stride_y, src_y_width, src_y_height, dst_y, -+ dst_stride_y, dst_y_width, dst_y_height, kFilterBilinear); - } -- r = ScalePlane(src_u, src_stride_u, src_uv_width, src_uv_height, dst_u, -- dst_stride_u, dst_uv_width, dst_uv_height, kFilterBilinear); -- if (r != 0) { -- return r; -- } -- r = ScalePlane(src_v, src_stride_v, src_uv_width, src_uv_height, dst_v, -- dst_stride_v, dst_uv_width, dst_uv_height, kFilterBilinear); -- return r; -+ ScalePlane(src_u, src_stride_u, src_uv_width, src_uv_height, dst_u, -+ dst_stride_u, dst_uv_width, dst_uv_height, kFilterBilinear); -+ ScalePlane(src_v, src_stride_v, src_uv_width, src_uv_height, dst_v, -+ dst_stride_v, dst_uv_width, dst_uv_height, kFilterBilinear); -+ return 0; - } - - // Copy I420 with optional flipping. -@@ -212,99 +203,6 @@ static int Planar16bitTo8bit(const uint1 - return 0; - } - --static int I41xToI420(const uint16_t* src_y, -- int src_stride_y, -- const uint16_t* src_u, -- int src_stride_u, -- const uint16_t* src_v, -- int src_stride_v, -- uint8_t* dst_y, -- int dst_stride_y, -- uint8_t* dst_u, -- int dst_stride_u, -- uint8_t* dst_v, -- int dst_stride_v, -- int width, -- int height, -- int depth) { -- const int scale = 1 << (24 - depth); -- -- if (width <= 0 || height == 0) { -- return -1; -- } -- // Negative height means invert the image. -- if (height < 0) { -- height = -height; -- src_y = src_y + (height - 1) * src_stride_y; -- src_u = src_u + (height - 1) * src_stride_u; -- src_v = src_v + (height - 1) * src_stride_v; -- src_stride_y = -src_stride_y; -- src_stride_u = -src_stride_u; -- src_stride_v = -src_stride_v; -- } -- -- { -- const int uv_width = SUBSAMPLE(width, 1, 1); -- const int uv_height = SUBSAMPLE(height, 1, 1); -- -- Convert16To8Plane(src_y, src_stride_y, dst_y, dst_stride_y, scale, width, -- height); -- ScalePlaneDown2_16To8(width, height, uv_width, uv_height, src_stride_u, -- dst_stride_u, src_u, dst_u, scale, kFilterBilinear); -- ScalePlaneDown2_16To8(width, height, uv_width, uv_height, src_stride_v, -- dst_stride_v, src_v, dst_v, scale, kFilterBilinear); -- } -- return 0; --} -- --static int I21xToI420(const uint16_t* src_y, -- int src_stride_y, -- const uint16_t* src_u, -- int src_stride_u, -- const uint16_t* src_v, -- int src_stride_v, -- uint8_t* dst_y, -- int dst_stride_y, -- uint8_t* dst_u, -- int dst_stride_u, -- uint8_t* dst_v, -- int dst_stride_v, -- int width, -- int height, -- int depth) { -- const int scale = 1 << (24 - depth); -- -- if (width <= 0 || height == 0) { -- return -1; -- } -- // Negative height means invert the image. -- if (height < 0) { -- height = -height; -- src_y = src_y + (height - 1) * src_stride_y; -- src_u = src_u + (height - 1) * src_stride_u; -- src_v = src_v + (height - 1) * src_stride_v; -- src_stride_y = -src_stride_y; -- src_stride_u = -src_stride_u; -- src_stride_v = -src_stride_v; -- } -- -- { -- const int uv_width = SUBSAMPLE(width, 1, 1); -- const int uv_height = SUBSAMPLE(height, 1, 1); -- const int dy = FixedDiv(height, uv_height); -- -- Convert16To8Plane(src_y, src_stride_y, dst_y, dst_stride_y, scale, width, -- height); -- ScalePlaneVertical_16To8(height, uv_width, uv_height, src_stride_u, -- dst_stride_u, src_u, dst_u, 0, 32768, dy, -- /*bpp=*/1, scale, kFilterBilinear); -- ScalePlaneVertical_16To8(height, uv_width, uv_height, src_stride_v, -- dst_stride_v, src_v, dst_v, 0, 32768, dy, -- /*bpp=*/1, scale, kFilterBilinear); -- } -- return 0; --} -- - // Convert 10 bit YUV to 8 bit. - LIBYUV_API - int I010ToI420(const uint16_t* src_y, -@@ -342,9 +240,38 @@ int I210ToI420(const uint16_t* src_y, - int dst_stride_v, - int width, - int height) { -- return I21xToI420(src_y, src_stride_y, src_u, src_stride_u, src_v, -- src_stride_v, dst_y, dst_stride_y, dst_u, dst_stride_u, -- dst_v, dst_stride_v, width, height, 10); -+ const int depth = 10; -+ const int scale = 1 << (24 - depth); -+ -+ if (width <= 0 || height == 0) { -+ return -1; -+ } -+ // Negative height means invert the image. -+ if (height < 0) { -+ height = -height; -+ src_y = src_y + (height - 1) * src_stride_y; -+ src_u = src_u + (height - 1) * src_stride_u; -+ src_v = src_v + (height - 1) * src_stride_v; -+ src_stride_y = -src_stride_y; -+ src_stride_u = -src_stride_u; -+ src_stride_v = -src_stride_v; -+ } -+ -+ { -+ const int uv_width = SUBSAMPLE(width, 1, 1); -+ const int uv_height = SUBSAMPLE(height, 1, 1); -+ const int dy = FixedDiv(height, uv_height); -+ -+ Convert16To8Plane(src_y, src_stride_y, dst_y, dst_stride_y, scale, width, -+ height); -+ ScalePlaneVertical_16To8(height, uv_width, uv_height, src_stride_u, -+ dst_stride_u, src_u, dst_u, 0, 32768, dy, -+ /*bpp=*/1, scale, kFilterBilinear); -+ ScalePlaneVertical_16To8(height, uv_width, uv_height, src_stride_v, -+ dst_stride_v, src_v, dst_v, 0, 32768, dy, -+ /*bpp=*/1, scale, kFilterBilinear); -+ } -+ return 0; - } - - LIBYUV_API -@@ -383,9 +310,35 @@ int I410ToI420(const uint16_t* src_y, - int dst_stride_v, - int width, - int height) { -- return I41xToI420(src_y, src_stride_y, src_u, src_stride_u, src_v, -- src_stride_v, dst_y, dst_stride_y, dst_u, dst_stride_u, -- dst_v, dst_stride_v, width, height, 10); -+ const int depth = 10; -+ const int scale = 1 << (24 - depth); -+ -+ if (width <= 0 || height == 0) { -+ return -1; -+ } -+ // Negative height means invert the image. -+ if (height < 0) { -+ height = -height; -+ src_y = src_y + (height - 1) * src_stride_y; -+ src_u = src_u + (height - 1) * src_stride_u; -+ src_v = src_v + (height - 1) * src_stride_v; -+ src_stride_y = -src_stride_y; -+ src_stride_u = -src_stride_u; -+ src_stride_v = -src_stride_v; -+ } -+ -+ { -+ const int uv_width = SUBSAMPLE(width, 1, 1); -+ const int uv_height = SUBSAMPLE(height, 1, 1); -+ -+ Convert16To8Plane(src_y, src_stride_y, dst_y, dst_stride_y, scale, width, -+ height); -+ ScalePlaneDown2_16To8(width, height, uv_width, uv_height, src_stride_u, -+ dst_stride_u, src_u, dst_u, scale, kFilterBilinear); -+ ScalePlaneDown2_16To8(width, height, uv_width, uv_height, src_stride_v, -+ dst_stride_v, src_v, dst_v, scale, kFilterBilinear); -+ } -+ return 0; - } - - LIBYUV_API -@@ -452,26 +405,6 @@ int I212ToI422(const uint16_t* src_y, - } - - LIBYUV_API --int I212ToI420(const uint16_t* src_y, -- int src_stride_y, -- const uint16_t* src_u, -- int src_stride_u, -- const uint16_t* src_v, -- int src_stride_v, -- uint8_t* dst_y, -- int dst_stride_y, -- uint8_t* dst_u, -- int dst_stride_u, -- uint8_t* dst_v, -- int dst_stride_v, -- int width, -- int height) { -- return I21xToI420(src_y, src_stride_y, src_u, src_stride_u, src_v, -- src_stride_v, dst_y, dst_stride_y, dst_u, dst_stride_u, -- dst_v, dst_stride_v, width, height, 12); --} -- --LIBYUV_API - int I412ToI444(const uint16_t* src_y, - int src_stride_y, - const uint16_t* src_u, -@@ -492,26 +425,6 @@ int I412ToI444(const uint16_t* src_y, - 0, 12); - } - --LIBYUV_API --int I412ToI420(const uint16_t* src_y, -- int src_stride_y, -- const uint16_t* src_u, -- int src_stride_u, -- const uint16_t* src_v, -- int src_stride_v, -- uint8_t* dst_y, -- int dst_stride_y, -- uint8_t* dst_u, -- int dst_stride_u, -- uint8_t* dst_v, -- int dst_stride_v, -- int width, -- int height) { -- return I41xToI420(src_y, src_stride_y, src_u, src_stride_u, src_v, -- src_stride_v, dst_y, dst_stride_y, dst_u, dst_stride_u, -- dst_v, dst_stride_v, width, height, 12); --} -- - // Any Ix10 To I010 format with mirroring. - static int Ix10ToI010(const uint16_t* src_y, - int src_stride_y, -@@ -535,25 +448,18 @@ static int Ix10ToI010(const uint16_t* sr - const int src_uv_height = SUBSAMPLE(height, subsample_y, subsample_y); - const int dst_uv_width = SUBSAMPLE(dst_y_width, 1, 1); - const int dst_uv_height = SUBSAMPLE(dst_y_height, 1, 1); -- int r; - if (width <= 0 || height == 0) { - return -1; - } - if (dst_y) { -- r = ScalePlane_12(src_y, src_stride_y, width, height, dst_y, dst_stride_y, -- dst_y_width, dst_y_height, kFilterBilinear); -- if (r != 0) { -- return r; -- } -+ ScalePlane_12(src_y, src_stride_y, width, height, dst_y, dst_stride_y, -+ dst_y_width, dst_y_height, kFilterBilinear); - } -- r = ScalePlane_12(src_u, src_stride_u, src_uv_width, src_uv_height, dst_u, -- dst_stride_u, dst_uv_width, dst_uv_height, kFilterBilinear); -- if (r != 0) { -- return r; -- } -- r = ScalePlane_12(src_v, src_stride_v, src_uv_width, src_uv_height, dst_v, -- dst_stride_v, dst_uv_width, dst_uv_height, kFilterBilinear); -- return r; -+ ScalePlane_12(src_u, src_stride_u, src_uv_width, src_uv_height, dst_u, -+ dst_stride_u, dst_uv_width, dst_uv_height, kFilterBilinear); -+ ScalePlane_12(src_v, src_stride_v, src_uv_width, src_uv_height, dst_v, -+ dst_stride_v, dst_uv_width, dst_uv_height, kFilterBilinear); -+ return 0; - } - - LIBYUV_API -@@ -793,8 +699,6 @@ int I422ToNV21(const uint8_t* src_y, - // Allocate u and v buffers - align_buffer_64(plane_u, halfwidth * halfheight * 2); - uint8_t* plane_v = plane_u + halfwidth * halfheight; -- if (!plane_u) -- return 1; - - I422ToI420(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, - dst_y, dst_stride_y, plane_u, halfwidth, plane_v, halfwidth, width, -@@ -897,9 +801,10 @@ int MT2TToP010(const uint8_t* src_y, - } - - { -- int uv_width = (width + 1) & ~1; -- int uv_height = (height + 1) / 2; -+ int u_width = (width + 1) / 2; -+ int uv_width = 2 * u_width; - int y = 0; -+ int uv_height = uv_height = (height + 1) / 2; - const int tile_width = 16; - const int y_tile_height = 32; - const int uv_tile_height = 16; -@@ -910,8 +815,6 @@ int MT2TToP010(const uint8_t* src_y, - void (*UnpackMT2T)(const uint8_t* src, uint16_t* dst, size_t size) = - UnpackMT2T_C; - align_buffer_64(row_buf, row_buf_size); -- if (!row_buf) -- return 1; - - #if defined(HAS_UNPACKMT2T_NEON) - if (TestCpuFlag(kCpuHasNEON)) { -@@ -1016,7 +919,7 @@ int I422ToNV21(const uint8_t* src_y, - #if defined(HAS_MERGEUVROW_AVX2) - if (TestCpuFlag(kCpuHasAVX2)) { - MergeUVRow = MergeUVRow_Any_AVX2; -- if (IS_ALIGNED(halfwidth, 16)) { -+ if (IS_ALIGNED(halfwidth, 32)) { - MergeUVRow = MergeUVRow_AVX2; - } - } -@@ -1053,11 +956,6 @@ int I422ToNV21(const uint8_t* src_y, - } - } - #endif --#if defined(HAS_MERGEUVROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- MergeUVRow = MergeUVRow_RVV; -- } --#endif - #if defined(HAS_INTERPOLATEROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - InterpolateRow = InterpolateRow_Any_SSSE3; -@@ -1098,11 +996,6 @@ int I422ToNV21(const uint8_t* src_y, - } - } - #endif --#if defined(HAS_INTERPOLATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- InterpolateRow = InterpolateRow_RVV; -- } --#endif - - if (dst_y) { - CopyPlane(src_y, src_stride_y, dst_y, dst_stride_y, halfwidth, height); -@@ -1112,8 +1005,6 @@ int I422ToNV21(const uint8_t* src_y, - int awidth = halfwidth * 2; - align_buffer_64(row_vu_0, awidth * 2); - uint8_t* row_vu_1 = row_vu_0 + awidth; -- if (!row_vu_0) -- return 1; - - for (y = 0; y < height - 1; y += 2) { - MergeUVRow(src_v, src_u, row_vu_0, halfwidth); -@@ -1352,22 +1243,18 @@ int NV12ToNV24(const uint8_t* src_y, - int dst_stride_uv, - int width, - int height) { -- int r; - if (width <= 0 || height == 0) { - return -1; - } - - if (dst_y) { -- r = ScalePlane(src_y, src_stride_y, width, height, dst_y, dst_stride_y, -- Abs(width), Abs(height), kFilterBilinear); -- if (r != 0) { -- return r; -- } -+ ScalePlane(src_y, src_stride_y, width, height, dst_y, dst_stride_y, -+ Abs(width), Abs(height), kFilterBilinear); - } -- r = UVScale(src_uv, src_stride_uv, SUBSAMPLE(width, 1, 1), -- SUBSAMPLE(height, 1, 1), dst_uv, dst_stride_uv, Abs(width), -- Abs(height), kFilterBilinear); -- return r; -+ UVScale(src_uv, src_stride_uv, SUBSAMPLE(width, 1, 1), -+ SUBSAMPLE(height, 1, 1), dst_uv, dst_stride_uv, Abs(width), -+ Abs(height), kFilterBilinear); -+ return 0; - } - - LIBYUV_API -@@ -1381,21 +1268,17 @@ int NV16ToNV24(const uint8_t* src_y, - int dst_stride_uv, - int width, - int height) { -- int r; - if (width <= 0 || height == 0) { - return -1; - } - - if (dst_y) { -- r = ScalePlane(src_y, src_stride_y, width, height, dst_y, dst_stride_y, -- Abs(width), Abs(height), kFilterBilinear); -- if (r != 0) { -- return r; -- } -+ ScalePlane(src_y, src_stride_y, width, height, dst_y, dst_stride_y, -+ Abs(width), Abs(height), kFilterBilinear); - } -- r = UVScale(src_uv, src_stride_uv, SUBSAMPLE(width, 1, 1), height, dst_uv, -- dst_stride_uv, Abs(width), Abs(height), kFilterBilinear); -- return r; -+ UVScale(src_uv, src_stride_uv, SUBSAMPLE(width, 1, 1), height, dst_uv, -+ dst_stride_uv, Abs(width), Abs(height), kFilterBilinear); -+ return 0; - } - - // Any P[420]1[02] to I[420]1[02] format with mirroring. -@@ -1473,22 +1356,18 @@ int P010ToP410(const uint16_t* src_y, - int dst_stride_uv, - int width, - int height) { -- int r; - if (width <= 0 || height == 0) { - return -1; - } - - if (dst_y) { -- r = ScalePlane_16(src_y, src_stride_y, width, height, dst_y, dst_stride_y, -- Abs(width), Abs(height), kFilterBilinear); -- if (r != 0) { -- return r; -- } -+ ScalePlane_16(src_y, src_stride_y, width, height, dst_y, dst_stride_y, -+ Abs(width), Abs(height), kFilterBilinear); - } -- r = UVScale_16(src_uv, src_stride_uv, SUBSAMPLE(width, 1, 1), -- SUBSAMPLE(height, 1, 1), dst_uv, dst_stride_uv, Abs(width), -- Abs(height), kFilterBilinear); -- return r; -+ UVScale_16(src_uv, src_stride_uv, SUBSAMPLE(width, 1, 1), -+ SUBSAMPLE(height, 1, 1), dst_uv, dst_stride_uv, Abs(width), -+ Abs(height), kFilterBilinear); -+ return 0; - } - - LIBYUV_API -@@ -1502,21 +1381,17 @@ int P210ToP410(const uint16_t* src_y, - int dst_stride_uv, - int width, - int height) { -- int r; - if (width <= 0 || height == 0) { - return -1; - } - - if (dst_y) { -- r = ScalePlane_16(src_y, src_stride_y, width, height, dst_y, dst_stride_y, -- Abs(width), Abs(height), kFilterBilinear); -- if (r != 0) { -- return r; -- } -+ ScalePlane_16(src_y, src_stride_y, width, height, dst_y, dst_stride_y, -+ Abs(width), Abs(height), kFilterBilinear); - } -- r = UVScale_16(src_uv, src_stride_uv, SUBSAMPLE(width, 1, 1), height, dst_uv, -- dst_stride_uv, Abs(width), Abs(height), kFilterBilinear); -- return r; -+ UVScale_16(src_uv, src_stride_uv, SUBSAMPLE(width, 1, 1), height, dst_uv, -+ dst_stride_uv, Abs(width), Abs(height), kFilterBilinear); -+ return 0; - } - - // Convert YUY2 to I420. -@@ -1583,16 +1458,6 @@ int YUY2ToI420(const uint8_t* src_yuy2, - } - } - #endif --#if defined(HAS_YUY2TOYROW_LSX) && defined(HAS_YUY2TOUVROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- YUY2ToYRow = YUY2ToYRow_Any_LSX; -- YUY2ToUVRow = YUY2ToUVRow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- YUY2ToYRow = YUY2ToYRow_LSX; -- YUY2ToUVRow = YUY2ToUVRow_LSX; -- } -- } --#endif - #if defined(HAS_YUY2TOYROW_LASX) && defined(HAS_YUY2TOUVROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - YUY2ToYRow = YUY2ToYRow_Any_LASX; -@@ -1684,26 +1549,6 @@ int UYVYToI420(const uint8_t* src_uyvy, - } - } - #endif --#if defined(HAS_UYVYTOYROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- UYVYToYRow = UYVYToYRow_Any_LSX; -- UYVYToUVRow = UYVYToUVRow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- UYVYToYRow = UYVYToYRow_LSX; -- UYVYToUVRow = UYVYToUVRow_LSX; -- } -- } --#endif --#if defined(HAS_UYVYTOYROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- UYVYToYRow = UYVYToYRow_Any_LSX; -- UYVYToUVRow = UYVYToUVRow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- UYVYToYRow = UYVYToYRow_LSX; -- UYVYToUVRow = UYVYToUVRow_LSX; -- } -- } --#endif - #if defined(HAS_UYVYTOYROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - UYVYToYRow = UYVYToYRow_Any_LASX; -@@ -1784,14 +1629,6 @@ int AYUVToNV12(const uint8_t* src_ayuv, - } - } - #endif --#if defined(HAS_AYUVTOUVROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- AYUVToUVRow = AYUVToUVRow_Any_SVE2; -- if (IS_ALIGNED(width, 2)) { -- AYUVToUVRow = AYUVToUVRow_SVE2; -- } -- } --#endif - - for (y = 0; y < height - 1; y += 2) { - AYUVToUVRow(src_ayuv, src_stride_ayuv, dst_uv, width); -@@ -1861,14 +1698,6 @@ int AYUVToNV21(const uint8_t* src_ayuv, - } - } - #endif --#if defined(HAS_AYUVTOVUROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- AYUVToVURow = AYUVToVURow_Any_SVE2; -- if (IS_ALIGNED(width, 2)) { -- AYUVToVURow = AYUVToVURow_SVE2; -- } -- } --#endif - - for (y = 0; y < height - 1; y += 2) { - AYUVToVURow(src_ayuv, src_stride_ayuv, dst_vu, width); -@@ -1920,14 +1749,6 @@ int ARGBToI420(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYROW_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- ARGBToYRow = ARGBToYRow_Any_NEON_DotProd; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYRow = ARGBToYRow_NEON_DotProd; -- } -- } --#endif - #if defined(HAS_ARGBTOUVROW_NEON) - if (TestCpuFlag(kCpuHasNEON)) { - ARGBToUVRow = ARGBToUVRow_Any_NEON; -@@ -1936,192 +1757,6 @@ int ARGBToI420(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOUVROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- ARGBToUVRow = ARGBToUVRow_Any_SVE2; -- if (IS_ALIGNED(width, 2)) { -- ARGBToUVRow = ARGBToUVRow_SVE2; -- } -- } --#endif --#if defined(HAS_ARGBTOYROW_SSSE3) -- if (TestCpuFlag(kCpuHasSSSE3)) { -- ARGBToYRow = ARGBToYRow_Any_SSSE3; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYRow = ARGBToYRow_SSSE3; -- } -- } --#endif --#if defined(HAS_ARGBTOUVROW_SSSE3) -- if (TestCpuFlag(kCpuHasSSSE3)) { -- ARGBToUVRow = ARGBToUVRow_Any_SSSE3; -- if (IS_ALIGNED(width, 16)) { -- ARGBToUVRow = ARGBToUVRow_SSSE3; -- } -- } --#endif --#if defined(HAS_ARGBTOYROW_AVX2) -- if (TestCpuFlag(kCpuHasAVX2)) { -- ARGBToYRow = ARGBToYRow_Any_AVX2; -- if (IS_ALIGNED(width, 32)) { -- ARGBToYRow = ARGBToYRow_AVX2; -- } -- } --#endif --#if defined(HAS_ARGBTOUVROW_AVX2) -- if (TestCpuFlag(kCpuHasAVX2)) { -- ARGBToUVRow = ARGBToUVRow_Any_AVX2; -- if (IS_ALIGNED(width, 32)) { -- ARGBToUVRow = ARGBToUVRow_AVX2; -- } -- } --#endif --#if defined(HAS_ARGBTOYROW_MSA) && defined(HAS_ARGBTOUVROW_MSA) -- if (TestCpuFlag(kCpuHasMSA)) { -- ARGBToYRow = ARGBToYRow_Any_MSA; -- ARGBToUVRow = ARGBToUVRow_Any_MSA; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYRow = ARGBToYRow_MSA; -- } -- if (IS_ALIGNED(width, 32)) { -- ARGBToUVRow = ARGBToUVRow_MSA; -- } -- } --#endif --#if defined(HAS_ARGBTOYROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBToYRow = ARGBToYRow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYRow = ARGBToYRow_LSX; -- } -- } --#endif --#if defined(HAS_ARGBTOYROW_LSX) && defined(HAS_ARGBTOUVROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBToYRow = ARGBToYRow_Any_LSX; -- ARGBToUVRow = ARGBToUVRow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYRow = ARGBToYRow_LSX; -- ARGBToUVRow = ARGBToUVRow_LSX; -- } -- } --#endif --#if defined(HAS_ARGBTOYROW_LASX) && defined(HAS_ARGBTOUVROW_LASX) -- if (TestCpuFlag(kCpuHasLASX)) { -- ARGBToYRow = ARGBToYRow_Any_LASX; -- ARGBToUVRow = ARGBToUVRow_Any_LASX; -- if (IS_ALIGNED(width, 32)) { -- ARGBToYRow = ARGBToYRow_LASX; -- ARGBToUVRow = ARGBToUVRow_LASX; -- } -- } --#endif -- -- for (y = 0; y < height - 1; y += 2) { -- ARGBToUVRow(src_argb, src_stride_argb, dst_u, dst_v, width); -- ARGBToYRow(src_argb, dst_y, width); -- ARGBToYRow(src_argb + src_stride_argb, dst_y + dst_stride_y, width); -- src_argb += src_stride_argb * 2; -- dst_y += dst_stride_y * 2; -- dst_u += dst_stride_u; -- dst_v += dst_stride_v; -- } -- if (height & 1) { -- ARGBToUVRow(src_argb, 0, dst_u, dst_v, width); -- ARGBToYRow(src_argb, dst_y, width); -- } -- return 0; --} -- --#ifdef USE_EXTRACTALPHA --// Convert ARGB to I420 with Alpha --// The following version calls ARGBExtractAlpha on the full image. --LIBYUV_API --int ARGBToI420Alpha(const uint8_t* src_argb, -- int src_stride_argb, -- uint8_t* dst_y, -- int dst_stride_y, -- uint8_t* dst_u, -- int dst_stride_u, -- uint8_t* dst_v, -- int dst_stride_v, -- uint8_t* dst_a, -- int dst_stride_a, -- int width, -- int height) { -- int r = ARGBToI420(src_argb, src_stride_argb, dst_y, dst_stride_y, dst_u, -- dst_stride_u, dst_v, dst_stride_v, width, height); -- if (r == 0) { -- r = ARGBExtractAlpha(src_argb, src_stride_argb, dst_a, dst_stride_a, width, -- height); -- } -- return r; --} --#else // USE_EXTRACTALPHA --// Convert ARGB to I420 with Alpha --LIBYUV_API --int ARGBToI420Alpha(const uint8_t* src_argb, -- int src_stride_argb, -- uint8_t* dst_y, -- int dst_stride_y, -- uint8_t* dst_u, -- int dst_stride_u, -- uint8_t* dst_v, -- int dst_stride_v, -- uint8_t* dst_a, -- int dst_stride_a, -- int width, -- int height) { -- int y; -- void (*ARGBToUVRow)(const uint8_t* src_argb0, int src_stride_argb, -- uint8_t* dst_u, uint8_t* dst_v, int width) = -- ARGBToUVRow_C; -- void (*ARGBToYRow)(const uint8_t* src_argb, uint8_t* dst_y, int width) = -- ARGBToYRow_C; -- void (*ARGBExtractAlphaRow)(const uint8_t* src_argb, uint8_t* dst_a, -- int width) = ARGBExtractAlphaRow_C; -- if (!src_argb || !dst_y || !dst_u || !dst_v || !dst_a || width <= 0 || -- height == 0) { -- return -1; -- } -- // Negative height means invert the image. -- if (height < 0) { -- height = -height; -- src_argb = src_argb + (height - 1) * src_stride_argb; -- src_stride_argb = -src_stride_argb; -- } --#if defined(HAS_ARGBTOYROW_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- ARGBToYRow = ARGBToYRow_Any_NEON; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYRow = ARGBToYRow_NEON; -- } -- } --#endif --#if defined(HAS_ARGBTOYROW_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- ARGBToYRow = ARGBToYRow_Any_NEON_DotProd; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYRow = ARGBToYRow_NEON_DotProd; -- } -- } --#endif --#if defined(HAS_ARGBTOUVROW_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- ARGBToUVRow = ARGBToUVRow_Any_NEON; -- if (IS_ALIGNED(width, 16)) { -- ARGBToUVRow = ARGBToUVRow_NEON; -- } -- } --#endif --#if defined(HAS_ARGBTOUVROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- ARGBToUVRow = ARGBToUVRow_Any_SVE2; -- if (IS_ALIGNED(width, 2)) { -- ARGBToUVRow = ARGBToUVRow_SVE2; -- } -- } --#endif - #if defined(HAS_ARGBTOYROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - ARGBToYRow = ARGBToYRow_Any_SSSE3; -@@ -2184,63 +1819,22 @@ int ARGBToI420Alpha(const uint8_t* src_a - } - } - #endif --#if defined(HAS_ARGBEXTRACTALPHAROW_SSE2) -- if (TestCpuFlag(kCpuHasSSE2)) { -- ARGBExtractAlphaRow = IS_ALIGNED(width, 8) ? ARGBExtractAlphaRow_SSE2 -- : ARGBExtractAlphaRow_Any_SSE2; -- } --#endif --#if defined(HAS_ARGBEXTRACTALPHAROW_AVX2) -- if (TestCpuFlag(kCpuHasAVX2)) { -- ARGBExtractAlphaRow = IS_ALIGNED(width, 32) ? ARGBExtractAlphaRow_AVX2 -- : ARGBExtractAlphaRow_Any_AVX2; -- } --#endif --#if defined(HAS_ARGBEXTRACTALPHAROW_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- ARGBExtractAlphaRow = IS_ALIGNED(width, 16) ? ARGBExtractAlphaRow_NEON -- : ARGBExtractAlphaRow_Any_NEON; -- } --#endif --#if defined(HAS_ARGBEXTRACTALPHAROW_MSA) -- if (TestCpuFlag(kCpuHasMSA)) { -- ARGBExtractAlphaRow = IS_ALIGNED(width, 16) ? ARGBExtractAlphaRow_MSA -- : ARGBExtractAlphaRow_Any_MSA; -- } --#endif --#if defined(HAS_ARGBEXTRACTALPHAROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBExtractAlphaRow = IS_ALIGNED(width, 16) ? ARGBExtractAlphaRow_LSX -- : ARGBExtractAlphaRow_Any_LSX; -- } --#endif --#if defined(HAS_ARGBEXTRACTALPHAROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBExtractAlphaRow = ARGBExtractAlphaRow_RVV; -- } --#endif - - for (y = 0; y < height - 1; y += 2) { - ARGBToUVRow(src_argb, src_stride_argb, dst_u, dst_v, width); - ARGBToYRow(src_argb, dst_y, width); - ARGBToYRow(src_argb + src_stride_argb, dst_y + dst_stride_y, width); -- ARGBExtractAlphaRow(src_argb, dst_a, width); -- ARGBExtractAlphaRow(src_argb + src_stride_argb, dst_a + dst_stride_a, -- width); - src_argb += src_stride_argb * 2; - dst_y += dst_stride_y * 2; - dst_u += dst_stride_u; - dst_v += dst_stride_v; -- dst_a += dst_stride_a * 2; - } - if (height & 1) { - ARGBToUVRow(src_argb, 0, dst_u, dst_v, width); - ARGBToYRow(src_argb, dst_y, width); -- ARGBExtractAlphaRow(src_argb, dst_a, width); - } - return 0; - } --#endif // USE_EXTRACTALPHA - - // Convert BGRA to I420. - LIBYUV_API -@@ -2277,14 +1871,6 @@ int BGRAToI420(const uint8_t* src_bgra, - } - } - #endif --#if defined(HAS_BGRATOYROW_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- BGRAToYRow = BGRAToYRow_Any_NEON_DotProd; -- if (IS_ALIGNED(width, 16)) { -- BGRAToYRow = BGRAToYRow_NEON_DotProd; -- } -- } --#endif - #if defined(HAS_BGRATOUVROW_NEON) - if (TestCpuFlag(kCpuHasNEON)) { - BGRAToUVRow = BGRAToUVRow_Any_NEON; -@@ -2293,14 +1879,6 @@ int BGRAToI420(const uint8_t* src_bgra, - } - } - #endif --#if defined(HAS_BGRATOUVROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- BGRAToUVRow = BGRAToUVRow_Any_SVE2; -- if (IS_ALIGNED(width, 2)) { -- BGRAToUVRow = BGRAToUVRow_SVE2; -- } -- } --#endif - #if defined(HAS_BGRATOYROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - BGRAToYRow = BGRAToYRow_Any_SSSE3; -@@ -2363,11 +1941,6 @@ int BGRAToI420(const uint8_t* src_bgra, - } - } - #endif --#if defined(HAS_BGRATOYROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- BGRAToYRow = BGRAToYRow_RVV; -- } --#endif - - for (y = 0; y < height - 1; y += 2) { - BGRAToUVRow(src_bgra, src_stride_bgra, dst_u, dst_v, width); -@@ -2452,14 +2025,6 @@ int ABGRToI420(const uint8_t* src_abgr, - } - } - #endif --#if defined(HAS_ABGRTOYROW_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- ABGRToYRow = ABGRToYRow_Any_NEON_DotProd; -- if (IS_ALIGNED(width, 16)) { -- ABGRToYRow = ABGRToYRow_NEON_DotProd; -- } -- } --#endif - #if defined(HAS_ABGRTOUVROW_NEON) - if (TestCpuFlag(kCpuHasNEON)) { - ABGRToUVRow = ABGRToUVRow_Any_NEON; -@@ -2468,14 +2033,6 @@ int ABGRToI420(const uint8_t* src_abgr, - } - } - #endif --#if defined(HAS_ABGRTOUVROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- ABGRToUVRow = ABGRToUVRow_Any_SVE2; -- if (IS_ALIGNED(width, 2)) { -- ABGRToUVRow = ABGRToUVRow_SVE2; -- } -- } --#endif - #if defined(HAS_ABGRTOYROW_MSA) && defined(HAS_ABGRTOUVROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - ABGRToYRow = ABGRToYRow_Any_MSA; -@@ -2504,11 +2061,6 @@ int ABGRToI420(const uint8_t* src_abgr, - } - } - #endif --#if defined(HAS_ABGRTOYROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ABGRToYRow = ABGRToYRow_RVV; -- } --#endif - - for (y = 0; y < height - 1; y += 2) { - ABGRToUVRow(src_abgr, src_stride_abgr, dst_u, dst_v, width); -@@ -2577,14 +2129,6 @@ int RGBAToI420(const uint8_t* src_rgba, - } - } - #endif --#if defined(HAS_RGBATOYROW_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- RGBAToYRow = RGBAToYRow_Any_NEON_DotProd; -- if (IS_ALIGNED(width, 16)) { -- RGBAToYRow = RGBAToYRow_NEON_DotProd; -- } -- } --#endif - #if defined(HAS_RGBATOUVROW_NEON) - if (TestCpuFlag(kCpuHasNEON)) { - RGBAToUVRow = RGBAToUVRow_Any_NEON; -@@ -2593,14 +2137,6 @@ int RGBAToI420(const uint8_t* src_rgba, - } - } - #endif --#if defined(HAS_RGBATOUVROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- RGBAToUVRow = RGBAToUVRow_Any_SVE2; -- if (IS_ALIGNED(width, 2)) { -- RGBAToUVRow = RGBAToUVRow_SVE2; -- } -- } --#endif - #if defined(HAS_RGBATOYROW_MSA) && defined(HAS_RGBATOUVROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - RGBAToYRow = RGBAToYRow_Any_MSA; -@@ -2629,11 +2165,6 @@ int RGBAToI420(const uint8_t* src_rgba, - } - } - #endif --#if defined(HAS_RGBATOYROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- RGBAToYRow = RGBAToYRow_RVV; -- } --#endif - - for (y = 0; y < height - 1; y += 2) { - RGBAToUVRow(src_rgba, src_stride_rgba, dst_u, dst_v, width); -@@ -2653,7 +2184,7 @@ int RGBAToI420(const uint8_t* src_rgba, - - // Enabled if 1 pass is available - #if (defined(HAS_RGB24TOYROW_NEON) || defined(HAS_RGB24TOYROW_MSA) || \ -- defined(HAS_RGB24TOYROW_LSX) || defined(HAS_RGB24TOYROW_RVV)) -+ defined(HAS_RGB24TOYROW_LSX)) - #define HAS_RGB24TOYROW - #endif - -@@ -2738,11 +2269,6 @@ int RGB24ToI420(const uint8_t* src_rgb24 - } - } - #endif --#if defined(HAS_RGB24TOYROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- RGB24ToYRow = RGB24ToYRow_RVV; -- } --#endif - - // Other platforms do intermediate conversion from RGB24 to ARGB. - #else // HAS_RGB24TOYROW -@@ -2794,8 +2320,6 @@ int RGB24ToI420(const uint8_t* src_rgb24 - // Allocate 2 rows of ARGB. - const int row_size = (width * 4 + 31) & ~31; - align_buffer_64(row, row_size * 2); -- if (!row) -- return 1; - #endif - - for (y = 0; y < height - 1; y += 2) { -@@ -2834,8 +2358,7 @@ int RGB24ToI420(const uint8_t* src_rgb24 - #undef HAS_RGB24TOYROW - - // Enabled if 1 pass is available --#if defined(HAS_RGB24TOYJROW_NEON) || defined(HAS_RGB24TOYJROW_MSA) || \ -- defined(HAS_RGB24TOYJROW_RVV) -+#if defined(HAS_RGB24TOYJROW_NEON) || defined(HAS_RGB24TOYJROW_MSA) - #define HAS_RGB24TOYJROW - #endif - -@@ -2916,11 +2439,6 @@ int RGB24ToJ420(const uint8_t* src_rgb24 - } - } - #endif --#if defined(HAS_RGB24TOYJROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- RGB24ToYJRow = RGB24ToYJRow_RVV; -- } --#endif - - // Other platforms do intermediate conversion from RGB24 to ARGB. - #else // HAS_RGB24TOYJROW -@@ -2972,8 +2490,6 @@ int RGB24ToJ420(const uint8_t* src_rgb24 - // Allocate 2 rows of ARGB. - const int row_size = (width * 4 + 31) & ~31; - align_buffer_64(row, row_size * 2); -- if (!row) -- return 1; - #endif - - for (y = 0; y < height - 1; y += 2) { -@@ -3013,7 +2529,7 @@ int RGB24ToJ420(const uint8_t* src_rgb24 - - // Enabled if 1 pass is available - #if (defined(HAS_RAWTOYROW_NEON) || defined(HAS_RAWTOYROW_MSA) || \ -- defined(HAS_RAWTOYROW_LSX) || defined(HAS_RAWTOYROW_RVV)) -+ defined(HAS_RAWTOYROW_LSX)) - #define HAS_RAWTOYROW - #endif - -@@ -3097,11 +2613,6 @@ int RAWToI420(const uint8_t* src_raw, - } - } - #endif --#if defined(HAS_RAWTOYROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- RAWToYRow = RAWToYRow_RVV; -- } --#endif - - // Other platforms do intermediate conversion from RAW to ARGB. - #else // HAS_RAWTOYROW -@@ -3153,8 +2664,6 @@ int RAWToI420(const uint8_t* src_raw, - // Allocate 2 rows of ARGB. - const int row_size = (width * 4 + 31) & ~31; - align_buffer_64(row, row_size * 2); -- if (!row) -- return 1; - #endif - - for (y = 0; y < height - 1; y += 2) { -@@ -3193,8 +2702,7 @@ int RAWToI420(const uint8_t* src_raw, - #undef HAS_RAWTOYROW - - // Enabled if 1 pass is available --#if defined(HAS_RAWTOYJROW_NEON) || defined(HAS_RAWTOYJROW_MSA) || \ -- defined(HAS_RAWTOYJROW_RVV) -+#if defined(HAS_RAWTOYJROW_NEON) || defined(HAS_RAWTOYJROW_MSA) - #define HAS_RAWTOYJROW - #endif - -@@ -3275,11 +2783,6 @@ int RAWToJ420(const uint8_t* src_raw, - } - } - #endif --#if defined(HAS_RAWTOYJROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- RAWToYJRow = RAWToYJRow_RVV; -- } --#endif - - // Other platforms do intermediate conversion from RAW to ARGB. - #else // HAS_RAWTOYJROW -@@ -3331,8 +2834,6 @@ int RAWToJ420(const uint8_t* src_raw, - // Allocate 2 rows of ARGB. - const int row_size = (width * 4 + 31) & ~31; - align_buffer_64(row, row_size * 2); -- if (!row) -- return 1; - #endif - - for (y = 0; y < height - 1; y += 2) { -@@ -3511,8 +3012,6 @@ int RGB565ToI420(const uint8_t* src_rgb5 - // Allocate 2 rows of ARGB. - const int row_size = (width * 4 + 31) & ~31; - align_buffer_64(row, row_size * 2); -- if (!row) -- return 1; - #endif - for (y = 0; y < height - 1; y += 2) { - #if (defined(HAS_RGB565TOYROW_NEON) || defined(HAS_RGB565TOYROW_MSA) || \ -@@ -3693,8 +3192,6 @@ int ARGB1555ToI420(const uint8_t* src_ar - // Allocate 2 rows of ARGB. - const int row_size = (width * 4 + 31) & ~31; - align_buffer_64(row, row_size * 2); -- if (!row) -- return 1; - #endif - - for (y = 0; y < height - 1; y += 2) { -@@ -3881,16 +3378,6 @@ int ARGB4444ToI420(const uint8_t* src_ar - } - } - #endif --#if defined(HAS_ARGBTOYROW_LSX) && defined(HAS_ARGBTOUVROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBToYRow = ARGBToYRow_Any_LSX; -- ARGBToUVRow = ARGBToUVRow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYRow = ARGBToYRow_LSX; -- ARGBToUVRow = ARGBToUVRow_LSX; -- } -- } --#endif - #if defined(HAS_ARGBTOYROW_LASX) && defined(HAS_ARGBTOUVROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - ARGBToYRow = ARGBToYRow_Any_LASX; -@@ -3908,8 +3395,6 @@ int ARGB4444ToI420(const uint8_t* src_ar - // Allocate 2 rows of ARGB. - const int row_size = (width * 4 + 31) & ~31; - align_buffer_64(row, row_size * 2); -- if (!row) -- return 1; - #endif - - for (y = 0; y < height - 1; y += 2) { -@@ -4021,11 +3506,6 @@ int RGB24ToJ400(const uint8_t* src_rgb24 - } - } - #endif --#if defined(HAS_RGB24TOYJROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- RGB24ToYJRow = RGB24ToYJRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - RGB24ToYJRow(src_rgb24, dst_yj, width); -@@ -4110,11 +3590,6 @@ int RAWToJ400(const uint8_t* src_raw, - } - } - #endif --#if defined(HAS_RAWTOYJROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- RAWToYJRow = RAWToYJRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - RAWToYJRow(src_raw, dst_yj, width); -diff --git a/media/libyuv/libyuv/source/convert_argb.cc b/media/libyuv/libyuv/source/convert_argb.cc ---- a/media/libyuv/libyuv/source/convert_argb.cc -+++ b/media/libyuv/libyuv/source/convert_argb.cc -@@ -14,6 +14,9 @@ - - #include "libyuv/convert_from_argb.h" - #include "libyuv/cpu_id.h" -+#ifdef HAVE_JPEG -+#include "libyuv/mjpeg_decoder.h" -+#endif - #include "libyuv/planar_functions.h" // For CopyPlane and ARGBShuffle. - #include "libyuv/rotate_argb.h" - #include "libyuv/row.h" -@@ -109,11 +112,6 @@ int I420ToARGBMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_I422TOARGBROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- I422ToARGBRow = I422ToARGBRow_SVE2; -- } --#endif - #if defined(HAS_I422TOARGBROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - I422ToARGBRow = I422ToARGBRow_Any_MSA; -@@ -122,14 +120,6 @@ int I420ToARGBMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_I422TOARGBROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- I422ToARGBRow = I422ToARGBRow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- I422ToARGBRow = I422ToARGBRow_LSX; -- } -- } --#endif - #if defined(HAS_I422TOARGBROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - I422ToARGBRow = I422ToARGBRow_Any_LASX; -@@ -138,11 +128,6 @@ int I420ToARGBMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_I422TOARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- I422ToARGBRow = I422ToARGBRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - I422ToARGBRow(src_y, src_u, src_v, dst_argb, yuvconstants, width); -@@ -368,11 +353,6 @@ int I422ToARGBMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_I422TOARGBROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- I422ToARGBRow = I422ToARGBRow_SVE2; -- } --#endif - #if defined(HAS_I422TOARGBROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - I422ToARGBRow = I422ToARGBRow_Any_MSA; -@@ -381,14 +361,6 @@ int I422ToARGBMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_I422TOARGBROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- I422ToARGBRow = I422ToARGBRow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- I422ToARGBRow = I422ToARGBRow_LSX; -- } -- } --#endif - #if defined(HAS_I422TOARGBROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - I422ToARGBRow = I422ToARGBRow_Any_LASX; -@@ -397,11 +369,6 @@ int I422ToARGBMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_I422TOARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- I422ToARGBRow = I422ToARGBRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - I422ToARGBRow(src_y, src_u, src_v, dst_argb, yuvconstants, width); -@@ -616,11 +583,6 @@ int I444ToARGBMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_I444TOARGBROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- I444ToARGBRow = I444ToARGBRow_SVE2; -- } --#endif - #if defined(HAS_I444TOARGBROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - I444ToARGBRow = I444ToARGBRow_Any_MSA; -@@ -637,11 +599,6 @@ int I444ToARGBMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_I444TOARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- I444ToARGBRow = I444ToARGBRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - I444ToARGBRow(src_y, src_u, src_v, dst_argb, yuvconstants, width); -@@ -872,11 +829,6 @@ int I444ToRGB24Matrix(const uint8_t* src - } - } - #endif --#if defined(HAS_I444TORGB24ROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- I444ToRGB24Row = I444ToRGB24Row_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - I444ToRGB24Row(src_y, src_u, src_v, dst_rgb24, yuvconstants, width); -@@ -954,14 +906,6 @@ int I010ToAR30Matrix(const uint16_t* src - dst_ar30 = dst_ar30 + (height - 1) * dst_stride_ar30; - dst_stride_ar30 = -dst_stride_ar30; - } --#if defined(HAS_I210TOAR30ROW_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- I210ToAR30Row = I210ToAR30Row_Any_NEON; -- if (IS_ALIGNED(width, 8)) { -- I210ToAR30Row = I210ToAR30Row_NEON; -- } -- } --#endif - #if defined(HAS_I210TOAR30ROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - I210ToAR30Row = I210ToAR30Row_Any_SSSE3; -@@ -1180,14 +1124,6 @@ int I210ToAR30Matrix(const uint16_t* src - dst_ar30 = dst_ar30 + (height - 1) * dst_stride_ar30; - dst_stride_ar30 = -dst_stride_ar30; - } --#if defined(HAS_I210TOAR30ROW_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- I210ToAR30Row = I210ToAR30Row_Any_NEON; -- if (IS_ALIGNED(width, 8)) { -- I210ToAR30Row = I210ToAR30Row_NEON; -- } -- } --#endif - #if defined(HAS_I210TOAR30ROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - I210ToAR30Row = I210ToAR30Row_Any_SSSE3; -@@ -1343,14 +1279,6 @@ int I410ToAR30Matrix(const uint16_t* src - dst_ar30 = dst_ar30 + (height - 1) * dst_stride_ar30; - dst_stride_ar30 = -dst_stride_ar30; - } --#if defined(HAS_I410TOAR30ROW_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- I410ToAR30Row = I410ToAR30Row_Any_NEON; -- if (IS_ALIGNED(width, 8)) { -- I410ToAR30Row = I410ToAR30Row_NEON; -- } -- } --#endif - #if defined(HAS_I410TOAR30ROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - I410ToAR30Row = I410ToAR30Row_Any_SSSE3; -@@ -1413,14 +1341,6 @@ int I010ToARGBMatrix(const uint16_t* src - } - } - #endif --#if defined(HAS_I210TOARGBROW_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- I210ToARGBRow = I210ToARGBRow_Any_NEON; -- if (IS_ALIGNED(width, 8)) { -- I210ToARGBRow = I210ToARGBRow_NEON; -- } -- } --#endif - #if defined(HAS_I210TOARGBROW_AVX2) - if (TestCpuFlag(kCpuHasAVX2)) { - I210ToARGBRow = I210ToARGBRow_Any_AVX2; -@@ -1641,14 +1561,6 @@ int I210ToARGBMatrix(const uint16_t* src - } - } - #endif --#if defined(HAS_I210TOARGBROW_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- I210ToARGBRow = I210ToARGBRow_Any_NEON; -- if (IS_ALIGNED(width, 8)) { -- I210ToARGBRow = I210ToARGBRow_NEON; -- } -- } --#endif - #if defined(HAS_I210TOARGBROW_AVX2) - if (TestCpuFlag(kCpuHasAVX2)) { - I210ToARGBRow = I210ToARGBRow_Any_AVX2; -@@ -1810,14 +1722,6 @@ int I410ToARGBMatrix(const uint16_t* src - } - } - #endif --#if defined(HAS_I410TOARGBROW_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- I410ToARGBRow = I410ToARGBRow_Any_NEON; -- if (IS_ALIGNED(width, 8)) { -- I410ToARGBRow = I410ToARGBRow_NEON; -- } -- } --#endif - #if defined(HAS_I410TOARGBROW_AVX2) - if (TestCpuFlag(kCpuHasAVX2)) { - I410ToARGBRow = I410ToARGBRow_Any_AVX2; -@@ -2095,11 +1999,6 @@ int I420AlphaToARGBMatrix(const uint8_t* - } - } - #endif --#if defined(HAS_I422ALPHATOARGBROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- I422AlphaToARGBRow = I422AlphaToARGBRow_SVE2; -- } --#endif - #if defined(HAS_I422ALPHATOARGBROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - I422AlphaToARGBRow = I422AlphaToARGBRow_Any_MSA; -@@ -2108,14 +2007,6 @@ int I420AlphaToARGBMatrix(const uint8_t* - } - } - #endif --#if defined(HAS_I422ALPHATOARGBROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- I422AlphaToARGBRow = I422AlphaToARGBRow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- I422AlphaToARGBRow = I422AlphaToARGBRow_LSX; -- } -- } --#endif - #if defined(HAS_I422ALPHATOARGBROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - I422AlphaToARGBRow = I422AlphaToARGBRow_Any_LASX; -@@ -2124,11 +2015,6 @@ int I420AlphaToARGBMatrix(const uint8_t* - } - } - #endif --#if defined(HAS_I422ALPHATOARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- I422AlphaToARGBRow = I422AlphaToARGBRow_RVV; -- } --#endif - #if defined(HAS_ARGBATTENUATEROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - ARGBAttenuateRow = ARGBAttenuateRow_Any_SSSE3; -@@ -2161,11 +2047,6 @@ int I420AlphaToARGBMatrix(const uint8_t* - } - } - #endif --#if defined(HAS_ARGBATTENUATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBAttenuateRow = ARGBAttenuateRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - I422AlphaToARGBRow(src_y, src_u, src_v, src_a, dst_argb, yuvconstants, -@@ -2243,11 +2124,6 @@ int I422AlphaToARGBMatrix(const uint8_t* - } - } - #endif --#if defined(HAS_I422ALPHATOARGBROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- I422AlphaToARGBRow = I422AlphaToARGBRow_SVE2; -- } --#endif - #if defined(HAS_I422ALPHATOARGBROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - I422AlphaToARGBRow = I422AlphaToARGBRow_Any_MSA; -@@ -2256,14 +2132,6 @@ int I422AlphaToARGBMatrix(const uint8_t* - } - } - #endif --#if defined(HAS_I422ALPHATOARGBROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- I422AlphaToARGBRow = I422AlphaToARGBRow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- I422AlphaToARGBRow = I422AlphaToARGBRow_LSX; -- } -- } --#endif - #if defined(HAS_I422ALPHATOARGBROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - I422AlphaToARGBRow = I422AlphaToARGBRow_Any_LASX; -@@ -2272,11 +2140,6 @@ int I422AlphaToARGBMatrix(const uint8_t* - } - } - #endif --#if defined(HAS_I422ALPHATOARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- I422AlphaToARGBRow = I422AlphaToARGBRow_RVV; -- } --#endif - #if defined(HAS_ARGBATTENUATEROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - ARGBAttenuateRow = ARGBAttenuateRow_Any_SSSE3; -@@ -2309,11 +2172,6 @@ int I422AlphaToARGBMatrix(const uint8_t* - } - } - #endif --#if defined(HAS_ARGBATTENUATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBAttenuateRow = ARGBAttenuateRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - I422AlphaToARGBRow(src_y, src_u, src_v, src_a, dst_argb, yuvconstants, -@@ -2389,11 +2247,6 @@ int I444AlphaToARGBMatrix(const uint8_t* - } - } - #endif --#if defined(HAS_I444ALPHATOARGBROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- I444AlphaToARGBRow = I444AlphaToARGBRow_SVE2; -- } --#endif - #if defined(HAS_I444ALPHATOARGBROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - I444AlphaToARGBRow = I444AlphaToARGBRow_Any_MSA; -@@ -2402,11 +2255,6 @@ int I444AlphaToARGBMatrix(const uint8_t* - } - } - #endif --#if defined(HAS_I444ALPHATOARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- I444AlphaToARGBRow = I444AlphaToARGBRow_RVV; -- } --#endif - #if defined(HAS_ARGBATTENUATEROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - ARGBAttenuateRow = ARGBAttenuateRow_Any_SSSE3; -@@ -2439,11 +2287,6 @@ int I444AlphaToARGBMatrix(const uint8_t* - } - } - #endif --#if defined(HAS_ARGBATTENUATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBAttenuateRow = ARGBAttenuateRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - I444AlphaToARGBRow(src_y, src_u, src_v, src_a, dst_argb, yuvconstants, -@@ -2624,14 +2467,6 @@ int I010AlphaToARGBMatrix(const uint16_t - dst_argb = dst_argb + (height - 1) * dst_stride_argb; - dst_stride_argb = -dst_stride_argb; - } --#if defined(HAS_I210ALPHATOARGBROW_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- I210AlphaToARGBRow = I210AlphaToARGBRow_Any_NEON; -- if (IS_ALIGNED(width, 8)) { -- I210AlphaToARGBRow = I210AlphaToARGBRow_NEON; -- } -- } --#endif - #if defined(HAS_I210ALPHATOARGBROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - I210AlphaToARGBRow = I210AlphaToARGBRow_Any_SSSE3; -@@ -2680,11 +2515,6 @@ int I010AlphaToARGBMatrix(const uint16_t - } - } - #endif --#if defined(HAS_ARGBATTENUATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBAttenuateRow = ARGBAttenuateRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - I210AlphaToARGBRow(src_y, src_u, src_v, src_a, dst_argb, yuvconstants, -@@ -2738,14 +2568,6 @@ int I210AlphaToARGBMatrix(const uint16_t - dst_argb = dst_argb + (height - 1) * dst_stride_argb; - dst_stride_argb = -dst_stride_argb; - } --#if defined(HAS_I210ALPHATOARGBROW_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- I210AlphaToARGBRow = I210AlphaToARGBRow_Any_NEON; -- if (IS_ALIGNED(width, 8)) { -- I210AlphaToARGBRow = I210AlphaToARGBRow_NEON; -- } -- } --#endif - #if defined(HAS_I210ALPHATOARGBROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - I210AlphaToARGBRow = I210AlphaToARGBRow_Any_SSSE3; -@@ -2794,11 +2616,6 @@ int I210AlphaToARGBMatrix(const uint16_t - } - } - #endif --#if defined(HAS_ARGBATTENUATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBAttenuateRow = ARGBAttenuateRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - I210AlphaToARGBRow(src_y, src_u, src_v, src_a, dst_argb, yuvconstants, -@@ -2850,14 +2667,6 @@ int I410AlphaToARGBMatrix(const uint16_t - dst_argb = dst_argb + (height - 1) * dst_stride_argb; - dst_stride_argb = -dst_stride_argb; - } --#if defined(HAS_I410ALPHATOARGBROW_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- I410AlphaToARGBRow = I410AlphaToARGBRow_Any_NEON; -- if (IS_ALIGNED(width, 8)) { -- I410AlphaToARGBRow = I410AlphaToARGBRow_NEON; -- } -- } --#endif - #if defined(HAS_I410ALPHATOARGBROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - I410AlphaToARGBRow = I410AlphaToARGBRow_Any_SSSE3; -@@ -2906,11 +2715,6 @@ int I410AlphaToARGBMatrix(const uint16_t - } - } - #endif --#if defined(HAS_ARGBATTENUATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBAttenuateRow = ARGBAttenuateRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - I410AlphaToARGBRow(src_y, src_u, src_v, src_a, dst_argb, yuvconstants, -@@ -2980,11 +2784,6 @@ int I400ToARGBMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_I400TOARGBROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- I400ToARGBRow = I400ToARGBRow_SVE2; -- } --#endif - #if defined(HAS_I400TOARGBROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - I400ToARGBRow = I400ToARGBRow_Any_MSA; -@@ -3001,11 +2800,6 @@ int I400ToARGBMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_I400TOARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- I400ToARGBRow = I400ToARGBRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - I400ToARGBRow(src_y, dst_argb, yuvconstants, width); -@@ -3093,12 +2887,6 @@ int J400ToARGB(const uint8_t* src_y, - } - } - #endif --#if defined(HAS_J400TOARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- J400ToARGBRow = J400ToARGBRow_RVV; -- } --#endif -- - for (y = 0; y < height; ++y) { - J400ToARGBRow(src_y, dst_argb, width); - src_y += src_stride_y; -@@ -3107,7 +2895,6 @@ int J400ToARGB(const uint8_t* src_y, - return 0; - } - --#ifndef __riscv - // Shuffle table for converting BGRA to ARGB. - static const uvec8 kShuffleMaskBGRAToARGB = { - 3u, 2u, 1u, 0u, 7u, 6u, 5u, 4u, 11u, 10u, 9u, 8u, 15u, 14u, 13u, 12u}; -@@ -3195,195 +2982,6 @@ int AR64ToAB64(const uint16_t* src_ar64, - return AR64Shuffle(src_ar64, src_stride_ar64, dst_ab64, dst_stride_ab64, - (const uint8_t*)&kShuffleMaskAR64ToAB64, width, height); - } --#else --// Convert BGRA to ARGB (same as ARGBToBGRA). --LIBYUV_API --int BGRAToARGB(const uint8_t* src_bgra, -- int src_stride_bgra, -- uint8_t* dst_argb, -- int dst_stride_argb, -- int width, -- int height) { -- return ARGBToBGRA(src_bgra, src_stride_bgra, dst_argb, dst_stride_argb, width, -- height); --} -- --// Convert ARGB to BGRA. --LIBYUV_API --int ARGBToBGRA(const uint8_t* src_argb, -- int src_stride_argb, -- uint8_t* dst_bgra, -- int dst_stride_bgra, -- int width, -- int height) { -- int y; -- void (*ARGBToBGRARow)(const uint8_t* src_argb, uint8_t* dst_bgra, int width) = -- ARGBToBGRARow_C; -- if (!src_argb || !dst_bgra || width <= 0 || height == 0) { -- return -1; -- } -- // Negative height means invert the image. -- if (height < 0) { -- height = -height; -- src_argb = src_argb + (height - 1) * src_stride_argb; -- src_stride_argb = -src_stride_argb; -- } -- // Coalesce rows. -- if (src_stride_argb == width * 4 && dst_stride_bgra == width * 4) { -- width *= height; -- height = 1; -- src_stride_argb = dst_stride_bgra = 0; -- } -- --#if defined(HAS_ARGBTOBGRAROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBToBGRARow = ARGBToBGRARow_RVV; -- } --#endif -- -- for (y = 0; y < height; ++y) { -- ARGBToBGRARow(src_argb, dst_bgra, width); -- src_argb += src_stride_argb; -- dst_bgra += dst_stride_bgra; -- } -- return 0; --} -- --// Convert ARGB to ABGR. --LIBYUV_API --int ARGBToABGR(const uint8_t* src_argb, -- int src_stride_argb, -- uint8_t* dst_abgr, -- int dst_stride_abgr, -- int width, -- int height) { -- int y; -- void (*ARGBToABGRRow)(const uint8_t* src_argb, uint8_t* dst_abgr, int width) = -- ARGBToABGRRow_C; -- if (!src_argb || !dst_abgr || width <= 0 || height == 0) { -- return -1; -- } -- // Negative height means invert the image. -- if (height < 0) { -- height = -height; -- src_argb = src_argb + (height - 1) * src_stride_argb; -- src_stride_argb = -src_stride_argb; -- } -- // Coalesce rows. -- if (src_stride_argb == width * 4 && dst_stride_abgr == width * 4) { -- width *= height; -- height = 1; -- src_stride_argb = dst_stride_abgr = 0; -- } -- --#if defined(HAS_ARGBTOABGRROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBToABGRRow = ARGBToABGRRow_RVV; -- } --#endif -- -- for (y = 0; y < height; ++y) { -- ARGBToABGRRow(src_argb, dst_abgr, width); -- src_argb += src_stride_argb; -- dst_abgr += dst_stride_abgr; -- } -- return 0; --} -- --// Convert ABGR to ARGB (same as ARGBToABGR). --LIBYUV_API --int ABGRToARGB(const uint8_t* src_abgr, -- int src_stride_abgr, -- uint8_t* dst_argb, -- int dst_stride_argb, -- int width, -- int height) { -- return ARGBToABGR(src_abgr, src_stride_abgr, dst_argb, dst_stride_argb, width, -- height); --} -- --// Convert RGBA to ARGB. --LIBYUV_API --int RGBAToARGB(const uint8_t* src_rgba, -- int src_stride_rgba, -- uint8_t* dst_argb, -- int dst_stride_argb, -- int width, -- int height) { -- int y; -- void (*RGBAToARGBRow)(const uint8_t* src_rgba, uint8_t* dst_argb, int width) = -- RGBAToARGBRow_C; -- if (!src_rgba || !dst_argb || width <= 0 || height == 0) { -- return -1; -- } -- // Negative height means invert the image. -- if (height < 0) { -- height = -height; -- src_rgba = src_rgba + (height - 1) * src_stride_rgba; -- src_stride_rgba = -src_stride_rgba; -- } -- // Coalesce rows. -- if (src_stride_rgba == width * 4 && dst_stride_argb == width * 4) { -- width *= height; -- height = 1; -- src_stride_rgba = dst_stride_argb = 0; -- } -- --#if defined(HAS_RGBATOARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- RGBAToARGBRow = RGBAToARGBRow_RVV; -- } --#endif -- -- for (y = 0; y < height; ++y) { -- RGBAToARGBRow(src_rgba, dst_argb, width); -- src_rgba += src_stride_rgba; -- dst_argb += dst_stride_argb; -- } -- return 0; --} -- --// Convert AR64 To AB64. --LIBYUV_API --int AR64ToAB64(const uint16_t* src_ar64, -- int src_stride_ar64, -- uint16_t* dst_ab64, -- int dst_stride_ab64, -- int width, -- int height) { -- int y; -- void (*AR64ToAB64Row)(const uint16_t* src_ar64, uint16_t* dst_ab64, -- int width) = AR64ToAB64Row_C; -- if (!src_ar64 || !dst_ab64 || width <= 0 || height == 0) { -- return -1; -- } -- // Negative height means invert the image. -- if (height < 0) { -- height = -height; -- src_ar64 = src_ar64 + (height - 1) * src_stride_ar64; -- src_stride_ar64 = -src_stride_ar64; -- } -- // Coalesce rows. -- if (src_stride_ar64 == width * 4 && dst_stride_ab64 == width * 4) { -- width *= height; -- height = 1; -- src_stride_ar64 = dst_stride_ab64 = 0; -- } -- --#if defined(HAS_AR64TOAB64ROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- AR64ToAB64Row = AR64ToAB64Row_RVV; -- } --#endif -- -- for (y = 0; y < height; ++y) { -- AR64ToAB64Row(src_ar64, dst_ab64, width); -- src_ar64 += src_stride_ar64; -- dst_ab64 += dst_stride_ab64; -- } -- return 0; --} --#endif - - // Convert RGB24 to ARGB. - LIBYUV_API -@@ -3451,11 +3049,6 @@ int RGB24ToARGB(const uint8_t* src_rgb24 - } - } - #endif --#if defined(HAS_RGB24TOARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- RGB24ToARGBRow = RGB24ToARGBRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - RGB24ToARGBRow(src_rgb24, dst_argb, width); -@@ -3531,11 +3124,6 @@ int RAWToARGB(const uint8_t* src_raw, - } - } - #endif --#if defined(HAS_RAWTOARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- RAWToARGBRow = RAWToARGBRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - RAWToARGBRow(src_raw, dst_argb, width); -@@ -3587,11 +3175,6 @@ int RAWToRGBA(const uint8_t* src_raw, - } - } - #endif --#if defined(HAS_RAWTORGBAROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- RAWToRGBARow = RAWToRGBARow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - RAWToRGBARow(src_raw, dst_rgba, width); -@@ -3734,11 +3317,6 @@ int ARGB1555ToARGB(const uint8_t* src_ar - } - } - #endif --#if defined(HAS_ARGB1555TOARGBROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- ARGB1555ToARGBRow = ARGB1555ToARGBRow_SVE2; -- } --#endif - #if defined(HAS_ARGB1555TOARGBROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - ARGB1555ToARGBRow = ARGB1555ToARGBRow_Any_MSA; -@@ -4001,11 +3579,6 @@ int AR64ToARGB(const uint16_t* src_ar64, - } - } - #endif --#if defined(HAS_AR64TOARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- AR64ToARGBRow = AR64ToARGBRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - AR64ToARGBRow(src_ar64, dst_argb, width); -@@ -4065,11 +3638,6 @@ int AB64ToARGB(const uint16_t* src_ab64, - } - } - #endif --#if defined(HAS_AB64TOARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- AB64ToARGBRow = AB64ToARGBRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - AB64ToARGBRow(src_ab64, dst_argb, width); -@@ -4128,11 +3696,6 @@ int NV12ToARGBMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_NV12TOARGBROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- NV12ToARGBRow = NV12ToARGBRow_SVE2; -- } --#endif - #if defined(HAS_NV12TOARGBROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - NV12ToARGBRow = NV12ToARGBRow_Any_MSA; -@@ -4157,11 +3720,6 @@ int NV12ToARGBMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_NV12TOARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- NV12ToARGBRow = NV12ToARGBRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - NV12ToARGBRow(src_y, src_uv, dst_argb, yuvconstants, width); -@@ -4223,11 +3781,6 @@ int NV21ToARGBMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_NV21TOARGBROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- NV21ToARGBRow = NV21ToARGBRow_SVE2; -- } --#endif - #if defined(HAS_NV21TOARGBROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - NV21ToARGBRow = NV21ToARGBRow_Any_MSA; -@@ -4252,11 +3805,6 @@ int NV21ToARGBMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_NV21TOARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- NV21ToARGBRow = NV21ToARGBRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - NV21ToARGBRow(src_y, src_vu, dst_argb, yuvconstants, width); -@@ -4377,11 +3925,6 @@ int NV12ToRGB24Matrix(const uint8_t* src - } - } - #endif --#if defined(HAS_NV12TORGB24ROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- NV12ToRGB24Row = NV12ToRGB24Row_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - NV12ToRGB24Row(src_y, src_uv, dst_rgb24, yuvconstants, width); -@@ -4443,11 +3986,6 @@ int NV21ToRGB24Matrix(const uint8_t* src - } - } - #endif --#if defined(HAS_NV21TORGB24ROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- NV21ToRGB24Row = NV21ToRGB24Row_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - NV21ToRGB24Row(src_y, src_vu, dst_rgb24, yuvconstants, width); -@@ -4574,15 +4112,14 @@ int NV21ToYUV24(const uint8_t* src_y, - return 0; - } - --// Convert YUY2 to ARGB with matrix. --LIBYUV_API --int YUY2ToARGBMatrix(const uint8_t* src_yuy2, -- int src_stride_yuy2, -- uint8_t* dst_argb, -- int dst_stride_argb, -- const struct YuvConstants* yuvconstants, -- int width, -- int height) { -+// Convert YUY2 to ARGB. -+LIBYUV_API -+int YUY2ToARGB(const uint8_t* src_yuy2, -+ int src_stride_yuy2, -+ uint8_t* dst_argb, -+ int dst_stride_argb, -+ int width, -+ int height) { - int y; - void (*YUY2ToARGBRow)(const uint8_t* src_yuy2, uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, int width) = -@@ -4626,11 +4163,6 @@ int YUY2ToARGBMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_YUY2TOARGBROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- YUY2ToARGBRow = YUY2ToARGBRow_SVE2; -- } --#endif - #if defined(HAS_YUY2TOARGBROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - YUY2ToARGBRow = YUY2ToARGBRow_Any_MSA; -@@ -4648,34 +4180,21 @@ int YUY2ToARGBMatrix(const uint8_t* src_ - } - #endif - for (y = 0; y < height; ++y) { -- YUY2ToARGBRow(src_yuy2, dst_argb, yuvconstants, width); -+ YUY2ToARGBRow(src_yuy2, dst_argb, &kYuvI601Constants, width); - src_yuy2 += src_stride_yuy2; - dst_argb += dst_stride_argb; - } - return 0; - } - --// Convert YUY2 to ARGB. --LIBYUV_API --int YUY2ToARGB(const uint8_t* src_yuy2, -- int src_stride_yuy2, -+// Convert UYVY to ARGB. -+LIBYUV_API -+int UYVYToARGB(const uint8_t* src_uyvy, -+ int src_stride_uyvy, - uint8_t* dst_argb, - int dst_stride_argb, - int width, - int height) { -- return YUY2ToARGBMatrix(src_yuy2, src_stride_yuy2, dst_argb, dst_stride_argb, -- &kYuvI601Constants, width, height); --} -- --// Convert UYVY to ARGB with matrix. --LIBYUV_API --int UYVYToARGBMatrix(const uint8_t* src_uyvy, -- int src_stride_uyvy, -- uint8_t* dst_argb, -- int dst_stride_argb, -- const struct YuvConstants* yuvconstants, -- int width, -- int height) { - int y; - void (*UYVYToARGBRow)(const uint8_t* src_uyvy, uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, int width) = -@@ -4719,11 +4238,6 @@ int UYVYToARGBMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_UYVYTOARGBROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- UYVYToARGBRow = UYVYToARGBRow_SVE2; -- } --#endif - #if defined(HAS_UYVYTOARGBROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - UYVYToARGBRow = UYVYToARGBRow_Any_MSA; -@@ -4741,25 +4255,12 @@ int UYVYToARGBMatrix(const uint8_t* src_ - } - #endif - for (y = 0; y < height; ++y) { -- UYVYToARGBRow(src_uyvy, dst_argb, yuvconstants, width); -+ UYVYToARGBRow(src_uyvy, dst_argb, &kYuvI601Constants, width); - src_uyvy += src_stride_uyvy; - dst_argb += dst_stride_argb; - } - return 0; - } -- --// Convert UYVY to ARGB. --LIBYUV_API --int UYVYToARGB(const uint8_t* src_uyvy, -- int src_stride_uyvy, -- uint8_t* dst_argb, -- int dst_stride_argb, -- int width, -- int height) { -- return UYVYToARGBMatrix(src_uyvy, src_stride_uyvy, dst_argb, dst_stride_argb, -- &kYuvI601Constants, width, height); --} -- - static void WeavePixels(const uint8_t* src_u, - const uint8_t* src_v, - int src_pixel_stride_uv, -@@ -4826,8 +4327,6 @@ int Android420ToARGBMatrix(const uint8_t - - // General case fallback creates NV12 - align_buffer_64(plane_uv, halfwidth * 2 * halfheight); -- if (!plane_uv) -- return 1; - dst_uv = plane_uv; - for (y = 0; y < halfheight; ++y) { - WeavePixels(src_u, src_v, src_pixel_stride_uv, dst_uv, halfwidth); -@@ -4931,11 +4430,6 @@ int I422ToRGBAMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_I422TORGBAROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- I422ToRGBARow = I422ToRGBARow_SVE2; -- } --#endif - #if defined(HAS_I422TORGBAROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - I422ToRGBARow = I422ToRGBARow_Any_MSA; -@@ -4944,14 +4438,6 @@ int I422ToRGBAMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_I422TORGBAROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- I422ToRGBARow = I422ToRGBARow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- I422ToRGBARow = I422ToRGBARow_LSX; -- } -- } --#endif - #if defined(HAS_I422TORGBAROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - I422ToRGBARow = I422ToRGBARow_Any_LASX; -@@ -4960,11 +4446,6 @@ int I422ToRGBAMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_I422TORGBAROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- I422ToRGBARow = I422ToRGBARow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - I422ToRGBARow(src_y, src_u, src_v, dst_rgba, yuvconstants, width); -@@ -5164,11 +4645,6 @@ int I420ToRGBAMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_I422TORGBAROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- I422ToRGBARow = I422ToRGBARow_SVE2; -- } --#endif - #if defined(HAS_I422TORGBAROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - I422ToRGBARow = I422ToRGBARow_Any_MSA; -@@ -5177,14 +4653,6 @@ int I420ToRGBAMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_I422TORGBAROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- I422ToRGBARow = I422ToRGBARow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- I422ToRGBARow = I422ToRGBARow_LSX; -- } -- } --#endif - #if defined(HAS_I422TORGBAROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - I422ToRGBARow = I422ToRGBARow_Any_LASX; -@@ -5193,11 +4661,6 @@ int I420ToRGBAMatrix(const uint8_t* src_ - } - } - #endif --#if defined(HAS_I422TORGBAROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- I422ToRGBARow = I422ToRGBARow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - I422ToRGBARow(src_y, src_u, src_v, dst_rgba, yuvconstants, width); -@@ -5307,14 +4770,6 @@ int I420ToRGB24Matrix(const uint8_t* src - } - } - #endif --#if defined(HAS_I422TORGB24ROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- I422ToRGB24Row = I422ToRGB24Row_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- I422ToRGB24Row = I422ToRGB24Row_LSX; -- } -- } --#endif - #if defined(HAS_I422TORGB24ROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - I422ToRGB24Row = I422ToRGB24Row_Any_LASX; -@@ -5323,11 +4778,6 @@ int I420ToRGB24Matrix(const uint8_t* src - } - } - #endif --#if defined(HAS_I422TORGB24ROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- I422ToRGB24Row = I422ToRGB24Row_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - I422ToRGB24Row(src_y, src_u, src_v, dst_rgb24, yuvconstants, width); -@@ -5509,14 +4959,6 @@ int I422ToRGB24Matrix(const uint8_t* src - } - } - #endif --#if defined(HAS_I422TORGB24ROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- I422ToRGB24Row = I422ToRGB24Row_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- I422ToRGB24Row = I422ToRGB24Row_LSX; -- } -- } --#endif - #if defined(HAS_I422TORGB24ROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - I422ToRGB24Row = I422ToRGB24Row_Any_LASX; -@@ -5525,11 +4967,6 @@ int I422ToRGB24Matrix(const uint8_t* src - } - } - #endif --#if defined(HAS_I422TORGB24ROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- I422ToRGB24Row = I422ToRGB24Row_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - I422ToRGB24Row(src_y, src_u, src_v, dst_rgb24, yuvconstants, width); -@@ -5636,14 +5073,6 @@ int I420ToARGB1555(const uint8_t* src_y, - } - } - #endif --#if defined(HAS_I422TOARGB1555ROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- I422ToARGB1555Row = I422ToARGB1555Row_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- I422ToARGB1555Row = I422ToARGB1555Row_LSX; -- } -- } --#endif - #if defined(HAS_I422TOARGB1555ROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - I422ToARGB1555Row = I422ToARGB1555Row_Any_LASX; -@@ -5725,14 +5154,6 @@ int I420ToARGB4444(const uint8_t* src_y, - } - } - #endif --#if defined(HAS_I422TOARGB4444ROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- I422ToARGB4444Row = I422ToARGB4444Row_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- I422ToARGB4444Row = I422ToARGB4444Row_LSX; -- } -- } --#endif - #if defined(HAS_I422TOARGB4444ROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - I422ToARGB4444Row = I422ToARGB4444Row_Any_LASX; -@@ -5815,14 +5236,6 @@ int I420ToRGB565Matrix(const uint8_t* sr - } - } - #endif --#if defined(HAS_I422TORGB565ROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- I422ToRGB565Row = I422ToRGB565Row_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- I422ToRGB565Row = I422ToRGB565Row_LSX; -- } -- } --#endif - #if defined(HAS_I422TORGB565ROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - I422ToRGB565Row = I422ToRGB565Row_Any_LASX; -@@ -5955,14 +5368,6 @@ int I422ToRGB565Matrix(const uint8_t* sr - } - } - #endif --#if defined(HAS_I422TORGB565ROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- I422ToRGB565Row = I422ToRGB565Row_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- I422ToRGB565Row = I422ToRGB565Row_LSX; -- } -- } --#endif - #if defined(HAS_I422TORGB565ROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - I422ToRGB565Row = I422ToRGB565Row_Any_LASX; -@@ -6023,7 +5428,7 @@ int I420ToRGB565Dither(const uint8_t* sr - const struct YuvConstants* yuvconstants, int width) = - I422ToARGBRow_C; - void (*ARGBToRGB565DitherRow)(const uint8_t* src_argb, uint8_t* dst_rgb, -- uint32_t dither4, int width) = -+ const uint32_t dither4, int width) = - ARGBToRGB565DitherRow_C; - if (!src_y || !src_u || !src_v || !dst_rgb565 || width <= 0 || height == 0) { - return -1; -@@ -6070,11 +5475,6 @@ int I420ToRGB565Dither(const uint8_t* sr - } - } - #endif --#if defined(HAS_I422TOARGBROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- I422ToARGBRow = I422ToARGBRow_SVE2; -- } --#endif - #if defined(HAS_I422TOARGBROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - I422ToARGBRow = I422ToARGBRow_Any_MSA; -@@ -6083,14 +5483,6 @@ int I420ToRGB565Dither(const uint8_t* sr - } - } - #endif --#if defined(HAS_I422TOARGBROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- I422ToARGBRow = I422ToARGBRow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- I422ToARGBRow = I422ToARGBRow_LSX; -- } -- } --#endif - #if defined(HAS_I422TOARGBROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - I422ToARGBRow = I422ToARGBRow_Any_LASX; -@@ -6099,11 +5491,6 @@ int I420ToRGB565Dither(const uint8_t* sr - } - } - #endif --#if defined(HAS_I422TOARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- I422ToARGBRow = I422ToARGBRow_RVV; -- } --#endif - #if defined(HAS_ARGBTORGB565DITHERROW_SSE2) - if (TestCpuFlag(kCpuHasSSE2)) { - ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_Any_SSE2; -@@ -6128,11 +5515,6 @@ int I420ToRGB565Dither(const uint8_t* sr - } - } - #endif --#if defined(HAS_ARGBTORGB565DITHERROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_SVE2; -- } --#endif - #if defined(HAS_ARGBTORGB565DITHERROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_Any_MSA; -@@ -6141,14 +5523,6 @@ int I420ToRGB565Dither(const uint8_t* sr - } - } - #endif --#if defined(HAS_ARGBTORGB565DITHERROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_Any_LSX; -- if (IS_ALIGNED(width, 8)) { -- ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_LSX; -- } -- } --#endif - #if defined(HAS_ARGBTORGB565DITHERROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_Any_LASX; -@@ -6160,8 +5534,6 @@ int I420ToRGB565Dither(const uint8_t* sr - { - // Allocate a row of argb. - align_buffer_64(row_argb, width * 4); -- if (!row_argb) -- return 1; - for (y = 0; y < height; ++y) { - I422ToARGBRow(src_y, src_u, src_v, row_argb, &kYuvI601Constants, width); - ARGBToRGB565DitherRow(row_argb, dst_rgb565, -@@ -6361,11 +5733,6 @@ static int I420ToARGBMatrixBilinear(cons - } - } - #endif --#if defined(HAS_I444TOARGBROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- I444ToARGBRow = I444ToARGBRow_SVE2; -- } --#endif - #if defined(HAS_I444TOARGBROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - I444ToARGBRow = I444ToARGBRow_Any_MSA; -@@ -6382,11 +5749,6 @@ static int I420ToARGBMatrixBilinear(cons - } - } - #endif --#if defined(HAS_I444TOARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- I444ToARGBRow = I444ToARGBRow_RVV; -- } --#endif - - #if defined(HAS_SCALEROWUP2_BILINEAR_SSE2) - if (TestCpuFlag(kCpuHasSSE2)) { -@@ -6415,12 +5777,6 @@ static int I420ToARGBMatrixBilinear(cons - ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_NEON; - } - #endif --#if defined(HAS_SCALEROWUP2_BILINEAR_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- Scale2RowUp_Bilinear = ScaleRowUp2_Bilinear_RVV; -- ScaleRowUp2_Linear = ScaleRowUp2_Linear_RVV; -- } --#endif - - // alloc 4 lines temp - const int row_size = (width + 31) & ~31; -@@ -6429,8 +5785,6 @@ static int I420ToARGBMatrixBilinear(cons - uint8_t* temp_u_2 = row + row_size; - uint8_t* temp_v_1 = row + row_size * 2; - uint8_t* temp_v_2 = row + row_size * 3; -- if (!row) -- return 1; - - ScaleRowUp2_Linear(src_u, temp_u_1, width); - ScaleRowUp2_Linear(src_v, temp_v_1, width); -@@ -6513,11 +5867,6 @@ static int I422ToARGBMatrixLinear(const - } - } - #endif --#if defined(HAS_I444TOARGBROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- I444ToARGBRow = I444ToARGBRow_SVE2; -- } --#endif - #if defined(HAS_I444TOARGBROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - I444ToARGBRow = I444ToARGBRow_Any_MSA; -@@ -6534,11 +5883,6 @@ static int I422ToARGBMatrixLinear(const - } - } - #endif --#if defined(HAS_I444TOARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- I444ToARGBRow = I444ToARGBRow_RVV; -- } --#endif - #if defined(HAS_SCALEROWUP2_LINEAR_SSE2) - if (TestCpuFlag(kCpuHasSSE2)) { - ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_SSE2; -@@ -6559,19 +5903,12 @@ static int I422ToARGBMatrixLinear(const - ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_NEON; - } - #endif --#if defined(HAS_SCALEROWUP2_LINEAR_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ScaleRowUp2_Linear = ScaleRowUp2_Linear_RVV; -- } --#endif - - // alloc 2 lines temp - const int row_size = (width + 31) & ~31; - align_buffer_64(row, row_size * 2); - uint8_t* temp_u = row; - uint8_t* temp_v = row + row_size; -- if (!row) -- return 1; - - for (y = 0; y < height; ++y) { - ScaleRowUp2_Linear(src_u, temp_u, width); -@@ -6658,11 +5995,6 @@ static int I420ToRGB24MatrixBilinear(con - } - } - #endif --#if defined(HAS_I444TORGB24ROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- I444ToRGB24Row = I444ToRGB24Row_RVV; -- } --#endif - - #if defined(HAS_SCALEROWUP2_BILINEAR_SSE2) - if (TestCpuFlag(kCpuHasSSE2)) { -@@ -6691,12 +6023,6 @@ static int I420ToRGB24MatrixBilinear(con - ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_NEON; - } - #endif --#if defined(HAS_SCALEROWUP2_BILINEAR_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- Scale2RowUp_Bilinear = ScaleRowUp2_Bilinear_RVV; -- ScaleRowUp2_Linear = ScaleRowUp2_Linear_RVV; -- } --#endif - - // alloc 4 lines temp - const int row_size = (width + 31) & ~31; -@@ -6705,8 +6031,6 @@ static int I420ToRGB24MatrixBilinear(con - uint8_t* temp_u_2 = row + row_size; - uint8_t* temp_v_1 = row + row_size * 2; - uint8_t* temp_v_2 = row + row_size * 3; -- if (!row) -- return 1; - - ScaleRowUp2_Linear(src_u, temp_u_1, width); - ScaleRowUp2_Linear(src_v, temp_v_1, width); -@@ -6768,14 +6092,6 @@ static int I010ToAR30MatrixBilinear(cons - dst_ar30 = dst_ar30 + (height - 1) * dst_stride_ar30; - dst_stride_ar30 = -dst_stride_ar30; - } --#if defined(HAS_I410TOAR30ROW_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- I410ToAR30Row = I410ToAR30Row_Any_NEON; -- if (IS_ALIGNED(width, 8)) { -- I410ToAR30Row = I410ToAR30Row_NEON; -- } -- } --#endif - #if defined(HAS_I410TOAR30ROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - I410ToAR30Row = I410ToAR30Row_Any_SSSE3; -@@ -6821,8 +6137,6 @@ static int I010ToAR30MatrixBilinear(cons - uint16_t* temp_u_2 = (uint16_t*)(row) + row_size; - uint16_t* temp_v_1 = (uint16_t*)(row) + row_size * 2; - uint16_t* temp_v_2 = (uint16_t*)(row) + row_size * 3; -- if (!row) -- return 1; - - ScaleRowUp2_Linear_12(src_u, temp_u_1, width); - ScaleRowUp2_Linear_12(src_v, temp_v_1, width); -@@ -6882,14 +6196,6 @@ static int I210ToAR30MatrixLinear(const - dst_ar30 = dst_ar30 + (height - 1) * dst_stride_ar30; - dst_stride_ar30 = -dst_stride_ar30; - } --#if defined(HAS_I410TOAR30ROW_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- I410ToAR30Row = I410ToAR30Row_Any_NEON; -- if (IS_ALIGNED(width, 8)) { -- I410ToAR30Row = I410ToAR30Row_NEON; -- } -- } --#endif - #if defined(HAS_I410TOAR30ROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - I410ToAR30Row = I410ToAR30Row_Any_SSSE3; -@@ -6928,8 +6234,6 @@ static int I210ToAR30MatrixLinear(const - align_buffer_64(row, row_size * 2 * sizeof(uint16_t)); - uint16_t* temp_u = (uint16_t*)(row); - uint16_t* temp_v = (uint16_t*)(row) + row_size; -- if (!row) -- return 1; - - for (y = 0; y < height; ++y) { - ScaleRowUp2_Linear_12(src_u, temp_u, width); -@@ -6983,14 +6287,6 @@ static int I010ToARGBMatrixBilinear(cons - } - } - #endif --#if defined(HAS_I410TOARGBROW_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- I410ToARGBRow = I410ToARGBRow_Any_NEON; -- if (IS_ALIGNED(width, 8)) { -- I410ToARGBRow = I410ToARGBRow_NEON; -- } -- } --#endif - #if defined(HAS_I410TOARGBROW_AVX2) - if (TestCpuFlag(kCpuHasAVX2)) { - I410ToARGBRow = I410ToARGBRow_Any_AVX2; -@@ -7028,8 +6324,6 @@ static int I010ToARGBMatrixBilinear(cons - uint16_t* temp_u_2 = (uint16_t*)(row) + row_size; - uint16_t* temp_v_1 = (uint16_t*)(row) + row_size * 2; - uint16_t* temp_v_2 = (uint16_t*)(row) + row_size * 3; -- if (!row) -- return 1; - - ScaleRowUp2_Linear_12(src_u, temp_u_1, width); - ScaleRowUp2_Linear_12(src_v, temp_v_1, width); -@@ -7096,14 +6390,6 @@ static int I210ToARGBMatrixLinear(const - } - } - #endif --#if defined(HAS_I410TOARGBROW_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- I410ToARGBRow = I410ToARGBRow_Any_NEON; -- if (IS_ALIGNED(width, 8)) { -- I410ToARGBRow = I410ToARGBRow_NEON; -- } -- } --#endif - #if defined(HAS_I410TOARGBROW_AVX2) - if (TestCpuFlag(kCpuHasAVX2)) { - I410ToARGBRow = I410ToARGBRow_Any_AVX2; -@@ -7134,8 +6420,6 @@ static int I210ToARGBMatrixLinear(const - align_buffer_64(row, row_size * 2 * sizeof(uint16_t)); - uint16_t* temp_u = (uint16_t*)(row); - uint16_t* temp_v = (uint16_t*)(row) + row_size; -- if (!row) -- return 1; - - for (y = 0; y < height; ++y) { - ScaleRowUp2_Linear_12(src_u, temp_u, width); -@@ -7214,11 +6498,6 @@ static int I420AlphaToARGBMatrixBilinear - } - } - #endif --#if defined(HAS_I444ALPHATOARGBROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- I444AlphaToARGBRow = I444AlphaToARGBRow_SVE2; -- } --#endif - #if defined(HAS_I444ALPHATOARGBROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - I444AlphaToARGBRow = I444AlphaToARGBRow_Any_MSA; -@@ -7235,11 +6514,6 @@ static int I420AlphaToARGBMatrixBilinear - } - } - #endif --#if defined(HAS_I444ALPHATOARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- I444AlphaToARGBRow = I444AlphaToARGBRow_RVV; -- } --#endif - #if defined(HAS_ARGBATTENUATEROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - ARGBAttenuateRow = ARGBAttenuateRow_Any_SSSE3; -@@ -7272,11 +6546,6 @@ static int I420AlphaToARGBMatrixBilinear - } - } - #endif --#if defined(HAS_ARGBATTENUATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBAttenuateRow = ARGBAttenuateRow_RVV; -- } --#endif - - #if defined(HAS_SCALEROWUP2_BILINEAR_SSE2) - if (TestCpuFlag(kCpuHasSSE2)) { -@@ -7305,12 +6574,6 @@ static int I420AlphaToARGBMatrixBilinear - ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_NEON; - } - #endif --#if defined(HAS_SCALEROWUP2_BILINEAR_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- Scale2RowUp_Bilinear = ScaleRowUp2_Bilinear_RVV; -- ScaleRowUp2_Linear = ScaleRowUp2_Linear_RVV; -- } --#endif - - // alloc 4 lines temp - const int row_size = (width + 31) & ~31; -@@ -7319,8 +6582,6 @@ static int I420AlphaToARGBMatrixBilinear - uint8_t* temp_u_2 = row + row_size; - uint8_t* temp_v_1 = row + row_size * 2; - uint8_t* temp_v_2 = row + row_size * 3; -- if (!row) -- return 1; - - ScaleRowUp2_Linear(src_u, temp_u_1, width); - ScaleRowUp2_Linear(src_v, temp_v_1, width); -@@ -7429,11 +6690,6 @@ static int I422AlphaToARGBMatrixLinear(c - } - } - #endif --#if defined(HAS_I444ALPHATOARGBROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- I444AlphaToARGBRow = I444AlphaToARGBRow_SVE2; -- } --#endif - #if defined(HAS_I444ALPHATOARGBROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - I444AlphaToARGBRow = I444AlphaToARGBRow_Any_MSA; -@@ -7450,11 +6706,6 @@ static int I422AlphaToARGBMatrixLinear(c - } - } - #endif --#if defined(HAS_I444ALPHATOARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- I444AlphaToARGBRow = I444AlphaToARGBRow_RVV; -- } --#endif - #if defined(HAS_ARGBATTENUATEROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - ARGBAttenuateRow = ARGBAttenuateRow_Any_SSSE3; -@@ -7487,12 +6738,6 @@ static int I422AlphaToARGBMatrixLinear(c - } - } - #endif --#if defined(HAS_ARGBATTENUATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBAttenuateRow = ARGBAttenuateRow_RVV; -- } --#endif -- - #if defined(HAS_SCALEROWUP2_LINEAR_SSE2) - if (TestCpuFlag(kCpuHasSSE2)) { - ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_SSE2; -@@ -7513,19 +6758,12 @@ static int I422AlphaToARGBMatrixLinear(c - ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_NEON; - } - #endif --#if defined(HAS_SCALEROWUP2_LINEAR_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ScaleRowUp2_Linear = ScaleRowUp2_Linear_RVV; -- } --#endif - - // alloc 2 lines temp - const int row_size = (width + 31) & ~31; - align_buffer_64(row, row_size * 2); - uint8_t* temp_u = row; - uint8_t* temp_v = row + row_size; -- if (!row) -- return 1; - - for (y = 0; y < height; ++y) { - ScaleRowUp2_Linear(src_u, temp_u, width); -@@ -7585,14 +6823,6 @@ static int I010AlphaToARGBMatrixBilinear - dst_argb = dst_argb + (height - 1) * dst_stride_argb; - dst_stride_argb = -dst_stride_argb; - } --#if defined(HAS_I410ALPHATOARGBROW_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- I410AlphaToARGBRow = I410AlphaToARGBRow_Any_NEON; -- if (IS_ALIGNED(width, 8)) { -- I410AlphaToARGBRow = I410AlphaToARGBRow_NEON; -- } -- } --#endif - #if defined(HAS_I410ALPHATOARGBROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - I410AlphaToARGBRow = I410AlphaToARGBRow_Any_SSSE3; -@@ -7641,11 +6871,6 @@ static int I010AlphaToARGBMatrixBilinear - } - } - #endif --#if defined(HAS_ARGBATTENUATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBAttenuateRow = ARGBAttenuateRow_RVV; -- } --#endif - - #if defined(HAS_SCALEROWUP2_BILINEAR_12_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { -@@ -7675,8 +6900,6 @@ static int I010AlphaToARGBMatrixBilinear - uint16_t* temp_u_2 = (uint16_t*)(row) + row_size; - uint16_t* temp_v_1 = (uint16_t*)(row) + row_size * 2; - uint16_t* temp_v_2 = (uint16_t*)(row) + row_size * 3; -- if (!row) -- return 1; - - ScaleRowUp2_Linear_12(src_u, temp_u_1, width); - ScaleRowUp2_Linear_12(src_v, temp_v_1, width); -@@ -7761,14 +6984,6 @@ static int I210AlphaToARGBMatrixLinear(c - dst_argb = dst_argb + (height - 1) * dst_stride_argb; - dst_stride_argb = -dst_stride_argb; - } --#if defined(HAS_I410ALPHATOARGBROW_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- I410AlphaToARGBRow = I410AlphaToARGBRow_Any_NEON; -- if (IS_ALIGNED(width, 8)) { -- I410AlphaToARGBRow = I410AlphaToARGBRow_NEON; -- } -- } --#endif - #if defined(HAS_I410ALPHATOARGBROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - I410AlphaToARGBRow = I410AlphaToARGBRow_Any_SSSE3; -@@ -7817,11 +7032,6 @@ static int I210AlphaToARGBMatrixLinear(c - } - } - #endif --#if defined(HAS_ARGBATTENUATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBAttenuateRow = ARGBAttenuateRow_RVV; -- } --#endif - - #if defined(HAS_SCALEROWUP2_LINEAR_12_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { -@@ -7844,8 +7054,6 @@ static int I210AlphaToARGBMatrixLinear(c - align_buffer_64(row, row_size * 2 * sizeof(uint16_t)); - uint16_t* temp_u = (uint16_t*)(row); - uint16_t* temp_v = (uint16_t*)(row) + row_size; -- if (!row) -- return 1; - - for (y = 0; y < height; ++y) { - ScaleRowUp2_Linear(src_u, temp_u, width); -@@ -7931,8 +7139,6 @@ static int P010ToARGBMatrixBilinear(cons - align_buffer_64(row, row_size * 2 * sizeof(uint16_t)); - uint16_t* temp_uv_1 = (uint16_t*)(row); - uint16_t* temp_uv_2 = (uint16_t*)(row) + row_size; -- if (!row) -- return 1; - - Scale2RowUp_Bilinear_16(src_uv, 0, temp_uv_1, row_size, width); - P410ToARGBRow(src_y, temp_uv_1, dst_argb, yuvconstants, width); -@@ -8022,8 +7228,6 @@ static int P210ToARGBMatrixLinear(const - const int row_size = (2 * width + 31) & ~31; - align_buffer_64(row, row_size * sizeof(uint16_t)); - uint16_t* temp_uv = (uint16_t*)(row); -- if (!row) -- return 1; - - for (y = 0; y < height; ++y) { - ScaleRowUp2_Linear(src_uv, temp_uv, width); -@@ -8103,8 +7307,6 @@ static int P010ToAR30MatrixBilinear(cons - align_buffer_64(row, row_size * 2 * sizeof(uint16_t)); - uint16_t* temp_uv_1 = (uint16_t*)(row); - uint16_t* temp_uv_2 = (uint16_t*)(row) + row_size; -- if (!row) -- return 1; - - Scale2RowUp_Bilinear_16(src_uv, 0, temp_uv_1, row_size, width); - P410ToAR30Row(src_y, temp_uv_1, dst_ar30, yuvconstants, width); -@@ -8194,8 +7396,6 @@ static int P210ToAR30MatrixLinear(const - const int row_size = (2 * width + 31) & ~31; - align_buffer_64(row, row_size * sizeof(uint16_t)); - uint16_t* temp_uv = (uint16_t*)(row); -- if (!row) -- return 1; - - for (y = 0; y < height; ++y) { - ScaleRowUp2_Linear(src_uv, temp_uv, width); -@@ -8261,11 +7461,6 @@ static int I422ToRGB24MatrixLinear(const - } - } - #endif --#if defined(HAS_I444TORGB24ROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- I444ToRGB24Row = I444ToRGB24Row_RVV; -- } --#endif - #if defined(HAS_SCALEROWUP2_LINEAR_SSE2) - if (TestCpuFlag(kCpuHasSSE2)) { - ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_SSE2; -@@ -8286,19 +7481,12 @@ static int I422ToRGB24MatrixLinear(const - ScaleRowUp2_Linear = ScaleRowUp2_Linear_Any_NEON; - } - #endif --#if defined(HAS_SCALEROWUP2_LINEAR_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ScaleRowUp2_Linear = ScaleRowUp2_Linear_RVV; -- } --#endif - - // alloc 2 lines temp - const int row_size = (width + 31) & ~31; - align_buffer_64(row, row_size * 2); - uint8_t* temp_u = row; - uint8_t* temp_v = row + row_size; -- if (!row) -- return 1; - - for (y = 0; y < height; ++y) { - ScaleRowUp2_Linear(src_u, temp_u, width); -diff --git a/media/libyuv/libyuv/source/convert_from.cc b/media/libyuv/libyuv/source/convert_from.cc ---- a/media/libyuv/libyuv/source/convert_from.cc -+++ b/media/libyuv/libyuv/source/convert_from.cc -@@ -52,26 +52,19 @@ static int I420ToI4xx(const uint8_t* src - const int dst_y_height = Abs(src_y_height); - const int src_uv_width = SUBSAMPLE(src_y_width, 1, 1); - const int src_uv_height = SUBSAMPLE(src_y_height, 1, 1); -- int r; - if (src_y_width == 0 || src_y_height == 0 || dst_uv_width <= 0 || - dst_uv_height <= 0) { - return -1; - } - if (dst_y) { -- r = ScalePlane(src_y, src_stride_y, src_y_width, src_y_height, dst_y, -- dst_stride_y, dst_y_width, dst_y_height, kFilterBilinear); -- if (r != 0) { -- return r; -- } -+ ScalePlane(src_y, src_stride_y, src_y_width, src_y_height, dst_y, -+ dst_stride_y, dst_y_width, dst_y_height, kFilterBilinear); - } -- r = ScalePlane(src_u, src_stride_u, src_uv_width, src_uv_height, dst_u, -- dst_stride_u, dst_uv_width, dst_uv_height, kFilterBilinear); -- if (r != 0) { -- return r; -- } -- r = ScalePlane(src_v, src_stride_v, src_uv_width, src_uv_height, dst_v, -- dst_stride_v, dst_uv_width, dst_uv_height, kFilterBilinear); -- return r; -+ ScalePlane(src_u, src_stride_u, src_uv_width, src_uv_height, dst_u, -+ dst_stride_u, dst_uv_width, dst_uv_height, kFilterBilinear); -+ ScalePlane(src_v, src_stride_v, src_uv_width, src_uv_height, dst_v, -+ dst_stride_v, dst_uv_width, dst_uv_height, kFilterBilinear); -+ return 0; - } - - // Convert 8 bit YUV to 10 bit. -@@ -230,28 +223,21 @@ int I010ToI410(const uint16_t* src_y, - int dst_stride_v, - int width, - int height) { -- int r; - if (width == 0 || height == 0) { - return -1; - } - - if (dst_y) { -- r = ScalePlane_12(src_y, src_stride_y, width, height, dst_y, dst_stride_y, -- Abs(width), Abs(height), kFilterBilinear); -- if (r != 0) { -- return r; -- } -+ ScalePlane_12(src_y, src_stride_y, width, height, dst_y, dst_stride_y, -+ Abs(width), Abs(height), kFilterBilinear); - } -- r = ScalePlane_12(src_u, src_stride_u, SUBSAMPLE(width, 1, 1), -- SUBSAMPLE(height, 1, 1), dst_u, dst_stride_u, Abs(width), -- Abs(height), kFilterBilinear); -- if (r != 0) { -- return r; -- } -- r = ScalePlane_12(src_v, src_stride_v, SUBSAMPLE(width, 1, 1), -- SUBSAMPLE(height, 1, 1), dst_v, dst_stride_v, Abs(width), -- Abs(height), kFilterBilinear); -- return r; -+ ScalePlane_12(src_u, src_stride_u, SUBSAMPLE(width, 1, 1), -+ SUBSAMPLE(height, 1, 1), dst_u, dst_stride_u, Abs(width), -+ Abs(height), kFilterBilinear); -+ ScalePlane_12(src_v, src_stride_v, SUBSAMPLE(width, 1, 1), -+ SUBSAMPLE(height, 1, 1), dst_v, dst_stride_v, Abs(width), -+ Abs(height), kFilterBilinear); -+ return 0; - } - - // 422 chroma to 444 chroma, 10/12 bit version -@@ -270,26 +256,19 @@ int I210ToI410(const uint16_t* src_y, - int dst_stride_v, - int width, - int height) { -- int r; - if (width == 0 || height == 0) { - return -1; - } - - if (dst_y) { -- r = ScalePlane_12(src_y, src_stride_y, width, height, dst_y, dst_stride_y, -- Abs(width), Abs(height), kFilterBilinear); -- if (r != 0) { -- return r; -- } -+ ScalePlane_12(src_y, src_stride_y, width, height, dst_y, dst_stride_y, -+ Abs(width), Abs(height), kFilterBilinear); - } -- r = ScalePlane_12(src_u, src_stride_u, SUBSAMPLE(width, 1, 1), height, dst_u, -- dst_stride_u, Abs(width), Abs(height), kFilterBilinear); -- if (r != 0) { -- return r; -- } -- r = ScalePlane_12(src_v, src_stride_v, SUBSAMPLE(width, 1, 1), height, dst_v, -- dst_stride_v, Abs(width), Abs(height), kFilterBilinear); -- return r; -+ ScalePlane_12(src_u, src_stride_u, SUBSAMPLE(width, 1, 1), height, dst_u, -+ dst_stride_u, Abs(width), Abs(height), kFilterBilinear); -+ ScalePlane_12(src_v, src_stride_v, SUBSAMPLE(width, 1, 1), height, dst_v, -+ dst_stride_v, Abs(width), Abs(height), kFilterBilinear); -+ return 0; - } - - // 422 chroma is 1/2 width, 1x height -@@ -309,26 +288,19 @@ int I422ToI444(const uint8_t* src_y, - int dst_stride_v, - int width, - int height) { -- int r; - if (width == 0 || height == 0) { - return -1; - } - - if (dst_y) { -- r = ScalePlane(src_y, src_stride_y, width, height, dst_y, dst_stride_y, -- Abs(width), Abs(height), kFilterBilinear); -- if (r != 0) { -- return r; -- } -+ ScalePlane(src_y, src_stride_y, width, height, dst_y, dst_stride_y, -+ Abs(width), Abs(height), kFilterBilinear); - } -- r = ScalePlane(src_u, src_stride_u, SUBSAMPLE(width, 1, 1), height, dst_u, -- dst_stride_u, Abs(width), Abs(height), kFilterBilinear); -- if (r != 0) { -- return r; -- } -- r = ScalePlane(src_v, src_stride_v, SUBSAMPLE(width, 1, 1), height, dst_v, -- dst_stride_v, Abs(width), Abs(height), kFilterBilinear); -- return r; -+ ScalePlane(src_u, src_stride_u, SUBSAMPLE(width, 1, 1), height, dst_u, -+ dst_stride_u, Abs(width), Abs(height), kFilterBilinear); -+ ScalePlane(src_v, src_stride_v, SUBSAMPLE(width, 1, 1), height, dst_v, -+ dst_stride_v, Abs(width), Abs(height), kFilterBilinear); -+ return 0; - } - - // Copy to I400. Source can be I420,422,444,400,NV12,NV21 -@@ -474,14 +446,6 @@ int I420ToYUY2(const uint8_t* src_y, - } - } - #endif --#if defined(HAS_I422TOYUY2ROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- I422ToYUY2Row = I422ToYUY2Row_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- I422ToYUY2Row = I422ToYUY2Row_LSX; -- } -- } --#endif - #if defined(HAS_I422TOYUY2ROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - I422ToYUY2Row = I422ToYUY2Row_Any_LASX; -@@ -569,14 +533,6 @@ int I422ToUYVY(const uint8_t* src_y, - } - } - #endif --#if defined(HAS_I422TOUYVYROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- I422ToUYVYRow = I422ToUYVYRow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- I422ToUYVYRow = I422ToUYVYRow_LSX; -- } -- } --#endif - #if defined(HAS_I422TOUYVYROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - I422ToUYVYRow = I422ToUYVYRow_Any_LASX; -@@ -652,14 +608,6 @@ int I420ToUYVY(const uint8_t* src_y, - } - } - #endif --#if defined(HAS_I422TOUYVYROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- I422ToUYVYRow = I422ToUYVYRow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- I422ToUYVYRow = I422ToUYVYRow_LSX; -- } -- } --#endif - #if defined(HAS_I422TOUYVYROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - I422ToUYVYRow = I422ToUYVYRow_Any_LASX; -diff --git a/media/libyuv/libyuv/source/convert_from_argb.cc b/media/libyuv/libyuv/source/convert_from_argb.cc ---- a/media/libyuv/libyuv/source/convert_from_argb.cc -+++ b/media/libyuv/libyuv/source/convert_from_argb.cc -@@ -76,14 +76,6 @@ int ARGBToI444(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOUV444ROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBToUV444Row = ARGBToUV444Row_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- ARGBToUV444Row = ARGBToUV444Row_LSX; -- } -- } --#endif - #if defined(HAS_ARGBTOUV444ROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - ARGBToUV444Row = ARGBToUV444Row_Any_LASX; -@@ -116,14 +108,6 @@ int ARGBToI444(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYROW_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- ARGBToYRow = ARGBToYRow_Any_NEON_DotProd; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYRow = ARGBToYRow_NEON_DotProd; -- } -- } --#endif - #if defined(HAS_ARGBTOYROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - ARGBToYRow = ARGBToYRow_Any_MSA; -@@ -148,11 +132,6 @@ int ARGBToI444(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBToYRow = ARGBToYRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - ARGBToUV444Row(src_argb, dst_u, dst_v, width); -@@ -239,14 +218,6 @@ int ARGBToI422(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYROW_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- ARGBToYRow = ARGBToYRow_Any_NEON_DotProd; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYRow = ARGBToYRow_NEON_DotProd; -- } -- } --#endif - #if defined(HAS_ARGBTOUVROW_NEON) - if (TestCpuFlag(kCpuHasNEON)) { - ARGBToUVRow = ARGBToUVRow_Any_NEON; -@@ -255,14 +226,6 @@ int ARGBToI422(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOUVROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- ARGBToUVRow = ARGBToUVRow_Any_SVE2; -- if (IS_ALIGNED(width, 2)) { -- ARGBToUVRow = ARGBToUVRow_SVE2; -- } -- } --#endif - #if defined(HAS_ARGBTOYROW_MSA) && defined(HAS_ARGBTOUVROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - ARGBToYRow = ARGBToYRow_Any_MSA; -@@ -283,16 +246,6 @@ int ARGBToI422(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYROW_LSX) && defined(HAS_ARGBTOUVROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBToYRow = ARGBToYRow_Any_LSX; -- ARGBToUVRow = ARGBToUVRow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYRow = ARGBToYRow_LSX; -- ARGBToUVRow = ARGBToUVRow_LSX; -- } -- } --#endif - #if defined(HAS_ARGBTOYROW_LASX) && defined(HAS_ARGBTOUVROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - ARGBToYRow = ARGBToYRow_Any_LASX; -@@ -303,11 +256,6 @@ int ARGBToI422(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBToYRow = ARGBToYRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - ARGBToUVRow(src_argb, 0, dst_u, dst_v, width); -@@ -355,14 +303,6 @@ int ARGBToNV12(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYROW_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- ARGBToYRow = ARGBToYRow_Any_NEON_DotProd; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYRow = ARGBToYRow_NEON_DotProd; -- } -- } --#endif - #if defined(HAS_ARGBTOUVROW_NEON) - if (TestCpuFlag(kCpuHasNEON)) { - ARGBToUVRow = ARGBToUVRow_Any_NEON; -@@ -371,14 +311,6 @@ int ARGBToNV12(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOUVROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- ARGBToUVRow = ARGBToUVRow_Any_SVE2; -- if (IS_ALIGNED(width, 2)) { -- ARGBToUVRow = ARGBToUVRow_SVE2; -- } -- } --#endif - #if defined(HAS_ARGBTOYROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - ARGBToYRow = ARGBToYRow_Any_SSSE3; -@@ -441,11 +373,6 @@ int ARGBToNV12(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBToYRow = ARGBToYRow_RVV; -- } --#endif - #if defined(HAS_MERGEUVROW_SSE2) - if (TestCpuFlag(kCpuHasSSE2)) { - MergeUVRow_ = MergeUVRow_Any_SSE2; -@@ -457,7 +384,7 @@ int ARGBToNV12(const uint8_t* src_argb, - #if defined(HAS_MERGEUVROW_AVX2) - if (TestCpuFlag(kCpuHasAVX2)) { - MergeUVRow_ = MergeUVRow_Any_AVX2; -- if (IS_ALIGNED(halfwidth, 16)) { -+ if (IS_ALIGNED(halfwidth, 32)) { - MergeUVRow_ = MergeUVRow_AVX2; - } - } -@@ -494,17 +421,10 @@ int ARGBToNV12(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_MERGEUVROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- MergeUVRow_ = MergeUVRow_RVV; -- } --#endif - { - // Allocate a rows of uv. - align_buffer_64(row_u, ((halfwidth + 31) & ~31) * 2); - uint8_t* row_v = row_u + ((halfwidth + 31) & ~31); -- if (!row_u) -- return 1; - - for (y = 0; y < height - 1; y += 2) { - ARGBToUVRow(src_argb, src_stride_argb, row_u, row_v, width); -@@ -593,14 +513,6 @@ int ARGBToNV21(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYROW_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- ARGBToYRow = ARGBToYRow_Any_NEON_DotProd; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYRow = ARGBToYRow_NEON_DotProd; -- } -- } --#endif - #if defined(HAS_ARGBTOUVROW_NEON) - if (TestCpuFlag(kCpuHasNEON)) { - ARGBToUVRow = ARGBToUVRow_Any_NEON; -@@ -609,14 +521,6 @@ int ARGBToNV21(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOUVROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- ARGBToUVRow = ARGBToUVRow_Any_SVE2; -- if (IS_ALIGNED(width, 2)) { -- ARGBToUVRow = ARGBToUVRow_SVE2; -- } -- } --#endif - #if defined(HAS_ARGBTOYROW_MSA) && defined(HAS_ARGBTOUVROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - ARGBToYRow = ARGBToYRow_Any_MSA; -@@ -637,16 +541,6 @@ int ARGBToNV21(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYROW_LSX) && defined(HAS_ARGBTOUVROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBToYRow = ARGBToYRow_Any_LSX; -- ARGBToUVRow = ARGBToUVRow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYRow = ARGBToYRow_LSX; -- ARGBToUVRow = ARGBToUVRow_LSX; -- } -- } --#endif - #if defined(HAS_ARGBTOYROW_LASX) && defined(HAS_ARGBTOUVROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - ARGBToYRow = ARGBToYRow_Any_LASX; -@@ -657,11 +551,6 @@ int ARGBToNV21(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBToYRow = ARGBToYRow_RVV; -- } --#endif - #if defined(HAS_MERGEUVROW_SSE2) - if (TestCpuFlag(kCpuHasSSE2)) { - MergeUVRow_ = MergeUVRow_Any_SSE2; -@@ -673,7 +562,7 @@ int ARGBToNV21(const uint8_t* src_argb, - #if defined(HAS_MERGEUVROW_AVX2) - if (TestCpuFlag(kCpuHasAVX2)) { - MergeUVRow_ = MergeUVRow_Any_AVX2; -- if (IS_ALIGNED(halfwidth, 16)) { -+ if (IS_ALIGNED(halfwidth, 32)) { - MergeUVRow_ = MergeUVRow_AVX2; - } - } -@@ -710,17 +599,10 @@ int ARGBToNV21(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_MERGEUVROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- MergeUVRow_ = MergeUVRow_RVV; -- } --#endif - { - // Allocate a rows of uv. - align_buffer_64(row_u, ((halfwidth + 31) & ~31) * 2); - uint8_t* row_v = row_u + ((halfwidth + 31) & ~31); -- if (!row_u) -- return 1; - - for (y = 0; y < height - 1; y += 2) { - ARGBToUVRow(src_argb, src_stride_argb, row_u, row_v, width); -@@ -808,14 +690,6 @@ int ABGRToNV12(const uint8_t* src_abgr, - } - } - #endif --#if defined(HAS_ABGRTOYROW_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- ABGRToYRow = ABGRToYRow_Any_NEON_DotProd; -- if (IS_ALIGNED(width, 16)) { -- ABGRToYRow = ABGRToYRow_NEON_DotProd; -- } -- } --#endif - #if defined(HAS_ABGRTOUVROW_NEON) - if (TestCpuFlag(kCpuHasNEON)) { - ABGRToUVRow = ABGRToUVRow_Any_NEON; -@@ -824,14 +698,6 @@ int ABGRToNV12(const uint8_t* src_abgr, - } - } - #endif --#if defined(HAS_ABGRTOUVROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- ABGRToUVRow = ABGRToUVRow_Any_SVE2; -- if (IS_ALIGNED(width, 2)) { -- ABGRToUVRow = ABGRToUVRow_SVE2; -- } -- } --#endif - #if defined(HAS_ABGRTOYROW_MSA) && defined(HAS_ABGRTOUVROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - ABGRToYRow = ABGRToYRow_Any_MSA; -@@ -860,11 +726,6 @@ int ABGRToNV12(const uint8_t* src_abgr, - } - } - #endif --#if defined(HAS_ABGRTOYROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ABGRToYRow = ABGRToYRow_RVV; -- } --#endif - #if defined(HAS_MERGEUVROW_SSE2) - if (TestCpuFlag(kCpuHasSSE2)) { - MergeUVRow_ = MergeUVRow_Any_SSE2; -@@ -876,7 +737,7 @@ int ABGRToNV12(const uint8_t* src_abgr, - #if defined(HAS_MERGEUVROW_AVX2) - if (TestCpuFlag(kCpuHasAVX2)) { - MergeUVRow_ = MergeUVRow_Any_AVX2; -- if (IS_ALIGNED(halfwidth, 16)) { -+ if (IS_ALIGNED(halfwidth, 32)) { - MergeUVRow_ = MergeUVRow_AVX2; - } - } -@@ -913,17 +774,10 @@ int ABGRToNV12(const uint8_t* src_abgr, - } - } - #endif --#if defined(HAS_MERGEUVROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- MergeUVRow_ = MergeUVRow_RVV; -- } --#endif - { - // Allocate a rows of uv. - align_buffer_64(row_u, ((halfwidth + 31) & ~31) * 2); - uint8_t* row_v = row_u + ((halfwidth + 31) & ~31); -- if (!row_u) -- return 1; - - for (y = 0; y < height - 1; y += 2) { - ABGRToUVRow(src_abgr, src_stride_abgr, row_u, row_v, width); -@@ -1012,14 +866,6 @@ int ABGRToNV21(const uint8_t* src_abgr, - } - } - #endif --#if defined(HAS_ABGRTOYROW_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- ABGRToYRow = ABGRToYRow_Any_NEON_DotProd; -- if (IS_ALIGNED(width, 16)) { -- ABGRToYRow = ABGRToYRow_NEON_DotProd; -- } -- } --#endif - #if defined(HAS_ABGRTOUVROW_NEON) - if (TestCpuFlag(kCpuHasNEON)) { - ABGRToUVRow = ABGRToUVRow_Any_NEON; -@@ -1028,14 +874,6 @@ int ABGRToNV21(const uint8_t* src_abgr, - } - } - #endif --#if defined(HAS_ABGRTOUVROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- ABGRToUVRow = ABGRToUVRow_Any_SVE2; -- if (IS_ALIGNED(width, 2)) { -- ABGRToUVRow = ABGRToUVRow_SVE2; -- } -- } --#endif - #if defined(HAS_ABGRTOYROW_MSA) && defined(HAS_ABGRTOUVROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - ABGRToYRow = ABGRToYRow_Any_MSA; -@@ -1064,11 +902,6 @@ int ABGRToNV21(const uint8_t* src_abgr, - } - } - #endif --#if defined(HAS_ABGRTOYROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ABGRToYRow = ABGRToYRow_RVV; -- } --#endif - #if defined(HAS_MERGEUVROW_SSE2) - if (TestCpuFlag(kCpuHasSSE2)) { - MergeUVRow_ = MergeUVRow_Any_SSE2; -@@ -1080,7 +913,7 @@ int ABGRToNV21(const uint8_t* src_abgr, - #if defined(HAS_MERGEUVROW_AVX2) - if (TestCpuFlag(kCpuHasAVX2)) { - MergeUVRow_ = MergeUVRow_Any_AVX2; -- if (IS_ALIGNED(halfwidth, 16)) { -+ if (IS_ALIGNED(halfwidth, 32)) { - MergeUVRow_ = MergeUVRow_AVX2; - } - } -@@ -1117,17 +950,10 @@ int ABGRToNV21(const uint8_t* src_abgr, - } - } - #endif --#if defined(HAS_MERGEUVROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- MergeUVRow_ = MergeUVRow_RVV; -- } --#endif - { - // Allocate a rows of uv. - align_buffer_64(row_u, ((halfwidth + 31) & ~31) * 2); - uint8_t* row_v = row_u + ((halfwidth + 31) & ~31); -- if (!row_u) -- return 1; - - for (y = 0; y < height - 1; y += 2) { - ABGRToUVRow(src_abgr, src_stride_abgr, row_u, row_v, width); -@@ -1221,14 +1047,6 @@ int ARGBToYUY2(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYROW_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- ARGBToYRow = ARGBToYRow_Any_NEON_DotProd; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYRow = ARGBToYRow_NEON_DotProd; -- } -- } --#endif - #if defined(HAS_ARGBTOUVROW_NEON) - if (TestCpuFlag(kCpuHasNEON)) { - ARGBToUVRow = ARGBToUVRow_Any_NEON; -@@ -1237,14 +1055,6 @@ int ARGBToYUY2(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOUVROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- ARGBToUVRow = ARGBToUVRow_Any_SVE2; -- if (IS_ALIGNED(width, 2)) { -- ARGBToUVRow = ARGBToUVRow_SVE2; -- } -- } --#endif - #if defined(HAS_ARGBTOYROW_MSA) && defined(HAS_ARGBTOUVROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - ARGBToYRow = ARGBToYRow_Any_MSA; -@@ -1265,16 +1075,6 @@ int ARGBToYUY2(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYROW_LSX) && defined(HAS_ARGBTOUVROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBToYRow = ARGBToYRow_Any_LSX; -- ARGBToUVRow = ARGBToUVRow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYRow = ARGBToYRow_LSX; -- ARGBToUVRow = ARGBToUVRow_LSX; -- } -- } --#endif - #if defined(HAS_ARGBTOYROW_LASX) && defined(HAS_ARGBTOUVROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - ARGBToYRow = ARGBToYRow_Any_LASX; -@@ -1285,11 +1085,6 @@ int ARGBToYUY2(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBToYRow = ARGBToYRow_RVV; -- } --#endif - #if defined(HAS_I422TOYUY2ROW_SSE2) - if (TestCpuFlag(kCpuHasSSE2)) { - I422ToYUY2Row = I422ToYUY2Row_Any_SSE2; -@@ -1322,14 +1117,6 @@ int ARGBToYUY2(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_I422TOYUY2ROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- I422ToYUY2Row = I422ToYUY2Row_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- I422ToYUY2Row = I422ToYUY2Row_LSX; -- } -- } --#endif - #if defined(HAS_I422TOYUY2ROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - I422ToYUY2Row = I422ToYUY2Row_Any_LASX; -@@ -1344,8 +1131,6 @@ int ARGBToYUY2(const uint8_t* src_argb, - align_buffer_64(row_y, ((width + 63) & ~63) * 2); - uint8_t* row_u = row_y + ((width + 63) & ~63); - uint8_t* row_v = row_u + ((width + 63) & ~63) / 2; -- if (!row_y) -- return 1; - - for (y = 0; y < height; ++y) { - ARGBToUVRow(src_argb, 0, row_u, row_v, width); -@@ -1433,14 +1218,6 @@ int ARGBToUYVY(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYROW_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- ARGBToYRow = ARGBToYRow_Any_NEON_DotProd; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYRow = ARGBToYRow_NEON_DotProd; -- } -- } --#endif - #if defined(HAS_ARGBTOUVROW_NEON) - if (TestCpuFlag(kCpuHasNEON)) { - ARGBToUVRow = ARGBToUVRow_Any_NEON; -@@ -1449,14 +1226,6 @@ int ARGBToUYVY(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOUVROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- ARGBToUVRow = ARGBToUVRow_Any_SVE2; -- if (IS_ALIGNED(width, 2)) { -- ARGBToUVRow = ARGBToUVRow_SVE2; -- } -- } --#endif - #if defined(HAS_ARGBTOYROW_MSA) && defined(HAS_ARGBTOUVROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - ARGBToYRow = ARGBToYRow_Any_MSA; -@@ -1477,16 +1246,6 @@ int ARGBToUYVY(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYROW_LSX) && defined(HAS_ARGBTOUVROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBToYRow = ARGBToYRow_Any_LSX; -- ARGBToUVRow = ARGBToUVRow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYRow = ARGBToYRow_LSX; -- ARGBToUVRow = ARGBToUVRow_LSX; -- } -- } --#endif - #if defined(HAS_ARGBTOYROW_LASX) && defined(HAS_ARGBTOUVROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - ARGBToYRow = ARGBToYRow_Any_LASX; -@@ -1497,11 +1256,6 @@ int ARGBToUYVY(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBToYRow = ARGBToYRow_RVV; -- } --#endif - #if defined(HAS_I422TOUYVYROW_SSE2) - if (TestCpuFlag(kCpuHasSSE2)) { - I422ToUYVYRow = I422ToUYVYRow_Any_SSE2; -@@ -1534,14 +1288,6 @@ int ARGBToUYVY(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_I422TOUYVYROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- I422ToUYVYRow = I422ToUYVYRow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- I422ToUYVYRow = I422ToUYVYRow_LSX; -- } -- } --#endif - #if defined(HAS_I422TOUYVYROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - I422ToUYVYRow = I422ToUYVYRow_Any_LASX; -@@ -1556,8 +1302,6 @@ int ARGBToUYVY(const uint8_t* src_argb, - align_buffer_64(row_y, ((width + 63) & ~63) * 2); - uint8_t* row_u = row_y + ((width + 63) & ~63); - uint8_t* row_v = row_u + ((width + 63) & ~63) / 2; -- if (!row_y) -- return 1; - - for (y = 0; y < height; ++y) { - ARGBToUVRow(src_argb, 0, row_u, row_v, width); -@@ -1621,14 +1365,6 @@ int ARGBToI400(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYROW_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- ARGBToYRow = ARGBToYRow_Any_NEON_DotProd; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYRow = ARGBToYRow_NEON_DotProd; -- } -- } --#endif - #if defined(HAS_ARGBTOYROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - ARGBToYRow = ARGBToYRow_Any_MSA; -@@ -1653,11 +1389,6 @@ int ARGBToI400(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBToYRow = ARGBToYRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - ARGBToYRow(src_argb, dst_y, width); -@@ -1667,7 +1398,6 @@ int ARGBToI400(const uint8_t* src_argb, - return 0; - } - --#ifndef __riscv - // Shuffle table for converting ARGB to RGBA. - static const uvec8 kShuffleMaskARGBToRGBA = { - 3u, 0u, 1u, 2u, 7u, 4u, 5u, 6u, 11u, 8u, 9u, 10u, 15u, 12u, 13u, 14u}; -@@ -1683,47 +1413,6 @@ int ARGBToRGBA(const uint8_t* src_argb, - return ARGBShuffle(src_argb, src_stride_argb, dst_rgba, dst_stride_rgba, - (const uint8_t*)(&kShuffleMaskARGBToRGBA), width, height); - } --#else --// Convert ARGB to RGBA. --LIBYUV_API --int ARGBToRGBA(const uint8_t* src_argb, -- int src_stride_argb, -- uint8_t* dst_rgba, -- int dst_stride_rgba, -- int width, -- int height) { -- int y; -- void (*ARGBToRGBARow)(const uint8_t* src_argb, uint8_t* dst_rgba, int width) = -- ARGBToRGBARow_C; -- if (!src_argb || !dst_rgba || width <= 0 || height == 0) { -- return -1; -- } -- if (height < 0) { -- height = -height; -- src_argb = src_argb + (height - 1) * src_stride_argb; -- src_stride_argb = -src_stride_argb; -- } -- // Coalesce rows. -- if (src_stride_argb == width * 4 && dst_stride_rgba == width * 4) { -- width *= height; -- height = 1; -- src_stride_argb = dst_stride_rgba = 0; -- } -- --#if defined(HAS_ARGBTORGBAROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBToRGBARow = ARGBToRGBARow_RVV; -- } --#endif -- -- for (y = 0; y < height; ++y) { -- ARGBToRGBARow(src_argb, dst_rgba, width); -- src_argb += src_stride_argb; -- dst_rgba += dst_stride_rgba; -- } -- return 0; --} --#endif - - // Convert ARGB To RGB24. - LIBYUV_API -@@ -1790,14 +1479,6 @@ int ARGBToRGB24(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTORGB24ROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBToRGB24Row = ARGBToRGB24Row_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- ARGBToRGB24Row = ARGBToRGB24Row_LSX; -- } -- } --#endif - #if defined(HAS_ARGBTORGB24ROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - ARGBToRGB24Row = ARGBToRGB24Row_Any_LASX; -@@ -1806,11 +1487,6 @@ int ARGBToRGB24(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTORGB24ROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBToRGB24Row = ARGBToRGB24Row_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - ARGBToRGB24Row(src_argb, dst_rgb24, width); -@@ -1877,14 +1553,6 @@ int ARGBToRAW(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTORAWROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBToRAWRow = ARGBToRAWRow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- ARGBToRAWRow = ARGBToRAWRow_LSX; -- } -- } --#endif - #if defined(HAS_ARGBTORAWROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - ARGBToRAWRow = ARGBToRAWRow_Any_LASX; -@@ -1893,11 +1561,6 @@ int ARGBToRAW(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTORAWROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBToRAWRow = ARGBToRAWRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - ARGBToRAWRow(src_argb, dst_raw, width); -@@ -1923,7 +1586,7 @@ int ARGBToRGB565Dither(const uint8_t* sr - int height) { - int y; - void (*ARGBToRGB565DitherRow)(const uint8_t* src_argb, uint8_t* dst_rgb, -- uint32_t dither4, int width) = -+ const uint32_t dither4, int width) = - ARGBToRGB565DitherRow_C; - if (!src_argb || !dst_rgb565 || width <= 0 || height == 0) { - return -1; -@@ -1960,11 +1623,6 @@ int ARGBToRGB565Dither(const uint8_t* sr - } - } - #endif --#if defined(HAS_ARGBTORGB565DITHERROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_SVE2; -- } --#endif - #if defined(HAS_ARGBTORGB565DITHERROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_Any_MSA; -@@ -1973,14 +1631,6 @@ int ARGBToRGB565Dither(const uint8_t* sr - } - } - #endif --#if defined(HAS_ARGBTORGB565DITHERROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_Any_LSX; -- if (IS_ALIGNED(width, 8)) { -- ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_LSX; -- } -- } --#endif - #if defined(HAS_ARGBTORGB565DITHERROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - ARGBToRGB565DitherRow = ARGBToRGB565DitherRow_Any_LASX; -@@ -2050,11 +1700,6 @@ int ARGBToRGB565(const uint8_t* src_argb - } - } - #endif --#if defined(HAS_ARGBTORGB565ROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- ARGBToRGB565Row = ARGBToRGB565Row_SVE2; -- } --#endif - #if defined(HAS_ARGBTORGB565ROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - ARGBToRGB565Row = ARGBToRGB565Row_Any_MSA; -@@ -2063,15 +1708,6 @@ int ARGBToRGB565(const uint8_t* src_argb - } - } - #endif --#if defined(HAS_ARGBTORGB565ROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBToRGB565Row = ARGBToRGB565Row_Any_LSX; -- if (IS_ALIGNED(width, 8)) { -- ARGBToRGB565Row = ARGBToRGB565Row_LSX; -- } -- } --#endif -- - #if defined(HAS_ARGBTORGB565ROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - ARGBToRGB565Row = ARGBToRGB565Row_Any_LASX; -@@ -2146,14 +1782,6 @@ int ARGBToARGB1555(const uint8_t* src_ar - } - } - #endif --#if defined(HAS_ARGBTOARGB1555ROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBToARGB1555Row = ARGBToARGB1555Row_Any_LSX; -- if (IS_ALIGNED(width, 8)) { -- ARGBToARGB1555Row = ARGBToARGB1555Row_LSX; -- } -- } --#endif - #if defined(HAS_ARGBTOARGB1555ROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - ARGBToARGB1555Row = ARGBToARGB1555Row_Any_LASX; -@@ -2228,14 +1856,6 @@ int ARGBToARGB4444(const uint8_t* src_ar - } - } - #endif --#if defined(HAS_ARGBTOARGB4444ROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBToARGB4444Row = ARGBToARGB4444Row_Any_LSX; -- if (IS_ALIGNED(width, 8)) { -- ARGBToARGB4444Row = ARGBToARGB4444Row_LSX; -- } -- } --#endif - #if defined(HAS_ARGBTOARGB4444ROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - ARGBToARGB4444Row = ARGBToARGB4444Row_Any_LASX; -@@ -2278,14 +1898,6 @@ int ABGRToAR30(const uint8_t* src_abgr, - height = 1; - src_stride_abgr = dst_stride_ar30 = 0; - } --#if defined(HAS_ABGRTOAR30ROW_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- ABGRToAR30Row = ABGRToAR30Row_Any_NEON; -- if (IS_ALIGNED(width, 8)) { -- ABGRToAR30Row = ABGRToAR30Row_NEON; -- } -- } --#endif - #if defined(HAS_ABGRTOAR30ROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - ABGRToAR30Row = ABGRToAR30Row_Any_SSSE3; -@@ -2335,14 +1947,6 @@ int ARGBToAR30(const uint8_t* src_argb, - height = 1; - src_stride_argb = dst_stride_ar30 = 0; - } --#if defined(HAS_ARGBTOAR30ROW_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- ARGBToAR30Row = ARGBToAR30Row_Any_NEON; -- if (IS_ALIGNED(width, 8)) { -- ARGBToAR30Row = ARGBToAR30Row_NEON; -- } -- } --#endif - #if defined(HAS_ARGBTOAR30ROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - ARGBToAR30Row = ARGBToAR30Row_Any_SSSE3; -@@ -2402,14 +2006,6 @@ int ARGBToJ420(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYJROW_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- ARGBToYJRow = ARGBToYJRow_Any_NEON_DotProd; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYJRow = ARGBToYJRow_NEON_DotProd; -- } -- } --#endif - #if defined(HAS_ARGBTOUVJROW_NEON) - if (TestCpuFlag(kCpuHasNEON)) { - ARGBToUVJRow = ARGBToUVJRow_Any_NEON; -@@ -2418,14 +2014,6 @@ int ARGBToJ420(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOUVJROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- ARGBToUVJRow = ARGBToUVJRow_Any_SVE2; -- if (IS_ALIGNED(width, 2)) { -- ARGBToUVJRow = ARGBToUVJRow_SVE2; -- } -- } --#endif - #if defined(HAS_ARGBTOYJROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - ARGBToYJRow = ARGBToYJRow_Any_SSSE3; -@@ -2490,11 +2078,6 @@ int ARGBToJ420(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYJROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBToYJRow = ARGBToYJRow_RVV; -- } --#endif - - for (y = 0; y < height - 1; y += 2) { - ARGBToUVJRow(src_argb, src_stride_argb, dst_uj, dst_vj, width); -@@ -2586,14 +2169,6 @@ int ARGBToJ422(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYJROW_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- ARGBToYJRow = ARGBToYJRow_Any_NEON_DotProd; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYJRow = ARGBToYJRow_NEON_DotProd; -- } -- } --#endif - #if defined(HAS_ARGBTOUVJROW_NEON) - if (TestCpuFlag(kCpuHasNEON)) { - ARGBToUVJRow = ARGBToUVJRow_Any_NEON; -@@ -2602,14 +2177,6 @@ int ARGBToJ422(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOUVJROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- ARGBToUVJRow = ARGBToUVJRow_Any_SVE2; -- if (IS_ALIGNED(width, 2)) { -- ARGBToUVJRow = ARGBToUVJRow_SVE2; -- } -- } --#endif - #if defined(HAS_ARGBTOYJROW_MSA) && defined(HAS_ARGBTOUVJROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - ARGBToYJRow = ARGBToYJRow_Any_MSA; -@@ -2642,11 +2209,6 @@ int ARGBToJ422(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYJROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBToYJRow = ARGBToYJRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - ARGBToUVJRow(src_argb, 0, dst_uj, dst_vj, width); -@@ -2708,14 +2270,6 @@ int ARGBToJ400(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYJROW_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- ARGBToYJRow = ARGBToYJRow_Any_NEON_DotProd; -- if (IS_ALIGNED(width, 16)) { -- ARGBToYJRow = ARGBToYJRow_NEON_DotProd; -- } -- } --#endif - #if defined(HAS_ARGBTOYJROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - ARGBToYJRow = ARGBToYJRow_Any_MSA; -@@ -2724,11 +2278,6 @@ int ARGBToJ400(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOYJROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBToYJRow = ARGBToYJRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - ARGBToYJRow(src_argb, dst_yj, width); -@@ -2787,14 +2336,6 @@ int RGBAToJ400(const uint8_t* src_rgba, - } - } - #endif --#if defined(HAS_RGBATOYJROW_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- RGBAToYJRow = RGBAToYJRow_Any_NEON_DotProd; -- if (IS_ALIGNED(width, 16)) { -- RGBAToYJRow = RGBAToYJRow_NEON_DotProd; -- } -- } --#endif - #if defined(HAS_RGBATOYJROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - RGBAToYJRow = RGBAToYJRow_Any_MSA; -@@ -2819,11 +2360,6 @@ int RGBAToJ400(const uint8_t* src_rgba, - } - } - #endif --#if defined(HAS_RGBATOYJROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- RGBAToYJRow = RGBAToYJRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - RGBAToYJRow(src_rgba, dst_yj, width); -@@ -2900,14 +2436,6 @@ int ABGRToJ420(const uint8_t* src_abgr, - } - } - #endif --#if defined(HAS_ABGRTOYJROW_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- ABGRToYJRow = ABGRToYJRow_Any_NEON_DotProd; -- if (IS_ALIGNED(width, 16)) { -- ABGRToYJRow = ABGRToYJRow_NEON_DotProd; -- } -- } --#endif - #if defined(HAS_ABGRTOUVJROW_NEON) - if (TestCpuFlag(kCpuHasNEON)) { - ABGRToUVJRow = ABGRToUVJRow_Any_NEON; -@@ -2916,14 +2444,6 @@ int ABGRToJ420(const uint8_t* src_abgr, - } - } - #endif --#if defined(HAS_ABGRTOUVJROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- ABGRToUVJRow = ABGRToUVJRow_Any_SVE2; -- if (IS_ALIGNED(width, 2)) { -- ABGRToUVJRow = ABGRToUVJRow_SVE2; -- } -- } --#endif - #if defined(HAS_ABGRTOYJROW_MSA) && defined(HAS_ABGRTOUVJROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - ABGRToYJRow = ABGRToYJRow_Any_MSA; -@@ -2950,11 +2470,6 @@ int ABGRToJ420(const uint8_t* src_abgr, - } - } - #endif --#if defined(HAS_ABGRTOYJROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ABGRToYJRow = ABGRToYJRow_RVV; -- } --#endif - - for (y = 0; y < height - 1; y += 2) { - ABGRToUVJRow(src_abgr, src_stride_abgr, dst_uj, dst_vj, width); -@@ -3046,14 +2561,6 @@ int ABGRToJ422(const uint8_t* src_abgr, - } - } - #endif --#if defined(HAS_ABGRTOYJROW_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- ABGRToYJRow = ABGRToYJRow_Any_NEON_DotProd; -- if (IS_ALIGNED(width, 16)) { -- ABGRToYJRow = ABGRToYJRow_NEON_DotProd; -- } -- } --#endif - #if defined(HAS_ABGRTOUVJROW_NEON) - if (TestCpuFlag(kCpuHasNEON)) { - ABGRToUVJRow = ABGRToUVJRow_Any_NEON; -@@ -3062,14 +2569,6 @@ int ABGRToJ422(const uint8_t* src_abgr, - } - } - #endif --#if defined(HAS_ABGRTOUVJROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- ABGRToUVJRow = ABGRToUVJRow_Any_SVE2; -- if (IS_ALIGNED(width, 2)) { -- ABGRToUVJRow = ABGRToUVJRow_SVE2; -- } -- } --#endif - #if defined(HAS_ABGRTOYJROW_MSA) && defined(HAS_ABGRTOUVJROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - ABGRToYJRow = ABGRToYJRow_Any_MSA; -@@ -3098,11 +2597,6 @@ int ABGRToJ422(const uint8_t* src_abgr, - } - } - #endif --#if defined(HAS_ABGRTOYJROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ABGRToYJRow = ABGRToYJRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - ABGRToUVJRow(src_abgr, 0, dst_uj, dst_vj, width); -@@ -3164,14 +2658,6 @@ int ABGRToJ400(const uint8_t* src_abgr, - } - } - #endif --#if defined(HAS_ABGRTOYJROW_NEON_DOTPROD) -- if (TestCpuFlag(kCpuHasNeonDotProd)) { -- ABGRToYJRow = ABGRToYJRow_Any_NEON_DotProd; -- if (IS_ALIGNED(width, 16)) { -- ABGRToYJRow = ABGRToYJRow_NEON_DotProd; -- } -- } --#endif - #if defined(HAS_ABGRTOYJROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - ABGRToYJRow = ABGRToYJRow_Any_MSA; -@@ -3196,11 +2682,6 @@ int ABGRToJ400(const uint8_t* src_abgr, - } - } - #endif --#if defined(HAS_ABGRTOYJROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ABGRToYJRow = ABGRToYJRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - ABGRToYJRow(src_abgr, dst_yj, width); -@@ -3260,11 +2741,6 @@ int ARGBToAR64(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOAR64ROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBToAR64Row = ARGBToAR64Row_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - ARGBToAR64Row(src_argb, dst_ar64, width); -@@ -3324,11 +2800,6 @@ int ARGBToAB64(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBTOAB64ROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBToAB64Row = ARGBToAB64Row_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - ARGBToAB64Row(src_argb, dst_ab64, width); -@@ -3339,8 +2810,7 @@ int ARGBToAB64(const uint8_t* src_argb, - } - - // Enabled if 1 pass is available --#if defined(HAS_RAWTOYJROW_NEON) || defined(HAS_RAWTOYJROW_MSA) || \ -- defined(HAS_RAWTOYJROW_RVV) -+#if defined(HAS_RAWTOYJROW_NEON) || defined(HAS_RAWTOYJROW_MSA) - #define HAS_RAWTOYJROW - #endif - -@@ -3422,11 +2892,6 @@ int RAWToJNV21(const uint8_t* src_raw, - } - } - #endif --#if defined(HAS_RAWTOYJROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- RAWToYJRow = RAWToYJRow_RVV; -- } --#endif - - // Other platforms do intermediate conversion from RAW to ARGB. - #else // HAS_RAWTOYJROW -@@ -3483,7 +2948,7 @@ int RAWToJNV21(const uint8_t* src_raw, - #if defined(HAS_MERGEUVROW_AVX2) - if (TestCpuFlag(kCpuHasAVX2)) { - MergeUVRow_ = MergeUVRow_Any_AVX2; -- if (IS_ALIGNED(halfwidth, 16)) { -+ if (IS_ALIGNED(halfwidth, 32)) { - MergeUVRow_ = MergeUVRow_AVX2; - } - } -@@ -3520,27 +2985,15 @@ int RAWToJNV21(const uint8_t* src_raw, - } - } - #endif --#if defined(HAS_MERGEUVROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- MergeUVRow_ = MergeUVRow_RVV; -- } --#endif - { --#if defined(HAS_RAWTOYJROW) - // Allocate a row of uv. -- const int row_uv_size = ((halfwidth + 31) & ~31); -- align_buffer_64(row_uj, row_uv_size * 2); -- uint8_t* row_vj = row_uj + row_uv_size; --#else -- // Allocate row of uv and 2 rows of ARGB. -- const int row_size = ((width * 4 + 31) & ~31); -- const int row_uv_size = ((halfwidth + 31) & ~31); -- align_buffer_64(row_uj, row_uv_size * 2 + row_size * 2); -- uint8_t* row_vj = row_uj + row_uv_size; -- uint8_t* row = row_vj + row_uv_size; -+ align_buffer_64(row_uj, ((halfwidth + 31) & ~31) * 2); -+ uint8_t* row_vj = row_uj + ((halfwidth + 31) & ~31); -+#if !defined(HAS_RAWTOYJROW) -+ // Allocate 2 rows of ARGB. -+ const int row_size = (width * 4 + 31) & ~31; -+ align_buffer_64(row, row_size * 2); - #endif -- if (!row_uj) -- return 1; - - for (y = 0; y < height - 1; y += 2) { - #if defined(HAS_RAWTOYJROW) -@@ -3572,6 +3025,9 @@ int RAWToJNV21(const uint8_t* src_raw, - ARGBToYJRow(row, dst_y, width); - #endif - } -+#if !defined(HAS_RAWTOYJROW) -+ free_aligned_buffer_64(row); -+#endif - free_aligned_buffer_64(row_uj); - } - return 0; -diff --git a/media/libyuv/libyuv/source/cpu_id.cc b/media/libyuv/libyuv/source/cpu_id.cc ---- a/media/libyuv/libyuv/source/cpu_id.cc -+++ b/media/libyuv/libyuv/source/cpu_id.cc -@@ -23,22 +23,6 @@ - #include // For fopen() - #include - --#if defined(__linux__) && defined(__aarch64__) --#include // For getauxval() --#endif -- --#if defined(_WIN32) && defined(__aarch64__) --#undef WIN32_LEAN_AND_MEAN --#define WIN32_LEAN_AND_MEAN --#undef WIN32_EXTRA_LEAN --#define WIN32_EXTRA_LEAN --#include // For IsProcessorFeaturePresent() --#endif -- --#if defined(__APPLE__) && defined(__aarch64__) --#include // For sysctlbyname() --#endif -- - #ifdef __cplusplus - namespace libyuv { - extern "C" { -@@ -56,6 +40,7 @@ extern "C" { - // cpu_info_ variable for SIMD instruction sets detected. - LIBYUV_API int cpu_info_ = 0; - -+// TODO(fbarchard): Consider using int for cpuid so casting is not needed. - // Low level cpuid for X86. - #if (defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || \ - defined(__x86_64__)) && \ -@@ -148,217 +133,46 @@ static int GetXCR0() { - #pragma optimize("g", on) - #endif - --static int cpuinfo_search(const char* cpuinfo_line, -- const char* needle, -- int needle_len) { -- const char* p = strstr(cpuinfo_line, needle); -- return p && (p[needle_len] == ' ' || p[needle_len] == '\n'); --} -- - // Based on libvpx arm_cpudetect.c - // For Arm, but public to allow testing on any CPU - LIBYUV_API SAFEBUFFERS int ArmCpuCaps(const char* cpuinfo_name) { - char cpuinfo_line[512]; -- FILE* f = fopen(cpuinfo_name, "re"); -+ FILE* f = fopen(cpuinfo_name, "r"); - if (!f) { - // Assume Neon if /proc/cpuinfo is unavailable. - // This will occur for Chrome sandbox for Pepper or Render process. - return kCpuHasNEON; - } -- memset(cpuinfo_line, 0, sizeof(cpuinfo_line)); -- int features = 0; -- while (fgets(cpuinfo_line, sizeof(cpuinfo_line), f)) { -+ while (fgets(cpuinfo_line, sizeof(cpuinfo_line) - 1, f)) { - if (memcmp(cpuinfo_line, "Features", 8) == 0) { -- if (cpuinfo_search(cpuinfo_line, " neon", 5)) { -- features |= kCpuHasNEON; -+ char* p = strstr(cpuinfo_line, " neon"); -+ if (p && (p[5] == ' ' || p[5] == '\n')) { -+ fclose(f); -+ return kCpuHasNEON; -+ } -+ // aarch64 uses asimd for Neon. -+ p = strstr(cpuinfo_line, " asimd"); -+ if (p) { -+ fclose(f); -+ return kCpuHasNEON; - } - } - } - fclose(f); -- return features; --} -- --#ifdef __aarch64__ --#ifdef __linux__ --// Define hwcap values ourselves: building with an old auxv header where these --// hwcap values are not defined should not prevent features from being enabled. --#define YUV_AARCH64_HWCAP_ASIMDDP (1 << 20) --#define YUV_AARCH64_HWCAP_SVE (1 << 22) --#define YUV_AARCH64_HWCAP2_SVE2 (1 << 1) --#define YUV_AARCH64_HWCAP2_I8MM (1 << 13) --#define YUV_AARCH64_HWCAP2_SME (1 << 23) -- --// For AArch64, but public to allow testing on any CPU. --LIBYUV_API SAFEBUFFERS int AArch64CpuCaps(unsigned long hwcap, -- unsigned long hwcap2) { -- // Neon is mandatory on AArch64, so enable regardless of hwcaps. -- int features = kCpuHasNEON; -- -- // Don't try to enable later extensions unless earlier extensions are also -- // reported available. Some of these constraints aren't strictly required by -- // the architecture, but are satisfied by all micro-architectures of -- // interest. This also avoids an issue on some emulators where true -- // architectural constraints are not satisfied, e.g. SVE2 may be reported as -- // available while SVE is not. -- if (hwcap & YUV_AARCH64_HWCAP_ASIMDDP) { -- features |= kCpuHasNeonDotProd; -- if (hwcap2 & YUV_AARCH64_HWCAP2_I8MM) { -- features |= kCpuHasNeonI8MM; -- if (hwcap & YUV_AARCH64_HWCAP_SVE) { -- features |= kCpuHasSVE; -- if (hwcap2 & YUV_AARCH64_HWCAP2_SVE2) { -- features |= kCpuHasSVE2; -- if (hwcap2 & YUV_AARCH64_HWCAP2_SME) { -- features |= kCpuHasSME; -- } -- } -- } -- } -- } -- return features; --} -- --#elif defined(_WIN32) --// For AArch64, but public to allow testing on any CPU. --LIBYUV_API SAFEBUFFERS int AArch64CpuCaps() { -- // Neon is mandatory on AArch64, so enable unconditionally. -- int features = kCpuHasNEON; -- -- // For more information on IsProcessorFeaturePresent(), see: -- // https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-isprocessorfeaturepresent#parameters --#ifdef PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE -- if (IsProcessorFeaturePresent(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE)) { -- features |= kCpuHasNeonDotProd; -- } --#endif -- // No Neon I8MM or SVE feature detection available here at time of writing. -- return features; --} -- --#elif defined(__APPLE__) --static bool have_feature(const char* feature) { -- // For more information on sysctlbyname(), see: -- // https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics -- int64_t feature_present = 0; -- size_t size = sizeof(feature_present); -- if (sysctlbyname(feature, &feature_present, &size, NULL, 0) != 0) { -- return false; -- } -- return feature_present; --} -- --// For AArch64, but public to allow testing on any CPU. --LIBYUV_API SAFEBUFFERS int AArch64CpuCaps() { -- // Neon is mandatory on AArch64, so enable unconditionally. -- int features = kCpuHasNEON; -- -- if (have_feature("hw.optional.arm.FEAT_DotProd")) { -- features |= kCpuHasNeonDotProd; -- if (have_feature("hw.optional.arm.FEAT_I8MM")) { -- features |= kCpuHasNeonI8MM; -- } -- } -- // No SVE feature detection available here at time of writing. -- return features; -+ return 0; - } - --#else // !defined(__linux__) && !defined(_WIN32) && !defined(__APPLE__) --// For AArch64, but public to allow testing on any CPU. --LIBYUV_API SAFEBUFFERS int AArch64CpuCaps() { -- // Neon is mandatory on AArch64, so enable unconditionally. -- int features = kCpuHasNEON; -- -- // TODO(libyuv:980) support feature detection on other platforms. -- -- return features; --} --#endif --#endif // defined(__aarch64__) -- --LIBYUV_API SAFEBUFFERS int RiscvCpuCaps(const char* cpuinfo_name) { -- char cpuinfo_line[512]; -- int flag = 0; -- FILE* f = fopen(cpuinfo_name, "re"); -- if (!f) { --#if defined(__riscv_vector) -- // Assume RVV if /proc/cpuinfo is unavailable. -- // This will occur for Chrome sandbox for Pepper or Render process. -- return kCpuHasRVV; --#else -- return 0; --#endif -- } -- memset(cpuinfo_line, 0, sizeof(cpuinfo_line)); -- while (fgets(cpuinfo_line, sizeof(cpuinfo_line), f)) { -- if (memcmp(cpuinfo_line, "isa", 3) == 0) { -- // ISA string must begin with rv64{i,e,g} for a 64-bit processor. -- char* isa = strstr(cpuinfo_line, "rv64"); -- if (isa) { -- size_t isa_len = strlen(isa); -- char* extensions; -- size_t extensions_len = 0; -- size_t std_isa_len; -- // Remove the new-line character at the end of string -- if (isa[isa_len - 1] == '\n') { -- isa[--isa_len] = '\0'; -- } -- // 5 ISA characters -- if (isa_len < 5) { -- fclose(f); -- return 0; -- } -- // Skip {i,e,g} canonical checking. -- // Skip rvxxx -- isa += 5; -- // Find the very first occurrence of 's', 'x' or 'z'. -- // To detect multi-letter standard, non-standard, and -- // supervisor-level extensions. -- extensions = strpbrk(isa, "zxs"); -- if (extensions) { -- // Multi-letter extensions are seperated by a single underscore -- // as described in RISC-V User-Level ISA V2.2. -- char* ext = strtok(extensions, "_"); -- extensions_len = strlen(extensions); -- while (ext) { -- // Search for the ZVFH (Vector FP16) extension. -- if (!strcmp(ext, "zvfh")) { -- flag |= kCpuHasRVVZVFH; -- } -- ext = strtok(NULL, "_"); -- } -- } -- std_isa_len = isa_len - extensions_len - 5; -- // Detect the v in the standard single-letter extensions. -- if (memchr(isa, 'v', std_isa_len)) { -- // The RVV implied the F extension. -- flag |= kCpuHasRVV; -- } -- } -- } --#if defined(__riscv_vector) -- // Assume RVV if /proc/cpuinfo is from x86 host running QEMU. -- else if ((memcmp(cpuinfo_line, "vendor_id\t: GenuineIntel", 24) == 0) || -- (memcmp(cpuinfo_line, "vendor_id\t: AuthenticAMD", 24) == 0)) { -- fclose(f); -- return kCpuHasRVV; -- } --#endif -- } -- fclose(f); -- return flag; --} -- -+// TODO(fbarchard): Consider read_msa_ir(). - LIBYUV_API SAFEBUFFERS int MipsCpuCaps(const char* cpuinfo_name) { - char cpuinfo_line[512]; -- int flag = 0; -- FILE* f = fopen(cpuinfo_name, "re"); -+ int flag = 0x0; -+ FILE* f = fopen(cpuinfo_name, "r"); - if (!f) { - // Assume nothing if /proc/cpuinfo is unavailable. - // This will occur for Chrome sandbox for Pepper or Render process. - return 0; - } -- memset(cpuinfo_line, 0, sizeof(cpuinfo_line)); -- while (fgets(cpuinfo_line, sizeof(cpuinfo_line), f)) { -+ while (fgets(cpuinfo_line, sizeof(cpuinfo_line) - 1, f)) { - if (memcmp(cpuinfo_line, "cpu model", 9) == 0) { - // Workaround early kernel without MSA in ASEs line. - if (strstr(cpuinfo_line, "Loongson-2K")) { -@@ -377,13 +191,14 @@ LIBYUV_API SAFEBUFFERS int MipsCpuCaps(c - return flag; - } - -+// TODO(fbarchard): Consider read_loongarch_ir(). - #define LOONGARCH_CFG2 0x2 - #define LOONGARCH_CFG2_LSX (1 << 6) - #define LOONGARCH_CFG2_LASX (1 << 7) - - #if defined(__loongarch__) - LIBYUV_API SAFEBUFFERS int LoongarchCpuCaps(void) { -- int flag = 0; -+ int flag = 0x0; - uint32_t cfg2 = 0; - - __asm__ volatile("cpucfg %0, %1 \n\t" : "+&r"(cfg2) : "r"(LOONGARCH_CFG2)); -@@ -405,12 +220,10 @@ static SAFEBUFFERS int GetCpuFlags(void) - int cpu_info0[4] = {0, 0, 0, 0}; - int cpu_info1[4] = {0, 0, 0, 0}; - int cpu_info7[4] = {0, 0, 0, 0}; -- int cpu_einfo7[4] = {0, 0, 0, 0}; - CpuId(0, 0, cpu_info0); - CpuId(1, 0, cpu_info1); - if (cpu_info0[0] >= 7) { - CpuId(7, 0, cpu_info7); -- CpuId(7, 1, cpu_einfo7); - } - cpu_info = kCpuHasX86 | ((cpu_info1[3] & 0x04000000) ? kCpuHasSSE2 : 0) | - ((cpu_info1[2] & 0x00000200) ? kCpuHasSSSE3 : 0) | -@@ -423,9 +236,7 @@ static SAFEBUFFERS int GetCpuFlags(void) - ((GetXCR0() & 6) == 6)) { // Test OS saves YMM registers - cpu_info |= kCpuHasAVX | ((cpu_info7[1] & 0x00000020) ? kCpuHasAVX2 : 0) | - ((cpu_info1[2] & 0x00001000) ? kCpuHasFMA3 : 0) | -- ((cpu_info1[2] & 0x20000000) ? kCpuHasF16C : 0) | -- ((cpu_einfo7[0] & 0x00000010) ? kCpuHasAVXVNNI : 0) | -- ((cpu_einfo7[3] & 0x00000010) ? kCpuHasAVXVNNIINT8 : 0); -+ ((cpu_info1[2] & 0x20000000) ? kCpuHasF16C : 0); - - // Detect AVX512bw - if ((GetXCR0() & 0xe0) == 0xe0) { -@@ -435,8 +246,8 @@ static SAFEBUFFERS int GetCpuFlags(void) - cpu_info |= (cpu_info7[2] & 0x00000040) ? kCpuHasAVX512VBMI2 : 0; - cpu_info |= (cpu_info7[2] & 0x00000800) ? kCpuHasAVX512VNNI : 0; - cpu_info |= (cpu_info7[2] & 0x00001000) ? kCpuHasAVX512VBITALG : 0; -- cpu_info |= (cpu_einfo7[3] & 0x00080000) ? kCpuHasAVX10 : 0; -- cpu_info |= (cpu_info7[3] & 0x02000000) ? kCpuHasAMXINT8 : 0; -+ cpu_info |= (cpu_info7[2] & 0x00004000) ? kCpuHasAVX512VPOPCNTDQ : 0; -+ cpu_info |= (cpu_info7[2] & 0x00000100) ? kCpuHasGFNI : 0; - } - } - #endif -@@ -449,29 +260,23 @@ static SAFEBUFFERS int GetCpuFlags(void) - cpu_info |= kCpuHasLOONGARCH; - #endif - #if defined(__arm__) || defined(__aarch64__) --#if defined(__aarch64__) && defined(__linux__) -- // getauxval is supported since Android SDK version 18, minimum at time of -- // writing is 21, so should be safe to always use this. If getauxval is -- // somehow disabled then getauxval returns 0, which will leave Neon enabled -- // since Neon is mandatory on AArch64. -- unsigned long hwcap = getauxval(AT_HWCAP); -- unsigned long hwcap2 = getauxval(AT_HWCAP2); -- cpu_info = AArch64CpuCaps(hwcap, hwcap2); --#elif defined(__aarch64__) -- cpu_info = AArch64CpuCaps(); -+// gcc -mfpu=neon defines __ARM_NEON__ -+// __ARM_NEON__ generates code that requires Neon. NaCL also requires Neon. -+// For Linux, /proc/cpuinfo can be tested but without that assume Neon. -+#if defined(__ARM_NEON__) || defined(__native_client__) || !defined(__linux__) -+ cpu_info = kCpuHasNEON; -+// For aarch64(arm64), /proc/cpuinfo's feature is not complete, e.g. no neon -+// flag in it. -+// So for aarch64, neon enabling is hard coded here. -+#endif -+#if defined(__aarch64__) -+ cpu_info = kCpuHasNEON; - #else -- // gcc -mfpu=neon defines __ARM_NEON__ -- // __ARM_NEON__ generates code that requires Neon. NaCL also requires Neon. -- // For Linux, /proc/cpuinfo can be tested but without that assume Neon. - // Linux arm parse text file for neon detect. - cpu_info = ArmCpuCaps("/proc/cpuinfo"); - #endif - cpu_info |= kCpuHasARM; - #endif // __arm__ --#if defined(__riscv) && defined(__linux__) -- cpu_info = RiscvCpuCaps("/proc/cpuinfo"); -- cpu_info |= kCpuHasRISCV; --#endif // __riscv - cpu_info |= kCpuInitialized; - return cpu_info; - } -diff --git a/media/libyuv/libyuv/source/mjpeg_decoder.cc b/media/libyuv/libyuv/source/mjpeg_decoder.cc ---- a/media/libyuv/libyuv/source/mjpeg_decoder.cc -+++ b/media/libyuv/libyuv/source/mjpeg_decoder.cc -@@ -13,7 +13,8 @@ - #ifdef HAVE_JPEG - #include - --#if !defined(__pnacl__) && !defined(__CLR_VER) && !defined(COVERAGE_ENABLED) -+#if !defined(__pnacl__) && !defined(__CLR_VER) && \ -+ !defined(COVERAGE_ENABLED) && !defined(TARGET_IPHONE_SIMULATOR) - // Must be included before jpeglib. - #include - #define HAVE_SETJMP -diff --git a/media/libyuv/libyuv/source/planar_functions.cc b/media/libyuv/libyuv/source/planar_functions.cc ---- a/media/libyuv/libyuv/source/planar_functions.cc -+++ b/media/libyuv/libyuv/source/planar_functions.cc -@@ -14,6 +14,9 @@ - #include // for memset() - - #include "libyuv/cpu_id.h" -+#ifdef HAVE_JPEG -+#include "libyuv/mjpeg_decoder.h" -+#endif - #include "libyuv/row.h" - #include "libyuv/scale_row.h" // for ScaleRowDown2 - -@@ -72,11 +75,6 @@ void CopyPlane(const uint8_t* src_y, - CopyRow = IS_ALIGNED(width, 32) ? CopyRow_NEON : CopyRow_Any_NEON; - } - #endif --#if defined(HAS_COPYROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- CopyRow = CopyRow_RVV; -- } --#endif - - // Copy plane - for (y = 0; y < height; ++y) { -@@ -164,7 +162,7 @@ void Convert8To16Plane(const uint8_t* sr - int src_stride_y, - uint16_t* dst_y, - int dst_stride_y, -- int scale, // 1024 for 10 bits -+ int scale, // 16384 for 10 bits - int width, - int height) { - int y; -@@ -547,11 +545,6 @@ void SplitUVPlane(const uint8_t* src_uv, - } - } - #endif --#if defined(HAS_SPLITUVROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- SplitUVRow = SplitUVRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - // Copy a row of UV. -@@ -601,7 +594,7 @@ void MergeUVPlane(const uint8_t* src_u, - #if defined(HAS_MERGEUVROW_AVX2) - if (TestCpuFlag(kCpuHasAVX2)) { - MergeUVRow = MergeUVRow_Any_AVX2; -- if (IS_ALIGNED(width, 16)) { -+ if (IS_ALIGNED(width, 32)) { - MergeUVRow = MergeUVRow_AVX2; - } - } -@@ -638,11 +631,6 @@ void MergeUVPlane(const uint8_t* src_u, - } - } - #endif --#if defined(HAS_MERGEUVROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- MergeUVRow = MergeUVRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - // Merge a row of U and V into a row of UV. -@@ -748,7 +736,7 @@ void MergeUVPlane_16(const uint16_t* src - #if defined(HAS_MERGEUVROW_16_AVX2) - if (TestCpuFlag(kCpuHasAVX2)) { - MergeUVRow_16 = MergeUVRow_16_Any_AVX2; -- if (IS_ALIGNED(width, 8)) { -+ if (IS_ALIGNED(width, 16)) { - MergeUVRow_16 = MergeUVRow_16_AVX2; - } - } -@@ -1280,11 +1268,6 @@ void SplitRGBPlane(const uint8_t* src_rg - } - } - #endif --#if defined(HAS_SPLITRGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- SplitRGBRow = SplitRGBRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - // Copy a row of RGB. -@@ -1344,11 +1327,6 @@ void MergeRGBPlane(const uint8_t* src_r, - } - } - #endif --#if defined(HAS_MERGERGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- MergeRGBRow = MergeRGBRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - // Merge a row of U and V into a row of RGB. -@@ -1380,9 +1358,6 @@ static void SplitARGBPlaneAlpha(const ui - - assert(height > 0); - -- if (width <= 0 || height == 0) { -- return; -- } - if (src_stride_argb == width * 4 && dst_stride_r == width && - dst_stride_g == width && dst_stride_b == width && dst_stride_a == width) { - width *= height; -@@ -1423,11 +1398,6 @@ static void SplitARGBPlaneAlpha(const ui - } - } - #endif --#if defined(HAS_SPLITARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- SplitARGBRow = SplitARGBRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - SplitARGBRow(src_argb, dst_r, dst_g, dst_b, dst_a, width); -@@ -1455,9 +1425,6 @@ static void SplitARGBPlaneOpaque(const u - uint8_t* dst_b, int width) = SplitXRGBRow_C; - assert(height > 0); - -- if (width <= 0 || height == 0) { -- return; -- } - if (src_stride_argb == width * 4 && dst_stride_r == width && - dst_stride_g == width && dst_stride_b == width) { - width *= height; -@@ -1497,11 +1464,6 @@ static void SplitARGBPlaneOpaque(const u - } - } - #endif --#if defined(HAS_SPLITXRGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- SplitXRGBRow = SplitXRGBRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - SplitXRGBRow(src_argb, dst_r, dst_g, dst_b, width); -@@ -1568,9 +1530,6 @@ static void MergeARGBPlaneAlpha(const ui - - assert(height > 0); - -- if (width <= 0 || height == 0) { -- return; -- } - if (src_stride_r == width && src_stride_g == width && src_stride_b == width && - src_stride_a == width && dst_stride_argb == width * 4) { - width *= height; -@@ -1602,11 +1561,6 @@ static void MergeARGBPlaneAlpha(const ui - } - } - #endif --#if defined(HAS_MERGEARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- MergeARGBRow = MergeARGBRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - MergeARGBRow(src_r, src_g, src_b, src_a, dst_argb, width); -@@ -1636,9 +1590,6 @@ static void MergeARGBPlaneOpaque(const u - - assert(height > 0); - -- if (width <= 0 || height == 0) { -- return; -- } - if (src_stride_r == width && src_stride_g == width && src_stride_b == width && - dst_stride_argb == width * 4) { - width *= height; -@@ -1669,11 +1620,6 @@ static void MergeARGBPlaneOpaque(const u - } - } - #endif --#if defined(HAS_MERGEXRGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- MergeXRGBRow = MergeXRGBRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - MergeXRGBRow(src_r, src_g, src_b, dst_argb, width); -@@ -2125,16 +2071,6 @@ int YUY2ToI422(const uint8_t* src_yuy2, - } - } - #endif --#if defined(HAS_YUY2TOYROW_LSX) && defined(HAS_YUY2TOUV422ROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- YUY2ToYRow = YUY2ToYRow_Any_LSX; -- YUY2ToUV422Row = YUY2ToUV422Row_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- YUY2ToYRow = YUY2ToYRow_LSX; -- YUY2ToUV422Row = YUY2ToUV422Row_LSX; -- } -- } --#endif - #if defined(HAS_YUY2TOYROW_LASX) && defined(HAS_YUY2TOUV422ROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - YUY2ToYRow = YUY2ToYRow_Any_LASX; -@@ -2231,16 +2167,6 @@ int UYVYToI422(const uint8_t* src_uyvy, - } - } - #endif --#if defined(HAS_UYVYTOYROW_LSX) && defined(HAS_UYVYTOUV422ROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- UYVYToYRow = UYVYToYRow_Any_LSX; -- UYVYToUV422Row = UYVYToUV422Row_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- UYVYToYRow = UYVYToYRow_LSX; -- UYVYToUV422Row = UYVYToUV422Row_LSX; -- } -- } --#endif - #if defined(HAS_UYVYTOYROW_LASX) && defined(HAS_UYVYTOUV422ROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - UYVYToYRow = UYVYToYRow_Any_LASX; -@@ -2388,14 +2314,6 @@ int UYVYToY(const uint8_t* src_uyvy, - } - } - #endif --#if defined(HAS_UYVYTOYROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- UYVYToYRow = UYVYToYRow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- UYVYToYRow = UYVYToYRow_LSX; -- } -- } --#endif - - for (y = 0; y < height; ++y) { - UYVYToYRow(src_uyvy, dst_y, width); -@@ -2454,14 +2372,6 @@ void MirrorPlane(const uint8_t* src_y, - } - } - #endif --#if defined(HAS_MIRRORROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- MirrorRow = MirrorRow_Any_LSX; -- if (IS_ALIGNED(width, 32)) { -- MirrorRow = MirrorRow_LSX; -- } -- } --#endif - #if defined(HAS_MIRRORROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - MirrorRow = MirrorRow_Any_LASX; -@@ -2528,14 +2438,6 @@ void MirrorUVPlane(const uint8_t* src_uv - } - } - #endif --#if defined(HAS_MIRRORUVROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- MirrorUVRow = MirrorUVRow_Any_LSX; -- if (IS_ALIGNED(width, 8)) { -- MirrorUVRow = MirrorUVRow_LSX; -- } -- } --#endif - #if defined(HAS_MIRRORUVROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - MirrorUVRow = MirrorUVRow_Any_LASX; -@@ -2708,14 +2610,6 @@ int ARGBMirror(const uint8_t* src_argb, - } - } - #endif --#if defined(HAS_ARGBMIRRORROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBMirrorRow = ARGBMirrorRow_Any_LSX; -- if (IS_ALIGNED(width, 8)) { -- ARGBMirrorRow = ARGBMirrorRow_LSX; -- } -- } --#endif - #if defined(HAS_ARGBMIRRORROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - ARGBMirrorRow = ARGBMirrorRow_Any_LASX; -@@ -2780,6 +2674,37 @@ int RGB24Mirror(const uint8_t* src_rgb24 - return 0; - } - -+// Get a blender that optimized for the CPU and pixel count. -+// As there are 6 blenders to choose from, the caller should try to use -+// the same blend function for all pixels if possible. -+LIBYUV_API -+ARGBBlendRow GetARGBBlend() { -+ void (*ARGBBlendRow)(const uint8_t* src_argb, const uint8_t* src_argb1, -+ uint8_t* dst_argb, int width) = ARGBBlendRow_C; -+#if defined(HAS_ARGBBLENDROW_SSSE3) -+ if (TestCpuFlag(kCpuHasSSSE3)) { -+ ARGBBlendRow = ARGBBlendRow_SSSE3; -+ return ARGBBlendRow; -+ } -+#endif -+#if defined(HAS_ARGBBLENDROW_NEON) -+ if (TestCpuFlag(kCpuHasNEON)) { -+ ARGBBlendRow = ARGBBlendRow_NEON; -+ } -+#endif -+#if defined(HAS_ARGBBLENDROW_MSA) -+ if (TestCpuFlag(kCpuHasMSA)) { -+ ARGBBlendRow = ARGBBlendRow_MSA; -+ } -+#endif -+#if defined(HAS_ARGBBLENDROW_LSX) -+ if (TestCpuFlag(kCpuHasLSX)) { -+ ARGBBlendRow = ARGBBlendRow_LSX; -+ } -+#endif -+ return ARGBBlendRow; -+} -+ - // Alpha Blend 2 ARGB images and store to destination. - LIBYUV_API - int ARGBBlend(const uint8_t* src_argb0, -@@ -2792,7 +2717,7 @@ int ARGBBlend(const uint8_t* src_argb0, - int height) { - int y; - void (*ARGBBlendRow)(const uint8_t* src_argb, const uint8_t* src_argb1, -- uint8_t* dst_argb, int width) = ARGBBlendRow_C; -+ uint8_t* dst_argb, int width) = GetARGBBlend(); - if (!src_argb0 || !src_argb1 || !dst_argb || width <= 0 || height == 0) { - return -1; - } -@@ -2809,31 +2734,7 @@ int ARGBBlend(const uint8_t* src_argb0, - height = 1; - src_stride_argb0 = src_stride_argb1 = dst_stride_argb = 0; - } --#if defined(HAS_ARGBBLENDROW_SSSE3) -- if (TestCpuFlag(kCpuHasSSSE3)) { -- ARGBBlendRow = ARGBBlendRow_SSSE3; -- } --#endif --#if defined(HAS_ARGBBLENDROW_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- ARGBBlendRow = ARGBBlendRow_NEON; -- } --#endif --#if defined(HAS_ARGBBLENDROW_MSA) -- if (TestCpuFlag(kCpuHasMSA)) { -- ARGBBlendRow = ARGBBlendRow_MSA; -- } --#endif --#if defined(HAS_ARGBBLENDROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBBlendRow = ARGBBlendRow_LSX; -- } --#endif --#if defined(HAS_ARGBBLENDROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBBlendRow = ARGBBlendRow_RVV; -- } --#endif -+ - for (y = 0; y < height; ++y) { - ARGBBlendRow(src_argb0, src_argb1, dst_argb, width); - src_argb0 += src_stride_argb0; -@@ -2893,11 +2794,6 @@ int BlendPlane(const uint8_t* src_y0, - } - } - #endif --#if defined(HAS_BLENDPLANEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- BlendPlaneRow = BlendPlaneRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - BlendPlaneRow(src_y0, src_y1, alpha, dst_y, width); -@@ -2975,11 +2871,6 @@ int I420Blend(const uint8_t* src_y0, - } - } - #endif --#if defined(HAS_BLENDPLANEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- BlendPlaneRow = BlendPlaneRow_RVV; -- } --#endif - if (!IS_ALIGNED(width, 2)) { - ScaleRowDown2 = ScaleRowDown2Box_Odd_C; - } -@@ -3016,16 +2907,9 @@ int I420Blend(const uint8_t* src_y0, - } - } - #endif --#if defined(HAS_SCALEROWDOWN2_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ScaleRowDown2 = ScaleRowDown2Box_RVV; -- } --#endif - - // Row buffer for intermediate alpha pixels. - align_buffer_64(halfalpha, halfwidth); -- if (!halfalpha) -- return 1; - for (y = 0; y < height; y += 2) { - // last row of odd height image use 1 row of alpha instead of 2. - if (y == (height - 1)) { -@@ -3108,14 +2992,6 @@ int ARGBMultiply(const uint8_t* src_argb - } - } - #endif --#if defined(HAS_ARGBMULTIPLYROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBMultiplyRow = ARGBMultiplyRow_Any_LSX; -- if (IS_ALIGNED(width, 4)) { -- ARGBMultiplyRow = ARGBMultiplyRow_LSX; -- } -- } --#endif - #if defined(HAS_ARGBMULTIPLYROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - ARGBMultiplyRow = ARGBMultiplyRow_Any_LASX; -@@ -3201,14 +3077,6 @@ int ARGBAdd(const uint8_t* src_argb0, - } - } - #endif --#if defined(HAS_ARGBADDROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBAddRow = ARGBAddRow_Any_LSX; -- if (IS_ALIGNED(width, 4)) { -- ARGBAddRow = ARGBAddRow_LSX; -- } -- } --#endif - #if defined(HAS_ARGBADDROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - ARGBAddRow = ARGBAddRow_Any_LASX; -@@ -3289,14 +3157,6 @@ int ARGBSubtract(const uint8_t* src_argb - } - } - #endif --#if defined(HAS_ARGBSUBTRACTROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBSubtractRow = ARGBSubtractRow_Any_LSX; -- if (IS_ALIGNED(width, 4)) { -- ARGBSubtractRow = ARGBSubtractRow_LSX; -- } -- } --#endif - #if defined(HAS_ARGBSUBTRACTROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - ARGBSubtractRow = ARGBSubtractRow_Any_LASX; -@@ -3374,11 +3234,6 @@ int RAWToRGB24(const uint8_t* src_raw, - } - } - #endif --#if defined(HAS_RAWTORGB24ROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- RAWToRGB24Row = RAWToRGB24Row_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - RAWToRGB24Row(src_raw, dst_rgb24, width); -@@ -3622,14 +3477,6 @@ int ARGBAttenuate(const uint8_t* src_arg - } - } - #endif --#if defined(HAS_ARGBATTENUATEROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBAttenuateRow = ARGBAttenuateRow_Any_LSX; -- if (IS_ALIGNED(width, 8)) { -- ARGBAttenuateRow = ARGBAttenuateRow_LSX; -- } -- } --#endif - #if defined(HAS_ARGBATTENUATEROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - ARGBAttenuateRow = ARGBAttenuateRow_Any_LASX; -@@ -3638,11 +3485,6 @@ int ARGBAttenuate(const uint8_t* src_arg - } - } - #endif --#if defined(HAS_ARGBATTENUATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBAttenuateRow = ARGBAttenuateRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - ARGBAttenuateRow(src_argb, dst_argb, width); -@@ -3743,11 +3585,6 @@ int ARGBGrayTo(const uint8_t* src_argb, - ARGBGrayRow = ARGBGrayRow_MSA; - } - #endif --#if defined(HAS_ARGBGRAYROW_LSX) -- if (TestCpuFlag(kCpuHasLSX) && IS_ALIGNED(width, 8)) { -- ARGBGrayRow = ARGBGrayRow_LSX; -- } --#endif - #if defined(HAS_ARGBGRAYROW_LASX) - if (TestCpuFlag(kCpuHasLASX) && IS_ALIGNED(width, 16)) { - ARGBGrayRow = ARGBGrayRow_LASX; -@@ -3798,11 +3635,6 @@ int ARGBGray(uint8_t* dst_argb, - ARGBGrayRow = ARGBGrayRow_MSA; - } - #endif --#if defined(HAS_ARGBGRAYROW_LSX) -- if (TestCpuFlag(kCpuHasLSX) && IS_ALIGNED(width, 8)) { -- ARGBGrayRow = ARGBGrayRow_LSX; -- } --#endif - #if defined(HAS_ARGBGRAYROW_LASX) - if (TestCpuFlag(kCpuHasLASX) && IS_ALIGNED(width, 16)) { - ARGBGrayRow = ARGBGrayRow_LASX; -@@ -3851,11 +3683,6 @@ int ARGBSepia(uint8_t* dst_argb, - ARGBSepiaRow = ARGBSepiaRow_MSA; - } - #endif --#if defined(HAS_ARGBSEPIAROW_LSX) -- if (TestCpuFlag(kCpuHasLSX) && IS_ALIGNED(width, 8)) { -- ARGBSepiaRow = ARGBSepiaRow_LSX; -- } --#endif - #if defined(HAS_ARGBSEPIAROW_LASX) - if (TestCpuFlag(kCpuHasLASX) && IS_ALIGNED(width, 16)) { - ARGBSepiaRow = ARGBSepiaRow_LASX; -@@ -3907,11 +3734,6 @@ int ARGBColorMatrix(const uint8_t* src_a - ARGBColorMatrixRow = ARGBColorMatrixRow_NEON; - } - #endif --#if defined(HAS_ARGBCOLORMATRIXROW_NEON_I8MM) -- if (TestCpuFlag(kCpuHasNeonI8MM) && IS_ALIGNED(width, 8)) { -- ARGBColorMatrixRow = ARGBColorMatrixRow_NEON_I8MM; -- } --#endif - #if defined(HAS_ARGBCOLORMATRIXROW_MSA) - if (TestCpuFlag(kCpuHasMSA) && IS_ALIGNED(width, 8)) { - ARGBColorMatrixRow = ARGBColorMatrixRow_MSA; -@@ -4286,11 +4108,6 @@ int ARGBShade(const uint8_t* src_argb, - ARGBShadeRow = ARGBShadeRow_MSA; - } - #endif --#if defined(HAS_ARGBSHADEROW_LSX) -- if (TestCpuFlag(kCpuHasLSX) && IS_ALIGNED(width, 4)) { -- ARGBShadeRow = ARGBShadeRow_LSX; -- } --#endif - #if defined(HAS_ARGBSHADEROW_LASX) - if (TestCpuFlag(kCpuHasLASX) && IS_ALIGNED(width, 8)) { - ARGBShadeRow = ARGBShadeRow_LASX; -@@ -4375,11 +4192,6 @@ int InterpolatePlane(const uint8_t* src0 - } - } - #endif --#if defined(HAS_INTERPOLATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- InterpolateRow = InterpolateRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - InterpolateRow(dst, src0, src1 - src0, width, interpolation); -@@ -4585,14 +4397,6 @@ int ARGBShuffle(const uint8_t* src_bgra, - } - } - #endif --#if defined(HAS_ARGBSHUFFLEROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBShuffleRow = ARGBShuffleRow_Any_LSX; -- if (IS_ALIGNED(width, 8)) { -- ARGBShuffleRow = ARGBShuffleRow_LSX; -- } -- } --#endif - #if defined(HAS_ARGBSHUFFLEROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - ARGBShuffleRow = ARGBShuffleRow_Any_LASX; -@@ -4714,8 +4518,6 @@ int GaussPlane_F32(const float* src, - { - // 2 pixels on each side, but aligned out to 16 bytes. - align_buffer_64(rowbuf, (4 + width + 4) * 4); -- if (!rowbuf) -- return 1; - memset(rowbuf, 0, 16); - memset(rowbuf + (4 + width) * 4, 0, 16); - float* row = (float*)(rowbuf + 16); -@@ -4826,11 +4628,6 @@ static int ARGBSobelize(const uint8_t* s - } - } - #endif --#if defined(HAS_ARGBTOYJROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBToYJRow = ARGBToYJRow_RVV; -- } --#endif - - #if defined(HAS_SOBELYROW_SSE2) - if (TestCpuFlag(kCpuHasSSE2)) { -@@ -4874,8 +4671,6 @@ static int ARGBSobelize(const uint8_t* s - uint8_t* row_y0 = row_y + kEdge; - uint8_t* row_y1 = row_y0 + row_size; - uint8_t* row_y2 = row_y1 + row_size; -- if (!rows) -- return 1; - ARGBToYJRow(src_argb, row_y0, width); - row_y0[-1] = row_y0[0]; - memset(row_y0 + width, row_y0[width - 1], 16); // Extrude 16 for valgrind. -@@ -5356,11 +5151,6 @@ int ARGBExtractAlpha(const uint8_t* src_ - : ARGBExtractAlphaRow_Any_LSX; - } - #endif --#if defined(HAS_ARGBEXTRACTALPHAROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBExtractAlphaRow = ARGBExtractAlphaRow_RVV; -- } --#endif - - for (int y = 0; y < height; ++y) { - ARGBExtractAlphaRow(src_argb, dst_a, width); -@@ -5412,11 +5202,6 @@ int ARGBCopyYToAlpha(const uint8_t* src_ - } - } - #endif --#if defined(HAS_ARGBCOPYYTOALPHAROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ARGBCopyYToAlphaRow = ARGBCopyYToAlphaRow_RVV; -- } --#endif - - for (y = 0; y < height; ++y) { - ARGBCopyYToAlphaRow(src_y, dst_argb, width); -@@ -5482,14 +5267,6 @@ int YUY2ToNV12(const uint8_t* src_yuy2, - } - } - #endif --#if defined(HAS_YUY2TOYROW_LSX) && defined(HAS_YUY2TOUV422ROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- YUY2ToYRow = YUY2ToYRow_Any_LSX; -- if (IS_ALIGNED(width, 16)) { -- YUY2ToYRow = YUY2ToYRow_LSX; -- } -- } --#endif - #if defined(HAS_YUY2TOYROW_LASX) && defined(HAS_YUY2TOUV422ROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - YUY2ToYRow = YUY2ToYRow_Any_LASX; -@@ -5606,12 +5383,6 @@ int UYVYToNV12(const uint8_t* src_uyvy, - } - } - #endif --#if defined(HAS_SPLITUVROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- SplitUVRow = SplitUVRow_RVV; -- } --#endif -- - #if defined(HAS_INTERPOLATEROW_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - InterpolateRow = InterpolateRow_Any_SSSE3; -@@ -5652,18 +5423,11 @@ int UYVYToNV12(const uint8_t* src_uyvy, - } - } - #endif --#if defined(HAS_INTERPOLATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- InterpolateRow = InterpolateRow_RVV; -- } --#endif - - { - int awidth = halfwidth * 2; - // row of y and 2 rows of uv - align_buffer_64(rows, awidth * 3); -- if (!rows) -- return 1; - - for (y = 0; y < height - 1; y += 2) { - // Split Y from UV. -@@ -5724,7 +5488,6 @@ void HalfMergeUVPlane(const uint8_t* src - HalfMergeUVRow = HalfMergeUVRow_AVX2; - } - #endif -- - for (y = 0; y < height - 1; y += 2) { - // Merge a row of U and V into a row of UV. - HalfMergeUVRow(src_u, src_stride_u, src_v, src_stride_v, dst_uv, width); -diff --git a/media/libyuv/libyuv/source/rotate.cc b/media/libyuv/libyuv/source/rotate.cc ---- a/media/libyuv/libyuv/source/rotate.cc -+++ b/media/libyuv/libyuv/source/rotate.cc -@@ -8,8 +8,6 @@ - * be found in the AUTHORS file in the root of the source tree. - */ - --#include -- - #include "libyuv/rotate.h" - - #include "libyuv/convert.h" -@@ -31,8 +29,7 @@ void TransposePlane(const uint8_t* src, - int width, - int height) { - int i = height; --#if defined(HAS_TRANSPOSEWX16_MSA) || defined(HAS_TRANSPOSEWX16_LSX) || \ -- defined(HAS_TRANSPOSEWX16_NEON) -+#if defined(HAS_TRANSPOSEWX16_MSA) || defined(HAS_TRANSPOSEWX16_LSX) - void (*TransposeWx16)(const uint8_t* src, int src_stride, uint8_t* dst, - int dst_stride, int width) = TransposeWx16_C; - #else -@@ -48,14 +45,6 @@ void TransposePlane(const uint8_t* src, - } - } - #endif --#if defined(HAS_TRANSPOSEWX16_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- TransposeWx16 = TransposeWx16_Any_NEON; -- if (IS_ALIGNED(width, 16)) { -- TransposeWx16 = TransposeWx16_NEON; -- } -- } --#endif - #if defined(HAS_TRANSPOSEWX8_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3)) { - TransposeWx8 = TransposeWx8_Any_SSSE3; -@@ -89,8 +78,7 @@ void TransposePlane(const uint8_t* src, - } - #endif - --#if defined(HAS_TRANSPOSEWX16_MSA) || defined(HAS_TRANSPOSEWX16_LSX) || \ -- defined(HAS_TRANSPOSEWX16_NEON) -+#if defined(HAS_TRANSPOSEWX16_MSA) || defined(HAS_TRANSPOSEWX16_LSX) - // Work across the source in 16x16 tiles - while (i >= 16) { - TransposeWx16(src, src_stride, dst, dst_stride, width); -@@ -152,9 +140,6 @@ void RotatePlane180(const uint8_t* src, - int height) { - // Swap top and bottom row and mirror the content. Uses a temporary row. - align_buffer_64(row, width); -- assert(row); -- if (!row) -- return; - const uint8_t* src_bot = src + src_stride * (height - 1); - uint8_t* dst_bot = dst + dst_stride * (height - 1); - int half_height = (height + 1) >> 1; -@@ -193,14 +178,6 @@ void RotatePlane180(const uint8_t* src, - } - } - #endif --#if defined(HAS_MIRRORROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- MirrorRow = MirrorRow_Any_LSX; -- if (IS_ALIGNED(width, 32)) { -- MirrorRow = MirrorRow_LSX; -- } -- } --#endif - #if defined(HAS_MIRRORROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - MirrorRow = MirrorRow_Any_LASX; -@@ -229,11 +206,6 @@ void RotatePlane180(const uint8_t* src, - CopyRow = IS_ALIGNED(width, 32) ? CopyRow_NEON : CopyRow_Any_NEON; - } - #endif --#if defined(HAS_COPYROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- CopyRow = CopyRow_RVV; -- } --#endif - - // Odd height will harmlessly mirror the middle row twice. - for (y = 0; y < half_height; ++y) { -@@ -289,10 +261,7 @@ void SplitTransposeUV(const uint8_t* src - #else - #if defined(HAS_TRANSPOSEUVWX8_NEON) - if (TestCpuFlag(kCpuHasNEON)) { -- TransposeUVWx8 = TransposeUVWx8_Any_NEON; -- if (IS_ALIGNED(width, 8)) { -- TransposeUVWx8 = TransposeUVWx8_NEON; -- } -+ TransposeUVWx8 = TransposeUVWx8_NEON; - } - #endif - #if defined(HAS_TRANSPOSEUVWX8_SSE2) -@@ -507,12 +476,13 @@ int RotatePlane(const uint8_t* src, - return -1; - } - --static void TransposePlane_16(const uint16_t* src, -- int src_stride, -- uint16_t* dst, -- int dst_stride, -- int width, -- int height) { -+LIBYUV_API -+void TransposePlane_16(const uint16_t* src, -+ int src_stride, -+ uint16_t* dst, -+ int dst_stride, -+ int width, -+ int height) { - int i = height; - // Work across the source in 8x8 tiles - while (i >= 8) { -@@ -561,29 +531,24 @@ static void RotatePlane180_16(const uint - int dst_stride, - int width, - int height) { -+ // Swap top and bottom row and mirror the content. Uses a temporary row. -+ align_buffer_64_16(row, width); - const uint16_t* src_bot = src + src_stride * (height - 1); - uint16_t* dst_bot = dst + dst_stride * (height - 1); - int half_height = (height + 1) >> 1; - int y; - -- // Swap top and bottom row and mirror the content. Uses a temporary row. -- align_buffer_64(row, width * 2); -- uint16_t* row_tmp = (uint16_t*)row; -- assert(row); -- if (!row) -- return; -- - // Odd height will harmlessly mirror the middle row twice. - for (y = 0; y < half_height; ++y) { -- CopyRow_16_C(src, row_tmp, width); // Copy top row into buffer -- MirrorRow_16_C(src_bot, dst, width); // Mirror bottom row into top row -- MirrorRow_16_C(row_tmp, dst_bot, width); // Mirror buffer into bottom row -+ CopyRow_16_C(src, row, width); // Copy top row into buffer -+ MirrorRow_16_C(src_bot, dst, width); // Mirror bottom row into top row -+ MirrorRow_16_C(row, dst_bot, width); // Mirror buffer into bottom row - src += src_stride; - dst += dst_stride; - src_bot -= src_stride; - dst_bot -= dst_stride; - } -- free_aligned_buffer_64(row); -+ free_aligned_buffer_64_16(row); - } - - LIBYUV_API -@@ -713,7 +678,6 @@ int I422Rotate(const uint8_t* src_y, - enum RotationMode mode) { - int halfwidth = (width + 1) >> 1; - int halfheight = (height + 1) >> 1; -- int r; - if (!src_y || !src_u || !src_v || width <= 0 || height == 0 || !dst_y || - !dst_u || !dst_v) { - return -1; -@@ -749,35 +713,23 @@ int I422Rotate(const uint8_t* src_y, - case kRotate90: - RotatePlane90(src_u, src_stride_u, dst_y, dst_stride_y, halfwidth, - height); -- r = ScalePlane(dst_y, dst_stride_y, height, halfwidth, dst_u, -- dst_stride_u, halfheight, width, kFilterBilinear); -- if (r != 0) { -- return r; -- } -+ ScalePlane(dst_y, dst_stride_y, height, halfwidth, dst_u, dst_stride_u, -+ halfheight, width, kFilterBilinear); - RotatePlane90(src_v, src_stride_v, dst_y, dst_stride_y, halfwidth, - height); -- r = ScalePlane(dst_y, dst_stride_y, height, halfwidth, dst_v, -- dst_stride_v, halfheight, width, kFilterLinear); -- if (r != 0) { -- return r; -- } -+ ScalePlane(dst_y, dst_stride_y, height, halfwidth, dst_v, dst_stride_v, -+ halfheight, width, kFilterLinear); - RotatePlane90(src_y, src_stride_y, dst_y, dst_stride_y, width, height); - return 0; - case kRotate270: - RotatePlane270(src_u, src_stride_u, dst_y, dst_stride_y, halfwidth, - height); -- r = ScalePlane(dst_y, dst_stride_y, height, halfwidth, dst_u, -- dst_stride_u, halfheight, width, kFilterBilinear); -- if (r != 0) { -- return r; -- } -+ ScalePlane(dst_y, dst_stride_y, height, halfwidth, dst_u, dst_stride_u, -+ halfheight, width, kFilterBilinear); - RotatePlane270(src_v, src_stride_v, dst_y, dst_stride_y, halfwidth, - height); -- r = ScalePlane(dst_y, dst_stride_y, height, halfwidth, dst_v, -- dst_stride_v, halfheight, width, kFilterLinear); -- if (r != 0) { -- return r; -- } -+ ScalePlane(dst_y, dst_stride_y, height, halfwidth, dst_v, dst_stride_v, -+ halfheight, width, kFilterLinear); - RotatePlane270(src_y, src_stride_y, dst_y, dst_stride_y, width, height); - return 0; - case kRotate180: -@@ -1091,7 +1043,6 @@ int I210Rotate(const uint16_t* src_y, - enum RotationMode mode) { - int halfwidth = (width + 1) >> 1; - int halfheight = (height + 1) >> 1; -- int r; - if (!src_y || !src_u || !src_v || width <= 0 || height == 0 || !dst_y || - !dst_u || !dst_v) { - return -1; -@@ -1127,35 +1078,23 @@ int I210Rotate(const uint16_t* src_y, - case kRotate90: - RotatePlane90_16(src_u, src_stride_u, dst_y, dst_stride_y, halfwidth, - height); -- r = ScalePlane_16(dst_y, dst_stride_y, height, halfwidth, dst_u, -- dst_stride_u, halfheight, width, kFilterBilinear); -- if (r != 0) { -- return r; -- } -+ ScalePlane_16(dst_y, dst_stride_y, height, halfwidth, dst_u, dst_stride_u, -+ halfheight, width, kFilterBilinear); - RotatePlane90_16(src_v, src_stride_v, dst_y, dst_stride_y, halfwidth, - height); -- r = ScalePlane_16(dst_y, dst_stride_y, height, halfwidth, dst_v, -- dst_stride_v, halfheight, width, kFilterLinear); -- if (r != 0) { -- return r; -- } -+ ScalePlane_16(dst_y, dst_stride_y, height, halfwidth, dst_v, dst_stride_v, -+ halfheight, width, kFilterLinear); - RotatePlane90_16(src_y, src_stride_y, dst_y, dst_stride_y, width, height); - return 0; - case kRotate270: - RotatePlane270_16(src_u, src_stride_u, dst_y, dst_stride_y, halfwidth, - height); -- r = ScalePlane_16(dst_y, dst_stride_y, height, halfwidth, dst_u, -- dst_stride_u, halfheight, width, kFilterBilinear); -- if (r != 0) { -- return r; -- } -+ ScalePlane_16(dst_y, dst_stride_y, height, halfwidth, dst_u, dst_stride_u, -+ halfheight, width, kFilterBilinear); - RotatePlane270_16(src_v, src_stride_v, dst_y, dst_stride_y, halfwidth, - height); -- r = ScalePlane_16(dst_y, dst_stride_y, height, halfwidth, dst_v, -- dst_stride_v, halfheight, width, kFilterLinear); -- if (r != 0) { -- return r; -- } -+ ScalePlane_16(dst_y, dst_stride_y, height, halfwidth, dst_v, dst_stride_v, -+ halfheight, width, kFilterLinear); - RotatePlane270_16(src_y, src_stride_y, dst_y, dst_stride_y, width, - height); - return 0; -diff --git a/media/libyuv/libyuv/source/rotate_any.cc b/media/libyuv/libyuv/source/rotate_any.cc ---- a/media/libyuv/libyuv/source/rotate_any.cc -+++ b/media/libyuv/libyuv/source/rotate_any.cc -@@ -32,9 +32,6 @@ extern "C" { - #ifdef HAS_TRANSPOSEWX8_NEON - TANY(TransposeWx8_Any_NEON, TransposeWx8_NEON, 7) - #endif --#ifdef HAS_TRANSPOSEWX16_NEON --TANY(TransposeWx16_Any_NEON, TransposeWx16_NEON, 15) --#endif - #ifdef HAS_TRANSPOSEWX8_SSSE3 - TANY(TransposeWx8_Any_SSSE3, TransposeWx8_SSSE3, 7) - #endif -diff --git a/media/libyuv/libyuv/source/rotate_argb.cc b/media/libyuv/libyuv/source/rotate_argb.cc ---- a/media/libyuv/libyuv/source/rotate_argb.cc -+++ b/media/libyuv/libyuv/source/rotate_argb.cc -@@ -69,11 +69,6 @@ static int ARGBTranspose(const uint8_t* - } - } - #endif --#if defined(HAS_SCALEARGBROWDOWNEVEN_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ScaleARGBRowDownEven = ScaleARGBRowDownEven_RVV; -- } --#endif - - for (i = 0; i < width; ++i) { // column of source to row of dest. - ScaleARGBRowDownEven(src_argb, 0, src_pixel_step, dst_argb, height); -@@ -120,6 +115,7 @@ static int ARGBRotate180(const uint8_t* - int width, - int height) { - // Swap first and last row and mirror the content. Uses a temporary row. -+ align_buffer_64(row, width * 4); - const uint8_t* src_bot = src_argb + src_stride_argb * (height - 1); - uint8_t* dst_bot = dst_argb + dst_stride_argb * (height - 1); - int half_height = (height + 1) >> 1; -@@ -128,9 +124,6 @@ static int ARGBRotate180(const uint8_t* - ARGBMirrorRow_C; - void (*CopyRow)(const uint8_t* src_argb, uint8_t* dst_argb, int width) = - CopyRow_C; -- align_buffer_64(row, width * 4); -- if (!row) -- return 1; - #if defined(HAS_ARGBMIRRORROW_NEON) - if (TestCpuFlag(kCpuHasNEON)) { - ARGBMirrorRow = ARGBMirrorRow_Any_NEON; -@@ -163,14 +156,6 @@ static int ARGBRotate180(const uint8_t* - } - } - #endif --#if defined(HAS_ARGBMIRRORROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- ARGBMirrorRow = ARGBMirrorRow_Any_LSX; -- if (IS_ALIGNED(width, 8)) { -- ARGBMirrorRow = ARGBMirrorRow_LSX; -- } -- } --#endif - #if defined(HAS_ARGBMIRRORROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - ARGBMirrorRow = ARGBMirrorRow_Any_LASX; -@@ -199,11 +184,6 @@ static int ARGBRotate180(const uint8_t* - CopyRow = IS_ALIGNED(width * 4, 32) ? CopyRow_NEON : CopyRow_Any_NEON; - } - #endif --#if defined(HAS_COPYROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- CopyRow = CopyRow_RVV; -- } --#endif - - // Odd height will harmlessly mirror the middle row twice. - for (y = 0; y < half_height; ++y) { -diff --git a/media/libyuv/libyuv/source/rotate_common.cc b/media/libyuv/libyuv/source/rotate_common.cc ---- a/media/libyuv/libyuv/source/rotate_common.cc -+++ b/media/libyuv/libyuv/source/rotate_common.cc -@@ -36,16 +36,6 @@ void TransposeWx8_C(const uint8_t* src, - } - } - --void TransposeWx16_C(const uint8_t* src, -- int src_stride, -- uint8_t* dst, -- int dst_stride, -- int width) { -- TransposeWx8_C(src, src_stride, dst, dst_stride, width); -- TransposeWx8_C((src + 8 * src_stride), src_stride, (dst + 8), dst_stride, -- width); --} -- - void TransposeUVWx8_C(const uint8_t* src, - int src_stride, - uint8_t* dst_a, -@@ -130,6 +120,37 @@ void TransposeWx8_16_C(const uint16_t* s - } - } - -+void TransposeUVWx8_16_C(const uint16_t* src, -+ int src_stride, -+ uint16_t* dst_a, -+ int dst_stride_a, -+ uint16_t* dst_b, -+ int dst_stride_b, -+ int width) { -+ int i; -+ for (i = 0; i < width; ++i) { -+ dst_a[0] = src[0 * src_stride + 0]; -+ dst_b[0] = src[0 * src_stride + 1]; -+ dst_a[1] = src[1 * src_stride + 0]; -+ dst_b[1] = src[1 * src_stride + 1]; -+ dst_a[2] = src[2 * src_stride + 0]; -+ dst_b[2] = src[2 * src_stride + 1]; -+ dst_a[3] = src[3 * src_stride + 0]; -+ dst_b[3] = src[3 * src_stride + 1]; -+ dst_a[4] = src[4 * src_stride + 0]; -+ dst_b[4] = src[4 * src_stride + 1]; -+ dst_a[5] = src[5 * src_stride + 0]; -+ dst_b[5] = src[5 * src_stride + 1]; -+ dst_a[6] = src[6 * src_stride + 0]; -+ dst_b[6] = src[6 * src_stride + 1]; -+ dst_a[7] = src[7 * src_stride + 0]; -+ dst_b[7] = src[7 * src_stride + 1]; -+ src += 2; -+ dst_a += dst_stride_a; -+ dst_b += dst_stride_b; -+ } -+} -+ - void TransposeWxH_16_C(const uint16_t* src, - int src_stride, - uint16_t* dst, -diff --git a/media/libyuv/libyuv/source/rotate_gcc.cc b/media/libyuv/libyuv/source/rotate_gcc.cc ---- a/media/libyuv/libyuv/source/rotate_gcc.cc -+++ b/media/libyuv/libyuv/source/rotate_gcc.cc -@@ -26,7 +26,7 @@ void TransposeWx8_SSSE3(const uint8_t* s - uint8_t* dst, - int dst_stride, - int width) { -- asm volatile ( -+ asm volatile( - // Read in the data from the source pointer. - // First round of bit swap. - LABELALIGN -@@ -116,7 +116,7 @@ void TransposeWx8_Fast_SSSE3(const uint8 - uint8_t* dst, - int dst_stride, - int width) { -- asm volatile ( -+ asm volatile( - // Read in the data from the source pointer. - // First round of bit swap. - LABELALIGN -@@ -261,7 +261,7 @@ void TransposeUVWx8_SSE2(const uint8_t* - uint8_t* dst_b, - int dst_stride_b, - int width) { -- asm volatile ( -+ asm volatile( - // Read in the data from the source pointer. - // First round of bit swap. - LABELALIGN -@@ -365,136 +365,6 @@ void TransposeUVWx8_SSE2(const uint8_t* - "xmm7", "xmm8", "xmm9"); - } - #endif // defined(HAS_TRANSPOSEUVWX8_SSE2) -- --#if defined(HAS_TRANSPOSE4X4_32_SSE2) --// 4 values, little endian view --// a b c d --// e f g h --// i j k l --// m n o p -- --// transpose 2x2 --// a e b f from row 0, 1 --// i m j n from row 2, 3 --// c g d h from row 0, 1 --// k o l p from row 2, 3 -- --// transpose 4x4 --// a e i m from row 0, 1 --// b f j n from row 0, 1 --// c g k o from row 2, 3 --// d h l p from row 2, 3 -- --// Transpose 32 bit values (ARGB) --void Transpose4x4_32_SSE2(const uint8_t* src, -- int src_stride, -- uint8_t* dst, -- int dst_stride, -- int width) { -- asm volatile ( -- // Main loop transpose 4x4. Read a column, write a row. -- "1: \n" -- "movdqu (%0),%%xmm0 \n" // a b c d -- "movdqu (%0,%3),%%xmm1 \n" // e f g h -- "lea (%0,%3,2),%0 \n" // src += stride * 2 -- "movdqu (%0),%%xmm2 \n" // i j k l -- "movdqu (%0,%3),%%xmm3 \n" // m n o p -- "lea (%0,%3,2),%0 \n" // src += stride * 2 -- -- // Transpose 2x2 -- "movdqa %%xmm0,%%xmm4 \n" -- "movdqa %%xmm2,%%xmm5 \n" -- "movdqa %%xmm0,%%xmm6 \n" -- "movdqa %%xmm2,%%xmm7 \n" -- "punpckldq %%xmm1,%%xmm4 \n" // a e b f from row 0, 1 -- "punpckldq %%xmm3,%%xmm5 \n" // i m j n from row 2, 3 -- "punpckhdq %%xmm1,%%xmm6 \n" // c g d h from row 0, 1 -- "punpckhdq %%xmm3,%%xmm7 \n" // k o l p from row 2, 3 -- -- // Transpose 4x4 -- "movdqa %%xmm4,%%xmm0 \n" -- "movdqa %%xmm4,%%xmm1 \n" -- "movdqa %%xmm6,%%xmm2 \n" -- "movdqa %%xmm6,%%xmm3 \n" -- "punpcklqdq %%xmm5,%%xmm0 \n" // a e i m from row 0, 1 -- "punpckhqdq %%xmm5,%%xmm1 \n" // b f j n from row 0, 1 -- "punpcklqdq %%xmm7,%%xmm2 \n" // c g k o from row 2, 3 -- "punpckhqdq %%xmm7,%%xmm3 \n" // d h l p from row 2, 3 -- -- "movdqu %%xmm0,(%1) \n" -- "lea 16(%1,%4),%1 \n" // dst += stride + 16 -- "movdqu %%xmm1,-16(%1) \n" -- "movdqu %%xmm2,-16(%1,%4) \n" -- "movdqu %%xmm3,-16(%1,%4,2) \n" -- "sub %4,%1 \n" -- "sub $0x4,%2 \n" -- "jg 1b \n" -- : "+r"(src), // %0 -- "+r"(dst), // %1 -- "+rm"(width) // %2 -- : "r"((ptrdiff_t)(src_stride)), // %3 -- "r"((ptrdiff_t)(dst_stride)) // %4 -- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", -- "xmm7"); --} --#endif // defined(HAS_TRANSPOSE4X4_32_SSE2) -- --#if defined(HAS_TRANSPOSE4X4_32_AVX2) -- --// Transpose 32 bit values (ARGB) --void Transpose4x4_32_AVX2(const uint8_t* src, -- int src_stride, -- uint8_t* dst, -- int dst_stride, -- int width) { -- asm volatile ( -- // Main loop transpose 2 blocks of 4x4. Read a column, write a row. -- "1: \n" -- "vmovdqu (%0),%%xmm0 \n" // a b c d -- "vmovdqu (%0,%3),%%xmm1 \n" // e f g h -- "lea (%0,%3,2),%0 \n" // src += stride * 2 -- "vmovdqu (%0),%%xmm2 \n" // i j k l -- "vmovdqu (%0,%3),%%xmm3 \n" // m n o p -- "lea (%0,%3,2),%0 \n" // src += stride * 2 -- -- "vinserti128 $1,(%0),%%ymm0,%%ymm0 \n" // a b c d -- "vinserti128 $1,(%0,%3),%%ymm1,%%ymm1 \n" // e f g h -- "lea (%0,%3,2),%0 \n" // src += stride * 2 -- "vinserti128 $1,(%0),%%ymm2,%%ymm2 \n" // i j k l -- "vinserti128 $1,(%0,%3),%%ymm3,%%ymm3 \n" // m n o p -- "lea (%0,%3,2),%0 \n" // src += stride * 2 -- -- // Transpose 2x2 -- "vpunpckldq %%ymm1,%%ymm0,%%ymm4 \n" // a e b f from row 0, 1 -- "vpunpckldq %%ymm3,%%ymm2,%%ymm5 \n" // i m j n from row 2, 3 -- "vpunpckhdq %%ymm1,%%ymm0,%%ymm6 \n" // c g d h from row 0, 1 -- "vpunpckhdq %%ymm3,%%ymm2,%%ymm7 \n" // k o l p from row 2, 3 -- -- // Transpose 4x4 -- "vpunpcklqdq %%ymm5,%%ymm4,%%ymm0 \n" // a e i m from row 0, 1 -- "vpunpckhqdq %%ymm5,%%ymm4,%%ymm1 \n" // b f j n from row 0, 1 -- "vpunpcklqdq %%ymm7,%%ymm6,%%ymm2 \n" // c g k o from row 2, 3 -- "vpunpckhqdq %%ymm7,%%ymm6,%%ymm3 \n" // d h l p from row 2, 3 -- -- "vmovdqu %%ymm0,(%1) \n" -- "lea 32(%1,%4),%1 \n" // dst += stride + 32 -- "vmovdqu %%ymm1,-32(%1) \n" -- "vmovdqu %%ymm2,-32(%1,%4) \n" -- "vmovdqu %%ymm3,-32(%1,%4,2) \n" -- "sub %4,%1 \n" -- "sub $0x8,%2 \n" -- "jg 1b \n" -- "vzeroupper \n" -- : "+r"(src), // %0 -- "+r"(dst), // %1 -- "+rm"(width) // %2 -- : "r"((ptrdiff_t)(src_stride)), // %3 -- "r"((ptrdiff_t)(dst_stride)) // %4 -- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", -- "xmm7"); --} --#endif // defined(HAS_TRANSPOSE4X4_32_AVX2) -- - #endif // defined(__x86_64__) || defined(__i386__) - - #ifdef __cplusplus -diff --git a/media/libyuv/libyuv/source/rotate_lsx.cc b/media/libyuv/libyuv/source/rotate_lsx.cc ---- a/media/libyuv/libyuv/source/rotate_lsx.cc -+++ b/media/libyuv/libyuv/source/rotate_lsx.cc -@@ -61,6 +61,16 @@ extern "C" { - _dst += _stride2; \ - } - -+void TransposeWx16_C(const uint8_t* src, -+ int src_stride, -+ uint8_t* dst, -+ int dst_stride, -+ int width) { -+ TransposeWx8_C(src, src_stride, dst, dst_stride, width); -+ TransposeWx8_C((src + 8 * src_stride), src_stride, (dst + 8), dst_stride, -+ width); -+} -+ - void TransposeUVWx16_C(const uint8_t* src, - int src_stride, - uint8_t* dst_a, -diff --git a/media/libyuv/libyuv/source/rotate_neon.cc b/media/libyuv/libyuv/source/rotate_neon.cc ---- a/media/libyuv/libyuv/source/rotate_neon.cc -+++ b/media/libyuv/libyuv/source/rotate_neon.cc -@@ -21,72 +21,177 @@ extern "C" { - #if !defined(LIBYUV_DISABLE_NEON) && defined(__ARM_NEON__) && \ - !defined(__aarch64__) - -+static const uvec8 kVTbl4x4Transpose = {0, 4, 8, 12, 1, 5, 9, 13, -+ 2, 6, 10, 14, 3, 7, 11, 15}; -+ - void TransposeWx8_NEON(const uint8_t* src, - int src_stride, - uint8_t* dst, - int dst_stride, - int width) { -- const uint8_t* temp; -- asm volatile ( -+ const uint8_t* src_temp; -+ asm volatile( - // loops are on blocks of 8. loop will stop when - // counter gets to or below 0. starting the counter - // at w-8 allow for this -- "sub %[width], #8 \n" -+ "sub %5, #8 \n" -+ -+ // handle 8x8 blocks. this should be the majority of the plane -+ "1: \n" -+ "mov %0, %1 \n" -+ -+ "vld1.8 {d0}, [%0], %2 \n" -+ "vld1.8 {d1}, [%0], %2 \n" -+ "vld1.8 {d2}, [%0], %2 \n" -+ "vld1.8 {d3}, [%0], %2 \n" -+ "vld1.8 {d4}, [%0], %2 \n" -+ "vld1.8 {d5}, [%0], %2 \n" -+ "vld1.8 {d6}, [%0], %2 \n" -+ "vld1.8 {d7}, [%0] \n" -+ -+ "vtrn.8 d1, d0 \n" -+ "vtrn.8 d3, d2 \n" -+ "vtrn.8 d5, d4 \n" -+ "vtrn.8 d7, d6 \n" -+ -+ "vtrn.16 d1, d3 \n" -+ "vtrn.16 d0, d2 \n" -+ "vtrn.16 d5, d7 \n" -+ "vtrn.16 d4, d6 \n" -+ -+ "vtrn.32 d1, d5 \n" -+ "vtrn.32 d0, d4 \n" -+ "vtrn.32 d3, d7 \n" -+ "vtrn.32 d2, d6 \n" -+ -+ "vrev16.8 q0, q0 \n" -+ "vrev16.8 q1, q1 \n" -+ "vrev16.8 q2, q2 \n" -+ "vrev16.8 q3, q3 \n" -+ -+ "mov %0, %3 \n" - -- "1: \n" -- "mov %[temp], %[src] \n" -- "vld1.8 {d0}, [%[temp]], %[src_stride] \n" -- "vld1.8 {d1}, [%[temp]], %[src_stride] \n" -- "vld1.8 {d2}, [%[temp]], %[src_stride] \n" -- "vld1.8 {d3}, [%[temp]], %[src_stride] \n" -- "vld1.8 {d4}, [%[temp]], %[src_stride] \n" -- "vld1.8 {d5}, [%[temp]], %[src_stride] \n" -- "vld1.8 {d6}, [%[temp]], %[src_stride] \n" -- "vld1.8 {d7}, [%[temp]] \n" -- "add %[src], #8 \n" -+ "vst1.8 {d1}, [%0], %4 \n" -+ "vst1.8 {d0}, [%0], %4 \n" -+ "vst1.8 {d3}, [%0], %4 \n" -+ "vst1.8 {d2}, [%0], %4 \n" -+ "vst1.8 {d5}, [%0], %4 \n" -+ "vst1.8 {d4}, [%0], %4 \n" -+ "vst1.8 {d7}, [%0], %4 \n" -+ "vst1.8 {d6}, [%0] \n" -+ -+ "add %1, #8 \n" // src += 8 -+ "add %3, %3, %4, lsl #3 \n" // dst += 8 * dst_stride -+ "subs %5, #8 \n" // w -= 8 -+ "bge 1b \n" -+ -+ // add 8 back to counter. if the result is 0 there are -+ // no residuals. -+ "adds %5, #8 \n" -+ "beq 4f \n" - -- "vtrn.8 d1, d0 \n" -- "vtrn.8 d3, d2 \n" -- "vtrn.8 d5, d4 \n" -- "vtrn.8 d7, d6 \n" -- "subs %[width], #8 \n" -+ // some residual, so between 1 and 7 lines left to transpose -+ "cmp %5, #2 \n" -+ "blt 3f \n" -+ -+ "cmp %5, #4 \n" -+ "blt 2f \n" - -- "vtrn.16 d1, d3 \n" -- "vtrn.16 d0, d2 \n" -- "vtrn.16 d5, d7 \n" -- "vtrn.16 d4, d6 \n" -+ // 4x8 block -+ "mov %0, %1 \n" -+ "vld1.32 {d0[0]}, [%0], %2 \n" -+ "vld1.32 {d0[1]}, [%0], %2 \n" -+ "vld1.32 {d1[0]}, [%0], %2 \n" -+ "vld1.32 {d1[1]}, [%0], %2 \n" -+ "vld1.32 {d2[0]}, [%0], %2 \n" -+ "vld1.32 {d2[1]}, [%0], %2 \n" -+ "vld1.32 {d3[0]}, [%0], %2 \n" -+ "vld1.32 {d3[1]}, [%0] \n" -+ -+ "mov %0, %3 \n" - -- "vtrn.32 d1, d5 \n" -- "vtrn.32 d0, d4 \n" -- "vtrn.32 d3, d7 \n" -- "vtrn.32 d2, d6 \n" -+ "vld1.8 {q3}, [%6] \n" -+ -+ "vtbl.8 d4, {d0, d1}, d6 \n" -+ "vtbl.8 d5, {d0, d1}, d7 \n" -+ "vtbl.8 d0, {d2, d3}, d6 \n" -+ "vtbl.8 d1, {d2, d3}, d7 \n" -+ -+ // TODO(frkoenig): Rework shuffle above to -+ // write out with 4 instead of 8 writes. -+ "vst1.32 {d4[0]}, [%0], %4 \n" -+ "vst1.32 {d4[1]}, [%0], %4 \n" -+ "vst1.32 {d5[0]}, [%0], %4 \n" -+ "vst1.32 {d5[1]}, [%0] \n" - -- "vrev16.8 q0, q0 \n" -- "vrev16.8 q1, q1 \n" -- "vrev16.8 q2, q2 \n" -- "vrev16.8 q3, q3 \n" -+ "add %0, %3, #4 \n" -+ "vst1.32 {d0[0]}, [%0], %4 \n" -+ "vst1.32 {d0[1]}, [%0], %4 \n" -+ "vst1.32 {d1[0]}, [%0], %4 \n" -+ "vst1.32 {d1[1]}, [%0] \n" -+ -+ "add %1, #4 \n" // src += 4 -+ "add %3, %3, %4, lsl #2 \n" // dst += 4 * dst_stride -+ "subs %5, #4 \n" // w -= 4 -+ "beq 4f \n" -+ -+ // some residual, check to see if it includes a 2x8 block, -+ // or less -+ "cmp %5, #2 \n" -+ "blt 3f \n" - -- "mov %[temp], %[dst] \n" -- "vst1.8 {d1}, [%[temp]], %[dst_stride] \n" -- "vst1.8 {d0}, [%[temp]], %[dst_stride] \n" -- "vst1.8 {d3}, [%[temp]], %[dst_stride] \n" -- "vst1.8 {d2}, [%[temp]], %[dst_stride] \n" -- "vst1.8 {d5}, [%[temp]], %[dst_stride] \n" -- "vst1.8 {d4}, [%[temp]], %[dst_stride] \n" -- "vst1.8 {d7}, [%[temp]], %[dst_stride] \n" -- "vst1.8 {d6}, [%[temp]] \n" -- "add %[dst], %[dst], %[dst_stride], lsl #3 \n" -+ // 2x8 block -+ "2: \n" -+ "mov %0, %1 \n" -+ "vld1.16 {d0[0]}, [%0], %2 \n" -+ "vld1.16 {d1[0]}, [%0], %2 \n" -+ "vld1.16 {d0[1]}, [%0], %2 \n" -+ "vld1.16 {d1[1]}, [%0], %2 \n" -+ "vld1.16 {d0[2]}, [%0], %2 \n" -+ "vld1.16 {d1[2]}, [%0], %2 \n" -+ "vld1.16 {d0[3]}, [%0], %2 \n" -+ "vld1.16 {d1[3]}, [%0] \n" -+ -+ "vtrn.8 d0, d1 \n" -+ -+ "mov %0, %3 \n" -+ -+ "vst1.64 {d0}, [%0], %4 \n" -+ "vst1.64 {d1}, [%0] \n" - -- "bge 1b \n" -- : [temp] "=&r"(temp), // %[temp] -- [src] "+r"(src), // %[src] -- [dst] "+r"(dst), // %[dst] -- [width] "+r"(width) // %[width] -- : [src_stride] "r"(src_stride), // %[src_stride] -- [dst_stride] "r"(dst_stride) // %[dst_stride] -+ "add %1, #2 \n" // src += 2 -+ "add %3, %3, %4, lsl #1 \n" // dst += 2 * dst_stride -+ "subs %5, #2 \n" // w -= 2 -+ "beq 4f \n" -+ -+ // 1x8 block -+ "3: \n" -+ "vld1.8 {d0[0]}, [%1], %2 \n" -+ "vld1.8 {d0[1]}, [%1], %2 \n" -+ "vld1.8 {d0[2]}, [%1], %2 \n" -+ "vld1.8 {d0[3]}, [%1], %2 \n" -+ "vld1.8 {d0[4]}, [%1], %2 \n" -+ "vld1.8 {d0[5]}, [%1], %2 \n" -+ "vld1.8 {d0[6]}, [%1], %2 \n" -+ "vld1.8 {d0[7]}, [%1] \n" -+ -+ "vst1.64 {d0}, [%3] \n" -+ -+ "4: \n" -+ -+ : "=&r"(src_temp), // %0 -+ "+r"(src), // %1 -+ "+r"(src_stride), // %2 -+ "+r"(dst), // %3 -+ "+r"(dst_stride), // %4 -+ "+r"(width) // %5 -+ : "r"(&kVTbl4x4Transpose) // %6 - : "memory", "cc", "q0", "q1", "q2", "q3"); - } - -+static const uvec8 kVTbl4x4TransposeDi = {0, 8, 1, 9, 2, 10, 3, 11, -+ 4, 12, 5, 13, 6, 14, 7, 15}; -+ - void TransposeUVWx8_NEON(const uint8_t* src, - int src_stride, - uint8_t* dst_a, -@@ -94,123 +199,217 @@ void TransposeUVWx8_NEON(const uint8_t* - uint8_t* dst_b, - int dst_stride_b, - int width) { -- const uint8_t* temp; -- asm volatile ( -+ const uint8_t* src_temp; -+ asm volatile( - // loops are on blocks of 8. loop will stop when - // counter gets to or below 0. starting the counter - // at w-8 allow for this -- "sub %[width], #8 \n" -+ "sub %7, #8 \n" -+ -+ // handle 8x8 blocks. this should be the majority of the plane -+ "1: \n" -+ "mov %0, %1 \n" -+ -+ "vld2.8 {d0, d1}, [%0], %2 \n" -+ "vld2.8 {d2, d3}, [%0], %2 \n" -+ "vld2.8 {d4, d5}, [%0], %2 \n" -+ "vld2.8 {d6, d7}, [%0], %2 \n" -+ "vld2.8 {d16, d17}, [%0], %2 \n" -+ "vld2.8 {d18, d19}, [%0], %2 \n" -+ "vld2.8 {d20, d21}, [%0], %2 \n" -+ "vld2.8 {d22, d23}, [%0] \n" -+ -+ "vtrn.8 q1, q0 \n" -+ "vtrn.8 q3, q2 \n" -+ "vtrn.8 q9, q8 \n" -+ "vtrn.8 q11, q10 \n" - -- "1: \n" -- "mov %[temp], %[src] \n" -- "vld2.8 {d0, d1}, [%[temp]], %[src_stride] \n" -- "vld2.8 {d2, d3}, [%[temp]], %[src_stride] \n" -- "vld2.8 {d4, d5}, [%[temp]], %[src_stride] \n" -- "vld2.8 {d6, d7}, [%[temp]], %[src_stride] \n" -- "vld2.8 {d16, d17}, [%[temp]], %[src_stride] \n" -- "vld2.8 {d18, d19}, [%[temp]], %[src_stride] \n" -- "vld2.8 {d20, d21}, [%[temp]], %[src_stride] \n" -- "vld2.8 {d22, d23}, [%[temp]] \n" -- "add %[src], #8*2 \n" -+ "vtrn.16 q1, q3 \n" -+ "vtrn.16 q0, q2 \n" -+ "vtrn.16 q9, q11 \n" -+ "vtrn.16 q8, q10 \n" -+ -+ "vtrn.32 q1, q9 \n" -+ "vtrn.32 q0, q8 \n" -+ "vtrn.32 q3, q11 \n" -+ "vtrn.32 q2, q10 \n" -+ -+ "vrev16.8 q0, q0 \n" -+ "vrev16.8 q1, q1 \n" -+ "vrev16.8 q2, q2 \n" -+ "vrev16.8 q3, q3 \n" -+ "vrev16.8 q8, q8 \n" -+ "vrev16.8 q9, q9 \n" -+ "vrev16.8 q10, q10 \n" -+ "vrev16.8 q11, q11 \n" -+ -+ "mov %0, %3 \n" - -- "vtrn.8 q1, q0 \n" -- "vtrn.8 q3, q2 \n" -- "vtrn.8 q9, q8 \n" -- "vtrn.8 q11, q10 \n" -- "subs %[width], #8 \n" -+ "vst1.8 {d2}, [%0], %4 \n" -+ "vst1.8 {d0}, [%0], %4 \n" -+ "vst1.8 {d6}, [%0], %4 \n" -+ "vst1.8 {d4}, [%0], %4 \n" -+ "vst1.8 {d18}, [%0], %4 \n" -+ "vst1.8 {d16}, [%0], %4 \n" -+ "vst1.8 {d22}, [%0], %4 \n" -+ "vst1.8 {d20}, [%0] \n" -+ -+ "mov %0, %5 \n" -+ -+ "vst1.8 {d3}, [%0], %6 \n" -+ "vst1.8 {d1}, [%0], %6 \n" -+ "vst1.8 {d7}, [%0], %6 \n" -+ "vst1.8 {d5}, [%0], %6 \n" -+ "vst1.8 {d19}, [%0], %6 \n" -+ "vst1.8 {d17}, [%0], %6 \n" -+ "vst1.8 {d23}, [%0], %6 \n" -+ "vst1.8 {d21}, [%0] \n" -+ -+ "add %1, #8*2 \n" // src += 8*2 -+ "add %3, %3, %4, lsl #3 \n" // dst_a += 8 * -+ // dst_stride_a -+ "add %5, %5, %6, lsl #3 \n" // dst_b += 8 * -+ // dst_stride_b -+ "subs %7, #8 \n" // w -= 8 -+ "bge 1b \n" - -- "vtrn.16 q1, q3 \n" -- "vtrn.16 q0, q2 \n" -- "vtrn.16 q9, q11 \n" -- "vtrn.16 q8, q10 \n" -+ // add 8 back to counter. if the result is 0 there are -+ // no residuals. -+ "adds %7, #8 \n" -+ "beq 4f \n" -+ -+ // some residual, so between 1 and 7 lines left to transpose -+ "cmp %7, #2 \n" -+ "blt 3f \n" -+ -+ "cmp %7, #4 \n" -+ "blt 2f \n" - -- "vtrn.32 q1, q9 \n" -- "vtrn.32 q0, q8 \n" -- "vtrn.32 q3, q11 \n" -- "vtrn.32 q2, q10 \n" -+ // TODO(frkoenig): Clean this up -+ // 4x8 block -+ "mov %0, %1 \n" -+ "vld1.64 {d0}, [%0], %2 \n" -+ "vld1.64 {d1}, [%0], %2 \n" -+ "vld1.64 {d2}, [%0], %2 \n" -+ "vld1.64 {d3}, [%0], %2 \n" -+ "vld1.64 {d4}, [%0], %2 \n" -+ "vld1.64 {d5}, [%0], %2 \n" -+ "vld1.64 {d6}, [%0], %2 \n" -+ "vld1.64 {d7}, [%0] \n" -+ -+ "vld1.8 {q15}, [%8] \n" -+ -+ "vtrn.8 q0, q1 \n" -+ "vtrn.8 q2, q3 \n" - -- "vrev16.8 q0, q0 \n" -- "vrev16.8 q1, q1 \n" -- "vrev16.8 q2, q2 \n" -- "vrev16.8 q3, q3 \n" -- "vrev16.8 q8, q8 \n" -- "vrev16.8 q9, q9 \n" -- "vrev16.8 q10, q10 \n" -- "vrev16.8 q11, q11 \n" -+ "vtbl.8 d16, {d0, d1}, d30 \n" -+ "vtbl.8 d17, {d0, d1}, d31 \n" -+ "vtbl.8 d18, {d2, d3}, d30 \n" -+ "vtbl.8 d19, {d2, d3}, d31 \n" -+ "vtbl.8 d20, {d4, d5}, d30 \n" -+ "vtbl.8 d21, {d4, d5}, d31 \n" -+ "vtbl.8 d22, {d6, d7}, d30 \n" -+ "vtbl.8 d23, {d6, d7}, d31 \n" -+ -+ "mov %0, %3 \n" -+ -+ "vst1.32 {d16[0]}, [%0], %4 \n" -+ "vst1.32 {d16[1]}, [%0], %4 \n" -+ "vst1.32 {d17[0]}, [%0], %4 \n" -+ "vst1.32 {d17[1]}, [%0], %4 \n" -+ -+ "add %0, %3, #4 \n" -+ "vst1.32 {d20[0]}, [%0], %4 \n" -+ "vst1.32 {d20[1]}, [%0], %4 \n" -+ "vst1.32 {d21[0]}, [%0], %4 \n" -+ "vst1.32 {d21[1]}, [%0] \n" -+ -+ "mov %0, %5 \n" - -- "mov %[temp], %[dst_a] \n" -- "vst1.8 {d2}, [%[temp]], %[dst_stride_a] \n" -- "vst1.8 {d0}, [%[temp]], %[dst_stride_a] \n" -- "vst1.8 {d6}, [%[temp]], %[dst_stride_a] \n" -- "vst1.8 {d4}, [%[temp]], %[dst_stride_a] \n" -- "vst1.8 {d18}, [%[temp]], %[dst_stride_a] \n" -- "vst1.8 {d16}, [%[temp]], %[dst_stride_a] \n" -- "vst1.8 {d22}, [%[temp]], %[dst_stride_a] \n" -- "vst1.8 {d20}, [%[temp]] \n" -- "add %[dst_a], %[dst_a], %[dst_stride_a], lsl #3 \n" -+ "vst1.32 {d18[0]}, [%0], %6 \n" -+ "vst1.32 {d18[1]}, [%0], %6 \n" -+ "vst1.32 {d19[0]}, [%0], %6 \n" -+ "vst1.32 {d19[1]}, [%0], %6 \n" -+ -+ "add %0, %5, #4 \n" -+ "vst1.32 {d22[0]}, [%0], %6 \n" -+ "vst1.32 {d22[1]}, [%0], %6 \n" -+ "vst1.32 {d23[0]}, [%0], %6 \n" -+ "vst1.32 {d23[1]}, [%0] \n" -+ -+ "add %1, #4*2 \n" // src += 4 * 2 -+ "add %3, %3, %4, lsl #2 \n" // dst_a += 4 * -+ // dst_stride_a -+ "add %5, %5, %6, lsl #2 \n" // dst_b += 4 * -+ // dst_stride_b -+ "subs %7, #4 \n" // w -= 4 -+ "beq 4f \n" -+ -+ // some residual, check to see if it includes a 2x8 block, -+ // or less -+ "cmp %7, #2 \n" -+ "blt 3f \n" - -- "mov %[temp], %[dst_b] \n" -- "vst1.8 {d3}, [%[temp]], %[dst_stride_b] \n" -- "vst1.8 {d1}, [%[temp]], %[dst_stride_b] \n" -- "vst1.8 {d7}, [%[temp]], %[dst_stride_b] \n" -- "vst1.8 {d5}, [%[temp]], %[dst_stride_b] \n" -- "vst1.8 {d19}, [%[temp]], %[dst_stride_b] \n" -- "vst1.8 {d17}, [%[temp]], %[dst_stride_b] \n" -- "vst1.8 {d23}, [%[temp]], %[dst_stride_b] \n" -- "vst1.8 {d21}, [%[temp]] \n" -- "add %[dst_b], %[dst_b], %[dst_stride_b], lsl #3 \n" -+ // 2x8 block -+ "2: \n" -+ "mov %0, %1 \n" -+ "vld2.16 {d0[0], d2[0]}, [%0], %2 \n" -+ "vld2.16 {d1[0], d3[0]}, [%0], %2 \n" -+ "vld2.16 {d0[1], d2[1]}, [%0], %2 \n" -+ "vld2.16 {d1[1], d3[1]}, [%0], %2 \n" -+ "vld2.16 {d0[2], d2[2]}, [%0], %2 \n" -+ "vld2.16 {d1[2], d3[2]}, [%0], %2 \n" -+ "vld2.16 {d0[3], d2[3]}, [%0], %2 \n" -+ "vld2.16 {d1[3], d3[3]}, [%0] \n" -+ -+ "vtrn.8 d0, d1 \n" -+ "vtrn.8 d2, d3 \n" -+ -+ "mov %0, %3 \n" -+ -+ "vst1.64 {d0}, [%0], %4 \n" -+ "vst1.64 {d2}, [%0] \n" -+ -+ "mov %0, %5 \n" -+ -+ "vst1.64 {d1}, [%0], %6 \n" -+ "vst1.64 {d3}, [%0] \n" - -- "bge 1b \n" -- : [temp] "=&r"(temp), // %[temp] -- [src] "+r"(src), // %[src] -- [dst_a] "+r"(dst_a), // %[dst_a] -- [dst_b] "+r"(dst_b), // %[dst_b] -- [width] "+r"(width) // %[width] -- : [src_stride] "r"(src_stride), // %[src_stride] -- [dst_stride_a] "r"(dst_stride_a), // %[dst_stride_a] -- [dst_stride_b] "r"(dst_stride_b) // %[dst_stride_b] -+ "add %1, #2*2 \n" // src += 2 * 2 -+ "add %3, %3, %4, lsl #1 \n" // dst_a += 2 * -+ // dst_stride_a -+ "add %5, %5, %6, lsl #1 \n" // dst_b += 2 * -+ // dst_stride_b -+ "subs %7, #2 \n" // w -= 2 -+ "beq 4f \n" -+ -+ // 1x8 block -+ "3: \n" -+ "vld2.8 {d0[0], d1[0]}, [%1], %2 \n" -+ "vld2.8 {d0[1], d1[1]}, [%1], %2 \n" -+ "vld2.8 {d0[2], d1[2]}, [%1], %2 \n" -+ "vld2.8 {d0[3], d1[3]}, [%1], %2 \n" -+ "vld2.8 {d0[4], d1[4]}, [%1], %2 \n" -+ "vld2.8 {d0[5], d1[5]}, [%1], %2 \n" -+ "vld2.8 {d0[6], d1[6]}, [%1], %2 \n" -+ "vld2.8 {d0[7], d1[7]}, [%1] \n" -+ -+ "vst1.64 {d0}, [%3] \n" -+ "vst1.64 {d1}, [%5] \n" -+ -+ "4: \n" -+ -+ : "=&r"(src_temp), // %0 -+ "+r"(src), // %1 -+ "+r"(src_stride), // %2 -+ "+r"(dst_a), // %3 -+ "+r"(dst_stride_a), // %4 -+ "+r"(dst_b), // %5 -+ "+r"(dst_stride_b), // %6 -+ "+r"(width) // %7 -+ : "r"(&kVTbl4x4TransposeDi) // %8 - : "memory", "cc", "q0", "q1", "q2", "q3", "q8", "q9", "q10", "q11"); - } -- --// Transpose 32 bit values (ARGB) --void Transpose4x4_32_NEON(const uint8_t* src, -- int src_stride, -- uint8_t* dst, -- int dst_stride, -- int width) { -- const uint8_t* src1 = src + src_stride; -- const uint8_t* src2 = src1 + src_stride; -- const uint8_t* src3 = src2 + src_stride; -- uint8_t* dst1 = dst + dst_stride; -- uint8_t* dst2 = dst1 + dst_stride; -- uint8_t* dst3 = dst2 + dst_stride; -- asm volatile ( -- // Main loop transpose 4x4. Read a column, write a row. -- "1: \n" -- "vld4.32 {d0[0], d2[0], d4[0], d6[0]}, [%0], %9 \n" -- "vld4.32 {d0[1], d2[1], d4[1], d6[1]}, [%1], %9 \n" -- "vld4.32 {d1[0], d3[0], d5[0], d7[0]}, [%2], %9 \n" -- "vld4.32 {d1[1], d3[1], d5[1], d7[1]}, [%3], %9 \n" -- "subs %8, %8, #4 \n" // w -= 4 -- "vst1.8 {q0}, [%4]! \n" -- "vst1.8 {q1}, [%5]! \n" -- "vst1.8 {q2}, [%6]! \n" -- "vst1.8 {q3}, [%7]! \n" -- "bgt 1b \n" -- -- : "+r"(src), // %0 -- "+r"(src1), // %1 -- "+r"(src2), // %2 -- "+r"(src3), // %3 -- "+r"(dst), // %4 -- "+r"(dst1), // %5 -- "+r"(dst2), // %6 -- "+r"(dst3), // %7 -- "+r"(width) // %8 -- : "r"((ptrdiff_t)(src_stride * 4)) // %9 -- : "memory", "cc", "q0", "q1", "q2", "q3"); --} -- - #endif // defined(__ARM_NEON__) && !defined(__aarch64__) - - #ifdef __cplusplus -diff --git a/media/libyuv/libyuv/source/rotate_neon64.cc b/media/libyuv/libyuv/source/rotate_neon64.cc ---- a/media/libyuv/libyuv/source/rotate_neon64.cc -+++ b/media/libyuv/libyuv/source/rotate_neon64.cc -@@ -21,122 +21,201 @@ extern "C" { - // This module is for GCC Neon armv8 64 bit. - #if !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__) - --void TransposeWx16_NEON(const uint8_t* src, -- int src_stride, -- uint8_t* dst, -- int dst_stride, -- int width) { -+static const uvec8 kVTbl4x4Transpose = {0, 4, 8, 12, 1, 5, 9, 13, -+ 2, 6, 10, 14, 3, 7, 11, 15}; -+ -+void TransposeWx8_NEON(const uint8_t* src, -+ int src_stride, -+ uint8_t* dst, -+ int dst_stride, -+ int width) { - const uint8_t* src_temp; -- asm volatile ( -- "1: \n" -- "mov %[src_temp], %[src] \n" -+ asm volatile( -+ // loops are on blocks of 8. loop will stop when -+ // counter gets to or below 0. starting the counter -+ // at w-8 allow for this -+ "sub %w3, %w3, #8 \n" -+ -+ // handle 8x8 blocks. this should be the majority of the plane -+ "1: \n" -+ "mov %0, %1 \n" -+ -+ "ld1 {v0.8b}, [%0], %5 \n" -+ "ld1 {v1.8b}, [%0], %5 \n" -+ "ld1 {v2.8b}, [%0], %5 \n" -+ "ld1 {v3.8b}, [%0], %5 \n" -+ "ld1 {v4.8b}, [%0], %5 \n" -+ "ld1 {v5.8b}, [%0], %5 \n" -+ "ld1 {v6.8b}, [%0], %5 \n" -+ "ld1 {v7.8b}, [%0] \n" -+ "mov %0, %1 \n" -+ -+ "trn2 v16.8b, v0.8b, v1.8b \n" -+ "prfm pldl1keep, [%0, 448] \n" // prefetch 7 lines ahead -+ "trn1 v17.8b, v0.8b, v1.8b \n" -+ "add %0, %0, %5 \n" -+ "trn2 v18.8b, v2.8b, v3.8b \n" -+ "prfm pldl1keep, [%0, 448] \n" // row 1 -+ "trn1 v19.8b, v2.8b, v3.8b \n" -+ "add %0, %0, %5 \n" -+ "trn2 v20.8b, v4.8b, v5.8b \n" -+ "prfm pldl1keep, [%0, 448] \n" // row 2 -+ "trn1 v21.8b, v4.8b, v5.8b \n" -+ "add %0, %0, %5 \n" -+ "trn2 v22.8b, v6.8b, v7.8b \n" -+ "prfm pldl1keep, [%0, 448] \n" // row 3 -+ "trn1 v23.8b, v6.8b, v7.8b \n" -+ "add %0, %0, %5 \n" - -- "ld1 {v16.16b}, [%[src_temp]], %[src_stride] \n" -- "ld1 {v17.16b}, [%[src_temp]], %[src_stride] \n" -- "ld1 {v18.16b}, [%[src_temp]], %[src_stride] \n" -- "ld1 {v19.16b}, [%[src_temp]], %[src_stride] \n" -- "ld1 {v20.16b}, [%[src_temp]], %[src_stride] \n" -- "ld1 {v21.16b}, [%[src_temp]], %[src_stride] \n" -- "ld1 {v22.16b}, [%[src_temp]], %[src_stride] \n" -- "ld1 {v23.16b}, [%[src_temp]], %[src_stride] \n" -- "ld1 {v24.16b}, [%[src_temp]], %[src_stride] \n" -- "ld1 {v25.16b}, [%[src_temp]], %[src_stride] \n" -- "ld1 {v26.16b}, [%[src_temp]], %[src_stride] \n" -- "ld1 {v27.16b}, [%[src_temp]], %[src_stride] \n" -- "ld1 {v28.16b}, [%[src_temp]], %[src_stride] \n" -- "ld1 {v29.16b}, [%[src_temp]], %[src_stride] \n" -- "ld1 {v30.16b}, [%[src_temp]], %[src_stride] \n" -- "ld1 {v31.16b}, [%[src_temp]], %[src_stride] \n" -+ "trn2 v3.4h, v17.4h, v19.4h \n" -+ "prfm pldl1keep, [%0, 448] \n" // row 4 -+ "trn1 v1.4h, v17.4h, v19.4h \n" -+ "add %0, %0, %5 \n" -+ "trn2 v2.4h, v16.4h, v18.4h \n" -+ "prfm pldl1keep, [%0, 448] \n" // row 5 -+ "trn1 v0.4h, v16.4h, v18.4h \n" -+ "add %0, %0, %5 \n" -+ "trn2 v7.4h, v21.4h, v23.4h \n" -+ "prfm pldl1keep, [%0, 448] \n" // row 6 -+ "trn1 v5.4h, v21.4h, v23.4h \n" -+ "add %0, %0, %5 \n" -+ "trn2 v6.4h, v20.4h, v22.4h \n" -+ "prfm pldl1keep, [%0, 448] \n" // row 7 -+ "trn1 v4.4h, v20.4h, v22.4h \n" -+ -+ "trn2 v21.2s, v1.2s, v5.2s \n" -+ "trn1 v17.2s, v1.2s, v5.2s \n" -+ "trn2 v20.2s, v0.2s, v4.2s \n" -+ "trn1 v16.2s, v0.2s, v4.2s \n" -+ "trn2 v23.2s, v3.2s, v7.2s \n" -+ "trn1 v19.2s, v3.2s, v7.2s \n" -+ "trn2 v22.2s, v2.2s, v6.2s \n" -+ "trn1 v18.2s, v2.2s, v6.2s \n" - -- "add %[src], %[src], #16 \n" -+ "mov %0, %2 \n" -+ -+ "st1 {v17.8b}, [%0], %6 \n" -+ "st1 {v16.8b}, [%0], %6 \n" -+ "st1 {v19.8b}, [%0], %6 \n" -+ "st1 {v18.8b}, [%0], %6 \n" -+ "st1 {v21.8b}, [%0], %6 \n" -+ "st1 {v20.8b}, [%0], %6 \n" -+ "st1 {v23.8b}, [%0], %6 \n" -+ "st1 {v22.8b}, [%0] \n" - -- // Transpose bytes within each 2x2 block. -- "trn1 v0.16b, v16.16b, v17.16b \n" -- "trn2 v1.16b, v16.16b, v17.16b \n" -- "trn1 v2.16b, v18.16b, v19.16b \n" -- "trn2 v3.16b, v18.16b, v19.16b \n" -- "trn1 v4.16b, v20.16b, v21.16b \n" -- "trn2 v5.16b, v20.16b, v21.16b \n" -- "trn1 v6.16b, v22.16b, v23.16b \n" -- "trn2 v7.16b, v22.16b, v23.16b \n" -- "trn1 v8.16b, v24.16b, v25.16b \n" -- "trn2 v9.16b, v24.16b, v25.16b \n" -- "trn1 v10.16b, v26.16b, v27.16b \n" -- "trn2 v11.16b, v26.16b, v27.16b \n" -- "trn1 v12.16b, v28.16b, v29.16b \n" -- "trn2 v13.16b, v28.16b, v29.16b \n" -- "trn1 v14.16b, v30.16b, v31.16b \n" -- "trn2 v15.16b, v30.16b, v31.16b \n" -+ "add %1, %1, #8 \n" // src += 8 -+ "add %2, %2, %6, lsl #3 \n" // dst += 8 * dst_stride -+ "subs %w3, %w3, #8 \n" // w -= 8 -+ "b.ge 1b \n" -+ -+ // add 8 back to counter. if the result is 0 there are -+ // no residuals. -+ "adds %w3, %w3, #8 \n" -+ "b.eq 4f \n" -+ -+ // some residual, so between 1 and 7 lines left to transpose -+ "cmp %w3, #2 \n" -+ "b.lt 3f \n" - -- // Transpose 2x2-byte blocks within each 4x4 block. -- "trn1 v16.8h, v0.8h, v2.8h \n" -- "trn1 v17.8h, v1.8h, v3.8h \n" -- "trn2 v18.8h, v0.8h, v2.8h \n" -- "trn2 v19.8h, v1.8h, v3.8h \n" -- "trn1 v20.8h, v4.8h, v6.8h \n" -- "trn1 v21.8h, v5.8h, v7.8h \n" -- "trn2 v22.8h, v4.8h, v6.8h \n" -- "trn2 v23.8h, v5.8h, v7.8h \n" -- "trn1 v24.8h, v8.8h, v10.8h \n" -- "trn1 v25.8h, v9.8h, v11.8h \n" -- "trn2 v26.8h, v8.8h, v10.8h \n" -- "trn2 v27.8h, v9.8h, v11.8h \n" -- "trn1 v28.8h, v12.8h, v14.8h \n" -- "trn1 v29.8h, v13.8h, v15.8h \n" -- "trn2 v30.8h, v12.8h, v14.8h \n" -- "trn2 v31.8h, v13.8h, v15.8h \n" -+ "cmp %w3, #4 \n" -+ "b.lt 2f \n" -+ -+ // 4x8 block -+ "mov %0, %1 \n" -+ "ld1 {v0.s}[0], [%0], %5 \n" -+ "ld1 {v0.s}[1], [%0], %5 \n" -+ "ld1 {v0.s}[2], [%0], %5 \n" -+ "ld1 {v0.s}[3], [%0], %5 \n" -+ "ld1 {v1.s}[0], [%0], %5 \n" -+ "ld1 {v1.s}[1], [%0], %5 \n" -+ "ld1 {v1.s}[2], [%0], %5 \n" -+ "ld1 {v1.s}[3], [%0] \n" -+ -+ "mov %0, %2 \n" -+ -+ "ld1 {v2.16b}, [%4] \n" -+ -+ "tbl v3.16b, {v0.16b}, v2.16b \n" -+ "tbl v0.16b, {v1.16b}, v2.16b \n" - -- "subs %w[width], %w[width], #16 \n" -+ // TODO(frkoenig): Rework shuffle above to -+ // write out with 4 instead of 8 writes. -+ "st1 {v3.s}[0], [%0], %6 \n" -+ "st1 {v3.s}[1], [%0], %6 \n" -+ "st1 {v3.s}[2], [%0], %6 \n" -+ "st1 {v3.s}[3], [%0] \n" -+ -+ "add %0, %2, #4 \n" -+ "st1 {v0.s}[0], [%0], %6 \n" -+ "st1 {v0.s}[1], [%0], %6 \n" -+ "st1 {v0.s}[2], [%0], %6 \n" -+ "st1 {v0.s}[3], [%0] \n" -+ -+ "add %1, %1, #4 \n" // src += 4 -+ "add %2, %2, %6, lsl #2 \n" // dst += 4 * dst_stride -+ "subs %w3, %w3, #4 \n" // w -= 4 -+ "b.eq 4f \n" -+ -+ // some residual, check to see if it includes a 2x8 block, -+ // or less -+ "cmp %w3, #2 \n" -+ "b.lt 3f \n" - -- // Transpose 4x4-byte blocks within each 8x8 block. -- "trn1 v0.4s, v16.4s, v20.4s \n" -- "trn1 v2.4s, v17.4s, v21.4s \n" -- "trn1 v4.4s, v18.4s, v22.4s \n" -- "trn1 v6.4s, v19.4s, v23.4s \n" -- "trn2 v8.4s, v16.4s, v20.4s \n" -- "trn2 v10.4s, v17.4s, v21.4s \n" -- "trn2 v12.4s, v18.4s, v22.4s \n" -- "trn2 v14.4s, v19.4s, v23.4s \n" -- "trn1 v1.4s, v24.4s, v28.4s \n" -- "trn1 v3.4s, v25.4s, v29.4s \n" -- "trn1 v5.4s, v26.4s, v30.4s \n" -- "trn1 v7.4s, v27.4s, v31.4s \n" -- "trn2 v9.4s, v24.4s, v28.4s \n" -- "trn2 v11.4s, v25.4s, v29.4s \n" -- "trn2 v13.4s, v26.4s, v30.4s \n" -- "trn2 v15.4s, v27.4s, v31.4s \n" -+ // 2x8 block -+ "2: \n" -+ "mov %0, %1 \n" -+ "ld1 {v0.h}[0], [%0], %5 \n" -+ "ld1 {v1.h}[0], [%0], %5 \n" -+ "ld1 {v0.h}[1], [%0], %5 \n" -+ "ld1 {v1.h}[1], [%0], %5 \n" -+ "ld1 {v0.h}[2], [%0], %5 \n" -+ "ld1 {v1.h}[2], [%0], %5 \n" -+ "ld1 {v0.h}[3], [%0], %5 \n" -+ "ld1 {v1.h}[3], [%0] \n" -+ -+ "trn2 v2.8b, v0.8b, v1.8b \n" -+ "trn1 v3.8b, v0.8b, v1.8b \n" -+ -+ "mov %0, %2 \n" -+ -+ "st1 {v3.8b}, [%0], %6 \n" -+ "st1 {v2.8b}, [%0] \n" -+ -+ "add %1, %1, #2 \n" // src += 2 -+ "add %2, %2, %6, lsl #1 \n" // dst += 2 * dst_stride -+ "subs %w3, %w3, #2 \n" // w -= 2 -+ "b.eq 4f \n" - -- // Transpose 8x8-byte blocks and store. -- "st2 {v0.d, v1.d}[0], [%[dst]], %[dst_stride] \n" -- "st2 {v2.d, v3.d}[0], [%[dst]], %[dst_stride] \n" -- "st2 {v4.d, v5.d}[0], [%[dst]], %[dst_stride] \n" -- "st2 {v6.d, v7.d}[0], [%[dst]], %[dst_stride] \n" -- "st2 {v8.d, v9.d}[0], [%[dst]], %[dst_stride] \n" -- "st2 {v10.d, v11.d}[0], [%[dst]], %[dst_stride] \n" -- "st2 {v12.d, v13.d}[0], [%[dst]], %[dst_stride] \n" -- "st2 {v14.d, v15.d}[0], [%[dst]], %[dst_stride] \n" -- "st2 {v0.d, v1.d}[1], [%[dst]], %[dst_stride] \n" -- "st2 {v2.d, v3.d}[1], [%[dst]], %[dst_stride] \n" -- "st2 {v4.d, v5.d}[1], [%[dst]], %[dst_stride] \n" -- "st2 {v6.d, v7.d}[1], [%[dst]], %[dst_stride] \n" -- "st2 {v8.d, v9.d}[1], [%[dst]], %[dst_stride] \n" -- "st2 {v10.d, v11.d}[1], [%[dst]], %[dst_stride] \n" -- "st2 {v12.d, v13.d}[1], [%[dst]], %[dst_stride] \n" -- "st2 {v14.d, v15.d}[1], [%[dst]], %[dst_stride] \n" -+ // 1x8 block -+ "3: \n" -+ "ld1 {v0.b}[0], [%1], %5 \n" -+ "ld1 {v0.b}[1], [%1], %5 \n" -+ "ld1 {v0.b}[2], [%1], %5 \n" -+ "ld1 {v0.b}[3], [%1], %5 \n" -+ "ld1 {v0.b}[4], [%1], %5 \n" -+ "ld1 {v0.b}[5], [%1], %5 \n" -+ "ld1 {v0.b}[6], [%1], %5 \n" -+ "ld1 {v0.b}[7], [%1] \n" -+ -+ "st1 {v0.8b}, [%2] \n" -+ -+ "4: \n" - -- "b.gt 1b \n" -- : [src] "+r"(src), // %[src] -- [src_temp] "=&r"(src_temp), // %[src_temp] -- [dst] "+r"(dst), // %[dst] -- [width] "+r"(width) // %[width] -- : [src_stride] "r"((ptrdiff_t)src_stride), // %[src_stride] -- [dst_stride] "r"((ptrdiff_t)dst_stride) // %[dst_stride] -- : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", -- "v9", "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", "v18", -- "v19", "v20", "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", -- "v29", "v30", "v31"); -+ : "=&r"(src_temp), // %0 -+ "+r"(src), // %1 -+ "+r"(dst), // %2 -+ "+r"(width) // %3 -+ : "r"(&kVTbl4x4Transpose), // %4 -+ "r"((ptrdiff_t)src_stride), // %5 -+ "r"((ptrdiff_t)dst_stride) // %6 -+ : "memory", "cc", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", -+ "v17", "v18", "v19", "v20", "v21", "v22", "v23"); - } - -+static const uint8_t kVTbl4x4TransposeDi[32] = { -+ 0, 16, 32, 48, 2, 18, 34, 50, 4, 20, 36, 52, 6, 22, 38, 54, -+ 1, 17, 33, 49, 3, 19, 35, 51, 5, 21, 37, 53, 7, 23, 39, 55}; -+ - void TransposeUVWx8_NEON(const uint8_t* src, - int src_stride, - uint8_t* dst_a, -@@ -144,85 +223,215 @@ void TransposeUVWx8_NEON(const uint8_t* - uint8_t* dst_b, - int dst_stride_b, - int width) { -- const uint8_t* temp; -- asm volatile ( -+ const uint8_t* src_temp; -+ asm volatile( - // loops are on blocks of 8. loop will stop when - // counter gets to or below 0. starting the counter - // at w-8 allow for this -- "sub %w[width], %w[width], #8 \n" -+ "sub %w4, %w4, #8 \n" -+ -+ // handle 8x8 blocks. this should be the majority of the plane -+ "1: \n" -+ "mov %0, %1 \n" -+ -+ "ld1 {v0.16b}, [%0], %5 \n" -+ "ld1 {v1.16b}, [%0], %5 \n" -+ "ld1 {v2.16b}, [%0], %5 \n" -+ "ld1 {v3.16b}, [%0], %5 \n" -+ "ld1 {v4.16b}, [%0], %5 \n" -+ "ld1 {v5.16b}, [%0], %5 \n" -+ "ld1 {v6.16b}, [%0], %5 \n" -+ "ld1 {v7.16b}, [%0] \n" -+ "mov %0, %1 \n" - -- "1: \n" -- "mov %[temp], %[src] \n" -- "ld1 {v0.16b}, [%[temp]], %[src_stride] \n" -- "ld1 {v1.16b}, [%[temp]], %[src_stride] \n" -- "ld1 {v2.16b}, [%[temp]], %[src_stride] \n" -- "ld1 {v3.16b}, [%[temp]], %[src_stride] \n" -- "ld1 {v4.16b}, [%[temp]], %[src_stride] \n" -- "ld1 {v5.16b}, [%[temp]], %[src_stride] \n" -- "ld1 {v6.16b}, [%[temp]], %[src_stride] \n" -- "ld1 {v7.16b}, [%[temp]] \n" -- "add %[src], %[src], #16 \n" -+ "trn1 v16.16b, v0.16b, v1.16b \n" -+ "trn2 v17.16b, v0.16b, v1.16b \n" -+ "trn1 v18.16b, v2.16b, v3.16b \n" -+ "trn2 v19.16b, v2.16b, v3.16b \n" -+ "trn1 v20.16b, v4.16b, v5.16b \n" -+ "trn2 v21.16b, v4.16b, v5.16b \n" -+ "trn1 v22.16b, v6.16b, v7.16b \n" -+ "trn2 v23.16b, v6.16b, v7.16b \n" -+ -+ "trn1 v0.8h, v16.8h, v18.8h \n" -+ "trn2 v1.8h, v16.8h, v18.8h \n" -+ "trn1 v2.8h, v20.8h, v22.8h \n" -+ "trn2 v3.8h, v20.8h, v22.8h \n" -+ "trn1 v4.8h, v17.8h, v19.8h \n" -+ "trn2 v5.8h, v17.8h, v19.8h \n" -+ "trn1 v6.8h, v21.8h, v23.8h \n" -+ "trn2 v7.8h, v21.8h, v23.8h \n" -+ -+ "trn1 v16.4s, v0.4s, v2.4s \n" -+ "trn2 v17.4s, v0.4s, v2.4s \n" -+ "trn1 v18.4s, v1.4s, v3.4s \n" -+ "trn2 v19.4s, v1.4s, v3.4s \n" -+ "trn1 v20.4s, v4.4s, v6.4s \n" -+ "trn2 v21.4s, v4.4s, v6.4s \n" -+ "trn1 v22.4s, v5.4s, v7.4s \n" -+ "trn2 v23.4s, v5.4s, v7.4s \n" -+ -+ "mov %0, %2 \n" - -- "trn1 v16.16b, v0.16b, v1.16b \n" -- "trn2 v17.16b, v0.16b, v1.16b \n" -- "trn1 v18.16b, v2.16b, v3.16b \n" -- "trn2 v19.16b, v2.16b, v3.16b \n" -- "trn1 v20.16b, v4.16b, v5.16b \n" -- "trn2 v21.16b, v4.16b, v5.16b \n" -- "trn1 v22.16b, v6.16b, v7.16b \n" -- "trn2 v23.16b, v6.16b, v7.16b \n" -+ "st1 {v16.d}[0], [%0], %6 \n" -+ "st1 {v18.d}[0], [%0], %6 \n" -+ "st1 {v17.d}[0], [%0], %6 \n" -+ "st1 {v19.d}[0], [%0], %6 \n" -+ "st1 {v16.d}[1], [%0], %6 \n" -+ "st1 {v18.d}[1], [%0], %6 \n" -+ "st1 {v17.d}[1], [%0], %6 \n" -+ "st1 {v19.d}[1], [%0] \n" -+ -+ "mov %0, %3 \n" -+ -+ "st1 {v20.d}[0], [%0], %7 \n" -+ "st1 {v22.d}[0], [%0], %7 \n" -+ "st1 {v21.d}[0], [%0], %7 \n" -+ "st1 {v23.d}[0], [%0], %7 \n" -+ "st1 {v20.d}[1], [%0], %7 \n" -+ "st1 {v22.d}[1], [%0], %7 \n" -+ "st1 {v21.d}[1], [%0], %7 \n" -+ "st1 {v23.d}[1], [%0] \n" - -- "subs %w[width], %w[width], #8 \n" -+ "add %1, %1, #16 \n" // src += 8*2 -+ "add %2, %2, %6, lsl #3 \n" // dst_a += 8 * -+ // dst_stride_a -+ "add %3, %3, %7, lsl #3 \n" // dst_b += 8 * -+ // dst_stride_b -+ "subs %w4, %w4, #8 \n" // w -= 8 -+ "b.ge 1b \n" -+ -+ // add 8 back to counter. if the result is 0 there are -+ // no residuals. -+ "adds %w4, %w4, #8 \n" -+ "b.eq 4f \n" -+ -+ // some residual, so between 1 and 7 lines left to transpose -+ "cmp %w4, #2 \n" -+ "b.lt 3f \n" - -- "trn1 v0.8h, v16.8h, v18.8h \n" -- "trn2 v1.8h, v16.8h, v18.8h \n" -- "trn1 v2.8h, v20.8h, v22.8h \n" -- "trn2 v3.8h, v20.8h, v22.8h \n" -- "trn1 v4.8h, v17.8h, v19.8h \n" -- "trn2 v5.8h, v17.8h, v19.8h \n" -- "trn1 v6.8h, v21.8h, v23.8h \n" -- "trn2 v7.8h, v21.8h, v23.8h \n" -+ "cmp %w4, #4 \n" -+ "b.lt 2f \n" -+ -+ // TODO(frkoenig): Clean this up -+ // 4x8 block -+ "mov %0, %1 \n" -+ "ld1 {v0.8b}, [%0], %5 \n" -+ "ld1 {v1.8b}, [%0], %5 \n" -+ "ld1 {v2.8b}, [%0], %5 \n" -+ "ld1 {v3.8b}, [%0], %5 \n" -+ "ld1 {v4.8b}, [%0], %5 \n" -+ "ld1 {v5.8b}, [%0], %5 \n" -+ "ld1 {v6.8b}, [%0], %5 \n" -+ "ld1 {v7.8b}, [%0] \n" -+ -+ "ld1 {v30.16b}, [%8], #16 \n" -+ "ld1 {v31.16b}, [%8] \n" - -- "trn1 v16.4s, v0.4s, v2.4s \n" -- "trn2 v17.4s, v0.4s, v2.4s \n" -- "trn1 v18.4s, v1.4s, v3.4s \n" -- "trn2 v19.4s, v1.4s, v3.4s \n" -- "trn1 v20.4s, v4.4s, v6.4s \n" -- "trn2 v21.4s, v4.4s, v6.4s \n" -- "trn1 v22.4s, v5.4s, v7.4s \n" -- "trn2 v23.4s, v5.4s, v7.4s \n" -+ "tbl v16.16b, {v0.16b, v1.16b, v2.16b, v3.16b}, v30.16b \n" -+ "tbl v17.16b, {v0.16b, v1.16b, v2.16b, v3.16b}, v31.16b \n" -+ "tbl v18.16b, {v4.16b, v5.16b, v6.16b, v7.16b}, v30.16b \n" -+ "tbl v19.16b, {v4.16b, v5.16b, v6.16b, v7.16b}, v31.16b \n" -+ -+ "mov %0, %2 \n" -+ -+ "st1 {v16.s}[0], [%0], %6 \n" -+ "st1 {v16.s}[1], [%0], %6 \n" -+ "st1 {v16.s}[2], [%0], %6 \n" -+ "st1 {v16.s}[3], [%0], %6 \n" -+ -+ "add %0, %2, #4 \n" -+ "st1 {v18.s}[0], [%0], %6 \n" -+ "st1 {v18.s}[1], [%0], %6 \n" -+ "st1 {v18.s}[2], [%0], %6 \n" -+ "st1 {v18.s}[3], [%0] \n" -+ -+ "mov %0, %3 \n" - -- "mov %[temp], %[dst_a] \n" -- "st1 {v16.d}[0], [%[temp]], %[dst_stride_a] \n" -- "st1 {v18.d}[0], [%[temp]], %[dst_stride_a] \n" -- "st1 {v17.d}[0], [%[temp]], %[dst_stride_a] \n" -- "st1 {v19.d}[0], [%[temp]], %[dst_stride_a] \n" -- "st1 {v16.d}[1], [%[temp]], %[dst_stride_a] \n" -- "st1 {v18.d}[1], [%[temp]], %[dst_stride_a] \n" -- "st1 {v17.d}[1], [%[temp]], %[dst_stride_a] \n" -- "st1 {v19.d}[1], [%[temp]] \n" -- "add %[dst_a], %[dst_a], %[dst_stride_a], lsl #3 \n" -+ "st1 {v17.s}[0], [%0], %7 \n" -+ "st1 {v17.s}[1], [%0], %7 \n" -+ "st1 {v17.s}[2], [%0], %7 \n" -+ "st1 {v17.s}[3], [%0], %7 \n" -+ -+ "add %0, %3, #4 \n" -+ "st1 {v19.s}[0], [%0], %7 \n" -+ "st1 {v19.s}[1], [%0], %7 \n" -+ "st1 {v19.s}[2], [%0], %7 \n" -+ "st1 {v19.s}[3], [%0] \n" -+ -+ "add %1, %1, #8 \n" // src += 4 * 2 -+ "add %2, %2, %6, lsl #2 \n" // dst_a += 4 * -+ // dst_stride_a -+ "add %3, %3, %7, lsl #2 \n" // dst_b += 4 * -+ // dst_stride_b -+ "subs %w4, %w4, #4 \n" // w -= 4 -+ "b.eq 4f \n" -+ -+ // some residual, check to see if it includes a 2x8 block, -+ // or less -+ "cmp %w4, #2 \n" -+ "b.lt 3f \n" - -- "mov %[temp], %[dst_b] \n" -- "st1 {v20.d}[0], [%[temp]], %[dst_stride_b] \n" -- "st1 {v22.d}[0], [%[temp]], %[dst_stride_b] \n" -- "st1 {v21.d}[0], [%[temp]], %[dst_stride_b] \n" -- "st1 {v23.d}[0], [%[temp]], %[dst_stride_b] \n" -- "st1 {v20.d}[1], [%[temp]], %[dst_stride_b] \n" -- "st1 {v22.d}[1], [%[temp]], %[dst_stride_b] \n" -- "st1 {v21.d}[1], [%[temp]], %[dst_stride_b] \n" -- "st1 {v23.d}[1], [%[temp]] \n" -- "add %[dst_b], %[dst_b], %[dst_stride_b], lsl #3 \n" -+ // 2x8 block -+ "2: \n" -+ "mov %0, %1 \n" -+ "ld2 {v0.h, v1.h}[0], [%0], %5 \n" -+ "ld2 {v2.h, v3.h}[0], [%0], %5 \n" -+ "ld2 {v0.h, v1.h}[1], [%0], %5 \n" -+ "ld2 {v2.h, v3.h}[1], [%0], %5 \n" -+ "ld2 {v0.h, v1.h}[2], [%0], %5 \n" -+ "ld2 {v2.h, v3.h}[2], [%0], %5 \n" -+ "ld2 {v0.h, v1.h}[3], [%0], %5 \n" -+ "ld2 {v2.h, v3.h}[3], [%0] \n" -+ -+ "trn1 v4.8b, v0.8b, v2.8b \n" -+ "trn2 v5.8b, v0.8b, v2.8b \n" -+ "trn1 v6.8b, v1.8b, v3.8b \n" -+ "trn2 v7.8b, v1.8b, v3.8b \n" -+ -+ "mov %0, %2 \n" -+ -+ "st1 {v4.d}[0], [%0], %6 \n" -+ "st1 {v6.d}[0], [%0] \n" -+ -+ "mov %0, %3 \n" -+ -+ "st1 {v5.d}[0], [%0], %7 \n" -+ "st1 {v7.d}[0], [%0] \n" - -- "b.ge 1b \n" -- : [temp] "=&r"(temp), // %[temp] -- [src] "+r"(src), // %[src] -- [dst_a] "+r"(dst_a), // %[dst_a] -- [dst_b] "+r"(dst_b), // %[dst_b] -- [width] "+r"(width) // %[width] -- : [src_stride] "r"((ptrdiff_t)src_stride), // %[src_stride] -- [dst_stride_a] "r"((ptrdiff_t)dst_stride_a), // %[dst_stride_a] -- [dst_stride_b] "r"((ptrdiff_t)dst_stride_b) // %[dst_stride_b] -+ "add %1, %1, #4 \n" // src += 2 * 2 -+ "add %2, %2, %6, lsl #1 \n" // dst_a += 2 * -+ // dst_stride_a -+ "add %3, %3, %7, lsl #1 \n" // dst_b += 2 * -+ // dst_stride_b -+ "subs %w4, %w4, #2 \n" // w -= 2 -+ "b.eq 4f \n" -+ -+ // 1x8 block -+ "3: \n" -+ "ld2 {v0.b, v1.b}[0], [%1], %5 \n" -+ "ld2 {v0.b, v1.b}[1], [%1], %5 \n" -+ "ld2 {v0.b, v1.b}[2], [%1], %5 \n" -+ "ld2 {v0.b, v1.b}[3], [%1], %5 \n" -+ "ld2 {v0.b, v1.b}[4], [%1], %5 \n" -+ "ld2 {v0.b, v1.b}[5], [%1], %5 \n" -+ "ld2 {v0.b, v1.b}[6], [%1], %5 \n" -+ "ld2 {v0.b, v1.b}[7], [%1] \n" -+ -+ "st1 {v0.d}[0], [%2] \n" -+ "st1 {v1.d}[0], [%3] \n" -+ -+ "4: \n" -+ -+ : "=&r"(src_temp), // %0 -+ "+r"(src), // %1 -+ "+r"(dst_a), // %2 -+ "+r"(dst_b), // %3 -+ "+r"(width) // %4 -+ : "r"((ptrdiff_t)src_stride), // %5 -+ "r"((ptrdiff_t)dst_stride_a), // %6 -+ "r"((ptrdiff_t)dst_stride_b), // %7 -+ "r"(&kVTbl4x4TransposeDi) // %8 - : "memory", "cc", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", - "v17", "v18", "v19", "v20", "v21", "v22", "v23", "v30", "v31"); - } -@@ -239,7 +448,7 @@ void Transpose4x4_32_NEON(const uint8_t* - uint8_t* dst1 = dst + dst_stride; - uint8_t* dst2 = dst1 + dst_stride; - uint8_t* dst3 = dst2 + dst_stride; -- asm volatile ( -+ asm volatile( - // Main loop transpose 4x4. Read a column, write a row. - "1: \n" - "ld4 {v0.s, v1.s, v2.s, v3.s}[0], [%0], %9 \n" -diff --git a/media/libyuv/libyuv/source/row_any.cc b/media/libyuv/libyuv/source/row_any.cc ---- a/media/libyuv/libyuv/source/row_any.cc -+++ b/media/libyuv/libyuv/source/row_any.cc -@@ -19,7 +19,7 @@ namespace libyuv { - extern "C" { - #endif - --// memset for vin is meant to clear the source buffer so that -+// memset for temp is meant to clear the source buffer (not dest) so that - // SIMD that reads full multiple of 16 bytes will not trigger msan errors. - // memset is not needed for production, as the garbage values are processed but - // not used, although there may be edge cases for subsampling. -@@ -35,20 +35,20 @@ extern "C" { - void NAMEANY(const uint8_t* y_buf, const uint8_t* u_buf, \ - const uint8_t* v_buf, const uint8_t* a_buf, uint8_t* dst_ptr, \ - int width) { \ -- SIMD_ALIGNED(uint8_t vin[64 * 4]); \ -- SIMD_ALIGNED(uint8_t vout[64]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -+ SIMD_ALIGNED(uint8_t temp[64 * 5]); \ -+ memset(temp, 0, 64 * 4); /* for msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(y_buf, u_buf, v_buf, a_buf, dst_ptr, n); \ - } \ -- memcpy(vin, y_buf + n, r); \ -- memcpy(vin + 64, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ -- memcpy(vin + 128, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ -- memcpy(vin + 192, a_buf + n, r); \ -- ANY_SIMD(vin, vin + 64, vin + 128, vin + 192, vout, MASK + 1); \ -- memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, vout, SS(r, DUVSHIFT) * BPP); \ -+ memcpy(temp, y_buf + n, r); \ -+ memcpy(temp + 64, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ -+ memcpy(temp + 128, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ -+ memcpy(temp + 192, a_buf + n, r); \ -+ ANY_SIMD(temp, temp + 64, temp + 128, temp + 192, temp + 256, MASK + 1); \ -+ memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, temp + 256, \ -+ SS(r, DUVSHIFT) * BPP); \ - } - - #ifdef HAS_MERGEARGBROW_SSE2 -@@ -68,25 +68,25 @@ ANY41(MergeARGBRow_Any_NEON, MergeARGBRo - void NAMEANY(const uint8_t* y_buf, const uint8_t* u_buf, \ - const uint8_t* v_buf, const uint8_t* a_buf, uint8_t* dst_ptr, \ - const struct YuvConstants* yuvconstants, int width) { \ -- SIMD_ALIGNED(uint8_t vin[64 * 4]); \ -- SIMD_ALIGNED(uint8_t vout[64]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -+ SIMD_ALIGNED(uint8_t temp[64 * 5]); \ -+ memset(temp, 0, 64 * 4); /* for msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(y_buf, u_buf, v_buf, a_buf, dst_ptr, yuvconstants, n); \ - } \ -- memcpy(vin, y_buf + n, r); \ -- memcpy(vin + 64, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ -- memcpy(vin + 128, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ -- memcpy(vin + 192, a_buf + n, r); \ -+ memcpy(temp, y_buf + n, r); \ -+ memcpy(temp + 64, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ -+ memcpy(temp + 128, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ -+ memcpy(temp + 192, a_buf + n, r); \ - if (width & 1) { \ -- vin[64 + SS(r, UVSHIFT)] = vin[64 + SS(r, UVSHIFT) - 1]; \ -- vin[128 + SS(r, UVSHIFT)] = vin[128 + SS(r, UVSHIFT) - 1]; \ -+ temp[64 + SS(r, UVSHIFT)] = temp[64 + SS(r, UVSHIFT) - 1]; \ -+ temp[128 + SS(r, UVSHIFT)] = temp[128 + SS(r, UVSHIFT) - 1]; \ - } \ -- ANY_SIMD(vin, vin + 64, vin + 128, vin + 192, vout, yuvconstants, \ -- MASK + 1); \ -- memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, vout, SS(r, DUVSHIFT) * BPP); \ -+ ANY_SIMD(temp, temp + 64, temp + 128, temp + 192, temp + 256, \ -+ yuvconstants, MASK + 1); \ -+ memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, temp + 256, \ -+ SS(r, DUVSHIFT) * BPP); \ - } - - #ifdef HAS_I444ALPHATOARGBROW_SSSE3 -@@ -113,9 +113,6 @@ ANY41C(I444AlphaToARGBRow_Any_MSA, I444A - #ifdef HAS_I422ALPHATOARGBROW_MSA - ANY41C(I422AlphaToARGBRow_Any_MSA, I422AlphaToARGBRow_MSA, 1, 0, 4, 7) - #endif --#ifdef HAS_I422ALPHATOARGBROW_LSX --ANY41C(I422AlphaToARGBRow_Any_LSX, I422AlphaToARGBRow_LSX, 1, 0, 4, 15) --#endif - #ifdef HAS_I422ALPHATOARGBROW_LASX - ANY41C(I422AlphaToARGBRow_Any_LASX, I422AlphaToARGBRow_LASX, 1, 0, 4, 15) - #endif -@@ -126,43 +123,23 @@ ANY41C(I422AlphaToARGBRow_Any_LASX, I422 - void NAMEANY(const T* y_buf, const T* u_buf, const T* v_buf, const T* a_buf, \ - uint8_t* dst_ptr, const struct YuvConstants* yuvconstants, \ - int width) { \ -- SIMD_ALIGNED(T vin[16 * 4]); \ -- SIMD_ALIGNED(uint8_t vout[64]); \ -- memset(vin, 0, sizeof(vin)); /* for YUY2 and msan */ \ -+ SIMD_ALIGNED(T temp[16 * 4]); \ -+ SIMD_ALIGNED(uint8_t out[64]); \ -+ memset(temp, 0, 16 * 4 * SBPP); /* for YUY2 and msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(y_buf, u_buf, v_buf, a_buf, dst_ptr, yuvconstants, n); \ - } \ -- memcpy(vin, y_buf + n, r * SBPP); \ -- memcpy(vin + 16, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT) * SBPP); \ -- memcpy(vin + 32, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT) * SBPP); \ -- memcpy(vin + 48, a_buf + n, r * SBPP); \ -- ANY_SIMD(vin, vin + 16, vin + 32, vin + 48, vout, yuvconstants, MASK + 1); \ -- memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, vout, SS(r, DUVSHIFT) * BPP); \ -+ memcpy(temp, y_buf + n, r * SBPP); \ -+ memcpy(temp + 16, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT) * SBPP); \ -+ memcpy(temp + 32, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT) * SBPP); \ -+ memcpy(temp + 48, a_buf + n, r * SBPP); \ -+ ANY_SIMD(temp, temp + 16, temp + 32, temp + 48, out, yuvconstants, \ -+ MASK + 1); \ -+ memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, out, SS(r, DUVSHIFT) * BPP); \ - } - --#ifdef HAS_I210ALPHATOARGBROW_NEON --ANY41CT(I210AlphaToARGBRow_Any_NEON, -- I210AlphaToARGBRow_NEON, -- 1, -- 0, -- uint16_t, -- 2, -- 4, -- 7) --#endif --#ifdef HAS_I410ALPHATOARGBROW_NEON --ANY41CT(I410AlphaToARGBRow_Any_NEON, -- I410AlphaToARGBRow_NEON, -- 0, -- 0, -- uint16_t, -- 2, -- 4, -- 7) --#endif -- - #ifdef HAS_I210ALPHATOARGBROW_SSSE3 - ANY41CT(I210AlphaToARGBRow_Any_SSSE3, - I210AlphaToARGBRow_SSSE3, -@@ -213,20 +190,20 @@ ANY41CT(I410AlphaToARGBRow_Any_AVX2, - #define ANY41PT(NAMEANY, ANY_SIMD, STYPE, SBPP, DTYPE, BPP, MASK) \ - void NAMEANY(const STYPE* r_buf, const STYPE* g_buf, const STYPE* b_buf, \ - const STYPE* a_buf, DTYPE* dst_ptr, int depth, int width) { \ -- SIMD_ALIGNED(STYPE vin[16 * 4]); \ -- SIMD_ALIGNED(DTYPE vout[64]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -+ SIMD_ALIGNED(STYPE temp[16 * 4]); \ -+ SIMD_ALIGNED(DTYPE out[64]); \ -+ memset(temp, 0, 16 * 4 * SBPP); /* for YUY2 and msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(r_buf, g_buf, b_buf, a_buf, dst_ptr, depth, n); \ - } \ -- memcpy(vin, r_buf + n, r * SBPP); \ -- memcpy(vin + 16, g_buf + n, r * SBPP); \ -- memcpy(vin + 32, b_buf + n, r * SBPP); \ -- memcpy(vin + 48, a_buf + n, r * SBPP); \ -- ANY_SIMD(vin, vin + 16, vin + 32, vin + 48, vout, depth, MASK + 1); \ -- memcpy((uint8_t*)dst_ptr + n * BPP, vout, r * BPP); \ -+ memcpy(temp, r_buf + n, r * SBPP); \ -+ memcpy(temp + 16, g_buf + n, r * SBPP); \ -+ memcpy(temp + 32, b_buf + n, r * SBPP); \ -+ memcpy(temp + 48, a_buf + n, r * SBPP); \ -+ ANY_SIMD(temp, temp + 16, temp + 32, temp + 48, out, depth, MASK + 1); \ -+ memcpy((uint8_t*)dst_ptr + n * BPP, out, r * BPP); \ - } - - #ifdef HAS_MERGEAR64ROW_AVX2 -@@ -260,22 +237,22 @@ ANY41PT(MergeARGB16To8Row_Any_NEON, - #undef ANY41PT - - // Any 3 planes to 1. --#define ANY31(NAMEANY, ANY_SIMD, UVSHIFT, DUVSHIFT, BPP, MASK) \ -- void NAMEANY(const uint8_t* y_buf, const uint8_t* u_buf, \ -- const uint8_t* v_buf, uint8_t* dst_ptr, int width) { \ -- SIMD_ALIGNED(uint8_t vin[64 * 3]); \ -- SIMD_ALIGNED(uint8_t vout[64]); \ -- memset(vin, 0, sizeof(vin)); /* for YUY2 and msan */ \ -- int r = width & MASK; \ -- int n = width & ~MASK; \ -- if (n > 0) { \ -- ANY_SIMD(y_buf, u_buf, v_buf, dst_ptr, n); \ -- } \ -- memcpy(vin, y_buf + n, r); \ -- memcpy(vin + 64, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ -- memcpy(vin + 128, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ -- ANY_SIMD(vin, vin + 64, vin + 128, vout, MASK + 1); \ -- memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, vout, SS(r, DUVSHIFT) * BPP); \ -+#define ANY31(NAMEANY, ANY_SIMD, UVSHIFT, DUVSHIFT, BPP, MASK) \ -+ void NAMEANY(const uint8_t* y_buf, const uint8_t* u_buf, \ -+ const uint8_t* v_buf, uint8_t* dst_ptr, int width) { \ -+ SIMD_ALIGNED(uint8_t temp[64 * 4]); \ -+ memset(temp, 0, 64 * 3); /* for YUY2 and msan */ \ -+ int r = width & MASK; \ -+ int n = width & ~MASK; \ -+ if (n > 0) { \ -+ ANY_SIMD(y_buf, u_buf, v_buf, dst_ptr, n); \ -+ } \ -+ memcpy(temp, y_buf + n, r); \ -+ memcpy(temp + 64, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ -+ memcpy(temp + 128, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ -+ ANY_SIMD(temp, temp + 64, temp + 128, temp + 192, MASK + 1); \ -+ memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, temp + 192, \ -+ SS(r, DUVSHIFT) * BPP); \ - } - - // Merge functions. -@@ -308,9 +285,6 @@ ANY31(I422ToYUY2Row_Any_NEON, I422ToYUY2 - #ifdef HAS_I422TOYUY2ROW_MSA - ANY31(I422ToYUY2Row_Any_MSA, I422ToYUY2Row_MSA, 1, 1, 4, 31) - #endif --#ifdef HAS_I422TOYUY2ROW_LSX --ANY31(I422ToYUY2Row_Any_LSX, I422ToYUY2Row_LSX, 1, 1, 4, 15) --#endif - #ifdef HAS_I422TOYUY2ROW_LASX - ANY31(I422ToYUY2Row_Any_LASX, I422ToYUY2Row_LASX, 1, 1, 4, 31) - #endif -@@ -320,9 +294,6 @@ ANY31(I422ToUYVYRow_Any_NEON, I422ToUYVY - #ifdef HAS_I422TOUYVYROW_MSA - ANY31(I422ToUYVYRow_Any_MSA, I422ToUYVYRow_MSA, 1, 1, 4, 31) - #endif --#ifdef HAS_I422TOUYVYROW_LSX --ANY31(I422ToUYVYRow_Any_LSX, I422ToUYVYRow_LSX, 1, 1, 4, 15) --#endif - #ifdef HAS_I422TOUYVYROW_LASX - ANY31(I422ToUYVYRow_Any_LASX, I422ToUYVYRow_LASX, 1, 1, 4, 31) - #endif -@@ -337,27 +308,28 @@ ANY31(BlendPlaneRow_Any_SSSE3, BlendPlan - // Note that odd width replication includes 444 due to implementation - // on arm that subsamples 444 to 422 internally. - // Any 3 planes to 1 with yuvconstants --#define ANY31C(NAMEANY, ANY_SIMD, UVSHIFT, DUVSHIFT, BPP, MASK) \ -- void NAMEANY(const uint8_t* y_buf, const uint8_t* u_buf, \ -- const uint8_t* v_buf, uint8_t* dst_ptr, \ -- const struct YuvConstants* yuvconstants, int width) { \ -- SIMD_ALIGNED(uint8_t vin[128 * 3]); \ -- SIMD_ALIGNED(uint8_t vout[128]); \ -- memset(vin, 0, sizeof(vin)); /* for YUY2 and msan */ \ -- int r = width & MASK; \ -- int n = width & ~MASK; \ -- if (n > 0) { \ -- ANY_SIMD(y_buf, u_buf, v_buf, dst_ptr, yuvconstants, n); \ -- } \ -- memcpy(vin, y_buf + n, r); \ -- memcpy(vin + 128, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ -- memcpy(vin + 256, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ -- if (width & 1) { \ -- vin[128 + SS(r, UVSHIFT)] = vin[128 + SS(r, UVSHIFT) - 1]; \ -- vin[256 + SS(r, UVSHIFT)] = vin[256 + SS(r, UVSHIFT) - 1]; \ -- } \ -- ANY_SIMD(vin, vin + 128, vin + 256, vout, yuvconstants, MASK + 1); \ -- memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, vout, SS(r, DUVSHIFT) * BPP); \ -+#define ANY31C(NAMEANY, ANY_SIMD, UVSHIFT, DUVSHIFT, BPP, MASK) \ -+ void NAMEANY(const uint8_t* y_buf, const uint8_t* u_buf, \ -+ const uint8_t* v_buf, uint8_t* dst_ptr, \ -+ const struct YuvConstants* yuvconstants, int width) { \ -+ SIMD_ALIGNED(uint8_t temp[128 * 4]); \ -+ memset(temp, 0, 128 * 3); /* for YUY2 and msan */ \ -+ int r = width & MASK; \ -+ int n = width & ~MASK; \ -+ if (n > 0) { \ -+ ANY_SIMD(y_buf, u_buf, v_buf, dst_ptr, yuvconstants, n); \ -+ } \ -+ memcpy(temp, y_buf + n, r); \ -+ memcpy(temp + 128, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ -+ memcpy(temp + 256, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ -+ if (width & 1) { \ -+ temp[128 + SS(r, UVSHIFT)] = temp[128 + SS(r, UVSHIFT) - 1]; \ -+ temp[256 + SS(r, UVSHIFT)] = temp[256 + SS(r, UVSHIFT) - 1]; \ -+ } \ -+ ANY_SIMD(temp, temp + 128, temp + 256, temp + 384, yuvconstants, \ -+ MASK + 1); \ -+ memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, temp + 384, \ -+ SS(r, DUVSHIFT) * BPP); \ - } - - #ifdef HAS_I422TOARGBROW_SSSE3 -@@ -438,14 +410,6 @@ ANY31C(I422ToARGB4444Row_Any_MSA, I422To - ANY31C(I422ToARGB1555Row_Any_MSA, I422ToARGB1555Row_MSA, 1, 0, 2, 7) - ANY31C(I422ToRGB565Row_Any_MSA, I422ToRGB565Row_MSA, 1, 0, 2, 7) - #endif --#ifdef HAS_I422TOARGBROW_LSX --ANY31C(I422ToARGBRow_Any_LSX, I422ToARGBRow_LSX, 1, 0, 4, 15) --ANY31C(I422ToRGBARow_Any_LSX, I422ToRGBARow_LSX, 1, 0, 4, 15) --ANY31C(I422ToRGB24Row_Any_LSX, I422ToRGB24Row_LSX, 1, 0, 3, 15) --ANY31C(I422ToRGB565Row_Any_LSX, I422ToRGB565Row_LSX, 1, 0, 2, 15) --ANY31C(I422ToARGB4444Row_Any_LSX, I422ToARGB4444Row_LSX, 1, 0, 2, 15) --ANY31C(I422ToARGB1555Row_Any_LSX, I422ToARGB1555Row_LSX, 1, 0, 2, 15) --#endif - #ifdef HAS_I422TOARGBROW_LASX - ANY31C(I422ToARGBRow_Any_LASX, I422ToARGBRow_LASX, 1, 0, 4, 31) - ANY31C(I422ToRGBARow_Any_LASX, I422ToRGBARow_LASX, 1, 0, 4, 31) -@@ -465,19 +429,19 @@ ANY31C(I444ToARGBRow_Any_LSX, I444ToARGB - void NAMEANY(const T* y_buf, const T* u_buf, const T* v_buf, \ - uint8_t* dst_ptr, const struct YuvConstants* yuvconstants, \ - int width) { \ -- SIMD_ALIGNED(T vin[16 * 3]); \ -- SIMD_ALIGNED(uint8_t vout[64]); \ -- memset(vin, 0, sizeof(vin)); /* for YUY2 and msan */ \ -+ SIMD_ALIGNED(T temp[16 * 3]); \ -+ SIMD_ALIGNED(uint8_t out[64]); \ -+ memset(temp, 0, 16 * 3 * SBPP); /* for YUY2 and msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(y_buf, u_buf, v_buf, dst_ptr, yuvconstants, n); \ - } \ -- memcpy(vin, y_buf + n, r * SBPP); \ -- memcpy(vin + 16, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT) * SBPP); \ -- memcpy(vin + 32, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT) * SBPP); \ -- ANY_SIMD(vin, vin + 16, vin + 32, vout, yuvconstants, MASK + 1); \ -- memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, vout, SS(r, DUVSHIFT) * BPP); \ -+ memcpy(temp, y_buf + n, r * SBPP); \ -+ memcpy(temp + 16, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT) * SBPP); \ -+ memcpy(temp + 32, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT) * SBPP); \ -+ ANY_SIMD(temp, temp + 16, temp + 32, out, yuvconstants, MASK + 1); \ -+ memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, out, SS(r, DUVSHIFT) * BPP); \ - } - - #ifdef HAS_I210TOAR30ROW_SSSE3 -@@ -516,37 +480,25 @@ ANY31CT(I212ToARGBRow_Any_AVX2, I212ToAR - #ifdef HAS_I212TOAR30ROW_AVX2 - ANY31CT(I212ToAR30Row_Any_AVX2, I212ToAR30Row_AVX2, 1, 0, uint16_t, 2, 4, 15) - #endif --#ifdef HAS_I210TOARGBROW_NEON --ANY31CT(I210ToARGBRow_Any_NEON, I210ToARGBRow_NEON, 1, 0, uint16_t, 2, 4, 7) --#endif --#ifdef HAS_I410TOARGBROW_NEON --ANY31CT(I410ToARGBRow_Any_NEON, I410ToARGBRow_NEON, 0, 0, uint16_t, 2, 4, 7) --#endif --#ifdef HAS_I210TOAR30ROW_NEON --ANY31CT(I210ToAR30Row_Any_NEON, I210ToAR30Row_NEON, 1, 0, uint16_t, 2, 4, 7) --#endif --#ifdef HAS_I410TOAR30ROW_NEON --ANY31CT(I410ToAR30Row_Any_NEON, I410ToAR30Row_NEON, 0, 0, uint16_t, 2, 4, 7) --#endif - #undef ANY31CT - - // Any 3 planes to 1 plane with parameter - #define ANY31PT(NAMEANY, ANY_SIMD, STYPE, SBPP, DTYPE, BPP, MASK) \ - void NAMEANY(const STYPE* r_buf, const STYPE* g_buf, const STYPE* b_buf, \ - DTYPE* dst_ptr, int depth, int width) { \ -- SIMD_ALIGNED(STYPE vin[16 * 3]); \ -- SIMD_ALIGNED(DTYPE vout[64]); \ -- memset(vin, 0, sizeof(vin)); /* for YUY2 and msan */ \ -+ SIMD_ALIGNED(STYPE temp[16 * 3]); \ -+ SIMD_ALIGNED(DTYPE out[64]); \ -+ memset(temp, 0, 16 * 3 * SBPP); /* for YUY2 and msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(r_buf, g_buf, b_buf, dst_ptr, depth, n); \ - } \ -- memcpy(vin, r_buf + n, r * SBPP); \ -- memcpy(vin + 16, g_buf + n, r * SBPP); \ -- memcpy(vin + 32, b_buf + n, r * SBPP); \ -- ANY_SIMD(vin, vin + 16, vin + 32, vout, depth, MASK + 1); \ -- memcpy((uint8_t*)dst_ptr + n * BPP, vout, r * BPP); \ -+ memcpy(temp, r_buf + n, r * SBPP); \ -+ memcpy(temp + 16, g_buf + n, r * SBPP); \ -+ memcpy(temp + 32, b_buf + n, r * SBPP); \ -+ ANY_SIMD(temp, temp + 16, temp + 32, out, depth, MASK + 1); \ -+ memcpy((uint8_t*)dst_ptr + n * BPP, out, r * BPP); \ - } - - #ifdef HAS_MERGEXR30ROW_AVX2 -@@ -561,7 +513,7 @@ ANY31PT(MergeXR30Row_10_Any_NEON, - 2, - uint8_t, - 4, -- 7) -+ 3) - #endif - - #ifdef HAS_MERGEXR64ROW_AVX2 -@@ -598,19 +550,18 @@ ANY31PT(MergeXRGB16To8Row_Any_NEON, - #define ANY21(NAMEANY, ANY_SIMD, UVSHIFT, SBPP, SBPP2, BPP, MASK) \ - void NAMEANY(const uint8_t* y_buf, const uint8_t* uv_buf, uint8_t* dst_ptr, \ - int width) { \ -- SIMD_ALIGNED(uint8_t vin[128 * 2]); \ -- SIMD_ALIGNED(uint8_t vout[128]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -+ SIMD_ALIGNED(uint8_t temp[128 * 3]); \ -+ memset(temp, 0, 128 * 2); /* for msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(y_buf, uv_buf, dst_ptr, n); \ - } \ -- memcpy(vin, y_buf + n * SBPP, r * SBPP); \ -- memcpy(vin + 128, uv_buf + (n >> UVSHIFT) * SBPP2, \ -+ memcpy(temp, y_buf + n * SBPP, r * SBPP); \ -+ memcpy(temp + 128, uv_buf + (n >> UVSHIFT) * SBPP2, \ - SS(r, UVSHIFT) * SBPP2); \ -- ANY_SIMD(vin, vin + 128, vout, MASK + 1); \ -- memcpy(dst_ptr + n * BPP, vout, r * BPP); \ -+ ANY_SIMD(temp, temp + 128, temp + 256, MASK + 1); \ -+ memcpy(dst_ptr + n * BPP, temp + 256, r * BPP); \ - } - - // Merge functions. -@@ -618,7 +569,7 @@ ANY31PT(MergeXRGB16To8Row_Any_NEON, - ANY21(MergeUVRow_Any_SSE2, MergeUVRow_SSE2, 0, 1, 1, 2, 15) - #endif - #ifdef HAS_MERGEUVROW_AVX2 --ANY21(MergeUVRow_Any_AVX2, MergeUVRow_AVX2, 0, 1, 1, 2, 15) -+ANY21(MergeUVRow_Any_AVX2, MergeUVRow_AVX2, 0, 1, 1, 2, 31) - #endif - #ifdef HAS_MERGEUVROW_AVX512BW - ANY21(MergeUVRow_Any_AVX512BW, MergeUVRow_AVX512BW, 0, 1, 1, 2, 31) -@@ -672,27 +623,18 @@ ANY21(ARGBSubtractRow_Any_NEON, ARGBSubt - #ifdef HAS_ARGBMULTIPLYROW_MSA - ANY21(ARGBMultiplyRow_Any_MSA, ARGBMultiplyRow_MSA, 0, 4, 4, 4, 3) - #endif --#ifdef HAS_ARGBMULTIPLYROW_LSX --ANY21(ARGBMultiplyRow_Any_LSX, ARGBMultiplyRow_LSX, 0, 4, 4, 4, 3) --#endif - #ifdef HAS_ARGBMULTIPLYROW_LASX - ANY21(ARGBMultiplyRow_Any_LASX, ARGBMultiplyRow_LASX, 0, 4, 4, 4, 7) - #endif - #ifdef HAS_ARGBADDROW_MSA - ANY21(ARGBAddRow_Any_MSA, ARGBAddRow_MSA, 0, 4, 4, 4, 7) - #endif --#ifdef HAS_ARGBADDROW_LSX --ANY21(ARGBAddRow_Any_LSX, ARGBAddRow_LSX, 0, 4, 4, 4, 3) --#endif - #ifdef HAS_ARGBADDROW_LASX - ANY21(ARGBAddRow_Any_LASX, ARGBAddRow_LASX, 0, 4, 4, 4, 7) - #endif - #ifdef HAS_ARGBSUBTRACTROW_MSA - ANY21(ARGBSubtractRow_Any_MSA, ARGBSubtractRow_MSA, 0, 4, 4, 4, 7) - #endif --#ifdef HAS_ARGBSUBTRACTROW_LSX --ANY21(ARGBSubtractRow_Any_LSX, ARGBSubtractRow_LSX, 0, 4, 4, 4, 3) --#endif - #ifdef HAS_ARGBSUBTRACTROW_LASX - ANY21(ARGBSubtractRow_Any_LASX, ARGBSubtractRow_LASX, 0, 4, 4, 4, 7) - #endif -@@ -739,19 +681,18 @@ ANY21(SobelXYRow_Any_LSX, SobelXYRow_LSX - #define ANY21S(NAMEANY, ANY_SIMD, SBPP, BPP, MASK) \ - void NAMEANY(const uint8_t* src_yuy2, int stride_yuy2, uint8_t* dst_uv, \ - int width) { \ -- SIMD_ALIGNED(uint8_t vin[32 * 2]); \ -- SIMD_ALIGNED(uint8_t vout[32]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -+ SIMD_ALIGNED(uint8_t temp[32 * 3]); \ -+ memset(temp, 0, 32 * 2); /* for msan */ \ - int awidth = (width + 1) / 2; \ - int r = awidth & MASK; \ - int n = awidth & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(src_yuy2, stride_yuy2, dst_uv, n * 2); \ - } \ -- memcpy(vin, src_yuy2 + n * SBPP, r * SBPP); \ -- memcpy(vin + 32, src_yuy2 + stride_yuy2 + n * SBPP, r * SBPP); \ -- ANY_SIMD(vin, 32, vout, MASK + 1); \ -- memcpy(dst_uv + n * BPP, vout, r * BPP); \ -+ memcpy(temp, src_yuy2 + n * SBPP, r * SBPP); \ -+ memcpy(temp + 32, src_yuy2 + stride_yuy2 + n * SBPP, r * SBPP); \ -+ ANY_SIMD(temp, 32, temp + 64, MASK + 1); \ -+ memcpy(dst_uv + n * BPP, temp + 64, r * BPP); \ - } - - #ifdef HAS_YUY2TONVUVROW_NEON -@@ -768,19 +709,18 @@ ANY21S(YUY2ToNVUVRow_Any_AVX2, YUY2ToNVU - #define ANY21C(NAMEANY, ANY_SIMD, UVSHIFT, SBPP, SBPP2, BPP, MASK) \ - void NAMEANY(const uint8_t* y_buf, const uint8_t* uv_buf, uint8_t* dst_ptr, \ - const struct YuvConstants* yuvconstants, int width) { \ -- SIMD_ALIGNED(uint8_t vin[128 * 2]); \ -- SIMD_ALIGNED(uint8_t vout[128]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -+ SIMD_ALIGNED(uint8_t temp[128 * 3]); \ -+ memset(temp, 0, 128 * 2); /* for msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(y_buf, uv_buf, dst_ptr, yuvconstants, n); \ - } \ -- memcpy(vin, y_buf + n * SBPP, r * SBPP); \ -- memcpy(vin + 128, uv_buf + (n >> UVSHIFT) * SBPP2, \ -+ memcpy(temp, y_buf + n * SBPP, r * SBPP); \ -+ memcpy(temp + 128, uv_buf + (n >> UVSHIFT) * SBPP2, \ - SS(r, UVSHIFT) * SBPP2); \ -- ANY_SIMD(vin, vin + 128, vout, yuvconstants, MASK + 1); \ -- memcpy(dst_ptr + n * BPP, vout, r * BPP); \ -+ ANY_SIMD(temp, temp + 128, temp + 256, yuvconstants, MASK + 1); \ -+ memcpy(dst_ptr + n * BPP, temp + 256, r * BPP); \ - } - - // Biplanar to RGB. -@@ -859,21 +799,21 @@ ANY21C(NV12ToRGB565Row_Any_LASX, NV12ToR - #undef ANY21C - - // Any 2 planes of 16 bit to 1 with yuvconstants --#define ANY21CT(NAMEANY, ANY_SIMD, UVSHIFT, DUVSHIFT, T, SBPP, BPP, MASK) \ -- void NAMEANY(const T* y_buf, const T* uv_buf, uint8_t* dst_ptr, \ -- const struct YuvConstants* yuvconstants, int width) { \ -- SIMD_ALIGNED(T vin[16 * 2]); \ -- SIMD_ALIGNED(uint8_t vout[64]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -- int r = width & MASK; \ -- int n = width & ~MASK; \ -- if (n > 0) { \ -- ANY_SIMD(y_buf, uv_buf, dst_ptr, yuvconstants, n); \ -- } \ -- memcpy(vin, y_buf + n, r * SBPP); \ -- memcpy(vin + 16, uv_buf + 2 * (n >> UVSHIFT), SS(r, UVSHIFT) * SBPP * 2); \ -- ANY_SIMD(vin, vin + 16, vout, yuvconstants, MASK + 1); \ -- memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, vout, SS(r, DUVSHIFT) * BPP); \ -+#define ANY21CT(NAMEANY, ANY_SIMD, UVSHIFT, DUVSHIFT, T, SBPP, BPP, MASK) \ -+ void NAMEANY(const T* y_buf, const T* uv_buf, uint8_t* dst_ptr, \ -+ const struct YuvConstants* yuvconstants, int width) { \ -+ SIMD_ALIGNED(T temp[16 * 3]); \ -+ SIMD_ALIGNED(uint8_t out[64]); \ -+ memset(temp, 0, 16 * 3 * SBPP); /* for YUY2 and msan */ \ -+ int r = width & MASK; \ -+ int n = width & ~MASK; \ -+ if (n > 0) { \ -+ ANY_SIMD(y_buf, uv_buf, dst_ptr, yuvconstants, n); \ -+ } \ -+ memcpy(temp, y_buf + n, r * SBPP); \ -+ memcpy(temp + 16, uv_buf + 2 * (n >> UVSHIFT), SS(r, UVSHIFT) * SBPP * 2); \ -+ ANY_SIMD(temp, temp + 16, out, yuvconstants, MASK + 1); \ -+ memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, out, SS(r, DUVSHIFT) * BPP); \ - } - - #ifdef HAS_P210TOAR30ROW_SSSE3 -@@ -907,22 +847,21 @@ ANY21CT(P410ToAR30Row_Any_AVX2, P410ToAR - #define ANY21PT(NAMEANY, ANY_SIMD, T, BPP, MASK) \ - void NAMEANY(const T* src_u, const T* src_v, T* dst_uv, int depth, \ - int width) { \ -- SIMD_ALIGNED(T vin[16 * 2]); \ -- SIMD_ALIGNED(T vout[16]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -+ SIMD_ALIGNED(T temp[16 * 4]); \ -+ memset(temp, 0, 16 * 4 * BPP); /* for msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(src_u, src_v, dst_uv, depth, n); \ - } \ -- memcpy(vin, src_u + n, r * BPP); \ -- memcpy(vin + 16, src_v + n, r * BPP); \ -- ANY_SIMD(vin, vin + 16, vout, depth, MASK + 1); \ -- memcpy(dst_uv + n * 2, vout, r * BPP * 2); \ -+ memcpy(temp, src_u + n, r * BPP); \ -+ memcpy(temp + 16, src_v + n, r * BPP); \ -+ ANY_SIMD(temp, temp + 16, temp + 32, depth, MASK + 1); \ -+ memcpy(dst_uv + n * 2, temp + 32, r * BPP * 2); \ - } - - #ifdef HAS_MERGEUVROW_16_AVX2 --ANY21PT(MergeUVRow_16_Any_AVX2, MergeUVRow_16_AVX2, uint16_t, 2, 7) -+ANY21PT(MergeUVRow_16_Any_AVX2, MergeUVRow_16_AVX2, uint16_t, 2, 15) - #endif - #ifdef HAS_MERGEUVROW_16_NEON - ANY21PT(MergeUVRow_16_Any_NEON, MergeUVRow_16_NEON, uint16_t, 2, 7) -@@ -931,19 +870,18 @@ ANY21PT(MergeUVRow_16_Any_NEON, MergeUVR - #undef ANY21CT - - // Any 1 to 1. --#define ANY11(NAMEANY, ANY_SIMD, UVSHIFT, SBPP, BPP, MASK) \ -- void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_ptr, int width) { \ -- SIMD_ALIGNED(uint8_t vin[128]); \ -- SIMD_ALIGNED(uint8_t vout[128]); \ -- memset(vin, 0, sizeof(vin)); /* for YUY2 and msan */ \ -- int r = width & MASK; \ -- int n = width & ~MASK; \ -- if (n > 0) { \ -- ANY_SIMD(src_ptr, dst_ptr, n); \ -- } \ -- memcpy(vin, src_ptr + (n >> UVSHIFT) * SBPP, SS(r, UVSHIFT) * SBPP); \ -- ANY_SIMD(vin, vout, MASK + 1); \ -- memcpy(dst_ptr + n * BPP, vout, r * BPP); \ -+#define ANY11(NAMEANY, ANY_SIMD, UVSHIFT, SBPP, BPP, MASK) \ -+ void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_ptr, int width) { \ -+ SIMD_ALIGNED(uint8_t temp[128 * 2]); \ -+ memset(temp, 0, 128); /* for YUY2 and msan */ \ -+ int r = width & MASK; \ -+ int n = width & ~MASK; \ -+ if (n > 0) { \ -+ ANY_SIMD(src_ptr, dst_ptr, n); \ -+ } \ -+ memcpy(temp, src_ptr + (n >> UVSHIFT) * SBPP, SS(r, UVSHIFT) * SBPP); \ -+ ANY_SIMD(temp, temp + 128, MASK + 1); \ -+ memcpy(dst_ptr + n * BPP, temp + 128, r * BPP); \ - } - - #ifdef HAS_COPYROW_AVX -@@ -981,12 +919,6 @@ ANY11(ARGBToARGB4444Row_Any_AVX2, ARGBTo - #if defined(HAS_ABGRTOAR30ROW_SSSE3) - ANY11(ABGRToAR30Row_Any_SSSE3, ABGRToAR30Row_SSSE3, 0, 4, 4, 3) - #endif --#if defined(HAS_ABGRTOAR30ROW_NEON) --ANY11(ABGRToAR30Row_Any_NEON, ABGRToAR30Row_NEON, 0, 4, 4, 7) --#endif --#if defined(HAS_ARGBTOAR30ROW_NEON) --ANY11(ARGBToAR30Row_Any_NEON, ARGBToAR30Row_NEON, 0, 4, 4, 7) --#endif - #if defined(HAS_ARGBTOAR30ROW_SSSE3) - ANY11(ARGBToAR30Row_Any_SSSE3, ARGBToAR30Row_SSSE3, 0, 4, 4, 3) - #endif -@@ -1040,13 +972,6 @@ ANY11(ARGBToARGB1555Row_Any_MSA, ARGBToA - ANY11(ARGBToARGB4444Row_Any_MSA, ARGBToARGB4444Row_MSA, 0, 4, 2, 7) - ANY11(J400ToARGBRow_Any_MSA, J400ToARGBRow_MSA, 0, 1, 4, 15) - #endif --#if defined(HAS_ARGBTORGB24ROW_LSX) --ANY11(ARGBToRGB24Row_Any_LSX, ARGBToRGB24Row_LSX, 0, 4, 3, 15) --ANY11(ARGBToRAWRow_Any_LSX, ARGBToRAWRow_LSX, 0, 4, 3, 15) --ANY11(ARGBToRGB565Row_Any_LSX, ARGBToRGB565Row_LSX, 0, 4, 2, 7) --ANY11(ARGBToARGB1555Row_Any_LSX, ARGBToARGB1555Row_LSX, 0, 4, 2, 7) --ANY11(ARGBToARGB4444Row_Any_LSX, ARGBToARGB4444Row_LSX, 0, 4, 2, 7) --#endif - #if defined(HAS_ARGBTORGB24ROW_LASX) - ANY11(ARGBToRGB24Row_Any_LASX, ARGBToRGB24Row_LASX, 0, 4, 3, 31) - ANY11(ARGBToRAWRow_Any_LASX, ARGBToRAWRow_LASX, 0, 4, 3, 31) -@@ -1111,9 +1036,6 @@ ANY11(RGBAToYJRow_Any_SSSE3, RGBAToYJRow - #ifdef HAS_ARGBTOYROW_NEON - ANY11(ARGBToYRow_Any_NEON, ARGBToYRow_NEON, 0, 4, 1, 15) - #endif --#ifdef HAS_ARGBTOYROW_NEON_DOTPROD --ANY11(ARGBToYRow_Any_NEON_DotProd, ARGBToYRow_NEON_DotProd, 0, 4, 1, 15) --#endif - #ifdef HAS_ARGBTOYROW_MSA - ANY11(ARGBToYRow_Any_MSA, ARGBToYRow_MSA, 0, 4, 1, 15) - #endif -@@ -1126,21 +1048,12 @@ ANY11(ARGBToYRow_Any_LASX, ARGBToYRow_LA - #ifdef HAS_ARGBTOYJROW_NEON - ANY11(ARGBToYJRow_Any_NEON, ARGBToYJRow_NEON, 0, 4, 1, 15) - #endif --#ifdef HAS_ARGBTOYJROW_NEON_DOTPROD --ANY11(ARGBToYJRow_Any_NEON_DotProd, ARGBToYJRow_NEON_DotProd, 0, 4, 1, 15) --#endif - #ifdef HAS_ABGRTOYJROW_NEON - ANY11(ABGRToYJRow_Any_NEON, ABGRToYJRow_NEON, 0, 4, 1, 15) - #endif --#ifdef HAS_ABGRTOYJROW_NEON_DOTPROD --ANY11(ABGRToYJRow_Any_NEON_DotProd, ABGRToYJRow_NEON_DotProd, 0, 4, 1, 15) --#endif - #ifdef HAS_RGBATOYJROW_NEON - ANY11(RGBAToYJRow_Any_NEON, RGBAToYJRow_NEON, 0, 4, 1, 15) - #endif --#ifdef HAS_RGBATOYJROW_NEON_DOTPROD --ANY11(RGBAToYJRow_Any_NEON_DotProd, RGBAToYJRow_NEON_DotProd, 0, 4, 1, 15) --#endif - #ifdef HAS_ARGBTOYJROW_MSA - ANY11(ARGBToYJRow_Any_MSA, ARGBToYJRow_MSA, 0, 4, 1, 15) - #endif -@@ -1165,9 +1078,6 @@ ANY11(ABGRToYJRow_Any_LASX, ABGRToYJRow_ - #ifdef HAS_BGRATOYROW_NEON - ANY11(BGRAToYRow_Any_NEON, BGRAToYRow_NEON, 0, 4, 1, 15) - #endif --#ifdef HAS_BGRATOYROW_NEON_DOTPROD --ANY11(BGRAToYRow_Any_NEON_DotProd, BGRAToYRow_NEON_DotProd, 0, 4, 1, 15) --#endif - #ifdef HAS_BGRATOYROW_MSA - ANY11(BGRAToYRow_Any_MSA, BGRAToYRow_MSA, 0, 4, 1, 15) - #endif -@@ -1180,9 +1090,6 @@ ANY11(BGRAToYRow_Any_LASX, BGRAToYRow_LA - #ifdef HAS_ABGRTOYROW_NEON - ANY11(ABGRToYRow_Any_NEON, ABGRToYRow_NEON, 0, 4, 1, 15) - #endif --#ifdef HAS_ABGRTOYROW_NEON_DOTPROD --ANY11(ABGRToYRow_Any_NEON_DotProd, ABGRToYRow_NEON_DotProd, 0, 4, 1, 15) --#endif - #ifdef HAS_ABGRTOYROW_MSA - ANY11(ABGRToYRow_Any_MSA, ABGRToYRow_MSA, 0, 4, 1, 7) - #endif -@@ -1195,9 +1102,6 @@ ANY11(ABGRToYRow_Any_LASX, ABGRToYRow_LA - #ifdef HAS_RGBATOYROW_NEON - ANY11(RGBAToYRow_Any_NEON, RGBAToYRow_NEON, 0, 4, 1, 15) - #endif --#ifdef HAS_RGBATOYROW_NEON_DOTPROD --ANY11(RGBAToYRow_Any_NEON_DotProd, RGBAToYRow_NEON_DotProd, 0, 4, 1, 15) --#endif - #ifdef HAS_RGBATOYROW_MSA - ANY11(RGBAToYRow_Any_MSA, RGBAToYRow_MSA, 0, 4, 1, 15) - #endif -@@ -1297,18 +1201,12 @@ ANY11(UYVYToYRow_Any_NEON, UYVYToYRow_NE - #ifdef HAS_YUY2TOYROW_MSA - ANY11(YUY2ToYRow_Any_MSA, YUY2ToYRow_MSA, 1, 4, 1, 31) - #endif --#ifdef HAS_YUY2TOYROW_LSX --ANY11(YUY2ToYRow_Any_LSX, YUY2ToYRow_LSX, 1, 4, 1, 15) --#endif - #ifdef HAS_YUY2TOYROW_LASX - ANY11(YUY2ToYRow_Any_LASX, YUY2ToYRow_LASX, 1, 4, 1, 31) - #endif - #ifdef HAS_UYVYTOYROW_MSA - ANY11(UYVYToYRow_Any_MSA, UYVYToYRow_MSA, 1, 4, 1, 31) - #endif --#ifdef HAS_UYVYTOYROW_LSX --ANY11(UYVYToYRow_Any_LSX, UYVYToYRow_LSX, 1, 4, 1, 15) --#endif - #ifdef HAS_UYVYTOYROW_LASX - ANY11(UYVYToYRow_Any_LASX, UYVYToYRow_LASX, 1, 4, 1, 31) - #endif -@@ -1405,9 +1303,6 @@ ANY11(ARGBAttenuateRow_Any_NEON, ARGBAtt - #ifdef HAS_ARGBATTENUATEROW_MSA - ANY11(ARGBAttenuateRow_Any_MSA, ARGBAttenuateRow_MSA, 0, 4, 4, 7) - #endif --#ifdef HAS_ARGBATTENUATEROW_LSX --ANY11(ARGBAttenuateRow_Any_LSX, ARGBAttenuateRow_LSX, 0, 4, 4, 7) --#endif - #ifdef HAS_ARGBATTENUATEROW_LASX - ANY11(ARGBAttenuateRow_Any_LASX, ARGBAttenuateRow_LASX, 0, 4, 4, 15) - #endif -@@ -1429,21 +1324,19 @@ ANY11(ARGBExtractAlphaRow_Any_LSX, ARGBE - #undef ANY11 - - // Any 1 to 1 blended. Destination is read, modify, write. --#define ANY11B(NAMEANY, ANY_SIMD, UVSHIFT, SBPP, BPP, MASK) \ -- void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_ptr, int width) { \ -- SIMD_ALIGNED(uint8_t vin[64]); \ -- SIMD_ALIGNED(uint8_t vout[64]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -- memset(vout, 0, sizeof(vout)); /* for msan */ \ -- int r = width & MASK; \ -- int n = width & ~MASK; \ -- if (n > 0) { \ -- ANY_SIMD(src_ptr, dst_ptr, n); \ -- } \ -- memcpy(vin, src_ptr + (n >> UVSHIFT) * SBPP, SS(r, UVSHIFT) * SBPP); \ -- memcpy(vout, dst_ptr + n * BPP, r * BPP); \ -- ANY_SIMD(vin, vout, MASK + 1); \ -- memcpy(dst_ptr + n * BPP, vout, r * BPP); \ -+#define ANY11B(NAMEANY, ANY_SIMD, UVSHIFT, SBPP, BPP, MASK) \ -+ void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_ptr, int width) { \ -+ SIMD_ALIGNED(uint8_t temp[64 * 2]); \ -+ memset(temp, 0, 64 * 2); /* for msan */ \ -+ int r = width & MASK; \ -+ int n = width & ~MASK; \ -+ if (n > 0) { \ -+ ANY_SIMD(src_ptr, dst_ptr, n); \ -+ } \ -+ memcpy(temp, src_ptr + (n >> UVSHIFT) * SBPP, SS(r, UVSHIFT) * SBPP); \ -+ memcpy(temp + 64, dst_ptr + n * BPP, r * BPP); \ -+ ANY_SIMD(temp, temp + 64, MASK + 1); \ -+ memcpy(dst_ptr + n * BPP, temp + 64, r * BPP); \ - } - - #ifdef HAS_ARGBCOPYALPHAROW_AVX2 -@@ -1463,17 +1356,16 @@ ANY11B(ARGBCopyYToAlphaRow_Any_SSE2, ARG - // Any 1 to 1 with parameter. - #define ANY11P(NAMEANY, ANY_SIMD, T, SBPP, BPP, MASK) \ - void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_ptr, T param, int width) { \ -- SIMD_ALIGNED(uint8_t vin[64]); \ -- SIMD_ALIGNED(uint8_t vout[64]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -+ SIMD_ALIGNED(uint8_t temp[64 * 2]); \ -+ memset(temp, 0, 64); /* for msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(src_ptr, dst_ptr, param, n); \ - } \ -- memcpy(vin, src_ptr + n * SBPP, r * SBPP); \ -- ANY_SIMD(vin, vout, param, MASK + 1); \ -- memcpy(dst_ptr + n * BPP, vout, r * BPP); \ -+ memcpy(temp, src_ptr + n * SBPP, r * SBPP); \ -+ ANY_SIMD(temp, temp + 64, param, MASK + 1); \ -+ memcpy(dst_ptr + n * BPP, temp + 64, r * BPP); \ - } - - #if defined(HAS_I400TOARGBROW_SSE2) -@@ -1549,14 +1441,6 @@ ANY11P(ARGBToRGB565DitherRow_Any_MSA, - 2, - 7) - #endif --#if defined(HAS_ARGBTORGB565DITHERROW_LSX) --ANY11P(ARGBToRGB565DitherRow_Any_LSX, -- ARGBToRGB565DitherRow_LSX, -- const uint32_t, -- 4, -- 2, -- 7) --#endif - #if defined(HAS_ARGBTORGB565DITHERROW_LASX) - ANY11P(ARGBToRGB565DitherRow_Any_LASX, - ARGBToRGB565DitherRow_LASX, -@@ -1577,9 +1461,6 @@ ANY11P(ARGBShuffleRow_Any_NEON, ARGBShuf - #ifdef HAS_ARGBSHUFFLEROW_MSA - ANY11P(ARGBShuffleRow_Any_MSA, ARGBShuffleRow_MSA, const uint8_t*, 4, 4, 7) - #endif --#ifdef HAS_ARGBSHUFFLEROW_LSX --ANY11P(ARGBShuffleRow_Any_LSX, ARGBShuffleRow_LSX, const uint8_t*, 4, 4, 7) --#endif - #ifdef HAS_ARGBSHUFFLEROW_LASX - ANY11P(ARGBShuffleRow_Any_LASX, ARGBShuffleRow_LASX, const uint8_t*, 4, 4, 15) - #endif -@@ -1589,17 +1470,17 @@ ANY11P(ARGBShuffleRow_Any_LASX, ARGBShuf - // Any 1 to 1 with type - #define ANY11T(NAMEANY, ANY_SIMD, SBPP, BPP, STYPE, DTYPE, MASK) \ - void NAMEANY(const STYPE* src_ptr, DTYPE* dst_ptr, int width) { \ -- SIMD_ALIGNED(uint8_t vin[(MASK + 1) * SBPP]); \ -- SIMD_ALIGNED(uint8_t vout[(MASK + 1) * BPP]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -+ SIMD_ALIGNED(uint8_t temp[(MASK + 1) * SBPP]); \ -+ SIMD_ALIGNED(uint8_t out[(MASK + 1) * BPP]); \ -+ memset(temp, 0, (MASK + 1) * SBPP); /* for msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(src_ptr, dst_ptr, n); \ - } \ -- memcpy(vin, (uint8_t*)(src_ptr) + n * SBPP, r * SBPP); \ -- ANY_SIMD((STYPE*)vin, (DTYPE*)vout, MASK + 1); \ -- memcpy((uint8_t*)(dst_ptr) + n * BPP, vout, r * BPP); \ -+ memcpy(temp, (uint8_t*)(src_ptr) + n * SBPP, r * SBPP); \ -+ ANY_SIMD((STYPE*)temp, (DTYPE*)out, MASK + 1); \ -+ memcpy((uint8_t*)(dst_ptr) + n * BPP, out, r * BPP); \ - } - - #ifdef HAS_ARGBTOAR64ROW_SSSE3 -@@ -1655,17 +1536,17 @@ ANY11T(AB64ToARGBRow_Any_NEON, AB64ToARG - // Any 1 to 1 with parameter and shorts. BPP measures in shorts. - #define ANY11C(NAMEANY, ANY_SIMD, SBPP, BPP, STYPE, DTYPE, MASK) \ - void NAMEANY(const STYPE* src_ptr, DTYPE* dst_ptr, int scale, int width) { \ -- SIMD_ALIGNED(STYPE vin[32]); \ -- SIMD_ALIGNED(DTYPE vout[32]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -+ SIMD_ALIGNED(STYPE temp[32]); \ -+ SIMD_ALIGNED(DTYPE out[32]); \ -+ memset(temp, 0, 32 * SBPP); /* for msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(src_ptr, dst_ptr, scale, n); \ - } \ -- memcpy(vin, src_ptr + n, r * SBPP); \ -- ANY_SIMD(vin, vout, scale, MASK + 1); \ -- memcpy(dst_ptr + n, vout, r * BPP); \ -+ memcpy(temp, src_ptr + n, r * SBPP); \ -+ ANY_SIMD(temp, out, scale, MASK + 1); \ -+ memcpy(dst_ptr + n, out, r * BPP); \ - } - - #ifdef HAS_CONVERT16TO8ROW_SSSE3 -@@ -1742,17 +1623,17 @@ ANY11C(DivideRow_16_Any_NEON, DivideRow_ - // Any 1 to 1 with parameter and shorts to byte. BPP measures in shorts. - #define ANY11P16(NAMEANY, ANY_SIMD, ST, T, SBPP, BPP, MASK) \ - void NAMEANY(const ST* src_ptr, T* dst_ptr, float param, int width) { \ -- SIMD_ALIGNED(ST vin[32]); \ -- SIMD_ALIGNED(T vout[32]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -+ SIMD_ALIGNED(ST temp[32]); \ -+ SIMD_ALIGNED(T out[32]); \ -+ memset(temp, 0, SBPP * 32); /* for msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(src_ptr, dst_ptr, param, n); \ - } \ -- memcpy(vin, src_ptr + n, r * SBPP); \ -- ANY_SIMD(vin, vout, param, MASK + 1); \ -- memcpy(dst_ptr + n, vout, r * BPP); \ -+ memcpy(temp, src_ptr + n, r * SBPP); \ -+ ANY_SIMD(temp, out, param, MASK + 1); \ -+ memcpy(dst_ptr + n, out, r * BPP); \ - } - - #ifdef HAS_HALFFLOATROW_SSE2 -@@ -1793,22 +1674,20 @@ ANY11P16(HalfFloatRow_Any_LSX, HalfFloat - #undef ANY11P16 - - // Any 1 to 1 with yuvconstants --#define ANY11C(NAMEANY, ANY_SIMD, UVSHIFT, SBPP, BPP, MASK) \ -- void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_ptr, \ -- const struct YuvConstants* yuvconstants, int width) { \ -- SIMD_ALIGNED(uint8_t vin[128]); \ -- SIMD_ALIGNED(uint8_t vout[128]); \ -- memset(vin, 0, sizeof(vin)); /* for YUY2 and msan */ \ -- int r = width & MASK; \ -- int n = width & ~MASK; \ -- if (n > 0) { \ -- ANY_SIMD(src_ptr, dst_ptr, yuvconstants, n); \ -- } \ -- memcpy(vin, src_ptr + (n >> UVSHIFT) * SBPP, SS(r, UVSHIFT) * SBPP); \ -- ANY_SIMD(vin, vout, yuvconstants, MASK + 1); \ -- memcpy(dst_ptr + n * BPP, vout, r * BPP); \ -+#define ANY11C(NAMEANY, ANY_SIMD, UVSHIFT, SBPP, BPP, MASK) \ -+ void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_ptr, \ -+ const struct YuvConstants* yuvconstants, int width) { \ -+ SIMD_ALIGNED(uint8_t temp[128 * 2]); \ -+ memset(temp, 0, 128); /* for YUY2 and msan */ \ -+ int r = width & MASK; \ -+ int n = width & ~MASK; \ -+ if (n > 0) { \ -+ ANY_SIMD(src_ptr, dst_ptr, yuvconstants, n); \ -+ } \ -+ memcpy(temp, src_ptr + (n >> UVSHIFT) * SBPP, SS(r, UVSHIFT) * SBPP); \ -+ ANY_SIMD(temp, temp + 128, yuvconstants, MASK + 1); \ -+ memcpy(dst_ptr + n * BPP, temp + 128, r * BPP); \ - } -- - #if defined(HAS_YUY2TOARGBROW_SSSE3) - ANY11C(YUY2ToARGBRow_Any_SSSE3, YUY2ToARGBRow_SSSE3, 1, 4, 4, 15) - ANY11C(UYVYToARGBRow_Any_SSSE3, UYVYToARGBRow_SSSE3, 1, 4, 4, 15) -@@ -1835,21 +1714,21 @@ ANY11C(UYVYToARGBRow_Any_LSX, UYVYToARGB - #define ANY11I(NAMEANY, ANY_SIMD, TD, TS, SBPP, BPP, MASK) \ - void NAMEANY(TD* dst_ptr, const TS* src_ptr, ptrdiff_t src_stride, \ - int width, int source_y_fraction) { \ -- SIMD_ALIGNED(TS vin[64 * 2]); \ -- SIMD_ALIGNED(TD vout[64]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -+ SIMD_ALIGNED(TS temps[64 * 2]); \ -+ SIMD_ALIGNED(TD tempd[64]); \ -+ memset(temps, 0, sizeof(temps)); /* for msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(dst_ptr, src_ptr, src_stride, n, source_y_fraction); \ - } \ -- memcpy(vin, src_ptr + n * SBPP, r * SBPP * sizeof(TS)); \ -+ memcpy(temps, src_ptr + n * SBPP, r * SBPP * sizeof(TS)); \ - if (source_y_fraction) { \ -- memcpy(vin + 64, src_ptr + src_stride + n * SBPP, \ -+ memcpy(temps + 64, src_ptr + src_stride + n * SBPP, \ - r * SBPP * sizeof(TS)); \ - } \ -- ANY_SIMD(vout, vin, 64, MASK + 1, source_y_fraction); \ -- memcpy(dst_ptr + n * BPP, vout, r * BPP * sizeof(TD)); \ -+ ANY_SIMD(tempd, temps, 64, MASK + 1, source_y_fraction); \ -+ memcpy(dst_ptr + n * BPP, tempd, r * BPP * sizeof(TD)); \ - } - - #ifdef HAS_INTERPOLATEROW_AVX2 -@@ -1889,21 +1768,21 @@ ANY11I(InterpolateRow_16_Any_NEON, - #define ANY11IS(NAMEANY, ANY_SIMD, TD, TS, SBPP, BPP, MASK) \ - void NAMEANY(TD* dst_ptr, const TS* src_ptr, ptrdiff_t src_stride, \ - int scale, int width, int source_y_fraction) { \ -- SIMD_ALIGNED(TS vin[64 * 2]); \ -- SIMD_ALIGNED(TD vout[64]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -+ SIMD_ALIGNED(TS temps[64 * 2]); \ -+ SIMD_ALIGNED(TD tempd[64]); \ -+ memset(temps, 0, sizeof(temps)); /* for msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(dst_ptr, src_ptr, src_stride, scale, n, source_y_fraction); \ - } \ -- memcpy(vin, src_ptr + n * SBPP, r * SBPP * sizeof(TS)); \ -+ memcpy(temps, src_ptr + n * SBPP, r * SBPP * sizeof(TS)); \ - if (source_y_fraction) { \ -- memcpy(vin + 64, src_ptr + src_stride + n * SBPP, \ -+ memcpy(temps + 64, src_ptr + src_stride + n * SBPP, \ - r * SBPP * sizeof(TS)); \ - } \ -- ANY_SIMD(vout, vin, 64, scale, MASK + 1, source_y_fraction); \ -- memcpy(dst_ptr + n * BPP, vout, r * BPP * sizeof(TD)); \ -+ ANY_SIMD(tempd, temps, 64, scale, MASK + 1, source_y_fraction); \ -+ memcpy(dst_ptr + n * BPP, tempd, r * BPP * sizeof(TD)); \ - } - - #ifdef HAS_INTERPOLATEROW_16TO8_NEON -@@ -1928,19 +1807,18 @@ ANY11IS(InterpolateRow_16To8_Any_AVX2, - #undef ANY11IS - - // Any 1 to 1 mirror. --#define ANY11M(NAMEANY, ANY_SIMD, BPP, MASK) \ -- void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_ptr, int width) { \ -- SIMD_ALIGNED(uint8_t vin[64]); \ -- SIMD_ALIGNED(uint8_t vout[64]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -- int r = width & MASK; \ -- int n = width & ~MASK; \ -- if (n > 0) { \ -- ANY_SIMD(src_ptr + r * BPP, dst_ptr, n); \ -- } \ -- memcpy(vin, src_ptr, r* BPP); \ -- ANY_SIMD(vin, vout, MASK + 1); \ -- memcpy(dst_ptr + n * BPP, vout + (MASK + 1 - r) * BPP, r * BPP); \ -+#define ANY11M(NAMEANY, ANY_SIMD, BPP, MASK) \ -+ void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_ptr, int width) { \ -+ SIMD_ALIGNED(uint8_t temp[64 * 2]); \ -+ memset(temp, 0, 64); /* for msan */ \ -+ int r = width & MASK; \ -+ int n = width & ~MASK; \ -+ if (n > 0) { \ -+ ANY_SIMD(src_ptr + r * BPP, dst_ptr, n); \ -+ } \ -+ memcpy(temp, src_ptr, r* BPP); \ -+ ANY_SIMD(temp, temp + 64, MASK + 1); \ -+ memcpy(dst_ptr + n * BPP, temp + 64 + (MASK + 1 - r) * BPP, r * BPP); \ - } - - #ifdef HAS_MIRRORROW_AVX2 -@@ -1955,9 +1833,6 @@ ANY11M(MirrorRow_Any_NEON, MirrorRow_NEO - #ifdef HAS_MIRRORROW_MSA - ANY11M(MirrorRow_Any_MSA, MirrorRow_MSA, 1, 63) - #endif --#ifdef HAS_MIRRORROW_LSX --ANY11M(MirrorRow_Any_LSX, MirrorRow_LSX, 1, 31) --#endif - #ifdef HAS_MIRRORROW_LASX - ANY11M(MirrorRow_Any_LASX, MirrorRow_LASX, 1, 63) - #endif -@@ -1973,9 +1848,6 @@ ANY11M(MirrorUVRow_Any_NEON, MirrorUVRow - #ifdef HAS_MIRRORUVROW_MSA - ANY11M(MirrorUVRow_Any_MSA, MirrorUVRow_MSA, 2, 7) - #endif --#ifdef HAS_MIRRORUVROW_LSX --ANY11M(MirrorUVRow_Any_LSX, MirrorUVRow_LSX, 2, 7) --#endif - #ifdef HAS_MIRRORUVROW_LASX - ANY11M(MirrorUVRow_Any_LASX, MirrorUVRow_LASX, 2, 15) - #endif -@@ -1991,9 +1863,6 @@ ANY11M(ARGBMirrorRow_Any_NEON, ARGBMirro - #ifdef HAS_ARGBMIRRORROW_MSA - ANY11M(ARGBMirrorRow_Any_MSA, ARGBMirrorRow_MSA, 4, 15) - #endif --#ifdef HAS_ARGBMIRRORROW_LSX --ANY11M(ARGBMirrorRow_Any_LSX, ARGBMirrorRow_LSX, 4, 7) --#endif - #ifdef HAS_ARGBMIRRORROW_LASX - ANY11M(ARGBMirrorRow_Any_LASX, ARGBMirrorRow_LASX, 4, 15) - #endif -@@ -2008,14 +1877,15 @@ ANY11M(RGB24MirrorRow_Any_NEON, RGB24Mir - // Any 1 plane. (memset) - #define ANY1(NAMEANY, ANY_SIMD, T, BPP, MASK) \ - void NAMEANY(uint8_t* dst_ptr, T v32, int width) { \ -- SIMD_ALIGNED(uint8_t vout[64]); \ -+ SIMD_ALIGNED(uint8_t temp[64]); \ -+ memset(temp, 0, 64); /* for msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(dst_ptr, v32, n); \ - } \ -- ANY_SIMD(vout, v32, MASK + 1); \ -- memcpy(dst_ptr + n * BPP, vout, r * BPP); \ -+ ANY_SIMD(temp, v32, MASK + 1); \ -+ memcpy(dst_ptr + n * BPP, temp, r * BPP); \ - } - - #ifdef HAS_SETROW_X86 -@@ -2039,21 +1909,20 @@ ANY1(ARGBSetRow_Any_LSX, ARGBSetRow_LSX, - #undef ANY1 - - // Any 1 to 2. Outputs UV planes. --#define ANY12(NAMEANY, ANY_SIMD, UVSHIFT, BPP, DUVSHIFT, MASK) \ -- void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_u, uint8_t* dst_v, \ -- int width) { \ -- SIMD_ALIGNED(uint8_t vin[128]); \ -- SIMD_ALIGNED(uint8_t vout[128 * 2]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -- int r = width & MASK; \ -- int n = width & ~MASK; \ -- if (n > 0) { \ -- ANY_SIMD(src_ptr, dst_u, dst_v, n); \ -- } \ -- memcpy(vin, src_ptr + (n >> UVSHIFT) * BPP, SS(r, UVSHIFT) * BPP); \ -- ANY_SIMD(vin, vout, vout + 128, MASK + 1); \ -- memcpy(dst_u + (n >> DUVSHIFT), vout, SS(r, DUVSHIFT)); \ -- memcpy(dst_v + (n >> DUVSHIFT), vout + 128, SS(r, DUVSHIFT)); \ -+#define ANY12(NAMEANY, ANY_SIMD, UVSHIFT, BPP, DUVSHIFT, MASK) \ -+ void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_u, uint8_t* dst_v, \ -+ int width) { \ -+ SIMD_ALIGNED(uint8_t temp[128 * 3]); \ -+ memset(temp, 0, 128); /* for msan */ \ -+ int r = width & MASK; \ -+ int n = width & ~MASK; \ -+ if (n > 0) { \ -+ ANY_SIMD(src_ptr, dst_u, dst_v, n); \ -+ } \ -+ memcpy(temp, src_ptr + (n >> UVSHIFT) * BPP, SS(r, UVSHIFT) * BPP); \ -+ ANY_SIMD(temp, temp + 128, temp + 256, MASK + 1); \ -+ memcpy(dst_u + (n >> DUVSHIFT), temp + 128, SS(r, DUVSHIFT)); \ -+ memcpy(dst_v + (n >> DUVSHIFT), temp + 256, SS(r, DUVSHIFT)); \ - } - - #ifdef HAS_SPLITUVROW_SSE2 -@@ -2092,11 +1961,6 @@ ANY12(ARGBToUV444Row_Any_MSA, ARGBToUV44 - ANY12(YUY2ToUV422Row_Any_MSA, YUY2ToUV422Row_MSA, 1, 4, 1, 31) - ANY12(UYVYToUV422Row_Any_MSA, UYVYToUV422Row_MSA, 1, 4, 1, 31) - #endif --#ifdef HAS_YUY2TOUV422ROW_LSX --ANY12(ARGBToUV444Row_Any_LSX, ARGBToUV444Row_LSX, 0, 4, 0, 15) --ANY12(YUY2ToUV422Row_Any_LSX, YUY2ToUV422Row_LSX, 1, 4, 1, 15) --ANY12(UYVYToUV422Row_Any_LSX, UYVYToUV422Row_LSX, 1, 4, 1, 15) --#endif - #ifdef HAS_YUY2TOUV422ROW_LASX - ANY12(ARGBToUV444Row_Any_LASX, ARGBToUV444Row_LASX, 0, 4, 0, 31) - ANY12(YUY2ToUV422Row_Any_LASX, YUY2ToUV422Row_LASX, 1, 4, 1, 31) -@@ -2107,18 +1971,17 @@ ANY12(UYVYToUV422Row_Any_LASX, UYVYToUV4 - // Any 2 16 bit planes with parameter to 1 - #define ANY12PT(NAMEANY, ANY_SIMD, T, BPP, MASK) \ - void NAMEANY(const T* src_uv, T* dst_u, T* dst_v, int depth, int width) { \ -- SIMD_ALIGNED(T vin[16 * 2]); \ -- SIMD_ALIGNED(T vout[16 * 2]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -+ SIMD_ALIGNED(T temp[16 * 4]); \ -+ memset(temp, 0, 16 * 4 * BPP); /* for msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(src_uv, dst_u, dst_v, depth, n); \ - } \ -- memcpy(vin, src_uv + n * 2, r * BPP * 2); \ -- ANY_SIMD(vin, vout, vout + 16, depth, MASK + 1); \ -- memcpy(dst_u + n, vout, r * BPP); \ -- memcpy(dst_v + n, vout + 16, r * BPP); \ -+ memcpy(temp, src_uv + n * 2, r * BPP * 2); \ -+ ANY_SIMD(temp, temp + 32, temp + 48, depth, MASK + 1); \ -+ memcpy(dst_u + n, temp + 32, r * BPP); \ -+ memcpy(dst_v + n, temp + 48, r * BPP); \ - } - - #ifdef HAS_SPLITUVROW_16_AVX2 -@@ -2132,22 +1995,21 @@ ANY12PT(SplitUVRow_16_Any_NEON, SplitUVR - #undef ANY21CT - - // Any 1 to 3. Outputs RGB planes. --#define ANY13(NAMEANY, ANY_SIMD, BPP, MASK) \ -- void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_r, uint8_t* dst_g, \ -- uint8_t* dst_b, int width) { \ -- SIMD_ALIGNED(uint8_t vin[16 * 3]); \ -- SIMD_ALIGNED(uint8_t vout[16 * 3]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -- int r = width & MASK; \ -- int n = width & ~MASK; \ -- if (n > 0) { \ -- ANY_SIMD(src_ptr, dst_r, dst_g, dst_b, n); \ -- } \ -- memcpy(vin, src_ptr + n * BPP, r * BPP); \ -- ANY_SIMD(vin, vout, vout + 16, vout + 32, MASK + 1); \ -- memcpy(dst_r + n, vout, r); \ -- memcpy(dst_g + n, vout + 16, r); \ -- memcpy(dst_b + n, vout + 32, r); \ -+#define ANY13(NAMEANY, ANY_SIMD, BPP, MASK) \ -+ void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_r, uint8_t* dst_g, \ -+ uint8_t* dst_b, int width) { \ -+ SIMD_ALIGNED(uint8_t temp[16 * 6]); \ -+ memset(temp, 0, 16 * 3); /* for msan */ \ -+ int r = width & MASK; \ -+ int n = width & ~MASK; \ -+ if (n > 0) { \ -+ ANY_SIMD(src_ptr, dst_r, dst_g, dst_b, n); \ -+ } \ -+ memcpy(temp, src_ptr + n * BPP, r * BPP); \ -+ ANY_SIMD(temp, temp + 16 * 3, temp + 16 * 4, temp + 16 * 5, MASK + 1); \ -+ memcpy(dst_r + n, temp + 16 * 3, r); \ -+ memcpy(dst_g + n, temp + 16 * 4, r); \ -+ memcpy(dst_b + n, temp + 16 * 5, r); \ - } - - #ifdef HAS_SPLITRGBROW_SSSE3 -@@ -2170,23 +2032,23 @@ ANY13(SplitXRGBRow_Any_NEON, SplitXRGBRo - #endif - - // Any 1 to 4. Outputs ARGB planes. --#define ANY14(NAMEANY, ANY_SIMD, BPP, MASK) \ -- void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_r, uint8_t* dst_g, \ -- uint8_t* dst_b, uint8_t* dst_a, int width) { \ -- SIMD_ALIGNED(uint8_t vin[16 * 4]); \ -- SIMD_ALIGNED(uint8_t vout[16 * 4]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -- int r = width & MASK; \ -- int n = width & ~MASK; \ -- if (n > 0) { \ -- ANY_SIMD(src_ptr, dst_r, dst_g, dst_b, dst_a, n); \ -- } \ -- memcpy(vin, src_ptr + n * BPP, r * BPP); \ -- ANY_SIMD(vin, vout, vout + 16, vout + 32, vout + 48, MASK + 1); \ -- memcpy(dst_r + n, vout, r); \ -- memcpy(dst_g + n, vout + 16, r); \ -- memcpy(dst_b + n, vout + 32, r); \ -- memcpy(dst_a + n, vout + 48, r); \ -+#define ANY14(NAMEANY, ANY_SIMD, BPP, MASK) \ -+ void NAMEANY(const uint8_t* src_ptr, uint8_t* dst_r, uint8_t* dst_g, \ -+ uint8_t* dst_b, uint8_t* dst_a, int width) { \ -+ SIMD_ALIGNED(uint8_t temp[16 * 8]); \ -+ memset(temp, 0, 16 * 4); /* for msan */ \ -+ int r = width & MASK; \ -+ int n = width & ~MASK; \ -+ if (n > 0) { \ -+ ANY_SIMD(src_ptr, dst_r, dst_g, dst_b, dst_a, n); \ -+ } \ -+ memcpy(temp, src_ptr + n * BPP, r * BPP); \ -+ ANY_SIMD(temp, temp + 16 * 4, temp + 16 * 5, temp + 16 * 6, temp + 16 * 7, \ -+ MASK + 1); \ -+ memcpy(dst_r + n, temp + 16 * 4, r); \ -+ memcpy(dst_g + n, temp + 16 * 5, r); \ -+ memcpy(dst_b + n, temp + 16 * 6, r); \ -+ memcpy(dst_a + n, temp + 16 * 7, r); \ - } - - #ifdef HAS_SPLITARGBROW_SSE2 -@@ -2207,26 +2069,25 @@ ANY14(SplitARGBRow_Any_NEON, SplitARGBRo - #define ANY12S(NAMEANY, ANY_SIMD, UVSHIFT, BPP, MASK) \ - void NAMEANY(const uint8_t* src_ptr, int src_stride, uint8_t* dst_u, \ - uint8_t* dst_v, int width) { \ -- SIMD_ALIGNED(uint8_t vin[128 * 2]); \ -- SIMD_ALIGNED(uint8_t vout[128 * 2]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -+ SIMD_ALIGNED(uint8_t temp[128 * 4]); \ -+ memset(temp, 0, 128 * 2); /* for msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(src_ptr, src_stride, dst_u, dst_v, n); \ - } \ -- memcpy(vin, src_ptr + (n >> UVSHIFT) * BPP, SS(r, UVSHIFT) * BPP); \ -- memcpy(vin + 128, src_ptr + src_stride + (n >> UVSHIFT) * BPP, \ -+ memcpy(temp, src_ptr + (n >> UVSHIFT) * BPP, SS(r, UVSHIFT) * BPP); \ -+ memcpy(temp + 128, src_ptr + src_stride + (n >> UVSHIFT) * BPP, \ - SS(r, UVSHIFT) * BPP); \ - if ((width & 1) && UVSHIFT == 0) { /* repeat last pixel for subsample */ \ -- memcpy(vin + SS(r, UVSHIFT) * BPP, vin + SS(r, UVSHIFT) * BPP - BPP, \ -+ memcpy(temp + SS(r, UVSHIFT) * BPP, temp + SS(r, UVSHIFT) * BPP - BPP, \ - BPP); \ -- memcpy(vin + 128 + SS(r, UVSHIFT) * BPP, \ -- vin + 128 + SS(r, UVSHIFT) * BPP - BPP, BPP); \ -+ memcpy(temp + 128 + SS(r, UVSHIFT) * BPP, \ -+ temp + 128 + SS(r, UVSHIFT) * BPP - BPP, BPP); \ - } \ -- ANY_SIMD(vin, 128, vout, vout + 128, MASK + 1); \ -- memcpy(dst_u + (n >> 1), vout, SS(r, 1)); \ -- memcpy(dst_v + (n >> 1), vout + 128, SS(r, 1)); \ -+ ANY_SIMD(temp, 128, temp + 256, temp + 384, MASK + 1); \ -+ memcpy(dst_u + (n >> 1), temp + 256, SS(r, 1)); \ -+ memcpy(dst_v + (n >> 1), temp + 384, SS(r, 1)); \ - } - - #ifdef HAS_ARGBTOUVROW_AVX2 -@@ -2264,30 +2125,18 @@ ANY12S(UYVYToUVRow_Any_SSE2, UYVYToUVRow - #ifdef HAS_ARGBTOUVROW_NEON - ANY12S(ARGBToUVRow_Any_NEON, ARGBToUVRow_NEON, 0, 4, 15) - #endif --#ifdef HAS_ARGBTOUVROW_SVE2 --ANY12S(ARGBToUVRow_Any_SVE2, ARGBToUVRow_SVE2, 0, 4, 1) --#endif - #ifdef HAS_ARGBTOUVROW_MSA - ANY12S(ARGBToUVRow_Any_MSA, ARGBToUVRow_MSA, 0, 4, 31) - #endif --#ifdef HAS_ARGBTOUVROW_LSX --ANY12S(ARGBToUVRow_Any_LSX, ARGBToUVRow_LSX, 0, 4, 15) --#endif - #ifdef HAS_ARGBTOUVROW_LASX - ANY12S(ARGBToUVRow_Any_LASX, ARGBToUVRow_LASX, 0, 4, 31) - #endif - #ifdef HAS_ARGBTOUVJROW_NEON - ANY12S(ARGBToUVJRow_Any_NEON, ARGBToUVJRow_NEON, 0, 4, 15) - #endif --#ifdef HAS_ARGBTOUVJROW_SVE2 --ANY12S(ARGBToUVJRow_Any_SVE2, ARGBToUVJRow_SVE2, 0, 4, 1) --#endif - #ifdef HAS_ABGRTOUVJROW_NEON - ANY12S(ABGRToUVJRow_Any_NEON, ABGRToUVJRow_NEON, 0, 4, 15) - #endif --#ifdef HAS_ABGRTOUVJROW_SVE2 --ANY12S(ABGRToUVJRow_Any_SVE2, ABGRToUVJRow_SVE2, 0, 4, 1) --#endif - #ifdef HAS_ARGBTOUVJROW_MSA - ANY12S(ARGBToUVJRow_Any_MSA, ARGBToUVJRow_MSA, 0, 4, 31) - #endif -@@ -2300,9 +2149,6 @@ ANY12S(ARGBToUVJRow_Any_LASX, ARGBToUVJR - #ifdef HAS_BGRATOUVROW_NEON - ANY12S(BGRAToUVRow_Any_NEON, BGRAToUVRow_NEON, 0, 4, 15) - #endif --#ifdef HAS_BGRATOUVROW_SVE2 --ANY12S(BGRAToUVRow_Any_SVE2, BGRAToUVRow_SVE2, 0, 4, 1) --#endif - #ifdef HAS_BGRATOUVROW_MSA - ANY12S(BGRAToUVRow_Any_MSA, BGRAToUVRow_MSA, 0, 4, 15) - #endif -@@ -2312,9 +2158,6 @@ ANY12S(BGRAToUVRow_Any_LSX, BGRAToUVRow_ - #ifdef HAS_ABGRTOUVROW_NEON - ANY12S(ABGRToUVRow_Any_NEON, ABGRToUVRow_NEON, 0, 4, 15) - #endif --#ifdef HAS_ABGRTOUVROW_SVE2 --ANY12S(ABGRToUVRow_Any_SVE2, ABGRToUVRow_SVE2, 0, 4, 1) --#endif - #ifdef HAS_ABGRTOUVROW_MSA - ANY12S(ABGRToUVRow_Any_MSA, ABGRToUVRow_MSA, 0, 4, 15) - #endif -@@ -2324,9 +2167,6 @@ ANY12S(ABGRToUVRow_Any_LSX, ABGRToUVRow_ - #ifdef HAS_RGBATOUVROW_NEON - ANY12S(RGBAToUVRow_Any_NEON, RGBAToUVRow_NEON, 0, 4, 15) - #endif --#ifdef HAS_RGBATOUVROW_SVE2 --ANY12S(RGBAToUVRow_Any_SVE2, RGBAToUVRow_SVE2, 0, 4, 1) --#endif - #ifdef HAS_RGBATOUVROW_MSA - ANY12S(RGBAToUVRow_Any_MSA, RGBAToUVRow_MSA, 0, 4, 15) - #endif -@@ -2399,18 +2239,12 @@ ANY12S(UYVYToUVRow_Any_NEON, UYVYToUVRow - #ifdef HAS_YUY2TOUVROW_MSA - ANY12S(YUY2ToUVRow_Any_MSA, YUY2ToUVRow_MSA, 1, 4, 31) - #endif --#ifdef HAS_YUY2TOUVROW_LSX --ANY12S(YUY2ToUVRow_Any_LSX, YUY2ToUVRow_LSX, 1, 4, 15) --#endif - #ifdef HAS_YUY2TOUVROW_LASX - ANY12S(YUY2ToUVRow_Any_LASX, YUY2ToUVRow_LASX, 1, 4, 31) - #endif - #ifdef HAS_UYVYTOUVROW_MSA - ANY12S(UYVYToUVRow_Any_MSA, UYVYToUVRow_MSA, 1, 4, 31) - #endif --#ifdef HAS_UYVYTOUVROW_LSX --ANY12S(UYVYToUVRow_Any_LSX, UYVYToUVRow_LSX, 1, 4, 15) --#endif - #ifdef HAS_UYVYTOUVROW_LASX - ANY12S(UYVYToUVRow_Any_LASX, UYVYToUVRow_LASX, 1, 4, 31) - #endif -@@ -2421,52 +2255,44 @@ ANY12S(UYVYToUVRow_Any_LASX, UYVYToUVRow - #define ANY11S(NAMEANY, ANY_SIMD, UVSHIFT, BPP, MASK) \ - void NAMEANY(const uint8_t* src_ptr, int src_stride, uint8_t* dst_vu, \ - int width) { \ -- SIMD_ALIGNED(uint8_t vin[128 * 2]); \ -- SIMD_ALIGNED(uint8_t vout[128]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -+ SIMD_ALIGNED(uint8_t temp[128 * 3]); \ -+ memset(temp, 0, 128 * 2); /* for msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(src_ptr, src_stride, dst_vu, n); \ - } \ -- memcpy(vin, src_ptr + (n >> UVSHIFT) * BPP, SS(r, UVSHIFT) * BPP); \ -- memcpy(vin + 128, src_ptr + src_stride + (n >> UVSHIFT) * BPP, \ -+ memcpy(temp, src_ptr + (n >> UVSHIFT) * BPP, SS(r, UVSHIFT) * BPP); \ -+ memcpy(temp + 128, src_ptr + src_stride + (n >> UVSHIFT) * BPP, \ - SS(r, UVSHIFT) * BPP); \ - if ((width & 1) && UVSHIFT == 0) { /* repeat last pixel for subsample */ \ -- memcpy(vin + SS(r, UVSHIFT) * BPP, vin + SS(r, UVSHIFT) * BPP - BPP, \ -+ memcpy(temp + SS(r, UVSHIFT) * BPP, temp + SS(r, UVSHIFT) * BPP - BPP, \ - BPP); \ -- memcpy(vin + 128 + SS(r, UVSHIFT) * BPP, \ -- vin + 128 + SS(r, UVSHIFT) * BPP - BPP, BPP); \ -+ memcpy(temp + 128 + SS(r, UVSHIFT) * BPP, \ -+ temp + 128 + SS(r, UVSHIFT) * BPP - BPP, BPP); \ - } \ -- ANY_SIMD(vin, 128, vout, MASK + 1); \ -- memcpy(dst_vu + (n >> 1) * 2, vout, SS(r, 1) * 2); \ -+ ANY_SIMD(temp, 128, temp + 256, MASK + 1); \ -+ memcpy(dst_vu + (n >> 1) * 2, temp + 256, SS(r, 1) * 2); \ - } - - #ifdef HAS_AYUVTOVUROW_NEON - ANY11S(AYUVToUVRow_Any_NEON, AYUVToUVRow_NEON, 0, 4, 15) - ANY11S(AYUVToVURow_Any_NEON, AYUVToVURow_NEON, 0, 4, 15) - #endif --#ifdef HAS_AYUVTOUVROW_SVE2 --ANY11S(AYUVToUVRow_Any_SVE2, AYUVToUVRow_SVE2, 0, 4, 1) --#endif --#ifdef HAS_AYUVTOVUROW_SVE2 --ANY11S(AYUVToVURow_Any_SVE2, AYUVToVURow_SVE2, 0, 4, 1) --#endif - #undef ANY11S - - #define ANYDETILE(NAMEANY, ANY_SIMD, T, BPP, MASK) \ - void NAMEANY(const T* src, ptrdiff_t src_tile_stride, T* dst, int width) { \ -- SIMD_ALIGNED(T vin[16]); \ -- SIMD_ALIGNED(T vout[16]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -+ SIMD_ALIGNED(T temp[16 * 2]); \ -+ memset(temp, 0, 16 * BPP); /* for msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(src, src_tile_stride, dst, n); \ - } \ -- memcpy(vin, src + (n / 16) * src_tile_stride, r * BPP); \ -- ANY_SIMD(vin, src_tile_stride, vout, MASK + 1); \ -- memcpy(dst + n, vout, r * BPP); \ -+ memcpy(temp, src + (n / 16) * src_tile_stride, r * BPP); \ -+ ANY_SIMD(temp, src_tile_stride, temp + 16, MASK + 1); \ -+ memcpy(dst + n, temp + 16, r * BPP); \ - } - - #ifdef HAS_DETILEROW_NEON -@@ -2485,22 +2311,20 @@ ANYDETILE(DetileRow_16_Any_SSE2, DetileR - ANYDETILE(DetileRow_16_Any_AVX, DetileRow_16_AVX, uint16_t, 2, 15) - #endif - --// DetileSplitUVRow width is in bytes - #define ANYDETILESPLITUV(NAMEANY, ANY_SIMD, MASK) \ - void NAMEANY(const uint8_t* src_uv, ptrdiff_t src_tile_stride, \ - uint8_t* dst_u, uint8_t* dst_v, int width) { \ -- SIMD_ALIGNED(uint8_t vin[16]); \ -- SIMD_ALIGNED(uint8_t vout[8 * 2]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -+ SIMD_ALIGNED(uint8_t temp[16 * 2]); \ -+ memset(temp, 0, 16 * 2); /* for msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(src_uv, src_tile_stride, dst_u, dst_v, n); \ - } \ -- memcpy(vin, src_uv + (n / 16) * src_tile_stride, r); \ -- ANY_SIMD(vin, src_tile_stride, vout, vout + 8, r); \ -- memcpy(dst_u + n / 2, vout, (r + 1) / 2); \ -- memcpy(dst_v + n / 2, vout + 8, (r + 1) / 2); \ -+ memcpy(temp, src_uv + (n / 16) * src_tile_stride, r); \ -+ ANY_SIMD(temp, src_tile_stride, temp + 16, temp + 24, r); \ -+ memcpy(dst_u + n / 2, temp + 16, (r + 1) / 2); \ -+ memcpy(dst_v + n / 2, temp + 24, (r + 1) / 2); \ - } - - #ifdef HAS_DETILESPLITUVROW_NEON -@@ -2514,19 +2338,19 @@ ANYDETILESPLITUV(DetileSplitUVRow_Any_SS - void NAMEANY(const uint8_t* src_y, ptrdiff_t src_y_tile_stride, \ - const uint8_t* src_uv, ptrdiff_t src_uv_tile_stride, \ - uint8_t* dst_yuy2, int width) { \ -- SIMD_ALIGNED(uint8_t vin[16 * 2]); \ -- SIMD_ALIGNED(uint8_t vout[16 * 2]); \ -- memset(vin, 0, sizeof(vin)); /* for msan */ \ -+ SIMD_ALIGNED(uint8_t temp[16 * 4]); \ -+ memset(temp, 0, 16 * 4); /* for msan */ \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANY_SIMD(src_y, src_y_tile_stride, src_uv, src_uv_tile_stride, dst_yuy2, \ - n); \ - } \ -- memcpy(vin, src_y + (n / 16) * src_y_tile_stride, r); \ -- memcpy(vin + 16, src_uv + (n / 16) * src_uv_tile_stride, r); \ -- ANY_SIMD(vin, src_y_tile_stride, vin + 16, src_uv_tile_stride, vout, r); \ -- memcpy(dst_yuy2 + 2 * n, vout, 2 * r); \ -+ memcpy(temp, src_y + (n / 16) * src_y_tile_stride, r); \ -+ memcpy(temp + 16, src_uv + (n / 16) * src_uv_tile_stride, r); \ -+ ANY_SIMD(temp, src_y_tile_stride, temp + 16, src_uv_tile_stride, \ -+ temp + 32, r); \ -+ memcpy(dst_yuy2 + 2 * n, temp + 32, 2 * r); \ - } - - #ifdef HAS_DETILETOYUY2_NEON -diff --git a/media/libyuv/libyuv/source/row_common.cc b/media/libyuv/libyuv/source/row_common.cc ---- a/media/libyuv/libyuv/source/row_common.cc -+++ b/media/libyuv/libyuv/source/row_common.cc -@@ -48,6 +48,7 @@ extern "C" { - defined(__i386__) || defined(_M_IX86)) - #define LIBYUV_ARGBTOUV_PAVGB 1 - #define LIBYUV_RGBTOU_TRUNCATE 1 -+#define LIBYUV_ATTENUATE_DUP 1 - #endif - #if defined(LIBYUV_BIT_EXACT) - #define LIBYUV_UNATTENUATE_DUP 1 -@@ -281,54 +282,6 @@ void AR30ToAB30Row_C(const uint8_t* src_ - } - } - --void ARGBToABGRRow_C(const uint8_t* src_argb, uint8_t* dst_abgr, int width) { -- int x; -- for (x = 0; x < width; ++x) { -- uint8_t b = src_argb[0]; -- uint8_t g = src_argb[1]; -- uint8_t r = src_argb[2]; -- uint8_t a = src_argb[3]; -- dst_abgr[0] = r; -- dst_abgr[1] = g; -- dst_abgr[2] = b; -- dst_abgr[3] = a; -- dst_abgr += 4; -- src_argb += 4; -- } --} -- --void ARGBToBGRARow_C(const uint8_t* src_argb, uint8_t* dst_bgra, int width) { -- int x; -- for (x = 0; x < width; ++x) { -- uint8_t b = src_argb[0]; -- uint8_t g = src_argb[1]; -- uint8_t r = src_argb[2]; -- uint8_t a = src_argb[3]; -- dst_bgra[0] = a; -- dst_bgra[1] = r; -- dst_bgra[2] = g; -- dst_bgra[3] = b; -- dst_bgra += 4; -- src_argb += 4; -- } --} -- --void ARGBToRGBARow_C(const uint8_t* src_argb, uint8_t* dst_rgba, int width) { -- int x; -- for (x = 0; x < width; ++x) { -- uint8_t b = src_argb[0]; -- uint8_t g = src_argb[1]; -- uint8_t r = src_argb[2]; -- uint8_t a = src_argb[3]; -- dst_rgba[0] = a; -- dst_rgba[1] = b; -- dst_rgba[2] = g; -- dst_rgba[3] = r; -- dst_rgba += 4; -- src_argb += 4; -- } --} -- - void ARGBToRGB24Row_C(const uint8_t* src_argb, uint8_t* dst_rgb, int width) { - int x; - for (x = 0; x < width; ++x) { -@@ -357,22 +310,6 @@ void ARGBToRAWRow_C(const uint8_t* src_a - } - } - --void RGBAToARGBRow_C(const uint8_t* src_rgba, uint8_t* dst_argb, int width) { -- int x; -- for (x = 0; x < width; ++x) { -- uint8_t a = src_rgba[0]; -- uint8_t b = src_rgba[1]; -- uint8_t g = src_rgba[2]; -- uint8_t r = src_rgba[3]; -- dst_argb[0] = b; -- dst_argb[1] = g; -- dst_argb[2] = r; -- dst_argb[3] = a; -- dst_argb += 4; -- src_rgba += 4; -- } --} -- - void ARGBToRGB565Row_C(const uint8_t* src_argb, uint8_t* dst_rgb, int width) { - int x; - for (x = 0; x < width - 1; x += 2) { -@@ -405,7 +342,7 @@ void ARGBToRGB565Row_C(const uint8_t* sr - // or the upper byte for big endian. - void ARGBToRGB565DitherRow_C(const uint8_t* src_argb, - uint8_t* dst_rgb, -- uint32_t dither4, -+ const uint32_t dither4, - int width) { - int x; - for (x = 0; x < width - 1; x += 2) { -@@ -492,12 +429,12 @@ void ARGBToARGB4444Row_C(const uint8_t* - void ABGRToAR30Row_C(const uint8_t* src_abgr, uint8_t* dst_ar30, int width) { - int x; - for (x = 0; x < width; ++x) { -- uint32_t r0 = (src_abgr[0] >> 6) | ((uint32_t)(src_abgr[0]) << 2); -+ uint32_t b0 = (src_abgr[0] >> 6) | ((uint32_t)(src_abgr[0]) << 2); - uint32_t g0 = (src_abgr[1] >> 6) | ((uint32_t)(src_abgr[1]) << 2); -- uint32_t b0 = (src_abgr[2] >> 6) | ((uint32_t)(src_abgr[2]) << 2); -+ uint32_t r0 = (src_abgr[2] >> 6) | ((uint32_t)(src_abgr[2]) << 2); - uint32_t a0 = (src_abgr[3] >> 6); - *(uint32_t*)(dst_ar30) = -- STATIC_CAST(uint32_t, b0 | (g0 << 10) | (r0 << 20) | (a0 << 30)); -+ STATIC_CAST(uint32_t, r0 | (g0 << 10) | (b0 << 20) | (a0 << 30)); - dst_ar30 += 4; - src_abgr += 4; - } -@@ -581,22 +518,6 @@ void AB64ToARGBRow_C(const uint16_t* src - } - } - --void AR64ToAB64Row_C(const uint16_t* src_ar64, uint16_t* dst_ab64, int width) { -- int x; -- for (x = 0; x < width; ++x) { -- uint16_t b = src_ar64[0]; -- uint16_t g = src_ar64[1]; -- uint16_t r = src_ar64[2]; -- uint16_t a = src_ar64[3]; -- dst_ab64[0] = r; -- dst_ab64[1] = g; -- dst_ab64[2] = b; -- dst_ab64[3] = a; -- dst_ab64 += 4; -- src_ar64 += 4; -- } --} -- - // TODO(fbarchard): Make shuffle compatible with SIMD versions - void AR64ShuffleRow_C(const uint8_t* src_ar64, - uint8_t* dst_ar64, -@@ -1563,7 +1484,7 @@ void J400ToARGBRow_C(const uint8_t* src_ - - // clang-format off - --#if defined(__aarch64__) || defined(__arm__) || defined(__riscv) -+#if defined(__aarch64__) || defined(__arm__) - // Bias values include subtract 128 from U and V, bias from Y and rounding. - // For B and R bias is negative. For G bias is positive. - #define YUVCONSTANTSBODY(YG, YB, UB, UG, VG, VR) \ -@@ -1759,7 +1680,7 @@ MAKEYUVCONSTANTS(V2020, YG, YB, UB, UG, - - #undef MAKEYUVCONSTANTS - --#if defined(__aarch64__) || defined(__arm__) || defined(__riscv) -+#if defined(__aarch64__) || defined(__arm__) - #define LOAD_YUV_CONSTANTS \ - int ub = yuvconstants->kUVCoeff[0]; \ - int vr = yuvconstants->kUVCoeff[1]; \ -@@ -1947,7 +1868,7 @@ static __inline void YPixel(uint8_t y, - uint8_t* g, - uint8_t* r, - const struct YuvConstants* yuvconstants) { --#if defined(__aarch64__) || defined(__arm__) || defined(__riscv) -+#if defined(__aarch64__) || defined(__arm__) - int yg = yuvconstants->kRGBCoeffBias[0]; - int ygb = yuvconstants->kRGBCoeffBias[4]; - #else -@@ -1955,10 +1876,9 @@ static __inline void YPixel(uint8_t y, - int yg = yuvconstants->kYToRgb[0]; - #endif - uint32_t y1 = (uint32_t)(y * 0x0101 * yg) >> 16; -- uint8_t b8 = STATIC_CAST(uint8_t, Clamp(((int32_t)(y1) + ygb) >> 6)); -- *b = b8; -- *g = b8; -- *r = b8; -+ *b = STATIC_CAST(uint8_t, Clamp(((int32_t)(y1) + ygb) >> 6)); -+ *g = STATIC_CAST(uint8_t, Clamp(((int32_t)(y1) + ygb) >> 6)); -+ *r = STATIC_CAST(uint8_t, Clamp(((int32_t)(y1) + ygb) >> 6)); - } - - void I444ToARGBRow_C(const uint8_t* src_y, -@@ -2948,21 +2868,24 @@ void DetileToYUY2_C(const uint8_t* src_y - // Unpack MT2T into tiled P010 64 pixels at a time. MT2T's bitstream is encoded - // in 80 byte blocks representing 64 pixels each. The first 16 bytes of the - // block contain all of the lower 2 bits of each pixel packed together, and the --// next 64 bytes represent all the upper 8 bits of the pixel. The lower bits are --// packed into 1x4 blocks, whereas the upper bits are packed in normal raster --// order. -+// next 64 bytes represent all the upper 8 bits of the pixel. - void UnpackMT2T_C(const uint8_t* src, uint16_t* dst, size_t size) { - for (size_t i = 0; i < size; i += 80) { - const uint8_t* src_lower_bits = src; - const uint8_t* src_upper_bits = src + 16; - -- for (int j = 0; j < 4; j++) { -- for (int k = 0; k < 16; k++) { -- *dst++ = ((src_lower_bits[k] >> (j * 2)) & 0x3) << 6 | -- (uint16_t)*src_upper_bits << 8 | -- (uint16_t)*src_upper_bits >> 2; -- src_upper_bits++; -- } -+ for (int j = 0; j < 16; j++) { -+ uint8_t lower_bits = src_lower_bits[j]; -+ *dst++ = (lower_bits & 0x03) << 6 | (uint16_t)src_upper_bits[j * 4] << 8 | -+ (uint16_t)src_upper_bits[j * 4] >> 2; -+ *dst++ = (lower_bits & 0x0C) << 4 | -+ (uint16_t)src_upper_bits[j * 4 + 1] << 8 | -+ (uint16_t)src_upper_bits[j * 4 + 1] >> 2; -+ *dst++ = (lower_bits & 0x30) << 2 | -+ (uint16_t)src_upper_bits[j * 4 + 2] << 8 | -+ (uint16_t)src_upper_bits[j * 4 + 2] >> 2; -+ *dst++ = (lower_bits & 0xC0) | (uint16_t)src_upper_bits[j * 4 + 3] << 8 | -+ (uint16_t)src_upper_bits[j * 4 + 3] >> 2; - } - - src += 80; -@@ -3449,7 +3372,12 @@ void BlendPlaneRow_C(const uint8_t* src0 - } - #undef UBLEND - --#define ATTENUATE(f, a) (f * a + 255) >> 8 -+#if LIBYUV_ATTENUATE_DUP -+// This code mimics the SSSE3 version for better testability. -+#define ATTENUATE(f, a) (a | (a << 8)) * (f | (f << 8)) >> 24 -+#else -+#define ATTENUATE(f, a) (f * a + 128) >> 8 -+#endif - - // Multiply source RGB by alpha and store to destination. - void ARGBAttenuateRow_C(const uint8_t* src_argb, uint8_t* dst_argb, int width) { -@@ -4619,4 +4547,4 @@ void HalfMergeUVRow_C(const uint8_t* src - #ifdef __cplusplus - } // extern "C" - } // namespace libyuv --#endif -+#endif -\ No newline at end of file -diff --git a/media/libyuv/libyuv/source/row_gcc.cc b/media/libyuv/libyuv/source/row_gcc.cc ---- a/media/libyuv/libyuv/source/row_gcc.cc -+++ b/media/libyuv/libyuv/source/row_gcc.cc -@@ -17,6 +17,8 @@ extern "C" { - // This module is for GCC x86 and x64. - #if !defined(LIBYUV_DISABLE_X86) && (defined(__x86_64__) || defined(__i386__)) - -+#include -+ - #if defined(HAS_ARGBTOYROW_SSSE3) || defined(HAS_ARGBGRAYROW_SSSE3) - - // Constants for ARGB -@@ -137,20 +139,24 @@ static const uvec8 kShuffleMaskARGBToRGB - 0u, 1u, 2u, 4u, 5u, 6u, 8u, 9u, 128u, 128u, 128u, 128u, 10u, 12u, 13u, 14u}; - - // YUY2 shuf 16 Y to 32 Y. --static const vec8 kShuffleYUY2Y = {0, 0, 2, 2, 4, 4, 6, 6, -- 8, 8, 10, 10, 12, 12, 14, 14}; -+static const lvec8 kShuffleYUY2Y = {0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, -+ 10, 12, 12, 14, 14, 0, 0, 2, 2, 4, 4, -+ 6, 6, 8, 8, 10, 10, 12, 12, 14, 14}; - - // YUY2 shuf 8 UV to 16 UV. --static const vec8 kShuffleYUY2UV = {1, 3, 1, 3, 5, 7, 5, 7, -- 9, 11, 9, 11, 13, 15, 13, 15}; -+static const lvec8 kShuffleYUY2UV = {1, 3, 1, 3, 5, 7, 5, 7, 9, 11, 9, -+ 11, 13, 15, 13, 15, 1, 3, 1, 3, 5, 7, -+ 5, 7, 9, 11, 9, 11, 13, 15, 13, 15}; - - // UYVY shuf 16 Y to 32 Y. --static const vec8 kShuffleUYVYY = {1, 1, 3, 3, 5, 5, 7, 7, -- 9, 9, 11, 11, 13, 13, 15, 15}; -+static const lvec8 kShuffleUYVYY = {1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, -+ 11, 13, 13, 15, 15, 1, 1, 3, 3, 5, 5, -+ 7, 7, 9, 9, 11, 11, 13, 13, 15, 15}; - - // UYVY shuf 8 UV to 16 UV. --static const vec8 kShuffleUYVYUV = {0, 2, 0, 2, 4, 6, 4, 6, -- 8, 10, 8, 10, 12, 14, 12, 14}; -+static const lvec8 kShuffleUYVYUV = {0, 2, 0, 2, 4, 6, 4, 6, 8, 10, 8, -+ 10, 12, 14, 12, 14, 0, 2, 0, 2, 4, 6, -+ 4, 6, 8, 10, 8, 10, 12, 14, 12, 14}; - - // NV21 shuf 8 VU to 16 UV. - static const lvec8 kShuffleNV21 = { -@@ -161,7 +167,7 @@ static const lvec8 kShuffleNV21 = { - - #ifdef HAS_J400TOARGBROW_SSE2 - void J400ToARGBRow_SSE2(const uint8_t* src_y, uint8_t* dst_argb, int width) { -- asm volatile ( -+ asm volatile( - "pcmpeqb %%xmm5,%%xmm5 \n" - "pslld $0x18,%%xmm5 \n" - -@@ -192,7 +198,7 @@ void J400ToARGBRow_SSE2(const uint8_t* s - void RGB24ToARGBRow_SSSE3(const uint8_t* src_rgb24, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "pcmpeqb %%xmm5,%%xmm5 \n" // 0xff000000 - "pslld $0x18,%%xmm5 \n" - "movdqa %3,%%xmm4 \n" -@@ -230,7 +236,7 @@ void RGB24ToARGBRow_SSSE3(const uint8_t* - } - - void RAWToARGBRow_SSSE3(const uint8_t* src_raw, uint8_t* dst_argb, int width) { -- asm volatile ( -+ asm volatile( - "pcmpeqb %%xmm5,%%xmm5 \n" // 0xff000000 - "pslld $0x18,%%xmm5 \n" - "movdqa %3,%%xmm4 \n" -@@ -269,7 +275,7 @@ void RAWToARGBRow_SSSE3(const uint8_t* s - - // Same code as RAWToARGB with different shuffler and A in low bits - void RAWToRGBARow_SSSE3(const uint8_t* src_raw, uint8_t* dst_rgba, int width) { -- asm volatile ( -+ asm volatile( - "pcmpeqb %%xmm5,%%xmm5 \n" // 0x000000ff - "psrld $0x18,%%xmm5 \n" - "movdqa %3,%%xmm4 \n" -@@ -309,7 +315,7 @@ void RAWToRGBARow_SSSE3(const uint8_t* s - void RAWToRGB24Row_SSSE3(const uint8_t* src_raw, - uint8_t* dst_rgb24, - int width) { -- asm volatile ( -+ asm volatile( - "movdqa %3,%%xmm3 \n" - "movdqa %4,%%xmm4 \n" - "movdqa %5,%%xmm5 \n" -@@ -339,7 +345,7 @@ void RAWToRGB24Row_SSSE3(const uint8_t* - } - - void RGB565ToARGBRow_SSE2(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - "mov $0x1080108,%%eax \n" - "movd %%eax,%%xmm5 \n" - "pshufd $0x0,%%xmm5,%%xmm5 \n" -@@ -387,7 +393,7 @@ void RGB565ToARGBRow_SSE2(const uint8_t* - } - - void ARGB1555ToARGBRow_SSE2(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - "mov $0x1080108,%%eax \n" - "movd %%eax,%%xmm5 \n" - "pshufd $0x0,%%xmm5,%%xmm5 \n" -@@ -438,7 +444,7 @@ void ARGB1555ToARGBRow_SSE2(const uint8_ - } - - void ARGB4444ToARGBRow_SSE2(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - "mov $0xf0f0f0f,%%eax \n" - "movd %%eax,%%xmm4 \n" - "pshufd $0x0,%%xmm4,%%xmm4 \n" -@@ -475,7 +481,8 @@ void ARGB4444ToARGBRow_SSE2(const uint8_ - } - - void ARGBToRGB24Row_SSSE3(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( -+ - "movdqa %3,%%xmm6 \n" - - LABELALIGN -@@ -513,7 +520,8 @@ void ARGBToRGB24Row_SSSE3(const uint8_t* - } - - void ARGBToRAWRow_SSSE3(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( -+ - "movdqa %3,%%xmm6 \n" - - LABELALIGN -@@ -555,7 +563,7 @@ void ARGBToRAWRow_SSSE3(const uint8_t* s - static const lvec32 kPermdRGB24_AVX = {0, 1, 2, 4, 5, 6, 3, 7}; - - void ARGBToRGB24Row_AVX2(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - "vbroadcastf128 %3,%%ymm6 \n" - "vmovdqa %4,%%ymm7 \n" - -@@ -615,7 +623,7 @@ static const ulvec8 kPermARGBToRGB24_2 = - 50u, 52u, 53u, 54u, 56u, 57u, 58u, 60u, 61u, 62u}; - - void ARGBToRGB24Row_AVX512VBMI(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - "vmovdqa %3,%%ymm5 \n" - "vmovdqa %4,%%ymm6 \n" - "vmovdqa %5,%%ymm7 \n" -@@ -649,7 +657,7 @@ void ARGBToRGB24Row_AVX512VBMI(const uin - - #ifdef HAS_ARGBTORAWROW_AVX2 - void ARGBToRAWRow_AVX2(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - "vbroadcastf128 %3,%%ymm6 \n" - "vmovdqa %4,%%ymm7 \n" - -@@ -694,7 +702,7 @@ void ARGBToRAWRow_AVX2(const uint8_t* sr - #endif - - void ARGBToRGB565Row_SSE2(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - "pcmpeqb %%xmm3,%%xmm3 \n" - "psrld $0x1b,%%xmm3 \n" - "pcmpeqb %%xmm4,%%xmm4 \n" -@@ -732,9 +740,9 @@ void ARGBToRGB565Row_SSE2(const uint8_t* - - void ARGBToRGB565DitherRow_SSE2(const uint8_t* src, - uint8_t* dst, -- uint32_t dither4, -+ const uint32_t dither4, - int width) { -- asm volatile ( -+ asm volatile( - "movd %3,%%xmm6 \n" - "punpcklbw %%xmm6,%%xmm6 \n" - "movdqa %%xmm6,%%xmm7 \n" -@@ -780,9 +788,9 @@ void ARGBToRGB565DitherRow_SSE2(const ui - #ifdef HAS_ARGBTORGB565DITHERROW_AVX2 - void ARGBToRGB565DitherRow_AVX2(const uint8_t* src, - uint8_t* dst, -- uint32_t dither4, -+ const uint32_t dither4, - int width) { -- asm volatile ( -+ asm volatile( - "vbroadcastss %3,%%xmm6 \n" - "vpunpcklbw %%xmm6,%%xmm6,%%xmm6 \n" - "vpermq $0xd8,%%ymm6,%%ymm6 \n" -@@ -824,7 +832,7 @@ void ARGBToRGB565DitherRow_AVX2(const ui - #endif // HAS_ARGBTORGB565DITHERROW_AVX2 - - void ARGBToARGB1555Row_SSE2(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - "pcmpeqb %%xmm4,%%xmm4 \n" - "psrld $0x1b,%%xmm4 \n" - "movdqa %%xmm4,%%xmm5 \n" -@@ -865,7 +873,7 @@ void ARGBToARGB1555Row_SSE2(const uint8_ - } - - void ARGBToARGB4444Row_SSE2(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - "pcmpeqb %%xmm4,%%xmm4 \n" - "psllw $0xc,%%xmm4 \n" - "movdqa %%xmm4,%%xmm3 \n" -@@ -928,7 +936,7 @@ static const uint32_t kMaskAG10 = 0xc000 - static const uint32_t kMulAG10 = 64 * 65536 + 1028; - - void ARGBToAR30Row_SSSE3(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - "movdqa %3,%%xmm2 \n" // shuffler for RB - "movd %4,%%xmm3 \n" // multipler for RB - "movd %5,%%xmm4 \n" // mask for R10 B10 -@@ -967,7 +975,7 @@ void ARGBToAR30Row_SSSE3(const uint8_t* - } - - void ABGRToAR30Row_SSSE3(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - "movdqa %3,%%xmm2 \n" // shuffler for RB - "movd %4,%%xmm3 \n" // multipler for RB - "movd %5,%%xmm4 \n" // mask for R10 B10 -@@ -1007,7 +1015,7 @@ void ABGRToAR30Row_SSSE3(const uint8_t* - - #ifdef HAS_ARGBTOAR30ROW_AVX2 - void ARGBToAR30Row_AVX2(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - "vbroadcastf128 %3,%%ymm2 \n" // shuffler for RB - "vbroadcastss %4,%%ymm3 \n" // multipler for RB - "vbroadcastss %5,%%ymm4 \n" // mask for R10 B10 -@@ -1044,7 +1052,7 @@ void ARGBToAR30Row_AVX2(const uint8_t* s - - #ifdef HAS_ABGRTOAR30ROW_AVX2 - void ABGRToAR30Row_AVX2(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - "vbroadcastf128 %3,%%ymm2 \n" // shuffler for RB - "vbroadcastss %4,%%ymm3 \n" // multipler for RB - "vbroadcastss %5,%%ymm4 \n" // mask for R10 B10 -@@ -1090,7 +1098,9 @@ static const uvec8 kShuffleARGBToAB64Hi - void ARGBToAR64Row_SSSE3(const uint8_t* src_argb, - uint16_t* dst_ar64, - int width) { -- asm volatile (LABELALIGN -+ asm volatile( -+ -+ LABELALIGN - "1: \n" - "movdqu (%0),%%xmm0 \n" - "movdqa %%xmm0,%%xmm1 \n" -@@ -1105,14 +1115,15 @@ void ARGBToAR64Row_SSSE3(const uint8_t* - : "+r"(src_argb), // %0 - "+r"(dst_ar64), // %1 - "+r"(width) // %2 -- ::"memory", -- "cc", "xmm0", "xmm1"); -+ : -+ : "memory", "cc", "xmm0", "xmm1"); - } - - void ARGBToAB64Row_SSSE3(const uint8_t* src_argb, - uint16_t* dst_ab64, - int width) { -- asm volatile ( -+ asm volatile( -+ - "movdqa %3,%%xmm2 \n" - "movdqa %4,%%xmm3 \n" LABELALIGN - "1: \n" -@@ -1137,7 +1148,9 @@ void ARGBToAB64Row_SSSE3(const uint8_t* - void AR64ToARGBRow_SSSE3(const uint16_t* src_ar64, - uint8_t* dst_argb, - int width) { -- asm volatile (LABELALIGN -+ asm volatile( -+ -+ LABELALIGN - "1: \n" - "movdqu (%0),%%xmm0 \n" - "movdqu 0x10(%0),%%xmm1 \n" -@@ -1152,17 +1165,16 @@ void AR64ToARGBRow_SSSE3(const uint16_t* - : "+r"(src_ar64), // %0 - "+r"(dst_argb), // %1 - "+r"(width) // %2 -- ::"memory", -- "cc", "xmm0", "xmm1"); -+ : -+ : "memory", "cc", "xmm0", "xmm1"); - } - - void AB64ToARGBRow_SSSE3(const uint16_t* src_ab64, - uint8_t* dst_argb, - int width) { -- asm volatile ( -- "movdqa %3,%%xmm2 \n" -- -- LABELALIGN -+ asm volatile( -+ -+ "movdqa %3,%%xmm2 \n" LABELALIGN - "1: \n" - "movdqu (%0),%%xmm0 \n" - "movdqu 0x10(%0),%%xmm1 \n" -@@ -1186,7 +1198,9 @@ void AB64ToARGBRow_SSSE3(const uint16_t* - void ARGBToAR64Row_AVX2(const uint8_t* src_argb, - uint16_t* dst_ar64, - int width) { -- asm volatile (LABELALIGN -+ asm volatile( -+ -+ LABELALIGN - "1: \n" - "vmovdqu (%0),%%ymm0 \n" - "vpermq $0xd8,%%ymm0,%%ymm0 \n" -@@ -1202,8 +1216,8 @@ void ARGBToAR64Row_AVX2(const uint8_t* s - : "+r"(src_argb), // %0 - "+r"(dst_ar64), // %1 - "+r"(width) // %2 -- ::"memory", -- "cc", "xmm0", "xmm1"); -+ : -+ : "memory", "cc", "xmm0", "xmm1"); - } - #endif - -@@ -1211,7 +1225,8 @@ void ARGBToAR64Row_AVX2(const uint8_t* s - void ARGBToAB64Row_AVX2(const uint8_t* src_argb, - uint16_t* dst_ab64, - int width) { -- asm volatile ( -+ asm volatile( -+ - "vbroadcastf128 %3,%%ymm2 \n" - "vbroadcastf128 %4,%%ymm3 \n" LABELALIGN - "1: \n" -@@ -1239,7 +1254,9 @@ void ARGBToAB64Row_AVX2(const uint8_t* s - void AR64ToARGBRow_AVX2(const uint16_t* src_ar64, - uint8_t* dst_argb, - int width) { -- asm volatile (LABELALIGN -+ asm volatile( -+ -+ LABELALIGN - "1: \n" - "vmovdqu (%0),%%ymm0 \n" - "vmovdqu 0x20(%0),%%ymm1 \n" -@@ -1256,8 +1273,8 @@ void AR64ToARGBRow_AVX2(const uint16_t* - : "+r"(src_ar64), // %0 - "+r"(dst_argb), // %1 - "+r"(width) // %2 -- ::"memory", -- "cc", "xmm0", "xmm1"); -+ : -+ : "memory", "cc", "xmm0", "xmm1"); - } - #endif - -@@ -1265,7 +1282,8 @@ void AR64ToARGBRow_AVX2(const uint16_t* - void AB64ToARGBRow_AVX2(const uint16_t* src_ab64, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( -+ - "vbroadcastf128 %3,%%ymm2 \n" LABELALIGN - "1: \n" - "vmovdqu (%0),%%ymm0 \n" -@@ -1289,6 +1307,8 @@ void AB64ToARGBRow_AVX2(const uint16_t* - } - #endif - -+// clang-format off -+ - // TODO(mraptis): Consider passing R, G, B multipliers as parameter. - // round parameter is register containing value to add before shift. - #define RGBTOY(round) \ -@@ -1313,10 +1333,8 @@ void AB64ToARGBRow_AVX2(const uint16_t* - "phaddw %%xmm0,%%xmm6 \n" \ - "phaddw %%xmm2,%%xmm1 \n" \ - "prefetcht0 1280(%0) \n" \ -- "paddw %%" #round \ -- ",%%xmm6 \n" \ -- "paddw %%" #round \ -- ",%%xmm1 \n" \ -+ "paddw %%" #round ",%%xmm6 \n" \ -+ "paddw %%" #round ",%%xmm1 \n" \ - "psrlw $0x8,%%xmm6 \n" \ - "psrlw $0x8,%%xmm1 \n" \ - "packuswb %%xmm1,%%xmm6 \n" \ -@@ -1343,10 +1361,8 @@ void AB64ToARGBRow_AVX2(const uint16_t* - "vphaddw %%ymm1,%%ymm0,%%ymm0 \n" /* mutates. */ \ - "vphaddw %%ymm3,%%ymm2,%%ymm2 \n" \ - "prefetcht0 1280(%0) \n" \ -- "vpaddw %%" #round \ -- ",%%ymm0,%%ymm0 \n" /* Add .5 for rounding. */ \ -- "vpaddw %%" #round \ -- ",%%ymm2,%%ymm2 \n" \ -+ "vpaddw %%" #round ",%%ymm0,%%ymm0 \n" /* Add .5 for rounding. */ \ -+ "vpaddw %%" #round ",%%ymm2,%%ymm2 \n" \ - "vpsrlw $0x8,%%ymm0,%%ymm0 \n" \ - "vpsrlw $0x8,%%ymm2,%%ymm2 \n" \ - "vpackuswb %%ymm2,%%ymm0,%%ymm0 \n" /* mutates. */ \ -@@ -1357,10 +1373,12 @@ void AB64ToARGBRow_AVX2(const uint16_t* - "jg 1b \n" \ - "vzeroupper \n" - -+// clang-format on -+ - #ifdef HAS_ARGBTOYROW_SSSE3 - // Convert 16 ARGB pixels (64 bytes) to 16 Y values. - void ARGBToYRow_SSSE3(const uint8_t* src_argb, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "movdqa %3,%%xmm4 \n" - "movdqa %4,%%xmm5 \n" - "movdqa %5,%%xmm7 \n" -@@ -1381,7 +1399,7 @@ void ARGBToYRow_SSSE3(const uint8_t* src - // Convert 16 ARGB pixels (64 bytes) to 16 YJ values. - // Same as ARGBToYRow but different coefficients, no add 16. - void ARGBToYJRow_SSSE3(const uint8_t* src_argb, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "movdqa %3,%%xmm4 \n" - "movdqa %4,%%xmm5 \n" - -@@ -1399,7 +1417,7 @@ void ARGBToYJRow_SSSE3(const uint8_t* sr - // Convert 16 ABGR pixels (64 bytes) to 16 YJ values. - // Same as ABGRToYRow but different coefficients, no add 16. - void ABGRToYJRow_SSSE3(const uint8_t* src_abgr, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "movdqa %3,%%xmm4 \n" - "movdqa %4,%%xmm5 \n" - -@@ -1417,7 +1435,7 @@ void ABGRToYJRow_SSSE3(const uint8_t* sr - // Convert 16 ARGB pixels (64 bytes) to 16 YJ values. - // Same as ARGBToYRow but different coefficients, no add 16. - void RGBAToYJRow_SSSE3(const uint8_t* src_rgba, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "movdqa %3,%%xmm4 \n" - "movdqa %4,%%xmm5 \n" - -@@ -1441,7 +1459,7 @@ static const lvec32 kPermdARGBToY_AVX = - - // Convert 32 ARGB pixels (128 bytes) to 32 Y values. - void ARGBToYRow_AVX2(const uint8_t* src_argb, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "vbroadcastf128 %3,%%ymm4 \n" - "vbroadcastf128 %4,%%ymm5 \n" - "vbroadcastf128 %5,%%ymm7 \n" -@@ -1462,7 +1480,7 @@ void ARGBToYRow_AVX2(const uint8_t* src_ - #ifdef HAS_ABGRTOYROW_AVX2 - // Convert 32 ABGR pixels (128 bytes) to 32 Y values. - void ABGRToYRow_AVX2(const uint8_t* src_abgr, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "vbroadcastf128 %3,%%ymm4 \n" - "vbroadcastf128 %4,%%ymm5 \n" - "vbroadcastf128 %5,%%ymm7 \n" -@@ -1483,7 +1501,7 @@ void ABGRToYRow_AVX2(const uint8_t* src_ - #ifdef HAS_ARGBTOYJROW_AVX2 - // Convert 32 ARGB pixels (128 bytes) to 32 Y values. - void ARGBToYJRow_AVX2(const uint8_t* src_argb, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "vbroadcastf128 %3,%%ymm4 \n" - "vbroadcastf128 %4,%%ymm5 \n" - "vmovdqu %5,%%ymm6 \n" LABELALIGN RGBTOY_AVX2( -@@ -1502,7 +1520,7 @@ void ARGBToYJRow_AVX2(const uint8_t* src - #ifdef HAS_ABGRTOYJROW_AVX2 - // Convert 32 ABGR pixels (128 bytes) to 32 Y values. - void ABGRToYJRow_AVX2(const uint8_t* src_abgr, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "vbroadcastf128 %3,%%ymm4 \n" - "vbroadcastf128 %4,%%ymm5 \n" - "vmovdqu %5,%%ymm6 \n" LABELALIGN RGBTOY_AVX2( -@@ -1521,7 +1539,7 @@ void ABGRToYJRow_AVX2(const uint8_t* src - #ifdef HAS_RGBATOYJROW_AVX2 - // Convert 32 ARGB pixels (128 bytes) to 32 Y values. - void RGBAToYJRow_AVX2(const uint8_t* src_rgba, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "vbroadcastf128 %3,%%ymm4 \n" - "vbroadcastf128 %4,%%ymm5 \n" - "vmovdqu %5,%%ymm6 \n" LABELALIGN RGBTOY_AVX2( -@@ -1542,7 +1560,7 @@ void ARGBToUVRow_SSSE3(const uint8_t* sr - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "movdqa %5,%%xmm3 \n" - "movdqa %6,%%xmm4 \n" - "movdqa %7,%%xmm5 \n" -@@ -1615,7 +1633,7 @@ void ARGBToUVRow_AVX2(const uint8_t* src - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "vbroadcastf128 %5,%%ymm5 \n" - "vbroadcastf128 %6,%%ymm6 \n" - "vbroadcastf128 %7,%%ymm7 \n" -@@ -1678,7 +1696,7 @@ void ABGRToUVRow_AVX2(const uint8_t* src - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "vbroadcastf128 %5,%%ymm5 \n" - "vbroadcastf128 %6,%%ymm6 \n" - "vbroadcastf128 %7,%%ymm7 \n" -@@ -1741,7 +1759,7 @@ void ARGBToUVJRow_AVX2(const uint8_t* sr - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "vbroadcastf128 %5,%%ymm5 \n" - "vbroadcastf128 %6,%%ymm6 \n" - "vbroadcastf128 %7,%%ymm7 \n" -@@ -1806,7 +1824,7 @@ void ABGRToUVJRow_AVX2(const uint8_t* sr - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "vbroadcastf128 %5,%%ymm5 \n" - "vbroadcastf128 %6,%%ymm6 \n" - "vbroadcastf128 %7,%%ymm7 \n" -@@ -1870,7 +1888,7 @@ void ARGBToUVJRow_SSSE3(const uint8_t* s - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "movdqa %5,%%xmm3 \n" - "movdqa %6,%%xmm4 \n" - "movdqa %7,%%xmm5 \n" -@@ -1936,7 +1954,7 @@ void ABGRToUVJRow_SSSE3(const uint8_t* s - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "movdqa %5,%%xmm3 \n" - "movdqa %6,%%xmm4 \n" - "movdqa %7,%%xmm5 \n" -@@ -2001,7 +2019,7 @@ void ARGBToUV444Row_SSSE3(const uint8_t* - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "movdqa %4,%%xmm3 \n" - "movdqa %5,%%xmm4 \n" - "movdqa %6,%%xmm5 \n" -@@ -2055,7 +2073,7 @@ void ARGBToUV444Row_SSSE3(const uint8_t* - #endif // HAS_ARGBTOUV444ROW_SSSE3 - - void BGRAToYRow_SSSE3(const uint8_t* src_bgra, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "movdqa %3,%%xmm4 \n" - "movdqa %4,%%xmm5 \n" - "movdqa %5,%%xmm7 \n" -@@ -2076,7 +2094,7 @@ void BGRAToUVRow_SSSE3(const uint8_t* sr - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "movdqa %5,%%xmm3 \n" - "movdqa %6,%%xmm4 \n" - "movdqa %7,%%xmm5 \n" -@@ -2135,7 +2153,7 @@ void BGRAToUVRow_SSSE3(const uint8_t* sr - } - - void ABGRToYRow_SSSE3(const uint8_t* src_abgr, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "movdqa %3,%%xmm4 \n" - "movdqa %4,%%xmm5 \n" - "movdqa %5,%%xmm7 \n" -@@ -2152,7 +2170,7 @@ void ABGRToYRow_SSSE3(const uint8_t* src - } - - void RGBAToYRow_SSSE3(const uint8_t* src_rgba, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "movdqa %3,%%xmm4 \n" - "movdqa %4,%%xmm5 \n" - "movdqa %5,%%xmm7 \n" -@@ -2173,7 +2191,7 @@ void ABGRToUVRow_SSSE3(const uint8_t* sr - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "movdqa %5,%%xmm3 \n" - "movdqa %6,%%xmm4 \n" - "movdqa %7,%%xmm5 \n" -@@ -2236,7 +2254,7 @@ void RGBAToUVRow_SSSE3(const uint8_t* sr - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "movdqa %5,%%xmm3 \n" - "movdqa %6,%%xmm4 \n" - "movdqa %7,%%xmm5 \n" -@@ -2451,25 +2469,21 @@ void RGBAToUVRow_SSSE3(const uint8_t* sr - "punpcklbw %%xmm4,%%xmm4 \n" \ - "lea 0x8(%[y_buf]),%[y_buf] \n" - --// Read 4 YUY2 with 8 Y and upsample 4 UV to 8 UV. --// xmm6 kShuffleYUY2Y, --// xmm7 kShuffleYUY2UV -+// Read 4 YUY2 with 8 Y and update 4 UV to 8 UV. - #define READYUY2 \ - "movdqu (%[yuy2_buf]),%%xmm4 \n" \ -- "lea 0x10(%[yuy2_buf]),%[yuy2_buf] \n" \ -- "movdqa %%xmm4,%%xmm3 \n" \ -- "pshufb %%xmm6,%%xmm4 \n" \ -- "pshufb %%xmm7,%%xmm3 \n" -- --// Read 4 UYVY with 8 Y and upsample 4 UV to 8 UV. --// xmm6 kShuffleUYVYY, --// xmm7 kShuffleUYVYUV -+ "pshufb %[kShuffleYUY2Y], %%xmm4 \n" \ -+ "movdqu (%[yuy2_buf]),%%xmm3 \n" \ -+ "pshufb %[kShuffleYUY2UV], %%xmm3 \n" \ -+ "lea 0x10(%[yuy2_buf]),%[yuy2_buf] \n" -+ -+// Read 4 UYVY with 8 Y and update 4 UV to 8 UV. - #define READUYVY \ - "movdqu (%[uyvy_buf]),%%xmm4 \n" \ -- "lea 0x10(%[uyvy_buf]),%[uyvy_buf] \n" \ -- "movdqa %%xmm4,%%xmm3 \n" \ -- "pshufb %%xmm6,%%xmm4 \n" \ -- "pshufb %%xmm7,%%xmm3 \n" -+ "pshufb %[kShuffleUYVYY], %%xmm4 \n" \ -+ "movdqu (%[uyvy_buf]),%%xmm3 \n" \ -+ "pshufb %[kShuffleUYVYUV], %%xmm3 \n" \ -+ "lea 0x10(%[uyvy_buf]),%[uyvy_buf] \n" - - // Read 4 UV from P210, upsample to 8 UV - #define READP210 \ -@@ -2626,7 +2640,7 @@ void OMITFP I444ToARGBRow_SSSE3(const ui - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "pcmpeqb %%xmm5,%%xmm5 \n" -@@ -2657,26 +2671,33 @@ void OMITFP I444AlphaToARGBRow_SSSE3(con - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile (YUVTORGB_SETUP( -- yuvconstants) "sub %[u_buf],%[v_buf] \n" -- -- LABELALIGN "1: \n" READYUVA444 -- YUVTORGB(yuvconstants) STOREARGB -+ // clang-format off -+ asm volatile ( -+ YUVTORGB_SETUP(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ -+ LABELALIGN -+ "1: \n" -+ READYUVA444 -+ YUVTORGB(yuvconstants) -+ STOREARGB - "subl $0x8,%[width] \n" - "jg 1b \n" -- : [y_buf] "+r"(y_buf), // %[y_buf] -- [u_buf] "+r"(u_buf), // %[u_buf] -- [v_buf] "+r"(v_buf), // %[v_buf] -- [a_buf] "+r"(a_buf), // %[a_buf] -- [dst_argb] "+r"(dst_argb), // %[dst_argb] -+ : [y_buf]"+r"(y_buf), // %[y_buf] -+ [u_buf]"+r"(u_buf), // %[u_buf] -+ [v_buf]"+r"(v_buf), // %[v_buf] -+ [a_buf]"+r"(a_buf), // %[a_buf] -+ [dst_argb]"+r"(dst_argb), // %[dst_argb] - #if defined(__i386__) -- [width] "+m"(width) // %[width] -+ [width]"+m"(width) // %[width] - #else -- [width] "+rm"(width) // %[width] -+ [width]"+rm"(width) // %[width] - #endif -- : [yuvconstants] "r"(yuvconstants) // %[yuvconstants] -- : "memory", "cc", YUVTORGB_REGS "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", -- "xmm5"); -+ : [yuvconstants]"r"(yuvconstants) // %[yuvconstants] -+ : "memory", "cc", YUVTORGB_REGS -+ "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" -+ ); -+ // clang-format on - } - #endif // HAS_I444ALPHATOARGBROW_SSSE3 - -@@ -2686,7 +2707,7 @@ void OMITFP I422ToRGB24Row_SSSE3(const u - uint8_t* dst_rgb24, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "movdqa %[kShuffleMaskARGBToRGB24_0],%%xmm5 \n" - "movdqa %[kShuffleMaskARGBToRGB24],%%xmm6 \n" -@@ -2722,7 +2743,7 @@ void OMITFP I444ToRGB24Row_SSSE3(const u - uint8_t* dst_rgb24, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "movdqa %[kShuffleMaskARGBToRGB24_0],%%xmm5 \n" - "movdqa %[kShuffleMaskARGBToRGB24],%%xmm6 \n" -@@ -2758,7 +2779,7 @@ void OMITFP I422ToARGBRow_SSSE3(const ui - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "pcmpeqb %%xmm5,%%xmm5 \n" -@@ -2787,7 +2808,7 @@ void OMITFP I422ToAR30Row_SSSE3(const ui - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "pcmpeqb %%xmm5,%%xmm5 \n" // AR30 constants -@@ -2822,7 +2843,7 @@ void OMITFP I210ToARGBRow_SSSE3(const ui - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "pcmpeqb %%xmm5,%%xmm5 \n" -@@ -2852,7 +2873,7 @@ void OMITFP I212ToARGBRow_SSSE3(const ui - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "pcmpeqb %%xmm5,%%xmm5 \n" -@@ -2882,7 +2903,7 @@ void OMITFP I210ToAR30Row_SSSE3(const ui - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "pcmpeqb %%xmm5,%%xmm5 \n" -@@ -2917,7 +2938,7 @@ void OMITFP I212ToAR30Row_SSSE3(const ui - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "pcmpeqb %%xmm5,%%xmm5 \n" -@@ -2952,7 +2973,7 @@ void OMITFP I410ToARGBRow_SSSE3(const ui - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "pcmpeqb %%xmm5,%%xmm5 \n" -@@ -2983,7 +3004,8 @@ void OMITFP I210AlphaToARGBRow_SSSE3(con - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile (YUVTORGB_SETUP( -+ asm volatile( -+ YUVTORGB_SETUP( - yuvconstants) "sub %[u_buf],%[v_buf] \n" - - LABELALIGN "1: \n" READYUVA210 -@@ -3015,26 +3037,32 @@ void OMITFP I410AlphaToARGBRow_SSSE3(con - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile (YUVTORGB_SETUP( -- yuvconstants) "sub %[u_buf],%[v_buf] \n" -- -- LABELALIGN "1: \n" READYUVA410 -- YUVTORGB(yuvconstants) STOREARGB -+ // clang-format off -+ asm volatile( -+ YUVTORGB_SETUP(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ -+ LABELALIGN -+ "1: \n" -+ READYUVA410 -+ YUVTORGB(yuvconstants) -+ STOREARGB - "subl $0x8,%[width] \n" - "jg 1b \n" -- : [y_buf] "+r"(y_buf), // %[y_buf] -- [u_buf] "+r"(u_buf), // %[u_buf] -- [v_buf] "+r"(v_buf), // %[v_buf] -- [a_buf] "+r"(a_buf), -- [dst_argb] "+r"(dst_argb), // %[dst_argb] -+ : [y_buf] "+r"(y_buf), // %[y_buf] -+ [u_buf] "+r"(u_buf), // %[u_buf] -+ [v_buf] "+r"(v_buf), // %[v_buf] -+ [a_buf] "+r"(a_buf), -+ [dst_argb] "+r"(dst_argb), // %[dst_argb] - #if defined(__i386__) -- [width] "+m"(width) // %[width] -+ [width] "+m"(width) // %[width] - #else -- [width] "+rm"(width) // %[width] -+ [width] "+rm"(width) // %[width] - #endif -- : [yuvconstants] "r"(yuvconstants) // %[yuvconstants] -- : "memory", "cc", YUVTORGB_REGS "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", -- "xmm5"); -+ : [yuvconstants] "r"(yuvconstants) // %[yuvconstants] -+ : "memory", "cc", YUVTORGB_REGS "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", -+ "xmm5"); -+ // clang-format on - } - #endif - -@@ -3045,7 +3073,7 @@ void OMITFP I410ToAR30Row_SSSE3(const ui - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "pcmpeqb %%xmm5,%%xmm5 \n" -@@ -3081,26 +3109,33 @@ void OMITFP I422AlphaToARGBRow_SSSE3(con - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile (YUVTORGB_SETUP( -- yuvconstants) "sub %[u_buf],%[v_buf] \n" -- -- LABELALIGN "1: \n" READYUVA422 -- YUVTORGB(yuvconstants) STOREARGB -+ // clang-format off -+ asm volatile ( -+ YUVTORGB_SETUP(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ -+ LABELALIGN -+ "1: \n" -+ READYUVA422 -+ YUVTORGB(yuvconstants) -+ STOREARGB - "subl $0x8,%[width] \n" - "jg 1b \n" -- : [y_buf] "+r"(y_buf), // %[y_buf] -- [u_buf] "+r"(u_buf), // %[u_buf] -- [v_buf] "+r"(v_buf), // %[v_buf] -- [a_buf] "+r"(a_buf), // %[a_buf] -- [dst_argb] "+r"(dst_argb), // %[dst_argb] -+ : [y_buf]"+r"(y_buf), // %[y_buf] -+ [u_buf]"+r"(u_buf), // %[u_buf] -+ [v_buf]"+r"(v_buf), // %[v_buf] -+ [a_buf]"+r"(a_buf), // %[a_buf] -+ [dst_argb]"+r"(dst_argb), // %[dst_argb] - #if defined(__i386__) -- [width] "+m"(width) // %[width] -+ [width]"+m"(width) // %[width] - #else -- [width] "+rm"(width) // %[width] -+ [width]"+rm"(width) // %[width] - #endif -- : [yuvconstants] "r"(yuvconstants) // %[yuvconstants] -- : "memory", "cc", YUVTORGB_REGS "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", -- "xmm5"); -+ : [yuvconstants]"r"(yuvconstants) // %[yuvconstants] -+ : "memory", "cc", YUVTORGB_REGS -+ "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" -+ ); -+ // clang-format on - } - #endif // HAS_I422ALPHATOARGBROW_SSSE3 - -@@ -3109,20 +3144,27 @@ void OMITFP NV12ToARGBRow_SSSE3(const ui - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile (YUVTORGB_SETUP( -- yuvconstants) "pcmpeqb %%xmm5,%%xmm5 \n" -- -- LABELALIGN "1: \n" READNV12 -- YUVTORGB(yuvconstants) STOREARGB -+ // clang-format off -+ asm volatile ( -+ YUVTORGB_SETUP(yuvconstants) -+ "pcmpeqb %%xmm5,%%xmm5 \n" -+ -+ LABELALIGN -+ "1: \n" -+ READNV12 -+ YUVTORGB(yuvconstants) -+ STOREARGB - "sub $0x8,%[width] \n" - "jg 1b \n" -- : [y_buf] "+r"(y_buf), // %[y_buf] -- [uv_buf] "+r"(uv_buf), // %[uv_buf] -- [dst_argb] "+r"(dst_argb), // %[dst_argb] -- [width] "+rm"(width) // %[width] -- : [yuvconstants] "r"(yuvconstants) // %[yuvconstants] -- : "memory", "cc", YUVTORGB_REGS "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", -- "xmm5"); -+ : [y_buf]"+r"(y_buf), // %[y_buf] -+ [uv_buf]"+r"(uv_buf), // %[uv_buf] -+ [dst_argb]"+r"(dst_argb), // %[dst_argb] -+ [width]"+rm"(width) // %[width] -+ : [yuvconstants]"r"(yuvconstants) // %[yuvconstants] -+ : "memory", "cc", YUVTORGB_REGS -+ "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" -+ ); -+ // clang-format on - } - - void OMITFP NV21ToARGBRow_SSSE3(const uint8_t* y_buf, -@@ -3130,65 +3172,84 @@ void OMITFP NV21ToARGBRow_SSSE3(const ui - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile (YUVTORGB_SETUP( -- yuvconstants) "pcmpeqb %%xmm5,%%xmm5 \n" -- -- LABELALIGN "1: \n" READNV21 -- YUVTORGB(yuvconstants) STOREARGB -+ // clang-format off -+ asm volatile ( -+ YUVTORGB_SETUP(yuvconstants) -+ "pcmpeqb %%xmm5,%%xmm5 \n" -+ -+ LABELALIGN -+ "1: \n" -+ READNV21 -+ YUVTORGB(yuvconstants) -+ STOREARGB - "sub $0x8,%[width] \n" - "jg 1b \n" -- : [y_buf] "+r"(y_buf), // %[y_buf] -- [vu_buf] "+r"(vu_buf), // %[vu_buf] -- [dst_argb] "+r"(dst_argb), // %[dst_argb] -- [width] "+rm"(width) // %[width] -- : [yuvconstants] "r"(yuvconstants), // %[yuvconstants] -- [kShuffleNV21] "m"(kShuffleNV21) -- : "memory", "cc", YUVTORGB_REGS "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", -- "xmm5"); -+ : [y_buf]"+r"(y_buf), // %[y_buf] -+ [vu_buf]"+r"(vu_buf), // %[vu_buf] -+ [dst_argb]"+r"(dst_argb), // %[dst_argb] -+ [width]"+rm"(width) // %[width] -+ : [yuvconstants]"r"(yuvconstants), // %[yuvconstants] -+ [kShuffleNV21]"m"(kShuffleNV21) -+ : "memory", "cc", YUVTORGB_REGS -+ "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" -+ ); -+ // clang-format on - } - - void OMITFP YUY2ToARGBRow_SSSE3(const uint8_t* yuy2_buf, - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -+ // clang-format off - asm volatile ( -- "movdqa %[kShuffleYUY2Y],%%xmm6 \n" -- "movdqa %[kShuffleYUY2UV],%%xmm7 \n" YUVTORGB_SETUP( -- yuvconstants) "pcmpeqb %%xmm5,%%xmm5 \n" -- -- LABELALIGN "1: \n" READYUY2 -- YUVTORGB(yuvconstants) STOREARGB -+ YUVTORGB_SETUP(yuvconstants) -+ "pcmpeqb %%xmm5,%%xmm5 \n" -+ -+ LABELALIGN -+ "1: \n" -+ READYUY2 -+ YUVTORGB(yuvconstants) -+ STOREARGB - "sub $0x8,%[width] \n" - "jg 1b \n" -- : [yuy2_buf] "+r"(yuy2_buf), // %[yuy2_buf] -- [dst_argb] "+r"(dst_argb), // %[dst_argb] -- [width] "+rm"(width) // %[width] -- : [yuvconstants] "r"(yuvconstants), // %[yuvconstants] -- [kShuffleYUY2Y] "m"(kShuffleYUY2Y), [kShuffleYUY2UV] "m"(kShuffleYUY2UV) -- : "memory", "cc", YUVTORGB_REGS "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", -- "xmm5", "xmm6", "xmm7"); -+ : [yuy2_buf]"+r"(yuy2_buf), // %[yuy2_buf] -+ [dst_argb]"+r"(dst_argb), // %[dst_argb] -+ [width]"+rm"(width) // %[width] -+ : [yuvconstants]"r"(yuvconstants), // %[yuvconstants] -+ [kShuffleYUY2Y]"m"(kShuffleYUY2Y), -+ [kShuffleYUY2UV]"m"(kShuffleYUY2UV) -+ : "memory", "cc", YUVTORGB_REGS -+ "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" -+ ); -+ // clang-format on - } - - void OMITFP UYVYToARGBRow_SSSE3(const uint8_t* uyvy_buf, - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -+ // clang-format off - asm volatile ( -- "movdqa %[kShuffleUYVYY],%%xmm6 \n" -- "movdqa %[kShuffleUYVYUV],%%xmm7 \n" YUVTORGB_SETUP( -- yuvconstants) "pcmpeqb %%xmm5,%%xmm5 \n" -- -- LABELALIGN "1: \n" READUYVY -- YUVTORGB(yuvconstants) STOREARGB -+ YUVTORGB_SETUP(yuvconstants) -+ "pcmpeqb %%xmm5,%%xmm5 \n" -+ -+ LABELALIGN -+ "1: \n" -+ READUYVY -+ YUVTORGB(yuvconstants) -+ STOREARGB - "sub $0x8,%[width] \n" - "jg 1b \n" -- : [uyvy_buf] "+r"(uyvy_buf), // %[uyvy_buf] -- [dst_argb] "+r"(dst_argb), // %[dst_argb] -- [width] "+rm"(width) // %[width] -- : [yuvconstants] "r"(yuvconstants), // %[yuvconstants] -- [kShuffleUYVYY] "m"(kShuffleUYVYY), [kShuffleUYVYUV] "m"(kShuffleUYVYUV) -- : "memory", "cc", YUVTORGB_REGS "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", -- "xmm5"); -+ : [uyvy_buf]"+r"(uyvy_buf), // %[uyvy_buf] -+ [dst_argb]"+r"(dst_argb), // %[dst_argb] -+ [width]"+rm"(width) // %[width] -+ : [yuvconstants]"r"(yuvconstants), // %[yuvconstants] -+ [kShuffleUYVYY]"m"(kShuffleUYVYY), -+ [kShuffleUYVYUV]"m"(kShuffleUYVYUV) -+ : "memory", "cc", YUVTORGB_REGS -+ "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" -+ ); -+ // clang-format on - } - - void OMITFP P210ToARGBRow_SSSE3(const uint16_t* y_buf, -@@ -3196,7 +3257,8 @@ void OMITFP P210ToARGBRow_SSSE3(const ui - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile (YUVTORGB_SETUP( -+ asm volatile( -+ YUVTORGB_SETUP( - yuvconstants) "pcmpeqb %%xmm5,%%xmm5 \n" - - LABELALIGN "1: \n" READP210 -@@ -3217,7 +3279,8 @@ void OMITFP P410ToARGBRow_SSSE3(const ui - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile (YUVTORGB_SETUP( -+ asm volatile( -+ YUVTORGB_SETUP( - yuvconstants) "pcmpeqb %%xmm5,%%xmm5 \n" - - LABELALIGN "1: \n" READP410 -@@ -3238,7 +3301,7 @@ void OMITFP P210ToAR30Row_SSSE3(const ui - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "pcmpeqb %%xmm5,%%xmm5 \n" - "psrlw $14,%%xmm5 \n" -@@ -3269,7 +3332,7 @@ void OMITFP P410ToAR30Row_SSSE3(const ui - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "pcmpeqb %%xmm5,%%xmm5 \n" - "psrlw $14,%%xmm5 \n" -@@ -3301,7 +3364,7 @@ void OMITFP I422ToRGBARow_SSSE3(const ui - uint8_t* dst_rgba, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "pcmpeqb %%xmm5,%%xmm5 \n" -@@ -3537,21 +3600,19 @@ void OMITFP I422ToRGBARow_SSSE3(const ui - "lea 0x20(%[y_buf]),%[y_buf] \n" - - // Read 8 YUY2 with 16 Y and upsample 8 UV to 16 UV. --// ymm6 kShuffleYUY2Y, --// ymm7 kShuffleYUY2UV - #define READYUY2_AVX2 \ -- "vmovdqu (%[yuy2_buf]),%%ymm1 \n" \ -- "vpshufb %%ymm6,%%ymm1,%%ymm4 \n" \ -- "vpshufb %%ymm7,%%ymm1,%%ymm3 \n" \ -+ "vmovdqu (%[yuy2_buf]),%%ymm4 \n" \ -+ "vpshufb %[kShuffleYUY2Y], %%ymm4, %%ymm4 \n" \ -+ "vmovdqu (%[yuy2_buf]),%%ymm3 \n" \ -+ "vpshufb %[kShuffleYUY2UV], %%ymm3, %%ymm3 \n" \ - "lea 0x20(%[yuy2_buf]),%[yuy2_buf] \n" - - // Read 8 UYVY with 16 Y and upsample 8 UV to 16 UV. --// ymm6 kShuffleUYVYY, --// ymm7 kShuffleUYVYUV - #define READUYVY_AVX2 \ -- "vmovdqu (%[uyvy_buf]),%%ymm1 \n" \ -- "vpshufb %%ymm6,%%ymm1,%%ymm4 \n" \ -- "vpshufb %%ymm7,%%ymm1,%%ymm3 \n" \ -+ "vmovdqu (%[uyvy_buf]),%%ymm4 \n" \ -+ "vpshufb %[kShuffleUYVYY], %%ymm4, %%ymm4 \n" \ -+ "vmovdqu (%[uyvy_buf]),%%ymm3 \n" \ -+ "vpshufb %[kShuffleUYVYUV], %%ymm3, %%ymm3 \n" \ - "lea 0x20(%[uyvy_buf]),%[uyvy_buf] \n" - - // TODO(fbarchard): Remove broadcastb -@@ -3712,7 +3773,7 @@ void OMITFP I444ToARGBRow_AVX2(const uin - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -@@ -3746,7 +3807,7 @@ void OMITFP I422ToARGBRow_AVX2(const uin - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -@@ -3786,7 +3847,7 @@ void OMITFP I422ToARGBRow_AVX512BW(const - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX512BW(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%xmm5,%%xmm5,%%xmm5 \n" -@@ -3825,7 +3886,7 @@ void OMITFP I422ToAR30Row_AVX2(const uin - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants -@@ -3865,7 +3926,7 @@ void OMITFP I210ToARGBRow_AVX2(const uin - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -@@ -3900,7 +3961,7 @@ void OMITFP I212ToARGBRow_AVX2(const uin - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -@@ -3935,7 +3996,7 @@ void OMITFP I210ToAR30Row_AVX2(const uin - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants -@@ -3975,7 +4036,7 @@ void OMITFP I212ToAR30Row_AVX2(const uin - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants -@@ -4015,7 +4076,7 @@ void OMITFP I410ToARGBRow_AVX2(const uin - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -@@ -4051,7 +4112,8 @@ void OMITFP I210AlphaToARGBRow_AVX2(cons - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile (YUVTORGB_SETUP_AVX2( -+ asm volatile( -+ YUVTORGB_SETUP_AVX2( - yuvconstants) "sub %[u_buf],%[v_buf] \n" - - LABELALIGN "1: \n" READYUVA210_AVX2 -@@ -4086,7 +4148,8 @@ void OMITFP I410AlphaToARGBRow_AVX2(cons - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile (YUVTORGB_SETUP_AVX2( -+ asm volatile( -+ YUVTORGB_SETUP_AVX2( - yuvconstants) "sub %[u_buf],%[v_buf] \n" - - LABELALIGN "1: \n" READYUVA410_AVX2 -@@ -4120,7 +4183,7 @@ void OMITFP I410ToAR30Row_AVX2(const uin - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants -@@ -4161,27 +4224,34 @@ void OMITFP I444AlphaToARGBRow_AVX2(cons - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile (YUVTORGB_SETUP_AVX2( -- yuvconstants) "sub %[u_buf],%[v_buf] \n" -- -- LABELALIGN "1: \n" READYUVA444_AVX2 -- YUVTORGB_AVX2(yuvconstants) STOREARGB_AVX2 -+ // clang-format off -+ asm volatile ( -+ YUVTORGB_SETUP_AVX2(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ -+ LABELALIGN -+ "1: \n" -+ READYUVA444_AVX2 -+ YUVTORGB_AVX2(yuvconstants) -+ STOREARGB_AVX2 - "subl $0x10,%[width] \n" - "jg 1b \n" - "vzeroupper \n" -- : [y_buf] "+r"(y_buf), // %[y_buf] -- [u_buf] "+r"(u_buf), // %[u_buf] -- [v_buf] "+r"(v_buf), // %[v_buf] -- [a_buf] "+r"(a_buf), // %[a_buf] -- [dst_argb] "+r"(dst_argb), // %[dst_argb] -+ : [y_buf]"+r"(y_buf), // %[y_buf] -+ [u_buf]"+r"(u_buf), // %[u_buf] -+ [v_buf]"+r"(v_buf), // %[v_buf] -+ [a_buf]"+r"(a_buf), // %[a_buf] -+ [dst_argb]"+r"(dst_argb), // %[dst_argb] - #if defined(__i386__) -- [width] "+m"(width) // %[width] -+ [width]"+m"(width) // %[width] - #else -- [width] "+rm"(width) // %[width] -+ [width]"+rm"(width) // %[width] - #endif -- : [yuvconstants] "r"(yuvconstants) // %[yuvconstants] -- : "memory", "cc", YUVTORGB_REGS_AVX2 "xmm0", "xmm1", "xmm2", "xmm3", -- "xmm4", "xmm5"); -+ : [yuvconstants]"r"(yuvconstants) // %[yuvconstants] -+ : "memory", "cc", YUVTORGB_REGS_AVX2 -+ "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" -+ ); -+ // clang-format on - } - #endif // HAS_I444ALPHATOARGBROW_AVX2 - -@@ -4195,27 +4265,34 @@ void OMITFP I422AlphaToARGBRow_AVX2(cons - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile (YUVTORGB_SETUP_AVX2( -- yuvconstants) "sub %[u_buf],%[v_buf] \n" -- -- LABELALIGN "1: \n" READYUVA422_AVX2 -- YUVTORGB_AVX2(yuvconstants) STOREARGB_AVX2 -+ // clang-format off -+ asm volatile ( -+ YUVTORGB_SETUP_AVX2(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ -+ LABELALIGN -+ "1: \n" -+ READYUVA422_AVX2 -+ YUVTORGB_AVX2(yuvconstants) -+ STOREARGB_AVX2 - "subl $0x10,%[width] \n" - "jg 1b \n" - "vzeroupper \n" -- : [y_buf] "+r"(y_buf), // %[y_buf] -- [u_buf] "+r"(u_buf), // %[u_buf] -- [v_buf] "+r"(v_buf), // %[v_buf] -- [a_buf] "+r"(a_buf), // %[a_buf] -- [dst_argb] "+r"(dst_argb), // %[dst_argb] -+ : [y_buf]"+r"(y_buf), // %[y_buf] -+ [u_buf]"+r"(u_buf), // %[u_buf] -+ [v_buf]"+r"(v_buf), // %[v_buf] -+ [a_buf]"+r"(a_buf), // %[a_buf] -+ [dst_argb]"+r"(dst_argb), // %[dst_argb] - #if defined(__i386__) -- [width] "+m"(width) // %[width] -+ [width]"+m"(width) // %[width] - #else -- [width] "+rm"(width) // %[width] -+ [width]"+rm"(width) // %[width] - #endif -- : [yuvconstants] "r"(yuvconstants) // %[yuvconstants] -- : "memory", "cc", YUVTORGB_REGS_AVX2 "xmm0", "xmm1", "xmm2", "xmm3", -- "xmm4", "xmm5"); -+ : [yuvconstants]"r"(yuvconstants) // %[yuvconstants] -+ : "memory", "cc", YUVTORGB_REGS_AVX2 -+ "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" -+ ); -+ // clang-format on - } - #endif // HAS_I422ALPHATOARGBROW_AVX2 - -@@ -4228,7 +4305,7 @@ void OMITFP I422ToRGBARow_AVX2(const uin - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -@@ -4271,21 +4348,28 @@ void OMITFP NV12ToARGBRow_AVX2(const uin - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile (YUVTORGB_SETUP_AVX2( -- yuvconstants) "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -- -- LABELALIGN "1: \n" READNV12_AVX2 -- YUVTORGB_AVX2(yuvconstants) STOREARGB_AVX2 -+ // clang-format off -+ asm volatile ( -+ YUVTORGB_SETUP_AVX2(yuvconstants) -+ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -+ -+ LABELALIGN -+ "1: \n" -+ READNV12_AVX2 -+ YUVTORGB_AVX2(yuvconstants) -+ STOREARGB_AVX2 - "sub $0x10,%[width] \n" - "jg 1b \n" - "vzeroupper \n" -- : [y_buf] "+r"(y_buf), // %[y_buf] -- [uv_buf] "+r"(uv_buf), // %[uv_buf] -- [dst_argb] "+r"(dst_argb), // %[dst_argb] -- [width] "+rm"(width) // %[width] -- : [yuvconstants] "r"(yuvconstants) // %[yuvconstants] -- : "memory", "cc", YUVTORGB_REGS_AVX2 "xmm0", "xmm0", "xmm1", "xmm2", -- "xmm3", "xmm4", "xmm5"); -+ : [y_buf]"+r"(y_buf), // %[y_buf] -+ [uv_buf]"+r"(uv_buf), // %[uv_buf] -+ [dst_argb]"+r"(dst_argb), // %[dst_argb] -+ [width]"+rm"(width) // %[width] -+ : [yuvconstants]"r"(yuvconstants) // %[yuvconstants] -+ : "memory", "cc", YUVTORGB_REGS_AVX2 -+ "xmm0", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" -+ ); -+ // clang-format on - } - #endif // HAS_NV12TOARGBROW_AVX2 - -@@ -4297,22 +4381,29 @@ void OMITFP NV21ToARGBRow_AVX2(const uin - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile (YUVTORGB_SETUP_AVX2( -- yuvconstants) "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -- -- LABELALIGN "1: \n" READNV21_AVX2 -- YUVTORGB_AVX2(yuvconstants) STOREARGB_AVX2 -+ // clang-format off -+ asm volatile ( -+ YUVTORGB_SETUP_AVX2(yuvconstants) -+ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -+ -+ LABELALIGN -+ "1: \n" -+ READNV21_AVX2 -+ YUVTORGB_AVX2(yuvconstants) -+ STOREARGB_AVX2 - "sub $0x10,%[width] \n" - "jg 1b \n" - "vzeroupper \n" -- : [y_buf] "+r"(y_buf), // %[y_buf] -- [vu_buf] "+r"(vu_buf), // %[vu_buf] -- [dst_argb] "+r"(dst_argb), // %[dst_argb] -- [width] "+rm"(width) // %[width] -- : [yuvconstants] "r"(yuvconstants), // %[yuvconstants] -- [kShuffleNV21] "m"(kShuffleNV21) -- : "memory", "cc", YUVTORGB_REGS_AVX2 "xmm0", "xmm0", "xmm1", "xmm2", -- "xmm3", "xmm4", "xmm5"); -+ : [y_buf]"+r"(y_buf), // %[y_buf] -+ [vu_buf]"+r"(vu_buf), // %[vu_buf] -+ [dst_argb]"+r"(dst_argb), // %[dst_argb] -+ [width]"+rm"(width) // %[width] -+ : [yuvconstants]"r"(yuvconstants), // %[yuvconstants] -+ [kShuffleNV21]"m"(kShuffleNV21) -+ : "memory", "cc", YUVTORGB_REGS_AVX2 -+ "xmm0", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" -+ ); -+ // clang-format on - } - #endif // HAS_NV21TOARGBROW_AVX2 - -@@ -4323,23 +4414,29 @@ void OMITFP YUY2ToARGBRow_AVX2(const uin - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -+ // clang-format off - asm volatile ( -- "vbroadcastf128 %[kShuffleYUY2Y],%%ymm6 \n" -- "vbroadcastf128 %[kShuffleYUY2UV],%%ymm7 \n" YUVTORGB_SETUP_AVX2( -- yuvconstants) "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -- -- LABELALIGN "1: \n" READYUY2_AVX2 -- YUVTORGB_AVX2(yuvconstants) STOREARGB_AVX2 -+ YUVTORGB_SETUP_AVX2(yuvconstants) -+ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -+ -+ LABELALIGN -+ "1: \n" -+ READYUY2_AVX2 -+ YUVTORGB_AVX2(yuvconstants) -+ STOREARGB_AVX2 - "sub $0x10,%[width] \n" - "jg 1b \n" - "vzeroupper \n" -- : [yuy2_buf] "+r"(yuy2_buf), // %[yuy2_buf] -- [dst_argb] "+r"(dst_argb), // %[dst_argb] -- [width] "+rm"(width) // %[width] -- : [yuvconstants] "r"(yuvconstants), // %[yuvconstants] -- [kShuffleYUY2Y] "m"(kShuffleYUY2Y), [kShuffleYUY2UV] "m"(kShuffleYUY2UV) -- : "memory", "cc", YUVTORGB_REGS_AVX2 "xmm0", "xmm0", "xmm1", "xmm2", -- "xmm3", "xmm4", "xmm5", "xmm6", "xmm7"); -+ : [yuy2_buf]"+r"(yuy2_buf), // %[yuy2_buf] -+ [dst_argb]"+r"(dst_argb), // %[dst_argb] -+ [width]"+rm"(width) // %[width] -+ : [yuvconstants]"r"(yuvconstants), // %[yuvconstants] -+ [kShuffleYUY2Y]"m"(kShuffleYUY2Y), -+ [kShuffleYUY2UV]"m"(kShuffleYUY2UV) -+ : "memory", "cc", YUVTORGB_REGS_AVX2 -+ "xmm0", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" -+ ); -+ // clang-format on - } - #endif // HAS_YUY2TOARGBROW_AVX2 - -@@ -4350,23 +4447,29 @@ void OMITFP UYVYToARGBRow_AVX2(const uin - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -+ // clang-format off - asm volatile ( -- "vbroadcastf128 %[kShuffleUYVYY],%%ymm6 \n" -- "vbroadcastf128 %[kShuffleUYVYUV],%%ymm7 \n" YUVTORGB_SETUP_AVX2( -- yuvconstants) "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -- -- LABELALIGN "1: \n" READUYVY_AVX2 -- YUVTORGB_AVX2(yuvconstants) STOREARGB_AVX2 -+ YUVTORGB_SETUP_AVX2(yuvconstants) -+ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -+ -+ LABELALIGN -+ "1: \n" -+ READUYVY_AVX2 -+ YUVTORGB_AVX2(yuvconstants) -+ STOREARGB_AVX2 - "sub $0x10,%[width] \n" - "jg 1b \n" - "vzeroupper \n" -- : [uyvy_buf] "+r"(uyvy_buf), // %[uyvy_buf] -- [dst_argb] "+r"(dst_argb), // %[dst_argb] -- [width] "+rm"(width) // %[width] -- : [yuvconstants] "r"(yuvconstants), // %[yuvconstants] -- [kShuffleUYVYY] "m"(kShuffleUYVYY), [kShuffleUYVYUV] "m"(kShuffleUYVYUV) -- : "memory", "cc", YUVTORGB_REGS_AVX2 "xmm0", "xmm1", "xmm2", "xmm3", -- "xmm4", "xmm5", "xmm6", "xmm7"); -+ : [uyvy_buf]"+r"(uyvy_buf), // %[uyvy_buf] -+ [dst_argb]"+r"(dst_argb), // %[dst_argb] -+ [width]"+rm"(width) // %[width] -+ : [yuvconstants]"r"(yuvconstants), // %[yuvconstants] -+ [kShuffleUYVYY]"m"(kShuffleUYVYY), -+ [kShuffleUYVYUV]"m"(kShuffleUYVYUV) -+ : "memory", "cc", YUVTORGB_REGS_AVX2 -+ "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" -+ ); -+ // clang-format on - } - #endif // HAS_UYVYTOARGBROW_AVX2 - -@@ -4378,21 +4481,28 @@ void OMITFP P210ToARGBRow_AVX2(const uin - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile (YUVTORGB_SETUP_AVX2( -- yuvconstants) "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -- -- LABELALIGN "1: \n" READP210_AVX2 -- YUVTORGB_AVX2(yuvconstants) STOREARGB_AVX2 -+ // clang-format off -+ asm volatile ( -+ YUVTORGB_SETUP_AVX2(yuvconstants) -+ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -+ -+ LABELALIGN -+ "1: \n" -+ READP210_AVX2 -+ YUVTORGB_AVX2(yuvconstants) -+ STOREARGB_AVX2 - "sub $0x10,%[width] \n" - "jg 1b \n" - "vzeroupper \n" -- : [y_buf] "+r"(y_buf), // %[y_buf] -- [uv_buf] "+r"(uv_buf), // %[uv_buf] -- [dst_argb] "+r"(dst_argb), // %[dst_argb] -- [width] "+rm"(width) // %[width] -- : [yuvconstants] "r"(yuvconstants) // %[yuvconstants] -- : "memory", "cc", YUVTORGB_REGS_AVX2 "xmm0", "xmm0", "xmm1", "xmm2", -- "xmm3", "xmm4", "xmm5"); -+ : [y_buf]"+r"(y_buf), // %[y_buf] -+ [uv_buf]"+r"(uv_buf), // %[uv_buf] -+ [dst_argb]"+r"(dst_argb), // %[dst_argb] -+ [width]"+rm"(width) // %[width] -+ : [yuvconstants]"r"(yuvconstants) // %[yuvconstants] -+ : "memory", "cc", YUVTORGB_REGS_AVX2 -+ "xmm0", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" -+ ); -+ // clang-format on - } - #endif // HAS_P210TOARGBROW_AVX2 - -@@ -4404,21 +4514,28 @@ void OMITFP P410ToARGBRow_AVX2(const uin - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile (YUVTORGB_SETUP_AVX2( -- yuvconstants) "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -- -- LABELALIGN "1: \n" READP410_AVX2 -- YUVTORGB_AVX2(yuvconstants) STOREARGB_AVX2 -+ // clang-format off -+ asm volatile ( -+ YUVTORGB_SETUP_AVX2(yuvconstants) -+ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -+ -+ LABELALIGN -+ "1: \n" -+ READP410_AVX2 -+ YUVTORGB_AVX2(yuvconstants) -+ STOREARGB_AVX2 - "sub $0x10,%[width] \n" - "jg 1b \n" - "vzeroupper \n" -- : [y_buf] "+r"(y_buf), // %[y_buf] -- [uv_buf] "+r"(uv_buf), // %[uv_buf] -- [dst_argb] "+r"(dst_argb), // %[dst_argb] -- [width] "+rm"(width) // %[width] -- : [yuvconstants] "r"(yuvconstants) // %[yuvconstants] -- : "memory", "cc", YUVTORGB_REGS_AVX2 "xmm0", "xmm0", "xmm1", "xmm2", -- "xmm3", "xmm4", "xmm5"); -+ : [y_buf]"+r"(y_buf), // %[y_buf] -+ [uv_buf]"+r"(uv_buf), // %[uv_buf] -+ [dst_argb]"+r"(dst_argb), // %[dst_argb] -+ [width]"+rm"(width) // %[width] -+ : [yuvconstants]"r"(yuvconstants) // %[yuvconstants] -+ : "memory", "cc", YUVTORGB_REGS_AVX2 -+ "xmm0", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5" -+ ); -+ // clang-format on - } - #endif // HAS_P410TOARGBROW_AVX2 - -@@ -4430,7 +4547,7 @@ void OMITFP P210ToAR30Row_AVX2(const uin - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants - "vpsrlw $14,%%ymm5,%%ymm5 \n" -@@ -4467,7 +4584,7 @@ void OMITFP P410ToAR30Row_AVX2(const uin - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants - "vpsrlw $14,%%ymm5,%%ymm5 \n" -@@ -4501,7 +4618,7 @@ void I400ToARGBRow_SSE2(const uint8_t* y - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - "movdqa 96(%3),%%xmm2 \n" // yg = 18997 = 1.164 - "movdqa 128(%3),%%xmm3 \n" // ygb = 1160 = 1.164 * 16 - "pcmpeqb %%xmm4,%%xmm4 \n" // 0xff000000 -@@ -4546,7 +4663,7 @@ void I400ToARGBRow_AVX2(const uint8_t* y - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - "vmovdqa 96(%3),%%ymm2 \n" // yg = 18997 = 1.164 - "vmovdqa 128(%3),%%ymm3 \n" // ygb = -1160 = 1.164*16 - "vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" // 0xff000000 -@@ -4590,7 +4707,8 @@ static const uvec8 kShuffleMirror = {15u - - void MirrorRow_SSSE3(const uint8_t* src, uint8_t* dst, int width) { - intptr_t temp_width = (intptr_t)(width); -- asm volatile ( -+ asm volatile( -+ - "movdqa %3,%%xmm5 \n" - - LABELALIGN -@@ -4612,7 +4730,8 @@ void MirrorRow_SSSE3(const uint8_t* src, - #ifdef HAS_MIRRORROW_AVX2 - void MirrorRow_AVX2(const uint8_t* src, uint8_t* dst, int width) { - intptr_t temp_width = (intptr_t)(width); -- asm volatile ( -+ asm volatile( -+ - "vbroadcastf128 %3,%%ymm5 \n" - - LABELALIGN -@@ -4640,7 +4759,8 @@ static const uvec8 kShuffleMirrorUV = {1 - - void MirrorUVRow_SSSE3(const uint8_t* src_uv, uint8_t* dst_uv, int width) { - intptr_t temp_width = (intptr_t)(width); -- asm volatile ( -+ asm volatile( -+ - "movdqa %3,%%xmm5 \n" - - LABELALIGN -@@ -4662,7 +4782,8 @@ void MirrorUVRow_SSSE3(const uint8_t* sr - #ifdef HAS_MIRRORUVROW_AVX2 - void MirrorUVRow_AVX2(const uint8_t* src_uv, uint8_t* dst_uv, int width) { - intptr_t temp_width = (intptr_t)(width); -- asm volatile ( -+ asm volatile( -+ - "vbroadcastf128 %3,%%ymm5 \n" - - LABELALIGN -@@ -4692,7 +4813,7 @@ void MirrorSplitUVRow_SSSE3(const uint8_ - uint8_t* dst_v, - int width) { - intptr_t temp_width = (intptr_t)(width); -- asm volatile ( -+ asm volatile( - "movdqa %4,%%xmm1 \n" - "lea -0x10(%0,%3,2),%0 \n" - "sub %1,%2 \n" -@@ -4732,7 +4853,7 @@ void RGB24MirrorRow_SSSE3(const uint8_t* - int width) { - intptr_t temp_width = (intptr_t)(width); - src_rgb24 += width * 3 - 48; -- asm volatile ( -+ asm volatile( - "movdqa %3,%%xmm4 \n" - "movdqa %4,%%xmm5 \n" - -@@ -4767,7 +4888,8 @@ void RGB24MirrorRow_SSSE3(const uint8_t* - - void ARGBMirrorRow_SSE2(const uint8_t* src, uint8_t* dst, int width) { - intptr_t temp_width = (intptr_t)(width); -- asm volatile ( -+ asm volatile( -+ - "lea -0x10(%0,%2,4),%0 \n" - - LABELALIGN -@@ -4792,7 +4914,8 @@ void ARGBMirrorRow_SSE2(const uint8_t* s - static const ulvec32 kARGBShuffleMirror_AVX2 = {7u, 6u, 5u, 4u, 3u, 2u, 1u, 0u}; - void ARGBMirrorRow_AVX2(const uint8_t* src, uint8_t* dst, int width) { - intptr_t temp_width = (intptr_t)(width); -- asm volatile ( -+ asm volatile( -+ - "vmovdqu %3,%%ymm5 \n" - - LABELALIGN -@@ -4816,7 +4939,7 @@ void SplitUVRow_AVX2(const uint8_t* src_ - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" - "vpsrlw $0x8,%%ymm5,%%ymm5 \n" - "sub %1,%2 \n" -@@ -4854,7 +4977,7 @@ void SplitUVRow_SSE2(const uint8_t* src_ - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "pcmpeqb %%xmm5,%%xmm5 \n" - "psrlw $0x8,%%xmm5 \n" - "sub %1,%2 \n" -@@ -4891,7 +5014,7 @@ void DetileRow_SSE2(const uint8_t* src, - ptrdiff_t src_tile_stride, - uint8_t* dst, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "movdqu (%0),%%xmm0 \n" - "sub $0x10,%2 \n" -@@ -4912,7 +5035,7 @@ void DetileRow_16_SSE2(const uint16_t* s - ptrdiff_t src_tile_stride, - uint16_t* dst, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "movdqu (%0),%%xmm0 \n" - "movdqu 0x10(%0),%%xmm1 \n" -@@ -4935,7 +5058,7 @@ void DetileRow_16_AVX(const uint16_t* sr - ptrdiff_t src_tile_stride, - uint16_t* dst, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vmovdqu (%0),%%ymm0 \n" - "lea (%0,%3,2),%0 \n" -@@ -4960,7 +5083,7 @@ void DetileToYUY2_SSE2(const uint8_t* sr - ptrdiff_t src_uv_tile_stride, - uint8_t* dst_yuy2, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "movdqu (%0),%%xmm0 \n" // Load 16 Y - "sub $0x10,%3 \n" -@@ -4999,7 +5122,7 @@ void DetileSplitUVRow_SSSE3(const uint8_ - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "movdqu %4,%%xmm1 \n" - "1: \n" - "movdqu (%0),%%xmm0 \n" -@@ -5022,31 +5145,21 @@ void DetileSplitUVRow_SSSE3(const uint8_ - #endif // HAS_DETILESPLITUVROW_SSSE3 - - #ifdef HAS_MERGEUVROW_AVX512BW -+__attribute__ ((target("avx512vl,avx512bw"))) - void MergeUVRow_AVX512BW(const uint8_t* src_u, - const uint8_t* src_v, - uint8_t* dst_uv, - int width) { -- asm volatile ( -- "sub %0,%1 \n" -- -- LABELALIGN -- "1: \n" -- "vpmovzxbw (%0),%%zmm0 \n" -- "vpmovzxbw 0x00(%0,%1,1),%%zmm1 \n" -- "lea 0x20(%0),%0 \n" -- "vpsllw $0x8,%%zmm1,%%zmm1 \n" -- "vporq %%zmm0,%%zmm1,%%zmm2 \n" -- "vmovdqu64 %%zmm2,(%2) \n" -- "lea 0x40(%2),%2 \n" -- "sub $0x20,%3 \n" -- "jg 1b \n" -- "vzeroupper \n" -- : "+r"(src_u), // %0 -- "+r"(src_v), // %1 -- "+r"(dst_uv), // %2 -- "+r"(width) // %3 -- : -- : "memory", "cc", "xmm0", "xmm1", "xmm2"); -+ do { -+ const __m512i u = _mm512_cvtepu8_epi16(_mm256_loadu_epi8(src_u)); -+ const __m512i v = _mm512_slli_epi64(_mm512_cvtepu8_epi16(_mm256_loadu_epi8(src_v)), 8); -+ const __m512i uv = _mm512_or_si512(u, v); -+ _mm512_storeu_epi8(dst_uv, uv); -+ src_u += 32; -+ src_v += 32; -+ dst_uv += 64; -+ width -= 32; -+ } while (width > 0); - } - #endif // HAS_MERGEUVROW_AVX512BW - -@@ -5055,19 +5168,23 @@ void MergeUVRow_AVX2(const uint8_t* src_ - const uint8_t* src_v, - uint8_t* dst_uv, - int width) { -- asm volatile ( -+ asm volatile( -+ - "sub %0,%1 \n" - - LABELALIGN - "1: \n" -- "vpmovzxbw (%0),%%ymm0 \n" -- "vpmovzxbw 0x00(%0,%1,1),%%ymm1 \n" -- "lea 0x10(%0),%0 \n" -- "vpsllw $0x8,%%ymm1,%%ymm1 \n" -- "vpor %%ymm0,%%ymm1,%%ymm2 \n" -- "vmovdqu %%ymm2,(%2) \n" -- "lea 0x20(%2),%2 \n" -- "sub $0x10,%3 \n" -+ "vmovdqu (%0),%%ymm0 \n" -+ "vmovdqu 0x00(%0,%1,1),%%ymm1 \n" -+ "lea 0x20(%0),%0 \n" -+ "vpunpcklbw %%ymm1,%%ymm0,%%ymm2 \n" -+ "vpunpckhbw %%ymm1,%%ymm0,%%ymm0 \n" -+ "vextractf128 $0x0,%%ymm2,(%2) \n" -+ "vextractf128 $0x0,%%ymm0,0x10(%2) \n" -+ "vextractf128 $0x1,%%ymm2,0x20(%2) \n" -+ "vextractf128 $0x1,%%ymm0,0x30(%2) \n" -+ "lea 0x40(%2),%2 \n" -+ "sub $0x20,%3 \n" - "jg 1b \n" - "vzeroupper \n" - : "+r"(src_u), // %0 -@@ -5084,7 +5201,8 @@ void MergeUVRow_SSE2(const uint8_t* src_ - const uint8_t* src_v, - uint8_t* dst_uv, - int width) { -- asm volatile ( -+ asm volatile( -+ - "sub %0,%1 \n" - - LABELALIGN -@@ -5115,33 +5233,38 @@ void MergeUVRow_16_AVX2(const uint16_t* - uint16_t* dst_uv, - int depth, - int width) { -+ depth = 16 - depth; -+ // clang-format off - asm volatile ( - "vmovd %4,%%xmm3 \n" -- "vmovd %5,%%xmm4 \n" -- - "sub %0,%1 \n" -- // 8 pixels per loop. -- -- LABELALIGN -- "1: \n" -- "vpmovzxwd (%0),%%ymm0 \n" -- "vpmovzxwd 0x00(%0,%1,1),%%ymm1 \n" -- "lea 0x10(%0),%0 \n" -+ -+ // 16 pixels per loop. -+ LABELALIGN -+ "1: \n" -+ "vmovdqu (%0),%%ymm0 \n" -+ "vmovdqu (%0,%1,1),%%ymm1 \n" -+ "add $0x20,%0 \n" -+ - "vpsllw %%xmm3,%%ymm0,%%ymm0 \n" -- "vpslld %%xmm4,%%ymm1,%%ymm1 \n" -- "vpor %%ymm0,%%ymm1,%%ymm2 \n" -- "vmovdqu %%ymm2,(%2) \n" -- "lea 0x20(%2),%2 \n" -- "sub $0x8,%3 \n" -+ "vpsllw %%xmm3,%%ymm1,%%ymm1 \n" -+ "vpunpcklwd %%ymm1,%%ymm0,%%ymm2 \n" // mutates -+ "vpunpckhwd %%ymm1,%%ymm0,%%ymm0 \n" -+ "vextractf128 $0x0,%%ymm2,(%2) \n" -+ "vextractf128 $0x0,%%ymm0,0x10(%2) \n" -+ "vextractf128 $0x1,%%ymm2,0x20(%2) \n" -+ "vextractf128 $0x1,%%ymm0,0x30(%2) \n" -+ "add $0x40,%2 \n" -+ "sub $0x10,%3 \n" - "jg 1b \n" - "vzeroupper \n" -- : "+r"(src_u), // %0 -- "+r"(src_v), // %1 -- "+r"(dst_uv), // %2 -- "+r"(width) // %3 -- : "r"(16 - depth), // %4 -- "r"(32 - depth) // %5 -- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4"); -+ : "+r"(src_u), // %0 -+ "+r"(src_v), // %1 -+ "+r"(dst_uv), // %2 -+ "+r"(width) // %3 -+ : "r"(depth) // %4 -+ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3"); -+ // clang-format on - } - #endif // HAS_MERGEUVROW_AVX2 - -@@ -5154,13 +5277,14 @@ void SplitUVRow_16_AVX2(const uint16_t* - int depth, - int width) { - depth = 16 - depth; -+ // clang-format off - asm volatile ( - "vmovd %4,%%xmm3 \n" - "vbroadcastf128 %5,%%ymm4 \n" - "sub %1,%2 \n" - -- // 16 pixels per loop. -- LABELALIGN -+ // 16 pixels per loop. -+ LABELALIGN - "1: \n" - "vmovdqu (%0),%%ymm0 \n" - "vmovdqu 0x20(%0),%%ymm1 \n" -@@ -5180,13 +5304,14 @@ void SplitUVRow_16_AVX2(const uint16_t* - "sub $0x10,%3 \n" - "jg 1b \n" - "vzeroupper \n" -- : "+r"(src_uv), // %0 -- "+r"(dst_u), // %1 -- "+r"(dst_v), // %2 -- "+r"(width) // %3 -- : "r"(depth), // %4 -- "m"(kSplitUVShuffle16) // %5 -- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4"); -+ : "+r"(src_uv), // %0 -+ "+r"(dst_u), // %1 -+ "+r"(dst_v), // %2 -+ "+r"(width) // %3 -+ : "r"(depth), // %4 -+ "m"(kSplitUVShuffle16) // %5 -+ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4"); -+ // clang-format on - } - #endif // HAS_SPLITUVROW_16_AVX2 - -@@ -5200,14 +5325,15 @@ void MultiplyRow_16_AVX2(const uint16_t* - uint16_t* dst_y, - int scale, - int width) { -+ // clang-format off - asm volatile ( - "vmovd %3,%%xmm3 \n" - "vpunpcklwd %%xmm3,%%xmm3,%%xmm3 \n" - "vbroadcastss %%xmm3,%%ymm3 \n" - "sub %0,%1 \n" - -- // 32 pixels per loop. -- LABELALIGN -+ // 32 pixels per loop. -+ LABELALIGN - "1: \n" - "vmovdqu (%0),%%ymm0 \n" - "vmovdqu 0x20(%0),%%ymm1 \n" -@@ -5219,11 +5345,12 @@ void MultiplyRow_16_AVX2(const uint16_t* - "sub $0x20,%2 \n" - "jg 1b \n" - "vzeroupper \n" -- : "+r"(src_y), // %0 -- "+r"(dst_y), // %1 -- "+r"(width) // %2 -- : "r"(scale) // %3 -- : "memory", "cc", "xmm0", "xmm1", "xmm3"); -+ : "+r"(src_y), // %0 -+ "+r"(dst_y), // %1 -+ "+r"(width) // %2 -+ : "r"(scale) // %3 -+ : "memory", "cc", "xmm0", "xmm1", "xmm3"); -+ // clang-format on - } - #endif // HAS_MULTIPLYROW_16_AVX2 - -@@ -5237,14 +5364,15 @@ void DivideRow_16_AVX2(const uint16_t* s - uint16_t* dst_y, - int scale, - int width) { -+ // clang-format off - asm volatile ( - "vmovd %3,%%xmm3 \n" - "vpunpcklwd %%xmm3,%%xmm3,%%xmm3 \n" - "vbroadcastss %%xmm3,%%ymm3 \n" - "sub %0,%1 \n" - -- // 32 pixels per loop. -- LABELALIGN -+ // 32 pixels per loop. -+ LABELALIGN - "1: \n" - "vmovdqu (%0),%%ymm0 \n" - "vmovdqu 0x20(%0),%%ymm1 \n" -@@ -5256,12 +5384,13 @@ void DivideRow_16_AVX2(const uint16_t* s - "sub $0x20,%2 \n" - "jg 1b \n" - "vzeroupper \n" -- : "+r"(src_y), // %0 -- "+r"(dst_y), // %1 -- "+r"(width), // %2 -- "+r"(scale) // %3 -- : -- : "memory", "cc", "xmm0", "xmm1", "xmm3"); -+ : "+r"(src_y), // %0 -+ "+r"(dst_y), // %1 -+ "+r"(width), // %2 -+ "+r"(scale) // %3 -+ : -+ : "memory", "cc", "xmm0", "xmm1", "xmm3"); -+ // clang-format on - } - #endif // HAS_MULTIPLYROW_16_AVX2 - -@@ -5274,13 +5403,14 @@ void Convert16To8Row_SSSE3(const uint16_ - uint8_t* dst_y, - int scale, - int width) { -+ // clang-format off - asm volatile ( - "movd %3,%%xmm2 \n" - "punpcklwd %%xmm2,%%xmm2 \n" - "pshufd $0x0,%%xmm2,%%xmm2 \n" - -- // 32 pixels per loop. -- LABELALIGN -+ // 32 pixels per loop. -+ LABELALIGN - "1: \n" - "movdqu (%0),%%xmm0 \n" - "movdqu 0x10(%0),%%xmm1 \n" -@@ -5292,11 +5422,12 @@ void Convert16To8Row_SSSE3(const uint16_ - "add $0x10,%1 \n" - "sub $0x10,%2 \n" - "jg 1b \n" -- : "+r"(src_y), // %0 -- "+r"(dst_y), // %1 -- "+r"(width) // %2 -- : "r"(scale) // %3 -- : "memory", "cc", "xmm0", "xmm1", "xmm2"); -+ : "+r"(src_y), // %0 -+ "+r"(dst_y), // %1 -+ "+r"(width) // %2 -+ : "r"(scale) // %3 -+ : "memory", "cc", "xmm0", "xmm1", "xmm2"); -+ // clang-format on - } - - #ifdef HAS_CONVERT16TO8ROW_AVX2 -@@ -5304,13 +5435,14 @@ void Convert16To8Row_AVX2(const uint16_t - uint8_t* dst_y, - int scale, - int width) { -+ // clang-format off - asm volatile ( - "vmovd %3,%%xmm2 \n" - "vpunpcklwd %%xmm2,%%xmm2,%%xmm2 \n" - "vbroadcastss %%xmm2,%%ymm2 \n" - -- // 32 pixels per loop. -- LABELALIGN -+ // 32 pixels per loop. -+ LABELALIGN - "1: \n" - "vmovdqu (%0),%%ymm0 \n" - "vmovdqu 0x20(%0),%%ymm1 \n" -@@ -5324,11 +5456,12 @@ void Convert16To8Row_AVX2(const uint16_t - "sub $0x20,%2 \n" - "jg 1b \n" - "vzeroupper \n" -- : "+r"(src_y), // %0 -- "+r"(dst_y), // %1 -- "+r"(width) // %2 -- : "r"(scale) // %3 -- : "memory", "cc", "xmm0", "xmm1", "xmm2"); -+ : "+r"(src_y), // %0 -+ "+r"(dst_y), // %1 -+ "+r"(width) // %2 -+ : "r"(scale) // %3 -+ : "memory", "cc", "xmm0", "xmm1", "xmm2"); -+ // clang-format on - } - #endif // HAS_CONVERT16TO8ROW_AVX2 - -@@ -5336,17 +5469,19 @@ void Convert16To8Row_AVX2(const uint16_t - // 512 = 9 bits - // 1024 = 10 bits - // 4096 = 12 bits -+// TODO(fbarchard): reduce to SSE2 - void Convert8To16Row_SSE2(const uint8_t* src_y, - uint16_t* dst_y, - int scale, - int width) { -+ // clang-format off - asm volatile ( - "movd %3,%%xmm2 \n" - "punpcklwd %%xmm2,%%xmm2 \n" - "pshufd $0x0,%%xmm2,%%xmm2 \n" - -- // 32 pixels per loop. -- LABELALIGN -+ // 32 pixels per loop. -+ LABELALIGN - "1: \n" - "movdqu (%0),%%xmm0 \n" - "movdqa %%xmm0,%%xmm1 \n" -@@ -5360,11 +5495,12 @@ void Convert8To16Row_SSE2(const uint8_t* - "add $0x20,%1 \n" - "sub $0x10,%2 \n" - "jg 1b \n" -- : "+r"(src_y), // %0 -- "+r"(dst_y), // %1 -- "+r"(width) // %2 -- : "r"(scale) // %3 -- : "memory", "cc", "xmm0", "xmm1", "xmm2"); -+ : "+r"(src_y), // %0 -+ "+r"(dst_y), // %1 -+ "+r"(width) // %2 -+ : "r"(scale) // %3 -+ : "memory", "cc", "xmm0", "xmm1", "xmm2"); -+ // clang-format on - } - - #ifdef HAS_CONVERT8TO16ROW_AVX2 -@@ -5372,13 +5508,14 @@ void Convert8To16Row_AVX2(const uint8_t* - uint16_t* dst_y, - int scale, - int width) { -+ // clang-format off - asm volatile ( - "vmovd %3,%%xmm2 \n" - "vpunpcklwd %%xmm2,%%xmm2,%%xmm2 \n" - "vbroadcastss %%xmm2,%%ymm2 \n" - -- // 32 pixels per loop. -- LABELALIGN -+ // 32 pixels per loop. -+ LABELALIGN - "1: \n" - "vmovdqu (%0),%%ymm0 \n" - "vpermq $0xd8,%%ymm0,%%ymm0 \n" -@@ -5393,11 +5530,12 @@ void Convert8To16Row_AVX2(const uint8_t* - "sub $0x20,%2 \n" - "jg 1b \n" - "vzeroupper \n" -- : "+r"(src_y), // %0 -- "+r"(dst_y), // %1 -- "+r"(width) // %2 -- : "r"(scale) // %3 -- : "memory", "cc", "xmm0", "xmm1", "xmm2"); -+ : "+r"(src_y), // %0 -+ "+r"(dst_y), // %1 -+ "+r"(width) // %2 -+ : "r"(scale) // %3 -+ : "memory", "cc", "xmm0", "xmm1", "xmm2"); -+ // clang-format on - } - #endif // HAS_CONVERT8TO16ROW_AVX2 - -@@ -5428,7 +5566,9 @@ void SplitRGBRow_SSSE3(const uint8_t* sr - uint8_t* dst_g, - uint8_t* dst_b, - int width) { -- asm volatile (LABELALIGN -+ asm volatile( -+ -+ LABELALIGN - "1: \n" - "movdqu (%0),%%xmm0 \n" - "movdqu 0x10(%0),%%xmm1 \n" -@@ -5502,7 +5642,9 @@ void MergeRGBRow_SSSE3(const uint8_t* sr - const uint8_t* src_b, - uint8_t* dst_rgb, - int width) { -- asm volatile (LABELALIGN -+ asm volatile( -+ -+ LABELALIGN - "1: \n" - "movdqu (%0),%%xmm0 \n" - "movdqu (%1),%%xmm1 \n" -@@ -5557,7 +5699,8 @@ void MergeARGBRow_SSE2(const uint8_t* sr - const uint8_t* src_a, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( -+ - "sub %0,%1 \n" - "sub %0,%2 \n" - "sub %0,%3 \n" -@@ -5598,7 +5741,9 @@ void MergeXRGBRow_SSE2(const uint8_t* sr - const uint8_t* src_b, - uint8_t* dst_argb, - int width) { -- asm volatile (LABELALIGN -+ asm volatile( -+ -+ LABELALIGN - "1: \n" - - "movq (%2),%%xmm0 \n" // B -@@ -5636,7 +5781,8 @@ void MergeARGBRow_AVX2(const uint8_t* sr - const uint8_t* src_a, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( -+ - "sub %0,%1 \n" - "sub %0,%2 \n" - "sub %0,%3 \n" -@@ -5681,13 +5827,13 @@ void MergeXRGBRow_AVX2(const uint8_t* sr - const uint8_t* src_b, - uint8_t* dst_argb, - int width) { -- asm( -+ asm volatile( - - LABELALIGN - "1: \n" - - "vmovdqu (%2),%%xmm0 \n" // B -- "vpcmpeqb %%ymm1,%%ymm1,%%ymm1 \n" // A(255) -+ "vpcmpeqd %%ymm1,%%ymm1,%%ymm1 \n" // A(255) - "vinserti128 $0,(%1),%%ymm1,%%ymm1 \n" // R - "vinserti128 $1,(%0),%%ymm0,%%ymm0 \n" // G - "vpunpckhbw %%ymm1,%%ymm0,%%ymm2 \n" -@@ -5713,8 +5859,8 @@ void MergeXRGBRow_AVX2(const uint8_t* sr - "+r"(src_b), // %2 - "+r"(dst_argb), // %3 - "+rm"(width) // %4 -- ::"memory", -- "cc", "xmm0", "xmm1", "xmm2"); -+ : -+ : "memory", "cc", "xmm0", "xmm1", "xmm2"); - } - #endif // HAS_MERGEARGBROW_AVX2 - -@@ -5725,7 +5871,8 @@ void SplitARGBRow_SSE2(const uint8_t* sr - uint8_t* dst_b, - uint8_t* dst_a, - int width) { -- asm volatile ( -+ asm volatile( -+ - "sub %1,%2 \n" - "sub %1,%3 \n" - "sub %1,%4 \n" -@@ -5776,7 +5923,9 @@ void SplitXRGBRow_SSE2(const uint8_t* sr - uint8_t* dst_g, - uint8_t* dst_b, - int width) { -- asm volatile (LABELALIGN -+ asm volatile( -+ -+ LABELALIGN - "1: \n" - - "movdqu (%0),%%xmm0 \n" // 00-0F -@@ -5825,7 +5974,8 @@ void SplitARGBRow_SSSE3(const uint8_t* s - uint8_t* dst_b, - uint8_t* dst_a, - int width) { -- asm volatile ( -+ asm volatile( -+ - "movdqa %6,%%xmm3 \n" - "sub %1,%2 \n" - "sub %1,%3 \n" -@@ -5871,7 +6021,8 @@ void SplitXRGBRow_SSSE3(const uint8_t* s - uint8_t* dst_g, - uint8_t* dst_b, - int width) { -- asm volatile ( -+ asm volatile( -+ - "movdqa %5,%%xmm3 \n" - - LABELALIGN -@@ -5912,7 +6063,8 @@ void SplitARGBRow_AVX2(const uint8_t* sr - uint8_t* dst_b, - uint8_t* dst_a, - int width) { -- asm volatile ( -+ asm volatile( -+ - "sub %1,%2 \n" - "sub %1,%3 \n" - "sub %1,%4 \n" -@@ -5963,7 +6115,8 @@ void SplitXRGBRow_AVX2(const uint8_t* sr - uint8_t* dst_g, - uint8_t* dst_b, - int width) { -- asm volatile ( -+ asm volatile( -+ - "vmovdqa %6,%%ymm3 \n" - "vbroadcastf128 %5,%%ymm4 \n" - -@@ -6010,7 +6163,8 @@ void MergeXR30Row_AVX2(const uint16_t* s - int depth, - int width) { - int shift = depth - 10; -- asm volatile ( -+ asm volatile( -+ - "sub %0,%1 \n" - "sub %0,%2 \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants -@@ -6076,7 +6230,8 @@ void MergeAR64Row_AVX2(const uint16_t* s - int shift = 16 - depth; - int mask = (1 << depth) - 1; - mask = (mask << 16) + mask; -- asm volatile ( -+ asm volatile( -+ - "sub %0,%1 \n" - "sub %0,%2 \n" - "sub %0,%3 \n" -@@ -6147,7 +6302,8 @@ void MergeXR64Row_AVX2(const uint16_t* s - int shift = 16 - depth; - int mask = (1 << depth) - 1; - mask = (mask << 16) + mask; -- asm volatile ( -+ asm volatile( -+ - "sub %0,%1 \n" - "sub %0,%2 \n" - "vmovdqa %7,%%ymm5 \n" -@@ -6210,7 +6366,8 @@ void MergeARGB16To8Row_AVX2(const uint16 - int depth, - int width) { - int shift = depth - 8; -- asm volatile ( -+ asm volatile( -+ - "sub %0,%1 \n" - "sub %0,%2 \n" - "sub %0,%3 \n" -@@ -6266,7 +6423,8 @@ void MergeXRGB16To8Row_AVX2(const uint16 - int depth, - int width) { - int shift = depth - 8; -- asm volatile ( -+ asm volatile( -+ - "sub %0,%1 \n" - "sub %0,%2 \n" - "vbroadcastf128 %6,%%ymm5 \n" -@@ -6310,7 +6468,7 @@ void MergeXRGB16To8Row_AVX2(const uint16 - - #ifdef HAS_COPYROW_SSE2 - void CopyRow_SSE2(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - "test $0xf,%0 \n" - "jne 2f \n" - "test $0xf,%1 \n" -@@ -6350,7 +6508,9 @@ void CopyRow_SSE2(const uint8_t* src, ui - - #ifdef HAS_COPYROW_AVX - void CopyRow_AVX(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile (LABELALIGN -+ asm volatile( -+ -+ LABELALIGN - "1: \n" - "vmovdqu (%0),%%ymm0 \n" - "vmovdqu 0x20(%0),%%ymm1 \n" -@@ -6373,7 +6533,8 @@ void CopyRow_AVX(const uint8_t* src, uin - // Multiple of 1. - void CopyRow_ERMS(const uint8_t* src, uint8_t* dst, int width) { - size_t width_tmp = (size_t)(width); -- asm volatile ( -+ asm volatile( -+ - "rep movsb \n" - : "+S"(src), // %0 - "+D"(dst), // %1 -@@ -6386,7 +6547,7 @@ void CopyRow_ERMS(const uint8_t* src, ui - #ifdef HAS_ARGBCOPYALPHAROW_SSE2 - // width in pixels - void ARGBCopyAlphaRow_SSE2(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - "pcmpeqb %%xmm0,%%xmm0 \n" - "pslld $0x18,%%xmm0 \n" - "pcmpeqb %%xmm1,%%xmm1 \n" -@@ -6421,7 +6582,7 @@ void ARGBCopyAlphaRow_SSE2(const uint8_t - #ifdef HAS_ARGBCOPYALPHAROW_AVX2 - // width in pixels - void ARGBCopyAlphaRow_AVX2(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - "vpcmpeqb %%ymm0,%%ymm0,%%ymm0 \n" - "vpsrld $0x8,%%ymm0,%%ymm0 \n" - -@@ -6451,7 +6612,9 @@ void ARGBCopyAlphaRow_AVX2(const uint8_t - void ARGBExtractAlphaRow_SSE2(const uint8_t* src_argb, - uint8_t* dst_a, - int width) { -- asm volatile (LABELALIGN -+ asm volatile( -+ -+ LABELALIGN - "1: \n" - "movdqu (%0), %%xmm0 \n" - "movdqu 0x10(%0), %%xmm1 \n" -@@ -6480,7 +6643,7 @@ static const uvec8 kShuffleAlphaShort_AV - void ARGBExtractAlphaRow_AVX2(const uint8_t* src_argb, - uint8_t* dst_a, - int width) { -- asm volatile ( -+ asm volatile( - "vmovdqa %3,%%ymm4 \n" - "vbroadcastf128 %4,%%ymm5 \n" - -@@ -6516,7 +6679,7 @@ void ARGBExtractAlphaRow_AVX2(const uint - #ifdef HAS_ARGBCOPYYTOALPHAROW_SSE2 - // width in pixels - void ARGBCopyYToAlphaRow_SSE2(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - "pcmpeqb %%xmm0,%%xmm0 \n" - "pslld $0x18,%%xmm0 \n" - "pcmpeqb %%xmm1,%%xmm1 \n" -@@ -6553,7 +6716,7 @@ void ARGBCopyYToAlphaRow_SSE2(const uint - #ifdef HAS_ARGBCOPYYTOALPHAROW_AVX2 - // width in pixels - void ARGBCopyYToAlphaRow_AVX2(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - "vpcmpeqb %%ymm0,%%ymm0,%%ymm0 \n" - "vpsrld $0x8,%%ymm0,%%ymm0 \n" - -@@ -6584,7 +6747,8 @@ void ARGBCopyYToAlphaRow_AVX2(const uint - void SetRow_X86(uint8_t* dst, uint8_t v8, int width) { - size_t width_tmp = (size_t)(width >> 2); - const uint32_t v32 = v8 * 0x01010101u; // Duplicate byte to all bytes. -- asm volatile ( -+ asm volatile( -+ - "rep stosl \n" - : "+D"(dst), // %0 - "+c"(width_tmp) // %1 -@@ -6594,7 +6758,8 @@ void SetRow_X86(uint8_t* dst, uint8_t v8 - - void SetRow_ERMS(uint8_t* dst, uint8_t v8, int width) { - size_t width_tmp = (size_t)(width); -- asm volatile ( -+ asm volatile( -+ - "rep stosb \n" - : "+D"(dst), // %0 - "+c"(width_tmp) // %1 -@@ -6604,7 +6769,8 @@ void SetRow_ERMS(uint8_t* dst, uint8_t v - - void ARGBSetRow_X86(uint8_t* dst_argb, uint32_t v32, int width) { - size_t width_tmp = (size_t)(width); -- asm volatile ( -+ asm volatile( -+ - "rep stosl \n" - : "+D"(dst_argb), // %0 - "+c"(width_tmp) // %1 -@@ -6615,7 +6781,7 @@ void ARGBSetRow_X86(uint8_t* dst_argb, u - - #ifdef HAS_YUY2TOYROW_SSE2 - void YUY2ToYRow_SSE2(const uint8_t* src_yuy2, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "pcmpeqb %%xmm5,%%xmm5 \n" - "psrlw $0x8,%%xmm5 \n" - -@@ -6642,7 +6808,7 @@ void YUY2ToNVUVRow_SSE2(const uint8_t* s - int stride_yuy2, - uint8_t* dst_uv, - int width) { -- asm volatile (LABELALIGN -+ asm volatile(LABELALIGN - "1: \n" - "movdqu (%0),%%xmm0 \n" - "movdqu 0x10(%0),%%xmm1 \n" -@@ -6658,11 +6824,11 @@ void YUY2ToNVUVRow_SSE2(const uint8_t* s - "lea 0x10(%1),%1 \n" - "sub $0x10,%2 \n" - "jg 1b \n" -- : "+r"(src_yuy2), // %0 -- "+r"(dst_uv), // %1 -- "+r"(width) // %2 -- : "r"((intptr_t)(stride_yuy2)) // %3 -- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3"); -+ : "+r"(src_yuy2), // %0 -+ "+r"(dst_uv), // %1 -+ "+r"(width) // %2 -+ : "r"((intptr_t)(stride_yuy2)) // %3 -+ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3"); - } - - void YUY2ToUVRow_SSE2(const uint8_t* src_yuy2, -@@ -6670,7 +6836,7 @@ void YUY2ToUVRow_SSE2(const uint8_t* src - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "pcmpeqb %%xmm5,%%xmm5 \n" - "psrlw $0x8,%%xmm5 \n" - "sub %1,%2 \n" -@@ -6709,7 +6875,7 @@ void YUY2ToUV422Row_SSE2(const uint8_t* - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "pcmpeqb %%xmm5,%%xmm5 \n" - "psrlw $0x8,%%xmm5 \n" - "sub %1,%2 \n" -@@ -6741,7 +6907,9 @@ void YUY2ToUV422Row_SSE2(const uint8_t* - } - - void UYVYToYRow_SSE2(const uint8_t* src_uyvy, uint8_t* dst_y, int width) { -- asm volatile (LABELALIGN -+ asm volatile( -+ -+ LABELALIGN - "1: \n" - "movdqu (%0),%%xmm0 \n" - "movdqu 0x10(%0),%%xmm1 \n" -@@ -6765,7 +6933,7 @@ void UYVYToUVRow_SSE2(const uint8_t* src - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "pcmpeqb %%xmm5,%%xmm5 \n" - "psrlw $0x8,%%xmm5 \n" - "sub %1,%2 \n" -@@ -6804,7 +6972,7 @@ void UYVYToUV422Row_SSE2(const uint8_t* - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "pcmpeqb %%xmm5,%%xmm5 \n" - "psrlw $0x8,%%xmm5 \n" - "sub %1,%2 \n" -@@ -6838,7 +7006,7 @@ void UYVYToUV422Row_SSE2(const uint8_t* - - #ifdef HAS_YUY2TOYROW_AVX2 - void YUY2ToYRow_AVX2(const uint8_t* src_yuy2, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" - "vpsrlw $0x8,%%ymm5,%%ymm5 \n" - -@@ -6867,7 +7035,9 @@ void YUY2ToNVUVRow_AVX2(const uint8_t* s - int stride_yuy2, - uint8_t* dst_uv, - int width) { -- asm volatile (LABELALIGN -+ asm volatile( -+ -+ LABELALIGN - "1: \n" - "vmovdqu (%0),%%ymm0 \n" - "vmovdqu 0x20(%0),%%ymm1 \n" -@@ -6895,7 +7065,7 @@ void YUY2ToUVRow_AVX2(const uint8_t* src - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" - "vpsrlw $0x8,%%ymm5,%%ymm5 \n" - "sub %1,%2 \n" -@@ -6935,7 +7105,7 @@ void YUY2ToUV422Row_AVX2(const uint8_t* - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" - "vpsrlw $0x8,%%ymm5,%%ymm5 \n" - "sub %1,%2 \n" -@@ -6970,7 +7140,9 @@ void YUY2ToUV422Row_AVX2(const uint8_t* - } - - void UYVYToYRow_AVX2(const uint8_t* src_uyvy, uint8_t* dst_y, int width) { -- asm volatile (LABELALIGN -+ asm volatile( -+ -+ LABELALIGN - "1: \n" - "vmovdqu (%0),%%ymm0 \n" - "vmovdqu 0x20(%0),%%ymm1 \n" -@@ -6995,7 +7167,7 @@ void UYVYToUVRow_AVX2(const uint8_t* src - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" - "vpsrlw $0x8,%%ymm5,%%ymm5 \n" - "sub %1,%2 \n" -@@ -7035,7 +7207,7 @@ void UYVYToUV422Row_AVX2(const uint8_t* - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" - "vpsrlw $0x8,%%ymm5,%%ymm5 \n" - "sub %1,%2 \n" -@@ -7080,7 +7252,7 @@ void ARGBBlendRow_SSSE3(const uint8_t* s - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "pcmpeqb %%xmm7,%%xmm7 \n" - "psrlw $0xf,%%xmm7 \n" - "pcmpeqb %%xmm6,%%xmm6 \n" -@@ -7168,7 +7340,7 @@ void BlendPlaneRow_SSSE3(const uint8_t* - const uint8_t* alpha, - uint8_t* dst, - int width) { -- asm volatile ( -+ asm volatile( - "pcmpeqb %%xmm5,%%xmm5 \n" - "psllw $0x8,%%xmm5 \n" - "mov $0x80808080,%%eax \n" -@@ -7220,7 +7392,7 @@ void BlendPlaneRow_AVX2(const uint8_t* s - const uint8_t* alpha, - uint8_t* dst, - int width) { -- asm volatile ( -+ asm volatile( - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" - "vpsllw $0x8,%%ymm5,%%ymm5 \n" - "mov $0x80808080,%%eax \n" -@@ -7272,106 +7444,93 @@ void BlendPlaneRow_AVX2(const uint8_t* s - - #ifdef HAS_ARGBATTENUATEROW_SSSE3 - // Shuffle table duplicating alpha. --static const vec8 kAttenuateShuffle = {6, -128, 6, -128, 6, -128, -- -128, -128, 14, -128, 14, -128, -- 14, -128, -128, -128}; -- -+static const uvec8 kShuffleAlpha0 = {3u, 3u, 3u, 3u, 3u, 3u, 128u, 128u, -+ 7u, 7u, 7u, 7u, 7u, 7u, 128u, 128u}; -+static const uvec8 kShuffleAlpha1 = {11u, 11u, 11u, 11u, 11u, 11u, 128u, 128u, -+ 15u, 15u, 15u, 15u, 15u, 15u, 128u, 128u}; - // Attenuate 4 pixels at a time. - void ARGBAttenuateRow_SSSE3(const uint8_t* src_argb, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( -+ "pcmpeqb %%xmm3,%%xmm3 \n" -+ "pslld $0x18,%%xmm3 \n" - "movdqa %3,%%xmm4 \n" -- "pcmpeqb %%xmm5,%%xmm5 \n" -- "pslld $0x18,%%xmm5 \n" -- "pxor %%xmm6,%%xmm6 \n" -- "pcmpeqb %%xmm7,%%xmm7 \n" -- "punpcklbw %%xmm6,%%xmm7 \n" -- "sub %0,%1 \n" -+ "movdqa %4,%%xmm5 \n" - - // 4 pixel loop. - LABELALIGN - "1: \n" -- "movdqu (%0),%%xmm6 \n" -- "movdqa %%xmm6,%%xmm0 \n" -- "movdqa %%xmm6,%%xmm1 \n" -- "punpcklbw %%xmm5,%%xmm0 \n" -- "punpckhbw %%xmm5,%%xmm1 \n" -- "movdqa %%xmm0,%%xmm2 \n" -- "movdqa %%xmm1,%%xmm3 \n" -- "pshufb %%xmm4,%%xmm2 \n" // a,a,a,0 -- "pshufb %%xmm4,%%xmm3 \n" -- "pmullw %%xmm2,%%xmm0 \n" // rgb * alpha -- "pmullw %%xmm3,%%xmm1 \n" -- "paddw %%xmm7,%%xmm0 \n" // + 255 -- "paddw %%xmm7,%%xmm1 \n" -+ "movdqu (%0),%%xmm0 \n" -+ "pshufb %%xmm4,%%xmm0 \n" -+ "movdqu (%0),%%xmm1 \n" -+ "punpcklbw %%xmm1,%%xmm1 \n" -+ "pmulhuw %%xmm1,%%xmm0 \n" -+ "movdqu (%0),%%xmm1 \n" -+ "pshufb %%xmm5,%%xmm1 \n" -+ "movdqu (%0),%%xmm2 \n" -+ "punpckhbw %%xmm2,%%xmm2 \n" -+ "pmulhuw %%xmm2,%%xmm1 \n" -+ "movdqu (%0),%%xmm2 \n" -+ "lea 0x10(%0),%0 \n" -+ "pand %%xmm3,%%xmm2 \n" - "psrlw $0x8,%%xmm0 \n" - "psrlw $0x8,%%xmm1 \n" - "packuswb %%xmm1,%%xmm0 \n" -- "pand %%xmm5,%%xmm6 \n" -- "por %%xmm6,%%xmm0 \n" -- "movdqu %%xmm0,(%0,%1) \n" -- "lea 0x10(%0),%0 \n" -+ "por %%xmm2,%%xmm0 \n" -+ "movdqu %%xmm0,(%1) \n" -+ "lea 0x10(%1),%1 \n" - "sub $0x4,%2 \n" - "jg 1b \n" -- : "+r"(src_argb), // %0 -- "+r"(dst_argb), // %1 -- "+r"(width) // %2 -- : "m"(kAttenuateShuffle) // %3 -- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", -- "xmm7"); -+ : "+r"(src_argb), // %0 -+ "+r"(dst_argb), // %1 -+ "+r"(width) // %2 -+ : "m"(kShuffleAlpha0), // %3 -+ "m"(kShuffleAlpha1) // %4 -+ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5"); - } - #endif // HAS_ARGBATTENUATEROW_SSSE3 - - #ifdef HAS_ARGBATTENUATEROW_AVX2 -- - // Shuffle table duplicating alpha. --static const lvec8 kAttenuateShuffle_AVX2 = { -- 6, -128, 6, -128, 6, -128, -128, -128, 14, -128, 14, -- -128, 14, -128, -128, -128, 22, -128, 22, -128, 22, -128, -- -128, -128, 30, -128, 30, -128, 30, -128, -128, -128}; -- -+static const uvec8 kShuffleAlpha_AVX2 = {6u, 7u, 6u, 7u, 6u, 7u, -+ 128u, 128u, 14u, 15u, 14u, 15u, -+ 14u, 15u, 128u, 128u}; - // Attenuate 8 pixels at a time. - void ARGBAttenuateRow_AVX2(const uint8_t* src_argb, - uint8_t* dst_argb, - int width) { -- asm volatile ( -- "vmovdqa %3,%%ymm4 \n" -+ asm volatile( -+ "vbroadcastf128 %3,%%ymm4 \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" - "vpslld $0x18,%%ymm5,%%ymm5 \n" -- "vpxor %%ymm6,%%ymm6,%%ymm6 \n" -- "vpcmpeqb %%ymm7,%%ymm7,%%ymm7 \n" -- "vpunpcklbw %%ymm6,%%ymm7,%%ymm7 \n" - "sub %0,%1 \n" - - // 8 pixel loop. - LABELALIGN - "1: \n" - "vmovdqu (%0),%%ymm6 \n" -- "vpunpcklbw %%ymm5,%%ymm6,%%ymm0 \n" -- "vpunpckhbw %%ymm5,%%ymm6,%%ymm1 \n" -+ "vpunpcklbw %%ymm6,%%ymm6,%%ymm0 \n" -+ "vpunpckhbw %%ymm6,%%ymm6,%%ymm1 \n" - "vpshufb %%ymm4,%%ymm0,%%ymm2 \n" - "vpshufb %%ymm4,%%ymm1,%%ymm3 \n" -- "vpmullw %%ymm2,%%ymm0,%%ymm0 \n" -- "vpmullw %%ymm3,%%ymm1,%%ymm1 \n" -- "vpaddw %%ymm7,%%ymm0,%%ymm0 \n" -- "vpaddw %%ymm7,%%ymm1,%%ymm1 \n" -+ "vpmulhuw %%ymm2,%%ymm0,%%ymm0 \n" -+ "vpmulhuw %%ymm3,%%ymm1,%%ymm1 \n" -+ "vpand %%ymm5,%%ymm6,%%ymm6 \n" - "vpsrlw $0x8,%%ymm0,%%ymm0 \n" - "vpsrlw $0x8,%%ymm1,%%ymm1 \n" - "vpackuswb %%ymm1,%%ymm0,%%ymm0 \n" -- "vpand %%ymm5,%%ymm6,%%ymm1 \n" -- "vpor %%ymm1,%%ymm0,%%ymm0 \n" -+ "vpor %%ymm6,%%ymm0,%%ymm0 \n" - "vmovdqu %%ymm0,0x00(%0,%1,1) \n" - "lea 0x20(%0),%0 \n" - "sub $0x8,%2 \n" - "jg 1b \n" - "vzeroupper \n" -- : "+r"(src_argb), // %0 -- "+r"(dst_argb), // %1 -- "+r"(width) // %2 -- : "m"(kAttenuateShuffle_AVX2) // %3 -- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", -- "xmm7"); -+ : "+r"(src_argb), // %0 -+ "+r"(dst_argb), // %1 -+ "+r"(width) // %2 -+ : "m"(kShuffleAlpha_AVX2) // %3 -+ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6"); - } - #endif // HAS_ARGBATTENUATEROW_AVX2 - -@@ -7381,7 +7540,7 @@ void ARGBUnattenuateRow_SSE2(const uint8 - uint8_t* dst_argb, - int width) { - uintptr_t alpha; -- asm( -+ asm volatile( - // 4 pixel loop. - LABELALIGN - "1: \n" -@@ -7429,7 +7588,7 @@ void ARGBUnattenuateRow_AVX2(const uint8 - uint8_t* dst_argb, - int width) { - uintptr_t alpha; -- asm volatile ( -+ asm volatile( - "sub %0,%1 \n" - "vbroadcastf128 %5,%%ymm5 \n" - -@@ -7491,7 +7650,7 @@ void ARGBUnattenuateRow_AVX2(const uint8 - #ifdef HAS_ARGBGRAYROW_SSSE3 - // Convert 8 ARGB pixels (64 bytes) to 8 Gray ARGB pixels - void ARGBGrayRow_SSSE3(const uint8_t* src_argb, uint8_t* dst_argb, int width) { -- asm volatile ( -+ asm volatile( - "movdqa %3,%%xmm4 \n" - "movdqa %4,%%xmm5 \n" - -@@ -7553,7 +7712,7 @@ static const vec8 kARGBToSepiaR = {24, 9 - - // Convert 8 ARGB pixels (32 bytes) to 8 Sepia ARGB pixels. - void ARGBSepiaRow_SSSE3(uint8_t* dst_argb, int width) { -- asm volatile ( -+ asm volatile( - "movdqa %2,%%xmm2 \n" - "movdqa %3,%%xmm3 \n" - "movdqa %4,%%xmm4 \n" -@@ -7614,7 +7773,7 @@ void ARGBColorMatrixRow_SSSE3(const uint - uint8_t* dst_argb, - const int8_t* matrix_argb, - int width) { -- asm volatile ( -+ asm volatile( - "movdqu (%3),%%xmm5 \n" - "pshufd $0x00,%%xmm5,%%xmm2 \n" - "pshufd $0x55,%%xmm5,%%xmm3 \n" -@@ -7679,7 +7838,7 @@ void ARGBQuantizeRow_SSE2(uint8_t* dst_a - int interval_size, - int interval_offset, - int width) { -- asm volatile ( -+ asm volatile( - "movd %2,%%xmm2 \n" - "movd %3,%%xmm3 \n" - "movd %4,%%xmm4 \n" -@@ -7730,7 +7889,7 @@ void ARGBShadeRow_SSE2(const uint8_t* sr - uint8_t* dst_argb, - int width, - uint32_t value) { -- asm volatile ( -+ asm volatile( - "movd %3,%%xmm2 \n" - "punpcklbw %%xmm2,%%xmm2 \n" - "punpcklqdq %%xmm2,%%xmm2 \n" -@@ -7766,7 +7925,8 @@ void ARGBMultiplyRow_SSE2(const uint8_t* - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( -+ - "pxor %%xmm5,%%xmm5 \n" - - // 4 pixel loop. -@@ -7804,7 +7964,8 @@ void ARGBMultiplyRow_AVX2(const uint8_t* - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( -+ - "vpxor %%ymm5,%%ymm5,%%ymm5 \n" - - // 4 pixel loop. -@@ -7841,7 +8002,7 @@ void ARGBAddRow_SSE2(const uint8_t* src_ - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width) { -- asm( -+ asm volatile( - // 4 pixel loop. - LABELALIGN - "1: \n" -@@ -7869,7 +8030,7 @@ void ARGBAddRow_AVX2(const uint8_t* src_ - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width) { -- asm( -+ asm volatile( - // 4 pixel loop. - LABELALIGN - "1: \n" -@@ -7897,7 +8058,7 @@ void ARGBSubtractRow_SSE2(const uint8_t* - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width) { -- asm( -+ asm volatile( - // 4 pixel loop. - LABELALIGN - "1: \n" -@@ -7925,7 +8086,7 @@ void ARGBSubtractRow_AVX2(const uint8_t* - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width) { -- asm( -+ asm volatile( - // 4 pixel loop. - LABELALIGN - "1: \n" -@@ -7957,7 +8118,7 @@ void SobelXRow_SSE2(const uint8_t* src_y - const uint8_t* src_y2, - uint8_t* dst_sobelx, - int width) { -- asm volatile ( -+ asm volatile( - "sub %0,%1 \n" - "sub %0,%2 \n" - "sub %0,%3 \n" -@@ -8011,7 +8172,7 @@ void SobelYRow_SSE2(const uint8_t* src_y - const uint8_t* src_y1, - uint8_t* dst_sobely, - int width) { -- asm volatile ( -+ asm volatile( - "sub %0,%1 \n" - "sub %0,%2 \n" - "pxor %%xmm5,%%xmm5 \n" -@@ -8064,7 +8225,7 @@ void SobelRow_SSE2(const uint8_t* src_so - const uint8_t* src_sobely, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "sub %0,%1 \n" - "pcmpeqb %%xmm5,%%xmm5 \n" - "pslld $0x18,%%xmm5 \n" -@@ -8111,7 +8272,7 @@ void SobelToPlaneRow_SSE2(const uint8_t* - const uint8_t* src_sobely, - uint8_t* dst_y, - int width) { -- asm volatile ( -+ asm volatile( - "sub %0,%1 \n" - "pcmpeqb %%xmm5,%%xmm5 \n" - "pslld $0x18,%%xmm5 \n" -@@ -8146,7 +8307,7 @@ void SobelXYRow_SSE2(const uint8_t* src_ - const uint8_t* src_sobely, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "sub %0,%1 \n" - "pcmpeqb %%xmm5,%%xmm5 \n" - -@@ -8194,7 +8355,7 @@ void ComputeCumulativeSumRow_SSE2(const - int32_t* cumsum, - const int32_t* previous_cumsum, - int width) { -- asm volatile ( -+ asm volatile( - "pxor %%xmm0,%%xmm0 \n" - "pxor %%xmm1,%%xmm1 \n" - "sub $0x4,%3 \n" -@@ -8274,7 +8435,7 @@ void CumulativeSumToAverageRow_SSE2(cons - int area, - uint8_t* dst, - int count) { -- asm volatile ( -+ asm volatile( - "movd %5,%%xmm5 \n" - "cvtdq2ps %%xmm5,%%xmm5 \n" - "rcpss %%xmm5,%%xmm4 \n" -@@ -8409,7 +8570,7 @@ void ARGBAffineRow_SSE2(const uint8_t* s - int width) { - intptr_t src_argb_stride_temp = src_argb_stride; - intptr_t temp; -- asm volatile ( -+ asm volatile( - "movq (%3),%%xmm2 \n" - "movq 0x08(%3),%%xmm7 \n" - "shl $0x10,%1 \n" -@@ -8494,7 +8655,7 @@ void InterpolateRow_SSSE3(uint8_t* dst_p - ptrdiff_t src_stride, - int width, - int source_y_fraction) { -- asm volatile ( -+ asm volatile( - "sub %1,%0 \n" - "cmp $0x0,%3 \n" - "je 100f \n" -@@ -8575,7 +8736,7 @@ void InterpolateRow_AVX2(uint8_t* dst_pt - ptrdiff_t src_stride, - int width, - int source_y_fraction) { -- asm volatile ( -+ asm volatile( - "sub %1,%0 \n" - "cmp $0x0,%3 \n" - "je 100f \n" -@@ -8652,7 +8813,8 @@ void ARGBShuffleRow_SSSE3(const uint8_t* - uint8_t* dst_argb, - const uint8_t* shuffler, - int width) { -- asm volatile ( -+ asm volatile( -+ - "movdqu (%3),%%xmm5 \n" - - LABELALIGN -@@ -8681,7 +8843,8 @@ void ARGBShuffleRow_AVX2(const uint8_t* - uint8_t* dst_argb, - const uint8_t* shuffler, - int width) { -- asm volatile ( -+ asm volatile( -+ - "vbroadcastf128 (%3),%%ymm5 \n" - - LABELALIGN -@@ -8711,7 +8874,8 @@ void I422ToYUY2Row_SSE2(const uint8_t* s - const uint8_t* src_v, - uint8_t* dst_yuy2, - int width) { -- asm volatile ( -+ asm volatile( -+ - "sub %1,%2 \n" - - LABELALIGN -@@ -8746,7 +8910,8 @@ void I422ToUYVYRow_SSE2(const uint8_t* s - const uint8_t* src_v, - uint8_t* dst_uyvy, - int width) { -- asm volatile ( -+ asm volatile( -+ - "sub %1,%2 \n" - - LABELALIGN -@@ -8781,7 +8946,8 @@ void I422ToYUY2Row_AVX2(const uint8_t* s - const uint8_t* src_v, - uint8_t* dst_yuy2, - int width) { -- asm volatile ( -+ asm volatile( -+ - "sub %1,%2 \n" - - LABELALIGN -@@ -8819,7 +8985,8 @@ void I422ToUYVYRow_AVX2(const uint8_t* s - const uint8_t* src_v, - uint8_t* dst_uyvy, - int width) { -- asm volatile ( -+ asm volatile( -+ - "sub %1,%2 \n" - - LABELALIGN -@@ -8856,7 +9023,8 @@ void ARGBPolynomialRow_SSE2(const uint8_ - uint8_t* dst_argb, - const float* poly, - int width) { -- asm volatile ( -+ asm volatile( -+ - "pxor %%xmm3,%%xmm3 \n" - - // 2 pixel loop. -@@ -8911,7 +9079,7 @@ void ARGBPolynomialRow_AVX2(const uint8_ - uint8_t* dst_argb, - const float* poly, - int width) { -- asm volatile ( -+ asm volatile( - "vbroadcastf128 (%3),%%ymm4 \n" - "vbroadcastf128 0x10(%3),%%ymm5 \n" - "vbroadcastf128 0x20(%3),%%ymm6 \n" -@@ -8954,7 +9122,7 @@ void HalfFloatRow_SSE2(const uint16_t* s - float scale, - int width) { - scale *= kScaleBias; -- asm volatile ( -+ asm volatile( - "movd %3,%%xmm4 \n" - "pshufd $0x0,%%xmm4,%%xmm4 \n" - "pxor %%xmm5,%%xmm5 \n" -@@ -8992,7 +9160,7 @@ void HalfFloatRow_AVX2(const uint16_t* s - float scale, - int width) { - scale *= kScaleBias; -- asm volatile ( -+ asm volatile( - "vbroadcastss %3, %%ymm4 \n" - "vpxor %%ymm5,%%ymm5,%%ymm5 \n" - "sub %0,%1 \n" -@@ -9033,7 +9201,7 @@ void HalfFloatRow_F16C(const uint16_t* s - uint16_t* dst, - float scale, - int width) { -- asm volatile ( -+ asm volatile( - "vbroadcastss %3, %%ymm4 \n" - "sub %0,%1 \n" - -@@ -9068,7 +9236,7 @@ void HalfFloatRow_F16C(const uint16_t* s - - #ifdef HAS_HALFFLOATROW_F16C - void HalfFloat1Row_F16C(const uint16_t* src, uint16_t* dst, float, int width) { -- asm volatile ( -+ asm volatile( - "sub %0,%1 \n" - // 16 pixel loop. - LABELALIGN -@@ -9099,7 +9267,7 @@ void ARGBColorTableRow_X86(uint8_t* dst_ - const uint8_t* table_argb, - int width) { - uintptr_t pixel_temp; -- asm( -+ asm volatile( - // 1 pixel loop. - LABELALIGN - "1: \n" -@@ -9132,7 +9300,7 @@ void RGBColorTableRow_X86(uint8_t* dst_a - const uint8_t* table_argb, - int width) { - uintptr_t pixel_temp; -- asm( -+ asm volatile( - // 1 pixel loop. - LABELALIGN - "1: \n" -@@ -9165,7 +9333,7 @@ void ARGBLumaColorTableRow_SSSE3(const u - uint32_t lumacoeff) { - uintptr_t pixel_temp; - uintptr_t table_temp; -- asm volatile ( -+ asm volatile( - "movd %6,%%xmm3 \n" - "pshufd $0x0,%%xmm3,%%xmm3 \n" - "pcmpeqb %%xmm4,%%xmm4 \n" -@@ -9269,7 +9437,7 @@ void NV21ToYUV24Row_SSSE3(const uint8_t* - const uint8_t* src_vu, - uint8_t* dst_yuv24, - int width) { -- asm volatile ( -+ asm volatile( - "sub %0,%1 \n" - "movdqa (%4),%%xmm4 \n" // 3 shuffler constants - "movdqa 16(%4),%%xmm5 \n" -@@ -9307,7 +9475,7 @@ void NV21ToYUV24Row_AVX2(const uint8_t* - const uint8_t* src_vu, - uint8_t* dst_yuv24, - int width) { -- asm volatile ( -+ asm volatile( - "sub %0,%1 \n" - "vbroadcastf128 (%4),%%ymm4 \n" // 3 shuffler constants - "vbroadcastf128 16(%4),%%ymm5 \n" -@@ -9355,7 +9523,7 @@ void NV21ToYUV24Row_AVX512(const uint8_t - const uint8_t* src_vu, - uint8_t* dst_yuv24, - int width) { -- asm volatile ( -+ asm volatile( - "sub %0,%1 \n" - "vmovdqa (%4),%%ymm4 \n" // 3 shuffler constants - "vmovdqa 32(%4),%%ymm5 \n" -@@ -9394,7 +9562,8 @@ static const uvec8 kShuffleUVToVU = {1u, - - // Convert UV plane of NV12 to VU of NV21. - void SwapUVRow_SSSE3(const uint8_t* src_uv, uint8_t* dst_vu, int width) { -- asm volatile ( -+ asm volatile( -+ - "movdqu %3,%%xmm5 \n" - - LABELALIGN -@@ -9419,7 +9588,8 @@ void SwapUVRow_SSSE3(const uint8_t* src_ - - #ifdef HAS_SWAPUVROW_AVX2 - void SwapUVRow_AVX2(const uint8_t* src_uv, uint8_t* dst_vu, int width) { -- asm volatile ( -+ asm volatile( -+ - "vbroadcastf128 %3,%%ymm5 \n" - - LABELALIGN -@@ -9449,7 +9619,7 @@ void HalfMergeUVRow_SSSE3(const uint8_t* - int src_stride_v, - uint8_t* dst_uv, - int width) { -- asm volatile ( -+ asm volatile( - "pcmpeqb %%xmm4,%%xmm4 \n" - "psrlw $0xf,%%xmm4 \n" - "packuswb %%xmm4,%%xmm4 \n" -@@ -9495,7 +9665,7 @@ void HalfMergeUVRow_AVX2(const uint8_t* - int src_stride_v, - uint8_t* dst_uv, - int width) { -- asm volatile ( -+ asm volatile( - "vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" - "vpsrlw $0xf,%%ymm4,%%ymm4 \n" - "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" -@@ -9537,7 +9707,7 @@ void HalfMergeUVRow_AVX2(const uint8_t* - } - - void ClampFloatToZero_SSE2(const float* src_x, float* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "pxor %%xmm1,%%xmm1 \n" - - LABELALIGN -diff --git a/media/libyuv/libyuv/source/row_lasx.cc b/media/libyuv/libyuv/source/row_lasx.cc ---- a/media/libyuv/libyuv/source/row_lasx.cc -+++ b/media/libyuv/libyuv/source/row_lasx.cc -@@ -543,8 +543,8 @@ void I422ToARGB4444Row_LASX(const uint8_ - __m256i vec_yb, vec_yg, vec_ub, vec_vr, vec_ug, vec_vg; - __m256i vec_ubvr, vec_ugvg; - __m256i const_0x80 = __lasx_xvldi(0x80); -- __m256i alpha = (__m256i)v4u64{0xF000F000F000F000, 0xF000F000F000F000, -- 0xF000F000F000F000, 0xF000F000F000F000}; -+ __m256i alpha = {0xF000F000F000F000, 0xF000F000F000F000, 0xF000F000F000F000, -+ 0xF000F000F000F000}; - __m256i mask = {0x00F000F000F000F0, 0x00F000F000F000F0, 0x00F000F000F000F0, - 0x00F000F000F000F0}; - -@@ -595,8 +595,8 @@ void I422ToARGB1555Row_LASX(const uint8_ - __m256i vec_yb, vec_yg, vec_ub, vec_vr, vec_ug, vec_vg; - __m256i vec_ubvr, vec_ugvg; - __m256i const_0x80 = __lasx_xvldi(0x80); -- __m256i alpha = (__m256i)v4u64{0x8000800080008000, 0x8000800080008000, -- 0x8000800080008000, 0x8000800080008000}; -+ __m256i alpha = {0x8000800080008000, 0x8000800080008000, 0x8000800080008000, -+ 0x8000800080008000}; - - YUVTORGB_SETUP(yuvconstants, vec_ub, vec_vr, vec_ug, vec_vg, vec_yg, vec_yb); - vec_ubvr = __lasx_xvilvl_h(vec_ub, vec_vr); -@@ -799,8 +799,8 @@ void ARGBToUVRow_LASX(const uint8_t* src - 0x0009000900090009, 0x0009000900090009}; - __m256i control = {0x0000000400000000, 0x0000000500000001, 0x0000000600000002, - 0x0000000700000003}; -- __m256i const_0x8080 = (__m256i)v4u64{0x8080808080808080, 0x8080808080808080, -- 0x8080808080808080, 0x8080808080808080}; -+ __m256i const_0x8080 = {0x8080808080808080, 0x8080808080808080, -+ 0x8080808080808080, 0x8080808080808080}; - - for (x = 0; x < len; x++) { - DUP4_ARG2(__lasx_xvld, src_argb0, 0, src_argb0, 32, src_argb0, 64, -@@ -1037,8 +1037,8 @@ void ARGBToUV444Row_LASX(const uint8_t* - __m256i const_38 = __lasx_xvldi(38); - __m256i const_94 = __lasx_xvldi(94); - __m256i const_18 = __lasx_xvldi(18); -- __m256i const_0x8080 = (__m256i)v4u64{0x8080808080808080, 0x8080808080808080, -- 0x8080808080808080, 0x8080808080808080}; -+ __m256i const_0x8080 = {0x8080808080808080, 0x8080808080808080, -+ 0x8080808080808080, 0x8080808080808080}; - __m256i control = {0x0000000400000000, 0x0000000500000001, 0x0000000600000002, - 0x0000000700000003}; - for (x = 0; x < len; x++) { -@@ -1182,7 +1182,7 @@ void ARGBAttenuateRow_LASX(const uint8_t - - void ARGBToRGB565DitherRow_LASX(const uint8_t* src_argb, - uint8_t* dst_rgb, -- uint32_t dither4, -+ const uint32_t dither4, - int width) { - int x; - int len = width / 16; -@@ -1609,8 +1609,8 @@ void ARGB1555ToUVRow_LASX(const uint8_t* - __m256i const_38 = __lasx_xvldi(0x413); - __m256i const_94 = __lasx_xvldi(0x42F); - __m256i const_18 = __lasx_xvldi(0x409); -- __m256i const_8080 = (__m256i)v4u64{0x8080808080808080, 0x8080808080808080, -- 0x8080808080808080, 0x8080808080808080}; -+ __m256i const_8080 = {0x8080808080808080, 0x8080808080808080, -+ 0x8080808080808080, 0x8080808080808080}; - - for (x = 0; x < len; x++) { - DUP4_ARG2(__lasx_xvld, src_argb1555, 0, src_argb1555, 32, next_argb1555, 0, -@@ -1726,8 +1726,8 @@ void RGB565ToUVRow_LASX(const uint8_t* s - __m256i const_38 = __lasx_xvldi(0x413); - __m256i const_94 = __lasx_xvldi(0x42F); - __m256i const_18 = __lasx_xvldi(0x409); -- __m256i const_8080 = (__m256i)v4u64{0x8080808080808080, 0x8080808080808080, -- 0x8080808080808080, 0x8080808080808080}; -+ __m256i const_8080 = {0x8080808080808080, 0x8080808080808080, -+ 0x8080808080808080, 0x8080808080808080}; - - for (x = 0; x < len; x++) { - DUP4_ARG2(__lasx_xvld, src_rgb565, 0, src_rgb565, 32, next_rgb565, 0, -@@ -1793,8 +1793,8 @@ void RGB24ToUVRow_LASX(const uint8_t* sr - __m256i const_38 = __lasx_xvldi(0x413); - __m256i const_94 = __lasx_xvldi(0x42F); - __m256i const_18 = __lasx_xvldi(0x409); -- __m256i const_8080 = (__m256i)v4u64{0x8080808080808080, 0x8080808080808080, -- 0x8080808080808080, 0x8080808080808080}; -+ __m256i const_8080 = {0x8080808080808080, 0x8080808080808080, -+ 0x8080808080808080, 0x8080808080808080}; - __m256i shuff0_b = {0x15120F0C09060300, 0x00000000001E1B18, - 0x15120F0C09060300, 0x00000000001E1B18}; - __m256i shuff1_b = {0x0706050403020100, 0x1D1A1714110A0908, -@@ -1856,8 +1856,8 @@ void RAWToUVRow_LASX(const uint8_t* src_ - __m256i const_38 = __lasx_xvldi(0x413); - __m256i const_94 = __lasx_xvldi(0x42F); - __m256i const_18 = __lasx_xvldi(0x409); -- __m256i const_8080 = (__m256i)v4u64{0x8080808080808080, 0x8080808080808080, -- 0x8080808080808080, 0x8080808080808080}; -+ __m256i const_8080 = {0x8080808080808080, 0x8080808080808080, -+ 0x8080808080808080, 0x8080808080808080}; - __m256i shuff0_r = {0x15120F0C09060300, 0x00000000001E1B18, - 0x15120F0C09060300, 0x00000000001E1B18}; - __m256i shuff1_r = {0x0706050403020100, 0x1D1A1714110A0908, -@@ -2037,7 +2037,7 @@ static void ARGBToYMatrixRow_LASX(const - int width, - const struct RgbConstants* rgbconstants) { - int32_t shuff[8] = {0, 4, 1, 5, 2, 6, 3, 7}; -- asm volatile ( -+ asm volatile( - "xvldrepl.b $xr0, %3, 0 \n\t" // load rgbconstants - "xvldrepl.b $xr1, %3, 1 \n\t" // load rgbconstants - "xvldrepl.b $xr2, %3, 2 \n\t" // load rgbconstants -@@ -2099,7 +2099,7 @@ static void RGBAToYMatrixRow_LASX(const - int width, - const struct RgbConstants* rgbconstants) { - int32_t shuff[8] = {0, 4, 1, 5, 2, 6, 3, 7}; -- asm volatile ( -+ asm volatile( - "xvldrepl.b $xr0, %3, 0 \n\t" // load rgbconstants - "xvldrepl.b $xr1, %3, 1 \n\t" // load rgbconstants - "xvldrepl.b $xr2, %3, 2 \n\t" // load rgbconstants -@@ -2163,7 +2163,7 @@ static void RGBToYMatrixRow_LASX(const u - 1, 0, 4, 0, 7, 0, 10, 0, 13, 0, 16, 0, 19, 0, 22, 0, - 25, 0, 28, 0, 31, 0, 2, 0, 5, 0, 8, 0, 11, 0, 14, 0, - 25, 0, 28, 0, 31, 0, 2, 0, 5, 0, 8, 0, 11, 0, 14, 0}; -- asm volatile ( -+ asm volatile( - "xvldrepl.b $xr0, %3, 0 \n\t" // load rgbconstants - "xvldrepl.b $xr1, %3, 1 \n\t" // load rgbconstants - "xvldrepl.b $xr2, %3, 2 \n\t" // load rgbconstants -@@ -2242,8 +2242,8 @@ void ARGBToUVJRow_LASX(const uint8_t* sr - __m256i const_21 = __lasx_xvldi(0x415); - __m256i const_53 = __lasx_xvldi(0x435); - __m256i const_10 = __lasx_xvldi(0x40A); -- __m256i const_8080 = (__m256i)v4u64{0x8080808080808080, 0x8080808080808080, -- 0x8080808080808080, 0x8080808080808080}; -+ __m256i const_8080 = {0x8080808080808080, 0x8080808080808080, -+ 0x8080808080808080, 0x8080808080808080}; - __m256i shuff = {0x1614060412100200, 0x1E1C0E0C1A180A08, 0x1715070513110301, - 0x1F1D0F0D1B190B09}; - -diff --git a/media/libyuv/libyuv/source/row_lsx.cc b/media/libyuv/libyuv/source/row_lsx.cc ---- a/media/libyuv/libyuv/source/row_lsx.cc -+++ b/media/libyuv/libyuv/source/row_lsx.cc -@@ -31,91 +31,6 @@ extern "C" { - yb = __lsx_vreplgr2vr_w(yuvconst->kYBiasToRgb[0]); \ - } - --// Load 32 YUV422 pixel data --#define READYUV422_D(psrc_y, psrc_u, psrc_v, out_y, uv_l, uv_h) \ -- { \ -- __m128i temp0, temp1; \ -- \ -- DUP2_ARG2(__lsx_vld, psrc_y, 0, psrc_u, 0, out_y, temp0); \ -- temp1 = __lsx_vld(psrc_v, 0); \ -- temp0 = __lsx_vsub_b(temp0, const_80); \ -- temp1 = __lsx_vsub_b(temp1, const_80); \ -- temp0 = __lsx_vsllwil_h_b(temp0, 0); \ -- temp1 = __lsx_vsllwil_h_b(temp1, 0); \ -- uv_l = __lsx_vilvl_h(temp0, temp1); \ -- uv_h = __lsx_vilvh_h(temp0, temp1); \ -- } -- --// Load 16 YUV422 pixel data --#define READYUV422(psrc_y, psrc_u, psrc_v, out_y, uv) \ -- { \ -- __m128i temp0, temp1; \ -- \ -- out_y = __lsx_vld(psrc_y, 0); \ -- temp0 = __lsx_vldrepl_d(psrc_u, 0); \ -- temp1 = __lsx_vldrepl_d(psrc_v, 0); \ -- uv = __lsx_vilvl_b(temp0, temp1); \ -- uv = __lsx_vsub_b(uv, const_80); \ -- uv = __lsx_vsllwil_h_b(uv, 0); \ -- } -- --// Convert 16 pixels of YUV420 to RGB. --#define YUVTORGB_D(in_y, in_uvl, in_uvh, ubvr, ugvg, yg, yb, b_l, b_h, g_l, \ -- g_h, r_l, r_h) \ -- { \ -- __m128i u_l, u_h, v_l, v_h; \ -- __m128i yl_ev, yl_od, yh_ev, yh_od; \ -- __m128i temp0, temp1, temp2, temp3; \ -- \ -- temp0 = __lsx_vilvl_b(in_y, in_y); \ -- temp1 = __lsx_vilvh_b(in_y, in_y); \ -- yl_ev = __lsx_vmulwev_w_hu_h(temp0, yg); \ -- yl_od = __lsx_vmulwod_w_hu_h(temp0, yg); \ -- yh_ev = __lsx_vmulwev_w_hu_h(temp1, yg); \ -- yh_od = __lsx_vmulwod_w_hu_h(temp1, yg); \ -- DUP4_ARG2(__lsx_vsrai_w, yl_ev, 16, yl_od, 16, yh_ev, 16, yh_od, 16, \ -- yl_ev, yl_od, yh_ev, yh_od); \ -- yl_ev = __lsx_vadd_w(yl_ev, yb); \ -- yl_od = __lsx_vadd_w(yl_od, yb); \ -- yh_ev = __lsx_vadd_w(yh_ev, yb); \ -- yh_od = __lsx_vadd_w(yh_od, yb); \ -- v_l = __lsx_vmulwev_w_h(in_uvl, ubvr); \ -- u_l = __lsx_vmulwod_w_h(in_uvl, ubvr); \ -- v_h = __lsx_vmulwev_w_h(in_uvh, ubvr); \ -- u_h = __lsx_vmulwod_w_h(in_uvh, ubvr); \ -- temp0 = __lsx_vadd_w(yl_ev, u_l); \ -- temp1 = __lsx_vadd_w(yl_od, u_l); \ -- temp2 = __lsx_vadd_w(yh_ev, u_h); \ -- temp3 = __lsx_vadd_w(yh_od, u_h); \ -- DUP4_ARG2(__lsx_vsrai_w, temp0, 6, temp1, 6, temp2, 6, temp3, 6, temp0, \ -- temp1, temp2, temp3); \ -- DUP4_ARG1(__lsx_vclip255_w, temp0, temp1, temp2, temp3, temp0, temp1, \ -- temp2, temp3); \ -- b_l = __lsx_vpackev_h(temp1, temp0); \ -- b_h = __lsx_vpackev_h(temp3, temp2); \ -- temp0 = __lsx_vadd_w(yl_ev, v_l); \ -- temp1 = __lsx_vadd_w(yl_od, v_l); \ -- temp2 = __lsx_vadd_w(yh_ev, v_h); \ -- temp3 = __lsx_vadd_w(yh_od, v_h); \ -- DUP4_ARG2(__lsx_vsrai_w, temp0, 6, temp1, 6, temp2, 6, temp3, 6, temp0, \ -- temp1, temp2, temp3); \ -- DUP4_ARG1(__lsx_vclip255_w, temp0, temp1, temp2, temp3, temp0, temp1, \ -- temp2, temp3); \ -- r_l = __lsx_vpackev_h(temp1, temp0); \ -- r_h = __lsx_vpackev_h(temp3, temp2); \ -- DUP2_ARG2(__lsx_vdp2_w_h, in_uvl, ugvg, in_uvh, ugvg, u_l, u_h); \ -- temp0 = __lsx_vsub_w(yl_ev, u_l); \ -- temp1 = __lsx_vsub_w(yl_od, u_l); \ -- temp2 = __lsx_vsub_w(yh_ev, u_h); \ -- temp3 = __lsx_vsub_w(yh_od, u_h); \ -- DUP4_ARG2(__lsx_vsrai_w, temp0, 6, temp1, 6, temp2, 6, temp3, 6, temp0, \ -- temp1, temp2, temp3); \ -- DUP4_ARG1(__lsx_vclip255_w, temp0, temp1, temp2, temp3, temp0, temp1, \ -- temp2, temp3); \ -- g_l = __lsx_vpackev_h(temp1, temp0); \ -- g_h = __lsx_vpackev_h(temp3, temp2); \ -- } -- - // Convert 8 pixels of YUV420 to RGB. - #define YUVTORGB(in_y, in_vu, vrub, vgug, yg, yb, out_b, out_g, out_r) \ - { \ -@@ -203,25 +118,6 @@ extern "C" { - out_g = __lsx_vpackev_h(tmp1, tmp0); \ - } - --// Pack and Store 16 ARGB values. --#define STOREARGB_D(a_l, a_h, r_l, r_h, g_l, g_h, b_l, b_h, pdst_argb) \ -- { \ -- __m128i temp0, temp1, temp2, temp3; \ -- temp0 = __lsx_vpackev_b(g_l, b_l); \ -- temp1 = __lsx_vpackev_b(a_l, r_l); \ -- temp2 = __lsx_vpackev_b(g_h, b_h); \ -- temp3 = __lsx_vpackev_b(a_h, r_h); \ -- r_l = __lsx_vilvl_h(temp1, temp0); \ -- r_h = __lsx_vilvh_h(temp1, temp0); \ -- g_l = __lsx_vilvl_h(temp3, temp2); \ -- g_h = __lsx_vilvh_h(temp3, temp2); \ -- __lsx_vst(r_l, pdst_argb, 0); \ -- __lsx_vst(r_h, pdst_argb, 16); \ -- __lsx_vst(g_l, pdst_argb, 32); \ -- __lsx_vst(g_h, pdst_argb, 48); \ -- pdst_argb += 64; \ -- } -- - // Pack and Store 8 ARGB values. - #define STOREARGB(in_a, in_r, in_g, in_b, pdst_argb) \ - { \ -@@ -259,1028 +155,6 @@ extern "C" { - _dst0 = __lsx_vpickod_b(_reg1, _reg0); \ - } - --void MirrorRow_LSX(const uint8_t* src, uint8_t* dst, int width) { -- int x; -- int len = width / 32; -- __m128i src0, src1; -- __m128i shuffler = {0x08090A0B0C0D0E0F, 0x0001020304050607}; -- src += width - 32; -- for (x = 0; x < len; x++) { -- DUP2_ARG2(__lsx_vld, src, 0, src, 16, src0, src1); -- DUP2_ARG3(__lsx_vshuf_b, src0, src0, shuffler, src1, src1, shuffler, src0, -- src1); -- __lsx_vst(src1, dst, 0); -- __lsx_vst(src0, dst, 16); -- dst += 32; -- src -= 32; -- } --} -- --void MirrorUVRow_LSX(const uint8_t* src_uv, uint8_t* dst_uv, int width) { -- int x; -- int len = width / 8; -- __m128i src, dst; -- __m128i shuffler = {0x0004000500060007, 0x0000000100020003}; -- -- src_uv += (width - 8) << 1; -- for (x = 0; x < len; x++) { -- src = __lsx_vld(src_uv, 0); -- dst = __lsx_vshuf_h(shuffler, src, src); -- __lsx_vst(dst, dst_uv, 0); -- src_uv -= 16; -- dst_uv += 16; -- } --} -- --void ARGBMirrorRow_LSX(const uint8_t* src, uint8_t* dst, int width) { -- int x; -- int len = width / 8; -- __m128i src0, src1; -- __m128i shuffler = {0x0B0A09080F0E0D0C, 0x0302010007060504}; -- -- src += (width * 4) - 32; -- for (x = 0; x < len; x++) { -- DUP2_ARG2(__lsx_vld, src, 0, src, 16, src0, src1); -- DUP2_ARG3(__lsx_vshuf_b, src0, src0, shuffler, src1, src1, shuffler, src0, -- src1); -- __lsx_vst(src1, dst, 0); -- __lsx_vst(src0, dst, 16); -- dst += 32; -- src -= 32; -- } --} -- --void I422ToYUY2Row_LSX(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_yuy2, -- int width) { -- int x; -- int len = width / 16; -- __m128i src_u0, src_v0, src_y0, vec_uv0; -- __m128i vec_yuy2_0, vec_yuy2_1; -- -- for (x = 0; x < len; x++) { -- DUP2_ARG2(__lsx_vld, src_u, 0, src_v, 0, src_u0, src_v0); -- src_y0 = __lsx_vld(src_y, 0); -- vec_uv0 = __lsx_vilvl_b(src_v0, src_u0); -- vec_yuy2_0 = __lsx_vilvl_b(vec_uv0, src_y0); -- vec_yuy2_1 = __lsx_vilvh_b(vec_uv0, src_y0); -- __lsx_vst(vec_yuy2_0, dst_yuy2, 0); -- __lsx_vst(vec_yuy2_1, dst_yuy2, 16); -- src_u += 8; -- src_v += 8; -- src_y += 16; -- dst_yuy2 += 32; -- } --} -- --void I422ToUYVYRow_LSX(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_uyvy, -- int width) { -- int x; -- int len = width / 16; -- __m128i src_u0, src_v0, src_y0, vec_uv0; -- __m128i vec_uyvy0, vec_uyvy1; -- -- for (x = 0; x < len; x++) { -- DUP2_ARG2(__lsx_vld, src_u, 0, src_v, 0, src_u0, src_v0); -- src_y0 = __lsx_vld(src_y, 0); -- vec_uv0 = __lsx_vilvl_b(src_v0, src_u0); -- vec_uyvy0 = __lsx_vilvl_b(src_y0, vec_uv0); -- vec_uyvy1 = __lsx_vilvh_b(src_y0, vec_uv0); -- __lsx_vst(vec_uyvy0, dst_uyvy, 0); -- __lsx_vst(vec_uyvy1, dst_uyvy, 16); -- src_u += 8; -- src_v += 8; -- src_y += 16; -- dst_uyvy += 32; -- } --} -- --void I422ToARGBRow_LSX(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width) { -- int x; -- int len = width / 16; -- __m128i vec_yb, vec_yg, vec_ub, vec_ug, vec_vr, vec_vg; -- __m128i vec_ubvr, vec_ugvg; -- __m128i alpha = __lsx_vldi(0xFF); -- __m128i const_80 = __lsx_vldi(0x80); -- -- YUVTORGB_SETUP(yuvconstants, vec_vr, vec_ub, vec_vg, vec_ug, vec_yg, vec_yb); -- vec_ubvr = __lsx_vilvl_h(vec_ub, vec_vr); -- vec_ugvg = __lsx_vilvl_h(vec_ug, vec_vg); -- -- for (x = 0; x < len; x++) { -- __m128i y, uv_l, uv_h, b_l, b_h, g_l, g_h, r_l, r_h; -- -- READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h); -- YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l, -- g_h, r_l, r_h); -- STOREARGB_D(alpha, alpha, r_l, r_h, g_l, g_h, b_l, b_h, dst_argb); -- src_y += 16; -- src_u += 8; -- src_v += 8; -- } --} -- --void I422ToRGBARow_LSX(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width) { -- int x; -- int len = width / 16; -- __m128i vec_yb, vec_yg, vec_ub, vec_vr, vec_ug, vec_vg; -- __m128i vec_ubvr, vec_ugvg; -- __m128i alpha = __lsx_vldi(0xFF); -- __m128i const_80 = __lsx_vldi(0x80); -- -- YUVTORGB_SETUP(yuvconstants, vec_vr, vec_ub, vec_vg, vec_ug, vec_yg, vec_yb); -- vec_ubvr = __lsx_vilvl_h(vec_ub, vec_vr); -- vec_ugvg = __lsx_vilvl_h(vec_ug, vec_vg); -- -- for (x = 0; x < len; x++) { -- __m128i y, uv_l, uv_h, b_l, b_h, g_l, g_h, r_l, r_h; -- -- READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h); -- YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l, -- g_h, r_l, r_h); -- STOREARGB_D(r_l, r_h, g_l, g_h, b_l, b_h, alpha, alpha, dst_argb); -- src_y += 16; -- src_u += 8; -- src_v += 8; -- } --} -- --void I422AlphaToARGBRow_LSX(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- const uint8_t* src_a, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width) { -- int x; -- int len = width / 16; -- int res = width & 15; -- __m128i vec_yb, vec_yg, vec_ub, vec_vr, vec_ug, vec_vg; -- __m128i vec_ubvr, vec_ugvg; -- __m128i zero = __lsx_vldi(0); -- __m128i const_80 = __lsx_vldi(0x80); -- -- YUVTORGB_SETUP(yuvconstants, vec_vr, vec_ub, vec_vg, vec_ug, vec_yg, vec_yb); -- vec_ubvr = __lsx_vilvl_h(vec_ub, vec_vr); -- vec_ugvg = __lsx_vilvl_h(vec_ug, vec_vg); -- -- for (x = 0; x < len; x++) { -- __m128i y, uv_l, uv_h, b_l, b_h, g_l, g_h, r_l, r_h, a_l, a_h; -- -- y = __lsx_vld(src_a, 0); -- a_l = __lsx_vilvl_b(zero, y); -- a_h = __lsx_vilvh_b(zero, y); -- READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h); -- YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l, -- g_h, r_l, r_h); -- STOREARGB_D(a_l, a_h, r_l, r_h, g_l, g_h, b_l, b_h, dst_argb); -- src_y += 16; -- src_u += 8; -- src_v += 8; -- src_a += 16; -- } -- if (res) { -- __m128i y, uv, r, g, b, a; -- a = __lsx_vld(src_a, 0); -- a = __lsx_vsllwil_hu_bu(a, 0); -- READYUV422(src_y, src_u, src_v, y, uv); -- YUVTORGB(y, uv, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b, g, r); -- STOREARGB(a, r, g, b, dst_argb); -- } --} -- --void I422ToRGB24Row_LSX(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int32_t width) { -- int x; -- int len = width / 16; -- __m128i vec_yb, vec_yg, vec_ub, vec_vr, vec_ug, vec_vg; -- __m128i vec_ubvr, vec_ugvg; -- __m128i const_80 = __lsx_vldi(0x80); -- __m128i shuffler0 = {0x0504120302100100, 0x0A18090816070614}; -- __m128i shuffler1 = {0x1E0F0E1C0D0C1A0B, 0x1E0F0E1C0D0C1A0B}; -- -- YUVTORGB_SETUP(yuvconstants, vec_vr, vec_ub, vec_vg, vec_ug, vec_yg, vec_yb); -- vec_ubvr = __lsx_vilvl_h(vec_ub, vec_vr); -- vec_ugvg = __lsx_vilvl_h(vec_ug, vec_vg); -- -- for (x = 0; x < len; x++) { -- __m128i y, uv_l, uv_h, b_l, b_h, g_l, g_h, r_l, r_h; -- __m128i temp0, temp1, temp2, temp3; -- -- READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h); -- YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l, -- g_h, r_l, r_h); -- temp0 = __lsx_vpackev_b(g_l, b_l); -- temp1 = __lsx_vpackev_b(g_h, b_h); -- DUP4_ARG3(__lsx_vshuf_b, r_l, temp0, shuffler1, r_h, temp1, shuffler1, r_l, -- temp0, shuffler0, r_h, temp1, shuffler0, temp2, temp3, temp0, -- temp1); -- -- b_l = __lsx_vilvl_d(temp1, temp2); -- b_h = __lsx_vilvh_d(temp3, temp1); -- __lsx_vst(temp0, dst_argb, 0); -- __lsx_vst(b_l, dst_argb, 16); -- __lsx_vst(b_h, dst_argb, 32); -- dst_argb += 48; -- src_y += 16; -- src_u += 8; -- src_v += 8; -- } --} -- --// TODO(fbarchard): Consider AND instead of shift to isolate 5 upper bits of R. --void I422ToRGB565Row_LSX(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_rgb565, -- const struct YuvConstants* yuvconstants, -- int width) { -- int x; -- int len = width / 16; -- __m128i vec_yb, vec_yg, vec_ub, vec_vr, vec_ug, vec_vg; -- __m128i vec_ubvr, vec_ugvg; -- __m128i const_80 = __lsx_vldi(0x80); -- -- YUVTORGB_SETUP(yuvconstants, vec_vr, vec_ub, vec_vg, vec_ug, vec_yg, vec_yb); -- vec_ubvr = __lsx_vilvl_h(vec_ub, vec_vr); -- vec_ugvg = __lsx_vilvl_h(vec_ug, vec_vg); -- -- for (x = 0; x < len; x++) { -- __m128i y, uv_l, uv_h, b_l, b_h, g_l, g_h, r_l, r_h; -- -- READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h); -- YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l, -- g_h, r_l, r_h); -- b_l = __lsx_vsrli_h(b_l, 3); -- b_h = __lsx_vsrli_h(b_h, 3); -- g_l = __lsx_vsrli_h(g_l, 2); -- g_h = __lsx_vsrli_h(g_h, 2); -- r_l = __lsx_vsrli_h(r_l, 3); -- r_h = __lsx_vsrli_h(r_h, 3); -- r_l = __lsx_vslli_h(r_l, 11); -- r_h = __lsx_vslli_h(r_h, 11); -- g_l = __lsx_vslli_h(g_l, 5); -- g_h = __lsx_vslli_h(g_h, 5); -- r_l = __lsx_vor_v(r_l, g_l); -- r_l = __lsx_vor_v(r_l, b_l); -- r_h = __lsx_vor_v(r_h, g_h); -- r_h = __lsx_vor_v(r_h, b_h); -- __lsx_vst(r_l, dst_rgb565, 0); -- __lsx_vst(r_h, dst_rgb565, 16); -- dst_rgb565 += 32; -- src_y += 16; -- src_u += 8; -- src_v += 8; -- } --} -- --// TODO(fbarchard): Consider AND instead of shift to isolate 4 upper bits of G. --void I422ToARGB4444Row_LSX(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_argb4444, -- const struct YuvConstants* yuvconstants, -- int width) { -- int x; -- int len = width / 16; -- __m128i vec_yb, vec_yg, vec_ub, vec_vr, vec_ug, vec_vg; -- __m128i vec_ubvr, vec_ugvg; -- __m128i const_80 = __lsx_vldi(0x80); -- __m128i alpha = (__m128i)v2u64{0xF000F000F000F000, 0xF000F000F000F000}; -- __m128i mask = {0x00F000F000F000F0, 0x00F000F000F000F0}; -- -- YUVTORGB_SETUP(yuvconstants, vec_vr, vec_ub, vec_vg, vec_ug, vec_yg, vec_yb); -- vec_ubvr = __lsx_vilvl_h(vec_ub, vec_vr); -- vec_ugvg = __lsx_vilvl_h(vec_ug, vec_vg); -- -- for (x = 0; x < len; x++) { -- __m128i y, uv_l, uv_h, b_l, b_h, g_l, g_h, r_l, r_h; -- -- READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h); -- YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l, -- g_h, r_l, r_h); -- b_l = __lsx_vsrli_h(b_l, 4); -- b_h = __lsx_vsrli_h(b_h, 4); -- r_l = __lsx_vsrli_h(r_l, 4); -- r_h = __lsx_vsrli_h(r_h, 4); -- g_l = __lsx_vand_v(g_l, mask); -- g_h = __lsx_vand_v(g_h, mask); -- r_l = __lsx_vslli_h(r_l, 8); -- r_h = __lsx_vslli_h(r_h, 8); -- r_l = __lsx_vor_v(r_l, alpha); -- r_h = __lsx_vor_v(r_h, alpha); -- r_l = __lsx_vor_v(r_l, g_l); -- r_h = __lsx_vor_v(r_h, g_h); -- r_l = __lsx_vor_v(r_l, b_l); -- r_h = __lsx_vor_v(r_h, b_h); -- __lsx_vst(r_l, dst_argb4444, 0); -- __lsx_vst(r_h, dst_argb4444, 16); -- dst_argb4444 += 32; -- src_y += 16; -- src_u += 8; -- src_v += 8; -- } --} -- --void I422ToARGB1555Row_LSX(const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_argb1555, -- const struct YuvConstants* yuvconstants, -- int width) { -- int x; -- int len = width / 16; -- __m128i vec_yb, vec_yg, vec_ub, vec_vr, vec_ug, vec_vg; -- __m128i vec_ubvr, vec_ugvg; -- __m128i const_80 = __lsx_vldi(0x80); -- __m128i alpha = (__m128i)v2u64{0x8000800080008000, 0x8000800080008000}; -- -- YUVTORGB_SETUP(yuvconstants, vec_vr, vec_ub, vec_vg, vec_ug, vec_yg, vec_yb); -- vec_ubvr = __lsx_vilvl_h(vec_ub, vec_vr); -- vec_ugvg = __lsx_vilvl_h(vec_ug, vec_vg); -- -- for (x = 0; x < len; x++) { -- __m128i y, uv_l, uv_h, b_l, b_h, g_l, g_h, r_l, r_h; -- -- READYUV422_D(src_y, src_u, src_v, y, uv_l, uv_h); -- YUVTORGB_D(y, uv_l, uv_h, vec_ubvr, vec_ugvg, vec_yg, vec_yb, b_l, b_h, g_l, -- g_h, r_l, r_h); -- b_l = __lsx_vsrli_h(b_l, 3); -- b_h = __lsx_vsrli_h(b_h, 3); -- g_l = __lsx_vsrli_h(g_l, 3); -- -- g_h = __lsx_vsrli_h(g_h, 3); -- g_l = __lsx_vslli_h(g_l, 5); -- g_h = __lsx_vslli_h(g_h, 5); -- r_l = __lsx_vsrli_h(r_l, 3); -- r_h = __lsx_vsrli_h(r_h, 3); -- r_l = __lsx_vslli_h(r_l, 10); -- r_h = __lsx_vslli_h(r_h, 10); -- r_l = __lsx_vor_v(r_l, alpha); -- r_h = __lsx_vor_v(r_h, alpha); -- r_l = __lsx_vor_v(r_l, g_l); -- r_h = __lsx_vor_v(r_h, g_h); -- r_l = __lsx_vor_v(r_l, b_l); -- r_h = __lsx_vor_v(r_h, b_h); -- __lsx_vst(r_l, dst_argb1555, 0); -- __lsx_vst(r_h, dst_argb1555, 16); -- dst_argb1555 += 32; -- src_y += 16; -- src_u += 8; -- src_v += 8; -- } --} -- --void YUY2ToYRow_LSX(const uint8_t* src_yuy2, uint8_t* dst_y, int width) { -- int x; -- int len = width / 16; -- __m128i src0, src1, dst0; -- -- for (x = 0; x < len; x++) { -- DUP2_ARG2(__lsx_vld, src_yuy2, 0, src_yuy2, 16, src0, src1); -- dst0 = __lsx_vpickev_b(src1, src0); -- __lsx_vst(dst0, dst_y, 0); -- src_yuy2 += 32; -- dst_y += 16; -- } --} -- --void YUY2ToUVRow_LSX(const uint8_t* src_yuy2, -- int src_stride_yuy2, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width) { -- const uint8_t* src_yuy2_next = src_yuy2 + src_stride_yuy2; -- int x; -- int len = width / 16; -- __m128i src0, src1, src2, src3; -- __m128i tmp0, dst0, dst1; -- -- for (x = 0; x < len; x++) { -- DUP4_ARG2(__lsx_vld, src_yuy2, 0, src_yuy2, 16, src_yuy2_next, 0, -- src_yuy2_next, 16, src0, src1, src2, src3); -- src0 = __lsx_vpickod_b(src1, src0); -- src1 = __lsx_vpickod_b(src3, src2); -- tmp0 = __lsx_vavgr_bu(src1, src0); -- dst0 = __lsx_vpickev_b(tmp0, tmp0); -- dst1 = __lsx_vpickod_b(tmp0, tmp0); -- __lsx_vstelm_d(dst0, dst_u, 0, 0); -- __lsx_vstelm_d(dst1, dst_v, 0, 0); -- src_yuy2 += 32; -- src_yuy2_next += 32; -- dst_u += 8; -- dst_v += 8; -- } --} -- --void YUY2ToUV422Row_LSX(const uint8_t* src_yuy2, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width) { -- int x; -- int len = width / 16; -- __m128i src0, src1, tmp0, dst0, dst1; -- -- for (x = 0; x < len; x++) { -- DUP2_ARG2(__lsx_vld, src_yuy2, 0, src_yuy2, 16, src0, src1); -- tmp0 = __lsx_vpickod_b(src1, src0); -- dst0 = __lsx_vpickev_b(tmp0, tmp0); -- dst1 = __lsx_vpickod_b(tmp0, tmp0); -- __lsx_vstelm_d(dst0, dst_u, 0, 0); -- __lsx_vstelm_d(dst1, dst_v, 0, 0); -- src_yuy2 += 32; -- dst_u += 8; -- dst_v += 8; -- } --} -- --void UYVYToYRow_LSX(const uint8_t* src_uyvy, uint8_t* dst_y, int width) { -- int x; -- int len = width / 16; -- __m128i src0, src1, dst0; -- -- for (x = 0; x < len; x++) { -- DUP2_ARG2(__lsx_vld, src_uyvy, 0, src_uyvy, 16, src0, src1); -- dst0 = __lsx_vpickod_b(src1, src0); -- __lsx_vst(dst0, dst_y, 0); -- src_uyvy += 32; -- dst_y += 16; -- } --} -- --void UYVYToUVRow_LSX(const uint8_t* src_uyvy, -- int src_stride_uyvy, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width) { -- const uint8_t* src_uyvy_next = src_uyvy + src_stride_uyvy; -- int x; -- int len = width / 16; -- __m128i src0, src1, src2, src3, tmp0, dst0, dst1; -- -- for (x = 0; x < len; x++) { -- DUP4_ARG2(__lsx_vld, src_uyvy, 0, src_uyvy, 16, src_uyvy_next, 0, -- src_uyvy_next, 16, src0, src1, src2, src3); -- src0 = __lsx_vpickev_b(src1, src0); -- src1 = __lsx_vpickev_b(src3, src2); -- tmp0 = __lsx_vavgr_bu(src1, src0); -- dst0 = __lsx_vpickev_b(tmp0, tmp0); -- dst1 = __lsx_vpickod_b(tmp0, tmp0); -- __lsx_vstelm_d(dst0, dst_u, 0, 0); -- __lsx_vstelm_d(dst1, dst_v, 0, 0); -- src_uyvy += 32; -- src_uyvy_next += 32; -- dst_u += 8; -- dst_v += 8; -- } --} -- --void UYVYToUV422Row_LSX(const uint8_t* src_uyvy, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width) { -- int x; -- int len = width / 16; -- __m128i src0, src1, tmp0, dst0, dst1; -- -- for (x = 0; x < len; x++) { -- DUP2_ARG2(__lsx_vld, src_uyvy, 0, src_uyvy, 16, src0, src1); -- tmp0 = __lsx_vpickev_b(src1, src0); -- dst0 = __lsx_vpickev_b(tmp0, tmp0); -- dst1 = __lsx_vpickod_b(tmp0, tmp0); -- __lsx_vstelm_d(dst0, dst_u, 0, 0); -- __lsx_vstelm_d(dst1, dst_v, 0, 0); -- src_uyvy += 32; -- dst_u += 8; -- dst_v += 8; -- } --} -- --void ARGBToUVRow_LSX(const uint8_t* src_argb0, -- int src_stride_argb, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width) { -- int x; -- int len = width / 16; -- const uint8_t* src_argb1 = src_argb0 + src_stride_argb; -- -- __m128i src0, src1, src2, src3, src4, src5, src6, src7; -- __m128i vec0, vec1, vec2, vec3; -- __m128i tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, dst0, dst1; -- __m128i const_0x70 = {0x0038003800380038, 0x0038003800380038}; -- __m128i const_0x4A = {0x0025002500250025, 0x0025002500250025}; -- __m128i const_0x26 = {0x0013001300130013, 0x0013001300130013}; -- __m128i const_0x5E = {0x002f002f002f002f, 0x002f002f002f002f}; -- __m128i const_0x12 = {0x0009000900090009, 0x0009000900090009}; -- __m128i const_0x8080 = (__m128i)v2u64{0x8080808080808080, 0x8080808080808080}; -- for (x = 0; x < len; x++) { -- DUP4_ARG2(__lsx_vld, src_argb0, 0, src_argb0, 16, src_argb0, 32, src_argb0, -- 48, src0, src1, src2, src3); -- DUP4_ARG2(__lsx_vld, src_argb1, 0, src_argb1, 16, src_argb1, 32, src_argb1, -- 48, src4, src5, src6, src7); -- vec0 = __lsx_vaddwev_h_bu(src0, src4); -- vec1 = __lsx_vaddwev_h_bu(src1, src5); -- vec2 = __lsx_vaddwev_h_bu(src2, src6); -- vec3 = __lsx_vaddwev_h_bu(src3, src7); -- tmp0 = __lsx_vpickev_h(vec1, vec0); -- tmp1 = __lsx_vpickev_h(vec3, vec2); -- tmp2 = __lsx_vpickod_h(vec1, vec0); -- tmp3 = __lsx_vpickod_h(vec3, vec2); -- vec0 = __lsx_vaddwod_h_bu(src0, src4); -- vec1 = __lsx_vaddwod_h_bu(src1, src5); -- vec2 = __lsx_vaddwod_h_bu(src2, src6); -- vec3 = __lsx_vaddwod_h_bu(src3, src7); -- tmp4 = __lsx_vpickev_h(vec1, vec0); -- tmp5 = __lsx_vpickev_h(vec3, vec2); -- vec0 = __lsx_vpickev_h(tmp1, tmp0); -- vec1 = __lsx_vpickod_h(tmp1, tmp0); -- src0 = __lsx_vavgr_h(vec0, vec1); -- vec0 = __lsx_vpickev_h(tmp3, tmp2); -- vec1 = __lsx_vpickod_h(tmp3, tmp2); -- src1 = __lsx_vavgr_h(vec0, vec1); -- vec0 = __lsx_vpickev_h(tmp5, tmp4); -- vec1 = __lsx_vpickod_h(tmp5, tmp4); -- src2 = __lsx_vavgr_h(vec0, vec1); -- dst0 = __lsx_vmadd_h(const_0x8080, src0, const_0x70); -- dst0 = __lsx_vmsub_h(dst0, src2, const_0x4A); -- dst0 = __lsx_vmsub_h(dst0, src1, const_0x26); -- dst1 = __lsx_vmadd_h(const_0x8080, src1, const_0x70); -- dst1 = __lsx_vmsub_h(dst1, src2, const_0x5E); -- dst1 = __lsx_vmsub_h(dst1, src0, const_0x12); -- dst0 = __lsx_vsrai_h(dst0, 8); -- dst1 = __lsx_vsrai_h(dst1, 8); -- dst0 = __lsx_vpickev_b(dst1, dst0); -- __lsx_vstelm_d(dst0, dst_u, 0, 0); -- __lsx_vstelm_d(dst0, dst_v, 0, 1); -- src_argb0 += 64; -- src_argb1 += 64; -- dst_u += 8; -- dst_v += 8; -- } --} -- --void ARGBToRGB24Row_LSX(const uint8_t* src_argb, uint8_t* dst_rgb, int width) { -- int x; -- int len = (width / 16) - 1; -- __m128i src0, src1, src2, src3; -- __m128i tmp0, tmp1, tmp2, tmp3; -- __m128i shuf = {0x0908060504020100, 0x000000000E0D0C0A}; -- for (x = 0; x < len; x++) { -- DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32, src_argb, 48, -- src0, src1, src2, src3); -- tmp0 = __lsx_vshuf_b(src0, src0, shuf); -- tmp1 = __lsx_vshuf_b(src1, src1, shuf); -- tmp2 = __lsx_vshuf_b(src2, src2, shuf); -- tmp3 = __lsx_vshuf_b(src3, src3, shuf); -- __lsx_vst(tmp0, dst_rgb, 0); -- __lsx_vst(tmp1, dst_rgb, 12); -- __lsx_vst(tmp2, dst_rgb, 24); -- __lsx_vst(tmp3, dst_rgb, 36); -- dst_rgb += 48; -- src_argb += 64; -- } -- DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32, src_argb, 48, -- src0, src1, src2, src3); -- tmp0 = __lsx_vshuf_b(src0, src0, shuf); -- tmp1 = __lsx_vshuf_b(src1, src1, shuf); -- tmp2 = __lsx_vshuf_b(src2, src2, shuf); -- tmp3 = __lsx_vshuf_b(src3, src3, shuf); -- __lsx_vst(tmp0, dst_rgb, 0); -- __lsx_vst(tmp1, dst_rgb, 12); -- __lsx_vst(tmp2, dst_rgb, 24); -- dst_rgb += 36; -- __lsx_vst(tmp3, dst_rgb, 0); --} -- --void ARGBToRAWRow_LSX(const uint8_t* src_argb, uint8_t* dst_rgb, int width) { -- int x; -- int len = (width / 16) - 1; -- __m128i src0, src1, src2, src3; -- __m128i tmp0, tmp1, tmp2, tmp3; -- __m128i shuf = {0x090A040506000102, 0x000000000C0D0E08}; -- for (x = 0; x < len; x++) { -- DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32, src_argb, 48, -- src0, src1, src2, src3); -- tmp0 = __lsx_vshuf_b(src0, src0, shuf); -- tmp1 = __lsx_vshuf_b(src1, src1, shuf); -- tmp2 = __lsx_vshuf_b(src2, src2, shuf); -- tmp3 = __lsx_vshuf_b(src3, src3, shuf); -- __lsx_vst(tmp0, dst_rgb, 0); -- __lsx_vst(tmp1, dst_rgb, 12); -- __lsx_vst(tmp2, dst_rgb, 24); -- __lsx_vst(tmp3, dst_rgb, 36); -- dst_rgb += 48; -- src_argb += 64; -- } -- DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32, src_argb, 48, -- src0, src1, src2, src3); -- tmp0 = __lsx_vshuf_b(src0, src0, shuf); -- tmp1 = __lsx_vshuf_b(src1, src1, shuf); -- tmp2 = __lsx_vshuf_b(src2, src2, shuf); -- tmp3 = __lsx_vshuf_b(src3, src3, shuf); -- __lsx_vst(tmp0, dst_rgb, 0); -- __lsx_vst(tmp1, dst_rgb, 12); -- __lsx_vst(tmp2, dst_rgb, 24); -- dst_rgb += 36; -- __lsx_vst(tmp3, dst_rgb, 0); --} -- --void ARGBToRGB565Row_LSX(const uint8_t* src_argb, uint8_t* dst_rgb, int width) { -- int x; -- int len = width / 8; -- __m128i zero = __lsx_vldi(0); -- __m128i src0, src1, tmp0, tmp1, dst0; -- __m128i shift = {0x0300030003000300, 0x0300030003000300}; -- -- for (x = 0; x < len; x++) { -- DUP2_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src0, src1); -- tmp0 = __lsx_vpickev_b(src1, src0); -- tmp1 = __lsx_vpickod_b(src1, src0); -- tmp0 = __lsx_vsrli_b(tmp0, 3); -- tmp1 = __lsx_vpackev_b(zero, tmp1); -- tmp1 = __lsx_vsrli_h(tmp1, 2); -- tmp0 = __lsx_vsll_b(tmp0, shift); -- tmp1 = __lsx_vslli_h(tmp1, 5); -- dst0 = __lsx_vor_v(tmp0, tmp1); -- __lsx_vst(dst0, dst_rgb, 0); -- dst_rgb += 16; -- src_argb += 32; -- } --} -- --void ARGBToARGB1555Row_LSX(const uint8_t* src_argb, -- uint8_t* dst_rgb, -- int width) { -- int x; -- int len = width / 8; -- __m128i zero = __lsx_vldi(0); -- __m128i src0, src1, tmp0, tmp1, tmp2, tmp3, dst0; -- __m128i shift1 = {0x0703070307030703, 0x0703070307030703}; -- __m128i shift2 = {0x0200020002000200, 0x0200020002000200}; -- -- for (x = 0; x < len; x++) { -- DUP2_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src0, src1); -- tmp0 = __lsx_vpickev_b(src1, src0); -- tmp1 = __lsx_vpickod_b(src1, src0); -- tmp0 = __lsx_vsrli_b(tmp0, 3); -- tmp1 = __lsx_vsrl_b(tmp1, shift1); -- tmp0 = __lsx_vsll_b(tmp0, shift2); -- tmp2 = __lsx_vpackev_b(zero, tmp1); -- tmp3 = __lsx_vpackod_b(zero, tmp1); -- tmp2 = __lsx_vslli_h(tmp2, 5); -- tmp3 = __lsx_vslli_h(tmp3, 15); -- dst0 = __lsx_vor_v(tmp0, tmp2); -- dst0 = __lsx_vor_v(dst0, tmp3); -- __lsx_vst(dst0, dst_rgb, 0); -- dst_rgb += 16; -- src_argb += 32; -- } --} -- --void ARGBToARGB4444Row_LSX(const uint8_t* src_argb, -- uint8_t* dst_rgb, -- int width) { -- int x; -- int len = width / 8; -- __m128i src0, src1, tmp0, tmp1, dst0; -- -- for (x = 0; x < len; x++) { -- DUP2_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src0, src1); -- tmp0 = __lsx_vpickev_b(src1, src0); -- tmp1 = __lsx_vpickod_b(src1, src0); -- tmp1 = __lsx_vandi_b(tmp1, 0xF0); -- tmp0 = __lsx_vsrli_b(tmp0, 4); -- dst0 = __lsx_vor_v(tmp1, tmp0); -- __lsx_vst(dst0, dst_rgb, 0); -- dst_rgb += 16; -- src_argb += 32; -- } --} -- --void ARGBToUV444Row_LSX(const uint8_t* src_argb, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int32_t width) { -- int x; -- int len = width / 16; -- __m128i src0, src1, src2, src3; -- __m128i tmp0, tmp1, tmp2, tmp3; -- __m128i reg0, reg1, reg2, reg3, dst0, dst1; -- __m128i const_112 = __lsx_vldi(112); -- __m128i const_74 = __lsx_vldi(74); -- __m128i const_38 = __lsx_vldi(38); -- __m128i const_94 = __lsx_vldi(94); -- __m128i const_18 = __lsx_vldi(18); -- __m128i const_0x8080 = (__m128i)v2u64{0x8080808080808080, 0x8080808080808080}; -- for (x = 0; x < len; x++) { -- DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32, src_argb, 48, -- src0, src1, src2, src3); -- tmp0 = __lsx_vpickev_h(src1, src0); -- tmp1 = __lsx_vpickod_h(src1, src0); -- tmp2 = __lsx_vpickev_h(src3, src2); -- tmp3 = __lsx_vpickod_h(src3, src2); -- reg0 = __lsx_vmaddwev_h_bu(const_0x8080, tmp0, const_112); -- reg1 = __lsx_vmaddwev_h_bu(const_0x8080, tmp2, const_112); -- reg2 = __lsx_vmulwod_h_bu(tmp0, const_74); -- reg3 = __lsx_vmulwod_h_bu(tmp2, const_74); -- reg2 = __lsx_vmaddwev_h_bu(reg2, tmp1, const_38); -- reg3 = __lsx_vmaddwev_h_bu(reg3, tmp3, const_38); -- reg0 = __lsx_vsub_h(reg0, reg2); -- reg1 = __lsx_vsub_h(reg1, reg3); -- reg0 = __lsx_vsrai_h(reg0, 8); -- reg1 = __lsx_vsrai_h(reg1, 8); -- dst0 = __lsx_vpickev_b(reg1, reg0); -- -- reg0 = __lsx_vmaddwev_h_bu(const_0x8080, tmp1, const_112); -- reg1 = __lsx_vmaddwev_h_bu(const_0x8080, tmp3, const_112); -- reg2 = __lsx_vmulwev_h_bu(tmp0, const_18); -- reg3 = __lsx_vmulwev_h_bu(tmp2, const_18); -- reg2 = __lsx_vmaddwod_h_bu(reg2, tmp0, const_94); -- reg3 = __lsx_vmaddwod_h_bu(reg3, tmp2, const_94); -- reg0 = __lsx_vsub_h(reg0, reg2); -- reg1 = __lsx_vsub_h(reg1, reg3); -- reg0 = __lsx_vsrai_h(reg0, 8); -- reg1 = __lsx_vsrai_h(reg1, 8); -- dst1 = __lsx_vpickev_b(reg1, reg0); -- -- __lsx_vst(dst0, dst_u, 0); -- __lsx_vst(dst1, dst_v, 0); -- dst_u += 16; -- dst_v += 16; -- src_argb += 64; -- } --} -- --void ARGBMultiplyRow_LSX(const uint8_t* src_argb0, -- const uint8_t* src_argb1, -- uint8_t* dst_argb, -- int width) { -- int x; -- int len = width / 4; -- __m128i zero = __lsx_vldi(0); -- __m128i src0, src1, dst0, dst1; -- __m128i tmp0, tmp1, tmp2, tmp3; -- -- for (x = 0; x < len; x++) { -- DUP2_ARG2(__lsx_vld, src_argb0, 0, src_argb1, 0, src0, src1); -- tmp0 = __lsx_vilvl_b(src0, src0); -- tmp1 = __lsx_vilvh_b(src0, src0); -- tmp2 = __lsx_vilvl_b(zero, src1); -- tmp3 = __lsx_vilvh_b(zero, src1); -- dst0 = __lsx_vmuh_hu(tmp0, tmp2); -- dst1 = __lsx_vmuh_hu(tmp1, tmp3); -- dst0 = __lsx_vpickev_b(dst1, dst0); -- __lsx_vst(dst0, dst_argb, 0); -- src_argb0 += 16; -- src_argb1 += 16; -- dst_argb += 16; -- } --} -- --void ARGBAddRow_LSX(const uint8_t* src_argb0, -- const uint8_t* src_argb1, -- uint8_t* dst_argb, -- int width) { -- int x; -- int len = width / 4; -- __m128i src0, src1, dst0; -- -- for (x = 0; x < len; x++) { -- DUP2_ARG2(__lsx_vld, src_argb0, 0, src_argb1, 0, src0, src1); -- dst0 = __lsx_vsadd_bu(src0, src1); -- __lsx_vst(dst0, dst_argb, 0); -- src_argb0 += 16; -- src_argb1 += 16; -- dst_argb += 16; -- } --} -- --void ARGBSubtractRow_LSX(const uint8_t* src_argb0, -- const uint8_t* src_argb1, -- uint8_t* dst_argb, -- int width) { -- int x; -- int len = width / 4; -- __m128i src0, src1, dst0; -- -- for (x = 0; x < len; x++) { -- DUP2_ARG2(__lsx_vld, src_argb0, 0, src_argb1, 0, src0, src1); -- dst0 = __lsx_vssub_bu(src0, src1); -- __lsx_vst(dst0, dst_argb, 0); -- src_argb0 += 16; -- src_argb1 += 16; -- dst_argb += 16; -- } --} -- --void ARGBAttenuateRow_LSX(const uint8_t* src_argb, -- uint8_t* dst_argb, -- int width) { -- int x; -- int len = width / 8; -- __m128i src0, src1, tmp0, tmp1; -- __m128i reg0, reg1, reg2, reg3, reg4, reg5; -- __m128i b, g, r, a, dst0, dst1; -- __m128i control = {0x0005000100040000, 0x0007000300060002}; -- -- for (x = 0; x < len; x++) { -- DUP2_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src0, src1); -- tmp0 = __lsx_vpickev_b(src1, src0); -- tmp1 = __lsx_vpickod_b(src1, src0); -- b = __lsx_vpackev_b(tmp0, tmp0); -- r = __lsx_vpackod_b(tmp0, tmp0); -- g = __lsx_vpackev_b(tmp1, tmp1); -- a = __lsx_vpackod_b(tmp1, tmp1); -- reg0 = __lsx_vmulwev_w_hu(b, a); -- reg1 = __lsx_vmulwod_w_hu(b, a); -- reg2 = __lsx_vmulwev_w_hu(r, a); -- reg3 = __lsx_vmulwod_w_hu(r, a); -- reg4 = __lsx_vmulwev_w_hu(g, a); -- reg5 = __lsx_vmulwod_w_hu(g, a); -- reg0 = __lsx_vssrani_h_w(reg1, reg0, 24); -- reg2 = __lsx_vssrani_h_w(reg3, reg2, 24); -- reg4 = __lsx_vssrani_h_w(reg5, reg4, 24); -- reg0 = __lsx_vshuf_h(control, reg0, reg0); -- reg2 = __lsx_vshuf_h(control, reg2, reg2); -- reg4 = __lsx_vshuf_h(control, reg4, reg4); -- tmp0 = __lsx_vpackev_b(reg4, reg0); -- tmp1 = __lsx_vpackev_b(a, reg2); -- dst0 = __lsx_vilvl_h(tmp1, tmp0); -- dst1 = __lsx_vilvh_h(tmp1, tmp0); -- __lsx_vst(dst0, dst_argb, 0); -- __lsx_vst(dst1, dst_argb, 16); -- dst_argb += 32; -- src_argb += 32; -- } --} -- --void ARGBToRGB565DitherRow_LSX(const uint8_t* src_argb, -- uint8_t* dst_rgb, -- uint32_t dither4, -- int width) { -- int x; -- int len = width / 8; -- __m128i src0, src1, tmp0, tmp1, dst0; -- __m128i b, g, r; -- __m128i zero = __lsx_vldi(0); -- __m128i vec_dither = __lsx_vldrepl_w(&dither4, 0); -- -- vec_dither = __lsx_vilvl_b(zero, vec_dither); -- for (x = 0; x < len; x++) { -- DUP2_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src0, src1); -- tmp0 = __lsx_vpickev_b(src1, src0); -- tmp1 = __lsx_vpickod_b(src1, src0); -- b = __lsx_vpackev_b(zero, tmp0); -- r = __lsx_vpackod_b(zero, tmp0); -- g = __lsx_vpackev_b(zero, tmp1); -- b = __lsx_vadd_h(b, vec_dither); -- g = __lsx_vadd_h(g, vec_dither); -- r = __lsx_vadd_h(r, vec_dither); -- DUP2_ARG1(__lsx_vclip255_h, b, g, b, g); -- r = __lsx_vclip255_h(r); -- b = __lsx_vsrai_h(b, 3); -- g = __lsx_vsrai_h(g, 2); -- r = __lsx_vsrai_h(r, 3); -- g = __lsx_vslli_h(g, 5); -- r = __lsx_vslli_h(r, 11); -- dst0 = __lsx_vor_v(b, g); -- dst0 = __lsx_vor_v(dst0, r); -- __lsx_vst(dst0, dst_rgb, 0); -- src_argb += 32; -- dst_rgb += 16; -- } --} -- --void ARGBShuffleRow_LSX(const uint8_t* src_argb, -- uint8_t* dst_argb, -- const uint8_t* shuffler, -- int width) { -- int x; -- int len = width / 8; -- __m128i src0, src1, dst0, dst1; -- __m128i shuf = {0x0404040400000000, 0x0C0C0C0C08080808}; -- __m128i temp = __lsx_vldrepl_w(shuffler, 0); -- -- shuf = __lsx_vadd_b(shuf, temp); -- for (x = 0; x < len; x++) { -- DUP2_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src0, src1); -- dst0 = __lsx_vshuf_b(src0, src0, shuf); -- dst1 = __lsx_vshuf_b(src1, src1, shuf); -- __lsx_vst(dst0, dst_argb, 0); -- __lsx_vst(dst1, dst_argb, 16); -- src_argb += 32; -- dst_argb += 32; -- } --} -- --void ARGBShadeRow_LSX(const uint8_t* src_argb, -- uint8_t* dst_argb, -- int width, -- uint32_t value) { -- int x; -- int len = width / 4; -- __m128i src0, dst0, tmp0, tmp1; -- __m128i vec_value = __lsx_vreplgr2vr_w(value); -- -- vec_value = __lsx_vilvl_b(vec_value, vec_value); -- for (x = 0; x < len; x++) { -- src0 = __lsx_vld(src_argb, 0); -- tmp0 = __lsx_vilvl_b(src0, src0); -- tmp1 = __lsx_vilvh_b(src0, src0); -- tmp0 = __lsx_vmuh_hu(tmp0, vec_value); -- tmp1 = __lsx_vmuh_hu(tmp1, vec_value); -- dst0 = __lsx_vpickod_b(tmp1, tmp0); -- __lsx_vst(dst0, dst_argb, 0); -- src_argb += 16; -- dst_argb += 16; -- } --} -- --void ARGBGrayRow_LSX(const uint8_t* src_argb, uint8_t* dst_argb, int width) { -- int x; -- int len = width / 8; -- __m128i src0, src1, tmp0, tmp1; -- __m128i reg0, reg1, reg2, dst0, dst1; -- __m128i const_128 = __lsx_vldi(0x480); -- __m128i const_150 = __lsx_vldi(0x96); -- __m128i const_br = {0x4D1D4D1D4D1D4D1D, 0x4D1D4D1D4D1D4D1D}; -- -- for (x = 0; x < len; x++) { -- DUP2_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src0, src1); -- tmp0 = __lsx_vpickev_b(src1, src0); -- tmp1 = __lsx_vpickod_b(src1, src0); -- reg0 = __lsx_vdp2_h_bu(tmp0, const_br); -- reg1 = __lsx_vmaddwev_h_bu(const_128, tmp1, const_150); -- reg2 = __lsx_vadd_h(reg0, reg1); -- tmp0 = __lsx_vpackod_b(reg2, reg2); -- tmp1 = __lsx_vpackod_b(tmp1, reg2); -- dst0 = __lsx_vilvl_h(tmp1, tmp0); -- dst1 = __lsx_vilvh_h(tmp1, tmp0); -- __lsx_vst(dst0, dst_argb, 0); -- __lsx_vst(dst1, dst_argb, 16); -- src_argb += 32; -- dst_argb += 32; -- } --} -- --void ARGBSepiaRow_LSX(uint8_t* dst_argb, int width) { -- int x; -- int len = width / 8; -- __m128i src0, src1, tmp0, tmp1; -- __m128i reg0, reg1, spb, spg, spr; -- __m128i dst0, dst1; -- __m128i spb_g = __lsx_vldi(68); -- __m128i spg_g = __lsx_vldi(88); -- __m128i spr_g = __lsx_vldi(98); -- __m128i spb_br = {0x2311231123112311, 0x2311231123112311}; -- __m128i spg_br = {0x2D162D162D162D16, 0x2D162D162D162D16}; -- __m128i spr_br = {0x3218321832183218, 0x3218321832183218}; -- __m128i shuff = {0x1706150413021100, 0x1F0E1D0C1B0A1908}; -- -- for (x = 0; x < len; x++) { -- DUP2_ARG2(__lsx_vld, dst_argb, 0, dst_argb, 16, src0, src1); -- tmp0 = __lsx_vpickev_b(src1, src0); -- tmp1 = __lsx_vpickod_b(src1, src0); -- DUP2_ARG2(__lsx_vdp2_h_bu, tmp0, spb_br, tmp0, spg_br, spb, spg); -- spr = __lsx_vdp2_h_bu(tmp0, spr_br); -- spb = __lsx_vmaddwev_h_bu(spb, tmp1, spb_g); -- spg = __lsx_vmaddwev_h_bu(spg, tmp1, spg_g); -- spr = __lsx_vmaddwev_h_bu(spr, tmp1, spr_g); -- spb = __lsx_vsrli_h(spb, 7); -- spg = __lsx_vsrli_h(spg, 7); -- spr = __lsx_vsrli_h(spr, 7); -- spg = __lsx_vsat_hu(spg, 7); -- spr = __lsx_vsat_hu(spr, 7); -- reg0 = __lsx_vpackev_b(spg, spb); -- reg1 = __lsx_vshuf_b(tmp1, spr, shuff); -- dst0 = __lsx_vilvl_h(reg1, reg0); -- dst1 = __lsx_vilvh_h(reg1, reg0); -- __lsx_vst(dst0, dst_argb, 0); -- __lsx_vst(dst1, dst_argb, 16); -- dst_argb += 32; -- } --} -- - void ARGB4444ToARGBRow_LSX(const uint8_t* src_argb4444, - uint8_t* dst_argb, - int width) { -@@ -1533,7 +407,7 @@ void ARGB1555ToUVRow_LSX(const uint8_t* - __m128i const_38 = __lsx_vldi(0x413); - __m128i const_94 = __lsx_vldi(0x42F); - __m128i const_18 = __lsx_vldi(0x409); -- __m128i const_8080 = (__m128i)v2u64{0x8080808080808080, 0x8080808080808080}; -+ __m128i const_8080 = {0x8080808080808080, 0x8080808080808080}; - - for (x = 0; x < len; x++) { - DUP4_ARG2(__lsx_vld, src_argb1555, 0, src_argb1555, 16, next_argb1555, 0, -@@ -1642,7 +516,7 @@ void RGB565ToUVRow_LSX(const uint8_t* sr - __m128i const_38 = __lsx_vldi(0x413); - __m128i const_94 = __lsx_vldi(0x42F); - __m128i const_18 = __lsx_vldi(0x409); -- __m128i const_8080 = (__m128i)v2u64{0x8080808080808080, 0x8080808080808080}; -+ __m128i const_8080 = {0x8080808080808080, 0x8080808080808080}; - - for (x = 0; x < len; x++) { - DUP4_ARG2(__lsx_vld, src_rgb565, 0, src_rgb565, 16, next_rgb565, 0, -@@ -1703,7 +577,7 @@ void RGB24ToUVRow_LSX(const uint8_t* src - __m128i const_38 = __lsx_vldi(0x413); - __m128i const_94 = __lsx_vldi(0x42F); - __m128i const_18 = __lsx_vldi(0x409); -- __m128i const_8080 = (__m128i)v2u64{0x8080808080808080, 0x8080808080808080}; -+ __m128i const_8080 = {0x8080808080808080, 0x8080808080808080}; - __m128i shuff0_b = {0x15120F0C09060300, 0x00000000001E1B18}; - __m128i shuff1_b = {0x0706050403020100, 0x1D1A1714110A0908}; - __m128i shuff0_g = {0x1613100D0A070401, 0x00000000001F1C19}; -@@ -1756,7 +630,7 @@ void RAWToUVRow_LSX(const uint8_t* src_r - __m128i const_38 = __lsx_vldi(0x413); - __m128i const_94 = __lsx_vldi(0x42F); - __m128i const_18 = __lsx_vldi(0x409); -- __m128i const_8080 = (__m128i)v2u64{0x8080808080808080, 0x8080808080808080}; -+ __m128i const_8080 = {0x8080808080808080, 0x8080808080808080}; - __m128i shuff0_r = {0x15120F0C09060300, 0x00000000001E1B18}; - __m128i shuff1_r = {0x0706050403020100, 0x1D1A1714110A0908}; - __m128i shuff0_g = {0x1613100D0A070401, 0x00000000001F1C19}; -@@ -1991,7 +865,7 @@ void BGRAToUVRow_LSX(const uint8_t* src_ - __m128i const_38 = __lsx_vldi(0x413); - __m128i const_94 = __lsx_vldi(0x42F); - __m128i const_18 = __lsx_vldi(0x409); -- __m128i const_8080 = (__m128i)v2u64{0x8080808080808080, 0x8080808080808080}; -+ __m128i const_8080 = {0x8080808080808080, 0x8080808080808080}; - - for (x = 0; x < len; x++) { - DUP4_ARG2(__lsx_vld, src_bgra, 0, src_bgra, 16, src_bgra, 32, src_bgra, 48, -@@ -2039,7 +913,7 @@ void ABGRToUVRow_LSX(const uint8_t* src_ - __m128i const_38 = __lsx_vldi(0x413); - __m128i const_94 = __lsx_vldi(0x42F); - __m128i const_18 = __lsx_vldi(0x409); -- __m128i const_8080 = (__m128i)v2u64{0x8080808080808080, 0x8080808080808080}; -+ __m128i const_8080 = {0x8080808080808080, 0x8080808080808080}; - - for (x = 0; x < len; x++) { - DUP4_ARG2(__lsx_vld, src_abgr, 0, src_abgr, 16, src_abgr, 32, src_abgr, 48, -@@ -2087,7 +961,7 @@ void RGBAToUVRow_LSX(const uint8_t* src_ - __m128i const_38 = __lsx_vldi(0x413); - __m128i const_94 = __lsx_vldi(0x42F); - __m128i const_18 = __lsx_vldi(0x409); -- __m128i const_8080 = (__m128i)v2u64{0x8080808080808080, 0x8080808080808080}; -+ __m128i const_8080 = {0x8080808080808080, 0x8080808080808080}; - - for (x = 0; x < len; x++) { - DUP4_ARG2(__lsx_vld, src_rgba, 0, src_rgba, 16, src_rgba, 32, src_rgba, 48, -@@ -2136,7 +1010,7 @@ void ARGBToUVJRow_LSX(const uint8_t* src - __m128i const_21 = __lsx_vldi(0x415); - __m128i const_53 = __lsx_vldi(0x435); - __m128i const_10 = __lsx_vldi(0x40A); -- __m128i const_8080 = (__m128i)v2u64{0x8080808080808080, 0x8080808080808080}; -+ __m128i const_8080 = {0x8080808080808080, 0x8080808080808080}; - - for (x = 0; x < len; x++) { - DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb, 32, src_argb, 48, -@@ -2514,7 +1388,7 @@ void ARGBBlendRow_LSX(const uint8_t* src - __m128i const_256 = __lsx_vldi(0x500); - __m128i zero = __lsx_vldi(0); - __m128i alpha = __lsx_vldi(0xFF); -- __m128i control = (__m128i)v2u64{0xFF000000FF000000, 0xFF000000FF000000}; -+ __m128i control = {0xFF000000FF000000, 0xFF000000FF000000}; - - for (x = 0; x < len; x++) { - DUP4_ARG2(__lsx_vld, src_argb, 0, src_argb, 16, src_argb1, 0, src_argb1, 16, -@@ -2560,7 +1434,7 @@ void ARGBQuantizeRow_LSX(uint8_t* dst_ar - __m128i vec_offset = __lsx_vreplgr2vr_b(interval_offset); - __m128i vec_scale = __lsx_vreplgr2vr_w(scale); - __m128i zero = __lsx_vldi(0); -- __m128i control = (__m128i)v2u64{0xFF000000FF000000, 0xFF000000FF000000}; -+ __m128i control = {0xFF000000FF000000, 0xFF000000FF000000}; - - for (x = 0; x < len; x++) { - DUP4_ARG2(__lsx_vld, dst_argb, 0, dst_argb, 16, dst_argb, 32, dst_argb, 48, -@@ -2805,7 +1679,8 @@ static void ARGBToYMatrixRow_LSX(const u - uint8_t* dst_y, - int width, - const struct RgbConstants* rgbconstants) { -- asm("vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants -+ asm volatile( -+ "vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants - "vldrepl.b $vr1, %3, 1 \n\t" // load rgbconstants - "vldrepl.b $vr2, %3, 2 \n\t" // load rgbconstants - "vldrepl.h $vr3, %3, 4 \n\t" // load rgbconstants -@@ -2863,7 +1738,8 @@ static void RGBAToYMatrixRow_LSX(const u - uint8_t* dst_y, - int width, - const struct RgbConstants* rgbconstants) { -- asm("vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants -+ asm volatile( -+ "vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants - "vldrepl.b $vr1, %3, 1 \n\t" // load rgbconstants - "vldrepl.b $vr2, %3, 2 \n\t" // load rgbconstants - "vldrepl.h $vr3, %3, 4 \n\t" // load rgbconstants -@@ -2920,7 +1796,8 @@ static void RGBToYMatrixRow_LSX(const ui - 7, 9, 10, 12, 13, 15, 1, 0, 4, 0, 7, 0, 10, - 0, 13, 0, 16, 0, 19, 0, 22, 0, 25, 0, 28, 0, - 31, 0, 2, 0, 5, 0, 8, 0, 11, 0, 14, 0}; -- asm("vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants -+ asm volatile( -+ "vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants - "vldrepl.b $vr1, %3, 1 \n\t" // load rgbconstants - "vldrepl.b $vr2, %3, 2 \n\t" // load rgbconstants - "vldrepl.h $vr3, %3, 4 \n\t" // load rgbconstants -diff --git a/media/libyuv/libyuv/source/row_neon.cc b/media/libyuv/libyuv/source/row_neon.cc ---- a/media/libyuv/libyuv/source/row_neon.cc -+++ b/media/libyuv/libyuv/source/row_neon.cc -@@ -89,14 +89,12 @@ extern "C" { - "vsli.u16 d2, d2, #8 \n" \ - "vsri.u16 d3, d3, #8 \n" - --// TODO: Use single register for kUVCoeff and multiply by lane - #define YUVTORGB_SETUP \ -- "vld1.16 {d31}, [%[kRGBCoeffBias]] \n" \ - "vld4.8 {d26[], d27[], d28[], d29[]}, [%[kUVCoeff]] \n" \ -- "vdup.u16 q10, d31[1] \n" \ -- "vdup.u16 q11, d31[2] \n" \ -- "vdup.u16 q12, d31[3] \n" \ -- "vdup.u16 d31, d31[0] \n" -+ "vld1.16 {d31[]}, [%[kRGBCoeffBias]]! \n" \ -+ "vld1.16 {d20[], d21[]}, [%[kRGBCoeffBias]]! \n" \ -+ "vld1.16 {d22[], d23[]}, [%[kRGBCoeffBias]]! \n" \ -+ "vld1.16 {d24[], d25[]}, [%[kRGBCoeffBias]] \n" - - // q0: B uint16x8_t - // q1: G uint16x8_t -@@ -140,7 +138,7 @@ void I444ToARGBRow_NEON(const uint8_t* s - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "vmov.u8 d6, #255 \n" - "1: \n" READYUV444 YUVTORGB -@@ -164,7 +162,7 @@ void I444ToRGB24Row_NEON(const uint8_t* - uint8_t* dst_rgb24, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "1: \n" READYUV444 YUVTORGB - RGBTORGB8 -@@ -187,7 +185,7 @@ void I422ToARGBRow_NEON(const uint8_t* s - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "vmov.u8 d6, #255 \n" - "1: \n" READYUV422 YUVTORGB -@@ -212,7 +210,7 @@ void I444AlphaToARGBRow_NEON(const uint8 - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "1: \n" READYUV444 YUVTORGB - RGBTORGB8 -@@ -238,7 +236,7 @@ void I422AlphaToARGBRow_NEON(const uint8 - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "1: \n" READYUV422 YUVTORGB - RGBTORGB8 -@@ -263,7 +261,7 @@ void I422ToRGBARow_NEON(const uint8_t* s - uint8_t* dst_rgba, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "vmov.u8 d6, #255 \n" - "1: \n" READYUV422 YUVTORGB -@@ -285,7 +283,7 @@ void I422ToRGB24Row_NEON(const uint8_t* - uint8_t* dst_rgb24, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "vmov.u8 d6, #255 \n" - "1: \n" READYUV422 YUVTORGB -@@ -316,7 +314,7 @@ void I422ToRGB565Row_NEON(const uint8_t* - uint8_t* dst_rgb565, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "vmov.u8 d6, #255 \n" - "1: \n" READYUV422 YUVTORGB -@@ -348,7 +346,7 @@ void I422ToARGB1555Row_NEON(const uint8_ - uint8_t* dst_argb1555, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "1: \n" READYUV422 YUVTORGB - RGBTORGB8 -@@ -381,7 +379,7 @@ void I422ToARGB4444Row_NEON(const uint8_ - uint8_t* dst_argb4444, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "vmov.u8 d6, #255 \n" - "vmov.u8 d7, #0x0f \n" // vbic bits to clear -@@ -404,7 +402,7 @@ void I400ToARGBRow_NEON(const uint8_t* s - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "vmov.u8 d6, #255 \n" - "1: \n" READYUV400 YUVTORGB -@@ -421,7 +419,7 @@ void I400ToARGBRow_NEON(const uint8_t* s - } - - void J400ToARGBRow_NEON(const uint8_t* src_y, uint8_t* dst_argb, int width) { -- asm volatile ( -+ asm volatile( - "vmov.u8 d23, #255 \n" - "1: \n" - "vld1.8 {d20}, [%0]! \n" -@@ -442,7 +440,7 @@ void NV12ToARGBRow_NEON(const uint8_t* s - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "vmov.u8 d6, #255 \n" - "1: \n" READNV12 YUVTORGB RGBTORGB8 -@@ -463,7 +461,7 @@ void NV21ToARGBRow_NEON(const uint8_t* s - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "vmov.u8 d6, #255 \n" - "1: \n" READNV21 YUVTORGB RGBTORGB8 -@@ -484,7 +482,7 @@ void NV12ToRGB24Row_NEON(const uint8_t* - uint8_t* dst_rgb24, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "vmov.u8 d6, #255 \n" - "1: \n" READNV12 YUVTORGB RGBTORGB8 -@@ -505,7 +503,7 @@ void NV21ToRGB24Row_NEON(const uint8_t* - uint8_t* dst_rgb24, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "vmov.u8 d6, #255 \n" - "1: \n" READNV21 YUVTORGB RGBTORGB8 -@@ -526,7 +524,7 @@ void NV12ToRGB565Row_NEON(const uint8_t* - uint8_t* dst_rgb565, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "vmov.u8 d6, #255 \n" - "1: \n" READNV12 YUVTORGB RGBTORGB8 -@@ -546,7 +544,7 @@ void YUY2ToARGBRow_NEON(const uint8_t* s - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "vmov.u8 d6, #255 \n" - "1: \n" READYUY2 YUVTORGB RGBTORGB8 -@@ -565,7 +563,7 @@ void UYVYToARGBRow_NEON(const uint8_t* s - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "vmov.u8 d6, #255 \n" - "1: \n" READUYVY YUVTORGB RGBTORGB8 -@@ -585,7 +583,7 @@ void SplitUVRow_NEON(const uint8_t* src_ - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld2.8 {q0, q1}, [%0]! \n" // load 16 pairs of UV - "subs %3, %3, #16 \n" // 16 processed per loop -@@ -609,7 +607,7 @@ void DetileRow_NEON(const uint8_t* src, - ptrdiff_t src_tile_stride, - uint8_t* dst, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld1.8 {q0}, [%0], %3 \n" // load 16 bytes - "subs %2, %2, #16 \n" // 16 processed per loop -@@ -629,7 +627,7 @@ void DetileRow_16_NEON(const uint16_t* s - ptrdiff_t src_tile_stride, - uint16_t* dst, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld1.16 {q0, q1}, [%0], %3 \n" // load 16 pixels - "subs %2, %2, #16 \n" // 16 processed per loop -@@ -650,7 +648,7 @@ void DetileSplitUVRow_NEON(const uint8_t - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld2.8 {d0, d1}, [%0], %4 \n" - "subs %3, %3, #16 \n" -@@ -675,7 +673,7 @@ void DetileToYUY2_NEON(const uint8_t* sr - ptrdiff_t src_uv_tile_stride, - uint8_t* dst_yuy2, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld1.8 {q0}, [%0], %4 \n" // Load 16 Y - "pld [%0, #1792] \n" -@@ -701,7 +699,7 @@ void DetileToYUY2_NEON(const uint8_t* sr - ptrdiff_t src_uv_tile_stride, - uint8_t* dst_yuy2, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld1.8 {q0}, [%0], %4 \n" // Load 16 Y - "vld1.8 {q1}, [%1], %5 \n" // Load 8 UV -@@ -723,43 +721,57 @@ void DetileToYUY2_NEON(const uint8_t* sr - #endif - - void UnpackMT2T_NEON(const uint8_t* src, uint16_t* dst, size_t size) { -- asm volatile ( -+ const uint8_t* src_lower_bits = src; -+ const uint8_t* src_upper_bits = src + 16; -+ asm volatile( - "1: \n" -- "vld1.8 {q14}, [%0]! \n" // Load lower bits. -- "vld1.8 {q9}, [%0]! \n" // Load upper bits row -- // by row. -- "vld1.8 {q11}, [%0]! \n" -- "vld1.8 {q13}, [%0]! \n" -- "vld1.8 {q15}, [%0]! \n" -- "vshl.u8 q8, q14, #6 \n" // Shift lower bit data -- // appropriately. -- "vshl.u8 q10, q14, #4 \n" -- "vshl.u8 q12, q14, #2 \n" -- "vzip.u8 q8, q9 \n" // Interleave upper and -- // lower bits. -- "vzip.u8 q10, q11 \n" -- "vzip.u8 q12, q13 \n" -- "vzip.u8 q14, q15 \n" -- "vsri.u16 q8, q8, #10 \n" // Copy upper 6 bits -- // into lower 6 bits for -- // better accuracy in -+ "vld4.8 {d1, d3, d5, d7}, [%1]! \n" // Load 32 bytes of upper -+ // bits. -+ "vld1.8 {d6}, [%0]! \n" // Load 8 bytes of lower -+ // bits. -+ "vshl.u8 d4, d6, #2 \n" // Align lower bits. -+ "vshl.u8 d2, d6, #4 \n" -+ "vshl.u8 d0, d6, #6 \n" -+ "vzip.u8 d0, d1 \n" // Zip lower and upper -+ // bits together. -+ "vzip.u8 d2, d3 \n" -+ "vzip.u8 d4, d5 \n" -+ "vzip.u8 d6, d7 \n" -+ "vsri.u16 q0, q0, #10 \n" // Copy upper 6 bits into -+ // lower 6 bits for better -+ // accuracy in - // conversions. -- "vsri.u16 q9, q9, #10 \n" -- "vsri.u16 q10, q10, #10 \n" -- "vsri.u16 q11, q11, #10 \n" -- "vsri.u16 q12, q12, #10 \n" -- "vsri.u16 q13, q13, #10 \n" -- "vsri.u16 q14, q14, #10 \n" -- "vsri.u16 q15, q15, #10 \n" -- "vstmia %1!, {q8-q15} \n" // Store pixel block (64 -- // pixels). -- "subs %2, %2, #80 \n" -+ "vsri.u16 q1, q1, #10 \n" -+ "vsri.u16 q2, q2, #10 \n" -+ "vsri.u16 q3, q3, #10 \n" -+ "vst4.16 {d0, d2, d4, d6}, [%2]! \n" // Store 32 pixels -+ "vst4.16 {d1, d3, d5, d7}, [%2]! \n" -+ "vld4.8 {d1, d3, d5, d7}, [%1]! \n" // Process last 32 pixels -+ // in the block -+ "vld1.8 {d6}, [%0]! \n" -+ "vshl.u8 d4, d6, #2 \n" -+ "vshl.u8 d2, d6, #4 \n" -+ "vshl.u8 d0, d6, #6 \n" -+ "vzip.u8 d0, d1 \n" -+ "vzip.u8 d2, d3 \n" -+ "vzip.u8 d4, d5 \n" -+ "vzip.u8 d6, d7 \n" -+ "vsri.u16 q0, q0, #10 \n" -+ "vsri.u16 q1, q1, #10 \n" -+ "vsri.u16 q2, q2, #10 \n" -+ "vsri.u16 q3, q3, #10 \n" -+ "vst4.16 {d0, d2, d4, d6}, [%2]! \n" -+ "vst4.16 {d1, d3, d5, d7}, [%2]! \n" -+ "mov %0, %1 \n" -+ "add %1, %0, #16 \n" -+ "subs %3, %3, #80 \n" - "bgt 1b \n" -- : "+r"(src), // %0 -- "+r"(dst), // %1 -- "+r"(size) // %2 -+ : "+r"(src_lower_bits), // %0 -+ "+r"(src_upper_bits), // %1 -+ "+r"(dst), // %2 -+ "+r"(size) // %3 - : -- : "cc", "memory", "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15"); -+ : "cc", "memory", "q0", "q1", "q2", "q3"); - } - - // Reads 16 U's and V's and writes out 16 pairs of UV. -@@ -767,7 +779,7 @@ void MergeUVRow_NEON(const uint8_t* src_ - const uint8_t* src_v, - uint8_t* dst_uv, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld1.8 {q0}, [%0]! \n" // load U - "vld1.8 {q1}, [%1]! \n" // load V -@@ -789,7 +801,7 @@ void SplitRGBRow_NEON(const uint8_t* src - uint8_t* dst_g, - uint8_t* dst_b, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld3.8 {d0, d2, d4}, [%0]! \n" // load 8 RGB - "vld3.8 {d1, d3, d5}, [%0]! \n" // next 8 RGB -@@ -804,7 +816,7 @@ void SplitRGBRow_NEON(const uint8_t* src - "+r"(dst_b), // %3 - "+r"(width) // %4 - : // Input registers -- : "cc", "memory", "q0", "q1", "q2" // Clobber List -+ : "cc", "memory", "d0", "d1", "d2" // Clobber List - ); - } - -@@ -814,7 +826,7 @@ void MergeRGBRow_NEON(const uint8_t* src - const uint8_t* src_b, - uint8_t* dst_rgb, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld1.8 {q0}, [%0]! \n" // load R - "vld1.8 {q1}, [%1]! \n" // load G -@@ -840,7 +852,7 @@ void SplitARGBRow_NEON(const uint8_t* sr - uint8_t* dst_b, - uint8_t* dst_a, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld4.8 {d0, d2, d4, d6}, [%0]! \n" // load 8 ARGB - "vld4.8 {d1, d3, d5, d7}, [%0]! \n" // next 8 ARGB -@@ -868,7 +880,7 @@ void MergeARGBRow_NEON(const uint8_t* sr - const uint8_t* src_a, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld1.8 {q2}, [%0]! \n" // load R - "vld1.8 {q1}, [%1]! \n" // load G -@@ -895,7 +907,7 @@ void SplitXRGBRow_NEON(const uint8_t* sr - uint8_t* dst_g, - uint8_t* dst_b, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld4.8 {d0, d2, d4, d6}, [%0]! \n" // load 8 ARGB - "vld4.8 {d1, d3, d5, d7}, [%0]! \n" // next 8 ARGB -@@ -920,7 +932,7 @@ void MergeXRGBRow_NEON(const uint8_t* sr - const uint8_t* src_b, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "vmov.u8 q3, #255 \n" // load A(255) - "1: \n" - "vld1.8 {q2}, [%0]! \n" // load R -@@ -947,7 +959,7 @@ void MergeXR30Row_NEON(const uint16_t* s - int depth, - int width) { - int shift = 10 - depth; -- asm volatile ( -+ asm volatile( - "vmov.u32 q14, #1023 \n" - "vdup.32 q15, %5 \n" - "1: \n" -@@ -984,7 +996,7 @@ void MergeXR30Row_10_NEON(const uint16_t - uint8_t* dst_ar30, - int /* depth */, - int width) { -- asm volatile ( -+ asm volatile( - "vmov.u32 q14, #1023 \n" - "1: \n" - "vld1.16 {d4}, [%2]! \n" // B -@@ -1021,7 +1033,7 @@ void MergeAR64Row_NEON(const uint16_t* s - int width) { - int shift = 16 - depth; - int mask = (1 << depth) - 1; -- asm volatile ( -+ asm volatile( - - "vdup.u16 q15, %6 \n" - "vdup.u16 q14, %7 \n" -@@ -1061,7 +1073,7 @@ void MergeXR64Row_NEON(const uint16_t* s - int width) { - int shift = 16 - depth; - int mask = (1 << depth) - 1; -- asm volatile ( -+ asm volatile( - - "vmov.u8 q3, #0xff \n" // A (0xffff) - "vdup.u16 q15, %5 \n" -@@ -1098,7 +1110,7 @@ void MergeARGB16To8Row_NEON(const uint16 - int depth, - int width) { - int shift = 8 - depth; -- asm volatile ( -+ asm volatile( - - "vdup.16 q15, %6 \n" - "1: \n" -@@ -1134,7 +1146,7 @@ void MergeXRGB16To8Row_NEON(const uint16 - int depth, - int width) { - int shift = 8 - depth; -- asm volatile ( -+ asm volatile( - - "vdup.16 q15, %5 \n" - "vmov.u8 d6, #0xff \n" // A (0xff) -@@ -1162,7 +1174,7 @@ void MergeXRGB16To8Row_NEON(const uint16 - - // Copy multiple of 32. vld4.8 allow unaligned and is fastest on a15. - void CopyRow_NEON(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld1.8 {d0, d1, d2, d3}, [%0]! \n" // load 32 - "subs %2, %2, #32 \n" // 32 processed per loop -@@ -1178,7 +1190,7 @@ void CopyRow_NEON(const uint8_t* src, ui - - // SetRow writes 'width' bytes using an 8 bit value repeated. - void SetRow_NEON(uint8_t* dst, uint8_t v8, int width) { -- asm volatile ( -+ asm volatile( - "vdup.8 q0, %2 \n" // duplicate 16 bytes - "1: \n" - "subs %1, %1, #16 \n" // 16 bytes per loop -@@ -1192,7 +1204,7 @@ void SetRow_NEON(uint8_t* dst, uint8_t v - - // ARGBSetRow writes 'width' pixels using an 32 bit value repeated. - void ARGBSetRow_NEON(uint8_t* dst, uint32_t v32, int width) { -- asm volatile ( -+ asm volatile( - "vdup.u32 q0, %2 \n" // duplicate 4 ints - "1: \n" - "subs %1, %1, #4 \n" // 4 pixels per loop -@@ -1205,7 +1217,7 @@ void ARGBSetRow_NEON(uint8_t* dst, uint3 - } - - void MirrorRow_NEON(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - // Start at end of source row. - "add %0, %0, %2 \n" - "sub %0, %0, #32 \n" // 32 bytes per loop -@@ -1227,7 +1239,7 @@ void MirrorRow_NEON(const uint8_t* src, - } - - void MirrorUVRow_NEON(const uint8_t* src_uv, uint8_t* dst_uv, int width) { -- asm volatile ( -+ asm volatile( - // Start at end of source row. - "mov r12, #-16 \n" - "add %0, %0, %2, lsl #1 \n" -@@ -1250,7 +1262,7 @@ void MirrorSplitUVRow_NEON(const uint8_t - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - // Start at end of source row. - "mov r12, #-16 \n" - "add %0, %0, %3, lsl #1 \n" -@@ -1272,7 +1284,7 @@ void MirrorSplitUVRow_NEON(const uint8_t - } - - void ARGBMirrorRow_NEON(const uint8_t* src_argb, uint8_t* dst_argb, int width) { -- asm volatile ( -+ asm volatile( - "add %0, %0, %2, lsl #2 \n" - "sub %0, #32 \n" - -@@ -1296,7 +1308,7 @@ void RGB24MirrorRow_NEON(const uint8_t* - uint8_t* dst_rgb24, - int width) { - src_rgb24 += width * 3 - 24; -- asm volatile ( -+ asm volatile( - "1: \n" - "vld3.8 {d0, d1, d2}, [%0], %3 \n" // src -= 24 - "subs %2, #8 \n" // 8 pixels per loop. -@@ -1315,7 +1327,7 @@ void RGB24MirrorRow_NEON(const uint8_t* - void RGB24ToARGBRow_NEON(const uint8_t* src_rgb24, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "vmov.u8 d4, #255 \n" // Alpha - "1: \n" - "vld3.8 {d1, d2, d3}, [%0]! \n" // load 8 pixels of RGB24. -@@ -1331,7 +1343,7 @@ void RGB24ToARGBRow_NEON(const uint8_t* - } - - void RAWToARGBRow_NEON(const uint8_t* src_raw, uint8_t* dst_argb, int width) { -- asm volatile ( -+ asm volatile( - "vmov.u8 d4, #255 \n" // Alpha - "1: \n" - "vld3.8 {d1, d2, d3}, [%0]! \n" // load 8 pixels of RAW. -@@ -1348,7 +1360,7 @@ void RAWToARGBRow_NEON(const uint8_t* sr - } - - void RAWToRGBARow_NEON(const uint8_t* src_raw, uint8_t* dst_rgba, int width) { -- asm volatile ( -+ asm volatile( - "vmov.u8 d0, #255 \n" // Alpha - "1: \n" - "vld3.8 {d1, d2, d3}, [%0]! \n" // load 8 pixels of RAW. -@@ -1364,7 +1376,7 @@ void RAWToRGBARow_NEON(const uint8_t* sr - ); - } - void RAWToRGB24Row_NEON(const uint8_t* src_raw, uint8_t* dst_rgb24, int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld3.8 {d1, d2, d3}, [%0]! \n" // load 8 pixels of RAW. - "subs %2, %2, #8 \n" // 8 processed per loop. -@@ -1395,7 +1407,7 @@ void RAWToRGB24Row_NEON(const uint8_t* s - void RGB565ToARGBRow_NEON(const uint8_t* src_rgb565, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "vmov.u8 d3, #255 \n" // Alpha - "1: \n" - "vld1.8 {q0}, [%0]! \n" // load 8 RGB565 pixels. -@@ -1441,7 +1453,7 @@ void RGB565ToARGBRow_NEON(const uint8_t* - void ARGB1555ToARGBRow_NEON(const uint8_t* src_argb1555, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "vmov.u8 d3, #255 \n" // Alpha - "1: \n" - "vld1.8 {q0}, [%0]! \n" // load 8 ARGB1555 pixels. -@@ -1470,7 +1482,7 @@ void ARGB1555ToARGBRow_NEON(const uint8_ - void ARGB4444ToARGBRow_NEON(const uint8_t* src_argb4444, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "vmov.u8 d3, #255 \n" // Alpha - "1: \n" - "vld1.8 {q0}, [%0]! \n" // load 8 ARGB4444 pixels. -@@ -1489,7 +1501,7 @@ void ARGB4444ToARGBRow_NEON(const uint8_ - void ARGBToRGB24Row_NEON(const uint8_t* src_argb, - uint8_t* dst_rgb24, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld4.8 {d0, d2, d4, d6}, [%0]! \n" // load 16 pixels of ARGB. - "vld4.8 {d1, d3, d5, d7}, [%0]! \n" -@@ -1506,7 +1518,7 @@ void ARGBToRGB24Row_NEON(const uint8_t* - } - - void ARGBToRAWRow_NEON(const uint8_t* src_argb, uint8_t* dst_raw, int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld4.8 {d1, d2, d3, d4}, [%0]! \n" // load 8 pixels of ARGB. - "subs %2, %2, #8 \n" // 8 processed per loop. -@@ -1522,7 +1534,7 @@ void ARGBToRAWRow_NEON(const uint8_t* sr - } - - void YUY2ToYRow_NEON(const uint8_t* src_yuy2, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld2.8 {q0, q1}, [%0]! \n" // load 16 pixels of YUY2. - "subs %2, %2, #16 \n" // 16 processed per loop. -@@ -1537,7 +1549,7 @@ void YUY2ToYRow_NEON(const uint8_t* src_ - } - - void UYVYToYRow_NEON(const uint8_t* src_uyvy, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld2.8 {q0, q1}, [%0]! \n" // load 16 pixels of UYVY. - "subs %2, %2, #16 \n" // 16 processed per loop. -@@ -1555,7 +1567,7 @@ void YUY2ToUV422Row_NEON(const uint8_t* - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // load 16 pixels of YUY2. - "subs %3, %3, #16 \n" // 16 pixels = 8 UVs. -@@ -1575,7 +1587,7 @@ void UYVYToUV422Row_NEON(const uint8_t* - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // load 16 pixels of UYVY. - "subs %3, %3, #16 \n" // 16 pixels = 8 UVs. -@@ -1596,7 +1608,7 @@ void YUY2ToUVRow_NEON(const uint8_t* src - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "add %1, %0, %1 \n" // stride + src_yuy2 - "1: \n" - "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // load 16 pixels of YUY2. -@@ -1623,7 +1635,7 @@ void UYVYToUVRow_NEON(const uint8_t* src - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "add %1, %0, %1 \n" // stride + src_uyvy - "1: \n" - "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // load 16 pixels of UYVY. -@@ -1649,7 +1661,7 @@ void YUY2ToNVUVRow_NEON(const uint8_t* s - int stride_yuy2, - uint8_t* dst_uv, - int width) { -- asm volatile ( -+ asm volatile( - "add %1, %0, %1 \n" // stride + src_yuy2 - "1: \n" - "vld2.8 {q0, q1}, [%0]! \n" // load 16 pixels of YUY2. -@@ -1673,7 +1685,7 @@ void ARGBShuffleRow_NEON(const uint8_t* - uint8_t* dst_argb, - const uint8_t* shuffler, - int width) { -- asm volatile ( -+ asm volatile( - "vld1.8 {q2}, [%3] \n" // shuffler - "1: \n" - "vld1.8 {q0}, [%0]! \n" // load 4 pixels. -@@ -1695,7 +1707,7 @@ void I422ToYUY2Row_NEON(const uint8_t* s - const uint8_t* src_v, - uint8_t* dst_yuy2, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld2.8 {d0, d2}, [%0]! \n" // load 16 Ys - "vld1.8 {d1}, [%1]! \n" // load 8 Us -@@ -1717,7 +1729,7 @@ void I422ToUYVYRow_NEON(const uint8_t* s - const uint8_t* src_v, - uint8_t* dst_uyvy, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld2.8 {d1, d3}, [%0]! \n" // load 16 Ys - "vld1.8 {d0}, [%1]! \n" // load 8 Us -@@ -1737,7 +1749,7 @@ void I422ToUYVYRow_NEON(const uint8_t* s - void ARGBToRGB565Row_NEON(const uint8_t* src_argb, - uint8_t* dst_rgb565, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld4.8 {d0, d2, d4, d6}, [%0]! \n" // load 8 pixels of ARGB. - "subs %2, %2, #8 \n" // 8 processed per loop. -@@ -1753,9 +1765,9 @@ void ARGBToRGB565Row_NEON(const uint8_t* - - void ARGBToRGB565DitherRow_NEON(const uint8_t* src_argb, - uint8_t* dst_rgb, -- uint32_t dither4, -+ const uint32_t dither4, - int width) { -- asm volatile ( -+ asm volatile( - "vdup.32 d7, %2 \n" // dither4 - "1: \n" - "vld4.8 {d0, d2, d4, d6}, [%1]! \n" // load 8 pixels of ARGB. -@@ -1776,7 +1788,7 @@ void ARGBToRGB565DitherRow_NEON(const ui - void ARGBToARGB1555Row_NEON(const uint8_t* src_argb, - uint8_t* dst_argb1555, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld4.8 {d0, d2, d4, d6}, [%0]! \n" // load 8 pixels of ARGB. - "subs %2, %2, #8 \n" // 8 processed per loop. -@@ -1793,7 +1805,7 @@ void ARGBToARGB1555Row_NEON(const uint8_ - void ARGBToARGB4444Row_NEON(const uint8_t* src_argb, - uint8_t* dst_argb4444, - int width) { -- asm volatile ( -+ asm volatile( - "vmov.u8 d7, #0x0f \n" // bits to clear with - // vbic. - "1: \n" -@@ -1812,7 +1824,7 @@ void ARGBToARGB4444Row_NEON(const uint8_ - void ARGBExtractAlphaRow_NEON(const uint8_t* src_argb, - uint8_t* dst_a, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld4.8 {d0, d2, d4, d6}, [%0]! \n" // load 8 ARGB pixels - "vld4.8 {d1, d3, d5, d7}, [%0]! \n" // load next 8 ARGB pixels -@@ -1827,27 +1839,19 @@ void ARGBExtractAlphaRow_NEON(const uint - ); - } - --struct RgbUVConstants { -- uint8_t kRGBToU[4]; -- uint8_t kRGBToV[4]; --}; -- - // 8x1 pixels. --void ARGBToUV444MatrixRow_NEON(const uint8_t* src_argb, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width, -- const struct RgbUVConstants* rgbuvconstants) { -- asm volatile ( -- -- "vld1.8 {d0}, [%4] \n" // load rgbuvconstants -- "vdup.u8 d24, d0[0] \n" // UB 0.875 coefficient -- "vdup.u8 d25, d0[1] \n" // UG -0.5781 coefficient -- "vdup.u8 d26, d0[2] \n" // UR -0.2969 coefficient -- "vdup.u8 d27, d0[4] \n" // VB -0.1406 coefficient -- "vdup.u8 d28, d0[5] \n" // VG -0.7344 coefficient -+void ARGBToUV444Row_NEON(const uint8_t* src_argb, -+ uint8_t* dst_u, -+ uint8_t* dst_v, -+ int width) { -+ asm volatile( -+ "vmov.u8 d24, #112 \n" // UB / VR 0.875 -+ // coefficient -+ "vmov.u8 d25, #74 \n" // UG -0.5781 coefficient -+ "vmov.u8 d26, #38 \n" // UR -0.2969 coefficient -+ "vmov.u8 d27, #18 \n" // VB -0.1406 coefficient -+ "vmov.u8 d28, #94 \n" // VG -0.7344 coefficient - "vmov.u16 q15, #0x8080 \n" // 128.5 -- - "1: \n" - "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // load 8 ARGB pixels. - "subs %3, %3, #8 \n" // 8 processed per loop. -@@ -1865,34 +1869,15 @@ void ARGBToUV444MatrixRow_NEON(const uin - "vst1.8 {d0}, [%1]! \n" // store 8 pixels U. - "vst1.8 {d1}, [%2]! \n" // store 8 pixels V. - "bgt 1b \n" -- : "+r"(src_argb), // %0 -- "+r"(dst_u), // %1 -- "+r"(dst_v), // %2 -- "+r"(width) // %3 -- : "r"(rgbuvconstants) // %4 -+ : "+r"(src_argb), // %0 -+ "+r"(dst_u), // %1 -+ "+r"(dst_v), // %2 -+ "+r"(width) // %3 -+ : - : "cc", "memory", "q0", "q1", "q2", "q3", "q4", "q12", "q13", "q14", - "q15"); - } - --// RGB to bt601 coefficients --// UB 0.875 coefficient = 112 --// UG -0.5781 coefficient = 74 --// UR -0.2969 coefficient = 38 --// VB -0.1406 coefficient = 18 --// VG -0.7344 coefficient = 94 --// VR 0.875 coefficient = 112 (ignored) -- --static const struct RgbUVConstants kRgb24I601UVConstants = {{112, 74, 38, 0}, -- {18, 94, 112, 0}}; -- --void ARGBToUV444Row_NEON(const uint8_t* src_argb, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width) { -- ARGBToUV444MatrixRow_NEON(src_argb, dst_u, dst_v, width, -- &kRgb24I601UVConstants); --} -- - // clang-format off - // 16x2 pixels -> 8x1. width is number of argb pixels. e.g. 16. - #define RGBTOUV(QB, QG, QR) \ -@@ -2366,7 +2351,7 @@ void RGB565ToUVRow_NEON(const uint8_t* s - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "add %1, %0, %1 \n" // src_stride + src_argb - "vmov.s16 q10, #112 / 2 \n" // UB / VR 0.875 - // coefficient -@@ -2432,7 +2417,7 @@ void ARGB1555ToUVRow_NEON(const uint8_t* - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "add %1, %0, %1 \n" // src_stride + src_argb - "vmov.s16 q10, #112 / 2 \n" // UB / VR 0.875 - // coefficient -@@ -2498,7 +2483,7 @@ void ARGB4444ToUVRow_NEON(const uint8_t* - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "add %1, %0, %1 \n" // src_stride + src_argb - "vmov.s16 q10, #112 / 2 \n" // UB / VR 0.875 - // coefficient -@@ -2550,7 +2535,7 @@ void ARGB4444ToUVRow_NEON(const uint8_t* - } - - void RGB565ToYRow_NEON(const uint8_t* src_rgb565, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "vmov.u8 d24, #25 \n" // B * 0.1016 coefficient - "vmov.u8 d25, #129 \n" // G * 0.5078 coefficient - "vmov.u8 d26, #66 \n" // R * 0.2578 coefficient -@@ -2576,7 +2561,7 @@ void RGB565ToYRow_NEON(const uint8_t* sr - void ARGB1555ToYRow_NEON(const uint8_t* src_argb1555, - uint8_t* dst_y, - int width) { -- asm volatile ( -+ asm volatile( - "vmov.u8 d24, #25 \n" // B * 0.1016 coefficient - "vmov.u8 d25, #129 \n" // G * 0.5078 coefficient - "vmov.u8 d26, #66 \n" // R * 0.2578 coefficient -@@ -2602,7 +2587,7 @@ void ARGB1555ToYRow_NEON(const uint8_t* - void ARGB4444ToYRow_NEON(const uint8_t* src_argb4444, - uint8_t* dst_y, - int width) { -- asm volatile ( -+ asm volatile( - "vmov.u8 d24, #25 \n" // B * 0.1016 coefficient - "vmov.u8 d25, #129 \n" // G * 0.5078 coefficient - "vmov.u8 d26, #66 \n" // R * 0.2578 coefficient -@@ -2628,7 +2613,7 @@ void ARGB4444ToYRow_NEON(const uint8_t* - void ARGBToAR64Row_NEON(const uint8_t* src_argb, - uint16_t* dst_ar64, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld1.8 {q0}, [%0]! \n" - "vld1.8 {q2}, [%0]! \n" -@@ -2651,7 +2636,7 @@ static const uvec8 kShuffleARGBToABGR = - void ARGBToAB64Row_NEON(const uint8_t* src_argb, - uint16_t* dst_ab64, - int width) { -- asm volatile ( -+ asm volatile( - "vld1.8 {q4}, [%3] \n" // shuffler - - "1: \n" -@@ -2677,7 +2662,7 @@ void ARGBToAB64Row_NEON(const uint8_t* s - void AR64ToARGBRow_NEON(const uint16_t* src_ar64, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld1.16 {q0}, [%0]! \n" - "vld1.16 {q1}, [%0]! \n" -@@ -2703,7 +2688,7 @@ static const uvec8 kShuffleAB64ToARGB = - void AB64ToARGBRow_NEON(const uint16_t* src_ab64, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "vld1.8 {d8}, [%3] \n" // shuffler - - "1: \n" -@@ -2729,6 +2714,7 @@ void AB64ToARGBRow_NEON(const uint16_t* - struct RgbConstants { - uint8_t kRGBToY[4]; - uint16_t kAddY; -+ uint16_t pad; - }; - - // RGB to JPeg coefficients -@@ -2736,9 +2722,11 @@ struct RgbConstants { - // G * 0.5870 coefficient = 150 - // R * 0.2990 coefficient = 77 - // Add 0.5 = 0x80 --static const struct RgbConstants kRgb24JPEGConstants = {{29, 150, 77, 0}, 128}; -+static const struct RgbConstants kRgb24JPEGConstants = {{29, 150, 77, 0}, -+ 128, -+ 0}; - --static const struct RgbConstants kRawJPEGConstants = {{77, 150, 29, 0}, 128}; -+static const struct RgbConstants kRawJPEGConstants = {{77, 150, 29, 0}, 128, 0}; - - // RGB to BT.601 coefficients - // B * 0.1016 coefficient = 25 -@@ -2747,16 +2735,19 @@ static const struct RgbConstants kRawJPE - // Add 16.5 = 0x1080 - - static const struct RgbConstants kRgb24I601Constants = {{25, 129, 66, 0}, -- 0x1080}; -+ 0x1080, -+ 0}; - --static const struct RgbConstants kRawI601Constants = {{66, 129, 25, 0}, 0x1080}; -+static const struct RgbConstants kRawI601Constants = {{66, 129, 25, 0}, -+ 0x1080, -+ 0}; - - // ARGB expects first 3 values to contain RGB and 4th value is ignored. - void ARGBToYMatrixRow_NEON(const uint8_t* src_argb, - uint8_t* dst_y, - int width, - const struct RgbConstants* rgbconstants) { -- asm volatile ( -+ asm volatile( - "vld1.8 {d0}, [%3] \n" // load rgbconstants - "vdup.u8 d20, d0[0] \n" - "vdup.u8 d21, d0[1] \n" -@@ -2806,7 +2797,7 @@ void RGBAToYMatrixRow_NEON(const uint8_t - uint8_t* dst_y, - int width, - const struct RgbConstants* rgbconstants) { -- asm volatile ( -+ asm volatile( - "vld1.8 {d0}, [%3] \n" // load rgbconstants - "vdup.u8 d20, d0[0] \n" - "vdup.u8 d21, d0[1] \n" -@@ -2850,7 +2841,7 @@ void RGBToYMatrixRow_NEON(const uint8_t* - uint8_t* dst_y, - int width, - const struct RgbConstants* rgbconstants) { -- asm volatile ( -+ asm volatile( - "vld1.8 {d0}, [%3] \n" // load rgbconstants - "vdup.u8 d20, d0[0] \n" - "vdup.u8 d21, d0[1] \n" -@@ -2902,7 +2893,7 @@ void InterpolateRow_NEON(uint8_t* dst_pt - int dst_width, - int source_y_fraction) { - int y1_fraction = source_y_fraction; -- asm volatile ( -+ asm volatile( - "cmp %4, #0 \n" - "beq 100f \n" - "add %2, %1 \n" -@@ -2964,7 +2955,7 @@ void InterpolateRow_16_NEON(uint16_t* ds - int y0_fraction = 256 - y1_fraction; - const uint16_t* src_ptr1 = src_ptr + src_stride; - -- asm volatile ( -+ asm volatile( - "cmp %4, #0 \n" - "beq 100f \n" - "cmp %4, #128 \n" -@@ -3019,7 +3010,7 @@ void ARGBBlendRow_NEON(const uint8_t* sr - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "subs %3, #8 \n" - "blt 89f \n" - // Blend 8 pixels. -@@ -3078,9 +3069,7 @@ void ARGBBlendRow_NEON(const uint8_t* sr - void ARGBAttenuateRow_NEON(const uint8_t* src_argb, - uint8_t* dst_argb, - int width) { -- asm volatile ( -- "vmov.u16 q15, #0x00ff \n" // 255 for rounding up -- -+ asm volatile( - // Attenuate 8 pixels. - "1: \n" - "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // load 8 pixels of ARGB. -@@ -3088,16 +3077,16 @@ void ARGBAttenuateRow_NEON(const uint8_t - "vmull.u8 q10, d0, d3 \n" // b * a - "vmull.u8 q11, d1, d3 \n" // g * a - "vmull.u8 q12, d2, d3 \n" // r * a -- "vaddhn.u16 d0, q10, q15 \n" // (b + 255) >> 8 -- "vaddhn.u16 d1, q11, q15 \n" // (g + 255) >> 8 -- "vaddhn.u16 d2, q12, q15 \n" // (r + 255) >> 8 -+ "vqrshrn.u16 d0, q10, #8 \n" // b >>= 8 -+ "vqrshrn.u16 d1, q11, #8 \n" // g >>= 8 -+ "vqrshrn.u16 d2, q12, #8 \n" // r >>= 8 - "vst4.8 {d0, d1, d2, d3}, [%1]! \n" // store 8 pixels of ARGB. - "bgt 1b \n" - : "+r"(src_argb), // %0 - "+r"(dst_argb), // %1 - "+r"(width) // %2 - : -- : "cc", "memory", "q0", "q1", "q10", "q11", "q12", "q15"); -+ : "cc", "memory", "q0", "q1", "q10", "q11", "q12"); - } - - // Quantize 8 ARGB pixels (32 bytes). -@@ -3107,7 +3096,7 @@ void ARGBQuantizeRow_NEON(uint8_t* dst_a - int interval_size, - int interval_offset, - int width) { -- asm volatile ( -+ asm volatile( - "vdup.u16 q8, %2 \n" - "vshr.u16 q8, q8, #1 \n" // scale >>= 1 - "vdup.u16 q9, %3 \n" // interval multiply. -@@ -3149,7 +3138,7 @@ void ARGBShadeRow_NEON(const uint8_t* sr - uint8_t* dst_argb, - int width, - uint32_t value) { -- asm volatile ( -+ asm volatile( - "vdup.u32 q0, %3 \n" // duplicate scale value. - "vzip.u8 d0, d1 \n" // d0 aarrggbb. - "vshr.u16 q0, q0, #1 \n" // scale / 2. -@@ -3183,7 +3172,7 @@ void ARGBShadeRow_NEON(const uint8_t* sr - // Similar to ARGBToYJ but stores ARGB. - // C code is (29 * b + 150 * g + 77 * r + 128) >> 8; - void ARGBGrayRow_NEON(const uint8_t* src_argb, uint8_t* dst_argb, int width) { -- asm volatile ( -+ asm volatile( - "vmov.u8 d24, #29 \n" // B * 0.1140 coefficient - "vmov.u8 d25, #150 \n" // G * 0.5870 coefficient - "vmov.u8 d26, #77 \n" // R * 0.2990 coefficient -@@ -3210,7 +3199,7 @@ void ARGBGrayRow_NEON(const uint8_t* src - // g = (r * 45 + g * 88 + b * 22) >> 7 - // r = (r * 50 + g * 98 + b * 24) >> 7 - void ARGBSepiaRow_NEON(uint8_t* dst_argb, int width) { -- asm volatile ( -+ asm volatile( - "vmov.u8 d20, #17 \n" // BB coefficient - "vmov.u8 d21, #68 \n" // BG coefficient - "vmov.u8 d22, #35 \n" // BR coefficient -@@ -3251,7 +3240,7 @@ void ARGBColorMatrixRow_NEON(const uint8 - uint8_t* dst_argb, - const int8_t* matrix_argb, - int width) { -- asm volatile ( -+ asm volatile( - "vld1.8 {q2}, [%3] \n" // load 3 ARGB vectors. - "vmovl.s8 q0, d4 \n" // B,G coefficients s16. - "vmovl.s8 q1, d5 \n" // R,A coefficients s16. -@@ -3310,7 +3299,7 @@ void ARGBMultiplyRow_NEON(const uint8_t* - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - // 8 pixel loop. - "1: \n" - "vld4.8 {d0, d2, d4, d6}, [%0]! \n" // load 8 ARGB pixels. -@@ -3339,7 +3328,7 @@ void ARGBAddRow_NEON(const uint8_t* src_ - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - // 8 pixel loop. - "1: \n" - "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // load 8 ARGB pixels. -@@ -3362,7 +3351,7 @@ void ARGBSubtractRow_NEON(const uint8_t* - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - // 8 pixel loop. - "1: \n" - "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // load 8 ARGB pixels. -@@ -3389,7 +3378,7 @@ void SobelRow_NEON(const uint8_t* src_so - const uint8_t* src_sobely, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "vmov.u8 d3, #255 \n" // alpha - // 8 pixel loop. - "1: \n" -@@ -3414,7 +3403,7 @@ void SobelToPlaneRow_NEON(const uint8_t* - const uint8_t* src_sobely, - uint8_t* dst_y, - int width) { -- asm volatile ( -+ asm volatile( - // 16 pixel loop. - "1: \n" - "vld1.8 {q0}, [%0]! \n" // load 16 sobelx. -@@ -3440,7 +3429,7 @@ void SobelXYRow_NEON(const uint8_t* src_ - const uint8_t* src_sobely, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "vmov.u8 d3, #255 \n" // alpha - // 8 pixel loop. - "1: \n" -@@ -3467,7 +3456,7 @@ void SobelXRow_NEON(const uint8_t* src_y - const uint8_t* src_y2, - uint8_t* dst_sobelx, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld1.8 {d0}, [%0],%5 \n" // top - "vld1.8 {d1}, [%0],%6 \n" -@@ -3505,7 +3494,7 @@ void SobelYRow_NEON(const uint8_t* src_y - const uint8_t* src_y1, - uint8_t* dst_sobely, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld1.8 {d0}, [%0],%4 \n" // left - "vld1.8 {d1}, [%1],%4 \n" -@@ -3542,7 +3531,7 @@ void HalfFloat1Row_NEON(const uint16_t* - uint16_t* dst, - float /*unused*/, - int width) { -- asm volatile ( -+ asm volatile( - - "1: \n" - "vld1.8 {q1}, [%0]! \n" // load 8 shorts -@@ -3568,7 +3557,7 @@ void HalfFloatRow_NEON(const uint16_t* s - uint16_t* dst, - float scale, - int width) { -- asm volatile ( -+ asm volatile( - - "1: \n" - "vld1.8 {q1}, [%0]! \n" // load 8 shorts -@@ -3594,7 +3583,7 @@ void ByteToFloatRow_NEON(const uint8_t* - float* dst, - float scale, - int width) { -- asm volatile ( -+ asm volatile( - - "1: \n" - "vld1.8 {d2}, [%0]! \n" // load 8 bytes -@@ -3623,7 +3612,7 @@ void GaussCol_NEON(const uint16_t* src0, - const uint16_t* src4, - uint32_t* dst, - int width) { -- asm volatile ( -+ asm volatile( - "vmov.u16 d6, #4 \n" // constant 4 - "vmov.u16 d7, #6 \n" // constant 6 - -@@ -3660,7 +3649,7 @@ void GaussRow_NEON(const uint32_t* src, - const uint32_t* src1 = src + 1; - const uint32_t* src2 = src + 2; - const uint32_t* src3 = src + 3; -- asm volatile ( -+ asm volatile( - "vmov.u32 q10, #4 \n" // constant 4 - "vmov.u32 q11, #6 \n" // constant 6 - -@@ -3698,7 +3687,7 @@ void NV21ToYUV24Row_NEON(const uint8_t* - const uint8_t* src_vu, - uint8_t* dst_yuv24, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld1.8 {q2}, [%0]! \n" // load 16 Y values - "vld2.8 {d0, d2}, [%1]! \n" // load 8 VU values -@@ -3722,7 +3711,7 @@ void AYUVToUVRow_NEON(const uint8_t* src - int src_stride_ayuv, - uint8_t* dst_uv, - int width) { -- asm volatile ( -+ asm volatile( - "add %1, %0, %1 \n" // src_stride + src_AYUV - "1: \n" - "vld4.8 {d0, d2, d4, d6}, [%0]! \n" // load 8 AYUV pixels. -@@ -3753,7 +3742,7 @@ void AYUVToVURow_NEON(const uint8_t* src - int src_stride_ayuv, - uint8_t* dst_vu, - int width) { -- asm volatile ( -+ asm volatile( - "add %1, %0, %1 \n" // src_stride + src_AYUV - "1: \n" - "vld4.8 {d0, d2, d4, d6}, [%0]! \n" // load 8 AYUV pixels. -@@ -3783,7 +3772,7 @@ void AYUVToVURow_NEON(const uint8_t* src - // Copy row of AYUV Y's into Y. - // Similar to ARGBExtractAlphaRow_NEON - void AYUVToYRow_NEON(const uint8_t* src_ayuv, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld4.8 {d0, d2, d4, d6}, [%0]! \n" // load 8 AYUV pixels - "vld4.8 {d1, d3, d5, d7}, [%0]! \n" // load next 8 AYUV pixels -@@ -3799,11 +3788,11 @@ void AYUVToYRow_NEON(const uint8_t* src_ - - // Convert UV plane of NV12 to VU of NV21. - void SwapUVRow_NEON(const uint8_t* src_uv, uint8_t* dst_vu, int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld2.8 {d0, d2}, [%0]! \n" // load 16 UV values - "vld2.8 {d1, d3}, [%0]! \n" -- "vmov.u8 q2, q0 \n" // move U after V -+ "vorr.u8 q2, q0, q0 \n" // move U after V - "subs %2, %2, #16 \n" // 16 pixels per loop - "vst2.8 {q1, q2}, [%1]! \n" // store 16 VU pixels - "bgt 1b \n" -@@ -3822,7 +3811,7 @@ void HalfMergeUVRow_NEON(const uint8_t* - int width) { - const uint8_t* src_u_1 = src_u + src_stride_u; - const uint8_t* src_v_1 = src_v + src_stride_v; -- asm volatile ( -+ asm volatile( - "1: \n" - "vld1.8 {q0}, [%0]! \n" // load 16 U values - "vld1.8 {q1}, [%2]! \n" // load 16 V values -@@ -3853,7 +3842,7 @@ void SplitUVRow_16_NEON(const uint16_t* - int depth, - int width) { - int shift = depth - 16; // Negative for right shift. -- asm volatile ( -+ asm volatile( - "vdup.16 q2, %4 \n" - "1: \n" - "vld2.16 {q0, q1}, [%0]! \n" // load 8 UV -@@ -3868,7 +3857,7 @@ void SplitUVRow_16_NEON(const uint16_t* - "+r"(dst_v), // %2 - "+r"(width) // %3 - : "r"(shift) // %4 -- : "cc", "memory", "q0", "q1", "q2"); -+ : "cc", "memory", "q0", "q1", "q2", "q3", "q4"); - } - - void MergeUVRow_16_NEON(const uint16_t* src_u, -@@ -3877,7 +3866,7 @@ void MergeUVRow_16_NEON(const uint16_t* - int depth, - int width) { - int shift = 16 - depth; -- asm volatile ( -+ asm volatile( - "vdup.16 q2, %4 \n" - "1: \n" - "vld1.16 {q0}, [%0]! \n" // load 8 U -@@ -3899,7 +3888,7 @@ void MultiplyRow_16_NEON(const uint16_t* - uint16_t* dst_y, - int scale, - int width) { -- asm volatile ( -+ asm volatile( - "vdup.16 q2, %3 \n" - "1: \n" - "vld1.16 {q0}, [%0]! \n" -@@ -3921,7 +3910,7 @@ void DivideRow_16_NEON(const uint16_t* s - uint16_t* dst_y, - int scale, - int width) { -- asm volatile ( -+ asm volatile( - "vdup.16 d8, %3 \n" - "1: \n" - "vld1.16 {q2, q3}, [%0]! \n" -@@ -3953,7 +3942,7 @@ void Convert16To8Row_NEON(const uint16_t - int scale, - int width) { - int shift = 15 - __builtin_clz((int32_t)scale); // Negative shl is shr -- asm volatile ( -+ asm volatile( - "vdup.16 q2, %3 \n" - "1: \n" - "vld1.16 {q0}, [%0]! \n" -diff --git a/media/libyuv/libyuv/source/row_neon64.cc b/media/libyuv/libyuv/source/row_neon64.cc ---- a/media/libyuv/libyuv/source/row_neon64.cc -+++ b/media/libyuv/libyuv/source/row_neon64.cc -@@ -28,67 +28,35 @@ extern "C" { - // Read 8 Y, 4 U and 4 V from 422 - #define READYUV422 \ - "ldr d0, [%[src_y]], #8 \n" \ -- "ldr s1, [%[src_u]], #4 \n" \ -- "ldr s2, [%[src_v]], #4 \n" \ -+ "ld1 {v1.s}[0], [%[src_u]], #4 \n" \ -+ "ld1 {v1.s}[1], [%[src_v]], #4 \n" \ - "zip1 v0.16b, v0.16b, v0.16b \n" \ - "prfm pldl1keep, [%[src_y], 448] \n" \ -- "zip1 v1.8b, v1.8b, v1.8b \n" \ -- "zip1 v2.8b, v2.8b, v2.8b \n" \ -- "prfm pldl1keep, [%[src_u], 128] \n" \ -- "prfm pldl1keep, [%[src_v], 128] \n" -- --// Read 8 Y, 4 U and 4 V from 210 --#define READYUV210 \ -- "ldr q2, [%[src_y]], #16 \n" \ -- "ldr d1, [%[src_u]], #8 \n" \ -- "ldr d3, [%[src_v]], #8 \n" \ -- "shl v0.8h, v2.8h, #6 \n" \ -- "usra v0.8h, v2.8h, #4 \n" \ -- "prfm pldl1keep, [%[src_y], 448] \n" \ -- "zip1 v2.8h, v3.8h, v3.8h \n" \ -- "zip1 v3.8h, v1.8h, v1.8h \n" \ -- "uqshrn v1.8b, v3.8h, #2 \n" \ -- "uqshrn2 v1.16b, v2.8h, #2 \n" \ -- "prfm pldl1keep, [%[src_u], 128] \n" \ -- "prfm pldl1keep, [%[src_v], 128] \n" -- --// Read 8 Y, 8 U and 8 V from 410 --#define READYUV410 \ -- "ldr q1, [%[src_y]], #16 \n" \ -- "ldr q2, [%[src_u]], #16 \n" \ -- "ldr q3, [%[src_v]], #16 \n" \ -- "shl v0.8h, v1.8h, #6 \n" \ -- "usra v0.8h, v1.8h, #4 \n" \ -- "prfm pldl1keep, [%[src_y], 448] \n" \ -- "uqshrn v1.8b, v2.8h, #2 \n" \ -- "uqshrn2 v1.16b, v3.8h, #2 \n" \ -+ "zip1 v1.16b, v1.16b, v1.16b \n" \ - "prfm pldl1keep, [%[src_u], 128] \n" \ - "prfm pldl1keep, [%[src_v], 128] \n" - - // Read 8 Y, 8 U and 8 V from 444 - #define READYUV444 \ - "ldr d0, [%[src_y]], #8 \n" \ -- "ldr d1, [%[src_u]], #8 \n" \ -- "ldr d2, [%[src_v]], #8 \n" \ -+ "ld1 {v1.d}[0], [%[src_u]], #8 \n" \ - "prfm pldl1keep, [%[src_y], 448] \n" \ -+ "ld1 {v1.d}[1], [%[src_v]], #8 \n" \ - "prfm pldl1keep, [%[src_u], 448] \n" \ - "zip1 v0.16b, v0.16b, v0.16b \n" \ - "prfm pldl1keep, [%[src_v], 448] \n" - --// Read 8 Y -+// Read 8 Y, and set 4 U and 4 V to 128 - #define READYUV400 \ - "ldr d0, [%[src_y]], #8 \n" \ -+ "movi v1.16b, #128 \n" \ - "prfm pldl1keep, [%[src_y], 448] \n" \ - "zip1 v0.16b, v0.16b, v0.16b \n" - - static const uvec8 kNV12Table = {0, 0, 2, 2, 4, 4, 6, 6, - 1, 1, 3, 3, 5, 5, 7, 7}; --static const uvec8 kNV12InterleavedTable = {0, 0, 4, 4, 8, 8, 12, 12, -- 2, 2, 6, 6, 10, 10, 14, 14}; - static const uvec8 kNV21Table = {1, 1, 3, 3, 5, 5, 7, 7, - 0, 0, 2, 2, 4, 4, 6, 6}; --static const uvec8 kNV21InterleavedTable = {1, 1, 5, 5, 9, 9, 13, 13, -- 3, 3, 7, 7, 11, 11, 15, 15}; - - // Read 8 Y and 4 UV from NV12 or NV21 - #define READNV12 \ -@@ -100,17 +68,17 @@ static const uvec8 kNV21InterleavedTable - "prfm pldl1keep, [%[src_uv], 448] \n" - - // Read 8 YUY2 --#define READYUY2 \ -- "ld1 {v3.16b}, [%[src_yuy2]], #16 \n" \ -- "trn1 v0.16b, v3.16b, v3.16b \n" \ -- "prfm pldl1keep, [%[src_yuy2], 448] \n" \ -- "tbl v1.16b, {v3.16b}, v2.16b \n" -+#define READYUY2 \ -+ "ld2 {v0.8b, v1.8b}, [%[src_yuy2]], #16 \n" \ -+ "zip1 v0.16b, v0.16b, v0.16b \n" \ -+ "prfm pldl1keep, [%[src_yuy2], 448] \n" \ -+ "tbl v1.16b, {v1.16b}, v2.16b \n" - - // Read 8 UYVY --#define READUYVY \ -- "ld1 {v3.16b}, [%[src_uyvy]], #16 \n" \ -- "trn2 v0.16b, v3.16b, v3.16b \n" \ -- "prfm pldl1keep, [%[src_uyvy], 448] \n" \ -+#define READUYVY \ -+ "ld2 {v3.8b, v4.8b}, [%[src_uyvy]], #16 \n" \ -+ "zip1 v0.16b, v4.16b, v4.16b \n" \ -+ "prfm pldl1keep, [%[src_uyvy], 448] \n" \ - "tbl v1.16b, {v3.16b}, v2.16b \n" - - // UB VR UG VG -@@ -123,14 +91,14 @@ static const uvec8 kNV21InterleavedTable - // v17.8h: G - // v18.8h: R - --// Convert from YUV (NV12 or NV21) to 2.14 fixed point RGB. --// Similar to I4XXTORGB but U/V components are in the low/high halves of v1. --#define NVTORGB \ -+// Convert from YUV to 2.14 fixed point RGB -+#define YUVTORGB \ - "umull2 v3.4s, v0.8h, v24.8h \n" \ - "umull v6.8h, v1.8b, v30.8b \n" \ - "umull v0.4s, v0.4h, v24.4h \n" \ - "umlal2 v6.8h, v1.16b, v31.16b \n" /* DG */ \ -- "uzp2 v0.8h, v0.8h, v3.8h \n" /* Y */ \ -+ "uqshrn v0.4h, v0.4s, #16 \n" \ -+ "uqshrn2 v0.8h, v3.4s, #16 \n" /* Y */ \ - "umull v4.8h, v1.8b, v28.8b \n" /* DB */ \ - "umull2 v5.8h, v1.16b, v29.16b \n" /* DR */ \ - "add v17.8h, v0.8h, v26.8h \n" /* G */ \ -@@ -140,69 +108,15 @@ static const uvec8 kNV21InterleavedTable - "uqsub v16.8h, v16.8h, v25.8h \n" /* B */ \ - "uqsub v18.8h, v18.8h, v27.8h \n" /* R */ - --// Convert from YUV (I444 or I420) to 2.14 fixed point RGB. --// Similar to NVTORGB but U/V components are in v1/v2. --#define I4XXTORGB \ -- "umull2 v3.4s, v0.8h, v24.8h \n" \ -- "umull v6.8h, v1.8b, v30.8b \n" \ -- "umull v0.4s, v0.4h, v24.4h \n" \ -- "umlal v6.8h, v2.8b, v31.8b \n" /* DG */ \ -- "uzp2 v0.8h, v0.8h, v3.8h \n" /* Y */ \ -- "umull v4.8h, v1.8b, v28.8b \n" /* DB */ \ -- "umull v5.8h, v2.8b, v29.8b \n" /* DR */ \ -- "add v17.8h, v0.8h, v26.8h \n" /* G */ \ -- "add v16.8h, v0.8h, v4.8h \n" /* B */ \ -- "add v18.8h, v0.8h, v5.8h \n" /* R */ \ -- "uqsub v17.8h, v17.8h, v6.8h \n" /* G */ \ -- "uqsub v16.8h, v16.8h, v25.8h \n" /* B */ \ -- "uqsub v18.8h, v18.8h, v27.8h \n" /* R */ -- --// Convert from YUV I400 to 2.14 fixed point RGB --#define I400TORGB \ -- "umull2 v3.4s, v0.8h, v24.8h \n" \ -- "umull v0.4s, v0.4h, v24.4h \n" \ -- "uzp2 v0.8h, v0.8h, v3.8h \n" /* Y */ \ -- "add v17.8h, v0.8h, v26.8h \n" /* G */ \ -- "add v16.8h, v0.8h, v4.8h \n" /* B */ \ -- "add v18.8h, v0.8h, v5.8h \n" /* R */ \ -- "uqsub v17.8h, v17.8h, v6.8h \n" /* G */ \ -- "uqsub v16.8h, v16.8h, v25.8h \n" /* B */ \ -- "uqsub v18.8h, v18.8h, v27.8h \n" /* R */ -- - // Convert from 2.14 fixed point RGB To 8 bit RGB - #define RGBTORGB8 \ - "uqshrn v17.8b, v17.8h, #6 \n" \ - "uqshrn v16.8b, v16.8h, #6 \n" \ - "uqshrn v18.8b, v18.8h, #6 \n" - --// Convert from 2.14 fixed point RGB to 8 bit RGB, placing the results in the --// top half of each lane. --#define RGBTORGB8_TOP \ -- "uqshl v17.8h, v17.8h, #2 \n" \ -- "uqshl v16.8h, v16.8h, #2 \n" \ -- "uqshl v18.8h, v18.8h, #2 \n" -- --// Store 2.14 fixed point RGB as AR30 elements --#define STOREAR30 \ -- /* Inputs: \ -- * v16.8h: xxbbbbbbbbbbxxxx \ -- * v17.8h: xxggggggggggxxxx \ -- * v18.8h: xxrrrrrrrrrrxxxx \ -- * v22.8h: 0011111111110000 (umin limit) \ -- * v23.8h: 1100000000000000 (alpha) \ -- */ \ -- "uqshl v0.8h, v16.8h, #2 \n" /* bbbbbbbbbbxxxxxx */ \ -- "uqshl v1.8h, v17.8h, #2 \n" /* ggggggggggxxxxxx */ \ -- "umin v2.8h, v18.8h, v22.8h \n" /* 00rrrrrrrrrrxxxx */ \ -- "shl v4.8h, v1.8h, #4 \n" /* ggggggxxxxxx0000 */ \ -- "orr v5.16b, v2.16b, v23.16b \n" /* 11rrrrrrrrrrxxxx */ \ -- "sri v4.8h, v0.8h, #6 \n" /* ggggggbbbbbbbbbb */ \ -- "sri v5.8h, v1.8h, #12 \n" /* 11rrrrrrrrrrgggg */ \ -- "st2 {v4.8h, v5.8h}, [%[dst_ar30]], #32 \n" -- --#define YUVTORGB_REGS \ -- "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", "v17", "v18", "v24", \ -- "v25", "v26", "v27", "v28", "v29", "v30", "v31" -+#define YUVTORGB_REGS \ -+ "v0", "v1", "v3", "v4", "v5", "v6", "v7", "v16", "v17", "v18", "v24", "v25", \ -+ "v26", "v27", "v28", "v29", "v30", "v31" - - void I444ToARGBRow_NEON(const uint8_t* src_y, - const uint8_t* src_u, -@@ -210,10 +124,10 @@ void I444ToARGBRow_NEON(const uint8_t* s - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "movi v19.8b, #255 \n" /* A */ -- "1: \n" READYUV444 I4XXTORGB -+ "1: \n" READYUV444 YUVTORGB - RGBTORGB8 - "subs %w[width], %w[width], #8 \n" - "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" -@@ -234,9 +148,9 @@ void I444ToRGB24Row_NEON(const uint8_t* - uint8_t* dst_rgb24, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP -- "1: \n" READYUV444 I4XXTORGB -+ "1: \n" READYUV444 YUVTORGB - RGBTORGB8 - "subs %w[width], %w[width], #8 \n" - "st3 {v16.8b,v17.8b,v18.8b}, [%[dst_rgb24]], #24 \n" -@@ -251,116 +165,16 @@ void I444ToRGB24Row_NEON(const uint8_t* - : "cc", "memory", YUVTORGB_REGS); - } - --void I210ToAR30Row_NEON(const uint16_t* src_y, -- const uint16_t* src_u, -- const uint16_t* src_v, -- uint8_t* dst_ar30, -- const struct YuvConstants* yuvconstants, -- int width) { -- const uvec8* uv_coeff = &yuvconstants->kUVCoeff; -- const vec16* rgb_coeff = &yuvconstants->kRGBCoeffBias; -- uint16_t limit = 0x3ff0; -- uint16_t alpha = 0xc000; -- asm volatile (YUVTORGB_SETUP -- "dup v22.8h, %w[limit] \n" -- "dup v23.8h, %w[alpha] \n" -- "1: \n" READYUV210 NVTORGB -- "subs %w[width], %w[width], #8 \n" STOREAR30 -- "b.gt 1b \n" -- : [src_y] "+r"(src_y), // %[src_y] -- [src_u] "+r"(src_u), // %[src_u] -- [src_v] "+r"(src_v), // %[src_v] -- [dst_ar30] "+r"(dst_ar30), // %[dst_ar30] -- [width] "+r"(width) // %[width] -- : [kUVCoeff] "r"(uv_coeff), // %[kUVCoeff] -- [kRGBCoeffBias] "r"(rgb_coeff), // %[kRGBCoeffBias] -- [limit] "r"(limit), // %[limit] -- [alpha] "r"(alpha) // %[alpha] -- : "cc", "memory", YUVTORGB_REGS, "v22", "v23"); --} -- --void I410ToAR30Row_NEON(const uint16_t* src_y, -- const uint16_t* src_u, -- const uint16_t* src_v, -- uint8_t* dst_ar30, -- const struct YuvConstants* yuvconstants, -- int width) { -- const uvec8* uv_coeff = &yuvconstants->kUVCoeff; -- const vec16* rgb_coeff = &yuvconstants->kRGBCoeffBias; -- uint16_t limit = 0x3ff0; -- uint16_t alpha = 0xc000; -- asm volatile (YUVTORGB_SETUP -- "dup v22.8h, %w[limit] \n" -- "dup v23.8h, %w[alpha] \n" -- "1: \n" READYUV410 NVTORGB -- "subs %w[width], %w[width], #8 \n" STOREAR30 -- "b.gt 1b \n" -- : [src_y] "+r"(src_y), // %[src_y] -- [src_u] "+r"(src_u), // %[src_u] -- [src_v] "+r"(src_v), // %[src_v] -- [dst_ar30] "+r"(dst_ar30), // %[dst_ar30] -- [width] "+r"(width) // %[width] -- : [kUVCoeff] "r"(uv_coeff), // %[kUVCoeff] -- [kRGBCoeffBias] "r"(rgb_coeff), // %[kRGBCoeffBias] -- [limit] "r"(limit), // %[limit] -- [alpha] "r"(alpha) // %[alpha] -- : "cc", "memory", YUVTORGB_REGS, "v22", "v23"); --} -- --void I210ToARGBRow_NEON(const uint16_t* src_y, -- const uint16_t* src_u, -- const uint16_t* src_v, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width) { -- asm volatile (YUVTORGB_SETUP -- "movi v19.8b, #255 \n" -- "1: \n" READYUV210 NVTORGB RGBTORGB8 -- "subs %w[width], %w[width], #8 \n" -- "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" -- "b.gt 1b \n" -- : [src_y] "+r"(src_y), // %[src_y] -- [src_u] "+r"(src_u), // %[src_u] -- [src_v] "+r"(src_v), // %[src_v] -- [dst_argb] "+r"(dst_argb), // %[dst_argb] -- [width] "+r"(width) // %[width] -- : [kUVCoeff] "r"(&yuvconstants->kUVCoeff), // %[kUVCoeff] -- [kRGBCoeffBias] "r"(&yuvconstants->kRGBCoeffBias) // %[kRGBCoeffBias] -- : "cc", "memory", YUVTORGB_REGS, "v19"); --} -- --void I410ToARGBRow_NEON(const uint16_t* src_y, -- const uint16_t* src_u, -- const uint16_t* src_v, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width) { -- asm volatile (YUVTORGB_SETUP -- "movi v19.8b, #255 \n" -- "1: \n" READYUV410 NVTORGB RGBTORGB8 -- "subs %w[width], %w[width], #8 \n" -- "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" -- "b.gt 1b \n" -- : [src_y] "+r"(src_y), // %[src_y] -- [src_u] "+r"(src_u), // %[src_u] -- [src_v] "+r"(src_v), // %[src_v] -- [dst_argb] "+r"(dst_argb), // %[dst_argb] -- [width] "+r"(width) // %[width] -- : [kUVCoeff] "r"(&yuvconstants->kUVCoeff), // %[kUVCoeff] -- [kRGBCoeffBias] "r"(&yuvconstants->kRGBCoeffBias) // %[kRGBCoeffBias] -- : "cc", "memory", YUVTORGB_REGS, "v19"); --} -- - void I422ToARGBRow_NEON(const uint8_t* src_y, - const uint8_t* src_u, - const uint8_t* src_v, - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "movi v19.8b, #255 \n" /* A */ -- "1: \n" READYUV422 I4XXTORGB -+ "1: \n" READYUV422 YUVTORGB - RGBTORGB8 - "subs %w[width], %w[width], #8 \n" - "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" -@@ -382,61 +196,11 @@ void I444AlphaToARGBRow_NEON(const uint8 - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "1: \n" - "ld1 {v19.8b}, [%[src_a]], #8 \n" READYUV444 -- "prfm pldl1keep, [%[src_a], 448] \n" I4XXTORGB RGBTORGB8 -- "subs %w[width], %w[width], #8 \n" -- "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" -- "b.gt 1b \n" -- : [src_y] "+r"(src_y), // %[src_y] -- [src_u] "+r"(src_u), // %[src_u] -- [src_v] "+r"(src_v), // %[src_v] -- [src_a] "+r"(src_a), // %[src_a] -- [dst_argb] "+r"(dst_argb), // %[dst_argb] -- [width] "+r"(width) // %[width] -- : [kUVCoeff] "r"(&yuvconstants->kUVCoeff), // %[kUVCoeff] -- [kRGBCoeffBias] "r"(&yuvconstants->kRGBCoeffBias) // %[kRGBCoeffBias] -- : "cc", "memory", YUVTORGB_REGS, "v19"); --} -- --void I410AlphaToARGBRow_NEON(const uint16_t* src_y, -- const uint16_t* src_u, -- const uint16_t* src_v, -- const uint16_t* src_a, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width) { -- asm volatile (YUVTORGB_SETUP -- "1: \n" -- "ld1 {v19.16b}, [%[src_a]], #16 \n" READYUV410 -- "uqshrn v19.8b, v19.8h, #2 \n" NVTORGB RGBTORGB8 -- "subs %w[width], %w[width], #8 \n" -- "st4 {v16.8b, v17.8b, v18.8b, v19.8b}, [%[dst_argb]], #32 \n" -- "b.gt 1b \n" -- : [src_y] "+r"(src_y), // %[src_y] -- [src_u] "+r"(src_u), // %[src_u] -- [src_v] "+r"(src_v), // %[src_v] -- [src_a] "+r"(src_a), // %[src_a] -- [dst_argb] "+r"(dst_argb), // %[dst_argb] -- [width] "+r"(width) // %[width] -- : [kUVCoeff] "r"(&yuvconstants->kUVCoeff), // %[kUVCoeff] -- [kRGBCoeffBias] "r"(&yuvconstants->kRGBCoeffBias) // %[kRGBCoeffBias] -- : "cc", "memory", YUVTORGB_REGS, "v19"); --} -- --void I210AlphaToARGBRow_NEON(const uint16_t* src_y, -- const uint16_t* src_u, -- const uint16_t* src_v, -- const uint16_t* src_a, -- uint8_t* dst_argb, -- const struct YuvConstants* yuvconstants, -- int width) { -- asm volatile (YUVTORGB_SETUP -- "1: \n" -- "ld1 {v19.16b}, [%[src_a]], #16 \n" READYUV210 -- "uqshrn v19.8b, v19.8h, #2 \n" NVTORGB RGBTORGB8 -+ "prfm pldl1keep, [%[src_a], 448] \n" YUVTORGB RGBTORGB8 - "subs %w[width], %w[width], #8 \n" - "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" - "b.gt 1b \n" -@@ -458,11 +222,11 @@ void I422AlphaToARGBRow_NEON(const uint8 - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "1: \n" - "ld1 {v19.8b}, [%[src_a]], #8 \n" READYUV422 -- "prfm pldl1keep, [%[src_a], 448] \n" I4XXTORGB RGBTORGB8 -+ "prfm pldl1keep, [%[src_a], 448] \n" YUVTORGB RGBTORGB8 - "subs %w[width], %w[width], #8 \n" - "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" - "b.gt 1b \n" -@@ -483,10 +247,10 @@ void I422ToRGBARow_NEON(const uint8_t* s - uint8_t* dst_rgba, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "movi v15.8b, #255 \n" /* A */ -- "1: \n" READYUV422 I4XXTORGB -+ "1: \n" READYUV422 YUVTORGB - RGBTORGB8 - "subs %w[width], %w[width], #8 \n" - "st4 {v15.8b,v16.8b,v17.8b,v18.8b}, [%[dst_rgba]], #32 \n" -@@ -507,9 +271,9 @@ void I422ToRGB24Row_NEON(const uint8_t* - uint8_t* dst_rgb24, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP -- "1: \n" READYUV422 I4XXTORGB -+ "1: \n" READYUV422 YUVTORGB - RGBTORGB8 - "subs %w[width], %w[width], #8 \n" - "st3 {v16.8b,v17.8b,v18.8b}, [%[dst_rgb24]], #24 \n" -@@ -524,24 +288,12 @@ void I422ToRGB24Row_NEON(const uint8_t* - : "cc", "memory", YUVTORGB_REGS); - } - --#define ARGBTORGB565 \ -- /* Inputs: \ -- * v16: bbbbbxxx \ -- * v17: ggggggxx \ -- * v18: rrrrrxxx */ \ -- "shll v18.8h, v18.8b, #8 \n" /* rrrrrrxx00000000 */ \ -- "shll v17.8h, v17.8b, #8 \n" /* gggggxxx00000000 */ \ -- "shll v16.8h, v16.8b, #8 \n" /* bbbbbbxx00000000 */ \ -- "sri v18.8h, v17.8h, #5 \n" /* rrrrrgggggg00000 */ \ -- "sri v18.8h, v16.8h, #11 \n" /* rrrrrggggggbbbbb */ -- --#define ARGBTORGB565_FROM_TOP \ -- /* Inputs: \ -- * v16: bbbbbxxxxxxxxxxx \ -- * v17: ggggggxxxxxxxxxx \ -- * v18: rrrrrxxxxxxxxxxx */ \ -- "sri v18.8h, v17.8h, #5 \n" /* rrrrrgggggg00000 */ \ -- "sri v18.8h, v16.8h, #11 \n" /* rrrrrggggggbbbbb */ -+#define ARGBTORGB565 \ -+ "shll v18.8h, v18.8b, #8 \n" /* R */ \ -+ "shll v17.8h, v17.8b, #8 \n" /* G */ \ -+ "shll v16.8h, v16.8b, #8 \n" /* B */ \ -+ "sri v18.8h, v17.8h, #5 \n" /* RG */ \ -+ "sri v18.8h, v16.8h, #11 \n" /* RGB */ - - void I422ToRGB565Row_NEON(const uint8_t* src_y, - const uint8_t* src_u, -@@ -549,11 +301,10 @@ void I422ToRGB565Row_NEON(const uint8_t* - uint8_t* dst_rgb565, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP -- "1: \n" READYUV422 I4XXTORGB -- RGBTORGB8_TOP -- "subs %w[width], %w[width], #8 \n" ARGBTORGB565_FROM_TOP -+ "1: \n" READYUV422 YUVTORGB -+ RGBTORGB8 "subs %w[width], %w[width], #8 \n" ARGBTORGB565 - "st1 {v18.8h}, [%[dst_rgb565]], #16 \n" // store 8 pixels RGB565. - "b.gt 1b \n" - : [src_y] "+r"(src_y), // %[src_y] -@@ -566,24 +317,14 @@ void I422ToRGB565Row_NEON(const uint8_t* - : "cc", "memory", YUVTORGB_REGS); - } - --#define ARGBTOARGB1555 \ -- /* Inputs: \ -- * v16: bbbbbxxx v17: gggggxxx v18: rrrrrxxx v19: axxxxxxx */ \ -- "shll v0.8h, v19.8b, #8 \n" /* axxxxxxx00000000 */ \ -- "shll v18.8h, v18.8b, #8 \n" /* rrrrrxxx00000000 */ \ -- "shll v17.8h, v17.8b, #8 \n" /* gggggxxx00000000 */ \ -- "shll v16.8h, v16.8b, #8 \n" /* bbbbbxxx00000000 */ \ -- "sri v0.8h, v18.8h, #1 \n" /* arrrrrxxx0000000 */ \ -- "sri v0.8h, v17.8h, #6 \n" /* arrrrrgggggxxx00 */ \ -- "sri v0.8h, v16.8h, #11 \n" /* arrrrrgggggbbbbb */ -- --#define ARGBTOARGB1555_FROM_TOP \ -- /* Inputs: \ -- * v16: bbbbbxxxxxxxxxxx v17: gggggxxxxxxxxxxx \ -- * v18: rrrrrxxxxxxxxxxx v19: axxxxxxxxxxxxxxx */ \ -- "sri v19.8h, v18.8h, #1 \n" /* arrrrrxxxxxxxxxx */ \ -- "sri v19.8h, v17.8h, #6 \n" /* arrrrrgggggxxxxx */ \ -- "sri v19.8h, v16.8h, #11 \n" /* arrrrrgggggbbbbb */ -+#define ARGBTOARGB1555 \ -+ "shll v0.8h, v19.8b, #8 \n" /* A */ \ -+ "shll v18.8h, v18.8b, #8 \n" /* R */ \ -+ "shll v17.8h, v17.8b, #8 \n" /* G */ \ -+ "shll v16.8h, v16.8b, #8 \n" /* B */ \ -+ "sri v0.8h, v18.8h, #1 \n" /* AR */ \ -+ "sri v0.8h, v17.8h, #6 \n" /* ARG */ \ -+ "sri v0.8h, v16.8h, #11 \n" /* ARGB */ - - void I422ToARGB1555Row_NEON(const uint8_t* src_y, - const uint8_t* src_u, -@@ -591,14 +332,15 @@ void I422ToARGB1555Row_NEON(const uint8_ - uint8_t* dst_argb1555, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile (YUVTORGB_SETUP -- "movi v19.8h, #0x80, lsl #8 \n" -- "1: \n" // -- READYUV422 I4XXTORGB RGBTORGB8_TOP -- "subs %w[width], %w[width], #8 \n" // -- ARGBTOARGB1555_FROM_TOP -- "st1 {v19.8h}, [%[dst_argb1555]], #16 \n" // store 8 pixels RGB1555. -- "b.gt 1b \n" -+ asm volatile( -+ YUVTORGB_SETUP -+ "movi v19.8b, #255 \n" -+ "1: \n" READYUV422 YUVTORGB -+ RGBTORGB8 -+ "subs %w[width], %w[width], #8 \n" ARGBTOARGB1555 -+ "st1 {v0.8h}, [%[dst_argb1555]], #16 \n" // store 8 pixels -+ // RGB565. -+ "b.gt 1b \n" - : [src_y] "+r"(src_y), // %[src_y] - [src_u] "+r"(src_u), // %[src_u] - [src_v] "+r"(src_v), // %[src_v] -@@ -609,11 +351,15 @@ void I422ToARGB1555Row_NEON(const uint8_ - : "cc", "memory", YUVTORGB_REGS, "v19"); - } - --#define ARGBTOARGB4444 \ -- /* Input v16.8b<=B, v17.8b<=G, v18.8b<=R, v19.8b<=A */ \ -- "sri v17.8b, v16.8b, #4 \n" /* BG */ \ -- "sri v19.8b, v18.8b, #4 \n" /* RA */ \ -- "zip1 v0.16b, v17.16b, v19.16b \n" /* BGRA */ -+#define ARGBTOARGB4444 \ -+ /* Input v16.8b<=B, v17.8b<=G, v18.8b<=R, v19.8b<=A, v23.8b<=0x0f */ \ -+ "ushr v16.8b, v16.8b, #4 \n" /* B */ \ -+ "bic v17.8b, v17.8b, v23.8b \n" /* G */ \ -+ "ushr v18.8b, v18.8b, #4 \n" /* R */ \ -+ "bic v19.8b, v19.8b, v23.8b \n" /* A */ \ -+ "orr v0.8b, v16.8b, v17.8b \n" /* BG */ \ -+ "orr v1.8b, v18.8b, v19.8b \n" /* RA */ \ -+ "zip1 v0.16b, v0.16b, v1.16b \n" /* BGRA */ - - void I422ToARGB4444Row_NEON(const uint8_t* src_y, - const uint8_t* src_u, -@@ -621,9 +367,11 @@ void I422ToARGB4444Row_NEON(const uint8_ - uint8_t* dst_argb4444, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP -- "1: \n" READYUV422 I4XXTORGB -+ "movi v23.16b, #0x0f \n" // bits to clear with -+ // vbic. -+ "1: \n" READYUV422 YUVTORGB - RGBTORGB8 - "subs %w[width], %w[width], #8 \n" - "movi v19.8b, #255 \n" ARGBTOARGB4444 -@@ -638,22 +386,17 @@ void I422ToARGB4444Row_NEON(const uint8_ - [width] "+r"(width) // %[width] - : [kUVCoeff] "r"(&yuvconstants->kUVCoeff), // %[kUVCoeff] - [kRGBCoeffBias] "r"(&yuvconstants->kRGBCoeffBias) // %[kRGBCoeffBias] -- : "cc", "memory", YUVTORGB_REGS, "v19"); -+ : "cc", "memory", YUVTORGB_REGS, "v19", "v23"); - } - - void I400ToARGBRow_NEON(const uint8_t* src_y, - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP -- "movi v1.16b, #128 \n" - "movi v19.8b, #255 \n" -- "umull v6.8h, v1.8b, v30.8b \n" -- "umlal2 v6.8h, v1.16b, v31.16b \n" /* DG */ -- "umull v4.8h, v1.8b, v28.8b \n" /* DB */ -- "umull2 v5.8h, v1.16b, v29.16b \n" /* DR */ -- "1: \n" READYUV400 I400TORGB -+ "1: \n" READYUV400 YUVTORGB - RGBTORGB8 - "subs %w[width], %w[width], #8 \n" - "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" -@@ -668,13 +411,13 @@ void I400ToARGBRow_NEON(const uint8_t* s - - #if LIBYUV_USE_ST4 - void J400ToARGBRow_NEON(const uint8_t* src_y, uint8_t* dst_argb, int width) { -- asm volatile ( -+ asm volatile( - "movi v23.8b, #255 \n" - "1: \n" - "ld1 {v20.8b}, [%0], #8 \n" - "prfm pldl1keep, [%0, 448] \n" -- "mov v21.8b, v20.8b \n" -- "mov v22.8b, v20.8b \n" -+ "orr v21.8b, v20.8b, v20.8b \n" -+ "orr v22.8b, v20.8b, v20.8b \n" - "subs %w2, %w2, #8 \n" - "st4 {v20.8b,v21.8b,v22.8b,v23.8b}, [%1], #32 \n" - "b.gt 1b \n" -@@ -686,7 +429,7 @@ void J400ToARGBRow_NEON(const uint8_t* s - } - #else - void J400ToARGBRow_NEON(const uint8_t* src_y, uint8_t* dst_argb, int width) { -- asm volatile ( -+ asm volatile( - "movi v20.8b, #255 \n" - "1: \n" - "ldr d16, [%0], #8 \n" -@@ -711,11 +454,11 @@ void NV12ToARGBRow_NEON(const uint8_t* s - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "movi v19.8b, #255 \n" - "ldr q2, [%[kNV12Table]] \n" -- "1: \n" READNV12 NVTORGB RGBTORGB8 -+ "1: \n" READNV12 YUVTORGB RGBTORGB8 - "subs %w[width], %w[width], #8 \n" - "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" - "b.gt 1b \n" -@@ -734,11 +477,11 @@ void NV21ToARGBRow_NEON(const uint8_t* s - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "movi v19.8b, #255 \n" - "ldr q2, [%[kNV12Table]] \n" -- "1: \n" READNV12 NVTORGB RGBTORGB8 -+ "1: \n" READNV12 YUVTORGB RGBTORGB8 - "subs %w[width], %w[width], #8 \n" - "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" - "b.gt 1b \n" -@@ -757,10 +500,10 @@ void NV12ToRGB24Row_NEON(const uint8_t* - uint8_t* dst_rgb24, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "ldr q2, [%[kNV12Table]] \n" -- "1: \n" READNV12 NVTORGB RGBTORGB8 -+ "1: \n" READNV12 YUVTORGB RGBTORGB8 - "subs %w[width], %w[width], #8 \n" - "st3 {v16.8b,v17.8b,v18.8b}, [%[dst_rgb24]], #24 \n" - "b.gt 1b \n" -@@ -779,10 +522,10 @@ void NV21ToRGB24Row_NEON(const uint8_t* - uint8_t* dst_rgb24, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "ldr q2, [%[kNV12Table]] \n" -- "1: \n" READNV12 NVTORGB RGBTORGB8 -+ "1: \n" READNV12 YUVTORGB RGBTORGB8 - "subs %w[width], %w[width], #8 \n" - "st3 {v16.8b,v17.8b,v18.8b}, [%[dst_rgb24]], #24 \n" - "b.gt 1b \n" -@@ -801,12 +544,11 @@ void NV12ToRGB565Row_NEON(const uint8_t* - uint8_t* dst_rgb565, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP - "ldr q2, [%[kNV12Table]] \n" -- "1: \n" READNV12 NVTORGB -- RGBTORGB8_TOP -- "subs %w[width], %w[width], #8 \n" ARGBTORGB565_FROM_TOP -+ "1: \n" READNV12 YUVTORGB RGBTORGB8 -+ "subs %w[width], %w[width], #8 \n" ARGBTORGB565 - "st1 {v18.8h}, [%[dst_rgb565]], #16 \n" // store 8 - // pixels - // RGB565. -@@ -825,20 +567,20 @@ void YUY2ToARGBRow_NEON(const uint8_t* s - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP -- "movi v19.8b, #255 \n" -- "ldr q2, [%[kNV21InterleavedTable]] \n" -- "1: \n" READYUY2 NVTORGB RGBTORGB8 -- "subs %w[width], %w[width], #8 \n" -+ "movi v19.8b, #255 \n" -+ "ldr q2, [%[kNV12Table]] \n" -+ "1: \n" READYUY2 YUVTORGB RGBTORGB8 -+ "subs %w[width], %w[width], #8 \n" - "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" -- "b.gt 1b \n" -+ "b.gt 1b \n" - : [src_yuy2] "+r"(src_yuy2), // %[src_yuy2] - [dst_argb] "+r"(dst_argb), // %[dst_argb] - [width] "+r"(width) // %[width] - : [kUVCoeff] "r"(&yuvconstants->kUVCoeff), // %[kUVCoeff] - [kRGBCoeffBias] "r"(&yuvconstants->kRGBCoeffBias), // %[kRGBCoeffBias] -- [kNV21InterleavedTable] "r"(&kNV21InterleavedTable) -+ [kNV12Table] "r"(&kNV12Table) - : "cc", "memory", YUVTORGB_REGS, "v2", "v19"); - } - -@@ -846,20 +588,20 @@ void UYVYToARGBRow_NEON(const uint8_t* s - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm volatile ( -+ asm volatile( - YUVTORGB_SETUP -- "movi v19.8b, #255 \n" -- "ldr q2, [%[kNV12InterleavedTable]] \n" -- "1: \n" READUYVY NVTORGB RGBTORGB8 -- "subs %w[width], %w[width], #8 \n" -+ "movi v19.8b, #255 \n" -+ "ldr q2, [%[kNV12Table]] \n" -+ "1: \n" READUYVY YUVTORGB RGBTORGB8 -+ "subs %w[width], %w[width], #8 \n" - "st4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%[dst_argb]], #32 \n" -- "b.gt 1b \n" -+ "b.gt 1b \n" - : [src_uyvy] "+r"(src_uyvy), // %[src_yuy2] - [dst_argb] "+r"(dst_argb), // %[dst_argb] - [width] "+r"(width) // %[width] - : [kUVCoeff] "r"(&yuvconstants->kUVCoeff), // %[kUVCoeff] - [kRGBCoeffBias] "r"(&yuvconstants->kRGBCoeffBias), // %[kRGBCoeffBias] -- [kNV12InterleavedTable] "r"(&kNV12InterleavedTable) -+ [kNV12Table] "r"(&kNV12Table) - : "cc", "memory", YUVTORGB_REGS, "v2", "v19"); - } - -@@ -868,7 +610,7 @@ void SplitUVRow_NEON(const uint8_t* src_ - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld2 {v0.16b,v1.16b}, [%0], #32 \n" // load 16 pairs of UV - "subs %w3, %w3, #16 \n" // 16 processed per loop -@@ -893,7 +635,7 @@ void DetileRow_NEON(const uint8_t* src, - ptrdiff_t src_tile_stride, - uint8_t* dst, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld1 {v0.16b}, [%0], %3 \n" // load 16 bytes - "subs %w2, %w2, #16 \n" // 16 processed per loop -@@ -913,7 +655,7 @@ void DetileRow_16_NEON(const uint16_t* s - ptrdiff_t src_tile_stride, - uint16_t* dst, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld1 {v0.8h,v1.8h}, [%0], %3 \n" // load 16 pixels - "subs %w2, %w2, #16 \n" // 16 processed per loop -@@ -934,7 +676,7 @@ void DetileSplitUVRow_NEON(const uint8_t - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld2 {v0.8b,v1.8b}, [%0], %4 \n" - "subs %w3, %w3, #16 \n" -@@ -959,7 +701,7 @@ void DetileToYUY2_NEON(const uint8_t* sr - ptrdiff_t src_uv_tile_stride, - uint8_t* dst_yuy2, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld1 {v0.16b}, [%0], %4 \n" // load 16 Ys - "prfm pldl1keep, [%0, 1792] \n" -@@ -985,7 +727,7 @@ void DetileToYUY2_NEON(const uint8_t* sr - ptrdiff_t src_uv_tile_stride, - uint8_t* dst_yuy2, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld1 {v0.16b}, [%0], %4 \n" // load 16 Ys - "ld1 {v1.16b}, [%1], %5 \n" // load 8 UVs -@@ -1010,39 +752,49 @@ void DetileToYUY2_NEON(const uint8_t* sr - // Unpack MT2T into tiled P010 64 pixels at a time. See - // tinyurl.com/mtk-10bit-video-format for format documentation. - void UnpackMT2T_NEON(const uint8_t* src, uint16_t* dst, size_t size) { -- asm volatile ( -+ const uint8_t* src_lower_bits = src; -+ const uint8_t* src_upper_bits = src + 16; -+ asm volatile( - "1: \n" -- "ld1 {v7.16b}, [%0], #16 \n" -- "ld1 {v0.16b-v3.16b}, [%0], #64 \n" -- "shl v4.16b, v7.16b, #6 \n" -- "shl v5.16b, v7.16b, #4 \n" -- "shl v6.16b, v7.16b, #2 \n" -- "subs %2, %2, #80 \n" -- "zip1 v16.16b, v4.16b, v0.16b \n" -- "zip1 v18.16b, v5.16b, v1.16b \n" -- "zip1 v20.16b, v6.16b, v2.16b \n" -- "zip1 v22.16b, v7.16b, v3.16b \n" -- "zip2 v17.16b, v4.16b, v0.16b \n" -- "zip2 v19.16b, v5.16b, v1.16b \n" -- "zip2 v21.16b, v6.16b, v2.16b \n" -- "zip2 v23.16b, v7.16b, v3.16b \n" -- "sri v16.8h, v16.8h, #10 \n" -- "sri v17.8h, v17.8h, #10 \n" -- "sri v18.8h, v18.8h, #10 \n" -- "sri v19.8h, v19.8h, #10 \n" -- "st1 {v16.8h-v19.8h}, [%1], #64 \n" -- "sri v20.8h, v20.8h, #10 \n" -- "sri v21.8h, v21.8h, #10 \n" -- "sri v22.8h, v22.8h, #10 \n" -- "sri v23.8h, v23.8h, #10 \n" -- "st1 {v20.8h-v23.8h}, [%1], #64 \n" -+ "ld4 {v0.8b, v1.8b, v2.8b, v3.8b}, [%1], #32 \n" -+ "ld1 {v7.8b}, [%0], #8 \n" -+ "shl v6.8b, v7.8b, #2 \n" -+ "shl v5.8b, v7.8b, #4 \n" -+ "shl v4.8b, v7.8b, #6 \n" -+ "zip1 v0.16b, v4.16b, v0.16b \n" -+ "zip1 v1.16b, v5.16b, v1.16b \n" -+ "zip1 v2.16b, v6.16b, v2.16b \n" -+ "zip1 v3.16b, v7.16b, v3.16b \n" -+ "sri v0.8h, v0.8h, #10 \n" -+ "sri v1.8h, v1.8h, #10 \n" -+ "sri v2.8h, v2.8h, #10 \n" -+ "sri v3.8h, v3.8h, #10 \n" -+ "st4 {v0.8h, v1.8h, v2.8h, v3.8h}, [%2], #64 \n" -+ "ld4 {v0.8b, v1.8b, v2.8b, v3.8b}, [%1], #32 \n" -+ "ld1 {v7.8b}, [%0], #8 \n" -+ "shl v6.8b, v7.8b, #2 \n" -+ "shl v5.8b, v7.8b, #4 \n" -+ "shl v4.8b, v7.8b, #6 \n" -+ "zip1 v0.16b, v4.16b, v0.16b \n" -+ "zip1 v1.16b, v5.16b, v1.16b \n" -+ "zip1 v2.16b, v6.16b, v2.16b \n" -+ "zip1 v3.16b, v7.16b, v3.16b \n" -+ "sri v0.8h, v0.8h, #10 \n" -+ "sri v1.8h, v1.8h, #10 \n" -+ "sri v2.8h, v2.8h, #10 \n" -+ "sri v3.8h, v3.8h, #10 \n" -+ "st4 {v0.8h, v1.8h, v2.8h, v3.8h}, [%2], #64 \n" -+ "mov %0, %1 \n" -+ "add %1, %0, #16 \n" -+ "subs %3, %3, #80 \n" - "b.gt 1b \n" -- : "+r"(src), // %0 -- "+r"(dst), // %1 -- "+r"(size) // %2 -+ : "+r"(src_lower_bits), // %0 -+ "+r"(src_upper_bits), // %1 -+ "+r"(dst), // %2 -+ "+r"(size) // %3 - : - : "cc", "memory", "w0", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", -- "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23"); -+ "v8", "v9", "v10", "v11", "v12"); - } - - #if LIBYUV_USE_ST2 -@@ -1051,7 +803,7 @@ void MergeUVRow_NEON(const uint8_t* src_ - const uint8_t* src_v, - uint8_t* dst_uv, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld1 {v0.16b}, [%0], #16 \n" // load U - "ld1 {v1.16b}, [%1], #16 \n" // load V -@@ -1068,6 +820,28 @@ void MergeUVRow_NEON(const uint8_t* src_ - : "cc", "memory", "v0", "v1" // Clobber List - ); - } -+// Reads 16 U's and V's and writes out 16 pairs of UV. -+void MergeUVRow_NEON1(const uint8_t* src_u, -+ const uint8_t* src_v, -+ uint8_t* dst_uv, -+ int width) { -+ asm volatile( -+ "1: \n" -+ "ld1 {v0.16b,v2.16b}, [%0], #32 \n" // load U -+ "ld1 {v1.16b,v3.16b}, [%1], #32 \n" // load V -+ "subs %w3, %w3, #32 \n" // 32 processed per loop -+ "prfm pldl1keep, [%0, 448] \n" -+ "prfm pldl1keep, [%1, 448] \n" -+ "st2 {v0.16b,v1.16b,v2.16b,v3.16b}, [%2], #64 \n" // store 32 UV -+ "b.gt 1b \n" -+ : "+r"(src_u), // %0 -+ "+r"(src_v), // %1 -+ "+r"(dst_uv), // %2 -+ "+r"(width) // %3 // Output registers -+ : // Input registers -+ : "cc", "memory", "v0", "v1" // Clobber List -+ ); -+} - - void MergeUVRow_16_NEON(const uint16_t* src_u, - const uint16_t* src_v, -@@ -1075,7 +849,7 @@ void MergeUVRow_16_NEON(const uint16_t* - int depth, - int width) { - int shift = 16 - depth; -- asm volatile ( -+ asm volatile( - "dup v2.8h, %w4 \n" - "1: \n" - "ld1 {v0.8h}, [%0], #16 \n" // load 8 U -@@ -1100,7 +874,7 @@ void MergeUVRow_NEON(const uint8_t* src_ - const uint8_t* src_v, - uint8_t* dst_uv, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld1 {v0.16b}, [%0], #16 \n" // load U - "ld1 {v1.16b}, [%1], #16 \n" // load V -@@ -1126,7 +900,7 @@ void MergeUVRow_16_NEON(const uint16_t* - int depth, - int width) { - int shift = 16 - depth; -- asm volatile ( -+ asm volatile( - "dup v4.8h, %w4 \n" - "1: \n" - "ld1 {v0.8h}, [%0], #16 \n" // load 8 U -@@ -1155,7 +929,7 @@ void SplitRGBRow_NEON(const uint8_t* src - uint8_t* dst_g, - uint8_t* dst_b, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld3 {v0.16b,v1.16b,v2.16b}, [%0], #48 \n" // load 16 RGB - "subs %w4, %w4, #16 \n" // 16 processed per loop -@@ -1180,7 +954,7 @@ void MergeRGBRow_NEON(const uint8_t* src - const uint8_t* src_b, - uint8_t* dst_rgb, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld1 {v0.16b}, [%0], #16 \n" // load R - "ld1 {v1.16b}, [%1], #16 \n" // load G -@@ -1208,7 +982,7 @@ void SplitARGBRow_NEON(const uint8_t* sr - uint8_t* dst_b, - uint8_t* dst_a, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld4 {v0.16b,v1.16b,v2.16b,v3.16b}, [%0], #64 \n" // load 16 ARGB - "subs %w5, %w5, #16 \n" // 16 processed per loop -@@ -1237,7 +1011,7 @@ void MergeARGBRow_NEON(const uint8_t* sr - const uint8_t* src_a, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld1 {v0.16b}, [%2], #16 \n" // load B - "ld1 {v1.16b}, [%1], #16 \n" // load G -@@ -1268,7 +1042,7 @@ void MergeARGBRow_NEON(const uint8_t* sr - const uint8_t* src_a, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld1 {v0.16b}, [%2], #16 \n" // load B - "ld1 {v1.16b}, [%1], #16 \n" // load G -@@ -1308,7 +1082,7 @@ void SplitXRGBRow_NEON(const uint8_t* sr - uint8_t* dst_g, - uint8_t* dst_b, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld4 {v0.16b,v1.16b,v2.16b,v3.16b}, [%0], #64 \n" // load 16 ARGB - "subs %w4, %w4, #16 \n" // 16 processed per loop -@@ -1333,7 +1107,7 @@ void MergeXRGBRow_NEON(const uint8_t* sr - const uint8_t* src_b, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "movi v3.16b, #255 \n" // load A(255) - "1: \n" - "ld1 {v2.16b}, [%0], #16 \n" // load R -@@ -1362,7 +1136,7 @@ void MergeXR30Row_NEON(const uint16_t* s - int depth, - int width) { - int shift = 10 - depth; -- asm volatile ( -+ asm volatile( - "movi v30.16b, #255 \n" - "ushr v30.4s, v30.4s, #22 \n" // 1023 - "dup v31.4s, %w5 \n" -@@ -1400,34 +1174,32 @@ void MergeXR30Row_10_NEON(const uint16_t - uint8_t* dst_ar30, - int /* depth */, - int width) { -- // Neon has no "shift left and accumulate/orr", so use a multiply-add to -- // perform the shift instead. -- int limit = 1023; -- asm volatile ( -- "dup v5.8h, %w[limit] \n" -- "movi v6.8h, #16 \n" // 1 << 4 -- "movi v7.8h, #4, lsl #8 \n" // 1 << 10 -- "1: \n" -- "ldr q0, [%0], #16 \n" // xxxxxxRrrrrrrrrr -- "ldr q1, [%1], #16 \n" // xxxxxxGggggggggg -- "ldr q2, [%2], #16 \n" // xxxxxxBbbbbbbbbb -- "umin v0.8h, v0.8h, v5.8h \n" // 000000Rrrrrrrrrr -- "umin v1.8h, v1.8h, v5.8h \n" // 000000Gggggggggg -- "movi v4.8h, #0xc0, lsl #8 \n" // 1100000000000000 -- "umin v3.8h, v2.8h, v5.8h \n" // 000000Bbbbbbbbbb -- "mla v4.8h, v0.8h, v6.8h \n" // 11Rrrrrrrrrr0000 -- "mla v3.8h, v1.8h, v7.8h \n" // ggggggBbbbbbbbbb -- "usra v4.8h, v1.8h, #6 \n" // 11RrrrrrrrrrGggg -- "subs %w4, %w4, #8 \n" -- "st2 {v3.8h, v4.8h}, [%3], #32 \n" -- "b.gt 1b \n" -+ asm volatile( -+ "movi v30.16b, #255 \n" -+ "ushr v30.4s, v30.4s, #22 \n" // 1023 -+ "1: \n" -+ "ldr d2, [%2], #8 \n" // B -+ "ldr d1, [%1], #8 \n" // G -+ "ldr d0, [%0], #8 \n" // R -+ "ushll v2.4s, v2.4h, #0 \n" // 000B -+ "ushll v1.4s, v1.4h, #0 \n" // G -+ "ushll v0.4s, v0.4h, #0 \n" // R -+ "umin v2.4s, v2.4s, v30.4s \n" -+ "umin v1.4s, v1.4s, v30.4s \n" -+ "umin v0.4s, v0.4s, v30.4s \n" -+ "sli v2.4s, v1.4s, #10 \n" // 00GB -+ "sli v2.4s, v0.4s, #20 \n" // 0RGB -+ "orr v2.4s, #0xc0, lsl #24 \n" // ARGB (AR30) -+ "subs %w4, %w4, #4 \n" -+ "str q2, [%3], #16 \n" -+ "b.gt 1b \n" - : "+r"(src_r), // %0 - "+r"(src_g), // %1 - "+r"(src_b), // %2 - "+r"(dst_ar30), // %3 - "+r"(width) // %4 -- : [limit] "r"(limit) -- : "memory", "cc", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7"); -+ : -+ : "memory", "cc", "v0", "v1", "v2", "v30"); - } - - void MergeAR64Row_NEON(const uint16_t* src_r, -@@ -1439,7 +1211,7 @@ void MergeAR64Row_NEON(const uint16_t* s - int width) { - int shift = 16 - depth; - int mask = (1 << depth) - 1; -- asm volatile ( -+ asm volatile( - - "dup v30.8h, %w7 \n" - "dup v31.8h, %w6 \n" -@@ -1482,7 +1254,7 @@ void MergeXR64Row_NEON(const uint16_t* s - int width) { - int shift = 16 - depth; - int mask = (1 << depth) - 1; -- asm volatile ( -+ asm volatile( - - "movi v3.16b, #0xff \n" // A (0xffff) - "dup v30.8h, %w6 \n" -@@ -1521,31 +1293,33 @@ void MergeARGB16To8Row_NEON(const uint16 - uint8_t* dst_argb, - int depth, - int width) { -- // Shift is 8 - depth, +8 so the result is in the top half of each lane. -- int shift = 16 - depth; -- asm volatile ( -+ int shift = 8 - depth; -+ asm volatile( -+ - "dup v31.8h, %w6 \n" - "1: \n" -- "ldr q0, [%0], #16 \n" // B -+ "ldr q2, [%0], #16 \n" // R - "ldr q1, [%1], #16 \n" // G -- "ldr q2, [%2], #16 \n" // R -+ "ldr q0, [%2], #16 \n" // B - "ldr q3, [%3], #16 \n" // A -- "uqshl v0.8h, v0.8h, v31.8h \n" -+ "ushl v2.8h, v2.8h, v31.8h \n" - "prfm pldl1keep, [%0, 448] \n" -- "uqshl v1.8h, v1.8h, v31.8h \n" -+ "ushl v1.8h, v1.8h, v31.8h \n" - "prfm pldl1keep, [%1, 448] \n" -- "uqshl v2.8h, v2.8h, v31.8h \n" -+ "ushl v0.8h, v0.8h, v31.8h \n" - "prfm pldl1keep, [%2, 448] \n" -- "uqshl v3.8h, v3.8h, v31.8h \n" -+ "ushl v3.8h, v3.8h, v31.8h \n" - "prfm pldl1keep, [%3, 448] \n" -- "trn2 v0.16b, v0.16b, v1.16b \n" -- "trn2 v1.16b, v2.16b, v3.16b \n" -+ "uqxtn v2.8b, v2.8h \n" -+ "uqxtn v1.8b, v1.8h \n" -+ "uqxtn v0.8b, v0.8h \n" -+ "uqxtn v3.8b, v3.8h \n" - "subs %w5, %w5, #8 \n" -- "st2 {v0.8h, v1.8h}, [%4], #32 \n" -+ "st4 {v0.8b, v1.8b, v2.8b, v3.8b}, [%4], #32 \n" - "b.gt 1b \n" -- : "+r"(src_b), // %0 -+ : "+r"(src_r), // %0 - "+r"(src_g), // %1 -- "+r"(src_r), // %2 -+ "+r"(src_b), // %2 - "+r"(src_a), // %3 - "+r"(dst_argb), // %4 - "+r"(width) // %5 -@@ -1559,29 +1333,30 @@ void MergeXRGB16To8Row_NEON(const uint16 - uint8_t* dst_argb, - int depth, - int width) { -- // Shift is 8 - depth, +8 so the result is in the top half of each lane. -- int shift = 16 - depth; -- asm volatile ( -+ int shift = 8 - depth; -+ asm volatile( -+ - "dup v31.8h, %w5 \n" -- "movi v3.16b, #0xff \n" // A (0xff) -+ "movi v3.8b, #0xff \n" // A (0xff) - "1: \n" -- "ldr q0, [%0], #16 \n" // B -+ "ldr q2, [%0], #16 \n" // R - "ldr q1, [%1], #16 \n" // G -- "ldr q2, [%2], #16 \n" // R -- "uqshl v0.8h, v0.8h, v31.8h \n" -+ "ldr q0, [%2], #16 \n" // B -+ "ushl v2.8h, v2.8h, v31.8h \n" - "prfm pldl1keep, [%0, 448] \n" -- "uqshl v1.8h, v1.8h, v31.8h \n" -+ "ushl v1.8h, v1.8h, v31.8h \n" - "prfm pldl1keep, [%1, 448] \n" -- "uqshl v2.8h, v2.8h, v31.8h \n" -+ "ushl v0.8h, v0.8h, v31.8h \n" - "prfm pldl1keep, [%2, 448] \n" -- "trn2 v0.16b, v0.16b, v1.16b \n" -- "trn2 v1.16b, v2.16b, v3.16b \n" -+ "uqxtn v2.8b, v2.8h \n" -+ "uqxtn v1.8b, v1.8h \n" -+ "uqxtn v0.8b, v0.8h \n" - "subs %w4, %w4, #8 \n" -- "st2 {v0.8h, v1.8h}, [%3], #32 \n" -+ "st4 {v0.8b, v1.8b, v2.8b, v3.8b}, [%3], #32 \n" - "b.gt 1b \n" -- : "+r"(src_b), // %0 -+ : "+r"(src_r), // %0 - "+r"(src_g), // %1 -- "+r"(src_r), // %2 -+ "+r"(src_b), // %2 - "+r"(dst_argb), // %3 - "+r"(width) // %4 - : "r"(shift) // %5 -@@ -1590,7 +1365,7 @@ void MergeXRGB16To8Row_NEON(const uint16 - - // Copy multiple of 32. - void CopyRow_NEON(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ldp q0, q1, [%0], #32 \n" - "prfm pldl1keep, [%0, 448] \n" -@@ -1607,7 +1382,7 @@ void CopyRow_NEON(const uint8_t* src, ui - - // SetRow writes 'width' bytes using an 8 bit value repeated. - void SetRow_NEON(uint8_t* dst, uint8_t v8, int width) { -- asm volatile ( -+ asm volatile( - "dup v0.16b, %w2 \n" // duplicate 16 bytes - "1: \n" - "subs %w1, %w1, #16 \n" // 16 bytes per loop -@@ -1620,7 +1395,7 @@ void SetRow_NEON(uint8_t* dst, uint8_t v - } - - void ARGBSetRow_NEON(uint8_t* dst, uint32_t v32, int width) { -- asm volatile ( -+ asm volatile( - "dup v0.4s, %w2 \n" // duplicate 4 ints - "1: \n" - "subs %w1, %w1, #4 \n" // 4 ints per loop -@@ -1637,7 +1412,7 @@ static const uvec8 kShuffleMirror = {15u - 7u, 6u, 5u, 4u, 3u, 2u, 1u, 0u}; - - void MirrorRow_NEON(const uint8_t* src, uint8_t* dst, int width) { -- asm volatile ( -+ asm volatile( - // Start at end of source row. - "ld1 {v3.16b}, [%3] \n" // shuffler - "add %0, %0, %w2, sxtw \n" -@@ -1662,7 +1437,7 @@ static const uvec8 kShuffleMirrorUV = {1 - 6u, 7u, 4u, 5u, 2u, 3u, 0u, 1u}; - - void MirrorUVRow_NEON(const uint8_t* src_uv, uint8_t* dst_uv, int width) { -- asm volatile ( -+ asm volatile( - // Start at end of source row. - "ld1 {v4.16b}, [%3] \n" // shuffler - "add %0, %0, %w2, sxtw #1 \n" -@@ -1686,7 +1461,7 @@ void MirrorSplitUVRow_NEON(const uint8_t - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - // Start at end of source row. - "ld1 {v4.16b}, [%4] \n" // shuffler - "add %0, %0, %w3, sxtw #1 \n" -@@ -1715,7 +1490,7 @@ static const uvec8 kShuffleMirrorARGB = - 4u, 5u, 6u, 7u, 0u, 1u, 2u, 3u}; - - void ARGBMirrorRow_NEON(const uint8_t* src_argb, uint8_t* dst_argb, int width) { -- asm volatile ( -+ asm volatile( - // Start at end of source row. - "ld1 {v4.16b}, [%3] \n" // shuffler - "add %0, %0, %w2, sxtw #2 \n" -@@ -1738,7 +1513,7 @@ void ARGBMirrorRow_NEON(const uint8_t* s - void RGB24MirrorRow_NEON(const uint8_t* src_rgb24, - uint8_t* dst_rgb24, - int width) { -- asm volatile ( -+ asm volatile( - "ld1 {v3.16b}, [%4] \n" // shuffler - "add %0, %0, %w2, sxtw #1 \n" // Start at end of row. - "add %0, %0, %w2, sxtw \n" -@@ -1763,7 +1538,7 @@ void RGB24MirrorRow_NEON(const uint8_t* - void RGB24ToARGBRow_NEON(const uint8_t* src_rgb24, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "movi v4.8b, #255 \n" // Alpha - "1: \n" - "ld3 {v1.8b,v2.8b,v3.8b}, [%0], #24 \n" // load 8 pixels of -@@ -1781,14 +1556,14 @@ void RGB24ToARGBRow_NEON(const uint8_t* - } - - void RAWToARGBRow_NEON(const uint8_t* src_raw, uint8_t* dst_argb, int width) { -- asm volatile ( -+ asm volatile( - "movi v5.8b, #255 \n" // Alpha - "1: \n" - "ld3 {v0.8b,v1.8b,v2.8b}, [%0], #24 \n" // read r g b - "subs %w2, %w2, #8 \n" // 8 processed per loop. -- "mov v3.8b, v1.8b \n" // move g -+ "orr v3.8b, v1.8b, v1.8b \n" // move g - "prfm pldl1keep, [%0, 448] \n" -- "mov v4.8b, v0.8b \n" // move r -+ "orr v4.8b, v0.8b, v0.8b \n" // move r - "st4 {v2.8b,v3.8b,v4.8b,v5.8b}, [%1], #32 \n" // store b g r a - "b.gt 1b \n" - : "+r"(src_raw), // %0 -@@ -1800,14 +1575,14 @@ void RAWToARGBRow_NEON(const uint8_t* sr - } - - void RAWToRGBARow_NEON(const uint8_t* src_raw, uint8_t* dst_rgba, int width) { -- asm volatile ( -+ asm volatile( - "movi v0.8b, #255 \n" // Alpha - "1: \n" - "ld3 {v3.8b,v4.8b,v5.8b}, [%0], #24 \n" // read r g b - "subs %w2, %w2, #8 \n" // 8 processed per loop. -- "mov v2.8b, v4.8b \n" // move g -+ "orr v2.8b, v4.8b, v4.8b \n" // move g - "prfm pldl1keep, [%0, 448] \n" -- "mov v1.8b, v5.8b \n" // move r -+ "orr v1.8b, v5.8b, v5.8b \n" // move r - "st4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%1], #32 \n" // store a b g r - "b.gt 1b \n" - : "+r"(src_raw), // %0 -@@ -1819,13 +1594,13 @@ void RAWToRGBARow_NEON(const uint8_t* sr - } - - void RAWToRGB24Row_NEON(const uint8_t* src_raw, uint8_t* dst_rgb24, int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld3 {v0.8b,v1.8b,v2.8b}, [%0], #24 \n" // read r g b - "subs %w2, %w2, #8 \n" // 8 processed per loop. -- "mov v3.8b, v1.8b \n" // move g -+ "orr v3.8b, v1.8b, v1.8b \n" // move g - "prfm pldl1keep, [%0, 448] \n" -- "mov v4.8b, v0.8b \n" // move r -+ "orr v4.8b, v0.8b, v0.8b \n" // move r - "st3 {v2.8b,v3.8b,v4.8b}, [%1], #24 \n" // store b g r - "b.gt 1b \n" - : "+r"(src_raw), // %0 -@@ -1836,20 +1611,23 @@ void RAWToRGB24Row_NEON(const uint8_t* s - ); - } - --#define RGB565TOARGB \ -- /* Input: v0.8h: RRRRRGGGGGGBBBBB */ \ -- "shrn v1.8b, v0.8h, #3 \n" /* G GGGGGGxx */ \ -- "shrn v2.8b, v0.8h, #8 \n" /* R RRRRRxxx */ \ -- "xtn v0.8b, v0.8h \n" /* B xxxBBBBB */ \ -- "sri v1.8b, v1.8b, #6 \n" /* G GGGGGGGG, fill 2 */ \ -- "shl v0.8b, v0.8b, #3 \n" /* B BBBBB000 */ \ -- "sri v2.8b, v2.8b, #5 \n" /* R RRRRRRRR, fill 3 */ \ -- "sri v0.8b, v0.8b, #5 \n" /* R BBBBBBBB, fill 3 */ -+#define RGB565TOARGB \ -+ "shrn v6.8b, v0.8h, #5 \n" /* G xxGGGGGG */ \ -+ "shl v6.8b, v6.8b, #2 \n" /* G GGGGGG00 upper 6 */ \ -+ "ushr v4.8b, v6.8b, #6 \n" /* G 000000GG lower 2 */ \ -+ "orr v1.8b, v4.8b, v6.8b \n" /* G */ \ -+ "xtn v2.8b, v0.8h \n" /* B xxxBBBBB */ \ -+ "ushr v0.8h, v0.8h, #11 \n" /* R 000RRRRR */ \ -+ "xtn2 v2.16b,v0.8h \n" /* R in upper part */ \ -+ "shl v2.16b, v2.16b, #3 \n" /* R,B BBBBB000 upper 5 */ \ -+ "ushr v0.16b, v2.16b, #5 \n" /* R,B 00000BBB lower 3 */ \ -+ "orr v0.16b, v0.16b, v2.16b \n" /* R,B */ \ -+ "dup v2.2D, v0.D[1] \n" /* R */ - - void RGB565ToARGBRow_NEON(const uint8_t* src_rgb565, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "movi v3.8b, #255 \n" // Alpha - "1: \n" - "ld1 {v0.16b}, [%0], #16 \n" // load 8 RGB565 pixels. -@@ -1865,34 +1643,48 @@ void RGB565ToARGBRow_NEON(const uint8_t* - ); - } - --#define ARGB1555TOARGB \ -- /* Input: ARRRRRGGGGGBBBBB */ \ -- "xtn v29.8b, v0.8h \n" /* xxxBBBBB */ \ -- "shrn v3.8b, v0.8h, #8 \n" /* Axxxxxxx */ \ -- "shrn v2.8b, v0.8h, #7 \n" /* RRRRRxxx */ \ -- "shrn v1.8b, v0.8h, #2 \n" /* GGGGGxxx */ \ -- "shl v0.8b, v29.8b, #3 \n" /* BBBBB000 */ \ -- "sshr v3.8b, v3.8b, #7 \n" /* AAAAAAAA */ \ -- "sri v2.8b, v2.8b, #5 \n" /* RRRRRRRR */ \ -- "sri v1.8b, v1.8b, #5 \n" /* GGGGGGGG */ \ -- "sri v0.8b, v0.8b, #5 \n" /* BBBBBBBB */ -+#define ARGB1555TOARGB \ -+ "ushr v2.8h, v0.8h, #10 \n" /* R xxxRRRRR */ \ -+ "shl v2.8h, v2.8h, #3 \n" /* R RRRRR000 upper 5 */ \ -+ "xtn v3.8b, v2.8h \n" /* RRRRR000 AAAAAAAA */ \ -+ \ -+ "sshr v2.8h, v0.8h, #15 \n" /* A AAAAAAAA */ \ -+ "xtn2 v3.16b, v2.8h \n" \ -+ \ -+ "xtn v2.8b, v0.8h \n" /* B xxxBBBBB */ \ -+ "shrn2 v2.16b,v0.8h, #5 \n" /* G xxxGGGGG */ \ -+ \ -+ "ushr v1.16b, v3.16b, #5 \n" /* R,A 00000RRR lower 3 */ \ -+ "shl v0.16b, v2.16b, #3 \n" /* B,G BBBBB000 upper 5 */ \ -+ "ushr v2.16b, v0.16b, #5 \n" /* B,G 00000BBB lower 3 */ \ -+ \ -+ "orr v0.16b, v0.16b, v2.16b \n" /* B,G */ \ -+ "orr v2.16b, v1.16b, v3.16b \n" /* R,A */ \ -+ "dup v1.2D, v0.D[1] \n" \ -+ "dup v3.2D, v2.D[1] \n" - - // RGB555TOARGB is same as ARGB1555TOARGB but ignores alpha. --#define RGB555TOARGB \ -- /* Input: xRRRRRGGGGGBBBBB */ \ -- "xtn v29.8b, v0.8h \n" /* xxxBBBBB */ \ -- "shrn v2.8b, v0.8h, #7 \n" /* RRRRRxxx */ \ -- "shrn v1.8b, v0.8h, #2 \n" /* GGGGGxxx */ \ -- "shl v0.8b, v29.8b, #3 \n" /* BBBBB000 */ \ -- \ -- "sri v2.8b, v2.8b, #5 \n" /* RRRRRRRR */ \ -- "sri v1.8b, v1.8b, #5 \n" /* GGGGGGGG */ \ -- "sri v0.8b, v0.8b, #5 \n" /* BBBBBBBB */ -+#define RGB555TOARGB \ -+ "ushr v2.8h, v0.8h, #10 \n" /* R xxxRRRRR */ \ -+ "shl v2.8h, v2.8h, #3 \n" /* R RRRRR000 upper 5 */ \ -+ "xtn v3.8b, v2.8h \n" /* RRRRR000 */ \ -+ \ -+ "xtn v2.8b, v0.8h \n" /* B xxxBBBBB */ \ -+ "shrn2 v2.16b,v0.8h, #5 \n" /* G xxxGGGGG */ \ -+ \ -+ "ushr v1.16b, v3.16b, #5 \n" /* R 00000RRR lower 3 */ \ -+ "shl v0.16b, v2.16b, #3 \n" /* B,G BBBBB000 upper 5 */ \ -+ "ushr v2.16b, v0.16b, #5 \n" /* B,G 00000BBB lower 3 */ \ -+ \ -+ "orr v0.16b, v0.16b, v2.16b \n" /* B,G */ \ -+ "orr v2.16b, v1.16b, v3.16b \n" /* R */ \ -+ "dup v1.2D, v0.D[1] \n" /* G */ - - void ARGB1555ToARGBRow_NEON(const uint8_t* src_argb1555, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( -+ "movi v3.8b, #255 \n" // Alpha - "1: \n" - "ld1 {v0.16b}, [%0], #16 \n" // load 8 ARGB1555 pixels. - "prfm pldl1keep, [%0, 448] \n" -@@ -1904,34 +1696,33 @@ void ARGB1555ToARGBRow_NEON(const uint8_ - "+r"(dst_argb), // %1 - "+r"(width) // %2 - : -- : "cc", "memory", "v0", "v1", "v2", "v3", "v29" // Clobber List -+ : "cc", "memory", "v0", "v1", "v2", "v3" // Clobber List - ); - } - --#define ARGB4444TOARGB \ -- /* Input: v1.8h = AAAARRRR_GGGGBBBB */ \ -- "shl v0.16b, v1.16b, #4 \n" /* RRRR0000_BBBB0000 */ \ -- "sri v1.16b, v1.16b, #4 \n" /* AAAAAAAA_GGGGGGGG */ \ -- "sri v0.16b, v0.16b, #4 \n" /* RRRRRRRR_BBBBBBBB */ -- --#define ARGB4444TORGB \ -- /* Input: v0.8h = xxxxRRRRGGGGBBBB */ \ -- "xtn v1.8b, v0.8h \n" /* GGGGBBBB */ \ -- "shrn v2.8b, v0.8h, #4 \n" /* RRRRxxxx */ \ -- "shl v0.8b, v1.8b, #4 \n" /* BBBB0000 */ \ -- "sri v1.8b, v1.8b, #4 \n" /* GGGGGGGG */ \ -- "sri v2.8b, v2.8b, #4 \n" /* RRRRRRRR */ \ -- "sri v0.8b, v0.8b, #4 \n" /* BBBBBBBB */ -+// Convert v0.8h to b = v0.8b g = v1.8b r = v2.8b -+// clobbers v3 -+#define ARGB4444TOARGB \ -+ "shrn v1.8b, v0.8h, #8 \n" /* v1(l) AR */ \ -+ "xtn2 v1.16b, v0.8h \n" /* v1(h) GB */ \ -+ "shl v2.16b, v1.16b, #4 \n" /* B,R BBBB0000 */ \ -+ "ushr v3.16b, v1.16b, #4 \n" /* G,A 0000GGGG */ \ -+ "ushr v0.16b, v2.16b, #4 \n" /* B,R 0000BBBB */ \ -+ "shl v1.16b, v3.16b, #4 \n" /* G,A GGGG0000 */ \ -+ "orr v2.16b, v0.16b, v2.16b \n" /* B,R BBBBBBBB */ \ -+ "orr v3.16b, v1.16b, v3.16b \n" /* G,A GGGGGGGG */ \ -+ "dup v0.2D, v2.D[1] \n" \ -+ "dup v1.2D, v3.D[1] \n" - - void ARGB4444ToARGBRow_NEON(const uint8_t* src_argb4444, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" -- "ld1 {v1.16b}, [%0], #16 \n" // load 8 ARGB4444 pixels. -+ "ld1 {v0.16b}, [%0], #16 \n" // load 8 ARGB4444 pixels. - "subs %w2, %w2, #8 \n" // 8 processed per loop. - "prfm pldl1keep, [%0, 448] \n" ARGB4444TOARGB -- "st2 {v0.16b, v1.16b}, [%1], #32 \n" // store 8 ARGB. -+ "st4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%1], #32 \n" // store 8 ARGB - "b.gt 1b \n" - : "+r"(src_argb4444), // %0 - "+r"(dst_argb), // %1 -@@ -1941,63 +1732,10 @@ void ARGB4444ToARGBRow_NEON(const uint8_ - ); - } - --static const int16_t kAR30Row_BoxShifts[] = {0, -6, 0, -6, 0, -6, 0, -6}; -- --static const uint8_t kABGRToAR30Row_BoxIndices[] = { -- 2, 2, 1, 1, 6, 6, 5, 5, 10, 10, 9, 9, 14, 14, 13, 13, -- 0, 0, 3, 3, 4, 4, 7, 7, 8, 8, 11, 11, 12, 12, 15, 15}; --static const uint8_t kARGBToAR30Row_BoxIndices[] = { -- 0, 0, 1, 1, 4, 4, 5, 5, 8, 8, 9, 9, 12, 12, 13, 13, -- 2, 2, 3, 3, 6, 6, 7, 7, 10, 10, 11, 11, 14, 14, 15, 15}; -- --// ARGB or ABGR as input, reordering based on TBL indices parameter. --static void ABCDToAR30Row_NEON(const uint8_t* src_abcd, -- uint8_t* dst_ar30, -- int width, -- const uint8_t* indices) { -- asm volatile ( -- "movi v2.4s, #0xf, msl 16 \n" // 0xfffff -- "ldr q3, [%[kAR30Row_BoxShifts]] \n" -- "ldp q4, q5, [%[indices]] \n" -- "1: \n" -- "ldp q0, q20, [%[src]], #32 \n" -- "subs %w[width], %w[width], #8 \n" -- "tbl v1.16b, {v0.16b}, v5.16b \n" -- "tbl v21.16b, {v20.16b}, v5.16b \n" -- "tbl v0.16b, {v0.16b}, v4.16b \n" -- "tbl v20.16b, {v20.16b}, v4.16b \n" -- "ushl v0.8h, v0.8h, v3.8h \n" -- "ushl v20.8h, v20.8h, v3.8h \n" -- "ushl v1.8h, v1.8h, v3.8h \n" -- "ushl v21.8h, v21.8h, v3.8h \n" -- "ushr v0.4s, v0.4s, #6 \n" -- "ushr v20.4s, v20.4s, #6 \n" -- "shl v1.4s, v1.4s, #14 \n" -- "shl v21.4s, v21.4s, #14 \n" -- "bif v0.16b, v1.16b, v2.16b \n" -- "bif v20.16b, v21.16b, v2.16b \n" -- "stp q0, q20, [%[dst]], #32 \n" -- "b.gt 1b \n" -- : [src] "+r"(src_abcd), // %[src] -- [dst] "+r"(dst_ar30), // %[dst] -- [width] "+r"(width) // %[width] -- : [kAR30Row_BoxShifts] "r"(kAR30Row_BoxShifts), // %[kAR30Row_BoxShifts] -- [indices] "r"(indices) // %[indices] -- : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v20", "v21"); --} -- --void ABGRToAR30Row_NEON(const uint8_t* src_abgr, uint8_t* dst_ar30, int width) { -- ABCDToAR30Row_NEON(src_abgr, dst_ar30, width, kABGRToAR30Row_BoxIndices); --} -- --void ARGBToAR30Row_NEON(const uint8_t* src_argb, uint8_t* dst_ar30, int width) { -- ABCDToAR30Row_NEON(src_argb, dst_ar30, width, kARGBToAR30Row_BoxIndices); --} -- - void ARGBToRGB24Row_NEON(const uint8_t* src_argb, - uint8_t* dst_rgb24, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld4 {v0.16b,v1.16b,v2.16b,v3.16b}, [%0], #64 \n" // load 16 ARGB - "subs %w2, %w2, #16 \n" // 16 pixels per loop. -@@ -2013,13 +1751,13 @@ void ARGBToRGB24Row_NEON(const uint8_t* - } - - void ARGBToRAWRow_NEON(const uint8_t* src_argb, uint8_t* dst_raw, int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld4 {v1.8b,v2.8b,v3.8b,v4.8b}, [%0], #32 \n" // load b g r a - "subs %w2, %w2, #8 \n" // 8 processed per loop. -- "mov v4.8b, v2.8b \n" // mov g -+ "orr v4.8b, v2.8b, v2.8b \n" // mov g - "prfm pldl1keep, [%0, 448] \n" -- "mov v5.8b, v1.8b \n" // mov b -+ "orr v5.8b, v1.8b, v1.8b \n" // mov b - "st3 {v3.8b,v4.8b,v5.8b}, [%1], #24 \n" // store r g b - "b.gt 1b \n" - : "+r"(src_argb), // %0 -@@ -2031,7 +1769,7 @@ void ARGBToRAWRow_NEON(const uint8_t* sr - } - - void YUY2ToYRow_NEON(const uint8_t* src_yuy2, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld2 {v0.16b,v1.16b}, [%0], #32 \n" // load 16 pixels of YUY2. - "subs %w2, %w2, #16 \n" // 16 processed per loop. -@@ -2047,7 +1785,7 @@ void YUY2ToYRow_NEON(const uint8_t* src_ - } - - void UYVYToYRow_NEON(const uint8_t* src_uyvy, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld2 {v0.16b,v1.16b}, [%0], #32 \n" // load 16 pixels of UYVY. - "subs %w2, %w2, #16 \n" // 16 processed per loop. -@@ -2066,7 +1804,7 @@ void YUY2ToUV422Row_NEON(const uint8_t* - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // load 16 YUY2 - "subs %w3, %w3, #16 \n" // 16 pixels = 8 UVs. -@@ -2087,7 +1825,7 @@ void UYVYToUV422Row_NEON(const uint8_t* - uint8_t* dst_u, - uint8_t* dst_v, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // load 16 UYVY - "subs %w3, %w3, #16 \n" // 16 pixels = 8 UVs. -@@ -2110,7 +1848,7 @@ void YUY2ToUVRow_NEON(const uint8_t* src - uint8_t* dst_v, - int width) { - const uint8_t* src_yuy2b = src_yuy2 + stride_yuy2; -- asm volatile ( -+ asm volatile( - "1: \n" - "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // load 16 pixels - "subs %w4, %w4, #16 \n" // 16 pixels = 8 UVs. -@@ -2138,7 +1876,7 @@ void UYVYToUVRow_NEON(const uint8_t* src - uint8_t* dst_v, - int width) { - const uint8_t* src_uyvyb = src_uyvy + stride_uyvy; -- asm volatile ( -+ asm volatile( - "1: \n" - "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // load 16 pixels - "subs %w4, %w4, #16 \n" // 16 pixels = 8 UVs. -@@ -2165,7 +1903,7 @@ void YUY2ToNVUVRow_NEON(const uint8_t* s - uint8_t* dst_uv, - int width) { - const uint8_t* src_yuy2b = src_yuy2 + stride_yuy2; -- asm volatile ( -+ asm volatile( - "1: \n" - "ld2 {v0.16b,v1.16b}, [%0], #32 \n" // load 16 pixels - "subs %w3, %w3, #16 \n" // 16 pixels = 8 UVs. -@@ -2188,7 +1926,7 @@ void ARGBShuffleRow_NEON(const uint8_t* - uint8_t* dst_argb, - const uint8_t* shuffler, - int width) { -- asm volatile ( -+ asm volatile( - "ld1 {v2.16b}, [%3] \n" // shuffler - "1: \n" - "ld1 {v0.16b}, [%0], #16 \n" // load 4 pixels. -@@ -2210,11 +1948,11 @@ void I422ToYUY2Row_NEON(const uint8_t* s - const uint8_t* src_v, - uint8_t* dst_yuy2, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld2 {v0.8b, v1.8b}, [%0], #16 \n" // load 16 Ys - "subs %w4, %w4, #16 \n" // 16 pixels -- "mov v2.8b, v1.8b \n" -+ "orr v2.8b, v1.8b, v1.8b \n" - "prfm pldl1keep, [%0, 448] \n" - "ld1 {v1.8b}, [%1], #8 \n" // load 8 Us - "ld1 {v3.8b}, [%2], #8 \n" // load 8 Vs -@@ -2234,10 +1972,10 @@ void I422ToUYVYRow_NEON(const uint8_t* s - const uint8_t* src_v, - uint8_t* dst_uyvy, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld2 {v1.8b,v2.8b}, [%0], #16 \n" // load 16 Ys -- "mov v3.8b, v2.8b \n" -+ "orr v3.8b, v2.8b, v2.8b \n" - "prfm pldl1keep, [%0, 448] \n" - "ld1 {v0.8b}, [%1], #8 \n" // load 8 Us - "ld1 {v2.8b}, [%2], #8 \n" // load 8 Vs -@@ -2256,7 +1994,7 @@ void I422ToUYVYRow_NEON(const uint8_t* s - void ARGBToRGB565Row_NEON(const uint8_t* src_argb, - uint8_t* dst_rgb565, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%0], #32 \n" // load 8 - // pixels -@@ -2273,30 +2011,31 @@ void ARGBToRGB565Row_NEON(const uint8_t* - - void ARGBToRGB565DitherRow_NEON(const uint8_t* src_argb, - uint8_t* dst_rgb, -- uint32_t dither4, -+ const uint32_t dither4, - int width) { -- asm volatile ( -- "dup v1.4s, %w3 \n" // dither4 -+ asm volatile( -+ "dup v1.4s, %w2 \n" // dither4 - "1: \n" -- "ld4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%0], #32 \n" // load 8 ARGB -- "subs %w2, %w2, #8 \n" // 8 processed per loop. -+ "ld4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%1], #32 \n" // load 8 -+ // pixels -+ "subs %w3, %w3, #8 \n" // 8 processed per loop. - "uqadd v16.8b, v16.8b, v1.8b \n" - "prfm pldl1keep, [%0, 448] \n" - "uqadd v17.8b, v17.8b, v1.8b \n" - "uqadd v18.8b, v18.8b, v1.8b \n" ARGBTORGB565 -- "st1 {v18.16b}, [%1], #16 \n" // store 8 pixels RGB565. -+ "st1 {v18.16b}, [%0], #16 \n" // store 8 pixels RGB565. - "b.gt 1b \n" -- : "+r"(src_argb), // %0 -- "+r"(dst_rgb), // %1 -- "+r"(width) // %2 -- : "r"(dither4) // %3 -+ : "+r"(dst_rgb) // %0 -+ : "r"(src_argb), // %1 -+ "r"(dither4), // %2 -+ "r"(width) // %3 - : "cc", "memory", "v1", "v16", "v17", "v18", "v19"); - } - - void ARGBToARGB1555Row_NEON(const uint8_t* src_argb, - uint8_t* dst_argb1555, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%0], #32 \n" // load 8 - // pixels -@@ -2314,7 +2053,9 @@ void ARGBToARGB1555Row_NEON(const uint8_ - void ARGBToARGB4444Row_NEON(const uint8_t* src_argb, - uint8_t* dst_argb4444, - int width) { -- asm volatile ( -+ asm volatile( -+ "movi v23.16b, #0x0f \n" // bits to clear with -+ // vbic. - "1: \n" - "ld4 {v16.8b,v17.8b,v18.8b,v19.8b}, [%0], #32 \n" // load 8 - // pixels -@@ -2326,14 +2067,14 @@ void ARGBToARGB4444Row_NEON(const uint8_ - "+r"(dst_argb4444), // %1 - "+r"(width) // %2 - : -- : "cc", "memory", "v0", "v1", "v16", "v17", "v18", "v19"); -+ : "cc", "memory", "v0", "v1", "v16", "v17", "v18", "v19", "v23"); - } - - #if LIBYUV_USE_ST2 - void ARGBToAR64Row_NEON(const uint8_t* src_argb, - uint16_t* dst_ar64, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ldp q0, q2, [%0], #32 \n" // load 8 pixels - "mov v1.16b, v0.16b \n" -@@ -2356,7 +2097,7 @@ static const uvec8 kShuffleARGBToABGR = - void ARGBToAB64Row_NEON(const uint8_t* src_argb, - uint16_t* dst_ab64, - int width) { -- asm volatile ( -+ asm volatile( - "ldr q4, [%3] \n" // shuffler - "1: \n" - "ldp q0, q2, [%0], #32 \n" // load 8 pixels -@@ -2379,7 +2120,7 @@ void ARGBToAB64Row_NEON(const uint8_t* s - void ARGBToAR64Row_NEON(const uint8_t* src_argb, - uint16_t* dst_ar64, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ldp q0, q1, [%0], #32 \n" // load 8 ARGB pixels - "subs %w2, %w2, #8 \n" // 8 processed per loop. -@@ -2404,7 +2145,7 @@ static const uvec8 kShuffleARGBToAB64[2] - void ARGBToAB64Row_NEON(const uint8_t* src_argb, - uint16_t* dst_ab64, - int width) { -- asm volatile ( -+ asm volatile( - "ldp q6, q7, [%3] \n" // 2 shufflers - "1: \n" - "ldp q0, q1, [%0], #32 \n" // load 8 pixels -@@ -2430,7 +2171,7 @@ static const uvec8 kShuffleAR64ToARGB = - void AR64ToARGBRow_NEON(const uint16_t* src_ar64, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "ldr q4, [%3] \n" // shuffler - "1: \n" - "ldp q0, q1, [%0], #32 \n" // load 4 pixels -@@ -2454,7 +2195,7 @@ static const uvec8 kShuffleAB64ToARGB = - void AB64ToARGBRow_NEON(const uint16_t* src_ab64, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "ldr q4, [%3] \n" // shuffler - "1: \n" - "ldp q0, q1, [%0], #32 \n" // load 4 pixels -@@ -2475,7 +2216,7 @@ void AB64ToARGBRow_NEON(const uint16_t* - void ARGBExtractAlphaRow_NEON(const uint8_t* src_argb, - uint8_t* dst_a, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld4 {v0.16b,v1.16b,v2.16b,v3.16b}, [%0], #64 \n" // load 16 - "prfm pldl1keep, [%0, 448] \n" -@@ -2490,26 +2231,19 @@ void ARGBExtractAlphaRow_NEON(const uint - ); - } - --struct RgbUVConstants { -- uint8_t kRGBToU[4]; -- uint8_t kRGBToV[4]; --}; -- - // 8x1 pixels. --void ARGBToUV444MatrixRow_NEON(const uint8_t* src_argb, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width, -- const struct RgbUVConstants* rgbuvconstants) { -- asm volatile ( -- "ldr d0, [%4] \n" // load rgbuvconstants -- "dup v24.16b, v0.b[0] \n" // UB 0.875 coefficient -- "dup v25.16b, v0.b[1] \n" // UG -0.5781 coefficient -- "dup v26.16b, v0.b[2] \n" // UR -0.2969 coefficient -- "dup v27.16b, v0.b[4] \n" // VB -0.1406 coefficient -- "dup v28.16b, v0.b[5] \n" // VG -0.7344 coefficient -- "movi v29.16b, #0x80 \n" // 128.5 -- -+void ARGBToUV444Row_NEON(const uint8_t* src_argb, -+ uint8_t* dst_u, -+ uint8_t* dst_v, -+ int width) { -+ asm volatile( -+ "movi v24.8b, #112 \n" // UB / VR 0.875 -+ // coefficient -+ "movi v25.8b, #74 \n" // UG -0.5781 coefficient -+ "movi v26.8b, #38 \n" // UR -0.2969 coefficient -+ "movi v27.8b, #18 \n" // VB -0.1406 coefficient -+ "movi v28.8b, #94 \n" // VG -0.7344 coefficient -+ "movi v29.16b,#0x80 \n" // 128.5 - "1: \n" - "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // load 8 ARGB - "subs %w3, %w3, #8 \n" // 8 processed per loop. -@@ -2528,34 +2262,15 @@ void ARGBToUV444MatrixRow_NEON(const uin - "st1 {v0.8b}, [%1], #8 \n" // store 8 pixels U. - "st1 {v1.8b}, [%2], #8 \n" // store 8 pixels V. - "b.gt 1b \n" -- : "+r"(src_argb), // %0 -- "+r"(dst_u), // %1 -- "+r"(dst_v), // %2 -- "+r"(width) // %3 -- : "r"(rgbuvconstants) // %4 -+ : "+r"(src_argb), // %0 -+ "+r"(dst_u), // %1 -+ "+r"(dst_v), // %2 -+ "+r"(width) // %3 -+ : - : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v24", "v25", "v26", - "v27", "v28", "v29"); - } - --// RGB to bt601 coefficients --// UB 0.875 coefficient = 112 --// UG -0.5781 coefficient = 74 --// UR -0.2969 coefficient = 38 --// VB -0.1406 coefficient = 18 --// VG -0.7344 coefficient = 94 --// VR 0.875 coefficient = 112 (ignored) -- --static const struct RgbUVConstants kRgb24I601UVConstants = {{112, 74, 38, 0}, -- {18, 94, 112, 0}}; -- --void ARGBToUV444Row_NEON(const uint8_t* src_argb, -- uint8_t* dst_u, -- uint8_t* dst_v, -- int width) { -- ARGBToUV444MatrixRow_NEON(src_argb, dst_u, dst_v, width, -- &kRgb24I601UVConstants); --} -- - #define RGBTOUV_SETUP_REG \ - "movi v20.8h, #56, lsl #0 \n" /* UB/VR coefficient (0.875) / 2 */ \ - "movi v21.8h, #37, lsl #0 \n" /* UG coefficient (-0.5781) / 2 */ \ -@@ -3009,7 +2724,7 @@ void RGB565ToUVRow_NEON(const uint8_t* s - uint8_t* dst_v, - int width) { - const uint8_t* src_rgb565_1 = src_rgb565 + src_stride_rgb565; -- asm volatile ( -+ asm volatile( - RGBTOUV_SETUP_REG - "1: \n" - "ld1 {v0.16b}, [%0], #16 \n" // load 8 RGB565 pixels. -@@ -3067,7 +2782,7 @@ void ARGB1555ToUVRow_NEON(const uint8_t* - uint8_t* dst_v, - int width) { - const uint8_t* src_argb1555_1 = src_argb1555 + src_stride_argb1555; -- asm volatile ( -+ asm volatile( - RGBTOUV_SETUP_REG - "1: \n" - "ld1 {v0.16b}, [%0], #16 \n" // load 8 ARGB1555 pixels. -@@ -3115,7 +2830,7 @@ void ARGB1555ToUVRow_NEON(const uint8_t* - : - : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v16", "v17", - "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", "v26", "v27", -- "v28", "v29"); -+ "v28"); - } - - // 16x2 pixels -> 8x1. width is number of argb pixels. e.g. 16. -@@ -3125,29 +2840,29 @@ void ARGB4444ToUVRow_NEON(const uint8_t* - uint8_t* dst_v, - int width) { - const uint8_t* src_argb4444_1 = src_argb4444 + src_stride_argb4444; -- asm volatile ( -+ asm volatile( - RGBTOUV_SETUP_REG // sets v20-v25 - "1: \n" - "ld1 {v0.16b}, [%0], #16 \n" // load 8 ARGB4444 pixels. -- ARGB4444TORGB -+ ARGB4444TOARGB - "uaddlp v16.4h, v0.8b \n" // B 8 bytes -> 4 shorts. - "prfm pldl1keep, [%0, 448] \n" - "uaddlp v17.4h, v1.8b \n" // G 8 bytes -> 4 shorts. - "uaddlp v18.4h, v2.8b \n" // R 8 bytes -> 4 shorts. - "ld1 {v0.16b}, [%0], #16 \n" // next 8 ARGB4444 pixels. -- ARGB4444TORGB -+ ARGB4444TOARGB - "uaddlp v26.4h, v0.8b \n" // B 8 bytes -> 4 shorts. - "uaddlp v27.4h, v1.8b \n" // G 8 bytes -> 4 shorts. - "uaddlp v28.4h, v2.8b \n" // R 8 bytes -> 4 shorts. - - "ld1 {v0.16b}, [%1], #16 \n" // load 8 ARGB4444 pixels. -- ARGB4444TORGB -+ ARGB4444TOARGB - "uadalp v16.4h, v0.8b \n" // B 8 bytes -> 4 shorts. - "prfm pldl1keep, [%1, 448] \n" - "uadalp v17.4h, v1.8b \n" // G 8 bytes -> 4 shorts. - "uadalp v18.4h, v2.8b \n" // R 8 bytes -> 4 shorts. - "ld1 {v0.16b}, [%1], #16 \n" // next 8 ARGB4444 pixels. -- ARGB4444TORGB -+ ARGB4444TOARGB - "uadalp v26.4h, v0.8b \n" // B 8 bytes -> 4 shorts. - "uadalp v27.4h, v1.8b \n" // G 8 bytes -> 4 shorts. - "uadalp v28.4h, v2.8b \n" // R 8 bytes -> 4 shorts. -@@ -3179,7 +2894,7 @@ void ARGB4444ToUVRow_NEON(const uint8_t* - } - - void RGB565ToYRow_NEON(const uint8_t* src_rgb565, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "movi v24.8b, #25 \n" // B * 0.1016 coefficient - "movi v25.8b, #129 \n" // G * 0.5078 coefficient - "movi v26.8b, #66 \n" // R * 0.2578 coefficient -@@ -3207,7 +2922,7 @@ void RGB565ToYRow_NEON(const uint8_t* sr - void ARGB1555ToYRow_NEON(const uint8_t* src_argb1555, - uint8_t* dst_y, - int width) { -- asm volatile ( -+ asm volatile( - "movi v4.8b, #25 \n" // B * 0.1016 coefficient - "movi v5.8b, #129 \n" // G * 0.5078 coefficient - "movi v6.8b, #66 \n" // R * 0.2578 coefficient -@@ -3215,7 +2930,7 @@ void ARGB1555ToYRow_NEON(const uint8_t* - "1: \n" - "ld1 {v0.16b}, [%0], #16 \n" // load 8 ARGB1555 pixels. - "subs %w2, %w2, #8 \n" // 8 processed per loop. -- RGB555TOARGB -+ ARGB1555TOARGB - "umull v3.8h, v0.8b, v4.8b \n" // B - "prfm pldl1keep, [%0, 448] \n" - "umlal v3.8h, v1.8b, v5.8b \n" // G -@@ -3228,13 +2943,13 @@ void ARGB1555ToYRow_NEON(const uint8_t* - "+r"(dst_y), // %1 - "+r"(width) // %2 - : -- : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v29"); -+ : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7"); - } - - void ARGB4444ToYRow_NEON(const uint8_t* src_argb4444, - uint8_t* dst_y, - int width) { -- asm volatile ( -+ asm volatile( - "movi v24.8b, #25 \n" // B * 0.1016 coefficient - "movi v25.8b, #129 \n" // G * 0.5078 coefficient - "movi v26.8b, #66 \n" // R * 0.2578 coefficient -@@ -3242,7 +2957,7 @@ void ARGB4444ToYRow_NEON(const uint8_t* - "1: \n" - "ld1 {v0.16b}, [%0], #16 \n" // load 8 ARGB4444 pixels. - "subs %w2, %w2, #8 \n" // 8 processed per loop. -- ARGB4444TORGB -+ ARGB4444TOARGB - "umull v3.8h, v0.8b, v24.8b \n" // B - "prfm pldl1keep, [%0, 448] \n" - "umlal v3.8h, v1.8b, v25.8b \n" // G -@@ -3261,14 +2976,40 @@ void ARGB4444ToYRow_NEON(const uint8_t* - struct RgbConstants { - uint8_t kRGBToY[4]; - uint16_t kAddY; -+ uint16_t pad; - }; - -+// RGB to JPeg coefficients -+// B * 0.1140 coefficient = 29 -+// G * 0.5870 coefficient = 150 -+// R * 0.2990 coefficient = 77 -+// Add 0.5 = 0x80 -+static const struct RgbConstants kRgb24JPEGConstants = {{29, 150, 77, 0}, -+ 128, -+ 0}; -+ -+static const struct RgbConstants kRawJPEGConstants = {{77, 150, 29, 0}, 128, 0}; -+ -+// RGB to BT.601 coefficients -+// B * 0.1016 coefficient = 25 -+// G * 0.5078 coefficient = 129 -+// R * 0.2578 coefficient = 66 -+// Add 16.5 = 0x1080 -+ -+static const struct RgbConstants kRgb24I601Constants = {{25, 129, 66, 0}, -+ 0x1080, -+ 0}; -+ -+static const struct RgbConstants kRawI601Constants = {{66, 129, 25, 0}, -+ 0x1080, -+ 0}; -+ - // ARGB expects first 3 values to contain RGB and 4th value is ignored. - void ARGBToYMatrixRow_NEON(const uint8_t* src_argb, - uint8_t* dst_y, - int width, - const struct RgbConstants* rgbconstants) { -- asm volatile ( -+ asm volatile( - "ldr d0, [%3] \n" // load rgbconstants - "dup v6.16b, v0.b[0] \n" - "dup v7.16b, v0.b[1] \n" -@@ -3297,67 +3038,6 @@ void ARGBToYMatrixRow_NEON(const uint8_t - "v17"); - } - --void --ARGBToYMatrixRow_NEON_DotProd(const uint8_t* src_argb, -- uint8_t* dst_y, -- int width, -- const struct RgbConstants* rgbconstants) { -- asm volatile ( -- "ldr d0, [%3] \n" // load rgbconstants -- "dup v16.4s, v0.s[0] \n" -- "dup v17.8h, v0.h[2] \n" -- "1: \n" -- "ld1 {v4.16b, v5.16b, v6.16b, v7.16b}, [%0], #64 \n" // load 16 -- // pixels. -- "subs %w2, %w2, #16 \n" // 16 processed per loop. -- "movi v0.16b, #0 \n" -- "movi v1.16b, #0 \n" -- "movi v2.16b, #0 \n" -- "movi v3.16b, #0 \n" -- "udot v0.4s, v4.16b, v16.16b \n" -- "udot v1.4s, v5.16b, v16.16b \n" -- "udot v2.4s, v6.16b, v16.16b \n" -- "udot v3.4s, v7.16b, v16.16b \n" -- "uzp1 v0.8h, v0.8h, v1.8h \n" -- "uzp1 v1.8h, v2.8h, v3.8h \n" -- "addhn v0.8b, v0.8h, v17.8h \n" -- "addhn v1.8b, v1.8h, v17.8h \n" -- "st1 {v0.8b, v1.8b}, [%1], #16 \n" // store 16 pixels Y. -- "b.gt 1b \n" -- : "+r"(src_argb), // %0 -- "+r"(dst_y), // %1 -- "+r"(width) // %2 -- : "r"(rgbconstants) // %3 -- : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", -- "v17"); --} -- --// RGB to JPeg coefficients --// B * 0.1140 coefficient = 29 --// G * 0.5870 coefficient = 150 --// R * 0.2990 coefficient = 77 --// Add 0.5 = 0x80 --static const struct RgbConstants kRgb24JPEGConstants = {{29, 150, 77, 0}, 128}; --static const struct RgbConstants kRgb24JPEGDotProdConstants = {{0, 29, 150, 77}, -- 128}; -- --static const struct RgbConstants kRawJPEGConstants = {{77, 150, 29, 0}, 128}; -- --// RGB to BT.601 coefficients --// B * 0.1016 coefficient = 25 --// G * 0.5078 coefficient = 129 --// R * 0.2578 coefficient = 66 --// Add 16.5 = 0x1080 -- --static const struct RgbConstants kRgb24I601Constants = {{25, 129, 66, 0}, -- 0x1080}; --static const struct RgbConstants kRgb24I601DotProdConstants = {{0, 25, 129, 66}, -- 0x1080}; -- --static const struct RgbConstants kRawI601Constants = {{66, 129, 25, 0}, 0x1080}; --static const struct RgbConstants kRawI601DotProdConstants = {{0, 66, 129, 25}, -- 0x1080}; -- - void ARGBToYRow_NEON(const uint8_t* src_argb, uint8_t* dst_y, int width) { - ARGBToYMatrixRow_NEON(src_argb, dst_y, width, &kRgb24I601Constants); - } -@@ -3374,37 +3054,13 @@ void ABGRToYJRow_NEON(const uint8_t* src - ARGBToYMatrixRow_NEON(src_abgr, dst_yj, width, &kRawJPEGConstants); - } - --void ARGBToYRow_NEON_DotProd(const uint8_t* src_argb, -- uint8_t* dst_y, -- int width) { -- ARGBToYMatrixRow_NEON_DotProd(src_argb, dst_y, width, &kRgb24I601Constants); --} -- --void ARGBToYJRow_NEON_DotProd(const uint8_t* src_argb, -- uint8_t* dst_yj, -- int width) { -- ARGBToYMatrixRow_NEON_DotProd(src_argb, dst_yj, width, &kRgb24JPEGConstants); --} -- --void ABGRToYRow_NEON_DotProd(const uint8_t* src_abgr, -- uint8_t* dst_y, -- int width) { -- ARGBToYMatrixRow_NEON_DotProd(src_abgr, dst_y, width, &kRawI601Constants); --} -- --void ABGRToYJRow_NEON_DotProd(const uint8_t* src_abgr, -- uint8_t* dst_yj, -- int width) { -- ARGBToYMatrixRow_NEON_DotProd(src_abgr, dst_yj, width, &kRawJPEGConstants); --} -- - // RGBA expects first value to be A and ignored, then 3 values to contain RGB. - // Same code as ARGB, except the LD4 - void RGBAToYMatrixRow_NEON(const uint8_t* src_rgba, - uint8_t* dst_y, - int width, - const struct RgbConstants* rgbconstants) { -- asm volatile ( -+ asm volatile( - "ldr d0, [%3] \n" // load rgbconstants - "dup v6.16b, v0.b[0] \n" - "dup v7.16b, v0.b[1] \n" -@@ -3445,38 +3101,11 @@ void BGRAToYRow_NEON(const uint8_t* src_ - RGBAToYMatrixRow_NEON(src_bgra, dst_y, width, &kRawI601Constants); - } - --void RGBAToYRow_NEON_DotProd(const uint8_t* src_rgba, -- uint8_t* dst_y, -- int width) { -- // No need for a separate implementation for RGBA inputs, just permute the -- // RGB constants. -- ARGBToYMatrixRow_NEON_DotProd(src_rgba, dst_y, width, -- &kRgb24I601DotProdConstants); --} -- --void RGBAToYJRow_NEON_DotProd(const uint8_t* src_rgba, -- uint8_t* dst_yj, -- int width) { -- // No need for a separate implementation for RGBA inputs, just permute the -- // RGB constants. -- ARGBToYMatrixRow_NEON_DotProd(src_rgba, dst_yj, width, -- &kRgb24JPEGDotProdConstants); --} -- --void BGRAToYRow_NEON_DotProd(const uint8_t* src_bgra, -- uint8_t* dst_y, -- int width) { -- // No need for a separate implementation for RGBA inputs, just permute the -- // RGB constants. -- ARGBToYMatrixRow_NEON_DotProd(src_bgra, dst_y, width, -- &kRawI601DotProdConstants); --} -- - void RGBToYMatrixRow_NEON(const uint8_t* src_rgb, - uint8_t* dst_y, - int width, - const struct RgbConstants* rgbconstants) { -- asm volatile ( -+ asm volatile( - "ldr d0, [%3] \n" // load rgbconstants - "dup v5.16b, v0.b[0] \n" - "dup v6.16b, v0.b[1] \n" -@@ -3528,7 +3157,7 @@ void InterpolateRow_NEON(uint8_t* dst_pt - int y1_fraction = source_y_fraction; - int y0_fraction = 256 - y1_fraction; - const uint8_t* src_ptr1 = src_ptr + src_stride; -- asm volatile ( -+ asm volatile( - "cmp %w4, #0 \n" - "b.eq 100f \n" - "cmp %w4, #128 \n" -@@ -3594,7 +3223,7 @@ void InterpolateRow_16_NEON(uint16_t* ds - int y0_fraction = 256 - y1_fraction; - const uint16_t* src_ptr1 = src_ptr + src_stride; - -- asm volatile ( -+ asm volatile( - "cmp %w4, #0 \n" - "b.eq 100f \n" - "cmp %w4, #128 \n" -@@ -3666,7 +3295,7 @@ void InterpolateRow_16To8_NEON(uint8_t* - const uint16_t* src_ptr1 = src_ptr + src_stride; - int shift = 15 - __builtin_clz((int32_t)scale); // Negative shl is shr - -- asm volatile ( -+ asm volatile( - "dup v6.8h, %w6 \n" - "cmp %w4, #0 \n" - "b.eq 100f \n" -@@ -3734,7 +3363,7 @@ void ARGBBlendRow_NEON(const uint8_t* sr - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "subs %w3, %w3, #8 \n" - "b.lt 89f \n" - // Blend 8 pixels. -@@ -3805,9 +3434,7 @@ void ARGBBlendRow_NEON(const uint8_t* sr - void ARGBAttenuateRow_NEON(const uint8_t* src_argb, - uint8_t* dst_argb, - int width) { -- asm volatile ( -- "movi v7.8h, #0x00ff \n" // 255 for rounding up -- -+ asm volatile( - // Attenuate 8 pixels. - "1: \n" - "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // load 8 ARGB -@@ -3816,16 +3443,16 @@ void ARGBAttenuateRow_NEON(const uint8_t - "prfm pldl1keep, [%0, 448] \n" - "umull v5.8h, v1.8b, v3.8b \n" // g * a - "umull v6.8h, v2.8b, v3.8b \n" // r * a -- "addhn v0.8b, v4.8h, v7.8h \n" // (b + 255) >> 8 -- "addhn v1.8b, v5.8h, v7.8h \n" // (g + 255) >> 8 -- "addhn v2.8b, v6.8h, v7.8h \n" // (r + 255) >> 8 -+ "uqrshrn v0.8b, v4.8h, #8 \n" // b >>= 8 -+ "uqrshrn v1.8b, v5.8h, #8 \n" // g >>= 8 -+ "uqrshrn v2.8b, v6.8h, #8 \n" // r >>= 8 - "st4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%1], #32 \n" // store 8 ARGB - "b.gt 1b \n" - : "+r"(src_argb), // %0 - "+r"(dst_argb), // %1 - "+r"(width) // %2 - : -- : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7"); -+ : "cc", "memory", "v0", "v1", "v2", "v3", "v4", "v5", "v6"); - } - - // Quantize 8 ARGB pixels (32 bytes). -@@ -3835,7 +3462,7 @@ void ARGBQuantizeRow_NEON(uint8_t* dst_a - int interval_size, - int interval_offset, - int width) { -- asm volatile ( -+ asm volatile( - "dup v4.8h, %w2 \n" - "ushr v4.8h, v4.8h, #1 \n" // scale >>= 1 - "dup v5.8h, %w3 \n" // interval multiply. -@@ -3872,36 +3499,36 @@ void ARGBQuantizeRow_NEON(uint8_t* dst_a - } - - // Shade 8 pixels at a time by specified value. --// sqrdmulh is a rounding instruction, so +1 if high bit of low half of --// multiply result is set. -+// NOTE vqrdmulh.s16 q10, q10, d0[0] must use a scaler register from 0 to 8. -+// Rounding in vqrdmulh does +1 to high if high bit of low s16 is set. - void ARGBShadeRow_NEON(const uint8_t* src_argb, - uint8_t* dst_argb, - int width, - uint32_t value) { -- asm volatile ( -- "dup v0.4s, %w3 \n" // duplicate scale value. -- "zip1 v0.16b, v0.16b, v0.16b \n" // v0.16b aarrggbbaarrggbb. -- "ushr v0.8h, v0.8h, #1 \n" // scale / 2. -+ asm volatile( -+ "dup v0.4s, %w3 \n" // duplicate scale value. -+ "zip1 v0.8b, v0.8b, v0.8b \n" // v0.8b aarrggbb. -+ "ushr v0.8h, v0.8h, #1 \n" // scale / 2. - - // 8 pixel loop. -- "1: \n" -- "ld1 {v4.8b,v5.8b,v6.8b,v7.8b}, [%0], #32 \n" // load 8 ARGB -- "subs %w2, %w2, #8 \n" // 8 processed per loop. -- "uxtl v4.8h, v4.8b \n" -- "prfm pldl1keep, [%0, 448] \n" -- "uxtl v5.8h, v5.8b \n" -- "uxtl v6.8h, v6.8b \n" -- "uxtl v7.8h, v7.8b \n" -- "sqrdmulh v4.8h, v4.8h, v0.8h \n" // argb * scale * 2 -- "sqrdmulh v5.8h, v5.8h, v0.8h \n" -- "sqrdmulh v6.8h, v6.8h, v0.8h \n" -- "sqrdmulh v7.8h, v7.8h, v0.8h \n" -- "uqxtn v4.8b, v4.8h \n" -- "uqxtn v5.8b, v5.8h \n" -- "uqxtn v6.8b, v6.8h \n" -- "uqxtn v7.8b, v7.8h \n" -- "st1 {v4.8b,v5.8b,v6.8b,v7.8b}, [%1], #32 \n" // store 8 ARGB -- "b.gt 1b \n" -+ "1: \n" -+ "ld4 {v4.8b,v5.8b,v6.8b,v7.8b}, [%0], #32 \n" // load 8 ARGB -+ "subs %w2, %w2, #8 \n" // 8 processed per loop. -+ "uxtl v4.8h, v4.8b \n" // b (0 .. 255) -+ "prfm pldl1keep, [%0, 448] \n" -+ "uxtl v5.8h, v5.8b \n" -+ "uxtl v6.8h, v6.8b \n" -+ "uxtl v7.8h, v7.8b \n" -+ "sqrdmulh v4.8h, v4.8h, v0.h[0] \n" // b * scale * 2 -+ "sqrdmulh v5.8h, v5.8h, v0.h[1] \n" // g -+ "sqrdmulh v6.8h, v6.8h, v0.h[2] \n" // r -+ "sqrdmulh v7.8h, v7.8h, v0.h[3] \n" // a -+ "uqxtn v4.8b, v4.8h \n" -+ "uqxtn v5.8b, v5.8h \n" -+ "uqxtn v6.8b, v6.8h \n" -+ "uqxtn v7.8b, v7.8h \n" -+ "st4 {v4.8b,v5.8b,v6.8b,v7.8b}, [%1], #32 \n" // store 8 ARGB -+ "b.gt 1b \n" - : "+r"(src_argb), // %0 - "+r"(dst_argb), // %1 - "+r"(width) // %2 -@@ -3913,7 +3540,7 @@ void ARGBShadeRow_NEON(const uint8_t* sr - // Similar to ARGBToYJ but stores ARGB. - // C code is (29 * b + 150 * g + 77 * r + 128) >> 8; - void ARGBGrayRow_NEON(const uint8_t* src_argb, uint8_t* dst_argb, int width) { -- asm volatile ( -+ asm volatile( - "movi v24.8b, #29 \n" // B * 0.1140 coefficient - "movi v25.8b, #150 \n" // G * 0.5870 coefficient - "movi v26.8b, #77 \n" // R * 0.2990 coefficient -@@ -3925,8 +3552,8 @@ void ARGBGrayRow_NEON(const uint8_t* src - "umlal v4.8h, v1.8b, v25.8b \n" // G - "umlal v4.8h, v2.8b, v26.8b \n" // R - "uqrshrn v0.8b, v4.8h, #8 \n" // 16 bit to 8 bit B -- "mov v1.8b, v0.8b \n" // G -- "mov v2.8b, v0.8b \n" // R -+ "orr v1.8b, v0.8b, v0.8b \n" // G -+ "orr v2.8b, v0.8b, v0.8b \n" // R - "st4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%1], #32 \n" // store 8 pixels. - "b.gt 1b \n" - : "+r"(src_argb), // %0 -@@ -3942,7 +3569,7 @@ void ARGBGrayRow_NEON(const uint8_t* src - // r = (r * 50 + g * 98 + b * 24) >> 7 - - void ARGBSepiaRow_NEON(uint8_t* dst_argb, int width) { -- asm volatile ( -+ asm volatile( - "movi v20.8b, #17 \n" // BB coefficient - "movi v21.8b, #68 \n" // BG coefficient - "movi v22.8b, #35 \n" // BR coefficient -@@ -3984,7 +3611,7 @@ void ARGBColorMatrixRow_NEON(const uint8 - uint8_t* dst_argb, - const int8_t* matrix_argb, - int width) { -- asm volatile ( -+ asm volatile( - "ld1 {v2.16b}, [%3] \n" // load 3 ARGB vectors. - "sxtl v0.8h, v2.8b \n" // B,G coefficients s16. - "sxtl2 v1.8h, v2.16b \n" // R,A coefficients s16. -@@ -4039,72 +3666,17 @@ void ARGBColorMatrixRow_NEON(const uint8 - "v17", "v18", "v19", "v22", "v23", "v24", "v25"); - } - --void ARGBColorMatrixRow_NEON_I8MM(const uint8_t* src_argb, -- uint8_t* dst_argb, -- const int8_t* matrix_argb, -- int width) { -- asm("ld1 {v31.16b}, [%[matrix_argb]] \n" -- -- "1: \n" -- "ld1 {v0.16b, v1.16b}, [%[src_argb]], #32 \n" -- -- "movi v16.4s, #0 \n" -- "movi v17.4s, #0 \n" -- "movi v18.4s, #0 \n" -- "movi v19.4s, #0 \n" -- "movi v20.4s, #0 \n" -- "movi v21.4s, #0 \n" -- "movi v22.4s, #0 \n" -- "movi v23.4s, #0 \n" -- -- // 8 processed per loop. -- "subs %w2, %w2, #8 \n" -- "prfm pldl1keep, [%[src_argb], 448] \n" -- -- "sudot v16.4s, v31.16b, v0.4b[0] \n" -- "sudot v17.4s, v31.16b, v0.4b[1] \n" -- "sudot v18.4s, v31.16b, v0.4b[2] \n" -- "sudot v19.4s, v31.16b, v0.4b[3] \n" -- "sudot v20.4s, v31.16b, v1.4b[0] \n" -- "sudot v21.4s, v31.16b, v1.4b[1] \n" -- "sudot v22.4s, v31.16b, v1.4b[2] \n" -- "sudot v23.4s, v31.16b, v1.4b[3] \n" -- -- "shrn v16.4h, v16.4s, #6 \n" -- "shrn v18.4h, v18.4s, #6 \n" -- "shrn v20.4h, v20.4s, #6 \n" -- "shrn v22.4h, v22.4s, #6 \n" -- "shrn2 v16.8h, v17.4s, #6 \n" -- "shrn2 v18.8h, v19.4s, #6 \n" -- "shrn2 v20.8h, v21.4s, #6 \n" -- "shrn2 v22.8h, v23.4s, #6 \n" -- -- "uqxtn v16.8b, v16.8h \n" -- "uqxtn v18.8b, v18.8h \n" -- "uqxtn v20.8b, v20.8h \n" -- "uqxtn v22.8b, v22.8h \n" -- -- "stp d16, d18, [%[dst_argb]], #16 \n" -- "stp d20, d22, [%[dst_argb]], #16 \n" -- "b.gt 1b \n" -- : [src_argb] "+r"(src_argb), // %[src_argb] -- [dst_argb] "+r"(dst_argb), // %[dst_argb] -- [width] "+r"(width) // %[width] -- : [matrix_argb] "r"(matrix_argb) // %[matrix_argb] -- : "cc", "memory", "v0", "v1", "v16", "v17", "v18", "v19", "v20", "v21", -- "v22", "v23", "v31"); --} -- -+// TODO(fbarchard): fix vqshrun in ARGBMultiplyRow_NEON and reenable. - // Multiply 2 rows of ARGB pixels together, 8 pixels at a time. - void ARGBMultiplyRow_NEON(const uint8_t* src_argb, - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - // 8 pixel loop. - "1: \n" -- "ld1 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // load 8 ARGB -- "ld1 {v4.8b,v5.8b,v6.8b,v7.8b}, [%1], #32 \n" // load 8 more -+ "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // load 8 ARGB -+ "ld4 {v4.8b,v5.8b,v6.8b,v7.8b}, [%1], #32 \n" // load 8 more - "subs %w3, %w3, #8 \n" // 8 processed per loop. - "umull v0.8h, v0.8b, v4.8b \n" // multiply B - "prfm pldl1keep, [%0, 448] \n" -@@ -4116,7 +3688,7 @@ void ARGBMultiplyRow_NEON(const uint8_t* - "rshrn v1.8b, v1.8h, #8 \n" // 16 bit to 8 bit G - "rshrn v2.8b, v2.8h, #8 \n" // 16 bit to 8 bit R - "rshrn v3.8b, v3.8h, #8 \n" // 16 bit to 8 bit A -- "st1 {v0.8b,v1.8b,v2.8b,v3.8b}, [%2], #32 \n" // store 8 ARGB -+ "st4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%2], #32 \n" // store 8 ARGB - "b.gt 1b \n" - : "+r"(src_argb), // %0 - "+r"(src_argb1), // %1 -@@ -4131,17 +3703,19 @@ void ARGBAddRow_NEON(const uint8_t* src_ - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - // 8 pixel loop. - "1: \n" -- "ldp q0, q1, [%0], #32 \n" // load 8 ARGB -- "ldp q4, q5, [%1], #32 \n" // load 8 more -+ "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // load 8 ARGB -+ "ld4 {v4.8b,v5.8b,v6.8b,v7.8b}, [%1], #32 \n" // load 8 more - "subs %w3, %w3, #8 \n" // 8 processed per loop. -+ "uqadd v0.8b, v0.8b, v4.8b \n" - "prfm pldl1keep, [%0, 448] \n" -+ "uqadd v1.8b, v1.8b, v5.8b \n" - "prfm pldl1keep, [%1, 448] \n" -- "uqadd v0.16b, v0.16b, v4.16b \n" -- "uqadd v1.16b, v1.16b, v5.16b \n" -- "stp q0, q1, [%2], #32 \n" // store 8 ARGB -+ "uqadd v2.8b, v2.8b, v6.8b \n" -+ "uqadd v3.8b, v3.8b, v7.8b \n" -+ "st4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%2], #32 \n" // store 8 ARGB - "b.gt 1b \n" - : "+r"(src_argb), // %0 - "+r"(src_argb1), // %1 -@@ -4156,17 +3730,19 @@ void ARGBSubtractRow_NEON(const uint8_t* - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - // 8 pixel loop. - "1: \n" -- "ldp q0, q1, [%0], #32 \n" // load 8 ARGB -- "ldp q4, q5, [%1], #32 \n" // load 8 more -+ "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // load 8 ARGB -+ "ld4 {v4.8b,v5.8b,v6.8b,v7.8b}, [%1], #32 \n" // load 8 more - "subs %w3, %w3, #8 \n" // 8 processed per loop. -+ "uqsub v0.8b, v0.8b, v4.8b \n" - "prfm pldl1keep, [%0, 448] \n" -+ "uqsub v1.8b, v1.8b, v5.8b \n" - "prfm pldl1keep, [%1, 448] \n" -- "uqsub v0.16b, v0.16b, v4.16b \n" -- "uqsub v1.16b, v1.16b, v5.16b \n" -- "stp q0, q1, [%2], #32 \n" // store 8 ARGB -+ "uqsub v2.8b, v2.8b, v6.8b \n" -+ "uqsub v3.8b, v3.8b, v7.8b \n" -+ "st4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%2], #32 \n" // store 8 ARGB - "b.gt 1b \n" - : "+r"(src_argb), // %0 - "+r"(src_argb1), // %1 -@@ -4185,7 +3761,7 @@ void SobelRow_NEON(const uint8_t* src_so - const uint8_t* src_sobely, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "movi v3.8b, #255 \n" // alpha - // 8 pixel loop. - "1: \n" -@@ -4194,9 +3770,9 @@ void SobelRow_NEON(const uint8_t* src_so - "subs %w3, %w3, #8 \n" // 8 processed per loop. - "uqadd v0.8b, v0.8b, v1.8b \n" // add - "prfm pldl1keep, [%0, 448] \n" -- "mov v1.8b, v0.8b \n" -+ "orr v1.8b, v0.8b, v0.8b \n" - "prfm pldl1keep, [%1, 448] \n" -- "mov v2.8b, v0.8b \n" -+ "orr v2.8b, v0.8b, v0.8b \n" - "st4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%2], #32 \n" // store 8 ARGB - "b.gt 1b \n" - : "+r"(src_sobelx), // %0 -@@ -4212,7 +3788,7 @@ void SobelToPlaneRow_NEON(const uint8_t* - const uint8_t* src_sobely, - uint8_t* dst_y, - int width) { -- asm volatile ( -+ asm volatile( - // 16 pixel loop. - "1: \n" - "ld1 {v0.16b}, [%0], #16 \n" // load 16 sobelx. -@@ -4240,7 +3816,7 @@ void SobelXYRow_NEON(const uint8_t* src_ - const uint8_t* src_sobely, - uint8_t* dst_argb, - int width) { -- asm volatile ( -+ asm volatile( - "movi v3.8b, #255 \n" // alpha - // 8 pixel loop. - "1: \n" -@@ -4269,7 +3845,7 @@ void SobelXRow_NEON(const uint8_t* src_y - const uint8_t* src_y2, - uint8_t* dst_sobelx, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld1 {v0.8b}, [%0],%5 \n" // top - "ld1 {v1.8b}, [%0],%6 \n" -@@ -4310,7 +3886,7 @@ void SobelYRow_NEON(const uint8_t* src_y - const uint8_t* src_y1, - uint8_t* dst_sobely, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld1 {v0.8b}, [%0],%4 \n" // left - "ld1 {v1.8b}, [%1],%4 \n" -@@ -4346,7 +3922,7 @@ void HalfFloat1Row_NEON(const uint16_t* - uint16_t* dst, - float /*unused*/, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld1 {v1.16b}, [%0], #16 \n" // load 8 shorts - "subs %w2, %w2, #8 \n" // 8 pixels per loop -@@ -4370,7 +3946,7 @@ void HalfFloatRow_NEON(const uint16_t* s - uint16_t* dst, - float scale, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld1 {v1.16b}, [%0], #16 \n" // load 8 shorts - "subs %w2, %w2, #8 \n" // 8 pixels per loop -@@ -4396,7 +3972,7 @@ void ByteToFloatRow_NEON(const uint8_t* - float* dst, - float scale, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld1 {v1.8b}, [%0], #8 \n" // load 8 bytes - "subs %w2, %w2, #8 \n" // 8 pixels per loop -@@ -4417,92 +3993,12 @@ void ByteToFloatRow_NEON(const uint8_t* - : "cc", "memory", "v1", "v2", "v3"); - } - --// Convert FP16 Half Floats to FP32 Floats --void ConvertFP16ToFP32Row_NEON(const uint16_t* src, // fp16 -- float* dst, -- int width) { -- asm volatile ( -- "1: \n" -- "ld1 {v1.8h}, [%0], #16 \n" // load 8 halffloats -- "subs %w2, %w2, #8 \n" // 8 floats per loop -- "prfm pldl1keep, [%0, 448] \n" -- "fcvtl v2.4s, v1.4h \n" // 8 floats -- "fcvtl2 v3.4s, v1.8h \n" -- "stp q2, q3, [%1], #32 \n" // store 8 floats -- "b.gt 1b \n" -- : "+r"(src), // %0 -- "+r"(dst), // %1 -- "+r"(width) // %2 -- : -- : "cc", "memory", "v1", "v2", "v3"); --} -- --// Convert FP16 Half Floats to FP32 Floats --// Read a column and write a row --void ConvertFP16ToFP32Column_NEON(const uint16_t* src, // fp16 -- int src_stride, // stride in elements -- float* dst, -- int width) { -- asm volatile ( -- "cmp %w2, #8 \n" // Is there 8 rows? -- "b.lo 2f \n" -- "1: \n" -- "ld1 {v0.h}[0], [%0], %3 \n" // load 8 halffloats -- "ld1 {v0.h}[1], [%0], %3 \n" -- "ld1 {v0.h}[2], [%0], %3 \n" -- "ld1 {v0.h}[3], [%0], %3 \n" -- "ld1 {v1.h}[0], [%0], %3 \n" -- "ld1 {v1.h}[1], [%0], %3 \n" -- "ld1 {v1.h}[2], [%0], %3 \n" -- "ld1 {v1.h}[3], [%0], %3 \n" -- "subs %w2, %w2, #8 \n" // 8 rows per loop -- "prfm pldl1keep, [%0, 448] \n" -- "fcvtl v2.4s, v0.4h \n" // 4 floats -- "fcvtl v3.4s, v1.4h \n" // 4 more floats -- "stp q2, q3, [%1], #32 \n" // store 8 floats -- "b.gt 1b \n" -- "cmp %w2, #1 \n" // Is there 1 value? -- "b.lo 3f \n" -- "2: \n" -- "ld1 {v1.h}[0], [%0], %3 \n" // load 1 halffloats -- "subs %w2, %w2, #1 \n" // 1 floats per loop -- "fcvtl v2.4s, v1.4h \n" // 1 floats -- "str s2, [%1], #4 \n" // store 1 floats -- "b.gt 2b \n" -- "3: \n" -- : "+r"(src), // %0 -- "+r"(dst), // %1 -- "+r"(width) // %2 -- : "r"((ptrdiff_t)(src_stride * 2)) // %3 -- : "cc", "memory", "v0", "v1", "v2", "v3"); --} -- --// Convert FP32 Floats to FP16 Half Floats --void ConvertFP32ToFP16Row_NEON(const float* src, -- uint16_t* dst, // fp16 -- int width) { -- asm volatile ( -- "1: \n" -- "ldp q2, q3, [%0], #32 \n" // load 8 floats -- "subs %w2, %w2, #8 \n" // 8 floats per loop -- "prfm pldl1keep, [%0, 448] \n" -- "fcvtn v1.4h, v2.4s \n" // 8 fp16 halffloats -- "fcvtn2 v1.8h, v3.4s \n" -- "str q1, [%1], #16 \n" // store 8 fp16 halffloats -- "b.gt 1b \n" -- : "+r"(src), // %0 -- "+r"(dst), // %1 -- "+r"(width) // %2 -- : -- : "cc", "memory", "v1", "v2", "v3"); --} -- - float ScaleMaxSamples_NEON(const float* src, - float* dst, - float scale, - int width) { - float fmax; -- asm volatile ( -+ asm volatile( - "movi v5.4s, #0 \n" // max - "movi v6.4s, #0 \n" - -@@ -4532,7 +4028,7 @@ float ScaleSumSamples_NEON(const float* - float scale, - int width) { - float fsum; -- asm volatile ( -+ asm volatile( - "movi v5.4s, #0 \n" // max - "movi v6.4s, #0 \n" // max - -@@ -4559,7 +4055,7 @@ float ScaleSumSamples_NEON(const float* - } - - void ScaleSamples_NEON(const float* src, float* dst, float scale, int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld1 {v1.4s, v2.4s}, [%0], #32 \n" // load 8 samples - "prfm pldl1keep, [%0, 448] \n" -@@ -4583,7 +4079,7 @@ void GaussCol_NEON(const uint16_t* src0, - const uint16_t* src4, - uint32_t* dst, - int width) { -- asm volatile ( -+ asm volatile( - "movi v6.8h, #4 \n" // constant 4 - "movi v7.8h, #6 \n" // constant 6 - -@@ -4625,7 +4121,7 @@ void GaussRow_NEON(const uint32_t* src, - const uint32_t* src1 = src + 1; - const uint32_t* src2 = src + 2; - const uint32_t* src3 = src + 3; -- asm volatile ( -+ asm volatile( - "movi v6.4s, #4 \n" // constant 4 - "movi v7.4s, #6 \n" // constant 6 - -@@ -4668,7 +4164,7 @@ void GaussCol_F32_NEON(const float* src0 - const float* src4, - float* dst, - int width) { -- asm volatile ( -+ asm volatile( - "ld2r {v6.4s, v7.4s}, [%7] \n" // constants 4 and 6 - - "1: \n" -@@ -4706,7 +4202,7 @@ void GaussCol_F32_NEON(const float* src0 - - // filter 5 rows with 1, 4, 6, 4, 1 coefficients to produce 1 row. - void GaussRow_F32_NEON(const float* src, float* dst, int width) { -- asm volatile ( -+ asm volatile( - "ld3r {v6.4s, v7.4s, v8.4s}, [%3] \n" // constants 4, 6, 1/256 - - "1: \n" -@@ -4745,7 +4241,7 @@ void NV21ToYUV24Row_NEON(const uint8_t* - const uint8_t* src_vu, - uint8_t* dst_yuv24, - int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld1 {v2.16b}, [%0], #16 \n" // load 16 Y values - "ld2 {v0.8b, v1.8b}, [%1], #16 \n" // load 8 VU values -@@ -4776,7 +4272,7 @@ void NV21ToYUV24Row_NEON(const uint8_t* - const uint8_t* src_vu, - uint8_t* dst_yuv24, - int width) { -- asm volatile ( -+ asm volatile( - "ld1 {v5.16b,v6.16b,v7.16b}, [%4] \n" // 3 shuffler constants - "1: \n" - "ld1 {v0.16b}, [%0], #16 \n" // load 16 Y values -@@ -4806,7 +4302,7 @@ void AYUVToUVRow_NEON(const uint8_t* src - uint8_t* dst_uv, - int width) { - const uint8_t* src_ayuv_1 = src_ayuv + src_stride_ayuv; -- asm volatile ( -+ asm volatile( - - "1: \n" - "ld4 {v0.16b,v1.16b,v2.16b,v3.16b}, [%0], #64 \n" // load 16 ayuv -@@ -4835,7 +4331,7 @@ void AYUVToVURow_NEON(const uint8_t* src - uint8_t* dst_vu, - int width) { - const uint8_t* src_ayuv_1 = src_ayuv + src_stride_ayuv; -- asm volatile ( -+ asm volatile( - - "1: \n" - "ld4 {v0.16b,v1.16b,v2.16b,v3.16b}, [%0], #64 \n" // load 16 ayuv -@@ -4861,7 +4357,7 @@ void AYUVToVURow_NEON(const uint8_t* src - - // Copy row of AYUV Y's into Y - void AYUVToYRow_NEON(const uint8_t* src_ayuv, uint8_t* dst_y, int width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld4 {v0.16b,v1.16b,v2.16b,v3.16b}, [%0], #64 \n" // load 16 - "subs %w2, %w2, #16 \n" // 16 pixels per loop -@@ -4875,23 +4371,28 @@ void AYUVToYRow_NEON(const uint8_t* src_ - : "cc", "memory", "v0", "v1", "v2", "v3"); - } - -+// Shuffle table for swapping UV bytes. -+static const uvec8 kShuffleSwapUV = {1u, 0u, 3u, 2u, 5u, 4u, 7u, 6u, -+ 9u, 8u, 11u, 10u, 13u, 12u, 15u, 14u}; -+ - // Convert UV plane of NV12 to VU of NV21. - void SwapUVRow_NEON(const uint8_t* src_uv, uint8_t* dst_vu, int width) { -- asm volatile ( -+ asm volatile( -+ "ld1 {v2.16b}, [%3] \n" // shuffler - "1: \n" - "ld1 {v0.16b}, [%0], 16 \n" // load 16 UV values - "ld1 {v1.16b}, [%0], 16 \n" - "subs %w2, %w2, #16 \n" // 16 pixels per loop -- "rev16 v0.16b, v0.16b \n" -+ "tbl v0.16b, {v0.16b}, v2.16b \n" - "prfm pldl1keep, [%0, 448] \n" -- "rev16 v1.16b, v1.16b \n" -+ "tbl v1.16b, {v1.16b}, v2.16b \n" - "stp q0, q1, [%1], 32 \n" // store 16 VU pixels - "b.gt 1b \n" -- : "+r"(src_uv), // %0 -- "+r"(dst_vu), // %1 -- "+r"(width) // %2 -- : -- : "cc", "memory", "v0", "v1"); -+ : "+r"(src_uv), // %0 -+ "+r"(dst_vu), // %1 -+ "+r"(width) // %2 -+ : "r"(&kShuffleSwapUV) // %3 -+ : "cc", "memory", "v0", "v1", "v2"); - } - - void HalfMergeUVRow_NEON(const uint8_t* src_u, -@@ -4902,7 +4403,7 @@ void HalfMergeUVRow_NEON(const uint8_t* - int width) { - const uint8_t* src_u_1 = src_u + src_stride_u; - const uint8_t* src_v_1 = src_v + src_stride_v; -- asm volatile ( -+ asm volatile( - "1: \n" - "ld1 {v0.16b}, [%0], #16 \n" // load 16 U values - "ld1 {v1.16b}, [%2], #16 \n" // load 16 V values -@@ -4937,7 +4438,7 @@ void SplitUVRow_16_NEON(const uint16_t* - int depth, - int width) { - int shift = depth - 16; // Negative for right shift. -- asm volatile ( -+ asm volatile( - "dup v2.8h, %w4 \n" - "1: \n" - "ld2 {v0.8h, v1.8h}, [%0], #32 \n" // load 8 UV -@@ -4960,7 +4461,7 @@ void MultiplyRow_16_NEON(const uint16_t* - uint16_t* dst_y, - int scale, - int width) { -- asm volatile ( -+ asm volatile( - "dup v2.8h, %w3 \n" - "1: \n" - "ldp q0, q1, [%0], #32 \n" -@@ -4981,7 +4482,7 @@ void DivideRow_16_NEON(const uint16_t* s - uint16_t* dst_y, - int scale, - int width) { -- asm volatile ( -+ asm volatile( - "dup v4.8h, %w3 \n" - "1: \n" - "ldp q2, q3, [%0], #32 \n" -@@ -4990,8 +4491,10 @@ void DivideRow_16_NEON(const uint16_t* s - "umull v2.4s, v3.4h, v4.4h \n" - "umull2 v3.4s, v3.8h, v4.8h \n" - "prfm pldl1keep, [%0, 448] \n" -- "uzp2 v0.8h, v0.8h, v1.8h \n" -- "uzp2 v1.8h, v2.8h, v3.8h \n" -+ "shrn v0.4h, v0.4s, #16 \n" -+ "shrn2 v0.8h, v1.4s, #16 \n" -+ "shrn v1.4h, v2.4s, #16 \n" -+ "shrn2 v1.8h, v3.4s, #16 \n" - "stp q0, q1, [%1], #32 \n" // store 16 pixels - "subs %w2, %w2, #16 \n" // 16 src pixels per loop - "b.gt 1b \n" -@@ -5011,18 +4514,16 @@ void Convert16To8Row_NEON(const uint16_t - uint8_t* dst_y, - int scale, - int width) { -- // 15 - clz(scale), + 8 to shift result into the high half of the lane to -- // saturate, then we can just use UZP2 to narrow rather than a pair of -- // saturating narrow instructions. -- int shift = 23 - __builtin_clz((int32_t)scale); -- asm volatile ( -+ int shift = 15 - __builtin_clz((int32_t)scale); // Negative shl is shr -+ asm volatile( - "dup v2.8h, %w3 \n" - "1: \n" - "ldp q0, q1, [%0], #32 \n" -- "uqshl v0.8h, v0.8h, v2.8h \n" -- "uqshl v1.8h, v1.8h, v2.8h \n" -+ "ushl v0.8h, v0.8h, v2.8h \n" // shr = v2 is negative -+ "ushl v1.8h, v1.8h, v2.8h \n" - "prfm pldl1keep, [%0, 448] \n" -- "uzp2 v0.16b, v0.16b, v1.16b \n" -+ "uqxtn v0.8b, v0.8h \n" -+ "uqxtn2 v0.16b, v1.8h \n" - "subs %w2, %w2, #16 \n" // 16 src pixels per loop - "str q0, [%1], #16 \n" // store 16 pixels - "b.gt 1b \n" -diff --git a/media/libyuv/libyuv/source/row_win.cc b/media/libyuv/libyuv/source/row_win.cc ---- a/media/libyuv/libyuv/source/row_win.cc -+++ b/media/libyuv/libyuv/source/row_win.cc -@@ -14,9 +14,7 @@ - #if !defined(LIBYUV_DISABLE_X86) && defined(_MSC_VER) && \ - !defined(__clang__) && (defined(_M_IX86) || defined(_M_X64)) - --#if defined(_M_ARM64EC) --#include --#elif defined(_M_X64) -+#if defined(_M_X64) - #include - #include // For _mm_maddubs_epi16 - #endif -@@ -895,7 +893,7 @@ static const lvec8 kShuffleNV21 = { - - __declspec(naked) void ARGBToRGB565DitherRow_SSE2(const uint8_t* src_argb, - uint8_t* dst_rgb, -- uint32_t dither4, -+ const uint32_t dither4, - int width) { - __asm { - -@@ -942,7 +940,7 @@ static const lvec8 kShuffleNV21 = { - #ifdef HAS_ARGBTORGB565DITHERROW_AVX2 - __declspec(naked) void ARGBToRGB565DitherRow_AVX2(const uint8_t* src_argb, - uint8_t* dst_rgb, -- uint32_t dither4, -+ const uint32_t dither4, - int width) { - __asm { - mov eax, [esp + 4] // src_argb -@@ -3463,14 +3461,17 @@ static const ulvec32 kARGBShuffleMirror_ - sub edx, eax - - convertloop: -- vpmovzxbw ymm0, [eax] -- vpmovzxbw ymm1, [eax + edx] -- lea eax, [eax + 16] -- vpsllw ymm1, ymm1, 8 -- vpor ymm2, ymm1, ymm0 -- vmovdqu [edi], ymm2 -- lea edi, [edi + 32] -- sub ecx, 16 -+ vmovdqu ymm0, [eax] // read 32 U's -+ vmovdqu ymm1, [eax + edx] // and 32 V's -+ lea eax, [eax + 32] -+ vpunpcklbw ymm2, ymm0, ymm1 // low 16 UV pairs. mutated qqword 0,2 -+ vpunpckhbw ymm0, ymm0, ymm1 // high 16 UV pairs. mutated qqword 1,3 -+ vextractf128 [edi], ymm2, 0 // bytes 0..15 -+ vextractf128 [edi + 16], ymm0, 0 // bytes 16..31 -+ vextractf128 [edi + 32], ymm2, 1 // bytes 32..47 -+ vextractf128 [edi + 48], ymm0, 1 // bytes 47..63 -+ lea edi, [edi + 64] -+ sub ecx, 32 - jg convertloop - - pop edi -diff --git a/media/libyuv/libyuv/source/scale.cc b/media/libyuv/libyuv/source/scale.cc ---- a/media/libyuv/libyuv/source/scale.cc -+++ b/media/libyuv/libyuv/source/scale.cc -@@ -135,14 +135,6 @@ static void ScalePlaneDown2(int src_widt - } - } - #endif --#if defined(HAS_SCALEROWDOWN2_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ScaleRowDown2 = filtering == kFilterNone -- ? ScaleRowDown2_RVV -- : (filtering == kFilterLinear ? ScaleRowDown2Linear_RVV -- : ScaleRowDown2Box_RVV); -- } --#endif - - if (filtering == kFilterLinear) { - src_stride = 0; -@@ -320,11 +312,6 @@ static void ScalePlaneDown4(int src_widt - } - } - #endif --#if defined(HAS_SCALEROWDOWN4_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ScaleRowDown4 = filtering ? ScaleRowDown4Box_RVV : ScaleRowDown4_RVV; -- } --#endif - - if (filtering == kFilterLinear) { - src_stride = 0; -@@ -485,17 +472,6 @@ static void ScalePlaneDown34(int src_wid - } - } - #endif --#if defined(HAS_SCALEROWDOWN34_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- if (!filtering) { -- ScaleRowDown34_0 = ScaleRowDown34_RVV; -- ScaleRowDown34_1 = ScaleRowDown34_RVV; -- } else { -- ScaleRowDown34_0 = ScaleRowDown34_0_Box_RVV; -- ScaleRowDown34_1 = ScaleRowDown34_1_Box_RVV; -- } -- } --#endif - - for (y = 0; y < dst_height - 2; y += 3) { - ScaleRowDown34_0(src_ptr, filter_stride, dst_ptr, dst_width); -@@ -711,17 +687,6 @@ static void ScalePlaneDown38(int src_wid - } - } - #endif --#if defined(HAS_SCALEROWDOWN38_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- if (!filtering) { -- ScaleRowDown38_3 = ScaleRowDown38_RVV; -- ScaleRowDown38_2 = ScaleRowDown38_RVV; -- } else { -- ScaleRowDown38_3 = ScaleRowDown38_3_Box_RVV; -- ScaleRowDown38_2 = ScaleRowDown38_2_Box_RVV; -- } -- } --#endif - - for (y = 0; y < dst_height - 2; y += 3) { - ScaleRowDown38_3(src_ptr, filter_stride, dst_ptr, dst_width); -@@ -855,10 +820,8 @@ static void ScaleAddCols2_C(int dst_widt - int ix = x >> 16; - x += dx; - boxwidth = MIN1((x >> 16) - ix); -- int scaletbl_index = boxwidth - minboxwidth; -- assert((scaletbl_index == 0) || (scaletbl_index == 1)); - *dst_ptr++ = (uint8_t)(SumPixels(boxwidth, src_ptr + ix) * -- scaletbl[scaletbl_index] >> -+ scaletbl[boxwidth - minboxwidth] >> - 16); - } - } -@@ -879,10 +842,9 @@ static void ScaleAddCols2_16_C(int dst_w - int ix = x >> 16; - x += dx; - boxwidth = MIN1((x >> 16) - ix); -- int scaletbl_index = boxwidth - minboxwidth; -- assert((scaletbl_index == 0) || (scaletbl_index == 1)); -- *dst_ptr++ = -- SumPixels_16(boxwidth, src_ptr + ix) * scaletbl[scaletbl_index] >> 16; -+ *dst_ptr++ = SumPixels_16(boxwidth, src_ptr + ix) * -+ scaletbl[boxwidth - minboxwidth] >> -+ 16; - } - } - -@@ -939,14 +901,14 @@ static void ScaleAddCols1_16_C(int dst_w - // one pixel of destination using fixed point (16.16) to step - // through source, sampling a box of pixel with simple - // averaging. --static int ScalePlaneBox(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint8_t* src_ptr, -- uint8_t* dst_ptr) { -+static void ScalePlaneBox(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint8_t* src_ptr, -+ uint8_t* dst_ptr) { - int j, k; - // Initial source x/y coordinate and step values as 16.16 fixed point. - int x = 0; -@@ -960,8 +922,6 @@ static int ScalePlaneBox(int src_width, - { - // Allocate a row buffer of uint16_t. - align_buffer_64(row16, src_width * 2); -- if (!row16) -- return 1; - void (*ScaleAddCols)(int dst_width, int boxheight, int x, int dx, - const uint16_t* src_ptr, uint8_t* dst_ptr) = - (dx & 0xffff) ? ScaleAddCols2_C -@@ -1008,11 +968,6 @@ static int ScalePlaneBox(int src_width, - } - } - #endif --#if defined(HAS_SCALEADDROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ScaleAddRow = ScaleAddRow_RVV; -- } --#endif - - for (j = 0; j < dst_height; ++j) { - int boxheight; -@@ -1033,17 +988,16 @@ static int ScalePlaneBox(int src_width, - } - free_aligned_buffer_64(row16); - } -- return 0; - } - --static int ScalePlaneBox_16(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint16_t* src_ptr, -- uint16_t* dst_ptr) { -+static void ScalePlaneBox_16(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint16_t* src_ptr, -+ uint16_t* dst_ptr) { - int j, k; - // Initial source x/y coordinate and step values as 16.16 fixed point. - int x = 0; -@@ -1057,8 +1011,6 @@ static int ScalePlaneBox_16(int src_widt - { - // Allocate a row buffer of uint32_t. - align_buffer_64(row32, src_width * 4); -- if (!row32) -- return 1; - void (*ScaleAddCols)(int dst_width, int boxheight, int x, int dx, - const uint32_t* src_ptr, uint16_t* dst_ptr) = - (dx & 0xffff) ? ScaleAddCols2_16_C : ScaleAddCols1_16_C; -@@ -1090,19 +1042,18 @@ static int ScalePlaneBox_16(int src_widt - } - free_aligned_buffer_64(row32); - } -- return 0; - } - - // Scale plane down with bilinear interpolation. --static int ScalePlaneBilinearDown(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint8_t* src_ptr, -- uint8_t* dst_ptr, -- enum FilterMode filtering) { -+void ScalePlaneBilinearDown(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint8_t* src_ptr, -+ uint8_t* dst_ptr, -+ enum FilterMode filtering) { - // Initial source x/y coordinate and step values as 16.16 fixed point. - int x = 0; - int y = 0; -@@ -1111,8 +1062,6 @@ static int ScalePlaneBilinearDown(int sr - // TODO(fbarchard): Consider not allocating row buffer for kFilterLinear. - // Allocate a row buffer. - align_buffer_64(row, src_width); -- if (!row) -- return 1; - - const int max_y = (src_height - 1) << 16; - int j; -@@ -1166,11 +1115,6 @@ static int ScalePlaneBilinearDown(int sr - } - } - #endif --#if defined(HAS_INTERPOLATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- InterpolateRow = InterpolateRow_RVV; -- } --#endif - - #if defined(HAS_SCALEFILTERCOLS_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3) && src_width < 32768) { -@@ -1222,18 +1166,17 @@ static int ScalePlaneBilinearDown(int sr - } - } - free_aligned_buffer_64(row); -- return 0; - } - --static int ScalePlaneBilinearDown_16(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint16_t* src_ptr, -- uint16_t* dst_ptr, -- enum FilterMode filtering) { -+void ScalePlaneBilinearDown_16(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint16_t* src_ptr, -+ uint16_t* dst_ptr, -+ enum FilterMode filtering) { - // Initial source x/y coordinate and step values as 16.16 fixed point. - int x = 0; - int y = 0; -@@ -1242,8 +1185,6 @@ static int ScalePlaneBilinearDown_16(int - // TODO(fbarchard): Consider not allocating row buffer for kFilterLinear. - // Allocate a row buffer. - align_buffer_64(row, src_width * 2); -- if (!row) -- return 1; - - const int max_y = (src_height - 1) << 16; - int j; -@@ -1316,19 +1257,18 @@ static int ScalePlaneBilinearDown_16(int - } - } - free_aligned_buffer_64(row); -- return 0; - } - - // Scale up down with bilinear interpolation. --static int ScalePlaneBilinearUp(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint8_t* src_ptr, -- uint8_t* dst_ptr, -- enum FilterMode filtering) { -+void ScalePlaneBilinearUp(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint8_t* src_ptr, -+ uint8_t* dst_ptr, -+ enum FilterMode filtering) { - int j; - // Initial source x/y coordinate and step values as 16.16 fixed point. - int x = 0; -@@ -1370,11 +1310,6 @@ static int ScalePlaneBilinearUp(int src_ - } - } - #endif --#if defined(HAS_INTERPOLATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- InterpolateRow = InterpolateRow_RVV; -- } --#endif - - if (filtering && src_width >= 32768) { - ScaleFilterCols = ScaleFilterCols64_C; -@@ -1427,8 +1362,6 @@ static int ScalePlaneBilinearUp(int src_ - // Allocate 2 row buffers. - const int row_size = (dst_width + 31) & ~31; - align_buffer_64(row, row_size * 2); -- if (!row) -- return 1; - - uint8_t* rowptr = row; - int rowstride = row_size; -@@ -1472,7 +1405,6 @@ static int ScalePlaneBilinearUp(int src_ - } - free_aligned_buffer_64(row); - } -- return 0; - } - - // Scale plane, horizontally up by 2 times. -@@ -1480,21 +1412,20 @@ static int ScalePlaneBilinearUp(int src_ - // This is an optimized version for scaling up a plane to 2 times of - // its original width, using linear interpolation. - // This is used to scale U and V planes of I422 to I444. --static void ScalePlaneUp2_Linear(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint8_t* src_ptr, -- uint8_t* dst_ptr) { -+void ScalePlaneUp2_Linear(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint8_t* src_ptr, -+ uint8_t* dst_ptr) { - void (*ScaleRowUp)(const uint8_t* src_ptr, uint8_t* dst_ptr, int dst_width) = - ScaleRowUp2_Linear_Any_C; - int i; - int y; - int dy; - -- (void)src_width; - // This function can only scale up by 2 times horizontally. - assert(src_width == ((dst_width + 1) / 2)); - -@@ -1521,11 +1452,6 @@ static void ScalePlaneUp2_Linear(int src - ScaleRowUp = ScaleRowUp2_Linear_Any_NEON; - } - #endif --#ifdef HAS_SCALEROWUP2_LINEAR_RVV -- if (TestCpuFlag(kCpuHasRVV)) { -- ScaleRowUp = ScaleRowUp2_Linear_RVV; -- } --#endif - - if (dst_height == 1) { - ScaleRowUp(src_ptr + ((src_height - 1) / 2) * (int64_t)src_stride, dst_ptr, -@@ -1545,20 +1471,19 @@ static void ScalePlaneUp2_Linear(int src - // This is an optimized version for scaling up a plane to 2 times of - // its original size, using bilinear interpolation. - // This is used to scale U and V planes of I420 to I444. --static void ScalePlaneUp2_Bilinear(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint8_t* src_ptr, -- uint8_t* dst_ptr) { -+void ScalePlaneUp2_Bilinear(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint8_t* src_ptr, -+ uint8_t* dst_ptr) { - void (*Scale2RowUp)(const uint8_t* src_ptr, ptrdiff_t src_stride, - uint8_t* dst_ptr, ptrdiff_t dst_stride, int dst_width) = - ScaleRowUp2_Bilinear_Any_C; - int x; - -- (void)src_width; - // This function can only scale up by 2 times. - assert(src_width == ((dst_width + 1) / 2)); - assert(src_height == ((dst_height + 1) / 2)); -@@ -1586,11 +1511,6 @@ static void ScalePlaneUp2_Bilinear(int s - Scale2RowUp = ScaleRowUp2_Bilinear_Any_NEON; - } - #endif --#ifdef HAS_SCALEROWUP2_BILINEAR_RVV -- if (TestCpuFlag(kCpuHasRVV)) { -- Scale2RowUp = ScaleRowUp2_Bilinear_RVV; -- } --#endif - - Scale2RowUp(src_ptr, 0, dst_ptr, 0, dst_width); - dst_ptr += dst_stride; -@@ -1611,21 +1531,20 @@ static void ScalePlaneUp2_Bilinear(int s - // its original width, using linear interpolation. - // stride is in count of uint16_t. - // This is used to scale U and V planes of I210 to I410 and I212 to I412. --static void ScalePlaneUp2_12_Linear(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint16_t* src_ptr, -- uint16_t* dst_ptr) { -+void ScalePlaneUp2_12_Linear(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint16_t* src_ptr, -+ uint16_t* dst_ptr) { - void (*ScaleRowUp)(const uint16_t* src_ptr, uint16_t* dst_ptr, - int dst_width) = ScaleRowUp2_Linear_16_Any_C; - int i; - int y; - int dy; - -- (void)src_width; - // This function can only scale up by 2 times horizontally. - assert(src_width == ((dst_width + 1) / 2)); - -@@ -1666,20 +1585,19 @@ static void ScalePlaneUp2_12_Linear(int - // its original size, using bilinear interpolation. - // stride is in count of uint16_t. - // This is used to scale U and V planes of I010 to I410 and I012 to I412. --static void ScalePlaneUp2_12_Bilinear(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint16_t* src_ptr, -- uint16_t* dst_ptr) { -+void ScalePlaneUp2_12_Bilinear(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint16_t* src_ptr, -+ uint16_t* dst_ptr) { - void (*Scale2RowUp)(const uint16_t* src_ptr, ptrdiff_t src_stride, - uint16_t* dst_ptr, ptrdiff_t dst_stride, int dst_width) = - ScaleRowUp2_Bilinear_16_Any_C; - int x; - -- (void)src_width; - // This function can only scale up by 2 times. - assert(src_width == ((dst_width + 1) / 2)); - assert(src_height == ((dst_height + 1) / 2)); -@@ -1714,21 +1632,20 @@ static void ScalePlaneUp2_12_Bilinear(in - } - } - --static void ScalePlaneUp2_16_Linear(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint16_t* src_ptr, -- uint16_t* dst_ptr) { -+void ScalePlaneUp2_16_Linear(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint16_t* src_ptr, -+ uint16_t* dst_ptr) { - void (*ScaleRowUp)(const uint16_t* src_ptr, uint16_t* dst_ptr, - int dst_width) = ScaleRowUp2_Linear_16_Any_C; - int i; - int y; - int dy; - -- (void)src_width; - // This function can only scale up by 2 times horizontally. - assert(src_width == ((dst_width + 1) / 2)); - -@@ -1764,20 +1681,19 @@ static void ScalePlaneUp2_16_Linear(int - } - } - --static void ScalePlaneUp2_16_Bilinear(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint16_t* src_ptr, -- uint16_t* dst_ptr) { -+void ScalePlaneUp2_16_Bilinear(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint16_t* src_ptr, -+ uint16_t* dst_ptr) { - void (*Scale2RowUp)(const uint16_t* src_ptr, ptrdiff_t src_stride, - uint16_t* dst_ptr, ptrdiff_t dst_stride, int dst_width) = - ScaleRowUp2_Bilinear_16_Any_C; - int x; - -- (void)src_width; - // This function can only scale up by 2 times. - assert(src_width == ((dst_width + 1) / 2)); - assert(src_height == ((dst_height + 1) / 2)); -@@ -1812,15 +1728,15 @@ static void ScalePlaneUp2_16_Bilinear(in - } - } - --static int ScalePlaneBilinearUp_16(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint16_t* src_ptr, -- uint16_t* dst_ptr, -- enum FilterMode filtering) { -+void ScalePlaneBilinearUp_16(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint16_t* src_ptr, -+ uint16_t* dst_ptr, -+ enum FilterMode filtering) { - int j; - // Initial source x/y coordinate and step values as 16.16 fixed point. - int x = 0; -@@ -1897,11 +1813,10 @@ static int ScalePlaneBilinearUp_16(int s - // Allocate 2 row buffers. - const int row_size = (dst_width + 31) & ~31; - align_buffer_64(row, row_size * 4); -+ -+ uint16_t* rowptr = (uint16_t*)row; - int rowstride = row_size; - int lasty = yi; -- uint16_t* rowptr = (uint16_t*)row; -- if (!row) -- return 1; - - ScaleFilterCols(rowptr, src, dst_width, x, dx); - if (src_height > 1) { -@@ -1941,7 +1856,6 @@ static int ScalePlaneBilinearUp_16(int s - } - free_aligned_buffer_64(row); - } -- return 0; - } - - // Scale Plane to/from any dimensions, without interpolation. -@@ -2026,15 +1940,15 @@ static void ScalePlaneSimple_16(int src_ - // Scale a plane. - // This function dispatches to a specialized scaler based on scale factor. - LIBYUV_API --int ScalePlane(const uint8_t* src, -- int src_stride, -- int src_width, -- int src_height, -- uint8_t* dst, -- int dst_stride, -- int dst_width, -- int dst_height, -- enum FilterMode filtering) { -+void ScalePlane(const uint8_t* src, -+ int src_stride, -+ int src_width, -+ int src_height, -+ uint8_t* dst, -+ int dst_stride, -+ int dst_width, -+ int dst_height, -+ enum FilterMode filtering) { - // Simplify filtering when possible. - filtering = ScaleFilterReduce(src_width, src_height, dst_width, dst_height, - filtering); -@@ -2050,7 +1964,7 @@ int ScalePlane(const uint8_t* src, - if (dst_width == src_width && dst_height == src_height) { - // Straight copy. - CopyPlane(src, src_stride, dst, dst_stride, dst_width, dst_height); -- return 0; -+ return; - } - if (dst_width == src_width && filtering != kFilterBox) { - int dy = 0; -@@ -2066,7 +1980,7 @@ int ScalePlane(const uint8_t* src, - // Arbitrary scale vertically, but unscaled horizontally. - ScalePlaneVertical(src_height, dst_width, dst_height, src_stride, - dst_stride, src, dst, 0, y, dy, /*bpp=*/1, filtering); -- return 0; -+ return; - } - if (dst_width <= Abs(src_width) && dst_height <= src_height) { - // Scale down. -@@ -2074,67 +1988,69 @@ int ScalePlane(const uint8_t* src, - // optimized, 3/4 - ScalePlaneDown34(src_width, src_height, dst_width, dst_height, src_stride, - dst_stride, src, dst, filtering); -- return 0; -+ return; - } - if (2 * dst_width == src_width && 2 * dst_height == src_height) { - // optimized, 1/2 - ScalePlaneDown2(src_width, src_height, dst_width, dst_height, src_stride, - dst_stride, src, dst, filtering); -- return 0; -+ return; - } - // 3/8 rounded up for odd sized chroma height. - if (8 * dst_width == 3 * src_width && 8 * dst_height == 3 * src_height) { - // optimized, 3/8 - ScalePlaneDown38(src_width, src_height, dst_width, dst_height, src_stride, - dst_stride, src, dst, filtering); -- return 0; -+ return; - } - if (4 * dst_width == src_width && 4 * dst_height == src_height && - (filtering == kFilterBox || filtering == kFilterNone)) { - // optimized, 1/4 - ScalePlaneDown4(src_width, src_height, dst_width, dst_height, src_stride, - dst_stride, src, dst, filtering); -- return 0; -+ return; - } - } - if (filtering == kFilterBox && dst_height * 2 < src_height) { -- return ScalePlaneBox(src_width, src_height, dst_width, dst_height, -- src_stride, dst_stride, src, dst); -+ ScalePlaneBox(src_width, src_height, dst_width, dst_height, src_stride, -+ dst_stride, src, dst); -+ return; - } - if ((dst_width + 1) / 2 == src_width && filtering == kFilterLinear) { - ScalePlaneUp2_Linear(src_width, src_height, dst_width, dst_height, - src_stride, dst_stride, src, dst); -- return 0; -+ return; - } - if ((dst_height + 1) / 2 == src_height && (dst_width + 1) / 2 == src_width && - (filtering == kFilterBilinear || filtering == kFilterBox)) { - ScalePlaneUp2_Bilinear(src_width, src_height, dst_width, dst_height, - src_stride, dst_stride, src, dst); -- return 0; -+ return; - } - if (filtering && dst_height > src_height) { -- return ScalePlaneBilinearUp(src_width, src_height, dst_width, dst_height, -- src_stride, dst_stride, src, dst, filtering); -+ ScalePlaneBilinearUp(src_width, src_height, dst_width, dst_height, -+ src_stride, dst_stride, src, dst, filtering); -+ return; - } - if (filtering) { -- return ScalePlaneBilinearDown(src_width, src_height, dst_width, dst_height, -- src_stride, dst_stride, src, dst, filtering); -+ ScalePlaneBilinearDown(src_width, src_height, dst_width, dst_height, -+ src_stride, dst_stride, src, dst, filtering); -+ return; - } - ScalePlaneSimple(src_width, src_height, dst_width, dst_height, src_stride, - dst_stride, src, dst); -- return 0; - } - - LIBYUV_API --int ScalePlane_16(const uint16_t* src, -- int src_stride, -- int src_width, -- int src_height, -- uint16_t* dst, -- int dst_stride, -- int dst_width, -- int dst_height, -- enum FilterMode filtering) { -+void ScalePlane_16(const uint16_t* src, -+ int src_stride, -+ int src_width, -+ int src_height, -+ uint16_t* dst, -+ int dst_stride, -+ int dst_width, -+ int dst_height, -+ enum FilterMode filtering) { - // Simplify filtering when possible. - filtering = ScaleFilterReduce(src_width, src_height, dst_width, dst_height, - filtering); -@@ -2150,7 +2066,7 @@ int ScalePlane_16(const uint16_t* src, - if (dst_width == src_width && dst_height == src_height) { - // Straight copy. - CopyPlane_16(src, src_stride, dst, dst_stride, dst_width, dst_height); -- return 0; -+ return; - } - if (dst_width == src_width && filtering != kFilterBox) { - int dy = 0; -@@ -2169,7 +2085,7 @@ int ScalePlane_16(const uint16_t* src, - // Arbitrary scale vertically, but unscaled horizontally. - ScalePlaneVertical_16(src_height, dst_width, dst_height, src_stride, - dst_stride, src, dst, 0, y, dy, /*bpp=*/1, filtering); -- return 0; -+ return; - } - if (dst_width <= Abs(src_width) && dst_height <= src_height) { - // Scale down. -@@ -2177,68 +2093,69 @@ int ScalePlane_16(const uint16_t* src, - // optimized, 3/4 - ScalePlaneDown34_16(src_width, src_height, dst_width, dst_height, - src_stride, dst_stride, src, dst, filtering); -- return 0; -+ return; - } - if (2 * dst_width == src_width && 2 * dst_height == src_height) { - // optimized, 1/2 - ScalePlaneDown2_16(src_width, src_height, dst_width, dst_height, - src_stride, dst_stride, src, dst, filtering); -- return 0; -+ return; - } - // 3/8 rounded up for odd sized chroma height. - if (8 * dst_width == 3 * src_width && 8 * dst_height == 3 * src_height) { - // optimized, 3/8 - ScalePlaneDown38_16(src_width, src_height, dst_width, dst_height, - src_stride, dst_stride, src, dst, filtering); -- return 0; -+ return; - } - if (4 * dst_width == src_width && 4 * dst_height == src_height && - (filtering == kFilterBox || filtering == kFilterNone)) { - // optimized, 1/4 - ScalePlaneDown4_16(src_width, src_height, dst_width, dst_height, - src_stride, dst_stride, src, dst, filtering); -- return 0; -+ return; - } - } - if (filtering == kFilterBox && dst_height * 2 < src_height) { -- return ScalePlaneBox_16(src_width, src_height, dst_width, dst_height, -- src_stride, dst_stride, src, dst); -+ ScalePlaneBox_16(src_width, src_height, dst_width, dst_height, src_stride, -+ dst_stride, src, dst); -+ return; - } - if ((dst_width + 1) / 2 == src_width && filtering == kFilterLinear) { - ScalePlaneUp2_16_Linear(src_width, src_height, dst_width, dst_height, - src_stride, dst_stride, src, dst); -- return 0; -+ return; - } - if ((dst_height + 1) / 2 == src_height && (dst_width + 1) / 2 == src_width && - (filtering == kFilterBilinear || filtering == kFilterBox)) { - ScalePlaneUp2_16_Bilinear(src_width, src_height, dst_width, dst_height, - src_stride, dst_stride, src, dst); -- return 0; -+ return; - } - if (filtering && dst_height > src_height) { -- return ScalePlaneBilinearUp_16(src_width, src_height, dst_width, dst_height, -- src_stride, dst_stride, src, dst, filtering); -+ ScalePlaneBilinearUp_16(src_width, src_height, dst_width, dst_height, -+ src_stride, dst_stride, src, dst, filtering); -+ return; - } - if (filtering) { -- return ScalePlaneBilinearDown_16(src_width, src_height, dst_width, -- dst_height, src_stride, dst_stride, src, -- dst, filtering); -+ ScalePlaneBilinearDown_16(src_width, src_height, dst_width, dst_height, -+ src_stride, dst_stride, src, dst, filtering); -+ return; - } - ScalePlaneSimple_16(src_width, src_height, dst_width, dst_height, src_stride, - dst_stride, src, dst); -- return 0; - } - - LIBYUV_API --int ScalePlane_12(const uint16_t* src, -- int src_stride, -- int src_width, -- int src_height, -- uint16_t* dst, -- int dst_stride, -- int dst_width, -- int dst_height, -- enum FilterMode filtering) { -+void ScalePlane_12(const uint16_t* src, -+ int src_stride, -+ int src_width, -+ int src_height, -+ uint16_t* dst, -+ int dst_stride, -+ int dst_width, -+ int dst_height, -+ enum FilterMode filtering) { - // Simplify filtering when possible. - filtering = ScaleFilterReduce(src_width, src_height, dst_width, dst_height, - filtering); -@@ -2253,17 +2170,17 @@ int ScalePlane_12(const uint16_t* src, - if ((dst_width + 1) / 2 == src_width && filtering == kFilterLinear) { - ScalePlaneUp2_12_Linear(src_width, src_height, dst_width, dst_height, - src_stride, dst_stride, src, dst); -- return 0; -+ return; - } - if ((dst_height + 1) / 2 == src_height && (dst_width + 1) / 2 == src_width && - (filtering == kFilterBilinear || filtering == kFilterBox)) { - ScalePlaneUp2_12_Bilinear(src_width, src_height, dst_width, dst_height, - src_stride, dst_stride, src, dst); -- return 0; -+ return; - } - -- return ScalePlane_16(src, src_stride, src_width, src_height, dst, dst_stride, -- dst_width, dst_height, filtering); -+ ScalePlane_16(src, src_stride, src_width, src_height, dst, dst_stride, -+ dst_width, dst_height, filtering); - } - - // Scale an I420 image. -@@ -2291,7 +2208,6 @@ int I420Scale(const uint8_t* src_y, - int src_halfheight = SUBSAMPLE(src_height, 1, 1); - int dst_halfwidth = SUBSAMPLE(dst_width, 1, 1); - int dst_halfheight = SUBSAMPLE(dst_height, 1, 1); -- int r; - - if (!src_y || !src_u || !src_v || src_width <= 0 || src_height == 0 || - src_width > 32768 || src_height > 32768 || !dst_y || !dst_u || !dst_v || -@@ -2299,19 +2215,13 @@ int I420Scale(const uint8_t* src_y, - return -1; - } - -- r = ScalePlane(src_y, src_stride_y, src_width, src_height, dst_y, -- dst_stride_y, dst_width, dst_height, filtering); -- if (r != 0) { -- return r; -- } -- r = ScalePlane(src_u, src_stride_u, src_halfwidth, src_halfheight, dst_u, -- dst_stride_u, dst_halfwidth, dst_halfheight, filtering); -- if (r != 0) { -- return r; -- } -- r = ScalePlane(src_v, src_stride_v, src_halfwidth, src_halfheight, dst_v, -- dst_stride_v, dst_halfwidth, dst_halfheight, filtering); -- return r; -+ ScalePlane(src_y, src_stride_y, src_width, src_height, dst_y, dst_stride_y, -+ dst_width, dst_height, filtering); -+ ScalePlane(src_u, src_stride_u, src_halfwidth, src_halfheight, dst_u, -+ dst_stride_u, dst_halfwidth, dst_halfheight, filtering); -+ ScalePlane(src_v, src_stride_v, src_halfwidth, src_halfheight, dst_v, -+ dst_stride_v, dst_halfwidth, dst_halfheight, filtering); -+ return 0; - } - - LIBYUV_API -@@ -2336,7 +2246,6 @@ int I420Scale_16(const uint16_t* src_y, - int src_halfheight = SUBSAMPLE(src_height, 1, 1); - int dst_halfwidth = SUBSAMPLE(dst_width, 1, 1); - int dst_halfheight = SUBSAMPLE(dst_height, 1, 1); -- int r; - - if (!src_y || !src_u || !src_v || src_width <= 0 || src_height == 0 || - src_width > 32768 || src_height > 32768 || !dst_y || !dst_u || !dst_v || -@@ -2344,19 +2253,13 @@ int I420Scale_16(const uint16_t* src_y, - return -1; - } - -- r = ScalePlane_16(src_y, src_stride_y, src_width, src_height, dst_y, -- dst_stride_y, dst_width, dst_height, filtering); -- if (r != 0) { -- return r; -- } -- r = ScalePlane_16(src_u, src_stride_u, src_halfwidth, src_halfheight, dst_u, -- dst_stride_u, dst_halfwidth, dst_halfheight, filtering); -- if (r != 0) { -- return r; -- } -- r = ScalePlane_16(src_v, src_stride_v, src_halfwidth, src_halfheight, dst_v, -- dst_stride_v, dst_halfwidth, dst_halfheight, filtering); -- return r; -+ ScalePlane_16(src_y, src_stride_y, src_width, src_height, dst_y, dst_stride_y, -+ dst_width, dst_height, filtering); -+ ScalePlane_16(src_u, src_stride_u, src_halfwidth, src_halfheight, dst_u, -+ dst_stride_u, dst_halfwidth, dst_halfheight, filtering); -+ ScalePlane_16(src_v, src_stride_v, src_halfwidth, src_halfheight, dst_v, -+ dst_stride_v, dst_halfwidth, dst_halfheight, filtering); -+ return 0; - } - - LIBYUV_API -@@ -2381,7 +2284,6 @@ int I420Scale_12(const uint16_t* src_y, - int src_halfheight = SUBSAMPLE(src_height, 1, 1); - int dst_halfwidth = SUBSAMPLE(dst_width, 1, 1); - int dst_halfheight = SUBSAMPLE(dst_height, 1, 1); -- int r; - - if (!src_y || !src_u || !src_v || src_width <= 0 || src_height == 0 || - src_width > 32768 || src_height > 32768 || !dst_y || !dst_u || !dst_v || -@@ -2389,19 +2291,13 @@ int I420Scale_12(const uint16_t* src_y, - return -1; - } - -- r = ScalePlane_12(src_y, src_stride_y, src_width, src_height, dst_y, -- dst_stride_y, dst_width, dst_height, filtering); -- if (r != 0) { -- return r; -- } -- r = ScalePlane_12(src_u, src_stride_u, src_halfwidth, src_halfheight, dst_u, -- dst_stride_u, dst_halfwidth, dst_halfheight, filtering); -- if (r != 0) { -- return r; -- } -- r = ScalePlane_12(src_v, src_stride_v, src_halfwidth, src_halfheight, dst_v, -- dst_stride_v, dst_halfwidth, dst_halfheight, filtering); -- return r; -+ ScalePlane_12(src_y, src_stride_y, src_width, src_height, dst_y, dst_stride_y, -+ dst_width, dst_height, filtering); -+ ScalePlane_12(src_u, src_stride_u, src_halfwidth, src_halfheight, dst_u, -+ dst_stride_u, dst_halfwidth, dst_halfheight, filtering); -+ ScalePlane_12(src_v, src_stride_v, src_halfwidth, src_halfheight, dst_v, -+ dst_stride_v, dst_halfwidth, dst_halfheight, filtering); -+ return 0; - } - - // Scale an I444 image. -@@ -2425,27 +2321,19 @@ int I444Scale(const uint8_t* src_y, - int dst_width, - int dst_height, - enum FilterMode filtering) { -- int r; -- - if (!src_y || !src_u || !src_v || src_width <= 0 || src_height == 0 || - src_width > 32768 || src_height > 32768 || !dst_y || !dst_u || !dst_v || - dst_width <= 0 || dst_height <= 0) { - return -1; - } - -- r = ScalePlane(src_y, src_stride_y, src_width, src_height, dst_y, -- dst_stride_y, dst_width, dst_height, filtering); -- if (r != 0) { -- return r; -- } -- r = ScalePlane(src_u, src_stride_u, src_width, src_height, dst_u, -- dst_stride_u, dst_width, dst_height, filtering); -- if (r != 0) { -- return r; -- } -- r = ScalePlane(src_v, src_stride_v, src_width, src_height, dst_v, -- dst_stride_v, dst_width, dst_height, filtering); -- return r; -+ ScalePlane(src_y, src_stride_y, src_width, src_height, dst_y, dst_stride_y, -+ dst_width, dst_height, filtering); -+ ScalePlane(src_u, src_stride_u, src_width, src_height, dst_u, dst_stride_u, -+ dst_width, dst_height, filtering); -+ ScalePlane(src_v, src_stride_v, src_width, src_height, dst_v, dst_stride_v, -+ dst_width, dst_height, filtering); -+ return 0; - } - - LIBYUV_API -@@ -2466,27 +2354,19 @@ int I444Scale_16(const uint16_t* src_y, - int dst_width, - int dst_height, - enum FilterMode filtering) { -- int r; -- - if (!src_y || !src_u || !src_v || src_width <= 0 || src_height == 0 || - src_width > 32768 || src_height > 32768 || !dst_y || !dst_u || !dst_v || - dst_width <= 0 || dst_height <= 0) { - return -1; - } - -- r = ScalePlane_16(src_y, src_stride_y, src_width, src_height, dst_y, -- dst_stride_y, dst_width, dst_height, filtering); -- if (r != 0) { -- return r; -- } -- r = ScalePlane_16(src_u, src_stride_u, src_width, src_height, dst_u, -- dst_stride_u, dst_width, dst_height, filtering); -- if (r != 0) { -- return r; -- } -- r = ScalePlane_16(src_v, src_stride_v, src_width, src_height, dst_v, -- dst_stride_v, dst_width, dst_height, filtering); -- return r; -+ ScalePlane_16(src_y, src_stride_y, src_width, src_height, dst_y, dst_stride_y, -+ dst_width, dst_height, filtering); -+ ScalePlane_16(src_u, src_stride_u, src_width, src_height, dst_u, dst_stride_u, -+ dst_width, dst_height, filtering); -+ ScalePlane_16(src_v, src_stride_v, src_width, src_height, dst_v, dst_stride_v, -+ dst_width, dst_height, filtering); -+ return 0; - } - - LIBYUV_API -@@ -2507,27 +2387,19 @@ int I444Scale_12(const uint16_t* src_y, - int dst_width, - int dst_height, - enum FilterMode filtering) { -- int r; -- - if (!src_y || !src_u || !src_v || src_width <= 0 || src_height == 0 || - src_width > 32768 || src_height > 32768 || !dst_y || !dst_u || !dst_v || - dst_width <= 0 || dst_height <= 0) { - return -1; - } - -- r = ScalePlane_12(src_y, src_stride_y, src_width, src_height, dst_y, -- dst_stride_y, dst_width, dst_height, filtering); -- if (r != 0) { -- return r; -- } -- r = ScalePlane_12(src_u, src_stride_u, src_width, src_height, dst_u, -- dst_stride_u, dst_width, dst_height, filtering); -- if (r != 0) { -- return r; -- } -- r = ScalePlane_12(src_v, src_stride_v, src_width, src_height, dst_v, -- dst_stride_v, dst_width, dst_height, filtering); -- return r; -+ ScalePlane_12(src_y, src_stride_y, src_width, src_height, dst_y, dst_stride_y, -+ dst_width, dst_height, filtering); -+ ScalePlane_12(src_u, src_stride_u, src_width, src_height, dst_u, dst_stride_u, -+ dst_width, dst_height, filtering); -+ ScalePlane_12(src_v, src_stride_v, src_width, src_height, dst_v, dst_stride_v, -+ dst_width, dst_height, filtering); -+ return 0; - } - - // Scale an I422 image. -@@ -2553,7 +2425,6 @@ int I422Scale(const uint8_t* src_y, - enum FilterMode filtering) { - int src_halfwidth = SUBSAMPLE(src_width, 1, 1); - int dst_halfwidth = SUBSAMPLE(dst_width, 1, 1); -- int r; - - if (!src_y || !src_u || !src_v || src_width <= 0 || src_height == 0 || - src_width > 32768 || src_height > 32768 || !dst_y || !dst_u || !dst_v || -@@ -2561,19 +2432,13 @@ int I422Scale(const uint8_t* src_y, - return -1; - } - -- r = ScalePlane(src_y, src_stride_y, src_width, src_height, dst_y, -- dst_stride_y, dst_width, dst_height, filtering); -- if (r != 0) { -- return r; -- } -- r = ScalePlane(src_u, src_stride_u, src_halfwidth, src_height, dst_u, -- dst_stride_u, dst_halfwidth, dst_height, filtering); -- if (r != 0) { -- return r; -- } -- r = ScalePlane(src_v, src_stride_v, src_halfwidth, src_height, dst_v, -- dst_stride_v, dst_halfwidth, dst_height, filtering); -- return r; -+ ScalePlane(src_y, src_stride_y, src_width, src_height, dst_y, dst_stride_y, -+ dst_width, dst_height, filtering); -+ ScalePlane(src_u, src_stride_u, src_halfwidth, src_height, dst_u, -+ dst_stride_u, dst_halfwidth, dst_height, filtering); -+ ScalePlane(src_v, src_stride_v, src_halfwidth, src_height, dst_v, -+ dst_stride_v, dst_halfwidth, dst_height, filtering); -+ return 0; - } - - LIBYUV_API -@@ -2596,7 +2461,6 @@ int I422Scale_16(const uint16_t* src_y, - enum FilterMode filtering) { - int src_halfwidth = SUBSAMPLE(src_width, 1, 1); - int dst_halfwidth = SUBSAMPLE(dst_width, 1, 1); -- int r; - - if (!src_y || !src_u || !src_v || src_width <= 0 || src_height == 0 || - src_width > 32768 || src_height > 32768 || !dst_y || !dst_u || !dst_v || -@@ -2604,19 +2468,13 @@ int I422Scale_16(const uint16_t* src_y, - return -1; - } - -- r = ScalePlane_16(src_y, src_stride_y, src_width, src_height, dst_y, -- dst_stride_y, dst_width, dst_height, filtering); -- if (r != 0) { -- return r; -- } -- r = ScalePlane_16(src_u, src_stride_u, src_halfwidth, src_height, dst_u, -- dst_stride_u, dst_halfwidth, dst_height, filtering); -- if (r != 0) { -- return r; -- } -- r = ScalePlane_16(src_v, src_stride_v, src_halfwidth, src_height, dst_v, -- dst_stride_v, dst_halfwidth, dst_height, filtering); -- return r; -+ ScalePlane_16(src_y, src_stride_y, src_width, src_height, dst_y, dst_stride_y, -+ dst_width, dst_height, filtering); -+ ScalePlane_16(src_u, src_stride_u, src_halfwidth, src_height, dst_u, -+ dst_stride_u, dst_halfwidth, dst_height, filtering); -+ ScalePlane_16(src_v, src_stride_v, src_halfwidth, src_height, dst_v, -+ dst_stride_v, dst_halfwidth, dst_height, filtering); -+ return 0; - } - - LIBYUV_API -@@ -2639,7 +2497,6 @@ int I422Scale_12(const uint16_t* src_y, - enum FilterMode filtering) { - int src_halfwidth = SUBSAMPLE(src_width, 1, 1); - int dst_halfwidth = SUBSAMPLE(dst_width, 1, 1); -- int r; - - if (!src_y || !src_u || !src_v || src_width <= 0 || src_height == 0 || - src_width > 32768 || src_height > 32768 || !dst_y || !dst_u || !dst_v || -@@ -2647,19 +2504,13 @@ int I422Scale_12(const uint16_t* src_y, - return -1; - } - -- r = ScalePlane_12(src_y, src_stride_y, src_width, src_height, dst_y, -- dst_stride_y, dst_width, dst_height, filtering); -- if (r != 0) { -- return r; -- } -- r = ScalePlane_12(src_u, src_stride_u, src_halfwidth, src_height, dst_u, -- dst_stride_u, dst_halfwidth, dst_height, filtering); -- if (r != 0) { -- return r; -- } -- r = ScalePlane_12(src_v, src_stride_v, src_halfwidth, src_height, dst_v, -- dst_stride_v, dst_halfwidth, dst_height, filtering); -- return r; -+ ScalePlane_12(src_y, src_stride_y, src_width, src_height, dst_y, dst_stride_y, -+ dst_width, dst_height, filtering); -+ ScalePlane_12(src_u, src_stride_u, src_halfwidth, src_height, dst_u, -+ dst_stride_u, dst_halfwidth, dst_height, filtering); -+ ScalePlane_12(src_v, src_stride_v, src_halfwidth, src_height, dst_v, -+ dst_stride_v, dst_halfwidth, dst_height, filtering); -+ return 0; - } - - // Scale an NV12 image. -@@ -2683,7 +2534,6 @@ int NV12Scale(const uint8_t* src_y, - int src_halfheight = SUBSAMPLE(src_height, 1, 1); - int dst_halfwidth = SUBSAMPLE(dst_width, 1, 1); - int dst_halfheight = SUBSAMPLE(dst_height, 1, 1); -- int r; - - if (!src_y || !src_uv || src_width <= 0 || src_height == 0 || - src_width > 32768 || src_height > 32768 || !dst_y || !dst_uv || -@@ -2691,14 +2541,11 @@ int NV12Scale(const uint8_t* src_y, - return -1; - } - -- r = ScalePlane(src_y, src_stride_y, src_width, src_height, dst_y, -- dst_stride_y, dst_width, dst_height, filtering); -- if (r != 0) { -- return r; -- } -- r = UVScale(src_uv, src_stride_uv, src_halfwidth, src_halfheight, dst_uv, -- dst_stride_uv, dst_halfwidth, dst_halfheight, filtering); -- return r; -+ ScalePlane(src_y, src_stride_y, src_width, src_height, dst_y, dst_stride_y, -+ dst_width, dst_height, filtering); -+ UVScale(src_uv, src_stride_uv, src_halfwidth, src_halfheight, dst_uv, -+ dst_stride_uv, dst_halfwidth, dst_halfheight, filtering); -+ return 0; - } - - // Deprecated api -diff --git a/media/libyuv/libyuv/source/scale_any.cc b/media/libyuv/libyuv/source/scale_any.cc ---- a/media/libyuv/libyuv/source/scale_any.cc -+++ b/media/libyuv/libyuv/source/scale_any.cc -@@ -128,22 +128,6 @@ SDODD(ScaleRowDown2Box_Odd_NEON, - 1, - 15) - #endif --#ifdef HAS_SCALEUVROWDOWN2_NEON --SDANY(ScaleUVRowDown2_Any_NEON, -- ScaleUVRowDown2_NEON, -- ScaleUVRowDown2_C, -- 2, -- 2, -- 7) --#endif --#ifdef HAS_SCALEUVROWDOWN2LINEAR_NEON --SDANY(ScaleUVRowDown2Linear_Any_NEON, -- ScaleUVRowDown2Linear_NEON, -- ScaleUVRowDown2Linear_C, -- 2, -- 2, -- 7) --#endif - #ifdef HAS_SCALEUVROWDOWN2BOX_NEON - SDANY(ScaleUVRowDown2Box_Any_NEON, - ScaleUVRowDown2Box_NEON, -diff --git a/media/libyuv/libyuv/source/scale_argb.cc b/media/libyuv/libyuv/source/scale_argb.cc ---- a/media/libyuv/libyuv/source/scale_argb.cc -+++ b/media/libyuv/libyuv/source/scale_argb.cc -@@ -16,7 +16,6 @@ - #include "libyuv/cpu_id.h" - #include "libyuv/planar_functions.h" // For CopyARGB - #include "libyuv/row.h" --#include "libyuv/scale_argb.h" - #include "libyuv/scale_row.h" - - #ifdef __cplusplus -@@ -128,15 +127,6 @@ static void ScaleARGBDown2(int src_width - } - } - #endif --#if defined(HAS_SCALEARGBROWDOWN2_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ScaleARGBRowDown2 = -- filtering == kFilterNone -- ? ScaleARGBRowDown2_RVV -- : (filtering == kFilterLinear ? ScaleARGBRowDown2Linear_RVV -- : ScaleARGBRowDown2Box_RVV); -- } --#endif - - if (filtering == kFilterLinear) { - src_stride = 0; -@@ -151,27 +141,22 @@ static void ScaleARGBDown2(int src_width - // ScaleARGB ARGB, 1/4 - // This is an optimized version for scaling down a ARGB to 1/4 of - // its original size. --static int ScaleARGBDown4Box(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint8_t* src_argb, -- uint8_t* dst_argb, -- int x, -- int dx, -- int y, -- int dy) { -+static void ScaleARGBDown4Box(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint8_t* src_argb, -+ uint8_t* dst_argb, -+ int x, -+ int dx, -+ int y, -+ int dy) { - int j; - // Allocate 2 rows of ARGB. - const int row_size = (dst_width * 2 * 4 + 31) & ~31; -- // TODO(fbarchard): Remove this row buffer and implement a ScaleARGBRowDown4 -- // but implemented via a 2 pass wrapper that uses a very small array on the -- // stack with a horizontal loop. - align_buffer_64(row, row_size * 2); -- if (!row) -- return 1; - int row_stride = src_stride * (dy >> 16); - void (*ScaleARGBRowDown2)(const uint8_t* src_argb, ptrdiff_t src_stride, - uint8_t* dst_argb, int dst_width) = -@@ -199,11 +184,6 @@ static int ScaleARGBDown4Box(int src_wid - } - } - #endif --#if defined(HAS_SCALEARGBROWDOWN2_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ScaleARGBRowDown2 = ScaleARGBRowDown2Box_RVV; -- } --#endif - - for (j = 0; j < dst_height; ++j) { - ScaleARGBRowDown2(src_argb, src_stride, row, dst_width * 2); -@@ -214,7 +194,6 @@ static int ScaleARGBDown4Box(int src_wid - dst_argb += dst_stride; - } - free_aligned_buffer_64(row); -- return 0; - } - - // ScaleARGB ARGB Even -@@ -284,16 +263,6 @@ static void ScaleARGBDownEven(int src_wi - } - } - #endif --#if defined(HAS_SCALEARGBROWDOWNEVENBOX_RVV) -- if (filtering && TestCpuFlag(kCpuHasRVV)) { -- ScaleARGBRowDownEven = ScaleARGBRowDownEvenBox_RVV; -- } --#endif --#if defined(HAS_SCALEARGBROWDOWNEVEN_RVV) -- if (!filtering && TestCpuFlag(kCpuHasRVV)) { -- ScaleARGBRowDownEven = ScaleARGBRowDownEven_RVV; -- } --#endif - - if (filtering == kFilterLinear) { - src_stride = 0; -@@ -306,19 +275,19 @@ static void ScaleARGBDownEven(int src_wi - } - - // Scale ARGB down with bilinear interpolation. --static int ScaleARGBBilinearDown(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint8_t* src_argb, -- uint8_t* dst_argb, -- int x, -- int dx, -- int y, -- int dy, -- enum FilterMode filtering) { -+static void ScaleARGBBilinearDown(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint8_t* src_argb, -+ uint8_t* dst_argb, -+ int x, -+ int dx, -+ int y, -+ int dy, -+ enum FilterMode filtering) { - int j; - void (*InterpolateRow)(uint8_t* dst_argb, const uint8_t* src_argb, - ptrdiff_t src_stride, int dst_width, -@@ -379,11 +348,6 @@ static int ScaleARGBBilinearDown(int src - } - } - #endif --#if defined(HAS_INTERPOLATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- InterpolateRow = InterpolateRow_RVV; -- } --#endif - #if defined(HAS_SCALEARGBFILTERCOLS_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3) && src_width < 32768) { - ScaleARGBFilterCols = ScaleARGBFilterCols_SSSE3; -@@ -417,8 +381,6 @@ static int ScaleARGBBilinearDown(int src - // Allocate a row of ARGB. - { - align_buffer_64(row, clip_src_width * 4); -- if (!row) -- return 1; - - const int max_y = (src_height - 1) << 16; - if (y > max_y) { -@@ -442,23 +404,22 @@ static int ScaleARGBBilinearDown(int src - } - free_aligned_buffer_64(row); - } -- return 0; - } - - // Scale ARGB up with bilinear interpolation. --static int ScaleARGBBilinearUp(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint8_t* src_argb, -- uint8_t* dst_argb, -- int x, -- int dx, -- int y, -- int dy, -- enum FilterMode filtering) { -+static void ScaleARGBBilinearUp(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint8_t* src_argb, -+ uint8_t* dst_argb, -+ int x, -+ int dx, -+ int y, -+ int dy, -+ enum FilterMode filtering) { - int j; - void (*InterpolateRow)(uint8_t* dst_argb, const uint8_t* src_argb, - ptrdiff_t src_stride, int dst_width, -@@ -507,11 +468,6 @@ static int ScaleARGBBilinearUp(int src_w - } - } - #endif --#if defined(HAS_INTERPOLATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- InterpolateRow = InterpolateRow_RVV; -- } --#endif - if (src_width >= 32768) { - ScaleARGBFilterCols = - filtering ? ScaleARGBFilterCols64_C : ScaleARGBCols64_C; -@@ -594,8 +550,6 @@ static int ScaleARGBBilinearUp(int src_w - // Allocate 2 rows of ARGB. - const int row_size = (dst_width * 4 + 31) & ~31; - align_buffer_64(row, row_size * 2); -- if (!row) -- return 1; - - uint8_t* rowptr = row; - int rowstride = row_size; -@@ -639,28 +593,27 @@ static int ScaleARGBBilinearUp(int src_w - } - free_aligned_buffer_64(row); - } -- return 0; - } - - #ifdef YUVSCALEUP - // Scale YUV to ARGB up with bilinear interpolation. --static int ScaleYUVToARGBBilinearUp(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride_y, -- int src_stride_u, -- int src_stride_v, -- int dst_stride_argb, -- const uint8_t* src_y, -- const uint8_t* src_u, -- const uint8_t* src_v, -- uint8_t* dst_argb, -- int x, -- int dx, -- int y, -- int dy, -- enum FilterMode filtering) { -+static void ScaleYUVToARGBBilinearUp(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride_y, -+ int src_stride_u, -+ int src_stride_v, -+ int dst_stride_argb, -+ const uint8_t* src_y, -+ const uint8_t* src_u, -+ const uint8_t* src_v, -+ uint8_t* dst_argb, -+ int x, -+ int dx, -+ int y, -+ int dy, -+ enum FilterMode filtering) { - int j; - void (*I422ToARGBRow)(const uint8_t* y_buf, const uint8_t* u_buf, - const uint8_t* v_buf, uint8_t* rgb_buf, int width) = -@@ -698,11 +651,6 @@ static int ScaleYUVToARGBBilinearUp(int - } - } - #endif --#if defined(HAS_I422TOARGBROW_SVE2) -- if (TestCpuFlag(kCpuHasSVE2)) { -- I422ToARGBRow = I422ToARGBRow_SVE2; -- } --#endif - #if defined(HAS_I422TOARGBROW_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - I422ToARGBRow = I422ToARGBRow_Any_MSA; -@@ -711,14 +659,6 @@ static int ScaleYUVToARGBBilinearUp(int - } - } - #endif --#if defined(HAS_I422TOARGBROW_LSX) -- if (TestCpuFlag(kCpuHasLSX)) { -- I422ToARGBRow = I422ToARGBRow_Any_LSX; -- if (IS_ALIGNED(src_width, 16)) { -- I422ToARGBRow = I422ToARGBRow_LSX; -- } -- } --#endif - #if defined(HAS_I422TOARGBROW_LASX) - if (TestCpuFlag(kCpuHasLASX)) { - I422ToARGBRow = I422ToARGBRow_Any_LASX; -@@ -727,11 +667,6 @@ static int ScaleYUVToARGBBilinearUp(int - } - } - #endif --#if defined(HAS_I422TOARGBROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- I422ToARGBRow = I422ToARGBRow_RVV; -- } --#endif - - void (*InterpolateRow)(uint8_t* dst_argb, const uint8_t* src_argb, - ptrdiff_t src_stride, int dst_width, -@@ -776,11 +711,6 @@ static int ScaleYUVToARGBBilinearUp(int - } - } - #endif --#if defined(HAS_INTERPOLATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- InterpolateRow = InterpolateRow_RVV; -- } --#endif - - void (*ScaleARGBFilterCols)(uint8_t* dst_argb, const uint8_t* src_argb, - int dst_width, int x, int dx) = -@@ -867,17 +797,16 @@ static int ScaleYUVToARGBBilinearUp(int - const uint8_t* src_row_u = src_u + uv_yi * (intptr_t)src_stride_u; - const uint8_t* src_row_v = src_v + uv_yi * (intptr_t)src_stride_v; - -- // Allocate 1 row of ARGB for source conversion and 2 rows of ARGB -- // scaled horizontally to the destination width. -+ // Allocate 2 rows of ARGB. - const int row_size = (dst_width * 4 + 31) & ~31; -- align_buffer_64(row, row_size * 2 + src_width * 4); -+ align_buffer_64(row, row_size * 2); - -- uint8_t* argb_row = row + row_size * 2; -+ // Allocate 1 row of ARGB for source conversion. -+ align_buffer_64(argb_row, src_width * 4); -+ - uint8_t* rowptr = row; - int rowstride = row_size; - int lasty = yi; -- if (!row) -- return 1; - - // TODO(fbarchard): Convert first 2 rows of YUV to ARGB. - ScaleARGBFilterCols(rowptr, src_row_y, dst_width, x, dx); -@@ -932,7 +861,7 @@ static int ScaleYUVToARGBBilinearUp(int - y += dy; - } - free_aligned_buffer_64(row); -- return 0; -+ free_aligned_buffer_64(row_argb); - } - #endif - -@@ -1007,19 +936,19 @@ static void ScaleARGBSimple(int src_widt - // ScaleARGB a ARGB. - // This function in turn calls a scaling function - // suitable for handling the desired resolutions. --static int ScaleARGB(const uint8_t* src, -- int src_stride, -- int src_width, -- int src_height, -- uint8_t* dst, -- int dst_stride, -- int dst_width, -- int dst_height, -- int clip_x, -- int clip_y, -- int clip_width, -- int clip_height, -- enum FilterMode filtering) { -+static void ScaleARGB(const uint8_t* src, -+ int src_stride, -+ int src_width, -+ int src_height, -+ uint8_t* dst, -+ int dst_stride, -+ int dst_width, -+ int dst_height, -+ int clip_x, -+ int clip_y, -+ int clip_width, -+ int clip_height, -+ enum FilterMode filtering) { - // Initial source x/y coordinate and step values as 16.16 fixed point. - int x = 0; - int y = 0; -@@ -1064,18 +993,18 @@ static int ScaleARGB(const uint8_t* src, - ScaleARGBDown2(src_width, src_height, clip_width, clip_height, - src_stride, dst_stride, src, dst, x, dx, y, dy, - filtering); -- return 0; -+ return; - } - if (dx == 0x40000 && filtering == kFilterBox) { - // Optimized 1/4 box downsample. -- return ScaleARGBDown4Box(src_width, src_height, clip_width, -- clip_height, src_stride, dst_stride, src, -- dst, x, dx, y, dy); -+ ScaleARGBDown4Box(src_width, src_height, clip_width, clip_height, -+ src_stride, dst_stride, src, dst, x, dx, y, dy); -+ return; - } - ScaleARGBDownEven(src_width, src_height, clip_width, clip_height, - src_stride, dst_stride, src, dst, x, dx, y, dy, - filtering); -- return 0; -+ return; - } - // Optimized odd scale down. ie 3, 5, 7, 9x. - if ((dx & 0x10000) && (dy & 0x10000)) { -@@ -1084,7 +1013,7 @@ static int ScaleARGB(const uint8_t* src, - // Straight copy. - ARGBCopy(src + (y >> 16) * (intptr_t)src_stride + (x >> 16) * 4, - src_stride, dst, dst_stride, clip_width, clip_height); -- return 0; -+ return; - } - } - } -@@ -1093,21 +1022,22 @@ static int ScaleARGB(const uint8_t* src, - // Arbitrary scale vertically, but unscaled horizontally. - ScalePlaneVertical(src_height, clip_width, clip_height, src_stride, - dst_stride, src, dst, x, y, dy, /*bpp=*/4, filtering); -- return 0; -+ return; - } - if (filtering && dy < 65536) { -- return ScaleARGBBilinearUp(src_width, src_height, clip_width, clip_height, -- src_stride, dst_stride, src, dst, x, dx, y, dy, -- filtering); -+ ScaleARGBBilinearUp(src_width, src_height, clip_width, clip_height, -+ src_stride, dst_stride, src, dst, x, dx, y, dy, -+ filtering); -+ return; - } - if (filtering) { -- return ScaleARGBBilinearDown(src_width, src_height, clip_width, clip_height, -- src_stride, dst_stride, src, dst, x, dx, y, dy, -- filtering); -+ ScaleARGBBilinearDown(src_width, src_height, clip_width, clip_height, -+ src_stride, dst_stride, src, dst, x, dx, y, dy, -+ filtering); -+ return; - } - ScaleARGBSimple(src_width, src_height, clip_width, clip_height, src_stride, - dst_stride, src, dst, x, dx, y, dy); -- return 0; - } - - LIBYUV_API -@@ -1131,9 +1061,10 @@ int ARGBScaleClip(const uint8_t* src_arg - (clip_y + clip_height) > dst_height) { - return -1; - } -- return ScaleARGB(src_argb, src_stride_argb, src_width, src_height, dst_argb, -- dst_stride_argb, dst_width, dst_height, clip_x, clip_y, -- clip_width, clip_height, filtering); -+ ScaleARGB(src_argb, src_stride_argb, src_width, src_height, dst_argb, -+ dst_stride_argb, dst_width, dst_height, clip_x, clip_y, clip_width, -+ clip_height, filtering); -+ return 0; - } - - // Scale an ARGB image. -@@ -1151,9 +1082,10 @@ int ARGBScale(const uint8_t* src_argb, - src_height > 32768 || !dst_argb || dst_width <= 0 || dst_height <= 0) { - return -1; - } -- return ScaleARGB(src_argb, src_stride_argb, src_width, src_height, dst_argb, -- dst_stride_argb, dst_width, dst_height, 0, 0, dst_width, -- dst_height, filtering); -+ ScaleARGB(src_argb, src_stride_argb, src_width, src_height, dst_argb, -+ dst_stride_argb, dst_width, dst_height, 0, 0, dst_width, dst_height, -+ filtering); -+ return 0; - } - - // Scale with YUV conversion to ARGB and clipping. -@@ -1177,11 +1109,8 @@ int YUVToARGBScaleClip(const uint8_t* sr - int clip_width, - int clip_height, - enum FilterMode filtering) { -+ uint8_t* argb_buffer = (uint8_t*)malloc(src_width * src_height * 4); - int r; -- uint8_t* argb_buffer = (uint8_t*)malloc(src_width * src_height * 4); -- if (!argb_buffer) { -- return 1; // Out of memory runtime error. -- } - (void)src_fourcc; // TODO(fbarchard): implement and/or assert. - (void)dst_fourcc; - I420ToARGB(src_y, src_stride_y, src_u, src_stride_u, src_v, src_stride_v, -diff --git a/media/libyuv/libyuv/source/scale_common.cc b/media/libyuv/libyuv/source/scale_common.cc ---- a/media/libyuv/libyuv/source/scale_common.cc -+++ b/media/libyuv/libyuv/source/scale_common.cc -@@ -1280,13 +1280,18 @@ void ScaleUVRowDown2_C(const uint8_t* sr - ptrdiff_t src_stride, - uint8_t* dst_uv, - int dst_width) { -+ const uint16_t* src = (const uint16_t*)(src_uv); -+ uint16_t* dst = (uint16_t*)(dst_uv); - int x; - (void)src_stride; -- for (x = 0; x < dst_width; ++x) { -- dst_uv[0] = src_uv[2]; // Store the 2nd UV -- dst_uv[1] = src_uv[3]; -- src_uv += 4; -- dst_uv += 2; -+ for (x = 0; x < dst_width - 1; x += 2) { -+ dst[0] = src[1]; -+ dst[1] = src[3]; -+ src += 2; -+ dst += 2; -+ } -+ if (dst_width & 1) { -+ dst[0] = src[1]; - } - } - -@@ -1678,12 +1683,6 @@ void ScalePlaneVertical(int src_height, - } - } - #endif --#if defined(HAS_INTERPOLATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- InterpolateRow = InterpolateRow_RVV; -- } --#endif -- - for (j = 0; j < dst_height; ++j) { - int yi; - int yf; -@@ -1964,6 +1963,35 @@ void ScaleSlope(int src_width, - } - #undef CENTERSTART - -+// Read 8x2 upsample with filtering and write 16x1. -+// actually reads an extra pixel, so 9x2. -+void ScaleRowUp2_16_C(const uint16_t* src_ptr, -+ ptrdiff_t src_stride, -+ uint16_t* dst, -+ int dst_width) { -+ const uint16_t* src2 = src_ptr + src_stride; -+ -+ int x; -+ for (x = 0; x < dst_width - 1; x += 2) { -+ uint16_t p0 = src_ptr[0]; -+ uint16_t p1 = src_ptr[1]; -+ uint16_t p2 = src2[0]; -+ uint16_t p3 = src2[1]; -+ dst[0] = (p0 * 9 + p1 * 3 + p2 * 3 + p3 + 8) >> 4; -+ dst[1] = (p0 * 3 + p1 * 9 + p2 + p3 * 3 + 8) >> 4; -+ ++src_ptr; -+ ++src2; -+ dst += 2; -+ } -+ if (dst_width & 1) { -+ uint16_t p0 = src_ptr[0]; -+ uint16_t p1 = src_ptr[1]; -+ uint16_t p2 = src2[0]; -+ uint16_t p3 = src2[1]; -+ dst[0] = (p0 * 9 + p1 * 3 + p2 * 3 + p3 + 8) >> 4; -+ } -+} -+ - #ifdef __cplusplus - } // extern "C" - } // namespace libyuv -diff --git a/media/libyuv/libyuv/source/scale_gcc.cc b/media/libyuv/libyuv/source/scale_gcc.cc ---- a/media/libyuv/libyuv/source/scale_gcc.cc -+++ b/media/libyuv/libyuv/source/scale_gcc.cc -@@ -97,7 +97,7 @@ void ScaleRowDown2_SSSE3(const uint8_t* - uint8_t* dst_ptr, - int dst_width) { - (void)src_stride; -- asm( -+ asm volatile( - // 16 pixel loop. - LABELALIGN - "1: \n" -@@ -114,8 +114,8 @@ void ScaleRowDown2_SSSE3(const uint8_t* - : "+r"(src_ptr), // %0 - "+r"(dst_ptr), // %1 - "+r"(dst_width) // %2 -- : -- : "memory", "cc", "xmm0", "xmm1"); -+ ::"memory", -+ "cc", "xmm0", "xmm1"); - } - - void ScaleRowDown2Linear_SSSE3(const uint8_t* src_ptr, -@@ -123,7 +123,8 @@ void ScaleRowDown2Linear_SSSE3(const uin - uint8_t* dst_ptr, - int dst_width) { - (void)src_stride; -- asm("pcmpeqb %%xmm4,%%xmm4 \n" -+ asm volatile( -+ "pcmpeqb %%xmm4,%%xmm4 \n" - "psrlw $0xf,%%xmm4 \n" - "packuswb %%xmm4,%%xmm4 \n" - "pxor %%xmm5,%%xmm5 \n" -@@ -145,15 +146,16 @@ void ScaleRowDown2Linear_SSSE3(const uin - : "+r"(src_ptr), // %0 - "+r"(dst_ptr), // %1 - "+r"(dst_width) // %2 -- : -- : "memory", "cc", "xmm0", "xmm1", "xmm4", "xmm5"); -+ ::"memory", -+ "cc", "xmm0", "xmm1", "xmm4", "xmm5"); - } - - void ScaleRowDown2Box_SSSE3(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm("pcmpeqb %%xmm4,%%xmm4 \n" -+ asm volatile( -+ "pcmpeqb %%xmm4,%%xmm4 \n" - "psrlw $0xf,%%xmm4 \n" - "packuswb %%xmm4,%%xmm4 \n" - "pxor %%xmm5,%%xmm5 \n" -@@ -193,7 +195,7 @@ void ScaleRowDown2_AVX2(const uint8_t* s - uint8_t* dst_ptr, - int dst_width) { - (void)src_stride; -- asm volatile (LABELALIGN -+ asm volatile(LABELALIGN - "1: \n" - "vmovdqu (%0),%%ymm0 \n" - "vmovdqu 0x20(%0),%%ymm1 \n" -@@ -207,11 +209,11 @@ void ScaleRowDown2_AVX2(const uint8_t* s - "sub $0x20,%2 \n" - "jg 1b \n" - "vzeroupper \n" -- : "+r"(src_ptr), // %0 -- "+r"(dst_ptr), // %1 -- "+r"(dst_width) // %2 -- : -- : "memory", "cc", "xmm0", "xmm1"); -+ : "+r"(src_ptr), // %0 -+ "+r"(dst_ptr), // %1 -+ "+r"(dst_width) // %2 -+ ::"memory", -+ "cc", "xmm0", "xmm1"); - } - - void ScaleRowDown2Linear_AVX2(const uint8_t* src_ptr, -@@ -219,7 +221,8 @@ void ScaleRowDown2Linear_AVX2(const uint - uint8_t* dst_ptr, - int dst_width) { - (void)src_stride; -- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" -+ asm volatile( -+ "vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" - "vpsrlw $0xf,%%ymm4,%%ymm4 \n" - "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" - "vpxor %%ymm5,%%ymm5,%%ymm5 \n" -@@ -243,15 +246,16 @@ void ScaleRowDown2Linear_AVX2(const uint - : "+r"(src_ptr), // %0 - "+r"(dst_ptr), // %1 - "+r"(dst_width) // %2 -- : -- : "memory", "cc", "xmm0", "xmm1", "xmm4", "xmm5"); -+ ::"memory", -+ "cc", "xmm0", "xmm1", "xmm4", "xmm5"); - } - - void ScaleRowDown2Box_AVX2(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" -+ asm volatile( -+ "vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" - "vpsrlw $0xf,%%ymm4,%%ymm4 \n" - "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" - "vpxor %%ymm5,%%ymm5,%%ymm5 \n" -@@ -293,7 +297,8 @@ void ScaleRowDown4_SSSE3(const uint8_t* - uint8_t* dst_ptr, - int dst_width) { - (void)src_stride; -- asm("pcmpeqb %%xmm5,%%xmm5 \n" -+ asm volatile( -+ "pcmpeqb %%xmm5,%%xmm5 \n" - "psrld $0x18,%%xmm5 \n" - "pslld $0x10,%%xmm5 \n" - -@@ -314,8 +319,8 @@ void ScaleRowDown4_SSSE3(const uint8_t* - : "+r"(src_ptr), // %0 - "+r"(dst_ptr), // %1 - "+r"(dst_width) // %2 -- : -- : "memory", "cc", "xmm0", "xmm1", "xmm5"); -+ ::"memory", -+ "cc", "xmm0", "xmm1", "xmm5"); - } - - void ScaleRowDown4Box_SSSE3(const uint8_t* src_ptr, -@@ -323,7 +328,8 @@ void ScaleRowDown4Box_SSSE3(const uint8_ - uint8_t* dst_ptr, - int dst_width) { - intptr_t stridex3; -- asm("pcmpeqb %%xmm4,%%xmm4 \n" -+ asm volatile( -+ "pcmpeqb %%xmm4,%%xmm4 \n" - "psrlw $0xf,%%xmm4 \n" - "movdqa %%xmm4,%%xmm5 \n" - "packuswb %%xmm4,%%xmm4 \n" -@@ -377,7 +383,8 @@ void ScaleRowDown4_AVX2(const uint8_t* s - uint8_t* dst_ptr, - int dst_width) { - (void)src_stride; -- asm("vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -+ asm volatile( -+ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" - "vpsrld $0x18,%%ymm5,%%ymm5 \n" - "vpslld $0x10,%%ymm5,%%ymm5 \n" - -@@ -401,15 +408,16 @@ void ScaleRowDown4_AVX2(const uint8_t* s - : "+r"(src_ptr), // %0 - "+r"(dst_ptr), // %1 - "+r"(dst_width) // %2 -- : -- : "memory", "cc", "xmm0", "xmm1", "xmm5"); -+ ::"memory", -+ "cc", "xmm0", "xmm1", "xmm5"); - } - - void ScaleRowDown4Box_AVX2(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" -+ asm volatile( -+ "vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" - "vpsrlw $0xf,%%ymm4,%%ymm4 \n" - "vpsllw $0x3,%%ymm4,%%ymm5 \n" - "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" -@@ -464,7 +472,8 @@ void ScaleRowDown34_SSSE3(const uint8_t* - uint8_t* dst_ptr, - int dst_width) { - (void)src_stride; -- asm("movdqa %0,%%xmm3 \n" -+ asm volatile( -+ "movdqa %0,%%xmm3 \n" - "movdqa %1,%%xmm4 \n" - "movdqa %2,%%xmm5 \n" - : -@@ -472,7 +481,7 @@ void ScaleRowDown34_SSSE3(const uint8_t* - "m"(kShuf1), // %1 - "m"(kShuf2) // %2 - ); -- asm volatile (LABELALIGN -+ asm volatile(LABELALIGN - "1: \n" - "movdqu (%0),%%xmm0 \n" - "movdqu 0x10(%0),%%xmm2 \n" -@@ -488,18 +497,19 @@ void ScaleRowDown34_SSSE3(const uint8_t* - "lea 0x18(%1),%1 \n" - "sub $0x18,%2 \n" - "jg 1b \n" -- : "+r"(src_ptr), // %0 -- "+r"(dst_ptr), // %1 -- "+r"(dst_width) // %2 -- : -- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5"); -+ : "+r"(src_ptr), // %0 -+ "+r"(dst_ptr), // %1 -+ "+r"(dst_width) // %2 -+ ::"memory", -+ "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5"); - } - - void ScaleRowDown34_1_Box_SSSE3(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm("movdqa %0,%%xmm2 \n" // kShuf01 -+ asm volatile( -+ "movdqa %0,%%xmm2 \n" // kShuf01 - "movdqa %1,%%xmm3 \n" // kShuf11 - "movdqa %2,%%xmm4 \n" // kShuf21 - : -@@ -507,7 +517,8 @@ void ScaleRowDown34_1_Box_SSSE3(const ui - "m"(kShuf11), // %1 - "m"(kShuf21) // %2 - ); -- asm("movdqa %0,%%xmm5 \n" // kMadd01 -+ asm volatile( -+ "movdqa %0,%%xmm5 \n" // kMadd01 - "movdqa %1,%%xmm0 \n" // kMadd11 - "movdqa %2,%%xmm1 \n" // kRound34 - : -@@ -515,7 +526,7 @@ void ScaleRowDown34_1_Box_SSSE3(const ui - "m"(kMadd11), // %1 - "m"(kRound34) // %2 - ); -- asm volatile (LABELALIGN -+ asm volatile(LABELALIGN - "1: \n" - "movdqu (%0),%%xmm6 \n" - "movdqu 0x00(%0,%3,1),%%xmm7 \n" -@@ -548,20 +559,21 @@ void ScaleRowDown34_1_Box_SSSE3(const ui - "lea 0x18(%1),%1 \n" - "sub $0x18,%2 \n" - "jg 1b \n" -- : "+r"(src_ptr), // %0 -- "+r"(dst_ptr), // %1 -- "+r"(dst_width) // %2 -- : "r"((intptr_t)(src_stride)), // %3 -- "m"(kMadd21) // %4 -- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", -- "xmm7"); -+ : "+r"(src_ptr), // %0 -+ "+r"(dst_ptr), // %1 -+ "+r"(dst_width) // %2 -+ : "r"((intptr_t)(src_stride)), // %3 -+ "m"(kMadd21) // %4 -+ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", -+ "xmm6", "xmm7"); - } - - void ScaleRowDown34_0_Box_SSSE3(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm("movdqa %0,%%xmm2 \n" // kShuf01 -+ asm volatile( -+ "movdqa %0,%%xmm2 \n" // kShuf01 - "movdqa %1,%%xmm3 \n" // kShuf11 - "movdqa %2,%%xmm4 \n" // kShuf21 - : -@@ -569,7 +581,8 @@ void ScaleRowDown34_0_Box_SSSE3(const ui - "m"(kShuf11), // %1 - "m"(kShuf21) // %2 - ); -- asm("movdqa %0,%%xmm5 \n" // kMadd01 -+ asm volatile( -+ "movdqa %0,%%xmm5 \n" // kMadd01 - "movdqa %1,%%xmm0 \n" // kMadd11 - "movdqa %2,%%xmm1 \n" // kRound34 - : -@@ -578,7 +591,7 @@ void ScaleRowDown34_0_Box_SSSE3(const ui - "m"(kRound34) // %2 - ); - -- asm volatile (LABELALIGN -+ asm volatile(LABELALIGN - "1: \n" - "movdqu (%0),%%xmm6 \n" - "movdqu 0x00(%0,%3,1),%%xmm7 \n" -@@ -614,13 +627,13 @@ void ScaleRowDown34_0_Box_SSSE3(const ui - "lea 0x18(%1),%1 \n" - "sub $0x18,%2 \n" - "jg 1b \n" -- : "+r"(src_ptr), // %0 -- "+r"(dst_ptr), // %1 -- "+r"(dst_width) // %2 -- : "r"((intptr_t)(src_stride)), // %3 -- "m"(kMadd21) // %4 -- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", -- "xmm7"); -+ : "+r"(src_ptr), // %0 -+ "+r"(dst_ptr), // %1 -+ "+r"(dst_width) // %2 -+ : "r"((intptr_t)(src_stride)), // %3 -+ "m"(kMadd21) // %4 -+ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", -+ "xmm6", "xmm7"); - } - - void ScaleRowDown38_SSSE3(const uint8_t* src_ptr, -@@ -628,7 +641,8 @@ void ScaleRowDown38_SSSE3(const uint8_t* - uint8_t* dst_ptr, - int dst_width) { - (void)src_stride; -- asm("movdqa %3,%%xmm4 \n" -+ asm volatile( -+ "movdqa %3,%%xmm4 \n" - "movdqa %4,%%xmm5 \n" - - LABELALIGN -@@ -657,7 +671,8 @@ void ScaleRowDown38_2_Box_SSSE3(const ui - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm("movdqa %0,%%xmm2 \n" -+ asm volatile( -+ "movdqa %0,%%xmm2 \n" - "movdqa %1,%%xmm3 \n" - "movdqa %2,%%xmm4 \n" - "movdqa %3,%%xmm5 \n" -@@ -667,7 +682,7 @@ void ScaleRowDown38_2_Box_SSSE3(const ui - "m"(kShufAb2), // %2 - "m"(kScaleAb2) // %3 - ); -- asm volatile (LABELALIGN -+ asm volatile(LABELALIGN - "1: \n" - "movdqu (%0),%%xmm0 \n" - "movdqu 0x00(%0,%3,1),%%xmm1 \n" -@@ -688,18 +703,20 @@ void ScaleRowDown38_2_Box_SSSE3(const ui - "lea 0x6(%1),%1 \n" - "sub $0x6,%2 \n" - "jg 1b \n" -- : "+r"(src_ptr), // %0 -- "+r"(dst_ptr), // %1 -- "+r"(dst_width) // %2 -- : "r"((intptr_t)(src_stride)) // %3 -- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6"); -+ : "+r"(src_ptr), // %0 -+ "+r"(dst_ptr), // %1 -+ "+r"(dst_width) // %2 -+ : "r"((intptr_t)(src_stride)) // %3 -+ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", -+ "xmm6"); - } - - void ScaleRowDown38_3_Box_SSSE3(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm("movdqa %0,%%xmm2 \n" -+ asm volatile( -+ "movdqa %0,%%xmm2 \n" - "movdqa %1,%%xmm3 \n" - "movdqa %2,%%xmm4 \n" - "pxor %%xmm5,%%xmm5 \n" -@@ -708,7 +725,7 @@ void ScaleRowDown38_3_Box_SSSE3(const ui - "m"(kShufAc3), // %1 - "m"(kScaleAc33) // %2 - ); -- asm volatile (LABELALIGN -+ asm volatile(LABELALIGN - "1: \n" - "movdqu (%0),%%xmm0 \n" - "movdqu 0x00(%0,%3,1),%%xmm6 \n" -@@ -748,12 +765,12 @@ void ScaleRowDown38_3_Box_SSSE3(const ui - "lea 0x6(%1),%1 \n" - "sub $0x6,%2 \n" - "jg 1b \n" -- : "+r"(src_ptr), // %0 -- "+r"(dst_ptr), // %1 -- "+r"(dst_width) // %2 -- : "r"((intptr_t)(src_stride)) // %3 -- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", -- "xmm7"); -+ : "+r"(src_ptr), // %0 -+ "+r"(dst_ptr), // %1 -+ "+r"(dst_width) // %2 -+ : "r"((intptr_t)(src_stride)) // %3 -+ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", -+ "xmm6", "xmm7"); - } - - static const uvec8 kLinearShuffleFar = {2, 3, 0, 1, 6, 7, 4, 5, -@@ -766,7 +783,8 @@ static const uvec8 kLinearMadd31 = {3, 1 - void ScaleRowUp2_Linear_SSE2(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int dst_width) { -- asm("pxor %%xmm0,%%xmm0 \n" // 0 -+ asm volatile( -+ "pxor %%xmm0,%%xmm0 \n" // 0 - "pcmpeqw %%xmm6,%%xmm6 \n" - "psrlw $15,%%xmm6 \n" - "psllw $1,%%xmm6 \n" // all 2 -@@ -821,7 +839,8 @@ void ScaleRowUp2_Bilinear_SSE2(const uin - uint8_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width) { -- asm volatile (LABELALIGN -+ asm volatile( -+ LABELALIGN - "1: \n" - "pxor %%xmm0,%%xmm0 \n" // 0 - // above line -@@ -934,7 +953,8 @@ void ScaleRowUp2_Bilinear_SSE2(const uin - void ScaleRowUp2_Linear_12_SSSE3(const uint16_t* src_ptr, - uint16_t* dst_ptr, - int dst_width) { -- asm("movdqa %3,%%xmm5 \n" -+ asm volatile( -+ "movdqa %3,%%xmm5 \n" - "pcmpeqw %%xmm4,%%xmm4 \n" - "psrlw $15,%%xmm4 \n" - "psllw $1,%%xmm4 \n" // all 2 -@@ -985,7 +1005,8 @@ void ScaleRowUp2_Bilinear_12_SSSE3(const - uint16_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width) { -- asm("pcmpeqw %%xmm7,%%xmm7 \n" -+ asm volatile( -+ "pcmpeqw %%xmm7,%%xmm7 \n" - "psrlw $15,%%xmm7 \n" - "psllw $3,%%xmm7 \n" // all 8 - "movdqa %5,%%xmm6 \n" -@@ -1082,7 +1103,8 @@ void ScaleRowUp2_Bilinear_12_SSSE3(const - void ScaleRowUp2_Linear_16_SSE2(const uint16_t* src_ptr, - uint16_t* dst_ptr, - int dst_width) { -- asm("pxor %%xmm5,%%xmm5 \n" -+ asm volatile( -+ "pxor %%xmm5,%%xmm5 \n" - "pcmpeqd %%xmm4,%%xmm4 \n" - "psrld $31,%%xmm4 \n" - "pslld $1,%%xmm4 \n" // all 2 -@@ -1134,7 +1156,8 @@ void ScaleRowUp2_Bilinear_16_SSE2(const - uint16_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width) { -- asm("pxor %%xmm7,%%xmm7 \n" -+ asm volatile( -+ "pxor %%xmm7,%%xmm7 \n" - "pcmpeqd %%xmm6,%%xmm6 \n" - "psrld $31,%%xmm6 \n" - "pslld $3,%%xmm6 \n" // all 8 -@@ -1241,7 +1264,8 @@ void ScaleRowUp2_Bilinear_16_SSE2(const - void ScaleRowUp2_Linear_SSSE3(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int dst_width) { -- asm("pcmpeqw %%xmm4,%%xmm4 \n" -+ asm volatile( -+ "pcmpeqw %%xmm4,%%xmm4 \n" - "psrlw $15,%%xmm4 \n" - "psllw $1,%%xmm4 \n" // all 2 - "movdqa %3,%%xmm3 \n" -@@ -1281,7 +1305,8 @@ void ScaleRowUp2_Bilinear_SSSE3(const ui - uint8_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width) { -- asm("pcmpeqw %%xmm6,%%xmm6 \n" -+ asm volatile( -+ "pcmpeqw %%xmm6,%%xmm6 \n" - "psrlw $15,%%xmm6 \n" - "psllw $3,%%xmm6 \n" // all 8 - "movdqa %5,%%xmm7 \n" -@@ -1365,7 +1390,8 @@ void ScaleRowUp2_Bilinear_SSSE3(const ui - void ScaleRowUp2_Linear_AVX2(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int dst_width) { -- asm("vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" -+ asm volatile( -+ "vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" - "vpsrlw $15,%%ymm4,%%ymm4 \n" - "vpsllw $1,%%ymm4,%%ymm4 \n" // all 2 - "vbroadcastf128 %3,%%ymm3 \n" -@@ -1408,7 +1434,8 @@ void ScaleRowUp2_Bilinear_AVX2(const uin - uint8_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width) { -- asm("vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" -+ asm volatile( -+ "vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" - "vpsrlw $15,%%ymm6,%%ymm6 \n" - "vpsllw $3,%%ymm6,%%ymm6 \n" // all 8 - "vbroadcastf128 %5,%%ymm7 \n" -@@ -1489,7 +1516,8 @@ void ScaleRowUp2_Bilinear_AVX2(const uin - void ScaleRowUp2_Linear_12_AVX2(const uint16_t* src_ptr, - uint16_t* dst_ptr, - int dst_width) { -- asm("vbroadcastf128 %3,%%ymm5 \n" -+ asm volatile( -+ "vbroadcastf128 %3,%%ymm5 \n" - "vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" - "vpsrlw $15,%%ymm4,%%ymm4 \n" - "vpsllw $1,%%ymm4,%%ymm4 \n" // all 2 -@@ -1540,7 +1568,8 @@ void ScaleRowUp2_Bilinear_12_AVX2(const - uint16_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width) { -- asm("vbroadcastf128 %5,%%ymm5 \n" -+ asm volatile( -+ "vbroadcastf128 %5,%%ymm5 \n" - "vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" - "vpsrlw $15,%%ymm4,%%ymm4 \n" - "vpsllw $3,%%ymm4,%%ymm4 \n" // all 8 -@@ -1601,7 +1630,8 @@ void ScaleRowUp2_Bilinear_12_AVX2(const - void ScaleRowUp2_Linear_16_AVX2(const uint16_t* src_ptr, - uint16_t* dst_ptr, - int dst_width) { -- asm("vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" -+ asm volatile( -+ "vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" - "vpsrld $31,%%ymm4,%%ymm4 \n" - "vpslld $1,%%ymm4,%%ymm4 \n" // all 2 - -@@ -1650,7 +1680,8 @@ void ScaleRowUp2_Bilinear_16_AVX2(const - uint16_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width) { -- asm("vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" -+ asm volatile( -+ "vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" - "vpsrld $31,%%ymm6,%%ymm6 \n" - "vpslld $3,%%ymm6,%%ymm6 \n" // all 8 - -@@ -1732,10 +1763,10 @@ void ScaleRowUp2_Bilinear_16_AVX2(const - void ScaleAddRow_SSE2(const uint8_t* src_ptr, - uint16_t* dst_ptr, - int src_width) { -- asm("pxor %%xmm5,%%xmm5 \n" -+ asm volatile("pxor %%xmm5,%%xmm5 \n" - -- // 16 pixel loop. -- LABELALIGN -+ // 16 pixel loop. -+ LABELALIGN - "1: \n" - "movdqu (%0),%%xmm3 \n" - "lea 0x10(%0),%0 \n" // src_ptr += 16 -@@ -1751,11 +1782,11 @@ void ScaleAddRow_SSE2(const uint8_t* src - "lea 0x20(%1),%1 \n" - "sub $0x10,%2 \n" - "jg 1b \n" -- : "+r"(src_ptr), // %0 -- "+r"(dst_ptr), // %1 -- "+r"(src_width) // %2 -- : -- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm5"); -+ : "+r"(src_ptr), // %0 -+ "+r"(dst_ptr), // %1 -+ "+r"(src_width) // %2 -+ : -+ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm5"); - } - - #ifdef HAS_SCALEADDROW_AVX2 -@@ -1763,9 +1794,9 @@ void ScaleAddRow_SSE2(const uint8_t* src - void ScaleAddRow_AVX2(const uint8_t* src_ptr, - uint16_t* dst_ptr, - int src_width) { -- asm("vpxor %%ymm5,%%ymm5,%%ymm5 \n" -+ asm volatile("vpxor %%ymm5,%%ymm5,%%ymm5 \n" - -- LABELALIGN -+ LABELALIGN - "1: \n" - "vmovdqu (%0),%%ymm3 \n" - "lea 0x20(%0),%0 \n" // src_ptr += 32 -@@ -1780,11 +1811,11 @@ void ScaleAddRow_AVX2(const uint8_t* src - "sub $0x20,%2 \n" - "jg 1b \n" - "vzeroupper \n" -- : "+r"(src_ptr), // %0 -- "+r"(dst_ptr), // %1 -- "+r"(src_width) // %2 -- : -- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm5"); -+ : "+r"(src_ptr), // %0 -+ "+r"(dst_ptr), // %1 -+ "+r"(src_width) // %2 -+ : -+ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm5"); - } - #endif // HAS_SCALEADDROW_AVX2 - -@@ -1804,7 +1835,8 @@ void ScaleFilterCols_SSSE3(uint8_t* dst_ - int x, - int dx) { - intptr_t x0, x1, temp_pixel; -- asm("movd %6,%%xmm2 \n" -+ asm volatile( -+ "movd %6,%%xmm2 \n" - "movd %7,%%xmm3 \n" - "movl $0x04040000,%k2 \n" - "movd %k2,%%xmm5 \n" -@@ -1900,7 +1932,7 @@ void ScaleColsUp2_SSE2(uint8_t* dst_ptr, - int dx) { - (void)x; - (void)dx; -- asm volatile (LABELALIGN -+ asm volatile(LABELALIGN - "1: \n" - "movdqu (%1),%%xmm0 \n" - "lea 0x10(%1),%1 \n" -@@ -1913,11 +1945,11 @@ void ScaleColsUp2_SSE2(uint8_t* dst_ptr, - "sub $0x20,%2 \n" - "jg 1b \n" - -- : "+r"(dst_ptr), // %0 -- "+r"(src_ptr), // %1 -- "+r"(dst_width) // %2 -- : -- : "memory", "cc", "xmm0", "xmm1"); -+ : "+r"(dst_ptr), // %0 -+ "+r"(src_ptr), // %1 -+ "+r"(dst_width) // %2 -+ ::"memory", -+ "cc", "xmm0", "xmm1"); - } - - void ScaleARGBRowDown2_SSE2(const uint8_t* src_argb, -@@ -1925,7 +1957,7 @@ void ScaleARGBRowDown2_SSE2(const uint8_ - uint8_t* dst_argb, - int dst_width) { - (void)src_stride; -- asm volatile (LABELALIGN -+ asm volatile(LABELALIGN - "1: \n" - "movdqu (%0),%%xmm0 \n" - "movdqu 0x10(%0),%%xmm1 \n" -@@ -1935,11 +1967,11 @@ void ScaleARGBRowDown2_SSE2(const uint8_ - "lea 0x10(%1),%1 \n" - "sub $0x4,%2 \n" - "jg 1b \n" -- : "+r"(src_argb), // %0 -- "+r"(dst_argb), // %1 -- "+r"(dst_width) // %2 -- : -- : "memory", "cc", "xmm0", "xmm1"); -+ : "+r"(src_argb), // %0 -+ "+r"(dst_argb), // %1 -+ "+r"(dst_width) // %2 -+ ::"memory", -+ "cc", "xmm0", "xmm1"); - } - - void ScaleARGBRowDown2Linear_SSE2(const uint8_t* src_argb, -@@ -1947,7 +1979,7 @@ void ScaleARGBRowDown2Linear_SSE2(const - uint8_t* dst_argb, - int dst_width) { - (void)src_stride; -- asm volatile (LABELALIGN -+ asm volatile(LABELALIGN - "1: \n" - "movdqu (%0),%%xmm0 \n" - "movdqu 0x10(%0),%%xmm1 \n" -@@ -1960,18 +1992,18 @@ void ScaleARGBRowDown2Linear_SSE2(const - "lea 0x10(%1),%1 \n" - "sub $0x4,%2 \n" - "jg 1b \n" -- : "+r"(src_argb), // %0 -- "+r"(dst_argb), // %1 -- "+r"(dst_width) // %2 -- : -- : "memory", "cc", "xmm0", "xmm1"); -+ : "+r"(src_argb), // %0 -+ "+r"(dst_argb), // %1 -+ "+r"(dst_width) // %2 -+ ::"memory", -+ "cc", "xmm0", "xmm1"); - } - - void ScaleARGBRowDown2Box_SSE2(const uint8_t* src_argb, - ptrdiff_t src_stride, - uint8_t* dst_argb, - int dst_width) { -- asm volatile (LABELALIGN -+ asm volatile(LABELALIGN - "1: \n" - "movdqu (%0),%%xmm0 \n" - "movdqu 0x10(%0),%%xmm1 \n" -@@ -1988,11 +2020,11 @@ void ScaleARGBRowDown2Box_SSE2(const uin - "lea 0x10(%1),%1 \n" - "sub $0x4,%2 \n" - "jg 1b \n" -- : "+r"(src_argb), // %0 -- "+r"(dst_argb), // %1 -- "+r"(dst_width) // %2 -- : "r"((intptr_t)(src_stride)) // %3 -- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3"); -+ : "+r"(src_argb), // %0 -+ "+r"(dst_argb), // %1 -+ "+r"(dst_width) // %2 -+ : "r"((intptr_t)(src_stride)) // %3 -+ : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3"); - } - - // Reads 4 pixels at a time. -@@ -2005,7 +2037,8 @@ void ScaleARGBRowDownEven_SSE2(const uin - intptr_t src_stepx_x4 = (intptr_t)(src_stepx); - intptr_t src_stepx_x12; - (void)src_stride; -- asm("lea 0x00(,%1,4),%1 \n" -+ asm volatile( -+ "lea 0x00(,%1,4),%1 \n" - "lea 0x00(%1,%1,2),%4 \n" - - LABELALIGN -@@ -2027,8 +2060,8 @@ void ScaleARGBRowDownEven_SSE2(const uin - "+r"(dst_argb), // %2 - "+r"(dst_width), // %3 - "=&r"(src_stepx_x12) // %4 -- : -- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3"); -+ ::"memory", -+ "cc", "xmm0", "xmm1", "xmm2", "xmm3"); - } - - // Blends four 2x2 to 4x1. -@@ -2041,7 +2074,8 @@ void ScaleARGBRowDownEvenBox_SSE2(const - intptr_t src_stepx_x4 = (intptr_t)(src_stepx); - intptr_t src_stepx_x12; - intptr_t row1 = (intptr_t)(src_stride); -- asm("lea 0x00(,%1,4),%1 \n" -+ asm volatile( -+ "lea 0x00(,%1,4),%1 \n" - "lea 0x00(%1,%1,2),%4 \n" - "lea 0x00(%0,%5,1),%5 \n" - -@@ -2073,8 +2107,8 @@ void ScaleARGBRowDownEvenBox_SSE2(const - "+rm"(dst_width), // %3 - "=&r"(src_stepx_x12), // %4 - "+r"(row1) // %5 -- : -- : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3"); -+ ::"memory", -+ "cc", "xmm0", "xmm1", "xmm2", "xmm3"); - } - - void ScaleARGBCols_SSE2(uint8_t* dst_argb, -@@ -2083,7 +2117,8 @@ void ScaleARGBCols_SSE2(uint8_t* dst_arg - int x, - int dx) { - intptr_t x0, x1; -- asm("movd %5,%%xmm2 \n" -+ asm volatile( -+ "movd %5,%%xmm2 \n" - "movd %6,%%xmm3 \n" - "pshufd $0x0,%%xmm2,%%xmm2 \n" - "pshufd $0x11,%%xmm3,%%xmm0 \n" -@@ -2153,7 +2188,7 @@ void ScaleARGBColsUp2_SSE2(uint8_t* dst_ - int dx) { - (void)x; - (void)dx; -- asm volatile (LABELALIGN -+ asm volatile(LABELALIGN - "1: \n" - "movdqu (%1),%%xmm0 \n" - "lea 0x10(%1),%1 \n" -@@ -2166,11 +2201,11 @@ void ScaleARGBColsUp2_SSE2(uint8_t* dst_ - "sub $0x8,%2 \n" - "jg 1b \n" - -- : "+r"(dst_argb), // %0 -- "+r"(src_argb), // %1 -- "+r"(dst_width) // %2 -- : -- : "memory", "cc", "xmm0", "xmm1"); -+ : "+r"(dst_argb), // %0 -+ "+r"(src_argb), // %1 -+ "+r"(dst_width) // %2 -+ ::"memory", -+ "cc", "xmm0", "xmm1"); - } - - // Shuffle table for arranging 2 pixels into pairs for pmaddubsw -@@ -2191,14 +2226,16 @@ void ScaleARGBFilterCols_SSSE3(uint8_t* - int x, - int dx) { - intptr_t x0, x1; -- asm("movdqa %0,%%xmm4 \n" -+ asm volatile( -+ "movdqa %0,%%xmm4 \n" - "movdqa %1,%%xmm5 \n" - : - : "m"(kShuffleColARGB), // %0 - "m"(kShuffleFractions) // %1 - ); - -- asm("movd %5,%%xmm2 \n" -+ asm volatile( -+ "movd %5,%%xmm2 \n" - "movd %6,%%xmm3 \n" - "pcmpeqb %%xmm6,%%xmm6 \n" - "psrlw $0x9,%%xmm6 \n" -@@ -2246,7 +2283,8 @@ void ScaleARGBFilterCols_SSSE3(uint8_t* - "packuswb %%xmm0,%%xmm0 \n" - "movd %%xmm0,(%0) \n" - -- LABELALIGN "99: \n" -+ LABELALIGN -+ "99: \n" // clang-format error. - - : "+r"(dst_argb), // %0 - "+r"(src_argb), // %1 -@@ -2260,7 +2298,8 @@ void ScaleARGBFilterCols_SSSE3(uint8_t* - - // Divide num by div and return as 16.16 fixed point result. - int FixedDiv_X86(int num, int div) { -- asm("cdq \n" -+ asm volatile( -+ "cdq \n" - "shld $0x10,%%eax,%%edx \n" - "shl $0x10,%%eax \n" - "idiv %1 \n" -@@ -2273,7 +2312,8 @@ int FixedDiv_X86(int num, int div) { - - // Divide num - 1 by div - 1 and return as 16.16 fixed point result. - int FixedDiv1_X86(int num, int div) { -- asm("cdq \n" -+ asm volatile( -+ "cdq \n" - "shld $0x10,%%eax,%%edx \n" - "shl $0x10,%%eax \n" - "sub $0x10001,%%eax \n" -@@ -2304,7 +2344,8 @@ void ScaleUVRowDown2Box_SSSE3(const uint - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm("pcmpeqb %%xmm4,%%xmm4 \n" // 01010101 -+ asm volatile( -+ "pcmpeqb %%xmm4,%%xmm4 \n" // 01010101 - "psrlw $0xf,%%xmm4 \n" - "packuswb %%xmm4,%%xmm4 \n" - "pxor %%xmm5, %%xmm5 \n" // zero -@@ -2343,7 +2384,8 @@ void ScaleUVRowDown2Box_AVX2(const uint8 - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" // 01010101 -+ asm volatile( -+ "vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" // 01010101 - "vpsrlw $0xf,%%ymm4,%%ymm4 \n" - "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" - "vpxor %%ymm5,%%ymm5,%%ymm5 \n" // zero -@@ -2386,7 +2428,8 @@ static const uvec8 kUVLinearMadd31 = {3, - void ScaleUVRowUp2_Linear_SSSE3(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int dst_width) { -- asm("pcmpeqw %%xmm4,%%xmm4 \n" -+ asm volatile( -+ "pcmpeqw %%xmm4,%%xmm4 \n" - "psrlw $15,%%xmm4 \n" - "psllw $1,%%xmm4 \n" // all 2 - "movdqa %3,%%xmm3 \n" -@@ -2426,7 +2469,8 @@ void ScaleUVRowUp2_Bilinear_SSSE3(const - uint8_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width) { -- asm("pcmpeqw %%xmm6,%%xmm6 \n" -+ asm volatile( -+ "pcmpeqw %%xmm6,%%xmm6 \n" - "psrlw $15,%%xmm6 \n" - "psllw $3,%%xmm6 \n" // all 8 - "movdqa %5,%%xmm7 \n" -@@ -2509,7 +2553,8 @@ void ScaleUVRowUp2_Bilinear_SSSE3(const - void ScaleUVRowUp2_Linear_AVX2(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int dst_width) { -- asm("vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" -+ asm volatile( -+ "vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" - "vpsrlw $15,%%ymm4,%%ymm4 \n" - "vpsllw $1,%%ymm4,%%ymm4 \n" // all 2 - "vbroadcastf128 %3,%%ymm3 \n" -@@ -2551,7 +2596,8 @@ void ScaleUVRowUp2_Bilinear_AVX2(const u - uint8_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width) { -- asm("vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" -+ asm volatile( -+ "vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" - "vpsrlw $15,%%ymm6,%%ymm6 \n" - "vpsllw $3,%%ymm6,%%ymm6 \n" // all 8 - "vbroadcastf128 %5,%%ymm7 \n" -@@ -2630,7 +2676,8 @@ void ScaleUVRowUp2_Bilinear_AVX2(const u - void ScaleUVRowUp2_Linear_16_SSE41(const uint16_t* src_ptr, - uint16_t* dst_ptr, - int dst_width) { -- asm("pxor %%xmm5,%%xmm5 \n" -+ asm volatile( -+ "pxor %%xmm5,%%xmm5 \n" - "pcmpeqd %%xmm4,%%xmm4 \n" - "psrld $31,%%xmm4 \n" - "pslld $1,%%xmm4 \n" // all 2 -@@ -2681,7 +2728,8 @@ void ScaleUVRowUp2_Bilinear_16_SSE41(con - uint16_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width) { -- asm("pxor %%xmm7,%%xmm7 \n" -+ asm volatile( -+ "pxor %%xmm7,%%xmm7 \n" - "pcmpeqd %%xmm6,%%xmm6 \n" - "psrld $31,%%xmm6 \n" - "pslld $3,%%xmm6 \n" // all 8 -@@ -2771,7 +2819,8 @@ void ScaleUVRowUp2_Bilinear_16_SSE41(con - void ScaleUVRowUp2_Linear_16_AVX2(const uint16_t* src_ptr, - uint16_t* dst_ptr, - int dst_width) { -- asm("vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" -+ asm volatile( -+ "vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" - "vpsrld $31,%%ymm4,%%ymm4 \n" - "vpslld $1,%%ymm4,%%ymm4 \n" // all 2 - -@@ -2819,7 +2868,8 @@ void ScaleUVRowUp2_Bilinear_16_AVX2(cons - uint16_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width) { -- asm("vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" -+ asm volatile( -+ "vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" - "vpsrld $31,%%ymm6,%%ymm6 \n" - "vpslld $3,%%ymm6,%%ymm6 \n" // all 8 - -diff --git a/media/libyuv/libyuv/source/scale_neon.cc b/media/libyuv/libyuv/source/scale_neon.cc ---- a/media/libyuv/libyuv/source/scale_neon.cc -+++ b/media/libyuv/libyuv/source/scale_neon.cc -@@ -28,7 +28,7 @@ void ScaleRowDown2_NEON(const uint8_t* s - uint8_t* dst, - int dst_width) { - (void)src_stride; -- asm volatile ( -+ asm volatile( - "1: \n" - // load even pixels into q0, odd into q1 - "vld2.8 {q0, q1}, [%0]! \n" -@@ -49,7 +49,7 @@ void ScaleRowDown2Linear_NEON(const uint - uint8_t* dst, - int dst_width) { - (void)src_stride; -- asm volatile ( -+ asm volatile( - "1: \n" - "vld2.8 {q0, q1}, [%0]! \n" // load 32 pixels - "subs %2, %2, #16 \n" // 16 processed per loop -@@ -69,7 +69,7 @@ void ScaleRowDown2Box_NEON(const uint8_t - ptrdiff_t src_stride, - uint8_t* dst, - int dst_width) { -- asm volatile ( -+ asm volatile( - // change the stride to row 2 pointer - "add %1, %0 \n" - "1: \n" -@@ -100,7 +100,7 @@ void ScaleRowDown4_NEON(const uint8_t* s - uint8_t* dst_ptr, - int dst_width) { - (void)src_stride; -- asm volatile ( -+ asm volatile( - "1: \n" - "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // src line 0 - "subs %2, %2, #8 \n" // 8 processed per loop -@@ -120,7 +120,7 @@ void ScaleRowDown4Box_NEON(const uint8_t - const uint8_t* src_ptr1 = src_ptr + src_stride; - const uint8_t* src_ptr2 = src_ptr + src_stride * 2; - const uint8_t* src_ptr3 = src_ptr + src_stride * 3; -- asm volatile ( -+ asm volatile( - "1: \n" - "vld1.8 {q0}, [%0]! \n" // load up 16x4 - "vld1.8 {q1}, [%3]! \n" -@@ -154,7 +154,7 @@ void ScaleRowDown34_NEON(const uint8_t* - uint8_t* dst_ptr, - int dst_width) { - (void)src_stride; -- asm volatile ( -+ asm volatile( - "1: \n" - "vld4.8 {d0, d1, d2, d3}, [%0]! \n" // src line 0 - "subs %2, %2, #24 \n" -@@ -172,7 +172,7 @@ void ScaleRowDown34_0_Box_NEON(const uin - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm volatile ( -+ asm volatile( - "vmov.u8 d24, #3 \n" - "add %3, %0 \n" - "1: \n" -@@ -229,7 +229,7 @@ void ScaleRowDown34_1_Box_NEON(const uin - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm volatile ( -+ asm volatile( - "vmov.u8 d24, #3 \n" - "add %3, %0 \n" - "1: \n" -@@ -281,7 +281,7 @@ void ScaleRowDown38_NEON(const uint8_t* - uint8_t* dst_ptr, - int dst_width) { - (void)src_stride; -- asm volatile ( -+ asm volatile( - "vld1.8 {q3}, [%3] \n" - "1: \n" - "vld1.8 {d0, d1, d2, d3}, [%0]! \n" -@@ -305,7 +305,7 @@ void OMITFP ScaleRowDown38_3_Box_NEON(co - int dst_width) { - const uint8_t* src_ptr1 = src_ptr + src_stride * 2; - -- asm volatile ( -+ asm volatile( - "vld1.16 {q13}, [%5] \n" - "vld1.8 {q14}, [%6] \n" - "vld1.8 {q15}, [%7] \n" -@@ -415,7 +415,7 @@ void ScaleRowDown38_2_Box_NEON(const uin - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm volatile ( -+ asm volatile( - "vld1.16 {q13}, [%4] \n" - "vld1.8 {q14}, [%5] \n" - "add %3, %0 \n" -@@ -508,7 +508,7 @@ void ScaleRowUp2_Linear_NEON(const uint8 - uint8_t* dst_ptr, - int dst_width) { - const uint8_t* src_temp = src_ptr + 1; -- asm volatile ( -+ asm volatile( - "vmov.u8 d30, #3 \n" - - "1: \n" -@@ -545,7 +545,7 @@ void ScaleRowUp2_Bilinear_NEON(const uin - const uint8_t* src_temp = src_ptr + 1; - const uint8_t* src_temp1 = src_ptr1 + 1; - -- asm volatile ( -+ asm volatile( - "vmov.u16 q15, #3 \n" - "vmov.u8 d28, #3 \n" - -@@ -607,7 +607,7 @@ void ScaleRowUp2_Linear_12_NEON(const ui - uint16_t* dst_ptr, - int dst_width) { - const uint16_t* src_temp = src_ptr + 1; -- asm volatile ( -+ asm volatile( - "vmov.u16 q15, #3 \n" - - "1: \n" -@@ -643,7 +643,7 @@ void ScaleRowUp2_Bilinear_12_NEON(const - const uint16_t* src_temp = src_ptr + 1; - const uint16_t* src_temp1 = src_ptr1 + 1; - -- asm volatile ( -+ asm volatile( - "vmov.u16 q15, #3 \n" - - "1: \n" -@@ -694,7 +694,7 @@ void ScaleRowUp2_Linear_16_NEON(const ui - uint16_t* dst_ptr, - int dst_width) { - const uint16_t* src_temp = src_ptr + 1; -- asm volatile ( -+ asm volatile( - "vmov.u16 d31, #3 \n" - - "1: \n" -@@ -738,7 +738,7 @@ void ScaleRowUp2_Bilinear_16_NEON(const - const uint16_t* src_temp = src_ptr + 1; - const uint16_t* src_temp1 = src_ptr1 + 1; - -- asm volatile ( -+ asm volatile( - "vmov.u16 d31, #3 \n" - "vmov.u32 q14, #3 \n" - -@@ -790,7 +790,7 @@ void ScaleUVRowUp2_Linear_NEON(const uin - uint8_t* dst_ptr, - int dst_width) { - const uint8_t* src_temp = src_ptr + 2; -- asm volatile ( -+ asm volatile( - "vmov.u8 d30, #3 \n" - - "1: \n" -@@ -827,7 +827,7 @@ void ScaleUVRowUp2_Bilinear_NEON(const u - const uint8_t* src_temp = src_ptr + 2; - const uint8_t* src_temp1 = src_ptr1 + 2; - -- asm volatile ( -+ asm volatile( - "vmov.u16 q15, #3 \n" - "vmov.u8 d28, #3 \n" - -@@ -889,7 +889,7 @@ void ScaleUVRowUp2_Linear_16_NEON(const - uint16_t* dst_ptr, - int dst_width) { - const uint16_t* src_temp = src_ptr + 2; -- asm volatile ( -+ asm volatile( - "vmov.u16 d30, #3 \n" - - "1: \n" -@@ -934,7 +934,7 @@ void ScaleUVRowUp2_Bilinear_16_NEON(cons - const uint16_t* src_temp = src_ptr + 2; - const uint16_t* src_temp1 = src_ptr1 + 2; - -- asm volatile ( -+ asm volatile( - "vmov.u16 d30, #3 \n" - "vmov.u32 q14, #3 \n" - -@@ -987,7 +987,7 @@ void ScaleUVRowUp2_Bilinear_16_NEON(cons - void ScaleAddRow_NEON(const uint8_t* src_ptr, - uint16_t* dst_ptr, - int src_width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "vld1.16 {q1, q2}, [%1] \n" // load accumulator - "vld1.8 {q0}, [%0]! \n" // load 16 bytes -@@ -1086,7 +1086,7 @@ void ScaleFilterRows_NEON(uint8_t* dst_p - ptrdiff_t src_stride, - int dst_width, - int source_y_fraction) { -- asm volatile ( -+ asm volatile( - "cmp %4, #0 \n" - "beq 100f \n" - "add %2, %1 \n" -@@ -1170,7 +1170,7 @@ void ScaleARGBRowDown2_NEON(const uint8_ - uint8_t* dst, - int dst_width) { - (void)src_stride; -- asm volatile ( -+ asm volatile( - "1: \n" - "vld4.32 {d0, d2, d4, d6}, [%0]! \n" // load 8 ARGB pixels. - "vld4.32 {d1, d3, d5, d7}, [%0]! \n" // load next 8 ARGB -@@ -1198,7 +1198,7 @@ void ScaleARGBRowDown2Linear_NEON(const - uint8_t* dst_argb, - int dst_width) { - (void)src_stride; -- asm volatile ( -+ asm volatile( - "1: \n" - "vld4.32 {d0, d2, d4, d6}, [%0]! \n" // load 8 ARGB pixels. - "vld4.32 {d1, d3, d5, d7}, [%0]! \n" // load next 8 ARGB -@@ -1219,7 +1219,7 @@ void ScaleARGBRowDown2Box_NEON(const uin - ptrdiff_t src_stride, - uint8_t* dst, - int dst_width) { -- asm volatile ( -+ asm volatile( - // change the stride to row 2 pointer - "add %1, %1, %0 \n" - "1: \n" -@@ -1258,7 +1258,7 @@ void ScaleARGBRowDownEven_NEON(const uin - uint8_t* dst_argb, - int dst_width) { - (void)src_stride; -- asm volatile ( -+ asm volatile( - "mov r12, %3, lsl #2 \n" - "1: \n" - "vld1.32 {d0[0]}, [%0], r12 \n" -@@ -1282,7 +1282,7 @@ void ScaleARGBRowDownEvenBox_NEON(const - int src_stepx, - uint8_t* dst_argb, - int dst_width) { -- asm volatile ( -+ asm volatile( - "mov r12, %4, lsl #2 \n" - "add %1, %1, %0 \n" - "1: \n" -@@ -1330,7 +1330,7 @@ void ScaleARGBCols_NEON(uint8_t* dst_arg - int dx) { - int tmp; - const uint8_t* src_tmp = src_argb; -- asm volatile ( -+ asm volatile( - "1: \n" - // clang-format off - LOAD1_DATA32_LANE(d0, 0) -@@ -1428,50 +1428,11 @@ void ScaleARGBFilterCols_NEON(uint8_t* d - - #undef LOAD2_DATA32_LANE - --void ScaleUVRowDown2_NEON(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- uint8_t* dst, -- int dst_width) { -- (void)src_stride; -- asm volatile ( -- "1: \n" -- "vld2.16 {d0, d2}, [%0]! \n" // load 8 UV pixels. -- "vld2.16 {d1, d3}, [%0]! \n" // load next 8 UV -- "subs %2, %2, #8 \n" // 8 processed per loop. -- "vst1.16 {q1}, [%1]! \n" // store 8 UV -- "bgt 1b \n" -- : "+r"(src_ptr), // %0 -- "+r"(dst), // %1 -- "+r"(dst_width) // %2 -- : -- : "memory", "cc", "q0", "q1"); --} -- --void ScaleUVRowDown2Linear_NEON(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- uint8_t* dst, -- int dst_width) { -- (void)src_stride; -- asm volatile ( -- "1: \n" -- "vld2.16 {d0, d2}, [%0]! \n" // load 8 UV pixels. -- "vld2.16 {d1, d3}, [%0]! \n" // load next 8 UV -- "subs %2, %2, #8 \n" // 8 processed per loop. -- "vrhadd.u8 q0, q0, q1 \n" // rounding half add -- "vst1.16 {q0}, [%1]! \n" // store 8 UV -- "bgt 1b \n" -- : "+r"(src_ptr), // %0 -- "+r"(dst), // %1 -- "+r"(dst_width) // %2 -- : -- : "memory", "cc", "q0", "q1"); --} -- - void ScaleUVRowDown2Box_NEON(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst, - int dst_width) { -- asm volatile ( -+ asm volatile( - // change the stride to row 2 pointer - "add %1, %1, %0 \n" - "1: \n" -@@ -1506,7 +1467,7 @@ void ScaleUVRowDownEven_NEON(const uint8 - const uint8_t* src2_ptr = src_ptr + src_stepx * 4; - const uint8_t* src3_ptr = src_ptr + src_stepx * 6; - (void)src_stride; -- asm volatile ( -+ asm volatile( - "1: \n" - "vld1.16 {d0[0]}, [%0], %6 \n" - "vld1.16 {d0[1]}, [%1], %6 \n" -diff --git a/media/libyuv/libyuv/source/scale_neon64.cc b/media/libyuv/libyuv/source/scale_neon64.cc ---- a/media/libyuv/libyuv/source/scale_neon64.cc -+++ b/media/libyuv/libyuv/source/scale_neon64.cc -@@ -26,7 +26,7 @@ void ScaleRowDown2_NEON(const uint8_t* s - uint8_t* dst, - int dst_width) { - (void)src_stride; -- asm volatile ( -+ asm volatile( - "1: \n" - // load even pixels into v0, odd into v1 - "ld2 {v0.16b,v1.16b}, [%0], #32 \n" -@@ -38,7 +38,7 @@ void ScaleRowDown2_NEON(const uint8_t* s - "+r"(dst), // %1 - "+r"(dst_width) // %2 - : -- : "memory", "cc", "v0", "v1" // Clobber List -+ : "v0", "v1" // Clobber List - ); - } - -@@ -48,7 +48,7 @@ void ScaleRowDown2Linear_NEON(const uint - uint8_t* dst, - int dst_width) { - (void)src_stride; -- asm volatile ( -+ asm volatile( - "1: \n" - // load even pixels into v0, odd into v1 - "ld2 {v0.16b,v1.16b}, [%0], #32 \n" -@@ -61,7 +61,7 @@ void ScaleRowDown2Linear_NEON(const uint - "+r"(dst), // %1 - "+r"(dst_width) // %2 - : -- : "memory", "cc", "v0", "v1" // Clobber List -+ : "v0", "v1" // Clobber List - ); - } - -@@ -70,7 +70,7 @@ void ScaleRowDown2Box_NEON(const uint8_t - ptrdiff_t src_stride, - uint8_t* dst, - int dst_width) { -- asm volatile ( -+ asm volatile( - // change the stride to row 2 pointer - "add %1, %1, %0 \n" - "1: \n" -@@ -92,7 +92,7 @@ void ScaleRowDown2Box_NEON(const uint8_t - "+r"(dst), // %2 - "+r"(dst_width) // %3 - : -- : "memory", "cc", "v0", "v1", "v2", "v3" // Clobber List -+ : "v0", "v1", "v2", "v3" // Clobber List - ); - } - -@@ -101,7 +101,7 @@ void ScaleRowDown4_NEON(const uint8_t* s - uint8_t* dst_ptr, - int dst_width) { - (void)src_stride; -- asm volatile ( -+ asm volatile( - "1: \n" - "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // src line 0 - "subs %w2, %w2, #8 \n" // 8 processed per loop -@@ -112,7 +112,7 @@ void ScaleRowDown4_NEON(const uint8_t* s - "+r"(dst_ptr), // %1 - "+r"(dst_width) // %2 - : -- : "memory", "cc", "v0", "v1", "v2", "v3"); -+ : "v0", "v1", "v2", "v3", "memory", "cc"); - } - - void ScaleRowDown4Box_NEON(const uint8_t* src_ptr, -@@ -122,7 +122,7 @@ void ScaleRowDown4Box_NEON(const uint8_t - const uint8_t* src_ptr1 = src_ptr + src_stride; - const uint8_t* src_ptr2 = src_ptr + src_stride * 2; - const uint8_t* src_ptr3 = src_ptr + src_stride * 3; -- asm volatile ( -+ asm volatile( - "1: \n" - "ld1 {v0.16b}, [%0], #16 \n" // load up 16x4 - "ld1 {v1.16b}, [%2], #16 \n" -@@ -148,7 +148,7 @@ void ScaleRowDown4Box_NEON(const uint8_t - "+r"(src_ptr3), // %4 - "+r"(dst_width) // %5 - : -- : "memory", "cc", "v0", "v1", "v2", "v3"); -+ : "v0", "v1", "v2", "v3", "memory", "cc"); - } - - // Down scale from 4 to 3 pixels. Use the neon multilane read/write -@@ -159,11 +159,11 @@ void ScaleRowDown34_NEON(const uint8_t* - uint8_t* dst_ptr, - int dst_width) { - (void)src_stride; -- asm volatile ( -+ asm volatile( - "1: \n" - "ld4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%0], #32 \n" // src line 0 - "subs %w2, %w2, #24 \n" -- "mov v2.16b, v3.16b \n" // order v0,v1,v2 -+ "orr v2.16b, v3.16b, v3.16b \n" // order v0,v1,v2 - "prfm pldl1keep, [%0, 448] \n" // prefetch 7 lines ahead - "st3 {v0.8b,v1.8b,v2.8b}, [%1], #24 \n" - "b.gt 1b \n" -@@ -171,14 +171,14 @@ void ScaleRowDown34_NEON(const uint8_t* - "+r"(dst_ptr), // %1 - "+r"(dst_width) // %2 - : -- : "memory", "cc", "v0", "v1", "v2", "v3"); -+ : "v0", "v1", "v2", "v3", "memory", "cc"); - } - - void ScaleRowDown34_0_Box_NEON(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm volatile ( -+ asm volatile( - "movi v20.8b, #3 \n" - "add %3, %3, %0 \n" - "1: \n" -@@ -229,15 +229,15 @@ void ScaleRowDown34_0_Box_NEON(const uin - "+r"(dst_width), // %2 - "+r"(src_stride) // %3 - : -- : "memory", "cc", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", -- "v17", "v18", "v19", "v20"); -+ : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", "v17", "v18", -+ "v19", "v20", "memory", "cc"); - } - - void ScaleRowDown34_1_Box_NEON(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm volatile ( -+ asm volatile( - "movi v20.8b, #3 \n" - "add %3, %3, %0 \n" - "1: \n" -@@ -272,7 +272,7 @@ void ScaleRowDown34_1_Box_NEON(const uin - "+r"(dst_width), // %2 - "+r"(src_stride) // %3 - : -- : "memory", "cc", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v20"); -+ : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v20", "memory", "cc"); - } - - static const uvec8 kShuf38 = {0, 3, 6, 8, 11, 14, 16, 19, -@@ -292,7 +292,7 @@ void ScaleRowDown38_NEON(const uint8_t* - uint8_t* dst_ptr, - int dst_width) { - (void)src_stride; -- asm volatile ( -+ asm volatile( - "ld1 {v3.16b}, [%3] \n" - "1: \n" - "ld1 {v0.16b,v1.16b}, [%0], #32 \n" -@@ -306,7 +306,7 @@ void ScaleRowDown38_NEON(const uint8_t* - "+r"(dst_ptr), // %1 - "+r"(dst_width) // %2 - : "r"(&kShuf38) // %3 -- : "memory", "cc", "v0", "v1", "v2", "v3"); -+ : "v0", "v1", "v2", "v3", "memory", "cc"); - } - - // 32x3 -> 12x1 -@@ -317,7 +317,7 @@ void OMITFP ScaleRowDown38_3_Box_NEON(co - const uint8_t* src_ptr1 = src_ptr + src_stride * 2; - ptrdiff_t tmp_src_stride = src_stride; - -- asm volatile ( -+ asm volatile( - "ld1 {v29.8h}, [%5] \n" - "ld1 {v30.16b}, [%6] \n" - "ld1 {v31.8h}, [%7] \n" -@@ -427,9 +427,9 @@ void OMITFP ScaleRowDown38_3_Box_NEON(co - : "r"(&kMult38_Div6), // %5 - "r"(&kShuf38_2), // %6 - "r"(&kMult38_Div9) // %7 -- : "memory", "cc", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", -- "v17", "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", "v29", -- "v30", "v31"); -+ : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", "v17", "v18", -+ "v19", "v20", "v21", "v22", "v23", "v24", "v25", "v29", "v30", "v31", -+ "memory", "cc"); - } - - // 32x2 -> 12x1 -@@ -439,7 +439,7 @@ void ScaleRowDown38_2_Box_NEON(const uin - int dst_width) { - // TODO(fbarchard): use src_stride directly for clang 3.5+. - ptrdiff_t tmp_src_stride = src_stride; -- asm volatile ( -+ asm volatile( - "ld1 {v30.8h}, [%4] \n" - "ld1 {v31.16b}, [%5] \n" - "add %2, %2, %0 \n" -@@ -531,15 +531,15 @@ void ScaleRowDown38_2_Box_NEON(const uin - "+r"(dst_width) // %3 - : "r"(&kMult38_Div6), // %4 - "r"(&kShuf38_2) // %5 -- : "memory", "cc", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", -- "v17", "v18", "v19", "v30", "v31"); -+ : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", "v17", "v18", -+ "v19", "v30", "v31", "memory", "cc"); - } - - void ScaleRowUp2_Linear_NEON(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int dst_width) { - const uint8_t* src_temp = src_ptr + 1; -- asm volatile ( -+ asm volatile( - "movi v31.8b, #3 \n" - - "1: \n" -@@ -578,7 +578,7 @@ void ScaleRowUp2_Bilinear_NEON(const uin - const uint8_t* src_temp = src_ptr + 1; - const uint8_t* src_temp1 = src_ptr1 + 1; - -- asm volatile ( -+ asm volatile( - "movi v31.8b, #3 \n" - "movi v30.8h, #3 \n" - -@@ -634,7 +634,7 @@ void ScaleRowUp2_Linear_12_NEON(const ui - uint16_t* dst_ptr, - int dst_width) { - const uint16_t* src_temp = src_ptr + 1; -- asm volatile ( -+ asm volatile( - "movi v31.8h, #3 \n" - - "1: \n" -@@ -671,7 +671,7 @@ void ScaleRowUp2_Bilinear_12_NEON(const - const uint16_t* src_temp = src_ptr + 1; - const uint16_t* src_temp1 = src_ptr1 + 1; - -- asm volatile ( -+ asm volatile( - "movi v31.8h, #3 \n" - - "1: \n" -@@ -725,7 +725,7 @@ void ScaleRowUp2_Linear_16_NEON(const ui - uint16_t* dst_ptr, - int dst_width) { - const uint16_t* src_temp = src_ptr + 1; -- asm volatile ( -+ asm volatile( - "movi v31.8h, #3 \n" - - "1: \n" -@@ -770,7 +770,7 @@ void ScaleRowUp2_Bilinear_16_NEON(const - const uint16_t* src_temp = src_ptr + 1; - const uint16_t* src_temp1 = src_ptr1 + 1; - -- asm volatile ( -+ asm volatile( - "movi v31.4h, #3 \n" - "movi v30.4s, #3 \n" - -@@ -825,7 +825,7 @@ void ScaleUVRowUp2_Linear_NEON(const uin - uint8_t* dst_ptr, - int dst_width) { - const uint8_t* src_temp = src_ptr + 2; -- asm volatile ( -+ asm volatile( - "movi v31.8b, #3 \n" - - "1: \n" -@@ -864,7 +864,7 @@ void ScaleUVRowUp2_Bilinear_NEON(const u - const uint8_t* src_temp = src_ptr + 2; - const uint8_t* src_temp1 = src_ptr1 + 2; - -- asm volatile ( -+ asm volatile( - "movi v31.8b, #3 \n" - "movi v30.8h, #3 \n" - -@@ -920,7 +920,7 @@ void ScaleUVRowUp2_Linear_16_NEON(const - uint16_t* dst_ptr, - int dst_width) { - const uint16_t* src_temp = src_ptr + 2; -- asm volatile ( -+ asm volatile( - "movi v31.8h, #3 \n" - - "1: \n" -@@ -967,7 +967,7 @@ void ScaleUVRowUp2_Bilinear_16_NEON(cons - const uint16_t* src_temp = src_ptr + 2; - const uint16_t* src_temp1 = src_ptr1 + 2; - -- asm volatile ( -+ asm volatile( - "movi v31.4h, #3 \n" - "movi v30.4s, #3 \n" - -@@ -1022,7 +1022,7 @@ void ScaleUVRowUp2_Bilinear_16_NEON(cons - void ScaleAddRow_NEON(const uint8_t* src_ptr, - uint16_t* dst_ptr, - int src_width) { -- asm volatile ( -+ asm volatile( - "1: \n" - "ld1 {v1.8h, v2.8h}, [%1] \n" // load accumulator - "ld1 {v0.16b}, [%0], #16 \n" // load 16 bytes -@@ -1118,12 +1118,107 @@ void ScaleFilterCols_NEON(uint8_t* dst_p - - #undef LOAD2_DATA8_LANE - -+// 16x2 -> 16x1 -+void ScaleFilterRows_NEON(uint8_t* dst_ptr, -+ const uint8_t* src_ptr, -+ ptrdiff_t src_stride, -+ int dst_width, -+ int source_y_fraction) { -+ int y_fraction = 256 - source_y_fraction; -+ asm volatile( -+ "cmp %w4, #0 \n" -+ "b.eq 100f \n" -+ "add %2, %2, %1 \n" -+ "cmp %w4, #64 \n" -+ "b.eq 75f \n" -+ "cmp %w4, #128 \n" -+ "b.eq 50f \n" -+ "cmp %w4, #192 \n" -+ "b.eq 25f \n" -+ -+ "dup v5.8b, %w4 \n" -+ "dup v4.8b, %w5 \n" -+ // General purpose row blend. -+ "1: \n" -+ "ld1 {v0.16b}, [%1], #16 \n" -+ "ld1 {v1.16b}, [%2], #16 \n" -+ "subs %w3, %w3, #16 \n" -+ "umull v6.8h, v0.8b, v4.8b \n" -+ "umull2 v7.8h, v0.16b, v4.16b \n" -+ "prfm pldl1keep, [%1, 448] \n" // prefetch 7 lines ahead -+ "umlal v6.8h, v1.8b, v5.8b \n" -+ "umlal2 v7.8h, v1.16b, v5.16b \n" -+ "prfm pldl1keep, [%2, 448] \n" -+ "rshrn v0.8b, v6.8h, #8 \n" -+ "rshrn2 v0.16b, v7.8h, #8 \n" -+ "st1 {v0.16b}, [%0], #16 \n" -+ "b.gt 1b \n" -+ "b 99f \n" -+ -+ // Blend 25 / 75. -+ "25: \n" -+ "ld1 {v0.16b}, [%1], #16 \n" -+ "ld1 {v1.16b}, [%2], #16 \n" -+ "subs %w3, %w3, #16 \n" -+ "urhadd v0.16b, v0.16b, v1.16b \n" -+ "prfm pldl1keep, [%1, 448] \n" // prefetch 7 lines ahead -+ "urhadd v0.16b, v0.16b, v1.16b \n" -+ "prfm pldl1keep, [%2, 448] \n" -+ "st1 {v0.16b}, [%0], #16 \n" -+ "b.gt 25b \n" -+ "b 99f \n" -+ -+ // Blend 50 / 50. -+ "50: \n" -+ "ld1 {v0.16b}, [%1], #16 \n" -+ "ld1 {v1.16b}, [%2], #16 \n" -+ "subs %w3, %w3, #16 \n" -+ "prfm pldl1keep, [%1, 448] \n" // prefetch 7 lines ahead -+ "urhadd v0.16b, v0.16b, v1.16b \n" -+ "prfm pldl1keep, [%2, 448] \n" -+ "st1 {v0.16b}, [%0], #16 \n" -+ "b.gt 50b \n" -+ "b 99f \n" -+ -+ // Blend 75 / 25. -+ "75: \n" -+ "ld1 {v1.16b}, [%1], #16 \n" -+ "ld1 {v0.16b}, [%2], #16 \n" -+ "subs %w3, %w3, #16 \n" -+ "urhadd v0.16b, v0.16b, v1.16b \n" -+ "prfm pldl1keep, [%1, 448] \n" // prefetch 7 lines ahead -+ "urhadd v0.16b, v0.16b, v1.16b \n" -+ "prfm pldl1keep, [%2, 448] \n" -+ "st1 {v0.16b}, [%0], #16 \n" -+ "b.gt 75b \n" -+ "b 99f \n" -+ -+ // Blend 100 / 0 - Copy row unchanged. -+ "100: \n" -+ "ld1 {v0.16b}, [%1], #16 \n" -+ "subs %w3, %w3, #16 \n" -+ "prfm pldl1keep, [%1, 448] \n" // prefetch 7 lines ahead -+ "st1 {v0.16b}, [%0], #16 \n" -+ "b.gt 100b \n" -+ -+ "99: \n" -+ "st1 {v0.b}[15], [%0] \n" -+ : "+r"(dst_ptr), // %0 -+ "+r"(src_ptr), // %1 -+ "+r"(src_stride), // %2 -+ "+r"(dst_width), // %3 -+ "+r"(source_y_fraction), // %4 -+ "+r"(y_fraction) // %5 -+ : -+ : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "memory", "cc"); -+} -+ - void ScaleARGBRowDown2_NEON(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst, - int dst_width) { - (void)src_stride; -- asm volatile ( -+ asm volatile( - "1: \n" - // load 16 ARGB pixels with even pixels into q0/q2, odd into q1/q3 - "ld4 {v0.4s,v1.4s,v2.4s,v3.4s}, [%0], #64 \n" -@@ -1145,7 +1240,7 @@ void ScaleARGBRowDown2Linear_NEON(const - uint8_t* dst_argb, - int dst_width) { - (void)src_stride; -- asm volatile ( -+ asm volatile( - "1: \n" - // load 16 ARGB pixels with even pixels into q0/q2, odd into q1/q3 - "ld4 {v0.4s,v1.4s,v2.4s,v3.4s}, [%0], #64 \n" -@@ -1168,59 +1263,60 @@ void ScaleARGBRowDown2Box_NEON(const uin - ptrdiff_t src_stride, - uint8_t* dst, - int dst_width) { -- const uint8_t* src_ptr1 = src_ptr + src_stride; -- asm volatile ( -- "1: \n" -- "ld2 {v0.4s, v1.4s}, [%[src]], #32 \n" -- "ld2 {v20.4s, v21.4s}, [%[src1]], #32 \n" -- "uaddl v2.8h, v0.8b, v1.8b \n" -- "uaddl2 v3.8h, v0.16b, v1.16b \n" -- "uaddl v22.8h, v20.8b, v21.8b \n" -- "uaddl2 v23.8h, v20.16b, v21.16b \n" -- "add v0.8h, v2.8h, v22.8h \n" -- "add v1.8h, v3.8h, v23.8h \n" -- "rshrn v0.8b, v0.8h, #2 \n" -- "rshrn v1.8b, v1.8h, #2 \n" -- "subs %w[width], %w[width], #4 \n" -- "stp d0, d1, [%[dst]], #16 \n" -- "b.gt 1b \n" -- : [src] "+r"(src_ptr), [src1] "+r"(src_ptr1), [dst] "+r"(dst), -- [width] "+r"(dst_width) -+ asm volatile( -+ // change the stride to row 2 pointer -+ "add %1, %1, %0 \n" -+ "1: \n" -+ "ld4 {v0.16b,v1.16b,v2.16b,v3.16b}, [%0], #64 \n" // load 16 ARGB -+ "subs %w3, %w3, #8 \n" // 8 processed per loop. -+ "uaddlp v0.8h, v0.16b \n" // B 16 bytes -> 8 shorts. -+ "uaddlp v1.8h, v1.16b \n" // G 16 bytes -> 8 shorts. -+ "uaddlp v2.8h, v2.16b \n" // R 16 bytes -> 8 shorts. -+ "uaddlp v3.8h, v3.16b \n" // A 16 bytes -> 8 shorts. -+ "ld4 {v16.16b,v17.16b,v18.16b,v19.16b}, [%1], #64 \n" // load 8 -+ "uadalp v0.8h, v16.16b \n" // B 16 bytes -> 8 shorts. -+ "uadalp v1.8h, v17.16b \n" // G 16 bytes -> 8 shorts. -+ "prfm pldl1keep, [%0, 448] \n" // prefetch 7 lines ahead -+ "uadalp v2.8h, v18.16b \n" // R 16 bytes -> 8 shorts. -+ "uadalp v3.8h, v19.16b \n" // A 16 bytes -> 8 shorts. -+ "prfm pldl1keep, [%1, 448] \n" -+ "rshrn v0.8b, v0.8h, #2 \n" // round and pack -+ "rshrn v1.8b, v1.8h, #2 \n" -+ "rshrn v2.8b, v2.8h, #2 \n" -+ "rshrn v3.8b, v3.8h, #2 \n" -+ "st4 {v0.8b,v1.8b,v2.8b,v3.8b}, [%2], #32 \n" -+ "b.gt 1b \n" -+ : "+r"(src_ptr), // %0 -+ "+r"(src_stride), // %1 -+ "+r"(dst), // %2 -+ "+r"(dst_width) // %3 - : -- : "memory", "cc", "v0", "v1", "v2", "v3", "v20", "v21", "v22", "v23"); -+ : "memory", "cc", "v0", "v1", "v2", "v3", "v16", "v17", "v18", "v19"); - } - -+// Reads 4 pixels at a time. -+// Alignment requirement: src_argb 4 byte aligned. - void ScaleARGBRowDownEven_NEON(const uint8_t* src_argb, - ptrdiff_t src_stride, - int src_stepx, - uint8_t* dst_argb, - int dst_width) { -- const uint8_t* src_argb1 = src_argb + src_stepx * 4; -- const uint8_t* src_argb2 = src_argb + src_stepx * 8; -- const uint8_t* src_argb3 = src_argb + src_stepx * 12; -- int64_t i = 0; - (void)src_stride; -- asm volatile ( -- "1: \n" -- "ldr w10, [%[src], %[i]] \n" -- "ldr w11, [%[src1], %[i]] \n" -- "ldr w12, [%[src2], %[i]] \n" -- "ldr w13, [%[src3], %[i]] \n" -- "add %[i], %[i], %[step] \n" -- "subs %w[width], %w[width], #4 \n" -- "prfm pldl1keep, [%[src], 448] \n" -- "stp w10, w11, [%[dst]], #8 \n" -- "stp w12, w13, [%[dst]], #8 \n" -- "b.gt 1b \n" -- : [src]"+r"(src_argb), -- [src1]"+r"(src_argb1), -- [src2]"+r"(src_argb2), -- [src3]"+r"(src_argb3), -- [dst]"+r"(dst_argb), -- [width]"+r"(dst_width), -- [i]"+r"(i) -- : [step]"r"((int64_t)(src_stepx * 16)) -- : "memory", "cc", "w10", "w11", "w12", "w13"); -+ asm volatile( -+ "1: \n" -+ "ld1 {v0.s}[0], [%0], %3 \n" -+ "ld1 {v0.s}[1], [%0], %3 \n" -+ "ld1 {v0.s}[2], [%0], %3 \n" -+ "ld1 {v0.s}[3], [%0], %3 \n" -+ "subs %w2, %w2, #4 \n" // 4 pixels per loop. -+ "prfm pldl1keep, [%0, 448] \n" // prefetch 7 lines ahead -+ "st1 {v0.16b}, [%1], #16 \n" -+ "b.gt 1b \n" -+ : "+r"(src_argb), // %0 -+ "+r"(dst_argb), // %1 -+ "+r"(dst_width) // %2 -+ : "r"((int64_t)(src_stepx * 4)) // %3 -+ : "memory", "cc", "v0"); - } - - // Reads 4 pixels at a time. -@@ -1232,7 +1328,7 @@ void ScaleARGBRowDownEvenBox_NEON(const - int src_stepx, - uint8_t* dst_argb, - int dst_width) { -- asm volatile ( -+ asm volatile( - "add %1, %1, %0 \n" - "1: \n" - "ld1 {v0.8b}, [%0], %4 \n" // Read 4 2x2 -> 2x1 -@@ -1287,7 +1383,7 @@ void ScaleARGBCols_NEON(uint8_t* dst_arg - int64_t x64 = (int64_t)x; // NOLINT - int64_t dx64 = (int64_t)dx; // NOLINT - int64_t tmp64; -- asm volatile ( -+ asm volatile( - "1: \n" - // clang-format off - LOAD1_DATA32_LANE(v0, 0) -@@ -1394,7 +1490,7 @@ void ScaleRowDown2Box_16_NEON(const uint - ptrdiff_t src_stride, - uint16_t* dst, - int dst_width) { -- asm volatile ( -+ asm volatile( - // change the stride to row 2 pointer - "add %1, %0, %1, lsl #1 \n" // ptr + stide * 2 - "1: \n" -@@ -1416,7 +1512,7 @@ void ScaleRowDown2Box_16_NEON(const uint - "+r"(dst), // %2 - "+r"(dst_width) // %3 - : -- : "memory", "cc", "v0", "v1", "v2", "v3" // Clobber List -+ : "v0", "v1", "v2", "v3" // Clobber List - ); - } - -@@ -1426,7 +1522,7 @@ void ScaleRowUp2_16_NEON(const uint16_t* - ptrdiff_t src_stride, - uint16_t* dst, - int dst_width) { -- asm volatile ( -+ asm volatile( - "add %1, %0, %1, lsl #1 \n" // ptr + stide * 2 - "movi v0.8h, #9 \n" // constants - "movi v1.4s, #3 \n" -@@ -1467,55 +1563,16 @@ void ScaleRowUp2_16_NEON(const uint16_t* - "+r"(dst_width) // %3 - : "r"(2LL), // %4 - "r"(14LL) // %5 -- : "memory", "cc", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", -- "v17", "v18", "v19" // Clobber List -+ : "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v16", "v17", "v18", -+ "v19" // Clobber List - ); - } - --void ScaleUVRowDown2_NEON(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- uint8_t* dst, -- int dst_width) { -- (void)src_stride; -- asm volatile ( -- "1: \n" -- "ld2 {v0.8h,v1.8h}, [%0], #32 \n" // load 16 UV -- "subs %w2, %w2, #8 \n" // 8 processed per loop. -- "prfm pldl1keep, [%0, 448] \n" // prefetch 7 lines ahead -- "st1 {v1.8h}, [%1], #16 \n" // store 8 UV -- "b.gt 1b \n" -- : "+r"(src_ptr), // %0 -- "+r"(dst), // %1 -- "+r"(dst_width) // %2 -- : -- : "memory", "cc", "v0", "v1"); --} -- --void ScaleUVRowDown2Linear_NEON(const uint8_t* src_ptr, -- ptrdiff_t src_stride, -- uint8_t* dst, -- int dst_width) { -- (void)src_stride; -- asm volatile ( -- "1: \n" -- "ld2 {v0.8h,v1.8h}, [%0], #32 \n" // load 16 UV -- "subs %w2, %w2, #8 \n" // 8 processed per loop. -- "urhadd v0.16b, v0.16b, v1.16b \n" // rounding half add -- "prfm pldl1keep, [%0, 448] \n" // prefetch 7 lines ahead -- "st1 {v0.8h}, [%1], #16 \n" // store 8 UV -- "b.gt 1b \n" -- : "+r"(src_ptr), // %0 -- "+r"(dst), // %1 -- "+r"(dst_width) // %2 -- : -- : "memory", "cc", "v0", "v1"); --} -- - void ScaleUVRowDown2Box_NEON(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst, - int dst_width) { -- asm volatile ( -+ asm volatile( - // change the stride to row 2 pointer - "add %1, %1, %0 \n" - "1: \n" -@@ -1550,7 +1607,7 @@ void ScaleUVRowDownEven_NEON(const uint8 - const uint8_t* src2_ptr = src_ptr + src_stepx * 4; - const uint8_t* src3_ptr = src_ptr + src_stepx * 6; - (void)src_stride; -- asm volatile ( -+ asm volatile( - "1: \n" - "ld1 {v0.h}[0], [%0], %6 \n" - "ld1 {v1.h}[0], [%1], %6 \n" -diff --git a/media/libyuv/libyuv/source/scale_uv.cc b/media/libyuv/libyuv/source/scale_uv.cc ---- a/media/libyuv/libyuv/source/scale_uv.cc -+++ b/media/libyuv/libyuv/source/scale_uv.cc -@@ -112,31 +112,6 @@ static void ScaleUVDown2(int src_width, - } - } - #endif --#if defined(HAS_SCALEUVROWDOWN2_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- ScaleUVRowDown2 = -- filtering == kFilterNone -- ? ScaleUVRowDown2_Any_NEON -- : (filtering == kFilterLinear ? ScaleUVRowDown2Linear_Any_NEON -- : ScaleUVRowDown2Box_Any_NEON); -- if (IS_ALIGNED(dst_width, 8)) { -- ScaleUVRowDown2 = -- filtering == kFilterNone -- ? ScaleUVRowDown2_NEON -- : (filtering == kFilterLinear ? ScaleUVRowDown2Linear_NEON -- : ScaleUVRowDown2Box_NEON); -- } -- } --#endif --#if defined(HAS_SCALEUVROWDOWN2_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ScaleUVRowDown2 = -- filtering == kFilterNone -- ? ScaleUVRowDown2_RVV -- : (filtering == kFilterLinear ? ScaleUVRowDown2Linear_RVV -- : ScaleUVRowDown2Box_RVV); -- } --#endif - - // This code is not enabled. Only box filter is available at this time. - #if defined(HAS_SCALEUVROWDOWN2_SSSE3) -@@ -155,7 +130,23 @@ static void ScaleUVDown2(int src_width, - } - } - #endif -- -+// This code is not enabled. Only box filter is available at this time. -+#if defined(HAS_SCALEUVROWDOWN2_NEON) -+ if (TestCpuFlag(kCpuHasNEON)) { -+ ScaleUVRowDown2 = -+ filtering == kFilterNone -+ ? ScaleUVRowDown2_Any_NEON -+ : (filtering == kFilterLinear ? ScaleUVRowDown2Linear_Any_NEON -+ : ScaleUVRowDown2Box_Any_NEON); -+ if (IS_ALIGNED(dst_width, 8)) { -+ ScaleUVRowDown2 = -+ filtering == kFilterNone -+ ? ScaleUVRowDown2_NEON -+ : (filtering == kFilterLinear ? ScaleUVRowDown2Linear_NEON -+ : ScaleUVRowDown2Box_NEON); -+ } -+ } -+#endif - #if defined(HAS_SCALEUVROWDOWN2_MSA) - if (TestCpuFlag(kCpuHasMSA)) { - ScaleUVRowDown2 = -@@ -188,24 +179,22 @@ static void ScaleUVDown2(int src_width, - // This is an optimized version for scaling down a UV to 1/4 of - // its original size. - #if HAS_SCALEUVDOWN4BOX --static int ScaleUVDown4Box(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint8_t* src_uv, -- uint8_t* dst_uv, -- int x, -- int dx, -- int y, -- int dy) { -+static void ScaleUVDown4Box(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint8_t* src_uv, -+ uint8_t* dst_uv, -+ int x, -+ int dx, -+ int y, -+ int dy) { - int j; - // Allocate 2 rows of UV. - const int row_size = (dst_width * 2 * 2 + 15) & ~15; - align_buffer_64(row, row_size * 2); -- if (!row) -- return 1; - int row_stride = src_stride * (dy >> 16); - void (*ScaleUVRowDown2)(const uint8_t* src_uv, ptrdiff_t src_stride, - uint8_t* dst_uv, int dst_width) = -@@ -242,11 +231,6 @@ static int ScaleUVDown4Box(int src_width - } - } - #endif --#if defined(HAS_SCALEUVROWDOWN2BOX_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- ScaleUVRowDown2 = ScaleUVRowDown2Box_RVV; -- } --#endif - - for (j = 0; j < dst_height; ++j) { - ScaleUVRowDown2(src_uv, src_stride, row, dst_width * 2); -@@ -257,7 +241,6 @@ static int ScaleUVDown4Box(int src_width - dst_uv += dst_stride; - } - free_aligned_buffer_64(row); -- return 0; - } - #endif // HAS_SCALEUVDOWN4BOX - -@@ -327,18 +310,6 @@ static void ScaleUVDownEven(int src_widt - } - } - #endif --#if defined(HAS_SCALEUVROWDOWNEVEN_RVV) || defined(HAS_SCALEUVROWDOWN4_RVV) -- if (TestCpuFlag(kCpuHasRVV) && !filtering) { -- #if defined(HAS_SCALEUVROWDOWNEVEN_RVV) -- ScaleUVRowDownEven = ScaleUVRowDownEven_RVV; -- #endif -- #if defined(HAS_SCALEUVROWDOWN4_RVV) -- if (col_step == 4) { -- ScaleUVRowDownEven = ScaleUVRowDown4_RVV; -- } -- #endif -- } --#endif - - if (filtering == kFilterLinear) { - src_stride = 0; -@@ -353,19 +324,19 @@ static void ScaleUVDownEven(int src_widt - - // Scale UV down with bilinear interpolation. - #if HAS_SCALEUVBILINEARDOWN --static int ScaleUVBilinearDown(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint8_t* src_uv, -- uint8_t* dst_uv, -- int x, -- int dx, -- int y, -- int dy, -- enum FilterMode filtering) { -+static void ScaleUVBilinearDown(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint8_t* src_uv, -+ uint8_t* dst_uv, -+ int x, -+ int dx, -+ int y, -+ int dy, -+ enum FilterMode filtering) { - int j; - void (*InterpolateRow)(uint8_t* dst_uv, const uint8_t* src_uv, - ptrdiff_t src_stride, int dst_width, -@@ -426,11 +397,6 @@ static int ScaleUVBilinearDown(int src_w - } - } - #endif --#if defined(HAS_INTERPOLATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- InterpolateRow = InterpolateRow_RVV; -- } --#endif - #if defined(HAS_SCALEUVFILTERCOLS_SSSE3) - if (TestCpuFlag(kCpuHasSSSE3) && src_width < 32768) { - ScaleUVFilterCols = ScaleUVFilterCols_SSSE3; -@@ -455,10 +421,9 @@ static int ScaleUVBilinearDown(int src_w - // TODO(fbarchard): Consider not allocating row buffer for kFilterLinear. - // Allocate a row of UV. - { -+ align_buffer_64(row, clip_src_width * 2); -+ - const int max_y = (src_height - 1) << 16; -- align_buffer_64(row, clip_src_width * 2); -- if (!row) -- return 1; - if (y > max_y) { - y = max_y; - } -@@ -480,25 +445,24 @@ static int ScaleUVBilinearDown(int src_w - } - free_aligned_buffer_64(row); - } -- return 0; - } - #endif - - // Scale UV up with bilinear interpolation. - #if HAS_SCALEUVBILINEARUP --static int ScaleUVBilinearUp(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint8_t* src_uv, -- uint8_t* dst_uv, -- int x, -- int dx, -- int y, -- int dy, -- enum FilterMode filtering) { -+static void ScaleUVBilinearUp(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint8_t* src_uv, -+ uint8_t* dst_uv, -+ int x, -+ int dx, -+ int y, -+ int dy, -+ enum FilterMode filtering) { - int j; - void (*InterpolateRow)(uint8_t* dst_uv, const uint8_t* src_uv, - ptrdiff_t src_stride, int dst_width, -@@ -547,11 +511,6 @@ static int ScaleUVBilinearUp(int src_wid - } - } - #endif --#if defined(HAS_INTERPOLATEROW_RVV) -- if (TestCpuFlag(kCpuHasRVV)) { -- InterpolateRow = InterpolateRow_RVV; -- } --#endif - if (src_width >= 32768) { - ScaleUVFilterCols = filtering ? ScaleUVFilterCols64_C : ScaleUVCols64_C; - } -@@ -617,8 +576,6 @@ static int ScaleUVBilinearUp(int src_wid - // Allocate 2 rows of UV. - const int row_size = (dst_width * 2 + 15) & ~15; - align_buffer_64(row, row_size * 2); -- if (!row) -- return 1; - - uint8_t* rowptr = row; - int rowstride = row_size; -@@ -662,7 +619,6 @@ static int ScaleUVBilinearUp(int src_wid - } - free_aligned_buffer_64(row); - } -- return 0; - } - #endif // HAS_SCALEUVBILINEARUP - -@@ -671,14 +627,14 @@ static int ScaleUVBilinearUp(int src_wid - // This is an optimized version for scaling up a plane to 2 times of - // its original width, using linear interpolation. - // This is used to scale U and V planes of NV16 to NV24. --static void ScaleUVLinearUp2(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint8_t* src_uv, -- uint8_t* dst_uv) { -+void ScaleUVLinearUp2(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint8_t* src_uv, -+ uint8_t* dst_uv) { - void (*ScaleRowUp)(const uint8_t* src_uv, uint8_t* dst_uv, int dst_width) = - ScaleUVRowUp2_Linear_Any_C; - int i; -@@ -688,30 +644,24 @@ static void ScaleUVLinearUp2(int src_wid - // This function can only scale up by 2 times horizontally. - assert(src_width == ((dst_width + 1) / 2)); - --#ifdef HAS_SCALEUVROWUP2_LINEAR_SSSE3 -+#ifdef HAS_SCALEUVROWUP2LINEAR_SSSE3 - if (TestCpuFlag(kCpuHasSSSE3)) { - ScaleRowUp = ScaleUVRowUp2_Linear_Any_SSSE3; - } - #endif - --#ifdef HAS_SCALEUVROWUP2_LINEAR_AVX2 -+#ifdef HAS_SCALEUVROWUP2LINEAR_AVX2 - if (TestCpuFlag(kCpuHasAVX2)) { - ScaleRowUp = ScaleUVRowUp2_Linear_Any_AVX2; - } - #endif - --#ifdef HAS_SCALEUVROWUP2_LINEAR_NEON -+#ifdef HAS_SCALEUVROWUP2LINEAR_NEON - if (TestCpuFlag(kCpuHasNEON)) { - ScaleRowUp = ScaleUVRowUp2_Linear_Any_NEON; - } - #endif - --#ifdef HAS_SCALEUVROWUP2_LINEAR_RVV -- if (TestCpuFlag(kCpuHasRVV)) { -- ScaleRowUp = ScaleUVRowUp2_Linear_RVV; -- } --#endif -- - if (dst_height == 1) { - ScaleRowUp(src_uv + ((src_height - 1) / 2) * (intptr_t)src_stride, dst_uv, - dst_width); -@@ -730,14 +680,14 @@ static void ScaleUVLinearUp2(int src_wid - // This is an optimized version for scaling up a plane to 2 times of - // its original size, using bilinear interpolation. - // This is used to scale U and V planes of NV12 to NV24. --static void ScaleUVBilinearUp2(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint8_t* src_ptr, -- uint8_t* dst_ptr) { -+void ScaleUVBilinearUp2(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint8_t* src_ptr, -+ uint8_t* dst_ptr) { - void (*Scale2RowUp)(const uint8_t* src_ptr, ptrdiff_t src_stride, - uint8_t* dst_ptr, ptrdiff_t dst_stride, int dst_width) = - ScaleUVRowUp2_Bilinear_Any_C; -@@ -747,30 +697,24 @@ static void ScaleUVBilinearUp2(int src_w - assert(src_width == ((dst_width + 1) / 2)); - assert(src_height == ((dst_height + 1) / 2)); - --#ifdef HAS_SCALEUVROWUP2_BILINEAR_SSSE3 -+#ifdef HAS_SCALEUVROWUP2BILINEAR_SSSE3 - if (TestCpuFlag(kCpuHasSSSE3)) { - Scale2RowUp = ScaleUVRowUp2_Bilinear_Any_SSSE3; - } - #endif - --#ifdef HAS_SCALEUVROWUP2_BILINEAR_AVX2 -+#ifdef HAS_SCALEUVROWUP2BILINEAR_AVX2 - if (TestCpuFlag(kCpuHasAVX2)) { - Scale2RowUp = ScaleUVRowUp2_Bilinear_Any_AVX2; - } - #endif - --#ifdef HAS_SCALEUVROWUP2_BILINEAR_NEON -+#ifdef HAS_SCALEUVROWUP2BILINEAR_NEON - if (TestCpuFlag(kCpuHasNEON)) { - Scale2RowUp = ScaleUVRowUp2_Bilinear_Any_NEON; - } - #endif - --#ifdef HAS_SCALEUVROWUP2_BILINEAR_RVV -- if (TestCpuFlag(kCpuHasRVV)) { -- Scale2RowUp = ScaleUVRowUp2_Bilinear_RVV; -- } --#endif -- - Scale2RowUp(src_ptr, 0, dst_ptr, 0, dst_width); - dst_ptr += dst_stride; - for (x = 0; x < src_height - 1; ++x) { -@@ -790,14 +734,14 @@ static void ScaleUVBilinearUp2(int src_w - // This is an optimized version for scaling up a plane to 2 times of - // its original width, using linear interpolation. - // This is used to scale U and V planes of P210 to P410. --static void ScaleUVLinearUp2_16(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint16_t* src_uv, -- uint16_t* dst_uv) { -+void ScaleUVLinearUp2_16(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint16_t* src_uv, -+ uint16_t* dst_uv) { - void (*ScaleRowUp)(const uint16_t* src_uv, uint16_t* dst_uv, int dst_width) = - ScaleUVRowUp2_Linear_16_Any_C; - int i; -@@ -807,19 +751,19 @@ static void ScaleUVLinearUp2_16(int src_ - // This function can only scale up by 2 times horizontally. - assert(src_width == ((dst_width + 1) / 2)); - --#ifdef HAS_SCALEUVROWUP2_LINEAR_16_SSE41 -+#ifdef HAS_SCALEUVROWUP2LINEAR_16_SSE41 - if (TestCpuFlag(kCpuHasSSE41)) { - ScaleRowUp = ScaleUVRowUp2_Linear_16_Any_SSE41; - } - #endif - --#ifdef HAS_SCALEUVROWUP2_LINEAR_16_AVX2 -+#ifdef HAS_SCALEUVROWUP2LINEAR_16_AVX2 - if (TestCpuFlag(kCpuHasAVX2)) { - ScaleRowUp = ScaleUVRowUp2_Linear_16_Any_AVX2; - } - #endif - --#ifdef HAS_SCALEUVROWUP2_LINEAR_16_NEON -+#ifdef HAS_SCALEUVROWUP2LINEAR_16_NEON - if (TestCpuFlag(kCpuHasNEON)) { - ScaleRowUp = ScaleUVRowUp2_Linear_16_Any_NEON; - } -@@ -843,14 +787,14 @@ static void ScaleUVLinearUp2_16(int src_ - // This is an optimized version for scaling up a plane to 2 times of - // its original size, using bilinear interpolation. - // This is used to scale U and V planes of P010 to P410. --static void ScaleUVBilinearUp2_16(int src_width, -- int src_height, -- int dst_width, -- int dst_height, -- int src_stride, -- int dst_stride, -- const uint16_t* src_ptr, -- uint16_t* dst_ptr) { -+void ScaleUVBilinearUp2_16(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ int src_stride, -+ int dst_stride, -+ const uint16_t* src_ptr, -+ uint16_t* dst_ptr) { - void (*Scale2RowUp)(const uint16_t* src_ptr, ptrdiff_t src_stride, - uint16_t* dst_ptr, ptrdiff_t dst_stride, int dst_width) = - ScaleUVRowUp2_Bilinear_16_Any_C; -@@ -860,19 +804,19 @@ static void ScaleUVBilinearUp2_16(int sr - assert(src_width == ((dst_width + 1) / 2)); - assert(src_height == ((dst_height + 1) / 2)); - --#ifdef HAS_SCALEUVROWUP2_BILINEAR_16_SSE41 -+#ifdef HAS_SCALEUVROWUP2BILINEAR_16_SSE41 - if (TestCpuFlag(kCpuHasSSE41)) { - Scale2RowUp = ScaleUVRowUp2_Bilinear_16_Any_SSE41; - } - #endif - --#ifdef HAS_SCALEUVROWUP2_BILINEAR_16_AVX2 -+#ifdef HAS_SCALEUVROWUP2BILINEAR_16_AVX2 - if (TestCpuFlag(kCpuHasAVX2)) { - Scale2RowUp = ScaleUVRowUp2_Bilinear_16_Any_AVX2; - } - #endif - --#ifdef HAS_SCALEUVROWUP2_BILINEAR_16_NEON -+#ifdef HAS_SCALEUVROWUP2BILINEAR_16_NEON - if (TestCpuFlag(kCpuHasNEON)) { - Scale2RowUp = ScaleUVRowUp2_Bilinear_16_Any_NEON; - } -@@ -998,19 +942,19 @@ static int UVCopy_16(const uint16_t* src - // Scale a UV plane (from NV12) - // This function in turn calls a scaling function - // suitable for handling the desired resolutions. --static int ScaleUV(const uint8_t* src, -- int src_stride, -- int src_width, -- int src_height, -- uint8_t* dst, -- int dst_stride, -- int dst_width, -- int dst_height, -- int clip_x, -- int clip_y, -- int clip_width, -- int clip_height, -- enum FilterMode filtering) { -+static void ScaleUV(const uint8_t* src, -+ int src_stride, -+ int src_width, -+ int src_height, -+ uint8_t* dst, -+ int dst_stride, -+ int dst_width, -+ int dst_height, -+ int clip_x, -+ int clip_y, -+ int clip_width, -+ int clip_height, -+ enum FilterMode filtering) { - // Initial source x/y coordinate and step values as 16.16 fixed point. - int x = 0; - int y = 0; -@@ -1056,22 +1000,22 @@ static int ScaleUV(const uint8_t* src, - ScaleUVDown2(src_width, src_height, clip_width, clip_height, - src_stride, dst_stride, src, dst, x, dx, y, dy, - filtering); -- return 0; -+ return; - } - #endif - #if HAS_SCALEUVDOWN4BOX - if (dx == 0x40000 && filtering == kFilterBox) { - // Optimized 1/4 box downsample. -- return ScaleUVDown4Box(src_width, src_height, clip_width, clip_height, -- src_stride, dst_stride, src, dst, x, dx, y, -- dy); -+ ScaleUVDown4Box(src_width, src_height, clip_width, clip_height, -+ src_stride, dst_stride, src, dst, x, dx, y, dy); -+ return; - } - #endif - #if HAS_SCALEUVDOWNEVEN - ScaleUVDownEven(src_width, src_height, clip_width, clip_height, - src_stride, dst_stride, src, dst, x, dx, y, dy, - filtering); -- return 0; -+ return; - #endif - } - // Optimized odd scale down. ie 3, 5, 7, 9x. -@@ -1082,7 +1026,7 @@ static int ScaleUV(const uint8_t* src, - // Straight copy. - UVCopy(src + (y >> 16) * (intptr_t)src_stride + (x >> 16) * 2, - src_stride, dst, dst_stride, clip_width, clip_height); -- return 0; -+ return; - } - #endif - } -@@ -1093,37 +1037,38 @@ static int ScaleUV(const uint8_t* src, - // Arbitrary scale vertically, but unscaled horizontally. - ScalePlaneVertical(src_height, clip_width, clip_height, src_stride, - dst_stride, src, dst, x, y, dy, /*bpp=*/2, filtering); -- return 0; -+ return; - } -- if ((filtering == kFilterLinear) && ((dst_width + 1) / 2 == src_width)) { -+ if (filtering && (dst_width + 1) / 2 == src_width) { - ScaleUVLinearUp2(src_width, src_height, clip_width, clip_height, src_stride, - dst_stride, src, dst); -- return 0; -+ return; - } - if ((clip_height + 1) / 2 == src_height && - (clip_width + 1) / 2 == src_width && - (filtering == kFilterBilinear || filtering == kFilterBox)) { - ScaleUVBilinearUp2(src_width, src_height, clip_width, clip_height, - src_stride, dst_stride, src, dst); -- return 0; -+ return; - } - #if HAS_SCALEUVBILINEARUP - if (filtering && dy < 65536) { -- return ScaleUVBilinearUp(src_width, src_height, clip_width, clip_height, -- src_stride, dst_stride, src, dst, x, dx, y, dy, -- filtering); -+ ScaleUVBilinearUp(src_width, src_height, clip_width, clip_height, -+ src_stride, dst_stride, src, dst, x, dx, y, dy, -+ filtering); -+ return; - } - #endif - #if HAS_SCALEUVBILINEARDOWN - if (filtering) { -- return ScaleUVBilinearDown(src_width, src_height, clip_width, clip_height, -- src_stride, dst_stride, src, dst, x, dx, y, dy, -- filtering); -+ ScaleUVBilinearDown(src_width, src_height, clip_width, clip_height, -+ src_stride, dst_stride, src, dst, x, dx, y, dy, -+ filtering); -+ return; - } - #endif - ScaleUVSimple(src_width, src_height, clip_width, clip_height, src_stride, - dst_stride, src, dst, x, dx, y, dy); -- return 0; - } - - // Scale an UV image. -@@ -1141,9 +1086,9 @@ int UVScale(const uint8_t* src_uv, - src_height > 32768 || !dst_uv || dst_width <= 0 || dst_height <= 0) { - return -1; - } -- return ScaleUV(src_uv, src_stride_uv, src_width, src_height, dst_uv, -- dst_stride_uv, dst_width, dst_height, 0, 0, dst_width, -- dst_height, filtering); -+ ScaleUV(src_uv, src_stride_uv, src_width, src_height, dst_uv, dst_stride_uv, -+ dst_width, dst_height, 0, 0, dst_width, dst_height, filtering); -+ return 0; - } - - // Scale a 16 bit UV image. -@@ -1194,7 +1139,7 @@ int UVScale_16(const uint16_t* src_uv, - } - #endif - -- if ((filtering == kFilterLinear) && ((dst_width + 1) / 2 == src_width)) { -+ if (filtering && (dst_width + 1) / 2 == src_width) { - ScaleUVLinearUp2_16(src_width, src_height, dst_width, dst_height, - src_stride_uv, dst_stride_uv, src_uv, dst_uv); - return 0; -diff --git a/media/libyuv/libyuv/tools_libyuv/autoroller/roll_deps.py b/media/libyuv/libyuv/tools_libyuv/autoroller/roll_deps.py ---- a/media/libyuv/libyuv/tools_libyuv/autoroller/roll_deps.py -+++ b/media/libyuv/libyuv/tools_libyuv/autoroller/roll_deps.py -@@ -1,14 +1,18 @@ - #!/usr/bin/env vpython3 - --# Copyright (c) 2017 The LibYUV project authors. All Rights Reserved. -+# Copyright 2017 The LibYuv Project Authors. All rights reserved. - # - # Use of this source code is governed by a BSD-style license - # that can be found in the LICENSE file in the root of the source - # tree. An additional intellectual property rights grant can be found --# in the file PATENTS. All contributing project authors may -+# in the file PATENTS. All contributing project authors may - # be found in the AUTHORS file in the root of the source tree. --"""Script to automatically roll dependencies in the LibYUV DEPS file.""" - -+# This is a modified copy of the script in -+# https://webrtc.googlesource.com/src/+/master/tools_webrtc/autoroller/roll_deps.py -+# customized for libyuv. -+ -+"""Script to automatically roll dependencies in the libyuv DEPS file.""" - - import argparse - import base64 -@@ -21,47 +25,9 @@ import sys - import urllib.request - - --def FindSrcDirPath(): -- """Returns the abs path to the src/ dir of the project.""" -- src_dir = os.path.dirname(os.path.abspath(__file__)) -- while os.path.basename(src_dir) != 'src': -- src_dir = os.path.normpath(os.path.join(src_dir, os.pardir)) -- return src_dir -- -- - # Skip these dependencies (list without solution name prefix). - DONT_AUTOROLL_THESE = [ -- 'third_party/fuchsia-gn-sdk', -- 'src/third_party/gflags/src', -- 'src/third_party/mockito/src', --] -- --# These dependencies are missing in chromium/src/DEPS, either unused or already --# in-tree. For instance, src/base is a part of the Chromium source git repo, --# but we pull it through a subtree mirror, so therefore it isn't listed in --# Chromium's deps but it is in ours. --LIBYUV_ONLY_DEPS = [ -- 'src/base', -- 'src/build', -- 'src/buildtools', -- 'src/ios', -- 'src/testing', -- 'src/third_party', -- 'src/third_party/android_support_test_runner', -- 'src/third_party/bazel', -- 'src/third_party/bouncycastle', -- 'src/third_party/errorprone/lib', -- 'src/third_party/findbugs', -- 'src/third_party/gson', -- 'src/third_party/gtest-parallel', -- 'src/third_party/guava', -- 'src/third_party/intellij', -- 'src/third_party/jsr-305/src', -- 'src/third_party/ow2_asm', -- 'src/third_party/proguard', -- 'src/third_party/ub-uiautomator/lib', -- 'src/tools', -- 'src/tools/clang/dsymutil', -+ 'src/third_party/gflags/src', - ] - - LIBYUV_URL = 'https://chromium.googlesource.com/libyuv/libyuv' -@@ -71,22 +37,16 @@ CHROMIUM_LOG_TEMPLATE = CHROMIUM_SRC_URL - CHROMIUM_FILE_TEMPLATE = CHROMIUM_SRC_URL + '/+/%s/%s' - - COMMIT_POSITION_RE = re.compile('^Cr-Commit-Position: .*#([0-9]+).*$') --CLANG_REVISION_RE = re.compile(r'^CLANG_REVISION = \'([-0-9a-z]+)\'$') -+CLANG_REVISION_RE = re.compile(r'^CLANG_REVISION = \'([0-9a-z-]+)\'$') - ROLL_BRANCH_NAME = 'roll_chromium_revision' - - SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) --CHECKOUT_SRC_DIR = FindSrcDirPath() -+CHECKOUT_SRC_DIR = os.path.realpath(os.path.join(SCRIPT_DIR, os.pardir, -+ os.pardir)) - CHECKOUT_ROOT_DIR = os.path.realpath(os.path.join(CHECKOUT_SRC_DIR, os.pardir)) - --# Copied from tools/android/roll/android_deps/.../BuildConfigGenerator.groovy. --ANDROID_DEPS_START = r'=== ANDROID_DEPS Generated Code Start ===' --ANDROID_DEPS_END = r'=== ANDROID_DEPS Generated Code End ===' --# Location of automically gathered android deps. --ANDROID_DEPS_PATH = 'src/third_party/android_deps/' -- - sys.path.append(os.path.join(CHECKOUT_SRC_DIR, 'build')) --import find_depot_tools -- -+import find_depot_tools # pylint: disable=wrong-import-position - find_depot_tools.add_depot_tools_to_path() - - CLANG_UPDATE_SCRIPT_URL_PATH = 'tools/clang/scripts/update.py' -@@ -96,26 +56,11 @@ CLANG_UPDATE_SCRIPT_LOCAL_PATH = os.path - DepsEntry = collections.namedtuple('DepsEntry', 'path url revision') - ChangedDep = collections.namedtuple('ChangedDep', - 'path url current_rev new_rev') --CipdDepsEntry = collections.namedtuple('CipdDepsEntry', 'path packages') --VersionEntry = collections.namedtuple('VersionEntry', 'version') --ChangedCipdPackage = collections.namedtuple( -- 'ChangedCipdPackage', 'path package current_version new_version') --ChangedVersionEntry = collections.namedtuple( -- 'ChangedVersionEntry', 'path current_version new_version') -- --ChromiumRevisionUpdate = collections.namedtuple('ChromiumRevisionUpdate', -- ('current_chromium_rev ' -- 'new_chromium_rev ')) -- - - class RollError(Exception): - pass - - --def StrExpansion(): -- return lambda str_value: str_value -- -- - def VarLookup(local_scope): - return lambda var_name: local_scope['vars'][var_name] - -@@ -123,9 +68,9 @@ def VarLookup(local_scope): - def ParseDepsDict(deps_content): - local_scope = {} - global_scope = { -- 'Str': StrExpansion(), -- 'Var': VarLookup(local_scope), -- 'deps_os': {}, -+ 'Var': VarLookup(local_scope), -+ 'Str': lambda s: s, -+ 'deps_os': {}, - } - exec(deps_content, global_scope, local_scope) - return local_scope -@@ -137,6 +82,11 @@ def ParseLocalDepsFile(filename): - return ParseDepsDict(deps_content) - - -+def ParseRemoteCrDepsFile(revision): -+ deps_content = ReadRemoteCrFile('DEPS', revision) -+ return ParseDepsDict(deps_content) -+ -+ - def ParseCommitPosition(commit_message): - for line in reversed(commit_message.splitlines()): - m = COMMIT_POSITION_RE.match(line.strip()) -@@ -147,18 +97,15 @@ def ParseCommitPosition(commit_message): - sys.exit(-1) - - --def _RunCommand(command, -- working_dir=None, -- ignore_exit_code=False, -- extra_env=None, -- input_data=None): -+def _RunCommand(command, working_dir=None, ignore_exit_code=False, -+ extra_env=None, input_data=None): - """Runs a command and returns the output from that command. - -- If the command fails (exit code != 0), the function will exit the process. -+ If the command fails (exit code != 0), the function will exit the process. - -- Returns: -- A tuple containing the stdout and stderr outputs as strings. -- """ -+ Returns: -+ A tuple containing the stdout and stderr outputs as strings. -+ """ - working_dir = working_dir or CHECKOUT_SRC_DIR - logging.debug('CMD: %s CWD: %s', ' '.join(command), working_dir) - env = os.environ.copy() -@@ -187,9 +134,9 @@ def _RunCommand(command, - def _GetBranches(): - """Returns a tuple of active,branches. - -- The 'active' is the name of the currently active branch and 'branches' is a -- list of all branches. -- """ -+ The 'active' is the name of the currently active branch and 'branches' is a -+ list of all branches. -+ """ - lines = _RunCommand(['git', 'branch'])[0].split('\n') - branches = [] - active = '' -@@ -213,16 +160,9 @@ def _ReadGitilesContent(url): - - - def ReadRemoteCrFile(path_below_src, revision): -- """Reads a remote Chromium file of a specific revision. -- -- Args: -- path_below_src: A path to the target file relative to src dir. -- revision: Revision to read. -- Returns: -- A string with file content. -- """ -- return _ReadGitilesContent(CHROMIUM_FILE_TEMPLATE % -- (revision, path_below_src)) -+ """Reads a remote Chromium file of a specific revision. Returns a string.""" -+ return _ReadGitilesContent(CHROMIUM_FILE_TEMPLATE % (revision, -+ path_below_src)) - - - def ReadRemoteCrCommit(revision): -@@ -231,13 +171,7 @@ def ReadRemoteCrCommit(revision): - - - def ReadUrlContent(url): -- """Connect to a remote host and read the contents. -- -- Args: -- url: URL to connect to. -- Returns: -- A list of lines. -- """ -+ """Connect to a remote host and read the contents. Returns a list of lines.""" - conn = urllib.request.urlopen(url) - try: - return conn.readlines() -@@ -251,172 +185,52 @@ def ReadUrlContent(url): - def GetMatchingDepsEntries(depsentry_dict, dir_path): - """Gets all deps entries matching the provided path. - -- This list may contain more than one DepsEntry object. -- Example: dir_path='src/testing' would give results containing both -- 'src/testing/gtest' and 'src/testing/gmock' deps entries for Chromium's -- DEPS. -- Example 2: dir_path='src/build' should return 'src/build' but not -- 'src/buildtools'. -+ This list may contain more than one DepsEntry object. -+ Example: dir_path='src/testing' would give results containing both -+ 'src/testing/gtest' and 'src/testing/gmock' deps entries for Chromium's DEPS. -+ Example 2: dir_path='src/build' should return 'src/build' but not -+ 'src/buildtools'. - -- Returns: -- A list of DepsEntry objects. -- """ -+ Returns: -+ A list of DepsEntry objects. -+ """ - result = [] - for path, depsentry in depsentry_dict.items(): - if path == dir_path: - result.append(depsentry) - else: - parts = path.split('/') -- if all(part == parts[i] for i, part in enumerate(dir_path.split('/'))): -+ if all(part == parts[i] -+ for i, part in enumerate(dir_path.split('/'))): - result.append(depsentry) - return result - -- - def BuildDepsentryDict(deps_dict): - """Builds a dict of paths to DepsEntry objects from a raw deps dict.""" - result = {} - - def AddDepsEntries(deps_subdict): -- for path, dep in deps_subdict.items(): -- if path in result: -- continue -- if not isinstance(dep, dict): -- dep = {'url': dep} -- if dep.get('dep_type') == 'cipd': -- result[path] = CipdDepsEntry(path, dep['packages']) -- else: -- if '@' not in dep['url']: -+ for path, deps_url_spec in deps_subdict.items(): -+ if isinstance(deps_url_spec, dict): -+ if deps_url_spec.get('dep_type') == 'cipd': - continue -- url, revision = dep['url'].split('@') -+ deps_url = deps_url_spec['url'] -+ else: -+ deps_url = deps_url_spec -+ if not path in result: -+ url, revision = deps_url.split('@') if deps_url else (None, None) - result[path] = DepsEntry(path, url, revision) - -- def AddVersionEntry(vars_subdict): -- for key, value in vars_subdict.items(): -- if key in result: -- continue -- if not key.endswith('_version'): -- continue -- key = re.sub('_version$', '', key) -- result[key] = VersionEntry(value) -- - AddDepsEntries(deps_dict['deps']) -- for deps_os in ['win', 'mac', 'unix', 'android', 'ios', 'unix']: -+ for deps_os in ['win', 'mac', 'linux', 'android', 'ios', 'unix']: - AddDepsEntries(deps_dict.get('deps_os', {}).get(deps_os, {})) -- AddVersionEntry(deps_dict.get('vars', {})) - return result - - --def _FindChangedCipdPackages(path, old_pkgs, new_pkgs): -- old_pkgs_names = {p['package'] for p in old_pkgs} -- new_pkgs_names = {p['package'] for p in new_pkgs} -- pkgs_equal = (old_pkgs_names == new_pkgs_names) -- added_pkgs = [p for p in new_pkgs_names if p not in old_pkgs_names] -- removed_pkgs = [p for p in old_pkgs_names if p not in new_pkgs_names] -- -- assert pkgs_equal, ('Old: %s\n New: %s.\nYou need to do a manual roll ' -- 'and remove/add entries in DEPS so the old and new ' -- 'list match.\nMost likely, you should add \"%s\" and ' -- 'remove \"%s\"' % -- (old_pkgs, new_pkgs, added_pkgs, removed_pkgs)) -- -- for old_pkg in old_pkgs: -- for new_pkg in new_pkgs: -- old_version = old_pkg['version'] -- new_version = new_pkg['version'] -- if (old_pkg['package'] == new_pkg['package'] -- and old_version != new_version): -- logging.debug('Roll dependency %s to %s', path, new_version) -- yield ChangedCipdPackage(path, old_pkg['package'], old_version, -- new_version) -- -- --def _FindChangedVars(name, old_version, new_version): -- if old_version != new_version: -- logging.debug('Roll dependency %s to %s', name, new_version) -- yield ChangedVersionEntry(name, old_version, new_version) -- -- --def _FindNewDeps(old, new): -- """ Gather dependencies only in `new` and return corresponding paths. """ -- old_entries = set(BuildDepsentryDict(old)) -- new_entries = set(BuildDepsentryDict(new)) -- return [ -- path for path in new_entries - old_entries -- if path not in DONT_AUTOROLL_THESE -- ] -- -- --def FindAddedDeps(libyuv_deps, new_cr_deps): -- """ -- Calculate new deps entries of interest. -- -- Ideally, that would mean: only appearing in chromium DEPS -- but transitively used in LibYUV. -- -- Since it's hard to compute, we restrict ourselves to a well defined subset: -- deps sitting in `ANDROID_DEPS_PATH`. -- Otherwise, assumes that's a Chromium-only dependency. -- -- Args: -- libyuv_deps: dict of deps as defined in the LibYUV DEPS file. -- new_cr_deps: dict of deps as defined in the chromium DEPS file. -- -- Caveat: Doesn't detect a new package in existing dep. -- -- Returns: -- A tuple consisting of: -- A list of paths added dependencies sitting in `ANDROID_DEPS_PATH`. -- A list of paths for other added dependencies. -- """ -- all_added_deps = _FindNewDeps(libyuv_deps, new_cr_deps) -- generated_android_deps = [ -- path for path in all_added_deps if path.startswith(ANDROID_DEPS_PATH) -- ] -- other_deps = [ -- path for path in all_added_deps if path not in generated_android_deps -- ] -- return generated_android_deps, other_deps -- -- --def FindRemovedDeps(libyuv_deps, new_cr_deps): -- """ -- Calculate obsolete deps entries. -- -- Ideally, that would mean: no more appearing in chromium DEPS -- and not used in LibYUV. -- -- Since it's hard to compute: -- 1/ We restrict ourselves to a well defined subset: -- deps sitting in `ANDROID_DEPS_PATH`. -- 2/ We rely on existing behavior of CalculateChangeDeps. -- I.e. Assumes non-CIPD dependencies are LibYUV-only, don't remove them. -- -- Args: -- libyuv_deps: dict of deps as defined in the LibYUV DEPS file. -- new_cr_deps: dict of deps as defined in the chromium DEPS file. -- -- Caveat: Doesn't detect a deleted package in existing dep. -- -- Returns: -- A tuple consisting of: -- A list of paths of dependencies removed from `ANDROID_DEPS_PATH`. -- A list of paths of unexpected disappearing dependencies. -- """ -- all_removed_deps = _FindNewDeps(new_cr_deps, libyuv_deps) -- generated_android_deps = sorted( -- [path for path in all_removed_deps if path.startswith(ANDROID_DEPS_PATH)]) -- # Webrtc-only dependencies are handled in CalculateChangedDeps. -- other_deps = sorted([ -- path for path in all_removed_deps -- if path not in generated_android_deps and path not in LIBYUV_ONLY_DEPS -- ]) -- return generated_android_deps, other_deps -- -- - def CalculateChangedDeps(libyuv_deps, new_cr_deps): - """ -- Calculate changed deps entries based on entries defined in the LibYUV DEPS -- file: -+ Calculate changed deps entries based on entries defined in the libyuv DEPS -+ file: - - If a shared dependency with the Chromium DEPS file: roll it to the same - revision as Chromium (i.e. entry in the new_cr_deps dict) - - If it's a Chromium sub-directory, roll it to the HEAD revision (notice -@@ -425,9 +239,9 @@ def CalculateChangedDeps(libyuv_deps, ne - - If it's another DEPS entry (not shared with Chromium), roll it to HEAD - unless it's configured to be skipped. - -- Returns: -- A list of ChangedDep objects representing the changed deps. -- """ -+ Returns: -+ A list of ChangedDep objects representing the changed deps. -+ """ - result = [] - libyuv_entries = BuildDepsentryDict(libyuv_deps) - new_cr_entries = BuildDepsentryDict(new_cr_deps) -@@ -436,117 +250,68 @@ def CalculateChangedDeps(libyuv_deps, ne - continue - cr_deps_entry = new_cr_entries.get(path) - if cr_deps_entry: -- assert type(cr_deps_entry) is type(libyuv_deps_entry) -- -- if isinstance(cr_deps_entry, CipdDepsEntry): -- result.extend( -- _FindChangedCipdPackages(path, libyuv_deps_entry.packages, -- cr_deps_entry.packages)) -- continue -- -- if isinstance(cr_deps_entry, VersionEntry): -- result.extend( -- _FindChangedVars(path, libyuv_deps_entry.version, -- cr_deps_entry.version)) -- continue -- - # Use the revision from Chromium's DEPS file. - new_rev = cr_deps_entry.revision - assert libyuv_deps_entry.url == cr_deps_entry.url, ( -- 'LibYUV DEPS entry %s has a different URL %s than Chromium %s.' % -- (path, libyuv_deps_entry.url, cr_deps_entry.url)) -+ 'Libyuv DEPS entry %s has a different URL (%s) than Chromium (%s).' % -+ (path, libyuv_deps_entry.url, cr_deps_entry.url)) - else: -- if isinstance(libyuv_deps_entry, DepsEntry): -- # Use the HEAD of the deps repo. -- stdout, _ = _RunCommand( -- ['git', 'ls-remote', libyuv_deps_entry.url, 'HEAD']) -- new_rev = stdout.strip().split('\t')[0] -- else: -- # The dependency has been removed from chromium. -- # This is handled by FindRemovedDeps. -- continue -+ # Use the HEAD of the deps repo. -+ stdout, _ = _RunCommand(['git', 'ls-remote', libyuv_deps_entry.url, -+ 'HEAD']) -+ new_rev = stdout.strip().split('\t')[0] - - # Check if an update is necessary. - if libyuv_deps_entry.revision != new_rev: - logging.debug('Roll dependency %s to %s', path, new_rev) -- result.append( -- ChangedDep(path, libyuv_deps_entry.url, libyuv_deps_entry.revision, -- new_rev)) -+ result.append(ChangedDep(path, libyuv_deps_entry.url, -+ libyuv_deps_entry.revision, new_rev)) - return sorted(result) - - - def CalculateChangedClang(new_cr_rev): -- - def GetClangRev(lines): - for line in lines: - match = CLANG_REVISION_RE.match(line) - if match: - return match.group(1) -- raise RollError('Could not parse Clang revision!') -+ raise RollError('Could not parse Clang revision from:\n' + '\n'.join(' ' + l for l in lines)) - - with open(CLANG_UPDATE_SCRIPT_LOCAL_PATH, 'r') as f: - current_lines = f.readlines() - current_rev = GetClangRev(current_lines) - - new_clang_update_py = ReadRemoteCrFile(CLANG_UPDATE_SCRIPT_URL_PATH, -- new_cr_rev).splitlines() -+ new_cr_rev).splitlines() - new_rev = GetClangRev(new_clang_update_py) - return ChangedDep(CLANG_UPDATE_SCRIPT_LOCAL_PATH, None, current_rev, new_rev) - - --def GenerateCommitMessage( -- rev_update, -- current_commit_pos, -- new_commit_pos, -- changed_deps_list, -- added_deps_paths=None, -- removed_deps_paths=None, -- clang_change=None, --): -- current_cr_rev = rev_update.current_chromium_rev[0:10] -- new_cr_rev = rev_update.new_chromium_rev[0:10] -+def GenerateCommitMessage(current_cr_rev, new_cr_rev, current_commit_pos, -+ new_commit_pos, changed_deps_list, clang_change): -+ current_cr_rev = current_cr_rev[0:10] -+ new_cr_rev = new_cr_rev[0:10] - rev_interval = '%s..%s' % (current_cr_rev, new_cr_rev) - git_number_interval = '%s:%s' % (current_commit_pos, new_commit_pos) - -- commit_msg = [ -- 'Roll chromium_revision %s (%s)\n' % (rev_interval, git_number_interval), -- 'Change log: %s' % (CHROMIUM_LOG_TEMPLATE % rev_interval), -- 'Full diff: %s\n' % (CHROMIUM_COMMIT_TEMPLATE % rev_interval) -- ] -- -- def Section(adjective, deps): -- noun = 'dependency' if len(deps) == 1 else 'dependencies' -- commit_msg.append('%s %s' % (adjective, noun)) -- -+ commit_msg = ['Roll chromium_revision %s (%s)\n' % (rev_interval, -+ git_number_interval)] -+ commit_msg.append('Change log: %s' % (CHROMIUM_LOG_TEMPLATE % rev_interval)) -+ commit_msg.append('Full diff: %s\n' % (CHROMIUM_COMMIT_TEMPLATE % -+ rev_interval)) - if changed_deps_list: -- Section('Changed', changed_deps_list) -+ commit_msg.append('Changed dependencies:') - - for c in changed_deps_list: -- if isinstance(c, ChangedCipdPackage): -- commit_msg.append('* %s: %s..%s' % -- (c.path, c.current_version, c.new_version)) -- elif isinstance(c, ChangedVersionEntry): -- commit_msg.append('* %s_vesion: %s..%s' % -- (c.path, c.current_version, c.new_version)) -- else: -- commit_msg.append('* %s: %s/+log/%s..%s' % -- (c.path, c.url, c.current_rev[0:10], c.new_rev[0:10])) -- -- if added_deps_paths: -- Section('Added', added_deps_paths) -- commit_msg.extend('* %s' % p for p in added_deps_paths) -- -- if removed_deps_paths: -- Section('Removed', removed_deps_paths) -- commit_msg.extend('* %s' % p for p in removed_deps_paths) -- -- if any([changed_deps_list, added_deps_paths, removed_deps_paths]): -+ commit_msg.append('* %s: %s/+log/%s..%s' % (c.path, c.url, -+ c.current_rev[0:10], -+ c.new_rev[0:10])) - change_url = CHROMIUM_FILE_TEMPLATE % (rev_interval, 'DEPS') - commit_msg.append('DEPS diff: %s\n' % change_url) - else: - commit_msg.append('No dependencies changed.') - -- if clang_change and clang_change.current_rev != clang_change.new_rev: -+ if clang_change.current_rev != clang_change.new_rev: - commit_msg.append('Clang version changed %s:%s' % - (clang_change.current_rev, clang_change.new_rev)) - change_url = CHROMIUM_FILE_TEMPLATE % (rev_interval, -@@ -555,61 +320,38 @@ def GenerateCommitMessage( - else: - commit_msg.append('No update to Clang.\n') - -+ # TBR needs to be non-empty for Gerrit to process it. -+ git_author = _RunCommand(['git', 'config', 'user.email'], -+ working_dir=CHECKOUT_SRC_DIR)[0].strip() -+ commit_msg.append('TBR=%s' % git_author) -+ - commit_msg.append('BUG=None') - return '\n'.join(commit_msg) - - --def UpdateDepsFile(deps_filename, rev_update, changed_deps, new_cr_content): -+def UpdateDepsFile(deps_filename, old_cr_revision, new_cr_revision, -+ changed_deps): - """Update the DEPS file with the new revision.""" - -- with open(deps_filename, 'rb') as deps_file: -- deps_content = deps_file.read().decode('utf-8') -- - # Update the chromium_revision variable. -- deps_content = deps_content.replace(rev_update.current_chromium_rev, -- rev_update.new_chromium_rev) -- -- # Add and remove dependencies. For now: only generated android deps. -- # Since gclient cannot add or remove deps, we on the fact that -- # these android deps are located in one place we can copy/paste. -- deps_re = re.compile(ANDROID_DEPS_START + '.*' + ANDROID_DEPS_END, re.DOTALL) -- new_deps = deps_re.search(new_cr_content) -- old_deps = deps_re.search(deps_content) -- if not new_deps or not old_deps: -- faulty = 'Chromium' if not new_deps else 'LibYUV' -- raise RollError('Was expecting to find "%s" and "%s"\n' -- 'in %s DEPS' % -- (ANDROID_DEPS_START, ANDROID_DEPS_END, faulty)) -- deps_content = deps_re.sub(new_deps.group(0), deps_content) -- -- for dep in changed_deps: -- if isinstance(dep, ChangedVersionEntry): -- deps_content = deps_content.replace(dep.current_version, dep.new_version) -- -+ with open(deps_filename, 'rb') as deps_file: -+ deps_content = deps_file.read().decode('utf-8') -+ deps_content = deps_content.replace(old_cr_revision, new_cr_revision) - with open(deps_filename, 'wb') as deps_file: - deps_file.write(deps_content.encode('utf-8')) - - # Update each individual DEPS entry. - for dep in changed_deps: -- # ChangedVersionEntry types are already been processed. -- if isinstance(dep, ChangedVersionEntry): -- continue - local_dep_dir = os.path.join(CHECKOUT_ROOT_DIR, dep.path) - if not os.path.isdir(local_dep_dir): - raise RollError( -- 'Cannot find local directory %s. Either run\n' -- 'gclient sync --deps=all\n' -- 'or make sure the .gclient file for your solution contains all ' -- 'platforms in the target_os list, i.e.\n' -+ 'Cannot find local directory %s. Make sure the .gclient file\n' -+ 'contains all platforms in the target_os list, i.e.\n' - 'target_os = ["android", "unix", "mac", "ios", "win"];\n' - 'Then run "gclient sync" again.' % local_dep_dir) -- if isinstance(dep, ChangedCipdPackage): -- package = dep.package.format() # Eliminate double curly brackets -- update = '%s:%s@%s' % (dep.path, package, dep.new_version) -- else: -- update = '%s@%s' % (dep.path, dep.new_rev) -- _RunCommand(['gclient', 'setdep', '--revision', update], -- working_dir=CHECKOUT_SRC_DIR) -+ _RunCommand( -+ ['gclient', 'setdep', '--revision', '%s@%s' % (dep.path, dep.new_rev)], -+ working_dir=CHECKOUT_SRC_DIR) - - - def _IsTreeClean(): -@@ -621,9 +363,9 @@ def _IsTreeClean(): - return False - - --def _EnsureUpdatedMainBranch(dry_run): -- current_branch = _RunCommand(['git', 'rev-parse', '--abbrev-ref', -- 'HEAD'])[0].splitlines()[0] -+def _EnsureUpdatedMasterBranch(dry_run): -+ current_branch = _RunCommand( -+ ['git', 'rev-parse', '--abbrev-ref', 'HEAD'])[0].splitlines()[0] - if current_branch != 'main': - logging.error('Please checkout the main branch and re-run this script.') - if not dry_run: -@@ -665,34 +407,19 @@ def ChooseCQMode(skip_cq, cq_over, curre - return 2 - - --def _GetCcRecipients(changed_deps_list): -- """Returns a list of emails to notify based on the changed deps list. -- """ -- cc_recipients = [] -- for c in changed_deps_list: -- pass -- return cc_recipients -- -- --def _UploadCL(commit_queue_mode, add_cc=None): -+def _UploadCL(commit_queue_mode): - """Upload the committed changes as a changelist to Gerrit. - -- commit_queue_mode: -- - 2: Submit to commit queue. -- - 1: Run trybots but do not submit to CQ. -- - 0: Skip CQ, upload only. -- -- add_cc: A list of email addresses to add as CC recipients. -- """ -- cc_recipients = [] -- if add_cc: -- cc_recipients.extend(add_cc) -+ commit_queue_mode: -+ - 2: Submit to commit queue. -+ - 1: Run trybots but do not submit to CQ. -+ - 0: Skip CQ, upload only. -+ """ - cmd = ['git', 'cl', 'upload', '--force', '--bypass-hooks'] - if commit_queue_mode >= 2: - logging.info('Sending the CL to the CQ...') - cmd.extend(['-o', 'label=Bot-Commit+1']) - cmd.extend(['-o', 'label=Commit-Queue+2']) -- cmd.extend(['--send-mail', '--cc', ','.join(cc_recipients)]) - elif commit_queue_mode >= 1: - logging.info('Starting CQ dry run...') - cmd.extend(['-o', 'label=Commit-Queue+1']) -@@ -702,57 +429,31 @@ def _UploadCL(commit_queue_mode, add_cc= - } - stdout, stderr = _RunCommand(cmd, extra_env=extra_env) - logging.debug('Output from "git cl upload":\nstdout:\n%s\n\nstderr:\n%s', -- stdout, stderr) -- -- --def GetRollRevisionRanges(opts, libyuv_deps): -- current_cr_rev = libyuv_deps['vars']['chromium_revision'] -- new_cr_rev = opts.revision -- if not new_cr_rev: -- stdout, _ = _RunCommand(['git', 'ls-remote', CHROMIUM_SRC_URL, 'HEAD']) -- head_rev = stdout.strip().split('\t')[0] -- logging.info('No revision specified. Using HEAD: %s', head_rev) -- new_cr_rev = head_rev -- -- return ChromiumRevisionUpdate(current_cr_rev, new_cr_rev) -+ stdout, stderr) - - - def main(): - p = argparse.ArgumentParser() -- p.add_argument('--clean', -- action='store_true', -- default=False, -+ p.add_argument('--clean', action='store_true', default=False, - help='Removes any previous local roll branch.') -- p.add_argument('-r', -- '--revision', -+ p.add_argument('-r', '--revision', - help=('Chromium Git revision to roll to. Defaults to the ' - 'Chromium HEAD revision if omitted.')) -- p.add_argument('--dry-run', -- action='store_true', -- default=False, -+ p.add_argument('--dry-run', action='store_true', default=False, - help=('Calculate changes and modify DEPS, but don\'t create ' - 'any local branch, commit, upload CL or send any ' - 'tryjobs.')) -- p.add_argument('-i', -- '--ignore-unclean-workdir', -- action='store_true', -+ p.add_argument('-i', '--ignore-unclean-workdir', action='store_true', - default=False, - help=('Ignore if the current branch is not main or if there ' - 'are uncommitted changes (default: %(default)s).')) - grp = p.add_mutually_exclusive_group() -- grp.add_argument('--skip-cq', -- action='store_true', -- default=False, -+ grp.add_argument('--skip-cq', action='store_true', default=False, - help='Skip sending the CL to the CQ (default: %(default)s)') -- grp.add_argument('--cq-over', -- type=int, -- default=1, -+ grp.add_argument('--cq-over', type=int, default=1, - help=('Commit queue dry run if the revision difference ' - 'is below this number (default: %(default)s)')) -- p.add_argument('-v', -- '--verbose', -- action='store_true', -- default=False, -+ p.add_argument('-v', '--verbose', action='store_true', default=False, - help='Be extra verbose in printing of log messages.') - opts = p.parse_args() - -@@ -769,52 +470,38 @@ def main(): - _RemovePreviousRollBranch(opts.dry_run) - - if not opts.ignore_unclean_workdir: -- _EnsureUpdatedMainBranch(opts.dry_run) -+ _EnsureUpdatedMasterBranch(opts.dry_run) -+ -+ new_cr_rev = opts.revision -+ if not new_cr_rev: -+ stdout, _ = _RunCommand(['git', 'ls-remote', CHROMIUM_SRC_URL, 'HEAD']) -+ head_rev = stdout.strip().split('\t')[0] -+ logging.info('No revision specified. Using HEAD: %s', head_rev) -+ new_cr_rev = head_rev - - deps_filename = os.path.join(CHECKOUT_SRC_DIR, 'DEPS') - libyuv_deps = ParseLocalDepsFile(deps_filename) -- -- rev_update = GetRollRevisionRanges(opts, libyuv_deps) -+ current_cr_rev = libyuv_deps['vars']['chromium_revision'] - -- current_commit_pos = ParseCommitPosition( -- ReadRemoteCrCommit(rev_update.current_chromium_rev)) -- new_commit_pos = ParseCommitPosition( -- ReadRemoteCrCommit(rev_update.new_chromium_rev)) -+ current_commit_pos = ParseCommitPosition(ReadRemoteCrCommit(current_cr_rev)) -+ new_commit_pos = ParseCommitPosition(ReadRemoteCrCommit(new_cr_rev)) - -- new_cr_content = ReadRemoteCrFile('DEPS', rev_update.new_chromium_rev) -- new_cr_deps = ParseDepsDict(new_cr_content) -+ new_cr_deps = ParseRemoteCrDepsFile(new_cr_rev) - changed_deps = CalculateChangedDeps(libyuv_deps, new_cr_deps) -- # Discard other deps, assumed to be chromium-only dependencies. -- new_generated_android_deps, _ = FindAddedDeps(libyuv_deps, new_cr_deps) -- removed_generated_android_deps, other_deps = FindRemovedDeps( -- libyuv_deps, new_cr_deps) -- if other_deps: -- raise RollError('LibYUV DEPS entries are missing from Chromium: %s.\n' -- 'Remove them or add them to either ' -- 'LIBYUV_ONLY_DEPS or DONT_AUTOROLL_THESE.' % other_deps) -- clang_change = CalculateChangedClang(rev_update.new_chromium_rev) -- commit_msg = GenerateCommitMessage( -- rev_update, -- current_commit_pos, -- new_commit_pos, -- changed_deps, -- added_deps_paths=new_generated_android_deps, -- removed_deps_paths=removed_generated_android_deps, -- clang_change=clang_change) -+ clang_change = CalculateChangedClang(new_cr_rev) -+ commit_msg = GenerateCommitMessage(current_cr_rev, new_cr_rev, -+ current_commit_pos, new_commit_pos, -+ changed_deps, clang_change) - logging.debug('Commit message:\n%s', commit_msg) - - _CreateRollBranch(opts.dry_run) -+ UpdateDepsFile(deps_filename, current_cr_rev, new_cr_rev, changed_deps) -+ _LocalCommit(commit_msg, opts.dry_run) -+ commit_queue_mode = ChooseCQMode(opts.skip_cq, opts.cq_over, -+ current_commit_pos, new_commit_pos) -+ logging.info('Uploading CL...') - if not opts.dry_run: -- UpdateDepsFile(deps_filename, rev_update, changed_deps, new_cr_content) -- if _IsTreeClean(): -- logging.info("No DEPS changes detected, skipping CL creation.") -- else: -- _LocalCommit(commit_msg, opts.dry_run) -- commit_queue_mode = ChooseCQMode(opts.skip_cq, opts.cq_over, -- current_commit_pos, new_commit_pos) -- logging.info('Uploading CL...') -- if not opts.dry_run: -- _UploadCL(commit_queue_mode, _GetCcRecipients(changed_deps)) -+ _UploadCL(commit_queue_mode) - return 0 - - -diff --git a/media/libyuv/libyuv/unit_test/convert_test.cc b/media/libyuv/libyuv/unit_test/convert_test.cc ---- a/media/libyuv/libyuv/unit_test/convert_test.cc -+++ b/media/libyuv/libyuv/unit_test/convert_test.cc -@@ -31,13 +31,6 @@ - #include "libyuv/row.h" /* For ARGBToAR30Row_AVX2 */ - #endif - --#if defined(__riscv) && !defined(__clang__) --#define DISABLE_SLOW_TESTS --#undef ENABLE_FULL_TESTS --#undef ENABLE_ROW_TESTS --#define LEAN_TESTS --#endif -- - // Some functions fail on big endian. Enable these tests on all cpus except - // PowerPC, but they are not optimized so disabled by default. - #if !defined(DISABLE_SLOW_TESTS) && !defined(__powerpc__) -@@ -58,8 +51,6 @@ namespace libyuv { - // subsample amount uses a divide. - #define SUBSAMPLE(v, a) ((((v) + (a)-1)) / (a)) - --#define ALIGNINT(V, ALIGN) (((V) + (ALIGN)-1) / (ALIGN) * (ALIGN)) -- - // Planar test - - #define TESTPLANARTOPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ -@@ -147,7 +138,6 @@ namespace libyuv { - free_aligned_buffer_page_end(src_v); \ - } - --#if defined(ENABLE_FULL_TESTS) - #define TESTPLANARTOP(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ - SRC_SUBSAMP_Y, FMT_PLANAR, DST_T, DST_BPC, \ - DST_SUBSAMP_X, DST_SUBSAMP_Y, SRC_DEPTH) \ -@@ -163,14 +153,6 @@ namespace libyuv { - TESTPLANARTOPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, SRC_SUBSAMP_Y, \ - FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, DST_SUBSAMP_Y, \ - benchmark_width_, _Opt, +, 0, SRC_DEPTH) --#else --#define TESTPLANARTOP(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ -- SRC_SUBSAMP_Y, FMT_PLANAR, DST_T, DST_BPC, \ -- DST_SUBSAMP_X, DST_SUBSAMP_Y, SRC_DEPTH) \ -- TESTPLANARTOPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, SRC_SUBSAMP_Y, \ -- FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, DST_SUBSAMP_Y, \ -- benchmark_width_, _Opt, +, 0, SRC_DEPTH) --#endif - - TESTPLANARTOP(I420, uint8_t, 1, 2, 2, I420, uint8_t, 1, 2, 2, 8) - TESTPLANARTOP(I422, uint8_t, 1, 2, 1, I420, uint8_t, 1, 2, 2, 8) -@@ -202,9 +184,7 @@ TESTPLANARTOP(I210, uint16_t, 2, 2, 1, I - TESTPLANARTOP(I410, uint16_t, 2, 1, 1, I420, uint8_t, 1, 2, 2, 10) - TESTPLANARTOP(I410, uint16_t, 2, 1, 1, I444, uint8_t, 1, 1, 1, 10) - TESTPLANARTOP(I012, uint16_t, 2, 2, 2, I420, uint8_t, 1, 2, 2, 12) --TESTPLANARTOP(I212, uint16_t, 2, 2, 1, I420, uint8_t, 1, 2, 2, 12) - TESTPLANARTOP(I212, uint16_t, 2, 2, 1, I422, uint8_t, 1, 2, 1, 12) --TESTPLANARTOP(I412, uint16_t, 2, 1, 1, I420, uint8_t, 1, 2, 2, 12) - TESTPLANARTOP(I412, uint16_t, 2, 1, 1, I444, uint8_t, 1, 1, 1, 12) - - // Test Android 420 to I420 -@@ -294,7 +274,6 @@ TESTPLANARTOP(I412, uint16_t, 2, 1, 1, I - free_aligned_buffer_page_end(src_uv); \ - } - --#if defined(ENABLE_FULL_TESTS) - #define TESTAPLANARTOP(SRC_FMT_PLANAR, PN, PIXEL_STRIDE, OFF_U, OFF_V, \ - SRC_SUBSAMP_X, SRC_SUBSAMP_Y, FMT_PLANAR, SUBSAMP_X, \ - SUBSAMP_Y) \ -@@ -310,14 +289,6 @@ TESTPLANARTOP(I412, uint16_t, 2, 1, 1, I - TESTAPLANARTOPI(SRC_FMT_PLANAR, PIXEL_STRIDE, SRC_SUBSAMP_X, SRC_SUBSAMP_Y, \ - FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, benchmark_width_, _Opt, +, \ - 0, PN, OFF_U, OFF_V) --#else --#define TESTAPLANARTOP(SRC_FMT_PLANAR, PN, PIXEL_STRIDE, OFF_U, OFF_V, \ -- SRC_SUBSAMP_X, SRC_SUBSAMP_Y, FMT_PLANAR, SUBSAMP_X, \ -- SUBSAMP_Y) \ -- TESTAPLANARTOPI(SRC_FMT_PLANAR, PIXEL_STRIDE, SRC_SUBSAMP_X, SRC_SUBSAMP_Y, \ -- FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, benchmark_width_, _Opt, +, \ -- 0, PN, OFF_U, OFF_V) --#endif - - TESTAPLANARTOP(Android420, I420, 1, 0, 0, 2, 2, I420, 2, 2) - TESTAPLANARTOP(Android420, NV12, 2, 0, 1, 2, 2, I420, 2, 2) -@@ -420,7 +391,6 @@ int I400ToNV21(const uint8_t* src_y, - free_aligned_buffer_page_end(src_v); \ - } - --#if defined(ENABLE_FULL_TESTS) - #define TESTPLANARTOBP(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ - SRC_SUBSAMP_Y, FMT_PLANAR, DST_T, DST_BPC, \ - DST_SUBSAMP_X, DST_SUBSAMP_Y, SRC_DEPTH) \ -@@ -437,14 +407,6 @@ int I400ToNV21(const uint8_t* src_y, - TESTPLANARTOBPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ - SRC_SUBSAMP_Y, FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, \ - DST_SUBSAMP_Y, benchmark_width_, _Opt, +, 0, SRC_DEPTH) --#else --#define TESTPLANARTOBP(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ -- SRC_SUBSAMP_Y, FMT_PLANAR, DST_T, DST_BPC, \ -- DST_SUBSAMP_X, DST_SUBSAMP_Y, SRC_DEPTH) \ -- TESTPLANARTOBPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ -- SRC_SUBSAMP_Y, FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, \ -- DST_SUBSAMP_Y, benchmark_width_, _Opt, +, 0, SRC_DEPTH) --#endif - - TESTPLANARTOBP(I420, uint8_t, 1, 2, 2, NV12, uint8_t, 1, 2, 2, 8) - TESTPLANARTOBP(I420, uint8_t, 1, 2, 2, NV21, uint8_t, 1, 2, 2, 8) -@@ -546,7 +508,6 @@ TESTPLANARTOBP(I212, uint16_t, 2, 2, 1, - free_aligned_buffer_page_end(src_uv); \ - } - --#if defined(ENABLE_FULL_TESTS) - #define TESTBPTOBP(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ - SRC_SUBSAMP_Y, FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, \ - DST_SUBSAMP_Y, SRC_DEPTH, TILE_WIDTH, TILE_HEIGHT) \ -@@ -570,15 +531,6 @@ TESTPLANARTOBP(I212, uint16_t, 2, 2, 1, - FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, DST_SUBSAMP_Y, \ - benchmark_width_, _NullY, +, 0, 0, SRC_DEPTH, TILE_WIDTH, \ - TILE_HEIGHT) --#else --#define TESTBPTOBP(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ -- SRC_SUBSAMP_Y, FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, \ -- DST_SUBSAMP_Y, SRC_DEPTH, TILE_WIDTH, TILE_HEIGHT) \ -- TESTBPTOBPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, SRC_SUBSAMP_Y, \ -- FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, DST_SUBSAMP_Y, \ -- benchmark_width_, _NullY, +, 0, 0, SRC_DEPTH, TILE_WIDTH, \ -- TILE_HEIGHT) --#endif - - TESTBPTOBP(NV21, uint8_t, 1, 2, 2, NV12, uint8_t, 1, 2, 2, 8, 1, 1) - TESTBPTOBP(NV12, uint8_t, 1, 2, 2, NV12Mirror, uint8_t, 1, 2, 2, 8, 1, 1) -@@ -593,6 +545,645 @@ TESTBPTOBP(P216, uint16_t, 2, 2, 1, P416 - TESTBPTOBP(MM21, uint8_t, 1, 2, 2, NV12, uint8_t, 1, 2, 2, 8, 16, 32) - TESTBPTOBP(MT2T, uint8_t, 10 / 8, 2, 2, P010, uint16_t, 2, 2, 2, 10, 16, 32) - -+#define TESTBPTOPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ -+ SRC_SUBSAMP_Y, FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, \ -+ DST_SUBSAMP_Y, W1280, N, NEG, OFF, SRC_DEPTH, TILE_WIDTH, \ -+ TILE_HEIGHT) \ -+ TEST_F(LibYUVConvertTest, SRC_FMT_PLANAR##To##FMT_PLANAR##N) { \ -+ static_assert(SRC_BPC == 1 || SRC_BPC == 2, "SRC BPC unsupported"); \ -+ static_assert(DST_BPC == 1 || DST_BPC == 2, "DST BPC unsupported"); \ -+ static_assert(SRC_SUBSAMP_X == 1 || SRC_SUBSAMP_X == 2, \ -+ "SRC_SUBSAMP_X unsupported"); \ -+ static_assert(SRC_SUBSAMP_Y == 1 || SRC_SUBSAMP_Y == 2, \ -+ "SRC_SUBSAMP_Y unsupported"); \ -+ static_assert(DST_SUBSAMP_X == 1 || DST_SUBSAMP_X == 2, \ -+ "DST_SUBSAMP_X unsupported"); \ -+ static_assert(DST_SUBSAMP_Y == 1 || DST_SUBSAMP_Y == 2, \ -+ "DST_SUBSAMP_Y unsupported"); \ -+ const int kWidth = W1280; \ -+ const int kHeight = benchmark_height_; \ -+ const int kSrcHalfWidth = SUBSAMPLE(kWidth, SRC_SUBSAMP_X); \ -+ const int kDstHalfWidth = SUBSAMPLE(kWidth, DST_SUBSAMP_X); \ -+ const int kDstHalfHeight = SUBSAMPLE(kHeight, DST_SUBSAMP_Y); \ -+ const int kPaddedWidth = (kWidth + (TILE_WIDTH - 1)) & ~(TILE_WIDTH - 1); \ -+ const int kPaddedHeight = \ -+ (kHeight + (TILE_HEIGHT - 1)) & ~(TILE_HEIGHT - 1); \ -+ const int kSrcHalfPaddedWidth = SUBSAMPLE(kPaddedWidth, SRC_SUBSAMP_X); \ -+ const int kSrcHalfPaddedHeight = SUBSAMPLE(kPaddedHeight, SRC_SUBSAMP_Y); \ -+ align_buffer_page_end(src_y, kPaddedWidth* kPaddedHeight* SRC_BPC + OFF); \ -+ align_buffer_page_end( \ -+ src_uv, kSrcHalfPaddedWidth* kSrcHalfPaddedHeight* SRC_BPC * 2 + OFF); \ -+ align_buffer_page_end(dst_y_c, kWidth* kHeight* DST_BPC); \ -+ align_buffer_page_end(dst_u_c, kDstHalfWidth* kDstHalfHeight* DST_BPC); \ -+ align_buffer_page_end(dst_v_c, kDstHalfWidth* kDstHalfHeight* DST_BPC); \ -+ align_buffer_page_end(dst_y_opt, kWidth* kHeight* DST_BPC); \ -+ align_buffer_page_end(dst_u_opt, kDstHalfWidth* kDstHalfHeight* DST_BPC); \ -+ align_buffer_page_end(dst_v_opt, kDstHalfWidth* kDstHalfHeight* DST_BPC); \ -+ SRC_T* src_y_p = reinterpret_cast(src_y + OFF); \ -+ SRC_T* src_uv_p = reinterpret_cast(src_uv + OFF); \ -+ for (int i = 0; i < kPaddedWidth * kPaddedHeight; ++i) { \ -+ src_y_p[i] = \ -+ (fastrand() & (((SRC_T)(-1)) << ((8 * SRC_BPC) - SRC_DEPTH))); \ -+ } \ -+ for (int i = 0; i < kSrcHalfPaddedWidth * kSrcHalfPaddedHeight * 2; ++i) { \ -+ src_uv_p[i] = \ -+ (fastrand() & (((SRC_T)(-1)) << ((8 * SRC_BPC) - SRC_DEPTH))); \ -+ } \ -+ memset(dst_y_c, 1, kWidth* kHeight* DST_BPC); \ -+ memset(dst_u_c, 2, kDstHalfWidth* kDstHalfHeight* DST_BPC); \ -+ memset(dst_v_c, 3, kDstHalfWidth* kDstHalfHeight* DST_BPC); \ -+ memset(dst_y_opt, 101, kWidth* kHeight* DST_BPC); \ -+ memset(dst_u_opt, 102, kDstHalfWidth* kDstHalfHeight* DST_BPC); \ -+ memset(dst_v_opt, 103, kDstHalfWidth* kDstHalfHeight* DST_BPC); \ -+ MaskCpuFlags(disable_cpu_flags_); \ -+ SRC_FMT_PLANAR##To##FMT_PLANAR( \ -+ src_y_p, kWidth, src_uv_p, kSrcHalfWidth * 2, \ -+ reinterpret_cast(dst_y_c), kWidth, \ -+ reinterpret_cast(dst_u_c), kDstHalfWidth, \ -+ reinterpret_cast(dst_v_c), kDstHalfWidth, kWidth, \ -+ NEG kHeight); \ -+ MaskCpuFlags(benchmark_cpu_info_); \ -+ for (int i = 0; i < benchmark_iterations_; ++i) { \ -+ SRC_FMT_PLANAR##To##FMT_PLANAR( \ -+ src_y_p, kWidth, src_uv_p, kSrcHalfWidth * 2, \ -+ reinterpret_cast(dst_y_opt), kWidth, \ -+ reinterpret_cast(dst_u_opt), kDstHalfWidth, \ -+ reinterpret_cast(dst_v_opt), kDstHalfWidth, kWidth, \ -+ NEG kHeight); \ -+ } \ -+ for (int i = 0; i < kHeight * kWidth * DST_BPC; ++i) { \ -+ EXPECT_EQ(dst_y_c[i], dst_y_opt[i]); \ -+ } \ -+ for (int i = 0; i < kDstHalfWidth * kDstHalfHeight * DST_BPC; ++i) { \ -+ EXPECT_EQ(dst_u_c[i], dst_u_opt[i]); \ -+ EXPECT_EQ(dst_v_c[i], dst_v_opt[i]); \ -+ } \ -+ free_aligned_buffer_page_end(dst_y_c); \ -+ free_aligned_buffer_page_end(dst_u_c); \ -+ free_aligned_buffer_page_end(dst_v_c); \ -+ free_aligned_buffer_page_end(dst_y_opt); \ -+ free_aligned_buffer_page_end(dst_u_opt); \ -+ free_aligned_buffer_page_end(dst_v_opt); \ -+ free_aligned_buffer_page_end(src_y); \ -+ free_aligned_buffer_page_end(src_uv); \ -+ } -+ -+#define TESTBPTOP(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, \ -+ SRC_SUBSAMP_Y, FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, \ -+ DST_SUBSAMP_Y, SRC_DEPTH, TILE_WIDTH, TILE_HEIGHT) \ -+ TESTBPTOPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, SRC_SUBSAMP_Y, \ -+ FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, DST_SUBSAMP_Y, \ -+ benchmark_width_ + 1, _Any, +, 0, SRC_DEPTH, TILE_WIDTH, \ -+ TILE_HEIGHT) \ -+ TESTBPTOPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, SRC_SUBSAMP_Y, \ -+ FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, DST_SUBSAMP_Y, \ -+ benchmark_width_, _Unaligned, +, 2, SRC_DEPTH, TILE_WIDTH, \ -+ TILE_HEIGHT) \ -+ TESTBPTOPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, SRC_SUBSAMP_Y, \ -+ FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, DST_SUBSAMP_Y, \ -+ benchmark_width_, _Invert, -, 0, SRC_DEPTH, TILE_WIDTH, \ -+ TILE_HEIGHT) \ -+ TESTBPTOPI(SRC_FMT_PLANAR, SRC_T, SRC_BPC, SRC_SUBSAMP_X, SRC_SUBSAMP_Y, \ -+ FMT_PLANAR, DST_T, DST_BPC, DST_SUBSAMP_X, DST_SUBSAMP_Y, \ -+ benchmark_width_, _Opt, +, 0, SRC_DEPTH, TILE_WIDTH, TILE_HEIGHT) -+ -+TESTBPTOP(NV12, uint8_t, 1, 2, 2, I420, uint8_t, 1, 2, 2, 8, 1, 1) -+TESTBPTOP(NV21, uint8_t, 1, 2, 2, I420, uint8_t, 1, 2, 2, 8, 1, 1) -+TESTBPTOP(MM21, uint8_t, 1, 2, 2, I420, uint8_t, 1, 2, 2, 8, 16, 32) -+TESTBPTOP(P010, uint16_t, 2, 2, 2, I010, uint16_t, 2, 2, 2, 10, 1, 1) -+TESTBPTOP(P012, uint16_t, 2, 2, 2, I012, uint16_t, 2, 2, 2, 12, 1, 1) -+ -+// Provide matrix wrappers for full range bt.709 -+#define F420ToABGR(a, b, c, d, e, f, g, h, i, j) \ -+ I420ToARGBMatrix(a, b, e, f, c, d, g, h, &kYvuF709Constants, i, j) -+#define F420ToARGB(a, b, c, d, e, f, g, h, i, j) \ -+ I420ToARGBMatrix(a, b, c, d, e, f, g, h, &kYuvF709Constants, i, j) -+#define F422ToABGR(a, b, c, d, e, f, g, h, i, j) \ -+ I422ToARGBMatrix(a, b, e, f, c, d, g, h, &kYvuF709Constants, i, j) -+#define F422ToARGB(a, b, c, d, e, f, g, h, i, j) \ -+ I422ToARGBMatrix(a, b, c, d, e, f, g, h, &kYuvF709Constants, i, j) -+#define F444ToABGR(a, b, c, d, e, f, g, h, i, j) \ -+ I444ToARGBMatrix(a, b, e, f, c, d, g, h, &kYvuF709Constants, i, j) -+#define F444ToARGB(a, b, c, d, e, f, g, h, i, j) \ -+ I444ToARGBMatrix(a, b, c, d, e, f, g, h, &kYuvF709Constants, i, j) -+ -+// Provide matrix wrappers for full range bt.2020 -+#define V420ToABGR(a, b, c, d, e, f, g, h, i, j) \ -+ I420ToARGBMatrix(a, b, e, f, c, d, g, h, &kYvuV2020Constants, i, j) -+#define V420ToARGB(a, b, c, d, e, f, g, h, i, j) \ -+ I420ToARGBMatrix(a, b, c, d, e, f, g, h, &kYuvV2020Constants, i, j) -+#define V422ToABGR(a, b, c, d, e, f, g, h, i, j) \ -+ I422ToARGBMatrix(a, b, e, f, c, d, g, h, &kYvuV2020Constants, i, j) -+#define V422ToARGB(a, b, c, d, e, f, g, h, i, j) \ -+ I422ToARGBMatrix(a, b, c, d, e, f, g, h, &kYuvV2020Constants, i, j) -+#define V444ToABGR(a, b, c, d, e, f, g, h, i, j) \ -+ I444ToARGBMatrix(a, b, e, f, c, d, g, h, &kYvuV2020Constants, i, j) -+#define V444ToARGB(a, b, c, d, e, f, g, h, i, j) \ -+ I444ToARGBMatrix(a, b, c, d, e, f, g, h, &kYuvV2020Constants, i, j) -+ -+#define I420ToARGBFilter(a, b, c, d, e, f, g, h, i, j) \ -+ I420ToARGBMatrixFilter(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j, \ -+ kFilterBilinear) -+#define I422ToARGBFilter(a, b, c, d, e, f, g, h, i, j) \ -+ I422ToARGBMatrixFilter(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j, \ -+ kFilterBilinear) -+#define I420ToRGB24Filter(a, b, c, d, e, f, g, h, i, j) \ -+ I420ToRGB24MatrixFilter(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j, \ -+ kFilterBilinear) -+#define I422ToRGB24Filter(a, b, c, d, e, f, g, h, i, j) \ -+ I420ToRGB24MatrixFilter(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j, \ -+ kFilterBilinear) -+ -+#define ALIGNINT(V, ALIGN) (((V) + (ALIGN)-1) / (ALIGN) * (ALIGN)) -+ -+#define TESTPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, W1280, N, NEG, OFF) \ -+ TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##N) { \ -+ const int kWidth = W1280; \ -+ const int kHeight = ALIGNINT(benchmark_height_, YALIGN); \ -+ const int kStrideB = ALIGNINT(kWidth * BPP_B, ALIGN); \ -+ const int kStrideUV = SUBSAMPLE(kWidth, SUBSAMP_X); \ -+ const int kSizeUV = kStrideUV * SUBSAMPLE(kHeight, SUBSAMP_Y); \ -+ align_buffer_page_end(src_y, kWidth* kHeight + OFF); \ -+ align_buffer_page_end(src_u, kSizeUV + OFF); \ -+ align_buffer_page_end(src_v, kSizeUV + OFF); \ -+ align_buffer_page_end(dst_argb_c, kStrideB* kHeight + OFF); \ -+ align_buffer_page_end(dst_argb_opt, kStrideB* kHeight + OFF); \ -+ for (int i = 0; i < kWidth * kHeight; ++i) { \ -+ src_y[i + OFF] = (fastrand() & 0xff); \ -+ } \ -+ for (int i = 0; i < kSizeUV; ++i) { \ -+ src_u[i + OFF] = (fastrand() & 0xff); \ -+ src_v[i + OFF] = (fastrand() & 0xff); \ -+ } \ -+ memset(dst_argb_c + OFF, 1, kStrideB * kHeight); \ -+ memset(dst_argb_opt + OFF, 101, kStrideB * kHeight); \ -+ MaskCpuFlags(disable_cpu_flags_); \ -+ double time0 = get_time(); \ -+ FMT_PLANAR##To##FMT_B(src_y + OFF, kWidth, src_u + OFF, kStrideUV, \ -+ src_v + OFF, kStrideUV, dst_argb_c + OFF, kStrideB, \ -+ kWidth, NEG kHeight); \ -+ double time1 = get_time(); \ -+ MaskCpuFlags(benchmark_cpu_info_); \ -+ for (int i = 0; i < benchmark_iterations_; ++i) { \ -+ FMT_PLANAR##To##FMT_B(src_y + OFF, kWidth, src_u + OFF, kStrideUV, \ -+ src_v + OFF, kStrideUV, dst_argb_opt + OFF, \ -+ kStrideB, kWidth, NEG kHeight); \ -+ } \ -+ double time2 = get_time(); \ -+ printf(" %8d us C - %8d us OPT\n", \ -+ static_cast((time1 - time0) * 1e6), \ -+ static_cast((time2 - time1) * 1e6 / benchmark_iterations_)); \ -+ for (int i = 0; i < kWidth * BPP_B * kHeight; ++i) { \ -+ EXPECT_EQ(dst_argb_c[i + OFF], dst_argb_opt[i + OFF]); \ -+ } \ -+ free_aligned_buffer_page_end(src_y); \ -+ free_aligned_buffer_page_end(src_u); \ -+ free_aligned_buffer_page_end(src_v); \ -+ free_aligned_buffer_page_end(dst_argb_c); \ -+ free_aligned_buffer_page_end(dst_argb_opt); \ -+ } -+ -+#if defined(ENABLE_FULL_TESTS) -+#define TESTPLANARTOB(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN) \ -+ TESTPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_ + 1, _Any, +, 0) \ -+ TESTPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_, _Unaligned, +, 4) \ -+ TESTPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_, _Invert, -, 0) \ -+ TESTPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_, _Opt, +, 0) -+#else -+#define TESTPLANARTOB(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN) \ -+ TESTPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_ + 1, _Any, +, 0) \ -+ TESTPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_, _Opt, +, 0) -+#endif -+ -+#if defined(ENABLE_FULL_TESTS) -+TESTPLANARTOB(I420, 2, 2, ARGB, 4, 4, 1) -+TESTPLANARTOB(I420, 2, 2, ABGR, 4, 4, 1) -+TESTPLANARTOB(J420, 2, 2, ARGB, 4, 4, 1) -+TESTPLANARTOB(J420, 2, 2, ABGR, 4, 4, 1) -+TESTPLANARTOB(F420, 2, 2, ARGB, 4, 4, 1) -+TESTPLANARTOB(F420, 2, 2, ABGR, 4, 4, 1) -+TESTPLANARTOB(H420, 2, 2, ARGB, 4, 4, 1) -+TESTPLANARTOB(H420, 2, 2, ABGR, 4, 4, 1) -+TESTPLANARTOB(U420, 2, 2, ARGB, 4, 4, 1) -+TESTPLANARTOB(U420, 2, 2, ABGR, 4, 4, 1) -+TESTPLANARTOB(V420, 2, 2, ARGB, 4, 4, 1) -+TESTPLANARTOB(V420, 2, 2, ABGR, 4, 4, 1) -+TESTPLANARTOB(I420, 2, 2, BGRA, 4, 4, 1) -+TESTPLANARTOB(I420, 2, 2, RGBA, 4, 4, 1) -+TESTPLANARTOB(I420, 2, 2, RAW, 3, 3, 1) -+TESTPLANARTOB(I420, 2, 2, RGB24, 3, 3, 1) -+TESTPLANARTOB(J420, 2, 2, RAW, 3, 3, 1) -+TESTPLANARTOB(J420, 2, 2, RGB24, 3, 3, 1) -+TESTPLANARTOB(H420, 2, 2, RAW, 3, 3, 1) -+TESTPLANARTOB(H420, 2, 2, RGB24, 3, 3, 1) -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTPLANARTOB(I420, 2, 2, RGB565, 2, 2, 1) -+TESTPLANARTOB(J420, 2, 2, RGB565, 2, 2, 1) -+TESTPLANARTOB(H420, 2, 2, RGB565, 2, 2, 1) -+TESTPLANARTOB(I420, 2, 2, ARGB1555, 2, 2, 1) -+TESTPLANARTOB(I420, 2, 2, ARGB4444, 2, 2, 1) -+TESTPLANARTOB(I422, 2, 1, RGB565, 2, 2, 1) -+#endif -+TESTPLANARTOB(I422, 2, 1, ARGB, 4, 4, 1) -+TESTPLANARTOB(I422, 2, 1, ABGR, 4, 4, 1) -+TESTPLANARTOB(J422, 2, 1, ARGB, 4, 4, 1) -+TESTPLANARTOB(J422, 2, 1, ABGR, 4, 4, 1) -+TESTPLANARTOB(H422, 2, 1, ARGB, 4, 4, 1) -+TESTPLANARTOB(H422, 2, 1, ABGR, 4, 4, 1) -+TESTPLANARTOB(U422, 2, 1, ARGB, 4, 4, 1) -+TESTPLANARTOB(U422, 2, 1, ABGR, 4, 4, 1) -+TESTPLANARTOB(V422, 2, 1, ARGB, 4, 4, 1) -+TESTPLANARTOB(V422, 2, 1, ABGR, 4, 4, 1) -+TESTPLANARTOB(I422, 2, 1, BGRA, 4, 4, 1) -+TESTPLANARTOB(I422, 2, 1, RGBA, 4, 4, 1) -+TESTPLANARTOB(I422, 1, 1, RGB24, 3, 3, 1) -+TESTPLANARTOB(I422, 1, 1, RAW, 3, 3, 1) -+TESTPLANARTOB(I444, 1, 1, ARGB, 4, 4, 1) -+TESTPLANARTOB(I444, 1, 1, ABGR, 4, 4, 1) -+TESTPLANARTOB(I444, 1, 1, RGB24, 3, 3, 1) -+TESTPLANARTOB(I444, 1, 1, RAW, 3, 3, 1) -+TESTPLANARTOB(J444, 1, 1, ARGB, 4, 4, 1) -+TESTPLANARTOB(J444, 1, 1, ABGR, 4, 4, 1) -+TESTPLANARTOB(H444, 1, 1, ARGB, 4, 4, 1) -+TESTPLANARTOB(H444, 1, 1, ABGR, 4, 4, 1) -+TESTPLANARTOB(U444, 1, 1, ARGB, 4, 4, 1) -+TESTPLANARTOB(U444, 1, 1, ABGR, 4, 4, 1) -+TESTPLANARTOB(V444, 1, 1, ARGB, 4, 4, 1) -+TESTPLANARTOB(V444, 1, 1, ABGR, 4, 4, 1) -+TESTPLANARTOB(I420, 2, 2, YUY2, 2, 4, 1) -+TESTPLANARTOB(I420, 2, 2, UYVY, 2, 4, 1) -+TESTPLANARTOB(I422, 2, 1, YUY2, 2, 4, 1) -+TESTPLANARTOB(I422, 2, 1, UYVY, 2, 4, 1) -+TESTPLANARTOB(I420, 2, 2, I400, 1, 1, 1) -+TESTPLANARTOB(J420, 2, 2, J400, 1, 1, 1) -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTPLANARTOB(I420, 2, 2, AR30, 4, 4, 1) -+TESTPLANARTOB(H420, 2, 2, AR30, 4, 4, 1) -+TESTPLANARTOB(I420, 2, 2, AB30, 4, 4, 1) -+TESTPLANARTOB(H420, 2, 2, AB30, 4, 4, 1) -+#endif -+TESTPLANARTOB(I420, 2, 2, ARGBFilter, 4, 4, 1) -+TESTPLANARTOB(I422, 2, 1, ARGBFilter, 4, 4, 1) -+TESTPLANARTOB(I420, 2, 2, RGB24Filter, 3, 3, 1) -+TESTPLANARTOB(I422, 2, 2, RGB24Filter, 3, 3, 1) -+#else -+TESTPLANARTOB(I420, 2, 2, ABGR, 4, 4, 1) -+TESTPLANARTOB(I420, 2, 2, ARGB, 4, 4, 1) -+TESTPLANARTOB(I420, 2, 2, BGRA, 4, 4, 1) -+TESTPLANARTOB(I420, 2, 2, RAW, 3, 3, 1) -+TESTPLANARTOB(I420, 2, 2, RGB24, 3, 3, 1) -+TESTPLANARTOB(I420, 2, 2, RGBA, 4, 4, 1) -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTPLANARTOB(I420, 2, 2, RGB565, 2, 2, 1) -+TESTPLANARTOB(I420, 2, 2, ARGB1555, 2, 2, 1) -+TESTPLANARTOB(I420, 2, 2, ARGB4444, 2, 2, 1) -+TESTPLANARTOB(I422, 2, 1, RGB565, 2, 2, 1) -+#endif -+TESTPLANARTOB(I420, 2, 2, I400, 1, 1, 1) -+TESTPLANARTOB(I420, 2, 2, UYVY, 2, 4, 1) -+TESTPLANARTOB(I420, 2, 2, YUY2, 2, 4, 1) -+TESTPLANARTOB(I422, 2, 1, ABGR, 4, 4, 1) -+TESTPLANARTOB(I422, 2, 1, ARGB, 4, 4, 1) -+TESTPLANARTOB(I422, 2, 1, BGRA, 4, 4, 1) -+TESTPLANARTOB(I422, 2, 1, RGBA, 4, 4, 1) -+TESTPLANARTOB(I422, 2, 1, UYVY, 2, 4, 1) -+TESTPLANARTOB(I422, 2, 1, YUY2, 2, 4, 1) -+TESTPLANARTOB(I420, 2, 2, ARGBFilter, 4, 4, 1) -+TESTPLANARTOB(I422, 2, 1, ARGBFilter, 4, 4, 1) -+TESTPLANARTOB(I420, 2, 2, RGB24Filter, 3, 3, 1) -+TESTPLANARTOB(I444, 1, 1, ABGR, 4, 4, 1) -+TESTPLANARTOB(I444, 1, 1, ARGB, 4, 4, 1) -+#endif -+ -+#define TESTQPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, W1280, N, NEG, OFF, ATTEN) \ -+ TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##N) { \ -+ const int kWidth = W1280; \ -+ const int kHeight = ALIGNINT(benchmark_height_, YALIGN); \ -+ const int kStrideB = ALIGNINT(kWidth * BPP_B, ALIGN); \ -+ const int kStrideUV = SUBSAMPLE(kWidth, SUBSAMP_X); \ -+ const int kSizeUV = kStrideUV * SUBSAMPLE(kHeight, SUBSAMP_Y); \ -+ align_buffer_page_end(src_y, kWidth* kHeight + OFF); \ -+ align_buffer_page_end(src_u, kSizeUV + OFF); \ -+ align_buffer_page_end(src_v, kSizeUV + OFF); \ -+ align_buffer_page_end(src_a, kWidth* kHeight + OFF); \ -+ align_buffer_page_end(dst_argb_c, kStrideB* kHeight + OFF); \ -+ align_buffer_page_end(dst_argb_opt, kStrideB* kHeight + OFF); \ -+ for (int i = 0; i < kWidth * kHeight; ++i) { \ -+ src_y[i + OFF] = (fastrand() & 0xff); \ -+ src_a[i + OFF] = (fastrand() & 0xff); \ -+ } \ -+ for (int i = 0; i < kSizeUV; ++i) { \ -+ src_u[i + OFF] = (fastrand() & 0xff); \ -+ src_v[i + OFF] = (fastrand() & 0xff); \ -+ } \ -+ memset(dst_argb_c + OFF, 1, kStrideB * kHeight); \ -+ memset(dst_argb_opt + OFF, 101, kStrideB * kHeight); \ -+ MaskCpuFlags(disable_cpu_flags_); \ -+ FMT_PLANAR##To##FMT_B(src_y + OFF, kWidth, src_u + OFF, kStrideUV, \ -+ src_v + OFF, kStrideUV, src_a + OFF, kWidth, \ -+ dst_argb_c + OFF, kStrideB, kWidth, NEG kHeight, \ -+ ATTEN); \ -+ MaskCpuFlags(benchmark_cpu_info_); \ -+ for (int i = 0; i < benchmark_iterations_; ++i) { \ -+ FMT_PLANAR##To##FMT_B(src_y + OFF, kWidth, src_u + OFF, kStrideUV, \ -+ src_v + OFF, kStrideUV, src_a + OFF, kWidth, \ -+ dst_argb_opt + OFF, kStrideB, kWidth, NEG kHeight, \ -+ ATTEN); \ -+ } \ -+ for (int i = 0; i < kWidth * BPP_B * kHeight; ++i) { \ -+ EXPECT_EQ(dst_argb_c[i + OFF], dst_argb_opt[i + OFF]); \ -+ } \ -+ free_aligned_buffer_page_end(src_y); \ -+ free_aligned_buffer_page_end(src_u); \ -+ free_aligned_buffer_page_end(src_v); \ -+ free_aligned_buffer_page_end(src_a); \ -+ free_aligned_buffer_page_end(dst_argb_c); \ -+ free_aligned_buffer_page_end(dst_argb_opt); \ -+ } -+ -+#if defined(ENABLE_FULL_TESTS) -+#define TESTQPLANARTOB(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN) \ -+ TESTQPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_ + 1, _Any, +, 0, 0) \ -+ TESTQPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_, _Unaligned, +, 2, 0) \ -+ TESTQPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_, _Invert, -, 0, 0) \ -+ TESTQPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_, _Opt, +, 0, 0) \ -+ TESTQPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_, _Premult, +, 0, 1) -+#else -+#define TESTQPLANARTOB(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN) \ -+ TESTQPLANARTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_, _Opt, +, 0, 0) -+#endif -+ -+#define J420AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I420AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ -+ l, m) -+#define J420AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I420AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ -+ l, m) -+#define F420AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I420AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ -+ l, m) -+#define F420AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I420AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ -+ l, m) -+#define H420AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I420AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ -+ l, m) -+#define H420AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I420AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ -+ l, m) -+#define U420AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I420AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ -+ l, m) -+#define U420AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I420AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ -+ l, m) -+#define V420AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I420AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ -+ l, m) -+#define V420AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I420AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ -+ l, m) -+#define J422AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I422AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ -+ l, m) -+#define J422AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I422AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ -+ l, m) -+#define F422AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I422AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ -+ l, m) -+#define F422AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I422AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ -+ l, m) -+#define H422AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I422AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ -+ l, m) -+#define H422AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I422AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ -+ l, m) -+#define U422AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I422AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ -+ l, m) -+#define U422AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I422AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ -+ l, m) -+#define V422AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I422AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ -+ l, m) -+#define V422AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I422AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ -+ l, m) -+#define J444AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I444AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ -+ l, m) -+#define J444AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I444AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ -+ l, m) -+#define F444AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I444AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ -+ l, m) -+#define F444AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I444AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ -+ l, m) -+#define H444AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I444AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ -+ l, m) -+#define H444AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I444AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ -+ l, m) -+#define U444AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I444AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ -+ l, m) -+#define U444AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I444AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ -+ l, m) -+#define V444AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I444AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ -+ l, m) -+#define V444AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I444AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ -+ l, m) -+ -+#define I420AlphaToARGBFilter(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I420AlphaToARGBMatrixFilter(a, b, c, d, e, f, g, h, i, j, \ -+ &kYuvI601Constants, k, l, m, kFilterBilinear) -+#define I422AlphaToARGBFilter(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I422AlphaToARGBMatrixFilter(a, b, c, d, e, f, g, h, i, j, \ -+ &kYuvI601Constants, k, l, m, kFilterBilinear) -+ -+#if defined(ENABLE_FULL_TESTS) -+TESTQPLANARTOB(I420Alpha, 2, 2, ARGB, 4, 4, 1) -+TESTQPLANARTOB(I420Alpha, 2, 2, ABGR, 4, 4, 1) -+TESTQPLANARTOB(J420Alpha, 2, 2, ARGB, 4, 4, 1) -+TESTQPLANARTOB(J420Alpha, 2, 2, ABGR, 4, 4, 1) -+TESTQPLANARTOB(H420Alpha, 2, 2, ARGB, 4, 4, 1) -+TESTQPLANARTOB(H420Alpha, 2, 2, ABGR, 4, 4, 1) -+TESTQPLANARTOB(F420Alpha, 2, 2, ARGB, 4, 4, 1) -+TESTQPLANARTOB(F420Alpha, 2, 2, ABGR, 4, 4, 1) -+TESTQPLANARTOB(U420Alpha, 2, 2, ARGB, 4, 4, 1) -+TESTQPLANARTOB(U420Alpha, 2, 2, ABGR, 4, 4, 1) -+TESTQPLANARTOB(V420Alpha, 2, 2, ARGB, 4, 4, 1) -+TESTQPLANARTOB(V420Alpha, 2, 2, ABGR, 4, 4, 1) -+TESTQPLANARTOB(I422Alpha, 2, 1, ARGB, 4, 4, 1) -+TESTQPLANARTOB(I422Alpha, 2, 1, ABGR, 4, 4, 1) -+TESTQPLANARTOB(J422Alpha, 2, 1, ARGB, 4, 4, 1) -+TESTQPLANARTOB(J422Alpha, 2, 1, ABGR, 4, 4, 1) -+TESTQPLANARTOB(H422Alpha, 2, 1, ARGB, 4, 4, 1) -+TESTQPLANARTOB(H422Alpha, 2, 1, ABGR, 4, 4, 1) -+TESTQPLANARTOB(F422Alpha, 2, 1, ARGB, 4, 4, 1) -+TESTQPLANARTOB(F422Alpha, 2, 1, ABGR, 4, 4, 1) -+TESTQPLANARTOB(U422Alpha, 2, 1, ARGB, 4, 4, 1) -+TESTQPLANARTOB(U422Alpha, 2, 1, ABGR, 4, 4, 1) -+TESTQPLANARTOB(V422Alpha, 2, 1, ARGB, 4, 4, 1) -+TESTQPLANARTOB(V422Alpha, 2, 1, ABGR, 4, 4, 1) -+TESTQPLANARTOB(I444Alpha, 1, 1, ARGB, 4, 4, 1) -+TESTQPLANARTOB(I444Alpha, 1, 1, ABGR, 4, 4, 1) -+TESTQPLANARTOB(J444Alpha, 1, 1, ARGB, 4, 4, 1) -+TESTQPLANARTOB(J444Alpha, 1, 1, ABGR, 4, 4, 1) -+TESTQPLANARTOB(H444Alpha, 1, 1, ARGB, 4, 4, 1) -+TESTQPLANARTOB(H444Alpha, 1, 1, ABGR, 4, 4, 1) -+TESTQPLANARTOB(F444Alpha, 1, 1, ARGB, 4, 4, 1) -+TESTQPLANARTOB(F444Alpha, 1, 1, ABGR, 4, 4, 1) -+TESTQPLANARTOB(U444Alpha, 1, 1, ARGB, 4, 4, 1) -+TESTQPLANARTOB(U444Alpha, 1, 1, ABGR, 4, 4, 1) -+TESTQPLANARTOB(V444Alpha, 1, 1, ARGB, 4, 4, 1) -+TESTQPLANARTOB(V444Alpha, 1, 1, ABGR, 4, 4, 1) -+TESTQPLANARTOB(I420Alpha, 2, 2, ARGBFilter, 4, 4, 1) -+TESTQPLANARTOB(I422Alpha, 2, 1, ARGBFilter, 4, 4, 1) -+#else -+TESTQPLANARTOB(I420Alpha, 2, 2, ARGB, 4, 4, 1) -+TESTQPLANARTOB(I422Alpha, 2, 1, ARGB, 4, 4, 1) -+TESTQPLANARTOB(I444Alpha, 1, 1, ARGB, 4, 4, 1) -+TESTQPLANARTOB(I420Alpha, 2, 2, ARGBFilter, 4, 4, 1) -+TESTQPLANARTOB(I422Alpha, 2, 1, ARGBFilter, 4, 4, 1) -+#endif -+ -+#define TESTBPTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, FMT_C, BPP_B, \ -+ W1280, N, NEG, OFF) \ -+ TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##N) { \ -+ const int kWidth = W1280; \ -+ const int kHeight = benchmark_height_; \ -+ const int kStrideB = kWidth * BPP_B; \ -+ const int kStrideUV = SUBSAMPLE(kWidth, SUBSAMP_X); \ -+ align_buffer_page_end(src_y, kWidth* kHeight + OFF); \ -+ align_buffer_page_end(src_uv, \ -+ kStrideUV* SUBSAMPLE(kHeight, SUBSAMP_Y) * 2 + OFF); \ -+ align_buffer_page_end(dst_argb_c, kStrideB* kHeight); \ -+ align_buffer_page_end(dst_argb_opt, kStrideB* kHeight); \ -+ for (int i = 0; i < kHeight; ++i) \ -+ for (int j = 0; j < kWidth; ++j) \ -+ src_y[i * kWidth + j + OFF] = (fastrand() & 0xff); \ -+ for (int i = 0; i < SUBSAMPLE(kHeight, SUBSAMP_Y); ++i) { \ -+ for (int j = 0; j < kStrideUV * 2; ++j) { \ -+ src_uv[i * kStrideUV * 2 + j + OFF] = (fastrand() & 0xff); \ -+ } \ -+ } \ -+ memset(dst_argb_c, 1, kStrideB* kHeight); \ -+ memset(dst_argb_opt, 101, kStrideB* kHeight); \ -+ MaskCpuFlags(disable_cpu_flags_); \ -+ FMT_PLANAR##To##FMT_B(src_y + OFF, kWidth, src_uv + OFF, kStrideUV * 2, \ -+ dst_argb_c, kWidth * BPP_B, kWidth, NEG kHeight); \ -+ MaskCpuFlags(benchmark_cpu_info_); \ -+ for (int i = 0; i < benchmark_iterations_; ++i) { \ -+ FMT_PLANAR##To##FMT_B(src_y + OFF, kWidth, src_uv + OFF, kStrideUV * 2, \ -+ dst_argb_opt, kWidth * BPP_B, kWidth, \ -+ NEG kHeight); \ -+ } \ -+ /* Convert to ARGB so 565 is expanded to bytes that can be compared. */ \ -+ align_buffer_page_end(dst_argb32_c, kWidth * 4 * kHeight); \ -+ align_buffer_page_end(dst_argb32_opt, kWidth * 4 * kHeight); \ -+ memset(dst_argb32_c, 2, kWidth * 4 * kHeight); \ -+ memset(dst_argb32_opt, 102, kWidth * 4 * kHeight); \ -+ FMT_C##ToARGB(dst_argb_c, kStrideB, dst_argb32_c, kWidth * 4, kWidth, \ -+ kHeight); \ -+ FMT_C##ToARGB(dst_argb_opt, kStrideB, dst_argb32_opt, kWidth * 4, kWidth, \ -+ kHeight); \ -+ for (int i = 0; i < kHeight; ++i) { \ -+ for (int j = 0; j < kWidth * 4; ++j) { \ -+ EXPECT_EQ(dst_argb32_c[i * kWidth * 4 + j], \ -+ dst_argb32_opt[i * kWidth * 4 + j]); \ -+ } \ -+ } \ -+ free_aligned_buffer_page_end(src_y); \ -+ free_aligned_buffer_page_end(src_uv); \ -+ free_aligned_buffer_page_end(dst_argb_c); \ -+ free_aligned_buffer_page_end(dst_argb_opt); \ -+ free_aligned_buffer_page_end(dst_argb32_c); \ -+ free_aligned_buffer_page_end(dst_argb32_opt); \ -+ } -+ -+#define TESTBPTOB(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, FMT_C, BPP_B) \ -+ TESTBPTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, FMT_C, BPP_B, \ -+ benchmark_width_ + 1, _Any, +, 0) \ -+ TESTBPTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, FMT_C, BPP_B, \ -+ benchmark_width_, _Unaligned, +, 2) \ -+ TESTBPTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, FMT_C, BPP_B, \ -+ benchmark_width_, _Invert, -, 0) \ -+ TESTBPTOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, FMT_C, BPP_B, \ -+ benchmark_width_, _Opt, +, 0) -+ -+#define JNV12ToARGB(a, b, c, d, e, f, g, h) \ -+ NV12ToARGBMatrix(a, b, c, d, e, f, &kYuvJPEGConstants, g, h) -+#define JNV21ToARGB(a, b, c, d, e, f, g, h) \ -+ NV21ToARGBMatrix(a, b, c, d, e, f, &kYuvJPEGConstants, g, h) -+#define JNV12ToABGR(a, b, c, d, e, f, g, h) \ -+ NV21ToARGBMatrix(a, b, c, d, e, f, &kYvuJPEGConstants, g, h) -+#define JNV21ToABGR(a, b, c, d, e, f, g, h) \ -+ NV12ToARGBMatrix(a, b, c, d, e, f, &kYvuJPEGConstants, g, h) -+#define JNV12ToRGB24(a, b, c, d, e, f, g, h) \ -+ NV12ToRGB24Matrix(a, b, c, d, e, f, &kYuvJPEGConstants, g, h) -+#define JNV21ToRGB24(a, b, c, d, e, f, g, h) \ -+ NV21ToRGB24Matrix(a, b, c, d, e, f, &kYuvJPEGConstants, g, h) -+#define JNV12ToRAW(a, b, c, d, e, f, g, h) \ -+ NV21ToRGB24Matrix(a, b, c, d, e, f, &kYvuJPEGConstants, g, h) -+#define JNV21ToRAW(a, b, c, d, e, f, g, h) \ -+ NV12ToRGB24Matrix(a, b, c, d, e, f, &kYvuJPEGConstants, g, h) -+#define JNV12ToRGB565(a, b, c, d, e, f, g, h) \ -+ NV12ToRGB565Matrix(a, b, c, d, e, f, &kYuvJPEGConstants, g, h) -+ -+TESTBPTOB(JNV12, 2, 2, ARGB, ARGB, 4) -+TESTBPTOB(JNV21, 2, 2, ARGB, ARGB, 4) -+TESTBPTOB(JNV12, 2, 2, ABGR, ABGR, 4) -+TESTBPTOB(JNV21, 2, 2, ABGR, ABGR, 4) -+TESTBPTOB(JNV12, 2, 2, RGB24, RGB24, 3) -+TESTBPTOB(JNV21, 2, 2, RGB24, RGB24, 3) -+TESTBPTOB(JNV12, 2, 2, RAW, RAW, 3) -+TESTBPTOB(JNV21, 2, 2, RAW, RAW, 3) -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTBPTOB(JNV12, 2, 2, RGB565, RGB565, 2) -+#endif -+ -+TESTBPTOB(NV12, 2, 2, ARGB, ARGB, 4) -+TESTBPTOB(NV21, 2, 2, ARGB, ARGB, 4) -+TESTBPTOB(NV12, 2, 2, ABGR, ABGR, 4) -+TESTBPTOB(NV21, 2, 2, ABGR, ABGR, 4) -+TESTBPTOB(NV12, 2, 2, RGB24, RGB24, 3) -+TESTBPTOB(NV21, 2, 2, RGB24, RGB24, 3) -+TESTBPTOB(NV12, 2, 2, RAW, RAW, 3) -+TESTBPTOB(NV21, 2, 2, RAW, RAW, 3) -+TESTBPTOB(NV21, 2, 2, YUV24, RAW, 3) -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTBPTOB(NV12, 2, 2, RGB565, RGB565, 2) -+#endif -+ - #define TESTATOPLANARI(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ - W1280, N, NEG, OFF) \ - TEST_F(LibYUVConvertTest, FMT_A##To##FMT_PLANAR##N) { \ -@@ -654,6 +1245,8 @@ TESTBPTOBP(MT2T, uint8_t, 10 / 8, 2, 2, - #else - #define TESTATOPLANAR(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y) \ - TESTATOPLANARI(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ -+ benchmark_width_ + 1, _Any, +, 0) \ -+ TESTATOPLANARI(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ - benchmark_width_, _Opt, +, 0) - #endif - -@@ -683,80 +1276,6 @@ TESTATOPLANAR(UYVY, 2, 1, I422, 2, 1) - TESTATOPLANAR(YUY2, 2, 1, I420, 2, 2) - TESTATOPLANAR(YUY2, 2, 1, I422, 2, 1) - --#define TESTATOPLANARAI(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, \ -- SUBSAMP_Y, W1280, N, NEG, OFF) \ -- TEST_F(LibYUVConvertTest, FMT_A##To##FMT_PLANAR##N) { \ -- const int kWidth = W1280; \ -- const int kHeight = ALIGNINT(benchmark_height_, YALIGN); \ -- const int kStrideUV = SUBSAMPLE(kWidth, SUBSAMP_X); \ -- const int kStride = (kStrideUV * SUBSAMP_X * 8 * BPP_A + 7) / 8; \ -- align_buffer_page_end(src_argb, kStride* kHeight + OFF); \ -- align_buffer_page_end(dst_a_c, kWidth* kHeight); \ -- align_buffer_page_end(dst_y_c, kWidth* kHeight); \ -- align_buffer_page_end(dst_uv_c, \ -- kStrideUV * 2 * SUBSAMPLE(kHeight, SUBSAMP_Y)); \ -- align_buffer_page_end(dst_a_opt, kWidth* kHeight); \ -- align_buffer_page_end(dst_y_opt, kWidth* kHeight); \ -- align_buffer_page_end(dst_uv_opt, \ -- kStrideUV * 2 * SUBSAMPLE(kHeight, SUBSAMP_Y)); \ -- memset(dst_a_c, 1, kWidth* kHeight); \ -- memset(dst_y_c, 2, kWidth* kHeight); \ -- memset(dst_uv_c, 3, kStrideUV * 2 * SUBSAMPLE(kHeight, SUBSAMP_Y)); \ -- memset(dst_a_opt, 101, kWidth* kHeight); \ -- memset(dst_y_opt, 102, kWidth* kHeight); \ -- memset(dst_uv_opt, 103, kStrideUV * 2 * SUBSAMPLE(kHeight, SUBSAMP_Y)); \ -- for (int i = 0; i < kHeight; ++i) \ -- for (int j = 0; j < kStride; ++j) \ -- src_argb[(i * kStride) + j + OFF] = (fastrand() & 0xff); \ -- MaskCpuFlags(disable_cpu_flags_); \ -- FMT_A##To##FMT_PLANAR(src_argb + OFF, kStride, dst_y_c, kWidth, dst_uv_c, \ -- kStrideUV * 2, dst_uv_c + kStrideUV, kStrideUV * 2, \ -- dst_a_c, kWidth, kWidth, NEG kHeight); \ -- MaskCpuFlags(benchmark_cpu_info_); \ -- for (int i = 0; i < benchmark_iterations_; ++i) { \ -- FMT_A##To##FMT_PLANAR(src_argb + OFF, kStride, dst_y_opt, kWidth, \ -- dst_uv_opt, kStrideUV * 2, dst_uv_opt + kStrideUV, \ -- kStrideUV * 2, dst_a_opt, kWidth, kWidth, \ -- NEG kHeight); \ -- } \ -- for (int i = 0; i < kHeight; ++i) { \ -- for (int j = 0; j < kWidth; ++j) { \ -- EXPECT_EQ(dst_y_c[i * kWidth + j], dst_y_opt[i * kWidth + j]); \ -- EXPECT_EQ(dst_a_c[i * kWidth + j], dst_a_opt[i * kWidth + j]); \ -- } \ -- } \ -- for (int i = 0; i < SUBSAMPLE(kHeight, SUBSAMP_Y) * 2; ++i) { \ -- for (int j = 0; j < kStrideUV; ++j) { \ -- EXPECT_EQ(dst_uv_c[i * kStrideUV + j], dst_uv_opt[i * kStrideUV + j]); \ -- } \ -- } \ -- free_aligned_buffer_page_end(dst_a_c); \ -- free_aligned_buffer_page_end(dst_y_c); \ -- free_aligned_buffer_page_end(dst_uv_c); \ -- free_aligned_buffer_page_end(dst_a_opt); \ -- free_aligned_buffer_page_end(dst_y_opt); \ -- free_aligned_buffer_page_end(dst_uv_opt); \ -- free_aligned_buffer_page_end(src_argb); \ -- } -- --#if defined(ENABLE_FULL_TESTS) --#define TESTATOPLANARA(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y) \ -- TESTATOPLANARAI(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ -- benchmark_width_ + 1, _Any, +, 0) \ -- TESTATOPLANARAI(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ -- benchmark_width_, _Unaligned, +, 2) \ -- TESTATOPLANARAI(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ -- benchmark_width_, _Invert, -, 0) \ -- TESTATOPLANARAI(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ -- benchmark_width_, _Opt, +, 0) --#else --#define TESTATOPLANARA(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y) \ -- TESTATOPLANARAI(FMT_A, BPP_A, YALIGN, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ -- benchmark_width_, _Opt, +, 0) --#endif -- --TESTATOPLANARA(ARGB, 4, 1, I420Alpha, 2, 2) -- - #define TESTATOBPI(FMT_A, SUB_A, BPP_A, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ - W1280, N, NEG, OFF) \ - TEST_F(LibYUVConvertTest, FMT_A##To##FMT_PLANAR##N) { \ -@@ -804,7 +1323,6 @@ TESTATOPLANARA(ARGB, 4, 1, I420Alpha, 2, - free_aligned_buffer_page_end(src_argb); \ - } - --#if defined(ENABLE_FULL_TESTS) - #define TESTATOBP(FMT_A, SUB_A, BPP_A, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y) \ - TESTATOBPI(FMT_A, SUB_A, BPP_A, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ - benchmark_width_ + 1, _Any, +, 0) \ -@@ -814,11 +1332,6 @@ TESTATOPLANARA(ARGB, 4, 1, I420Alpha, 2, - benchmark_width_, _Invert, -, 0) \ - TESTATOBPI(FMT_A, SUB_A, BPP_A, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ - benchmark_width_, _Opt, +, 0) --#else --#define TESTATOBP(FMT_A, SUB_A, BPP_A, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y) \ -- TESTATOBPI(FMT_A, SUB_A, BPP_A, FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, \ -- benchmark_width_, _Opt, +, 0) --#endif - - TESTATOBP(ARGB, 1, 4, NV12, 2, 2) - TESTATOBP(ARGB, 1, 4, NV21, 2, 2) -@@ -830,7 +1343,440 @@ TESTATOBP(UYVY, 2, 4, NV12, 2, 2) - TESTATOBP(AYUV, 1, 4, NV12, 2, 2) - TESTATOBP(AYUV, 1, 4, NV21, 2, 2) - --#if !defined(LEAN_TESTS) -+#define TESTATOBI(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, \ -+ EPP_B, STRIDE_B, HEIGHT_B, W1280, N, NEG, OFF) \ -+ TEST_F(LibYUVConvertTest, FMT_A##To##FMT_B##N) { \ -+ const int kWidth = W1280; \ -+ const int kHeight = benchmark_height_; \ -+ const int kHeightA = (kHeight + HEIGHT_A - 1) / HEIGHT_A * HEIGHT_A; \ -+ const int kHeightB = (kHeight + HEIGHT_B - 1) / HEIGHT_B * HEIGHT_B; \ -+ const int kStrideA = \ -+ (kWidth * EPP_A + STRIDE_A - 1) / STRIDE_A * STRIDE_A; \ -+ const int kStrideB = \ -+ (kWidth * EPP_B + STRIDE_B - 1) / STRIDE_B * STRIDE_B; \ -+ align_buffer_page_end(src_argb, \ -+ kStrideA* kHeightA*(int)sizeof(TYPE_A) + OFF); \ -+ align_buffer_page_end(dst_argb_c, kStrideB* kHeightB*(int)sizeof(TYPE_B)); \ -+ align_buffer_page_end(dst_argb_opt, \ -+ kStrideB* kHeightB*(int)sizeof(TYPE_B)); \ -+ for (int i = 0; i < kStrideA * kHeightA * (int)sizeof(TYPE_A); ++i) { \ -+ src_argb[i + OFF] = (fastrand() & 0xff); \ -+ } \ -+ memset(dst_argb_c, 1, kStrideB* kHeightB); \ -+ memset(dst_argb_opt, 101, kStrideB* kHeightB); \ -+ MaskCpuFlags(disable_cpu_flags_); \ -+ FMT_A##To##FMT_B((TYPE_A*)(src_argb + OFF), kStrideA, (TYPE_B*)dst_argb_c, \ -+ kStrideB, kWidth, NEG kHeight); \ -+ MaskCpuFlags(benchmark_cpu_info_); \ -+ for (int i = 0; i < benchmark_iterations_; ++i) { \ -+ FMT_A##To##FMT_B((TYPE_A*)(src_argb + OFF), kStrideA, \ -+ (TYPE_B*)dst_argb_opt, kStrideB, kWidth, NEG kHeight); \ -+ } \ -+ for (int i = 0; i < kStrideB * kHeightB * (int)sizeof(TYPE_B); ++i) { \ -+ EXPECT_EQ(dst_argb_c[i], dst_argb_opt[i]); \ -+ } \ -+ free_aligned_buffer_page_end(src_argb); \ -+ free_aligned_buffer_page_end(dst_argb_c); \ -+ free_aligned_buffer_page_end(dst_argb_opt); \ -+ } -+ -+#define TESTATOBRANDOM(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, \ -+ TYPE_B, EPP_B, STRIDE_B, HEIGHT_B) \ -+ TEST_F(LibYUVConvertTest, FMT_A##To##FMT_B##_Random) { \ -+ for (int times = 0; times < benchmark_iterations_; ++times) { \ -+ const int kWidth = (fastrand() & 63) + 1; \ -+ const int kHeight = (fastrand() & 31) + 1; \ -+ const int kHeightA = (kHeight + HEIGHT_A - 1) / HEIGHT_A * HEIGHT_A; \ -+ const int kHeightB = (kHeight + HEIGHT_B - 1) / HEIGHT_B * HEIGHT_B; \ -+ const int kStrideA = \ -+ (kWidth * EPP_A + STRIDE_A - 1) / STRIDE_A * STRIDE_A; \ -+ const int kStrideB = \ -+ (kWidth * EPP_B + STRIDE_B - 1) / STRIDE_B * STRIDE_B; \ -+ align_buffer_page_end(src_argb, kStrideA* kHeightA*(int)sizeof(TYPE_A)); \ -+ align_buffer_page_end(dst_argb_c, \ -+ kStrideB* kHeightB*(int)sizeof(TYPE_B)); \ -+ align_buffer_page_end(dst_argb_opt, \ -+ kStrideB* kHeightB*(int)sizeof(TYPE_B)); \ -+ for (int i = 0; i < kStrideA * kHeightA * (int)sizeof(TYPE_A); ++i) { \ -+ src_argb[i] = 0xfe; \ -+ } \ -+ memset(dst_argb_c, 123, kStrideB* kHeightB); \ -+ memset(dst_argb_opt, 123, kStrideB* kHeightB); \ -+ MaskCpuFlags(disable_cpu_flags_); \ -+ FMT_A##To##FMT_B((TYPE_A*)src_argb, kStrideA, (TYPE_B*)dst_argb_c, \ -+ kStrideB, kWidth, kHeight); \ -+ MaskCpuFlags(benchmark_cpu_info_); \ -+ FMT_A##To##FMT_B((TYPE_A*)src_argb, kStrideA, (TYPE_B*)dst_argb_opt, \ -+ kStrideB, kWidth, kHeight); \ -+ for (int i = 0; i < kStrideB * kHeightB * (int)sizeof(TYPE_B); ++i) { \ -+ EXPECT_EQ(dst_argb_c[i], dst_argb_opt[i]); \ -+ } \ -+ free_aligned_buffer_page_end(src_argb); \ -+ free_aligned_buffer_page_end(dst_argb_c); \ -+ free_aligned_buffer_page_end(dst_argb_opt); \ -+ } \ -+ } -+ -+#if defined(ENABLE_FULL_TESTS) -+#define TESTATOB(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, \ -+ EPP_B, STRIDE_B, HEIGHT_B) \ -+ TESTATOBI(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, EPP_B, \ -+ STRIDE_B, HEIGHT_B, benchmark_width_ + 1, _Any, +, 0) \ -+ TESTATOBI(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, EPP_B, \ -+ STRIDE_B, HEIGHT_B, benchmark_width_, _Unaligned, +, 4) \ -+ TESTATOBI(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, EPP_B, \ -+ STRIDE_B, HEIGHT_B, benchmark_width_, _Invert, -, 0) \ -+ TESTATOBI(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, EPP_B, \ -+ STRIDE_B, HEIGHT_B, benchmark_width_, _Opt, +, 0) \ -+ TESTATOBRANDOM(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, \ -+ EPP_B, STRIDE_B, HEIGHT_B) -+#else -+#define TESTATOB(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, \ -+ EPP_B, STRIDE_B, HEIGHT_B) \ -+ TESTATOBI(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, EPP_B, \ -+ STRIDE_B, HEIGHT_B, benchmark_width_, _Opt, +, 0) -+#endif -+ -+TESTATOB(AB30, uint8_t, 4, 4, 1, ABGR, uint8_t, 4, 4, 1) -+TESTATOB(AB30, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTATOB(ABGR, uint8_t, 4, 4, 1, AR30, uint8_t, 4, 4, 1) -+#endif -+TESTATOB(ABGR, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTATOB(AR30, uint8_t, 4, 4, 1, AB30, uint8_t, 4, 4, 1) -+#endif -+TESTATOB(AR30, uint8_t, 4, 4, 1, ABGR, uint8_t, 4, 4, 1) -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTATOB(AR30, uint8_t, 4, 4, 1, AR30, uint8_t, 4, 4, 1) -+TESTATOB(AR30, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) -+#endif -+TESTATOB(ARGB, uint8_t, 4, 4, 1, ABGR, uint8_t, 4, 4, 1) -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTATOB(ARGB, uint8_t, 4, 4, 1, AR30, uint8_t, 4, 4, 1) -+#endif -+TESTATOB(ARGB, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) -+TESTATOB(ARGB, uint8_t, 4, 4, 1, ARGB1555, uint8_t, 2, 2, 1) -+TESTATOB(ARGB, uint8_t, 4, 4, 1, ARGB4444, uint8_t, 2, 2, 1) -+TESTATOB(ARGB, uint8_t, 4, 4, 1, ARGBMirror, uint8_t, 4, 4, 1) -+TESTATOB(ARGB, uint8_t, 4, 4, 1, BGRA, uint8_t, 4, 4, 1) -+TESTATOB(ARGB, uint8_t, 4, 4, 1, I400, uint8_t, 1, 1, 1) -+TESTATOB(ARGB, uint8_t, 4, 4, 1, J400, uint8_t, 1, 1, 1) -+TESTATOB(ABGR, uint8_t, 4, 4, 1, J400, uint8_t, 1, 1, 1) -+TESTATOB(RGBA, uint8_t, 4, 4, 1, J400, uint8_t, 1, 1, 1) -+TESTATOB(ARGB, uint8_t, 4, 4, 1, RAW, uint8_t, 3, 3, 1) -+TESTATOB(ARGB, uint8_t, 4, 4, 1, RGB24, uint8_t, 3, 3, 1) -+TESTATOB(ABGR, uint8_t, 4, 4, 1, RAW, uint8_t, 3, 3, 1) -+TESTATOB(ABGR, uint8_t, 4, 4, 1, RGB24, uint8_t, 3, 3, 1) -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTATOB(ARGB, uint8_t, 4, 4, 1, RGB565, uint8_t, 2, 2, 1) -+#endif -+TESTATOB(ARGB, uint8_t, 4, 4, 1, RGBA, uint8_t, 4, 4, 1) -+TESTATOB(ARGB, uint8_t, 4, 4, 1, UYVY, uint8_t, 2, 4, 1) -+TESTATOB(ARGB, uint8_t, 4, 4, 1, YUY2, uint8_t, 2, 4, 1) -+TESTATOB(ARGB1555, uint8_t, 2, 2, 1, ARGB, uint8_t, 4, 4, 1) -+TESTATOB(ARGB4444, uint8_t, 2, 2, 1, ARGB, uint8_t, 4, 4, 1) -+TESTATOB(BGRA, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) -+TESTATOB(I400, uint8_t, 1, 1, 1, ARGB, uint8_t, 4, 4, 1) -+TESTATOB(I400, uint8_t, 1, 1, 1, I400, uint8_t, 1, 1, 1) -+TESTATOB(I400, uint8_t, 1, 1, 1, I400Mirror, uint8_t, 1, 1, 1) -+TESTATOB(J400, uint8_t, 1, 1, 1, ARGB, uint8_t, 4, 4, 1) -+TESTATOB(J400, uint8_t, 1, 1, 1, J400, uint8_t, 1, 1, 1) -+TESTATOB(RAW, uint8_t, 3, 3, 1, ARGB, uint8_t, 4, 4, 1) -+TESTATOB(RAW, uint8_t, 3, 3, 1, RGBA, uint8_t, 4, 4, 1) -+TESTATOB(RAW, uint8_t, 3, 3, 1, RGB24, uint8_t, 3, 3, 1) -+TESTATOB(RGB24, uint8_t, 3, 3, 1, ARGB, uint8_t, 4, 4, 1) -+TESTATOB(RGB24, uint8_t, 3, 3, 1, J400, uint8_t, 1, 1, 1) -+TESTATOB(RGB24, uint8_t, 3, 3, 1, RGB24Mirror, uint8_t, 3, 3, 1) -+TESTATOB(RAW, uint8_t, 3, 3, 1, J400, uint8_t, 1, 1, 1) -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTATOB(RGB565, uint8_t, 2, 2, 1, ARGB, uint8_t, 4, 4, 1) -+#endif -+TESTATOB(RGBA, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) -+TESTATOB(UYVY, uint8_t, 2, 4, 1, ARGB, uint8_t, 4, 4, 1) -+TESTATOB(YUY2, uint8_t, 2, 4, 1, ARGB, uint8_t, 4, 4, 1) -+TESTATOB(YUY2, uint8_t, 2, 4, 1, Y, uint8_t, 1, 1, 1) -+TESTATOB(ARGB, uint8_t, 4, 4, 1, AR64, uint16_t, 4, 4, 1) -+TESTATOB(ARGB, uint8_t, 4, 4, 1, AB64, uint16_t, 4, 4, 1) -+TESTATOB(ABGR, uint8_t, 4, 4, 1, AR64, uint16_t, 4, 4, 1) -+TESTATOB(ABGR, uint8_t, 4, 4, 1, AB64, uint16_t, 4, 4, 1) -+TESTATOB(AR64, uint16_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) -+TESTATOB(AB64, uint16_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) -+TESTATOB(AR64, uint16_t, 4, 4, 1, ABGR, uint8_t, 4, 4, 1) -+TESTATOB(AB64, uint16_t, 4, 4, 1, ABGR, uint8_t, 4, 4, 1) -+TESTATOB(AR64, uint16_t, 4, 4, 1, AB64, uint16_t, 4, 4, 1) -+TESTATOB(AB64, uint16_t, 4, 4, 1, AR64, uint16_t, 4, 4, 1) -+ -+// in place test -+#define TESTATOAI(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, \ -+ EPP_B, STRIDE_B, HEIGHT_B, W1280, N, NEG, OFF) \ -+ TEST_F(LibYUVConvertTest, FMT_A##To##FMT_B##N) { \ -+ const int kWidth = W1280; \ -+ const int kHeight = benchmark_height_; \ -+ const int kHeightA = (kHeight + HEIGHT_A - 1) / HEIGHT_A * HEIGHT_A; \ -+ const int kHeightB = (kHeight + HEIGHT_B - 1) / HEIGHT_B * HEIGHT_B; \ -+ const int kStrideA = \ -+ (kWidth * EPP_A + STRIDE_A - 1) / STRIDE_A * STRIDE_A; \ -+ const int kStrideB = \ -+ (kWidth * EPP_B + STRIDE_B - 1) / STRIDE_B * STRIDE_B; \ -+ align_buffer_page_end(src_argb, \ -+ kStrideA* kHeightA*(int)sizeof(TYPE_A) + OFF); \ -+ align_buffer_page_end(dst_argb_c, \ -+ kStrideA* kHeightA*(int)sizeof(TYPE_A) + OFF); \ -+ align_buffer_page_end(dst_argb_opt, \ -+ kStrideA* kHeightA*(int)sizeof(TYPE_A) + OFF); \ -+ for (int i = 0; i < kStrideA * kHeightA * (int)sizeof(TYPE_A); ++i) { \ -+ src_argb[i + OFF] = (fastrand() & 0xff); \ -+ } \ -+ memcpy(dst_argb_c + OFF, src_argb, \ -+ kStrideA * kHeightA * (int)sizeof(TYPE_A)); \ -+ memcpy(dst_argb_opt + OFF, src_argb, \ -+ kStrideA * kHeightA * (int)sizeof(TYPE_A)); \ -+ MaskCpuFlags(disable_cpu_flags_); \ -+ FMT_A##To##FMT_B((TYPE_A*)(dst_argb_c /* src */ + OFF), kStrideA, \ -+ (TYPE_B*)dst_argb_c, kStrideB, kWidth, NEG kHeight); \ -+ MaskCpuFlags(benchmark_cpu_info_); \ -+ for (int i = 0; i < benchmark_iterations_; ++i) { \ -+ FMT_A##To##FMT_B((TYPE_A*)(dst_argb_opt /* src */ + OFF), kStrideA, \ -+ (TYPE_B*)dst_argb_opt, kStrideB, kWidth, NEG kHeight); \ -+ } \ -+ memcpy(dst_argb_opt + OFF, src_argb, \ -+ kStrideA * kHeightA * (int)sizeof(TYPE_A)); \ -+ FMT_A##To##FMT_B((TYPE_A*)(dst_argb_opt /* src */ + OFF), kStrideA, \ -+ (TYPE_B*)dst_argb_opt, kStrideB, kWidth, NEG kHeight); \ -+ for (int i = 0; i < kStrideB * kHeightB * (int)sizeof(TYPE_B); ++i) { \ -+ EXPECT_EQ(dst_argb_c[i], dst_argb_opt[i]); \ -+ } \ -+ free_aligned_buffer_page_end(src_argb); \ -+ free_aligned_buffer_page_end(dst_argb_c); \ -+ free_aligned_buffer_page_end(dst_argb_opt); \ -+ } -+ -+#define TESTATOA(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, \ -+ EPP_B, STRIDE_B, HEIGHT_B) \ -+ TESTATOAI(FMT_A, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, FMT_B, TYPE_B, EPP_B, \ -+ STRIDE_B, HEIGHT_B, benchmark_width_, _Inplace, +, 0) -+ -+TESTATOA(AB30, uint8_t, 4, 4, 1, ABGR, uint8_t, 4, 4, 1) -+TESTATOA(AB30, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTATOA(ABGR, uint8_t, 4, 4, 1, AR30, uint8_t, 4, 4, 1) -+#endif -+TESTATOA(ABGR, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTATOA(AR30, uint8_t, 4, 4, 1, AB30, uint8_t, 4, 4, 1) -+#endif -+TESTATOA(AR30, uint8_t, 4, 4, 1, ABGR, uint8_t, 4, 4, 1) -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTATOA(AR30, uint8_t, 4, 4, 1, AR30, uint8_t, 4, 4, 1) -+TESTATOA(AR30, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) -+#endif -+TESTATOA(ARGB, uint8_t, 4, 4, 1, ABGR, uint8_t, 4, 4, 1) -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTATOA(ARGB, uint8_t, 4, 4, 1, AR30, uint8_t, 4, 4, 1) -+#endif -+TESTATOA(ARGB, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) -+TESTATOA(ARGB, uint8_t, 4, 4, 1, ARGB1555, uint8_t, 2, 2, 1) -+TESTATOA(ARGB, uint8_t, 4, 4, 1, ARGB4444, uint8_t, 2, 2, 1) -+// TODO(fbarchard): Support in place for mirror. -+// TESTATOA(ARGB, uint8_t, 4, 4, 1, ARGBMirror, uint8_t, 4, 4, 1) -+TESTATOA(ARGB, uint8_t, 4, 4, 1, BGRA, uint8_t, 4, 4, 1) -+TESTATOA(ARGB, uint8_t, 4, 4, 1, I400, uint8_t, 1, 1, 1) -+TESTATOA(ARGB, uint8_t, 4, 4, 1, J400, uint8_t, 1, 1, 1) -+TESTATOA(RGBA, uint8_t, 4, 4, 1, J400, uint8_t, 1, 1, 1) -+TESTATOA(ARGB, uint8_t, 4, 4, 1, RAW, uint8_t, 3, 3, 1) -+TESTATOA(ARGB, uint8_t, 4, 4, 1, RGB24, uint8_t, 3, 3, 1) -+TESTATOA(ABGR, uint8_t, 4, 4, 1, RAW, uint8_t, 3, 3, 1) -+TESTATOA(ABGR, uint8_t, 4, 4, 1, RGB24, uint8_t, 3, 3, 1) -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTATOA(ARGB, uint8_t, 4, 4, 1, RGB565, uint8_t, 2, 2, 1) -+#endif -+TESTATOA(ARGB, uint8_t, 4, 4, 1, RGBA, uint8_t, 4, 4, 1) -+TESTATOA(ARGB, uint8_t, 4, 4, 1, UYVY, uint8_t, 2, 4, 1) -+TESTATOA(ARGB, uint8_t, 4, 4, 1, YUY2, uint8_t, 2, 4, 1) -+// TODO(fbarchard): Support in place for conversions that increase bpp. -+// TESTATOA(ARGB1555, uint8_t, 2, 2, 1, ARGB, uint8_t, 4, 4, 1) -+// TESTATOA(ARGB4444, uint8_t, 2, 2, 1, ARGB, uint8_t, 4, 4, 1) -+TESTATOA(BGRA, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) -+// TESTATOA(I400, uint8_t, 1, 1, 1, ARGB, uint8_t, 4, 4, 1) -+TESTATOA(I400, uint8_t, 1, 1, 1, I400, uint8_t, 1, 1, 1) -+// TESTATOA(I400, uint8_t, 1, 1, 1, I400Mirror, uint8_t, 1, 1, 1) -+// TESTATOA(J400, uint8_t, 1, 1, 1, ARGB, uint8_t, 4, 4, 1) -+TESTATOA(J400, uint8_t, 1, 1, 1, J400, uint8_t, 1, 1, 1) -+// TESTATOA(RAW, uint8_t, 3, 3, 1, ARGB, uint8_t, 4, 4, 1) -+// TESTATOA(RAW, uint8_t, 3, 3, 1, RGBA, uint8_t, 4, 4, 1) -+TESTATOA(RAW, uint8_t, 3, 3, 1, RGB24, uint8_t, 3, 3, 1) -+// TESTATOA(RGB24, uint8_t, 3, 3, 1, ARGB, uint8_t, 4, 4, 1) -+TESTATOA(RGB24, uint8_t, 3, 3, 1, J400, uint8_t, 1, 1, 1) -+// TESTATOA(RGB24, uint8_t, 3, 3, 1, RGB24Mirror, uint8_t, 3, 3, 1) -+TESTATOA(RAW, uint8_t, 3, 3, 1, J400, uint8_t, 1, 1, 1) -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+// TESTATOA(RGB565, uint8_t, 2, 2, 1, ARGB, uint8_t, 4, 4, 1) -+#endif -+TESTATOA(RGBA, uint8_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) -+// TESTATOA(UYVY, uint8_t, 2, 4, 1, ARGB, uint8_t, 4, 4, 1) -+// TESTATOA(YUY2, uint8_t, 2, 4, 1, ARGB, uint8_t, 4, 4, 1) -+TESTATOA(YUY2, uint8_t, 2, 4, 1, Y, uint8_t, 1, 1, 1) -+// TESTATOA(ARGB, uint8_t, 4, 4, 1, AR64, uint16_t, 4, 4, 1) -+// TESTATOA(ARGB, uint8_t, 4, 4, 1, AB64, uint16_t, 4, 4, 1) -+// TESTATOA(ABGR, uint8_t, 4, 4, 1, AR64, uint16_t, 4, 4, 1) -+// TESTATOA(ABGR, uint8_t, 4, 4, 1, AB64, uint16_t, 4, 4, 1) -+TESTATOA(AR64, uint16_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) -+TESTATOA(AB64, uint16_t, 4, 4, 1, ARGB, uint8_t, 4, 4, 1) -+TESTATOA(AR64, uint16_t, 4, 4, 1, ABGR, uint8_t, 4, 4, 1) -+TESTATOA(AB64, uint16_t, 4, 4, 1, ABGR, uint8_t, 4, 4, 1) -+TESTATOA(AR64, uint16_t, 4, 4, 1, AB64, uint16_t, 4, 4, 1) -+TESTATOA(AB64, uint16_t, 4, 4, 1, AR64, uint16_t, 4, 4, 1) -+ -+#define TESTATOBDI(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, FMT_B, BPP_B, STRIDE_B, \ -+ HEIGHT_B, W1280, N, NEG, OFF) \ -+ TEST_F(LibYUVConvertTest, FMT_A##To##FMT_B##Dither##N) { \ -+ const int kWidth = W1280; \ -+ const int kHeight = benchmark_height_; \ -+ const int kHeightA = (kHeight + HEIGHT_A - 1) / HEIGHT_A * HEIGHT_A; \ -+ const int kHeightB = (kHeight + HEIGHT_B - 1) / HEIGHT_B * HEIGHT_B; \ -+ const int kStrideA = \ -+ (kWidth * BPP_A + STRIDE_A - 1) / STRIDE_A * STRIDE_A; \ -+ const int kStrideB = \ -+ (kWidth * BPP_B + STRIDE_B - 1) / STRIDE_B * STRIDE_B; \ -+ align_buffer_page_end(src_argb, kStrideA* kHeightA + OFF); \ -+ align_buffer_page_end(dst_argb_c, kStrideB* kHeightB); \ -+ align_buffer_page_end(dst_argb_opt, kStrideB* kHeightB); \ -+ for (int i = 0; i < kStrideA * kHeightA; ++i) { \ -+ src_argb[i + OFF] = (fastrand() & 0xff); \ -+ } \ -+ memset(dst_argb_c, 1, kStrideB* kHeightB); \ -+ memset(dst_argb_opt, 101, kStrideB* kHeightB); \ -+ MaskCpuFlags(disable_cpu_flags_); \ -+ FMT_A##To##FMT_B##Dither(src_argb + OFF, kStrideA, dst_argb_c, kStrideB, \ -+ NULL, kWidth, NEG kHeight); \ -+ MaskCpuFlags(benchmark_cpu_info_); \ -+ for (int i = 0; i < benchmark_iterations_; ++i) { \ -+ FMT_A##To##FMT_B##Dither(src_argb + OFF, kStrideA, dst_argb_opt, \ -+ kStrideB, NULL, kWidth, NEG kHeight); \ -+ } \ -+ for (int i = 0; i < kStrideB * kHeightB; ++i) { \ -+ EXPECT_EQ(dst_argb_c[i], dst_argb_opt[i]); \ -+ } \ -+ free_aligned_buffer_page_end(src_argb); \ -+ free_aligned_buffer_page_end(dst_argb_c); \ -+ free_aligned_buffer_page_end(dst_argb_opt); \ -+ } -+ -+#define TESTATOBDRANDOM(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, FMT_B, BPP_B, \ -+ STRIDE_B, HEIGHT_B) \ -+ TEST_F(LibYUVConvertTest, FMT_A##To##FMT_B##Dither_Random) { \ -+ for (int times = 0; times < benchmark_iterations_; ++times) { \ -+ const int kWidth = (fastrand() & 63) + 1; \ -+ const int kHeight = (fastrand() & 31) + 1; \ -+ const int kHeightA = (kHeight + HEIGHT_A - 1) / HEIGHT_A * HEIGHT_A; \ -+ const int kHeightB = (kHeight + HEIGHT_B - 1) / HEIGHT_B * HEIGHT_B; \ -+ const int kStrideA = \ -+ (kWidth * BPP_A + STRIDE_A - 1) / STRIDE_A * STRIDE_A; \ -+ const int kStrideB = \ -+ (kWidth * BPP_B + STRIDE_B - 1) / STRIDE_B * STRIDE_B; \ -+ align_buffer_page_end(src_argb, kStrideA* kHeightA); \ -+ align_buffer_page_end(dst_argb_c, kStrideB* kHeightB); \ -+ align_buffer_page_end(dst_argb_opt, kStrideB* kHeightB); \ -+ for (int i = 0; i < kStrideA * kHeightA; ++i) { \ -+ src_argb[i] = (fastrand() & 0xff); \ -+ } \ -+ memset(dst_argb_c, 123, kStrideB* kHeightB); \ -+ memset(dst_argb_opt, 123, kStrideB* kHeightB); \ -+ MaskCpuFlags(disable_cpu_flags_); \ -+ FMT_A##To##FMT_B##Dither(src_argb, kStrideA, dst_argb_c, kStrideB, NULL, \ -+ kWidth, kHeight); \ -+ MaskCpuFlags(benchmark_cpu_info_); \ -+ FMT_A##To##FMT_B##Dither(src_argb, kStrideA, dst_argb_opt, kStrideB, \ -+ NULL, kWidth, kHeight); \ -+ for (int i = 0; i < kStrideB * kHeightB; ++i) { \ -+ EXPECT_EQ(dst_argb_c[i], dst_argb_opt[i]); \ -+ } \ -+ free_aligned_buffer_page_end(src_argb); \ -+ free_aligned_buffer_page_end(dst_argb_c); \ -+ free_aligned_buffer_page_end(dst_argb_opt); \ -+ } \ -+ } -+ -+#define TESTATOBD(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, FMT_B, BPP_B, STRIDE_B, \ -+ HEIGHT_B) \ -+ TESTATOBDI(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, FMT_B, BPP_B, STRIDE_B, \ -+ HEIGHT_B, benchmark_width_ + 1, _Any, +, 0) \ -+ TESTATOBDI(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, FMT_B, BPP_B, STRIDE_B, \ -+ HEIGHT_B, benchmark_width_, _Unaligned, +, 2) \ -+ TESTATOBDI(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, FMT_B, BPP_B, STRIDE_B, \ -+ HEIGHT_B, benchmark_width_, _Invert, -, 0) \ -+ TESTATOBDI(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, FMT_B, BPP_B, STRIDE_B, \ -+ HEIGHT_B, benchmark_width_, _Opt, +, 0) \ -+ TESTATOBDRANDOM(FMT_A, BPP_A, STRIDE_A, HEIGHT_A, FMT_B, BPP_B, STRIDE_B, \ -+ HEIGHT_B) -+ -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTATOBD(ARGB, 4, 4, 1, RGB565, 2, 2, 1) -+#endif -+ -+// These conversions called twice, produce the original result. -+// e.g. endian swap twice. -+#define TESTENDI(FMT_ATOB, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, W1280, N, NEG, \ -+ OFF) \ -+ TEST_F(LibYUVConvertTest, FMT_ATOB##_Endswap##N) { \ -+ const int kWidth = W1280; \ -+ const int kHeight = benchmark_height_; \ -+ const int kHeightA = (kHeight + HEIGHT_A - 1) / HEIGHT_A * HEIGHT_A; \ -+ const int kStrideA = \ -+ (kWidth * EPP_A + STRIDE_A - 1) / STRIDE_A * STRIDE_A; \ -+ align_buffer_page_end(src_argb, \ -+ kStrideA* kHeightA*(int)sizeof(TYPE_A) + OFF); \ -+ align_buffer_page_end(dst_argb_c, kStrideA* kHeightA*(int)sizeof(TYPE_A)); \ -+ align_buffer_page_end(dst_argb_opt, \ -+ kStrideA* kHeightA*(int)sizeof(TYPE_A)); \ -+ for (int i = 0; i < kStrideA * kHeightA * (int)sizeof(TYPE_A); ++i) { \ -+ src_argb[i + OFF] = (fastrand() & 0xff); \ -+ } \ -+ memset(dst_argb_c, 1, kStrideA* kHeightA); \ -+ memset(dst_argb_opt, 101, kStrideA* kHeightA); \ -+ MaskCpuFlags(disable_cpu_flags_); \ -+ FMT_ATOB((TYPE_A*)(src_argb + OFF), kStrideA, (TYPE_A*)dst_argb_c, \ -+ kStrideA, kWidth, NEG kHeight); \ -+ MaskCpuFlags(benchmark_cpu_info_); \ -+ for (int i = 0; i < benchmark_iterations_; ++i) { \ -+ FMT_ATOB((TYPE_A*)(src_argb + OFF), kStrideA, (TYPE_A*)dst_argb_opt, \ -+ kStrideA, kWidth, NEG kHeight); \ -+ } \ -+ MaskCpuFlags(disable_cpu_flags_); \ -+ FMT_ATOB((TYPE_A*)dst_argb_c, kStrideA, (TYPE_A*)dst_argb_c, kStrideA, \ -+ kWidth, NEG kHeight); \ -+ MaskCpuFlags(benchmark_cpu_info_); \ -+ FMT_ATOB((TYPE_A*)dst_argb_opt, kStrideA, (TYPE_A*)dst_argb_opt, kStrideA, \ -+ kWidth, NEG kHeight); \ -+ for (int i = 0; i < kStrideA * kHeightA * (int)sizeof(TYPE_A); ++i) { \ -+ EXPECT_EQ(src_argb[i + OFF], dst_argb_opt[i]); \ -+ EXPECT_EQ(dst_argb_c[i], dst_argb_opt[i]); \ -+ } \ -+ free_aligned_buffer_page_end(src_argb); \ -+ free_aligned_buffer_page_end(dst_argb_c); \ -+ free_aligned_buffer_page_end(dst_argb_opt); \ -+ } -+ -+#if defined(ENABLE_FULL_TESTS) -+#define TESTEND(FMT_ATOB, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A) \ -+ TESTENDI(FMT_ATOB, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, benchmark_width_ + 1, \ -+ _Any, +, 0) \ -+ TESTENDI(FMT_ATOB, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, benchmark_width_, \ -+ _Unaligned, +, 2) \ -+ TESTENDI(FMT_ATOB, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, benchmark_width_, \ -+ _Opt, +, 0) -+#else -+#define TESTEND(FMT_ATOB, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A) \ -+ TESTENDI(FMT_ATOB, TYPE_A, EPP_A, STRIDE_A, HEIGHT_A, benchmark_width_, \ -+ _Opt, +, 0) -+#endif -+ -+TESTEND(ARGBToBGRA, uint8_t, 4, 4, 1) -+TESTEND(ARGBToABGR, uint8_t, 4, 4, 1) -+TESTEND(BGRAToARGB, uint8_t, 4, 4, 1) -+TESTEND(ABGRToARGB, uint8_t, 4, 4, 1) -+TESTEND(AB64ToAR64, uint16_t, 4, 4, 1) - - #ifdef HAVE_JPEG - TEST_F(LibYUVConvertTest, ValidateJpeg) { -@@ -1263,9 +2209,6 @@ TEST_F(LibYUVConvertTest, TestMJPGToI420 - int half_height = (height + 1) / 2; - int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * - benchmark_height_ / (width * height); -- if (benchmark_iterations < 1) { -- benchmark_iterations = 1; -- } - - align_buffer_page_end(dst_y, width * height); - align_buffer_page_end(dst_u, half_width * half_height); -@@ -1300,9 +2243,6 @@ TEST_F(LibYUVConvertTest, TestMJPGToI420 - int half_height = (height + 1) / 2; - int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * - benchmark_height_ / (width * height); -- if (benchmark_iterations < 1) { -- benchmark_iterations = 1; -- } - - // Convert to NV21 - align_buffer_page_end(dst_y, width * height); -@@ -1362,9 +2302,6 @@ TEST_F(LibYUVConvertTest, TestMJPGToI420 - int half_height = (height + 1) / 2; - int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * - benchmark_height_ / (width * height); -- if (benchmark_iterations < 1) { -- benchmark_iterations = 1; -- } - - // Convert to NV12 - align_buffer_page_end(dst_y, width * height); -@@ -1424,9 +2361,6 @@ TEST_F(LibYUVConvertTest, TestMJPGToNV21 - int half_height = (height + 1) / 2; - int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * - benchmark_height_ / (width * height); -- if (benchmark_iterations < 1) { -- benchmark_iterations = 1; -- } - - align_buffer_page_end(dst_y, width * height); - align_buffer_page_end(dst_uv, half_width * half_height * 2); -@@ -1457,9 +2391,6 @@ TEST_F(LibYUVConvertTest, TestMJPGToNV12 - int half_height = (height + 1) / 2; - int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * - benchmark_height_ / (width * height); -- if (benchmark_iterations < 1) { -- benchmark_iterations = 1; -- } - - align_buffer_page_end(dst_y, width * height); - align_buffer_page_end(dst_uv, half_width * half_height * 2); -@@ -1495,9 +2426,6 @@ TEST_F(LibYUVConvertTest, DISABLED_TestM - int half_height = (height + 1) / 2; - int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * - benchmark_height_ / (width * height); -- if (benchmark_iterations < 1) { -- benchmark_iterations = 1; -- } - - align_buffer_page_end(dst_y, width * height); - align_buffer_page_end(dst_uv, half_width * half_height * 2); -@@ -1528,9 +2456,6 @@ TEST_F(LibYUVConvertTest, DISABLED_TestM - int half_height = (height + 1) / 2; - int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * - benchmark_height_ / (width * height); -- if (benchmark_iterations < 1) { -- benchmark_iterations = 1; -- } - - align_buffer_page_end(dst_y, width * height); - align_buffer_page_end(dst_uv, half_width * half_height * 2); -@@ -1565,9 +2490,6 @@ TEST_F(LibYUVConvertTest, TestMJPGToNV21 - int half_height = (height + 1) / 2; - int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * - benchmark_height_ / (width * height); -- if (benchmark_iterations < 1) { -- benchmark_iterations = 1; -- } - - align_buffer_page_end(dst_y, width * height); - align_buffer_page_end(dst_uv, half_width * half_height * 2); -@@ -1598,9 +2520,6 @@ TEST_F(LibYUVConvertTest, TestMJPGToNV12 - int half_height = (height + 1) / 2; - int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * - benchmark_height_ / (width * height); -- if (benchmark_iterations < 1) { -- benchmark_iterations = 1; -- } - - align_buffer_page_end(dst_y, width * height); - align_buffer_page_end(dst_uv, half_width * half_height * 2); -@@ -1635,9 +2554,6 @@ TEST_F(LibYUVConvertTest, TestMJPGToNV21 - int half_height = (height + 1) / 2; - int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * - benchmark_height_ / (width * height); -- if (benchmark_iterations < 1) { -- benchmark_iterations = 1; -- } - - align_buffer_page_end(dst_y, width * height); - align_buffer_page_end(dst_uv, half_width * half_height * 2); -@@ -1668,9 +2584,6 @@ TEST_F(LibYUVConvertTest, TestMJPGToNV12 - int half_height = (height + 1) / 2; - int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * - benchmark_height_ / (width * height); -- if (benchmark_iterations < 1) { -- benchmark_iterations = 1; -- } - - align_buffer_page_end(dst_y, width * height); - align_buffer_page_end(dst_uv, half_width * half_height * 2); -@@ -1703,9 +2616,6 @@ TEST_F(LibYUVConvertTest, TestMJPGToARGB - - int benchmark_iterations = benchmark_iterations_ * benchmark_width_ * - benchmark_height_ / (width * height); -- if (benchmark_iterations < 1) { -- benchmark_iterations = 1; -- } - - align_buffer_page_end(dst_argb, width * height * 4); - for (int times = 0; times < benchmark_iterations; ++times) { -@@ -1944,6 +2854,157 @@ TEST_F(LibYUVConvertTest, I420CropOddY) - free_aligned_buffer_page_end(src_y); - } - -+TEST_F(LibYUVConvertTest, TestYToARGB) { -+ uint8_t y[32]; -+ uint8_t expectedg[32]; -+ for (int i = 0; i < 32; ++i) { -+ y[i] = i * 5 + 17; -+ expectedg[i] = static_cast((y[i] - 16) * 1.164f + 0.5f); -+ } -+ uint8_t argb[32 * 4]; -+ YToARGB(y, 0, argb, 0, 32, 1); -+ -+ for (int i = 0; i < 32; ++i) { -+ printf("%2d %d: %d <-> %d,%d,%d,%d\n", i, y[i], expectedg[i], -+ argb[i * 4 + 0], argb[i * 4 + 1], argb[i * 4 + 2], argb[i * 4 + 3]); -+ } -+ for (int i = 0; i < 32; ++i) { -+ EXPECT_EQ(expectedg[i], argb[i * 4 + 0]); -+ } -+} -+ -+static const uint8_t kNoDither4x4[16] = { -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -+}; -+ -+TEST_F(LibYUVConvertTest, TestNoDither) { -+ align_buffer_page_end(src_argb, benchmark_width_ * benchmark_height_ * 4); -+ align_buffer_page_end(dst_rgb565, benchmark_width_ * benchmark_height_ * 2); -+ align_buffer_page_end(dst_rgb565dither, -+ benchmark_width_ * benchmark_height_ * 2); -+ MemRandomize(src_argb, benchmark_width_ * benchmark_height_ * 4); -+ MemRandomize(dst_rgb565, benchmark_width_ * benchmark_height_ * 2); -+ MemRandomize(dst_rgb565dither, benchmark_width_ * benchmark_height_ * 2); -+ ARGBToRGB565(src_argb, benchmark_width_ * 4, dst_rgb565, benchmark_width_ * 2, -+ benchmark_width_, benchmark_height_); -+ ARGBToRGB565Dither(src_argb, benchmark_width_ * 4, dst_rgb565dither, -+ benchmark_width_ * 2, kNoDither4x4, benchmark_width_, -+ benchmark_height_); -+ for (int i = 0; i < benchmark_width_ * benchmark_height_ * 2; ++i) { -+ EXPECT_EQ(dst_rgb565[i], dst_rgb565dither[i]); -+ } -+ -+ free_aligned_buffer_page_end(src_argb); -+ free_aligned_buffer_page_end(dst_rgb565); -+ free_aligned_buffer_page_end(dst_rgb565dither); -+} -+ -+// Ordered 4x4 dither for 888 to 565. Values from 0 to 7. -+static const uint8_t kDither565_4x4[16] = { -+ 0, 4, 1, 5, 6, 2, 7, 3, 1, 5, 0, 4, 7, 3, 6, 2, -+}; -+ -+TEST_F(LibYUVConvertTest, TestDither) { -+ align_buffer_page_end(src_argb, benchmark_width_ * benchmark_height_ * 4); -+ align_buffer_page_end(dst_rgb565, benchmark_width_ * benchmark_height_ * 2); -+ align_buffer_page_end(dst_rgb565dither, -+ benchmark_width_ * benchmark_height_ * 2); -+ align_buffer_page_end(dst_argb, benchmark_width_ * benchmark_height_ * 4); -+ align_buffer_page_end(dst_argbdither, -+ benchmark_width_ * benchmark_height_ * 4); -+ MemRandomize(src_argb, benchmark_width_ * benchmark_height_ * 4); -+ MemRandomize(dst_rgb565, benchmark_width_ * benchmark_height_ * 2); -+ MemRandomize(dst_rgb565dither, benchmark_width_ * benchmark_height_ * 2); -+ MemRandomize(dst_argb, benchmark_width_ * benchmark_height_ * 4); -+ MemRandomize(dst_argbdither, benchmark_width_ * benchmark_height_ * 4); -+ ARGBToRGB565(src_argb, benchmark_width_ * 4, dst_rgb565, benchmark_width_ * 2, -+ benchmark_width_, benchmark_height_); -+ ARGBToRGB565Dither(src_argb, benchmark_width_ * 4, dst_rgb565dither, -+ benchmark_width_ * 2, kDither565_4x4, benchmark_width_, -+ benchmark_height_); -+ RGB565ToARGB(dst_rgb565, benchmark_width_ * 2, dst_argb, benchmark_width_ * 4, -+ benchmark_width_, benchmark_height_); -+ RGB565ToARGB(dst_rgb565dither, benchmark_width_ * 2, dst_argbdither, -+ benchmark_width_ * 4, benchmark_width_, benchmark_height_); -+ -+ for (int i = 0; i < benchmark_width_ * benchmark_height_ * 4; ++i) { -+ EXPECT_NEAR(dst_argb[i], dst_argbdither[i], 9); -+ } -+ free_aligned_buffer_page_end(src_argb); -+ free_aligned_buffer_page_end(dst_rgb565); -+ free_aligned_buffer_page_end(dst_rgb565dither); -+ free_aligned_buffer_page_end(dst_argb); -+ free_aligned_buffer_page_end(dst_argbdither); -+} -+ -+#define TESTPLANARTOBID(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, W1280, N, NEG, OFF, FMT_C, BPP_C) \ -+ TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##Dither##N) { \ -+ const int kWidth = W1280; \ -+ const int kHeight = ALIGNINT(benchmark_height_, YALIGN); \ -+ const int kStrideB = ALIGNINT(kWidth * BPP_B, ALIGN); \ -+ const int kStrideUV = SUBSAMPLE(kWidth, SUBSAMP_X); \ -+ const int kSizeUV = kStrideUV * SUBSAMPLE(kHeight, SUBSAMP_Y); \ -+ align_buffer_page_end(src_y, kWidth* kHeight + OFF); \ -+ align_buffer_page_end(src_u, kSizeUV + OFF); \ -+ align_buffer_page_end(src_v, kSizeUV + OFF); \ -+ align_buffer_page_end(dst_argb_c, kStrideB* kHeight + OFF); \ -+ align_buffer_page_end(dst_argb_opt, kStrideB* kHeight + OFF); \ -+ for (int i = 0; i < kWidth * kHeight; ++i) { \ -+ src_y[i + OFF] = (fastrand() & 0xff); \ -+ } \ -+ for (int i = 0; i < kSizeUV; ++i) { \ -+ src_u[i + OFF] = (fastrand() & 0xff); \ -+ src_v[i + OFF] = (fastrand() & 0xff); \ -+ } \ -+ memset(dst_argb_c + OFF, 1, kStrideB * kHeight); \ -+ memset(dst_argb_opt + OFF, 101, kStrideB * kHeight); \ -+ MaskCpuFlags(disable_cpu_flags_); \ -+ FMT_PLANAR##To##FMT_B##Dither(src_y + OFF, kWidth, src_u + OFF, kStrideUV, \ -+ src_v + OFF, kStrideUV, dst_argb_c + OFF, \ -+ kStrideB, NULL, kWidth, NEG kHeight); \ -+ MaskCpuFlags(benchmark_cpu_info_); \ -+ for (int i = 0; i < benchmark_iterations_; ++i) { \ -+ FMT_PLANAR##To##FMT_B##Dither( \ -+ src_y + OFF, kWidth, src_u + OFF, kStrideUV, src_v + OFF, kStrideUV, \ -+ dst_argb_opt + OFF, kStrideB, NULL, kWidth, NEG kHeight); \ -+ } \ -+ /* Convert to ARGB so 565 is expanded to bytes that can be compared. */ \ -+ align_buffer_page_end(dst_argb32_c, kWidth* BPP_C* kHeight); \ -+ align_buffer_page_end(dst_argb32_opt, kWidth* BPP_C* kHeight); \ -+ memset(dst_argb32_c, 2, kWidth* BPP_C* kHeight); \ -+ memset(dst_argb32_opt, 102, kWidth* BPP_C* kHeight); \ -+ FMT_B##To##FMT_C(dst_argb_c + OFF, kStrideB, dst_argb32_c, kWidth * BPP_C, \ -+ kWidth, kHeight); \ -+ FMT_B##To##FMT_C(dst_argb_opt + OFF, kStrideB, dst_argb32_opt, \ -+ kWidth * BPP_C, kWidth, kHeight); \ -+ for (int i = 0; i < kWidth * BPP_C * kHeight; ++i) { \ -+ EXPECT_EQ(dst_argb32_c[i], dst_argb32_opt[i]); \ -+ } \ -+ free_aligned_buffer_page_end(src_y); \ -+ free_aligned_buffer_page_end(src_u); \ -+ free_aligned_buffer_page_end(src_v); \ -+ free_aligned_buffer_page_end(dst_argb_c); \ -+ free_aligned_buffer_page_end(dst_argb_opt); \ -+ free_aligned_buffer_page_end(dst_argb32_c); \ -+ free_aligned_buffer_page_end(dst_argb32_opt); \ -+ } -+ -+#define TESTPLANARTOBD(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, FMT_C, BPP_C) \ -+ TESTPLANARTOBID(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_ + 1, _Any, +, 0, FMT_C, BPP_C) \ -+ TESTPLANARTOBID(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_, _Unaligned, +, 2, FMT_C, BPP_C) \ -+ TESTPLANARTOBID(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_, _Invert, -, 0, FMT_C, BPP_C) \ -+ TESTPLANARTOBID(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_, _Opt, +, 0, FMT_C, BPP_C) -+ -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTPLANARTOBD(I420, 2, 2, RGB565, 2, 2, 1, ARGB, 4) -+#endif -+ - #define TESTPTOB(NAME, UYVYTOI420, UYVYTONV12) \ - TEST_F(LibYUVConvertTest, NAME) { \ - const int kWidth = benchmark_width_; \ -@@ -2049,6 +3110,1367 @@ TEST_F(LibYUVConvertTest, MM21ToYUY2) { - free_aligned_buffer_page_end(golden_yuyv); - } - -+// Transitive test. A to B to C is same as A to C. -+// Benchmarks A To B to C for comparison to 1 step, benchmarked elsewhere. -+#define TESTPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ -+ W1280, N, NEG, OFF, FMT_C, BPP_C) \ -+ TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##To##FMT_C##N) { \ -+ const int kWidth = W1280; \ -+ const int kHeight = benchmark_height_; \ -+ const int kStrideB = SUBSAMPLE(kWidth, SUB_B) * BPP_B; \ -+ const int kStrideUV = SUBSAMPLE(kWidth, SUBSAMP_X); \ -+ const int kSizeUV = kStrideUV * SUBSAMPLE(kHeight, SUBSAMP_Y); \ -+ align_buffer_page_end(src_y, kWidth* kHeight + OFF); \ -+ align_buffer_page_end(src_u, kSizeUV + OFF); \ -+ align_buffer_page_end(src_v, kSizeUV + OFF); \ -+ align_buffer_page_end(dst_argb_b, kStrideB* kHeight + OFF); \ -+ for (int i = 0; i < kWidth * kHeight; ++i) { \ -+ src_y[i + OFF] = (fastrand() & 0xff); \ -+ } \ -+ for (int i = 0; i < kSizeUV; ++i) { \ -+ src_u[i + OFF] = (fastrand() & 0xff); \ -+ src_v[i + OFF] = (fastrand() & 0xff); \ -+ } \ -+ memset(dst_argb_b + OFF, 1, kStrideB * kHeight); \ -+ FMT_PLANAR##To##FMT_B(src_y + OFF, kWidth, src_u + OFF, kStrideUV, \ -+ src_v + OFF, kStrideUV, dst_argb_b + OFF, kStrideB, \ -+ kWidth, NEG kHeight); \ -+ /* Convert to a 3rd format in 1 step and 2 steps and compare */ \ -+ const int kStrideC = kWidth * BPP_C; \ -+ align_buffer_page_end(dst_argb_c, kStrideC* kHeight + OFF); \ -+ align_buffer_page_end(dst_argb_bc, kStrideC* kHeight + OFF); \ -+ memset(dst_argb_c + OFF, 2, kStrideC * kHeight); \ -+ memset(dst_argb_bc + OFF, 3, kStrideC * kHeight); \ -+ for (int i = 0; i < benchmark_iterations_; ++i) { \ -+ FMT_PLANAR##To##FMT_C(src_y + OFF, kWidth, src_u + OFF, kStrideUV, \ -+ src_v + OFF, kStrideUV, dst_argb_c + OFF, \ -+ kStrideC, kWidth, NEG kHeight); \ -+ /* Convert B to C */ \ -+ FMT_B##To##FMT_C(dst_argb_b + OFF, kStrideB, dst_argb_bc + OFF, \ -+ kStrideC, kWidth, kHeight); \ -+ } \ -+ for (int i = 0; i < kStrideC * kHeight; ++i) { \ -+ EXPECT_EQ(dst_argb_c[i + OFF], dst_argb_bc[i + OFF]); \ -+ } \ -+ free_aligned_buffer_page_end(src_y); \ -+ free_aligned_buffer_page_end(src_u); \ -+ free_aligned_buffer_page_end(src_v); \ -+ free_aligned_buffer_page_end(dst_argb_b); \ -+ free_aligned_buffer_page_end(dst_argb_c); \ -+ free_aligned_buffer_page_end(dst_argb_bc); \ -+ } -+ -+#if defined(ENABLE_FULL_TESTS) -+#define TESTPLANARTOE(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ -+ FMT_C, BPP_C) \ -+ TESTPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ -+ benchmark_width_ + 1, _Any, +, 0, FMT_C, BPP_C) \ -+ TESTPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ -+ benchmark_width_, _Unaligned, +, 2, FMT_C, BPP_C) \ -+ TESTPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ -+ benchmark_width_, _Invert, -, 0, FMT_C, BPP_C) \ -+ TESTPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ -+ benchmark_width_, _Opt, +, 0, FMT_C, BPP_C) -+#else -+#define TESTPLANARTOE(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ -+ FMT_C, BPP_C) \ -+ TESTPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ -+ benchmark_width_, _Opt, +, 0, FMT_C, BPP_C) -+#endif -+ -+#if defined(ENABLE_FULL_TESTS) -+TESTPLANARTOE(I420, 2, 2, ABGR, 1, 4, ARGB, 4) -+TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, ABGR, 4) -+TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, RAW, 3) -+TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, RGB24, 3) -+TESTPLANARTOE(I420, 2, 2, BGRA, 1, 4, ARGB, 4) -+TESTPLANARTOE(I420, 2, 2, RAW, 1, 3, ARGB, 4) -+TESTPLANARTOE(I420, 2, 2, RAW, 1, 3, RGB24, 3) -+TESTPLANARTOE(I420, 2, 2, RGB24, 1, 3, ARGB, 4) -+TESTPLANARTOE(I420, 2, 2, RGB24, 1, 3, RAW, 3) -+TESTPLANARTOE(I420, 2, 2, RGBA, 1, 4, ARGB, 4) -+TESTPLANARTOE(H420, 2, 2, ABGR, 1, 4, ARGB, 4) -+TESTPLANARTOE(H420, 2, 2, ARGB, 1, 4, ABGR, 4) -+TESTPLANARTOE(H420, 2, 2, ARGB, 1, 4, RAW, 3) -+TESTPLANARTOE(H420, 2, 2, ARGB, 1, 4, RGB24, 3) -+TESTPLANARTOE(H420, 2, 2, RAW, 1, 3, ARGB, 4) -+TESTPLANARTOE(H420, 2, 2, RAW, 1, 3, RGB24, 3) -+TESTPLANARTOE(H420, 2, 2, RGB24, 1, 3, ARGB, 4) -+TESTPLANARTOE(H420, 2, 2, RGB24, 1, 3, RAW, 3) -+TESTPLANARTOE(J420, 2, 2, ABGR, 1, 4, ARGB, 4) -+TESTPLANARTOE(J420, 2, 2, ARGB, 1, 4, ARGB, 4) -+TESTPLANARTOE(U420, 2, 2, ABGR, 1, 4, ARGB, 4) -+TESTPLANARTOE(U420, 2, 2, ARGB, 1, 4, ARGB, 4) -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, RGB565, 2) -+TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, ARGB1555, 2) -+TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, ARGB4444, 2) -+TESTPLANARTOE(I422, 2, 1, ARGB, 1, 4, RGB565, 2) -+#endif -+TESTPLANARTOE(I422, 2, 1, ARGB, 1, 4, ABGR, 4) -+TESTPLANARTOE(I422, 2, 1, ABGR, 1, 4, ARGB, 4) -+TESTPLANARTOE(J422, 2, 1, ARGB, 1, 4, ARGB, 4) -+TESTPLANARTOE(J422, 2, 1, ABGR, 1, 4, ARGB, 4) -+TESTPLANARTOE(H422, 2, 1, ARGB, 1, 4, ARGB, 4) -+TESTPLANARTOE(H422, 2, 1, ABGR, 1, 4, ARGB, 4) -+TESTPLANARTOE(U422, 2, 1, ARGB, 1, 4, ARGB, 4) -+TESTPLANARTOE(U422, 2, 1, ABGR, 1, 4, ARGB, 4) -+TESTPLANARTOE(V422, 2, 1, ARGB, 1, 4, ARGB, 4) -+TESTPLANARTOE(V422, 2, 1, ABGR, 1, 4, ARGB, 4) -+TESTPLANARTOE(I422, 2, 1, BGRA, 1, 4, ARGB, 4) -+TESTPLANARTOE(I422, 2, 1, RGBA, 1, 4, ARGB, 4) -+TESTPLANARTOE(I444, 1, 1, ARGB, 1, 4, ABGR, 4) -+TESTPLANARTOE(I444, 1, 1, ABGR, 1, 4, ARGB, 4) -+TESTPLANARTOE(J444, 1, 1, ARGB, 1, 4, ARGB, 4) -+TESTPLANARTOE(J444, 1, 1, ABGR, 1, 4, ARGB, 4) -+TESTPLANARTOE(H444, 1, 1, ARGB, 1, 4, ARGB, 4) -+TESTPLANARTOE(H444, 1, 1, ABGR, 1, 4, ARGB, 4) -+TESTPLANARTOE(U444, 1, 1, ARGB, 1, 4, ARGB, 4) -+TESTPLANARTOE(U444, 1, 1, ABGR, 1, 4, ARGB, 4) -+TESTPLANARTOE(V444, 1, 1, ARGB, 1, 4, ARGB, 4) -+TESTPLANARTOE(V444, 1, 1, ABGR, 1, 4, ARGB, 4) -+TESTPLANARTOE(I420, 2, 2, YUY2, 2, 4, ARGB, 4) -+TESTPLANARTOE(I420, 2, 2, UYVY, 2, 4, ARGB, 4) -+TESTPLANARTOE(I422, 2, 1, YUY2, 2, 4, ARGB, 4) -+TESTPLANARTOE(I422, 2, 1, UYVY, 2, 4, ARGB, 4) -+#else -+TESTPLANARTOE(I420, 2, 2, ABGR, 1, 4, ARGB, 4) -+TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, ARGB1555, 2) -+TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, ARGB4444, 2) -+TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, RAW, 3) -+TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, RGB24, 3) -+TESTPLANARTOE(I420, 2, 2, ARGB, 1, 4, RGB565, 2) -+TESTPLANARTOE(I420, 2, 2, BGRA, 1, 4, ARGB, 4) -+TESTPLANARTOE(I420, 2, 2, RAW, 1, 3, ARGB, 4) -+TESTPLANARTOE(I420, 2, 2, RAW, 1, 3, RGB24, 3) -+TESTPLANARTOE(I420, 2, 2, RGB24, 1, 3, ARGB, 4) -+TESTPLANARTOE(I420, 2, 2, RGB24, 1, 3, RAW, 3) -+TESTPLANARTOE(I420, 2, 2, RGBA, 1, 4, ARGB, 4) -+TESTPLANARTOE(I420, 2, 2, UYVY, 2, 4, ARGB, 4) -+TESTPLANARTOE(I420, 2, 2, YUY2, 2, 4, ARGB, 4) -+TESTPLANARTOE(I422, 2, 1, ABGR, 1, 4, ARGB, 4) -+TESTPLANARTOE(I422, 2, 1, ARGB, 1, 4, RGB565, 2) -+TESTPLANARTOE(I422, 2, 1, BGRA, 1, 4, ARGB, 4) -+TESTPLANARTOE(I422, 2, 1, RGBA, 1, 4, ARGB, 4) -+TESTPLANARTOE(I422, 2, 1, UYVY, 2, 4, ARGB, 4) -+TESTPLANARTOE(I422, 2, 1, YUY2, 2, 4, ARGB, 4) -+TESTPLANARTOE(I444, 1, 1, ABGR, 1, 4, ARGB, 4) -+#endif -+ -+// Transitive test: Compare 1 step vs 2 step conversion for YUVA to ARGB. -+// Benchmark 2 step conversion for comparison to 1 step conversion. -+#define TESTQPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ -+ W1280, N, NEG, OFF, FMT_C, BPP_C, ATTEN) \ -+ TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##To##FMT_C##N) { \ -+ const int kWidth = W1280; \ -+ const int kHeight = benchmark_height_; \ -+ const int kStrideB = SUBSAMPLE(kWidth, SUB_B) * BPP_B; \ -+ const int kSizeUV = \ -+ SUBSAMPLE(kWidth, SUBSAMP_X) * SUBSAMPLE(kHeight, SUBSAMP_Y); \ -+ align_buffer_page_end(src_y, kWidth* kHeight + OFF); \ -+ align_buffer_page_end(src_u, kSizeUV + OFF); \ -+ align_buffer_page_end(src_v, kSizeUV + OFF); \ -+ align_buffer_page_end(src_a, kWidth* kHeight + OFF); \ -+ align_buffer_page_end(dst_argb_b, kStrideB* kHeight + OFF); \ -+ const int kStrideC = kWidth * BPP_C; \ -+ align_buffer_page_end(dst_argb_c, kStrideC* kHeight + OFF); \ -+ align_buffer_page_end(dst_argb_bc, kStrideC* kHeight + OFF); \ -+ memset(dst_argb_c + OFF, 2, kStrideC * kHeight); \ -+ memset(dst_argb_b + OFF, 1, kStrideB * kHeight); \ -+ memset(dst_argb_bc + OFF, 3, kStrideC * kHeight); \ -+ for (int i = 0; i < kWidth * kHeight; ++i) { \ -+ src_y[i + OFF] = (fastrand() & 0xff); \ -+ src_a[i + OFF] = (fastrand() & 0xff); \ -+ } \ -+ for (int i = 0; i < kSizeUV; ++i) { \ -+ src_u[i + OFF] = (fastrand() & 0xff); \ -+ src_v[i + OFF] = (fastrand() & 0xff); \ -+ } \ -+ for (int i = 0; i < benchmark_iterations_; ++i) { \ -+ /* Convert A to B */ \ -+ FMT_PLANAR##To##FMT_B( \ -+ src_y + OFF, kWidth, src_u + OFF, SUBSAMPLE(kWidth, SUBSAMP_X), \ -+ src_v + OFF, SUBSAMPLE(kWidth, SUBSAMP_X), src_a + OFF, kWidth, \ -+ dst_argb_b + OFF, kStrideB, kWidth, NEG kHeight, ATTEN); \ -+ /* Convert B to C */ \ -+ FMT_B##To##FMT_C(dst_argb_b + OFF, kStrideB, dst_argb_bc + OFF, \ -+ kStrideC, kWidth, kHeight); \ -+ } \ -+ /* Convert A to C */ \ -+ FMT_PLANAR##To##FMT_C( \ -+ src_y + OFF, kWidth, src_u + OFF, SUBSAMPLE(kWidth, SUBSAMP_X), \ -+ src_v + OFF, SUBSAMPLE(kWidth, SUBSAMP_X), src_a + OFF, kWidth, \ -+ dst_argb_c + OFF, kStrideC, kWidth, NEG kHeight, ATTEN); \ -+ for (int i = 0; i < kStrideC * kHeight; ++i) { \ -+ EXPECT_EQ(dst_argb_c[i + OFF], dst_argb_bc[i + OFF]); \ -+ } \ -+ free_aligned_buffer_page_end(src_y); \ -+ free_aligned_buffer_page_end(src_u); \ -+ free_aligned_buffer_page_end(src_v); \ -+ free_aligned_buffer_page_end(src_a); \ -+ free_aligned_buffer_page_end(dst_argb_b); \ -+ free_aligned_buffer_page_end(dst_argb_c); \ -+ free_aligned_buffer_page_end(dst_argb_bc); \ -+ } -+ -+#if defined(ENABLE_FULL_TESTS) -+#define TESTQPLANARTOE(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ -+ FMT_C, BPP_C) \ -+ TESTQPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ -+ benchmark_width_ + 1, _Any, +, 0, FMT_C, BPP_C, 0) \ -+ TESTQPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ -+ benchmark_width_, _Unaligned, +, 2, FMT_C, BPP_C, 0) \ -+ TESTQPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ -+ benchmark_width_, _Invert, -, 0, FMT_C, BPP_C, 0) \ -+ TESTQPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ -+ benchmark_width_, _Opt, +, 0, FMT_C, BPP_C, 0) \ -+ TESTQPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ -+ benchmark_width_, _Premult, +, 0, FMT_C, BPP_C, 1) -+#else -+#define TESTQPLANARTOE(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ -+ FMT_C, BPP_C) \ -+ TESTQPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ -+ benchmark_width_, _Opt, +, 0, FMT_C, BPP_C, 0) -+#endif -+ -+#if defined(ENABLE_FULL_TESTS) -+TESTQPLANARTOE(I420Alpha, 2, 2, ARGB, 1, 4, ABGR, 4) -+TESTQPLANARTOE(I420Alpha, 2, 2, ABGR, 1, 4, ARGB, 4) -+TESTQPLANARTOE(J420Alpha, 2, 2, ARGB, 1, 4, ABGR, 4) -+TESTQPLANARTOE(J420Alpha, 2, 2, ABGR, 1, 4, ARGB, 4) -+TESTQPLANARTOE(H420Alpha, 2, 2, ARGB, 1, 4, ABGR, 4) -+TESTQPLANARTOE(H420Alpha, 2, 2, ABGR, 1, 4, ARGB, 4) -+TESTQPLANARTOE(F420Alpha, 2, 2, ARGB, 1, 4, ABGR, 4) -+TESTQPLANARTOE(F420Alpha, 2, 2, ABGR, 1, 4, ARGB, 4) -+TESTQPLANARTOE(U420Alpha, 2, 2, ARGB, 1, 4, ABGR, 4) -+TESTQPLANARTOE(U420Alpha, 2, 2, ABGR, 1, 4, ARGB, 4) -+TESTQPLANARTOE(V420Alpha, 2, 2, ARGB, 1, 4, ABGR, 4) -+TESTQPLANARTOE(V420Alpha, 2, 2, ABGR, 1, 4, ARGB, 4) -+TESTQPLANARTOE(I422Alpha, 2, 1, ARGB, 1, 4, ABGR, 4) -+TESTQPLANARTOE(I422Alpha, 2, 1, ABGR, 1, 4, ARGB, 4) -+TESTQPLANARTOE(J422Alpha, 2, 1, ARGB, 1, 4, ABGR, 4) -+TESTQPLANARTOE(J422Alpha, 2, 1, ABGR, 1, 4, ARGB, 4) -+TESTQPLANARTOE(F422Alpha, 2, 1, ARGB, 1, 4, ABGR, 4) -+TESTQPLANARTOE(F422Alpha, 2, 1, ABGR, 1, 4, ARGB, 4) -+TESTQPLANARTOE(H422Alpha, 2, 1, ARGB, 1, 4, ABGR, 4) -+TESTQPLANARTOE(H422Alpha, 2, 1, ABGR, 1, 4, ARGB, 4) -+TESTQPLANARTOE(U422Alpha, 2, 1, ARGB, 1, 4, ABGR, 4) -+TESTQPLANARTOE(U422Alpha, 2, 1, ABGR, 1, 4, ARGB, 4) -+TESTQPLANARTOE(V422Alpha, 2, 1, ARGB, 1, 4, ABGR, 4) -+TESTQPLANARTOE(V422Alpha, 2, 1, ABGR, 1, 4, ARGB, 4) -+TESTQPLANARTOE(I444Alpha, 1, 1, ARGB, 1, 4, ABGR, 4) -+TESTQPLANARTOE(I444Alpha, 1, 1, ABGR, 1, 4, ARGB, 4) -+TESTQPLANARTOE(J444Alpha, 1, 1, ARGB, 1, 4, ABGR, 4) -+TESTQPLANARTOE(J444Alpha, 1, 1, ABGR, 1, 4, ARGB, 4) -+TESTQPLANARTOE(H444Alpha, 1, 1, ARGB, 1, 4, ABGR, 4) -+TESTQPLANARTOE(H444Alpha, 1, 1, ABGR, 1, 4, ARGB, 4) -+TESTQPLANARTOE(U444Alpha, 1, 1, ARGB, 1, 4, ABGR, 4) -+TESTQPLANARTOE(U444Alpha, 1, 1, ABGR, 1, 4, ARGB, 4) -+TESTQPLANARTOE(V444Alpha, 1, 1, ARGB, 1, 4, ABGR, 4) -+TESTQPLANARTOE(V444Alpha, 1, 1, ABGR, 1, 4, ARGB, 4) -+#else -+TESTQPLANARTOE(I420Alpha, 2, 2, ABGR, 1, 4, ARGB, 4) -+TESTQPLANARTOE(I422Alpha, 2, 1, ABGR, 1, 4, ARGB, 4) -+TESTQPLANARTOE(I444Alpha, 1, 1, ABGR, 1, 4, ARGB, 4) -+#endif -+ -+#define TESTPLANETOEI(FMT_A, SUB_A, BPP_A, FMT_B, SUB_B, BPP_B, W1280, N, NEG, \ -+ OFF, FMT_C, BPP_C) \ -+ TEST_F(LibYUVConvertTest, FMT_A##To##FMT_B##To##FMT_C##N) { \ -+ const int kWidth = W1280; \ -+ const int kHeight = benchmark_height_; \ -+ const int kStrideA = SUBSAMPLE(kWidth, SUB_A) * BPP_A; \ -+ const int kStrideB = SUBSAMPLE(kWidth, SUB_B) * BPP_B; \ -+ align_buffer_page_end(src_argb_a, kStrideA* kHeight + OFF); \ -+ align_buffer_page_end(dst_argb_b, kStrideB* kHeight + OFF); \ -+ MemRandomize(src_argb_a + OFF, kStrideA * kHeight); \ -+ memset(dst_argb_b + OFF, 1, kStrideB * kHeight); \ -+ FMT_A##To##FMT_B(src_argb_a + OFF, kStrideA, dst_argb_b + OFF, kStrideB, \ -+ kWidth, NEG kHeight); \ -+ /* Convert to a 3rd format in 1 step and 2 steps and compare */ \ -+ const int kStrideC = kWidth * BPP_C; \ -+ align_buffer_page_end(dst_argb_c, kStrideC* kHeight + OFF); \ -+ align_buffer_page_end(dst_argb_bc, kStrideC* kHeight + OFF); \ -+ memset(dst_argb_c + OFF, 2, kStrideC * kHeight); \ -+ memset(dst_argb_bc + OFF, 3, kStrideC * kHeight); \ -+ for (int i = 0; i < benchmark_iterations_; ++i) { \ -+ FMT_A##To##FMT_C(src_argb_a + OFF, kStrideA, dst_argb_c + OFF, kStrideC, \ -+ kWidth, NEG kHeight); \ -+ /* Convert B to C */ \ -+ FMT_B##To##FMT_C(dst_argb_b + OFF, kStrideB, dst_argb_bc + OFF, \ -+ kStrideC, kWidth, kHeight); \ -+ } \ -+ for (int i = 0; i < kStrideC * kHeight; i += 4) { \ -+ EXPECT_EQ(dst_argb_c[i + OFF + 0], dst_argb_bc[i + OFF + 0]); \ -+ EXPECT_EQ(dst_argb_c[i + OFF + 1], dst_argb_bc[i + OFF + 1]); \ -+ EXPECT_EQ(dst_argb_c[i + OFF + 2], dst_argb_bc[i + OFF + 2]); \ -+ EXPECT_NEAR(dst_argb_c[i + OFF + 3], dst_argb_bc[i + OFF + 3], 64); \ -+ } \ -+ free_aligned_buffer_page_end(src_argb_a); \ -+ free_aligned_buffer_page_end(dst_argb_b); \ -+ free_aligned_buffer_page_end(dst_argb_c); \ -+ free_aligned_buffer_page_end(dst_argb_bc); \ -+ } -+ -+#define TESTPLANETOE(FMT_A, SUB_A, BPP_A, FMT_B, SUB_B, BPP_B, FMT_C, BPP_C) \ -+ TESTPLANETOEI(FMT_A, SUB_A, BPP_A, FMT_B, SUB_B, BPP_B, \ -+ benchmark_width_ + 1, _Any, +, 0, FMT_C, BPP_C) \ -+ TESTPLANETOEI(FMT_A, SUB_A, BPP_A, FMT_B, SUB_B, BPP_B, benchmark_width_, \ -+ _Unaligned, +, 4, FMT_C, BPP_C) \ -+ TESTPLANETOEI(FMT_A, SUB_A, BPP_A, FMT_B, SUB_B, BPP_B, benchmark_width_, \ -+ _Invert, -, 0, FMT_C, BPP_C) \ -+ TESTPLANETOEI(FMT_A, SUB_A, BPP_A, FMT_B, SUB_B, BPP_B, benchmark_width_, \ -+ _Opt, +, 0, FMT_C, BPP_C) -+ -+// Caveat: Destination needs to be 4 bytes -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTPLANETOE(ARGB, 1, 4, AR30, 1, 4, ARGB, 4) -+TESTPLANETOE(ABGR, 1, 4, AR30, 1, 4, ABGR, 4) -+TESTPLANETOE(AR30, 1, 4, ARGB, 1, 4, ABGR, 4) -+TESTPLANETOE(AR30, 1, 4, ABGR, 1, 4, ARGB, 4) -+TESTPLANETOE(ARGB, 1, 4, AB30, 1, 4, ARGB, 4) -+TESTPLANETOE(ABGR, 1, 4, AB30, 1, 4, ABGR, 4) -+TESTPLANETOE(AB30, 1, 4, ARGB, 1, 4, ABGR, 4) -+TESTPLANETOE(AB30, 1, 4, ABGR, 1, 4, ARGB, 4) -+#endif -+ -+TEST_F(LibYUVConvertTest, RotateWithARGBSource) { -+ // 2x2 frames -+ uint32_t src[4]; -+ uint32_t dst[4]; -+ // some random input -+ src[0] = 0x11000000; -+ src[1] = 0x00450000; -+ src[2] = 0x00009f00; -+ src[3] = 0x000000ff; -+ // zeros on destination -+ dst[0] = 0x00000000; -+ dst[1] = 0x00000000; -+ dst[2] = 0x00000000; -+ dst[3] = 0x00000000; -+ -+ int r = ConvertToARGB(reinterpret_cast(src), -+ 16, // input size -+ reinterpret_cast(dst), -+ 8, // destination stride -+ 0, // crop_x -+ 0, // crop_y -+ 2, // width -+ 2, // height -+ 2, // crop width -+ 2, // crop height -+ kRotate90, FOURCC_ARGB); -+ -+ EXPECT_EQ(r, 0); -+ // 90 degrees rotation, no conversion -+ EXPECT_EQ(dst[0], src[2]); -+ EXPECT_EQ(dst[1], src[0]); -+ EXPECT_EQ(dst[2], src[3]); -+ EXPECT_EQ(dst[3], src[1]); -+} -+ -+#ifdef HAS_ARGBTOAR30ROW_AVX2 -+TEST_F(LibYUVConvertTest, ARGBToAR30Row_Opt) { -+ // ARGBToAR30Row_AVX2 expects a multiple of 8 pixels. -+ const int kPixels = (benchmark_width_ * benchmark_height_ + 7) & ~7; -+ align_buffer_page_end(src, kPixels * 4); -+ align_buffer_page_end(dst_opt, kPixels * 4); -+ align_buffer_page_end(dst_c, kPixels * 4); -+ MemRandomize(src, kPixels * 4); -+ memset(dst_opt, 0, kPixels * 4); -+ memset(dst_c, 1, kPixels * 4); -+ -+ ARGBToAR30Row_C(src, dst_c, kPixels); -+ -+ int has_avx2 = TestCpuFlag(kCpuHasAVX2); -+ int has_ssse3 = TestCpuFlag(kCpuHasSSSE3); -+ for (int i = 0; i < benchmark_iterations_; ++i) { -+ if (has_avx2) { -+ ARGBToAR30Row_AVX2(src, dst_opt, kPixels); -+ } else if (has_ssse3) { -+ ARGBToAR30Row_SSSE3(src, dst_opt, kPixels); -+ } else { -+ ARGBToAR30Row_C(src, dst_opt, kPixels); -+ } -+ } -+ for (int i = 0; i < kPixels * 4; ++i) { -+ EXPECT_EQ(dst_opt[i], dst_c[i]); -+ } -+ -+ free_aligned_buffer_page_end(src); -+ free_aligned_buffer_page_end(dst_opt); -+ free_aligned_buffer_page_end(dst_c); -+} -+#endif // HAS_ARGBTOAR30ROW_AVX2 -+ -+#ifdef HAS_ABGRTOAR30ROW_AVX2 -+TEST_F(LibYUVConvertTest, ABGRToAR30Row_Opt) { -+ // ABGRToAR30Row_AVX2 expects a multiple of 8 pixels. -+ const int kPixels = (benchmark_width_ * benchmark_height_ + 7) & ~7; -+ align_buffer_page_end(src, kPixels * 4); -+ align_buffer_page_end(dst_opt, kPixels * 4); -+ align_buffer_page_end(dst_c, kPixels * 4); -+ MemRandomize(src, kPixels * 4); -+ memset(dst_opt, 0, kPixels * 4); -+ memset(dst_c, 1, kPixels * 4); -+ -+ ABGRToAR30Row_C(src, dst_c, kPixels); -+ -+ int has_avx2 = TestCpuFlag(kCpuHasAVX2); -+ int has_ssse3 = TestCpuFlag(kCpuHasSSSE3); -+ for (int i = 0; i < benchmark_iterations_; ++i) { -+ if (has_avx2) { -+ ABGRToAR30Row_AVX2(src, dst_opt, kPixels); -+ } else if (has_ssse3) { -+ ABGRToAR30Row_SSSE3(src, dst_opt, kPixels); -+ } else { -+ ABGRToAR30Row_C(src, dst_opt, kPixels); -+ } -+ } -+ for (int i = 0; i < kPixels * 4; ++i) { -+ EXPECT_EQ(dst_opt[i], dst_c[i]); -+ } -+ -+ free_aligned_buffer_page_end(src); -+ free_aligned_buffer_page_end(dst_opt); -+ free_aligned_buffer_page_end(dst_c); -+} -+#endif // HAS_ABGRTOAR30ROW_AVX2 -+ -+// Provide matrix wrappers for 12 bit YUV -+#define I012ToARGB(a, b, c, d, e, f, g, h, i, j) \ -+ I012ToARGBMatrix(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j) -+#define I012ToAR30(a, b, c, d, e, f, g, h, i, j) \ -+ I012ToAR30Matrix(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j) -+ -+#define I410ToARGB(a, b, c, d, e, f, g, h, i, j) \ -+ I410ToARGBMatrix(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j) -+#define I410ToABGR(a, b, c, d, e, f, g, h, i, j) \ -+ I410ToABGRMatrix(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j) -+#define H410ToARGB(a, b, c, d, e, f, g, h, i, j) \ -+ I410ToARGBMatrix(a, b, c, d, e, f, g, h, &kYuvH709Constants, i, j) -+#define H410ToABGR(a, b, c, d, e, f, g, h, i, j) \ -+ I410ToABGRMatrix(a, b, c, d, e, f, g, h, &kYuvH709Constants, i, j) -+#define U410ToARGB(a, b, c, d, e, f, g, h, i, j) \ -+ I410ToARGBMatrix(a, b, c, d, e, f, g, h, &kYuv2020Constants, i, j) -+#define U410ToABGR(a, b, c, d, e, f, g, h, i, j) \ -+ I410ToABGRMatrix(a, b, c, d, e, f, g, h, &kYuv2020Constants, i, j) -+#define I410ToAR30(a, b, c, d, e, f, g, h, i, j) \ -+ I410ToAR30Matrix(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j) -+#define I410ToAB30(a, b, c, d, e, f, g, h, i, j) \ -+ I410ToAB30Matrix(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j) -+#define H410ToAR30(a, b, c, d, e, f, g, h, i, j) \ -+ I410ToAR30Matrix(a, b, c, d, e, f, g, h, &kYuvH709Constants, i, j) -+#define H410ToAB30(a, b, c, d, e, f, g, h, i, j) \ -+ I410ToAB30Matrix(a, b, c, d, e, f, g, h, &kYuvH709Constants, i, j) -+#define U410ToAR30(a, b, c, d, e, f, g, h, i, j) \ -+ I410ToAR30Matrix(a, b, c, d, e, f, g, h, &kYuv2020Constants, i, j) -+#define U410ToAB30(a, b, c, d, e, f, g, h, i, j) \ -+ I410ToAB30Matrix(a, b, c, d, e, f, g, h, &kYuv2020Constants, i, j) -+ -+#define I010ToARGBFilter(a, b, c, d, e, f, g, h, i, j) \ -+ I010ToARGBMatrixFilter(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j, \ -+ kFilterBilinear) -+#define I010ToAR30Filter(a, b, c, d, e, f, g, h, i, j) \ -+ I010ToAR30MatrixFilter(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j, \ -+ kFilterBilinear) -+#define I210ToARGBFilter(a, b, c, d, e, f, g, h, i, j) \ -+ I210ToARGBMatrixFilter(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j, \ -+ kFilterBilinear) -+#define I210ToAR30Filter(a, b, c, d, e, f, g, h, i, j) \ -+ I210ToAR30MatrixFilter(a, b, c, d, e, f, g, h, &kYuvI601Constants, i, j, \ -+ kFilterBilinear) -+ -+// TODO(fbarchard): Fix clamping issue affected by U channel. -+#define TESTPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_MASK, FMT_B, \ -+ BPP_B, ALIGN, YALIGN, W1280, N, NEG, SOFF, DOFF) \ -+ TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##N) { \ -+ const int kWidth = W1280; \ -+ const int kHeight = ALIGNINT(benchmark_height_, YALIGN); \ -+ const int kStrideB = ALIGNINT(kWidth * BPP_B, ALIGN); \ -+ const int kStrideUV = SUBSAMPLE(kWidth, SUBSAMP_X); \ -+ const int kSizeUV = kStrideUV * SUBSAMPLE(kHeight, SUBSAMP_Y); \ -+ const int kBpc = 2; \ -+ align_buffer_page_end(src_y, kWidth* kHeight* kBpc + SOFF); \ -+ align_buffer_page_end(src_u, kSizeUV* kBpc + SOFF); \ -+ align_buffer_page_end(src_v, kSizeUV* kBpc + SOFF); \ -+ align_buffer_page_end(dst_argb_c, kStrideB* kHeight + DOFF); \ -+ align_buffer_page_end(dst_argb_opt, kStrideB* kHeight + DOFF); \ -+ for (int i = 0; i < kWidth * kHeight; ++i) { \ -+ reinterpret_cast(src_y + SOFF)[i] = (fastrand() & FMT_MASK); \ -+ } \ -+ for (int i = 0; i < kSizeUV; ++i) { \ -+ reinterpret_cast(src_u + SOFF)[i] = (fastrand() & FMT_MASK); \ -+ reinterpret_cast(src_v + SOFF)[i] = (fastrand() & FMT_MASK); \ -+ } \ -+ memset(dst_argb_c + DOFF, 1, kStrideB * kHeight); \ -+ memset(dst_argb_opt + DOFF, 101, kStrideB * kHeight); \ -+ MaskCpuFlags(disable_cpu_flags_); \ -+ FMT_PLANAR##To##FMT_B( \ -+ reinterpret_cast(src_y + SOFF), kWidth, \ -+ reinterpret_cast(src_u + SOFF), kStrideUV, \ -+ reinterpret_cast(src_v + SOFF), kStrideUV, \ -+ dst_argb_c + DOFF, kStrideB, kWidth, NEG kHeight); \ -+ MaskCpuFlags(benchmark_cpu_info_); \ -+ for (int i = 0; i < benchmark_iterations_; ++i) { \ -+ FMT_PLANAR##To##FMT_B( \ -+ reinterpret_cast(src_y + SOFF), kWidth, \ -+ reinterpret_cast(src_u + SOFF), kStrideUV, \ -+ reinterpret_cast(src_v + SOFF), kStrideUV, \ -+ dst_argb_opt + DOFF, kStrideB, kWidth, NEG kHeight); \ -+ } \ -+ for (int i = 0; i < kWidth * BPP_B * kHeight; ++i) { \ -+ EXPECT_EQ(dst_argb_c[i + DOFF], dst_argb_opt[i + DOFF]); \ -+ } \ -+ free_aligned_buffer_page_end(src_y); \ -+ free_aligned_buffer_page_end(src_u); \ -+ free_aligned_buffer_page_end(src_v); \ -+ free_aligned_buffer_page_end(dst_argb_c); \ -+ free_aligned_buffer_page_end(dst_argb_opt); \ -+ } -+ -+#define TESTPLANAR16TOB(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_MASK, FMT_B, \ -+ BPP_B, ALIGN, YALIGN) \ -+ TESTPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_MASK, FMT_B, BPP_B, \ -+ ALIGN, YALIGN, benchmark_width_ + 1, _Any, +, 0, 0) \ -+ TESTPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_MASK, FMT_B, BPP_B, \ -+ ALIGN, YALIGN, benchmark_width_, _Unaligned, +, 4, 4) \ -+ TESTPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_MASK, FMT_B, BPP_B, \ -+ ALIGN, YALIGN, benchmark_width_, _Invert, -, 0, 0) \ -+ TESTPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_MASK, FMT_B, BPP_B, \ -+ ALIGN, YALIGN, benchmark_width_, _Opt, +, 0, 0) -+ -+// These conversions are only optimized for x86 -+#if !defined(DISABLE_SLOW_TESTS) || defined(__x86_64__) || defined(__i386__) -+TESTPLANAR16TOB(I010, 2, 2, 0x3ff, ARGB, 4, 4, 1) -+TESTPLANAR16TOB(I010, 2, 2, 0x3ff, ABGR, 4, 4, 1) -+TESTPLANAR16TOB(H010, 2, 2, 0x3ff, ARGB, 4, 4, 1) -+TESTPLANAR16TOB(H010, 2, 2, 0x3ff, ABGR, 4, 4, 1) -+TESTPLANAR16TOB(U010, 2, 2, 0x3ff, ARGB, 4, 4, 1) -+TESTPLANAR16TOB(U010, 2, 2, 0x3ff, ABGR, 4, 4, 1) -+TESTPLANAR16TOB(I210, 2, 1, 0x3ff, ARGB, 4, 4, 1) -+TESTPLANAR16TOB(I210, 2, 1, 0x3ff, ABGR, 4, 4, 1) -+TESTPLANAR16TOB(H210, 2, 1, 0x3ff, ARGB, 4, 4, 1) -+TESTPLANAR16TOB(H210, 2, 1, 0x3ff, ABGR, 4, 4, 1) -+TESTPLANAR16TOB(U210, 2, 1, 0x3ff, ARGB, 4, 4, 1) -+TESTPLANAR16TOB(U210, 2, 1, 0x3ff, ABGR, 4, 4, 1) -+TESTPLANAR16TOB(I410, 1, 1, 0x3ff, ARGB, 4, 4, 1) -+TESTPLANAR16TOB(I410, 1, 1, 0x3ff, ABGR, 4, 4, 1) -+TESTPLANAR16TOB(H410, 1, 1, 0x3ff, ARGB, 4, 4, 1) -+TESTPLANAR16TOB(H410, 1, 1, 0x3ff, ABGR, 4, 4, 1) -+TESTPLANAR16TOB(U410, 1, 1, 0x3ff, ARGB, 4, 4, 1) -+TESTPLANAR16TOB(U410, 1, 1, 0x3ff, ABGR, 4, 4, 1) -+TESTPLANAR16TOB(I012, 2, 2, 0xfff, ARGB, 4, 4, 1) -+TESTPLANAR16TOB(I010, 2, 2, 0x3ff, ARGBFilter, 4, 4, 1) -+TESTPLANAR16TOB(I210, 2, 1, 0x3ff, ARGBFilter, 4, 4, 1) -+ -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTPLANAR16TOB(I010, 2, 2, 0x3ff, AR30, 4, 4, 1) -+TESTPLANAR16TOB(I010, 2, 2, 0x3ff, AB30, 4, 4, 1) -+TESTPLANAR16TOB(H010, 2, 2, 0x3ff, AR30, 4, 4, 1) -+TESTPLANAR16TOB(H010, 2, 2, 0x3ff, AB30, 4, 4, 1) -+TESTPLANAR16TOB(U010, 2, 2, 0x3ff, AR30, 4, 4, 1) -+TESTPLANAR16TOB(U010, 2, 2, 0x3ff, AB30, 4, 4, 1) -+TESTPLANAR16TOB(I210, 2, 1, 0x3ff, AR30, 4, 4, 1) -+TESTPLANAR16TOB(I210, 2, 1, 0x3ff, AB30, 4, 4, 1) -+TESTPLANAR16TOB(H210, 2, 1, 0x3ff, AR30, 4, 4, 1) -+TESTPLANAR16TOB(H210, 2, 1, 0x3ff, AB30, 4, 4, 1) -+TESTPLANAR16TOB(U210, 2, 1, 0x3ff, AR30, 4, 4, 1) -+TESTPLANAR16TOB(U210, 2, 1, 0x3ff, AB30, 4, 4, 1) -+TESTPLANAR16TOB(I410, 1, 1, 0x3ff, AR30, 4, 4, 1) -+TESTPLANAR16TOB(I410, 1, 1, 0x3ff, AB30, 4, 4, 1) -+TESTPLANAR16TOB(H410, 1, 1, 0x3ff, AR30, 4, 4, 1) -+TESTPLANAR16TOB(H410, 1, 1, 0x3ff, AB30, 4, 4, 1) -+TESTPLANAR16TOB(U410, 1, 1, 0x3ff, AR30, 4, 4, 1) -+TESTPLANAR16TOB(U410, 1, 1, 0x3ff, AB30, 4, 4, 1) -+TESTPLANAR16TOB(I012, 2, 2, 0xfff, AR30, 4, 4, 1) -+TESTPLANAR16TOB(I010, 2, 2, 0x3ff, AR30Filter, 4, 4, 1) -+TESTPLANAR16TOB(I210, 2, 1, 0x3ff, AR30Filter, 4, 4, 1) -+#endif // LITTLE_ENDIAN_ONLY_TEST -+#endif // DISABLE_SLOW_TESTS -+ -+#define TESTQPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, \ -+ ALIGN, YALIGN, W1280, N, NEG, OFF, ATTEN, S_DEPTH) \ -+ TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##N) { \ -+ const int kWidth = W1280; \ -+ const int kHeight = ALIGNINT(benchmark_height_, YALIGN); \ -+ const int kStrideB = ALIGNINT(kWidth * BPP_B, ALIGN); \ -+ const int kStrideUV = SUBSAMPLE(kWidth, SUBSAMP_X); \ -+ const int kSizeUV = kStrideUV * SUBSAMPLE(kHeight, SUBSAMP_Y); \ -+ const int kBpc = 2; \ -+ align_buffer_page_end(src_y, kWidth* kHeight* kBpc + OFF); \ -+ align_buffer_page_end(src_u, kSizeUV* kBpc + OFF); \ -+ align_buffer_page_end(src_v, kSizeUV* kBpc + OFF); \ -+ align_buffer_page_end(src_a, kWidth* kHeight* kBpc + OFF); \ -+ align_buffer_page_end(dst_argb_c, kStrideB* kHeight + OFF); \ -+ align_buffer_page_end(dst_argb_opt, kStrideB* kHeight + OFF); \ -+ for (int i = 0; i < kWidth * kHeight; ++i) { \ -+ reinterpret_cast(src_y + OFF)[i] = \ -+ (fastrand() & ((1 << S_DEPTH) - 1)); \ -+ reinterpret_cast(src_a + OFF)[i] = \ -+ (fastrand() & ((1 << S_DEPTH) - 1)); \ -+ } \ -+ for (int i = 0; i < kSizeUV; ++i) { \ -+ reinterpret_cast(src_u + OFF)[i] = \ -+ (fastrand() & ((1 << S_DEPTH) - 1)); \ -+ reinterpret_cast(src_v + OFF)[i] = \ -+ (fastrand() & ((1 << S_DEPTH) - 1)); \ -+ } \ -+ memset(dst_argb_c + OFF, 1, kStrideB * kHeight); \ -+ memset(dst_argb_opt + OFF, 101, kStrideB * kHeight); \ -+ MaskCpuFlags(disable_cpu_flags_); \ -+ FMT_PLANAR##To##FMT_B(reinterpret_cast(src_y + OFF), kWidth, \ -+ reinterpret_cast(src_u + OFF), kStrideUV, \ -+ reinterpret_cast(src_v + OFF), kStrideUV, \ -+ reinterpret_cast(src_a + OFF), kWidth, \ -+ dst_argb_c + OFF, kStrideB, kWidth, NEG kHeight, \ -+ ATTEN); \ -+ MaskCpuFlags(benchmark_cpu_info_); \ -+ for (int i = 0; i < benchmark_iterations_; ++i) { \ -+ FMT_PLANAR##To##FMT_B( \ -+ reinterpret_cast(src_y + OFF), kWidth, \ -+ reinterpret_cast(src_u + OFF), kStrideUV, \ -+ reinterpret_cast(src_v + OFF), kStrideUV, \ -+ reinterpret_cast(src_a + OFF), kWidth, \ -+ dst_argb_opt + OFF, kStrideB, kWidth, NEG kHeight, ATTEN); \ -+ } \ -+ for (int i = 0; i < kWidth * BPP_B * kHeight; ++i) { \ -+ EXPECT_EQ(dst_argb_c[i + OFF], dst_argb_opt[i + OFF]); \ -+ } \ -+ free_aligned_buffer_page_end(src_y); \ -+ free_aligned_buffer_page_end(src_u); \ -+ free_aligned_buffer_page_end(src_v); \ -+ free_aligned_buffer_page_end(src_a); \ -+ free_aligned_buffer_page_end(dst_argb_c); \ -+ free_aligned_buffer_page_end(dst_argb_opt); \ -+ } -+ -+#if defined(ENABLE_FULL_TESTS) -+#define TESTQPLANAR16TOB(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, \ -+ ALIGN, YALIGN, S_DEPTH) \ -+ TESTQPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_ + 1, _Any, +, 0, 0, S_DEPTH) \ -+ TESTQPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_, _Unaligned, +, 2, 0, S_DEPTH) \ -+ TESTQPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_, _Invert, -, 0, 0, S_DEPTH) \ -+ TESTQPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_, _Opt, +, 0, 0, S_DEPTH) \ -+ TESTQPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_, _Premult, +, 0, 1, S_DEPTH) -+#else -+#define TESTQPLANAR16TOB(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, \ -+ ALIGN, YALIGN, S_DEPTH) \ -+ TESTQPLANAR16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, benchmark_width_, _Opt, +, 0, 0, S_DEPTH) -+#endif -+ -+#define I010AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I010AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvI601Constants, k, \ -+ l, m) -+#define I010AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I010AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvI601Constants, k, \ -+ l, m) -+#define J010AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I010AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ -+ l, m) -+#define J010AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I010AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ -+ l, m) -+#define F010AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I010AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ -+ l, m) -+#define F010AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I010AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ -+ l, m) -+#define H010AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I010AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ -+ l, m) -+#define H010AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I010AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ -+ l, m) -+#define U010AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I010AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ -+ l, m) -+#define U010AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I010AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ -+ l, m) -+#define V010AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I010AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ -+ l, m) -+#define V010AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I010AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ -+ l, m) -+#define I210AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I210AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvI601Constants, k, \ -+ l, m) -+#define I210AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I210AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvI601Constants, k, \ -+ l, m) -+#define J210AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I210AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ -+ l, m) -+#define J210AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I210AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ -+ l, m) -+#define F210AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I210AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ -+ l, m) -+#define F210AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I210AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ -+ l, m) -+#define H210AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I210AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ -+ l, m) -+#define H210AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I210AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ -+ l, m) -+#define U210AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I210AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ -+ l, m) -+#define U210AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I210AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ -+ l, m) -+#define V210AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I210AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ -+ l, m) -+#define V210AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I210AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ -+ l, m) -+#define I410AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I410AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvI601Constants, k, \ -+ l, m) -+#define I410AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I410AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvI601Constants, k, \ -+ l, m) -+#define J410AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I410AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ -+ l, m) -+#define J410AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I410AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvJPEGConstants, k, \ -+ l, m) -+#define F410AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I410AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ -+ l, m) -+#define F410AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I410AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvF709Constants, k, \ -+ l, m) -+#define H410AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I410AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ -+ l, m) -+#define H410AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I410AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvH709Constants, k, \ -+ l, m) -+#define U410AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I410AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ -+ l, m) -+#define U410AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I410AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuv2020Constants, k, \ -+ l, m) -+#define V410AlphaToARGB(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I410AlphaToARGBMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ -+ l, m) -+#define V410AlphaToABGR(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I410AlphaToABGRMatrix(a, b, c, d, e, f, g, h, i, j, &kYuvV2020Constants, k, \ -+ l, m) -+#define I010AlphaToARGBFilter(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I010AlphaToARGBMatrixFilter(a, b, c, d, e, f, g, h, i, j, \ -+ &kYuvI601Constants, k, l, m, kFilterBilinear) -+#define I210AlphaToARGBFilter(a, b, c, d, e, f, g, h, i, j, k, l, m) \ -+ I010AlphaToARGBMatrixFilter(a, b, c, d, e, f, g, h, i, j, \ -+ &kYuvI601Constants, k, l, m, kFilterBilinear) -+ -+// These conversions are only optimized for x86 -+#if !defined(DISABLE_SLOW_TESTS) || defined(__x86_64__) || defined(__i386__) -+TESTQPLANAR16TOB(I010Alpha, 2, 2, ARGB, 4, 4, 1, 10) -+TESTQPLANAR16TOB(I010Alpha, 2, 2, ABGR, 4, 4, 1, 10) -+TESTQPLANAR16TOB(J010Alpha, 2, 2, ARGB, 4, 4, 1, 10) -+TESTQPLANAR16TOB(J010Alpha, 2, 2, ABGR, 4, 4, 1, 10) -+TESTQPLANAR16TOB(H010Alpha, 2, 2, ARGB, 4, 4, 1, 10) -+TESTQPLANAR16TOB(H010Alpha, 2, 2, ABGR, 4, 4, 1, 10) -+TESTQPLANAR16TOB(F010Alpha, 2, 2, ARGB, 4, 4, 1, 10) -+TESTQPLANAR16TOB(F010Alpha, 2, 2, ABGR, 4, 4, 1, 10) -+TESTQPLANAR16TOB(U010Alpha, 2, 2, ARGB, 4, 4, 1, 10) -+TESTQPLANAR16TOB(U010Alpha, 2, 2, ABGR, 4, 4, 1, 10) -+TESTQPLANAR16TOB(V010Alpha, 2, 2, ARGB, 4, 4, 1, 10) -+TESTQPLANAR16TOB(V010Alpha, 2, 2, ABGR, 4, 4, 1, 10) -+TESTQPLANAR16TOB(I210Alpha, 2, 1, ARGB, 4, 4, 1, 10) -+TESTQPLANAR16TOB(I210Alpha, 2, 1, ABGR, 4, 4, 1, 10) -+TESTQPLANAR16TOB(J210Alpha, 2, 1, ARGB, 4, 4, 1, 10) -+TESTQPLANAR16TOB(J210Alpha, 2, 1, ABGR, 4, 4, 1, 10) -+TESTQPLANAR16TOB(H210Alpha, 2, 1, ARGB, 4, 4, 1, 10) -+TESTQPLANAR16TOB(H210Alpha, 2, 1, ABGR, 4, 4, 1, 10) -+TESTQPLANAR16TOB(F210Alpha, 2, 1, ARGB, 4, 4, 1, 10) -+TESTQPLANAR16TOB(F210Alpha, 2, 1, ABGR, 4, 4, 1, 10) -+TESTQPLANAR16TOB(U210Alpha, 2, 1, ARGB, 4, 4, 1, 10) -+TESTQPLANAR16TOB(U210Alpha, 2, 1, ABGR, 4, 4, 1, 10) -+TESTQPLANAR16TOB(V210Alpha, 2, 1, ARGB, 4, 4, 1, 10) -+TESTQPLANAR16TOB(V210Alpha, 2, 1, ABGR, 4, 4, 1, 10) -+TESTQPLANAR16TOB(I410Alpha, 1, 1, ARGB, 4, 4, 1, 10) -+TESTQPLANAR16TOB(I410Alpha, 1, 1, ABGR, 4, 4, 1, 10) -+TESTQPLANAR16TOB(J410Alpha, 1, 1, ARGB, 4, 4, 1, 10) -+TESTQPLANAR16TOB(J410Alpha, 1, 1, ABGR, 4, 4, 1, 10) -+TESTQPLANAR16TOB(H410Alpha, 1, 1, ARGB, 4, 4, 1, 10) -+TESTQPLANAR16TOB(H410Alpha, 1, 1, ABGR, 4, 4, 1, 10) -+TESTQPLANAR16TOB(F410Alpha, 1, 1, ARGB, 4, 4, 1, 10) -+TESTQPLANAR16TOB(F410Alpha, 1, 1, ABGR, 4, 4, 1, 10) -+TESTQPLANAR16TOB(U410Alpha, 1, 1, ARGB, 4, 4, 1, 10) -+TESTQPLANAR16TOB(U410Alpha, 1, 1, ABGR, 4, 4, 1, 10) -+TESTQPLANAR16TOB(V410Alpha, 1, 1, ARGB, 4, 4, 1, 10) -+TESTQPLANAR16TOB(V410Alpha, 1, 1, ABGR, 4, 4, 1, 10) -+TESTQPLANAR16TOB(I010Alpha, 2, 2, ARGBFilter, 4, 4, 1, 10) -+TESTQPLANAR16TOB(I210Alpha, 2, 1, ARGBFilter, 4, 4, 1, 10) -+#endif // DISABLE_SLOW_TESTS -+ -+#define TESTBP16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, W1280, N, NEG, SOFF, DOFF, S_DEPTH) \ -+ TEST_F(LibYUVConvertTest, FMT_PLANAR##To##FMT_B##N) { \ -+ const int kWidth = W1280; \ -+ const int kHeight = ALIGNINT(benchmark_height_, YALIGN); \ -+ const int kStrideB = ALIGNINT(kWidth * BPP_B, ALIGN); \ -+ const int kStrideUV = SUBSAMPLE(kWidth, SUBSAMP_X) * 2; \ -+ const int kSizeUV = kStrideUV * SUBSAMPLE(kHeight, SUBSAMP_Y) * 2; \ -+ const int kBpc = 2; \ -+ align_buffer_page_end(src_y, kWidth* kHeight* kBpc + SOFF); \ -+ align_buffer_page_end(src_uv, kSizeUV* kBpc + SOFF); \ -+ align_buffer_page_end(dst_argb_c, kStrideB* kHeight + DOFF); \ -+ align_buffer_page_end(dst_argb_opt, kStrideB* kHeight + DOFF); \ -+ for (int i = 0; i < kWidth * kHeight; ++i) { \ -+ reinterpret_cast(src_y + SOFF)[i] = \ -+ (fastrand() & (((uint16_t)(-1)) << (16 - S_DEPTH))); \ -+ } \ -+ for (int i = 0; i < kSizeUV; ++i) { \ -+ reinterpret_cast(src_uv + SOFF)[i] = \ -+ (fastrand() & (((uint16_t)(-1)) << (16 - S_DEPTH))); \ -+ } \ -+ memset(dst_argb_c + DOFF, 1, kStrideB * kHeight); \ -+ memset(dst_argb_opt + DOFF, 101, kStrideB * kHeight); \ -+ MaskCpuFlags(disable_cpu_flags_); \ -+ FMT_PLANAR##To##FMT_B(reinterpret_cast(src_y + SOFF), kWidth, \ -+ reinterpret_cast(src_uv + SOFF), \ -+ kStrideUV, dst_argb_c + DOFF, kStrideB, kWidth, \ -+ NEG kHeight); \ -+ MaskCpuFlags(benchmark_cpu_info_); \ -+ for (int i = 0; i < benchmark_iterations_; ++i) { \ -+ FMT_PLANAR##To##FMT_B(reinterpret_cast(src_y + SOFF), kWidth, \ -+ reinterpret_cast(src_uv + SOFF), \ -+ kStrideUV, dst_argb_opt + DOFF, kStrideB, kWidth, \ -+ NEG kHeight); \ -+ } \ -+ for (int i = 0; i < kWidth * BPP_B * kHeight; ++i) { \ -+ EXPECT_EQ(dst_argb_c[i + DOFF], dst_argb_opt[i + DOFF]); \ -+ } \ -+ free_aligned_buffer_page_end(src_y); \ -+ free_aligned_buffer_page_end(src_uv); \ -+ free_aligned_buffer_page_end(dst_argb_c); \ -+ free_aligned_buffer_page_end(dst_argb_opt); \ -+ } -+ -+#define TESTBP16TOB(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, \ -+ YALIGN, S_DEPTH) \ -+ TESTBP16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, YALIGN, \ -+ benchmark_width_ + 1, _Any, +, 0, 0, S_DEPTH) \ -+ TESTBP16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, YALIGN, \ -+ benchmark_width_, _Unaligned, +, 4, 4, S_DEPTH) \ -+ TESTBP16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, YALIGN, \ -+ benchmark_width_, _Invert, -, 0, 0, S_DEPTH) \ -+ TESTBP16TOBI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, BPP_B, ALIGN, YALIGN, \ -+ benchmark_width_, _Opt, +, 0, 0, S_DEPTH) -+ -+#define P010ToARGB(a, b, c, d, e, f, g, h) \ -+ P010ToARGBMatrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) -+#define P210ToARGB(a, b, c, d, e, f, g, h) \ -+ P210ToARGBMatrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) -+#define P010ToAR30(a, b, c, d, e, f, g, h) \ -+ P010ToAR30Matrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) -+#define P210ToAR30(a, b, c, d, e, f, g, h) \ -+ P210ToAR30Matrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) -+ -+#define P012ToARGB(a, b, c, d, e, f, g, h) \ -+ P012ToARGBMatrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) -+#define P212ToARGB(a, b, c, d, e, f, g, h) \ -+ P212ToARGBMatrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) -+#define P012ToAR30(a, b, c, d, e, f, g, h) \ -+ P012ToAR30Matrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) -+#define P212ToAR30(a, b, c, d, e, f, g, h) \ -+ P212ToAR30Matrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) -+ -+#define P016ToARGB(a, b, c, d, e, f, g, h) \ -+ P016ToARGBMatrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) -+#define P216ToARGB(a, b, c, d, e, f, g, h) \ -+ P216ToARGBMatrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) -+#define P016ToAR30(a, b, c, d, e, f, g, h) \ -+ P016ToAR30Matrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) -+#define P216ToAR30(a, b, c, d, e, f, g, h) \ -+ P216ToAR30Matrix(a, b, c, d, e, f, &kYuvH709Constants, g, h) -+ -+#define P010ToARGBFilter(a, b, c, d, e, f, g, h) \ -+ P010ToARGBMatrixFilter(a, b, c, d, e, f, &kYuvH709Constants, g, h, \ -+ kFilterBilinear) -+#define P210ToARGBFilter(a, b, c, d, e, f, g, h) \ -+ P210ToARGBMatrixFilter(a, b, c, d, e, f, &kYuvH709Constants, g, h, \ -+ kFilterBilinear) -+#define P010ToAR30Filter(a, b, c, d, e, f, g, h) \ -+ P010ToAR30MatrixFilter(a, b, c, d, e, f, &kYuvH709Constants, g, h, \ -+ kFilterBilinear) -+#define P210ToAR30Filter(a, b, c, d, e, f, g, h) \ -+ P210ToAR30MatrixFilter(a, b, c, d, e, f, &kYuvH709Constants, g, h, \ -+ kFilterBilinear) -+ -+#if !defined(DISABLE_SLOW_TESTS) || defined(__x86_64__) || defined(__i386__) -+TESTBP16TOB(P010, 2, 2, ARGB, 4, 4, 1, 10) -+TESTBP16TOB(P210, 2, 1, ARGB, 4, 4, 1, 10) -+TESTBP16TOB(P012, 2, 2, ARGB, 4, 4, 1, 12) -+TESTBP16TOB(P212, 2, 1, ARGB, 4, 4, 1, 12) -+TESTBP16TOB(P016, 2, 2, ARGB, 4, 4, 1, 16) -+TESTBP16TOB(P216, 2, 1, ARGB, 4, 4, 1, 16) -+TESTBP16TOB(P010, 2, 2, ARGBFilter, 4, 4, 1, 10) -+TESTBP16TOB(P210, 2, 1, ARGBFilter, 4, 4, 1, 10) -+#ifdef LITTLE_ENDIAN_ONLY_TEST -+TESTBP16TOB(P010, 2, 2, AR30, 4, 4, 1, 10) -+TESTBP16TOB(P210, 2, 1, AR30, 4, 4, 1, 10) -+TESTBP16TOB(P012, 2, 2, AR30, 4, 4, 1, 12) -+TESTBP16TOB(P212, 2, 1, AR30, 4, 4, 1, 12) -+TESTBP16TOB(P016, 2, 2, AR30, 4, 4, 1, 16) -+TESTBP16TOB(P216, 2, 1, AR30, 4, 4, 1, 16) -+TESTBP16TOB(P010, 2, 2, AR30Filter, 4, 4, 1, 10) -+TESTBP16TOB(P210, 2, 1, AR30Filter, 4, 4, 1, 10) -+#endif // LITTLE_ENDIAN_ONLY_TEST -+#endif // DISABLE_SLOW_TESTS -+ -+static int Clamp(int y) { -+ if (y < 0) { -+ y = 0; -+ } -+ if (y > 255) { -+ y = 255; -+ } -+ return y; -+} -+ -+static int Clamp10(int y) { -+ if (y < 0) { -+ y = 0; -+ } -+ if (y > 1023) { -+ y = 1023; -+ } -+ return y; -+} -+ -+// Test 8 bit YUV to 8 bit RGB -+TEST_F(LibYUVConvertTest, TestH420ToARGB) { -+ const int kSize = 256; -+ int histogram_b[256]; -+ int histogram_g[256]; -+ int histogram_r[256]; -+ memset(histogram_b, 0, sizeof(histogram_b)); -+ memset(histogram_g, 0, sizeof(histogram_g)); -+ memset(histogram_r, 0, sizeof(histogram_r)); -+ align_buffer_page_end(orig_yuv, kSize + kSize / 2 * 2); -+ align_buffer_page_end(argb_pixels, kSize * 4); -+ uint8_t* orig_y = orig_yuv; -+ uint8_t* orig_u = orig_y + kSize; -+ uint8_t* orig_v = orig_u + kSize / 2; -+ -+ // Test grey scale -+ for (int i = 0; i < kSize; ++i) { -+ orig_y[i] = i; -+ } -+ for (int i = 0; i < kSize / 2; ++i) { -+ orig_u[i] = 128; // 128 is 0. -+ orig_v[i] = 128; -+ } -+ -+ H420ToARGB(orig_y, 0, orig_u, 0, orig_v, 0, argb_pixels, 0, kSize, 1); -+ -+ for (int i = 0; i < kSize; ++i) { -+ int b = argb_pixels[i * 4 + 0]; -+ int g = argb_pixels[i * 4 + 1]; -+ int r = argb_pixels[i * 4 + 2]; -+ int a = argb_pixels[i * 4 + 3]; -+ ++histogram_b[b]; -+ ++histogram_g[g]; -+ ++histogram_r[r]; -+ // Reference formula for Y channel contribution in YUV to RGB conversions: -+ int expected_y = Clamp(static_cast((i - 16) * 1.164f + 0.5f)); -+ EXPECT_EQ(b, expected_y); -+ EXPECT_EQ(g, expected_y); -+ EXPECT_EQ(r, expected_y); -+ EXPECT_EQ(a, 255); -+ } -+ -+ int count_b = 0; -+ int count_g = 0; -+ int count_r = 0; -+ for (int i = 0; i < kSize; ++i) { -+ if (histogram_b[i]) { -+ ++count_b; -+ } -+ if (histogram_g[i]) { -+ ++count_g; -+ } -+ if (histogram_r[i]) { -+ ++count_r; -+ } -+ } -+ printf("uniques: B %d, G, %d, R %d\n", count_b, count_g, count_r); -+ -+ free_aligned_buffer_page_end(orig_yuv); -+ free_aligned_buffer_page_end(argb_pixels); -+} -+ -+// Test 10 bit YUV to 8 bit RGB -+TEST_F(LibYUVConvertTest, TestH010ToARGB) { -+ const int kSize = 1024; -+ int histogram_b[1024]; -+ int histogram_g[1024]; -+ int histogram_r[1024]; -+ memset(histogram_b, 0, sizeof(histogram_b)); -+ memset(histogram_g, 0, sizeof(histogram_g)); -+ memset(histogram_r, 0, sizeof(histogram_r)); -+ align_buffer_page_end(orig_yuv, kSize * 2 + kSize / 2 * 2 * 2); -+ align_buffer_page_end(argb_pixels, kSize * 4); -+ uint16_t* orig_y = reinterpret_cast(orig_yuv); -+ uint16_t* orig_u = orig_y + kSize; -+ uint16_t* orig_v = orig_u + kSize / 2; -+ -+ // Test grey scale -+ for (int i = 0; i < kSize; ++i) { -+ orig_y[i] = i; -+ } -+ for (int i = 0; i < kSize / 2; ++i) { -+ orig_u[i] = 512; // 512 is 0. -+ orig_v[i] = 512; -+ } -+ -+ H010ToARGB(orig_y, 0, orig_u, 0, orig_v, 0, argb_pixels, 0, kSize, 1); -+ -+ for (int i = 0; i < kSize; ++i) { -+ int b = argb_pixels[i * 4 + 0]; -+ int g = argb_pixels[i * 4 + 1]; -+ int r = argb_pixels[i * 4 + 2]; -+ int a = argb_pixels[i * 4 + 3]; -+ ++histogram_b[b]; -+ ++histogram_g[g]; -+ ++histogram_r[r]; -+ int expected_y = Clamp(static_cast((i - 64) * 1.164f / 4)); -+ EXPECT_NEAR(b, expected_y, 1); -+ EXPECT_NEAR(g, expected_y, 1); -+ EXPECT_NEAR(r, expected_y, 1); -+ EXPECT_EQ(a, 255); -+ } -+ -+ int count_b = 0; -+ int count_g = 0; -+ int count_r = 0; -+ for (int i = 0; i < kSize; ++i) { -+ if (histogram_b[i]) { -+ ++count_b; -+ } -+ if (histogram_g[i]) { -+ ++count_g; -+ } -+ if (histogram_r[i]) { -+ ++count_r; -+ } -+ } -+ printf("uniques: B %d, G, %d, R %d\n", count_b, count_g, count_r); -+ -+ free_aligned_buffer_page_end(orig_yuv); -+ free_aligned_buffer_page_end(argb_pixels); -+} -+ -+// Test 10 bit YUV to 10 bit RGB -+// Caveat: Result is near due to float rounding in expected -+// result. -+TEST_F(LibYUVConvertTest, TestH010ToAR30) { -+ const int kSize = 1024; -+ int histogram_b[1024]; -+ int histogram_g[1024]; -+ int histogram_r[1024]; -+ memset(histogram_b, 0, sizeof(histogram_b)); -+ memset(histogram_g, 0, sizeof(histogram_g)); -+ memset(histogram_r, 0, sizeof(histogram_r)); -+ -+ align_buffer_page_end(orig_yuv, kSize * 2 + kSize / 2 * 2 * 2); -+ align_buffer_page_end(ar30_pixels, kSize * 4); -+ uint16_t* orig_y = reinterpret_cast(orig_yuv); -+ uint16_t* orig_u = orig_y + kSize; -+ uint16_t* orig_v = orig_u + kSize / 2; -+ -+ // Test grey scale -+ for (int i = 0; i < kSize; ++i) { -+ orig_y[i] = i; -+ } -+ for (int i = 0; i < kSize / 2; ++i) { -+ orig_u[i] = 512; // 512 is 0. -+ orig_v[i] = 512; -+ } -+ -+ H010ToAR30(orig_y, 0, orig_u, 0, orig_v, 0, ar30_pixels, 0, kSize, 1); -+ -+ for (int i = 0; i < kSize; ++i) { -+ int b10 = reinterpret_cast(ar30_pixels)[i] & 1023; -+ int g10 = (reinterpret_cast(ar30_pixels)[i] >> 10) & 1023; -+ int r10 = (reinterpret_cast(ar30_pixels)[i] >> 20) & 1023; -+ int a2 = (reinterpret_cast(ar30_pixels)[i] >> 30) & 3; -+ ++histogram_b[b10]; -+ ++histogram_g[g10]; -+ ++histogram_r[r10]; -+ int expected_y = Clamp10(static_cast((i - 64) * 1.164f + 0.5)); -+ EXPECT_NEAR(b10, expected_y, 4); -+ EXPECT_NEAR(g10, expected_y, 4); -+ EXPECT_NEAR(r10, expected_y, 4); -+ EXPECT_EQ(a2, 3); -+ } -+ -+ int count_b = 0; -+ int count_g = 0; -+ int count_r = 0; -+ for (int i = 0; i < kSize; ++i) { -+ if (histogram_b[i]) { -+ ++count_b; -+ } -+ if (histogram_g[i]) { -+ ++count_g; -+ } -+ if (histogram_r[i]) { -+ ++count_r; -+ } -+ } -+ printf("uniques: B %d, G, %d, R %d\n", count_b, count_g, count_r); -+ -+ free_aligned_buffer_page_end(orig_yuv); -+ free_aligned_buffer_page_end(ar30_pixels); -+} -+ -+// Test 10 bit YUV to 10 bit RGB -+// Caveat: Result is near due to float rounding in expected -+// result. -+TEST_F(LibYUVConvertTest, TestH010ToAB30) { -+ const int kSize = 1024; -+ int histogram_b[1024]; -+ int histogram_g[1024]; -+ int histogram_r[1024]; -+ memset(histogram_b, 0, sizeof(histogram_b)); -+ memset(histogram_g, 0, sizeof(histogram_g)); -+ memset(histogram_r, 0, sizeof(histogram_r)); -+ -+ align_buffer_page_end(orig_yuv, kSize * 2 + kSize / 2 * 2 * 2); -+ align_buffer_page_end(ab30_pixels, kSize * 4); -+ uint16_t* orig_y = reinterpret_cast(orig_yuv); -+ uint16_t* orig_u = orig_y + kSize; -+ uint16_t* orig_v = orig_u + kSize / 2; -+ -+ // Test grey scale -+ for (int i = 0; i < kSize; ++i) { -+ orig_y[i] = i; -+ } -+ for (int i = 0; i < kSize / 2; ++i) { -+ orig_u[i] = 512; // 512 is 0. -+ orig_v[i] = 512; -+ } -+ -+ H010ToAB30(orig_y, 0, orig_u, 0, orig_v, 0, ab30_pixels, 0, kSize, 1); -+ -+ for (int i = 0; i < kSize; ++i) { -+ int r10 = reinterpret_cast(ab30_pixels)[i] & 1023; -+ int g10 = (reinterpret_cast(ab30_pixels)[i] >> 10) & 1023; -+ int b10 = (reinterpret_cast(ab30_pixels)[i] >> 20) & 1023; -+ int a2 = (reinterpret_cast(ab30_pixels)[i] >> 30) & 3; -+ ++histogram_b[b10]; -+ ++histogram_g[g10]; -+ ++histogram_r[r10]; -+ int expected_y = Clamp10(static_cast((i - 64) * 1.164f)); -+ EXPECT_NEAR(b10, expected_y, 4); -+ EXPECT_NEAR(g10, expected_y, 4); -+ EXPECT_NEAR(r10, expected_y, 4); -+ EXPECT_EQ(a2, 3); -+ } -+ -+ int count_b = 0; -+ int count_g = 0; -+ int count_r = 0; -+ for (int i = 0; i < kSize; ++i) { -+ if (histogram_b[i]) { -+ ++count_b; -+ } -+ if (histogram_g[i]) { -+ ++count_g; -+ } -+ if (histogram_r[i]) { -+ ++count_r; -+ } -+ } -+ printf("uniques: B %d, G, %d, R %d\n", count_b, count_g, count_r); -+ -+ free_aligned_buffer_page_end(orig_yuv); -+ free_aligned_buffer_page_end(ab30_pixels); -+} -+ -+// Test 8 bit YUV to 10 bit RGB -+TEST_F(LibYUVConvertTest, TestH420ToAR30) { -+ const int kSize = 256; -+ const int kHistSize = 1024; -+ int histogram_b[kHistSize]; -+ int histogram_g[kHistSize]; -+ int histogram_r[kHistSize]; -+ memset(histogram_b, 0, sizeof(histogram_b)); -+ memset(histogram_g, 0, sizeof(histogram_g)); -+ memset(histogram_r, 0, sizeof(histogram_r)); -+ align_buffer_page_end(orig_yuv, kSize + kSize / 2 * 2); -+ align_buffer_page_end(ar30_pixels, kSize * 4); -+ uint8_t* orig_y = orig_yuv; -+ uint8_t* orig_u = orig_y + kSize; -+ uint8_t* orig_v = orig_u + kSize / 2; -+ -+ // Test grey scale -+ for (int i = 0; i < kSize; ++i) { -+ orig_y[i] = i; -+ } -+ for (int i = 0; i < kSize / 2; ++i) { -+ orig_u[i] = 128; // 128 is 0. -+ orig_v[i] = 128; -+ } -+ -+ H420ToAR30(orig_y, 0, orig_u, 0, orig_v, 0, ar30_pixels, 0, kSize, 1); -+ -+ for (int i = 0; i < kSize; ++i) { -+ int b10 = reinterpret_cast(ar30_pixels)[i] & 1023; -+ int g10 = (reinterpret_cast(ar30_pixels)[i] >> 10) & 1023; -+ int r10 = (reinterpret_cast(ar30_pixels)[i] >> 20) & 1023; -+ int a2 = (reinterpret_cast(ar30_pixels)[i] >> 30) & 3; -+ ++histogram_b[b10]; -+ ++histogram_g[g10]; -+ ++histogram_r[r10]; -+ int expected_y = Clamp10(static_cast((i - 16) * 1.164f * 4.f)); -+ EXPECT_NEAR(b10, expected_y, 4); -+ EXPECT_NEAR(g10, expected_y, 4); -+ EXPECT_NEAR(r10, expected_y, 4); -+ EXPECT_EQ(a2, 3); -+ } -+ -+ int count_b = 0; -+ int count_g = 0; -+ int count_r = 0; -+ for (int i = 0; i < kHistSize; ++i) { -+ if (histogram_b[i]) { -+ ++count_b; -+ } -+ if (histogram_g[i]) { -+ ++count_g; -+ } -+ if (histogram_r[i]) { -+ ++count_r; -+ } -+ } -+ printf("uniques: B %d, G, %d, R %d\n", count_b, count_g, count_r); -+ -+ free_aligned_buffer_page_end(orig_yuv); -+ free_aligned_buffer_page_end(ar30_pixels); -+} -+ -+// Test I400 with jpeg matrix is same as J400 -+TEST_F(LibYUVConvertTest, TestI400) { -+ const int kSize = 256; -+ align_buffer_page_end(orig_i400, kSize); -+ align_buffer_page_end(argb_pixels_i400, kSize * 4); -+ align_buffer_page_end(argb_pixels_j400, kSize * 4); -+ align_buffer_page_end(argb_pixels_jpeg_i400, kSize * 4); -+ align_buffer_page_end(argb_pixels_h709_i400, kSize * 4); -+ align_buffer_page_end(argb_pixels_2020_i400, kSize * 4); -+ -+ // Test grey scale -+ for (int i = 0; i < kSize; ++i) { -+ orig_i400[i] = i; -+ } -+ -+ J400ToARGB(orig_i400, 0, argb_pixels_j400, 0, kSize, 1); -+ I400ToARGB(orig_i400, 0, argb_pixels_i400, 0, kSize, 1); -+ I400ToARGBMatrix(orig_i400, 0, argb_pixels_jpeg_i400, 0, &kYuvJPEGConstants, -+ kSize, 1); -+ I400ToARGBMatrix(orig_i400, 0, argb_pixels_h709_i400, 0, &kYuvH709Constants, -+ kSize, 1); -+ I400ToARGBMatrix(orig_i400, 0, argb_pixels_2020_i400, 0, &kYuv2020Constants, -+ kSize, 1); -+ -+ EXPECT_EQ(0, argb_pixels_i400[0]); -+ EXPECT_EQ(0, argb_pixels_j400[0]); -+ EXPECT_EQ(0, argb_pixels_jpeg_i400[0]); -+ EXPECT_EQ(0, argb_pixels_h709_i400[0]); -+ EXPECT_EQ(0, argb_pixels_2020_i400[0]); -+ EXPECT_EQ(0, argb_pixels_i400[16 * 4]); -+ EXPECT_EQ(16, argb_pixels_j400[16 * 4]); -+ EXPECT_EQ(16, argb_pixels_jpeg_i400[16 * 4]); -+ EXPECT_EQ(0, argb_pixels_h709_i400[16 * 4]); -+ EXPECT_EQ(0, argb_pixels_2020_i400[16 * 4]); -+ EXPECT_EQ(130, argb_pixels_i400[128 * 4]); -+ EXPECT_EQ(128, argb_pixels_j400[128 * 4]); -+ EXPECT_EQ(128, argb_pixels_jpeg_i400[128 * 4]); -+ EXPECT_EQ(130, argb_pixels_h709_i400[128 * 4]); -+ EXPECT_EQ(130, argb_pixels_2020_i400[128 * 4]); -+ EXPECT_EQ(255, argb_pixels_i400[255 * 4]); -+ EXPECT_EQ(255, argb_pixels_j400[255 * 4]); -+ EXPECT_EQ(255, argb_pixels_jpeg_i400[255 * 4]); -+ EXPECT_EQ(255, argb_pixels_h709_i400[255 * 4]); -+ EXPECT_EQ(255, argb_pixels_2020_i400[255 * 4]); -+ -+ for (int i = 0; i < kSize * 4; ++i) { -+ if ((i & 3) == 3) { -+ EXPECT_EQ(255, argb_pixels_j400[i]); -+ } else { -+ EXPECT_EQ(i / 4, argb_pixels_j400[i]); -+ } -+ EXPECT_EQ(argb_pixels_jpeg_i400[i], argb_pixels_j400[i]); -+ } -+ -+ free_aligned_buffer_page_end(orig_i400); -+ free_aligned_buffer_page_end(argb_pixels_i400); -+ free_aligned_buffer_page_end(argb_pixels_j400); -+ free_aligned_buffer_page_end(argb_pixels_jpeg_i400); -+ free_aligned_buffer_page_end(argb_pixels_h709_i400); -+ free_aligned_buffer_page_end(argb_pixels_2020_i400); -+} -+ -+// Test RGB24 to ARGB and back to RGB24 -+TEST_F(LibYUVConvertTest, TestARGBToRGB24) { -+ const int kSize = 256; -+ align_buffer_page_end(orig_rgb24, kSize * 3); -+ align_buffer_page_end(argb_pixels, kSize * 4); -+ align_buffer_page_end(dest_rgb24, kSize * 3); -+ -+ // Test grey scale -+ for (int i = 0; i < kSize * 3; ++i) { -+ orig_rgb24[i] = i; -+ } -+ -+ RGB24ToARGB(orig_rgb24, 0, argb_pixels, 0, kSize, 1); -+ ARGBToRGB24(argb_pixels, 0, dest_rgb24, 0, kSize, 1); -+ -+ for (int i = 0; i < kSize * 3; ++i) { -+ EXPECT_EQ(orig_rgb24[i], dest_rgb24[i]); -+ } -+ -+ free_aligned_buffer_page_end(orig_rgb24); -+ free_aligned_buffer_page_end(argb_pixels); -+ free_aligned_buffer_page_end(dest_rgb24); -+} -+ -+TEST_F(LibYUVConvertTest, Test565) { -+ SIMD_ALIGNED(uint8_t orig_pixels[256][4]); -+ SIMD_ALIGNED(uint8_t pixels565[256][2]); -+ -+ for (int i = 0; i < 256; ++i) { -+ for (int j = 0; j < 4; ++j) { -+ orig_pixels[i][j] = i; -+ } -+ } -+ ARGBToRGB565(&orig_pixels[0][0], 0, &pixels565[0][0], 0, 256, 1); -+ uint32_t checksum = HashDjb2(&pixels565[0][0], sizeof(pixels565), 5381); -+ EXPECT_EQ(610919429u, checksum); -+} -+ - // Test RGB24 to J420 is exact - #if defined(LIBYUV_BIT_EXACT) - TEST_F(LibYUVConvertTest, TestRGB24ToJ420) { -@@ -2105,6 +4527,4 @@ TEST_F(LibYUVConvertTest, TestRGB24ToI42 - } - #endif - --#endif // !defined(LEAN_TESTS) -- - } // namespace libyuv -diff --git a/media/libyuv/libyuv/unit_test/cpu_test.cc b/media/libyuv/libyuv/unit_test/cpu_test.cc ---- a/media/libyuv/libyuv/unit_test/cpu_test.cc -+++ b/media/libyuv/libyuv/unit_test/cpu_test.cc -@@ -20,23 +20,13 @@ namespace libyuv { - - TEST_F(LibYUVBaseTest, TestCpuHas) { - int cpu_flags = TestCpuFlag(-1); -- printf("Cpu Flags 0x%x\n", cpu_flags); -+ printf("Cpu Flags %d\n", cpu_flags); - #if defined(__arm__) || defined(__aarch64__) - int has_arm = TestCpuFlag(kCpuHasARM); -- printf("Has ARM 0x%x\n", has_arm); -+ printf("Has ARM %d\n", has_arm); - int has_neon = TestCpuFlag(kCpuHasNEON); -- printf("Has NEON 0x%x\n", has_neon); -+ printf("Has NEON %d\n", has_neon); - #endif --#if defined(__riscv) && defined(__linux__) -- int has_riscv = TestCpuFlag(kCpuHasRISCV); -- printf("Has RISCV 0x%x\n", has_riscv); -- int has_rvv = TestCpuFlag(kCpuHasRVV); -- printf("Has RVV 0x%x\n", has_rvv); -- int has_rvvzvfh = TestCpuFlag(kCpuHasRVVZVFH); -- printf("Has RVVZVFH 0x%x\n", has_rvvzvfh); --#endif --#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || \ -- defined(_M_X64) - int has_x86 = TestCpuFlag(kCpuHasX86); - int has_sse2 = TestCpuFlag(kCpuHasSSE2); - int has_ssse3 = TestCpuFlag(kCpuHasSSSE3); -@@ -47,50 +37,47 @@ TEST_F(LibYUVBaseTest, TestCpuHas) { - int has_erms = TestCpuFlag(kCpuHasERMS); - int has_fma3 = TestCpuFlag(kCpuHasFMA3); - int has_f16c = TestCpuFlag(kCpuHasF16C); -+ int has_gfni = TestCpuFlag(kCpuHasGFNI); - int has_avx512bw = TestCpuFlag(kCpuHasAVX512BW); - int has_avx512vl = TestCpuFlag(kCpuHasAVX512VL); - int has_avx512vnni = TestCpuFlag(kCpuHasAVX512VNNI); - int has_avx512vbmi = TestCpuFlag(kCpuHasAVX512VBMI); - int has_avx512vbmi2 = TestCpuFlag(kCpuHasAVX512VBMI2); - int has_avx512vbitalg = TestCpuFlag(kCpuHasAVX512VBITALG); -- int has_avx10 = TestCpuFlag(kCpuHasAVX10); -- int has_avxvnni = TestCpuFlag(kCpuHasAVXVNNI); -- int has_avxvnniint8 = TestCpuFlag(kCpuHasAVXVNNIINT8); -- int has_amxint8 = TestCpuFlag(kCpuHasAMXINT8); -- printf("Has X86 0x%x\n", has_x86); -- printf("Has SSE2 0x%x\n", has_sse2); -- printf("Has SSSE3 0x%x\n", has_ssse3); -- printf("Has SSE41 0x%x\n", has_sse41); -- printf("Has SSE42 0x%x\n", has_sse42); -- printf("Has AVX 0x%x\n", has_avx); -- printf("Has AVX2 0x%x\n", has_avx2); -- printf("Has ERMS 0x%x\n", has_erms); -- printf("Has FMA3 0x%x\n", has_fma3); -- printf("Has F16C 0x%x\n", has_f16c); -- printf("Has AVX512BW 0x%x\n", has_avx512bw); -- printf("Has AVX512VL 0x%x\n", has_avx512vl); -- printf("Has AVX512VNNI 0x%x\n", has_avx512vnni); -- printf("Has AVX512VBMI 0x%x\n", has_avx512vbmi); -- printf("Has AVX512VBMI2 0x%x\n", has_avx512vbmi2); -- printf("Has AVX512VBITALG 0x%x\n", has_avx512vbitalg); -- printf("Has AVX10 0x%x\n", has_avx10); -- printf("HAS AVXVNNI 0x%x\n", has_avxvnni); -- printf("Has AVXVNNIINT8 0x%x\n", has_avxvnniint8); -- printf("Has AMXINT8 0x%x\n", has_amxint8); --#endif -+ int has_avx512vpopcntdq = TestCpuFlag(kCpuHasAVX512VPOPCNTDQ); -+ printf("Has X86 %d\n", has_x86); -+ printf("Has SSE2 %d\n", has_sse2); -+ printf("Has SSSE3 %d\n", has_ssse3); -+ printf("Has SSE41 %d\n", has_sse41); -+ printf("Has SSE42 %d\n", has_sse42); -+ printf("Has AVX %d\n", has_avx); -+ printf("Has AVX2 %d\n", has_avx2); -+ printf("Has ERMS %d\n", has_erms); -+ printf("Has FMA3 %d\n", has_fma3); -+ printf("Has F16C %d\n", has_f16c); -+ printf("Has GFNI %d\n", has_gfni); -+ printf("Has AVX512BW %d\n", has_avx512bw); -+ printf("Has AVX512VL %d\n", has_avx512vl); -+ printf("Has AVX512VNNI %d\n", has_avx512vnni); -+ printf("Has AVX512VBMI %d\n", has_avx512vbmi); -+ printf("Has AVX512VBMI2 %d\n", has_avx512vbmi2); -+ printf("Has AVX512VBITALG %d\n", has_avx512vbitalg); -+ printf("Has AVX512VPOPCNTDQ %d\n", has_avx512vpopcntdq); -+ - #if defined(__mips__) - int has_mips = TestCpuFlag(kCpuHasMIPS); -- printf("Has MIPS 0x%x\n", has_mips); -+ printf("Has MIPS %d\n", has_mips); - int has_msa = TestCpuFlag(kCpuHasMSA); -- printf("Has MSA 0x%x\n", has_msa); -+ printf("Has MSA %d\n", has_msa); - #endif -+ - #if defined(__loongarch__) - int has_loongarch = TestCpuFlag(kCpuHasLOONGARCH); -- printf("Has LOONGARCH 0x%x\n", has_loongarch); -+ printf("Has LOONGARCH %d\n", has_loongarch); - int has_lsx = TestCpuFlag(kCpuHasLSX); -- printf("Has LSX 0x%x\n", has_lsx); -+ printf("Has LSX %d\n", has_lsx); - int has_lasx = TestCpuFlag(kCpuHasLASX); -- printf("Has LASX 0x%x\n", has_lasx); -+ printf("Has LASX %d\n", has_lasx); - #endif - } - -@@ -117,39 +104,27 @@ TEST_F(LibYUVBaseTest, TestCompilerMacro - #ifdef __i386__ - printf("__i386__ %d\n", __i386__); - #endif -+#ifdef __mips -+ printf("__mips %d\n", __mips); -+#endif -+#ifdef __mips_isa_rev -+ printf("__mips_isa_rev %d\n", __mips_isa_rev); -+#endif - #ifdef __x86_64__ - printf("__x86_64__ %d\n", __x86_64__); - #endif --#ifdef _M_IX86 -- printf("_M_IX86 %d\n", _M_IX86); --#endif --#ifdef _M_X64 -- printf("_M_X64 %d\n", _M_X64); --#endif - #ifdef _MSC_VER - printf("_MSC_VER %d\n", _MSC_VER); - #endif - #ifdef __aarch64__ - printf("__aarch64__ %d\n", __aarch64__); - #endif -+#ifdef __APPLE__ -+ printf("__APPLE__ %d\n", __APPLE__); -+#endif - #ifdef __arm__ - printf("__arm__ %d\n", __arm__); - #endif --#ifdef __riscv -- printf("__riscv %d\n", __riscv); --#endif --#ifdef __riscv_vector -- printf("__riscv_vector %d\n", __riscv_vector); --#endif --#ifdef __riscv_v_intrinsic -- printf("__riscv_v_intrinsic %d\n", __riscv_v_intrinsic); --#endif --#ifdef __riscv_zve64x -- printf("__riscv_zve64x %d\n", __riscv_zve64x); --#endif --#ifdef __APPLE__ -- printf("__APPLE__ %d\n", __APPLE__); --#endif - #ifdef __clang__ - printf("__clang__ %d\n", __clang__); - #endif -@@ -165,11 +140,20 @@ TEST_F(LibYUVBaseTest, TestCompilerMacro - #ifdef __mips_msa - printf("__mips_msa %d\n", __mips_msa); - #endif --#ifdef __mips -- printf("__mips %d\n", __mips); -+#ifdef __native_client__ -+ printf("__native_client__ %d\n", __native_client__); -+#endif -+#ifdef __pic__ -+ printf("__pic__ %d\n", __pic__); - #endif --#ifdef __mips_isa_rev -- printf("__mips_isa_rev %d\n", __mips_isa_rev); -+#ifdef __pnacl__ -+ printf("__pnacl__ %d\n", __pnacl__); -+#endif -+#ifdef _M_IX86 -+ printf("_M_IX86 %d\n", _M_IX86); -+#endif -+#ifdef _M_X64 -+ printf("_M_X64 %d\n", _M_X64); - #endif - #ifdef _MIPS_ARCH_LOONGSON3A - printf("_MIPS_ARCH_LOONGSON3A %d\n", _MIPS_ARCH_LOONGSON3A); -@@ -180,17 +164,8 @@ TEST_F(LibYUVBaseTest, TestCompilerMacro - #ifdef _WIN32 - printf("_WIN32 %d\n", _WIN32); - #endif --#ifdef __native_client__ -- printf("__native_client__ %d\n", __native_client__); --#endif --#ifdef __pic__ -- printf("__pic__ %d\n", __pic__); --#endif --#ifdef __pnacl__ -- printf("__pnacl__ %d\n", __pnacl__); --#endif - #ifdef GG_LONGLONG -- printf("GG_LONGLONG %lld\n", GG_LONGLONG(1)); -+ printf("GG_LONGLONG %d\n", GG_LONGLONG); - #endif - #ifdef INT_TYPES_DEFINED - printf("INT_TYPES_DEFINED\n"); -@@ -225,9 +200,8 @@ TEST_F(LibYUVBaseTest, TestCpuId) { - cpu_info[0] = cpu_info[1]; // Reorder output - cpu_info[1] = cpu_info[3]; - cpu_info[3] = 0; -- printf("Cpu Vendor: %s 0x%x 0x%x 0x%x\n", -- reinterpret_cast(&cpu_info[0]), cpu_info[0], cpu_info[1], -- cpu_info[2]); -+ printf("Cpu Vendor: %s %x %x %x\n", reinterpret_cast(&cpu_info[0]), -+ cpu_info[0], cpu_info[1], cpu_info[2]); - EXPECT_EQ(12u, strlen(reinterpret_cast(&cpu_info[0]))); - - // CPU Family and Model -@@ -255,20 +229,21 @@ static int FileExists(const char* file_n - return 1; - } - --TEST_F(LibYUVBaseTest, TestLinuxArm) { -+TEST_F(LibYUVBaseTest, TestLinuxNeon) { - if (FileExists("../../unit_test/testdata/arm_v7.txt")) { - printf("Note: testing to load \"../../unit_test/testdata/arm_v7.txt\"\n"); - - EXPECT_EQ(0, ArmCpuCaps("../../unit_test/testdata/arm_v7.txt")); - EXPECT_EQ(kCpuHasNEON, ArmCpuCaps("../../unit_test/testdata/tegra3.txt")); -+ EXPECT_EQ(kCpuHasNEON, ArmCpuCaps("../../unit_test/testdata/juno.txt")); - } else { - printf("WARNING: unable to load \"../../unit_test/testdata/arm_v7.txt\"\n"); - } --#if defined(__linux__) && defined(__ARM_NEON__) && !defined(__aarch64__) -+#if defined(__linux__) && defined(__ARM_NEON__) - if (FileExists("/proc/cpuinfo")) { - if (kCpuHasNEON != ArmCpuCaps("/proc/cpuinfo")) { -- // This can happen on Arm emulator but /proc/cpuinfo is from host. -- printf("WARNING: Neon build enabled but CPU does not have Neon\n"); -+ // This can happen on ARM emulator but /proc/cpuinfo is from host. -+ printf("WARNING: Neon build enabled but CPU does not have NEON\n"); - } - } else { - printf("WARNING: unable to load \"/proc/cpuinfo\"\n"); -@@ -276,29 +251,6 @@ TEST_F(LibYUVBaseTest, TestLinuxArm) { - #endif - } - --#if defined(__linux__) && defined(__aarch64__) --TEST_F(LibYUVBaseTest, TestLinuxAArch64) { -- // Values taken from a Cortex-A57 machine, only Neon available. -- EXPECT_EQ(kCpuHasNEON, AArch64CpuCaps(0xffU, 0x0U)); -- -- // Values taken from a Google Pixel 7. -- int expected = kCpuHasNEON | kCpuHasNeonDotProd; -- EXPECT_EQ(expected, AArch64CpuCaps(0x119fffU, 0x0U)); -- -- // Values taken from a Google Pixel 8. -- expected = kCpuHasNEON | kCpuHasNeonDotProd | kCpuHasNeonI8MM | kCpuHasSVE | -- kCpuHasSVE2; -- EXPECT_EQ(expected, AArch64CpuCaps(0x3fffffffU, 0x2f33fU)); -- -- // Values taken from a Neoverse N2 machine. -- EXPECT_EQ(expected, AArch64CpuCaps(0x3fffffffU, 0x2f3ffU)); -- -- // Check for SME feature detection. -- expected |= kCpuHasSME; -- EXPECT_EQ(expected, AArch64CpuCaps(0x3fffffffU, 0x82f3ffU)); --} --#endif -- - TEST_F(LibYUVBaseTest, TestLinuxMipsMsa) { - if (FileExists("../../unit_test/testdata/mips.txt")) { - printf("Note: testing to load \"../../unit_test/testdata/mips.txt\"\n"); -@@ -312,32 +264,6 @@ TEST_F(LibYUVBaseTest, TestLinuxMipsMsa) - } - } - --TEST_F(LibYUVBaseTest, TestLinuxRVV) { -- if (FileExists("../../unit_test/testdata/riscv64.txt")) { -- printf("Note: testing to load \"../../unit_test/testdata/riscv64.txt\"\n"); -- -- EXPECT_EQ(0, RiscvCpuCaps("../../unit_test/testdata/riscv64.txt")); -- EXPECT_EQ(kCpuHasRVV, -- RiscvCpuCaps("../../unit_test/testdata/riscv64_rvv.txt")); -- EXPECT_EQ(kCpuHasRVV | kCpuHasRVVZVFH, -- RiscvCpuCaps("../../unit_test/testdata/riscv64_rvv_zvfh.txt")); -- } else { -- printf( -- "WARNING: unable to load " -- "\"../../unit_test/testdata/riscv64.txt\"\n"); -- } --#if defined(__linux__) && defined(__riscv) -- if (FileExists("/proc/cpuinfo")) { -- if (!(kCpuHasRVV & RiscvCpuCaps("/proc/cpuinfo"))) { -- // This can happen on RVV emulator but /proc/cpuinfo is from host. -- printf("WARNING: RVV build enabled but CPU does not have RVV\n"); -- } -- } else { -- printf("WARNING: unable to load \"/proc/cpuinfo\"\n"); -- } --#endif --} -- - // TODO(fbarchard): Fix clangcl test of cpuflags. - #ifdef _MSC_VER - TEST_F(LibYUVBaseTest, DISABLED_TestSetCpuFlags) { -diff --git a/media/libyuv/libyuv/unit_test/planar_test.cc b/media/libyuv/libyuv/unit_test/planar_test.cc ---- a/media/libyuv/libyuv/unit_test/planar_test.cc -+++ b/media/libyuv/libyuv/unit_test/planar_test.cc -@@ -30,9 +30,9 @@ - #endif - - #if defined(LIBYUV_BIT_EXACT) --#define EXPECTED_UNATTENUATE_DIFF 0 -+#define EXPECTED_ATTENUATE_DIFF 0 - #else --#define EXPECTED_UNATTENUATE_DIFF 2 -+#define EXPECTED_ATTENUATE_DIFF 2 - #endif - - namespace libyuv { -@@ -57,17 +57,12 @@ TEST_F(LibYUVPlanarTest, TestAttenuate) - orig_pixels[2 * 4 + 0] = 16u; - orig_pixels[2 * 4 + 1] = 64u; - orig_pixels[2 * 4 + 2] = 192u; -- orig_pixels[2 * 4 + 3] = 128u; -+ orig_pixels[2 * 4 + 3] = 255u; - orig_pixels[3 * 4 + 0] = 16u; - orig_pixels[3 * 4 + 1] = 64u; - orig_pixels[3 * 4 + 2] = 192u; -- orig_pixels[3 * 4 + 3] = 255u; -- orig_pixels[4 * 4 + 0] = 255u; -- orig_pixels[4 * 4 + 1] = 255u; -- orig_pixels[4 * 4 + 2] = 255u; -- orig_pixels[4 * 4 + 3] = 255u; -- -- ARGBUnattenuate(orig_pixels, 0, unatten_pixels, 0, 5, 1); -+ orig_pixels[3 * 4 + 3] = 128u; -+ ARGBUnattenuate(orig_pixels, 0, unatten_pixels, 0, 4, 1); - EXPECT_EQ(255u, unatten_pixels[0 * 4 + 0]); - EXPECT_EQ(255u, unatten_pixels[0 * 4 + 1]); - EXPECT_EQ(254u, unatten_pixels[0 * 4 + 2]); -@@ -76,55 +71,14 @@ TEST_F(LibYUVPlanarTest, TestAttenuate) - EXPECT_EQ(0u, unatten_pixels[1 * 4 + 1]); - EXPECT_EQ(0u, unatten_pixels[1 * 4 + 2]); - EXPECT_EQ(0u, unatten_pixels[1 * 4 + 3]); -- EXPECT_EQ(32u, unatten_pixels[2 * 4 + 0]); -- EXPECT_EQ(128u, unatten_pixels[2 * 4 + 1]); -- EXPECT_EQ(255u, unatten_pixels[2 * 4 + 2]); -- EXPECT_EQ(128u, unatten_pixels[2 * 4 + 3]); -- EXPECT_EQ(16u, unatten_pixels[3 * 4 + 0]); -- EXPECT_EQ(64u, unatten_pixels[3 * 4 + 1]); -- EXPECT_EQ(192u, unatten_pixels[3 * 4 + 2]); -- EXPECT_EQ(255u, unatten_pixels[3 * 4 + 3]); -- EXPECT_EQ(255u, unatten_pixels[4 * 4 + 0]); -- EXPECT_EQ(255u, unatten_pixels[4 * 4 + 1]); -- EXPECT_EQ(255u, unatten_pixels[4 * 4 + 2]); -- EXPECT_EQ(255u, unatten_pixels[4 * 4 + 3]); -- -- ARGBAttenuate(orig_pixels, 0, atten_pixels, 0, 5, 1); -- EXPECT_EQ(100u, atten_pixels[0 * 4 + 0]); -- EXPECT_EQ(65u, atten_pixels[0 * 4 + 1]); -- EXPECT_EQ(64u, atten_pixels[0 * 4 + 2]); -- EXPECT_EQ(128u, atten_pixels[0 * 4 + 3]); -- EXPECT_EQ(0u, atten_pixels[1 * 4 + 0]); -- EXPECT_EQ(0u, atten_pixels[1 * 4 + 1]); -- EXPECT_EQ(0u, atten_pixels[1 * 4 + 2]); -- EXPECT_EQ(0u, atten_pixels[1 * 4 + 3]); -- EXPECT_EQ(8u, atten_pixels[2 * 4 + 0]); -- EXPECT_EQ(32u, atten_pixels[2 * 4 + 1]); -- EXPECT_EQ(96u, atten_pixels[2 * 4 + 2]); -- EXPECT_EQ(128u, atten_pixels[2 * 4 + 3]); -- EXPECT_EQ(16u, atten_pixels[3 * 4 + 0]); -- EXPECT_EQ(64u, atten_pixels[3 * 4 + 1]); -- EXPECT_EQ(192u, atten_pixels[3 * 4 + 2]); -- EXPECT_EQ(255u, atten_pixels[3 * 4 + 3]); -- EXPECT_EQ(255u, atten_pixels[4 * 4 + 0]); -- EXPECT_EQ(255u, atten_pixels[4 * 4 + 1]); -- EXPECT_EQ(255u, atten_pixels[4 * 4 + 2]); -- EXPECT_EQ(255u, atten_pixels[4 * 4 + 3]); -- -- // test 255 -- for (int i = 0; i < 256; ++i) { -- orig_pixels[i * 4 + 0] = i; -- orig_pixels[i * 4 + 1] = 0; -- orig_pixels[i * 4 + 2] = 0; -- orig_pixels[i * 4 + 3] = 255; -- } -- ARGBAttenuate(orig_pixels, 0, atten_pixels, 0, 256, 1); -- for (int i = 0; i < 256; ++i) { -- EXPECT_EQ(orig_pixels[i * 4 + 0], atten_pixels[i * 4 + 0]); -- EXPECT_EQ(0, atten_pixels[i * 4 + 1]); -- EXPECT_EQ(0, atten_pixels[i * 4 + 2]); -- EXPECT_EQ(255, atten_pixels[i * 4 + 3]); -- } -+ EXPECT_EQ(16u, unatten_pixels[2 * 4 + 0]); -+ EXPECT_EQ(64u, unatten_pixels[2 * 4 + 1]); -+ EXPECT_EQ(192u, unatten_pixels[2 * 4 + 2]); -+ EXPECT_EQ(255u, unatten_pixels[2 * 4 + 3]); -+ EXPECT_EQ(32u, unatten_pixels[3 * 4 + 0]); -+ EXPECT_EQ(128u, unatten_pixels[3 * 4 + 1]); -+ EXPECT_EQ(255u, unatten_pixels[3 * 4 + 2]); -+ EXPECT_EQ(128u, unatten_pixels[3 * 4 + 3]); - - for (int i = 0; i < 1280; ++i) { - orig_pixels[i * 4 + 0] = i; -@@ -138,10 +92,10 @@ TEST_F(LibYUVPlanarTest, TestAttenuate) - ARGBAttenuate(unatten_pixels, 0, atten2_pixels, 0, 1280, 1); - } - for (int i = 0; i < 1280; ++i) { -- EXPECT_NEAR(atten_pixels[i * 4 + 0], atten2_pixels[i * 4 + 0], 1); -- EXPECT_NEAR(atten_pixels[i * 4 + 1], atten2_pixels[i * 4 + 1], 1); -- EXPECT_NEAR(atten_pixels[i * 4 + 2], atten2_pixels[i * 4 + 2], 1); -- EXPECT_NEAR(atten_pixels[i * 4 + 3], atten2_pixels[i * 4 + 3], 1); -+ EXPECT_NEAR(atten_pixels[i * 4 + 0], atten2_pixels[i * 4 + 0], 2); -+ EXPECT_NEAR(atten_pixels[i * 4 + 1], atten2_pixels[i * 4 + 1], 2); -+ EXPECT_NEAR(atten_pixels[i * 4 + 2], atten2_pixels[i * 4 + 2], 2); -+ EXPECT_NEAR(atten_pixels[i * 4 + 3], atten2_pixels[i * 4 + 3], 2); - } - // Make sure transparent, 50% and opaque are fully accurate. - EXPECT_EQ(0, atten_pixels[0 * 4 + 0]); -@@ -152,9 +106,9 @@ TEST_F(LibYUVPlanarTest, TestAttenuate) - EXPECT_EQ(32, atten_pixels[128 * 4 + 1]); - EXPECT_EQ(21, atten_pixels[128 * 4 + 2]); - EXPECT_EQ(128, atten_pixels[128 * 4 + 3]); -- EXPECT_EQ(255, atten_pixels[255 * 4 + 0]); -- EXPECT_EQ(127, atten_pixels[255 * 4 + 1]); -- EXPECT_EQ(85, atten_pixels[255 * 4 + 2]); -+ EXPECT_NEAR(254, atten_pixels[255 * 4 + 0], EXPECTED_ATTENUATE_DIFF); -+ EXPECT_NEAR(127, atten_pixels[255 * 4 + 1], EXPECTED_ATTENUATE_DIFF); -+ EXPECT_NEAR(85, atten_pixels[255 * 4 + 2], EXPECTED_ATTENUATE_DIFF); - EXPECT_EQ(255, atten_pixels[255 * 4 + 3]); - - free_aligned_buffer_page_end(atten2_pixels); -@@ -211,28 +165,28 @@ TEST_F(LibYUVPlanarTest, ARGBAttenuate_A - benchmark_iterations_, disable_cpu_flags_, - benchmark_cpu_info_, +1, 0); - -- EXPECT_EQ(max_diff, 0); -+ EXPECT_LE(max_diff, EXPECTED_ATTENUATE_DIFF); - } - - TEST_F(LibYUVPlanarTest, ARGBAttenuate_Unaligned) { - int max_diff = - TestAttenuateI(benchmark_width_, benchmark_height_, benchmark_iterations_, - disable_cpu_flags_, benchmark_cpu_info_, +1, 1); -- EXPECT_EQ(max_diff, 0); -+ EXPECT_LE(max_diff, EXPECTED_ATTENUATE_DIFF); - } - - TEST_F(LibYUVPlanarTest, ARGBAttenuate_Invert) { - int max_diff = - TestAttenuateI(benchmark_width_, benchmark_height_, benchmark_iterations_, - disable_cpu_flags_, benchmark_cpu_info_, -1, 0); -- EXPECT_EQ(max_diff, 0); -+ EXPECT_LE(max_diff, EXPECTED_ATTENUATE_DIFF); - } - - TEST_F(LibYUVPlanarTest, ARGBAttenuate_Opt) { - int max_diff = - TestAttenuateI(benchmark_width_, benchmark_height_, benchmark_iterations_, - disable_cpu_flags_, benchmark_cpu_info_, +1, 0); -- EXPECT_EQ(max_diff, 0); -+ EXPECT_LE(max_diff, EXPECTED_ATTENUATE_DIFF); - } - - static int TestUnattenuateI(int width, -@@ -284,28 +238,28 @@ TEST_F(LibYUVPlanarTest, ARGBUnattenuate - int max_diff = TestUnattenuateI(benchmark_width_ + 1, benchmark_height_, - benchmark_iterations_, disable_cpu_flags_, - benchmark_cpu_info_, +1, 0); -- EXPECT_LE(max_diff, EXPECTED_UNATTENUATE_DIFF); -+ EXPECT_LE(max_diff, EXPECTED_ATTENUATE_DIFF); - } - - TEST_F(LibYUVPlanarTest, ARGBUnattenuate_Unaligned) { - int max_diff = TestUnattenuateI(benchmark_width_, benchmark_height_, - benchmark_iterations_, disable_cpu_flags_, - benchmark_cpu_info_, +1, 1); -- EXPECT_LE(max_diff, EXPECTED_UNATTENUATE_DIFF); -+ EXPECT_LE(max_diff, EXPECTED_ATTENUATE_DIFF); - } - - TEST_F(LibYUVPlanarTest, ARGBUnattenuate_Invert) { - int max_diff = TestUnattenuateI(benchmark_width_, benchmark_height_, - benchmark_iterations_, disable_cpu_flags_, - benchmark_cpu_info_, -1, 0); -- EXPECT_LE(max_diff, EXPECTED_UNATTENUATE_DIFF); -+ EXPECT_LE(max_diff, EXPECTED_ATTENUATE_DIFF); - } - - TEST_F(LibYUVPlanarTest, ARGBUnattenuate_Opt) { - int max_diff = TestUnattenuateI(benchmark_width_, benchmark_height_, - benchmark_iterations_, disable_cpu_flags_, - benchmark_cpu_info_, +1, 0); -- EXPECT_LE(max_diff, EXPECTED_UNATTENUATE_DIFF); -+ EXPECT_LE(max_diff, EXPECTED_ATTENUATE_DIFF); - } - - TEST_F(LibYUVPlanarTest, TestARGBComputeCumulativeSum) { -@@ -2551,12 +2505,11 @@ int TestHalfFloatPlane(int benchmark_wid - #if defined(__arm__) - static void EnableFlushDenormalToZero(void) { - uint32_t cw; -- asm volatile ( -- "vmrs %0, fpscr \n" -- "orr %0, %0, #0x1000000 \n" -- "vmsr fpscr, %0 \n" -- : "=r"(cw) -- ::"memory", "cc"); // Clobber List -+ __asm__ __volatile__( -+ "vmrs %0, fpscr \n" -+ "orr %0, %0, #0x1000000 \n" -+ "vmsr fpscr, %0 \n" -+ : "=r"(cw)::"memory"); - } - #endif - -@@ -2796,23 +2749,12 @@ TEST_F(LibYUVPlanarTest, TestARGBExtract - MaskCpuFlags(disable_cpu_flags_); - ARGBExtractAlpha(src_pixels, benchmark_width_ * 4, dst_pixels_c, - benchmark_width_, benchmark_width_, benchmark_height_); -- double c_time = get_time(); -- ARGBExtractAlpha(src_pixels, benchmark_width_ * 4, dst_pixels_c, -- benchmark_width_, benchmark_width_, benchmark_height_); -- c_time = (get_time() - c_time); -- - MaskCpuFlags(benchmark_cpu_info_); -- ARGBExtractAlpha(src_pixels, benchmark_width_ * 4, dst_pixels_opt, -- benchmark_width_, benchmark_width_, benchmark_height_); -- double opt_time = get_time(); -+ - for (int i = 0; i < benchmark_iterations_; ++i) { - ARGBExtractAlpha(src_pixels, benchmark_width_ * 4, dst_pixels_opt, - benchmark_width_, benchmark_width_, benchmark_height_); - } -- opt_time = (get_time() - opt_time) / benchmark_iterations_; -- // Report performance of C vs OPT -- printf("%8d us C - %8d us OPT\n", static_cast(c_time * 1e6), -- static_cast(opt_time * 1e6)); - for (int i = 0; i < kPixels; ++i) { - EXPECT_EQ(dst_pixels_c[i], dst_pixels_opt[i]); - } -@@ -2835,24 +2777,12 @@ TEST_F(LibYUVPlanarTest, TestARGBCopyYTo - MaskCpuFlags(disable_cpu_flags_); - ARGBCopyYToAlpha(orig_pixels, benchmark_width_, dst_pixels_c, - benchmark_width_ * 4, benchmark_width_, benchmark_height_); -- double c_time = get_time(); -- ARGBCopyYToAlpha(orig_pixels, benchmark_width_, dst_pixels_c, -- benchmark_width_ * 4, benchmark_width_, benchmark_height_); -- c_time = (get_time() - c_time); -- - MaskCpuFlags(benchmark_cpu_info_); -- ARGBCopyYToAlpha(orig_pixels, benchmark_width_, dst_pixels_opt, -- benchmark_width_ * 4, benchmark_width_, benchmark_height_); -- double opt_time = get_time(); -+ - for (int i = 0; i < benchmark_iterations_; ++i) { - ARGBCopyYToAlpha(orig_pixels, benchmark_width_, dst_pixels_opt, - benchmark_width_ * 4, benchmark_width_, benchmark_height_); - } -- opt_time = (get_time() - opt_time) / benchmark_iterations_; -- -- // Report performance of C vs OPT -- printf("%8d us C - %8d us OPT\n", static_cast(c_time * 1e6), -- static_cast(opt_time * 1e6)); - for (int i = 0; i < kPixels * 4; ++i) { - EXPECT_EQ(dst_pixels_c[i], dst_pixels_opt[i]); - } -@@ -3604,8 +3534,8 @@ TESTTPLANARTOP(MergeXR30, uint16_t, uint - // TODO(fbarchard): improve test for platforms and cpu detect - #ifdef HAS_MERGEUVROW_16_AVX2 - TEST_F(LibYUVPlanarTest, MergeUVRow_16_Opt) { -- // Round count up to multiple of 8 -- const int kPixels = (benchmark_width_ * benchmark_height_ + 7) & ~7; -+ // Round count up to multiple of 16 -+ const int kPixels = (benchmark_width_ * benchmark_height_ + 15) & ~15; - - align_buffer_page_end(src_pixels_u, kPixels * 2); - align_buffer_page_end(src_pixels_v, kPixels * 2); -@@ -4538,83 +4468,4 @@ TEST_F(LibYUVPlanarTest, NV21Copy) { - free_aligned_buffer_page_end(dst_vu); - } - --#if defined(ENABLE_ROW_TESTS) && !defined(LIBYUV_DISABLE_NEON) && \ -- defined(__aarch64__) -- --TEST_F(LibYUVPlanarTest, TestConvertFP16ToFP32) { -- int i, j; -- const int y_plane_size = benchmark_width_ * benchmark_height_; -- -- align_buffer_page_end(orig_f, y_plane_size * 4); -- align_buffer_page_end(orig_y, y_plane_size * 2); -- align_buffer_page_end(dst_opt, y_plane_size * 4); -- align_buffer_page_end(rec_opt, y_plane_size * 2); -- -- for (i = 0; i < y_plane_size; ++i) { -- ((float*)orig_f)[i] = (float)(i % 10000) * 3.14f; -- } -- memset(orig_y, 1, y_plane_size * 2); -- memset(dst_opt, 2, y_plane_size * 4); -- memset(rec_opt, 3, y_plane_size * 2); -- -- ConvertFP32ToFP16Row_NEON((const float*)orig_f, (uint16_t*)orig_y, -- y_plane_size); -- -- for (j = 0; j < benchmark_iterations_; j++) { -- ConvertFP16ToFP32Row_NEON((const uint16_t*)orig_y, (float*)dst_opt, -- y_plane_size); -- } -- -- ConvertFP32ToFP16Row_NEON((const float*)dst_opt, (uint16_t*)rec_opt, -- y_plane_size); -- -- for (i = 0; i < y_plane_size; ++i) { -- EXPECT_EQ(((const uint16_t*)orig_y)[i], ((const uint16_t*)rec_opt)[i]); -- } -- -- free_aligned_buffer_page_end(orig_f); -- free_aligned_buffer_page_end(orig_y); -- free_aligned_buffer_page_end(dst_opt); -- free_aligned_buffer_page_end(rec_opt); --} -- --TEST_F(LibYUVPlanarTest, TestConvertFP16ToFP32Column) { -- int i, j; -- const int y_plane_size = benchmark_width_ * benchmark_height_; -- -- align_buffer_page_end(orig_f, y_plane_size * 4); -- align_buffer_page_end(orig_y, y_plane_size * 2); -- align_buffer_page_end(dst_opt, y_plane_size * 4); -- align_buffer_page_end(rec_opt, y_plane_size * 2); -- -- for (i = 0; i < y_plane_size; ++i) { -- ((float*)orig_f)[i] = (float)(i % 10000) * 3.14f; -- } -- memset(orig_y, 1, y_plane_size * 2); -- memset(dst_opt, 2, y_plane_size * 4); -- memset(rec_opt, 3, y_plane_size * 2); -- -- ConvertFP32ToFP16Row_NEON((const float*)orig_f, (uint16_t*)orig_y, -- y_plane_size); -- -- for (j = 0; j < benchmark_iterations_; j++) { -- ConvertFP16ToFP32Column_NEON((const uint16_t*)orig_y, 1, (float*)dst_opt, -- y_plane_size); -- } -- -- ConvertFP32ToFP16Row_NEON((const float*)dst_opt, (uint16_t*)rec_opt, -- y_plane_size); -- -- for (i = 0; i < y_plane_size; ++i) { -- EXPECT_EQ(((const uint16_t*)orig_y)[i], ((const uint16_t*)rec_opt)[i]); -- } -- -- free_aligned_buffer_page_end(orig_f); -- free_aligned_buffer_page_end(orig_y); -- free_aligned_buffer_page_end(dst_opt); -- free_aligned_buffer_page_end(rec_opt); --} -- --#endif // defined(ENABLE_ROW_TESTS) && defined(__aarch64__) -- - } // namespace libyuv -diff --git a/media/libyuv/libyuv/unit_test/rotate_test.cc b/media/libyuv/libyuv/unit_test/rotate_test.cc ---- a/media/libyuv/libyuv/unit_test/rotate_test.cc -+++ b/media/libyuv/libyuv/unit_test/rotate_test.cc -@@ -864,55 +864,7 @@ TEST_F(LibYUVRotateTest, I410Rotate270_O - - #if defined(ENABLE_ROW_TESTS) - --TEST_F(LibYUVRotateTest, Transpose4x4_Test) { -- // dst width and height -- const int width = 4; -- const int height = 4; -- int src_pixels[4][4]; -- int dst_pixels_c[4][4]; -- int dst_pixels_opt[4][4]; -- -- for (int i = 0; i < 4; ++i) { -- for (int j = 0; j < 4; ++j) { -- src_pixels[i][j] = i * 10 + j; -- } -- } -- memset(dst_pixels_c, 1, width * height * 4); -- memset(dst_pixels_opt, 2, width * height * 4); -- -- Transpose4x4_32_C((const uint8_t*)src_pixels, height * 4, -- (uint8_t*)dst_pixels_c, width * 4, width); -- -- const int benchmark_iterations = -- (benchmark_iterations_ * benchmark_width_ * benchmark_height_ + 15) / -- (4 * 4); -- for (int i = 0; i < benchmark_iterations; ++i) { --#if defined(HAS_TRANSPOSE4X4_32_NEON) -- if (TestCpuFlag(kCpuHasNEON)) { -- Transpose4x4_32_NEON((const uint8_t*)src_pixels, height * 4, -- (uint8_t*)dst_pixels_opt, width * 4, width); -- } else --#elif defined(HAS_TRANSPOSE4X4_32_SSE2) -- if (TestCpuFlag(kCpuHasSSE2)) { -- Transpose4x4_32_SSE2((const uint8_t*)src_pixels, height * 4, -- (uint8_t*)dst_pixels_opt, width * 4, width); -- } else --#endif -- { -- Transpose4x4_32_C((const uint8_t*)src_pixels, height * 4, -- (uint8_t*)dst_pixels_opt, width * 4, width); -- } -- } -- -- for (int i = 0; i < 4; ++i) { -- for (int j = 0; j < 4; ++j) { -- EXPECT_EQ(dst_pixels_c[i][j], src_pixels[j][i]); -- EXPECT_EQ(dst_pixels_c[i][j], dst_pixels_opt[i][j]); -- } -- } --} -- --TEST_F(LibYUVRotateTest, Transpose4x4_Opt) { -+TEST_F(LibYUVRotateTest, Transpose4x4) { - // dst width and height - const int width = ((benchmark_width_ * benchmark_height_ + 3) / 4 + 3) & ~3; - const int height = 4; -@@ -922,35 +874,29 @@ TEST_F(LibYUVRotateTest, Transpose4x4_Op - - MemRandomize(src_pixels, height * width * 4); - memset(dst_pixels_c, 1, width * height * 4); -- memset(dst_pixels_opt, 2, width * height * 4); -+ memset(dst_pixels_opt, 1, width * height * 4); - - Transpose4x4_32_C((const uint8_t*)src_pixels, height * 4, - (uint8_t*)dst_pixels_c, width * 4, width); - - for (int i = 0; i < benchmark_iterations_; ++i) { --#if defined(HAS_TRANSPOSE4X4_32_NEON) -+#if defined(__aarch64__) - if (TestCpuFlag(kCpuHasNEON)) { - Transpose4x4_32_NEON((const uint8_t*)src_pixels, height * 4, - (uint8_t*)dst_pixels_opt, width * 4, width); -- } else --#elif defined(HAS_TRANSPOSE4X4_32_AVX2) -- if (TestCpuFlag(kCpuHasAVX2)) { -- Transpose4x4_32_AVX2((const uint8_t*)src_pixels, height * 4, -- (uint8_t*)dst_pixels_opt, width * 4, width); -- } else if (TestCpuFlag(kCpuHasSSE2)) { -- Transpose4x4_32_SSE2((const uint8_t*)src_pixels, height * 4, -- (uint8_t*)dst_pixels_opt, width * 4, width); -- } else --#endif -- { -+ } else { - Transpose4x4_32_C((const uint8_t*)src_pixels, height * 4, - (uint8_t*)dst_pixels_opt, width * 4, width); - } -+#else -+ Transpose4x4_32_C((const uint8_t*)src_pixels, height * 4, -+ (uint8_t*)dst_pixels_opt, width * 4, width); -+#endif - } - -- for (int i = 0; i < width * height; ++i) { -- EXPECT_EQ(dst_pixels_c[i], dst_pixels_opt[i]); -- } -+ // for (int i = 0; i < width * height; ++i) { -+ // EXPECT_EQ(dst_pixels_c[i], dst_pixels_opt[i]); -+ // } - - free_aligned_buffer_page_end(src_pixels); - free_aligned_buffer_page_end(dst_pixels_c); -diff --git a/media/libyuv/libyuv/unit_test/scale_test.cc b/media/libyuv/libyuv/unit_test/scale_test.cc ---- a/media/libyuv/libyuv/unit_test/scale_test.cc -+++ b/media/libyuv/libyuv/unit_test/scale_test.cc -@@ -22,11 +22,6 @@ - #define STRINGIZE(line) #line - #define FILELINESTR(file, line) file ":" STRINGIZE(line) - --#if defined(__riscv) && !defined(__clang__) --#define DISABLE_SLOW_TESTS --#undef ENABLE_FULL_TESTS --#endif -- - #if !defined(DISABLE_SLOW_TESTS) || defined(__x86_64__) || defined(__i386__) - // SLOW TESTS are those that are unoptimized C code. - // FULL TESTS are optimized but test many variations of the same code. -@@ -1128,6 +1123,479 @@ TEST_SCALESWAPXY1(DISABLED_, Scale, Bili - TEST_SCALESWAPXY1(DISABLED_, Scale, Box, 3) - #endif - #endif -+ - #undef TEST_SCALESWAPXY1 - -+#ifdef ENABLE_ROW_TESTS -+#ifdef HAS_SCALEROWDOWN2_SSSE3 -+TEST_F(LibYUVScaleTest, TestScaleRowDown2Box_Odd_SSSE3) { -+ SIMD_ALIGNED(uint8_t orig_pixels[128 * 2]); -+ SIMD_ALIGNED(uint8_t dst_pixels_opt[64]); -+ SIMD_ALIGNED(uint8_t dst_pixels_c[64]); -+ memset(orig_pixels, 0, sizeof(orig_pixels)); -+ memset(dst_pixels_opt, 0, sizeof(dst_pixels_opt)); -+ memset(dst_pixels_c, 0, sizeof(dst_pixels_c)); -+ -+ int has_ssse3 = TestCpuFlag(kCpuHasSSSE3); -+ if (!has_ssse3) { -+ printf("Warning SSSE3 not detected; Skipping test.\n"); -+ } else { -+ // TL. -+ orig_pixels[0] = 255u; -+ orig_pixels[1] = 0u; -+ orig_pixels[128 + 0] = 0u; -+ orig_pixels[128 + 1] = 0u; -+ // TR. -+ orig_pixels[2] = 0u; -+ orig_pixels[3] = 100u; -+ orig_pixels[128 + 2] = 0u; -+ orig_pixels[128 + 3] = 0u; -+ // BL. -+ orig_pixels[4] = 0u; -+ orig_pixels[5] = 0u; -+ orig_pixels[128 + 4] = 50u; -+ orig_pixels[128 + 5] = 0u; -+ // BR. -+ orig_pixels[6] = 0u; -+ orig_pixels[7] = 0u; -+ orig_pixels[128 + 6] = 0u; -+ orig_pixels[128 + 7] = 20u; -+ // Odd. -+ orig_pixels[126] = 4u; -+ orig_pixels[127] = 255u; -+ orig_pixels[128 + 126] = 16u; -+ orig_pixels[128 + 127] = 255u; -+ -+ // Test regular half size. -+ ScaleRowDown2Box_C(orig_pixels, 128, dst_pixels_c, 64); -+ -+ EXPECT_EQ(64u, dst_pixels_c[0]); -+ EXPECT_EQ(25u, dst_pixels_c[1]); -+ EXPECT_EQ(13u, dst_pixels_c[2]); -+ EXPECT_EQ(5u, dst_pixels_c[3]); -+ EXPECT_EQ(0u, dst_pixels_c[4]); -+ EXPECT_EQ(133u, dst_pixels_c[63]); -+ -+ // Test Odd width version - Last pixel is just 1 horizontal pixel. -+ ScaleRowDown2Box_Odd_C(orig_pixels, 128, dst_pixels_c, 64); -+ -+ EXPECT_EQ(64u, dst_pixels_c[0]); -+ EXPECT_EQ(25u, dst_pixels_c[1]); -+ EXPECT_EQ(13u, dst_pixels_c[2]); -+ EXPECT_EQ(5u, dst_pixels_c[3]); -+ EXPECT_EQ(0u, dst_pixels_c[4]); -+ EXPECT_EQ(10u, dst_pixels_c[63]); -+ -+ // Test one pixel less, should skip the last pixel. -+ memset(dst_pixels_c, 0, sizeof(dst_pixels_c)); -+ ScaleRowDown2Box_Odd_C(orig_pixels, 128, dst_pixels_c, 63); -+ -+ EXPECT_EQ(64u, dst_pixels_c[0]); -+ EXPECT_EQ(25u, dst_pixels_c[1]); -+ EXPECT_EQ(13u, dst_pixels_c[2]); -+ EXPECT_EQ(5u, dst_pixels_c[3]); -+ EXPECT_EQ(0u, dst_pixels_c[4]); -+ EXPECT_EQ(0u, dst_pixels_c[63]); -+ -+ // Test regular half size SSSE3. -+ ScaleRowDown2Box_SSSE3(orig_pixels, 128, dst_pixels_opt, 64); -+ -+ EXPECT_EQ(64u, dst_pixels_opt[0]); -+ EXPECT_EQ(25u, dst_pixels_opt[1]); -+ EXPECT_EQ(13u, dst_pixels_opt[2]); -+ EXPECT_EQ(5u, dst_pixels_opt[3]); -+ EXPECT_EQ(0u, dst_pixels_opt[4]); -+ EXPECT_EQ(133u, dst_pixels_opt[63]); -+ -+ // Compare C and SSSE3 match. -+ ScaleRowDown2Box_Odd_C(orig_pixels, 128, dst_pixels_c, 64); -+ ScaleRowDown2Box_Odd_SSSE3(orig_pixels, 128, dst_pixels_opt, 64); -+ for (int i = 0; i < 64; ++i) { -+ EXPECT_EQ(dst_pixels_c[i], dst_pixels_opt[i]); -+ } -+ } -+} -+#endif // HAS_SCALEROWDOWN2_SSSE3 -+ -+extern "C" void ScaleRowUp2_16_NEON(const uint16_t* src_ptr, -+ ptrdiff_t src_stride, -+ uint16_t* dst, -+ int dst_width); -+extern "C" void ScaleRowUp2_16_C(const uint16_t* src_ptr, -+ ptrdiff_t src_stride, -+ uint16_t* dst, -+ int dst_width); -+ -+TEST_F(LibYUVScaleTest, TestScaleRowUp2_16) { -+ SIMD_ALIGNED(uint16_t orig_pixels[640 * 2 + 1]); // 2 rows + 1 pixel overrun. -+ SIMD_ALIGNED(uint16_t dst_pixels_opt[1280]); -+ SIMD_ALIGNED(uint16_t dst_pixels_c[1280]); -+ -+ memset(orig_pixels, 0, sizeof(orig_pixels)); -+ memset(dst_pixels_opt, 1, sizeof(dst_pixels_opt)); -+ memset(dst_pixels_c, 2, sizeof(dst_pixels_c)); -+ -+ for (int i = 0; i < 640 * 2 + 1; ++i) { -+ orig_pixels[i] = i; -+ } -+ ScaleRowUp2_16_C(&orig_pixels[0], 640, &dst_pixels_c[0], 1280); -+ for (int i = 0; i < benchmark_pixels_div1280_; ++i) { -+#if !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__) -+ int has_neon = TestCpuFlag(kCpuHasNEON); -+ if (has_neon) { -+ ScaleRowUp2_16_NEON(&orig_pixels[0], 640, &dst_pixels_opt[0], 1280); -+ } else { -+ ScaleRowUp2_16_C(&orig_pixels[0], 640, &dst_pixels_opt[0], 1280); -+ } -+#else -+ ScaleRowUp2_16_C(&orig_pixels[0], 640, &dst_pixels_opt[0], 1280); -+#endif -+ } -+ -+ for (int i = 0; i < 1280; ++i) { -+ EXPECT_EQ(dst_pixels_c[i], dst_pixels_opt[i]); -+ } -+ EXPECT_EQ(dst_pixels_c[0], (0 * 9 + 1 * 3 + 640 * 3 + 641 * 1 + 8) / 16); -+ EXPECT_EQ(dst_pixels_c[1279], 800); -+} -+ -+extern "C" void ScaleRowDown2Box_16_NEON(const uint16_t* src_ptr, -+ ptrdiff_t src_stride, -+ uint16_t* dst, -+ int dst_width); -+ -+TEST_F(LibYUVScaleTest, TestScaleRowDown2Box_16) { -+ SIMD_ALIGNED(uint16_t orig_pixels[2560 * 2]); -+ SIMD_ALIGNED(uint16_t dst_pixels_c[1280]); -+ SIMD_ALIGNED(uint16_t dst_pixels_opt[1280]); -+ -+ memset(orig_pixels, 0, sizeof(orig_pixels)); -+ memset(dst_pixels_c, 1, sizeof(dst_pixels_c)); -+ memset(dst_pixels_opt, 2, sizeof(dst_pixels_opt)); -+ -+ for (int i = 0; i < 2560 * 2; ++i) { -+ orig_pixels[i] = i; -+ } -+ ScaleRowDown2Box_16_C(&orig_pixels[0], 2560, &dst_pixels_c[0], 1280); -+ for (int i = 0; i < benchmark_pixels_div1280_; ++i) { -+#if !defined(LIBYUV_DISABLE_NEON) && defined(__aarch64__) -+ int has_neon = TestCpuFlag(kCpuHasNEON); -+ if (has_neon) { -+ ScaleRowDown2Box_16_NEON(&orig_pixels[0], 2560, &dst_pixels_opt[0], 1280); -+ } else { -+ ScaleRowDown2Box_16_C(&orig_pixels[0], 2560, &dst_pixels_opt[0], 1280); -+ } -+#else -+ ScaleRowDown2Box_16_C(&orig_pixels[0], 2560, &dst_pixels_opt[0], 1280); -+#endif -+ } -+ -+ for (int i = 0; i < 1280; ++i) { -+ EXPECT_EQ(dst_pixels_c[i], dst_pixels_opt[i]); -+ } -+ -+ EXPECT_EQ(dst_pixels_c[0], (0 + 1 + 2560 + 2561 + 2) / 4); -+ EXPECT_EQ(dst_pixels_c[1279], 3839); -+} -+#endif // ENABLE_ROW_TESTS -+ -+// Test scaling plane with 8 bit C vs 12 bit C and return maximum pixel -+// difference. -+// 0 = exact. -+static int TestPlaneFilter_16(int src_width, -+ int src_height, -+ int dst_width, -+ int dst_height, -+ FilterMode f, -+ int benchmark_iterations, -+ int disable_cpu_flags, -+ int benchmark_cpu_info) { -+ if (!SizeValid(src_width, src_height, dst_width, dst_height)) { -+ return 0; -+ } -+ -+ int i; -+ int64_t src_y_plane_size = (Abs(src_width)) * (Abs(src_height)); -+ int src_stride_y = Abs(src_width); -+ int dst_y_plane_size = dst_width * dst_height; -+ int dst_stride_y = dst_width; -+ -+ align_buffer_page_end(src_y, src_y_plane_size); -+ align_buffer_page_end(src_y_16, src_y_plane_size * 2); -+ align_buffer_page_end(dst_y_8, dst_y_plane_size); -+ align_buffer_page_end(dst_y_16, dst_y_plane_size * 2); -+ uint16_t* p_src_y_16 = reinterpret_cast(src_y_16); -+ uint16_t* p_dst_y_16 = reinterpret_cast(dst_y_16); -+ -+ MemRandomize(src_y, src_y_plane_size); -+ memset(dst_y_8, 0, dst_y_plane_size); -+ memset(dst_y_16, 1, dst_y_plane_size * 2); -+ -+ for (i = 0; i < src_y_plane_size; ++i) { -+ p_src_y_16[i] = src_y[i] & 255; -+ } -+ -+ MaskCpuFlags(disable_cpu_flags); // Disable all CPU optimization. -+ ScalePlane(src_y, src_stride_y, src_width, src_height, dst_y_8, dst_stride_y, -+ dst_width, dst_height, f); -+ MaskCpuFlags(benchmark_cpu_info); // Enable all CPU optimization. -+ -+ for (i = 0; i < benchmark_iterations; ++i) { -+ ScalePlane_16(p_src_y_16, src_stride_y, src_width, src_height, p_dst_y_16, -+ dst_stride_y, dst_width, dst_height, f); -+ } -+ -+ // Expect an exact match. -+ int max_diff = 0; -+ for (i = 0; i < dst_y_plane_size; ++i) { -+ int abs_diff = Abs(dst_y_8[i] - p_dst_y_16[i]); -+ if (abs_diff > max_diff) { -+ max_diff = abs_diff; -+ } -+ } -+ -+ free_aligned_buffer_page_end(dst_y_8); -+ free_aligned_buffer_page_end(dst_y_16); -+ free_aligned_buffer_page_end(src_y); -+ free_aligned_buffer_page_end(src_y_16); -+ -+ return max_diff; -+} -+ -+// The following adjustments in dimensions ensure the scale factor will be -+// exactly achieved. -+// 2 is chroma subsample. -+#define DX(x, nom, denom) static_cast(((Abs(x) / nom + 1) / 2) * nom * 2) -+#define SX(x, nom, denom) static_cast(((x / nom + 1) / 2) * denom * 2) -+ -+#define TEST_FACTOR1(name, filter, nom, denom, max_diff) \ -+ TEST_F(LibYUVScaleTest, DISABLED_##ScalePlaneDownBy##name##_##filter##_16) { \ -+ int diff = TestPlaneFilter_16( \ -+ SX(benchmark_width_, nom, denom), SX(benchmark_height_, nom, denom), \ -+ DX(benchmark_width_, nom, denom), DX(benchmark_height_, nom, denom), \ -+ kFilter##filter, benchmark_iterations_, disable_cpu_flags_, \ -+ benchmark_cpu_info_); \ -+ EXPECT_LE(diff, max_diff); \ -+ } -+ -+// Test a scale factor with all 4 filters. Expect unfiltered to be exact, but -+// filtering is different fixed point implementations for SSSE3, Neon and C. -+#define TEST_FACTOR(name, nom, denom, boxdiff) \ -+ TEST_FACTOR1(name, None, nom, denom, 0) \ -+ TEST_FACTOR1(name, Linear, nom, denom, boxdiff) \ -+ TEST_FACTOR1(name, Bilinear, nom, denom, boxdiff) \ -+ TEST_FACTOR1(name, Box, nom, denom, boxdiff) -+ -+TEST_FACTOR(2, 1, 2, 0) -+TEST_FACTOR(4, 1, 4, 0) -+// TEST_FACTOR(8, 1, 8, 0) Disable for benchmark performance. Takes 90 seconds. -+TEST_FACTOR(3by4, 3, 4, 1) -+TEST_FACTOR(3by8, 3, 8, 1) -+TEST_FACTOR(3, 1, 3, 0) -+#undef TEST_FACTOR1 -+#undef TEST_FACTOR -+#undef SX -+#undef DX -+ -+TEST_F(LibYUVScaleTest, PlaneTest3x) { -+ const int kSrcStride = 480; -+ const int kDstStride = 160; -+ const int kSize = kSrcStride * 3; -+ align_buffer_page_end(orig_pixels, kSize); -+ for (int i = 0; i < 480 * 3; ++i) { -+ orig_pixels[i] = i; -+ } -+ align_buffer_page_end(dest_pixels, kDstStride); -+ -+ int iterations160 = (benchmark_width_ * benchmark_height_ + (160 - 1)) / 160 * -+ benchmark_iterations_; -+ for (int i = 0; i < iterations160; ++i) { -+ ScalePlane(orig_pixels, kSrcStride, 480, 3, dest_pixels, kDstStride, 160, 1, -+ kFilterBilinear); -+ } -+ -+ EXPECT_EQ(225, dest_pixels[0]); -+ -+ ScalePlane(orig_pixels, kSrcStride, 480, 3, dest_pixels, kDstStride, 160, 1, -+ kFilterNone); -+ -+ EXPECT_EQ(225, dest_pixels[0]); -+ -+ free_aligned_buffer_page_end(dest_pixels); -+ free_aligned_buffer_page_end(orig_pixels); -+} -+ -+TEST_F(LibYUVScaleTest, PlaneTest4x) { -+ const int kSrcStride = 640; -+ const int kDstStride = 160; -+ const int kSize = kSrcStride * 4; -+ align_buffer_page_end(orig_pixels, kSize); -+ for (int i = 0; i < 640 * 4; ++i) { -+ orig_pixels[i] = i; -+ } -+ align_buffer_page_end(dest_pixels, kDstStride); -+ -+ int iterations160 = (benchmark_width_ * benchmark_height_ + (160 - 1)) / 160 * -+ benchmark_iterations_; -+ for (int i = 0; i < iterations160; ++i) { -+ ScalePlane(orig_pixels, kSrcStride, 640, 4, dest_pixels, kDstStride, 160, 1, -+ kFilterBilinear); -+ } -+ -+ EXPECT_EQ(66, dest_pixels[0]); -+ -+ ScalePlane(orig_pixels, kSrcStride, 640, 4, dest_pixels, kDstStride, 160, 1, -+ kFilterNone); -+ -+ EXPECT_EQ(2, dest_pixels[0]); // expect the 3rd pixel of the 3rd row -+ -+ free_aligned_buffer_page_end(dest_pixels); -+ free_aligned_buffer_page_end(orig_pixels); -+} -+ -+// Intent is to test 200x50 to 50x200 but width and height can be parameters. -+TEST_F(LibYUVScaleTest, PlaneTestRotate_None) { -+ const int kSize = benchmark_width_ * benchmark_height_; -+ align_buffer_page_end(orig_pixels, kSize); -+ for (int i = 0; i < kSize; ++i) { -+ orig_pixels[i] = i; -+ } -+ align_buffer_page_end(dest_opt_pixels, kSize); -+ align_buffer_page_end(dest_c_pixels, kSize); -+ -+ MaskCpuFlags(disable_cpu_flags_); // Disable all CPU optimization. -+ ScalePlane(orig_pixels, benchmark_width_, benchmark_width_, benchmark_height_, -+ dest_c_pixels, benchmark_height_, benchmark_height_, -+ benchmark_width_, kFilterNone); -+ MaskCpuFlags(benchmark_cpu_info_); // Enable all CPU optimization. -+ -+ for (int i = 0; i < benchmark_iterations_; ++i) { -+ ScalePlane(orig_pixels, benchmark_width_, benchmark_width_, -+ benchmark_height_, dest_opt_pixels, benchmark_height_, -+ benchmark_height_, benchmark_width_, kFilterNone); -+ } -+ -+ for (int i = 0; i < kSize; ++i) { -+ EXPECT_EQ(dest_c_pixels[i], dest_opt_pixels[i]); -+ } -+ -+ free_aligned_buffer_page_end(dest_c_pixels); -+ free_aligned_buffer_page_end(dest_opt_pixels); -+ free_aligned_buffer_page_end(orig_pixels); -+} -+ -+TEST_F(LibYUVScaleTest, PlaneTestRotate_Bilinear) { -+ const int kSize = benchmark_width_ * benchmark_height_; -+ align_buffer_page_end(orig_pixels, kSize); -+ for (int i = 0; i < kSize; ++i) { -+ orig_pixels[i] = i; -+ } -+ align_buffer_page_end(dest_opt_pixels, kSize); -+ align_buffer_page_end(dest_c_pixels, kSize); -+ -+ MaskCpuFlags(disable_cpu_flags_); // Disable all CPU optimization. -+ ScalePlane(orig_pixels, benchmark_width_, benchmark_width_, benchmark_height_, -+ dest_c_pixels, benchmark_height_, benchmark_height_, -+ benchmark_width_, kFilterBilinear); -+ MaskCpuFlags(benchmark_cpu_info_); // Enable all CPU optimization. -+ -+ for (int i = 0; i < benchmark_iterations_; ++i) { -+ ScalePlane(orig_pixels, benchmark_width_, benchmark_width_, -+ benchmark_height_, dest_opt_pixels, benchmark_height_, -+ benchmark_height_, benchmark_width_, kFilterBilinear); -+ } -+ -+ for (int i = 0; i < kSize; ++i) { -+ EXPECT_EQ(dest_c_pixels[i], dest_opt_pixels[i]); -+ } -+ -+ free_aligned_buffer_page_end(dest_c_pixels); -+ free_aligned_buffer_page_end(dest_opt_pixels); -+ free_aligned_buffer_page_end(orig_pixels); -+} -+ -+// Intent is to test 200x50 to 50x200 but width and height can be parameters. -+TEST_F(LibYUVScaleTest, PlaneTestRotate_Box) { -+ const int kSize = benchmark_width_ * benchmark_height_; -+ align_buffer_page_end(orig_pixels, kSize); -+ for (int i = 0; i < kSize; ++i) { -+ orig_pixels[i] = i; -+ } -+ align_buffer_page_end(dest_opt_pixels, kSize); -+ align_buffer_page_end(dest_c_pixels, kSize); -+ -+ MaskCpuFlags(disable_cpu_flags_); // Disable all CPU optimization. -+ ScalePlane(orig_pixels, benchmark_width_, benchmark_width_, benchmark_height_, -+ dest_c_pixels, benchmark_height_, benchmark_height_, -+ benchmark_width_, kFilterBox); -+ MaskCpuFlags(benchmark_cpu_info_); // Enable all CPU optimization. -+ -+ for (int i = 0; i < benchmark_iterations_; ++i) { -+ ScalePlane(orig_pixels, benchmark_width_, benchmark_width_, -+ benchmark_height_, dest_opt_pixels, benchmark_height_, -+ benchmark_height_, benchmark_width_, kFilterBox); -+ } -+ -+ for (int i = 0; i < kSize; ++i) { -+ EXPECT_EQ(dest_c_pixels[i], dest_opt_pixels[i]); -+ } -+ -+ free_aligned_buffer_page_end(dest_c_pixels); -+ free_aligned_buffer_page_end(dest_opt_pixels); -+ free_aligned_buffer_page_end(orig_pixels); -+} -+ -+TEST_F(LibYUVScaleTest, PlaneTest1_Box) { -+ align_buffer_page_end(orig_pixels, 3); -+ align_buffer_page_end(dst_pixels, 3); -+ -+ // Pad the 1x1 byte image with invalid values before and after in case libyuv -+ // reads outside the memory boundaries. -+ orig_pixels[0] = 0; -+ orig_pixels[1] = 1; // scale this pixel -+ orig_pixels[2] = 2; -+ dst_pixels[0] = 3; -+ dst_pixels[1] = 3; -+ dst_pixels[2] = 3; -+ -+ libyuv::ScalePlane(orig_pixels + 1, /* src_stride= */ 1, /* src_width= */ 1, -+ /* src_height= */ 1, dst_pixels, /* dst_stride= */ 1, -+ /* dst_width= */ 1, /* dst_height= */ 2, -+ libyuv::kFilterBox); -+ -+ EXPECT_EQ(dst_pixels[0], 1); -+ EXPECT_EQ(dst_pixels[1], 1); -+ EXPECT_EQ(dst_pixels[2], 3); -+ -+ free_aligned_buffer_page_end(dst_pixels); -+ free_aligned_buffer_page_end(orig_pixels); -+} -+ -+TEST_F(LibYUVScaleTest, PlaneTest1_16_Box) { -+ align_buffer_page_end(orig_pixels_alloc, 3 * 2); -+ align_buffer_page_end(dst_pixels_alloc, 3 * 2); -+ uint16_t* orig_pixels = (uint16_t*)orig_pixels_alloc; -+ uint16_t* dst_pixels = (uint16_t*)dst_pixels_alloc; -+ -+ // Pad the 1x1 byte image with invalid values before and after in case libyuv -+ // reads outside the memory boundaries. -+ orig_pixels[0] = 0; -+ orig_pixels[1] = 1; // scale this pixel -+ orig_pixels[2] = 2; -+ dst_pixels[0] = 3; -+ dst_pixels[1] = 3; -+ dst_pixels[2] = 3; -+ -+ libyuv::ScalePlane_16( -+ orig_pixels + 1, /* src_stride= */ 1, /* src_width= */ 1, -+ /* src_height= */ 1, dst_pixels, /* dst_stride= */ 1, -+ /* dst_width= */ 1, /* dst_height= */ 2, libyuv::kFilterNone); -+ -+ EXPECT_EQ(dst_pixels[0], 1); -+ EXPECT_EQ(dst_pixels[1], 1); -+ EXPECT_EQ(dst_pixels[2], 3); -+ -+ free_aligned_buffer_page_end(dst_pixels_alloc); -+ free_aligned_buffer_page_end(orig_pixels_alloc); -+} - } // namespace libyuv -diff --git a/media/libyuv/libyuv/unit_test/scale_uv_test.cc b/media/libyuv/libyuv/unit_test/scale_uv_test.cc ---- a/media/libyuv/libyuv/unit_test/scale_uv_test.cc -+++ b/media/libyuv/libyuv/unit_test/scale_uv_test.cc -@@ -39,35 +39,55 @@ static int UVTestFilter(int src_width, - return 0; - } - -- int i; -- int64_t src_uv_plane_size = Abs(src_width) * Abs(src_height) * 2LL; -- int src_stride_uv = Abs(src_width) * 2; -- int64_t dst_uv_plane_size = dst_width * dst_height * 2LL; -- int dst_stride_uv = dst_width * 2; -+ int i, j; -+ const int b = 0; // 128 to test for padding/stride. -+ int64_t src_uv_plane_size = -+ (Abs(src_width) + b * 2) * (Abs(src_height) + b * 2) * 2LL; -+ int src_stride_uv = (b * 2 + Abs(src_width)) * 2; - - align_buffer_page_end(src_uv, src_uv_plane_size); -- align_buffer_page_end(dst_uv_c, dst_uv_plane_size); -- align_buffer_page_end(dst_uv_opt, dst_uv_plane_size); -- -- if (!src_uv || !dst_uv_c || !dst_uv_opt) { -+ if (!src_uv) { - printf("Skipped. Alloc failed " FILELINESTR(__FILE__, __LINE__) "\n"); - return 0; - } - MemRandomize(src_uv, src_uv_plane_size); -+ -+ int64_t dst_uv_plane_size = (dst_width + b * 2) * (dst_height + b * 2) * 2LL; -+ int dst_stride_uv = (b * 2 + dst_width) * 2; -+ -+ align_buffer_page_end(dst_uv_c, dst_uv_plane_size); -+ align_buffer_page_end(dst_uv_opt, dst_uv_plane_size); -+ if (!dst_uv_c || !dst_uv_opt) { -+ printf("Skipped. Alloc failed " FILELINESTR(__FILE__, __LINE__) "\n"); -+ return 0; -+ } - memset(dst_uv_c, 2, dst_uv_plane_size); -- memset(dst_uv_opt, 123, dst_uv_plane_size); -+ memset(dst_uv_opt, 3, dst_uv_plane_size); -+ -+ // Warm up both versions for consistent benchmarks. -+ MaskCpuFlags(disable_cpu_flags); // Disable all CPU optimization. -+ UVScale(src_uv + (src_stride_uv * b) + b * 2, src_stride_uv, src_width, -+ src_height, dst_uv_c + (dst_stride_uv * b) + b * 2, dst_stride_uv, -+ dst_width, dst_height, f); -+ MaskCpuFlags(benchmark_cpu_info); // Enable all CPU optimization. -+ UVScale(src_uv + (src_stride_uv * b) + b * 2, src_stride_uv, src_width, -+ src_height, dst_uv_opt + (dst_stride_uv * b) + b * 2, dst_stride_uv, -+ dst_width, dst_height, f); - - MaskCpuFlags(disable_cpu_flags); // Disable all CPU optimization. - double c_time = get_time(); -- UVScale(src_uv, src_stride_uv, src_width, src_height, dst_uv_c, dst_stride_uv, -+ UVScale(src_uv + (src_stride_uv * b) + b * 2, src_stride_uv, src_width, -+ src_height, dst_uv_c + (dst_stride_uv * b) + b * 2, dst_stride_uv, - dst_width, dst_height, f); -+ - c_time = (get_time() - c_time); - - MaskCpuFlags(benchmark_cpu_info); // Enable all CPU optimization. - double opt_time = get_time(); - for (i = 0; i < benchmark_iterations; ++i) { -- UVScale(src_uv, src_stride_uv, src_width, src_height, dst_uv_opt, -- dst_stride_uv, dst_width, dst_height, f); -+ UVScale(src_uv + (src_stride_uv * b) + b * 2, src_stride_uv, src_width, -+ src_height, dst_uv_opt + (dst_stride_uv * b) + b * 2, dst_stride_uv, -+ dst_width, dst_height, f); - } - opt_time = (get_time() - opt_time) / benchmark_iterations; - -@@ -75,11 +95,18 @@ static int UVTestFilter(int src_width, - printf("filter %d - %8d us C - %8d us OPT\n", f, - static_cast(c_time * 1e6), static_cast(opt_time * 1e6)); - -+ // C version may be a little off from the optimized. Order of -+ // operations may introduce rounding somewhere. So do a difference -+ // of the buffers and look to see that the max difference isn't -+ // over 2. - int max_diff = 0; -- for (i = 0; i < dst_uv_plane_size; ++i) { -- int abs_diff = Abs(dst_uv_c[i] - dst_uv_opt[i]); -- if (abs_diff > max_diff) { -- max_diff = abs_diff; -+ for (i = b; i < (dst_height + b); ++i) { -+ for (j = b * 2; j < (dst_width + b) * 2; ++j) { -+ int abs_diff = Abs(dst_uv_c[(i * dst_stride_uv) + j] - -+ dst_uv_opt[(i * dst_stride_uv) + j]); -+ if (abs_diff > max_diff) { -+ max_diff = abs_diff; -+ } - } - } - -@@ -94,26 +121,28 @@ static int UVTestFilter(int src_width, - #define DX(x, nom, denom) static_cast((Abs(x) / nom) * nom) - #define SX(x, nom, denom) static_cast((x / nom) * denom) - --#define TEST_FACTOR1(name, filter, nom, denom) \ -+#define TEST_FACTOR1(name, filter, nom, denom, max_diff) \ - TEST_F(LibYUVScaleTest, UVScaleDownBy##name##_##filter) { \ - int diff = UVTestFilter( \ - SX(benchmark_width_, nom, denom), SX(benchmark_height_, nom, denom), \ - DX(benchmark_width_, nom, denom), DX(benchmark_height_, nom, denom), \ - kFilter##filter, benchmark_iterations_, disable_cpu_flags_, \ - benchmark_cpu_info_); \ -- EXPECT_EQ(0, diff); \ -+ EXPECT_LE(diff, max_diff); \ - } - - #if defined(ENABLE_FULL_TESTS) --// Test a scale factor with all 4 filters. Expect exact for SIMD vs C. --#define TEST_FACTOR(name, nom, denom) \ -- TEST_FACTOR1(name, None, nom, denom) \ -- TEST_FACTOR1(name, Linear, nom, denom) \ -- TEST_FACTOR1(name, Bilinear, nom, denom) \ -- TEST_FACTOR1(name, Box, nom, denom) -+// Test a scale factor with all 4 filters. Expect unfiltered to be exact, but -+// filtering is different fixed point implementations for SSSE3, Neon and C. -+#define TEST_FACTOR(name, nom, denom) \ -+ TEST_FACTOR1(name, None, nom, denom, 0) \ -+ TEST_FACTOR1(name, Linear, nom, denom, 3) \ -+ TEST_FACTOR1(name, Bilinear, nom, denom, 3) \ -+ TEST_FACTOR1(name, Box, nom, denom, 3) - #else - // Test a scale factor with Bilinear. --#define TEST_FACTOR(name, nom, denom) TEST_FACTOR1(name, Bilinear, nom, denom) -+#define TEST_FACTOR(name, nom, denom) \ -+ TEST_FACTOR1(name, Bilinear, nom, denom, 3) - #endif - - TEST_FACTOR(2, 1, 2) -diff --git a/media/libyuv/libyuv/unit_test/unit_test.cc b/media/libyuv/libyuv/unit_test/unit_test.cc ---- a/media/libyuv/libyuv/unit_test/unit_test.cc -+++ b/media/libyuv/libyuv/unit_test/unit_test.cc -@@ -88,11 +88,6 @@ int TestCpuEnv(int cpu_info) { - cpu_info &= ~libyuv::kCpuHasLASX; - } - #endif --#if defined(__riscv) && defined(__linux__) -- if (TestEnv("LIBYUV_DISABLE_RVV")) { -- cpu_info &= ~libyuv::kCpuHasRVV; -- } --#endif - #if !defined(__pnacl__) && !defined(__CLR_VER) && \ - (defined(__x86_64__) || defined(_M_X64) || defined(__i386__) || \ - defined(_M_IX86)) -@@ -144,17 +139,11 @@ int TestCpuEnv(int cpu_info) { - if (TestEnv("LIBYUV_DISABLE_AVX512VBITALG")) { - cpu_info &= ~libyuv::kCpuHasAVX512VBITALG; - } -- if (TestEnv("LIBYUV_DISABLE_AVX10")) { -- cpu_info &= ~libyuv::kCpuHasAVX10; -- } -- if (TestEnv("LIBYUV_DISABLE_AVXVNNI")) { -- cpu_info &= ~libyuv::kCpuHasAVXVNNI; -+ if (TestEnv("LIBYUV_DISABLE_AVX512VPOPCNTDQ")) { -+ cpu_info &= ~libyuv::kCpuHasAVX512VPOPCNTDQ; - } -- if (TestEnv("LIBYUV_DISABLE_AVXVNNIINT8")) { -- cpu_info &= ~libyuv::kCpuHasAVXVNNIINT8; -- } -- if (TestEnv("LIBYUV_DISABLE_AMXINT8")) { -- cpu_info &= ~libyuv::kCpuHasAMXINT8; -+ if (TestEnv("LIBYUV_DISABLE_GFNI")) { -+ cpu_info &= ~libyuv::kCpuHasGFNI; - } - #endif - if (TestEnv("LIBYUV_DISABLE_ASM")) { -@@ -207,7 +196,7 @@ LibYUVConvertTest::LibYUVConvertTest() - } - const char* cpu_info = getenv("LIBYUV_CPU_INFO"); - if (cpu_info) { -- benchmark_cpu_info_ = atoi(cpu_info); // NOLINT -+ benchmark_cpu_info_ = atoi(cpu_flags); // NOLINT - } - if (LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info)) { - benchmark_cpu_info_ = LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info); -@@ -263,7 +252,7 @@ LibYUVColorTest::LibYUVColorTest() - } - const char* cpu_info = getenv("LIBYUV_CPU_INFO"); - if (cpu_info) { -- benchmark_cpu_info_ = atoi(cpu_info); // NOLINT -+ benchmark_cpu_info_ = atoi(cpu_flags); // NOLINT - } - if (LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info)) { - benchmark_cpu_info_ = LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info); -@@ -319,7 +308,7 @@ LibYUVScaleTest::LibYUVScaleTest() - } - const char* cpu_info = getenv("LIBYUV_CPU_INFO"); - if (cpu_info) { -- benchmark_cpu_info_ = atoi(cpu_info); // NOLINT -+ benchmark_cpu_info_ = atoi(cpu_flags); // NOLINT - } - if (LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info)) { - benchmark_cpu_info_ = LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info); -@@ -375,7 +364,7 @@ LibYUVRotateTest::LibYUVRotateTest() - } - const char* cpu_info = getenv("LIBYUV_CPU_INFO"); - if (cpu_info) { -- benchmark_cpu_info_ = atoi(cpu_info); // NOLINT -+ benchmark_cpu_info_ = atoi(cpu_flags); // NOLINT - } - if (LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info)) { - benchmark_cpu_info_ = LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info); -@@ -431,7 +420,7 @@ LibYUVPlanarTest::LibYUVPlanarTest() - } - const char* cpu_info = getenv("LIBYUV_CPU_INFO"); - if (cpu_info) { -- benchmark_cpu_info_ = atoi(cpu_info); // NOLINT -+ benchmark_cpu_info_ = atoi(cpu_flags); // NOLINT - } - if (LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info)) { - benchmark_cpu_info_ = LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info); -@@ -487,7 +476,7 @@ LibYUVBaseTest::LibYUVBaseTest() - } - const char* cpu_info = getenv("LIBYUV_CPU_INFO"); - if (cpu_info) { -- benchmark_cpu_info_ = atoi(cpu_info); // NOLINT -+ benchmark_cpu_info_ = atoi(cpu_flags); // NOLINT - } - if (LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info)) { - benchmark_cpu_info_ = LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info); -@@ -543,7 +532,7 @@ LibYUVCompareTest::LibYUVCompareTest() - } - const char* cpu_info = getenv("LIBYUV_CPU_INFO"); - if (cpu_info) { -- benchmark_cpu_info_ = atoi(cpu_info); // NOLINT -+ benchmark_cpu_info_ = atoi(cpu_flags); // NOLINT - } - if (LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info)) { - benchmark_cpu_info_ = LIBYUV_GET_FLAG(FLAGS_libyuv_cpu_info); -diff --git a/media/libyuv/libyuv/util/cpuid.c b/media/libyuv/libyuv/util/cpuid.c ---- a/media/libyuv/libyuv/util/cpuid.c -+++ b/media/libyuv/libyuv/util/cpuid.c -@@ -12,51 +12,21 @@ - #include - #include - --#ifdef __linux__ --#include --#include --#endif -- - #include "libyuv/cpu_id.h" - - #ifdef __cplusplus - using namespace libyuv; - #endif - --#ifdef __linux__ --static void KernelVersion(int *version) { -- struct utsname buffer; -- int i = 0; -- -- version[0] = version[1] = 0; -- if (uname(&buffer) == 0) { -- char *v = buffer.release; -- for (i = 0; *v && i < 2; ++v) { -- if (isdigit(*v)) { -- version[i++] = (int) strtol(v, &v, 10); -- } -- } -- } --} --#endif -- - int main(int argc, const char* argv[]) { - int cpu_flags = TestCpuFlag(-1); - int has_arm = TestCpuFlag(kCpuHasARM); -- int has_riscv = TestCpuFlag(kCpuHasRISCV); -+ int has_mips = TestCpuFlag(kCpuHasMIPS); - int has_x86 = TestCpuFlag(kCpuHasX86); -- int has_mips = TestCpuFlag(kCpuHasMIPS); - int has_loongarch = TestCpuFlag(kCpuHasLOONGARCH); - (void)argc; - (void)argv; - --#ifdef __linux__ -- { -- int kernelversion[2]; -- KernelVersion(kernelversion); -- printf("Kernel Version %d.%d\n", kernelversion[0], kernelversion[1]); -- } --#endif - #if defined(__i386__) || defined(__x86_64__) || \ - defined(_M_IX86) || defined(_M_X64) - if (has_x86) { -@@ -92,54 +62,24 @@ int main(int argc, const char* argv[]) { - model, model); - } - #endif -- printf("Cpu Flags 0x%x\n", cpu_flags); -+ printf("Cpu Flags %x\n", cpu_flags); -+ printf("Has ARM %x\n", has_arm); -+ printf("Has MIPS %x\n", has_mips); -+ printf("Has X86 %x\n", has_x86); -+ printf("Has LOONGARCH %x\n", has_loongarch); - if (has_arm) { - int has_neon = TestCpuFlag(kCpuHasNEON); -- int has_neon_dotprod = TestCpuFlag(kCpuHasNeonDotProd); -- int has_neon_i8mm = TestCpuFlag(kCpuHasNeonI8MM); -- int has_sve = TestCpuFlag(kCpuHasSVE); -- int has_sve2 = TestCpuFlag(kCpuHasSVE2); -- int has_sme = TestCpuFlag(kCpuHasSME); -- printf("Has Arm 0x%x\n", has_arm); -- printf("Has Neon 0x%x\n", has_neon); -- printf("Has Neon DotProd 0x%x\n", has_neon_dotprod); -- printf("Has Neon I8MM 0x%x\n", has_neon_i8mm); -- printf("Has SVE 0x%x\n", has_sve); -- printf("Has SVE2 0x%x\n", has_sve2); -- printf("Has SME 0x%x\n", has_sme); -- --#if __aarch64__ -- // Read and print the SVE and SME vector lengths. -- if (has_sve) { -- int sve_vl; -- // rdvl x0, #1 -- asm(".inst 0x04bf5020; mov %w0, w0" : "=r"(sve_vl)::"x0"); -- printf("SVE vector length: %d bytes\n", sve_vl); -- } -- if (has_sme) { -- int sme_vl; -- // rdsvl x0, #1 -- asm(".inst 0x04bf5820; mov %w0, w0" : "=r"(sme_vl)::"x0"); -- printf("SME vector length: %d bytes\n", sme_vl); -- } --#endif -- } -- if (has_riscv) { -- int has_rvv = TestCpuFlag(kCpuHasRVV); -- printf("Has RISCV 0x%x\n", has_riscv); -- printf("Has RVV 0x%x\n", has_rvv); -+ printf("Has NEON %x\n", has_neon); - } - if (has_mips) { - int has_msa = TestCpuFlag(kCpuHasMSA); -- printf("Has MIPS 0x%x\n", has_mips); -- printf("Has MSA 0x%x\n", has_msa); -+ printf("Has MSA %x\n", has_msa); - } - if (has_loongarch) { - int has_lsx = TestCpuFlag(kCpuHasLSX); -+ printf("Has LSX %x\n", has_lsx); - int has_lasx = TestCpuFlag(kCpuHasLASX); -- printf("Has LOONGARCH 0x%x\n", has_loongarch); -- printf("Has LSX 0x%x\n", has_lsx); -- printf("Has LASX 0x%x\n", has_lasx); -+ printf("Has LASX %x\n", has_lasx); - } - if (has_x86) { - int has_sse2 = TestCpuFlag(kCpuHasSSE2); -@@ -151,36 +91,31 @@ int main(int argc, const char* argv[]) { - int has_erms = TestCpuFlag(kCpuHasERMS); - int has_fma3 = TestCpuFlag(kCpuHasFMA3); - int has_f16c = TestCpuFlag(kCpuHasF16C); -+ int has_gfni = TestCpuFlag(kCpuHasGFNI); - int has_avx512bw = TestCpuFlag(kCpuHasAVX512BW); - int has_avx512vl = TestCpuFlag(kCpuHasAVX512VL); - int has_avx512vnni = TestCpuFlag(kCpuHasAVX512VNNI); - int has_avx512vbmi = TestCpuFlag(kCpuHasAVX512VBMI); - int has_avx512vbmi2 = TestCpuFlag(kCpuHasAVX512VBMI2); - int has_avx512vbitalg = TestCpuFlag(kCpuHasAVX512VBITALG); -- int has_avx10 = TestCpuFlag(kCpuHasAVX10); -- int has_avxvnni = TestCpuFlag(kCpuHasAVXVNNI); -- int has_avxvnniint8 = TestCpuFlag(kCpuHasAVXVNNIINT8); -- int has_amxint8 = TestCpuFlag(kCpuHasAMXINT8); -- printf("Has X86 0x%x\n", has_x86); -- printf("Has SSE2 0x%x\n", has_sse2); -- printf("Has SSSE3 0x%x\n", has_ssse3); -- printf("Has SSE4.1 0x%x\n", has_sse41); -- printf("Has SSE4.2 0x%x\n", has_sse42); -- printf("Has AVX 0x%x\n", has_avx); -- printf("Has AVX2 0x%x\n", has_avx2); -- printf("Has ERMS 0x%x\n", has_erms); -- printf("Has FMA3 0x%x\n", has_fma3); -- printf("Has F16C 0x%x\n", has_f16c); -- printf("Has AVX512BW 0x%x\n", has_avx512bw); -- printf("Has AVX512VL 0x%x\n", has_avx512vl); -- printf("Has AVX512VNNI 0x%x\n", has_avx512vnni); -- printf("Has AVX512VBMI 0x%x\n", has_avx512vbmi); -- printf("Has AVX512VBMI2 0x%x\n", has_avx512vbmi2); -- printf("Has AVX512VBITALG 0x%x\n", has_avx512vbitalg); -- printf("Has AVX10 0x%x\n", has_avx10); -- printf("HAS AVXVNNI 0x%x\n", has_avxvnni); -- printf("Has AVXVNNIINT8 0x%x\n", has_avxvnniint8); -- printf("Has AMXINT8 0x%x\n", has_amxint8); -+ int has_avx512vpopcntdq = TestCpuFlag(kCpuHasAVX512VPOPCNTDQ); -+ printf("Has SSE2 %x\n", has_sse2); -+ printf("Has SSSE3 %x\n", has_ssse3); -+ printf("Has SSE4.1 %x\n", has_sse41); -+ printf("Has SSE4.2 %x\n", has_sse42); -+ printf("Has AVX %x\n", has_avx); -+ printf("Has AVX2 %x\n", has_avx2); -+ printf("Has ERMS %x\n", has_erms); -+ printf("Has FMA3 %x\n", has_fma3); -+ printf("Has F16C %x\n", has_f16c); -+ printf("Has GFNI %x\n", has_gfni); -+ printf("Has AVX512BW %x\n", has_avx512bw); -+ printf("Has AVX512VL %x\n", has_avx512vl); -+ printf("Has AVX512VNNI %x\n", has_avx512vnni); -+ printf("Has AVX512VBMI %x\n", has_avx512vbmi); -+ printf("Has AVX512VBMI2 %x\n", has_avx512vbmi2); -+ printf("Has AVX512VBITALG %x\n", has_avx512vbitalg); -+ printf("Has AVX512VPOPCNTDQ %x\n", has_avx512vpopcntdq); - } - return 0; - } -diff --git a/media/libyuv/libyuv/util/yuvconstants.c b/media/libyuv/libyuv/util/yuvconstants.c ---- a/media/libyuv/libyuv/util/yuvconstants.c -+++ b/media/libyuv/libyuv/util/yuvconstants.c -@@ -54,8 +54,8 @@ int main(int argc, const char* argv[]) { - printf(" 9 BT.2020 KR = 0.2627; KB = 0.0593\n"); - return -1; - } -- float kr = (float)atof(argv[1]); -- float kb = (float)atof(argv[2]); -+ float kr = atof(argv[1]); -+ float kb = atof(argv[2]); - float kg = 1 - kr - kb; - - float vr = 2 * (1 - kr); -diff --git a/media/libyuv/moz.build b/media/libyuv/moz.build ---- a/media/libyuv/moz.build -+++ b/media/libyuv/moz.build -@@ -30,7 +30,6 @@ libyuv_non_unified_sources = [ - 'libyuv/source/row_common.cc', - 'libyuv/source/scale.cc', - 'libyuv/source/scale_common.cc', -- 'libyuv/source/scale_uv.cc', - ] - - GYP_DIRS += ['libyuv'] -diff --git a/media/libyuv/moz.yaml b/media/libyuv/moz.yaml ---- a/media/libyuv/moz.yaml -+++ b/media/libyuv/moz.yaml -@@ -23,7 +23,7 @@ origin: - - # Revision to pull in - # Must be a long or short commit SHA (long preferred) -- revision: 616bee5420b62a7be09fda0252034e8be85f91b0 -+ revision: 2bdc210be9eb11ded16bf3ef1f6cadb0d4dcb0c2 - - # The package's license, where possible using the mnemonic from - # https://spdx.org/licenses/ -@@ -34,24 +34,23 @@ origin: - license-file: LICENSE - - updatebot: -- maintainer-phab: ng -- maintainer-bz: na-g@nostrum.com -- tasks: -- - type: vendoring -- enabled: true -- frequency: release -+ maintainer-phab: ng -+ maintainer-bz: na-g@nostrum.com -+ tasks: -+ - type: vendoring -+ enabled: true -+ frequency: release - - vendoring: - url: https://chromium.googlesource.com/libyuv/libyuv/ - source-hosting: googlesource - vendor-directory: media/libyuv/libyuv/ -- skip-vendoring-steps: ["update-moz-build"] -+ skip-vendoring-steps: ['update-moz-build'] - - exclude: - - ".*" - - patches: -- - 00_fix_build_errors.patch -- - 01_make_mjpeg_printfs_optional.patch -- - 02_update_gyp.patch -- - 03_add_neon64_and_sve_gyp_targets.patch -+ - fix_build_errors.patch -+ - make_mjpeg_printfs_optional.patch -+ - update_gyp.patch diff --git a/wasi.patch b/wasi.patch index 51600e7..f1d6bb4 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/home/komat/CVS/firefox/firefox-130.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-130.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 33de47f343d25c3eecd764fefc7d13391012c98b Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Sun, 8 Sep 2024 11:43:26 +0200 Subject: [PATCH 390/545] PipeWire camera support: backport set of upstream patches --- firefox.spec | 20 +- ...ariable-with-pipewire-status-updated.patch | 16 + ...pport-for-device-change-notification.patch | 173 ++++++++++ ...nformation-about-camera-availability.patch | 42 +++ ...eedback-for-newly-created-deviceinfo.patch | 306 ++++++++++++++++++ 5 files changed, 556 insertions(+), 1 deletion(-) create mode 100644 libwebrtc-pipewire-camera-make-member-variable-with-pipewire-status-updated.patch create mode 100644 pipewire-camera-add-missing-support-for-device-change-notification.patch create mode 100644 pipewire-camera-always-query-information-about-camera-availability.patch create mode 100644 pipewire-camera-always-register-video-input-feedback-for-newly-created-deviceinfo.patch diff --git a/firefox.spec b/firefox.spec index 95eed97..cec3225 100644 --- a/firefox.spec +++ b/firefox.spec @@ -197,7 +197,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 130.0 -Release: 4%{?pre_tag}%{?dist} +Release: 5%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -292,6 +292,15 @@ Patch424: D210430.1715848796.diff # https://phabricator.services.mozilla.com/D219224 # Part of Firefox 131 Patch500: libwebrtc-pipewire-camera-filter-out-devices-with-no-capabilities.patch +# Part of Firefox 132 +# https://phabricator.services.mozilla.com/D219062 +Patch501: pipewire-camera-always-query-information-about-camera-availability.patch +# https://phabricator.services.mozilla.com/D219060 +Patch502: pipewire-camera-always-register-video-input-feedback-for-newly-created-deviceinfo.patch +# https://phabricator.services.mozilla.com/D220895 +Patch503: libwebrtc-pipewire-camera-make-member-variable-with-pipewire-status-updated.patch +# https://phabricator.services.mozilla.com/D219218 +Patch504: pipewire-camera-add-missing-support-for-device-change-notification.patch # PGO/LTO patches Patch600: pgo.patch @@ -604,6 +613,12 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch -P402 -p1 -b .1196777 %patch -P407 -p1 -b .1667096 +%patch -P500 -p1 -b .filter-out-devices-with-no-capabilities +%patch -P501 -p1 -b .always-query-information-about-camera-availability +%patch -P502 -p1 -b .always-register-video-input-feedback-for-newly-created-deviceinfo +%patch -P503 -p1 -b .make-member-variable-with-pipewire-status-updated +%patch -P504 -p1 -b .add-missing-support-for-device-change-notification + # PGO patches %if %{build_with_pgo} %if !%{build_with_clang} @@ -1239,6 +1254,9 @@ fi #--------------------------------------------------------------------- %changelog +* Sun Sep 08 2024 Jan Grulich - 130.0-5 +- PipeWire camera support: backport set of upstream patches + * Fri Sep 6 2024 Martin Stransky - 130.0-4 - Added fix for mzbz#1916038 diff --git a/libwebrtc-pipewire-camera-make-member-variable-with-pipewire-status-updated.patch b/libwebrtc-pipewire-camera-make-member-variable-with-pipewire-status-updated.patch new file mode 100644 index 0000000..9674402 --- /dev/null +++ b/libwebrtc-pipewire-camera-make-member-variable-with-pipewire-status-updated.patch @@ -0,0 +1,16 @@ +diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc +--- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc ++++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc +@@ -413,10 +413,12 @@ + }); + that->nodes_.erase(it, that->nodes_.end()); + } + + void PipeWireSession::Finish(VideoCaptureOptions::Status status) { ++ status_ = status; ++ + webrtc::MutexLock lock(&callback_lock_); + + if (callback_) { + callback_->OnInitialized(status); + callback_ = nullptr; diff --git a/pipewire-camera-add-missing-support-for-device-change-notification.patch b/pipewire-camera-add-missing-support-for-device-change-notification.patch new file mode 100644 index 0000000..9491731 --- /dev/null +++ b/pipewire-camera-add-missing-support-for-device-change-notification.patch @@ -0,0 +1,173 @@ +diff --git a/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc b/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc +index db2a3c7..a0607b4 100644 +--- a/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc ++++ b/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc +@@ -29,13 +29,19 @@ + namespace webrtc { + namespace videocapturemodule { + DeviceInfoPipeWire::DeviceInfoPipeWire(VideoCaptureOptions* options) +- : DeviceInfoImpl(), pipewire_session_(options->pipewire_session()) {} ++ : DeviceInfoImpl(), pipewire_session_(options->pipewire_session()) { ++ const bool ret = pipewire_session_->RegisterDeviceInfo(this); ++ RTC_CHECK(ret); ++} + + int32_t DeviceInfoPipeWire::Init() { + return 0; + } + +-DeviceInfoPipeWire::~DeviceInfoPipeWire() = default; ++DeviceInfoPipeWire::~DeviceInfoPipeWire() { ++ const bool ret = pipewire_session_->DeRegisterDeviceInfo(this); ++ RTC_CHECK(ret); ++} + + uint32_t DeviceInfoPipeWire::NumberOfDevices() { + RTC_CHECK(pipewire_session_); +diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc +index ac12d04..0b78c16 100644 +--- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc ++++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc +@@ -9,6 +9,7 @@ + */ + + #include "modules/video_capture/linux/pipewire_session.h" ++#include "modules/video_capture/linux/device_info_pipewire.h" + + #include + #include +@@ -274,6 +275,28 @@ void PipeWireSession::InitPipeWire(int fd) { + Finish(VideoCaptureOptions::Status::ERROR); + } + ++bool PipeWireSession::RegisterDeviceInfo(DeviceInfoPipeWire* device_info) { ++ RTC_CHECK(device_info); ++ MutexLock lock(&device_info_lock_); ++ auto it = std::find(device_info_list_.begin(), device_info_list_.end(), device_info); ++ if (it == device_info_list_.end()) { ++ device_info_list_.push_back(device_info); ++ return true; ++ } ++ return false; ++} ++ ++bool PipeWireSession::DeRegisterDeviceInfo(DeviceInfoPipeWire* device_info) { ++ RTC_CHECK(device_info); ++ MutexLock lock(&device_info_lock_); ++ auto it = std::find(device_info_list_.begin(), device_info_list_.end(), device_info); ++ if (it != device_info_list_.end()) { ++ device_info_list_.erase(it); ++ return true; ++ } ++ return false; ++} ++ + bool PipeWireSession::StartPipeWire(int fd) { + pw_init(/*argc=*/nullptr, /*argv=*/nullptr); + +@@ -344,6 +367,21 @@ void PipeWireSession::PipeWireSync() { + sync_seq_ = pw_core_sync(pw_core_, PW_ID_CORE, sync_seq_); + } + ++void PipeWireSession::NotifyDeviceChange() { ++ RTC_LOG(LS_INFO) << "Notify about device list changes"; ++ MutexLock lock(&device_info_lock_); ++ ++ // It makes sense to notify about device changes only once we are ++ // properly initialized. ++ if (status_ != VideoCaptureOptions::Status::SUCCESS) { ++ return; ++ } ++ ++ for (auto* deviceInfo : device_info_list_) { ++ deviceInfo->DeviceChange(); ++ } ++} ++ + // static + void PipeWireSession::OnCoreError(void* data, + uint32_t id, +@@ -401,6 +439,8 @@ void PipeWireSession::OnRegistryGlobal(void* data, + + that->nodes_.push_back(PipeWireNode::Create(that, id, props)); + that->PipeWireSync(); ++ ++ that->NotifyDeviceChange(); + } + + // static +@@ -412,10 +452,15 @@ void PipeWireSession::OnRegistryGlobalRemove(void* data, uint32_t id) { + return node->id() == id; + }); + that->nodes_.erase(it, that->nodes_.end()); ++ ++ that->NotifyDeviceChange(); + } + + void PipeWireSession::Finish(VideoCaptureOptions::Status status) { +- status_ = status; ++ { ++ MutexLock lock(&device_info_lock_); ++ status_ = status; ++ } + + webrtc::MutexLock lock(&callback_lock_); + +diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h +index 84273ea..1f3a006 100644 +--- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h ++++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h +@@ -29,6 +29,7 @@ + namespace webrtc { + namespace videocapturemodule { + ++class DeviceInfoPipeWire; + class PipeWireSession; + class VideoCaptureModulePipeWire; + +@@ -97,6 +98,21 @@ class PipeWireSession : public rtc::RefCountedNonVirtual { + + void Init(VideoCaptureOptions::Callback* callback, + int fd = kInvalidPipeWireFd); ++ ++ // [De]Register DeviceInfo for device change updates ++ // These methods will add or remove references to DeviceInfo ++ // objects that we want to notify about device changes. ++ // NOTE: We do not take ownership of these objects and ++ // they should never be released by us. All the instances ++ // of DeviceInfoPipeWire must outlive their registration. ++ ++ // Returns true when DeviceInfo was successfuly registered ++ // or false otherwise, when it was already registered before. ++ bool RegisterDeviceInfo(DeviceInfoPipeWire* device_info); ++ // Returns true when DeviceInfo was successfuly unregistered ++ // or false otherwise, when it was not previously registered. ++ bool DeRegisterDeviceInfo(DeviceInfoPipeWire* device_info); ++ + const std::deque& nodes() const { + return nodes_; + } +@@ -111,6 +127,8 @@ class PipeWireSession : public rtc::RefCountedNonVirtual { + void StopPipeWire(); + void PipeWireSync(); + ++ void NotifyDeviceChange(); ++ + static void OnCoreError(void* data, + uint32_t id, + int seq, +@@ -133,7 +151,13 @@ class PipeWireSession : public rtc::RefCountedNonVirtual { + VideoCaptureOptions::Callback* callback_ RTC_GUARDED_BY(&callback_lock_) = + nullptr; + +- VideoCaptureOptions::Status status_; ++ webrtc::Mutex device_info_lock_; ++ std::vector device_info_list_ ++ RTC_GUARDED_BY(device_info_lock_); ++ // Guard with device_info_lock, because currently it's the only place where ++ // we use this status information. ++ VideoCaptureOptions::Status status_ ++ RTC_GUARDED_BY(device_info_lock_); + + struct pw_thread_loop* pw_main_loop_ = nullptr; + struct pw_context* pw_context_ = nullptr; diff --git a/pipewire-camera-always-query-information-about-camera-availability.patch b/pipewire-camera-always-query-information-about-camera-availability.patch new file mode 100644 index 0000000..de67cfd --- /dev/null +++ b/pipewire-camera-always-query-information-about-camera-availability.patch @@ -0,0 +1,42 @@ +diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp +--- a/dom/media/MediaManager.cpp ++++ b/dom/media/MediaManager.cpp +@@ -2151,13 +2151,19 @@ + deviceAccessPromise = backgroundChild->SendRequestCameraAccess( + aParams.mFlags.contains(EnumerationFlag::AllowPermissionRequest)); + } + + if (!deviceAccessPromise) { +- // No device access request needed. Proceed directly. +- deviceAccessPromise = +- NativePromise::CreateAndResolve(CamerasAccessStatus::Granted, __func__); ++ // No device access request needed. We can proceed directly, but we still ++ // need to update camera availability, because the camera engine is always ++ // created together with the WebRTC backend, which is done because ++ // devicechange events must work before prompting in cases where persistent ++ // permission has already been given. Making a request to camera access not ++ // allowing a permission request does exactly what we need in this case. ++ ipc::PBackgroundChild* backgroundChild = ++ ipc::BackgroundChild::GetOrCreateForCurrentThread(); ++ deviceAccessPromise = backgroundChild->SendRequestCameraAccess(false); + } + + return deviceAccessPromise->Then( + GetCurrentSerialEventTarget(), __func__, + [this, self = RefPtr(this), aParams = std::move(aParams)]( +@@ -2188,12 +2194,13 @@ + MakeRefPtr(MediaMgrError::Name::NotAllowedError), + "MaybeRequestPermissionAndEnumerateRawDevices: camera access " + "rejected"); + } + +- if (aParams.mFlags.contains(EnumerationFlag::AllowPermissionRequest)) { +- MOZ_ASSERT(aValue.ResolveValue() == CamerasAccessStatus::Granted); ++ if (aParams.VideoInputType() == MediaSourceEnum::Camera && ++ aParams.mFlags.contains(EnumerationFlag::AllowPermissionRequest) && ++ aValue.ResolveValue() == CamerasAccessStatus::Granted) { + EnsureNoPlaceholdersInDeviceCache(); + } + + // We have to nest this, unfortunately, since we have no guarantees that + // mMediaThread is alive. If we'd reject due to shutdown above, and have diff --git a/pipewire-camera-always-register-video-input-feedback-for-newly-created-deviceinfo.patch b/pipewire-camera-always-register-video-input-feedback-for-newly-created-deviceinfo.patch new file mode 100644 index 0000000..3c47a11 --- /dev/null +++ b/pipewire-camera-always-register-video-input-feedback-for-newly-created-deviceinfo.patch @@ -0,0 +1,306 @@ +diff --git a/dom/media/systemservices/CamerasParent.h b/dom/media/systemservices/CamerasParent.h +--- a/dom/media/systemservices/CamerasParent.h ++++ b/dom/media/systemservices/CamerasParent.h +@@ -142,10 +142,15 @@ + int ReleaseCapture(const CaptureEngine& aCapEngine, int aCaptureId); + + // VideoInputFeedBack + void OnDeviceChange() override; + ++ // Creates a new DeviceInfo or returns an existing DeviceInfo for given ++ // capture engine. Returns a nullptr in case capture engine failed to be ++ // initialized. Video capture thread only. ++ std::shared_ptr GetDeviceInfo( ++ int aEngine); + VideoEngine* EnsureInitialized(int aEngine); + + // Stops any ongoing capturing and releases resources. Called on + // mVideoCaptureThread. Idempotent. + void CloseEngines(); +diff --git a/dom/media/systemservices/CamerasParent.cpp b/dom/media/systemservices/CamerasParent.cpp +--- a/dom/media/systemservices/CamerasParent.cpp ++++ b/dom/media/systemservices/CamerasParent.cpp +@@ -403,19 +403,29 @@ + LOG("Forcing shutdown of engine %d, capturer %d", capEngine, streamNum); + StopCapture(capEngine, streamNum); + Unused << ReleaseCapture(capEngine, streamNum); + } + +- if (VideoEngine* engine = mEngines->ElementAt(CameraEngine); engine) { +- auto device_info = engine->GetOrCreateVideoCaptureDeviceInfo(); +- MOZ_ASSERT(device_info); +- if (device_info) { +- device_info->DeRegisterVideoInputFeedBack(this); +- } ++ auto device_info = GetDeviceInfo(CameraEngine); ++ MOZ_ASSERT(device_info); ++ if (device_info) { ++ device_info->DeRegisterVideoInputFeedBack(this); + } + } + ++std::shared_ptr ++CamerasParent::GetDeviceInfo(int aEngine) { ++ MOZ_ASSERT(mVideoCaptureThread->IsOnCurrentThread()); ++ LOG_VERBOSE("CamerasParent(%p)::%s", this, __func__); ++ ++ auto* engine = EnsureInitialized(aEngine); ++ if (!engine) { ++ return nullptr; ++ } ++ return engine->GetOrCreateVideoCaptureDeviceInfo(this); ++} ++ + VideoEngine* CamerasParent::EnsureInitialized(int aEngine) { + MOZ_ASSERT(mVideoCaptureThread->IsOnCurrentThread()); + LOG_VERBOSE("CamerasParent(%p)::%s", this, __func__); + CaptureEngine capEngine = static_cast(aEngine); + +@@ -447,18 +457,10 @@ + if (!engine) { + LOG("VideoEngine::Create failed"); + return nullptr; + } + +- if (capEngine == CameraEngine) { +- auto device_info = engine->GetOrCreateVideoCaptureDeviceInfo(); +- MOZ_ASSERT(device_info); +- if (device_info) { +- device_info->RegisterVideoInputFeedBack(this); +- } +- } +- + return mEngines->ElementAt(capEngine) = std::move(engine); + } + + // Dispatch the runnable to do the camera operation on the + // specific Cameras thread, preventing us from blocking, and +@@ -472,23 +474,20 @@ + + LOG_FUNCTION(); + LOG("CaptureEngine=%d", aCapEngine); + + using Promise = MozPromise; +- InvokeAsync( +- mVideoCaptureThread, __func__, +- [this, self = RefPtr(this), aCapEngine] { +- int num = -1; +- if (auto* engine = EnsureInitialized(aCapEngine)) { +- if (auto devInfo = engine->GetOrCreateVideoCaptureDeviceInfo()) { +- num = static_cast(devInfo->NumberOfDevices()); +- } +- } ++ InvokeAsync(mVideoCaptureThread, __func__, ++ [this, self = RefPtr(this), aCapEngine] { ++ int num = -1; ++ if (auto devInfo = GetDeviceInfo(aCapEngine)) { ++ num = static_cast(devInfo->NumberOfDevices()); ++ } + +- return Promise::CreateAndResolve( +- num, "CamerasParent::RecvNumberOfCaptureDevices"); +- }) ++ return Promise::CreateAndResolve( ++ num, "CamerasParent::RecvNumberOfCaptureDevices"); ++ }) + ->Then( + mPBackgroundEventTarget, __func__, + [this, self = RefPtr(this)](Promise::ResolveOrRejectValue&& aValue) { + int nrDevices = aValue.ResolveValue(); + +@@ -556,14 +555,12 @@ + using Promise = MozPromise; + InvokeAsync( + mVideoCaptureThread, __func__, + [this, self = RefPtr(this), id = nsCString(aUniqueId), aCapEngine]() { + int num = -1; +- if (auto* engine = EnsureInitialized(aCapEngine)) { +- if (auto devInfo = engine->GetOrCreateVideoCaptureDeviceInfo()) { +- num = devInfo->NumberOfCapabilities(id.get()); +- } ++ if (auto devInfo = GetDeviceInfo(aCapEngine)) { ++ num = devInfo->NumberOfCapabilities(id.get()); + } + return Promise::CreateAndResolve( + num, "CamerasParent::RecvNumberOfCapabilities"); + }) + ->Then( +@@ -597,40 +594,38 @@ + LOG_FUNCTION(); + LOG("RecvGetCaptureCapability: %s %d", PromiseFlatCString(aUniqueId).get(), + aIndex); + + using Promise = MozPromise; +- InvokeAsync( +- mVideoCaptureThread, __func__, +- [this, self = RefPtr(this), id = nsCString(aUniqueId), aCapEngine, +- aIndex] { +- webrtc::VideoCaptureCapability webrtcCaps; +- int error = -1; +- if (auto* engine = EnsureInitialized(aCapEngine)) { +- if (auto devInfo = engine->GetOrCreateVideoCaptureDeviceInfo()) { +- error = devInfo->GetCapability(id.get(), aIndex, webrtcCaps); +- } +- } ++ InvokeAsync(mVideoCaptureThread, __func__, ++ [this, self = RefPtr(this), id = nsCString(aUniqueId), aCapEngine, ++ aIndex] { ++ webrtc::VideoCaptureCapability webrtcCaps; ++ int error = -1; ++ if (auto devInfo = GetDeviceInfo(aCapEngine)) { ++ error = devInfo->GetCapability(id.get(), aIndex, webrtcCaps); ++ } + +- if (!error && aCapEngine == CameraEngine) { +- auto iter = mAllCandidateCapabilities.find(id); +- if (iter == mAllCandidateCapabilities.end()) { +- std::map +- candidateCapabilities; +- candidateCapabilities.emplace(aIndex, webrtcCaps); +- mAllCandidateCapabilities.emplace(id, candidateCapabilities); +- } else { +- (iter->second).emplace(aIndex, webrtcCaps); +- } +- } +- if (error) { +- return Promise::CreateAndReject( +- error, "CamerasParent::RecvGetCaptureCapability"); +- } +- return Promise::CreateAndResolve( +- webrtcCaps, "CamerasParent::RecvGetCaptureCapability"); +- }) ++ if (!error && aCapEngine == CameraEngine) { ++ auto iter = mAllCandidateCapabilities.find(id); ++ if (iter == mAllCandidateCapabilities.end()) { ++ std::map ++ candidateCapabilities; ++ candidateCapabilities.emplace(aIndex, webrtcCaps); ++ mAllCandidateCapabilities.emplace(id, ++ candidateCapabilities); ++ } else { ++ (iter->second).emplace(aIndex, webrtcCaps); ++ } ++ } ++ if (error) { ++ return Promise::CreateAndReject( ++ error, "CamerasParent::RecvGetCaptureCapability"); ++ } ++ return Promise::CreateAndResolve( ++ webrtcCaps, "CamerasParent::RecvGetCaptureCapability"); ++ }) + ->Then( + mPBackgroundEventTarget, __func__, + [this, self = RefPtr(this)](Promise::ResolveOrRejectValue&& aValue) { + if (mDestroyed) { + LOG("RecvGetCaptureCapability: child not alive"); +@@ -662,37 +657,36 @@ + + LOG_FUNCTION(); + + using Data = std::tuple; + using Promise = MozPromise; +- InvokeAsync( +- mVideoCaptureThread, __func__, +- [this, self = RefPtr(this), aCapEngine, aDeviceIndex] { +- char deviceName[MediaEngineSource::kMaxDeviceNameLength]; +- char deviceUniqueId[MediaEngineSource::kMaxUniqueIdLength]; +- nsCString name; +- nsCString uniqueId; +- pid_t devicePid = 0; +- bool placeholder = false; +- int error = -1; +- if (auto* engine = EnsureInitialized(aCapEngine)) { +- if (auto devInfo = engine->GetOrCreateVideoCaptureDeviceInfo()) { +- error = devInfo->GetDeviceName( +- aDeviceIndex, deviceName, sizeof(deviceName), deviceUniqueId, +- sizeof(deviceUniqueId), nullptr, 0, &devicePid, &placeholder); +- } +- } +- if (error == 0) { +- name.Assign(deviceName); +- uniqueId.Assign(deviceUniqueId); +- } ++ InvokeAsync(mVideoCaptureThread, __func__, ++ [this, self = RefPtr(this), aCapEngine, aDeviceIndex] { ++ char deviceName[MediaEngineSource::kMaxDeviceNameLength]; ++ char deviceUniqueId[MediaEngineSource::kMaxUniqueIdLength]; ++ nsCString name; ++ nsCString uniqueId; ++ pid_t devicePid = 0; ++ bool placeholder = false; ++ int error = -1; ++ if (auto devInfo = GetDeviceInfo(aCapEngine)) { ++ error = devInfo->GetDeviceName( ++ aDeviceIndex, deviceName, sizeof(deviceName), ++ deviceUniqueId, sizeof(deviceUniqueId), nullptr, 0, ++ &devicePid, &placeholder); ++ } + +- return Promise::CreateAndResolve( +- std::make_tuple(std::move(name), std::move(uniqueId), devicePid, +- placeholder, error), +- "CamerasParent::RecvGetCaptureDevice"); +- }) ++ if (error == 0) { ++ name.Assign(deviceName); ++ uniqueId.Assign(deviceUniqueId); ++ } ++ ++ return Promise::CreateAndResolve( ++ std::make_tuple(std::move(name), std::move(uniqueId), ++ devicePid, placeholder, error), ++ "CamerasParent::RecvGetCaptureDevice"); ++ }) + ->Then( + mPBackgroundEventTarget, __func__, + [this, self = RefPtr(this)](Promise::ResolveOrRejectValue&& aValue) { + const auto& [name, uniqueId, devicePid, placeholder, error] = + aValue.ResolveValue(); +diff --git a/dom/media/systemservices/VideoEngine.h b/dom/media/systemservices/VideoEngine.h +--- a/dom/media/systemservices/VideoEngine.h ++++ b/dom/media/systemservices/VideoEngine.h +@@ -63,11 +63,11 @@ + * @return on failure the shared_ptr will be null, otherwise it will contain + * a DeviceInfo. + * @see bug 1305212 https://bugzilla.mozilla.org/show_bug.cgi?id=1305212 + */ + std::shared_ptr +- GetOrCreateVideoCaptureDeviceInfo(); ++ GetOrCreateVideoCaptureDeviceInfo(webrtc::VideoInputFeedBack* callBack); + + /** + * Destroys existing DeviceInfo. + * The DeviceInfo will be recreated the next time it is needed. + */ +diff --git a/dom/media/systemservices/VideoEngine.cpp b/dom/media/systemservices/VideoEngine.cpp +--- a/dom/media/systemservices/VideoEngine.cpp ++++ b/dom/media/systemservices/VideoEngine.cpp +@@ -111,11 +111,12 @@ + mIdMap.erase(aId); + return found ? 0 : (-1); + } + + std::shared_ptr +-VideoEngine::GetOrCreateVideoCaptureDeviceInfo() { ++VideoEngine::GetOrCreateVideoCaptureDeviceInfo( ++ webrtc::VideoInputFeedBack* callBack) { + LOG(("%s", __PRETTY_FUNCTION__)); + webrtc::Timestamp currentTime = webrtc::Timestamp::Micros(0); + + const char* capDevTypeName = EnumValueToString(mCaptureDevType); + +@@ -154,10 +155,14 @@ + } + #endif + + mDeviceInfo = mVideoCaptureFactory->CreateDeviceInfo(mId, mCaptureDevType); + ++ if (mDeviceInfo && mCaptureDevType == CaptureDeviceType::Camera) { ++ mDeviceInfo->RegisterVideoInputFeedBack(callBack); ++ } ++ + LOG(("EXIT %s", __PRETTY_FUNCTION__)); + return mDeviceInfo; + } + + void VideoEngine::ClearVideoCaptureDeviceInfo() { From 6e089051d3daaaea77ced4a20e6e94ee3d46c5ab Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 18 Sep 2024 10:44:30 +0200 Subject: [PATCH 391/545] Update to 130.0.1 --- .gitignore | 2 + D221275.1725700750.diff | 2127 --------------------------------------- firefox.spec | 13 +- sources | 4 +- wasi.patch | 2 +- 5 files changed, 11 insertions(+), 2137 deletions(-) delete mode 100644 D221275.1725700750.diff diff --git a/.gitignore b/.gitignore index 5e59402..b323ef9 100644 --- a/.gitignore +++ b/.gitignore @@ -656,3 +656,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-129.0.2-20240820.tar.xz /firefox-langpacks-130.0-20240828.tar.xz /firefox-130.0.source.tar.xz +/firefox-130.0.1.source.tar.xz +/firefox-langpacks-130.0.1-20240918.tar.xz diff --git a/D221275.1725700750.diff b/D221275.1725700750.diff deleted file mode 100644 index c999a5f..0000000 --- a/D221275.1725700750.diff +++ /dev/null @@ -1,2127 +0,0 @@ -diff --git a/media/libyuv/04_add_missing_volatile.patch b/media/libyuv/04_add_missing_volatile.patch -new file mode 100644 ---- /dev/null -+++ b/media/libyuv/04_add_missing_volatile.patch -@@ -0,0 +1,875 @@ -+diff --git a/include/libyuv/macros_msa.h b/include/libyuv/macros_msa.h -+index 6434a4da0537c..08e8c82927dd0 100644 -+--- a/include/libyuv/macros_msa.h -++++ b/include/libyuv/macros_msa.h -+@@ -20,7 +20,7 @@ -+ ({ \ -+ const uint8_t* psrc_lw_m = (const uint8_t*)(psrc); \ -+ uint32_t val_m; \ -+- asm("lw %[val_m], %[psrc_lw_m] \n" \ -++ asm volatile("lw %[val_m], %[psrc_lw_m] \n" \ -+ : [val_m] "=r"(val_m) \ -+ : [psrc_lw_m] "m"(*psrc_lw_m)); \ -+ val_m; \ -+@@ -31,7 +31,7 @@ -+ ({ \ -+ const uint8_t* psrc_ld_m = (const uint8_t*)(psrc); \ -+ uint64_t val_m = 0; \ -+- asm("ld %[val_m], %[psrc_ld_m] \n" \ -++ asm volatile("ld %[val_m], %[psrc_ld_m] \n" \ -+ : [val_m] "=r"(val_m) \ -+ : [psrc_ld_m] "m"(*psrc_ld_m)); \ -+ val_m; \ -+@@ -55,7 +55,7 @@ -+ ({ \ -+ uint8_t* pdst_sw_m = (uint8_t*)(pdst); /* NOLINT */ \ -+ uint32_t val_m = (val); \ -+- asm("sw %[val_m], %[pdst_sw_m] \n" \ -++ asm volatile("sw %[val_m], %[pdst_sw_m] \n" \ -+ : [pdst_sw_m] "=m"(*pdst_sw_m) \ -+ : [val_m] "r"(val_m)); \ -+ }) -+@@ -65,7 +65,7 @@ -+ ({ \ -+ uint8_t* pdst_sd_m = (uint8_t*)(pdst); /* NOLINT */ \ -+ uint64_t val_m = (val); \ -+- asm("sd %[val_m], %[pdst_sd_m] \n" \ -++ asm volatile("sd %[val_m], %[pdst_sd_m] \n" \ -+ : [pdst_sd_m] "=m"(*pdst_sd_m) \ -+ : [val_m] "r"(val_m)); \ -+ }) -+@@ -86,7 +86,8 @@ -+ uint8_t* psrc_lw_m = (uint8_t*)(psrc); \ -+ uint32_t val_lw_m; \ -+ \ -+- asm("lwr %[val_lw_m], 0(%[psrc_lw_m]) \n\t" \ -++ asm volatile( \ -++ "lwr %[val_lw_m], 0(%[psrc_lw_m]) \n\t" \ -+ "lwl %[val_lw_m], 3(%[psrc_lw_m]) \n\t" \ -+ \ -+ : [val_lw_m] "=&r"(val_lw_m) \ -+@@ -101,7 +102,8 @@ -+ uint8_t* psrc_ld_m = (uint8_t*)(psrc); \ -+ uint64_t val_ld_m = 0; \ -+ \ -+- asm("ldr %[val_ld_m], 0(%[psrc_ld_m]) \n\t" \ -++ asm volatile( \ -++ "ldr %[val_ld_m], 0(%[psrc_ld_m]) \n\t" \ -+ "ldl %[val_ld_m], 7(%[psrc_ld_m]) \n\t" \ -+ \ -+ : [val_ld_m] "=&r"(val_ld_m) \ -+@@ -128,7 +130,7 @@ -+ ({ \ -+ uint8_t* pdst_sw_m = (uint8_t*)(pdst); /* NOLINT */ \ -+ uint32_t val_m = (val); \ -+- asm("usw %[val_m], %[pdst_sw_m] \n" \ -++ asm volatile("usw %[val_m], %[pdst_sw_m] \n" \ -+ : [pdst_sw_m] "=m"(*pdst_sw_m) \ -+ : [val_m] "r"(val_m)); \ -+ }) -+diff --git a/source/row_gcc.cc b/source/row_gcc.cc -+index f8f41860ab7c5..6eb3286b053ad 100644 -+--- a/source/row_gcc.cc -++++ b/source/row_gcc.cc -+@@ -2626,7 +2626,7 @@ void OMITFP I444ToARGBRow_SSSE3(const uint8_t* y_buf, -+ uint8_t* dst_argb, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ "pcmpeqb %%xmm5,%%xmm5 \n" -+@@ -2686,7 +2686,7 @@ void OMITFP I422ToRGB24Row_SSSE3(const uint8_t* y_buf, -+ uint8_t* dst_rgb24, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP(yuvconstants) -+ "movdqa %[kShuffleMaskARGBToRGB24_0],%%xmm5 \n" -+ "movdqa %[kShuffleMaskARGBToRGB24],%%xmm6 \n" -+@@ -2722,7 +2722,7 @@ void OMITFP I444ToRGB24Row_SSSE3(const uint8_t* y_buf, -+ uint8_t* dst_rgb24, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP(yuvconstants) -+ "movdqa %[kShuffleMaskARGBToRGB24_0],%%xmm5 \n" -+ "movdqa %[kShuffleMaskARGBToRGB24],%%xmm6 \n" -+@@ -2758,7 +2758,7 @@ void OMITFP I422ToARGBRow_SSSE3(const uint8_t* y_buf, -+ uint8_t* dst_argb, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ "pcmpeqb %%xmm5,%%xmm5 \n" -+@@ -2787,7 +2787,7 @@ void OMITFP I422ToAR30Row_SSSE3(const uint8_t* y_buf, -+ uint8_t* dst_ar30, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ "pcmpeqb %%xmm5,%%xmm5 \n" // AR30 constants -+@@ -2822,7 +2822,7 @@ void OMITFP I210ToARGBRow_SSSE3(const uint16_t* y_buf, -+ uint8_t* dst_argb, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ "pcmpeqb %%xmm5,%%xmm5 \n" -+@@ -2852,7 +2852,7 @@ void OMITFP I212ToARGBRow_SSSE3(const uint16_t* y_buf, -+ uint8_t* dst_argb, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ "pcmpeqb %%xmm5,%%xmm5 \n" -+@@ -2882,7 +2882,7 @@ void OMITFP I210ToAR30Row_SSSE3(const uint16_t* y_buf, -+ uint8_t* dst_ar30, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ "pcmpeqb %%xmm5,%%xmm5 \n" -+@@ -2917,7 +2917,7 @@ void OMITFP I212ToAR30Row_SSSE3(const uint16_t* y_buf, -+ uint8_t* dst_ar30, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ "pcmpeqb %%xmm5,%%xmm5 \n" -+@@ -2952,7 +2952,7 @@ void OMITFP I410ToARGBRow_SSSE3(const uint16_t* y_buf, -+ uint8_t* dst_argb, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ "pcmpeqb %%xmm5,%%xmm5 \n" -+@@ -3045,7 +3045,7 @@ void OMITFP I410ToAR30Row_SSSE3(const uint16_t* y_buf, -+ uint8_t* dst_ar30, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ "pcmpeqb %%xmm5,%%xmm5 \n" -+@@ -3238,7 +3238,7 @@ void OMITFP P210ToAR30Row_SSSE3(const uint16_t* y_buf, -+ uint8_t* dst_ar30, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP(yuvconstants) -+ "pcmpeqb %%xmm5,%%xmm5 \n" -+ "psrlw $14,%%xmm5 \n" -+@@ -3269,7 +3269,7 @@ void OMITFP P410ToAR30Row_SSSE3(const uint16_t* y_buf, -+ uint8_t* dst_ar30, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP(yuvconstants) -+ "pcmpeqb %%xmm5,%%xmm5 \n" -+ "psrlw $14,%%xmm5 \n" -+@@ -3301,7 +3301,7 @@ void OMITFP I422ToRGBARow_SSSE3(const uint8_t* y_buf, -+ uint8_t* dst_rgba, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ "pcmpeqb %%xmm5,%%xmm5 \n" -+@@ -3712,7 +3712,7 @@ void OMITFP I444ToARGBRow_AVX2(const uint8_t* y_buf, -+ uint8_t* dst_argb, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP_AVX2(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -+@@ -3746,7 +3746,7 @@ void OMITFP I422ToARGBRow_AVX2(const uint8_t* y_buf, -+ uint8_t* dst_argb, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP_AVX2(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -+@@ -3786,7 +3786,7 @@ void OMITFP I422ToARGBRow_AVX512BW(const uint8_t* y_buf, -+ uint8_t* dst_argb, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP_AVX512BW(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ "vpcmpeqb %%xmm5,%%xmm5,%%xmm5 \n" -+@@ -3825,7 +3825,7 @@ void OMITFP I422ToAR30Row_AVX2(const uint8_t* y_buf, -+ uint8_t* dst_ar30, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP_AVX2(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants -+@@ -3865,7 +3865,7 @@ void OMITFP I210ToARGBRow_AVX2(const uint16_t* y_buf, -+ uint8_t* dst_argb, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP_AVX2(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -+@@ -3900,7 +3900,7 @@ void OMITFP I212ToARGBRow_AVX2(const uint16_t* y_buf, -+ uint8_t* dst_argb, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP_AVX2(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -+@@ -3935,7 +3935,7 @@ void OMITFP I210ToAR30Row_AVX2(const uint16_t* y_buf, -+ uint8_t* dst_ar30, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP_AVX2(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants -+@@ -3975,7 +3975,7 @@ void OMITFP I212ToAR30Row_AVX2(const uint16_t* y_buf, -+ uint8_t* dst_ar30, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP_AVX2(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants -+@@ -4015,7 +4015,7 @@ void OMITFP I410ToARGBRow_AVX2(const uint16_t* y_buf, -+ uint8_t* dst_argb, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP_AVX2(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -+@@ -4120,7 +4120,7 @@ void OMITFP I410ToAR30Row_AVX2(const uint16_t* y_buf, -+ uint8_t* dst_ar30, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP_AVX2(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants -+@@ -4228,7 +4228,7 @@ void OMITFP I422ToRGBARow_AVX2(const uint8_t* y_buf, -+ uint8_t* dst_argb, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP_AVX2(yuvconstants) -+ "sub %[u_buf],%[v_buf] \n" -+ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -+@@ -4430,7 +4430,7 @@ void OMITFP P210ToAR30Row_AVX2(const uint16_t* y_buf, -+ uint8_t* dst_ar30, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP_AVX2(yuvconstants) -+ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants -+ "vpsrlw $14,%%ymm5,%%ymm5 \n" -+@@ -4467,7 +4467,7 @@ void OMITFP P410ToAR30Row_AVX2(const uint16_t* y_buf, -+ uint8_t* dst_ar30, -+ const struct YuvConstants* yuvconstants, -+ int width) { -+- asm ( -++ asm volatile ( -+ YUVTORGB_SETUP_AVX2(yuvconstants) -+ "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants -+ "vpsrlw $14,%%ymm5,%%ymm5 \n" -+@@ -5681,7 +5681,7 @@ void MergeXRGBRow_AVX2(const uint8_t* src_r, -+ const uint8_t* src_b, -+ uint8_t* dst_argb, -+ int width) { -+- asm( -++ asm volatile( -+ -+ LABELALIGN -+ "1: \n" -+@@ -7381,7 +7381,7 @@ void ARGBUnattenuateRow_SSE2(const uint8_t* src_argb, -+ uint8_t* dst_argb, -+ int width) { -+ uintptr_t alpha; -+- asm( -++ asm volatile( -+ // 4 pixel loop. -+ LABELALIGN -+ "1: \n" -+@@ -7841,7 +7841,7 @@ void ARGBAddRow_SSE2(const uint8_t* src_argb, -+ const uint8_t* src_argb1, -+ uint8_t* dst_argb, -+ int width) { -+- asm( -++ asm volatile( -+ // 4 pixel loop. -+ LABELALIGN -+ "1: \n" -+@@ -7869,7 +7869,7 @@ void ARGBAddRow_AVX2(const uint8_t* src_argb, -+ const uint8_t* src_argb1, -+ uint8_t* dst_argb, -+ int width) { -+- asm( -++ asm volatile( -+ // 4 pixel loop. -+ LABELALIGN -+ "1: \n" -+@@ -7897,7 +7897,7 @@ void ARGBSubtractRow_SSE2(const uint8_t* src_argb, -+ const uint8_t* src_argb1, -+ uint8_t* dst_argb, -+ int width) { -+- asm( -++ asm volatile( -+ // 4 pixel loop. -+ LABELALIGN -+ "1: \n" -+@@ -7925,7 +7925,7 @@ void ARGBSubtractRow_AVX2(const uint8_t* src_argb, -+ const uint8_t* src_argb1, -+ uint8_t* dst_argb, -+ int width) { -+- asm( -++ asm volatile( -+ // 4 pixel loop. -+ LABELALIGN -+ "1: \n" -+@@ -9099,7 +9099,7 @@ void ARGBColorTableRow_X86(uint8_t* dst_argb, -+ const uint8_t* table_argb, -+ int width) { -+ uintptr_t pixel_temp; -+- asm( -++ asm volatile( -+ // 1 pixel loop. -+ LABELALIGN -+ "1: \n" -+@@ -9132,7 +9132,7 @@ void RGBColorTableRow_X86(uint8_t* dst_argb, -+ const uint8_t* table_argb, -+ int width) { -+ uintptr_t pixel_temp; -+- asm( -++ asm volatile( -+ // 1 pixel loop. -+ LABELALIGN -+ "1: \n" -+diff --git a/source/row_lsx.cc b/source/row_lsx.cc -+index 09f206cab93f2..fa088c9e78a94 100644 -+--- a/source/row_lsx.cc -++++ b/source/row_lsx.cc -+@@ -2805,7 +2805,8 @@ static void ARGBToYMatrixRow_LSX(const uint8_t* src_argb, -+ uint8_t* dst_y, -+ int width, -+ const struct RgbConstants* rgbconstants) { -+- asm("vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants -++ asm volatile( -++ "vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants -+ "vldrepl.b $vr1, %3, 1 \n\t" // load rgbconstants -+ "vldrepl.b $vr2, %3, 2 \n\t" // load rgbconstants -+ "vldrepl.h $vr3, %3, 4 \n\t" // load rgbconstants -+@@ -2863,7 +2864,8 @@ static void RGBAToYMatrixRow_LSX(const uint8_t* src_rgba, -+ uint8_t* dst_y, -+ int width, -+ const struct RgbConstants* rgbconstants) { -+- asm("vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants -++ asm volatile( -++ "vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants -+ "vldrepl.b $vr1, %3, 1 \n\t" // load rgbconstants -+ "vldrepl.b $vr2, %3, 2 \n\t" // load rgbconstants -+ "vldrepl.h $vr3, %3, 4 \n\t" // load rgbconstants -+@@ -2920,7 +2922,8 @@ static void RGBToYMatrixRow_LSX(const uint8_t* src_rgba, -+ 7, 9, 10, 12, 13, 15, 1, 0, 4, 0, 7, 0, 10, -+ 0, 13, 0, 16, 0, 19, 0, 22, 0, 25, 0, 28, 0, -+ 31, 0, 2, 0, 5, 0, 8, 0, 11, 0, 14, 0}; -+- asm("vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants -++ asm volatile( -++ "vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants -+ "vldrepl.b $vr1, %3, 1 \n\t" // load rgbconstants -+ "vldrepl.b $vr2, %3, 2 \n\t" // load rgbconstants -+ "vldrepl.h $vr3, %3, 4 \n\t" // load rgbconstants -+diff --git a/source/scale_gcc.cc b/source/scale_gcc.cc -+index 9dfe64a931808..7556bcb4c1d62 100644 -+--- a/source/scale_gcc.cc -++++ b/source/scale_gcc.cc -+@@ -97,7 +97,7 @@ void ScaleRowDown2_SSSE3(const uint8_t* src_ptr, -+ uint8_t* dst_ptr, -+ int dst_width) { -+ (void)src_stride; -+- asm( -++ asm volatile( -+ // 16 pixel loop. -+ LABELALIGN -+ "1: \n" -+@@ -123,7 +123,7 @@ void ScaleRowDown2Linear_SSSE3(const uint8_t* src_ptr, -+ uint8_t* dst_ptr, -+ int dst_width) { -+ (void)src_stride; -+- asm("pcmpeqb %%xmm4,%%xmm4 \n" -++ asm volatile("pcmpeqb %%xmm4,%%xmm4 \n" -+ "psrlw $0xf,%%xmm4 \n" -+ "packuswb %%xmm4,%%xmm4 \n" -+ "pxor %%xmm5,%%xmm5 \n" -+@@ -153,7 +153,7 @@ void ScaleRowDown2Box_SSSE3(const uint8_t* src_ptr, -+ ptrdiff_t src_stride, -+ uint8_t* dst_ptr, -+ int dst_width) { -+- asm("pcmpeqb %%xmm4,%%xmm4 \n" -++ asm volatile("pcmpeqb %%xmm4,%%xmm4 \n" -+ "psrlw $0xf,%%xmm4 \n" -+ "packuswb %%xmm4,%%xmm4 \n" -+ "pxor %%xmm5,%%xmm5 \n" -+@@ -219,7 +219,7 @@ void ScaleRowDown2Linear_AVX2(const uint8_t* src_ptr, -+ uint8_t* dst_ptr, -+ int dst_width) { -+ (void)src_stride; -+- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" -++ asm volatile("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" -+ "vpsrlw $0xf,%%ymm4,%%ymm4 \n" -+ "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" -+ "vpxor %%ymm5,%%ymm5,%%ymm5 \n" -+@@ -251,7 +251,7 @@ void ScaleRowDown2Box_AVX2(const uint8_t* src_ptr, -+ ptrdiff_t src_stride, -+ uint8_t* dst_ptr, -+ int dst_width) { -+- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" -++ asm volatile("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" -+ "vpsrlw $0xf,%%ymm4,%%ymm4 \n" -+ "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" -+ "vpxor %%ymm5,%%ymm5,%%ymm5 \n" -+@@ -293,7 +293,7 @@ void ScaleRowDown4_SSSE3(const uint8_t* src_ptr, -+ uint8_t* dst_ptr, -+ int dst_width) { -+ (void)src_stride; -+- asm("pcmpeqb %%xmm5,%%xmm5 \n" -++ asm volatile("pcmpeqb %%xmm5,%%xmm5 \n" -+ "psrld $0x18,%%xmm5 \n" -+ "pslld $0x10,%%xmm5 \n" -+ -+@@ -323,7 +323,7 @@ void ScaleRowDown4Box_SSSE3(const uint8_t* src_ptr, -+ uint8_t* dst_ptr, -+ int dst_width) { -+ intptr_t stridex3; -+- asm("pcmpeqb %%xmm4,%%xmm4 \n" -++ asm volatile("pcmpeqb %%xmm4,%%xmm4 \n" -+ "psrlw $0xf,%%xmm4 \n" -+ "movdqa %%xmm4,%%xmm5 \n" -+ "packuswb %%xmm4,%%xmm4 \n" -+@@ -377,7 +377,7 @@ void ScaleRowDown4_AVX2(const uint8_t* src_ptr, -+ uint8_t* dst_ptr, -+ int dst_width) { -+ (void)src_stride; -+- asm("vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -++ asm volatile("vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -+ "vpsrld $0x18,%%ymm5,%%ymm5 \n" -+ "vpslld $0x10,%%ymm5,%%ymm5 \n" -+ -+@@ -409,7 +409,7 @@ void ScaleRowDown4Box_AVX2(const uint8_t* src_ptr, -+ ptrdiff_t src_stride, -+ uint8_t* dst_ptr, -+ int dst_width) { -+- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" -++ asm volatile("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" -+ "vpsrlw $0xf,%%ymm4,%%ymm4 \n" -+ "vpsllw $0x3,%%ymm4,%%ymm5 \n" -+ "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" -+@@ -464,7 +464,7 @@ void ScaleRowDown34_SSSE3(const uint8_t* src_ptr, -+ uint8_t* dst_ptr, -+ int dst_width) { -+ (void)src_stride; -+- asm("movdqa %0,%%xmm3 \n" -++ asm volatile("movdqa %0,%%xmm3 \n" -+ "movdqa %1,%%xmm4 \n" -+ "movdqa %2,%%xmm5 \n" -+ : -+@@ -499,7 +499,7 @@ void ScaleRowDown34_1_Box_SSSE3(const uint8_t* src_ptr, -+ ptrdiff_t src_stride, -+ uint8_t* dst_ptr, -+ int dst_width) { -+- asm("movdqa %0,%%xmm2 \n" // kShuf01 -++ asm volatile("movdqa %0,%%xmm2 \n" // kShuf01 -+ "movdqa %1,%%xmm3 \n" // kShuf11 -+ "movdqa %2,%%xmm4 \n" // kShuf21 -+ : -+@@ -507,7 +507,7 @@ void ScaleRowDown34_1_Box_SSSE3(const uint8_t* src_ptr, -+ "m"(kShuf11), // %1 -+ "m"(kShuf21) // %2 -+ ); -+- asm("movdqa %0,%%xmm5 \n" // kMadd01 -++ asm volatile("movdqa %0,%%xmm5 \n" // kMadd01 -+ "movdqa %1,%%xmm0 \n" // kMadd11 -+ "movdqa %2,%%xmm1 \n" // kRound34 -+ : -+@@ -561,7 +561,7 @@ void ScaleRowDown34_0_Box_SSSE3(const uint8_t* src_ptr, -+ ptrdiff_t src_stride, -+ uint8_t* dst_ptr, -+ int dst_width) { -+- asm("movdqa %0,%%xmm2 \n" // kShuf01 -++ asm volatile("movdqa %0,%%xmm2 \n" // kShuf01 -+ "movdqa %1,%%xmm3 \n" // kShuf11 -+ "movdqa %2,%%xmm4 \n" // kShuf21 -+ : -+@@ -569,7 +569,7 @@ void ScaleRowDown34_0_Box_SSSE3(const uint8_t* src_ptr, -+ "m"(kShuf11), // %1 -+ "m"(kShuf21) // %2 -+ ); -+- asm("movdqa %0,%%xmm5 \n" // kMadd01 -++ asm volatile("movdqa %0,%%xmm5 \n" // kMadd01 -+ "movdqa %1,%%xmm0 \n" // kMadd11 -+ "movdqa %2,%%xmm1 \n" // kRound34 -+ : -+@@ -628,7 +628,7 @@ void ScaleRowDown38_SSSE3(const uint8_t* src_ptr, -+ uint8_t* dst_ptr, -+ int dst_width) { -+ (void)src_stride; -+- asm("movdqa %3,%%xmm4 \n" -++ asm volatile("movdqa %3,%%xmm4 \n" -+ "movdqa %4,%%xmm5 \n" -+ -+ LABELALIGN -+@@ -657,7 +657,7 @@ void ScaleRowDown38_2_Box_SSSE3(const uint8_t* src_ptr, -+ ptrdiff_t src_stride, -+ uint8_t* dst_ptr, -+ int dst_width) { -+- asm("movdqa %0,%%xmm2 \n" -++ asm volatile("movdqa %0,%%xmm2 \n" -+ "movdqa %1,%%xmm3 \n" -+ "movdqa %2,%%xmm4 \n" -+ "movdqa %3,%%xmm5 \n" -+@@ -699,7 +699,7 @@ void ScaleRowDown38_3_Box_SSSE3(const uint8_t* src_ptr, -+ ptrdiff_t src_stride, -+ uint8_t* dst_ptr, -+ int dst_width) { -+- asm("movdqa %0,%%xmm2 \n" -++ asm volatile("movdqa %0,%%xmm2 \n" -+ "movdqa %1,%%xmm3 \n" -+ "movdqa %2,%%xmm4 \n" -+ "pxor %%xmm5,%%xmm5 \n" -+@@ -766,7 +766,7 @@ static const uvec8 kLinearMadd31 = {3, 1, 1, 3, 3, 1, 1, 3, -+ void ScaleRowUp2_Linear_SSE2(const uint8_t* src_ptr, -+ uint8_t* dst_ptr, -+ int dst_width) { -+- asm("pxor %%xmm0,%%xmm0 \n" // 0 -++ asm volatile("pxor %%xmm0,%%xmm0 \n" // 0 -+ "pcmpeqw %%xmm6,%%xmm6 \n" -+ "psrlw $15,%%xmm6 \n" -+ "psllw $1,%%xmm6 \n" // all 2 -+@@ -934,7 +934,7 @@ void ScaleRowUp2_Bilinear_SSE2(const uint8_t* src_ptr, -+ void ScaleRowUp2_Linear_12_SSSE3(const uint16_t* src_ptr, -+ uint16_t* dst_ptr, -+ int dst_width) { -+- asm("movdqa %3,%%xmm5 \n" -++ asm volatile("movdqa %3,%%xmm5 \n" -+ "pcmpeqw %%xmm4,%%xmm4 \n" -+ "psrlw $15,%%xmm4 \n" -+ "psllw $1,%%xmm4 \n" // all 2 -+@@ -985,7 +985,7 @@ void ScaleRowUp2_Bilinear_12_SSSE3(const uint16_t* src_ptr, -+ uint16_t* dst_ptr, -+ ptrdiff_t dst_stride, -+ int dst_width) { -+- asm("pcmpeqw %%xmm7,%%xmm7 \n" -++ asm volatile("pcmpeqw %%xmm7,%%xmm7 \n" -+ "psrlw $15,%%xmm7 \n" -+ "psllw $3,%%xmm7 \n" // all 8 -+ "movdqa %5,%%xmm6 \n" -+@@ -1082,7 +1082,7 @@ void ScaleRowUp2_Bilinear_12_SSSE3(const uint16_t* src_ptr, -+ void ScaleRowUp2_Linear_16_SSE2(const uint16_t* src_ptr, -+ uint16_t* dst_ptr, -+ int dst_width) { -+- asm("pxor %%xmm5,%%xmm5 \n" -++ asm volatile("pxor %%xmm5,%%xmm5 \n" -+ "pcmpeqd %%xmm4,%%xmm4 \n" -+ "psrld $31,%%xmm4 \n" -+ "pslld $1,%%xmm4 \n" // all 2 -+@@ -1134,7 +1134,7 @@ void ScaleRowUp2_Bilinear_16_SSE2(const uint16_t* src_ptr, -+ uint16_t* dst_ptr, -+ ptrdiff_t dst_stride, -+ int dst_width) { -+- asm("pxor %%xmm7,%%xmm7 \n" -++ asm volatile("pxor %%xmm7,%%xmm7 \n" -+ "pcmpeqd %%xmm6,%%xmm6 \n" -+ "psrld $31,%%xmm6 \n" -+ "pslld $3,%%xmm6 \n" // all 8 -+@@ -1241,7 +1241,7 @@ void ScaleRowUp2_Bilinear_16_SSE2(const uint16_t* src_ptr, -+ void ScaleRowUp2_Linear_SSSE3(const uint8_t* src_ptr, -+ uint8_t* dst_ptr, -+ int dst_width) { -+- asm("pcmpeqw %%xmm4,%%xmm4 \n" -++ asm volatile("pcmpeqw %%xmm4,%%xmm4 \n" -+ "psrlw $15,%%xmm4 \n" -+ "psllw $1,%%xmm4 \n" // all 2 -+ "movdqa %3,%%xmm3 \n" -+@@ -1281,7 +1281,7 @@ void ScaleRowUp2_Bilinear_SSSE3(const uint8_t* src_ptr, -+ uint8_t* dst_ptr, -+ ptrdiff_t dst_stride, -+ int dst_width) { -+- asm("pcmpeqw %%xmm6,%%xmm6 \n" -++ asm volatile("pcmpeqw %%xmm6,%%xmm6 \n" -+ "psrlw $15,%%xmm6 \n" -+ "psllw $3,%%xmm6 \n" // all 8 -+ "movdqa %5,%%xmm7 \n" -+@@ -1365,7 +1365,7 @@ void ScaleRowUp2_Bilinear_SSSE3(const uint8_t* src_ptr, -+ void ScaleRowUp2_Linear_AVX2(const uint8_t* src_ptr, -+ uint8_t* dst_ptr, -+ int dst_width) { -+- asm("vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" -++ asm volatile("vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" -+ "vpsrlw $15,%%ymm4,%%ymm4 \n" -+ "vpsllw $1,%%ymm4,%%ymm4 \n" // all 2 -+ "vbroadcastf128 %3,%%ymm3 \n" -+@@ -1408,7 +1408,7 @@ void ScaleRowUp2_Bilinear_AVX2(const uint8_t* src_ptr, -+ uint8_t* dst_ptr, -+ ptrdiff_t dst_stride, -+ int dst_width) { -+- asm("vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" -++ asm volatile("vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" -+ "vpsrlw $15,%%ymm6,%%ymm6 \n" -+ "vpsllw $3,%%ymm6,%%ymm6 \n" // all 8 -+ "vbroadcastf128 %5,%%ymm7 \n" -+@@ -1489,7 +1489,7 @@ void ScaleRowUp2_Bilinear_AVX2(const uint8_t* src_ptr, -+ void ScaleRowUp2_Linear_12_AVX2(const uint16_t* src_ptr, -+ uint16_t* dst_ptr, -+ int dst_width) { -+- asm("vbroadcastf128 %3,%%ymm5 \n" -++ asm volatile("vbroadcastf128 %3,%%ymm5 \n" -+ "vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" -+ "vpsrlw $15,%%ymm4,%%ymm4 \n" -+ "vpsllw $1,%%ymm4,%%ymm4 \n" // all 2 -+@@ -1540,7 +1540,7 @@ void ScaleRowUp2_Bilinear_12_AVX2(const uint16_t* src_ptr, -+ uint16_t* dst_ptr, -+ ptrdiff_t dst_stride, -+ int dst_width) { -+- asm("vbroadcastf128 %5,%%ymm5 \n" -++ asm volatile("vbroadcastf128 %5,%%ymm5 \n" -+ "vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" -+ "vpsrlw $15,%%ymm4,%%ymm4 \n" -+ "vpsllw $3,%%ymm4,%%ymm4 \n" // all 8 -+@@ -1601,7 +1601,7 @@ void ScaleRowUp2_Bilinear_12_AVX2(const uint16_t* src_ptr, -+ void ScaleRowUp2_Linear_16_AVX2(const uint16_t* src_ptr, -+ uint16_t* dst_ptr, -+ int dst_width) { -+- asm("vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" -++ asm volatile("vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" -+ "vpsrld $31,%%ymm4,%%ymm4 \n" -+ "vpslld $1,%%ymm4,%%ymm4 \n" // all 2 -+ -+@@ -1650,7 +1650,7 @@ void ScaleRowUp2_Bilinear_16_AVX2(const uint16_t* src_ptr, -+ uint16_t* dst_ptr, -+ ptrdiff_t dst_stride, -+ int dst_width) { -+- asm("vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" -++ asm volatile("vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" -+ "vpsrld $31,%%ymm6,%%ymm6 \n" -+ "vpslld $3,%%ymm6,%%ymm6 \n" // all 8 -+ -+@@ -1732,7 +1732,7 @@ void ScaleRowUp2_Bilinear_16_AVX2(const uint16_t* src_ptr, -+ void ScaleAddRow_SSE2(const uint8_t* src_ptr, -+ uint16_t* dst_ptr, -+ int src_width) { -+- asm("pxor %%xmm5,%%xmm5 \n" -++ asm volatile("pxor %%xmm5,%%xmm5 \n" -+ -+ // 16 pixel loop. -+ LABELALIGN -+@@ -1763,7 +1763,7 @@ void ScaleAddRow_SSE2(const uint8_t* src_ptr, -+ void ScaleAddRow_AVX2(const uint8_t* src_ptr, -+ uint16_t* dst_ptr, -+ int src_width) { -+- asm("vpxor %%ymm5,%%ymm5,%%ymm5 \n" -++ asm volatile("vpxor %%ymm5,%%ymm5,%%ymm5 \n" -+ -+ LABELALIGN -+ "1: \n" -+@@ -1804,7 +1804,7 @@ void ScaleFilterCols_SSSE3(uint8_t* dst_ptr, -+ int x, -+ int dx) { -+ intptr_t x0, x1, temp_pixel; -+- asm("movd %6,%%xmm2 \n" -++ asm volatile("movd %6,%%xmm2 \n" -+ "movd %7,%%xmm3 \n" -+ "movl $0x04040000,%k2 \n" -+ "movd %k2,%%xmm5 \n" -+@@ -2005,7 +2005,7 @@ void ScaleARGBRowDownEven_SSE2(const uint8_t* src_argb, -+ intptr_t src_stepx_x4 = (intptr_t)(src_stepx); -+ intptr_t src_stepx_x12; -+ (void)src_stride; -+- asm("lea 0x00(,%1,4),%1 \n" -++ asm volatile("lea 0x00(,%1,4),%1 \n" -+ "lea 0x00(%1,%1,2),%4 \n" -+ -+ LABELALIGN -+@@ -2041,7 +2041,7 @@ void ScaleARGBRowDownEvenBox_SSE2(const uint8_t* src_argb, -+ intptr_t src_stepx_x4 = (intptr_t)(src_stepx); -+ intptr_t src_stepx_x12; -+ intptr_t row1 = (intptr_t)(src_stride); -+- asm("lea 0x00(,%1,4),%1 \n" -++ asm volatile("lea 0x00(,%1,4),%1 \n" -+ "lea 0x00(%1,%1,2),%4 \n" -+ "lea 0x00(%0,%5,1),%5 \n" -+ -+@@ -2083,7 +2083,7 @@ void ScaleARGBCols_SSE2(uint8_t* dst_argb, -+ int x, -+ int dx) { -+ intptr_t x0, x1; -+- asm("movd %5,%%xmm2 \n" -++ asm volatile("movd %5,%%xmm2 \n" -+ "movd %6,%%xmm3 \n" -+ "pshufd $0x0,%%xmm2,%%xmm2 \n" -+ "pshufd $0x11,%%xmm3,%%xmm0 \n" -+@@ -2191,14 +2191,14 @@ void ScaleARGBFilterCols_SSSE3(uint8_t* dst_argb, -+ int x, -+ int dx) { -+ intptr_t x0, x1; -+- asm("movdqa %0,%%xmm4 \n" -++ asm volatile("movdqa %0,%%xmm4 \n" -+ "movdqa %1,%%xmm5 \n" -+ : -+ : "m"(kShuffleColARGB), // %0 -+ "m"(kShuffleFractions) // %1 -+ ); -+ -+- asm("movd %5,%%xmm2 \n" -++ asm volatile("movd %5,%%xmm2 \n" -+ "movd %6,%%xmm3 \n" -+ "pcmpeqb %%xmm6,%%xmm6 \n" -+ "psrlw $0x9,%%xmm6 \n" -+@@ -2260,7 +2260,7 @@ void ScaleARGBFilterCols_SSSE3(uint8_t* dst_argb, -+ -+ // Divide num by div and return as 16.16 fixed point result. -+ int FixedDiv_X86(int num, int div) { -+- asm("cdq \n" -++ asm volatile("cdq \n" -+ "shld $0x10,%%eax,%%edx \n" -+ "shl $0x10,%%eax \n" -+ "idiv %1 \n" -+@@ -2273,7 +2273,7 @@ int FixedDiv_X86(int num, int div) { -+ -+ // Divide num - 1 by div - 1 and return as 16.16 fixed point result. -+ int FixedDiv1_X86(int num, int div) { -+- asm("cdq \n" -++ asm volatile("cdq \n" -+ "shld $0x10,%%eax,%%edx \n" -+ "shl $0x10,%%eax \n" -+ "sub $0x10001,%%eax \n" -+@@ -2304,7 +2304,7 @@ void ScaleUVRowDown2Box_SSSE3(const uint8_t* src_ptr, -+ ptrdiff_t src_stride, -+ uint8_t* dst_ptr, -+ int dst_width) { -+- asm("pcmpeqb %%xmm4,%%xmm4 \n" // 01010101 -++ asm volatile("pcmpeqb %%xmm4,%%xmm4 \n" // 01010101 -+ "psrlw $0xf,%%xmm4 \n" -+ "packuswb %%xmm4,%%xmm4 \n" -+ "pxor %%xmm5, %%xmm5 \n" // zero -+@@ -2343,7 +2343,7 @@ void ScaleUVRowDown2Box_AVX2(const uint8_t* src_ptr, -+ ptrdiff_t src_stride, -+ uint8_t* dst_ptr, -+ int dst_width) { -+- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" // 01010101 -++ asm volatile("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" // 01010101 -+ "vpsrlw $0xf,%%ymm4,%%ymm4 \n" -+ "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" -+ "vpxor %%ymm5,%%ymm5,%%ymm5 \n" // zero -+@@ -2386,7 +2386,7 @@ static const uvec8 kUVLinearMadd31 = {3, 1, 3, 1, 1, 3, 1, 3, -+ void ScaleUVRowUp2_Linear_SSSE3(const uint8_t* src_ptr, -+ uint8_t* dst_ptr, -+ int dst_width) { -+- asm("pcmpeqw %%xmm4,%%xmm4 \n" -++ asm volatile("pcmpeqw %%xmm4,%%xmm4 \n" -+ "psrlw $15,%%xmm4 \n" -+ "psllw $1,%%xmm4 \n" // all 2 -+ "movdqa %3,%%xmm3 \n" -+@@ -2426,7 +2426,7 @@ void ScaleUVRowUp2_Bilinear_SSSE3(const uint8_t* src_ptr, -+ uint8_t* dst_ptr, -+ ptrdiff_t dst_stride, -+ int dst_width) { -+- asm("pcmpeqw %%xmm6,%%xmm6 \n" -++ asm volatile("pcmpeqw %%xmm6,%%xmm6 \n" -+ "psrlw $15,%%xmm6 \n" -+ "psllw $3,%%xmm6 \n" // all 8 -+ "movdqa %5,%%xmm7 \n" -+@@ -2509,7 +2509,7 @@ void ScaleUVRowUp2_Bilinear_SSSE3(const uint8_t* src_ptr, -+ void ScaleUVRowUp2_Linear_AVX2(const uint8_t* src_ptr, -+ uint8_t* dst_ptr, -+ int dst_width) { -+- asm("vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" -++ asm volatile("vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" -+ "vpsrlw $15,%%ymm4,%%ymm4 \n" -+ "vpsllw $1,%%ymm4,%%ymm4 \n" // all 2 -+ "vbroadcastf128 %3,%%ymm3 \n" -+@@ -2551,7 +2551,7 @@ void ScaleUVRowUp2_Bilinear_AVX2(const uint8_t* src_ptr, -+ uint8_t* dst_ptr, -+ ptrdiff_t dst_stride, -+ int dst_width) { -+- asm("vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" -++ asm volatile("vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" -+ "vpsrlw $15,%%ymm6,%%ymm6 \n" -+ "vpsllw $3,%%ymm6,%%ymm6 \n" // all 8 -+ "vbroadcastf128 %5,%%ymm7 \n" -+@@ -2630,7 +2630,7 @@ void ScaleUVRowUp2_Bilinear_AVX2(const uint8_t* src_ptr, -+ void ScaleUVRowUp2_Linear_16_SSE41(const uint16_t* src_ptr, -+ uint16_t* dst_ptr, -+ int dst_width) { -+- asm("pxor %%xmm5,%%xmm5 \n" -++ asm volatile("pxor %%xmm5,%%xmm5 \n" -+ "pcmpeqd %%xmm4,%%xmm4 \n" -+ "psrld $31,%%xmm4 \n" -+ "pslld $1,%%xmm4 \n" // all 2 -+@@ -2681,7 +2681,7 @@ void ScaleUVRowUp2_Bilinear_16_SSE41(const uint16_t* src_ptr, -+ uint16_t* dst_ptr, -+ ptrdiff_t dst_stride, -+ int dst_width) { -+- asm("pxor %%xmm7,%%xmm7 \n" -++ asm volatile("pxor %%xmm7,%%xmm7 \n" -+ "pcmpeqd %%xmm6,%%xmm6 \n" -+ "psrld $31,%%xmm6 \n" -+ "pslld $3,%%xmm6 \n" // all 8 -+@@ -2771,7 +2771,7 @@ void ScaleUVRowUp2_Bilinear_16_SSE41(const uint16_t* src_ptr, -+ void ScaleUVRowUp2_Linear_16_AVX2(const uint16_t* src_ptr, -+ uint16_t* dst_ptr, -+ int dst_width) { -+- asm("vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" -++ asm volatile("vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" -+ "vpsrld $31,%%ymm4,%%ymm4 \n" -+ "vpslld $1,%%ymm4,%%ymm4 \n" // all 2 -+ -+@@ -2819,7 +2819,7 @@ void ScaleUVRowUp2_Bilinear_16_AVX2(const uint16_t* src_ptr, -+ uint16_t* dst_ptr, -+ ptrdiff_t dst_stride, -+ int dst_width) { -+- asm("vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" -++ asm volatile("vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" -+ "vpsrld $31,%%ymm6,%%ymm6 \n" -+ "vpslld $3,%%ymm6,%%ymm6 \n" // all 8 -+ -diff --git a/media/libyuv/libyuv/include/libyuv/macros_msa.h b/media/libyuv/libyuv/include/libyuv/macros_msa.h ---- a/media/libyuv/libyuv/include/libyuv/macros_msa.h -+++ b/media/libyuv/libyuv/include/libyuv/macros_msa.h -@@ -18,22 +18,22 @@ - #if (__mips_isa_rev >= 6) - #define LW(psrc) \ - ({ \ - const uint8_t* psrc_lw_m = (const uint8_t*)(psrc); \ - uint32_t val_m; \ -- asm("lw %[val_m], %[psrc_lw_m] \n" \ -+ asm volatile("lw %[val_m], %[psrc_lw_m] \n" \ - : [val_m] "=r"(val_m) \ - : [psrc_lw_m] "m"(*psrc_lw_m)); \ - val_m; \ - }) - - #if (__mips == 64) - #define LD(psrc) \ - ({ \ - const uint8_t* psrc_ld_m = (const uint8_t*)(psrc); \ - uint64_t val_m = 0; \ -- asm("ld %[val_m], %[psrc_ld_m] \n" \ -+ asm volatile("ld %[val_m], %[psrc_ld_m] \n" \ - : [val_m] "=r"(val_m) \ - : [psrc_ld_m] "m"(*psrc_ld_m)); \ - val_m; \ - }) - #else // !(__mips == 64) -@@ -53,21 +53,21 @@ - - #define SW(val, pdst) \ - ({ \ - uint8_t* pdst_sw_m = (uint8_t*)(pdst); /* NOLINT */ \ - uint32_t val_m = (val); \ -- asm("sw %[val_m], %[pdst_sw_m] \n" \ -+ asm volatile("sw %[val_m], %[pdst_sw_m] \n" \ - : [pdst_sw_m] "=m"(*pdst_sw_m) \ - : [val_m] "r"(val_m)); \ - }) - - #if (__mips == 64) - #define SD(val, pdst) \ - ({ \ - uint8_t* pdst_sd_m = (uint8_t*)(pdst); /* NOLINT */ \ - uint64_t val_m = (val); \ -- asm("sd %[val_m], %[pdst_sd_m] \n" \ -+ asm volatile("sd %[val_m], %[pdst_sd_m] \n" \ - : [pdst_sd_m] "=m"(*pdst_sd_m) \ - : [val_m] "r"(val_m)); \ - }) - #else // !(__mips == 64) - #define SD(val, pdst) \ -@@ -84,11 +84,12 @@ - #define LW(psrc) \ - ({ \ - uint8_t* psrc_lw_m = (uint8_t*)(psrc); \ - uint32_t val_lw_m; \ - \ -- asm("lwr %[val_lw_m], 0(%[psrc_lw_m]) \n\t" \ -+ asm volatile( \ -+ "lwr %[val_lw_m], 0(%[psrc_lw_m]) \n\t" \ - "lwl %[val_lw_m], 3(%[psrc_lw_m]) \n\t" \ - \ - : [val_lw_m] "=&r"(val_lw_m) \ - : [psrc_lw_m] "r"(psrc_lw_m)); \ - \ -@@ -99,11 +100,12 @@ - #define LD(psrc) \ - ({ \ - uint8_t* psrc_ld_m = (uint8_t*)(psrc); \ - uint64_t val_ld_m = 0; \ - \ -- asm("ldr %[val_ld_m], 0(%[psrc_ld_m]) \n\t" \ -+ asm volatile( \ -+ "ldr %[val_ld_m], 0(%[psrc_ld_m]) \n\t" \ - "ldl %[val_ld_m], 7(%[psrc_ld_m]) \n\t" \ - \ - : [val_ld_m] "=&r"(val_ld_m) \ - : [psrc_ld_m] "r"(psrc_ld_m)); \ - \ -@@ -126,11 +128,11 @@ - - #define SW(val, pdst) \ - ({ \ - uint8_t* pdst_sw_m = (uint8_t*)(pdst); /* NOLINT */ \ - uint32_t val_m = (val); \ -- asm("usw %[val_m], %[pdst_sw_m] \n" \ -+ asm volatile("usw %[val_m], %[pdst_sw_m] \n" \ - : [pdst_sw_m] "=m"(*pdst_sw_m) \ - : [val_m] "r"(val_m)); \ - }) - - #define SD(val, pdst) \ -diff --git a/media/libyuv/libyuv/source/row_gcc.cc b/media/libyuv/libyuv/source/row_gcc.cc ---- a/media/libyuv/libyuv/source/row_gcc.cc -+++ b/media/libyuv/libyuv/source/row_gcc.cc -@@ -2624,11 +2624,11 @@ - const uint8_t* u_buf, - const uint8_t* v_buf, - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "pcmpeqb %%xmm5,%%xmm5 \n" - - LABELALIGN -@@ -2684,11 +2684,11 @@ - const uint8_t* u_buf, - const uint8_t* v_buf, - uint8_t* dst_rgb24, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "movdqa %[kShuffleMaskARGBToRGB24_0],%%xmm5 \n" - "movdqa %[kShuffleMaskARGBToRGB24],%%xmm6 \n" - "sub %[u_buf],%[v_buf] \n" - -@@ -2720,11 +2720,11 @@ - const uint8_t* u_buf, - const uint8_t* v_buf, - uint8_t* dst_rgb24, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "movdqa %[kShuffleMaskARGBToRGB24_0],%%xmm5 \n" - "movdqa %[kShuffleMaskARGBToRGB24],%%xmm6 \n" - "sub %[u_buf],%[v_buf] \n" - -@@ -2756,11 +2756,11 @@ - const uint8_t* u_buf, - const uint8_t* v_buf, - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "pcmpeqb %%xmm5,%%xmm5 \n" - - LABELALIGN -@@ -2785,11 +2785,11 @@ - const uint8_t* u_buf, - const uint8_t* v_buf, - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "pcmpeqb %%xmm5,%%xmm5 \n" // AR30 constants - "psrlw $14,%%xmm5 \n" - "psllw $4,%%xmm5 \n" // 2 alpha bits -@@ -2820,11 +2820,11 @@ - const uint16_t* u_buf, - const uint16_t* v_buf, - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "pcmpeqb %%xmm5,%%xmm5 \n" - - LABELALIGN -@@ -2850,11 +2850,11 @@ - const uint16_t* u_buf, - const uint16_t* v_buf, - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "pcmpeqb %%xmm5,%%xmm5 \n" - - LABELALIGN -@@ -2880,11 +2880,11 @@ - const uint16_t* u_buf, - const uint16_t* v_buf, - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "pcmpeqb %%xmm5,%%xmm5 \n" - "psrlw $14,%%xmm5 \n" - "psllw $4,%%xmm5 \n" // 2 alpha bits -@@ -2915,11 +2915,11 @@ - const uint16_t* u_buf, - const uint16_t* v_buf, - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "pcmpeqb %%xmm5,%%xmm5 \n" - "psrlw $14,%%xmm5 \n" - "psllw $4,%%xmm5 \n" // 2 alpha bits -@@ -2950,11 +2950,11 @@ - const uint16_t* u_buf, - const uint16_t* v_buf, - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "pcmpeqb %%xmm5,%%xmm5 \n" - - LABELALIGN -@@ -3043,11 +3043,11 @@ - const uint16_t* u_buf, - const uint16_t* v_buf, - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "pcmpeqb %%xmm5,%%xmm5 \n" - "psrlw $14,%%xmm5 \n" - "psllw $4,%%xmm5 \n" // 2 alpha bits -@@ -3236,11 +3236,11 @@ - void OMITFP P210ToAR30Row_SSSE3(const uint16_t* y_buf, - const uint16_t* uv_buf, - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "pcmpeqb %%xmm5,%%xmm5 \n" - "psrlw $14,%%xmm5 \n" - "psllw $4,%%xmm5 \n" // 2 alpha bits - "pxor %%xmm6,%%xmm6 \n" // 0 for min -@@ -3267,11 +3267,11 @@ - void OMITFP P410ToAR30Row_SSSE3(const uint16_t* y_buf, - const uint16_t* uv_buf, - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "pcmpeqb %%xmm5,%%xmm5 \n" - "psrlw $14,%%xmm5 \n" - "psllw $4,%%xmm5 \n" // 2 alpha bits - "pxor %%xmm6,%%xmm6 \n" // 0 for min -@@ -3299,11 +3299,11 @@ - const uint8_t* u_buf, - const uint8_t* v_buf, - uint8_t* dst_rgba, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "pcmpeqb %%xmm5,%%xmm5 \n" - - LABELALIGN -@@ -3710,11 +3710,11 @@ - const uint8_t* u_buf, - const uint8_t* v_buf, - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" - - LABELALIGN -@@ -3744,11 +3744,11 @@ - const uint8_t* u_buf, - const uint8_t* v_buf, - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" - - LABELALIGN -@@ -3784,11 +3784,11 @@ - const uint8_t* u_buf, - const uint8_t* v_buf, - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX512BW(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%xmm5,%%xmm5,%%xmm5 \n" - "vpbroadcastq %%xmm5,%%zmm5 \n" - -@@ -3823,11 +3823,11 @@ - const uint8_t* u_buf, - const uint8_t* v_buf, - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants - "vpsrlw $14,%%ymm5,%%ymm5 \n" - "vpsllw $4,%%ymm5,%%ymm5 \n" // 2 alpha bits -@@ -3863,11 +3863,11 @@ - const uint16_t* u_buf, - const uint16_t* v_buf, - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" - - LABELALIGN -@@ -3898,11 +3898,11 @@ - const uint16_t* u_buf, - const uint16_t* v_buf, - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" - - LABELALIGN -@@ -3933,11 +3933,11 @@ - const uint16_t* u_buf, - const uint16_t* v_buf, - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants - "vpsrlw $14,%%ymm5,%%ymm5 \n" - "vpsllw $4,%%ymm5,%%ymm5 \n" // 2 alpha bits -@@ -3973,11 +3973,11 @@ - const uint16_t* u_buf, - const uint16_t* v_buf, - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants - "vpsrlw $14,%%ymm5,%%ymm5 \n" - "vpsllw $4,%%ymm5,%%ymm5 \n" // 2 alpha bits -@@ -4013,11 +4013,11 @@ - const uint16_t* u_buf, - const uint16_t* v_buf, - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" - - LABELALIGN -@@ -4118,11 +4118,11 @@ - const uint16_t* u_buf, - const uint16_t* v_buf, - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants - "vpsrlw $14,%%ymm5,%%ymm5 \n" - "vpsllw $4,%%ymm5,%%ymm5 \n" // 2 alpha bits -@@ -4226,11 +4226,11 @@ - const uint8_t* u_buf, - const uint8_t* v_buf, - uint8_t* dst_argb, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "sub %[u_buf],%[v_buf] \n" - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" - - LABELALIGN -@@ -4428,11 +4428,11 @@ - void OMITFP P210ToAR30Row_AVX2(const uint16_t* y_buf, - const uint16_t* uv_buf, - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants - "vpsrlw $14,%%ymm5,%%ymm5 \n" - "vpsllw $4,%%ymm5,%%ymm5 \n" // 2 alpha bits - "vpxor %%ymm6,%%ymm6,%%ymm6 \n" // 0 for min -@@ -4465,11 +4465,11 @@ - void OMITFP P410ToAR30Row_AVX2(const uint16_t* y_buf, - const uint16_t* uv_buf, - uint8_t* dst_ar30, - const struct YuvConstants* yuvconstants, - int width) { -- asm ( -+ asm volatile ( - YUVTORGB_SETUP_AVX2(yuvconstants) - "vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" // AR30 constants - "vpsrlw $14,%%ymm5,%%ymm5 \n" - "vpsllw $4,%%ymm5,%%ymm5 \n" // 2 alpha bits - "vpxor %%ymm6,%%ymm6,%%ymm6 \n" // 0 for min -@@ -5679,11 +5679,11 @@ - void MergeXRGBRow_AVX2(const uint8_t* src_r, - const uint8_t* src_g, - const uint8_t* src_b, - uint8_t* dst_argb, - int width) { -- asm( -+ asm volatile( - - LABELALIGN - "1: \n" - - "vmovdqu (%2),%%xmm0 \n" // B -@@ -7379,11 +7379,11 @@ - // Unattenuate 4 pixels at a time. - void ARGBUnattenuateRow_SSE2(const uint8_t* src_argb, - uint8_t* dst_argb, - int width) { - uintptr_t alpha; -- asm( -+ asm volatile( - // 4 pixel loop. - LABELALIGN - "1: \n" - "movdqu (%0),%%xmm0 \n" - "movzb 0x03(%0),%3 \n" -@@ -7839,11 +7839,11 @@ - // Add 2 rows of ARGB pixels together, 4 pixels at a time. - void ARGBAddRow_SSE2(const uint8_t* src_argb, - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width) { -- asm( -+ asm volatile( - // 4 pixel loop. - LABELALIGN - "1: \n" - "movdqu (%0),%%xmm0 \n" - "lea 0x10(%0),%0 \n" -@@ -7867,11 +7867,11 @@ - // Add 2 rows of ARGB pixels together, 4 pixels at a time. - void ARGBAddRow_AVX2(const uint8_t* src_argb, - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width) { -- asm( -+ asm volatile( - // 4 pixel loop. - LABELALIGN - "1: \n" - "vmovdqu (%0),%%ymm0 \n" - "lea 0x20(%0),%0 \n" -@@ -7895,11 +7895,11 @@ - // Subtract 2 rows of ARGB pixels, 4 pixels at a time. - void ARGBSubtractRow_SSE2(const uint8_t* src_argb, - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width) { -- asm( -+ asm volatile( - // 4 pixel loop. - LABELALIGN - "1: \n" - "movdqu (%0),%%xmm0 \n" - "lea 0x10(%0),%0 \n" -@@ -7923,11 +7923,11 @@ - // Subtract 2 rows of ARGB pixels, 8 pixels at a time. - void ARGBSubtractRow_AVX2(const uint8_t* src_argb, - const uint8_t* src_argb1, - uint8_t* dst_argb, - int width) { -- asm( -+ asm volatile( - // 4 pixel loop. - LABELALIGN - "1: \n" - "vmovdqu (%0),%%ymm0 \n" - "lea 0x20(%0),%0 \n" -@@ -9097,11 +9097,11 @@ - // Tranform ARGB pixels with color table. - void ARGBColorTableRow_X86(uint8_t* dst_argb, - const uint8_t* table_argb, - int width) { - uintptr_t pixel_temp; -- asm( -+ asm volatile( - // 1 pixel loop. - LABELALIGN - "1: \n" - "movzb (%0),%1 \n" - "lea 0x4(%0),%0 \n" -@@ -9130,11 +9130,11 @@ - // Tranform RGB pixels with color table. - void RGBColorTableRow_X86(uint8_t* dst_argb, - const uint8_t* table_argb, - int width) { - uintptr_t pixel_temp; -- asm( -+ asm volatile( - // 1 pixel loop. - LABELALIGN - "1: \n" - "movzb (%0),%1 \n" - "lea 0x4(%0),%0 \n" -diff --git a/media/libyuv/libyuv/source/row_lsx.cc b/media/libyuv/libyuv/source/row_lsx.cc ---- a/media/libyuv/libyuv/source/row_lsx.cc -+++ b/media/libyuv/libyuv/source/row_lsx.cc -@@ -2803,11 +2803,12 @@ - // ARGB expects first 3 values to contain RGB and 4th value is ignored. - static void ARGBToYMatrixRow_LSX(const uint8_t* src_argb, - uint8_t* dst_y, - int width, - const struct RgbConstants* rgbconstants) { -- asm("vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants -+ asm volatile( -+ "vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants - "vldrepl.b $vr1, %3, 1 \n\t" // load rgbconstants - "vldrepl.b $vr2, %3, 2 \n\t" // load rgbconstants - "vldrepl.h $vr3, %3, 4 \n\t" // load rgbconstants - "1: \n\t" - "vld $vr4, %0, 0 \n\t" -@@ -2861,11 +2862,12 @@ - // Same code as ARGB, except the LD4 - static void RGBAToYMatrixRow_LSX(const uint8_t* src_rgba, - uint8_t* dst_y, - int width, - const struct RgbConstants* rgbconstants) { -- asm("vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants -+ asm volatile( -+ "vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants - "vldrepl.b $vr1, %3, 1 \n\t" // load rgbconstants - "vldrepl.b $vr2, %3, 2 \n\t" // load rgbconstants - "vldrepl.h $vr3, %3, 4 \n\t" // load rgbconstants - "1: \n\t" - "vld $vr4, %0, 0 \n\t" -@@ -2918,11 +2920,12 @@ - int8_t shuff[64] = {0, 2, 3, 5, 6, 8, 9, 11, 12, 14, 15, 17, 18, - 20, 21, 23, 24, 26, 27, 29, 30, 0, 1, 3, 4, 6, - 7, 9, 10, 12, 13, 15, 1, 0, 4, 0, 7, 0, 10, - 0, 13, 0, 16, 0, 19, 0, 22, 0, 25, 0, 28, 0, - 31, 0, 2, 0, 5, 0, 8, 0, 11, 0, 14, 0}; -- asm("vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants -+ asm volatile( -+ "vldrepl.b $vr0, %3, 0 \n\t" // load rgbconstants - "vldrepl.b $vr1, %3, 1 \n\t" // load rgbconstants - "vldrepl.b $vr2, %3, 2 \n\t" // load rgbconstants - "vldrepl.h $vr3, %3, 4 \n\t" // load rgbconstants - "vld $vr4, %4, 0 \n\t" // load shuff - "vld $vr5, %4, 16 \n\t" -diff --git a/media/libyuv/libyuv/source/scale_gcc.cc b/media/libyuv/libyuv/source/scale_gcc.cc ---- a/media/libyuv/libyuv/source/scale_gcc.cc -+++ b/media/libyuv/libyuv/source/scale_gcc.cc -@@ -95,11 +95,11 @@ - void ScaleRowDown2_SSSE3(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { - (void)src_stride; -- asm( -+ asm volatile( - // 16 pixel loop. - LABELALIGN - "1: \n" - "movdqu (%0),%%xmm0 \n" - "movdqu 0x10(%0),%%xmm1 \n" -@@ -121,11 +121,11 @@ - void ScaleRowDown2Linear_SSSE3(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { - (void)src_stride; -- asm("pcmpeqb %%xmm4,%%xmm4 \n" -+ asm volatile("pcmpeqb %%xmm4,%%xmm4 \n" - "psrlw $0xf,%%xmm4 \n" - "packuswb %%xmm4,%%xmm4 \n" - "pxor %%xmm5,%%xmm5 \n" - - LABELALIGN -@@ -151,11 +151,11 @@ - - void ScaleRowDown2Box_SSSE3(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm("pcmpeqb %%xmm4,%%xmm4 \n" -+ asm volatile("pcmpeqb %%xmm4,%%xmm4 \n" - "psrlw $0xf,%%xmm4 \n" - "packuswb %%xmm4,%%xmm4 \n" - "pxor %%xmm5,%%xmm5 \n" - - LABELALIGN -@@ -217,11 +217,11 @@ - void ScaleRowDown2Linear_AVX2(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { - (void)src_stride; -- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" -+ asm volatile("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" - "vpsrlw $0xf,%%ymm4,%%ymm4 \n" - "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" - "vpxor %%ymm5,%%ymm5,%%ymm5 \n" - - LABELALIGN -@@ -249,11 +249,11 @@ - - void ScaleRowDown2Box_AVX2(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" -+ asm volatile("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" - "vpsrlw $0xf,%%ymm4,%%ymm4 \n" - "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" - "vpxor %%ymm5,%%ymm5,%%ymm5 \n" - - LABELALIGN -@@ -291,11 +291,11 @@ - void ScaleRowDown4_SSSE3(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { - (void)src_stride; -- asm("pcmpeqb %%xmm5,%%xmm5 \n" -+ asm volatile("pcmpeqb %%xmm5,%%xmm5 \n" - "psrld $0x18,%%xmm5 \n" - "pslld $0x10,%%xmm5 \n" - - LABELALIGN - "1: \n" -@@ -321,11 +321,11 @@ - void ScaleRowDown4Box_SSSE3(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { - intptr_t stridex3; -- asm("pcmpeqb %%xmm4,%%xmm4 \n" -+ asm volatile("pcmpeqb %%xmm4,%%xmm4 \n" - "psrlw $0xf,%%xmm4 \n" - "movdqa %%xmm4,%%xmm5 \n" - "packuswb %%xmm4,%%xmm4 \n" - "psllw $0x3,%%xmm5 \n" - "lea 0x00(%4,%4,2),%3 \n" -@@ -375,11 +375,11 @@ - void ScaleRowDown4_AVX2(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { - (void)src_stride; -- asm("vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" -+ asm volatile("vpcmpeqb %%ymm5,%%ymm5,%%ymm5 \n" - "vpsrld $0x18,%%ymm5,%%ymm5 \n" - "vpslld $0x10,%%ymm5,%%ymm5 \n" - - LABELALIGN - "1: \n" -@@ -407,11 +407,11 @@ - - void ScaleRowDown4Box_AVX2(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" -+ asm volatile("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" - "vpsrlw $0xf,%%ymm4,%%ymm4 \n" - "vpsllw $0x3,%%ymm4,%%ymm5 \n" - "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" - - LABELALIGN -@@ -462,11 +462,11 @@ - void ScaleRowDown34_SSSE3(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { - (void)src_stride; -- asm("movdqa %0,%%xmm3 \n" -+ asm volatile("movdqa %0,%%xmm3 \n" - "movdqa %1,%%xmm4 \n" - "movdqa %2,%%xmm5 \n" - : - : "m"(kShuf0), // %0 - "m"(kShuf1), // %1 -@@ -497,19 +497,19 @@ - - void ScaleRowDown34_1_Box_SSSE3(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm("movdqa %0,%%xmm2 \n" // kShuf01 -+ asm volatile("movdqa %0,%%xmm2 \n" // kShuf01 - "movdqa %1,%%xmm3 \n" // kShuf11 - "movdqa %2,%%xmm4 \n" // kShuf21 - : - : "m"(kShuf01), // %0 - "m"(kShuf11), // %1 - "m"(kShuf21) // %2 - ); -- asm("movdqa %0,%%xmm5 \n" // kMadd01 -+ asm volatile("movdqa %0,%%xmm5 \n" // kMadd01 - "movdqa %1,%%xmm0 \n" // kMadd11 - "movdqa %2,%%xmm1 \n" // kRound34 - : - : "m"(kMadd01), // %0 - "m"(kMadd11), // %1 -@@ -559,19 +559,19 @@ - - void ScaleRowDown34_0_Box_SSSE3(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm("movdqa %0,%%xmm2 \n" // kShuf01 -+ asm volatile("movdqa %0,%%xmm2 \n" // kShuf01 - "movdqa %1,%%xmm3 \n" // kShuf11 - "movdqa %2,%%xmm4 \n" // kShuf21 - : - : "m"(kShuf01), // %0 - "m"(kShuf11), // %1 - "m"(kShuf21) // %2 - ); -- asm("movdqa %0,%%xmm5 \n" // kMadd01 -+ asm volatile("movdqa %0,%%xmm5 \n" // kMadd01 - "movdqa %1,%%xmm0 \n" // kMadd11 - "movdqa %2,%%xmm1 \n" // kRound34 - : - : "m"(kMadd01), // %0 - "m"(kMadd11), // %1 -@@ -626,11 +626,11 @@ - void ScaleRowDown38_SSSE3(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { - (void)src_stride; -- asm("movdqa %3,%%xmm4 \n" -+ asm volatile("movdqa %3,%%xmm4 \n" - "movdqa %4,%%xmm5 \n" - - LABELALIGN - "1: \n" - "movdqu (%0),%%xmm0 \n" -@@ -655,11 +655,11 @@ - - void ScaleRowDown38_2_Box_SSSE3(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm("movdqa %0,%%xmm2 \n" -+ asm volatile("movdqa %0,%%xmm2 \n" - "movdqa %1,%%xmm3 \n" - "movdqa %2,%%xmm4 \n" - "movdqa %3,%%xmm5 \n" - : - : "m"(kShufAb0), // %0 -@@ -697,11 +697,11 @@ - - void ScaleRowDown38_3_Box_SSSE3(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm("movdqa %0,%%xmm2 \n" -+ asm volatile("movdqa %0,%%xmm2 \n" - "movdqa %1,%%xmm3 \n" - "movdqa %2,%%xmm4 \n" - "pxor %%xmm5,%%xmm5 \n" - : - : "m"(kShufAc), // %0 -@@ -764,11 +764,11 @@ - - #ifdef HAS_SCALEROWUP2_LINEAR_SSE2 - void ScaleRowUp2_Linear_SSE2(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int dst_width) { -- asm("pxor %%xmm0,%%xmm0 \n" // 0 -+ asm volatile("pxor %%xmm0,%%xmm0 \n" // 0 - "pcmpeqw %%xmm6,%%xmm6 \n" - "psrlw $15,%%xmm6 \n" - "psllw $1,%%xmm6 \n" // all 2 - - LABELALIGN -@@ -932,11 +932,11 @@ - - #ifdef HAS_SCALEROWUP2_LINEAR_12_SSSE3 - void ScaleRowUp2_Linear_12_SSSE3(const uint16_t* src_ptr, - uint16_t* dst_ptr, - int dst_width) { -- asm("movdqa %3,%%xmm5 \n" -+ asm volatile("movdqa %3,%%xmm5 \n" - "pcmpeqw %%xmm4,%%xmm4 \n" - "psrlw $15,%%xmm4 \n" - "psllw $1,%%xmm4 \n" // all 2 - - LABELALIGN -@@ -983,11 +983,11 @@ - void ScaleRowUp2_Bilinear_12_SSSE3(const uint16_t* src_ptr, - ptrdiff_t src_stride, - uint16_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width) { -- asm("pcmpeqw %%xmm7,%%xmm7 \n" -+ asm volatile("pcmpeqw %%xmm7,%%xmm7 \n" - "psrlw $15,%%xmm7 \n" - "psllw $3,%%xmm7 \n" // all 8 - "movdqa %5,%%xmm6 \n" - - LABELALIGN -@@ -1080,11 +1080,11 @@ - - #ifdef HAS_SCALEROWUP2_LINEAR_16_SSE2 - void ScaleRowUp2_Linear_16_SSE2(const uint16_t* src_ptr, - uint16_t* dst_ptr, - int dst_width) { -- asm("pxor %%xmm5,%%xmm5 \n" -+ asm volatile("pxor %%xmm5,%%xmm5 \n" - "pcmpeqd %%xmm4,%%xmm4 \n" - "psrld $31,%%xmm4 \n" - "pslld $1,%%xmm4 \n" // all 2 - - LABELALIGN -@@ -1132,11 +1132,11 @@ - void ScaleRowUp2_Bilinear_16_SSE2(const uint16_t* src_ptr, - ptrdiff_t src_stride, - uint16_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width) { -- asm("pxor %%xmm7,%%xmm7 \n" -+ asm volatile("pxor %%xmm7,%%xmm7 \n" - "pcmpeqd %%xmm6,%%xmm6 \n" - "psrld $31,%%xmm6 \n" - "pslld $3,%%xmm6 \n" // all 8 - - LABELALIGN -@@ -1239,11 +1239,11 @@ - - #ifdef HAS_SCALEROWUP2_LINEAR_SSSE3 - void ScaleRowUp2_Linear_SSSE3(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int dst_width) { -- asm("pcmpeqw %%xmm4,%%xmm4 \n" -+ asm volatile("pcmpeqw %%xmm4,%%xmm4 \n" - "psrlw $15,%%xmm4 \n" - "psllw $1,%%xmm4 \n" // all 2 - "movdqa %3,%%xmm3 \n" - - LABELALIGN -@@ -1279,11 +1279,11 @@ - void ScaleRowUp2_Bilinear_SSSE3(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width) { -- asm("pcmpeqw %%xmm6,%%xmm6 \n" -+ asm volatile("pcmpeqw %%xmm6,%%xmm6 \n" - "psrlw $15,%%xmm6 \n" - "psllw $3,%%xmm6 \n" // all 8 - "movdqa %5,%%xmm7 \n" - - LABELALIGN -@@ -1363,11 +1363,11 @@ - - #ifdef HAS_SCALEROWUP2_LINEAR_AVX2 - void ScaleRowUp2_Linear_AVX2(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int dst_width) { -- asm("vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" -+ asm volatile("vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" - "vpsrlw $15,%%ymm4,%%ymm4 \n" - "vpsllw $1,%%ymm4,%%ymm4 \n" // all 2 - "vbroadcastf128 %3,%%ymm3 \n" - - LABELALIGN -@@ -1406,11 +1406,11 @@ - void ScaleRowUp2_Bilinear_AVX2(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width) { -- asm("vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" -+ asm volatile("vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" - "vpsrlw $15,%%ymm6,%%ymm6 \n" - "vpsllw $3,%%ymm6,%%ymm6 \n" // all 8 - "vbroadcastf128 %5,%%ymm7 \n" - - LABELALIGN -@@ -1487,11 +1487,11 @@ - - #ifdef HAS_SCALEROWUP2_LINEAR_12_AVX2 - void ScaleRowUp2_Linear_12_AVX2(const uint16_t* src_ptr, - uint16_t* dst_ptr, - int dst_width) { -- asm("vbroadcastf128 %3,%%ymm5 \n" -+ asm volatile("vbroadcastf128 %3,%%ymm5 \n" - "vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" - "vpsrlw $15,%%ymm4,%%ymm4 \n" - "vpsllw $1,%%ymm4,%%ymm4 \n" // all 2 - - LABELALIGN -@@ -1538,11 +1538,11 @@ - void ScaleRowUp2_Bilinear_12_AVX2(const uint16_t* src_ptr, - ptrdiff_t src_stride, - uint16_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width) { -- asm("vbroadcastf128 %5,%%ymm5 \n" -+ asm volatile("vbroadcastf128 %5,%%ymm5 \n" - "vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" - "vpsrlw $15,%%ymm4,%%ymm4 \n" - "vpsllw $3,%%ymm4,%%ymm4 \n" // all 8 - - LABELALIGN -@@ -1599,11 +1599,11 @@ - - #ifdef HAS_SCALEROWUP2_LINEAR_16_AVX2 - void ScaleRowUp2_Linear_16_AVX2(const uint16_t* src_ptr, - uint16_t* dst_ptr, - int dst_width) { -- asm("vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" -+ asm volatile("vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" - "vpsrld $31,%%ymm4,%%ymm4 \n" - "vpslld $1,%%ymm4,%%ymm4 \n" // all 2 - - LABELALIGN - "1: \n" -@@ -1648,11 +1648,11 @@ - void ScaleRowUp2_Bilinear_16_AVX2(const uint16_t* src_ptr, - ptrdiff_t src_stride, - uint16_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width) { -- asm("vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" -+ asm volatile("vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" - "vpsrld $31,%%ymm6,%%ymm6 \n" - "vpslld $3,%%ymm6,%%ymm6 \n" // all 8 - - LABELALIGN - "1: \n" -@@ -1730,11 +1730,11 @@ - - // Reads 16xN bytes and produces 16 shorts at a time. - void ScaleAddRow_SSE2(const uint8_t* src_ptr, - uint16_t* dst_ptr, - int src_width) { -- asm("pxor %%xmm5,%%xmm5 \n" -+ asm volatile("pxor %%xmm5,%%xmm5 \n" - - // 16 pixel loop. - LABELALIGN - "1: \n" - "movdqu (%0),%%xmm3 \n" -@@ -1761,11 +1761,11 @@ - #ifdef HAS_SCALEADDROW_AVX2 - // Reads 32 bytes and accumulates to 32 shorts at a time. - void ScaleAddRow_AVX2(const uint8_t* src_ptr, - uint16_t* dst_ptr, - int src_width) { -- asm("vpxor %%ymm5,%%ymm5,%%ymm5 \n" -+ asm volatile("vpxor %%ymm5,%%ymm5,%%ymm5 \n" - - LABELALIGN - "1: \n" - "vmovdqu (%0),%%ymm3 \n" - "lea 0x20(%0),%0 \n" // src_ptr += 32 -@@ -1802,11 +1802,11 @@ - const uint8_t* src_ptr, - int dst_width, - int x, - int dx) { - intptr_t x0, x1, temp_pixel; -- asm("movd %6,%%xmm2 \n" -+ asm volatile("movd %6,%%xmm2 \n" - "movd %7,%%xmm3 \n" - "movl $0x04040000,%k2 \n" - "movd %k2,%%xmm5 \n" - "pcmpeqb %%xmm6,%%xmm6 \n" - "psrlw $0x9,%%xmm6 \n" // 0x007f007f -@@ -2003,11 +2003,11 @@ - uint8_t* dst_argb, - int dst_width) { - intptr_t src_stepx_x4 = (intptr_t)(src_stepx); - intptr_t src_stepx_x12; - (void)src_stride; -- asm("lea 0x00(,%1,4),%1 \n" -+ asm volatile("lea 0x00(,%1,4),%1 \n" - "lea 0x00(%1,%1,2),%4 \n" - - LABELALIGN - "1: \n" - "movd (%0),%%xmm0 \n" -@@ -2039,11 +2039,11 @@ - uint8_t* dst_argb, - int dst_width) { - intptr_t src_stepx_x4 = (intptr_t)(src_stepx); - intptr_t src_stepx_x12; - intptr_t row1 = (intptr_t)(src_stride); -- asm("lea 0x00(,%1,4),%1 \n" -+ asm volatile("lea 0x00(,%1,4),%1 \n" - "lea 0x00(%1,%1,2),%4 \n" - "lea 0x00(%0,%5,1),%5 \n" - - LABELALIGN - "1: \n" -@@ -2081,11 +2081,11 @@ - const uint8_t* src_argb, - int dst_width, - int x, - int dx) { - intptr_t x0, x1; -- asm("movd %5,%%xmm2 \n" -+ asm volatile("movd %5,%%xmm2 \n" - "movd %6,%%xmm3 \n" - "pshufd $0x0,%%xmm2,%%xmm2 \n" - "pshufd $0x11,%%xmm3,%%xmm0 \n" - "paddd %%xmm0,%%xmm2 \n" - "paddd %%xmm3,%%xmm3 \n" -@@ -2189,18 +2189,18 @@ - const uint8_t* src_argb, - int dst_width, - int x, - int dx) { - intptr_t x0, x1; -- asm("movdqa %0,%%xmm4 \n" -+ asm volatile("movdqa %0,%%xmm4 \n" - "movdqa %1,%%xmm5 \n" - : - : "m"(kShuffleColARGB), // %0 - "m"(kShuffleFractions) // %1 - ); - -- asm("movd %5,%%xmm2 \n" -+ asm volatile("movd %5,%%xmm2 \n" - "movd %6,%%xmm3 \n" - "pcmpeqb %%xmm6,%%xmm6 \n" - "psrlw $0x9,%%xmm6 \n" - "pextrw $0x1,%%xmm2,%k3 \n" - "sub $0x2,%2 \n" -@@ -2258,11 +2258,11 @@ - : "memory", "cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6"); - } - - // Divide num by div and return as 16.16 fixed point result. - int FixedDiv_X86(int num, int div) { -- asm("cdq \n" -+ asm volatile("cdq \n" - "shld $0x10,%%eax,%%edx \n" - "shl $0x10,%%eax \n" - "idiv %1 \n" - "mov %0, %%eax \n" - : "+a"(num) // %0 -@@ -2271,11 +2271,11 @@ - return num; - } - - // Divide num - 1 by div - 1 and return as 16.16 fixed point result. - int FixedDiv1_X86(int num, int div) { -- asm("cdq \n" -+ asm volatile("cdq \n" - "shld $0x10,%%eax,%%edx \n" - "shl $0x10,%%eax \n" - "sub $0x10001,%%eax \n" - "sbb $0x0,%%edx \n" - "sub $0x1,%1 \n" -@@ -2302,11 +2302,11 @@ - - void ScaleUVRowDown2Box_SSSE3(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm("pcmpeqb %%xmm4,%%xmm4 \n" // 01010101 -+ asm volatile("pcmpeqb %%xmm4,%%xmm4 \n" // 01010101 - "psrlw $0xf,%%xmm4 \n" - "packuswb %%xmm4,%%xmm4 \n" - "pxor %%xmm5, %%xmm5 \n" // zero - "movdqa %4,%%xmm1 \n" // split shuffler - "movdqa %5,%%xmm3 \n" // merge shuffler -@@ -2341,11 +2341,11 @@ - #ifdef HAS_SCALEUVROWDOWN2BOX_AVX2 - void ScaleUVRowDown2Box_AVX2(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - int dst_width) { -- asm("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" // 01010101 -+ asm volatile("vpcmpeqb %%ymm4,%%ymm4,%%ymm4 \n" // 01010101 - "vpsrlw $0xf,%%ymm4,%%ymm4 \n" - "vpackuswb %%ymm4,%%ymm4,%%ymm4 \n" - "vpxor %%ymm5,%%ymm5,%%ymm5 \n" // zero - "vbroadcastf128 %4,%%ymm1 \n" // split shuffler - "vbroadcastf128 %5,%%ymm3 \n" // merge shuffler -@@ -2384,11 +2384,11 @@ - - #ifdef HAS_SCALEUVROWUP2_LINEAR_SSSE3 - void ScaleUVRowUp2_Linear_SSSE3(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int dst_width) { -- asm("pcmpeqw %%xmm4,%%xmm4 \n" -+ asm volatile("pcmpeqw %%xmm4,%%xmm4 \n" - "psrlw $15,%%xmm4 \n" - "psllw $1,%%xmm4 \n" // all 2 - "movdqa %3,%%xmm3 \n" - - LABELALIGN -@@ -2424,11 +2424,11 @@ - void ScaleUVRowUp2_Bilinear_SSSE3(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width) { -- asm("pcmpeqw %%xmm6,%%xmm6 \n" -+ asm volatile("pcmpeqw %%xmm6,%%xmm6 \n" - "psrlw $15,%%xmm6 \n" - "psllw $3,%%xmm6 \n" // all 8 - "movdqa %5,%%xmm7 \n" - - LABELALIGN -@@ -2507,11 +2507,11 @@ - #ifdef HAS_SCALEUVROWUP2_LINEAR_AVX2 - - void ScaleUVRowUp2_Linear_AVX2(const uint8_t* src_ptr, - uint8_t* dst_ptr, - int dst_width) { -- asm("vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" -+ asm volatile("vpcmpeqw %%ymm4,%%ymm4,%%ymm4 \n" - "vpsrlw $15,%%ymm4,%%ymm4 \n" - "vpsllw $1,%%ymm4,%%ymm4 \n" // all 2 - "vbroadcastf128 %3,%%ymm3 \n" - - LABELALIGN -@@ -2549,11 +2549,11 @@ - void ScaleUVRowUp2_Bilinear_AVX2(const uint8_t* src_ptr, - ptrdiff_t src_stride, - uint8_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width) { -- asm("vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" -+ asm volatile("vpcmpeqw %%ymm6,%%ymm6,%%ymm6 \n" - "vpsrlw $15,%%ymm6,%%ymm6 \n" - "vpsllw $3,%%ymm6,%%ymm6 \n" // all 8 - "vbroadcastf128 %5,%%ymm7 \n" - - LABELALIGN -@@ -2628,11 +2628,11 @@ - - #ifdef HAS_SCALEUVROWUP2_LINEAR_16_SSE41 - void ScaleUVRowUp2_Linear_16_SSE41(const uint16_t* src_ptr, - uint16_t* dst_ptr, - int dst_width) { -- asm("pxor %%xmm5,%%xmm5 \n" -+ asm volatile("pxor %%xmm5,%%xmm5 \n" - "pcmpeqd %%xmm4,%%xmm4 \n" - "psrld $31,%%xmm4 \n" - "pslld $1,%%xmm4 \n" // all 2 - - LABELALIGN -@@ -2679,11 +2679,11 @@ - void ScaleUVRowUp2_Bilinear_16_SSE41(const uint16_t* src_ptr, - ptrdiff_t src_stride, - uint16_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width) { -- asm("pxor %%xmm7,%%xmm7 \n" -+ asm volatile("pxor %%xmm7,%%xmm7 \n" - "pcmpeqd %%xmm6,%%xmm6 \n" - "psrld $31,%%xmm6 \n" - "pslld $3,%%xmm6 \n" // all 8 - - LABELALIGN -@@ -2769,11 +2769,11 @@ - - #ifdef HAS_SCALEUVROWUP2_LINEAR_16_AVX2 - void ScaleUVRowUp2_Linear_16_AVX2(const uint16_t* src_ptr, - uint16_t* dst_ptr, - int dst_width) { -- asm("vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" -+ asm volatile("vpcmpeqd %%ymm4,%%ymm4,%%ymm4 \n" - "vpsrld $31,%%ymm4,%%ymm4 \n" - "vpslld $1,%%ymm4,%%ymm4 \n" // all 2 - - LABELALIGN - "1: \n" -@@ -2817,11 +2817,11 @@ - void ScaleUVRowUp2_Bilinear_16_AVX2(const uint16_t* src_ptr, - ptrdiff_t src_stride, - uint16_t* dst_ptr, - ptrdiff_t dst_stride, - int dst_width) { -- asm("vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" -+ asm volatile("vpcmpeqd %%ymm6,%%ymm6,%%ymm6 \n" - "vpsrld $31,%%ymm6,%%ymm6 \n" - "vpslld $3,%%ymm6,%%ymm6 \n" // all 8 - - LABELALIGN - "1: \n" -diff --git a/media/libyuv/moz.yaml b/media/libyuv/moz.yaml ---- a/media/libyuv/moz.yaml -+++ b/media/libyuv/moz.yaml -@@ -53,5 +53,6 @@ - patches: - - 00_fix_build_errors.patch - - 01_make_mjpeg_printfs_optional.patch - - 02_update_gyp.patch - - 03_add_neon64_and_sve_gyp_targets.patch -+ - 04_add_missing_volatile.patch - diff --git a/firefox.spec b/firefox.spec index 95eed97..d79eea1 100644 --- a/firefox.spec +++ b/firefox.spec @@ -196,14 +196,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 130.0 -Release: 4%{?pre_tag}%{?dist} +Version: 130.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240830.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240918.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -302,8 +302,6 @@ Patch603: firefox-gcc-always-inline.patch Patch800: bmo-1559213-Support-system-av1.patch Patch801: bmo-1559213-fix-system-av1-libs.patch -Patch802: D221275.1725700750.diff - %if %{?system_nss} BuildRequires: pkgconfig(nspr) >= %{nspr_version} BuildRequires: pkgconfig(nss) >= %{nss_version} @@ -613,8 +611,6 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %endif %patch -P603 -p1 -b .inline -%patch -P802 -p1 -b .libyuv - #%patch800 -p1 -b .system-av1 #%patch801 -p1 -b .system-av1-fixup @@ -1239,6 +1235,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Sep 18 2024 Martin Stransky - 130.0.1-1 +- Updated to 130.0.1 + * Fri Sep 6 2024 Martin Stransky - 130.0-4 - Added fix for mzbz#1916038 diff --git a/sources b/sources index d6d4d22..bfc2f88 100644 --- a/sources +++ b/sources @@ -2,5 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a -SHA512 (firefox-130.0.source.tar.xz) = d0d11b38d9e02fa15298ec13336bb086668b4f36b3ce9ced218a265327fd4822b9fea4303402631947ea3c20490c414de87f8df3e7c23d2e02b70f0456b9af40 -SHA512 (firefox-langpacks-130.0-20240830.tar.xz) = 71f3c555acde5b55bce4b95972524f6a5d47477771ff36ad8b3d39c5b68228004401c4082fa0cd95f6701500b8c402af2a764817e626faa9e41200d801337f45 +SHA512 (firefox-130.0.1.source.tar.xz) = 163d1ce9f671a4716686955c43ff23d9f200f6c52dfdabcbb93af6a326c24aa5096404f42447b02b5a3ad02e2f60d17271783638fe027d24865aebb3e70e97fe +SHA512 (firefox-langpacks-130.0.1-20240918.tar.xz) = 5da9f6a16e406859d04580bf4636ec5c6ac85232f199fb56c2c6a0b447f86f6557b730491012420faf02af14410c73de9f3e86fde707a7c5527078423b2b2c22 diff --git a/wasi.patch b/wasi.patch index f1d6bb4..22a7489 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-130.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-130.0.1/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From fc19acac9d6c236ad4d72b1e102cd2078874c370 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 18 Sep 2024 11:57:02 +0200 Subject: [PATCH 392/545] Removed unused patches --- firefox.spec | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/firefox.spec b/firefox.spec index b25ec13..a85ee4d 100644 --- a/firefox.spec +++ b/firefox.spec @@ -589,11 +589,6 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch -P80 -p1 -b .wasi %endif -# Test patches -#%patch100 -p1 -b .firefox-tests-xpcshell -#%patch101 -p1 -b .firefox-tests-reftest -#%patch102 -p1 -b .firefox-tests-xpcshell-freeze - # Fedora patches %patch -P215 -p1 -b .addons %patch -P219 -p1 -b .rhbz-1173156 @@ -605,8 +600,6 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch -P229 -p1 -b .firefox-nss-addon-hack %patch -P230 -p1 -b .firefox-enable-vaapi %patch -P231 -p1 -b .fedora-customization -#%patch241 -p1 -b .kde-integration-toolkit -#%patch242 -p1 -b .kde-integration %patch -P402 -p1 -b .1196777 %patch -P407 -p1 -b .1667096 @@ -626,9 +619,6 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %endif %patch -P603 -p1 -b .inline -#%patch800 -p1 -b .system-av1 -#%patch801 -p1 -b .system-av1-fixup - rm -f .mozconfig cp %{SOURCE10} .mozconfig echo "ac_add_options --enable-default-toolkit=cairo-gtk3-wayland" >> .mozconfig From 551e155c735b98d1eec2a9348a7d7eaede1f16e5 Mon Sep 17 00:00:00 2001 From: Songsong Zhang Date: Tue, 23 Jul 2024 07:00:30 +0000 Subject: [PATCH 393/545] Add v4l2test file for RISC-V --- firefox.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index a85ee4d..94ab52c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -197,7 +197,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 130.0.1 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -1226,7 +1226,7 @@ fi %{mozappdir}/platform.ini %{mozappdir}/gmp-clearkey %{mozappdir}/fonts/TwemojiMozilla.ttf -%ifarch aarch64 +%ifarch aarch64 riscv64 %{mozappdir}/v4l2test %endif %{mozappdir}/vaapitest @@ -1240,6 +1240,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Sep 20 2024 Songsong Zhang - 130.0.1-2 +- Add v4l2test file for RISC-V + * Wed Sep 18 2024 Martin Stransky - 130.0.1-1 - Updated to 130.0.1 From 6483fd4d669df73ab7c9054a458afd9708627f43 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 23 Sep 2024 15:22:16 +0200 Subject: [PATCH 394/545] Fix PipeWire camera support enablement for F41+ Additional WebRTC backports for PipeWire camera support --- firefox.spec | 14 +- ...r-each-format-when-specified-as-list.patch | 31 ++++ ...m-parameters-specified-by-capability.patch | 137 ++++++++++++++++++ 3 files changed, 180 insertions(+), 2 deletions(-) create mode 100644 libwebrtc-pipewire-camera-get-max-fps-for-each-format-when-specified-as-list.patch create mode 100644 libwebrtc-pipewire-camera-use-exact-stream-parameters-specified-by-capability.patch diff --git a/firefox.spec b/firefox.spec index 94ab52c..d09df34 100644 --- a/firefox.spec +++ b/firefox.spec @@ -197,7 +197,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 130.0.1 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -301,6 +301,10 @@ Patch502: pipewire-camera-always-register-video-input-feedback-for-newly- Patch503: libwebrtc-pipewire-camera-make-member-variable-with-pipewire-status-updated.patch # https://phabricator.services.mozilla.com/D219218 Patch504: pipewire-camera-add-missing-support-for-device-change-notification.patch +# https://phabricator.services.mozilla.com/D223112 +Patch505: libwebrtc-pipewire-camera-get-max-fps-for-each-format-when-specified-as-list.patch +# https://phabricator.services.mozilla.com/D223112 +Patch506: libwebrtc-pipewire-camera-use-exact-stream-parameters-specified-by-capability.patch # PGO/LTO patches Patch600: pgo.patch @@ -609,6 +613,8 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch -P502 -p1 -b .always-register-video-input-feedback-for-newly-created-deviceinfo %patch -P503 -p1 -b .make-member-variable-with-pipewire-status-updated %patch -P504 -p1 -b .add-missing-support-for-device-change-notification +%patch -P505 -p1 -b .get-max-fps-for-each-format-when-specified-as-list +%patch -P506 -p1 -b .use-exact-stream-parameters-specified-by-capability # PGO patches %if %{build_with_pgo} @@ -1095,7 +1101,7 @@ echo 'pref("widget.use-xdg-desktop-portal.file-picker", 1);' >> %{buildroot}%{mo %endif %if %{?use_pipewire_camera} -echo 'pref("media.webrtc.camera.allow-pipewire", 1);' >> %{buildroot}%{mozappdir}/browser/defaults/preferences/firefox-redhat-default-prefs.js +echo 'pref("media.webrtc.camera.allow-pipewire", true);' >> %{buildroot}%{mozappdir}/browser/defaults/preferences/firefox-redhat-default-prefs.js %endif # Add distribution.ini @@ -1240,6 +1246,10 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Sep 23 2024 Jan Grulich - 130.0.1-3 +- Fix PipeWire camera support enablement for F41+ +- Additional WebRTC backports for PipeWire camera support + * Fri Sep 20 2024 Songsong Zhang - 130.0.1-2 - Add v4l2test file for RISC-V diff --git a/libwebrtc-pipewire-camera-get-max-fps-for-each-format-when-specified-as-list.patch b/libwebrtc-pipewire-camera-get-max-fps-for-each-format-when-specified-as-list.patch new file mode 100644 index 0000000..1bea098 --- /dev/null +++ b/libwebrtc-pipewire-camera-get-max-fps-for-each-format-when-specified-as-list.patch @@ -0,0 +1,31 @@ +diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc +index 0b78c16..641e523 100644 +--- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc ++++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc +@@ -17,6 +17,8 @@ + #include + #include + ++#include ++ + #include "common_video/libyuv/include/webrtc_libyuv.h" + #include "modules/video_capture/device_info_impl.h" + #include "rtc_base/logging.h" +@@ -148,9 +150,15 @@ void PipeWireNode::OnNodeParam(void* data, + + fract = static_cast(SPA_POD_BODY(val)); + +- if (choice == SPA_CHOICE_None) ++ if (choice == SPA_CHOICE_None) { + cap.maxFPS = 1.0 * fract[0].num / fract[0].denom; +- else if (choice == SPA_CHOICE_Range && fract[1].num > 0) ++ } else if (choice == SPA_CHOICE_Enum) { ++ for (uint32_t i = 1; i < n_items; i++) { ++ cap.maxFPS = std::max( ++ static_cast(1.0 * fract[i].num / fract[i].denom), ++ cap.maxFPS); ++ } ++ } else if (choice == SPA_CHOICE_Range && fract[1].num > 0) + cap.maxFPS = 1.0 * fract[1].num / fract[1].denom; + } + } diff --git a/libwebrtc-pipewire-camera-use-exact-stream-parameters-specified-by-capability.patch b/libwebrtc-pipewire-camera-use-exact-stream-parameters-specified-by-capability.patch new file mode 100644 index 0000000..472eb79 --- /dev/null +++ b/libwebrtc-pipewire-camera-use-exact-stream-parameters-specified-by-capability.patch @@ -0,0 +1,137 @@ +diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc +index 1672b75..2338fa6 100644 +--- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc ++++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc +@@ -51,10 +51,20 @@ VideoType VideoCaptureModulePipeWire::PipeWireRawFormatToVideoType( + if (spa_and_pixel_format.spa_format == spa_format) + return spa_and_pixel_format.video_type; + } +- RTC_LOG(LS_INFO) << "Unsupported pixel format: " << spa_format; ++ RTC_LOG(LS_WARNING) << "Unsupported pixel format: " << spa_format; + return VideoType::kUnknown; + } + ++uint32_t VideoCaptureModulePipeWire::VideoTypeToPipeWireRawFormat( ++ VideoType type) { ++ for (const auto& spa_and_pixel_format : kSupportedFormats) { ++ if (spa_and_pixel_format.video_type == type) ++ return spa_and_pixel_format.spa_format; ++ } ++ RTC_LOG(LS_WARNING) << "Unsupported video type: " << static_cast(type); ++ return SPA_VIDEO_FORMAT_UNKNOWN; ++} ++ + VideoCaptureModulePipeWire::VideoCaptureModulePipeWire( + VideoCaptureOptions* options) + : VideoCaptureImpl(), +@@ -87,45 +97,53 @@ int32_t VideoCaptureModulePipeWire::Init(const char* deviceUniqueId) { + } + + static spa_pod* BuildFormat(spa_pod_builder* builder, +- uint32_t format, ++ VideoType video_type, + uint32_t width, + uint32_t height, + float frame_rate) { +- spa_pod_frame frames[2]; ++ spa_pod_frame frame; ++ ++ const uint32_t media_subtype = video_type == VideoType::kMJPEG ++ ? SPA_MEDIA_SUBTYPE_mjpg ++ : SPA_MEDIA_SUBTYPE_raw; + +- spa_pod_builder_push_object(builder, &frames[0], SPA_TYPE_OBJECT_Format, ++ spa_pod_builder_push_object(builder, &frame, SPA_TYPE_OBJECT_Format, + SPA_PARAM_EnumFormat); + spa_pod_builder_add(builder, SPA_FORMAT_mediaType, + SPA_POD_Id(SPA_MEDIA_TYPE_video), SPA_FORMAT_mediaSubtype, +- SPA_POD_Id(format), 0); +- +- if (format == SPA_MEDIA_SUBTYPE_raw) { +- spa_pod_builder_prop(builder, SPA_FORMAT_VIDEO_format, 0); +- spa_pod_builder_push_choice(builder, &frames[1], SPA_CHOICE_Enum, 0); +- spa_pod_builder_id(builder, kSupportedFormats[0].spa_format); +- for (const auto& spa_and_pixel_format : kSupportedFormats) +- spa_pod_builder_id(builder, spa_and_pixel_format.spa_format); +- spa_pod_builder_pop(builder, &frames[1]); +- } ++ SPA_POD_Id(media_subtype), 0); + +- spa_rectangle preferred_size = spa_rectangle{width, height}; +- spa_rectangle min_size = spa_rectangle{1, 1}; +- spa_rectangle max_size = spa_rectangle{4096, 4096}; +- spa_pod_builder_add( +- builder, SPA_FORMAT_VIDEO_size, +- SPA_POD_CHOICE_RANGE_Rectangle(&preferred_size, &min_size, &max_size), 0); ++ if (media_subtype == SPA_MEDIA_SUBTYPE_raw) { ++ const uint32_t format = ++ VideoCaptureModulePipeWire::VideoTypeToPipeWireRawFormat(video_type); ++ RTC_CHECK(format != SPA_VIDEO_FORMAT_UNKNOWN); ++ spa_pod_builder_add(builder, SPA_FORMAT_VIDEO_format, SPA_POD_Id(format), ++ 0); ++ } + +- spa_fraction preferred_frame_rate = +- spa_fraction{static_cast(frame_rate), 1}; +- spa_fraction min_frame_rate = spa_fraction{0, 1}; +- spa_fraction max_frame_rate = spa_fraction{INT32_MAX, 1}; +- spa_pod_builder_add( +- builder, SPA_FORMAT_VIDEO_framerate, +- SPA_POD_CHOICE_RANGE_Fraction(&preferred_frame_rate, &min_frame_rate, +- &max_frame_rate), +- 0); ++ spa_rectangle resolution = spa_rectangle{width, height}; ++ spa_pod_builder_add(builder, SPA_FORMAT_VIDEO_size, ++ SPA_POD_Rectangle(&resolution), 0); ++ ++ // Framerate can be also set to 0 to be unspecified ++ if (frame_rate) { ++ spa_fraction framerate = spa_fraction{static_cast(frame_rate), 1}; ++ spa_pod_builder_add(builder, SPA_FORMAT_VIDEO_framerate, ++ SPA_POD_Fraction(&framerate), 0); ++ } else { ++ // Default to some reasonable values ++ spa_fraction preferred_frame_rate = ++ spa_fraction{static_cast(30), 1}; ++ spa_fraction min_frame_rate = spa_fraction{1, 1}; ++ spa_fraction max_frame_rate = spa_fraction{30, 1}; ++ spa_pod_builder_add( ++ builder, SPA_FORMAT_VIDEO_framerate, ++ SPA_POD_CHOICE_RANGE_Fraction(&preferred_frame_rate, &min_frame_rate, ++ &max_frame_rate), ++ 0); ++ } + +- return static_cast(spa_pod_builder_pop(builder, &frames[0])); ++ return static_cast(spa_pod_builder_pop(builder, &frame)); + } + + int32_t VideoCaptureModulePipeWire::StartCapture( +@@ -176,13 +194,10 @@ int32_t VideoCaptureModulePipeWire::StartCapture( + uint32_t width = capability.width; + uint32_t height = capability.height; + uint32_t frame_rate = capability.maxFPS; +- bool prefer_jpeg = (width > 640) || (height > 480); ++ VideoType video_type = capability.videoType; + + params.push_back( +- BuildFormat(&builder, SPA_MEDIA_SUBTYPE_raw, width, height, frame_rate)); +- params.insert( +- prefer_jpeg ? params.begin() : params.end(), +- BuildFormat(&builder, SPA_MEDIA_SUBTYPE_mjpg, width, height, frame_rate)); ++ BuildFormat(&builder, video_type, width, height, frame_rate)); + + int res = pw_stream_connect( + stream_, PW_DIRECTION_INPUT, node_id_, +diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h +index eeb3b94..789f203 100644 +--- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h ++++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h +@@ -28,6 +28,7 @@ class VideoCaptureModulePipeWire : public VideoCaptureImpl { + int32_t CaptureSettings(VideoCaptureCapability& settings) override; + + static VideoType PipeWireRawFormatToVideoType(uint32_t format); ++ static uint32_t VideoTypeToPipeWireRawFormat(VideoType type); + + private: + static void OnStreamParamChanged(void* data, From 6b8e086d0ffdb3fe2f3a56c0edbce2bbd3e82276 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 25 Sep 2024 09:32:15 +0200 Subject: [PATCH 395/545] Added fix for mzbz#1634961 --- .gitignore | 2 + D220671.patch | 270 ++++++++++++++++++++++++++++++++++++++++++++++++++ firefox.spec | 10 +- sources | 4 +- wasi.patch | 2 +- 5 files changed, 283 insertions(+), 5 deletions(-) create mode 100644 D220671.patch diff --git a/.gitignore b/.gitignore index b323ef9..9c5fe26 100644 --- a/.gitignore +++ b/.gitignore @@ -658,3 +658,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-130.0.source.tar.xz /firefox-130.0.1.source.tar.xz /firefox-langpacks-130.0.1-20240918.tar.xz +/firefox-langpacks-131.0-20240924.tar.xz +/firefox-131.0.source.tar.xz diff --git a/D220671.patch b/D220671.patch new file mode 100644 index 0000000..e5d659b --- /dev/null +++ b/D220671.patch @@ -0,0 +1,270 @@ +diff -up firefox-131.0/browser/components/shell/moz.build.D220671 firefox-131.0/browser/components/shell/moz.build +--- firefox-131.0/browser/components/shell/moz.build.D220671 2024-09-23 19:59:58.000000000 +0200 ++++ firefox-131.0/browser/components/shell/moz.build 2024-09-25 08:55:09.196886415 +0200 +@@ -35,8 +35,11 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "coco + elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": + XPIDL_SOURCES += [ + "nsIGNOMEShellService.idl", ++ "nsIOpenTabsProvider.idl", ++ ] ++ EXTRA_JS_MODULES += [ ++ "OpenTabsProvider.sys.mjs", + ] +- + SOURCES += [ + "nsGNOMEShellService.cpp", + ] +diff -up firefox-131.0/browser/components/shell/nsGNOMEShellDBusHelper.cpp.D220671 firefox-131.0/browser/components/shell/nsGNOMEShellDBusHelper.cpp +--- firefox-131.0/browser/components/shell/nsGNOMEShellDBusHelper.cpp.D220671 2024-09-23 19:59:58.000000000 +0200 ++++ firefox-131.0/browser/components/shell/nsGNOMEShellDBusHelper.cpp 2024-09-25 09:01:04.080111999 +0200 +@@ -13,6 +13,8 @@ + #include "nsPrintfCString.h" + #include "mozilla/XREAppData.h" + #include "nsAppRunner.h" ++#include "nsImportModule.h" ++#include "nsIOpenTabsProvider.h" + + #define DBUS_BUS_NAME_TEMPLATE "org.mozilla.%s.SearchProvider" + #define DBUS_OBJECT_PATH_TEMPLATE "/org/mozilla/%s/SearchProvider" +@@ -65,12 +67,23 @@ static bool GetGnomeSearchTitle(const ch + } + + int DBusGetIndexFromIDKey(const char* aIDKey) { +- // ID is NN:URL where NN is index to our current history ++ // ID is NN:S:URL where NN is index to our current history + // result container. + char tmp[] = {aIDKey[0], aIDKey[1], '\0'}; + return atoi(tmp); + } + ++char DBusGetStateFromIDKey(const char* aIDKey) { ++ // ID is NN:S:URL where NN is index to our current history ++ // result container, and S is the state, which can be 'o'pen or 'h'istory ++ if (std::strlen(aIDKey) > 3) { ++ return aIDKey[3]; ++ } ++ // Should never happen, but just to avoid any possible segfault, we ++ // default to state 'history'. ++ return 'h'; ++} ++ + static void ConcatArray(nsACString& aOutputStr, const char** aStringArray) { + for (const char** term = aStringArray; *term; term++) { + aOutputStr.Append(*term); +@@ -151,6 +164,7 @@ static already_AddRefed DBusAp + aSearchResult->GetSearchResultContainer(); + + int index = DBusGetIndexFromIDKey(aID); ++ char state = DBusGetStateFromIDKey(aID); + nsCOMPtr child; + container->GetChild(index, getter_AddRefs(child)); + nsAutoCString title; +@@ -164,6 +178,12 @@ static already_AddRefed DBusAp + } + } + ++ // Check if the URI state is "open tab". If so, mark it with an asterisk to ++ // indicate this to the user. ++ if (state == 'o') { ++ title = "(*) "_ns + title; ++ } ++ + GVariantBuilder b; + g_variant_builder_init(&b, G_VARIANT_TYPE("a{sv}")); + +@@ -265,6 +285,7 @@ static void ActivateResultID( + ConstructCommandLine(std::size(urlList), urlList, nullptr, &tmp); + } else { + int keyIndex = atoi(aResultID); ++ char state = DBusGetStateFromIDKey(aResultID); + nsCOMPtr child; + aSearchResult->GetSearchResultContainer()->GetChild(keyIndex, + getter_AddRefs(child)); +@@ -278,6 +299,22 @@ static void ActivateResultID( + return; + } + ++ // If the state of the URI is 'o'pen, we send it along to JS and let ++ // it switch the tab accordingly ++ if (state == 'o') { ++ // If we can't successfully switch to an open tab, use the existing ++ // 'open in a new tab'-mechanism as a fallback. ++ nsresult rv; ++ nsCOMPtr provider = do_ImportESModule( ++ "resource:///modules/OpenTabsProvider.sys.mjs", &rv); ++ if (NS_SUCCEEDED(rv)) { ++ rv = provider->SwitchToOpenTab(uri); ++ if (NS_SUCCEEDED(rv)) { ++ return; ++ } ++ } ++ } ++ + const char* urlList[2] = {"unused", uri.get()}; + commandLine = + ConstructCommandLine(std::size(urlList), urlList, nullptr, &tmp); +diff -up firefox-131.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.D220671 firefox-131.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp +--- firefox-131.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.D220671 2024-09-23 19:59:58.000000000 +0200 ++++ firefox-131.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp 2024-09-25 08:55:09.197886449 +0200 +@@ -20,7 +20,8 @@ + #include "nsServiceManagerUtils.h" + #include "mozilla/GUniquePtr.h" + #include "mozilla/UniquePtrExtensions.h" +- ++#include "nsImportModule.h" ++#include "nsIOpenTabsProvider.h" + #include "imgIContainer.h" + #include "imgITools.h" + +@@ -70,7 +71,7 @@ class AsyncFaviconDataReady final : publ + int aIconIndex, int aTimeStamp) + : mSearchResult(std::move(aSearchResult)), + mIconIndex(aIconIndex), +- mTimeStamp(aTimeStamp) {}; ++ mTimeStamp(aTimeStamp) {} + + private: + ~AsyncFaviconDataReady() {} +@@ -412,10 +413,11 @@ nsresult nsGNOMEShellHistoryService::Que + } + + static void DBusGetIDKeyForURI(int aIndex, nsAutoCString& aUri, +- nsAutoCString& aIDKey) { +- // Compose ID as NN:URL where NN is index to our current history +- // result container. +- aIDKey = nsPrintfCString("%.2d:%s", aIndex, aUri.get()); ++ nsAutoCString& aIDKey, bool isOpen) { ++ // Compose ID as NN:S:URL where NN is index to our current history ++ // result container and S is the state, which can be 'o'pen or 'h'istory ++ aIDKey = ++ nsPrintfCString("%.2d:%c:%s", aIndex, isOpen ? 'o' : 'h', aUri.get()); + } + + // Send (as) rearch result reply +@@ -456,8 +458,15 @@ void nsGNOMEShellHistorySearchResult::Ha + new AsyncFaviconDataReady(this, i, mTimeStamp); + favIconSvc->GetFaviconDataForPage(iconIri, callback, 0); + ++ bool isOpen = false; ++ for (const auto& openuri : mOpenTabs) { ++ if (openuri.Equals(uri)) { ++ isOpen = true; ++ break; ++ } ++ } + nsAutoCString idKey; +- DBusGetIDKeyForURI(i, uri, idKey); ++ DBusGetIDKeyForURI(i, uri, idKey, isOpen); + + g_variant_builder_add(&b, "s", idKey.get()); + } +@@ -479,8 +488,30 @@ void nsGNOMEShellHistorySearchResult::Re + // latest requested search timestamp). + if (mSearchProvider->SetSearchResult(this)) { + mHistResultContainer = aHistResultContainer; +- HandleSearchResultReply(); + } ++ ++ // Getting the currently open tabs to mark them accordingly ++ nsresult rv; ++ nsCOMPtr provider = ++ do_ImportESModule("resource:///modules/OpenTabsProvider.sys.mjs", &rv); ++ if (NS_FAILED(rv)) { ++ // Don't fail, just log an error message ++ NS_WARNING("Failed to determine currently open tabs. Using history only."); ++ } ++ ++ nsTArray openTabs; ++ if (provider) { ++ rv = provider->GetOpenTabs(openTabs); ++ if (NS_FAILED(rv)) { ++ // Don't fail, just log an error message ++ NS_WARNING( ++ "Failed to determine currently open tabs. Using history only."); ++ } ++ } ++ // In case of error, we just clear out mOpenTabs with an empty new array ++ mOpenTabs = std::move(openTabs); ++ ++ HandleSearchResultReply(); + } + + void nsGNOMEShellHistorySearchResult::SetHistoryIcon(int aTimeStamp, +diff -up firefox-131.0/browser/components/shell/nsGNOMEShellSearchProvider.h.D220671 firefox-131.0/browser/components/shell/nsGNOMEShellSearchProvider.h +--- firefox-131.0/browser/components/shell/nsGNOMEShellSearchProvider.h.D220671 2024-09-23 19:59:58.000000000 +0200 ++++ firefox-131.0/browser/components/shell/nsGNOMEShellSearchProvider.h 2024-09-25 08:55:09.197886449 +0200 +@@ -23,7 +23,7 @@ class nsGNOMEShellSearchProvider; + + class GnomeHistoryIcon { + public: +- GnomeHistoryIcon() : mTimeStamp(-1), mWidth(0), mHeight(0) {}; ++ GnomeHistoryIcon() : mTimeStamp(-1), mWidth(0), mHeight(0) {} + + // From which search is this icon + void Set(int aTimeStamp, mozilla::UniquePtr aData, int aWidth, +@@ -58,7 +58,7 @@ class nsGNOMEShellHistorySearchResult : + GDBusConnection* aConnection, int aTimeStamp) + : mSearchProvider(aSearchProvider), + mConnection(aConnection), +- mTimeStamp(aTimeStamp) {}; ++ mTimeStamp(aTimeStamp) {} + + void SetReply(RefPtr aReply) { + mReply = std::move(aReply); +@@ -96,6 +96,7 @@ class nsGNOMEShellHistorySearchResult : + private: + nsGNOMEShellSearchProvider* mSearchProvider; + nsCOMPtr mHistResultContainer; ++ nsTArray mOpenTabs; + nsAutoCString mSearchTerm; + RefPtr mReply; + GDBusConnection* mConnection = nullptr; +diff -up firefox-131.0/browser/components/shell/nsIOpenTabsProvider.idl.D220671 firefox-131.0/browser/components/shell/nsIOpenTabsProvider.idl +--- firefox-131.0/browser/components/shell/nsIOpenTabsProvider.idl.D220671 2024-09-25 08:55:09.197886449 +0200 ++++ firefox-131.0/browser/components/shell/nsIOpenTabsProvider.idl 2024-09-25 08:55:09.197886449 +0200 +@@ -0,0 +1,19 @@ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#include "nsISupports.idl" ++ ++[scriptable, uuid(46e3e300-a45a-45b0-ac68-016e9496bf98)] ++interface nsIOpenTabsProvider : nsISupports ++{ ++ /** ++ * List of currently open public tabs ++ */ ++ Array getOpenTabs(); ++ ++ /** ++ * Function to switch current tab to a given already open URL ++ */ ++ void switchToOpenTab(in AUTF8String url); ++}; +diff -up firefox-131.0/browser/components/shell/OpenTabsProvider.sys.mjs.D220671 firefox-131.0/browser/components/shell/OpenTabsProvider.sys.mjs +--- firefox-131.0/browser/components/shell/OpenTabsProvider.sys.mjs.D220671 2024-09-25 08:55:09.197886449 +0200 ++++ firefox-131.0/browser/components/shell/OpenTabsProvider.sys.mjs 2024-09-25 08:55:09.197886449 +0200 +@@ -0,0 +1,22 @@ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++const lazy = {}; ++ ++ChromeUtils.defineESModuleGetters(lazy, { ++ BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", ++ UrlbarProviderOpenTabs: "resource:///modules/UrlbarProviderOpenTabs.sys.mjs", ++}); ++ ++export function getOpenTabs() { ++ // We only want public tabs, so isInPrivateWindow = false ++ let urls = lazy.UrlbarProviderOpenTabs.getOpenTabUrls(false); ++ return Array.from(urls.keys()); ++} ++ ++export function switchToOpenTab(url) { ++ // We only want public tabs, so skip private top windows ++ let win = lazy.BrowserWindowTracker.getTopWindow({ private: false }); ++ win?.switchToTabHavingURI(url); ++} diff --git a/firefox.spec b/firefox.spec index a85ee4d..e76ef44 100644 --- a/firefox.spec +++ b/firefox.spec @@ -196,14 +196,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 130.0.1 +Version: 131.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240918.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20240924.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -287,6 +287,7 @@ Patch421: D209911.1715685535.diff Patch422: D210158.1715685536.diff Patch423: D210159.1715685538.diff Patch424: D210430.1715848796.diff +Patch425: D220671.patch # PipeWire camera upstream patches # https://phabricator.services.mozilla.com/D219224 @@ -604,6 +605,8 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch -P402 -p1 -b .1196777 %patch -P407 -p1 -b .1667096 +%patch -P425 -p1 -b .D220671 + %patch -P500 -p1 -b .filter-out-devices-with-no-capabilities %patch -P501 -p1 -b .always-query-information-about-camera-availability %patch -P502 -p1 -b .always-register-video-input-feedback-for-newly-created-deviceinfo @@ -1240,6 +1243,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Sep 25 2024 Martin Stransky - 131.0-1 +- Added fix for mzbz#1634961 + * Wed Sep 18 2024 Martin Stransky - 130.0.1-1 - Updated to 130.0.1 diff --git a/sources b/sources index bfc2f88..33af059 100644 --- a/sources +++ b/sources @@ -2,5 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a -SHA512 (firefox-130.0.1.source.tar.xz) = 163d1ce9f671a4716686955c43ff23d9f200f6c52dfdabcbb93af6a326c24aa5096404f42447b02b5a3ad02e2f60d17271783638fe027d24865aebb3e70e97fe -SHA512 (firefox-langpacks-130.0.1-20240918.tar.xz) = 5da9f6a16e406859d04580bf4636ec5c6ac85232f199fb56c2c6a0b447f86f6557b730491012420faf02af14410c73de9f3e86fde707a7c5527078423b2b2c22 +SHA512 (firefox-langpacks-131.0-20240924.tar.xz) = be7d03f1dbe316b28fc02bb4bc1c67a3a43d1f97027f39bcf90d12a1a4acedd1e7c16cb8e41d1b252fb746186e983f062c2795f0a7d397df932ba49515f54248 +SHA512 (firefox-131.0.source.tar.xz) = 324cbaadff4d19a18d56ca01ae7212ac8362e3f5933f3017a19b64c35d58606ace8bba3672790ecb48d4a849619cdc95701440701725e8eb2859d55f1e8d8e3c diff --git a/wasi.patch b/wasi.patch index 22a7489..ad1e91c 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-130.0.1/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-131.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From e86d77bc73141e32543e727789afbe923b6f48bb Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 25 Sep 2024 09:35:06 +0200 Subject: [PATCH 396/545] Updated to 131.0 --- firefox.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/firefox.spec b/firefox.spec index 2f58b42..40c19d8 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1251,6 +1251,7 @@ fi %changelog * Wed Sep 25 2024 Martin Stransky - 131.0-1 - Added fix for mzbz#1634961 +- Updated to 131.0 * Mon Sep 23 2024 Jan Grulich - 130.0.1-3 - Fix PipeWire camera support enablement for F41+ From 0bec6f6cb8eef665ee7c9217daddd6a389dd428e Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 30 Sep 2024 09:26:43 +0200 Subject: [PATCH 397/545] Fix regression from mzbz#1634961 - enable Gnome Shell search in opened tabs, Temporary disabled PGO due to build issues --- D224089.patch | 35 +++++++++++++++++++++++++++++++++++ firefox.spec | 12 +++++++++--- 2 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 D224089.patch diff --git a/D224089.patch b/D224089.patch new file mode 100644 index 0000000..b1609af --- /dev/null +++ b/D224089.patch @@ -0,0 +1,35 @@ +diff --git a/browser/components/shell/nsGNOMEShellSearchProvider.cpp b/browser/components/shell/nsGNOMEShellSearchProvider.cpp +--- a/browser/components/shell/nsGNOMEShellSearchProvider.cpp ++++ b/browser/components/shell/nsGNOMEShellSearchProvider.cpp +@@ -421,10 +421,11 @@ + } + + // Send (as) rearch result reply + void nsGNOMEShellHistorySearchResult::HandleSearchResultReply() { + MOZ_ASSERT(mReply); ++ MOZ_ASSERT(mHistResultContainer); + + GVariantBuilder b; + g_variant_builder_init(&b, G_VARIANT_TYPE("as")); + + uint32_t childCount = 0; +@@ -484,14 +485,16 @@ + void nsGNOMEShellHistorySearchResult::ReceiveSearchResultContainer( + nsCOMPtr aHistResultContainer) { + // Propagate search results to nsGNOMEShellSearchProvider. + // SetSearchResult() checks this is up-to-date search (our time stamp matches + // latest requested search timestamp). +- if (mSearchProvider->SetSearchResult(this)) { +- mHistResultContainer = aHistResultContainer; ++ if (!mSearchProvider->SetSearchResult(this)) { ++ return; + } + ++ mHistResultContainer = aHistResultContainer; ++ + // Getting the currently open tabs to mark them accordingly + nsresult rv; + nsCOMPtr provider = + do_ImportESModule("resource:///modules/OpenTabsProvider.sys.mjs", &rv); + if (NS_FAILED(rv)) { + diff --git a/firefox.spec b/firefox.spec index 40c19d8..2e88030 100644 --- a/firefox.spec +++ b/firefox.spec @@ -103,7 +103,7 @@ ExcludeArch: i686 %global build_with_pgo 0 %ifarch x86_64 %if %{release_build} -%global build_with_pgo 1 +%global build_with_pgo 0 %endif %endif %if 0%{?flatpak} @@ -197,7 +197,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 131.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -288,6 +288,7 @@ Patch422: D210158.1715685536.diff Patch423: D210159.1715685538.diff Patch424: D210430.1715848796.diff Patch425: D220671.patch +Patch426: D224089.patch # PipeWire camera upstream patches # https://phabricator.services.mozilla.com/D219224 @@ -610,6 +611,7 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch -P407 -p1 -b .1667096 %patch -P425 -p1 -b .D220671 +%patch -P426 -p1 -b .D224089 %patch -P500 -p1 -b .filter-out-devices-with-no-capabilities %patch -P501 -p1 -b .always-query-information-about-camera-availability @@ -1249,8 +1251,12 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Sep 30 2024 Martin Stransky - 131.0-2 +- Fix regression from mzbz#1634961 - enable Gnome Shell search in opened tabs +- Temporary disabled PGO due to build issues. + * Wed Sep 25 2024 Martin Stransky - 131.0-1 -- Added fix for mzbz#1634961 +- Added fix for mzbz#1634961 - enable Gnome Shell search in opened tabs - Updated to 131.0 * Mon Sep 23 2024 Jan Grulich - 130.0.1-3 From 3abe4b4c2f4e5a722bb7a74d25c14201af9babbe Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 9 Oct 2024 09:07:10 +0200 Subject: [PATCH 398/545] Updated to 131.0.2 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 9c5fe26..880f560 100644 --- a/.gitignore +++ b/.gitignore @@ -660,3 +660,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-130.0.1-20240918.tar.xz /firefox-langpacks-131.0-20240924.tar.xz /firefox-131.0.source.tar.xz +/firefox-131.0.2.source.tar.xz +/firefox-langpacks-131.0.2-20241009.tar.xz diff --git a/firefox.spec b/firefox.spec index 2e88030..801014f 100644 --- a/firefox.spec +++ b/firefox.spec @@ -196,14 +196,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 131.0 -Release: 2%{?pre_tag}%{?dist} +Version: 131.0.2 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20240924.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20241009.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1251,6 +1251,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Oct 09 2024 Martin Stransky - 131.0.2-1 +- Updated to 131.0.2 + * Mon Sep 30 2024 Martin Stransky - 131.0-2 - Fix regression from mzbz#1634961 - enable Gnome Shell search in opened tabs - Temporary disabled PGO due to build issues. diff --git a/sources b/sources index 33af059..0d2ddc5 100644 --- a/sources +++ b/sources @@ -2,5 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a -SHA512 (firefox-langpacks-131.0-20240924.tar.xz) = be7d03f1dbe316b28fc02bb4bc1c67a3a43d1f97027f39bcf90d12a1a4acedd1e7c16cb8e41d1b252fb746186e983f062c2795f0a7d397df932ba49515f54248 -SHA512 (firefox-131.0.source.tar.xz) = 324cbaadff4d19a18d56ca01ae7212ac8362e3f5933f3017a19b64c35d58606ace8bba3672790ecb48d4a849619cdc95701440701725e8eb2859d55f1e8d8e3c +SHA512 (firefox-131.0.2.source.tar.xz) = fb1a1179a8c62de975c93e1ac6f058cb5492e955bbb7ac2d4b83cdd14ba17bdb2450078bd6f626124b14542f3fda9514bea476aaa34ff4f5a2bee6b1625ec963 +SHA512 (firefox-langpacks-131.0.2-20241009.tar.xz) = 64abb95544cc798bdd97db958c7c376d50eb3255cfcddb335d9591870c3bc71793e3c0692c682b50ebaa80811538086be8dbb6696919df04fb90ee37588c881d From 98b5183c32db72c321e2a2a0ece74789c8c494f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 10 Oct 2024 15:59:20 +0200 Subject: [PATCH 399/545] Properly obsolete firefox-{x11,wayland} MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On my system I still have firefox-x11-122.0.1-1.fc39.x86_64. I started looking at why this package was not removed… That version compares higher than 122.0-2, so the Obsoletes that were present were not effective. Since F39 builds of firefox still include firefox-x11, the version in Obsoletes has to be made dynamic. (This could even be considered a small security problem. Even though I'm an avid firefox user, I don't follow the details of packaging, so I wasn't aware that the -x11 subpackage was dropped. In the gnome app overview, I see both "Firefox" and "Firefox on x11" and nothing indicates that one of them is very old and insecure. I could easily click on the wrong icon and use a vulnerable version.) --- firefox.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index 801014f..b9fb930 100644 --- a/firefox.spec +++ b/firefox.spec @@ -497,9 +497,12 @@ Provides: webclient # Don't ship firefox-x11 and firefox-wayland on Fedora 40. # Wayland backend is considered as mature enough now. +# We need to use v-r in Obsoletes because new versions of this +# package keep being built in older releases, and we want to +# obsolete all of them when the user updates to F40+. %if 0%{?fedora} >= 40 -Obsoletes: firefox-wayland < 122.0-2 -Obsoletes: firefox-x11 < 122.0-2 +Obsoletes: firefox-wayland < %{version}-%{release} +Obsoletes: firefox-x11 < %{version}-%{release} %endif %description From 70f2a5c6d7ede91a2a1ae316ec5cffa704f1ef78 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 15 Oct 2024 12:47:01 +0200 Subject: [PATCH 400/545] Updated to 131.0.3 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- wasi.patch | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 880f560..ece73d2 100644 --- a/.gitignore +++ b/.gitignore @@ -662,3 +662,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-131.0.source.tar.xz /firefox-131.0.2.source.tar.xz /firefox-langpacks-131.0.2-20241009.tar.xz +/firefox-131.0.3.source.tar.xz +/firefox-langpacks-131.0.3-20241015.tar.xz diff --git a/firefox.spec b/firefox.spec index 801014f..f257e83 100644 --- a/firefox.spec +++ b/firefox.spec @@ -196,14 +196,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 131.0.2 +Version: 131.0.3 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20241009.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20241015.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1251,6 +1251,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Oct 15 2024 Martin Stransky - 131.0.3-1 +- Updated to 131.0.3 + * Wed Oct 09 2024 Martin Stransky - 131.0.2-1 - Updated to 131.0.2 diff --git a/sources b/sources index 0d2ddc5..f9a40c8 100644 --- a/sources +++ b/sources @@ -2,5 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a -SHA512 (firefox-131.0.2.source.tar.xz) = fb1a1179a8c62de975c93e1ac6f058cb5492e955bbb7ac2d4b83cdd14ba17bdb2450078bd6f626124b14542f3fda9514bea476aaa34ff4f5a2bee6b1625ec963 -SHA512 (firefox-langpacks-131.0.2-20241009.tar.xz) = 64abb95544cc798bdd97db958c7c376d50eb3255cfcddb335d9591870c3bc71793e3c0692c682b50ebaa80811538086be8dbb6696919df04fb90ee37588c881d +SHA512 (firefox-131.0.3.source.tar.xz) = 3aa96db839f7a45e34c43b5e7e3333e1100ca11545ad26a8e42987fbc72df5ae7ebebe7dfc8c4e856d2bb4676c0516914a07c001f6047799f314146a3329c0ce +SHA512 (firefox-langpacks-131.0.3-20241015.tar.xz) = 7f76e91402f69fa2141566109a7296eaabde531f7963c9ad017d5e5a54dfbc506bda2dbba86955c8a7ba7867953a5402242adb9fa7ced2e1a2ed482316f99a2d diff --git a/wasi.patch b/wasi.patch index ad1e91c..119e795 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-131.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-131.0.3/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 65a47d46b5fd4be38bcad1137b387a3fd240274b Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 16 Oct 2024 07:52:32 +0200 Subject: [PATCH 401/545] Disabled ppc64le on Fedora 39 due to repeated build failures --- firefox.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/firefox.spec b/firefox.spec index f257e83..5f48d75 100644 --- a/firefox.spec +++ b/firefox.spec @@ -6,6 +6,11 @@ # https://bugzilla.redhat.com/show_bug.cgi?id=2129720 ExcludeArch: i686 +# Disabled due to build failures +%if 0%{?fedora} < 40 +ExcludeArch: ppc64le +%endif + # Run Mozilla test suite as a part of compile rpm section. Turn off when # building locally and don't want to spend 24 hours waiting for results. %global run_firefox_tests 0 From 57c29a6f705a35e3e3b1bf39a0c82da89e9b989a Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 21 Oct 2024 13:38:55 +0200 Subject: [PATCH 402/545] Backported hi-res mouse scrolling and hold touchpad gesture support --- D220551.1729586347.diff | 1908 +++++++++++++++++++++++++++++++++++++++ D220551.1729586452.diff | 1908 +++++++++++++++++++++++++++++++++++++++ D221617.1729589907.diff | 123 +++ D221931.1729587190.diff | 80 ++ D222280.1729587199.diff | 65 ++ D222363.1729589473.diff | 73 ++ D223285.1729586039.diff | 478 ++++++++++ D223313.1729587212.diff | 29 + D224842.1729586219.diff | 48 + D225439.1729586066.diff | 223 +++++ D225760.1729586239.diff | 46 + D225868.1729586247.diff | 17 + firefox.spec | 35 +- 13 files changed, 5027 insertions(+), 6 deletions(-) create mode 100644 D220551.1729586347.diff create mode 100644 D220551.1729586452.diff create mode 100644 D221617.1729589907.diff create mode 100644 D221931.1729587190.diff create mode 100644 D222280.1729587199.diff create mode 100644 D222363.1729589473.diff create mode 100644 D223285.1729586039.diff create mode 100644 D223313.1729587212.diff create mode 100644 D224842.1729586219.diff create mode 100644 D225439.1729586066.diff create mode 100644 D225760.1729586239.diff create mode 100644 D225868.1729586247.diff diff --git a/D220551.1729586347.diff b/D220551.1729586347.diff new file mode 100644 index 0000000..2d8c4e0 --- /dev/null +++ b/D220551.1729586347.diff @@ -0,0 +1,1908 @@ +diff --git a/widget/gtk/WidgetUtilsGtk.cpp b/widget/gtk/WidgetUtilsGtk.cpp +--- a/widget/gtk/WidgetUtilsGtk.cpp ++++ b/widget/gtk/WidgetUtilsGtk.cpp +@@ -303,11 +303,11 @@ + }; + #endif + + RefPtr RequestWaylandFocusPromise() { + #ifdef MOZ_WAYLAND +- if (!GdkIsWaylandDisplay() || !KeymapWrapper::GetSeat()) { ++ if (!GdkIsWaylandDisplay() || !WaylandDisplayGet()->GetSeat()) { + LOGW("RequestWaylandFocusPromise() failed."); + return nullptr; + } + + RefPtr sourceWindow = nsWindow::GetFocusedWindow(); +@@ -347,11 +347,11 @@ + xdg_activation_v1_get_activation_token(xdg_activation); + xdg_activation_token_v1_add_listener( + aXdgToken, &token_listener, + new XDGTokenRequest(aXdgToken, transferPromise)); + xdg_activation_token_v1_set_serial(aXdgToken, focusSerial, +- KeymapWrapper::GetSeat()); ++ WaylandDisplayGet()->GetSeat()); + xdg_activation_token_v1_set_surface(aXdgToken, focusSurface); + xdg_activation_token_v1_commit(aXdgToken); + + LOGW("RequestWaylandFocusPromise() XDG Token sent"); + +diff --git a/widget/gtk/mozwayland/mozwayland.h b/widget/gtk/mozwayland/mozwayland.h +--- a/widget/gtk/mozwayland/mozwayland.h ++++ b/widget/gtk/mozwayland/mozwayland.h +@@ -29,14 +29,22 @@ + struct wl_proxy* proxy, uint32_t opcode, + const struct wl_interface* interface, ...); + MOZ_EXPORT struct wl_proxy* wl_proxy_marshal_constructor_versioned( + struct wl_proxy* proxy, uint32_t opcode, + const struct wl_interface* interface, uint32_t version, ...); ++MOZ_EXPORT struct wl_proxy* wl_proxy_marshal_flags( ++ struct wl_proxy* proxy, uint32_t opcode, ++ const struct wl_interface* interface, uint32_t version, uint32_t flags, ++ ...); + MOZ_EXPORT void wl_proxy_destroy(struct wl_proxy* proxy); + MOZ_EXPORT void* wl_proxy_create_wrapper(void* proxy); + MOZ_EXPORT void wl_proxy_wrapper_destroy(void* proxy_wrapper); + ++#ifndef WL_MARSHAL_FLAG_DESTROY ++# define WL_MARSHAL_FLAG_DESTROY (1 << 0) ++#endif ++ + /* We need implement some missing functions from wayland-client-protocol.h + */ + #ifndef WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM + enum wl_data_device_manager_dnd_action { + WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE = 0, +@@ -125,10 +133,407 @@ + wl_proxy_marshal((struct wl_proxy*)wl_surface, WL_SURFACE_DAMAGE_BUFFER, x, y, + width, height); + } + #endif + ++#ifndef WL_POINTER_AXIS_ENUM ++# define WL_POINTER_AXIS_ENUM ++/** ++ * @ingroup iface_wl_pointer ++ * axis types ++ * ++ * Describes the axis types of scroll events. ++ */ ++enum wl_pointer_axis { ++ /** ++ * vertical axis ++ */ ++ WL_POINTER_AXIS_VERTICAL_SCROLL = 0, ++ /** ++ * horizontal axis ++ */ ++ WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1, ++}; ++#endif /* WL_POINTER_AXIS_ENUM */ ++ ++#ifndef WL_POINTER_AXIS_SOURCE_ENUM ++# define WL_POINTER_AXIS_SOURCE_ENUM ++/** ++ * @ingroup iface_wl_pointer ++ * axis source types ++ * ++ * Describes the source types for axis events. This indicates to the ++ * client how an axis event was physically generated; a client may ++ * adjust the user interface accordingly. For example, scroll events ++ * from a "finger" source may be in a smooth coordinate space with ++ * kinetic scrolling whereas a "wheel" source may be in discrete steps ++ * of a number of lines. ++ * ++ * The "continuous" axis source is a device generating events in a ++ * continuous coordinate space, but using something other than a ++ * finger. One example for this source is button-based scrolling where ++ * the vertical motion of a device is converted to scroll events while ++ * a button is held down. ++ * ++ * The "wheel tilt" axis source indicates that the actual device is a ++ * wheel but the scroll event is not caused by a rotation but a ++ * (usually sideways) tilt of the wheel. ++ */ ++enum wl_pointer_axis_source { ++ /** ++ * a physical wheel rotation ++ */ ++ WL_POINTER_AXIS_SOURCE_WHEEL = 0, ++ /** ++ * finger on a touch surface ++ */ ++ WL_POINTER_AXIS_SOURCE_FINGER = 1, ++ /** ++ * continuous coordinate space ++ */ ++ WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2, ++ /** ++ * a physical wheel tilt ++ * @since 6 ++ */ ++ WL_POINTER_AXIS_SOURCE_WHEEL_TILT = 3, ++}; ++/** ++ * @ingroup iface_wl_pointer ++ */ ++# define WL_POINTER_AXIS_SOURCE_WHEEL_TILT_SINCE_VERSION 6 ++#endif /* WL_POINTER_AXIS_SOURCE_ENUM */ ++ ++#ifndef WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM ++# define WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM ++/** ++ * @ingroup iface_wl_pointer ++ * axis relative direction ++ * ++ * This specifies the direction of the physical motion that caused a ++ * wl_pointer.axis event, relative to the wl_pointer.axis direction. ++ */ ++enum wl_pointer_axis_relative_direction { ++ /** ++ * physical motion matches axis direction ++ */ ++ WL_POINTER_AXIS_RELATIVE_DIRECTION_IDENTICAL = 0, ++ /** ++ * physical motion is the inverse of the axis direction ++ */ ++ WL_POINTER_AXIS_RELATIVE_DIRECTION_INVERTED = 1, ++}; ++#endif /* WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM */ ++ ++/** ++ * @ingroup iface_wl_pointer ++ * @struct wl_pointer_listener ++ */ ++struct moz_wl_pointer_listener { ++ /** ++ * enter event ++ * ++ * Notification that this seat's pointer is focused on a certain ++ * surface. ++ * ++ * When a seat's focus enters a surface, the pointer image is ++ * undefined and a client should respond to this event by setting ++ * an appropriate pointer image with the set_cursor request. ++ * @param serial serial number of the enter event ++ * @param surface surface entered by the pointer ++ * @param surface_x surface-local x coordinate ++ * @param surface_y surface-local y coordinate ++ */ ++ void (*enter)(void* data, struct wl_pointer* wl_pointer, uint32_t serial, ++ struct wl_surface* surface, wl_fixed_t surface_x, ++ wl_fixed_t surface_y); ++ /** ++ * leave event ++ * ++ * Notification that this seat's pointer is no longer focused on ++ * a certain surface. ++ * ++ * The leave notification is sent before the enter notification for ++ * the new focus. ++ * @param serial serial number of the leave event ++ * @param surface surface left by the pointer ++ */ ++ void (*leave)(void* data, struct wl_pointer* wl_pointer, uint32_t serial, ++ struct wl_surface* surface); ++ /** ++ * pointer motion event ++ * ++ * Notification of pointer location change. The arguments ++ * surface_x and surface_y are the location relative to the focused ++ * surface. ++ * @param time timestamp with millisecond granularity ++ * @param surface_x surface-local x coordinate ++ * @param surface_y surface-local y coordinate ++ */ ++ void (*motion)(void* data, struct wl_pointer* wl_pointer, uint32_t time, ++ wl_fixed_t surface_x, wl_fixed_t surface_y); ++ /** ++ * pointer button event ++ * ++ * Mouse button click and release notifications. ++ * ++ * The location of the click is given by the last motion or enter ++ * event. The time argument is a timestamp with millisecond ++ * granularity, with an undefined base. ++ * ++ * The button is a button code as defined in the Linux kernel's ++ * linux/input-event-codes.h header file, e.g. BTN_LEFT. ++ * ++ * Any 16-bit button code value is reserved for future additions to ++ * the kernel's event code list. All other button codes above ++ * 0xFFFF are currently undefined but may be used in future ++ * versions of this protocol. ++ * @param serial serial number of the button event ++ * @param time timestamp with millisecond granularity ++ * @param button button that produced the event ++ * @param state physical state of the button ++ */ ++ void (*button)(void* data, struct wl_pointer* wl_pointer, uint32_t serial, ++ uint32_t time, uint32_t button, uint32_t state); ++ /** ++ * axis event ++ * ++ * Scroll and other axis notifications. ++ * ++ * For scroll events (vertical and horizontal scroll axes), the ++ * value parameter is the length of a vector along the specified ++ * axis in a coordinate space identical to those of motion events, ++ * representing a relative movement along the specified axis. ++ * ++ * For devices that support movements non-parallel to axes multiple ++ * axis events will be emitted. ++ * ++ * When applicable, for example for touch pads, the server can ++ * choose to emit scroll events where the motion vector is ++ * equivalent to a motion event vector. ++ * ++ * When applicable, a client can transform its content relative to ++ * the scroll distance. ++ * @param time timestamp with millisecond granularity ++ * @param axis axis type ++ * @param value length of vector in surface-local coordinate space ++ */ ++ void (*axis)(void* data, struct wl_pointer* wl_pointer, uint32_t time, ++ uint32_t axis, wl_fixed_t value); ++ /** ++ * end of a pointer event sequence ++ * ++ * Indicates the end of a set of events that logically belong ++ * together. A client is expected to accumulate the data in all ++ * events within the frame before proceeding. ++ * ++ * All wl_pointer events before a wl_pointer.frame event belong ++ * logically together. For example, in a diagonal scroll motion the ++ * compositor will send an optional wl_pointer.axis_source event, ++ * two wl_pointer.axis events (horizontal and vertical) and finally ++ * a wl_pointer.frame event. The client may use this information to ++ * calculate a diagonal vector for scrolling. ++ * ++ * When multiple wl_pointer.axis events occur within the same ++ * frame, the motion vector is the combined motion of all events. ++ * When a wl_pointer.axis and a wl_pointer.axis_stop event occur ++ * within the same frame, this indicates that axis movement in one ++ * axis has stopped but continues in the other axis. When multiple ++ * wl_pointer.axis_stop events occur within the same frame, this ++ * indicates that these axes stopped in the same instance. ++ * ++ * A wl_pointer.frame event is sent for every logical event group, ++ * even if the group only contains a single wl_pointer event. ++ * Specifically, a client may get a sequence: motion, frame, ++ * button, frame, axis, frame, axis_stop, frame. ++ * ++ * The wl_pointer.enter and wl_pointer.leave events are logical ++ * events generated by the compositor and not the hardware. These ++ * events are also grouped by a wl_pointer.frame. When a pointer ++ * moves from one surface to another, a compositor should group the ++ * wl_pointer.leave event within the same wl_pointer.frame. ++ * However, a client must not rely on wl_pointer.leave and ++ * wl_pointer.enter being in the same wl_pointer.frame. ++ * Compositor-specific policies may require the wl_pointer.leave ++ * and wl_pointer.enter event being split across multiple ++ * wl_pointer.frame groups. ++ * @since 5 ++ */ ++ void (*frame)(void* data, struct wl_pointer* wl_pointer); ++ /** ++ * axis source event ++ * ++ * Source information for scroll and other axes. ++ * ++ * This event does not occur on its own. It is sent before a ++ * wl_pointer.frame event and carries the source information for ++ * all events within that frame. ++ * ++ * The source specifies how this event was generated. If the source ++ * is wl_pointer.axis_source.finger, a wl_pointer.axis_stop event ++ * will be sent when the user lifts the finger off the device. ++ * ++ * If the source is wl_pointer.axis_source.wheel, ++ * wl_pointer.axis_source.wheel_tilt or ++ * wl_pointer.axis_source.continuous, a wl_pointer.axis_stop event ++ * may or may not be sent. Whether a compositor sends an axis_stop ++ * event for these sources is hardware-specific and ++ * implementation-dependent; clients must not rely on receiving an ++ * axis_stop event for these scroll sources and should treat scroll ++ * sequences from these scroll sources as unterminated by default. ++ * ++ * This event is optional. If the source is unknown for a ++ * particular axis event sequence, no event is sent. Only one ++ * wl_pointer.axis_source event is permitted per frame. ++ * ++ * The order of wl_pointer.axis_discrete and wl_pointer.axis_source ++ * is not guaranteed. ++ * @param axis_source source of the axis event ++ * @since 5 ++ */ ++ void (*axis_source)(void* data, struct wl_pointer* wl_pointer, ++ uint32_t axis_source); ++ /** ++ * axis stop event ++ * ++ * Stop notification for scroll and other axes. ++ * ++ * For some wl_pointer.axis_source types, a wl_pointer.axis_stop ++ * event is sent to notify a client that the axis sequence has ++ * terminated. This enables the client to implement kinetic ++ * scrolling. See the wl_pointer.axis_source documentation for ++ * information on when this event may be generated. ++ * ++ * Any wl_pointer.axis events with the same axis_source after this ++ * event should be considered as the start of a new axis motion. ++ * ++ * The timestamp is to be interpreted identical to the timestamp in ++ * the wl_pointer.axis event. The timestamp value may be the same ++ * as a preceding wl_pointer.axis event. ++ * @param time timestamp with millisecond granularity ++ * @param axis the axis stopped with this event ++ * @since 5 ++ */ ++ void (*axis_stop)(void* data, struct wl_pointer* wl_pointer, uint32_t time, ++ uint32_t axis); ++ /** ++ * axis click event ++ * ++ * Discrete step information for scroll and other axes. ++ * ++ * This event carries the axis value of the wl_pointer.axis event ++ * in discrete steps (e.g. mouse wheel clicks). ++ * ++ * This event is deprecated with wl_pointer version 8 - this event ++ * is not sent to clients supporting version 8 or later. ++ * ++ * This event does not occur on its own, it is coupled with a ++ * wl_pointer.axis event that represents this axis value on a ++ * continuous scale. The protocol guarantees that each ++ * axis_discrete event is always followed by exactly one axis event ++ * with the same axis number within the same wl_pointer.frame. Note ++ * that the protocol allows for other events to occur between the ++ * axis_discrete and its coupled axis event, including other ++ * axis_discrete or axis events. A wl_pointer.frame must not ++ * contain more than one axis_discrete event per axis type. ++ * ++ * This event is optional; continuous scrolling devices like ++ * two-finger scrolling on touchpads do not have discrete steps and ++ * do not generate this event. ++ * ++ * The discrete value carries the directional information. e.g. a ++ * value of -2 is two steps towards the negative direction of this ++ * axis. ++ * ++ * The axis number is identical to the axis number in the ++ * associated axis event. ++ * ++ * The order of wl_pointer.axis_discrete and wl_pointer.axis_source ++ * is not guaranteed. ++ * @param axis axis type ++ * @param discrete number of steps ++ * @since 5 ++ * @deprecated Deprecated since version 8 ++ */ ++ void (*axis_discrete)(void* data, struct wl_pointer* wl_pointer, ++ uint32_t axis, int32_t discrete); ++ /** ++ * axis high-resolution scroll event ++ * ++ * Discrete high-resolution scroll information. ++ * ++ * This event carries high-resolution wheel scroll information, ++ * with each multiple of 120 representing one logical scroll step ++ * (a wheel detent). For example, an axis_value120 of 30 is one ++ * quarter of a logical scroll step in the positive direction, a ++ * value120 of -240 are two logical scroll steps in the negative ++ * direction within the same hardware event. Clients that rely on ++ * discrete scrolling should accumulate the value120 to multiples ++ * of 120 before processing the event. ++ * ++ * The value120 must not be zero. ++ * ++ * This event replaces the wl_pointer.axis_discrete event in ++ * clients supporting wl_pointer version 8 or later. ++ * ++ * Where a wl_pointer.axis_source event occurs in the same ++ * wl_pointer.frame, the axis source applies to this event. ++ * ++ * The order of wl_pointer.axis_value120 and wl_pointer.axis_source ++ * is not guaranteed. ++ * @param axis axis type ++ * @param value120 scroll distance as fraction of 120 ++ * @since 8 ++ */ ++ void (*axis_value120)(void* data, struct wl_pointer* wl_pointer, ++ uint32_t axis, int32_t value120); ++ /** ++ * axis relative physical direction event ++ * ++ * Relative directional information of the entity causing the ++ * axis motion. ++ * ++ * For a wl_pointer.axis event, the ++ * wl_pointer.axis_relative_direction event specifies the movement ++ * direction of the entity causing the wl_pointer.axis event. For ++ * example: - if a user's fingers on a touchpad move down and this ++ * causes a wl_pointer.axis vertical_scroll down event, the ++ * physical direction is 'identical' - if a user's fingers on a ++ * touchpad move down and this causes a wl_pointer.axis ++ * vertical_scroll up scroll up event ('natural scrolling'), the ++ * physical direction is 'inverted'. ++ * ++ * A client may use this information to adjust scroll motion of ++ * components. Specifically, enabling natural scrolling causes the ++ * content to change direction compared to traditional scrolling. ++ * Some widgets like volume control sliders should usually match ++ * the physical direction regardless of whether natural scrolling ++ * is active. This event enables clients to match the scroll ++ * direction of a widget to the physical direction. ++ * ++ * This event does not occur on its own, it is coupled with a ++ * wl_pointer.axis event that represents this axis value. The ++ * protocol guarantees that each axis_relative_direction event is ++ * always followed by exactly one axis event with the same axis ++ * number within the same wl_pointer.frame. Note that the protocol ++ * allows for other events to occur between the ++ * axis_relative_direction and its coupled axis event. ++ * ++ * The axis number is identical to the axis number in the ++ * associated axis event. ++ * ++ * The order of wl_pointer.axis_relative_direction, ++ * wl_pointer.axis_discrete and wl_pointer.axis_source is not ++ * guaranteed. ++ * @param axis axis type ++ * @param direction physical direction relative to axis motion ++ * @since 9 ++ */ ++ void (*axis_relative_direction)(void* data, struct wl_pointer* wl_pointer, ++ uint32_t axis, uint32_t direction); ++}; ++ + #ifdef __cplusplus + } + #endif + + #endif /* __MozWayland_h_ */ +diff --git a/widget/gtk/nsGtkKeyUtils.h b/widget/gtk/nsGtkKeyUtils.h +--- a/widget/gtk/nsGtkKeyUtils.h ++++ b/widget/gtk/nsGtkKeyUtils.h +@@ -196,22 +196,19 @@ + /** + * Utility function to set all supported modifier masks + * from xkb_keymap. We call that from Wayland backend routines. + */ + static void SetModifierMasks(xkb_keymap* aKeymap); ++ static void HandleKeymap(uint32_t format, int fd, uint32_t size); + + /** + * Wayland global focus handlers + */ + static void SetFocusIn(wl_surface* aFocusSurface, uint32_t aFocusSerial); + static void SetFocusOut(wl_surface* aFocusSurface); + static void GetFocusInfo(wl_surface** aFocusSurface, uint32_t* aFocusSerial); + +- static void SetSeat(wl_seat* aSeat, int aId); +- static void ClearSeat(int aId); +- static wl_seat* GetSeat(); +- + static void SetKeyboard(wl_keyboard* aKeyboard); + static wl_keyboard* GetKeyboard(); + static void ClearKeyboard(); + + /** +@@ -495,13 +492,10 @@ + void SetModifierMask(xkb_keymap* aKeymap, ModifierIndex aModifierIndex, + const char* aModifierName); + #endif + + #ifdef MOZ_WAYLAND +- static wl_seat* sSeat; +- static int sSeatID; +- static wl_keyboard* sKeyboard; + wl_surface* mFocusSurface = nullptr; + uint32_t mFocusSerial = 0; + #endif + }; + +diff --git a/widget/gtk/nsGtkKeyUtils.cpp b/widget/gtk/nsGtkKeyUtils.cpp +--- a/widget/gtk/nsGtkKeyUtils.cpp ++++ b/widget/gtk/nsGtkKeyUtils.cpp +@@ -63,16 +63,10 @@ + Time KeymapWrapper::sLastRepeatableKeyTime = 0; + #endif + KeymapWrapper::RepeatState KeymapWrapper::sRepeatState = + KeymapWrapper::NOT_PRESSED; + +-#ifdef MOZ_WAYLAND +-wl_seat* KeymapWrapper::sSeat = nullptr; +-int KeymapWrapper::sSeatID = -1; +-wl_keyboard* KeymapWrapper::sKeyboard = nullptr; +-#endif +- + static const char* GetBoolName(bool aBool) { return aBool ? "TRUE" : "FALSE"; } + + static const char* GetStatusName(nsEventStatus aStatus) { + switch (aStatus) { + case nsEventStatus_eConsumeDoDefault: +@@ -688,12 +682,11 @@ + keymapWrapper->GetGdkModifierMask(HYPER))); + } + + /* This keymap routine is derived from weston-2.0.0/clients/simple-im.c + */ +-static void keyboard_handle_keymap(void* data, struct wl_keyboard* wl_keyboard, +- uint32_t format, int fd, uint32_t size) { ++void KeymapWrapper::HandleKeymap(uint32_t format, int fd, uint32_t size) { + KeymapWrapper::ResetKeyboard(); + + if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) { + close(fd); + return; +@@ -722,54 +715,10 @@ + + xkb_keymap_unref(keymap); + + xkb_context_unref(xkb_context); + } +- +-static void keyboard_handle_enter(void* data, struct wl_keyboard* keyboard, +- uint32_t serial, struct wl_surface* surface, +- struct wl_array* keys) { +- KeymapWrapper::SetFocusIn(surface, serial); +-} +- +-static void keyboard_handle_leave(void* data, struct wl_keyboard* keyboard, +- uint32_t serial, struct wl_surface* surface) { +- KeymapWrapper::SetFocusOut(surface); +-} +- +-static void keyboard_handle_key(void* data, struct wl_keyboard* keyboard, +- uint32_t serial, uint32_t time, uint32_t key, +- uint32_t state) {} +-static void keyboard_handle_modifiers(void* data, struct wl_keyboard* keyboard, +- uint32_t serial, uint32_t mods_depressed, +- uint32_t mods_latched, +- uint32_t mods_locked, uint32_t group) {} +-static void keyboard_handle_repeat_info(void* data, +- struct wl_keyboard* keyboard, +- int32_t rate, int32_t delay) {} +- +-static const struct wl_keyboard_listener keyboard_listener = { +- keyboard_handle_keymap, keyboard_handle_enter, +- keyboard_handle_leave, keyboard_handle_key, +- keyboard_handle_modifiers, keyboard_handle_repeat_info}; +- +-static void seat_handle_capabilities(void* data, struct wl_seat* seat, +- unsigned int caps) { +- wl_keyboard* keyboard = KeymapWrapper::GetKeyboard(); +- if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !keyboard) { +- keyboard = wl_seat_get_keyboard(seat); +- wl_keyboard_add_listener(keyboard, &keyboard_listener, nullptr); +- KeymapWrapper::SetKeyboard(keyboard); +- } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && keyboard) { +- KeymapWrapper::ClearKeyboard(); +- } +-} +- +-static const struct wl_seat_listener seat_listener = { +- seat_handle_capabilities, +-}; +- + #endif + + KeymapWrapper::~KeymapWrapper() { + #ifdef MOZ_X11 + gdk_window_remove_filter(nullptr, FilterEvents, this); +@@ -2694,38 +2643,9 @@ + uint32_t* aFocusSerial) { + KeymapWrapper* keymapWrapper = KeymapWrapper::GetInstance(); + *aFocusSurface = keymapWrapper->mFocusSurface; + *aFocusSerial = keymapWrapper->mFocusSerial; + } +- +-void KeymapWrapper::SetSeat(wl_seat* aSeat, int aId) { +- sSeat = aSeat; +- sSeatID = aId; +- wl_seat_add_listener(aSeat, &seat_listener, nullptr); +-} +- +-void KeymapWrapper::ClearSeat(int aId) { +- if (sSeatID == aId) { +- ClearKeyboard(); +- sSeat = nullptr; +- sSeatID = -1; +- } +-} +- +-wl_seat* KeymapWrapper::GetSeat() { return sSeat; } +- +-void KeymapWrapper::SetKeyboard(wl_keyboard* aKeyboard) { +- sKeyboard = aKeyboard; +-} +- +-wl_keyboard* KeymapWrapper::GetKeyboard() { return sKeyboard; } +- +-void KeymapWrapper::ClearKeyboard() { +- if (sKeyboard) { +- wl_keyboard_destroy(sKeyboard); +- sKeyboard = nullptr; +- } +-} + #endif + + } // namespace widget + } // namespace mozilla +diff --git a/widget/gtk/nsWaylandDisplay.h b/widget/gtk/nsWaylandDisplay.h +--- a/widget/gtk/nsWaylandDisplay.h ++++ b/widget/gtk/nsWaylandDisplay.h +@@ -14,10 +14,11 @@ + #include "mozilla/widget/gbm.h" + #include "mozilla/widget/fractional-scale-v1-client-protocol.h" + #include "mozilla/widget/idle-inhibit-unstable-v1-client-protocol.h" + #include "mozilla/widget/relative-pointer-unstable-v1-client-protocol.h" + #include "mozilla/widget/pointer-constraints-unstable-v1-client-protocol.h" ++#include "mozilla/widget/pointer-gestures-unstable-v1-client-protocol.h" + #include "mozilla/widget/linux-dmabuf-unstable-v1-client-protocol.h" + #include "mozilla/widget/viewporter-client-protocol.h" + #include "mozilla/widget/xdg-activation-v1-client-protocol.h" + #include "mozilla/widget/xdg-dbus-annotation-v1-client-protocol.h" + #include "mozilla/widget/xdg-output-unstable-v1-client-protocol.h" +@@ -55,19 +56,33 @@ + wp_fractional_scale_manager_v1* GetFractionalScaleManager() { + return mFractionalScaleManager; + } + bool IsPrimarySelectionEnabled() { return mIsPrimarySelectionEnabled; } + ++ wl_pointer* GetPointer() { return mPointer; } ++ void SetPointer(wl_pointer* aPointer); ++ void RemovePointer(); ++ + void SetShm(wl_shm* aShm); ++ ++ void SetKeyboard(wl_keyboard* aKeyboard); ++ wl_keyboard* GetKeyboard() { return mKeyboard; } ++ void ClearKeyboard(); ++ ++ void SetSeat(wl_seat* aSeat, int aSeatId); ++ wl_seat* GetSeat() { return mSeat; } ++ void RemoveSeat(int aSeatId); ++ + void SetCompositor(wl_compositor* aCompositor); + void SetSubcompositor(wl_subcompositor* aSubcompositor); + void SetDataDeviceManager(wl_data_device_manager* aDataDeviceManager); + void SetIdleInhibitManager(zwp_idle_inhibit_manager_v1* aIdleInhibitManager); + void SetViewporter(wp_viewporter* aViewporter); + void SetRelativePointerManager( + zwp_relative_pointer_manager_v1* aRelativePointerManager); + void SetPointerConstraints(zwp_pointer_constraints_v1* aPointerConstraints); ++ void SetPointerGestures(zwp_pointer_gestures_v1* aPointerGestures); + void SetDmabuf(zwp_linux_dmabuf_v1* aDmabuf); + void SetXdgActivation(xdg_activation_v1* aXdgActivation); + void SetXdgDbusAnnotationManager( + xdg_dbus_annotation_manager_v1* aXdgDbusAnnotationManager); + void SetFractionalScaleManager(wp_fractional_scale_manager_v1* aManager) { +@@ -82,13 +97,19 @@ + wl_registry* mRegistry = nullptr; + wl_display* mDisplay = nullptr; + wl_compositor* mCompositor = nullptr; + wl_subcompositor* mSubcompositor = nullptr; + wl_shm* mShm = nullptr; ++ wl_seat* mSeat = nullptr; ++ int mSeatId = -1; ++ wl_keyboard* mKeyboard = nullptr; ++ wl_pointer* mPointer = nullptr; + zwp_idle_inhibit_manager_v1* mIdleInhibitManager = nullptr; + zwp_relative_pointer_manager_v1* mRelativePointerManager = nullptr; + zwp_pointer_constraints_v1* mPointerConstraints = nullptr; ++ zwp_pointer_gestures_v1* mPointerGestures = nullptr; ++ zwp_pointer_gesture_hold_v1* mPointerGestureHold = nullptr; + wp_viewporter* mViewporter = nullptr; + zwp_linux_dmabuf_v1* mDmabuf = nullptr; + xdg_activation_v1* mXdgActivation = nullptr; + xdg_dbus_annotation_manager_v1* mXdgDbusAnnotationManager = nullptr; + wp_fractional_scale_manager_v1* mFractionalScaleManager = nullptr; +diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp +--- a/widget/gtk/nsWaylandDisplay.cpp ++++ b/widget/gtk/nsWaylandDisplay.cpp +@@ -17,10 +17,11 @@ + #include "mozilla/ThreadLocal.h" + #include "mozilla/StaticPrefs_widget.h" + #include "mozilla/Sprintf.h" + #include "WidgetUtilsGtk.h" + #include "nsGtkKeyUtils.h" ++#include "nsWindow.h" + + namespace mozilla::widget { + + static nsWaylandDisplay* gWaylandDisplay; + +@@ -55,10 +56,202 @@ + return gWaylandDisplay; + } + + void nsWaylandDisplay::SetShm(wl_shm* aShm) { mShm = aShm; } + ++struct PointerState { ++ wl_surface* surface; ++ ++ nsWindow* GetWindow() { ++ GdkWindow* window = ++ static_cast(wl_surface_get_user_data(surface)); ++ return window ? static_cast( ++ g_object_get_data(G_OBJECT(window), "nsWindow")) ++ : nullptr; ++ } ++} sPointerState; ++ ++static void gesture_hold_begin(void* data, ++ struct zwp_pointer_gesture_hold_v1* hold, ++ uint32_t serial, uint32_t time, ++ struct wl_surface* surface, uint32_t fingers) { ++ RefPtr window = sPointerState.GetWindow(); ++ if (!window) { ++ return; ++ } ++ window->OnTouchpadHoldEvent(GDK_TOUCHPAD_GESTURE_PHASE_BEGIN, time, fingers); ++} ++ ++static void gesture_hold_end(void* data, ++ struct zwp_pointer_gesture_hold_v1* hold, ++ uint32_t serial, uint32_t time, ++ int32_t cancelled) { ++ RefPtr window = sPointerState.GetWindow(); ++ if (!window) { ++ return; ++ } ++ window->OnTouchpadHoldEvent(cancelled ? GDK_TOUCHPAD_GESTURE_PHASE_CANCEL ++ : GDK_TOUCHPAD_GESTURE_PHASE_END, ++ time, 0); ++} ++ ++static const struct zwp_pointer_gesture_hold_v1_listener gesture_hold_listener = ++ {gesture_hold_begin, gesture_hold_end}; ++ ++static void pointer_handle_enter(void* data, struct wl_pointer* pointer, ++ uint32_t serial, struct wl_surface* surface, ++ wl_fixed_t sx, wl_fixed_t sy) { ++ sPointerState.surface = surface; ++} ++ ++static void pointer_handle_leave(void* data, struct wl_pointer* pointer, ++ uint32_t serial, struct wl_surface* surface) { ++ sPointerState.surface = nullptr; ++} ++ ++static void pointer_handle_motion(void* data, struct wl_pointer* pointer, ++ uint32_t time, wl_fixed_t sx, wl_fixed_t sy) { ++} ++ ++static void pointer_handle_button(void* data, struct wl_pointer* pointer, ++ uint32_t serial, uint32_t time, ++ uint32_t button, uint32_t state) {} ++ ++static void pointer_handle_axis(void* data, struct wl_pointer* pointer, ++ uint32_t time, uint32_t axis, ++ wl_fixed_t value) {} ++ ++static void pointer_handle_frame(void* data, struct wl_pointer* pointer) {} ++ ++static void pointer_handle_axis_source( ++ void* data, struct wl_pointer* pointer, ++ /*enum wl_pointer_axis_source */ uint32_t source) {} ++ ++static void pointer_handle_axis_stop(void* data, struct wl_pointer* pointer, ++ uint32_t time, uint32_t axis) {} ++ ++static void pointer_handle_axis_discrete(void* data, struct wl_pointer* pointer, ++ uint32_t axis, int32_t value) {} ++ ++static void pointer_handle_axis_value120(void* data, struct wl_pointer* pointer, ++ uint32_t axis, int32_t value) {} ++ ++static const struct moz_wl_pointer_listener pointer_listener = { ++ pointer_handle_enter, pointer_handle_leave, ++ pointer_handle_motion, pointer_handle_button, ++ pointer_handle_axis, pointer_handle_frame, ++ pointer_handle_axis_source, pointer_handle_axis_stop, ++ pointer_handle_axis_discrete, pointer_handle_axis_value120, ++}; ++ ++void nsWaylandDisplay::SetPointer(wl_pointer* aPointer) { ++ if (!mPointerGestures) { ++ return; ++ } ++ MOZ_DIAGNOSTIC_ASSERT(!mPointer); ++ mPointer = aPointer; ++ wl_pointer_add_listener(mPointer, ++ (const wl_pointer_listener*)&pointer_listener, this); ++ ++ mPointerGestureHold = ++ zwp_pointer_gestures_v1_get_hold_gesture(mPointerGestures, mPointer); ++ zwp_pointer_gesture_hold_v1_set_user_data(mPointerGestureHold, this); ++ zwp_pointer_gesture_hold_v1_add_listener(mPointerGestureHold, ++ &gesture_hold_listener, this); ++} ++ ++void nsWaylandDisplay::RemovePointer() { ++ wl_pointer_release(mPointer); ++ mPointer = nullptr; ++} ++ ++static void seat_handle_capabilities(void* data, struct wl_seat* seat, ++ unsigned int caps) { ++ auto* display = static_cast(data); ++ if (!display) { ++ return; ++ } ++ ++ if ((caps & WL_SEAT_CAPABILITY_POINTER) && !display->GetPointer()) { ++ display->SetPointer(wl_seat_get_pointer(seat)); ++ } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && display->GetPointer()) { ++ display->RemovePointer(); ++ } ++ ++ wl_keyboard* keyboard = display->GetKeyboard(); ++ if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !keyboard) { ++ display->SetKeyboard(wl_seat_get_keyboard(seat)); ++ } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && keyboard) { ++ display->ClearKeyboard(); ++ } ++} ++ ++static const struct wl_seat_listener seat_listener = { ++ seat_handle_capabilities, ++}; ++ ++void nsWaylandDisplay::SetSeat(wl_seat* aSeat, int aSeatId) { ++ mSeat = aSeat; ++ mSeatId = aSeatId; ++ wl_seat_add_listener(aSeat, &seat_listener, this); ++} ++ ++void nsWaylandDisplay::RemoveSeat(int aSeatId) { ++ if (mSeatId == aSeatId) { ++ mSeat = nullptr; ++ mSeatId = -1; ++ } ++} ++ ++/* This keymap routine is derived from weston-2.0.0/clients/simple-im.c ++ */ ++static void keyboard_handle_keymap(void* data, struct wl_keyboard* wl_keyboard, ++ uint32_t format, int fd, uint32_t size) { ++ KeymapWrapper::HandleKeymap(format, fd, size); ++} ++ ++static void keyboard_handle_enter(void* data, struct wl_keyboard* keyboard, ++ uint32_t serial, struct wl_surface* surface, ++ struct wl_array* keys) { ++ KeymapWrapper::SetFocusIn(surface, serial); ++} ++ ++static void keyboard_handle_leave(void* data, struct wl_keyboard* keyboard, ++ uint32_t serial, struct wl_surface* surface) { ++ KeymapWrapper::SetFocusOut(surface); ++} ++ ++static void keyboard_handle_key(void* data, struct wl_keyboard* keyboard, ++ uint32_t serial, uint32_t time, uint32_t key, ++ uint32_t state) {} ++static void keyboard_handle_modifiers(void* data, struct wl_keyboard* keyboard, ++ uint32_t serial, uint32_t mods_depressed, ++ uint32_t mods_latched, ++ uint32_t mods_locked, uint32_t group) {} ++static void keyboard_handle_repeat_info(void* data, ++ struct wl_keyboard* keyboard, ++ int32_t rate, int32_t delay) {} ++ ++static const struct wl_keyboard_listener keyboard_listener = { ++ keyboard_handle_keymap, keyboard_handle_enter, ++ keyboard_handle_leave, keyboard_handle_key, ++ keyboard_handle_modifiers, keyboard_handle_repeat_info}; ++ ++void nsWaylandDisplay::SetKeyboard(wl_keyboard* aKeyboard) { ++ MOZ_ASSERT(aKeyboard); ++ MOZ_DIAGNOSTIC_ASSERT(!mKeyboard); ++ mKeyboard = aKeyboard; ++ wl_keyboard_add_listener(mKeyboard, &keyboard_listener, nullptr); ++} ++ ++void nsWaylandDisplay::ClearKeyboard() { ++ if (mKeyboard) { ++ wl_keyboard_destroy(mKeyboard); ++ mKeyboard = nullptr; ++ } ++} ++ + void nsWaylandDisplay::SetCompositor(wl_compositor* aCompositor) { + mCompositor = aCompositor; + } + + void nsWaylandDisplay::SetSubcompositor(wl_subcompositor* aSubcompositor) { +@@ -82,10 +275,15 @@ + void nsWaylandDisplay::SetPointerConstraints( + zwp_pointer_constraints_v1* aPointerConstraints) { + mPointerConstraints = aPointerConstraints; + } + ++void nsWaylandDisplay::SetPointerGestures( ++ zwp_pointer_gestures_v1* aPointerGestures) { ++ mPointerGestures = aPointerGestures; ++} ++ + void nsWaylandDisplay::SetDmabuf(zwp_linux_dmabuf_v1* aDmabuf) { + mDmabuf = aDmabuf; + } + + void nsWaylandDisplay::SetXdgActivation(xdg_activation_v1* aXdgActivation) { +@@ -122,11 +320,12 @@ + } else if (iface.EqualsLiteral("zwp_pointer_constraints_v1")) { + auto* pointer_constraints = WaylandRegistryBind( + registry, id, &zwp_pointer_constraints_v1_interface, 1); + display->SetPointerConstraints(pointer_constraints); + } else if (iface.EqualsLiteral("wl_compositor")) { +- // Requested wl_compositor version 4 as we need wl_surface_damage_buffer(). ++ // Requested wl_compositor version 4 as we need ++ // wl_surface_damage_buffer(). + auto* compositor = WaylandRegistryBind( + registry, id, &wl_compositor_interface, 4); + display->SetCompositor(compositor); + } else if (iface.EqualsLiteral("wl_subcompositor")) { + auto* subcompositor = WaylandRegistryBind( +@@ -150,24 +349,33 @@ + registry, id, &xdg_dbus_annotation_manager_v1_interface, 1); + display->SetXdgDbusAnnotationManager(annotationManager); + } else if (iface.EqualsLiteral("wl_seat")) { + auto* seat = + WaylandRegistryBind(registry, id, &wl_seat_interface, 1); +- KeymapWrapper::SetSeat(seat, id); ++ display->SetSeat(seat, id); + } else if (iface.EqualsLiteral("wp_fractional_scale_manager_v1")) { + auto* manager = WaylandRegistryBind( + registry, id, &wp_fractional_scale_manager_v1_interface, 1); + display->SetFractionalScaleManager(manager); + } else if (iface.EqualsLiteral("gtk_primary_selection_device_manager") || + iface.EqualsLiteral("zwp_primary_selection_device_manager_v1")) { + display->EnablePrimarySelection(); ++ } else if (iface.EqualsLiteral("zwp_pointer_gestures_v1")) { ++ // HOLD is introduced in version 3 ++ auto* gestures = WaylandRegistryBind( ++ registry, id, &zwp_pointer_gestures_v1_interface, 3); ++ display->SetPointerGestures(gestures); + } + } + + static void global_registry_remover(void* data, wl_registry* registry, + uint32_t id) { +- KeymapWrapper::ClearSeat(id); ++ auto* display = static_cast(data); ++ if (!display) { ++ return; ++ } ++ display->RemoveSeat(id); + } + + static const struct wl_registry_listener registry_listener = { + global_registry_handler, global_registry_remover}; + +diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h +--- a/widget/gtk/nsWindow.h ++++ b/widget/gtk/nsWindow.h +@@ -107,10 +107,19 @@ + GDK_ANCHOR_SLIDE = GDK_ANCHOR_SLIDE_X | GDK_ANCHOR_SLIDE_Y, + GDK_ANCHOR_RESIZE = GDK_ANCHOR_RESIZE_X | GDK_ANCHOR_RESIZE_Y + } GdkAnchorHints; + #endif + ++#if !GTK_CHECK_VERSION(3, 18, 0) ++typedef enum { ++ GDK_TOUCHPAD_GESTURE_PHASE_BEGIN, ++ GDK_TOUCHPAD_GESTURE_PHASE_UPDATE, ++ GDK_TOUCHPAD_GESTURE_PHASE_END, ++ GDK_TOUCHPAD_GESTURE_PHASE_CANCEL ++} GdkTouchpadGesturePhase; ++#endif ++ + namespace mozilla { + enum class NativeKeyBindingsType : uint8_t; + + class TimeStamp; + #ifdef MOZ_X11 +@@ -256,10 +265,12 @@ + GtkSelectionData* aSelectionData, guint aInfo, + guint aTime, gpointer aData); + gboolean OnPropertyNotifyEvent(GtkWidget* aWidget, GdkEventProperty* aEvent); + gboolean OnTouchEvent(GdkEventTouch* aEvent); + gboolean OnTouchpadPinchEvent(GdkEventTouchpadPinch* aEvent); ++ void OnTouchpadHoldEvent(GdkTouchpadGesturePhase aPhase, guint aTime, ++ uint32_t aFingers); + + gint GetInputRegionMarginInGdkCoords(); + + void UpdateOpaqueRegionInternal(); + void UpdateOpaqueRegion(const LayoutDeviceIntRegion&) override; +diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp +--- a/widget/gtk/nsWindow.cpp ++++ b/widget/gtk/nsWindow.cpp +@@ -139,11 +139,10 @@ + // Don't put more than this many rects in the dirty region, just fluff + // out to the bounding-box if there are more + #define MAX_RECTS_IN_REGION 100 + + #if !GTK_CHECK_VERSION(3, 18, 0) +- + struct _GdkEventTouchpadPinch { + GdkEventType type; + GdkWindow* window; + gint8 send_event; + gint8 phase; +@@ -157,20 +156,12 @@ + gdouble scale; + gdouble x_root, y_root; + guint state; + }; + +-typedef enum { +- GDK_TOUCHPAD_GESTURE_PHASE_BEGIN, +- GDK_TOUCHPAD_GESTURE_PHASE_UPDATE, +- GDK_TOUCHPAD_GESTURE_PHASE_END, +- GDK_TOUCHPAD_GESTURE_PHASE_CANCEL +-} GdkTouchpadGesturePhase; +- + gint GDK_TOUCHPAD_GESTURE_MASK = 1 << 24; + GdkEventType GDK_TOUCHPAD_PINCH = static_cast(42); +- + #endif + + const gint kEvents = GDK_TOUCHPAD_GESTURE_MASK | GDK_EXPOSURE_MASK | + GDK_STRUCTURE_MASK | GDK_VISIBILITY_NOTIFY_MASK | + GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | +@@ -5509,10 +5500,15 @@ + mLastPinchEventSpan = aEvent->scale; + DispatchPinchGestureInput(event); + return TRUE; + } + ++void nsWindow::OnTouchpadHoldEvent(GdkTouchpadGesturePhase aPhase, guint aTime, ++ uint32_t aFingers) { ++ LOG("OnTouchpadHoldEvent: aPhase %d aFingers %d", aPhase, aFingers); ++} ++ + gboolean nsWindow::OnTouchEvent(GdkEventTouch* aEvent) { + LOG("OnTouchEvent: x=%f y=%f type=%d\n", aEvent->x, aEvent->y, aEvent->type); + if (!mHandleTouchEvent) { + // If a popup window was spawned (e.g. as the result of a long-press) + // and touch events got diverted to that window within a touch sequence, +diff --git a/widget/gtk/wayland/moz.build b/widget/gtk/wayland/moz.build +--- a/widget/gtk/wayland/moz.build ++++ b/widget/gtk/wayland/moz.build +@@ -10,10 +10,11 @@ + SOURCES += [ + "fractional-scale-v1-protocol.c", + "idle-inhibit-unstable-v1-protocol.c", + "linux-dmabuf-unstable-v1-protocol.c", + "pointer-constraints-unstable-v1-protocol.c", ++ "pointer-gestures-unstable-v1-protocol.c", + "relative-pointer-unstable-v1-protocol.c", + "viewporter-protocol.c", + "xdg-activation-v1-protocol.c", + "xdg-dbus-annotation-v1-protocol.c", + "xdg-output-unstable-v1-protocol.c", +@@ -22,10 +23,11 @@ + EXPORTS.mozilla.widget += [ + "fractional-scale-v1-client-protocol.h", + "idle-inhibit-unstable-v1-client-protocol.h", + "linux-dmabuf-unstable-v1-client-protocol.h", + "pointer-constraints-unstable-v1-client-protocol.h", ++ "pointer-gestures-unstable-v1-client-protocol.h", + "relative-pointer-unstable-v1-client-protocol.h", + "viewporter-client-protocol.h", + "xdg-activation-v1-client-protocol.h", + "xdg-dbus-annotation-v1-client-protocol.h", + "xdg-output-unstable-v1-client-protocol.h", +diff --git a/widget/gtk/wayland/pointer-gestures-unstable-v1-client-protocol.h b/widget/gtk/wayland/pointer-gestures-unstable-v1-client-protocol.h +new file mode 100644 +--- /dev/null ++++ b/widget/gtk/wayland/pointer-gestures-unstable-v1-client-protocol.h +@@ -0,0 +1,685 @@ ++/* Generated by wayland-scanner 1.22.0 */ ++ ++#ifndef POINTER_GESTURES_UNSTABLE_V1_CLIENT_PROTOCOL_H ++#define POINTER_GESTURES_UNSTABLE_V1_CLIENT_PROTOCOL_H ++ ++#include ++#include ++#include "wayland-client.h" ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++/** ++ * @page page_pointer_gestures_unstable_v1 The pointer_gestures_unstable_v1 ++ * protocol ++ * @section page_ifaces_pointer_gestures_unstable_v1 Interfaces ++ * - @subpage page_iface_zwp_pointer_gestures_v1 - touchpad gestures ++ * - @subpage page_iface_zwp_pointer_gesture_swipe_v1 - a swipe gesture object ++ * - @subpage page_iface_zwp_pointer_gesture_pinch_v1 - a pinch gesture object ++ * - @subpage page_iface_zwp_pointer_gesture_hold_v1 - a hold gesture object ++ */ ++struct wl_pointer; ++struct wl_surface; ++struct zwp_pointer_gesture_hold_v1; ++struct zwp_pointer_gesture_pinch_v1; ++struct zwp_pointer_gesture_swipe_v1; ++struct zwp_pointer_gestures_v1; ++ ++#ifndef ZWP_POINTER_GESTURES_V1_INTERFACE ++# define ZWP_POINTER_GESTURES_V1_INTERFACE ++/** ++ * @page page_iface_zwp_pointer_gestures_v1 zwp_pointer_gestures_v1 ++ * @section page_iface_zwp_pointer_gestures_v1_desc Description ++ * ++ * A global interface to provide semantic touchpad gestures for a given ++ * pointer. ++ * ++ * Three gestures are currently supported: swipe, pinch, and hold. ++ * Pinch and swipe gestures follow a three-stage cycle: begin, update, ++ * end, hold gestures follow a two-stage cycle: begin and end. All ++ * gestures are identified by a unique id. ++ * ++ * Warning! The protocol described in this file is experimental and ++ * backward incompatible changes may be made. Backward compatible changes ++ * may be added together with the corresponding interface version bump. ++ * Backward incompatible changes are done by bumping the version number in ++ * the protocol and interface names and resetting the interface version. ++ * Once the protocol is to be declared stable, the 'z' prefix and the ++ * version number in the protocol and interface names are removed and the ++ * interface version number is reset. ++ * @section page_iface_zwp_pointer_gestures_v1_api API ++ * See @ref iface_zwp_pointer_gestures_v1. ++ */ ++/** ++ * @defgroup iface_zwp_pointer_gestures_v1 The zwp_pointer_gestures_v1 interface ++ * ++ * A global interface to provide semantic touchpad gestures for a given ++ * pointer. ++ * ++ * Three gestures are currently supported: swipe, pinch, and hold. ++ * Pinch and swipe gestures follow a three-stage cycle: begin, update, ++ * end, hold gestures follow a two-stage cycle: begin and end. All ++ * gestures are identified by a unique id. ++ * ++ * Warning! The protocol described in this file is experimental and ++ * backward incompatible changes may be made. Backward compatible changes ++ * may be added together with the corresponding interface version bump. ++ * Backward incompatible changes are done by bumping the version number in ++ * the protocol and interface names and resetting the interface version. ++ * Once the protocol is to be declared stable, the 'z' prefix and the ++ * version number in the protocol and interface names are removed and the ++ * interface version number is reset. ++ */ ++extern const struct wl_interface zwp_pointer_gestures_v1_interface; ++#endif ++#ifndef ZWP_POINTER_GESTURE_SWIPE_V1_INTERFACE ++# define ZWP_POINTER_GESTURE_SWIPE_V1_INTERFACE ++/** ++ * @page page_iface_zwp_pointer_gesture_swipe_v1 zwp_pointer_gesture_swipe_v1 ++ * @section page_iface_zwp_pointer_gesture_swipe_v1_desc Description ++ * ++ * A swipe gesture object notifies a client about a multi-finger swipe ++ * gesture detected on an indirect input device such as a touchpad. ++ * The gesture is usually initiated by multiple fingers moving in the ++ * same direction but once initiated the direction may change. ++ * The precise conditions of when such a gesture is detected are ++ * implementation-dependent. ++ * ++ * A gesture consists of three stages: begin, update (optional) and end. ++ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a ++ * same pointer/seat, how compositors prevent these situations is ++ * implementation-dependent. ++ * ++ * A gesture may be cancelled by the compositor or the hardware. ++ * Clients should not consider performing permanent or irreversible ++ * actions until the end of a gesture has been received. ++ * @section page_iface_zwp_pointer_gesture_swipe_v1_api API ++ * See @ref iface_zwp_pointer_gesture_swipe_v1. ++ */ ++/** ++ * @defgroup iface_zwp_pointer_gesture_swipe_v1 The zwp_pointer_gesture_swipe_v1 ++ * interface ++ * ++ * A swipe gesture object notifies a client about a multi-finger swipe ++ * gesture detected on an indirect input device such as a touchpad. ++ * The gesture is usually initiated by multiple fingers moving in the ++ * same direction but once initiated the direction may change. ++ * The precise conditions of when such a gesture is detected are ++ * implementation-dependent. ++ * ++ * A gesture consists of three stages: begin, update (optional) and end. ++ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a ++ * same pointer/seat, how compositors prevent these situations is ++ * implementation-dependent. ++ * ++ * A gesture may be cancelled by the compositor or the hardware. ++ * Clients should not consider performing permanent or irreversible ++ * actions until the end of a gesture has been received. ++ */ ++extern const struct wl_interface zwp_pointer_gesture_swipe_v1_interface; ++#endif ++#ifndef ZWP_POINTER_GESTURE_PINCH_V1_INTERFACE ++# define ZWP_POINTER_GESTURE_PINCH_V1_INTERFACE ++/** ++ * @page page_iface_zwp_pointer_gesture_pinch_v1 zwp_pointer_gesture_pinch_v1 ++ * @section page_iface_zwp_pointer_gesture_pinch_v1_desc Description ++ * ++ * A pinch gesture object notifies a client about a multi-finger pinch ++ * gesture detected on an indirect input device such as a touchpad. ++ * The gesture is usually initiated by multiple fingers moving towards ++ * each other or away from each other, or by two or more fingers rotating ++ * around a logical center of gravity. The precise conditions of when ++ * such a gesture is detected are implementation-dependent. ++ * ++ * A gesture consists of three stages: begin, update (optional) and end. ++ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a ++ * same pointer/seat, how compositors prevent these situations is ++ * implementation-dependent. ++ * ++ * A gesture may be cancelled by the compositor or the hardware. ++ * Clients should not consider performing permanent or irreversible ++ * actions until the end of a gesture has been received. ++ * @section page_iface_zwp_pointer_gesture_pinch_v1_api API ++ * See @ref iface_zwp_pointer_gesture_pinch_v1. ++ */ ++/** ++ * @defgroup iface_zwp_pointer_gesture_pinch_v1 The zwp_pointer_gesture_pinch_v1 ++ * interface ++ * ++ * A pinch gesture object notifies a client about a multi-finger pinch ++ * gesture detected on an indirect input device such as a touchpad. ++ * The gesture is usually initiated by multiple fingers moving towards ++ * each other or away from each other, or by two or more fingers rotating ++ * around a logical center of gravity. The precise conditions of when ++ * such a gesture is detected are implementation-dependent. ++ * ++ * A gesture consists of three stages: begin, update (optional) and end. ++ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a ++ * same pointer/seat, how compositors prevent these situations is ++ * implementation-dependent. ++ * ++ * A gesture may be cancelled by the compositor or the hardware. ++ * Clients should not consider performing permanent or irreversible ++ * actions until the end of a gesture has been received. ++ */ ++extern const struct wl_interface zwp_pointer_gesture_pinch_v1_interface; ++#endif ++#ifndef ZWP_POINTER_GESTURE_HOLD_V1_INTERFACE ++# define ZWP_POINTER_GESTURE_HOLD_V1_INTERFACE ++/** ++ * @page page_iface_zwp_pointer_gesture_hold_v1 zwp_pointer_gesture_hold_v1 ++ * @section page_iface_zwp_pointer_gesture_hold_v1_desc Description ++ * ++ * A hold gesture object notifies a client about a single- or ++ * multi-finger hold gesture detected on an indirect input device such as ++ * a touchpad. The gesture is usually initiated by one or more fingers ++ * being held down without significant movement. The precise conditions ++ * of when such a gesture is detected are implementation-dependent. ++ * ++ * In particular, this gesture may be used to cancel kinetic scrolling. ++ * ++ * A hold gesture consists of two stages: begin and end. Unlike pinch and ++ * swipe there is no update stage. ++ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a ++ * same pointer/seat, how compositors prevent these situations is ++ * implementation-dependent. ++ * ++ * A gesture may be cancelled by the compositor or the hardware. ++ * Clients should not consider performing permanent or irreversible ++ * actions until the end of a gesture has been received. ++ * @section page_iface_zwp_pointer_gesture_hold_v1_api API ++ * See @ref iface_zwp_pointer_gesture_hold_v1. ++ */ ++/** ++ * @defgroup iface_zwp_pointer_gesture_hold_v1 The zwp_pointer_gesture_hold_v1 ++ * interface ++ * ++ * A hold gesture object notifies a client about a single- or ++ * multi-finger hold gesture detected on an indirect input device such as ++ * a touchpad. The gesture is usually initiated by one or more fingers ++ * being held down without significant movement. The precise conditions ++ * of when such a gesture is detected are implementation-dependent. ++ * ++ * In particular, this gesture may be used to cancel kinetic scrolling. ++ * ++ * A hold gesture consists of two stages: begin and end. Unlike pinch and ++ * swipe there is no update stage. ++ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a ++ * same pointer/seat, how compositors prevent these situations is ++ * implementation-dependent. ++ * ++ * A gesture may be cancelled by the compositor or the hardware. ++ * Clients should not consider performing permanent or irreversible ++ * actions until the end of a gesture has been received. ++ */ ++extern const struct wl_interface zwp_pointer_gesture_hold_v1_interface; ++#endif ++ ++#define ZWP_POINTER_GESTURES_V1_GET_SWIPE_GESTURE 0 ++#define ZWP_POINTER_GESTURES_V1_GET_PINCH_GESTURE 1 ++#define ZWP_POINTER_GESTURES_V1_RELEASE 2 ++#define ZWP_POINTER_GESTURES_V1_GET_HOLD_GESTURE 3 ++ ++/** ++ * @ingroup iface_zwp_pointer_gestures_v1 ++ */ ++#define ZWP_POINTER_GESTURES_V1_GET_SWIPE_GESTURE_SINCE_VERSION 1 ++/** ++ * @ingroup iface_zwp_pointer_gestures_v1 ++ */ ++#define ZWP_POINTER_GESTURES_V1_GET_PINCH_GESTURE_SINCE_VERSION 1 ++/** ++ * @ingroup iface_zwp_pointer_gestures_v1 ++ */ ++#define ZWP_POINTER_GESTURES_V1_RELEASE_SINCE_VERSION 2 ++/** ++ * @ingroup iface_zwp_pointer_gestures_v1 ++ */ ++#define ZWP_POINTER_GESTURES_V1_GET_HOLD_GESTURE_SINCE_VERSION 3 ++ ++/** @ingroup iface_zwp_pointer_gestures_v1 */ ++static inline void zwp_pointer_gestures_v1_set_user_data( ++ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1, void* user_data) { ++ wl_proxy_set_user_data((struct wl_proxy*)zwp_pointer_gestures_v1, user_data); ++} ++ ++/** @ingroup iface_zwp_pointer_gestures_v1 */ ++static inline void* zwp_pointer_gestures_v1_get_user_data( ++ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1) { ++ return wl_proxy_get_user_data((struct wl_proxy*)zwp_pointer_gestures_v1); ++} ++ ++static inline uint32_t zwp_pointer_gestures_v1_get_version( ++ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1) { ++ return wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gestures_v1); ++} ++ ++/** @ingroup iface_zwp_pointer_gestures_v1 */ ++static inline void zwp_pointer_gestures_v1_destroy( ++ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1) { ++ wl_proxy_destroy((struct wl_proxy*)zwp_pointer_gestures_v1); ++} ++ ++/** ++ * @ingroup iface_zwp_pointer_gestures_v1 ++ * ++ * Create a swipe gesture object. See the ++ * wl_pointer_gesture_swipe interface for details. ++ */ ++static inline struct zwp_pointer_gesture_swipe_v1* ++zwp_pointer_gestures_v1_get_swipe_gesture( ++ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1, ++ struct wl_pointer* pointer) { ++ struct wl_proxy* id; ++ ++ id = wl_proxy_marshal_flags( ++ (struct wl_proxy*)zwp_pointer_gestures_v1, ++ ZWP_POINTER_GESTURES_V1_GET_SWIPE_GESTURE, ++ &zwp_pointer_gesture_swipe_v1_interface, ++ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gestures_v1), 0, NULL, ++ pointer); ++ ++ return (struct zwp_pointer_gesture_swipe_v1*)id; ++} ++ ++/** ++ * @ingroup iface_zwp_pointer_gestures_v1 ++ * ++ * Create a pinch gesture object. See the ++ * wl_pointer_gesture_pinch interface for details. ++ */ ++static inline struct zwp_pointer_gesture_pinch_v1* ++zwp_pointer_gestures_v1_get_pinch_gesture( ++ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1, ++ struct wl_pointer* pointer) { ++ struct wl_proxy* id; ++ ++ id = wl_proxy_marshal_flags( ++ (struct wl_proxy*)zwp_pointer_gestures_v1, ++ ZWP_POINTER_GESTURES_V1_GET_PINCH_GESTURE, ++ &zwp_pointer_gesture_pinch_v1_interface, ++ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gestures_v1), 0, NULL, ++ pointer); ++ ++ return (struct zwp_pointer_gesture_pinch_v1*)id; ++} ++ ++/** ++ * @ingroup iface_zwp_pointer_gestures_v1 ++ * ++ * Destroy the pointer gesture object. Swipe, pinch and hold objects ++ * created via this gesture object remain valid. ++ */ ++static inline void zwp_pointer_gestures_v1_release( ++ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1) { ++ wl_proxy_marshal_flags( ++ (struct wl_proxy*)zwp_pointer_gestures_v1, ++ ZWP_POINTER_GESTURES_V1_RELEASE, NULL, ++ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gestures_v1), ++ WL_MARSHAL_FLAG_DESTROY); ++} ++ ++/** ++ * @ingroup iface_zwp_pointer_gestures_v1 ++ * ++ * Create a hold gesture object. See the ++ * wl_pointer_gesture_hold interface for details. ++ */ ++static inline struct zwp_pointer_gesture_hold_v1* ++zwp_pointer_gestures_v1_get_hold_gesture( ++ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1, ++ struct wl_pointer* pointer) { ++ struct wl_proxy* id; ++ ++ id = wl_proxy_marshal_flags( ++ (struct wl_proxy*)zwp_pointer_gestures_v1, ++ ZWP_POINTER_GESTURES_V1_GET_HOLD_GESTURE, ++ &zwp_pointer_gesture_hold_v1_interface, ++ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gestures_v1), 0, NULL, ++ pointer); ++ ++ return (struct zwp_pointer_gesture_hold_v1*)id; ++} ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_swipe_v1 ++ * @struct zwp_pointer_gesture_swipe_v1_listener ++ */ ++struct zwp_pointer_gesture_swipe_v1_listener { ++ /** ++ * multi-finger swipe begin ++ * ++ * This event is sent when a multi-finger swipe gesture is ++ * detected on the device. ++ * @param time timestamp with millisecond granularity ++ * @param fingers number of fingers ++ */ ++ void (*begin)( ++ void* data, ++ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1, ++ uint32_t serial, uint32_t time, struct wl_surface* surface, ++ uint32_t fingers); ++ /** ++ * multi-finger swipe motion ++ * ++ * This event is sent when a multi-finger swipe gesture changes ++ * the position of the logical center. ++ * ++ * The dx and dy coordinates are relative coordinates of the ++ * logical center of the gesture compared to the previous event. ++ * @param time timestamp with millisecond granularity ++ * @param dx delta x coordinate in surface coordinate space ++ * @param dy delta y coordinate in surface coordinate space ++ */ ++ void (*update)( ++ void* data, ++ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1, ++ uint32_t time, wl_fixed_t dx, wl_fixed_t dy); ++ /** ++ * multi-finger swipe end ++ * ++ * This event is sent when a multi-finger swipe gesture ceases to ++ * be valid. This may happen when one or more fingers are lifted or ++ * the gesture is cancelled. ++ * ++ * When a gesture is cancelled, the client should undo state ++ * changes caused by this gesture. What causes a gesture to be ++ * cancelled is implementation-dependent. ++ * @param time timestamp with millisecond granularity ++ * @param cancelled 1 if the gesture was cancelled, 0 otherwise ++ */ ++ void (*end)(void* data, ++ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1, ++ uint32_t serial, uint32_t time, int32_t cancelled); ++}; ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_swipe_v1 ++ */ ++static inline int zwp_pointer_gesture_swipe_v1_add_listener( ++ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1, ++ const struct zwp_pointer_gesture_swipe_v1_listener* listener, void* data) { ++ return wl_proxy_add_listener((struct wl_proxy*)zwp_pointer_gesture_swipe_v1, ++ (void (**)(void))listener, data); ++} ++ ++#define ZWP_POINTER_GESTURE_SWIPE_V1_DESTROY 0 ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_swipe_v1 ++ */ ++#define ZWP_POINTER_GESTURE_SWIPE_V1_BEGIN_SINCE_VERSION 1 ++/** ++ * @ingroup iface_zwp_pointer_gesture_swipe_v1 ++ */ ++#define ZWP_POINTER_GESTURE_SWIPE_V1_UPDATE_SINCE_VERSION 1 ++/** ++ * @ingroup iface_zwp_pointer_gesture_swipe_v1 ++ */ ++#define ZWP_POINTER_GESTURE_SWIPE_V1_END_SINCE_VERSION 1 ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_swipe_v1 ++ */ ++#define ZWP_POINTER_GESTURE_SWIPE_V1_DESTROY_SINCE_VERSION 1 ++ ++/** @ingroup iface_zwp_pointer_gesture_swipe_v1 */ ++static inline void zwp_pointer_gesture_swipe_v1_set_user_data( ++ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1, ++ void* user_data) { ++ wl_proxy_set_user_data((struct wl_proxy*)zwp_pointer_gesture_swipe_v1, ++ user_data); ++} ++ ++/** @ingroup iface_zwp_pointer_gesture_swipe_v1 */ ++static inline void* zwp_pointer_gesture_swipe_v1_get_user_data( ++ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1) { ++ return wl_proxy_get_user_data((struct wl_proxy*)zwp_pointer_gesture_swipe_v1); ++} ++ ++static inline uint32_t zwp_pointer_gesture_swipe_v1_get_version( ++ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1) { ++ return wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_swipe_v1); ++} ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_swipe_v1 ++ */ ++static inline void zwp_pointer_gesture_swipe_v1_destroy( ++ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1) { ++ wl_proxy_marshal_flags( ++ (struct wl_proxy*)zwp_pointer_gesture_swipe_v1, ++ ZWP_POINTER_GESTURE_SWIPE_V1_DESTROY, NULL, ++ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_swipe_v1), ++ WL_MARSHAL_FLAG_DESTROY); ++} ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_pinch_v1 ++ * @struct zwp_pointer_gesture_pinch_v1_listener ++ */ ++struct zwp_pointer_gesture_pinch_v1_listener { ++ /** ++ * multi-finger pinch begin ++ * ++ * This event is sent when a multi-finger pinch gesture is ++ * detected on the device. ++ * @param time timestamp with millisecond granularity ++ * @param fingers number of fingers ++ */ ++ void (*begin)( ++ void* data, ++ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1, ++ uint32_t serial, uint32_t time, struct wl_surface* surface, ++ uint32_t fingers); ++ /** ++ * multi-finger pinch motion ++ * ++ * This event is sent when a multi-finger pinch gesture changes ++ * the position of the logical center, the rotation or the relative ++ * scale. ++ * ++ * The dx and dy coordinates are relative coordinates in the ++ * surface coordinate space of the logical center of the gesture. ++ * ++ * The scale factor is an absolute scale compared to the ++ * pointer_gesture_pinch.begin event, e.g. a scale of 2 means the ++ * fingers are now twice as far apart as on ++ * pointer_gesture_pinch.begin. ++ * ++ * The rotation is the relative angle in degrees clockwise compared ++ * to the previous pointer_gesture_pinch.begin or ++ * pointer_gesture_pinch.update event. ++ * @param time timestamp with millisecond granularity ++ * @param dx delta x coordinate in surface coordinate space ++ * @param dy delta y coordinate in surface coordinate space ++ * @param scale scale relative to the initial finger position ++ * @param rotation angle in degrees cw relative to the previous event ++ */ ++ void (*update)( ++ void* data, ++ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1, ++ uint32_t time, wl_fixed_t dx, wl_fixed_t dy, wl_fixed_t scale, ++ wl_fixed_t rotation); ++ /** ++ * multi-finger pinch end ++ * ++ * This event is sent when a multi-finger pinch gesture ceases to ++ * be valid. This may happen when one or more fingers are lifted or ++ * the gesture is cancelled. ++ * ++ * When a gesture is cancelled, the client should undo state ++ * changes caused by this gesture. What causes a gesture to be ++ * cancelled is implementation-dependent. ++ * @param time timestamp with millisecond granularity ++ * @param cancelled 1 if the gesture was cancelled, 0 otherwise ++ */ ++ void (*end)(void* data, ++ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1, ++ uint32_t serial, uint32_t time, int32_t cancelled); ++}; ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_pinch_v1 ++ */ ++static inline int zwp_pointer_gesture_pinch_v1_add_listener( ++ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1, ++ const struct zwp_pointer_gesture_pinch_v1_listener* listener, void* data) { ++ return wl_proxy_add_listener((struct wl_proxy*)zwp_pointer_gesture_pinch_v1, ++ (void (**)(void))listener, data); ++} ++ ++#define ZWP_POINTER_GESTURE_PINCH_V1_DESTROY 0 ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_pinch_v1 ++ */ ++#define ZWP_POINTER_GESTURE_PINCH_V1_BEGIN_SINCE_VERSION 1 ++/** ++ * @ingroup iface_zwp_pointer_gesture_pinch_v1 ++ */ ++#define ZWP_POINTER_GESTURE_PINCH_V1_UPDATE_SINCE_VERSION 1 ++/** ++ * @ingroup iface_zwp_pointer_gesture_pinch_v1 ++ */ ++#define ZWP_POINTER_GESTURE_PINCH_V1_END_SINCE_VERSION 1 ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_pinch_v1 ++ */ ++#define ZWP_POINTER_GESTURE_PINCH_V1_DESTROY_SINCE_VERSION 1 ++ ++/** @ingroup iface_zwp_pointer_gesture_pinch_v1 */ ++static inline void zwp_pointer_gesture_pinch_v1_set_user_data( ++ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1, ++ void* user_data) { ++ wl_proxy_set_user_data((struct wl_proxy*)zwp_pointer_gesture_pinch_v1, ++ user_data); ++} ++ ++/** @ingroup iface_zwp_pointer_gesture_pinch_v1 */ ++static inline void* zwp_pointer_gesture_pinch_v1_get_user_data( ++ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1) { ++ return wl_proxy_get_user_data((struct wl_proxy*)zwp_pointer_gesture_pinch_v1); ++} ++ ++static inline uint32_t zwp_pointer_gesture_pinch_v1_get_version( ++ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1) { ++ return wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_pinch_v1); ++} ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_pinch_v1 ++ */ ++static inline void zwp_pointer_gesture_pinch_v1_destroy( ++ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1) { ++ wl_proxy_marshal_flags( ++ (struct wl_proxy*)zwp_pointer_gesture_pinch_v1, ++ ZWP_POINTER_GESTURE_PINCH_V1_DESTROY, NULL, ++ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_pinch_v1), ++ WL_MARSHAL_FLAG_DESTROY); ++} ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_hold_v1 ++ * @struct zwp_pointer_gesture_hold_v1_listener ++ */ ++struct zwp_pointer_gesture_hold_v1_listener { ++ /** ++ * multi-finger hold begin ++ * ++ * This event is sent when a hold gesture is detected on the ++ * device. ++ * @param time timestamp with millisecond granularity ++ * @param fingers number of fingers ++ * @since 3 ++ */ ++ void (*begin)(void* data, ++ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1, ++ uint32_t serial, uint32_t time, struct wl_surface* surface, ++ uint32_t fingers); ++ /** ++ * multi-finger hold end ++ * ++ * This event is sent when a hold gesture ceases to be valid. ++ * This may happen when the holding fingers are lifted or the ++ * gesture is cancelled, for example if the fingers move past an ++ * implementation-defined threshold, the finger count changes or ++ * the hold gesture changes into a different type of gesture. ++ * ++ * When a gesture is cancelled, the client may need to undo state ++ * changes caused by this gesture. What causes a gesture to be ++ * cancelled is implementation-dependent. ++ * @param time timestamp with millisecond granularity ++ * @param cancelled 1 if the gesture was cancelled, 0 otherwise ++ * @since 3 ++ */ ++ void (*end)(void* data, ++ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1, ++ uint32_t serial, uint32_t time, int32_t cancelled); ++}; ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_hold_v1 ++ */ ++static inline int zwp_pointer_gesture_hold_v1_add_listener( ++ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1, ++ const struct zwp_pointer_gesture_hold_v1_listener* listener, void* data) { ++ return wl_proxy_add_listener((struct wl_proxy*)zwp_pointer_gesture_hold_v1, ++ (void (**)(void))listener, data); ++} ++ ++#define ZWP_POINTER_GESTURE_HOLD_V1_DESTROY 0 ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_hold_v1 ++ */ ++#define ZWP_POINTER_GESTURE_HOLD_V1_BEGIN_SINCE_VERSION 3 ++/** ++ * @ingroup iface_zwp_pointer_gesture_hold_v1 ++ */ ++#define ZWP_POINTER_GESTURE_HOLD_V1_END_SINCE_VERSION 3 ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_hold_v1 ++ */ ++#define ZWP_POINTER_GESTURE_HOLD_V1_DESTROY_SINCE_VERSION 3 ++ ++/** @ingroup iface_zwp_pointer_gesture_hold_v1 */ ++static inline void zwp_pointer_gesture_hold_v1_set_user_data( ++ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1, ++ void* user_data) { ++ wl_proxy_set_user_data((struct wl_proxy*)zwp_pointer_gesture_hold_v1, ++ user_data); ++} ++ ++/** @ingroup iface_zwp_pointer_gesture_hold_v1 */ ++static inline void* zwp_pointer_gesture_hold_v1_get_user_data( ++ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1) { ++ return wl_proxy_get_user_data((struct wl_proxy*)zwp_pointer_gesture_hold_v1); ++} ++ ++static inline uint32_t zwp_pointer_gesture_hold_v1_get_version( ++ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1) { ++ return wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_hold_v1); ++} ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_hold_v1 ++ */ ++static inline void zwp_pointer_gesture_hold_v1_destroy( ++ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1) { ++ wl_proxy_marshal_flags( ++ (struct wl_proxy*)zwp_pointer_gesture_hold_v1, ++ ZWP_POINTER_GESTURE_HOLD_V1_DESTROY, NULL, ++ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_hold_v1), ++ WL_MARSHAL_FLAG_DESTROY); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff --git a/widget/gtk/wayland/pointer-gestures-unstable-v1-protocol.c b/widget/gtk/wayland/pointer-gestures-unstable-v1-protocol.c +new file mode 100644 +--- /dev/null ++++ b/widget/gtk/wayland/pointer-gestures-unstable-v1-protocol.c +@@ -0,0 +1,112 @@ ++/* Generated by wayland-scanner 1.22.0 */ ++ ++#include ++#include ++#include "wayland-util.h" ++ ++#ifndef __has_attribute ++# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */ ++#endif ++ ++#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4) ++# define WL_PRIVATE __attribute__((visibility("hidden"))) ++#else ++# define WL_PRIVATE ++#endif ++ ++#pragma GCC visibility push(default) ++extern const struct wl_interface wl_pointer_interface; ++extern const struct wl_interface wl_surface_interface; ++#pragma GCC visibility pop ++extern const struct wl_interface zwp_pointer_gesture_hold_v1_interface; ++extern const struct wl_interface zwp_pointer_gesture_pinch_v1_interface; ++extern const struct wl_interface zwp_pointer_gesture_swipe_v1_interface; ++ ++static const struct wl_interface* pointer_gestures_unstable_v1_types[] = { ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ &zwp_pointer_gesture_swipe_v1_interface, ++ &wl_pointer_interface, ++ &zwp_pointer_gesture_pinch_v1_interface, ++ &wl_pointer_interface, ++ &zwp_pointer_gesture_hold_v1_interface, ++ &wl_pointer_interface, ++ NULL, ++ NULL, ++ &wl_surface_interface, ++ NULL, ++ NULL, ++ NULL, ++ &wl_surface_interface, ++ NULL, ++ NULL, ++ NULL, ++ &wl_surface_interface, ++ NULL, ++}; ++ ++static const struct wl_message zwp_pointer_gestures_v1_requests[] = { ++ {"get_swipe_gesture", "no", pointer_gestures_unstable_v1_types + 5}, ++ {"get_pinch_gesture", "no", pointer_gestures_unstable_v1_types + 7}, ++ {"release", "2", pointer_gestures_unstable_v1_types + 0}, ++ {"get_hold_gesture", "3no", pointer_gestures_unstable_v1_types + 9}, ++}; ++ ++WL_PRIVATE const struct wl_interface zwp_pointer_gestures_v1_interface = { ++ "zwp_pointer_gestures_v1", 3, 4, zwp_pointer_gestures_v1_requests, 0, NULL, ++}; ++ ++static const struct wl_message zwp_pointer_gesture_swipe_v1_requests[] = { ++ {"destroy", "", pointer_gestures_unstable_v1_types + 0}, ++}; ++ ++static const struct wl_message zwp_pointer_gesture_swipe_v1_events[] = { ++ {"begin", "uuou", pointer_gestures_unstable_v1_types + 11}, ++ {"update", "uff", pointer_gestures_unstable_v1_types + 0}, ++ {"end", "uui", pointer_gestures_unstable_v1_types + 0}, ++}; ++ ++WL_PRIVATE const struct wl_interface zwp_pointer_gesture_swipe_v1_interface = { ++ "zwp_pointer_gesture_swipe_v1", ++ 2, ++ 1, ++ zwp_pointer_gesture_swipe_v1_requests, ++ 3, ++ zwp_pointer_gesture_swipe_v1_events, ++}; ++ ++static const struct wl_message zwp_pointer_gesture_pinch_v1_requests[] = { ++ {"destroy", "", pointer_gestures_unstable_v1_types + 0}, ++}; ++ ++static const struct wl_message zwp_pointer_gesture_pinch_v1_events[] = { ++ {"begin", "uuou", pointer_gestures_unstable_v1_types + 15}, ++ {"update", "uffff", pointer_gestures_unstable_v1_types + 0}, ++ {"end", "uui", pointer_gestures_unstable_v1_types + 0}, ++}; ++ ++WL_PRIVATE const struct wl_interface zwp_pointer_gesture_pinch_v1_interface = { ++ "zwp_pointer_gesture_pinch_v1", ++ 2, ++ 1, ++ zwp_pointer_gesture_pinch_v1_requests, ++ 3, ++ zwp_pointer_gesture_pinch_v1_events, ++}; ++ ++static const struct wl_message zwp_pointer_gesture_hold_v1_requests[] = { ++ {"destroy", "3", pointer_gestures_unstable_v1_types + 0}, ++}; ++ ++static const struct wl_message zwp_pointer_gesture_hold_v1_events[] = { ++ {"begin", "3uuou", pointer_gestures_unstable_v1_types + 19}, ++ {"end", "3uui", pointer_gestures_unstable_v1_types + 0}, ++}; ++ ++WL_PRIVATE const struct wl_interface zwp_pointer_gesture_hold_v1_interface = { ++ "zwp_pointer_gesture_hold_v1", 3, 1, ++ zwp_pointer_gesture_hold_v1_requests, 2, zwp_pointer_gesture_hold_v1_events, ++}; + diff --git a/D220551.1729586452.diff b/D220551.1729586452.diff new file mode 100644 index 0000000..2d8c4e0 --- /dev/null +++ b/D220551.1729586452.diff @@ -0,0 +1,1908 @@ +diff --git a/widget/gtk/WidgetUtilsGtk.cpp b/widget/gtk/WidgetUtilsGtk.cpp +--- a/widget/gtk/WidgetUtilsGtk.cpp ++++ b/widget/gtk/WidgetUtilsGtk.cpp +@@ -303,11 +303,11 @@ + }; + #endif + + RefPtr RequestWaylandFocusPromise() { + #ifdef MOZ_WAYLAND +- if (!GdkIsWaylandDisplay() || !KeymapWrapper::GetSeat()) { ++ if (!GdkIsWaylandDisplay() || !WaylandDisplayGet()->GetSeat()) { + LOGW("RequestWaylandFocusPromise() failed."); + return nullptr; + } + + RefPtr sourceWindow = nsWindow::GetFocusedWindow(); +@@ -347,11 +347,11 @@ + xdg_activation_v1_get_activation_token(xdg_activation); + xdg_activation_token_v1_add_listener( + aXdgToken, &token_listener, + new XDGTokenRequest(aXdgToken, transferPromise)); + xdg_activation_token_v1_set_serial(aXdgToken, focusSerial, +- KeymapWrapper::GetSeat()); ++ WaylandDisplayGet()->GetSeat()); + xdg_activation_token_v1_set_surface(aXdgToken, focusSurface); + xdg_activation_token_v1_commit(aXdgToken); + + LOGW("RequestWaylandFocusPromise() XDG Token sent"); + +diff --git a/widget/gtk/mozwayland/mozwayland.h b/widget/gtk/mozwayland/mozwayland.h +--- a/widget/gtk/mozwayland/mozwayland.h ++++ b/widget/gtk/mozwayland/mozwayland.h +@@ -29,14 +29,22 @@ + struct wl_proxy* proxy, uint32_t opcode, + const struct wl_interface* interface, ...); + MOZ_EXPORT struct wl_proxy* wl_proxy_marshal_constructor_versioned( + struct wl_proxy* proxy, uint32_t opcode, + const struct wl_interface* interface, uint32_t version, ...); ++MOZ_EXPORT struct wl_proxy* wl_proxy_marshal_flags( ++ struct wl_proxy* proxy, uint32_t opcode, ++ const struct wl_interface* interface, uint32_t version, uint32_t flags, ++ ...); + MOZ_EXPORT void wl_proxy_destroy(struct wl_proxy* proxy); + MOZ_EXPORT void* wl_proxy_create_wrapper(void* proxy); + MOZ_EXPORT void wl_proxy_wrapper_destroy(void* proxy_wrapper); + ++#ifndef WL_MARSHAL_FLAG_DESTROY ++# define WL_MARSHAL_FLAG_DESTROY (1 << 0) ++#endif ++ + /* We need implement some missing functions from wayland-client-protocol.h + */ + #ifndef WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM + enum wl_data_device_manager_dnd_action { + WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE = 0, +@@ -125,10 +133,407 @@ + wl_proxy_marshal((struct wl_proxy*)wl_surface, WL_SURFACE_DAMAGE_BUFFER, x, y, + width, height); + } + #endif + ++#ifndef WL_POINTER_AXIS_ENUM ++# define WL_POINTER_AXIS_ENUM ++/** ++ * @ingroup iface_wl_pointer ++ * axis types ++ * ++ * Describes the axis types of scroll events. ++ */ ++enum wl_pointer_axis { ++ /** ++ * vertical axis ++ */ ++ WL_POINTER_AXIS_VERTICAL_SCROLL = 0, ++ /** ++ * horizontal axis ++ */ ++ WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1, ++}; ++#endif /* WL_POINTER_AXIS_ENUM */ ++ ++#ifndef WL_POINTER_AXIS_SOURCE_ENUM ++# define WL_POINTER_AXIS_SOURCE_ENUM ++/** ++ * @ingroup iface_wl_pointer ++ * axis source types ++ * ++ * Describes the source types for axis events. This indicates to the ++ * client how an axis event was physically generated; a client may ++ * adjust the user interface accordingly. For example, scroll events ++ * from a "finger" source may be in a smooth coordinate space with ++ * kinetic scrolling whereas a "wheel" source may be in discrete steps ++ * of a number of lines. ++ * ++ * The "continuous" axis source is a device generating events in a ++ * continuous coordinate space, but using something other than a ++ * finger. One example for this source is button-based scrolling where ++ * the vertical motion of a device is converted to scroll events while ++ * a button is held down. ++ * ++ * The "wheel tilt" axis source indicates that the actual device is a ++ * wheel but the scroll event is not caused by a rotation but a ++ * (usually sideways) tilt of the wheel. ++ */ ++enum wl_pointer_axis_source { ++ /** ++ * a physical wheel rotation ++ */ ++ WL_POINTER_AXIS_SOURCE_WHEEL = 0, ++ /** ++ * finger on a touch surface ++ */ ++ WL_POINTER_AXIS_SOURCE_FINGER = 1, ++ /** ++ * continuous coordinate space ++ */ ++ WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2, ++ /** ++ * a physical wheel tilt ++ * @since 6 ++ */ ++ WL_POINTER_AXIS_SOURCE_WHEEL_TILT = 3, ++}; ++/** ++ * @ingroup iface_wl_pointer ++ */ ++# define WL_POINTER_AXIS_SOURCE_WHEEL_TILT_SINCE_VERSION 6 ++#endif /* WL_POINTER_AXIS_SOURCE_ENUM */ ++ ++#ifndef WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM ++# define WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM ++/** ++ * @ingroup iface_wl_pointer ++ * axis relative direction ++ * ++ * This specifies the direction of the physical motion that caused a ++ * wl_pointer.axis event, relative to the wl_pointer.axis direction. ++ */ ++enum wl_pointer_axis_relative_direction { ++ /** ++ * physical motion matches axis direction ++ */ ++ WL_POINTER_AXIS_RELATIVE_DIRECTION_IDENTICAL = 0, ++ /** ++ * physical motion is the inverse of the axis direction ++ */ ++ WL_POINTER_AXIS_RELATIVE_DIRECTION_INVERTED = 1, ++}; ++#endif /* WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM */ ++ ++/** ++ * @ingroup iface_wl_pointer ++ * @struct wl_pointer_listener ++ */ ++struct moz_wl_pointer_listener { ++ /** ++ * enter event ++ * ++ * Notification that this seat's pointer is focused on a certain ++ * surface. ++ * ++ * When a seat's focus enters a surface, the pointer image is ++ * undefined and a client should respond to this event by setting ++ * an appropriate pointer image with the set_cursor request. ++ * @param serial serial number of the enter event ++ * @param surface surface entered by the pointer ++ * @param surface_x surface-local x coordinate ++ * @param surface_y surface-local y coordinate ++ */ ++ void (*enter)(void* data, struct wl_pointer* wl_pointer, uint32_t serial, ++ struct wl_surface* surface, wl_fixed_t surface_x, ++ wl_fixed_t surface_y); ++ /** ++ * leave event ++ * ++ * Notification that this seat's pointer is no longer focused on ++ * a certain surface. ++ * ++ * The leave notification is sent before the enter notification for ++ * the new focus. ++ * @param serial serial number of the leave event ++ * @param surface surface left by the pointer ++ */ ++ void (*leave)(void* data, struct wl_pointer* wl_pointer, uint32_t serial, ++ struct wl_surface* surface); ++ /** ++ * pointer motion event ++ * ++ * Notification of pointer location change. The arguments ++ * surface_x and surface_y are the location relative to the focused ++ * surface. ++ * @param time timestamp with millisecond granularity ++ * @param surface_x surface-local x coordinate ++ * @param surface_y surface-local y coordinate ++ */ ++ void (*motion)(void* data, struct wl_pointer* wl_pointer, uint32_t time, ++ wl_fixed_t surface_x, wl_fixed_t surface_y); ++ /** ++ * pointer button event ++ * ++ * Mouse button click and release notifications. ++ * ++ * The location of the click is given by the last motion or enter ++ * event. The time argument is a timestamp with millisecond ++ * granularity, with an undefined base. ++ * ++ * The button is a button code as defined in the Linux kernel's ++ * linux/input-event-codes.h header file, e.g. BTN_LEFT. ++ * ++ * Any 16-bit button code value is reserved for future additions to ++ * the kernel's event code list. All other button codes above ++ * 0xFFFF are currently undefined but may be used in future ++ * versions of this protocol. ++ * @param serial serial number of the button event ++ * @param time timestamp with millisecond granularity ++ * @param button button that produced the event ++ * @param state physical state of the button ++ */ ++ void (*button)(void* data, struct wl_pointer* wl_pointer, uint32_t serial, ++ uint32_t time, uint32_t button, uint32_t state); ++ /** ++ * axis event ++ * ++ * Scroll and other axis notifications. ++ * ++ * For scroll events (vertical and horizontal scroll axes), the ++ * value parameter is the length of a vector along the specified ++ * axis in a coordinate space identical to those of motion events, ++ * representing a relative movement along the specified axis. ++ * ++ * For devices that support movements non-parallel to axes multiple ++ * axis events will be emitted. ++ * ++ * When applicable, for example for touch pads, the server can ++ * choose to emit scroll events where the motion vector is ++ * equivalent to a motion event vector. ++ * ++ * When applicable, a client can transform its content relative to ++ * the scroll distance. ++ * @param time timestamp with millisecond granularity ++ * @param axis axis type ++ * @param value length of vector in surface-local coordinate space ++ */ ++ void (*axis)(void* data, struct wl_pointer* wl_pointer, uint32_t time, ++ uint32_t axis, wl_fixed_t value); ++ /** ++ * end of a pointer event sequence ++ * ++ * Indicates the end of a set of events that logically belong ++ * together. A client is expected to accumulate the data in all ++ * events within the frame before proceeding. ++ * ++ * All wl_pointer events before a wl_pointer.frame event belong ++ * logically together. For example, in a diagonal scroll motion the ++ * compositor will send an optional wl_pointer.axis_source event, ++ * two wl_pointer.axis events (horizontal and vertical) and finally ++ * a wl_pointer.frame event. The client may use this information to ++ * calculate a diagonal vector for scrolling. ++ * ++ * When multiple wl_pointer.axis events occur within the same ++ * frame, the motion vector is the combined motion of all events. ++ * When a wl_pointer.axis and a wl_pointer.axis_stop event occur ++ * within the same frame, this indicates that axis movement in one ++ * axis has stopped but continues in the other axis. When multiple ++ * wl_pointer.axis_stop events occur within the same frame, this ++ * indicates that these axes stopped in the same instance. ++ * ++ * A wl_pointer.frame event is sent for every logical event group, ++ * even if the group only contains a single wl_pointer event. ++ * Specifically, a client may get a sequence: motion, frame, ++ * button, frame, axis, frame, axis_stop, frame. ++ * ++ * The wl_pointer.enter and wl_pointer.leave events are logical ++ * events generated by the compositor and not the hardware. These ++ * events are also grouped by a wl_pointer.frame. When a pointer ++ * moves from one surface to another, a compositor should group the ++ * wl_pointer.leave event within the same wl_pointer.frame. ++ * However, a client must not rely on wl_pointer.leave and ++ * wl_pointer.enter being in the same wl_pointer.frame. ++ * Compositor-specific policies may require the wl_pointer.leave ++ * and wl_pointer.enter event being split across multiple ++ * wl_pointer.frame groups. ++ * @since 5 ++ */ ++ void (*frame)(void* data, struct wl_pointer* wl_pointer); ++ /** ++ * axis source event ++ * ++ * Source information for scroll and other axes. ++ * ++ * This event does not occur on its own. It is sent before a ++ * wl_pointer.frame event and carries the source information for ++ * all events within that frame. ++ * ++ * The source specifies how this event was generated. If the source ++ * is wl_pointer.axis_source.finger, a wl_pointer.axis_stop event ++ * will be sent when the user lifts the finger off the device. ++ * ++ * If the source is wl_pointer.axis_source.wheel, ++ * wl_pointer.axis_source.wheel_tilt or ++ * wl_pointer.axis_source.continuous, a wl_pointer.axis_stop event ++ * may or may not be sent. Whether a compositor sends an axis_stop ++ * event for these sources is hardware-specific and ++ * implementation-dependent; clients must not rely on receiving an ++ * axis_stop event for these scroll sources and should treat scroll ++ * sequences from these scroll sources as unterminated by default. ++ * ++ * This event is optional. If the source is unknown for a ++ * particular axis event sequence, no event is sent. Only one ++ * wl_pointer.axis_source event is permitted per frame. ++ * ++ * The order of wl_pointer.axis_discrete and wl_pointer.axis_source ++ * is not guaranteed. ++ * @param axis_source source of the axis event ++ * @since 5 ++ */ ++ void (*axis_source)(void* data, struct wl_pointer* wl_pointer, ++ uint32_t axis_source); ++ /** ++ * axis stop event ++ * ++ * Stop notification for scroll and other axes. ++ * ++ * For some wl_pointer.axis_source types, a wl_pointer.axis_stop ++ * event is sent to notify a client that the axis sequence has ++ * terminated. This enables the client to implement kinetic ++ * scrolling. See the wl_pointer.axis_source documentation for ++ * information on when this event may be generated. ++ * ++ * Any wl_pointer.axis events with the same axis_source after this ++ * event should be considered as the start of a new axis motion. ++ * ++ * The timestamp is to be interpreted identical to the timestamp in ++ * the wl_pointer.axis event. The timestamp value may be the same ++ * as a preceding wl_pointer.axis event. ++ * @param time timestamp with millisecond granularity ++ * @param axis the axis stopped with this event ++ * @since 5 ++ */ ++ void (*axis_stop)(void* data, struct wl_pointer* wl_pointer, uint32_t time, ++ uint32_t axis); ++ /** ++ * axis click event ++ * ++ * Discrete step information for scroll and other axes. ++ * ++ * This event carries the axis value of the wl_pointer.axis event ++ * in discrete steps (e.g. mouse wheel clicks). ++ * ++ * This event is deprecated with wl_pointer version 8 - this event ++ * is not sent to clients supporting version 8 or later. ++ * ++ * This event does not occur on its own, it is coupled with a ++ * wl_pointer.axis event that represents this axis value on a ++ * continuous scale. The protocol guarantees that each ++ * axis_discrete event is always followed by exactly one axis event ++ * with the same axis number within the same wl_pointer.frame. Note ++ * that the protocol allows for other events to occur between the ++ * axis_discrete and its coupled axis event, including other ++ * axis_discrete or axis events. A wl_pointer.frame must not ++ * contain more than one axis_discrete event per axis type. ++ * ++ * This event is optional; continuous scrolling devices like ++ * two-finger scrolling on touchpads do not have discrete steps and ++ * do not generate this event. ++ * ++ * The discrete value carries the directional information. e.g. a ++ * value of -2 is two steps towards the negative direction of this ++ * axis. ++ * ++ * The axis number is identical to the axis number in the ++ * associated axis event. ++ * ++ * The order of wl_pointer.axis_discrete and wl_pointer.axis_source ++ * is not guaranteed. ++ * @param axis axis type ++ * @param discrete number of steps ++ * @since 5 ++ * @deprecated Deprecated since version 8 ++ */ ++ void (*axis_discrete)(void* data, struct wl_pointer* wl_pointer, ++ uint32_t axis, int32_t discrete); ++ /** ++ * axis high-resolution scroll event ++ * ++ * Discrete high-resolution scroll information. ++ * ++ * This event carries high-resolution wheel scroll information, ++ * with each multiple of 120 representing one logical scroll step ++ * (a wheel detent). For example, an axis_value120 of 30 is one ++ * quarter of a logical scroll step in the positive direction, a ++ * value120 of -240 are two logical scroll steps in the negative ++ * direction within the same hardware event. Clients that rely on ++ * discrete scrolling should accumulate the value120 to multiples ++ * of 120 before processing the event. ++ * ++ * The value120 must not be zero. ++ * ++ * This event replaces the wl_pointer.axis_discrete event in ++ * clients supporting wl_pointer version 8 or later. ++ * ++ * Where a wl_pointer.axis_source event occurs in the same ++ * wl_pointer.frame, the axis source applies to this event. ++ * ++ * The order of wl_pointer.axis_value120 and wl_pointer.axis_source ++ * is not guaranteed. ++ * @param axis axis type ++ * @param value120 scroll distance as fraction of 120 ++ * @since 8 ++ */ ++ void (*axis_value120)(void* data, struct wl_pointer* wl_pointer, ++ uint32_t axis, int32_t value120); ++ /** ++ * axis relative physical direction event ++ * ++ * Relative directional information of the entity causing the ++ * axis motion. ++ * ++ * For a wl_pointer.axis event, the ++ * wl_pointer.axis_relative_direction event specifies the movement ++ * direction of the entity causing the wl_pointer.axis event. For ++ * example: - if a user's fingers on a touchpad move down and this ++ * causes a wl_pointer.axis vertical_scroll down event, the ++ * physical direction is 'identical' - if a user's fingers on a ++ * touchpad move down and this causes a wl_pointer.axis ++ * vertical_scroll up scroll up event ('natural scrolling'), the ++ * physical direction is 'inverted'. ++ * ++ * A client may use this information to adjust scroll motion of ++ * components. Specifically, enabling natural scrolling causes the ++ * content to change direction compared to traditional scrolling. ++ * Some widgets like volume control sliders should usually match ++ * the physical direction regardless of whether natural scrolling ++ * is active. This event enables clients to match the scroll ++ * direction of a widget to the physical direction. ++ * ++ * This event does not occur on its own, it is coupled with a ++ * wl_pointer.axis event that represents this axis value. The ++ * protocol guarantees that each axis_relative_direction event is ++ * always followed by exactly one axis event with the same axis ++ * number within the same wl_pointer.frame. Note that the protocol ++ * allows for other events to occur between the ++ * axis_relative_direction and its coupled axis event. ++ * ++ * The axis number is identical to the axis number in the ++ * associated axis event. ++ * ++ * The order of wl_pointer.axis_relative_direction, ++ * wl_pointer.axis_discrete and wl_pointer.axis_source is not ++ * guaranteed. ++ * @param axis axis type ++ * @param direction physical direction relative to axis motion ++ * @since 9 ++ */ ++ void (*axis_relative_direction)(void* data, struct wl_pointer* wl_pointer, ++ uint32_t axis, uint32_t direction); ++}; ++ + #ifdef __cplusplus + } + #endif + + #endif /* __MozWayland_h_ */ +diff --git a/widget/gtk/nsGtkKeyUtils.h b/widget/gtk/nsGtkKeyUtils.h +--- a/widget/gtk/nsGtkKeyUtils.h ++++ b/widget/gtk/nsGtkKeyUtils.h +@@ -196,22 +196,19 @@ + /** + * Utility function to set all supported modifier masks + * from xkb_keymap. We call that from Wayland backend routines. + */ + static void SetModifierMasks(xkb_keymap* aKeymap); ++ static void HandleKeymap(uint32_t format, int fd, uint32_t size); + + /** + * Wayland global focus handlers + */ + static void SetFocusIn(wl_surface* aFocusSurface, uint32_t aFocusSerial); + static void SetFocusOut(wl_surface* aFocusSurface); + static void GetFocusInfo(wl_surface** aFocusSurface, uint32_t* aFocusSerial); + +- static void SetSeat(wl_seat* aSeat, int aId); +- static void ClearSeat(int aId); +- static wl_seat* GetSeat(); +- + static void SetKeyboard(wl_keyboard* aKeyboard); + static wl_keyboard* GetKeyboard(); + static void ClearKeyboard(); + + /** +@@ -495,13 +492,10 @@ + void SetModifierMask(xkb_keymap* aKeymap, ModifierIndex aModifierIndex, + const char* aModifierName); + #endif + + #ifdef MOZ_WAYLAND +- static wl_seat* sSeat; +- static int sSeatID; +- static wl_keyboard* sKeyboard; + wl_surface* mFocusSurface = nullptr; + uint32_t mFocusSerial = 0; + #endif + }; + +diff --git a/widget/gtk/nsGtkKeyUtils.cpp b/widget/gtk/nsGtkKeyUtils.cpp +--- a/widget/gtk/nsGtkKeyUtils.cpp ++++ b/widget/gtk/nsGtkKeyUtils.cpp +@@ -63,16 +63,10 @@ + Time KeymapWrapper::sLastRepeatableKeyTime = 0; + #endif + KeymapWrapper::RepeatState KeymapWrapper::sRepeatState = + KeymapWrapper::NOT_PRESSED; + +-#ifdef MOZ_WAYLAND +-wl_seat* KeymapWrapper::sSeat = nullptr; +-int KeymapWrapper::sSeatID = -1; +-wl_keyboard* KeymapWrapper::sKeyboard = nullptr; +-#endif +- + static const char* GetBoolName(bool aBool) { return aBool ? "TRUE" : "FALSE"; } + + static const char* GetStatusName(nsEventStatus aStatus) { + switch (aStatus) { + case nsEventStatus_eConsumeDoDefault: +@@ -688,12 +682,11 @@ + keymapWrapper->GetGdkModifierMask(HYPER))); + } + + /* This keymap routine is derived from weston-2.0.0/clients/simple-im.c + */ +-static void keyboard_handle_keymap(void* data, struct wl_keyboard* wl_keyboard, +- uint32_t format, int fd, uint32_t size) { ++void KeymapWrapper::HandleKeymap(uint32_t format, int fd, uint32_t size) { + KeymapWrapper::ResetKeyboard(); + + if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) { + close(fd); + return; +@@ -722,54 +715,10 @@ + + xkb_keymap_unref(keymap); + + xkb_context_unref(xkb_context); + } +- +-static void keyboard_handle_enter(void* data, struct wl_keyboard* keyboard, +- uint32_t serial, struct wl_surface* surface, +- struct wl_array* keys) { +- KeymapWrapper::SetFocusIn(surface, serial); +-} +- +-static void keyboard_handle_leave(void* data, struct wl_keyboard* keyboard, +- uint32_t serial, struct wl_surface* surface) { +- KeymapWrapper::SetFocusOut(surface); +-} +- +-static void keyboard_handle_key(void* data, struct wl_keyboard* keyboard, +- uint32_t serial, uint32_t time, uint32_t key, +- uint32_t state) {} +-static void keyboard_handle_modifiers(void* data, struct wl_keyboard* keyboard, +- uint32_t serial, uint32_t mods_depressed, +- uint32_t mods_latched, +- uint32_t mods_locked, uint32_t group) {} +-static void keyboard_handle_repeat_info(void* data, +- struct wl_keyboard* keyboard, +- int32_t rate, int32_t delay) {} +- +-static const struct wl_keyboard_listener keyboard_listener = { +- keyboard_handle_keymap, keyboard_handle_enter, +- keyboard_handle_leave, keyboard_handle_key, +- keyboard_handle_modifiers, keyboard_handle_repeat_info}; +- +-static void seat_handle_capabilities(void* data, struct wl_seat* seat, +- unsigned int caps) { +- wl_keyboard* keyboard = KeymapWrapper::GetKeyboard(); +- if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !keyboard) { +- keyboard = wl_seat_get_keyboard(seat); +- wl_keyboard_add_listener(keyboard, &keyboard_listener, nullptr); +- KeymapWrapper::SetKeyboard(keyboard); +- } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && keyboard) { +- KeymapWrapper::ClearKeyboard(); +- } +-} +- +-static const struct wl_seat_listener seat_listener = { +- seat_handle_capabilities, +-}; +- + #endif + + KeymapWrapper::~KeymapWrapper() { + #ifdef MOZ_X11 + gdk_window_remove_filter(nullptr, FilterEvents, this); +@@ -2694,38 +2643,9 @@ + uint32_t* aFocusSerial) { + KeymapWrapper* keymapWrapper = KeymapWrapper::GetInstance(); + *aFocusSurface = keymapWrapper->mFocusSurface; + *aFocusSerial = keymapWrapper->mFocusSerial; + } +- +-void KeymapWrapper::SetSeat(wl_seat* aSeat, int aId) { +- sSeat = aSeat; +- sSeatID = aId; +- wl_seat_add_listener(aSeat, &seat_listener, nullptr); +-} +- +-void KeymapWrapper::ClearSeat(int aId) { +- if (sSeatID == aId) { +- ClearKeyboard(); +- sSeat = nullptr; +- sSeatID = -1; +- } +-} +- +-wl_seat* KeymapWrapper::GetSeat() { return sSeat; } +- +-void KeymapWrapper::SetKeyboard(wl_keyboard* aKeyboard) { +- sKeyboard = aKeyboard; +-} +- +-wl_keyboard* KeymapWrapper::GetKeyboard() { return sKeyboard; } +- +-void KeymapWrapper::ClearKeyboard() { +- if (sKeyboard) { +- wl_keyboard_destroy(sKeyboard); +- sKeyboard = nullptr; +- } +-} + #endif + + } // namespace widget + } // namespace mozilla +diff --git a/widget/gtk/nsWaylandDisplay.h b/widget/gtk/nsWaylandDisplay.h +--- a/widget/gtk/nsWaylandDisplay.h ++++ b/widget/gtk/nsWaylandDisplay.h +@@ -14,10 +14,11 @@ + #include "mozilla/widget/gbm.h" + #include "mozilla/widget/fractional-scale-v1-client-protocol.h" + #include "mozilla/widget/idle-inhibit-unstable-v1-client-protocol.h" + #include "mozilla/widget/relative-pointer-unstable-v1-client-protocol.h" + #include "mozilla/widget/pointer-constraints-unstable-v1-client-protocol.h" ++#include "mozilla/widget/pointer-gestures-unstable-v1-client-protocol.h" + #include "mozilla/widget/linux-dmabuf-unstable-v1-client-protocol.h" + #include "mozilla/widget/viewporter-client-protocol.h" + #include "mozilla/widget/xdg-activation-v1-client-protocol.h" + #include "mozilla/widget/xdg-dbus-annotation-v1-client-protocol.h" + #include "mozilla/widget/xdg-output-unstable-v1-client-protocol.h" +@@ -55,19 +56,33 @@ + wp_fractional_scale_manager_v1* GetFractionalScaleManager() { + return mFractionalScaleManager; + } + bool IsPrimarySelectionEnabled() { return mIsPrimarySelectionEnabled; } + ++ wl_pointer* GetPointer() { return mPointer; } ++ void SetPointer(wl_pointer* aPointer); ++ void RemovePointer(); ++ + void SetShm(wl_shm* aShm); ++ ++ void SetKeyboard(wl_keyboard* aKeyboard); ++ wl_keyboard* GetKeyboard() { return mKeyboard; } ++ void ClearKeyboard(); ++ ++ void SetSeat(wl_seat* aSeat, int aSeatId); ++ wl_seat* GetSeat() { return mSeat; } ++ void RemoveSeat(int aSeatId); ++ + void SetCompositor(wl_compositor* aCompositor); + void SetSubcompositor(wl_subcompositor* aSubcompositor); + void SetDataDeviceManager(wl_data_device_manager* aDataDeviceManager); + void SetIdleInhibitManager(zwp_idle_inhibit_manager_v1* aIdleInhibitManager); + void SetViewporter(wp_viewporter* aViewporter); + void SetRelativePointerManager( + zwp_relative_pointer_manager_v1* aRelativePointerManager); + void SetPointerConstraints(zwp_pointer_constraints_v1* aPointerConstraints); ++ void SetPointerGestures(zwp_pointer_gestures_v1* aPointerGestures); + void SetDmabuf(zwp_linux_dmabuf_v1* aDmabuf); + void SetXdgActivation(xdg_activation_v1* aXdgActivation); + void SetXdgDbusAnnotationManager( + xdg_dbus_annotation_manager_v1* aXdgDbusAnnotationManager); + void SetFractionalScaleManager(wp_fractional_scale_manager_v1* aManager) { +@@ -82,13 +97,19 @@ + wl_registry* mRegistry = nullptr; + wl_display* mDisplay = nullptr; + wl_compositor* mCompositor = nullptr; + wl_subcompositor* mSubcompositor = nullptr; + wl_shm* mShm = nullptr; ++ wl_seat* mSeat = nullptr; ++ int mSeatId = -1; ++ wl_keyboard* mKeyboard = nullptr; ++ wl_pointer* mPointer = nullptr; + zwp_idle_inhibit_manager_v1* mIdleInhibitManager = nullptr; + zwp_relative_pointer_manager_v1* mRelativePointerManager = nullptr; + zwp_pointer_constraints_v1* mPointerConstraints = nullptr; ++ zwp_pointer_gestures_v1* mPointerGestures = nullptr; ++ zwp_pointer_gesture_hold_v1* mPointerGestureHold = nullptr; + wp_viewporter* mViewporter = nullptr; + zwp_linux_dmabuf_v1* mDmabuf = nullptr; + xdg_activation_v1* mXdgActivation = nullptr; + xdg_dbus_annotation_manager_v1* mXdgDbusAnnotationManager = nullptr; + wp_fractional_scale_manager_v1* mFractionalScaleManager = nullptr; +diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp +--- a/widget/gtk/nsWaylandDisplay.cpp ++++ b/widget/gtk/nsWaylandDisplay.cpp +@@ -17,10 +17,11 @@ + #include "mozilla/ThreadLocal.h" + #include "mozilla/StaticPrefs_widget.h" + #include "mozilla/Sprintf.h" + #include "WidgetUtilsGtk.h" + #include "nsGtkKeyUtils.h" ++#include "nsWindow.h" + + namespace mozilla::widget { + + static nsWaylandDisplay* gWaylandDisplay; + +@@ -55,10 +56,202 @@ + return gWaylandDisplay; + } + + void nsWaylandDisplay::SetShm(wl_shm* aShm) { mShm = aShm; } + ++struct PointerState { ++ wl_surface* surface; ++ ++ nsWindow* GetWindow() { ++ GdkWindow* window = ++ static_cast(wl_surface_get_user_data(surface)); ++ return window ? static_cast( ++ g_object_get_data(G_OBJECT(window), "nsWindow")) ++ : nullptr; ++ } ++} sPointerState; ++ ++static void gesture_hold_begin(void* data, ++ struct zwp_pointer_gesture_hold_v1* hold, ++ uint32_t serial, uint32_t time, ++ struct wl_surface* surface, uint32_t fingers) { ++ RefPtr window = sPointerState.GetWindow(); ++ if (!window) { ++ return; ++ } ++ window->OnTouchpadHoldEvent(GDK_TOUCHPAD_GESTURE_PHASE_BEGIN, time, fingers); ++} ++ ++static void gesture_hold_end(void* data, ++ struct zwp_pointer_gesture_hold_v1* hold, ++ uint32_t serial, uint32_t time, ++ int32_t cancelled) { ++ RefPtr window = sPointerState.GetWindow(); ++ if (!window) { ++ return; ++ } ++ window->OnTouchpadHoldEvent(cancelled ? GDK_TOUCHPAD_GESTURE_PHASE_CANCEL ++ : GDK_TOUCHPAD_GESTURE_PHASE_END, ++ time, 0); ++} ++ ++static const struct zwp_pointer_gesture_hold_v1_listener gesture_hold_listener = ++ {gesture_hold_begin, gesture_hold_end}; ++ ++static void pointer_handle_enter(void* data, struct wl_pointer* pointer, ++ uint32_t serial, struct wl_surface* surface, ++ wl_fixed_t sx, wl_fixed_t sy) { ++ sPointerState.surface = surface; ++} ++ ++static void pointer_handle_leave(void* data, struct wl_pointer* pointer, ++ uint32_t serial, struct wl_surface* surface) { ++ sPointerState.surface = nullptr; ++} ++ ++static void pointer_handle_motion(void* data, struct wl_pointer* pointer, ++ uint32_t time, wl_fixed_t sx, wl_fixed_t sy) { ++} ++ ++static void pointer_handle_button(void* data, struct wl_pointer* pointer, ++ uint32_t serial, uint32_t time, ++ uint32_t button, uint32_t state) {} ++ ++static void pointer_handle_axis(void* data, struct wl_pointer* pointer, ++ uint32_t time, uint32_t axis, ++ wl_fixed_t value) {} ++ ++static void pointer_handle_frame(void* data, struct wl_pointer* pointer) {} ++ ++static void pointer_handle_axis_source( ++ void* data, struct wl_pointer* pointer, ++ /*enum wl_pointer_axis_source */ uint32_t source) {} ++ ++static void pointer_handle_axis_stop(void* data, struct wl_pointer* pointer, ++ uint32_t time, uint32_t axis) {} ++ ++static void pointer_handle_axis_discrete(void* data, struct wl_pointer* pointer, ++ uint32_t axis, int32_t value) {} ++ ++static void pointer_handle_axis_value120(void* data, struct wl_pointer* pointer, ++ uint32_t axis, int32_t value) {} ++ ++static const struct moz_wl_pointer_listener pointer_listener = { ++ pointer_handle_enter, pointer_handle_leave, ++ pointer_handle_motion, pointer_handle_button, ++ pointer_handle_axis, pointer_handle_frame, ++ pointer_handle_axis_source, pointer_handle_axis_stop, ++ pointer_handle_axis_discrete, pointer_handle_axis_value120, ++}; ++ ++void nsWaylandDisplay::SetPointer(wl_pointer* aPointer) { ++ if (!mPointerGestures) { ++ return; ++ } ++ MOZ_DIAGNOSTIC_ASSERT(!mPointer); ++ mPointer = aPointer; ++ wl_pointer_add_listener(mPointer, ++ (const wl_pointer_listener*)&pointer_listener, this); ++ ++ mPointerGestureHold = ++ zwp_pointer_gestures_v1_get_hold_gesture(mPointerGestures, mPointer); ++ zwp_pointer_gesture_hold_v1_set_user_data(mPointerGestureHold, this); ++ zwp_pointer_gesture_hold_v1_add_listener(mPointerGestureHold, ++ &gesture_hold_listener, this); ++} ++ ++void nsWaylandDisplay::RemovePointer() { ++ wl_pointer_release(mPointer); ++ mPointer = nullptr; ++} ++ ++static void seat_handle_capabilities(void* data, struct wl_seat* seat, ++ unsigned int caps) { ++ auto* display = static_cast(data); ++ if (!display) { ++ return; ++ } ++ ++ if ((caps & WL_SEAT_CAPABILITY_POINTER) && !display->GetPointer()) { ++ display->SetPointer(wl_seat_get_pointer(seat)); ++ } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && display->GetPointer()) { ++ display->RemovePointer(); ++ } ++ ++ wl_keyboard* keyboard = display->GetKeyboard(); ++ if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !keyboard) { ++ display->SetKeyboard(wl_seat_get_keyboard(seat)); ++ } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && keyboard) { ++ display->ClearKeyboard(); ++ } ++} ++ ++static const struct wl_seat_listener seat_listener = { ++ seat_handle_capabilities, ++}; ++ ++void nsWaylandDisplay::SetSeat(wl_seat* aSeat, int aSeatId) { ++ mSeat = aSeat; ++ mSeatId = aSeatId; ++ wl_seat_add_listener(aSeat, &seat_listener, this); ++} ++ ++void nsWaylandDisplay::RemoveSeat(int aSeatId) { ++ if (mSeatId == aSeatId) { ++ mSeat = nullptr; ++ mSeatId = -1; ++ } ++} ++ ++/* This keymap routine is derived from weston-2.0.0/clients/simple-im.c ++ */ ++static void keyboard_handle_keymap(void* data, struct wl_keyboard* wl_keyboard, ++ uint32_t format, int fd, uint32_t size) { ++ KeymapWrapper::HandleKeymap(format, fd, size); ++} ++ ++static void keyboard_handle_enter(void* data, struct wl_keyboard* keyboard, ++ uint32_t serial, struct wl_surface* surface, ++ struct wl_array* keys) { ++ KeymapWrapper::SetFocusIn(surface, serial); ++} ++ ++static void keyboard_handle_leave(void* data, struct wl_keyboard* keyboard, ++ uint32_t serial, struct wl_surface* surface) { ++ KeymapWrapper::SetFocusOut(surface); ++} ++ ++static void keyboard_handle_key(void* data, struct wl_keyboard* keyboard, ++ uint32_t serial, uint32_t time, uint32_t key, ++ uint32_t state) {} ++static void keyboard_handle_modifiers(void* data, struct wl_keyboard* keyboard, ++ uint32_t serial, uint32_t mods_depressed, ++ uint32_t mods_latched, ++ uint32_t mods_locked, uint32_t group) {} ++static void keyboard_handle_repeat_info(void* data, ++ struct wl_keyboard* keyboard, ++ int32_t rate, int32_t delay) {} ++ ++static const struct wl_keyboard_listener keyboard_listener = { ++ keyboard_handle_keymap, keyboard_handle_enter, ++ keyboard_handle_leave, keyboard_handle_key, ++ keyboard_handle_modifiers, keyboard_handle_repeat_info}; ++ ++void nsWaylandDisplay::SetKeyboard(wl_keyboard* aKeyboard) { ++ MOZ_ASSERT(aKeyboard); ++ MOZ_DIAGNOSTIC_ASSERT(!mKeyboard); ++ mKeyboard = aKeyboard; ++ wl_keyboard_add_listener(mKeyboard, &keyboard_listener, nullptr); ++} ++ ++void nsWaylandDisplay::ClearKeyboard() { ++ if (mKeyboard) { ++ wl_keyboard_destroy(mKeyboard); ++ mKeyboard = nullptr; ++ } ++} ++ + void nsWaylandDisplay::SetCompositor(wl_compositor* aCompositor) { + mCompositor = aCompositor; + } + + void nsWaylandDisplay::SetSubcompositor(wl_subcompositor* aSubcompositor) { +@@ -82,10 +275,15 @@ + void nsWaylandDisplay::SetPointerConstraints( + zwp_pointer_constraints_v1* aPointerConstraints) { + mPointerConstraints = aPointerConstraints; + } + ++void nsWaylandDisplay::SetPointerGestures( ++ zwp_pointer_gestures_v1* aPointerGestures) { ++ mPointerGestures = aPointerGestures; ++} ++ + void nsWaylandDisplay::SetDmabuf(zwp_linux_dmabuf_v1* aDmabuf) { + mDmabuf = aDmabuf; + } + + void nsWaylandDisplay::SetXdgActivation(xdg_activation_v1* aXdgActivation) { +@@ -122,11 +320,12 @@ + } else if (iface.EqualsLiteral("zwp_pointer_constraints_v1")) { + auto* pointer_constraints = WaylandRegistryBind( + registry, id, &zwp_pointer_constraints_v1_interface, 1); + display->SetPointerConstraints(pointer_constraints); + } else if (iface.EqualsLiteral("wl_compositor")) { +- // Requested wl_compositor version 4 as we need wl_surface_damage_buffer(). ++ // Requested wl_compositor version 4 as we need ++ // wl_surface_damage_buffer(). + auto* compositor = WaylandRegistryBind( + registry, id, &wl_compositor_interface, 4); + display->SetCompositor(compositor); + } else if (iface.EqualsLiteral("wl_subcompositor")) { + auto* subcompositor = WaylandRegistryBind( +@@ -150,24 +349,33 @@ + registry, id, &xdg_dbus_annotation_manager_v1_interface, 1); + display->SetXdgDbusAnnotationManager(annotationManager); + } else if (iface.EqualsLiteral("wl_seat")) { + auto* seat = + WaylandRegistryBind(registry, id, &wl_seat_interface, 1); +- KeymapWrapper::SetSeat(seat, id); ++ display->SetSeat(seat, id); + } else if (iface.EqualsLiteral("wp_fractional_scale_manager_v1")) { + auto* manager = WaylandRegistryBind( + registry, id, &wp_fractional_scale_manager_v1_interface, 1); + display->SetFractionalScaleManager(manager); + } else if (iface.EqualsLiteral("gtk_primary_selection_device_manager") || + iface.EqualsLiteral("zwp_primary_selection_device_manager_v1")) { + display->EnablePrimarySelection(); ++ } else if (iface.EqualsLiteral("zwp_pointer_gestures_v1")) { ++ // HOLD is introduced in version 3 ++ auto* gestures = WaylandRegistryBind( ++ registry, id, &zwp_pointer_gestures_v1_interface, 3); ++ display->SetPointerGestures(gestures); + } + } + + static void global_registry_remover(void* data, wl_registry* registry, + uint32_t id) { +- KeymapWrapper::ClearSeat(id); ++ auto* display = static_cast(data); ++ if (!display) { ++ return; ++ } ++ display->RemoveSeat(id); + } + + static const struct wl_registry_listener registry_listener = { + global_registry_handler, global_registry_remover}; + +diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h +--- a/widget/gtk/nsWindow.h ++++ b/widget/gtk/nsWindow.h +@@ -107,10 +107,19 @@ + GDK_ANCHOR_SLIDE = GDK_ANCHOR_SLIDE_X | GDK_ANCHOR_SLIDE_Y, + GDK_ANCHOR_RESIZE = GDK_ANCHOR_RESIZE_X | GDK_ANCHOR_RESIZE_Y + } GdkAnchorHints; + #endif + ++#if !GTK_CHECK_VERSION(3, 18, 0) ++typedef enum { ++ GDK_TOUCHPAD_GESTURE_PHASE_BEGIN, ++ GDK_TOUCHPAD_GESTURE_PHASE_UPDATE, ++ GDK_TOUCHPAD_GESTURE_PHASE_END, ++ GDK_TOUCHPAD_GESTURE_PHASE_CANCEL ++} GdkTouchpadGesturePhase; ++#endif ++ + namespace mozilla { + enum class NativeKeyBindingsType : uint8_t; + + class TimeStamp; + #ifdef MOZ_X11 +@@ -256,10 +265,12 @@ + GtkSelectionData* aSelectionData, guint aInfo, + guint aTime, gpointer aData); + gboolean OnPropertyNotifyEvent(GtkWidget* aWidget, GdkEventProperty* aEvent); + gboolean OnTouchEvent(GdkEventTouch* aEvent); + gboolean OnTouchpadPinchEvent(GdkEventTouchpadPinch* aEvent); ++ void OnTouchpadHoldEvent(GdkTouchpadGesturePhase aPhase, guint aTime, ++ uint32_t aFingers); + + gint GetInputRegionMarginInGdkCoords(); + + void UpdateOpaqueRegionInternal(); + void UpdateOpaqueRegion(const LayoutDeviceIntRegion&) override; +diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp +--- a/widget/gtk/nsWindow.cpp ++++ b/widget/gtk/nsWindow.cpp +@@ -139,11 +139,10 @@ + // Don't put more than this many rects in the dirty region, just fluff + // out to the bounding-box if there are more + #define MAX_RECTS_IN_REGION 100 + + #if !GTK_CHECK_VERSION(3, 18, 0) +- + struct _GdkEventTouchpadPinch { + GdkEventType type; + GdkWindow* window; + gint8 send_event; + gint8 phase; +@@ -157,20 +156,12 @@ + gdouble scale; + gdouble x_root, y_root; + guint state; + }; + +-typedef enum { +- GDK_TOUCHPAD_GESTURE_PHASE_BEGIN, +- GDK_TOUCHPAD_GESTURE_PHASE_UPDATE, +- GDK_TOUCHPAD_GESTURE_PHASE_END, +- GDK_TOUCHPAD_GESTURE_PHASE_CANCEL +-} GdkTouchpadGesturePhase; +- + gint GDK_TOUCHPAD_GESTURE_MASK = 1 << 24; + GdkEventType GDK_TOUCHPAD_PINCH = static_cast(42); +- + #endif + + const gint kEvents = GDK_TOUCHPAD_GESTURE_MASK | GDK_EXPOSURE_MASK | + GDK_STRUCTURE_MASK | GDK_VISIBILITY_NOTIFY_MASK | + GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | +@@ -5509,10 +5500,15 @@ + mLastPinchEventSpan = aEvent->scale; + DispatchPinchGestureInput(event); + return TRUE; + } + ++void nsWindow::OnTouchpadHoldEvent(GdkTouchpadGesturePhase aPhase, guint aTime, ++ uint32_t aFingers) { ++ LOG("OnTouchpadHoldEvent: aPhase %d aFingers %d", aPhase, aFingers); ++} ++ + gboolean nsWindow::OnTouchEvent(GdkEventTouch* aEvent) { + LOG("OnTouchEvent: x=%f y=%f type=%d\n", aEvent->x, aEvent->y, aEvent->type); + if (!mHandleTouchEvent) { + // If a popup window was spawned (e.g. as the result of a long-press) + // and touch events got diverted to that window within a touch sequence, +diff --git a/widget/gtk/wayland/moz.build b/widget/gtk/wayland/moz.build +--- a/widget/gtk/wayland/moz.build ++++ b/widget/gtk/wayland/moz.build +@@ -10,10 +10,11 @@ + SOURCES += [ + "fractional-scale-v1-protocol.c", + "idle-inhibit-unstable-v1-protocol.c", + "linux-dmabuf-unstable-v1-protocol.c", + "pointer-constraints-unstable-v1-protocol.c", ++ "pointer-gestures-unstable-v1-protocol.c", + "relative-pointer-unstable-v1-protocol.c", + "viewporter-protocol.c", + "xdg-activation-v1-protocol.c", + "xdg-dbus-annotation-v1-protocol.c", + "xdg-output-unstable-v1-protocol.c", +@@ -22,10 +23,11 @@ + EXPORTS.mozilla.widget += [ + "fractional-scale-v1-client-protocol.h", + "idle-inhibit-unstable-v1-client-protocol.h", + "linux-dmabuf-unstable-v1-client-protocol.h", + "pointer-constraints-unstable-v1-client-protocol.h", ++ "pointer-gestures-unstable-v1-client-protocol.h", + "relative-pointer-unstable-v1-client-protocol.h", + "viewporter-client-protocol.h", + "xdg-activation-v1-client-protocol.h", + "xdg-dbus-annotation-v1-client-protocol.h", + "xdg-output-unstable-v1-client-protocol.h", +diff --git a/widget/gtk/wayland/pointer-gestures-unstable-v1-client-protocol.h b/widget/gtk/wayland/pointer-gestures-unstable-v1-client-protocol.h +new file mode 100644 +--- /dev/null ++++ b/widget/gtk/wayland/pointer-gestures-unstable-v1-client-protocol.h +@@ -0,0 +1,685 @@ ++/* Generated by wayland-scanner 1.22.0 */ ++ ++#ifndef POINTER_GESTURES_UNSTABLE_V1_CLIENT_PROTOCOL_H ++#define POINTER_GESTURES_UNSTABLE_V1_CLIENT_PROTOCOL_H ++ ++#include ++#include ++#include "wayland-client.h" ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++/** ++ * @page page_pointer_gestures_unstable_v1 The pointer_gestures_unstable_v1 ++ * protocol ++ * @section page_ifaces_pointer_gestures_unstable_v1 Interfaces ++ * - @subpage page_iface_zwp_pointer_gestures_v1 - touchpad gestures ++ * - @subpage page_iface_zwp_pointer_gesture_swipe_v1 - a swipe gesture object ++ * - @subpage page_iface_zwp_pointer_gesture_pinch_v1 - a pinch gesture object ++ * - @subpage page_iface_zwp_pointer_gesture_hold_v1 - a hold gesture object ++ */ ++struct wl_pointer; ++struct wl_surface; ++struct zwp_pointer_gesture_hold_v1; ++struct zwp_pointer_gesture_pinch_v1; ++struct zwp_pointer_gesture_swipe_v1; ++struct zwp_pointer_gestures_v1; ++ ++#ifndef ZWP_POINTER_GESTURES_V1_INTERFACE ++# define ZWP_POINTER_GESTURES_V1_INTERFACE ++/** ++ * @page page_iface_zwp_pointer_gestures_v1 zwp_pointer_gestures_v1 ++ * @section page_iface_zwp_pointer_gestures_v1_desc Description ++ * ++ * A global interface to provide semantic touchpad gestures for a given ++ * pointer. ++ * ++ * Three gestures are currently supported: swipe, pinch, and hold. ++ * Pinch and swipe gestures follow a three-stage cycle: begin, update, ++ * end, hold gestures follow a two-stage cycle: begin and end. All ++ * gestures are identified by a unique id. ++ * ++ * Warning! The protocol described in this file is experimental and ++ * backward incompatible changes may be made. Backward compatible changes ++ * may be added together with the corresponding interface version bump. ++ * Backward incompatible changes are done by bumping the version number in ++ * the protocol and interface names and resetting the interface version. ++ * Once the protocol is to be declared stable, the 'z' prefix and the ++ * version number in the protocol and interface names are removed and the ++ * interface version number is reset. ++ * @section page_iface_zwp_pointer_gestures_v1_api API ++ * See @ref iface_zwp_pointer_gestures_v1. ++ */ ++/** ++ * @defgroup iface_zwp_pointer_gestures_v1 The zwp_pointer_gestures_v1 interface ++ * ++ * A global interface to provide semantic touchpad gestures for a given ++ * pointer. ++ * ++ * Three gestures are currently supported: swipe, pinch, and hold. ++ * Pinch and swipe gestures follow a three-stage cycle: begin, update, ++ * end, hold gestures follow a two-stage cycle: begin and end. All ++ * gestures are identified by a unique id. ++ * ++ * Warning! The protocol described in this file is experimental and ++ * backward incompatible changes may be made. Backward compatible changes ++ * may be added together with the corresponding interface version bump. ++ * Backward incompatible changes are done by bumping the version number in ++ * the protocol and interface names and resetting the interface version. ++ * Once the protocol is to be declared stable, the 'z' prefix and the ++ * version number in the protocol and interface names are removed and the ++ * interface version number is reset. ++ */ ++extern const struct wl_interface zwp_pointer_gestures_v1_interface; ++#endif ++#ifndef ZWP_POINTER_GESTURE_SWIPE_V1_INTERFACE ++# define ZWP_POINTER_GESTURE_SWIPE_V1_INTERFACE ++/** ++ * @page page_iface_zwp_pointer_gesture_swipe_v1 zwp_pointer_gesture_swipe_v1 ++ * @section page_iface_zwp_pointer_gesture_swipe_v1_desc Description ++ * ++ * A swipe gesture object notifies a client about a multi-finger swipe ++ * gesture detected on an indirect input device such as a touchpad. ++ * The gesture is usually initiated by multiple fingers moving in the ++ * same direction but once initiated the direction may change. ++ * The precise conditions of when such a gesture is detected are ++ * implementation-dependent. ++ * ++ * A gesture consists of three stages: begin, update (optional) and end. ++ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a ++ * same pointer/seat, how compositors prevent these situations is ++ * implementation-dependent. ++ * ++ * A gesture may be cancelled by the compositor or the hardware. ++ * Clients should not consider performing permanent or irreversible ++ * actions until the end of a gesture has been received. ++ * @section page_iface_zwp_pointer_gesture_swipe_v1_api API ++ * See @ref iface_zwp_pointer_gesture_swipe_v1. ++ */ ++/** ++ * @defgroup iface_zwp_pointer_gesture_swipe_v1 The zwp_pointer_gesture_swipe_v1 ++ * interface ++ * ++ * A swipe gesture object notifies a client about a multi-finger swipe ++ * gesture detected on an indirect input device such as a touchpad. ++ * The gesture is usually initiated by multiple fingers moving in the ++ * same direction but once initiated the direction may change. ++ * The precise conditions of when such a gesture is detected are ++ * implementation-dependent. ++ * ++ * A gesture consists of three stages: begin, update (optional) and end. ++ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a ++ * same pointer/seat, how compositors prevent these situations is ++ * implementation-dependent. ++ * ++ * A gesture may be cancelled by the compositor or the hardware. ++ * Clients should not consider performing permanent or irreversible ++ * actions until the end of a gesture has been received. ++ */ ++extern const struct wl_interface zwp_pointer_gesture_swipe_v1_interface; ++#endif ++#ifndef ZWP_POINTER_GESTURE_PINCH_V1_INTERFACE ++# define ZWP_POINTER_GESTURE_PINCH_V1_INTERFACE ++/** ++ * @page page_iface_zwp_pointer_gesture_pinch_v1 zwp_pointer_gesture_pinch_v1 ++ * @section page_iface_zwp_pointer_gesture_pinch_v1_desc Description ++ * ++ * A pinch gesture object notifies a client about a multi-finger pinch ++ * gesture detected on an indirect input device such as a touchpad. ++ * The gesture is usually initiated by multiple fingers moving towards ++ * each other or away from each other, or by two or more fingers rotating ++ * around a logical center of gravity. The precise conditions of when ++ * such a gesture is detected are implementation-dependent. ++ * ++ * A gesture consists of three stages: begin, update (optional) and end. ++ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a ++ * same pointer/seat, how compositors prevent these situations is ++ * implementation-dependent. ++ * ++ * A gesture may be cancelled by the compositor or the hardware. ++ * Clients should not consider performing permanent or irreversible ++ * actions until the end of a gesture has been received. ++ * @section page_iface_zwp_pointer_gesture_pinch_v1_api API ++ * See @ref iface_zwp_pointer_gesture_pinch_v1. ++ */ ++/** ++ * @defgroup iface_zwp_pointer_gesture_pinch_v1 The zwp_pointer_gesture_pinch_v1 ++ * interface ++ * ++ * A pinch gesture object notifies a client about a multi-finger pinch ++ * gesture detected on an indirect input device such as a touchpad. ++ * The gesture is usually initiated by multiple fingers moving towards ++ * each other or away from each other, or by two or more fingers rotating ++ * around a logical center of gravity. The precise conditions of when ++ * such a gesture is detected are implementation-dependent. ++ * ++ * A gesture consists of three stages: begin, update (optional) and end. ++ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a ++ * same pointer/seat, how compositors prevent these situations is ++ * implementation-dependent. ++ * ++ * A gesture may be cancelled by the compositor or the hardware. ++ * Clients should not consider performing permanent or irreversible ++ * actions until the end of a gesture has been received. ++ */ ++extern const struct wl_interface zwp_pointer_gesture_pinch_v1_interface; ++#endif ++#ifndef ZWP_POINTER_GESTURE_HOLD_V1_INTERFACE ++# define ZWP_POINTER_GESTURE_HOLD_V1_INTERFACE ++/** ++ * @page page_iface_zwp_pointer_gesture_hold_v1 zwp_pointer_gesture_hold_v1 ++ * @section page_iface_zwp_pointer_gesture_hold_v1_desc Description ++ * ++ * A hold gesture object notifies a client about a single- or ++ * multi-finger hold gesture detected on an indirect input device such as ++ * a touchpad. The gesture is usually initiated by one or more fingers ++ * being held down without significant movement. The precise conditions ++ * of when such a gesture is detected are implementation-dependent. ++ * ++ * In particular, this gesture may be used to cancel kinetic scrolling. ++ * ++ * A hold gesture consists of two stages: begin and end. Unlike pinch and ++ * swipe there is no update stage. ++ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a ++ * same pointer/seat, how compositors prevent these situations is ++ * implementation-dependent. ++ * ++ * A gesture may be cancelled by the compositor or the hardware. ++ * Clients should not consider performing permanent or irreversible ++ * actions until the end of a gesture has been received. ++ * @section page_iface_zwp_pointer_gesture_hold_v1_api API ++ * See @ref iface_zwp_pointer_gesture_hold_v1. ++ */ ++/** ++ * @defgroup iface_zwp_pointer_gesture_hold_v1 The zwp_pointer_gesture_hold_v1 ++ * interface ++ * ++ * A hold gesture object notifies a client about a single- or ++ * multi-finger hold gesture detected on an indirect input device such as ++ * a touchpad. The gesture is usually initiated by one or more fingers ++ * being held down without significant movement. The precise conditions ++ * of when such a gesture is detected are implementation-dependent. ++ * ++ * In particular, this gesture may be used to cancel kinetic scrolling. ++ * ++ * A hold gesture consists of two stages: begin and end. Unlike pinch and ++ * swipe there is no update stage. ++ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a ++ * same pointer/seat, how compositors prevent these situations is ++ * implementation-dependent. ++ * ++ * A gesture may be cancelled by the compositor or the hardware. ++ * Clients should not consider performing permanent or irreversible ++ * actions until the end of a gesture has been received. ++ */ ++extern const struct wl_interface zwp_pointer_gesture_hold_v1_interface; ++#endif ++ ++#define ZWP_POINTER_GESTURES_V1_GET_SWIPE_GESTURE 0 ++#define ZWP_POINTER_GESTURES_V1_GET_PINCH_GESTURE 1 ++#define ZWP_POINTER_GESTURES_V1_RELEASE 2 ++#define ZWP_POINTER_GESTURES_V1_GET_HOLD_GESTURE 3 ++ ++/** ++ * @ingroup iface_zwp_pointer_gestures_v1 ++ */ ++#define ZWP_POINTER_GESTURES_V1_GET_SWIPE_GESTURE_SINCE_VERSION 1 ++/** ++ * @ingroup iface_zwp_pointer_gestures_v1 ++ */ ++#define ZWP_POINTER_GESTURES_V1_GET_PINCH_GESTURE_SINCE_VERSION 1 ++/** ++ * @ingroup iface_zwp_pointer_gestures_v1 ++ */ ++#define ZWP_POINTER_GESTURES_V1_RELEASE_SINCE_VERSION 2 ++/** ++ * @ingroup iface_zwp_pointer_gestures_v1 ++ */ ++#define ZWP_POINTER_GESTURES_V1_GET_HOLD_GESTURE_SINCE_VERSION 3 ++ ++/** @ingroup iface_zwp_pointer_gestures_v1 */ ++static inline void zwp_pointer_gestures_v1_set_user_data( ++ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1, void* user_data) { ++ wl_proxy_set_user_data((struct wl_proxy*)zwp_pointer_gestures_v1, user_data); ++} ++ ++/** @ingroup iface_zwp_pointer_gestures_v1 */ ++static inline void* zwp_pointer_gestures_v1_get_user_data( ++ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1) { ++ return wl_proxy_get_user_data((struct wl_proxy*)zwp_pointer_gestures_v1); ++} ++ ++static inline uint32_t zwp_pointer_gestures_v1_get_version( ++ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1) { ++ return wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gestures_v1); ++} ++ ++/** @ingroup iface_zwp_pointer_gestures_v1 */ ++static inline void zwp_pointer_gestures_v1_destroy( ++ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1) { ++ wl_proxy_destroy((struct wl_proxy*)zwp_pointer_gestures_v1); ++} ++ ++/** ++ * @ingroup iface_zwp_pointer_gestures_v1 ++ * ++ * Create a swipe gesture object. See the ++ * wl_pointer_gesture_swipe interface for details. ++ */ ++static inline struct zwp_pointer_gesture_swipe_v1* ++zwp_pointer_gestures_v1_get_swipe_gesture( ++ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1, ++ struct wl_pointer* pointer) { ++ struct wl_proxy* id; ++ ++ id = wl_proxy_marshal_flags( ++ (struct wl_proxy*)zwp_pointer_gestures_v1, ++ ZWP_POINTER_GESTURES_V1_GET_SWIPE_GESTURE, ++ &zwp_pointer_gesture_swipe_v1_interface, ++ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gestures_v1), 0, NULL, ++ pointer); ++ ++ return (struct zwp_pointer_gesture_swipe_v1*)id; ++} ++ ++/** ++ * @ingroup iface_zwp_pointer_gestures_v1 ++ * ++ * Create a pinch gesture object. See the ++ * wl_pointer_gesture_pinch interface for details. ++ */ ++static inline struct zwp_pointer_gesture_pinch_v1* ++zwp_pointer_gestures_v1_get_pinch_gesture( ++ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1, ++ struct wl_pointer* pointer) { ++ struct wl_proxy* id; ++ ++ id = wl_proxy_marshal_flags( ++ (struct wl_proxy*)zwp_pointer_gestures_v1, ++ ZWP_POINTER_GESTURES_V1_GET_PINCH_GESTURE, ++ &zwp_pointer_gesture_pinch_v1_interface, ++ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gestures_v1), 0, NULL, ++ pointer); ++ ++ return (struct zwp_pointer_gesture_pinch_v1*)id; ++} ++ ++/** ++ * @ingroup iface_zwp_pointer_gestures_v1 ++ * ++ * Destroy the pointer gesture object. Swipe, pinch and hold objects ++ * created via this gesture object remain valid. ++ */ ++static inline void zwp_pointer_gestures_v1_release( ++ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1) { ++ wl_proxy_marshal_flags( ++ (struct wl_proxy*)zwp_pointer_gestures_v1, ++ ZWP_POINTER_GESTURES_V1_RELEASE, NULL, ++ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gestures_v1), ++ WL_MARSHAL_FLAG_DESTROY); ++} ++ ++/** ++ * @ingroup iface_zwp_pointer_gestures_v1 ++ * ++ * Create a hold gesture object. See the ++ * wl_pointer_gesture_hold interface for details. ++ */ ++static inline struct zwp_pointer_gesture_hold_v1* ++zwp_pointer_gestures_v1_get_hold_gesture( ++ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1, ++ struct wl_pointer* pointer) { ++ struct wl_proxy* id; ++ ++ id = wl_proxy_marshal_flags( ++ (struct wl_proxy*)zwp_pointer_gestures_v1, ++ ZWP_POINTER_GESTURES_V1_GET_HOLD_GESTURE, ++ &zwp_pointer_gesture_hold_v1_interface, ++ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gestures_v1), 0, NULL, ++ pointer); ++ ++ return (struct zwp_pointer_gesture_hold_v1*)id; ++} ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_swipe_v1 ++ * @struct zwp_pointer_gesture_swipe_v1_listener ++ */ ++struct zwp_pointer_gesture_swipe_v1_listener { ++ /** ++ * multi-finger swipe begin ++ * ++ * This event is sent when a multi-finger swipe gesture is ++ * detected on the device. ++ * @param time timestamp with millisecond granularity ++ * @param fingers number of fingers ++ */ ++ void (*begin)( ++ void* data, ++ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1, ++ uint32_t serial, uint32_t time, struct wl_surface* surface, ++ uint32_t fingers); ++ /** ++ * multi-finger swipe motion ++ * ++ * This event is sent when a multi-finger swipe gesture changes ++ * the position of the logical center. ++ * ++ * The dx and dy coordinates are relative coordinates of the ++ * logical center of the gesture compared to the previous event. ++ * @param time timestamp with millisecond granularity ++ * @param dx delta x coordinate in surface coordinate space ++ * @param dy delta y coordinate in surface coordinate space ++ */ ++ void (*update)( ++ void* data, ++ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1, ++ uint32_t time, wl_fixed_t dx, wl_fixed_t dy); ++ /** ++ * multi-finger swipe end ++ * ++ * This event is sent when a multi-finger swipe gesture ceases to ++ * be valid. This may happen when one or more fingers are lifted or ++ * the gesture is cancelled. ++ * ++ * When a gesture is cancelled, the client should undo state ++ * changes caused by this gesture. What causes a gesture to be ++ * cancelled is implementation-dependent. ++ * @param time timestamp with millisecond granularity ++ * @param cancelled 1 if the gesture was cancelled, 0 otherwise ++ */ ++ void (*end)(void* data, ++ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1, ++ uint32_t serial, uint32_t time, int32_t cancelled); ++}; ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_swipe_v1 ++ */ ++static inline int zwp_pointer_gesture_swipe_v1_add_listener( ++ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1, ++ const struct zwp_pointer_gesture_swipe_v1_listener* listener, void* data) { ++ return wl_proxy_add_listener((struct wl_proxy*)zwp_pointer_gesture_swipe_v1, ++ (void (**)(void))listener, data); ++} ++ ++#define ZWP_POINTER_GESTURE_SWIPE_V1_DESTROY 0 ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_swipe_v1 ++ */ ++#define ZWP_POINTER_GESTURE_SWIPE_V1_BEGIN_SINCE_VERSION 1 ++/** ++ * @ingroup iface_zwp_pointer_gesture_swipe_v1 ++ */ ++#define ZWP_POINTER_GESTURE_SWIPE_V1_UPDATE_SINCE_VERSION 1 ++/** ++ * @ingroup iface_zwp_pointer_gesture_swipe_v1 ++ */ ++#define ZWP_POINTER_GESTURE_SWIPE_V1_END_SINCE_VERSION 1 ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_swipe_v1 ++ */ ++#define ZWP_POINTER_GESTURE_SWIPE_V1_DESTROY_SINCE_VERSION 1 ++ ++/** @ingroup iface_zwp_pointer_gesture_swipe_v1 */ ++static inline void zwp_pointer_gesture_swipe_v1_set_user_data( ++ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1, ++ void* user_data) { ++ wl_proxy_set_user_data((struct wl_proxy*)zwp_pointer_gesture_swipe_v1, ++ user_data); ++} ++ ++/** @ingroup iface_zwp_pointer_gesture_swipe_v1 */ ++static inline void* zwp_pointer_gesture_swipe_v1_get_user_data( ++ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1) { ++ return wl_proxy_get_user_data((struct wl_proxy*)zwp_pointer_gesture_swipe_v1); ++} ++ ++static inline uint32_t zwp_pointer_gesture_swipe_v1_get_version( ++ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1) { ++ return wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_swipe_v1); ++} ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_swipe_v1 ++ */ ++static inline void zwp_pointer_gesture_swipe_v1_destroy( ++ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1) { ++ wl_proxy_marshal_flags( ++ (struct wl_proxy*)zwp_pointer_gesture_swipe_v1, ++ ZWP_POINTER_GESTURE_SWIPE_V1_DESTROY, NULL, ++ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_swipe_v1), ++ WL_MARSHAL_FLAG_DESTROY); ++} ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_pinch_v1 ++ * @struct zwp_pointer_gesture_pinch_v1_listener ++ */ ++struct zwp_pointer_gesture_pinch_v1_listener { ++ /** ++ * multi-finger pinch begin ++ * ++ * This event is sent when a multi-finger pinch gesture is ++ * detected on the device. ++ * @param time timestamp with millisecond granularity ++ * @param fingers number of fingers ++ */ ++ void (*begin)( ++ void* data, ++ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1, ++ uint32_t serial, uint32_t time, struct wl_surface* surface, ++ uint32_t fingers); ++ /** ++ * multi-finger pinch motion ++ * ++ * This event is sent when a multi-finger pinch gesture changes ++ * the position of the logical center, the rotation or the relative ++ * scale. ++ * ++ * The dx and dy coordinates are relative coordinates in the ++ * surface coordinate space of the logical center of the gesture. ++ * ++ * The scale factor is an absolute scale compared to the ++ * pointer_gesture_pinch.begin event, e.g. a scale of 2 means the ++ * fingers are now twice as far apart as on ++ * pointer_gesture_pinch.begin. ++ * ++ * The rotation is the relative angle in degrees clockwise compared ++ * to the previous pointer_gesture_pinch.begin or ++ * pointer_gesture_pinch.update event. ++ * @param time timestamp with millisecond granularity ++ * @param dx delta x coordinate in surface coordinate space ++ * @param dy delta y coordinate in surface coordinate space ++ * @param scale scale relative to the initial finger position ++ * @param rotation angle in degrees cw relative to the previous event ++ */ ++ void (*update)( ++ void* data, ++ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1, ++ uint32_t time, wl_fixed_t dx, wl_fixed_t dy, wl_fixed_t scale, ++ wl_fixed_t rotation); ++ /** ++ * multi-finger pinch end ++ * ++ * This event is sent when a multi-finger pinch gesture ceases to ++ * be valid. This may happen when one or more fingers are lifted or ++ * the gesture is cancelled. ++ * ++ * When a gesture is cancelled, the client should undo state ++ * changes caused by this gesture. What causes a gesture to be ++ * cancelled is implementation-dependent. ++ * @param time timestamp with millisecond granularity ++ * @param cancelled 1 if the gesture was cancelled, 0 otherwise ++ */ ++ void (*end)(void* data, ++ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1, ++ uint32_t serial, uint32_t time, int32_t cancelled); ++}; ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_pinch_v1 ++ */ ++static inline int zwp_pointer_gesture_pinch_v1_add_listener( ++ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1, ++ const struct zwp_pointer_gesture_pinch_v1_listener* listener, void* data) { ++ return wl_proxy_add_listener((struct wl_proxy*)zwp_pointer_gesture_pinch_v1, ++ (void (**)(void))listener, data); ++} ++ ++#define ZWP_POINTER_GESTURE_PINCH_V1_DESTROY 0 ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_pinch_v1 ++ */ ++#define ZWP_POINTER_GESTURE_PINCH_V1_BEGIN_SINCE_VERSION 1 ++/** ++ * @ingroup iface_zwp_pointer_gesture_pinch_v1 ++ */ ++#define ZWP_POINTER_GESTURE_PINCH_V1_UPDATE_SINCE_VERSION 1 ++/** ++ * @ingroup iface_zwp_pointer_gesture_pinch_v1 ++ */ ++#define ZWP_POINTER_GESTURE_PINCH_V1_END_SINCE_VERSION 1 ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_pinch_v1 ++ */ ++#define ZWP_POINTER_GESTURE_PINCH_V1_DESTROY_SINCE_VERSION 1 ++ ++/** @ingroup iface_zwp_pointer_gesture_pinch_v1 */ ++static inline void zwp_pointer_gesture_pinch_v1_set_user_data( ++ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1, ++ void* user_data) { ++ wl_proxy_set_user_data((struct wl_proxy*)zwp_pointer_gesture_pinch_v1, ++ user_data); ++} ++ ++/** @ingroup iface_zwp_pointer_gesture_pinch_v1 */ ++static inline void* zwp_pointer_gesture_pinch_v1_get_user_data( ++ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1) { ++ return wl_proxy_get_user_data((struct wl_proxy*)zwp_pointer_gesture_pinch_v1); ++} ++ ++static inline uint32_t zwp_pointer_gesture_pinch_v1_get_version( ++ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1) { ++ return wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_pinch_v1); ++} ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_pinch_v1 ++ */ ++static inline void zwp_pointer_gesture_pinch_v1_destroy( ++ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1) { ++ wl_proxy_marshal_flags( ++ (struct wl_proxy*)zwp_pointer_gesture_pinch_v1, ++ ZWP_POINTER_GESTURE_PINCH_V1_DESTROY, NULL, ++ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_pinch_v1), ++ WL_MARSHAL_FLAG_DESTROY); ++} ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_hold_v1 ++ * @struct zwp_pointer_gesture_hold_v1_listener ++ */ ++struct zwp_pointer_gesture_hold_v1_listener { ++ /** ++ * multi-finger hold begin ++ * ++ * This event is sent when a hold gesture is detected on the ++ * device. ++ * @param time timestamp with millisecond granularity ++ * @param fingers number of fingers ++ * @since 3 ++ */ ++ void (*begin)(void* data, ++ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1, ++ uint32_t serial, uint32_t time, struct wl_surface* surface, ++ uint32_t fingers); ++ /** ++ * multi-finger hold end ++ * ++ * This event is sent when a hold gesture ceases to be valid. ++ * This may happen when the holding fingers are lifted or the ++ * gesture is cancelled, for example if the fingers move past an ++ * implementation-defined threshold, the finger count changes or ++ * the hold gesture changes into a different type of gesture. ++ * ++ * When a gesture is cancelled, the client may need to undo state ++ * changes caused by this gesture. What causes a gesture to be ++ * cancelled is implementation-dependent. ++ * @param time timestamp with millisecond granularity ++ * @param cancelled 1 if the gesture was cancelled, 0 otherwise ++ * @since 3 ++ */ ++ void (*end)(void* data, ++ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1, ++ uint32_t serial, uint32_t time, int32_t cancelled); ++}; ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_hold_v1 ++ */ ++static inline int zwp_pointer_gesture_hold_v1_add_listener( ++ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1, ++ const struct zwp_pointer_gesture_hold_v1_listener* listener, void* data) { ++ return wl_proxy_add_listener((struct wl_proxy*)zwp_pointer_gesture_hold_v1, ++ (void (**)(void))listener, data); ++} ++ ++#define ZWP_POINTER_GESTURE_HOLD_V1_DESTROY 0 ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_hold_v1 ++ */ ++#define ZWP_POINTER_GESTURE_HOLD_V1_BEGIN_SINCE_VERSION 3 ++/** ++ * @ingroup iface_zwp_pointer_gesture_hold_v1 ++ */ ++#define ZWP_POINTER_GESTURE_HOLD_V1_END_SINCE_VERSION 3 ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_hold_v1 ++ */ ++#define ZWP_POINTER_GESTURE_HOLD_V1_DESTROY_SINCE_VERSION 3 ++ ++/** @ingroup iface_zwp_pointer_gesture_hold_v1 */ ++static inline void zwp_pointer_gesture_hold_v1_set_user_data( ++ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1, ++ void* user_data) { ++ wl_proxy_set_user_data((struct wl_proxy*)zwp_pointer_gesture_hold_v1, ++ user_data); ++} ++ ++/** @ingroup iface_zwp_pointer_gesture_hold_v1 */ ++static inline void* zwp_pointer_gesture_hold_v1_get_user_data( ++ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1) { ++ return wl_proxy_get_user_data((struct wl_proxy*)zwp_pointer_gesture_hold_v1); ++} ++ ++static inline uint32_t zwp_pointer_gesture_hold_v1_get_version( ++ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1) { ++ return wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_hold_v1); ++} ++ ++/** ++ * @ingroup iface_zwp_pointer_gesture_hold_v1 ++ */ ++static inline void zwp_pointer_gesture_hold_v1_destroy( ++ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1) { ++ wl_proxy_marshal_flags( ++ (struct wl_proxy*)zwp_pointer_gesture_hold_v1, ++ ZWP_POINTER_GESTURE_HOLD_V1_DESTROY, NULL, ++ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_hold_v1), ++ WL_MARSHAL_FLAG_DESTROY); ++} ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +diff --git a/widget/gtk/wayland/pointer-gestures-unstable-v1-protocol.c b/widget/gtk/wayland/pointer-gestures-unstable-v1-protocol.c +new file mode 100644 +--- /dev/null ++++ b/widget/gtk/wayland/pointer-gestures-unstable-v1-protocol.c +@@ -0,0 +1,112 @@ ++/* Generated by wayland-scanner 1.22.0 */ ++ ++#include ++#include ++#include "wayland-util.h" ++ ++#ifndef __has_attribute ++# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */ ++#endif ++ ++#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4) ++# define WL_PRIVATE __attribute__((visibility("hidden"))) ++#else ++# define WL_PRIVATE ++#endif ++ ++#pragma GCC visibility push(default) ++extern const struct wl_interface wl_pointer_interface; ++extern const struct wl_interface wl_surface_interface; ++#pragma GCC visibility pop ++extern const struct wl_interface zwp_pointer_gesture_hold_v1_interface; ++extern const struct wl_interface zwp_pointer_gesture_pinch_v1_interface; ++extern const struct wl_interface zwp_pointer_gesture_swipe_v1_interface; ++ ++static const struct wl_interface* pointer_gestures_unstable_v1_types[] = { ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ NULL, ++ &zwp_pointer_gesture_swipe_v1_interface, ++ &wl_pointer_interface, ++ &zwp_pointer_gesture_pinch_v1_interface, ++ &wl_pointer_interface, ++ &zwp_pointer_gesture_hold_v1_interface, ++ &wl_pointer_interface, ++ NULL, ++ NULL, ++ &wl_surface_interface, ++ NULL, ++ NULL, ++ NULL, ++ &wl_surface_interface, ++ NULL, ++ NULL, ++ NULL, ++ &wl_surface_interface, ++ NULL, ++}; ++ ++static const struct wl_message zwp_pointer_gestures_v1_requests[] = { ++ {"get_swipe_gesture", "no", pointer_gestures_unstable_v1_types + 5}, ++ {"get_pinch_gesture", "no", pointer_gestures_unstable_v1_types + 7}, ++ {"release", "2", pointer_gestures_unstable_v1_types + 0}, ++ {"get_hold_gesture", "3no", pointer_gestures_unstable_v1_types + 9}, ++}; ++ ++WL_PRIVATE const struct wl_interface zwp_pointer_gestures_v1_interface = { ++ "zwp_pointer_gestures_v1", 3, 4, zwp_pointer_gestures_v1_requests, 0, NULL, ++}; ++ ++static const struct wl_message zwp_pointer_gesture_swipe_v1_requests[] = { ++ {"destroy", "", pointer_gestures_unstable_v1_types + 0}, ++}; ++ ++static const struct wl_message zwp_pointer_gesture_swipe_v1_events[] = { ++ {"begin", "uuou", pointer_gestures_unstable_v1_types + 11}, ++ {"update", "uff", pointer_gestures_unstable_v1_types + 0}, ++ {"end", "uui", pointer_gestures_unstable_v1_types + 0}, ++}; ++ ++WL_PRIVATE const struct wl_interface zwp_pointer_gesture_swipe_v1_interface = { ++ "zwp_pointer_gesture_swipe_v1", ++ 2, ++ 1, ++ zwp_pointer_gesture_swipe_v1_requests, ++ 3, ++ zwp_pointer_gesture_swipe_v1_events, ++}; ++ ++static const struct wl_message zwp_pointer_gesture_pinch_v1_requests[] = { ++ {"destroy", "", pointer_gestures_unstable_v1_types + 0}, ++}; ++ ++static const struct wl_message zwp_pointer_gesture_pinch_v1_events[] = { ++ {"begin", "uuou", pointer_gestures_unstable_v1_types + 15}, ++ {"update", "uffff", pointer_gestures_unstable_v1_types + 0}, ++ {"end", "uui", pointer_gestures_unstable_v1_types + 0}, ++}; ++ ++WL_PRIVATE const struct wl_interface zwp_pointer_gesture_pinch_v1_interface = { ++ "zwp_pointer_gesture_pinch_v1", ++ 2, ++ 1, ++ zwp_pointer_gesture_pinch_v1_requests, ++ 3, ++ zwp_pointer_gesture_pinch_v1_events, ++}; ++ ++static const struct wl_message zwp_pointer_gesture_hold_v1_requests[] = { ++ {"destroy", "3", pointer_gestures_unstable_v1_types + 0}, ++}; ++ ++static const struct wl_message zwp_pointer_gesture_hold_v1_events[] = { ++ {"begin", "3uuou", pointer_gestures_unstable_v1_types + 19}, ++ {"end", "3uui", pointer_gestures_unstable_v1_types + 0}, ++}; ++ ++WL_PRIVATE const struct wl_interface zwp_pointer_gesture_hold_v1_interface = { ++ "zwp_pointer_gesture_hold_v1", 3, 1, ++ zwp_pointer_gesture_hold_v1_requests, 2, zwp_pointer_gesture_hold_v1_events, ++}; + diff --git a/D221617.1729589907.diff b/D221617.1729589907.diff new file mode 100644 index 0000000..1b1718d --- /dev/null +++ b/D221617.1729589907.diff @@ -0,0 +1,123 @@ +diff --git a/widget/gtk/mozwayland/mozwayland.h b/widget/gtk/mozwayland/mozwayland.h +--- a/widget/gtk/mozwayland/mozwayland.h ++++ b/widget/gtk/mozwayland/mozwayland.h +@@ -41,10 +41,14 @@ + + #ifndef WL_MARSHAL_FLAG_DESTROY + # define WL_MARSHAL_FLAG_DESTROY (1 << 0) + #endif + ++#ifndef WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION ++# define WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION 4 ++#endif ++ + /* We need implement some missing functions from wayland-client-protocol.h + */ + #ifndef WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM + enum wl_data_device_manager_dnd_action { + WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE = 0, +@@ -133,10 +137,14 @@ + wl_proxy_marshal((struct wl_proxy*)wl_surface, WL_SURFACE_DAMAGE_BUFFER, x, y, + width, height); + } + #endif + ++#ifndef WL_POINTER_RELEASE_SINCE_VERSION ++# define WL_POINTER_RELEASE_SINCE_VERSION 3 ++#endif ++ + #ifndef WL_POINTER_AXIS_ENUM + # define WL_POINTER_AXIS_ENUM + /** + * @ingroup iface_wl_pointer + * axis types +diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp +--- a/widget/gtk/nsWaylandDisplay.cpp ++++ b/widget/gtk/nsWaylandDisplay.cpp +@@ -142,11 +142,12 @@ + pointer_handle_axis_source, pointer_handle_axis_stop, + pointer_handle_axis_discrete, pointer_handle_axis_value120, + }; + + void nsWaylandDisplay::SetPointer(wl_pointer* aPointer) { +- if (!mPointerGestures) { ++ if (!mPointerGestures || wl_proxy_get_version((struct wl_proxy*)aPointer) < ++ WL_POINTER_RELEASE_SINCE_VERSION) { + return; + } + MOZ_DIAGNOSTIC_ASSERT(!mPointer); + mPointer = aPointer; + wl_pointer_add_listener(mPointer, +@@ -183,12 +184,18 @@ + } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && keyboard) { + display->ClearKeyboard(); + } + } + ++static void seat_handle_name(void* data, struct wl_seat* seat, ++ const char* name) { ++ /* We don't care about the name. */ ++} ++ + static const struct wl_seat_listener seat_listener = { + seat_handle_capabilities, ++ seat_handle_name, + }; + + void nsWaylandDisplay::SetSeat(wl_seat* aSeat, int aSeatId) { + mSeat = aSeat; + mSeatId = aSeatId; +@@ -320,14 +327,13 @@ + } else if (iface.EqualsLiteral("zwp_pointer_constraints_v1")) { + auto* pointer_constraints = WaylandRegistryBind( + registry, id, &zwp_pointer_constraints_v1_interface, 1); + display->SetPointerConstraints(pointer_constraints); + } else if (iface.EqualsLiteral("wl_compositor")) { +- // Requested wl_compositor version 4 as we need +- // wl_surface_damage_buffer(). + auto* compositor = WaylandRegistryBind( +- registry, id, &wl_compositor_interface, 4); ++ registry, id, &wl_compositor_interface, ++ WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION); + display->SetCompositor(compositor); + } else if (iface.EqualsLiteral("wl_subcompositor")) { + auto* subcompositor = WaylandRegistryBind( + registry, id, &wl_subcompositor_interface, 1); + display->SetSubcompositor(subcompositor); +@@ -347,25 +353,29 @@ + auto* annotationManager = + WaylandRegistryBind( + registry, id, &xdg_dbus_annotation_manager_v1_interface, 1); + display->SetXdgDbusAnnotationManager(annotationManager); + } else if (iface.EqualsLiteral("wl_seat")) { +- auto* seat = +- WaylandRegistryBind(registry, id, &wl_seat_interface, 1); +- display->SetSeat(seat, id); ++ auto* seat = WaylandRegistryBind(registry, id, &wl_seat_interface, ++ WL_POINTER_RELEASE_SINCE_VERSION); ++ if (seat) { ++ display->SetSeat(seat, id); ++ } + } else if (iface.EqualsLiteral("wp_fractional_scale_manager_v1")) { + auto* manager = WaylandRegistryBind( + registry, id, &wp_fractional_scale_manager_v1_interface, 1); + display->SetFractionalScaleManager(manager); + } else if (iface.EqualsLiteral("gtk_primary_selection_device_manager") || + iface.EqualsLiteral("zwp_primary_selection_device_manager_v1")) { + display->EnablePrimarySelection(); + } else if (iface.EqualsLiteral("zwp_pointer_gestures_v1")) { +- // HOLD is introduced in version 3 + auto* gestures = WaylandRegistryBind( +- registry, id, &zwp_pointer_gestures_v1_interface, 3); +- display->SetPointerGestures(gestures); ++ registry, id, &zwp_pointer_gestures_v1_interface, ++ ZWP_POINTER_GESTURES_V1_GET_HOLD_GESTURE_SINCE_VERSION); ++ if (gestures) { ++ display->SetPointerGestures(gestures); ++ } + } + } + + static void global_registry_remover(void* data, wl_registry* registry, + uint32_t id) { + diff --git a/D221931.1729587190.diff b/D221931.1729587190.diff new file mode 100644 index 0000000..3fcaea6 --- /dev/null +++ b/D221931.1729587190.diff @@ -0,0 +1,80 @@ +diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp +--- a/widget/gtk/nsWaylandDisplay.cpp ++++ b/widget/gtk/nsWaylandDisplay.cpp +@@ -56,38 +56,48 @@ + return gWaylandDisplay; + } + + void nsWaylandDisplay::SetShm(wl_shm* aShm) { mShm = aShm; } + +-struct PointerState { +- wl_surface* surface; +- ++class EventSurface { ++ public: + nsWindow* GetWindow() { ++ if (!surface) { ++ return nullptr; ++ } + GdkWindow* window = + static_cast(wl_surface_get_user_data(surface)); + return window ? static_cast( + g_object_get_data(G_OBJECT(window), "nsWindow")) + : nullptr; + } +-} sPointerState; ++ void Set(wl_surface* aSurface) { surface = aSurface; } ++ void Clear() { surface = nullptr; } ++ ++ private: ++ wl_surface* surface = nullptr; ++}; ++ ++static EventSurface sTouchSurface; + + static void gesture_hold_begin(void* data, + struct zwp_pointer_gesture_hold_v1* hold, + uint32_t serial, uint32_t time, + struct wl_surface* surface, uint32_t fingers) { +- RefPtr window = sPointerState.GetWindow(); ++ sTouchSurface.Set(surface); ++ RefPtr window = sTouchSurface.GetWindow(); + if (!window) { + return; + } + window->OnTouchpadHoldEvent(GDK_TOUCHPAD_GESTURE_PHASE_BEGIN, time, fingers); + } + + static void gesture_hold_end(void* data, + struct zwp_pointer_gesture_hold_v1* hold, + uint32_t serial, uint32_t time, + int32_t cancelled) { +- RefPtr window = sPointerState.GetWindow(); ++ RefPtr window = sTouchSurface.GetWindow(); + if (!window) { + return; + } + window->OnTouchpadHoldEvent(cancelled ? GDK_TOUCHPAD_GESTURE_PHASE_CANCEL + : GDK_TOUCHPAD_GESTURE_PHASE_END, +@@ -97,18 +107,14 @@ + static const struct zwp_pointer_gesture_hold_v1_listener gesture_hold_listener = + {gesture_hold_begin, gesture_hold_end}; + + static void pointer_handle_enter(void* data, struct wl_pointer* pointer, + uint32_t serial, struct wl_surface* surface, +- wl_fixed_t sx, wl_fixed_t sy) { +- sPointerState.surface = surface; +-} ++ wl_fixed_t sx, wl_fixed_t sy) {} + + static void pointer_handle_leave(void* data, struct wl_pointer* pointer, +- uint32_t serial, struct wl_surface* surface) { +- sPointerState.surface = nullptr; +-} ++ uint32_t serial, struct wl_surface* surface) {} + + static void pointer_handle_motion(void* data, struct wl_pointer* pointer, + uint32_t time, wl_fixed_t sx, wl_fixed_t sy) { + } + + diff --git a/D222280.1729587199.diff b/D222280.1729587199.diff new file mode 100644 index 0000000..a48f729 --- /dev/null +++ b/D222280.1729587199.diff @@ -0,0 +1,65 @@ +diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp +--- a/widget/gtk/nsWaylandDisplay.cpp ++++ b/widget/gtk/nsWaylandDisplay.cpp +@@ -56,48 +56,44 @@ + return gWaylandDisplay; + } + + void nsWaylandDisplay::SetShm(wl_shm* aShm) { mShm = aShm; } + +-class EventSurface { ++class TouchWindow { + public: +- nsWindow* GetWindow() { +- if (!surface) { +- return nullptr; +- } ++ already_AddRefed GetAndClearWindow() { return mWindow.forget(); } ++ RefPtr TakeWindow(wl_surface* aSurface) { + GdkWindow* window = +- static_cast(wl_surface_get_user_data(surface)); +- return window ? static_cast( +- g_object_get_data(G_OBJECT(window), "nsWindow")) +- : nullptr; ++ static_cast(wl_surface_get_user_data(aSurface)); ++ mWindow = window ? static_cast( ++ g_object_get_data(G_OBJECT(window), "nsWindow")) ++ : nullptr; ++ return mWindow; + } +- void Set(wl_surface* aSurface) { surface = aSurface; } +- void Clear() { surface = nullptr; } + + private: +- wl_surface* surface = nullptr; ++ StaticRefPtr mWindow; + }; + +-static EventSurface sTouchSurface; ++static TouchWindow sTouchWindow; + + static void gesture_hold_begin(void* data, + struct zwp_pointer_gesture_hold_v1* hold, + uint32_t serial, uint32_t time, + struct wl_surface* surface, uint32_t fingers) { +- sTouchSurface.Set(surface); +- RefPtr window = sTouchSurface.GetWindow(); ++ RefPtr window = sTouchWindow.TakeWindow(surface); + if (!window) { + return; + } + window->OnTouchpadHoldEvent(GDK_TOUCHPAD_GESTURE_PHASE_BEGIN, time, fingers); + } + + static void gesture_hold_end(void* data, + struct zwp_pointer_gesture_hold_v1* hold, + uint32_t serial, uint32_t time, + int32_t cancelled) { +- RefPtr window = sTouchSurface.GetWindow(); ++ RefPtr window = sTouchWindow.GetAndClearWindow(); + if (!window) { + return; + } + window->OnTouchpadHoldEvent(cancelled ? GDK_TOUCHPAD_GESTURE_PHASE_CANCEL + : GDK_TOUCHPAD_GESTURE_PHASE_END, + diff --git a/D222363.1729589473.diff b/D222363.1729589473.diff new file mode 100644 index 0000000..bf25ebf --- /dev/null +++ b/D222363.1729589473.diff @@ -0,0 +1,73 @@ +diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp +--- a/widget/gtk/nsWaylandDisplay.cpp ++++ b/widget/gtk/nsWaylandDisplay.cpp +@@ -328,11 +328,12 @@ + display->SetRelativePointerManager(relative_pointer_manager); + } else if (iface.EqualsLiteral("zwp_pointer_constraints_v1")) { + auto* pointer_constraints = WaylandRegistryBind( + registry, id, &zwp_pointer_constraints_v1_interface, 1); + display->SetPointerConstraints(pointer_constraints); +- } else if (iface.EqualsLiteral("wl_compositor")) { ++ } else if (iface.EqualsLiteral("wl_compositor") && ++ version >= WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION) { + auto* compositor = WaylandRegistryBind( + registry, id, &wl_compositor_interface, + WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION); + display->SetCompositor(compositor); + } else if (iface.EqualsLiteral("wl_subcompositor")) { +@@ -341,43 +342,44 @@ + display->SetSubcompositor(subcompositor); + } else if (iface.EqualsLiteral("wp_viewporter")) { + auto* viewporter = WaylandRegistryBind( + registry, id, &wp_viewporter_interface, 1); + display->SetViewporter(viewporter); +- } else if (iface.EqualsLiteral("zwp_linux_dmabuf_v1") && version > 2) { ++ } else if (iface.EqualsLiteral("zwp_linux_dmabuf_v1") && ++ version >= ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION) { + auto* dmabuf = WaylandRegistryBind( +- registry, id, &zwp_linux_dmabuf_v1_interface, 3); ++ registry, id, &zwp_linux_dmabuf_v1_interface, ++ ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION); + display->SetDmabuf(dmabuf); + } else if (iface.EqualsLiteral("xdg_activation_v1")) { + auto* activation = WaylandRegistryBind( + registry, id, &xdg_activation_v1_interface, 1); + display->SetXdgActivation(activation); + } else if (iface.EqualsLiteral("xdg_dbus_annotation_manager_v1")) { + auto* annotationManager = + WaylandRegistryBind( + registry, id, &xdg_dbus_annotation_manager_v1_interface, 1); + display->SetXdgDbusAnnotationManager(annotationManager); +- } else if (iface.EqualsLiteral("wl_seat")) { ++ } else if (iface.EqualsLiteral("wl_seat") && ++ version >= WL_POINTER_RELEASE_SINCE_VERSION) { + auto* seat = WaylandRegistryBind(registry, id, &wl_seat_interface, + WL_POINTER_RELEASE_SINCE_VERSION); +- if (seat) { +- display->SetSeat(seat, id); +- } ++ display->SetSeat(seat, id); + } else if (iface.EqualsLiteral("wp_fractional_scale_manager_v1")) { + auto* manager = WaylandRegistryBind( + registry, id, &wp_fractional_scale_manager_v1_interface, 1); + display->SetFractionalScaleManager(manager); + } else if (iface.EqualsLiteral("gtk_primary_selection_device_manager") || + iface.EqualsLiteral("zwp_primary_selection_device_manager_v1")) { + display->EnablePrimarySelection(); +- } else if (iface.EqualsLiteral("zwp_pointer_gestures_v1")) { ++ } else if (iface.EqualsLiteral("zwp_pointer_gestures_v1") && ++ version >= ++ ZWP_POINTER_GESTURES_V1_GET_HOLD_GESTURE_SINCE_VERSION) { + auto* gestures = WaylandRegistryBind( + registry, id, &zwp_pointer_gestures_v1_interface, + ZWP_POINTER_GESTURES_V1_GET_HOLD_GESTURE_SINCE_VERSION); +- if (gestures) { +- display->SetPointerGestures(gestures); +- } ++ display->SetPointerGestures(gestures); + } + } + + static void global_registry_remover(void* data, wl_registry* registry, + uint32_t id) { + diff --git a/D223285.1729586039.diff b/D223285.1729586039.diff new file mode 100644 index 0000000..f3ed973 --- /dev/null +++ b/D223285.1729586039.diff @@ -0,0 +1,478 @@ +diff --git a/widget/gtk/mozwayland/mozwayland.h b/widget/gtk/mozwayland/mozwayland.h +--- a/widget/gtk/mozwayland/mozwayland.h ++++ b/widget/gtk/mozwayland/mozwayland.h +@@ -137,14 +137,10 @@ + wl_proxy_marshal((struct wl_proxy*)wl_surface, WL_SURFACE_DAMAGE_BUFFER, x, y, + width, height); + } + #endif + +-#ifndef WL_POINTER_RELEASE_SINCE_VERSION +-# define WL_POINTER_RELEASE_SINCE_VERSION 3 +-#endif +- + #ifndef WL_POINTER_AXIS_ENUM + # define WL_POINTER_AXIS_ENUM + /** + * @ingroup iface_wl_pointer + * axis types +@@ -230,10 +226,58 @@ + */ + WL_POINTER_AXIS_RELATIVE_DIRECTION_INVERTED = 1, + }; + #endif /* WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM */ + ++#ifndef WL_POINTER_AXIS_SOURCE_ENUM ++# define WL_POINTER_AXIS_SOURCE_ENUM ++/** ++ * @ingroup iface_wl_pointer ++ * axis source types ++ * ++ * Describes the source types for axis events. This indicates to the ++ * client how an axis event was physically generated; a client may ++ * adjust the user interface accordingly. For example, scroll events ++ * from a "finger" source may be in a smooth coordinate space with ++ * kinetic scrolling whereas a "wheel" source may be in discrete steps ++ * of a number of lines. ++ * ++ * The "continuous" axis source is a device generating events in a ++ * continuous coordinate space, but using something other than a ++ * finger. One example for this source is button-based scrolling where ++ * the vertical motion of a device is converted to scroll events while ++ * a button is held down. ++ * ++ * The "wheel tilt" axis source indicates that the actual device is a ++ * wheel but the scroll event is not caused by a rotation but a ++ * (usually sideways) tilt of the wheel. ++ */ ++enum wl_pointer_axis_source { ++ /** ++ * a physical wheel rotation ++ */ ++ WL_POINTER_AXIS_SOURCE_WHEEL = 0, ++ /** ++ * finger on a touch surface ++ */ ++ WL_POINTER_AXIS_SOURCE_FINGER = 1, ++ /** ++ * continuous coordinate space ++ */ ++ WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2, ++ /** ++ * a physical wheel tilt ++ * @since 6 ++ */ ++ WL_POINTER_AXIS_SOURCE_WHEEL_TILT = 3, ++}; ++/** ++ * @ingroup iface_wl_pointer ++ */ ++# define WL_POINTER_AXIS_SOURCE_WHEEL_TILT_SINCE_VERSION 6 ++#endif /* WL_POINTER_AXIS_SOURCE_ENUM */ ++ + /** + * @ingroup iface_wl_pointer + * @struct wl_pointer_listener + */ + struct moz_wl_pointer_listener { +@@ -538,10 +582,18 @@ + */ + void (*axis_relative_direction)(void* data, struct wl_pointer* wl_pointer, + uint32_t axis, uint32_t direction); + }; + ++#ifndef WL_POINTER_RELEASE_SINCE_VERSION ++# define WL_POINTER_RELEASE_SINCE_VERSION 3 ++#endif ++ ++#ifndef WL_POINTER_AXIS_VALUE120_SINCE_VERSION ++# define WL_POINTER_AXIS_VALUE120_SINCE_VERSION 8 ++#endif ++ + #ifdef __cplusplus + } + #endif + + #endif /* __MozWayland_h_ */ +diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp +--- a/widget/gtk/nsWaylandDisplay.cpp ++++ b/widget/gtk/nsWaylandDisplay.cpp +@@ -56,13 +56,12 @@ + return gWaylandDisplay; + } + + void nsWaylandDisplay::SetShm(wl_shm* aShm) { mShm = aShm; } + +-class TouchWindow { ++class WaylandPointerEvent { + public: +- already_AddRefed GetAndClearWindow() { return mWindow.forget(); } + RefPtr TakeWindow(wl_surface* aSurface) { + if (!aSurface) { + mWindow = nullptr; + } else { + GdkWindow* window = +@@ -71,33 +70,85 @@ + g_object_get_data(G_OBJECT(window), "nsWindow")) + : nullptr; + } + return mWindow; + } ++ already_AddRefed GetAndClearWindow() { return mWindow.forget(); } ++ RefPtr GetWindow() { return mWindow; } ++ ++ void SetSource(int32_t aSource) { mSource = aSource; } ++ ++ void SetDelta120(uint32_t aAxis, int32_t aDelta) { ++ switch (aAxis) { ++ case WL_POINTER_AXIS_VERTICAL_SCROLL: ++ mDeltaY = aDelta / 120.0f; ++ break; ++ case WL_POINTER_AXIS_HORIZONTAL_SCROLL: ++ mDeltaX = aDelta / 120.0f; ++ break; ++ default: ++ NS_WARNING("WaylandPointerEvent::SetDelta120(): wrong axis!"); ++ break; ++ } ++ } ++ ++ void SetTime(uint32_t aTime) { mTime = aTime; } ++ ++ void SendScrollEvent() { ++ if (!mWindow) { ++ return; ++ } ++ ++ // nsWindow::OnSmoothScrollEvent() may spin event loop so ++ // mWindow/mSource/delta may be replaced. ++ int32_t source = mSource; ++ float deltaX = mDeltaX; ++ float deltaY = mDeltaY; ++ ++ mSource = -1; ++ mDeltaX = mDeltaY = 0.0f; ++ ++ // We process wheel events only now. ++ if (source != WL_POINTER_AXIS_SOURCE_WHEEL) { ++ return; ++ } ++ ++ RefPtr win = mWindow; ++ uint32_t eventTime = mTime; ++ win->OnSmoothScrollEvent(eventTime, deltaX, deltaY); ++ } ++ ++ void Clear() { mWindow = nullptr; } ++ ++ WaylandPointerEvent() { Clear(); } + + private: + StaticRefPtr mWindow; ++ uint32_t mTime = 0; ++ int32_t mSource = 0; ++ float mDeltaX = 0; ++ float mDeltaY = 0; + }; + +-static TouchWindow sTouchWindow; ++static WaylandPointerEvent sHoldGesture; + + static void gesture_hold_begin(void* data, + struct zwp_pointer_gesture_hold_v1* hold, + uint32_t serial, uint32_t time, + struct wl_surface* surface, uint32_t fingers) { +- RefPtr window = sTouchWindow.TakeWindow(surface); ++ RefPtr window = sHoldGesture.TakeWindow(surface); + if (!window) { + return; + } + window->OnTouchpadHoldEvent(GDK_TOUCHPAD_GESTURE_PHASE_BEGIN, time, fingers); + } + + static void gesture_hold_end(void* data, + struct zwp_pointer_gesture_hold_v1* hold, + uint32_t serial, uint32_t time, + int32_t cancelled) { +- RefPtr window = sTouchWindow.GetAndClearWindow(); ++ RefPtr window = sHoldGesture.GetAndClearWindow(); + if (!window) { + return; + } + window->OnTouchpadHoldEvent(cancelled ? GDK_TOUCHPAD_GESTURE_PHASE_CANCEL + : GDK_TOUCHPAD_GESTURE_PHASE_END, +@@ -105,16 +156,22 @@ + } + + static const struct zwp_pointer_gesture_hold_v1_listener gesture_hold_listener = + {gesture_hold_begin, gesture_hold_end}; + ++static WaylandPointerEvent sScrollEvent; ++ + static void pointer_handle_enter(void* data, struct wl_pointer* pointer, + uint32_t serial, struct wl_surface* surface, +- wl_fixed_t sx, wl_fixed_t sy) {} ++ wl_fixed_t sx, wl_fixed_t sy) { ++ sScrollEvent.TakeWindow(surface); ++} + + static void pointer_handle_leave(void* data, struct wl_pointer* pointer, +- uint32_t serial, struct wl_surface* surface) {} ++ uint32_t serial, struct wl_surface* surface) { ++ sScrollEvent.Clear(); ++} + + static void pointer_handle_motion(void* data, struct wl_pointer* pointer, + uint32_t time, wl_fixed_t sx, wl_fixed_t sy) { + } + +@@ -122,26 +179,60 @@ + uint32_t serial, uint32_t time, + uint32_t button, uint32_t state) {} + + static void pointer_handle_axis(void* data, struct wl_pointer* pointer, + uint32_t time, uint32_t axis, +- wl_fixed_t value) {} ++ wl_fixed_t value) { ++ sScrollEvent.SetTime(time); ++} + +-static void pointer_handle_frame(void* data, struct wl_pointer* pointer) {} ++static void pointer_handle_frame(void* data, struct wl_pointer* pointer) { ++ sScrollEvent.SendScrollEvent(); ++} + + static void pointer_handle_axis_source( + void* data, struct wl_pointer* pointer, +- /*enum wl_pointer_axis_source */ uint32_t source) {} ++ /*enum wl_pointer_axis_source */ uint32_t source) { ++ sScrollEvent.SetSource(source); ++} + + static void pointer_handle_axis_stop(void* data, struct wl_pointer* pointer, + uint32_t time, uint32_t axis) {} + + static void pointer_handle_axis_discrete(void* data, struct wl_pointer* pointer, + uint32_t axis, int32_t value) {} + + static void pointer_handle_axis_value120(void* data, struct wl_pointer* pointer, +- uint32_t axis, int32_t value) {} ++ uint32_t axis, int32_t value) { ++ sScrollEvent.SetDelta120(axis, value); ++} ++ ++/* ++ * Example of scroll events we get for various devices. Note that ++ * even three different devices has the same wl_pointer. ++ * ++ * Standard mouse wheel: ++ * ++ * pointer_handle_axis_source pointer 0x7fd14fd4bac0 source 0 ++ * pointer_handle_axis_value120 pointer 0x7fd14fd4bac0 value 120 ++ * pointer_handle_axis pointer 0x7fd14fd4bac0 time 9470441 value 10.000000 ++ * pointer_handle_frame ++ * ++ * Hi-res mouse wheel: ++ * ++ * pointer_handle_axis_source pointer 0x7fd14fd4bac0 source 0 ++ * pointer_handle_axis_value120 pointer 0x7fd14fd4bac0 value -24 ++ * pointer_handle_axis pointer 0x7fd14fd4bac0 time 9593205 value -1.992188 ++ * pointer_handle_frame ++ * ++ * Touchpad: ++ * ++ * pointer_handle_axis_source pointer 0x7fd14fd4bac0 source 1 ++ * pointer_handle_axis pointer 0x7fd14fd4bac0 time 9431830 value 0.312500 ++ * pointer_handle_axis pointer 0x7fd14fd4bac0 time 9431830 value -1.015625 ++ * pointer_handle_frame ++ */ + + static const struct moz_wl_pointer_listener pointer_listener = { + pointer_handle_enter, pointer_handle_leave, + pointer_handle_motion, pointer_handle_button, + pointer_handle_axis, pointer_handle_frame, +@@ -363,12 +454,13 @@ + WaylandRegistryBind( + registry, id, &xdg_dbus_annotation_manager_v1_interface, 1); + display->SetXdgDbusAnnotationManager(annotationManager); + } else if (iface.EqualsLiteral("wl_seat") && + version >= WL_POINTER_RELEASE_SINCE_VERSION) { +- auto* seat = WaylandRegistryBind(registry, id, &wl_seat_interface, +- WL_POINTER_RELEASE_SINCE_VERSION); ++ auto* seat = WaylandRegistryBind( ++ registry, id, &wl_seat_interface, ++ MIN(version, WL_POINTER_AXIS_VALUE120_SINCE_VERSION)); + display->SetSeat(seat, id); + } else if (iface.EqualsLiteral("wp_fractional_scale_manager_v1")) { + auto* manager = WaylandRegistryBind( + registry, id, &wp_fractional_scale_manager_v1_interface, 1); + display->SetFractionalScaleManager(manager); +diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h +--- a/widget/gtk/nsWindow.h ++++ b/widget/gtk/nsWindow.h +@@ -256,10 +256,11 @@ + void OnContainerFocusOutEvent(GdkEventFocus* aEvent); + gboolean OnKeyPressEvent(GdkEventKey* aEvent); + gboolean OnKeyReleaseEvent(GdkEventKey* aEvent); + + void OnScrollEvent(GdkEventScroll* aEvent); ++ void OnSmoothScrollEvent(uint32_t aTime, float aDeltaX, float aDeltaY); + + void OnVisibilityNotifyEvent(GdkVisibilityState aState); + void OnWindowStateEvent(GtkWidget* aWidget, GdkEventWindowState* aEvent); + void OnDragDataReceivedEvent(GtkWidget* aWidget, GdkDragContext* aDragContext, + gint aX, gint aY, +@@ -900,18 +901,35 @@ + + // Next/Previous popups in Wayland popup hierarchy. + RefPtr mWaylandPopupNext; + RefPtr mWaylandPopupPrev; + ++ // When popup is resized by Gtk by move-to-rect callback, ++ // we store final popup size here. Then we use mMoveToRectPopupSize size ++ // in following popup operations unless mLayoutPopupSizeCleared is set. ++ LayoutDeviceIntSize mMoveToRectPopupSize; ++ + #ifdef MOZ_ENABLE_DBUS + RefPtr mDBusMenuBar; + #endif + +- // When popup is resized by Gtk by move-to-rect callback, +- // we store final popup size here. Then we use mMoveToRectPopupSize size +- // in following popup operations unless mLayoutPopupSizeCleared is set. +- LayoutDeviceIntSize mMoveToRectPopupSize; ++ struct LastMouseCoordinates { ++ template ++ void Set(Event* aEvent) { ++ mX = aEvent->x; ++ mY = aEvent->y; ++ mRootX = aEvent->x_root; ++ mRootY = aEvent->y_root; ++ } ++ ++ float mX = 0.0f, mY = 0.0f; ++ float mRootX = 0.0f, mRootY = 0.0f; ++ } mLastMouseCoordinates; ++ ++ // We don't want to fire scroll event with the same timestamp as ++ // smooth scroll event. ++ guint32 mLastSmoothScrollEventTime = GDK_CURRENT_TIME; + + /** + * |mIMContext| takes all IME related stuff. + * + * This is owned by the top-level nsWindow or the topmost child +diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp +--- a/widget/gtk/nsWindow.cpp ++++ b/widget/gtk/nsWindow.cpp +@@ -4152,10 +4152,11 @@ + } + + // Check before checking for ungrab as the button state may have + // changed while a non-Gecko ancestor window had a pointer grab. + DispatchMissedButtonReleases(aEvent); ++ mLastMouseCoordinates.Set(aEvent); + + WidgetMouseEvent event(true, eMouseEnterIntoWidget, this, + WidgetMouseEvent::eReal); + + event.mRefPoint = GdkEventCoordsToDevicePixels(aEvent->x, aEvent->y); +@@ -4373,10 +4374,12 @@ + newSize.height, mAspectRatio); + gtk_window_resize(GTK_WINDOW(mShell), newSize.width, newSize.height); + } + + void nsWindow::OnMotionNotifyEvent(GdkEventMotion* aEvent) { ++ mLastMouseCoordinates.Set(aEvent); ++ + if (!mGdkWindow) { + return; + } + + // Emulate gdk_window_begin_resize_drag() for windows +@@ -4625,10 +4628,11 @@ + + void nsWindow::OnButtonPressEvent(GdkEventButton* aEvent) { + LOG("Button %u press\n", aEvent->button); + + SetLastMousePressEvent((GdkEvent*)aEvent); ++ mLastMouseCoordinates.Set(aEvent); + + // If you double click in GDK, it will actually generate a second + // GDK_BUTTON_PRESS before sending the GDK_2BUTTON_PRESS, and this is + // different than the DOM spec. GDK puts this in the queue + // programatically, so it's safe to assume that if there's a +@@ -4762,10 +4766,11 @@ + + void nsWindow::OnButtonReleaseEvent(GdkEventButton* aEvent) { + LOG("Button %u release\n", aEvent->button); + + SetLastMousePressEvent(nullptr); ++ mLastMouseCoordinates.Set(aEvent); + + if (!mGdkWindow) { + return; + } + +@@ -4997,11 +5002,19 @@ + } + return TRUE; + } + + void nsWindow::OnScrollEvent(GdkEventScroll* aEvent) { +- LOG("OnScrollEvent"); ++ LOG("OnScrollEvent time %d", aEvent->time); ++ ++ mLastMouseCoordinates.Set(aEvent); ++ ++ // This event was already handled by OnSmoothScrollEvent(). ++ if (aEvent->time != GDK_CURRENT_TIME && ++ mLastSmoothScrollEventTime == aEvent->time) { ++ return; ++ } + + // check to see if we should rollup + if (CheckForRollup(aEvent->x_root, aEvent->y_root, true, false)) { + return; + } +@@ -5148,10 +5161,39 @@ + wheelEvent.AssignEventTime(GetWidgetEventTime(aEvent->time)); + + DispatchInputEvent(&wheelEvent); + } + ++void nsWindow::OnSmoothScrollEvent(uint32_t aTime, float aDeltaX, ++ float aDeltaY) { ++ LOG("OnSmoothScrollEvent time %d dX %f dY %f", aTime, aDeltaX, aDeltaY); ++ ++ // This event was already handled by OnSmoothScrollEvent(). ++ mLastSmoothScrollEventTime = aTime; ++ ++ if (CheckForRollup(mLastMouseCoordinates.mRootX, mLastMouseCoordinates.mRootY, ++ true, false)) { ++ return; ++ } ++ ++ WidgetWheelEvent wheelEvent(true, eWheel, this); ++ wheelEvent.mDeltaMode = dom::WheelEvent_Binding::DOM_DELTA_LINE; ++ // Use the same constant as nsWindow::OnScrollEvent(). ++ wheelEvent.mDeltaX = aDeltaX * 3; ++ wheelEvent.mDeltaY = aDeltaY * 3; ++ wheelEvent.mWheelTicksX = aDeltaX; ++ wheelEvent.mWheelTicksY = aDeltaY; ++ wheelEvent.mIsNoLineOrPageDelta = true; ++ wheelEvent.mRefPoint = GdkEventCoordsToDevicePixels(mLastMouseCoordinates.mX, ++ mLastMouseCoordinates.mY); ++ ++ KeymapWrapper::InitInputEvent(wheelEvent, ++ KeymapWrapper::GetCurrentModifierState()); ++ wheelEvent.AssignEventTime(GetWidgetEventTime(aTime)); ++ DispatchInputEvent(&wheelEvent); ++} ++ + void nsWindow::DispatchPanGesture(PanGestureInput& aPanInput) { + MOZ_ASSERT(NS_IsMainThread()); + + if (mSwipeTracker) { + // Give the swipe tracker a first pass at the event. If a new pan gesture + diff --git a/D223313.1729587212.diff b/D223313.1729587212.diff new file mode 100644 index 0000000..74fcb77 --- /dev/null +++ b/D223313.1729587212.diff @@ -0,0 +1,29 @@ +diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp +--- a/widget/gtk/nsWaylandDisplay.cpp ++++ b/widget/gtk/nsWaylandDisplay.cpp +@@ -60,15 +60,19 @@ + + class TouchWindow { + public: + already_AddRefed GetAndClearWindow() { return mWindow.forget(); } + RefPtr TakeWindow(wl_surface* aSurface) { +- GdkWindow* window = +- static_cast(wl_surface_get_user_data(aSurface)); +- mWindow = window ? static_cast( +- g_object_get_data(G_OBJECT(window), "nsWindow")) +- : nullptr; ++ if (!aSurface) { ++ mWindow = nullptr; ++ } else { ++ GdkWindow* window = ++ static_cast(wl_surface_get_user_data(aSurface)); ++ mWindow = window ? static_cast( ++ g_object_get_data(G_OBJECT(window), "nsWindow")) ++ : nullptr; ++ } + return mWindow; + } + + private: + StaticRefPtr mWindow; + diff --git a/D224842.1729586219.diff b/D224842.1729586219.diff new file mode 100644 index 0000000..30c76c0 --- /dev/null +++ b/D224842.1729586219.diff @@ -0,0 +1,48 @@ +diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp +--- a/widget/gtk/nsWaylandDisplay.cpp ++++ b/widget/gtk/nsWaylandDisplay.cpp +@@ -244,24 +244,34 @@ + pointer_handle_axis_source, pointer_handle_axis_stop, + pointer_handle_axis_discrete, pointer_handle_axis_value120, + }; + + void nsWaylandDisplay::SetPointer(wl_pointer* aPointer) { +- if (!mPointerGestures || wl_proxy_get_version((struct wl_proxy*)aPointer) < +- WL_POINTER_RELEASE_SINCE_VERSION) { ++ // Don't even try on such old interface ++ if (wl_proxy_get_version((struct wl_proxy*)aPointer) < ++ WL_POINTER_RELEASE_SINCE_VERSION) { + return; + } ++ + MOZ_DIAGNOSTIC_ASSERT(!mPointer); + mPointer = aPointer; +- wl_pointer_add_listener(mPointer, +- (const wl_pointer_listener*)&pointer_listener, this); ++ ++ // We're interested in pointer_handle_axis_value120() only for now. ++ if (wl_proxy_get_version((struct wl_proxy*)aPointer) >= ++ WL_POINTER_AXIS_VALUE120_SINCE_VERSION) { ++ wl_pointer_add_listener( ++ mPointer, (const wl_pointer_listener*)&pointer_listener, this); ++ } + +- mPointerGestureHold = +- zwp_pointer_gestures_v1_get_hold_gesture(mPointerGestures, mPointer); +- zwp_pointer_gesture_hold_v1_set_user_data(mPointerGestureHold, this); +- zwp_pointer_gesture_hold_v1_add_listener(mPointerGestureHold, +- &gesture_hold_listener, this); ++ // mPointerGestures is set by zwp_pointer_gestures_v1 if we have it. ++ if (mPointerGestures) { ++ mPointerGestureHold = ++ zwp_pointer_gestures_v1_get_hold_gesture(mPointerGestures, mPointer); ++ zwp_pointer_gesture_hold_v1_set_user_data(mPointerGestureHold, this); ++ zwp_pointer_gesture_hold_v1_add_listener(mPointerGestureHold, ++ &gesture_hold_listener, this); ++ } + } + + void nsWaylandDisplay::RemovePointer() { + wl_pointer_release(mPointer); + mPointer = nullptr; + diff --git a/D225439.1729586066.diff b/D225439.1729586066.diff new file mode 100644 index 0000000..212ee35 --- /dev/null +++ b/D225439.1729586066.diff @@ -0,0 +1,223 @@ +diff --git a/gfx/layers/apz/src/InputQueue.cpp b/gfx/layers/apz/src/InputQueue.cpp +--- a/gfx/layers/apz/src/InputQueue.cpp ++++ b/gfx/layers/apz/src/InputQueue.cpp +@@ -440,28 +440,33 @@ + APZEventResult InputQueue::ReceivePanGestureInput( + const RefPtr& aTarget, + TargetConfirmationFlags aFlags, const PanGestureInput& aEvent) { + APZEventResult result(aTarget, aFlags); + ++#ifndef MOZ_WIDGET_GTK + if (aEvent.mType == PanGestureInput::PANGESTURE_MAYSTART || + aEvent.mType == PanGestureInput::PANGESTURE_CANCELLED) { + // Ignore these events for now. + result.SetStatusAsConsumeDoDefault(aTarget); + return result; + } ++#endif + + if (aEvent.mType == PanGestureInput::PANGESTURE_INTERRUPTED) { + if (RefPtr block = mActivePanGestureBlock.get()) { + mQueuedInputs.AppendElement(MakeUnique(aEvent, *block)); + ProcessQueue(); + } + result.SetStatusAsIgnore(); + return result; + } + ++ bool startsNewBlock = aEvent.mType == PanGestureInput::PANGESTURE_MAYSTART || ++ aEvent.mType == PanGestureInput::PANGESTURE_START; ++ + RefPtr block; +- if (aEvent.mType != PanGestureInput::PANGESTURE_START) { ++ if (!startsNewBlock) { + block = mActivePanGestureBlock.get(); + } + + PanGestureInput event = aEvent; + +@@ -481,14 +486,14 @@ + // However, if there is a non-momentum event (indicating the user + // continued scrolling on the touchpad), a new input block is started + // by turning the event into a pan-start below. + return result; + } +- if (event.mType != PanGestureInput::PANGESTURE_START) { +- // Only PANGESTURE_START events are allowed to start a new pan gesture +- // block, but we really want to start a new block here, so we magically +- // turn this input into a PANGESTURE_START. ++ if (!startsNewBlock) { ++ // Only PANGESTURE_MAYSTART or PANGESTURE_START events are allowed to ++ // start a new pan gesture block, but we really want to start a new block ++ // here, so we magically turn this input into a PANGESTURE_START. + INPQ_LOG( + "transmogrifying pan input %d to PANGESTURE_START for new block\n", + event.mType); + event.mType = PanGestureInput::PANGESTURE_START; + } +diff --git a/gfx/layers/apz/test/gtest/TestPanning.cpp b/gfx/layers/apz/test/gtest/TestPanning.cpp +--- a/gfx/layers/apz/test/gtest/TestPanning.cpp ++++ b/gfx/layers/apz/test/gtest/TestPanning.cpp +@@ -78,10 +78,31 @@ + EXPECT_EQ(ParentLayerPoint(), pointOut); + EXPECT_EQ(AsyncTransform(), viewTransformOut); + + apzc->AssertStateIsReset(); + } ++ ++ void PanWithFling() { ++ // Send a pan gesture that triggers a fling animation at the end. ++ // Note that we need at least two _PAN events to have enough samples ++ // in the velocity tracker to compute a fling velocity. ++ PanGesture(PanGestureInput::PANGESTURE_START, apzc, ScreenIntPoint(50, 80), ++ ScreenPoint(0, 2), mcc->Time()); ++ mcc->AdvanceByMillis(5); ++ apzc->AdvanceAnimations(mcc->GetSampleTime()); ++ PanGesture(PanGestureInput::PANGESTURE_PAN, apzc, ScreenIntPoint(50, 80), ++ ScreenPoint(0, 10), mcc->Time()); ++ mcc->AdvanceByMillis(5); ++ apzc->AdvanceAnimations(mcc->GetSampleTime()); ++ PanGesture(PanGestureInput::PANGESTURE_PAN, apzc, ScreenIntPoint(50, 80), ++ ScreenPoint(0, 10), mcc->Time()); ++ mcc->AdvanceByMillis(5); ++ apzc->AdvanceAnimations(mcc->GetSampleTime()); ++ PanGesture(PanGestureInput::PANGESTURE_END, apzc, ScreenIntPoint(50, 80), ++ ScreenPoint(0, 0), mcc->Time(), MODIFIER_NONE, ++ /*aSimulateMomentum=*/true); ++ } + }; + + // In the each of the following 4 pan tests we are performing two pan gestures: + // vertical pan from top to bottom and back - from bottom to top. According to + // the pointer-events/touch-action spec AUTO and PAN_Y touch-action values allow +@@ -218,27 +239,11 @@ + EXPECT_NE(velocityFromPartialData, velocityFromFullDataViaHistory); + } + + TEST_F(APZCPanningTester, DuplicatePanEndEvents_Bug1833950) { + // Send a pan gesture that triggers a fling animation at the end. +- // Note that we need at least two _PAN events to have enough samples +- // in the velocity tracker to compute a fling velocity. +- PanGesture(PanGestureInput::PANGESTURE_START, apzc, ScreenIntPoint(50, 80), +- ScreenPoint(0, 2), mcc->Time()); +- mcc->AdvanceByMillis(5); +- apzc->AdvanceAnimations(mcc->GetSampleTime()); +- PanGesture(PanGestureInput::PANGESTURE_PAN, apzc, ScreenIntPoint(50, 80), +- ScreenPoint(0, 10), mcc->Time()); +- mcc->AdvanceByMillis(5); +- apzc->AdvanceAnimations(mcc->GetSampleTime()); +- PanGesture(PanGestureInput::PANGESTURE_PAN, apzc, ScreenIntPoint(50, 80), +- ScreenPoint(0, 10), mcc->Time()); +- mcc->AdvanceByMillis(5); +- apzc->AdvanceAnimations(mcc->GetSampleTime()); +- PanGesture(PanGestureInput::PANGESTURE_END, apzc, ScreenIntPoint(50, 80), +- ScreenPoint(0, 0), mcc->Time(), MODIFIER_NONE, +- /*aSimulateMomentum=*/true); ++ PanWithFling(); + + // Give the fling animation a chance to start. + SampleAnimationOnce(); + apzc->AssertStateIsFling(); + +@@ -247,5 +252,73 @@ + // trigger an assertion failure in debug mode. + PanGesture(PanGestureInput::PANGESTURE_END, apzc, ScreenIntPoint(50, 80), + ScreenPoint(0, 0), mcc->Time(), MODIFIER_NONE, + /*aSimulateMomentum=*/true); + } ++ ++#ifdef MOZ_WIDGET_GTK // Handling PANGESTURE_MAYSTART is Linux-only for now ++TEST_F(APZCPanningTester, HoldGesture_HoldAndRelease) { ++ // Send a pan gesture that triggers a fling animation at the end. ++ PanWithFling(); ++ ++ // Give the fling animation a chance to start. ++ SampleAnimationOnce(); ++ apzc->AssertStateIsFling(); ++ ++ // Send a PANGESTURE_MAYSTART event, signifying that the fingers went back ++ // down on the touchpad. ++ PanGesture(PanGestureInput::PANGESTURE_MAYSTART, apzc, ScreenIntPoint(50, 80), ++ ScreenPoint(0, 0), mcc->Time()); ++ ++ // This should have had the effect of cancelling the fling animation. ++ apzc->AssertStateIsReset(); ++ ++ // Send a PANGESTURE_CANCELLED event, signifying that the fingers have been ++ // lifted without any scrolling. This should have no effect on the gesture ++ // state. ++ mcc->AdvanceByMillis(5); ++ apzc->AdvanceAnimations(mcc->GetSampleTime()); ++ PanGesture(PanGestureInput::PANGESTURE_CANCELLED, apzc, ++ ScreenIntPoint(50, 80), ScreenPoint(0, 0), mcc->Time()); ++ apzc->AssertStateIsReset(); ++} ++ ++TEST_F(APZCPanningTester, HoldGesture_HoldAndScroll) { ++ // Send a pan gesture that triggers a fling animation at the end. ++ PanWithFling(); ++ ++ // Give the fling animation a chance to start. ++ SampleAnimationOnce(); ++ apzc->AssertStateIsFling(); ++ ++ // Record the scroll offset before the fingers go back. ++ float scrollYBefore = apzc->GetFrameMetrics().GetVisualScrollOffset().y; ++ EXPECT_GT(scrollYBefore, 0); ++ ++ // Send a PANGESTURE_MAYSTART event, signifying that the fingers went back ++ // down on the touchpad. ++ PanGesture(PanGestureInput::PANGESTURE_MAYSTART, apzc, ScreenIntPoint(50, 80), ++ ScreenPoint(0, 0), mcc->Time()); ++ ++ // This should have had the effect of cancelling the fling animation. ++ apzc->AssertStateIsReset(); ++ ++ // Do actual panning as part of the same gesture. ++ mcc->AdvanceByMillis(5); ++ apzc->AdvanceAnimations(mcc->GetSampleTime()); ++ PanGesture(PanGestureInput::PANGESTURE_START, apzc, ScreenIntPoint(50, 80), ++ ScreenPoint(0, 2), mcc->Time()); ++ mcc->AdvanceByMillis(5); ++ apzc->AdvanceAnimations(mcc->GetSampleTime()); ++ PanGesture(PanGestureInput::PANGESTURE_PAN, apzc, ScreenIntPoint(50, 80), ++ ScreenPoint(0, 10), mcc->Time()); ++ mcc->AdvanceByMillis(5); ++ apzc->AdvanceAnimations(mcc->GetSampleTime()); ++ PanGesture(PanGestureInput::PANGESTURE_END, apzc, ScreenIntPoint(50, 80), ++ ScreenPoint(0, 0), mcc->Time(), MODIFIER_NONE, ++ /*aSimulateMomentum=*/true); ++ ++ // Check that we've done additional scrolling. ++ float scrollYAfter = apzc->GetFrameMetrics().GetVisualScrollOffset().y; ++ EXPECT_GT(scrollYAfter, scrollYBefore); ++} ++#endif +diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp +--- a/widget/gtk/nsWindow.cpp ++++ b/widget/gtk/nsWindow.cpp +@@ -5587,10 +5587,23 @@ + } + + void nsWindow::OnTouchpadHoldEvent(GdkTouchpadGesturePhase aPhase, guint aTime, + uint32_t aFingers) { + LOG("OnTouchpadHoldEvent: aPhase %d aFingers %d", aPhase, aFingers); ++ MOZ_ASSERT(aPhase != ++ GDK_TOUCHPAD_GESTURE_PHASE_UPDATE); // not used for hold gestures ++ PanGestureInput::PanGestureType eventType = ++ (aPhase == GDK_TOUCHPAD_GESTURE_PHASE_BEGIN) ++ ? PanGestureInput::PANGESTURE_MAYSTART ++ : PanGestureInput::PANGESTURE_CANCELLED; ++ ScreenPoint touchPoint = ViewAs( ++ GdkEventCoordsToDevicePixels(mLastMouseCoordinates.mX, ++ mLastMouseCoordinates.mY), ++ PixelCastJustification::LayoutDeviceIsScreenForUntransformedEvent); ++ PanGestureInput panEvent(eventType, GetEventTimeStamp(aTime), touchPoint, ++ ScreenPoint(), 0); ++ DispatchPanGesture(panEvent); + } + + gboolean nsWindow::OnTouchEvent(GdkEventTouch* aEvent) { + LOG("OnTouchEvent: x=%f y=%f type=%d\n", aEvent->x, aEvent->y, aEvent->type); + if (!mHandleTouchEvent) { + diff --git a/D225760.1729586239.diff b/D225760.1729586239.diff new file mode 100644 index 0000000..50cc583 --- /dev/null +++ b/D225760.1729586239.diff @@ -0,0 +1,46 @@ +diff --git a/widget/gtk/nsGtkKeyUtils.cpp b/widget/gtk/nsGtkKeyUtils.cpp +--- a/widget/gtk/nsGtkKeyUtils.cpp ++++ b/widget/gtk/nsGtkKeyUtils.cpp +@@ -683,19 +683,27 @@ + } + + /* This keymap routine is derived from weston-2.0.0/clients/simple-im.c + */ + void KeymapWrapper::HandleKeymap(uint32_t format, int fd, uint32_t size) { ++ MOZ_LOG(gKeyLog, LogLevel::Info, ++ ("KeymapWrapper::HandleKeymap() format %d fd %d size %d", format, fd, ++ size)); + KeymapWrapper::ResetKeyboard(); + + if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) { ++ MOZ_LOG(gKeyLog, LogLevel::Info, ++ ("KeymapWrapper::HandleKeymap(): format is not " ++ "WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1!")); + close(fd); + return; + } + + char* mapString = (char*)mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); + if (mapString == MAP_FAILED) { ++ MOZ_LOG(gKeyLog, LogLevel::Info, ++ ("KeymapWrapper::HandleKeymap(): failed to allocate shm!")); + close(fd); + return; + } + + struct xkb_context* xkb_context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); +@@ -705,11 +713,12 @@ + + munmap(mapString, size); + close(fd); + + if (!keymap) { +- NS_WARNING("keyboard_handle_keymap(): Failed to compile keymap!\n"); ++ MOZ_LOG(gKeyLog, LogLevel::Info, ++ ("KeymapWrapper::HandleKeymap(): Failed to compile keymap!")); + return; + } + + KeymapWrapper::SetModifierMasks(keymap); + + diff --git a/D225868.1729586247.diff b/D225868.1729586247.diff new file mode 100644 index 0000000..8ab66b1 --- /dev/null +++ b/D225868.1729586247.diff @@ -0,0 +1,17 @@ +diff --git a/widget/gtk/nsGtkKeyUtils.cpp b/widget/gtk/nsGtkKeyUtils.cpp +--- a/widget/gtk/nsGtkKeyUtils.cpp ++++ b/widget/gtk/nsGtkKeyUtils.cpp +@@ -696,11 +696,11 @@ + "WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1!")); + close(fd); + return; + } + +- char* mapString = (char*)mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); ++ char* mapString = (char*)mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0); + if (mapString == MAP_FAILED) { + MOZ_LOG(gKeyLog, LogLevel::Info, + ("KeymapWrapper::HandleKeymap(): failed to allocate shm!")); + close(fd); + return; + diff --git a/firefox.spec b/firefox.spec index 5f48d75..bd87d9c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -6,11 +6,6 @@ # https://bugzilla.redhat.com/show_bug.cgi?id=2129720 ExcludeArch: i686 -# Disabled due to build failures -%if 0%{?fedora} < 40 -ExcludeArch: ppc64le -%endif - # Run Mozilla test suite as a part of compile rpm section. Turn off when # building locally and don't want to spend 24 hours waiting for results. %global run_firefox_tests 0 @@ -202,7 +197,7 @@ ExcludeArch: ppc64le Summary: Mozilla Firefox Web browser Name: firefox Version: 131.0.3 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -295,6 +290,18 @@ Patch424: D210430.1715848796.diff Patch425: D220671.patch Patch426: D224089.patch +Patch430: D220551.1729586452.diff +Patch431: D221617.1729589907.diff +Patch432: D221931.1729587190.diff +Patch433: D222280.1729587199.diff +Patch434: D222363.1729589473.diff +Patch435: D223313.1729587212.diff +Patch436: D223285.1729586039.diff +Patch437: D224842.1729586219.diff +Patch438: D225439.1729586066.diff +Patch439: D225760.1729586239.diff +Patch440: D225868.1729586247.diff + # PipeWire camera upstream patches # https://phabricator.services.mozilla.com/D219224 # Part of Firefox 131 @@ -618,6 +625,18 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch -P425 -p1 -b .D220671 %patch -P426 -p1 -b .D224089 +%patch -P430 -p1 -b .D220551 +%patch -P431 -p1 -b .D221617 +%patch -P432 -p1 -b .D221931 +%patch -P433 -p1 -b .D222280 +%patch -P434 -p1 -b .D222363 +%patch -P435 -p1 -b .D223285 +%patch -P436 -p1 -b .D223313 +%patch -P437 -p1 -b .D224842 +%patch -P438 -p1 -b .D225439 +%patch -P439 -p1 -b .D225760 +%patch -P440 -p1 -b .D225868 + %patch -P500 -p1 -b .filter-out-devices-with-no-capabilities %patch -P501 -p1 -b .always-query-information-about-camera-availability %patch -P502 -p1 -b .always-register-video-input-feedback-for-newly-created-deviceinfo @@ -1256,6 +1275,10 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Oct 21 2024 Martin Stransky - 131.0.3-2 +- Enabled ppc64le again +- Backported hi-res mouse scrolling and hold touchpad gesture support + * Tue Oct 15 2024 Martin Stransky - 131.0.3-1 - Updated to 131.0.3 From 2b368d7cdeb97edf06e603f8af6ce0013e93f1b0 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 21 Oct 2024 20:26:44 +0200 Subject: [PATCH 403/545] build fixes --- firefox.spec | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/firefox.spec b/firefox.spec index bd87d9c..38398de 100644 --- a/firefox.spec +++ b/firefox.spec @@ -6,6 +6,9 @@ # https://bugzilla.redhat.com/show_bug.cgi?id=2129720 ExcludeArch: i686 +# Disabled due to build failures +ExcludeArch: ppc64le + # Run Mozilla test suite as a part of compile rpm section. Turn off when # building locally and don't want to spend 24 hours waiting for results. %global run_firefox_tests 0 @@ -197,7 +200,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 131.0.3 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -625,6 +628,7 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch -P425 -p1 -b .D220671 %patch -P426 -p1 -b .D224089 +%if 0%{?fedora} > 40 %patch -P430 -p1 -b .D220551 %patch -P431 -p1 -b .D221617 %patch -P432 -p1 -b .D221931 @@ -636,6 +640,7 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch -P438 -p1 -b .D225439 %patch -P439 -p1 -b .D225760 %patch -P440 -p1 -b .D225868 +%endif %patch -P500 -p1 -b .filter-out-devices-with-no-capabilities %patch -P501 -p1 -b .always-query-information-about-camera-availability @@ -1275,9 +1280,9 @@ fi #--------------------------------------------------------------------- %changelog -* Mon Oct 21 2024 Martin Stransky - 131.0.3-2 -- Enabled ppc64le again -- Backported hi-res mouse scrolling and hold touchpad gesture support +* Mon Oct 21 2024 Martin Stransky - 131.0.3-3 +- Backported hi-res mouse scrolling and + hold touchpad gesture support for Fedora 41 * Tue Oct 15 2024 Martin Stransky - 131.0.3-1 - Updated to 131.0.3 From ecaeb2239ace56606b3ce1501670ef2069f3d6b2 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 23 Oct 2024 11:47:11 +0200 Subject: [PATCH 404/545] Updated to 132.0 --- D220551.1729586452.diff | 1908 --------------------------------------- D220671.patch | 270 ------ D221617.1729589907.diff | 123 --- D221931.1729587190.diff | 80 -- D222280.1729587199.diff | 65 -- D222363.1729589473.diff | 73 -- D223313.1729587212.diff | 29 - D224089.patch | 35 - firefox.spec | 52 +- rhbz-1173156.patch | 22 +- wasi.patch | 2 +- 11 files changed, 18 insertions(+), 2641 deletions(-) delete mode 100644 D220551.1729586452.diff delete mode 100644 D220671.patch delete mode 100644 D221617.1729589907.diff delete mode 100644 D221931.1729587190.diff delete mode 100644 D222280.1729587199.diff delete mode 100644 D222363.1729589473.diff delete mode 100644 D223313.1729587212.diff delete mode 100644 D224089.patch diff --git a/D220551.1729586452.diff b/D220551.1729586452.diff deleted file mode 100644 index 2d8c4e0..0000000 --- a/D220551.1729586452.diff +++ /dev/null @@ -1,1908 +0,0 @@ -diff --git a/widget/gtk/WidgetUtilsGtk.cpp b/widget/gtk/WidgetUtilsGtk.cpp ---- a/widget/gtk/WidgetUtilsGtk.cpp -+++ b/widget/gtk/WidgetUtilsGtk.cpp -@@ -303,11 +303,11 @@ - }; - #endif - - RefPtr RequestWaylandFocusPromise() { - #ifdef MOZ_WAYLAND -- if (!GdkIsWaylandDisplay() || !KeymapWrapper::GetSeat()) { -+ if (!GdkIsWaylandDisplay() || !WaylandDisplayGet()->GetSeat()) { - LOGW("RequestWaylandFocusPromise() failed."); - return nullptr; - } - - RefPtr sourceWindow = nsWindow::GetFocusedWindow(); -@@ -347,11 +347,11 @@ - xdg_activation_v1_get_activation_token(xdg_activation); - xdg_activation_token_v1_add_listener( - aXdgToken, &token_listener, - new XDGTokenRequest(aXdgToken, transferPromise)); - xdg_activation_token_v1_set_serial(aXdgToken, focusSerial, -- KeymapWrapper::GetSeat()); -+ WaylandDisplayGet()->GetSeat()); - xdg_activation_token_v1_set_surface(aXdgToken, focusSurface); - xdg_activation_token_v1_commit(aXdgToken); - - LOGW("RequestWaylandFocusPromise() XDG Token sent"); - -diff --git a/widget/gtk/mozwayland/mozwayland.h b/widget/gtk/mozwayland/mozwayland.h ---- a/widget/gtk/mozwayland/mozwayland.h -+++ b/widget/gtk/mozwayland/mozwayland.h -@@ -29,14 +29,22 @@ - struct wl_proxy* proxy, uint32_t opcode, - const struct wl_interface* interface, ...); - MOZ_EXPORT struct wl_proxy* wl_proxy_marshal_constructor_versioned( - struct wl_proxy* proxy, uint32_t opcode, - const struct wl_interface* interface, uint32_t version, ...); -+MOZ_EXPORT struct wl_proxy* wl_proxy_marshal_flags( -+ struct wl_proxy* proxy, uint32_t opcode, -+ const struct wl_interface* interface, uint32_t version, uint32_t flags, -+ ...); - MOZ_EXPORT void wl_proxy_destroy(struct wl_proxy* proxy); - MOZ_EXPORT void* wl_proxy_create_wrapper(void* proxy); - MOZ_EXPORT void wl_proxy_wrapper_destroy(void* proxy_wrapper); - -+#ifndef WL_MARSHAL_FLAG_DESTROY -+# define WL_MARSHAL_FLAG_DESTROY (1 << 0) -+#endif -+ - /* We need implement some missing functions from wayland-client-protocol.h - */ - #ifndef WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM - enum wl_data_device_manager_dnd_action { - WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE = 0, -@@ -125,10 +133,407 @@ - wl_proxy_marshal((struct wl_proxy*)wl_surface, WL_SURFACE_DAMAGE_BUFFER, x, y, - width, height); - } - #endif - -+#ifndef WL_POINTER_AXIS_ENUM -+# define WL_POINTER_AXIS_ENUM -+/** -+ * @ingroup iface_wl_pointer -+ * axis types -+ * -+ * Describes the axis types of scroll events. -+ */ -+enum wl_pointer_axis { -+ /** -+ * vertical axis -+ */ -+ WL_POINTER_AXIS_VERTICAL_SCROLL = 0, -+ /** -+ * horizontal axis -+ */ -+ WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1, -+}; -+#endif /* WL_POINTER_AXIS_ENUM */ -+ -+#ifndef WL_POINTER_AXIS_SOURCE_ENUM -+# define WL_POINTER_AXIS_SOURCE_ENUM -+/** -+ * @ingroup iface_wl_pointer -+ * axis source types -+ * -+ * Describes the source types for axis events. This indicates to the -+ * client how an axis event was physically generated; a client may -+ * adjust the user interface accordingly. For example, scroll events -+ * from a "finger" source may be in a smooth coordinate space with -+ * kinetic scrolling whereas a "wheel" source may be in discrete steps -+ * of a number of lines. -+ * -+ * The "continuous" axis source is a device generating events in a -+ * continuous coordinate space, but using something other than a -+ * finger. One example for this source is button-based scrolling where -+ * the vertical motion of a device is converted to scroll events while -+ * a button is held down. -+ * -+ * The "wheel tilt" axis source indicates that the actual device is a -+ * wheel but the scroll event is not caused by a rotation but a -+ * (usually sideways) tilt of the wheel. -+ */ -+enum wl_pointer_axis_source { -+ /** -+ * a physical wheel rotation -+ */ -+ WL_POINTER_AXIS_SOURCE_WHEEL = 0, -+ /** -+ * finger on a touch surface -+ */ -+ WL_POINTER_AXIS_SOURCE_FINGER = 1, -+ /** -+ * continuous coordinate space -+ */ -+ WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2, -+ /** -+ * a physical wheel tilt -+ * @since 6 -+ */ -+ WL_POINTER_AXIS_SOURCE_WHEEL_TILT = 3, -+}; -+/** -+ * @ingroup iface_wl_pointer -+ */ -+# define WL_POINTER_AXIS_SOURCE_WHEEL_TILT_SINCE_VERSION 6 -+#endif /* WL_POINTER_AXIS_SOURCE_ENUM */ -+ -+#ifndef WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM -+# define WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM -+/** -+ * @ingroup iface_wl_pointer -+ * axis relative direction -+ * -+ * This specifies the direction of the physical motion that caused a -+ * wl_pointer.axis event, relative to the wl_pointer.axis direction. -+ */ -+enum wl_pointer_axis_relative_direction { -+ /** -+ * physical motion matches axis direction -+ */ -+ WL_POINTER_AXIS_RELATIVE_DIRECTION_IDENTICAL = 0, -+ /** -+ * physical motion is the inverse of the axis direction -+ */ -+ WL_POINTER_AXIS_RELATIVE_DIRECTION_INVERTED = 1, -+}; -+#endif /* WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM */ -+ -+/** -+ * @ingroup iface_wl_pointer -+ * @struct wl_pointer_listener -+ */ -+struct moz_wl_pointer_listener { -+ /** -+ * enter event -+ * -+ * Notification that this seat's pointer is focused on a certain -+ * surface. -+ * -+ * When a seat's focus enters a surface, the pointer image is -+ * undefined and a client should respond to this event by setting -+ * an appropriate pointer image with the set_cursor request. -+ * @param serial serial number of the enter event -+ * @param surface surface entered by the pointer -+ * @param surface_x surface-local x coordinate -+ * @param surface_y surface-local y coordinate -+ */ -+ void (*enter)(void* data, struct wl_pointer* wl_pointer, uint32_t serial, -+ struct wl_surface* surface, wl_fixed_t surface_x, -+ wl_fixed_t surface_y); -+ /** -+ * leave event -+ * -+ * Notification that this seat's pointer is no longer focused on -+ * a certain surface. -+ * -+ * The leave notification is sent before the enter notification for -+ * the new focus. -+ * @param serial serial number of the leave event -+ * @param surface surface left by the pointer -+ */ -+ void (*leave)(void* data, struct wl_pointer* wl_pointer, uint32_t serial, -+ struct wl_surface* surface); -+ /** -+ * pointer motion event -+ * -+ * Notification of pointer location change. The arguments -+ * surface_x and surface_y are the location relative to the focused -+ * surface. -+ * @param time timestamp with millisecond granularity -+ * @param surface_x surface-local x coordinate -+ * @param surface_y surface-local y coordinate -+ */ -+ void (*motion)(void* data, struct wl_pointer* wl_pointer, uint32_t time, -+ wl_fixed_t surface_x, wl_fixed_t surface_y); -+ /** -+ * pointer button event -+ * -+ * Mouse button click and release notifications. -+ * -+ * The location of the click is given by the last motion or enter -+ * event. The time argument is a timestamp with millisecond -+ * granularity, with an undefined base. -+ * -+ * The button is a button code as defined in the Linux kernel's -+ * linux/input-event-codes.h header file, e.g. BTN_LEFT. -+ * -+ * Any 16-bit button code value is reserved for future additions to -+ * the kernel's event code list. All other button codes above -+ * 0xFFFF are currently undefined but may be used in future -+ * versions of this protocol. -+ * @param serial serial number of the button event -+ * @param time timestamp with millisecond granularity -+ * @param button button that produced the event -+ * @param state physical state of the button -+ */ -+ void (*button)(void* data, struct wl_pointer* wl_pointer, uint32_t serial, -+ uint32_t time, uint32_t button, uint32_t state); -+ /** -+ * axis event -+ * -+ * Scroll and other axis notifications. -+ * -+ * For scroll events (vertical and horizontal scroll axes), the -+ * value parameter is the length of a vector along the specified -+ * axis in a coordinate space identical to those of motion events, -+ * representing a relative movement along the specified axis. -+ * -+ * For devices that support movements non-parallel to axes multiple -+ * axis events will be emitted. -+ * -+ * When applicable, for example for touch pads, the server can -+ * choose to emit scroll events where the motion vector is -+ * equivalent to a motion event vector. -+ * -+ * When applicable, a client can transform its content relative to -+ * the scroll distance. -+ * @param time timestamp with millisecond granularity -+ * @param axis axis type -+ * @param value length of vector in surface-local coordinate space -+ */ -+ void (*axis)(void* data, struct wl_pointer* wl_pointer, uint32_t time, -+ uint32_t axis, wl_fixed_t value); -+ /** -+ * end of a pointer event sequence -+ * -+ * Indicates the end of a set of events that logically belong -+ * together. A client is expected to accumulate the data in all -+ * events within the frame before proceeding. -+ * -+ * All wl_pointer events before a wl_pointer.frame event belong -+ * logically together. For example, in a diagonal scroll motion the -+ * compositor will send an optional wl_pointer.axis_source event, -+ * two wl_pointer.axis events (horizontal and vertical) and finally -+ * a wl_pointer.frame event. The client may use this information to -+ * calculate a diagonal vector for scrolling. -+ * -+ * When multiple wl_pointer.axis events occur within the same -+ * frame, the motion vector is the combined motion of all events. -+ * When a wl_pointer.axis and a wl_pointer.axis_stop event occur -+ * within the same frame, this indicates that axis movement in one -+ * axis has stopped but continues in the other axis. When multiple -+ * wl_pointer.axis_stop events occur within the same frame, this -+ * indicates that these axes stopped in the same instance. -+ * -+ * A wl_pointer.frame event is sent for every logical event group, -+ * even if the group only contains a single wl_pointer event. -+ * Specifically, a client may get a sequence: motion, frame, -+ * button, frame, axis, frame, axis_stop, frame. -+ * -+ * The wl_pointer.enter and wl_pointer.leave events are logical -+ * events generated by the compositor and not the hardware. These -+ * events are also grouped by a wl_pointer.frame. When a pointer -+ * moves from one surface to another, a compositor should group the -+ * wl_pointer.leave event within the same wl_pointer.frame. -+ * However, a client must not rely on wl_pointer.leave and -+ * wl_pointer.enter being in the same wl_pointer.frame. -+ * Compositor-specific policies may require the wl_pointer.leave -+ * and wl_pointer.enter event being split across multiple -+ * wl_pointer.frame groups. -+ * @since 5 -+ */ -+ void (*frame)(void* data, struct wl_pointer* wl_pointer); -+ /** -+ * axis source event -+ * -+ * Source information for scroll and other axes. -+ * -+ * This event does not occur on its own. It is sent before a -+ * wl_pointer.frame event and carries the source information for -+ * all events within that frame. -+ * -+ * The source specifies how this event was generated. If the source -+ * is wl_pointer.axis_source.finger, a wl_pointer.axis_stop event -+ * will be sent when the user lifts the finger off the device. -+ * -+ * If the source is wl_pointer.axis_source.wheel, -+ * wl_pointer.axis_source.wheel_tilt or -+ * wl_pointer.axis_source.continuous, a wl_pointer.axis_stop event -+ * may or may not be sent. Whether a compositor sends an axis_stop -+ * event for these sources is hardware-specific and -+ * implementation-dependent; clients must not rely on receiving an -+ * axis_stop event for these scroll sources and should treat scroll -+ * sequences from these scroll sources as unterminated by default. -+ * -+ * This event is optional. If the source is unknown for a -+ * particular axis event sequence, no event is sent. Only one -+ * wl_pointer.axis_source event is permitted per frame. -+ * -+ * The order of wl_pointer.axis_discrete and wl_pointer.axis_source -+ * is not guaranteed. -+ * @param axis_source source of the axis event -+ * @since 5 -+ */ -+ void (*axis_source)(void* data, struct wl_pointer* wl_pointer, -+ uint32_t axis_source); -+ /** -+ * axis stop event -+ * -+ * Stop notification for scroll and other axes. -+ * -+ * For some wl_pointer.axis_source types, a wl_pointer.axis_stop -+ * event is sent to notify a client that the axis sequence has -+ * terminated. This enables the client to implement kinetic -+ * scrolling. See the wl_pointer.axis_source documentation for -+ * information on when this event may be generated. -+ * -+ * Any wl_pointer.axis events with the same axis_source after this -+ * event should be considered as the start of a new axis motion. -+ * -+ * The timestamp is to be interpreted identical to the timestamp in -+ * the wl_pointer.axis event. The timestamp value may be the same -+ * as a preceding wl_pointer.axis event. -+ * @param time timestamp with millisecond granularity -+ * @param axis the axis stopped with this event -+ * @since 5 -+ */ -+ void (*axis_stop)(void* data, struct wl_pointer* wl_pointer, uint32_t time, -+ uint32_t axis); -+ /** -+ * axis click event -+ * -+ * Discrete step information for scroll and other axes. -+ * -+ * This event carries the axis value of the wl_pointer.axis event -+ * in discrete steps (e.g. mouse wheel clicks). -+ * -+ * This event is deprecated with wl_pointer version 8 - this event -+ * is not sent to clients supporting version 8 or later. -+ * -+ * This event does not occur on its own, it is coupled with a -+ * wl_pointer.axis event that represents this axis value on a -+ * continuous scale. The protocol guarantees that each -+ * axis_discrete event is always followed by exactly one axis event -+ * with the same axis number within the same wl_pointer.frame. Note -+ * that the protocol allows for other events to occur between the -+ * axis_discrete and its coupled axis event, including other -+ * axis_discrete or axis events. A wl_pointer.frame must not -+ * contain more than one axis_discrete event per axis type. -+ * -+ * This event is optional; continuous scrolling devices like -+ * two-finger scrolling on touchpads do not have discrete steps and -+ * do not generate this event. -+ * -+ * The discrete value carries the directional information. e.g. a -+ * value of -2 is two steps towards the negative direction of this -+ * axis. -+ * -+ * The axis number is identical to the axis number in the -+ * associated axis event. -+ * -+ * The order of wl_pointer.axis_discrete and wl_pointer.axis_source -+ * is not guaranteed. -+ * @param axis axis type -+ * @param discrete number of steps -+ * @since 5 -+ * @deprecated Deprecated since version 8 -+ */ -+ void (*axis_discrete)(void* data, struct wl_pointer* wl_pointer, -+ uint32_t axis, int32_t discrete); -+ /** -+ * axis high-resolution scroll event -+ * -+ * Discrete high-resolution scroll information. -+ * -+ * This event carries high-resolution wheel scroll information, -+ * with each multiple of 120 representing one logical scroll step -+ * (a wheel detent). For example, an axis_value120 of 30 is one -+ * quarter of a logical scroll step in the positive direction, a -+ * value120 of -240 are two logical scroll steps in the negative -+ * direction within the same hardware event. Clients that rely on -+ * discrete scrolling should accumulate the value120 to multiples -+ * of 120 before processing the event. -+ * -+ * The value120 must not be zero. -+ * -+ * This event replaces the wl_pointer.axis_discrete event in -+ * clients supporting wl_pointer version 8 or later. -+ * -+ * Where a wl_pointer.axis_source event occurs in the same -+ * wl_pointer.frame, the axis source applies to this event. -+ * -+ * The order of wl_pointer.axis_value120 and wl_pointer.axis_source -+ * is not guaranteed. -+ * @param axis axis type -+ * @param value120 scroll distance as fraction of 120 -+ * @since 8 -+ */ -+ void (*axis_value120)(void* data, struct wl_pointer* wl_pointer, -+ uint32_t axis, int32_t value120); -+ /** -+ * axis relative physical direction event -+ * -+ * Relative directional information of the entity causing the -+ * axis motion. -+ * -+ * For a wl_pointer.axis event, the -+ * wl_pointer.axis_relative_direction event specifies the movement -+ * direction of the entity causing the wl_pointer.axis event. For -+ * example: - if a user's fingers on a touchpad move down and this -+ * causes a wl_pointer.axis vertical_scroll down event, the -+ * physical direction is 'identical' - if a user's fingers on a -+ * touchpad move down and this causes a wl_pointer.axis -+ * vertical_scroll up scroll up event ('natural scrolling'), the -+ * physical direction is 'inverted'. -+ * -+ * A client may use this information to adjust scroll motion of -+ * components. Specifically, enabling natural scrolling causes the -+ * content to change direction compared to traditional scrolling. -+ * Some widgets like volume control sliders should usually match -+ * the physical direction regardless of whether natural scrolling -+ * is active. This event enables clients to match the scroll -+ * direction of a widget to the physical direction. -+ * -+ * This event does not occur on its own, it is coupled with a -+ * wl_pointer.axis event that represents this axis value. The -+ * protocol guarantees that each axis_relative_direction event is -+ * always followed by exactly one axis event with the same axis -+ * number within the same wl_pointer.frame. Note that the protocol -+ * allows for other events to occur between the -+ * axis_relative_direction and its coupled axis event. -+ * -+ * The axis number is identical to the axis number in the -+ * associated axis event. -+ * -+ * The order of wl_pointer.axis_relative_direction, -+ * wl_pointer.axis_discrete and wl_pointer.axis_source is not -+ * guaranteed. -+ * @param axis axis type -+ * @param direction physical direction relative to axis motion -+ * @since 9 -+ */ -+ void (*axis_relative_direction)(void* data, struct wl_pointer* wl_pointer, -+ uint32_t axis, uint32_t direction); -+}; -+ - #ifdef __cplusplus - } - #endif - - #endif /* __MozWayland_h_ */ -diff --git a/widget/gtk/nsGtkKeyUtils.h b/widget/gtk/nsGtkKeyUtils.h ---- a/widget/gtk/nsGtkKeyUtils.h -+++ b/widget/gtk/nsGtkKeyUtils.h -@@ -196,22 +196,19 @@ - /** - * Utility function to set all supported modifier masks - * from xkb_keymap. We call that from Wayland backend routines. - */ - static void SetModifierMasks(xkb_keymap* aKeymap); -+ static void HandleKeymap(uint32_t format, int fd, uint32_t size); - - /** - * Wayland global focus handlers - */ - static void SetFocusIn(wl_surface* aFocusSurface, uint32_t aFocusSerial); - static void SetFocusOut(wl_surface* aFocusSurface); - static void GetFocusInfo(wl_surface** aFocusSurface, uint32_t* aFocusSerial); - -- static void SetSeat(wl_seat* aSeat, int aId); -- static void ClearSeat(int aId); -- static wl_seat* GetSeat(); -- - static void SetKeyboard(wl_keyboard* aKeyboard); - static wl_keyboard* GetKeyboard(); - static void ClearKeyboard(); - - /** -@@ -495,13 +492,10 @@ - void SetModifierMask(xkb_keymap* aKeymap, ModifierIndex aModifierIndex, - const char* aModifierName); - #endif - - #ifdef MOZ_WAYLAND -- static wl_seat* sSeat; -- static int sSeatID; -- static wl_keyboard* sKeyboard; - wl_surface* mFocusSurface = nullptr; - uint32_t mFocusSerial = 0; - #endif - }; - -diff --git a/widget/gtk/nsGtkKeyUtils.cpp b/widget/gtk/nsGtkKeyUtils.cpp ---- a/widget/gtk/nsGtkKeyUtils.cpp -+++ b/widget/gtk/nsGtkKeyUtils.cpp -@@ -63,16 +63,10 @@ - Time KeymapWrapper::sLastRepeatableKeyTime = 0; - #endif - KeymapWrapper::RepeatState KeymapWrapper::sRepeatState = - KeymapWrapper::NOT_PRESSED; - --#ifdef MOZ_WAYLAND --wl_seat* KeymapWrapper::sSeat = nullptr; --int KeymapWrapper::sSeatID = -1; --wl_keyboard* KeymapWrapper::sKeyboard = nullptr; --#endif -- - static const char* GetBoolName(bool aBool) { return aBool ? "TRUE" : "FALSE"; } - - static const char* GetStatusName(nsEventStatus aStatus) { - switch (aStatus) { - case nsEventStatus_eConsumeDoDefault: -@@ -688,12 +682,11 @@ - keymapWrapper->GetGdkModifierMask(HYPER))); - } - - /* This keymap routine is derived from weston-2.0.0/clients/simple-im.c - */ --static void keyboard_handle_keymap(void* data, struct wl_keyboard* wl_keyboard, -- uint32_t format, int fd, uint32_t size) { -+void KeymapWrapper::HandleKeymap(uint32_t format, int fd, uint32_t size) { - KeymapWrapper::ResetKeyboard(); - - if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) { - close(fd); - return; -@@ -722,54 +715,10 @@ - - xkb_keymap_unref(keymap); - - xkb_context_unref(xkb_context); - } -- --static void keyboard_handle_enter(void* data, struct wl_keyboard* keyboard, -- uint32_t serial, struct wl_surface* surface, -- struct wl_array* keys) { -- KeymapWrapper::SetFocusIn(surface, serial); --} -- --static void keyboard_handle_leave(void* data, struct wl_keyboard* keyboard, -- uint32_t serial, struct wl_surface* surface) { -- KeymapWrapper::SetFocusOut(surface); --} -- --static void keyboard_handle_key(void* data, struct wl_keyboard* keyboard, -- uint32_t serial, uint32_t time, uint32_t key, -- uint32_t state) {} --static void keyboard_handle_modifiers(void* data, struct wl_keyboard* keyboard, -- uint32_t serial, uint32_t mods_depressed, -- uint32_t mods_latched, -- uint32_t mods_locked, uint32_t group) {} --static void keyboard_handle_repeat_info(void* data, -- struct wl_keyboard* keyboard, -- int32_t rate, int32_t delay) {} -- --static const struct wl_keyboard_listener keyboard_listener = { -- keyboard_handle_keymap, keyboard_handle_enter, -- keyboard_handle_leave, keyboard_handle_key, -- keyboard_handle_modifiers, keyboard_handle_repeat_info}; -- --static void seat_handle_capabilities(void* data, struct wl_seat* seat, -- unsigned int caps) { -- wl_keyboard* keyboard = KeymapWrapper::GetKeyboard(); -- if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !keyboard) { -- keyboard = wl_seat_get_keyboard(seat); -- wl_keyboard_add_listener(keyboard, &keyboard_listener, nullptr); -- KeymapWrapper::SetKeyboard(keyboard); -- } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && keyboard) { -- KeymapWrapper::ClearKeyboard(); -- } --} -- --static const struct wl_seat_listener seat_listener = { -- seat_handle_capabilities, --}; -- - #endif - - KeymapWrapper::~KeymapWrapper() { - #ifdef MOZ_X11 - gdk_window_remove_filter(nullptr, FilterEvents, this); -@@ -2694,38 +2643,9 @@ - uint32_t* aFocusSerial) { - KeymapWrapper* keymapWrapper = KeymapWrapper::GetInstance(); - *aFocusSurface = keymapWrapper->mFocusSurface; - *aFocusSerial = keymapWrapper->mFocusSerial; - } -- --void KeymapWrapper::SetSeat(wl_seat* aSeat, int aId) { -- sSeat = aSeat; -- sSeatID = aId; -- wl_seat_add_listener(aSeat, &seat_listener, nullptr); --} -- --void KeymapWrapper::ClearSeat(int aId) { -- if (sSeatID == aId) { -- ClearKeyboard(); -- sSeat = nullptr; -- sSeatID = -1; -- } --} -- --wl_seat* KeymapWrapper::GetSeat() { return sSeat; } -- --void KeymapWrapper::SetKeyboard(wl_keyboard* aKeyboard) { -- sKeyboard = aKeyboard; --} -- --wl_keyboard* KeymapWrapper::GetKeyboard() { return sKeyboard; } -- --void KeymapWrapper::ClearKeyboard() { -- if (sKeyboard) { -- wl_keyboard_destroy(sKeyboard); -- sKeyboard = nullptr; -- } --} - #endif - - } // namespace widget - } // namespace mozilla -diff --git a/widget/gtk/nsWaylandDisplay.h b/widget/gtk/nsWaylandDisplay.h ---- a/widget/gtk/nsWaylandDisplay.h -+++ b/widget/gtk/nsWaylandDisplay.h -@@ -14,10 +14,11 @@ - #include "mozilla/widget/gbm.h" - #include "mozilla/widget/fractional-scale-v1-client-protocol.h" - #include "mozilla/widget/idle-inhibit-unstable-v1-client-protocol.h" - #include "mozilla/widget/relative-pointer-unstable-v1-client-protocol.h" - #include "mozilla/widget/pointer-constraints-unstable-v1-client-protocol.h" -+#include "mozilla/widget/pointer-gestures-unstable-v1-client-protocol.h" - #include "mozilla/widget/linux-dmabuf-unstable-v1-client-protocol.h" - #include "mozilla/widget/viewporter-client-protocol.h" - #include "mozilla/widget/xdg-activation-v1-client-protocol.h" - #include "mozilla/widget/xdg-dbus-annotation-v1-client-protocol.h" - #include "mozilla/widget/xdg-output-unstable-v1-client-protocol.h" -@@ -55,19 +56,33 @@ - wp_fractional_scale_manager_v1* GetFractionalScaleManager() { - return mFractionalScaleManager; - } - bool IsPrimarySelectionEnabled() { return mIsPrimarySelectionEnabled; } - -+ wl_pointer* GetPointer() { return mPointer; } -+ void SetPointer(wl_pointer* aPointer); -+ void RemovePointer(); -+ - void SetShm(wl_shm* aShm); -+ -+ void SetKeyboard(wl_keyboard* aKeyboard); -+ wl_keyboard* GetKeyboard() { return mKeyboard; } -+ void ClearKeyboard(); -+ -+ void SetSeat(wl_seat* aSeat, int aSeatId); -+ wl_seat* GetSeat() { return mSeat; } -+ void RemoveSeat(int aSeatId); -+ - void SetCompositor(wl_compositor* aCompositor); - void SetSubcompositor(wl_subcompositor* aSubcompositor); - void SetDataDeviceManager(wl_data_device_manager* aDataDeviceManager); - void SetIdleInhibitManager(zwp_idle_inhibit_manager_v1* aIdleInhibitManager); - void SetViewporter(wp_viewporter* aViewporter); - void SetRelativePointerManager( - zwp_relative_pointer_manager_v1* aRelativePointerManager); - void SetPointerConstraints(zwp_pointer_constraints_v1* aPointerConstraints); -+ void SetPointerGestures(zwp_pointer_gestures_v1* aPointerGestures); - void SetDmabuf(zwp_linux_dmabuf_v1* aDmabuf); - void SetXdgActivation(xdg_activation_v1* aXdgActivation); - void SetXdgDbusAnnotationManager( - xdg_dbus_annotation_manager_v1* aXdgDbusAnnotationManager); - void SetFractionalScaleManager(wp_fractional_scale_manager_v1* aManager) { -@@ -82,13 +97,19 @@ - wl_registry* mRegistry = nullptr; - wl_display* mDisplay = nullptr; - wl_compositor* mCompositor = nullptr; - wl_subcompositor* mSubcompositor = nullptr; - wl_shm* mShm = nullptr; -+ wl_seat* mSeat = nullptr; -+ int mSeatId = -1; -+ wl_keyboard* mKeyboard = nullptr; -+ wl_pointer* mPointer = nullptr; - zwp_idle_inhibit_manager_v1* mIdleInhibitManager = nullptr; - zwp_relative_pointer_manager_v1* mRelativePointerManager = nullptr; - zwp_pointer_constraints_v1* mPointerConstraints = nullptr; -+ zwp_pointer_gestures_v1* mPointerGestures = nullptr; -+ zwp_pointer_gesture_hold_v1* mPointerGestureHold = nullptr; - wp_viewporter* mViewporter = nullptr; - zwp_linux_dmabuf_v1* mDmabuf = nullptr; - xdg_activation_v1* mXdgActivation = nullptr; - xdg_dbus_annotation_manager_v1* mXdgDbusAnnotationManager = nullptr; - wp_fractional_scale_manager_v1* mFractionalScaleManager = nullptr; -diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp ---- a/widget/gtk/nsWaylandDisplay.cpp -+++ b/widget/gtk/nsWaylandDisplay.cpp -@@ -17,10 +17,11 @@ - #include "mozilla/ThreadLocal.h" - #include "mozilla/StaticPrefs_widget.h" - #include "mozilla/Sprintf.h" - #include "WidgetUtilsGtk.h" - #include "nsGtkKeyUtils.h" -+#include "nsWindow.h" - - namespace mozilla::widget { - - static nsWaylandDisplay* gWaylandDisplay; - -@@ -55,10 +56,202 @@ - return gWaylandDisplay; - } - - void nsWaylandDisplay::SetShm(wl_shm* aShm) { mShm = aShm; } - -+struct PointerState { -+ wl_surface* surface; -+ -+ nsWindow* GetWindow() { -+ GdkWindow* window = -+ static_cast(wl_surface_get_user_data(surface)); -+ return window ? static_cast( -+ g_object_get_data(G_OBJECT(window), "nsWindow")) -+ : nullptr; -+ } -+} sPointerState; -+ -+static void gesture_hold_begin(void* data, -+ struct zwp_pointer_gesture_hold_v1* hold, -+ uint32_t serial, uint32_t time, -+ struct wl_surface* surface, uint32_t fingers) { -+ RefPtr window = sPointerState.GetWindow(); -+ if (!window) { -+ return; -+ } -+ window->OnTouchpadHoldEvent(GDK_TOUCHPAD_GESTURE_PHASE_BEGIN, time, fingers); -+} -+ -+static void gesture_hold_end(void* data, -+ struct zwp_pointer_gesture_hold_v1* hold, -+ uint32_t serial, uint32_t time, -+ int32_t cancelled) { -+ RefPtr window = sPointerState.GetWindow(); -+ if (!window) { -+ return; -+ } -+ window->OnTouchpadHoldEvent(cancelled ? GDK_TOUCHPAD_GESTURE_PHASE_CANCEL -+ : GDK_TOUCHPAD_GESTURE_PHASE_END, -+ time, 0); -+} -+ -+static const struct zwp_pointer_gesture_hold_v1_listener gesture_hold_listener = -+ {gesture_hold_begin, gesture_hold_end}; -+ -+static void pointer_handle_enter(void* data, struct wl_pointer* pointer, -+ uint32_t serial, struct wl_surface* surface, -+ wl_fixed_t sx, wl_fixed_t sy) { -+ sPointerState.surface = surface; -+} -+ -+static void pointer_handle_leave(void* data, struct wl_pointer* pointer, -+ uint32_t serial, struct wl_surface* surface) { -+ sPointerState.surface = nullptr; -+} -+ -+static void pointer_handle_motion(void* data, struct wl_pointer* pointer, -+ uint32_t time, wl_fixed_t sx, wl_fixed_t sy) { -+} -+ -+static void pointer_handle_button(void* data, struct wl_pointer* pointer, -+ uint32_t serial, uint32_t time, -+ uint32_t button, uint32_t state) {} -+ -+static void pointer_handle_axis(void* data, struct wl_pointer* pointer, -+ uint32_t time, uint32_t axis, -+ wl_fixed_t value) {} -+ -+static void pointer_handle_frame(void* data, struct wl_pointer* pointer) {} -+ -+static void pointer_handle_axis_source( -+ void* data, struct wl_pointer* pointer, -+ /*enum wl_pointer_axis_source */ uint32_t source) {} -+ -+static void pointer_handle_axis_stop(void* data, struct wl_pointer* pointer, -+ uint32_t time, uint32_t axis) {} -+ -+static void pointer_handle_axis_discrete(void* data, struct wl_pointer* pointer, -+ uint32_t axis, int32_t value) {} -+ -+static void pointer_handle_axis_value120(void* data, struct wl_pointer* pointer, -+ uint32_t axis, int32_t value) {} -+ -+static const struct moz_wl_pointer_listener pointer_listener = { -+ pointer_handle_enter, pointer_handle_leave, -+ pointer_handle_motion, pointer_handle_button, -+ pointer_handle_axis, pointer_handle_frame, -+ pointer_handle_axis_source, pointer_handle_axis_stop, -+ pointer_handle_axis_discrete, pointer_handle_axis_value120, -+}; -+ -+void nsWaylandDisplay::SetPointer(wl_pointer* aPointer) { -+ if (!mPointerGestures) { -+ return; -+ } -+ MOZ_DIAGNOSTIC_ASSERT(!mPointer); -+ mPointer = aPointer; -+ wl_pointer_add_listener(mPointer, -+ (const wl_pointer_listener*)&pointer_listener, this); -+ -+ mPointerGestureHold = -+ zwp_pointer_gestures_v1_get_hold_gesture(mPointerGestures, mPointer); -+ zwp_pointer_gesture_hold_v1_set_user_data(mPointerGestureHold, this); -+ zwp_pointer_gesture_hold_v1_add_listener(mPointerGestureHold, -+ &gesture_hold_listener, this); -+} -+ -+void nsWaylandDisplay::RemovePointer() { -+ wl_pointer_release(mPointer); -+ mPointer = nullptr; -+} -+ -+static void seat_handle_capabilities(void* data, struct wl_seat* seat, -+ unsigned int caps) { -+ auto* display = static_cast(data); -+ if (!display) { -+ return; -+ } -+ -+ if ((caps & WL_SEAT_CAPABILITY_POINTER) && !display->GetPointer()) { -+ display->SetPointer(wl_seat_get_pointer(seat)); -+ } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && display->GetPointer()) { -+ display->RemovePointer(); -+ } -+ -+ wl_keyboard* keyboard = display->GetKeyboard(); -+ if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !keyboard) { -+ display->SetKeyboard(wl_seat_get_keyboard(seat)); -+ } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && keyboard) { -+ display->ClearKeyboard(); -+ } -+} -+ -+static const struct wl_seat_listener seat_listener = { -+ seat_handle_capabilities, -+}; -+ -+void nsWaylandDisplay::SetSeat(wl_seat* aSeat, int aSeatId) { -+ mSeat = aSeat; -+ mSeatId = aSeatId; -+ wl_seat_add_listener(aSeat, &seat_listener, this); -+} -+ -+void nsWaylandDisplay::RemoveSeat(int aSeatId) { -+ if (mSeatId == aSeatId) { -+ mSeat = nullptr; -+ mSeatId = -1; -+ } -+} -+ -+/* This keymap routine is derived from weston-2.0.0/clients/simple-im.c -+ */ -+static void keyboard_handle_keymap(void* data, struct wl_keyboard* wl_keyboard, -+ uint32_t format, int fd, uint32_t size) { -+ KeymapWrapper::HandleKeymap(format, fd, size); -+} -+ -+static void keyboard_handle_enter(void* data, struct wl_keyboard* keyboard, -+ uint32_t serial, struct wl_surface* surface, -+ struct wl_array* keys) { -+ KeymapWrapper::SetFocusIn(surface, serial); -+} -+ -+static void keyboard_handle_leave(void* data, struct wl_keyboard* keyboard, -+ uint32_t serial, struct wl_surface* surface) { -+ KeymapWrapper::SetFocusOut(surface); -+} -+ -+static void keyboard_handle_key(void* data, struct wl_keyboard* keyboard, -+ uint32_t serial, uint32_t time, uint32_t key, -+ uint32_t state) {} -+static void keyboard_handle_modifiers(void* data, struct wl_keyboard* keyboard, -+ uint32_t serial, uint32_t mods_depressed, -+ uint32_t mods_latched, -+ uint32_t mods_locked, uint32_t group) {} -+static void keyboard_handle_repeat_info(void* data, -+ struct wl_keyboard* keyboard, -+ int32_t rate, int32_t delay) {} -+ -+static const struct wl_keyboard_listener keyboard_listener = { -+ keyboard_handle_keymap, keyboard_handle_enter, -+ keyboard_handle_leave, keyboard_handle_key, -+ keyboard_handle_modifiers, keyboard_handle_repeat_info}; -+ -+void nsWaylandDisplay::SetKeyboard(wl_keyboard* aKeyboard) { -+ MOZ_ASSERT(aKeyboard); -+ MOZ_DIAGNOSTIC_ASSERT(!mKeyboard); -+ mKeyboard = aKeyboard; -+ wl_keyboard_add_listener(mKeyboard, &keyboard_listener, nullptr); -+} -+ -+void nsWaylandDisplay::ClearKeyboard() { -+ if (mKeyboard) { -+ wl_keyboard_destroy(mKeyboard); -+ mKeyboard = nullptr; -+ } -+} -+ - void nsWaylandDisplay::SetCompositor(wl_compositor* aCompositor) { - mCompositor = aCompositor; - } - - void nsWaylandDisplay::SetSubcompositor(wl_subcompositor* aSubcompositor) { -@@ -82,10 +275,15 @@ - void nsWaylandDisplay::SetPointerConstraints( - zwp_pointer_constraints_v1* aPointerConstraints) { - mPointerConstraints = aPointerConstraints; - } - -+void nsWaylandDisplay::SetPointerGestures( -+ zwp_pointer_gestures_v1* aPointerGestures) { -+ mPointerGestures = aPointerGestures; -+} -+ - void nsWaylandDisplay::SetDmabuf(zwp_linux_dmabuf_v1* aDmabuf) { - mDmabuf = aDmabuf; - } - - void nsWaylandDisplay::SetXdgActivation(xdg_activation_v1* aXdgActivation) { -@@ -122,11 +320,12 @@ - } else if (iface.EqualsLiteral("zwp_pointer_constraints_v1")) { - auto* pointer_constraints = WaylandRegistryBind( - registry, id, &zwp_pointer_constraints_v1_interface, 1); - display->SetPointerConstraints(pointer_constraints); - } else if (iface.EqualsLiteral("wl_compositor")) { -- // Requested wl_compositor version 4 as we need wl_surface_damage_buffer(). -+ // Requested wl_compositor version 4 as we need -+ // wl_surface_damage_buffer(). - auto* compositor = WaylandRegistryBind( - registry, id, &wl_compositor_interface, 4); - display->SetCompositor(compositor); - } else if (iface.EqualsLiteral("wl_subcompositor")) { - auto* subcompositor = WaylandRegistryBind( -@@ -150,24 +349,33 @@ - registry, id, &xdg_dbus_annotation_manager_v1_interface, 1); - display->SetXdgDbusAnnotationManager(annotationManager); - } else if (iface.EqualsLiteral("wl_seat")) { - auto* seat = - WaylandRegistryBind(registry, id, &wl_seat_interface, 1); -- KeymapWrapper::SetSeat(seat, id); -+ display->SetSeat(seat, id); - } else if (iface.EqualsLiteral("wp_fractional_scale_manager_v1")) { - auto* manager = WaylandRegistryBind( - registry, id, &wp_fractional_scale_manager_v1_interface, 1); - display->SetFractionalScaleManager(manager); - } else if (iface.EqualsLiteral("gtk_primary_selection_device_manager") || - iface.EqualsLiteral("zwp_primary_selection_device_manager_v1")) { - display->EnablePrimarySelection(); -+ } else if (iface.EqualsLiteral("zwp_pointer_gestures_v1")) { -+ // HOLD is introduced in version 3 -+ auto* gestures = WaylandRegistryBind( -+ registry, id, &zwp_pointer_gestures_v1_interface, 3); -+ display->SetPointerGestures(gestures); - } - } - - static void global_registry_remover(void* data, wl_registry* registry, - uint32_t id) { -- KeymapWrapper::ClearSeat(id); -+ auto* display = static_cast(data); -+ if (!display) { -+ return; -+ } -+ display->RemoveSeat(id); - } - - static const struct wl_registry_listener registry_listener = { - global_registry_handler, global_registry_remover}; - -diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h ---- a/widget/gtk/nsWindow.h -+++ b/widget/gtk/nsWindow.h -@@ -107,10 +107,19 @@ - GDK_ANCHOR_SLIDE = GDK_ANCHOR_SLIDE_X | GDK_ANCHOR_SLIDE_Y, - GDK_ANCHOR_RESIZE = GDK_ANCHOR_RESIZE_X | GDK_ANCHOR_RESIZE_Y - } GdkAnchorHints; - #endif - -+#if !GTK_CHECK_VERSION(3, 18, 0) -+typedef enum { -+ GDK_TOUCHPAD_GESTURE_PHASE_BEGIN, -+ GDK_TOUCHPAD_GESTURE_PHASE_UPDATE, -+ GDK_TOUCHPAD_GESTURE_PHASE_END, -+ GDK_TOUCHPAD_GESTURE_PHASE_CANCEL -+} GdkTouchpadGesturePhase; -+#endif -+ - namespace mozilla { - enum class NativeKeyBindingsType : uint8_t; - - class TimeStamp; - #ifdef MOZ_X11 -@@ -256,10 +265,12 @@ - GtkSelectionData* aSelectionData, guint aInfo, - guint aTime, gpointer aData); - gboolean OnPropertyNotifyEvent(GtkWidget* aWidget, GdkEventProperty* aEvent); - gboolean OnTouchEvent(GdkEventTouch* aEvent); - gboolean OnTouchpadPinchEvent(GdkEventTouchpadPinch* aEvent); -+ void OnTouchpadHoldEvent(GdkTouchpadGesturePhase aPhase, guint aTime, -+ uint32_t aFingers); - - gint GetInputRegionMarginInGdkCoords(); - - void UpdateOpaqueRegionInternal(); - void UpdateOpaqueRegion(const LayoutDeviceIntRegion&) override; -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp ---- a/widget/gtk/nsWindow.cpp -+++ b/widget/gtk/nsWindow.cpp -@@ -139,11 +139,10 @@ - // Don't put more than this many rects in the dirty region, just fluff - // out to the bounding-box if there are more - #define MAX_RECTS_IN_REGION 100 - - #if !GTK_CHECK_VERSION(3, 18, 0) -- - struct _GdkEventTouchpadPinch { - GdkEventType type; - GdkWindow* window; - gint8 send_event; - gint8 phase; -@@ -157,20 +156,12 @@ - gdouble scale; - gdouble x_root, y_root; - guint state; - }; - --typedef enum { -- GDK_TOUCHPAD_GESTURE_PHASE_BEGIN, -- GDK_TOUCHPAD_GESTURE_PHASE_UPDATE, -- GDK_TOUCHPAD_GESTURE_PHASE_END, -- GDK_TOUCHPAD_GESTURE_PHASE_CANCEL --} GdkTouchpadGesturePhase; -- - gint GDK_TOUCHPAD_GESTURE_MASK = 1 << 24; - GdkEventType GDK_TOUCHPAD_PINCH = static_cast(42); -- - #endif - - const gint kEvents = GDK_TOUCHPAD_GESTURE_MASK | GDK_EXPOSURE_MASK | - GDK_STRUCTURE_MASK | GDK_VISIBILITY_NOTIFY_MASK | - GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | -@@ -5509,10 +5500,15 @@ - mLastPinchEventSpan = aEvent->scale; - DispatchPinchGestureInput(event); - return TRUE; - } - -+void nsWindow::OnTouchpadHoldEvent(GdkTouchpadGesturePhase aPhase, guint aTime, -+ uint32_t aFingers) { -+ LOG("OnTouchpadHoldEvent: aPhase %d aFingers %d", aPhase, aFingers); -+} -+ - gboolean nsWindow::OnTouchEvent(GdkEventTouch* aEvent) { - LOG("OnTouchEvent: x=%f y=%f type=%d\n", aEvent->x, aEvent->y, aEvent->type); - if (!mHandleTouchEvent) { - // If a popup window was spawned (e.g. as the result of a long-press) - // and touch events got diverted to that window within a touch sequence, -diff --git a/widget/gtk/wayland/moz.build b/widget/gtk/wayland/moz.build ---- a/widget/gtk/wayland/moz.build -+++ b/widget/gtk/wayland/moz.build -@@ -10,10 +10,11 @@ - SOURCES += [ - "fractional-scale-v1-protocol.c", - "idle-inhibit-unstable-v1-protocol.c", - "linux-dmabuf-unstable-v1-protocol.c", - "pointer-constraints-unstable-v1-protocol.c", -+ "pointer-gestures-unstable-v1-protocol.c", - "relative-pointer-unstable-v1-protocol.c", - "viewporter-protocol.c", - "xdg-activation-v1-protocol.c", - "xdg-dbus-annotation-v1-protocol.c", - "xdg-output-unstable-v1-protocol.c", -@@ -22,10 +23,11 @@ - EXPORTS.mozilla.widget += [ - "fractional-scale-v1-client-protocol.h", - "idle-inhibit-unstable-v1-client-protocol.h", - "linux-dmabuf-unstable-v1-client-protocol.h", - "pointer-constraints-unstable-v1-client-protocol.h", -+ "pointer-gestures-unstable-v1-client-protocol.h", - "relative-pointer-unstable-v1-client-protocol.h", - "viewporter-client-protocol.h", - "xdg-activation-v1-client-protocol.h", - "xdg-dbus-annotation-v1-client-protocol.h", - "xdg-output-unstable-v1-client-protocol.h", -diff --git a/widget/gtk/wayland/pointer-gestures-unstable-v1-client-protocol.h b/widget/gtk/wayland/pointer-gestures-unstable-v1-client-protocol.h -new file mode 100644 ---- /dev/null -+++ b/widget/gtk/wayland/pointer-gestures-unstable-v1-client-protocol.h -@@ -0,0 +1,685 @@ -+/* Generated by wayland-scanner 1.22.0 */ -+ -+#ifndef POINTER_GESTURES_UNSTABLE_V1_CLIENT_PROTOCOL_H -+#define POINTER_GESTURES_UNSTABLE_V1_CLIENT_PROTOCOL_H -+ -+#include -+#include -+#include "wayland-client.h" -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+/** -+ * @page page_pointer_gestures_unstable_v1 The pointer_gestures_unstable_v1 -+ * protocol -+ * @section page_ifaces_pointer_gestures_unstable_v1 Interfaces -+ * - @subpage page_iface_zwp_pointer_gestures_v1 - touchpad gestures -+ * - @subpage page_iface_zwp_pointer_gesture_swipe_v1 - a swipe gesture object -+ * - @subpage page_iface_zwp_pointer_gesture_pinch_v1 - a pinch gesture object -+ * - @subpage page_iface_zwp_pointer_gesture_hold_v1 - a hold gesture object -+ */ -+struct wl_pointer; -+struct wl_surface; -+struct zwp_pointer_gesture_hold_v1; -+struct zwp_pointer_gesture_pinch_v1; -+struct zwp_pointer_gesture_swipe_v1; -+struct zwp_pointer_gestures_v1; -+ -+#ifndef ZWP_POINTER_GESTURES_V1_INTERFACE -+# define ZWP_POINTER_GESTURES_V1_INTERFACE -+/** -+ * @page page_iface_zwp_pointer_gestures_v1 zwp_pointer_gestures_v1 -+ * @section page_iface_zwp_pointer_gestures_v1_desc Description -+ * -+ * A global interface to provide semantic touchpad gestures for a given -+ * pointer. -+ * -+ * Three gestures are currently supported: swipe, pinch, and hold. -+ * Pinch and swipe gestures follow a three-stage cycle: begin, update, -+ * end, hold gestures follow a two-stage cycle: begin and end. All -+ * gestures are identified by a unique id. -+ * -+ * Warning! The protocol described in this file is experimental and -+ * backward incompatible changes may be made. Backward compatible changes -+ * may be added together with the corresponding interface version bump. -+ * Backward incompatible changes are done by bumping the version number in -+ * the protocol and interface names and resetting the interface version. -+ * Once the protocol is to be declared stable, the 'z' prefix and the -+ * version number in the protocol and interface names are removed and the -+ * interface version number is reset. -+ * @section page_iface_zwp_pointer_gestures_v1_api API -+ * See @ref iface_zwp_pointer_gestures_v1. -+ */ -+/** -+ * @defgroup iface_zwp_pointer_gestures_v1 The zwp_pointer_gestures_v1 interface -+ * -+ * A global interface to provide semantic touchpad gestures for a given -+ * pointer. -+ * -+ * Three gestures are currently supported: swipe, pinch, and hold. -+ * Pinch and swipe gestures follow a three-stage cycle: begin, update, -+ * end, hold gestures follow a two-stage cycle: begin and end. All -+ * gestures are identified by a unique id. -+ * -+ * Warning! The protocol described in this file is experimental and -+ * backward incompatible changes may be made. Backward compatible changes -+ * may be added together with the corresponding interface version bump. -+ * Backward incompatible changes are done by bumping the version number in -+ * the protocol and interface names and resetting the interface version. -+ * Once the protocol is to be declared stable, the 'z' prefix and the -+ * version number in the protocol and interface names are removed and the -+ * interface version number is reset. -+ */ -+extern const struct wl_interface zwp_pointer_gestures_v1_interface; -+#endif -+#ifndef ZWP_POINTER_GESTURE_SWIPE_V1_INTERFACE -+# define ZWP_POINTER_GESTURE_SWIPE_V1_INTERFACE -+/** -+ * @page page_iface_zwp_pointer_gesture_swipe_v1 zwp_pointer_gesture_swipe_v1 -+ * @section page_iface_zwp_pointer_gesture_swipe_v1_desc Description -+ * -+ * A swipe gesture object notifies a client about a multi-finger swipe -+ * gesture detected on an indirect input device such as a touchpad. -+ * The gesture is usually initiated by multiple fingers moving in the -+ * same direction but once initiated the direction may change. -+ * The precise conditions of when such a gesture is detected are -+ * implementation-dependent. -+ * -+ * A gesture consists of three stages: begin, update (optional) and end. -+ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a -+ * same pointer/seat, how compositors prevent these situations is -+ * implementation-dependent. -+ * -+ * A gesture may be cancelled by the compositor or the hardware. -+ * Clients should not consider performing permanent or irreversible -+ * actions until the end of a gesture has been received. -+ * @section page_iface_zwp_pointer_gesture_swipe_v1_api API -+ * See @ref iface_zwp_pointer_gesture_swipe_v1. -+ */ -+/** -+ * @defgroup iface_zwp_pointer_gesture_swipe_v1 The zwp_pointer_gesture_swipe_v1 -+ * interface -+ * -+ * A swipe gesture object notifies a client about a multi-finger swipe -+ * gesture detected on an indirect input device such as a touchpad. -+ * The gesture is usually initiated by multiple fingers moving in the -+ * same direction but once initiated the direction may change. -+ * The precise conditions of when such a gesture is detected are -+ * implementation-dependent. -+ * -+ * A gesture consists of three stages: begin, update (optional) and end. -+ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a -+ * same pointer/seat, how compositors prevent these situations is -+ * implementation-dependent. -+ * -+ * A gesture may be cancelled by the compositor or the hardware. -+ * Clients should not consider performing permanent or irreversible -+ * actions until the end of a gesture has been received. -+ */ -+extern const struct wl_interface zwp_pointer_gesture_swipe_v1_interface; -+#endif -+#ifndef ZWP_POINTER_GESTURE_PINCH_V1_INTERFACE -+# define ZWP_POINTER_GESTURE_PINCH_V1_INTERFACE -+/** -+ * @page page_iface_zwp_pointer_gesture_pinch_v1 zwp_pointer_gesture_pinch_v1 -+ * @section page_iface_zwp_pointer_gesture_pinch_v1_desc Description -+ * -+ * A pinch gesture object notifies a client about a multi-finger pinch -+ * gesture detected on an indirect input device such as a touchpad. -+ * The gesture is usually initiated by multiple fingers moving towards -+ * each other or away from each other, or by two or more fingers rotating -+ * around a logical center of gravity. The precise conditions of when -+ * such a gesture is detected are implementation-dependent. -+ * -+ * A gesture consists of three stages: begin, update (optional) and end. -+ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a -+ * same pointer/seat, how compositors prevent these situations is -+ * implementation-dependent. -+ * -+ * A gesture may be cancelled by the compositor or the hardware. -+ * Clients should not consider performing permanent or irreversible -+ * actions until the end of a gesture has been received. -+ * @section page_iface_zwp_pointer_gesture_pinch_v1_api API -+ * See @ref iface_zwp_pointer_gesture_pinch_v1. -+ */ -+/** -+ * @defgroup iface_zwp_pointer_gesture_pinch_v1 The zwp_pointer_gesture_pinch_v1 -+ * interface -+ * -+ * A pinch gesture object notifies a client about a multi-finger pinch -+ * gesture detected on an indirect input device such as a touchpad. -+ * The gesture is usually initiated by multiple fingers moving towards -+ * each other or away from each other, or by two or more fingers rotating -+ * around a logical center of gravity. The precise conditions of when -+ * such a gesture is detected are implementation-dependent. -+ * -+ * A gesture consists of three stages: begin, update (optional) and end. -+ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a -+ * same pointer/seat, how compositors prevent these situations is -+ * implementation-dependent. -+ * -+ * A gesture may be cancelled by the compositor or the hardware. -+ * Clients should not consider performing permanent or irreversible -+ * actions until the end of a gesture has been received. -+ */ -+extern const struct wl_interface zwp_pointer_gesture_pinch_v1_interface; -+#endif -+#ifndef ZWP_POINTER_GESTURE_HOLD_V1_INTERFACE -+# define ZWP_POINTER_GESTURE_HOLD_V1_INTERFACE -+/** -+ * @page page_iface_zwp_pointer_gesture_hold_v1 zwp_pointer_gesture_hold_v1 -+ * @section page_iface_zwp_pointer_gesture_hold_v1_desc Description -+ * -+ * A hold gesture object notifies a client about a single- or -+ * multi-finger hold gesture detected on an indirect input device such as -+ * a touchpad. The gesture is usually initiated by one or more fingers -+ * being held down without significant movement. The precise conditions -+ * of when such a gesture is detected are implementation-dependent. -+ * -+ * In particular, this gesture may be used to cancel kinetic scrolling. -+ * -+ * A hold gesture consists of two stages: begin and end. Unlike pinch and -+ * swipe there is no update stage. -+ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a -+ * same pointer/seat, how compositors prevent these situations is -+ * implementation-dependent. -+ * -+ * A gesture may be cancelled by the compositor or the hardware. -+ * Clients should not consider performing permanent or irreversible -+ * actions until the end of a gesture has been received. -+ * @section page_iface_zwp_pointer_gesture_hold_v1_api API -+ * See @ref iface_zwp_pointer_gesture_hold_v1. -+ */ -+/** -+ * @defgroup iface_zwp_pointer_gesture_hold_v1 The zwp_pointer_gesture_hold_v1 -+ * interface -+ * -+ * A hold gesture object notifies a client about a single- or -+ * multi-finger hold gesture detected on an indirect input device such as -+ * a touchpad. The gesture is usually initiated by one or more fingers -+ * being held down without significant movement. The precise conditions -+ * of when such a gesture is detected are implementation-dependent. -+ * -+ * In particular, this gesture may be used to cancel kinetic scrolling. -+ * -+ * A hold gesture consists of two stages: begin and end. Unlike pinch and -+ * swipe there is no update stage. -+ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a -+ * same pointer/seat, how compositors prevent these situations is -+ * implementation-dependent. -+ * -+ * A gesture may be cancelled by the compositor or the hardware. -+ * Clients should not consider performing permanent or irreversible -+ * actions until the end of a gesture has been received. -+ */ -+extern const struct wl_interface zwp_pointer_gesture_hold_v1_interface; -+#endif -+ -+#define ZWP_POINTER_GESTURES_V1_GET_SWIPE_GESTURE 0 -+#define ZWP_POINTER_GESTURES_V1_GET_PINCH_GESTURE 1 -+#define ZWP_POINTER_GESTURES_V1_RELEASE 2 -+#define ZWP_POINTER_GESTURES_V1_GET_HOLD_GESTURE 3 -+ -+/** -+ * @ingroup iface_zwp_pointer_gestures_v1 -+ */ -+#define ZWP_POINTER_GESTURES_V1_GET_SWIPE_GESTURE_SINCE_VERSION 1 -+/** -+ * @ingroup iface_zwp_pointer_gestures_v1 -+ */ -+#define ZWP_POINTER_GESTURES_V1_GET_PINCH_GESTURE_SINCE_VERSION 1 -+/** -+ * @ingroup iface_zwp_pointer_gestures_v1 -+ */ -+#define ZWP_POINTER_GESTURES_V1_RELEASE_SINCE_VERSION 2 -+/** -+ * @ingroup iface_zwp_pointer_gestures_v1 -+ */ -+#define ZWP_POINTER_GESTURES_V1_GET_HOLD_GESTURE_SINCE_VERSION 3 -+ -+/** @ingroup iface_zwp_pointer_gestures_v1 */ -+static inline void zwp_pointer_gestures_v1_set_user_data( -+ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1, void* user_data) { -+ wl_proxy_set_user_data((struct wl_proxy*)zwp_pointer_gestures_v1, user_data); -+} -+ -+/** @ingroup iface_zwp_pointer_gestures_v1 */ -+static inline void* zwp_pointer_gestures_v1_get_user_data( -+ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1) { -+ return wl_proxy_get_user_data((struct wl_proxy*)zwp_pointer_gestures_v1); -+} -+ -+static inline uint32_t zwp_pointer_gestures_v1_get_version( -+ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1) { -+ return wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gestures_v1); -+} -+ -+/** @ingroup iface_zwp_pointer_gestures_v1 */ -+static inline void zwp_pointer_gestures_v1_destroy( -+ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1) { -+ wl_proxy_destroy((struct wl_proxy*)zwp_pointer_gestures_v1); -+} -+ -+/** -+ * @ingroup iface_zwp_pointer_gestures_v1 -+ * -+ * Create a swipe gesture object. See the -+ * wl_pointer_gesture_swipe interface for details. -+ */ -+static inline struct zwp_pointer_gesture_swipe_v1* -+zwp_pointer_gestures_v1_get_swipe_gesture( -+ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1, -+ struct wl_pointer* pointer) { -+ struct wl_proxy* id; -+ -+ id = wl_proxy_marshal_flags( -+ (struct wl_proxy*)zwp_pointer_gestures_v1, -+ ZWP_POINTER_GESTURES_V1_GET_SWIPE_GESTURE, -+ &zwp_pointer_gesture_swipe_v1_interface, -+ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gestures_v1), 0, NULL, -+ pointer); -+ -+ return (struct zwp_pointer_gesture_swipe_v1*)id; -+} -+ -+/** -+ * @ingroup iface_zwp_pointer_gestures_v1 -+ * -+ * Create a pinch gesture object. See the -+ * wl_pointer_gesture_pinch interface for details. -+ */ -+static inline struct zwp_pointer_gesture_pinch_v1* -+zwp_pointer_gestures_v1_get_pinch_gesture( -+ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1, -+ struct wl_pointer* pointer) { -+ struct wl_proxy* id; -+ -+ id = wl_proxy_marshal_flags( -+ (struct wl_proxy*)zwp_pointer_gestures_v1, -+ ZWP_POINTER_GESTURES_V1_GET_PINCH_GESTURE, -+ &zwp_pointer_gesture_pinch_v1_interface, -+ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gestures_v1), 0, NULL, -+ pointer); -+ -+ return (struct zwp_pointer_gesture_pinch_v1*)id; -+} -+ -+/** -+ * @ingroup iface_zwp_pointer_gestures_v1 -+ * -+ * Destroy the pointer gesture object. Swipe, pinch and hold objects -+ * created via this gesture object remain valid. -+ */ -+static inline void zwp_pointer_gestures_v1_release( -+ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1) { -+ wl_proxy_marshal_flags( -+ (struct wl_proxy*)zwp_pointer_gestures_v1, -+ ZWP_POINTER_GESTURES_V1_RELEASE, NULL, -+ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gestures_v1), -+ WL_MARSHAL_FLAG_DESTROY); -+} -+ -+/** -+ * @ingroup iface_zwp_pointer_gestures_v1 -+ * -+ * Create a hold gesture object. See the -+ * wl_pointer_gesture_hold interface for details. -+ */ -+static inline struct zwp_pointer_gesture_hold_v1* -+zwp_pointer_gestures_v1_get_hold_gesture( -+ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1, -+ struct wl_pointer* pointer) { -+ struct wl_proxy* id; -+ -+ id = wl_proxy_marshal_flags( -+ (struct wl_proxy*)zwp_pointer_gestures_v1, -+ ZWP_POINTER_GESTURES_V1_GET_HOLD_GESTURE, -+ &zwp_pointer_gesture_hold_v1_interface, -+ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gestures_v1), 0, NULL, -+ pointer); -+ -+ return (struct zwp_pointer_gesture_hold_v1*)id; -+} -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_swipe_v1 -+ * @struct zwp_pointer_gesture_swipe_v1_listener -+ */ -+struct zwp_pointer_gesture_swipe_v1_listener { -+ /** -+ * multi-finger swipe begin -+ * -+ * This event is sent when a multi-finger swipe gesture is -+ * detected on the device. -+ * @param time timestamp with millisecond granularity -+ * @param fingers number of fingers -+ */ -+ void (*begin)( -+ void* data, -+ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1, -+ uint32_t serial, uint32_t time, struct wl_surface* surface, -+ uint32_t fingers); -+ /** -+ * multi-finger swipe motion -+ * -+ * This event is sent when a multi-finger swipe gesture changes -+ * the position of the logical center. -+ * -+ * The dx and dy coordinates are relative coordinates of the -+ * logical center of the gesture compared to the previous event. -+ * @param time timestamp with millisecond granularity -+ * @param dx delta x coordinate in surface coordinate space -+ * @param dy delta y coordinate in surface coordinate space -+ */ -+ void (*update)( -+ void* data, -+ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1, -+ uint32_t time, wl_fixed_t dx, wl_fixed_t dy); -+ /** -+ * multi-finger swipe end -+ * -+ * This event is sent when a multi-finger swipe gesture ceases to -+ * be valid. This may happen when one or more fingers are lifted or -+ * the gesture is cancelled. -+ * -+ * When a gesture is cancelled, the client should undo state -+ * changes caused by this gesture. What causes a gesture to be -+ * cancelled is implementation-dependent. -+ * @param time timestamp with millisecond granularity -+ * @param cancelled 1 if the gesture was cancelled, 0 otherwise -+ */ -+ void (*end)(void* data, -+ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1, -+ uint32_t serial, uint32_t time, int32_t cancelled); -+}; -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_swipe_v1 -+ */ -+static inline int zwp_pointer_gesture_swipe_v1_add_listener( -+ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1, -+ const struct zwp_pointer_gesture_swipe_v1_listener* listener, void* data) { -+ return wl_proxy_add_listener((struct wl_proxy*)zwp_pointer_gesture_swipe_v1, -+ (void (**)(void))listener, data); -+} -+ -+#define ZWP_POINTER_GESTURE_SWIPE_V1_DESTROY 0 -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_swipe_v1 -+ */ -+#define ZWP_POINTER_GESTURE_SWIPE_V1_BEGIN_SINCE_VERSION 1 -+/** -+ * @ingroup iface_zwp_pointer_gesture_swipe_v1 -+ */ -+#define ZWP_POINTER_GESTURE_SWIPE_V1_UPDATE_SINCE_VERSION 1 -+/** -+ * @ingroup iface_zwp_pointer_gesture_swipe_v1 -+ */ -+#define ZWP_POINTER_GESTURE_SWIPE_V1_END_SINCE_VERSION 1 -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_swipe_v1 -+ */ -+#define ZWP_POINTER_GESTURE_SWIPE_V1_DESTROY_SINCE_VERSION 1 -+ -+/** @ingroup iface_zwp_pointer_gesture_swipe_v1 */ -+static inline void zwp_pointer_gesture_swipe_v1_set_user_data( -+ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1, -+ void* user_data) { -+ wl_proxy_set_user_data((struct wl_proxy*)zwp_pointer_gesture_swipe_v1, -+ user_data); -+} -+ -+/** @ingroup iface_zwp_pointer_gesture_swipe_v1 */ -+static inline void* zwp_pointer_gesture_swipe_v1_get_user_data( -+ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1) { -+ return wl_proxy_get_user_data((struct wl_proxy*)zwp_pointer_gesture_swipe_v1); -+} -+ -+static inline uint32_t zwp_pointer_gesture_swipe_v1_get_version( -+ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1) { -+ return wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_swipe_v1); -+} -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_swipe_v1 -+ */ -+static inline void zwp_pointer_gesture_swipe_v1_destroy( -+ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1) { -+ wl_proxy_marshal_flags( -+ (struct wl_proxy*)zwp_pointer_gesture_swipe_v1, -+ ZWP_POINTER_GESTURE_SWIPE_V1_DESTROY, NULL, -+ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_swipe_v1), -+ WL_MARSHAL_FLAG_DESTROY); -+} -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_pinch_v1 -+ * @struct zwp_pointer_gesture_pinch_v1_listener -+ */ -+struct zwp_pointer_gesture_pinch_v1_listener { -+ /** -+ * multi-finger pinch begin -+ * -+ * This event is sent when a multi-finger pinch gesture is -+ * detected on the device. -+ * @param time timestamp with millisecond granularity -+ * @param fingers number of fingers -+ */ -+ void (*begin)( -+ void* data, -+ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1, -+ uint32_t serial, uint32_t time, struct wl_surface* surface, -+ uint32_t fingers); -+ /** -+ * multi-finger pinch motion -+ * -+ * This event is sent when a multi-finger pinch gesture changes -+ * the position of the logical center, the rotation or the relative -+ * scale. -+ * -+ * The dx and dy coordinates are relative coordinates in the -+ * surface coordinate space of the logical center of the gesture. -+ * -+ * The scale factor is an absolute scale compared to the -+ * pointer_gesture_pinch.begin event, e.g. a scale of 2 means the -+ * fingers are now twice as far apart as on -+ * pointer_gesture_pinch.begin. -+ * -+ * The rotation is the relative angle in degrees clockwise compared -+ * to the previous pointer_gesture_pinch.begin or -+ * pointer_gesture_pinch.update event. -+ * @param time timestamp with millisecond granularity -+ * @param dx delta x coordinate in surface coordinate space -+ * @param dy delta y coordinate in surface coordinate space -+ * @param scale scale relative to the initial finger position -+ * @param rotation angle in degrees cw relative to the previous event -+ */ -+ void (*update)( -+ void* data, -+ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1, -+ uint32_t time, wl_fixed_t dx, wl_fixed_t dy, wl_fixed_t scale, -+ wl_fixed_t rotation); -+ /** -+ * multi-finger pinch end -+ * -+ * This event is sent when a multi-finger pinch gesture ceases to -+ * be valid. This may happen when one or more fingers are lifted or -+ * the gesture is cancelled. -+ * -+ * When a gesture is cancelled, the client should undo state -+ * changes caused by this gesture. What causes a gesture to be -+ * cancelled is implementation-dependent. -+ * @param time timestamp with millisecond granularity -+ * @param cancelled 1 if the gesture was cancelled, 0 otherwise -+ */ -+ void (*end)(void* data, -+ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1, -+ uint32_t serial, uint32_t time, int32_t cancelled); -+}; -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_pinch_v1 -+ */ -+static inline int zwp_pointer_gesture_pinch_v1_add_listener( -+ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1, -+ const struct zwp_pointer_gesture_pinch_v1_listener* listener, void* data) { -+ return wl_proxy_add_listener((struct wl_proxy*)zwp_pointer_gesture_pinch_v1, -+ (void (**)(void))listener, data); -+} -+ -+#define ZWP_POINTER_GESTURE_PINCH_V1_DESTROY 0 -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_pinch_v1 -+ */ -+#define ZWP_POINTER_GESTURE_PINCH_V1_BEGIN_SINCE_VERSION 1 -+/** -+ * @ingroup iface_zwp_pointer_gesture_pinch_v1 -+ */ -+#define ZWP_POINTER_GESTURE_PINCH_V1_UPDATE_SINCE_VERSION 1 -+/** -+ * @ingroup iface_zwp_pointer_gesture_pinch_v1 -+ */ -+#define ZWP_POINTER_GESTURE_PINCH_V1_END_SINCE_VERSION 1 -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_pinch_v1 -+ */ -+#define ZWP_POINTER_GESTURE_PINCH_V1_DESTROY_SINCE_VERSION 1 -+ -+/** @ingroup iface_zwp_pointer_gesture_pinch_v1 */ -+static inline void zwp_pointer_gesture_pinch_v1_set_user_data( -+ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1, -+ void* user_data) { -+ wl_proxy_set_user_data((struct wl_proxy*)zwp_pointer_gesture_pinch_v1, -+ user_data); -+} -+ -+/** @ingroup iface_zwp_pointer_gesture_pinch_v1 */ -+static inline void* zwp_pointer_gesture_pinch_v1_get_user_data( -+ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1) { -+ return wl_proxy_get_user_data((struct wl_proxy*)zwp_pointer_gesture_pinch_v1); -+} -+ -+static inline uint32_t zwp_pointer_gesture_pinch_v1_get_version( -+ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1) { -+ return wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_pinch_v1); -+} -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_pinch_v1 -+ */ -+static inline void zwp_pointer_gesture_pinch_v1_destroy( -+ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1) { -+ wl_proxy_marshal_flags( -+ (struct wl_proxy*)zwp_pointer_gesture_pinch_v1, -+ ZWP_POINTER_GESTURE_PINCH_V1_DESTROY, NULL, -+ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_pinch_v1), -+ WL_MARSHAL_FLAG_DESTROY); -+} -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_hold_v1 -+ * @struct zwp_pointer_gesture_hold_v1_listener -+ */ -+struct zwp_pointer_gesture_hold_v1_listener { -+ /** -+ * multi-finger hold begin -+ * -+ * This event is sent when a hold gesture is detected on the -+ * device. -+ * @param time timestamp with millisecond granularity -+ * @param fingers number of fingers -+ * @since 3 -+ */ -+ void (*begin)(void* data, -+ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1, -+ uint32_t serial, uint32_t time, struct wl_surface* surface, -+ uint32_t fingers); -+ /** -+ * multi-finger hold end -+ * -+ * This event is sent when a hold gesture ceases to be valid. -+ * This may happen when the holding fingers are lifted or the -+ * gesture is cancelled, for example if the fingers move past an -+ * implementation-defined threshold, the finger count changes or -+ * the hold gesture changes into a different type of gesture. -+ * -+ * When a gesture is cancelled, the client may need to undo state -+ * changes caused by this gesture. What causes a gesture to be -+ * cancelled is implementation-dependent. -+ * @param time timestamp with millisecond granularity -+ * @param cancelled 1 if the gesture was cancelled, 0 otherwise -+ * @since 3 -+ */ -+ void (*end)(void* data, -+ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1, -+ uint32_t serial, uint32_t time, int32_t cancelled); -+}; -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_hold_v1 -+ */ -+static inline int zwp_pointer_gesture_hold_v1_add_listener( -+ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1, -+ const struct zwp_pointer_gesture_hold_v1_listener* listener, void* data) { -+ return wl_proxy_add_listener((struct wl_proxy*)zwp_pointer_gesture_hold_v1, -+ (void (**)(void))listener, data); -+} -+ -+#define ZWP_POINTER_GESTURE_HOLD_V1_DESTROY 0 -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_hold_v1 -+ */ -+#define ZWP_POINTER_GESTURE_HOLD_V1_BEGIN_SINCE_VERSION 3 -+/** -+ * @ingroup iface_zwp_pointer_gesture_hold_v1 -+ */ -+#define ZWP_POINTER_GESTURE_HOLD_V1_END_SINCE_VERSION 3 -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_hold_v1 -+ */ -+#define ZWP_POINTER_GESTURE_HOLD_V1_DESTROY_SINCE_VERSION 3 -+ -+/** @ingroup iface_zwp_pointer_gesture_hold_v1 */ -+static inline void zwp_pointer_gesture_hold_v1_set_user_data( -+ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1, -+ void* user_data) { -+ wl_proxy_set_user_data((struct wl_proxy*)zwp_pointer_gesture_hold_v1, -+ user_data); -+} -+ -+/** @ingroup iface_zwp_pointer_gesture_hold_v1 */ -+static inline void* zwp_pointer_gesture_hold_v1_get_user_data( -+ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1) { -+ return wl_proxy_get_user_data((struct wl_proxy*)zwp_pointer_gesture_hold_v1); -+} -+ -+static inline uint32_t zwp_pointer_gesture_hold_v1_get_version( -+ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1) { -+ return wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_hold_v1); -+} -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_hold_v1 -+ */ -+static inline void zwp_pointer_gesture_hold_v1_destroy( -+ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1) { -+ wl_proxy_marshal_flags( -+ (struct wl_proxy*)zwp_pointer_gesture_hold_v1, -+ ZWP_POINTER_GESTURE_HOLD_V1_DESTROY, NULL, -+ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_hold_v1), -+ WL_MARSHAL_FLAG_DESTROY); -+} -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif -diff --git a/widget/gtk/wayland/pointer-gestures-unstable-v1-protocol.c b/widget/gtk/wayland/pointer-gestures-unstable-v1-protocol.c -new file mode 100644 ---- /dev/null -+++ b/widget/gtk/wayland/pointer-gestures-unstable-v1-protocol.c -@@ -0,0 +1,112 @@ -+/* Generated by wayland-scanner 1.22.0 */ -+ -+#include -+#include -+#include "wayland-util.h" -+ -+#ifndef __has_attribute -+# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */ -+#endif -+ -+#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4) -+# define WL_PRIVATE __attribute__((visibility("hidden"))) -+#else -+# define WL_PRIVATE -+#endif -+ -+#pragma GCC visibility push(default) -+extern const struct wl_interface wl_pointer_interface; -+extern const struct wl_interface wl_surface_interface; -+#pragma GCC visibility pop -+extern const struct wl_interface zwp_pointer_gesture_hold_v1_interface; -+extern const struct wl_interface zwp_pointer_gesture_pinch_v1_interface; -+extern const struct wl_interface zwp_pointer_gesture_swipe_v1_interface; -+ -+static const struct wl_interface* pointer_gestures_unstable_v1_types[] = { -+ NULL, -+ NULL, -+ NULL, -+ NULL, -+ NULL, -+ &zwp_pointer_gesture_swipe_v1_interface, -+ &wl_pointer_interface, -+ &zwp_pointer_gesture_pinch_v1_interface, -+ &wl_pointer_interface, -+ &zwp_pointer_gesture_hold_v1_interface, -+ &wl_pointer_interface, -+ NULL, -+ NULL, -+ &wl_surface_interface, -+ NULL, -+ NULL, -+ NULL, -+ &wl_surface_interface, -+ NULL, -+ NULL, -+ NULL, -+ &wl_surface_interface, -+ NULL, -+}; -+ -+static const struct wl_message zwp_pointer_gestures_v1_requests[] = { -+ {"get_swipe_gesture", "no", pointer_gestures_unstable_v1_types + 5}, -+ {"get_pinch_gesture", "no", pointer_gestures_unstable_v1_types + 7}, -+ {"release", "2", pointer_gestures_unstable_v1_types + 0}, -+ {"get_hold_gesture", "3no", pointer_gestures_unstable_v1_types + 9}, -+}; -+ -+WL_PRIVATE const struct wl_interface zwp_pointer_gestures_v1_interface = { -+ "zwp_pointer_gestures_v1", 3, 4, zwp_pointer_gestures_v1_requests, 0, NULL, -+}; -+ -+static const struct wl_message zwp_pointer_gesture_swipe_v1_requests[] = { -+ {"destroy", "", pointer_gestures_unstable_v1_types + 0}, -+}; -+ -+static const struct wl_message zwp_pointer_gesture_swipe_v1_events[] = { -+ {"begin", "uuou", pointer_gestures_unstable_v1_types + 11}, -+ {"update", "uff", pointer_gestures_unstable_v1_types + 0}, -+ {"end", "uui", pointer_gestures_unstable_v1_types + 0}, -+}; -+ -+WL_PRIVATE const struct wl_interface zwp_pointer_gesture_swipe_v1_interface = { -+ "zwp_pointer_gesture_swipe_v1", -+ 2, -+ 1, -+ zwp_pointer_gesture_swipe_v1_requests, -+ 3, -+ zwp_pointer_gesture_swipe_v1_events, -+}; -+ -+static const struct wl_message zwp_pointer_gesture_pinch_v1_requests[] = { -+ {"destroy", "", pointer_gestures_unstable_v1_types + 0}, -+}; -+ -+static const struct wl_message zwp_pointer_gesture_pinch_v1_events[] = { -+ {"begin", "uuou", pointer_gestures_unstable_v1_types + 15}, -+ {"update", "uffff", pointer_gestures_unstable_v1_types + 0}, -+ {"end", "uui", pointer_gestures_unstable_v1_types + 0}, -+}; -+ -+WL_PRIVATE const struct wl_interface zwp_pointer_gesture_pinch_v1_interface = { -+ "zwp_pointer_gesture_pinch_v1", -+ 2, -+ 1, -+ zwp_pointer_gesture_pinch_v1_requests, -+ 3, -+ zwp_pointer_gesture_pinch_v1_events, -+}; -+ -+static const struct wl_message zwp_pointer_gesture_hold_v1_requests[] = { -+ {"destroy", "3", pointer_gestures_unstable_v1_types + 0}, -+}; -+ -+static const struct wl_message zwp_pointer_gesture_hold_v1_events[] = { -+ {"begin", "3uuou", pointer_gestures_unstable_v1_types + 19}, -+ {"end", "3uui", pointer_gestures_unstable_v1_types + 0}, -+}; -+ -+WL_PRIVATE const struct wl_interface zwp_pointer_gesture_hold_v1_interface = { -+ "zwp_pointer_gesture_hold_v1", 3, 1, -+ zwp_pointer_gesture_hold_v1_requests, 2, zwp_pointer_gesture_hold_v1_events, -+}; - diff --git a/D220671.patch b/D220671.patch deleted file mode 100644 index e5d659b..0000000 --- a/D220671.patch +++ /dev/null @@ -1,270 +0,0 @@ -diff -up firefox-131.0/browser/components/shell/moz.build.D220671 firefox-131.0/browser/components/shell/moz.build ---- firefox-131.0/browser/components/shell/moz.build.D220671 2024-09-23 19:59:58.000000000 +0200 -+++ firefox-131.0/browser/components/shell/moz.build 2024-09-25 08:55:09.196886415 +0200 -@@ -35,8 +35,11 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "coco - elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": - XPIDL_SOURCES += [ - "nsIGNOMEShellService.idl", -+ "nsIOpenTabsProvider.idl", -+ ] -+ EXTRA_JS_MODULES += [ -+ "OpenTabsProvider.sys.mjs", - ] -- - SOURCES += [ - "nsGNOMEShellService.cpp", - ] -diff -up firefox-131.0/browser/components/shell/nsGNOMEShellDBusHelper.cpp.D220671 firefox-131.0/browser/components/shell/nsGNOMEShellDBusHelper.cpp ---- firefox-131.0/browser/components/shell/nsGNOMEShellDBusHelper.cpp.D220671 2024-09-23 19:59:58.000000000 +0200 -+++ firefox-131.0/browser/components/shell/nsGNOMEShellDBusHelper.cpp 2024-09-25 09:01:04.080111999 +0200 -@@ -13,6 +13,8 @@ - #include "nsPrintfCString.h" - #include "mozilla/XREAppData.h" - #include "nsAppRunner.h" -+#include "nsImportModule.h" -+#include "nsIOpenTabsProvider.h" - - #define DBUS_BUS_NAME_TEMPLATE "org.mozilla.%s.SearchProvider" - #define DBUS_OBJECT_PATH_TEMPLATE "/org/mozilla/%s/SearchProvider" -@@ -65,12 +67,23 @@ static bool GetGnomeSearchTitle(const ch - } - - int DBusGetIndexFromIDKey(const char* aIDKey) { -- // ID is NN:URL where NN is index to our current history -+ // ID is NN:S:URL where NN is index to our current history - // result container. - char tmp[] = {aIDKey[0], aIDKey[1], '\0'}; - return atoi(tmp); - } - -+char DBusGetStateFromIDKey(const char* aIDKey) { -+ // ID is NN:S:URL where NN is index to our current history -+ // result container, and S is the state, which can be 'o'pen or 'h'istory -+ if (std::strlen(aIDKey) > 3) { -+ return aIDKey[3]; -+ } -+ // Should never happen, but just to avoid any possible segfault, we -+ // default to state 'history'. -+ return 'h'; -+} -+ - static void ConcatArray(nsACString& aOutputStr, const char** aStringArray) { - for (const char** term = aStringArray; *term; term++) { - aOutputStr.Append(*term); -@@ -151,6 +164,7 @@ static already_AddRefed DBusAp - aSearchResult->GetSearchResultContainer(); - - int index = DBusGetIndexFromIDKey(aID); -+ char state = DBusGetStateFromIDKey(aID); - nsCOMPtr child; - container->GetChild(index, getter_AddRefs(child)); - nsAutoCString title; -@@ -164,6 +178,12 @@ static already_AddRefed DBusAp - } - } - -+ // Check if the URI state is "open tab". If so, mark it with an asterisk to -+ // indicate this to the user. -+ if (state == 'o') { -+ title = "(*) "_ns + title; -+ } -+ - GVariantBuilder b; - g_variant_builder_init(&b, G_VARIANT_TYPE("a{sv}")); - -@@ -265,6 +285,7 @@ static void ActivateResultID( - ConstructCommandLine(std::size(urlList), urlList, nullptr, &tmp); - } else { - int keyIndex = atoi(aResultID); -+ char state = DBusGetStateFromIDKey(aResultID); - nsCOMPtr child; - aSearchResult->GetSearchResultContainer()->GetChild(keyIndex, - getter_AddRefs(child)); -@@ -278,6 +299,22 @@ static void ActivateResultID( - return; - } - -+ // If the state of the URI is 'o'pen, we send it along to JS and let -+ // it switch the tab accordingly -+ if (state == 'o') { -+ // If we can't successfully switch to an open tab, use the existing -+ // 'open in a new tab'-mechanism as a fallback. -+ nsresult rv; -+ nsCOMPtr provider = do_ImportESModule( -+ "resource:///modules/OpenTabsProvider.sys.mjs", &rv); -+ if (NS_SUCCEEDED(rv)) { -+ rv = provider->SwitchToOpenTab(uri); -+ if (NS_SUCCEEDED(rv)) { -+ return; -+ } -+ } -+ } -+ - const char* urlList[2] = {"unused", uri.get()}; - commandLine = - ConstructCommandLine(std::size(urlList), urlList, nullptr, &tmp); -diff -up firefox-131.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.D220671 firefox-131.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp ---- firefox-131.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp.D220671 2024-09-23 19:59:58.000000000 +0200 -+++ firefox-131.0/browser/components/shell/nsGNOMEShellSearchProvider.cpp 2024-09-25 08:55:09.197886449 +0200 -@@ -20,7 +20,8 @@ - #include "nsServiceManagerUtils.h" - #include "mozilla/GUniquePtr.h" - #include "mozilla/UniquePtrExtensions.h" -- -+#include "nsImportModule.h" -+#include "nsIOpenTabsProvider.h" - #include "imgIContainer.h" - #include "imgITools.h" - -@@ -70,7 +71,7 @@ class AsyncFaviconDataReady final : publ - int aIconIndex, int aTimeStamp) - : mSearchResult(std::move(aSearchResult)), - mIconIndex(aIconIndex), -- mTimeStamp(aTimeStamp) {}; -+ mTimeStamp(aTimeStamp) {} - - private: - ~AsyncFaviconDataReady() {} -@@ -412,10 +413,11 @@ nsresult nsGNOMEShellHistoryService::Que - } - - static void DBusGetIDKeyForURI(int aIndex, nsAutoCString& aUri, -- nsAutoCString& aIDKey) { -- // Compose ID as NN:URL where NN is index to our current history -- // result container. -- aIDKey = nsPrintfCString("%.2d:%s", aIndex, aUri.get()); -+ nsAutoCString& aIDKey, bool isOpen) { -+ // Compose ID as NN:S:URL where NN is index to our current history -+ // result container and S is the state, which can be 'o'pen or 'h'istory -+ aIDKey = -+ nsPrintfCString("%.2d:%c:%s", aIndex, isOpen ? 'o' : 'h', aUri.get()); - } - - // Send (as) rearch result reply -@@ -456,8 +458,15 @@ void nsGNOMEShellHistorySearchResult::Ha - new AsyncFaviconDataReady(this, i, mTimeStamp); - favIconSvc->GetFaviconDataForPage(iconIri, callback, 0); - -+ bool isOpen = false; -+ for (const auto& openuri : mOpenTabs) { -+ if (openuri.Equals(uri)) { -+ isOpen = true; -+ break; -+ } -+ } - nsAutoCString idKey; -- DBusGetIDKeyForURI(i, uri, idKey); -+ DBusGetIDKeyForURI(i, uri, idKey, isOpen); - - g_variant_builder_add(&b, "s", idKey.get()); - } -@@ -479,8 +488,30 @@ void nsGNOMEShellHistorySearchResult::Re - // latest requested search timestamp). - if (mSearchProvider->SetSearchResult(this)) { - mHistResultContainer = aHistResultContainer; -- HandleSearchResultReply(); - } -+ -+ // Getting the currently open tabs to mark them accordingly -+ nsresult rv; -+ nsCOMPtr provider = -+ do_ImportESModule("resource:///modules/OpenTabsProvider.sys.mjs", &rv); -+ if (NS_FAILED(rv)) { -+ // Don't fail, just log an error message -+ NS_WARNING("Failed to determine currently open tabs. Using history only."); -+ } -+ -+ nsTArray openTabs; -+ if (provider) { -+ rv = provider->GetOpenTabs(openTabs); -+ if (NS_FAILED(rv)) { -+ // Don't fail, just log an error message -+ NS_WARNING( -+ "Failed to determine currently open tabs. Using history only."); -+ } -+ } -+ // In case of error, we just clear out mOpenTabs with an empty new array -+ mOpenTabs = std::move(openTabs); -+ -+ HandleSearchResultReply(); - } - - void nsGNOMEShellHistorySearchResult::SetHistoryIcon(int aTimeStamp, -diff -up firefox-131.0/browser/components/shell/nsGNOMEShellSearchProvider.h.D220671 firefox-131.0/browser/components/shell/nsGNOMEShellSearchProvider.h ---- firefox-131.0/browser/components/shell/nsGNOMEShellSearchProvider.h.D220671 2024-09-23 19:59:58.000000000 +0200 -+++ firefox-131.0/browser/components/shell/nsGNOMEShellSearchProvider.h 2024-09-25 08:55:09.197886449 +0200 -@@ -23,7 +23,7 @@ class nsGNOMEShellSearchProvider; - - class GnomeHistoryIcon { - public: -- GnomeHistoryIcon() : mTimeStamp(-1), mWidth(0), mHeight(0) {}; -+ GnomeHistoryIcon() : mTimeStamp(-1), mWidth(0), mHeight(0) {} - - // From which search is this icon - void Set(int aTimeStamp, mozilla::UniquePtr aData, int aWidth, -@@ -58,7 +58,7 @@ class nsGNOMEShellHistorySearchResult : - GDBusConnection* aConnection, int aTimeStamp) - : mSearchProvider(aSearchProvider), - mConnection(aConnection), -- mTimeStamp(aTimeStamp) {}; -+ mTimeStamp(aTimeStamp) {} - - void SetReply(RefPtr aReply) { - mReply = std::move(aReply); -@@ -96,6 +96,7 @@ class nsGNOMEShellHistorySearchResult : - private: - nsGNOMEShellSearchProvider* mSearchProvider; - nsCOMPtr mHistResultContainer; -+ nsTArray mOpenTabs; - nsAutoCString mSearchTerm; - RefPtr mReply; - GDBusConnection* mConnection = nullptr; -diff -up firefox-131.0/browser/components/shell/nsIOpenTabsProvider.idl.D220671 firefox-131.0/browser/components/shell/nsIOpenTabsProvider.idl ---- firefox-131.0/browser/components/shell/nsIOpenTabsProvider.idl.D220671 2024-09-25 08:55:09.197886449 +0200 -+++ firefox-131.0/browser/components/shell/nsIOpenTabsProvider.idl 2024-09-25 08:55:09.197886449 +0200 -@@ -0,0 +1,19 @@ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+#include "nsISupports.idl" -+ -+[scriptable, uuid(46e3e300-a45a-45b0-ac68-016e9496bf98)] -+interface nsIOpenTabsProvider : nsISupports -+{ -+ /** -+ * List of currently open public tabs -+ */ -+ Array getOpenTabs(); -+ -+ /** -+ * Function to switch current tab to a given already open URL -+ */ -+ void switchToOpenTab(in AUTF8String url); -+}; -diff -up firefox-131.0/browser/components/shell/OpenTabsProvider.sys.mjs.D220671 firefox-131.0/browser/components/shell/OpenTabsProvider.sys.mjs ---- firefox-131.0/browser/components/shell/OpenTabsProvider.sys.mjs.D220671 2024-09-25 08:55:09.197886449 +0200 -+++ firefox-131.0/browser/components/shell/OpenTabsProvider.sys.mjs 2024-09-25 08:55:09.197886449 +0200 -@@ -0,0 +1,22 @@ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+const lazy = {}; -+ -+ChromeUtils.defineESModuleGetters(lazy, { -+ BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.sys.mjs", -+ UrlbarProviderOpenTabs: "resource:///modules/UrlbarProviderOpenTabs.sys.mjs", -+}); -+ -+export function getOpenTabs() { -+ // We only want public tabs, so isInPrivateWindow = false -+ let urls = lazy.UrlbarProviderOpenTabs.getOpenTabUrls(false); -+ return Array.from(urls.keys()); -+} -+ -+export function switchToOpenTab(url) { -+ // We only want public tabs, so skip private top windows -+ let win = lazy.BrowserWindowTracker.getTopWindow({ private: false }); -+ win?.switchToTabHavingURI(url); -+} diff --git a/D221617.1729589907.diff b/D221617.1729589907.diff deleted file mode 100644 index 1b1718d..0000000 --- a/D221617.1729589907.diff +++ /dev/null @@ -1,123 +0,0 @@ -diff --git a/widget/gtk/mozwayland/mozwayland.h b/widget/gtk/mozwayland/mozwayland.h ---- a/widget/gtk/mozwayland/mozwayland.h -+++ b/widget/gtk/mozwayland/mozwayland.h -@@ -41,10 +41,14 @@ - - #ifndef WL_MARSHAL_FLAG_DESTROY - # define WL_MARSHAL_FLAG_DESTROY (1 << 0) - #endif - -+#ifndef WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION -+# define WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION 4 -+#endif -+ - /* We need implement some missing functions from wayland-client-protocol.h - */ - #ifndef WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM - enum wl_data_device_manager_dnd_action { - WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE = 0, -@@ -133,10 +137,14 @@ - wl_proxy_marshal((struct wl_proxy*)wl_surface, WL_SURFACE_DAMAGE_BUFFER, x, y, - width, height); - } - #endif - -+#ifndef WL_POINTER_RELEASE_SINCE_VERSION -+# define WL_POINTER_RELEASE_SINCE_VERSION 3 -+#endif -+ - #ifndef WL_POINTER_AXIS_ENUM - # define WL_POINTER_AXIS_ENUM - /** - * @ingroup iface_wl_pointer - * axis types -diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp ---- a/widget/gtk/nsWaylandDisplay.cpp -+++ b/widget/gtk/nsWaylandDisplay.cpp -@@ -142,11 +142,12 @@ - pointer_handle_axis_source, pointer_handle_axis_stop, - pointer_handle_axis_discrete, pointer_handle_axis_value120, - }; - - void nsWaylandDisplay::SetPointer(wl_pointer* aPointer) { -- if (!mPointerGestures) { -+ if (!mPointerGestures || wl_proxy_get_version((struct wl_proxy*)aPointer) < -+ WL_POINTER_RELEASE_SINCE_VERSION) { - return; - } - MOZ_DIAGNOSTIC_ASSERT(!mPointer); - mPointer = aPointer; - wl_pointer_add_listener(mPointer, -@@ -183,12 +184,18 @@ - } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && keyboard) { - display->ClearKeyboard(); - } - } - -+static void seat_handle_name(void* data, struct wl_seat* seat, -+ const char* name) { -+ /* We don't care about the name. */ -+} -+ - static const struct wl_seat_listener seat_listener = { - seat_handle_capabilities, -+ seat_handle_name, - }; - - void nsWaylandDisplay::SetSeat(wl_seat* aSeat, int aSeatId) { - mSeat = aSeat; - mSeatId = aSeatId; -@@ -320,14 +327,13 @@ - } else if (iface.EqualsLiteral("zwp_pointer_constraints_v1")) { - auto* pointer_constraints = WaylandRegistryBind( - registry, id, &zwp_pointer_constraints_v1_interface, 1); - display->SetPointerConstraints(pointer_constraints); - } else if (iface.EqualsLiteral("wl_compositor")) { -- // Requested wl_compositor version 4 as we need -- // wl_surface_damage_buffer(). - auto* compositor = WaylandRegistryBind( -- registry, id, &wl_compositor_interface, 4); -+ registry, id, &wl_compositor_interface, -+ WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION); - display->SetCompositor(compositor); - } else if (iface.EqualsLiteral("wl_subcompositor")) { - auto* subcompositor = WaylandRegistryBind( - registry, id, &wl_subcompositor_interface, 1); - display->SetSubcompositor(subcompositor); -@@ -347,25 +353,29 @@ - auto* annotationManager = - WaylandRegistryBind( - registry, id, &xdg_dbus_annotation_manager_v1_interface, 1); - display->SetXdgDbusAnnotationManager(annotationManager); - } else if (iface.EqualsLiteral("wl_seat")) { -- auto* seat = -- WaylandRegistryBind(registry, id, &wl_seat_interface, 1); -- display->SetSeat(seat, id); -+ auto* seat = WaylandRegistryBind(registry, id, &wl_seat_interface, -+ WL_POINTER_RELEASE_SINCE_VERSION); -+ if (seat) { -+ display->SetSeat(seat, id); -+ } - } else if (iface.EqualsLiteral("wp_fractional_scale_manager_v1")) { - auto* manager = WaylandRegistryBind( - registry, id, &wp_fractional_scale_manager_v1_interface, 1); - display->SetFractionalScaleManager(manager); - } else if (iface.EqualsLiteral("gtk_primary_selection_device_manager") || - iface.EqualsLiteral("zwp_primary_selection_device_manager_v1")) { - display->EnablePrimarySelection(); - } else if (iface.EqualsLiteral("zwp_pointer_gestures_v1")) { -- // HOLD is introduced in version 3 - auto* gestures = WaylandRegistryBind( -- registry, id, &zwp_pointer_gestures_v1_interface, 3); -- display->SetPointerGestures(gestures); -+ registry, id, &zwp_pointer_gestures_v1_interface, -+ ZWP_POINTER_GESTURES_V1_GET_HOLD_GESTURE_SINCE_VERSION); -+ if (gestures) { -+ display->SetPointerGestures(gestures); -+ } - } - } - - static void global_registry_remover(void* data, wl_registry* registry, - uint32_t id) { - diff --git a/D221931.1729587190.diff b/D221931.1729587190.diff deleted file mode 100644 index 3fcaea6..0000000 --- a/D221931.1729587190.diff +++ /dev/null @@ -1,80 +0,0 @@ -diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp ---- a/widget/gtk/nsWaylandDisplay.cpp -+++ b/widget/gtk/nsWaylandDisplay.cpp -@@ -56,38 +56,48 @@ - return gWaylandDisplay; - } - - void nsWaylandDisplay::SetShm(wl_shm* aShm) { mShm = aShm; } - --struct PointerState { -- wl_surface* surface; -- -+class EventSurface { -+ public: - nsWindow* GetWindow() { -+ if (!surface) { -+ return nullptr; -+ } - GdkWindow* window = - static_cast(wl_surface_get_user_data(surface)); - return window ? static_cast( - g_object_get_data(G_OBJECT(window), "nsWindow")) - : nullptr; - } --} sPointerState; -+ void Set(wl_surface* aSurface) { surface = aSurface; } -+ void Clear() { surface = nullptr; } -+ -+ private: -+ wl_surface* surface = nullptr; -+}; -+ -+static EventSurface sTouchSurface; - - static void gesture_hold_begin(void* data, - struct zwp_pointer_gesture_hold_v1* hold, - uint32_t serial, uint32_t time, - struct wl_surface* surface, uint32_t fingers) { -- RefPtr window = sPointerState.GetWindow(); -+ sTouchSurface.Set(surface); -+ RefPtr window = sTouchSurface.GetWindow(); - if (!window) { - return; - } - window->OnTouchpadHoldEvent(GDK_TOUCHPAD_GESTURE_PHASE_BEGIN, time, fingers); - } - - static void gesture_hold_end(void* data, - struct zwp_pointer_gesture_hold_v1* hold, - uint32_t serial, uint32_t time, - int32_t cancelled) { -- RefPtr window = sPointerState.GetWindow(); -+ RefPtr window = sTouchSurface.GetWindow(); - if (!window) { - return; - } - window->OnTouchpadHoldEvent(cancelled ? GDK_TOUCHPAD_GESTURE_PHASE_CANCEL - : GDK_TOUCHPAD_GESTURE_PHASE_END, -@@ -97,18 +107,14 @@ - static const struct zwp_pointer_gesture_hold_v1_listener gesture_hold_listener = - {gesture_hold_begin, gesture_hold_end}; - - static void pointer_handle_enter(void* data, struct wl_pointer* pointer, - uint32_t serial, struct wl_surface* surface, -- wl_fixed_t sx, wl_fixed_t sy) { -- sPointerState.surface = surface; --} -+ wl_fixed_t sx, wl_fixed_t sy) {} - - static void pointer_handle_leave(void* data, struct wl_pointer* pointer, -- uint32_t serial, struct wl_surface* surface) { -- sPointerState.surface = nullptr; --} -+ uint32_t serial, struct wl_surface* surface) {} - - static void pointer_handle_motion(void* data, struct wl_pointer* pointer, - uint32_t time, wl_fixed_t sx, wl_fixed_t sy) { - } - - diff --git a/D222280.1729587199.diff b/D222280.1729587199.diff deleted file mode 100644 index a48f729..0000000 --- a/D222280.1729587199.diff +++ /dev/null @@ -1,65 +0,0 @@ -diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp ---- a/widget/gtk/nsWaylandDisplay.cpp -+++ b/widget/gtk/nsWaylandDisplay.cpp -@@ -56,48 +56,44 @@ - return gWaylandDisplay; - } - - void nsWaylandDisplay::SetShm(wl_shm* aShm) { mShm = aShm; } - --class EventSurface { -+class TouchWindow { - public: -- nsWindow* GetWindow() { -- if (!surface) { -- return nullptr; -- } -+ already_AddRefed GetAndClearWindow() { return mWindow.forget(); } -+ RefPtr TakeWindow(wl_surface* aSurface) { - GdkWindow* window = -- static_cast(wl_surface_get_user_data(surface)); -- return window ? static_cast( -- g_object_get_data(G_OBJECT(window), "nsWindow")) -- : nullptr; -+ static_cast(wl_surface_get_user_data(aSurface)); -+ mWindow = window ? static_cast( -+ g_object_get_data(G_OBJECT(window), "nsWindow")) -+ : nullptr; -+ return mWindow; - } -- void Set(wl_surface* aSurface) { surface = aSurface; } -- void Clear() { surface = nullptr; } - - private: -- wl_surface* surface = nullptr; -+ StaticRefPtr mWindow; - }; - --static EventSurface sTouchSurface; -+static TouchWindow sTouchWindow; - - static void gesture_hold_begin(void* data, - struct zwp_pointer_gesture_hold_v1* hold, - uint32_t serial, uint32_t time, - struct wl_surface* surface, uint32_t fingers) { -- sTouchSurface.Set(surface); -- RefPtr window = sTouchSurface.GetWindow(); -+ RefPtr window = sTouchWindow.TakeWindow(surface); - if (!window) { - return; - } - window->OnTouchpadHoldEvent(GDK_TOUCHPAD_GESTURE_PHASE_BEGIN, time, fingers); - } - - static void gesture_hold_end(void* data, - struct zwp_pointer_gesture_hold_v1* hold, - uint32_t serial, uint32_t time, - int32_t cancelled) { -- RefPtr window = sTouchSurface.GetWindow(); -+ RefPtr window = sTouchWindow.GetAndClearWindow(); - if (!window) { - return; - } - window->OnTouchpadHoldEvent(cancelled ? GDK_TOUCHPAD_GESTURE_PHASE_CANCEL - : GDK_TOUCHPAD_GESTURE_PHASE_END, - diff --git a/D222363.1729589473.diff b/D222363.1729589473.diff deleted file mode 100644 index bf25ebf..0000000 --- a/D222363.1729589473.diff +++ /dev/null @@ -1,73 +0,0 @@ -diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp ---- a/widget/gtk/nsWaylandDisplay.cpp -+++ b/widget/gtk/nsWaylandDisplay.cpp -@@ -328,11 +328,12 @@ - display->SetRelativePointerManager(relative_pointer_manager); - } else if (iface.EqualsLiteral("zwp_pointer_constraints_v1")) { - auto* pointer_constraints = WaylandRegistryBind( - registry, id, &zwp_pointer_constraints_v1_interface, 1); - display->SetPointerConstraints(pointer_constraints); -- } else if (iface.EqualsLiteral("wl_compositor")) { -+ } else if (iface.EqualsLiteral("wl_compositor") && -+ version >= WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION) { - auto* compositor = WaylandRegistryBind( - registry, id, &wl_compositor_interface, - WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION); - display->SetCompositor(compositor); - } else if (iface.EqualsLiteral("wl_subcompositor")) { -@@ -341,43 +342,44 @@ - display->SetSubcompositor(subcompositor); - } else if (iface.EqualsLiteral("wp_viewporter")) { - auto* viewporter = WaylandRegistryBind( - registry, id, &wp_viewporter_interface, 1); - display->SetViewporter(viewporter); -- } else if (iface.EqualsLiteral("zwp_linux_dmabuf_v1") && version > 2) { -+ } else if (iface.EqualsLiteral("zwp_linux_dmabuf_v1") && -+ version >= ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION) { - auto* dmabuf = WaylandRegistryBind( -- registry, id, &zwp_linux_dmabuf_v1_interface, 3); -+ registry, id, &zwp_linux_dmabuf_v1_interface, -+ ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION); - display->SetDmabuf(dmabuf); - } else if (iface.EqualsLiteral("xdg_activation_v1")) { - auto* activation = WaylandRegistryBind( - registry, id, &xdg_activation_v1_interface, 1); - display->SetXdgActivation(activation); - } else if (iface.EqualsLiteral("xdg_dbus_annotation_manager_v1")) { - auto* annotationManager = - WaylandRegistryBind( - registry, id, &xdg_dbus_annotation_manager_v1_interface, 1); - display->SetXdgDbusAnnotationManager(annotationManager); -- } else if (iface.EqualsLiteral("wl_seat")) { -+ } else if (iface.EqualsLiteral("wl_seat") && -+ version >= WL_POINTER_RELEASE_SINCE_VERSION) { - auto* seat = WaylandRegistryBind(registry, id, &wl_seat_interface, - WL_POINTER_RELEASE_SINCE_VERSION); -- if (seat) { -- display->SetSeat(seat, id); -- } -+ display->SetSeat(seat, id); - } else if (iface.EqualsLiteral("wp_fractional_scale_manager_v1")) { - auto* manager = WaylandRegistryBind( - registry, id, &wp_fractional_scale_manager_v1_interface, 1); - display->SetFractionalScaleManager(manager); - } else if (iface.EqualsLiteral("gtk_primary_selection_device_manager") || - iface.EqualsLiteral("zwp_primary_selection_device_manager_v1")) { - display->EnablePrimarySelection(); -- } else if (iface.EqualsLiteral("zwp_pointer_gestures_v1")) { -+ } else if (iface.EqualsLiteral("zwp_pointer_gestures_v1") && -+ version >= -+ ZWP_POINTER_GESTURES_V1_GET_HOLD_GESTURE_SINCE_VERSION) { - auto* gestures = WaylandRegistryBind( - registry, id, &zwp_pointer_gestures_v1_interface, - ZWP_POINTER_GESTURES_V1_GET_HOLD_GESTURE_SINCE_VERSION); -- if (gestures) { -- display->SetPointerGestures(gestures); -- } -+ display->SetPointerGestures(gestures); - } - } - - static void global_registry_remover(void* data, wl_registry* registry, - uint32_t id) { - diff --git a/D223313.1729587212.diff b/D223313.1729587212.diff deleted file mode 100644 index 74fcb77..0000000 --- a/D223313.1729587212.diff +++ /dev/null @@ -1,29 +0,0 @@ -diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp ---- a/widget/gtk/nsWaylandDisplay.cpp -+++ b/widget/gtk/nsWaylandDisplay.cpp -@@ -60,15 +60,19 @@ - - class TouchWindow { - public: - already_AddRefed GetAndClearWindow() { return mWindow.forget(); } - RefPtr TakeWindow(wl_surface* aSurface) { -- GdkWindow* window = -- static_cast(wl_surface_get_user_data(aSurface)); -- mWindow = window ? static_cast( -- g_object_get_data(G_OBJECT(window), "nsWindow")) -- : nullptr; -+ if (!aSurface) { -+ mWindow = nullptr; -+ } else { -+ GdkWindow* window = -+ static_cast(wl_surface_get_user_data(aSurface)); -+ mWindow = window ? static_cast( -+ g_object_get_data(G_OBJECT(window), "nsWindow")) -+ : nullptr; -+ } - return mWindow; - } - - private: - StaticRefPtr mWindow; - diff --git a/D224089.patch b/D224089.patch deleted file mode 100644 index b1609af..0000000 --- a/D224089.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/browser/components/shell/nsGNOMEShellSearchProvider.cpp b/browser/components/shell/nsGNOMEShellSearchProvider.cpp ---- a/browser/components/shell/nsGNOMEShellSearchProvider.cpp -+++ b/browser/components/shell/nsGNOMEShellSearchProvider.cpp -@@ -421,10 +421,11 @@ - } - - // Send (as) rearch result reply - void nsGNOMEShellHistorySearchResult::HandleSearchResultReply() { - MOZ_ASSERT(mReply); -+ MOZ_ASSERT(mHistResultContainer); - - GVariantBuilder b; - g_variant_builder_init(&b, G_VARIANT_TYPE("as")); - - uint32_t childCount = 0; -@@ -484,14 +485,16 @@ - void nsGNOMEShellHistorySearchResult::ReceiveSearchResultContainer( - nsCOMPtr aHistResultContainer) { - // Propagate search results to nsGNOMEShellSearchProvider. - // SetSearchResult() checks this is up-to-date search (our time stamp matches - // latest requested search timestamp). -- if (mSearchProvider->SetSearchResult(this)) { -- mHistResultContainer = aHistResultContainer; -+ if (!mSearchProvider->SetSearchResult(this)) { -+ return; - } - -+ mHistResultContainer = aHistResultContainer; -+ - // Getting the currently open tabs to mark them accordingly - nsresult rv; - nsCOMPtr provider = - do_ImportESModule("resource:///modules/OpenTabsProvider.sys.mjs", &rv); - if (NS_FAILED(rv)) { - diff --git a/firefox.spec b/firefox.spec index 38398de..253857b 100644 --- a/firefox.spec +++ b/firefox.spec @@ -199,14 +199,14 @@ ExcludeArch: ppc64le Summary: Mozilla Firefox Web browser Name: firefox -Version: 131.0.3 -Release: 3%{?pre_tag}%{?dist} +Version: 132.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20241015.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20241023.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -290,39 +290,13 @@ Patch421: D209911.1715685535.diff Patch422: D210158.1715685536.diff Patch423: D210159.1715685538.diff Patch424: D210430.1715848796.diff -Patch425: D220671.patch -Patch426: D224089.patch -Patch430: D220551.1729586452.diff -Patch431: D221617.1729589907.diff -Patch432: D221931.1729587190.diff -Patch433: D222280.1729587199.diff -Patch434: D222363.1729589473.diff -Patch435: D223313.1729587212.diff Patch436: D223285.1729586039.diff Patch437: D224842.1729586219.diff Patch438: D225439.1729586066.diff Patch439: D225760.1729586239.diff Patch440: D225868.1729586247.diff -# PipeWire camera upstream patches -# https://phabricator.services.mozilla.com/D219224 -# Part of Firefox 131 -Patch500: libwebrtc-pipewire-camera-filter-out-devices-with-no-capabilities.patch -# Part of Firefox 132 -# https://phabricator.services.mozilla.com/D219062 -Patch501: pipewire-camera-always-query-information-about-camera-availability.patch -# https://phabricator.services.mozilla.com/D219060 -Patch502: pipewire-camera-always-register-video-input-feedback-for-newly-created-deviceinfo.patch -# https://phabricator.services.mozilla.com/D220895 -Patch503: libwebrtc-pipewire-camera-make-member-variable-with-pipewire-status-updated.patch -# https://phabricator.services.mozilla.com/D219218 -Patch504: pipewire-camera-add-missing-support-for-device-change-notification.patch -# https://phabricator.services.mozilla.com/D223112 -Patch505: libwebrtc-pipewire-camera-get-max-fps-for-each-format-when-specified-as-list.patch -# https://phabricator.services.mozilla.com/D223112 -Patch506: libwebrtc-pipewire-camera-use-exact-stream-parameters-specified-by-capability.patch - # PGO/LTO patches Patch600: pgo.patch Patch602: mozilla-1516803.patch @@ -625,16 +599,7 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch -P402 -p1 -b .1196777 %patch -P407 -p1 -b .1667096 -%patch -P425 -p1 -b .D220671 -%patch -P426 -p1 -b .D224089 - %if 0%{?fedora} > 40 -%patch -P430 -p1 -b .D220551 -%patch -P431 -p1 -b .D221617 -%patch -P432 -p1 -b .D221931 -%patch -P433 -p1 -b .D222280 -%patch -P434 -p1 -b .D222363 -%patch -P435 -p1 -b .D223285 %patch -P436 -p1 -b .D223313 %patch -P437 -p1 -b .D224842 %patch -P438 -p1 -b .D225439 @@ -642,14 +607,6 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch -P440 -p1 -b .D225868 %endif -%patch -P500 -p1 -b .filter-out-devices-with-no-capabilities -%patch -P501 -p1 -b .always-query-information-about-camera-availability -%patch -P502 -p1 -b .always-register-video-input-feedback-for-newly-created-deviceinfo -%patch -P503 -p1 -b .make-member-variable-with-pipewire-status-updated -%patch -P504 -p1 -b .add-missing-support-for-device-change-notification -%patch -P505 -p1 -b .get-max-fps-for-each-format-when-specified-as-list -%patch -P506 -p1 -b .use-exact-stream-parameters-specified-by-capability - # PGO patches %if %{build_with_pgo} %if !%{build_with_clang} @@ -1280,6 +1237,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Oct 23 2024 Martin Stransky - 132.0-1 +- Updated to 132.0 + * Mon Oct 21 2024 Martin Stransky - 131.0.3-3 - Backported hi-res mouse scrolling and hold touchpad gesture support for Fedora 41 diff --git a/rhbz-1173156.patch b/rhbz-1173156.patch index c35d901..067b561 100644 --- a/rhbz-1173156.patch +++ b/rhbz-1173156.patch @@ -1,12 +1,12 @@ -diff -up firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp.rhbz-1173156 firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp ---- firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp.rhbz-1173156 2019-01-22 10:36:09.284069020 +0100 -+++ firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp 2019-01-22 10:37:12.669757744 +0100 -@@ -161,7 +161,7 @@ nsresult nsAuthSambaNTLM::SpawnNTLMAuthH - const char* username = PR_GetEnv("USER"); - if (!username) return NS_ERROR_FAILURE; +diff -up firefox-132.0/extensions/auth/nsAuthSambaNTLM.cpp.rhbz-1173156 firefox-132.0/extensions/auth/nsAuthSambaNTLM.cpp +--- firefox-132.0/extensions/auth/nsAuthSambaNTLM.cpp.rhbz-1173156 2024-10-23 09:26:41.433895188 +0200 ++++ firefox-132.0/extensions/auth/nsAuthSambaNTLM.cpp 2024-10-23 10:05:11.025801336 +0200 +@@ -153,7 +153,7 @@ nsresult nsAuthSambaNTLM::SpawnNTLMAuthH + options.fds_to_remap.push_back( + std::pair{fromChildPipeWrite.get(), STDOUT_FILENO}); + +- std::vector argvVec{"ntlm_auth", "--helper-protocol", ++ std::vector argvVec{"/usr/bin/ntlm_auth", "--helper-protocol", + "ntlmssp-client-1", "--use-cached-creds", + "--username", username}; -- const char* const args[] = {"ntlm_auth", -+ const char* const args[] = {"/usr/bin/ntlm_auth", - "--helper-protocol", - "ntlmssp-client-1", - "--use-cached-creds", diff --git a/wasi.patch b/wasi.patch index 119e795..748c29a 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-131.0.3/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-132.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From d8c658443873ff6c7ff59aba836b9da7ba5eb13c Mon Sep 17 00:00:00 2001 From: Andrew Lukoshko Date: Sat, 24 Aug 2024 13:44:47 +0200 Subject: [PATCH 405/545] Generate distribution.ini using /etc/os-release values This allows to unify source for Fedora/RHEL/CS and generate correct distribution.ini according to build target. Currently this file is static and different for Fedora and RHEL/CS. --- distribution.ini | 9 --------- distribution.ini.in | 9 +++++++++ firefox.spec | 8 ++++++-- 3 files changed, 15 insertions(+), 11 deletions(-) delete mode 100644 distribution.ini create mode 100644 distribution.ini.in diff --git a/distribution.ini b/distribution.ini deleted file mode 100644 index 11f1f96..0000000 --- a/distribution.ini +++ /dev/null @@ -1,9 +0,0 @@ -[Global] -id=fedora -version=1.0 -about=Mozilla Firefox for Fedora - -[Preferences] -app.distributor=fedora -app.distributor.channel=fedora -app.partner.fedora=fedora diff --git a/distribution.ini.in b/distribution.ini.in new file mode 100644 index 0000000..0eaacc7 --- /dev/null +++ b/distribution.ini.in @@ -0,0 +1,9 @@ +[Global] +id=__ID__ +version=1.0 +about=Mozilla Firefox for __NAME__ + +[Preferences] +app.distributor=__ID__ +app.distributor.channel=__ID__ +app.partner.fedora=__ID__ diff --git a/firefox.spec b/firefox.spec index 253857b..63e579c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -217,7 +217,7 @@ Source21: firefox.sh.in Source23: firefox.1 Source24: mozilla-api-key Source25: firefox-symbolic.svg -Source26: distribution.ini +Source26: distribution.ini.in Source27: google-api-key Source28: firefox-wayland.sh.in Source29: firefox-wayland.desktop @@ -1097,7 +1097,11 @@ echo 'pref("media.webrtc.camera.allow-pipewire", true);' >> %{buildroot}%{mozapp # Add distribution.ini mkdir -p %{buildroot}%{mozappdir}/distribution -cp %{SOURCE26} %{buildroot}%{mozappdir}/distribution +sed -e "s/__NAME__/%(source /etc/os-release; echo ${NAME})/" \ + -e "s/__ID__/%(source /etc/os-release; echo ${ID})/" \ + -e "s/rhel/redhat/" \ + -e "s/Fedora.*/Fedora/" \ + %{SOURCE26} > %{buildroot}%{mozappdir}/distribution/distribution.ini # Install appdata file mkdir -p %{buildroot}%{_datadir}/metainfo From 06068c9b429bd24c147d7c0056514f5251264a95 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 23 Oct 2024 13:39:06 +0200 Subject: [PATCH 406/545] uploaded sources --- .gitignore | 2 ++ sources | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ece73d2..4b732ed 100644 --- a/.gitignore +++ b/.gitignore @@ -664,3 +664,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-131.0.2-20241009.tar.xz /firefox-131.0.3.source.tar.xz /firefox-langpacks-131.0.3-20241015.tar.xz +/firefox-132.0.source.tar.xz +/firefox-langpacks-132.0-20241023.tar.xz diff --git a/sources b/sources index f9a40c8..7f30e95 100644 --- a/sources +++ b/sources @@ -2,5 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a -SHA512 (firefox-131.0.3.source.tar.xz) = 3aa96db839f7a45e34c43b5e7e3333e1100ca11545ad26a8e42987fbc72df5ae7ebebe7dfc8c4e856d2bb4676c0516914a07c001f6047799f314146a3329c0ce -SHA512 (firefox-langpacks-131.0.3-20241015.tar.xz) = 7f76e91402f69fa2141566109a7296eaabde531f7963c9ad017d5e5a54dfbc506bda2dbba86955c8a7ba7867953a5402242adb9fa7ced2e1a2ed482316f99a2d +SHA512 (firefox-132.0.source.tar.xz) = 254ffba16d6e6c61cffaa8131f81a9a78880e5723b7ee78ac36251a27d82e6ff088238ae289d07469ba3a51b5b5969a08ecd1fc02dcb4d93325a08fac1cfc916 +SHA512 (firefox-langpacks-132.0-20241023.tar.xz) = 0568f7ae41c597ba52cb720f12ec8f040d5d8211c19423d2efde283e9e9ad64ced6dc021fcc1965f564d88fca0fd9779db9d2e50e7234ec0c103a8f76fc81ca5 From afe48a021c9bf591eb3f114dca2392cf83bb6148 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 24 Oct 2024 08:44:46 +0200 Subject: [PATCH 407/545] Updated NSS version --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 253857b..6dd2951 100644 --- a/firefox.spec +++ b/firefox.spec @@ -155,7 +155,7 @@ ExcludeArch: ppc64le %if %{?system_nss} %global nspr_version 4.32 %global nspr_build_version %{nspr_version} -%global nss_version 3.102 +%global nss_version 3.105 %global nss_build_version %{nss_version} %endif From 3e87328081ff6185b2ea61e625eaa79d8486bd11 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 25 Oct 2024 13:15:07 +0200 Subject: [PATCH 408/545] Enabled PGO on x86_64 --- firefox.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index 6dd2951..4c7b303 100644 --- a/firefox.spec +++ b/firefox.spec @@ -106,7 +106,7 @@ ExcludeArch: ppc64le %global build_with_pgo 0 %ifarch x86_64 %if %{release_build} -%global build_with_pgo 0 +%global build_with_pgo 1 %endif %endif %if 0%{?flatpak} @@ -200,7 +200,7 @@ ExcludeArch: ppc64le Summary: Mozilla Firefox Web browser Name: firefox Version: 132.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -1237,6 +1237,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Oct 25 2024 Martin Stransky - 132.0-2 +- Enabled PGO + * Wed Oct 23 2024 Martin Stransky - 132.0-1 - Updated to 132.0 From 2223db9e0fdf33a3742697805b3e5a25b99462d1 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 5 Nov 2024 16:30:15 +0100 Subject: [PATCH 409/545] Updated to 132.0.1 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- wasi.patch | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 4b732ed..b6e4cca 100644 --- a/.gitignore +++ b/.gitignore @@ -666,3 +666,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-131.0.3-20241015.tar.xz /firefox-132.0.source.tar.xz /firefox-langpacks-132.0-20241023.tar.xz +/firefox-132.0.1.source.tar.xz +/firefox-langpacks-132.0.1-20241105.tar.xz diff --git a/firefox.spec b/firefox.spec index 4c7b303..712265c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -199,14 +199,14 @@ ExcludeArch: ppc64le Summary: Mozilla Firefox Web browser Name: firefox -Version: 132.0 -Release: 2%{?pre_tag}%{?dist} +Version: 132.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20241023.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20241105.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1237,6 +1237,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Nov 05 2024 Martin Stransky - 132.0.1-1 +- Updated to 132.0.1 + * Fri Oct 25 2024 Martin Stransky - 132.0-2 - Enabled PGO diff --git a/sources b/sources index 7f30e95..72e20b0 100644 --- a/sources +++ b/sources @@ -2,5 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a -SHA512 (firefox-132.0.source.tar.xz) = 254ffba16d6e6c61cffaa8131f81a9a78880e5723b7ee78ac36251a27d82e6ff088238ae289d07469ba3a51b5b5969a08ecd1fc02dcb4d93325a08fac1cfc916 -SHA512 (firefox-langpacks-132.0-20241023.tar.xz) = 0568f7ae41c597ba52cb720f12ec8f040d5d8211c19423d2efde283e9e9ad64ced6dc021fcc1965f564d88fca0fd9779db9d2e50e7234ec0c103a8f76fc81ca5 +SHA512 (firefox-132.0.1.source.tar.xz) = 10d5b05f61628deb9a69cb34b2cf3c75bb6b8768f5a718cef2157d5feb1671ede0d583439562e1c1221914eb6ed37fdf415dd651b1465c056be174136cd80b9d +SHA512 (firefox-langpacks-132.0.1-20241105.tar.xz) = fa93df0a89f5176fc01638a429833886b133f68d55855c55b46efae9de7656193bb16c6ab2fa3b2aa8cf9570d0d7005c5754aa4a130cddf1af1b49e6f52a615e diff --git a/wasi.patch b/wasi.patch index 748c29a..bba8a86 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-132.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-132.0.1-build/firefox-132.0.1/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From c7bc0f02ea8b0c089f49aecacd874501b0eb38ea Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Thu, 7 Nov 2024 14:23:04 +0100 Subject: [PATCH 410/545] PipeWire camera: use better unique device name for camera devices --- firefox.spec | 10 +- ...ter-out-devices-with-no-capabilities.patch | 249 -------------- ...r-each-format-when-specified-as-list.patch | 31 -- ...ariable-with-pipewire-status-updated.patch | 16 - ...nique-device-name-for-camera-devices.patch | 37 +++ ...m-parameters-specified-by-capability.patch | 137 -------- ...pport-for-device-change-notification.patch | 173 ---------- ...nformation-about-camera-availability.patch | 42 --- ...eedback-for-newly-created-deviceinfo.patch | 306 ------------------ 9 files changed, 46 insertions(+), 955 deletions(-) delete mode 100644 libwebrtc-pipewire-camera-filter-out-devices-with-no-capabilities.patch delete mode 100644 libwebrtc-pipewire-camera-get-max-fps-for-each-format-when-specified-as-list.patch delete mode 100644 libwebrtc-pipewire-camera-make-member-variable-with-pipewire-status-updated.patch create mode 100644 libwebrtc-pipewire-camera-use-better-unique-device-name-for-camera-devices.patch delete mode 100644 libwebrtc-pipewire-camera-use-exact-stream-parameters-specified-by-capability.patch delete mode 100644 pipewire-camera-add-missing-support-for-device-change-notification.patch delete mode 100644 pipewire-camera-always-query-information-about-camera-availability.patch delete mode 100644 pipewire-camera-always-register-video-input-feedback-for-newly-created-deviceinfo.patch diff --git a/firefox.spec b/firefox.spec index 712265c..1ba4a03 100644 --- a/firefox.spec +++ b/firefox.spec @@ -200,7 +200,7 @@ ExcludeArch: ppc64le Summary: Mozilla Firefox Web browser Name: firefox Version: 132.0.1 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -297,6 +297,10 @@ Patch438: D225439.1729586066.diff Patch439: D225760.1729586239.diff Patch440: D225868.1729586247.diff +# WebRTC/PipeWire camera patches +# https://phabricator.services.mozilla.com/D228635 +Patch450: libwebrtc-pipewire-camera-use-better-unique-device-name-for-camera-devices.patch + # PGO/LTO patches Patch600: pgo.patch Patch602: mozilla-1516803.patch @@ -605,6 +609,7 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch -P438 -p1 -b .D225439 %patch -P439 -p1 -b .D225760 %patch -P440 -p1 -b .D225868 +%patch -P450 -p1 -b .libwebrtc-pipewire-camera-use-better-unique-device-name-for-camera-devices %endif # PGO patches @@ -1237,6 +1242,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Nov 07 2024 Jan Grulich - 132.0.1-2 +- PipeWire camera: use better unique device name for camera devices + * Tue Nov 05 2024 Martin Stransky - 132.0.1-1 - Updated to 132.0.1 diff --git a/libwebrtc-pipewire-camera-filter-out-devices-with-no-capabilities.patch b/libwebrtc-pipewire-camera-filter-out-devices-with-no-capabilities.patch deleted file mode 100644 index 8ce30b5..0000000 --- a/libwebrtc-pipewire-camera-filter-out-devices-with-no-capabilities.patch +++ /dev/null @@ -1,249 +0,0 @@ -diff --git a/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc b/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc ---- a/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc -+++ b/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc -@@ -55,50 +55,50 @@ - RTC_CHECK(pipewire_session_); - - if (deviceNumber >= NumberOfDevices()) - return -1; - -- const PipeWireNode& node = pipewire_session_->nodes().at(deviceNumber); -+ const auto& node = pipewire_session_->nodes().at(deviceNumber); - -- if (deviceNameLength <= node.display_name().length()) { -+ if (deviceNameLength <= node->display_name().length()) { - RTC_LOG(LS_INFO) << "deviceNameUTF8 buffer passed is too small"; - return -1; - } -- if (deviceUniqueIdUTF8Length <= node.unique_id().length()) { -+ if (deviceUniqueIdUTF8Length <= node->unique_id().length()) { - RTC_LOG(LS_INFO) << "deviceUniqueIdUTF8 buffer passed is too small"; - return -1; - } - if (productUniqueIdUTF8 && -- productUniqueIdUTF8Length <= node.model_id().length()) { -+ productUniqueIdUTF8Length <= node->model_id().length()) { - RTC_LOG(LS_INFO) << "productUniqueIdUTF8 buffer passed is too small"; - return -1; - } - - memset(deviceNameUTF8, 0, deviceNameLength); -- node.display_name().copy(deviceNameUTF8, deviceNameLength); -+ node->display_name().copy(deviceNameUTF8, deviceNameLength); - - memset(deviceUniqueIdUTF8, 0, deviceUniqueIdUTF8Length); -- node.unique_id().copy(deviceUniqueIdUTF8, deviceUniqueIdUTF8Length); -+ node->unique_id().copy(deviceUniqueIdUTF8, deviceUniqueIdUTF8Length); - - if (productUniqueIdUTF8) { - memset(productUniqueIdUTF8, 0, productUniqueIdUTF8Length); -- node.model_id().copy(productUniqueIdUTF8, productUniqueIdUTF8Length); -+ node->model_id().copy(productUniqueIdUTF8, productUniqueIdUTF8Length); - } - - return 0; - } - - int32_t DeviceInfoPipeWire::CreateCapabilityMap( - const char* deviceUniqueIdUTF8) { - RTC_CHECK(pipewire_session_); - - for (auto& node : pipewire_session_->nodes()) { -- if (node.unique_id().compare(deviceUniqueIdUTF8) != 0) -+ if (node->unique_id().compare(deviceUniqueIdUTF8) != 0) - continue; - -- _captureCapabilities = node.capabilities(); -- _lastUsedDeviceNameLength = node.unique_id().length(); -+ _captureCapabilities = node->capabilities(); -+ _lastUsedDeviceNameLength = node->unique_id().length(); - _lastUsedDeviceName = static_cast( - realloc(_lastUsedDeviceName, _lastUsedDeviceNameLength + 1)); - memcpy(_lastUsedDeviceName, deviceUniqueIdUTF8, - _lastUsedDeviceNameLength + 1); - return _captureCapabilities.size(); -diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h ---- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h -+++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h -@@ -35,21 +35,31 @@ - // PipeWireNode objects are the local representation of PipeWire node objects. - // The portal API ensured that only camera nodes are visible to the client. - // So they all represent one camera that is available via PipeWire. - class PipeWireNode { - public: -- PipeWireNode(PipeWireSession* session, uint32_t id, const spa_dict* props); -- ~PipeWireNode(); -+ struct PipeWireNodeDeleter { -+ void operator()(PipeWireNode* node) const noexcept; -+ }; -+ -+ using PipeWireNodePtr = -+ std::unique_ptr; -+ static PipeWireNodePtr Create(PipeWireSession* session, -+ uint32_t id, -+ const spa_dict* props); - - uint32_t id() const { return id_; } - std::string display_name() const { return display_name_; } - std::string unique_id() const { return unique_id_; } - std::string model_id() const { return model_id_; } - std::vector capabilities() const { - return capabilities_; - } - -+ protected: -+ PipeWireNode(PipeWireSession* session, uint32_t id, const spa_dict* props); -+ - private: - static void OnNodeInfo(void* data, const pw_node_info* info); - static void OnNodeParam(void* data, - int seq, - uint32_t id, -@@ -85,12 +95,13 @@ - PipeWireSession(); - ~PipeWireSession(); - - void Init(VideoCaptureOptions::Callback* callback, - int fd = kInvalidPipeWireFd); -- -- const std::deque& nodes() const { return nodes_; } -+ const std::deque& nodes() const { -+ return nodes_; -+ } - - friend class CameraPortalNotifier; - friend class PipeWireNode; - friend class VideoCaptureModulePipeWire; - -@@ -132,11 +143,11 @@ - struct pw_registry* pw_registry_ = nullptr; - struct spa_hook registry_listener_; - - int sync_seq_ = 0; - -- std::deque nodes_; -+ std::deque nodes_; - std::unique_ptr portal_; - std::unique_ptr portal_notifier_; - }; - - } // namespace videocapturemodule -diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc ---- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc -+++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc -@@ -50,10 +50,23 @@ - default: - return VideoType::kUnknown; - } - } - -+void PipeWireNode::PipeWireNodeDeleter::operator()( -+ PipeWireNode* node) const noexcept { -+ pw_proxy_destroy(node->proxy_); -+ spa_hook_remove(&node->node_listener_); -+} -+ -+// static -+PipeWireNode::PipeWireNodePtr PipeWireNode::Create(PipeWireSession* session, -+ uint32_t id, -+ const spa_dict* props) { -+ return PipeWireNodePtr(new PipeWireNode(session, id, props)); -+} -+ - PipeWireNode::PipeWireNode(PipeWireSession* session, - uint32_t id, - const spa_dict* props) - : session_(session), - id_(id), -@@ -71,15 +84,10 @@ - }; - - pw_node_add_listener(proxy_, &node_listener_, &node_events, this); - } - --PipeWireNode::~PipeWireNode() { -- pw_proxy_destroy(proxy_); -- spa_hook_remove(&node_listener_); --} -- - // static - void PipeWireNode::OnNodeInfo(void* data, const pw_node_info* info) { - PipeWireNode* that = static_cast(data); - - if (info->change_mask & PW_NODE_CHANGE_MASK_PROPS) { -@@ -97,11 +105,13 @@ - char model_str[10]; - snprintf(model_str, sizeof(model_str), "%04x:%04x", vid.value(), - pid.value()); - that->model_id_ = model_str; - } -- } else if (info->change_mask & PW_NODE_CHANGE_MASK_PARAMS) { -+ } -+ -+ if (info->change_mask & PW_NODE_CHANGE_MASK_PARAMS) { - for (uint32_t i = 0; i < info->n_params; i++) { - uint32_t id = info->params[i].id; - if (id == SPA_PARAM_EnumFormat && - info->params[i].flags & SPA_PARAM_INFO_READ) { - pw_node_enum_params(that->proxy_, 0, id, 0, UINT32_MAX, nullptr); -@@ -348,10 +358,18 @@ - PipeWireSession* that = static_cast(data); - - if (id == PW_ID_CORE) { - if (seq == that->sync_seq_) { - RTC_LOG(LS_VERBOSE) << "Enumerating PipeWire camera devices complete."; -+ -+ // Remove camera devices with no capabilities -+ auto it = std::remove_if(that->nodes_.begin(), that->nodes_.end(), -+ [](const PipeWireNode::PipeWireNodePtr& node) { -+ return node->capabilities().empty(); -+ }); -+ that->nodes_.erase(it, that->nodes_.end()); -+ - that->Finish(VideoCaptureOptions::Status::SUCCESS); - } - } - } - -@@ -364,12 +382,12 @@ - const spa_dict* props) { - PipeWireSession* that = static_cast(data); - - // Skip already added nodes to avoid duplicate camera entries - if (std::find_if(that->nodes_.begin(), that->nodes_.end(), -- [id](const PipeWireNode& node) { -- return node.id() == id; -+ [id](const PipeWireNode::PipeWireNodePtr& node) { -+ return node->id() == id; - }) != that->nodes_.end()) - return; - - if (type != absl::string_view(PW_TYPE_INTERFACE_Node)) - return; -@@ -379,21 +397,22 @@ - - auto node_role = spa_dict_lookup(props, PW_KEY_MEDIA_ROLE); - if (!node_role || strcmp(node_role, "Camera")) - return; - -- that->nodes_.emplace_back(that, id, props); -+ that->nodes_.push_back(PipeWireNode::Create(that, id, props)); - that->PipeWireSync(); - } - - // static - void PipeWireSession::OnRegistryGlobalRemove(void* data, uint32_t id) { - PipeWireSession* that = static_cast(data); - -- auto it = std::remove_if( -- that->nodes_.begin(), that->nodes_.end(), -- [id](const PipeWireNode& node) { return node.id() == id; }); -+ auto it = std::remove_if(that->nodes_.begin(), that->nodes_.end(), -+ [id](const PipeWireNode::PipeWireNodePtr& node) { -+ return node->id() == id; -+ }); - that->nodes_.erase(it, that->nodes_.end()); - } - - void PipeWireSession::Finish(VideoCaptureOptions::Status status) { - webrtc::MutexLock lock(&callback_lock_); diff --git a/libwebrtc-pipewire-camera-get-max-fps-for-each-format-when-specified-as-list.patch b/libwebrtc-pipewire-camera-get-max-fps-for-each-format-when-specified-as-list.patch deleted file mode 100644 index 1bea098..0000000 --- a/libwebrtc-pipewire-camera-get-max-fps-for-each-format-when-specified-as-list.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc -index 0b78c16..641e523 100644 ---- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc -+++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc -@@ -17,6 +17,8 @@ - #include - #include - -+#include -+ - #include "common_video/libyuv/include/webrtc_libyuv.h" - #include "modules/video_capture/device_info_impl.h" - #include "rtc_base/logging.h" -@@ -148,9 +150,15 @@ void PipeWireNode::OnNodeParam(void* data, - - fract = static_cast(SPA_POD_BODY(val)); - -- if (choice == SPA_CHOICE_None) -+ if (choice == SPA_CHOICE_None) { - cap.maxFPS = 1.0 * fract[0].num / fract[0].denom; -- else if (choice == SPA_CHOICE_Range && fract[1].num > 0) -+ } else if (choice == SPA_CHOICE_Enum) { -+ for (uint32_t i = 1; i < n_items; i++) { -+ cap.maxFPS = std::max( -+ static_cast(1.0 * fract[i].num / fract[i].denom), -+ cap.maxFPS); -+ } -+ } else if (choice == SPA_CHOICE_Range && fract[1].num > 0) - cap.maxFPS = 1.0 * fract[1].num / fract[1].denom; - } - } diff --git a/libwebrtc-pipewire-camera-make-member-variable-with-pipewire-status-updated.patch b/libwebrtc-pipewire-camera-make-member-variable-with-pipewire-status-updated.patch deleted file mode 100644 index 9674402..0000000 --- a/libwebrtc-pipewire-camera-make-member-variable-with-pipewire-status-updated.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc ---- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc -+++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc -@@ -413,10 +413,12 @@ - }); - that->nodes_.erase(it, that->nodes_.end()); - } - - void PipeWireSession::Finish(VideoCaptureOptions::Status status) { -+ status_ = status; -+ - webrtc::MutexLock lock(&callback_lock_); - - if (callback_) { - callback_->OnInitialized(status); - callback_ = nullptr; diff --git a/libwebrtc-pipewire-camera-use-better-unique-device-name-for-camera-devices.patch b/libwebrtc-pipewire-camera-use-better-unique-device-name-for-camera-devices.patch new file mode 100644 index 0000000..0eaf427 --- /dev/null +++ b/libwebrtc-pipewire-camera-use-better-unique-device-name-for-camera-devices.patch @@ -0,0 +1,37 @@ +diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc +index e5db278ff6..13707da44d 100644 +--- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc ++++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc +@@ -76,7 +76,7 @@ PipeWireNode::PipeWireNode(PipeWireSession* session, + : session_(session), + id_(id), + display_name_(spa_dict_lookup(props, PW_KEY_NODE_DESCRIPTION)), +- unique_id_(rtc::ToString(id)) { ++ unique_id_(spa_dict_lookup(props, PW_KEY_NODE_NAME)) { + RTC_LOG(LS_VERBOSE) << "Found Camera: " << display_name_; + + proxy_ = static_cast(pw_registry_bind( +diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc +index 61b1b54233..f6cd57ac36 100644 +--- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc ++++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc +@@ -83,12 +83,15 @@ int32_t VideoCaptureModulePipeWire::Init(const char* deviceUniqueId) { + RTC_CHECK_RUNS_SERIALIZED(&capture_checker_); + RTC_DCHECK_RUN_ON(&api_checker_); + +- absl::optional id; +- id = rtc::StringToNumber(deviceUniqueId); +- if (id == absl::nullopt) ++ auto node = ++ std::find_if(session_->nodes_.begin(), session_->nodes_.end(), ++ [deviceUniqueId](const PipeWireNode::PipeWireNodePtr& node) { ++ return node->unique_id() == deviceUniqueId; ++ }); ++ if (node == session_->nodes_.end()) + return -1; + +- node_id_ = id.value(); ++ node_id_ = (*node)->id(); + + const int len = strlen(deviceUniqueId); + _deviceUniqueId = new (std::nothrow) char[len + 1]; diff --git a/libwebrtc-pipewire-camera-use-exact-stream-parameters-specified-by-capability.patch b/libwebrtc-pipewire-camera-use-exact-stream-parameters-specified-by-capability.patch deleted file mode 100644 index 472eb79..0000000 --- a/libwebrtc-pipewire-camera-use-exact-stream-parameters-specified-by-capability.patch +++ /dev/null @@ -1,137 +0,0 @@ -diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc -index 1672b75..2338fa6 100644 ---- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc -+++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc -@@ -51,10 +51,20 @@ VideoType VideoCaptureModulePipeWire::PipeWireRawFormatToVideoType( - if (spa_and_pixel_format.spa_format == spa_format) - return spa_and_pixel_format.video_type; - } -- RTC_LOG(LS_INFO) << "Unsupported pixel format: " << spa_format; -+ RTC_LOG(LS_WARNING) << "Unsupported pixel format: " << spa_format; - return VideoType::kUnknown; - } - -+uint32_t VideoCaptureModulePipeWire::VideoTypeToPipeWireRawFormat( -+ VideoType type) { -+ for (const auto& spa_and_pixel_format : kSupportedFormats) { -+ if (spa_and_pixel_format.video_type == type) -+ return spa_and_pixel_format.spa_format; -+ } -+ RTC_LOG(LS_WARNING) << "Unsupported video type: " << static_cast(type); -+ return SPA_VIDEO_FORMAT_UNKNOWN; -+} -+ - VideoCaptureModulePipeWire::VideoCaptureModulePipeWire( - VideoCaptureOptions* options) - : VideoCaptureImpl(), -@@ -87,45 +97,53 @@ int32_t VideoCaptureModulePipeWire::Init(const char* deviceUniqueId) { - } - - static spa_pod* BuildFormat(spa_pod_builder* builder, -- uint32_t format, -+ VideoType video_type, - uint32_t width, - uint32_t height, - float frame_rate) { -- spa_pod_frame frames[2]; -+ spa_pod_frame frame; -+ -+ const uint32_t media_subtype = video_type == VideoType::kMJPEG -+ ? SPA_MEDIA_SUBTYPE_mjpg -+ : SPA_MEDIA_SUBTYPE_raw; - -- spa_pod_builder_push_object(builder, &frames[0], SPA_TYPE_OBJECT_Format, -+ spa_pod_builder_push_object(builder, &frame, SPA_TYPE_OBJECT_Format, - SPA_PARAM_EnumFormat); - spa_pod_builder_add(builder, SPA_FORMAT_mediaType, - SPA_POD_Id(SPA_MEDIA_TYPE_video), SPA_FORMAT_mediaSubtype, -- SPA_POD_Id(format), 0); -- -- if (format == SPA_MEDIA_SUBTYPE_raw) { -- spa_pod_builder_prop(builder, SPA_FORMAT_VIDEO_format, 0); -- spa_pod_builder_push_choice(builder, &frames[1], SPA_CHOICE_Enum, 0); -- spa_pod_builder_id(builder, kSupportedFormats[0].spa_format); -- for (const auto& spa_and_pixel_format : kSupportedFormats) -- spa_pod_builder_id(builder, spa_and_pixel_format.spa_format); -- spa_pod_builder_pop(builder, &frames[1]); -- } -+ SPA_POD_Id(media_subtype), 0); - -- spa_rectangle preferred_size = spa_rectangle{width, height}; -- spa_rectangle min_size = spa_rectangle{1, 1}; -- spa_rectangle max_size = spa_rectangle{4096, 4096}; -- spa_pod_builder_add( -- builder, SPA_FORMAT_VIDEO_size, -- SPA_POD_CHOICE_RANGE_Rectangle(&preferred_size, &min_size, &max_size), 0); -+ if (media_subtype == SPA_MEDIA_SUBTYPE_raw) { -+ const uint32_t format = -+ VideoCaptureModulePipeWire::VideoTypeToPipeWireRawFormat(video_type); -+ RTC_CHECK(format != SPA_VIDEO_FORMAT_UNKNOWN); -+ spa_pod_builder_add(builder, SPA_FORMAT_VIDEO_format, SPA_POD_Id(format), -+ 0); -+ } - -- spa_fraction preferred_frame_rate = -- spa_fraction{static_cast(frame_rate), 1}; -- spa_fraction min_frame_rate = spa_fraction{0, 1}; -- spa_fraction max_frame_rate = spa_fraction{INT32_MAX, 1}; -- spa_pod_builder_add( -- builder, SPA_FORMAT_VIDEO_framerate, -- SPA_POD_CHOICE_RANGE_Fraction(&preferred_frame_rate, &min_frame_rate, -- &max_frame_rate), -- 0); -+ spa_rectangle resolution = spa_rectangle{width, height}; -+ spa_pod_builder_add(builder, SPA_FORMAT_VIDEO_size, -+ SPA_POD_Rectangle(&resolution), 0); -+ -+ // Framerate can be also set to 0 to be unspecified -+ if (frame_rate) { -+ spa_fraction framerate = spa_fraction{static_cast(frame_rate), 1}; -+ spa_pod_builder_add(builder, SPA_FORMAT_VIDEO_framerate, -+ SPA_POD_Fraction(&framerate), 0); -+ } else { -+ // Default to some reasonable values -+ spa_fraction preferred_frame_rate = -+ spa_fraction{static_cast(30), 1}; -+ spa_fraction min_frame_rate = spa_fraction{1, 1}; -+ spa_fraction max_frame_rate = spa_fraction{30, 1}; -+ spa_pod_builder_add( -+ builder, SPA_FORMAT_VIDEO_framerate, -+ SPA_POD_CHOICE_RANGE_Fraction(&preferred_frame_rate, &min_frame_rate, -+ &max_frame_rate), -+ 0); -+ } - -- return static_cast(spa_pod_builder_pop(builder, &frames[0])); -+ return static_cast(spa_pod_builder_pop(builder, &frame)); - } - - int32_t VideoCaptureModulePipeWire::StartCapture( -@@ -176,13 +194,10 @@ int32_t VideoCaptureModulePipeWire::StartCapture( - uint32_t width = capability.width; - uint32_t height = capability.height; - uint32_t frame_rate = capability.maxFPS; -- bool prefer_jpeg = (width > 640) || (height > 480); -+ VideoType video_type = capability.videoType; - - params.push_back( -- BuildFormat(&builder, SPA_MEDIA_SUBTYPE_raw, width, height, frame_rate)); -- params.insert( -- prefer_jpeg ? params.begin() : params.end(), -- BuildFormat(&builder, SPA_MEDIA_SUBTYPE_mjpg, width, height, frame_rate)); -+ BuildFormat(&builder, video_type, width, height, frame_rate)); - - int res = pw_stream_connect( - stream_, PW_DIRECTION_INPUT, node_id_, -diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h -index eeb3b94..789f203 100644 ---- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h -+++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h -@@ -28,6 +28,7 @@ class VideoCaptureModulePipeWire : public VideoCaptureImpl { - int32_t CaptureSettings(VideoCaptureCapability& settings) override; - - static VideoType PipeWireRawFormatToVideoType(uint32_t format); -+ static uint32_t VideoTypeToPipeWireRawFormat(VideoType type); - - private: - static void OnStreamParamChanged(void* data, diff --git a/pipewire-camera-add-missing-support-for-device-change-notification.patch b/pipewire-camera-add-missing-support-for-device-change-notification.patch deleted file mode 100644 index 9491731..0000000 --- a/pipewire-camera-add-missing-support-for-device-change-notification.patch +++ /dev/null @@ -1,173 +0,0 @@ -diff --git a/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc b/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc -index db2a3c7..a0607b4 100644 ---- a/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc -+++ b/third_party/libwebrtc/modules/video_capture/linux/device_info_pipewire.cc -@@ -29,13 +29,19 @@ - namespace webrtc { - namespace videocapturemodule { - DeviceInfoPipeWire::DeviceInfoPipeWire(VideoCaptureOptions* options) -- : DeviceInfoImpl(), pipewire_session_(options->pipewire_session()) {} -+ : DeviceInfoImpl(), pipewire_session_(options->pipewire_session()) { -+ const bool ret = pipewire_session_->RegisterDeviceInfo(this); -+ RTC_CHECK(ret); -+} - - int32_t DeviceInfoPipeWire::Init() { - return 0; - } - --DeviceInfoPipeWire::~DeviceInfoPipeWire() = default; -+DeviceInfoPipeWire::~DeviceInfoPipeWire() { -+ const bool ret = pipewire_session_->DeRegisterDeviceInfo(this); -+ RTC_CHECK(ret); -+} - - uint32_t DeviceInfoPipeWire::NumberOfDevices() { - RTC_CHECK(pipewire_session_); -diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc -index ac12d04..0b78c16 100644 ---- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc -+++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc -@@ -9,6 +9,7 @@ - */ - - #include "modules/video_capture/linux/pipewire_session.h" -+#include "modules/video_capture/linux/device_info_pipewire.h" - - #include - #include -@@ -274,6 +275,28 @@ void PipeWireSession::InitPipeWire(int fd) { - Finish(VideoCaptureOptions::Status::ERROR); - } - -+bool PipeWireSession::RegisterDeviceInfo(DeviceInfoPipeWire* device_info) { -+ RTC_CHECK(device_info); -+ MutexLock lock(&device_info_lock_); -+ auto it = std::find(device_info_list_.begin(), device_info_list_.end(), device_info); -+ if (it == device_info_list_.end()) { -+ device_info_list_.push_back(device_info); -+ return true; -+ } -+ return false; -+} -+ -+bool PipeWireSession::DeRegisterDeviceInfo(DeviceInfoPipeWire* device_info) { -+ RTC_CHECK(device_info); -+ MutexLock lock(&device_info_lock_); -+ auto it = std::find(device_info_list_.begin(), device_info_list_.end(), device_info); -+ if (it != device_info_list_.end()) { -+ device_info_list_.erase(it); -+ return true; -+ } -+ return false; -+} -+ - bool PipeWireSession::StartPipeWire(int fd) { - pw_init(/*argc=*/nullptr, /*argv=*/nullptr); - -@@ -344,6 +367,21 @@ void PipeWireSession::PipeWireSync() { - sync_seq_ = pw_core_sync(pw_core_, PW_ID_CORE, sync_seq_); - } - -+void PipeWireSession::NotifyDeviceChange() { -+ RTC_LOG(LS_INFO) << "Notify about device list changes"; -+ MutexLock lock(&device_info_lock_); -+ -+ // It makes sense to notify about device changes only once we are -+ // properly initialized. -+ if (status_ != VideoCaptureOptions::Status::SUCCESS) { -+ return; -+ } -+ -+ for (auto* deviceInfo : device_info_list_) { -+ deviceInfo->DeviceChange(); -+ } -+} -+ - // static - void PipeWireSession::OnCoreError(void* data, - uint32_t id, -@@ -401,6 +439,8 @@ void PipeWireSession::OnRegistryGlobal(void* data, - - that->nodes_.push_back(PipeWireNode::Create(that, id, props)); - that->PipeWireSync(); -+ -+ that->NotifyDeviceChange(); - } - - // static -@@ -412,10 +452,15 @@ void PipeWireSession::OnRegistryGlobalRemove(void* data, uint32_t id) { - return node->id() == id; - }); - that->nodes_.erase(it, that->nodes_.end()); -+ -+ that->NotifyDeviceChange(); - } - - void PipeWireSession::Finish(VideoCaptureOptions::Status status) { -- status_ = status; -+ { -+ MutexLock lock(&device_info_lock_); -+ status_ = status; -+ } - - webrtc::MutexLock lock(&callback_lock_); - -diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h -index 84273ea..1f3a006 100644 ---- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h -+++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h -@@ -29,6 +29,7 @@ - namespace webrtc { - namespace videocapturemodule { - -+class DeviceInfoPipeWire; - class PipeWireSession; - class VideoCaptureModulePipeWire; - -@@ -97,6 +98,21 @@ class PipeWireSession : public rtc::RefCountedNonVirtual { - - void Init(VideoCaptureOptions::Callback* callback, - int fd = kInvalidPipeWireFd); -+ -+ // [De]Register DeviceInfo for device change updates -+ // These methods will add or remove references to DeviceInfo -+ // objects that we want to notify about device changes. -+ // NOTE: We do not take ownership of these objects and -+ // they should never be released by us. All the instances -+ // of DeviceInfoPipeWire must outlive their registration. -+ -+ // Returns true when DeviceInfo was successfuly registered -+ // or false otherwise, when it was already registered before. -+ bool RegisterDeviceInfo(DeviceInfoPipeWire* device_info); -+ // Returns true when DeviceInfo was successfuly unregistered -+ // or false otherwise, when it was not previously registered. -+ bool DeRegisterDeviceInfo(DeviceInfoPipeWire* device_info); -+ - const std::deque& nodes() const { - return nodes_; - } -@@ -111,6 +127,8 @@ class PipeWireSession : public rtc::RefCountedNonVirtual { - void StopPipeWire(); - void PipeWireSync(); - -+ void NotifyDeviceChange(); -+ - static void OnCoreError(void* data, - uint32_t id, - int seq, -@@ -133,7 +151,13 @@ class PipeWireSession : public rtc::RefCountedNonVirtual { - VideoCaptureOptions::Callback* callback_ RTC_GUARDED_BY(&callback_lock_) = - nullptr; - -- VideoCaptureOptions::Status status_; -+ webrtc::Mutex device_info_lock_; -+ std::vector device_info_list_ -+ RTC_GUARDED_BY(device_info_lock_); -+ // Guard with device_info_lock, because currently it's the only place where -+ // we use this status information. -+ VideoCaptureOptions::Status status_ -+ RTC_GUARDED_BY(device_info_lock_); - - struct pw_thread_loop* pw_main_loop_ = nullptr; - struct pw_context* pw_context_ = nullptr; diff --git a/pipewire-camera-always-query-information-about-camera-availability.patch b/pipewire-camera-always-query-information-about-camera-availability.patch deleted file mode 100644 index de67cfd..0000000 --- a/pipewire-camera-always-query-information-about-camera-availability.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp ---- a/dom/media/MediaManager.cpp -+++ b/dom/media/MediaManager.cpp -@@ -2151,13 +2151,19 @@ - deviceAccessPromise = backgroundChild->SendRequestCameraAccess( - aParams.mFlags.contains(EnumerationFlag::AllowPermissionRequest)); - } - - if (!deviceAccessPromise) { -- // No device access request needed. Proceed directly. -- deviceAccessPromise = -- NativePromise::CreateAndResolve(CamerasAccessStatus::Granted, __func__); -+ // No device access request needed. We can proceed directly, but we still -+ // need to update camera availability, because the camera engine is always -+ // created together with the WebRTC backend, which is done because -+ // devicechange events must work before prompting in cases where persistent -+ // permission has already been given. Making a request to camera access not -+ // allowing a permission request does exactly what we need in this case. -+ ipc::PBackgroundChild* backgroundChild = -+ ipc::BackgroundChild::GetOrCreateForCurrentThread(); -+ deviceAccessPromise = backgroundChild->SendRequestCameraAccess(false); - } - - return deviceAccessPromise->Then( - GetCurrentSerialEventTarget(), __func__, - [this, self = RefPtr(this), aParams = std::move(aParams)]( -@@ -2188,12 +2194,13 @@ - MakeRefPtr(MediaMgrError::Name::NotAllowedError), - "MaybeRequestPermissionAndEnumerateRawDevices: camera access " - "rejected"); - } - -- if (aParams.mFlags.contains(EnumerationFlag::AllowPermissionRequest)) { -- MOZ_ASSERT(aValue.ResolveValue() == CamerasAccessStatus::Granted); -+ if (aParams.VideoInputType() == MediaSourceEnum::Camera && -+ aParams.mFlags.contains(EnumerationFlag::AllowPermissionRequest) && -+ aValue.ResolveValue() == CamerasAccessStatus::Granted) { - EnsureNoPlaceholdersInDeviceCache(); - } - - // We have to nest this, unfortunately, since we have no guarantees that - // mMediaThread is alive. If we'd reject due to shutdown above, and have diff --git a/pipewire-camera-always-register-video-input-feedback-for-newly-created-deviceinfo.patch b/pipewire-camera-always-register-video-input-feedback-for-newly-created-deviceinfo.patch deleted file mode 100644 index 3c47a11..0000000 --- a/pipewire-camera-always-register-video-input-feedback-for-newly-created-deviceinfo.patch +++ /dev/null @@ -1,306 +0,0 @@ -diff --git a/dom/media/systemservices/CamerasParent.h b/dom/media/systemservices/CamerasParent.h ---- a/dom/media/systemservices/CamerasParent.h -+++ b/dom/media/systemservices/CamerasParent.h -@@ -142,10 +142,15 @@ - int ReleaseCapture(const CaptureEngine& aCapEngine, int aCaptureId); - - // VideoInputFeedBack - void OnDeviceChange() override; - -+ // Creates a new DeviceInfo or returns an existing DeviceInfo for given -+ // capture engine. Returns a nullptr in case capture engine failed to be -+ // initialized. Video capture thread only. -+ std::shared_ptr GetDeviceInfo( -+ int aEngine); - VideoEngine* EnsureInitialized(int aEngine); - - // Stops any ongoing capturing and releases resources. Called on - // mVideoCaptureThread. Idempotent. - void CloseEngines(); -diff --git a/dom/media/systemservices/CamerasParent.cpp b/dom/media/systemservices/CamerasParent.cpp ---- a/dom/media/systemservices/CamerasParent.cpp -+++ b/dom/media/systemservices/CamerasParent.cpp -@@ -403,19 +403,29 @@ - LOG("Forcing shutdown of engine %d, capturer %d", capEngine, streamNum); - StopCapture(capEngine, streamNum); - Unused << ReleaseCapture(capEngine, streamNum); - } - -- if (VideoEngine* engine = mEngines->ElementAt(CameraEngine); engine) { -- auto device_info = engine->GetOrCreateVideoCaptureDeviceInfo(); -- MOZ_ASSERT(device_info); -- if (device_info) { -- device_info->DeRegisterVideoInputFeedBack(this); -- } -+ auto device_info = GetDeviceInfo(CameraEngine); -+ MOZ_ASSERT(device_info); -+ if (device_info) { -+ device_info->DeRegisterVideoInputFeedBack(this); - } - } - -+std::shared_ptr -+CamerasParent::GetDeviceInfo(int aEngine) { -+ MOZ_ASSERT(mVideoCaptureThread->IsOnCurrentThread()); -+ LOG_VERBOSE("CamerasParent(%p)::%s", this, __func__); -+ -+ auto* engine = EnsureInitialized(aEngine); -+ if (!engine) { -+ return nullptr; -+ } -+ return engine->GetOrCreateVideoCaptureDeviceInfo(this); -+} -+ - VideoEngine* CamerasParent::EnsureInitialized(int aEngine) { - MOZ_ASSERT(mVideoCaptureThread->IsOnCurrentThread()); - LOG_VERBOSE("CamerasParent(%p)::%s", this, __func__); - CaptureEngine capEngine = static_cast(aEngine); - -@@ -447,18 +457,10 @@ - if (!engine) { - LOG("VideoEngine::Create failed"); - return nullptr; - } - -- if (capEngine == CameraEngine) { -- auto device_info = engine->GetOrCreateVideoCaptureDeviceInfo(); -- MOZ_ASSERT(device_info); -- if (device_info) { -- device_info->RegisterVideoInputFeedBack(this); -- } -- } -- - return mEngines->ElementAt(capEngine) = std::move(engine); - } - - // Dispatch the runnable to do the camera operation on the - // specific Cameras thread, preventing us from blocking, and -@@ -472,23 +474,20 @@ - - LOG_FUNCTION(); - LOG("CaptureEngine=%d", aCapEngine); - - using Promise = MozPromise; -- InvokeAsync( -- mVideoCaptureThread, __func__, -- [this, self = RefPtr(this), aCapEngine] { -- int num = -1; -- if (auto* engine = EnsureInitialized(aCapEngine)) { -- if (auto devInfo = engine->GetOrCreateVideoCaptureDeviceInfo()) { -- num = static_cast(devInfo->NumberOfDevices()); -- } -- } -+ InvokeAsync(mVideoCaptureThread, __func__, -+ [this, self = RefPtr(this), aCapEngine] { -+ int num = -1; -+ if (auto devInfo = GetDeviceInfo(aCapEngine)) { -+ num = static_cast(devInfo->NumberOfDevices()); -+ } - -- return Promise::CreateAndResolve( -- num, "CamerasParent::RecvNumberOfCaptureDevices"); -- }) -+ return Promise::CreateAndResolve( -+ num, "CamerasParent::RecvNumberOfCaptureDevices"); -+ }) - ->Then( - mPBackgroundEventTarget, __func__, - [this, self = RefPtr(this)](Promise::ResolveOrRejectValue&& aValue) { - int nrDevices = aValue.ResolveValue(); - -@@ -556,14 +555,12 @@ - using Promise = MozPromise; - InvokeAsync( - mVideoCaptureThread, __func__, - [this, self = RefPtr(this), id = nsCString(aUniqueId), aCapEngine]() { - int num = -1; -- if (auto* engine = EnsureInitialized(aCapEngine)) { -- if (auto devInfo = engine->GetOrCreateVideoCaptureDeviceInfo()) { -- num = devInfo->NumberOfCapabilities(id.get()); -- } -+ if (auto devInfo = GetDeviceInfo(aCapEngine)) { -+ num = devInfo->NumberOfCapabilities(id.get()); - } - return Promise::CreateAndResolve( - num, "CamerasParent::RecvNumberOfCapabilities"); - }) - ->Then( -@@ -597,40 +594,38 @@ - LOG_FUNCTION(); - LOG("RecvGetCaptureCapability: %s %d", PromiseFlatCString(aUniqueId).get(), - aIndex); - - using Promise = MozPromise; -- InvokeAsync( -- mVideoCaptureThread, __func__, -- [this, self = RefPtr(this), id = nsCString(aUniqueId), aCapEngine, -- aIndex] { -- webrtc::VideoCaptureCapability webrtcCaps; -- int error = -1; -- if (auto* engine = EnsureInitialized(aCapEngine)) { -- if (auto devInfo = engine->GetOrCreateVideoCaptureDeviceInfo()) { -- error = devInfo->GetCapability(id.get(), aIndex, webrtcCaps); -- } -- } -+ InvokeAsync(mVideoCaptureThread, __func__, -+ [this, self = RefPtr(this), id = nsCString(aUniqueId), aCapEngine, -+ aIndex] { -+ webrtc::VideoCaptureCapability webrtcCaps; -+ int error = -1; -+ if (auto devInfo = GetDeviceInfo(aCapEngine)) { -+ error = devInfo->GetCapability(id.get(), aIndex, webrtcCaps); -+ } - -- if (!error && aCapEngine == CameraEngine) { -- auto iter = mAllCandidateCapabilities.find(id); -- if (iter == mAllCandidateCapabilities.end()) { -- std::map -- candidateCapabilities; -- candidateCapabilities.emplace(aIndex, webrtcCaps); -- mAllCandidateCapabilities.emplace(id, candidateCapabilities); -- } else { -- (iter->second).emplace(aIndex, webrtcCaps); -- } -- } -- if (error) { -- return Promise::CreateAndReject( -- error, "CamerasParent::RecvGetCaptureCapability"); -- } -- return Promise::CreateAndResolve( -- webrtcCaps, "CamerasParent::RecvGetCaptureCapability"); -- }) -+ if (!error && aCapEngine == CameraEngine) { -+ auto iter = mAllCandidateCapabilities.find(id); -+ if (iter == mAllCandidateCapabilities.end()) { -+ std::map -+ candidateCapabilities; -+ candidateCapabilities.emplace(aIndex, webrtcCaps); -+ mAllCandidateCapabilities.emplace(id, -+ candidateCapabilities); -+ } else { -+ (iter->second).emplace(aIndex, webrtcCaps); -+ } -+ } -+ if (error) { -+ return Promise::CreateAndReject( -+ error, "CamerasParent::RecvGetCaptureCapability"); -+ } -+ return Promise::CreateAndResolve( -+ webrtcCaps, "CamerasParent::RecvGetCaptureCapability"); -+ }) - ->Then( - mPBackgroundEventTarget, __func__, - [this, self = RefPtr(this)](Promise::ResolveOrRejectValue&& aValue) { - if (mDestroyed) { - LOG("RecvGetCaptureCapability: child not alive"); -@@ -662,37 +657,36 @@ - - LOG_FUNCTION(); - - using Data = std::tuple; - using Promise = MozPromise; -- InvokeAsync( -- mVideoCaptureThread, __func__, -- [this, self = RefPtr(this), aCapEngine, aDeviceIndex] { -- char deviceName[MediaEngineSource::kMaxDeviceNameLength]; -- char deviceUniqueId[MediaEngineSource::kMaxUniqueIdLength]; -- nsCString name; -- nsCString uniqueId; -- pid_t devicePid = 0; -- bool placeholder = false; -- int error = -1; -- if (auto* engine = EnsureInitialized(aCapEngine)) { -- if (auto devInfo = engine->GetOrCreateVideoCaptureDeviceInfo()) { -- error = devInfo->GetDeviceName( -- aDeviceIndex, deviceName, sizeof(deviceName), deviceUniqueId, -- sizeof(deviceUniqueId), nullptr, 0, &devicePid, &placeholder); -- } -- } -- if (error == 0) { -- name.Assign(deviceName); -- uniqueId.Assign(deviceUniqueId); -- } -+ InvokeAsync(mVideoCaptureThread, __func__, -+ [this, self = RefPtr(this), aCapEngine, aDeviceIndex] { -+ char deviceName[MediaEngineSource::kMaxDeviceNameLength]; -+ char deviceUniqueId[MediaEngineSource::kMaxUniqueIdLength]; -+ nsCString name; -+ nsCString uniqueId; -+ pid_t devicePid = 0; -+ bool placeholder = false; -+ int error = -1; -+ if (auto devInfo = GetDeviceInfo(aCapEngine)) { -+ error = devInfo->GetDeviceName( -+ aDeviceIndex, deviceName, sizeof(deviceName), -+ deviceUniqueId, sizeof(deviceUniqueId), nullptr, 0, -+ &devicePid, &placeholder); -+ } - -- return Promise::CreateAndResolve( -- std::make_tuple(std::move(name), std::move(uniqueId), devicePid, -- placeholder, error), -- "CamerasParent::RecvGetCaptureDevice"); -- }) -+ if (error == 0) { -+ name.Assign(deviceName); -+ uniqueId.Assign(deviceUniqueId); -+ } -+ -+ return Promise::CreateAndResolve( -+ std::make_tuple(std::move(name), std::move(uniqueId), -+ devicePid, placeholder, error), -+ "CamerasParent::RecvGetCaptureDevice"); -+ }) - ->Then( - mPBackgroundEventTarget, __func__, - [this, self = RefPtr(this)](Promise::ResolveOrRejectValue&& aValue) { - const auto& [name, uniqueId, devicePid, placeholder, error] = - aValue.ResolveValue(); -diff --git a/dom/media/systemservices/VideoEngine.h b/dom/media/systemservices/VideoEngine.h ---- a/dom/media/systemservices/VideoEngine.h -+++ b/dom/media/systemservices/VideoEngine.h -@@ -63,11 +63,11 @@ - * @return on failure the shared_ptr will be null, otherwise it will contain - * a DeviceInfo. - * @see bug 1305212 https://bugzilla.mozilla.org/show_bug.cgi?id=1305212 - */ - std::shared_ptr -- GetOrCreateVideoCaptureDeviceInfo(); -+ GetOrCreateVideoCaptureDeviceInfo(webrtc::VideoInputFeedBack* callBack); - - /** - * Destroys existing DeviceInfo. - * The DeviceInfo will be recreated the next time it is needed. - */ -diff --git a/dom/media/systemservices/VideoEngine.cpp b/dom/media/systemservices/VideoEngine.cpp ---- a/dom/media/systemservices/VideoEngine.cpp -+++ b/dom/media/systemservices/VideoEngine.cpp -@@ -111,11 +111,12 @@ - mIdMap.erase(aId); - return found ? 0 : (-1); - } - - std::shared_ptr --VideoEngine::GetOrCreateVideoCaptureDeviceInfo() { -+VideoEngine::GetOrCreateVideoCaptureDeviceInfo( -+ webrtc::VideoInputFeedBack* callBack) { - LOG(("%s", __PRETTY_FUNCTION__)); - webrtc::Timestamp currentTime = webrtc::Timestamp::Micros(0); - - const char* capDevTypeName = EnumValueToString(mCaptureDevType); - -@@ -154,10 +155,14 @@ - } - #endif - - mDeviceInfo = mVideoCaptureFactory->CreateDeviceInfo(mId, mCaptureDevType); - -+ if (mDeviceInfo && mCaptureDevType == CaptureDeviceType::Camera) { -+ mDeviceInfo->RegisterVideoInputFeedBack(callBack); -+ } -+ - LOG(("EXIT %s", __PRETTY_FUNCTION__)); - return mDeviceInfo; - } - - void VideoEngine::ClearVideoCaptureDeviceInfo() { From 2a1dcfee99917f5ebd6226b074c3e4cd93c5daef Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 15 Nov 2024 20:35:19 +0100 Subject: [PATCH 411/545] Updated to 132.0.2 --- firefox.spec | 19 ++++++++++--------- wasi.patch | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/firefox.spec b/firefox.spec index 1ba4a03..9e99b20 100644 --- a/firefox.spec +++ b/firefox.spec @@ -6,9 +6,6 @@ # https://bugzilla.redhat.com/show_bug.cgi?id=2129720 ExcludeArch: i686 -# Disabled due to build failures -ExcludeArch: ppc64le - # Run Mozilla test suite as a part of compile rpm section. Turn off when # building locally and don't want to spend 24 hours waiting for results. %global run_firefox_tests 0 @@ -199,14 +196,14 @@ ExcludeArch: ppc64le Summary: Mozilla Firefox Web browser Name: firefox -Version: 132.0.1 -Release: 2%{?pre_tag}%{?dist} +Version: 132.0.2 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20241105.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20241115.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -826,7 +823,7 @@ MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | sed -e 's/-O2//') # If MOZ_DEBUG_FLAGS is empty, firefox's build will default it to "-g" which # overrides the -g1 from line above and breaks building on s390/arm # (OOM when linking, rhbz#1238225) -%ifarch %{ix86} +%ifarch %{ix86} ppc64le MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | sed -e 's/-g/-g0/') %else # this reduces backtrace quality substantially, but seems to be needed @@ -837,11 +834,11 @@ MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | sed -e 's/-g/-g1/') export MOZ_DEBUG_FLAGS=" " MOZ_LINK_FLAGS="%{build_ldflags}" %if !%{build_with_clang} -%ifarch aarch64 %{ix86} +%ifarch aarch64 %{ix86} ppc64le MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" %endif %endif -%ifarch %{ix86} s390x +%ifarch %{ix86} s390x ppc64le export RUSTFLAGS="-Cdebuginfo=0" %endif %if %{build_with_asan} @@ -1242,6 +1239,10 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Nov 15 2024 Martin Stransky - 132.0.2-1 +- Updated to 132.0.2 +- Try to reduce build mem usage on ppc64le + * Thu Nov 07 2024 Jan Grulich - 132.0.1-2 - PipeWire camera: use better unique device name for camera devices diff --git a/wasi.patch b/wasi.patch index bba8a86..476266a 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-132.0.1-build/firefox-132.0.1/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-132.0.2-build/firefox-132.0.2/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From f3ac8bae08ee43b4983d7decc01a196e1f9ea109 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 15 Nov 2024 23:08:28 +0100 Subject: [PATCH 412/545] Updated sources --- .gitignore | 2 ++ sources | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b6e4cca..1dcbdf8 100644 --- a/.gitignore +++ b/.gitignore @@ -668,3 +668,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-132.0-20241023.tar.xz /firefox-132.0.1.source.tar.xz /firefox-langpacks-132.0.1-20241105.tar.xz +/firefox-langpacks-132.0.2-20241115.tar.xz +/firefox-132.0.2.source.tar.xz diff --git a/sources b/sources index 72e20b0..31ada40 100644 --- a/sources +++ b/sources @@ -2,5 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a -SHA512 (firefox-132.0.1.source.tar.xz) = 10d5b05f61628deb9a69cb34b2cf3c75bb6b8768f5a718cef2157d5feb1671ede0d583439562e1c1221914eb6ed37fdf415dd651b1465c056be174136cd80b9d -SHA512 (firefox-langpacks-132.0.1-20241105.tar.xz) = fa93df0a89f5176fc01638a429833886b133f68d55855c55b46efae9de7656193bb16c6ab2fa3b2aa8cf9570d0d7005c5754aa4a130cddf1af1b49e6f52a615e +SHA512 (firefox-langpacks-132.0.2-20241115.tar.xz) = 56aa82e805c900d3001a8c8b33b134ca0bcf0be6c445d0b536ac157845b3e59ffaa6a155594cfef501432baebf379e41450ddab3ba62e3f6956f6da27700bfc2 +SHA512 (firefox-132.0.2.source.tar.xz) = 9ea95d9fb1a941ac5a5b50da67e224f3ccf8c401f26cb61bb74ad7f4e1e8706d469c4b6325714f2cb9cdf50c32710377d6bca18dd65b55db2c39ef2b27a57fae From 3b51a028b9adf9231eb80ef6c3f9de935eb5a186 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 18 Nov 2024 19:28:54 +0100 Subject: [PATCH 413/545] Added memory saving flags to x86_64 --- firefox.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index 9e99b20..1eb169f 100644 --- a/firefox.spec +++ b/firefox.spec @@ -197,7 +197,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 132.0.2 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -834,7 +834,7 @@ MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | sed -e 's/-g/-g1/') export MOZ_DEBUG_FLAGS=" " MOZ_LINK_FLAGS="%{build_ldflags}" %if !%{build_with_clang} -%ifarch aarch64 %{ix86} ppc64le +%ifarch aarch64 %{ix86} ppc64le x86_64 MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" %endif %endif @@ -1239,6 +1239,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Nov 18 2024 Martin Stransky - 132.0.2-2 +- Added memory saving flags to x86_64 + * Fri Nov 15 2024 Martin Stransky - 132.0.2-1 - Updated to 132.0.2 - Try to reduce build mem usage on ppc64le From 0e10582f61bfeea301145a9158523597128440d4 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 22 Nov 2024 10:41:47 +0100 Subject: [PATCH 414/545] Updated to 133.0 --- .gitignore | 2 + D209910.1715685533.diff | 419 ----------------------------------- D209911.1715685535.diff | 55 ----- D210158.1715685536.diff | 54 ----- D210159.1715685538.diff | 49 ---- D210430.1715848796.diff | 121 ---------- D223285.1729586039.diff | 478 ---------------------------------------- D224842.1729586219.diff | 48 ---- D225439.1729586066.diff | 223 ------------------- D225760.1729586239.diff | 46 ---- D225868.1729586247.diff | 17 -- firefox.spec | 27 +-- mozilla-1196777.patch | 19 +- sources | 2 + wasi.patch | 2 +- 15 files changed, 21 insertions(+), 1541 deletions(-) delete mode 100644 D209910.1715685533.diff delete mode 100644 D209911.1715685535.diff delete mode 100644 D210158.1715685536.diff delete mode 100644 D210159.1715685538.diff delete mode 100644 D210430.1715848796.diff delete mode 100644 D223285.1729586039.diff delete mode 100644 D224842.1729586219.diff delete mode 100644 D225439.1729586066.diff delete mode 100644 D225760.1729586239.diff delete mode 100644 D225868.1729586247.diff diff --git a/.gitignore b/.gitignore index 1dcbdf8..5b3f960 100644 --- a/.gitignore +++ b/.gitignore @@ -670,3 +670,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-132.0.1-20241105.tar.xz /firefox-langpacks-132.0.2-20241115.tar.xz /firefox-132.0.2.source.tar.xz +/firefox-133.0.source.tar.xz +/firefox-langpacks-133.0-20241122.tar.xz diff --git a/D209910.1715685533.diff b/D209910.1715685533.diff deleted file mode 100644 index c94d88e..0000000 --- a/D209910.1715685533.diff +++ /dev/null @@ -1,419 +0,0 @@ -diff --git a/widget/gtk/DBusService.h b/widget/gtk/DBusService.h -new file mode 100644 ---- /dev/null -+++ b/widget/gtk/DBusService.h -@@ -0,0 +1,67 @@ -+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+#ifndef DBusService_h__ -+#define DBusService_h__ -+ -+#include -+#include -+#include "mozilla/RefPtr.h" -+#include "mozilla/GRefPtr.h" -+ -+namespace mozilla::widget { -+ -+class DBusService final { -+ public: -+ explicit DBusService(const char* aAppFile) : mAppFile(aAppFile) {} -+ ~DBusService(); -+ -+ // nsBaseAppShell overrides: -+ bool Init(); -+ void Run(); -+ -+ void StartDBusListening(); -+ void StopDBusListening(); -+ -+ static void DBusSessionSleepCallback(GDBusProxy* aProxy, gchar* aSenderName, -+ gchar* aSignalName, -+ GVariant* aParameters, -+ gpointer aUserData); -+ static void DBusTimedatePropertiesChangedCallback(GDBusProxy* aProxy, -+ gchar* aSenderName, -+ gchar* aSignalName, -+ GVariant* aParameters, -+ gpointer aUserData); -+ static void DBusConnectClientResponse(GObject* aObject, GAsyncResult* aResult, -+ gpointer aUserData); -+ -+ bool LaunchApp(const char* aCommand, const char** aURIList, int aURIListLen); -+ -+ void HandleFreedesktopActivate(GVariant* aParameters, -+ GDBusMethodInvocation* aReply); -+ void HandleFreedesktopOpen(GVariant* aParameters, -+ GDBusMethodInvocation* aReply); -+ void HandleFreedesktopActivateAction(GVariant* aParameters, -+ GDBusMethodInvocation* aReply); -+ -+ bool StartFreedesktopListener(); -+ void StopFreedesktopListener(); -+ -+ void OnBusAcquired(GDBusConnection* aConnection); -+ void OnNameAcquired(GDBusConnection* aConnection); -+ void OnNameLost(GDBusConnection* aConnection); -+ -+ private: -+ // The connection is owned by DBus library -+ uint mDBusID = 0; -+ uint mRegistrationId = 0; -+ GDBusConnection* mConnection = nullptr; -+ RefPtr mIntrospectionData; -+ const char* mAppFile = nullptr; -+}; -+ -+} // namespace mozilla::widget -+ -+#endif // DBusService_h__ -diff --git a/widget/gtk/DBusService.cpp b/widget/gtk/DBusService.cpp -new file mode 100644 ---- /dev/null -+++ b/widget/gtk/DBusService.cpp -@@ -0,0 +1,327 @@ -+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+#include -+#include -+#include -+#include -+#include -+#include "DBusService.h" -+#include "nsAppRunner.h" -+#include "mozilla/Unused.h" -+#include "mozilla/GUniquePtr.h" -+#include "mozilla/WidgetUtils.h" -+#include -+#include "nsIObserverService.h" -+#include "WidgetUtilsGtk.h" -+#include "prproces.h" -+#include "mozilla/XREAppData.h" -+#include "nsPrintfCString.h" -+ -+using namespace mozilla; -+using namespace mozilla::widget; -+ -+DBusService::~DBusService() { StopFreedesktopListener(); } -+ -+bool DBusService::Init() { return StartFreedesktopListener(); } -+ -+void DBusService::Run() { -+ GMainLoop* loop = g_main_loop_new(nullptr, false); -+ g_main_loop_run(loop); -+ g_main_loop_unref(loop); -+} -+ -+// Mozilla has old GIO version in build roots -+#define G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE GBusNameOwnerFlags(1 << 2) -+ -+#define DBUS_BUS_NAME_TEMPLATE "org.mozilla.%s" -+#define DBUS_OBJECT_PATH_TEMPLATE "/org/mozilla/%s" -+ -+static const char* GetDBusBusName() { -+ static const char* name = []() { -+ nsAutoCString appName; -+ gAppData->GetDBusAppName(appName); -+ return ToNewCString(nsPrintfCString(DBUS_BUS_NAME_TEMPLATE, -+ appName.get())); // Intentionally leak -+ }(); -+ return name; -+} -+ -+static const char* GetDBusObjectPath() { -+ static const char* path = []() { -+ nsAutoCString appName; -+ gAppData->GetDBusAppName(appName); -+ return ToNewCString(nsPrintfCString(DBUS_OBJECT_PATH_TEMPLATE, -+ appName.get())); // Intentionally leak -+ }(); -+ return path; -+} -+ -+// See -+// https://specifications.freedesktop.org/desktop-entry-spec/1.1/ar01s07.html -+// for details -+static const char* kIntrospectTemplate = -+ "\n" -+ "\n" -+ "\n" -+ "\n" -+ " \n" -+ " \n" -+ " \n" -+ " \n" -+ " \n" -+ "\n" -+ "\n" -+ " \n" -+ " \n" -+ " \n" -+ "\n" -+ "\n" -+ "\n"; -+ -+bool DBusService::LaunchApp(const char* aCommand, const char** aURIList, -+ int aURIListLen) { -+ // Allocate space for all uris, executable name, command if supplied and -+ // null terminator -+ int paramsNum = aURIListLen + 2; -+ if (aCommand) { -+ paramsNum++; -+ } -+ -+ char** argv = (char**)moz_xmalloc(sizeof(char*) * paramsNum); -+ int argc = 0; -+ argv[argc++] = strdup(mAppFile); -+ if (aCommand) { -+ argv[argc++] = strdup(aCommand); -+ } -+ for (int i = 0; aURIList && i < aURIListLen; i++) { -+ argv[argc++] = strdup(aURIList[i]); -+ } -+ argv[argc++] = nullptr; -+ -+ nsAutoCString exePath; -+ nsCOMPtr lf; -+ bool ret = false; -+ if (NS_SUCCEEDED(XRE_GetBinaryPath(getter_AddRefs(lf)))) { -+ if (NS_SUCCEEDED(lf->GetNativePath(exePath))) { -+ ret = (PR_CreateProcessDetached(exePath.get(), argv, nullptr, nullptr) != -+ PR_FAILURE); -+ } -+ } -+ -+ for (int i = 0; i < argc; i++) { -+ free(argv[i]); -+ } -+ free(argv); -+ return ret; -+} -+ -+// The Activate method is called when the application is started without -+// files to open. -+// Open :: (a{sv}) → () -+void DBusService::HandleFreedesktopActivate(GVariant* aParameters, -+ GDBusMethodInvocation* aReply) { -+ if (!LaunchApp(nullptr, nullptr, 0)) { -+ g_dbus_method_invocation_return_error(aReply, G_DBUS_ERROR, -+ G_DBUS_ERROR_FAILED, -+ "Failed to run target application."); -+ return; -+ } -+ g_dbus_method_invocation_return_value(aReply, nullptr); -+} -+ -+// The Open method is called when the application is started with files. -+// The array of strings is an array of URIs, in UTF-8. -+// Open :: (as,a{sv}) → () -+void DBusService::HandleFreedesktopOpen(GVariant* aParameters, -+ GDBusMethodInvocation* aReply) { -+ RefPtr variant = -+ dont_AddRef(g_variant_get_child_value(aParameters, 0)); -+ gsize uriNum = 0; -+ GUniquePtr uriArray(g_variant_get_strv(variant, &uriNum)); -+ if (!LaunchApp(nullptr, uriArray.get(), uriNum)) { -+ g_dbus_method_invocation_return_error(aReply, G_DBUS_ERROR, -+ G_DBUS_ERROR_FAILED, -+ "Failed to run target application."); -+ return; -+ } -+ g_dbus_method_invocation_return_value(aReply, nullptr); -+} -+ -+// The ActivateAction method is called when Desktop Actions are activated. -+// The action-name parameter is the name of the action. -+// ActivateAction :: (s,av,a{sv}) → () -+void DBusService::HandleFreedesktopActivateAction( -+ GVariant* aParameters, GDBusMethodInvocation* aReply) { -+ const char* actionName; -+ -+ // aParameters is "(s,av,a{sv})" type -+ RefPtr r = dont_AddRef(g_variant_get_child_value(aParameters, 0)); -+ if (!(actionName = g_variant_get_string(r, nullptr))) { -+ g_dbus_method_invocation_return_error( -+ aReply, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "Wrong params!"); -+ return; -+ } -+ -+ // TODO: Read av params and pass them to LaunchApp? -+ -+ // actionName matches desktop action defined in .desktop file. -+ // We implement it for .desktop file shipped by flatpak -+ // (taskcluster/docker/firefox-flatpak/org.mozilla.firefox.desktop) -+ bool ret = false; -+ if (!strcmp(actionName, "new-window")) { -+ ret = LaunchApp(nullptr, nullptr, 0); -+ } else if (!strcmp(actionName, "new-private-window")) { -+ ret = LaunchApp("--private-window", nullptr, 0); -+ } else if (!strcmp(actionName, "profile-manager-window")) { -+ ret = LaunchApp("--ProfileManager", nullptr, 0); -+ } -+ if (!ret) { -+ g_dbus_method_invocation_return_error(aReply, G_DBUS_ERROR, -+ G_DBUS_ERROR_FAILED, -+ "Failed to run target application."); -+ return; -+ } -+ g_dbus_method_invocation_return_value(aReply, nullptr); -+} -+ -+static void HandleMethodCall(GDBusConnection* aConnection, const gchar* aSender, -+ const gchar* aObjectPath, -+ const gchar* aInterfaceName, -+ const gchar* aMethodName, GVariant* aParameters, -+ GDBusMethodInvocation* aInvocation, -+ gpointer aUserData) { -+ MOZ_ASSERT(aUserData); -+ MOZ_ASSERT(NS_IsMainThread()); -+ -+ if (strcmp("org.freedesktop.Application", aInterfaceName) != 0) { -+ g_warning("DBusService: HandleMethodCall() wrong interface name %s", -+ aInterfaceName); -+ return; -+ } -+ if (strcmp("Activate", aMethodName) == 0) { -+ static_cast(aUserData)->HandleFreedesktopActivate( -+ aParameters, aInvocation); -+ } else if (strcmp("Open", aMethodName) == 0) { -+ static_cast(aUserData)->HandleFreedesktopOpen(aParameters, -+ aInvocation); -+ } else if (strcmp("ActivateAction", aMethodName) == 0) { -+ static_cast(aUserData)->HandleFreedesktopActivateAction( -+ aParameters, aInvocation); -+ } else { -+ g_warning("DBusService: HandleMethodCall() wrong method %s", aMethodName); -+ } -+} -+ -+static GVariant* HandleGetProperty(GDBusConnection* aConnection, -+ const gchar* aSender, -+ const gchar* aObjectPath, -+ const gchar* aInterfaceName, -+ const gchar* aPropertyName, GError** aError, -+ gpointer aUserData) { -+ MOZ_ASSERT(aUserData); -+ MOZ_ASSERT(NS_IsMainThread()); -+ g_set_error(aError, G_IO_ERROR, G_IO_ERROR_FAILED, -+ "%s:%s setting is not supported", aInterfaceName, aPropertyName); -+ return nullptr; -+} -+ -+static gboolean HandleSetProperty(GDBusConnection* aConnection, -+ const gchar* aSender, -+ const gchar* aObjectPath, -+ const gchar* aInterfaceName, -+ const gchar* aPropertyName, GVariant* aValue, -+ GError** aError, gpointer aUserData) { -+ MOZ_ASSERT(aUserData); -+ MOZ_ASSERT(NS_IsMainThread()); -+ g_set_error(aError, G_IO_ERROR, G_IO_ERROR_FAILED, -+ "%s:%s setting is not supported", aInterfaceName, aPropertyName); -+ return false; -+} -+ -+static const GDBusInterfaceVTable gInterfaceVTable = { -+ HandleMethodCall, HandleGetProperty, HandleSetProperty}; -+ -+void DBusService::OnBusAcquired(GDBusConnection* aConnection) { -+ GUniquePtr error; -+ mIntrospectionData = dont_AddRef(g_dbus_node_info_new_for_xml( -+ kIntrospectTemplate, getter_Transfers(error))); -+ if (!mIntrospectionData) { -+ g_warning("DBusService: g_dbus_node_info_new_for_xml() failed! %s", -+ error->message); -+ return; -+ } -+ -+ mRegistrationId = g_dbus_connection_register_object( -+ aConnection, GetDBusObjectPath(), mIntrospectionData->interfaces[0], -+ &gInterfaceVTable, this, /* user_data */ -+ nullptr, /* user_data_free_func */ -+ getter_Transfers(error)); /* GError** */ -+ -+ if (mRegistrationId == 0) { -+ g_warning( -+ "DBusService: g_dbus_connection_register_object() " -+ "failed! %s", -+ error->message); -+ return; -+ } -+} -+ -+void DBusService::OnNameAcquired(GDBusConnection* aConnection) { -+ mConnection = aConnection; -+} -+ -+void DBusService::OnNameLost(GDBusConnection* aConnection) { -+ mConnection = nullptr; -+ if (!mRegistrationId) { -+ return; -+ } -+ if (g_dbus_connection_unregister_object(aConnection, mRegistrationId)) { -+ mRegistrationId = 0; -+ } -+} -+ -+bool DBusService::StartFreedesktopListener() { -+ if (mDBusID) { -+ // We're already connected so we don't need to reconnect -+ return false; -+ } -+ -+ mDBusID = g_bus_own_name( -+ // if org.mozilla.Firefox is taken it means we're already running -+ // so use G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE and quit. -+ G_BUS_TYPE_SESSION, GetDBusBusName(), G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE, -+ [](GDBusConnection* aConnection, const gchar*, -+ gpointer aUserData) -> void { -+ static_cast(aUserData)->OnBusAcquired(aConnection); -+ }, -+ [](GDBusConnection* aConnection, const gchar*, -+ gpointer aUserData) -> void { -+ static_cast(aUserData)->OnNameAcquired(aConnection); -+ }, -+ [](GDBusConnection* aConnection, const gchar*, -+ gpointer aUserData) -> void { -+ static_cast(aUserData)->OnNameLost(aConnection); -+ }, -+ this, nullptr); -+ -+ if (!mDBusID) { -+ g_warning("DBusService: g_bus_own_name() failed!"); -+ return false; -+ } -+ -+ return true; -+} -+ -+void DBusService::StopFreedesktopListener() { -+ OnNameLost(mConnection); -+ if (mDBusID) { -+ g_bus_unown_name(mDBusID); -+ mDBusID = 0; -+ } -+ mIntrospectionData = nullptr; -+} -diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build ---- a/widget/gtk/moz.build -+++ b/widget/gtk/moz.build -@@ -172,9 +172,10 @@ - "AsyncDBus.h", - ] - UNIFIED_SOURCES += [ - "AsyncDBus.cpp", - "DBusMenu.cpp", -+ "DBusService.cpp", - ] - CXXFLAGS += CONFIG["MOZ_DBUS_CFLAGS"] - - CXXFLAGS += ["-Werror=switch"] - diff --git a/D209911.1715685535.diff b/D209911.1715685535.diff deleted file mode 100644 index 67bb1f9..0000000 --- a/D209911.1715685535.diff +++ /dev/null @@ -1,55 +0,0 @@ -diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp ---- a/toolkit/xre/nsAppRunner.cpp -+++ b/toolkit/xre/nsAppRunner.cpp -@@ -265,10 +265,13 @@ - #endif - - #ifdef MOZ_WIDGET_GTK - # include "nsAppShell.h" - #endif -+#ifdef MOZ_ENABLE_DBUS -+# include "DBusService.h" -+#endif - - extern uint32_t gRestartMode; - extern void InstallSignalHandlers(const char* ProgramName); - - #define FILE_COMPATIBILITY_INFO "compatibility.ini"_ns -@@ -2132,10 +2135,14 @@ - - #if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) || defined(XP_MACOSX) - printf(" --headless Run without a GUI.\n"); - #endif - -+#if defined(MOZ_ENABLE_DBUS) -+ printf(" --dbus-service Run as DBus service.\n"); -+#endif -+ - // this works, but only after the components have registered. so if you drop - // in a new command line handler, --help won't not until the second run. out - // of the bug, because we ship a component.reg file, it works correctly. - DumpArbitraryHelp(); - } -@@ -4370,10 +4377,21 @@ - DumpFullVersion(); - *aExitFlag = true; - return 0; - } - -+#ifdef MOZ_ENABLE_DBUS -+ if (CheckArg("dbus-service")) { -+ UniquePtr dbusService = MakeUnique(gArgv[0]); -+ if (dbusService->Init()) { -+ dbusService->Run(); -+ } -+ *aExitFlag = true; -+ return 1; -+ } -+#endif -+ - rv = XRE_InitCommandLine(gArgc, gArgv); - NS_ENSURE_SUCCESS(rv, 1); - - return 0; - } - diff --git a/D210158.1715685536.diff b/D210158.1715685536.diff deleted file mode 100644 index 4228f3a..0000000 --- a/D210158.1715685536.diff +++ /dev/null @@ -1,54 +0,0 @@ -diff -up firefox-126.0/widget/gtk/DBusService.cpp.D210158.1715685536 firefox-126.0/widget/gtk/DBusService.cpp ---- firefox-126.0/widget/gtk/DBusService.cpp.D210158.1715685536 2024-05-14 11:19:02.098199593 +0200 -+++ firefox-126.0/widget/gtk/DBusService.cpp 2024-05-14 11:24:44.236939835 +0200 -@@ -85,38 +85,24 @@ static const char* kIntrospectTemplate = - - bool DBusService::LaunchApp(const char* aCommand, const char** aURIList, - int aURIListLen) { -- // Allocate space for all uris, executable name, command if supplied and -- // null terminator -- int paramsNum = aURIListLen + 2; -+ nsAutoCString param(mAppFile); - if (aCommand) { -- paramsNum++; -- } -- -- char** argv = (char**)moz_xmalloc(sizeof(char*) * paramsNum); -- int argc = 0; -- argv[argc++] = strdup(mAppFile); -- if (aCommand) { -- argv[argc++] = strdup(aCommand); -+ param.Append(" "); -+ param.Append(aCommand); - } - for (int i = 0; aURIList && i < aURIListLen; i++) { -- argv[argc++] = strdup(aURIList[i]); -- } -- argv[argc++] = nullptr; -- -- nsAutoCString exePath; -- nsCOMPtr lf; -- bool ret = false; -- if (NS_SUCCEEDED(XRE_GetBinaryPath(getter_AddRefs(lf)))) { -- if (NS_SUCCEEDED(lf->GetNativePath(exePath))) { -- ret = (PR_CreateProcessDetached(exePath.get(), argv, nullptr, nullptr) != -- PR_FAILURE); -- } -+ param.Append(" "); -+ GUniquePtr escUri(g_shell_quote(aURIList[i])); -+ param.Append(escUri.get()); - } - -- for (int i = 0; i < argc; i++) { -- free(argv[i]); -+ char* argv[] = {strdup("/bin/sh"), strdup("-c"), strdup(param.get()), -+ nullptr}; -+ int ret = -+ PR_CreateProcessDetached("/bin/sh", argv, nullptr, nullptr) != PR_FAILURE; -+ for (auto str : argv) { -+ free(str); - } -- free(argv); - return ret; - } - diff --git a/D210159.1715685538.diff b/D210159.1715685538.diff deleted file mode 100644 index c0f8552..0000000 --- a/D210159.1715685538.diff +++ /dev/null @@ -1,49 +0,0 @@ -diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp ---- a/toolkit/xre/nsAppRunner.cpp -+++ b/toolkit/xre/nsAppRunner.cpp -@@ -2136,11 +2136,15 @@ - #if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) || defined(XP_MACOSX) - printf(" --headless Run without a GUI.\n"); - #endif - - #if defined(MOZ_ENABLE_DBUS) -- printf(" --dbus-service Run as DBus service.\n"); -+ printf( -+ " --dbus-service Run as DBus service for " -+ "org.freedesktop.Application and\n" -+ " set a launcher (usually /usr/bin/appname " -+ "script) for it."); - #endif - - // this works, but only after the components have registered. so if you drop - // in a new command line handler, --help won't not until the second run. out - // of the bug, because we ship a component.reg file, it works correctly. -@@ -4378,17 +4382,24 @@ - *aExitFlag = true; - return 0; - } - - #ifdef MOZ_ENABLE_DBUS -- if (CheckArg("dbus-service")) { -- UniquePtr dbusService = MakeUnique(gArgv[0]); -+ const char* dbusServiceLauncher = nullptr; -+ ar = CheckArg("dbus-service", &dbusServiceLauncher, CheckArgFlag::None); -+ if (ar == ARG_BAD) { -+ Output(true, "Missing launcher param for --dbus-service\n"); -+ return 1; -+ } -+ if (ar == ARG_FOUND) { -+ UniquePtr dbusService = -+ MakeUnique(dbusServiceLauncher); - if (dbusService->Init()) { - dbusService->Run(); - } - *aExitFlag = true; -- return 1; -+ return 0; - } - #endif - - rv = XRE_InitCommandLine(gArgc, gArgv); - NS_ENSURE_SUCCESS(rv, 1); - diff --git a/D210430.1715848796.diff b/D210430.1715848796.diff deleted file mode 100644 index 18e3d4e..0000000 --- a/D210430.1715848796.diff +++ /dev/null @@ -1,121 +0,0 @@ -diff --git a/toolkit/components/remote/nsDBusRemoteClient.h b/toolkit/components/remote/nsDBusRemoteClient.h ---- a/toolkit/components/remote/nsDBusRemoteClient.h -+++ b/toolkit/components/remote/nsDBusRemoteClient.h -@@ -29,10 +29,10 @@ - void Shutdown(); - - private: - bool GetRemoteDestinationName(const char* aProgram, const char* aProfile, - nsCString& aDestinationName); -- nsresult DoSendDBusCommandLine(const char* aProgram, const char* aProfile, -- const char* aBuffer, int aLength); -+ nsresult DoSendDBusCommandLine(const char* aProfile, const char* aBuffer, -+ int aLength); - }; - - #endif // DBusRemoteClient_h__ -diff --git a/toolkit/components/remote/nsDBusRemoteClient.cpp b/toolkit/components/remote/nsDBusRemoteClient.cpp ---- a/toolkit/components/remote/nsDBusRemoteClient.cpp -+++ b/toolkit/components/remote/nsDBusRemoteClient.cpp -@@ -6,10 +6,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 "nsDBusRemoteClient.h" - #include "RemoteUtils.h" -+#include "nsAppRunner.h" - #include "mozilla/XREAppData.h" - #include "mozilla/Logging.h" - #include "mozilla/Base64.h" - #include "nsPrintfCString.h" - #include "mozilla/GUniquePtr.h" -@@ -36,11 +37,11 @@ - } - - nsresult nsDBusRemoteClient::SendCommandLine( - const char* aProgram, const char* aProfile, int32_t argc, char** argv, - const char* aStartupToken, char** aResponse, bool* aWindowFound) { -- NS_ENSURE_TRUE(aProgram, NS_ERROR_INVALID_ARG); -+ NS_ENSURE_TRUE(aProfile, NS_ERROR_INVALID_ARG); - - LOG("nsDBusRemoteClient::SendCommandLine"); - - int commandLineLength; - char* commandLine = -@@ -48,12 +49,11 @@ - if (!commandLine) { - LOG(" failed to create command line"); - return NS_ERROR_FAILURE; - } - -- nsresult rv = -- DoSendDBusCommandLine(aProgram, aProfile, commandLine, commandLineLength); -+ nsresult rv = DoSendDBusCommandLine(aProfile, commandLine, commandLineLength); - free(commandLine); - - *aWindowFound = NS_SUCCEEDED(rv); - - LOG("DoSendDBusCommandLine %s", NS_SUCCEEDED(rv) ? "OK" : "FAILED"); -@@ -97,18 +97,17 @@ - } - - return true; - } - --nsresult nsDBusRemoteClient::DoSendDBusCommandLine(const char* aProgram, -- const char* aProfile, -+nsresult nsDBusRemoteClient::DoSendDBusCommandLine(const char* aProfile, - const char* aBuffer, - int aLength) { - LOG("nsDBusRemoteClient::DoSendDBusCommandLine()"); - -- nsAutoCString appName(aProgram); -- mozilla::XREAppData::SanitizeNameForDBus(appName); -+ nsAutoCString appName; -+ gAppData->GetDBusAppName(appName); - - nsAutoCString destinationName; - if (!GetRemoteDestinationName(appName.get(), aProfile, destinationName)) { - LOG(" failed to get remote destination name"); - return NS_ERROR_FAILURE; -diff --git a/toolkit/components/remote/nsDBusRemoteServer.cpp b/toolkit/components/remote/nsDBusRemoteServer.cpp ---- a/toolkit/components/remote/nsDBusRemoteServer.cpp -+++ b/toolkit/components/remote/nsDBusRemoteServer.cpp -@@ -6,10 +6,11 @@ - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - #include "nsDBusRemoteServer.h" - - #include "nsCOMPtr.h" -+#include "nsAppRunner.h" - #include "mozilla/XREAppData.h" - #include "mozilla/Base64.h" - #include "mozilla/ScopeExit.h" - #include "mozilla/GUniquePtr.h" - #include "MainThreadUtils.h" -@@ -186,17 +187,18 @@ - - nsresult nsDBusRemoteServer::Startup(const char* aAppName, - const char* aProfileName) { - MOZ_DIAGNOSTIC_ASSERT(!mDBusID); - -- // Don't even try to start without any application/profile name -- if (!aAppName || aAppName[0] == '\0' || !aProfileName || -- aProfileName[0] == '\0') -- return NS_ERROR_INVALID_ARG; -+ // Don't even try to start without any profile name -+ if (!aProfileName || aProfileName[0] == '\0') return NS_ERROR_INVALID_ARG; - -- mAppName = aAppName; -- mozilla::XREAppData::SanitizeNameForDBus(mAppName); -+ // aAppName is remoting name which can be something like org.mozilla.appname -+ // or so. -+ // For DBus service we rather use general application DBus identifier -+ // which is shared by all DBus services. -+ gAppData->GetDBusAppName(mAppName); - - nsAutoCString profileName; - MOZ_TRY( - mozilla::Base64Encode(aProfileName, strlen(aProfileName), profileName)); - - diff --git a/D223285.1729586039.diff b/D223285.1729586039.diff deleted file mode 100644 index f3ed973..0000000 --- a/D223285.1729586039.diff +++ /dev/null @@ -1,478 +0,0 @@ -diff --git a/widget/gtk/mozwayland/mozwayland.h b/widget/gtk/mozwayland/mozwayland.h ---- a/widget/gtk/mozwayland/mozwayland.h -+++ b/widget/gtk/mozwayland/mozwayland.h -@@ -137,14 +137,10 @@ - wl_proxy_marshal((struct wl_proxy*)wl_surface, WL_SURFACE_DAMAGE_BUFFER, x, y, - width, height); - } - #endif - --#ifndef WL_POINTER_RELEASE_SINCE_VERSION --# define WL_POINTER_RELEASE_SINCE_VERSION 3 --#endif -- - #ifndef WL_POINTER_AXIS_ENUM - # define WL_POINTER_AXIS_ENUM - /** - * @ingroup iface_wl_pointer - * axis types -@@ -230,10 +226,58 @@ - */ - WL_POINTER_AXIS_RELATIVE_DIRECTION_INVERTED = 1, - }; - #endif /* WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM */ - -+#ifndef WL_POINTER_AXIS_SOURCE_ENUM -+# define WL_POINTER_AXIS_SOURCE_ENUM -+/** -+ * @ingroup iface_wl_pointer -+ * axis source types -+ * -+ * Describes the source types for axis events. This indicates to the -+ * client how an axis event was physically generated; a client may -+ * adjust the user interface accordingly. For example, scroll events -+ * from a "finger" source may be in a smooth coordinate space with -+ * kinetic scrolling whereas a "wheel" source may be in discrete steps -+ * of a number of lines. -+ * -+ * The "continuous" axis source is a device generating events in a -+ * continuous coordinate space, but using something other than a -+ * finger. One example for this source is button-based scrolling where -+ * the vertical motion of a device is converted to scroll events while -+ * a button is held down. -+ * -+ * The "wheel tilt" axis source indicates that the actual device is a -+ * wheel but the scroll event is not caused by a rotation but a -+ * (usually sideways) tilt of the wheel. -+ */ -+enum wl_pointer_axis_source { -+ /** -+ * a physical wheel rotation -+ */ -+ WL_POINTER_AXIS_SOURCE_WHEEL = 0, -+ /** -+ * finger on a touch surface -+ */ -+ WL_POINTER_AXIS_SOURCE_FINGER = 1, -+ /** -+ * continuous coordinate space -+ */ -+ WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2, -+ /** -+ * a physical wheel tilt -+ * @since 6 -+ */ -+ WL_POINTER_AXIS_SOURCE_WHEEL_TILT = 3, -+}; -+/** -+ * @ingroup iface_wl_pointer -+ */ -+# define WL_POINTER_AXIS_SOURCE_WHEEL_TILT_SINCE_VERSION 6 -+#endif /* WL_POINTER_AXIS_SOURCE_ENUM */ -+ - /** - * @ingroup iface_wl_pointer - * @struct wl_pointer_listener - */ - struct moz_wl_pointer_listener { -@@ -538,10 +582,18 @@ - */ - void (*axis_relative_direction)(void* data, struct wl_pointer* wl_pointer, - uint32_t axis, uint32_t direction); - }; - -+#ifndef WL_POINTER_RELEASE_SINCE_VERSION -+# define WL_POINTER_RELEASE_SINCE_VERSION 3 -+#endif -+ -+#ifndef WL_POINTER_AXIS_VALUE120_SINCE_VERSION -+# define WL_POINTER_AXIS_VALUE120_SINCE_VERSION 8 -+#endif -+ - #ifdef __cplusplus - } - #endif - - #endif /* __MozWayland_h_ */ -diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp ---- a/widget/gtk/nsWaylandDisplay.cpp -+++ b/widget/gtk/nsWaylandDisplay.cpp -@@ -56,13 +56,12 @@ - return gWaylandDisplay; - } - - void nsWaylandDisplay::SetShm(wl_shm* aShm) { mShm = aShm; } - --class TouchWindow { -+class WaylandPointerEvent { - public: -- already_AddRefed GetAndClearWindow() { return mWindow.forget(); } - RefPtr TakeWindow(wl_surface* aSurface) { - if (!aSurface) { - mWindow = nullptr; - } else { - GdkWindow* window = -@@ -71,33 +70,85 @@ - g_object_get_data(G_OBJECT(window), "nsWindow")) - : nullptr; - } - return mWindow; - } -+ already_AddRefed GetAndClearWindow() { return mWindow.forget(); } -+ RefPtr GetWindow() { return mWindow; } -+ -+ void SetSource(int32_t aSource) { mSource = aSource; } -+ -+ void SetDelta120(uint32_t aAxis, int32_t aDelta) { -+ switch (aAxis) { -+ case WL_POINTER_AXIS_VERTICAL_SCROLL: -+ mDeltaY = aDelta / 120.0f; -+ break; -+ case WL_POINTER_AXIS_HORIZONTAL_SCROLL: -+ mDeltaX = aDelta / 120.0f; -+ break; -+ default: -+ NS_WARNING("WaylandPointerEvent::SetDelta120(): wrong axis!"); -+ break; -+ } -+ } -+ -+ void SetTime(uint32_t aTime) { mTime = aTime; } -+ -+ void SendScrollEvent() { -+ if (!mWindow) { -+ return; -+ } -+ -+ // nsWindow::OnSmoothScrollEvent() may spin event loop so -+ // mWindow/mSource/delta may be replaced. -+ int32_t source = mSource; -+ float deltaX = mDeltaX; -+ float deltaY = mDeltaY; -+ -+ mSource = -1; -+ mDeltaX = mDeltaY = 0.0f; -+ -+ // We process wheel events only now. -+ if (source != WL_POINTER_AXIS_SOURCE_WHEEL) { -+ return; -+ } -+ -+ RefPtr win = mWindow; -+ uint32_t eventTime = mTime; -+ win->OnSmoothScrollEvent(eventTime, deltaX, deltaY); -+ } -+ -+ void Clear() { mWindow = nullptr; } -+ -+ WaylandPointerEvent() { Clear(); } - - private: - StaticRefPtr mWindow; -+ uint32_t mTime = 0; -+ int32_t mSource = 0; -+ float mDeltaX = 0; -+ float mDeltaY = 0; - }; - --static TouchWindow sTouchWindow; -+static WaylandPointerEvent sHoldGesture; - - static void gesture_hold_begin(void* data, - struct zwp_pointer_gesture_hold_v1* hold, - uint32_t serial, uint32_t time, - struct wl_surface* surface, uint32_t fingers) { -- RefPtr window = sTouchWindow.TakeWindow(surface); -+ RefPtr window = sHoldGesture.TakeWindow(surface); - if (!window) { - return; - } - window->OnTouchpadHoldEvent(GDK_TOUCHPAD_GESTURE_PHASE_BEGIN, time, fingers); - } - - static void gesture_hold_end(void* data, - struct zwp_pointer_gesture_hold_v1* hold, - uint32_t serial, uint32_t time, - int32_t cancelled) { -- RefPtr window = sTouchWindow.GetAndClearWindow(); -+ RefPtr window = sHoldGesture.GetAndClearWindow(); - if (!window) { - return; - } - window->OnTouchpadHoldEvent(cancelled ? GDK_TOUCHPAD_GESTURE_PHASE_CANCEL - : GDK_TOUCHPAD_GESTURE_PHASE_END, -@@ -105,16 +156,22 @@ - } - - static const struct zwp_pointer_gesture_hold_v1_listener gesture_hold_listener = - {gesture_hold_begin, gesture_hold_end}; - -+static WaylandPointerEvent sScrollEvent; -+ - static void pointer_handle_enter(void* data, struct wl_pointer* pointer, - uint32_t serial, struct wl_surface* surface, -- wl_fixed_t sx, wl_fixed_t sy) {} -+ wl_fixed_t sx, wl_fixed_t sy) { -+ sScrollEvent.TakeWindow(surface); -+} - - static void pointer_handle_leave(void* data, struct wl_pointer* pointer, -- uint32_t serial, struct wl_surface* surface) {} -+ uint32_t serial, struct wl_surface* surface) { -+ sScrollEvent.Clear(); -+} - - static void pointer_handle_motion(void* data, struct wl_pointer* pointer, - uint32_t time, wl_fixed_t sx, wl_fixed_t sy) { - } - -@@ -122,26 +179,60 @@ - uint32_t serial, uint32_t time, - uint32_t button, uint32_t state) {} - - static void pointer_handle_axis(void* data, struct wl_pointer* pointer, - uint32_t time, uint32_t axis, -- wl_fixed_t value) {} -+ wl_fixed_t value) { -+ sScrollEvent.SetTime(time); -+} - --static void pointer_handle_frame(void* data, struct wl_pointer* pointer) {} -+static void pointer_handle_frame(void* data, struct wl_pointer* pointer) { -+ sScrollEvent.SendScrollEvent(); -+} - - static void pointer_handle_axis_source( - void* data, struct wl_pointer* pointer, -- /*enum wl_pointer_axis_source */ uint32_t source) {} -+ /*enum wl_pointer_axis_source */ uint32_t source) { -+ sScrollEvent.SetSource(source); -+} - - static void pointer_handle_axis_stop(void* data, struct wl_pointer* pointer, - uint32_t time, uint32_t axis) {} - - static void pointer_handle_axis_discrete(void* data, struct wl_pointer* pointer, - uint32_t axis, int32_t value) {} - - static void pointer_handle_axis_value120(void* data, struct wl_pointer* pointer, -- uint32_t axis, int32_t value) {} -+ uint32_t axis, int32_t value) { -+ sScrollEvent.SetDelta120(axis, value); -+} -+ -+/* -+ * Example of scroll events we get for various devices. Note that -+ * even three different devices has the same wl_pointer. -+ * -+ * Standard mouse wheel: -+ * -+ * pointer_handle_axis_source pointer 0x7fd14fd4bac0 source 0 -+ * pointer_handle_axis_value120 pointer 0x7fd14fd4bac0 value 120 -+ * pointer_handle_axis pointer 0x7fd14fd4bac0 time 9470441 value 10.000000 -+ * pointer_handle_frame -+ * -+ * Hi-res mouse wheel: -+ * -+ * pointer_handle_axis_source pointer 0x7fd14fd4bac0 source 0 -+ * pointer_handle_axis_value120 pointer 0x7fd14fd4bac0 value -24 -+ * pointer_handle_axis pointer 0x7fd14fd4bac0 time 9593205 value -1.992188 -+ * pointer_handle_frame -+ * -+ * Touchpad: -+ * -+ * pointer_handle_axis_source pointer 0x7fd14fd4bac0 source 1 -+ * pointer_handle_axis pointer 0x7fd14fd4bac0 time 9431830 value 0.312500 -+ * pointer_handle_axis pointer 0x7fd14fd4bac0 time 9431830 value -1.015625 -+ * pointer_handle_frame -+ */ - - static const struct moz_wl_pointer_listener pointer_listener = { - pointer_handle_enter, pointer_handle_leave, - pointer_handle_motion, pointer_handle_button, - pointer_handle_axis, pointer_handle_frame, -@@ -363,12 +454,13 @@ - WaylandRegistryBind( - registry, id, &xdg_dbus_annotation_manager_v1_interface, 1); - display->SetXdgDbusAnnotationManager(annotationManager); - } else if (iface.EqualsLiteral("wl_seat") && - version >= WL_POINTER_RELEASE_SINCE_VERSION) { -- auto* seat = WaylandRegistryBind(registry, id, &wl_seat_interface, -- WL_POINTER_RELEASE_SINCE_VERSION); -+ auto* seat = WaylandRegistryBind( -+ registry, id, &wl_seat_interface, -+ MIN(version, WL_POINTER_AXIS_VALUE120_SINCE_VERSION)); - display->SetSeat(seat, id); - } else if (iface.EqualsLiteral("wp_fractional_scale_manager_v1")) { - auto* manager = WaylandRegistryBind( - registry, id, &wp_fractional_scale_manager_v1_interface, 1); - display->SetFractionalScaleManager(manager); -diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h ---- a/widget/gtk/nsWindow.h -+++ b/widget/gtk/nsWindow.h -@@ -256,10 +256,11 @@ - void OnContainerFocusOutEvent(GdkEventFocus* aEvent); - gboolean OnKeyPressEvent(GdkEventKey* aEvent); - gboolean OnKeyReleaseEvent(GdkEventKey* aEvent); - - void OnScrollEvent(GdkEventScroll* aEvent); -+ void OnSmoothScrollEvent(uint32_t aTime, float aDeltaX, float aDeltaY); - - void OnVisibilityNotifyEvent(GdkVisibilityState aState); - void OnWindowStateEvent(GtkWidget* aWidget, GdkEventWindowState* aEvent); - void OnDragDataReceivedEvent(GtkWidget* aWidget, GdkDragContext* aDragContext, - gint aX, gint aY, -@@ -900,18 +901,35 @@ - - // Next/Previous popups in Wayland popup hierarchy. - RefPtr mWaylandPopupNext; - RefPtr mWaylandPopupPrev; - -+ // When popup is resized by Gtk by move-to-rect callback, -+ // we store final popup size here. Then we use mMoveToRectPopupSize size -+ // in following popup operations unless mLayoutPopupSizeCleared is set. -+ LayoutDeviceIntSize mMoveToRectPopupSize; -+ - #ifdef MOZ_ENABLE_DBUS - RefPtr mDBusMenuBar; - #endif - -- // When popup is resized by Gtk by move-to-rect callback, -- // we store final popup size here. Then we use mMoveToRectPopupSize size -- // in following popup operations unless mLayoutPopupSizeCleared is set. -- LayoutDeviceIntSize mMoveToRectPopupSize; -+ struct LastMouseCoordinates { -+ template -+ void Set(Event* aEvent) { -+ mX = aEvent->x; -+ mY = aEvent->y; -+ mRootX = aEvent->x_root; -+ mRootY = aEvent->y_root; -+ } -+ -+ float mX = 0.0f, mY = 0.0f; -+ float mRootX = 0.0f, mRootY = 0.0f; -+ } mLastMouseCoordinates; -+ -+ // We don't want to fire scroll event with the same timestamp as -+ // smooth scroll event. -+ guint32 mLastSmoothScrollEventTime = GDK_CURRENT_TIME; - - /** - * |mIMContext| takes all IME related stuff. - * - * This is owned by the top-level nsWindow or the topmost child -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp ---- a/widget/gtk/nsWindow.cpp -+++ b/widget/gtk/nsWindow.cpp -@@ -4152,10 +4152,11 @@ - } - - // Check before checking for ungrab as the button state may have - // changed while a non-Gecko ancestor window had a pointer grab. - DispatchMissedButtonReleases(aEvent); -+ mLastMouseCoordinates.Set(aEvent); - - WidgetMouseEvent event(true, eMouseEnterIntoWidget, this, - WidgetMouseEvent::eReal); - - event.mRefPoint = GdkEventCoordsToDevicePixels(aEvent->x, aEvent->y); -@@ -4373,10 +4374,12 @@ - newSize.height, mAspectRatio); - gtk_window_resize(GTK_WINDOW(mShell), newSize.width, newSize.height); - } - - void nsWindow::OnMotionNotifyEvent(GdkEventMotion* aEvent) { -+ mLastMouseCoordinates.Set(aEvent); -+ - if (!mGdkWindow) { - return; - } - - // Emulate gdk_window_begin_resize_drag() for windows -@@ -4625,10 +4628,11 @@ - - void nsWindow::OnButtonPressEvent(GdkEventButton* aEvent) { - LOG("Button %u press\n", aEvent->button); - - SetLastMousePressEvent((GdkEvent*)aEvent); -+ mLastMouseCoordinates.Set(aEvent); - - // If you double click in GDK, it will actually generate a second - // GDK_BUTTON_PRESS before sending the GDK_2BUTTON_PRESS, and this is - // different than the DOM spec. GDK puts this in the queue - // programatically, so it's safe to assume that if there's a -@@ -4762,10 +4766,11 @@ - - void nsWindow::OnButtonReleaseEvent(GdkEventButton* aEvent) { - LOG("Button %u release\n", aEvent->button); - - SetLastMousePressEvent(nullptr); -+ mLastMouseCoordinates.Set(aEvent); - - if (!mGdkWindow) { - return; - } - -@@ -4997,11 +5002,19 @@ - } - return TRUE; - } - - void nsWindow::OnScrollEvent(GdkEventScroll* aEvent) { -- LOG("OnScrollEvent"); -+ LOG("OnScrollEvent time %d", aEvent->time); -+ -+ mLastMouseCoordinates.Set(aEvent); -+ -+ // This event was already handled by OnSmoothScrollEvent(). -+ if (aEvent->time != GDK_CURRENT_TIME && -+ mLastSmoothScrollEventTime == aEvent->time) { -+ return; -+ } - - // check to see if we should rollup - if (CheckForRollup(aEvent->x_root, aEvent->y_root, true, false)) { - return; - } -@@ -5148,10 +5161,39 @@ - wheelEvent.AssignEventTime(GetWidgetEventTime(aEvent->time)); - - DispatchInputEvent(&wheelEvent); - } - -+void nsWindow::OnSmoothScrollEvent(uint32_t aTime, float aDeltaX, -+ float aDeltaY) { -+ LOG("OnSmoothScrollEvent time %d dX %f dY %f", aTime, aDeltaX, aDeltaY); -+ -+ // This event was already handled by OnSmoothScrollEvent(). -+ mLastSmoothScrollEventTime = aTime; -+ -+ if (CheckForRollup(mLastMouseCoordinates.mRootX, mLastMouseCoordinates.mRootY, -+ true, false)) { -+ return; -+ } -+ -+ WidgetWheelEvent wheelEvent(true, eWheel, this); -+ wheelEvent.mDeltaMode = dom::WheelEvent_Binding::DOM_DELTA_LINE; -+ // Use the same constant as nsWindow::OnScrollEvent(). -+ wheelEvent.mDeltaX = aDeltaX * 3; -+ wheelEvent.mDeltaY = aDeltaY * 3; -+ wheelEvent.mWheelTicksX = aDeltaX; -+ wheelEvent.mWheelTicksY = aDeltaY; -+ wheelEvent.mIsNoLineOrPageDelta = true; -+ wheelEvent.mRefPoint = GdkEventCoordsToDevicePixels(mLastMouseCoordinates.mX, -+ mLastMouseCoordinates.mY); -+ -+ KeymapWrapper::InitInputEvent(wheelEvent, -+ KeymapWrapper::GetCurrentModifierState()); -+ wheelEvent.AssignEventTime(GetWidgetEventTime(aTime)); -+ DispatchInputEvent(&wheelEvent); -+} -+ - void nsWindow::DispatchPanGesture(PanGestureInput& aPanInput) { - MOZ_ASSERT(NS_IsMainThread()); - - if (mSwipeTracker) { - // Give the swipe tracker a first pass at the event. If a new pan gesture - diff --git a/D224842.1729586219.diff b/D224842.1729586219.diff deleted file mode 100644 index 30c76c0..0000000 --- a/D224842.1729586219.diff +++ /dev/null @@ -1,48 +0,0 @@ -diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp ---- a/widget/gtk/nsWaylandDisplay.cpp -+++ b/widget/gtk/nsWaylandDisplay.cpp -@@ -244,24 +244,34 @@ - pointer_handle_axis_source, pointer_handle_axis_stop, - pointer_handle_axis_discrete, pointer_handle_axis_value120, - }; - - void nsWaylandDisplay::SetPointer(wl_pointer* aPointer) { -- if (!mPointerGestures || wl_proxy_get_version((struct wl_proxy*)aPointer) < -- WL_POINTER_RELEASE_SINCE_VERSION) { -+ // Don't even try on such old interface -+ if (wl_proxy_get_version((struct wl_proxy*)aPointer) < -+ WL_POINTER_RELEASE_SINCE_VERSION) { - return; - } -+ - MOZ_DIAGNOSTIC_ASSERT(!mPointer); - mPointer = aPointer; -- wl_pointer_add_listener(mPointer, -- (const wl_pointer_listener*)&pointer_listener, this); -+ -+ // We're interested in pointer_handle_axis_value120() only for now. -+ if (wl_proxy_get_version((struct wl_proxy*)aPointer) >= -+ WL_POINTER_AXIS_VALUE120_SINCE_VERSION) { -+ wl_pointer_add_listener( -+ mPointer, (const wl_pointer_listener*)&pointer_listener, this); -+ } - -- mPointerGestureHold = -- zwp_pointer_gestures_v1_get_hold_gesture(mPointerGestures, mPointer); -- zwp_pointer_gesture_hold_v1_set_user_data(mPointerGestureHold, this); -- zwp_pointer_gesture_hold_v1_add_listener(mPointerGestureHold, -- &gesture_hold_listener, this); -+ // mPointerGestures is set by zwp_pointer_gestures_v1 if we have it. -+ if (mPointerGestures) { -+ mPointerGestureHold = -+ zwp_pointer_gestures_v1_get_hold_gesture(mPointerGestures, mPointer); -+ zwp_pointer_gesture_hold_v1_set_user_data(mPointerGestureHold, this); -+ zwp_pointer_gesture_hold_v1_add_listener(mPointerGestureHold, -+ &gesture_hold_listener, this); -+ } - } - - void nsWaylandDisplay::RemovePointer() { - wl_pointer_release(mPointer); - mPointer = nullptr; - diff --git a/D225439.1729586066.diff b/D225439.1729586066.diff deleted file mode 100644 index 212ee35..0000000 --- a/D225439.1729586066.diff +++ /dev/null @@ -1,223 +0,0 @@ -diff --git a/gfx/layers/apz/src/InputQueue.cpp b/gfx/layers/apz/src/InputQueue.cpp ---- a/gfx/layers/apz/src/InputQueue.cpp -+++ b/gfx/layers/apz/src/InputQueue.cpp -@@ -440,28 +440,33 @@ - APZEventResult InputQueue::ReceivePanGestureInput( - const RefPtr& aTarget, - TargetConfirmationFlags aFlags, const PanGestureInput& aEvent) { - APZEventResult result(aTarget, aFlags); - -+#ifndef MOZ_WIDGET_GTK - if (aEvent.mType == PanGestureInput::PANGESTURE_MAYSTART || - aEvent.mType == PanGestureInput::PANGESTURE_CANCELLED) { - // Ignore these events for now. - result.SetStatusAsConsumeDoDefault(aTarget); - return result; - } -+#endif - - if (aEvent.mType == PanGestureInput::PANGESTURE_INTERRUPTED) { - if (RefPtr block = mActivePanGestureBlock.get()) { - mQueuedInputs.AppendElement(MakeUnique(aEvent, *block)); - ProcessQueue(); - } - result.SetStatusAsIgnore(); - return result; - } - -+ bool startsNewBlock = aEvent.mType == PanGestureInput::PANGESTURE_MAYSTART || -+ aEvent.mType == PanGestureInput::PANGESTURE_START; -+ - RefPtr block; -- if (aEvent.mType != PanGestureInput::PANGESTURE_START) { -+ if (!startsNewBlock) { - block = mActivePanGestureBlock.get(); - } - - PanGestureInput event = aEvent; - -@@ -481,14 +486,14 @@ - // However, if there is a non-momentum event (indicating the user - // continued scrolling on the touchpad), a new input block is started - // by turning the event into a pan-start below. - return result; - } -- if (event.mType != PanGestureInput::PANGESTURE_START) { -- // Only PANGESTURE_START events are allowed to start a new pan gesture -- // block, but we really want to start a new block here, so we magically -- // turn this input into a PANGESTURE_START. -+ if (!startsNewBlock) { -+ // Only PANGESTURE_MAYSTART or PANGESTURE_START events are allowed to -+ // start a new pan gesture block, but we really want to start a new block -+ // here, so we magically turn this input into a PANGESTURE_START. - INPQ_LOG( - "transmogrifying pan input %d to PANGESTURE_START for new block\n", - event.mType); - event.mType = PanGestureInput::PANGESTURE_START; - } -diff --git a/gfx/layers/apz/test/gtest/TestPanning.cpp b/gfx/layers/apz/test/gtest/TestPanning.cpp ---- a/gfx/layers/apz/test/gtest/TestPanning.cpp -+++ b/gfx/layers/apz/test/gtest/TestPanning.cpp -@@ -78,10 +78,31 @@ - EXPECT_EQ(ParentLayerPoint(), pointOut); - EXPECT_EQ(AsyncTransform(), viewTransformOut); - - apzc->AssertStateIsReset(); - } -+ -+ void PanWithFling() { -+ // Send a pan gesture that triggers a fling animation at the end. -+ // Note that we need at least two _PAN events to have enough samples -+ // in the velocity tracker to compute a fling velocity. -+ PanGesture(PanGestureInput::PANGESTURE_START, apzc, ScreenIntPoint(50, 80), -+ ScreenPoint(0, 2), mcc->Time()); -+ mcc->AdvanceByMillis(5); -+ apzc->AdvanceAnimations(mcc->GetSampleTime()); -+ PanGesture(PanGestureInput::PANGESTURE_PAN, apzc, ScreenIntPoint(50, 80), -+ ScreenPoint(0, 10), mcc->Time()); -+ mcc->AdvanceByMillis(5); -+ apzc->AdvanceAnimations(mcc->GetSampleTime()); -+ PanGesture(PanGestureInput::PANGESTURE_PAN, apzc, ScreenIntPoint(50, 80), -+ ScreenPoint(0, 10), mcc->Time()); -+ mcc->AdvanceByMillis(5); -+ apzc->AdvanceAnimations(mcc->GetSampleTime()); -+ PanGesture(PanGestureInput::PANGESTURE_END, apzc, ScreenIntPoint(50, 80), -+ ScreenPoint(0, 0), mcc->Time(), MODIFIER_NONE, -+ /*aSimulateMomentum=*/true); -+ } - }; - - // In the each of the following 4 pan tests we are performing two pan gestures: - // vertical pan from top to bottom and back - from bottom to top. According to - // the pointer-events/touch-action spec AUTO and PAN_Y touch-action values allow -@@ -218,27 +239,11 @@ - EXPECT_NE(velocityFromPartialData, velocityFromFullDataViaHistory); - } - - TEST_F(APZCPanningTester, DuplicatePanEndEvents_Bug1833950) { - // Send a pan gesture that triggers a fling animation at the end. -- // Note that we need at least two _PAN events to have enough samples -- // in the velocity tracker to compute a fling velocity. -- PanGesture(PanGestureInput::PANGESTURE_START, apzc, ScreenIntPoint(50, 80), -- ScreenPoint(0, 2), mcc->Time()); -- mcc->AdvanceByMillis(5); -- apzc->AdvanceAnimations(mcc->GetSampleTime()); -- PanGesture(PanGestureInput::PANGESTURE_PAN, apzc, ScreenIntPoint(50, 80), -- ScreenPoint(0, 10), mcc->Time()); -- mcc->AdvanceByMillis(5); -- apzc->AdvanceAnimations(mcc->GetSampleTime()); -- PanGesture(PanGestureInput::PANGESTURE_PAN, apzc, ScreenIntPoint(50, 80), -- ScreenPoint(0, 10), mcc->Time()); -- mcc->AdvanceByMillis(5); -- apzc->AdvanceAnimations(mcc->GetSampleTime()); -- PanGesture(PanGestureInput::PANGESTURE_END, apzc, ScreenIntPoint(50, 80), -- ScreenPoint(0, 0), mcc->Time(), MODIFIER_NONE, -- /*aSimulateMomentum=*/true); -+ PanWithFling(); - - // Give the fling animation a chance to start. - SampleAnimationOnce(); - apzc->AssertStateIsFling(); - -@@ -247,5 +252,73 @@ - // trigger an assertion failure in debug mode. - PanGesture(PanGestureInput::PANGESTURE_END, apzc, ScreenIntPoint(50, 80), - ScreenPoint(0, 0), mcc->Time(), MODIFIER_NONE, - /*aSimulateMomentum=*/true); - } -+ -+#ifdef MOZ_WIDGET_GTK // Handling PANGESTURE_MAYSTART is Linux-only for now -+TEST_F(APZCPanningTester, HoldGesture_HoldAndRelease) { -+ // Send a pan gesture that triggers a fling animation at the end. -+ PanWithFling(); -+ -+ // Give the fling animation a chance to start. -+ SampleAnimationOnce(); -+ apzc->AssertStateIsFling(); -+ -+ // Send a PANGESTURE_MAYSTART event, signifying that the fingers went back -+ // down on the touchpad. -+ PanGesture(PanGestureInput::PANGESTURE_MAYSTART, apzc, ScreenIntPoint(50, 80), -+ ScreenPoint(0, 0), mcc->Time()); -+ -+ // This should have had the effect of cancelling the fling animation. -+ apzc->AssertStateIsReset(); -+ -+ // Send a PANGESTURE_CANCELLED event, signifying that the fingers have been -+ // lifted without any scrolling. This should have no effect on the gesture -+ // state. -+ mcc->AdvanceByMillis(5); -+ apzc->AdvanceAnimations(mcc->GetSampleTime()); -+ PanGesture(PanGestureInput::PANGESTURE_CANCELLED, apzc, -+ ScreenIntPoint(50, 80), ScreenPoint(0, 0), mcc->Time()); -+ apzc->AssertStateIsReset(); -+} -+ -+TEST_F(APZCPanningTester, HoldGesture_HoldAndScroll) { -+ // Send a pan gesture that triggers a fling animation at the end. -+ PanWithFling(); -+ -+ // Give the fling animation a chance to start. -+ SampleAnimationOnce(); -+ apzc->AssertStateIsFling(); -+ -+ // Record the scroll offset before the fingers go back. -+ float scrollYBefore = apzc->GetFrameMetrics().GetVisualScrollOffset().y; -+ EXPECT_GT(scrollYBefore, 0); -+ -+ // Send a PANGESTURE_MAYSTART event, signifying that the fingers went back -+ // down on the touchpad. -+ PanGesture(PanGestureInput::PANGESTURE_MAYSTART, apzc, ScreenIntPoint(50, 80), -+ ScreenPoint(0, 0), mcc->Time()); -+ -+ // This should have had the effect of cancelling the fling animation. -+ apzc->AssertStateIsReset(); -+ -+ // Do actual panning as part of the same gesture. -+ mcc->AdvanceByMillis(5); -+ apzc->AdvanceAnimations(mcc->GetSampleTime()); -+ PanGesture(PanGestureInput::PANGESTURE_START, apzc, ScreenIntPoint(50, 80), -+ ScreenPoint(0, 2), mcc->Time()); -+ mcc->AdvanceByMillis(5); -+ apzc->AdvanceAnimations(mcc->GetSampleTime()); -+ PanGesture(PanGestureInput::PANGESTURE_PAN, apzc, ScreenIntPoint(50, 80), -+ ScreenPoint(0, 10), mcc->Time()); -+ mcc->AdvanceByMillis(5); -+ apzc->AdvanceAnimations(mcc->GetSampleTime()); -+ PanGesture(PanGestureInput::PANGESTURE_END, apzc, ScreenIntPoint(50, 80), -+ ScreenPoint(0, 0), mcc->Time(), MODIFIER_NONE, -+ /*aSimulateMomentum=*/true); -+ -+ // Check that we've done additional scrolling. -+ float scrollYAfter = apzc->GetFrameMetrics().GetVisualScrollOffset().y; -+ EXPECT_GT(scrollYAfter, scrollYBefore); -+} -+#endif -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp ---- a/widget/gtk/nsWindow.cpp -+++ b/widget/gtk/nsWindow.cpp -@@ -5587,10 +5587,23 @@ - } - - void nsWindow::OnTouchpadHoldEvent(GdkTouchpadGesturePhase aPhase, guint aTime, - uint32_t aFingers) { - LOG("OnTouchpadHoldEvent: aPhase %d aFingers %d", aPhase, aFingers); -+ MOZ_ASSERT(aPhase != -+ GDK_TOUCHPAD_GESTURE_PHASE_UPDATE); // not used for hold gestures -+ PanGestureInput::PanGestureType eventType = -+ (aPhase == GDK_TOUCHPAD_GESTURE_PHASE_BEGIN) -+ ? PanGestureInput::PANGESTURE_MAYSTART -+ : PanGestureInput::PANGESTURE_CANCELLED; -+ ScreenPoint touchPoint = ViewAs( -+ GdkEventCoordsToDevicePixels(mLastMouseCoordinates.mX, -+ mLastMouseCoordinates.mY), -+ PixelCastJustification::LayoutDeviceIsScreenForUntransformedEvent); -+ PanGestureInput panEvent(eventType, GetEventTimeStamp(aTime), touchPoint, -+ ScreenPoint(), 0); -+ DispatchPanGesture(panEvent); - } - - gboolean nsWindow::OnTouchEvent(GdkEventTouch* aEvent) { - LOG("OnTouchEvent: x=%f y=%f type=%d\n", aEvent->x, aEvent->y, aEvent->type); - if (!mHandleTouchEvent) { - diff --git a/D225760.1729586239.diff b/D225760.1729586239.diff deleted file mode 100644 index 50cc583..0000000 --- a/D225760.1729586239.diff +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/widget/gtk/nsGtkKeyUtils.cpp b/widget/gtk/nsGtkKeyUtils.cpp ---- a/widget/gtk/nsGtkKeyUtils.cpp -+++ b/widget/gtk/nsGtkKeyUtils.cpp -@@ -683,19 +683,27 @@ - } - - /* This keymap routine is derived from weston-2.0.0/clients/simple-im.c - */ - void KeymapWrapper::HandleKeymap(uint32_t format, int fd, uint32_t size) { -+ MOZ_LOG(gKeyLog, LogLevel::Info, -+ ("KeymapWrapper::HandleKeymap() format %d fd %d size %d", format, fd, -+ size)); - KeymapWrapper::ResetKeyboard(); - - if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) { -+ MOZ_LOG(gKeyLog, LogLevel::Info, -+ ("KeymapWrapper::HandleKeymap(): format is not " -+ "WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1!")); - close(fd); - return; - } - - char* mapString = (char*)mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); - if (mapString == MAP_FAILED) { -+ MOZ_LOG(gKeyLog, LogLevel::Info, -+ ("KeymapWrapper::HandleKeymap(): failed to allocate shm!")); - close(fd); - return; - } - - struct xkb_context* xkb_context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); -@@ -705,11 +713,12 @@ - - munmap(mapString, size); - close(fd); - - if (!keymap) { -- NS_WARNING("keyboard_handle_keymap(): Failed to compile keymap!\n"); -+ MOZ_LOG(gKeyLog, LogLevel::Info, -+ ("KeymapWrapper::HandleKeymap(): Failed to compile keymap!")); - return; - } - - KeymapWrapper::SetModifierMasks(keymap); - - diff --git a/D225868.1729586247.diff b/D225868.1729586247.diff deleted file mode 100644 index 8ab66b1..0000000 --- a/D225868.1729586247.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/widget/gtk/nsGtkKeyUtils.cpp b/widget/gtk/nsGtkKeyUtils.cpp ---- a/widget/gtk/nsGtkKeyUtils.cpp -+++ b/widget/gtk/nsGtkKeyUtils.cpp -@@ -696,11 +696,11 @@ - "WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1!")); - close(fd); - return; - } - -- char* mapString = (char*)mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); -+ char* mapString = (char*)mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0); - if (mapString == MAP_FAILED) { - MOZ_LOG(gKeyLog, LogLevel::Info, - ("KeymapWrapper::HandleKeymap(): failed to allocate shm!")); - close(fd); - return; - diff --git a/firefox.spec b/firefox.spec index 1eb169f..5093a5a 100644 --- a/firefox.spec +++ b/firefox.spec @@ -152,7 +152,7 @@ ExcludeArch: i686 %if %{?system_nss} %global nspr_version 4.32 %global nspr_build_version %{nspr_version} -%global nss_version 3.105 +%global nss_version 3.106 %global nss_build_version %{nss_version} %endif @@ -196,14 +196,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 132.0.2 -Release: 2%{?pre_tag}%{?dist} +Version: 133.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20241115.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20241122.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -282,17 +282,6 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch -Patch420: D209910.1715685533.diff -Patch421: D209911.1715685535.diff -Patch422: D210158.1715685536.diff -Patch423: D210159.1715685538.diff -Patch424: D210430.1715848796.diff - -Patch436: D223285.1729586039.diff -Patch437: D224842.1729586219.diff -Patch438: D225439.1729586066.diff -Patch439: D225760.1729586239.diff -Patch440: D225868.1729586247.diff # WebRTC/PipeWire camera patches # https://phabricator.services.mozilla.com/D228635 @@ -601,11 +590,6 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch -P407 -p1 -b .1667096 %if 0%{?fedora} > 40 -%patch -P436 -p1 -b .D223313 -%patch -P437 -p1 -b .D224842 -%patch -P438 -p1 -b .D225439 -%patch -P439 -p1 -b .D225760 -%patch -P440 -p1 -b .D225868 %patch -P450 -p1 -b .libwebrtc-pipewire-camera-use-better-unique-device-name-for-camera-devices %endif @@ -1239,6 +1223,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Nov 22 2024 Martin Stransky - 133.0-1 +- Updated to latest upstream (133.0) + * Mon Nov 18 2024 Martin Stransky - 132.0.2-2 - Added memory saving flags to x86_64 diff --git a/mozilla-1196777.patch b/mozilla-1196777.patch index 864741e..ac405c6 100644 --- a/mozilla-1196777.patch +++ b/mozilla-1196777.patch @@ -1,13 +1,12 @@ -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; +diff -up firefox-133.0/widget/gtk/nsWindow.cpp.1196777 firefox-133.0/widget/gtk/nsWindow.cpp +--- firefox-133.0/widget/gtk/nsWindow.cpp.1196777 2024-11-22 09:32:52.293470407 +0100 ++++ firefox-133.0/widget/gtk/nsWindow.cpp 2024-11-22 10:21:54.996441520 +0100 +@@ -191,7 +191,7 @@ constexpr gint kEvents = + GDK_VISIBILITY_NOTIFY_MASK | 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_PROPERTY_CHANGE_MASK | GDK_FOCUS_CHANGE_MASK; /* utility functions */ static bool is_mouse_in_window(GdkWindow* aWindow, gdouble aMouseX, diff --git a/sources b/sources index 31ada40..ffd4733 100644 --- a/sources +++ b/sources @@ -4,3 +4,5 @@ SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125 SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a SHA512 (firefox-langpacks-132.0.2-20241115.tar.xz) = 56aa82e805c900d3001a8c8b33b134ca0bcf0be6c445d0b536ac157845b3e59ffaa6a155594cfef501432baebf379e41450ddab3ba62e3f6956f6da27700bfc2 SHA512 (firefox-132.0.2.source.tar.xz) = 9ea95d9fb1a941ac5a5b50da67e224f3ccf8c401f26cb61bb74ad7f4e1e8706d469c4b6325714f2cb9cdf50c32710377d6bca18dd65b55db2c39ef2b27a57fae +SHA512 (firefox-133.0.source.tar.xz) = b16f9898bee4121914caef48d4f7f44bf9d69aee168586b02bf1b4f4197844fd10179e1b63b273f52929fb348030df36328f24993cd666969da4ddc82562a90c +SHA512 (firefox-langpacks-133.0-20241122.tar.xz) = 1f3c43c7e497d63487ef5241c5a755408fa8a90aa2468dc50f61702e3a842677d265640c584427859a7d4c4bd385a68584f8885576cb42f3aa17836db74fb9f1 diff --git a/wasi.patch b/wasi.patch index 476266a..d3d00f9 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-132.0.2-build/firefox-132.0.2/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-133.0-build/firefox-133.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From fa2ec46f3ad7c884d99565bf18c2be750ea364ac Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 22 Nov 2024 10:41:47 +0100 Subject: [PATCH 415/545] Updated to 133.0 --- .gitignore | 2 + D209910.1715685533.diff | 419 ----------------------------------- D209911.1715685535.diff | 55 ----- D210158.1715685536.diff | 54 ----- D210159.1715685538.diff | 49 ---- D210430.1715848796.diff | 121 ---------- D223285.1729586039.diff | 478 ---------------------------------------- D224842.1729586219.diff | 48 ---- D225439.1729586066.diff | 223 ------------------- D225760.1729586239.diff | 46 ---- D225868.1729586247.diff | 17 -- firefox.spec | 28 +-- mozilla-1196777.patch | 19 +- sources | 2 + wasi.patch | 2 +- 15 files changed, 21 insertions(+), 1542 deletions(-) delete mode 100644 D209910.1715685533.diff delete mode 100644 D209911.1715685535.diff delete mode 100644 D210158.1715685536.diff delete mode 100644 D210159.1715685538.diff delete mode 100644 D210430.1715848796.diff delete mode 100644 D223285.1729586039.diff delete mode 100644 D224842.1729586219.diff delete mode 100644 D225439.1729586066.diff delete mode 100644 D225760.1729586239.diff delete mode 100644 D225868.1729586247.diff diff --git a/.gitignore b/.gitignore index 1dcbdf8..5b3f960 100644 --- a/.gitignore +++ b/.gitignore @@ -670,3 +670,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-132.0.1-20241105.tar.xz /firefox-langpacks-132.0.2-20241115.tar.xz /firefox-132.0.2.source.tar.xz +/firefox-133.0.source.tar.xz +/firefox-langpacks-133.0-20241122.tar.xz diff --git a/D209910.1715685533.diff b/D209910.1715685533.diff deleted file mode 100644 index c94d88e..0000000 --- a/D209910.1715685533.diff +++ /dev/null @@ -1,419 +0,0 @@ -diff --git a/widget/gtk/DBusService.h b/widget/gtk/DBusService.h -new file mode 100644 ---- /dev/null -+++ b/widget/gtk/DBusService.h -@@ -0,0 +1,67 @@ -+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+#ifndef DBusService_h__ -+#define DBusService_h__ -+ -+#include -+#include -+#include "mozilla/RefPtr.h" -+#include "mozilla/GRefPtr.h" -+ -+namespace mozilla::widget { -+ -+class DBusService final { -+ public: -+ explicit DBusService(const char* aAppFile) : mAppFile(aAppFile) {} -+ ~DBusService(); -+ -+ // nsBaseAppShell overrides: -+ bool Init(); -+ void Run(); -+ -+ void StartDBusListening(); -+ void StopDBusListening(); -+ -+ static void DBusSessionSleepCallback(GDBusProxy* aProxy, gchar* aSenderName, -+ gchar* aSignalName, -+ GVariant* aParameters, -+ gpointer aUserData); -+ static void DBusTimedatePropertiesChangedCallback(GDBusProxy* aProxy, -+ gchar* aSenderName, -+ gchar* aSignalName, -+ GVariant* aParameters, -+ gpointer aUserData); -+ static void DBusConnectClientResponse(GObject* aObject, GAsyncResult* aResult, -+ gpointer aUserData); -+ -+ bool LaunchApp(const char* aCommand, const char** aURIList, int aURIListLen); -+ -+ void HandleFreedesktopActivate(GVariant* aParameters, -+ GDBusMethodInvocation* aReply); -+ void HandleFreedesktopOpen(GVariant* aParameters, -+ GDBusMethodInvocation* aReply); -+ void HandleFreedesktopActivateAction(GVariant* aParameters, -+ GDBusMethodInvocation* aReply); -+ -+ bool StartFreedesktopListener(); -+ void StopFreedesktopListener(); -+ -+ void OnBusAcquired(GDBusConnection* aConnection); -+ void OnNameAcquired(GDBusConnection* aConnection); -+ void OnNameLost(GDBusConnection* aConnection); -+ -+ private: -+ // The connection is owned by DBus library -+ uint mDBusID = 0; -+ uint mRegistrationId = 0; -+ GDBusConnection* mConnection = nullptr; -+ RefPtr mIntrospectionData; -+ const char* mAppFile = nullptr; -+}; -+ -+} // namespace mozilla::widget -+ -+#endif // DBusService_h__ -diff --git a/widget/gtk/DBusService.cpp b/widget/gtk/DBusService.cpp -new file mode 100644 ---- /dev/null -+++ b/widget/gtk/DBusService.cpp -@@ -0,0 +1,327 @@ -+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+#include -+#include -+#include -+#include -+#include -+#include "DBusService.h" -+#include "nsAppRunner.h" -+#include "mozilla/Unused.h" -+#include "mozilla/GUniquePtr.h" -+#include "mozilla/WidgetUtils.h" -+#include -+#include "nsIObserverService.h" -+#include "WidgetUtilsGtk.h" -+#include "prproces.h" -+#include "mozilla/XREAppData.h" -+#include "nsPrintfCString.h" -+ -+using namespace mozilla; -+using namespace mozilla::widget; -+ -+DBusService::~DBusService() { StopFreedesktopListener(); } -+ -+bool DBusService::Init() { return StartFreedesktopListener(); } -+ -+void DBusService::Run() { -+ GMainLoop* loop = g_main_loop_new(nullptr, false); -+ g_main_loop_run(loop); -+ g_main_loop_unref(loop); -+} -+ -+// Mozilla has old GIO version in build roots -+#define G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE GBusNameOwnerFlags(1 << 2) -+ -+#define DBUS_BUS_NAME_TEMPLATE "org.mozilla.%s" -+#define DBUS_OBJECT_PATH_TEMPLATE "/org/mozilla/%s" -+ -+static const char* GetDBusBusName() { -+ static const char* name = []() { -+ nsAutoCString appName; -+ gAppData->GetDBusAppName(appName); -+ return ToNewCString(nsPrintfCString(DBUS_BUS_NAME_TEMPLATE, -+ appName.get())); // Intentionally leak -+ }(); -+ return name; -+} -+ -+static const char* GetDBusObjectPath() { -+ static const char* path = []() { -+ nsAutoCString appName; -+ gAppData->GetDBusAppName(appName); -+ return ToNewCString(nsPrintfCString(DBUS_OBJECT_PATH_TEMPLATE, -+ appName.get())); // Intentionally leak -+ }(); -+ return path; -+} -+ -+// See -+// https://specifications.freedesktop.org/desktop-entry-spec/1.1/ar01s07.html -+// for details -+static const char* kIntrospectTemplate = -+ "\n" -+ "\n" -+ "\n" -+ "\n" -+ " \n" -+ " \n" -+ " \n" -+ " \n" -+ " \n" -+ "\n" -+ "\n" -+ " \n" -+ " \n" -+ " \n" -+ "\n" -+ "\n" -+ "\n"; -+ -+bool DBusService::LaunchApp(const char* aCommand, const char** aURIList, -+ int aURIListLen) { -+ // Allocate space for all uris, executable name, command if supplied and -+ // null terminator -+ int paramsNum = aURIListLen + 2; -+ if (aCommand) { -+ paramsNum++; -+ } -+ -+ char** argv = (char**)moz_xmalloc(sizeof(char*) * paramsNum); -+ int argc = 0; -+ argv[argc++] = strdup(mAppFile); -+ if (aCommand) { -+ argv[argc++] = strdup(aCommand); -+ } -+ for (int i = 0; aURIList && i < aURIListLen; i++) { -+ argv[argc++] = strdup(aURIList[i]); -+ } -+ argv[argc++] = nullptr; -+ -+ nsAutoCString exePath; -+ nsCOMPtr lf; -+ bool ret = false; -+ if (NS_SUCCEEDED(XRE_GetBinaryPath(getter_AddRefs(lf)))) { -+ if (NS_SUCCEEDED(lf->GetNativePath(exePath))) { -+ ret = (PR_CreateProcessDetached(exePath.get(), argv, nullptr, nullptr) != -+ PR_FAILURE); -+ } -+ } -+ -+ for (int i = 0; i < argc; i++) { -+ free(argv[i]); -+ } -+ free(argv); -+ return ret; -+} -+ -+// The Activate method is called when the application is started without -+// files to open. -+// Open :: (a{sv}) → () -+void DBusService::HandleFreedesktopActivate(GVariant* aParameters, -+ GDBusMethodInvocation* aReply) { -+ if (!LaunchApp(nullptr, nullptr, 0)) { -+ g_dbus_method_invocation_return_error(aReply, G_DBUS_ERROR, -+ G_DBUS_ERROR_FAILED, -+ "Failed to run target application."); -+ return; -+ } -+ g_dbus_method_invocation_return_value(aReply, nullptr); -+} -+ -+// The Open method is called when the application is started with files. -+// The array of strings is an array of URIs, in UTF-8. -+// Open :: (as,a{sv}) → () -+void DBusService::HandleFreedesktopOpen(GVariant* aParameters, -+ GDBusMethodInvocation* aReply) { -+ RefPtr variant = -+ dont_AddRef(g_variant_get_child_value(aParameters, 0)); -+ gsize uriNum = 0; -+ GUniquePtr uriArray(g_variant_get_strv(variant, &uriNum)); -+ if (!LaunchApp(nullptr, uriArray.get(), uriNum)) { -+ g_dbus_method_invocation_return_error(aReply, G_DBUS_ERROR, -+ G_DBUS_ERROR_FAILED, -+ "Failed to run target application."); -+ return; -+ } -+ g_dbus_method_invocation_return_value(aReply, nullptr); -+} -+ -+// The ActivateAction method is called when Desktop Actions are activated. -+// The action-name parameter is the name of the action. -+// ActivateAction :: (s,av,a{sv}) → () -+void DBusService::HandleFreedesktopActivateAction( -+ GVariant* aParameters, GDBusMethodInvocation* aReply) { -+ const char* actionName; -+ -+ // aParameters is "(s,av,a{sv})" type -+ RefPtr r = dont_AddRef(g_variant_get_child_value(aParameters, 0)); -+ if (!(actionName = g_variant_get_string(r, nullptr))) { -+ g_dbus_method_invocation_return_error( -+ aReply, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "Wrong params!"); -+ return; -+ } -+ -+ // TODO: Read av params and pass them to LaunchApp? -+ -+ // actionName matches desktop action defined in .desktop file. -+ // We implement it for .desktop file shipped by flatpak -+ // (taskcluster/docker/firefox-flatpak/org.mozilla.firefox.desktop) -+ bool ret = false; -+ if (!strcmp(actionName, "new-window")) { -+ ret = LaunchApp(nullptr, nullptr, 0); -+ } else if (!strcmp(actionName, "new-private-window")) { -+ ret = LaunchApp("--private-window", nullptr, 0); -+ } else if (!strcmp(actionName, "profile-manager-window")) { -+ ret = LaunchApp("--ProfileManager", nullptr, 0); -+ } -+ if (!ret) { -+ g_dbus_method_invocation_return_error(aReply, G_DBUS_ERROR, -+ G_DBUS_ERROR_FAILED, -+ "Failed to run target application."); -+ return; -+ } -+ g_dbus_method_invocation_return_value(aReply, nullptr); -+} -+ -+static void HandleMethodCall(GDBusConnection* aConnection, const gchar* aSender, -+ const gchar* aObjectPath, -+ const gchar* aInterfaceName, -+ const gchar* aMethodName, GVariant* aParameters, -+ GDBusMethodInvocation* aInvocation, -+ gpointer aUserData) { -+ MOZ_ASSERT(aUserData); -+ MOZ_ASSERT(NS_IsMainThread()); -+ -+ if (strcmp("org.freedesktop.Application", aInterfaceName) != 0) { -+ g_warning("DBusService: HandleMethodCall() wrong interface name %s", -+ aInterfaceName); -+ return; -+ } -+ if (strcmp("Activate", aMethodName) == 0) { -+ static_cast(aUserData)->HandleFreedesktopActivate( -+ aParameters, aInvocation); -+ } else if (strcmp("Open", aMethodName) == 0) { -+ static_cast(aUserData)->HandleFreedesktopOpen(aParameters, -+ aInvocation); -+ } else if (strcmp("ActivateAction", aMethodName) == 0) { -+ static_cast(aUserData)->HandleFreedesktopActivateAction( -+ aParameters, aInvocation); -+ } else { -+ g_warning("DBusService: HandleMethodCall() wrong method %s", aMethodName); -+ } -+} -+ -+static GVariant* HandleGetProperty(GDBusConnection* aConnection, -+ const gchar* aSender, -+ const gchar* aObjectPath, -+ const gchar* aInterfaceName, -+ const gchar* aPropertyName, GError** aError, -+ gpointer aUserData) { -+ MOZ_ASSERT(aUserData); -+ MOZ_ASSERT(NS_IsMainThread()); -+ g_set_error(aError, G_IO_ERROR, G_IO_ERROR_FAILED, -+ "%s:%s setting is not supported", aInterfaceName, aPropertyName); -+ return nullptr; -+} -+ -+static gboolean HandleSetProperty(GDBusConnection* aConnection, -+ const gchar* aSender, -+ const gchar* aObjectPath, -+ const gchar* aInterfaceName, -+ const gchar* aPropertyName, GVariant* aValue, -+ GError** aError, gpointer aUserData) { -+ MOZ_ASSERT(aUserData); -+ MOZ_ASSERT(NS_IsMainThread()); -+ g_set_error(aError, G_IO_ERROR, G_IO_ERROR_FAILED, -+ "%s:%s setting is not supported", aInterfaceName, aPropertyName); -+ return false; -+} -+ -+static const GDBusInterfaceVTable gInterfaceVTable = { -+ HandleMethodCall, HandleGetProperty, HandleSetProperty}; -+ -+void DBusService::OnBusAcquired(GDBusConnection* aConnection) { -+ GUniquePtr error; -+ mIntrospectionData = dont_AddRef(g_dbus_node_info_new_for_xml( -+ kIntrospectTemplate, getter_Transfers(error))); -+ if (!mIntrospectionData) { -+ g_warning("DBusService: g_dbus_node_info_new_for_xml() failed! %s", -+ error->message); -+ return; -+ } -+ -+ mRegistrationId = g_dbus_connection_register_object( -+ aConnection, GetDBusObjectPath(), mIntrospectionData->interfaces[0], -+ &gInterfaceVTable, this, /* user_data */ -+ nullptr, /* user_data_free_func */ -+ getter_Transfers(error)); /* GError** */ -+ -+ if (mRegistrationId == 0) { -+ g_warning( -+ "DBusService: g_dbus_connection_register_object() " -+ "failed! %s", -+ error->message); -+ return; -+ } -+} -+ -+void DBusService::OnNameAcquired(GDBusConnection* aConnection) { -+ mConnection = aConnection; -+} -+ -+void DBusService::OnNameLost(GDBusConnection* aConnection) { -+ mConnection = nullptr; -+ if (!mRegistrationId) { -+ return; -+ } -+ if (g_dbus_connection_unregister_object(aConnection, mRegistrationId)) { -+ mRegistrationId = 0; -+ } -+} -+ -+bool DBusService::StartFreedesktopListener() { -+ if (mDBusID) { -+ // We're already connected so we don't need to reconnect -+ return false; -+ } -+ -+ mDBusID = g_bus_own_name( -+ // if org.mozilla.Firefox is taken it means we're already running -+ // so use G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE and quit. -+ G_BUS_TYPE_SESSION, GetDBusBusName(), G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE, -+ [](GDBusConnection* aConnection, const gchar*, -+ gpointer aUserData) -> void { -+ static_cast(aUserData)->OnBusAcquired(aConnection); -+ }, -+ [](GDBusConnection* aConnection, const gchar*, -+ gpointer aUserData) -> void { -+ static_cast(aUserData)->OnNameAcquired(aConnection); -+ }, -+ [](GDBusConnection* aConnection, const gchar*, -+ gpointer aUserData) -> void { -+ static_cast(aUserData)->OnNameLost(aConnection); -+ }, -+ this, nullptr); -+ -+ if (!mDBusID) { -+ g_warning("DBusService: g_bus_own_name() failed!"); -+ return false; -+ } -+ -+ return true; -+} -+ -+void DBusService::StopFreedesktopListener() { -+ OnNameLost(mConnection); -+ if (mDBusID) { -+ g_bus_unown_name(mDBusID); -+ mDBusID = 0; -+ } -+ mIntrospectionData = nullptr; -+} -diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build ---- a/widget/gtk/moz.build -+++ b/widget/gtk/moz.build -@@ -172,9 +172,10 @@ - "AsyncDBus.h", - ] - UNIFIED_SOURCES += [ - "AsyncDBus.cpp", - "DBusMenu.cpp", -+ "DBusService.cpp", - ] - CXXFLAGS += CONFIG["MOZ_DBUS_CFLAGS"] - - CXXFLAGS += ["-Werror=switch"] - diff --git a/D209911.1715685535.diff b/D209911.1715685535.diff deleted file mode 100644 index 67bb1f9..0000000 --- a/D209911.1715685535.diff +++ /dev/null @@ -1,55 +0,0 @@ -diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp ---- a/toolkit/xre/nsAppRunner.cpp -+++ b/toolkit/xre/nsAppRunner.cpp -@@ -265,10 +265,13 @@ - #endif - - #ifdef MOZ_WIDGET_GTK - # include "nsAppShell.h" - #endif -+#ifdef MOZ_ENABLE_DBUS -+# include "DBusService.h" -+#endif - - extern uint32_t gRestartMode; - extern void InstallSignalHandlers(const char* ProgramName); - - #define FILE_COMPATIBILITY_INFO "compatibility.ini"_ns -@@ -2132,10 +2135,14 @@ - - #if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) || defined(XP_MACOSX) - printf(" --headless Run without a GUI.\n"); - #endif - -+#if defined(MOZ_ENABLE_DBUS) -+ printf(" --dbus-service Run as DBus service.\n"); -+#endif -+ - // this works, but only after the components have registered. so if you drop - // in a new command line handler, --help won't not until the second run. out - // of the bug, because we ship a component.reg file, it works correctly. - DumpArbitraryHelp(); - } -@@ -4370,10 +4377,21 @@ - DumpFullVersion(); - *aExitFlag = true; - return 0; - } - -+#ifdef MOZ_ENABLE_DBUS -+ if (CheckArg("dbus-service")) { -+ UniquePtr dbusService = MakeUnique(gArgv[0]); -+ if (dbusService->Init()) { -+ dbusService->Run(); -+ } -+ *aExitFlag = true; -+ return 1; -+ } -+#endif -+ - rv = XRE_InitCommandLine(gArgc, gArgv); - NS_ENSURE_SUCCESS(rv, 1); - - return 0; - } - diff --git a/D210158.1715685536.diff b/D210158.1715685536.diff deleted file mode 100644 index 4228f3a..0000000 --- a/D210158.1715685536.diff +++ /dev/null @@ -1,54 +0,0 @@ -diff -up firefox-126.0/widget/gtk/DBusService.cpp.D210158.1715685536 firefox-126.0/widget/gtk/DBusService.cpp ---- firefox-126.0/widget/gtk/DBusService.cpp.D210158.1715685536 2024-05-14 11:19:02.098199593 +0200 -+++ firefox-126.0/widget/gtk/DBusService.cpp 2024-05-14 11:24:44.236939835 +0200 -@@ -85,38 +85,24 @@ static const char* kIntrospectTemplate = - - bool DBusService::LaunchApp(const char* aCommand, const char** aURIList, - int aURIListLen) { -- // Allocate space for all uris, executable name, command if supplied and -- // null terminator -- int paramsNum = aURIListLen + 2; -+ nsAutoCString param(mAppFile); - if (aCommand) { -- paramsNum++; -- } -- -- char** argv = (char**)moz_xmalloc(sizeof(char*) * paramsNum); -- int argc = 0; -- argv[argc++] = strdup(mAppFile); -- if (aCommand) { -- argv[argc++] = strdup(aCommand); -+ param.Append(" "); -+ param.Append(aCommand); - } - for (int i = 0; aURIList && i < aURIListLen; i++) { -- argv[argc++] = strdup(aURIList[i]); -- } -- argv[argc++] = nullptr; -- -- nsAutoCString exePath; -- nsCOMPtr lf; -- bool ret = false; -- if (NS_SUCCEEDED(XRE_GetBinaryPath(getter_AddRefs(lf)))) { -- if (NS_SUCCEEDED(lf->GetNativePath(exePath))) { -- ret = (PR_CreateProcessDetached(exePath.get(), argv, nullptr, nullptr) != -- PR_FAILURE); -- } -+ param.Append(" "); -+ GUniquePtr escUri(g_shell_quote(aURIList[i])); -+ param.Append(escUri.get()); - } - -- for (int i = 0; i < argc; i++) { -- free(argv[i]); -+ char* argv[] = {strdup("/bin/sh"), strdup("-c"), strdup(param.get()), -+ nullptr}; -+ int ret = -+ PR_CreateProcessDetached("/bin/sh", argv, nullptr, nullptr) != PR_FAILURE; -+ for (auto str : argv) { -+ free(str); - } -- free(argv); - return ret; - } - diff --git a/D210159.1715685538.diff b/D210159.1715685538.diff deleted file mode 100644 index c0f8552..0000000 --- a/D210159.1715685538.diff +++ /dev/null @@ -1,49 +0,0 @@ -diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp ---- a/toolkit/xre/nsAppRunner.cpp -+++ b/toolkit/xre/nsAppRunner.cpp -@@ -2136,11 +2136,15 @@ - #if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) || defined(XP_MACOSX) - printf(" --headless Run without a GUI.\n"); - #endif - - #if defined(MOZ_ENABLE_DBUS) -- printf(" --dbus-service Run as DBus service.\n"); -+ printf( -+ " --dbus-service Run as DBus service for " -+ "org.freedesktop.Application and\n" -+ " set a launcher (usually /usr/bin/appname " -+ "script) for it."); - #endif - - // this works, but only after the components have registered. so if you drop - // in a new command line handler, --help won't not until the second run. out - // of the bug, because we ship a component.reg file, it works correctly. -@@ -4378,17 +4382,24 @@ - *aExitFlag = true; - return 0; - } - - #ifdef MOZ_ENABLE_DBUS -- if (CheckArg("dbus-service")) { -- UniquePtr dbusService = MakeUnique(gArgv[0]); -+ const char* dbusServiceLauncher = nullptr; -+ ar = CheckArg("dbus-service", &dbusServiceLauncher, CheckArgFlag::None); -+ if (ar == ARG_BAD) { -+ Output(true, "Missing launcher param for --dbus-service\n"); -+ return 1; -+ } -+ if (ar == ARG_FOUND) { -+ UniquePtr dbusService = -+ MakeUnique(dbusServiceLauncher); - if (dbusService->Init()) { - dbusService->Run(); - } - *aExitFlag = true; -- return 1; -+ return 0; - } - #endif - - rv = XRE_InitCommandLine(gArgc, gArgv); - NS_ENSURE_SUCCESS(rv, 1); - diff --git a/D210430.1715848796.diff b/D210430.1715848796.diff deleted file mode 100644 index 18e3d4e..0000000 --- a/D210430.1715848796.diff +++ /dev/null @@ -1,121 +0,0 @@ -diff --git a/toolkit/components/remote/nsDBusRemoteClient.h b/toolkit/components/remote/nsDBusRemoteClient.h ---- a/toolkit/components/remote/nsDBusRemoteClient.h -+++ b/toolkit/components/remote/nsDBusRemoteClient.h -@@ -29,10 +29,10 @@ - void Shutdown(); - - private: - bool GetRemoteDestinationName(const char* aProgram, const char* aProfile, - nsCString& aDestinationName); -- nsresult DoSendDBusCommandLine(const char* aProgram, const char* aProfile, -- const char* aBuffer, int aLength); -+ nsresult DoSendDBusCommandLine(const char* aProfile, const char* aBuffer, -+ int aLength); - }; - - #endif // DBusRemoteClient_h__ -diff --git a/toolkit/components/remote/nsDBusRemoteClient.cpp b/toolkit/components/remote/nsDBusRemoteClient.cpp ---- a/toolkit/components/remote/nsDBusRemoteClient.cpp -+++ b/toolkit/components/remote/nsDBusRemoteClient.cpp -@@ -6,10 +6,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 "nsDBusRemoteClient.h" - #include "RemoteUtils.h" -+#include "nsAppRunner.h" - #include "mozilla/XREAppData.h" - #include "mozilla/Logging.h" - #include "mozilla/Base64.h" - #include "nsPrintfCString.h" - #include "mozilla/GUniquePtr.h" -@@ -36,11 +37,11 @@ - } - - nsresult nsDBusRemoteClient::SendCommandLine( - const char* aProgram, const char* aProfile, int32_t argc, char** argv, - const char* aStartupToken, char** aResponse, bool* aWindowFound) { -- NS_ENSURE_TRUE(aProgram, NS_ERROR_INVALID_ARG); -+ NS_ENSURE_TRUE(aProfile, NS_ERROR_INVALID_ARG); - - LOG("nsDBusRemoteClient::SendCommandLine"); - - int commandLineLength; - char* commandLine = -@@ -48,12 +49,11 @@ - if (!commandLine) { - LOG(" failed to create command line"); - return NS_ERROR_FAILURE; - } - -- nsresult rv = -- DoSendDBusCommandLine(aProgram, aProfile, commandLine, commandLineLength); -+ nsresult rv = DoSendDBusCommandLine(aProfile, commandLine, commandLineLength); - free(commandLine); - - *aWindowFound = NS_SUCCEEDED(rv); - - LOG("DoSendDBusCommandLine %s", NS_SUCCEEDED(rv) ? "OK" : "FAILED"); -@@ -97,18 +97,17 @@ - } - - return true; - } - --nsresult nsDBusRemoteClient::DoSendDBusCommandLine(const char* aProgram, -- const char* aProfile, -+nsresult nsDBusRemoteClient::DoSendDBusCommandLine(const char* aProfile, - const char* aBuffer, - int aLength) { - LOG("nsDBusRemoteClient::DoSendDBusCommandLine()"); - -- nsAutoCString appName(aProgram); -- mozilla::XREAppData::SanitizeNameForDBus(appName); -+ nsAutoCString appName; -+ gAppData->GetDBusAppName(appName); - - nsAutoCString destinationName; - if (!GetRemoteDestinationName(appName.get(), aProfile, destinationName)) { - LOG(" failed to get remote destination name"); - return NS_ERROR_FAILURE; -diff --git a/toolkit/components/remote/nsDBusRemoteServer.cpp b/toolkit/components/remote/nsDBusRemoteServer.cpp ---- a/toolkit/components/remote/nsDBusRemoteServer.cpp -+++ b/toolkit/components/remote/nsDBusRemoteServer.cpp -@@ -6,10 +6,11 @@ - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - #include "nsDBusRemoteServer.h" - - #include "nsCOMPtr.h" -+#include "nsAppRunner.h" - #include "mozilla/XREAppData.h" - #include "mozilla/Base64.h" - #include "mozilla/ScopeExit.h" - #include "mozilla/GUniquePtr.h" - #include "MainThreadUtils.h" -@@ -186,17 +187,18 @@ - - nsresult nsDBusRemoteServer::Startup(const char* aAppName, - const char* aProfileName) { - MOZ_DIAGNOSTIC_ASSERT(!mDBusID); - -- // Don't even try to start without any application/profile name -- if (!aAppName || aAppName[0] == '\0' || !aProfileName || -- aProfileName[0] == '\0') -- return NS_ERROR_INVALID_ARG; -+ // Don't even try to start without any profile name -+ if (!aProfileName || aProfileName[0] == '\0') return NS_ERROR_INVALID_ARG; - -- mAppName = aAppName; -- mozilla::XREAppData::SanitizeNameForDBus(mAppName); -+ // aAppName is remoting name which can be something like org.mozilla.appname -+ // or so. -+ // For DBus service we rather use general application DBus identifier -+ // which is shared by all DBus services. -+ gAppData->GetDBusAppName(mAppName); - - nsAutoCString profileName; - MOZ_TRY( - mozilla::Base64Encode(aProfileName, strlen(aProfileName), profileName)); - - diff --git a/D223285.1729586039.diff b/D223285.1729586039.diff deleted file mode 100644 index f3ed973..0000000 --- a/D223285.1729586039.diff +++ /dev/null @@ -1,478 +0,0 @@ -diff --git a/widget/gtk/mozwayland/mozwayland.h b/widget/gtk/mozwayland/mozwayland.h ---- a/widget/gtk/mozwayland/mozwayland.h -+++ b/widget/gtk/mozwayland/mozwayland.h -@@ -137,14 +137,10 @@ - wl_proxy_marshal((struct wl_proxy*)wl_surface, WL_SURFACE_DAMAGE_BUFFER, x, y, - width, height); - } - #endif - --#ifndef WL_POINTER_RELEASE_SINCE_VERSION --# define WL_POINTER_RELEASE_SINCE_VERSION 3 --#endif -- - #ifndef WL_POINTER_AXIS_ENUM - # define WL_POINTER_AXIS_ENUM - /** - * @ingroup iface_wl_pointer - * axis types -@@ -230,10 +226,58 @@ - */ - WL_POINTER_AXIS_RELATIVE_DIRECTION_INVERTED = 1, - }; - #endif /* WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM */ - -+#ifndef WL_POINTER_AXIS_SOURCE_ENUM -+# define WL_POINTER_AXIS_SOURCE_ENUM -+/** -+ * @ingroup iface_wl_pointer -+ * axis source types -+ * -+ * Describes the source types for axis events. This indicates to the -+ * client how an axis event was physically generated; a client may -+ * adjust the user interface accordingly. For example, scroll events -+ * from a "finger" source may be in a smooth coordinate space with -+ * kinetic scrolling whereas a "wheel" source may be in discrete steps -+ * of a number of lines. -+ * -+ * The "continuous" axis source is a device generating events in a -+ * continuous coordinate space, but using something other than a -+ * finger. One example for this source is button-based scrolling where -+ * the vertical motion of a device is converted to scroll events while -+ * a button is held down. -+ * -+ * The "wheel tilt" axis source indicates that the actual device is a -+ * wheel but the scroll event is not caused by a rotation but a -+ * (usually sideways) tilt of the wheel. -+ */ -+enum wl_pointer_axis_source { -+ /** -+ * a physical wheel rotation -+ */ -+ WL_POINTER_AXIS_SOURCE_WHEEL = 0, -+ /** -+ * finger on a touch surface -+ */ -+ WL_POINTER_AXIS_SOURCE_FINGER = 1, -+ /** -+ * continuous coordinate space -+ */ -+ WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2, -+ /** -+ * a physical wheel tilt -+ * @since 6 -+ */ -+ WL_POINTER_AXIS_SOURCE_WHEEL_TILT = 3, -+}; -+/** -+ * @ingroup iface_wl_pointer -+ */ -+# define WL_POINTER_AXIS_SOURCE_WHEEL_TILT_SINCE_VERSION 6 -+#endif /* WL_POINTER_AXIS_SOURCE_ENUM */ -+ - /** - * @ingroup iface_wl_pointer - * @struct wl_pointer_listener - */ - struct moz_wl_pointer_listener { -@@ -538,10 +582,18 @@ - */ - void (*axis_relative_direction)(void* data, struct wl_pointer* wl_pointer, - uint32_t axis, uint32_t direction); - }; - -+#ifndef WL_POINTER_RELEASE_SINCE_VERSION -+# define WL_POINTER_RELEASE_SINCE_VERSION 3 -+#endif -+ -+#ifndef WL_POINTER_AXIS_VALUE120_SINCE_VERSION -+# define WL_POINTER_AXIS_VALUE120_SINCE_VERSION 8 -+#endif -+ - #ifdef __cplusplus - } - #endif - - #endif /* __MozWayland_h_ */ -diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp ---- a/widget/gtk/nsWaylandDisplay.cpp -+++ b/widget/gtk/nsWaylandDisplay.cpp -@@ -56,13 +56,12 @@ - return gWaylandDisplay; - } - - void nsWaylandDisplay::SetShm(wl_shm* aShm) { mShm = aShm; } - --class TouchWindow { -+class WaylandPointerEvent { - public: -- already_AddRefed GetAndClearWindow() { return mWindow.forget(); } - RefPtr TakeWindow(wl_surface* aSurface) { - if (!aSurface) { - mWindow = nullptr; - } else { - GdkWindow* window = -@@ -71,33 +70,85 @@ - g_object_get_data(G_OBJECT(window), "nsWindow")) - : nullptr; - } - return mWindow; - } -+ already_AddRefed GetAndClearWindow() { return mWindow.forget(); } -+ RefPtr GetWindow() { return mWindow; } -+ -+ void SetSource(int32_t aSource) { mSource = aSource; } -+ -+ void SetDelta120(uint32_t aAxis, int32_t aDelta) { -+ switch (aAxis) { -+ case WL_POINTER_AXIS_VERTICAL_SCROLL: -+ mDeltaY = aDelta / 120.0f; -+ break; -+ case WL_POINTER_AXIS_HORIZONTAL_SCROLL: -+ mDeltaX = aDelta / 120.0f; -+ break; -+ default: -+ NS_WARNING("WaylandPointerEvent::SetDelta120(): wrong axis!"); -+ break; -+ } -+ } -+ -+ void SetTime(uint32_t aTime) { mTime = aTime; } -+ -+ void SendScrollEvent() { -+ if (!mWindow) { -+ return; -+ } -+ -+ // nsWindow::OnSmoothScrollEvent() may spin event loop so -+ // mWindow/mSource/delta may be replaced. -+ int32_t source = mSource; -+ float deltaX = mDeltaX; -+ float deltaY = mDeltaY; -+ -+ mSource = -1; -+ mDeltaX = mDeltaY = 0.0f; -+ -+ // We process wheel events only now. -+ if (source != WL_POINTER_AXIS_SOURCE_WHEEL) { -+ return; -+ } -+ -+ RefPtr win = mWindow; -+ uint32_t eventTime = mTime; -+ win->OnSmoothScrollEvent(eventTime, deltaX, deltaY); -+ } -+ -+ void Clear() { mWindow = nullptr; } -+ -+ WaylandPointerEvent() { Clear(); } - - private: - StaticRefPtr mWindow; -+ uint32_t mTime = 0; -+ int32_t mSource = 0; -+ float mDeltaX = 0; -+ float mDeltaY = 0; - }; - --static TouchWindow sTouchWindow; -+static WaylandPointerEvent sHoldGesture; - - static void gesture_hold_begin(void* data, - struct zwp_pointer_gesture_hold_v1* hold, - uint32_t serial, uint32_t time, - struct wl_surface* surface, uint32_t fingers) { -- RefPtr window = sTouchWindow.TakeWindow(surface); -+ RefPtr window = sHoldGesture.TakeWindow(surface); - if (!window) { - return; - } - window->OnTouchpadHoldEvent(GDK_TOUCHPAD_GESTURE_PHASE_BEGIN, time, fingers); - } - - static void gesture_hold_end(void* data, - struct zwp_pointer_gesture_hold_v1* hold, - uint32_t serial, uint32_t time, - int32_t cancelled) { -- RefPtr window = sTouchWindow.GetAndClearWindow(); -+ RefPtr window = sHoldGesture.GetAndClearWindow(); - if (!window) { - return; - } - window->OnTouchpadHoldEvent(cancelled ? GDK_TOUCHPAD_GESTURE_PHASE_CANCEL - : GDK_TOUCHPAD_GESTURE_PHASE_END, -@@ -105,16 +156,22 @@ - } - - static const struct zwp_pointer_gesture_hold_v1_listener gesture_hold_listener = - {gesture_hold_begin, gesture_hold_end}; - -+static WaylandPointerEvent sScrollEvent; -+ - static void pointer_handle_enter(void* data, struct wl_pointer* pointer, - uint32_t serial, struct wl_surface* surface, -- wl_fixed_t sx, wl_fixed_t sy) {} -+ wl_fixed_t sx, wl_fixed_t sy) { -+ sScrollEvent.TakeWindow(surface); -+} - - static void pointer_handle_leave(void* data, struct wl_pointer* pointer, -- uint32_t serial, struct wl_surface* surface) {} -+ uint32_t serial, struct wl_surface* surface) { -+ sScrollEvent.Clear(); -+} - - static void pointer_handle_motion(void* data, struct wl_pointer* pointer, - uint32_t time, wl_fixed_t sx, wl_fixed_t sy) { - } - -@@ -122,26 +179,60 @@ - uint32_t serial, uint32_t time, - uint32_t button, uint32_t state) {} - - static void pointer_handle_axis(void* data, struct wl_pointer* pointer, - uint32_t time, uint32_t axis, -- wl_fixed_t value) {} -+ wl_fixed_t value) { -+ sScrollEvent.SetTime(time); -+} - --static void pointer_handle_frame(void* data, struct wl_pointer* pointer) {} -+static void pointer_handle_frame(void* data, struct wl_pointer* pointer) { -+ sScrollEvent.SendScrollEvent(); -+} - - static void pointer_handle_axis_source( - void* data, struct wl_pointer* pointer, -- /*enum wl_pointer_axis_source */ uint32_t source) {} -+ /*enum wl_pointer_axis_source */ uint32_t source) { -+ sScrollEvent.SetSource(source); -+} - - static void pointer_handle_axis_stop(void* data, struct wl_pointer* pointer, - uint32_t time, uint32_t axis) {} - - static void pointer_handle_axis_discrete(void* data, struct wl_pointer* pointer, - uint32_t axis, int32_t value) {} - - static void pointer_handle_axis_value120(void* data, struct wl_pointer* pointer, -- uint32_t axis, int32_t value) {} -+ uint32_t axis, int32_t value) { -+ sScrollEvent.SetDelta120(axis, value); -+} -+ -+/* -+ * Example of scroll events we get for various devices. Note that -+ * even three different devices has the same wl_pointer. -+ * -+ * Standard mouse wheel: -+ * -+ * pointer_handle_axis_source pointer 0x7fd14fd4bac0 source 0 -+ * pointer_handle_axis_value120 pointer 0x7fd14fd4bac0 value 120 -+ * pointer_handle_axis pointer 0x7fd14fd4bac0 time 9470441 value 10.000000 -+ * pointer_handle_frame -+ * -+ * Hi-res mouse wheel: -+ * -+ * pointer_handle_axis_source pointer 0x7fd14fd4bac0 source 0 -+ * pointer_handle_axis_value120 pointer 0x7fd14fd4bac0 value -24 -+ * pointer_handle_axis pointer 0x7fd14fd4bac0 time 9593205 value -1.992188 -+ * pointer_handle_frame -+ * -+ * Touchpad: -+ * -+ * pointer_handle_axis_source pointer 0x7fd14fd4bac0 source 1 -+ * pointer_handle_axis pointer 0x7fd14fd4bac0 time 9431830 value 0.312500 -+ * pointer_handle_axis pointer 0x7fd14fd4bac0 time 9431830 value -1.015625 -+ * pointer_handle_frame -+ */ - - static const struct moz_wl_pointer_listener pointer_listener = { - pointer_handle_enter, pointer_handle_leave, - pointer_handle_motion, pointer_handle_button, - pointer_handle_axis, pointer_handle_frame, -@@ -363,12 +454,13 @@ - WaylandRegistryBind( - registry, id, &xdg_dbus_annotation_manager_v1_interface, 1); - display->SetXdgDbusAnnotationManager(annotationManager); - } else if (iface.EqualsLiteral("wl_seat") && - version >= WL_POINTER_RELEASE_SINCE_VERSION) { -- auto* seat = WaylandRegistryBind(registry, id, &wl_seat_interface, -- WL_POINTER_RELEASE_SINCE_VERSION); -+ auto* seat = WaylandRegistryBind( -+ registry, id, &wl_seat_interface, -+ MIN(version, WL_POINTER_AXIS_VALUE120_SINCE_VERSION)); - display->SetSeat(seat, id); - } else if (iface.EqualsLiteral("wp_fractional_scale_manager_v1")) { - auto* manager = WaylandRegistryBind( - registry, id, &wp_fractional_scale_manager_v1_interface, 1); - display->SetFractionalScaleManager(manager); -diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h ---- a/widget/gtk/nsWindow.h -+++ b/widget/gtk/nsWindow.h -@@ -256,10 +256,11 @@ - void OnContainerFocusOutEvent(GdkEventFocus* aEvent); - gboolean OnKeyPressEvent(GdkEventKey* aEvent); - gboolean OnKeyReleaseEvent(GdkEventKey* aEvent); - - void OnScrollEvent(GdkEventScroll* aEvent); -+ void OnSmoothScrollEvent(uint32_t aTime, float aDeltaX, float aDeltaY); - - void OnVisibilityNotifyEvent(GdkVisibilityState aState); - void OnWindowStateEvent(GtkWidget* aWidget, GdkEventWindowState* aEvent); - void OnDragDataReceivedEvent(GtkWidget* aWidget, GdkDragContext* aDragContext, - gint aX, gint aY, -@@ -900,18 +901,35 @@ - - // Next/Previous popups in Wayland popup hierarchy. - RefPtr mWaylandPopupNext; - RefPtr mWaylandPopupPrev; - -+ // When popup is resized by Gtk by move-to-rect callback, -+ // we store final popup size here. Then we use mMoveToRectPopupSize size -+ // in following popup operations unless mLayoutPopupSizeCleared is set. -+ LayoutDeviceIntSize mMoveToRectPopupSize; -+ - #ifdef MOZ_ENABLE_DBUS - RefPtr mDBusMenuBar; - #endif - -- // When popup is resized by Gtk by move-to-rect callback, -- // we store final popup size here. Then we use mMoveToRectPopupSize size -- // in following popup operations unless mLayoutPopupSizeCleared is set. -- LayoutDeviceIntSize mMoveToRectPopupSize; -+ struct LastMouseCoordinates { -+ template -+ void Set(Event* aEvent) { -+ mX = aEvent->x; -+ mY = aEvent->y; -+ mRootX = aEvent->x_root; -+ mRootY = aEvent->y_root; -+ } -+ -+ float mX = 0.0f, mY = 0.0f; -+ float mRootX = 0.0f, mRootY = 0.0f; -+ } mLastMouseCoordinates; -+ -+ // We don't want to fire scroll event with the same timestamp as -+ // smooth scroll event. -+ guint32 mLastSmoothScrollEventTime = GDK_CURRENT_TIME; - - /** - * |mIMContext| takes all IME related stuff. - * - * This is owned by the top-level nsWindow or the topmost child -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp ---- a/widget/gtk/nsWindow.cpp -+++ b/widget/gtk/nsWindow.cpp -@@ -4152,10 +4152,11 @@ - } - - // Check before checking for ungrab as the button state may have - // changed while a non-Gecko ancestor window had a pointer grab. - DispatchMissedButtonReleases(aEvent); -+ mLastMouseCoordinates.Set(aEvent); - - WidgetMouseEvent event(true, eMouseEnterIntoWidget, this, - WidgetMouseEvent::eReal); - - event.mRefPoint = GdkEventCoordsToDevicePixels(aEvent->x, aEvent->y); -@@ -4373,10 +4374,12 @@ - newSize.height, mAspectRatio); - gtk_window_resize(GTK_WINDOW(mShell), newSize.width, newSize.height); - } - - void nsWindow::OnMotionNotifyEvent(GdkEventMotion* aEvent) { -+ mLastMouseCoordinates.Set(aEvent); -+ - if (!mGdkWindow) { - return; - } - - // Emulate gdk_window_begin_resize_drag() for windows -@@ -4625,10 +4628,11 @@ - - void nsWindow::OnButtonPressEvent(GdkEventButton* aEvent) { - LOG("Button %u press\n", aEvent->button); - - SetLastMousePressEvent((GdkEvent*)aEvent); -+ mLastMouseCoordinates.Set(aEvent); - - // If you double click in GDK, it will actually generate a second - // GDK_BUTTON_PRESS before sending the GDK_2BUTTON_PRESS, and this is - // different than the DOM spec. GDK puts this in the queue - // programatically, so it's safe to assume that if there's a -@@ -4762,10 +4766,11 @@ - - void nsWindow::OnButtonReleaseEvent(GdkEventButton* aEvent) { - LOG("Button %u release\n", aEvent->button); - - SetLastMousePressEvent(nullptr); -+ mLastMouseCoordinates.Set(aEvent); - - if (!mGdkWindow) { - return; - } - -@@ -4997,11 +5002,19 @@ - } - return TRUE; - } - - void nsWindow::OnScrollEvent(GdkEventScroll* aEvent) { -- LOG("OnScrollEvent"); -+ LOG("OnScrollEvent time %d", aEvent->time); -+ -+ mLastMouseCoordinates.Set(aEvent); -+ -+ // This event was already handled by OnSmoothScrollEvent(). -+ if (aEvent->time != GDK_CURRENT_TIME && -+ mLastSmoothScrollEventTime == aEvent->time) { -+ return; -+ } - - // check to see if we should rollup - if (CheckForRollup(aEvent->x_root, aEvent->y_root, true, false)) { - return; - } -@@ -5148,10 +5161,39 @@ - wheelEvent.AssignEventTime(GetWidgetEventTime(aEvent->time)); - - DispatchInputEvent(&wheelEvent); - } - -+void nsWindow::OnSmoothScrollEvent(uint32_t aTime, float aDeltaX, -+ float aDeltaY) { -+ LOG("OnSmoothScrollEvent time %d dX %f dY %f", aTime, aDeltaX, aDeltaY); -+ -+ // This event was already handled by OnSmoothScrollEvent(). -+ mLastSmoothScrollEventTime = aTime; -+ -+ if (CheckForRollup(mLastMouseCoordinates.mRootX, mLastMouseCoordinates.mRootY, -+ true, false)) { -+ return; -+ } -+ -+ WidgetWheelEvent wheelEvent(true, eWheel, this); -+ wheelEvent.mDeltaMode = dom::WheelEvent_Binding::DOM_DELTA_LINE; -+ // Use the same constant as nsWindow::OnScrollEvent(). -+ wheelEvent.mDeltaX = aDeltaX * 3; -+ wheelEvent.mDeltaY = aDeltaY * 3; -+ wheelEvent.mWheelTicksX = aDeltaX; -+ wheelEvent.mWheelTicksY = aDeltaY; -+ wheelEvent.mIsNoLineOrPageDelta = true; -+ wheelEvent.mRefPoint = GdkEventCoordsToDevicePixels(mLastMouseCoordinates.mX, -+ mLastMouseCoordinates.mY); -+ -+ KeymapWrapper::InitInputEvent(wheelEvent, -+ KeymapWrapper::GetCurrentModifierState()); -+ wheelEvent.AssignEventTime(GetWidgetEventTime(aTime)); -+ DispatchInputEvent(&wheelEvent); -+} -+ - void nsWindow::DispatchPanGesture(PanGestureInput& aPanInput) { - MOZ_ASSERT(NS_IsMainThread()); - - if (mSwipeTracker) { - // Give the swipe tracker a first pass at the event. If a new pan gesture - diff --git a/D224842.1729586219.diff b/D224842.1729586219.diff deleted file mode 100644 index 30c76c0..0000000 --- a/D224842.1729586219.diff +++ /dev/null @@ -1,48 +0,0 @@ -diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp ---- a/widget/gtk/nsWaylandDisplay.cpp -+++ b/widget/gtk/nsWaylandDisplay.cpp -@@ -244,24 +244,34 @@ - pointer_handle_axis_source, pointer_handle_axis_stop, - pointer_handle_axis_discrete, pointer_handle_axis_value120, - }; - - void nsWaylandDisplay::SetPointer(wl_pointer* aPointer) { -- if (!mPointerGestures || wl_proxy_get_version((struct wl_proxy*)aPointer) < -- WL_POINTER_RELEASE_SINCE_VERSION) { -+ // Don't even try on such old interface -+ if (wl_proxy_get_version((struct wl_proxy*)aPointer) < -+ WL_POINTER_RELEASE_SINCE_VERSION) { - return; - } -+ - MOZ_DIAGNOSTIC_ASSERT(!mPointer); - mPointer = aPointer; -- wl_pointer_add_listener(mPointer, -- (const wl_pointer_listener*)&pointer_listener, this); -+ -+ // We're interested in pointer_handle_axis_value120() only for now. -+ if (wl_proxy_get_version((struct wl_proxy*)aPointer) >= -+ WL_POINTER_AXIS_VALUE120_SINCE_VERSION) { -+ wl_pointer_add_listener( -+ mPointer, (const wl_pointer_listener*)&pointer_listener, this); -+ } - -- mPointerGestureHold = -- zwp_pointer_gestures_v1_get_hold_gesture(mPointerGestures, mPointer); -- zwp_pointer_gesture_hold_v1_set_user_data(mPointerGestureHold, this); -- zwp_pointer_gesture_hold_v1_add_listener(mPointerGestureHold, -- &gesture_hold_listener, this); -+ // mPointerGestures is set by zwp_pointer_gestures_v1 if we have it. -+ if (mPointerGestures) { -+ mPointerGestureHold = -+ zwp_pointer_gestures_v1_get_hold_gesture(mPointerGestures, mPointer); -+ zwp_pointer_gesture_hold_v1_set_user_data(mPointerGestureHold, this); -+ zwp_pointer_gesture_hold_v1_add_listener(mPointerGestureHold, -+ &gesture_hold_listener, this); -+ } - } - - void nsWaylandDisplay::RemovePointer() { - wl_pointer_release(mPointer); - mPointer = nullptr; - diff --git a/D225439.1729586066.diff b/D225439.1729586066.diff deleted file mode 100644 index 212ee35..0000000 --- a/D225439.1729586066.diff +++ /dev/null @@ -1,223 +0,0 @@ -diff --git a/gfx/layers/apz/src/InputQueue.cpp b/gfx/layers/apz/src/InputQueue.cpp ---- a/gfx/layers/apz/src/InputQueue.cpp -+++ b/gfx/layers/apz/src/InputQueue.cpp -@@ -440,28 +440,33 @@ - APZEventResult InputQueue::ReceivePanGestureInput( - const RefPtr& aTarget, - TargetConfirmationFlags aFlags, const PanGestureInput& aEvent) { - APZEventResult result(aTarget, aFlags); - -+#ifndef MOZ_WIDGET_GTK - if (aEvent.mType == PanGestureInput::PANGESTURE_MAYSTART || - aEvent.mType == PanGestureInput::PANGESTURE_CANCELLED) { - // Ignore these events for now. - result.SetStatusAsConsumeDoDefault(aTarget); - return result; - } -+#endif - - if (aEvent.mType == PanGestureInput::PANGESTURE_INTERRUPTED) { - if (RefPtr block = mActivePanGestureBlock.get()) { - mQueuedInputs.AppendElement(MakeUnique(aEvent, *block)); - ProcessQueue(); - } - result.SetStatusAsIgnore(); - return result; - } - -+ bool startsNewBlock = aEvent.mType == PanGestureInput::PANGESTURE_MAYSTART || -+ aEvent.mType == PanGestureInput::PANGESTURE_START; -+ - RefPtr block; -- if (aEvent.mType != PanGestureInput::PANGESTURE_START) { -+ if (!startsNewBlock) { - block = mActivePanGestureBlock.get(); - } - - PanGestureInput event = aEvent; - -@@ -481,14 +486,14 @@ - // However, if there is a non-momentum event (indicating the user - // continued scrolling on the touchpad), a new input block is started - // by turning the event into a pan-start below. - return result; - } -- if (event.mType != PanGestureInput::PANGESTURE_START) { -- // Only PANGESTURE_START events are allowed to start a new pan gesture -- // block, but we really want to start a new block here, so we magically -- // turn this input into a PANGESTURE_START. -+ if (!startsNewBlock) { -+ // Only PANGESTURE_MAYSTART or PANGESTURE_START events are allowed to -+ // start a new pan gesture block, but we really want to start a new block -+ // here, so we magically turn this input into a PANGESTURE_START. - INPQ_LOG( - "transmogrifying pan input %d to PANGESTURE_START for new block\n", - event.mType); - event.mType = PanGestureInput::PANGESTURE_START; - } -diff --git a/gfx/layers/apz/test/gtest/TestPanning.cpp b/gfx/layers/apz/test/gtest/TestPanning.cpp ---- a/gfx/layers/apz/test/gtest/TestPanning.cpp -+++ b/gfx/layers/apz/test/gtest/TestPanning.cpp -@@ -78,10 +78,31 @@ - EXPECT_EQ(ParentLayerPoint(), pointOut); - EXPECT_EQ(AsyncTransform(), viewTransformOut); - - apzc->AssertStateIsReset(); - } -+ -+ void PanWithFling() { -+ // Send a pan gesture that triggers a fling animation at the end. -+ // Note that we need at least two _PAN events to have enough samples -+ // in the velocity tracker to compute a fling velocity. -+ PanGesture(PanGestureInput::PANGESTURE_START, apzc, ScreenIntPoint(50, 80), -+ ScreenPoint(0, 2), mcc->Time()); -+ mcc->AdvanceByMillis(5); -+ apzc->AdvanceAnimations(mcc->GetSampleTime()); -+ PanGesture(PanGestureInput::PANGESTURE_PAN, apzc, ScreenIntPoint(50, 80), -+ ScreenPoint(0, 10), mcc->Time()); -+ mcc->AdvanceByMillis(5); -+ apzc->AdvanceAnimations(mcc->GetSampleTime()); -+ PanGesture(PanGestureInput::PANGESTURE_PAN, apzc, ScreenIntPoint(50, 80), -+ ScreenPoint(0, 10), mcc->Time()); -+ mcc->AdvanceByMillis(5); -+ apzc->AdvanceAnimations(mcc->GetSampleTime()); -+ PanGesture(PanGestureInput::PANGESTURE_END, apzc, ScreenIntPoint(50, 80), -+ ScreenPoint(0, 0), mcc->Time(), MODIFIER_NONE, -+ /*aSimulateMomentum=*/true); -+ } - }; - - // In the each of the following 4 pan tests we are performing two pan gestures: - // vertical pan from top to bottom and back - from bottom to top. According to - // the pointer-events/touch-action spec AUTO and PAN_Y touch-action values allow -@@ -218,27 +239,11 @@ - EXPECT_NE(velocityFromPartialData, velocityFromFullDataViaHistory); - } - - TEST_F(APZCPanningTester, DuplicatePanEndEvents_Bug1833950) { - // Send a pan gesture that triggers a fling animation at the end. -- // Note that we need at least two _PAN events to have enough samples -- // in the velocity tracker to compute a fling velocity. -- PanGesture(PanGestureInput::PANGESTURE_START, apzc, ScreenIntPoint(50, 80), -- ScreenPoint(0, 2), mcc->Time()); -- mcc->AdvanceByMillis(5); -- apzc->AdvanceAnimations(mcc->GetSampleTime()); -- PanGesture(PanGestureInput::PANGESTURE_PAN, apzc, ScreenIntPoint(50, 80), -- ScreenPoint(0, 10), mcc->Time()); -- mcc->AdvanceByMillis(5); -- apzc->AdvanceAnimations(mcc->GetSampleTime()); -- PanGesture(PanGestureInput::PANGESTURE_PAN, apzc, ScreenIntPoint(50, 80), -- ScreenPoint(0, 10), mcc->Time()); -- mcc->AdvanceByMillis(5); -- apzc->AdvanceAnimations(mcc->GetSampleTime()); -- PanGesture(PanGestureInput::PANGESTURE_END, apzc, ScreenIntPoint(50, 80), -- ScreenPoint(0, 0), mcc->Time(), MODIFIER_NONE, -- /*aSimulateMomentum=*/true); -+ PanWithFling(); - - // Give the fling animation a chance to start. - SampleAnimationOnce(); - apzc->AssertStateIsFling(); - -@@ -247,5 +252,73 @@ - // trigger an assertion failure in debug mode. - PanGesture(PanGestureInput::PANGESTURE_END, apzc, ScreenIntPoint(50, 80), - ScreenPoint(0, 0), mcc->Time(), MODIFIER_NONE, - /*aSimulateMomentum=*/true); - } -+ -+#ifdef MOZ_WIDGET_GTK // Handling PANGESTURE_MAYSTART is Linux-only for now -+TEST_F(APZCPanningTester, HoldGesture_HoldAndRelease) { -+ // Send a pan gesture that triggers a fling animation at the end. -+ PanWithFling(); -+ -+ // Give the fling animation a chance to start. -+ SampleAnimationOnce(); -+ apzc->AssertStateIsFling(); -+ -+ // Send a PANGESTURE_MAYSTART event, signifying that the fingers went back -+ // down on the touchpad. -+ PanGesture(PanGestureInput::PANGESTURE_MAYSTART, apzc, ScreenIntPoint(50, 80), -+ ScreenPoint(0, 0), mcc->Time()); -+ -+ // This should have had the effect of cancelling the fling animation. -+ apzc->AssertStateIsReset(); -+ -+ // Send a PANGESTURE_CANCELLED event, signifying that the fingers have been -+ // lifted without any scrolling. This should have no effect on the gesture -+ // state. -+ mcc->AdvanceByMillis(5); -+ apzc->AdvanceAnimations(mcc->GetSampleTime()); -+ PanGesture(PanGestureInput::PANGESTURE_CANCELLED, apzc, -+ ScreenIntPoint(50, 80), ScreenPoint(0, 0), mcc->Time()); -+ apzc->AssertStateIsReset(); -+} -+ -+TEST_F(APZCPanningTester, HoldGesture_HoldAndScroll) { -+ // Send a pan gesture that triggers a fling animation at the end. -+ PanWithFling(); -+ -+ // Give the fling animation a chance to start. -+ SampleAnimationOnce(); -+ apzc->AssertStateIsFling(); -+ -+ // Record the scroll offset before the fingers go back. -+ float scrollYBefore = apzc->GetFrameMetrics().GetVisualScrollOffset().y; -+ EXPECT_GT(scrollYBefore, 0); -+ -+ // Send a PANGESTURE_MAYSTART event, signifying that the fingers went back -+ // down on the touchpad. -+ PanGesture(PanGestureInput::PANGESTURE_MAYSTART, apzc, ScreenIntPoint(50, 80), -+ ScreenPoint(0, 0), mcc->Time()); -+ -+ // This should have had the effect of cancelling the fling animation. -+ apzc->AssertStateIsReset(); -+ -+ // Do actual panning as part of the same gesture. -+ mcc->AdvanceByMillis(5); -+ apzc->AdvanceAnimations(mcc->GetSampleTime()); -+ PanGesture(PanGestureInput::PANGESTURE_START, apzc, ScreenIntPoint(50, 80), -+ ScreenPoint(0, 2), mcc->Time()); -+ mcc->AdvanceByMillis(5); -+ apzc->AdvanceAnimations(mcc->GetSampleTime()); -+ PanGesture(PanGestureInput::PANGESTURE_PAN, apzc, ScreenIntPoint(50, 80), -+ ScreenPoint(0, 10), mcc->Time()); -+ mcc->AdvanceByMillis(5); -+ apzc->AdvanceAnimations(mcc->GetSampleTime()); -+ PanGesture(PanGestureInput::PANGESTURE_END, apzc, ScreenIntPoint(50, 80), -+ ScreenPoint(0, 0), mcc->Time(), MODIFIER_NONE, -+ /*aSimulateMomentum=*/true); -+ -+ // Check that we've done additional scrolling. -+ float scrollYAfter = apzc->GetFrameMetrics().GetVisualScrollOffset().y; -+ EXPECT_GT(scrollYAfter, scrollYBefore); -+} -+#endif -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp ---- a/widget/gtk/nsWindow.cpp -+++ b/widget/gtk/nsWindow.cpp -@@ -5587,10 +5587,23 @@ - } - - void nsWindow::OnTouchpadHoldEvent(GdkTouchpadGesturePhase aPhase, guint aTime, - uint32_t aFingers) { - LOG("OnTouchpadHoldEvent: aPhase %d aFingers %d", aPhase, aFingers); -+ MOZ_ASSERT(aPhase != -+ GDK_TOUCHPAD_GESTURE_PHASE_UPDATE); // not used for hold gestures -+ PanGestureInput::PanGestureType eventType = -+ (aPhase == GDK_TOUCHPAD_GESTURE_PHASE_BEGIN) -+ ? PanGestureInput::PANGESTURE_MAYSTART -+ : PanGestureInput::PANGESTURE_CANCELLED; -+ ScreenPoint touchPoint = ViewAs( -+ GdkEventCoordsToDevicePixels(mLastMouseCoordinates.mX, -+ mLastMouseCoordinates.mY), -+ PixelCastJustification::LayoutDeviceIsScreenForUntransformedEvent); -+ PanGestureInput panEvent(eventType, GetEventTimeStamp(aTime), touchPoint, -+ ScreenPoint(), 0); -+ DispatchPanGesture(panEvent); - } - - gboolean nsWindow::OnTouchEvent(GdkEventTouch* aEvent) { - LOG("OnTouchEvent: x=%f y=%f type=%d\n", aEvent->x, aEvent->y, aEvent->type); - if (!mHandleTouchEvent) { - diff --git a/D225760.1729586239.diff b/D225760.1729586239.diff deleted file mode 100644 index 50cc583..0000000 --- a/D225760.1729586239.diff +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/widget/gtk/nsGtkKeyUtils.cpp b/widget/gtk/nsGtkKeyUtils.cpp ---- a/widget/gtk/nsGtkKeyUtils.cpp -+++ b/widget/gtk/nsGtkKeyUtils.cpp -@@ -683,19 +683,27 @@ - } - - /* This keymap routine is derived from weston-2.0.0/clients/simple-im.c - */ - void KeymapWrapper::HandleKeymap(uint32_t format, int fd, uint32_t size) { -+ MOZ_LOG(gKeyLog, LogLevel::Info, -+ ("KeymapWrapper::HandleKeymap() format %d fd %d size %d", format, fd, -+ size)); - KeymapWrapper::ResetKeyboard(); - - if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) { -+ MOZ_LOG(gKeyLog, LogLevel::Info, -+ ("KeymapWrapper::HandleKeymap(): format is not " -+ "WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1!")); - close(fd); - return; - } - - char* mapString = (char*)mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); - if (mapString == MAP_FAILED) { -+ MOZ_LOG(gKeyLog, LogLevel::Info, -+ ("KeymapWrapper::HandleKeymap(): failed to allocate shm!")); - close(fd); - return; - } - - struct xkb_context* xkb_context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); -@@ -705,11 +713,12 @@ - - munmap(mapString, size); - close(fd); - - if (!keymap) { -- NS_WARNING("keyboard_handle_keymap(): Failed to compile keymap!\n"); -+ MOZ_LOG(gKeyLog, LogLevel::Info, -+ ("KeymapWrapper::HandleKeymap(): Failed to compile keymap!")); - return; - } - - KeymapWrapper::SetModifierMasks(keymap); - - diff --git a/D225868.1729586247.diff b/D225868.1729586247.diff deleted file mode 100644 index 8ab66b1..0000000 --- a/D225868.1729586247.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/widget/gtk/nsGtkKeyUtils.cpp b/widget/gtk/nsGtkKeyUtils.cpp ---- a/widget/gtk/nsGtkKeyUtils.cpp -+++ b/widget/gtk/nsGtkKeyUtils.cpp -@@ -696,11 +696,11 @@ - "WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1!")); - close(fd); - return; - } - -- char* mapString = (char*)mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); -+ char* mapString = (char*)mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0); - if (mapString == MAP_FAILED) { - MOZ_LOG(gKeyLog, LogLevel::Info, - ("KeymapWrapper::HandleKeymap(): failed to allocate shm!")); - close(fd); - return; - diff --git a/firefox.spec b/firefox.spec index 1eb169f..e147f83 100644 --- a/firefox.spec +++ b/firefox.spec @@ -152,7 +152,7 @@ ExcludeArch: i686 %if %{?system_nss} %global nspr_version 4.32 %global nspr_build_version %{nspr_version} -%global nss_version 3.105 +%global nss_version 3.106 %global nss_build_version %{nss_version} %endif @@ -196,14 +196,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 132.0.2 -Release: 2%{?pre_tag}%{?dist} +Version: 133.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20241115.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20241122.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -282,17 +282,6 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch -Patch420: D209910.1715685533.diff -Patch421: D209911.1715685535.diff -Patch422: D210158.1715685536.diff -Patch423: D210159.1715685538.diff -Patch424: D210430.1715848796.diff - -Patch436: D223285.1729586039.diff -Patch437: D224842.1729586219.diff -Patch438: D225439.1729586066.diff -Patch439: D225760.1729586239.diff -Patch440: D225868.1729586247.diff # WebRTC/PipeWire camera patches # https://phabricator.services.mozilla.com/D228635 @@ -601,11 +590,6 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch -P407 -p1 -b .1667096 %if 0%{?fedora} > 40 -%patch -P436 -p1 -b .D223313 -%patch -P437 -p1 -b .D224842 -%patch -P438 -p1 -b .D225439 -%patch -P439 -p1 -b .D225760 -%patch -P440 -p1 -b .D225868 %patch -P450 -p1 -b .libwebrtc-pipewire-camera-use-better-unique-device-name-for-camera-devices %endif @@ -1215,7 +1199,6 @@ fi %{_datadir}/icons/hicolor/symbolic/apps/firefox-symbolic.svg %if %{enable_mozilla_crashreporter} %{mozappdir}/crashreporter -%{mozappdir}/minidump-analyzer %endif %{mozappdir}/*.so %{mozappdir}/defaults/pref/channel-prefs.js @@ -1239,6 +1222,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Nov 22 2024 Martin Stransky - 133.0-1 +- Updated to latest upstream (133.0) + * Mon Nov 18 2024 Martin Stransky - 132.0.2-2 - Added memory saving flags to x86_64 diff --git a/mozilla-1196777.patch b/mozilla-1196777.patch index 864741e..ac405c6 100644 --- a/mozilla-1196777.patch +++ b/mozilla-1196777.patch @@ -1,13 +1,12 @@ -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; +diff -up firefox-133.0/widget/gtk/nsWindow.cpp.1196777 firefox-133.0/widget/gtk/nsWindow.cpp +--- firefox-133.0/widget/gtk/nsWindow.cpp.1196777 2024-11-22 09:32:52.293470407 +0100 ++++ firefox-133.0/widget/gtk/nsWindow.cpp 2024-11-22 10:21:54.996441520 +0100 +@@ -191,7 +191,7 @@ constexpr gint kEvents = + GDK_VISIBILITY_NOTIFY_MASK | 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_PROPERTY_CHANGE_MASK | GDK_FOCUS_CHANGE_MASK; /* utility functions */ static bool is_mouse_in_window(GdkWindow* aWindow, gdouble aMouseX, diff --git a/sources b/sources index 31ada40..ffd4733 100644 --- a/sources +++ b/sources @@ -4,3 +4,5 @@ SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125 SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a SHA512 (firefox-langpacks-132.0.2-20241115.tar.xz) = 56aa82e805c900d3001a8c8b33b134ca0bcf0be6c445d0b536ac157845b3e59ffaa6a155594cfef501432baebf379e41450ddab3ba62e3f6956f6da27700bfc2 SHA512 (firefox-132.0.2.source.tar.xz) = 9ea95d9fb1a941ac5a5b50da67e224f3ccf8c401f26cb61bb74ad7f4e1e8706d469c4b6325714f2cb9cdf50c32710377d6bca18dd65b55db2c39ef2b27a57fae +SHA512 (firefox-133.0.source.tar.xz) = b16f9898bee4121914caef48d4f7f44bf9d69aee168586b02bf1b4f4197844fd10179e1b63b273f52929fb348030df36328f24993cd666969da4ddc82562a90c +SHA512 (firefox-langpacks-133.0-20241122.tar.xz) = 1f3c43c7e497d63487ef5241c5a755408fa8a90aa2468dc50f61702e3a842677d265640c584427859a7d4c4bd385a68584f8885576cb42f3aa17836db74fb9f1 diff --git a/wasi.patch b/wasi.patch index 476266a..d3d00f9 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-132.0.2-build/firefox-132.0.2/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-133.0-build/firefox-133.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 693c9dd4b7ad5ecc8d9d605336d933d8ba2abe47 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Sun, 24 Nov 2024 20:43:37 +0100 Subject: [PATCH 416/545] Build with bundled nss --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index e147f83..00fdd03 100644 --- a/firefox.spec +++ b/firefox.spec @@ -33,7 +33,7 @@ ExcludeArch: i686 %global use_pipewire_camera 0 %endif -%global system_nss 1 +%global system_nss 0 %global system_libevent 1 %global build_with_asan 0 %ifarch x86_64 %{ix86} From 734ed8d8e62dc6dc13310bbc72dcbad6d82767da Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 26 Nov 2024 08:13:20 +0100 Subject: [PATCH 417/545] Build with system nss --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 00fdd03..e147f83 100644 --- a/firefox.spec +++ b/firefox.spec @@ -33,7 +33,7 @@ ExcludeArch: i686 %global use_pipewire_camera 0 %endif -%global system_nss 0 +%global system_nss 1 %global system_libevent 1 %global build_with_asan 0 %ifarch x86_64 %{ix86} From 8e87d0d10d9ddacb639e0127f572d5ad046a7d54 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Sat, 30 Nov 2024 09:35:20 +0100 Subject: [PATCH 418/545] Add fix for mzbz#1934217 --- firefox.spec | 7 +- mzbz-1934217.patch | 192 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 198 insertions(+), 1 deletion(-) create mode 100644 mzbz-1934217.patch diff --git a/firefox.spec b/firefox.spec index e147f83..9fd1d20 100644 --- a/firefox.spec +++ b/firefox.spec @@ -197,7 +197,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 133.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -282,6 +282,7 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch +Patch408: mzbz-1934217.patch # WebRTC/PipeWire camera patches # https://phabricator.services.mozilla.com/D228635 @@ -588,6 +589,7 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch -P402 -p1 -b .1196777 %patch -P407 -p1 -b .1667096 +%patch -P408 -p1 -b .1934217 %if 0%{?fedora} > 40 %patch -P450 -p1 -b .libwebrtc-pipewire-camera-use-better-unique-device-name-for-camera-devices @@ -1222,6 +1224,9 @@ fi #--------------------------------------------------------------------- %changelog +* Sun Nov 30 2024 Martin Stransky - 133.0-2 +- Add fix for mzbz#1934217 + * Fri Nov 22 2024 Martin Stransky - 133.0-1 - Updated to latest upstream (133.0) diff --git a/mzbz-1934217.patch b/mzbz-1934217.patch new file mode 100644 index 0000000..4d4b718 --- /dev/null +++ b/mzbz-1934217.patch @@ -0,0 +1,192 @@ +changeset: 770274:d6372d8b0c6f +bookmark: phab-D230658 +tag: tip +parent: 770246:b8a69414f282 +user: Martin Stransky +date: Fri Nov 29 12:17:12 2024 +0000 +files: third_party/wayland-proxy/wayland-proxy.cpp +description: +Bug 1934217 [Wayland] Run disconnected wayland client for some time to allow process wayland protocol error messages r?emilio + +Differential Revision: https://phabricator.services.mozilla.com/D230658 + + +diff --git a/third_party/wayland-proxy/wayland-proxy.cpp b/third_party/wayland-proxy/wayland-proxy.cpp +--- a/third_party/wayland-proxy/wayland-proxy.cpp ++++ b/third_party/wayland-proxy/wayland-proxy.cpp +@@ -26,7 +26,8 @@ + #include + #include + #include +-#include ++#include ++#include + + #include "wayland-proxy.h" + +@@ -110,7 +111,7 @@ class ProxiedConnection { + // Process this connection (send/receive data). + // Returns false if connection is broken and should be removed. + bool Process(); +- void ProcessFailure(); ++ bool ProcessFailure(); + + void PrintConnectionInfo(); + +@@ -160,6 +161,13 @@ class ProxiedConnection { + int mStatRecvFromClient = 0; + int mStatSentToClient = 0; + int mStatSentToClientLater = 0; ++ ++ ++ // Wait 0.5 sec before we disconnect client ++ // from compositor. It gives client time to ++ // process potential error messages from compositor. ++ constexpr static const double sFailureTimeout = CLOCKS_PER_SEC / 2; ++ clock_t mFailureTime = 0; + }; + + WaylandMessage::~WaylandMessage() { +@@ -502,12 +510,30 @@ void ProxiedConnection::PrintConnectionI + } + + bool ProxiedConnection::Process() { ++ // If the connection already fails at ProxiedConnection::Process() somewhere, ++ // well finish processing all pending messages and flush queues to sockets. ++ // Then the connection becomes inactive (so we return early here) and we'll ++ // keep application socket opened for some time and then close ++ // the connection (disconnect application). ++ // ++ // It's because if we close application socket the app is instantly ++ // terminated by gtk event loop and there may be unprocessed messages ++ // pending in wayland client queues. ++ // ++ // That ensures we see actual wayland protocol error instead of ++ // 'application is terminated' error. ++ if (mApplicationFailed || mCompositorFailed) { ++ return false; ++ } ++ ++ // If we hit any error (instead of compositor waiting to connect), ++ // we keep the code running and flush pending messages where it's possible. ++ + // Check if appplication is still listening + if (mApplicationFlags & (POLLHUP | POLLERR)) { + Print("ProxiedConnection::Process(): Client socket is not listening\n"); + WaylandProxy::AddState(WAYLAND_PROXY_APP_CONNECTION_FAILED); + mApplicationFailed = true; +- return false; + } + + // Check if compositor is still listening +@@ -516,7 +542,6 @@ bool ProxiedConnection::Process() { + Print("ProxiedConnection::Process(): Compositor socket is not listening\n"); + WaylandProxy::AddState(WAYLAND_PROXY_COMPOSITOR_CONNECTION_FAILED); + mCompositorFailed = true; +- return false; + } + } else { + // Try to reconnect to compositor. +@@ -524,11 +549,9 @@ bool ProxiedConnection::Process() { + Error("ProxiedConnection::Process(): Failed to connect to compositor\n"); + WaylandProxy::AddState(WAYLAND_PROXY_COMPOSITOR_CONNECTION_FAILED); + mCompositorFailed = true; +- return false; +- } +- // We're not connected yet but ConnectToCompositor() didn't return +- // fatal error. Try again later. +- if (!mCompositorConnected) { ++ } else if (!mCompositorConnected) { ++ // We're not connected yet but ConnectToCompositor() didn't return ++ // fatal error. Try again later. + return true; + } + } +@@ -539,7 +562,6 @@ bool ProxiedConnection::Process() { + Error("ProxiedConnection::Process(): Failed to read data from compositor!"); + WaylandProxy::AddState(WAYLAND_PROXY_COMPOSITOR_CONNECTION_FAILED); + mCompositorFailed = true; +- return false; + } + if (!TransferOrQueue(mApplicationSocket, mApplicationFlags, mCompositorSocket, + &mToCompositorQueue, mStatRecvFromClient, +@@ -547,32 +569,41 @@ bool ProxiedConnection::Process() { + Error("ProxiedConnection::Process(): Failed to read data from client!"); + WaylandProxy::AddState(WAYLAND_PROXY_APP_CONNECTION_FAILED); + mApplicationFailed = true; +- return false; + } + if (!FlushQueue(mCompositorSocket, mCompositorFlags, mToCompositorQueue, + mStatSentToCompositorLater)) { + Error("ProxiedConnection::Process(): Failed to flush queue to compositor!"); + WaylandProxy::AddState(WAYLAND_PROXY_COMPOSITOR_CONNECTION_FAILED); + mCompositorFailed = true; +- return false; + } + if (!FlushQueue(mApplicationSocket, mApplicationFlags, mToApplicationQueue, + mStatSentToClientLater)) { + Error("ProxiedConnection::Process(): Failed to flush queue to client!"); + WaylandProxy::AddState(WAYLAND_PROXY_APP_CONNECTION_FAILED); + mApplicationFailed = true; +- return false; + } + + if (sPrintInfo) { + PrintConnectionInfo(); + } + +- return true; ++ if (mCompositorFailed) { ++ mFailureTime = clock(); ++ } ++ return !mApplicationFailed && !mCompositorFailed; + } + +-void ProxiedConnection::ProcessFailure() { ++bool ProxiedConnection::ProcessFailure() { ++ if (!mCompositorFailed && !mApplicationFailed) { ++ return false; ++ } ++ + if (mCompositorFailed) { ++ double time = (double)(clock() - mFailureTime); ++ if (time < sFailureTimeout) { ++ return false; ++ } ++ + struct stat buffer; + if (stat(mWaylandDisplay, &buffer) < 0) { + Print("ProxiedConnection(): compositor crashed!\n"); +@@ -583,9 +614,10 @@ void ProxiedConnection::ProcessFailure() + } else if (mApplicationFailed) { + Print("ProxiedConnection(): application fails to read/write events!\n"); + } ++ ++ return true; + } + +- + bool WaylandProxy::CheckWaylandDisplay(const char* aWaylandDisplay) { + struct sockaddr_un addr = {}; + addr.sun_family = AF_UNIX; +@@ -839,12 +871,13 @@ bool WaylandProxy::ProcessConnections() + for (connection = mConnections.begin(); connection != mConnections.end();) { + if (!(*connection)->Process()) { + WaylandProxy::AddState(WAYLAND_PROXY_CONNECTION_REMOVED); +- (*connection)->ProcessFailure(); +- connection = mConnections.erase(connection); +- if (mConnections.empty()) { +- // We removed last connection - quit. +- Info("removed last connection, quit\n"); +- return false; ++ if ((*connection)->ProcessFailure()) { ++ connection = mConnections.erase(connection); ++ if (mConnections.empty()) { ++ // We removed last connection - quit. ++ Info("removed last connection, quit\n"); ++ return false; ++ } + } + } else { + connection++; + From b5b76160bf93bda34bf3ca6bd5ee2b1982495fdf Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Sat, 30 Nov 2024 09:37:42 +0100 Subject: [PATCH 419/545] fixed changelog --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 9fd1d20..fb57379 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1224,7 +1224,7 @@ fi #--------------------------------------------------------------------- %changelog -* Sun Nov 30 2024 Martin Stransky - 133.0-2 +* Sat Nov 30 2024 Martin Stransky - 133.0-2 - Add fix for mzbz#1934217 * Fri Nov 22 2024 Martin Stransky - 133.0-1 From 6021cc0be14c4333e2767324a7553bdb0243e952 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 6 Dec 2024 10:00:45 +0100 Subject: [PATCH 420/545] Removed unused sources --- sources | 2 -- 1 file changed, 2 deletions(-) diff --git a/sources b/sources index ffd4733..ba175af 100644 --- a/sources +++ b/sources @@ -2,7 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a -SHA512 (firefox-langpacks-132.0.2-20241115.tar.xz) = 56aa82e805c900d3001a8c8b33b134ca0bcf0be6c445d0b536ac157845b3e59ffaa6a155594cfef501432baebf379e41450ddab3ba62e3f6956f6da27700bfc2 -SHA512 (firefox-132.0.2.source.tar.xz) = 9ea95d9fb1a941ac5a5b50da67e224f3ccf8c401f26cb61bb74ad7f4e1e8706d469c4b6325714f2cb9cdf50c32710377d6bca18dd65b55db2c39ef2b27a57fae SHA512 (firefox-133.0.source.tar.xz) = b16f9898bee4121914caef48d4f7f44bf9d69aee168586b02bf1b4f4197844fd10179e1b63b273f52929fb348030df36328f24993cd666969da4ddc82562a90c SHA512 (firefox-langpacks-133.0-20241122.tar.xz) = 1f3c43c7e497d63487ef5241c5a755408fa8a90aa2468dc50f61702e3a842677d265640c584427859a7d4c4bd385a68584f8885576cb42f3aa17836db74fb9f1 From 51be9803b2aeeeba2cad46c5eaf005f03780e1ab Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 11 Dec 2024 10:26:46 +0100 Subject: [PATCH 421/545] Updated to 133.0.3 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- wasi.patch | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 5b3f960..55bd7ba 100644 --- a/.gitignore +++ b/.gitignore @@ -672,3 +672,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-132.0.2.source.tar.xz /firefox-133.0.source.tar.xz /firefox-langpacks-133.0-20241122.tar.xz +/firefox-langpacks-133.0.3-20241211.tar.xz +/firefox-133.0.3.source.tar.xz diff --git a/firefox.spec b/firefox.spec index fb57379..67b9784 100644 --- a/firefox.spec +++ b/firefox.spec @@ -196,14 +196,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 133.0 -Release: 2%{?pre_tag}%{?dist} +Version: 133.0.3 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20241122.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20241211.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1224,6 +1224,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Dec 11 2024 Martin Stransky - 133.0.3-1 +- Updated to 133.0.3 + * Sat Nov 30 2024 Martin Stransky - 133.0-2 - Add fix for mzbz#1934217 diff --git a/sources b/sources index ba175af..4ecb8eb 100644 --- a/sources +++ b/sources @@ -2,5 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a -SHA512 (firefox-133.0.source.tar.xz) = b16f9898bee4121914caef48d4f7f44bf9d69aee168586b02bf1b4f4197844fd10179e1b63b273f52929fb348030df36328f24993cd666969da4ddc82562a90c -SHA512 (firefox-langpacks-133.0-20241122.tar.xz) = 1f3c43c7e497d63487ef5241c5a755408fa8a90aa2468dc50f61702e3a842677d265640c584427859a7d4c4bd385a68584f8885576cb42f3aa17836db74fb9f1 +SHA512 (firefox-langpacks-133.0.3-20241211.tar.xz) = ad6708f15de611c239cccf72c45d0de5d0a057a67ac626211962247dcb7a93676ec3618832fe1771bdb7f3432cd4f602986dae6b2ae1a0596f83b10a9b262b8f +SHA512 (firefox-133.0.3.source.tar.xz) = ce48beaa5bb1717d9b6dbfff035b1bb5de1456df14b6a91adfaf3ccfb7ac550ab7ee854546231424a920e01d981825253609fce2ec326c4aa1ca316bbbdb31f8 diff --git a/wasi.patch b/wasi.patch index d3d00f9..283efcc 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-133.0-build/firefox-133.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-133.0.3-build/firefox-133.0.3/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From a2fde72d25c680f69deb84c6df967beea6a25eee Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 16 Dec 2024 11:02:53 +0100 Subject: [PATCH 422/545] Remove MOZ_DBUS_APP_NAME from launch script as it breaks Thunderbird (rhbz#2320090) --- firefox.sh.in | 8 -------- firefox.spec | 5 ++++- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/firefox.sh.in b/firefox.sh.in index a6b92c0..e6edd02 100644 --- a/firefox.sh.in +++ b/firefox.sh.in @@ -250,14 +250,6 @@ then export MOZ_APP_REMOTINGNAME=__APP_NAME__ fi -# MOZ_DBUS_APP_NAME sets app name for DBus services like Gnome Shell -# search provider or remote launcher -# DBus interface name (or prefix) is org.mozilla.MOZ_DBUS_APP_NAME -if [ -z "$MOZ_DBUS_APP_NAME" ] -then - export MOZ_DBUS_APP_NAME=firefox -fi - # Flatpak specific environment variables %FLATPAK_ENV_VARS% diff --git a/firefox.spec b/firefox.spec index 67b9784..d68aed6 100644 --- a/firefox.spec +++ b/firefox.spec @@ -197,7 +197,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 133.0.3 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -1224,6 +1224,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Dec 16 2024 Martin Stransky - 133.0.3-2 +- Remove MOZ_DBUS_APP_NAME from launch script as it breaks Thunderbird (rhbz#2320090) + * Wed Dec 11 2024 Martin Stransky - 133.0.3-1 - Updated to 133.0.3 From 2c1ed0ea17ab0800ca17263c34a551f2d35fe229 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 3 Jan 2025 01:29:27 +0100 Subject: [PATCH 423/545] Updated to 134.0 --- .gitignore | 2 + build-aarch64-skia.patch | 24 ++++++------ firefox.spec | 17 +++------ ...nique-device-name-for-camera-devices.patch | 37 ------------------- sources | 4 +- wasi.patch | 2 +- 6 files changed, 22 insertions(+), 64 deletions(-) delete mode 100644 libwebrtc-pipewire-camera-use-better-unique-device-name-for-camera-devices.patch diff --git a/.gitignore b/.gitignore index 55bd7ba..d97c949 100644 --- a/.gitignore +++ b/.gitignore @@ -674,3 +674,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-133.0-20241122.tar.xz /firefox-langpacks-133.0.3-20241211.tar.xz /firefox-133.0.3.source.tar.xz +/firefox-langpacks-134.0-20250102.tar.xz +/firefox-134.0.source.tar.xz diff --git a/build-aarch64-skia.patch b/build-aarch64-skia.patch index b3abe7a..9223bb8 100644 --- a/build-aarch64-skia.patch +++ b/build-aarch64-skia.patch @@ -1,6 +1,6 @@ -diff -up firefox-128.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h.aarch64-skia firefox-128.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h ---- firefox-128.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h.aarch64-skia 2024-07-02 11:10:25.047099913 +0200 -+++ firefox-128.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h 2024-07-02 11:15:43.855410571 +0200 +diff -up firefox-134.0-build/firefox-134.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h.aarch64-skia firefox-134.0-build/firefox-134.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h +--- firefox-134.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h.aarch64-skia 2024-12-30 19:30:46.000000000 +0100 ++++ firefox-134.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h 2025-01-02 20:51:07.855087265 +0100 @@ -151,7 +151,7 @@ SI U32 to_fixed(F f) { return (U32)cast @@ -19,17 +19,15 @@ diff -up firefox-128.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h.aarch64-s return (U16)vcvt_f16_f32(f); #elif defined(USING_AVX512F) return (U16)_mm512_cvtps_ph((__m512 )f, _MM_FROUND_CUR_DIRECTION ); -diff -up firefox-128.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia firefox-128.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h ---- firefox-128.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia 2024-07-02 11:10:25.048099949 +0200 -+++ firefox-128.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h 2024-07-02 11:13:33.384783413 +0200 -@@ -1425,8 +1425,8 @@ SI F from_half(U16 h) { +diff -up firefox-134.0-build/firefox-134.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia firefox-134.0-build/firefox-134.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h +--- firefox-134.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia 2025-01-02 20:51:07.856087299 +0100 ++++ firefox-134.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h 2025-01-02 23:09:47.802283444 +0100 +@@ -1421,7 +1421,7 @@ SI F from_half(U16 h) { } SI U16 to_half(F f) { --#if defined(JUMPER_IS_NEON) && defined(SK_CPU_ARM64) -- return (U16)vcvt_f16_f32(f); -+#if 0 //defined(JUMPER_IS_NEON) && defined(SK_CPU_ARM64) -+ return (U16)vcvt_f16_f32(f); +-#if defined(SKRP_CPU_NEON) && defined(SK_CPU_ARM64) ++#if 0 // defined(SKRP_CPU_NEON) && defined(SK_CPU_ARM64) + return (U16)vcvt_f16_f32(f); - #elif defined(JUMPER_IS_SKX) - return (U16)_mm512_cvtps_ph(f, _MM_FROUND_CUR_DIRECTION); + #elif defined(SKRP_CPU_SKX) diff --git a/firefox.spec b/firefox.spec index d68aed6..ee6f8ad 100644 --- a/firefox.spec +++ b/firefox.spec @@ -196,14 +196,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 133.0.3 -Release: 2%{?pre_tag}%{?dist} +Version: 134.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20241211.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250102.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -284,10 +284,6 @@ Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: mzbz-1934217.patch -# WebRTC/PipeWire camera patches -# https://phabricator.services.mozilla.com/D228635 -Patch450: libwebrtc-pipewire-camera-use-better-unique-device-name-for-camera-devices.patch - # PGO/LTO patches Patch600: pgo.patch Patch602: mozilla-1516803.patch @@ -591,10 +587,6 @@ export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.buil %patch -P407 -p1 -b .1667096 %patch -P408 -p1 -b .1934217 -%if 0%{?fedora} > 40 -%patch -P450 -p1 -b .libwebrtc-pipewire-camera-use-better-unique-device-name-for-camera-devices -%endif - # PGO patches %if %{build_with_pgo} %if !%{build_with_clang} @@ -1224,6 +1216,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Jan 02 2025 Martin Stransky - 134.0-1 +- Updated to 134.0 + * Mon Dec 16 2024 Martin Stransky - 133.0.3-2 - Remove MOZ_DBUS_APP_NAME from launch script as it breaks Thunderbird (rhbz#2320090) diff --git a/libwebrtc-pipewire-camera-use-better-unique-device-name-for-camera-devices.patch b/libwebrtc-pipewire-camera-use-better-unique-device-name-for-camera-devices.patch deleted file mode 100644 index 0eaf427..0000000 --- a/libwebrtc-pipewire-camera-use-better-unique-device-name-for-camera-devices.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc -index e5db278ff6..13707da44d 100644 ---- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc -+++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc -@@ -76,7 +76,7 @@ PipeWireNode::PipeWireNode(PipeWireSession* session, - : session_(session), - id_(id), - display_name_(spa_dict_lookup(props, PW_KEY_NODE_DESCRIPTION)), -- unique_id_(rtc::ToString(id)) { -+ unique_id_(spa_dict_lookup(props, PW_KEY_NODE_NAME)) { - RTC_LOG(LS_VERBOSE) << "Found Camera: " << display_name_; - - proxy_ = static_cast(pw_registry_bind( -diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc -index 61b1b54233..f6cd57ac36 100644 ---- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc -+++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc -@@ -83,12 +83,15 @@ int32_t VideoCaptureModulePipeWire::Init(const char* deviceUniqueId) { - RTC_CHECK_RUNS_SERIALIZED(&capture_checker_); - RTC_DCHECK_RUN_ON(&api_checker_); - -- absl::optional id; -- id = rtc::StringToNumber(deviceUniqueId); -- if (id == absl::nullopt) -+ auto node = -+ std::find_if(session_->nodes_.begin(), session_->nodes_.end(), -+ [deviceUniqueId](const PipeWireNode::PipeWireNodePtr& node) { -+ return node->unique_id() == deviceUniqueId; -+ }); -+ if (node == session_->nodes_.end()) - return -1; - -- node_id_ = id.value(); -+ node_id_ = (*node)->id(); - - const int len = strlen(deviceUniqueId); - _deviceUniqueId = new (std::nothrow) char[len + 1]; diff --git a/sources b/sources index 4ecb8eb..8db0166 100644 --- a/sources +++ b/sources @@ -2,5 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a -SHA512 (firefox-langpacks-133.0.3-20241211.tar.xz) = ad6708f15de611c239cccf72c45d0de5d0a057a67ac626211962247dcb7a93676ec3618832fe1771bdb7f3432cd4f602986dae6b2ae1a0596f83b10a9b262b8f -SHA512 (firefox-133.0.3.source.tar.xz) = ce48beaa5bb1717d9b6dbfff035b1bb5de1456df14b6a91adfaf3ccfb7ac550ab7ee854546231424a920e01d981825253609fce2ec326c4aa1ca316bbbdb31f8 +SHA512 (firefox-langpacks-134.0-20250102.tar.xz) = 7c09b58fe338351dc0316d772c2433753b3894e6b40e63070b61e9bddda4b6b33913041f71ca058f855de3f7261afa9e357a187a4e7091d70410d1670506ff56 +SHA512 (firefox-134.0.source.tar.xz) = 1275a686dc0a27b48df4ae05616511512f676e03474e3095b2521eac25a385d345aa3e8786716dbe812af49e07d72b32772479089d648968e2004ca0c9c35344 diff --git a/wasi.patch b/wasi.patch index 283efcc..a8dbf03 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-133.0.3-build/firefox-133.0.3/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-134.0-build/firefox-134.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From c8803752f0b5d03205b64a1a08d64d5d5fbd97cc Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 15 Jan 2025 20:38:27 +0100 Subject: [PATCH 424/545] Updated to 134.0.1 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index d97c949..3c95691 100644 --- a/.gitignore +++ b/.gitignore @@ -676,3 +676,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-133.0.3.source.tar.xz /firefox-langpacks-134.0-20250102.tar.xz /firefox-134.0.source.tar.xz +/firefox-langpacks-134.0.1-20250115.tar.xz +/firefox-134.0.1.source.tar.xz diff --git a/firefox.spec b/firefox.spec index ee6f8ad..aaaa894 100644 --- a/firefox.spec +++ b/firefox.spec @@ -196,14 +196,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 134.0 +Version: 134.0.1 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250102.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250115.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1216,6 +1216,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Jan 15 2025 Martin Stransky - 134.0.1-1 +- Updated to 134.0.1 + * Thu Jan 02 2025 Martin Stransky - 134.0-1 - Updated to 134.0 diff --git a/sources b/sources index 8db0166..1464ac0 100644 --- a/sources +++ b/sources @@ -2,5 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a -SHA512 (firefox-langpacks-134.0-20250102.tar.xz) = 7c09b58fe338351dc0316d772c2433753b3894e6b40e63070b61e9bddda4b6b33913041f71ca058f855de3f7261afa9e357a187a4e7091d70410d1670506ff56 -SHA512 (firefox-134.0.source.tar.xz) = 1275a686dc0a27b48df4ae05616511512f676e03474e3095b2521eac25a385d345aa3e8786716dbe812af49e07d72b32772479089d648968e2004ca0c9c35344 +SHA512 (firefox-langpacks-134.0.1-20250115.tar.xz) = 3b1a40d9231ed03562f1af116482d6fac7f488b716e1793733b73c33cd2557c1b15f2564b48fe2f27f5bf840e14f0c9c5f92b828963b595321a1d17e81fad8e1 +SHA512 (firefox-134.0.1.source.tar.xz) = 3f40ca5a753a66e08af4e8b12d75feab67b0567ecffd34f5cf013f49aeb809ccd458c8011e9456dc902c24eaf626078117874514eb40cee5574eafce93ee772d From aa135fb5172d032350746de3425e6d5f7eed965a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Sun, 12 May 2024 14:41:30 +0200 Subject: [PATCH 425/545] Add option to easier build with clang --- firefox.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/firefox.spec b/firefox.spec index aaaa894..ad00023 100644 --- a/firefox.spec +++ b/firefox.spec @@ -53,10 +53,11 @@ ExcludeArch: i686 %bcond wasi_sdk 1 %endif -%if "%{toolchain}" == "clang" -%global build_with_clang 1 +%bcond build_with_clang 0 +%if %{with build_with_clang} +%global toolchain clang %else -%global build_with_clang 0 +%global toolchain gcc %endif %global gnome_shell_search_provider 0 From d529b4b41d2450fbadb4106d441a9146d6976709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Sun, 12 May 2024 14:47:28 +0200 Subject: [PATCH 426/545] Remove unused patch --- firefox.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index aaaa894..1f0383d 100644 --- a/firefox.spec +++ b/firefox.spec @@ -243,7 +243,6 @@ Source49: wasi.patch.template Source50: wasi-sdk-20.tar.gz # Build patches -#Patch3: mozilla-build-arm.patch Patch32: build-rust-ppc64le.patch Patch35: build-ppc-jit.patch # Fixing missing cacheFlush when JS_CODEGEN_NONE is used (s390x) From a390ac89a89ad43725e463712b47ade8c1422a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Mon, 13 May 2024 06:15:35 +0200 Subject: [PATCH 427/545] Fix build with Clang LLVM 15+ needs compiler-rt to provide libclang_rt.profile-x86_64.a --- firefox.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/firefox.spec b/firefox.spec index aaaa894..a5b31b1 100644 --- a/firefox.spec +++ b/firefox.spec @@ -468,6 +468,10 @@ BuildRequires: clang cmake ninja-build Recommends: speech-dispatcher Recommends: speech-dispatcher-utils +%if %{with build_with_clang} +BuildRequires: compiler-rt +%endif + Obsoletes: mozilla <= 37:1.7.13 Provides: webclient From 1e8e36237364315d95a0185a9c292c9fe4eaaa01 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Thu, 16 Jan 2025 08:31:57 +0100 Subject: [PATCH 428/545] Rebase wasi-sdk to version 25 --- .gitignore | 1 + firefox.spec | 4 ++-- sources | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 3c95691..31f33c6 100644 --- a/.gitignore +++ b/.gitignore @@ -678,3 +678,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-134.0.source.tar.xz /firefox-langpacks-134.0.1-20250115.tar.xz /firefox-134.0.1.source.tar.xz +/wasi-sdk-25.tar.gz diff --git a/firefox.spec b/firefox.spec index aaaa894..00e796f 100644 --- a/firefox.spec +++ b/firefox.spec @@ -239,8 +239,8 @@ Source48: org.mozilla.firefox.appdata.xml.in Source49: wasi.patch.template # Created by: # git clone --recursive https://github.com/WebAssembly/wasi-sdk.git -# cd wasi-sdk && git-archive-all --force-submodules wasi-sdk-20.tar.gz -Source50: wasi-sdk-20.tar.gz +# cd wasi-sdk && git-archive-all --force-submodules wasi-sdk-25.tar.gz +Source50: wasi-sdk-25.tar.gz # Build patches #Patch3: mozilla-build-arm.patch diff --git a/sources b/sources index 1464ac0..567fa9a 100644 --- a/sources +++ b/sources @@ -1,6 +1,6 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 -SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a SHA512 (firefox-langpacks-134.0.1-20250115.tar.xz) = 3b1a40d9231ed03562f1af116482d6fac7f488b716e1793733b73c33cd2557c1b15f2564b48fe2f27f5bf840e14f0c9c5f92b828963b595321a1d17e81fad8e1 SHA512 (firefox-134.0.1.source.tar.xz) = 3f40ca5a753a66e08af4e8b12d75feab67b0567ecffd34f5cf013f49aeb809ccd458c8011e9456dc902c24eaf626078117874514eb40cee5574eafce93ee772d +SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa From 6400c3f44b00e9b19f1e75067f963edacd430c17 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Thu, 16 Jan 2025 13:13:05 +0100 Subject: [PATCH 429/545] Fixing wasi build --- firefox.spec | 18 ++++++++++++++---- wasi.patch | 32 ++++++++++---------------------- wasi.patch.template | 30 +++++++++--------------------- 3 files changed, 33 insertions(+), 47 deletions(-) diff --git a/firefox.spec b/firefox.spec index 00e796f..d3ad948 100644 --- a/firefox.spec +++ b/firefox.spec @@ -567,7 +567,7 @@ This package contains results of tests executed during build. # We need to create the wasi.patch with the correct path to the wasm libclang_rt. %if %{with wasi_sdk} -export LIBCLANG_RT=`pwd`/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a; cat %{SOURCE49} | envsubst > %{_sourcedir}/wasi.patch +export LIBCLANG_RT=`pwd`/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a; cat %{SOURCE49} | envsubst > %{_sourcedir}/wasi.patch %patch -P80 -p1 -b .wasi %endif @@ -732,8 +732,18 @@ chmod a-x third_party/rust/ash/src/extensions/nv/*.rs #WASI SDK %if %{with wasi_sdk} -pushd wasi-sdk-20 -NINJA_FLAGS=-v CC=clang CXX=clang++ env -u CFLAGS -u CXXFLAGS -u FFLAGS -u VALFLAGS -u RUSTFLAGS -u LDFLAGS -u LT_SYS_LIBRARY_PATH make package +pushd wasi-sdk-25 + +NINJA_FLAGS=-v CC=clang CXX=clang++ env -u CFLAGS -u CXXFLAGS -u FFLAGS -u VALFLAGS -u RUSTFLAGS -u LDFLAGS -u LT_SYS_LIBRARY_PATH cmake -G Ninja -B build/toolchain -S . -DWASI_SDK_BUILD_TOOLCHAIN=ON -DCMAKE_INSTALL_PREFIX=build/install +NINJA_FLAGS=-v CC=clang CXX=clang++ env -u CFLAGS -u CXXFLAGS -u FFLAGS -u VALFLAGS -u RUSTFLAGS -u LDFLAGS -u LT_SYS_LIBRARY_PATH cmake --build build/toolchain --target install + +NINJA_FLAGS=-v CC=clang CXX=clang++ env -u CFLAGS -u CXXFLAGS -u FFLAGS -u VALFLAGS -u RUSTFLAGS -u LDFLAGS -u LT_SYS_LIBRARY_PATH cmake -G Ninja -B build/sysroot -S . \ + -DCMAKE_INSTALL_PREFIX=build/install \ + -DCMAKE_TOOLCHAIN_FILE=build/install/share/cmake/wasi-sdk.cmake \ + -DCMAKE_C_COMPILER_WORKS=ON \ + -DCMAKE_CXX_COMPILER_WORKS=ON +NINJA_FLAGS=-v CC=clang CXX=clang++ env -u CFLAGS -u CXXFLAGS -u FFLAGS -u VALFLAGS -u RUSTFLAGS -u LDFLAGS -u LT_SYS_LIBRARY_PATH cmake --build build/sysroot --target install + popd %endif # ^ with wasi_sdk @@ -855,7 +865,7 @@ echo "ac_add_options MOZ_PGO=1" >> .mozconfig %endif %if %{with wasi_sdk} -echo "ac_add_options --with-wasi-sysroot=`pwd`/wasi-sdk-20/build/install/opt/wasi-sdk/share/wasi-sysroot" >> .mozconfig +echo "ac_add_options --with-wasi-sysroot=`pwd`/wasi-sdk-25/build/sysroot/install/share/wasi-sysroot" >> .mozconfig %else echo "ac_add_options --without-sysroot" >> .mozconfig echo "ac_add_options --without-wasm-sandboxed-libraries" >> .mozconfig diff --git a/wasi.patch b/wasi.patch index a8dbf03..2717bf9 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,30 +6,18 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-134.0-build/firefox-134.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/home/jhorak/f/firefox/firefox-134.0.1-build/firefox-134.0.1/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) -diff -up firefox-121.0.1/wasi-sdk-20/Makefile.fedora firefox-121.0.1/wasi-sdk-20/Makefile ---- firefox-121.0.1/wasi-sdk-20/Makefile.fedora 2024-03-04 13:20:56.903403496 +0100 -+++ firefox-121.0.1/wasi-sdk-20/Makefile 2024-03-04 13:19:59.381140045 +0100 -@@ -44,7 +44,7 @@ endif +diff -up firefox-134.0.1/wasi-sdk-25/version.py.wasi firefox-134.0.1/wasi-sdk-25/version.py +--- firefox-134.0.1/wasi-sdk-25/version.py.wasi 2025-01-16 11:53:48.013045085 +0100 ++++ firefox-134.0.1/wasi-sdk-25/version.py 2025-01-16 11:54:05.470072564 +0100 +@@ -60,6 +60,7 @@ assert parse_git_version( - # Only the major version is needed for Clang, see https://reviews.llvm.org/D125860. - CLANG_VERSION=$(shell $(BASH) ./llvm_version_major.sh $(LLVM_PROJ_DIR)) --VERSION:=$(shell $(BASH) ./version.sh) -+VERSION:=20 #$(shell $(BASH) ./version.sh) - DEBUG_PREFIX_MAP=-fdebug-prefix-map=$(ROOT_DIR)=wasisdk://v$(VERSION) - default: build -@@ -262,8 +262,8 @@ package: build/package.BUILT - - build/package.BUILT: build strip - mkdir -p dist -- ./deb_from_installation.sh $(shell pwd)/dist "$(VERSION)" "$(BUILD_PREFIX)" -- ./tar_from_installation.sh "$(shell pwd)/dist" "$(VERSION)" "$(BUILD_PREFIX)" -+ #./deb_from_installation.sh $(shell pwd)/dist "$(VERSION)" "$(BUILD_PREFIX)" -+ #./tar_from_installation.sh "$(shell pwd)/dist" "$(VERSION)" "$(BUILD_PREFIX)" - touch build/package.BUILT - - .PHONY: default clean build strip package check + def git_version(): ++ return 25 + version = exec(['git', 'describe', '--long', '--candidates=999', + '--match=wasi-sdk-*', '--dirty=+m', f'--abbrev={GIT_REF_LEN}'], + os.path.dirname(sys.argv[0])) diff --git a/wasi.patch.template b/wasi.patch.template index daaad77..69f7da3 100644 --- a/wasi.patch.template +++ b/wasi.patch.template @@ -10,26 +10,14 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. return [] set_config("WASI_SYSROOT", wasi_sysroot) -diff -up firefox-121.0.1/wasi-sdk-20/Makefile.fedora firefox-121.0.1/wasi-sdk-20/Makefile ---- firefox-121.0.1/wasi-sdk-20/Makefile.fedora 2024-03-04 13:20:56.903403496 +0100 -+++ firefox-121.0.1/wasi-sdk-20/Makefile 2024-03-04 13:19:59.381140045 +0100 -@@ -44,7 +44,7 @@ endif +diff -up firefox-134.0.1/wasi-sdk-25/version.py.wasi firefox-134.0.1/wasi-sdk-25/version.py +--- firefox-134.0.1/wasi-sdk-25/version.py.wasi 2025-01-16 11:53:48.013045085 +0100 ++++ firefox-134.0.1/wasi-sdk-25/version.py 2025-01-16 11:54:05.470072564 +0100 +@@ -60,6 +60,7 @@ assert parse_git_version( - # Only the major version is needed for Clang, see https://reviews.llvm.org/D125860. - CLANG_VERSION=$(shell $(BASH) ./llvm_version_major.sh $(LLVM_PROJ_DIR)) --VERSION:=$(shell $(BASH) ./version.sh) -+VERSION:=20 #$(shell $(BASH) ./version.sh) - DEBUG_PREFIX_MAP=-fdebug-prefix-map=$(ROOT_DIR)=wasisdk://v$(VERSION) - default: build -@@ -262,8 +262,8 @@ package: build/package.BUILT - - build/package.BUILT: build strip - mkdir -p dist -- ./deb_from_installation.sh $(shell pwd)/dist "$(VERSION)" "$(BUILD_PREFIX)" -- ./tar_from_installation.sh "$(shell pwd)/dist" "$(VERSION)" "$(BUILD_PREFIX)" -+ #./deb_from_installation.sh $(shell pwd)/dist "$(VERSION)" "$(BUILD_PREFIX)" -+ #./tar_from_installation.sh "$(shell pwd)/dist" "$(VERSION)" "$(BUILD_PREFIX)" - touch build/package.BUILT - - .PHONY: default clean build strip package check + def git_version(): ++ return 25 + version = exec(['git', 'describe', '--long', '--candidates=999', + '--match=wasi-sdk-*', '--dirty=+m', f'--abbrev={GIT_REF_LEN}'], + os.path.dirname(sys.argv[0])) From 7a256903b56c97b8d3923aaa85ef1edf59c59e34 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Fri, 17 Jan 2025 08:42:11 +0100 Subject: [PATCH 430/545] Fixing wasi build again --- wasi.patch.template | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/wasi.patch.template b/wasi.patch.template index 69f7da3..6771a31 100644 --- a/wasi.patch.template +++ b/wasi.patch.template @@ -1,7 +1,7 @@ -diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz.configure ---- firefox-121.0.1/toolkit/moz.configure.wasi 2024-02-01 09:14:33.816548952 +0100 -+++ firefox-121.0.1/toolkit/moz.configure 2024-02-01 09:15:53.264684309 +0100 -@@ -2663,7 +2663,7 @@ with only_when(requires_wasm_sandboxing +diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz.configure +--- firefox-134.0.1/toolkit/moz.configure.wasi 2025-01-13 14:46:04.000000000 +0100 ++++ firefox-134.0.1/toolkit/moz.configure 2025-01-17 08:39:38.870092763 +0100 +@@ -2767,7 +2776,7 @@ with only_when(requires_wasm_sandboxing def wasi_sysroot_flags(wasi_sysroot): if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) @@ -10,9 +10,21 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. return [] set_config("WASI_SYSROOT", wasi_sysroot) +diff -up firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake.wasi firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake +--- firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake.wasi 2025-01-17 08:40:23.004159900 +0100 ++++ firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake 2025-01-17 08:40:35.478178790 +0100 +@@ -126,7 +126,7 @@ endif() + add_custom_command( + OUTPUT ${wasm_component_ld} + COMMAND +- cargo install --root ${wasm_component_ld_root} ${rust_target_flag} ++ cargo install --offline --root ${wasm_component_ld_root} ${rust_target_flag} + wasm-component-ld@${wasm_component_ld_version} + COMMAND + cmake -E make_directory ${wasi_tmp_install}/bin diff -up firefox-134.0.1/wasi-sdk-25/version.py.wasi firefox-134.0.1/wasi-sdk-25/version.py ---- firefox-134.0.1/wasi-sdk-25/version.py.wasi 2025-01-16 11:53:48.013045085 +0100 -+++ firefox-134.0.1/wasi-sdk-25/version.py 2025-01-16 11:54:05.470072564 +0100 +--- firefox-134.0.1/wasi-sdk-25/version.py.wasi 2025-01-16 08:03:26.042654800 +0100 ++++ firefox-134.0.1/wasi-sdk-25/version.py 2025-01-17 08:39:38.856092741 +0100 @@ -60,6 +60,7 @@ assert parse_git_version( From 06cb25cdc39ecca4c41f10fdcafd363f048e0665 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Fri, 17 Jan 2025 11:32:03 +0100 Subject: [PATCH 431/545] Fix wasi build --- firefox.spec | 2 +- wasi.patch | 24 ++++++++++++++++++------ wasi.patch.template | 2 +- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/firefox.spec b/firefox.spec index d3ad948..c5fd386 100644 --- a/firefox.spec +++ b/firefox.spec @@ -567,7 +567,7 @@ This package contains results of tests executed during build. # We need to create the wasi.patch with the correct path to the wasm libclang_rt. %if %{with wasi_sdk} -export LIBCLANG_RT=`pwd`/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a; cat %{SOURCE49} | envsubst > %{_sourcedir}/wasi.patch +cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a|" > %{_sourcedir}/wasi.patch %patch -P80 -p1 -b .wasi %endif diff --git a/wasi.patch b/wasi.patch index 2717bf9..0e20526 100644 --- a/wasi.patch +++ b/wasi.patch @@ -1,7 +1,7 @@ -diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz.configure ---- firefox-121.0.1/toolkit/moz.configure.wasi 2024-02-01 09:14:33.816548952 +0100 -+++ firefox-121.0.1/toolkit/moz.configure 2024-02-01 09:15:53.264684309 +0100 -@@ -2663,7 +2663,7 @@ with only_when(requires_wasm_sandboxing +diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz.configure +--- firefox-134.0.1/toolkit/moz.configure.wasi 2025-01-13 14:46:04.000000000 +0100 ++++ firefox-134.0.1/toolkit/moz.configure 2025-01-17 08:39:38.870092763 +0100 +@@ -2767,7 +2776,7 @@ with only_when(requires_wasm_sandboxing def wasi_sysroot_flags(wasi_sysroot): if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) @@ -10,9 +10,21 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. return [] set_config("WASI_SYSROOT", wasi_sysroot) +diff -up firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake.wasi firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake +--- firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake.wasi 2025-01-17 08:40:23.004159900 +0100 ++++ firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake 2025-01-17 08:40:35.478178790 +0100 +@@ -126,7 +126,7 @@ endif() + add_custom_command( + OUTPUT ${wasm_component_ld} + COMMAND +- cargo install --root ${wasm_component_ld_root} ${rust_target_flag} ++ cargo install --offline --root ${wasm_component_ld_root} ${rust_target_flag} + wasm-component-ld@${wasm_component_ld_version} + COMMAND + cmake -E make_directory ${wasi_tmp_install}/bin diff -up firefox-134.0.1/wasi-sdk-25/version.py.wasi firefox-134.0.1/wasi-sdk-25/version.py ---- firefox-134.0.1/wasi-sdk-25/version.py.wasi 2025-01-16 11:53:48.013045085 +0100 -+++ firefox-134.0.1/wasi-sdk-25/version.py 2025-01-16 11:54:05.470072564 +0100 +--- firefox-134.0.1/wasi-sdk-25/version.py.wasi 2025-01-16 08:03:26.042654800 +0100 ++++ firefox-134.0.1/wasi-sdk-25/version.py 2025-01-17 08:39:38.856092741 +0100 @@ -60,6 +60,7 @@ assert parse_git_version( diff --git a/wasi.patch.template b/wasi.patch.template index 6771a31..33dd908 100644 --- a/wasi.patch.template +++ b/wasi.patch.template @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "$LIBCLANG_RT"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "LIBCLANG_RT_PLACEHOLDER"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From dbd57477ae4e58fce4a481383e6d8b1a6b57b56d Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Fri, 17 Jan 2025 12:54:42 +0100 Subject: [PATCH 432/545] vendor wasm-component-ld --- .gitignore | 1 + firefox.spec | 22 ++++++++++++++++++---- sources | 1 + 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 31f33c6..880892d 100644 --- a/.gitignore +++ b/.gitignore @@ -679,3 +679,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-134.0.1-20250115.tar.xz /firefox-134.0.1.source.tar.xz /wasi-sdk-25.tar.gz +/wasm-component-ld-vendor.tar.xz diff --git a/firefox.spec b/firefox.spec index c5fd386..74c7d0c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -207,6 +207,7 @@ Source1: firefox-langpacks-%{version}%{?pre_version}-20250115.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz +Source4: wasm-component-ld-vendor.tar.xz Source10: firefox-mozconfig Source12: firefox-redhat-default-prefs.js Source20: firefox.desktop @@ -734,15 +735,28 @@ chmod a-x third_party/rust/ash/src/extensions/nv/*.rs %if %{with wasi_sdk} pushd wasi-sdk-25 -NINJA_FLAGS=-v CC=clang CXX=clang++ env -u CFLAGS -u CXXFLAGS -u FFLAGS -u VALFLAGS -u RUSTFLAGS -u LDFLAGS -u LT_SYS_LIBRARY_PATH cmake -G Ninja -B build/toolchain -S . -DWASI_SDK_BUILD_TOOLCHAIN=ON -DCMAKE_INSTALL_PREFIX=build/install -NINJA_FLAGS=-v CC=clang CXX=clang++ env -u CFLAGS -u CXXFLAGS -u FFLAGS -u VALFLAGS -u RUSTFLAGS -u LDFLAGS -u LT_SYS_LIBRARY_PATH cmake --build build/toolchain --target install +mkdir -p my_rust_vendor +cd my_rust_vendor +tar xf %{SOURCE4} +mkdir -p .cargo +cat > .cargo/config < Date: Wed, 22 Jan 2025 09:11:47 +0100 Subject: [PATCH 433/545] Updated to 134.0.2 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- wasi.patch | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 3c95691..70ec3bd 100644 --- a/.gitignore +++ b/.gitignore @@ -678,3 +678,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-134.0.source.tar.xz /firefox-langpacks-134.0.1-20250115.tar.xz /firefox-134.0.1.source.tar.xz +/firefox-134.0.2.source.tar.xz +/firefox-langpacks-134.0.2-20250122.tar.xz diff --git a/firefox.spec b/firefox.spec index aaaa894..61358bb 100644 --- a/firefox.spec +++ b/firefox.spec @@ -196,14 +196,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 134.0.1 +Version: 134.0.2 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250115.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250122.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1216,6 +1216,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Jan 22 2025 Martin Stransky - 134.0.2-1 +- Updated to 134.0.2 + * Tue Jan 15 2025 Martin Stransky - 134.0.1-1 - Updated to 134.0.1 diff --git a/sources b/sources index 1464ac0..81db396 100644 --- a/sources +++ b/sources @@ -2,5 +2,5 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (wasi-sdk-20.tar.gz) = 95be9d9b41ed1f7884e9cd68bad22abbb355b049fd09731c89b9e36666d0205b1a16ec9c21820adf0c5a34e2048015cbfbef0542170d466fa3336c636873c405 SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a -SHA512 (firefox-langpacks-134.0.1-20250115.tar.xz) = 3b1a40d9231ed03562f1af116482d6fac7f488b716e1793733b73c33cd2557c1b15f2564b48fe2f27f5bf840e14f0c9c5f92b828963b595321a1d17e81fad8e1 -SHA512 (firefox-134.0.1.source.tar.xz) = 3f40ca5a753a66e08af4e8b12d75feab67b0567ecffd34f5cf013f49aeb809ccd458c8011e9456dc902c24eaf626078117874514eb40cee5574eafce93ee772d +SHA512 (firefox-134.0.2.source.tar.xz) = 74d631ecbdb5607cfcc4de408947b3b129e36b3d1daa501827aebc81f48c878f9bade875875c466c07c651f26b5388ff2d2d2087e66e0613d8914abaa7ddf5ae +SHA512 (firefox-langpacks-134.0.2-20250122.tar.xz) = 89dee6af98c98a1643fb83ce2febf959d0618853873f826da78869857158e82adafbdd7f594eebdc419faf353eed928788a7a6294b1b1ecf153e97a94daca72f diff --git a/wasi.patch b/wasi.patch index a8dbf03..6ad2ba9 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-121.0.1/toolkit/moz.configure.wasi firefox-121.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-134.0-build/firefox-134.0/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-134.0.2-build/firefox-134.0.2/wasi-sdk-20/build/compiler-rt/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 986578da5109861399a737dec54bab8d54f5d215 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Wed, 22 Jan 2025 15:06:29 +0100 Subject: [PATCH 434/545] Fixing wasi build on f40 --- wasi.patch | 30 +++++++++++++++++++++++++++--- wasi.patch.template | 18 +++++++++++++++--- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/wasi.patch b/wasi.patch index 5584843..6d02e23 100644 --- a/wasi.patch +++ b/wasi.patch @@ -1,3 +1,15 @@ +diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz.configure +--- firefox-134.0.1/toolkit/moz.configure.wasi 2025-01-13 14:46:04.000000000 +0100 ++++ firefox-134.0.1/toolkit/moz.configure 2025-01-17 08:39:38.870092763 +0100 +@@ -2767,7 +2776,7 @@ with only_when(requires_wasm_sandboxing + def wasi_sysroot_flags(wasi_sysroot): + if wasi_sysroot: + log.info("Using wasi sysroot in %s", wasi_sysroot) +- return ["--sysroot=%s" % wasi_sysroot] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/home/jhorak/f/firefox/firefox-134.0.2-build/firefox-134.0.2/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] + return [] + + set_config("WASI_SYSROOT", wasi_sysroot) diff -up firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake.wasi firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake --- firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake.wasi 2025-01-17 08:40:23.004159900 +0100 +++ firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake 2025-01-17 08:40:35.478178790 +0100 @@ -10,9 +22,21 @@ diff -up firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake.wasi firefox wasm-component-ld@${wasm_component_ld_version} COMMAND cmake -E make_directory ${wasi_tmp_install}/bin -diff -up firefox-134.0.1/wasi-sdk-25/version.py.wasi firefox-134.0.1/wasi-sdk-25/version.py ---- firefox-134.0.1/wasi-sdk-25/version.py.wasi 2025-01-16 08:03:26.042654800 +0100 -+++ firefox-134.0.1/wasi-sdk-25/version.py 2025-01-17 08:39:38.856092741 +0100 +diff -up firefox-134.0.2/wasi-sdk-25/src/wasi-libc/Makefile.wasi firefox-134.0.2/wasi-sdk-25/src/wasi-libc/Makefile +--- firefox-134.0.2/wasi-sdk-25/src/wasi-libc/Makefile.wasi 2025-01-22 14:58:26.354291234 +0100 ++++ firefox-134.0.2/wasi-sdk-25/src/wasi-libc/Makefile 2025-01-22 14:59:24.565358494 +0100 +@@ -412,7 +412,7 @@ ASMFLAGS += --target=$(TARGET_TRIPLE) + # TODO: Add -fno-signaling-nans when the compiler supports it. + CFLAGS += -fno-trapping-math + # Add all warnings, but disable a few which occur in third-party code. +-CFLAGS += -Wall -Wextra -Werror \ ++CFLAGS += -mno-reference-types -Wall -Wextra -Werror \ + -Wno-null-pointer-arithmetic \ + -Wno-unused-parameter \ + -Wno-sign-compare \ +diff -up firefox-134.0.2/wasi-sdk-25/version.py.wasi firefox-134.0.2/wasi-sdk-25/version.py +--- firefox-134.0.2/wasi-sdk-25/version.py.wasi 2025-01-16 08:03:26.042654800 +0100 ++++ firefox-134.0.2/wasi-sdk-25/version.py 2025-01-22 14:08:34.563909971 +0100 @@ -60,6 +60,7 @@ assert parse_git_version( diff --git a/wasi.patch.template b/wasi.patch.template index 33dd908..26b5f23 100644 --- a/wasi.patch.template +++ b/wasi.patch.template @@ -22,9 +22,21 @@ diff -up firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake.wasi firefox wasm-component-ld@${wasm_component_ld_version} COMMAND cmake -E make_directory ${wasi_tmp_install}/bin -diff -up firefox-134.0.1/wasi-sdk-25/version.py.wasi firefox-134.0.1/wasi-sdk-25/version.py ---- firefox-134.0.1/wasi-sdk-25/version.py.wasi 2025-01-16 08:03:26.042654800 +0100 -+++ firefox-134.0.1/wasi-sdk-25/version.py 2025-01-17 08:39:38.856092741 +0100 +diff -up firefox-134.0.2/wasi-sdk-25/src/wasi-libc/Makefile.wasi firefox-134.0.2/wasi-sdk-25/src/wasi-libc/Makefile +--- firefox-134.0.2/wasi-sdk-25/src/wasi-libc/Makefile.wasi 2025-01-22 14:58:26.354291234 +0100 ++++ firefox-134.0.2/wasi-sdk-25/src/wasi-libc/Makefile 2025-01-22 14:59:24.565358494 +0100 +@@ -412,7 +412,7 @@ ASMFLAGS += --target=$(TARGET_TRIPLE) + # TODO: Add -fno-signaling-nans when the compiler supports it. + CFLAGS += -fno-trapping-math + # Add all warnings, but disable a few which occur in third-party code. +-CFLAGS += -Wall -Wextra -Werror \ ++CFLAGS += -mno-reference-types -Wall -Wextra -Werror \ + -Wno-null-pointer-arithmetic \ + -Wno-unused-parameter \ + -Wno-sign-compare \ +diff -up firefox-134.0.2/wasi-sdk-25/version.py.wasi firefox-134.0.2/wasi-sdk-25/version.py +--- firefox-134.0.2/wasi-sdk-25/version.py.wasi 2025-01-16 08:03:26.042654800 +0100 ++++ firefox-134.0.2/wasi-sdk-25/version.py 2025-01-22 14:08:34.563909971 +0100 @@ -60,6 +60,7 @@ assert parse_git_version( From 4d033ce29a03415d0d37ab41da1f9b53bce92b20 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 28 Jan 2025 08:05:46 +0100 Subject: [PATCH 435/545] Call restorecon for widevine only (rhbz#2342243) --- firefox.sh.in | 2 +- firefox.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/firefox.sh.in b/firefox.sh.in index e6edd02..dfcefff 100644 --- a/firefox.sh.in +++ b/firefox.sh.in @@ -184,7 +184,7 @@ fi # (rhbz#1731371) if [ $MOZILLA_DOWN -ne 0 ]; then if [ -x $GETENFORCE_FILE ] && [ `$GETENFORCE_FILE` != "Disabled" ]; then - (restorecon -vr ~/.mozilla/firefox/* &) + (restorecon -vr ~/.mozilla/firefox/*/gmp-widevinecdm/* &) fi fi diff --git a/firefox.spec b/firefox.spec index 3afe004..3817f32 100644 --- a/firefox.spec +++ b/firefox.spec @@ -197,7 +197,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 134.0.2 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -1240,6 +1240,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Jan 28 2025 Martin Stransky - 134.0.2-2 +- Call restorecon for widevine only (rhbz#2342243) + * Wed Jan 22 2025 Martin Stransky - 134.0.2-1 - Updated to 134.0.2 From 5e17e3db83b2853846bcdbd3269e980d6f90a76b Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Wed, 29 Jan 2025 08:13:34 +0100 Subject: [PATCH 436/545] Fixing wasi build --- firefox.spec | 8 ++------ wasi.patch.template | 12 ------------ 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/firefox.spec b/firefox.spec index 3817f32..997ecf2 100644 --- a/firefox.spec +++ b/firefox.spec @@ -42,16 +42,12 @@ ExcludeArch: i686 %global enable_replace_malloc 0 %endif -# wasi_sdk is for sandboxing third party c/c++ libs by using rlbox, exclude s390x on the f39. -%if 0%{?fedora} < 40 -%ifarch s390x +# wasi_sdk 25 is not compatible with llvm 18 +%if 0%{?fedora} <= 40 %bcond wasi_sdk 0 %else %bcond wasi_sdk 1 %endif -%else -%bcond wasi_sdk 1 -%endif %if "%{toolchain}" == "clang" %global build_with_clang 1 diff --git a/wasi.patch.template b/wasi.patch.template index 26b5f23..fe4aee9 100644 --- a/wasi.patch.template +++ b/wasi.patch.template @@ -22,18 +22,6 @@ diff -up firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake.wasi firefox wasm-component-ld@${wasm_component_ld_version} COMMAND cmake -E make_directory ${wasi_tmp_install}/bin -diff -up firefox-134.0.2/wasi-sdk-25/src/wasi-libc/Makefile.wasi firefox-134.0.2/wasi-sdk-25/src/wasi-libc/Makefile ---- firefox-134.0.2/wasi-sdk-25/src/wasi-libc/Makefile.wasi 2025-01-22 14:58:26.354291234 +0100 -+++ firefox-134.0.2/wasi-sdk-25/src/wasi-libc/Makefile 2025-01-22 14:59:24.565358494 +0100 -@@ -412,7 +412,7 @@ ASMFLAGS += --target=$(TARGET_TRIPLE) - # TODO: Add -fno-signaling-nans when the compiler supports it. - CFLAGS += -fno-trapping-math - # Add all warnings, but disable a few which occur in third-party code. --CFLAGS += -Wall -Wextra -Werror \ -+CFLAGS += -mno-reference-types -Wall -Wextra -Werror \ - -Wno-null-pointer-arithmetic \ - -Wno-unused-parameter \ - -Wno-sign-compare \ diff -up firefox-134.0.2/wasi-sdk-25/version.py.wasi firefox-134.0.2/wasi-sdk-25/version.py --- firefox-134.0.2/wasi-sdk-25/version.py.wasi 2025-01-16 08:03:26.042654800 +0100 +++ firefox-134.0.2/wasi-sdk-25/version.py 2025-01-22 14:08:34.563909971 +0100 From 374d0dbadea131e1146151171acd392c86704d65 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 4 Feb 2025 13:13:48 +0100 Subject: [PATCH 437/545] Updated to 135.0 --- .gitignore | 2 + firefox.spec | 13 +-- mzbz-1934217.patch | 192 --------------------------------------------- sources | 4 +- wasi.patch | 2 +- 5 files changed, 12 insertions(+), 201 deletions(-) delete mode 100644 mzbz-1934217.patch diff --git a/.gitignore b/.gitignore index 45845ee..9d07673 100644 --- a/.gitignore +++ b/.gitignore @@ -682,3 +682,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-134.0.2-20250122.tar.xz /wasi-sdk-25.tar.gz /wasm-component-ld-vendor.tar.xz +/firefox-135.0.source.tar.xz +/firefox-langpacks-135.0-20250204.tar.xz diff --git a/firefox.spec b/firefox.spec index 3817f32..641a0b5 100644 --- a/firefox.spec +++ b/firefox.spec @@ -196,14 +196,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 134.0.2 -Release: 2%{?pre_tag}%{?dist} +Version: 135.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250122.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250204.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -283,7 +283,6 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch -Patch408: mzbz-1934217.patch # PGO/LTO patches Patch600: pgo.patch @@ -586,7 +585,6 @@ cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysr %patch -P402 -p1 -b .1196777 %patch -P407 -p1 -b .1667096 -%patch -P408 -p1 -b .1934217 # PGO patches %if %{build_with_pgo} @@ -1240,13 +1238,16 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Feb 04 2025 Martin Stransky - 135.0-1 +- Updated to 135.0 + * Tue Jan 28 2025 Martin Stransky - 134.0.2-2 - Call restorecon for widevine only (rhbz#2342243) * Wed Jan 22 2025 Martin Stransky - 134.0.2-1 - Updated to 134.0.2 -* Tue Jan 15 2025 Martin Stransky - 134.0.1-1 +* Wed Jan 15 2025 Martin Stransky - 134.0.1-1 - Updated to 134.0.1 * Thu Jan 02 2025 Martin Stransky - 134.0-1 diff --git a/mzbz-1934217.patch b/mzbz-1934217.patch deleted file mode 100644 index 4d4b718..0000000 --- a/mzbz-1934217.patch +++ /dev/null @@ -1,192 +0,0 @@ -changeset: 770274:d6372d8b0c6f -bookmark: phab-D230658 -tag: tip -parent: 770246:b8a69414f282 -user: Martin Stransky -date: Fri Nov 29 12:17:12 2024 +0000 -files: third_party/wayland-proxy/wayland-proxy.cpp -description: -Bug 1934217 [Wayland] Run disconnected wayland client for some time to allow process wayland protocol error messages r?emilio - -Differential Revision: https://phabricator.services.mozilla.com/D230658 - - -diff --git a/third_party/wayland-proxy/wayland-proxy.cpp b/third_party/wayland-proxy/wayland-proxy.cpp ---- a/third_party/wayland-proxy/wayland-proxy.cpp -+++ b/third_party/wayland-proxy/wayland-proxy.cpp -@@ -26,7 +26,8 @@ - #include - #include - #include --#include -+#include -+#include - - #include "wayland-proxy.h" - -@@ -110,7 +111,7 @@ class ProxiedConnection { - // Process this connection (send/receive data). - // Returns false if connection is broken and should be removed. - bool Process(); -- void ProcessFailure(); -+ bool ProcessFailure(); - - void PrintConnectionInfo(); - -@@ -160,6 +161,13 @@ class ProxiedConnection { - int mStatRecvFromClient = 0; - int mStatSentToClient = 0; - int mStatSentToClientLater = 0; -+ -+ -+ // Wait 0.5 sec before we disconnect client -+ // from compositor. It gives client time to -+ // process potential error messages from compositor. -+ constexpr static const double sFailureTimeout = CLOCKS_PER_SEC / 2; -+ clock_t mFailureTime = 0; - }; - - WaylandMessage::~WaylandMessage() { -@@ -502,12 +510,30 @@ void ProxiedConnection::PrintConnectionI - } - - bool ProxiedConnection::Process() { -+ // If the connection already fails at ProxiedConnection::Process() somewhere, -+ // well finish processing all pending messages and flush queues to sockets. -+ // Then the connection becomes inactive (so we return early here) and we'll -+ // keep application socket opened for some time and then close -+ // the connection (disconnect application). -+ // -+ // It's because if we close application socket the app is instantly -+ // terminated by gtk event loop and there may be unprocessed messages -+ // pending in wayland client queues. -+ // -+ // That ensures we see actual wayland protocol error instead of -+ // 'application is terminated' error. -+ if (mApplicationFailed || mCompositorFailed) { -+ return false; -+ } -+ -+ // If we hit any error (instead of compositor waiting to connect), -+ // we keep the code running and flush pending messages where it's possible. -+ - // Check if appplication is still listening - if (mApplicationFlags & (POLLHUP | POLLERR)) { - Print("ProxiedConnection::Process(): Client socket is not listening\n"); - WaylandProxy::AddState(WAYLAND_PROXY_APP_CONNECTION_FAILED); - mApplicationFailed = true; -- return false; - } - - // Check if compositor is still listening -@@ -516,7 +542,6 @@ bool ProxiedConnection::Process() { - Print("ProxiedConnection::Process(): Compositor socket is not listening\n"); - WaylandProxy::AddState(WAYLAND_PROXY_COMPOSITOR_CONNECTION_FAILED); - mCompositorFailed = true; -- return false; - } - } else { - // Try to reconnect to compositor. -@@ -524,11 +549,9 @@ bool ProxiedConnection::Process() { - Error("ProxiedConnection::Process(): Failed to connect to compositor\n"); - WaylandProxy::AddState(WAYLAND_PROXY_COMPOSITOR_CONNECTION_FAILED); - mCompositorFailed = true; -- return false; -- } -- // We're not connected yet but ConnectToCompositor() didn't return -- // fatal error. Try again later. -- if (!mCompositorConnected) { -+ } else if (!mCompositorConnected) { -+ // We're not connected yet but ConnectToCompositor() didn't return -+ // fatal error. Try again later. - return true; - } - } -@@ -539,7 +562,6 @@ bool ProxiedConnection::Process() { - Error("ProxiedConnection::Process(): Failed to read data from compositor!"); - WaylandProxy::AddState(WAYLAND_PROXY_COMPOSITOR_CONNECTION_FAILED); - mCompositorFailed = true; -- return false; - } - if (!TransferOrQueue(mApplicationSocket, mApplicationFlags, mCompositorSocket, - &mToCompositorQueue, mStatRecvFromClient, -@@ -547,32 +569,41 @@ bool ProxiedConnection::Process() { - Error("ProxiedConnection::Process(): Failed to read data from client!"); - WaylandProxy::AddState(WAYLAND_PROXY_APP_CONNECTION_FAILED); - mApplicationFailed = true; -- return false; - } - if (!FlushQueue(mCompositorSocket, mCompositorFlags, mToCompositorQueue, - mStatSentToCompositorLater)) { - Error("ProxiedConnection::Process(): Failed to flush queue to compositor!"); - WaylandProxy::AddState(WAYLAND_PROXY_COMPOSITOR_CONNECTION_FAILED); - mCompositorFailed = true; -- return false; - } - if (!FlushQueue(mApplicationSocket, mApplicationFlags, mToApplicationQueue, - mStatSentToClientLater)) { - Error("ProxiedConnection::Process(): Failed to flush queue to client!"); - WaylandProxy::AddState(WAYLAND_PROXY_APP_CONNECTION_FAILED); - mApplicationFailed = true; -- return false; - } - - if (sPrintInfo) { - PrintConnectionInfo(); - } - -- return true; -+ if (mCompositorFailed) { -+ mFailureTime = clock(); -+ } -+ return !mApplicationFailed && !mCompositorFailed; - } - --void ProxiedConnection::ProcessFailure() { -+bool ProxiedConnection::ProcessFailure() { -+ if (!mCompositorFailed && !mApplicationFailed) { -+ return false; -+ } -+ - if (mCompositorFailed) { -+ double time = (double)(clock() - mFailureTime); -+ if (time < sFailureTimeout) { -+ return false; -+ } -+ - struct stat buffer; - if (stat(mWaylandDisplay, &buffer) < 0) { - Print("ProxiedConnection(): compositor crashed!\n"); -@@ -583,9 +614,10 @@ void ProxiedConnection::ProcessFailure() - } else if (mApplicationFailed) { - Print("ProxiedConnection(): application fails to read/write events!\n"); - } -+ -+ return true; - } - -- - bool WaylandProxy::CheckWaylandDisplay(const char* aWaylandDisplay) { - struct sockaddr_un addr = {}; - addr.sun_family = AF_UNIX; -@@ -839,12 +871,13 @@ bool WaylandProxy::ProcessConnections() - for (connection = mConnections.begin(); connection != mConnections.end();) { - if (!(*connection)->Process()) { - WaylandProxy::AddState(WAYLAND_PROXY_CONNECTION_REMOVED); -- (*connection)->ProcessFailure(); -- connection = mConnections.erase(connection); -- if (mConnections.empty()) { -- // We removed last connection - quit. -- Info("removed last connection, quit\n"); -- return false; -+ if ((*connection)->ProcessFailure()) { -+ connection = mConnections.erase(connection); -+ if (mConnections.empty()) { -+ // We removed last connection - quit. -+ Info("removed last connection, quit\n"); -+ return false; -+ } - } - } else { - connection++; - diff --git a/sources b/sources index e0a39ea..7139204 100644 --- a/sources +++ b/sources @@ -1,7 +1,7 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a -SHA512 (firefox-134.0.2.source.tar.xz) = 74d631ecbdb5607cfcc4de408947b3b129e36b3d1daa501827aebc81f48c878f9bade875875c466c07c651f26b5388ff2d2d2087e66e0613d8914abaa7ddf5ae -SHA512 (firefox-langpacks-134.0.2-20250122.tar.xz) = 89dee6af98c98a1643fb83ce2febf959d0618853873f826da78869857158e82adafbdd7f594eebdc419faf353eed928788a7a6294b1b1ecf153e97a94daca72f SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 +SHA512 (firefox-135.0.source.tar.xz) = 7d283bcefe1e328901f15a88f5ff3da566bb0495ce5b9e3895e7a156020126a5743b6bffd69d94d9eb812e1868195ae92db162d29a5d98ee118fdb238469c089 +SHA512 (firefox-langpacks-135.0-20250204.tar.xz) = ca53e36bc83800afe8ecc54eadf6c06d7f82005d5fc2e1cef688b48425dd84933c90af9a2346700e0e67629d874d4ce098ecfb9e84cb2942dc9d0238415fcffa diff --git a/wasi.patch b/wasi.patch index 6d02e23..bce9679 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/home/jhorak/f/firefox/firefox-134.0.2-build/firefox-134.0.2/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-135.0-build/firefox-135.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 7c1006e94a8754e19de2fa086b86b0259e790dbf Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 19 Feb 2025 10:19:46 +0100 Subject: [PATCH 438/545] Updated to 135.0.1 --- firefox.spec | 7 +++++-- sources | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/firefox.spec b/firefox.spec index 6e9b84e..ceaf38f 100644 --- a/firefox.spec +++ b/firefox.spec @@ -192,14 +192,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 135.0 +Version: 135.0.1 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250204.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250219.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1234,6 +1234,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Feb 19 2025 Martin Stransky - 135.0.1-1 +- Updated to 135.0.1 + * Tue Feb 04 2025 Martin Stransky - 135.0-1 - Updated to 135.0 diff --git a/sources b/sources index 7139204..d5d0517 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125 SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 -SHA512 (firefox-135.0.source.tar.xz) = 7d283bcefe1e328901f15a88f5ff3da566bb0495ce5b9e3895e7a156020126a5743b6bffd69d94d9eb812e1868195ae92db162d29a5d98ee118fdb238469c089 -SHA512 (firefox-langpacks-135.0-20250204.tar.xz) = ca53e36bc83800afe8ecc54eadf6c06d7f82005d5fc2e1cef688b48425dd84933c90af9a2346700e0e67629d874d4ce098ecfb9e84cb2942dc9d0238415fcffa +SHA512 (firefox-langpacks-135.0.1-20250219.tar.xz) = b5808a54f3fb7ae2716ce4464a672ac9c200a7ba39114f3dd16d03c2983138b8a9db0df67d4e3b073183a9e2b4d9509b3dcac8502c64b66b36fc3d054d9661ea +SHA512 (firefox-135.0.1.source.tar.xz) = 9ff7c2ab6bc1660e339cdcd7745f8bdac5be25d3a79b9f0393385935270d7ef488599856bc38c22ae0b067389fa71a6999703b74804a6e0ea8265eb99788cea9 From 45702faa295349d11e7931f906913726db55d893 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 25 Feb 2025 13:06:07 +0100 Subject: [PATCH 439/545] Updated to 136.0 --- .gitignore | 2 ++ firefox-enable-vaapi.patch | 18 ------------------ firefox.spec | 9 +++++---- sources | 4 ++-- wasi.patch | 14 +------------- 5 files changed, 10 insertions(+), 37 deletions(-) delete mode 100644 firefox-enable-vaapi.patch diff --git a/.gitignore b/.gitignore index 9d07673..15a9d9c 100644 --- a/.gitignore +++ b/.gitignore @@ -684,3 +684,5 @@ firefox-3.6.4.source.tar.bz2 /wasm-component-ld-vendor.tar.xz /firefox-135.0.source.tar.xz /firefox-langpacks-135.0-20250204.tar.xz +/firefox-136.0.source.tar.xz +/firefox-langpacks-136.0-20250225.tar.xz diff --git a/firefox-enable-vaapi.patch b/firefox-enable-vaapi.patch deleted file mode 100644 index 5f25bc1..0000000 --- a/firefox-enable-vaapi.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -up firefox-117.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi firefox-117.0/widget/gtk/GfxInfo.cpp ---- firefox-117.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi 2023-08-28 11:20:54.324211945 +0200 -+++ firefox-117.0/widget/gtk/GfxInfo.cpp 2023-08-28 11:24:01.700666843 +0200 -@@ -1095,14 +1095,6 @@ const nsTArray& GfxInfo:: - nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_LESS_THAN, V(23, 1, 1, 0), - "FEATURE_HARDWARE_VIDEO_DECODING_AMD_DISABLE", "Mesa 23.1.1.0"); - -- // Disable on Release/late Beta on AMD --#if !defined(EARLY_BETA_OR_EARLIER) -- APPEND_TO_DRIVER_BLOCKLIST(OperatingSystem::Linux, DeviceFamily::AtiAll, -- nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING, -- nsIGfxInfo::FEATURE_BLOCKED_DEVICE, -- DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0), -- "FEATURE_HARDWARE_VIDEO_DECODING_DISABLE", ""); --#endif - //////////////////////////////////// - // FEATURE_HW_DECODED_VIDEO_ZERO_COPY - ALLOWLIST - APPEND_TO_DRIVER_BLOCKLIST2(OperatingSystem::Linux, DeviceFamily::All, diff --git a/firefox.spec b/firefox.spec index ceaf38f..6237b6a 100644 --- a/firefox.spec +++ b/firefox.spec @@ -192,14 +192,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 135.0.1 +Version: 136.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250219.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250225.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -271,7 +271,6 @@ Patch219: rhbz-1173156.patch Patch226: rhbz-1354671.patch Patch228: disable-openh264-download.patch Patch229: firefox-nss-addon-hack.patch -Patch230: firefox-enable-vaapi.patch Patch231: fedora-customization.patch Patch241: 0025-Add-KDE-integration-to-Firefox-toolkit-parts.patch Patch242: 0026-Add-KDE-integration-to-Firefox.patch @@ -576,7 +575,6 @@ cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysr %endif %patch -P228 -p1 -b .disable-openh264-download %patch -P229 -p1 -b .firefox-nss-addon-hack -%patch -P230 -p1 -b .firefox-enable-vaapi %patch -P231 -p1 -b .fedora-customization %patch -P402 -p1 -b .1196777 @@ -1234,6 +1232,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Feb 25 2025 Martin Stransky - 136.0-1 +- Updated to 136.0 + * Wed Feb 19 2025 Martin Stransky - 135.0.1-1 - Updated to 135.0.1 diff --git a/sources b/sources index d5d0517..b114d53 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125 SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 -SHA512 (firefox-langpacks-135.0.1-20250219.tar.xz) = b5808a54f3fb7ae2716ce4464a672ac9c200a7ba39114f3dd16d03c2983138b8a9db0df67d4e3b073183a9e2b4d9509b3dcac8502c64b66b36fc3d054d9661ea -SHA512 (firefox-135.0.1.source.tar.xz) = 9ff7c2ab6bc1660e339cdcd7745f8bdac5be25d3a79b9f0393385935270d7ef488599856bc38c22ae0b067389fa71a6999703b74804a6e0ea8265eb99788cea9 +SHA512 (firefox-136.0.source.tar.xz) = c2524d5eddadd6c6b7fe576ac8ff414d8304316ffb6777830e8bed6d14b46725d3990e9b9193d36590b4ad4c13dddd170f4e7404373afbe04b1132d5fbf70ca1 +SHA512 (firefox-langpacks-136.0-20250225.tar.xz) = 9f269d2499e2adb804aa4f3696507e4afb391363f0782d728c8342f6b77098c5ca4474777632b9bcaeb3680cb6806d7ac3d1f26fb7ae2ab806cd10e7c4a05eb5 diff --git a/wasi.patch b/wasi.patch index bce9679..3534061 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-135.0-build/firefox-135.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-136.0-build/firefox-136.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) @@ -22,18 +22,6 @@ diff -up firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake.wasi firefox wasm-component-ld@${wasm_component_ld_version} COMMAND cmake -E make_directory ${wasi_tmp_install}/bin -diff -up firefox-134.0.2/wasi-sdk-25/src/wasi-libc/Makefile.wasi firefox-134.0.2/wasi-sdk-25/src/wasi-libc/Makefile ---- firefox-134.0.2/wasi-sdk-25/src/wasi-libc/Makefile.wasi 2025-01-22 14:58:26.354291234 +0100 -+++ firefox-134.0.2/wasi-sdk-25/src/wasi-libc/Makefile 2025-01-22 14:59:24.565358494 +0100 -@@ -412,7 +412,7 @@ ASMFLAGS += --target=$(TARGET_TRIPLE) - # TODO: Add -fno-signaling-nans when the compiler supports it. - CFLAGS += -fno-trapping-math - # Add all warnings, but disable a few which occur in third-party code. --CFLAGS += -Wall -Wextra -Werror \ -+CFLAGS += -mno-reference-types -Wall -Wextra -Werror \ - -Wno-null-pointer-arithmetic \ - -Wno-unused-parameter \ - -Wno-sign-compare \ diff -up firefox-134.0.2/wasi-sdk-25/version.py.wasi firefox-134.0.2/wasi-sdk-25/version.py --- firefox-134.0.2/wasi-sdk-25/version.py.wasi 2025-01-16 08:03:26.042654800 +0100 +++ firefox-134.0.2/wasi-sdk-25/version.py 2025-01-22 14:08:34.563909971 +0100 From dafa26f99e3cdce29bfabb44f3943ed970cf51ec Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 25 Feb 2025 13:07:21 +0100 Subject: [PATCH 440/545] Updated to 136.0 --- .gitignore | 2 ++ firefox-enable-vaapi.patch | 18 ------------------ firefox.spec | 9 +++++---- sources | 4 ++-- wasi.patch | 14 +------------- 5 files changed, 10 insertions(+), 37 deletions(-) delete mode 100644 firefox-enable-vaapi.patch diff --git a/.gitignore b/.gitignore index 9d07673..15a9d9c 100644 --- a/.gitignore +++ b/.gitignore @@ -684,3 +684,5 @@ firefox-3.6.4.source.tar.bz2 /wasm-component-ld-vendor.tar.xz /firefox-135.0.source.tar.xz /firefox-langpacks-135.0-20250204.tar.xz +/firefox-136.0.source.tar.xz +/firefox-langpacks-136.0-20250225.tar.xz diff --git a/firefox-enable-vaapi.patch b/firefox-enable-vaapi.patch deleted file mode 100644 index 5f25bc1..0000000 --- a/firefox-enable-vaapi.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -up firefox-117.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi firefox-117.0/widget/gtk/GfxInfo.cpp ---- firefox-117.0/widget/gtk/GfxInfo.cpp.firefox-enable-vaapi 2023-08-28 11:20:54.324211945 +0200 -+++ firefox-117.0/widget/gtk/GfxInfo.cpp 2023-08-28 11:24:01.700666843 +0200 -@@ -1095,14 +1095,6 @@ const nsTArray& GfxInfo:: - nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_LESS_THAN, V(23, 1, 1, 0), - "FEATURE_HARDWARE_VIDEO_DECODING_AMD_DISABLE", "Mesa 23.1.1.0"); - -- // Disable on Release/late Beta on AMD --#if !defined(EARLY_BETA_OR_EARLIER) -- APPEND_TO_DRIVER_BLOCKLIST(OperatingSystem::Linux, DeviceFamily::AtiAll, -- nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING, -- nsIGfxInfo::FEATURE_BLOCKED_DEVICE, -- DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0), -- "FEATURE_HARDWARE_VIDEO_DECODING_DISABLE", ""); --#endif - //////////////////////////////////// - // FEATURE_HW_DECODED_VIDEO_ZERO_COPY - ALLOWLIST - APPEND_TO_DRIVER_BLOCKLIST2(OperatingSystem::Linux, DeviceFamily::All, diff --git a/firefox.spec b/firefox.spec index ceaf38f..6237b6a 100644 --- a/firefox.spec +++ b/firefox.spec @@ -192,14 +192,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 135.0.1 +Version: 136.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250219.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250225.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -271,7 +271,6 @@ Patch219: rhbz-1173156.patch Patch226: rhbz-1354671.patch Patch228: disable-openh264-download.patch Patch229: firefox-nss-addon-hack.patch -Patch230: firefox-enable-vaapi.patch Patch231: fedora-customization.patch Patch241: 0025-Add-KDE-integration-to-Firefox-toolkit-parts.patch Patch242: 0026-Add-KDE-integration-to-Firefox.patch @@ -576,7 +575,6 @@ cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysr %endif %patch -P228 -p1 -b .disable-openh264-download %patch -P229 -p1 -b .firefox-nss-addon-hack -%patch -P230 -p1 -b .firefox-enable-vaapi %patch -P231 -p1 -b .fedora-customization %patch -P402 -p1 -b .1196777 @@ -1234,6 +1232,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Feb 25 2025 Martin Stransky - 136.0-1 +- Updated to 136.0 + * Wed Feb 19 2025 Martin Stransky - 135.0.1-1 - Updated to 135.0.1 diff --git a/sources b/sources index d5d0517..b114d53 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125 SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 -SHA512 (firefox-langpacks-135.0.1-20250219.tar.xz) = b5808a54f3fb7ae2716ce4464a672ac9c200a7ba39114f3dd16d03c2983138b8a9db0df67d4e3b073183a9e2b4d9509b3dcac8502c64b66b36fc3d054d9661ea -SHA512 (firefox-135.0.1.source.tar.xz) = 9ff7c2ab6bc1660e339cdcd7745f8bdac5be25d3a79b9f0393385935270d7ef488599856bc38c22ae0b067389fa71a6999703b74804a6e0ea8265eb99788cea9 +SHA512 (firefox-136.0.source.tar.xz) = c2524d5eddadd6c6b7fe576ac8ff414d8304316ffb6777830e8bed6d14b46725d3990e9b9193d36590b4ad4c13dddd170f4e7404373afbe04b1132d5fbf70ca1 +SHA512 (firefox-langpacks-136.0-20250225.tar.xz) = 9f269d2499e2adb804aa4f3696507e4afb391363f0782d728c8342f6b77098c5ca4474777632b9bcaeb3680cb6806d7ac3d1f26fb7ae2ab806cd10e7c4a05eb5 diff --git a/wasi.patch b/wasi.patch index bce9679..3534061 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-135.0-build/firefox-135.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-136.0-build/firefox-136.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) @@ -22,18 +22,6 @@ diff -up firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake.wasi firefox wasm-component-ld@${wasm_component_ld_version} COMMAND cmake -E make_directory ${wasi_tmp_install}/bin -diff -up firefox-134.0.2/wasi-sdk-25/src/wasi-libc/Makefile.wasi firefox-134.0.2/wasi-sdk-25/src/wasi-libc/Makefile ---- firefox-134.0.2/wasi-sdk-25/src/wasi-libc/Makefile.wasi 2025-01-22 14:58:26.354291234 +0100 -+++ firefox-134.0.2/wasi-sdk-25/src/wasi-libc/Makefile 2025-01-22 14:59:24.565358494 +0100 -@@ -412,7 +412,7 @@ ASMFLAGS += --target=$(TARGET_TRIPLE) - # TODO: Add -fno-signaling-nans when the compiler supports it. - CFLAGS += -fno-trapping-math - # Add all warnings, but disable a few which occur in third-party code. --CFLAGS += -Wall -Wextra -Werror \ -+CFLAGS += -mno-reference-types -Wall -Wextra -Werror \ - -Wno-null-pointer-arithmetic \ - -Wno-unused-parameter \ - -Wno-sign-compare \ diff -up firefox-134.0.2/wasi-sdk-25/version.py.wasi firefox-134.0.2/wasi-sdk-25/version.py --- firefox-134.0.2/wasi-sdk-25/version.py.wasi 2025-01-16 08:03:26.042654800 +0100 +++ firefox-134.0.2/wasi-sdk-25/version.py 2025-01-22 14:08:34.563909971 +0100 From 281e7fc594a66b37a13b716a72bc63a333984736 Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Mon, 26 Aug 2024 18:12:42 +0200 Subject: [PATCH 441/545] stop disabling the use of colors from system theme This was originally disabled as fix for rhbz#1226489 in Firefox 38 time. However, the corresponding upstream bug https://bugzilla.mozilla.org/show_bug.cgi?id=1158076 was fixed in Firefox 55, so it looks like there's no reason to keep this anymore. I checked a few pages with browser.display.use_system_colors set to true and I couldn't notice any visual issues. --- firefox-redhat-default-prefs.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/firefox-redhat-default-prefs.js b/firefox-redhat-default-prefs.js index 6fcee25..1383a0f 100644 --- a/firefox-redhat-default-prefs.js +++ b/firefox-redhat-default-prefs.js @@ -22,8 +22,6 @@ pref("media.gmp-gmpopenh264.autoupdate",false); pref("media.gmp-gmpopenh264.enabled",false); pref("media.gmp.decoder.enabled", true); pref("plugins.notifyMissingFlash", false); -/* See https://bugzilla.redhat.com/show_bug.cgi?id=1226489 */ -pref("browser.display.use_system_colors", false); /* Allow sending credetials to all https:// sites */ pref("network.negotiate-auth.trusted-uris", "https://"); pref("spellchecker.dictionary_path","/usr/share/hunspell"); From 29cb80df9540757c4eebf9e582c60b0b96af51f5 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 28 Feb 2025 14:06:41 +0100 Subject: [PATCH 442/545] Updated to 136.0 Build 3 --- .gitignore | 1 + firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 15a9d9c..f190448 100644 --- a/.gitignore +++ b/.gitignore @@ -686,3 +686,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-135.0-20250204.tar.xz /firefox-136.0.source.tar.xz /firefox-langpacks-136.0-20250225.tar.xz +/firefox-langpacks-136.0-20250228.tar.xz diff --git a/firefox.spec b/firefox.spec index 6237b6a..95ab126 100644 --- a/firefox.spec +++ b/firefox.spec @@ -193,13 +193,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 136.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250225.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250228.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1232,6 +1232,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Feb 28 2025 Martin Stransky - 136.0-2 +- Updated to 136.0 Build 3 + * Tue Feb 25 2025 Martin Stransky - 136.0-1 - Updated to 136.0 diff --git a/sources b/sources index b114d53..b299631 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125 SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 -SHA512 (firefox-136.0.source.tar.xz) = c2524d5eddadd6c6b7fe576ac8ff414d8304316ffb6777830e8bed6d14b46725d3990e9b9193d36590b4ad4c13dddd170f4e7404373afbe04b1132d5fbf70ca1 -SHA512 (firefox-langpacks-136.0-20250225.tar.xz) = 9f269d2499e2adb804aa4f3696507e4afb391363f0782d728c8342f6b77098c5ca4474777632b9bcaeb3680cb6806d7ac3d1f26fb7ae2ab806cd10e7c4a05eb5 +SHA512 (firefox-langpacks-136.0-20250228.tar.xz) = 6bf8f73054a979e330d3d75b8a32ae64480f90c34acf364a60fa094279303527dab19575e6fc4473d60ffa623098a232af693b2e944c77765690c71057c777ea +SHA512 (firefox-136.0.source.tar.xz) = a2b7e74e8404138b294f7b3c5f1eaeaeb8ce84c9aad25379e8ec785a9686f42def9f8c119d4bc276dd371d13d7bebbe4b1b092af41500aa8c2b2c827971445b4 From 2ca6a09a02d207bb6dd533a00c0b7e2eed6effb3 Mon Sep 17 00:00:00 2001 From: Christian Stadelmann Date: Fri, 28 Feb 2025 16:40:57 +0000 Subject: [PATCH 443/545] Remove G_SLICE workaround as it was dropped from upstream glib Upstream GLib has dropped the GSlice allocator in GLib 2.76, which renders the G_SLICE environment variable useless. See: * https://gitlab.gnome.org/GNOME/glib/-/blob/main/docs/reference/glib/running.md * https://gitlab.gnome.org/GNOME/glib/-/commit/45b5a6c1e56d5b73cc5ed798ef59a5601e56c170 --- firefox.sh.in | 5 ----- 1 file changed, 5 deletions(-) diff --git a/firefox.sh.in b/firefox.sh.in index dfcefff..2a07e49 100644 --- a/firefox.sh.in +++ b/firefox.sh.in @@ -142,11 +142,6 @@ export FONTCONFIG_PATH GNOME_DISABLE_CRASH_DIALOG=1 export GNOME_DISABLE_CRASH_DIALOG -## -## Disable the SLICE allocator (rhbz#1014858) -## -export G_SLICE=always-malloc - ## ## Enable Xinput2 (mozbz#1207973) ## From b373f8ce3870430272e53ba4f3c63f0b933f96cf Mon Sep 17 00:00:00 2001 From: Christian Stadelmann Date: Fri, 28 Feb 2025 17:24:14 +0000 Subject: [PATCH 444/545] Remove setting non-existent font config path - The file or folder `/usr/lib64/firefox/res/Xft` does not exist and is not provided by firefox package itself or any other package on Fedora 41 - The folder `/etc/fonts` is the _default font configuration directory_ according to fonts-conf(5) (see also: https://fontconfig.pages.freedesktop.org/fontconfig/fontconfig-user.html) so there is no need to specify it explicitly This line has not been changed since importing the repo from CVS over 20 years ago, so I guess it is just a leftover. --- firefox.sh.in | 6 ------ 1 file changed, 6 deletions(-) diff --git a/firefox.sh.in b/firefox.sh.in index dfcefff..3548765 100644 --- a/firefox.sh.in +++ b/firefox.sh.in @@ -107,12 +107,6 @@ export MOZ_PLUGIN_PATH ## export MOZ_APP_LAUNCHER="/__PREFIX__/bin/firefox" -## -## Set FONTCONFIG_PATH for Xft/fontconfig -## -FONTCONFIG_PATH="/etc/fonts:${MOZILLA_FIVE_HOME}/res/Xft" -export FONTCONFIG_PATH - ## ## We want Firefox to use Openh264 provided by Fedora. ## From 233edd69e3b0dd25547ff2da600397b5e4ebf23c Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 12 Mar 2025 11:48:55 +0100 Subject: [PATCH 445/545] Updated to 136.0.1 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index f190448..7fbe6b5 100644 --- a/.gitignore +++ b/.gitignore @@ -687,3 +687,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-136.0.source.tar.xz /firefox-langpacks-136.0-20250225.tar.xz /firefox-langpacks-136.0-20250228.tar.xz +/firefox-136.0.1.source.tar.xz +/firefox-langpacks-136.0.1-20250312.tar.xz diff --git a/firefox.spec b/firefox.spec index 95ab126..73eb07c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -192,14 +192,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 136.0 -Release: 2%{?pre_tag}%{?dist} +Version: 136.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250228.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250312.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1232,6 +1232,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Mar 12 2025 Martin Stransky - 136.0.1-1 +- Updated to 136.0.1 + * Fri Feb 28 2025 Martin Stransky - 136.0-2 - Updated to 136.0 Build 3 diff --git a/sources b/sources index b299631..c440520 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125 SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 -SHA512 (firefox-langpacks-136.0-20250228.tar.xz) = 6bf8f73054a979e330d3d75b8a32ae64480f90c34acf364a60fa094279303527dab19575e6fc4473d60ffa623098a232af693b2e944c77765690c71057c777ea -SHA512 (firefox-136.0.source.tar.xz) = a2b7e74e8404138b294f7b3c5f1eaeaeb8ce84c9aad25379e8ec785a9686f42def9f8c119d4bc276dd371d13d7bebbe4b1b092af41500aa8c2b2c827971445b4 +SHA512 (firefox-136.0.1.source.tar.xz) = e5833ccf97796c15b5156357427621d1f2d1d7ee55b53262f3935eadb98229c74a355bbe2f72a4168ec4e29dd3f83f4eaca99c5215d61bd087475331d3522abd +SHA512 (firefox-langpacks-136.0.1-20250312.tar.xz) = f3ada0893ec14b0a82f0b15190aea405be4b54cccfe437b62b29faa3fcfd95ed5e9806d557a8354de09ccfac6118c01b6f537227d6a81bf0015fa552eb489fbc From 4d9e561f5a15ab87b29fef83215f4529955a4c32 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 19 Mar 2025 13:54:50 +0100 Subject: [PATCH 446/545] Updated to 136.0.2 --- .gitignore | 1 + firefox.spec | 17 ++++++++++------- sources | 2 ++ wasi.patch | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 7fbe6b5..0acc6b3 100644 --- a/.gitignore +++ b/.gitignore @@ -689,3 +689,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-136.0-20250228.tar.xz /firefox-136.0.1.source.tar.xz /firefox-langpacks-136.0.1-20250312.tar.xz +/firefox-langpacks-136.0.2-20250319.tar.xz diff --git a/firefox.spec b/firefox.spec index 9414203..efad903 100644 --- a/firefox.spec +++ b/firefox.spec @@ -169,7 +169,7 @@ ExcludeArch: i686 %if !%{release_build} %global pre_tag .npgo %endif -%if %{build_with_clang} +%if %{with build_with_clang} %global pre_tag .clang %endif %if %{build_with_asan} @@ -193,14 +193,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 136.0.1 +Version: 136.0.2 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250312.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250319.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -333,7 +333,7 @@ BuildRequires: llvm BuildRequires: llvm-devel BuildRequires: clang BuildRequires: clang-libs -%if %{build_with_clang} || %{with wasi_sdk} +%if %{with build_with_clang} || %{with wasi_sdk} BuildRequires: lld %endif @@ -589,7 +589,7 @@ cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysr # PGO patches %if %{build_with_pgo} -%if !%{build_with_clang} +%if !%{with build_with_clang} %patch -P600 -p1 -b .pgo %patch -P602 -p1 -b .1516803 %endif @@ -834,7 +834,7 @@ MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | sed -e 's/-g/-g1/') %endif export MOZ_DEBUG_FLAGS=" " MOZ_LINK_FLAGS="%{build_ldflags}" -%if !%{build_with_clang} +%if !%{with build_with_clang} %ifarch aarch64 %{ix86} ppc64le x86_64 MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" %endif @@ -854,7 +854,7 @@ echo "export CFLAGS=\"$MOZ_OPT_FLAGS\"" >> .mozconfig echo "export CXXFLAGS=\"$MOZ_OPT_FLAGS\"" >> .mozconfig echo "export LDFLAGS=\"$MOZ_LINK_FLAGS\"" >> .mozconfig -%if %{build_with_clang} +%if %{with build_with_clang} echo "export LLVM_PROFDATA=\"llvm-profdata\"" >> .mozconfig echo "export AR=\"llvm-ar\"" >> .mozconfig echo "export NM=\"llvm-nm\"" >> .mozconfig @@ -1243,6 +1243,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Mar 19 2025 Martin Stransky - 136.0.2-1 +- Updated to 136.0.2 + * Wed Mar 12 2025 Martin Stransky - 136.0.1-1 - Updated to 136.0.1 diff --git a/sources b/sources index c440520..25562aa 100644 --- a/sources +++ b/sources @@ -5,3 +5,5 @@ SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7 SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (firefox-136.0.1.source.tar.xz) = e5833ccf97796c15b5156357427621d1f2d1d7ee55b53262f3935eadb98229c74a355bbe2f72a4168ec4e29dd3f83f4eaca99c5215d61bd087475331d3522abd SHA512 (firefox-langpacks-136.0.1-20250312.tar.xz) = f3ada0893ec14b0a82f0b15190aea405be4b54cccfe437b62b29faa3fcfd95ed5e9806d557a8354de09ccfac6118c01b6f537227d6a81bf0015fa552eb489fbc +SHA512 (firefox-langpacks-136.0.2-20250319.tar.xz) = d0ba5b862a1bac5b6af72c0315ddbe15f28df675accea6776adda4f41101bc0392395f0832bdbe03b440ae5705ce9aa4f3db24224723a66d132988871049a781 +SHA512 (firefox-136.0.source.tar.xz) = a2b7e74e8404138b294f7b3c5f1eaeaeb8ce84c9aad25379e8ec785a9686f42def9f8c119d4bc276dd371d13d7bebbe4b1b092af41500aa8c2b2c827971445b4 diff --git a/wasi.patch b/wasi.patch index 3534061..9a28c4e 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-136.0-build/firefox-136.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-136.0.2-build/firefox-136.0.2/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 56e5a95e64d8689af3796778c950a3c291ab7f9d Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 19 Mar 2025 19:15:14 +0100 Subject: [PATCH 447/545] removed old sources --- sources | 2 -- 1 file changed, 2 deletions(-) diff --git a/sources b/sources index 25562aa..a57dfef 100644 --- a/sources +++ b/sources @@ -3,7 +3,5 @@ SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125 SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 -SHA512 (firefox-136.0.1.source.tar.xz) = e5833ccf97796c15b5156357427621d1f2d1d7ee55b53262f3935eadb98229c74a355bbe2f72a4168ec4e29dd3f83f4eaca99c5215d61bd087475331d3522abd -SHA512 (firefox-langpacks-136.0.1-20250312.tar.xz) = f3ada0893ec14b0a82f0b15190aea405be4b54cccfe437b62b29faa3fcfd95ed5e9806d557a8354de09ccfac6118c01b6f537227d6a81bf0015fa552eb489fbc SHA512 (firefox-langpacks-136.0.2-20250319.tar.xz) = d0ba5b862a1bac5b6af72c0315ddbe15f28df675accea6776adda4f41101bc0392395f0832bdbe03b440ae5705ce9aa4f3db24224723a66d132988871049a781 SHA512 (firefox-136.0.source.tar.xz) = a2b7e74e8404138b294f7b3c5f1eaeaeb8ce84c9aad25379e8ec785a9686f42def9f8c119d4bc276dd371d13d7bebbe4b1b092af41500aa8c2b2c827971445b4 From dfb73a541242b62892301d92f30157c1c4a1da6c Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 19 Mar 2025 22:29:00 +0100 Subject: [PATCH 448/545] Updated sources --- .gitignore | 1 + sources | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0acc6b3..5ec4e03 100644 --- a/.gitignore +++ b/.gitignore @@ -690,3 +690,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-136.0.1.source.tar.xz /firefox-langpacks-136.0.1-20250312.tar.xz /firefox-langpacks-136.0.2-20250319.tar.xz +/firefox-136.0.2.source.tar.xz diff --git a/sources b/sources index a57dfef..07f8123 100644 --- a/sources +++ b/sources @@ -4,4 +4,4 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (firefox-langpacks-136.0.2-20250319.tar.xz) = d0ba5b862a1bac5b6af72c0315ddbe15f28df675accea6776adda4f41101bc0392395f0832bdbe03b440ae5705ce9aa4f3db24224723a66d132988871049a781 -SHA512 (firefox-136.0.source.tar.xz) = a2b7e74e8404138b294f7b3c5f1eaeaeb8ce84c9aad25379e8ec785a9686f42def9f8c119d4bc276dd371d13d7bebbe4b1b092af41500aa8c2b2c827971445b4 +SHA512 (firefox-136.0.2.source.tar.xz) = 50dfbedb6bd513a3c6cf90558d7c6993cc78558cccc69fcc882f8e54eb8e8bec9779dce6fb7211c1a0234ac4a189438c5fa55ee9d0d06fcbae5cf44778af2ef1 From 1b3593d295e90594b4c04e9485d2cf298c458019 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 24 Mar 2025 10:58:54 +0100 Subject: [PATCH 449/545] Stop overriding user settings on every update (rhbz#2353895) --- firefox-redhat-default-prefs.js | 54 ++++++++++++++++----------------- firefox.spec | 5 ++- 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/firefox-redhat-default-prefs.js b/firefox-redhat-default-prefs.js index 1383a0f..564074f 100644 --- a/firefox-redhat-default-prefs.js +++ b/firefox-redhat-default-prefs.js @@ -1,34 +1,34 @@ pref("app.update.auto", false); pref("app.update.enabled", false); pref("app.update.autoInstallEnabled", false); -pref("general.smoothScroll", true); -pref("intl.locale.requested", ""); -pref("toolkit.storage.synchronous", 0); -pref("toolkit.networkmanager.disable", false); -pref("offline.autoDetect", true); -pref("browser.backspace_action", 2); -pref("browser.display.use_system_colors", true); -pref("browser.download.folderList", 1); -pref("browser.link.open_external", 3); -pref("browser.shell.checkDefaultBrowser", false); -pref("network.manage-offline-status", true); -pref("extensions.shownSelectionUI", true); -pref("ui.SpellCheckerUnderlineStyle", 1); -pref("startup.homepage_override_url", ""); -pref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=https://start.fedoraproject.org/"); -pref("browser.newtabpage.pinned", '[{"url":"https://start.fedoraproject.org/","title":"Fedora Project - Start Page"}]'); -pref("media.gmp-gmpopenh264.provider.enabled",false); -pref("media.gmp-gmpopenh264.autoupdate",false); -pref("media.gmp-gmpopenh264.enabled",false); -pref("media.gmp.decoder.enabled", true); -pref("plugins.notifyMissingFlash", false); +defaultPref("general.smoothScroll", true); +defaultPref("intl.locale.requested", ""); +defaultPref("toolkit.storage.synchronous", 0); +defaultPref("toolkit.networkmanager.disable", false); +defaultPref("offline.autoDetect", true); +defaultPref("browser.backspace_action", 2); +defaultPref("browser.display.use_system_colors", true); +defaultPref("browser.download.folderList", 1); +defaultPref("browser.link.open_external", 3); +defaultPref("browser.shell.checkDefaultBrowser", false); +defaultPref("network.manage-offline-status", true); +defaultPref("extensions.shownSelectionUI", true); +defaultPref("ui.SpellCheckerUnderlineStyle", 1); +defaultPref("startup.homepage_override_url", ""); +defaultPref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=https://start.fedoraproject.org/"); +defaultPref("browser.newtabpage.pinned", '[{"url":"https://start.fedoraproject.org/","title":"Fedora Project - Start Page"}]'); +defaultPref("media.gmp-gmpopenh264.provider.enabled",false); +defaultPref("media.gmp-gmpopenh264.autoupdate",false); +defaultPref("media.gmp-gmpopenh264.enabled",false); +defaultPref("media.gmp.decoder.enabled", true); +defaultPref("plugins.notifyMissingFlash", false); /* Allow sending credetials to all https:// sites */ -pref("network.negotiate-auth.trusted-uris", "https://"); -pref("spellchecker.dictionary_path","/usr/share/hunspell"); +defaultPref("network.negotiate-auth.trusted-uris", "https://"); +defaultPref("spellchecker.dictionary_path","/usr/share/hunspell"); /* Disable DoH by default */ -pref("network.trr.mode", 5); +defaultPref("network.trr.mode", 5); /* Enable per-user policy dir, see mozbz#1583466 */ -pref("browser.policies.perUserDir", true); -pref("browser.gnome-search-provider.enabled",true); +defaultPref("browser.policies.perUserDir", true); +defaultPref("browser.gnome-search-provider.enabled",true); /* Enable ffvpx playback for WebRTC */ -pref("media.navigator.mediadatadecoder_vpx_enabled", true); +defaultPref("media.navigator.mediadatadecoder_vpx_enabled", true); diff --git a/firefox.spec b/firefox.spec index efad903..e8bdde0 100644 --- a/firefox.spec +++ b/firefox.spec @@ -194,7 +194,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 136.0.2 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -1243,6 +1243,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Mar 24 2025 Martin Stransky - 136.0.2-2 +- Stop overriding user settings on every update (rhbz#2353895) + * Wed Mar 19 2025 Martin Stransky - 136.0.2-1 - Updated to 136.0.2 From 0f065b22d374929a9d02e6731368b095b1c4b928 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 24 Mar 2025 11:01:01 +0100 Subject: [PATCH 450/545] Remove browser.display.use_system_colors override (rhbz#2353953) --- firefox-redhat-default-prefs.js | 1 - firefox.spec | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox-redhat-default-prefs.js b/firefox-redhat-default-prefs.js index 564074f..057bf8a 100644 --- a/firefox-redhat-default-prefs.js +++ b/firefox-redhat-default-prefs.js @@ -7,7 +7,6 @@ defaultPref("toolkit.storage.synchronous", 0); defaultPref("toolkit.networkmanager.disable", false); defaultPref("offline.autoDetect", true); defaultPref("browser.backspace_action", 2); -defaultPref("browser.display.use_system_colors", true); defaultPref("browser.download.folderList", 1); defaultPref("browser.link.open_external", 3); defaultPref("browser.shell.checkDefaultBrowser", false); diff --git a/firefox.spec b/firefox.spec index e8bdde0..36459cc 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1245,6 +1245,7 @@ fi %changelog * Mon Mar 24 2025 Martin Stransky - 136.0.2-2 - Stop overriding user settings on every update (rhbz#2353895) +- Remove browser.display.use_system_colors override (rhbz#2353953) * Wed Mar 19 2025 Martin Stransky - 136.0.2-1 - Updated to 136.0.2 From 96dc4115d326e0cabb985bc08ae09eb84fdfb063 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 25 Mar 2025 08:11:54 +0100 Subject: [PATCH 451/545] Update to latest upstream (136.0.3), Revert rhbz#2353895 as it looks broken --- .gitignore | 2 ++ firefox-redhat-default-prefs.js | 52 ++++++++++++++++----------------- firefox.spec | 10 +++++-- sources | 4 +-- 4 files changed, 37 insertions(+), 31 deletions(-) diff --git a/.gitignore b/.gitignore index 5ec4e03..fd28e3d 100644 --- a/.gitignore +++ b/.gitignore @@ -691,3 +691,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-136.0.1-20250312.tar.xz /firefox-langpacks-136.0.2-20250319.tar.xz /firefox-136.0.2.source.tar.xz +/firefox-136.0.3.source.tar.xz +/firefox-langpacks-136.0.3-20250325.tar.xz diff --git a/firefox-redhat-default-prefs.js b/firefox-redhat-default-prefs.js index 057bf8a..979f21b 100644 --- a/firefox-redhat-default-prefs.js +++ b/firefox-redhat-default-prefs.js @@ -1,33 +1,33 @@ pref("app.update.auto", false); pref("app.update.enabled", false); pref("app.update.autoInstallEnabled", false); -defaultPref("general.smoothScroll", true); -defaultPref("intl.locale.requested", ""); -defaultPref("toolkit.storage.synchronous", 0); -defaultPref("toolkit.networkmanager.disable", false); -defaultPref("offline.autoDetect", true); -defaultPref("browser.backspace_action", 2); -defaultPref("browser.download.folderList", 1); -defaultPref("browser.link.open_external", 3); -defaultPref("browser.shell.checkDefaultBrowser", false); -defaultPref("network.manage-offline-status", true); -defaultPref("extensions.shownSelectionUI", true); -defaultPref("ui.SpellCheckerUnderlineStyle", 1); -defaultPref("startup.homepage_override_url", ""); -defaultPref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=https://start.fedoraproject.org/"); -defaultPref("browser.newtabpage.pinned", '[{"url":"https://start.fedoraproject.org/","title":"Fedora Project - Start Page"}]'); -defaultPref("media.gmp-gmpopenh264.provider.enabled",false); -defaultPref("media.gmp-gmpopenh264.autoupdate",false); -defaultPref("media.gmp-gmpopenh264.enabled",false); -defaultPref("media.gmp.decoder.enabled", true); -defaultPref("plugins.notifyMissingFlash", false); +pref("general.smoothScroll", true); +pref("intl.locale.requested", ""); +pref("toolkit.storage.synchronous", 0); +pref("toolkit.networkmanager.disable", false); +pref("offline.autoDetect", true); +pref("browser.backspace_action", 2); +pref("browser.download.folderList", 1); +pref("browser.link.open_external", 3); +pref("browser.shell.checkDefaultBrowser", false); +pref("network.manage-offline-status", true); +pref("extensions.shownSelectionUI", true); +pref("ui.SpellCheckerUnderlineStyle", 1); +pref("startup.homepage_override_url", ""); +pref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=https://start.fedoraproject.org/"); +pref("browser.newtabpage.pinned", '[{"url":"https://start.fedoraproject.org/","title":"Fedora Project - Start Page"}]'); +pref("media.gmp-gmpopenh264.provider.enabled",false); +pref("media.gmp-gmpopenh264.autoupdate",false); +pref("media.gmp-gmpopenh264.enabled",false); +pref("media.gmp.decoder.enabled", true); +pref("plugins.notifyMissingFlash", false); /* Allow sending credetials to all https:// sites */ -defaultPref("network.negotiate-auth.trusted-uris", "https://"); -defaultPref("spellchecker.dictionary_path","/usr/share/hunspell"); +pref("network.negotiate-auth.trusted-uris", "https://"); +pref("spellchecker.dictionary_path","/usr/share/hunspell"); /* Disable DoH by default */ -defaultPref("network.trr.mode", 5); +pref("network.trr.mode", 5); /* Enable per-user policy dir, see mozbz#1583466 */ -defaultPref("browser.policies.perUserDir", true); -defaultPref("browser.gnome-search-provider.enabled",true); +pref("browser.policies.perUserDir", true); +pref("browser.gnome-search-provider.enabled",true); /* Enable ffvpx playback for WebRTC */ -defaultPref("media.navigator.mediadatadecoder_vpx_enabled", true); +pref("media.navigator.mediadatadecoder_vpx_enabled", true); diff --git a/firefox.spec b/firefox.spec index 36459cc..36c5273 100644 --- a/firefox.spec +++ b/firefox.spec @@ -193,14 +193,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 136.0.2 -Release: 2%{?pre_tag}%{?dist} +Version: 136.0.3 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250319.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250325.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1243,6 +1243,10 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Mar 25 2025 Martin Stransky - 136.0.3-1 +- Revert rhbz#2353895 as it looks broken +- Update to latest upstream (136.0.3) + * Mon Mar 24 2025 Martin Stransky - 136.0.2-2 - Stop overriding user settings on every update (rhbz#2353895) - Remove browser.display.use_system_colors override (rhbz#2353953) diff --git a/sources b/sources index 07f8123..e08398d 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125 SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 -SHA512 (firefox-langpacks-136.0.2-20250319.tar.xz) = d0ba5b862a1bac5b6af72c0315ddbe15f28df675accea6776adda4f41101bc0392395f0832bdbe03b440ae5705ce9aa4f3db24224723a66d132988871049a781 -SHA512 (firefox-136.0.2.source.tar.xz) = 50dfbedb6bd513a3c6cf90558d7c6993cc78558cccc69fcc882f8e54eb8e8bec9779dce6fb7211c1a0234ac4a189438c5fa55ee9d0d06fcbae5cf44778af2ef1 +SHA512 (firefox-136.0.3.source.tar.xz) = 59cb54bc946aecea810169970aad4ba3f7b3092e56f15f86ff3d51fa2752c89632a057a1bda016f0005665ec5099d9b9f9a4786b9c02e3f5656eb2003b6a1747 +SHA512 (firefox-langpacks-136.0.3-20250325.tar.xz) = caba2fcfab58b5547777df830d2af1cfa30f345111e00b117995d50bd2e80963f1284a85ed1e71d7c464cfc592453e789495848c64027dbe3bed254311bd6744 From 4cf000a2ecd9571b1590793b447e834243654a61 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 25 Mar 2025 08:42:14 +0100 Subject: [PATCH 452/545] Removed unused GNOME_DISABLE_CRASH_DIALOG=1 --- firefox.sh.in | 6 ------ 1 file changed, 6 deletions(-) diff --git a/firefox.sh.in b/firefox.sh.in index c13983c..7d3faed 100644 --- a/firefox.sh.in +++ b/firefox.sh.in @@ -130,12 +130,6 @@ export MOZ_APP_LAUNCHER="/__PREFIX__/bin/firefox" # export MOZ_DISABLE_PANGO # -## -## Disable the GNOME crash dialog, Moz has it's own -## -GNOME_DISABLE_CRASH_DIALOG=1 -export GNOME_DISABLE_CRASH_DIALOG - ## ## Enable Xinput2 (mozbz#1207973) ## From 022fac0b47728738a2bbbb41aa137da2da1ff376 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 26 Mar 2025 12:14:46 +0100 Subject: [PATCH 453/545] Updated to 137.0 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- wasi.patch | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index fd28e3d..3f71c4f 100644 --- a/.gitignore +++ b/.gitignore @@ -693,3 +693,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-136.0.2.source.tar.xz /firefox-136.0.3.source.tar.xz /firefox-langpacks-136.0.3-20250325.tar.xz +/firefox-langpacks-137.0-20250326.tar.xz +/firefox-137.0.source.tar.xz diff --git a/firefox.spec b/firefox.spec index 36c5273..820ac70 100644 --- a/firefox.spec +++ b/firefox.spec @@ -193,14 +193,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 136.0.3 +Version: 137.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250325.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250326.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1243,6 +1243,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Mar 26 2025 Martin Stransky - 137.0-1 +- Update to latest upstream (137.0) + * Tue Mar 25 2025 Martin Stransky - 136.0.3-1 - Revert rhbz#2353895 as it looks broken - Update to latest upstream (136.0.3) diff --git a/sources b/sources index e08398d..9990afa 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125 SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 -SHA512 (firefox-136.0.3.source.tar.xz) = 59cb54bc946aecea810169970aad4ba3f7b3092e56f15f86ff3d51fa2752c89632a057a1bda016f0005665ec5099d9b9f9a4786b9c02e3f5656eb2003b6a1747 -SHA512 (firefox-langpacks-136.0.3-20250325.tar.xz) = caba2fcfab58b5547777df830d2af1cfa30f345111e00b117995d50bd2e80963f1284a85ed1e71d7c464cfc592453e789495848c64027dbe3bed254311bd6744 +SHA512 (firefox-langpacks-137.0-20250326.tar.xz) = f54941fc924f50a1e236f14be712a308e62cc8b153cd436a8b6fecdb40284c09837fa217d379b977cf17384a6343a3adfe9b542df2b32ea336686f64d8693a6d +SHA512 (firefox-137.0.source.tar.xz) = 36900441acab18ea7c6dcd56bf195749092df797b7f6f47b44ab309d04fb1177844e9545329eb96c4fbdddda88a8b562218e9aaa865ad5fdcfcb7d2eaee19fb7 diff --git a/wasi.patch b/wasi.patch index 9a28c4e..aa8c6d0 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-136.0.2-build/firefox-136.0.2/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-137.0-build/firefox-137.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 9b737f0495951a3e206a6ba10042dee990b8d7e3 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 31 Mar 2025 17:25:43 +0200 Subject: [PATCH 454/545] Update 137.0 build 2 --- .gitignore | 1 + firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 3f71c4f..ec8716e 100644 --- a/.gitignore +++ b/.gitignore @@ -695,3 +695,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-136.0.3-20250325.tar.xz /firefox-langpacks-137.0-20250326.tar.xz /firefox-137.0.source.tar.xz +/firefox-langpacks-137.0-20250331.tar.xz diff --git a/firefox.spec b/firefox.spec index 820ac70..7981fbe 100644 --- a/firefox.spec +++ b/firefox.spec @@ -194,13 +194,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 137.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250326.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250331.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1243,6 +1243,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Mar 31 2025 Martin Stransky - 137.0-2 +- Update 137.0 build 2 + * Wed Mar 26 2025 Martin Stransky - 137.0-1 - Update to latest upstream (137.0) diff --git a/sources b/sources index 9990afa..0ea0303 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125 SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 -SHA512 (firefox-langpacks-137.0-20250326.tar.xz) = f54941fc924f50a1e236f14be712a308e62cc8b153cd436a8b6fecdb40284c09837fa217d379b977cf17384a6343a3adfe9b542df2b32ea336686f64d8693a6d -SHA512 (firefox-137.0.source.tar.xz) = 36900441acab18ea7c6dcd56bf195749092df797b7f6f47b44ab309d04fb1177844e9545329eb96c4fbdddda88a8b562218e9aaa865ad5fdcfcb7d2eaee19fb7 +SHA512 (firefox-langpacks-137.0-20250331.tar.xz) = 453382a28b935a63ad869f22cb5a8a3006814d96925ecf4255c02edd2cf031084821af7bb4bf8eaa5fbe0c20547365c98ac8aa9f76a2e2b43a64aede171d372e +SHA512 (firefox-137.0.source.tar.xz) = 81a2c0cc14ffc2e49e49379e6c2ab56cfb6e13b66666a64f3abff44a43bb2e7dc17274d325d1c20af062d40bff8063d788d4b2f931a7a646db8b07204ca6b481 From 28fda94a3b63fda0487acea5c978e6e6c18418d4 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 14 Apr 2025 09:43:36 +0200 Subject: [PATCH 455/545] Update to 137.0.1 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- wasi.patch | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index ec8716e..724f2f3 100644 --- a/.gitignore +++ b/.gitignore @@ -696,3 +696,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-137.0-20250326.tar.xz /firefox-137.0.source.tar.xz /firefox-langpacks-137.0-20250331.tar.xz +/firefox-137.0.1.source.tar.xz +/firefox-langpacks-137.0.1-20250414.tar.xz diff --git a/firefox.spec b/firefox.spec index 7981fbe..cf65b69 100644 --- a/firefox.spec +++ b/firefox.spec @@ -193,14 +193,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 137.0 -Release: 2%{?pre_tag}%{?dist} +Version: 137.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250331.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250414.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1243,6 +1243,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Apr 14 2025 Martin Stransky - 137.0.1-1 +- Update 137.0.1 + * Mon Mar 31 2025 Martin Stransky - 137.0-2 - Update 137.0 build 2 diff --git a/sources b/sources index 0ea0303..c1064f8 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125 SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 -SHA512 (firefox-langpacks-137.0-20250331.tar.xz) = 453382a28b935a63ad869f22cb5a8a3006814d96925ecf4255c02edd2cf031084821af7bb4bf8eaa5fbe0c20547365c98ac8aa9f76a2e2b43a64aede171d372e -SHA512 (firefox-137.0.source.tar.xz) = 81a2c0cc14ffc2e49e49379e6c2ab56cfb6e13b66666a64f3abff44a43bb2e7dc17274d325d1c20af062d40bff8063d788d4b2f931a7a646db8b07204ca6b481 +SHA512 (firefox-137.0.1.source.tar.xz) = cc2cbe3dd65696849c1b197b908887c111083fa8b5089aa4eae6f33ee404db29c566619c48b77fb495ad7f9dc94a2d9d910e5b2aaf8644db1d00368091f9dcb6 +SHA512 (firefox-langpacks-137.0.1-20250414.tar.xz) = dd08a6da826fcdbe9b5c7bcd3474aa67b09bb186dd6353ffc49e3a091bedb2b38daf3ae5705798ab639121c705b374b0d7e94a0fb8647aa3eadaee317d16133a diff --git a/wasi.patch b/wasi.patch index aa8c6d0..2fc4667 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-137.0-build/firefox-137.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-137.0.1-build/firefox-137.0.1/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 540d80f5e279bf400de134cd7dc7cfc64cbcf3b8 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 16 Apr 2025 10:26:09 +0200 Subject: [PATCH 456/545] Update 137.0.2 --- firefox.spec | 7 +++++-- sources | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/firefox.spec b/firefox.spec index cf65b69..db39c6d 100644 --- a/firefox.spec +++ b/firefox.spec @@ -193,14 +193,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 137.0.1 +Version: 137.0.2 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250414.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250416.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1243,6 +1243,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Apr 16 2025 Martin Stransky - 137.0.2-1 +- Update 137.0.2 + * Mon Apr 14 2025 Martin Stransky - 137.0.1-1 - Update 137.0.1 diff --git a/sources b/sources index c1064f8..cca5c9d 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125 SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 -SHA512 (firefox-137.0.1.source.tar.xz) = cc2cbe3dd65696849c1b197b908887c111083fa8b5089aa4eae6f33ee404db29c566619c48b77fb495ad7f9dc94a2d9d910e5b2aaf8644db1d00368091f9dcb6 -SHA512 (firefox-langpacks-137.0.1-20250414.tar.xz) = dd08a6da826fcdbe9b5c7bcd3474aa67b09bb186dd6353ffc49e3a091bedb2b38daf3ae5705798ab639121c705b374b0d7e94a0fb8647aa3eadaee317d16133a +SHA512 (firefox-langpacks-137.0.2-20250416.tar.xz) = 23fda4ca1eefb7cc5c966276668c95c99e905da81f8dc314f36d0a8332803c21d6e12c1defc02d667b426716439cf51256e436a269ae0ae22c7d5b1b6faa733f +SHA512 (firefox-137.0.2.source.tar.xz) = 82140c4325233ea2e2f579088cebb98c0e8db8848b4018cff95d4ed42bf847049ed6520fc051d930ee267a5acb008908170825d381589da0d109ca04a61e1c24 From 47ca594e398b84d2c4d33faf5fa0b2e242f12354 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 16 Apr 2025 21:08:39 +0200 Subject: [PATCH 457/545] Added fix for Firefox freezes (mzbz#1951249) --- D244990.1744916693.diff | 153 ++++++++++++++++++++++++++++++++++++++++ firefox.spec | 7 +- wasi.patch | 2 +- 3 files changed, 160 insertions(+), 2 deletions(-) create mode 100644 D244990.1744916693.diff diff --git a/D244990.1744916693.diff b/D244990.1744916693.diff new file mode 100644 index 0000000..1582cab --- /dev/null +++ b/D244990.1744916693.diff @@ -0,0 +1,153 @@ +diff --git a/widget/gtk/WaylandVsyncSource.h b/widget/gtk/WaylandVsyncSource.h +--- a/widget/gtk/WaylandVsyncSource.h ++++ b/widget/gtk/WaylandVsyncSource.h +@@ -47,13 +47,10 @@ + explicit WaylandVsyncSource(nsWindow* aWindow); + virtual ~WaylandVsyncSource(); + + static Maybe GetFastestVsyncRate(); + +- void EnableVSyncSource(); +- void DisableVSyncSource(); +- + // Regular VSync callback. Runs for visible windows only. + // aTime = 0 means emulated frame and use current time. + void VisibleWindowCallback(uint32_t aTime = 0); + + // Idle callback for hidden windows. +@@ -67,10 +64,15 @@ + void EnableVsync() override; + void DisableVsync() override; + bool IsVsyncEnabled() override; + void Shutdown() override; + ++ // Enable/Disable this particular VSync source. Called from widget code ++ // if we know that nsWindow become visible/hidden. ++ void EnableVSyncSource(); ++ void DisableVSyncSource(); ++ + // We addref/unref this during init so we should not + // call it from constructor. + void Init(); + + private: +@@ -80,10 +82,12 @@ + TimeStamp aVsyncTimestamp); + void* GetWindowForLogging() { return mWindow; }; + + void SetHiddenWindowVSync(); + ++ void SetVSyncEventsLocked(const MutexAutoLock& aProofOfLock, bool aEnabled); ++ + Mutex mMutex; + + // Main thread only, except for logging. + RefPtr mWindow; + RefPtr mWaylandSurface MOZ_GUARDED_BY(mMutex); +diff --git a/widget/gtk/WaylandVsyncSource.cpp b/widget/gtk/WaylandVsyncSource.cpp +--- a/widget/gtk/WaylandVsyncSource.cpp ++++ b/widget/gtk/WaylandVsyncSource.cpp +@@ -139,28 +139,66 @@ + }, + this); + } + } + ++void WaylandVsyncSource::SetVSyncEventsLocked(const MutexAutoLock& aProofOfLock, ++ bool aEnabled) { ++ MOZ_DIAGNOSTIC_ASSERT(NS_IsMainThread()); ++ mMutex.AssertCurrentThreadOwns(); ++ if (aEnabled) { ++ mLastVsyncTimeStamp = TimeStamp::Now(); ++ } else { ++ MozClearHandleID(mHiddenWindowTimerID, g_source_remove); ++ } ++ mWaylandSurface->SetFrameCallbackState(aEnabled); ++} ++ ++void WaylandVsyncSource::EnableVsync() { ++ MOZ_DIAGNOSTIC_ASSERT(NS_IsMainThread()); ++ MutexAutoLock lock(mMutex); ++ LOG("WaylandVsyncSource::EnableVsync fps %f\n", GetFPS(mVsyncRate)); ++ if (mVsyncEnabled || mIsShutdown) { ++ LOG(" early quit"); ++ return; ++ } ++ mVsyncEnabled = true; ++ SetVSyncEventsLocked(lock, mVsyncEnabled && mVsyncSourceEnabled); ++} ++ ++void WaylandVsyncSource::DisableVsync() { ++ MOZ_DIAGNOSTIC_ASSERT(NS_IsMainThread()); ++ MutexAutoLock lock(mMutex); ++ LOG("WaylandVsyncSource::DisableVsync fps %f\n", GetFPS(mVsyncRate)); ++ if (!mVsyncEnabled || mIsShutdown) { ++ LOG(" early quit"); ++ return; ++ } ++ mVsyncEnabled = false; ++ SetVSyncEventsLocked(lock, mVsyncEnabled && mVsyncSourceEnabled); ++} ++ + void WaylandVsyncSource::EnableVSyncSource() { + MutexAutoLock lock(mMutex); + LOG("WaylandVsyncSource::EnableVSyncSource() WaylandSurface [%p] fps %f", + mWaylandSurface.get(), GetFPS(mVsyncRate)); + mVsyncSourceEnabled = true; + ++ MOZ_DIAGNOSTIC_ASSERT(NS_IsMainThread()); + MOZ_DIAGNOSTIC_ASSERT(mWaylandSurface); +- mWaylandSurface->SetFrameCallbackState(mVsyncEnabled && mVsyncSourceEnabled); ++ SetVSyncEventsLocked(lock, mVsyncEnabled && mVsyncSourceEnabled); + } + + void WaylandVsyncSource::DisableVSyncSource() { + MutexAutoLock lock(mMutex); + LOG("WaylandVsyncSource::DisableVSyncSource() WaylandSurface [%p]", + mWaylandSurface.get()); + mVsyncSourceEnabled = false; + ++ MOZ_DIAGNOSTIC_ASSERT(NS_IsMainThread()); + MOZ_DIAGNOSTIC_ASSERT(mWaylandSurface); +- mWaylandSurface->SetFrameCallbackState(mVsyncEnabled && mVsyncSourceEnabled); ++ SetVSyncEventsLocked(lock, mVsyncEnabled && mVsyncSourceEnabled); + } + + bool WaylandVsyncSource::HiddenWindowCallback() { + MOZ_DIAGNOSTIC_ASSERT(NS_IsMainThread()); + +@@ -299,33 +337,10 @@ + } + + LOG(" new fps %f correction %f\n", GetFPS(mVsyncRate), correction); + } + +-void WaylandVsyncSource::EnableVsync() { +- MOZ_ASSERT(NS_IsMainThread()); +- MutexAutoLock lock(mMutex); +- LOG("WaylandVsyncSource::EnableVsync fps %f\n", GetFPS(mVsyncRate)); +- if (mVsyncEnabled || mIsShutdown) { +- LOG(" early quit"); +- return; +- } +- mVsyncEnabled = true; +- mWaylandSurface->SetFrameCallbackState(mVsyncEnabled && mVsyncSourceEnabled); +-} +- +-void WaylandVsyncSource::DisableVsync() { +- MutexAutoLock lock(mMutex); +- LOG("WaylandVsyncSource::DisableVsync fps %f\n", GetFPS(mVsyncRate)); +- if (!mVsyncEnabled || mIsShutdown) { +- LOG(" early quit"); +- return; +- } +- mVsyncEnabled = false; +- mWaylandSurface->SetFrameCallbackState(mVsyncEnabled && mVsyncSourceEnabled); +-} +- + bool WaylandVsyncSource::IsVsyncEnabled() { + MutexAutoLock lock(mMutex); + return mVsyncEnabled && mWaylandSurface; + } + + diff --git a/firefox.spec b/firefox.spec index db39c6d..a9567d9 100644 --- a/firefox.spec +++ b/firefox.spec @@ -194,7 +194,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 137.0.2 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -278,6 +278,7 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch +Patch408: D244990.1744916693.diff # PGO/LTO patches Patch600: pgo.patch @@ -586,6 +587,7 @@ cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysr %patch -P402 -p1 -b .1196777 %patch -P407 -p1 -b .1667096 +%patch -P408 -p1 -b .D244990 # PGO patches %if %{build_with_pgo} @@ -1243,6 +1245,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Apr 16 2025 Martin Stransky - 137.0.2-2 +- Added fix for mzbz#1951249 + * Wed Apr 16 2025 Martin Stransky - 137.0.2-1 - Update 137.0.2 diff --git a/wasi.patch b/wasi.patch index 2fc4667..93e0420 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-137.0.1-build/firefox-137.0.1/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-137.0.2-build/firefox-137.0.2/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From f027bb52f41706fbc2875cc3eaa2f48c2226aa90 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 22 Apr 2025 11:55:06 +0200 Subject: [PATCH 458/545] Added fix for rhbz#2358565 --- firefox-gcc-15.0-s390.patch | 19 +++++++++++++++++++ firefox.spec | 7 ++++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 firefox-gcc-15.0-s390.patch diff --git a/firefox-gcc-15.0-s390.patch b/firefox-gcc-15.0-s390.patch new file mode 100644 index 0000000..9cf82fc --- /dev/null +++ b/firefox-gcc-15.0-s390.patch @@ -0,0 +1,19 @@ +diff -up firefox-137.0.2/toolkit/components/protobuf/src/google/protobuf/port_def.inc.s390 firefox-137.0.2/toolkit/components/protobuf/src/google/protobuf/port_def.inc +--- firefox-137.0.2/toolkit/components/protobuf/src/google/protobuf/port_def.inc.s390 2025-04-22 11:42:00.650759505 +0200 ++++ firefox-137.0.2/toolkit/components/protobuf/src/google/protobuf/port_def.inc 2025-04-22 11:46:02.522031338 +0200 +@@ -257,12 +257,14 @@ + #if __has_cpp_attribute(clang::musttail) && !defined(__arm__) && \ + !defined(_ARCH_PPC) && !defined(__wasm__) && \ + !(defined(_MSC_VER) && defined(_M_IX86)) && \ +- !(defined(__NDK_MAJOR__) && __NDK_MAJOR <= 24) ++ !(defined(__NDK_MAJOR__) && __NDK_MAJOR <= 24) && \ ++ !defined(__s390__) + # ifndef PROTO2_OPENSOURCE + // Compilation fails on ARM32: b/195943306 + // Compilation fails on powerpc64le: b/187985113 + // Compilation fails on X86 Windows: + // https://github.com/llvm/llvm-project/issues/53271 ++// Compilation fails on S390 for calls with more than 4 arguments + # endif + #define PROTOBUF_MUSTTAIL [[clang::musttail]] + #define PROTOBUF_TAILCALL true diff --git a/firefox.spec b/firefox.spec index a9567d9..a4027a2 100644 --- a/firefox.spec +++ b/firefox.spec @@ -194,7 +194,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 137.0.2 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -255,6 +255,7 @@ Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch78: firefox-i686-build.patch Patch79: firefox-gcc-13-build.patch Patch80: wasi.patch +Patch81: firefox-gcc-15.0-s390.patch # Test patches # Generate without context by @@ -567,6 +568,7 @@ This package contains results of tests executed during build. %patch -P71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 %patch -P78 -p1 -b .firefox-i686 %patch -P79 -p1 -b .firefox-gcc-13-build +%patch -P81 -p1 -b .firefox-gcc-15.0-s390 # We need to create the wasi.patch with the correct path to the wasm libclang_rt. %if %{with wasi_sdk} @@ -1245,6 +1247,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Apr 22 2025 Martin Stransky - 137.0.2-3 +- Added fix for rhbz#2358565 + * Wed Apr 16 2025 Martin Stransky - 137.0.2-2 - Added fix for mzbz#1951249 From 28b6b2d3aa55ff8d862a882366ddfda302836165 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 22 Apr 2025 13:25:42 +0200 Subject: [PATCH 459/545] Updated to 138.0 --- .gitignore | 2 ++ firefox.spec | 11 ++++++----- sources | 4 ++-- wasi.patch | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 724f2f3..e3fba33 100644 --- a/.gitignore +++ b/.gitignore @@ -698,3 +698,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-137.0-20250331.tar.xz /firefox-137.0.1.source.tar.xz /firefox-langpacks-137.0.1-20250414.tar.xz +/firefox-138.0.source.tar.xz +/firefox-langpacks-138.0-20250422.tar.xz diff --git a/firefox.spec b/firefox.spec index a4027a2..ebc1d77 100644 --- a/firefox.spec +++ b/firefox.spec @@ -193,14 +193,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 137.0.2 -Release: 3%{?pre_tag}%{?dist} +Version: 138.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250416.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250422.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -279,7 +279,6 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch -Patch408: D244990.1744916693.diff # PGO/LTO patches Patch600: pgo.patch @@ -589,7 +588,6 @@ cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysr %patch -P402 -p1 -b .1196777 %patch -P407 -p1 -b .1667096 -%patch -P408 -p1 -b .D244990 # PGO patches %if %{build_with_pgo} @@ -1247,6 +1245,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Apr 22 2025 Martin Stransky - 138.0-1 +- Updated to 138.0 + * Tue Apr 22 2025 Martin Stransky - 137.0.2-3 - Added fix for rhbz#2358565 diff --git a/sources b/sources index cca5c9d..bfeb4b5 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125 SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 -SHA512 (firefox-langpacks-137.0.2-20250416.tar.xz) = 23fda4ca1eefb7cc5c966276668c95c99e905da81f8dc314f36d0a8332803c21d6e12c1defc02d667b426716439cf51256e436a269ae0ae22c7d5b1b6faa733f -SHA512 (firefox-137.0.2.source.tar.xz) = 82140c4325233ea2e2f579088cebb98c0e8db8848b4018cff95d4ed42bf847049ed6520fc051d930ee267a5acb008908170825d381589da0d109ca04a61e1c24 +SHA512 (firefox-138.0.source.tar.xz) = 265eef505216f70d50ebb95a6b23983d0b70430320e7e2dcf497127890d7bbdff1c49c64790010c85b8e3fe0da5c90e95b2d44fb1adca64b1755428ccb2b91a2 +SHA512 (firefox-langpacks-138.0-20250422.tar.xz) = 3c5d9f3fa6717a766ee60b4e992f344a2d422d09225d68fd668fb96c5412e2f68e7dbcc7a92b49bf222c2fb3bde5847adb5110d89514df6dde15f15c79278d46 diff --git a/wasi.patch b/wasi.patch index 93e0420..2e07932 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-137.0.2-build/firefox-137.0.2/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-138.0-build/firefox-138.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From d06ba1cb582acf78d398f8280fc808aea07952e0 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 23 Apr 2025 13:45:08 +0200 Subject: [PATCH 460/545] Add HDR fix, update cbindgen --- D246394.1745494582.diff | 17 +++++++++++++++++ firefox.spec | 2 ++ gen_cbindgen-vendor.sh | 2 +- sources | 2 +- 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 D246394.1745494582.diff diff --git a/D246394.1745494582.diff b/D246394.1745494582.diff new file mode 100644 index 0000000..6505b3e --- /dev/null +++ b/D246394.1745494582.diff @@ -0,0 +1,17 @@ +diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml +--- a/modules/libpref/init/StaticPrefList.yaml ++++ b/modules/libpref/init/StaticPrefList.yaml +@@ -10564,11 +10564,11 @@ + rust: true + + # Is matching video-dynamic-range: high allowed? + - name: layout.css.video-dynamic-range.allows-high + type: RelaxedAtomicBool +-#if defined(XP_MACOSX) || defined(MOZ_WAYLAND) ++#if defined(XP_MACOSX) + value: true + #else + value: false + #endif + mirror: always + diff --git a/firefox.spec b/firefox.spec index ebc1d77..d5ec00f 100644 --- a/firefox.spec +++ b/firefox.spec @@ -279,6 +279,7 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch +Patch408: D246394.1745494582.diff # PGO/LTO patches Patch600: pgo.patch @@ -588,6 +589,7 @@ cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysr %patch -P402 -p1 -b .1196777 %patch -P407 -p1 -b .1667096 +%patch -P408 -p1 -b .D246394.1745494582 # PGO patches %if %{build_with_pgo} diff --git a/gen_cbindgen-vendor.sh b/gen_cbindgen-vendor.sh index 4e8aded..c131864 100755 --- a/gen_cbindgen-vendor.sh +++ b/gen_cbindgen-vendor.sh @@ -12,7 +12,7 @@ to be used with 'cargo vendor' commmand. """ [dependencies] -cbindgen = "0.26.0" +cbindgen = "0.28.0" [[bin]] name = "dummy" diff --git a/sources b/sources index bfeb4b5..f20131c 100644 --- a/sources +++ b/sources @@ -1,7 +1,7 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 -SHA512 (cbindgen-vendor.tar.xz) = f96541cddcad0fe67784de5d35a00841c561d9be5b6125c7811ce8dfd55645e7071b7b4da935391fb2ff76175ac7a38d1a878078a20f4d437946713fb9f8a23e SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (firefox-138.0.source.tar.xz) = 265eef505216f70d50ebb95a6b23983d0b70430320e7e2dcf497127890d7bbdff1c49c64790010c85b8e3fe0da5c90e95b2d44fb1adca64b1755428ccb2b91a2 SHA512 (firefox-langpacks-138.0-20250422.tar.xz) = 3c5d9f3fa6717a766ee60b4e992f344a2d422d09225d68fd668fb96c5412e2f68e7dbcc7a92b49bf222c2fb3bde5847adb5110d89514df6dde15f15c79278d46 +SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f From e99b0b9e6bff4986a778eedcfa59c115a90f165b Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 23 Apr 2025 14:48:10 +0200 Subject: [PATCH 461/545] Update llvm setup for Fedora 42+, NSS version up --- firefox.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index d5ec00f..05ce0e6 100644 --- a/firefox.spec +++ b/firefox.spec @@ -149,7 +149,7 @@ ExcludeArch: i686 %if %{?system_nss} %global nspr_version 4.32 %global nspr_build_version %{nspr_version} -%global nss_version 3.106 +%global nss_version 3.110 %global nss_build_version %{nss_version} %endif @@ -713,7 +713,11 @@ echo "ac_add_options --with-google-safebrowsing-api-keyfile=`pwd`/google-api-key # https://bugzilla.redhat.com/show_bug.cgi?id=2239046 # with clang 17 upstream's detection fails, so let's just tell it # where to look +%if 0%{?fedora} >= 42 +echo "ac_add_options --with-libclang-path=`llvm-config-20 --libdir`" >> .mozconfig +%else echo "ac_add_options --with-libclang-path=`llvm-config --libdir`" >> .mozconfig +%endif %if %{enable_replace_malloc} echo "ac_add_options --enable-replace-malloc" >> .mozconfig From 63cced6f158823aea20d8314c11c1976c8d730dc Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 28 Apr 2025 09:16:32 +0200 Subject: [PATCH 462/545] Build fix --- firefox.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 05ce0e6..eac2cb8 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1202,7 +1202,6 @@ fi %license %{mozappdir}/LICENSE %{mozappdir}/browser/chrome %{mozappdir}/browser/defaults/preferences/firefox-redhat-default-prefs.js -%{mozappdir}/browser/features/*.xpi %{mozappdir}/distribution/distribution.ini # That's Windows only %ghost %{mozappdir}/browser/features/aushelper@mozilla.org.xpi From 9547d5f181c97f19f31268a1216d52c3de3b7a61 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 29 Apr 2025 00:12:57 +0200 Subject: [PATCH 463/545] build fixed by Bojan Smojver --- firefox-mach-D1957628.diff | 89 ++++++++++++++++++++++++++++++++++++++ firefox.spec | 6 +++ 2 files changed, 95 insertions(+) create mode 100644 firefox-mach-D1957628.diff diff --git a/firefox-mach-D1957628.diff b/firefox-mach-D1957628.diff new file mode 100644 index 0000000..9c8be57 --- /dev/null +++ b/firefox-mach-D1957628.diff @@ -0,0 +1,89 @@ + +# HG changeset patch +# User ahochheiden +# Date 1743556649 0 +# Node ID c0faed343035719b07164a465d6f03de5cc6e25b +# Parent 656945d1a18403ec3800cf3d75f7f266a72798eb +Bug 1957628 - Fix 'optional pip install' breakage while maintaining enhanced error output for 'non-optional pip install' r=firefox-build-system-reviewers,sergesanspaille + +Differential Revision: https://phabricator.services.mozilla.com/D243902 + +diff --git a/python/mach/mach/site.py b/python/mach/mach/site.py +--- a/python/mach/mach/site.py ++++ b/python/mach/mach/site.py +@@ -715,19 +715,19 @@ class CommandSiteManager: + if not os.path.isabs(path): + path = os.path.join(self._topsrcdir, path) + + args = ["--requirement", path] + + if require_hashes: + args.append("--require-hashes") + +- install_result = self._virtualenv.pip_install(args) +- +- if install_result.returncode: ++ try: ++ install_result = self._virtualenv.pip_install(args) ++ except subprocess.CalledProcessError: + raise InstallPipRequirementsException( + f'Failed to install "{path}" into the "{self._site_name}" site.' + ) + + check_result = subprocess.run( + pip_command(python_executable=self.python_path, subcommand="check"), + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, +@@ -1042,36 +1042,42 @@ class PythonVirtualenv: + install_result = subprocess.run( + pip_command( + python_executable=self.python_path, + subcommand="install", + args=pip_install_args, + ), + **kwargs, + ) +- return install_result + except subprocess.CalledProcessError as cpe: + if not self._quiet: ++ # We print the stdout/stderr on a failed install here so that we don't ++ # need to do it for every code path. We still raise the CalledProcessError ++ # afterward so that the different paths can do their own handling. + if cpe.stdout: + print(cpe.stdout) + if cpe.stderr: + print(cpe.stderr, file=sys.stderr) +- sys.exit(1) ++ raise cpe ++ ++ # On one code path we do a 'pip check', and if that fails, having the stdout ++ # of the 'pip install' is helpful for debugging, so we pass it along here so ++ # that we can print later if we hit that scenario. ++ return install_result + + def install_optional_packages(self, optional_requirements): + for requirement in optional_requirements: + try: + self.pip_install_with_constraints([str(requirement.requirement)]) +- except subprocess.CalledProcessError as error: +- print( +- f"{error.output if error.output else ''}" +- f"{error.stderr if error.stderr else ''}" +- f"Could not install {requirement.requirement.name}, so " +- f"{requirement.repercussion}. Continuing." +- ) ++ except subprocess.CalledProcessError: ++ if not self._quiet: ++ print( ++ f"Could not install {requirement.requirement.name}, so " ++ f"{requirement.repercussion}. Continuing." ++ ) + + def _resolve_installed_packages(self): + return _resolve_installed_packages(self.python_path) + + + class RequirementsValidationResult: + def __init__(self): + self._package_discrepancies = [] + diff --git a/firefox.spec b/firefox.spec index eac2cb8..dcb4209 100644 --- a/firefox.spec +++ b/firefox.spec @@ -256,6 +256,7 @@ Patch78: firefox-i686-build.patch Patch79: firefox-gcc-13-build.patch Patch80: wasi.patch Patch81: firefox-gcc-15.0-s390.patch +Patch82: firefox-mach-D1957628.diff # Test patches # Generate without context by @@ -569,6 +570,7 @@ This package contains results of tests executed during build. %patch -P78 -p1 -b .firefox-i686 %patch -P79 -p1 -b .firefox-gcc-13-build %patch -P81 -p1 -b .firefox-gcc-15.0-s390 +%patch -P82 -p1 -b .firefox-mach-D1957628 # We need to create the wasi.patch with the correct path to the wasm libclang_rt. %if %{with wasi_sdk} @@ -1250,6 +1252,10 @@ fi #--------------------------------------------------------------------- %changelog +* Sat Apr 26 2025 Bojan Smojver - 138.0-1 +- Add fix for mzbz#1957628 +- Remove browser/features/*.xpi files, no longer shipped + * Tue Apr 22 2025 Martin Stransky - 138.0-1 - Updated to 138.0 From f09793d1a4bb426f78a9772b95cad3b867d8bc90 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 1 May 2025 20:04:45 +0200 Subject: [PATCH 464/545] Updated to 138.0.1 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- wasi.patch | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index e3fba33..a571cc0 100644 --- a/.gitignore +++ b/.gitignore @@ -700,3 +700,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-137.0.1-20250414.tar.xz /firefox-138.0.source.tar.xz /firefox-langpacks-138.0-20250422.tar.xz +/firefox-langpacks-138.0.1-20250501.tar.xz +/firefox-138.0.1.source.tar.xz diff --git a/firefox.spec b/firefox.spec index dcb4209..6152dc6 100644 --- a/firefox.spec +++ b/firefox.spec @@ -193,14 +193,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 138.0 +Version: 138.0.1 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250422.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250501.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1252,6 +1252,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu May 1 2025 Martin Stransky - 138.0.1-1 +- Updated to 138.0.1 + * Sat Apr 26 2025 Bojan Smojver - 138.0-1 - Add fix for mzbz#1957628 - Remove browser/features/*.xpi files, no longer shipped diff --git a/sources b/sources index f20131c..4f2483e 100644 --- a/sources +++ b/sources @@ -2,6 +2,6 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 -SHA512 (firefox-138.0.source.tar.xz) = 265eef505216f70d50ebb95a6b23983d0b70430320e7e2dcf497127890d7bbdff1c49c64790010c85b8e3fe0da5c90e95b2d44fb1adca64b1755428ccb2b91a2 -SHA512 (firefox-langpacks-138.0-20250422.tar.xz) = 3c5d9f3fa6717a766ee60b4e992f344a2d422d09225d68fd668fb96c5412e2f68e7dbcc7a92b49bf222c2fb3bde5847adb5110d89514df6dde15f15c79278d46 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f +SHA512 (firefox-langpacks-138.0.1-20250501.tar.xz) = a86313e95d5ef753f2349baf2eb5d10926d0b0988ba81586af660901b6a19761a97aa37ebf82da6a0f5dae80bd710afd280b58a86f56ffb19b236df8e2046eaa +SHA512 (firefox-138.0.1.source.tar.xz) = bc5a8d658140c4c3db29d51134c97105a0225567d5ce14757f69594066bf6a44a13e0626cebde2b7a078bac128a14690ee06083d0306d7789de2a5e9d8394b23 diff --git a/wasi.patch b/wasi.patch index 2e07932..f2e4c71 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-138.0-build/firefox-138.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-138.0.1-build/firefox-138.0.1/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 69bd5c304a25bf2a7d96e1fb0afc98ac62484789 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 12 May 2025 21:08:55 +0200 Subject: [PATCH 465/545] Updated to 138.0.3 --- .gitignore | 2 ++ D246394.1745494582.diff | 17 ----------------- firefox.spec | 9 +++++---- sources | 4 ++-- wasi.patch | 2 +- 5 files changed, 10 insertions(+), 24 deletions(-) delete mode 100644 D246394.1745494582.diff diff --git a/.gitignore b/.gitignore index a571cc0..e20be7c 100644 --- a/.gitignore +++ b/.gitignore @@ -702,3 +702,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-138.0-20250422.tar.xz /firefox-langpacks-138.0.1-20250501.tar.xz /firefox-138.0.1.source.tar.xz +/firefox-138.0.3.source.tar.xz +/firefox-langpacks-138.0.3-20250512.tar.xz diff --git a/D246394.1745494582.diff b/D246394.1745494582.diff deleted file mode 100644 index 6505b3e..0000000 --- a/D246394.1745494582.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml ---- a/modules/libpref/init/StaticPrefList.yaml -+++ b/modules/libpref/init/StaticPrefList.yaml -@@ -10564,11 +10564,11 @@ - rust: true - - # Is matching video-dynamic-range: high allowed? - - name: layout.css.video-dynamic-range.allows-high - type: RelaxedAtomicBool --#if defined(XP_MACOSX) || defined(MOZ_WAYLAND) -+#if defined(XP_MACOSX) - value: true - #else - value: false - #endif - mirror: always - diff --git a/firefox.spec b/firefox.spec index 6152dc6..7e03db0 100644 --- a/firefox.spec +++ b/firefox.spec @@ -193,14 +193,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 138.0.1 +Version: 138.0.3 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250501.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250512.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -280,7 +280,6 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch -Patch408: D246394.1745494582.diff # PGO/LTO patches Patch600: pgo.patch @@ -591,7 +590,6 @@ cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysr %patch -P402 -p1 -b .1196777 %patch -P407 -p1 -b .1667096 -%patch -P408 -p1 -b .D246394.1745494582 # PGO patches %if %{build_with_pgo} @@ -1252,6 +1250,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon May 12 2025 Martin Stransky - 138.0.3-1 +- Updated to 138.0.3 + * Thu May 1 2025 Martin Stransky - 138.0.1-1 - Updated to 138.0.1 diff --git a/sources b/sources index 4f2483e..17988a3 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-langpacks-138.0.1-20250501.tar.xz) = a86313e95d5ef753f2349baf2eb5d10926d0b0988ba81586af660901b6a19761a97aa37ebf82da6a0f5dae80bd710afd280b58a86f56ffb19b236df8e2046eaa -SHA512 (firefox-138.0.1.source.tar.xz) = bc5a8d658140c4c3db29d51134c97105a0225567d5ce14757f69594066bf6a44a13e0626cebde2b7a078bac128a14690ee06083d0306d7789de2a5e9d8394b23 +SHA512 (firefox-138.0.3.source.tar.xz) = 0f1c8ee05bec465b55429c18d788856574c5b2e31d911f15f76d31c00de84d8b8681961799c4101cd1540bd228afd201a4b59fd7c9a88918695040965b9dc0f1 +SHA512 (firefox-langpacks-138.0.3-20250512.tar.xz) = 4c3b2d2ac9b0003bfb63610c1b3c2e21e043ea86778b115737414f014c86c7f963eb634d387eb97fee02e26f3b8bb378132fa33baaf3580f7b0c77bb635d7be0 diff --git a/wasi.patch b/wasi.patch index f2e4c71..f089570 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-138.0.1-build/firefox-138.0.1/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-138.0.3-build/firefox-138.0.3/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 968cc7c29e52741067add78eb63b2bf25eeb0f67 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 14 May 2025 10:24:15 +0200 Subject: [PATCH 466/545] Fixed rhbz#2283790 --- firefox.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 7e03db0..133d40a 100644 --- a/firefox.spec +++ b/firefox.spec @@ -194,7 +194,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 138.0.3 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -1200,6 +1200,7 @@ fi %{_datadir}/metainfo/*.appdata.xml %dir %{mozappdir} %license %{mozappdir}/LICENSE +%{mozappdir}/browser %{mozappdir}/browser/chrome %{mozappdir}/browser/defaults/preferences/firefox-redhat-default-prefs.js %{mozappdir}/distribution/distribution.ini @@ -1250,6 +1251,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed May 14 2025 Martin Stransky - 138.0.3-2 +- Fixed rhbz#2283790 + * Mon May 12 2025 Martin Stransky - 138.0.3-1 - Updated to 138.0.3 From f07dadb0c28016c9cefa009cb2573823bfa7948b Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 19 May 2025 12:09:12 +0200 Subject: [PATCH 467/545] Updated to 138.0.4 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index e20be7c..8d39ede 100644 --- a/.gitignore +++ b/.gitignore @@ -704,3 +704,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-138.0.1.source.tar.xz /firefox-138.0.3.source.tar.xz /firefox-langpacks-138.0.3-20250512.tar.xz +/firefox-langpacks-138.0.4-20250519.tar.xz +/firefox-138.0.4.source.tar.xz diff --git a/firefox.spec b/firefox.spec index 133d40a..4b9eb47 100644 --- a/firefox.spec +++ b/firefox.spec @@ -193,14 +193,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 138.0.3 -Release: 2%{?pre_tag}%{?dist} +Version: 138.0.4 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250512.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250519.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1251,6 +1251,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon May 19 2025 Martin Stransky - 138.0.4-1 +- Updated to 138.0.4 + * Wed May 14 2025 Martin Stransky - 138.0.3-2 - Fixed rhbz#2283790 diff --git a/sources b/sources index 17988a3..9738bf0 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-138.0.3.source.tar.xz) = 0f1c8ee05bec465b55429c18d788856574c5b2e31d911f15f76d31c00de84d8b8681961799c4101cd1540bd228afd201a4b59fd7c9a88918695040965b9dc0f1 -SHA512 (firefox-langpacks-138.0.3-20250512.tar.xz) = 4c3b2d2ac9b0003bfb63610c1b3c2e21e043ea86778b115737414f014c86c7f963eb634d387eb97fee02e26f3b8bb378132fa33baaf3580f7b0c77bb635d7be0 +SHA512 (firefox-langpacks-138.0.4-20250519.tar.xz) = 2ac0c5a8a5b4521edfe6af9d721c32bff03541c5b09cc410ce56ab5fba2474756f1c885bb9e81c857925c91d2462ef03c6952ff7bf60902ed5a8e4261e360d50 +SHA512 (firefox-138.0.4.source.tar.xz) = 64d80456da8df27d7eeed7eb20c35fcf213bc948eb48739b6101e2c476ea9a9133da928477a79683c96c160f8d53bed52be487f01a8d29e38d39071f12676806 From 5c006a337eb506fbd9cdc1889cc172eaedf567a6 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 27 May 2025 11:30:44 +0200 Subject: [PATCH 468/545] Updated to 139.0 --- .gitignore | 2 ++ firefox.spec | 9 +++++---- sources | 4 ++-- wasi.patch | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 8d39ede..d2aab7a 100644 --- a/.gitignore +++ b/.gitignore @@ -706,3 +706,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-138.0.3-20250512.tar.xz /firefox-langpacks-138.0.4-20250519.tar.xz /firefox-138.0.4.source.tar.xz +/firefox-139.0.source.tar.xz +/firefox-langpacks-139.0-20250527.tar.xz diff --git a/firefox.spec b/firefox.spec index 4b9eb47..c6591b3 100644 --- a/firefox.spec +++ b/firefox.spec @@ -193,14 +193,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 138.0.4 +Version: 139.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250519.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250527.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -256,7 +256,6 @@ Patch78: firefox-i686-build.patch Patch79: firefox-gcc-13-build.patch Patch80: wasi.patch Patch81: firefox-gcc-15.0-s390.patch -Patch82: firefox-mach-D1957628.diff # Test patches # Generate without context by @@ -569,7 +568,6 @@ This package contains results of tests executed during build. %patch -P78 -p1 -b .firefox-i686 %patch -P79 -p1 -b .firefox-gcc-13-build %patch -P81 -p1 -b .firefox-gcc-15.0-s390 -%patch -P82 -p1 -b .firefox-mach-D1957628 # We need to create the wasi.patch with the correct path to the wasm libclang_rt. %if %{with wasi_sdk} @@ -1251,6 +1249,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue May 27 2025 Martin Stransky - 139.0-1 +- Updated to 139.0 + * Mon May 19 2025 Martin Stransky - 138.0.4-1 - Updated to 138.0.4 diff --git a/sources b/sources index 9738bf0..cd62be9 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-langpacks-138.0.4-20250519.tar.xz) = 2ac0c5a8a5b4521edfe6af9d721c32bff03541c5b09cc410ce56ab5fba2474756f1c885bb9e81c857925c91d2462ef03c6952ff7bf60902ed5a8e4261e360d50 -SHA512 (firefox-138.0.4.source.tar.xz) = 64d80456da8df27d7eeed7eb20c35fcf213bc948eb48739b6101e2c476ea9a9133da928477a79683c96c160f8d53bed52be487f01a8d29e38d39071f12676806 +SHA512 (firefox-139.0.source.tar.xz) = 84a2b47f2ff71aac226a774ab0ac9ab8d9a16f5620a06f7abb6648732209d022aef35a9d4873e91ebd67a4fc494fc238524e25c38fad8046db26afda06e6f970 +SHA512 (firefox-langpacks-139.0-20250527.tar.xz) = 4eb200ecd6a2edd655584698f82fef60e6b723feecddc312207cd79d4ca80fbdec9f5a0641c440bd625241a63d438e3be9a5b756700c63d4c5b9f3036e193125 diff --git a/wasi.patch b/wasi.patch index f089570..3a2ba05 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-138.0.3-build/firefox-138.0.3/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-139.0-build/firefox-139.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 0b8ab68f727033e1bec77770374d2a99ac96f969 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 27 May 2025 11:32:31 +0200 Subject: [PATCH 469/545] Removed unused patch --- firefox-mach-D1957628.diff | 89 -------------------------------------- 1 file changed, 89 deletions(-) delete mode 100644 firefox-mach-D1957628.diff diff --git a/firefox-mach-D1957628.diff b/firefox-mach-D1957628.diff deleted file mode 100644 index 9c8be57..0000000 --- a/firefox-mach-D1957628.diff +++ /dev/null @@ -1,89 +0,0 @@ - -# HG changeset patch -# User ahochheiden -# Date 1743556649 0 -# Node ID c0faed343035719b07164a465d6f03de5cc6e25b -# Parent 656945d1a18403ec3800cf3d75f7f266a72798eb -Bug 1957628 - Fix 'optional pip install' breakage while maintaining enhanced error output for 'non-optional pip install' r=firefox-build-system-reviewers,sergesanspaille - -Differential Revision: https://phabricator.services.mozilla.com/D243902 - -diff --git a/python/mach/mach/site.py b/python/mach/mach/site.py ---- a/python/mach/mach/site.py -+++ b/python/mach/mach/site.py -@@ -715,19 +715,19 @@ class CommandSiteManager: - if not os.path.isabs(path): - path = os.path.join(self._topsrcdir, path) - - args = ["--requirement", path] - - if require_hashes: - args.append("--require-hashes") - -- install_result = self._virtualenv.pip_install(args) -- -- if install_result.returncode: -+ try: -+ install_result = self._virtualenv.pip_install(args) -+ except subprocess.CalledProcessError: - raise InstallPipRequirementsException( - f'Failed to install "{path}" into the "{self._site_name}" site.' - ) - - check_result = subprocess.run( - pip_command(python_executable=self.python_path, subcommand="check"), - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, -@@ -1042,36 +1042,42 @@ class PythonVirtualenv: - install_result = subprocess.run( - pip_command( - python_executable=self.python_path, - subcommand="install", - args=pip_install_args, - ), - **kwargs, - ) -- return install_result - except subprocess.CalledProcessError as cpe: - if not self._quiet: -+ # We print the stdout/stderr on a failed install here so that we don't -+ # need to do it for every code path. We still raise the CalledProcessError -+ # afterward so that the different paths can do their own handling. - if cpe.stdout: - print(cpe.stdout) - if cpe.stderr: - print(cpe.stderr, file=sys.stderr) -- sys.exit(1) -+ raise cpe -+ -+ # On one code path we do a 'pip check', and if that fails, having the stdout -+ # of the 'pip install' is helpful for debugging, so we pass it along here so -+ # that we can print later if we hit that scenario. -+ return install_result - - def install_optional_packages(self, optional_requirements): - for requirement in optional_requirements: - try: - self.pip_install_with_constraints([str(requirement.requirement)]) -- except subprocess.CalledProcessError as error: -- print( -- f"{error.output if error.output else ''}" -- f"{error.stderr if error.stderr else ''}" -- f"Could not install {requirement.requirement.name}, so " -- f"{requirement.repercussion}. Continuing." -- ) -+ except subprocess.CalledProcessError: -+ if not self._quiet: -+ print( -+ f"Could not install {requirement.requirement.name}, so " -+ f"{requirement.repercussion}. Continuing." -+ ) - - def _resolve_installed_packages(self): - return _resolve_installed_packages(self.python_path) - - - class RequirementsValidationResult: - def __init__(self): - self._package_discrepancies = [] - From 4943887c79d592dd783487ca704f1fa739c2d925 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 27 May 2025 21:37:02 +0200 Subject: [PATCH 470/545] Build fixed, thanks to Bojan Smojver --- firefox.spec | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/firefox.spec b/firefox.spec index c6591b3..faef5e6 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1199,9 +1199,7 @@ fi %dir %{mozappdir} %license %{mozappdir}/LICENSE %{mozappdir}/browser -%{mozappdir}/browser/chrome -%{mozappdir}/browser/defaults/preferences/firefox-redhat-default-prefs.js -%{mozappdir}/distribution/distribution.ini +%{mozappdir}/distribution # That's Windows only %ghost %{mozappdir}/browser/features/aushelper@mozilla.org.xpi %if %{without langpacks_subpkg} @@ -1209,7 +1207,6 @@ fi %dir %{langpackdir} %endif %endif -%{mozappdir}/browser/omni.ja %{mozappdir}/application.ini %{mozappdir}/pingsender %exclude %{mozappdir}/removed-files @@ -1226,6 +1223,7 @@ fi %{_datadir}/icons/hicolor/symbolic/apps/firefox-symbolic.svg %if %{enable_mozilla_crashreporter} %{mozappdir}/crashreporter +%{mozappdir}/crashhelper %endif %{mozappdir}/*.so %{mozappdir}/defaults/pref/channel-prefs.js @@ -1234,7 +1232,7 @@ fi %{mozappdir}/omni.ja %{mozappdir}/platform.ini %{mozappdir}/gmp-clearkey -%{mozappdir}/fonts/TwemojiMozilla.ttf +%{mozappdir}/fonts %ifarch aarch64 riscv64 %{mozappdir}/v4l2test %endif From e87a3826bc2651cd1ba19aa845bd6268a18361c0 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Wed, 28 May 2025 12:01:28 +0200 Subject: [PATCH 471/545] Disable wasi sdk on s390x due to unsupported configuration --- firefox.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index faef5e6..095f3d9 100644 --- a/firefox.spec +++ b/firefox.spec @@ -44,9 +44,13 @@ ExcludeArch: i686 # wasi_sdk 25 is not compatible with llvm 18 %if 0%{?fedora} <= 40 -%bcond wasi_sdk 0 + %bcond wasi_sdk 0 %else -%bcond wasi_sdk 1 + %ifarch s390x + %bcond wasi_sdk 0 + %else + %bcond wasi_sdk 1 + %endif %endif %bcond build_with_clang 0 From 10619cea11eadd3f78d27a247f0e3087bbb08be9 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Fri, 30 May 2025 13:52:11 +0200 Subject: [PATCH 472/545] Use system libraries for drm/gbm/pipewire --- firefox.spec | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 095f3d9..b0b25e7 100644 --- a/firefox.spec +++ b/firefox.spec @@ -89,6 +89,9 @@ ExcludeArch: i686 %global system_jpeg 1 %global system_pixman 1 %global system_webp 1 +%global system_drm 1 +%global system_gbm 1 +%global system_pipewire 1 # Bundled cbindgen makes build slow. # Enable only if system cbindgen is not available. %if 0%{?rhel} @@ -198,7 +201,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 139.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -342,7 +345,17 @@ BuildRequires: clang-libs BuildRequires: lld %endif +%if %{?system_drm} +BuildRequires: libdrm-devel +%endif + +%if %{?system_gbm} +BuildRequires: mesa-libgbm-devel +%endif + +%if %{?system_pipewire} BuildRequires: pipewire-devel +%endif %if !0%{?use_bundled_cbindgen} BuildRequires: cbindgen @@ -697,6 +710,24 @@ echo "ac_add_options --with-system-webp" >> .mozconfig echo "ac_add_options --without-system-webp" >> .mozconfig %endif +%if %{?system_drm} +echo "ac_add_options --with-system-libdrm" >> .mozconfig +%else +echo "ac_add_options --without-system-libdrm" >> .mozconfig +%endif + +%if %{?system_gbm} +echo "ac_add_options --with-system-gbm" >> .mozconfig +%else +echo "ac_add_options --without-system-gbm" >> .mozconfig +%endif + +%if %{?system_pipewire} +echo "ac_add_options --with-system-pipewire" >> .mozconfig +%else +echo "ac_add_options --without-system-pipewire" >> .mozconfig +%endif + %ifarch s390x echo "ac_add_options --disable-jit" >> .mozconfig %endif @@ -1251,6 +1282,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri May 30 2025 Jan Grulich - 139.0-2 +- Use system libraries for drm/gbm/pipewire + * Tue May 27 2025 Martin Stransky - 139.0-1 - Updated to 139.0 From a5c1b68cbb60c38a2ebb721b051e2d83d0ff5102 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 6 Jun 2025 08:31:30 +0200 Subject: [PATCH 473/545] Updated desktop file translation (rhbz#2362155) --- firefox.desktop | 855 ++++++++++++++++++++++++++++++++++++++++-------- firefox.spec | 5 +- 2 files changed, 715 insertions(+), 145 deletions(-) diff --git a/firefox.desktop b/firefox.desktop index 566c8d9..bd09aa8 100644 --- a/firefox.desktop +++ b/firefox.desktop @@ -1,47 +1,520 @@ [Desktop Entry] Version=1.0 Name=Firefox -GenericName=Web Browser -GenericName[ca]=Navegador web -GenericName[cs]=Webový prohlížeč -GenericName[es]=Navegador web -GenericName[fa]=مرورگر اینترنتی -GenericName[fi]=WWW-selain -GenericName[fr]=Navigateur Web -GenericName[hu]=Webböngésző -GenericName[it]=Browser Web -GenericName[ja]=ウェブ・ブラウザ -GenericName[ko]=웹 브라우저 -GenericName[nb]=Nettleser -GenericName[nl]=Webbrowser -GenericName[nn]=Nettlesar -GenericName[no]=Nettleser -GenericName[pl]=Przeglądarka WWW -GenericName[pt]=Navegador Web -GenericName[pt_BR]=Navegador Web -GenericName[sk]=Internetový prehliadač -GenericName[sv]=Webbläsare -Comment=Browse the Web -Comment[ca]=Navegueu per el web +Name[ach]=Firefox +Name[af]=Firefox +Name[an]=Firefox +Name[ar]=Firefox +Name[ast]=Firefox +Name[az]=Firefox +Name[be]=Firefox +Name[bg]=Firefox +Name[bn]=Firefox +Name[br]=Firefox +Name[bs]=Firefox +Name[ca]=Firefox +Name[ca_valencia]=Firefox +Name[cak]=Firefox +Name[cs]=Firefox +Name[cy]=Firefox +Name[da]=Firefox +Name[de]=Firefox +Name[dsb]=Firefox +Name[el]=Firefox +Name[en_CA]=Firefox +Name[en_GB]=Firefox +Name[eo]=Firefox +Name[es_AR]=Firefox +Name[es_CL]=Firefox +Name[es_ES]=Firefox +Name[es_MX]=Firefox +Name[et]=Firefox +Name[eu]=Firefox +Name[fa]=Firefox +Name[ff]=Firefox +Name[fi]=Firefox +Name[fr]=Firefox +Name[fur]=Firefox +Name[fy_NL]=Firefox +Name[ga_IE]=Firefox +Name[gd]=Firefox +Name[gl]=Firefox +Name[gn]=Firefox +Name[gu_IN]=Firefox +Name[he]=Firefox +Name[hi_IN]=Firefox +Name[hr]=Firefox +Name[hsb]=Firefox +Name[hu]=Firefox +Name[hy_AM]=Firefox +Name[ia]=Firefox +Name[id]=Firefox +Name[is]=Firefox +Name[it]=Firefox +Name[ja]=Firefox +Name[ka]=Firefox +Name[kab]=Firefox +Name[kk]=Firefox +Name[km]=Firefox +Name[kn]=Firefox +Name[ko]=Firefox +Name[lij]=Firefox +Name[lt]=Firefox +Name[lv]=Firefox +Name[mk]=Firefox +Name[mr]=Firefox +Name[ms]=Firefox +Name[my]=Firefox +Name[nb_NO]=Firefox +Name[ne_NP]=Firefox +Name[nl]=Firefox +Name[nn_NO]=Firefox +Name[oc]=Firefox +Name[pa_IN]=Firefox +Name[pl]=Firefox +Name[pt_BR]=Firefox +Name[pt_PT]=Firefox +Name[rm]=Firefox +Name[ro]=Firefox +Name[ru]=Firefox +Name[sat]=Firefox +Name[sc]=Firefox +Name[sco]=Firefox +Name[si]=Firefox +Name[sk]=Firefox +Name[skr]=Firefox +Name[sl]=Firefox +Name[son]=Firefox +Name[sq]=Firefox +Name[sr]=Firefox +Name[sv_SE]=Firefox +Name[szl]=Firefox +Name[ta]=Firefox +Name[te]=Firefox +Name[tg]=Firefox +Name[th]=Firefox +Name[tl]=Firefox +Name[tr]=Firefox +Name[trs]=Firefox +Name[uk]=Firefox +Name[ur]=Firefox +Name[uz]=Firefox +Name[vi]=Firefox +Name[xh]=Firefox +Name[zh_CN]=Firefox +Name[zh_TW]=Firefox +Comment=Browse the World Wide Web +Comment[ach]=Browse the World Wide Web +Comment[af]=Browse the World Wide Web +Comment[an]=Browse the World Wide Web +Comment[ar]=تصفح شبكة الوِب العالمية +Comment[ast]=Browse the World Wide Web +Comment[az]=Browse the World Wide Web +Comment[be]=Аглядайце Сеціва +Comment[bg]=Разгледайте световната мрежа +Comment[bn]=ওয়ার্ল্ড ওয়াইড ওয়েব ব্রাউজ করুন +Comment[br]=Ergerzhout ar World Wide Web +Comment[bs]=Pretražujte World Wide Web +Comment[ca]=Navegeu pel Web +Comment[ca_valencia]=Browse the World Wide Web +Comment[cak]=Tok chupam Word Wide Web Comment[cs]=Prohlížení stránek World Wide Webu +Comment[cy]=Pori'r We Fyd Eang +Comment[da]=Brug internettet Comment[de]=Im Internet surfen -Comment[es]=Navegue por la web -Comment[fa]=صفحات شبکه جهانی اینترنت را مرور نمایید -Comment[fi]=Selaa Internetin WWW-sivuja -Comment[fr]=Navigue sur Internet -Comment[hu]=A világháló böngészése -Comment[it]=Esplora il web -Comment[ja]=ウェブを閲覧します -Comment[ko]=웹을 돌아 다닙니다 -Comment[nb]=Surf på nettet -Comment[nl]=Verken het internet -Comment[nn]=Surf på nettet -Comment[no]=Surf på nettet -Comment[pl]=Przeglądanie stron WWW -Comment[pt]=Navegue na Internet -Comment[pt_BR]=Navegue na Internet -Comment[sk]=Prehliadanie internetu -Comment[sv]=Surfa på webben +Comment[dsb]=Pśeglědajśo World Wide Web +Comment[el]=Περιηγηθείτε στον παγκόσμιο ιστό +Comment[en_CA]=Browse the World Wide Web +Comment[en_GB]=Browse the World Wide Web +Comment[eo]=Retumi en la reto +Comment[es_AR]=Navegar la World Wide Web +Comment[es_CL]=Navegar por la World Wide Web +Comment[es_ES]=Navegar por la web +Comment[es_MX]=Navegar por la web +Comment[et]=Browse the World Wide Web +Comment[eu]=Arakatu World Wide Web-a +Comment[fa]=Browse the World Wide Web +Comment[ff]=Browse the World Wide Web +Comment[fi]=Selaa Internetiä +Comment[fr]=Naviguer sur le Web +Comment[fur]=Navighe sul Web +Comment[fy_NL]=Navigearje op it wrâldwide web +Comment[ga_IE]=Browse the World Wide Web +Comment[gd]=Rùraich lìon na cruinne +Comment[gl]=Navegar pola World Wide Web +Comment[gn]=Eikundaha World Wide Web rupi +Comment[gu_IN]=Browse the World Wide Web +Comment[he]=גלישה באינטרנט +Comment[hi_IN]=Browse the World Wide Web +Comment[hr]=Pregledaj World Wide Web +Comment[hsb]=Přehladajće World Wide Web +Comment[hu]=Böngésszen a világhálón +Comment[hy_AM]=Զննի՛ր համաշխարհային սարդոստայնը +Comment[ia]=Navigar sur le Web +Comment[id]=Jelajahi World Wide Web +Comment[is]=Vafraðu um veraldarvefinn +Comment[it]=Naviga sul Web +Comment[ja]=World Wide Web をブラウジング +Comment[ka]=მსოფლიო ქსელთან წვდომა +Comment[kab]=Inig deg Web +Comment[kk]=Ғаламторды шолу +Comment[km]=Browse the World Wide Web +Comment[kn]=Browse the World Wide Web +Comment[ko]=월드 와이드 웹 탐색 +Comment[lij]=Browse the World Wide Web +Comment[lt]=Browse the World Wide Web +Comment[lv]=Pārlūkojiet globālo tīmekli +Comment[mk]=Browse the World Wide Web +Comment[mr]=Browse the World Wide Web +Comment[ms]=Browse the World Wide Web +Comment[my]=Browse the World Wide Web +Comment[nb_NO]=Surf på nettet +Comment[ne_NP]=वर्ल्ड वाइड वेब ब्राउज गर्नुहोस् +Comment[nl]=Navigeren op het wereldwijde web +Comment[nn_NO]=Surf på nettet +Comment[oc]=Navegar pel Web +Comment[pa_IN]=ਵਰਲਡ ਵਾਈਡ ਵੈੱਬ ਬਰਾਊਜ਼ਰ ਕਰੋ +Comment[pl]=Przeglądaj Internet +Comment[pt_BR]=Navegue na World Wide Web +Comment[pt_PT]=Navegar na Internet +Comment[rm]=Navigar en il web +Comment[ro]=Browse the World Wide Web +Comment[ru]=Доступ в Интернет +Comment[sat]=World Wide Web ᱠᱷᱩᱞᱟᱹᱭ ᱢᱮ +Comment[sc]=Nàviga su Web +Comment[sco]=Browse the World Wide Web +Comment[si]=ලෝක ව්‍යාප්ත වියමන පිරික්සන්න +Comment[sk]=Prehľadávať web (www) +Comment[skr]=ورلڈ وائیڈ ویب براؤز کرو +Comment[sl]=Brskanje po svetovnem spletu +Comment[son]=Browse the World Wide Web +Comment[sq]=Shfletoni në World Wide Web +Comment[sr]=Истражите интернет +Comment[sv_SE]=Surfa på webben +Comment[szl]=Browse the World Wide Web +Comment[ta]=Browse the World Wide Web +Comment[te]=ప్రపంచ వ్యాప్త జాలంలో విహరించండి +Comment[tg]=Ба шабакаи ҷаҳонии Интернет дастрасӣ пайдо намоед +Comment[th]=เรียกดูเวิลด์ไวด์เว็บ +Comment[tl]=Browse the World Wide Web +Comment[tr]=Web’de gezin +Comment[trs]=Gāchē nu ngà World Wide Web +Comment[uk]=Переглядайте всесвітню мережу +Comment[ur]=Browse the World Wide Web +Comment[uz]=Browse the World Wide Web +Comment[vi]=Duyệt web trên toàn thế giới +Comment[xh]=Browse the World Wide Web +Comment[zh_CN]=浏览万维网 +Comment[zh_TW]=瀏覽全球資訊網 +GenericName=Web Browser +GenericName[ach]=Web Browser +GenericName[af]=Web Browser +GenericName[an]=Web Browser +GenericName[ar]=متصفح الإنترنت +GenericName[ast]=Web Browser +GenericName[az]=Web Browser +GenericName[be]=Вэб-браўзер +GenericName[bg]=Уеб браузър +GenericName[bn]=ওয়েব ব্রাউজার +GenericName[br]=Merdeer Web +GenericName[bs]=Web pretraživač +GenericName[ca]=Navegador web +GenericName[ca_valencia]=Web Browser +GenericName[cak]=Web Okik'amaya'l +GenericName[cs]=Webový prohlížeč +GenericName[cy]=Porwr Gwe +GenericName[da]=Webbrowser +GenericName[de]=Internet-Browser +GenericName[dsb]=Webwobglědowak +GenericName[el]=Πρόγραμμα περιήγησης +GenericName[en_CA]=Web Browser +GenericName[en_GB]=Web Browser +GenericName[eo]=Retumilo +GenericName[es_AR]=Navegador web +GenericName[es_CL]=Navegador Web +GenericName[es_ES]=Navegador web +GenericName[es_MX]=Navegador Web +GenericName[et]=Web Browser +GenericName[eu]=Web nabigatzailea +GenericName[fa]=Web Browser +GenericName[ff]=Web Browser +GenericName[fi]=Verkkoselain +GenericName[fr]=Navigateur web +GenericName[fur]=Navigadôr Web +GenericName[fy_NL]=Webbrowser +GenericName[ga_IE]=Web Browser +GenericName[gd]=Brabhsair-lìn +GenericName[gl]=Navegador web +GenericName[gn]=Ñanduti Kundahára +GenericName[gu_IN]=Web Browser +GenericName[he]=דפדפן אינטרנט +GenericName[hi_IN]=Web Browser +GenericName[hr]=Web preglednik +GenericName[hsb]=Webwobhladowak +GenericName[hu]=Webböngésző +GenericName[hy_AM]=Վեբ դիտարկիչ +GenericName[ia]=Navigator web +GenericName[id]=Peramban Web +GenericName[is]=Vafri +GenericName[it]=Browser web +GenericName[ja]=ウェブブラウザー +GenericName[ka]=ბრაუზერი +GenericName[kab]=Iminig web +GenericName[kk]=Веб-браузері +GenericName[km]=Web Browser +GenericName[kn]=Web Browser +GenericName[ko]=웹 브라우저 +GenericName[lij]=Navegatô Web +GenericName[lt]=Web Browser +GenericName[lv]=Tīmekļa pārlūks +GenericName[mk]=Web Browser +GenericName[mr]=Web Browser +GenericName[ms]=Web Browser +GenericName[my]=Web Browser +GenericName[nb_NO]=Nettleser +GenericName[ne_NP]=वेब ब्राउजर +GenericName[nl]=Webbrowser +GenericName[nn_NO]=Nettlesar +GenericName[oc]=Navegador Web +GenericName[pa_IN]=ਵੈੱਬ ਬਰਾਊਜ਼ਰ +GenericName[pl]=Przeglądarka internetowa +GenericName[pt_BR]=Navegador web +GenericName[pt_PT]=Navegador Web +GenericName[rm]=Navigatur web +GenericName[ro]=Web Browser +GenericName[ru]=Веб-браузер +GenericName[sat]=ᱣᱮᱵᱽ ᱵᱽᱨᱟᱣᱡᱚᱨ +GenericName[sc]=Navigadore web +GenericName[sco]=Web Browser +GenericName[si]=වියමන අතිරික්සුව +GenericName[sk]=Webový prehliadač +GenericName[skr]=ویب براؤزر +GenericName[sl]=Spletni brskalnik +GenericName[son]=Web Browser +GenericName[sq]=Shfletues +GenericName[sr]=Веб прегледач +GenericName[sv_SE]=Webbläsare +GenericName[szl]=Web Browser +GenericName[ta]=Web Browser +GenericName[te]=జాల విహారిణి +GenericName[tg]=Браузери веб +GenericName[th]=เว็บเบราว์เซอร์ +GenericName[tl]=Web Browser +GenericName[tr]=Web Tarayıcısı +GenericName[trs]=Web riña gāchē nu’ +GenericName[uk]=Браузер +GenericName[ur]=Web Browser +GenericName[uz]=Web Browser +GenericName[vi]=Trình duyệt web +GenericName[xh]=Web Browser +GenericName[zh_CN]=Web 浏览器 +GenericName[zh_TW]=網頁瀏覽器 +Keywords=Internet;WWW;Browser;Web;Explorer; +Keywords[ach]=Internet;WWW;Browser;Web;Explorer; +Keywords[af]=Internet;WWW;Browser;Web;Explorer; +Keywords[an]=Internet;WWW;Browser;Web;Explorer; +Keywords[ar]=إنترنت;WWW;متصفح;ويب;مستكشف; +Keywords[ast]=Internet;WWW;Browser;Web;Explorer; +Keywords[az]=Internet;WWW;Browser;Web;Explorer; +Keywords[be]=Internet;WWW;Browser;Web;Explorer; +Keywords[bg]=Internet;WWW;Browser;Web;Explorer; +Keywords[bn]=ইন্টারনেট;WWW;ব্রাউজার;ওয়েব;এক্সপ্লোরার; +Keywords[br]=Internet;WWW;Merdeer;Web;Ergerzhout; +Keywords[bs]=Internet;WWW;Pretraživač;Web;Istraživač; +Keywords[ca]=Internet;WWW;Browser;Web;Explorador;Navegador; +Keywords[ca_valencia]=Internet;WWW;Browser;Web;Explorer; +Keywords[cak]=K'amaya'l;WWW;Okik'amaya'l;Kanob'äl; +Keywords[cs]=internet;WWW;prohlížeč;web; +Keywords[cy]=Rhyngrwyd;WWW;Porwr;Gwe;Archwiliwr; +Keywords[da]=Internet;WWW;Browser;Nettet;Explorer; +Keywords[de]=Internet;WWW;Browser;Web;Explorer; +Keywords[dsb]=Internet;WWW;wobglědowak;Web;Explorer; +Keywords[el]=Internet;WWW;Browser;Web;Explorer;Διαδίκτυο;Ιστός;Ίντερνετ; +Keywords[en_CA]=Internet;WWW;Browser;Web;Explorer; +Keywords[en_GB]=Internet;WWW;Browser;Web;Explorer; +Keywords[eo]=Interreto;Retumilo;TTT;Teksaĵo;Reto;Internet;WWW;Browser;Web;Explorer; +Keywords[es_AR]=Internet;WWW;Navegador;Web;Explorador; +Keywords[es_CL]=Internet;WWW;Navegador;Web;Explorador; +Keywords[es_ES]=Internet;WWW;Navegador;Web;Explorador; +Keywords[es_MX]=Internet;WWW;Navegador;Web;Explorador; +Keywords[et]=Internet;WWW;Browser;Web;Explorer; +Keywords[eu]=Internet;WWW;Nabigatzailea;Web;Arakatzailea; +Keywords[fa]=Internet;WWW;Browser;Web;Explorer; +Keywords[ff]=Internet;WWW;Browser;Web;Explorer; +Keywords[fi]=Internet;WWW;Browser;Web;Explorer;netti;webbi;selain; +Keywords[fr]=Internet;WWW;Navigateur;Web;Explorer; +Keywords[fur]=Internet;WWW;Browser;Navigadôr;Web;Esploradôr;Explorer; +Keywords[fy_NL]=Ynternet;WWW;Browser;Web;Ferkenner; +Keywords[ga_IE]=Internet;WWW;Browser;Web;Explorer; +Keywords[gd]=Internet;WWW;Browser;Web;Explorer;eadar-lìon;brabhsair;brobhsair;lìon;taisgealaiche; +Keywords[gl]=Internet;WWW;Navegador;Web;Explorador; +Keywords[gn]=Internet;WWW;Browser;Web;Explorer; +Keywords[gu_IN]=Internet;WWW;Browser;Web;Explorer; +Keywords[he]=אינטרנט;WWW;דפדפן;רשת;סייר;מרשתת; +Keywords[hi_IN]=Internet;WWW;Browser;Web;Explorer; +Keywords[hr]=Internet;WWW;Preglednik;Web;Istraživač; +Keywords[hsb]=Internet;WWW;wobhladowak;Web;Explorer; +Keywords[hu]=Internet;WWW;Böngésző;Web;Világháló; +Keywords[hy_AM]=Համացանց,WWW,Զննիչ,Վեբ,Ցանցախույզ: +Keywords[ia]=Internet;WWW;Navigator;Web;Explorator; +Keywords[id]=Internet;WWW;Browser;Web;Explorer; +Keywords[is]=Internet;WWW; Vafri; Vefur; Explorer; +Keywords[it]=Internet;WWW;Browser;Web;Explorer;Navigatore; +Keywords[ja]=Internet;WWW;Browser;Web;Explorer;インターネット;ブラウザー;ウェブ; +Keywords[ka]=ინტერნეტი;WWW;ბრაუზერი;ქსელი;ქსელთან წვდომა; +Keywords[kab]=Internet;WWW;Browser;Web;Explorer; +Keywords[kk]=Internet;WWW;Browser;Web;Explorer;Интернет;Ғаламтор;Браузер;Желі;Шолғыш; +Keywords[km]=Internet;WWW;Browser;Web;Explorer; +Keywords[kn]=Internet;WWW;Browser;Web;Explorer; +Keywords[ko]=인터넷;브라우저;웹;탐색기;Internet;WWW;Browser;Web;Explorer; +Keywords[lij]=Internet;WWW;Browser;Web;Explorer;Navegatô; +Keywords[lt]=Internet;WWW;Browser;Web;Explorer; +Keywords[lv]=Internets;WWW;Pārlūkprogramma;Tīmeklis; +Keywords[mk]=Internet;WWW;Browser;Web;Explorer; +Keywords[mr]=Internet;WWW;Browser;Web;Explorer; +Keywords[ms]=Internet;WWW;Browser;Web;Explorer; +Keywords[my]=Internet;WWW;Browser;Web;Explorer; +Keywords[nb_NO]=Internett;WWW;Nettleser;Web;Utforsker; +Keywords[ne_NP]=Internet;WWW;Browser;Web;Explorer; +Keywords[nl]=Internet;WWW;Browser;Web;Verkenner; +Keywords[nn_NO]=Internett;WWW;Nettlesar;Web;Utforskar; +Keywords[oc]=Internet;WWW;Navegador;Navigador;Navegator;Navigator;Web;Explorer; +Keywords[pa_IN]=ਇੰਟਰਨੈੱਟ;WWW;ਬਰਾਊਜ਼ਰ;ਵੈੱਬ;ਐਕਸਪਲਰੋਰ;ਵੈਬ;ਇੰਟਰਨੈਟ; +Keywords[pl]=Internet;WWW;Przeglądarka;Browser;Wyszukiwarka;Web;Sieć;Explorer;Eksplorer;Strony;Witryny;internetowe; +Keywords[pt_BR]=Internet;WWW;Browser;Web;Explorer;Navegador; +Keywords[pt_PT]=Internet;WWW;Navegador;Web;Explorador; +Keywords[rm]=Internet;WWW;Browser;Web;Explorer;navigatur; +Keywords[ro]=Internet;WWW;Browser;Web;Explorer; +Keywords[ru]=Сеть;Интернет;Браузер;Доступ в Интернет; +Keywords[sat]=Internet;WWW;Browser;Web;Explorer; +Keywords[sc]=Internet;WWW;Navigadore;Web;Explorer; +Keywords[sco]=Internet;WWW;Browser;Web;Explorer; +Keywords[si]=අන්තර්ජාලය;අතිරික්සුව;පිරික්සන්න;ගවේශකය;Internet;WWW;Browser;Web;Explorer; +Keywords[sk]=Internet;WWW;Prehliadač;Web;Prieskumník; +Keywords[skr]=Internet;WWW;Browser;Web;Explorer; +Keywords[sl]=internet;www;brskalnik;splet; +Keywords[son]=Internet;WWW;Browser;Web;Explorer; +Keywords[sq]=Internet;WWW;Shfletues;Web;Eksplorues; +Keywords[sr]=Internet;WWW;Browser;Web;Explorer;интернет;прегледач;веб;мрежа;прегледач; +Keywords[sv_SE]=Internet;WWW;Webbläsare;Webb;Utforskare; +Keywords[szl]=Internet;WWW;Browser;Web;Explorer; +Keywords[ta]=Internet;WWW;Browser;Web;Explorer; +Keywords[te]=Internet;WWW;Browser;Web;Explorer; +Keywords[tg]=Интернет;WWW;Браузер;Сомона;Ҷустуҷӯгар; +Keywords[th]=อินเทอร์เน็ต;เบราว์เซอร์;เว็บ;Internet;WWW;Browser;Web;Explorer; +Keywords[tl]=Internet;WWW;Browser;Web;Explorer; +Keywords[tr]=Internet;WWW;Browser;Web;Explorer;İnternet;Tarayıcı; +Keywords[trs]=Internet;WWW;Browser;Web;Explorer; +Keywords[uk]=Інтернет;WWW;Браузер;Веб;Переглядач; +Keywords[ur]=Internet;WWW;Browser;Web;Explorer; +Keywords[uz]=Internet;WWW;Browser;Web;Explorer; +Keywords[vi]=Internet;WWW;Trình duyệt;Web;Duyệt web; +Keywords[xh]=Internet;WWW;Browser;Web;Explorer; +Keywords[zh_CN]=Internet;WWW;Browser;Web;Explorer; +Keywords[zh_TW]=網際網路;網路;瀏覽器;網頁;上網;Internet;WWW;Browser;Web;Explorer; +X-GNOME-FullName=Firefox Web Browser +X-GNOME-FullName[ach]=Firefox Web Browser +X-GNOME-FullName[af]=Firefox Web Browser +X-GNOME-FullName[an]=Firefox Web Browser +X-GNOME-FullName[ar]=متصفح Firefox +X-GNOME-FullName[ast]=Firefox Web Browser +X-GNOME-FullName[az]=Firefox Web Browser +X-GNOME-FullName[be]=Вэб-браўзер Firefox +X-GNOME-FullName[bg]=Firefox Уеб браузър +X-GNOME-FullName[bn]=Firefox Web Browser +X-GNOME-FullName[br]=Merdeer Web Firefox +X-GNOME-FullName[bs]=Firefox web pretraživač +X-GNOME-FullName[ca]=Navegador web Firefox +X-GNOME-FullName[ca_valencia]=Firefox Web Browser +X-GNOME-FullName[cak]=Firefox Web Browser +X-GNOME-FullName[cs]=Webový prohlížeč Firefox +X-GNOME-FullName[cy]=Porwr Gwe Firefox +X-GNOME-FullName[da]=Firefox-browser +X-GNOME-FullName[de]=Firefox-Web-Browser +X-GNOME-FullName[dsb]=Webwobglědowak Firefox +X-GNOME-FullName[el]=Πρόγραμμα περιήγησης Firefox +X-GNOME-FullName[en_CA]=Firefox Web Browser +X-GNOME-FullName[en_GB]=Firefox Web Browser +X-GNOME-FullName[eo]=Retumilo Firefox +X-GNOME-FullName[es_AR]=Navegador web Firefox +X-GNOME-FullName[es_CL]=Navegador web Firefox +X-GNOME-FullName[es_ES]=Navegador web Firefox +X-GNOME-FullName[es_MX]=Navegador web Firefox +X-GNOME-FullName[et]=Firefox Web Browser +X-GNOME-FullName[eu]=Firefox web nabigatzailea +X-GNOME-FullName[fa]=Firefox Web Browser +X-GNOME-FullName[ff]=Firefox Web Browser +X-GNOME-FullName[fi]=Firefox-verkkoselain +X-GNOME-FullName[fr]=Navigateur web Firefox +X-GNOME-FullName[fur]=Navigadôr web Firefox +X-GNOME-FullName[fy_NL]=Firefox-webbrowser +X-GNOME-FullName[ga_IE]=Firefox Web Browser +X-GNOME-FullName[gd]=Brabhsair-lìn Firefox +X-GNOME-FullName[gl]=Navegador web Firefox +X-GNOME-FullName[gn]=Firefox Ñanduti Kundahára +X-GNOME-FullName[gu_IN]=Firefox Web Browser +X-GNOME-FullName[he]=דפדפן אינטרנט Firefox +X-GNOME-FullName[hi_IN]=Firefox वेब ब्राउज़र +X-GNOME-FullName[hr]=Firefox web preglednik +X-GNOME-FullName[hsb]=Webwobhladowak Firefox +X-GNOME-FullName[hu]=Firefox webböngésző +X-GNOME-FullName[hy_AM]=Firefox վեբ դիտարկիչ +X-GNOME-FullName[ia]=Navigator web Firefox +X-GNOME-FullName[id]=Firefox Peramban Web +X-GNOME-FullName[is]=Firefox-vafri +X-GNOME-FullName[it]=Browser web Firefox +X-GNOME-FullName[ja]=Firefox ウェブブラウザー +X-GNOME-FullName[ka]=Firefox-ბრაუზერი +X-GNOME-FullName[kab]=Iminig web Firefox +X-GNOME-FullName[kk]=Firefox веб-браузері +X-GNOME-FullName[km]=Firefox Web Browser +X-GNOME-FullName[kn]=Firefox Web Browser +X-GNOME-FullName[ko]=Firefox 웹 브라우저 +X-GNOME-FullName[lij]=Firefox Navegatô Web +X-GNOME-FullName[lt]=Firefox Web Browser +X-GNOME-FullName[lv]=Firefox tīmekļa pārlūks +X-GNOME-FullName[mk]=Firefox Web Browser +X-GNOME-FullName[mr]=Firefox Web Browser +X-GNOME-FullName[ms]=Firefox Web Browser +X-GNOME-FullName[my]=Firefox Web Browser +X-GNOME-FullName[nb_NO]=Firefox-nettleser +X-GNOME-FullName[ne_NP]=Firefox वेब ब्राउजर +X-GNOME-FullName[nl]=Firefox-webbrowser +X-GNOME-FullName[nn_NO]=Firefox-nettlesar +X-GNOME-FullName[oc]=Navegador web Firefox +X-GNOME-FullName[pa_IN]=Firefox ਵੈੱਬ ਬਰਾਊਜ਼ਰ +X-GNOME-FullName[pl]=Przeglądarka Firefox +X-GNOME-FullName[pt_BR]=Navegador web Firefox +X-GNOME-FullName[pt_PT]=Navegador Web Firefox +X-GNOME-FullName[rm]=Navigatur-web Firefox +X-GNOME-FullName[ro]=Firefox Web Browser +X-GNOME-FullName[ru]=Веб-браузер Firefox +X-GNOME-FullName[sat]=Firefox ᱣᱮᱵᱽ ᱵᱽᱨᱟᱣᱡᱚᱨ +X-GNOME-FullName[sc]=Navigadore web Firefox +X-GNOME-FullName[sco]=Firefox Web Browser +X-GNOME-FullName[si]=Firefox අතිරික්සුව +X-GNOME-FullName[sk]=Webový prehliadač Firefox +X-GNOME-FullName[skr]=Firefox ویب براؤزر +X-GNOME-FullName[sl]=Spletni brskalnik Firefox +X-GNOME-FullName[son]=Firefox Web Browser +X-GNOME-FullName[sq]=Shfletuesi Firefox +X-GNOME-FullName[sr]=Firefox веб прегледач +X-GNOME-FullName[sv_SE]=Firefox webbläsare +X-GNOME-FullName[szl]=Firefox Web Browser +X-GNOME-FullName[ta]=Firefox Web Browser +X-GNOME-FullName[te]=Firefox Web Browser +X-GNOME-FullName[tg]=Браузери интернетии «Firefox» +X-GNOME-FullName[th]=เว็บเบราว์เซอร์ Firefox +X-GNOME-FullName[tl]=Firefox Web Browser +X-GNOME-FullName[tr]=Firefox Web Tarayıcısı +X-GNOME-FullName[trs]=Firefox Web riña gāchē nu’ +X-GNOME-FullName[uk]=Браузер Firefox +X-GNOME-FullName[ur]=Firefox Web Browser +X-GNOME-FullName[uz]=Firefox Web Browser +X-GNOME-FullName[vi]=Trình duyệt Web Firefox +X-GNOME-FullName[xh]=Firefox Web Browser +X-GNOME-FullName[zh_CN]=Firefox 浏览器 +X-GNOME-FullName[zh_TW]=Firefox 網頁瀏覽器 Exec=firefox %u Icon=firefox Terminal=false @@ -49,230 +522,324 @@ Type=Application MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https; StartupNotify=true Categories=Network;WebBrowser; -Keywords=web;browser;internet; Actions=new-window;new-private-window;profile-manager-window; # Activable desktop file crashes KDE so remove it for now # DBusActivatable=true [Desktop Action new-window] -Name=Open a New Window -Name[ach]=Dirica manyen -Name[af]=Nuwe venster -Name[an]=Nueva finestra +Name=New Window +Name[ach]=New Window +Name[af]=New Window +Name[an]=New Window Name[ar]=نافذة جديدة -Name[as]=নতুন উইন্ডো -Name[ast]=Ventana nueva -Name[az]=Yeni Pəncərə +Name[ast]=New Window +Name[az]=New Window Name[be]=Новае акно Name[bg]=Нов прозорец -Name[bn_BD]=নতুন উইন্ডো (N) -Name[bn_IN]=নতুন উইন্ডো +Name[bn]=নতুন উইন্ডো Name[br]=Prenestr nevez -Name[brx]=गोदान उइन्ड'(N) Name[bs]=Novi prozor Name[ca]=Finestra nova -Name[cak]=K'ak'a' tzuwäch +Name[ca_valencia]=New Window +Name[cak]=K'ak'a' Tzuwäch Name[cs]=Nové okno Name[cy]=Ffenestr Newydd Name[da]=Nyt vindue Name[de]=Neues Fenster Name[dsb]=Nowe wokno Name[el]=Νέο παράθυρο +Name[en_CA]=New Window Name[en_GB]=New Window -Name[en_US]=New Window -Name[en_ZA]=New Window Name[eo]=Nova fenestro Name[es_AR]=Nueva ventana Name[es_CL]=Nueva ventana Name[es_ES]=Nueva ventana Name[es_MX]=Nueva ventana -Name[et]=Uus aken +Name[et]=New Window Name[eu]=Leiho berria Name[fa]=پنجره جدید‌ -Name[ff]=Henorde Hesere +Name[ff]=New Window Name[fi]=Uusi ikkuna Name[fr]=Nouvelle fenêtre +Name[fur]=Gnûf barcon Name[fy_NL]=Nij finster -Name[ga_IE]=Fuinneog Nua +Name[ga_IE]=New Window Name[gd]=Uinneag ùr Name[gl]=Nova xanela Name[gn]=Ovetã pyahu -Name[gu_IN]=નવી વિન્ડો +Name[gu_IN]=New Window Name[he]=חלון חדש -Name[hi_IN]=नया विंडो +Name[hi_IN]=New Window Name[hr]=Novi prozor Name[hsb]=Nowe wokno Name[hu]=Új ablak -Name[hy_AM]=Նոր Պատուհան +Name[hy_AM]=Նոր պատուհան +Name[ia]=Nove fenestra Name[id]=Jendela Baru Name[is]=Nýr gluggi Name[it]=Nuova finestra Name[ja]=新しいウィンドウ -Name[ja_JP-mac]=新規ウインドウ Name[ka]=ახალი ფანჯარა +Name[kab]=Asfaylu amaynut Name[kk]=Жаңа терезе -Name[km]=បង្អួច​​​ថ្មី -Name[kn]=ಹೊಸ ಕಿಟಕಿ +Name[km]=New Window +Name[kn]=New Window Name[ko]=새 창 -Name[kok]=नवें जनेल -Name[ks]=نئئ وِنڈو -Name[lij]=Neuvo barcon -Name[lo]=ຫນ້າຕ່າງໃຫມ່ -Name[lt]=Naujas langas -Name[ltg]=Jauns lūgs +Name[lij]=Neuvo Barcon +Name[lt]=New Window Name[lv]=Jauns logs -Name[mai]=नव विंडो -Name[mk]=Нов прозорец -Name[ml]=പുതിയ ജാലകം -Name[mr]=नवीन पटल -Name[ms]=Tetingkap Baru -Name[my]=ဝင်းဒိုးအသစ် +Name[mk]=New Window +Name[mr]=New Window +Name[ms]=New Window +Name[my]=New Window Name[nb_NO]=Nytt vindu Name[ne_NP]=नयाँ सञ्झ्याल Name[nl]=Nieuw venster Name[nn_NO]=Nytt vindauge -Name[or]=ନୂତନ ୱିଣ୍ଡୋ +Name[oc]=Fenèstra novèla Name[pa_IN]=ਨਵੀਂ ਵਿੰਡੋ Name[pl]=Nowe okno Name[pt_BR]=Nova janela Name[pt_PT]=Nova janela Name[rm]=Nova fanestra -Name[ro]=Fereastră nouă +Name[ro]=New Window Name[ru]=Новое окно -Name[sat]=नावा विंडो (N) -Name[si]=නව කවුළුවක් +Name[sat]=ᱱᱟᱶᱟ ᱣᱤᱱᱰᱳ +Name[sc]=Ventana noa +Name[sco]=New Window +Name[si]=නව කවුළුව Name[sk]=Nové okno +Name[skr]=نویں ونڈو Name[sl]=Novo okno -Name[son]=Zanfun taaga +Name[son]=New Window Name[sq]=Dritare e Re Name[sr]=Нови прозор Name[sv_SE]=Nytt fönster -Name[ta]=புதிய சாளரம் -Name[te]=కొత్త విండో +Name[szl]=New Window +Name[ta]=New Window +Name[te]=కొత్త కిటికీ +Name[tg]=Равзанаи нав Name[th]=หน้าต่างใหม่ +Name[tl]=New Window Name[tr]=Yeni pencere -Name[tsz]=Eraatarakua jimpani +Name[trs]=Bēntanâ nākàa Name[uk]=Нове вікно -Name[ur]=نیا دریچہ -Name[uz]=Yangi oyna +Name[ur]=New Window +Name[uz]=New Window Name[vi]=Cửa sổ mới -Name[wo]=Palanteer bu bees -Name[xh]=Ifestile entsha +Name[xh]=New Window Name[zh_CN]=新建窗口 Name[zh_TW]=開新視窗 Exec=firefox --new-window %u [Desktop Action new-private-window] -Name=Open a New Private Window -Name[ach]=Dirica manyen me mung -Name[af]=Nuwe privaatvenster -Name[an]=Nueva finestra privada +Name=New Private Window +Name[ach]=New Private Window +Name[af]=New Private Window +Name[an]=New Private Window Name[ar]=نافذة خاصة جديدة -Name[as]=নতুন ব্যক্তিগত উইন্ডো -Name[ast]=Ventana privada nueva -Name[az]=Yeni Məxfi Pəncərə -Name[be]=Новае акно адасаблення -Name[bg]=Нов прозорец за поверително сърфиране -Name[bn_BD]=নতুন ব্যক্তিগত উইন্ডো -Name[bn_IN]=নতুন ব্যক্তিগত উইন্ডো -Name[br]=Prenestr merdeiñ prevez nevez -Name[brx]=गोदान प्राइभेट उइन्ड' +Name[ast]=New Private Window +Name[az]=New Private Window +Name[be]=Новае прыватнае акно +Name[bg]=Нов личен прозорец +Name[bn]=নতুন ব্যক্তিগত উইন্ডো +Name[br]=Prenestr prevez nevez Name[bs]=Novi privatni prozor Name[ca]=Finestra privada nova -Name[cak]=K'ak'a' ichinan tzuwäch +Name[ca_valencia]=New Private Window +Name[cak]=K'ak'a' Ichinan Tzuwäch Name[cs]=Nové anonymní okno Name[cy]=Ffenestr Breifat Newydd Name[da]=Nyt privat vindue Name[de]=Neues privates Fenster Name[dsb]=Nowe priwatne wokno -Name[el]=Νέο παράθυρο ιδιωτικής περιήγησης +Name[el]=Νέο ιδιωτικό παράθυρο +Name[en_CA]=New Private Window Name[en_GB]=New Private Window -Name[en_US]=New Private Window -Name[en_ZA]=New Private Window Name[eo]=Nova privata fenestro Name[es_AR]=Nueva ventana privada Name[es_CL]=Nueva ventana privada Name[es_ES]=Nueva ventana privada Name[es_MX]=Nueva ventana privada -Name[et]=Uus privaatne aken +Name[et]=New Private Window Name[eu]=Leiho pribatu berria Name[fa]=پنجره ناشناس جدید -Name[ff]=Henorde Suturo Hesere +Name[ff]=New Private Window Name[fi]=Uusi yksityinen ikkuna -Name[fr]=Nouvelle fenêtre de navigation privée +Name[fr]=Nouvelle fenêtre privée +Name[fur]=Gnûf barcon privât Name[fy_NL]=Nij priveefinster -Name[ga_IE]=Fuinneog Nua Phríobháideach +Name[ga_IE]=New Private Window Name[gd]=Uinneag phrìobhaideach ùr Name[gl]=Nova xanela privada Name[gn]=Ovetã ñemi pyahu -Name[gu_IN]=નવી ખાનગી વિન્ડો +Name[gu_IN]=New Private Window Name[he]=חלון פרטי חדש -Name[hi_IN]=नयी निजी विंडो +Name[hi_IN]=New Private Window Name[hr]=Novi privatni prozor Name[hsb]=Nowe priwatne wokno Name[hu]=Új privát ablak -Name[hy_AM]=Սկսել Գաղտնի դիտարկում +Name[hy_AM]=Նոր գաղտնի պատուհան +Name[ia]=Nove fenestra private Name[id]=Jendela Mode Pribadi Baru Name[is]=Nýr huliðsgluggi Name[it]=Nuova finestra anonima Name[ja]=新しいプライベートウィンドウ -Name[ja_JP-mac]=新規プライベートウインドウ Name[ka]=ახალი პირადი ფანჯარა +Name[kab]=Asfaylu amaynut n tunigin tusligt Name[kk]=Жаңа жекелік терезе -Name[km]=បង្អួច​ឯកជន​ថ្មី -Name[kn]=ಹೊಸ ಖಾಸಗಿ ಕಿಟಕಿ -Name[ko]=새 사생활 보호 모드 -Name[kok]=नवो खाजगी विंडो -Name[ks]=نْو پرایوٹ وینڈو& -Name[lij]=Neuvo barcon privou -Name[lo]=ເປີດຫນ້າຕ່າງສວນຕົວຂື້ນມາໃຫມ່ -Name[lt]=Naujas privataus naršymo langas -Name[ltg]=Jauns privatais lūgs +Name[km]=New Private Window +Name[kn]=New Private Window +Name[ko]=새 사생활 보호 창 +Name[lij]=Neuvo Barcon Privòu +Name[lt]=New Private Window Name[lv]=Jauns privātais logs -Name[mai]=नया निज विंडो (W) -Name[mk]=Нов приватен прозорец -Name[ml]=പുതിയ സ്വകാര്യ ജാലകം -Name[mr]=नवीन वैयक्तिक पटल -Name[ms]=Tetingkap Persendirian Baharu +Name[mk]=New Private Window +Name[mr]=New Private Window +Name[ms]=New Private Window Name[my]=New Private Window Name[nb_NO]=Nytt privat vindu Name[ne_NP]=नयाँ निजी सञ्झ्याल Name[nl]=Nieuw privévenster Name[nn_NO]=Nytt privat vindauge -Name[or]=ନୂତନ ବ୍ୟକ୍ତିଗତ ୱିଣ୍ଡୋ +Name[oc]=Fenèstra privada novèla Name[pa_IN]=ਨਵੀਂ ਪ੍ਰਾਈਵੇਟ ਵਿੰਡੋ Name[pl]=Nowe okno prywatne Name[pt_BR]=Nova janela privativa Name[pt_PT]=Nova janela privada Name[rm]=Nova fanestra privata -Name[ro]=Fereastră privată nouă +Name[ro]=New Private Window Name[ru]=Новое приватное окно -Name[sat]=नावा निजेराक् विंडो (W ) -Name[si]=නව පුද්ගලික කවුළුව (W) -Name[sk]=Nové okno v režime Súkromné prehliadanie +Name[sat]=ᱱᱟᱶᱟ ᱱᱤᱡᱮᱨᱟᱜ ᱣᱤᱱᱰᱳ +Name[sc]=Ventana privada noa +Name[sco]=New Private Window +Name[si]=නව පෞද්. කවුළුව +Name[sk]=Nové súkromné okno +Name[skr]=نویں نجی ونڈو Name[sl]=Novo zasebno okno -Name[son]=Sutura zanfun taaga +Name[son]=New Private Window Name[sq]=Dritare e Re Private -Name[sr]=Нови приватан прозор +Name[sr]=Нови приватни прозор Name[sv_SE]=Nytt privat fönster -Name[ta]=புதிய தனிப்பட்ட சாளரம் -Name[te]=కొత్త ఆంతరంగిక విండో +Name[szl]=New Private Window +Name[ta]=New Private Window +Name[te]=కొత్త ఆంతరంగిక కిటికీ +Name[tg]=Равзанаи хусусии нав Name[th]=หน้าต่างส่วนตัวใหม่ +Name[tl]=New Private Window Name[tr]=Yeni gizli pencere -Name[tsz]=Juchiiti eraatarakua jimpani +Name[trs]=Bēntanâ huì nākàa Name[uk]=Приватне вікно -Name[ur]=نیا نجی دریچہ -Name[uz]=Yangi maxfiy oyna +Name[ur]=New Private Window +Name[uz]=New Private Window Name[vi]=Cửa sổ riêng tư mới -Name[wo]=Panlanteeru biir bu bees -Name[xh]=Ifestile yangasese entsha -Name[zh_CN]=新建隐私浏览窗口 -Name[zh_TW]=新增隱私視窗 +Name[xh]=New Private Window +Name[zh_CN]=新建隐私窗口 +Name[zh_TW]=開新隱私視窗 Exec=firefox --private-window %u -[Desktop Action profile-manager-window] -Name=Open the Profile Manager -Name[cs]=Správa profilů +[Desktop Action open-profile-manager] +Name=Open Profile Manager +Name[ach]=Open Profile Manager +Name[af]=Open Profile Manager +Name[an]=Open Profile Manager +Name[ar]=افتح مدير الملف الشخصي +Name[ast]=Open Profile Manager +Name[az]=Open Profile Manager +Name[be]=Адкрыць менеджар профіляў +Name[bg]=Отваряне на мениджъра на профили +Name[bn]=Open Profile Manager +Name[br]=Digeriñ an ardoer aeladoù +Name[bs]=Otvori Menadžera profila +Name[ca]=Obre el gestor de perfils +Name[ca_valencia]=Open Profile Manager +Name[cak]=Open Profile Manager +Name[cs]=Otevřete Správce profilů +Name[cy]=Agorwch y Rheolwr Proffil +Name[da]=Åbn profilhåndtering Name[de]=Profilverwaltung öffnen +Name[dsb]=Profilowy zastojnik wócyniś +Name[el]=Άνοιγμα Διαχείρισης προφίλ +Name[en_CA]=Open Profile Manager +Name[en_GB]=Open Profile Manager +Name[eo]=Malfermi administranton de profiloj +Name[es_AR]=Abrir administrador de perfiles +Name[es_CL]=Abrir administrador de perfiles +Name[es_ES]=Abrir administrador de perfiles +Name[es_MX]=Abrir administrador de perfiles +Name[et]=Open Profile Manager +Name[eu]=Ireki profilen kudeatzailea +Name[fa]=Open Profile Manager +Name[ff]=Open Profile Manager +Name[fi]=Avaa profiilien hallinta Name[fr]=Ouvrir le gestionnaire de profils +Name[fur]=Vierç gjestôr profîi +Name[fy_NL]=Profylbehearder iepenje +Name[ga_IE]=Open Profile Manager +Name[gd]=Fosgail manaidsear nam pròifilean +Name[gl]=Abrir o xestor de perfís +Name[gn]=Embojuruja mba’ete ñangarekoha +Name[gu_IN]=Open Profile Manager +Name[he]=פתיחת מנהל הפרופילים +Name[hi_IN]=Open Profile Manager +Name[hr]=Otvori upravljač profila +Name[hsb]=Zrjadowak profilow wočinić +Name[hu]=Profilkezelő megnyitása +Name[hy_AM]=Բացեք պրոֆիլի կառավարիչը +Name[ia]=Aperir le gestor de profilo +Name[id]=Buka Pengelola Profil +Name[is]=Opna umsýslu notandasniða +Name[it]=Apri gestore profili +Name[ja]=プロファイルマネージャーを開く +Name[ka]=პროფილის მმართველის გახსნა +Name[kab]=Ldi amsefrak n umaɣnu +Name[kk]=Профильдер бақарушысын ашу +Name[km]=Open Profile Manager +Name[kn]=Open Profile Manager +Name[ko]=프로필 관리자 열기 +Name[lij]=Open Profile Manager +Name[lt]=Open Profile Manager +Name[lv]=Atvērt profilu pārvaldnieku +Name[mk]=Open Profile Manager +Name[mr]=Open Profile Manager +Name[ms]=Open Profile Manager +Name[my]=Open Profile Manager +Name[nb_NO]=Åpne profilbehandler +Name[ne_NP]=Open Profile Manager +Name[nl]=Profielbeheerder openen +Name[nn_NO]=Opne profilhandsaming +Name[oc]=Dobrir lo gestionari de perfils +Name[pa_IN]=ਪਰੋਫ਼ਾਈਲ ਮੈਨੇਜਰ ਖੋਲ੍ਹੋ +Name[pl]=Menedżer profili +Name[pt_BR]=Abrir gerenciador de perfis +Name[pt_PT]=Abrir o Gestor de Perfis +Name[rm]=Avrir l'administraziun da profils +Name[ro]=Open Profile Manager +Name[ru]=Открыть менеджер профилей +Name[sat]=ᱢᱮᱫᱦᱟᱸ ᱢᱮᱱᱮᱡᱚᱨ ᱠᱷᱩᱞᱟᱹᱭ ᱢᱮ +Name[sc]=Aberi su gestore de profilos +Name[sco]=Open Profile Manager +Name[si]=පැතිකඩ කළමනාකරු අරින්න +Name[sk]=Otvoriť Správcu profilov +Name[skr]=پروفائل منیجر کھولو +Name[sl]=Odpri upravitelja profilov +Name[son]=Open Profile Manager +Name[sq]=Hapni Përgjegjës Profilesh +Name[sr]=Отворите управљач профила +Name[sv_SE]=Öppna Profilhanteraren +Name[szl]=Open Profile Manager +Name[ta]=Open Profile Manager +Name[te]=Open Profile Manager +Name[tg]=Кушодани мудири профилҳо +Name[th]=เปิดตัวจัดการโปรไฟล์ +Name[tl]=Open Profile Manager +Name[tr]=Profil yöneticisini aç +Name[trs]=Sa nīkāj ñu’ūnj nej perfî huā nì’nï̀nj ïn +Name[uk]=Відкрити менеджер профілів +Name[ur]=Open Profile Manager +Name[uz]=Open Profile Manager +Name[vi]=Mở trình quản lý hồ sơ +Name[xh]=Open Profile Manager +Name[zh_CN]=打开配置文件管理器 +Name[zh_TW]=開啟設定檔管理員 Exec=firefox --ProfileManager diff --git a/firefox.spec b/firefox.spec index b0b25e7..e4b9b05 100644 --- a/firefox.spec +++ b/firefox.spec @@ -201,7 +201,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 139.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -1282,6 +1282,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Jun 6 2025 Martin Stransky - 139.0-3 +- Updated desktop file translation (rhbz#2362155) + * Fri May 30 2025 Jan Grulich - 139.0-2 - Use system libraries for drm/gbm/pipewire From f09f930358eb75baadffcff08ac7e3fadd44a541 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 11 Jun 2025 08:18:45 +0200 Subject: [PATCH 474/545] Updated to 139.0.4 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index d2aab7a..d53b6b1 100644 --- a/.gitignore +++ b/.gitignore @@ -708,3 +708,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-138.0.4.source.tar.xz /firefox-139.0.source.tar.xz /firefox-langpacks-139.0-20250527.tar.xz +/firefox-langpacks-139.0.4-20250610.tar.xz +/firefox-139.0.4.source.tar.xz diff --git a/firefox.spec b/firefox.spec index e4b9b05..e5a8aba 100644 --- a/firefox.spec +++ b/firefox.spec @@ -200,14 +200,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 139.0 -Release: 3%{?pre_tag}%{?dist} +Version: 139.0.4 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250527.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250611.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1282,6 +1282,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Jun 11 2025 Martin Stransky - 139.0.4-1 +- Updated to latest upstream (139.0.4) + * Fri Jun 6 2025 Martin Stransky - 139.0-3 - Updated desktop file translation (rhbz#2362155) diff --git a/sources b/sources index cd62be9..82c7102 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-139.0.source.tar.xz) = 84a2b47f2ff71aac226a774ab0ac9ab8d9a16f5620a06f7abb6648732209d022aef35a9d4873e91ebd67a4fc494fc238524e25c38fad8046db26afda06e6f970 -SHA512 (firefox-langpacks-139.0-20250527.tar.xz) = 4eb200ecd6a2edd655584698f82fef60e6b723feecddc312207cd79d4ca80fbdec9f5a0641c440bd625241a63d438e3be9a5b756700c63d4c5b9f3036e193125 +SHA512 (firefox-langpacks-139.0.4-20250610.tar.xz) = 2c931db95b0aa3de45310fbb697319fafe33aa6dcb4ffa84b45b35593deb3e64a1dfbf71453cf792fbe4063e08fd5a9feb4870c2e608f632fbe833f2f30c5673 +SHA512 (firefox-139.0.4.source.tar.xz) = fa5ae798b0cd485e0a56b0c57ed7f33e0d0ef921302dc0169eac91926194abe2070beb54239c81924f819a60b589f305f923970d753c07ba50acc36e1a492db4 From 8309e8fbbc74d49da274503bf55df995a843d134 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 11 Jun 2025 08:29:36 +0200 Subject: [PATCH 475/545] build fix --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index e5a8aba..64162a9 100644 --- a/firefox.spec +++ b/firefox.spec @@ -207,7 +207,7 @@ URL: https://www.mozilla.org/firefox/ License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250611.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250610.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz From 725d62009aa91b80a10ba9c965cefe698205ed04 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 11 Jun 2025 20:15:58 +0200 Subject: [PATCH 476/545] Use headless Mutter to run PGO builds --- firefox.spec | 5 ++++- run-wayland-compositor | 2 +- wasi.patch | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/firefox.spec b/firefox.spec index 64162a9..30becdb 100644 --- a/firefox.spec +++ b/firefox.spec @@ -201,7 +201,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 139.0.4 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -1282,6 +1282,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Jun 11 2025 Martin Stransky - 139.0.4-2 +- Use headless Mutter to run PGO builds + * Wed Jun 11 2025 Martin Stransky - 139.0.4-1 - Updated to latest upstream (139.0.4) diff --git a/run-wayland-compositor b/run-wayland-compositor index cc993dd..a104423 100755 --- a/run-wayland-compositor +++ b/run-wayland-compositor @@ -33,7 +33,7 @@ if [ -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]; then fi echo "Launch mutter for $WAYLAND_DISPLAY" -xvfb-run -s "-screen 0 1600x1200x24" mutter --nested --wayland --wayland-display=$WAYLAND_DISPLAY & MUTTER_PID=$! +MUTTER_DEBUG_DUMMY_MODE_SPECS="1920x1080@60" mutter --headless --wayland --wayland-display=$WAYLAND_DISPLAY & MUTTER_PID=$! export MUTTER_PID echo "Mutter PID $MUTTER_PID" diff --git a/wasi.patch b/wasi.patch index 3a2ba05..3da64cb 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-139.0-build/firefox-139.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-139.0.4-build/firefox-139.0.4/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 3dd27b4f6e26224f1f7c9fa44fa762eead19f319 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 12 Jun 2025 11:18:49 +0200 Subject: [PATCH 477/545] mutter PGO build fix --- run-wayland-compositor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-wayland-compositor b/run-wayland-compositor index a104423..e5e4109 100755 --- a/run-wayland-compositor +++ b/run-wayland-compositor @@ -33,7 +33,7 @@ if [ -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]; then fi echo "Launch mutter for $WAYLAND_DISPLAY" -MUTTER_DEBUG_DUMMY_MODE_SPECS="1920x1080@60" mutter --headless --wayland --wayland-display=$WAYLAND_DISPLAY & MUTTER_PID=$! +MUTTER_DEBUG_DUMMY_MODE_SPECS="1920x1080@60" mutter --headless --wayland --no-x11 --wayland-display=$WAYLAND_DISPLAY & MUTTER_PID=$! export MUTTER_PID echo "Mutter PID $MUTTER_PID" From 6049c4d71a2c66d2fc74d912f9a6c12e09717564 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 17 Jun 2025 09:41:11 +0200 Subject: [PATCH 478/545] Update to latest upstream (140.0) --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- wasi.patch | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index d53b6b1..70c719a 100644 --- a/.gitignore +++ b/.gitignore @@ -710,3 +710,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-139.0-20250527.tar.xz /firefox-langpacks-139.0.4-20250610.tar.xz /firefox-139.0.4.source.tar.xz +/firefox-140.0.source.tar.xz +/firefox-langpacks-140.0-20250617.tar.xz diff --git a/firefox.spec b/firefox.spec index 30becdb..8d01692 100644 --- a/firefox.spec +++ b/firefox.spec @@ -200,14 +200,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 139.0.4 -Release: 2%{?pre_tag}%{?dist} +Version: 140.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250610.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250616.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1282,6 +1282,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Jun 17 2025 Martin Stransky - 140.0-1 +- Update to latest upstream (140.0) + * Wed Jun 11 2025 Martin Stransky - 139.0.4-2 - Use headless Mutter to run PGO builds diff --git a/sources b/sources index 82c7102..8427931 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-langpacks-139.0.4-20250610.tar.xz) = 2c931db95b0aa3de45310fbb697319fafe33aa6dcb4ffa84b45b35593deb3e64a1dfbf71453cf792fbe4063e08fd5a9feb4870c2e608f632fbe833f2f30c5673 -SHA512 (firefox-139.0.4.source.tar.xz) = fa5ae798b0cd485e0a56b0c57ed7f33e0d0ef921302dc0169eac91926194abe2070beb54239c81924f819a60b589f305f923970d753c07ba50acc36e1a492db4 +SHA512 (firefox-140.0.source.tar.xz) = ef209827a422bab443e2b6fc59ac16f0ad99293b3c8f10a978f222ac8da5ff568b2fadfb97784feeafa4a24883d44ea2f34b47b2bb19863a27e00d2d787b8ad3 +SHA512 (firefox-langpacks-140.0-20250617.tar.xz) = abf2701f6588b846b8ae4b59eee85e2bd57c94e3d86b3fa9c71b06d07d3486979a266be4f3e144a876a1aa5c46f27725725830a42b53a3ff051721ab8e995eb2 diff --git a/wasi.patch b/wasi.patch index 3da64cb..849c315 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-139.0.4-build/firefox-139.0.4/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-140.0-build/firefox-140.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 1d89f3ced4636492ece409bc486c635c460a3c63 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 17 Jun 2025 21:35:51 +0200 Subject: [PATCH 479/545] build fix - sources --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 8d01692..684f166 100644 --- a/firefox.spec +++ b/firefox.spec @@ -207,7 +207,7 @@ URL: https://www.mozilla.org/firefox/ License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250616.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250617.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz From f79bda8a615a5328c56d924d9189db679a49538f Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 18 Jun 2025 20:04:27 +0200 Subject: [PATCH 480/545] Revert mutter PGO changes --- run-wayland-compositor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-wayland-compositor b/run-wayland-compositor index e5e4109..cc993dd 100755 --- a/run-wayland-compositor +++ b/run-wayland-compositor @@ -33,7 +33,7 @@ if [ -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]; then fi echo "Launch mutter for $WAYLAND_DISPLAY" -MUTTER_DEBUG_DUMMY_MODE_SPECS="1920x1080@60" mutter --headless --wayland --no-x11 --wayland-display=$WAYLAND_DISPLAY & MUTTER_PID=$! +xvfb-run -s "-screen 0 1600x1200x24" mutter --nested --wayland --wayland-display=$WAYLAND_DISPLAY & MUTTER_PID=$! export MUTTER_PID echo "Mutter PID $MUTTER_PID" From 431d7e98cf5a0aa64ec3371f675144004a62f075 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 27 Jun 2025 14:09:38 +0200 Subject: [PATCH 481/545] Updated to 140.0.1 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- wasi.patch | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 70c719a..c159178 100644 --- a/.gitignore +++ b/.gitignore @@ -712,3 +712,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-139.0.4.source.tar.xz /firefox-140.0.source.tar.xz /firefox-langpacks-140.0-20250617.tar.xz +/firefox-140.0.1.source.tar.xz +/firefox-langpacks-140.0.1-20250627.tar.xz diff --git a/firefox.spec b/firefox.spec index 684f166..f2f1948 100644 --- a/firefox.spec +++ b/firefox.spec @@ -200,14 +200,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 140.0 +Version: 140.0.1 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250617.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250627.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1282,6 +1282,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Jun 27 2025 Martin Stransky - 140.0.1-1 +- Update to latest upstream (140.0.1) + * Tue Jun 17 2025 Martin Stransky - 140.0-1 - Update to latest upstream (140.0) diff --git a/sources b/sources index 8427931..1175283 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-140.0.source.tar.xz) = ef209827a422bab443e2b6fc59ac16f0ad99293b3c8f10a978f222ac8da5ff568b2fadfb97784feeafa4a24883d44ea2f34b47b2bb19863a27e00d2d787b8ad3 -SHA512 (firefox-langpacks-140.0-20250617.tar.xz) = abf2701f6588b846b8ae4b59eee85e2bd57c94e3d86b3fa9c71b06d07d3486979a266be4f3e144a876a1aa5c46f27725725830a42b53a3ff051721ab8e995eb2 +SHA512 (firefox-140.0.1.source.tar.xz) = d521405f49a38b8449a24f90e5ea14d4337085918779d93d282cec80b2627f381648529d6f69930eb6e90e37302797b0049fec5846d25dc40f556bbd86d55ef1 +SHA512 (firefox-langpacks-140.0.1-20250627.tar.xz) = 840e00b5371958981303dbb858f5d313845445cda856c55c2c4b04198bbfedf212526f65f0dd7aa402edb52854d625087933b4ed01acaaed7750e844ea0685b2 diff --git a/wasi.patch b/wasi.patch index 849c315..c7d32ed 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-140.0-build/firefox-140.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-140.0.1-build/firefox-140.0.1/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 17a61ecf81abf1d19ffe967d16a1dd5030a498b7 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 9 Jul 2025 12:56:09 +0200 Subject: [PATCH 482/545] Update to latest upstream (140.0.4) --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index c159178..3184822 100644 --- a/.gitignore +++ b/.gitignore @@ -714,3 +714,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-140.0-20250617.tar.xz /firefox-140.0.1.source.tar.xz /firefox-langpacks-140.0.1-20250627.tar.xz +/firefox-140.0.4.source.tar.xz +/firefox-langpacks-140.0.4-20250708.tar.xz diff --git a/firefox.spec b/firefox.spec index f2f1948..f783134 100644 --- a/firefox.spec +++ b/firefox.spec @@ -200,14 +200,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 140.0.1 +Version: 140.0.4 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250627.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250708.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1282,6 +1282,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Jul 09 2025 Martin Stransky - 140.0.4-1 +- Update to latest upstream (140.0.4) + * Fri Jun 27 2025 Martin Stransky - 140.0.1-1 - Update to latest upstream (140.0.1) diff --git a/sources b/sources index 1175283..8557bee 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-140.0.1.source.tar.xz) = d521405f49a38b8449a24f90e5ea14d4337085918779d93d282cec80b2627f381648529d6f69930eb6e90e37302797b0049fec5846d25dc40f556bbd86d55ef1 -SHA512 (firefox-langpacks-140.0.1-20250627.tar.xz) = 840e00b5371958981303dbb858f5d313845445cda856c55c2c4b04198bbfedf212526f65f0dd7aa402edb52854d625087933b4ed01acaaed7750e844ea0685b2 +SHA512 (firefox-140.0.4.source.tar.xz) = 3de7c0871b8a45683f5c226fb3e91e597e8f89ef154b208b2a57c4d3ea9f39cb5c69ecbd5eca3b6da68d3775688d2289c1360c7d110c67bb1be1cf26ef8cf36d +SHA512 (firefox-langpacks-140.0.4-20250708.tar.xz) = 2238390a9d4f65c31d329ef8167b20075f8e5d3efe0b2add3f742a3ea4b6348e4e36820bb078d8b7cc90f67bdb91731115b520808c2b64f1c4574d5a44d3c33c From 4ef0ebecb5dd0df0361ba459ed77ceaf1bbea44f Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 14 Jul 2025 07:21:18 +0200 Subject: [PATCH 483/545] Removed gnome keyring from PGO build script --- run-wayland-compositor | 1 - 1 file changed, 1 deletion(-) diff --git a/run-wayland-compositor b/run-wayland-compositor index cc993dd..47ff3c0 100755 --- a/run-wayland-compositor +++ b/run-wayland-compositor @@ -20,7 +20,6 @@ if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then # if not found, launch a new one eval `dbus-launch --sh-syntax` fi -eval `echo '' | /usr/bin/gnome-keyring-daemon -r -d --unlock --components=secrets` if [ -z "$XDG_RUNTIME_DIR" ]; then export XDG_RUNTIME_DIR=$HOME From 2b5a89f8e1a4b94a3434b6550ad4725c60a5a56a Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 16 Jul 2025 10:16:36 +0200 Subject: [PATCH 484/545] Updated to 141.0 --- firefox.spec | 11 +++++++---- run-wayland-compositor | 2 +- sources | 2 -- wasi.patch | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/firefox.spec b/firefox.spec index f783134..e5cfbb3 100644 --- a/firefox.spec +++ b/firefox.spec @@ -119,12 +119,12 @@ ExcludeArch: i686 %endif %if 0%{?build_with_pgo} -%global use_xvfb 1 +%global use_xvfb 0 %global build_tests 1 %endif %if 0%{?run_firefox_tests} -%global use_xvfb 1 +%global use_xvfb 0 %global build_tests 1 %endif @@ -200,14 +200,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 140.0.4 +Version: 141.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250708.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250715.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1282,6 +1282,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Jul 15 2025 Martin Stransky - 141.0-1 +- Update to latest upstream (141.0) + * Wed Jul 09 2025 Martin Stransky - 140.0.4-1 - Update to latest upstream (140.0.4) diff --git a/run-wayland-compositor b/run-wayland-compositor index 47ff3c0..31eee24 100755 --- a/run-wayland-compositor +++ b/run-wayland-compositor @@ -32,7 +32,7 @@ if [ -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]; then fi echo "Launch mutter for $WAYLAND_DISPLAY" -xvfb-run -s "-screen 0 1600x1200x24" mutter --nested --wayland --wayland-display=$WAYLAND_DISPLAY & MUTTER_PID=$! +mutter --headless --virtual-monitor 1920x1080 --wayland-display=$WAYLAND_DISPLAY & MUTTER_PID=$! export MUTTER_PID echo "Mutter PID $MUTTER_PID" diff --git a/sources b/sources index 8557bee..bf76c45 100644 --- a/sources +++ b/sources @@ -3,5 +3,3 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-140.0.4.source.tar.xz) = 3de7c0871b8a45683f5c226fb3e91e597e8f89ef154b208b2a57c4d3ea9f39cb5c69ecbd5eca3b6da68d3775688d2289c1360c7d110c67bb1be1cf26ef8cf36d -SHA512 (firefox-langpacks-140.0.4-20250708.tar.xz) = 2238390a9d4f65c31d329ef8167b20075f8e5d3efe0b2add3f742a3ea4b6348e4e36820bb078d8b7cc90f67bdb91731115b520808c2b64f1c4574d5a44d3c33c diff --git a/wasi.patch b/wasi.patch index c7d32ed..a0e075d 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-140.0.1-build/firefox-140.0.1/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-141.0-build/firefox-141.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 170d89d3aec1206eed6ea755f7dfcfd7ae6a9697 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 17 Jul 2025 08:09:48 +0200 Subject: [PATCH 485/545] Updated to 141.0 --- .gitignore | 2 ++ firefox.spec | 4 ++-- sources | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 3184822..c87ed30 100644 --- a/.gitignore +++ b/.gitignore @@ -716,3 +716,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-140.0.1-20250627.tar.xz /firefox-140.0.4.source.tar.xz /firefox-langpacks-140.0.4-20250708.tar.xz +/firefox-141.0.source.tar.xz +/firefox-langpacks-141.0-20250717.tar.xz diff --git a/firefox.spec b/firefox.spec index e5cfbb3..5f3d1b2 100644 --- a/firefox.spec +++ b/firefox.spec @@ -207,7 +207,7 @@ URL: https://www.mozilla.org/firefox/ License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250715.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250717.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1282,7 +1282,7 @@ fi #--------------------------------------------------------------------- %changelog -* Tue Jul 15 2025 Martin Stransky - 141.0-1 +* Tue Jul 17 2025 Martin Stransky - 141.0-1 - Update to latest upstream (141.0) * Wed Jul 09 2025 Martin Stransky - 140.0.4-1 diff --git a/sources b/sources index bf76c45..d53ffbd 100644 --- a/sources +++ b/sources @@ -3,3 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f +SHA512 (firefox-141.0.source.tar.xz) = bc27d8b477a5812a5b6a4bc791655f78b98f91f6f719459b6377e48a3725b747b83de2e5f9c3c16fda8862e4989085b01711a5aef5c5cd99ec286dd36d593f11 +SHA512 (firefox-langpacks-141.0-20250717.tar.xz) = d8b317718911f1611b5db911f6a456ea7d0a2698642fc775ae040cba65550b6ce34883adcbeef0d4a5603080817f186100a4bfde2778b477fda0fa3cbf8528a2 From 66392400ba7dc5233d1c8bb9fb97f48ca2d98d4e Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 17 Jul 2025 10:57:19 +0200 Subject: [PATCH 486/545] changelog fix --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 5f3d1b2..77d2fca 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1282,7 +1282,7 @@ fi #--------------------------------------------------------------------- %changelog -* Tue Jul 17 2025 Martin Stransky - 141.0-1 +* Thu Jul 17 2025 Martin Stransky - 141.0-1 - Update to latest upstream (141.0) * Wed Jul 09 2025 Martin Stransky - 140.0.4-1 From 1b2d75db032880e71f894914b949f51ed59bd15a Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 17 Jul 2025 11:02:24 +0200 Subject: [PATCH 487/545] build fixes --- run-wayland-compositor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-wayland-compositor b/run-wayland-compositor index 31eee24..2ac9f69 100755 --- a/run-wayland-compositor +++ b/run-wayland-compositor @@ -32,7 +32,7 @@ if [ -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]; then fi echo "Launch mutter for $WAYLAND_DISPLAY" -mutter --headless --virtual-monitor 1920x1080 --wayland-display=$WAYLAND_DISPLAY & MUTTER_PID=$! +mutter --headless --virtual-monitor 1920x1080 --wayland-display=$WAYLAND_DISPLAY --no-x11 & MUTTER_PID=$! export MUTTER_PID echo "Mutter PID $MUTTER_PID" From 3a3ae1f6e78392fe9cd0e6d5b29e7804239bf28a Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 18 Jul 2025 13:15:14 +0200 Subject: [PATCH 488/545] Respin 141.0 build 2 --- .gitignore | 1 + firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index c87ed30..a165436 100644 --- a/.gitignore +++ b/.gitignore @@ -718,3 +718,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-140.0.4-20250708.tar.xz /firefox-141.0.source.tar.xz /firefox-langpacks-141.0-20250717.tar.xz +/firefox-langpacks-141.0-20250718.tar.xz diff --git a/firefox.spec b/firefox.spec index 77d2fca..6788277 100644 --- a/firefox.spec +++ b/firefox.spec @@ -201,13 +201,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 141.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250717.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250718.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1282,6 +1282,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Jul 18 2025 Martin Stransky - 141.0-2 +- Respin 141.0 build 2 + * Thu Jul 17 2025 Martin Stransky - 141.0-1 - Update to latest upstream (141.0) diff --git a/sources b/sources index d53ffbd..b41a270 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-141.0.source.tar.xz) = bc27d8b477a5812a5b6a4bc791655f78b98f91f6f719459b6377e48a3725b747b83de2e5f9c3c16fda8862e4989085b01711a5aef5c5cd99ec286dd36d593f11 -SHA512 (firefox-langpacks-141.0-20250717.tar.xz) = d8b317718911f1611b5db911f6a456ea7d0a2698642fc775ae040cba65550b6ce34883adcbeef0d4a5603080817f186100a4bfde2778b477fda0fa3cbf8528a2 +SHA512 (firefox-141.0.source.tar.xz) = bd6998bce927c5b5c186537bd41475fc9e3809829ceadb2277bb382d02d3780d2a5e5749487567a75b7c9e3726f97662c4ec28924bc491c5a3f21e2ec4828d63 +SHA512 (firefox-langpacks-141.0-20250718.tar.xz) = 65cd5f6cd1b991a0332e1d21b1218a522f869f8bc97f98dc0bcd58b22236f016d65a237cdb66874669b51f9c99a5cc1f3f2e1bc6396c75464c2b56d6ed8bfb51 From 14acb37320dba072a78a098e192676c83b3fa3fb Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 23 Jul 2025 20:32:35 +0000 Subject: [PATCH 489/545] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- firefox.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 6788277..b6babb9 100644 --- a/firefox.spec +++ b/firefox.spec @@ -201,7 +201,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 141.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -1282,6 +1282,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Jul 23 2025 Fedora Release Engineering - 141.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Fri Jul 18 2025 Martin Stransky - 141.0-2 - Respin 141.0 build 2 From c71c4ce3229512df49cf213d66352d670d97b004 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 6 Aug 2025 11:49:08 +0200 Subject: [PATCH 490/545] Updated to 141.0.2 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 2 ++ wasi.patch | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index a165436..276e498 100644 --- a/.gitignore +++ b/.gitignore @@ -719,3 +719,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-141.0.source.tar.xz /firefox-langpacks-141.0-20250717.tar.xz /firefox-langpacks-141.0-20250718.tar.xz +/firefox-langpacks-141.2.0-20250806.tar.xz +/firefox-141.0.2.source.tar.xz diff --git a/firefox.spec b/firefox.spec index 6788277..edd139c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -200,14 +200,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 141.0 -Release: 2%{?pre_tag}%{?dist} +Version: 141.0.2 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250718.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250806.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1282,6 +1282,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Aug 6 2025 Martin Stransky - 141.0.2-1 +- Updated to 141.0.2 + * Fri Jul 18 2025 Martin Stransky - 141.0-2 - Respin 141.0 build 2 diff --git a/sources b/sources index b41a270..66549bc 100644 --- a/sources +++ b/sources @@ -5,3 +5,5 @@ SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f SHA512 (firefox-141.0.source.tar.xz) = bd6998bce927c5b5c186537bd41475fc9e3809829ceadb2277bb382d02d3780d2a5e5749487567a75b7c9e3726f97662c4ec28924bc491c5a3f21e2ec4828d63 SHA512 (firefox-langpacks-141.0-20250718.tar.xz) = 65cd5f6cd1b991a0332e1d21b1218a522f869f8bc97f98dc0bcd58b22236f016d65a237cdb66874669b51f9c99a5cc1f3f2e1bc6396c75464c2b56d6ed8bfb51 +SHA512 (firefox-langpacks-141.2.0-20250806.tar.xz) = 9c818332016fe79f03920fd0b5fa505cb6ffdaf0c307662523b126dcdd3f2c9c735a2ec109d50c253b0d946fd58051b7e8cf7736089d4ce2e907eaacfc409dce +SHA512 (firefox-141.0.2.source.tar.xz) = 6d1552bc64d915e784a5d560c8bb35a5308f35ebcd2552b027f80f950c7f0c627cca46b0796cf6e17d8f50c82e6f70a3ec11471ce0e058794f500b7b15e17b43 diff --git a/wasi.patch b/wasi.patch index a0e075d..bae0ee0 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-141.0-build/firefox-141.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-141.0.2-build/firefox-141.0.2/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 92be14d9ab00078a8d1ef0e726a7e46c25c34aea Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 6 Aug 2025 11:52:31 +0200 Subject: [PATCH 491/545] sources update --- sources | 2 -- 1 file changed, 2 deletions(-) diff --git a/sources b/sources index 66549bc..a0fa588 100644 --- a/sources +++ b/sources @@ -3,7 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-141.0.source.tar.xz) = bd6998bce927c5b5c186537bd41475fc9e3809829ceadb2277bb382d02d3780d2a5e5749487567a75b7c9e3726f97662c4ec28924bc491c5a3f21e2ec4828d63 -SHA512 (firefox-langpacks-141.0-20250718.tar.xz) = 65cd5f6cd1b991a0332e1d21b1218a522f869f8bc97f98dc0bcd58b22236f016d65a237cdb66874669b51f9c99a5cc1f3f2e1bc6396c75464c2b56d6ed8bfb51 SHA512 (firefox-langpacks-141.2.0-20250806.tar.xz) = 9c818332016fe79f03920fd0b5fa505cb6ffdaf0c307662523b126dcdd3f2c9c735a2ec109d50c253b0d946fd58051b7e8cf7736089d4ce2e907eaacfc409dce SHA512 (firefox-141.0.2.source.tar.xz) = 6d1552bc64d915e784a5d560c8bb35a5308f35ebcd2552b027f80f950c7f0c627cca46b0796cf6e17d8f50c82e6f70a3ec11471ce0e058794f500b7b15e17b43 From 2d720ae2e56f0d1fe79dd13774bc707e1dc852b3 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 6 Aug 2025 12:09:23 +0200 Subject: [PATCH 492/545] sources upload --- .gitignore | 1 + sources | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 276e498..171877a 100644 --- a/.gitignore +++ b/.gitignore @@ -721,3 +721,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-141.0-20250718.tar.xz /firefox-langpacks-141.2.0-20250806.tar.xz /firefox-141.0.2.source.tar.xz +/firefox-langpacks-141.0.2-20250806.tar.xz diff --git a/sources b/sources index a0fa588..2bcc7e9 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-langpacks-141.2.0-20250806.tar.xz) = 9c818332016fe79f03920fd0b5fa505cb6ffdaf0c307662523b126dcdd3f2c9c735a2ec109d50c253b0d946fd58051b7e8cf7736089d4ce2e907eaacfc409dce SHA512 (firefox-141.0.2.source.tar.xz) = 6d1552bc64d915e784a5d560c8bb35a5308f35ebcd2552b027f80f950c7f0c627cca46b0796cf6e17d8f50c82e6f70a3ec11471ce0e058794f500b7b15e17b43 +SHA512 (firefox-langpacks-141.0.2-20250806.tar.xz) = 9c818332016fe79f03920fd0b5fa505cb6ffdaf0c307662523b126dcdd3f2c9c735a2ec109d50c253b0d946fd58051b7e8cf7736089d4ce2e907eaacfc409dce From b1a854bf0a86de4f12f9ab1bcbb670cb104563d1 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 11 Aug 2025 09:17:41 +0200 Subject: [PATCH 493/545] Updated to 141.0.3 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- wasi.patch | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 171877a..63bba76 100644 --- a/.gitignore +++ b/.gitignore @@ -722,3 +722,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-141.2.0-20250806.tar.xz /firefox-141.0.2.source.tar.xz /firefox-langpacks-141.0.2-20250806.tar.xz +/firefox-langpacks-141.0.3-20250811.tar.xz +/firefox-141.0.3.source.tar.xz diff --git a/firefox.spec b/firefox.spec index c786ed3..4973ac4 100644 --- a/firefox.spec +++ b/firefox.spec @@ -200,14 +200,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 141.0.2 +Version: 141.0.3 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250806.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250811.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1282,6 +1282,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Aug 11 2025 Martin Stransky - 141.0.3-1 +- Updated to 141.0.3 + * Wed Aug 6 2025 Martin Stransky - 141.0.2-1 - Updated to 141.0.2 diff --git a/sources b/sources index 2bcc7e9..3e3284b 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-141.0.2.source.tar.xz) = 6d1552bc64d915e784a5d560c8bb35a5308f35ebcd2552b027f80f950c7f0c627cca46b0796cf6e17d8f50c82e6f70a3ec11471ce0e058794f500b7b15e17b43 -SHA512 (firefox-langpacks-141.0.2-20250806.tar.xz) = 9c818332016fe79f03920fd0b5fa505cb6ffdaf0c307662523b126dcdd3f2c9c735a2ec109d50c253b0d946fd58051b7e8cf7736089d4ce2e907eaacfc409dce +SHA512 (firefox-langpacks-141.0.3-20250811.tar.xz) = 2fbc6a36cfc367cea2debe2d92bdca5a7ac17e3a26969f96c6cb48aa332d2fc9e520a6a3de15354ea656fab81d11b6a98d826c10457421df79af82bcc8e60270 +SHA512 (firefox-141.0.3.source.tar.xz) = b660b018840c41a254734b4847a791f1a9fd2f72dbea825ea5971fd0b3269a43f1f4be1ccf4a53f7809b6b98398f4e04a142e57f8882d6590bab636ef75002f6 diff --git a/wasi.patch b/wasi.patch index bae0ee0..4c08f72 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-141.0.2-build/firefox-141.0.2/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-141.0.3-build/firefox-141.0.3/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 461eda46715709b33039257aaedb862b9e9388d3 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 12 Aug 2025 11:56:48 +0200 Subject: [PATCH 494/545] Updated to 142.0 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 63bba76..8318831 100644 --- a/.gitignore +++ b/.gitignore @@ -724,3 +724,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-141.0.2-20250806.tar.xz /firefox-langpacks-141.0.3-20250811.tar.xz /firefox-141.0.3.source.tar.xz +/firefox-142.0.source.tar.xz +/firefox-langpacks-142.0-20250812.tar.xz diff --git a/firefox.spec b/firefox.spec index 4973ac4..2727d33 100644 --- a/firefox.spec +++ b/firefox.spec @@ -200,14 +200,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 141.0.3 +Version: 142.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250811.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250812.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1282,6 +1282,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Aug 12 2025 Martin Stransky - 142.0-1 +- Updated to 142.0 + * Mon Aug 11 2025 Martin Stransky - 141.0.3-1 - Updated to 141.0.3 diff --git a/sources b/sources index 3e3284b..f22879a 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-langpacks-141.0.3-20250811.tar.xz) = 2fbc6a36cfc367cea2debe2d92bdca5a7ac17e3a26969f96c6cb48aa332d2fc9e520a6a3de15354ea656fab81d11b6a98d826c10457421df79af82bcc8e60270 -SHA512 (firefox-141.0.3.source.tar.xz) = b660b018840c41a254734b4847a791f1a9fd2f72dbea825ea5971fd0b3269a43f1f4be1ccf4a53f7809b6b98398f4e04a142e57f8882d6590bab636ef75002f6 +SHA512 (firefox-142.0.source.tar.xz) = b0c1c766083a30a92b77dcf16a584d9fb341cd811d21c3a34da4cd0d714fd6adc73b608092d66058697bc4562faacc44859153e49ffdeb6e14e059e59f2ea246 +SHA512 (firefox-langpacks-142.0-20250812.tar.xz) = fe985f08767b7cc40aea43ce3fa85580518d64c5e9bc526d7505c62cfee8d59054c5714dfe99bd845c882756687ca9a20c581bc477f8371b515f15f3387b987e From b11c19c1ffec63b7fc61495b53cdb30c1af1870a Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 14 Aug 2025 15:29:38 +0200 Subject: [PATCH 495/545] Build updates --- 0001-GLIBCXX-fix-for-GCC-12.patch | 25 ++++---------- firefox.spec | 4 +-- pgo.patch | 54 +++++++++++++++---------------- wasi.patch | 2 +- 4 files changed, 36 insertions(+), 49 deletions(-) diff --git a/0001-GLIBCXX-fix-for-GCC-12.patch b/0001-GLIBCXX-fix-for-GCC-12.patch index 37d6f50..55153a1 100644 --- a/0001-GLIBCXX-fix-for-GCC-12.patch +++ b/0001-GLIBCXX-fix-for-GCC-12.patch @@ -1,16 +1,6 @@ -From efd5bc0715e5477318be95a76811cda0a89e8289 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= -Date: Fri, 4 Mar 2022 12:00:26 +0100 -Subject: [PATCH] GLIBCXX fix for GCC 12? - ---- - build/unix/stdc++compat/stdc++compat.cpp | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -diff --git a/build/unix/stdc++compat/stdc++compat.cpp b/build/unix/stdc++compat/stdc++compat.cpp -index 0180f6bcfa998..8d7a542ff11f0 100644 ---- a/build/unix/stdc++compat/stdc++compat.cpp -+++ b/build/unix/stdc++compat/stdc++compat.cpp +diff -up firefox-142.0/build/unix/stdc++compat/stdc++compat.cpp.0001-GLIBCXX-fix-for-GCC-12 firefox-142.0/build/unix/stdc++compat/stdc++compat.cpp +--- firefox-142.0/build/unix/stdc++compat/stdc++compat.cpp.0001-GLIBCXX-fix-for-GCC-12 2025-08-11 20:04:27.000000000 +0200 ++++ firefox-142.0/build/unix/stdc++compat/stdc++compat.cpp 2025-08-14 15:02:05.496137133 +0200 @@ -24,6 +24,7 @@ GLIBCXX_3.4.27 is from gcc 10 GLIBCXX_3.4.28 is from gcc 10 @@ -19,9 +9,9 @@ index 0180f6bcfa998..8d7a542ff11f0 100644 This file adds the necessary compatibility tricks to avoid symbols with version GLIBCXX_3.4.20 and bigger, keeping binary compatibility with -@@ -69,6 +70,19 @@ void __attribute__((weak)) __throw_bad_array_new_length() { MOZ_CRASH(); } - } // namespace std - #endif +@@ -94,6 +95,19 @@ void operator delete(void* ptr, size_t s + } + # endif +#if _GLIBCXX_RELEASE >= 12 +namespace std { @@ -39,6 +29,3 @@ index 0180f6bcfa998..8d7a542ff11f0 100644 /* While we generally don't build with exceptions, we have some host tools * that do use them. libstdc++ from GCC 5.0 added exception constructors with * char const* argument. Older versions only have a constructor with --- -2.35.1 - diff --git a/firefox.spec b/firefox.spec index 2727d33..461b905 100644 --- a/firefox.spec +++ b/firefox.spec @@ -154,9 +154,9 @@ ExcludeArch: i686 %endif %if %{?system_nss} -%global nspr_version 4.32 +%global nspr_version 4.37 %global nspr_build_version %{nspr_version} -%global nss_version 3.110 +%global nss_version 3.114 %global nss_build_version %{nss_version} %endif diff --git a/pgo.patch b/pgo.patch index 3d8a0b1..69a6741 100644 --- a/pgo.patch +++ b/pgo.patch @@ -1,7 +1,7 @@ -diff -up firefox-128.0/build/moz.configure/lto-pgo.configure.pgo firefox-128.0/build/moz.configure/lto-pgo.configure ---- firefox-128.0/build/moz.configure/lto-pgo.configure.pgo 2024-07-02 00:34:14.000000000 +0200 -+++ firefox-128.0/build/moz.configure/lto-pgo.configure 2024-07-02 17:59:44.425650444 +0200 -@@ -90,12 +90,16 @@ set_config("PGO_PROFILE_PATH", pgo_profi +diff -up firefox-142.0/build/moz.configure/lto-pgo.configure.pgo firefox-142.0/build/moz.configure/lto-pgo.configure +--- firefox-142.0/build/moz.configure/lto-pgo.configure.pgo 2025-08-11 20:04:27.000000000 +0200 ++++ firefox-142.0/build/moz.configure/lto-pgo.configure 2025-08-14 15:04:02.135920021 +0200 +@@ -96,12 +96,16 @@ set_config("PGO_PROFILE_PATH", pgo_profi @depends( "--enable-profile-use", @@ -19,7 +19,7 @@ diff -up firefox-128.0/build/moz.configure/lto-pgo.configure.pgo firefox-128.0/b if not profile_use: return None -@@ -133,7 +137,7 @@ def pgo_flags( +@@ -145,7 +149,7 @@ def pgo_flags( return namespace( gen_cflags=["-fprofile-generate"], gen_ldflags=["-fprofile-generate"], @@ -28,19 +28,19 @@ diff -up firefox-128.0/build/moz.configure/lto-pgo.configure.pgo firefox-128.0/b use_ldflags=["-fprofile-use"], ) -diff -up firefox-128.0/build/pgo/profileserver.py.pgo firefox-128.0/build/pgo/profileserver.py ---- firefox-128.0/build/pgo/profileserver.py.pgo 2024-07-02 00:34:15.000000000 +0200 -+++ firefox-128.0/build/pgo/profileserver.py 2024-07-02 17:59:44.425650444 +0200 -@@ -11,7 +11,7 @@ import subprocess +diff -up firefox-142.0/build/pgo/profileserver.py.pgo firefox-142.0/build/pgo/profileserver.py +--- firefox-142.0/build/pgo/profileserver.py.pgo 2025-08-11 20:04:27.000000000 +0200 ++++ firefox-142.0/build/pgo/profileserver.py 2025-08-14 15:05:07.519412644 +0200 +@@ -10,7 +10,7 @@ import subprocess import sys import mozcrash -from mozbuild.base import BinaryNotFoundException, MozbuildObject +from mozbuild.base import BinaryNotFoundException, MozbuildObject, BuildEnvironmentNotFoundException - from mozfile import TemporaryDirectory + from mozfile import TemporaryDirectory, json from mozhttpd import MozHttpd from mozprofile import FirefoxProfile, Preferences -@@ -97,9 +97,22 @@ if __name__ == "__main__": +@@ -96,9 +96,22 @@ if __name__ == "__main__": locations = ServerLocations() locations.add_host(host="127.0.0.1", port=PORT, options="primary,privileged") @@ -66,10 +66,10 @@ diff -up firefox-128.0/build/pgo/profileserver.py.pgo firefox-128.0/build/pgo/pr with TemporaryDirectory() as profilePath: # TODO: refactor this into mozprofile -diff -up firefox-128.0/gfx/2d/moz.build.pgo firefox-128.0/gfx/2d/moz.build ---- firefox-128.0/gfx/2d/moz.build.pgo 2024-07-02 00:34:17.000000000 +0200 -+++ firefox-128.0/gfx/2d/moz.build 2024-07-02 17:59:44.425650444 +0200 -@@ -135,11 +135,11 @@ if CONFIG["INTEL_ARCHITECTURE"]: +diff -up firefox-142.0/gfx/2d/moz.build.pgo firefox-142.0/gfx/2d/moz.build +--- firefox-142.0/gfx/2d/moz.build.pgo 2025-08-11 20:04:29.000000000 +0200 ++++ firefox-142.0/gfx/2d/moz.build 2025-08-14 15:04:02.136286381 +0200 +@@ -138,11 +138,11 @@ if CONFIG["INTEL_ARCHITECTURE"]: # The file uses SSE2 intrinsics, so it needs special compile flags on some # compilers. SOURCES["BlurSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] @@ -83,10 +83,10 @@ diff -up firefox-128.0/gfx/2d/moz.build.pgo firefox-128.0/gfx/2d/moz.build SOURCES["SwizzleSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] SOURCES["SwizzleSSSE3.cpp"].flags += CONFIG["SSSE3_FLAGS"] elif CONFIG["TARGET_CPU"].startswith("mips"): -diff -up firefox-128.0/gfx/skia/generate_mozbuild.py.pgo firefox-128.0/gfx/skia/generate_mozbuild.py ---- firefox-128.0/gfx/skia/generate_mozbuild.py.pgo 2024-07-02 17:59:44.425650444 +0200 -+++ firefox-128.0/gfx/skia/generate_mozbuild.py 2024-07-02 18:17:40.973081400 +0200 -@@ -54,8 +54,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind +diff -up firefox-142.0/gfx/skia/generate_mozbuild.py.pgo firefox-142.0/gfx/skia/generate_mozbuild.py +--- firefox-142.0/gfx/skia/generate_mozbuild.py.pgo 2025-08-11 20:04:30.000000000 +0200 ++++ firefox-142.0/gfx/skia/generate_mozbuild.py 2025-08-14 15:04:02.136434775 +0200 +@@ -50,8 +50,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind if CONFIG['INTEL_ARCHITECTURE']: SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX'] skia_ssse3_flags = ['-Dskvx=skvx_ssse3', '-mssse3'] @@ -97,10 +97,10 @@ diff -up firefox-128.0/gfx/skia/generate_mozbuild.py.pgo firefox-128.0/gfx/skia/ SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags += skia_ssse3_flags SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags += skia_ssse3_flags SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3'] -diff -up firefox-128.0/gfx/skia/moz.build.pgo firefox-128.0/gfx/skia/moz.build ---- firefox-128.0/gfx/skia/moz.build.pgo 2024-07-02 17:59:44.425650444 +0200 -+++ firefox-128.0/gfx/skia/moz.build 2024-07-02 18:19:21.092831537 +0200 -@@ -582,8 +582,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind +diff -up firefox-142.0/gfx/skia/moz.build.pgo firefox-142.0/gfx/skia/moz.build +--- firefox-142.0/gfx/skia/moz.build.pgo 2025-08-11 20:04:30.000000000 +0200 ++++ firefox-142.0/gfx/skia/moz.build 2025-08-14 15:04:02.136573991 +0200 +@@ -597,8 +597,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind if CONFIG['INTEL_ARCHITECTURE']: SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX'] skia_ssse3_flags = ['-Dskvx=skvx_ssse3', '-mssse3'] @@ -111,10 +111,10 @@ diff -up firefox-128.0/gfx/skia/moz.build.pgo firefox-128.0/gfx/skia/moz.build SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags += skia_ssse3_flags SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags += skia_ssse3_flags SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3'] -diff -up firefox-128.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-128.0/toolkit/components/terminator/nsTerminator.cpp ---- firefox-128.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2024-07-02 00:34:32.000000000 +0200 -+++ firefox-128.0/toolkit/components/terminator/nsTerminator.cpp 2024-07-02 17:59:44.425650444 +0200 -@@ -332,6 +332,11 @@ void nsTerminator::StartWatchdog() { +diff -up firefox-142.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-142.0/toolkit/components/terminator/nsTerminator.cpp +--- firefox-142.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2025-08-11 20:04:46.000000000 +0200 ++++ firefox-142.0/toolkit/components/terminator/nsTerminator.cpp 2025-08-14 15:04:02.136726031 +0200 +@@ -330,6 +330,11 @@ void nsTerminator::StartWatchdog() { } #endif diff --git a/wasi.patch b/wasi.patch index 4c08f72..7bff8a0 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-141.0.3-build/firefox-141.0.3/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-142.0-build/firefox-142.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 13c9319e5fa4791031b6d814063319a633768398 Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Sat, 23 Aug 2025 17:58:40 +0200 Subject: [PATCH 496/545] Drop unused yasm build dependency Part of: https://fedoraproject.org/wiki/Changes/DeprecateYASM A quick grep in sources suggests that yasm is used only in bundled libvpx sources (we're using the system one), and even that can be built with nasm instead. --- firefox.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index 461b905..a2c1e19 100644 --- a/firefox.spec +++ b/firefox.spec @@ -201,7 +201,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 142.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -336,7 +336,6 @@ BuildRequires: pkgconfig(libwebpdemux) >= %{libwebp_version} %endif BuildRequires: autoconf213 BuildRequires: pkgconfig(libpulse) -BuildRequires: yasm BuildRequires: llvm BuildRequires: llvm-devel BuildRequires: clang @@ -1282,6 +1281,10 @@ fi #--------------------------------------------------------------------- %changelog +* Sat Aug 23 2025 Dominik Mierzejewski - 142.0-2 +- Drop unused yasm build dependency, part of: + https://fedoraproject.org/wiki/Changes/DeprecateYASM + * Tue Aug 12 2025 Martin Stransky - 142.0-1 - Updated to 142.0 From 74ec41e9ec185bfe17723625577295175d9ce8ed Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 25 Aug 2025 14:34:03 +0200 Subject: [PATCH 497/545] Fix build with llvm-21 --- firefox.spec | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/firefox.spec b/firefox.spec index a2c1e19..cc00707 100644 --- a/firefox.spec +++ b/firefox.spec @@ -201,7 +201,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 142.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -745,11 +745,7 @@ echo "ac_add_options --with-google-safebrowsing-api-keyfile=`pwd`/google-api-key # https://bugzilla.redhat.com/show_bug.cgi?id=2239046 # with clang 17 upstream's detection fails, so let's just tell it # where to look -%if 0%{?fedora} >= 42 -echo "ac_add_options --with-libclang-path=`llvm-config-20 --libdir`" >> .mozconfig -%else echo "ac_add_options --with-libclang-path=`llvm-config --libdir`" >> .mozconfig -%endif %if %{enable_replace_malloc} echo "ac_add_options --enable-replace-malloc" >> .mozconfig @@ -1281,6 +1277,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Aug 15 2025 Tom Stellard - 142.0-3 +- Fix build with llvm-21 + * Sat Aug 23 2025 Dominik Mierzejewski - 142.0-2 - Drop unused yasm build dependency, part of: https://fedoraproject.org/wiki/Changes/DeprecateYASM From 56372fb8f8f901af50be04f33fbb98bc7abc80f3 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 25 Aug 2025 17:07:55 +0200 Subject: [PATCH 498/545] Changelog fix --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index cc00707..39ecb3c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1277,7 +1277,7 @@ fi #--------------------------------------------------------------------- %changelog -* Fri Aug 15 2025 Tom Stellard - 142.0-3 +* Mon Aug 25 2025 Tom Stellard - 142.0-3 - Fix build with llvm-21 * Sat Aug 23 2025 Dominik Mierzejewski - 142.0-2 From 2d7fde7ef198c95a963fa694bddf1b41f46919b7 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 27 Aug 2025 12:02:10 +0200 Subject: [PATCH 499/545] Updated to 142.0.1 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 8318831..0a97a30 100644 --- a/.gitignore +++ b/.gitignore @@ -726,3 +726,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-141.0.3.source.tar.xz /firefox-142.0.source.tar.xz /firefox-langpacks-142.0-20250812.tar.xz +/firefox-langpacks-142.0.1-20250827.tar.xz +/firefox-142.0.1.source.tar.xz diff --git a/firefox.spec b/firefox.spec index 39ecb3c..a596254 100644 --- a/firefox.spec +++ b/firefox.spec @@ -200,14 +200,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 142.0 -Release: 3%{?pre_tag}%{?dist} +Version: 142.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250812.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250827.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1277,6 +1277,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Aug 27 2025 Martin Stransky - 142.0.1-1 +- Updated to 142.0.1 + * Mon Aug 25 2025 Tom Stellard - 142.0-3 - Fix build with llvm-21 diff --git a/sources b/sources index f22879a..b4188da 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-142.0.source.tar.xz) = b0c1c766083a30a92b77dcf16a584d9fb341cd811d21c3a34da4cd0d714fd6adc73b608092d66058697bc4562faacc44859153e49ffdeb6e14e059e59f2ea246 -SHA512 (firefox-langpacks-142.0-20250812.tar.xz) = fe985f08767b7cc40aea43ce3fa85580518d64c5e9bc526d7505c62cfee8d59054c5714dfe99bd845c882756687ca9a20c581bc477f8371b515f15f3387b987e +SHA512 (firefox-langpacks-142.0.1-20250827.tar.xz) = d6b9db42c4679115dbdb7e58c5f0d7f80abdc787d24b3d10f3ee9ea99c632800a344d8a4d2345e134abea9bf4056ab0a7a52d171c7b61520db441a7440f01c27 +SHA512 (firefox-142.0.1.source.tar.xz) = fca1b9c67a0b2f216f1f11fd5e3a08920998921e3d61eb633f1dde7fe69cb40cdbb63a41a1dfc4f1022509da643e3791467d88e62e7ea30b293ebf69d87bb585 From feb0fe313d64c2e58f4a370fc05cc3154621d8f6 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 10 Sep 2025 10:51:05 +0200 Subject: [PATCH 500/545] Updated to 143.0 --- firefox.spec | 7 +++++-- sources | 4 ++-- wasi.patch | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/firefox.spec b/firefox.spec index a596254..60f640d 100644 --- a/firefox.spec +++ b/firefox.spec @@ -200,14 +200,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 142.0.1 +Version: 143.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250827.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250909.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1277,6 +1277,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Sep 10 2025 Martin Stransky - 143.0-1 +- Updated to 143.0 + * Wed Aug 27 2025 Martin Stransky - 142.0.1-1 - Updated to 142.0.1 diff --git a/sources b/sources index b4188da..4d0a0f4 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-langpacks-142.0.1-20250827.tar.xz) = d6b9db42c4679115dbdb7e58c5f0d7f80abdc787d24b3d10f3ee9ea99c632800a344d8a4d2345e134abea9bf4056ab0a7a52d171c7b61520db441a7440f01c27 -SHA512 (firefox-142.0.1.source.tar.xz) = fca1b9c67a0b2f216f1f11fd5e3a08920998921e3d61eb633f1dde7fe69cb40cdbb63a41a1dfc4f1022509da643e3791467d88e62e7ea30b293ebf69d87bb585 +SHA512 (firefox-143.0.source.tar.xz) = 49fe5e5dbb7539be3e4c517d3cac453ea9b739e61040c4ac1abcf3d6665732fba5ff91fb040f3c0294af0f8c2824235a94e60ac9c26e25cb14d89d4b50c8a911 +SHA512 (firefox-langpacks-143.0-20250909.tar.xz) = e14f4053620c373ec54f7660e59f572f4a64346a2e8a08c4e6a5448d0443c4d0e307f832013b5140d0c7fd9c342cf5606f140ae1b9bc8fba4e94fd13eb921173 diff --git a/wasi.patch b/wasi.patch index 7bff8a0..7151b04 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-142.0-build/firefox-142.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-143.0-build/firefox-143.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 6304afcc4b4fd2b9967787419e09097d5cf5fb3d Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 11 Sep 2025 14:14:38 +0200 Subject: [PATCH 501/545] nss version update --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 60f640d..860bea9 100644 --- a/firefox.spec +++ b/firefox.spec @@ -156,7 +156,7 @@ ExcludeArch: i686 %if %{?system_nss} %global nspr_version 4.37 %global nspr_build_version %{nspr_version} -%global nss_version 3.114 +%global nss_version 3.115 %global nss_build_version %{nss_version} %endif From 634cc6b04f6e48140f07b78c96bd1addfd3166ff Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 19 Sep 2025 09:24:51 +0200 Subject: [PATCH 502/545] Updated to 143.0.1 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 0a97a30..eea0fe0 100644 --- a/.gitignore +++ b/.gitignore @@ -728,3 +728,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-142.0-20250812.tar.xz /firefox-langpacks-142.0.1-20250827.tar.xz /firefox-142.0.1.source.tar.xz +/firefox-143.0.1.source.tar.xz +/firefox-langpacks-143.0.1-20250919.tar.xz diff --git a/firefox.spec b/firefox.spec index 860bea9..9c91399 100644 --- a/firefox.spec +++ b/firefox.spec @@ -200,14 +200,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 143.0 +Version: 143.0.1 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250909.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250919.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1277,6 +1277,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Sep 19 2025 Martin Stransky - 143.0.1-1 +- Updated to 143.0.1 + * Wed Sep 10 2025 Martin Stransky - 143.0-1 - Updated to 143.0 diff --git a/sources b/sources index 4d0a0f4..156b6e6 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-143.0.source.tar.xz) = 49fe5e5dbb7539be3e4c517d3cac453ea9b739e61040c4ac1abcf3d6665732fba5ff91fb040f3c0294af0f8c2824235a94e60ac9c26e25cb14d89d4b50c8a911 -SHA512 (firefox-langpacks-143.0-20250909.tar.xz) = e14f4053620c373ec54f7660e59f572f4a64346a2e8a08c4e6a5448d0443c4d0e307f832013b5140d0c7fd9c342cf5606f140ae1b9bc8fba4e94fd13eb921173 +SHA512 (firefox-143.0.1.source.tar.xz) = ef00d8bab715e7c2f4c138cfce0698e004f0616c767c8a7fa918e24e4a9f9151c41184d9c089ccbc6ab46a3b4bf6f12d723196f47e9c9d7f55f2ca44bab17cb2 +SHA512 (firefox-langpacks-143.0.1-20250919.tar.xz) = 8c04e5fce3fa27e74b7e8580bf19f81da290a5d1ccc982dca9cf3c6964769f77b3ba1659874b343091a3405ca4ef1725cf4c23578424cf7e36f0c7bed758fe93 From 4b7cbfdd1fd850c52900e27a86d1c039e02cf280 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 25 Sep 2025 11:32:43 +0200 Subject: [PATCH 503/545] Added fix for mzbz#1984368 --- D263545.1758878742.diff | 143 ++++++++++++++++++++++++++++++++++++++++ firefox.spec | 7 +- wasi.patch | 2 +- 3 files changed, 150 insertions(+), 2 deletions(-) create mode 100644 D263545.1758878742.diff diff --git a/D263545.1758878742.diff b/D263545.1758878742.diff new file mode 100644 index 0000000..f99ebee --- /dev/null +++ b/D263545.1758878742.diff @@ -0,0 +1,143 @@ +diff --git a/widget/gtk/WaylandBuffer.h b/widget/gtk/WaylandBuffer.h +--- a/widget/gtk/WaylandBuffer.h ++++ b/widget/gtk/WaylandBuffer.h +@@ -62,11 +62,11 @@ + return aSize == mSize; + } + + bool IsAttached() const; + +- BufferTransaction* GetTransaction(); ++ BufferTransaction* GetTransaction(const WaylandSurfaceLock& aSurfaceLock); + void RemoveTransaction(RefPtr aTransaction); + + #ifdef MOZ_LOGGING + virtual void DumpToFile(const char* aHint) = 0; + #endif +@@ -207,10 +207,14 @@ + + bool MatchesBuffer(uintptr_t aBuffer) { + return aBuffer == reinterpret_cast(mBuffer.get()); + } + ++ bool CanRecycle(WaylandSurface* aSurface) { ++ return IsDetached() && (!mSurface || mSurface == aSurface); ++ } ++ + private: + ~BufferTransaction(); + + void WlBufferDeleteLocked(const WaylandSurfaceLock& aSurfaceLock); + void DeleteLocked(const WaylandSurfaceLock& aSurfaceLock); +diff --git a/widget/gtk/WaylandBuffer.cpp b/widget/gtk/WaylandBuffer.cpp +--- a/widget/gtk/WaylandBuffer.cpp ++++ b/widget/gtk/WaylandBuffer.cpp +@@ -97,13 +97,14 @@ + } + } + return false; + } + +-BufferTransaction* WaylandBuffer::GetTransaction() { ++BufferTransaction* WaylandBuffer::GetTransaction( ++ const WaylandSurfaceLock& aSurfaceLock) { + for (const auto& transaction : mBufferTransactions) { +- if (transaction->IsDetached()) { ++ if (transaction->CanRecycle(aSurfaceLock.GetWaylandSurface())) { + LOGWAYLAND("WaylandBuffer::GetTransaction() [%p] reuse transaction [%d]", + (void*)this, (int)mBufferTransactions.Length()); + return transaction; + } + } +@@ -118,13 +119,13 @@ + return nullptr; + } + + LOGWAYLAND( + "WaylandBuffer::GetTransaction() create new [%p] wl_buffer [%p] " +- "transactions [%d] external buffer [%d]", ++ "transactions [%d] external buffer [%d] WaylandSurface [%p]", + (void*)this, buffer, (int)mBufferTransactions.Length(), +- !!mExternalWlBuffer); ++ !!mExternalWlBuffer, aSurfaceLock.GetWaylandSurface()); + + auto* transaction = new BufferTransaction(this, buffer, !!mExternalWlBuffer); + mBufferTransactions.AppendElement(transaction); + return transaction; + } +@@ -330,16 +331,19 @@ + + wl_buffer* BufferTransaction::BufferBorrowLocked( + const WaylandSurfaceLock& aSurfaceLock) { + LOGWAYLAND( + "BufferTransaction::BufferBorrow() [%p] widget [%p] WaylandSurface [%p] " +- "(old %p) " + "WaylandBuffer [%p]", + this, aSurfaceLock.GetWaylandSurface()->GetLoggingWidget(), +- aSurfaceLock.GetWaylandSurface(), mSurface.get(), mBuffer.get()); ++ aSurfaceLock.GetWaylandSurface(), mBuffer.get()); + ++ MOZ_DIAGNOSTIC_ASSERT( ++ !mSurface || mSurface == aSurfaceLock.GetWaylandSurface(), ++ "Can't transfer transaction between WaylandSurfaces!"); + MOZ_DIAGNOSTIC_ASSERT(mBufferState == BufferState::Detached); ++ + mSurface = aSurfaceLock.GetWaylandSurface(); + + // We don't take reference to this. Some compositors doesn't send + // buffer release callback and we may leak BufferTransaction then. + // Rather we destroy wl_buffer at end which makes sure no release callback +diff --git a/widget/gtk/WaylandSurface.h b/widget/gtk/WaylandSurface.h +--- a/widget/gtk/WaylandSurface.h ++++ b/widget/gtk/WaylandSurface.h +@@ -298,10 +298,11 @@ + void Unlock(struct wl_surface** aSurface, + WaylandSurfaceLock* aWaylandSurfaceLock); + void Commit(WaylandSurfaceLock* aProofOfLock, bool aForceCommit, + bool aForceDisplayFlush); + ++ // Get buffer transaction for WaylandBuffer, create new or recycle one. + BufferTransaction* GetNextTransactionLocked( + const WaylandSurfaceLock& aSurfaceLock, WaylandBuffer* aBuffer); + // Force release/detele all transactions and wl_buffers attached to them. + void ReleaseAllWaylandTransactionsLocked(WaylandSurfaceLock& aSurfaceLock); + +diff --git a/widget/gtk/WaylandSurface.cpp b/widget/gtk/WaylandSurface.cpp +--- a/widget/gtk/WaylandSurface.cpp ++++ b/widget/gtk/WaylandSurface.cpp +@@ -1152,16 +1152,19 @@ + mBufferTransactions.RemoveElement(aTransaction); + MOZ_DIAGNOSTIC_ASSERT(!mBufferTransactions.Contains(aTransaction)); + } + + BufferTransaction* WaylandSurface::GetNextTransactionLocked( +- const WaylandSurfaceLock& aProofOfLock, WaylandBuffer* aBuffer) { +- auto* nextTransaction = aBuffer->GetTransaction(); ++ const WaylandSurfaceLock& aSurfaceLock, WaylandBuffer* aBuffer) { ++ auto* nextTransaction = aBuffer->GetTransaction(aSurfaceLock); + if (!nextTransaction) { + return nullptr; + } + ++ // Iterate through transactions attached to this WaylandSurface ++ // and delete detached transactions which belongs to old (previously attached) ++ // WaylandBuffer. + auto transactions = std::move(mBufferTransactions); + bool addedNext = false; + // DeleteTransactionLocked() may delete BufferTransaction so + // iterate with ref taken. + for (auto t : transactions) { +@@ -1175,11 +1178,11 @@ + continue; + } + MOZ_DIAGNOSTIC_ASSERT(!t->IsDeleted()); + // Remove detached transactions from unused buffers. + if (t->IsDetached() && !t->MatchesBuffer(mLatestAttachedBuffer)) { +- t->DeleteTransactionLocked(aProofOfLock); ++ t->DeleteTransactionLocked(aSurfaceLock); + } else { + mBufferTransactions.AppendElement(t); + } + } + if (!addedNext) { + diff --git a/firefox.spec b/firefox.spec index 9c91399..789076d 100644 --- a/firefox.spec +++ b/firefox.spec @@ -201,7 +201,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 143.0.1 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -286,6 +286,7 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch +Patch408: D263545.1758878742.diff # PGO/LTO patches Patch600: pgo.patch @@ -604,6 +605,7 @@ cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysr %patch -P402 -p1 -b .1196777 %patch -P407 -p1 -b .1667096 +%patch -P408 -p1 -b .D263545.1758878742 # PGO patches %if %{build_with_pgo} @@ -1277,6 +1279,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Sep 25 2025 Martin Stransky - 143.0.1-2 +- Added fix for mzbz#1984368 + * Fri Sep 19 2025 Martin Stransky - 143.0.1-1 - Updated to 143.0.1 diff --git a/wasi.patch b/wasi.patch index 7151b04..e56f1fa 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-143.0-build/firefox-143.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-143.0.1-build/firefox-143.0.1/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 90c68a6ff356230a9510575d464ccb7b514496ac Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 26 Sep 2025 08:45:49 +0200 Subject: [PATCH 504/545] Added fix for mzbz#1990162 --- D265754.1758954428.diff | 34 ++++++++++++++++++++++++++++++++++ firefox.spec | 7 ++++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 D265754.1758954428.diff diff --git a/D265754.1758954428.diff b/D265754.1758954428.diff new file mode 100644 index 0000000..cfcf9cd --- /dev/null +++ b/D265754.1758954428.diff @@ -0,0 +1,34 @@ +diff --git a/widget/gtk/DMABufDevice.cpp b/widget/gtk/DMABufDevice.cpp +--- a/widget/gtk/DMABufDevice.cpp ++++ b/widget/gtk/DMABufDevice.cpp +@@ -195,11 +195,14 @@ + int DMABufDevice::GetDmabufFD(uint32_t aGEMHandle) { + int fd; + return GbmLib::DrmPrimeHandleToFD(mDRMFd, aGEMHandle, 0, &fd) < 0 ? -1 : fd; + } + +-int DMABufDevice::OpenDRMFd() { return open(mDrmRenderNode.get(), O_RDWR); } ++int DMABufDevice::OpenDRMFd() { ++ LOGDMABUF(("DMABufDevice::OpenDRMFd() DRM device %s", mDrmRenderNode.get())); ++ return open(mDrmRenderNode.get(), O_RDWR | O_CLOEXEC); ++} + + bool DMABufDevice::IsEnabled(nsACString& aFailureId) { + if (mDRMFd == -1) { + aFailureId = mFailureId; + } +@@ -250,12 +253,11 @@ + LOGDMABUF(("We're missing DRM render device!\n")); + mFailureId = "FEATURE_FAILURE_NO_DRM_DEVICE"; + return false; + } + +- LOGDMABUF(("Using DRM device %s", mDrmRenderNode.get())); +- mDRMFd = open(mDrmRenderNode.get(), O_RDWR); ++ mDRMFd = OpenDRMFd(); + if (mDRMFd < 0) { + LOGDMABUF(("Failed to open drm render node %s error %s\n", + mDrmRenderNode.get(), strerror(errno))); + mFailureId = "FEATURE_FAILURE_NO_DRM_DEVICE"; + return false; + diff --git a/firefox.spec b/firefox.spec index 789076d..70ccd03 100644 --- a/firefox.spec +++ b/firefox.spec @@ -201,7 +201,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 143.0.1 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -287,6 +287,7 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch Patch408: D263545.1758878742.diff +Patch409: D265754.1758954428.diff # PGO/LTO patches Patch600: pgo.patch @@ -606,6 +607,7 @@ cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysr %patch -P402 -p1 -b .1196777 %patch -P407 -p1 -b .1667096 %patch -P408 -p1 -b .D263545.1758878742 +%patch -P409 -p1 -b .D265754.1758954428 # PGO patches %if %{build_with_pgo} @@ -1279,6 +1281,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Sep 26 2025 Martin Stransky - 143.0.1-3 +- Added fix for mzbz#1990162 + * Thu Sep 25 2025 Martin Stransky - 143.0.1-2 - Added fix for mzbz#1984368 From 0aced88ad79758b4ebb910d3e4ed7cc8aa49ae3a Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 30 Sep 2025 09:07:07 +0200 Subject: [PATCH 505/545] Updated to 143.0.3 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 2 ++ wasi.patch | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index eea0fe0..641f59d 100644 --- a/.gitignore +++ b/.gitignore @@ -730,3 +730,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-142.0.1.source.tar.xz /firefox-143.0.1.source.tar.xz /firefox-langpacks-143.0.1-20250919.tar.xz +/firefox-langpacks-143.0.3-20250930.tar.xz +/firefox-143.0.3.source.tar.xz diff --git a/firefox.spec b/firefox.spec index 70ccd03..34449f0 100644 --- a/firefox.spec +++ b/firefox.spec @@ -200,14 +200,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 143.0.1 -Release: 3%{?pre_tag}%{?dist} +Version: 143.0.3 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250919.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250930.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1281,6 +1281,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Sep 30 2025 Martin Stransky - 143.0.3-1 +- Updated to 143.0.3 + * Fri Sep 26 2025 Martin Stransky - 143.0.1-3 - Added fix for mzbz#1990162 diff --git a/sources b/sources index 156b6e6..ca79c5a 100644 --- a/sources +++ b/sources @@ -5,3 +5,5 @@ SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f SHA512 (firefox-143.0.1.source.tar.xz) = ef00d8bab715e7c2f4c138cfce0698e004f0616c767c8a7fa918e24e4a9f9151c41184d9c089ccbc6ab46a3b4bf6f12d723196f47e9c9d7f55f2ca44bab17cb2 SHA512 (firefox-langpacks-143.0.1-20250919.tar.xz) = 8c04e5fce3fa27e74b7e8580bf19f81da290a5d1ccc982dca9cf3c6964769f77b3ba1659874b343091a3405ca4ef1725cf4c23578424cf7e36f0c7bed758fe93 +SHA512 (firefox-langpacks-143.0.3-20250930.tar.xz) = b5ceb263efbe02f60cacdf403843ac8339e9ea4cd58d8387133cb1ab1d5455de38135f8cc10139e2b8eda19d8a12917e07cab64b00e1319349ab7c51cf46f51d +SHA512 (firefox-143.0.3.source.tar.xz) = c092bd3aac79f856a804c908b76d40409ce052b00176269ea3029b5a3a6885d4d21ce26bd76c9ea13827ff75459b6b4b0566f5aa49035ac234ae5890c67845b0 diff --git a/wasi.patch b/wasi.patch index e56f1fa..2f9806e 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-143.0.1-build/firefox-143.0.1/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-143.0.3-build/firefox-143.0.3/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 32ea5807875da9864afe27650e92db954097796a Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 30 Sep 2025 09:08:17 +0200 Subject: [PATCH 506/545] removed already merged patch --- D263545.1758878742.diff | 143 ---------------------------------------- firefox.spec | 2 - 2 files changed, 145 deletions(-) delete mode 100644 D263545.1758878742.diff diff --git a/D263545.1758878742.diff b/D263545.1758878742.diff deleted file mode 100644 index f99ebee..0000000 --- a/D263545.1758878742.diff +++ /dev/null @@ -1,143 +0,0 @@ -diff --git a/widget/gtk/WaylandBuffer.h b/widget/gtk/WaylandBuffer.h ---- a/widget/gtk/WaylandBuffer.h -+++ b/widget/gtk/WaylandBuffer.h -@@ -62,11 +62,11 @@ - return aSize == mSize; - } - - bool IsAttached() const; - -- BufferTransaction* GetTransaction(); -+ BufferTransaction* GetTransaction(const WaylandSurfaceLock& aSurfaceLock); - void RemoveTransaction(RefPtr aTransaction); - - #ifdef MOZ_LOGGING - virtual void DumpToFile(const char* aHint) = 0; - #endif -@@ -207,10 +207,14 @@ - - bool MatchesBuffer(uintptr_t aBuffer) { - return aBuffer == reinterpret_cast(mBuffer.get()); - } - -+ bool CanRecycle(WaylandSurface* aSurface) { -+ return IsDetached() && (!mSurface || mSurface == aSurface); -+ } -+ - private: - ~BufferTransaction(); - - void WlBufferDeleteLocked(const WaylandSurfaceLock& aSurfaceLock); - void DeleteLocked(const WaylandSurfaceLock& aSurfaceLock); -diff --git a/widget/gtk/WaylandBuffer.cpp b/widget/gtk/WaylandBuffer.cpp ---- a/widget/gtk/WaylandBuffer.cpp -+++ b/widget/gtk/WaylandBuffer.cpp -@@ -97,13 +97,14 @@ - } - } - return false; - } - --BufferTransaction* WaylandBuffer::GetTransaction() { -+BufferTransaction* WaylandBuffer::GetTransaction( -+ const WaylandSurfaceLock& aSurfaceLock) { - for (const auto& transaction : mBufferTransactions) { -- if (transaction->IsDetached()) { -+ if (transaction->CanRecycle(aSurfaceLock.GetWaylandSurface())) { - LOGWAYLAND("WaylandBuffer::GetTransaction() [%p] reuse transaction [%d]", - (void*)this, (int)mBufferTransactions.Length()); - return transaction; - } - } -@@ -118,13 +119,13 @@ - return nullptr; - } - - LOGWAYLAND( - "WaylandBuffer::GetTransaction() create new [%p] wl_buffer [%p] " -- "transactions [%d] external buffer [%d]", -+ "transactions [%d] external buffer [%d] WaylandSurface [%p]", - (void*)this, buffer, (int)mBufferTransactions.Length(), -- !!mExternalWlBuffer); -+ !!mExternalWlBuffer, aSurfaceLock.GetWaylandSurface()); - - auto* transaction = new BufferTransaction(this, buffer, !!mExternalWlBuffer); - mBufferTransactions.AppendElement(transaction); - return transaction; - } -@@ -330,16 +331,19 @@ - - wl_buffer* BufferTransaction::BufferBorrowLocked( - const WaylandSurfaceLock& aSurfaceLock) { - LOGWAYLAND( - "BufferTransaction::BufferBorrow() [%p] widget [%p] WaylandSurface [%p] " -- "(old %p) " - "WaylandBuffer [%p]", - this, aSurfaceLock.GetWaylandSurface()->GetLoggingWidget(), -- aSurfaceLock.GetWaylandSurface(), mSurface.get(), mBuffer.get()); -+ aSurfaceLock.GetWaylandSurface(), mBuffer.get()); - -+ MOZ_DIAGNOSTIC_ASSERT( -+ !mSurface || mSurface == aSurfaceLock.GetWaylandSurface(), -+ "Can't transfer transaction between WaylandSurfaces!"); - MOZ_DIAGNOSTIC_ASSERT(mBufferState == BufferState::Detached); -+ - mSurface = aSurfaceLock.GetWaylandSurface(); - - // We don't take reference to this. Some compositors doesn't send - // buffer release callback and we may leak BufferTransaction then. - // Rather we destroy wl_buffer at end which makes sure no release callback -diff --git a/widget/gtk/WaylandSurface.h b/widget/gtk/WaylandSurface.h ---- a/widget/gtk/WaylandSurface.h -+++ b/widget/gtk/WaylandSurface.h -@@ -298,10 +298,11 @@ - void Unlock(struct wl_surface** aSurface, - WaylandSurfaceLock* aWaylandSurfaceLock); - void Commit(WaylandSurfaceLock* aProofOfLock, bool aForceCommit, - bool aForceDisplayFlush); - -+ // Get buffer transaction for WaylandBuffer, create new or recycle one. - BufferTransaction* GetNextTransactionLocked( - const WaylandSurfaceLock& aSurfaceLock, WaylandBuffer* aBuffer); - // Force release/detele all transactions and wl_buffers attached to them. - void ReleaseAllWaylandTransactionsLocked(WaylandSurfaceLock& aSurfaceLock); - -diff --git a/widget/gtk/WaylandSurface.cpp b/widget/gtk/WaylandSurface.cpp ---- a/widget/gtk/WaylandSurface.cpp -+++ b/widget/gtk/WaylandSurface.cpp -@@ -1152,16 +1152,19 @@ - mBufferTransactions.RemoveElement(aTransaction); - MOZ_DIAGNOSTIC_ASSERT(!mBufferTransactions.Contains(aTransaction)); - } - - BufferTransaction* WaylandSurface::GetNextTransactionLocked( -- const WaylandSurfaceLock& aProofOfLock, WaylandBuffer* aBuffer) { -- auto* nextTransaction = aBuffer->GetTransaction(); -+ const WaylandSurfaceLock& aSurfaceLock, WaylandBuffer* aBuffer) { -+ auto* nextTransaction = aBuffer->GetTransaction(aSurfaceLock); - if (!nextTransaction) { - return nullptr; - } - -+ // Iterate through transactions attached to this WaylandSurface -+ // and delete detached transactions which belongs to old (previously attached) -+ // WaylandBuffer. - auto transactions = std::move(mBufferTransactions); - bool addedNext = false; - // DeleteTransactionLocked() may delete BufferTransaction so - // iterate with ref taken. - for (auto t : transactions) { -@@ -1175,11 +1178,11 @@ - continue; - } - MOZ_DIAGNOSTIC_ASSERT(!t->IsDeleted()); - // Remove detached transactions from unused buffers. - if (t->IsDetached() && !t->MatchesBuffer(mLatestAttachedBuffer)) { -- t->DeleteTransactionLocked(aProofOfLock); -+ t->DeleteTransactionLocked(aSurfaceLock); - } else { - mBufferTransactions.AppendElement(t); - } - } - if (!addedNext) { - diff --git a/firefox.spec b/firefox.spec index 34449f0..7336ad7 100644 --- a/firefox.spec +++ b/firefox.spec @@ -286,7 +286,6 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch -Patch408: D263545.1758878742.diff Patch409: D265754.1758954428.diff # PGO/LTO patches @@ -606,7 +605,6 @@ cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysr %patch -P402 -p1 -b .1196777 %patch -P407 -p1 -b .1667096 -%patch -P408 -p1 -b .D263545.1758878742 %patch -P409 -p1 -b .D265754.1758954428 # PGO patches From e6b7799cc63f00e7d484989aec132aed57d8bee9 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 30 Sep 2025 09:11:32 +0200 Subject: [PATCH 507/545] Remover merged patch --- D265754.1758954428.diff | 34 ---------------------------------- firefox.spec | 2 -- 2 files changed, 36 deletions(-) delete mode 100644 D265754.1758954428.diff diff --git a/D265754.1758954428.diff b/D265754.1758954428.diff deleted file mode 100644 index cfcf9cd..0000000 --- a/D265754.1758954428.diff +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/widget/gtk/DMABufDevice.cpp b/widget/gtk/DMABufDevice.cpp ---- a/widget/gtk/DMABufDevice.cpp -+++ b/widget/gtk/DMABufDevice.cpp -@@ -195,11 +195,14 @@ - int DMABufDevice::GetDmabufFD(uint32_t aGEMHandle) { - int fd; - return GbmLib::DrmPrimeHandleToFD(mDRMFd, aGEMHandle, 0, &fd) < 0 ? -1 : fd; - } - --int DMABufDevice::OpenDRMFd() { return open(mDrmRenderNode.get(), O_RDWR); } -+int DMABufDevice::OpenDRMFd() { -+ LOGDMABUF(("DMABufDevice::OpenDRMFd() DRM device %s", mDrmRenderNode.get())); -+ return open(mDrmRenderNode.get(), O_RDWR | O_CLOEXEC); -+} - - bool DMABufDevice::IsEnabled(nsACString& aFailureId) { - if (mDRMFd == -1) { - aFailureId = mFailureId; - } -@@ -250,12 +253,11 @@ - LOGDMABUF(("We're missing DRM render device!\n")); - mFailureId = "FEATURE_FAILURE_NO_DRM_DEVICE"; - return false; - } - -- LOGDMABUF(("Using DRM device %s", mDrmRenderNode.get())); -- mDRMFd = open(mDrmRenderNode.get(), O_RDWR); -+ mDRMFd = OpenDRMFd(); - if (mDRMFd < 0) { - LOGDMABUF(("Failed to open drm render node %s error %s\n", - mDrmRenderNode.get(), strerror(errno))); - mFailureId = "FEATURE_FAILURE_NO_DRM_DEVICE"; - return false; - diff --git a/firefox.spec b/firefox.spec index 7336ad7..f59dfac 100644 --- a/firefox.spec +++ b/firefox.spec @@ -286,7 +286,6 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch -Patch409: D265754.1758954428.diff # PGO/LTO patches Patch600: pgo.patch @@ -605,7 +604,6 @@ cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysr %patch -P402 -p1 -b .1196777 %patch -P407 -p1 -b .1667096 -%patch -P409 -p1 -b .D265754.1758954428 # PGO patches %if %{build_with_pgo} From 9a2664b2bce1327971c5898eabe77d00afb926fb Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 6 Oct 2025 09:06:24 +0200 Subject: [PATCH 508/545] Updated to 143.0.4 --- firefox.spec | 7 +++++-- sources | 6 ++---- wasi.patch | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/firefox.spec b/firefox.spec index f59dfac..9096523 100644 --- a/firefox.spec +++ b/firefox.spec @@ -200,14 +200,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 143.0.3 +Version: 143.0.4 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250930.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20251006.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1277,6 +1277,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Oct 06 2025 Martin Stransky - 143.0.4-1 +- Updated to 143.0.4 + * Tue Sep 30 2025 Martin Stransky - 143.0.3-1 - Updated to 143.0.3 diff --git a/sources b/sources index ca79c5a..c135e25 100644 --- a/sources +++ b/sources @@ -3,7 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-143.0.1.source.tar.xz) = ef00d8bab715e7c2f4c138cfce0698e004f0616c767c8a7fa918e24e4a9f9151c41184d9c089ccbc6ab46a3b4bf6f12d723196f47e9c9d7f55f2ca44bab17cb2 -SHA512 (firefox-langpacks-143.0.1-20250919.tar.xz) = 8c04e5fce3fa27e74b7e8580bf19f81da290a5d1ccc982dca9cf3c6964769f77b3ba1659874b343091a3405ca4ef1725cf4c23578424cf7e36f0c7bed758fe93 -SHA512 (firefox-langpacks-143.0.3-20250930.tar.xz) = b5ceb263efbe02f60cacdf403843ac8339e9ea4cd58d8387133cb1ab1d5455de38135f8cc10139e2b8eda19d8a12917e07cab64b00e1319349ab7c51cf46f51d -SHA512 (firefox-143.0.3.source.tar.xz) = c092bd3aac79f856a804c908b76d40409ce052b00176269ea3029b5a3a6885d4d21ce26bd76c9ea13827ff75459b6b4b0566f5aa49035ac234ae5890c67845b0 +SHA512 (firefox-langpacks-143.0.4-20251006.tar.xz) = cbf8a09193d0fcff659b4c59678d14dab481ada78e8388d90899f99f642ddb8bc5f9b2cd4fc14282e317d0c286e76e7f967684f0586aef534a0000d14fe61a5a +SHA512 (firefox-143.0.4.source.tar.xz) = 2bcbde4e72ea41e9ccc98836901635350b5dc7b50c618e19ab6103a27adc0f017ca3fa7555378c8af6ee1f3a14d02935289fe2b0d35d840d610f5ac07a88e4b6 diff --git a/wasi.patch b/wasi.patch index 2f9806e..e02fddb 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-143.0.3-build/firefox-143.0.3/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-143.0.4-build/firefox-143.0.4/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From b7cf0be1376df43bedf45fa9200279e0672143d3 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 9 Oct 2025 10:03:48 +0200 Subject: [PATCH 509/545] Updated to 144.0 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 641f59d..2a5c75d 100644 --- a/.gitignore +++ b/.gitignore @@ -732,3 +732,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-143.0.1-20250919.tar.xz /firefox-langpacks-143.0.3-20250930.tar.xz /firefox-143.0.3.source.tar.xz +/firefox-langpacks-144.0-20251009.tar.xz +/firefox-144.0.source.tar.xz diff --git a/firefox.spec b/firefox.spec index 9096523..7e73fc2 100644 --- a/firefox.spec +++ b/firefox.spec @@ -200,14 +200,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 143.0.4 +Version: 144.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20251006.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20251009.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1277,6 +1277,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Oct 09 2025 Martin Stransky - 144.0-1 +- Updated to 144.0 + * Mon Oct 06 2025 Martin Stransky - 143.0.4-1 - Updated to 143.0.4 diff --git a/sources b/sources index c135e25..384bb4d 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-langpacks-143.0.4-20251006.tar.xz) = cbf8a09193d0fcff659b4c59678d14dab481ada78e8388d90899f99f642ddb8bc5f9b2cd4fc14282e317d0c286e76e7f967684f0586aef534a0000d14fe61a5a -SHA512 (firefox-143.0.4.source.tar.xz) = 2bcbde4e72ea41e9ccc98836901635350b5dc7b50c618e19ab6103a27adc0f017ca3fa7555378c8af6ee1f3a14d02935289fe2b0d35d840d610f5ac07a88e4b6 +SHA512 (firefox-langpacks-144.0-20251009.tar.xz) = a2a6058ddbdd71f44fda4adb0516a9be18d50a69a229e487012a5681c26a0e3a6f8f23c3350db73604fdf32b28836621cba6c3de79c85ae921f13c1c45745e78 +SHA512 (firefox-144.0.source.tar.xz) = fb70e7c91012b2d75cb30df7b60d76feb9cff0e5d4fe3d3dd83a956c2d07ac7acfac011f6668cc5482149a8779f48cb43de180edd0f9696d59856c3178ef71b6 From 7d1764e9551f958098abd747e7efd5f0d19ca574 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 9 Oct 2025 15:30:28 +0200 Subject: [PATCH 510/545] Updated NSS version --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 7e73fc2..3aeea2a 100644 --- a/firefox.spec +++ b/firefox.spec @@ -156,7 +156,7 @@ ExcludeArch: i686 %if %{?system_nss} %global nspr_version 4.37 %global nspr_build_version %{nspr_version} -%global nss_version 3.115 +%global nss_version 3.116 %global nss_build_version %{nss_version} %endif From abb284ea0a2e8c89ea0a62154622dbf89d32d457 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 13 Oct 2025 14:10:40 +0200 Subject: [PATCH 511/545] Updated to 144.0 build 2 --- .gitignore | 1 + firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 2a5c75d..cc1defc 100644 --- a/.gitignore +++ b/.gitignore @@ -734,3 +734,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-143.0.3.source.tar.xz /firefox-langpacks-144.0-20251009.tar.xz /firefox-144.0.source.tar.xz +/firefox-langpacks-144.0-20251010.tar.xz diff --git a/firefox.spec b/firefox.spec index 3aeea2a..6a20c37 100644 --- a/firefox.spec +++ b/firefox.spec @@ -201,13 +201,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 144.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20251009.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20251010.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1277,6 +1277,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Oct 13 2025 Martin Stransky - 144.0-2 +- Updated to 144.0 (b2) + * Thu Oct 09 2025 Martin Stransky - 144.0-1 - Updated to 144.0 diff --git a/sources b/sources index 384bb4d..4e3ce65 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-langpacks-144.0-20251009.tar.xz) = a2a6058ddbdd71f44fda4adb0516a9be18d50a69a229e487012a5681c26a0e3a6f8f23c3350db73604fdf32b28836621cba6c3de79c85ae921f13c1c45745e78 -SHA512 (firefox-144.0.source.tar.xz) = fb70e7c91012b2d75cb30df7b60d76feb9cff0e5d4fe3d3dd83a956c2d07ac7acfac011f6668cc5482149a8779f48cb43de180edd0f9696d59856c3178ef71b6 +SHA512 (firefox-144.0.source.tar.xz) = e1f924ed006a31f5333ea6af219c1fb90d4866e5889ac634c324a3e80b042a7e0b2b9aeb798672ea1a434fbf817fc0b82a12ec0fb405a48e3a2ca21cc394445e +SHA512 (firefox-langpacks-144.0-20251010.tar.xz) = 3a556e77fb7b733cb40acc7e5d8dab87b3a68b284f1e0eabf7c39b4a3d6d2c193c5731619bf9ef034255650564157cf4bfcf99d0fd41661e6cc8e53bde4f2627 From f2736110e37e124118bc772e6950854c24651bb7 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 16 Oct 2025 10:39:35 +0200 Subject: [PATCH 512/545] Removed unused patches --- D168799.diff | 93 - D192061.1699444912.diff | 113 - D192208.1699444906.diff | 201 -- D220551.1729586347.diff | 1908 ----------- D244990.1744916693.diff | 153 - bmo-1559213-Support-system-av1.patch | 91 - bmo-1559213-fix-system-av1-libs.patch | 22 - build-cacheFlush-missing.patch | 13 - build-ppc-jit.patch | 51 - build-rust-ppc64le.patch | 25 - fedora-shebang-build.patch | 9 - firefox-glibc-dynstack.patch | 64 - firefox-nss-version.patch | 12 - firefox-testing.patch | 69 - firefox-tests-reftest.patch | 514 --- firefox-tests-xpcshell-freeze.patch | 14 - firefox-tests-xpcshell.patch | 147 - firefox.spec | 17 - python-build.patch | 4558 ------------------------- wasi.patch | 2 +- 20 files changed, 1 insertion(+), 8075 deletions(-) delete mode 100644 D168799.diff delete mode 100644 D192061.1699444912.diff delete mode 100644 D192208.1699444906.diff delete mode 100644 D220551.1729586347.diff delete mode 100644 D244990.1744916693.diff delete mode 100644 bmo-1559213-Support-system-av1.patch delete mode 100644 bmo-1559213-fix-system-av1-libs.patch delete mode 100644 build-cacheFlush-missing.patch delete mode 100644 build-ppc-jit.patch delete mode 100644 build-rust-ppc64le.patch delete mode 100644 fedora-shebang-build.patch delete mode 100644 firefox-glibc-dynstack.patch delete mode 100644 firefox-nss-version.patch delete mode 100644 firefox-testing.patch delete mode 100644 firefox-tests-reftest.patch delete mode 100644 firefox-tests-xpcshell-freeze.patch delete mode 100644 firefox-tests-xpcshell.patch delete mode 100644 python-build.patch diff --git a/D168799.diff b/D168799.diff deleted file mode 100644 index 40dc3b4..0000000 --- a/D168799.diff +++ /dev/null @@ -1,93 +0,0 @@ -diff --git a/extensions/pref/autoconfig/test/unit/test_autoconfig_custom_path.js b/extensions/pref/autoconfig/test/unit/test_autoconfig_custom_path.js ---- a/extensions/pref/autoconfig/test/unit/test_autoconfig_custom_path.js -+++ b/extensions/pref/autoconfig/test/unit/test_autoconfig_custom_path.js -@@ -9,10 +9,13 @@ - let testDirName = do_get_cwd().clone(); - Services.env.set("MOZ_SYSTEM_CONFIG_DIR", testDirName.path); - - updateAppInfo(); - -+ try { -+ Services.dirsvc.undefine("SysConfD"); -+ } catch (e) {} - let customSysConfD = Services.dirsvc.get("SysConfD", Ci.nsIFile); - let parent = customSysConfD.parent; - let child = customSysConfD.leafName; - notEqual("/etc", parent.path, "SysConfD is not in /etc"); - equal("xpcshell", child, "SysConfD is xpcshell"); -diff --git a/extensions/pref/autoconfig/test/unit/test_autoconfig_default_path.js b/extensions/pref/autoconfig/test/unit/test_autoconfig_default_path.js ---- a/extensions/pref/autoconfig/test/unit/test_autoconfig_default_path.js -+++ b/extensions/pref/autoconfig/test/unit/test_autoconfig_default_path.js -@@ -6,8 +6,11 @@ - ); - - function run_test() { - updateAppInfo(); - -+ try { -+ Services.dirsvc.undefine("SysConfD"); -+ } catch (e) {} - let defaultSysConfD = Services.dirsvc.get("SysConfD", Ci.nsIFile); - equal("/etc/xpcshell", defaultSysConfD.path, "SysConfD is in /etc"); - } -diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp ---- a/modules/libpref/Preferences.cpp -+++ b/modules/libpref/Preferences.cpp -@@ -4917,27 +4917,10 @@ - ArrayLength(specialFiles)); - if (NS_FAILED(rv)) { - NS_WARNING("Error parsing application default preferences."); - } - --#if defined(MOZ_WIDGET_GTK) -- // Under Flatpak/Snap package, load /etc/firefox/defaults/pref/*.js. -- if (mozilla::widget::IsRunningUnderFlatpakOrSnap()) { -- nsCOMPtr defaultSnapPrefDir; -- rv = NS_GetSpecialDirectory(NS_OS_SYSTEM_CONFIG_DIR, -- getter_AddRefs(defaultSnapPrefDir)); -- NS_ENSURE_SUCCESS(rv, rv); -- defaultSnapPrefDir->AppendNative("defaults"_ns); -- defaultSnapPrefDir->AppendNative("pref"_ns); -- -- rv = pref_LoadPrefsInDir(defaultSnapPrefDir, nullptr, 0); -- if (NS_FAILED(rv)) { -- NS_WARNING("Error parsing application default preferences under Snap."); -- } -- } --#endif -- - // Load jar:$app/omni.jar!/defaults/preferences/*.js - // or jar:$gre/omni.jar!/defaults/preferences/*.js. - RefPtr appJarReader = Omnijar::GetReader(Omnijar::APP); - - // GetReader(Omnijar::APP) returns null when `$app == $gre`, in -@@ -5006,10 +4989,28 @@ - // Do we care if a file provided by this process fails to load? - pref_LoadPrefsInDir(path, nullptr, 0); - } - } - -+#if defined(MOZ_WIDGET_GTK) -+ // To ensure the system-wide preferences are not overwritten by -+ // firefox/browser/defauts/preferences/*.js we need to load -+ // the /etc/firefox/defaults/pref/*.js settings as last. -+ // Under Flatpak, the NS_OS_SYSTEM_CONFIG_DIR points to /app/etc/firefox -+ nsCOMPtr defaultSystemPrefDir; -+ rv = NS_GetSpecialDirectory(NS_OS_SYSTEM_CONFIG_DIR, -+ getter_AddRefs(defaultSystemPrefDir)); -+ NS_ENSURE_SUCCESS(rv, rv); -+ defaultSystemPrefDir->AppendNative("defaults"_ns); -+ defaultSystemPrefDir->AppendNative("pref"_ns); -+ -+ rv = pref_LoadPrefsInDir(defaultSystemPrefDir, nullptr, 0); -+ if (NS_FAILED(rv)) { -+ NS_WARNING("Error parsing application default preferences."); -+ } -+#endif -+ - if (XRE_IsParentProcess()) { - SetupTelemetryPref(); - } - - if (aIsStartup) { - diff --git a/D192061.1699444912.diff b/D192061.1699444912.diff deleted file mode 100644 index a7c4e85..0000000 --- a/D192061.1699444912.diff +++ /dev/null @@ -1,113 +0,0 @@ -diff --git a/widget/gtk/nsUserIdleServiceGTK.cpp b/widget/gtk/nsUserIdleServiceGTK.cpp ---- a/widget/gtk/nsUserIdleServiceGTK.cpp -+++ b/widget/gtk/nsUserIdleServiceGTK.cpp -@@ -149,48 +149,62 @@ - - #ifdef MOZ_ENABLE_DBUS - class UserIdleServiceMutter : public UserIdleServiceImpl { - public: - bool PollIdleTime(uint32_t* aIdleTime) override { -- MOZ_LOG(sIdleLog, LogLevel::Info, -- ("UserIdleServiceMutter::PollIdleTime()\n")); -- -- MOZ_ASSERT(mProxy); -- GUniquePtr error; -+ MOZ_LOG(sIdleLog, LogLevel::Info, ("PollIdleTime() request\n")); - -- RefPtr result = dont_AddRef(g_dbus_proxy_call_sync( -- mProxy, "GetIdletime", nullptr, G_DBUS_CALL_FLAGS_NONE, -1, -- mCancellable, getter_Transfers(error))); -- if (!result) { -- MOZ_LOG(sIdleLog, LogLevel::Info, -- ("UserIdleServiceMutter::PollIdleTime() failed, message: %s\n", -- error->message)); -+ // We're not ready yet -+ if (!mProxy) { - return false; - } -- if (!g_variant_is_of_type(result, G_VARIANT_TYPE_TUPLE) || -- g_variant_n_children(result) != 1) { -- MOZ_LOG( -- sIdleLog, LogLevel::Info, -- ("UserIdleServiceMutter::PollIdleTime() Unexpected params type: %s\n", -- g_variant_get_type_string(result))); -- return false; -+ -+ if (!mPollInProgress) { -+ mPollInProgress = true; -+ DBusProxyCall(mProxy, "GetIdletime", nullptr, G_DBUS_CALL_FLAGS_NONE, -1, -+ mCancellable) -+ ->Then( -+ GetCurrentSerialEventTarget(), __func__, -+ // It's safe to capture this as we use mCancellable to stop -+ // listening. -+ [self = RefPtr{this}, this](RefPtr&& aResult) { -+ if (!g_variant_is_of_type(aResult, G_VARIANT_TYPE_TUPLE) || -+ g_variant_n_children(aResult) != 1) { -+ MOZ_LOG(sIdleLog, LogLevel::Info, -+ ("PollIdleTime() Unexpected params type: %s\n", -+ g_variant_get_type_string(aResult))); -+ mLastIdleTime = 0; -+ return; -+ } -+ RefPtr iTime = -+ dont_AddRef(g_variant_get_child_value(aResult, 0)); -+ if (!g_variant_is_of_type(iTime, G_VARIANT_TYPE_UINT64)) { -+ MOZ_LOG(sIdleLog, LogLevel::Info, -+ ("PollIdleTime() Unexpected params type: %s\n", -+ g_variant_get_type_string(aResult))); -+ mLastIdleTime = 0; -+ return; -+ } -+ uint64_t idleTime = g_variant_get_uint64(iTime); -+ if (idleTime > std::numeric_limits::max()) { -+ idleTime = std::numeric_limits::max(); -+ } -+ mLastIdleTime = idleTime; -+ mPollInProgress = false; -+ MOZ_LOG(sIdleLog, LogLevel::Info, -+ ("Async handler got %d\n", mLastIdleTime)); -+ }, -+ [self = RefPtr{this}, this](GUniquePtr&& aError) { -+ mPollInProgress = false; -+ g_warning("Failed to call GetIdletime(): %s\n", -+ aError->message); -+ }); - } -- RefPtr iTime = dont_AddRef(g_variant_get_child_value(result, 0)); -- if (!g_variant_is_of_type(iTime, G_VARIANT_TYPE_UINT64)) { -- MOZ_LOG( -- sIdleLog, LogLevel::Info, -- ("UserIdleServiceMutter::PollIdleTime() Unexpected params type: %s\n", -- g_variant_get_type_string(result))); -- return false; -- } -- uint64_t idleTime = g_variant_get_uint64(iTime); -- if (idleTime > std::numeric_limits::max()) { -- idleTime = std::numeric_limits::max(); -- } -- *aIdleTime = idleTime; -+ -+ *aIdleTime = mLastIdleTime; - MOZ_LOG(sIdleLog, LogLevel::Info, -- ("UserIdleServiceMutter::PollIdleTime() %d\n", *aIdleTime)); -+ ("PollIdleTime() returns %d\n", *aIdleTime)); - return true; - } - - bool ProbeImplementation( - RefPtr aUserIdleServiceGTK) override { -@@ -229,10 +243,12 @@ - } - - private: - RefPtr mProxy; - RefPtr mCancellable; -+ uint32_t mLastIdleTime = 0; -+ bool mPollInProgress = false; - }; - #endif - - void nsUserIdleServiceGTK::ProbeService() { - MOZ_LOG(sIdleLog, LogLevel::Info, - diff --git a/D192208.1699444906.diff b/D192208.1699444906.diff deleted file mode 100644 index f77a357..0000000 --- a/D192208.1699444906.diff +++ /dev/null @@ -1,201 +0,0 @@ -diff --git a/widget/gtk/nsUserIdleServiceGTK.h b/widget/gtk/nsUserIdleServiceGTK.h ---- a/widget/gtk/nsUserIdleServiceGTK.h -+++ b/widget/gtk/nsUserIdleServiceGTK.h -@@ -14,18 +14,20 @@ - - class nsUserIdleServiceGTK; - - class UserIdleServiceImpl { - public: -- NS_INLINE_DECL_REFCOUNTING(UserIdleServiceImpl); -+ explicit UserIdleServiceImpl(nsUserIdleServiceGTK* aUserIdleService) -+ : mUserIdleServiceGTK(aUserIdleService){}; - - virtual bool PollIdleTime(uint32_t* aIdleTime) = 0; -- virtual bool ProbeImplementation( -- RefPtr aUserIdleServiceGTK) = 0; -+ virtual bool ProbeImplementation() = 0; -+ -+ virtual ~UserIdleServiceImpl() = default; - - protected: -- virtual ~UserIdleServiceImpl() = default; -+ nsUserIdleServiceGTK* mUserIdleServiceGTK; - }; - - #define IDLE_SERVICE_MUTTER 0 - #define IDLE_SERVICE_XSCREENSAVER 1 - #define IDLE_SERVICE_NONE 2 -@@ -61,11 +63,11 @@ - nsUserIdleServiceGTK() = default; - - private: - ~nsUserIdleServiceGTK() = default; - -- RefPtr mIdleService; -+ mozilla::UniquePtr mIdleService; - #ifdef MOZ_ENABLE_DBUS - int mIdleServiceType = IDLE_SERVICE_MUTTER; - #else - int mIdleServiceType = IDLE_SERVICE_XSCREENSAVER; - #endif -diff --git a/widget/gtk/nsUserIdleServiceGTK.cpp b/widget/gtk/nsUserIdleServiceGTK.cpp ---- a/widget/gtk/nsUserIdleServiceGTK.cpp -+++ b/widget/gtk/nsUserIdleServiceGTK.cpp -@@ -74,12 +74,11 @@ - MOZ_LOG(sIdleLog, LogLevel::Warning, - ("XSSQueryExtension returned false!\n")); - return false; - } - -- bool ProbeImplementation( -- RefPtr aUserIdleServiceGTK) override { -+ bool ProbeImplementation() override { - MOZ_LOG(sIdleLog, LogLevel::Info, - ("UserIdleServiceX11::UserIdleServiceX11()\n")); - - if (!mozilla::widget::GdkIsX11Display()) { - return false; -@@ -114,15 +113,17 @@ - // We're missing X11 symbols - return false; - } - - // UserIdleServiceX11 uses sync init, confirm it now. -- aUserIdleServiceGTK->AcceptServiceCallback(); -+ mUserIdleServiceGTK->AcceptServiceCallback(); - return true; - } - -- protected: -+ explicit UserIdleServiceX11(nsUserIdleServiceGTK* aUserIdleService) -+ : UserIdleServiceImpl(aUserIdleService){}; -+ - ~UserIdleServiceX11() { - # ifdef MOZ_X11 - if (mXssInfo) { - XFree(mXssInfo); - } -@@ -164,11 +165,11 @@ - mCancellable) - ->Then( - GetCurrentSerialEventTarget(), __func__, - // It's safe to capture this as we use mCancellable to stop - // listening. -- [self = RefPtr{this}, this](RefPtr&& aResult) { -+ [this](RefPtr&& aResult) { - if (!g_variant_is_of_type(aResult, G_VARIANT_TYPE_TUPLE) || - g_variant_n_children(aResult) != 1) { - MOZ_LOG(sIdleLog, LogLevel::Info, - ("PollIdleTime() Unexpected params type: %s\n", - g_variant_get_type_string(aResult))); -@@ -191,25 +192,25 @@ - mLastIdleTime = idleTime; - mPollInProgress = false; - MOZ_LOG(sIdleLog, LogLevel::Info, - ("Async handler got %d\n", mLastIdleTime)); - }, -- [self = RefPtr{this}, this](GUniquePtr&& aError) { -+ [this](GUniquePtr&& aError) { - mPollInProgress = false; - g_warning("Failed to call GetIdletime(): %s\n", - aError->message); -+ mUserIdleServiceGTK->RejectAndTryNextServiceCallback(); - }); - } - - *aIdleTime = mLastIdleTime; - MOZ_LOG(sIdleLog, LogLevel::Info, - ("PollIdleTime() returns %d\n", *aIdleTime)); - return true; - } - -- bool ProbeImplementation( -- RefPtr aUserIdleServiceGTK) override { -+ bool ProbeImplementation() override { - MOZ_LOG(sIdleLog, LogLevel::Info, - ("UserIdleServiceMutter::UserIdleServiceMutter()\n")); - - mCancellable = dont_AddRef(g_cancellable_new()); - CreateDBusProxyForBus( -@@ -219,23 +220,23 @@ - nullptr, "org.gnome.Mutter.IdleMonitor", - "/org/gnome/Mutter/IdleMonitor/Core", "org.gnome.Mutter.IdleMonitor", - mCancellable) - ->Then( - GetCurrentSerialEventTarget(), __func__, -- [self = RefPtr{this}, service = RefPtr{aUserIdleServiceGTK}]( -- RefPtr&& aProxy) { -- self->mProxy = std::move(aProxy); -- service->AcceptServiceCallback(); -+ [this](RefPtr&& aProxy) { -+ mProxy = std::move(aProxy); -+ mUserIdleServiceGTK->AcceptServiceCallback(); - }, -- [self = RefPtr{this}, service = RefPtr{aUserIdleServiceGTK}]( -- GUniquePtr&& aError) { -- service->RejectAndTryNextServiceCallback(); -+ [this](GUniquePtr&& aError) { -+ mUserIdleServiceGTK->RejectAndTryNextServiceCallback(); - }); - return true; - } - -- protected: -+ explicit UserIdleServiceMutter(nsUserIdleServiceGTK* aUserIdleService) -+ : UserIdleServiceImpl(aUserIdleService){}; -+ - ~UserIdleServiceMutter() { - if (mCancellable) { - g_cancellable_cancel(mCancellable); - mCancellable = nullptr; - } -@@ -257,23 +258,23 @@ - MOZ_ASSERT(!mIdleService); - - switch (mIdleServiceType) { - #ifdef MOZ_ENABLE_DBUS - case IDLE_SERVICE_MUTTER: -- mIdleService = new UserIdleServiceMutter(); -+ mIdleService = MakeUnique(this); - break; - #endif - #ifdef MOZ_X11 - case IDLE_SERVICE_XSCREENSAVER: -- mIdleService = new UserIdleServiceX11(); -+ mIdleService = MakeUnique(this); - break; - #endif - default: - return; - } - -- if (!mIdleService->ProbeImplementation(this)) { -+ if (!mIdleService->ProbeImplementation()) { - RejectAndTryNextServiceCallback(); - } - } - - void nsUserIdleServiceGTK::AcceptServiceCallback() { -@@ -289,19 +290,19 @@ - mIdleServiceType)); - - // Delete recent non-working service - MOZ_ASSERT(mIdleService, "Nothing to reject?"); - mIdleService = nullptr; -+ mIdleServiceInitialized = false; - - mIdleServiceType++; - if (mIdleServiceType < IDLE_SERVICE_NONE) { - MOZ_LOG(sIdleLog, LogLevel::Info, - ("nsUserIdleServiceGTK try next idle service\n")); - ProbeService(); - } else { - MOZ_LOG(sIdleLog, LogLevel::Info, ("nsUserIdleServiceGTK failed\n")); -- mIdleServiceInitialized = false; - } - } - - bool nsUserIdleServiceGTK::PollIdleTime(uint32_t* aIdleTime) { - if (!mIdleServiceInitialized) { - diff --git a/D220551.1729586347.diff b/D220551.1729586347.diff deleted file mode 100644 index 2d8c4e0..0000000 --- a/D220551.1729586347.diff +++ /dev/null @@ -1,1908 +0,0 @@ -diff --git a/widget/gtk/WidgetUtilsGtk.cpp b/widget/gtk/WidgetUtilsGtk.cpp ---- a/widget/gtk/WidgetUtilsGtk.cpp -+++ b/widget/gtk/WidgetUtilsGtk.cpp -@@ -303,11 +303,11 @@ - }; - #endif - - RefPtr RequestWaylandFocusPromise() { - #ifdef MOZ_WAYLAND -- if (!GdkIsWaylandDisplay() || !KeymapWrapper::GetSeat()) { -+ if (!GdkIsWaylandDisplay() || !WaylandDisplayGet()->GetSeat()) { - LOGW("RequestWaylandFocusPromise() failed."); - return nullptr; - } - - RefPtr sourceWindow = nsWindow::GetFocusedWindow(); -@@ -347,11 +347,11 @@ - xdg_activation_v1_get_activation_token(xdg_activation); - xdg_activation_token_v1_add_listener( - aXdgToken, &token_listener, - new XDGTokenRequest(aXdgToken, transferPromise)); - xdg_activation_token_v1_set_serial(aXdgToken, focusSerial, -- KeymapWrapper::GetSeat()); -+ WaylandDisplayGet()->GetSeat()); - xdg_activation_token_v1_set_surface(aXdgToken, focusSurface); - xdg_activation_token_v1_commit(aXdgToken); - - LOGW("RequestWaylandFocusPromise() XDG Token sent"); - -diff --git a/widget/gtk/mozwayland/mozwayland.h b/widget/gtk/mozwayland/mozwayland.h ---- a/widget/gtk/mozwayland/mozwayland.h -+++ b/widget/gtk/mozwayland/mozwayland.h -@@ -29,14 +29,22 @@ - struct wl_proxy* proxy, uint32_t opcode, - const struct wl_interface* interface, ...); - MOZ_EXPORT struct wl_proxy* wl_proxy_marshal_constructor_versioned( - struct wl_proxy* proxy, uint32_t opcode, - const struct wl_interface* interface, uint32_t version, ...); -+MOZ_EXPORT struct wl_proxy* wl_proxy_marshal_flags( -+ struct wl_proxy* proxy, uint32_t opcode, -+ const struct wl_interface* interface, uint32_t version, uint32_t flags, -+ ...); - MOZ_EXPORT void wl_proxy_destroy(struct wl_proxy* proxy); - MOZ_EXPORT void* wl_proxy_create_wrapper(void* proxy); - MOZ_EXPORT void wl_proxy_wrapper_destroy(void* proxy_wrapper); - -+#ifndef WL_MARSHAL_FLAG_DESTROY -+# define WL_MARSHAL_FLAG_DESTROY (1 << 0) -+#endif -+ - /* We need implement some missing functions from wayland-client-protocol.h - */ - #ifndef WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM - enum wl_data_device_manager_dnd_action { - WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE = 0, -@@ -125,10 +133,407 @@ - wl_proxy_marshal((struct wl_proxy*)wl_surface, WL_SURFACE_DAMAGE_BUFFER, x, y, - width, height); - } - #endif - -+#ifndef WL_POINTER_AXIS_ENUM -+# define WL_POINTER_AXIS_ENUM -+/** -+ * @ingroup iface_wl_pointer -+ * axis types -+ * -+ * Describes the axis types of scroll events. -+ */ -+enum wl_pointer_axis { -+ /** -+ * vertical axis -+ */ -+ WL_POINTER_AXIS_VERTICAL_SCROLL = 0, -+ /** -+ * horizontal axis -+ */ -+ WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1, -+}; -+#endif /* WL_POINTER_AXIS_ENUM */ -+ -+#ifndef WL_POINTER_AXIS_SOURCE_ENUM -+# define WL_POINTER_AXIS_SOURCE_ENUM -+/** -+ * @ingroup iface_wl_pointer -+ * axis source types -+ * -+ * Describes the source types for axis events. This indicates to the -+ * client how an axis event was physically generated; a client may -+ * adjust the user interface accordingly. For example, scroll events -+ * from a "finger" source may be in a smooth coordinate space with -+ * kinetic scrolling whereas a "wheel" source may be in discrete steps -+ * of a number of lines. -+ * -+ * The "continuous" axis source is a device generating events in a -+ * continuous coordinate space, but using something other than a -+ * finger. One example for this source is button-based scrolling where -+ * the vertical motion of a device is converted to scroll events while -+ * a button is held down. -+ * -+ * The "wheel tilt" axis source indicates that the actual device is a -+ * wheel but the scroll event is not caused by a rotation but a -+ * (usually sideways) tilt of the wheel. -+ */ -+enum wl_pointer_axis_source { -+ /** -+ * a physical wheel rotation -+ */ -+ WL_POINTER_AXIS_SOURCE_WHEEL = 0, -+ /** -+ * finger on a touch surface -+ */ -+ WL_POINTER_AXIS_SOURCE_FINGER = 1, -+ /** -+ * continuous coordinate space -+ */ -+ WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2, -+ /** -+ * a physical wheel tilt -+ * @since 6 -+ */ -+ WL_POINTER_AXIS_SOURCE_WHEEL_TILT = 3, -+}; -+/** -+ * @ingroup iface_wl_pointer -+ */ -+# define WL_POINTER_AXIS_SOURCE_WHEEL_TILT_SINCE_VERSION 6 -+#endif /* WL_POINTER_AXIS_SOURCE_ENUM */ -+ -+#ifndef WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM -+# define WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM -+/** -+ * @ingroup iface_wl_pointer -+ * axis relative direction -+ * -+ * This specifies the direction of the physical motion that caused a -+ * wl_pointer.axis event, relative to the wl_pointer.axis direction. -+ */ -+enum wl_pointer_axis_relative_direction { -+ /** -+ * physical motion matches axis direction -+ */ -+ WL_POINTER_AXIS_RELATIVE_DIRECTION_IDENTICAL = 0, -+ /** -+ * physical motion is the inverse of the axis direction -+ */ -+ WL_POINTER_AXIS_RELATIVE_DIRECTION_INVERTED = 1, -+}; -+#endif /* WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM */ -+ -+/** -+ * @ingroup iface_wl_pointer -+ * @struct wl_pointer_listener -+ */ -+struct moz_wl_pointer_listener { -+ /** -+ * enter event -+ * -+ * Notification that this seat's pointer is focused on a certain -+ * surface. -+ * -+ * When a seat's focus enters a surface, the pointer image is -+ * undefined and a client should respond to this event by setting -+ * an appropriate pointer image with the set_cursor request. -+ * @param serial serial number of the enter event -+ * @param surface surface entered by the pointer -+ * @param surface_x surface-local x coordinate -+ * @param surface_y surface-local y coordinate -+ */ -+ void (*enter)(void* data, struct wl_pointer* wl_pointer, uint32_t serial, -+ struct wl_surface* surface, wl_fixed_t surface_x, -+ wl_fixed_t surface_y); -+ /** -+ * leave event -+ * -+ * Notification that this seat's pointer is no longer focused on -+ * a certain surface. -+ * -+ * The leave notification is sent before the enter notification for -+ * the new focus. -+ * @param serial serial number of the leave event -+ * @param surface surface left by the pointer -+ */ -+ void (*leave)(void* data, struct wl_pointer* wl_pointer, uint32_t serial, -+ struct wl_surface* surface); -+ /** -+ * pointer motion event -+ * -+ * Notification of pointer location change. The arguments -+ * surface_x and surface_y are the location relative to the focused -+ * surface. -+ * @param time timestamp with millisecond granularity -+ * @param surface_x surface-local x coordinate -+ * @param surface_y surface-local y coordinate -+ */ -+ void (*motion)(void* data, struct wl_pointer* wl_pointer, uint32_t time, -+ wl_fixed_t surface_x, wl_fixed_t surface_y); -+ /** -+ * pointer button event -+ * -+ * Mouse button click and release notifications. -+ * -+ * The location of the click is given by the last motion or enter -+ * event. The time argument is a timestamp with millisecond -+ * granularity, with an undefined base. -+ * -+ * The button is a button code as defined in the Linux kernel's -+ * linux/input-event-codes.h header file, e.g. BTN_LEFT. -+ * -+ * Any 16-bit button code value is reserved for future additions to -+ * the kernel's event code list. All other button codes above -+ * 0xFFFF are currently undefined but may be used in future -+ * versions of this protocol. -+ * @param serial serial number of the button event -+ * @param time timestamp with millisecond granularity -+ * @param button button that produced the event -+ * @param state physical state of the button -+ */ -+ void (*button)(void* data, struct wl_pointer* wl_pointer, uint32_t serial, -+ uint32_t time, uint32_t button, uint32_t state); -+ /** -+ * axis event -+ * -+ * Scroll and other axis notifications. -+ * -+ * For scroll events (vertical and horizontal scroll axes), the -+ * value parameter is the length of a vector along the specified -+ * axis in a coordinate space identical to those of motion events, -+ * representing a relative movement along the specified axis. -+ * -+ * For devices that support movements non-parallel to axes multiple -+ * axis events will be emitted. -+ * -+ * When applicable, for example for touch pads, the server can -+ * choose to emit scroll events where the motion vector is -+ * equivalent to a motion event vector. -+ * -+ * When applicable, a client can transform its content relative to -+ * the scroll distance. -+ * @param time timestamp with millisecond granularity -+ * @param axis axis type -+ * @param value length of vector in surface-local coordinate space -+ */ -+ void (*axis)(void* data, struct wl_pointer* wl_pointer, uint32_t time, -+ uint32_t axis, wl_fixed_t value); -+ /** -+ * end of a pointer event sequence -+ * -+ * Indicates the end of a set of events that logically belong -+ * together. A client is expected to accumulate the data in all -+ * events within the frame before proceeding. -+ * -+ * All wl_pointer events before a wl_pointer.frame event belong -+ * logically together. For example, in a diagonal scroll motion the -+ * compositor will send an optional wl_pointer.axis_source event, -+ * two wl_pointer.axis events (horizontal and vertical) and finally -+ * a wl_pointer.frame event. The client may use this information to -+ * calculate a diagonal vector for scrolling. -+ * -+ * When multiple wl_pointer.axis events occur within the same -+ * frame, the motion vector is the combined motion of all events. -+ * When a wl_pointer.axis and a wl_pointer.axis_stop event occur -+ * within the same frame, this indicates that axis movement in one -+ * axis has stopped but continues in the other axis. When multiple -+ * wl_pointer.axis_stop events occur within the same frame, this -+ * indicates that these axes stopped in the same instance. -+ * -+ * A wl_pointer.frame event is sent for every logical event group, -+ * even if the group only contains a single wl_pointer event. -+ * Specifically, a client may get a sequence: motion, frame, -+ * button, frame, axis, frame, axis_stop, frame. -+ * -+ * The wl_pointer.enter and wl_pointer.leave events are logical -+ * events generated by the compositor and not the hardware. These -+ * events are also grouped by a wl_pointer.frame. When a pointer -+ * moves from one surface to another, a compositor should group the -+ * wl_pointer.leave event within the same wl_pointer.frame. -+ * However, a client must not rely on wl_pointer.leave and -+ * wl_pointer.enter being in the same wl_pointer.frame. -+ * Compositor-specific policies may require the wl_pointer.leave -+ * and wl_pointer.enter event being split across multiple -+ * wl_pointer.frame groups. -+ * @since 5 -+ */ -+ void (*frame)(void* data, struct wl_pointer* wl_pointer); -+ /** -+ * axis source event -+ * -+ * Source information for scroll and other axes. -+ * -+ * This event does not occur on its own. It is sent before a -+ * wl_pointer.frame event and carries the source information for -+ * all events within that frame. -+ * -+ * The source specifies how this event was generated. If the source -+ * is wl_pointer.axis_source.finger, a wl_pointer.axis_stop event -+ * will be sent when the user lifts the finger off the device. -+ * -+ * If the source is wl_pointer.axis_source.wheel, -+ * wl_pointer.axis_source.wheel_tilt or -+ * wl_pointer.axis_source.continuous, a wl_pointer.axis_stop event -+ * may or may not be sent. Whether a compositor sends an axis_stop -+ * event for these sources is hardware-specific and -+ * implementation-dependent; clients must not rely on receiving an -+ * axis_stop event for these scroll sources and should treat scroll -+ * sequences from these scroll sources as unterminated by default. -+ * -+ * This event is optional. If the source is unknown for a -+ * particular axis event sequence, no event is sent. Only one -+ * wl_pointer.axis_source event is permitted per frame. -+ * -+ * The order of wl_pointer.axis_discrete and wl_pointer.axis_source -+ * is not guaranteed. -+ * @param axis_source source of the axis event -+ * @since 5 -+ */ -+ void (*axis_source)(void* data, struct wl_pointer* wl_pointer, -+ uint32_t axis_source); -+ /** -+ * axis stop event -+ * -+ * Stop notification for scroll and other axes. -+ * -+ * For some wl_pointer.axis_source types, a wl_pointer.axis_stop -+ * event is sent to notify a client that the axis sequence has -+ * terminated. This enables the client to implement kinetic -+ * scrolling. See the wl_pointer.axis_source documentation for -+ * information on when this event may be generated. -+ * -+ * Any wl_pointer.axis events with the same axis_source after this -+ * event should be considered as the start of a new axis motion. -+ * -+ * The timestamp is to be interpreted identical to the timestamp in -+ * the wl_pointer.axis event. The timestamp value may be the same -+ * as a preceding wl_pointer.axis event. -+ * @param time timestamp with millisecond granularity -+ * @param axis the axis stopped with this event -+ * @since 5 -+ */ -+ void (*axis_stop)(void* data, struct wl_pointer* wl_pointer, uint32_t time, -+ uint32_t axis); -+ /** -+ * axis click event -+ * -+ * Discrete step information for scroll and other axes. -+ * -+ * This event carries the axis value of the wl_pointer.axis event -+ * in discrete steps (e.g. mouse wheel clicks). -+ * -+ * This event is deprecated with wl_pointer version 8 - this event -+ * is not sent to clients supporting version 8 or later. -+ * -+ * This event does not occur on its own, it is coupled with a -+ * wl_pointer.axis event that represents this axis value on a -+ * continuous scale. The protocol guarantees that each -+ * axis_discrete event is always followed by exactly one axis event -+ * with the same axis number within the same wl_pointer.frame. Note -+ * that the protocol allows for other events to occur between the -+ * axis_discrete and its coupled axis event, including other -+ * axis_discrete or axis events. A wl_pointer.frame must not -+ * contain more than one axis_discrete event per axis type. -+ * -+ * This event is optional; continuous scrolling devices like -+ * two-finger scrolling on touchpads do not have discrete steps and -+ * do not generate this event. -+ * -+ * The discrete value carries the directional information. e.g. a -+ * value of -2 is two steps towards the negative direction of this -+ * axis. -+ * -+ * The axis number is identical to the axis number in the -+ * associated axis event. -+ * -+ * The order of wl_pointer.axis_discrete and wl_pointer.axis_source -+ * is not guaranteed. -+ * @param axis axis type -+ * @param discrete number of steps -+ * @since 5 -+ * @deprecated Deprecated since version 8 -+ */ -+ void (*axis_discrete)(void* data, struct wl_pointer* wl_pointer, -+ uint32_t axis, int32_t discrete); -+ /** -+ * axis high-resolution scroll event -+ * -+ * Discrete high-resolution scroll information. -+ * -+ * This event carries high-resolution wheel scroll information, -+ * with each multiple of 120 representing one logical scroll step -+ * (a wheel detent). For example, an axis_value120 of 30 is one -+ * quarter of a logical scroll step in the positive direction, a -+ * value120 of -240 are two logical scroll steps in the negative -+ * direction within the same hardware event. Clients that rely on -+ * discrete scrolling should accumulate the value120 to multiples -+ * of 120 before processing the event. -+ * -+ * The value120 must not be zero. -+ * -+ * This event replaces the wl_pointer.axis_discrete event in -+ * clients supporting wl_pointer version 8 or later. -+ * -+ * Where a wl_pointer.axis_source event occurs in the same -+ * wl_pointer.frame, the axis source applies to this event. -+ * -+ * The order of wl_pointer.axis_value120 and wl_pointer.axis_source -+ * is not guaranteed. -+ * @param axis axis type -+ * @param value120 scroll distance as fraction of 120 -+ * @since 8 -+ */ -+ void (*axis_value120)(void* data, struct wl_pointer* wl_pointer, -+ uint32_t axis, int32_t value120); -+ /** -+ * axis relative physical direction event -+ * -+ * Relative directional information of the entity causing the -+ * axis motion. -+ * -+ * For a wl_pointer.axis event, the -+ * wl_pointer.axis_relative_direction event specifies the movement -+ * direction of the entity causing the wl_pointer.axis event. For -+ * example: - if a user's fingers on a touchpad move down and this -+ * causes a wl_pointer.axis vertical_scroll down event, the -+ * physical direction is 'identical' - if a user's fingers on a -+ * touchpad move down and this causes a wl_pointer.axis -+ * vertical_scroll up scroll up event ('natural scrolling'), the -+ * physical direction is 'inverted'. -+ * -+ * A client may use this information to adjust scroll motion of -+ * components. Specifically, enabling natural scrolling causes the -+ * content to change direction compared to traditional scrolling. -+ * Some widgets like volume control sliders should usually match -+ * the physical direction regardless of whether natural scrolling -+ * is active. This event enables clients to match the scroll -+ * direction of a widget to the physical direction. -+ * -+ * This event does not occur on its own, it is coupled with a -+ * wl_pointer.axis event that represents this axis value. The -+ * protocol guarantees that each axis_relative_direction event is -+ * always followed by exactly one axis event with the same axis -+ * number within the same wl_pointer.frame. Note that the protocol -+ * allows for other events to occur between the -+ * axis_relative_direction and its coupled axis event. -+ * -+ * The axis number is identical to the axis number in the -+ * associated axis event. -+ * -+ * The order of wl_pointer.axis_relative_direction, -+ * wl_pointer.axis_discrete and wl_pointer.axis_source is not -+ * guaranteed. -+ * @param axis axis type -+ * @param direction physical direction relative to axis motion -+ * @since 9 -+ */ -+ void (*axis_relative_direction)(void* data, struct wl_pointer* wl_pointer, -+ uint32_t axis, uint32_t direction); -+}; -+ - #ifdef __cplusplus - } - #endif - - #endif /* __MozWayland_h_ */ -diff --git a/widget/gtk/nsGtkKeyUtils.h b/widget/gtk/nsGtkKeyUtils.h ---- a/widget/gtk/nsGtkKeyUtils.h -+++ b/widget/gtk/nsGtkKeyUtils.h -@@ -196,22 +196,19 @@ - /** - * Utility function to set all supported modifier masks - * from xkb_keymap. We call that from Wayland backend routines. - */ - static void SetModifierMasks(xkb_keymap* aKeymap); -+ static void HandleKeymap(uint32_t format, int fd, uint32_t size); - - /** - * Wayland global focus handlers - */ - static void SetFocusIn(wl_surface* aFocusSurface, uint32_t aFocusSerial); - static void SetFocusOut(wl_surface* aFocusSurface); - static void GetFocusInfo(wl_surface** aFocusSurface, uint32_t* aFocusSerial); - -- static void SetSeat(wl_seat* aSeat, int aId); -- static void ClearSeat(int aId); -- static wl_seat* GetSeat(); -- - static void SetKeyboard(wl_keyboard* aKeyboard); - static wl_keyboard* GetKeyboard(); - static void ClearKeyboard(); - - /** -@@ -495,13 +492,10 @@ - void SetModifierMask(xkb_keymap* aKeymap, ModifierIndex aModifierIndex, - const char* aModifierName); - #endif - - #ifdef MOZ_WAYLAND -- static wl_seat* sSeat; -- static int sSeatID; -- static wl_keyboard* sKeyboard; - wl_surface* mFocusSurface = nullptr; - uint32_t mFocusSerial = 0; - #endif - }; - -diff --git a/widget/gtk/nsGtkKeyUtils.cpp b/widget/gtk/nsGtkKeyUtils.cpp ---- a/widget/gtk/nsGtkKeyUtils.cpp -+++ b/widget/gtk/nsGtkKeyUtils.cpp -@@ -63,16 +63,10 @@ - Time KeymapWrapper::sLastRepeatableKeyTime = 0; - #endif - KeymapWrapper::RepeatState KeymapWrapper::sRepeatState = - KeymapWrapper::NOT_PRESSED; - --#ifdef MOZ_WAYLAND --wl_seat* KeymapWrapper::sSeat = nullptr; --int KeymapWrapper::sSeatID = -1; --wl_keyboard* KeymapWrapper::sKeyboard = nullptr; --#endif -- - static const char* GetBoolName(bool aBool) { return aBool ? "TRUE" : "FALSE"; } - - static const char* GetStatusName(nsEventStatus aStatus) { - switch (aStatus) { - case nsEventStatus_eConsumeDoDefault: -@@ -688,12 +682,11 @@ - keymapWrapper->GetGdkModifierMask(HYPER))); - } - - /* This keymap routine is derived from weston-2.0.0/clients/simple-im.c - */ --static void keyboard_handle_keymap(void* data, struct wl_keyboard* wl_keyboard, -- uint32_t format, int fd, uint32_t size) { -+void KeymapWrapper::HandleKeymap(uint32_t format, int fd, uint32_t size) { - KeymapWrapper::ResetKeyboard(); - - if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) { - close(fd); - return; -@@ -722,54 +715,10 @@ - - xkb_keymap_unref(keymap); - - xkb_context_unref(xkb_context); - } -- --static void keyboard_handle_enter(void* data, struct wl_keyboard* keyboard, -- uint32_t serial, struct wl_surface* surface, -- struct wl_array* keys) { -- KeymapWrapper::SetFocusIn(surface, serial); --} -- --static void keyboard_handle_leave(void* data, struct wl_keyboard* keyboard, -- uint32_t serial, struct wl_surface* surface) { -- KeymapWrapper::SetFocusOut(surface); --} -- --static void keyboard_handle_key(void* data, struct wl_keyboard* keyboard, -- uint32_t serial, uint32_t time, uint32_t key, -- uint32_t state) {} --static void keyboard_handle_modifiers(void* data, struct wl_keyboard* keyboard, -- uint32_t serial, uint32_t mods_depressed, -- uint32_t mods_latched, -- uint32_t mods_locked, uint32_t group) {} --static void keyboard_handle_repeat_info(void* data, -- struct wl_keyboard* keyboard, -- int32_t rate, int32_t delay) {} -- --static const struct wl_keyboard_listener keyboard_listener = { -- keyboard_handle_keymap, keyboard_handle_enter, -- keyboard_handle_leave, keyboard_handle_key, -- keyboard_handle_modifiers, keyboard_handle_repeat_info}; -- --static void seat_handle_capabilities(void* data, struct wl_seat* seat, -- unsigned int caps) { -- wl_keyboard* keyboard = KeymapWrapper::GetKeyboard(); -- if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !keyboard) { -- keyboard = wl_seat_get_keyboard(seat); -- wl_keyboard_add_listener(keyboard, &keyboard_listener, nullptr); -- KeymapWrapper::SetKeyboard(keyboard); -- } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && keyboard) { -- KeymapWrapper::ClearKeyboard(); -- } --} -- --static const struct wl_seat_listener seat_listener = { -- seat_handle_capabilities, --}; -- - #endif - - KeymapWrapper::~KeymapWrapper() { - #ifdef MOZ_X11 - gdk_window_remove_filter(nullptr, FilterEvents, this); -@@ -2694,38 +2643,9 @@ - uint32_t* aFocusSerial) { - KeymapWrapper* keymapWrapper = KeymapWrapper::GetInstance(); - *aFocusSurface = keymapWrapper->mFocusSurface; - *aFocusSerial = keymapWrapper->mFocusSerial; - } -- --void KeymapWrapper::SetSeat(wl_seat* aSeat, int aId) { -- sSeat = aSeat; -- sSeatID = aId; -- wl_seat_add_listener(aSeat, &seat_listener, nullptr); --} -- --void KeymapWrapper::ClearSeat(int aId) { -- if (sSeatID == aId) { -- ClearKeyboard(); -- sSeat = nullptr; -- sSeatID = -1; -- } --} -- --wl_seat* KeymapWrapper::GetSeat() { return sSeat; } -- --void KeymapWrapper::SetKeyboard(wl_keyboard* aKeyboard) { -- sKeyboard = aKeyboard; --} -- --wl_keyboard* KeymapWrapper::GetKeyboard() { return sKeyboard; } -- --void KeymapWrapper::ClearKeyboard() { -- if (sKeyboard) { -- wl_keyboard_destroy(sKeyboard); -- sKeyboard = nullptr; -- } --} - #endif - - } // namespace widget - } // namespace mozilla -diff --git a/widget/gtk/nsWaylandDisplay.h b/widget/gtk/nsWaylandDisplay.h ---- a/widget/gtk/nsWaylandDisplay.h -+++ b/widget/gtk/nsWaylandDisplay.h -@@ -14,10 +14,11 @@ - #include "mozilla/widget/gbm.h" - #include "mozilla/widget/fractional-scale-v1-client-protocol.h" - #include "mozilla/widget/idle-inhibit-unstable-v1-client-protocol.h" - #include "mozilla/widget/relative-pointer-unstable-v1-client-protocol.h" - #include "mozilla/widget/pointer-constraints-unstable-v1-client-protocol.h" -+#include "mozilla/widget/pointer-gestures-unstable-v1-client-protocol.h" - #include "mozilla/widget/linux-dmabuf-unstable-v1-client-protocol.h" - #include "mozilla/widget/viewporter-client-protocol.h" - #include "mozilla/widget/xdg-activation-v1-client-protocol.h" - #include "mozilla/widget/xdg-dbus-annotation-v1-client-protocol.h" - #include "mozilla/widget/xdg-output-unstable-v1-client-protocol.h" -@@ -55,19 +56,33 @@ - wp_fractional_scale_manager_v1* GetFractionalScaleManager() { - return mFractionalScaleManager; - } - bool IsPrimarySelectionEnabled() { return mIsPrimarySelectionEnabled; } - -+ wl_pointer* GetPointer() { return mPointer; } -+ void SetPointer(wl_pointer* aPointer); -+ void RemovePointer(); -+ - void SetShm(wl_shm* aShm); -+ -+ void SetKeyboard(wl_keyboard* aKeyboard); -+ wl_keyboard* GetKeyboard() { return mKeyboard; } -+ void ClearKeyboard(); -+ -+ void SetSeat(wl_seat* aSeat, int aSeatId); -+ wl_seat* GetSeat() { return mSeat; } -+ void RemoveSeat(int aSeatId); -+ - void SetCompositor(wl_compositor* aCompositor); - void SetSubcompositor(wl_subcompositor* aSubcompositor); - void SetDataDeviceManager(wl_data_device_manager* aDataDeviceManager); - void SetIdleInhibitManager(zwp_idle_inhibit_manager_v1* aIdleInhibitManager); - void SetViewporter(wp_viewporter* aViewporter); - void SetRelativePointerManager( - zwp_relative_pointer_manager_v1* aRelativePointerManager); - void SetPointerConstraints(zwp_pointer_constraints_v1* aPointerConstraints); -+ void SetPointerGestures(zwp_pointer_gestures_v1* aPointerGestures); - void SetDmabuf(zwp_linux_dmabuf_v1* aDmabuf); - void SetXdgActivation(xdg_activation_v1* aXdgActivation); - void SetXdgDbusAnnotationManager( - xdg_dbus_annotation_manager_v1* aXdgDbusAnnotationManager); - void SetFractionalScaleManager(wp_fractional_scale_manager_v1* aManager) { -@@ -82,13 +97,19 @@ - wl_registry* mRegistry = nullptr; - wl_display* mDisplay = nullptr; - wl_compositor* mCompositor = nullptr; - wl_subcompositor* mSubcompositor = nullptr; - wl_shm* mShm = nullptr; -+ wl_seat* mSeat = nullptr; -+ int mSeatId = -1; -+ wl_keyboard* mKeyboard = nullptr; -+ wl_pointer* mPointer = nullptr; - zwp_idle_inhibit_manager_v1* mIdleInhibitManager = nullptr; - zwp_relative_pointer_manager_v1* mRelativePointerManager = nullptr; - zwp_pointer_constraints_v1* mPointerConstraints = nullptr; -+ zwp_pointer_gestures_v1* mPointerGestures = nullptr; -+ zwp_pointer_gesture_hold_v1* mPointerGestureHold = nullptr; - wp_viewporter* mViewporter = nullptr; - zwp_linux_dmabuf_v1* mDmabuf = nullptr; - xdg_activation_v1* mXdgActivation = nullptr; - xdg_dbus_annotation_manager_v1* mXdgDbusAnnotationManager = nullptr; - wp_fractional_scale_manager_v1* mFractionalScaleManager = nullptr; -diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp ---- a/widget/gtk/nsWaylandDisplay.cpp -+++ b/widget/gtk/nsWaylandDisplay.cpp -@@ -17,10 +17,11 @@ - #include "mozilla/ThreadLocal.h" - #include "mozilla/StaticPrefs_widget.h" - #include "mozilla/Sprintf.h" - #include "WidgetUtilsGtk.h" - #include "nsGtkKeyUtils.h" -+#include "nsWindow.h" - - namespace mozilla::widget { - - static nsWaylandDisplay* gWaylandDisplay; - -@@ -55,10 +56,202 @@ - return gWaylandDisplay; - } - - void nsWaylandDisplay::SetShm(wl_shm* aShm) { mShm = aShm; } - -+struct PointerState { -+ wl_surface* surface; -+ -+ nsWindow* GetWindow() { -+ GdkWindow* window = -+ static_cast(wl_surface_get_user_data(surface)); -+ return window ? static_cast( -+ g_object_get_data(G_OBJECT(window), "nsWindow")) -+ : nullptr; -+ } -+} sPointerState; -+ -+static void gesture_hold_begin(void* data, -+ struct zwp_pointer_gesture_hold_v1* hold, -+ uint32_t serial, uint32_t time, -+ struct wl_surface* surface, uint32_t fingers) { -+ RefPtr window = sPointerState.GetWindow(); -+ if (!window) { -+ return; -+ } -+ window->OnTouchpadHoldEvent(GDK_TOUCHPAD_GESTURE_PHASE_BEGIN, time, fingers); -+} -+ -+static void gesture_hold_end(void* data, -+ struct zwp_pointer_gesture_hold_v1* hold, -+ uint32_t serial, uint32_t time, -+ int32_t cancelled) { -+ RefPtr window = sPointerState.GetWindow(); -+ if (!window) { -+ return; -+ } -+ window->OnTouchpadHoldEvent(cancelled ? GDK_TOUCHPAD_GESTURE_PHASE_CANCEL -+ : GDK_TOUCHPAD_GESTURE_PHASE_END, -+ time, 0); -+} -+ -+static const struct zwp_pointer_gesture_hold_v1_listener gesture_hold_listener = -+ {gesture_hold_begin, gesture_hold_end}; -+ -+static void pointer_handle_enter(void* data, struct wl_pointer* pointer, -+ uint32_t serial, struct wl_surface* surface, -+ wl_fixed_t sx, wl_fixed_t sy) { -+ sPointerState.surface = surface; -+} -+ -+static void pointer_handle_leave(void* data, struct wl_pointer* pointer, -+ uint32_t serial, struct wl_surface* surface) { -+ sPointerState.surface = nullptr; -+} -+ -+static void pointer_handle_motion(void* data, struct wl_pointer* pointer, -+ uint32_t time, wl_fixed_t sx, wl_fixed_t sy) { -+} -+ -+static void pointer_handle_button(void* data, struct wl_pointer* pointer, -+ uint32_t serial, uint32_t time, -+ uint32_t button, uint32_t state) {} -+ -+static void pointer_handle_axis(void* data, struct wl_pointer* pointer, -+ uint32_t time, uint32_t axis, -+ wl_fixed_t value) {} -+ -+static void pointer_handle_frame(void* data, struct wl_pointer* pointer) {} -+ -+static void pointer_handle_axis_source( -+ void* data, struct wl_pointer* pointer, -+ /*enum wl_pointer_axis_source */ uint32_t source) {} -+ -+static void pointer_handle_axis_stop(void* data, struct wl_pointer* pointer, -+ uint32_t time, uint32_t axis) {} -+ -+static void pointer_handle_axis_discrete(void* data, struct wl_pointer* pointer, -+ uint32_t axis, int32_t value) {} -+ -+static void pointer_handle_axis_value120(void* data, struct wl_pointer* pointer, -+ uint32_t axis, int32_t value) {} -+ -+static const struct moz_wl_pointer_listener pointer_listener = { -+ pointer_handle_enter, pointer_handle_leave, -+ pointer_handle_motion, pointer_handle_button, -+ pointer_handle_axis, pointer_handle_frame, -+ pointer_handle_axis_source, pointer_handle_axis_stop, -+ pointer_handle_axis_discrete, pointer_handle_axis_value120, -+}; -+ -+void nsWaylandDisplay::SetPointer(wl_pointer* aPointer) { -+ if (!mPointerGestures) { -+ return; -+ } -+ MOZ_DIAGNOSTIC_ASSERT(!mPointer); -+ mPointer = aPointer; -+ wl_pointer_add_listener(mPointer, -+ (const wl_pointer_listener*)&pointer_listener, this); -+ -+ mPointerGestureHold = -+ zwp_pointer_gestures_v1_get_hold_gesture(mPointerGestures, mPointer); -+ zwp_pointer_gesture_hold_v1_set_user_data(mPointerGestureHold, this); -+ zwp_pointer_gesture_hold_v1_add_listener(mPointerGestureHold, -+ &gesture_hold_listener, this); -+} -+ -+void nsWaylandDisplay::RemovePointer() { -+ wl_pointer_release(mPointer); -+ mPointer = nullptr; -+} -+ -+static void seat_handle_capabilities(void* data, struct wl_seat* seat, -+ unsigned int caps) { -+ auto* display = static_cast(data); -+ if (!display) { -+ return; -+ } -+ -+ if ((caps & WL_SEAT_CAPABILITY_POINTER) && !display->GetPointer()) { -+ display->SetPointer(wl_seat_get_pointer(seat)); -+ } else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && display->GetPointer()) { -+ display->RemovePointer(); -+ } -+ -+ wl_keyboard* keyboard = display->GetKeyboard(); -+ if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !keyboard) { -+ display->SetKeyboard(wl_seat_get_keyboard(seat)); -+ } else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && keyboard) { -+ display->ClearKeyboard(); -+ } -+} -+ -+static const struct wl_seat_listener seat_listener = { -+ seat_handle_capabilities, -+}; -+ -+void nsWaylandDisplay::SetSeat(wl_seat* aSeat, int aSeatId) { -+ mSeat = aSeat; -+ mSeatId = aSeatId; -+ wl_seat_add_listener(aSeat, &seat_listener, this); -+} -+ -+void nsWaylandDisplay::RemoveSeat(int aSeatId) { -+ if (mSeatId == aSeatId) { -+ mSeat = nullptr; -+ mSeatId = -1; -+ } -+} -+ -+/* This keymap routine is derived from weston-2.0.0/clients/simple-im.c -+ */ -+static void keyboard_handle_keymap(void* data, struct wl_keyboard* wl_keyboard, -+ uint32_t format, int fd, uint32_t size) { -+ KeymapWrapper::HandleKeymap(format, fd, size); -+} -+ -+static void keyboard_handle_enter(void* data, struct wl_keyboard* keyboard, -+ uint32_t serial, struct wl_surface* surface, -+ struct wl_array* keys) { -+ KeymapWrapper::SetFocusIn(surface, serial); -+} -+ -+static void keyboard_handle_leave(void* data, struct wl_keyboard* keyboard, -+ uint32_t serial, struct wl_surface* surface) { -+ KeymapWrapper::SetFocusOut(surface); -+} -+ -+static void keyboard_handle_key(void* data, struct wl_keyboard* keyboard, -+ uint32_t serial, uint32_t time, uint32_t key, -+ uint32_t state) {} -+static void keyboard_handle_modifiers(void* data, struct wl_keyboard* keyboard, -+ uint32_t serial, uint32_t mods_depressed, -+ uint32_t mods_latched, -+ uint32_t mods_locked, uint32_t group) {} -+static void keyboard_handle_repeat_info(void* data, -+ struct wl_keyboard* keyboard, -+ int32_t rate, int32_t delay) {} -+ -+static const struct wl_keyboard_listener keyboard_listener = { -+ keyboard_handle_keymap, keyboard_handle_enter, -+ keyboard_handle_leave, keyboard_handle_key, -+ keyboard_handle_modifiers, keyboard_handle_repeat_info}; -+ -+void nsWaylandDisplay::SetKeyboard(wl_keyboard* aKeyboard) { -+ MOZ_ASSERT(aKeyboard); -+ MOZ_DIAGNOSTIC_ASSERT(!mKeyboard); -+ mKeyboard = aKeyboard; -+ wl_keyboard_add_listener(mKeyboard, &keyboard_listener, nullptr); -+} -+ -+void nsWaylandDisplay::ClearKeyboard() { -+ if (mKeyboard) { -+ wl_keyboard_destroy(mKeyboard); -+ mKeyboard = nullptr; -+ } -+} -+ - void nsWaylandDisplay::SetCompositor(wl_compositor* aCompositor) { - mCompositor = aCompositor; - } - - void nsWaylandDisplay::SetSubcompositor(wl_subcompositor* aSubcompositor) { -@@ -82,10 +275,15 @@ - void nsWaylandDisplay::SetPointerConstraints( - zwp_pointer_constraints_v1* aPointerConstraints) { - mPointerConstraints = aPointerConstraints; - } - -+void nsWaylandDisplay::SetPointerGestures( -+ zwp_pointer_gestures_v1* aPointerGestures) { -+ mPointerGestures = aPointerGestures; -+} -+ - void nsWaylandDisplay::SetDmabuf(zwp_linux_dmabuf_v1* aDmabuf) { - mDmabuf = aDmabuf; - } - - void nsWaylandDisplay::SetXdgActivation(xdg_activation_v1* aXdgActivation) { -@@ -122,11 +320,12 @@ - } else if (iface.EqualsLiteral("zwp_pointer_constraints_v1")) { - auto* pointer_constraints = WaylandRegistryBind( - registry, id, &zwp_pointer_constraints_v1_interface, 1); - display->SetPointerConstraints(pointer_constraints); - } else if (iface.EqualsLiteral("wl_compositor")) { -- // Requested wl_compositor version 4 as we need wl_surface_damage_buffer(). -+ // Requested wl_compositor version 4 as we need -+ // wl_surface_damage_buffer(). - auto* compositor = WaylandRegistryBind( - registry, id, &wl_compositor_interface, 4); - display->SetCompositor(compositor); - } else if (iface.EqualsLiteral("wl_subcompositor")) { - auto* subcompositor = WaylandRegistryBind( -@@ -150,24 +349,33 @@ - registry, id, &xdg_dbus_annotation_manager_v1_interface, 1); - display->SetXdgDbusAnnotationManager(annotationManager); - } else if (iface.EqualsLiteral("wl_seat")) { - auto* seat = - WaylandRegistryBind(registry, id, &wl_seat_interface, 1); -- KeymapWrapper::SetSeat(seat, id); -+ display->SetSeat(seat, id); - } else if (iface.EqualsLiteral("wp_fractional_scale_manager_v1")) { - auto* manager = WaylandRegistryBind( - registry, id, &wp_fractional_scale_manager_v1_interface, 1); - display->SetFractionalScaleManager(manager); - } else if (iface.EqualsLiteral("gtk_primary_selection_device_manager") || - iface.EqualsLiteral("zwp_primary_selection_device_manager_v1")) { - display->EnablePrimarySelection(); -+ } else if (iface.EqualsLiteral("zwp_pointer_gestures_v1")) { -+ // HOLD is introduced in version 3 -+ auto* gestures = WaylandRegistryBind( -+ registry, id, &zwp_pointer_gestures_v1_interface, 3); -+ display->SetPointerGestures(gestures); - } - } - - static void global_registry_remover(void* data, wl_registry* registry, - uint32_t id) { -- KeymapWrapper::ClearSeat(id); -+ auto* display = static_cast(data); -+ if (!display) { -+ return; -+ } -+ display->RemoveSeat(id); - } - - static const struct wl_registry_listener registry_listener = { - global_registry_handler, global_registry_remover}; - -diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h ---- a/widget/gtk/nsWindow.h -+++ b/widget/gtk/nsWindow.h -@@ -107,10 +107,19 @@ - GDK_ANCHOR_SLIDE = GDK_ANCHOR_SLIDE_X | GDK_ANCHOR_SLIDE_Y, - GDK_ANCHOR_RESIZE = GDK_ANCHOR_RESIZE_X | GDK_ANCHOR_RESIZE_Y - } GdkAnchorHints; - #endif - -+#if !GTK_CHECK_VERSION(3, 18, 0) -+typedef enum { -+ GDK_TOUCHPAD_GESTURE_PHASE_BEGIN, -+ GDK_TOUCHPAD_GESTURE_PHASE_UPDATE, -+ GDK_TOUCHPAD_GESTURE_PHASE_END, -+ GDK_TOUCHPAD_GESTURE_PHASE_CANCEL -+} GdkTouchpadGesturePhase; -+#endif -+ - namespace mozilla { - enum class NativeKeyBindingsType : uint8_t; - - class TimeStamp; - #ifdef MOZ_X11 -@@ -256,10 +265,12 @@ - GtkSelectionData* aSelectionData, guint aInfo, - guint aTime, gpointer aData); - gboolean OnPropertyNotifyEvent(GtkWidget* aWidget, GdkEventProperty* aEvent); - gboolean OnTouchEvent(GdkEventTouch* aEvent); - gboolean OnTouchpadPinchEvent(GdkEventTouchpadPinch* aEvent); -+ void OnTouchpadHoldEvent(GdkTouchpadGesturePhase aPhase, guint aTime, -+ uint32_t aFingers); - - gint GetInputRegionMarginInGdkCoords(); - - void UpdateOpaqueRegionInternal(); - void UpdateOpaqueRegion(const LayoutDeviceIntRegion&) override; -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp ---- a/widget/gtk/nsWindow.cpp -+++ b/widget/gtk/nsWindow.cpp -@@ -139,11 +139,10 @@ - // Don't put more than this many rects in the dirty region, just fluff - // out to the bounding-box if there are more - #define MAX_RECTS_IN_REGION 100 - - #if !GTK_CHECK_VERSION(3, 18, 0) -- - struct _GdkEventTouchpadPinch { - GdkEventType type; - GdkWindow* window; - gint8 send_event; - gint8 phase; -@@ -157,20 +156,12 @@ - gdouble scale; - gdouble x_root, y_root; - guint state; - }; - --typedef enum { -- GDK_TOUCHPAD_GESTURE_PHASE_BEGIN, -- GDK_TOUCHPAD_GESTURE_PHASE_UPDATE, -- GDK_TOUCHPAD_GESTURE_PHASE_END, -- GDK_TOUCHPAD_GESTURE_PHASE_CANCEL --} GdkTouchpadGesturePhase; -- - gint GDK_TOUCHPAD_GESTURE_MASK = 1 << 24; - GdkEventType GDK_TOUCHPAD_PINCH = static_cast(42); -- - #endif - - const gint kEvents = GDK_TOUCHPAD_GESTURE_MASK | GDK_EXPOSURE_MASK | - GDK_STRUCTURE_MASK | GDK_VISIBILITY_NOTIFY_MASK | - GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | -@@ -5509,10 +5500,15 @@ - mLastPinchEventSpan = aEvent->scale; - DispatchPinchGestureInput(event); - return TRUE; - } - -+void nsWindow::OnTouchpadHoldEvent(GdkTouchpadGesturePhase aPhase, guint aTime, -+ uint32_t aFingers) { -+ LOG("OnTouchpadHoldEvent: aPhase %d aFingers %d", aPhase, aFingers); -+} -+ - gboolean nsWindow::OnTouchEvent(GdkEventTouch* aEvent) { - LOG("OnTouchEvent: x=%f y=%f type=%d\n", aEvent->x, aEvent->y, aEvent->type); - if (!mHandleTouchEvent) { - // If a popup window was spawned (e.g. as the result of a long-press) - // and touch events got diverted to that window within a touch sequence, -diff --git a/widget/gtk/wayland/moz.build b/widget/gtk/wayland/moz.build ---- a/widget/gtk/wayland/moz.build -+++ b/widget/gtk/wayland/moz.build -@@ -10,10 +10,11 @@ - SOURCES += [ - "fractional-scale-v1-protocol.c", - "idle-inhibit-unstable-v1-protocol.c", - "linux-dmabuf-unstable-v1-protocol.c", - "pointer-constraints-unstable-v1-protocol.c", -+ "pointer-gestures-unstable-v1-protocol.c", - "relative-pointer-unstable-v1-protocol.c", - "viewporter-protocol.c", - "xdg-activation-v1-protocol.c", - "xdg-dbus-annotation-v1-protocol.c", - "xdg-output-unstable-v1-protocol.c", -@@ -22,10 +23,11 @@ - EXPORTS.mozilla.widget += [ - "fractional-scale-v1-client-protocol.h", - "idle-inhibit-unstable-v1-client-protocol.h", - "linux-dmabuf-unstable-v1-client-protocol.h", - "pointer-constraints-unstable-v1-client-protocol.h", -+ "pointer-gestures-unstable-v1-client-protocol.h", - "relative-pointer-unstable-v1-client-protocol.h", - "viewporter-client-protocol.h", - "xdg-activation-v1-client-protocol.h", - "xdg-dbus-annotation-v1-client-protocol.h", - "xdg-output-unstable-v1-client-protocol.h", -diff --git a/widget/gtk/wayland/pointer-gestures-unstable-v1-client-protocol.h b/widget/gtk/wayland/pointer-gestures-unstable-v1-client-protocol.h -new file mode 100644 ---- /dev/null -+++ b/widget/gtk/wayland/pointer-gestures-unstable-v1-client-protocol.h -@@ -0,0 +1,685 @@ -+/* Generated by wayland-scanner 1.22.0 */ -+ -+#ifndef POINTER_GESTURES_UNSTABLE_V1_CLIENT_PROTOCOL_H -+#define POINTER_GESTURES_UNSTABLE_V1_CLIENT_PROTOCOL_H -+ -+#include -+#include -+#include "wayland-client.h" -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+/** -+ * @page page_pointer_gestures_unstable_v1 The pointer_gestures_unstable_v1 -+ * protocol -+ * @section page_ifaces_pointer_gestures_unstable_v1 Interfaces -+ * - @subpage page_iface_zwp_pointer_gestures_v1 - touchpad gestures -+ * - @subpage page_iface_zwp_pointer_gesture_swipe_v1 - a swipe gesture object -+ * - @subpage page_iface_zwp_pointer_gesture_pinch_v1 - a pinch gesture object -+ * - @subpage page_iface_zwp_pointer_gesture_hold_v1 - a hold gesture object -+ */ -+struct wl_pointer; -+struct wl_surface; -+struct zwp_pointer_gesture_hold_v1; -+struct zwp_pointer_gesture_pinch_v1; -+struct zwp_pointer_gesture_swipe_v1; -+struct zwp_pointer_gestures_v1; -+ -+#ifndef ZWP_POINTER_GESTURES_V1_INTERFACE -+# define ZWP_POINTER_GESTURES_V1_INTERFACE -+/** -+ * @page page_iface_zwp_pointer_gestures_v1 zwp_pointer_gestures_v1 -+ * @section page_iface_zwp_pointer_gestures_v1_desc Description -+ * -+ * A global interface to provide semantic touchpad gestures for a given -+ * pointer. -+ * -+ * Three gestures are currently supported: swipe, pinch, and hold. -+ * Pinch and swipe gestures follow a three-stage cycle: begin, update, -+ * end, hold gestures follow a two-stage cycle: begin and end. All -+ * gestures are identified by a unique id. -+ * -+ * Warning! The protocol described in this file is experimental and -+ * backward incompatible changes may be made. Backward compatible changes -+ * may be added together with the corresponding interface version bump. -+ * Backward incompatible changes are done by bumping the version number in -+ * the protocol and interface names and resetting the interface version. -+ * Once the protocol is to be declared stable, the 'z' prefix and the -+ * version number in the protocol and interface names are removed and the -+ * interface version number is reset. -+ * @section page_iface_zwp_pointer_gestures_v1_api API -+ * See @ref iface_zwp_pointer_gestures_v1. -+ */ -+/** -+ * @defgroup iface_zwp_pointer_gestures_v1 The zwp_pointer_gestures_v1 interface -+ * -+ * A global interface to provide semantic touchpad gestures for a given -+ * pointer. -+ * -+ * Three gestures are currently supported: swipe, pinch, and hold. -+ * Pinch and swipe gestures follow a three-stage cycle: begin, update, -+ * end, hold gestures follow a two-stage cycle: begin and end. All -+ * gestures are identified by a unique id. -+ * -+ * Warning! The protocol described in this file is experimental and -+ * backward incompatible changes may be made. Backward compatible changes -+ * may be added together with the corresponding interface version bump. -+ * Backward incompatible changes are done by bumping the version number in -+ * the protocol and interface names and resetting the interface version. -+ * Once the protocol is to be declared stable, the 'z' prefix and the -+ * version number in the protocol and interface names are removed and the -+ * interface version number is reset. -+ */ -+extern const struct wl_interface zwp_pointer_gestures_v1_interface; -+#endif -+#ifndef ZWP_POINTER_GESTURE_SWIPE_V1_INTERFACE -+# define ZWP_POINTER_GESTURE_SWIPE_V1_INTERFACE -+/** -+ * @page page_iface_zwp_pointer_gesture_swipe_v1 zwp_pointer_gesture_swipe_v1 -+ * @section page_iface_zwp_pointer_gesture_swipe_v1_desc Description -+ * -+ * A swipe gesture object notifies a client about a multi-finger swipe -+ * gesture detected on an indirect input device such as a touchpad. -+ * The gesture is usually initiated by multiple fingers moving in the -+ * same direction but once initiated the direction may change. -+ * The precise conditions of when such a gesture is detected are -+ * implementation-dependent. -+ * -+ * A gesture consists of three stages: begin, update (optional) and end. -+ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a -+ * same pointer/seat, how compositors prevent these situations is -+ * implementation-dependent. -+ * -+ * A gesture may be cancelled by the compositor or the hardware. -+ * Clients should not consider performing permanent or irreversible -+ * actions until the end of a gesture has been received. -+ * @section page_iface_zwp_pointer_gesture_swipe_v1_api API -+ * See @ref iface_zwp_pointer_gesture_swipe_v1. -+ */ -+/** -+ * @defgroup iface_zwp_pointer_gesture_swipe_v1 The zwp_pointer_gesture_swipe_v1 -+ * interface -+ * -+ * A swipe gesture object notifies a client about a multi-finger swipe -+ * gesture detected on an indirect input device such as a touchpad. -+ * The gesture is usually initiated by multiple fingers moving in the -+ * same direction but once initiated the direction may change. -+ * The precise conditions of when such a gesture is detected are -+ * implementation-dependent. -+ * -+ * A gesture consists of three stages: begin, update (optional) and end. -+ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a -+ * same pointer/seat, how compositors prevent these situations is -+ * implementation-dependent. -+ * -+ * A gesture may be cancelled by the compositor or the hardware. -+ * Clients should not consider performing permanent or irreversible -+ * actions until the end of a gesture has been received. -+ */ -+extern const struct wl_interface zwp_pointer_gesture_swipe_v1_interface; -+#endif -+#ifndef ZWP_POINTER_GESTURE_PINCH_V1_INTERFACE -+# define ZWP_POINTER_GESTURE_PINCH_V1_INTERFACE -+/** -+ * @page page_iface_zwp_pointer_gesture_pinch_v1 zwp_pointer_gesture_pinch_v1 -+ * @section page_iface_zwp_pointer_gesture_pinch_v1_desc Description -+ * -+ * A pinch gesture object notifies a client about a multi-finger pinch -+ * gesture detected on an indirect input device such as a touchpad. -+ * The gesture is usually initiated by multiple fingers moving towards -+ * each other or away from each other, or by two or more fingers rotating -+ * around a logical center of gravity. The precise conditions of when -+ * such a gesture is detected are implementation-dependent. -+ * -+ * A gesture consists of three stages: begin, update (optional) and end. -+ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a -+ * same pointer/seat, how compositors prevent these situations is -+ * implementation-dependent. -+ * -+ * A gesture may be cancelled by the compositor or the hardware. -+ * Clients should not consider performing permanent or irreversible -+ * actions until the end of a gesture has been received. -+ * @section page_iface_zwp_pointer_gesture_pinch_v1_api API -+ * See @ref iface_zwp_pointer_gesture_pinch_v1. -+ */ -+/** -+ * @defgroup iface_zwp_pointer_gesture_pinch_v1 The zwp_pointer_gesture_pinch_v1 -+ * interface -+ * -+ * A pinch gesture object notifies a client about a multi-finger pinch -+ * gesture detected on an indirect input device such as a touchpad. -+ * The gesture is usually initiated by multiple fingers moving towards -+ * each other or away from each other, or by two or more fingers rotating -+ * around a logical center of gravity. The precise conditions of when -+ * such a gesture is detected are implementation-dependent. -+ * -+ * A gesture consists of three stages: begin, update (optional) and end. -+ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a -+ * same pointer/seat, how compositors prevent these situations is -+ * implementation-dependent. -+ * -+ * A gesture may be cancelled by the compositor or the hardware. -+ * Clients should not consider performing permanent or irreversible -+ * actions until the end of a gesture has been received. -+ */ -+extern const struct wl_interface zwp_pointer_gesture_pinch_v1_interface; -+#endif -+#ifndef ZWP_POINTER_GESTURE_HOLD_V1_INTERFACE -+# define ZWP_POINTER_GESTURE_HOLD_V1_INTERFACE -+/** -+ * @page page_iface_zwp_pointer_gesture_hold_v1 zwp_pointer_gesture_hold_v1 -+ * @section page_iface_zwp_pointer_gesture_hold_v1_desc Description -+ * -+ * A hold gesture object notifies a client about a single- or -+ * multi-finger hold gesture detected on an indirect input device such as -+ * a touchpad. The gesture is usually initiated by one or more fingers -+ * being held down without significant movement. The precise conditions -+ * of when such a gesture is detected are implementation-dependent. -+ * -+ * In particular, this gesture may be used to cancel kinetic scrolling. -+ * -+ * A hold gesture consists of two stages: begin and end. Unlike pinch and -+ * swipe there is no update stage. -+ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a -+ * same pointer/seat, how compositors prevent these situations is -+ * implementation-dependent. -+ * -+ * A gesture may be cancelled by the compositor or the hardware. -+ * Clients should not consider performing permanent or irreversible -+ * actions until the end of a gesture has been received. -+ * @section page_iface_zwp_pointer_gesture_hold_v1_api API -+ * See @ref iface_zwp_pointer_gesture_hold_v1. -+ */ -+/** -+ * @defgroup iface_zwp_pointer_gesture_hold_v1 The zwp_pointer_gesture_hold_v1 -+ * interface -+ * -+ * A hold gesture object notifies a client about a single- or -+ * multi-finger hold gesture detected on an indirect input device such as -+ * a touchpad. The gesture is usually initiated by one or more fingers -+ * being held down without significant movement. The precise conditions -+ * of when such a gesture is detected are implementation-dependent. -+ * -+ * In particular, this gesture may be used to cancel kinetic scrolling. -+ * -+ * A hold gesture consists of two stages: begin and end. Unlike pinch and -+ * swipe there is no update stage. -+ * There cannot be multiple simultaneous hold, pinch or swipe gestures on a -+ * same pointer/seat, how compositors prevent these situations is -+ * implementation-dependent. -+ * -+ * A gesture may be cancelled by the compositor or the hardware. -+ * Clients should not consider performing permanent or irreversible -+ * actions until the end of a gesture has been received. -+ */ -+extern const struct wl_interface zwp_pointer_gesture_hold_v1_interface; -+#endif -+ -+#define ZWP_POINTER_GESTURES_V1_GET_SWIPE_GESTURE 0 -+#define ZWP_POINTER_GESTURES_V1_GET_PINCH_GESTURE 1 -+#define ZWP_POINTER_GESTURES_V1_RELEASE 2 -+#define ZWP_POINTER_GESTURES_V1_GET_HOLD_GESTURE 3 -+ -+/** -+ * @ingroup iface_zwp_pointer_gestures_v1 -+ */ -+#define ZWP_POINTER_GESTURES_V1_GET_SWIPE_GESTURE_SINCE_VERSION 1 -+/** -+ * @ingroup iface_zwp_pointer_gestures_v1 -+ */ -+#define ZWP_POINTER_GESTURES_V1_GET_PINCH_GESTURE_SINCE_VERSION 1 -+/** -+ * @ingroup iface_zwp_pointer_gestures_v1 -+ */ -+#define ZWP_POINTER_GESTURES_V1_RELEASE_SINCE_VERSION 2 -+/** -+ * @ingroup iface_zwp_pointer_gestures_v1 -+ */ -+#define ZWP_POINTER_GESTURES_V1_GET_HOLD_GESTURE_SINCE_VERSION 3 -+ -+/** @ingroup iface_zwp_pointer_gestures_v1 */ -+static inline void zwp_pointer_gestures_v1_set_user_data( -+ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1, void* user_data) { -+ wl_proxy_set_user_data((struct wl_proxy*)zwp_pointer_gestures_v1, user_data); -+} -+ -+/** @ingroup iface_zwp_pointer_gestures_v1 */ -+static inline void* zwp_pointer_gestures_v1_get_user_data( -+ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1) { -+ return wl_proxy_get_user_data((struct wl_proxy*)zwp_pointer_gestures_v1); -+} -+ -+static inline uint32_t zwp_pointer_gestures_v1_get_version( -+ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1) { -+ return wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gestures_v1); -+} -+ -+/** @ingroup iface_zwp_pointer_gestures_v1 */ -+static inline void zwp_pointer_gestures_v1_destroy( -+ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1) { -+ wl_proxy_destroy((struct wl_proxy*)zwp_pointer_gestures_v1); -+} -+ -+/** -+ * @ingroup iface_zwp_pointer_gestures_v1 -+ * -+ * Create a swipe gesture object. See the -+ * wl_pointer_gesture_swipe interface for details. -+ */ -+static inline struct zwp_pointer_gesture_swipe_v1* -+zwp_pointer_gestures_v1_get_swipe_gesture( -+ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1, -+ struct wl_pointer* pointer) { -+ struct wl_proxy* id; -+ -+ id = wl_proxy_marshal_flags( -+ (struct wl_proxy*)zwp_pointer_gestures_v1, -+ ZWP_POINTER_GESTURES_V1_GET_SWIPE_GESTURE, -+ &zwp_pointer_gesture_swipe_v1_interface, -+ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gestures_v1), 0, NULL, -+ pointer); -+ -+ return (struct zwp_pointer_gesture_swipe_v1*)id; -+} -+ -+/** -+ * @ingroup iface_zwp_pointer_gestures_v1 -+ * -+ * Create a pinch gesture object. See the -+ * wl_pointer_gesture_pinch interface for details. -+ */ -+static inline struct zwp_pointer_gesture_pinch_v1* -+zwp_pointer_gestures_v1_get_pinch_gesture( -+ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1, -+ struct wl_pointer* pointer) { -+ struct wl_proxy* id; -+ -+ id = wl_proxy_marshal_flags( -+ (struct wl_proxy*)zwp_pointer_gestures_v1, -+ ZWP_POINTER_GESTURES_V1_GET_PINCH_GESTURE, -+ &zwp_pointer_gesture_pinch_v1_interface, -+ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gestures_v1), 0, NULL, -+ pointer); -+ -+ return (struct zwp_pointer_gesture_pinch_v1*)id; -+} -+ -+/** -+ * @ingroup iface_zwp_pointer_gestures_v1 -+ * -+ * Destroy the pointer gesture object. Swipe, pinch and hold objects -+ * created via this gesture object remain valid. -+ */ -+static inline void zwp_pointer_gestures_v1_release( -+ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1) { -+ wl_proxy_marshal_flags( -+ (struct wl_proxy*)zwp_pointer_gestures_v1, -+ ZWP_POINTER_GESTURES_V1_RELEASE, NULL, -+ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gestures_v1), -+ WL_MARSHAL_FLAG_DESTROY); -+} -+ -+/** -+ * @ingroup iface_zwp_pointer_gestures_v1 -+ * -+ * Create a hold gesture object. See the -+ * wl_pointer_gesture_hold interface for details. -+ */ -+static inline struct zwp_pointer_gesture_hold_v1* -+zwp_pointer_gestures_v1_get_hold_gesture( -+ struct zwp_pointer_gestures_v1* zwp_pointer_gestures_v1, -+ struct wl_pointer* pointer) { -+ struct wl_proxy* id; -+ -+ id = wl_proxy_marshal_flags( -+ (struct wl_proxy*)zwp_pointer_gestures_v1, -+ ZWP_POINTER_GESTURES_V1_GET_HOLD_GESTURE, -+ &zwp_pointer_gesture_hold_v1_interface, -+ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gestures_v1), 0, NULL, -+ pointer); -+ -+ return (struct zwp_pointer_gesture_hold_v1*)id; -+} -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_swipe_v1 -+ * @struct zwp_pointer_gesture_swipe_v1_listener -+ */ -+struct zwp_pointer_gesture_swipe_v1_listener { -+ /** -+ * multi-finger swipe begin -+ * -+ * This event is sent when a multi-finger swipe gesture is -+ * detected on the device. -+ * @param time timestamp with millisecond granularity -+ * @param fingers number of fingers -+ */ -+ void (*begin)( -+ void* data, -+ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1, -+ uint32_t serial, uint32_t time, struct wl_surface* surface, -+ uint32_t fingers); -+ /** -+ * multi-finger swipe motion -+ * -+ * This event is sent when a multi-finger swipe gesture changes -+ * the position of the logical center. -+ * -+ * The dx and dy coordinates are relative coordinates of the -+ * logical center of the gesture compared to the previous event. -+ * @param time timestamp with millisecond granularity -+ * @param dx delta x coordinate in surface coordinate space -+ * @param dy delta y coordinate in surface coordinate space -+ */ -+ void (*update)( -+ void* data, -+ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1, -+ uint32_t time, wl_fixed_t dx, wl_fixed_t dy); -+ /** -+ * multi-finger swipe end -+ * -+ * This event is sent when a multi-finger swipe gesture ceases to -+ * be valid. This may happen when one or more fingers are lifted or -+ * the gesture is cancelled. -+ * -+ * When a gesture is cancelled, the client should undo state -+ * changes caused by this gesture. What causes a gesture to be -+ * cancelled is implementation-dependent. -+ * @param time timestamp with millisecond granularity -+ * @param cancelled 1 if the gesture was cancelled, 0 otherwise -+ */ -+ void (*end)(void* data, -+ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1, -+ uint32_t serial, uint32_t time, int32_t cancelled); -+}; -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_swipe_v1 -+ */ -+static inline int zwp_pointer_gesture_swipe_v1_add_listener( -+ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1, -+ const struct zwp_pointer_gesture_swipe_v1_listener* listener, void* data) { -+ return wl_proxy_add_listener((struct wl_proxy*)zwp_pointer_gesture_swipe_v1, -+ (void (**)(void))listener, data); -+} -+ -+#define ZWP_POINTER_GESTURE_SWIPE_V1_DESTROY 0 -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_swipe_v1 -+ */ -+#define ZWP_POINTER_GESTURE_SWIPE_V1_BEGIN_SINCE_VERSION 1 -+/** -+ * @ingroup iface_zwp_pointer_gesture_swipe_v1 -+ */ -+#define ZWP_POINTER_GESTURE_SWIPE_V1_UPDATE_SINCE_VERSION 1 -+/** -+ * @ingroup iface_zwp_pointer_gesture_swipe_v1 -+ */ -+#define ZWP_POINTER_GESTURE_SWIPE_V1_END_SINCE_VERSION 1 -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_swipe_v1 -+ */ -+#define ZWP_POINTER_GESTURE_SWIPE_V1_DESTROY_SINCE_VERSION 1 -+ -+/** @ingroup iface_zwp_pointer_gesture_swipe_v1 */ -+static inline void zwp_pointer_gesture_swipe_v1_set_user_data( -+ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1, -+ void* user_data) { -+ wl_proxy_set_user_data((struct wl_proxy*)zwp_pointer_gesture_swipe_v1, -+ user_data); -+} -+ -+/** @ingroup iface_zwp_pointer_gesture_swipe_v1 */ -+static inline void* zwp_pointer_gesture_swipe_v1_get_user_data( -+ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1) { -+ return wl_proxy_get_user_data((struct wl_proxy*)zwp_pointer_gesture_swipe_v1); -+} -+ -+static inline uint32_t zwp_pointer_gesture_swipe_v1_get_version( -+ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1) { -+ return wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_swipe_v1); -+} -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_swipe_v1 -+ */ -+static inline void zwp_pointer_gesture_swipe_v1_destroy( -+ struct zwp_pointer_gesture_swipe_v1* zwp_pointer_gesture_swipe_v1) { -+ wl_proxy_marshal_flags( -+ (struct wl_proxy*)zwp_pointer_gesture_swipe_v1, -+ ZWP_POINTER_GESTURE_SWIPE_V1_DESTROY, NULL, -+ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_swipe_v1), -+ WL_MARSHAL_FLAG_DESTROY); -+} -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_pinch_v1 -+ * @struct zwp_pointer_gesture_pinch_v1_listener -+ */ -+struct zwp_pointer_gesture_pinch_v1_listener { -+ /** -+ * multi-finger pinch begin -+ * -+ * This event is sent when a multi-finger pinch gesture is -+ * detected on the device. -+ * @param time timestamp with millisecond granularity -+ * @param fingers number of fingers -+ */ -+ void (*begin)( -+ void* data, -+ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1, -+ uint32_t serial, uint32_t time, struct wl_surface* surface, -+ uint32_t fingers); -+ /** -+ * multi-finger pinch motion -+ * -+ * This event is sent when a multi-finger pinch gesture changes -+ * the position of the logical center, the rotation or the relative -+ * scale. -+ * -+ * The dx and dy coordinates are relative coordinates in the -+ * surface coordinate space of the logical center of the gesture. -+ * -+ * The scale factor is an absolute scale compared to the -+ * pointer_gesture_pinch.begin event, e.g. a scale of 2 means the -+ * fingers are now twice as far apart as on -+ * pointer_gesture_pinch.begin. -+ * -+ * The rotation is the relative angle in degrees clockwise compared -+ * to the previous pointer_gesture_pinch.begin or -+ * pointer_gesture_pinch.update event. -+ * @param time timestamp with millisecond granularity -+ * @param dx delta x coordinate in surface coordinate space -+ * @param dy delta y coordinate in surface coordinate space -+ * @param scale scale relative to the initial finger position -+ * @param rotation angle in degrees cw relative to the previous event -+ */ -+ void (*update)( -+ void* data, -+ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1, -+ uint32_t time, wl_fixed_t dx, wl_fixed_t dy, wl_fixed_t scale, -+ wl_fixed_t rotation); -+ /** -+ * multi-finger pinch end -+ * -+ * This event is sent when a multi-finger pinch gesture ceases to -+ * be valid. This may happen when one or more fingers are lifted or -+ * the gesture is cancelled. -+ * -+ * When a gesture is cancelled, the client should undo state -+ * changes caused by this gesture. What causes a gesture to be -+ * cancelled is implementation-dependent. -+ * @param time timestamp with millisecond granularity -+ * @param cancelled 1 if the gesture was cancelled, 0 otherwise -+ */ -+ void (*end)(void* data, -+ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1, -+ uint32_t serial, uint32_t time, int32_t cancelled); -+}; -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_pinch_v1 -+ */ -+static inline int zwp_pointer_gesture_pinch_v1_add_listener( -+ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1, -+ const struct zwp_pointer_gesture_pinch_v1_listener* listener, void* data) { -+ return wl_proxy_add_listener((struct wl_proxy*)zwp_pointer_gesture_pinch_v1, -+ (void (**)(void))listener, data); -+} -+ -+#define ZWP_POINTER_GESTURE_PINCH_V1_DESTROY 0 -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_pinch_v1 -+ */ -+#define ZWP_POINTER_GESTURE_PINCH_V1_BEGIN_SINCE_VERSION 1 -+/** -+ * @ingroup iface_zwp_pointer_gesture_pinch_v1 -+ */ -+#define ZWP_POINTER_GESTURE_PINCH_V1_UPDATE_SINCE_VERSION 1 -+/** -+ * @ingroup iface_zwp_pointer_gesture_pinch_v1 -+ */ -+#define ZWP_POINTER_GESTURE_PINCH_V1_END_SINCE_VERSION 1 -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_pinch_v1 -+ */ -+#define ZWP_POINTER_GESTURE_PINCH_V1_DESTROY_SINCE_VERSION 1 -+ -+/** @ingroup iface_zwp_pointer_gesture_pinch_v1 */ -+static inline void zwp_pointer_gesture_pinch_v1_set_user_data( -+ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1, -+ void* user_data) { -+ wl_proxy_set_user_data((struct wl_proxy*)zwp_pointer_gesture_pinch_v1, -+ user_data); -+} -+ -+/** @ingroup iface_zwp_pointer_gesture_pinch_v1 */ -+static inline void* zwp_pointer_gesture_pinch_v1_get_user_data( -+ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1) { -+ return wl_proxy_get_user_data((struct wl_proxy*)zwp_pointer_gesture_pinch_v1); -+} -+ -+static inline uint32_t zwp_pointer_gesture_pinch_v1_get_version( -+ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1) { -+ return wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_pinch_v1); -+} -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_pinch_v1 -+ */ -+static inline void zwp_pointer_gesture_pinch_v1_destroy( -+ struct zwp_pointer_gesture_pinch_v1* zwp_pointer_gesture_pinch_v1) { -+ wl_proxy_marshal_flags( -+ (struct wl_proxy*)zwp_pointer_gesture_pinch_v1, -+ ZWP_POINTER_GESTURE_PINCH_V1_DESTROY, NULL, -+ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_pinch_v1), -+ WL_MARSHAL_FLAG_DESTROY); -+} -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_hold_v1 -+ * @struct zwp_pointer_gesture_hold_v1_listener -+ */ -+struct zwp_pointer_gesture_hold_v1_listener { -+ /** -+ * multi-finger hold begin -+ * -+ * This event is sent when a hold gesture is detected on the -+ * device. -+ * @param time timestamp with millisecond granularity -+ * @param fingers number of fingers -+ * @since 3 -+ */ -+ void (*begin)(void* data, -+ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1, -+ uint32_t serial, uint32_t time, struct wl_surface* surface, -+ uint32_t fingers); -+ /** -+ * multi-finger hold end -+ * -+ * This event is sent when a hold gesture ceases to be valid. -+ * This may happen when the holding fingers are lifted or the -+ * gesture is cancelled, for example if the fingers move past an -+ * implementation-defined threshold, the finger count changes or -+ * the hold gesture changes into a different type of gesture. -+ * -+ * When a gesture is cancelled, the client may need to undo state -+ * changes caused by this gesture. What causes a gesture to be -+ * cancelled is implementation-dependent. -+ * @param time timestamp with millisecond granularity -+ * @param cancelled 1 if the gesture was cancelled, 0 otherwise -+ * @since 3 -+ */ -+ void (*end)(void* data, -+ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1, -+ uint32_t serial, uint32_t time, int32_t cancelled); -+}; -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_hold_v1 -+ */ -+static inline int zwp_pointer_gesture_hold_v1_add_listener( -+ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1, -+ const struct zwp_pointer_gesture_hold_v1_listener* listener, void* data) { -+ return wl_proxy_add_listener((struct wl_proxy*)zwp_pointer_gesture_hold_v1, -+ (void (**)(void))listener, data); -+} -+ -+#define ZWP_POINTER_GESTURE_HOLD_V1_DESTROY 0 -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_hold_v1 -+ */ -+#define ZWP_POINTER_GESTURE_HOLD_V1_BEGIN_SINCE_VERSION 3 -+/** -+ * @ingroup iface_zwp_pointer_gesture_hold_v1 -+ */ -+#define ZWP_POINTER_GESTURE_HOLD_V1_END_SINCE_VERSION 3 -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_hold_v1 -+ */ -+#define ZWP_POINTER_GESTURE_HOLD_V1_DESTROY_SINCE_VERSION 3 -+ -+/** @ingroup iface_zwp_pointer_gesture_hold_v1 */ -+static inline void zwp_pointer_gesture_hold_v1_set_user_data( -+ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1, -+ void* user_data) { -+ wl_proxy_set_user_data((struct wl_proxy*)zwp_pointer_gesture_hold_v1, -+ user_data); -+} -+ -+/** @ingroup iface_zwp_pointer_gesture_hold_v1 */ -+static inline void* zwp_pointer_gesture_hold_v1_get_user_data( -+ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1) { -+ return wl_proxy_get_user_data((struct wl_proxy*)zwp_pointer_gesture_hold_v1); -+} -+ -+static inline uint32_t zwp_pointer_gesture_hold_v1_get_version( -+ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1) { -+ return wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_hold_v1); -+} -+ -+/** -+ * @ingroup iface_zwp_pointer_gesture_hold_v1 -+ */ -+static inline void zwp_pointer_gesture_hold_v1_destroy( -+ struct zwp_pointer_gesture_hold_v1* zwp_pointer_gesture_hold_v1) { -+ wl_proxy_marshal_flags( -+ (struct wl_proxy*)zwp_pointer_gesture_hold_v1, -+ ZWP_POINTER_GESTURE_HOLD_V1_DESTROY, NULL, -+ wl_proxy_get_version((struct wl_proxy*)zwp_pointer_gesture_hold_v1), -+ WL_MARSHAL_FLAG_DESTROY); -+} -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif -diff --git a/widget/gtk/wayland/pointer-gestures-unstable-v1-protocol.c b/widget/gtk/wayland/pointer-gestures-unstable-v1-protocol.c -new file mode 100644 ---- /dev/null -+++ b/widget/gtk/wayland/pointer-gestures-unstable-v1-protocol.c -@@ -0,0 +1,112 @@ -+/* Generated by wayland-scanner 1.22.0 */ -+ -+#include -+#include -+#include "wayland-util.h" -+ -+#ifndef __has_attribute -+# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */ -+#endif -+ -+#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4) -+# define WL_PRIVATE __attribute__((visibility("hidden"))) -+#else -+# define WL_PRIVATE -+#endif -+ -+#pragma GCC visibility push(default) -+extern const struct wl_interface wl_pointer_interface; -+extern const struct wl_interface wl_surface_interface; -+#pragma GCC visibility pop -+extern const struct wl_interface zwp_pointer_gesture_hold_v1_interface; -+extern const struct wl_interface zwp_pointer_gesture_pinch_v1_interface; -+extern const struct wl_interface zwp_pointer_gesture_swipe_v1_interface; -+ -+static const struct wl_interface* pointer_gestures_unstable_v1_types[] = { -+ NULL, -+ NULL, -+ NULL, -+ NULL, -+ NULL, -+ &zwp_pointer_gesture_swipe_v1_interface, -+ &wl_pointer_interface, -+ &zwp_pointer_gesture_pinch_v1_interface, -+ &wl_pointer_interface, -+ &zwp_pointer_gesture_hold_v1_interface, -+ &wl_pointer_interface, -+ NULL, -+ NULL, -+ &wl_surface_interface, -+ NULL, -+ NULL, -+ NULL, -+ &wl_surface_interface, -+ NULL, -+ NULL, -+ NULL, -+ &wl_surface_interface, -+ NULL, -+}; -+ -+static const struct wl_message zwp_pointer_gestures_v1_requests[] = { -+ {"get_swipe_gesture", "no", pointer_gestures_unstable_v1_types + 5}, -+ {"get_pinch_gesture", "no", pointer_gestures_unstable_v1_types + 7}, -+ {"release", "2", pointer_gestures_unstable_v1_types + 0}, -+ {"get_hold_gesture", "3no", pointer_gestures_unstable_v1_types + 9}, -+}; -+ -+WL_PRIVATE const struct wl_interface zwp_pointer_gestures_v1_interface = { -+ "zwp_pointer_gestures_v1", 3, 4, zwp_pointer_gestures_v1_requests, 0, NULL, -+}; -+ -+static const struct wl_message zwp_pointer_gesture_swipe_v1_requests[] = { -+ {"destroy", "", pointer_gestures_unstable_v1_types + 0}, -+}; -+ -+static const struct wl_message zwp_pointer_gesture_swipe_v1_events[] = { -+ {"begin", "uuou", pointer_gestures_unstable_v1_types + 11}, -+ {"update", "uff", pointer_gestures_unstable_v1_types + 0}, -+ {"end", "uui", pointer_gestures_unstable_v1_types + 0}, -+}; -+ -+WL_PRIVATE const struct wl_interface zwp_pointer_gesture_swipe_v1_interface = { -+ "zwp_pointer_gesture_swipe_v1", -+ 2, -+ 1, -+ zwp_pointer_gesture_swipe_v1_requests, -+ 3, -+ zwp_pointer_gesture_swipe_v1_events, -+}; -+ -+static const struct wl_message zwp_pointer_gesture_pinch_v1_requests[] = { -+ {"destroy", "", pointer_gestures_unstable_v1_types + 0}, -+}; -+ -+static const struct wl_message zwp_pointer_gesture_pinch_v1_events[] = { -+ {"begin", "uuou", pointer_gestures_unstable_v1_types + 15}, -+ {"update", "uffff", pointer_gestures_unstable_v1_types + 0}, -+ {"end", "uui", pointer_gestures_unstable_v1_types + 0}, -+}; -+ -+WL_PRIVATE const struct wl_interface zwp_pointer_gesture_pinch_v1_interface = { -+ "zwp_pointer_gesture_pinch_v1", -+ 2, -+ 1, -+ zwp_pointer_gesture_pinch_v1_requests, -+ 3, -+ zwp_pointer_gesture_pinch_v1_events, -+}; -+ -+static const struct wl_message zwp_pointer_gesture_hold_v1_requests[] = { -+ {"destroy", "3", pointer_gestures_unstable_v1_types + 0}, -+}; -+ -+static const struct wl_message zwp_pointer_gesture_hold_v1_events[] = { -+ {"begin", "3uuou", pointer_gestures_unstable_v1_types + 19}, -+ {"end", "3uui", pointer_gestures_unstable_v1_types + 0}, -+}; -+ -+WL_PRIVATE const struct wl_interface zwp_pointer_gesture_hold_v1_interface = { -+ "zwp_pointer_gesture_hold_v1", 3, 1, -+ zwp_pointer_gesture_hold_v1_requests, 2, zwp_pointer_gesture_hold_v1_events, -+}; - diff --git a/D244990.1744916693.diff b/D244990.1744916693.diff deleted file mode 100644 index 1582cab..0000000 --- a/D244990.1744916693.diff +++ /dev/null @@ -1,153 +0,0 @@ -diff --git a/widget/gtk/WaylandVsyncSource.h b/widget/gtk/WaylandVsyncSource.h ---- a/widget/gtk/WaylandVsyncSource.h -+++ b/widget/gtk/WaylandVsyncSource.h -@@ -47,13 +47,10 @@ - explicit WaylandVsyncSource(nsWindow* aWindow); - virtual ~WaylandVsyncSource(); - - static Maybe GetFastestVsyncRate(); - -- void EnableVSyncSource(); -- void DisableVSyncSource(); -- - // Regular VSync callback. Runs for visible windows only. - // aTime = 0 means emulated frame and use current time. - void VisibleWindowCallback(uint32_t aTime = 0); - - // Idle callback for hidden windows. -@@ -67,10 +64,15 @@ - void EnableVsync() override; - void DisableVsync() override; - bool IsVsyncEnabled() override; - void Shutdown() override; - -+ // Enable/Disable this particular VSync source. Called from widget code -+ // if we know that nsWindow become visible/hidden. -+ void EnableVSyncSource(); -+ void DisableVSyncSource(); -+ - // We addref/unref this during init so we should not - // call it from constructor. - void Init(); - - private: -@@ -80,10 +82,12 @@ - TimeStamp aVsyncTimestamp); - void* GetWindowForLogging() { return mWindow; }; - - void SetHiddenWindowVSync(); - -+ void SetVSyncEventsLocked(const MutexAutoLock& aProofOfLock, bool aEnabled); -+ - Mutex mMutex; - - // Main thread only, except for logging. - RefPtr mWindow; - RefPtr mWaylandSurface MOZ_GUARDED_BY(mMutex); -diff --git a/widget/gtk/WaylandVsyncSource.cpp b/widget/gtk/WaylandVsyncSource.cpp ---- a/widget/gtk/WaylandVsyncSource.cpp -+++ b/widget/gtk/WaylandVsyncSource.cpp -@@ -139,28 +139,66 @@ - }, - this); - } - } - -+void WaylandVsyncSource::SetVSyncEventsLocked(const MutexAutoLock& aProofOfLock, -+ bool aEnabled) { -+ MOZ_DIAGNOSTIC_ASSERT(NS_IsMainThread()); -+ mMutex.AssertCurrentThreadOwns(); -+ if (aEnabled) { -+ mLastVsyncTimeStamp = TimeStamp::Now(); -+ } else { -+ MozClearHandleID(mHiddenWindowTimerID, g_source_remove); -+ } -+ mWaylandSurface->SetFrameCallbackState(aEnabled); -+} -+ -+void WaylandVsyncSource::EnableVsync() { -+ MOZ_DIAGNOSTIC_ASSERT(NS_IsMainThread()); -+ MutexAutoLock lock(mMutex); -+ LOG("WaylandVsyncSource::EnableVsync fps %f\n", GetFPS(mVsyncRate)); -+ if (mVsyncEnabled || mIsShutdown) { -+ LOG(" early quit"); -+ return; -+ } -+ mVsyncEnabled = true; -+ SetVSyncEventsLocked(lock, mVsyncEnabled && mVsyncSourceEnabled); -+} -+ -+void WaylandVsyncSource::DisableVsync() { -+ MOZ_DIAGNOSTIC_ASSERT(NS_IsMainThread()); -+ MutexAutoLock lock(mMutex); -+ LOG("WaylandVsyncSource::DisableVsync fps %f\n", GetFPS(mVsyncRate)); -+ if (!mVsyncEnabled || mIsShutdown) { -+ LOG(" early quit"); -+ return; -+ } -+ mVsyncEnabled = false; -+ SetVSyncEventsLocked(lock, mVsyncEnabled && mVsyncSourceEnabled); -+} -+ - void WaylandVsyncSource::EnableVSyncSource() { - MutexAutoLock lock(mMutex); - LOG("WaylandVsyncSource::EnableVSyncSource() WaylandSurface [%p] fps %f", - mWaylandSurface.get(), GetFPS(mVsyncRate)); - mVsyncSourceEnabled = true; - -+ MOZ_DIAGNOSTIC_ASSERT(NS_IsMainThread()); - MOZ_DIAGNOSTIC_ASSERT(mWaylandSurface); -- mWaylandSurface->SetFrameCallbackState(mVsyncEnabled && mVsyncSourceEnabled); -+ SetVSyncEventsLocked(lock, mVsyncEnabled && mVsyncSourceEnabled); - } - - void WaylandVsyncSource::DisableVSyncSource() { - MutexAutoLock lock(mMutex); - LOG("WaylandVsyncSource::DisableVSyncSource() WaylandSurface [%p]", - mWaylandSurface.get()); - mVsyncSourceEnabled = false; - -+ MOZ_DIAGNOSTIC_ASSERT(NS_IsMainThread()); - MOZ_DIAGNOSTIC_ASSERT(mWaylandSurface); -- mWaylandSurface->SetFrameCallbackState(mVsyncEnabled && mVsyncSourceEnabled); -+ SetVSyncEventsLocked(lock, mVsyncEnabled && mVsyncSourceEnabled); - } - - bool WaylandVsyncSource::HiddenWindowCallback() { - MOZ_DIAGNOSTIC_ASSERT(NS_IsMainThread()); - -@@ -299,33 +337,10 @@ - } - - LOG(" new fps %f correction %f\n", GetFPS(mVsyncRate), correction); - } - --void WaylandVsyncSource::EnableVsync() { -- MOZ_ASSERT(NS_IsMainThread()); -- MutexAutoLock lock(mMutex); -- LOG("WaylandVsyncSource::EnableVsync fps %f\n", GetFPS(mVsyncRate)); -- if (mVsyncEnabled || mIsShutdown) { -- LOG(" early quit"); -- return; -- } -- mVsyncEnabled = true; -- mWaylandSurface->SetFrameCallbackState(mVsyncEnabled && mVsyncSourceEnabled); --} -- --void WaylandVsyncSource::DisableVsync() { -- MutexAutoLock lock(mMutex); -- LOG("WaylandVsyncSource::DisableVsync fps %f\n", GetFPS(mVsyncRate)); -- if (!mVsyncEnabled || mIsShutdown) { -- LOG(" early quit"); -- return; -- } -- mVsyncEnabled = false; -- mWaylandSurface->SetFrameCallbackState(mVsyncEnabled && mVsyncSourceEnabled); --} -- - bool WaylandVsyncSource::IsVsyncEnabled() { - MutexAutoLock lock(mMutex); - return mVsyncEnabled && mWaylandSurface; - } - - diff --git a/bmo-1559213-Support-system-av1.patch b/bmo-1559213-Support-system-av1.patch deleted file mode 100644 index 1d50290..0000000 --- a/bmo-1559213-Support-system-av1.patch +++ /dev/null @@ -1,91 +0,0 @@ -diff -up firefox-122.0/config/external/moz.build.system-av1 firefox-122.0/config/external/moz.build ---- firefox-122.0/config/external/moz.build.system-av1 2024-01-18 21:41:20.000000000 +0100 -+++ firefox-122.0/config/external/moz.build 2024-01-19 18:27:03.512034790 +0100 -@@ -40,8 +40,9 @@ if not CONFIG["MOZ_SYSTEM_LIBVPX"]: - external_dirs += ["media/libvpx"] - - if CONFIG["MOZ_AV1"]: -- external_dirs += ["media/libaom"] -- external_dirs += ["media/libdav1d"] -+ if not CONFIG["MOZ_SYSTEM_AV1"]: -+ external_dirs += ["media/libaom"] -+ external_dirs += ["media/libdav1d"] - - if not CONFIG["MOZ_SYSTEM_PNG"]: - external_dirs += ["media/libpng"] -diff -up firefox-122.0/config/system-headers.mozbuild.system-av1 firefox-122.0/config/system-headers.mozbuild ---- firefox-122.0/config/system-headers.mozbuild.system-av1 2024-01-19 18:27:03.513034826 +0100 -+++ firefox-122.0/config/system-headers.mozbuild 2024-01-19 19:02:54.515493457 +0100 -@@ -1304,6 +1304,14 @@ if CONFIG["MOZ_ENABLE_LIBPROXY"]: - "proxy.h", - ] - -+if CONFIG['MOZ_SYSTEM_AV1']: -+ system_headers += [ -+ 'aom/aom_decoder.h', -+ 'aom/aomdx.h', -+ 'aom/aom_image.h', -+ 'dav1d/dav1d.h', -+ ] -+ - if CONFIG["MOZ_SYSTEM_ICU"]: - system_headers += [ - "unicode/calendar.h", -diff -up firefox-122.0/dom/media/platforms/moz.build.system-av1 firefox-122.0/dom/media/platforms/moz.build ---- firefox-122.0/dom/media/platforms/moz.build.system-av1 2024-01-18 21:41:21.000000000 +0100 -+++ firefox-122.0/dom/media/platforms/moz.build 2024-01-19 18:27:03.513034826 +0100 -@@ -81,6 +81,11 @@ if CONFIG["MOZ_AV1"]: - "agnostic/AOMDecoder.cpp", - "agnostic/DAV1DDecoder.cpp", - ] -+ if CONFIG["MOZ_SYSTEM_AV1"]: -+ CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"] -+ OS_LIBS += CONFIG["MOZ_SYSTEM_LIBAOM_LIBS"] -+ CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBDAV1D_CFLAGS"] -+ OS_LIBS += CONFIG["MOZ_SYSTEM_LIBDAV1D_LIBS"] - - if CONFIG["MOZ_OMX"]: - EXPORTS += [ -diff -up firefox-122.0/toolkit/moz.configure.system-av1 firefox-122.0/toolkit/moz.configure ---- firefox-122.0/toolkit/moz.configure.system-av1 2024-01-19 18:27:03.495034173 +0100 -+++ firefox-122.0/toolkit/moz.configure 2024-01-19 18:27:03.514034863 +0100 -@@ -743,14 +743,29 @@ def av1(value): - if value: - return True - -+option("--with-system-av1", help="Use system av1 (located with pkg-config)") - --@depends(target, when=av1 & compile_environment) -+system_libaom_info = pkg_check_modules('MOZ_SYSTEM_LIBAOM', 'aom >= 1.0.0', -+ when='--with-system-av1') -+ -+system_libdav1d_info = pkg_check_modules('MOZ_SYSTEM_LIBDAV1D', 'dav1d >= 0.1.1', -+ when='--with-system-av1') -+ -+@depends(system_libaom_info, system_libdav1d_info) -+def system_av1(system_libaom_info, system_libdav1d_info): -+ has_av1_libs = False -+ if system_libaom_info and system_libdav1d_info: -+ has_av1_libs = True -+ return has_av1_libs -+ -+ -+@depends(target, when=av1 & depends(system_av1)(lambda v: not v) & compile_environment) - def dav1d_asm(target): - if target.cpu in ("aarch64", "x86", "x86_64"): - return True - - --@depends(target, when=av1 & compile_environment) -+@depends(target, when=av1 & depends(system_av1)(lambda v: not v) & compile_environment) - def dav1d_nasm(target): - if target.cpu in ("x86", "x86_64"): - return namespace(version="2.14", what="AV1") -@@ -760,6 +775,7 @@ set_config("MOZ_DAV1D_ASM", dav1d_asm) - set_define("MOZ_DAV1D_ASM", dav1d_asm) - set_config("MOZ_AV1", av1) - set_define("MOZ_AV1", av1) -+set_config("MOZ_SYSTEM_AV1", depends_if(system_av1)(lambda _: True)) - - # JXL Image Codec Support - # ============================================================== diff --git a/bmo-1559213-fix-system-av1-libs.patch b/bmo-1559213-fix-system-av1-libs.patch deleted file mode 100644 index d687e8f..0000000 --- a/bmo-1559213-fix-system-av1-libs.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -Naur a/media/ffvpx/libavcodec/moz.build b/media/ffvpx/libavcodec/moz.build ---- a/media/ffvpx/libavcodec/moz.build 2023-08-01 09:34:20.242044722 +0300 -+++ b/media/ffvpx/libavcodec/moz.build 2023-08-01 09:36:01.445808739 +0300 -@@ -109,10 +109,14 @@ - 'vp9recon.c', - 'vpx_rac.c', - ] -- USE_LIBS += [ -- 'dav1d', -- 'media_libdav1d_asm', -- ] -+ 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', -+ ] - if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": - LOCAL_INCLUDES += ['/media/mozva'] - SOURCES += [ diff --git a/build-cacheFlush-missing.patch b/build-cacheFlush-missing.patch deleted file mode 100644 index 51c368c..0000000 --- a/build-cacheFlush-missing.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -up firefox-55.0.3/js/src/jit/ExecutableAllocator.h.wasm firefox-55.0.3/js/src/jit/ExecutableAllocator.h ---- firefox-55.0.3/js/src/jit/ExecutableAllocator.h.wasm 2017-09-05 11:32:12.235909468 +0200 -+++ firefox-55.0.3/js/src/jit/ExecutableAllocator.h 2017-09-05 11:32:46.157916575 +0200 -@@ -219,7 +219,7 @@ class ExecutableAllocator - - static void poisonCode(JSRuntime* rt, JitPoisonRangeVector& ranges); - --#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64) || defined(JS_SIMULATOR_ARM64) -+#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64) || defined(JS_SIMULATOR_ARM64) || defined(JS_CODEGEN_NONE) - static void cacheFlush(void*, size_t) - { - } -diff -up firefox-55.0.3/js/src/jit-test/tests/wasm/bench/wasm_box2d.wasm firefox-55.0.3/js/src/jit-test/tests/wasm/bench/wasm_box2d diff --git a/build-ppc-jit.patch b/build-ppc-jit.patch deleted file mode 100644 index a9dc6d1..0000000 --- a/build-ppc-jit.patch +++ /dev/null @@ -1,51 +0,0 @@ -diff -up firefox-55.0/js/src/jit/MIR.h.old firefox-55.0/js/src/jit/MIR.h ---- firefox-55.0/js/src/jit/MIR.h.old 2017-08-08 14:04:44.528460099 +0200 -+++ firefox-55.0/js/src/jit/MIR.h 2017-08-08 14:05:11.045364831 +0200 -@@ -12434,7 +12434,7 @@ class MNearbyInt - TRIVIAL_NEW_WRAPPERS - - static bool HasAssemblerSupport(RoundingMode mode) { -- return Assembler::HasRoundInstruction(mode); -+ return false; - } - - RoundingMode roundingMode() const { return roundingMode_; } -diff -up firefox-55.0/js/src/jit/ExecutableAllocator.h.old firefox-55.0/js/src/jit/ExecutableAllocator.h ---- firefox-55.0/js/src/jit/ExecutableAllocator.h.old 2017-08-09 09:24:18.784983505 +0200 -+++ firefox-55.0/js/src/jit/ExecutableAllocator.h 2017-08-09 09:28:01.471100075 +0200 -@@ -307,6 +307,10 @@ class ExecutableAllocator - { - sync_instruction_memory((caddr_t)code, size); - } -+#else -+ static void cacheFlush(void*, size_t) -+ { -+ } - #endif - - private: -diff -up firefox-55.0/js/src/wasm/WasmBuiltins.cpp.old firefox-55.0/js/src/wasm/WasmBuiltins.cpp ---- firefox-55.0/js/src/wasm/WasmBuiltins.cpp.old 2017-08-09 12:50:46.877450765 +0200 -+++ firefox-55.0/js/src/wasm/WasmBuiltins.cpp 2017-08-09 12:50:59.725406974 +0200 -@@ -881,7 +881,6 @@ wasm::EnsureBuiltinThunksInitialized() - MOZ_ASSERT(!masm.numSymbolicAccesses()); - #endif - -- ExecutableAllocator::cacheFlush(thunks->codeBase, thunks->codeSize); - if (!ExecutableAllocator::makeExecutable(thunks->codeBase, thunks->codeSize)) - return false; - -diff -up firefox-55.0/js/src/wasm/WasmCode.cpp.old firefox-55.0/js/src/wasm/WasmCode.cpp ---- firefox-55.0/js/src/wasm/WasmCode.cpp.old 2017-08-09 12:50:37.205483731 +0200 -+++ firefox-55.0/js/src/wasm/WasmCode.cpp 2017-08-09 12:51:10.365370708 +0200 -@@ -287,8 +287,6 @@ CodeSegment::initialize(Tier tier, - if (!StaticallyLink(*this, linkData)) - return false; - -- ExecutableAllocator::cacheFlush(bytes_.get(), RoundupCodeLength(codeLength)); -- - // Reprotect the whole region to avoid having separate RW and RX mappings. - if (!ExecutableAllocator::makeExecutable(bytes_.get(), RoundupCodeLength(codeLength))) - return false; -diff -up firefox-55.0/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium.old firefox-55.0/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium -diff -up firefox-55.0/media/webrtc/trunk/Makefile.old firefox-55.0/media/webrtc/trunk/Makefile diff --git a/build-rust-ppc64le.patch b/build-rust-ppc64le.patch deleted file mode 100644 index 2474c35..0000000 --- a/build-rust-ppc64le.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -up firefox-55.0/build/moz.configure/rust.configure.rust-ppc64le firefox-55.0/build/moz.configure/rust.configure ---- firefox-55.0/build/moz.configure/rust.configure.rust-ppc64le 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/build/moz.configure/rust.configure 2017-08-02 10:19:03.254220003 +0200 -@@ -151,6 +151,9 @@ def rust_triple_alias(host_or_target): - ('sparc64', 'Linux'): 'sparc64-unknown-linux-gnu', - ('x86', 'Linux'): 'i686-unknown-linux-gnu', - ('x86_64', 'Linux'): 'x86_64-unknown-linux-gnu', -+ ('ppc64le', 'Linux'): 'powerpc64le-unknown-linux-gnu', -+ ('ppc64', 'Linux'): 'powerpc64-unknown-linux-gnu', -+ ('s390x', 'Linux'): 's390x-unknown-linux-gnu', - # OS X - ('x86', 'OSX'): 'i686-apple-darwin', - ('x86_64', 'OSX'): 'x86_64-apple-darwin', -@@ -174,8 +177,10 @@ def rust_triple_alias(host_or_target): - ('sparc64', 'SunOS'): 'sparcv9-sun-solaris', - }.get((host_or_target.cpu, os_or_kernel), None) - -+ if (rustc_target == 'powerpc64-unknown-linux-gnu' and host_or_target.endianness == 'little'): -+ rustc_target = 'powerpc64le-unknown-linux-gnu' - if rustc_target is None: -- die("Don't know how to translate {} for rustc".format(host_or_target.alias)) -+ die("Don't know how to translate {} for rustc, cpu: {}, os: {}".format(target.alias, target.cpu, os_or_kernel)) - - # Check to see whether our rustc has a reasonably functional stdlib - # for our chosen target. diff --git a/fedora-shebang-build.patch b/fedora-shebang-build.patch deleted file mode 100644 index 9ade86c..0000000 --- a/fedora-shebang-build.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff -up firefox-73.0/build/unix/run-mozilla.sh.old firefox-73.0/build/unix/run-mozilla.sh ---- firefox-73.0/build/unix/run-mozilla.sh.old 2020-02-12 09:58:00.150895904 +0100 -+++ firefox-73.0/build/unix/run-mozilla.sh 2020-02-12 09:58:06.505860696 +0100 -@@ -1,4 +1,4 @@ --#!/bin/sh -+#!/usr/bin/sh - # - # This Source Code Form is subject to the terms of the Mozilla Public - # License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/firefox-glibc-dynstack.patch b/firefox-glibc-dynstack.patch deleted file mode 100644 index b0487d7..0000000 --- a/firefox-glibc-dynstack.patch +++ /dev/null @@ -1,64 +0,0 @@ -diff -ur firefox-90.0.orig/js/xpconnect/src/XPCJSContext.cpp firefox-90.0/js/xpconnect/src/XPCJSContext.cpp ---- firefox-90.0.orig/js/xpconnect/src/XPCJSContext.cpp 2021-07-05 21:16:02.000000000 +0200 -+++ firefox-90.0/js/xpconnect/src/XPCJSContext.cpp 2021-07-19 15:01:24.083460460 +0200 -@@ -85,14 +85,6 @@ - using namespace xpc; - using namespace JS; - --// The watchdog thread loop is pretty trivial, and should not require much stack --// space to do its job. So only give it 32KiB or the platform minimum. --#if !defined(PTHREAD_STACK_MIN) --# define PTHREAD_STACK_MIN 0 --#endif --static constexpr size_t kWatchdogStackSize = -- PTHREAD_STACK_MIN < 32 * 1024 ? 32 * 1024 : PTHREAD_STACK_MIN; -- - static void WatchdogMain(void* arg); - class Watchdog; - class WatchdogManager; -@@ -163,7 +155,7 @@ - // watchdog, we need to join it on shutdown. - mThread = PR_CreateThread(PR_USER_THREAD, WatchdogMain, this, - PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, -- PR_JOINABLE_THREAD, kWatchdogStackSize); -+ PR_JOINABLE_THREAD, 0); - if (!mThread) { - MOZ_CRASH("PR_CreateThread failed!"); - } -Only in firefox-90.0/js/xpconnect/src: XPCJSContext.cpp.firefox-glibc-dynstack -diff -ur firefox-90.0.orig/security/sandbox/linux/launch/SandboxLaunch.cpp firefox-90.0/security/sandbox/linux/launch/SandboxLaunch.cpp ---- firefox-90.0.orig/security/sandbox/linux/launch/SandboxLaunch.cpp 2021-07-05 18:20:36.000000000 +0200 -+++ firefox-90.0/security/sandbox/linux/launch/SandboxLaunch.cpp 2021-07-20 08:39:17.272136982 +0200 -@@ -501,8 +501,7 @@ - MOZ_NEVER_INLINE MOZ_ASAN_BLACKLIST static pid_t DoClone(int aFlags, - jmp_buf* aCtx) { - static constexpr size_t kStackAlignment = 16; -- uint8_t miniStack[PTHREAD_STACK_MIN] -- __attribute__((aligned(kStackAlignment))); -+ uint8_t miniStack[4096] __attribute__((aligned(kStackAlignment))); - #ifdef __hppa__ - void* stackPtr = miniStack; - #else -@@ -523,13 +522,19 @@ - CLONE_CHILD_CLEARTID; - MOZ_RELEASE_ASSERT((aFlags & kBadFlags) == 0); - -+ // Block signals due to small stack in DoClone. -+ sigset_t oldSigs; -+ BlockAllSignals(&oldSigs); -+ -+ int ret = 0; - jmp_buf ctx; - if (setjmp(ctx) == 0) { - // In the parent and just called setjmp: -- return DoClone(aFlags | SIGCHLD, &ctx); -+ ret = DoClone(aFlags | SIGCHLD, &ctx); - } -+ RestoreSignals(&oldSigs); - // In the child and have longjmp'ed: -- return 0; -+ return ret; - } - - static bool WriteStringToFile(const char* aPath, const char* aStr, -Only in firefox-90.0/security/sandbox/linux/launch: SandboxLaunch.cpp~ diff --git a/firefox-nss-version.patch b/firefox-nss-version.patch deleted file mode 100644 index 21985d1..0000000 --- a/firefox-nss-version.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up firefox-84.0.1/build/moz.configure/nss.configure.nss-version firefox-84.0.1/build/moz.configure/nss.configure ---- firefox-84.0.1/build/moz.configure/nss.configure.nss-version 2020-12-21 20:07:33.000000000 +0100 -+++ firefox-84.0.1/build/moz.configure/nss.configure 2020-12-22 10:23:02.156625919 +0100 -@@ -9,7 +9,7 @@ option("--with-system-nss", help="Use sy - imply_option("--with-system-nspr", True, when="--with-system-nss") - - nss_pkg = pkg_check_modules( -- "NSS", "nss >= 3.59.1", when="--with-system-nss", config=False -+ "NSS", "nss >= 3.59", when="--with-system-nss", config=False - ) - - set_config("MOZ_SYSTEM_NSS", True, when="--with-system-nss") diff --git a/firefox-testing.patch b/firefox-testing.patch deleted file mode 100644 index d380b48..0000000 --- a/firefox-testing.patch +++ /dev/null @@ -1,69 +0,0 @@ -diff -up firefox-96.0.1/docshell/base/crashtests/crashtests.list.testing firefox-96.0.1/docshell/base/crashtests/crashtests.list ---- firefox-96.0.1/docshell/base/crashtests/crashtests.list.testing 2022-01-13 20:26:02.000000000 +0100 -+++ firefox-96.0.1/docshell/base/crashtests/crashtests.list 2022-01-18 10:42:02.642971427 +0100 -@@ -13,7 +13,6 @@ load 614499-1.html - load 678872-1.html - skip-if(Android) pref(dom.disable_open_during_load,false) load 914521.html # Android bug 1584562 - pref(browser.send_pings,true) asserts(0-2) load 1257730-1.html # bug 566159 --load 1331295.html - load 1341657.html - load 1584467.html - load 1614211-1.html -diff -up firefox-96.0.1/dom/media/tests/crashtests/crashtests.list.testing firefox-96.0.1/dom/media/tests/crashtests/crashtests.list ---- firefox-96.0.1/dom/media/tests/crashtests/crashtests.list.testing 2022-01-13 20:26:03.000000000 +0100 -+++ firefox-96.0.1/dom/media/tests/crashtests/crashtests.list 2022-01-18 10:42:02.642971427 +0100 -@@ -25,7 +25,6 @@ asserts-if(Android,0-1) pref(browser.lin - load 1443212.html - asserts-if(Android,0-2) load 1453030.html - load 1468451.html --skip-if(Android) load 1490700.html # No screenshare on Android - load 1505957.html - load 1509442.html - load 1511130.html -diff -up firefox-96.0.1/testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py.testing firefox-96.0.1/testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py ---- firefox-96.0.1/testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py.testing 2022-01-13 20:26:09.000000000 +0100 -+++ firefox-96.0.1/testing/marionette/harness/marionette_harness/tests/unit/test_marionette.py 2022-01-18 10:42:02.642971427 +0100 -@@ -98,15 +98,7 @@ class TestMarionette(MarionetteTestCase) - - def test_application_update_disabled(self): - # Updates of the application should always be disabled by default -- with self.marionette.using_context("chrome"): -- update_allowed = self.marionette.execute_script( -- """ -- let aus = Cc['@mozilla.org/updates/update-service;1'] -- .getService(Ci.nsIApplicationUpdateService); -- return aus.canCheckForUpdates; -- """ -- ) -- -+ update_allowed = False - self.assertFalse(update_allowed) - - -diff -up firefox-96.0.1/testing/tools/websocketprocessbridge/websocketprocessbridge_requirements_3.txt.testing firefox-96.0.1/testing/tools/websocketprocessbridge/websocketprocessbridge_requirements_3.txt ---- firefox-96.0.1/testing/tools/websocketprocessbridge/websocketprocessbridge_requirements_3.txt.testing 2022-01-13 23:26:17.000000000 +0100 -+++ firefox-96.0.1/testing/tools/websocketprocessbridge/websocketprocessbridge_requirements_3.txt 2022-01-18 10:42:02.642971427 +0100 -@@ -1,6 +1,7 @@ - # This file is the websocketprocess requirements.txt used with python 3. - - six -+pyrsistent - vcversioner==2.16.0.0 - twisted>=18.7.0 - -diff -up firefox-96.0.1/toolkit/crashreporter/test/unit/xpcshell.ini.testing firefox-96.0.1/toolkit/crashreporter/test/unit/xpcshell.ini ---- firefox-96.0.1/toolkit/crashreporter/test/unit/xpcshell.ini.testing 2022-01-13 23:26:17.000000000 +0100 -+++ firefox-96.0.1/toolkit/crashreporter/test/unit/xpcshell.ini 2022-01-18 10:58:40.574277255 +0100 -@@ -37,7 +37,6 @@ skip-if = (os != 'win' && os != 'linux') - - [test_crash_AsyncShutdown.js] - [test_event_files.js] --[test_crash_terminator.js] - - [test_crash_backgroundtask_moz_crash.js] - skip-if = os == 'win' -@@ -123,4 +122,3 @@ head = head_crashreporter.js head_win64c - skip-if = !(os == 'win' && bits == 64 && processor == 'x86_64') - reason = Windows test specific to the x86-64 architecture - support-files = test_crash_win64cfi_not_a_pe.exe -- diff --git a/firefox-tests-reftest.patch b/firefox-tests-reftest.patch deleted file mode 100644 index 6800721..0000000 --- a/firefox-tests-reftest.patch +++ /dev/null @@ -1,514 +0,0 @@ -diff -U0 firefox-92.0/dom/canvas/test/reftest/filters/reftest.list.firefox-tests-reftest firefox-92.0/dom/canvas/test/reftest/filters/reftest.list ---- firefox-92.0/dom/canvas/test/reftest/filters/reftest.list.firefox-tests-reftest 2021-09-01 19:14:40.000000000 +0200 -+++ firefox-92.0/dom/canvas/test/reftest/filters/reftest.list 2021-09-03 18:44:02.933897050 +0200 -@@ -21 +21 @@ --== units-ex.html ref.html -+fuzzy-if(gtkWidget,0-255,0-100) == units-ex.html ref.html -diff -U0 firefox-92.0/dom/html/reftests/autofocus/reftest.list.firefox-tests-reftest firefox-92.0/dom/html/reftests/autofocus/reftest.list ---- firefox-92.0/dom/html/reftests/autofocus/reftest.list.firefox-tests-reftest 2021-09-01 19:14:40.000000000 +0200 -+++ firefox-92.0/dom/html/reftests/autofocus/reftest.list 2021-09-03 18:44:02.933897050 +0200 -@@ -7 +7 @@ --fuzzy-if(gtkWidget,0-18,0-1) needs-focus == textarea-load.html textarea-ref.html # One anti-aliased corner. -+fuzzy-if(gtkWidget,0-56,0-2) needs-focus == textarea-load.html textarea-ref.html # One anti-aliased corner. -diff -U0 firefox-92.0/dom/html/reftests/reftest.list.firefox-tests-reftest firefox-92.0/dom/html/reftests/reftest.list ---- firefox-92.0/dom/html/reftests/reftest.list.firefox-tests-reftest 2021-09-01 19:14:40.000000000 +0200 -+++ firefox-92.0/dom/html/reftests/reftest.list 2021-09-03 18:44:02.933897050 +0200 -@@ -46 +45,0 @@ --skip-if(isCoverageBuild) fuzzy(0-2,0-830) random-if(useDrawSnapshot) == bug917595-iframe-1.html bug917595-1-ref.html -diff -U0 firefox-92.0/dom/media/test/reftest/reftest.list.firefox-tests-reftest firefox-92.0/dom/media/test/reftest/reftest.list ---- firefox-92.0/dom/media/test/reftest/reftest.list.firefox-tests-reftest 2021-09-01 19:14:40.000000000 +0200 -+++ firefox-92.0/dom/media/test/reftest/reftest.list 2021-09-03 18:50:43.693907440 +0200 -@@ -0,0 +1,9 @@ -+skip-if(Android) fuzzy-if(OSX,0-80,0-76800) fuzzy-if(appleSilicon,92-92,76799-76799) fuzzy-if(winWidget,0-62,0-76799) fuzzy-if(gtkWidget&&layersGPUAccelerated,0-70,0-2032) fuzzy-if(swgl,62-69,588-76737) HTTP(..) == short.mp4.firstframe.html short.mp4.firstframe-ref.html -+skip-if(Android) fuzzy-if(OSX,0-87,0-76797) fuzzy-if(appleSilicon,83-83,76797-76797) fuzzy-if(winWidget,0-60,0-76797) fuzzy-if(gtkWidget&&layersGPUAccelerated,0-60,0-6070) fuzzy-if(swgl,52-76,1698-76545) HTTP(..) == short.mp4.lastframe.html short.mp4.lastframe-ref.html -+skip-if(Android) skip-if(cocoaWidget) skip-if(winWidget) fuzzy-if(gtkWidget&&layersGPUAccelerated,0-57,0-4282) fuzzy-if(OSX,55-80,4173-4417) fuzzy-if(swgl,54-54,3653-3653) HTTP(..) == bipbop_300_215kbps.mp4.lastframe.html bipbop_300_215kbps.mp4.lastframe-ref.html -+skip-if(Android) fuzzy-if(OSX,0-25,0-175921) fuzzy-if(appleSilicon,49-49,176063-176063) fuzzy-if(winWidget,0-71,0-179198) fuzzy-if((/^Windows\x20NT\x2010\.0/.test(http.oscpu))&&(/^aarch64-msvc/.test(xulRuntime.XPCOMABI)),0-255,0-179500) HTTP(..) == gizmo.mp4.seek.html gizmo.mp4.55thframe-ref.html -+skip-if(Android) skip-if(MinGW) skip-if((/^Windows\x20NT\x2010\.0/.test(http.oscpu))&&(/^aarch64-msvc/.test(xulRuntime.XPCOMABI))) fuzzy(0-10,0-778236) == image-10bits-rendering-video.html image-10bits-rendering-ref.html -+skip-if(Android) skip-if(MinGW) skip-if((/^Windows\x20NT\x2010\.0/.test(http.oscpu))&&(/^aarch64-msvc/.test(xulRuntime.XPCOMABI))) fuzzy(0-10,0-778536) == image-10bits-rendering-90-video.html image-10bits-rendering-90-ref.html -+skip-if(Android) fuzzy(0-27,0-573106) fuzzy-if(appleSilicon,46-46,575885-575885) == image-10bits-rendering-720-video.html image-10bits-rendering-720-ref.html -+skip-if(Android) fuzzy(0-31,0-573249) == image-10bits-rendering-720-90-video.html image-10bits-rendering-720-90-ref.html -+skip-if(Android) skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy(0-84,0-771156) fails-if(useDrawSnapshot) == uneven_frame_duration_video.html uneven_frame_duration_video-ref.html # Skip on Windows 7 as the resolution of the video is too high for test machines and will fail in the decoder. -diff -U0 firefox-92.0/dom/media/webvtt/test/reftest/reftest.list.firefox-tests-reftest firefox-92.0/dom/media/webvtt/test/reftest/reftest.list ---- firefox-92.0/dom/media/webvtt/test/reftest/reftest.list.firefox-tests-reftest 2021-09-01 19:14:41.000000000 +0200 -+++ firefox-92.0/dom/media/webvtt/test/reftest/reftest.list 2021-09-03 18:50:43.693907440 +0200 -@@ -1,2 +0,0 @@ --skip-if(Android) fuzzy-if((/^Windows\x20NT\x2010\.0/.test(http.oscpu))&&(/^aarch64-msvc/.test(xulRuntime.XPCOMABI)),0-136,0-427680) == vtt_update_display_after_removed_cue.html vtt_update_display_after_removed_cue_ref.html --skip-if(Android) fuzzy-if(winWidget,0-170,0-170) == vtt_overlapping_time.html vtt_overlapping_time-ref.html -diff -U0 firefox-92.0/gfx/layers/apz/test/reftest/reftest.list.firefox-tests-reftest firefox-92.0/gfx/layers/apz/test/reftest/reftest.list ---- firefox-92.0/gfx/layers/apz/test/reftest/reftest.list.firefox-tests-reftest 2021-09-01 19:14:41.000000000 +0200 -+++ firefox-92.0/gfx/layers/apz/test/reftest/reftest.list 2021-09-03 18:50:43.693907440 +0200 -@@ -6,6 +5,0 @@ --fuzzy-if(Android&&!swgl,0-1,0-2) fuzzy-if(Android&&swgl,3-3,4-4) fuzzy-if(webrender&>kWidget,1-8,8-32) fuzzy-if(webrender&&cocoaWidget,18-22,20-44) skip-if(!asyncPan) pref(apz.allow_zooming,true) == async-scrollbar-1-v.html async-scrollbar-1-v-ref.html --fuzzy-if(Android&&!swgl,0-4,0-5) fuzzy-if(Android&&swgl,11-11,4-4) fuzzy-if(webrender&>kWidget,1-30,4-32) fuzzy-if(webrender&&cocoaWidget,18-22,20-44) skip-if(!asyncPan) pref(apz.allow_zooming,true) == async-scrollbar-1-h.html async-scrollbar-1-h-ref.html --fuzzy-if(Android&&!swgl,0-7,0-6) fuzzy-if(Android&&swgl,11-11,8-8) fuzzy-if(webrender&>kWidget,1-2,4-20) fuzzy-if(webrender&&cocoaWidget,14-18,48-88) skip-if(!asyncPan) pref(apz.allow_zooming,true) == async-scrollbar-1-vh.html async-scrollbar-1-vh-ref.html --fuzzy-if(Android&&!swgl,0-1,0-2) fuzzy-if(Android&&swgl,3-3,4-4) fuzzy-if(webrender&>kWidget,1-8,8-32) fuzzy-if(webrender&&cocoaWidget,18-22,20-44) skip-if(!asyncPan) pref(apz.allow_zooming,true) == async-scrollbar-1-v-rtl.html async-scrollbar-1-v-rtl-ref.html --fuzzy-if(Android,0-14,0-5) fuzzy-if(webrender&>kWidget,1-30,12-32) fuzzy-if(webrender&&cocoaWidget,18-22,20-44) skip-if(!asyncPan) pref(apz.allow_zooming,true) == async-scrollbar-1-h-rtl.html async-scrollbar-1-h-rtl-ref.html --fuzzy-if(Android,0-8,0-8) fuzzy-if(webrender&>kWidget,8-14,12-32) fuzzy-if(webrender&&cocoaWidget,14-18,26-54) skip-if(!asyncPan) pref(apz.allow_zooming,true) == async-scrollbar-1-vh-rtl.html async-scrollbar-1-vh-rtl-ref.html -@@ -21 +15 @@ --# On desktop, even more fuzz is needed because thumb scaling is not exactly proportional: making the page twice as long -+# On desktop, even more fuzz is needed because thumb scaling is not exactly proportional: making the page twice as long -diff -U0 firefox-92.0/image/test/reftest/downscaling/reftest.list.firefox-tests-reftest firefox-92.0/image/test/reftest/downscaling/reftest.list ---- firefox-92.0/image/test/reftest/downscaling/reftest.list.firefox-tests-reftest 2021-09-01 19:14:47.000000000 +0200 -+++ firefox-92.0/image/test/reftest/downscaling/reftest.list 2021-09-03 18:50:44.863939657 +0200 -@@ -91,0 +92,4 @@ -+fuzzy(0-17,0-3940) fuzzy-if(gtkWidget&&!webrender,4-4,2616-2616) fuzzy-if(gtkWidget&&!webrender&&!layersGPUAccelerated,0-0,0-0) fuzzy-if(gtkWidget&&webrender,0-0,0-0) skip-if(Android) == downscale-moz-icon-1.html downscale-moz-icon-1-ref.html # gtkWidget Bug 1592059: regular is 2616, no-accel is 0, qr passes with 0 -+ -+# Skip on Android because it runs reftests via http, and moz-icon isn't -+# accessible from http/https origins anymore. -@@ -172,0 +177,5 @@ -+ -+# Skip on WinXP with skia content -+# Skip on Android because it runs reftests via http, and moz-icon isn't -+# accessible from http/https origins anymore. -+fuzzy(0-53,0-6391) fuzzy-if(appleSilicon,20-20,11605-11605) fuzzy-if(gtkWidget&&webrender,18-19,5502-5568) fails-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) skip-if(Android) == downscale-moz-icon-1.html downscale-moz-icon-1-ref.html # gtkWidget Bug 1592059 -diff -U0 firefox-92.0/layout/reftests/abs-pos/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/abs-pos/reftest.list ---- firefox-92.0/layout/reftests/abs-pos/reftest.list.firefox-tests-reftest 2021-09-01 19:15:00.000000000 +0200 -+++ firefox-92.0/layout/reftests/abs-pos/reftest.list 2021-09-03 18:50:44.863939657 +0200 -@@ -54 +54 @@ --fuzzy-if(gtkWidget,0-1,0-1) fuzzy-if(Android,0-9,0-185) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-140,0-144) == scrollframe-2.html scrollframe-2-ref.html #bug 756530 -+fuzzy-if(gtkWidget,0-100,0-160) fuzzy-if(Android,0-9,0-185) == scrollframe-2.html scrollframe-2-ref.html #bug 756530 -diff -U0 firefox-92.0/layout/reftests/async-scrolling/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/async-scrolling/reftest.list ---- firefox-92.0/layout/reftests/async-scrolling/reftest.list.firefox-tests-reftest 2021-09-01 19:15:01.000000000 +0200 -+++ firefox-92.0/layout/reftests/async-scrolling/reftest.list 2021-09-03 18:50:44.863939657 +0200 -@@ -27 +27 @@ --fuzzy-if(Android,0-8,0-4) fuzzy-if(webrender&>kWidget,20-33,14-32) fuzzy-if(webrender&&cocoaWidget,9-21,20-44) skip-if(!asyncPan) == position-fixed-transformed-1.html position-fixed-transformed-1-ref.html # Bug 1604338 -+fuzzy-if(Android,0-8,0-4) fuzzy-if(webrender&>kWidget,30-50,30-50) fuzzy-if(webrender&&cocoaWidget,21-21,44-44) skip-if(!asyncPan) == position-fixed-transformed-1.html position-fixed-transformed-1-ref.html # Bug 1604338 -@@ -52,2 +51,0 @@ --fuzzy-if(Android,0-6,0-4) fuzzy-if(skiaContent&&!Android,0-1,0-34) fuzzy-if(webrender&>kWidget,22-74,20-32) fuzzy-if(webrender&&cocoaWidget,6-7,18-39) fuzzy-if(swgl&&cocoaWidget&&isDebugBuild,0-7,0-39) skip-if(!asyncPan) == offscreen-clipped-blendmode-1.html offscreen-clipped-blendmode-ref.html # Bug 1604338 --fuzzy-if(Android,0-6,0-4) fuzzy-if(webrender&>kWidget,22-74,20-32) fuzzy-if(webrender&&cocoaWidget,6-7,18-39) fuzzy-if(swgl&&cocoaWidget&&isDebugBuild,0-7,0-39) skip-if(!asyncPan) == offscreen-clipped-blendmode-2.html offscreen-clipped-blendmode-ref.html # Bug 1604338 -@@ -55,2 +52,0 @@ --fuzzy-if(Android,0-6,0-4) fuzzy-if(webrender&>kWidget,22-74,20-32) fuzzy-if(webrender&&cocoaWidget,6-7,18-39) fuzzy-if(swgl&&cocoaWidget&&isDebugBuild,0-7,0-39) skip-if(!asyncPan) == offscreen-clipped-blendmode-4.html offscreen-clipped-blendmode-ref.html # Bug 1604338 --fuzzy-if(Android,0-7,0-1680) fuzzy-if(webrender&>kWidget,1-1,2-20) fuzzy-if(webrender&&cocoaWidget,1-2,10-18) fuzzy-if(swgl&&cocoaWidget&&isDebugBuild,0-2,0-18) skip-if(!asyncPan) == perspective-scrolling-1.html perspective-scrolling-1-ref.html # Bug 1604338 -@@ -58,2 +54,2 @@ --fuzzy-if(Android,0-19,0-4) fuzzy-if(webrender&>kWidget,8-13,12-32) fuzzy-if(webrender&&cocoaWidget,10-13,20-44) skip-if(!asyncPan) == perspective-scrolling-3.html perspective-scrolling-3-ref.html # Bug 1604338 --fuzzy-if(Android,0-7,0-4) fuzzy-if(webrender&>kWidget,18-30,14-32) fuzzy-if(webrender&&cocoaWidget,16-20,20-44) skip-if(!asyncPan) == perspective-scrolling-4.html perspective-scrolling-4-ref.html # Bug 1604338 -+fuzzy-if(Android,0-19,0-4) fuzzy-if(webrender&>kWidget,0-50,0-50) fuzzy-if(webrender&&cocoaWidget,13-13,44-44) skip-if(!asyncPan) == perspective-scrolling-3.html perspective-scrolling-3-ref.html # Bug 1604338 -+fuzzy-if(Android,0-7,0-4) fuzzy-if(webrender&>kWidget,0-50,0-50) fuzzy-if(webrender&&cocoaWidget,19-20,44-44) skip-if(!asyncPan) == perspective-scrolling-4.html perspective-scrolling-4-ref.html # Bug 1604338 -@@ -65,4 +60,0 @@ --fuzzy-if(Android,0-19,0-4) fuzzy-if(webrender&>kWidget,12-19,12-32) fuzzy-if(webrender&&cocoaWidget,17-21,20-44) skip-if(!asyncPan) == fixed-pos-scrolled-clip-1.html fixed-pos-scrolled-clip-1-ref.html # Bug 1604338 --fuzzy-if(Android,0-44,0-10) fuzzy-if(Android&&webrender&&swgl,0-44,0-126) fuzzy-if(webrender&>kWidget,16-26,26-64) fuzzy-if(webrender&&cocoaWidget,10-13,38-82) fuzzy-if(winWidget&&!nativeThemePref,0-4,0-36) skip-if(!asyncPan) == fixed-pos-scrolled-clip-2.html fixed-pos-scrolled-clip-2-ref.html # Bug 1604338 --fuzzy-if(Android,0-6,0-8) fuzzy-if(webrender&>kWidget,17-28,24-60) fuzzy-if(webrender&&cocoaWidget,15-19,40-75) skip-if(!asyncPan) == fixed-pos-scrolled-clip-3.html fixed-pos-scrolled-clip-3-ref.html # Bug 1604338 --fuzzy-if(Android,0-6,0-8) fuzzy-if(webrender&>kWidget,17-29,24-60) fuzzy-if(webrender&&cocoaWidget,15-19,40-75) skip-if(!asyncPan) == fixed-pos-scrolled-clip-4.html fixed-pos-scrolled-clip-4-ref.html # Bug 1604338 -@@ -71 +63 @@ --fuzzy-if(Android,0-8,0-4) fuzzy-if(webrender&>kWidget,16-25,12-32) fuzzy-if(webrender&&cocoaWidget,13-16,20-44) skip-if(!asyncPan) == position-sticky-scrolled-clip-1.html position-sticky-scrolled-clip-1-ref.html # Bug 1604338 -+fuzzy-if(Android,0-8,0-4) fuzzy-if(webrender&>kWidget,22-30,28-50) fuzzy-if(webrender&&cocoaWidget,16-16,44-44) skip-if(!asyncPan) == position-sticky-scrolled-clip-1.html position-sticky-scrolled-clip-1-ref.html # Bug 1604338 -@@ -73,6 +64,0 @@ --fuzzy-if(Android,0-8,0-27) fuzzy-if(webrender&&cocoaWidget,9-11,20-44) skip-if(!asyncPan) == curtain-effect-1.html curtain-effect-1-ref.html --fuzzy-if(Android,0-7,0-4) fuzzy-if(webrender&>kWidget,10-15,12-32) fuzzy-if(webrender&&cocoaWidget,5-9,20-42) skip-if(!asyncPan) == transformed-1.html transformed-1-ref.html # Bug 1604338 --fuzzy-if(Android&&!webrender,2-6,4-4) fuzzy-if(Android&&webrender,6-7,4-4) fuzzy-if(webrender&>kWidget,3-5,12-28) fuzzy-if(webrender&&cocoaWidget,5-6,18-38) skip-if(!asyncPan) fuzzy-if(swgl&&cocoaWidget&&isDebugBuild,0-6,0-38) == position-sticky-transformed-in-scrollframe-1.html position-sticky-transformed-in-scrollframe-1-ref.html # Bug 1604338 --fuzzy-if(Android&&!webrender,3-3,4-4) fuzzy-if(Android&&webrender,10-10,4-449) fuzzy-if(webrender&>kWidget,13-20,12-32) fuzzy-if(webrender&&cocoaWidget,12-16,20-44) skip-if(!asyncPan) == position-sticky-transformed-in-scrollframe-2.html position-sticky-transformed-in-scrollframe-2-ref.html # Bug 1604338 --fuzzy-if(Android&&!webrender,3-3,4-4) fuzzy-if(Android&&webrender,12-13,4-24) fuzzy-if(webrender&>kWidget,16-27,14-32) fuzzy-if(webrender&&cocoaWidget,13-16,20-44) skip-if(!asyncPan) == position-sticky-in-transformed-scrollframe-1.html position-sticky-in-transformed-scrollframe-ref.html # Bug 1604338 --fuzzy-if(Android&&!webrender,3-3,4-4) fuzzy-if(Android&&webrender,12-13,4-24) fuzzy-if(webrender&>kWidget,16-27,14-32) fuzzy-if(webrender&&cocoaWidget,13-16,20-44) skip-if(!asyncPan) == position-sticky-in-transformed-scrollframe-2.html position-sticky-in-transformed-scrollframe-ref.html # Bug 1604338 -diff -U0 firefox-92.0/layout/reftests/bidi/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/bidi/reftest.list ---- firefox-92.0/layout/reftests/bidi/reftest.list.firefox-tests-reftest 2021-09-01 19:15:00.000000000 +0200 -+++ firefox-92.0/layout/reftests/bidi/reftest.list 2021-09-03 18:50:44.863939657 +0200 -@@ -3 +3 @@ --fuzzy-if(cocoaWidget,0-1,0-1) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == bdi-element.html bdi-element-ref.html # Bug 1392106 -+fuzzy(0-1,0-1) fuzzy-if(cocoaWidget,0-1,0-1) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == bdi-element.html bdi-element-ref.html # Bug 1392106 -@@ -33,2 +33,2 @@ --fuzzy-if(Android,0-1,0-6) fuzzy-if(cocoaWidget,0-1,0-2) == mixedChartype-02.html mixedChartype-02-ref.html --fuzzy-if(Android,0-1,0-6) fuzzy-if(cocoaWidget,0-1,0-2) == mixedChartype-02-j.html mixedChartype-02-ref.html -+fuzzy-if(gtkWidget,0-1,0-3) fuzzy-if(Android,0-1,0-6) fuzzy-if(cocoaWidget,0-1,0-2) == mixedChartype-02.html mixedChartype-02-ref.html -+fuzzy-if(gtkWidget,0-1,0-3) fuzzy-if(Android,0-1,0-6) fuzzy-if(cocoaWidget,0-1,0-2) == mixedChartype-02-j.html mixedChartype-02-ref.html -@@ -163,8 +163,8 @@ --fuzzy-if(cocoaWidget,0-1,0-4) fuzzy-if(Android,0-1,0-6) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-2a-ltr.html brackets-2a-ltr-ref.html # Bug 1392106 --fuzzy-if(cocoaWidget,0-1,0-2) fuzzy-if(Android,0-254,0-557) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-2a-rtl.html brackets-2a-rtl-ref.html # Bug 1392106 --fuzzy-if(cocoaWidget,0-1,0-6) fuzzy-if(Android,0-1,0-8) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-2b-ltr.html brackets-2b-ltr-ref.html # Bug 1392106 --fuzzy-if(cocoaWidget,0-1,0-7) fuzzy-if(Android,0-1,0-6) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-2b-rtl.html brackets-2b-rtl-ref.html # Bug 1392106 --fuzzy-if(cocoaWidget,0-1,0-7) fuzzy-if(Android,0-1,0-6) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-2c-ltr.html brackets-2c-ltr-ref.html # Bug 1392106 --fuzzy-if(cocoaWidget,0-1,0-6) fuzzy-if(Android,0-254,0-231) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-2c-rtl.html brackets-2c-rtl-ref.html # Bug 1392106 --fuzzy-if(cocoaWidget,0-1,0-6) fuzzy-if(Android,0-1,0-8) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-3a-ltr.html brackets-3a-ltr-ref.html # Bug 1392106 --fuzzy-if(cocoaWidget,0-1,0-3) fuzzy-if(Android,0-1,0-6) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-3a-rtl.html brackets-3a-rtl-ref.html # Bug 1392106 -+fuzzy(0-1,0-6) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-2a-ltr.html brackets-2a-ltr-ref.html # Bug 1392106 -+fuzzy(0-64,0-140) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-2a-rtl.html brackets-2a-rtl-ref.html # Bug 1392106 -+fuzzy(0-1,0-8) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-2b-ltr.html brackets-2b-ltr-ref.html # Bug 1392106 -+fuzzy(0-1,0-6) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-2b-rtl.html brackets-2b-rtl-ref.html # Bug 1392106 -+fuzzy(0-1,0-6) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-2c-ltr.html brackets-2c-ltr-ref.html # Bug 1392106 -+fuzzy(0-254,0-231) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-2c-rtl.html brackets-2c-rtl-ref.html # Bug 1392106 -+fuzzy(0-1,0-8) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-3a-ltr.html brackets-3a-ltr-ref.html # Bug 1392106 -+fuzzy(0-1,0-6) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == brackets-3a-rtl.html brackets-3a-rtl-ref.html # Bug 1392106 -diff -U0 firefox-92.0/layout/reftests/border-radius/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/border-radius/reftest.list ---- firefox-92.0/layout/reftests/border-radius/reftest.list.firefox-tests-reftest 2021-09-01 19:15:01.000000000 +0200 -+++ firefox-92.0/layout/reftests/border-radius/reftest.list 2021-09-03 18:50:44.863939657 +0200 -@@ -54 +54 @@ --fuzzy-if(Android,0-8,0-469) fuzzy-if(skiaContent,0-21,0-76) fuzzy-if(winWidget,0-144,0-335) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == clipping-6.html clipping-6-ref.html # PaintedLayer and MaskLayer with transforms that aren't identical, bug 1392106 -+fuzzy-if(gtkWidget,0-80,0-300) fuzzy-if(Android,0-8,0-469) fuzzy-if(winWidget,0-144,0-335) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == clipping-6.html clipping-6-ref.html # PaintedLayer and MaskLayer with transforms that aren't identical, bug 1392106 -diff -U0 firefox-92.0/layout/reftests/bugs/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/bugs/reftest.list ---- firefox-92.0/layout/reftests/bugs/reftest.list.firefox-tests-reftest 2021-09-01 19:15:00.000000000 +0200 -+++ firefox-92.0/layout/reftests/bugs/reftest.list 2021-09-03 18:50:44.864939685 +0200 -@@ -464 +463,0 @@ --== 341043-1a.html 341043-1-ref.html -@@ -553 +552 @@ --== 363706-1.html 363706-1-ref.html -+fuzzy-if(gtkWidget,255-255,0-100) == 363706-1.html 363706-1-ref.html -@@ -672 +671 @@ --== 376532-1.html 376532-1-ref.html -+fuzzy-if(gtkWidget,0-150,0-50) == 376532-1.html 376532-1-ref.html -@@ -763 +762 @@ --== 389074-1.html 389074-1-ref.html -+fuzzy-if(gtkWidget,0-150,0-80) == 389074-1.html 389074-1-ref.html -@@ -926 +925 @@ --random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == 411059-1.html 411059-1-ref.html # Bug 1392106 -+fuzzy-if(gtkWidget,0-255,0-6312) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == 411059-1.html 411059-1-ref.html # Bug 1392106 -@@ -1000 +999 @@ --== 422394-1.html 422394-1-ref.html -+fuzzy-if(gtkWidget,0-255,0-640) == 422394-1.html 422394-1-ref.html -@@ -1172 +1171 @@ --fails-if(Android||cocoaWidget||winWidget) == chrome://reftest/content/bugs/456147.xhtml 456147-ref.html # bug 458047 -+fuzzy-if(gtkWidget,0-255,0-5167) fails-if(Android||cocoaWidget||winWidget) == chrome://reftest/content/bugs/456147.xhtml 456147-ref.html # bug 458047 -@@ -1820 +1819 @@ --== 1062108-1.html 1062108-1-ref.html -+fuzzy-if(gtkWidget,0-255,0-53) == 1062108-1.html 1062108-1-ref.html -@@ -2022 +2020,0 @@ --!= 1404057.html 1404057-noref.html -@@ -2062,2 +2059,0 @@ --fuzzy-if(!webrender,1-5,66-547) fuzzy-if(geckoview&&!webrender,1-2,64-141) fuzzy-if(winWidget&&swgl,1-1,12-16) fuzzy-if(cocoaWidget&&swgl,1-1,32-32) fuzzy-if(useDrawSnapshot&&webrender,3-3,459-459) == 1529992-1.html 1529992-1-ref.html --fuzzy-if(!webrender,0-6,0-34) fuzzy-if(Android,9-14,44-60) fails-if(!useDrawSnapshot&&webrender) == 1529992-2.html 1529992-2-ref.html -@@ -2066 +2062 @@ --skip-if(!asyncPan) == 1544895.html 1544895-ref.html -+fuzzy-if(gtkWidget,0-252,0-24) skip-if(!asyncPan) == 1544895.html 1544895-ref.html -@@ -2079 +2075 @@ --fuzzy-if(winWidget&&webrender,0-31,0-3) fuzzy-if(geckoview&&webrender,0-93,0-87) == 1562733-rotated-nastaliq-2.html 1562733-rotated-nastaliq-2-ref.html -+fuzzy(0-30,0-2) fuzzy-if(winWidget&&webrender,0-31,0-3) fuzzy-if(geckoview&&webrender,0-93,0-87) == 1562733-rotated-nastaliq-2.html 1562733-rotated-nastaliq-2-ref.html -diff -U0 firefox-92.0/layout/reftests/canvas/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/canvas/reftest.list ---- firefox-92.0/layout/reftests/canvas/reftest.list.firefox-tests-reftest 2021-09-01 19:15:00.000000000 +0200 -+++ firefox-92.0/layout/reftests/canvas/reftest.list 2021-09-03 18:50:44.864939685 +0200 -@@ -51,2 +50,0 @@ --!= text-font-lang.html text-font-lang-notref.html -- -@@ -54 +52 @@ --random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == text-small-caps-1.html text-small-caps-1-ref.html # Bug 1392106 -+fuzzy-if(gtkWidget,0-255,0-2304) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == text-small-caps-1.html text-small-caps-1-ref.html # Bug 1392106 -diff -U0 firefox-92.0/layout/reftests/css-break/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/css-break/reftest.list ---- firefox-92.0/layout/reftests/css-break/reftest.list.firefox-tests-reftest 2021-09-03 18:50:44.864939685 +0200 -+++ firefox-92.0/layout/reftests/css-break/reftest.list 2021-09-03 18:51:55.862894766 +0200 -@@ -1,3 +0,0 @@ --== box-decoration-break-1.html box-decoration-break-1-ref.html --fuzzy(0-1,0-20) fuzzy-if(skiaContent,0-1,0-700) == box-decoration-break-with-inset-box-shadow-1.html box-decoration-break-with-inset-box-shadow-1-ref.html --fuzzy(0-45,0-460) fuzzy-if(skiaContent,0-64,0-484) fuzzy-if(Android,0-70,0-1330) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == box-decoration-break-with-outset-box-shadow-1.html box-decoration-break-with-outset-box-shadow-1-ref.html # Bug 1386543, bug 1392106 -diff -U0 firefox-92.0/layout/reftests/css-placeholder/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/css-placeholder/reftest.list ---- firefox-92.0/layout/reftests/css-placeholder/reftest.list.firefox-tests-reftest 2021-09-01 19:15:00.000000000 +0200 -+++ firefox-92.0/layout/reftests/css-placeholder/reftest.list 2021-09-03 18:50:44.864939685 +0200 -@@ -5 +5 @@ --fuzzy-if(gtkWidget&&nativeThemePref,255-255,1376-1881) == css-simple-styling.html css-simple-styling-ref.html # gtkWidget, Bug 1600749 -+fuzzy-if(gtkWidget&&nativeThemePref,255-255,1300-1881) == css-simple-styling.html css-simple-styling-ref.html # gtkWidget, Bug 1600749 -diff -U0 firefox-92.0/layout/reftests/css-ruby/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/css-ruby/reftest.list ---- firefox-92.0/layout/reftests/css-ruby/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/css-ruby/reftest.list 2021-09-03 18:50:44.865939713 +0200 -@@ -17,4 +17,4 @@ --== relative-positioning-2.html relative-positioning-2-ref.html --== ruby-position-horizontal.html ruby-position-horizontal-ref.html --== ruby-position-vertical-lr.html ruby-position-vertical-lr-ref.html --== ruby-position-vertical-rl.html ruby-position-vertical-rl-ref.html -+fuzzy-if(gtkWidget,0-255,0-669) == relative-positioning-2.html relative-positioning-2-ref.html -+fuzzy-if(gtkWidget,0-255,0-947) == ruby-position-horizontal.html ruby-position-horizontal-ref.html -+fuzzy-if(gtkWidget,0-255,0-1079) == ruby-position-vertical-lr.html ruby-position-vertical-lr-ref.html -+fuzzy-if(gtkWidget,0-255,0-1079) == ruby-position-vertical-rl.html ruby-position-vertical-rl-ref.html -@@ -26 +26 @@ --pref(layout.css.ruby.intercharacter.enabled,true) fuzzy-if(Android,0-198,0-70) == ruby-intercharacter-1.htm ruby-intercharacter-1-ref.htm -+fuzzy-if(gtkWidget,0-240,0-61) pref(layout.css.ruby.intercharacter.enabled,true) fuzzy-if(Android,0-198,0-70) == ruby-intercharacter-1.htm ruby-intercharacter-1-ref.htm -@@ -28 +28 @@ --pref(layout.css.ruby.intercharacter.enabled,true) == ruby-intercharacter-2.htm ruby-intercharacter-2-ref.htm -+fuzzy-if(gtkWidget,0-255,0-219) pref(layout.css.ruby.intercharacter.enabled,true) == ruby-intercharacter-2.htm ruby-intercharacter-2-ref.htm -diff -U0 firefox-92.0/layout/reftests/first-letter/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/first-letter/reftest.list ---- firefox-92.0/layout/reftests/first-letter/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/first-letter/reftest.list 2021-09-03 18:50:44.865939713 +0200 -@@ -64 +64 @@ --fails-if(winWidget||cocoaWidget) fails-if(geckoview) == 617869-1.html 617869-1-ref.html # Bug 1558513 for GV -+fuzzy-if(gtkWidget,0-260,0-900) fails-if(winWidget||cocoaWidget) fails-if(geckoview) == 617869-1.html 617869-1-ref.html # Bug 1558513 for GV -diff -U0 firefox-92.0/layout/reftests/font-face/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/font-face/reftest.list ---- firefox-92.0/layout/reftests/font-face/reftest.list.firefox-tests-reftest 2021-09-01 19:15:01.000000000 +0200 -+++ firefox-92.0/layout/reftests/font-face/reftest.list 2021-09-03 18:50:44.865939713 +0200 -@@ -9 +9 @@ --== name-override-simple-1.html name-override-simple-1-ref.html -+fuzzy-if(gtkWidget,0-112,0-107) == name-override-simple-1.html name-override-simple-1-ref.html -@@ -26,3 +26,2 @@ --random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(Android) == src-list-local-full.html src-list-local-full-ref.html # Bug 1392106 --random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(Android) == src-list-local-full-quotes.html src-list-local-full-ref.html # Bug 1392106 --== src-list-local-fallback.html src-list-local-fallback-ref.html -+fuzzy(0-255,0-6200) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(Android) == src-list-local-full.html src-list-local-full-ref.html # Bug 1392106 -+fuzzy(0-255,0-6200) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fails-if(Android) == src-list-local-full-quotes.html src-list-local-full-ref.html # Bug 1392106 -@@ -57 +56 @@ --== cross-iframe-1.html cross-iframe-1-ref.html -+fuzzy-if(gtkWidget,0-112,0-107) == cross-iframe-1.html cross-iframe-1-ref.html -@@ -81 +80 @@ --== sheet-set-switch-1.html sheet-set-switch-1-ref.html -+fuzzy-if(gtkWidget,0-112,0-108) random-if(cocoaWidget) == sheet-set-switch-1.html sheet-set-switch-1-ref.html # bug 468217 -@@ -93 +92 @@ --random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == local-1.html local-1-ref.html # Bug 1392106 -+fuzzy-if(gtkWidget,0-255,0-7000) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == local-1.html local-1-ref.html # Bug 1392106 -@@ -171,2 +170,2 @@ --HTTP(..) == reflow-sanity-1.html reflow-sanity-1-ref.html --HTTP(..) == reflow-sanity-1-data.html reflow-sanity-1-ref.html -+fuzzy-if(gtkWidget,0-104,0-406) HTTP(..) == reflow-sanity-1.html reflow-sanity-1-ref.html -+fuzzy-if(gtkWidget,0-104,0-406) HTTP(..) == reflow-sanity-1-data.html reflow-sanity-1-ref.html -@@ -174,4 +173,4 @@ --HTTP(..) == reflow-sanity-delay-1a.html reflow-sanity-1-ref.html --HTTP(..) == reflow-sanity-delay-1b.html reflow-sanity-1-ref.html --HTTP(..) == reflow-sanity-delay-1c.html reflow-sanity-1-ref.html --HTTP(..) == reflow-sanity-delay-1-metrics.html reflow-sanity-1-ref.html -+fuzzy-if(gtkWidget,0-104,0-406) HTTP(..) == reflow-sanity-delay-1a.html reflow-sanity-1-ref.html -+fuzzy-if(gtkWidget,0-104,0-406) HTTP(..) == reflow-sanity-delay-1b.html reflow-sanity-1-ref.html -+fuzzy-if(gtkWidget,0-104,0-406) HTTP(..) == reflow-sanity-delay-1c.html reflow-sanity-1-ref.html -+fuzzy-if(gtkWidget,0-104,0-406) HTTP(..) == reflow-sanity-delay-1-metrics.html reflow-sanity-1-ref.html -@@ -204 +203 @@ --# Currently Windows 7 and macOS all fail on -+# Currently Windows 7 and macOS all fail on -diff -U0 firefox-92.0/layout/reftests/font-matching/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/font-matching/reftest.list ---- firefox-92.0/layout/reftests/font-matching/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/font-matching/reftest.list 2021-09-03 18:50:44.865939713 +0200 -@@ -124 +124 @@ --random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == italic-oblique-2.html italic-oblique-ref.html # Bug 1392106 -+fuzzy-if(gtkWidget,0-104,0-1836) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == italic-oblique-2.html italic-oblique-ref.html # Bug 1392106 -@@ -128 +128 @@ --random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == italic-oblique-6.html italic-oblique-ref.html # Bug 1392106 -+fuzzy-if(gtkWidget,0-104,0-1836) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == italic-oblique-6.html italic-oblique-ref.html # Bug 1392106 -@@ -130,2 +130,2 @@ --random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == italic-oblique-8.html italic-oblique-ref.html # Bug 1392106 --random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == italic-oblique-9.html italic-oblique-ref.html # Bug 1392106 -+fuzzy-if(gtkWidget,0-104,0-1836) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == italic-oblique-8.html italic-oblique-ref.html # Bug 1392106 -+fuzzy-if(gtkWidget,0-104,0-1836) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == italic-oblique-9.html italic-oblique-ref.html # Bug 1392106 -diff -U0 firefox-92.0/layout/reftests/forms/fieldset/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/forms/fieldset/reftest.list ---- firefox-92.0/layout/reftests/forms/fieldset/reftest.list.firefox-tests-reftest 2021-09-01 19:15:01.000000000 +0200 -+++ firefox-92.0/layout/reftests/forms/fieldset/reftest.list 2021-09-03 18:50:44.865939713 +0200 -@@ -8 +7,0 @@ --fuzzy-if(!layersGPUAccelerated,0-142,0-276) == positioned-container-1.html positioned-container-1-ref.html -diff -U0 firefox-92.0/layout/reftests/forms/input/checkbox/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/forms/input/checkbox/reftest.list ---- firefox-92.0/layout/reftests/forms/input/checkbox/reftest.list.firefox-tests-reftest 2021-09-01 19:15:01.000000000 +0200 -+++ firefox-92.0/layout/reftests/forms/input/checkbox/reftest.list 2021-09-03 18:50:44.865939713 +0200 -@@ -18 +18 @@ --skip-if((OSX||winWidget)&&nativeThemePref) fuzzy-if(gtkWidget&&nativeThemePref,25-25,32-32) fails-if(Android&&nativeThemePref) == checkbox-clamp-02.html checkbox-clamp-02-ref.html -+skip-if(OSX||winWidget) fails-if(geckoview&&webrender) fuzzy-if(gtkWidget&&nativeThemePref,12-25,25-32) fails-if(Android) == checkbox-clamp-02.html checkbox-clamp-02-ref.html -diff -U0 firefox-92.0/layout/reftests/forms/input/radio/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/forms/input/radio/reftest.list ---- firefox-92.0/layout/reftests/forms/input/radio/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/forms/input/radio/reftest.list 2021-09-03 18:50:44.865939713 +0200 -@@ -9 +9 @@ --skip-if(OSX||winWidget||Android) fuzzy-if(gtkWidget&&nativeThemePref,24-24,16-16) == radio-clamp-02.html radio-clamp-02-ref.html # gtkWidget, Bug 1599622 -+skip-if(OSX||winWidget||Android) fuzzy-if(gtkWidget&&nativeThemePref,10-24,16-16) == radio-clamp-02.html radio-clamp-02-ref.html # gtkWidget, Bug 1599622 -diff -U0 firefox-92.0/layout/reftests/forms/placeholder/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/forms/placeholder/reftest.list ---- firefox-92.0/layout/reftests/forms/placeholder/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/forms/placeholder/reftest.list 2021-09-03 18:50:44.866939741 +0200 -@@ -21 +21 @@ --fuzzy-if(winWidget,0-160,0-10) fuzzy-if(Android,0-160,0-41) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-146,0-317) fuzzy-if(OSX==1010&&browserIsRemote,0-1,0-8) == placeholder-6.html placeholder-overflow-ref.html -+fuzzy-if(gtkWidget,0-255,0-341) fuzzy-if(winWidget,0-160,0-10) fuzzy-if(Android,0-160,0-41) fuzzy-if(OSX==1010&&browserIsRemote,0-1,0-8) == placeholder-6.html placeholder-overflow-ref.html -diff -U0 firefox-92.0/layout/reftests/forms/textbox/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/forms/textbox/reftest.list ---- firefox-92.0/layout/reftests/forms/textbox/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/forms/textbox/reftest.list 2021-09-03 18:50:44.866939741 +0200 -@@ -4 +3,0 @@ --fuzzy-if(winWidget,0-1,0-3) skip-if(cocoaWidget||Android) fails-if(!useDrawSnapshot&&webrender) == chrome://reftest/content/forms/textbox/accesskey-2.xhtml chrome://reftest/content/forms/textbox/accesskey-2-ref.xhtml -@@ -8 +6,0 @@ --fuzzy-if(winWidget,0-1,0-3) skip-if(cocoaWidget||Android) fails-if(!useDrawSnapshot&&webrender&&!Android) == chrome://reftest/content/forms/textbox/accesskey-4.xhtml chrome://reftest/content/forms/textbox/accesskey-4-ref.xhtml -diff -U0 firefox-92.0/layout/reftests/generated-content/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/generated-content/reftest.list ---- firefox-92.0/layout/reftests/generated-content/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/generated-content/reftest.list 2021-09-03 18:50:44.866939741 +0200 -@@ -16 +16 @@ --fuzzy-if(OSX==1010,0-1,0-10) == quotes-001.xml quotes-001-ref.xml -+fuzzy(0-128,0-737) fuzzy-if(OSX==1010,0-1,0-10) == quotes-001.xml quotes-001-ref.xml -diff -U0 firefox-92.0/layout/reftests/high-contrast/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/high-contrast/reftest.list ---- firefox-92.0/layout/reftests/high-contrast/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/high-contrast/reftest.list 2021-09-03 18:50:44.866939741 +0200 -@@ -22 +22 @@ --fuzzy-if(cocoaWidget,255-255,1495-1495) fuzzy-if(winWidget,255-255,353-353) fuzzy-if(Android,255-255,700-700) == backplate-bg-image-010.html backplate-bg-image-010-ref.html -+fuzzy-if(gtkWidget,0-255,0-1495) fuzzy-if(cocoaWidget,255-255,1495-1495) fuzzy-if(winWidget,255-255,353-353) fuzzy-if(Android,255-255,700-700) == backplate-bg-image-010.html backplate-bg-image-010-ref.html -diff -U0 firefox-92.0/layout/reftests/indic-shaping/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/indic-shaping/reftest.list ---- firefox-92.0/layout/reftests/indic-shaping/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/indic-shaping/reftest.list 2021-09-03 18:50:44.866939741 +0200 -@@ -12 +11,0 @@ --fuzzy-if(gtkWidget,255-255,46-46) == gujarati-3b.html gujarati-3-ref.html # gtkWidget, Bug 1600777 -diff -U0 firefox-92.0/layout/reftests/mathml/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/mathml/reftest.list ---- firefox-92.0/layout/reftests/mathml/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/mathml/reftest.list 2021-09-03 18:50:44.866939741 +0200 -@@ -26 +26 @@ --random-if(smallScreen&&Android) fuzzy(0-255,0-200) fuzzy-if(geckoview&&webrender,201-216,200-250) fuzzy-if(webrender&&winWidget,114-255,245-361) fuzzy-if(webrender&&OSX,79-153,240-250) == mirror-op-1.html mirror-op-1-ref.html -+random-if(smallScreen&&Android) fuzzy(0-255,0-350) fuzzy-if(geckoview&&webrender,201-216,312-316) fuzzy-if(webrender&&winWidget,114-255,245-361) fuzzy-if(webrender&&OSX,79-153,307-314) == mirror-op-1.html mirror-op-1-ref.html -@@ -66 +66 @@ --== stretchy-largeop-2.html stretchy-largeop-2-ref.html -+fuzzy-if(gtkWidget,0-255,0-126) == stretchy-largeop-2.html stretchy-largeop-2-ref.html -@@ -177 +176,0 @@ --fuzzy-if(skiaContent,0-1,0-80) fuzzy-if(Android,0-255,0-105) fuzzy-if(gtkWidget,255-255,96-96) skip-if(winWidget) == multiscripts-1.html multiscripts-1-ref.html # Windows: bug 1314684; Android: bug 1392254; Linux: bug 1599638 -@@ -256 +254,0 @@ --fails-if(winWidget) fuzzy-if(gtkWidget,255-255,776226-776226) == subscript-italic-correction.html subscript-italic-correction-ref.html # bug 961482 (Windows), bug 1599640 (Linux) -diff -U0 firefox-92.0/layout/reftests/position-dynamic-changes/relative/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/position-dynamic-changes/relative/reftest.list ---- firefox-92.0/layout/reftests/position-dynamic-changes/relative/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/position-dynamic-changes/relative/reftest.list 2021-09-03 18:50:44.866939741 +0200 -@@ -1,4 +1,4 @@ --fuzzy-if(cocoaWidget,0-1,0-2) fuzzy-if(d2d,0-47,0-26) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-169,0-970) == move-right-bottom.html move-right-bottom-ref.html --fuzzy-if(cocoaWidget,0-1,0-2) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-169,0-970) == move-top-left.html move-top-left-ref.html # Bug 688545 --fuzzy-if(cocoaWidget,0-1,0-3) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-144,0-580) == move-right-bottom-table.html move-right-bottom-table-ref.html --fuzzy-if(cocoaWidget,0-1,0-3) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-144,0-580) == move-top-left-table.html move-top-left-table-ref.html # Bug 688545 -+fuzzy-if(gtkWidget,0-99,0-1255) fuzzy-if(cocoaWidget,0-1,0-2) == move-right-bottom.html move-right-bottom-ref.html -+fuzzy-if(gtkWidget,0-99,0-1254) fuzzy-if(cocoaWidget,0-1,0-2) == move-top-left.html move-top-left-ref.html # Bug 688545 -+fuzzy-if(gtkWidget,0-103,0-637) fuzzy-if(cocoaWidget,0-1,0-3) == move-right-bottom-table.html move-right-bottom-table-ref.html -+fuzzy-if(gtkWidget,0-103,0-637) fuzzy-if(cocoaWidget,0-1,0-3) == move-top-left-table.html move-top-left-table-ref.html # Bug 688545 -diff -U0 firefox-92.0/layout/reftests/position-sticky/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/position-sticky/reftest.list ---- firefox-92.0/layout/reftests/position-sticky/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/position-sticky/reftest.list 2021-09-03 18:50:44.866939741 +0200 -@@ -53,3 +52,0 @@ --fuzzy-if(Android,0-5,0-4) fuzzy-if(webrender&>kWidget,10-17,12-32) fuzzy-if(webrender&&cocoaWidget,7-8,18-42) skip-if(!asyncPan) fails-if(useDrawSnapshot) == transformed-2.html transformed-2-ref.html # Bug 1604644 --skip-if(!asyncPan) fuzzy-if(Android,0-10,0-4) fuzzy-if(webrender&>kWidget,19-30,12-32) fuzzy-if(webrender&&cocoaWidget,13-16,20-44) fails-if(useDrawSnapshot) == nested-sticky-1.html nested-sticky-1-ref.html # Bug 1604644 --skip-if(!asyncPan) fuzzy-if(Android,0-10,0-4) fuzzy-if(webrender&>kWidget,19-30,12-32) fuzzy-if(webrender&&cocoaWidget,13-16,20-44) fuzzy-if(/^Windows\x20NT\x206\.1/.test(http.oscpu),0-4,0-104) fails-if(useDrawSnapshot) == nested-sticky-2.html nested-sticky-2-ref.html # Bug 1604644 -diff -U0 firefox-92.0/layout/reftests/reftest-sanity/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/reftest-sanity/reftest.list ---- firefox-92.0/layout/reftests/reftest-sanity/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/reftest-sanity/reftest.list 2021-09-03 18:50:44.867939768 +0200 -@@ -131,6 +131,6 @@ --pref(font.default.x-western,"serif") == font-serif.html font-default.html --pref(font.default.x-western,"serif") != font-sans-serif.html font-default.html --pref(font.default.x-western,"sans-serif") == font-sans-serif.html font-default.html --pref(font.default.x-western,"sans-serif") != font-serif.html font-default.html --fails pref(font.default.x-western,true) == font-serif.html font-default.html --fails pref(font.default.x-western,0) == font-serif.html font-default.html -+#pref(font.default.x-western,"serif") == font-serif.html font-default.html -+#pref(font.default.x-western,"serif") != font-sans-serif.html font-default.html -+#pref(font.default.x-western,"sans-serif") == font-sans-serif.html font-default.html -+#pref(font.default.x-western,"sans-serif") != font-serif.html font-default.html -+#fails pref(font.default.x-western,true) == font-serif.html font-default.html -+#fails pref(font.default.x-western,0) == font-serif.html font-default.html -diff -U0 firefox-92.0/layout/reftests/svg/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/svg/reftest.list ---- firefox-92.0/layout/reftests/svg/reftest.list.firefox-tests-reftest 2021-09-01 19:15:00.000000000 +0200 -+++ firefox-92.0/layout/reftests/svg/reftest.list 2021-09-03 18:50:44.867939768 +0200 -@@ -475 +475 @@ --random-if(winWidget) fuzzy-if(Android,0-10,0-2) == text-gradient-02.svg text-gradient-02-ref.svg # see bug 590101 -+random-if(winWidget) fuzzy-if(gtkWidget,0-20,0-10) fuzzy-if(Android,0-10,0-2) == text-gradient-02.svg text-gradient-02-ref.svg # see bug 590101 -@@ -482 +481,0 @@ --!= text-language-00.xhtml text-language-00-ref.xhtml -@@ -484 +483 @@ --random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == text-layout-01.svg text-layout-01-ref.svg # Bug 1392106 -+fuzzy-if(gtkWidget,0-255,0-1769) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == text-layout-01.svg text-layout-01-ref.svg # Bug 1392106 -@@ -492 +491 @@ --random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == text-layout-09.svg pass.svg # Bug 1392106 -+fuzzy(0-255,0-237) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == text-layout-09.svg pass.svg # Bug 1392106 -diff -U0 firefox-92.0/layout/reftests/svg/smil/style/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/svg/smil/style/reftest.list ---- firefox-92.0/layout/reftests/svg/smil/style/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/svg/smil/style/reftest.list 2021-09-03 18:50:44.867939768 +0200 -@@ -70 +70 @@ --random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) fuzzy-if(gtkWidget,255-255,1520-1520) == anim-css-font-1.svg anim-css-font-1-ref.svg # Windows: Bug 1392106 Linux: Bug 1599619 -+random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == anim-css-font-1.svg anim-css-font-1-ref.svg # Windows: Bug 1392106 Linux: Bug 1599619 -diff -U0 firefox-92.0/layout/reftests/svg/svg-integration/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/svg/svg-integration/reftest.list ---- firefox-92.0/layout/reftests/svg/svg-integration/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/svg/svg-integration/reftest.list 2021-09-03 18:50:44.867939768 +0200 -@@ -50 +50 @@ --fuzzy-if(Android,0-4,0-10) == box-decoration-break-01.xhtml box-decoration-break-01-ref.xhtml -+fuzzy-if(gtkWidget,0-5,0-11) fuzzy-if(Android,0-4,0-10) == box-decoration-break-01.xhtml box-decoration-break-01-ref.xhtml -@@ -52 +52 @@ --fuzzy(0-67,0-238) == box-decoration-break-03.xhtml box-decoration-break-01-ref.xhtml -+fuzzy(0-67,0-254) == box-decoration-break-03.xhtml box-decoration-break-01-ref.xhtml -diff -U0 firefox-92.0/layout/reftests/svg/text/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/svg/text/reftest.list ---- firefox-92.0/layout/reftests/svg/text/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/svg/text/reftest.list 2021-09-03 18:50:44.867939768 +0200 -@@ -203,2 +202,0 @@ --fuzzy-if(skiaContent,0-1,0-100) needs-focus fuzzy-if(webrender&&winWidget,55-148,200-318) == simple-bidi-selection.svg simple-bidi-selection-ref.html --fuzzy-if(skiaContent,0-1,0-50) needs-focus fuzzy-if(webrender&&winWidget,55-148,200-254) fuzzy-if(webrender&&OSX,1-65,19-196) == simple-fill-color-selection.svg simple-fill-color-selection-ref.html -diff -U0 firefox-92.0/layout/reftests/tab-size/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/tab-size/reftest.list ---- firefox-92.0/layout/reftests/tab-size/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/tab-size/reftest.list 2021-09-03 18:50:44.867939768 +0200 -@@ -2,6 +2,6 @@ --== tab-size-8.html spaces-8.html --== tab-size-4.html spaces-4.html --== tab-size-4-span.html spaces-4.html --== tab-size-4-spanoffset.html spaces-4-offset.html --== tab-size-4-multiple.html spaces-4-multiple.html --== tab-size-1.html spaces-1.html -+fuzzy-if(gtkWidget,0-255,0-70) == tab-size-8.html spaces-8.html -+fuzzy-if(gtkWidget,0-255,0-70) == tab-size-4.html spaces-4.html -+fuzzy-if(gtkWidget,0-255,0-70) == tab-size-4-span.html spaces-4.html -+fuzzy-if(gtkWidget,0-255,0-371) == tab-size-4-spanoffset.html spaces-4-offset.html -+fuzzy-if(gtkWidget,0-255,0-410) == tab-size-4-multiple.html spaces-4-multiple.html -+fuzzy-if(gtkWidget,0-255,0-63) == tab-size-1.html spaces-1.html -diff -U0 firefox-92.0/layout/reftests/text-decoration/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/text-decoration/reftest.list ---- firefox-92.0/layout/reftests/text-decoration/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/text-decoration/reftest.list 2021-09-03 18:50:44.867939768 +0200 -@@ -1,2 +1,2 @@ --fuzzy-if(webrender&>kWidget,0-208,0-12) == complex-decoration-style-quirks.html complex-decoration-style-quirks-ref.html --fuzzy-if(webrender&>kWidget,0-208,0-12) == complex-decoration-style-standards.html complex-decoration-style-standards-ref.html -+fuzzy-if(gtkWidget,0-255,0-40) == complex-decoration-style-quirks.html complex-decoration-style-quirks-ref.html -+fuzzy-if(gtkWidget,0-255,0-40) == complex-decoration-style-standards.html complex-decoration-style-standards-ref.html -diff -U0 firefox-92.0/layout/reftests/text-overflow/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/text-overflow/reftest.list ---- firefox-92.0/layout/reftests/text-overflow/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/text-overflow/reftest.list 2021-09-03 18:50:44.868939795 +0200 -@@ -6 +6 @@ --skip-if(!gtkWidget) fuzzy-if(gtkWidget,0-124,0-289) == bidi-simple-scrolled.html bidi-simple-scrolled-ref.html # Fails on Windows and OSX due to anti-aliasing -+skip-if(!gtkWidget) fuzzy-if(gtkWidget,0-255,0-400) == bidi-simple-scrolled.html bidi-simple-scrolled-ref.html # Fails on Windows and OSX due to anti-aliasing -@@ -28 +28 @@ --== float-edges-1.html float-edges-1-ref.html -+fuzzy-if(gtkWidget,0-255,0-294) == float-edges-1.html float-edges-1-ref.html -diff -U0 firefox-92.0/layout/reftests/text/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/text/reftest.list ---- firefox-92.0/layout/reftests/text/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/text/reftest.list 2021-09-03 18:50:44.868939795 +0200 -@@ -190 +190 @@ --fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == 1320665-cmap-format-13.html 1320665-cmap-format-13-ref.html # see bug 1320665 comments 8-9 -+fuzzy-if(gtkWidget,0-255,0-1071) fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == 1320665-cmap-format-13.html 1320665-cmap-format-13-ref.html # see bug 1320665 comments 8-9 -@@ -193,2 +193,2 @@ --fuzzy-if(Android,0-128,0-233) == 1463020-letter-spacing-text-transform-1.html 1463020-letter-spacing-text-transform-1-ref.html --fails-if(Android) == 1463020-letter-spacing-text-transform-2.html 1463020-letter-spacing-text-transform-2-ref.html # missing font coverage on Android -+fuzzy-if(gtkWidget,0-255,0-800) fails-if(/^^Windows\x20NT\x2010\.0/.test(http.oscpu)) fuzzy-if(Android,0-128,0-233) == 1463020-letter-spacing-text-transform-1.html 1463020-letter-spacing-text-transform-1-ref.html -+fuzzy-if(gtkWidget,0-255,0-1600) fails-if(Android) == 1463020-letter-spacing-text-transform-2.html 1463020-letter-spacing-text-transform-2-ref.html # missing font coverage on Android -@@ -198 +197,0 @@ --fuzzy-if(useDrawSnapshot&&webrender,255-255,50-50) fuzzy-if(!webrender,0-42,0-1590) fuzzy-if(gtkWidget&&!webrender,0-255,0-50) == 1655364-1.html 1655364-1-ref.html -@@ -366 +365 @@ --== color-opacity-rtl-1.html color-opacity-rtl-1-ref.html -+fuzzy-if(gtkWidget,0-5,0-5) == color-opacity-rtl-1.html color-opacity-rtl-1-ref.html -diff -U0 firefox-92.0/layout/reftests/text-transform/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/text-transform/reftest.list ---- firefox-92.0/layout/reftests/text-transform/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/text-transform/reftest.list 2021-09-03 18:50:44.868939795 +0200 -@@ -15 +15 @@ --random-if(winWidget) == small-caps-1.html small-caps-1-ref.html # fails if default font supports 'smcp' -+fuzzy-if(gtkWidget,0-255,0-571) random-if(winWidget) == small-caps-1.html small-caps-1-ref.html # fails if default font supports 'smcp' -diff -U0 firefox-92.0/layout/reftests/transform-3d/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/transform-3d/reftest.list ---- firefox-92.0/layout/reftests/transform-3d/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/transform-3d/reftest.list 2021-09-03 18:50:44.868939795 +0200 -@@ -14 +13,0 @@ --fuzzy-if(gtkWidget||winWidget,0-8,0-376) fuzzy-if(Android,0-8,0-441) fuzzy-if(skiaContent,0-16,0-346) fuzzy-if(webrender&&cocoaWidget,0-200,0-310) fuzzy-if(webrender&&winWidget,0-175,0-250) == preserve3d-1a.html preserve3d-1-ref.html -@@ -27,2 +26,2 @@ --fuzzy-if(winWidget,0-143,0-689) fuzzy-if(OSX,0-224,0-924) fuzzy-if(winWidget,0-154,0-644) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == scale3d-all.html scale3d-1-ref.html # subpixel AA --fuzzy-if(winWidget,0-143,0-689) fuzzy-if(OSX,0-224,0-924) fuzzy-if(winWidget,0-154,0-644) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == scale3d-all-separate.html scale3d-1-ref.html # subpixel AA -+fuzzy-if(gtkWidget,0-100,0-628) fuzzy-if(winWidget,0-143,0-689) fuzzy-if(OSX,0-224,0-924) fuzzy-if(winWidget,0-154,0-644) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == scale3d-all.html scale3d-1-ref.html # subpixel AA -+fuzzy-if(gtkWidget,0-100,0-628) fuzzy-if(winWidget,0-143,0-689) fuzzy-if(OSX,0-224,0-924) fuzzy-if(winWidget,0-154,0-644) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == scale3d-all-separate.html scale3d-1-ref.html # subpixel AA -@@ -75,2 +74,2 @@ --fuzzy-if(skiaContent,0-1,0-4) fuzzy-if(cocoaWidget,0-128,0-9) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == animate-preserve3d-parent.html animate-preserve3d-ref.html # intermittently fuzzy on Mac --fuzzy-if(skiaContent,0-1,0-4) fuzzy-if(cocoaWidget,0-128,0-9) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == animate-preserve3d-child.html animate-preserve3d-ref.html # intermittently fuzzy on Mac, bug 1461311 for Android -+fuzzy(0-1,0-9) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == animate-preserve3d-parent.html animate-preserve3d-ref.html # intermittently fuzzy on Mac -+fuzzy(0-1,0-6) fuzzy-if(cocoaWidget,0-128,0-9) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == animate-preserve3d-child.html animate-preserve3d-ref.html # intermittently fuzzy on Mac, bug 1461311 for Android -@@ -102 +100,0 @@ --fuzzy-if(webrender,0-6,0-3117) fuzzy-if(useDrawSnapshot,4-4,13-13) == 1637067-1.html 1637067-1-ref.html -diff -U0 firefox-92.0/layout/reftests/writing-mode/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/writing-mode/reftest.list ---- firefox-92.0/layout/reftests/writing-mode/reftest.list.firefox-tests-reftest 2021-09-01 19:15:01.000000000 +0200 -+++ firefox-92.0/layout/reftests/writing-mode/reftest.list 2021-09-03 18:50:44.868939795 +0200 -@@ -20 +20 @@ --random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == 1091058-1.html 1091058-1-ref.html # Bug 1392106 -+fuzzy(0-255,0-315) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == 1091058-1.html 1091058-1-ref.html # Bug 1392106 -@@ -34 +34 @@ --fuzzy-if(Android,0-128,0-94) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == 1111944-1-list-marker.html 1111944-1-list-marker-ref.html # Bug 1392106 -+fuzzy-if(gtkWidget,0-72,0-47) fuzzy-if(Android,0-128,0-94) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == 1111944-1-list-marker.html 1111944-1-list-marker-ref.html # Bug 1392106 -@@ -114 +114 @@ --fails-if(geckoview) == 1135361-ruby-justify-1.html 1135361-ruby-justify-1-ref.html # Bug 1558513 for GV -+fuzzy-if(gtkWidget,0-255,0-2323) fails-if(geckoview) == 1135361-ruby-justify-1.html 1135361-ruby-justify-1-ref.html # Bug 1558513 for GV -@@ -154 +154 @@ --fuzzy-if(winWidget,0-3,0-84) == 1193519-sideways-lr-3.html 1193519-sideways-lr-3-ref.html -+fuzzy(0-255,0-610) fuzzy-if(winWidget,0-3,0-84) fails-if(webrender&&winWidget&&!swgl) == 1193519-sideways-lr-3.html 1193519-sideways-lr-3-ref.html -@@ -185 +185 @@ --== 1395926-vertical-upright-gpos-1.html 1395926-vertical-upright-gpos-1-ref.html -+fuzzy-if(gtkWidget,0-248,0-8) == 1395926-vertical-upright-gpos-1.html 1395926-vertical-upright-gpos-1-ref.html -diff -U0 firefox-92.0/layout/reftests/writing-mode/tables/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/writing-mode/tables/reftest.list ---- firefox-92.0/layout/reftests/writing-mode/tables/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/writing-mode/tables/reftest.list 2021-09-03 18:50:44.868939795 +0200 -@@ -34 +34 @@ --== fixed-table-layout-027-vlr.html fixed-table-layout-025-ref.html -+fuzzy-if(gtkWidget,0-260,0-250) == fixed-table-layout-027-vlr.html fixed-table-layout-025-ref.html -@@ -60 +60 @@ --== fixed-table-layout-027-vrl.html fixed-table-layout-025-ref.html -+fuzzy-if(gtkWidget,0-260,0-250) == fixed-table-layout-027-vrl.html fixed-table-layout-025-ref.html -@@ -77,2 +76,0 @@ --fuzzy-if(Android,0-255,0-38) == table-caption-top-1.html table-caption-top-1-ref.html --fuzzy-if(Android,0-255,0-38) pref(layout.css.caption-side-non-standard.enabled,true) == table-caption-bottom-1.html table-caption-bottom-1-ref.html -diff -U0 firefox-92.0/layout/reftests/xul/reftest.list.firefox-tests-reftest firefox-92.0/layout/reftests/xul/reftest.list ---- firefox-92.0/layout/reftests/xul/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/reftests/xul/reftest.list 2021-09-03 18:50:44.869939823 +0200 -@@ -15 +15 @@ --random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == chrome://reftest/content/xul/text-small-caps-1.xhtml chrome://reftest/content/xul/text-small-caps-1-ref.xhtml -+fuzzy-if(gtkWidget,0-255,0-5159) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == chrome://reftest/content/xul/text-small-caps-1.xhtml chrome://reftest/content/xul/text-small-caps-1-ref.xhtml -diff -U0 firefox-92.0/layout/xul/reftest/reftest.list.firefox-tests-reftest firefox-92.0/layout/xul/reftest/reftest.list ---- firefox-92.0/layout/xul/reftest/reftest.list.firefox-tests-reftest 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/layout/xul/reftest/reftest.list 2021-09-03 18:50:44.869939823 +0200 -@@ -13,2 +12,0 @@ --# This test is fuzzy as the marks cannot be positioned exactly as the real ones are measured in dev pixels. --fuzzy(0-10,0-102) fuzzy-if(winWidget&&isDebugBuild&&layersGPUAccelerated&&!is64Bit,1-1,102-102) == chrome://reftest/content/xul/reftest/scrollbar-marks-overlay.html chrome://reftest/content/xul/reftest/scrollbar-marks-overlay-ref.html diff --git a/firefox-tests-xpcshell-freeze.patch b/firefox-tests-xpcshell-freeze.patch deleted file mode 100644 index 1115417..0000000 --- a/firefox-tests-xpcshell-freeze.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -up firefox-88.0/testing/xpcshell/runxpcshelltests.py.old firefox-88.0/testing/xpcshell/runxpcshelltests.py ---- firefox-88.0/testing/xpcshell/runxpcshelltests.py.old 2021-04-30 10:45:14.466616224 +0200 -+++ firefox-88.0/testing/xpcshell/runxpcshelltests.py 2021-04-30 10:45:21.339525085 +0200 -@@ -1382,8 +1382,8 @@ class XPCShellTests(object): - self.log.info("Process %s" % label) - self.log.info(msg) - -- dumpOutput(proc.stdout, "stdout") -- dumpOutput(proc.stderr, "stderr") -+ #dumpOutput(proc.stdout, "stdout") -+ #dumpOutput(proc.stderr, "stderr") - self.nodeProc = {} - - def startHttp3Server(self): diff --git a/firefox-tests-xpcshell.patch b/firefox-tests-xpcshell.patch deleted file mode 100644 index a342668..0000000 --- a/firefox-tests-xpcshell.patch +++ /dev/null @@ -1,147 +0,0 @@ -diff -U0 firefox-92.0/browser/components/enterprisepolicies/tests/xpcshell/xpcshell.ini.firefox-tests-xpcshell firefox-92.0/browser/components/enterprisepolicies/tests/xpcshell/xpcshell.ini ---- firefox-92.0/browser/components/enterprisepolicies/tests/xpcshell/xpcshell.ini.firefox-tests-xpcshell 2021-09-01 19:14:33.000000000 +0200 -+++ firefox-92.0/browser/components/enterprisepolicies/tests/xpcshell/xpcshell.ini 2021-09-03 18:39:17.386058157 +0200 -@@ -9 +8,0 @@ --[test_appupdateurl.js] -@@ -27 +25,0 @@ --[test_sorted_alphabetically.js] -diff -U0 firefox-92.0/netwerk/test/unit_ipc/xpcshell.ini.firefox-tests-xpcshell firefox-92.0/netwerk/test/unit_ipc/xpcshell.ini ---- firefox-92.0/netwerk/test/unit_ipc/xpcshell.ini.firefox-tests-xpcshell 2021-09-01 19:15:11.000000000 +0200 -+++ firefox-92.0/netwerk/test/unit_ipc/xpcshell.ini 2021-09-03 18:41:07.754088004 +0200 -@@ -73 +72,0 @@ --[test_dns_service_wrap.js] -@@ -114 +112,0 @@ --[test_trr_httpssvc_wrap.js] -diff -U0 firefox-92.0/netwerk/test/unit/xpcshell.ini.firefox-tests-xpcshell firefox-92.0/netwerk/test/unit/xpcshell.ini ---- firefox-92.0/netwerk/test/unit/xpcshell.ini.firefox-tests-xpcshell 2021-09-01 19:15:11.000000000 +0200 -+++ firefox-92.0/netwerk/test/unit/xpcshell.ini 2021-09-03 18:41:58.545482327 +0200 -@@ -205 +204,0 @@ --[test_dns_service.js] -@@ -221 +219,0 @@ --[test_file_protocol.js] -@@ -328 +325,0 @@ --[test_unix_domain.js] -@@ -340 +336,0 @@ --[test_udp_multicast.js] -@@ -390,2 +385,0 @@ --[test_tls_flags.js] --skip-if = (os == "android" && processor == "x86_64") -@@ -406 +399,0 @@ --[test_network_connectivity_service.js] -@@ -503 +495,0 @@ --[test_httpssvc_retry_with_ech.js] -@@ -513 +504,0 @@ --[test_odoh.js] -diff -U0 firefox-92.0/security/manager/ssl/tests/unit/xpcshell.ini.firefox-tests-xpcshell firefox-92.0/security/manager/ssl/tests/unit/xpcshell.ini ---- firefox-92.0/security/manager/ssl/tests/unit/xpcshell.ini.firefox-tests-xpcshell 2021-09-01 19:15:06.000000000 +0200 -+++ firefox-92.0/security/manager/ssl/tests/unit/xpcshell.ini 2021-09-03 18:41:07.755088031 +0200 -@@ -115,4 +114,0 @@ --[test_encrypted_client_hello.js] --run-sequentially = hardcoded ports --[test_encrypted_client_hello_client_only.js] --run-sequentially = hardcoded ports -@@ -180 +175,0 @@ --[test_oskeystore.js] -diff -U0 firefox-92.0/security/manager/ssl/tests/unit/xpcshell-smartcards.ini.firefox-tests-xpcshell firefox-92.0/security/manager/ssl/tests/unit/xpcshell-smartcards.ini ---- firefox-92.0/security/manager/ssl/tests/unit/xpcshell-smartcards.ini.firefox-tests-xpcshell 2021-09-01 19:15:18.000000000 +0200 -+++ firefox-92.0/security/manager/ssl/tests/unit/xpcshell-smartcards.ini 2021-09-03 18:41:07.755088031 +0200 -@@ -10 +9,0 @@ --[test_pkcs11_module.js] -diff -U0 firefox-92.0/toolkit/components/antitracking/test/xpcshell/xpcshell.ini.firefox-tests-xpcshell firefox-92.0/toolkit/components/antitracking/test/xpcshell/xpcshell.ini ---- firefox-92.0/toolkit/components/antitracking/test/xpcshell/xpcshell.ini.firefox-tests-xpcshell 2021-09-01 19:15:34.000000000 +0200 -+++ firefox-92.0/toolkit/components/antitracking/test/xpcshell/xpcshell.ini 2021-09-03 18:41:07.755088031 +0200 -@@ -11 +10,0 @@ --[test_staticPartition_font.js] -diff -U0 firefox-92.0/toolkit/components/commandlines/test/unit/xpcshell.ini.firefox-tests-xpcshell firefox-92.0/toolkit/components/commandlines/test/unit/xpcshell.ini ---- firefox-92.0/toolkit/components/commandlines/test/unit/xpcshell.ini.firefox-tests-xpcshell 2021-09-01 19:16:05.000000000 +0200 -+++ firefox-92.0/toolkit/components/commandlines/test/unit/xpcshell.ini 2021-09-03 18:41:07.755088031 +0200 -@@ -10 +9,0 @@ --[test_resolvefile.js] -diff -U0 firefox-92.0/toolkit/components/corroborator/test/xpcshell/test_verify_jar.js.firefox-tests-xpcshell firefox-92.0/toolkit/components/corroborator/test/xpcshell/test_verify_jar.js ---- firefox-92.0/toolkit/components/corroborator/test/xpcshell/test_verify_jar.js.firefox-tests-xpcshell 2021-09-01 19:16:00.000000000 +0200 -+++ firefox-92.0/toolkit/components/corroborator/test/xpcshell/test_verify_jar.js 2021-09-03 18:41:07.755088031 +0200 -@@ -30,5 +29,0 @@ -- -- result = await Corroborate.verifyJar( -- do_get_file("data/signed-components.xpi") -- ); -- equal(result, true, "Components signed files do verify"); -diff -U0 firefox-92.0/toolkit/components/extensions/test/xpcshell/xpcshell-common.ini.firefox-tests-xpcshell firefox-92.0/toolkit/components/extensions/test/xpcshell/xpcshell-common.ini ---- firefox-92.0/toolkit/components/extensions/test/xpcshell/xpcshell-common.ini.firefox-tests-xpcshell 2021-09-01 19:16:05.000000000 +0200 -+++ firefox-92.0/toolkit/components/extensions/test/xpcshell/xpcshell-common.ini 2021-09-03 18:41:07.755088031 +0200 -@@ -97,10 +96,0 @@ --skip-if = appname == "thunderbird" || os == "android" || tsan # tsan: bug 1612707 --[test_ext_downloads_misc.js] --skip-if = -- os == "android" -- os == 'linux' && bits == 32 # bug 1324870 -- tsan # bug 1612707 -- os == "win" && bits == 32 # bug 1559476 --[test_ext_downloads_partitionKey.js] --skip-if = os == "android" --[test_ext_downloads_private.js] -@@ -288,2 +277,0 @@ --[test_proxy_listener.js] --skip-if = appname == "thunderbird" -diff -U0 firefox-92.0/toolkit/components/search/tests/xpcshell/xpcshell.ini.firefox-tests-xpcshell firefox-92.0/toolkit/components/search/tests/xpcshell/xpcshell.ini ---- firefox-92.0/toolkit/components/search/tests/xpcshell/xpcshell.ini.firefox-tests-xpcshell 2021-09-01 19:16:05.000000000 +0200 -+++ firefox-92.0/toolkit/components/search/tests/xpcshell/xpcshell.ini 2021-09-03 18:41:07.755088031 +0200 -@@ -124 +123,0 @@ --[test_reload_engines.js] -@@ -131 +129,0 @@ --[test_searchSuggest.js] -@@ -142,2 +139,0 @@ --[test_settings.js] --[test_sort_orders-no-hints.js] -diff -U0 firefox-92.0/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js.firefox-tests-xpcshell firefox-92.0/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js ---- firefox-92.0/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js.firefox-tests-xpcshell 2021-09-01 19:16:00.000000000 +0200 -+++ firefox-92.0/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js 2021-09-03 18:41:07.755088031 +0200 -@@ -594,20 +593,0 @@ -- Assert.ok( -- withSuspend - withoutSuspend <= max_delta_ms, -- "In test condition, the two uptimes should be close to each other" -- ); -- -- // This however should always hold, except on Windows < 10, where the two -- // clocks are from different system calls, and it can fail in test condition -- // because the machine has not been suspended. -- if ( -- AppConstants.platform != "win" || -- AppConstants.isPlatformAndVersionAtLeast("win", "10.0") -- ) { -- Assert.greaterOrEqual( -- withSuspend, -- withoutSuspend, -- `The uptime with suspend must always been greater or equal to the uptime -- without suspend` -- ); -- } -- -diff -U0 firefox-92.0/toolkit/mozapps/downloads/tests/unit/xpcshell.ini.firefox-tests-xpcshell firefox-92.0/toolkit/mozapps/downloads/tests/unit/xpcshell.ini ---- firefox-92.0/toolkit/mozapps/downloads/tests/unit/xpcshell.ini.firefox-tests-xpcshell 2021-09-01 19:16:01.000000000 +0200 -+++ firefox-92.0/toolkit/mozapps/downloads/tests/unit/xpcshell.ini 2021-09-03 18:41:07.755088031 +0200 -@@ -4 +3,0 @@ --[test_DownloadUtils.js] -diff -U0 firefox-92.0/toolkit/mozapps/extensions/test/xpcshell/xpcshell.ini.firefox-tests-xpcshell firefox-92.0/toolkit/mozapps/extensions/test/xpcshell/xpcshell.ini ---- firefox-92.0/toolkit/mozapps/extensions/test/xpcshell/xpcshell.ini.firefox-tests-xpcshell 2021-09-01 19:16:01.000000000 +0200 -+++ firefox-92.0/toolkit/mozapps/extensions/test/xpcshell/xpcshell.ini 2021-09-03 18:41:07.756088058 +0200 -@@ -91 +90,0 @@ --[test_sideloads_after_rebuild.js] -@@ -106 +104,0 @@ --[test_startup_scan.js] -@@ -187,2 +184,0 @@ --tags = webextensions --[test_webextension_theme.js] -diff -U0 firefox-92.0/toolkit/profile/xpcshell/xpcshell.ini.firefox-tests-xpcshell firefox-92.0/toolkit/profile/xpcshell/xpcshell.ini ---- firefox-92.0/toolkit/profile/xpcshell/xpcshell.ini.firefox-tests-xpcshell 2021-09-01 19:15:35.000000000 +0200 -+++ firefox-92.0/toolkit/profile/xpcshell/xpcshell.ini 2021-09-03 18:41:07.756088058 +0200 -@@ -32,3 +31,0 @@ --[test_snatch_environment.js] --[test_skip_locked_environment.js] --[test_snatch_environment_default.js] -diff -U0 firefox-92.0/uriloader/exthandler/tests/unit/test_handlerService.js.firefox-tests-xpcshell firefox-92.0/uriloader/exthandler/tests/unit/test_handlerService.js ---- firefox-92.0/uriloader/exthandler/tests/unit/test_handlerService.js.firefox-tests-xpcshell 2021-09-01 19:16:05.000000000 +0200 -+++ firefox-92.0/uriloader/exthandler/tests/unit/test_handlerService.js 2021-09-03 18:41:07.756088058 +0200 -@@ -145 +145 @@ -- Assert.ok(!protoInfo.alwaysAskBeforeHandling); -+ //Assert.ok(!protoInfo.alwaysAskBeforeHandling); diff --git a/firefox.spec b/firefox.spec index 6a20c37..8ac1be9 100644 --- a/firefox.spec +++ b/firefox.spec @@ -248,29 +248,15 @@ Source49: wasi.patch.template Source50: wasi-sdk-25.tar.gz # Build patches -Patch32: build-rust-ppc64le.patch -Patch35: build-ppc-jit.patch -# Fixing missing cacheFlush when JS_CODEGEN_NONE is used (s390x) -Patch38: build-cacheFlush-missing.patch Patch40: build-aarch64-skia.patch Patch44: build-arm-libopus.patch -Patch46: firefox-nss-version.patch Patch53: firefox-gcc-build.patch -Patch55: firefox-testing.patch -Patch61: firefox-glibc-dynstack.patch Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch Patch78: firefox-i686-build.patch Patch79: firefox-gcc-13-build.patch Patch80: wasi.patch Patch81: firefox-gcc-15.0-s390.patch -# Test patches -# Generate without context by -# GENDIFF_DIFF_ARGS=-U0 gendiff firefox-xxxx .firefox-tests-xpcshell -# GENDIFF_DIFF_ARGS=-U0 gendiff firefox-xxxx .firefox-tests-reftest -Patch100: firefox-tests-xpcshell.patch -Patch101: firefox-tests-reftest.patch -Patch102: firefox-tests-xpcshell-freeze.patch # Fedora specific patches Patch215: firefox-enable-addons.patch @@ -292,9 +278,6 @@ Patch600: pgo.patch Patch602: mozilla-1516803.patch Patch603: firefox-gcc-always-inline.patch -# system AV1 patches (from Gentoo) -Patch800: bmo-1559213-Support-system-av1.patch -Patch801: bmo-1559213-fix-system-av1-libs.patch %if %{?system_nss} BuildRequires: pkgconfig(nspr) >= %{nspr_version} diff --git a/python-build.patch b/python-build.patch deleted file mode 100644 index ad1d0fc..0000000 --- a/python-build.patch +++ /dev/null @@ -1,4558 +0,0 @@ -diff --git a/python/l10n/mozxchannel/__init__.py b/python/l10n/mozxchannel/__init__.py ---- a/python/l10n/mozxchannel/__init__.py -+++ b/python/l10n/mozxchannel/__init__.py -@@ -46,25 +46,6 @@ def get_default_config(topsrcdir, string - "mobile/android/locales/l10n.toml", - ], - }, -- "comm-central": { -- "path": topsrcdir / "comm", -- "post-clobber": True, -- "url": "https://hg.mozilla.org/comm-central/", -- "heads": { -- # This list of repositories is ordered, starting with the -- # one with the most recent content (central) to the oldest -- # (ESR). In case two ESR versions are supported, the oldest -- # ESR goes last (e.g. esr78 goes after esr91). -- "comm": "comm-central", -- "comm-beta": "releases/comm-beta", -- "comm-esr102": "releases/comm-esr102", -- }, -- "config_files": [ -- "comm/calendar/locales/l10n.toml", -- "comm/mail/locales/l10n.toml", -- "comm/suite/locales/l10n.toml", -- ], -- }, - }, - } - -diff --git a/python/mach/docs/windows-usage-outside-mozillabuild.rst b/python/mach/docs/windows-usage-outside-mozillabuild.rst ---- a/python/mach/docs/windows-usage-outside-mozillabuild.rst -+++ b/python/mach/docs/windows-usage-outside-mozillabuild.rst -@@ -117,3 +117,8 @@ Success! - - At this point, you should be able to invoke Mach and manage your version control system outside - of MozillaBuild. -+ -+.. tip:: -+ -+ `See here `__ for a detailed guide on -+ installing and customizing a development environment with MSYS2, zsh, and Windows Terminal. -diff --git a/python/mach/mach/site.py b/python/mach/mach/site.py ---- a/python/mach/mach/site.py -+++ b/python/mach/mach/site.py -@@ -18,10 +18,10 @@ import site - import subprocess - import sys - import sysconfig --from pathlib import Path - import tempfile - from contextlib import contextmanager --from typing import Optional, Callable -+from pathlib import Path -+from typing import Callable, Optional - - from mach.requirements import ( - MachEnvRequirements, -@@ -663,6 +663,58 @@ class CommandSiteManager: - stderr=subprocess.STDOUT, - universal_newlines=True, - ) -+ -+ if not check_result.returncode: -+ return -+ -+ """ -+ Some commands may use the "setup.py" script of first-party modules. This causes -+ a "*.egg-info" dir to be created for that module (which pip can then detect as -+ a package). Since we add all first-party module directories to the .pthfile for -+ the "mach" venv, these first-party modules are then detected by all venvs after -+ they are created. The problem is that these .egg-info directories can become -+ stale (since if the first-party module is updated it's not guaranteed that the -+ command that runs the "setup.py" was ran afterwards). This can cause -+ incompatibilities with the pip check (since the dependencies can change between -+ different versions). -+ -+ These .egg-info dirs are in our VCS ignore lists (eg: ".hgignore") because they -+ are necessary to run some commands, so we don't want to always purge them, and we -+ also don't want to accidentally commit them. Given this, we can leverage our VCS -+ to find all the current first-party .egg-info dirs. -+ -+ If we're in the case where 'pip check' fails, then we can try purging the -+ first-party .egg-info dirs, then run the 'pip check' again afterwards. If it's -+ still failing, then we know the .egg-info dirs weren't the problem. If that's -+ the case we can just raise the error encountered, which is the same as before. -+ """ -+ -+ def _delete_ignored_egg_info_dirs(): -+ from pathlib import Path -+ -+ from mozversioncontrol import get_repository_from_env -+ -+ with get_repository_from_env() as repo: -+ ignored_file_finder = repo.get_ignored_files_finder().find( -+ "**/*.egg-info" -+ ) -+ -+ unique_egg_info_dirs = { -+ Path(found[0]).parent for found in ignored_file_finder -+ } -+ -+ for egg_info_dir in unique_egg_info_dirs: -+ shutil.rmtree(egg_info_dir) -+ -+ _delete_ignored_egg_info_dirs() -+ -+ check_result = subprocess.run( -+ [self.python_path, "-m", "pip", "check"], -+ stdout=subprocess.PIPE, -+ stderr=subprocess.STDOUT, -+ universal_newlines=True, -+ ) -+ - if check_result.returncode: - if quiet: - # If "quiet" was specified, then the "pip install" output wasn't printed -@@ -763,7 +815,7 @@ class PythonVirtualenv: - else: - self.bin_path = os.path.join(prefix, "bin") - self.python_path = os.path.join(self.bin_path, "python") -- self.prefix = prefix -+ self.prefix = os.path.realpath(prefix) - - @functools.lru_cache(maxsize=None) - def resolve_sysconfig_packages_path(self, sysconfig_path): -@@ -783,16 +835,12 @@ class PythonVirtualenv: - relative_path = path.relative_to(data_path) - - # Path to virtualenv's "site-packages" directory for provided sysconfig path -- return os.path.normpath( -- os.path.normcase(os.path.realpath(Path(self.prefix) / relative_path)) -- ) -+ return os.path.normpath(os.path.normcase(Path(self.prefix) / relative_path)) - - def site_packages_dirs(self): - dirs = [] - if sys.platform.startswith("win"): -- dirs.append( -- os.path.normpath(os.path.normcase(os.path.realpath(self.prefix))) -- ) -+ dirs.append(os.path.normpath(os.path.normcase(self.prefix))) - purelib = self.resolve_sysconfig_packages_path("purelib") - platlib = self.resolve_sysconfig_packages_path("platlib") - -diff --git a/python/mozboot/bin/bootstrap.py b/python/mozboot/bin/bootstrap.py ---- a/python/mozboot/bin/bootstrap.py -+++ b/python/mozboot/bin/bootstrap.py -@@ -11,8 +11,6 @@ - # Python environment (except that it's run with a sufficiently recent version of - # Python 3), so we are restricted to stdlib modules. - --from __future__ import absolute_import, print_function, unicode_literals -- - import sys - - major, minor = sys.version_info[:2] -@@ -23,14 +21,13 @@ if (major < 3) or (major == 3 and minor - ) - sys.exit(1) - -+import ctypes - import os - import shutil - import subprocess - import tempfile --import ctypes -- -+from optparse import OptionParser - from pathlib import Path --from optparse import OptionParser - - CLONE_MERCURIAL_PULL_FAIL = """ - Failed to pull from hg.mozilla.org. -@@ -55,7 +52,7 @@ def which(name): - search_dirs = os.environ["PATH"].split(os.pathsep) - potential_names = [name] - if WINDOWS: -- potential_names.append(name + ".exe") -+ potential_names.insert(0, name + ".exe") - - for path in search_dirs: - for executable_name in potential_names: -@@ -105,7 +102,7 @@ def input_clone_dest(vcs, no_interactive - return None - - --def hg_clone_firefox(hg: Path, dest: Path): -+def hg_clone_firefox(hg: Path, dest: Path, head_repo, head_rev): - # We create an empty repo then modify the config before adding data. - # This is necessary to ensure storage settings are optimally - # configured. -@@ -139,16 +136,28 @@ def hg_clone_firefox(hg: Path, dest: Pat - fh.write("# This is necessary to keep performance in check\n") - fh.write("maxchainlen = 10000\n") - -+ # Pulling a specific revision into an empty repository induces a lot of -+ # load on the Mercurial server, so we always pull from mozilla-unified (which, -+ # when done from an empty repository, is equivalent to a clone), and then pull -+ # the specific revision we want (if we want a specific one, otherwise we just -+ # use the "central" bookmark), at which point it will be an incremental pull, -+ # that the server can process more easily. -+ # This is the same thing that robustcheckout does on automation. - res = subprocess.call( - [str(hg), "pull", "https://hg.mozilla.org/mozilla-unified"], cwd=str(dest) - ) -+ if not res and head_repo: -+ res = subprocess.call( -+ [str(hg), "pull", head_repo, "-r", head_rev], cwd=str(dest) -+ ) - print("") - if res: - print(CLONE_MERCURIAL_PULL_FAIL % dest) - return None - -- print('updating to "central" - the development head of Gecko and Firefox') -- res = subprocess.call([str(hg), "update", "-r", "central"], cwd=str(dest)) -+ head_rev = head_rev or "central" -+ print(f'updating to "{head_rev}" - the development head of Gecko and Firefox') -+ res = subprocess.call([str(hg), "update", "-r", head_rev], cwd=str(dest)) - if res: - print( - f"error updating; you will need to `cd {dest} && hg update -r central` " -@@ -157,7 +166,7 @@ def hg_clone_firefox(hg: Path, dest: Pat - return dest - - --def git_clone_firefox(git: Path, dest: Path, watchman: Path): -+def git_clone_firefox(git: Path, dest: Path, watchman: Path, head_repo, head_rev): - tempdir = None - cinnabar = None - env = dict(os.environ) -@@ -196,8 +205,7 @@ def git_clone_firefox(git: Path, dest: P - [ - str(git), - "clone", -- "-b", -- "bookmarks/central", -+ "--no-checkout", - "hg::https://hg.mozilla.org/mozilla-unified", - str(dest), - ], -@@ -210,6 +218,19 @@ def git_clone_firefox(git: Path, dest: P - [str(git), "config", "pull.ff", "only"], cwd=str(dest), env=env - ) - -+ if head_repo: -+ subprocess.check_call( -+ [str(git), "cinnabar", "fetch", f"hg::{head_repo}", head_rev], -+ cwd=str(dest), -+ env=env, -+ ) -+ -+ subprocess.check_call( -+ [str(git), "checkout", "FETCH_HEAD" if head_rev else "bookmarks/central"], -+ cwd=str(dest), -+ env=env, -+ ) -+ - watchman_sample = dest / ".git/hooks/fsmonitor-watchman.sample" - # Older versions of git didn't include fsmonitor-watchman.sample. - if watchman and watchman_sample.exists(): -@@ -233,12 +254,6 @@ def git_clone_firefox(git: Path, dest: P - subprocess.check_call(config_args, cwd=str(dest), env=env) - return dest - finally: -- if not cinnabar: -- print( -- "Failed to install git-cinnabar. Try performing a manual " -- "installation: https://github.com/glandium/git-cinnabar/wiki/" -- "Mozilla:-A-git-workflow-for-Gecko-development" -- ) - if tempdir: - shutil.rmtree(str(tempdir)) - -@@ -326,11 +341,15 @@ def clone(options): - add_microsoft_defender_antivirus_exclusions(dest, no_system_changes) - - print(f"Cloning Firefox {VCS_HUMAN_READABLE[vcs]} repository to {dest}") -+ -+ head_repo = os.environ.get("GECKO_HEAD_REPOSITORY") -+ head_rev = os.environ.get("GECKO_HEAD_REV") -+ - if vcs == "hg": -- return hg_clone_firefox(binary, dest) -+ return hg_clone_firefox(binary, dest, head_repo, head_rev) - else: - watchman = which("watchman") -- return git_clone_firefox(binary, dest, watchman) -+ return git_clone_firefox(binary, dest, watchman, head_repo, head_rev) - - - def bootstrap(srcdir: Path, application_choice, no_interactive, no_system_changes): -diff --git a/python/mozboot/mozboot/android.py b/python/mozboot/mozboot/android.py ---- a/python/mozboot/mozboot/android.py -+++ b/python/mozboot/mozboot/android.py -@@ -2,8 +2,6 @@ - # 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/. - --from __future__ import absolute_import, print_function, unicode_literals -- - import errno - import json - import os -@@ -11,15 +9,16 @@ import stat - import subprocess - import sys - import time --import requests -+from pathlib import Path - from typing import Optional, Union --from pathlib import Path --from tqdm import tqdm -+ -+import requests - - # We need the NDK version in multiple different places, and it's inconvenient - # to pass down the NDK version to all relevant places, so we have this global - # variable. - from mozboot.bootstrap import MOZCONFIG_SUGGESTION_TEMPLATE -+from tqdm import tqdm - - NDK_VERSION = "r21d" - CMDLINE_TOOLS_VERSION_STRING = "7.0" -@@ -74,7 +73,7 @@ output as packages are downloaded and in - - MOBILE_ANDROID_MOZCONFIG_TEMPLATE = """ - # Build GeckoView/Firefox for Android: --ac_add_options --enable-application=mobile/android -+ac_add_options --enable-project=mobile/android - - # Targeting the following architecture. - # For regular phones, no --target is needed. -@@ -90,8 +89,7 @@ ac_add_options --enable-application=mobi - - MOBILE_ANDROID_ARTIFACT_MODE_MOZCONFIG_TEMPLATE = """ - # Build GeckoView/Firefox for Android Artifact Mode: --ac_add_options --enable-application=mobile/android --ac_add_options --target=arm-linux-androideabi -+ac_add_options --enable-project=mobile/android - ac_add_options --enable-artifact-builds - - {extra_lines} -@@ -162,18 +160,19 @@ def download( - download_file_path: Path, - ): - with requests.Session() as session: -- request = session.head(url) -+ request = session.head(url, allow_redirects=True) -+ request.raise_for_status() - remote_file_size = int(request.headers["content-length"]) - - if download_file_path.is_file(): - local_file_size = download_file_path.stat().st_size - - if local_file_size == remote_file_size: -- print(f"{download_file_path} already downloaded. Skipping download...") -+ print( -+ f"{download_file_path.name} already downloaded. Skipping download..." -+ ) - else: -- print( -- f"Partial download detected. Resuming download of {download_file_path}..." -- ) -+ print(f"Partial download detected. Resuming download of {url}...") - download_internal( - download_file_path, - session, -@@ -182,7 +181,7 @@ def download( - local_file_size, - ) - else: -- print(f"Downloading {download_file_path}...") -+ print(f"Downloading {url}...") - download_internal(download_file_path, session, url, remote_file_size) - - -diff --git a/python/mozboot/mozboot/archlinux.py b/python/mozboot/mozboot/archlinux.py ---- a/python/mozboot/mozboot/archlinux.py -+++ b/python/mozboot/mozboot/archlinux.py -@@ -2,120 +2,27 @@ - # 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/. - --from __future__ import absolute_import, print_function, unicode_literals -- --import os - import sys --import tempfile --import subprocess -- --from pathlib import Path - - from mozboot.base import BaseBootstrapper - from mozboot.linux_common import LinuxBootstrapper - --# NOTE: This script is intended to be run with a vanilla Python install. We --# have to rely on the standard library instead of Python 2+3 helpers like --# the six module. --if sys.version_info < (3,): -- input = raw_input # noqa -- -- --AUR_URL_TEMPLATE = "https://aur.archlinux.org/cgit/aur.git/snapshot/{}.tar.gz" -- - - class ArchlinuxBootstrapper(LinuxBootstrapper, BaseBootstrapper): - """Archlinux experimental bootstrapper.""" - -- SYSTEM_PACKAGES = ["base-devel", "unzip", "zip"] -- -- BROWSER_PACKAGES = [ -- "alsa-lib", -- "dbus-glib", -- "gtk3", -- "libevent", -- "libvpx", -- "libxt", -- "mime-types", -- "startup-notification", -- "gst-plugins-base-libs", -- "libpulse", -- "xorg-server-xvfb", -- "gst-libav", -- "gst-plugins-good", -- ] -- -- BROWSER_AUR_PACKAGES = [ -- "uuid", -- ] -- -- MOBILE_ANDROID_COMMON_PACKAGES = [ -- # See comment about 32 bit binaries and multilib below. -- "multilib/lib32-ncurses", -- "multilib/lib32-readline", -- "multilib/lib32-zlib", -- ] -- - def __init__(self, version, dist_id, **kwargs): - print("Using an experimental bootstrapper for Archlinux.", file=sys.stderr) - BaseBootstrapper.__init__(self, **kwargs) - -- def install_system_packages(self): -- self.pacman_install(*self.SYSTEM_PACKAGES) -- -- def install_browser_packages(self, mozconfig_builder, artifact_mode=False): -- # TODO: Figure out what not to install for artifact mode -- self.aur_install(*self.BROWSER_AUR_PACKAGES) -- self.pacman_install(*self.BROWSER_PACKAGES) -- -- def install_browser_artifact_mode_packages(self, mozconfig_builder): -- self.install_browser_packages(mozconfig_builder, artifact_mode=True) -- -- def ensure_nasm_packages(self): -- # installed via install_browser_packages -- pass -- -- def install_mobile_android_packages(self, mozconfig_builder, artifact_mode=False): -- # Multi-part process: -- # 1. System packages. -- # 2. Android SDK. Android NDK only if we are not in artifact mode. Android packages. -- -- # 1. This is hard to believe, but the Android SDK binaries are 32-bit -- # and that conflicts with 64-bit Arch installations out of the box. The -- # solution is to add the multilibs repository; unfortunately, this -- # requires manual intervention. -- try: -- self.pacman_install(*self.MOBILE_ANDROID_COMMON_PACKAGES) -- except Exception as e: -- print( -- "Failed to install all packages. The Android developer " -- "toolchain requires 32 bit binaries be enabled (see " -- "https://wiki.archlinux.org/index.php/Android). You may need to " -- "manually enable the multilib repository following the instructions " -- "at https://wiki.archlinux.org/index.php/Multilib.", -- file=sys.stderr, -- ) -- raise e -- -- # 2. Android pieces. -- super().install_mobile_android_packages( -- mozconfig_builder, artifact_mode=artifact_mode -- ) -+ def install_packages(self, packages): -+ # watchman is not available via pacman -+ packages = [p for p in packages if p != "watchman"] -+ self.pacman_install(*packages) - - def upgrade_mercurial(self, current): - self.pacman_install("mercurial") - -- def pacman_is_installed(self, package): -- command = ["pacman", "-Q", package] -- return ( -- subprocess.run( -- command, -- stdout=subprocess.DEVNULL, -- stderr=subprocess.DEVNULL, -- ).returncode -- == 0 -- ) -- - def pacman_install(self, *packages): - command = ["pacman", "-S", "--needed"] - if self.no_interactive: -@@ -124,71 +31,3 @@ class ArchlinuxBootstrapper(LinuxBootstr - command.extend(packages) - - self.run_as_root(command) -- -- def run(self, command, env=None): -- subprocess.check_call(command, stdin=sys.stdin, env=env) -- -- def download(self, uri): -- command = ["curl", "-L", "-O", uri] -- self.run(command) -- -- def unpack(self, path: Path, name, ext): -- if ext == ".gz": -- compression = "-z" -- else: -- print(f"unsupported compression extension: {ext}", file=sys.stderr) -- sys.exit(1) -- -- name = path / (name + ".tar" + ext) -- command = ["tar", "-x", compression, "-f", str(name), "-C", str(path)] -- self.run(command) -- -- def makepkg(self, name): -- command = ["makepkg", "-sri"] -- if self.no_interactive: -- command.append("--noconfirm") -- makepkg_env = os.environ.copy() -- makepkg_env["PKGDEST"] = "." -- self.run(command, env=makepkg_env) -- -- def aur_install(self, *packages): -- needed = [] -- -- for package in packages: -- if self.pacman_is_installed(package): -- print( -- f"warning: AUR package {package} is installed -- skipping", -- file=sys.stderr, -- ) -- else: -- needed.append(package) -- -- # all required AUR packages are already installed! -- if not needed: -- return -- -- path = Path(tempfile.mkdtemp(prefix="mozboot-")) -- if not self.no_interactive: -- print( -- "WARNING! This script requires to install packages from the AUR " -- "This is potentially insecure so I recommend that you carefully " -- "read each package description and check the sources." -- f"These packages will be built in {path}: " + ", ".join(needed), -- file=sys.stderr, -- ) -- choice = input("Do you want to continue? (yes/no) [no]") -- if choice != "yes": -- sys.exit(1) -- -- base_dir = Path.cwd() -- os.chdir(path) -- for name in needed: -- url = AUR_URL_TEMPLATE.format(package) -- ext = Path(url).suffix -- directory = path / name -- self.download(url) -- self.unpack(path, name, ext) -- os.chdir(directory) -- self.makepkg(name) -- -- os.chdir(base_dir) -diff --git a/python/mozboot/mozboot/base.py b/python/mozboot/mozboot/base.py ---- a/python/mozboot/mozboot/base.py -+++ b/python/mozboot/mozboot/base.py -@@ -2,25 +2,22 @@ - # 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/. - --from __future__ import absolute_import, print_function, unicode_literals -- - import os - import re - import subprocess - import sys -- - from pathlib import Path - --from packaging.version import Version -+from mach.util import to_optional_path, win_to_msys_path - from mozboot import rust - from mozboot.util import ( -+ MINIMUM_RUST_VERSION, - get_mach_virtualenv_binary, -- MINIMUM_RUST_VERSION, - http_download_and_save, - ) -+from mozbuild.bootstrap import bootstrap_all_toolchains_for, bootstrap_toolchain - from mozfile import which --from mozbuild.bootstrap import bootstrap_toolchain --from mach.util import to_optional_path, win_to_msys_path -+from packaging.version import Version - - NO_MERCURIAL = """ - Could not find Mercurial (hg) in the current shell's path. Try starting a new -@@ -143,7 +140,7 @@ ac_add_options --enable-artifact-builds - - JS_MOZCONFIG_TEMPLATE = """\ - # Build only the SpiderMonkey JS test shell --ac_add_options --enable-application=js -+ac_add_options --enable-project=js - """ - - # Upgrade Mercurial older than this. -@@ -344,47 +341,12 @@ class BaseBootstrapper(object): - % __name__ - ) - -- def ensure_stylo_packages(self): -- """ -- Install any necessary packages needed for Stylo development. -- """ -- raise NotImplementedError( -- "%s does not yet implement ensure_stylo_packages()" % __name__ -- ) -- -- def ensure_nasm_packages(self): -- """ -- Install nasm. -- """ -- raise NotImplementedError( -- "%s does not yet implement ensure_nasm_packages()" % __name__ -- ) -- - def ensure_sccache_packages(self): - """ - Install sccache. - """ - pass - -- def ensure_node_packages(self): -- """ -- Install any necessary packages needed to supply NodeJS""" -- raise NotImplementedError( -- "%s does not yet implement ensure_node_packages()" % __name__ -- ) -- -- def ensure_fix_stacks_packages(self): -- """ -- Install fix-stacks. -- """ -- pass -- -- def ensure_minidump_stackwalk_packages(self): -- """ -- Install minidump-stackwalk. -- """ -- pass -- - def install_toolchain_static_analysis(self, toolchain_job): - clang_tools_path = self.state_dir / "clang-tools" - if not clang_tools_path.exists(): -@@ -428,9 +390,17 @@ class BaseBootstrapper(object): - - subprocess.check_call(cmd, cwd=str(install_dir)) - -- def run_as_root(self, command): -+ def auto_bootstrap(self, application): -+ args = ["--with-ccache=sccache"] -+ if application.endswith("_artifact_mode"): -+ args.append("--enable-artifact-builds") -+ application = application[: -len("_artifact_mode")] -+ args.append("--enable-project={}".format(application.replace("_", "/"))) -+ bootstrap_all_toolchains_for(args) -+ -+ def run_as_root(self, command, may_use_sudo=True): - if os.geteuid() != 0: -- if which("sudo"): -+ if may_use_sudo and which("sudo"): - command.insert(0, "sudo") - else: - command = ["su", "root", "-c", " ".join(command)] -@@ -439,107 +409,6 @@ class BaseBootstrapper(object): - - subprocess.check_call(command, stdin=sys.stdin) - -- def dnf_install(self, *packages): -- if which("dnf"): -- -- def not_installed(package): -- # We could check for "Error: No matching Packages to list", but -- # checking `dnf`s exit code is sufficent. -- # Ideally we'd invoke dnf with '--cacheonly', but there's: -- # https://bugzilla.redhat.com/show_bug.cgi?id=2030255 -- is_installed = subprocess.run( -- ["dnf", "list", "--installed", package], -- stdout=subprocess.PIPE, -- stderr=subprocess.STDOUT, -- ) -- if is_installed.returncode not in [0, 1]: -- stdout = is_installed.stdout -- raise Exception( -- f'Failed to determine whether package "{package}" is installed: "{stdout}"' -- ) -- return is_installed.returncode != 0 -- -- packages = list(filter(not_installed, packages)) -- if len(packages) == 0: -- # avoid sudo prompt (support unattended re-bootstrapping) -- return -- -- command = ["dnf", "install"] -- else: -- command = ["yum", "install"] -- -- if self.no_interactive: -- command.append("-y") -- command.extend(packages) -- -- self.run_as_root(command) -- -- def dnf_groupinstall(self, *packages): -- if which("dnf"): -- installed = subprocess.run( -- # Ideally we'd invoke dnf with '--cacheonly', but there's: -- # https://bugzilla.redhat.com/show_bug.cgi?id=2030255 -- # Ideally we'd use `--installed` instead of the undocumented -- # `installed` subcommand, but that doesn't currently work: -- # https://bugzilla.redhat.com/show_bug.cgi?id=1884616#c0 -- ["dnf", "group", "list", "installed", "--hidden"], -- universal_newlines=True, -- stdout=subprocess.PIPE, -- stderr=subprocess.STDOUT, -- ) -- if installed.returncode != 0: -- raise Exception( -- f'Failed to determine currently-installed package groups: "{installed.stdout}"' -- ) -- installed_packages = (pkg.strip() for pkg in installed.stdout.split("\n")) -- packages = list(filter(lambda p: p not in installed_packages, packages)) -- if len(packages) == 0: -- # avoid sudo prompt (support unattended re-bootstrapping) -- return -- -- command = ["dnf", "groupinstall"] -- else: -- command = ["yum", "groupinstall"] -- -- if self.no_interactive: -- command.append("-y") -- command.extend(packages) -- -- self.run_as_root(command) -- -- def dnf_update(self, *packages): -- if which("dnf"): -- command = ["dnf", "update"] -- else: -- command = ["yum", "update"] -- -- if self.no_interactive: -- command.append("-y") -- command.extend(packages) -- -- self.run_as_root(command) -- -- def apt_install(self, *packages): -- command = ["apt-get", "install"] -- if self.no_interactive: -- command.append("-y") -- command.extend(packages) -- -- self.run_as_root(command) -- -- def apt_update(self): -- command = ["apt-get", "update"] -- if self.no_interactive: -- command.append("-y") -- -- self.run_as_root(command) -- -- def apt_add_architecture(self, arch): -- command = ["dpkg", "--add-architecture"] -- command.extend(arch) -- -- self.run_as_root(command) -- - def prompt_int(self, prompt, low, high, default=None): - """Prompts the user with prompt and requires an integer between low and high. - -@@ -757,14 +626,10 @@ class BaseBootstrapper(object): - if modern: - print("Your version of Rust (%s) is new enough." % version) - -- if rustup: -- self.ensure_rust_targets(rustup, version) -- return -- -- if version: -+ elif version: - print("Your version of Rust (%s) is too old." % version) - -- if rustup: -+ if rustup and not modern: - rustup_version = self._parse_version(rustup) - if not rustup_version: - print(RUSTUP_OLD) -@@ -776,10 +641,16 @@ class BaseBootstrapper(object): - if not modern: - print(RUST_UPGRADE_FAILED % (MODERN_RUST_VERSION, after)) - sys.exit(1) -- else: -+ elif not rustup: - # No rustup. Download and run the installer. - print("Will try to install Rust.") - self.install_rust() -+ modern, version = self.is_rust_modern(cargo_bin) -+ rustup = to_optional_path( -+ which("rustup", extra_search_dirs=[str(cargo_bin)]) -+ ) -+ -+ self.ensure_rust_targets(rustup, version) - - def ensure_rust_targets(self, rustup: Path, rust_version): - """Make sure appropriate cross target libraries are installed.""" -diff --git a/python/mozboot/mozboot/bootstrap.py b/python/mozboot/mozboot/bootstrap.py ---- a/python/mozboot/mozboot/bootstrap.py -+++ b/python/mozboot/mozboot/bootstrap.py -@@ -2,48 +2,46 @@ - # 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/. - --from __future__ import absolute_import, print_function, unicode_literals -- --from collections import OrderedDict -- - import os - import platform - import re - import shutil --import sys -+import stat - import subprocess -+import sys - import time --from typing import Optional -+from collections import OrderedDict - from pathlib import Path --from packaging.version import Version -+from typing import Optional -+ -+# Use distro package to retrieve linux platform information -+import distro -+from mach.site import MachSiteManager -+from mach.telemetry import initialize_telemetry_setting - from mach.util import ( -+ UserError, - get_state_dir, -- UserError, - to_optional_path, - to_optional_str, - win_to_msys_path, - ) --from mach.telemetry import initialize_telemetry_setting --from mach.site import MachSiteManager -+from mozboot.archlinux import ArchlinuxBootstrapper - from mozboot.base import MODERN_RUST_VERSION - from mozboot.centosfedora import CentOSFedoraBootstrapper --from mozboot.opensuse import OpenSUSEBootstrapper - from mozboot.debian import DebianBootstrapper - from mozboot.freebsd import FreeBSDBootstrapper - from mozboot.gentoo import GentooBootstrapper --from mozboot.osx import OSXBootstrapper, OSXBootstrapperLight -+from mozboot.mozconfig import MozconfigBuilder -+from mozboot.mozillabuild import MozillaBuildBootstrapper - from mozboot.openbsd import OpenBSDBootstrapper --from mozboot.archlinux import ArchlinuxBootstrapper -+from mozboot.opensuse import OpenSUSEBootstrapper -+from mozboot.osx import OSXBootstrapper, OSXBootstrapperLight - from mozboot.solus import SolusBootstrapper - from mozboot.void import VoidBootstrapper - from mozboot.windows import WindowsBootstrapper --from mozboot.mozillabuild import MozillaBuildBootstrapper --from mozboot.mozconfig import MozconfigBuilder -+from mozbuild.base import MozbuildObject - from mozfile import which --from mozbuild.base import MozbuildObject -- --# Use distro package to retrieve linux platform information --import distro -+from packaging.version import Version - - APPLICATION_CHOICE = """ - Note on Artifact Mode: -@@ -123,6 +121,7 @@ DEBIAN_DISTROS = ( - "devuan", - "pureos", - "deepin", -+ "tuxedo", - ) - - ADD_GIT_CINNABAR_PATH = """ -@@ -250,13 +249,11 @@ class Bootstrapper(object): - # Also install the clang static-analysis package by default - # The best place to install our packages is in the state directory - # we have. We should have created one above in non-interactive mode. -- self.instance.ensure_node_packages() -- self.instance.ensure_fix_stacks_packages() -- self.instance.ensure_minidump_stackwalk_packages() -+ self.instance.auto_bootstrap(application) -+ self.instance.install_toolchain_artifact("fix-stacks") -+ self.instance.install_toolchain_artifact("minidump-stackwalk") - if not self.instance.artifact_mode: -- self.instance.ensure_stylo_packages() - self.instance.ensure_clang_static_analysis_package() -- self.instance.ensure_nasm_packages() - self.instance.ensure_sccache_packages() - # Like 'ensure_browser_packages' or 'ensure_mobile_android_packages' - getattr(self.instance, "ensure_%s_packages" % application)() -@@ -325,7 +322,6 @@ class Bootstrapper(object): - state_dir = Path(get_state_dir()) - self.instance.state_dir = state_dir - -- hg_installed, hg_modern = self.instance.ensure_mercurial_modern() - hg = to_optional_path(which("hg")) - - # We need to enable the loading of hgrc in case extensions are -@@ -355,6 +351,10 @@ class Bootstrapper(object): - - # Possibly configure Mercurial, but not if the current checkout or repo - # type is Git. -+ hg_installed = bool(hg) -+ if checkout_type == "hg": -+ hg_installed, hg_modern = self.instance.ensure_mercurial_modern() -+ - if hg_installed and checkout_type == "hg": - if not self.instance.no_interactive: - configure_hg = self.instance.prompt_yesno(prompt=CONFIGURE_MERCURIAL) -@@ -485,8 +485,8 @@ class Bootstrapper(object): - # distutils is singled out here because some distros (namely Ubuntu) - # include it in a separate package outside of the main Python - # installation. -+ import distutils.spawn - import distutils.sysconfig -- import distutils.spawn - - assert distutils.sysconfig is not None and distutils.spawn is not None - except ImportError as e: -@@ -610,11 +610,11 @@ def current_firefox_checkout(env, hg: Op - # Just check for known-good files in the checkout, to prevent attempted - # foot-shootings. Determining a canonical git checkout of mozilla-unified - # is...complicated -- elif git_dir.exists(): -+ elif git_dir.exists() or hg_dir.exists(): - moz_configure = path / "moz.configure" - if moz_configure.exists(): - _warn_if_risky_revision(path) -- return "git", path -+ return ("git" if git_dir.exists() else "hg"), path - - if not len(path.parents): - break -@@ -639,13 +639,23 @@ def update_git_tools(git: Optional[Path] - # repository. It now only downloads prebuilt binaries, so if we are - # updating from an old setup, remove the repository and start over. - if (cinnabar_dir / ".git").exists(): -- shutil.rmtree(str(cinnabar_dir)) -+ # git sets pack files read-only, which causes problems removing -+ # them on Windows. To work around that, we use an error handler -+ # on rmtree that retries to remove the file after chmod'ing it. -+ def onerror(func, path, exc): -+ if func == os.unlink: -+ os.chmod(path, stat.S_IRWXU) -+ func(path) -+ else: -+ raise -+ -+ shutil.rmtree(str(cinnabar_dir), onerror=onerror) - - # If we already have an executable, ask it to update itself. - exists = cinnabar_exe.exists() - if exists: - try: -- subprocess.check_call([cinnabar_exe, "self-update"]) -+ subprocess.check_call([str(cinnabar_exe), "self-update"]) - except subprocess.CalledProcessError as e: - print(e) - -diff --git a/python/mozboot/mozboot/centosfedora.py b/python/mozboot/mozboot/centosfedora.py ---- a/python/mozboot/mozboot/centosfedora.py -+++ b/python/mozboot/mozboot/centosfedora.py -@@ -2,10 +2,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/. - --from __future__ import absolute_import, print_function, unicode_literals -+import subprocess - - from mozboot.base import BaseBootstrapper - from mozboot.linux_common import LinuxBootstrapper -+from mozfile import which - - - class CentOSFedoraBootstrapper(LinuxBootstrapper, BaseBootstrapper): -@@ -16,79 +17,63 @@ class CentOSFedoraBootstrapper(LinuxBoot - self.version = int(version.split(".")[0]) - self.dist_id = dist_id - -- self.group_packages = [] -- -- self.packages = ["which"] -- -- self.browser_group_packages = ["GNOME Software Development"] -- -- self.browser_packages = [ -- "alsa-lib-devel", -- "dbus-glib-devel", -- "glibc-static", -- # Development group. -- "libstdc++-static", -- "libXt-devel", -- "pulseaudio-libs-devel", -- "gcc-c++", -- ] -- -- self.mobile_android_packages = [] -- -+ def install_packages(self, packages): -+ if self.version >= 33 and "perl" in packages: -+ packages.append("perl-FindBin") -+ # watchman is not available on centos/rocky - if self.distro in ("centos", "rocky"): -- self.group_packages += ["Development Tools"] -- -- self.packages += ["curl-devel"] -- -- self.browser_packages += ["gtk3-devel"] -- -- if self.version == 6: -- self.group_packages += [ -- "Development Libraries", -- "GNOME Software Development", -- ] -- -- else: -- self.packages += ["redhat-rpm-config"] -- -- self.browser_group_packages = ["Development Tools"] -- -- elif self.distro == "fedora": -- self.group_packages += ["C Development Tools and Libraries"] -- -- self.packages += [ -- "redhat-rpm-config", -- "watchman", -- ] -- if self.version >= 33: -- self.packages.append("perl-FindBin") -- -- self.mobile_android_packages += ["ncurses-compat-libs"] -- -- self.packages += ["python3-devel"] -- -- def install_system_packages(self): -- self.dnf_groupinstall(*self.group_packages) -- self.dnf_install(*self.packages) -- -- def install_browser_packages(self, mozconfig_builder, artifact_mode=False): -- # TODO: Figure out what not to install for artifact mode -- self.dnf_groupinstall(*self.browser_group_packages) -- self.dnf_install(*self.browser_packages) -- -- def install_browser_artifact_mode_packages(self, mozconfig_builder): -- self.install_browser_packages(mozconfig_builder, artifact_mode=True) -- -- def install_mobile_android_packages(self, mozconfig_builder, artifact_mode=False): -- # Install Android specific packages. -- self.dnf_install(*self.mobile_android_packages) -- -- super().install_mobile_android_packages( -- mozconfig_builder, artifact_mode=artifact_mode -- ) -+ packages = [p for p in packages if p != "watchman"] -+ self.dnf_install(*packages) - - def upgrade_mercurial(self, current): - if current is None: - self.dnf_install("mercurial") - else: - self.dnf_update("mercurial") -+ -+ def dnf_install(self, *packages): -+ if which("dnf"): -+ -+ def not_installed(package): -+ # We could check for "Error: No matching Packages to list", but -+ # checking `dnf`s exit code is sufficent. -+ # Ideally we'd invoke dnf with '--cacheonly', but there's: -+ # https://bugzilla.redhat.com/show_bug.cgi?id=2030255 -+ is_installed = subprocess.run( -+ ["dnf", "list", "--installed", package], -+ stdout=subprocess.PIPE, -+ stderr=subprocess.STDOUT, -+ ) -+ if is_installed.returncode not in [0, 1]: -+ stdout = is_installed.stdout -+ raise Exception( -+ f'Failed to determine whether package "{package}" is installed: "{stdout}"' -+ ) -+ return is_installed.returncode != 0 -+ -+ packages = list(filter(not_installed, packages)) -+ if len(packages) == 0: -+ # avoid sudo prompt (support unattended re-bootstrapping) -+ return -+ -+ command = ["dnf", "install"] -+ else: -+ command = ["yum", "install"] -+ -+ if self.no_interactive: -+ command.append("-y") -+ command.extend(packages) -+ -+ self.run_as_root(command) -+ -+ def dnf_update(self, *packages): -+ if which("dnf"): -+ command = ["dnf", "update"] -+ else: -+ command = ["yum", "update"] -+ -+ if self.no_interactive: -+ command.append("-y") -+ command.extend(packages) -+ -+ self.run_as_root(command) -diff --git a/python/mozboot/mozboot/debian.py b/python/mozboot/mozboot/debian.py ---- a/python/mozboot/mozboot/debian.py -+++ b/python/mozboot/mozboot/debian.py -@@ -2,48 +2,13 @@ - # 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/. - --from __future__ import absolute_import, print_function, unicode_literals -+import sys - --from mozboot.base import BaseBootstrapper, MERCURIAL_INSTALL_PROMPT -+from mozboot.base import MERCURIAL_INSTALL_PROMPT, BaseBootstrapper - from mozboot.linux_common import LinuxBootstrapper - --import sys -- - - class DebianBootstrapper(LinuxBootstrapper, BaseBootstrapper): -- -- # These are common packages for all Debian-derived distros (such as -- # Ubuntu). -- COMMON_PACKAGES = [ -- "build-essential", -- "libpython3-dev", -- "m4", -- "unzip", -- "uuid", -- "zip", -- ] -- -- # These are common packages for building Firefox for Desktop -- # (browser) for all Debian-derived distros (such as Ubuntu). -- BROWSER_COMMON_PACKAGES = [ -- "libasound2-dev", -- "libcurl4-openssl-dev", -- "libdbus-1-dev", -- "libdbus-glib-1-dev", -- "libdrm-dev", -- "libgtk-3-dev", -- "libpulse-dev", -- "libx11-xcb-dev", -- "libxt-dev", -- "xvfb", -- ] -- -- # These are common packages for building Firefox for Android -- # (mobile/android) for all Debian-derived distros (such as Ubuntu). -- MOBILE_ANDROID_COMMON_PACKAGES = [ -- "libncurses5", # For native debugging in Android Studio -- ] -- - def __init__(self, distro, version, dist_id, codename, **kwargs): - BaseBootstrapper.__init__(self, **kwargs) - -@@ -52,16 +17,6 @@ class DebianBootstrapper(LinuxBootstrapp - self.dist_id = dist_id - self.codename = codename - -- self.packages = list(self.COMMON_PACKAGES) -- -- try: -- version_number = int(version) -- except ValueError: -- version_number = None -- -- if (version_number and (version_number >= 11)) or version == "unstable": -- self.packages += ["watchman"] -- - def suggest_install_distutils(self): - print( - "HINT: Try installing distutils with " -@@ -75,26 +30,15 @@ class DebianBootstrapper(LinuxBootstrapp - file=sys.stderr, - ) - -- def install_system_packages(self): -- self.apt_install(*self.packages) -- -- def install_browser_packages(self, mozconfig_builder, artifact_mode=False): -- # TODO: Figure out what not to install for artifact mode -- self.apt_install(*self.BROWSER_COMMON_PACKAGES) -- -- def install_browser_artifact_mode_packages(self, mozconfig_builder): -- self.install_browser_packages(mozconfig_builder, artifact_mode=True) -+ def install_packages(self, packages): -+ try: -+ if int(self.version) < 11: -+ # watchman is only available starting from Debian 11. -+ packages = [p for p in packages if p != "watchman"] -+ except ValueError: -+ pass - -- def install_mobile_android_packages(self, mozconfig_builder, artifact_mode=False): -- # Multi-part process: -- # 1. System packages. -- # 2. Android SDK. Android NDK only if we are not in artifact mode. Android packages. -- self.apt_install(*self.MOBILE_ANDROID_COMMON_PACKAGES) -- -- # 2. Android pieces. -- super().install_mobile_android_packages( -- mozconfig_builder, artifact_mode=artifact_mode -- ) -+ self.apt_install(*packages) - - def _update_package_manager(self): - self.apt_update() -@@ -122,3 +66,18 @@ class DebianBootstrapper(LinuxBootstrapp - # pip. - assert res == 1 - self.run_as_root(["pip3", "install", "--upgrade", "Mercurial"]) -+ -+ def apt_install(self, *packages): -+ command = ["apt-get", "install"] -+ if self.no_interactive: -+ command.append("-y") -+ command.extend(packages) -+ -+ self.run_as_root(command) -+ -+ def apt_update(self): -+ command = ["apt-get", "update"] -+ if self.no_interactive: -+ command.append("-y") -+ -+ self.run_as_root(command) -diff --git a/python/mozboot/mozboot/freebsd.py b/python/mozboot/mozboot/freebsd.py ---- a/python/mozboot/mozboot/freebsd.py -+++ b/python/mozboot/mozboot/freebsd.py -@@ -2,7 +2,6 @@ - # 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/. - --from __future__ import absolute_import, print_function, unicode_literals - import sys - - from mozboot.base import BaseBootstrapper -@@ -19,11 +18,11 @@ class FreeBSDBootstrapper(BaseBootstrapp - "gmake", - "gtar", - "m4", -+ "npm", - "pkgconf", - "py%d%d-sqlite3" % sys.version_info[0:2], - "rust", - "watchman", -- "zip", - ] - - self.browser_packages = [ -@@ -56,10 +55,11 @@ class FreeBSDBootstrapper(BaseBootstrapp - def install_browser_packages(self, mozconfig_builder, artifact_mode=False): - # TODO: Figure out what not to install for artifact mode - packages = self.browser_packages.copy() -- if sys.platform.startswith("netbsd"): -- packages.extend(["brotli", "gtk3+", "libv4l"]) -- else: -- packages.extend(["gtk3", "mesa-dri", "v4l_compat"]) -+ if not artifact_mode: -+ if sys.platform.startswith("netbsd"): -+ packages.extend(["brotli", "gtk3+", "libv4l", "cbindgen"]) -+ else: -+ packages.extend(["gtk3", "mesa-dri", "v4l_compat", "rust-cbindgen"]) - self.pkg_install(*packages) - - def install_browser_artifact_mode_packages(self, mozconfig_builder): -@@ -69,19 +69,5 @@ class FreeBSDBootstrapper(BaseBootstrapp - # TODO: we don't ship clang base static analysis for this platform - pass - -- def ensure_stylo_packages(self): -- # Clang / llvm already installed as browser package -- if sys.platform.startswith("netbsd"): -- self.pkg_install("cbindgen") -- else: -- self.pkg_install("rust-cbindgen") -- -- def ensure_nasm_packages(self): -- # installed via install_browser_packages -- pass -- -- def ensure_node_packages(self): -- self.pkg_install("npm") -- - def upgrade_mercurial(self, current): - self.pkg_install("mercurial") -diff --git a/python/mozboot/mozboot/gentoo.py b/python/mozboot/mozboot/gentoo.py ---- a/python/mozboot/mozboot/gentoo.py -+++ b/python/mozboot/mozboot/gentoo.py -@@ -2,8 +2,6 @@ - # 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/. - --from __future__ import absolute_import, print_function, unicode_literals -- - from mozboot.base import BaseBootstrapper - from mozboot.linux_common import LinuxBootstrapper - -@@ -15,32 +13,13 @@ class GentooBootstrapper(LinuxBootstrapp - self.version = version - self.dist_id = dist_id - -- def install_system_packages(self): -- self.ensure_system_packages() -- -- def ensure_system_packages(self): -- self.run_as_root( -- ["emerge", "--noreplace", "--quiet", "app-arch/zip", "dev-util/watchman"] -- ) -- -- def install_browser_packages(self, mozconfig_builder, artifact_mode=False): -- # TODO: Figure out what not to install for artifact mode -- self.run_as_root( -- [ -- "emerge", -- "--oneshot", -- "--noreplace", -- "--quiet", -- "--newuse", -- "dev-libs/dbus-glib", -- "media-sound/pulseaudio", -- "x11-libs/gtk+:3", -- "x11-libs/libXt", -- ] -- ) -- -- def install_browser_artifact_mode_packages(self, mozconfig_builder): -- self.install_browser_packages(mozconfig_builder, artifact_mode=True) -+ def install_packages(self, packages): -+ DISAMBIGUATE = { -+ "tar": "app-arch/tar", -+ } -+ # watchman is available but requires messing with USEs. -+ packages = [DISAMBIGUATE.get(p, p) for p in packages if p != "watchman"] -+ self.run_as_root(["emerge", "--noreplace"] + packages) - - def _update_package_manager(self): - self.run_as_root(["emerge", "--sync"]) -diff --git a/python/mozboot/mozboot/linux_common.py b/python/mozboot/mozboot/linux_common.py ---- a/python/mozboot/mozboot/linux_common.py -+++ b/python/mozboot/mozboot/linux_common.py -@@ -6,8 +6,6 @@ - # needed to install Stylo and Node dependencies. This class must come before - # BaseBootstrapper in the inheritance list. - --from __future__ import absolute_import, print_function, unicode_literals -- - import platform - - -@@ -15,68 +13,6 @@ def is_non_x86_64(): - return platform.machine() != "x86_64" - - --class SccacheInstall(object): -- def __init__(self, **kwargs): -- pass -- -- def ensure_sccache_packages(self): -- self.install_toolchain_artifact("sccache") -- -- --class FixStacksInstall(object): -- def __init__(self, **kwargs): -- pass -- -- def ensure_fix_stacks_packages(self): -- self.install_toolchain_artifact("fix-stacks") -- -- --class StyloInstall(object): -- def __init__(self, **kwargs): -- pass -- -- def ensure_stylo_packages(self): -- if is_non_x86_64(): -- print( -- "Cannot install bindgen clang and cbindgen packages from taskcluster.\n" -- "Please install these packages manually." -- ) -- return -- -- self.install_toolchain_artifact("clang") -- self.install_toolchain_artifact("cbindgen") -- -- --class NasmInstall(object): -- def __init__(self, **kwargs): -- pass -- -- def ensure_nasm_packages(self): -- if is_non_x86_64(): -- print( -- "Cannot install nasm from taskcluster.\n" -- "Please install this package manually." -- ) -- return -- -- self.install_toolchain_artifact("nasm") -- -- --class NodeInstall(object): -- def __init__(self, **kwargs): -- pass -- -- def ensure_node_packages(self): -- if is_non_x86_64(): -- print( -- "Cannot install node package from taskcluster.\n" -- "Please install this package manually." -- ) -- return -- -- self.install_toolchain_artifact("node") -- -- - class ClangStaticAnalysisInstall(object): - def __init__(self, **kwargs): - pass -@@ -94,14 +30,6 @@ class ClangStaticAnalysisInstall(object) - self.install_toolchain_static_analysis(static_analysis.LINUX_CLANG_TIDY) - - --class MinidumpStackwalkInstall(object): -- def __init__(self, **kwargs): -- pass -- -- def ensure_minidump_stackwalk_packages(self): -- self.install_toolchain_artifact("minidump-stackwalk") -- -- - class MobileAndroidBootstrapper(object): - def __init__(self, **kwargs): - pass -@@ -154,13 +82,32 @@ class MobileAndroidBootstrapper(object): - - class LinuxBootstrapper( - ClangStaticAnalysisInstall, -- FixStacksInstall, -- MinidumpStackwalkInstall, - MobileAndroidBootstrapper, -- NasmInstall, -- NodeInstall, -- SccacheInstall, -- StyloInstall, - ): - def __init__(self, **kwargs): - pass -+ -+ def ensure_sccache_packages(self): -+ pass -+ -+ def install_system_packages(self): -+ self.install_packages( -+ [ -+ "bash", -+ "findutils", # contains xargs -+ "gzip", -+ "libxml2", # used by bootstrapped clang -+ "m4", -+ "make", -+ "perl", -+ "tar", -+ "unzip", -+ "watchman", -+ ] -+ ) -+ -+ def install_browser_packages(self, mozconfig_builder, artifact_mode=False): -+ pass -+ -+ def install_browser_artifact_mode_packages(self, mozconfig_builder): -+ pass -diff --git a/python/mozboot/mozboot/mach_commands.py b/python/mozboot/mozboot/mach_commands.py ---- a/python/mozboot/mozboot/mach_commands.py -+++ b/python/mozboot/mozboot/mach_commands.py -@@ -2,13 +2,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/. - --from __future__ import absolute_import, print_function, unicode_literals -- - import errno - import sys -+from pathlib import Path - --from pathlib import Path --from mach.decorators import CommandArgument, Command -+from mach.decorators import Command, CommandArgument - from mozboot.bootstrap import APPLICATIONS - - -@@ -71,8 +69,8 @@ def vcs_setup(command_context, update_on - """ - import mozboot.bootstrap as bootstrap - import mozversioncontrol -+ from mach.util import to_optional_path - from mozfile import which -- from mach.util import to_optional_path - - repo = mozversioncontrol.get_repository_object(command_context._mach_context.topdir) - tool = "hg" -diff --git a/python/mozboot/mozboot/mozconfig.py b/python/mozboot/mozboot/mozconfig.py ---- a/python/mozboot/mozboot/mozconfig.py -+++ b/python/mozboot/mozboot/mozconfig.py -@@ -2,15 +2,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/. - --from __future__ import absolute_import -- - import filecmp - import os -- - from pathlib import Path - from typing import Union - -- - MOZ_MYCONFIG_ERROR = """ - The MOZ_MYCONFIG environment variable to define the location of mozconfigs - is deprecated. If you wish to define the mozconfig path via an environment -diff --git a/python/mozboot/mozboot/mozillabuild.py b/python/mozboot/mozboot/mozillabuild.py ---- a/python/mozboot/mozboot/mozillabuild.py -+++ b/python/mozboot/mozboot/mozillabuild.py -@@ -2,8 +2,6 @@ - # 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/. - --from __future__ import absolute_import, print_function, unicode_literals -- - import ctypes - import os - import platform -@@ -231,35 +229,9 @@ class MozillaBuildBootstrapper(BaseBoots - def ensure_sccache_packages(self): - from mozboot import sccache - -- self.install_toolchain_artifact("sccache") - self.install_toolchain_artifact(sccache.RUSTC_DIST_TOOLCHAIN, no_unpack=True) - self.install_toolchain_artifact(sccache.CLANG_DIST_TOOLCHAIN, no_unpack=True) - -- def ensure_stylo_packages(self): -- # On-device artifact builds are supported; on-device desktop builds are not. -- if is_aarch64_host(): -- raise Exception( -- "You should not be performing desktop builds on an " -- "AArch64 device. If you want to do artifact builds " -- "instead, please choose the appropriate artifact build " -- "option when beginning bootstrap." -- ) -- -- self.install_toolchain_artifact("clang") -- self.install_toolchain_artifact("cbindgen") -- -- def ensure_nasm_packages(self): -- self.install_toolchain_artifact("nasm") -- -- def ensure_node_packages(self): -- self.install_toolchain_artifact("node") -- -- def ensure_fix_stacks_packages(self): -- self.install_toolchain_artifact("fix-stacks") -- -- def ensure_minidump_stackwalk_packages(self): -- self.install_toolchain_artifact("minidump-stackwalk") -- - def _update_package_manager(self): - pass - -diff --git a/python/mozboot/mozboot/openbsd.py b/python/mozboot/mozboot/openbsd.py ---- a/python/mozboot/mozboot/openbsd.py -+++ b/python/mozboot/mozboot/openbsd.py -@@ -2,8 +2,6 @@ - # 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/. - --from __future__ import absolute_import, print_function, unicode_literals -- - from mozboot.base import BaseBootstrapper - - -@@ -11,9 +9,17 @@ class OpenBSDBootstrapper(BaseBootstrapp - def __init__(self, version, **kwargs): - BaseBootstrapper.__init__(self, **kwargs) - -- self.packages = ["gmake", "gtar", "rust", "unzip", "zip"] -+ self.packages = ["gmake", "gtar", "rust", "unzip"] - -- self.browser_packages = ["llvm", "nasm", "gtk+3", "dbus-glib", "pulseaudio"] -+ self.browser_packages = [ -+ "llvm", -+ "cbindgen", -+ "nasm", -+ "node", -+ "gtk+3", -+ "dbus-glib", -+ "pulseaudio", -+ ] - - def install_system_packages(self): - # we use -z because there's no other way to say "any autoconf-2.13" -@@ -30,14 +36,3 @@ class OpenBSDBootstrapper(BaseBootstrapp - def ensure_clang_static_analysis_package(self): - # TODO: we don't ship clang base static analysis for this platform - pass -- -- def ensure_stylo_packages(self): -- # Clang / llvm already installed as browser package -- self.run_as_root(["pkg_add", "cbindgen"]) -- -- def ensure_nasm_packages(self): -- # installed via install_browser_packages -- pass -- -- def ensure_node_packages(self): -- self.run_as_root(["pkg_add", "node"]) -diff --git a/python/mozboot/mozboot/opensuse.py b/python/mozboot/mozboot/opensuse.py ---- a/python/mozboot/mozboot/opensuse.py -+++ b/python/mozboot/mozboot/opensuse.py -@@ -2,107 +2,24 @@ - # 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/. - --from __future__ import absolute_import, print_function, unicode_literals -- --from mozboot.base import BaseBootstrapper, MERCURIAL_INSTALL_PROMPT -+from mozboot.base import MERCURIAL_INSTALL_PROMPT, BaseBootstrapper - from mozboot.linux_common import LinuxBootstrapper - --import distro --import subprocess -- - - class OpenSUSEBootstrapper(LinuxBootstrapper, BaseBootstrapper): - """openSUSE experimental bootstrapper.""" - -- SYSTEM_PACKAGES = [ -- "libcurl-devel", -- "libpulse-devel", -- "rpmconf", -- "which", -- "unzip", -- ] -- -- BROWSER_PACKAGES = [ -- "alsa-devel", -- "gcc-c++", -- "gtk3-devel", -- "dbus-1-glib-devel", -- "glibc-devel-static", -- "libstdc++-devel", -- "libXt-devel", -- "libproxy-devel", -- "libuuid-devel", -- "clang-devel", -- "patterns-gnome-devel_gnome", -- ] -- -- OPTIONAL_BROWSER_PACKAGES = [ -- "gconf2-devel", # https://bugzilla.mozilla.org/show_bug.cgi?id=1779931 -- ] -- -- BROWSER_GROUP_PACKAGES = ["devel_C_C++", "devel_gnome"] -- -- MOBILE_ANDROID_COMMON_PACKAGES = ["java-1_8_0-openjdk"] -- - def __init__(self, version, dist_id, **kwargs): - print("Using an experimental bootstrapper for openSUSE.") - BaseBootstrapper.__init__(self, **kwargs) - -- def install_system_packages(self): -- self.zypper_install(*self.SYSTEM_PACKAGES) -- -- def install_browser_packages(self, mozconfig_builder, artifact_mode=False): -- # TODO: Figure out what not to install for artifact mode -- packages_to_install = self.BROWSER_PACKAGES.copy() -- -- for package in self.OPTIONAL_BROWSER_PACKAGES: -- if self.zypper_can_install(package): -- packages_to_install.append(package) -- else: -- print( -- f"WARNING! zypper cannot find a package for '{package}' for " -- f"{distro.name(True)}. It will not be automatically installed." -- ) -- -- self.zypper_install(*packages_to_install) -- -- def install_browser_group_packages(self): -- self.ensure_browser_group_packages() -- -- def install_browser_artifact_mode_packages(self, mozconfig_builder): -- self.install_browser_packages(mozconfig_builder, artifact_mode=True) -- -- def ensure_clang_static_analysis_package(self): -- from mozboot import static_analysis -- -- self.install_toolchain_static_analysis(static_analysis.LINUX_CLANG_TIDY) -- -- def ensure_browser_group_packages(self, artifact_mode=False): -- # TODO: Figure out what not to install for artifact mode -- self.zypper_patterninstall(*self.BROWSER_GROUP_PACKAGES) -- -- def install_mobile_android_packages(self, mozconfig_builder, artifact_mode=False): -- # Multi-part process: -- # 1. System packages. -- # 2. Android SDK. Android NDK only if we are not in artifact mode. Android packages. -- -- # 1. This is hard to believe, but the Android SDK binaries are 32-bit -- # and that conflicts with 64-bit Arch installations out of the box. The -- # solution is to add the multilibs repository; unfortunately, this -- # requires manual intervention. -- try: -- self.zypper_install(*self.MOBILE_ANDROID_COMMON_PACKAGES) -- except Exception as e: -- print( -- "Failed to install all packages. The Android developer " -- "toolchain requires 32 bit binaries be enabled" -- ) -- raise e -- -- # 2. Android pieces. -- super().install_mobile_android_packages( -- mozconfig_builder, artifact_mode=artifact_mode -- ) -+ def install_packages(self, packages): -+ ALTERNATIVE_NAMES = { -+ "libxml2": "libxml2-2", -+ } -+ # watchman is not available -+ packages = [ALTERNATIVE_NAMES.get(p, p) for p in packages if p != "watchman"] -+ self.zypper_install(*packages) - - def _update_package_manager(self): - self.zypper_update() -@@ -142,14 +59,5 @@ class OpenSUSEBootstrapper(LinuxBootstra - def zypper_install(self, *packages): - self.zypper("install", *packages) - -- def zypper_can_install(self, package): -- return ( -- subprocess.call(["zypper", "search", package], stdout=subprocess.DEVNULL) -- == 0 -- ) -- - def zypper_update(self, *packages): - self.zypper("update", *packages) -- -- def zypper_patterninstall(self, *packages): -- self.zypper("install", "-t", "pattern", *packages) -diff --git a/python/mozboot/mozboot/osx.py b/python/mozboot/mozboot/osx.py ---- a/python/mozboot/mozboot/osx.py -+++ b/python/mozboot/mozboot/osx.py -@@ -2,8 +2,6 @@ - # 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/. - --from __future__ import absolute_import, print_function, unicode_literals -- - import platform - import subprocess - import sys -@@ -14,11 +12,10 @@ try: - except ImportError: - from urllib.request import urlopen - --from packaging.version import Version -- -+from mach.util import to_optional_path, to_optional_str - from mozboot.base import BaseBootstrapper - from mozfile import which --from mach.util import to_optional_path, to_optional_str -+from packaging.version import Version - - HOMEBREW_BOOTSTRAP = ( - "https://raw.githubusercontent.com/Homebrew/install/master/install.sh" -@@ -166,21 +163,9 @@ class OSXBootstrapperLight(OSXAndroidBoo - def install_browser_artifact_mode_packages(self, mozconfig_builder): - pass - -- def ensure_node_packages(self): -- pass -- -- def ensure_stylo_packages(self): -- pass -- - def ensure_clang_static_analysis_package(self): - pass - -- def ensure_nasm_packages(self): -- pass -- -- def ensure_minidump_stackwalk_packages(self): -- self.install_toolchain_artifact("minidump-stackwalk") -- - - class OSXBootstrapper(OSXAndroidBootstrapper, BaseBootstrapper): - def __init__(self, version, **kwargs): -@@ -299,26 +284,9 @@ class OSXBootstrapper(OSXAndroidBootstra - def ensure_sccache_packages(self): - from mozboot import sccache - -- self.install_toolchain_artifact("sccache") - self.install_toolchain_artifact(sccache.RUSTC_DIST_TOOLCHAIN, no_unpack=True) - self.install_toolchain_artifact(sccache.CLANG_DIST_TOOLCHAIN, no_unpack=True) - -- def ensure_fix_stacks_packages(self): -- self.install_toolchain_artifact("fix-stacks") -- -- def ensure_stylo_packages(self): -- self.install_toolchain_artifact("clang") -- self.install_toolchain_artifact("cbindgen") -- -- def ensure_nasm_packages(self): -- self.install_toolchain_artifact("nasm") -- -- def ensure_node_packages(self): -- self.install_toolchain_artifact("node") -- -- def ensure_minidump_stackwalk_packages(self): -- self.install_toolchain_artifact("minidump-stackwalk") -- - def install_homebrew(self): - print(BREW_INSTALL) - bootstrap = urlopen(url=HOMEBREW_BOOTSTRAP, timeout=20).read() -diff --git a/python/mozboot/mozboot/rust.py b/python/mozboot/mozboot/rust.py ---- a/python/mozboot/mozboot/rust.py -+++ b/python/mozboot/mozboot/rust.py -@@ -2,16 +2,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/. - --from __future__ import absolute_import, print_function, unicode_literals -- - import platform as platform_mod - import sys - -- - # Base url for pulling the rustup installer. --# Use the no-CNAME host for compatibilty with Python 2.7 --# which doesn't support SNI. --RUSTUP_URL_BASE = "https://static-rust-lang-org.s3.amazonaws.com/rustup" -+RUSTUP_URL_BASE = "https://static.rust-lang.org/rustup" - - # Pull this to get the lastest stable version number. - RUSTUP_MANIFEST = RUSTUP_URL_BASE + "/release-stable.toml" -@@ -123,6 +118,7 @@ def rustup_latest_version(): - - def http_download_and_hash(url): - import hashlib -+ - import requests - - h = hashlib.sha256() -diff --git a/python/mozboot/mozboot/sccache.py b/python/mozboot/mozboot/sccache.py ---- a/python/mozboot/mozboot/sccache.py -+++ b/python/mozboot/mozboot/sccache.py -@@ -2,8 +2,6 @@ - # 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/. - --from __future__ import absolute_import, print_function, unicode_literals -- - # sccache-dist currently expects clients to provide toolchains when - # distributing from macOS or Windows, so we download linux binaries capable - # of cross-compiling for these cases. -diff --git a/python/mozboot/mozboot/solus.py b/python/mozboot/mozboot/solus.py ---- a/python/mozboot/mozboot/solus.py -+++ b/python/mozboot/mozboot/solus.py -@@ -2,73 +2,19 @@ - # 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/. - --from __future__ import absolute_import, print_function, unicode_literals -- --import sys --import subprocess -- - from mozboot.base import BaseBootstrapper - from mozboot.linux_common import LinuxBootstrapper - --# NOTE: This script is intended to be run with a vanilla Python install. We --# have to rely on the standard library instead of Python 2+3 helpers like --# the six module. --if sys.version_info < (3,): -- input = raw_input # noqa -- - - class SolusBootstrapper(LinuxBootstrapper, BaseBootstrapper): - """Solus experimental bootstrapper.""" - -- SYSTEM_PACKAGES = ["unzip", "zip"] -- SYSTEM_COMPONENTS = ["system.devel"] -- -- BROWSER_PACKAGES = [ -- "alsa-lib", -- "dbus", -- "libgtk-3", -- "libevent", -- "libvpx", -- "libxt", -- "libstartup-notification", -- "gst-plugins-base", -- "gst-plugins-good", -- "pulseaudio", -- "xorg-server-xvfb", -- ] -- -- MOBILE_ANDROID_COMMON_PACKAGES = [ -- # See comment about 32 bit binaries and multilib below. -- "ncurses-32bit", -- "readline-32bit", -- "zlib-32bit", -- ] -- - def __init__(self, version, dist_id, **kwargs): - print("Using an experimental bootstrapper for Solus.") - BaseBootstrapper.__init__(self, **kwargs) - -- def install_system_packages(self): -- self.package_install(*self.SYSTEM_PACKAGES) -- self.component_install(*self.SYSTEM_COMPONENTS) -- -- def install_browser_packages(self, mozconfig_builder, artifact_mode=False): -- self.package_install(*self.BROWSER_PACKAGES) -- -- def install_browser_artifact_mode_packages(self, mozconfig_builder): -- self.install_browser_packages(mozconfig_builder, artifact_mode=True) -- -- def install_mobile_android_packages(self, mozconfig_builder, artifact_mode=False): -- try: -- self.package_install(*self.MOBILE_ANDROID_COMMON_PACKAGES) -- except Exception as e: -- print("Failed to install all packages!") -- raise e -- -- # 2. Android pieces. -- super().install_mobile_android_packages( -- mozconfig_builder, artifact_mode=artifact_mode -- ) -+ def install_packages(self, packages): -+ self.package_install(*packages) - - def _update_package_manager(self): - pass -@@ -84,15 +30,3 @@ class SolusBootstrapper(LinuxBootstrappe - command.extend(packages) - - self.run_as_root(command) -- -- def component_install(self, *components): -- command = ["eopkg", "install", "-c"] -- if self.no_interactive: -- command.append("--yes-all") -- -- command.extend(components) -- -- self.run_as_root(command) -- -- def run(self, command, env=None): -- subprocess.check_call(command, stdin=sys.stdin, env=env) -diff --git a/python/mozboot/mozboot/static_analysis.py b/python/mozboot/mozboot/static_analysis.py ---- a/python/mozboot/mozboot/static_analysis.py -+++ b/python/mozboot/mozboot/static_analysis.py -@@ -2,8 +2,6 @@ - # 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/. - --from __future__ import absolute_import, print_function, unicode_literals -- - WINDOWS_CLANG_TIDY = "win64-clang-tidy" - LINUX_CLANG_TIDY = "linux64-clang-tidy" - MACOS_CLANG_TIDY = "macosx64-clang-tidy" -diff --git a/python/mozboot/mozboot/util.py b/python/mozboot/mozboot/util.py ---- a/python/mozboot/mozboot/util.py -+++ b/python/mozboot/mozboot/util.py -@@ -2,27 +2,14 @@ - # 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/. - --from __future__ import absolute_import, print_function, unicode_literals -- - import hashlib - import os --import sys -- - from pathlib import Path -+from urllib.request import urlopen - - from mach.site import PythonVirtualenv - from mach.util import get_state_dir - --# NOTE: This script is intended to be run with a vanilla Python install. We --# have to rely on the standard library instead of Python 2+3 helpers like --# the six module. --if sys.version_info < (3,): -- from urllib2 import urlopen -- -- input = raw_input # noqa --else: -- from urllib.request import urlopen -- - MINIMUM_RUST_VERSION = "1.63.0" - - -diff --git a/python/mozboot/mozboot/void.py b/python/mozboot/mozboot/void.py ---- a/python/mozboot/mozboot/void.py -+++ b/python/mozboot/mozboot/void.py -@@ -2,31 +2,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/. - --from __future__ import absolute_import, print_function, unicode_literals -- --import os --import subprocess --import sys -- - from mozboot.base import BaseBootstrapper - from mozboot.linux_common import LinuxBootstrapper - - - class VoidBootstrapper(LinuxBootstrapper, BaseBootstrapper): -- -- PACKAGES = ["clang", "make", "mercurial", "watchman", "unzip", "zip"] -- -- BROWSER_PACKAGES = [ -- "dbus-devel", -- "dbus-glib-devel", -- "gtk+3-devel", -- "pulseaudio", -- "pulseaudio-devel", -- "libcurl-devel", -- "libxcb-devel", -- "libXt-devel", -- ] -- - def __init__(self, version, dist_id, **kwargs): - BaseBootstrapper.__init__(self, **kwargs) - -@@ -34,18 +14,10 @@ class VoidBootstrapper(LinuxBootstrapper - self.version = version - self.dist_id = dist_id - -- self.packages = self.PACKAGES -- self.browser_packages = self.BROWSER_PACKAGES -- - def run_as_root(self, command): - # VoidLinux doesn't support users sudo'ing most commands by default because of the group - # configuration. -- if os.geteuid() != 0: -- command = ["su", "root", "-c", " ".join(command)] -- -- print("Executing as root:", subprocess.list2cmdline(command)) -- -- subprocess.check_call(command, stdin=sys.stdin) -+ super().run_as_root(command, may_use_sudo=False) - - def xbps_install(self, *packages): - command = ["xbps-install"] -@@ -62,14 +34,8 @@ class VoidBootstrapper(LinuxBootstrapper - - self.run_as_root(command) - -- def install_system_packages(self): -- self.xbps_install(*self.packages) -- -- def install_browser_packages(self, mozconfig_builder, artifact_mode=False): -- self.xbps_install(*self.browser_packages) -- -- def install_browser_artifact_mode_packages(self, mozconfig_builder): -- self.install_browser_packages(mozconfig_builder, artifact_mode=True) -+ def install_packages(self, packages): -+ self.xbps_install(*packages) - - def _update_package_manager(self): - self.xbps_update() -diff --git a/python/mozboot/mozboot/windows.py b/python/mozboot/mozboot/windows.py ---- a/python/mozboot/mozboot/windows.py -+++ b/python/mozboot/mozboot/windows.py -@@ -2,12 +2,10 @@ - # 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/. - --from __future__ import absolute_import, print_function, unicode_literals -- - import ctypes - import os -+import subprocess - import sys --import subprocess - - from mozboot.base import BaseBootstrapper - from mozfile import which -@@ -50,7 +48,6 @@ class WindowsBootstrapper(BaseBootstrapp - "patchutils", - "diffutils", - "tar", -- "zip", - "unzip", - "mingw-w64-x86_64-toolchain", # TODO: Remove when Mercurial is installable from a wheel. - "mingw-w64-i686-toolchain", -@@ -106,25 +103,6 @@ class WindowsBootstrapper(BaseBootstrapp - - self.install_toolchain_static_analysis(static_analysis.WINDOWS_CLANG_TIDY) - -- def ensure_stylo_packages(self): -- # On-device artifact builds are supported; on-device desktop builds are not. -- if is_aarch64_host(): -- raise Exception( -- "You should not be performing desktop builds on an " -- "AArch64 device. If you want to do artifact builds " -- "instead, please choose the appropriate artifact build " -- "option when beginning bootstrap." -- ) -- -- self.install_toolchain_artifact("clang") -- self.install_toolchain_artifact("cbindgen") -- -- def ensure_nasm_packages(self): -- self.install_toolchain_artifact("nasm") -- -- def ensure_node_packages(self): -- self.install_toolchain_artifact("node") -- - def _update_package_manager(self): - self.pacman_update() - -diff --git a/python/mozbuild/mozbuild/action/langpack_manifest.py b/python/mozbuild/mozbuild/action/langpack_manifest.py ---- a/python/mozbuild/mozbuild/action/langpack_manifest.py -+++ b/python/mozbuild/mozbuild/action/langpack_manifest.py -@@ -4,28 +4,30 @@ - - ### - # This script generates a web manifest JSON file based on the xpi-stage --# directory structure. It extracts the data from defines.inc files from --# the locale directory, chrome registry entries and other information --# necessary to produce the complete manifest file for a language pack. -+# directory structure. It extracts data necessary to produce the complete -+# manifest file for a language pack: -+# from the `langpack-manifest.ftl` file in the locale directory; -+# from chrome registry entries; -+# and from other information in the `xpi-stage` directory. - ### -+ - from __future__ import absolute_import, print_function, unicode_literals - - import argparse --import sys --import os --import json -+import datetime - import io --import datetime --import requests --import mozversioncontrol -+import json -+import logging -+import os -+import sys -+ -+import fluent.syntax.ast as FTL - import mozpack.path as mozpath --from mozpack.chrome.manifest import ( -- Manifest, -- ManifestLocale, -- parse_manifest, --) -+import mozversioncontrol -+import requests -+from fluent.syntax.parser import FluentParser - from mozbuild.configure.util import Version --from mozbuild.preprocessor import Preprocessor -+from mozpack.chrome.manifest import Manifest, ManifestLocale, parse_manifest - - - def write_file(path, content): -@@ -112,53 +114,89 @@ def get_timestamp_for_locale(path): - - - ### --# Parses multiple defines files into a single key-value pair object. -+# Parses an FTL file into a key-value pair object. -+# Does not support attributes, terms, variables, functions or selectors; -+# only messages with values consisting of text elements and literals. - # - # Args: --# paths (str) - a comma separated list of paths to defines files -+# path (str) - a path to an FTL file - # - # Returns: --# (dict) - a key-value dict with defines -+# (dict) - A mapping of message keys to formatted string values. -+# Empty if the file at `path` was not found. - # - # Example: --# res = parse_defines('./toolkit/defines.inc,./browser/defines.inc') -+# res = parse_flat_ftl('./browser/langpack-metadata.ftl') - # res == { --# 'MOZ_LANG_TITLE': 'Polski', --# 'MOZ_LANGPACK_CREATOR': 'Aviary.pl', --# 'MOZ_LANGPACK_CONTRIBUTORS': 'Marek Stepien, Marek Wawoczny' -+# 'langpack-title': 'Polski', -+# 'langpack-creator': 'mozilla.org', -+# 'langpack-contributors': 'Joe Solon, Suzy Solon' - # } - ### --def parse_defines(paths): -- pp = Preprocessor() -- for path in paths: -- pp.do_include(path) -+def parse_flat_ftl(path): -+ parser = FluentParser(with_spans=False) -+ try: -+ with open(path, encoding="utf-8") as file: -+ res = parser.parse(file.read()) -+ except FileNotFoundError as err: -+ logging.warning(err) -+ return {} - -- return pp.context -+ result = {} -+ for entry in res.body: -+ if isinstance(entry, FTL.Message) and isinstance(entry.value, FTL.Pattern): -+ flat = "" -+ for elem in entry.value.elements: -+ if isinstance(elem, FTL.TextElement): -+ flat += elem.value -+ elif isinstance(elem.expression, FTL.Literal): -+ flat += elem.expression.parse()["value"] -+ else: -+ name = type(elem.expression).__name__ -+ raise Exception(f"Unsupported {name} for {entry.id.name} in {path}") -+ result[entry.id.name] = flat.strip() -+ return result - - --### --# Converts the list of contributors from the old RDF based list --# of entries, into a comma separated list. -+## -+# Generates the title and description for the langpack. -+# -+# Uses data stored in a JSON file next to this source, -+# which is expected to have the following format: -+# Record -+# -+# If an English name is given and is different from the native one, -+# it will be included parenthetically in the title. -+# -+# NOTE: If you're updating the native locale names, -+# you should also update the data in -+# toolkit/components/mozintl/mozIntl.sys.mjs. - # - # Args: --# str (str) - a string with an RDF list of contributors entries -+# app (str) - Application name -+# locale (str) - Locale identifier - # - # Returns: --# (str) - a comma separated list of contributors -+# (str, str) - Tuple of title and description - # --# Example: --# s = convert_contributors(' --# Marek Wawoczny --# Marek Stepien --# ') --# s == 'Marek Wawoczny, Marek Stepien' - ### --def convert_contributors(str): -- str = str.replace("", "") -- tokens = str.split("") -- tokens = map(lambda t: t.strip(), tokens) -- tokens = filter(lambda t: t != "", tokens) -- return ", ".join(tokens) -+def get_title_and_description(app, locale): -+ dir = os.path.dirname(__file__) -+ with open(os.path.join(dir, "langpack_localeNames.json"), encoding="utf-8") as nf: -+ names = json.load(nf) -+ if locale in names: -+ data = names[locale] -+ native = data["native"] -+ english = data["english"] if "english" in data else native -+ titleName = f"{native} ({english})" if english != native else native -+ descName = f"{native} ({locale})" -+ else: -+ titleName = locale -+ descName = locale -+ -+ title = f"Language Pack: {titleName}" -+ description = f"{app} Language Pack for {descName}" -+ return title, description - - - ### -@@ -166,26 +204,25 @@ def convert_contributors(str): - # and optionally adding the list of contributors, if provided. - # - # Args: --# author (str) - a string with the name of the author --# contributors (str) - RDF based list of contributors from a chrome manifest -+# ftl (dict) - a key-value mapping of locale-specific strings - # - # Returns: - # (str) - a string to be placed in the author field of the manifest.json - # - # Example: --# s = build_author_string( --# 'Aviary.pl', --# ' --# Marek Wawoczny --# Marek Stepien --# ') --# s == 'Aviary.pl (contributors: Marek Wawoczny, Marek Stepien)' -+# s = get_author({ -+# 'langpack-creator': 'mozilla.org', -+# 'langpack-contributors': 'Joe Solon, Suzy Solon' -+# }) -+# s == 'mozilla.org (contributors: Joe Solon, Suzy Solon)' - ### --def build_author_string(author, contributors): -- contrib = convert_contributors(contributors) -- if len(contrib) == 0: -+def get_author(ftl): -+ author = ftl["langpack-creator"] if "langpack-creator" in ftl else "mozilla.org" -+ contrib = ftl["langpack-contributors"] if "langpack-contributors" in ftl else "" -+ if contrib: -+ return f"{author} (contributors: {contrib})" -+ else: - return author -- return "{0} (contributors: {1})".format(author, contrib) - - - ## -@@ -333,7 +370,7 @@ def get_version_maybe_buildid(version): - # resources are for - # app_name (str) - The name of the application the language - # resources are for --# defines (dict) - A dictionary of defines entries -+# ftl (dict) - A dictionary of locale-specific strings - # chrome_entries (dict) - A dictionary of chrome registry entries - # - # Returns: -@@ -346,7 +383,7 @@ def get_version_maybe_buildid(version): - # '57.0.*', - # 'Firefox', - # '/var/vcs/l10n-central', --# {'MOZ_LANG_TITLE': 'Polski'}, -+# {'langpack-title': 'Polski'}, - # chrome_entries - # ) - # manifest == { -@@ -392,18 +429,13 @@ def create_webmanifest( - app_name, - l10n_basedir, - langpack_eid, -- defines, -+ ftl, - chrome_entries, - ): - locales = list(map(lambda loc: loc.strip(), locstr.split(","))) - main_locale = locales[0] -- -- author = build_author_string( -- defines["MOZ_LANGPACK_CREATOR"], -- defines["MOZ_LANGPACK_CONTRIBUTORS"] -- if "MOZ_LANGPACK_CONTRIBUTORS" in defines -- else "", -- ) -+ title, description = get_title_and_description(app_name, main_locale) -+ author = get_author(ftl) - - manifest = { - "langpack_id": main_locale, -@@ -415,8 +447,8 @@ def create_webmanifest( - "strict_max_version": max_app_ver, - } - }, -- "name": "{0} Language Pack".format(defines["MOZ_LANG_TITLE"]), -- "description": "Language pack for {0} for {1}".format(app_name, main_locale), -+ "name": title, -+ "description": description, - "version": get_version_maybe_buildid(version), - "languages": {}, - "sources": {"browser": {"base_path": "browser/"}}, -@@ -466,10 +498,8 @@ def main(args): - "--langpack-eid", help="Language pack id to use for this locale" - ) - parser.add_argument( -- "--defines", -- default=[], -- nargs="+", -- help="List of defines files to load data from", -+ "--metadata", -+ help="FTL file defining langpack metadata", - ) - parser.add_argument("--input", help="Langpack directory.") - -@@ -480,7 +510,7 @@ def main(args): - os.path.join(args.input, "chrome.manifest"), args.input, chrome_entries - ) - -- defines = parse_defines(args.defines) -+ ftl = parse_flat_ftl(args.metadata) - - # Mangle the app version to set min version (remove patch level) - min_app_version = args.app_version -@@ -502,7 +532,7 @@ def main(args): - args.app_name, - args.l10n_basedir, - args.langpack_eid, -- defines, -+ ftl, - chrome_entries, - ) - write_file(os.path.join(args.input, "manifest.json"), res) -diff --git a/python/mozbuild/mozbuild/action/make_dmg.py b/python/mozbuild/mozbuild/action/make_dmg.py ---- a/python/mozbuild/mozbuild/action/make_dmg.py -+++ b/python/mozbuild/mozbuild/action/make_dmg.py -@@ -2,13 +2,16 @@ - # 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/. - --from __future__ import absolute_import, print_function -+import argparse -+import platform -+import sys -+from pathlib import Path - -+from mozbuild.bootstrap import bootstrap_toolchain - from mozbuild.repackaging.application_ini import get_application_ini_value - from mozpack import dmg - --import argparse --import sys -+is_linux = platform.system() == "Linux" - - - def main(args): -@@ -41,7 +44,20 @@ def main(args): - options.inpath, "App", "CodeName", fallback="Name" - ) - -- dmg.create_dmg(options.inpath, options.dmgfile, volume_name, extra_files) -+ # Resolve required tools -+ dmg_tool = bootstrap_toolchain("dmg/dmg") -+ hfs_tool = bootstrap_toolchain("dmg/hfsplus") -+ mkfshfs_tool = bootstrap_toolchain("hfsplus/newfs_hfs") -+ -+ dmg.create_dmg( -+ source_directory=Path(options.inpath), -+ output_dmg=Path(options.dmgfile), -+ volume_name=volume_name, -+ extra_files=extra_files, -+ dmg_tool=dmg_tool, -+ hfs_tool=hfs_tool, -+ mkfshfs_tool=mkfshfs_tool, -+ ) - - return 0 - -diff --git a/python/mozbuild/mozbuild/action/unpack_dmg.py b/python/mozbuild/mozbuild/action/unpack_dmg.py ---- a/python/mozbuild/mozbuild/action/unpack_dmg.py -+++ b/python/mozbuild/mozbuild/action/unpack_dmg.py -@@ -2,12 +2,18 @@ - # 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/. - --from __future__ import absolute_import, print_function -+import argparse -+import sys -+from pathlib import Path - -+from mozbuild.bootstrap import bootstrap_toolchain - from mozpack import dmg - --import argparse --import sys -+ -+def _path_or_none(input: str): -+ if not input: -+ return None -+ return Path(input) - - - def main(args): -@@ -26,12 +32,17 @@ def main(args): - - options = parser.parse_args(args) - -+ dmg_tool = bootstrap_toolchain("dmg/dmg") -+ hfs_tool = bootstrap_toolchain("dmg/hfsplus") -+ - dmg.extract_dmg( -- dmgfile=options.dmgfile, -- output=options.outpath, -- dsstore=options.dsstore, -- background=options.background, -- icon=options.icon, -+ dmgfile=Path(options.dmgfile), -+ output=Path(options.outpath), -+ dmg_tool=Path(dmg_tool), -+ hfs_tool=Path(hfs_tool), -+ dsstore=_path_or_none(options.dsstore), -+ background=_path_or_none(options.background), -+ icon=_path_or_none(options.icon), - ) - return 0 - -diff --git a/python/mozbuild/mozbuild/artifacts.py b/python/mozbuild/mozbuild/artifacts.py ---- a/python/mozbuild/mozbuild/artifacts.py -+++ b/python/mozbuild/mozbuild/artifacts.py -@@ -129,7 +129,6 @@ class ArtifactJob(object): - ("bin/http3server", ("bin", "bin")), - ("bin/plugins/gmp-*/*/*", ("bin/plugins", "bin")), - ("bin/plugins/*", ("bin/plugins", "plugins")), -- ("bin/components/*.xpt", ("bin/components", "bin/components")), - } - - # We can tell our input is a test archive by this suffix, which happens to -@@ -137,6 +136,32 @@ class ArtifactJob(object): - _test_zip_archive_suffix = ".common.tests.zip" - _test_tar_archive_suffix = ".common.tests.tar.gz" - -+ # A map of extra archives to fetch and unpack. An extra archive might -+ # include optional build output to incorporate into the local artifact -+ # build. Test archives and crashreporter symbols could be extra archives -+ # but they require special handling; this mechanism is generic and intended -+ # only for the simplest cases. -+ # -+ # Each suffix key matches a candidate archive (i.e., an artifact produced by -+ # an upstream build). Each value is itself a dictionary that must contain -+ # the following keys: -+ # -+ # - `description`: a purely informational string description. -+ # - `src_prefix`: entry names in the archive with leading `src_prefix` will -+ # have the prefix stripped. -+ # - `dest_prefix`: entry names in the archive will have `dest_prefix` -+ # prepended. -+ # -+ # The entries in the archive, suitably renamed, will be extracted into `dist`. -+ _extra_archives = { -+ ".xpt_artifacts.zip": { -+ "description": "XPT Artifacts", -+ "src_prefix": "", -+ "dest_prefix": "xpt_artifacts", -+ }, -+ } -+ _extra_archive_suffixes = tuple(sorted(_extra_archives.keys())) -+ - def __init__( - self, - log=None, -@@ -190,6 +215,8 @@ class ArtifactJob(object): - self._symbols_archive_suffix - ): - yield name -+ elif name.endswith(ArtifactJob._extra_archive_suffixes): -+ yield name - else: - self.log( - logging.DEBUG, -@@ -222,6 +249,8 @@ class ArtifactJob(object): - self._symbols_archive_suffix - ): - return self.process_symbols_archive(filename, processed_filename) -+ if filename.endswith(ArtifactJob._extra_archive_suffixes): -+ return self.process_extra_archive(filename, processed_filename) - return self.process_package_artifact(filename, processed_filename) - - def process_package_artifact(self, filename, processed_filename): -@@ -373,6 +402,43 @@ class ArtifactJob(object): - ) - writer.add(destpath.encode("utf-8"), entry) - -+ def process_extra_archive(self, filename, processed_filename): -+ for suffix, extra_archive in ArtifactJob._extra_archives.items(): -+ if filename.endswith(suffix): -+ self.log( -+ logging.INFO, -+ "artifact", -+ {"filename": filename, "description": extra_archive["description"]}, -+ '"{filename}" is a recognized extra archive ({description})', -+ ) -+ break -+ else: -+ raise ValueError('"{}" is not a recognized extra archive!'.format(filename)) -+ -+ src_prefix = extra_archive["src_prefix"] -+ dest_prefix = extra_archive["dest_prefix"] -+ -+ with self.get_writer(file=processed_filename, compress_level=5) as writer: -+ for filename, entry in self.iter_artifact_archive(filename): -+ if not filename.startswith(src_prefix): -+ self.log( -+ logging.DEBUG, -+ "artifact", -+ {"filename": filename, "src_prefix": src_prefix}, -+ "Skipping extra archive item {filename} " -+ "that does not start with {src_prefix}", -+ ) -+ continue -+ destpath = mozpath.relpath(filename, src_prefix) -+ destpath = mozpath.join(dest_prefix, destpath) -+ self.log( -+ logging.INFO, -+ "artifact", -+ {"destpath": destpath}, -+ "Adding {destpath} to processed archive", -+ ) -+ writer.add(destpath.encode("utf-8"), entry) -+ - def iter_artifact_archive(self, filename): - if filename.endswith(".zip"): - reader = JarReader(filename) -@@ -1392,7 +1458,15 @@ https://firefox-source-docs.mozilla.org/ - {"processed_filename": processed_filename}, - "Writing processed {processed_filename}", - ) -- self._artifact_job.process_artifact(filename, processed_filename) -+ try: -+ self._artifact_job.process_artifact(filename, processed_filename) -+ except Exception as e: -+ # Delete the partial output of failed processing. -+ try: -+ os.remove(processed_filename) -+ except FileNotFoundError: -+ pass -+ raise e - - self._artifact_cache._persist_limit.register_file(processed_filename) - -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 -@@ -215,8 +215,8 @@ class BuildBackend(LoggingMixin): - invalidate the XUL cache (which includes some JS) at application - startup-time. The application checks for .purgecaches in the - application directory, which varies according to -- --enable-application. There's a further wrinkle on macOS, where -- the real application directory is part of a Cocoa bundle -+ --enable-application/--enable-project. There's a further wrinkle on -+ macOS, where the real application directory is part of a Cocoa bundle - produced from the regular application directory by the build - system. In this case, we write to both locations, since the - build system recreates the Cocoa bundle from the contents of the -diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py ---- a/python/mozbuild/mozbuild/backend/recursivemake.py -+++ b/python/mozbuild/mozbuild/backend/recursivemake.py -@@ -8,26 +8,24 @@ import io - import logging - import os - import re --import six -- - from collections import defaultdict, namedtuple - from itertools import chain - from operator import itemgetter --from six import StringIO - --from mozpack.manifests import InstallManifest - import mozpack.path as mozpath -- -+import six - from mozbuild import frontend - from mozbuild.frontend.context import ( - AbsolutePath, -+ ObjDirPath, - Path, - RenamedSourcePath, - SourcePath, -- ObjDirPath, - ) --from .common import CommonBackend --from .make import MakeBackend -+from mozbuild.shellutil import quote as shell_quote -+from mozpack.manifests import InstallManifest -+from six import StringIO -+ - from ..frontend.data import ( - BaseLibrary, - BaseProgram, -@@ -46,6 +44,7 @@ from ..frontend.data import ( - HostLibrary, - HostProgram, - HostRustProgram, -+ HostSharedLibrary, - HostSimpleProgram, - HostSources, - InstallationTarget, -@@ -58,7 +57,6 @@ from ..frontend.data import ( - ObjdirPreprocessedFiles, - PerSourceFlag, - Program, -- HostSharedLibrary, - RustProgram, - RustTests, - SandboxedWasmLibrary, -@@ -71,9 +69,10 @@ from ..frontend.data import ( - WasmSources, - XPIDLModule, - ) --from ..util import ensureParentDir, FileAvoidWrite, OrderedDefaultDict, pairwise - from ..makeutil import Makefile --from mozbuild.shellutil import quote as shell_quote -+from ..util import FileAvoidWrite, OrderedDefaultDict, ensureParentDir, pairwise -+from .common import CommonBackend -+from .make import MakeBackend - - # To protect against accidentally adding logic to Makefiles that belong in moz.build, - # we check if moz.build-like variables are defined in Makefiles. If they are, we throw -@@ -367,7 +366,6 @@ class RecursiveMakeBackend(MakeBackend): - self._traversal = RecursiveMakeTraversal() - self._compile_graph = OrderedDefaultDict(set) - self._rust_targets = set() -- self._rust_lib_targets = set() - self._gkrust_target = None - self._pre_compile = set() - -@@ -611,7 +609,6 @@ class RecursiveMakeBackend(MakeBackend): - build_target = self._build_target_for_obj(obj) - self._compile_graph[build_target] - self._rust_targets.add(build_target) -- self._rust_lib_targets.add(build_target) - if obj.is_gkrust: - self._gkrust_target = build_target - -@@ -774,7 +771,6 @@ class RecursiveMakeBackend(MakeBackend): - # on other directories in the tree, so putting them first here will - # start them earlier in the build. - rust_roots = sorted(r for r in roots if r in self._rust_targets) -- rust_libs = sorted(r for r in roots if r in self._rust_lib_targets) - if category == "compile" and rust_roots: - rust_rule = root_deps_mk.create_rule(["recurse_rust"]) - rust_rule.add_dependencies(rust_roots) -@@ -786,7 +782,7 @@ class RecursiveMakeBackend(MakeBackend): - # builds. - for prior_target, target in pairwise( - sorted( -- [t for t in rust_libs], key=lambda t: t != self._gkrust_target -+ [t for t in rust_roots], key=lambda t: t != self._gkrust_target - ) - ): - r = root_deps_mk.create_rule([target]) -@@ -1201,8 +1197,9 @@ class RecursiveMakeBackend(MakeBackend): - self, obj, backend_file, target_variable, target_cargo_variable - ): - backend_file.write_once("CARGO_FILE := %s\n" % obj.cargo_file) -- backend_file.write_once("CARGO_TARGET_DIR := .\n") -- backend_file.write("%s += %s\n" % (target_variable, obj.location)) -+ target_dir = mozpath.normpath(backend_file.environment.topobjdir) -+ backend_file.write_once("CARGO_TARGET_DIR := %s\n" % target_dir) -+ backend_file.write("%s += $(DEPTH)/%s\n" % (target_variable, obj.location)) - backend_file.write("%s += %s\n" % (target_cargo_variable, obj.name)) - - def _process_rust_program(self, obj, backend_file): -diff --git a/python/mozbuild/mozbuild/bootstrap.py b/python/mozbuild/mozbuild/bootstrap.py ---- a/python/mozbuild/mozbuild/bootstrap.py -+++ b/python/mozbuild/mozbuild/bootstrap.py -@@ -2,16 +2,16 @@ - # 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/. - --from mozbuild.configure import ConfigureSandbox --from pathlib import Path - import functools - import io - import logging - import os -+from pathlib import Path -+ -+from mozbuild.configure import ConfigureSandbox - - --@functools.lru_cache(maxsize=None) --def _bootstrap_sandbox(): -+def _raw_sandbox(extra_args=[]): - # Here, we don't want an existing mozconfig to interfere with what we - # do, neither do we want the default for --enable-bootstrap (which is not - # always on) to prevent this from doing something. -@@ -22,9 +22,17 @@ def _bootstrap_sandbox(): - logger.propagate = False - sandbox = ConfigureSandbox( - {}, -- argv=["configure", "--enable-bootstrap", f"MOZCONFIG={os.devnull}"], -+ argv=["configure"] -+ + extra_args -+ + ["--enable-bootstrap", f"MOZCONFIG={os.devnull}"], - logger=logger, - ) -+ return sandbox -+ -+ -+@functools.lru_cache(maxsize=None) -+def _bootstrap_sandbox(): -+ sandbox = _raw_sandbox() - moz_configure = ( - Path(__file__).parent.parent.parent.parent / "build" / "moz.configure" - ) -@@ -42,3 +50,12 @@ def bootstrap_toolchain(toolchain_job): - # Returns the path to the toolchain. - sandbox = _bootstrap_sandbox() - return sandbox._value_for(sandbox["bootstrap_path"](toolchain_job)) -+ -+ -+def bootstrap_all_toolchains_for(configure_args=[]): -+ sandbox = _raw_sandbox(configure_args) -+ moz_configure = Path(__file__).parent.parent.parent.parent / "moz.configure" -+ sandbox.include_file(str(moz_configure)) -+ for depend in sandbox._depends.values(): -+ if depend.name == "bootstrap_path": -+ depend.result() -diff --git a/python/mozbuild/mozbuild/controller/building.py b/python/mozbuild/mozbuild/controller/building.py ---- a/python/mozbuild/mozbuild/controller/building.py -+++ b/python/mozbuild/mozbuild/controller/building.py -@@ -765,11 +765,11 @@ class StaticAnalysisFooter(Footer): - processed = monitor.num_files_processed - percent = "(%.2f%%)" % (processed * 100.0 / total) - parts = [ -- ("dim", "Processing"), -+ ("bright_black", "Processing"), - ("yellow", str(processed)), -- ("dim", "of"), -+ ("bright_black", "of"), - ("yellow", str(total)), -- ("dim", "files"), -+ ("bright_black", "files"), - ("green", percent), - ] - if monitor.current_file: -diff --git a/python/mozbuild/mozbuild/frontend/gyp_reader.py b/python/mozbuild/mozbuild/frontend/gyp_reader.py ---- a/python/mozbuild/mozbuild/frontend/gyp_reader.py -+++ b/python/mozbuild/mozbuild/frontend/gyp_reader.py -@@ -4,18 +4,20 @@ - - from __future__ import absolute_import, print_function, unicode_literals - -+import os -+import sys -+import time -+ - import gyp - import gyp.msvs_emulation -+import mozpack.path as mozpath - import six --import sys --import os --import time -+from mozbuild import shellutil -+from mozbuild.util import expand_variables -+from mozpack.files import FileFinder - --import mozpack.path as mozpath --from mozpack.files import FileFinder -+from .context import VARIABLES, ObjDirPath, SourcePath, TemplateContext - from .sandbox import alphabetical_sorted --from .context import ObjDirPath, SourcePath, TemplateContext, VARIABLES --from mozbuild.util import expand_variables - - # Define this module as gyp.generator.mozbuild so that gyp can use it - # as a generator under the name "mozbuild". -@@ -443,6 +445,12 @@ class GypProcessor(object): - "build_files": [path], - "root_targets": None, - } -+ # The NSS gyp configuration uses CC and CFLAGS to determine the -+ # floating-point ABI on arm. -+ os.environ.update( -+ CC=config.substs["CC"], -+ CFLAGS=shellutil.quote(*config.substs["CC_BASE_FLAGS"]), -+ ) - - if gyp_dir_attrs.no_chromium: - includes = [] -diff --git a/python/mozbuild/mozbuild/generated_sources.py b/python/mozbuild/mozbuild/generated_sources.py ---- a/python/mozbuild/mozbuild/generated_sources.py -+++ b/python/mozbuild/mozbuild/generated_sources.py -@@ -8,8 +8,10 @@ import hashlib - import json - import os - -+import mozpack.path as mozpath - from mozpack.files import FileFinder --import mozpack.path as mozpath -+ -+GENERATED_SOURCE_EXTS = (".rs", ".c", ".h", ".cc", ".cpp") - - - def sha512_digest(data): -@@ -56,7 +58,7 @@ def get_generated_sources(): - base = mozpath.join(buildconfig.substs["RUST_TARGET"], rust_build_kind, "build") - finder = FileFinder(mozpath.join(buildconfig.topobjdir, base)) - for p, f in finder: -- if p.endswith((".rs", ".c", ".h", ".cc", ".cpp")): -+ if p.endswith(GENERATED_SOURCE_EXTS): - yield mozpath.join(base, p), f - - -diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py ---- a/python/mozbuild/mozbuild/mach_commands.py -+++ b/python/mozbuild/mozbuild/mach_commands.py -@@ -5,6 +5,7 @@ - from __future__ import absolute_import, print_function, unicode_literals - - import argparse -+import errno - import itertools - import json - import logging -@@ -17,26 +18,20 @@ import subprocess - import sys - import tempfile - import time --import errno -+from pathlib import Path - - import mozbuild.settings # noqa need @SettingsProvider hook to execute - import mozpack.path as mozpath -- --from pathlib import Path - from mach.decorators import ( -+ Command, - CommandArgument, - CommandArgumentGroup, -- Command, - SettingsProvider, - SubCommand, - ) -- --from mozbuild.base import ( -- BinaryNotFoundException, -- BuildEnvironmentNotFoundException, -- MachCommandConditions as conditions, -- MozbuildObject, --) -+from mozbuild.base import BinaryNotFoundException, BuildEnvironmentNotFoundException -+from mozbuild.base import MachCommandConditions as conditions -+from mozbuild.base import MozbuildObject - from mozbuild.util import MOZBUILD_METRICS_PATH - - here = os.path.abspath(os.path.dirname(__file__)) -@@ -217,6 +212,114 @@ def check( - - @SubCommand( - "cargo", -+ "udeps", -+ description="Run `cargo udeps` on a given crate. Defaults to gkrust.", -+ metrics_path=MOZBUILD_METRICS_PATH, -+) -+@CommandArgument( -+ "--all-crates", -+ action="store_true", -+ help="Check all of the crates in the tree.", -+) -+@CommandArgument("crates", default=None, nargs="*", help="The crate name(s) to check.") -+@CommandArgument( -+ "--jobs", -+ "-j", -+ default="0", -+ nargs="?", -+ metavar="jobs", -+ type=int, -+ help="Run the tests in parallel using multiple processes.", -+) -+@CommandArgument("-v", "--verbose", action="store_true", help="Verbose output.") -+@CommandArgument( -+ "--message-format-json", -+ action="store_true", -+ help="Emit error messages as JSON.", -+) -+@CommandArgument( -+ "--expect-unused", -+ action="store_true", -+ help="Do not return an error exit code if udeps detects unused dependencies.", -+) -+def udeps( -+ command_context, -+ all_crates=None, -+ crates=None, -+ jobs=0, -+ verbose=False, -+ message_format_json=False, -+ expect_unused=False, -+): -+ from mozbuild.controller.building import BuildDriver -+ -+ command_context.log_manager.enable_all_structured_loggers() -+ -+ try: -+ command_context.config_environment -+ except BuildEnvironmentNotFoundException: -+ build = command_context._spawn(BuildDriver) -+ ret = build.build( -+ command_context.metrics, -+ what=["pre-export", "export"], -+ jobs=jobs, -+ verbose=verbose, -+ mach_context=command_context._mach_context, -+ ) -+ if ret != 0: -+ return ret -+ # XXX duplication with `mach vendor rust` -+ crates_and_roots = { -+ "gkrust": "toolkit/library/rust", -+ "gkrust-gtest": "toolkit/library/gtest/rust", -+ "geckodriver": "testing/geckodriver", -+ } -+ -+ if all_crates: -+ crates = crates_and_roots.keys() -+ elif not crates: -+ crates = ["gkrust"] -+ -+ for crate in crates: -+ root = crates_and_roots.get(crate, None) -+ if not root: -+ print( -+ "Cannot locate crate %s. Please check your spelling or " -+ "add the crate information to the list." % crate -+ ) -+ return 1 -+ -+ udeps_targets = [ -+ "force-cargo-library-udeps", -+ "force-cargo-host-library-udeps", -+ "force-cargo-program-udeps", -+ "force-cargo-host-program-udeps", -+ ] -+ -+ append_env = {} -+ if message_format_json: -+ append_env["USE_CARGO_JSON_MESSAGE_FORMAT"] = "1" -+ if expect_unused: -+ append_env["CARGO_UDEPS_EXPECT_ERR"] = "1" -+ -+ ret = command_context._run_make( -+ srcdir=False, -+ directory=root, -+ ensure_exit_code=0, -+ silent=not verbose, -+ print_directory=False, -+ target=udeps_targets, -+ num_jobs=jobs, -+ append_env=append_env, -+ ) -+ if ret != 0: -+ return ret -+ -+ return 0 -+ -+ -+@SubCommand( -+ "cargo", - "vet", - description="Run `cargo vet`.", - ) -@@ -278,6 +381,209 @@ def cargo_vet(command_context, arguments - return res if stdout else res.returncode - - -+@SubCommand( -+ "cargo", -+ "clippy", -+ description="Run `cargo clippy` on a given crate. Defaults to gkrust.", -+ metrics_path=MOZBUILD_METRICS_PATH, -+) -+@CommandArgument( -+ "--all-crates", -+ default=None, -+ action="store_true", -+ help="Check all of the crates in the tree.", -+) -+@CommandArgument("crates", default=None, nargs="*", help="The crate name(s) to check.") -+@CommandArgument( -+ "--jobs", -+ "-j", -+ default="0", -+ nargs="?", -+ metavar="jobs", -+ type=int, -+ help="Run the tests in parallel using multiple processes.", -+) -+@CommandArgument("-v", "--verbose", action="store_true", help="Verbose output.") -+@CommandArgument( -+ "--message-format-json", -+ action="store_true", -+ help="Emit error messages as JSON.", -+) -+def clippy( -+ command_context, -+ all_crates=None, -+ crates=None, -+ jobs=0, -+ verbose=False, -+ message_format_json=False, -+): -+ from mozbuild.controller.building import BuildDriver -+ -+ command_context.log_manager.enable_all_structured_loggers() -+ -+ try: -+ command_context.config_environment -+ except BuildEnvironmentNotFoundException: -+ build = command_context._spawn(BuildDriver) -+ ret = build.build( -+ command_context.metrics, -+ what=["pre-export", "export"], -+ jobs=jobs, -+ verbose=verbose, -+ mach_context=command_context._mach_context, -+ ) -+ if ret != 0: -+ return ret -+ # XXX duplication with `mach vendor rust` -+ crates_and_roots = { -+ "gkrust": "toolkit/library/rust", -+ "gkrust-gtest": "toolkit/library/gtest/rust", -+ "geckodriver": "testing/geckodriver", -+ } -+ -+ if all_crates: -+ crates = crates_and_roots.keys() -+ elif crates is None or crates == []: -+ crates = ["gkrust"] -+ -+ final_ret = 0 -+ -+ for crate in crates: -+ root = crates_and_roots.get(crate, None) -+ if not root: -+ print( -+ "Cannot locate crate %s. Please check your spelling or " -+ "add the crate information to the list." % crate -+ ) -+ return 1 -+ -+ check_targets = [ -+ "force-cargo-library-clippy", -+ "force-cargo-host-library-clippy", -+ "force-cargo-program-clippy", -+ "force-cargo-host-program-clippy", -+ ] -+ -+ append_env = {} -+ if message_format_json: -+ append_env["USE_CARGO_JSON_MESSAGE_FORMAT"] = "1" -+ -+ ret = 2 -+ -+ try: -+ ret = command_context._run_make( -+ srcdir=False, -+ directory=root, -+ ensure_exit_code=0, -+ silent=not verbose, -+ print_directory=False, -+ target=check_targets, -+ num_jobs=jobs, -+ append_env=append_env, -+ ) -+ except Exception as e: -+ print("%s" % e) -+ if ret != 0: -+ final_ret = ret -+ -+ return final_ret -+ -+ -+@SubCommand( -+ "cargo", -+ "audit", -+ description="Run `cargo audit` on a given crate. Defaults to gkrust.", -+) -+@CommandArgument( -+ "--all-crates", -+ action="store_true", -+ help="Run `cargo audit` on all the crates in the tree.", -+) -+@CommandArgument( -+ "crates", -+ default=None, -+ nargs="*", -+ help="The crate name(s) to run `cargo audit` on.", -+) -+@CommandArgument( -+ "--jobs", -+ "-j", -+ default="0", -+ nargs="?", -+ metavar="jobs", -+ type=int, -+ help="Run `audit` in parallel using multiple processes.", -+) -+@CommandArgument("-v", "--verbose", action="store_true", help="Verbose output.") -+@CommandArgument( -+ "--message-format-json", -+ action="store_true", -+ help="Emit error messages as JSON.", -+) -+def audit( -+ command_context, -+ all_crates=None, -+ crates=None, -+ jobs=0, -+ verbose=False, -+ message_format_json=False, -+): -+ # XXX duplication with `mach vendor rust` -+ crates_and_roots = { -+ "gkrust": "toolkit/library/rust", -+ "gkrust-gtest": "toolkit/library/gtest/rust", -+ "geckodriver": "testing/geckodriver", -+ } -+ -+ if all_crates: -+ crates = crates_and_roots.keys() -+ elif not crates: -+ crates = ["gkrust"] -+ -+ final_ret = 0 -+ -+ for crate in crates: -+ root = crates_and_roots.get(crate, None) -+ if not root: -+ print( -+ "Cannot locate crate %s. Please check your spelling or " -+ "add the crate information to the list." % crate -+ ) -+ return 1 -+ -+ check_targets = [ -+ "force-cargo-library-audit", -+ "force-cargo-host-library-audit", -+ "force-cargo-program-audit", -+ "force-cargo-host-program-audit", -+ ] -+ -+ append_env = {} -+ if message_format_json: -+ append_env["USE_CARGO_JSON_MESSAGE_FORMAT"] = "1" -+ -+ ret = 2 -+ -+ try: -+ ret = command_context._run_make( -+ srcdir=False, -+ directory=root, -+ ensure_exit_code=0, -+ silent=not verbose, -+ print_directory=False, -+ target=check_targets -+ + ["cargo_build_flags=-f %s/Cargo.lock" % command_context.topsrcdir], -+ num_jobs=jobs, -+ append_env=append_env, -+ ) -+ except Exception as e: -+ print("%s" % e) -+ if ret != 0: -+ final_ret = ret -+ -+ return final_ret -+ -+ - @Command( - "doctor", - category="devenv", -@@ -891,8 +1197,9 @@ def gtest( - pass_thru=True, - ) - -+ import functools -+ - from mozprocess import ProcessHandlerMixin -- import functools - - def handle_line(job_id, line): - # Prepend the jobId -@@ -946,7 +1253,7 @@ def android_gtest( - setup_logging("mach-gtest", {}, {default_format: sys.stdout}, format_args) - - # ensure that a device is available and test app is installed -- from mozrunner.devices.android_device import verify_android_device, get_adb_path -+ from mozrunner.devices.android_device import get_adb_path, verify_android_device - - verify_android_device( - command_context, install=install, app=package, device_serial=device_serial -@@ -1046,8 +1353,8 @@ def install(command_context, **kwargs): - """Install a package.""" - if conditions.is_android(command_context): - from mozrunner.devices.android_device import ( -+ InstallIntent, - verify_android_device, -- InstallIntent, - ) - - ret = ( -@@ -1386,9 +1693,9 @@ def _run_android( - use_existing_process=False, - ): - from mozrunner.devices.android_device import ( -- verify_android_device, -+ InstallIntent, - _get_device, -- InstallIntent, -+ verify_android_device, - ) - from six.moves import shlex_quote - -@@ -1782,7 +2089,7 @@ def _run_desktop( - stacks, - show_dump_stats, - ): -- from mozprofile import Profile, Preferences -+ from mozprofile import Preferences, Profile - - try: - if packaged: -@@ -2106,7 +2413,34 @@ def repackage(command_context): - scriptworkers in order to bundle things up into shippable formats, such as a - .dmg on OSX or an installer exe on Windows. - """ -- print("Usage: ./mach repackage [dmg|installer|mar] [args...]") -+ print("Usage: ./mach repackage [dmg|pkg|installer|mar] [args...]") -+ -+ -+@SubCommand( -+ "repackage", "deb", description="Repackage a tar file into a .deb for Linux" -+) -+@CommandArgument("--input", "-i", type=str, required=True, help="Input filename") -+@CommandArgument("--output", "-o", type=str, required=True, help="Output filename") -+@CommandArgument("--arch", type=str, required=True, help="One of ['x86', 'x86_64']") -+@CommandArgument( -+ "--templates", -+ type=str, -+ required=True, -+ help="Location of the templates used to generate the debian/ directory files", -+) -+def repackage_deb(command_context, input, output, arch, templates): -+ if not os.path.exists(input): -+ print("Input file does not exist: %s" % input) -+ return 1 -+ -+ template_dir = os.path.join( -+ command_context.topsrcdir, -+ templates, -+ ) -+ -+ from mozbuild.repackaging.deb import repackage_deb -+ -+ repackage_deb(input, output, template_dir, arch) - - - @SubCommand("repackage", "dmg", description="Repackage a tar file into a .dmg for OSX") -@@ -2117,18 +2451,24 @@ def repackage_dmg(command_context, input - print("Input file does not exist: %s" % input) - return 1 - -- if not os.path.exists(os.path.join(command_context.topobjdir, "config.status")): -- print( -- "config.status not found. Please run |mach configure| " -- "prior to |mach repackage|." -- ) -- return 1 -- - from mozbuild.repackaging.dmg import repackage_dmg - - repackage_dmg(input, output) - - -+@SubCommand("repackage", "pkg", description="Repackage a tar file into a .pkg for OSX") -+@CommandArgument("--input", "-i", type=str, required=True, help="Input filename") -+@CommandArgument("--output", "-o", type=str, required=True, help="Output filename") -+def repackage_pkg(command_context, input, output): -+ if not os.path.exists(input): -+ print("Input file does not exist: %s" % input) -+ return 1 -+ -+ from mozbuild.repackaging.pkg import repackage_pkg -+ -+ repackage_pkg(input, output) -+ -+ - @SubCommand( - "repackage", "installer", description="Repackage into a Windows installer exe" - ) -diff --git a/python/mozbuild/mozbuild/repackaging/dmg.py b/python/mozbuild/mozbuild/repackaging/dmg.py ---- a/python/mozbuild/mozbuild/repackaging/dmg.py -+++ b/python/mozbuild/mozbuild/repackaging/dmg.py -@@ -2,16 +2,13 @@ - # 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/. - --from __future__ import absolute_import, print_function -+import tarfile -+from pathlib import Path - --import errno --import os --import tempfile --import tarfile --import shutil --import mozpack.path as mozpath -+import mozfile -+from mozbuild.bootstrap import bootstrap_toolchain -+from mozbuild.repackaging.application_ini import get_application_ini_value - from mozpack.dmg import create_dmg --from mozbuild.repackaging.application_ini import get_application_ini_value - - - def repackage_dmg(infile, output): -@@ -19,27 +16,41 @@ def repackage_dmg(infile, output): - if not tarfile.is_tarfile(infile): - raise Exception("Input file %s is not a valid tarfile." % infile) - -- tmpdir = tempfile.mkdtemp() -- try: -+ # Resolve required tools -+ dmg_tool = bootstrap_toolchain("dmg/dmg") -+ if not dmg_tool: -+ raise Exception("DMG tool not found") -+ hfs_tool = bootstrap_toolchain("dmg/hfsplus") -+ if not hfs_tool: -+ raise Exception("HFS tool not found") -+ mkfshfs_tool = bootstrap_toolchain("hfsplus/newfs_hfs") -+ if not mkfshfs_tool: -+ raise Exception("MKFSHFS tool not found") -+ -+ with mozfile.TemporaryDirectory() as tmp: -+ tmpdir = Path(tmp) - with tarfile.open(infile) as tar: - tar.extractall(path=tmpdir) - - # Remove the /Applications symlink. If we don't, an rsync command in - # create_dmg() will break, and create_dmg() re-creates the symlink anyway. -- try: -- os.remove(mozpath.join(tmpdir, " ")) -- except OSError as e: -- if e.errno != errno.ENOENT: -- raise -+ symlink = tmpdir / " " -+ if symlink.is_file(): -+ symlink.unlink() - - volume_name = get_application_ini_value( -- tmpdir, "App", "CodeName", fallback="Name" -+ str(tmpdir), "App", "CodeName", fallback="Name" - ) - - # The extra_files argument is empty [] because they are already a part - # of the original dmg produced by the build, and they remain in the - # tarball generated by the signing task. -- create_dmg(tmpdir, output, volume_name, []) -- -- finally: -- shutil.rmtree(tmpdir) -+ create_dmg( -+ source_directory=tmpdir, -+ output_dmg=Path(output), -+ volume_name=volume_name, -+ extra_files=[], -+ dmg_tool=Path(dmg_tool), -+ hfs_tool=Path(hfs_tool), -+ mkfshfs_tool=Path(mkfshfs_tool), -+ ) -diff --git a/python/mozbuild/mozbuild/test/action/test_langpack_manifest.py b/python/mozbuild/mozbuild/test/action/test_langpack_manifest.py ---- a/python/mozbuild/mozbuild/test/action/test_langpack_manifest.py -+++ b/python/mozbuild/mozbuild/test/action/test_langpack_manifest.py -@@ -5,14 +5,13 @@ - - from __future__ import absolute_import, print_function - --import unittest - import json - import os -- --import mozunit -+import tempfile -+import unittest - - import mozbuild.action.langpack_manifest as langpack_manifest --from mozbuild.preprocessor import Context -+import mozunit - - - class TestGenerateManifest(unittest.TestCase): -@@ -20,16 +19,30 @@ class TestGenerateManifest(unittest.Test - Unit tests for langpack_manifest.py. - """ - -+ def test_parse_flat_ftl(self): -+ src = """ -+langpack-creator = bar {"bar"} -+langpack-contributors = { "" } -+""" -+ tmp = tempfile.NamedTemporaryFile(mode="wt", suffix=".ftl", delete=False) -+ try: -+ tmp.write(src) -+ tmp.close() -+ ftl = langpack_manifest.parse_flat_ftl(tmp.name) -+ self.assertEqual(ftl["langpack-creator"], "bar bar") -+ self.assertEqual(ftl["langpack-contributors"], "") -+ finally: -+ os.remove(tmp.name) -+ -+ def test_parse_flat_ftl_missing(self): -+ ftl = langpack_manifest.parse_flat_ftl("./does-not-exist.ftl") -+ self.assertEqual(len(ftl), 0) -+ - def test_manifest(self): -- ctx = Context() -- ctx["MOZ_LANG_TITLE"] = "Finnish" -- ctx["MOZ_LANGPACK_CREATOR"] = "Suomennosprojekti" -- ctx[ -- "MOZ_LANGPACK_CONTRIBUTORS" -- ] = """ -- Joe Smith -- Mary White -- """ -+ ctx = { -+ "langpack-creator": "Suomennosprojekti", -+ "langpack-contributors": "Joe Smith, Mary White", -+ } - os.environ["MOZ_BUILD_DATE"] = "20210928100000" - manifest = langpack_manifest.create_webmanifest( - "fi", -@@ -44,16 +57,17 @@ class TestGenerateManifest(unittest.Test - ) - - data = json.loads(manifest) -- self.assertEqual(data["name"], "Finnish Language Pack") -+ self.assertEqual(data["name"], "Language Pack: Suomi (Finnish)") - self.assertEqual( - data["author"], "Suomennosprojekti (contributors: Joe Smith, Mary White)" - ) - self.assertEqual(data["version"], "57.0.1buildid20210928.100000") - - def test_manifest_without_contributors(self): -- ctx = Context() -- ctx["MOZ_LANG_TITLE"] = "Finnish" -- ctx["MOZ_LANGPACK_CREATOR"] = "Suomennosprojekti" -+ ctx = { -+ "langpack-creator": "Suomennosprojekti", -+ "langpack-contributors": "", -+ } - manifest = langpack_manifest.create_webmanifest( - "fi", - "57.0.1", -@@ -67,7 +81,7 @@ class TestGenerateManifest(unittest.Test - ) - - data = json.loads(manifest) -- self.assertEqual(data["name"], "Finnish Language Pack") -+ self.assertEqual(data["name"], "Language Pack: Suomi (Finnish)") - self.assertEqual(data["author"], "Suomennosprojekti") - - -diff --git a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py ---- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py -+++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py -@@ -6,21 +6,18 @@ from __future__ import absolute_import, - - import io - import os --import six.moves.cPickle as pickle --import six - import unittest - --from mozpack.manifests import InstallManifest --from mozunit import main -- -+import mozpack.path as mozpath -+import six -+import six.moves.cPickle as pickle - from mozbuild.backend.recursivemake import RecursiveMakeBackend, RecursiveMakeTraversal - from mozbuild.backend.test_manifest import TestManifestBackend - from mozbuild.frontend.emitter import TreeMetadataEmitter - from mozbuild.frontend.reader import BuildReader -- - from mozbuild.test.backend.common import BackendTester -- --import mozpack.path as mozpath -+from mozpack.manifests import InstallManifest -+from mozunit import main - - - class TestRecursiveMakeTraversal(unittest.TestCase): -@@ -1011,10 +1008,10 @@ class TestRecursiveMakeBackend(BackendTe - - expected = [ - "CARGO_FILE := %s/code/Cargo.toml" % env.topsrcdir, -- "CARGO_TARGET_DIR := .", -- "RUST_PROGRAMS += i686-pc-windows-msvc/release/target.exe", -+ "CARGO_TARGET_DIR := %s" % env.topobjdir, -+ "RUST_PROGRAMS += $(DEPTH)/i686-pc-windows-msvc/release/target.exe", - "RUST_CARGO_PROGRAMS += target", -- "HOST_RUST_PROGRAMS += i686-pc-windows-msvc/release/host.exe", -+ "HOST_RUST_PROGRAMS += $(DEPTH)/i686-pc-windows-msvc/release/host.exe", - "HOST_RUST_CARGO_PROGRAMS += host", - ] - -diff --git a/python/mozbuild/mozbuild/vendor/moz_yaml.py b/python/mozbuild/mozbuild/vendor/moz_yaml.py ---- a/python/mozbuild/mozbuild/vendor/moz_yaml.py -+++ b/python/mozbuild/mozbuild/vendor/moz_yaml.py -@@ -104,6 +104,10 @@ origin: - # optional - license-file: COPYING - -+ # If there are any mozilla-specific notes you want to put -+ # about a library, they can be put here. -+ notes: Notes about the library -+ - # Configuration for the automated vendoring system. - # optional - vendoring: -@@ -379,6 +383,7 @@ def _schema_1(): - "origin": { - Required("name"): All(str, Length(min=1)), - Required("description"): All(str, Length(min=1)), -+ "notes": All(str, Length(min=1)), - Required("url"): FqdnUrl(), - Required("license"): Msg(License(), msg="Unsupported License"), - "license-file": All(str, Length(min=1)), -diff --git a/python/mozbuild/mozbuild/vendor/vendor_manifest.py b/python/mozbuild/mozbuild/vendor/vendor_manifest.py ---- a/python/mozbuild/mozbuild/vendor/vendor_manifest.py -+++ b/python/mozbuild/mozbuild/vendor/vendor_manifest.py -@@ -25,7 +25,7 @@ from mozbuild.vendor.rewrite_mozbuild im - MozBuildRewriteException, - ) - --DEFAULT_EXCLUDE_FILES = [".git*"] -+DEFAULT_EXCLUDE_FILES = [".git*", ".git*/**"] - DEFAULT_KEEP_FILES = ["**/moz.build", "**/moz.yaml"] - DEFAULT_INCLUDE_FILES = [] - -diff --git a/python/mozbuild/mozbuild/vendor/vendor_rust.py b/python/mozbuild/mozbuild/vendor/vendor_rust.py ---- a/python/mozbuild/mozbuild/vendor/vendor_rust.py -+++ b/python/mozbuild/mozbuild/vendor/vendor_rust.py -@@ -196,6 +196,7 @@ class VendorRust(MozbuildObject): - f - for f in self.repository.get_changed_files("M") - if os.path.basename(f) not in ("Cargo.toml", "Cargo.lock") -+ and not f.startswith("supply-chain/") - ] - if modified: - self.log( -diff --git a/python/mozbuild/mozpack/dmg.py b/python/mozbuild/mozpack/dmg.py ---- a/python/mozbuild/mozpack/dmg.py -+++ b/python/mozbuild/mozpack/dmg.py -@@ -2,28 +2,18 @@ - # 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/. - --from __future__ import absolute_import, print_function, unicode_literals -- --import buildconfig --import errno --import mozfile - import os - import platform - import shutil - import subprocess -+from pathlib import Path -+from typing import List - -+import mozfile - from mozbuild.util import ensureParentDir - - is_linux = platform.system() == "Linux" -- -- --def mkdir(dir): -- if not os.path.isdir(dir): -- try: -- os.makedirs(dir) -- except OSError as e: -- if e.errno != errno.EEXIST: -- raise -+is_osx = platform.system() == "Darwin" - - - def chmod(dir): -@@ -31,48 +21,50 @@ def chmod(dir): - subprocess.check_call(["chmod", "-R", "a+rX,a-st,u+w,go-w", dir]) - - --def rsync(source, dest): -+def rsync(source: Path, dest: Path): - "rsync the contents of directory source into directory dest" - # Ensure a trailing slash on directories so rsync copies the *contents* of source. -- if not source.endswith("/") and os.path.isdir(source): -- source += "/" -- subprocess.check_call(["rsync", "-a", "--copy-unsafe-links", source, dest]) -+ raw_source = str(source) -+ if source.is_dir(): -+ raw_source = str(source) + "/" -+ subprocess.check_call(["rsync", "-a", "--copy-unsafe-links", raw_source, dest]) - - --def set_folder_icon(dir, tmpdir): -+def set_folder_icon(dir: Path, tmpdir: Path, hfs_tool: Path = None): - "Set HFS attributes of dir to use a custom icon" -- if not is_linux: -+ if is_linux: -+ hfs = tmpdir / "staged.hfs" -+ subprocess.check_call([hfs_tool, hfs, "attr", "/", "C"]) -+ elif is_osx: - subprocess.check_call(["SetFile", "-a", "C", dir]) -- else: -- hfs = os.path.join(tmpdir, "staged.hfs") -- subprocess.check_call([buildconfig.substs["HFS_TOOL"], hfs, "attr", "/", "C"]) - - --def generate_hfs_file(stagedir, tmpdir, volume_name): -+def generate_hfs_file( -+ stagedir: Path, tmpdir: Path, volume_name: str, mkfshfs_tool: Path -+): - """ - When cross compiling, we zero fill an hfs file, that we will turn into - a DMG. To do so we test the size of the staged dir, and add some slight - padding to that. - """ -- if is_linux: -- hfs = os.path.join(tmpdir, "staged.hfs") -- output = subprocess.check_output(["du", "-s", stagedir]) -- size = int(output.split()[0]) / 1000 # Get in MB -- size = int(size * 1.02) # Bump the used size slightly larger. -- # Setup a proper file sized out with zero's -- subprocess.check_call( -- [ -- "dd", -- "if=/dev/zero", -- "of={}".format(hfs), -- "bs=1M", -- "count={}".format(size), -- ] -- ) -- subprocess.check_call([buildconfig.substs["MKFSHFS"], "-v", volume_name, hfs]) -+ hfs = tmpdir / "staged.hfs" -+ output = subprocess.check_output(["du", "-s", stagedir]) -+ size = int(output.split()[0]) / 1000 # Get in MB -+ size = int(size * 1.02) # Bump the used size slightly larger. -+ # Setup a proper file sized out with zero's -+ subprocess.check_call( -+ [ -+ "dd", -+ "if=/dev/zero", -+ "of={}".format(hfs), -+ "bs=1M", -+ "count={}".format(size), -+ ] -+ ) -+ subprocess.check_call([mkfshfs_tool, "-v", volume_name, hfs]) - - --def create_app_symlink(stagedir, tmpdir): -+def create_app_symlink(stagedir: Path, tmpdir: Path, hfs_tool: Path = None): - """ - Make a symlink to /Applications. The symlink name is a space - so we don't have to localize it. The Applications folder icon -@@ -80,18 +72,34 @@ def create_app_symlink(stagedir, tmpdir) - """ - if is_linux: - hfs = os.path.join(tmpdir, "staged.hfs") -- subprocess.check_call( -- [buildconfig.substs["HFS_TOOL"], hfs, "symlink", "/ ", "/Applications"] -- ) -- else: -- os.symlink("/Applications", os.path.join(stagedir, " ")) -+ subprocess.check_call([hfs_tool, hfs, "symlink", "/ ", "/Applications"]) -+ elif is_osx: -+ os.symlink("/Applications", stagedir / " ") - - --def create_dmg_from_staged(stagedir, output_dmg, tmpdir, volume_name): -+def create_dmg_from_staged( -+ stagedir: Path, -+ output_dmg: Path, -+ tmpdir: Path, -+ volume_name: str, -+ hfs_tool: Path = None, -+ dmg_tool: Path = None, -+): - "Given a prepared directory stagedir, produce a DMG at output_dmg." -- if not is_linux: -- # Running on OS X -- hybrid = os.path.join(tmpdir, "hybrid.dmg") -+ if is_linux: -+ # The dmg tool doesn't create the destination directories, and silently -+ # returns success if the parent directory doesn't exist. -+ ensureParentDir(output_dmg) -+ -+ hfs = os.path.join(tmpdir, "staged.hfs") -+ subprocess.check_call([hfs_tool, hfs, "addall", stagedir]) -+ subprocess.check_call( -+ [dmg_tool, "build", hfs, output_dmg], -+ # dmg is seriously chatty -+ stdout=subprocess.DEVNULL, -+ ) -+ elif is_osx: -+ hybrid = tmpdir / "hybrid.dmg" - subprocess.check_call( - [ - "hdiutil", -@@ -121,37 +129,17 @@ def create_dmg_from_staged(stagedir, out - output_dmg, - ] - ) -- else: -- # The dmg tool doesn't create the destination directories, and silently -- # returns success if the parent directory doesn't exist. -- ensureParentDir(output_dmg) -- -- hfs = os.path.join(tmpdir, "staged.hfs") -- subprocess.check_call([buildconfig.substs["HFS_TOOL"], hfs, "addall", stagedir]) -- subprocess.check_call( -- [buildconfig.substs["DMG_TOOL"], "build", hfs, output_dmg], -- # dmg is seriously chatty -- stdout=open(os.devnull, "wb"), -- ) - - --def check_tools(*tools): -- """ -- Check that each tool named in tools exists in SUBSTS and is executable. -- """ -- for tool in tools: -- path = buildconfig.substs[tool] -- if not path: -- raise Exception('Required tool "%s" not found' % tool) -- if not os.path.isfile(path): -- raise Exception('Required tool "%s" not found at path "%s"' % (tool, path)) -- if not os.access(path, os.X_OK): -- raise Exception( -- 'Required tool "%s" at path "%s" is not executable' % (tool, path) -- ) -- -- --def create_dmg(source_directory, output_dmg, volume_name, extra_files): -+def create_dmg( -+ source_directory: Path, -+ output_dmg: Path, -+ volume_name: str, -+ extra_files: List[tuple], -+ dmg_tool: Path, -+ hfs_tool: Path, -+ mkfshfs_tool: Path, -+): - """ - Create a DMG disk image at the path output_dmg from source_directory. - -@@ -162,73 +150,80 @@ def create_dmg(source_directory, output_ - if platform.system() not in ("Darwin", "Linux"): - raise Exception("Don't know how to build a DMG on '%s'" % platform.system()) - -- if is_linux: -- check_tools("DMG_TOOL", "MKFSHFS", "HFS_TOOL") -- with mozfile.TemporaryDirectory() as tmpdir: -- stagedir = os.path.join(tmpdir, "stage") -- os.mkdir(stagedir) -+ with mozfile.TemporaryDirectory() as tmp: -+ tmpdir = Path(tmp) -+ stagedir = tmpdir / "stage" -+ stagedir.mkdir() -+ - # Copy the app bundle over using rsync - rsync(source_directory, stagedir) - # Copy extra files - for source, target in extra_files: -- full_target = os.path.join(stagedir, target) -- mkdir(os.path.dirname(full_target)) -+ full_target = stagedir / target -+ full_target.parent.mkdir(parents=True, exist_ok=True) - shutil.copyfile(source, full_target) -- generate_hfs_file(stagedir, tmpdir, volume_name) -- create_app_symlink(stagedir, tmpdir) -+ if is_linux: -+ # Not needed in osx -+ generate_hfs_file(stagedir, tmpdir, volume_name, mkfshfs_tool) -+ create_app_symlink(stagedir, tmpdir, hfs_tool) - # Set the folder attributes to use a custom icon -- set_folder_icon(stagedir, tmpdir) -+ set_folder_icon(stagedir, tmpdir, hfs_tool) - chmod(stagedir) -- create_dmg_from_staged(stagedir, output_dmg, tmpdir, volume_name) -+ create_dmg_from_staged( -+ stagedir, output_dmg, tmpdir, volume_name, hfs_tool, dmg_tool -+ ) - - --def extract_dmg_contents(dmgfile, destdir): -- import buildconfig -- -+def extract_dmg_contents( -+ dmgfile: Path, -+ destdir: Path, -+ dmg_tool: Path = None, -+ hfs_tool: Path = None, -+): - if is_linux: - with mozfile.TemporaryDirectory() as tmpdir: - hfs_file = os.path.join(tmpdir, "firefox.hfs") - subprocess.check_call( -- [buildconfig.substs["DMG_TOOL"], "extract", dmgfile, hfs_file], -+ [dmg_tool, "extract", dmgfile, hfs_file], - # dmg is seriously chatty -- stdout=open(os.devnull, "wb"), -- ) -- subprocess.check_call( -- [buildconfig.substs["HFS_TOOL"], hfs_file, "extractall", "/", destdir] -+ stdout=subprocess.DEVNULL, - ) -+ subprocess.check_call([hfs_tool, hfs_file, "extractall", "/", destdir]) - else: -- unpack_diskimage = os.path.join( -- buildconfig.topsrcdir, "build", "package", "mac_osx", "unpack-diskimage" -- ) -- unpack_mountpoint = os.path.join( -- "/tmp", "{}-unpack".format(buildconfig.substs["MOZ_APP_NAME"]) -- ) -+ # TODO: find better way to resolve topsrcdir (checkout directory) -+ topsrcdir = Path(__file__).parent.parent.parent.parent.resolve() -+ unpack_diskimage = topsrcdir / "build/package/mac_osx/unpack-diskimage" -+ unpack_mountpoint = Path("/tmp/app-unpack") - subprocess.check_call([unpack_diskimage, dmgfile, unpack_mountpoint, destdir]) - - --def extract_dmg(dmgfile, output, dsstore=None, icon=None, background=None): -+def extract_dmg( -+ dmgfile: Path, -+ output: Path, -+ dmg_tool: Path = None, -+ hfs_tool: Path = None, -+ dsstore: Path = None, -+ icon: Path = None, -+ background: Path = None, -+): - if platform.system() not in ("Darwin", "Linux"): - raise Exception("Don't know how to extract a DMG on '%s'" % platform.system()) - -- if is_linux: -- check_tools("DMG_TOOL", "MKFSHFS", "HFS_TOOL") -- -- with mozfile.TemporaryDirectory() as tmpdir: -- extract_dmg_contents(dmgfile, tmpdir) -- if os.path.islink(os.path.join(tmpdir, " ")): -+ with mozfile.TemporaryDirectory() as tmp: -+ tmpdir = Path(tmp) -+ extract_dmg_contents(dmgfile, tmpdir, dmg_tool, hfs_tool) -+ applications_symlink = tmpdir / " " -+ if applications_symlink.is_symlink(): - # Rsync will fail on the presence of this symlink -- os.remove(os.path.join(tmpdir, " ")) -+ applications_symlink.unlink() - rsync(tmpdir, output) - - if dsstore: -- mkdir(os.path.dirname(dsstore)) -- rsync(os.path.join(tmpdir, ".DS_Store"), dsstore) -+ dsstore.parent.mkdir(parents=True, exist_ok=True) -+ rsync(tmpdir / ".DS_Store", dsstore) - if background: -- mkdir(os.path.dirname(background)) -- rsync( -- os.path.join(tmpdir, ".background", os.path.basename(background)), -- background, -- ) -+ background.parent.mkdir(parents=True, exist_ok=True) -+ rsync(tmpdir / ".background" / background.name, background) - if icon: -- mkdir(os.path.dirname(icon)) -- rsync(os.path.join(tmpdir, ".VolumeIcon.icns"), icon) -+ icon.parent.mkdir(parents=True, exist_ok=True) -+ rsync(tmpdir / ".VolumeIcon.icns", icon) -diff --git a/python/mozbuild/mozpack/mozjar.py b/python/mozbuild/mozpack/mozjar.py ---- a/python/mozbuild/mozpack/mozjar.py -+++ b/python/mozbuild/mozpack/mozjar.py -@@ -287,12 +287,22 @@ class JarFileReader(object): - self.compressed = header["compression"] != JAR_STORED - self.compress = header["compression"] - -+ def readable(self): -+ return True -+ - def read(self, length=-1): - """ - Read some amount of uncompressed data. - """ - return self.uncompressed_data.read(length) - -+ def readinto(self, b): -+ """ -+ Read bytes into a pre-allocated, writable bytes-like object `b` and return -+ the number of bytes read. -+ """ -+ return self.uncompressed_data.readinto(b) -+ - def readlines(self): - """ - Return a list containing all the lines of data in the uncompressed -@@ -320,6 +330,10 @@ class JarFileReader(object): - self.uncompressed_data.close() - - @property -+ def closed(self): -+ return self.uncompressed_data.closed -+ -+ @property - def compressed_data(self): - """ - Return the raw compressed data. -diff --git a/python/mozbuild/mozpack/test/python.ini b/python/mozbuild/mozpack/test/python.ini ---- a/python/mozbuild/mozpack/test/python.ini -+++ b/python/mozbuild/mozpack/test/python.ini -@@ -14,4 +14,5 @@ subsuite = mozbuild - [test_packager_l10n.py] - [test_packager_unpack.py] - [test_path.py] -+[test_pkg.py] - [test_unify.py] -diff --git a/python/mozlint/mozlint/cli.py b/python/mozlint/mozlint/cli.py ---- a/python/mozlint/mozlint/cli.py -+++ b/python/mozlint/mozlint/cli.py -@@ -46,10 +46,13 @@ class MozlintParser(ArgumentParser): - [ - ["-W", "--warnings"], - { -+ "const": True, -+ "nargs": "?", -+ "choices": ["soft"], - "dest": "show_warnings", -- "default": False, -- "action": "store_true", -- "help": "Display and fail on warnings in addition to errors.", -+ "help": "Display and fail on warnings in addition to errors. " -+ "--warnings=soft can be used to report warnings but only fail " -+ "on errors.", - }, - ], - [ -diff --git a/python/mozlint/mozlint/result.py b/python/mozlint/mozlint/result.py ---- a/python/mozlint/mozlint/result.py -+++ b/python/mozlint/mozlint/result.py -@@ -3,6 +3,7 @@ - # file, You can obtain one at http://mozilla.org/MPL/2.0/. - - from collections import defaultdict -+from itertools import chain - from json import JSONEncoder - import os - import mozpack.path as mozpath -@@ -15,7 +16,8 @@ class ResultSummary(object): - - root = None - -- def __init__(self, root): -+ def __init__(self, root, fail_on_warnings=True): -+ self.fail_on_warnings = fail_on_warnings - self.reset() - - # Store the repository root folder to be able to build -@@ -30,9 +32,19 @@ class ResultSummary(object): - self.suppressed_warnings = defaultdict(int) - self.fixed = 0 - -+ def has_issues_failure(self): -+ """Returns true in case issues were detected during the lint run. Do not -+ consider warning issues in case `self.fail_on_warnings` is set to False. -+ """ -+ if self.fail_on_warnings is False: -+ return any( -+ result.level != "warning" for result in chain(*self.issues.values()) -+ ) -+ return len(self.issues) >= 1 -+ - @property - def returncode(self): -- if self.issues or self.failed: -+ if self.has_issues_failure() or self.failed: - return 1 - return 0 - -diff --git a/python/mozlint/mozlint/roller.py b/python/mozlint/mozlint/roller.py ---- a/python/mozlint/mozlint/roller.py -+++ b/python/mozlint/mozlint/roller.py -@@ -177,7 +177,11 @@ class LintRoller(object): - self._setupargs = setupargs or {} - - # result state -- self.result = ResultSummary(root) -+ self.result = ResultSummary( -+ root, -+ # Prevent failing on warnings when the --warnings parameter is set to "soft" -+ fail_on_warnings=lintargs.get("show_warnings") != "soft", -+ ) - - self.root = root - self.exclude = exclude or [] -diff --git a/python/mozlint/mozlint/types.py b/python/mozlint/mozlint/types.py ---- a/python/mozlint/mozlint/types.py -+++ b/python/mozlint/mozlint/types.py -@@ -87,40 +87,6 @@ class BaseType(object): - pass - - --class FileType(BaseType): -- """Abstract base class for linter types that check each file -- -- Subclasses of this linter type will read each file and check the file contents -- """ -- -- __metaclass__ = ABCMeta -- -- @abstractmethod -- def lint_single_file(payload, line, config): -- """Run linter defined by `config` against `paths` with `lintargs`. -- -- :param path: Path to the file to lint. -- :param config: Linter config the paths are being linted against. -- :param lintargs: External arguments to the linter not defined in -- the definition, but passed in by a consumer. -- :returns: An error message or None -- """ -- pass -- -- def _lint(self, path, config, **lintargs): -- if os.path.isdir(path): -- return self._lint_dir(path, config, **lintargs) -- -- payload = config["payload"] -- -- errors = [] -- message = self.lint_single_file(payload, path, config) -- if message: -- errors.append(result.from_config(config, message=message, path=path)) -- -- return errors -- -- - class LineType(BaseType): - """Abstract base class for linter types that check each line individually. - -@@ -182,6 +148,10 @@ class ExternalType(BaseType): - return func(files, config, **lintargs) - - -+class ExternalFileType(ExternalType): -+ batch = False -+ -+ - class GlobalType(ExternalType): - """Linter type that runs an external global linting function just once. - -@@ -237,6 +207,7 @@ supported_types = { - "string": StringType(), - "regex": RegexType(), - "external": ExternalType(), -+ "external-file": ExternalFileType(), - "global": GlobalType(), - "structured_log": StructuredLogType(), - } -diff --git a/python/mozlint/test/test_roller.py b/python/mozlint/test/test_roller.py ---- a/python/mozlint/test/test_roller.py -+++ b/python/mozlint/test/test_roller.py -@@ -14,6 +14,7 @@ import pytest - - from mozlint.errors import LintersNotConfigured, NoValidLinter - from mozlint.result import Issue, ResultSummary -+from mozlint.roller import LintRoller - from itertools import chain - - -@@ -152,26 +153,41 @@ def test_roll_warnings(lint, linters, fi - assert result.total_suppressed_warnings == 0 - - --def test_roll_code_review(monkeypatch, lint, linters, files): -+def test_roll_code_review(monkeypatch, linters, files): - monkeypatch.setenv("CODE_REVIEW", "1") -- lint.lintargs["show_warnings"] = False -+ lint = LintRoller(root=here, show_warnings=False) - lint.read(linters("warning")) - result = lint.roll(files) - assert len(result.issues) == 1 - assert result.total_issues == 2 - assert len(result.suppressed_warnings) == 0 - assert result.total_suppressed_warnings == 0 -+ assert result.returncode == 1 - - --def test_roll_code_review_warnings_disabled(monkeypatch, lint, linters, files): -+def test_roll_code_review_warnings_disabled(monkeypatch, linters, files): - monkeypatch.setenv("CODE_REVIEW", "1") -- lint.lintargs["show_warnings"] = False -+ lint = LintRoller(root=here, show_warnings=False) - lint.read(linters("warning_no_code_review")) - result = lint.roll(files) - assert len(result.issues) == 0 - assert result.total_issues == 0 -+ assert lint.result.fail_on_warnings is True - assert len(result.suppressed_warnings) == 1 - assert result.total_suppressed_warnings == 2 -+ assert result.returncode == 0 -+ -+ -+def test_roll_code_review_warnings_soft(linters, files): -+ lint = LintRoller(root=here, show_warnings="soft") -+ lint.read(linters("warning_no_code_review")) -+ result = lint.roll(files) -+ assert len(result.issues) == 1 -+ assert result.total_issues == 2 -+ assert lint.result.fail_on_warnings is False -+ assert len(result.suppressed_warnings) == 0 -+ assert result.total_suppressed_warnings == 0 -+ assert result.returncode == 0 - - - def fake_run_worker(config, paths, **lintargs): -diff --git a/python/mozperftest/mozperftest/test/webpagetest.py b/python/mozperftest/mozperftest/test/webpagetest.py ---- a/python/mozperftest/mozperftest/test/webpagetest.py -+++ b/python/mozperftest/mozperftest/test/webpagetest.py -@@ -29,6 +29,7 @@ ACCEPTED_CONNECTIONS = [ - - ACCEPTED_STATISTICS = ["average", "median", "standardDeviation"] - WPT_KEY_FILE = "WPT_key.txt" -+WPT_API_EXPIRED_MESSAGE = "API key expired" - - - class WPTTimeOutError(Exception): -@@ -112,6 +113,14 @@ class WPTInvalidStatisticsError(Exceptio - pass - - -+class WPTExpiredAPIKeyError(Exception): -+ """ -+ This error is raised if we get a notification from WPT that our API key has expired -+ """ -+ -+ pass -+ -+ - class PropagatingErrorThread(Thread): - def run(self): - self.exc = None -@@ -244,6 +253,11 @@ class WebPageTest(Layer): - requested_results = requests.get(url) - results_of_request = json.loads(requested_results.text) - start = time.time() -+ if ( -+ "statusText" in results_of_request.keys() -+ and results_of_request["statusText"] == WPT_API_EXPIRED_MESSAGE -+ ): -+ raise WPTExpiredAPIKeyError("The API key has expired") - while ( - requested_results.status_code == 200 - and time.time() - start < self.timeout_limit -diff --git a/python/mozperftest/mozperftest/tests/test_webpagetest.py b/python/mozperftest/mozperftest/tests/test_webpagetest.py ---- a/python/mozperftest/mozperftest/tests/test_webpagetest.py -+++ b/python/mozperftest/mozperftest/tests/test_webpagetest.py -@@ -13,10 +13,12 @@ from mozperftest.test.webpagetest import - WPTBrowserSelectionError, - WPTInvalidURLError, - WPTLocationSelectionError, -- WPTInvalidConnectionSelection, -- ACCEPTED_STATISTICS, - WPTInvalidStatisticsError, - WPTDataProcessingError, -+ WPTExpiredAPIKeyError, -+ WPTInvalidConnectionSelection, -+ WPT_API_EXPIRED_MESSAGE, -+ ACCEPTED_STATISTICS, - ) - - WPT_METRICS = [ -@@ -82,7 +84,9 @@ def init_placeholder_wpt_data(fvonly=Fal - return placeholder_data - - --def init_mocked_request(status_code, WPT_test_status_code=200, **kwargs): -+def init_mocked_request( -+ status_code, WPT_test_status_code=200, WPT_test_status_text="Ok", **kwargs -+): - mock_data = { - "data": { - "ec2-us-east-1": {"PendingTests": {"Queued": 3}, "Label": "California"}, -@@ -92,6 +96,7 @@ def init_mocked_request(status_code, WPT - "remaining": 2000, - }, - "statusCode": WPT_test_status_code, -+ "statusText": WPT_test_status_text, - } - for key, value in kwargs.items(): - mock_data["data"][key] = value -@@ -245,3 +250,23 @@ def test_webpagetest_test_metric_not_fou - test = webpagetest.WebPageTest(env, mach_cmd) - with pytest.raises(WPTDataProcessingError): - test.run(metadata) -+ -+ -+@mock.patch("mozperftest.utils.get_tc_secret", return_value={"wpt_key": "fake_key"}) -+@mock.patch( -+ "mozperftest.test.webpagetest.WebPageTest.location_queue", return_value=None -+) -+@mock.patch( -+ "requests.get", -+ return_value=init_mocked_request( -+ 200, WPT_test_status_code=400, WPT_test_status_text=WPT_API_EXPIRED_MESSAGE -+ ), -+) -+@mock.patch("mozperftest.test.webpagetest.WPT_KEY_FILE", "tests/data/WPT_fakekey.txt") -+def test_webpagetest_test_expired_api_key(*mocked): -+ mach_cmd, metadata, env = running_env(tests=[str(EXAMPLE_WPT_TEST)]) -+ metadata.script["options"]["test_list"] = ["google.ca"] -+ metadata.script["options"]["test_parameters"]["wait_between_requests"] = 1 -+ test = webpagetest.WebPageTest(env, mach_cmd) -+ with pytest.raises(WPTExpiredAPIKeyError): -+ test.run(metadata) -diff --git a/python/mozterm/mozterm/widgets.py b/python/mozterm/mozterm/widgets.py ---- a/python/mozterm/mozterm/widgets.py -+++ b/python/mozterm/mozterm/widgets.py -@@ -6,6 +6,8 @@ from __future__ import absolute_import, - - from .terminal import Terminal - -+DEFAULT = "\x1b(B\x1b[m" -+ - - class BaseWidget(object): - def __init__(self, terminal=None): -@@ -39,7 +41,16 @@ class Footer(BaseWidget): - for part in parts: - try: - func, part = part -- encoded = getattr(self.term, func)(part) -+ attribute = getattr(self.term, func) -+ # In Blessed, these attributes aren't always callable -+ if callable(attribute): -+ encoded = attribute(part) -+ else: -+ # If it's not callable, assume it's just the raw -+ # ANSI Escape Sequence and prepend it ourselves. -+ # Append DEFAULT to stop text that comes afterwards -+ # from inheriting the formatting we prepended. -+ encoded = attribute + part + DEFAULT - except ValueError: - encoded = part - -diff --git a/python/mozterm/test/test_terminal.py b/python/mozterm/test/test_terminal.py ---- a/python/mozterm/test/test_terminal.py -+++ b/python/mozterm/test/test_terminal.py -@@ -9,32 +9,17 @@ import sys - - import mozunit - import pytest -- --from mozterm import Terminal, NullTerminal -+from mozterm import NullTerminal, Terminal - - - def test_terminal(): -- blessings = pytest.importorskip("blessings") -+ blessed = pytest.importorskip("blessed") - term = Terminal() -- assert isinstance(term, blessings.Terminal) -+ assert isinstance(term, blessed.Terminal) - - term = Terminal(disable_styling=True) - assert isinstance(term, NullTerminal) - -- del sys.modules["blessings"] -- orig = sys.path[:] -- for path in orig: -- if "blessings" in path: -- sys.path.remove(path) -- -- term = Terminal() -- assert isinstance(term, NullTerminal) -- -- with pytest.raises(ImportError): -- term = Terminal(raises=True) -- -- sys.path = orig -- - - def test_null_terminal(): - term = NullTerminal() -diff --git a/python/mozterm/test/test_widgets.py b/python/mozterm/test/test_widgets.py ---- a/python/mozterm/test/test_widgets.py -+++ b/python/mozterm/test/test_widgets.py -@@ -4,41 +4,42 @@ - - from __future__ import absolute_import, unicode_literals - -+import sys - from io import StringIO - - import mozunit - import pytest -- - from mozterm import Terminal - from mozterm.widgets import Footer - - - @pytest.fixture --def terminal(monkeypatch): -- blessings = pytest.importorskip("blessings") -+def terminal(): -+ blessed = pytest.importorskip("blessed") - - kind = "xterm-256color" - try: - term = Terminal(stream=StringIO(), force_styling=True, kind=kind) -- except blessings.curses.error: -+ except blessed.curses.error: - pytest.skip("terminal '{}' not found".format(kind)) - -- # For some reason blessings returns None for width/height though a comment -- # says that shouldn't ever happen. -- monkeypatch.setattr(term, "_height_and_width", lambda: (100, 100)) - return term - - -+@pytest.mark.skipif( -+ not sys.platform.startswith("win"), -+ reason="Only do ANSI Escape Sequence comparisons on Windows.", -+) - def test_footer(terminal): - footer = Footer(terminal=terminal) - footer.write( - [ -- ("dim", "foo"), -+ ("bright_black", "foo"), - ("green", "bar"), - ] - ) - value = terminal.stream.getvalue() -- expected = "\x1b7\x1b[2mfoo\x1b(B\x1b[m \x1b[32mbar\x1b(B\x1b[m\x1b8" -+ expected = "\x1b7\x1b[90mfoo\x1b(B\x1b[m \x1b[32mbar\x1b(B\x1b[m\x1b8" - assert value == expected - - footer.clear() -diff --git a/python/mozversioncontrol/mozversioncontrol/__init__.py b/python/mozversioncontrol/mozversioncontrol/__init__.py ---- a/python/mozversioncontrol/mozversioncontrol/__init__.py -+++ b/python/mozversioncontrol/mozversioncontrol/__init__.py -@@ -222,6 +222,16 @@ class Repository(object): - """ - - @abc.abstractmethod -+ def get_ignored_files_finder(self): -+ """Obtain a mozpack.files.BaseFinder of ignored files in the working -+ directory. -+ -+ The Finder will have its list of all files in the repo cached for its -+ entire lifetime, so operations on the Finder will not track with, for -+ example, changes to the repo during the Finder's lifetime. -+ """ -+ -+ @abc.abstractmethod - def working_directory_clean(self, untracked=False, ignored=False): - """Determine if the working directory is free of modifications. - -@@ -501,6 +511,15 @@ class HgRepository(Repository): - ) - return FileListFinder(files) - -+ def get_ignored_files_finder(self): -+ # Can return backslashes on Windows. Normalize to forward slashes. -+ files = list( -+ p.replace("\\", "/").split(" ")[-1] -+ for p in self._run("status", "-i").split("\n") -+ if p -+ ) -+ return FileListFinder(files) -+ - def working_directory_clean(self, untracked=False, ignored=False): - args = ["status", "--modified", "--added", "--removed", "--deleted"] - if untracked: -@@ -675,6 +694,16 @@ class GitRepository(Repository): - files = [p for p in self._run("ls-files", "-z").split("\0") if p] - return FileListFinder(files) - -+ def get_ignored_files_finder(self): -+ files = [ -+ p -+ for p in self._run( -+ "ls-files", "-i", "-o", "-z", "--exclude-standard" -+ ).split("\0") -+ if p -+ ] -+ return FileListFinder(files) -+ - def working_directory_clean(self, untracked=False, ignored=False): - args = ["status", "--porcelain"] - -diff --git a/python/sites/mach.txt b/python/sites/mach.txt ---- a/python/sites/mach.txt -+++ b/python/sites/mach.txt -@@ -42,10 +42,10 @@ pth:testing/mozbase/mozsystemmonitor - pth:testing/mozbase/mozscreenshot - pth:testing/mozbase/moztest - pth:testing/mozbase/mozversion -+pth:testing/mozharness - pth:testing/raptor - pth:testing/talos - pth:testing/web-platform --vendored:testing/web-platform/tests/tools/third_party/funcsigs - vendored:testing/web-platform/tests/tools/third_party/h2 - vendored:testing/web-platform/tests/tools/third_party/hpack - vendored:testing/web-platform/tests/tools/third_party/html5lib -@@ -139,5 +139,5 @@ pypi-optional:glean-sdk==51.8.2:telemetr - # Mach gracefully handles the case where `psutil` is unavailable. - # We aren't (yet) able to pin packages in automation, so we have to - # support down to the oldest locally-installed version (5.4.2). --pypi-optional:psutil>=5.4.2,<=5.8.0:telemetry will be missing some data --pypi-optional:zstandard>=0.11.1,<=0.17.0:zstd archives will not be possible to extract -+pypi-optional:psutil>=5.4.2,<=5.9.4:telemetry will be missing some data -+pypi-optional:zstandard>=0.11.1,<=0.19.0:zstd archives will not be possible to extract diff --git a/wasi.patch b/wasi.patch index e02fddb..c6c2f91 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-143.0.4-build/firefox-143.0.4/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/home/komat/CVS/firefox/firefox-144.0-build/firefox-144.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From d2b88682142f3f1570f6167c3f30de998788e010 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 16 Oct 2025 14:32:25 +0200 Subject: [PATCH 513/545] Add fix for mzbz#1990430 --- D268839.1760704138.diff | 17 +++++++++++++++++ firefox.spec | 7 ++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 D268839.1760704138.diff diff --git a/D268839.1760704138.diff b/D268839.1760704138.diff new file mode 100644 index 0000000..f57779e --- /dev/null +++ b/D268839.1760704138.diff @@ -0,0 +1,17 @@ +diff --git a/xpcom/ds/nsTArray.h b/xpcom/ds/nsTArray.h +--- a/xpcom/ds/nsTArray.h ++++ b/xpcom/ds/nsTArray.h +@@ -2970,11 +2970,11 @@ + // FIXME: Conceptually `value_type mElements[N]`, but that upsets the + // hazard analysis, see bug 1880185. + char mStorage[sizeof(value_type) * N]; + }; + AutoBuffer() : mHdr{.mLength = 0, .mCapacity = N, .mIsAutoArray = true} {} +- ~AutoBuffer() {} ++ ~AutoBuffer() = default; + } mAutoBuf; + static_assert(offsetof(AutoBuffer, mStorage) == sizeof(nsTArrayHeader), + "Shouldn't have padding"); + }; + + diff --git a/firefox.spec b/firefox.spec index 8ac1be9..65a6371 100644 --- a/firefox.spec +++ b/firefox.spec @@ -201,7 +201,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 144.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -272,6 +272,7 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch +Patch408: D268839.1760704138.diff # PGO/LTO patches Patch600: pgo.patch @@ -584,6 +585,7 @@ cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysr %patch -P228 -p1 -b .disable-openh264-download %patch -P229 -p1 -b .firefox-nss-addon-hack %patch -P231 -p1 -b .fedora-customization +%patch -P408 -p1 -b .D268839.1760704138 %patch -P402 -p1 -b .1196777 %patch -P407 -p1 -b .1667096 @@ -1260,6 +1262,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Oct 15 2025 Martin Stransky - 144.0-3 +- Add fix for mzbz#1990430 + * Mon Oct 13 2025 Martin Stransky - 144.0-2 - Updated to 144.0 (b2) From 6806656d321a7fc84755e31e0e4ef801e78daea8 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 16 Oct 2025 14:37:50 +0200 Subject: [PATCH 514/545] changelog fix --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 65a6371..6d323cc 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1262,7 +1262,7 @@ fi #--------------------------------------------------------------------- %changelog -* Thu Oct 15 2025 Martin Stransky - 144.0-3 +* Thu Oct 16 2025 Martin Stransky - 144.0-3 - Add fix for mzbz#1990430 * Mon Oct 13 2025 Martin Stransky - 144.0-2 From 5984ba219075a3b6344f7e9aed86b33140121310 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 30 Oct 2025 11:31:59 +0100 Subject: [PATCH 515/545] Updated to 144.0.2 --- firefox.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/firefox.spec b/firefox.spec index 6d323cc..3f514d9 100644 --- a/firefox.spec +++ b/firefox.spec @@ -200,14 +200,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 144.0 -Release: 3%{?pre_tag}%{?dist} +Version: 144.0.2 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20251010.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20251030.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1262,6 +1262,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Oct 30 2025 Martin Stransky - 144.0.2-1 +- Updated to 144.0.2 + * Thu Oct 16 2025 Martin Stransky - 144.0-3 - Add fix for mzbz#1990430 From e87ce54e2a6a3b751da8dd415338772729a7ab89 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 30 Oct 2025 11:32:54 +0100 Subject: [PATCH 516/545] updated sources --- sources | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources b/sources index 4e3ce65..d9bb1b5 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-144.0.source.tar.xz) = e1f924ed006a31f5333ea6af219c1fb90d4866e5889ac634c324a3e80b042a7e0b2b9aeb798672ea1a434fbf817fc0b82a12ec0fb405a48e3a2ca21cc394445e -SHA512 (firefox-langpacks-144.0-20251010.tar.xz) = 3a556e77fb7b733cb40acc7e5d8dab87b3a68b284f1e0eabf7c39b4a3d6d2c193c5731619bf9ef034255650564157cf4bfcf99d0fd41661e6cc8e53bde4f2627 +SHA512 (firefox-144.0.2.source.tar.xz) = 87eebabab2c85eb32b2d1161e520f56e271a4893c8cd4d8225fc7b498a9883496315854a758478fb4edd061674a9f7c0503e9b9f0eb4503b1f89203774d02f97 +SHA512 (firefox-langpacks-144.0.2-20251030.tar.xz) = eb8164500601e68b3df184fea9b48f32f34e7de8d6b00b269df26dd0eaa8a6848371bdd03dc8980c746fd9fce1e0c79d890e685460bd0143bd03c6f374b85640 From 842bd5a7bee21c8d711eb8ce12bd1e2579a5957b Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 31 Oct 2025 07:52:36 +0100 Subject: [PATCH 517/545] removed unused patch --- D268839.1760704138.diff | 17 ----------------- firefox.spec | 2 -- 2 files changed, 19 deletions(-) delete mode 100644 D268839.1760704138.diff diff --git a/D268839.1760704138.diff b/D268839.1760704138.diff deleted file mode 100644 index f57779e..0000000 --- a/D268839.1760704138.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/xpcom/ds/nsTArray.h b/xpcom/ds/nsTArray.h ---- a/xpcom/ds/nsTArray.h -+++ b/xpcom/ds/nsTArray.h -@@ -2970,11 +2970,11 @@ - // FIXME: Conceptually `value_type mElements[N]`, but that upsets the - // hazard analysis, see bug 1880185. - char mStorage[sizeof(value_type) * N]; - }; - AutoBuffer() : mHdr{.mLength = 0, .mCapacity = N, .mIsAutoArray = true} {} -- ~AutoBuffer() {} -+ ~AutoBuffer() = default; - } mAutoBuf; - static_assert(offsetof(AutoBuffer, mStorage) == sizeof(nsTArrayHeader), - "Shouldn't have padding"); - }; - - diff --git a/firefox.spec b/firefox.spec index 3f514d9..8afde36 100644 --- a/firefox.spec +++ b/firefox.spec @@ -272,7 +272,6 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches Patch402: mozilla-1196777.patch Patch407: mozilla-1667096.patch -Patch408: D268839.1760704138.diff # PGO/LTO patches Patch600: pgo.patch @@ -585,7 +584,6 @@ cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysr %patch -P228 -p1 -b .disable-openh264-download %patch -P229 -p1 -b .firefox-nss-addon-hack %patch -P231 -p1 -b .fedora-customization -%patch -P408 -p1 -b .D268839.1760704138 %patch -P402 -p1 -b .1196777 %patch -P407 -p1 -b .1667096 From b58666ee948cd9e73903eaa2860e53587867ffd9 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 3 Nov 2025 13:25:27 +0100 Subject: [PATCH 518/545] Backport: libwebrtc - update PipeWire headers --- firefox.spec | 11 +- libwebrtc-update-pipewire-headers.patch | 212 ++++++++++++++++++++++++ 2 files changed, 219 insertions(+), 4 deletions(-) create mode 100644 libwebrtc-update-pipewire-headers.patch diff --git a/firefox.spec b/firefox.spec index 8afde36..27ab68f 100644 --- a/firefox.spec +++ b/firefox.spec @@ -270,8 +270,10 @@ Patch241: 0025-Add-KDE-integration-to-Firefox-toolkit-parts.patch Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches -Patch402: mozilla-1196777.patch -Patch407: mozilla-1667096.patch +Patch400: mozilla-1196777.patch +Patch401: mozilla-1667096.patch +# https://webrtc-review.googlesource.com/c/src/+/401602 +Patch402: libwebrtc-update-pipewire-headers.patch # PGO/LTO patches Patch600: pgo.patch @@ -585,8 +587,9 @@ cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysr %patch -P229 -p1 -b .firefox-nss-addon-hack %patch -P231 -p1 -b .fedora-customization -%patch -P402 -p1 -b .1196777 -%patch -P407 -p1 -b .1667096 +%patch -P400 -p1 -b .1196777 +%patch -P401 -p1 -b .1667096 +%patch -P402 -p1 -b .libwebrtc-update-pipewire-headers # PGO patches %if %{build_with_pgo} diff --git a/libwebrtc-update-pipewire-headers.patch b/libwebrtc-update-pipewire-headers.patch new file mode 100644 index 0000000..10eca6d --- /dev/null +++ b/libwebrtc-update-pipewire-headers.patch @@ -0,0 +1,212 @@ +From 8f712e0ae30b56cd52166dfb50c2937d2223db1a Mon Sep 17 00:00:00 2001 +From: Jan Grulich +Date: Tue, 05 Aug 2025 09:52:21 +0200 +Subject: [PATCH] IWYU modules/desktop_capture and modules/video_capture for PipeWire + +Done using + find modules -name "*.h" -o -name "*.cc" | xargs tools_webrtc/iwyu/apply-include-cleaner +followed by + tools_webrtc/gn_check_autofix.py -C out/Default/ +and git cl format. + +Still keep pipewire/spa headers as ignored until PipeWire with IWYU +annotations is available and until we require version of PipeWire where +we are sure all the headers do exist. + +Bug: webrtc:422940461 +Change-Id: Idb8a43f77bfe7f5e08b6542211ca1400715093f0 +Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/401602 +Reviewed-by: Philipp Hancke +Reviewed-by: Ilya Nikolaevskiy +Reviewed-by: Harald Alvestrand +Reviewed-by: Alexander Cooper +Commit-Queue: Jan Grulich +Cr-Commit-Position: refs/heads/main@{#45289} +--- + +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc +index d276411..f7603e0 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc +@@ -17,7 +17,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc +index e5eb267..3bbc482 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc +@@ -12,7 +12,13 @@ + + #include + #include +-#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include + + #include + +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +index 1a8ff9d..d54220d 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +@@ -13,7 +13,19 @@ + #include + #include + #include ++#include ++#include ++#include ++#include + #include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include + + #include + +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc +index 1055104..b06e37b 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc +@@ -12,6 +12,17 @@ + #include "modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h" + + #include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include + #include + #include + #include +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h +index f63a2e6..f35e452 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h +@@ -12,7 +12,8 @@ + #define MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_TEST_TEST_SCREENCAST_STREAM_PROVIDER_H_ + + #include +-#include ++#include ++#include + + #include "modules/desktop_capture/linux/wayland/screencast_stream_utils.h" + #include "modules/desktop_capture/rgba_color.h" +diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc +index 25c4dfa..3e6a541 100644 +--- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc ++++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc +@@ -11,11 +11,18 @@ + #include "modules/video_capture/linux/pipewire_session.h" + #include "modules/video_capture/linux/device_info_pipewire.h" + ++#include + #include + #include + #include ++#include + #include +-#include ++#include ++#include ++#include ++#include ++#include ++#include + + #include + +diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h +index 7dbba23..df8fa7f 100644 +--- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h ++++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h +@@ -12,6 +12,9 @@ + #define MODULES_VIDEO_CAPTURE_LINUX_PIPEWIRE_SESSION_H_ + + #include ++#include ++#include ++#include + + #include + #include +@@ -68,8 +71,8 @@ class PipeWireNode { + const spa_pod* param); + static bool ParseFormat(const spa_pod* param, VideoCaptureCapability* cap); + +- pw_proxy* proxy_; +- spa_hook node_listener_; ++ struct pw_proxy* proxy_; ++ struct spa_hook node_listener_; + PipeWireSession* session_; + uint32_t id_; + std::string display_name_; +diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc +index f6cd57a..8935df1 100644 +--- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc ++++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc +@@ -10,10 +10,20 @@ + + #include "modules/video_capture/linux/video_capture_pipewire.h" + ++#include ++#include ++#include ++#include + #include ++#include + #include ++#include + #include ++#include ++#include ++#include + #include ++#include + + #include + +diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h +index 240e7da..a29c153 100644 +--- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h ++++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h +@@ -11,10 +11,15 @@ + #ifndef MODULES_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_PIPEWIRE_H_ + #define MODULES_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_PIPEWIRE_H_ + ++#include ++#include ++#include ++ + #include "modules/video_capture/linux/pipewire_session.h" + #include "modules/video_capture/video_capture_defines.h" + #include "modules/video_capture/video_capture_impl.h" + ++ + namespace webrtc { + namespace videocapturemodule { + class VideoCaptureModulePipeWire : public VideoCaptureImpl { From 1c782e34ff1070da1f682e140ef6845c43371a70 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 5 Nov 2025 14:29:08 +0100 Subject: [PATCH 519/545] Updated to 145.0 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- pgo.patch | 42 +++++++++++++++++++++--------------------- sources | 4 ++-- 4 files changed, 30 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index cc1defc..bfc1598 100644 --- a/.gitignore +++ b/.gitignore @@ -735,3 +735,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-144.0-20251009.tar.xz /firefox-144.0.source.tar.xz /firefox-langpacks-144.0-20251010.tar.xz +/firefox-145.0.source.tar.xz +/firefox-langpacks-145.0-20251105.tar.xz diff --git a/firefox.spec b/firefox.spec index 8afde36..f7dbd16 100644 --- a/firefox.spec +++ b/firefox.spec @@ -200,14 +200,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 144.0.2 +Version: 145.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20251030.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20251105.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1260,6 +1260,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Nov 05 2025 Martin Stransky - 145.0-1 +- Updated to 145.0 + * Thu Oct 30 2025 Martin Stransky - 144.0.2-1 - Updated to 144.0.2 diff --git a/pgo.patch b/pgo.patch index 69a6741..c1ae97d 100644 --- a/pgo.patch +++ b/pgo.patch @@ -1,6 +1,6 @@ -diff -up firefox-142.0/build/moz.configure/lto-pgo.configure.pgo firefox-142.0/build/moz.configure/lto-pgo.configure ---- firefox-142.0/build/moz.configure/lto-pgo.configure.pgo 2025-08-11 20:04:27.000000000 +0200 -+++ firefox-142.0/build/moz.configure/lto-pgo.configure 2025-08-14 15:04:02.135920021 +0200 +diff -up firefox-145.0/build/moz.configure/lto-pgo.configure.pgo firefox-145.0/build/moz.configure/lto-pgo.configure +--- firefox-145.0/build/moz.configure/lto-pgo.configure.pgo 2025-11-03 16:56:55.000000000 +0100 ++++ firefox-145.0/build/moz.configure/lto-pgo.configure 2025-11-05 13:59:53.477443914 +0100 @@ -96,12 +96,16 @@ set_config("PGO_PROFILE_PATH", pgo_profi @depends( @@ -28,9 +28,9 @@ diff -up firefox-142.0/build/moz.configure/lto-pgo.configure.pgo firefox-142.0/b use_ldflags=["-fprofile-use"], ) -diff -up firefox-142.0/build/pgo/profileserver.py.pgo firefox-142.0/build/pgo/profileserver.py ---- firefox-142.0/build/pgo/profileserver.py.pgo 2025-08-11 20:04:27.000000000 +0200 -+++ firefox-142.0/build/pgo/profileserver.py 2025-08-14 15:05:07.519412644 +0200 +diff -up firefox-145.0/build/pgo/profileserver.py.pgo firefox-145.0/build/pgo/profileserver.py +--- firefox-145.0/build/pgo/profileserver.py.pgo 2025-11-03 16:56:55.000000000 +0100 ++++ firefox-145.0/build/pgo/profileserver.py 2025-11-05 13:59:53.477602066 +0100 @@ -10,7 +10,7 @@ import subprocess import sys @@ -66,13 +66,13 @@ diff -up firefox-142.0/build/pgo/profileserver.py.pgo firefox-142.0/build/pgo/pr with TemporaryDirectory() as profilePath: # TODO: refactor this into mozprofile -diff -up firefox-142.0/gfx/2d/moz.build.pgo firefox-142.0/gfx/2d/moz.build ---- firefox-142.0/gfx/2d/moz.build.pgo 2025-08-11 20:04:29.000000000 +0200 -+++ firefox-142.0/gfx/2d/moz.build 2025-08-14 15:04:02.136286381 +0200 -@@ -138,11 +138,11 @@ if CONFIG["INTEL_ARCHITECTURE"]: +diff -up firefox-145.0/gfx/2d/moz.build.pgo firefox-145.0/gfx/2d/moz.build +--- firefox-145.0/gfx/2d/moz.build.pgo 2025-11-03 16:56:57.000000000 +0100 ++++ firefox-145.0/gfx/2d/moz.build 2025-11-05 14:21:20.485610837 +0100 +@@ -137,11 +137,11 @@ if CONFIG["INTEL_ARCHITECTURE"]: + DEFINES["USE_SSE2"] = True # The file uses SSE2 intrinsics, so it needs special compile flags on some # compilers. - SOURCES["BlurSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] - SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2"] + SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2", "-fno-lto"] SOURCES["ConvolutionFilterSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] @@ -82,10 +82,10 @@ diff -up firefox-142.0/gfx/2d/moz.build.pgo firefox-142.0/gfx/2d/moz.build + SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2", "-fno-lto"] SOURCES["SwizzleSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] SOURCES["SwizzleSSSE3.cpp"].flags += CONFIG["SSSE3_FLAGS"] - elif CONFIG["TARGET_CPU"].startswith("mips"): -diff -up firefox-142.0/gfx/skia/generate_mozbuild.py.pgo firefox-142.0/gfx/skia/generate_mozbuild.py ---- firefox-142.0/gfx/skia/generate_mozbuild.py.pgo 2025-08-11 20:04:30.000000000 +0200 -+++ firefox-142.0/gfx/skia/generate_mozbuild.py 2025-08-14 15:04:02.136434775 +0200 + +diff -up firefox-145.0/gfx/skia/generate_mozbuild.py.pgo firefox-145.0/gfx/skia/generate_mozbuild.py +--- firefox-145.0/gfx/skia/generate_mozbuild.py.pgo 2025-11-03 16:56:57.000000000 +0100 ++++ firefox-145.0/gfx/skia/generate_mozbuild.py 2025-11-05 13:59:53.477947055 +0100 @@ -50,8 +50,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind if CONFIG['INTEL_ARCHITECTURE']: SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX'] @@ -97,9 +97,9 @@ diff -up firefox-142.0/gfx/skia/generate_mozbuild.py.pgo firefox-142.0/gfx/skia/ SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags += skia_ssse3_flags SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags += skia_ssse3_flags SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3'] -diff -up firefox-142.0/gfx/skia/moz.build.pgo firefox-142.0/gfx/skia/moz.build ---- firefox-142.0/gfx/skia/moz.build.pgo 2025-08-11 20:04:30.000000000 +0200 -+++ firefox-142.0/gfx/skia/moz.build 2025-08-14 15:04:02.136573991 +0200 +diff -up firefox-145.0/gfx/skia/moz.build.pgo firefox-145.0/gfx/skia/moz.build +--- firefox-145.0/gfx/skia/moz.build.pgo 2025-11-03 16:56:57.000000000 +0100 ++++ firefox-145.0/gfx/skia/moz.build 2025-11-05 13:59:53.478077484 +0100 @@ -597,8 +597,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind if CONFIG['INTEL_ARCHITECTURE']: SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX'] @@ -111,9 +111,9 @@ diff -up firefox-142.0/gfx/skia/moz.build.pgo firefox-142.0/gfx/skia/moz.build SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags += skia_ssse3_flags SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags += skia_ssse3_flags SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3'] -diff -up firefox-142.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-142.0/toolkit/components/terminator/nsTerminator.cpp ---- firefox-142.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2025-08-11 20:04:46.000000000 +0200 -+++ firefox-142.0/toolkit/components/terminator/nsTerminator.cpp 2025-08-14 15:04:02.136726031 +0200 +diff -up firefox-145.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-145.0/toolkit/components/terminator/nsTerminator.cpp +--- firefox-145.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2025-11-03 16:57:15.000000000 +0100 ++++ firefox-145.0/toolkit/components/terminator/nsTerminator.cpp 2025-11-05 13:59:53.478238011 +0100 @@ -330,6 +330,11 @@ void nsTerminator::StartWatchdog() { } #endif diff --git a/sources b/sources index d9bb1b5..d764eaa 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-144.0.2.source.tar.xz) = 87eebabab2c85eb32b2d1161e520f56e271a4893c8cd4d8225fc7b498a9883496315854a758478fb4edd061674a9f7c0503e9b9f0eb4503b1f89203774d02f97 -SHA512 (firefox-langpacks-144.0.2-20251030.tar.xz) = eb8164500601e68b3df184fea9b48f32f34e7de8d6b00b269df26dd0eaa8a6848371bdd03dc8980c746fd9fce1e0c79d890e685460bd0143bd03c6f374b85640 +SHA512 (firefox-145.0.source.tar.xz) = 78554c68aa7cb3ecc2f842ce91debedb512151abfecc674ae9751b32be2c22de54b09b085b2d7e9f79626051b4b100a699c591193191fb736fd89ec9fc7c62d5 +SHA512 (firefox-langpacks-145.0-20251105.tar.xz) = 9101fd12ac19bafe2a725b22a1b2e70e8e49db4aa557f1f1c346418986e1f4e08cb59ed74eaef8280b3fcd9906a0701a0eac6bde26350b6b448c12a620ebd9d5 From e3513faf0e73f1c138bea187ee1fc3b602fee01f Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 6 Nov 2025 09:26:42 +0100 Subject: [PATCH 520/545] Temporary disabled libwebrtc-update-pipewire-headers.patch --- firefox.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index cfd26c4..7443595 100644 --- a/firefox.spec +++ b/firefox.spec @@ -589,7 +589,8 @@ cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysr %patch -P400 -p1 -b .1196777 %patch -P401 -p1 -b .1667096 -%patch -P402 -p1 -b .libwebrtc-update-pipewire-headers +# Temporary disabled, doesn't apply to 145 +#%patch -P402 -p1 -b .libwebrtc-update-pipewire-headers # PGO patches %if %{build_with_pgo} From 2762f92444b998554a68b930cd6be718a72eb503 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 6 Nov 2025 12:55:38 +0100 Subject: [PATCH 521/545] Really remove libwebrtc-update-pipewire-headers.patch --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 7443595..d6e3452 100644 --- a/firefox.spec +++ b/firefox.spec @@ -273,7 +273,7 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch Patch400: mozilla-1196777.patch Patch401: mozilla-1667096.patch # https://webrtc-review.googlesource.com/c/src/+/401602 -Patch402: libwebrtc-update-pipewire-headers.patch +#Patch402: libwebrtc-update-pipewire-headers.patch # PGO/LTO patches Patch600: pgo.patch From 94772650729110b12dbfa45435a6b718cb7d5c10 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 10 Nov 2025 10:44:00 +0100 Subject: [PATCH 522/545] Remporary disable LTO due to https://gcc.gnu.org/PR122620 --- firefox.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index d6e3452..df7d576 100644 --- a/firefox.spec +++ b/firefox.spec @@ -896,7 +896,9 @@ export CCACHE_DISABLE=1 export GCOV_PREFIX=`pwd -P`/objdir export GCOV_PREFIX_STRIP=$(( $(echo `pwd -P`|tr -c -d '/' |wc -c )+2 )) env | grep GCOV -echo "ac_add_options --enable-lto" >> .mozconfig +#echo "ac_add_options --enable-lto" >> .mozconfig +# Temporary disable due to https://gcc.gnu.org/PR122620 +echo "ac_add_options --disable-lto" >> .mozconfig echo "ac_add_options MOZ_PGO=1" >> .mozconfig %endif From 1b8800e37a9c4f5b3f646d8cfb05bf9a8ef46641 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 10 Nov 2025 11:52:32 +0100 Subject: [PATCH 523/545] Removed unused patch --- firefox.spec | 6 +- libwebrtc-update-pipewire-headers.patch | 212 ------------------------ 2 files changed, 1 insertion(+), 217 deletions(-) delete mode 100644 libwebrtc-update-pipewire-headers.patch diff --git a/firefox.spec b/firefox.spec index df7d576..14f38ea 100644 --- a/firefox.spec +++ b/firefox.spec @@ -201,7 +201,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 145.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -272,8 +272,6 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches Patch400: mozilla-1196777.patch Patch401: mozilla-1667096.patch -# https://webrtc-review.googlesource.com/c/src/+/401602 -#Patch402: libwebrtc-update-pipewire-headers.patch # PGO/LTO patches Patch600: pgo.patch @@ -589,8 +587,6 @@ cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysr %patch -P400 -p1 -b .1196777 %patch -P401 -p1 -b .1667096 -# Temporary disabled, doesn't apply to 145 -#%patch -P402 -p1 -b .libwebrtc-update-pipewire-headers # PGO patches %if %{build_with_pgo} diff --git a/libwebrtc-update-pipewire-headers.patch b/libwebrtc-update-pipewire-headers.patch deleted file mode 100644 index 10eca6d..0000000 --- a/libwebrtc-update-pipewire-headers.patch +++ /dev/null @@ -1,212 +0,0 @@ -From 8f712e0ae30b56cd52166dfb50c2937d2223db1a Mon Sep 17 00:00:00 2001 -From: Jan Grulich -Date: Tue, 05 Aug 2025 09:52:21 +0200 -Subject: [PATCH] IWYU modules/desktop_capture and modules/video_capture for PipeWire - -Done using - find modules -name "*.h" -o -name "*.cc" | xargs tools_webrtc/iwyu/apply-include-cleaner -followed by - tools_webrtc/gn_check_autofix.py -C out/Default/ -and git cl format. - -Still keep pipewire/spa headers as ignored until PipeWire with IWYU -annotations is available and until we require version of PipeWire where -we are sure all the headers do exist. - -Bug: webrtc:422940461 -Change-Id: Idb8a43f77bfe7f5e08b6542211ca1400715093f0 -Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/401602 -Reviewed-by: Philipp Hancke -Reviewed-by: Ilya Nikolaevskiy -Reviewed-by: Harald Alvestrand -Reviewed-by: Alexander Cooper -Commit-Queue: Jan Grulich -Cr-Commit-Position: refs/heads/main@{#45289} ---- - -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc -index d276411..f7603e0 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc -@@ -17,7 +17,7 @@ - #include - #include - #include --#include -+#include - #include - #include - -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc -index e5eb267..3bbc482 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc -@@ -12,7 +12,13 @@ - - #include - #include --#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include - - #include - -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -index 1a8ff9d..d54220d 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -@@ -13,7 +13,19 @@ - #include - #include - #include -+#include -+#include -+#include -+#include - #include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include - - #include - -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc -index 1055104..b06e37b 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc -@@ -12,6 +12,17 @@ - #include "modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h" - - #include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include - #include - #include - #include -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h -index f63a2e6..f35e452 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h -@@ -12,7 +12,8 @@ - #define MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_TEST_TEST_SCREENCAST_STREAM_PROVIDER_H_ - - #include --#include -+#include -+#include - - #include "modules/desktop_capture/linux/wayland/screencast_stream_utils.h" - #include "modules/desktop_capture/rgba_color.h" -diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc -index 25c4dfa..3e6a541 100644 ---- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc -+++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc -@@ -11,11 +11,18 @@ - #include "modules/video_capture/linux/pipewire_session.h" - #include "modules/video_capture/linux/device_info_pipewire.h" - -+#include - #include - #include - #include -+#include - #include --#include -+#include -+#include -+#include -+#include -+#include -+#include - - #include - -diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h -index 7dbba23..df8fa7f 100644 ---- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h -+++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h -@@ -12,6 +12,9 @@ - #define MODULES_VIDEO_CAPTURE_LINUX_PIPEWIRE_SESSION_H_ - - #include -+#include -+#include -+#include - - #include - #include -@@ -68,8 +71,8 @@ class PipeWireNode { - const spa_pod* param); - static bool ParseFormat(const spa_pod* param, VideoCaptureCapability* cap); - -- pw_proxy* proxy_; -- spa_hook node_listener_; -+ struct pw_proxy* proxy_; -+ struct spa_hook node_listener_; - PipeWireSession* session_; - uint32_t id_; - std::string display_name_; -diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc -index f6cd57a..8935df1 100644 ---- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc -+++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc -@@ -10,10 +10,20 @@ - - #include "modules/video_capture/linux/video_capture_pipewire.h" - -+#include -+#include -+#include -+#include - #include -+#include - #include -+#include - #include -+#include -+#include -+#include - #include -+#include - - #include - -diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h -index 240e7da..a29c153 100644 ---- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h -+++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h -@@ -11,10 +11,15 @@ - #ifndef MODULES_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_PIPEWIRE_H_ - #define MODULES_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_PIPEWIRE_H_ - -+#include -+#include -+#include -+ - #include "modules/video_capture/linux/pipewire_session.h" - #include "modules/video_capture/video_capture_defines.h" - #include "modules/video_capture/video_capture_impl.h" - -+ - namespace webrtc { - namespace videocapturemodule { - class VideoCaptureModulePipeWire : public VideoCaptureImpl { From b562ef83c9c52977bec4e7eef0caed127bed363c Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 10 Nov 2025 11:54:15 +0100 Subject: [PATCH 524/545] Release version update --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 14f38ea..0641f25 100644 --- a/firefox.spec +++ b/firefox.spec @@ -201,7 +201,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 145.0 -Release: 2%{?pre_tag}%{?dist} +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ From 2d4ef1e9c67117692eb57072f027d2c0f29f7b6b Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 11 Nov 2025 10:05:59 +0100 Subject: [PATCH 525/545] Updated to 145.0 build 2 --- .gitignore | 1 + firefox.spec | 14 ++++++++------ sources | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index bfc1598..3e282ad 100644 --- a/.gitignore +++ b/.gitignore @@ -737,3 +737,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-144.0-20251010.tar.xz /firefox-145.0.source.tar.xz /firefox-langpacks-145.0-20251105.tar.xz +/firefox-langpacks-145.0-20251111.tar.xz diff --git a/firefox.spec b/firefox.spec index 0641f25..b8ca280 100644 --- a/firefox.spec +++ b/firefox.spec @@ -107,7 +107,8 @@ ExcludeArch: i686 %global build_with_pgo 0 %ifarch x86_64 %if %{release_build} -%global build_with_pgo 1 +# Temporary disable due to https://gcc.gnu.org/PR122620 +%global build_with_pgo 0 %endif %endif %if 0%{?flatpak} @@ -201,13 +202,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 145.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20251105.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20251111.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -892,9 +893,7 @@ export CCACHE_DISABLE=1 export GCOV_PREFIX=`pwd -P`/objdir export GCOV_PREFIX_STRIP=$(( $(echo `pwd -P`|tr -c -d '/' |wc -c )+2 )) env | grep GCOV -#echo "ac_add_options --enable-lto" >> .mozconfig -# Temporary disable due to https://gcc.gnu.org/PR122620 -echo "ac_add_options --disable-lto" >> .mozconfig +echo "ac_add_options --enable-lto" >> .mozconfig echo "ac_add_options MOZ_PGO=1" >> .mozconfig %endif @@ -1262,6 +1261,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Nov 11 2025 Martin Stransky - 145.0-2 +- Updated to 145.0 B2 + * Wed Nov 05 2025 Martin Stransky - 145.0-1 - Updated to 145.0 diff --git a/sources b/sources index d764eaa..8e64714 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-145.0.source.tar.xz) = 78554c68aa7cb3ecc2f842ce91debedb512151abfecc674ae9751b32be2c22de54b09b085b2d7e9f79626051b4b100a699c591193191fb736fd89ec9fc7c62d5 -SHA512 (firefox-langpacks-145.0-20251105.tar.xz) = 9101fd12ac19bafe2a725b22a1b2e70e8e49db4aa557f1f1c346418986e1f4e08cb59ed74eaef8280b3fcd9906a0701a0eac6bde26350b6b448c12a620ebd9d5 +SHA512 (firefox-145.0.source.tar.xz) = 7ba40d7de95d7b93278f1823ce460b45c6bfac01eda52bc5c28f23a6bc858bdcbf8b4b4dc359b853372fffbcff4e7f0b276fefe22c2d4a0fa303e8ce1d2629be +SHA512 (firefox-langpacks-145.0-20251111.tar.xz) = b02ba448cc8f233a44811b23ce1abb43f1574aa47a058ef4c1cd9bd3c8930a2b5de4be786ef808f3330fa61bc222a007b5fc643c19527fadd6110bae568ccb69 From c462501e8db0043cd76c3080fdd4f1df4cec0ef2 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 19 Nov 2025 10:13:11 +0100 Subject: [PATCH 526/545] Updated to 145.0.1, enabled PGO --- .gitignore | 2 ++ firefox.spec | 12 +++++++----- sources | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 3e282ad..69ebc12 100644 --- a/.gitignore +++ b/.gitignore @@ -738,3 +738,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-145.0.source.tar.xz /firefox-langpacks-145.0-20251105.tar.xz /firefox-langpacks-145.0-20251111.tar.xz +/firefox-145.0.1.source.tar.xz +/firefox-langpacks-145.0.1-20251119.tar.xz diff --git a/firefox.spec b/firefox.spec index b8ca280..5e1c6f4 100644 --- a/firefox.spec +++ b/firefox.spec @@ -107,8 +107,7 @@ ExcludeArch: i686 %global build_with_pgo 0 %ifarch x86_64 %if %{release_build} -# Temporary disable due to https://gcc.gnu.org/PR122620 -%global build_with_pgo 0 +%global build_with_pgo 1 %endif %endif %if 0%{?flatpak} @@ -201,14 +200,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 145.0 -Release: 2%{?pre_tag}%{?dist} +Version: 145.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20251111.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20251119.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1261,6 +1260,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Nov 19 2025 Martin Stransky - 145.0.1-1 +- Updated to 145.0.1 + * Tue Nov 11 2025 Martin Stransky - 145.0-2 - Updated to 145.0 B2 diff --git a/sources b/sources index 8e64714..8e87a93 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-145.0.source.tar.xz) = 7ba40d7de95d7b93278f1823ce460b45c6bfac01eda52bc5c28f23a6bc858bdcbf8b4b4dc359b853372fffbcff4e7f0b276fefe22c2d4a0fa303e8ce1d2629be -SHA512 (firefox-langpacks-145.0-20251111.tar.xz) = b02ba448cc8f233a44811b23ce1abb43f1574aa47a058ef4c1cd9bd3c8930a2b5de4be786ef808f3330fa61bc222a007b5fc643c19527fadd6110bae568ccb69 +SHA512 (firefox-145.0.1.source.tar.xz) = 6e052fee46c31b2696ba5403f905e0b94b08ce354588cd6315d54ee1dcff9b82835d64ea5a57596dfb1866dd1518a29966fdaabdb4c3838103344bd2dc18c72d +SHA512 (firefox-langpacks-145.0.1-20251119.tar.xz) = 8bfa41b7d99e83000ff2cffcd6a56eddc41d90026ba37642d0e52b46459a2a57567d76c66d9beaebe67325b489c51a0e42d2e7694a60781e5e37946c892bfb08 From dc17442e7c1550afc5a2aca9c4c0e692a8b7cb05 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 3 Dec 2025 09:23:46 +0100 Subject: [PATCH 527/545] Updated to 146.0 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 69ebc12..9633b70 100644 --- a/.gitignore +++ b/.gitignore @@ -740,3 +740,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-145.0-20251111.tar.xz /firefox-145.0.1.source.tar.xz /firefox-langpacks-145.0.1-20251119.tar.xz +/firefox-146.0.source.tar.xz +/firefox-langpacks-146.0-20251202.tar.xz diff --git a/firefox.spec b/firefox.spec index 5e1c6f4..cf895b7 100644 --- a/firefox.spec +++ b/firefox.spec @@ -200,14 +200,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 145.0.1 +Version: 146.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20251119.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20251202.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1260,6 +1260,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Dec 03 2025 Martin Stransky - 146.0-1 +- Updated to 146.0 + * Wed Nov 19 2025 Martin Stransky - 145.0.1-1 - Updated to 145.0.1 diff --git a/sources b/sources index 8e87a93..4d687ab 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f -SHA512 (firefox-145.0.1.source.tar.xz) = 6e052fee46c31b2696ba5403f905e0b94b08ce354588cd6315d54ee1dcff9b82835d64ea5a57596dfb1866dd1518a29966fdaabdb4c3838103344bd2dc18c72d -SHA512 (firefox-langpacks-145.0.1-20251119.tar.xz) = 8bfa41b7d99e83000ff2cffcd6a56eddc41d90026ba37642d0e52b46459a2a57567d76c66d9beaebe67325b489c51a0e42d2e7694a60781e5e37946c892bfb08 +SHA512 (firefox-146.0.source.tar.xz) = 768ca227b8253b52fe089ef26d66408c447af611f5fd115fc90bfc4e3ddb787a044bc827dbeb361e1eb2d69354d9fa1978ae42f6cff45c9484c40c95e90eb67f +SHA512 (firefox-langpacks-146.0-20251202.tar.xz) = 42a9282afd48b298ff059180ed75a70c2c5a235daa9c15665478c006e60af8a135c5e82521755011867ebed7a66da547a8634425cf759d688130406457fa929e From f99934eed5d8d0dc047cc2791b9ae9c1fdd46f5e Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 3 Dec 2025 12:04:57 +0100 Subject: [PATCH 528/545] Updated cbindgen --- gen_cbindgen-vendor.sh | 2 +- sources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gen_cbindgen-vendor.sh b/gen_cbindgen-vendor.sh index c131864..5711901 100755 --- a/gen_cbindgen-vendor.sh +++ b/gen_cbindgen-vendor.sh @@ -12,7 +12,7 @@ to be used with 'cargo vendor' commmand. """ [dependencies] -cbindgen = "0.28.0" +cbindgen = "0.29.1" [[bin]] name = "dummy" diff --git a/sources b/sources index 4d687ab..983d332 100644 --- a/sources +++ b/sources @@ -2,6 +2,6 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 -SHA512 (cbindgen-vendor.tar.xz) = dd99c0233c421e973d62512aee0dfe6e31bf5f30c26522485474541f37806052298f1e9a4fb0f388ed0074564fc1dc7edc0c16c411886576b754df92e97caf8f SHA512 (firefox-146.0.source.tar.xz) = 768ca227b8253b52fe089ef26d66408c447af611f5fd115fc90bfc4e3ddb787a044bc827dbeb361e1eb2d69354d9fa1978ae42f6cff45c9484c40c95e90eb67f SHA512 (firefox-langpacks-146.0-20251202.tar.xz) = 42a9282afd48b298ff059180ed75a70c2c5a235daa9c15665478c006e60af8a135c5e82521755011867ebed7a66da547a8634425cf759d688130406457fa929e +SHA512 (cbindgen-vendor.tar.xz) = bea420e66bdd1c7c944655dd3e01abd6e7d6ac4b245c7ee190f31d800f7786f21e5cae11715b479bf795f4369d18c40dc12df19e0b643664f2f78e5c8a681415 From 0c021524a474cb6cfad72b5598e7a79991c2a9f7 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 8 Dec 2025 21:59:20 +0100 Subject: [PATCH 529/545] Updated to 146.0 build 2 --- .gitignore | 1 + firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 9633b70..be18a7a 100644 --- a/.gitignore +++ b/.gitignore @@ -742,3 +742,4 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-145.0.1-20251119.tar.xz /firefox-146.0.source.tar.xz /firefox-langpacks-146.0-20251202.tar.xz +/firefox-langpacks-146.0-20251208.tar.xz diff --git a/firefox.spec b/firefox.spec index cf895b7..8cf11c4 100644 --- a/firefox.spec +++ b/firefox.spec @@ -201,13 +201,13 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 146.0 -Release: 1%{?pre_tag}%{?dist} +Release: 2%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20251202.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20251208.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1260,6 +1260,9 @@ fi #--------------------------------------------------------------------- %changelog +* Mon Dec 08 2025 Martin Stransky - 146.0-2 +- Updated to 146.0 build 2 + * Wed Dec 03 2025 Martin Stransky - 146.0-1 - Updated to 146.0 diff --git a/sources b/sources index 983d332..ac0fdb4 100644 --- a/sources +++ b/sources @@ -2,6 +2,6 @@ SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb5 SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 -SHA512 (firefox-146.0.source.tar.xz) = 768ca227b8253b52fe089ef26d66408c447af611f5fd115fc90bfc4e3ddb787a044bc827dbeb361e1eb2d69354d9fa1978ae42f6cff45c9484c40c95e90eb67f -SHA512 (firefox-langpacks-146.0-20251202.tar.xz) = 42a9282afd48b298ff059180ed75a70c2c5a235daa9c15665478c006e60af8a135c5e82521755011867ebed7a66da547a8634425cf759d688130406457fa929e SHA512 (cbindgen-vendor.tar.xz) = bea420e66bdd1c7c944655dd3e01abd6e7d6ac4b245c7ee190f31d800f7786f21e5cae11715b479bf795f4369d18c40dc12df19e0b643664f2f78e5c8a681415 +SHA512 (firefox-langpacks-146.0-20251208.tar.xz) = 6084dc27a0519647ca6016fb4e6a95bcdcf9cab409abffc8296af237b650d0704ff351dd66ebe4ef52f65622941f0a40f7ffe52cfb15d416e7cba6ce11f47b00 +SHA512 (firefox-146.0.source.tar.xz) = db6664310cdcdede832b29dea533b345a3ac86f9df7813118d44b1ec2c4a32e4de2b6e98044385ca6f6026eb3a9994c486a1ddb8b6f4ae7589ed46b122c05630 From 853aa9dc99f52b0a9f795e6f63ef2c2c502e067d Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Thu, 11 Dec 2025 12:39:21 +0100 Subject: [PATCH 530/545] Added build patches for rawhide --- build-c11-threads-avail.patch | 29 +++++++++++++++++++++++++++++ build-seccomp.patch | 11 +++++++++++ firefox.spec | 6 ++++++ 3 files changed, 46 insertions(+) create mode 100644 build-c11-threads-avail.patch create mode 100644 build-seccomp.patch diff --git a/build-c11-threads-avail.patch b/build-c11-threads-avail.patch new file mode 100644 index 0000000..740efd9 --- /dev/null +++ b/build-c11-threads-avail.patch @@ -0,0 +1,29 @@ +diff -up thunderbird-145.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads.h.build-c11-threads-avail thunderbird-145.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads.h +diff -up thunderbird-145.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h.build-c11-threads-avail thunderbird-145.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h +--- thunderbird-145.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h.build-c11-threads-avail 2025-11-20 12:10:52.605376092 +0100 ++++ thunderbird-145.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h 2025-11-25 13:35:01.220333404 +0100 +@@ -66,7 +66,7 @@ typedef pthread_cond_t cnd_t; + typedef pthread_t thrd_t; + typedef pthread_key_t tss_t; + typedef pthread_mutex_t mtx_t; +-typedef pthread_once_t once_flag; ++//typedef pthread_once_t once_flag; + + + /* +@@ -90,12 +90,13 @@ impl_thrd_routine(void *p) + + /*--------------- 7.25.2 Initialization functions ---------------*/ + // 7.25.2.1 +-static inline void ++// ++/*static inline void + call_once(once_flag *flag, void (*func)(void)) + { + pthread_once(flag, func); + } +- ++*/ + + /*------------- 7.25.3 Condition variable functions -------------*/ + // 7.25.3.1 diff --git a/build-seccomp.patch b/build-seccomp.patch new file mode 100644 index 0000000..b57f65a --- /dev/null +++ b/build-seccomp.patch @@ -0,0 +1,11 @@ +diff -up thunderbird-145.0/security/sandbox/chromium/sandbox/linux/system_headers/linux_seccomp.h.seccomp thunderbird-145.0/security/sandbox/chromium/sandbox/linux/system_headers/linux_seccomp.h +--- thunderbird-145.0/security/sandbox/chromium/sandbox/linux/system_headers/linux_seccomp.h.seccomp 2025-12-09 13:42:31.378958842 +0100 ++++ thunderbird-145.0/security/sandbox/chromium/sandbox/linux/system_headers/linux_seccomp.h 2025-12-09 13:42:37.886937626 +0100 +@@ -6,6 +6,7 @@ + #define SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SECCOMP_H_ + + #include ++#include + #include + + #include "build/build_config.h" diff --git a/firefox.spec b/firefox.spec index 8cf11c4..bdb8807 100644 --- a/firefox.spec +++ b/firefox.spec @@ -256,6 +256,8 @@ Patch78: firefox-i686-build.patch Patch79: firefox-gcc-13-build.patch Patch80: wasi.patch Patch81: firefox-gcc-15.0-s390.patch +Patch82: build-c11-threads-avail.patch +Patch83: build-seccomp.patch # Fedora specific patches @@ -567,6 +569,10 @@ This package contains results of tests executed during build. %patch -P78 -p1 -b .firefox-i686 %patch -P79 -p1 -b .firefox-gcc-13-build %patch -P81 -p1 -b .firefox-gcc-15.0-s390 +%if 0%{?fedora} >= 44 +%patch -P82 -p1 -b .build-c11-threads-avail +%patch -P83 -p1 -b .build-seccomp +%endif # We need to create the wasi.patch with the correct path to the wasm libclang_rt. %if %{with wasi_sdk} From ed74b03b2d1fa2e20a2236b3b760a88f2d5c7548 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Thu, 11 Dec 2025 13:02:33 +0100 Subject: [PATCH 531/545] Added D275955.1765540580 --- D275955.1765540580.diff | 17 +++++++++++++++++ firefox.spec | 2 ++ 2 files changed, 19 insertions(+) create mode 100644 D275955.1765540580.diff diff --git a/D275955.1765540580.diff b/D275955.1765540580.diff new file mode 100644 index 0000000..65928d8 --- /dev/null +++ b/D275955.1765540580.diff @@ -0,0 +1,17 @@ +diff --git a/parser/htmlaccel/htmlaccelEnabled.h b/parser/htmlaccel/htmlaccelEnabled.h +--- a/parser/htmlaccel/htmlaccelEnabled.h ++++ b/parser/htmlaccel/htmlaccelEnabled.h +@@ -26,11 +26,11 @@ + inline bool htmlaccelEnabled() { + #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ < 12 + // __GNUC__ is stuck at 4 in clang, so we need to check __clang__ above. + // GCC 12 or newer is required for __builtin_shuffle. + return false; +-#elif defined(__aarch64__) && defined(__LITTLE_ENDIAN__) ++#elif defined(__aarch64__) && defined(__ORDER_LITTLE_ENDIAN__) + # define MOZ_MAY_HAVE_HTMLACCEL 1 + return true; + #elif defined(__x86_64__) + # define MOZ_MAY_HAVE_HTMLACCEL 1 + bool ret = mozilla::supports_bmi(); + diff --git a/firefox.spec b/firefox.spec index bdb8807..91f6373 100644 --- a/firefox.spec +++ b/firefox.spec @@ -274,6 +274,7 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches Patch400: mozilla-1196777.patch Patch401: mozilla-1667096.patch +Patch402: D275955.1765540580.diff # PGO/LTO patches Patch600: pgo.patch @@ -593,6 +594,7 @@ cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysr %patch -P400 -p1 -b .1196777 %patch -P401 -p1 -b .1667096 +%patch -P402 -p1 -b .D275955.1765540580 # PGO patches %if %{build_with_pgo} From e611a5f21790c7f52205caa9b1232e9b67a192cc Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Thu, 11 Dec 2025 13:08:48 +0100 Subject: [PATCH 532/545] Fixed rawhide gcc build (kudos to jhorak who hacked it! He's just awesome.) --- firefox.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 91f6373..4656770 100644 --- a/firefox.spec +++ b/firefox.spec @@ -201,7 +201,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 146.0 -Release: 2%{?pre_tag}%{?dist} +Release: 3%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -1268,6 +1268,10 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Dec 11 2025 Martin Stransky - 146.0-3 +- Added aarch64 crash fix +- Fixed rawhide gcc build (kudos to jhorak who hacked it! He's just awesome.) + * Mon Dec 08 2025 Martin Stransky - 146.0-2 - Updated to 146.0 build 2 From d96e56c1d7a60a80ff82130129a75cf1dde11565 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Thu, 11 Dec 2025 13:33:43 +0100 Subject: [PATCH 533/545] Fix build-c11-threads-avail patch --- build-c11-threads-avail.patch | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/build-c11-threads-avail.patch b/build-c11-threads-avail.patch index 740efd9..73ed5f5 100644 --- a/build-c11-threads-avail.patch +++ b/build-c11-threads-avail.patch @@ -1,7 +1,14 @@ -diff -up thunderbird-145.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads.h.build-c11-threads-avail thunderbird-145.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads.h -diff -up thunderbird-145.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h.build-c11-threads-avail thunderbird-145.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h ---- thunderbird-145.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h.build-c11-threads-avail 2025-11-20 12:10:52.605376092 +0100 -+++ thunderbird-145.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h 2025-11-25 13:35:01.220333404 +0100 +diff -up firefox-146.0/third_party/rust/glslopt/.cargo-checksum.json.build-c11-threads-avail firefox-146.0/third_party/rust/glslopt/.cargo-checksum.json +--- firefox-146.0/third_party/rust/glslopt/.cargo-checksum.json.build-c11-threads-avail 2025-12-05 18:43:21.000000000 +0100 ++++ firefox-146.0/third_party/rust/glslopt/.cargo-checksum.json 2025-12-11 13:32:52.599001257 +0100 +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"010bb96167ff152e0e5ac30f9905dc749a3f038199b70c541c5d8cb97a185ee3","README.md":"4468e08c64c19977707d792bfab0080e35ff927b64990eab77873f8ba056ba1c","build.rs":"6a64610018701781af182c418a4355c9ac5d99d000be9457f0e38a7dadf7542a","glsl-optimizer/CMakeLists.txt":"42ce94744e82ffa000da8b64d81fc140e293b9f5da7dd4cf6b49e7404a2448d9","glsl-optimizer/README.md":"b18eef11a92d267d88a937b1154f7670ee433c730b102fdf7e2da0b02722b146","glsl-optimizer/contrib/glslopt/Main.cpp":"14ba213210c62e234b8d9b0052105fed28eedd83d535ebe85acc10bda7322dd4","glsl-optimizer/contrib/glslopt/Readme":"65d2a6f1aa1dc61e903e090cdade027abad33e02e7c9c81e07dc80508acadec4","glsl-optimizer/generateParsers.sh":"878a97db5d3b69eb3b4c3a95780763b373cfcc0c02e0b28894f162dbbd1b8848","glsl-optimizer/include/GL/gl.h":"1989b51365b6d7d0c48ff6e8b181ef75e2cdf71bfb1626b1cc4362e2f54854a3","glsl-optimizer/include/GL/glext.h":"2ac3681045a35a2194a81a960cad395c04bef1c8a20ef46b799fb24af3ec5f70","glsl-optimizer/include/KHR/khrplatform.h":"1448141a0c054d7f46edfb63f4fe6c203acf9591974049481c32442fb03fd6ed","glsl-optimizer/include/c11/threads.h":"56e9e592b28df19f0db432125223cb3eb5c0c1f960c22db96a15692e14776337","glsl-optimizer/include/c11/threads_posix.h":"f8ad2b69fa472e332b50572c1b2dcc1c8a0fa783a1199aad245398d3df421b4b","glsl-optimizer/include/c11/threads_win32.h":"95bf19d7fc14d328a016889afd583e4c49c050a93bcfb114bd2e9130a4532488","glsl-optimizer/include/c11_compat.h":"103fedb48f658d36cb416c9c9e5ea4d70dff181aab551fcb1028107d098ffa3e","glsl-optimizer/include/c99_compat.h":"aafad02f1ea90a7857636913ea21617a0fcd6197256dcfc6dd97bb3410ba892e","glsl-optimizer/include/no_extern_c.h":"40069dbb6dd2843658d442f926e609c7799b9c296046a90b62b570774fd618f5","glsl-optimizer/license.txt":"e26a745226f4a46b3ca00ffbe8be18507362189a2863d04b4f563ba176a9a836","glsl-optimizer/src/compiler/builtin_type_macros.h":"5b4fc4d4da7b07f997b6eb569e37db79fa0735286575ef1fab08d419e76776ff","glsl-optimizer/src/compiler/glsl/README":"e7d408b621c1b605857c4cab63902f615edb06b530142b91ac040808df6e22f7","glsl-optimizer/src/compiler/glsl/TODO":"dd3b7a098e6f9c85ca8c99ce6dea49d65bb75d4cea243b917f29e4ad2c974603","glsl-optimizer/src/compiler/glsl/ast.h":"3e68ff374350c49211a9931f7f55a485d8d89fc4b21caaffbf6655009ad95bf8","glsl-optimizer/src/compiler/glsl/ast_array_index.cpp":"92b4d501f33e0544c00d14e4f8837753afd916c2b42e076ccc95c9e8fc37ba94","glsl-optimizer/src/compiler/glsl/ast_expr.cpp":"afd712a7b1beb2b633888f4a0911b0a8e4ae5eb5ab9c1e3f247d518cdaaa56d6","glsl-optimizer/src/compiler/glsl/ast_function.cpp":"74f4fbd490e366b37f4715168bb3465ecd9334d4130942f75dcc8e80e8e7f027","glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp":"d0f798eb09271d41d068b9e7b18220d37f1ed0083300ab51eba30989698fe23d","glsl-optimizer/src/compiler/glsl/ast_type.cpp":"8eb790b24b26dfb72bdc333744b566c26d8464c5d47d20eae659461f5c4899f7","glsl-optimizer/src/compiler/glsl/builtin_functions.cpp":"454189d643c220fcb49116ee5c8a34f7b349aa67564040deb8607f6a41a15e70","glsl-optimizer/src/compiler/glsl/builtin_functions.h":"a37cad7ed09b522c5b8bec7b80115a36846e7ba6e0874a2a858e32f7f202c665","glsl-optimizer/src/compiler/glsl/builtin_int64.h":"619def6f3aebf180da3944ef08f159ab12a58b24767e41d8b985ac37ded54d62","glsl-optimizer/src/compiler/glsl/builtin_types.cpp":"afec060b62d6f3b00bfbf94e9fa5f96341ce096c128d1eef322791e6ed9cea4d","glsl-optimizer/src/compiler/glsl/builtin_variables.cpp":"6563bfb1345cbca4c77e00eef09ad152f3e1dc271d246a08c5ce9e1f4ce4250a","glsl-optimizer/src/compiler/glsl/float64.glsl":"1072fd888be48c2a7a5117cd2d92a65f034965a66375f598bb856bff5d7be766","glsl-optimizer/src/compiler/glsl/generate_ir.cpp":"e5f0175370a0d07f93c48d3f0f1b8233d12c64a7b02de02dcc753ef7b398ef0f","glsl-optimizer/src/compiler/glsl/glcpp/README":"a0332a1b221d047e9cce5181a64d4ac4056046fd878360ec8ae3a7b1e062bcff","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.c":"2d179879b1ffe84f58875eee5b0c19b6bae9c973b0c48e6bcd99978f2f501c80","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.l":"e4c5744c837200dafd7c15a912d13f650308ea552454d4fa67271bc0a5bde118","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.c":"03494f9ce1cb82260506e2559e73a3eeb622c4bd51b65eaa0a2c3351862bd4c8","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.h":"264d9a18421cde255ce34a0a62b3d8e73465359f0d167e64aa3973062aae5bdd","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.y":"fafb66e3a8f149d19e085f18a4273ba6d4c11af9e9a01d665cc784dddf97b79f","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.c":"37ed294403c2abfd17fd999d1ae8d11b170e5e9c878979fefac74a31195c96b0","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.h":"85ac8b444bcbd0822b66448a1da407b6ae5467b649f5afaf5c58325bd7569468","glsl-optimizer/src/compiler/glsl/glcpp/pp.c":"a52d94f1bcb3fb2747a95709c4a77c25de7eea8354d2b83bb18efd96976a4473","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.c":"d11aeb3acfe966d1b78f1ee49804093f2434214c41391d139ffcb67b69dc9862","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.h":"abbf1f36ec5a92d035bfbb841b9452287d147616e56373cdbee1c0e55af46406","glsl-optimizer/src/compiler/glsl/glsl_lexer.cpp":"272b9fc1383d72b81bfc03fa11fdf82270ed91a294e523f9ce2b4554bd3effa9","glsl-optimizer/src/compiler/glsl/glsl_lexer.ll":"2b57d9f9eb830c3d7961d4533048a158ee6f458c8d05c65bea7b7cfbc36e4458","glsl-optimizer/src/compiler/glsl/glsl_optimizer.cpp":"f8095d20629d0af70be930b0612e169edb274551a1d25a3cd1bf9995a11ce2e8","glsl-optimizer/src/compiler/glsl/glsl_optimizer.h":"22e843b4ec53ba5f6cd85ca5f7bad33922dca8061b19fb512d46f1caca8d4757","glsl-optimizer/src/compiler/glsl/glsl_parser.cpp":"126baf368d525aba301854e3d91ba60b5aee32e1102376af71416f32cb95ec48","glsl-optimizer/src/compiler/glsl/glsl_parser.h":"2ea9a50716098a8f7bef782d2a030d757b68da73afb01b4d4940d3e8381d44e8","glsl-optimizer/src/compiler/glsl/glsl_parser.yy":"6b1fd1576b29fce005dff744a6dbd0219e4c695c361d61864e1f3a8d6fa6b764","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.cpp":"aad64b5b66467da650091430681e8c6a820cf3cadc4db3c160bf2f15875390ae","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.h":"71fd0e92bbdb193dfb067d7bfdb1200d77392be2fbd0cbfc9ca89d1bb4c7e741","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.cpp":"6660fb83c0ddddbbd64581d46ccfdb9c84bfaa99d13348c289e6442ab00df046","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.h":"24682b8304e0ea3f6318ddb8c859686bd1faee23cd0511d1760977ae975d41bf","glsl-optimizer/src/compiler/glsl/hir_field_selection.cpp":"72a039b0fcab4161788def9e4bedac7ac06a20d8e13146529c6d246bd5202afd","glsl-optimizer/src/compiler/glsl/int64.glsl":"303dbe95dde44b91aee3e38b115b92028400d6a92f9268975d607471984e13eb","glsl-optimizer/src/compiler/glsl/ir.cpp":"2b4741cce90b5d4abff5d719c7324e2693c67294d4d99736cb241554adb281bc","glsl-optimizer/src/compiler/glsl/ir.h":"990b1c74447c4eb4835353ccb0ed9aea644f97fc1129ef1739cd935075d85d2e","glsl-optimizer/src/compiler/glsl/ir_array_refcount.cpp":"8cdc1cffe01e42e0566fa2193a75f789628e8025ad1b82f0ee6f204451b7f9f7","glsl-optimizer/src/compiler/glsl/ir_array_refcount.h":"75f06ec81342b379096ca52e1dc0fd5f19a11ff8e9b58203c20628179d644c12","glsl-optimizer/src/compiler/glsl/ir_basic_block.cpp":"1e2920b1c0ecb08424c745c558f84d0d7e44b74585cf2cc2265dc4dfede3fa2f","glsl-optimizer/src/compiler/glsl/ir_basic_block.h":"81be7da0fc0ee547cd13ec60c1fcd7d3ce3d70d7e5e988f01a3b43a827acdf05","glsl-optimizer/src/compiler/glsl/ir_builder.cpp":"daba29c5a1efdd5a9754f420eb3e2ebdf73485273497f40d4863dadeddb23c0d","glsl-optimizer/src/compiler/glsl/ir_builder.h":"2822e74dd3f6e3df8b300af27d5b11ea2dd99d0e5e7ca809b7bbcce9833c483c","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.cpp":"8c6df5abf2fe313363f285f171c19ca6c8ee4f3bc2ed79d33c0c88cc8be45c48","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.h":"799852adc3a0e54d04080655e7cebfa0d3bf5b6ffed5d8414f141380665d4db7","glsl-optimizer/src/compiler/glsl/ir_clone.cpp":"d897a4e1f5bbec4a6a2f15044c1be9a4d13899c73be77335b041049a4589aa5d","glsl-optimizer/src/compiler/glsl/ir_constant_expression.cpp":"78bd87ddb09db67f6c499067728d72aef4f16aa02721a99a4b769d1e0cfa9010","glsl-optimizer/src/compiler/glsl/ir_equals.cpp":"bca28533a6310b0fc152b56d80872368f1510dc62ed6e8ac199b9ffa7fac02e7","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.cpp":"7e918d4e1f237eca01396004015865ce345afe32a876c9dbc6728576a1a7eae4","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.h":"f45b66aa9497520e7e08e612d24b308477c34477fbd963ee9320eac664957f16","glsl-optimizer/src/compiler/glsl/ir_expression_operation.h":"cc9f10727dbd26cac506804f51456302c702650f9eeb59054a7e1575d5cf6687","glsl-optimizer/src/compiler/glsl/ir_expression_operation.py":"7b86c96021b9fbe165957f4ecb0b612fefcde1c2cf3c6d75e3cdb22e369216ba","glsl-optimizer/src/compiler/glsl/ir_expression_operation_constant.h":"9ad3346416392e3efa11e12ecf2feca7453c5253d241eb96c91dfb85d4f2b971","glsl-optimizer/src/compiler/glsl/ir_expression_operation_strings.h":"a6826daf496a8b9e89885bc2a161ac3445d501b23c6e0ac33e2c01b506b273c8","glsl-optimizer/src/compiler/glsl/ir_function.cpp":"7537365fc0fbe4b37a26b9a2146cc64d3e9a774d60eab63b65002ad165ae8fc7","glsl-optimizer/src/compiler/glsl/ir_function_can_inline.cpp":"faddbf112187a048d502716a3fb82570a322299ba2a3abd79388382c82040bfc","glsl-optimizer/src/compiler/glsl/ir_function_detect_recursion.cpp":"9176973eaf5c0a984701f953bb7a80f37dca43d59b5bce50fc69b3f02f2902d7","glsl-optimizer/src/compiler/glsl/ir_function_inlining.h":"9739493f99c489987d650762fccdd3fb3d432f6481d67f6c799176685bd59632","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.cpp":"3725861fbe2b98e0617f52d3b14cf6d3b25fb5ec00f5ef5d308b03642f592767","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.h":"e0560210e966c0c31e4ca843e80ea154e64db5a444b8c2df845b6ba5b3a43fc1","glsl-optimizer/src/compiler/glsl/ir_hv_accept.cpp":"caf7ce2cd9494aadd3c58bcf77f29de58368dc9e347a362bbf37f8bda9509b80","glsl-optimizer/src/compiler/glsl/ir_optimization.h":"8b3dcfc7f9e96b21a8dd47a0040d90be483a9e67a2cdce3a697188fb758d4630","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.cpp":"f8e34a983452be0dcb5a695e9c8e895eead24f9e540992a8afe510ae85da4c4c","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.h":"1ad1bd3efd1ace39051c13f904c05fd80425d329444f9a8d47fd6d948faf46e0","glsl-optimizer/src/compiler/glsl/ir_print_visitor.cpp":"643f5a68aae3fb37267fd793f1216d1cfdeb2c09338c26b1f30e4c6deaef4de5","glsl-optimizer/src/compiler/glsl/ir_print_visitor.h":"4573eb93268a2654c14b505253dd651e2695d43dc745904d824da18305269b95","glsl-optimizer/src/compiler/glsl/ir_reader.cpp":"06bfba802c8354e5a8b2334b6d78d6297de18235bedd3f8fbb382c89870b02f2","glsl-optimizer/src/compiler/glsl/ir_reader.h":"63e3f7f1597936a7011d5b520e171b197bf82bee6c1560d822c3edf5aaa6f9e9","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.cpp":"84b5c5d746555adca85759c2912fe48010232b7c1c0bd2cf03bd04067a85e66f","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.h":"fd8c561b71085d3211fff85ed514fecb299d8ce19a04bc063419a55b6d840525","glsl-optimizer/src/compiler/glsl/ir_set_program_inouts.cpp":"ab9f115ce9e7f312d9c7978340ced0dc4ae6d13a80e08442ba9709d11d50cae5","glsl-optimizer/src/compiler/glsl/ir_uniform.h":"683ae6896b1a08470c090be5f822fc31cd434eab9216e954b9bba24a46975109","glsl-optimizer/src/compiler/glsl/ir_unused_structs.cpp":"9c1620c45f2fc071fe5ed828472040b14c5f42effe06aa0e3b8352c95ef78786","glsl-optimizer/src/compiler/glsl/ir_unused_structs.h":"13387b49c23093575276b25b9dfd31fedd8f131c5c4f3128ab04cf03e15b5295","glsl-optimizer/src/compiler/glsl/ir_validate.cpp":"6b232be5999a86ea278f4f15b2832d76843246509118d924243055a3b9b0299f","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.cpp":"2764a3cad937d53f36db7447c3a5b98b04bf153acf81074d971857fc5bca460d","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.h":"b0668e3eb1501ef65e38fe12830742ecb3d28e6039f30e366c8924efc29b4a39","glsl-optimizer/src/compiler/glsl/ir_visitor.h":"f21b3534c3d66d5fb707d1581fece7e1eb043523afbaedf89918cfb031c6df94","glsl-optimizer/src/compiler/glsl/link_atomics.cpp":"360f0209e11f367ba358223597b0a118bae095bff16337cf03f1fb89c5b80ca6","glsl-optimizer/src/compiler/glsl/link_functions.cpp":"de7895da8aa33a1e3c2c1eb2fdaf267ab5d1fbfdb79ae2e67f95211e946e294c","glsl-optimizer/src/compiler/glsl/link_interface_blocks.cpp":"1926cfa73810704eb19b916c1b2cdb9321155e2f98b2a0a57c7c3c6e960540cd","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.cpp":"1e14e06ca3b2c1089cfba2e8eaf0c1f373d9d6374b6082f320962dd71ae09611","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.h":"fd58c155af645295bb6aec08797889de586f4d919731de2bce57e8dce59bb048","glsl-optimizer/src/compiler/glsl/link_uniform_blocks.cpp":"09589f49776dce32e6c4044937de7e0c839a9754ad31960148f8f9e010658997","glsl-optimizer/src/compiler/glsl/link_uniform_initializers.cpp":"bf98e08c12db466acf9623cbeb8fa8e3b4002512722e7a6521287f558a099f37","glsl-optimizer/src/compiler/glsl/link_uniforms.cpp":"84bad5b1377362cecf259b05124239be5220b03ce1c0c61b59bd9a47e4379af2","glsl-optimizer/src/compiler/glsl/link_varyings.cpp":"a5f1a53e7c80d635515fe808ff223d89fef1767abb0f2b7aa28fa6773dca353f","glsl-optimizer/src/compiler/glsl/link_varyings.h":"b9dbe018f038df69763df2e928742ce81bbc6e3aaba26f50621e30a6d9aa6220","glsl-optimizer/src/compiler/glsl/linker.cpp":"40b1ecd5d4f6c7f13d5a87ce390561a51fdf6f3fcd9b2197b9c88b03a773ba94","glsl-optimizer/src/compiler/glsl/linker.h":"ecf94b4ad75ef461c27c557fda4bd25f34c91930822b8e1d729ec84520d4a049","glsl-optimizer/src/compiler/glsl/linker_util.cpp":"1663ad88e2a369305659aeeffaedb5bd752cf76340a2ba5797fc0bf600633cf9","glsl-optimizer/src/compiler/glsl/linker_util.h":"6db788daf9c8e87ae2764b61a8b37ebe419e69c1b82ddee01986e37c978c6993","glsl-optimizer/src/compiler/glsl/list.h":"b1f46ce0e552fe7c45b2a19408a9d97662e23e4b182ab335491c26f8cf25886f","glsl-optimizer/src/compiler/glsl/loop_analysis.cpp":"57ecd573477c68091c7cc99537faa7139a8f395935e3d4f10144cefdefb5a611","glsl-optimizer/src/compiler/glsl/loop_analysis.h":"a85f045a038ee5b5176063e85d7988865862c44ab0580f771b993a042d0b69cc","glsl-optimizer/src/compiler/glsl/loop_unroll.cpp":"bd4292ea2809f5a669bcb76ceaa1ac365772dcd638c579c3ed10275214901a54","glsl-optimizer/src/compiler/glsl/lower_blend_equation_advanced.cpp":"8cfbef140d9c4b4d2f57bfa05c9c374d31a121d0f87afce94333f049023b654a","glsl-optimizer/src/compiler/glsl/lower_buffer_access.cpp":"1ae221c3c7a95aeb867207e7a742be635f91b406c157747bfd6ddf10274d97fb","glsl-optimizer/src/compiler/glsl/lower_buffer_access.h":"807886953a576a323591798cbca5e2df24295ea893b28affd8ffb5926cebaa04","glsl-optimizer/src/compiler/glsl/lower_builtins.cpp":"4d81afc32cf58e1481fcb5e42888ab93dbe6820310a20ff7a9982b77b2152d9b","glsl-optimizer/src/compiler/glsl/lower_const_arrays_to_uniforms.cpp":"608403f0eeeedf21cfcd3014116e0f44e28cbdf6c4c32aac7e613e64e30205e1","glsl-optimizer/src/compiler/glsl/lower_cs_derived.cpp":"179905cd47a294122adeb5b0abfed6f2f67782dcde21b544d1ee2c1985154e66","glsl-optimizer/src/compiler/glsl/lower_discard.cpp":"3b361b2db0004d544d64611cb50d5a6e364cf6c5f2e60c449085d7d753dd7fb0","glsl-optimizer/src/compiler/glsl/lower_discard_flow.cpp":"f5c29b6a27690bb5c91f196d1a1cf9f6be4f1025292311fe2dac561ce6774dee","glsl-optimizer/src/compiler/glsl/lower_distance.cpp":"a118c85493d5d22b2c059a930c51a5854896d4b1dade76598eaa985e5a3dff8c","glsl-optimizer/src/compiler/glsl/lower_if_to_cond_assign.cpp":"469e617757fd1728709cce021aac5c8da05ee503bf5366977bdc4ef7a6d83950","glsl-optimizer/src/compiler/glsl/lower_instructions.cpp":"6ff5c396abe40d8a2145d571e99e2bbe9143393e15aafc28adc2803a01d821b6","glsl-optimizer/src/compiler/glsl/lower_int64.cpp":"d1ed41196880dd53c7b13e2782f9423f8442bf1d46186e8be92b1b66218a83ee","glsl-optimizer/src/compiler/glsl/lower_jumps.cpp":"34de7b493f281589fb0c2c0f6e885d0a0fabbe7a4e97a73de374dd714777a58c","glsl-optimizer/src/compiler/glsl/lower_mat_op_to_vec.cpp":"dff7a308edc4846c348ed4225c6699a9c75abac68d88f41f85954276552779f4","glsl-optimizer/src/compiler/glsl/lower_named_interface_blocks.cpp":"16063ac127bff75a68272070ab11c21c25101edbff62b4c68f4983b4cd941af0","glsl-optimizer/src/compiler/glsl/lower_offset_array.cpp":"3b00773399135aea85746a5a68b96ef000bc6841be1a2c8e6f25c516628b0949","glsl-optimizer/src/compiler/glsl/lower_output_reads.cpp":"a0fc9975d5aa1617e21fc6c353659a9802da9e83779a3eef4ec584f74b4dadc5","glsl-optimizer/src/compiler/glsl/lower_packed_varyings.cpp":"7550099d4ae123d71541c2fc88bc04fbfe9271ec75d7e210987d1c8cac3cf3ea","glsl-optimizer/src/compiler/glsl/lower_packing_builtins.cpp":"79a13d161fe505a410ab948d92769395708693ec888153630fa240e5b97e356f","glsl-optimizer/src/compiler/glsl/lower_precision.cpp":"f82a185b879872b977a1787d8061b9a80bc4cf8db1b970db6efba2ad9cc20fa2","glsl-optimizer/src/compiler/glsl/lower_shared_reference.cpp":"ea2dccf50a83bc19391bf6b7ab6aa53c0005f427af4066d25140340af9a4beef","glsl-optimizer/src/compiler/glsl/lower_subroutine.cpp":"f69fa53650eeb6f2944fce4d36a6e0a423e6705f3a3bd3389c7fadb83cfc8802","glsl-optimizer/src/compiler/glsl/lower_tess_level.cpp":"b196c9d424c0569f3e85d75c2d125af21566cb113d69036db87c0990703e0fa7","glsl-optimizer/src/compiler/glsl/lower_texture_projection.cpp":"4d247f244272adc8250fd888d8d932a140dd5de4d1efc7a58492c3c2b8291527","glsl-optimizer/src/compiler/glsl/lower_ubo_reference.cpp":"89bdbc6c1669230c644c0857db1ce2781ec61d349ecd08c7914146e1f4750a4a","glsl-optimizer/src/compiler/glsl/lower_variable_index_to_cond_assign.cpp":"fce930f29ac9405b297d1f749d68f59506b89c70b4ee1b1ab8cf49a34cc71ecf","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_cond_assign.cpp":"3c67d851a11a55fad1c49a550f3a0cfe50892d33a3f238ce266cd829eba510a8","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_swizzle.cpp":"f5ec666b73e1415cbab32519a53605ed385f3b03e889560373dbce69dda5000e","glsl-optimizer/src/compiler/glsl/lower_vector.cpp":"f7c13f5572ebe09b6a71553133b2cf003cd4b77b9657600672ee3b21bf890725","glsl-optimizer/src/compiler/glsl/lower_vector_derefs.cpp":"b05793da6dd620a531b43df5af8b2ecbc37b9db0c88910f5724ea10bcd057e19","glsl-optimizer/src/compiler/glsl/lower_vector_insert.cpp":"fee772ec17eea5e86a529bf9c5fa2ee0d29a5982bb75ebc6d68ed36cd19aa299","glsl-optimizer/src/compiler/glsl/lower_vertex_id.cpp":"690e8715182e03fead5cc5a35251fb4f41b357e4c71a1dfbc4bd7be19862b56d","glsl-optimizer/src/compiler/glsl/lower_xfb_varying.cpp":"58c0e8b270e4bbde54250be03cdb2f36966bcafb785372ad2e2b786835df7f9f","glsl-optimizer/src/compiler/glsl/main.cpp":"ae5e88abbbc8a12f769e1296bad938b9d7398cc6da0d3d0caeceeeb876536850","glsl-optimizer/src/compiler/glsl/opt_add_neg_to_sub.h":"f5054944bfd068810629080d0ea11df78b3f57a8f86df75e13ca50157ad1964d","glsl-optimizer/src/compiler/glsl/opt_algebraic.cpp":"25f45b20e1972ee8c789177a1aeda6e4286c25db2eae3a43ff83029ae64969c0","glsl-optimizer/src/compiler/glsl/opt_array_splitting.cpp":"19d3ce0e815438f4df9ab2890e767b03a4f3f191b53bb30c0217cf2ae6a95430","glsl-optimizer/src/compiler/glsl/opt_conditional_discard.cpp":"0e44e0e126711a3725c1f3a2aa65ff03c381fed08680ffc30101aae60f716c4e","glsl-optimizer/src/compiler/glsl/opt_constant_folding.cpp":"a088d04d9b45f9e55e235835648f614c89b7803c03a6d4f6a6d1a6bc1f0228bd","glsl-optimizer/src/compiler/glsl/opt_constant_propagation.cpp":"8a9440d77ecd6dcf13e683cbb99943aab6311c8fd4b5f6a9189a8d4f270746f4","glsl-optimizer/src/compiler/glsl/opt_constant_variable.cpp":"63d3ccd4dd09f19c9cf1a2f51592111bed41284504f29f3c0de4cadebc439a37","glsl-optimizer/src/compiler/glsl/opt_copy_propagation_elements.cpp":"ffa0f50863995e0d2e31f55a52e82319edc71e520987bebd7f7e561ea331c64b","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_variables.cpp":"84e8747b948232f01dd56b428b9315f96f9511f605f240119fc446fae28981a9","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_varyings.cpp":"761523e88f5b3ba785170f4d7205e94fa99acb7e74d29efbe40e1c010e1dbdb3","glsl-optimizer/src/compiler/glsl/opt_dead_code.cpp":"fd1ba2da7337d4e5dad17f5c2d73d9cc8880305f423e85d64cf94553588fa401","glsl-optimizer/src/compiler/glsl/opt_dead_code_local.cpp":"969a598b4df322baf222258a66cd64a326ea20e5b3125be9d8d1771f522c69e0","glsl-optimizer/src/compiler/glsl/opt_dead_functions.cpp":"774cae6536d02edf26e996a2a895e1f62d5098f16dc96b44798b4fc731a9a95f","glsl-optimizer/src/compiler/glsl/opt_flatten_nested_if_blocks.cpp":"3696a5c55f02e20056e085bc2714f73ac992f221b6f3387d655068e86b512046","glsl-optimizer/src/compiler/glsl/opt_flip_matrices.cpp":"44f0fe05b49329667671f88c96dc86ab3fe1459ff7b87f2b2d88de2d49829f9f","glsl-optimizer/src/compiler/glsl/opt_function_inlining.cpp":"fb56a33c90419a01676b57cbd91d0674a54cca40e6defaacc88dd33facebc131","glsl-optimizer/src/compiler/glsl/opt_if_simplification.cpp":"ac406eb35e379c357641d6c5749f50c65961455924d3dc884e2b90046fa92c5c","glsl-optimizer/src/compiler/glsl/opt_minmax.cpp":"8abd59d3b14ef60ff14a9c69660e6945f5cf10b97edb4afebe56be3f81d96316","glsl-optimizer/src/compiler/glsl/opt_rebalance_tree.cpp":"8bb6329dc0f299042368fc81934c2df019b45ab9f7aa0415d4e57b8d1ff98c9f","glsl-optimizer/src/compiler/glsl/opt_redundant_jumps.cpp":"222c73e2ac7a938ebb6428cc6c780c908ff6156d8ff935b04fed93a48fc10496","glsl-optimizer/src/compiler/glsl/opt_structure_splitting.cpp":"2edc79cc13f3177934e0443ad62f5976a1991f01f86ea303a803434849b13a47","glsl-optimizer/src/compiler/glsl/opt_swizzle.cpp":"015d0abddfe507f67c4b96c82988d861d018ededf7bf055e2bcbe9ea92da694e","glsl-optimizer/src/compiler/glsl/opt_tree_grafting.cpp":"46d28ac983ea244a4315bdc0e8892979ec4d1f9b9a96ac8a8a08006d9bc5e878","glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp":"d80ee43bb97d9f016fb9c5e1e06f5b2afa569811f368ba067be794ec11d085fb","glsl-optimizer/src/compiler/glsl/program.h":"2982447e2abd35371e273ad87951722782a8b21c08294f67c39d987da1e1c55f","glsl-optimizer/src/compiler/glsl/propagate_invariance.cpp":"080943e21baa32494723a2eefb185915d2daae1f46d6df420145c5ad6857e119","glsl-optimizer/src/compiler/glsl/s_expression.cpp":"1ced972bc6ecc8eab4116ea71fb0212ab9ae5bcc0be3b47aa5d9d903566b3af1","glsl-optimizer/src/compiler/glsl/s_expression.h":"65b847e30e22a809b57d0bc70243049c99d9c6318803c5b8d0826aba55dc217e","glsl-optimizer/src/compiler/glsl/serialize.cpp":"be0eb4251348a9d921acb839a5c48c6023a2e9d116d602bb0432787ab623655d","glsl-optimizer/src/compiler/glsl/serialize.h":"57425732eba1233d928e5f07f88b623ce65af46b3bb034bf147f0a4b7f94f9a1","glsl-optimizer/src/compiler/glsl/shader_cache.cpp":"e0c5c433f2df3fccdf1d61281bfcb0ee5633433339b97c697d64db99611cbaaf","glsl-optimizer/src/compiler/glsl/shader_cache.h":"9217164d8d7f54aca0fe5922c7187095a6ae0cb703b196b79805aeef07a7e697","glsl-optimizer/src/compiler/glsl/standalone.cpp":"8e6c416a14d631261917a5fe4cc91880c287b22b2dfd70eb22028289a8fa5364","glsl-optimizer/src/compiler/glsl/standalone.h":"a7c397d1dfdd1e7fb2cfe99db35cd9df93251e642059208533202b7f20497f83","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.cpp":"970d14b7a9d58e5270321f97bf5d57795558b1c570a56678e04a65b26c60bf4f","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.h":"d921a617ea82b9e49413314492a645c44356de503581b1be3f1b57de236e480d","glsl-optimizer/src/compiler/glsl/string_to_uint_map.cpp":"d824bf5b839bd39498dc9e457103cdbe3e5289ddf7564107c27b1505948dd31f","glsl-optimizer/src/compiler/glsl/string_to_uint_map.h":"e2f18e66359c9d620e085de7f4a334a47df9c66e65a5bfe8b734c627bec04104","glsl-optimizer/src/compiler/glsl/test_optpass.h":"b27b8f35f5387e7ce4982bb51c7b63ccf14f91757f3108a5d02ed006925bb8a0","glsl-optimizer/src/compiler/glsl/xxd.py":"376484142f27f45090ea8203ae2621abf73f06175cb0ee8d96f44a3b9327f4bd","glsl-optimizer/src/compiler/glsl_types.cpp":"044bb6754f45419a3151e7a25c39202a82009ae3c6bc54ff7f0bb4258a5deefe","glsl-optimizer/src/compiler/glsl_types.h":"fd899a42f34ddeb8601bc3cd6c5e3aed82fc8aef4042dde1b39b3c01e1dcc219","glsl-optimizer/src/compiler/shader_enums.c":"436bff5216b11b0980bdfada5885fc6ac9afa2037a3027fcd6eea2a8635597ac","glsl-optimizer/src/compiler/shader_enums.h":"13220442a5c02e83540cf2c0ad4f8417b2fbda5f2586dec4e92082544c937cdd","glsl-optimizer/src/compiler/shader_info.h":"4c5453e81197ca83593ee4f365074b23530f2ab21c78e1733b63dec6f344c12a","glsl-optimizer/src/gallium/auxiliary/util/u_half.h":"3c2b37bda3ccb64387e44b723d29cf9046decab1a893bf42d842e9603398bdee","glsl-optimizer/src/gallium/include/pipe/p_compiler.h":"c75620096ce8523dae90599e50aa2ef6468d3b0e368a77795edeb20dd1abfc0c","glsl-optimizer/src/gallium/include/pipe/p_config.h":"a27692fc35f9e55df3224b7529e66b3001e911e94e6bc5f8f569e493e1ee3fb7","glsl-optimizer/src/gallium/include/pipe/p_defines.h":"be26d68c0acc67c5e44788c6299716a9eee415fd81d7d747e3738a829e3b6b38","glsl-optimizer/src/gallium/include/pipe/p_format.h":"5674215fc41d27496f037cf837717daefbf23ebb38d40ace7c0c414bc08182b0","glsl-optimizer/src/gallium/include/pipe/p_state.h":"d600593aba5f5a17072a6c38f6baa81e01c7994b0174250f7e433bb41684b702","glsl-optimizer/src/mapi/glapi/glapi.h":"73632a625c0ddabc401205e8b5a81eb8af8506868efe4b170d7979ec3619e9c5","glsl-optimizer/src/mesa/main/config.h":"5800259373099e5405de2eb52619f9de242552a479902a3a642a333c8cb3c1e7","glsl-optimizer/src/mesa/main/context.c":"2f3208473d99c94f734b1137ba91889d4a1babb9e7534bf1dc85d851ee98274e","glsl-optimizer/src/mesa/main/context.h":"cc7e4194797db9d007f01884e23d786c453b3860821f7f2ddcdf0f1bf3f8ffb1","glsl-optimizer/src/mesa/main/dd.h":"6a964acd06b6c2d88700e69fb75fe3c6b3b3d45bbc41db24f3f897a29695fe0c","glsl-optimizer/src/mesa/main/debug_output.h":"7312422e90b8c0e34028ac27280e438139b5cba525c99deb3ac883cd3d87e452","glsl-optimizer/src/mesa/main/draw.h":"7eaef3a9e27a60ea6f7937109bf3a6190b831162fde0479abb12077ce27c353d","glsl-optimizer/src/mesa/main/enums.h":"87d562a6764f51c014a2274fa7c3aca17c04441537ddd56b2554f13c6fffea92","glsl-optimizer/src/mesa/main/errors.h":"c79444b5df289c90fbb22a33b2d0c23917d9fc4510960088f0b79e53bb56b1b2","glsl-optimizer/src/mesa/main/extensions.h":"a38b2f87cc93c513994281350d69e06c84ff8eded5313ec0a1be33f375e0ebbd","glsl-optimizer/src/mesa/main/extensions_table.c":"17642d1a8c9a0bf2bd61060052d33ff14a005d2b962e6cf91465797a50851e85","glsl-optimizer/src/mesa/main/extensions_table.h":"2c879571c238d2e14461031ac740372fd0f9ac3a34c0d5541bb9b7ed4c0376c8","glsl-optimizer/src/mesa/main/formats.h":"02e2f7ec3e39286cf9f27e2641043e6df8ecb1dfde9e643313210e214af2a929","glsl-optimizer/src/mesa/main/glheader.h":"58217b33eead6aa6b23cd4a291cefeaa6cb84e465f4960daffca97c44d6d1c35","glsl-optimizer/src/mesa/main/glthread.h":"51fb2711f77e7eafcfc52d29d5b844978832b24c930d88accd48d143a6eb9c6f","glsl-optimizer/src/mesa/main/hash.h":"7e7f782034c16a8e693de48e00c31d4a90b0129f4029fd074033d7d16ccbe718","glsl-optimizer/src/mesa/main/macros.h":"73d15ddfd64f2b57b9b2ffeeb993b9c2c0899a80563e9d6ff337b11ccbe6eee5","glsl-optimizer/src/mesa/main/menums.h":"5dfac0e2279d60b0cd0c7b9fc2a5021620d0f6282ed2e738c420214e3af152d3","glsl-optimizer/src/mesa/main/mesa_private.h":"edda678b93438944279a551f663b8858ad84814a9fc88ba9672ef195599c24ae","glsl-optimizer/src/mesa/main/mtypes.h":"6efddefa099e4d2e3fdd97f0055644f47aba21711385edfeabc2d9b0676f2eec","glsl-optimizer/src/mesa/main/shaderobj.h":"9f0dfe96d0c2154201adef942bd36053533ac7b2492fb3786acda5bea514c75e","glsl-optimizer/src/mesa/main/uniforms.h":"4e331e6ad6e9cbded978b4082dbe0a57c1f8f01327446bb6892bfc179976c38b","glsl-optimizer/src/mesa/main/version.h":"9d0a13a758099302dc55cf7d045791834a89b0f9d4cf17b2692259b369a8a9a1","glsl-optimizer/src/mesa/math/m_matrix.h":"a37b19f182e070db3df93b0ede43c22fb8be8c2906504133ee6dbd7db1185d8b","glsl-optimizer/src/mesa/program/dummy_errors.c":"1820e305515b4c5e041f5e1623266a48ec8f076a155310be7d60637101f593e4","glsl-optimizer/src/mesa/program/ir_to_mesa.h":"b47f58d22e3ca2ae42d52501ea769d15c4476834944fa97eeccd3a3439211d00","glsl-optimizer/src/mesa/program/prog_instruction.h":"ab3832152a7e144b59e5a2264b2c29db56d93be31e76bbd958527a56771b40eb","glsl-optimizer/src/mesa/program/prog_parameter.h":"ba18c743284eadbc837c2c364c73e5d372321a7637a76e589d8d39fe8b5de225","glsl-optimizer/src/mesa/program/prog_statevars.h":"fc413698f84bc52d45fdeae0471934ee9904bfb7eac1a2b5f70446e54bcbbdca","glsl-optimizer/src/mesa/program/program.h":"1f01026a4eff440a3f122fd9b519d03546fe7f7d8be60dca834e95a2f8fbbfd2","glsl-optimizer/src/mesa/program/symbol_table.c":"6611cb9f078035bf5ff8c9112093a6c7d99f8af99a3931d0c07f227cc72283ea","glsl-optimizer/src/mesa/program/symbol_table.h":"631dc35ac48d5e87962d45507461920f6575610960ffcc42a08cefeb43300cda","glsl-optimizer/src/mesa/vbo/vbo.h":"6eb1dcd9a08c92f276c5fe08da184ff9d455d1be421913b8ad732a7b65e858fb","glsl-optimizer/src/util/bitscan.h":"9e49e694e6b34fe035bc685f32588827eb8cbe7d82878963c7ab52843e1c16aa","glsl-optimizer/src/util/bitset.h":"c40f78515c6230fed18345c6751ce33833a49da7a27901c7e6d7340cbdcbc5e7","glsl-optimizer/src/util/blob.c":"8f729846f66efc9c15485cc5fc24c6ec861fc1fecb2f652573f2a237d481b791","glsl-optimizer/src/util/blob.h":"93e1eaac866b9a7cd6fc03b533c18fb2edf0e97f03395eff4f3a605c4fc14d0c","glsl-optimizer/src/util/compiler.h":"79e3bf40a5bab704e6c949f23a1352759607bb57d80e5d8df2ef159755f10b68","glsl-optimizer/src/util/crc32.c":"2f3467a046b3a76784ecb9aa55d527698c8607fd0b12c622f6691aaa77b58505","glsl-optimizer/src/util/crc32.h":"59bd81865e51042b73a86f8fb117c312418df095fed2d828c5c1d1c8b6fc6cd4","glsl-optimizer/src/util/debug.c":"c3d68e9752ccc19e66c669562cd113cf1d0ac83cbb30174789e7fb8d1df58f9c","glsl-optimizer/src/util/debug.h":"50068d745c4199ccbd33d68dd4c8a36d2b5179c7869a21e75906ddd0718ca456","glsl-optimizer/src/util/detect_os.h":"343a8790d17a3710c6dd015ee367f84e3902ff3f2e36faca2bf93f9d725d3574","glsl-optimizer/src/util/disk_cache.c":"f533937e5a4fffe76e2739ef4b6b1e1da097d96d63eb808e68ebbc7027641c23","glsl-optimizer/src/util/disk_cache.h":"e83314fb14134a8e079b15e470a6376ba5a8253701f048c890a62b7e55d64bc8","glsl-optimizer/src/util/fast_urem_by_const.h":"e108fce804616c47d071dfe4a04163eec1126e448ed1aa89abb6b3a6d772bd5b","glsl-optimizer/src/util/fnv1a.h":"ab2596f19c6adf431ae27618f62c5743e24ad23ef83bb359a4c4c218245ab459","glsl-optimizer/src/util/format/u_format.h":"4cdfc0c59cbc99a092e5ec5a396910f2d93b9643e5d8141050b011e66f11e45b","glsl-optimizer/src/util/futex.h":"26f7c9d86e9ffef4c0fa2761f1aaa1918337302e20bd6ca10e61dc3c47356deb","glsl-optimizer/src/util/half_float.c":"11bc2584493d5d9d46e8c8a619a0307cf150bf5ab5d0f96bb764b061dc37a00e","glsl-optimizer/src/util/half_float.h":"7f7c380f126da1400a91758cc0392f24bf967bce1672890b62be26fe9fbd922b","glsl-optimizer/src/util/hash_table.c":"0ca40352e35dedab0a84c64c903f1b16d47e950bb5f43b4d22bb57d499bfea6e","glsl-optimizer/src/util/hash_table.h":"217191bb360592e2232f187473c10287d2cda8ae6fa5c53d0ef74c8c206118b4","glsl-optimizer/src/util/list.h":"9fab03c6a78186bb5f173269f825f6ce976b409d931852e3d93bac632e07989a","glsl-optimizer/src/util/macros.h":"63faf65b51058c483b17f1f77da51d1c53c8beab52678cb6bd01f1228a63b6b0","glsl-optimizer/src/util/mesa-sha1.c":"00c692ec353ebc02c06c57c5a71de0ab7a119f86a4146f452e65ec87e4944417","glsl-optimizer/src/util/mesa-sha1.h":"bff4c29f4bf7cdbcefb30fa0c996a7604a380eba8976467c2a60e7cd328f7e26","glsl-optimizer/src/util/mesa-sha1_test.c":"25da89a59d51469f77b4c468ca23ffdce0a7a1166a70b6cc23026a6800b0143c","glsl-optimizer/src/util/os_memory.h":"64555faf1760ae6954f42c83727c38dfc4c278e9152115779ffaad58b42adacf","glsl-optimizer/src/util/os_memory_aligned.h":"12d86fa94be38c13f7eeebdf313795e1267dd5a7187d2f0072e0e896f41702f6","glsl-optimizer/src/util/os_memory_stdc.h":"07360363b88c927065e10df71bebf6c8a0cc3b9167c9dfce55f2d65f11e6f787","glsl-optimizer/src/util/os_misc.c":"a9936e613ec84803abd59ad47c192c8e3939993c950ac91973fdc4cec1801bb8","glsl-optimizer/src/util/os_misc.h":"cc68eb12e05b5e749c54298cb4a6f4cd20cc5af7db3403e70b3c27b56090c740","glsl-optimizer/src/util/os_time.h":"73e775f7335244ff5964c678c27eedf1aea6abea44c4169d327ea8c7ce4a3a88","glsl-optimizer/src/util/ralloc.c":"4b51189595ef67bcef52c40cbf654d969041dbd15e15d4a893ad494ac060aeca","glsl-optimizer/src/util/ralloc.h":"e573c45875ff1530f0dbee9a93ae55535fdac8d5cc88a79ebc327c688824bde5","glsl-optimizer/src/util/rounding.h":"0450722353caf83de07e67f335949dbe95fe53b534052d4ee9d28d2781387614","glsl-optimizer/src/util/set.c":"86f8c9a830bead5a5a79bc970b0ff97809312af07b3beb39ef9d90af04d40a1b","glsl-optimizer/src/util/set.h":"3e39ca161e7ed4ec7c436cc9c7919ed9a55ed1b71edbf2caf6f9bcfd9bc578ed","glsl-optimizer/src/util/sha1/README":"00af7419af05247081858acb2902efd99fcda2ce16e331079f701645bb3729c0","glsl-optimizer/src/util/sha1/sha1.c":"1403bbe0aad42ba3e6be7e09f7cad87a6a8c4ad5b63962f7b92b9f37d8133b04","glsl-optimizer/src/util/sha1/sha1.h":"68d9f240eab2918026ecdf22be36811abbd4f1389f6c36e31258041aeaedd247","glsl-optimizer/src/util/simple_mtx.h":"12c6c3c4b7db9168bc656d5b3c65912075084d2b388c415d5c3d3f5953a9d6c7","glsl-optimizer/src/util/softfloat.c":"a97e51a96fe5e6a052c02aa6bbec683fe73fb88a8c087d9c930503e2120d8a2e","glsl-optimizer/src/util/softfloat.h":"66664b0250e83bf5dd4cc743acd119d076efcea624a0eab3d6b60718e6ee8811","glsl-optimizer/src/util/string_buffer.c":"63a1d1b1e34926c88ea00159cafbcd56568b805c4f64d1e8c97169fe313921fc","glsl-optimizer/src/util/string_buffer.h":"7b88d1b1d9c6cfb8e93331813535c127289437c75f822029e9a3bca8ea6b52ee","glsl-optimizer/src/util/strndup.h":"0273c4fdb7482cd7746881a63d3998648c6d63415ba85af1d1860f0e0dc504c6","glsl-optimizer/src/util/strtod.c":"5cf610d8a37373cf37cfb7aae903525d943b2674b1f32594c70b0eb19a8c9697","glsl-optimizer/src/util/strtod.h":"237396def4e264d35ed4bedea00ef9a4ceab6d7a11a18c770d9747d22c69ed2d","glsl-optimizer/src/util/u_atomic.h":"c02e809526c6c09ba8fe51f50b2490d1b6c8e5c7f3c4031ae958250d098fc3bb","glsl-optimizer/src/util/u_debug.c":"8c060e379b816618f3dd22c9ea523c68b9425c76c36a7dfe5d6d375b337f5f4a","glsl-optimizer/src/util/u_debug.h":"e11e26edd9b9e4e6f8e6a435e69f4d9edda27e9a379f68f4c82ea2525aaaea68","glsl-optimizer/src/util/u_dynarray.h":"853d0fa6ff2261614488be624deb8a2b01e57c2c8eabc28578cbeed4ccc95694","glsl-optimizer/src/util/u_endian.h":"3ccea7e529740318d8a4b05c00db3adc9d1e292a52bdc56a05c9fae99209720f","glsl-optimizer/src/util/u_math.c":"c868a8c0886dc78f1b06b13404ba8b253090449045774dd56893ac9d75795184","glsl-optimizer/src/util/u_math.h":"a04e32e126db016413f9de0a2028a3e71737137463b1289eae576f884b06fcf1","glsl-optimizer/src/util/u_memory.h":"c5db17c724c70283ddbe04165722f6988d4e0eb9aa3602ae472feff016649af9","glsl-optimizer/src/util/u_queue.h":"92930ce236c0528a98b695f5cea8c5c6aa9683beaf71a2227bdc5d33d1b21506","glsl-optimizer/src/util/u_string.h":"c5a2f4ef576d1547bda12c4ea219179fefa54414977743ac094abcaf696ef6ca","glsl-optimizer/src/util/u_thread.h":"00b708459b27f9910d18db92c18cc65cfc618ac2b3cd144e45f8640057b10d58","glsl-optimizer/src/util/xxhash.h":"2f2aff2fc6c0c929f52cf6ae7314122124c5be026d41ad1c357608383c4a37ad","src/bindings.rs":"79993db2058bde39f99ef483d02560d33b1cb882f6a552319e8b86eb6f9021e1","src/lib.rs":"04be1554cd829eb40864b06d80b491dd48117a4e3a601c7d482117f7a0391e67","wrapper.hpp":"f3ea34cc496f7d90b9bfcada3250b37b314c3524dac693b2ece9517bc7d274ac"},"package":"913662ae8335df058d56e00f11340b20fa82e03e0276587797ef325ab01e50d4"} +\ No newline at end of file ++{"files":{"Cargo.toml":"010bb96167ff152e0e5ac30f9905dc749a3f038199b70c541c5d8cb97a185ee3","README.md":"4468e08c64c19977707d792bfab0080e35ff927b64990eab77873f8ba056ba1c","build.rs":"6a64610018701781af182c418a4355c9ac5d99d000be9457f0e38a7dadf7542a","glsl-optimizer/CMakeLists.txt":"42ce94744e82ffa000da8b64d81fc140e293b9f5da7dd4cf6b49e7404a2448d9","glsl-optimizer/README.md":"b18eef11a92d267d88a937b1154f7670ee433c730b102fdf7e2da0b02722b146","glsl-optimizer/contrib/glslopt/Main.cpp":"14ba213210c62e234b8d9b0052105fed28eedd83d535ebe85acc10bda7322dd4","glsl-optimizer/contrib/glslopt/Readme":"65d2a6f1aa1dc61e903e090cdade027abad33e02e7c9c81e07dc80508acadec4","glsl-optimizer/generateParsers.sh":"878a97db5d3b69eb3b4c3a95780763b373cfcc0c02e0b28894f162dbbd1b8848","glsl-optimizer/include/GL/gl.h":"1989b51365b6d7d0c48ff6e8b181ef75e2cdf71bfb1626b1cc4362e2f54854a3","glsl-optimizer/include/GL/glext.h":"2ac3681045a35a2194a81a960cad395c04bef1c8a20ef46b799fb24af3ec5f70","glsl-optimizer/include/KHR/khrplatform.h":"1448141a0c054d7f46edfb63f4fe6c203acf9591974049481c32442fb03fd6ed","glsl-optimizer/include/c11/threads.h":"56e9e592b28df19f0db432125223cb3eb5c0c1f960c22db96a15692e14776337","glsl-optimizer/include/c11/threads_posix.h":"f922e2c8613582a9340aa5ae37a4f7bd962dbc30e33a7a6ab14bed2d2995bc2b","glsl-optimizer/include/c11/threads_win32.h":"95bf19d7fc14d328a016889afd583e4c49c050a93bcfb114bd2e9130a4532488","glsl-optimizer/include/c11_compat.h":"103fedb48f658d36cb416c9c9e5ea4d70dff181aab551fcb1028107d098ffa3e","glsl-optimizer/include/c99_compat.h":"aafad02f1ea90a7857636913ea21617a0fcd6197256dcfc6dd97bb3410ba892e","glsl-optimizer/include/no_extern_c.h":"40069dbb6dd2843658d442f926e609c7799b9c296046a90b62b570774fd618f5","glsl-optimizer/license.txt":"e26a745226f4a46b3ca00ffbe8be18507362189a2863d04b4f563ba176a9a836","glsl-optimizer/src/compiler/builtin_type_macros.h":"5b4fc4d4da7b07f997b6eb569e37db79fa0735286575ef1fab08d419e76776ff","glsl-optimizer/src/compiler/glsl/README":"e7d408b621c1b605857c4cab63902f615edb06b530142b91ac040808df6e22f7","glsl-optimizer/src/compiler/glsl/TODO":"dd3b7a098e6f9c85ca8c99ce6dea49d65bb75d4cea243b917f29e4ad2c974603","glsl-optimizer/src/compiler/glsl/ast.h":"3e68ff374350c49211a9931f7f55a485d8d89fc4b21caaffbf6655009ad95bf8","glsl-optimizer/src/compiler/glsl/ast_array_index.cpp":"92b4d501f33e0544c00d14e4f8837753afd916c2b42e076ccc95c9e8fc37ba94","glsl-optimizer/src/compiler/glsl/ast_expr.cpp":"afd712a7b1beb2b633888f4a0911b0a8e4ae5eb5ab9c1e3f247d518cdaaa56d6","glsl-optimizer/src/compiler/glsl/ast_function.cpp":"74f4fbd490e366b37f4715168bb3465ecd9334d4130942f75dcc8e80e8e7f027","glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp":"d0f798eb09271d41d068b9e7b18220d37f1ed0083300ab51eba30989698fe23d","glsl-optimizer/src/compiler/glsl/ast_type.cpp":"8eb790b24b26dfb72bdc333744b566c26d8464c5d47d20eae659461f5c4899f7","glsl-optimizer/src/compiler/glsl/builtin_functions.cpp":"454189d643c220fcb49116ee5c8a34f7b349aa67564040deb8607f6a41a15e70","glsl-optimizer/src/compiler/glsl/builtin_functions.h":"a37cad7ed09b522c5b8bec7b80115a36846e7ba6e0874a2a858e32f7f202c665","glsl-optimizer/src/compiler/glsl/builtin_int64.h":"619def6f3aebf180da3944ef08f159ab12a58b24767e41d8b985ac37ded54d62","glsl-optimizer/src/compiler/glsl/builtin_types.cpp":"afec060b62d6f3b00bfbf94e9fa5f96341ce096c128d1eef322791e6ed9cea4d","glsl-optimizer/src/compiler/glsl/builtin_variables.cpp":"6563bfb1345cbca4c77e00eef09ad152f3e1dc271d246a08c5ce9e1f4ce4250a","glsl-optimizer/src/compiler/glsl/float64.glsl":"1072fd888be48c2a7a5117cd2d92a65f034965a66375f598bb856bff5d7be766","glsl-optimizer/src/compiler/glsl/generate_ir.cpp":"e5f0175370a0d07f93c48d3f0f1b8233d12c64a7b02de02dcc753ef7b398ef0f","glsl-optimizer/src/compiler/glsl/glcpp/README":"a0332a1b221d047e9cce5181a64d4ac4056046fd878360ec8ae3a7b1e062bcff","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.c":"2d179879b1ffe84f58875eee5b0c19b6bae9c973b0c48e6bcd99978f2f501c80","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.l":"e4c5744c837200dafd7c15a912d13f650308ea552454d4fa67271bc0a5bde118","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.c":"03494f9ce1cb82260506e2559e73a3eeb622c4bd51b65eaa0a2c3351862bd4c8","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.h":"264d9a18421cde255ce34a0a62b3d8e73465359f0d167e64aa3973062aae5bdd","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.y":"fafb66e3a8f149d19e085f18a4273ba6d4c11af9e9a01d665cc784dddf97b79f","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.c":"37ed294403c2abfd17fd999d1ae8d11b170e5e9c878979fefac74a31195c96b0","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.h":"85ac8b444bcbd0822b66448a1da407b6ae5467b649f5afaf5c58325bd7569468","glsl-optimizer/src/compiler/glsl/glcpp/pp.c":"a52d94f1bcb3fb2747a95709c4a77c25de7eea8354d2b83bb18efd96976a4473","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.c":"d11aeb3acfe966d1b78f1ee49804093f2434214c41391d139ffcb67b69dc9862","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.h":"abbf1f36ec5a92d035bfbb841b9452287d147616e56373cdbee1c0e55af46406","glsl-optimizer/src/compiler/glsl/glsl_lexer.cpp":"272b9fc1383d72b81bfc03fa11fdf82270ed91a294e523f9ce2b4554bd3effa9","glsl-optimizer/src/compiler/glsl/glsl_lexer.ll":"2b57d9f9eb830c3d7961d4533048a158ee6f458c8d05c65bea7b7cfbc36e4458","glsl-optimizer/src/compiler/glsl/glsl_optimizer.cpp":"f8095d20629d0af70be930b0612e169edb274551a1d25a3cd1bf9995a11ce2e8","glsl-optimizer/src/compiler/glsl/glsl_optimizer.h":"22e843b4ec53ba5f6cd85ca5f7bad33922dca8061b19fb512d46f1caca8d4757","glsl-optimizer/src/compiler/glsl/glsl_parser.cpp":"126baf368d525aba301854e3d91ba60b5aee32e1102376af71416f32cb95ec48","glsl-optimizer/src/compiler/glsl/glsl_parser.h":"2ea9a50716098a8f7bef782d2a030d757b68da73afb01b4d4940d3e8381d44e8","glsl-optimizer/src/compiler/glsl/glsl_parser.yy":"6b1fd1576b29fce005dff744a6dbd0219e4c695c361d61864e1f3a8d6fa6b764","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.cpp":"aad64b5b66467da650091430681e8c6a820cf3cadc4db3c160bf2f15875390ae","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.h":"71fd0e92bbdb193dfb067d7bfdb1200d77392be2fbd0cbfc9ca89d1bb4c7e741","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.cpp":"6660fb83c0ddddbbd64581d46ccfdb9c84bfaa99d13348c289e6442ab00df046","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.h":"24682b8304e0ea3f6318ddb8c859686bd1faee23cd0511d1760977ae975d41bf","glsl-optimizer/src/compiler/glsl/hir_field_selection.cpp":"72a039b0fcab4161788def9e4bedac7ac06a20d8e13146529c6d246bd5202afd","glsl-optimizer/src/compiler/glsl/int64.glsl":"303dbe95dde44b91aee3e38b115b92028400d6a92f9268975d607471984e13eb","glsl-optimizer/src/compiler/glsl/ir.cpp":"2b4741cce90b5d4abff5d719c7324e2693c67294d4d99736cb241554adb281bc","glsl-optimizer/src/compiler/glsl/ir.h":"990b1c74447c4eb4835353ccb0ed9aea644f97fc1129ef1739cd935075d85d2e","glsl-optimizer/src/compiler/glsl/ir_array_refcount.cpp":"8cdc1cffe01e42e0566fa2193a75f789628e8025ad1b82f0ee6f204451b7f9f7","glsl-optimizer/src/compiler/glsl/ir_array_refcount.h":"75f06ec81342b379096ca52e1dc0fd5f19a11ff8e9b58203c20628179d644c12","glsl-optimizer/src/compiler/glsl/ir_basic_block.cpp":"1e2920b1c0ecb08424c745c558f84d0d7e44b74585cf2cc2265dc4dfede3fa2f","glsl-optimizer/src/compiler/glsl/ir_basic_block.h":"81be7da0fc0ee547cd13ec60c1fcd7d3ce3d70d7e5e988f01a3b43a827acdf05","glsl-optimizer/src/compiler/glsl/ir_builder.cpp":"daba29c5a1efdd5a9754f420eb3e2ebdf73485273497f40d4863dadeddb23c0d","glsl-optimizer/src/compiler/glsl/ir_builder.h":"2822e74dd3f6e3df8b300af27d5b11ea2dd99d0e5e7ca809b7bbcce9833c483c","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.cpp":"8c6df5abf2fe313363f285f171c19ca6c8ee4f3bc2ed79d33c0c88cc8be45c48","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.h":"799852adc3a0e54d04080655e7cebfa0d3bf5b6ffed5d8414f141380665d4db7","glsl-optimizer/src/compiler/glsl/ir_clone.cpp":"d897a4e1f5bbec4a6a2f15044c1be9a4d13899c73be77335b041049a4589aa5d","glsl-optimizer/src/compiler/glsl/ir_constant_expression.cpp":"78bd87ddb09db67f6c499067728d72aef4f16aa02721a99a4b769d1e0cfa9010","glsl-optimizer/src/compiler/glsl/ir_equals.cpp":"bca28533a6310b0fc152b56d80872368f1510dc62ed6e8ac199b9ffa7fac02e7","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.cpp":"7e918d4e1f237eca01396004015865ce345afe32a876c9dbc6728576a1a7eae4","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.h":"f45b66aa9497520e7e08e612d24b308477c34477fbd963ee9320eac664957f16","glsl-optimizer/src/compiler/glsl/ir_expression_operation.h":"cc9f10727dbd26cac506804f51456302c702650f9eeb59054a7e1575d5cf6687","glsl-optimizer/src/compiler/glsl/ir_expression_operation.py":"7b86c96021b9fbe165957f4ecb0b612fefcde1c2cf3c6d75e3cdb22e369216ba","glsl-optimizer/src/compiler/glsl/ir_expression_operation_constant.h":"9ad3346416392e3efa11e12ecf2feca7453c5253d241eb96c91dfb85d4f2b971","glsl-optimizer/src/compiler/glsl/ir_expression_operation_strings.h":"a6826daf496a8b9e89885bc2a161ac3445d501b23c6e0ac33e2c01b506b273c8","glsl-optimizer/src/compiler/glsl/ir_function.cpp":"7537365fc0fbe4b37a26b9a2146cc64d3e9a774d60eab63b65002ad165ae8fc7","glsl-optimizer/src/compiler/glsl/ir_function_can_inline.cpp":"faddbf112187a048d502716a3fb82570a322299ba2a3abd79388382c82040bfc","glsl-optimizer/src/compiler/glsl/ir_function_detect_recursion.cpp":"9176973eaf5c0a984701f953bb7a80f37dca43d59b5bce50fc69b3f02f2902d7","glsl-optimizer/src/compiler/glsl/ir_function_inlining.h":"9739493f99c489987d650762fccdd3fb3d432f6481d67f6c799176685bd59632","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.cpp":"3725861fbe2b98e0617f52d3b14cf6d3b25fb5ec00f5ef5d308b03642f592767","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.h":"e0560210e966c0c31e4ca843e80ea154e64db5a444b8c2df845b6ba5b3a43fc1","glsl-optimizer/src/compiler/glsl/ir_hv_accept.cpp":"caf7ce2cd9494aadd3c58bcf77f29de58368dc9e347a362bbf37f8bda9509b80","glsl-optimizer/src/compiler/glsl/ir_optimization.h":"8b3dcfc7f9e96b21a8dd47a0040d90be483a9e67a2cdce3a697188fb758d4630","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.cpp":"f8e34a983452be0dcb5a695e9c8e895eead24f9e540992a8afe510ae85da4c4c","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.h":"1ad1bd3efd1ace39051c13f904c05fd80425d329444f9a8d47fd6d948faf46e0","glsl-optimizer/src/compiler/glsl/ir_print_visitor.cpp":"643f5a68aae3fb37267fd793f1216d1cfdeb2c09338c26b1f30e4c6deaef4de5","glsl-optimizer/src/compiler/glsl/ir_print_visitor.h":"4573eb93268a2654c14b505253dd651e2695d43dc745904d824da18305269b95","glsl-optimizer/src/compiler/glsl/ir_reader.cpp":"06bfba802c8354e5a8b2334b6d78d6297de18235bedd3f8fbb382c89870b02f2","glsl-optimizer/src/compiler/glsl/ir_reader.h":"63e3f7f1597936a7011d5b520e171b197bf82bee6c1560d822c3edf5aaa6f9e9","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.cpp":"84b5c5d746555adca85759c2912fe48010232b7c1c0bd2cf03bd04067a85e66f","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.h":"fd8c561b71085d3211fff85ed514fecb299d8ce19a04bc063419a55b6d840525","glsl-optimizer/src/compiler/glsl/ir_set_program_inouts.cpp":"ab9f115ce9e7f312d9c7978340ced0dc4ae6d13a80e08442ba9709d11d50cae5","glsl-optimizer/src/compiler/glsl/ir_uniform.h":"683ae6896b1a08470c090be5f822fc31cd434eab9216e954b9bba24a46975109","glsl-optimizer/src/compiler/glsl/ir_unused_structs.cpp":"9c1620c45f2fc071fe5ed828472040b14c5f42effe06aa0e3b8352c95ef78786","glsl-optimizer/src/compiler/glsl/ir_unused_structs.h":"13387b49c23093575276b25b9dfd31fedd8f131c5c4f3128ab04cf03e15b5295","glsl-optimizer/src/compiler/glsl/ir_validate.cpp":"6b232be5999a86ea278f4f15b2832d76843246509118d924243055a3b9b0299f","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.cpp":"2764a3cad937d53f36db7447c3a5b98b04bf153acf81074d971857fc5bca460d","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.h":"b0668e3eb1501ef65e38fe12830742ecb3d28e6039f30e366c8924efc29b4a39","glsl-optimizer/src/compiler/glsl/ir_visitor.h":"f21b3534c3d66d5fb707d1581fece7e1eb043523afbaedf89918cfb031c6df94","glsl-optimizer/src/compiler/glsl/link_atomics.cpp":"360f0209e11f367ba358223597b0a118bae095bff16337cf03f1fb89c5b80ca6","glsl-optimizer/src/compiler/glsl/link_functions.cpp":"de7895da8aa33a1e3c2c1eb2fdaf267ab5d1fbfdb79ae2e67f95211e946e294c","glsl-optimizer/src/compiler/glsl/link_interface_blocks.cpp":"1926cfa73810704eb19b916c1b2cdb9321155e2f98b2a0a57c7c3c6e960540cd","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.cpp":"1e14e06ca3b2c1089cfba2e8eaf0c1f373d9d6374b6082f320962dd71ae09611","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.h":"fd58c155af645295bb6aec08797889de586f4d919731de2bce57e8dce59bb048","glsl-optimizer/src/compiler/glsl/link_uniform_blocks.cpp":"09589f49776dce32e6c4044937de7e0c839a9754ad31960148f8f9e010658997","glsl-optimizer/src/compiler/glsl/link_uniform_initializers.cpp":"bf98e08c12db466acf9623cbeb8fa8e3b4002512722e7a6521287f558a099f37","glsl-optimizer/src/compiler/glsl/link_uniforms.cpp":"84bad5b1377362cecf259b05124239be5220b03ce1c0c61b59bd9a47e4379af2","glsl-optimizer/src/compiler/glsl/link_varyings.cpp":"a5f1a53e7c80d635515fe808ff223d89fef1767abb0f2b7aa28fa6773dca353f","glsl-optimizer/src/compiler/glsl/link_varyings.h":"b9dbe018f038df69763df2e928742ce81bbc6e3aaba26f50621e30a6d9aa6220","glsl-optimizer/src/compiler/glsl/linker.cpp":"40b1ecd5d4f6c7f13d5a87ce390561a51fdf6f3fcd9b2197b9c88b03a773ba94","glsl-optimizer/src/compiler/glsl/linker.h":"ecf94b4ad75ef461c27c557fda4bd25f34c91930822b8e1d729ec84520d4a049","glsl-optimizer/src/compiler/glsl/linker_util.cpp":"1663ad88e2a369305659aeeffaedb5bd752cf76340a2ba5797fc0bf600633cf9","glsl-optimizer/src/compiler/glsl/linker_util.h":"6db788daf9c8e87ae2764b61a8b37ebe419e69c1b82ddee01986e37c978c6993","glsl-optimizer/src/compiler/glsl/list.h":"b1f46ce0e552fe7c45b2a19408a9d97662e23e4b182ab335491c26f8cf25886f","glsl-optimizer/src/compiler/glsl/loop_analysis.cpp":"57ecd573477c68091c7cc99537faa7139a8f395935e3d4f10144cefdefb5a611","glsl-optimizer/src/compiler/glsl/loop_analysis.h":"a85f045a038ee5b5176063e85d7988865862c44ab0580f771b993a042d0b69cc","glsl-optimizer/src/compiler/glsl/loop_unroll.cpp":"bd4292ea2809f5a669bcb76ceaa1ac365772dcd638c579c3ed10275214901a54","glsl-optimizer/src/compiler/glsl/lower_blend_equation_advanced.cpp":"8cfbef140d9c4b4d2f57bfa05c9c374d31a121d0f87afce94333f049023b654a","glsl-optimizer/src/compiler/glsl/lower_buffer_access.cpp":"1ae221c3c7a95aeb867207e7a742be635f91b406c157747bfd6ddf10274d97fb","glsl-optimizer/src/compiler/glsl/lower_buffer_access.h":"807886953a576a323591798cbca5e2df24295ea893b28affd8ffb5926cebaa04","glsl-optimizer/src/compiler/glsl/lower_builtins.cpp":"4d81afc32cf58e1481fcb5e42888ab93dbe6820310a20ff7a9982b77b2152d9b","glsl-optimizer/src/compiler/glsl/lower_const_arrays_to_uniforms.cpp":"608403f0eeeedf21cfcd3014116e0f44e28cbdf6c4c32aac7e613e64e30205e1","glsl-optimizer/src/compiler/glsl/lower_cs_derived.cpp":"179905cd47a294122adeb5b0abfed6f2f67782dcde21b544d1ee2c1985154e66","glsl-optimizer/src/compiler/glsl/lower_discard.cpp":"3b361b2db0004d544d64611cb50d5a6e364cf6c5f2e60c449085d7d753dd7fb0","glsl-optimizer/src/compiler/glsl/lower_discard_flow.cpp":"f5c29b6a27690bb5c91f196d1a1cf9f6be4f1025292311fe2dac561ce6774dee","glsl-optimizer/src/compiler/glsl/lower_distance.cpp":"a118c85493d5d22b2c059a930c51a5854896d4b1dade76598eaa985e5a3dff8c","glsl-optimizer/src/compiler/glsl/lower_if_to_cond_assign.cpp":"469e617757fd1728709cce021aac5c8da05ee503bf5366977bdc4ef7a6d83950","glsl-optimizer/src/compiler/glsl/lower_instructions.cpp":"6ff5c396abe40d8a2145d571e99e2bbe9143393e15aafc28adc2803a01d821b6","glsl-optimizer/src/compiler/glsl/lower_int64.cpp":"d1ed41196880dd53c7b13e2782f9423f8442bf1d46186e8be92b1b66218a83ee","glsl-optimizer/src/compiler/glsl/lower_jumps.cpp":"34de7b493f281589fb0c2c0f6e885d0a0fabbe7a4e97a73de374dd714777a58c","glsl-optimizer/src/compiler/glsl/lower_mat_op_to_vec.cpp":"dff7a308edc4846c348ed4225c6699a9c75abac68d88f41f85954276552779f4","glsl-optimizer/src/compiler/glsl/lower_named_interface_blocks.cpp":"16063ac127bff75a68272070ab11c21c25101edbff62b4c68f4983b4cd941af0","glsl-optimizer/src/compiler/glsl/lower_offset_array.cpp":"3b00773399135aea85746a5a68b96ef000bc6841be1a2c8e6f25c516628b0949","glsl-optimizer/src/compiler/glsl/lower_output_reads.cpp":"a0fc9975d5aa1617e21fc6c353659a9802da9e83779a3eef4ec584f74b4dadc5","glsl-optimizer/src/compiler/glsl/lower_packed_varyings.cpp":"7550099d4ae123d71541c2fc88bc04fbfe9271ec75d7e210987d1c8cac3cf3ea","glsl-optimizer/src/compiler/glsl/lower_packing_builtins.cpp":"79a13d161fe505a410ab948d92769395708693ec888153630fa240e5b97e356f","glsl-optimizer/src/compiler/glsl/lower_precision.cpp":"f82a185b879872b977a1787d8061b9a80bc4cf8db1b970db6efba2ad9cc20fa2","glsl-optimizer/src/compiler/glsl/lower_shared_reference.cpp":"ea2dccf50a83bc19391bf6b7ab6aa53c0005f427af4066d25140340af9a4beef","glsl-optimizer/src/compiler/glsl/lower_subroutine.cpp":"f69fa53650eeb6f2944fce4d36a6e0a423e6705f3a3bd3389c7fadb83cfc8802","glsl-optimizer/src/compiler/glsl/lower_tess_level.cpp":"b196c9d424c0569f3e85d75c2d125af21566cb113d69036db87c0990703e0fa7","glsl-optimizer/src/compiler/glsl/lower_texture_projection.cpp":"4d247f244272adc8250fd888d8d932a140dd5de4d1efc7a58492c3c2b8291527","glsl-optimizer/src/compiler/glsl/lower_ubo_reference.cpp":"89bdbc6c1669230c644c0857db1ce2781ec61d349ecd08c7914146e1f4750a4a","glsl-optimizer/src/compiler/glsl/lower_variable_index_to_cond_assign.cpp":"fce930f29ac9405b297d1f749d68f59506b89c70b4ee1b1ab8cf49a34cc71ecf","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_cond_assign.cpp":"3c67d851a11a55fad1c49a550f3a0cfe50892d33a3f238ce266cd829eba510a8","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_swizzle.cpp":"f5ec666b73e1415cbab32519a53605ed385f3b03e889560373dbce69dda5000e","glsl-optimizer/src/compiler/glsl/lower_vector.cpp":"f7c13f5572ebe09b6a71553133b2cf003cd4b77b9657600672ee3b21bf890725","glsl-optimizer/src/compiler/glsl/lower_vector_derefs.cpp":"b05793da6dd620a531b43df5af8b2ecbc37b9db0c88910f5724ea10bcd057e19","glsl-optimizer/src/compiler/glsl/lower_vector_insert.cpp":"fee772ec17eea5e86a529bf9c5fa2ee0d29a5982bb75ebc6d68ed36cd19aa299","glsl-optimizer/src/compiler/glsl/lower_vertex_id.cpp":"690e8715182e03fead5cc5a35251fb4f41b357e4c71a1dfbc4bd7be19862b56d","glsl-optimizer/src/compiler/glsl/lower_xfb_varying.cpp":"58c0e8b270e4bbde54250be03cdb2f36966bcafb785372ad2e2b786835df7f9f","glsl-optimizer/src/compiler/glsl/main.cpp":"ae5e88abbbc8a12f769e1296bad938b9d7398cc6da0d3d0caeceeeb876536850","glsl-optimizer/src/compiler/glsl/opt_add_neg_to_sub.h":"f5054944bfd068810629080d0ea11df78b3f57a8f86df75e13ca50157ad1964d","glsl-optimizer/src/compiler/glsl/opt_algebraic.cpp":"25f45b20e1972ee8c789177a1aeda6e4286c25db2eae3a43ff83029ae64969c0","glsl-optimizer/src/compiler/glsl/opt_array_splitting.cpp":"19d3ce0e815438f4df9ab2890e767b03a4f3f191b53bb30c0217cf2ae6a95430","glsl-optimizer/src/compiler/glsl/opt_conditional_discard.cpp":"0e44e0e126711a3725c1f3a2aa65ff03c381fed08680ffc30101aae60f716c4e","glsl-optimizer/src/compiler/glsl/opt_constant_folding.cpp":"a088d04d9b45f9e55e235835648f614c89b7803c03a6d4f6a6d1a6bc1f0228bd","glsl-optimizer/src/compiler/glsl/opt_constant_propagation.cpp":"8a9440d77ecd6dcf13e683cbb99943aab6311c8fd4b5f6a9189a8d4f270746f4","glsl-optimizer/src/compiler/glsl/opt_constant_variable.cpp":"63d3ccd4dd09f19c9cf1a2f51592111bed41284504f29f3c0de4cadebc439a37","glsl-optimizer/src/compiler/glsl/opt_copy_propagation_elements.cpp":"ffa0f50863995e0d2e31f55a52e82319edc71e520987bebd7f7e561ea331c64b","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_variables.cpp":"84e8747b948232f01dd56b428b9315f96f9511f605f240119fc446fae28981a9","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_varyings.cpp":"761523e88f5b3ba785170f4d7205e94fa99acb7e74d29efbe40e1c010e1dbdb3","glsl-optimizer/src/compiler/glsl/opt_dead_code.cpp":"fd1ba2da7337d4e5dad17f5c2d73d9cc8880305f423e85d64cf94553588fa401","glsl-optimizer/src/compiler/glsl/opt_dead_code_local.cpp":"969a598b4df322baf222258a66cd64a326ea20e5b3125be9d8d1771f522c69e0","glsl-optimizer/src/compiler/glsl/opt_dead_functions.cpp":"774cae6536d02edf26e996a2a895e1f62d5098f16dc96b44798b4fc731a9a95f","glsl-optimizer/src/compiler/glsl/opt_flatten_nested_if_blocks.cpp":"3696a5c55f02e20056e085bc2714f73ac992f221b6f3387d655068e86b512046","glsl-optimizer/src/compiler/glsl/opt_flip_matrices.cpp":"44f0fe05b49329667671f88c96dc86ab3fe1459ff7b87f2b2d88de2d49829f9f","glsl-optimizer/src/compiler/glsl/opt_function_inlining.cpp":"fb56a33c90419a01676b57cbd91d0674a54cca40e6defaacc88dd33facebc131","glsl-optimizer/src/compiler/glsl/opt_if_simplification.cpp":"ac406eb35e379c357641d6c5749f50c65961455924d3dc884e2b90046fa92c5c","glsl-optimizer/src/compiler/glsl/opt_minmax.cpp":"8abd59d3b14ef60ff14a9c69660e6945f5cf10b97edb4afebe56be3f81d96316","glsl-optimizer/src/compiler/glsl/opt_rebalance_tree.cpp":"8bb6329dc0f299042368fc81934c2df019b45ab9f7aa0415d4e57b8d1ff98c9f","glsl-optimizer/src/compiler/glsl/opt_redundant_jumps.cpp":"222c73e2ac7a938ebb6428cc6c780c908ff6156d8ff935b04fed93a48fc10496","glsl-optimizer/src/compiler/glsl/opt_structure_splitting.cpp":"2edc79cc13f3177934e0443ad62f5976a1991f01f86ea303a803434849b13a47","glsl-optimizer/src/compiler/glsl/opt_swizzle.cpp":"015d0abddfe507f67c4b96c82988d861d018ededf7bf055e2bcbe9ea92da694e","glsl-optimizer/src/compiler/glsl/opt_tree_grafting.cpp":"46d28ac983ea244a4315bdc0e8892979ec4d1f9b9a96ac8a8a08006d9bc5e878","glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp":"d80ee43bb97d9f016fb9c5e1e06f5b2afa569811f368ba067be794ec11d085fb","glsl-optimizer/src/compiler/glsl/program.h":"2982447e2abd35371e273ad87951722782a8b21c08294f67c39d987da1e1c55f","glsl-optimizer/src/compiler/glsl/propagate_invariance.cpp":"080943e21baa32494723a2eefb185915d2daae1f46d6df420145c5ad6857e119","glsl-optimizer/src/compiler/glsl/s_expression.cpp":"1ced972bc6ecc8eab4116ea71fb0212ab9ae5bcc0be3b47aa5d9d903566b3af1","glsl-optimizer/src/compiler/glsl/s_expression.h":"65b847e30e22a809b57d0bc70243049c99d9c6318803c5b8d0826aba55dc217e","glsl-optimizer/src/compiler/glsl/serialize.cpp":"be0eb4251348a9d921acb839a5c48c6023a2e9d116d602bb0432787ab623655d","glsl-optimizer/src/compiler/glsl/serialize.h":"57425732eba1233d928e5f07f88b623ce65af46b3bb034bf147f0a4b7f94f9a1","glsl-optimizer/src/compiler/glsl/shader_cache.cpp":"e0c5c433f2df3fccdf1d61281bfcb0ee5633433339b97c697d64db99611cbaaf","glsl-optimizer/src/compiler/glsl/shader_cache.h":"9217164d8d7f54aca0fe5922c7187095a6ae0cb703b196b79805aeef07a7e697","glsl-optimizer/src/compiler/glsl/standalone.cpp":"8e6c416a14d631261917a5fe4cc91880c287b22b2dfd70eb22028289a8fa5364","glsl-optimizer/src/compiler/glsl/standalone.h":"a7c397d1dfdd1e7fb2cfe99db35cd9df93251e642059208533202b7f20497f83","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.cpp":"970d14b7a9d58e5270321f97bf5d57795558b1c570a56678e04a65b26c60bf4f","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.h":"d921a617ea82b9e49413314492a645c44356de503581b1be3f1b57de236e480d","glsl-optimizer/src/compiler/glsl/string_to_uint_map.cpp":"d824bf5b839bd39498dc9e457103cdbe3e5289ddf7564107c27b1505948dd31f","glsl-optimizer/src/compiler/glsl/string_to_uint_map.h":"e2f18e66359c9d620e085de7f4a334a47df9c66e65a5bfe8b734c627bec04104","glsl-optimizer/src/compiler/glsl/test_optpass.h":"b27b8f35f5387e7ce4982bb51c7b63ccf14f91757f3108a5d02ed006925bb8a0","glsl-optimizer/src/compiler/glsl/xxd.py":"376484142f27f45090ea8203ae2621abf73f06175cb0ee8d96f44a3b9327f4bd","glsl-optimizer/src/compiler/glsl_types.cpp":"044bb6754f45419a3151e7a25c39202a82009ae3c6bc54ff7f0bb4258a5deefe","glsl-optimizer/src/compiler/glsl_types.h":"fd899a42f34ddeb8601bc3cd6c5e3aed82fc8aef4042dde1b39b3c01e1dcc219","glsl-optimizer/src/compiler/shader_enums.c":"436bff5216b11b0980bdfada5885fc6ac9afa2037a3027fcd6eea2a8635597ac","glsl-optimizer/src/compiler/shader_enums.h":"13220442a5c02e83540cf2c0ad4f8417b2fbda5f2586dec4e92082544c937cdd","glsl-optimizer/src/compiler/shader_info.h":"4c5453e81197ca83593ee4f365074b23530f2ab21c78e1733b63dec6f344c12a","glsl-optimizer/src/gallium/auxiliary/util/u_half.h":"3c2b37bda3ccb64387e44b723d29cf9046decab1a893bf42d842e9603398bdee","glsl-optimizer/src/gallium/include/pipe/p_compiler.h":"c75620096ce8523dae90599e50aa2ef6468d3b0e368a77795edeb20dd1abfc0c","glsl-optimizer/src/gallium/include/pipe/p_config.h":"a27692fc35f9e55df3224b7529e66b3001e911e94e6bc5f8f569e493e1ee3fb7","glsl-optimizer/src/gallium/include/pipe/p_defines.h":"be26d68c0acc67c5e44788c6299716a9eee415fd81d7d747e3738a829e3b6b38","glsl-optimizer/src/gallium/include/pipe/p_format.h":"5674215fc41d27496f037cf837717daefbf23ebb38d40ace7c0c414bc08182b0","glsl-optimizer/src/gallium/include/pipe/p_state.h":"d600593aba5f5a17072a6c38f6baa81e01c7994b0174250f7e433bb41684b702","glsl-optimizer/src/mapi/glapi/glapi.h":"73632a625c0ddabc401205e8b5a81eb8af8506868efe4b170d7979ec3619e9c5","glsl-optimizer/src/mesa/main/config.h":"5800259373099e5405de2eb52619f9de242552a479902a3a642a333c8cb3c1e7","glsl-optimizer/src/mesa/main/context.c":"2f3208473d99c94f734b1137ba91889d4a1babb9e7534bf1dc85d851ee98274e","glsl-optimizer/src/mesa/main/context.h":"cc7e4194797db9d007f01884e23d786c453b3860821f7f2ddcdf0f1bf3f8ffb1","glsl-optimizer/src/mesa/main/dd.h":"6a964acd06b6c2d88700e69fb75fe3c6b3b3d45bbc41db24f3f897a29695fe0c","glsl-optimizer/src/mesa/main/debug_output.h":"7312422e90b8c0e34028ac27280e438139b5cba525c99deb3ac883cd3d87e452","glsl-optimizer/src/mesa/main/draw.h":"7eaef3a9e27a60ea6f7937109bf3a6190b831162fde0479abb12077ce27c353d","glsl-optimizer/src/mesa/main/enums.h":"87d562a6764f51c014a2274fa7c3aca17c04441537ddd56b2554f13c6fffea92","glsl-optimizer/src/mesa/main/errors.h":"c79444b5df289c90fbb22a33b2d0c23917d9fc4510960088f0b79e53bb56b1b2","glsl-optimizer/src/mesa/main/extensions.h":"a38b2f87cc93c513994281350d69e06c84ff8eded5313ec0a1be33f375e0ebbd","glsl-optimizer/src/mesa/main/extensions_table.c":"17642d1a8c9a0bf2bd61060052d33ff14a005d2b962e6cf91465797a50851e85","glsl-optimizer/src/mesa/main/extensions_table.h":"2c879571c238d2e14461031ac740372fd0f9ac3a34c0d5541bb9b7ed4c0376c8","glsl-optimizer/src/mesa/main/formats.h":"02e2f7ec3e39286cf9f27e2641043e6df8ecb1dfde9e643313210e214af2a929","glsl-optimizer/src/mesa/main/glheader.h":"58217b33eead6aa6b23cd4a291cefeaa6cb84e465f4960daffca97c44d6d1c35","glsl-optimizer/src/mesa/main/glthread.h":"51fb2711f77e7eafcfc52d29d5b844978832b24c930d88accd48d143a6eb9c6f","glsl-optimizer/src/mesa/main/hash.h":"7e7f782034c16a8e693de48e00c31d4a90b0129f4029fd074033d7d16ccbe718","glsl-optimizer/src/mesa/main/macros.h":"73d15ddfd64f2b57b9b2ffeeb993b9c2c0899a80563e9d6ff337b11ccbe6eee5","glsl-optimizer/src/mesa/main/menums.h":"5dfac0e2279d60b0cd0c7b9fc2a5021620d0f6282ed2e738c420214e3af152d3","glsl-optimizer/src/mesa/main/mesa_private.h":"edda678b93438944279a551f663b8858ad84814a9fc88ba9672ef195599c24ae","glsl-optimizer/src/mesa/main/mtypes.h":"6efddefa099e4d2e3fdd97f0055644f47aba21711385edfeabc2d9b0676f2eec","glsl-optimizer/src/mesa/main/shaderobj.h":"9f0dfe96d0c2154201adef942bd36053533ac7b2492fb3786acda5bea514c75e","glsl-optimizer/src/mesa/main/uniforms.h":"4e331e6ad6e9cbded978b4082dbe0a57c1f8f01327446bb6892bfc179976c38b","glsl-optimizer/src/mesa/main/version.h":"9d0a13a758099302dc55cf7d045791834a89b0f9d4cf17b2692259b369a8a9a1","glsl-optimizer/src/mesa/math/m_matrix.h":"a37b19f182e070db3df93b0ede43c22fb8be8c2906504133ee6dbd7db1185d8b","glsl-optimizer/src/mesa/program/dummy_errors.c":"1820e305515b4c5e041f5e1623266a48ec8f076a155310be7d60637101f593e4","glsl-optimizer/src/mesa/program/ir_to_mesa.h":"b47f58d22e3ca2ae42d52501ea769d15c4476834944fa97eeccd3a3439211d00","glsl-optimizer/src/mesa/program/prog_instruction.h":"ab3832152a7e144b59e5a2264b2c29db56d93be31e76bbd958527a56771b40eb","glsl-optimizer/src/mesa/program/prog_parameter.h":"ba18c743284eadbc837c2c364c73e5d372321a7637a76e589d8d39fe8b5de225","glsl-optimizer/src/mesa/program/prog_statevars.h":"fc413698f84bc52d45fdeae0471934ee9904bfb7eac1a2b5f70446e54bcbbdca","glsl-optimizer/src/mesa/program/program.h":"1f01026a4eff440a3f122fd9b519d03546fe7f7d8be60dca834e95a2f8fbbfd2","glsl-optimizer/src/mesa/program/symbol_table.c":"6611cb9f078035bf5ff8c9112093a6c7d99f8af99a3931d0c07f227cc72283ea","glsl-optimizer/src/mesa/program/symbol_table.h":"631dc35ac48d5e87962d45507461920f6575610960ffcc42a08cefeb43300cda","glsl-optimizer/src/mesa/vbo/vbo.h":"6eb1dcd9a08c92f276c5fe08da184ff9d455d1be421913b8ad732a7b65e858fb","glsl-optimizer/src/util/bitscan.h":"9e49e694e6b34fe035bc685f32588827eb8cbe7d82878963c7ab52843e1c16aa","glsl-optimizer/src/util/bitset.h":"c40f78515c6230fed18345c6751ce33833a49da7a27901c7e6d7340cbdcbc5e7","glsl-optimizer/src/util/blob.c":"8f729846f66efc9c15485cc5fc24c6ec861fc1fecb2f652573f2a237d481b791","glsl-optimizer/src/util/blob.h":"93e1eaac866b9a7cd6fc03b533c18fb2edf0e97f03395eff4f3a605c4fc14d0c","glsl-optimizer/src/util/compiler.h":"79e3bf40a5bab704e6c949f23a1352759607bb57d80e5d8df2ef159755f10b68","glsl-optimizer/src/util/crc32.c":"2f3467a046b3a76784ecb9aa55d527698c8607fd0b12c622f6691aaa77b58505","glsl-optimizer/src/util/crc32.h":"59bd81865e51042b73a86f8fb117c312418df095fed2d828c5c1d1c8b6fc6cd4","glsl-optimizer/src/util/debug.c":"c3d68e9752ccc19e66c669562cd113cf1d0ac83cbb30174789e7fb8d1df58f9c","glsl-optimizer/src/util/debug.h":"50068d745c4199ccbd33d68dd4c8a36d2b5179c7869a21e75906ddd0718ca456","glsl-optimizer/src/util/detect_os.h":"343a8790d17a3710c6dd015ee367f84e3902ff3f2e36faca2bf93f9d725d3574","glsl-optimizer/src/util/disk_cache.c":"f533937e5a4fffe76e2739ef4b6b1e1da097d96d63eb808e68ebbc7027641c23","glsl-optimizer/src/util/disk_cache.h":"e83314fb14134a8e079b15e470a6376ba5a8253701f048c890a62b7e55d64bc8","glsl-optimizer/src/util/fast_urem_by_const.h":"e108fce804616c47d071dfe4a04163eec1126e448ed1aa89abb6b3a6d772bd5b","glsl-optimizer/src/util/fnv1a.h":"ab2596f19c6adf431ae27618f62c5743e24ad23ef83bb359a4c4c218245ab459","glsl-optimizer/src/util/format/u_format.h":"4cdfc0c59cbc99a092e5ec5a396910f2d93b9643e5d8141050b011e66f11e45b","glsl-optimizer/src/util/futex.h":"26f7c9d86e9ffef4c0fa2761f1aaa1918337302e20bd6ca10e61dc3c47356deb","glsl-optimizer/src/util/half_float.c":"11bc2584493d5d9d46e8c8a619a0307cf150bf5ab5d0f96bb764b061dc37a00e","glsl-optimizer/src/util/half_float.h":"7f7c380f126da1400a91758cc0392f24bf967bce1672890b62be26fe9fbd922b","glsl-optimizer/src/util/hash_table.c":"0ca40352e35dedab0a84c64c903f1b16d47e950bb5f43b4d22bb57d499bfea6e","glsl-optimizer/src/util/hash_table.h":"217191bb360592e2232f187473c10287d2cda8ae6fa5c53d0ef74c8c206118b4","glsl-optimizer/src/util/list.h":"9fab03c6a78186bb5f173269f825f6ce976b409d931852e3d93bac632e07989a","glsl-optimizer/src/util/macros.h":"63faf65b51058c483b17f1f77da51d1c53c8beab52678cb6bd01f1228a63b6b0","glsl-optimizer/src/util/mesa-sha1.c":"00c692ec353ebc02c06c57c5a71de0ab7a119f86a4146f452e65ec87e4944417","glsl-optimizer/src/util/mesa-sha1.h":"bff4c29f4bf7cdbcefb30fa0c996a7604a380eba8976467c2a60e7cd328f7e26","glsl-optimizer/src/util/mesa-sha1_test.c":"25da89a59d51469f77b4c468ca23ffdce0a7a1166a70b6cc23026a6800b0143c","glsl-optimizer/src/util/os_memory.h":"64555faf1760ae6954f42c83727c38dfc4c278e9152115779ffaad58b42adacf","glsl-optimizer/src/util/os_memory_aligned.h":"12d86fa94be38c13f7eeebdf313795e1267dd5a7187d2f0072e0e896f41702f6","glsl-optimizer/src/util/os_memory_stdc.h":"07360363b88c927065e10df71bebf6c8a0cc3b9167c9dfce55f2d65f11e6f787","glsl-optimizer/src/util/os_misc.c":"a9936e613ec84803abd59ad47c192c8e3939993c950ac91973fdc4cec1801bb8","glsl-optimizer/src/util/os_misc.h":"cc68eb12e05b5e749c54298cb4a6f4cd20cc5af7db3403e70b3c27b56090c740","glsl-optimizer/src/util/os_time.h":"73e775f7335244ff5964c678c27eedf1aea6abea44c4169d327ea8c7ce4a3a88","glsl-optimizer/src/util/ralloc.c":"4b51189595ef67bcef52c40cbf654d969041dbd15e15d4a893ad494ac060aeca","glsl-optimizer/src/util/ralloc.h":"e573c45875ff1530f0dbee9a93ae55535fdac8d5cc88a79ebc327c688824bde5","glsl-optimizer/src/util/rounding.h":"0450722353caf83de07e67f335949dbe95fe53b534052d4ee9d28d2781387614","glsl-optimizer/src/util/set.c":"86f8c9a830bead5a5a79bc970b0ff97809312af07b3beb39ef9d90af04d40a1b","glsl-optimizer/src/util/set.h":"3e39ca161e7ed4ec7c436cc9c7919ed9a55ed1b71edbf2caf6f9bcfd9bc578ed","glsl-optimizer/src/util/sha1/README":"00af7419af05247081858acb2902efd99fcda2ce16e331079f701645bb3729c0","glsl-optimizer/src/util/sha1/sha1.c":"1403bbe0aad42ba3e6be7e09f7cad87a6a8c4ad5b63962f7b92b9f37d8133b04","glsl-optimizer/src/util/sha1/sha1.h":"68d9f240eab2918026ecdf22be36811abbd4f1389f6c36e31258041aeaedd247","glsl-optimizer/src/util/simple_mtx.h":"12c6c3c4b7db9168bc656d5b3c65912075084d2b388c415d5c3d3f5953a9d6c7","glsl-optimizer/src/util/softfloat.c":"a97e51a96fe5e6a052c02aa6bbec683fe73fb88a8c087d9c930503e2120d8a2e","glsl-optimizer/src/util/softfloat.h":"66664b0250e83bf5dd4cc743acd119d076efcea624a0eab3d6b60718e6ee8811","glsl-optimizer/src/util/string_buffer.c":"63a1d1b1e34926c88ea00159cafbcd56568b805c4f64d1e8c97169fe313921fc","glsl-optimizer/src/util/string_buffer.h":"7b88d1b1d9c6cfb8e93331813535c127289437c75f822029e9a3bca8ea6b52ee","glsl-optimizer/src/util/strndup.h":"0273c4fdb7482cd7746881a63d3998648c6d63415ba85af1d1860f0e0dc504c6","glsl-optimizer/src/util/strtod.c":"5cf610d8a37373cf37cfb7aae903525d943b2674b1f32594c70b0eb19a8c9697","glsl-optimizer/src/util/strtod.h":"237396def4e264d35ed4bedea00ef9a4ceab6d7a11a18c770d9747d22c69ed2d","glsl-optimizer/src/util/u_atomic.h":"c02e809526c6c09ba8fe51f50b2490d1b6c8e5c7f3c4031ae958250d098fc3bb","glsl-optimizer/src/util/u_debug.c":"8c060e379b816618f3dd22c9ea523c68b9425c76c36a7dfe5d6d375b337f5f4a","glsl-optimizer/src/util/u_debug.h":"e11e26edd9b9e4e6f8e6a435e69f4d9edda27e9a379f68f4c82ea2525aaaea68","glsl-optimizer/src/util/u_dynarray.h":"853d0fa6ff2261614488be624deb8a2b01e57c2c8eabc28578cbeed4ccc95694","glsl-optimizer/src/util/u_endian.h":"3ccea7e529740318d8a4b05c00db3adc9d1e292a52bdc56a05c9fae99209720f","glsl-optimizer/src/util/u_math.c":"c868a8c0886dc78f1b06b13404ba8b253090449045774dd56893ac9d75795184","glsl-optimizer/src/util/u_math.h":"a04e32e126db016413f9de0a2028a3e71737137463b1289eae576f884b06fcf1","glsl-optimizer/src/util/u_memory.h":"c5db17c724c70283ddbe04165722f6988d4e0eb9aa3602ae472feff016649af9","glsl-optimizer/src/util/u_queue.h":"92930ce236c0528a98b695f5cea8c5c6aa9683beaf71a2227bdc5d33d1b21506","glsl-optimizer/src/util/u_string.h":"c5a2f4ef576d1547bda12c4ea219179fefa54414977743ac094abcaf696ef6ca","glsl-optimizer/src/util/u_thread.h":"00b708459b27f9910d18db92c18cc65cfc618ac2b3cd144e45f8640057b10d58","glsl-optimizer/src/util/xxhash.h":"2f2aff2fc6c0c929f52cf6ae7314122124c5be026d41ad1c357608383c4a37ad","src/bindings.rs":"79993db2058bde39f99ef483d02560d33b1cb882f6a552319e8b86eb6f9021e1","src/lib.rs":"04be1554cd829eb40864b06d80b491dd48117a4e3a601c7d482117f7a0391e67","wrapper.hpp":"f3ea34cc496f7d90b9bfcada3250b37b314c3524dac693b2ece9517bc7d274ac"},"package":"913662ae8335df058d56e00f11340b20fa82e03e0276587797ef325ab01e50d4"} +\ No newline at end of file +diff -up firefox-146.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h.build-c11-threads-avail firefox-146.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h +--- firefox-146.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h.build-c11-threads-avail 2025-12-05 18:43:20.000000000 +0100 ++++ firefox-146.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h 2025-12-11 13:30:50.463371937 +0100 @@ -66,7 +66,7 @@ typedef pthread_cond_t cnd_t; typedef pthread_t thrd_t; typedef pthread_key_t tss_t; From 64c0ad783fd9411581518d56eb024b88f6942dc3 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 12 Dec 2025 08:53:48 +0100 Subject: [PATCH 534/545] Remove firefox-bin --- firefox.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/firefox.spec b/firefox.spec index 4656770..8db2dfd 100644 --- a/firefox.spec +++ b/firefox.spec @@ -201,7 +201,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 146.0 -Release: 3%{?pre_tag}%{?dist} +Release: 4%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -1018,6 +1018,7 @@ install -p -D -m 644 %{SOURCE23} %{buildroot}%{_mandir}/man1/firefox.1 rm -f %{buildroot}/%{mozappdir}/firefox-config rm -f %{buildroot}/%{mozappdir}/update-settings.ini +rm -f %{buildroot}/%{mozappdir}/firefox-bin for s in 16 22 24 32 48 256; do mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps @@ -1200,7 +1201,6 @@ fi %endif %{_bindir}/firefox %{mozappdir}/firefox -%{mozappdir}/firefox-bin %{mozappdir}/glxtest %doc %{_mandir}/man1/* %dir %{_sysconfdir}/%{name} @@ -1268,6 +1268,9 @@ fi #--------------------------------------------------------------------- %changelog +* Thu Dec 11 2025 Martin Stransky - 146.0-4 +- Removed firefox-bin + * Thu Dec 11 2025 Martin Stransky - 146.0-3 - Added aarch64 crash fix - Fixed rawhide gcc build (kudos to jhorak who hacked it! He's just awesome.) From eafa7d4b2bac3c1667920bbf33d56959471519f7 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 17 Dec 2025 13:26:05 +0100 Subject: [PATCH 535/545] Removed firefox-bin from man pages --- firefox.1 | 9 +-------- firefox.spec | 5 ++++- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/firefox.1 b/firefox.1 index 9228231..318f2af 100644 --- a/firefox.1 +++ b/firefox.1 @@ -6,17 +6,10 @@ firefox \- a Web browser for X11 derived from the Mozilla browser .B firefox [\fIOPTIONS\fR ...] [\fIURL\fR] -.B firefox-bin -[\fIOPTIONS\fR] [\fIURL\fR] - .SH DESCRIPTION \fBMozilla Firefox\fR is an open-source web browser, designed for standards compliance, performance and portability. -.SH USAGE -\fBfirefox\fR is a simple shell script that will set up the -environment for the actual executable, \fBfirefox-bin\fR. - .SH OPTIONS A summary of the options supported by \fBfirefox\fR is included below. @@ -132,7 +125,7 @@ Specify destination file for a drawing recording. \fI/usr/bin/firefox\fR - shell script wrapping \fBfirefox\fR .br -\fI/usr/lib64/firefox/firefox-bin\fR - \fBfirefox\fR +\fI/usr/lib64/firefox/firefox\fR - \fBfirefox\fR executable .SH VERSION diff --git a/firefox.spec b/firefox.spec index 8db2dfd..22b86c2 100644 --- a/firefox.spec +++ b/firefox.spec @@ -201,7 +201,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 146.0 -Release: 4%{?pre_tag}%{?dist} +Release: 5%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -1268,6 +1268,9 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Dec 17 2025 Martin Stransky - 146.0-5 +- Removed firefox-bin from man pages + * Thu Dec 11 2025 Martin Stransky - 146.0-4 - Removed firefox-bin From 6f0f3b9cb3ea04bf2e26e10616c96249b243cd3b Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 17 Dec 2025 14:01:48 +0100 Subject: [PATCH 536/545] -m --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 22b86c2..48cadde 100644 --- a/firefox.spec +++ b/firefox.spec @@ -863,7 +863,7 @@ export MOZ_DEBUG_FLAGS=" " MOZ_LINK_FLAGS="%{build_ldflags}" %if !%{with build_with_clang} %ifarch aarch64 %{ix86} ppc64le x86_64 -MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" +MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -Wl,--no-keep-memory" %endif %endif %ifarch %{ix86} s390x ppc64le From bab13b94df0e300524e3a506323c54f92f1fa4b7 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 17 Dec 2025 14:01:48 +0100 Subject: [PATCH 537/545] Removed -Wl,--reduce-memory-overheads as it throws unknown option error --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 22b86c2..48cadde 100644 --- a/firefox.spec +++ b/firefox.spec @@ -863,7 +863,7 @@ export MOZ_DEBUG_FLAGS=" " MOZ_LINK_FLAGS="%{build_ldflags}" %if !%{with build_with_clang} %ifarch aarch64 %{ix86} ppc64le x86_64 -MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" +MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -Wl,--no-keep-memory" %endif %endif %ifarch %{ix86} s390x ppc64le From 23c7be839d6b1939537267548eb396cd9e861229 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 17 Dec 2025 14:22:49 +0100 Subject: [PATCH 538/545] build fix --- IWYU.patch | 399 +++++++++++++++++++++++++++++++++++++++++++++++++++ firefox.spec | 8 +- wasi.patch | 2 +- 3 files changed, 407 insertions(+), 2 deletions(-) create mode 100644 IWYU.patch diff --git a/IWYU.patch b/IWYU.patch new file mode 100644 index 0000000..7a5b442 --- /dev/null +++ b/IWYU.patch @@ -0,0 +1,399 @@ +From e774818fc59945332a71daa449756ddfbd05576b Mon Sep 17 00:00:00 2001 +From: Dan Baker +Date: Wed, 22 Oct 2025 13:58:55 -0600 +Subject: [PATCH] Bug 1995393 - Vendor libwebrtc from 8f712e0ae3 + +Upstream commit: https://webrtc.googlesource.com/src/+/8f712e0ae30b56cd52166dfb50c2937d2223db1a + IWYU modules/desktop_capture and modules/video_capture for PipeWire + + Done using + find modules -name "*.h" -o -name "*.cc" | xargs tools_webrtc/iwyu/apply-include-cleaner + followed by + tools_webrtc/gn_check_autofix.py -C out/Default/ + and git cl format. + + Still keep pipewire/spa headers as ignored until PipeWire with IWYU + annotations is available and until we require version of PipeWire where + we are sure all the headers do exist. + + Bug: webrtc:422940461 + Change-Id: Idb8a43f77bfe7f5e08b6542211ca1400715093f0 + Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/401602 + Reviewed-by: Philipp Hancke + Reviewed-by: Ilya Nikolaevskiy + Reviewed-by: Harald Alvestrand + Reviewed-by: Alexander Cooper + Commit-Queue: Jan Grulich + Cr-Commit-Position: refs/heads/main@{#45289} +--- + .../libwebrtc/README.mozilla.last-vendor | 4 ++-- + .../linux/wayland/egl_dmabuf.cc | 2 +- + .../linux/wayland/screencast_stream_utils.cc | 8 ++++++- + .../linux/wayland/shared_screencast_stream.cc | 12 ++++++++++ + .../test/test_screencast_stream_provider.cc | 9 ++++++++ + .../test/test_screencast_stream_provider.h | 3 ++- + .../video_capture/linux/pipewire_session.cc | 9 +++++++- + .../video_capture/linux/pipewire_session.h | 7 ++++-- + .../linux/video_capture_pipewire.cc | 10 +++++++++ + .../linux/video_capture_pipewire.h | 4 ++++ + .../libwebrtc/moz-patch-stack/s0063.patch | 4 ++-- + .../libwebrtc/moz-patch-stack/s0074.patch | 6 ++--- + .../libwebrtc/moz-patch-stack/s0075.patch | 8 +++---- + .../libwebrtc/moz-patch-stack/s0098.patch | 22 +++++++++---------- + 14 files changed, 80 insertions(+), 28 deletions(-) + +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc +index 821fdfb487b7a..f7e1b0a00d404 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc +@@ -21,7 +21,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc +index c0023edda0a8a..251bc4e365854 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc +@@ -12,7 +12,13 @@ + + #include + #include +-#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include + + #include + #include +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +index 5828014a4e070..9be5546e3c9c7 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +@@ -13,7 +13,19 @@ + #include + #include + #include ++#include ++#include ++#include ++#include + #include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include + #include + #include + +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc +index 8b7fb41def2e9..dc736ddd55d2c 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc +@@ -13,7 +13,16 @@ + + #include + #include ++#include ++#include ++#include ++#include + #include ++#include ++#include ++#include ++#include ++#include + #include + #include + +diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h +index 63244d2b9c1f2..d48b020aa7d3c 100644 +--- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h ++++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h +@@ -12,7 +12,8 @@ + #define MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_TEST_TEST_SCREENCAST_STREAM_PROVIDER_H_ + + #include +-#include ++#include ++#include + + #include + +diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc +index 86368f6aa19bb..aa791b31c709b 100644 +--- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc ++++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc +@@ -11,11 +11,18 @@ + #include "modules/video_capture/linux/pipewire_session.h" + #include "modules/video_capture/linux/device_info_pipewire.h" + ++#include + #include + #include + #include ++#include + #include +-#include ++#include ++#include ++#include ++#include ++#include ++#include + + #include + #include +diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h +index ecf419a026dc4..a9e162a2ff69a 100644 +--- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h ++++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h +@@ -12,6 +12,9 @@ + #define MODULES_VIDEO_CAPTURE_LINUX_PIPEWIRE_SESSION_H_ + + #include ++#include ++#include ++#include + + #include + #include +@@ -71,8 +74,8 @@ class PipeWireNode { + const spa_pod* param); + static bool ParseFormat(const spa_pod* param, VideoCaptureCapability* cap); + +- pw_proxy* proxy_; +- spa_hook node_listener_; ++ struct pw_proxy* proxy_; ++ struct spa_hook node_listener_; + PipeWireSession* session_; + uint32_t id_; + std::string display_name_; +diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc +index e19af597dad19..65bfb928e9974 100644 +--- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc ++++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc +@@ -10,10 +10,20 @@ + + #include "modules/video_capture/linux/video_capture_pipewire.h" + ++#include ++#include ++#include ++#include + #include ++#include + #include ++#include + #include ++#include ++#include ++#include + #include ++#include + #include + + #include +diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h +index 17573037f7b40..a5f70f96a41f3 100644 +--- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h ++++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h +@@ -11,6 +11,10 @@ + #ifndef MODULES_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_PIPEWIRE_H_ + #define MODULES_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_PIPEWIRE_H_ + ++#include ++#include ++#include ++ + #include + + #include "api/scoped_refptr.h" +diff --git a/third_party/libwebrtc/moz-patch-stack/s0063.patch b/third_party/libwebrtc/moz-patch-stack/s0063.patch +index 0b8089dd0b9a3..a1fb77ad10da8 100644 +--- a/third_party/libwebrtc/moz-patch-stack/s0063.patch ++++ b/third_party/libwebrtc/moz-patch-stack/s0063.patch +@@ -18,7 +18,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/c8606497de1f461a6 + 1 file changed, 28 insertions(+), 2 deletions(-) + + diff --git a/modules/desktop_capture/linux/wayland/egl_dmabuf.cc b/modules/desktop_capture/linux/wayland/egl_dmabuf.cc +-index b580717bf4..821fdfb487 100644 ++index 3a80f4ecc1..f7e1b0a00d 100644 + --- a/modules/desktop_capture/linux/wayland/egl_dmabuf.cc + +++ b/modules/desktop_capture/linux/wayland/egl_dmabuf.cc + @@ -19,6 +19,7 @@ +@@ -27,7 +27,7 @@ index b580717bf4..821fdfb487 100644 + #include + +#include + #include +- #include ++ #include + #include + @@ -230,6 +231,26 @@ static void CloseLibrary(void* library) { + } +diff --git a/third_party/libwebrtc/moz-patch-stack/s0074.patch b/third_party/libwebrtc/moz-patch-stack/s0074.patch +index b792004299431..70c92bca05c1c 100644 +--- a/third_party/libwebrtc/moz-patch-stack/s0074.patch ++++ b/third_party/libwebrtc/moz-patch-stack/s0074.patch +@@ -10,10 +10,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/158a888cad8869a2f + 1 file changed, 8 insertions(+), 1 deletion(-) + + diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +-index 403e07ba57..d97eed6457 100644 ++index 02f5a56bed..f1f5a796e1 100644 + --- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc + +++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +-@@ -45,6 +45,13 @@ ++@@ -57,6 +57,13 @@ + #include "rtc_base/thread_annotations.h" + #include "rtc_base/time_utils.h" + +@@ -27,7 +27,7 @@ index 403e07ba57..d97eed6457 100644 + namespace webrtc { + + const int kBytesPerPixel = 4; +-@@ -286,7 +293,7 @@ void SharedScreenCastStreamPrivate::OnStreamParamChanged( ++@@ -298,7 +305,7 @@ void SharedScreenCastStreamPrivate::OnStreamParamChanged( + that->modifier_ = + has_modifier ? that->spa_video_format_.modifier : DRM_FORMAT_MOD_INVALID; + std::vector params; +diff --git a/third_party/libwebrtc/moz-patch-stack/s0075.patch b/third_party/libwebrtc/moz-patch-stack/s0075.patch +index 036a798f51409..573e7696aac37 100644 +--- a/third_party/libwebrtc/moz-patch-stack/s0075.patch ++++ b/third_party/libwebrtc/moz-patch-stack/s0075.patch +@@ -12,10 +12,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/237d19fe96dd7d25b + 1 file changed, 6 insertions(+), 3 deletions(-) + + diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +-index d97eed6457..5828014a4e 100644 ++index f1f5a796e1..9be5546e3c 100644 + --- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc + +++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +-@@ -424,7 +424,9 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( ++@@ -436,7 +436,9 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( + RTC_LOG(LS_ERROR) << "Unable to open PipeWire library"; + return false; + } +@@ -26,7 +26,7 @@ index d97eed6457..5828014a4e 100644 + + pw_stream_node_id_ = stream_node_id; + +-@@ -513,7 +515,8 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( ++@@ -525,7 +527,8 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( + for (uint32_t format : {SPA_VIDEO_FORMAT_BGRA, SPA_VIDEO_FORMAT_RGBA, + SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_RGBx}) { + // Modifiers can be used with PipeWire >= 0.3.33 +@@ -36,7 +36,7 @@ index d97eed6457..5828014a4e 100644 + modifiers_ = egl_dmabuf_->QueryDmaBufModifiers(format); + + if (!modifiers_.empty()) { +-@@ -959,7 +962,7 @@ bool SharedScreenCastStreamPrivate::ProcessDMABuffer( ++@@ -971,7 +974,7 @@ bool SharedScreenCastStreamPrivate::ProcessDMABuffer( + + const uint n_planes = spa_buffer->n_datas; + +diff --git a/third_party/libwebrtc/moz-patch-stack/s0098.patch b/third_party/libwebrtc/moz-patch-stack/s0098.patch +index 4fe0e9e698d0e..d80ffc77c631b 100644 +--- a/third_party/libwebrtc/moz-patch-stack/s0098.patch ++++ b/third_party/libwebrtc/moz-patch-stack/s0098.patch +@@ -42,7 +42,7 @@ index 009e1408b9..a737f9bdb3 100644 + uint32_t DeviceInfoPipeWire::NumberOfDevices() { + RTC_CHECK(pipewire_session_); + diff --git a/modules/video_capture/linux/pipewire_session.cc b/modules/video_capture/linux/pipewire_session.cc +-index 2c533a0edb..86368f6aa1 100644 ++index 2eb73a47e8..aa791b31c7 100644 + --- a/modules/video_capture/linux/pipewire_session.cc + +++ b/modules/video_capture/linux/pipewire_session.cc + @@ -9,6 +9,7 @@ +@@ -51,9 +51,9 @@ index 2c533a0edb..86368f6aa1 100644 + #include "modules/video_capture/linux/pipewire_session.h" + +#include "modules/video_capture/linux/device_info_pipewire.h" + ++ #include + #include +- #include +-@@ -296,6 +297,28 @@ void PipeWireSession::InitPipeWire(int fd) { ++@@ -303,6 +304,28 @@ void PipeWireSession::InitPipeWire(int fd) { + Finish(VideoCaptureOptions::Status::ERROR); + } + +@@ -82,7 +82,7 @@ index 2c533a0edb..86368f6aa1 100644 + RTC_NO_SANITIZE("cfi-icall") + bool PipeWireSession::StartPipeWire(int fd) { + pw_init(/*argc=*/nullptr, /*argv=*/nullptr); +-@@ -368,6 +391,21 @@ void PipeWireSession::PipeWireSync() { ++@@ -375,6 +398,21 @@ void PipeWireSession::PipeWireSync() { + sync_seq_ = pw_core_sync(pw_core_, PW_ID_CORE, sync_seq_); + } + +@@ -104,7 +104,7 @@ index 2c533a0edb..86368f6aa1 100644 + // static + void PipeWireSession::OnCoreError(void* data, + uint32_t id, +-@@ -426,6 +464,8 @@ void PipeWireSession::OnRegistryGlobal(void* data, ++@@ -433,6 +471,8 @@ void PipeWireSession::OnRegistryGlobal(void* data, + + that->nodes_.push_back(PipeWireNode::Create(that, id, props)); + that->PipeWireSync(); +@@ -113,7 +113,7 @@ index 2c533a0edb..86368f6aa1 100644 + } + + // static +-@@ -437,10 +477,15 @@ void PipeWireSession::OnRegistryGlobalRemove(void* data, uint32_t id) { ++@@ -444,10 +484,15 @@ void PipeWireSession::OnRegistryGlobalRemove(void* data, uint32_t id) { + return node->id() == id; + }); + that->nodes_.erase(it, that->nodes_.end()); +@@ -131,10 +131,10 @@ index 2c533a0edb..86368f6aa1 100644 + webrtc::MutexLock lock(&callback_lock_); + + diff --git a/modules/video_capture/linux/pipewire_session.h b/modules/video_capture/linux/pipewire_session.h +-index b2a2023585..ecf419a026 100644 ++index 84848d76ef..a9e162a2ff 100644 + --- a/modules/video_capture/linux/pipewire_session.h + +++ b/modules/video_capture/linux/pipewire_session.h +-@@ -31,6 +31,7 @@ ++@@ -34,6 +34,7 @@ + namespace webrtc { + namespace videocapturemodule { + +@@ -142,7 +142,7 @@ index b2a2023585..ecf419a026 100644 + class PipeWireSession; + class VideoCaptureModulePipeWire; + +-@@ -99,6 +100,21 @@ class PipeWireSession : public webrtc::RefCountedNonVirtual { ++@@ -102,6 +103,21 @@ class PipeWireSession : public webrtc::RefCountedNonVirtual { + + void Init(VideoCaptureOptions::Callback* callback, + int fd = kInvalidPipeWireFd); +@@ -164,7 +164,7 @@ index b2a2023585..ecf419a026 100644 + const std::deque& nodes() const { + return nodes_; + } +-@@ -113,6 +129,8 @@ class PipeWireSession : public webrtc::RefCountedNonVirtual { ++@@ -116,6 +132,8 @@ class PipeWireSession : public webrtc::RefCountedNonVirtual { + void StopPipeWire(); + void PipeWireSync(); + +@@ -173,7 +173,7 @@ index b2a2023585..ecf419a026 100644 + static void OnCoreError(void* data, + uint32_t id, + int seq, +-@@ -135,7 +153,13 @@ class PipeWireSession : public webrtc::RefCountedNonVirtual { ++@@ -138,7 +156,13 @@ class PipeWireSession : public webrtc::RefCountedNonVirtual { + VideoCaptureOptions::Callback* callback_ RTC_GUARDED_BY(&callback_lock_) = + nullptr; + diff --git a/firefox.spec b/firefox.spec index 48cadde..defbbbb 100644 --- a/firefox.spec +++ b/firefox.spec @@ -201,7 +201,7 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox Version: 146.0 -Release: 5%{?pre_tag}%{?dist} +Release: 6%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ @@ -275,6 +275,7 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch Patch400: mozilla-1196777.patch Patch401: mozilla-1667096.patch Patch402: D275955.1765540580.diff +Patch403: IWYU.patch # PGO/LTO patches Patch600: pgo.patch @@ -595,6 +596,7 @@ cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysr %patch -P400 -p1 -b .1196777 %patch -P401 -p1 -b .1667096 %patch -P402 -p1 -b .D275955.1765540580 +%patch -P403 -p1 -b .IWYU # PGO patches %if %{build_with_pgo} @@ -1268,6 +1270,10 @@ fi #--------------------------------------------------------------------- %changelog +* Wed Dec 17 2025 Martin Stransky - 146.0-6 +- Added upstream patch IWYU (libwebrtc IWYU fixes for PipeWire) +- Claude AI assisted editing (failed to do whole work, but it was close!) + * Wed Dec 17 2025 Martin Stransky - 146.0-5 - Removed firefox-bin from man pages diff --git a/wasi.patch b/wasi.patch index c6c2f91..8e32b85 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/home/komat/CVS/firefox/firefox-144.0-build/firefox-144.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-146.0-build/firefox-146.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 89608198f4f6f33e0990bc9d7cbd2ff5353cb92b Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 19 Dec 2025 09:25:39 +0100 Subject: [PATCH 539/545] Updated to 146.0.1 --- .gitignore | 2 ++ firefox.spec | 9 ++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index be18a7a..0699076 100644 --- a/.gitignore +++ b/.gitignore @@ -743,3 +743,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-146.0.source.tar.xz /firefox-langpacks-146.0-20251202.tar.xz /firefox-langpacks-146.0-20251208.tar.xz +/firefox-146.0.1.source.tar.xz +/firefox-langpacks-146.0.1-20251219.tar.xz diff --git a/firefox.spec b/firefox.spec index defbbbb..a3bf450 100644 --- a/firefox.spec +++ b/firefox.spec @@ -200,14 +200,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 146.0 -Release: 6%{?pre_tag}%{?dist} +Version: 146.0.1 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20251208.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20251219.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1270,6 +1270,9 @@ fi #--------------------------------------------------------------------- %changelog +* Fri Dec 19 2025 Martin Stransky - 146.0.1-1 +- Updated to 146.0.1 + * Wed Dec 17 2025 Martin Stransky - 146.0-6 - Added upstream patch IWYU (libwebrtc IWYU fixes for PipeWire) - Claude AI assisted editing (failed to do whole work, but it was close!) diff --git a/sources b/sources index ac0fdb4..d632e98 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = bea420e66bdd1c7c944655dd3e01abd6e7d6ac4b245c7ee190f31d800f7786f21e5cae11715b479bf795f4369d18c40dc12df19e0b643664f2f78e5c8a681415 -SHA512 (firefox-langpacks-146.0-20251208.tar.xz) = 6084dc27a0519647ca6016fb4e6a95bcdcf9cab409abffc8296af237b650d0704ff351dd66ebe4ef52f65622941f0a40f7ffe52cfb15d416e7cba6ce11f47b00 -SHA512 (firefox-146.0.source.tar.xz) = db6664310cdcdede832b29dea533b345a3ac86f9df7813118d44b1ec2c4a32e4de2b6e98044385ca6f6026eb3a9994c486a1ddb8b6f4ae7589ed46b122c05630 +SHA512 (firefox-146.0.1.source.tar.xz) = ae95b86e483febf8dfec8347748dd9048ed7d7f845250e07aa8048e2b351da61f6f3c5f83bb0d0c72e1a75ec61b60e59bbe69639f0f33532910ff8bf5ca07394 +SHA512 (firefox-langpacks-146.0.1-20251219.tar.xz) = da5d32fbfbdad65d270f30a8b4d335ab30531e1362705c0f43274906a701886babec2ef67e8e887ab074b3483932287f4f0131c1d64e5021a2124e27b8d0f243 From 1e7c0442f39be3867dd19b52196463dc02d581a9 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 6 Jan 2026 09:13:17 +0100 Subject: [PATCH 540/545] Updated to 147.0 --- .gitignore | 2 ++ firefox.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 0699076..fd8c1c6 100644 --- a/.gitignore +++ b/.gitignore @@ -745,3 +745,5 @@ firefox-3.6.4.source.tar.bz2 /firefox-langpacks-146.0-20251208.tar.xz /firefox-146.0.1.source.tar.xz /firefox-langpacks-146.0.1-20251219.tar.xz +/firefox-langpacks-147.0-20260106.tar.xz +/firefox-147.0.source.tar.xz diff --git a/firefox.spec b/firefox.spec index a3bf450..4315c8c 100644 --- a/firefox.spec +++ b/firefox.spec @@ -200,14 +200,14 @@ ExcludeArch: i686 Summary: Mozilla Firefox Web browser Name: firefox -Version: 146.0.1 +Version: 147.0 Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ # Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20251219.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20250106.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz @@ -1270,6 +1270,9 @@ fi #--------------------------------------------------------------------- %changelog +* Tue Jan 06 2025 Martin Stransky - 147.0-1 +- Updated to 147.0 + * Fri Dec 19 2025 Martin Stransky - 146.0.1-1 - Updated to 146.0.1 diff --git a/sources b/sources index d632e98..b87ab2c 100644 --- a/sources +++ b/sources @@ -3,5 +3,5 @@ SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 SHA512 (cbindgen-vendor.tar.xz) = bea420e66bdd1c7c944655dd3e01abd6e7d6ac4b245c7ee190f31d800f7786f21e5cae11715b479bf795f4369d18c40dc12df19e0b643664f2f78e5c8a681415 -SHA512 (firefox-146.0.1.source.tar.xz) = ae95b86e483febf8dfec8347748dd9048ed7d7f845250e07aa8048e2b351da61f6f3c5f83bb0d0c72e1a75ec61b60e59bbe69639f0f33532910ff8bf5ca07394 -SHA512 (firefox-langpacks-146.0.1-20251219.tar.xz) = da5d32fbfbdad65d270f30a8b4d335ab30531e1362705c0f43274906a701886babec2ef67e8e887ab074b3483932287f4f0131c1d64e5021a2124e27b8d0f243 +SHA512 (firefox-langpacks-147.0-20260106.tar.xz) = 4006c6e8dda8722509c1d1756807373d431d75b20d5a0c3f19e72a2a0dc76df62b15ef871e3fff2d30b2682e6a56b4a4541d8445ea1b83641559a3270e0057b7 +SHA512 (firefox-147.0.source.tar.xz) = ac9017b1a2da7b2f139392c394c36341fd3476e3d4ea1a3c7e5e7bf100dc30d185132ef9256be7e6b0f9dbfc69234ac571ea1fc6db9d84543b15772f4ec85161 From 462718a74b59cdd4ea78f2937353348880a6f5a3 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 6 Jan 2026 09:39:20 +0100 Subject: [PATCH 541/545] Updated to 147.0 - removed unused patches --- D275955.1765540580.diff | 17 -- IWYU.patch | 399 ---------------------------------- build-c11-threads-avail.patch | 36 --- firefox.spec | 8 +- wasi.patch | 2 +- 5 files changed, 2 insertions(+), 460 deletions(-) delete mode 100644 D275955.1765540580.diff delete mode 100644 IWYU.patch delete mode 100644 build-c11-threads-avail.patch diff --git a/D275955.1765540580.diff b/D275955.1765540580.diff deleted file mode 100644 index 65928d8..0000000 --- a/D275955.1765540580.diff +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/parser/htmlaccel/htmlaccelEnabled.h b/parser/htmlaccel/htmlaccelEnabled.h ---- a/parser/htmlaccel/htmlaccelEnabled.h -+++ b/parser/htmlaccel/htmlaccelEnabled.h -@@ -26,11 +26,11 @@ - inline bool htmlaccelEnabled() { - #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ < 12 - // __GNUC__ is stuck at 4 in clang, so we need to check __clang__ above. - // GCC 12 or newer is required for __builtin_shuffle. - return false; --#elif defined(__aarch64__) && defined(__LITTLE_ENDIAN__) -+#elif defined(__aarch64__) && defined(__ORDER_LITTLE_ENDIAN__) - # define MOZ_MAY_HAVE_HTMLACCEL 1 - return true; - #elif defined(__x86_64__) - # define MOZ_MAY_HAVE_HTMLACCEL 1 - bool ret = mozilla::supports_bmi(); - diff --git a/IWYU.patch b/IWYU.patch deleted file mode 100644 index 7a5b442..0000000 --- a/IWYU.patch +++ /dev/null @@ -1,399 +0,0 @@ -From e774818fc59945332a71daa449756ddfbd05576b Mon Sep 17 00:00:00 2001 -From: Dan Baker -Date: Wed, 22 Oct 2025 13:58:55 -0600 -Subject: [PATCH] Bug 1995393 - Vendor libwebrtc from 8f712e0ae3 - -Upstream commit: https://webrtc.googlesource.com/src/+/8f712e0ae30b56cd52166dfb50c2937d2223db1a - IWYU modules/desktop_capture and modules/video_capture for PipeWire - - Done using - find modules -name "*.h" -o -name "*.cc" | xargs tools_webrtc/iwyu/apply-include-cleaner - followed by - tools_webrtc/gn_check_autofix.py -C out/Default/ - and git cl format. - - Still keep pipewire/spa headers as ignored until PipeWire with IWYU - annotations is available and until we require version of PipeWire where - we are sure all the headers do exist. - - Bug: webrtc:422940461 - Change-Id: Idb8a43f77bfe7f5e08b6542211ca1400715093f0 - Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/401602 - Reviewed-by: Philipp Hancke - Reviewed-by: Ilya Nikolaevskiy - Reviewed-by: Harald Alvestrand - Reviewed-by: Alexander Cooper - Commit-Queue: Jan Grulich - Cr-Commit-Position: refs/heads/main@{#45289} ---- - .../libwebrtc/README.mozilla.last-vendor | 4 ++-- - .../linux/wayland/egl_dmabuf.cc | 2 +- - .../linux/wayland/screencast_stream_utils.cc | 8 ++++++- - .../linux/wayland/shared_screencast_stream.cc | 12 ++++++++++ - .../test/test_screencast_stream_provider.cc | 9 ++++++++ - .../test/test_screencast_stream_provider.h | 3 ++- - .../video_capture/linux/pipewire_session.cc | 9 +++++++- - .../video_capture/linux/pipewire_session.h | 7 ++++-- - .../linux/video_capture_pipewire.cc | 10 +++++++++ - .../linux/video_capture_pipewire.h | 4 ++++ - .../libwebrtc/moz-patch-stack/s0063.patch | 4 ++-- - .../libwebrtc/moz-patch-stack/s0074.patch | 6 ++--- - .../libwebrtc/moz-patch-stack/s0075.patch | 8 +++---- - .../libwebrtc/moz-patch-stack/s0098.patch | 22 +++++++++---------- - 14 files changed, 80 insertions(+), 28 deletions(-) - -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc -index 821fdfb487b7a..f7e1b0a00d404 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc -@@ -21,7 +21,7 @@ - #include - #include - #include --#include -+#include - #include - #include - -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc -index c0023edda0a8a..251bc4e365854 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc -@@ -12,7 +12,13 @@ - - #include - #include --#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include - - #include - #include -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -index 5828014a4e070..9be5546e3c9c7 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -@@ -13,7 +13,19 @@ - #include - #include - #include -+#include -+#include -+#include -+#include - #include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include - #include - #include - -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc -index 8b7fb41def2e9..dc736ddd55d2c 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc -@@ -13,7 +13,16 @@ - - #include - #include -+#include -+#include -+#include -+#include - #include -+#include -+#include -+#include -+#include -+#include - #include - #include - -diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h -index 63244d2b9c1f2..d48b020aa7d3c 100644 ---- a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h -+++ b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h -@@ -12,7 +12,8 @@ - #define MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_TEST_TEST_SCREENCAST_STREAM_PROVIDER_H_ - - #include --#include -+#include -+#include - - #include - -diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc -index 86368f6aa19bb..aa791b31c709b 100644 ---- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc -+++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc -@@ -11,11 +11,18 @@ - #include "modules/video_capture/linux/pipewire_session.h" - #include "modules/video_capture/linux/device_info_pipewire.h" - -+#include - #include - #include - #include -+#include - #include --#include -+#include -+#include -+#include -+#include -+#include -+#include - - #include - #include -diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h -index ecf419a026dc4..a9e162a2ff69a 100644 ---- a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h -+++ b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h -@@ -12,6 +12,9 @@ - #define MODULES_VIDEO_CAPTURE_LINUX_PIPEWIRE_SESSION_H_ - - #include -+#include -+#include -+#include - - #include - #include -@@ -71,8 +74,8 @@ class PipeWireNode { - const spa_pod* param); - static bool ParseFormat(const spa_pod* param, VideoCaptureCapability* cap); - -- pw_proxy* proxy_; -- spa_hook node_listener_; -+ struct pw_proxy* proxy_; -+ struct spa_hook node_listener_; - PipeWireSession* session_; - uint32_t id_; - std::string display_name_; -diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc -index e19af597dad19..65bfb928e9974 100644 ---- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc -+++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc -@@ -10,10 +10,20 @@ - - #include "modules/video_capture/linux/video_capture_pipewire.h" - -+#include -+#include -+#include -+#include - #include -+#include - #include -+#include - #include -+#include -+#include -+#include - #include -+#include - #include - - #include -diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h -index 17573037f7b40..a5f70f96a41f3 100644 ---- a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h -+++ b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h -@@ -11,6 +11,10 @@ - #ifndef MODULES_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_PIPEWIRE_H_ - #define MODULES_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_PIPEWIRE_H_ - -+#include -+#include -+#include -+ - #include - - #include "api/scoped_refptr.h" -diff --git a/third_party/libwebrtc/moz-patch-stack/s0063.patch b/third_party/libwebrtc/moz-patch-stack/s0063.patch -index 0b8089dd0b9a3..a1fb77ad10da8 100644 ---- a/third_party/libwebrtc/moz-patch-stack/s0063.patch -+++ b/third_party/libwebrtc/moz-patch-stack/s0063.patch -@@ -18,7 +18,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/c8606497de1f461a6 - 1 file changed, 28 insertions(+), 2 deletions(-) - - diff --git a/modules/desktop_capture/linux/wayland/egl_dmabuf.cc b/modules/desktop_capture/linux/wayland/egl_dmabuf.cc --index b580717bf4..821fdfb487 100644 -+index 3a80f4ecc1..f7e1b0a00d 100644 - --- a/modules/desktop_capture/linux/wayland/egl_dmabuf.cc - +++ b/modules/desktop_capture/linux/wayland/egl_dmabuf.cc - @@ -19,6 +19,7 @@ -@@ -27,7 +27,7 @@ index b580717bf4..821fdfb487 100644 - #include - +#include - #include -- #include -+ #include - #include - @@ -230,6 +231,26 @@ static void CloseLibrary(void* library) { - } -diff --git a/third_party/libwebrtc/moz-patch-stack/s0074.patch b/third_party/libwebrtc/moz-patch-stack/s0074.patch -index b792004299431..70c92bca05c1c 100644 ---- a/third_party/libwebrtc/moz-patch-stack/s0074.patch -+++ b/third_party/libwebrtc/moz-patch-stack/s0074.patch -@@ -10,10 +10,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/158a888cad8869a2f - 1 file changed, 8 insertions(+), 1 deletion(-) - - diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc --index 403e07ba57..d97eed6457 100644 -+index 02f5a56bed..f1f5a796e1 100644 - --- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc - +++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc --@@ -45,6 +45,13 @@ -+@@ -57,6 +57,13 @@ - #include "rtc_base/thread_annotations.h" - #include "rtc_base/time_utils.h" - -@@ -27,7 +27,7 @@ index 403e07ba57..d97eed6457 100644 - namespace webrtc { - - const int kBytesPerPixel = 4; --@@ -286,7 +293,7 @@ void SharedScreenCastStreamPrivate::OnStreamParamChanged( -+@@ -298,7 +305,7 @@ void SharedScreenCastStreamPrivate::OnStreamParamChanged( - that->modifier_ = - has_modifier ? that->spa_video_format_.modifier : DRM_FORMAT_MOD_INVALID; - std::vector params; -diff --git a/third_party/libwebrtc/moz-patch-stack/s0075.patch b/third_party/libwebrtc/moz-patch-stack/s0075.patch -index 036a798f51409..573e7696aac37 100644 ---- a/third_party/libwebrtc/moz-patch-stack/s0075.patch -+++ b/third_party/libwebrtc/moz-patch-stack/s0075.patch -@@ -12,10 +12,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/237d19fe96dd7d25b - 1 file changed, 6 insertions(+), 3 deletions(-) - - diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc --index d97eed6457..5828014a4e 100644 -+index f1f5a796e1..9be5546e3c 100644 - --- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc - +++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc --@@ -424,7 +424,9 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( -+@@ -436,7 +436,9 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( - RTC_LOG(LS_ERROR) << "Unable to open PipeWire library"; - return false; - } -@@ -26,7 +26,7 @@ index d97eed6457..5828014a4e 100644 - - pw_stream_node_id_ = stream_node_id; - --@@ -513,7 +515,8 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( -+@@ -525,7 +527,8 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( - for (uint32_t format : {SPA_VIDEO_FORMAT_BGRA, SPA_VIDEO_FORMAT_RGBA, - SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_RGBx}) { - // Modifiers can be used with PipeWire >= 0.3.33 -@@ -36,7 +36,7 @@ index d97eed6457..5828014a4e 100644 - modifiers_ = egl_dmabuf_->QueryDmaBufModifiers(format); - - if (!modifiers_.empty()) { --@@ -959,7 +962,7 @@ bool SharedScreenCastStreamPrivate::ProcessDMABuffer( -+@@ -971,7 +974,7 @@ bool SharedScreenCastStreamPrivate::ProcessDMABuffer( - - const uint n_planes = spa_buffer->n_datas; - -diff --git a/third_party/libwebrtc/moz-patch-stack/s0098.patch b/third_party/libwebrtc/moz-patch-stack/s0098.patch -index 4fe0e9e698d0e..d80ffc77c631b 100644 ---- a/third_party/libwebrtc/moz-patch-stack/s0098.patch -+++ b/third_party/libwebrtc/moz-patch-stack/s0098.patch -@@ -42,7 +42,7 @@ index 009e1408b9..a737f9bdb3 100644 - uint32_t DeviceInfoPipeWire::NumberOfDevices() { - RTC_CHECK(pipewire_session_); - diff --git a/modules/video_capture/linux/pipewire_session.cc b/modules/video_capture/linux/pipewire_session.cc --index 2c533a0edb..86368f6aa1 100644 -+index 2eb73a47e8..aa791b31c7 100644 - --- a/modules/video_capture/linux/pipewire_session.cc - +++ b/modules/video_capture/linux/pipewire_session.cc - @@ -9,6 +9,7 @@ -@@ -51,9 +51,9 @@ index 2c533a0edb..86368f6aa1 100644 - #include "modules/video_capture/linux/pipewire_session.h" - +#include "modules/video_capture/linux/device_info_pipewire.h" - -+ #include - #include -- #include --@@ -296,6 +297,28 @@ void PipeWireSession::InitPipeWire(int fd) { -+@@ -303,6 +304,28 @@ void PipeWireSession::InitPipeWire(int fd) { - Finish(VideoCaptureOptions::Status::ERROR); - } - -@@ -82,7 +82,7 @@ index 2c533a0edb..86368f6aa1 100644 - RTC_NO_SANITIZE("cfi-icall") - bool PipeWireSession::StartPipeWire(int fd) { - pw_init(/*argc=*/nullptr, /*argv=*/nullptr); --@@ -368,6 +391,21 @@ void PipeWireSession::PipeWireSync() { -+@@ -375,6 +398,21 @@ void PipeWireSession::PipeWireSync() { - sync_seq_ = pw_core_sync(pw_core_, PW_ID_CORE, sync_seq_); - } - -@@ -104,7 +104,7 @@ index 2c533a0edb..86368f6aa1 100644 - // static - void PipeWireSession::OnCoreError(void* data, - uint32_t id, --@@ -426,6 +464,8 @@ void PipeWireSession::OnRegistryGlobal(void* data, -+@@ -433,6 +471,8 @@ void PipeWireSession::OnRegistryGlobal(void* data, - - that->nodes_.push_back(PipeWireNode::Create(that, id, props)); - that->PipeWireSync(); -@@ -113,7 +113,7 @@ index 2c533a0edb..86368f6aa1 100644 - } - - // static --@@ -437,10 +477,15 @@ void PipeWireSession::OnRegistryGlobalRemove(void* data, uint32_t id) { -+@@ -444,10 +484,15 @@ void PipeWireSession::OnRegistryGlobalRemove(void* data, uint32_t id) { - return node->id() == id; - }); - that->nodes_.erase(it, that->nodes_.end()); -@@ -131,10 +131,10 @@ index 2c533a0edb..86368f6aa1 100644 - webrtc::MutexLock lock(&callback_lock_); - - diff --git a/modules/video_capture/linux/pipewire_session.h b/modules/video_capture/linux/pipewire_session.h --index b2a2023585..ecf419a026 100644 -+index 84848d76ef..a9e162a2ff 100644 - --- a/modules/video_capture/linux/pipewire_session.h - +++ b/modules/video_capture/linux/pipewire_session.h --@@ -31,6 +31,7 @@ -+@@ -34,6 +34,7 @@ - namespace webrtc { - namespace videocapturemodule { - -@@ -142,7 +142,7 @@ index b2a2023585..ecf419a026 100644 - class PipeWireSession; - class VideoCaptureModulePipeWire; - --@@ -99,6 +100,21 @@ class PipeWireSession : public webrtc::RefCountedNonVirtual { -+@@ -102,6 +103,21 @@ class PipeWireSession : public webrtc::RefCountedNonVirtual { - - void Init(VideoCaptureOptions::Callback* callback, - int fd = kInvalidPipeWireFd); -@@ -164,7 +164,7 @@ index b2a2023585..ecf419a026 100644 - const std::deque& nodes() const { - return nodes_; - } --@@ -113,6 +129,8 @@ class PipeWireSession : public webrtc::RefCountedNonVirtual { -+@@ -116,6 +132,8 @@ class PipeWireSession : public webrtc::RefCountedNonVirtual { - void StopPipeWire(); - void PipeWireSync(); - -@@ -173,7 +173,7 @@ index b2a2023585..ecf419a026 100644 - static void OnCoreError(void* data, - uint32_t id, - int seq, --@@ -135,7 +153,13 @@ class PipeWireSession : public webrtc::RefCountedNonVirtual { -+@@ -138,7 +156,13 @@ class PipeWireSession : public webrtc::RefCountedNonVirtual { - VideoCaptureOptions::Callback* callback_ RTC_GUARDED_BY(&callback_lock_) = - nullptr; - diff --git a/build-c11-threads-avail.patch b/build-c11-threads-avail.patch deleted file mode 100644 index 73ed5f5..0000000 --- a/build-c11-threads-avail.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff -up firefox-146.0/third_party/rust/glslopt/.cargo-checksum.json.build-c11-threads-avail firefox-146.0/third_party/rust/glslopt/.cargo-checksum.json ---- firefox-146.0/third_party/rust/glslopt/.cargo-checksum.json.build-c11-threads-avail 2025-12-05 18:43:21.000000000 +0100 -+++ firefox-146.0/third_party/rust/glslopt/.cargo-checksum.json 2025-12-11 13:32:52.599001257 +0100 -@@ -1 +1 @@ --{"files":{"Cargo.toml":"010bb96167ff152e0e5ac30f9905dc749a3f038199b70c541c5d8cb97a185ee3","README.md":"4468e08c64c19977707d792bfab0080e35ff927b64990eab77873f8ba056ba1c","build.rs":"6a64610018701781af182c418a4355c9ac5d99d000be9457f0e38a7dadf7542a","glsl-optimizer/CMakeLists.txt":"42ce94744e82ffa000da8b64d81fc140e293b9f5da7dd4cf6b49e7404a2448d9","glsl-optimizer/README.md":"b18eef11a92d267d88a937b1154f7670ee433c730b102fdf7e2da0b02722b146","glsl-optimizer/contrib/glslopt/Main.cpp":"14ba213210c62e234b8d9b0052105fed28eedd83d535ebe85acc10bda7322dd4","glsl-optimizer/contrib/glslopt/Readme":"65d2a6f1aa1dc61e903e090cdade027abad33e02e7c9c81e07dc80508acadec4","glsl-optimizer/generateParsers.sh":"878a97db5d3b69eb3b4c3a95780763b373cfcc0c02e0b28894f162dbbd1b8848","glsl-optimizer/include/GL/gl.h":"1989b51365b6d7d0c48ff6e8b181ef75e2cdf71bfb1626b1cc4362e2f54854a3","glsl-optimizer/include/GL/glext.h":"2ac3681045a35a2194a81a960cad395c04bef1c8a20ef46b799fb24af3ec5f70","glsl-optimizer/include/KHR/khrplatform.h":"1448141a0c054d7f46edfb63f4fe6c203acf9591974049481c32442fb03fd6ed","glsl-optimizer/include/c11/threads.h":"56e9e592b28df19f0db432125223cb3eb5c0c1f960c22db96a15692e14776337","glsl-optimizer/include/c11/threads_posix.h":"f8ad2b69fa472e332b50572c1b2dcc1c8a0fa783a1199aad245398d3df421b4b","glsl-optimizer/include/c11/threads_win32.h":"95bf19d7fc14d328a016889afd583e4c49c050a93bcfb114bd2e9130a4532488","glsl-optimizer/include/c11_compat.h":"103fedb48f658d36cb416c9c9e5ea4d70dff181aab551fcb1028107d098ffa3e","glsl-optimizer/include/c99_compat.h":"aafad02f1ea90a7857636913ea21617a0fcd6197256dcfc6dd97bb3410ba892e","glsl-optimizer/include/no_extern_c.h":"40069dbb6dd2843658d442f926e609c7799b9c296046a90b62b570774fd618f5","glsl-optimizer/license.txt":"e26a745226f4a46b3ca00ffbe8be18507362189a2863d04b4f563ba176a9a836","glsl-optimizer/src/compiler/builtin_type_macros.h":"5b4fc4d4da7b07f997b6eb569e37db79fa0735286575ef1fab08d419e76776ff","glsl-optimizer/src/compiler/glsl/README":"e7d408b621c1b605857c4cab63902f615edb06b530142b91ac040808df6e22f7","glsl-optimizer/src/compiler/glsl/TODO":"dd3b7a098e6f9c85ca8c99ce6dea49d65bb75d4cea243b917f29e4ad2c974603","glsl-optimizer/src/compiler/glsl/ast.h":"3e68ff374350c49211a9931f7f55a485d8d89fc4b21caaffbf6655009ad95bf8","glsl-optimizer/src/compiler/glsl/ast_array_index.cpp":"92b4d501f33e0544c00d14e4f8837753afd916c2b42e076ccc95c9e8fc37ba94","glsl-optimizer/src/compiler/glsl/ast_expr.cpp":"afd712a7b1beb2b633888f4a0911b0a8e4ae5eb5ab9c1e3f247d518cdaaa56d6","glsl-optimizer/src/compiler/glsl/ast_function.cpp":"74f4fbd490e366b37f4715168bb3465ecd9334d4130942f75dcc8e80e8e7f027","glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp":"d0f798eb09271d41d068b9e7b18220d37f1ed0083300ab51eba30989698fe23d","glsl-optimizer/src/compiler/glsl/ast_type.cpp":"8eb790b24b26dfb72bdc333744b566c26d8464c5d47d20eae659461f5c4899f7","glsl-optimizer/src/compiler/glsl/builtin_functions.cpp":"454189d643c220fcb49116ee5c8a34f7b349aa67564040deb8607f6a41a15e70","glsl-optimizer/src/compiler/glsl/builtin_functions.h":"a37cad7ed09b522c5b8bec7b80115a36846e7ba6e0874a2a858e32f7f202c665","glsl-optimizer/src/compiler/glsl/builtin_int64.h":"619def6f3aebf180da3944ef08f159ab12a58b24767e41d8b985ac37ded54d62","glsl-optimizer/src/compiler/glsl/builtin_types.cpp":"afec060b62d6f3b00bfbf94e9fa5f96341ce096c128d1eef322791e6ed9cea4d","glsl-optimizer/src/compiler/glsl/builtin_variables.cpp":"6563bfb1345cbca4c77e00eef09ad152f3e1dc271d246a08c5ce9e1f4ce4250a","glsl-optimizer/src/compiler/glsl/float64.glsl":"1072fd888be48c2a7a5117cd2d92a65f034965a66375f598bb856bff5d7be766","glsl-optimizer/src/compiler/glsl/generate_ir.cpp":"e5f0175370a0d07f93c48d3f0f1b8233d12c64a7b02de02dcc753ef7b398ef0f","glsl-optimizer/src/compiler/glsl/glcpp/README":"a0332a1b221d047e9cce5181a64d4ac4056046fd878360ec8ae3a7b1e062bcff","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.c":"2d179879b1ffe84f58875eee5b0c19b6bae9c973b0c48e6bcd99978f2f501c80","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.l":"e4c5744c837200dafd7c15a912d13f650308ea552454d4fa67271bc0a5bde118","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.c":"03494f9ce1cb82260506e2559e73a3eeb622c4bd51b65eaa0a2c3351862bd4c8","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.h":"264d9a18421cde255ce34a0a62b3d8e73465359f0d167e64aa3973062aae5bdd","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.y":"fafb66e3a8f149d19e085f18a4273ba6d4c11af9e9a01d665cc784dddf97b79f","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.c":"37ed294403c2abfd17fd999d1ae8d11b170e5e9c878979fefac74a31195c96b0","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.h":"85ac8b444bcbd0822b66448a1da407b6ae5467b649f5afaf5c58325bd7569468","glsl-optimizer/src/compiler/glsl/glcpp/pp.c":"a52d94f1bcb3fb2747a95709c4a77c25de7eea8354d2b83bb18efd96976a4473","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.c":"d11aeb3acfe966d1b78f1ee49804093f2434214c41391d139ffcb67b69dc9862","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.h":"abbf1f36ec5a92d035bfbb841b9452287d147616e56373cdbee1c0e55af46406","glsl-optimizer/src/compiler/glsl/glsl_lexer.cpp":"272b9fc1383d72b81bfc03fa11fdf82270ed91a294e523f9ce2b4554bd3effa9","glsl-optimizer/src/compiler/glsl/glsl_lexer.ll":"2b57d9f9eb830c3d7961d4533048a158ee6f458c8d05c65bea7b7cfbc36e4458","glsl-optimizer/src/compiler/glsl/glsl_optimizer.cpp":"f8095d20629d0af70be930b0612e169edb274551a1d25a3cd1bf9995a11ce2e8","glsl-optimizer/src/compiler/glsl/glsl_optimizer.h":"22e843b4ec53ba5f6cd85ca5f7bad33922dca8061b19fb512d46f1caca8d4757","glsl-optimizer/src/compiler/glsl/glsl_parser.cpp":"126baf368d525aba301854e3d91ba60b5aee32e1102376af71416f32cb95ec48","glsl-optimizer/src/compiler/glsl/glsl_parser.h":"2ea9a50716098a8f7bef782d2a030d757b68da73afb01b4d4940d3e8381d44e8","glsl-optimizer/src/compiler/glsl/glsl_parser.yy":"6b1fd1576b29fce005dff744a6dbd0219e4c695c361d61864e1f3a8d6fa6b764","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.cpp":"aad64b5b66467da650091430681e8c6a820cf3cadc4db3c160bf2f15875390ae","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.h":"71fd0e92bbdb193dfb067d7bfdb1200d77392be2fbd0cbfc9ca89d1bb4c7e741","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.cpp":"6660fb83c0ddddbbd64581d46ccfdb9c84bfaa99d13348c289e6442ab00df046","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.h":"24682b8304e0ea3f6318ddb8c859686bd1faee23cd0511d1760977ae975d41bf","glsl-optimizer/src/compiler/glsl/hir_field_selection.cpp":"72a039b0fcab4161788def9e4bedac7ac06a20d8e13146529c6d246bd5202afd","glsl-optimizer/src/compiler/glsl/int64.glsl":"303dbe95dde44b91aee3e38b115b92028400d6a92f9268975d607471984e13eb","glsl-optimizer/src/compiler/glsl/ir.cpp":"2b4741cce90b5d4abff5d719c7324e2693c67294d4d99736cb241554adb281bc","glsl-optimizer/src/compiler/glsl/ir.h":"990b1c74447c4eb4835353ccb0ed9aea644f97fc1129ef1739cd935075d85d2e","glsl-optimizer/src/compiler/glsl/ir_array_refcount.cpp":"8cdc1cffe01e42e0566fa2193a75f789628e8025ad1b82f0ee6f204451b7f9f7","glsl-optimizer/src/compiler/glsl/ir_array_refcount.h":"75f06ec81342b379096ca52e1dc0fd5f19a11ff8e9b58203c20628179d644c12","glsl-optimizer/src/compiler/glsl/ir_basic_block.cpp":"1e2920b1c0ecb08424c745c558f84d0d7e44b74585cf2cc2265dc4dfede3fa2f","glsl-optimizer/src/compiler/glsl/ir_basic_block.h":"81be7da0fc0ee547cd13ec60c1fcd7d3ce3d70d7e5e988f01a3b43a827acdf05","glsl-optimizer/src/compiler/glsl/ir_builder.cpp":"daba29c5a1efdd5a9754f420eb3e2ebdf73485273497f40d4863dadeddb23c0d","glsl-optimizer/src/compiler/glsl/ir_builder.h":"2822e74dd3f6e3df8b300af27d5b11ea2dd99d0e5e7ca809b7bbcce9833c483c","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.cpp":"8c6df5abf2fe313363f285f171c19ca6c8ee4f3bc2ed79d33c0c88cc8be45c48","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.h":"799852adc3a0e54d04080655e7cebfa0d3bf5b6ffed5d8414f141380665d4db7","glsl-optimizer/src/compiler/glsl/ir_clone.cpp":"d897a4e1f5bbec4a6a2f15044c1be9a4d13899c73be77335b041049a4589aa5d","glsl-optimizer/src/compiler/glsl/ir_constant_expression.cpp":"78bd87ddb09db67f6c499067728d72aef4f16aa02721a99a4b769d1e0cfa9010","glsl-optimizer/src/compiler/glsl/ir_equals.cpp":"bca28533a6310b0fc152b56d80872368f1510dc62ed6e8ac199b9ffa7fac02e7","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.cpp":"7e918d4e1f237eca01396004015865ce345afe32a876c9dbc6728576a1a7eae4","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.h":"f45b66aa9497520e7e08e612d24b308477c34477fbd963ee9320eac664957f16","glsl-optimizer/src/compiler/glsl/ir_expression_operation.h":"cc9f10727dbd26cac506804f51456302c702650f9eeb59054a7e1575d5cf6687","glsl-optimizer/src/compiler/glsl/ir_expression_operation.py":"7b86c96021b9fbe165957f4ecb0b612fefcde1c2cf3c6d75e3cdb22e369216ba","glsl-optimizer/src/compiler/glsl/ir_expression_operation_constant.h":"9ad3346416392e3efa11e12ecf2feca7453c5253d241eb96c91dfb85d4f2b971","glsl-optimizer/src/compiler/glsl/ir_expression_operation_strings.h":"a6826daf496a8b9e89885bc2a161ac3445d501b23c6e0ac33e2c01b506b273c8","glsl-optimizer/src/compiler/glsl/ir_function.cpp":"7537365fc0fbe4b37a26b9a2146cc64d3e9a774d60eab63b65002ad165ae8fc7","glsl-optimizer/src/compiler/glsl/ir_function_can_inline.cpp":"faddbf112187a048d502716a3fb82570a322299ba2a3abd79388382c82040bfc","glsl-optimizer/src/compiler/glsl/ir_function_detect_recursion.cpp":"9176973eaf5c0a984701f953bb7a80f37dca43d59b5bce50fc69b3f02f2902d7","glsl-optimizer/src/compiler/glsl/ir_function_inlining.h":"9739493f99c489987d650762fccdd3fb3d432f6481d67f6c799176685bd59632","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.cpp":"3725861fbe2b98e0617f52d3b14cf6d3b25fb5ec00f5ef5d308b03642f592767","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.h":"e0560210e966c0c31e4ca843e80ea154e64db5a444b8c2df845b6ba5b3a43fc1","glsl-optimizer/src/compiler/glsl/ir_hv_accept.cpp":"caf7ce2cd9494aadd3c58bcf77f29de58368dc9e347a362bbf37f8bda9509b80","glsl-optimizer/src/compiler/glsl/ir_optimization.h":"8b3dcfc7f9e96b21a8dd47a0040d90be483a9e67a2cdce3a697188fb758d4630","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.cpp":"f8e34a983452be0dcb5a695e9c8e895eead24f9e540992a8afe510ae85da4c4c","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.h":"1ad1bd3efd1ace39051c13f904c05fd80425d329444f9a8d47fd6d948faf46e0","glsl-optimizer/src/compiler/glsl/ir_print_visitor.cpp":"643f5a68aae3fb37267fd793f1216d1cfdeb2c09338c26b1f30e4c6deaef4de5","glsl-optimizer/src/compiler/glsl/ir_print_visitor.h":"4573eb93268a2654c14b505253dd651e2695d43dc745904d824da18305269b95","glsl-optimizer/src/compiler/glsl/ir_reader.cpp":"06bfba802c8354e5a8b2334b6d78d6297de18235bedd3f8fbb382c89870b02f2","glsl-optimizer/src/compiler/glsl/ir_reader.h":"63e3f7f1597936a7011d5b520e171b197bf82bee6c1560d822c3edf5aaa6f9e9","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.cpp":"84b5c5d746555adca85759c2912fe48010232b7c1c0bd2cf03bd04067a85e66f","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.h":"fd8c561b71085d3211fff85ed514fecb299d8ce19a04bc063419a55b6d840525","glsl-optimizer/src/compiler/glsl/ir_set_program_inouts.cpp":"ab9f115ce9e7f312d9c7978340ced0dc4ae6d13a80e08442ba9709d11d50cae5","glsl-optimizer/src/compiler/glsl/ir_uniform.h":"683ae6896b1a08470c090be5f822fc31cd434eab9216e954b9bba24a46975109","glsl-optimizer/src/compiler/glsl/ir_unused_structs.cpp":"9c1620c45f2fc071fe5ed828472040b14c5f42effe06aa0e3b8352c95ef78786","glsl-optimizer/src/compiler/glsl/ir_unused_structs.h":"13387b49c23093575276b25b9dfd31fedd8f131c5c4f3128ab04cf03e15b5295","glsl-optimizer/src/compiler/glsl/ir_validate.cpp":"6b232be5999a86ea278f4f15b2832d76843246509118d924243055a3b9b0299f","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.cpp":"2764a3cad937d53f36db7447c3a5b98b04bf153acf81074d971857fc5bca460d","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.h":"b0668e3eb1501ef65e38fe12830742ecb3d28e6039f30e366c8924efc29b4a39","glsl-optimizer/src/compiler/glsl/ir_visitor.h":"f21b3534c3d66d5fb707d1581fece7e1eb043523afbaedf89918cfb031c6df94","glsl-optimizer/src/compiler/glsl/link_atomics.cpp":"360f0209e11f367ba358223597b0a118bae095bff16337cf03f1fb89c5b80ca6","glsl-optimizer/src/compiler/glsl/link_functions.cpp":"de7895da8aa33a1e3c2c1eb2fdaf267ab5d1fbfdb79ae2e67f95211e946e294c","glsl-optimizer/src/compiler/glsl/link_interface_blocks.cpp":"1926cfa73810704eb19b916c1b2cdb9321155e2f98b2a0a57c7c3c6e960540cd","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.cpp":"1e14e06ca3b2c1089cfba2e8eaf0c1f373d9d6374b6082f320962dd71ae09611","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.h":"fd58c155af645295bb6aec08797889de586f4d919731de2bce57e8dce59bb048","glsl-optimizer/src/compiler/glsl/link_uniform_blocks.cpp":"09589f49776dce32e6c4044937de7e0c839a9754ad31960148f8f9e010658997","glsl-optimizer/src/compiler/glsl/link_uniform_initializers.cpp":"bf98e08c12db466acf9623cbeb8fa8e3b4002512722e7a6521287f558a099f37","glsl-optimizer/src/compiler/glsl/link_uniforms.cpp":"84bad5b1377362cecf259b05124239be5220b03ce1c0c61b59bd9a47e4379af2","glsl-optimizer/src/compiler/glsl/link_varyings.cpp":"a5f1a53e7c80d635515fe808ff223d89fef1767abb0f2b7aa28fa6773dca353f","glsl-optimizer/src/compiler/glsl/link_varyings.h":"b9dbe018f038df69763df2e928742ce81bbc6e3aaba26f50621e30a6d9aa6220","glsl-optimizer/src/compiler/glsl/linker.cpp":"40b1ecd5d4f6c7f13d5a87ce390561a51fdf6f3fcd9b2197b9c88b03a773ba94","glsl-optimizer/src/compiler/glsl/linker.h":"ecf94b4ad75ef461c27c557fda4bd25f34c91930822b8e1d729ec84520d4a049","glsl-optimizer/src/compiler/glsl/linker_util.cpp":"1663ad88e2a369305659aeeffaedb5bd752cf76340a2ba5797fc0bf600633cf9","glsl-optimizer/src/compiler/glsl/linker_util.h":"6db788daf9c8e87ae2764b61a8b37ebe419e69c1b82ddee01986e37c978c6993","glsl-optimizer/src/compiler/glsl/list.h":"b1f46ce0e552fe7c45b2a19408a9d97662e23e4b182ab335491c26f8cf25886f","glsl-optimizer/src/compiler/glsl/loop_analysis.cpp":"57ecd573477c68091c7cc99537faa7139a8f395935e3d4f10144cefdefb5a611","glsl-optimizer/src/compiler/glsl/loop_analysis.h":"a85f045a038ee5b5176063e85d7988865862c44ab0580f771b993a042d0b69cc","glsl-optimizer/src/compiler/glsl/loop_unroll.cpp":"bd4292ea2809f5a669bcb76ceaa1ac365772dcd638c579c3ed10275214901a54","glsl-optimizer/src/compiler/glsl/lower_blend_equation_advanced.cpp":"8cfbef140d9c4b4d2f57bfa05c9c374d31a121d0f87afce94333f049023b654a","glsl-optimizer/src/compiler/glsl/lower_buffer_access.cpp":"1ae221c3c7a95aeb867207e7a742be635f91b406c157747bfd6ddf10274d97fb","glsl-optimizer/src/compiler/glsl/lower_buffer_access.h":"807886953a576a323591798cbca5e2df24295ea893b28affd8ffb5926cebaa04","glsl-optimizer/src/compiler/glsl/lower_builtins.cpp":"4d81afc32cf58e1481fcb5e42888ab93dbe6820310a20ff7a9982b77b2152d9b","glsl-optimizer/src/compiler/glsl/lower_const_arrays_to_uniforms.cpp":"608403f0eeeedf21cfcd3014116e0f44e28cbdf6c4c32aac7e613e64e30205e1","glsl-optimizer/src/compiler/glsl/lower_cs_derived.cpp":"179905cd47a294122adeb5b0abfed6f2f67782dcde21b544d1ee2c1985154e66","glsl-optimizer/src/compiler/glsl/lower_discard.cpp":"3b361b2db0004d544d64611cb50d5a6e364cf6c5f2e60c449085d7d753dd7fb0","glsl-optimizer/src/compiler/glsl/lower_discard_flow.cpp":"f5c29b6a27690bb5c91f196d1a1cf9f6be4f1025292311fe2dac561ce6774dee","glsl-optimizer/src/compiler/glsl/lower_distance.cpp":"a118c85493d5d22b2c059a930c51a5854896d4b1dade76598eaa985e5a3dff8c","glsl-optimizer/src/compiler/glsl/lower_if_to_cond_assign.cpp":"469e617757fd1728709cce021aac5c8da05ee503bf5366977bdc4ef7a6d83950","glsl-optimizer/src/compiler/glsl/lower_instructions.cpp":"6ff5c396abe40d8a2145d571e99e2bbe9143393e15aafc28adc2803a01d821b6","glsl-optimizer/src/compiler/glsl/lower_int64.cpp":"d1ed41196880dd53c7b13e2782f9423f8442bf1d46186e8be92b1b66218a83ee","glsl-optimizer/src/compiler/glsl/lower_jumps.cpp":"34de7b493f281589fb0c2c0f6e885d0a0fabbe7a4e97a73de374dd714777a58c","glsl-optimizer/src/compiler/glsl/lower_mat_op_to_vec.cpp":"dff7a308edc4846c348ed4225c6699a9c75abac68d88f41f85954276552779f4","glsl-optimizer/src/compiler/glsl/lower_named_interface_blocks.cpp":"16063ac127bff75a68272070ab11c21c25101edbff62b4c68f4983b4cd941af0","glsl-optimizer/src/compiler/glsl/lower_offset_array.cpp":"3b00773399135aea85746a5a68b96ef000bc6841be1a2c8e6f25c516628b0949","glsl-optimizer/src/compiler/glsl/lower_output_reads.cpp":"a0fc9975d5aa1617e21fc6c353659a9802da9e83779a3eef4ec584f74b4dadc5","glsl-optimizer/src/compiler/glsl/lower_packed_varyings.cpp":"7550099d4ae123d71541c2fc88bc04fbfe9271ec75d7e210987d1c8cac3cf3ea","glsl-optimizer/src/compiler/glsl/lower_packing_builtins.cpp":"79a13d161fe505a410ab948d92769395708693ec888153630fa240e5b97e356f","glsl-optimizer/src/compiler/glsl/lower_precision.cpp":"f82a185b879872b977a1787d8061b9a80bc4cf8db1b970db6efba2ad9cc20fa2","glsl-optimizer/src/compiler/glsl/lower_shared_reference.cpp":"ea2dccf50a83bc19391bf6b7ab6aa53c0005f427af4066d25140340af9a4beef","glsl-optimizer/src/compiler/glsl/lower_subroutine.cpp":"f69fa53650eeb6f2944fce4d36a6e0a423e6705f3a3bd3389c7fadb83cfc8802","glsl-optimizer/src/compiler/glsl/lower_tess_level.cpp":"b196c9d424c0569f3e85d75c2d125af21566cb113d69036db87c0990703e0fa7","glsl-optimizer/src/compiler/glsl/lower_texture_projection.cpp":"4d247f244272adc8250fd888d8d932a140dd5de4d1efc7a58492c3c2b8291527","glsl-optimizer/src/compiler/glsl/lower_ubo_reference.cpp":"89bdbc6c1669230c644c0857db1ce2781ec61d349ecd08c7914146e1f4750a4a","glsl-optimizer/src/compiler/glsl/lower_variable_index_to_cond_assign.cpp":"fce930f29ac9405b297d1f749d68f59506b89c70b4ee1b1ab8cf49a34cc71ecf","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_cond_assign.cpp":"3c67d851a11a55fad1c49a550f3a0cfe50892d33a3f238ce266cd829eba510a8","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_swizzle.cpp":"f5ec666b73e1415cbab32519a53605ed385f3b03e889560373dbce69dda5000e","glsl-optimizer/src/compiler/glsl/lower_vector.cpp":"f7c13f5572ebe09b6a71553133b2cf003cd4b77b9657600672ee3b21bf890725","glsl-optimizer/src/compiler/glsl/lower_vector_derefs.cpp":"b05793da6dd620a531b43df5af8b2ecbc37b9db0c88910f5724ea10bcd057e19","glsl-optimizer/src/compiler/glsl/lower_vector_insert.cpp":"fee772ec17eea5e86a529bf9c5fa2ee0d29a5982bb75ebc6d68ed36cd19aa299","glsl-optimizer/src/compiler/glsl/lower_vertex_id.cpp":"690e8715182e03fead5cc5a35251fb4f41b357e4c71a1dfbc4bd7be19862b56d","glsl-optimizer/src/compiler/glsl/lower_xfb_varying.cpp":"58c0e8b270e4bbde54250be03cdb2f36966bcafb785372ad2e2b786835df7f9f","glsl-optimizer/src/compiler/glsl/main.cpp":"ae5e88abbbc8a12f769e1296bad938b9d7398cc6da0d3d0caeceeeb876536850","glsl-optimizer/src/compiler/glsl/opt_add_neg_to_sub.h":"f5054944bfd068810629080d0ea11df78b3f57a8f86df75e13ca50157ad1964d","glsl-optimizer/src/compiler/glsl/opt_algebraic.cpp":"25f45b20e1972ee8c789177a1aeda6e4286c25db2eae3a43ff83029ae64969c0","glsl-optimizer/src/compiler/glsl/opt_array_splitting.cpp":"19d3ce0e815438f4df9ab2890e767b03a4f3f191b53bb30c0217cf2ae6a95430","glsl-optimizer/src/compiler/glsl/opt_conditional_discard.cpp":"0e44e0e126711a3725c1f3a2aa65ff03c381fed08680ffc30101aae60f716c4e","glsl-optimizer/src/compiler/glsl/opt_constant_folding.cpp":"a088d04d9b45f9e55e235835648f614c89b7803c03a6d4f6a6d1a6bc1f0228bd","glsl-optimizer/src/compiler/glsl/opt_constant_propagation.cpp":"8a9440d77ecd6dcf13e683cbb99943aab6311c8fd4b5f6a9189a8d4f270746f4","glsl-optimizer/src/compiler/glsl/opt_constant_variable.cpp":"63d3ccd4dd09f19c9cf1a2f51592111bed41284504f29f3c0de4cadebc439a37","glsl-optimizer/src/compiler/glsl/opt_copy_propagation_elements.cpp":"ffa0f50863995e0d2e31f55a52e82319edc71e520987bebd7f7e561ea331c64b","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_variables.cpp":"84e8747b948232f01dd56b428b9315f96f9511f605f240119fc446fae28981a9","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_varyings.cpp":"761523e88f5b3ba785170f4d7205e94fa99acb7e74d29efbe40e1c010e1dbdb3","glsl-optimizer/src/compiler/glsl/opt_dead_code.cpp":"fd1ba2da7337d4e5dad17f5c2d73d9cc8880305f423e85d64cf94553588fa401","glsl-optimizer/src/compiler/glsl/opt_dead_code_local.cpp":"969a598b4df322baf222258a66cd64a326ea20e5b3125be9d8d1771f522c69e0","glsl-optimizer/src/compiler/glsl/opt_dead_functions.cpp":"774cae6536d02edf26e996a2a895e1f62d5098f16dc96b44798b4fc731a9a95f","glsl-optimizer/src/compiler/glsl/opt_flatten_nested_if_blocks.cpp":"3696a5c55f02e20056e085bc2714f73ac992f221b6f3387d655068e86b512046","glsl-optimizer/src/compiler/glsl/opt_flip_matrices.cpp":"44f0fe05b49329667671f88c96dc86ab3fe1459ff7b87f2b2d88de2d49829f9f","glsl-optimizer/src/compiler/glsl/opt_function_inlining.cpp":"fb56a33c90419a01676b57cbd91d0674a54cca40e6defaacc88dd33facebc131","glsl-optimizer/src/compiler/glsl/opt_if_simplification.cpp":"ac406eb35e379c357641d6c5749f50c65961455924d3dc884e2b90046fa92c5c","glsl-optimizer/src/compiler/glsl/opt_minmax.cpp":"8abd59d3b14ef60ff14a9c69660e6945f5cf10b97edb4afebe56be3f81d96316","glsl-optimizer/src/compiler/glsl/opt_rebalance_tree.cpp":"8bb6329dc0f299042368fc81934c2df019b45ab9f7aa0415d4e57b8d1ff98c9f","glsl-optimizer/src/compiler/glsl/opt_redundant_jumps.cpp":"222c73e2ac7a938ebb6428cc6c780c908ff6156d8ff935b04fed93a48fc10496","glsl-optimizer/src/compiler/glsl/opt_structure_splitting.cpp":"2edc79cc13f3177934e0443ad62f5976a1991f01f86ea303a803434849b13a47","glsl-optimizer/src/compiler/glsl/opt_swizzle.cpp":"015d0abddfe507f67c4b96c82988d861d018ededf7bf055e2bcbe9ea92da694e","glsl-optimizer/src/compiler/glsl/opt_tree_grafting.cpp":"46d28ac983ea244a4315bdc0e8892979ec4d1f9b9a96ac8a8a08006d9bc5e878","glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp":"d80ee43bb97d9f016fb9c5e1e06f5b2afa569811f368ba067be794ec11d085fb","glsl-optimizer/src/compiler/glsl/program.h":"2982447e2abd35371e273ad87951722782a8b21c08294f67c39d987da1e1c55f","glsl-optimizer/src/compiler/glsl/propagate_invariance.cpp":"080943e21baa32494723a2eefb185915d2daae1f46d6df420145c5ad6857e119","glsl-optimizer/src/compiler/glsl/s_expression.cpp":"1ced972bc6ecc8eab4116ea71fb0212ab9ae5bcc0be3b47aa5d9d903566b3af1","glsl-optimizer/src/compiler/glsl/s_expression.h":"65b847e30e22a809b57d0bc70243049c99d9c6318803c5b8d0826aba55dc217e","glsl-optimizer/src/compiler/glsl/serialize.cpp":"be0eb4251348a9d921acb839a5c48c6023a2e9d116d602bb0432787ab623655d","glsl-optimizer/src/compiler/glsl/serialize.h":"57425732eba1233d928e5f07f88b623ce65af46b3bb034bf147f0a4b7f94f9a1","glsl-optimizer/src/compiler/glsl/shader_cache.cpp":"e0c5c433f2df3fccdf1d61281bfcb0ee5633433339b97c697d64db99611cbaaf","glsl-optimizer/src/compiler/glsl/shader_cache.h":"9217164d8d7f54aca0fe5922c7187095a6ae0cb703b196b79805aeef07a7e697","glsl-optimizer/src/compiler/glsl/standalone.cpp":"8e6c416a14d631261917a5fe4cc91880c287b22b2dfd70eb22028289a8fa5364","glsl-optimizer/src/compiler/glsl/standalone.h":"a7c397d1dfdd1e7fb2cfe99db35cd9df93251e642059208533202b7f20497f83","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.cpp":"970d14b7a9d58e5270321f97bf5d57795558b1c570a56678e04a65b26c60bf4f","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.h":"d921a617ea82b9e49413314492a645c44356de503581b1be3f1b57de236e480d","glsl-optimizer/src/compiler/glsl/string_to_uint_map.cpp":"d824bf5b839bd39498dc9e457103cdbe3e5289ddf7564107c27b1505948dd31f","glsl-optimizer/src/compiler/glsl/string_to_uint_map.h":"e2f18e66359c9d620e085de7f4a334a47df9c66e65a5bfe8b734c627bec04104","glsl-optimizer/src/compiler/glsl/test_optpass.h":"b27b8f35f5387e7ce4982bb51c7b63ccf14f91757f3108a5d02ed006925bb8a0","glsl-optimizer/src/compiler/glsl/xxd.py":"376484142f27f45090ea8203ae2621abf73f06175cb0ee8d96f44a3b9327f4bd","glsl-optimizer/src/compiler/glsl_types.cpp":"044bb6754f45419a3151e7a25c39202a82009ae3c6bc54ff7f0bb4258a5deefe","glsl-optimizer/src/compiler/glsl_types.h":"fd899a42f34ddeb8601bc3cd6c5e3aed82fc8aef4042dde1b39b3c01e1dcc219","glsl-optimizer/src/compiler/shader_enums.c":"436bff5216b11b0980bdfada5885fc6ac9afa2037a3027fcd6eea2a8635597ac","glsl-optimizer/src/compiler/shader_enums.h":"13220442a5c02e83540cf2c0ad4f8417b2fbda5f2586dec4e92082544c937cdd","glsl-optimizer/src/compiler/shader_info.h":"4c5453e81197ca83593ee4f365074b23530f2ab21c78e1733b63dec6f344c12a","glsl-optimizer/src/gallium/auxiliary/util/u_half.h":"3c2b37bda3ccb64387e44b723d29cf9046decab1a893bf42d842e9603398bdee","glsl-optimizer/src/gallium/include/pipe/p_compiler.h":"c75620096ce8523dae90599e50aa2ef6468d3b0e368a77795edeb20dd1abfc0c","glsl-optimizer/src/gallium/include/pipe/p_config.h":"a27692fc35f9e55df3224b7529e66b3001e911e94e6bc5f8f569e493e1ee3fb7","glsl-optimizer/src/gallium/include/pipe/p_defines.h":"be26d68c0acc67c5e44788c6299716a9eee415fd81d7d747e3738a829e3b6b38","glsl-optimizer/src/gallium/include/pipe/p_format.h":"5674215fc41d27496f037cf837717daefbf23ebb38d40ace7c0c414bc08182b0","glsl-optimizer/src/gallium/include/pipe/p_state.h":"d600593aba5f5a17072a6c38f6baa81e01c7994b0174250f7e433bb41684b702","glsl-optimizer/src/mapi/glapi/glapi.h":"73632a625c0ddabc401205e8b5a81eb8af8506868efe4b170d7979ec3619e9c5","glsl-optimizer/src/mesa/main/config.h":"5800259373099e5405de2eb52619f9de242552a479902a3a642a333c8cb3c1e7","glsl-optimizer/src/mesa/main/context.c":"2f3208473d99c94f734b1137ba91889d4a1babb9e7534bf1dc85d851ee98274e","glsl-optimizer/src/mesa/main/context.h":"cc7e4194797db9d007f01884e23d786c453b3860821f7f2ddcdf0f1bf3f8ffb1","glsl-optimizer/src/mesa/main/dd.h":"6a964acd06b6c2d88700e69fb75fe3c6b3b3d45bbc41db24f3f897a29695fe0c","glsl-optimizer/src/mesa/main/debug_output.h":"7312422e90b8c0e34028ac27280e438139b5cba525c99deb3ac883cd3d87e452","glsl-optimizer/src/mesa/main/draw.h":"7eaef3a9e27a60ea6f7937109bf3a6190b831162fde0479abb12077ce27c353d","glsl-optimizer/src/mesa/main/enums.h":"87d562a6764f51c014a2274fa7c3aca17c04441537ddd56b2554f13c6fffea92","glsl-optimizer/src/mesa/main/errors.h":"c79444b5df289c90fbb22a33b2d0c23917d9fc4510960088f0b79e53bb56b1b2","glsl-optimizer/src/mesa/main/extensions.h":"a38b2f87cc93c513994281350d69e06c84ff8eded5313ec0a1be33f375e0ebbd","glsl-optimizer/src/mesa/main/extensions_table.c":"17642d1a8c9a0bf2bd61060052d33ff14a005d2b962e6cf91465797a50851e85","glsl-optimizer/src/mesa/main/extensions_table.h":"2c879571c238d2e14461031ac740372fd0f9ac3a34c0d5541bb9b7ed4c0376c8","glsl-optimizer/src/mesa/main/formats.h":"02e2f7ec3e39286cf9f27e2641043e6df8ecb1dfde9e643313210e214af2a929","glsl-optimizer/src/mesa/main/glheader.h":"58217b33eead6aa6b23cd4a291cefeaa6cb84e465f4960daffca97c44d6d1c35","glsl-optimizer/src/mesa/main/glthread.h":"51fb2711f77e7eafcfc52d29d5b844978832b24c930d88accd48d143a6eb9c6f","glsl-optimizer/src/mesa/main/hash.h":"7e7f782034c16a8e693de48e00c31d4a90b0129f4029fd074033d7d16ccbe718","glsl-optimizer/src/mesa/main/macros.h":"73d15ddfd64f2b57b9b2ffeeb993b9c2c0899a80563e9d6ff337b11ccbe6eee5","glsl-optimizer/src/mesa/main/menums.h":"5dfac0e2279d60b0cd0c7b9fc2a5021620d0f6282ed2e738c420214e3af152d3","glsl-optimizer/src/mesa/main/mesa_private.h":"edda678b93438944279a551f663b8858ad84814a9fc88ba9672ef195599c24ae","glsl-optimizer/src/mesa/main/mtypes.h":"6efddefa099e4d2e3fdd97f0055644f47aba21711385edfeabc2d9b0676f2eec","glsl-optimizer/src/mesa/main/shaderobj.h":"9f0dfe96d0c2154201adef942bd36053533ac7b2492fb3786acda5bea514c75e","glsl-optimizer/src/mesa/main/uniforms.h":"4e331e6ad6e9cbded978b4082dbe0a57c1f8f01327446bb6892bfc179976c38b","glsl-optimizer/src/mesa/main/version.h":"9d0a13a758099302dc55cf7d045791834a89b0f9d4cf17b2692259b369a8a9a1","glsl-optimizer/src/mesa/math/m_matrix.h":"a37b19f182e070db3df93b0ede43c22fb8be8c2906504133ee6dbd7db1185d8b","glsl-optimizer/src/mesa/program/dummy_errors.c":"1820e305515b4c5e041f5e1623266a48ec8f076a155310be7d60637101f593e4","glsl-optimizer/src/mesa/program/ir_to_mesa.h":"b47f58d22e3ca2ae42d52501ea769d15c4476834944fa97eeccd3a3439211d00","glsl-optimizer/src/mesa/program/prog_instruction.h":"ab3832152a7e144b59e5a2264b2c29db56d93be31e76bbd958527a56771b40eb","glsl-optimizer/src/mesa/program/prog_parameter.h":"ba18c743284eadbc837c2c364c73e5d372321a7637a76e589d8d39fe8b5de225","glsl-optimizer/src/mesa/program/prog_statevars.h":"fc413698f84bc52d45fdeae0471934ee9904bfb7eac1a2b5f70446e54bcbbdca","glsl-optimizer/src/mesa/program/program.h":"1f01026a4eff440a3f122fd9b519d03546fe7f7d8be60dca834e95a2f8fbbfd2","glsl-optimizer/src/mesa/program/symbol_table.c":"6611cb9f078035bf5ff8c9112093a6c7d99f8af99a3931d0c07f227cc72283ea","glsl-optimizer/src/mesa/program/symbol_table.h":"631dc35ac48d5e87962d45507461920f6575610960ffcc42a08cefeb43300cda","glsl-optimizer/src/mesa/vbo/vbo.h":"6eb1dcd9a08c92f276c5fe08da184ff9d455d1be421913b8ad732a7b65e858fb","glsl-optimizer/src/util/bitscan.h":"9e49e694e6b34fe035bc685f32588827eb8cbe7d82878963c7ab52843e1c16aa","glsl-optimizer/src/util/bitset.h":"c40f78515c6230fed18345c6751ce33833a49da7a27901c7e6d7340cbdcbc5e7","glsl-optimizer/src/util/blob.c":"8f729846f66efc9c15485cc5fc24c6ec861fc1fecb2f652573f2a237d481b791","glsl-optimizer/src/util/blob.h":"93e1eaac866b9a7cd6fc03b533c18fb2edf0e97f03395eff4f3a605c4fc14d0c","glsl-optimizer/src/util/compiler.h":"79e3bf40a5bab704e6c949f23a1352759607bb57d80e5d8df2ef159755f10b68","glsl-optimizer/src/util/crc32.c":"2f3467a046b3a76784ecb9aa55d527698c8607fd0b12c622f6691aaa77b58505","glsl-optimizer/src/util/crc32.h":"59bd81865e51042b73a86f8fb117c312418df095fed2d828c5c1d1c8b6fc6cd4","glsl-optimizer/src/util/debug.c":"c3d68e9752ccc19e66c669562cd113cf1d0ac83cbb30174789e7fb8d1df58f9c","glsl-optimizer/src/util/debug.h":"50068d745c4199ccbd33d68dd4c8a36d2b5179c7869a21e75906ddd0718ca456","glsl-optimizer/src/util/detect_os.h":"343a8790d17a3710c6dd015ee367f84e3902ff3f2e36faca2bf93f9d725d3574","glsl-optimizer/src/util/disk_cache.c":"f533937e5a4fffe76e2739ef4b6b1e1da097d96d63eb808e68ebbc7027641c23","glsl-optimizer/src/util/disk_cache.h":"e83314fb14134a8e079b15e470a6376ba5a8253701f048c890a62b7e55d64bc8","glsl-optimizer/src/util/fast_urem_by_const.h":"e108fce804616c47d071dfe4a04163eec1126e448ed1aa89abb6b3a6d772bd5b","glsl-optimizer/src/util/fnv1a.h":"ab2596f19c6adf431ae27618f62c5743e24ad23ef83bb359a4c4c218245ab459","glsl-optimizer/src/util/format/u_format.h":"4cdfc0c59cbc99a092e5ec5a396910f2d93b9643e5d8141050b011e66f11e45b","glsl-optimizer/src/util/futex.h":"26f7c9d86e9ffef4c0fa2761f1aaa1918337302e20bd6ca10e61dc3c47356deb","glsl-optimizer/src/util/half_float.c":"11bc2584493d5d9d46e8c8a619a0307cf150bf5ab5d0f96bb764b061dc37a00e","glsl-optimizer/src/util/half_float.h":"7f7c380f126da1400a91758cc0392f24bf967bce1672890b62be26fe9fbd922b","glsl-optimizer/src/util/hash_table.c":"0ca40352e35dedab0a84c64c903f1b16d47e950bb5f43b4d22bb57d499bfea6e","glsl-optimizer/src/util/hash_table.h":"217191bb360592e2232f187473c10287d2cda8ae6fa5c53d0ef74c8c206118b4","glsl-optimizer/src/util/list.h":"9fab03c6a78186bb5f173269f825f6ce976b409d931852e3d93bac632e07989a","glsl-optimizer/src/util/macros.h":"63faf65b51058c483b17f1f77da51d1c53c8beab52678cb6bd01f1228a63b6b0","glsl-optimizer/src/util/mesa-sha1.c":"00c692ec353ebc02c06c57c5a71de0ab7a119f86a4146f452e65ec87e4944417","glsl-optimizer/src/util/mesa-sha1.h":"bff4c29f4bf7cdbcefb30fa0c996a7604a380eba8976467c2a60e7cd328f7e26","glsl-optimizer/src/util/mesa-sha1_test.c":"25da89a59d51469f77b4c468ca23ffdce0a7a1166a70b6cc23026a6800b0143c","glsl-optimizer/src/util/os_memory.h":"64555faf1760ae6954f42c83727c38dfc4c278e9152115779ffaad58b42adacf","glsl-optimizer/src/util/os_memory_aligned.h":"12d86fa94be38c13f7eeebdf313795e1267dd5a7187d2f0072e0e896f41702f6","glsl-optimizer/src/util/os_memory_stdc.h":"07360363b88c927065e10df71bebf6c8a0cc3b9167c9dfce55f2d65f11e6f787","glsl-optimizer/src/util/os_misc.c":"a9936e613ec84803abd59ad47c192c8e3939993c950ac91973fdc4cec1801bb8","glsl-optimizer/src/util/os_misc.h":"cc68eb12e05b5e749c54298cb4a6f4cd20cc5af7db3403e70b3c27b56090c740","glsl-optimizer/src/util/os_time.h":"73e775f7335244ff5964c678c27eedf1aea6abea44c4169d327ea8c7ce4a3a88","glsl-optimizer/src/util/ralloc.c":"4b51189595ef67bcef52c40cbf654d969041dbd15e15d4a893ad494ac060aeca","glsl-optimizer/src/util/ralloc.h":"e573c45875ff1530f0dbee9a93ae55535fdac8d5cc88a79ebc327c688824bde5","glsl-optimizer/src/util/rounding.h":"0450722353caf83de07e67f335949dbe95fe53b534052d4ee9d28d2781387614","glsl-optimizer/src/util/set.c":"86f8c9a830bead5a5a79bc970b0ff97809312af07b3beb39ef9d90af04d40a1b","glsl-optimizer/src/util/set.h":"3e39ca161e7ed4ec7c436cc9c7919ed9a55ed1b71edbf2caf6f9bcfd9bc578ed","glsl-optimizer/src/util/sha1/README":"00af7419af05247081858acb2902efd99fcda2ce16e331079f701645bb3729c0","glsl-optimizer/src/util/sha1/sha1.c":"1403bbe0aad42ba3e6be7e09f7cad87a6a8c4ad5b63962f7b92b9f37d8133b04","glsl-optimizer/src/util/sha1/sha1.h":"68d9f240eab2918026ecdf22be36811abbd4f1389f6c36e31258041aeaedd247","glsl-optimizer/src/util/simple_mtx.h":"12c6c3c4b7db9168bc656d5b3c65912075084d2b388c415d5c3d3f5953a9d6c7","glsl-optimizer/src/util/softfloat.c":"a97e51a96fe5e6a052c02aa6bbec683fe73fb88a8c087d9c930503e2120d8a2e","glsl-optimizer/src/util/softfloat.h":"66664b0250e83bf5dd4cc743acd119d076efcea624a0eab3d6b60718e6ee8811","glsl-optimizer/src/util/string_buffer.c":"63a1d1b1e34926c88ea00159cafbcd56568b805c4f64d1e8c97169fe313921fc","glsl-optimizer/src/util/string_buffer.h":"7b88d1b1d9c6cfb8e93331813535c127289437c75f822029e9a3bca8ea6b52ee","glsl-optimizer/src/util/strndup.h":"0273c4fdb7482cd7746881a63d3998648c6d63415ba85af1d1860f0e0dc504c6","glsl-optimizer/src/util/strtod.c":"5cf610d8a37373cf37cfb7aae903525d943b2674b1f32594c70b0eb19a8c9697","glsl-optimizer/src/util/strtod.h":"237396def4e264d35ed4bedea00ef9a4ceab6d7a11a18c770d9747d22c69ed2d","glsl-optimizer/src/util/u_atomic.h":"c02e809526c6c09ba8fe51f50b2490d1b6c8e5c7f3c4031ae958250d098fc3bb","glsl-optimizer/src/util/u_debug.c":"8c060e379b816618f3dd22c9ea523c68b9425c76c36a7dfe5d6d375b337f5f4a","glsl-optimizer/src/util/u_debug.h":"e11e26edd9b9e4e6f8e6a435e69f4d9edda27e9a379f68f4c82ea2525aaaea68","glsl-optimizer/src/util/u_dynarray.h":"853d0fa6ff2261614488be624deb8a2b01e57c2c8eabc28578cbeed4ccc95694","glsl-optimizer/src/util/u_endian.h":"3ccea7e529740318d8a4b05c00db3adc9d1e292a52bdc56a05c9fae99209720f","glsl-optimizer/src/util/u_math.c":"c868a8c0886dc78f1b06b13404ba8b253090449045774dd56893ac9d75795184","glsl-optimizer/src/util/u_math.h":"a04e32e126db016413f9de0a2028a3e71737137463b1289eae576f884b06fcf1","glsl-optimizer/src/util/u_memory.h":"c5db17c724c70283ddbe04165722f6988d4e0eb9aa3602ae472feff016649af9","glsl-optimizer/src/util/u_queue.h":"92930ce236c0528a98b695f5cea8c5c6aa9683beaf71a2227bdc5d33d1b21506","glsl-optimizer/src/util/u_string.h":"c5a2f4ef576d1547bda12c4ea219179fefa54414977743ac094abcaf696ef6ca","glsl-optimizer/src/util/u_thread.h":"00b708459b27f9910d18db92c18cc65cfc618ac2b3cd144e45f8640057b10d58","glsl-optimizer/src/util/xxhash.h":"2f2aff2fc6c0c929f52cf6ae7314122124c5be026d41ad1c357608383c4a37ad","src/bindings.rs":"79993db2058bde39f99ef483d02560d33b1cb882f6a552319e8b86eb6f9021e1","src/lib.rs":"04be1554cd829eb40864b06d80b491dd48117a4e3a601c7d482117f7a0391e67","wrapper.hpp":"f3ea34cc496f7d90b9bfcada3250b37b314c3524dac693b2ece9517bc7d274ac"},"package":"913662ae8335df058d56e00f11340b20fa82e03e0276587797ef325ab01e50d4"} -\ No newline at end of file -+{"files":{"Cargo.toml":"010bb96167ff152e0e5ac30f9905dc749a3f038199b70c541c5d8cb97a185ee3","README.md":"4468e08c64c19977707d792bfab0080e35ff927b64990eab77873f8ba056ba1c","build.rs":"6a64610018701781af182c418a4355c9ac5d99d000be9457f0e38a7dadf7542a","glsl-optimizer/CMakeLists.txt":"42ce94744e82ffa000da8b64d81fc140e293b9f5da7dd4cf6b49e7404a2448d9","glsl-optimizer/README.md":"b18eef11a92d267d88a937b1154f7670ee433c730b102fdf7e2da0b02722b146","glsl-optimizer/contrib/glslopt/Main.cpp":"14ba213210c62e234b8d9b0052105fed28eedd83d535ebe85acc10bda7322dd4","glsl-optimizer/contrib/glslopt/Readme":"65d2a6f1aa1dc61e903e090cdade027abad33e02e7c9c81e07dc80508acadec4","glsl-optimizer/generateParsers.sh":"878a97db5d3b69eb3b4c3a95780763b373cfcc0c02e0b28894f162dbbd1b8848","glsl-optimizer/include/GL/gl.h":"1989b51365b6d7d0c48ff6e8b181ef75e2cdf71bfb1626b1cc4362e2f54854a3","glsl-optimizer/include/GL/glext.h":"2ac3681045a35a2194a81a960cad395c04bef1c8a20ef46b799fb24af3ec5f70","glsl-optimizer/include/KHR/khrplatform.h":"1448141a0c054d7f46edfb63f4fe6c203acf9591974049481c32442fb03fd6ed","glsl-optimizer/include/c11/threads.h":"56e9e592b28df19f0db432125223cb3eb5c0c1f960c22db96a15692e14776337","glsl-optimizer/include/c11/threads_posix.h":"f922e2c8613582a9340aa5ae37a4f7bd962dbc30e33a7a6ab14bed2d2995bc2b","glsl-optimizer/include/c11/threads_win32.h":"95bf19d7fc14d328a016889afd583e4c49c050a93bcfb114bd2e9130a4532488","glsl-optimizer/include/c11_compat.h":"103fedb48f658d36cb416c9c9e5ea4d70dff181aab551fcb1028107d098ffa3e","glsl-optimizer/include/c99_compat.h":"aafad02f1ea90a7857636913ea21617a0fcd6197256dcfc6dd97bb3410ba892e","glsl-optimizer/include/no_extern_c.h":"40069dbb6dd2843658d442f926e609c7799b9c296046a90b62b570774fd618f5","glsl-optimizer/license.txt":"e26a745226f4a46b3ca00ffbe8be18507362189a2863d04b4f563ba176a9a836","glsl-optimizer/src/compiler/builtin_type_macros.h":"5b4fc4d4da7b07f997b6eb569e37db79fa0735286575ef1fab08d419e76776ff","glsl-optimizer/src/compiler/glsl/README":"e7d408b621c1b605857c4cab63902f615edb06b530142b91ac040808df6e22f7","glsl-optimizer/src/compiler/glsl/TODO":"dd3b7a098e6f9c85ca8c99ce6dea49d65bb75d4cea243b917f29e4ad2c974603","glsl-optimizer/src/compiler/glsl/ast.h":"3e68ff374350c49211a9931f7f55a485d8d89fc4b21caaffbf6655009ad95bf8","glsl-optimizer/src/compiler/glsl/ast_array_index.cpp":"92b4d501f33e0544c00d14e4f8837753afd916c2b42e076ccc95c9e8fc37ba94","glsl-optimizer/src/compiler/glsl/ast_expr.cpp":"afd712a7b1beb2b633888f4a0911b0a8e4ae5eb5ab9c1e3f247d518cdaaa56d6","glsl-optimizer/src/compiler/glsl/ast_function.cpp":"74f4fbd490e366b37f4715168bb3465ecd9334d4130942f75dcc8e80e8e7f027","glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp":"d0f798eb09271d41d068b9e7b18220d37f1ed0083300ab51eba30989698fe23d","glsl-optimizer/src/compiler/glsl/ast_type.cpp":"8eb790b24b26dfb72bdc333744b566c26d8464c5d47d20eae659461f5c4899f7","glsl-optimizer/src/compiler/glsl/builtin_functions.cpp":"454189d643c220fcb49116ee5c8a34f7b349aa67564040deb8607f6a41a15e70","glsl-optimizer/src/compiler/glsl/builtin_functions.h":"a37cad7ed09b522c5b8bec7b80115a36846e7ba6e0874a2a858e32f7f202c665","glsl-optimizer/src/compiler/glsl/builtin_int64.h":"619def6f3aebf180da3944ef08f159ab12a58b24767e41d8b985ac37ded54d62","glsl-optimizer/src/compiler/glsl/builtin_types.cpp":"afec060b62d6f3b00bfbf94e9fa5f96341ce096c128d1eef322791e6ed9cea4d","glsl-optimizer/src/compiler/glsl/builtin_variables.cpp":"6563bfb1345cbca4c77e00eef09ad152f3e1dc271d246a08c5ce9e1f4ce4250a","glsl-optimizer/src/compiler/glsl/float64.glsl":"1072fd888be48c2a7a5117cd2d92a65f034965a66375f598bb856bff5d7be766","glsl-optimizer/src/compiler/glsl/generate_ir.cpp":"e5f0175370a0d07f93c48d3f0f1b8233d12c64a7b02de02dcc753ef7b398ef0f","glsl-optimizer/src/compiler/glsl/glcpp/README":"a0332a1b221d047e9cce5181a64d4ac4056046fd878360ec8ae3a7b1e062bcff","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.c":"2d179879b1ffe84f58875eee5b0c19b6bae9c973b0c48e6bcd99978f2f501c80","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.l":"e4c5744c837200dafd7c15a912d13f650308ea552454d4fa67271bc0a5bde118","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.c":"03494f9ce1cb82260506e2559e73a3eeb622c4bd51b65eaa0a2c3351862bd4c8","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.h":"264d9a18421cde255ce34a0a62b3d8e73465359f0d167e64aa3973062aae5bdd","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.y":"fafb66e3a8f149d19e085f18a4273ba6d4c11af9e9a01d665cc784dddf97b79f","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.c":"37ed294403c2abfd17fd999d1ae8d11b170e5e9c878979fefac74a31195c96b0","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.h":"85ac8b444bcbd0822b66448a1da407b6ae5467b649f5afaf5c58325bd7569468","glsl-optimizer/src/compiler/glsl/glcpp/pp.c":"a52d94f1bcb3fb2747a95709c4a77c25de7eea8354d2b83bb18efd96976a4473","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.c":"d11aeb3acfe966d1b78f1ee49804093f2434214c41391d139ffcb67b69dc9862","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.h":"abbf1f36ec5a92d035bfbb841b9452287d147616e56373cdbee1c0e55af46406","glsl-optimizer/src/compiler/glsl/glsl_lexer.cpp":"272b9fc1383d72b81bfc03fa11fdf82270ed91a294e523f9ce2b4554bd3effa9","glsl-optimizer/src/compiler/glsl/glsl_lexer.ll":"2b57d9f9eb830c3d7961d4533048a158ee6f458c8d05c65bea7b7cfbc36e4458","glsl-optimizer/src/compiler/glsl/glsl_optimizer.cpp":"f8095d20629d0af70be930b0612e169edb274551a1d25a3cd1bf9995a11ce2e8","glsl-optimizer/src/compiler/glsl/glsl_optimizer.h":"22e843b4ec53ba5f6cd85ca5f7bad33922dca8061b19fb512d46f1caca8d4757","glsl-optimizer/src/compiler/glsl/glsl_parser.cpp":"126baf368d525aba301854e3d91ba60b5aee32e1102376af71416f32cb95ec48","glsl-optimizer/src/compiler/glsl/glsl_parser.h":"2ea9a50716098a8f7bef782d2a030d757b68da73afb01b4d4940d3e8381d44e8","glsl-optimizer/src/compiler/glsl/glsl_parser.yy":"6b1fd1576b29fce005dff744a6dbd0219e4c695c361d61864e1f3a8d6fa6b764","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.cpp":"aad64b5b66467da650091430681e8c6a820cf3cadc4db3c160bf2f15875390ae","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.h":"71fd0e92bbdb193dfb067d7bfdb1200d77392be2fbd0cbfc9ca89d1bb4c7e741","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.cpp":"6660fb83c0ddddbbd64581d46ccfdb9c84bfaa99d13348c289e6442ab00df046","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.h":"24682b8304e0ea3f6318ddb8c859686bd1faee23cd0511d1760977ae975d41bf","glsl-optimizer/src/compiler/glsl/hir_field_selection.cpp":"72a039b0fcab4161788def9e4bedac7ac06a20d8e13146529c6d246bd5202afd","glsl-optimizer/src/compiler/glsl/int64.glsl":"303dbe95dde44b91aee3e38b115b92028400d6a92f9268975d607471984e13eb","glsl-optimizer/src/compiler/glsl/ir.cpp":"2b4741cce90b5d4abff5d719c7324e2693c67294d4d99736cb241554adb281bc","glsl-optimizer/src/compiler/glsl/ir.h":"990b1c74447c4eb4835353ccb0ed9aea644f97fc1129ef1739cd935075d85d2e","glsl-optimizer/src/compiler/glsl/ir_array_refcount.cpp":"8cdc1cffe01e42e0566fa2193a75f789628e8025ad1b82f0ee6f204451b7f9f7","glsl-optimizer/src/compiler/glsl/ir_array_refcount.h":"75f06ec81342b379096ca52e1dc0fd5f19a11ff8e9b58203c20628179d644c12","glsl-optimizer/src/compiler/glsl/ir_basic_block.cpp":"1e2920b1c0ecb08424c745c558f84d0d7e44b74585cf2cc2265dc4dfede3fa2f","glsl-optimizer/src/compiler/glsl/ir_basic_block.h":"81be7da0fc0ee547cd13ec60c1fcd7d3ce3d70d7e5e988f01a3b43a827acdf05","glsl-optimizer/src/compiler/glsl/ir_builder.cpp":"daba29c5a1efdd5a9754f420eb3e2ebdf73485273497f40d4863dadeddb23c0d","glsl-optimizer/src/compiler/glsl/ir_builder.h":"2822e74dd3f6e3df8b300af27d5b11ea2dd99d0e5e7ca809b7bbcce9833c483c","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.cpp":"8c6df5abf2fe313363f285f171c19ca6c8ee4f3bc2ed79d33c0c88cc8be45c48","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.h":"799852adc3a0e54d04080655e7cebfa0d3bf5b6ffed5d8414f141380665d4db7","glsl-optimizer/src/compiler/glsl/ir_clone.cpp":"d897a4e1f5bbec4a6a2f15044c1be9a4d13899c73be77335b041049a4589aa5d","glsl-optimizer/src/compiler/glsl/ir_constant_expression.cpp":"78bd87ddb09db67f6c499067728d72aef4f16aa02721a99a4b769d1e0cfa9010","glsl-optimizer/src/compiler/glsl/ir_equals.cpp":"bca28533a6310b0fc152b56d80872368f1510dc62ed6e8ac199b9ffa7fac02e7","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.cpp":"7e918d4e1f237eca01396004015865ce345afe32a876c9dbc6728576a1a7eae4","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.h":"f45b66aa9497520e7e08e612d24b308477c34477fbd963ee9320eac664957f16","glsl-optimizer/src/compiler/glsl/ir_expression_operation.h":"cc9f10727dbd26cac506804f51456302c702650f9eeb59054a7e1575d5cf6687","glsl-optimizer/src/compiler/glsl/ir_expression_operation.py":"7b86c96021b9fbe165957f4ecb0b612fefcde1c2cf3c6d75e3cdb22e369216ba","glsl-optimizer/src/compiler/glsl/ir_expression_operation_constant.h":"9ad3346416392e3efa11e12ecf2feca7453c5253d241eb96c91dfb85d4f2b971","glsl-optimizer/src/compiler/glsl/ir_expression_operation_strings.h":"a6826daf496a8b9e89885bc2a161ac3445d501b23c6e0ac33e2c01b506b273c8","glsl-optimizer/src/compiler/glsl/ir_function.cpp":"7537365fc0fbe4b37a26b9a2146cc64d3e9a774d60eab63b65002ad165ae8fc7","glsl-optimizer/src/compiler/glsl/ir_function_can_inline.cpp":"faddbf112187a048d502716a3fb82570a322299ba2a3abd79388382c82040bfc","glsl-optimizer/src/compiler/glsl/ir_function_detect_recursion.cpp":"9176973eaf5c0a984701f953bb7a80f37dca43d59b5bce50fc69b3f02f2902d7","glsl-optimizer/src/compiler/glsl/ir_function_inlining.h":"9739493f99c489987d650762fccdd3fb3d432f6481d67f6c799176685bd59632","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.cpp":"3725861fbe2b98e0617f52d3b14cf6d3b25fb5ec00f5ef5d308b03642f592767","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.h":"e0560210e966c0c31e4ca843e80ea154e64db5a444b8c2df845b6ba5b3a43fc1","glsl-optimizer/src/compiler/glsl/ir_hv_accept.cpp":"caf7ce2cd9494aadd3c58bcf77f29de58368dc9e347a362bbf37f8bda9509b80","glsl-optimizer/src/compiler/glsl/ir_optimization.h":"8b3dcfc7f9e96b21a8dd47a0040d90be483a9e67a2cdce3a697188fb758d4630","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.cpp":"f8e34a983452be0dcb5a695e9c8e895eead24f9e540992a8afe510ae85da4c4c","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.h":"1ad1bd3efd1ace39051c13f904c05fd80425d329444f9a8d47fd6d948faf46e0","glsl-optimizer/src/compiler/glsl/ir_print_visitor.cpp":"643f5a68aae3fb37267fd793f1216d1cfdeb2c09338c26b1f30e4c6deaef4de5","glsl-optimizer/src/compiler/glsl/ir_print_visitor.h":"4573eb93268a2654c14b505253dd651e2695d43dc745904d824da18305269b95","glsl-optimizer/src/compiler/glsl/ir_reader.cpp":"06bfba802c8354e5a8b2334b6d78d6297de18235bedd3f8fbb382c89870b02f2","glsl-optimizer/src/compiler/glsl/ir_reader.h":"63e3f7f1597936a7011d5b520e171b197bf82bee6c1560d822c3edf5aaa6f9e9","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.cpp":"84b5c5d746555adca85759c2912fe48010232b7c1c0bd2cf03bd04067a85e66f","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.h":"fd8c561b71085d3211fff85ed514fecb299d8ce19a04bc063419a55b6d840525","glsl-optimizer/src/compiler/glsl/ir_set_program_inouts.cpp":"ab9f115ce9e7f312d9c7978340ced0dc4ae6d13a80e08442ba9709d11d50cae5","glsl-optimizer/src/compiler/glsl/ir_uniform.h":"683ae6896b1a08470c090be5f822fc31cd434eab9216e954b9bba24a46975109","glsl-optimizer/src/compiler/glsl/ir_unused_structs.cpp":"9c1620c45f2fc071fe5ed828472040b14c5f42effe06aa0e3b8352c95ef78786","glsl-optimizer/src/compiler/glsl/ir_unused_structs.h":"13387b49c23093575276b25b9dfd31fedd8f131c5c4f3128ab04cf03e15b5295","glsl-optimizer/src/compiler/glsl/ir_validate.cpp":"6b232be5999a86ea278f4f15b2832d76843246509118d924243055a3b9b0299f","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.cpp":"2764a3cad937d53f36db7447c3a5b98b04bf153acf81074d971857fc5bca460d","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.h":"b0668e3eb1501ef65e38fe12830742ecb3d28e6039f30e366c8924efc29b4a39","glsl-optimizer/src/compiler/glsl/ir_visitor.h":"f21b3534c3d66d5fb707d1581fece7e1eb043523afbaedf89918cfb031c6df94","glsl-optimizer/src/compiler/glsl/link_atomics.cpp":"360f0209e11f367ba358223597b0a118bae095bff16337cf03f1fb89c5b80ca6","glsl-optimizer/src/compiler/glsl/link_functions.cpp":"de7895da8aa33a1e3c2c1eb2fdaf267ab5d1fbfdb79ae2e67f95211e946e294c","glsl-optimizer/src/compiler/glsl/link_interface_blocks.cpp":"1926cfa73810704eb19b916c1b2cdb9321155e2f98b2a0a57c7c3c6e960540cd","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.cpp":"1e14e06ca3b2c1089cfba2e8eaf0c1f373d9d6374b6082f320962dd71ae09611","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.h":"fd58c155af645295bb6aec08797889de586f4d919731de2bce57e8dce59bb048","glsl-optimizer/src/compiler/glsl/link_uniform_blocks.cpp":"09589f49776dce32e6c4044937de7e0c839a9754ad31960148f8f9e010658997","glsl-optimizer/src/compiler/glsl/link_uniform_initializers.cpp":"bf98e08c12db466acf9623cbeb8fa8e3b4002512722e7a6521287f558a099f37","glsl-optimizer/src/compiler/glsl/link_uniforms.cpp":"84bad5b1377362cecf259b05124239be5220b03ce1c0c61b59bd9a47e4379af2","glsl-optimizer/src/compiler/glsl/link_varyings.cpp":"a5f1a53e7c80d635515fe808ff223d89fef1767abb0f2b7aa28fa6773dca353f","glsl-optimizer/src/compiler/glsl/link_varyings.h":"b9dbe018f038df69763df2e928742ce81bbc6e3aaba26f50621e30a6d9aa6220","glsl-optimizer/src/compiler/glsl/linker.cpp":"40b1ecd5d4f6c7f13d5a87ce390561a51fdf6f3fcd9b2197b9c88b03a773ba94","glsl-optimizer/src/compiler/glsl/linker.h":"ecf94b4ad75ef461c27c557fda4bd25f34c91930822b8e1d729ec84520d4a049","glsl-optimizer/src/compiler/glsl/linker_util.cpp":"1663ad88e2a369305659aeeffaedb5bd752cf76340a2ba5797fc0bf600633cf9","glsl-optimizer/src/compiler/glsl/linker_util.h":"6db788daf9c8e87ae2764b61a8b37ebe419e69c1b82ddee01986e37c978c6993","glsl-optimizer/src/compiler/glsl/list.h":"b1f46ce0e552fe7c45b2a19408a9d97662e23e4b182ab335491c26f8cf25886f","glsl-optimizer/src/compiler/glsl/loop_analysis.cpp":"57ecd573477c68091c7cc99537faa7139a8f395935e3d4f10144cefdefb5a611","glsl-optimizer/src/compiler/glsl/loop_analysis.h":"a85f045a038ee5b5176063e85d7988865862c44ab0580f771b993a042d0b69cc","glsl-optimizer/src/compiler/glsl/loop_unroll.cpp":"bd4292ea2809f5a669bcb76ceaa1ac365772dcd638c579c3ed10275214901a54","glsl-optimizer/src/compiler/glsl/lower_blend_equation_advanced.cpp":"8cfbef140d9c4b4d2f57bfa05c9c374d31a121d0f87afce94333f049023b654a","glsl-optimizer/src/compiler/glsl/lower_buffer_access.cpp":"1ae221c3c7a95aeb867207e7a742be635f91b406c157747bfd6ddf10274d97fb","glsl-optimizer/src/compiler/glsl/lower_buffer_access.h":"807886953a576a323591798cbca5e2df24295ea893b28affd8ffb5926cebaa04","glsl-optimizer/src/compiler/glsl/lower_builtins.cpp":"4d81afc32cf58e1481fcb5e42888ab93dbe6820310a20ff7a9982b77b2152d9b","glsl-optimizer/src/compiler/glsl/lower_const_arrays_to_uniforms.cpp":"608403f0eeeedf21cfcd3014116e0f44e28cbdf6c4c32aac7e613e64e30205e1","glsl-optimizer/src/compiler/glsl/lower_cs_derived.cpp":"179905cd47a294122adeb5b0abfed6f2f67782dcde21b544d1ee2c1985154e66","glsl-optimizer/src/compiler/glsl/lower_discard.cpp":"3b361b2db0004d544d64611cb50d5a6e364cf6c5f2e60c449085d7d753dd7fb0","glsl-optimizer/src/compiler/glsl/lower_discard_flow.cpp":"f5c29b6a27690bb5c91f196d1a1cf9f6be4f1025292311fe2dac561ce6774dee","glsl-optimizer/src/compiler/glsl/lower_distance.cpp":"a118c85493d5d22b2c059a930c51a5854896d4b1dade76598eaa985e5a3dff8c","glsl-optimizer/src/compiler/glsl/lower_if_to_cond_assign.cpp":"469e617757fd1728709cce021aac5c8da05ee503bf5366977bdc4ef7a6d83950","glsl-optimizer/src/compiler/glsl/lower_instructions.cpp":"6ff5c396abe40d8a2145d571e99e2bbe9143393e15aafc28adc2803a01d821b6","glsl-optimizer/src/compiler/glsl/lower_int64.cpp":"d1ed41196880dd53c7b13e2782f9423f8442bf1d46186e8be92b1b66218a83ee","glsl-optimizer/src/compiler/glsl/lower_jumps.cpp":"34de7b493f281589fb0c2c0f6e885d0a0fabbe7a4e97a73de374dd714777a58c","glsl-optimizer/src/compiler/glsl/lower_mat_op_to_vec.cpp":"dff7a308edc4846c348ed4225c6699a9c75abac68d88f41f85954276552779f4","glsl-optimizer/src/compiler/glsl/lower_named_interface_blocks.cpp":"16063ac127bff75a68272070ab11c21c25101edbff62b4c68f4983b4cd941af0","glsl-optimizer/src/compiler/glsl/lower_offset_array.cpp":"3b00773399135aea85746a5a68b96ef000bc6841be1a2c8e6f25c516628b0949","glsl-optimizer/src/compiler/glsl/lower_output_reads.cpp":"a0fc9975d5aa1617e21fc6c353659a9802da9e83779a3eef4ec584f74b4dadc5","glsl-optimizer/src/compiler/glsl/lower_packed_varyings.cpp":"7550099d4ae123d71541c2fc88bc04fbfe9271ec75d7e210987d1c8cac3cf3ea","glsl-optimizer/src/compiler/glsl/lower_packing_builtins.cpp":"79a13d161fe505a410ab948d92769395708693ec888153630fa240e5b97e356f","glsl-optimizer/src/compiler/glsl/lower_precision.cpp":"f82a185b879872b977a1787d8061b9a80bc4cf8db1b970db6efba2ad9cc20fa2","glsl-optimizer/src/compiler/glsl/lower_shared_reference.cpp":"ea2dccf50a83bc19391bf6b7ab6aa53c0005f427af4066d25140340af9a4beef","glsl-optimizer/src/compiler/glsl/lower_subroutine.cpp":"f69fa53650eeb6f2944fce4d36a6e0a423e6705f3a3bd3389c7fadb83cfc8802","glsl-optimizer/src/compiler/glsl/lower_tess_level.cpp":"b196c9d424c0569f3e85d75c2d125af21566cb113d69036db87c0990703e0fa7","glsl-optimizer/src/compiler/glsl/lower_texture_projection.cpp":"4d247f244272adc8250fd888d8d932a140dd5de4d1efc7a58492c3c2b8291527","glsl-optimizer/src/compiler/glsl/lower_ubo_reference.cpp":"89bdbc6c1669230c644c0857db1ce2781ec61d349ecd08c7914146e1f4750a4a","glsl-optimizer/src/compiler/glsl/lower_variable_index_to_cond_assign.cpp":"fce930f29ac9405b297d1f749d68f59506b89c70b4ee1b1ab8cf49a34cc71ecf","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_cond_assign.cpp":"3c67d851a11a55fad1c49a550f3a0cfe50892d33a3f238ce266cd829eba510a8","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_swizzle.cpp":"f5ec666b73e1415cbab32519a53605ed385f3b03e889560373dbce69dda5000e","glsl-optimizer/src/compiler/glsl/lower_vector.cpp":"f7c13f5572ebe09b6a71553133b2cf003cd4b77b9657600672ee3b21bf890725","glsl-optimizer/src/compiler/glsl/lower_vector_derefs.cpp":"b05793da6dd620a531b43df5af8b2ecbc37b9db0c88910f5724ea10bcd057e19","glsl-optimizer/src/compiler/glsl/lower_vector_insert.cpp":"fee772ec17eea5e86a529bf9c5fa2ee0d29a5982bb75ebc6d68ed36cd19aa299","glsl-optimizer/src/compiler/glsl/lower_vertex_id.cpp":"690e8715182e03fead5cc5a35251fb4f41b357e4c71a1dfbc4bd7be19862b56d","glsl-optimizer/src/compiler/glsl/lower_xfb_varying.cpp":"58c0e8b270e4bbde54250be03cdb2f36966bcafb785372ad2e2b786835df7f9f","glsl-optimizer/src/compiler/glsl/main.cpp":"ae5e88abbbc8a12f769e1296bad938b9d7398cc6da0d3d0caeceeeb876536850","glsl-optimizer/src/compiler/glsl/opt_add_neg_to_sub.h":"f5054944bfd068810629080d0ea11df78b3f57a8f86df75e13ca50157ad1964d","glsl-optimizer/src/compiler/glsl/opt_algebraic.cpp":"25f45b20e1972ee8c789177a1aeda6e4286c25db2eae3a43ff83029ae64969c0","glsl-optimizer/src/compiler/glsl/opt_array_splitting.cpp":"19d3ce0e815438f4df9ab2890e767b03a4f3f191b53bb30c0217cf2ae6a95430","glsl-optimizer/src/compiler/glsl/opt_conditional_discard.cpp":"0e44e0e126711a3725c1f3a2aa65ff03c381fed08680ffc30101aae60f716c4e","glsl-optimizer/src/compiler/glsl/opt_constant_folding.cpp":"a088d04d9b45f9e55e235835648f614c89b7803c03a6d4f6a6d1a6bc1f0228bd","glsl-optimizer/src/compiler/glsl/opt_constant_propagation.cpp":"8a9440d77ecd6dcf13e683cbb99943aab6311c8fd4b5f6a9189a8d4f270746f4","glsl-optimizer/src/compiler/glsl/opt_constant_variable.cpp":"63d3ccd4dd09f19c9cf1a2f51592111bed41284504f29f3c0de4cadebc439a37","glsl-optimizer/src/compiler/glsl/opt_copy_propagation_elements.cpp":"ffa0f50863995e0d2e31f55a52e82319edc71e520987bebd7f7e561ea331c64b","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_variables.cpp":"84e8747b948232f01dd56b428b9315f96f9511f605f240119fc446fae28981a9","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_varyings.cpp":"761523e88f5b3ba785170f4d7205e94fa99acb7e74d29efbe40e1c010e1dbdb3","glsl-optimizer/src/compiler/glsl/opt_dead_code.cpp":"fd1ba2da7337d4e5dad17f5c2d73d9cc8880305f423e85d64cf94553588fa401","glsl-optimizer/src/compiler/glsl/opt_dead_code_local.cpp":"969a598b4df322baf222258a66cd64a326ea20e5b3125be9d8d1771f522c69e0","glsl-optimizer/src/compiler/glsl/opt_dead_functions.cpp":"774cae6536d02edf26e996a2a895e1f62d5098f16dc96b44798b4fc731a9a95f","glsl-optimizer/src/compiler/glsl/opt_flatten_nested_if_blocks.cpp":"3696a5c55f02e20056e085bc2714f73ac992f221b6f3387d655068e86b512046","glsl-optimizer/src/compiler/glsl/opt_flip_matrices.cpp":"44f0fe05b49329667671f88c96dc86ab3fe1459ff7b87f2b2d88de2d49829f9f","glsl-optimizer/src/compiler/glsl/opt_function_inlining.cpp":"fb56a33c90419a01676b57cbd91d0674a54cca40e6defaacc88dd33facebc131","glsl-optimizer/src/compiler/glsl/opt_if_simplification.cpp":"ac406eb35e379c357641d6c5749f50c65961455924d3dc884e2b90046fa92c5c","glsl-optimizer/src/compiler/glsl/opt_minmax.cpp":"8abd59d3b14ef60ff14a9c69660e6945f5cf10b97edb4afebe56be3f81d96316","glsl-optimizer/src/compiler/glsl/opt_rebalance_tree.cpp":"8bb6329dc0f299042368fc81934c2df019b45ab9f7aa0415d4e57b8d1ff98c9f","glsl-optimizer/src/compiler/glsl/opt_redundant_jumps.cpp":"222c73e2ac7a938ebb6428cc6c780c908ff6156d8ff935b04fed93a48fc10496","glsl-optimizer/src/compiler/glsl/opt_structure_splitting.cpp":"2edc79cc13f3177934e0443ad62f5976a1991f01f86ea303a803434849b13a47","glsl-optimizer/src/compiler/glsl/opt_swizzle.cpp":"015d0abddfe507f67c4b96c82988d861d018ededf7bf055e2bcbe9ea92da694e","glsl-optimizer/src/compiler/glsl/opt_tree_grafting.cpp":"46d28ac983ea244a4315bdc0e8892979ec4d1f9b9a96ac8a8a08006d9bc5e878","glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp":"d80ee43bb97d9f016fb9c5e1e06f5b2afa569811f368ba067be794ec11d085fb","glsl-optimizer/src/compiler/glsl/program.h":"2982447e2abd35371e273ad87951722782a8b21c08294f67c39d987da1e1c55f","glsl-optimizer/src/compiler/glsl/propagate_invariance.cpp":"080943e21baa32494723a2eefb185915d2daae1f46d6df420145c5ad6857e119","glsl-optimizer/src/compiler/glsl/s_expression.cpp":"1ced972bc6ecc8eab4116ea71fb0212ab9ae5bcc0be3b47aa5d9d903566b3af1","glsl-optimizer/src/compiler/glsl/s_expression.h":"65b847e30e22a809b57d0bc70243049c99d9c6318803c5b8d0826aba55dc217e","glsl-optimizer/src/compiler/glsl/serialize.cpp":"be0eb4251348a9d921acb839a5c48c6023a2e9d116d602bb0432787ab623655d","glsl-optimizer/src/compiler/glsl/serialize.h":"57425732eba1233d928e5f07f88b623ce65af46b3bb034bf147f0a4b7f94f9a1","glsl-optimizer/src/compiler/glsl/shader_cache.cpp":"e0c5c433f2df3fccdf1d61281bfcb0ee5633433339b97c697d64db99611cbaaf","glsl-optimizer/src/compiler/glsl/shader_cache.h":"9217164d8d7f54aca0fe5922c7187095a6ae0cb703b196b79805aeef07a7e697","glsl-optimizer/src/compiler/glsl/standalone.cpp":"8e6c416a14d631261917a5fe4cc91880c287b22b2dfd70eb22028289a8fa5364","glsl-optimizer/src/compiler/glsl/standalone.h":"a7c397d1dfdd1e7fb2cfe99db35cd9df93251e642059208533202b7f20497f83","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.cpp":"970d14b7a9d58e5270321f97bf5d57795558b1c570a56678e04a65b26c60bf4f","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.h":"d921a617ea82b9e49413314492a645c44356de503581b1be3f1b57de236e480d","glsl-optimizer/src/compiler/glsl/string_to_uint_map.cpp":"d824bf5b839bd39498dc9e457103cdbe3e5289ddf7564107c27b1505948dd31f","glsl-optimizer/src/compiler/glsl/string_to_uint_map.h":"e2f18e66359c9d620e085de7f4a334a47df9c66e65a5bfe8b734c627bec04104","glsl-optimizer/src/compiler/glsl/test_optpass.h":"b27b8f35f5387e7ce4982bb51c7b63ccf14f91757f3108a5d02ed006925bb8a0","glsl-optimizer/src/compiler/glsl/xxd.py":"376484142f27f45090ea8203ae2621abf73f06175cb0ee8d96f44a3b9327f4bd","glsl-optimizer/src/compiler/glsl_types.cpp":"044bb6754f45419a3151e7a25c39202a82009ae3c6bc54ff7f0bb4258a5deefe","glsl-optimizer/src/compiler/glsl_types.h":"fd899a42f34ddeb8601bc3cd6c5e3aed82fc8aef4042dde1b39b3c01e1dcc219","glsl-optimizer/src/compiler/shader_enums.c":"436bff5216b11b0980bdfada5885fc6ac9afa2037a3027fcd6eea2a8635597ac","glsl-optimizer/src/compiler/shader_enums.h":"13220442a5c02e83540cf2c0ad4f8417b2fbda5f2586dec4e92082544c937cdd","glsl-optimizer/src/compiler/shader_info.h":"4c5453e81197ca83593ee4f365074b23530f2ab21c78e1733b63dec6f344c12a","glsl-optimizer/src/gallium/auxiliary/util/u_half.h":"3c2b37bda3ccb64387e44b723d29cf9046decab1a893bf42d842e9603398bdee","glsl-optimizer/src/gallium/include/pipe/p_compiler.h":"c75620096ce8523dae90599e50aa2ef6468d3b0e368a77795edeb20dd1abfc0c","glsl-optimizer/src/gallium/include/pipe/p_config.h":"a27692fc35f9e55df3224b7529e66b3001e911e94e6bc5f8f569e493e1ee3fb7","glsl-optimizer/src/gallium/include/pipe/p_defines.h":"be26d68c0acc67c5e44788c6299716a9eee415fd81d7d747e3738a829e3b6b38","glsl-optimizer/src/gallium/include/pipe/p_format.h":"5674215fc41d27496f037cf837717daefbf23ebb38d40ace7c0c414bc08182b0","glsl-optimizer/src/gallium/include/pipe/p_state.h":"d600593aba5f5a17072a6c38f6baa81e01c7994b0174250f7e433bb41684b702","glsl-optimizer/src/mapi/glapi/glapi.h":"73632a625c0ddabc401205e8b5a81eb8af8506868efe4b170d7979ec3619e9c5","glsl-optimizer/src/mesa/main/config.h":"5800259373099e5405de2eb52619f9de242552a479902a3a642a333c8cb3c1e7","glsl-optimizer/src/mesa/main/context.c":"2f3208473d99c94f734b1137ba91889d4a1babb9e7534bf1dc85d851ee98274e","glsl-optimizer/src/mesa/main/context.h":"cc7e4194797db9d007f01884e23d786c453b3860821f7f2ddcdf0f1bf3f8ffb1","glsl-optimizer/src/mesa/main/dd.h":"6a964acd06b6c2d88700e69fb75fe3c6b3b3d45bbc41db24f3f897a29695fe0c","glsl-optimizer/src/mesa/main/debug_output.h":"7312422e90b8c0e34028ac27280e438139b5cba525c99deb3ac883cd3d87e452","glsl-optimizer/src/mesa/main/draw.h":"7eaef3a9e27a60ea6f7937109bf3a6190b831162fde0479abb12077ce27c353d","glsl-optimizer/src/mesa/main/enums.h":"87d562a6764f51c014a2274fa7c3aca17c04441537ddd56b2554f13c6fffea92","glsl-optimizer/src/mesa/main/errors.h":"c79444b5df289c90fbb22a33b2d0c23917d9fc4510960088f0b79e53bb56b1b2","glsl-optimizer/src/mesa/main/extensions.h":"a38b2f87cc93c513994281350d69e06c84ff8eded5313ec0a1be33f375e0ebbd","glsl-optimizer/src/mesa/main/extensions_table.c":"17642d1a8c9a0bf2bd61060052d33ff14a005d2b962e6cf91465797a50851e85","glsl-optimizer/src/mesa/main/extensions_table.h":"2c879571c238d2e14461031ac740372fd0f9ac3a34c0d5541bb9b7ed4c0376c8","glsl-optimizer/src/mesa/main/formats.h":"02e2f7ec3e39286cf9f27e2641043e6df8ecb1dfde9e643313210e214af2a929","glsl-optimizer/src/mesa/main/glheader.h":"58217b33eead6aa6b23cd4a291cefeaa6cb84e465f4960daffca97c44d6d1c35","glsl-optimizer/src/mesa/main/glthread.h":"51fb2711f77e7eafcfc52d29d5b844978832b24c930d88accd48d143a6eb9c6f","glsl-optimizer/src/mesa/main/hash.h":"7e7f782034c16a8e693de48e00c31d4a90b0129f4029fd074033d7d16ccbe718","glsl-optimizer/src/mesa/main/macros.h":"73d15ddfd64f2b57b9b2ffeeb993b9c2c0899a80563e9d6ff337b11ccbe6eee5","glsl-optimizer/src/mesa/main/menums.h":"5dfac0e2279d60b0cd0c7b9fc2a5021620d0f6282ed2e738c420214e3af152d3","glsl-optimizer/src/mesa/main/mesa_private.h":"edda678b93438944279a551f663b8858ad84814a9fc88ba9672ef195599c24ae","glsl-optimizer/src/mesa/main/mtypes.h":"6efddefa099e4d2e3fdd97f0055644f47aba21711385edfeabc2d9b0676f2eec","glsl-optimizer/src/mesa/main/shaderobj.h":"9f0dfe96d0c2154201adef942bd36053533ac7b2492fb3786acda5bea514c75e","glsl-optimizer/src/mesa/main/uniforms.h":"4e331e6ad6e9cbded978b4082dbe0a57c1f8f01327446bb6892bfc179976c38b","glsl-optimizer/src/mesa/main/version.h":"9d0a13a758099302dc55cf7d045791834a89b0f9d4cf17b2692259b369a8a9a1","glsl-optimizer/src/mesa/math/m_matrix.h":"a37b19f182e070db3df93b0ede43c22fb8be8c2906504133ee6dbd7db1185d8b","glsl-optimizer/src/mesa/program/dummy_errors.c":"1820e305515b4c5e041f5e1623266a48ec8f076a155310be7d60637101f593e4","glsl-optimizer/src/mesa/program/ir_to_mesa.h":"b47f58d22e3ca2ae42d52501ea769d15c4476834944fa97eeccd3a3439211d00","glsl-optimizer/src/mesa/program/prog_instruction.h":"ab3832152a7e144b59e5a2264b2c29db56d93be31e76bbd958527a56771b40eb","glsl-optimizer/src/mesa/program/prog_parameter.h":"ba18c743284eadbc837c2c364c73e5d372321a7637a76e589d8d39fe8b5de225","glsl-optimizer/src/mesa/program/prog_statevars.h":"fc413698f84bc52d45fdeae0471934ee9904bfb7eac1a2b5f70446e54bcbbdca","glsl-optimizer/src/mesa/program/program.h":"1f01026a4eff440a3f122fd9b519d03546fe7f7d8be60dca834e95a2f8fbbfd2","glsl-optimizer/src/mesa/program/symbol_table.c":"6611cb9f078035bf5ff8c9112093a6c7d99f8af99a3931d0c07f227cc72283ea","glsl-optimizer/src/mesa/program/symbol_table.h":"631dc35ac48d5e87962d45507461920f6575610960ffcc42a08cefeb43300cda","glsl-optimizer/src/mesa/vbo/vbo.h":"6eb1dcd9a08c92f276c5fe08da184ff9d455d1be421913b8ad732a7b65e858fb","glsl-optimizer/src/util/bitscan.h":"9e49e694e6b34fe035bc685f32588827eb8cbe7d82878963c7ab52843e1c16aa","glsl-optimizer/src/util/bitset.h":"c40f78515c6230fed18345c6751ce33833a49da7a27901c7e6d7340cbdcbc5e7","glsl-optimizer/src/util/blob.c":"8f729846f66efc9c15485cc5fc24c6ec861fc1fecb2f652573f2a237d481b791","glsl-optimizer/src/util/blob.h":"93e1eaac866b9a7cd6fc03b533c18fb2edf0e97f03395eff4f3a605c4fc14d0c","glsl-optimizer/src/util/compiler.h":"79e3bf40a5bab704e6c949f23a1352759607bb57d80e5d8df2ef159755f10b68","glsl-optimizer/src/util/crc32.c":"2f3467a046b3a76784ecb9aa55d527698c8607fd0b12c622f6691aaa77b58505","glsl-optimizer/src/util/crc32.h":"59bd81865e51042b73a86f8fb117c312418df095fed2d828c5c1d1c8b6fc6cd4","glsl-optimizer/src/util/debug.c":"c3d68e9752ccc19e66c669562cd113cf1d0ac83cbb30174789e7fb8d1df58f9c","glsl-optimizer/src/util/debug.h":"50068d745c4199ccbd33d68dd4c8a36d2b5179c7869a21e75906ddd0718ca456","glsl-optimizer/src/util/detect_os.h":"343a8790d17a3710c6dd015ee367f84e3902ff3f2e36faca2bf93f9d725d3574","glsl-optimizer/src/util/disk_cache.c":"f533937e5a4fffe76e2739ef4b6b1e1da097d96d63eb808e68ebbc7027641c23","glsl-optimizer/src/util/disk_cache.h":"e83314fb14134a8e079b15e470a6376ba5a8253701f048c890a62b7e55d64bc8","glsl-optimizer/src/util/fast_urem_by_const.h":"e108fce804616c47d071dfe4a04163eec1126e448ed1aa89abb6b3a6d772bd5b","glsl-optimizer/src/util/fnv1a.h":"ab2596f19c6adf431ae27618f62c5743e24ad23ef83bb359a4c4c218245ab459","glsl-optimizer/src/util/format/u_format.h":"4cdfc0c59cbc99a092e5ec5a396910f2d93b9643e5d8141050b011e66f11e45b","glsl-optimizer/src/util/futex.h":"26f7c9d86e9ffef4c0fa2761f1aaa1918337302e20bd6ca10e61dc3c47356deb","glsl-optimizer/src/util/half_float.c":"11bc2584493d5d9d46e8c8a619a0307cf150bf5ab5d0f96bb764b061dc37a00e","glsl-optimizer/src/util/half_float.h":"7f7c380f126da1400a91758cc0392f24bf967bce1672890b62be26fe9fbd922b","glsl-optimizer/src/util/hash_table.c":"0ca40352e35dedab0a84c64c903f1b16d47e950bb5f43b4d22bb57d499bfea6e","glsl-optimizer/src/util/hash_table.h":"217191bb360592e2232f187473c10287d2cda8ae6fa5c53d0ef74c8c206118b4","glsl-optimizer/src/util/list.h":"9fab03c6a78186bb5f173269f825f6ce976b409d931852e3d93bac632e07989a","glsl-optimizer/src/util/macros.h":"63faf65b51058c483b17f1f77da51d1c53c8beab52678cb6bd01f1228a63b6b0","glsl-optimizer/src/util/mesa-sha1.c":"00c692ec353ebc02c06c57c5a71de0ab7a119f86a4146f452e65ec87e4944417","glsl-optimizer/src/util/mesa-sha1.h":"bff4c29f4bf7cdbcefb30fa0c996a7604a380eba8976467c2a60e7cd328f7e26","glsl-optimizer/src/util/mesa-sha1_test.c":"25da89a59d51469f77b4c468ca23ffdce0a7a1166a70b6cc23026a6800b0143c","glsl-optimizer/src/util/os_memory.h":"64555faf1760ae6954f42c83727c38dfc4c278e9152115779ffaad58b42adacf","glsl-optimizer/src/util/os_memory_aligned.h":"12d86fa94be38c13f7eeebdf313795e1267dd5a7187d2f0072e0e896f41702f6","glsl-optimizer/src/util/os_memory_stdc.h":"07360363b88c927065e10df71bebf6c8a0cc3b9167c9dfce55f2d65f11e6f787","glsl-optimizer/src/util/os_misc.c":"a9936e613ec84803abd59ad47c192c8e3939993c950ac91973fdc4cec1801bb8","glsl-optimizer/src/util/os_misc.h":"cc68eb12e05b5e749c54298cb4a6f4cd20cc5af7db3403e70b3c27b56090c740","glsl-optimizer/src/util/os_time.h":"73e775f7335244ff5964c678c27eedf1aea6abea44c4169d327ea8c7ce4a3a88","glsl-optimizer/src/util/ralloc.c":"4b51189595ef67bcef52c40cbf654d969041dbd15e15d4a893ad494ac060aeca","glsl-optimizer/src/util/ralloc.h":"e573c45875ff1530f0dbee9a93ae55535fdac8d5cc88a79ebc327c688824bde5","glsl-optimizer/src/util/rounding.h":"0450722353caf83de07e67f335949dbe95fe53b534052d4ee9d28d2781387614","glsl-optimizer/src/util/set.c":"86f8c9a830bead5a5a79bc970b0ff97809312af07b3beb39ef9d90af04d40a1b","glsl-optimizer/src/util/set.h":"3e39ca161e7ed4ec7c436cc9c7919ed9a55ed1b71edbf2caf6f9bcfd9bc578ed","glsl-optimizer/src/util/sha1/README":"00af7419af05247081858acb2902efd99fcda2ce16e331079f701645bb3729c0","glsl-optimizer/src/util/sha1/sha1.c":"1403bbe0aad42ba3e6be7e09f7cad87a6a8c4ad5b63962f7b92b9f37d8133b04","glsl-optimizer/src/util/sha1/sha1.h":"68d9f240eab2918026ecdf22be36811abbd4f1389f6c36e31258041aeaedd247","glsl-optimizer/src/util/simple_mtx.h":"12c6c3c4b7db9168bc656d5b3c65912075084d2b388c415d5c3d3f5953a9d6c7","glsl-optimizer/src/util/softfloat.c":"a97e51a96fe5e6a052c02aa6bbec683fe73fb88a8c087d9c930503e2120d8a2e","glsl-optimizer/src/util/softfloat.h":"66664b0250e83bf5dd4cc743acd119d076efcea624a0eab3d6b60718e6ee8811","glsl-optimizer/src/util/string_buffer.c":"63a1d1b1e34926c88ea00159cafbcd56568b805c4f64d1e8c97169fe313921fc","glsl-optimizer/src/util/string_buffer.h":"7b88d1b1d9c6cfb8e93331813535c127289437c75f822029e9a3bca8ea6b52ee","glsl-optimizer/src/util/strndup.h":"0273c4fdb7482cd7746881a63d3998648c6d63415ba85af1d1860f0e0dc504c6","glsl-optimizer/src/util/strtod.c":"5cf610d8a37373cf37cfb7aae903525d943b2674b1f32594c70b0eb19a8c9697","glsl-optimizer/src/util/strtod.h":"237396def4e264d35ed4bedea00ef9a4ceab6d7a11a18c770d9747d22c69ed2d","glsl-optimizer/src/util/u_atomic.h":"c02e809526c6c09ba8fe51f50b2490d1b6c8e5c7f3c4031ae958250d098fc3bb","glsl-optimizer/src/util/u_debug.c":"8c060e379b816618f3dd22c9ea523c68b9425c76c36a7dfe5d6d375b337f5f4a","glsl-optimizer/src/util/u_debug.h":"e11e26edd9b9e4e6f8e6a435e69f4d9edda27e9a379f68f4c82ea2525aaaea68","glsl-optimizer/src/util/u_dynarray.h":"853d0fa6ff2261614488be624deb8a2b01e57c2c8eabc28578cbeed4ccc95694","glsl-optimizer/src/util/u_endian.h":"3ccea7e529740318d8a4b05c00db3adc9d1e292a52bdc56a05c9fae99209720f","glsl-optimizer/src/util/u_math.c":"c868a8c0886dc78f1b06b13404ba8b253090449045774dd56893ac9d75795184","glsl-optimizer/src/util/u_math.h":"a04e32e126db016413f9de0a2028a3e71737137463b1289eae576f884b06fcf1","glsl-optimizer/src/util/u_memory.h":"c5db17c724c70283ddbe04165722f6988d4e0eb9aa3602ae472feff016649af9","glsl-optimizer/src/util/u_queue.h":"92930ce236c0528a98b695f5cea8c5c6aa9683beaf71a2227bdc5d33d1b21506","glsl-optimizer/src/util/u_string.h":"c5a2f4ef576d1547bda12c4ea219179fefa54414977743ac094abcaf696ef6ca","glsl-optimizer/src/util/u_thread.h":"00b708459b27f9910d18db92c18cc65cfc618ac2b3cd144e45f8640057b10d58","glsl-optimizer/src/util/xxhash.h":"2f2aff2fc6c0c929f52cf6ae7314122124c5be026d41ad1c357608383c4a37ad","src/bindings.rs":"79993db2058bde39f99ef483d02560d33b1cb882f6a552319e8b86eb6f9021e1","src/lib.rs":"04be1554cd829eb40864b06d80b491dd48117a4e3a601c7d482117f7a0391e67","wrapper.hpp":"f3ea34cc496f7d90b9bfcada3250b37b314c3524dac693b2ece9517bc7d274ac"},"package":"913662ae8335df058d56e00f11340b20fa82e03e0276587797ef325ab01e50d4"} -\ No newline at end of file -diff -up firefox-146.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h.build-c11-threads-avail firefox-146.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h ---- firefox-146.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h.build-c11-threads-avail 2025-12-05 18:43:20.000000000 +0100 -+++ firefox-146.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h 2025-12-11 13:30:50.463371937 +0100 -@@ -66,7 +66,7 @@ typedef pthread_cond_t cnd_t; - typedef pthread_t thrd_t; - typedef pthread_key_t tss_t; - typedef pthread_mutex_t mtx_t; --typedef pthread_once_t once_flag; -+//typedef pthread_once_t once_flag; - - - /* -@@ -90,12 +90,13 @@ impl_thrd_routine(void *p) - - /*--------------- 7.25.2 Initialization functions ---------------*/ - // 7.25.2.1 --static inline void -+// -+/*static inline void - call_once(once_flag *flag, void (*func)(void)) - { - pthread_once(flag, func); - } -- -+*/ - - /*------------- 7.25.3 Condition variable functions -------------*/ - // 7.25.3.1 diff --git a/firefox.spec b/firefox.spec index 4315c8c..13d860e 100644 --- a/firefox.spec +++ b/firefox.spec @@ -256,7 +256,6 @@ Patch78: firefox-i686-build.patch Patch79: firefox-gcc-13-build.patch Patch80: wasi.patch Patch81: firefox-gcc-15.0-s390.patch -Patch82: build-c11-threads-avail.patch Patch83: build-seccomp.patch @@ -274,8 +273,6 @@ Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches Patch400: mozilla-1196777.patch Patch401: mozilla-1667096.patch -Patch402: D275955.1765540580.diff -Patch403: IWYU.patch # PGO/LTO patches Patch600: pgo.patch @@ -572,7 +569,6 @@ This package contains results of tests executed during build. %patch -P79 -p1 -b .firefox-gcc-13-build %patch -P81 -p1 -b .firefox-gcc-15.0-s390 %if 0%{?fedora} >= 44 -%patch -P82 -p1 -b .build-c11-threads-avail %patch -P83 -p1 -b .build-seccomp %endif @@ -595,8 +591,6 @@ cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysr %patch -P400 -p1 -b .1196777 %patch -P401 -p1 -b .1667096 -%patch -P402 -p1 -b .D275955.1765540580 -%patch -P403 -p1 -b .IWYU # PGO patches %if %{build_with_pgo} @@ -1270,7 +1264,7 @@ fi #--------------------------------------------------------------------- %changelog -* Tue Jan 06 2025 Martin Stransky - 147.0-1 +* Tue Jan 06 2026 Martin Stransky - 147.0-1 - Updated to 147.0 * Fri Dec 19 2025 Martin Stransky - 146.0.1-1 diff --git a/wasi.patch b/wasi.patch index 8e32b85..0a83f8c 100644 --- a/wasi.patch +++ b/wasi.patch @@ -6,7 +6,7 @@ diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz. if wasi_sysroot: log.info("Using wasi sysroot in %s", wasi_sysroot) - return ["--sysroot=%s" % wasi_sysroot] -+ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-146.0-build/firefox-146.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-147.0-build/firefox-147.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] return [] set_config("WASI_SYSROOT", wasi_sysroot) From 24fd754487b3a877964a4107475f5d39f7b46ac8 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 6 Jan 2026 10:15:20 +0100 Subject: [PATCH 542/545] build fix --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 13d860e..0acd0e3 100644 --- a/firefox.spec +++ b/firefox.spec @@ -207,7 +207,7 @@ URL: https://www.mozilla.org/firefox/ License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20250106.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20260106.tar.xz %endif Source2: cbindgen-vendor.tar.xz Source3: dump_syms-vendor.tar.xz From f146ba56bb7f12aaf088e5f0806c6bd3f9ec64e8 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 7 Jan 2026 10:41:20 +0100 Subject: [PATCH 543/545] Updated NSS version --- firefox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firefox.spec b/firefox.spec index 0acd0e3..45a8c2e 100644 --- a/firefox.spec +++ b/firefox.spec @@ -156,7 +156,7 @@ ExcludeArch: i686 %if %{?system_nss} %global nspr_version 4.37 %global nspr_build_version %{nspr_version} -%global nss_version 3.116 +%global nss_version 3.119 %global nss_build_version %{nss_version} %endif From 4705e57bd913d46c42632cb427a77deaaf17c6b1 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 7 Jan 2026 11:39:58 +0100 Subject: [PATCH 544/545] Added build-c11-threads-avail.patch --- build-c11-threads-avail.patch | 36 +++++++++++++++++++++++++++++++++++ firefox.spec | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 build-c11-threads-avail.patch diff --git a/build-c11-threads-avail.patch b/build-c11-threads-avail.patch new file mode 100644 index 0000000..73ed5f5 --- /dev/null +++ b/build-c11-threads-avail.patch @@ -0,0 +1,36 @@ +diff -up firefox-146.0/third_party/rust/glslopt/.cargo-checksum.json.build-c11-threads-avail firefox-146.0/third_party/rust/glslopt/.cargo-checksum.json +--- firefox-146.0/third_party/rust/glslopt/.cargo-checksum.json.build-c11-threads-avail 2025-12-05 18:43:21.000000000 +0100 ++++ firefox-146.0/third_party/rust/glslopt/.cargo-checksum.json 2025-12-11 13:32:52.599001257 +0100 +@@ -1 +1 @@ +-{"files":{"Cargo.toml":"010bb96167ff152e0e5ac30f9905dc749a3f038199b70c541c5d8cb97a185ee3","README.md":"4468e08c64c19977707d792bfab0080e35ff927b64990eab77873f8ba056ba1c","build.rs":"6a64610018701781af182c418a4355c9ac5d99d000be9457f0e38a7dadf7542a","glsl-optimizer/CMakeLists.txt":"42ce94744e82ffa000da8b64d81fc140e293b9f5da7dd4cf6b49e7404a2448d9","glsl-optimizer/README.md":"b18eef11a92d267d88a937b1154f7670ee433c730b102fdf7e2da0b02722b146","glsl-optimizer/contrib/glslopt/Main.cpp":"14ba213210c62e234b8d9b0052105fed28eedd83d535ebe85acc10bda7322dd4","glsl-optimizer/contrib/glslopt/Readme":"65d2a6f1aa1dc61e903e090cdade027abad33e02e7c9c81e07dc80508acadec4","glsl-optimizer/generateParsers.sh":"878a97db5d3b69eb3b4c3a95780763b373cfcc0c02e0b28894f162dbbd1b8848","glsl-optimizer/include/GL/gl.h":"1989b51365b6d7d0c48ff6e8b181ef75e2cdf71bfb1626b1cc4362e2f54854a3","glsl-optimizer/include/GL/glext.h":"2ac3681045a35a2194a81a960cad395c04bef1c8a20ef46b799fb24af3ec5f70","glsl-optimizer/include/KHR/khrplatform.h":"1448141a0c054d7f46edfb63f4fe6c203acf9591974049481c32442fb03fd6ed","glsl-optimizer/include/c11/threads.h":"56e9e592b28df19f0db432125223cb3eb5c0c1f960c22db96a15692e14776337","glsl-optimizer/include/c11/threads_posix.h":"f8ad2b69fa472e332b50572c1b2dcc1c8a0fa783a1199aad245398d3df421b4b","glsl-optimizer/include/c11/threads_win32.h":"95bf19d7fc14d328a016889afd583e4c49c050a93bcfb114bd2e9130a4532488","glsl-optimizer/include/c11_compat.h":"103fedb48f658d36cb416c9c9e5ea4d70dff181aab551fcb1028107d098ffa3e","glsl-optimizer/include/c99_compat.h":"aafad02f1ea90a7857636913ea21617a0fcd6197256dcfc6dd97bb3410ba892e","glsl-optimizer/include/no_extern_c.h":"40069dbb6dd2843658d442f926e609c7799b9c296046a90b62b570774fd618f5","glsl-optimizer/license.txt":"e26a745226f4a46b3ca00ffbe8be18507362189a2863d04b4f563ba176a9a836","glsl-optimizer/src/compiler/builtin_type_macros.h":"5b4fc4d4da7b07f997b6eb569e37db79fa0735286575ef1fab08d419e76776ff","glsl-optimizer/src/compiler/glsl/README":"e7d408b621c1b605857c4cab63902f615edb06b530142b91ac040808df6e22f7","glsl-optimizer/src/compiler/glsl/TODO":"dd3b7a098e6f9c85ca8c99ce6dea49d65bb75d4cea243b917f29e4ad2c974603","glsl-optimizer/src/compiler/glsl/ast.h":"3e68ff374350c49211a9931f7f55a485d8d89fc4b21caaffbf6655009ad95bf8","glsl-optimizer/src/compiler/glsl/ast_array_index.cpp":"92b4d501f33e0544c00d14e4f8837753afd916c2b42e076ccc95c9e8fc37ba94","glsl-optimizer/src/compiler/glsl/ast_expr.cpp":"afd712a7b1beb2b633888f4a0911b0a8e4ae5eb5ab9c1e3f247d518cdaaa56d6","glsl-optimizer/src/compiler/glsl/ast_function.cpp":"74f4fbd490e366b37f4715168bb3465ecd9334d4130942f75dcc8e80e8e7f027","glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp":"d0f798eb09271d41d068b9e7b18220d37f1ed0083300ab51eba30989698fe23d","glsl-optimizer/src/compiler/glsl/ast_type.cpp":"8eb790b24b26dfb72bdc333744b566c26d8464c5d47d20eae659461f5c4899f7","glsl-optimizer/src/compiler/glsl/builtin_functions.cpp":"454189d643c220fcb49116ee5c8a34f7b349aa67564040deb8607f6a41a15e70","glsl-optimizer/src/compiler/glsl/builtin_functions.h":"a37cad7ed09b522c5b8bec7b80115a36846e7ba6e0874a2a858e32f7f202c665","glsl-optimizer/src/compiler/glsl/builtin_int64.h":"619def6f3aebf180da3944ef08f159ab12a58b24767e41d8b985ac37ded54d62","glsl-optimizer/src/compiler/glsl/builtin_types.cpp":"afec060b62d6f3b00bfbf94e9fa5f96341ce096c128d1eef322791e6ed9cea4d","glsl-optimizer/src/compiler/glsl/builtin_variables.cpp":"6563bfb1345cbca4c77e00eef09ad152f3e1dc271d246a08c5ce9e1f4ce4250a","glsl-optimizer/src/compiler/glsl/float64.glsl":"1072fd888be48c2a7a5117cd2d92a65f034965a66375f598bb856bff5d7be766","glsl-optimizer/src/compiler/glsl/generate_ir.cpp":"e5f0175370a0d07f93c48d3f0f1b8233d12c64a7b02de02dcc753ef7b398ef0f","glsl-optimizer/src/compiler/glsl/glcpp/README":"a0332a1b221d047e9cce5181a64d4ac4056046fd878360ec8ae3a7b1e062bcff","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.c":"2d179879b1ffe84f58875eee5b0c19b6bae9c973b0c48e6bcd99978f2f501c80","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.l":"e4c5744c837200dafd7c15a912d13f650308ea552454d4fa67271bc0a5bde118","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.c":"03494f9ce1cb82260506e2559e73a3eeb622c4bd51b65eaa0a2c3351862bd4c8","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.h":"264d9a18421cde255ce34a0a62b3d8e73465359f0d167e64aa3973062aae5bdd","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.y":"fafb66e3a8f149d19e085f18a4273ba6d4c11af9e9a01d665cc784dddf97b79f","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.c":"37ed294403c2abfd17fd999d1ae8d11b170e5e9c878979fefac74a31195c96b0","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.h":"85ac8b444bcbd0822b66448a1da407b6ae5467b649f5afaf5c58325bd7569468","glsl-optimizer/src/compiler/glsl/glcpp/pp.c":"a52d94f1bcb3fb2747a95709c4a77c25de7eea8354d2b83bb18efd96976a4473","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.c":"d11aeb3acfe966d1b78f1ee49804093f2434214c41391d139ffcb67b69dc9862","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.h":"abbf1f36ec5a92d035bfbb841b9452287d147616e56373cdbee1c0e55af46406","glsl-optimizer/src/compiler/glsl/glsl_lexer.cpp":"272b9fc1383d72b81bfc03fa11fdf82270ed91a294e523f9ce2b4554bd3effa9","glsl-optimizer/src/compiler/glsl/glsl_lexer.ll":"2b57d9f9eb830c3d7961d4533048a158ee6f458c8d05c65bea7b7cfbc36e4458","glsl-optimizer/src/compiler/glsl/glsl_optimizer.cpp":"f8095d20629d0af70be930b0612e169edb274551a1d25a3cd1bf9995a11ce2e8","glsl-optimizer/src/compiler/glsl/glsl_optimizer.h":"22e843b4ec53ba5f6cd85ca5f7bad33922dca8061b19fb512d46f1caca8d4757","glsl-optimizer/src/compiler/glsl/glsl_parser.cpp":"126baf368d525aba301854e3d91ba60b5aee32e1102376af71416f32cb95ec48","glsl-optimizer/src/compiler/glsl/glsl_parser.h":"2ea9a50716098a8f7bef782d2a030d757b68da73afb01b4d4940d3e8381d44e8","glsl-optimizer/src/compiler/glsl/glsl_parser.yy":"6b1fd1576b29fce005dff744a6dbd0219e4c695c361d61864e1f3a8d6fa6b764","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.cpp":"aad64b5b66467da650091430681e8c6a820cf3cadc4db3c160bf2f15875390ae","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.h":"71fd0e92bbdb193dfb067d7bfdb1200d77392be2fbd0cbfc9ca89d1bb4c7e741","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.cpp":"6660fb83c0ddddbbd64581d46ccfdb9c84bfaa99d13348c289e6442ab00df046","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.h":"24682b8304e0ea3f6318ddb8c859686bd1faee23cd0511d1760977ae975d41bf","glsl-optimizer/src/compiler/glsl/hir_field_selection.cpp":"72a039b0fcab4161788def9e4bedac7ac06a20d8e13146529c6d246bd5202afd","glsl-optimizer/src/compiler/glsl/int64.glsl":"303dbe95dde44b91aee3e38b115b92028400d6a92f9268975d607471984e13eb","glsl-optimizer/src/compiler/glsl/ir.cpp":"2b4741cce90b5d4abff5d719c7324e2693c67294d4d99736cb241554adb281bc","glsl-optimizer/src/compiler/glsl/ir.h":"990b1c74447c4eb4835353ccb0ed9aea644f97fc1129ef1739cd935075d85d2e","glsl-optimizer/src/compiler/glsl/ir_array_refcount.cpp":"8cdc1cffe01e42e0566fa2193a75f789628e8025ad1b82f0ee6f204451b7f9f7","glsl-optimizer/src/compiler/glsl/ir_array_refcount.h":"75f06ec81342b379096ca52e1dc0fd5f19a11ff8e9b58203c20628179d644c12","glsl-optimizer/src/compiler/glsl/ir_basic_block.cpp":"1e2920b1c0ecb08424c745c558f84d0d7e44b74585cf2cc2265dc4dfede3fa2f","glsl-optimizer/src/compiler/glsl/ir_basic_block.h":"81be7da0fc0ee547cd13ec60c1fcd7d3ce3d70d7e5e988f01a3b43a827acdf05","glsl-optimizer/src/compiler/glsl/ir_builder.cpp":"daba29c5a1efdd5a9754f420eb3e2ebdf73485273497f40d4863dadeddb23c0d","glsl-optimizer/src/compiler/glsl/ir_builder.h":"2822e74dd3f6e3df8b300af27d5b11ea2dd99d0e5e7ca809b7bbcce9833c483c","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.cpp":"8c6df5abf2fe313363f285f171c19ca6c8ee4f3bc2ed79d33c0c88cc8be45c48","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.h":"799852adc3a0e54d04080655e7cebfa0d3bf5b6ffed5d8414f141380665d4db7","glsl-optimizer/src/compiler/glsl/ir_clone.cpp":"d897a4e1f5bbec4a6a2f15044c1be9a4d13899c73be77335b041049a4589aa5d","glsl-optimizer/src/compiler/glsl/ir_constant_expression.cpp":"78bd87ddb09db67f6c499067728d72aef4f16aa02721a99a4b769d1e0cfa9010","glsl-optimizer/src/compiler/glsl/ir_equals.cpp":"bca28533a6310b0fc152b56d80872368f1510dc62ed6e8ac199b9ffa7fac02e7","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.cpp":"7e918d4e1f237eca01396004015865ce345afe32a876c9dbc6728576a1a7eae4","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.h":"f45b66aa9497520e7e08e612d24b308477c34477fbd963ee9320eac664957f16","glsl-optimizer/src/compiler/glsl/ir_expression_operation.h":"cc9f10727dbd26cac506804f51456302c702650f9eeb59054a7e1575d5cf6687","glsl-optimizer/src/compiler/glsl/ir_expression_operation.py":"7b86c96021b9fbe165957f4ecb0b612fefcde1c2cf3c6d75e3cdb22e369216ba","glsl-optimizer/src/compiler/glsl/ir_expression_operation_constant.h":"9ad3346416392e3efa11e12ecf2feca7453c5253d241eb96c91dfb85d4f2b971","glsl-optimizer/src/compiler/glsl/ir_expression_operation_strings.h":"a6826daf496a8b9e89885bc2a161ac3445d501b23c6e0ac33e2c01b506b273c8","glsl-optimizer/src/compiler/glsl/ir_function.cpp":"7537365fc0fbe4b37a26b9a2146cc64d3e9a774d60eab63b65002ad165ae8fc7","glsl-optimizer/src/compiler/glsl/ir_function_can_inline.cpp":"faddbf112187a048d502716a3fb82570a322299ba2a3abd79388382c82040bfc","glsl-optimizer/src/compiler/glsl/ir_function_detect_recursion.cpp":"9176973eaf5c0a984701f953bb7a80f37dca43d59b5bce50fc69b3f02f2902d7","glsl-optimizer/src/compiler/glsl/ir_function_inlining.h":"9739493f99c489987d650762fccdd3fb3d432f6481d67f6c799176685bd59632","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.cpp":"3725861fbe2b98e0617f52d3b14cf6d3b25fb5ec00f5ef5d308b03642f592767","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.h":"e0560210e966c0c31e4ca843e80ea154e64db5a444b8c2df845b6ba5b3a43fc1","glsl-optimizer/src/compiler/glsl/ir_hv_accept.cpp":"caf7ce2cd9494aadd3c58bcf77f29de58368dc9e347a362bbf37f8bda9509b80","glsl-optimizer/src/compiler/glsl/ir_optimization.h":"8b3dcfc7f9e96b21a8dd47a0040d90be483a9e67a2cdce3a697188fb758d4630","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.cpp":"f8e34a983452be0dcb5a695e9c8e895eead24f9e540992a8afe510ae85da4c4c","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.h":"1ad1bd3efd1ace39051c13f904c05fd80425d329444f9a8d47fd6d948faf46e0","glsl-optimizer/src/compiler/glsl/ir_print_visitor.cpp":"643f5a68aae3fb37267fd793f1216d1cfdeb2c09338c26b1f30e4c6deaef4de5","glsl-optimizer/src/compiler/glsl/ir_print_visitor.h":"4573eb93268a2654c14b505253dd651e2695d43dc745904d824da18305269b95","glsl-optimizer/src/compiler/glsl/ir_reader.cpp":"06bfba802c8354e5a8b2334b6d78d6297de18235bedd3f8fbb382c89870b02f2","glsl-optimizer/src/compiler/glsl/ir_reader.h":"63e3f7f1597936a7011d5b520e171b197bf82bee6c1560d822c3edf5aaa6f9e9","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.cpp":"84b5c5d746555adca85759c2912fe48010232b7c1c0bd2cf03bd04067a85e66f","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.h":"fd8c561b71085d3211fff85ed514fecb299d8ce19a04bc063419a55b6d840525","glsl-optimizer/src/compiler/glsl/ir_set_program_inouts.cpp":"ab9f115ce9e7f312d9c7978340ced0dc4ae6d13a80e08442ba9709d11d50cae5","glsl-optimizer/src/compiler/glsl/ir_uniform.h":"683ae6896b1a08470c090be5f822fc31cd434eab9216e954b9bba24a46975109","glsl-optimizer/src/compiler/glsl/ir_unused_structs.cpp":"9c1620c45f2fc071fe5ed828472040b14c5f42effe06aa0e3b8352c95ef78786","glsl-optimizer/src/compiler/glsl/ir_unused_structs.h":"13387b49c23093575276b25b9dfd31fedd8f131c5c4f3128ab04cf03e15b5295","glsl-optimizer/src/compiler/glsl/ir_validate.cpp":"6b232be5999a86ea278f4f15b2832d76843246509118d924243055a3b9b0299f","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.cpp":"2764a3cad937d53f36db7447c3a5b98b04bf153acf81074d971857fc5bca460d","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.h":"b0668e3eb1501ef65e38fe12830742ecb3d28e6039f30e366c8924efc29b4a39","glsl-optimizer/src/compiler/glsl/ir_visitor.h":"f21b3534c3d66d5fb707d1581fece7e1eb043523afbaedf89918cfb031c6df94","glsl-optimizer/src/compiler/glsl/link_atomics.cpp":"360f0209e11f367ba358223597b0a118bae095bff16337cf03f1fb89c5b80ca6","glsl-optimizer/src/compiler/glsl/link_functions.cpp":"de7895da8aa33a1e3c2c1eb2fdaf267ab5d1fbfdb79ae2e67f95211e946e294c","glsl-optimizer/src/compiler/glsl/link_interface_blocks.cpp":"1926cfa73810704eb19b916c1b2cdb9321155e2f98b2a0a57c7c3c6e960540cd","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.cpp":"1e14e06ca3b2c1089cfba2e8eaf0c1f373d9d6374b6082f320962dd71ae09611","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.h":"fd58c155af645295bb6aec08797889de586f4d919731de2bce57e8dce59bb048","glsl-optimizer/src/compiler/glsl/link_uniform_blocks.cpp":"09589f49776dce32e6c4044937de7e0c839a9754ad31960148f8f9e010658997","glsl-optimizer/src/compiler/glsl/link_uniform_initializers.cpp":"bf98e08c12db466acf9623cbeb8fa8e3b4002512722e7a6521287f558a099f37","glsl-optimizer/src/compiler/glsl/link_uniforms.cpp":"84bad5b1377362cecf259b05124239be5220b03ce1c0c61b59bd9a47e4379af2","glsl-optimizer/src/compiler/glsl/link_varyings.cpp":"a5f1a53e7c80d635515fe808ff223d89fef1767abb0f2b7aa28fa6773dca353f","glsl-optimizer/src/compiler/glsl/link_varyings.h":"b9dbe018f038df69763df2e928742ce81bbc6e3aaba26f50621e30a6d9aa6220","glsl-optimizer/src/compiler/glsl/linker.cpp":"40b1ecd5d4f6c7f13d5a87ce390561a51fdf6f3fcd9b2197b9c88b03a773ba94","glsl-optimizer/src/compiler/glsl/linker.h":"ecf94b4ad75ef461c27c557fda4bd25f34c91930822b8e1d729ec84520d4a049","glsl-optimizer/src/compiler/glsl/linker_util.cpp":"1663ad88e2a369305659aeeffaedb5bd752cf76340a2ba5797fc0bf600633cf9","glsl-optimizer/src/compiler/glsl/linker_util.h":"6db788daf9c8e87ae2764b61a8b37ebe419e69c1b82ddee01986e37c978c6993","glsl-optimizer/src/compiler/glsl/list.h":"b1f46ce0e552fe7c45b2a19408a9d97662e23e4b182ab335491c26f8cf25886f","glsl-optimizer/src/compiler/glsl/loop_analysis.cpp":"57ecd573477c68091c7cc99537faa7139a8f395935e3d4f10144cefdefb5a611","glsl-optimizer/src/compiler/glsl/loop_analysis.h":"a85f045a038ee5b5176063e85d7988865862c44ab0580f771b993a042d0b69cc","glsl-optimizer/src/compiler/glsl/loop_unroll.cpp":"bd4292ea2809f5a669bcb76ceaa1ac365772dcd638c579c3ed10275214901a54","glsl-optimizer/src/compiler/glsl/lower_blend_equation_advanced.cpp":"8cfbef140d9c4b4d2f57bfa05c9c374d31a121d0f87afce94333f049023b654a","glsl-optimizer/src/compiler/glsl/lower_buffer_access.cpp":"1ae221c3c7a95aeb867207e7a742be635f91b406c157747bfd6ddf10274d97fb","glsl-optimizer/src/compiler/glsl/lower_buffer_access.h":"807886953a576a323591798cbca5e2df24295ea893b28affd8ffb5926cebaa04","glsl-optimizer/src/compiler/glsl/lower_builtins.cpp":"4d81afc32cf58e1481fcb5e42888ab93dbe6820310a20ff7a9982b77b2152d9b","glsl-optimizer/src/compiler/glsl/lower_const_arrays_to_uniforms.cpp":"608403f0eeeedf21cfcd3014116e0f44e28cbdf6c4c32aac7e613e64e30205e1","glsl-optimizer/src/compiler/glsl/lower_cs_derived.cpp":"179905cd47a294122adeb5b0abfed6f2f67782dcde21b544d1ee2c1985154e66","glsl-optimizer/src/compiler/glsl/lower_discard.cpp":"3b361b2db0004d544d64611cb50d5a6e364cf6c5f2e60c449085d7d753dd7fb0","glsl-optimizer/src/compiler/glsl/lower_discard_flow.cpp":"f5c29b6a27690bb5c91f196d1a1cf9f6be4f1025292311fe2dac561ce6774dee","glsl-optimizer/src/compiler/glsl/lower_distance.cpp":"a118c85493d5d22b2c059a930c51a5854896d4b1dade76598eaa985e5a3dff8c","glsl-optimizer/src/compiler/glsl/lower_if_to_cond_assign.cpp":"469e617757fd1728709cce021aac5c8da05ee503bf5366977bdc4ef7a6d83950","glsl-optimizer/src/compiler/glsl/lower_instructions.cpp":"6ff5c396abe40d8a2145d571e99e2bbe9143393e15aafc28adc2803a01d821b6","glsl-optimizer/src/compiler/glsl/lower_int64.cpp":"d1ed41196880dd53c7b13e2782f9423f8442bf1d46186e8be92b1b66218a83ee","glsl-optimizer/src/compiler/glsl/lower_jumps.cpp":"34de7b493f281589fb0c2c0f6e885d0a0fabbe7a4e97a73de374dd714777a58c","glsl-optimizer/src/compiler/glsl/lower_mat_op_to_vec.cpp":"dff7a308edc4846c348ed4225c6699a9c75abac68d88f41f85954276552779f4","glsl-optimizer/src/compiler/glsl/lower_named_interface_blocks.cpp":"16063ac127bff75a68272070ab11c21c25101edbff62b4c68f4983b4cd941af0","glsl-optimizer/src/compiler/glsl/lower_offset_array.cpp":"3b00773399135aea85746a5a68b96ef000bc6841be1a2c8e6f25c516628b0949","glsl-optimizer/src/compiler/glsl/lower_output_reads.cpp":"a0fc9975d5aa1617e21fc6c353659a9802da9e83779a3eef4ec584f74b4dadc5","glsl-optimizer/src/compiler/glsl/lower_packed_varyings.cpp":"7550099d4ae123d71541c2fc88bc04fbfe9271ec75d7e210987d1c8cac3cf3ea","glsl-optimizer/src/compiler/glsl/lower_packing_builtins.cpp":"79a13d161fe505a410ab948d92769395708693ec888153630fa240e5b97e356f","glsl-optimizer/src/compiler/glsl/lower_precision.cpp":"f82a185b879872b977a1787d8061b9a80bc4cf8db1b970db6efba2ad9cc20fa2","glsl-optimizer/src/compiler/glsl/lower_shared_reference.cpp":"ea2dccf50a83bc19391bf6b7ab6aa53c0005f427af4066d25140340af9a4beef","glsl-optimizer/src/compiler/glsl/lower_subroutine.cpp":"f69fa53650eeb6f2944fce4d36a6e0a423e6705f3a3bd3389c7fadb83cfc8802","glsl-optimizer/src/compiler/glsl/lower_tess_level.cpp":"b196c9d424c0569f3e85d75c2d125af21566cb113d69036db87c0990703e0fa7","glsl-optimizer/src/compiler/glsl/lower_texture_projection.cpp":"4d247f244272adc8250fd888d8d932a140dd5de4d1efc7a58492c3c2b8291527","glsl-optimizer/src/compiler/glsl/lower_ubo_reference.cpp":"89bdbc6c1669230c644c0857db1ce2781ec61d349ecd08c7914146e1f4750a4a","glsl-optimizer/src/compiler/glsl/lower_variable_index_to_cond_assign.cpp":"fce930f29ac9405b297d1f749d68f59506b89c70b4ee1b1ab8cf49a34cc71ecf","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_cond_assign.cpp":"3c67d851a11a55fad1c49a550f3a0cfe50892d33a3f238ce266cd829eba510a8","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_swizzle.cpp":"f5ec666b73e1415cbab32519a53605ed385f3b03e889560373dbce69dda5000e","glsl-optimizer/src/compiler/glsl/lower_vector.cpp":"f7c13f5572ebe09b6a71553133b2cf003cd4b77b9657600672ee3b21bf890725","glsl-optimizer/src/compiler/glsl/lower_vector_derefs.cpp":"b05793da6dd620a531b43df5af8b2ecbc37b9db0c88910f5724ea10bcd057e19","glsl-optimizer/src/compiler/glsl/lower_vector_insert.cpp":"fee772ec17eea5e86a529bf9c5fa2ee0d29a5982bb75ebc6d68ed36cd19aa299","glsl-optimizer/src/compiler/glsl/lower_vertex_id.cpp":"690e8715182e03fead5cc5a35251fb4f41b357e4c71a1dfbc4bd7be19862b56d","glsl-optimizer/src/compiler/glsl/lower_xfb_varying.cpp":"58c0e8b270e4bbde54250be03cdb2f36966bcafb785372ad2e2b786835df7f9f","glsl-optimizer/src/compiler/glsl/main.cpp":"ae5e88abbbc8a12f769e1296bad938b9d7398cc6da0d3d0caeceeeb876536850","glsl-optimizer/src/compiler/glsl/opt_add_neg_to_sub.h":"f5054944bfd068810629080d0ea11df78b3f57a8f86df75e13ca50157ad1964d","glsl-optimizer/src/compiler/glsl/opt_algebraic.cpp":"25f45b20e1972ee8c789177a1aeda6e4286c25db2eae3a43ff83029ae64969c0","glsl-optimizer/src/compiler/glsl/opt_array_splitting.cpp":"19d3ce0e815438f4df9ab2890e767b03a4f3f191b53bb30c0217cf2ae6a95430","glsl-optimizer/src/compiler/glsl/opt_conditional_discard.cpp":"0e44e0e126711a3725c1f3a2aa65ff03c381fed08680ffc30101aae60f716c4e","glsl-optimizer/src/compiler/glsl/opt_constant_folding.cpp":"a088d04d9b45f9e55e235835648f614c89b7803c03a6d4f6a6d1a6bc1f0228bd","glsl-optimizer/src/compiler/glsl/opt_constant_propagation.cpp":"8a9440d77ecd6dcf13e683cbb99943aab6311c8fd4b5f6a9189a8d4f270746f4","glsl-optimizer/src/compiler/glsl/opt_constant_variable.cpp":"63d3ccd4dd09f19c9cf1a2f51592111bed41284504f29f3c0de4cadebc439a37","glsl-optimizer/src/compiler/glsl/opt_copy_propagation_elements.cpp":"ffa0f50863995e0d2e31f55a52e82319edc71e520987bebd7f7e561ea331c64b","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_variables.cpp":"84e8747b948232f01dd56b428b9315f96f9511f605f240119fc446fae28981a9","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_varyings.cpp":"761523e88f5b3ba785170f4d7205e94fa99acb7e74d29efbe40e1c010e1dbdb3","glsl-optimizer/src/compiler/glsl/opt_dead_code.cpp":"fd1ba2da7337d4e5dad17f5c2d73d9cc8880305f423e85d64cf94553588fa401","glsl-optimizer/src/compiler/glsl/opt_dead_code_local.cpp":"969a598b4df322baf222258a66cd64a326ea20e5b3125be9d8d1771f522c69e0","glsl-optimizer/src/compiler/glsl/opt_dead_functions.cpp":"774cae6536d02edf26e996a2a895e1f62d5098f16dc96b44798b4fc731a9a95f","glsl-optimizer/src/compiler/glsl/opt_flatten_nested_if_blocks.cpp":"3696a5c55f02e20056e085bc2714f73ac992f221b6f3387d655068e86b512046","glsl-optimizer/src/compiler/glsl/opt_flip_matrices.cpp":"44f0fe05b49329667671f88c96dc86ab3fe1459ff7b87f2b2d88de2d49829f9f","glsl-optimizer/src/compiler/glsl/opt_function_inlining.cpp":"fb56a33c90419a01676b57cbd91d0674a54cca40e6defaacc88dd33facebc131","glsl-optimizer/src/compiler/glsl/opt_if_simplification.cpp":"ac406eb35e379c357641d6c5749f50c65961455924d3dc884e2b90046fa92c5c","glsl-optimizer/src/compiler/glsl/opt_minmax.cpp":"8abd59d3b14ef60ff14a9c69660e6945f5cf10b97edb4afebe56be3f81d96316","glsl-optimizer/src/compiler/glsl/opt_rebalance_tree.cpp":"8bb6329dc0f299042368fc81934c2df019b45ab9f7aa0415d4e57b8d1ff98c9f","glsl-optimizer/src/compiler/glsl/opt_redundant_jumps.cpp":"222c73e2ac7a938ebb6428cc6c780c908ff6156d8ff935b04fed93a48fc10496","glsl-optimizer/src/compiler/glsl/opt_structure_splitting.cpp":"2edc79cc13f3177934e0443ad62f5976a1991f01f86ea303a803434849b13a47","glsl-optimizer/src/compiler/glsl/opt_swizzle.cpp":"015d0abddfe507f67c4b96c82988d861d018ededf7bf055e2bcbe9ea92da694e","glsl-optimizer/src/compiler/glsl/opt_tree_grafting.cpp":"46d28ac983ea244a4315bdc0e8892979ec4d1f9b9a96ac8a8a08006d9bc5e878","glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp":"d80ee43bb97d9f016fb9c5e1e06f5b2afa569811f368ba067be794ec11d085fb","glsl-optimizer/src/compiler/glsl/program.h":"2982447e2abd35371e273ad87951722782a8b21c08294f67c39d987da1e1c55f","glsl-optimizer/src/compiler/glsl/propagate_invariance.cpp":"080943e21baa32494723a2eefb185915d2daae1f46d6df420145c5ad6857e119","glsl-optimizer/src/compiler/glsl/s_expression.cpp":"1ced972bc6ecc8eab4116ea71fb0212ab9ae5bcc0be3b47aa5d9d903566b3af1","glsl-optimizer/src/compiler/glsl/s_expression.h":"65b847e30e22a809b57d0bc70243049c99d9c6318803c5b8d0826aba55dc217e","glsl-optimizer/src/compiler/glsl/serialize.cpp":"be0eb4251348a9d921acb839a5c48c6023a2e9d116d602bb0432787ab623655d","glsl-optimizer/src/compiler/glsl/serialize.h":"57425732eba1233d928e5f07f88b623ce65af46b3bb034bf147f0a4b7f94f9a1","glsl-optimizer/src/compiler/glsl/shader_cache.cpp":"e0c5c433f2df3fccdf1d61281bfcb0ee5633433339b97c697d64db99611cbaaf","glsl-optimizer/src/compiler/glsl/shader_cache.h":"9217164d8d7f54aca0fe5922c7187095a6ae0cb703b196b79805aeef07a7e697","glsl-optimizer/src/compiler/glsl/standalone.cpp":"8e6c416a14d631261917a5fe4cc91880c287b22b2dfd70eb22028289a8fa5364","glsl-optimizer/src/compiler/glsl/standalone.h":"a7c397d1dfdd1e7fb2cfe99db35cd9df93251e642059208533202b7f20497f83","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.cpp":"970d14b7a9d58e5270321f97bf5d57795558b1c570a56678e04a65b26c60bf4f","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.h":"d921a617ea82b9e49413314492a645c44356de503581b1be3f1b57de236e480d","glsl-optimizer/src/compiler/glsl/string_to_uint_map.cpp":"d824bf5b839bd39498dc9e457103cdbe3e5289ddf7564107c27b1505948dd31f","glsl-optimizer/src/compiler/glsl/string_to_uint_map.h":"e2f18e66359c9d620e085de7f4a334a47df9c66e65a5bfe8b734c627bec04104","glsl-optimizer/src/compiler/glsl/test_optpass.h":"b27b8f35f5387e7ce4982bb51c7b63ccf14f91757f3108a5d02ed006925bb8a0","glsl-optimizer/src/compiler/glsl/xxd.py":"376484142f27f45090ea8203ae2621abf73f06175cb0ee8d96f44a3b9327f4bd","glsl-optimizer/src/compiler/glsl_types.cpp":"044bb6754f45419a3151e7a25c39202a82009ae3c6bc54ff7f0bb4258a5deefe","glsl-optimizer/src/compiler/glsl_types.h":"fd899a42f34ddeb8601bc3cd6c5e3aed82fc8aef4042dde1b39b3c01e1dcc219","glsl-optimizer/src/compiler/shader_enums.c":"436bff5216b11b0980bdfada5885fc6ac9afa2037a3027fcd6eea2a8635597ac","glsl-optimizer/src/compiler/shader_enums.h":"13220442a5c02e83540cf2c0ad4f8417b2fbda5f2586dec4e92082544c937cdd","glsl-optimizer/src/compiler/shader_info.h":"4c5453e81197ca83593ee4f365074b23530f2ab21c78e1733b63dec6f344c12a","glsl-optimizer/src/gallium/auxiliary/util/u_half.h":"3c2b37bda3ccb64387e44b723d29cf9046decab1a893bf42d842e9603398bdee","glsl-optimizer/src/gallium/include/pipe/p_compiler.h":"c75620096ce8523dae90599e50aa2ef6468d3b0e368a77795edeb20dd1abfc0c","glsl-optimizer/src/gallium/include/pipe/p_config.h":"a27692fc35f9e55df3224b7529e66b3001e911e94e6bc5f8f569e493e1ee3fb7","glsl-optimizer/src/gallium/include/pipe/p_defines.h":"be26d68c0acc67c5e44788c6299716a9eee415fd81d7d747e3738a829e3b6b38","glsl-optimizer/src/gallium/include/pipe/p_format.h":"5674215fc41d27496f037cf837717daefbf23ebb38d40ace7c0c414bc08182b0","glsl-optimizer/src/gallium/include/pipe/p_state.h":"d600593aba5f5a17072a6c38f6baa81e01c7994b0174250f7e433bb41684b702","glsl-optimizer/src/mapi/glapi/glapi.h":"73632a625c0ddabc401205e8b5a81eb8af8506868efe4b170d7979ec3619e9c5","glsl-optimizer/src/mesa/main/config.h":"5800259373099e5405de2eb52619f9de242552a479902a3a642a333c8cb3c1e7","glsl-optimizer/src/mesa/main/context.c":"2f3208473d99c94f734b1137ba91889d4a1babb9e7534bf1dc85d851ee98274e","glsl-optimizer/src/mesa/main/context.h":"cc7e4194797db9d007f01884e23d786c453b3860821f7f2ddcdf0f1bf3f8ffb1","glsl-optimizer/src/mesa/main/dd.h":"6a964acd06b6c2d88700e69fb75fe3c6b3b3d45bbc41db24f3f897a29695fe0c","glsl-optimizer/src/mesa/main/debug_output.h":"7312422e90b8c0e34028ac27280e438139b5cba525c99deb3ac883cd3d87e452","glsl-optimizer/src/mesa/main/draw.h":"7eaef3a9e27a60ea6f7937109bf3a6190b831162fde0479abb12077ce27c353d","glsl-optimizer/src/mesa/main/enums.h":"87d562a6764f51c014a2274fa7c3aca17c04441537ddd56b2554f13c6fffea92","glsl-optimizer/src/mesa/main/errors.h":"c79444b5df289c90fbb22a33b2d0c23917d9fc4510960088f0b79e53bb56b1b2","glsl-optimizer/src/mesa/main/extensions.h":"a38b2f87cc93c513994281350d69e06c84ff8eded5313ec0a1be33f375e0ebbd","glsl-optimizer/src/mesa/main/extensions_table.c":"17642d1a8c9a0bf2bd61060052d33ff14a005d2b962e6cf91465797a50851e85","glsl-optimizer/src/mesa/main/extensions_table.h":"2c879571c238d2e14461031ac740372fd0f9ac3a34c0d5541bb9b7ed4c0376c8","glsl-optimizer/src/mesa/main/formats.h":"02e2f7ec3e39286cf9f27e2641043e6df8ecb1dfde9e643313210e214af2a929","glsl-optimizer/src/mesa/main/glheader.h":"58217b33eead6aa6b23cd4a291cefeaa6cb84e465f4960daffca97c44d6d1c35","glsl-optimizer/src/mesa/main/glthread.h":"51fb2711f77e7eafcfc52d29d5b844978832b24c930d88accd48d143a6eb9c6f","glsl-optimizer/src/mesa/main/hash.h":"7e7f782034c16a8e693de48e00c31d4a90b0129f4029fd074033d7d16ccbe718","glsl-optimizer/src/mesa/main/macros.h":"73d15ddfd64f2b57b9b2ffeeb993b9c2c0899a80563e9d6ff337b11ccbe6eee5","glsl-optimizer/src/mesa/main/menums.h":"5dfac0e2279d60b0cd0c7b9fc2a5021620d0f6282ed2e738c420214e3af152d3","glsl-optimizer/src/mesa/main/mesa_private.h":"edda678b93438944279a551f663b8858ad84814a9fc88ba9672ef195599c24ae","glsl-optimizer/src/mesa/main/mtypes.h":"6efddefa099e4d2e3fdd97f0055644f47aba21711385edfeabc2d9b0676f2eec","glsl-optimizer/src/mesa/main/shaderobj.h":"9f0dfe96d0c2154201adef942bd36053533ac7b2492fb3786acda5bea514c75e","glsl-optimizer/src/mesa/main/uniforms.h":"4e331e6ad6e9cbded978b4082dbe0a57c1f8f01327446bb6892bfc179976c38b","glsl-optimizer/src/mesa/main/version.h":"9d0a13a758099302dc55cf7d045791834a89b0f9d4cf17b2692259b369a8a9a1","glsl-optimizer/src/mesa/math/m_matrix.h":"a37b19f182e070db3df93b0ede43c22fb8be8c2906504133ee6dbd7db1185d8b","glsl-optimizer/src/mesa/program/dummy_errors.c":"1820e305515b4c5e041f5e1623266a48ec8f076a155310be7d60637101f593e4","glsl-optimizer/src/mesa/program/ir_to_mesa.h":"b47f58d22e3ca2ae42d52501ea769d15c4476834944fa97eeccd3a3439211d00","glsl-optimizer/src/mesa/program/prog_instruction.h":"ab3832152a7e144b59e5a2264b2c29db56d93be31e76bbd958527a56771b40eb","glsl-optimizer/src/mesa/program/prog_parameter.h":"ba18c743284eadbc837c2c364c73e5d372321a7637a76e589d8d39fe8b5de225","glsl-optimizer/src/mesa/program/prog_statevars.h":"fc413698f84bc52d45fdeae0471934ee9904bfb7eac1a2b5f70446e54bcbbdca","glsl-optimizer/src/mesa/program/program.h":"1f01026a4eff440a3f122fd9b519d03546fe7f7d8be60dca834e95a2f8fbbfd2","glsl-optimizer/src/mesa/program/symbol_table.c":"6611cb9f078035bf5ff8c9112093a6c7d99f8af99a3931d0c07f227cc72283ea","glsl-optimizer/src/mesa/program/symbol_table.h":"631dc35ac48d5e87962d45507461920f6575610960ffcc42a08cefeb43300cda","glsl-optimizer/src/mesa/vbo/vbo.h":"6eb1dcd9a08c92f276c5fe08da184ff9d455d1be421913b8ad732a7b65e858fb","glsl-optimizer/src/util/bitscan.h":"9e49e694e6b34fe035bc685f32588827eb8cbe7d82878963c7ab52843e1c16aa","glsl-optimizer/src/util/bitset.h":"c40f78515c6230fed18345c6751ce33833a49da7a27901c7e6d7340cbdcbc5e7","glsl-optimizer/src/util/blob.c":"8f729846f66efc9c15485cc5fc24c6ec861fc1fecb2f652573f2a237d481b791","glsl-optimizer/src/util/blob.h":"93e1eaac866b9a7cd6fc03b533c18fb2edf0e97f03395eff4f3a605c4fc14d0c","glsl-optimizer/src/util/compiler.h":"79e3bf40a5bab704e6c949f23a1352759607bb57d80e5d8df2ef159755f10b68","glsl-optimizer/src/util/crc32.c":"2f3467a046b3a76784ecb9aa55d527698c8607fd0b12c622f6691aaa77b58505","glsl-optimizer/src/util/crc32.h":"59bd81865e51042b73a86f8fb117c312418df095fed2d828c5c1d1c8b6fc6cd4","glsl-optimizer/src/util/debug.c":"c3d68e9752ccc19e66c669562cd113cf1d0ac83cbb30174789e7fb8d1df58f9c","glsl-optimizer/src/util/debug.h":"50068d745c4199ccbd33d68dd4c8a36d2b5179c7869a21e75906ddd0718ca456","glsl-optimizer/src/util/detect_os.h":"343a8790d17a3710c6dd015ee367f84e3902ff3f2e36faca2bf93f9d725d3574","glsl-optimizer/src/util/disk_cache.c":"f533937e5a4fffe76e2739ef4b6b1e1da097d96d63eb808e68ebbc7027641c23","glsl-optimizer/src/util/disk_cache.h":"e83314fb14134a8e079b15e470a6376ba5a8253701f048c890a62b7e55d64bc8","glsl-optimizer/src/util/fast_urem_by_const.h":"e108fce804616c47d071dfe4a04163eec1126e448ed1aa89abb6b3a6d772bd5b","glsl-optimizer/src/util/fnv1a.h":"ab2596f19c6adf431ae27618f62c5743e24ad23ef83bb359a4c4c218245ab459","glsl-optimizer/src/util/format/u_format.h":"4cdfc0c59cbc99a092e5ec5a396910f2d93b9643e5d8141050b011e66f11e45b","glsl-optimizer/src/util/futex.h":"26f7c9d86e9ffef4c0fa2761f1aaa1918337302e20bd6ca10e61dc3c47356deb","glsl-optimizer/src/util/half_float.c":"11bc2584493d5d9d46e8c8a619a0307cf150bf5ab5d0f96bb764b061dc37a00e","glsl-optimizer/src/util/half_float.h":"7f7c380f126da1400a91758cc0392f24bf967bce1672890b62be26fe9fbd922b","glsl-optimizer/src/util/hash_table.c":"0ca40352e35dedab0a84c64c903f1b16d47e950bb5f43b4d22bb57d499bfea6e","glsl-optimizer/src/util/hash_table.h":"217191bb360592e2232f187473c10287d2cda8ae6fa5c53d0ef74c8c206118b4","glsl-optimizer/src/util/list.h":"9fab03c6a78186bb5f173269f825f6ce976b409d931852e3d93bac632e07989a","glsl-optimizer/src/util/macros.h":"63faf65b51058c483b17f1f77da51d1c53c8beab52678cb6bd01f1228a63b6b0","glsl-optimizer/src/util/mesa-sha1.c":"00c692ec353ebc02c06c57c5a71de0ab7a119f86a4146f452e65ec87e4944417","glsl-optimizer/src/util/mesa-sha1.h":"bff4c29f4bf7cdbcefb30fa0c996a7604a380eba8976467c2a60e7cd328f7e26","glsl-optimizer/src/util/mesa-sha1_test.c":"25da89a59d51469f77b4c468ca23ffdce0a7a1166a70b6cc23026a6800b0143c","glsl-optimizer/src/util/os_memory.h":"64555faf1760ae6954f42c83727c38dfc4c278e9152115779ffaad58b42adacf","glsl-optimizer/src/util/os_memory_aligned.h":"12d86fa94be38c13f7eeebdf313795e1267dd5a7187d2f0072e0e896f41702f6","glsl-optimizer/src/util/os_memory_stdc.h":"07360363b88c927065e10df71bebf6c8a0cc3b9167c9dfce55f2d65f11e6f787","glsl-optimizer/src/util/os_misc.c":"a9936e613ec84803abd59ad47c192c8e3939993c950ac91973fdc4cec1801bb8","glsl-optimizer/src/util/os_misc.h":"cc68eb12e05b5e749c54298cb4a6f4cd20cc5af7db3403e70b3c27b56090c740","glsl-optimizer/src/util/os_time.h":"73e775f7335244ff5964c678c27eedf1aea6abea44c4169d327ea8c7ce4a3a88","glsl-optimizer/src/util/ralloc.c":"4b51189595ef67bcef52c40cbf654d969041dbd15e15d4a893ad494ac060aeca","glsl-optimizer/src/util/ralloc.h":"e573c45875ff1530f0dbee9a93ae55535fdac8d5cc88a79ebc327c688824bde5","glsl-optimizer/src/util/rounding.h":"0450722353caf83de07e67f335949dbe95fe53b534052d4ee9d28d2781387614","glsl-optimizer/src/util/set.c":"86f8c9a830bead5a5a79bc970b0ff97809312af07b3beb39ef9d90af04d40a1b","glsl-optimizer/src/util/set.h":"3e39ca161e7ed4ec7c436cc9c7919ed9a55ed1b71edbf2caf6f9bcfd9bc578ed","glsl-optimizer/src/util/sha1/README":"00af7419af05247081858acb2902efd99fcda2ce16e331079f701645bb3729c0","glsl-optimizer/src/util/sha1/sha1.c":"1403bbe0aad42ba3e6be7e09f7cad87a6a8c4ad5b63962f7b92b9f37d8133b04","glsl-optimizer/src/util/sha1/sha1.h":"68d9f240eab2918026ecdf22be36811abbd4f1389f6c36e31258041aeaedd247","glsl-optimizer/src/util/simple_mtx.h":"12c6c3c4b7db9168bc656d5b3c65912075084d2b388c415d5c3d3f5953a9d6c7","glsl-optimizer/src/util/softfloat.c":"a97e51a96fe5e6a052c02aa6bbec683fe73fb88a8c087d9c930503e2120d8a2e","glsl-optimizer/src/util/softfloat.h":"66664b0250e83bf5dd4cc743acd119d076efcea624a0eab3d6b60718e6ee8811","glsl-optimizer/src/util/string_buffer.c":"63a1d1b1e34926c88ea00159cafbcd56568b805c4f64d1e8c97169fe313921fc","glsl-optimizer/src/util/string_buffer.h":"7b88d1b1d9c6cfb8e93331813535c127289437c75f822029e9a3bca8ea6b52ee","glsl-optimizer/src/util/strndup.h":"0273c4fdb7482cd7746881a63d3998648c6d63415ba85af1d1860f0e0dc504c6","glsl-optimizer/src/util/strtod.c":"5cf610d8a37373cf37cfb7aae903525d943b2674b1f32594c70b0eb19a8c9697","glsl-optimizer/src/util/strtod.h":"237396def4e264d35ed4bedea00ef9a4ceab6d7a11a18c770d9747d22c69ed2d","glsl-optimizer/src/util/u_atomic.h":"c02e809526c6c09ba8fe51f50b2490d1b6c8e5c7f3c4031ae958250d098fc3bb","glsl-optimizer/src/util/u_debug.c":"8c060e379b816618f3dd22c9ea523c68b9425c76c36a7dfe5d6d375b337f5f4a","glsl-optimizer/src/util/u_debug.h":"e11e26edd9b9e4e6f8e6a435e69f4d9edda27e9a379f68f4c82ea2525aaaea68","glsl-optimizer/src/util/u_dynarray.h":"853d0fa6ff2261614488be624deb8a2b01e57c2c8eabc28578cbeed4ccc95694","glsl-optimizer/src/util/u_endian.h":"3ccea7e529740318d8a4b05c00db3adc9d1e292a52bdc56a05c9fae99209720f","glsl-optimizer/src/util/u_math.c":"c868a8c0886dc78f1b06b13404ba8b253090449045774dd56893ac9d75795184","glsl-optimizer/src/util/u_math.h":"a04e32e126db016413f9de0a2028a3e71737137463b1289eae576f884b06fcf1","glsl-optimizer/src/util/u_memory.h":"c5db17c724c70283ddbe04165722f6988d4e0eb9aa3602ae472feff016649af9","glsl-optimizer/src/util/u_queue.h":"92930ce236c0528a98b695f5cea8c5c6aa9683beaf71a2227bdc5d33d1b21506","glsl-optimizer/src/util/u_string.h":"c5a2f4ef576d1547bda12c4ea219179fefa54414977743ac094abcaf696ef6ca","glsl-optimizer/src/util/u_thread.h":"00b708459b27f9910d18db92c18cc65cfc618ac2b3cd144e45f8640057b10d58","glsl-optimizer/src/util/xxhash.h":"2f2aff2fc6c0c929f52cf6ae7314122124c5be026d41ad1c357608383c4a37ad","src/bindings.rs":"79993db2058bde39f99ef483d02560d33b1cb882f6a552319e8b86eb6f9021e1","src/lib.rs":"04be1554cd829eb40864b06d80b491dd48117a4e3a601c7d482117f7a0391e67","wrapper.hpp":"f3ea34cc496f7d90b9bfcada3250b37b314c3524dac693b2ece9517bc7d274ac"},"package":"913662ae8335df058d56e00f11340b20fa82e03e0276587797ef325ab01e50d4"} +\ No newline at end of file ++{"files":{"Cargo.toml":"010bb96167ff152e0e5ac30f9905dc749a3f038199b70c541c5d8cb97a185ee3","README.md":"4468e08c64c19977707d792bfab0080e35ff927b64990eab77873f8ba056ba1c","build.rs":"6a64610018701781af182c418a4355c9ac5d99d000be9457f0e38a7dadf7542a","glsl-optimizer/CMakeLists.txt":"42ce94744e82ffa000da8b64d81fc140e293b9f5da7dd4cf6b49e7404a2448d9","glsl-optimizer/README.md":"b18eef11a92d267d88a937b1154f7670ee433c730b102fdf7e2da0b02722b146","glsl-optimizer/contrib/glslopt/Main.cpp":"14ba213210c62e234b8d9b0052105fed28eedd83d535ebe85acc10bda7322dd4","glsl-optimizer/contrib/glslopt/Readme":"65d2a6f1aa1dc61e903e090cdade027abad33e02e7c9c81e07dc80508acadec4","glsl-optimizer/generateParsers.sh":"878a97db5d3b69eb3b4c3a95780763b373cfcc0c02e0b28894f162dbbd1b8848","glsl-optimizer/include/GL/gl.h":"1989b51365b6d7d0c48ff6e8b181ef75e2cdf71bfb1626b1cc4362e2f54854a3","glsl-optimizer/include/GL/glext.h":"2ac3681045a35a2194a81a960cad395c04bef1c8a20ef46b799fb24af3ec5f70","glsl-optimizer/include/KHR/khrplatform.h":"1448141a0c054d7f46edfb63f4fe6c203acf9591974049481c32442fb03fd6ed","glsl-optimizer/include/c11/threads.h":"56e9e592b28df19f0db432125223cb3eb5c0c1f960c22db96a15692e14776337","glsl-optimizer/include/c11/threads_posix.h":"f922e2c8613582a9340aa5ae37a4f7bd962dbc30e33a7a6ab14bed2d2995bc2b","glsl-optimizer/include/c11/threads_win32.h":"95bf19d7fc14d328a016889afd583e4c49c050a93bcfb114bd2e9130a4532488","glsl-optimizer/include/c11_compat.h":"103fedb48f658d36cb416c9c9e5ea4d70dff181aab551fcb1028107d098ffa3e","glsl-optimizer/include/c99_compat.h":"aafad02f1ea90a7857636913ea21617a0fcd6197256dcfc6dd97bb3410ba892e","glsl-optimizer/include/no_extern_c.h":"40069dbb6dd2843658d442f926e609c7799b9c296046a90b62b570774fd618f5","glsl-optimizer/license.txt":"e26a745226f4a46b3ca00ffbe8be18507362189a2863d04b4f563ba176a9a836","glsl-optimizer/src/compiler/builtin_type_macros.h":"5b4fc4d4da7b07f997b6eb569e37db79fa0735286575ef1fab08d419e76776ff","glsl-optimizer/src/compiler/glsl/README":"e7d408b621c1b605857c4cab63902f615edb06b530142b91ac040808df6e22f7","glsl-optimizer/src/compiler/glsl/TODO":"dd3b7a098e6f9c85ca8c99ce6dea49d65bb75d4cea243b917f29e4ad2c974603","glsl-optimizer/src/compiler/glsl/ast.h":"3e68ff374350c49211a9931f7f55a485d8d89fc4b21caaffbf6655009ad95bf8","glsl-optimizer/src/compiler/glsl/ast_array_index.cpp":"92b4d501f33e0544c00d14e4f8837753afd916c2b42e076ccc95c9e8fc37ba94","glsl-optimizer/src/compiler/glsl/ast_expr.cpp":"afd712a7b1beb2b633888f4a0911b0a8e4ae5eb5ab9c1e3f247d518cdaaa56d6","glsl-optimizer/src/compiler/glsl/ast_function.cpp":"74f4fbd490e366b37f4715168bb3465ecd9334d4130942f75dcc8e80e8e7f027","glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp":"d0f798eb09271d41d068b9e7b18220d37f1ed0083300ab51eba30989698fe23d","glsl-optimizer/src/compiler/glsl/ast_type.cpp":"8eb790b24b26dfb72bdc333744b566c26d8464c5d47d20eae659461f5c4899f7","glsl-optimizer/src/compiler/glsl/builtin_functions.cpp":"454189d643c220fcb49116ee5c8a34f7b349aa67564040deb8607f6a41a15e70","glsl-optimizer/src/compiler/glsl/builtin_functions.h":"a37cad7ed09b522c5b8bec7b80115a36846e7ba6e0874a2a858e32f7f202c665","glsl-optimizer/src/compiler/glsl/builtin_int64.h":"619def6f3aebf180da3944ef08f159ab12a58b24767e41d8b985ac37ded54d62","glsl-optimizer/src/compiler/glsl/builtin_types.cpp":"afec060b62d6f3b00bfbf94e9fa5f96341ce096c128d1eef322791e6ed9cea4d","glsl-optimizer/src/compiler/glsl/builtin_variables.cpp":"6563bfb1345cbca4c77e00eef09ad152f3e1dc271d246a08c5ce9e1f4ce4250a","glsl-optimizer/src/compiler/glsl/float64.glsl":"1072fd888be48c2a7a5117cd2d92a65f034965a66375f598bb856bff5d7be766","glsl-optimizer/src/compiler/glsl/generate_ir.cpp":"e5f0175370a0d07f93c48d3f0f1b8233d12c64a7b02de02dcc753ef7b398ef0f","glsl-optimizer/src/compiler/glsl/glcpp/README":"a0332a1b221d047e9cce5181a64d4ac4056046fd878360ec8ae3a7b1e062bcff","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.c":"2d179879b1ffe84f58875eee5b0c19b6bae9c973b0c48e6bcd99978f2f501c80","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.l":"e4c5744c837200dafd7c15a912d13f650308ea552454d4fa67271bc0a5bde118","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.c":"03494f9ce1cb82260506e2559e73a3eeb622c4bd51b65eaa0a2c3351862bd4c8","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.h":"264d9a18421cde255ce34a0a62b3d8e73465359f0d167e64aa3973062aae5bdd","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.y":"fafb66e3a8f149d19e085f18a4273ba6d4c11af9e9a01d665cc784dddf97b79f","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.c":"37ed294403c2abfd17fd999d1ae8d11b170e5e9c878979fefac74a31195c96b0","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.h":"85ac8b444bcbd0822b66448a1da407b6ae5467b649f5afaf5c58325bd7569468","glsl-optimizer/src/compiler/glsl/glcpp/pp.c":"a52d94f1bcb3fb2747a95709c4a77c25de7eea8354d2b83bb18efd96976a4473","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.c":"d11aeb3acfe966d1b78f1ee49804093f2434214c41391d139ffcb67b69dc9862","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.h":"abbf1f36ec5a92d035bfbb841b9452287d147616e56373cdbee1c0e55af46406","glsl-optimizer/src/compiler/glsl/glsl_lexer.cpp":"272b9fc1383d72b81bfc03fa11fdf82270ed91a294e523f9ce2b4554bd3effa9","glsl-optimizer/src/compiler/glsl/glsl_lexer.ll":"2b57d9f9eb830c3d7961d4533048a158ee6f458c8d05c65bea7b7cfbc36e4458","glsl-optimizer/src/compiler/glsl/glsl_optimizer.cpp":"f8095d20629d0af70be930b0612e169edb274551a1d25a3cd1bf9995a11ce2e8","glsl-optimizer/src/compiler/glsl/glsl_optimizer.h":"22e843b4ec53ba5f6cd85ca5f7bad33922dca8061b19fb512d46f1caca8d4757","glsl-optimizer/src/compiler/glsl/glsl_parser.cpp":"126baf368d525aba301854e3d91ba60b5aee32e1102376af71416f32cb95ec48","glsl-optimizer/src/compiler/glsl/glsl_parser.h":"2ea9a50716098a8f7bef782d2a030d757b68da73afb01b4d4940d3e8381d44e8","glsl-optimizer/src/compiler/glsl/glsl_parser.yy":"6b1fd1576b29fce005dff744a6dbd0219e4c695c361d61864e1f3a8d6fa6b764","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.cpp":"aad64b5b66467da650091430681e8c6a820cf3cadc4db3c160bf2f15875390ae","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.h":"71fd0e92bbdb193dfb067d7bfdb1200d77392be2fbd0cbfc9ca89d1bb4c7e741","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.cpp":"6660fb83c0ddddbbd64581d46ccfdb9c84bfaa99d13348c289e6442ab00df046","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.h":"24682b8304e0ea3f6318ddb8c859686bd1faee23cd0511d1760977ae975d41bf","glsl-optimizer/src/compiler/glsl/hir_field_selection.cpp":"72a039b0fcab4161788def9e4bedac7ac06a20d8e13146529c6d246bd5202afd","glsl-optimizer/src/compiler/glsl/int64.glsl":"303dbe95dde44b91aee3e38b115b92028400d6a92f9268975d607471984e13eb","glsl-optimizer/src/compiler/glsl/ir.cpp":"2b4741cce90b5d4abff5d719c7324e2693c67294d4d99736cb241554adb281bc","glsl-optimizer/src/compiler/glsl/ir.h":"990b1c74447c4eb4835353ccb0ed9aea644f97fc1129ef1739cd935075d85d2e","glsl-optimizer/src/compiler/glsl/ir_array_refcount.cpp":"8cdc1cffe01e42e0566fa2193a75f789628e8025ad1b82f0ee6f204451b7f9f7","glsl-optimizer/src/compiler/glsl/ir_array_refcount.h":"75f06ec81342b379096ca52e1dc0fd5f19a11ff8e9b58203c20628179d644c12","glsl-optimizer/src/compiler/glsl/ir_basic_block.cpp":"1e2920b1c0ecb08424c745c558f84d0d7e44b74585cf2cc2265dc4dfede3fa2f","glsl-optimizer/src/compiler/glsl/ir_basic_block.h":"81be7da0fc0ee547cd13ec60c1fcd7d3ce3d70d7e5e988f01a3b43a827acdf05","glsl-optimizer/src/compiler/glsl/ir_builder.cpp":"daba29c5a1efdd5a9754f420eb3e2ebdf73485273497f40d4863dadeddb23c0d","glsl-optimizer/src/compiler/glsl/ir_builder.h":"2822e74dd3f6e3df8b300af27d5b11ea2dd99d0e5e7ca809b7bbcce9833c483c","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.cpp":"8c6df5abf2fe313363f285f171c19ca6c8ee4f3bc2ed79d33c0c88cc8be45c48","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.h":"799852adc3a0e54d04080655e7cebfa0d3bf5b6ffed5d8414f141380665d4db7","glsl-optimizer/src/compiler/glsl/ir_clone.cpp":"d897a4e1f5bbec4a6a2f15044c1be9a4d13899c73be77335b041049a4589aa5d","glsl-optimizer/src/compiler/glsl/ir_constant_expression.cpp":"78bd87ddb09db67f6c499067728d72aef4f16aa02721a99a4b769d1e0cfa9010","glsl-optimizer/src/compiler/glsl/ir_equals.cpp":"bca28533a6310b0fc152b56d80872368f1510dc62ed6e8ac199b9ffa7fac02e7","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.cpp":"7e918d4e1f237eca01396004015865ce345afe32a876c9dbc6728576a1a7eae4","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.h":"f45b66aa9497520e7e08e612d24b308477c34477fbd963ee9320eac664957f16","glsl-optimizer/src/compiler/glsl/ir_expression_operation.h":"cc9f10727dbd26cac506804f51456302c702650f9eeb59054a7e1575d5cf6687","glsl-optimizer/src/compiler/glsl/ir_expression_operation.py":"7b86c96021b9fbe165957f4ecb0b612fefcde1c2cf3c6d75e3cdb22e369216ba","glsl-optimizer/src/compiler/glsl/ir_expression_operation_constant.h":"9ad3346416392e3efa11e12ecf2feca7453c5253d241eb96c91dfb85d4f2b971","glsl-optimizer/src/compiler/glsl/ir_expression_operation_strings.h":"a6826daf496a8b9e89885bc2a161ac3445d501b23c6e0ac33e2c01b506b273c8","glsl-optimizer/src/compiler/glsl/ir_function.cpp":"7537365fc0fbe4b37a26b9a2146cc64d3e9a774d60eab63b65002ad165ae8fc7","glsl-optimizer/src/compiler/glsl/ir_function_can_inline.cpp":"faddbf112187a048d502716a3fb82570a322299ba2a3abd79388382c82040bfc","glsl-optimizer/src/compiler/glsl/ir_function_detect_recursion.cpp":"9176973eaf5c0a984701f953bb7a80f37dca43d59b5bce50fc69b3f02f2902d7","glsl-optimizer/src/compiler/glsl/ir_function_inlining.h":"9739493f99c489987d650762fccdd3fb3d432f6481d67f6c799176685bd59632","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.cpp":"3725861fbe2b98e0617f52d3b14cf6d3b25fb5ec00f5ef5d308b03642f592767","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.h":"e0560210e966c0c31e4ca843e80ea154e64db5a444b8c2df845b6ba5b3a43fc1","glsl-optimizer/src/compiler/glsl/ir_hv_accept.cpp":"caf7ce2cd9494aadd3c58bcf77f29de58368dc9e347a362bbf37f8bda9509b80","glsl-optimizer/src/compiler/glsl/ir_optimization.h":"8b3dcfc7f9e96b21a8dd47a0040d90be483a9e67a2cdce3a697188fb758d4630","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.cpp":"f8e34a983452be0dcb5a695e9c8e895eead24f9e540992a8afe510ae85da4c4c","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.h":"1ad1bd3efd1ace39051c13f904c05fd80425d329444f9a8d47fd6d948faf46e0","glsl-optimizer/src/compiler/glsl/ir_print_visitor.cpp":"643f5a68aae3fb37267fd793f1216d1cfdeb2c09338c26b1f30e4c6deaef4de5","glsl-optimizer/src/compiler/glsl/ir_print_visitor.h":"4573eb93268a2654c14b505253dd651e2695d43dc745904d824da18305269b95","glsl-optimizer/src/compiler/glsl/ir_reader.cpp":"06bfba802c8354e5a8b2334b6d78d6297de18235bedd3f8fbb382c89870b02f2","glsl-optimizer/src/compiler/glsl/ir_reader.h":"63e3f7f1597936a7011d5b520e171b197bf82bee6c1560d822c3edf5aaa6f9e9","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.cpp":"84b5c5d746555adca85759c2912fe48010232b7c1c0bd2cf03bd04067a85e66f","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.h":"fd8c561b71085d3211fff85ed514fecb299d8ce19a04bc063419a55b6d840525","glsl-optimizer/src/compiler/glsl/ir_set_program_inouts.cpp":"ab9f115ce9e7f312d9c7978340ced0dc4ae6d13a80e08442ba9709d11d50cae5","glsl-optimizer/src/compiler/glsl/ir_uniform.h":"683ae6896b1a08470c090be5f822fc31cd434eab9216e954b9bba24a46975109","glsl-optimizer/src/compiler/glsl/ir_unused_structs.cpp":"9c1620c45f2fc071fe5ed828472040b14c5f42effe06aa0e3b8352c95ef78786","glsl-optimizer/src/compiler/glsl/ir_unused_structs.h":"13387b49c23093575276b25b9dfd31fedd8f131c5c4f3128ab04cf03e15b5295","glsl-optimizer/src/compiler/glsl/ir_validate.cpp":"6b232be5999a86ea278f4f15b2832d76843246509118d924243055a3b9b0299f","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.cpp":"2764a3cad937d53f36db7447c3a5b98b04bf153acf81074d971857fc5bca460d","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.h":"b0668e3eb1501ef65e38fe12830742ecb3d28e6039f30e366c8924efc29b4a39","glsl-optimizer/src/compiler/glsl/ir_visitor.h":"f21b3534c3d66d5fb707d1581fece7e1eb043523afbaedf89918cfb031c6df94","glsl-optimizer/src/compiler/glsl/link_atomics.cpp":"360f0209e11f367ba358223597b0a118bae095bff16337cf03f1fb89c5b80ca6","glsl-optimizer/src/compiler/glsl/link_functions.cpp":"de7895da8aa33a1e3c2c1eb2fdaf267ab5d1fbfdb79ae2e67f95211e946e294c","glsl-optimizer/src/compiler/glsl/link_interface_blocks.cpp":"1926cfa73810704eb19b916c1b2cdb9321155e2f98b2a0a57c7c3c6e960540cd","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.cpp":"1e14e06ca3b2c1089cfba2e8eaf0c1f373d9d6374b6082f320962dd71ae09611","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.h":"fd58c155af645295bb6aec08797889de586f4d919731de2bce57e8dce59bb048","glsl-optimizer/src/compiler/glsl/link_uniform_blocks.cpp":"09589f49776dce32e6c4044937de7e0c839a9754ad31960148f8f9e010658997","glsl-optimizer/src/compiler/glsl/link_uniform_initializers.cpp":"bf98e08c12db466acf9623cbeb8fa8e3b4002512722e7a6521287f558a099f37","glsl-optimizer/src/compiler/glsl/link_uniforms.cpp":"84bad5b1377362cecf259b05124239be5220b03ce1c0c61b59bd9a47e4379af2","glsl-optimizer/src/compiler/glsl/link_varyings.cpp":"a5f1a53e7c80d635515fe808ff223d89fef1767abb0f2b7aa28fa6773dca353f","glsl-optimizer/src/compiler/glsl/link_varyings.h":"b9dbe018f038df69763df2e928742ce81bbc6e3aaba26f50621e30a6d9aa6220","glsl-optimizer/src/compiler/glsl/linker.cpp":"40b1ecd5d4f6c7f13d5a87ce390561a51fdf6f3fcd9b2197b9c88b03a773ba94","glsl-optimizer/src/compiler/glsl/linker.h":"ecf94b4ad75ef461c27c557fda4bd25f34c91930822b8e1d729ec84520d4a049","glsl-optimizer/src/compiler/glsl/linker_util.cpp":"1663ad88e2a369305659aeeffaedb5bd752cf76340a2ba5797fc0bf600633cf9","glsl-optimizer/src/compiler/glsl/linker_util.h":"6db788daf9c8e87ae2764b61a8b37ebe419e69c1b82ddee01986e37c978c6993","glsl-optimizer/src/compiler/glsl/list.h":"b1f46ce0e552fe7c45b2a19408a9d97662e23e4b182ab335491c26f8cf25886f","glsl-optimizer/src/compiler/glsl/loop_analysis.cpp":"57ecd573477c68091c7cc99537faa7139a8f395935e3d4f10144cefdefb5a611","glsl-optimizer/src/compiler/glsl/loop_analysis.h":"a85f045a038ee5b5176063e85d7988865862c44ab0580f771b993a042d0b69cc","glsl-optimizer/src/compiler/glsl/loop_unroll.cpp":"bd4292ea2809f5a669bcb76ceaa1ac365772dcd638c579c3ed10275214901a54","glsl-optimizer/src/compiler/glsl/lower_blend_equation_advanced.cpp":"8cfbef140d9c4b4d2f57bfa05c9c374d31a121d0f87afce94333f049023b654a","glsl-optimizer/src/compiler/glsl/lower_buffer_access.cpp":"1ae221c3c7a95aeb867207e7a742be635f91b406c157747bfd6ddf10274d97fb","glsl-optimizer/src/compiler/glsl/lower_buffer_access.h":"807886953a576a323591798cbca5e2df24295ea893b28affd8ffb5926cebaa04","glsl-optimizer/src/compiler/glsl/lower_builtins.cpp":"4d81afc32cf58e1481fcb5e42888ab93dbe6820310a20ff7a9982b77b2152d9b","glsl-optimizer/src/compiler/glsl/lower_const_arrays_to_uniforms.cpp":"608403f0eeeedf21cfcd3014116e0f44e28cbdf6c4c32aac7e613e64e30205e1","glsl-optimizer/src/compiler/glsl/lower_cs_derived.cpp":"179905cd47a294122adeb5b0abfed6f2f67782dcde21b544d1ee2c1985154e66","glsl-optimizer/src/compiler/glsl/lower_discard.cpp":"3b361b2db0004d544d64611cb50d5a6e364cf6c5f2e60c449085d7d753dd7fb0","glsl-optimizer/src/compiler/glsl/lower_discard_flow.cpp":"f5c29b6a27690bb5c91f196d1a1cf9f6be4f1025292311fe2dac561ce6774dee","glsl-optimizer/src/compiler/glsl/lower_distance.cpp":"a118c85493d5d22b2c059a930c51a5854896d4b1dade76598eaa985e5a3dff8c","glsl-optimizer/src/compiler/glsl/lower_if_to_cond_assign.cpp":"469e617757fd1728709cce021aac5c8da05ee503bf5366977bdc4ef7a6d83950","glsl-optimizer/src/compiler/glsl/lower_instructions.cpp":"6ff5c396abe40d8a2145d571e99e2bbe9143393e15aafc28adc2803a01d821b6","glsl-optimizer/src/compiler/glsl/lower_int64.cpp":"d1ed41196880dd53c7b13e2782f9423f8442bf1d46186e8be92b1b66218a83ee","glsl-optimizer/src/compiler/glsl/lower_jumps.cpp":"34de7b493f281589fb0c2c0f6e885d0a0fabbe7a4e97a73de374dd714777a58c","glsl-optimizer/src/compiler/glsl/lower_mat_op_to_vec.cpp":"dff7a308edc4846c348ed4225c6699a9c75abac68d88f41f85954276552779f4","glsl-optimizer/src/compiler/glsl/lower_named_interface_blocks.cpp":"16063ac127bff75a68272070ab11c21c25101edbff62b4c68f4983b4cd941af0","glsl-optimizer/src/compiler/glsl/lower_offset_array.cpp":"3b00773399135aea85746a5a68b96ef000bc6841be1a2c8e6f25c516628b0949","glsl-optimizer/src/compiler/glsl/lower_output_reads.cpp":"a0fc9975d5aa1617e21fc6c353659a9802da9e83779a3eef4ec584f74b4dadc5","glsl-optimizer/src/compiler/glsl/lower_packed_varyings.cpp":"7550099d4ae123d71541c2fc88bc04fbfe9271ec75d7e210987d1c8cac3cf3ea","glsl-optimizer/src/compiler/glsl/lower_packing_builtins.cpp":"79a13d161fe505a410ab948d92769395708693ec888153630fa240e5b97e356f","glsl-optimizer/src/compiler/glsl/lower_precision.cpp":"f82a185b879872b977a1787d8061b9a80bc4cf8db1b970db6efba2ad9cc20fa2","glsl-optimizer/src/compiler/glsl/lower_shared_reference.cpp":"ea2dccf50a83bc19391bf6b7ab6aa53c0005f427af4066d25140340af9a4beef","glsl-optimizer/src/compiler/glsl/lower_subroutine.cpp":"f69fa53650eeb6f2944fce4d36a6e0a423e6705f3a3bd3389c7fadb83cfc8802","glsl-optimizer/src/compiler/glsl/lower_tess_level.cpp":"b196c9d424c0569f3e85d75c2d125af21566cb113d69036db87c0990703e0fa7","glsl-optimizer/src/compiler/glsl/lower_texture_projection.cpp":"4d247f244272adc8250fd888d8d932a140dd5de4d1efc7a58492c3c2b8291527","glsl-optimizer/src/compiler/glsl/lower_ubo_reference.cpp":"89bdbc6c1669230c644c0857db1ce2781ec61d349ecd08c7914146e1f4750a4a","glsl-optimizer/src/compiler/glsl/lower_variable_index_to_cond_assign.cpp":"fce930f29ac9405b297d1f749d68f59506b89c70b4ee1b1ab8cf49a34cc71ecf","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_cond_assign.cpp":"3c67d851a11a55fad1c49a550f3a0cfe50892d33a3f238ce266cd829eba510a8","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_swizzle.cpp":"f5ec666b73e1415cbab32519a53605ed385f3b03e889560373dbce69dda5000e","glsl-optimizer/src/compiler/glsl/lower_vector.cpp":"f7c13f5572ebe09b6a71553133b2cf003cd4b77b9657600672ee3b21bf890725","glsl-optimizer/src/compiler/glsl/lower_vector_derefs.cpp":"b05793da6dd620a531b43df5af8b2ecbc37b9db0c88910f5724ea10bcd057e19","glsl-optimizer/src/compiler/glsl/lower_vector_insert.cpp":"fee772ec17eea5e86a529bf9c5fa2ee0d29a5982bb75ebc6d68ed36cd19aa299","glsl-optimizer/src/compiler/glsl/lower_vertex_id.cpp":"690e8715182e03fead5cc5a35251fb4f41b357e4c71a1dfbc4bd7be19862b56d","glsl-optimizer/src/compiler/glsl/lower_xfb_varying.cpp":"58c0e8b270e4bbde54250be03cdb2f36966bcafb785372ad2e2b786835df7f9f","glsl-optimizer/src/compiler/glsl/main.cpp":"ae5e88abbbc8a12f769e1296bad938b9d7398cc6da0d3d0caeceeeb876536850","glsl-optimizer/src/compiler/glsl/opt_add_neg_to_sub.h":"f5054944bfd068810629080d0ea11df78b3f57a8f86df75e13ca50157ad1964d","glsl-optimizer/src/compiler/glsl/opt_algebraic.cpp":"25f45b20e1972ee8c789177a1aeda6e4286c25db2eae3a43ff83029ae64969c0","glsl-optimizer/src/compiler/glsl/opt_array_splitting.cpp":"19d3ce0e815438f4df9ab2890e767b03a4f3f191b53bb30c0217cf2ae6a95430","glsl-optimizer/src/compiler/glsl/opt_conditional_discard.cpp":"0e44e0e126711a3725c1f3a2aa65ff03c381fed08680ffc30101aae60f716c4e","glsl-optimizer/src/compiler/glsl/opt_constant_folding.cpp":"a088d04d9b45f9e55e235835648f614c89b7803c03a6d4f6a6d1a6bc1f0228bd","glsl-optimizer/src/compiler/glsl/opt_constant_propagation.cpp":"8a9440d77ecd6dcf13e683cbb99943aab6311c8fd4b5f6a9189a8d4f270746f4","glsl-optimizer/src/compiler/glsl/opt_constant_variable.cpp":"63d3ccd4dd09f19c9cf1a2f51592111bed41284504f29f3c0de4cadebc439a37","glsl-optimizer/src/compiler/glsl/opt_copy_propagation_elements.cpp":"ffa0f50863995e0d2e31f55a52e82319edc71e520987bebd7f7e561ea331c64b","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_variables.cpp":"84e8747b948232f01dd56b428b9315f96f9511f605f240119fc446fae28981a9","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_varyings.cpp":"761523e88f5b3ba785170f4d7205e94fa99acb7e74d29efbe40e1c010e1dbdb3","glsl-optimizer/src/compiler/glsl/opt_dead_code.cpp":"fd1ba2da7337d4e5dad17f5c2d73d9cc8880305f423e85d64cf94553588fa401","glsl-optimizer/src/compiler/glsl/opt_dead_code_local.cpp":"969a598b4df322baf222258a66cd64a326ea20e5b3125be9d8d1771f522c69e0","glsl-optimizer/src/compiler/glsl/opt_dead_functions.cpp":"774cae6536d02edf26e996a2a895e1f62d5098f16dc96b44798b4fc731a9a95f","glsl-optimizer/src/compiler/glsl/opt_flatten_nested_if_blocks.cpp":"3696a5c55f02e20056e085bc2714f73ac992f221b6f3387d655068e86b512046","glsl-optimizer/src/compiler/glsl/opt_flip_matrices.cpp":"44f0fe05b49329667671f88c96dc86ab3fe1459ff7b87f2b2d88de2d49829f9f","glsl-optimizer/src/compiler/glsl/opt_function_inlining.cpp":"fb56a33c90419a01676b57cbd91d0674a54cca40e6defaacc88dd33facebc131","glsl-optimizer/src/compiler/glsl/opt_if_simplification.cpp":"ac406eb35e379c357641d6c5749f50c65961455924d3dc884e2b90046fa92c5c","glsl-optimizer/src/compiler/glsl/opt_minmax.cpp":"8abd59d3b14ef60ff14a9c69660e6945f5cf10b97edb4afebe56be3f81d96316","glsl-optimizer/src/compiler/glsl/opt_rebalance_tree.cpp":"8bb6329dc0f299042368fc81934c2df019b45ab9f7aa0415d4e57b8d1ff98c9f","glsl-optimizer/src/compiler/glsl/opt_redundant_jumps.cpp":"222c73e2ac7a938ebb6428cc6c780c908ff6156d8ff935b04fed93a48fc10496","glsl-optimizer/src/compiler/glsl/opt_structure_splitting.cpp":"2edc79cc13f3177934e0443ad62f5976a1991f01f86ea303a803434849b13a47","glsl-optimizer/src/compiler/glsl/opt_swizzle.cpp":"015d0abddfe507f67c4b96c82988d861d018ededf7bf055e2bcbe9ea92da694e","glsl-optimizer/src/compiler/glsl/opt_tree_grafting.cpp":"46d28ac983ea244a4315bdc0e8892979ec4d1f9b9a96ac8a8a08006d9bc5e878","glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp":"d80ee43bb97d9f016fb9c5e1e06f5b2afa569811f368ba067be794ec11d085fb","glsl-optimizer/src/compiler/glsl/program.h":"2982447e2abd35371e273ad87951722782a8b21c08294f67c39d987da1e1c55f","glsl-optimizer/src/compiler/glsl/propagate_invariance.cpp":"080943e21baa32494723a2eefb185915d2daae1f46d6df420145c5ad6857e119","glsl-optimizer/src/compiler/glsl/s_expression.cpp":"1ced972bc6ecc8eab4116ea71fb0212ab9ae5bcc0be3b47aa5d9d903566b3af1","glsl-optimizer/src/compiler/glsl/s_expression.h":"65b847e30e22a809b57d0bc70243049c99d9c6318803c5b8d0826aba55dc217e","glsl-optimizer/src/compiler/glsl/serialize.cpp":"be0eb4251348a9d921acb839a5c48c6023a2e9d116d602bb0432787ab623655d","glsl-optimizer/src/compiler/glsl/serialize.h":"57425732eba1233d928e5f07f88b623ce65af46b3bb034bf147f0a4b7f94f9a1","glsl-optimizer/src/compiler/glsl/shader_cache.cpp":"e0c5c433f2df3fccdf1d61281bfcb0ee5633433339b97c697d64db99611cbaaf","glsl-optimizer/src/compiler/glsl/shader_cache.h":"9217164d8d7f54aca0fe5922c7187095a6ae0cb703b196b79805aeef07a7e697","glsl-optimizer/src/compiler/glsl/standalone.cpp":"8e6c416a14d631261917a5fe4cc91880c287b22b2dfd70eb22028289a8fa5364","glsl-optimizer/src/compiler/glsl/standalone.h":"a7c397d1dfdd1e7fb2cfe99db35cd9df93251e642059208533202b7f20497f83","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.cpp":"970d14b7a9d58e5270321f97bf5d57795558b1c570a56678e04a65b26c60bf4f","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.h":"d921a617ea82b9e49413314492a645c44356de503581b1be3f1b57de236e480d","glsl-optimizer/src/compiler/glsl/string_to_uint_map.cpp":"d824bf5b839bd39498dc9e457103cdbe3e5289ddf7564107c27b1505948dd31f","glsl-optimizer/src/compiler/glsl/string_to_uint_map.h":"e2f18e66359c9d620e085de7f4a334a47df9c66e65a5bfe8b734c627bec04104","glsl-optimizer/src/compiler/glsl/test_optpass.h":"b27b8f35f5387e7ce4982bb51c7b63ccf14f91757f3108a5d02ed006925bb8a0","glsl-optimizer/src/compiler/glsl/xxd.py":"376484142f27f45090ea8203ae2621abf73f06175cb0ee8d96f44a3b9327f4bd","glsl-optimizer/src/compiler/glsl_types.cpp":"044bb6754f45419a3151e7a25c39202a82009ae3c6bc54ff7f0bb4258a5deefe","glsl-optimizer/src/compiler/glsl_types.h":"fd899a42f34ddeb8601bc3cd6c5e3aed82fc8aef4042dde1b39b3c01e1dcc219","glsl-optimizer/src/compiler/shader_enums.c":"436bff5216b11b0980bdfada5885fc6ac9afa2037a3027fcd6eea2a8635597ac","glsl-optimizer/src/compiler/shader_enums.h":"13220442a5c02e83540cf2c0ad4f8417b2fbda5f2586dec4e92082544c937cdd","glsl-optimizer/src/compiler/shader_info.h":"4c5453e81197ca83593ee4f365074b23530f2ab21c78e1733b63dec6f344c12a","glsl-optimizer/src/gallium/auxiliary/util/u_half.h":"3c2b37bda3ccb64387e44b723d29cf9046decab1a893bf42d842e9603398bdee","glsl-optimizer/src/gallium/include/pipe/p_compiler.h":"c75620096ce8523dae90599e50aa2ef6468d3b0e368a77795edeb20dd1abfc0c","glsl-optimizer/src/gallium/include/pipe/p_config.h":"a27692fc35f9e55df3224b7529e66b3001e911e94e6bc5f8f569e493e1ee3fb7","glsl-optimizer/src/gallium/include/pipe/p_defines.h":"be26d68c0acc67c5e44788c6299716a9eee415fd81d7d747e3738a829e3b6b38","glsl-optimizer/src/gallium/include/pipe/p_format.h":"5674215fc41d27496f037cf837717daefbf23ebb38d40ace7c0c414bc08182b0","glsl-optimizer/src/gallium/include/pipe/p_state.h":"d600593aba5f5a17072a6c38f6baa81e01c7994b0174250f7e433bb41684b702","glsl-optimizer/src/mapi/glapi/glapi.h":"73632a625c0ddabc401205e8b5a81eb8af8506868efe4b170d7979ec3619e9c5","glsl-optimizer/src/mesa/main/config.h":"5800259373099e5405de2eb52619f9de242552a479902a3a642a333c8cb3c1e7","glsl-optimizer/src/mesa/main/context.c":"2f3208473d99c94f734b1137ba91889d4a1babb9e7534bf1dc85d851ee98274e","glsl-optimizer/src/mesa/main/context.h":"cc7e4194797db9d007f01884e23d786c453b3860821f7f2ddcdf0f1bf3f8ffb1","glsl-optimizer/src/mesa/main/dd.h":"6a964acd06b6c2d88700e69fb75fe3c6b3b3d45bbc41db24f3f897a29695fe0c","glsl-optimizer/src/mesa/main/debug_output.h":"7312422e90b8c0e34028ac27280e438139b5cba525c99deb3ac883cd3d87e452","glsl-optimizer/src/mesa/main/draw.h":"7eaef3a9e27a60ea6f7937109bf3a6190b831162fde0479abb12077ce27c353d","glsl-optimizer/src/mesa/main/enums.h":"87d562a6764f51c014a2274fa7c3aca17c04441537ddd56b2554f13c6fffea92","glsl-optimizer/src/mesa/main/errors.h":"c79444b5df289c90fbb22a33b2d0c23917d9fc4510960088f0b79e53bb56b1b2","glsl-optimizer/src/mesa/main/extensions.h":"a38b2f87cc93c513994281350d69e06c84ff8eded5313ec0a1be33f375e0ebbd","glsl-optimizer/src/mesa/main/extensions_table.c":"17642d1a8c9a0bf2bd61060052d33ff14a005d2b962e6cf91465797a50851e85","glsl-optimizer/src/mesa/main/extensions_table.h":"2c879571c238d2e14461031ac740372fd0f9ac3a34c0d5541bb9b7ed4c0376c8","glsl-optimizer/src/mesa/main/formats.h":"02e2f7ec3e39286cf9f27e2641043e6df8ecb1dfde9e643313210e214af2a929","glsl-optimizer/src/mesa/main/glheader.h":"58217b33eead6aa6b23cd4a291cefeaa6cb84e465f4960daffca97c44d6d1c35","glsl-optimizer/src/mesa/main/glthread.h":"51fb2711f77e7eafcfc52d29d5b844978832b24c930d88accd48d143a6eb9c6f","glsl-optimizer/src/mesa/main/hash.h":"7e7f782034c16a8e693de48e00c31d4a90b0129f4029fd074033d7d16ccbe718","glsl-optimizer/src/mesa/main/macros.h":"73d15ddfd64f2b57b9b2ffeeb993b9c2c0899a80563e9d6ff337b11ccbe6eee5","glsl-optimizer/src/mesa/main/menums.h":"5dfac0e2279d60b0cd0c7b9fc2a5021620d0f6282ed2e738c420214e3af152d3","glsl-optimizer/src/mesa/main/mesa_private.h":"edda678b93438944279a551f663b8858ad84814a9fc88ba9672ef195599c24ae","glsl-optimizer/src/mesa/main/mtypes.h":"6efddefa099e4d2e3fdd97f0055644f47aba21711385edfeabc2d9b0676f2eec","glsl-optimizer/src/mesa/main/shaderobj.h":"9f0dfe96d0c2154201adef942bd36053533ac7b2492fb3786acda5bea514c75e","glsl-optimizer/src/mesa/main/uniforms.h":"4e331e6ad6e9cbded978b4082dbe0a57c1f8f01327446bb6892bfc179976c38b","glsl-optimizer/src/mesa/main/version.h":"9d0a13a758099302dc55cf7d045791834a89b0f9d4cf17b2692259b369a8a9a1","glsl-optimizer/src/mesa/math/m_matrix.h":"a37b19f182e070db3df93b0ede43c22fb8be8c2906504133ee6dbd7db1185d8b","glsl-optimizer/src/mesa/program/dummy_errors.c":"1820e305515b4c5e041f5e1623266a48ec8f076a155310be7d60637101f593e4","glsl-optimizer/src/mesa/program/ir_to_mesa.h":"b47f58d22e3ca2ae42d52501ea769d15c4476834944fa97eeccd3a3439211d00","glsl-optimizer/src/mesa/program/prog_instruction.h":"ab3832152a7e144b59e5a2264b2c29db56d93be31e76bbd958527a56771b40eb","glsl-optimizer/src/mesa/program/prog_parameter.h":"ba18c743284eadbc837c2c364c73e5d372321a7637a76e589d8d39fe8b5de225","glsl-optimizer/src/mesa/program/prog_statevars.h":"fc413698f84bc52d45fdeae0471934ee9904bfb7eac1a2b5f70446e54bcbbdca","glsl-optimizer/src/mesa/program/program.h":"1f01026a4eff440a3f122fd9b519d03546fe7f7d8be60dca834e95a2f8fbbfd2","glsl-optimizer/src/mesa/program/symbol_table.c":"6611cb9f078035bf5ff8c9112093a6c7d99f8af99a3931d0c07f227cc72283ea","glsl-optimizer/src/mesa/program/symbol_table.h":"631dc35ac48d5e87962d45507461920f6575610960ffcc42a08cefeb43300cda","glsl-optimizer/src/mesa/vbo/vbo.h":"6eb1dcd9a08c92f276c5fe08da184ff9d455d1be421913b8ad732a7b65e858fb","glsl-optimizer/src/util/bitscan.h":"9e49e694e6b34fe035bc685f32588827eb8cbe7d82878963c7ab52843e1c16aa","glsl-optimizer/src/util/bitset.h":"c40f78515c6230fed18345c6751ce33833a49da7a27901c7e6d7340cbdcbc5e7","glsl-optimizer/src/util/blob.c":"8f729846f66efc9c15485cc5fc24c6ec861fc1fecb2f652573f2a237d481b791","glsl-optimizer/src/util/blob.h":"93e1eaac866b9a7cd6fc03b533c18fb2edf0e97f03395eff4f3a605c4fc14d0c","glsl-optimizer/src/util/compiler.h":"79e3bf40a5bab704e6c949f23a1352759607bb57d80e5d8df2ef159755f10b68","glsl-optimizer/src/util/crc32.c":"2f3467a046b3a76784ecb9aa55d527698c8607fd0b12c622f6691aaa77b58505","glsl-optimizer/src/util/crc32.h":"59bd81865e51042b73a86f8fb117c312418df095fed2d828c5c1d1c8b6fc6cd4","glsl-optimizer/src/util/debug.c":"c3d68e9752ccc19e66c669562cd113cf1d0ac83cbb30174789e7fb8d1df58f9c","glsl-optimizer/src/util/debug.h":"50068d745c4199ccbd33d68dd4c8a36d2b5179c7869a21e75906ddd0718ca456","glsl-optimizer/src/util/detect_os.h":"343a8790d17a3710c6dd015ee367f84e3902ff3f2e36faca2bf93f9d725d3574","glsl-optimizer/src/util/disk_cache.c":"f533937e5a4fffe76e2739ef4b6b1e1da097d96d63eb808e68ebbc7027641c23","glsl-optimizer/src/util/disk_cache.h":"e83314fb14134a8e079b15e470a6376ba5a8253701f048c890a62b7e55d64bc8","glsl-optimizer/src/util/fast_urem_by_const.h":"e108fce804616c47d071dfe4a04163eec1126e448ed1aa89abb6b3a6d772bd5b","glsl-optimizer/src/util/fnv1a.h":"ab2596f19c6adf431ae27618f62c5743e24ad23ef83bb359a4c4c218245ab459","glsl-optimizer/src/util/format/u_format.h":"4cdfc0c59cbc99a092e5ec5a396910f2d93b9643e5d8141050b011e66f11e45b","glsl-optimizer/src/util/futex.h":"26f7c9d86e9ffef4c0fa2761f1aaa1918337302e20bd6ca10e61dc3c47356deb","glsl-optimizer/src/util/half_float.c":"11bc2584493d5d9d46e8c8a619a0307cf150bf5ab5d0f96bb764b061dc37a00e","glsl-optimizer/src/util/half_float.h":"7f7c380f126da1400a91758cc0392f24bf967bce1672890b62be26fe9fbd922b","glsl-optimizer/src/util/hash_table.c":"0ca40352e35dedab0a84c64c903f1b16d47e950bb5f43b4d22bb57d499bfea6e","glsl-optimizer/src/util/hash_table.h":"217191bb360592e2232f187473c10287d2cda8ae6fa5c53d0ef74c8c206118b4","glsl-optimizer/src/util/list.h":"9fab03c6a78186bb5f173269f825f6ce976b409d931852e3d93bac632e07989a","glsl-optimizer/src/util/macros.h":"63faf65b51058c483b17f1f77da51d1c53c8beab52678cb6bd01f1228a63b6b0","glsl-optimizer/src/util/mesa-sha1.c":"00c692ec353ebc02c06c57c5a71de0ab7a119f86a4146f452e65ec87e4944417","glsl-optimizer/src/util/mesa-sha1.h":"bff4c29f4bf7cdbcefb30fa0c996a7604a380eba8976467c2a60e7cd328f7e26","glsl-optimizer/src/util/mesa-sha1_test.c":"25da89a59d51469f77b4c468ca23ffdce0a7a1166a70b6cc23026a6800b0143c","glsl-optimizer/src/util/os_memory.h":"64555faf1760ae6954f42c83727c38dfc4c278e9152115779ffaad58b42adacf","glsl-optimizer/src/util/os_memory_aligned.h":"12d86fa94be38c13f7eeebdf313795e1267dd5a7187d2f0072e0e896f41702f6","glsl-optimizer/src/util/os_memory_stdc.h":"07360363b88c927065e10df71bebf6c8a0cc3b9167c9dfce55f2d65f11e6f787","glsl-optimizer/src/util/os_misc.c":"a9936e613ec84803abd59ad47c192c8e3939993c950ac91973fdc4cec1801bb8","glsl-optimizer/src/util/os_misc.h":"cc68eb12e05b5e749c54298cb4a6f4cd20cc5af7db3403e70b3c27b56090c740","glsl-optimizer/src/util/os_time.h":"73e775f7335244ff5964c678c27eedf1aea6abea44c4169d327ea8c7ce4a3a88","glsl-optimizer/src/util/ralloc.c":"4b51189595ef67bcef52c40cbf654d969041dbd15e15d4a893ad494ac060aeca","glsl-optimizer/src/util/ralloc.h":"e573c45875ff1530f0dbee9a93ae55535fdac8d5cc88a79ebc327c688824bde5","glsl-optimizer/src/util/rounding.h":"0450722353caf83de07e67f335949dbe95fe53b534052d4ee9d28d2781387614","glsl-optimizer/src/util/set.c":"86f8c9a830bead5a5a79bc970b0ff97809312af07b3beb39ef9d90af04d40a1b","glsl-optimizer/src/util/set.h":"3e39ca161e7ed4ec7c436cc9c7919ed9a55ed1b71edbf2caf6f9bcfd9bc578ed","glsl-optimizer/src/util/sha1/README":"00af7419af05247081858acb2902efd99fcda2ce16e331079f701645bb3729c0","glsl-optimizer/src/util/sha1/sha1.c":"1403bbe0aad42ba3e6be7e09f7cad87a6a8c4ad5b63962f7b92b9f37d8133b04","glsl-optimizer/src/util/sha1/sha1.h":"68d9f240eab2918026ecdf22be36811abbd4f1389f6c36e31258041aeaedd247","glsl-optimizer/src/util/simple_mtx.h":"12c6c3c4b7db9168bc656d5b3c65912075084d2b388c415d5c3d3f5953a9d6c7","glsl-optimizer/src/util/softfloat.c":"a97e51a96fe5e6a052c02aa6bbec683fe73fb88a8c087d9c930503e2120d8a2e","glsl-optimizer/src/util/softfloat.h":"66664b0250e83bf5dd4cc743acd119d076efcea624a0eab3d6b60718e6ee8811","glsl-optimizer/src/util/string_buffer.c":"63a1d1b1e34926c88ea00159cafbcd56568b805c4f64d1e8c97169fe313921fc","glsl-optimizer/src/util/string_buffer.h":"7b88d1b1d9c6cfb8e93331813535c127289437c75f822029e9a3bca8ea6b52ee","glsl-optimizer/src/util/strndup.h":"0273c4fdb7482cd7746881a63d3998648c6d63415ba85af1d1860f0e0dc504c6","glsl-optimizer/src/util/strtod.c":"5cf610d8a37373cf37cfb7aae903525d943b2674b1f32594c70b0eb19a8c9697","glsl-optimizer/src/util/strtod.h":"237396def4e264d35ed4bedea00ef9a4ceab6d7a11a18c770d9747d22c69ed2d","glsl-optimizer/src/util/u_atomic.h":"c02e809526c6c09ba8fe51f50b2490d1b6c8e5c7f3c4031ae958250d098fc3bb","glsl-optimizer/src/util/u_debug.c":"8c060e379b816618f3dd22c9ea523c68b9425c76c36a7dfe5d6d375b337f5f4a","glsl-optimizer/src/util/u_debug.h":"e11e26edd9b9e4e6f8e6a435e69f4d9edda27e9a379f68f4c82ea2525aaaea68","glsl-optimizer/src/util/u_dynarray.h":"853d0fa6ff2261614488be624deb8a2b01e57c2c8eabc28578cbeed4ccc95694","glsl-optimizer/src/util/u_endian.h":"3ccea7e529740318d8a4b05c00db3adc9d1e292a52bdc56a05c9fae99209720f","glsl-optimizer/src/util/u_math.c":"c868a8c0886dc78f1b06b13404ba8b253090449045774dd56893ac9d75795184","glsl-optimizer/src/util/u_math.h":"a04e32e126db016413f9de0a2028a3e71737137463b1289eae576f884b06fcf1","glsl-optimizer/src/util/u_memory.h":"c5db17c724c70283ddbe04165722f6988d4e0eb9aa3602ae472feff016649af9","glsl-optimizer/src/util/u_queue.h":"92930ce236c0528a98b695f5cea8c5c6aa9683beaf71a2227bdc5d33d1b21506","glsl-optimizer/src/util/u_string.h":"c5a2f4ef576d1547bda12c4ea219179fefa54414977743ac094abcaf696ef6ca","glsl-optimizer/src/util/u_thread.h":"00b708459b27f9910d18db92c18cc65cfc618ac2b3cd144e45f8640057b10d58","glsl-optimizer/src/util/xxhash.h":"2f2aff2fc6c0c929f52cf6ae7314122124c5be026d41ad1c357608383c4a37ad","src/bindings.rs":"79993db2058bde39f99ef483d02560d33b1cb882f6a552319e8b86eb6f9021e1","src/lib.rs":"04be1554cd829eb40864b06d80b491dd48117a4e3a601c7d482117f7a0391e67","wrapper.hpp":"f3ea34cc496f7d90b9bfcada3250b37b314c3524dac693b2ece9517bc7d274ac"},"package":"913662ae8335df058d56e00f11340b20fa82e03e0276587797ef325ab01e50d4"} +\ No newline at end of file +diff -up firefox-146.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h.build-c11-threads-avail firefox-146.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h +--- firefox-146.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h.build-c11-threads-avail 2025-12-05 18:43:20.000000000 +0100 ++++ firefox-146.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h 2025-12-11 13:30:50.463371937 +0100 +@@ -66,7 +66,7 @@ typedef pthread_cond_t cnd_t; + typedef pthread_t thrd_t; + typedef pthread_key_t tss_t; + typedef pthread_mutex_t mtx_t; +-typedef pthread_once_t once_flag; ++//typedef pthread_once_t once_flag; + + + /* +@@ -90,12 +90,13 @@ impl_thrd_routine(void *p) + + /*--------------- 7.25.2 Initialization functions ---------------*/ + // 7.25.2.1 +-static inline void ++// ++/*static inline void + call_once(once_flag *flag, void (*func)(void)) + { + pthread_once(flag, func); + } +- ++*/ + + /*------------- 7.25.3 Condition variable functions -------------*/ + // 7.25.3.1 diff --git a/firefox.spec b/firefox.spec index 45a8c2e..b91a17e 100644 --- a/firefox.spec +++ b/firefox.spec @@ -256,6 +256,7 @@ Patch78: firefox-i686-build.patch Patch79: firefox-gcc-13-build.patch Patch80: wasi.patch Patch81: firefox-gcc-15.0-s390.patch +Patch82: build-c11-threads-avail.patch Patch83: build-seccomp.patch @@ -569,6 +570,7 @@ This package contains results of tests executed during build. %patch -P79 -p1 -b .firefox-gcc-13-build %patch -P81 -p1 -b .firefox-gcc-15.0-s390 %if 0%{?fedora} >= 44 +%patch -P82 -p1 -b .build-c11-threads-avail %patch -P83 -p1 -b .build-seccomp %endif From 5cae6ba54834b5026df33b14c5a2c2f7b572f659 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Wed, 7 Jan 2026 12:52:11 +0100 Subject: [PATCH 545/545] Build fix --- build-c11-threads-avail.patch | 16 ++++++++-------- fix-cargo-checksum | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+), 8 deletions(-) create mode 100755 fix-cargo-checksum diff --git a/build-c11-threads-avail.patch b/build-c11-threads-avail.patch index 73ed5f5..f627a7b 100644 --- a/build-c11-threads-avail.patch +++ b/build-c11-threads-avail.patch @@ -1,11 +1,3 @@ -diff -up firefox-146.0/third_party/rust/glslopt/.cargo-checksum.json.build-c11-threads-avail firefox-146.0/third_party/rust/glslopt/.cargo-checksum.json ---- firefox-146.0/third_party/rust/glslopt/.cargo-checksum.json.build-c11-threads-avail 2025-12-05 18:43:21.000000000 +0100 -+++ firefox-146.0/third_party/rust/glslopt/.cargo-checksum.json 2025-12-11 13:32:52.599001257 +0100 -@@ -1 +1 @@ --{"files":{"Cargo.toml":"010bb96167ff152e0e5ac30f9905dc749a3f038199b70c541c5d8cb97a185ee3","README.md":"4468e08c64c19977707d792bfab0080e35ff927b64990eab77873f8ba056ba1c","build.rs":"6a64610018701781af182c418a4355c9ac5d99d000be9457f0e38a7dadf7542a","glsl-optimizer/CMakeLists.txt":"42ce94744e82ffa000da8b64d81fc140e293b9f5da7dd4cf6b49e7404a2448d9","glsl-optimizer/README.md":"b18eef11a92d267d88a937b1154f7670ee433c730b102fdf7e2da0b02722b146","glsl-optimizer/contrib/glslopt/Main.cpp":"14ba213210c62e234b8d9b0052105fed28eedd83d535ebe85acc10bda7322dd4","glsl-optimizer/contrib/glslopt/Readme":"65d2a6f1aa1dc61e903e090cdade027abad33e02e7c9c81e07dc80508acadec4","glsl-optimizer/generateParsers.sh":"878a97db5d3b69eb3b4c3a95780763b373cfcc0c02e0b28894f162dbbd1b8848","glsl-optimizer/include/GL/gl.h":"1989b51365b6d7d0c48ff6e8b181ef75e2cdf71bfb1626b1cc4362e2f54854a3","glsl-optimizer/include/GL/glext.h":"2ac3681045a35a2194a81a960cad395c04bef1c8a20ef46b799fb24af3ec5f70","glsl-optimizer/include/KHR/khrplatform.h":"1448141a0c054d7f46edfb63f4fe6c203acf9591974049481c32442fb03fd6ed","glsl-optimizer/include/c11/threads.h":"56e9e592b28df19f0db432125223cb3eb5c0c1f960c22db96a15692e14776337","glsl-optimizer/include/c11/threads_posix.h":"f8ad2b69fa472e332b50572c1b2dcc1c8a0fa783a1199aad245398d3df421b4b","glsl-optimizer/include/c11/threads_win32.h":"95bf19d7fc14d328a016889afd583e4c49c050a93bcfb114bd2e9130a4532488","glsl-optimizer/include/c11_compat.h":"103fedb48f658d36cb416c9c9e5ea4d70dff181aab551fcb1028107d098ffa3e","glsl-optimizer/include/c99_compat.h":"aafad02f1ea90a7857636913ea21617a0fcd6197256dcfc6dd97bb3410ba892e","glsl-optimizer/include/no_extern_c.h":"40069dbb6dd2843658d442f926e609c7799b9c296046a90b62b570774fd618f5","glsl-optimizer/license.txt":"e26a745226f4a46b3ca00ffbe8be18507362189a2863d04b4f563ba176a9a836","glsl-optimizer/src/compiler/builtin_type_macros.h":"5b4fc4d4da7b07f997b6eb569e37db79fa0735286575ef1fab08d419e76776ff","glsl-optimizer/src/compiler/glsl/README":"e7d408b621c1b605857c4cab63902f615edb06b530142b91ac040808df6e22f7","glsl-optimizer/src/compiler/glsl/TODO":"dd3b7a098e6f9c85ca8c99ce6dea49d65bb75d4cea243b917f29e4ad2c974603","glsl-optimizer/src/compiler/glsl/ast.h":"3e68ff374350c49211a9931f7f55a485d8d89fc4b21caaffbf6655009ad95bf8","glsl-optimizer/src/compiler/glsl/ast_array_index.cpp":"92b4d501f33e0544c00d14e4f8837753afd916c2b42e076ccc95c9e8fc37ba94","glsl-optimizer/src/compiler/glsl/ast_expr.cpp":"afd712a7b1beb2b633888f4a0911b0a8e4ae5eb5ab9c1e3f247d518cdaaa56d6","glsl-optimizer/src/compiler/glsl/ast_function.cpp":"74f4fbd490e366b37f4715168bb3465ecd9334d4130942f75dcc8e80e8e7f027","glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp":"d0f798eb09271d41d068b9e7b18220d37f1ed0083300ab51eba30989698fe23d","glsl-optimizer/src/compiler/glsl/ast_type.cpp":"8eb790b24b26dfb72bdc333744b566c26d8464c5d47d20eae659461f5c4899f7","glsl-optimizer/src/compiler/glsl/builtin_functions.cpp":"454189d643c220fcb49116ee5c8a34f7b349aa67564040deb8607f6a41a15e70","glsl-optimizer/src/compiler/glsl/builtin_functions.h":"a37cad7ed09b522c5b8bec7b80115a36846e7ba6e0874a2a858e32f7f202c665","glsl-optimizer/src/compiler/glsl/builtin_int64.h":"619def6f3aebf180da3944ef08f159ab12a58b24767e41d8b985ac37ded54d62","glsl-optimizer/src/compiler/glsl/builtin_types.cpp":"afec060b62d6f3b00bfbf94e9fa5f96341ce096c128d1eef322791e6ed9cea4d","glsl-optimizer/src/compiler/glsl/builtin_variables.cpp":"6563bfb1345cbca4c77e00eef09ad152f3e1dc271d246a08c5ce9e1f4ce4250a","glsl-optimizer/src/compiler/glsl/float64.glsl":"1072fd888be48c2a7a5117cd2d92a65f034965a66375f598bb856bff5d7be766","glsl-optimizer/src/compiler/glsl/generate_ir.cpp":"e5f0175370a0d07f93c48d3f0f1b8233d12c64a7b02de02dcc753ef7b398ef0f","glsl-optimizer/src/compiler/glsl/glcpp/README":"a0332a1b221d047e9cce5181a64d4ac4056046fd878360ec8ae3a7b1e062bcff","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.c":"2d179879b1ffe84f58875eee5b0c19b6bae9c973b0c48e6bcd99978f2f501c80","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.l":"e4c5744c837200dafd7c15a912d13f650308ea552454d4fa67271bc0a5bde118","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.c":"03494f9ce1cb82260506e2559e73a3eeb622c4bd51b65eaa0a2c3351862bd4c8","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.h":"264d9a18421cde255ce34a0a62b3d8e73465359f0d167e64aa3973062aae5bdd","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.y":"fafb66e3a8f149d19e085f18a4273ba6d4c11af9e9a01d665cc784dddf97b79f","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.c":"37ed294403c2abfd17fd999d1ae8d11b170e5e9c878979fefac74a31195c96b0","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.h":"85ac8b444bcbd0822b66448a1da407b6ae5467b649f5afaf5c58325bd7569468","glsl-optimizer/src/compiler/glsl/glcpp/pp.c":"a52d94f1bcb3fb2747a95709c4a77c25de7eea8354d2b83bb18efd96976a4473","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.c":"d11aeb3acfe966d1b78f1ee49804093f2434214c41391d139ffcb67b69dc9862","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.h":"abbf1f36ec5a92d035bfbb841b9452287d147616e56373cdbee1c0e55af46406","glsl-optimizer/src/compiler/glsl/glsl_lexer.cpp":"272b9fc1383d72b81bfc03fa11fdf82270ed91a294e523f9ce2b4554bd3effa9","glsl-optimizer/src/compiler/glsl/glsl_lexer.ll":"2b57d9f9eb830c3d7961d4533048a158ee6f458c8d05c65bea7b7cfbc36e4458","glsl-optimizer/src/compiler/glsl/glsl_optimizer.cpp":"f8095d20629d0af70be930b0612e169edb274551a1d25a3cd1bf9995a11ce2e8","glsl-optimizer/src/compiler/glsl/glsl_optimizer.h":"22e843b4ec53ba5f6cd85ca5f7bad33922dca8061b19fb512d46f1caca8d4757","glsl-optimizer/src/compiler/glsl/glsl_parser.cpp":"126baf368d525aba301854e3d91ba60b5aee32e1102376af71416f32cb95ec48","glsl-optimizer/src/compiler/glsl/glsl_parser.h":"2ea9a50716098a8f7bef782d2a030d757b68da73afb01b4d4940d3e8381d44e8","glsl-optimizer/src/compiler/glsl/glsl_parser.yy":"6b1fd1576b29fce005dff744a6dbd0219e4c695c361d61864e1f3a8d6fa6b764","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.cpp":"aad64b5b66467da650091430681e8c6a820cf3cadc4db3c160bf2f15875390ae","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.h":"71fd0e92bbdb193dfb067d7bfdb1200d77392be2fbd0cbfc9ca89d1bb4c7e741","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.cpp":"6660fb83c0ddddbbd64581d46ccfdb9c84bfaa99d13348c289e6442ab00df046","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.h":"24682b8304e0ea3f6318ddb8c859686bd1faee23cd0511d1760977ae975d41bf","glsl-optimizer/src/compiler/glsl/hir_field_selection.cpp":"72a039b0fcab4161788def9e4bedac7ac06a20d8e13146529c6d246bd5202afd","glsl-optimizer/src/compiler/glsl/int64.glsl":"303dbe95dde44b91aee3e38b115b92028400d6a92f9268975d607471984e13eb","glsl-optimizer/src/compiler/glsl/ir.cpp":"2b4741cce90b5d4abff5d719c7324e2693c67294d4d99736cb241554adb281bc","glsl-optimizer/src/compiler/glsl/ir.h":"990b1c74447c4eb4835353ccb0ed9aea644f97fc1129ef1739cd935075d85d2e","glsl-optimizer/src/compiler/glsl/ir_array_refcount.cpp":"8cdc1cffe01e42e0566fa2193a75f789628e8025ad1b82f0ee6f204451b7f9f7","glsl-optimizer/src/compiler/glsl/ir_array_refcount.h":"75f06ec81342b379096ca52e1dc0fd5f19a11ff8e9b58203c20628179d644c12","glsl-optimizer/src/compiler/glsl/ir_basic_block.cpp":"1e2920b1c0ecb08424c745c558f84d0d7e44b74585cf2cc2265dc4dfede3fa2f","glsl-optimizer/src/compiler/glsl/ir_basic_block.h":"81be7da0fc0ee547cd13ec60c1fcd7d3ce3d70d7e5e988f01a3b43a827acdf05","glsl-optimizer/src/compiler/glsl/ir_builder.cpp":"daba29c5a1efdd5a9754f420eb3e2ebdf73485273497f40d4863dadeddb23c0d","glsl-optimizer/src/compiler/glsl/ir_builder.h":"2822e74dd3f6e3df8b300af27d5b11ea2dd99d0e5e7ca809b7bbcce9833c483c","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.cpp":"8c6df5abf2fe313363f285f171c19ca6c8ee4f3bc2ed79d33c0c88cc8be45c48","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.h":"799852adc3a0e54d04080655e7cebfa0d3bf5b6ffed5d8414f141380665d4db7","glsl-optimizer/src/compiler/glsl/ir_clone.cpp":"d897a4e1f5bbec4a6a2f15044c1be9a4d13899c73be77335b041049a4589aa5d","glsl-optimizer/src/compiler/glsl/ir_constant_expression.cpp":"78bd87ddb09db67f6c499067728d72aef4f16aa02721a99a4b769d1e0cfa9010","glsl-optimizer/src/compiler/glsl/ir_equals.cpp":"bca28533a6310b0fc152b56d80872368f1510dc62ed6e8ac199b9ffa7fac02e7","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.cpp":"7e918d4e1f237eca01396004015865ce345afe32a876c9dbc6728576a1a7eae4","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.h":"f45b66aa9497520e7e08e612d24b308477c34477fbd963ee9320eac664957f16","glsl-optimizer/src/compiler/glsl/ir_expression_operation.h":"cc9f10727dbd26cac506804f51456302c702650f9eeb59054a7e1575d5cf6687","glsl-optimizer/src/compiler/glsl/ir_expression_operation.py":"7b86c96021b9fbe165957f4ecb0b612fefcde1c2cf3c6d75e3cdb22e369216ba","glsl-optimizer/src/compiler/glsl/ir_expression_operation_constant.h":"9ad3346416392e3efa11e12ecf2feca7453c5253d241eb96c91dfb85d4f2b971","glsl-optimizer/src/compiler/glsl/ir_expression_operation_strings.h":"a6826daf496a8b9e89885bc2a161ac3445d501b23c6e0ac33e2c01b506b273c8","glsl-optimizer/src/compiler/glsl/ir_function.cpp":"7537365fc0fbe4b37a26b9a2146cc64d3e9a774d60eab63b65002ad165ae8fc7","glsl-optimizer/src/compiler/glsl/ir_function_can_inline.cpp":"faddbf112187a048d502716a3fb82570a322299ba2a3abd79388382c82040bfc","glsl-optimizer/src/compiler/glsl/ir_function_detect_recursion.cpp":"9176973eaf5c0a984701f953bb7a80f37dca43d59b5bce50fc69b3f02f2902d7","glsl-optimizer/src/compiler/glsl/ir_function_inlining.h":"9739493f99c489987d650762fccdd3fb3d432f6481d67f6c799176685bd59632","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.cpp":"3725861fbe2b98e0617f52d3b14cf6d3b25fb5ec00f5ef5d308b03642f592767","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.h":"e0560210e966c0c31e4ca843e80ea154e64db5a444b8c2df845b6ba5b3a43fc1","glsl-optimizer/src/compiler/glsl/ir_hv_accept.cpp":"caf7ce2cd9494aadd3c58bcf77f29de58368dc9e347a362bbf37f8bda9509b80","glsl-optimizer/src/compiler/glsl/ir_optimization.h":"8b3dcfc7f9e96b21a8dd47a0040d90be483a9e67a2cdce3a697188fb758d4630","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.cpp":"f8e34a983452be0dcb5a695e9c8e895eead24f9e540992a8afe510ae85da4c4c","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.h":"1ad1bd3efd1ace39051c13f904c05fd80425d329444f9a8d47fd6d948faf46e0","glsl-optimizer/src/compiler/glsl/ir_print_visitor.cpp":"643f5a68aae3fb37267fd793f1216d1cfdeb2c09338c26b1f30e4c6deaef4de5","glsl-optimizer/src/compiler/glsl/ir_print_visitor.h":"4573eb93268a2654c14b505253dd651e2695d43dc745904d824da18305269b95","glsl-optimizer/src/compiler/glsl/ir_reader.cpp":"06bfba802c8354e5a8b2334b6d78d6297de18235bedd3f8fbb382c89870b02f2","glsl-optimizer/src/compiler/glsl/ir_reader.h":"63e3f7f1597936a7011d5b520e171b197bf82bee6c1560d822c3edf5aaa6f9e9","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.cpp":"84b5c5d746555adca85759c2912fe48010232b7c1c0bd2cf03bd04067a85e66f","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.h":"fd8c561b71085d3211fff85ed514fecb299d8ce19a04bc063419a55b6d840525","glsl-optimizer/src/compiler/glsl/ir_set_program_inouts.cpp":"ab9f115ce9e7f312d9c7978340ced0dc4ae6d13a80e08442ba9709d11d50cae5","glsl-optimizer/src/compiler/glsl/ir_uniform.h":"683ae6896b1a08470c090be5f822fc31cd434eab9216e954b9bba24a46975109","glsl-optimizer/src/compiler/glsl/ir_unused_structs.cpp":"9c1620c45f2fc071fe5ed828472040b14c5f42effe06aa0e3b8352c95ef78786","glsl-optimizer/src/compiler/glsl/ir_unused_structs.h":"13387b49c23093575276b25b9dfd31fedd8f131c5c4f3128ab04cf03e15b5295","glsl-optimizer/src/compiler/glsl/ir_validate.cpp":"6b232be5999a86ea278f4f15b2832d76843246509118d924243055a3b9b0299f","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.cpp":"2764a3cad937d53f36db7447c3a5b98b04bf153acf81074d971857fc5bca460d","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.h":"b0668e3eb1501ef65e38fe12830742ecb3d28e6039f30e366c8924efc29b4a39","glsl-optimizer/src/compiler/glsl/ir_visitor.h":"f21b3534c3d66d5fb707d1581fece7e1eb043523afbaedf89918cfb031c6df94","glsl-optimizer/src/compiler/glsl/link_atomics.cpp":"360f0209e11f367ba358223597b0a118bae095bff16337cf03f1fb89c5b80ca6","glsl-optimizer/src/compiler/glsl/link_functions.cpp":"de7895da8aa33a1e3c2c1eb2fdaf267ab5d1fbfdb79ae2e67f95211e946e294c","glsl-optimizer/src/compiler/glsl/link_interface_blocks.cpp":"1926cfa73810704eb19b916c1b2cdb9321155e2f98b2a0a57c7c3c6e960540cd","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.cpp":"1e14e06ca3b2c1089cfba2e8eaf0c1f373d9d6374b6082f320962dd71ae09611","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.h":"fd58c155af645295bb6aec08797889de586f4d919731de2bce57e8dce59bb048","glsl-optimizer/src/compiler/glsl/link_uniform_blocks.cpp":"09589f49776dce32e6c4044937de7e0c839a9754ad31960148f8f9e010658997","glsl-optimizer/src/compiler/glsl/link_uniform_initializers.cpp":"bf98e08c12db466acf9623cbeb8fa8e3b4002512722e7a6521287f558a099f37","glsl-optimizer/src/compiler/glsl/link_uniforms.cpp":"84bad5b1377362cecf259b05124239be5220b03ce1c0c61b59bd9a47e4379af2","glsl-optimizer/src/compiler/glsl/link_varyings.cpp":"a5f1a53e7c80d635515fe808ff223d89fef1767abb0f2b7aa28fa6773dca353f","glsl-optimizer/src/compiler/glsl/link_varyings.h":"b9dbe018f038df69763df2e928742ce81bbc6e3aaba26f50621e30a6d9aa6220","glsl-optimizer/src/compiler/glsl/linker.cpp":"40b1ecd5d4f6c7f13d5a87ce390561a51fdf6f3fcd9b2197b9c88b03a773ba94","glsl-optimizer/src/compiler/glsl/linker.h":"ecf94b4ad75ef461c27c557fda4bd25f34c91930822b8e1d729ec84520d4a049","glsl-optimizer/src/compiler/glsl/linker_util.cpp":"1663ad88e2a369305659aeeffaedb5bd752cf76340a2ba5797fc0bf600633cf9","glsl-optimizer/src/compiler/glsl/linker_util.h":"6db788daf9c8e87ae2764b61a8b37ebe419e69c1b82ddee01986e37c978c6993","glsl-optimizer/src/compiler/glsl/list.h":"b1f46ce0e552fe7c45b2a19408a9d97662e23e4b182ab335491c26f8cf25886f","glsl-optimizer/src/compiler/glsl/loop_analysis.cpp":"57ecd573477c68091c7cc99537faa7139a8f395935e3d4f10144cefdefb5a611","glsl-optimizer/src/compiler/glsl/loop_analysis.h":"a85f045a038ee5b5176063e85d7988865862c44ab0580f771b993a042d0b69cc","glsl-optimizer/src/compiler/glsl/loop_unroll.cpp":"bd4292ea2809f5a669bcb76ceaa1ac365772dcd638c579c3ed10275214901a54","glsl-optimizer/src/compiler/glsl/lower_blend_equation_advanced.cpp":"8cfbef140d9c4b4d2f57bfa05c9c374d31a121d0f87afce94333f049023b654a","glsl-optimizer/src/compiler/glsl/lower_buffer_access.cpp":"1ae221c3c7a95aeb867207e7a742be635f91b406c157747bfd6ddf10274d97fb","glsl-optimizer/src/compiler/glsl/lower_buffer_access.h":"807886953a576a323591798cbca5e2df24295ea893b28affd8ffb5926cebaa04","glsl-optimizer/src/compiler/glsl/lower_builtins.cpp":"4d81afc32cf58e1481fcb5e42888ab93dbe6820310a20ff7a9982b77b2152d9b","glsl-optimizer/src/compiler/glsl/lower_const_arrays_to_uniforms.cpp":"608403f0eeeedf21cfcd3014116e0f44e28cbdf6c4c32aac7e613e64e30205e1","glsl-optimizer/src/compiler/glsl/lower_cs_derived.cpp":"179905cd47a294122adeb5b0abfed6f2f67782dcde21b544d1ee2c1985154e66","glsl-optimizer/src/compiler/glsl/lower_discard.cpp":"3b361b2db0004d544d64611cb50d5a6e364cf6c5f2e60c449085d7d753dd7fb0","glsl-optimizer/src/compiler/glsl/lower_discard_flow.cpp":"f5c29b6a27690bb5c91f196d1a1cf9f6be4f1025292311fe2dac561ce6774dee","glsl-optimizer/src/compiler/glsl/lower_distance.cpp":"a118c85493d5d22b2c059a930c51a5854896d4b1dade76598eaa985e5a3dff8c","glsl-optimizer/src/compiler/glsl/lower_if_to_cond_assign.cpp":"469e617757fd1728709cce021aac5c8da05ee503bf5366977bdc4ef7a6d83950","glsl-optimizer/src/compiler/glsl/lower_instructions.cpp":"6ff5c396abe40d8a2145d571e99e2bbe9143393e15aafc28adc2803a01d821b6","glsl-optimizer/src/compiler/glsl/lower_int64.cpp":"d1ed41196880dd53c7b13e2782f9423f8442bf1d46186e8be92b1b66218a83ee","glsl-optimizer/src/compiler/glsl/lower_jumps.cpp":"34de7b493f281589fb0c2c0f6e885d0a0fabbe7a4e97a73de374dd714777a58c","glsl-optimizer/src/compiler/glsl/lower_mat_op_to_vec.cpp":"dff7a308edc4846c348ed4225c6699a9c75abac68d88f41f85954276552779f4","glsl-optimizer/src/compiler/glsl/lower_named_interface_blocks.cpp":"16063ac127bff75a68272070ab11c21c25101edbff62b4c68f4983b4cd941af0","glsl-optimizer/src/compiler/glsl/lower_offset_array.cpp":"3b00773399135aea85746a5a68b96ef000bc6841be1a2c8e6f25c516628b0949","glsl-optimizer/src/compiler/glsl/lower_output_reads.cpp":"a0fc9975d5aa1617e21fc6c353659a9802da9e83779a3eef4ec584f74b4dadc5","glsl-optimizer/src/compiler/glsl/lower_packed_varyings.cpp":"7550099d4ae123d71541c2fc88bc04fbfe9271ec75d7e210987d1c8cac3cf3ea","glsl-optimizer/src/compiler/glsl/lower_packing_builtins.cpp":"79a13d161fe505a410ab948d92769395708693ec888153630fa240e5b97e356f","glsl-optimizer/src/compiler/glsl/lower_precision.cpp":"f82a185b879872b977a1787d8061b9a80bc4cf8db1b970db6efba2ad9cc20fa2","glsl-optimizer/src/compiler/glsl/lower_shared_reference.cpp":"ea2dccf50a83bc19391bf6b7ab6aa53c0005f427af4066d25140340af9a4beef","glsl-optimizer/src/compiler/glsl/lower_subroutine.cpp":"f69fa53650eeb6f2944fce4d36a6e0a423e6705f3a3bd3389c7fadb83cfc8802","glsl-optimizer/src/compiler/glsl/lower_tess_level.cpp":"b196c9d424c0569f3e85d75c2d125af21566cb113d69036db87c0990703e0fa7","glsl-optimizer/src/compiler/glsl/lower_texture_projection.cpp":"4d247f244272adc8250fd888d8d932a140dd5de4d1efc7a58492c3c2b8291527","glsl-optimizer/src/compiler/glsl/lower_ubo_reference.cpp":"89bdbc6c1669230c644c0857db1ce2781ec61d349ecd08c7914146e1f4750a4a","glsl-optimizer/src/compiler/glsl/lower_variable_index_to_cond_assign.cpp":"fce930f29ac9405b297d1f749d68f59506b89c70b4ee1b1ab8cf49a34cc71ecf","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_cond_assign.cpp":"3c67d851a11a55fad1c49a550f3a0cfe50892d33a3f238ce266cd829eba510a8","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_swizzle.cpp":"f5ec666b73e1415cbab32519a53605ed385f3b03e889560373dbce69dda5000e","glsl-optimizer/src/compiler/glsl/lower_vector.cpp":"f7c13f5572ebe09b6a71553133b2cf003cd4b77b9657600672ee3b21bf890725","glsl-optimizer/src/compiler/glsl/lower_vector_derefs.cpp":"b05793da6dd620a531b43df5af8b2ecbc37b9db0c88910f5724ea10bcd057e19","glsl-optimizer/src/compiler/glsl/lower_vector_insert.cpp":"fee772ec17eea5e86a529bf9c5fa2ee0d29a5982bb75ebc6d68ed36cd19aa299","glsl-optimizer/src/compiler/glsl/lower_vertex_id.cpp":"690e8715182e03fead5cc5a35251fb4f41b357e4c71a1dfbc4bd7be19862b56d","glsl-optimizer/src/compiler/glsl/lower_xfb_varying.cpp":"58c0e8b270e4bbde54250be03cdb2f36966bcafb785372ad2e2b786835df7f9f","glsl-optimizer/src/compiler/glsl/main.cpp":"ae5e88abbbc8a12f769e1296bad938b9d7398cc6da0d3d0caeceeeb876536850","glsl-optimizer/src/compiler/glsl/opt_add_neg_to_sub.h":"f5054944bfd068810629080d0ea11df78b3f57a8f86df75e13ca50157ad1964d","glsl-optimizer/src/compiler/glsl/opt_algebraic.cpp":"25f45b20e1972ee8c789177a1aeda6e4286c25db2eae3a43ff83029ae64969c0","glsl-optimizer/src/compiler/glsl/opt_array_splitting.cpp":"19d3ce0e815438f4df9ab2890e767b03a4f3f191b53bb30c0217cf2ae6a95430","glsl-optimizer/src/compiler/glsl/opt_conditional_discard.cpp":"0e44e0e126711a3725c1f3a2aa65ff03c381fed08680ffc30101aae60f716c4e","glsl-optimizer/src/compiler/glsl/opt_constant_folding.cpp":"a088d04d9b45f9e55e235835648f614c89b7803c03a6d4f6a6d1a6bc1f0228bd","glsl-optimizer/src/compiler/glsl/opt_constant_propagation.cpp":"8a9440d77ecd6dcf13e683cbb99943aab6311c8fd4b5f6a9189a8d4f270746f4","glsl-optimizer/src/compiler/glsl/opt_constant_variable.cpp":"63d3ccd4dd09f19c9cf1a2f51592111bed41284504f29f3c0de4cadebc439a37","glsl-optimizer/src/compiler/glsl/opt_copy_propagation_elements.cpp":"ffa0f50863995e0d2e31f55a52e82319edc71e520987bebd7f7e561ea331c64b","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_variables.cpp":"84e8747b948232f01dd56b428b9315f96f9511f605f240119fc446fae28981a9","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_varyings.cpp":"761523e88f5b3ba785170f4d7205e94fa99acb7e74d29efbe40e1c010e1dbdb3","glsl-optimizer/src/compiler/glsl/opt_dead_code.cpp":"fd1ba2da7337d4e5dad17f5c2d73d9cc8880305f423e85d64cf94553588fa401","glsl-optimizer/src/compiler/glsl/opt_dead_code_local.cpp":"969a598b4df322baf222258a66cd64a326ea20e5b3125be9d8d1771f522c69e0","glsl-optimizer/src/compiler/glsl/opt_dead_functions.cpp":"774cae6536d02edf26e996a2a895e1f62d5098f16dc96b44798b4fc731a9a95f","glsl-optimizer/src/compiler/glsl/opt_flatten_nested_if_blocks.cpp":"3696a5c55f02e20056e085bc2714f73ac992f221b6f3387d655068e86b512046","glsl-optimizer/src/compiler/glsl/opt_flip_matrices.cpp":"44f0fe05b49329667671f88c96dc86ab3fe1459ff7b87f2b2d88de2d49829f9f","glsl-optimizer/src/compiler/glsl/opt_function_inlining.cpp":"fb56a33c90419a01676b57cbd91d0674a54cca40e6defaacc88dd33facebc131","glsl-optimizer/src/compiler/glsl/opt_if_simplification.cpp":"ac406eb35e379c357641d6c5749f50c65961455924d3dc884e2b90046fa92c5c","glsl-optimizer/src/compiler/glsl/opt_minmax.cpp":"8abd59d3b14ef60ff14a9c69660e6945f5cf10b97edb4afebe56be3f81d96316","glsl-optimizer/src/compiler/glsl/opt_rebalance_tree.cpp":"8bb6329dc0f299042368fc81934c2df019b45ab9f7aa0415d4e57b8d1ff98c9f","glsl-optimizer/src/compiler/glsl/opt_redundant_jumps.cpp":"222c73e2ac7a938ebb6428cc6c780c908ff6156d8ff935b04fed93a48fc10496","glsl-optimizer/src/compiler/glsl/opt_structure_splitting.cpp":"2edc79cc13f3177934e0443ad62f5976a1991f01f86ea303a803434849b13a47","glsl-optimizer/src/compiler/glsl/opt_swizzle.cpp":"015d0abddfe507f67c4b96c82988d861d018ededf7bf055e2bcbe9ea92da694e","glsl-optimizer/src/compiler/glsl/opt_tree_grafting.cpp":"46d28ac983ea244a4315bdc0e8892979ec4d1f9b9a96ac8a8a08006d9bc5e878","glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp":"d80ee43bb97d9f016fb9c5e1e06f5b2afa569811f368ba067be794ec11d085fb","glsl-optimizer/src/compiler/glsl/program.h":"2982447e2abd35371e273ad87951722782a8b21c08294f67c39d987da1e1c55f","glsl-optimizer/src/compiler/glsl/propagate_invariance.cpp":"080943e21baa32494723a2eefb185915d2daae1f46d6df420145c5ad6857e119","glsl-optimizer/src/compiler/glsl/s_expression.cpp":"1ced972bc6ecc8eab4116ea71fb0212ab9ae5bcc0be3b47aa5d9d903566b3af1","glsl-optimizer/src/compiler/glsl/s_expression.h":"65b847e30e22a809b57d0bc70243049c99d9c6318803c5b8d0826aba55dc217e","glsl-optimizer/src/compiler/glsl/serialize.cpp":"be0eb4251348a9d921acb839a5c48c6023a2e9d116d602bb0432787ab623655d","glsl-optimizer/src/compiler/glsl/serialize.h":"57425732eba1233d928e5f07f88b623ce65af46b3bb034bf147f0a4b7f94f9a1","glsl-optimizer/src/compiler/glsl/shader_cache.cpp":"e0c5c433f2df3fccdf1d61281bfcb0ee5633433339b97c697d64db99611cbaaf","glsl-optimizer/src/compiler/glsl/shader_cache.h":"9217164d8d7f54aca0fe5922c7187095a6ae0cb703b196b79805aeef07a7e697","glsl-optimizer/src/compiler/glsl/standalone.cpp":"8e6c416a14d631261917a5fe4cc91880c287b22b2dfd70eb22028289a8fa5364","glsl-optimizer/src/compiler/glsl/standalone.h":"a7c397d1dfdd1e7fb2cfe99db35cd9df93251e642059208533202b7f20497f83","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.cpp":"970d14b7a9d58e5270321f97bf5d57795558b1c570a56678e04a65b26c60bf4f","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.h":"d921a617ea82b9e49413314492a645c44356de503581b1be3f1b57de236e480d","glsl-optimizer/src/compiler/glsl/string_to_uint_map.cpp":"d824bf5b839bd39498dc9e457103cdbe3e5289ddf7564107c27b1505948dd31f","glsl-optimizer/src/compiler/glsl/string_to_uint_map.h":"e2f18e66359c9d620e085de7f4a334a47df9c66e65a5bfe8b734c627bec04104","glsl-optimizer/src/compiler/glsl/test_optpass.h":"b27b8f35f5387e7ce4982bb51c7b63ccf14f91757f3108a5d02ed006925bb8a0","glsl-optimizer/src/compiler/glsl/xxd.py":"376484142f27f45090ea8203ae2621abf73f06175cb0ee8d96f44a3b9327f4bd","glsl-optimizer/src/compiler/glsl_types.cpp":"044bb6754f45419a3151e7a25c39202a82009ae3c6bc54ff7f0bb4258a5deefe","glsl-optimizer/src/compiler/glsl_types.h":"fd899a42f34ddeb8601bc3cd6c5e3aed82fc8aef4042dde1b39b3c01e1dcc219","glsl-optimizer/src/compiler/shader_enums.c":"436bff5216b11b0980bdfada5885fc6ac9afa2037a3027fcd6eea2a8635597ac","glsl-optimizer/src/compiler/shader_enums.h":"13220442a5c02e83540cf2c0ad4f8417b2fbda5f2586dec4e92082544c937cdd","glsl-optimizer/src/compiler/shader_info.h":"4c5453e81197ca83593ee4f365074b23530f2ab21c78e1733b63dec6f344c12a","glsl-optimizer/src/gallium/auxiliary/util/u_half.h":"3c2b37bda3ccb64387e44b723d29cf9046decab1a893bf42d842e9603398bdee","glsl-optimizer/src/gallium/include/pipe/p_compiler.h":"c75620096ce8523dae90599e50aa2ef6468d3b0e368a77795edeb20dd1abfc0c","glsl-optimizer/src/gallium/include/pipe/p_config.h":"a27692fc35f9e55df3224b7529e66b3001e911e94e6bc5f8f569e493e1ee3fb7","glsl-optimizer/src/gallium/include/pipe/p_defines.h":"be26d68c0acc67c5e44788c6299716a9eee415fd81d7d747e3738a829e3b6b38","glsl-optimizer/src/gallium/include/pipe/p_format.h":"5674215fc41d27496f037cf837717daefbf23ebb38d40ace7c0c414bc08182b0","glsl-optimizer/src/gallium/include/pipe/p_state.h":"d600593aba5f5a17072a6c38f6baa81e01c7994b0174250f7e433bb41684b702","glsl-optimizer/src/mapi/glapi/glapi.h":"73632a625c0ddabc401205e8b5a81eb8af8506868efe4b170d7979ec3619e9c5","glsl-optimizer/src/mesa/main/config.h":"5800259373099e5405de2eb52619f9de242552a479902a3a642a333c8cb3c1e7","glsl-optimizer/src/mesa/main/context.c":"2f3208473d99c94f734b1137ba91889d4a1babb9e7534bf1dc85d851ee98274e","glsl-optimizer/src/mesa/main/context.h":"cc7e4194797db9d007f01884e23d786c453b3860821f7f2ddcdf0f1bf3f8ffb1","glsl-optimizer/src/mesa/main/dd.h":"6a964acd06b6c2d88700e69fb75fe3c6b3b3d45bbc41db24f3f897a29695fe0c","glsl-optimizer/src/mesa/main/debug_output.h":"7312422e90b8c0e34028ac27280e438139b5cba525c99deb3ac883cd3d87e452","glsl-optimizer/src/mesa/main/draw.h":"7eaef3a9e27a60ea6f7937109bf3a6190b831162fde0479abb12077ce27c353d","glsl-optimizer/src/mesa/main/enums.h":"87d562a6764f51c014a2274fa7c3aca17c04441537ddd56b2554f13c6fffea92","glsl-optimizer/src/mesa/main/errors.h":"c79444b5df289c90fbb22a33b2d0c23917d9fc4510960088f0b79e53bb56b1b2","glsl-optimizer/src/mesa/main/extensions.h":"a38b2f87cc93c513994281350d69e06c84ff8eded5313ec0a1be33f375e0ebbd","glsl-optimizer/src/mesa/main/extensions_table.c":"17642d1a8c9a0bf2bd61060052d33ff14a005d2b962e6cf91465797a50851e85","glsl-optimizer/src/mesa/main/extensions_table.h":"2c879571c238d2e14461031ac740372fd0f9ac3a34c0d5541bb9b7ed4c0376c8","glsl-optimizer/src/mesa/main/formats.h":"02e2f7ec3e39286cf9f27e2641043e6df8ecb1dfde9e643313210e214af2a929","glsl-optimizer/src/mesa/main/glheader.h":"58217b33eead6aa6b23cd4a291cefeaa6cb84e465f4960daffca97c44d6d1c35","glsl-optimizer/src/mesa/main/glthread.h":"51fb2711f77e7eafcfc52d29d5b844978832b24c930d88accd48d143a6eb9c6f","glsl-optimizer/src/mesa/main/hash.h":"7e7f782034c16a8e693de48e00c31d4a90b0129f4029fd074033d7d16ccbe718","glsl-optimizer/src/mesa/main/macros.h":"73d15ddfd64f2b57b9b2ffeeb993b9c2c0899a80563e9d6ff337b11ccbe6eee5","glsl-optimizer/src/mesa/main/menums.h":"5dfac0e2279d60b0cd0c7b9fc2a5021620d0f6282ed2e738c420214e3af152d3","glsl-optimizer/src/mesa/main/mesa_private.h":"edda678b93438944279a551f663b8858ad84814a9fc88ba9672ef195599c24ae","glsl-optimizer/src/mesa/main/mtypes.h":"6efddefa099e4d2e3fdd97f0055644f47aba21711385edfeabc2d9b0676f2eec","glsl-optimizer/src/mesa/main/shaderobj.h":"9f0dfe96d0c2154201adef942bd36053533ac7b2492fb3786acda5bea514c75e","glsl-optimizer/src/mesa/main/uniforms.h":"4e331e6ad6e9cbded978b4082dbe0a57c1f8f01327446bb6892bfc179976c38b","glsl-optimizer/src/mesa/main/version.h":"9d0a13a758099302dc55cf7d045791834a89b0f9d4cf17b2692259b369a8a9a1","glsl-optimizer/src/mesa/math/m_matrix.h":"a37b19f182e070db3df93b0ede43c22fb8be8c2906504133ee6dbd7db1185d8b","glsl-optimizer/src/mesa/program/dummy_errors.c":"1820e305515b4c5e041f5e1623266a48ec8f076a155310be7d60637101f593e4","glsl-optimizer/src/mesa/program/ir_to_mesa.h":"b47f58d22e3ca2ae42d52501ea769d15c4476834944fa97eeccd3a3439211d00","glsl-optimizer/src/mesa/program/prog_instruction.h":"ab3832152a7e144b59e5a2264b2c29db56d93be31e76bbd958527a56771b40eb","glsl-optimizer/src/mesa/program/prog_parameter.h":"ba18c743284eadbc837c2c364c73e5d372321a7637a76e589d8d39fe8b5de225","glsl-optimizer/src/mesa/program/prog_statevars.h":"fc413698f84bc52d45fdeae0471934ee9904bfb7eac1a2b5f70446e54bcbbdca","glsl-optimizer/src/mesa/program/program.h":"1f01026a4eff440a3f122fd9b519d03546fe7f7d8be60dca834e95a2f8fbbfd2","glsl-optimizer/src/mesa/program/symbol_table.c":"6611cb9f078035bf5ff8c9112093a6c7d99f8af99a3931d0c07f227cc72283ea","glsl-optimizer/src/mesa/program/symbol_table.h":"631dc35ac48d5e87962d45507461920f6575610960ffcc42a08cefeb43300cda","glsl-optimizer/src/mesa/vbo/vbo.h":"6eb1dcd9a08c92f276c5fe08da184ff9d455d1be421913b8ad732a7b65e858fb","glsl-optimizer/src/util/bitscan.h":"9e49e694e6b34fe035bc685f32588827eb8cbe7d82878963c7ab52843e1c16aa","glsl-optimizer/src/util/bitset.h":"c40f78515c6230fed18345c6751ce33833a49da7a27901c7e6d7340cbdcbc5e7","glsl-optimizer/src/util/blob.c":"8f729846f66efc9c15485cc5fc24c6ec861fc1fecb2f652573f2a237d481b791","glsl-optimizer/src/util/blob.h":"93e1eaac866b9a7cd6fc03b533c18fb2edf0e97f03395eff4f3a605c4fc14d0c","glsl-optimizer/src/util/compiler.h":"79e3bf40a5bab704e6c949f23a1352759607bb57d80e5d8df2ef159755f10b68","glsl-optimizer/src/util/crc32.c":"2f3467a046b3a76784ecb9aa55d527698c8607fd0b12c622f6691aaa77b58505","glsl-optimizer/src/util/crc32.h":"59bd81865e51042b73a86f8fb117c312418df095fed2d828c5c1d1c8b6fc6cd4","glsl-optimizer/src/util/debug.c":"c3d68e9752ccc19e66c669562cd113cf1d0ac83cbb30174789e7fb8d1df58f9c","glsl-optimizer/src/util/debug.h":"50068d745c4199ccbd33d68dd4c8a36d2b5179c7869a21e75906ddd0718ca456","glsl-optimizer/src/util/detect_os.h":"343a8790d17a3710c6dd015ee367f84e3902ff3f2e36faca2bf93f9d725d3574","glsl-optimizer/src/util/disk_cache.c":"f533937e5a4fffe76e2739ef4b6b1e1da097d96d63eb808e68ebbc7027641c23","glsl-optimizer/src/util/disk_cache.h":"e83314fb14134a8e079b15e470a6376ba5a8253701f048c890a62b7e55d64bc8","glsl-optimizer/src/util/fast_urem_by_const.h":"e108fce804616c47d071dfe4a04163eec1126e448ed1aa89abb6b3a6d772bd5b","glsl-optimizer/src/util/fnv1a.h":"ab2596f19c6adf431ae27618f62c5743e24ad23ef83bb359a4c4c218245ab459","glsl-optimizer/src/util/format/u_format.h":"4cdfc0c59cbc99a092e5ec5a396910f2d93b9643e5d8141050b011e66f11e45b","glsl-optimizer/src/util/futex.h":"26f7c9d86e9ffef4c0fa2761f1aaa1918337302e20bd6ca10e61dc3c47356deb","glsl-optimizer/src/util/half_float.c":"11bc2584493d5d9d46e8c8a619a0307cf150bf5ab5d0f96bb764b061dc37a00e","glsl-optimizer/src/util/half_float.h":"7f7c380f126da1400a91758cc0392f24bf967bce1672890b62be26fe9fbd922b","glsl-optimizer/src/util/hash_table.c":"0ca40352e35dedab0a84c64c903f1b16d47e950bb5f43b4d22bb57d499bfea6e","glsl-optimizer/src/util/hash_table.h":"217191bb360592e2232f187473c10287d2cda8ae6fa5c53d0ef74c8c206118b4","glsl-optimizer/src/util/list.h":"9fab03c6a78186bb5f173269f825f6ce976b409d931852e3d93bac632e07989a","glsl-optimizer/src/util/macros.h":"63faf65b51058c483b17f1f77da51d1c53c8beab52678cb6bd01f1228a63b6b0","glsl-optimizer/src/util/mesa-sha1.c":"00c692ec353ebc02c06c57c5a71de0ab7a119f86a4146f452e65ec87e4944417","glsl-optimizer/src/util/mesa-sha1.h":"bff4c29f4bf7cdbcefb30fa0c996a7604a380eba8976467c2a60e7cd328f7e26","glsl-optimizer/src/util/mesa-sha1_test.c":"25da89a59d51469f77b4c468ca23ffdce0a7a1166a70b6cc23026a6800b0143c","glsl-optimizer/src/util/os_memory.h":"64555faf1760ae6954f42c83727c38dfc4c278e9152115779ffaad58b42adacf","glsl-optimizer/src/util/os_memory_aligned.h":"12d86fa94be38c13f7eeebdf313795e1267dd5a7187d2f0072e0e896f41702f6","glsl-optimizer/src/util/os_memory_stdc.h":"07360363b88c927065e10df71bebf6c8a0cc3b9167c9dfce55f2d65f11e6f787","glsl-optimizer/src/util/os_misc.c":"a9936e613ec84803abd59ad47c192c8e3939993c950ac91973fdc4cec1801bb8","glsl-optimizer/src/util/os_misc.h":"cc68eb12e05b5e749c54298cb4a6f4cd20cc5af7db3403e70b3c27b56090c740","glsl-optimizer/src/util/os_time.h":"73e775f7335244ff5964c678c27eedf1aea6abea44c4169d327ea8c7ce4a3a88","glsl-optimizer/src/util/ralloc.c":"4b51189595ef67bcef52c40cbf654d969041dbd15e15d4a893ad494ac060aeca","glsl-optimizer/src/util/ralloc.h":"e573c45875ff1530f0dbee9a93ae55535fdac8d5cc88a79ebc327c688824bde5","glsl-optimizer/src/util/rounding.h":"0450722353caf83de07e67f335949dbe95fe53b534052d4ee9d28d2781387614","glsl-optimizer/src/util/set.c":"86f8c9a830bead5a5a79bc970b0ff97809312af07b3beb39ef9d90af04d40a1b","glsl-optimizer/src/util/set.h":"3e39ca161e7ed4ec7c436cc9c7919ed9a55ed1b71edbf2caf6f9bcfd9bc578ed","glsl-optimizer/src/util/sha1/README":"00af7419af05247081858acb2902efd99fcda2ce16e331079f701645bb3729c0","glsl-optimizer/src/util/sha1/sha1.c":"1403bbe0aad42ba3e6be7e09f7cad87a6a8c4ad5b63962f7b92b9f37d8133b04","glsl-optimizer/src/util/sha1/sha1.h":"68d9f240eab2918026ecdf22be36811abbd4f1389f6c36e31258041aeaedd247","glsl-optimizer/src/util/simple_mtx.h":"12c6c3c4b7db9168bc656d5b3c65912075084d2b388c415d5c3d3f5953a9d6c7","glsl-optimizer/src/util/softfloat.c":"a97e51a96fe5e6a052c02aa6bbec683fe73fb88a8c087d9c930503e2120d8a2e","glsl-optimizer/src/util/softfloat.h":"66664b0250e83bf5dd4cc743acd119d076efcea624a0eab3d6b60718e6ee8811","glsl-optimizer/src/util/string_buffer.c":"63a1d1b1e34926c88ea00159cafbcd56568b805c4f64d1e8c97169fe313921fc","glsl-optimizer/src/util/string_buffer.h":"7b88d1b1d9c6cfb8e93331813535c127289437c75f822029e9a3bca8ea6b52ee","glsl-optimizer/src/util/strndup.h":"0273c4fdb7482cd7746881a63d3998648c6d63415ba85af1d1860f0e0dc504c6","glsl-optimizer/src/util/strtod.c":"5cf610d8a37373cf37cfb7aae903525d943b2674b1f32594c70b0eb19a8c9697","glsl-optimizer/src/util/strtod.h":"237396def4e264d35ed4bedea00ef9a4ceab6d7a11a18c770d9747d22c69ed2d","glsl-optimizer/src/util/u_atomic.h":"c02e809526c6c09ba8fe51f50b2490d1b6c8e5c7f3c4031ae958250d098fc3bb","glsl-optimizer/src/util/u_debug.c":"8c060e379b816618f3dd22c9ea523c68b9425c76c36a7dfe5d6d375b337f5f4a","glsl-optimizer/src/util/u_debug.h":"e11e26edd9b9e4e6f8e6a435e69f4d9edda27e9a379f68f4c82ea2525aaaea68","glsl-optimizer/src/util/u_dynarray.h":"853d0fa6ff2261614488be624deb8a2b01e57c2c8eabc28578cbeed4ccc95694","glsl-optimizer/src/util/u_endian.h":"3ccea7e529740318d8a4b05c00db3adc9d1e292a52bdc56a05c9fae99209720f","glsl-optimizer/src/util/u_math.c":"c868a8c0886dc78f1b06b13404ba8b253090449045774dd56893ac9d75795184","glsl-optimizer/src/util/u_math.h":"a04e32e126db016413f9de0a2028a3e71737137463b1289eae576f884b06fcf1","glsl-optimizer/src/util/u_memory.h":"c5db17c724c70283ddbe04165722f6988d4e0eb9aa3602ae472feff016649af9","glsl-optimizer/src/util/u_queue.h":"92930ce236c0528a98b695f5cea8c5c6aa9683beaf71a2227bdc5d33d1b21506","glsl-optimizer/src/util/u_string.h":"c5a2f4ef576d1547bda12c4ea219179fefa54414977743ac094abcaf696ef6ca","glsl-optimizer/src/util/u_thread.h":"00b708459b27f9910d18db92c18cc65cfc618ac2b3cd144e45f8640057b10d58","glsl-optimizer/src/util/xxhash.h":"2f2aff2fc6c0c929f52cf6ae7314122124c5be026d41ad1c357608383c4a37ad","src/bindings.rs":"79993db2058bde39f99ef483d02560d33b1cb882f6a552319e8b86eb6f9021e1","src/lib.rs":"04be1554cd829eb40864b06d80b491dd48117a4e3a601c7d482117f7a0391e67","wrapper.hpp":"f3ea34cc496f7d90b9bfcada3250b37b314c3524dac693b2ece9517bc7d274ac"},"package":"913662ae8335df058d56e00f11340b20fa82e03e0276587797ef325ab01e50d4"} -\ No newline at end of file -+{"files":{"Cargo.toml":"010bb96167ff152e0e5ac30f9905dc749a3f038199b70c541c5d8cb97a185ee3","README.md":"4468e08c64c19977707d792bfab0080e35ff927b64990eab77873f8ba056ba1c","build.rs":"6a64610018701781af182c418a4355c9ac5d99d000be9457f0e38a7dadf7542a","glsl-optimizer/CMakeLists.txt":"42ce94744e82ffa000da8b64d81fc140e293b9f5da7dd4cf6b49e7404a2448d9","glsl-optimizer/README.md":"b18eef11a92d267d88a937b1154f7670ee433c730b102fdf7e2da0b02722b146","glsl-optimizer/contrib/glslopt/Main.cpp":"14ba213210c62e234b8d9b0052105fed28eedd83d535ebe85acc10bda7322dd4","glsl-optimizer/contrib/glslopt/Readme":"65d2a6f1aa1dc61e903e090cdade027abad33e02e7c9c81e07dc80508acadec4","glsl-optimizer/generateParsers.sh":"878a97db5d3b69eb3b4c3a95780763b373cfcc0c02e0b28894f162dbbd1b8848","glsl-optimizer/include/GL/gl.h":"1989b51365b6d7d0c48ff6e8b181ef75e2cdf71bfb1626b1cc4362e2f54854a3","glsl-optimizer/include/GL/glext.h":"2ac3681045a35a2194a81a960cad395c04bef1c8a20ef46b799fb24af3ec5f70","glsl-optimizer/include/KHR/khrplatform.h":"1448141a0c054d7f46edfb63f4fe6c203acf9591974049481c32442fb03fd6ed","glsl-optimizer/include/c11/threads.h":"56e9e592b28df19f0db432125223cb3eb5c0c1f960c22db96a15692e14776337","glsl-optimizer/include/c11/threads_posix.h":"f922e2c8613582a9340aa5ae37a4f7bd962dbc30e33a7a6ab14bed2d2995bc2b","glsl-optimizer/include/c11/threads_win32.h":"95bf19d7fc14d328a016889afd583e4c49c050a93bcfb114bd2e9130a4532488","glsl-optimizer/include/c11_compat.h":"103fedb48f658d36cb416c9c9e5ea4d70dff181aab551fcb1028107d098ffa3e","glsl-optimizer/include/c99_compat.h":"aafad02f1ea90a7857636913ea21617a0fcd6197256dcfc6dd97bb3410ba892e","glsl-optimizer/include/no_extern_c.h":"40069dbb6dd2843658d442f926e609c7799b9c296046a90b62b570774fd618f5","glsl-optimizer/license.txt":"e26a745226f4a46b3ca00ffbe8be18507362189a2863d04b4f563ba176a9a836","glsl-optimizer/src/compiler/builtin_type_macros.h":"5b4fc4d4da7b07f997b6eb569e37db79fa0735286575ef1fab08d419e76776ff","glsl-optimizer/src/compiler/glsl/README":"e7d408b621c1b605857c4cab63902f615edb06b530142b91ac040808df6e22f7","glsl-optimizer/src/compiler/glsl/TODO":"dd3b7a098e6f9c85ca8c99ce6dea49d65bb75d4cea243b917f29e4ad2c974603","glsl-optimizer/src/compiler/glsl/ast.h":"3e68ff374350c49211a9931f7f55a485d8d89fc4b21caaffbf6655009ad95bf8","glsl-optimizer/src/compiler/glsl/ast_array_index.cpp":"92b4d501f33e0544c00d14e4f8837753afd916c2b42e076ccc95c9e8fc37ba94","glsl-optimizer/src/compiler/glsl/ast_expr.cpp":"afd712a7b1beb2b633888f4a0911b0a8e4ae5eb5ab9c1e3f247d518cdaaa56d6","glsl-optimizer/src/compiler/glsl/ast_function.cpp":"74f4fbd490e366b37f4715168bb3465ecd9334d4130942f75dcc8e80e8e7f027","glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp":"d0f798eb09271d41d068b9e7b18220d37f1ed0083300ab51eba30989698fe23d","glsl-optimizer/src/compiler/glsl/ast_type.cpp":"8eb790b24b26dfb72bdc333744b566c26d8464c5d47d20eae659461f5c4899f7","glsl-optimizer/src/compiler/glsl/builtin_functions.cpp":"454189d643c220fcb49116ee5c8a34f7b349aa67564040deb8607f6a41a15e70","glsl-optimizer/src/compiler/glsl/builtin_functions.h":"a37cad7ed09b522c5b8bec7b80115a36846e7ba6e0874a2a858e32f7f202c665","glsl-optimizer/src/compiler/glsl/builtin_int64.h":"619def6f3aebf180da3944ef08f159ab12a58b24767e41d8b985ac37ded54d62","glsl-optimizer/src/compiler/glsl/builtin_types.cpp":"afec060b62d6f3b00bfbf94e9fa5f96341ce096c128d1eef322791e6ed9cea4d","glsl-optimizer/src/compiler/glsl/builtin_variables.cpp":"6563bfb1345cbca4c77e00eef09ad152f3e1dc271d246a08c5ce9e1f4ce4250a","glsl-optimizer/src/compiler/glsl/float64.glsl":"1072fd888be48c2a7a5117cd2d92a65f034965a66375f598bb856bff5d7be766","glsl-optimizer/src/compiler/glsl/generate_ir.cpp":"e5f0175370a0d07f93c48d3f0f1b8233d12c64a7b02de02dcc753ef7b398ef0f","glsl-optimizer/src/compiler/glsl/glcpp/README":"a0332a1b221d047e9cce5181a64d4ac4056046fd878360ec8ae3a7b1e062bcff","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.c":"2d179879b1ffe84f58875eee5b0c19b6bae9c973b0c48e6bcd99978f2f501c80","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.l":"e4c5744c837200dafd7c15a912d13f650308ea552454d4fa67271bc0a5bde118","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.c":"03494f9ce1cb82260506e2559e73a3eeb622c4bd51b65eaa0a2c3351862bd4c8","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.h":"264d9a18421cde255ce34a0a62b3d8e73465359f0d167e64aa3973062aae5bdd","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.y":"fafb66e3a8f149d19e085f18a4273ba6d4c11af9e9a01d665cc784dddf97b79f","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.c":"37ed294403c2abfd17fd999d1ae8d11b170e5e9c878979fefac74a31195c96b0","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.h":"85ac8b444bcbd0822b66448a1da407b6ae5467b649f5afaf5c58325bd7569468","glsl-optimizer/src/compiler/glsl/glcpp/pp.c":"a52d94f1bcb3fb2747a95709c4a77c25de7eea8354d2b83bb18efd96976a4473","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.c":"d11aeb3acfe966d1b78f1ee49804093f2434214c41391d139ffcb67b69dc9862","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.h":"abbf1f36ec5a92d035bfbb841b9452287d147616e56373cdbee1c0e55af46406","glsl-optimizer/src/compiler/glsl/glsl_lexer.cpp":"272b9fc1383d72b81bfc03fa11fdf82270ed91a294e523f9ce2b4554bd3effa9","glsl-optimizer/src/compiler/glsl/glsl_lexer.ll":"2b57d9f9eb830c3d7961d4533048a158ee6f458c8d05c65bea7b7cfbc36e4458","glsl-optimizer/src/compiler/glsl/glsl_optimizer.cpp":"f8095d20629d0af70be930b0612e169edb274551a1d25a3cd1bf9995a11ce2e8","glsl-optimizer/src/compiler/glsl/glsl_optimizer.h":"22e843b4ec53ba5f6cd85ca5f7bad33922dca8061b19fb512d46f1caca8d4757","glsl-optimizer/src/compiler/glsl/glsl_parser.cpp":"126baf368d525aba301854e3d91ba60b5aee32e1102376af71416f32cb95ec48","glsl-optimizer/src/compiler/glsl/glsl_parser.h":"2ea9a50716098a8f7bef782d2a030d757b68da73afb01b4d4940d3e8381d44e8","glsl-optimizer/src/compiler/glsl/glsl_parser.yy":"6b1fd1576b29fce005dff744a6dbd0219e4c695c361d61864e1f3a8d6fa6b764","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.cpp":"aad64b5b66467da650091430681e8c6a820cf3cadc4db3c160bf2f15875390ae","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.h":"71fd0e92bbdb193dfb067d7bfdb1200d77392be2fbd0cbfc9ca89d1bb4c7e741","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.cpp":"6660fb83c0ddddbbd64581d46ccfdb9c84bfaa99d13348c289e6442ab00df046","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.h":"24682b8304e0ea3f6318ddb8c859686bd1faee23cd0511d1760977ae975d41bf","glsl-optimizer/src/compiler/glsl/hir_field_selection.cpp":"72a039b0fcab4161788def9e4bedac7ac06a20d8e13146529c6d246bd5202afd","glsl-optimizer/src/compiler/glsl/int64.glsl":"303dbe95dde44b91aee3e38b115b92028400d6a92f9268975d607471984e13eb","glsl-optimizer/src/compiler/glsl/ir.cpp":"2b4741cce90b5d4abff5d719c7324e2693c67294d4d99736cb241554adb281bc","glsl-optimizer/src/compiler/glsl/ir.h":"990b1c74447c4eb4835353ccb0ed9aea644f97fc1129ef1739cd935075d85d2e","glsl-optimizer/src/compiler/glsl/ir_array_refcount.cpp":"8cdc1cffe01e42e0566fa2193a75f789628e8025ad1b82f0ee6f204451b7f9f7","glsl-optimizer/src/compiler/glsl/ir_array_refcount.h":"75f06ec81342b379096ca52e1dc0fd5f19a11ff8e9b58203c20628179d644c12","glsl-optimizer/src/compiler/glsl/ir_basic_block.cpp":"1e2920b1c0ecb08424c745c558f84d0d7e44b74585cf2cc2265dc4dfede3fa2f","glsl-optimizer/src/compiler/glsl/ir_basic_block.h":"81be7da0fc0ee547cd13ec60c1fcd7d3ce3d70d7e5e988f01a3b43a827acdf05","glsl-optimizer/src/compiler/glsl/ir_builder.cpp":"daba29c5a1efdd5a9754f420eb3e2ebdf73485273497f40d4863dadeddb23c0d","glsl-optimizer/src/compiler/glsl/ir_builder.h":"2822e74dd3f6e3df8b300af27d5b11ea2dd99d0e5e7ca809b7bbcce9833c483c","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.cpp":"8c6df5abf2fe313363f285f171c19ca6c8ee4f3bc2ed79d33c0c88cc8be45c48","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.h":"799852adc3a0e54d04080655e7cebfa0d3bf5b6ffed5d8414f141380665d4db7","glsl-optimizer/src/compiler/glsl/ir_clone.cpp":"d897a4e1f5bbec4a6a2f15044c1be9a4d13899c73be77335b041049a4589aa5d","glsl-optimizer/src/compiler/glsl/ir_constant_expression.cpp":"78bd87ddb09db67f6c499067728d72aef4f16aa02721a99a4b769d1e0cfa9010","glsl-optimizer/src/compiler/glsl/ir_equals.cpp":"bca28533a6310b0fc152b56d80872368f1510dc62ed6e8ac199b9ffa7fac02e7","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.cpp":"7e918d4e1f237eca01396004015865ce345afe32a876c9dbc6728576a1a7eae4","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.h":"f45b66aa9497520e7e08e612d24b308477c34477fbd963ee9320eac664957f16","glsl-optimizer/src/compiler/glsl/ir_expression_operation.h":"cc9f10727dbd26cac506804f51456302c702650f9eeb59054a7e1575d5cf6687","glsl-optimizer/src/compiler/glsl/ir_expression_operation.py":"7b86c96021b9fbe165957f4ecb0b612fefcde1c2cf3c6d75e3cdb22e369216ba","glsl-optimizer/src/compiler/glsl/ir_expression_operation_constant.h":"9ad3346416392e3efa11e12ecf2feca7453c5253d241eb96c91dfb85d4f2b971","glsl-optimizer/src/compiler/glsl/ir_expression_operation_strings.h":"a6826daf496a8b9e89885bc2a161ac3445d501b23c6e0ac33e2c01b506b273c8","glsl-optimizer/src/compiler/glsl/ir_function.cpp":"7537365fc0fbe4b37a26b9a2146cc64d3e9a774d60eab63b65002ad165ae8fc7","glsl-optimizer/src/compiler/glsl/ir_function_can_inline.cpp":"faddbf112187a048d502716a3fb82570a322299ba2a3abd79388382c82040bfc","glsl-optimizer/src/compiler/glsl/ir_function_detect_recursion.cpp":"9176973eaf5c0a984701f953bb7a80f37dca43d59b5bce50fc69b3f02f2902d7","glsl-optimizer/src/compiler/glsl/ir_function_inlining.h":"9739493f99c489987d650762fccdd3fb3d432f6481d67f6c799176685bd59632","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.cpp":"3725861fbe2b98e0617f52d3b14cf6d3b25fb5ec00f5ef5d308b03642f592767","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.h":"e0560210e966c0c31e4ca843e80ea154e64db5a444b8c2df845b6ba5b3a43fc1","glsl-optimizer/src/compiler/glsl/ir_hv_accept.cpp":"caf7ce2cd9494aadd3c58bcf77f29de58368dc9e347a362bbf37f8bda9509b80","glsl-optimizer/src/compiler/glsl/ir_optimization.h":"8b3dcfc7f9e96b21a8dd47a0040d90be483a9e67a2cdce3a697188fb758d4630","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.cpp":"f8e34a983452be0dcb5a695e9c8e895eead24f9e540992a8afe510ae85da4c4c","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.h":"1ad1bd3efd1ace39051c13f904c05fd80425d329444f9a8d47fd6d948faf46e0","glsl-optimizer/src/compiler/glsl/ir_print_visitor.cpp":"643f5a68aae3fb37267fd793f1216d1cfdeb2c09338c26b1f30e4c6deaef4de5","glsl-optimizer/src/compiler/glsl/ir_print_visitor.h":"4573eb93268a2654c14b505253dd651e2695d43dc745904d824da18305269b95","glsl-optimizer/src/compiler/glsl/ir_reader.cpp":"06bfba802c8354e5a8b2334b6d78d6297de18235bedd3f8fbb382c89870b02f2","glsl-optimizer/src/compiler/glsl/ir_reader.h":"63e3f7f1597936a7011d5b520e171b197bf82bee6c1560d822c3edf5aaa6f9e9","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.cpp":"84b5c5d746555adca85759c2912fe48010232b7c1c0bd2cf03bd04067a85e66f","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.h":"fd8c561b71085d3211fff85ed514fecb299d8ce19a04bc063419a55b6d840525","glsl-optimizer/src/compiler/glsl/ir_set_program_inouts.cpp":"ab9f115ce9e7f312d9c7978340ced0dc4ae6d13a80e08442ba9709d11d50cae5","glsl-optimizer/src/compiler/glsl/ir_uniform.h":"683ae6896b1a08470c090be5f822fc31cd434eab9216e954b9bba24a46975109","glsl-optimizer/src/compiler/glsl/ir_unused_structs.cpp":"9c1620c45f2fc071fe5ed828472040b14c5f42effe06aa0e3b8352c95ef78786","glsl-optimizer/src/compiler/glsl/ir_unused_structs.h":"13387b49c23093575276b25b9dfd31fedd8f131c5c4f3128ab04cf03e15b5295","glsl-optimizer/src/compiler/glsl/ir_validate.cpp":"6b232be5999a86ea278f4f15b2832d76843246509118d924243055a3b9b0299f","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.cpp":"2764a3cad937d53f36db7447c3a5b98b04bf153acf81074d971857fc5bca460d","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.h":"b0668e3eb1501ef65e38fe12830742ecb3d28e6039f30e366c8924efc29b4a39","glsl-optimizer/src/compiler/glsl/ir_visitor.h":"f21b3534c3d66d5fb707d1581fece7e1eb043523afbaedf89918cfb031c6df94","glsl-optimizer/src/compiler/glsl/link_atomics.cpp":"360f0209e11f367ba358223597b0a118bae095bff16337cf03f1fb89c5b80ca6","glsl-optimizer/src/compiler/glsl/link_functions.cpp":"de7895da8aa33a1e3c2c1eb2fdaf267ab5d1fbfdb79ae2e67f95211e946e294c","glsl-optimizer/src/compiler/glsl/link_interface_blocks.cpp":"1926cfa73810704eb19b916c1b2cdb9321155e2f98b2a0a57c7c3c6e960540cd","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.cpp":"1e14e06ca3b2c1089cfba2e8eaf0c1f373d9d6374b6082f320962dd71ae09611","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.h":"fd58c155af645295bb6aec08797889de586f4d919731de2bce57e8dce59bb048","glsl-optimizer/src/compiler/glsl/link_uniform_blocks.cpp":"09589f49776dce32e6c4044937de7e0c839a9754ad31960148f8f9e010658997","glsl-optimizer/src/compiler/glsl/link_uniform_initializers.cpp":"bf98e08c12db466acf9623cbeb8fa8e3b4002512722e7a6521287f558a099f37","glsl-optimizer/src/compiler/glsl/link_uniforms.cpp":"84bad5b1377362cecf259b05124239be5220b03ce1c0c61b59bd9a47e4379af2","glsl-optimizer/src/compiler/glsl/link_varyings.cpp":"a5f1a53e7c80d635515fe808ff223d89fef1767abb0f2b7aa28fa6773dca353f","glsl-optimizer/src/compiler/glsl/link_varyings.h":"b9dbe018f038df69763df2e928742ce81bbc6e3aaba26f50621e30a6d9aa6220","glsl-optimizer/src/compiler/glsl/linker.cpp":"40b1ecd5d4f6c7f13d5a87ce390561a51fdf6f3fcd9b2197b9c88b03a773ba94","glsl-optimizer/src/compiler/glsl/linker.h":"ecf94b4ad75ef461c27c557fda4bd25f34c91930822b8e1d729ec84520d4a049","glsl-optimizer/src/compiler/glsl/linker_util.cpp":"1663ad88e2a369305659aeeffaedb5bd752cf76340a2ba5797fc0bf600633cf9","glsl-optimizer/src/compiler/glsl/linker_util.h":"6db788daf9c8e87ae2764b61a8b37ebe419e69c1b82ddee01986e37c978c6993","glsl-optimizer/src/compiler/glsl/list.h":"b1f46ce0e552fe7c45b2a19408a9d97662e23e4b182ab335491c26f8cf25886f","glsl-optimizer/src/compiler/glsl/loop_analysis.cpp":"57ecd573477c68091c7cc99537faa7139a8f395935e3d4f10144cefdefb5a611","glsl-optimizer/src/compiler/glsl/loop_analysis.h":"a85f045a038ee5b5176063e85d7988865862c44ab0580f771b993a042d0b69cc","glsl-optimizer/src/compiler/glsl/loop_unroll.cpp":"bd4292ea2809f5a669bcb76ceaa1ac365772dcd638c579c3ed10275214901a54","glsl-optimizer/src/compiler/glsl/lower_blend_equation_advanced.cpp":"8cfbef140d9c4b4d2f57bfa05c9c374d31a121d0f87afce94333f049023b654a","glsl-optimizer/src/compiler/glsl/lower_buffer_access.cpp":"1ae221c3c7a95aeb867207e7a742be635f91b406c157747bfd6ddf10274d97fb","glsl-optimizer/src/compiler/glsl/lower_buffer_access.h":"807886953a576a323591798cbca5e2df24295ea893b28affd8ffb5926cebaa04","glsl-optimizer/src/compiler/glsl/lower_builtins.cpp":"4d81afc32cf58e1481fcb5e42888ab93dbe6820310a20ff7a9982b77b2152d9b","glsl-optimizer/src/compiler/glsl/lower_const_arrays_to_uniforms.cpp":"608403f0eeeedf21cfcd3014116e0f44e28cbdf6c4c32aac7e613e64e30205e1","glsl-optimizer/src/compiler/glsl/lower_cs_derived.cpp":"179905cd47a294122adeb5b0abfed6f2f67782dcde21b544d1ee2c1985154e66","glsl-optimizer/src/compiler/glsl/lower_discard.cpp":"3b361b2db0004d544d64611cb50d5a6e364cf6c5f2e60c449085d7d753dd7fb0","glsl-optimizer/src/compiler/glsl/lower_discard_flow.cpp":"f5c29b6a27690bb5c91f196d1a1cf9f6be4f1025292311fe2dac561ce6774dee","glsl-optimizer/src/compiler/glsl/lower_distance.cpp":"a118c85493d5d22b2c059a930c51a5854896d4b1dade76598eaa985e5a3dff8c","glsl-optimizer/src/compiler/glsl/lower_if_to_cond_assign.cpp":"469e617757fd1728709cce021aac5c8da05ee503bf5366977bdc4ef7a6d83950","glsl-optimizer/src/compiler/glsl/lower_instructions.cpp":"6ff5c396abe40d8a2145d571e99e2bbe9143393e15aafc28adc2803a01d821b6","glsl-optimizer/src/compiler/glsl/lower_int64.cpp":"d1ed41196880dd53c7b13e2782f9423f8442bf1d46186e8be92b1b66218a83ee","glsl-optimizer/src/compiler/glsl/lower_jumps.cpp":"34de7b493f281589fb0c2c0f6e885d0a0fabbe7a4e97a73de374dd714777a58c","glsl-optimizer/src/compiler/glsl/lower_mat_op_to_vec.cpp":"dff7a308edc4846c348ed4225c6699a9c75abac68d88f41f85954276552779f4","glsl-optimizer/src/compiler/glsl/lower_named_interface_blocks.cpp":"16063ac127bff75a68272070ab11c21c25101edbff62b4c68f4983b4cd941af0","glsl-optimizer/src/compiler/glsl/lower_offset_array.cpp":"3b00773399135aea85746a5a68b96ef000bc6841be1a2c8e6f25c516628b0949","glsl-optimizer/src/compiler/glsl/lower_output_reads.cpp":"a0fc9975d5aa1617e21fc6c353659a9802da9e83779a3eef4ec584f74b4dadc5","glsl-optimizer/src/compiler/glsl/lower_packed_varyings.cpp":"7550099d4ae123d71541c2fc88bc04fbfe9271ec75d7e210987d1c8cac3cf3ea","glsl-optimizer/src/compiler/glsl/lower_packing_builtins.cpp":"79a13d161fe505a410ab948d92769395708693ec888153630fa240e5b97e356f","glsl-optimizer/src/compiler/glsl/lower_precision.cpp":"f82a185b879872b977a1787d8061b9a80bc4cf8db1b970db6efba2ad9cc20fa2","glsl-optimizer/src/compiler/glsl/lower_shared_reference.cpp":"ea2dccf50a83bc19391bf6b7ab6aa53c0005f427af4066d25140340af9a4beef","glsl-optimizer/src/compiler/glsl/lower_subroutine.cpp":"f69fa53650eeb6f2944fce4d36a6e0a423e6705f3a3bd3389c7fadb83cfc8802","glsl-optimizer/src/compiler/glsl/lower_tess_level.cpp":"b196c9d424c0569f3e85d75c2d125af21566cb113d69036db87c0990703e0fa7","glsl-optimizer/src/compiler/glsl/lower_texture_projection.cpp":"4d247f244272adc8250fd888d8d932a140dd5de4d1efc7a58492c3c2b8291527","glsl-optimizer/src/compiler/glsl/lower_ubo_reference.cpp":"89bdbc6c1669230c644c0857db1ce2781ec61d349ecd08c7914146e1f4750a4a","glsl-optimizer/src/compiler/glsl/lower_variable_index_to_cond_assign.cpp":"fce930f29ac9405b297d1f749d68f59506b89c70b4ee1b1ab8cf49a34cc71ecf","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_cond_assign.cpp":"3c67d851a11a55fad1c49a550f3a0cfe50892d33a3f238ce266cd829eba510a8","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_swizzle.cpp":"f5ec666b73e1415cbab32519a53605ed385f3b03e889560373dbce69dda5000e","glsl-optimizer/src/compiler/glsl/lower_vector.cpp":"f7c13f5572ebe09b6a71553133b2cf003cd4b77b9657600672ee3b21bf890725","glsl-optimizer/src/compiler/glsl/lower_vector_derefs.cpp":"b05793da6dd620a531b43df5af8b2ecbc37b9db0c88910f5724ea10bcd057e19","glsl-optimizer/src/compiler/glsl/lower_vector_insert.cpp":"fee772ec17eea5e86a529bf9c5fa2ee0d29a5982bb75ebc6d68ed36cd19aa299","glsl-optimizer/src/compiler/glsl/lower_vertex_id.cpp":"690e8715182e03fead5cc5a35251fb4f41b357e4c71a1dfbc4bd7be19862b56d","glsl-optimizer/src/compiler/glsl/lower_xfb_varying.cpp":"58c0e8b270e4bbde54250be03cdb2f36966bcafb785372ad2e2b786835df7f9f","glsl-optimizer/src/compiler/glsl/main.cpp":"ae5e88abbbc8a12f769e1296bad938b9d7398cc6da0d3d0caeceeeb876536850","glsl-optimizer/src/compiler/glsl/opt_add_neg_to_sub.h":"f5054944bfd068810629080d0ea11df78b3f57a8f86df75e13ca50157ad1964d","glsl-optimizer/src/compiler/glsl/opt_algebraic.cpp":"25f45b20e1972ee8c789177a1aeda6e4286c25db2eae3a43ff83029ae64969c0","glsl-optimizer/src/compiler/glsl/opt_array_splitting.cpp":"19d3ce0e815438f4df9ab2890e767b03a4f3f191b53bb30c0217cf2ae6a95430","glsl-optimizer/src/compiler/glsl/opt_conditional_discard.cpp":"0e44e0e126711a3725c1f3a2aa65ff03c381fed08680ffc30101aae60f716c4e","glsl-optimizer/src/compiler/glsl/opt_constant_folding.cpp":"a088d04d9b45f9e55e235835648f614c89b7803c03a6d4f6a6d1a6bc1f0228bd","glsl-optimizer/src/compiler/glsl/opt_constant_propagation.cpp":"8a9440d77ecd6dcf13e683cbb99943aab6311c8fd4b5f6a9189a8d4f270746f4","glsl-optimizer/src/compiler/glsl/opt_constant_variable.cpp":"63d3ccd4dd09f19c9cf1a2f51592111bed41284504f29f3c0de4cadebc439a37","glsl-optimizer/src/compiler/glsl/opt_copy_propagation_elements.cpp":"ffa0f50863995e0d2e31f55a52e82319edc71e520987bebd7f7e561ea331c64b","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_variables.cpp":"84e8747b948232f01dd56b428b9315f96f9511f605f240119fc446fae28981a9","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_varyings.cpp":"761523e88f5b3ba785170f4d7205e94fa99acb7e74d29efbe40e1c010e1dbdb3","glsl-optimizer/src/compiler/glsl/opt_dead_code.cpp":"fd1ba2da7337d4e5dad17f5c2d73d9cc8880305f423e85d64cf94553588fa401","glsl-optimizer/src/compiler/glsl/opt_dead_code_local.cpp":"969a598b4df322baf222258a66cd64a326ea20e5b3125be9d8d1771f522c69e0","glsl-optimizer/src/compiler/glsl/opt_dead_functions.cpp":"774cae6536d02edf26e996a2a895e1f62d5098f16dc96b44798b4fc731a9a95f","glsl-optimizer/src/compiler/glsl/opt_flatten_nested_if_blocks.cpp":"3696a5c55f02e20056e085bc2714f73ac992f221b6f3387d655068e86b512046","glsl-optimizer/src/compiler/glsl/opt_flip_matrices.cpp":"44f0fe05b49329667671f88c96dc86ab3fe1459ff7b87f2b2d88de2d49829f9f","glsl-optimizer/src/compiler/glsl/opt_function_inlining.cpp":"fb56a33c90419a01676b57cbd91d0674a54cca40e6defaacc88dd33facebc131","glsl-optimizer/src/compiler/glsl/opt_if_simplification.cpp":"ac406eb35e379c357641d6c5749f50c65961455924d3dc884e2b90046fa92c5c","glsl-optimizer/src/compiler/glsl/opt_minmax.cpp":"8abd59d3b14ef60ff14a9c69660e6945f5cf10b97edb4afebe56be3f81d96316","glsl-optimizer/src/compiler/glsl/opt_rebalance_tree.cpp":"8bb6329dc0f299042368fc81934c2df019b45ab9f7aa0415d4e57b8d1ff98c9f","glsl-optimizer/src/compiler/glsl/opt_redundant_jumps.cpp":"222c73e2ac7a938ebb6428cc6c780c908ff6156d8ff935b04fed93a48fc10496","glsl-optimizer/src/compiler/glsl/opt_structure_splitting.cpp":"2edc79cc13f3177934e0443ad62f5976a1991f01f86ea303a803434849b13a47","glsl-optimizer/src/compiler/glsl/opt_swizzle.cpp":"015d0abddfe507f67c4b96c82988d861d018ededf7bf055e2bcbe9ea92da694e","glsl-optimizer/src/compiler/glsl/opt_tree_grafting.cpp":"46d28ac983ea244a4315bdc0e8892979ec4d1f9b9a96ac8a8a08006d9bc5e878","glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp":"d80ee43bb97d9f016fb9c5e1e06f5b2afa569811f368ba067be794ec11d085fb","glsl-optimizer/src/compiler/glsl/program.h":"2982447e2abd35371e273ad87951722782a8b21c08294f67c39d987da1e1c55f","glsl-optimizer/src/compiler/glsl/propagate_invariance.cpp":"080943e21baa32494723a2eefb185915d2daae1f46d6df420145c5ad6857e119","glsl-optimizer/src/compiler/glsl/s_expression.cpp":"1ced972bc6ecc8eab4116ea71fb0212ab9ae5bcc0be3b47aa5d9d903566b3af1","glsl-optimizer/src/compiler/glsl/s_expression.h":"65b847e30e22a809b57d0bc70243049c99d9c6318803c5b8d0826aba55dc217e","glsl-optimizer/src/compiler/glsl/serialize.cpp":"be0eb4251348a9d921acb839a5c48c6023a2e9d116d602bb0432787ab623655d","glsl-optimizer/src/compiler/glsl/serialize.h":"57425732eba1233d928e5f07f88b623ce65af46b3bb034bf147f0a4b7f94f9a1","glsl-optimizer/src/compiler/glsl/shader_cache.cpp":"e0c5c433f2df3fccdf1d61281bfcb0ee5633433339b97c697d64db99611cbaaf","glsl-optimizer/src/compiler/glsl/shader_cache.h":"9217164d8d7f54aca0fe5922c7187095a6ae0cb703b196b79805aeef07a7e697","glsl-optimizer/src/compiler/glsl/standalone.cpp":"8e6c416a14d631261917a5fe4cc91880c287b22b2dfd70eb22028289a8fa5364","glsl-optimizer/src/compiler/glsl/standalone.h":"a7c397d1dfdd1e7fb2cfe99db35cd9df93251e642059208533202b7f20497f83","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.cpp":"970d14b7a9d58e5270321f97bf5d57795558b1c570a56678e04a65b26c60bf4f","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.h":"d921a617ea82b9e49413314492a645c44356de503581b1be3f1b57de236e480d","glsl-optimizer/src/compiler/glsl/string_to_uint_map.cpp":"d824bf5b839bd39498dc9e457103cdbe3e5289ddf7564107c27b1505948dd31f","glsl-optimizer/src/compiler/glsl/string_to_uint_map.h":"e2f18e66359c9d620e085de7f4a334a47df9c66e65a5bfe8b734c627bec04104","glsl-optimizer/src/compiler/glsl/test_optpass.h":"b27b8f35f5387e7ce4982bb51c7b63ccf14f91757f3108a5d02ed006925bb8a0","glsl-optimizer/src/compiler/glsl/xxd.py":"376484142f27f45090ea8203ae2621abf73f06175cb0ee8d96f44a3b9327f4bd","glsl-optimizer/src/compiler/glsl_types.cpp":"044bb6754f45419a3151e7a25c39202a82009ae3c6bc54ff7f0bb4258a5deefe","glsl-optimizer/src/compiler/glsl_types.h":"fd899a42f34ddeb8601bc3cd6c5e3aed82fc8aef4042dde1b39b3c01e1dcc219","glsl-optimizer/src/compiler/shader_enums.c":"436bff5216b11b0980bdfada5885fc6ac9afa2037a3027fcd6eea2a8635597ac","glsl-optimizer/src/compiler/shader_enums.h":"13220442a5c02e83540cf2c0ad4f8417b2fbda5f2586dec4e92082544c937cdd","glsl-optimizer/src/compiler/shader_info.h":"4c5453e81197ca83593ee4f365074b23530f2ab21c78e1733b63dec6f344c12a","glsl-optimizer/src/gallium/auxiliary/util/u_half.h":"3c2b37bda3ccb64387e44b723d29cf9046decab1a893bf42d842e9603398bdee","glsl-optimizer/src/gallium/include/pipe/p_compiler.h":"c75620096ce8523dae90599e50aa2ef6468d3b0e368a77795edeb20dd1abfc0c","glsl-optimizer/src/gallium/include/pipe/p_config.h":"a27692fc35f9e55df3224b7529e66b3001e911e94e6bc5f8f569e493e1ee3fb7","glsl-optimizer/src/gallium/include/pipe/p_defines.h":"be26d68c0acc67c5e44788c6299716a9eee415fd81d7d747e3738a829e3b6b38","glsl-optimizer/src/gallium/include/pipe/p_format.h":"5674215fc41d27496f037cf837717daefbf23ebb38d40ace7c0c414bc08182b0","glsl-optimizer/src/gallium/include/pipe/p_state.h":"d600593aba5f5a17072a6c38f6baa81e01c7994b0174250f7e433bb41684b702","glsl-optimizer/src/mapi/glapi/glapi.h":"73632a625c0ddabc401205e8b5a81eb8af8506868efe4b170d7979ec3619e9c5","glsl-optimizer/src/mesa/main/config.h":"5800259373099e5405de2eb52619f9de242552a479902a3a642a333c8cb3c1e7","glsl-optimizer/src/mesa/main/context.c":"2f3208473d99c94f734b1137ba91889d4a1babb9e7534bf1dc85d851ee98274e","glsl-optimizer/src/mesa/main/context.h":"cc7e4194797db9d007f01884e23d786c453b3860821f7f2ddcdf0f1bf3f8ffb1","glsl-optimizer/src/mesa/main/dd.h":"6a964acd06b6c2d88700e69fb75fe3c6b3b3d45bbc41db24f3f897a29695fe0c","glsl-optimizer/src/mesa/main/debug_output.h":"7312422e90b8c0e34028ac27280e438139b5cba525c99deb3ac883cd3d87e452","glsl-optimizer/src/mesa/main/draw.h":"7eaef3a9e27a60ea6f7937109bf3a6190b831162fde0479abb12077ce27c353d","glsl-optimizer/src/mesa/main/enums.h":"87d562a6764f51c014a2274fa7c3aca17c04441537ddd56b2554f13c6fffea92","glsl-optimizer/src/mesa/main/errors.h":"c79444b5df289c90fbb22a33b2d0c23917d9fc4510960088f0b79e53bb56b1b2","glsl-optimizer/src/mesa/main/extensions.h":"a38b2f87cc93c513994281350d69e06c84ff8eded5313ec0a1be33f375e0ebbd","glsl-optimizer/src/mesa/main/extensions_table.c":"17642d1a8c9a0bf2bd61060052d33ff14a005d2b962e6cf91465797a50851e85","glsl-optimizer/src/mesa/main/extensions_table.h":"2c879571c238d2e14461031ac740372fd0f9ac3a34c0d5541bb9b7ed4c0376c8","glsl-optimizer/src/mesa/main/formats.h":"02e2f7ec3e39286cf9f27e2641043e6df8ecb1dfde9e643313210e214af2a929","glsl-optimizer/src/mesa/main/glheader.h":"58217b33eead6aa6b23cd4a291cefeaa6cb84e465f4960daffca97c44d6d1c35","glsl-optimizer/src/mesa/main/glthread.h":"51fb2711f77e7eafcfc52d29d5b844978832b24c930d88accd48d143a6eb9c6f","glsl-optimizer/src/mesa/main/hash.h":"7e7f782034c16a8e693de48e00c31d4a90b0129f4029fd074033d7d16ccbe718","glsl-optimizer/src/mesa/main/macros.h":"73d15ddfd64f2b57b9b2ffeeb993b9c2c0899a80563e9d6ff337b11ccbe6eee5","glsl-optimizer/src/mesa/main/menums.h":"5dfac0e2279d60b0cd0c7b9fc2a5021620d0f6282ed2e738c420214e3af152d3","glsl-optimizer/src/mesa/main/mesa_private.h":"edda678b93438944279a551f663b8858ad84814a9fc88ba9672ef195599c24ae","glsl-optimizer/src/mesa/main/mtypes.h":"6efddefa099e4d2e3fdd97f0055644f47aba21711385edfeabc2d9b0676f2eec","glsl-optimizer/src/mesa/main/shaderobj.h":"9f0dfe96d0c2154201adef942bd36053533ac7b2492fb3786acda5bea514c75e","glsl-optimizer/src/mesa/main/uniforms.h":"4e331e6ad6e9cbded978b4082dbe0a57c1f8f01327446bb6892bfc179976c38b","glsl-optimizer/src/mesa/main/version.h":"9d0a13a758099302dc55cf7d045791834a89b0f9d4cf17b2692259b369a8a9a1","glsl-optimizer/src/mesa/math/m_matrix.h":"a37b19f182e070db3df93b0ede43c22fb8be8c2906504133ee6dbd7db1185d8b","glsl-optimizer/src/mesa/program/dummy_errors.c":"1820e305515b4c5e041f5e1623266a48ec8f076a155310be7d60637101f593e4","glsl-optimizer/src/mesa/program/ir_to_mesa.h":"b47f58d22e3ca2ae42d52501ea769d15c4476834944fa97eeccd3a3439211d00","glsl-optimizer/src/mesa/program/prog_instruction.h":"ab3832152a7e144b59e5a2264b2c29db56d93be31e76bbd958527a56771b40eb","glsl-optimizer/src/mesa/program/prog_parameter.h":"ba18c743284eadbc837c2c364c73e5d372321a7637a76e589d8d39fe8b5de225","glsl-optimizer/src/mesa/program/prog_statevars.h":"fc413698f84bc52d45fdeae0471934ee9904bfb7eac1a2b5f70446e54bcbbdca","glsl-optimizer/src/mesa/program/program.h":"1f01026a4eff440a3f122fd9b519d03546fe7f7d8be60dca834e95a2f8fbbfd2","glsl-optimizer/src/mesa/program/symbol_table.c":"6611cb9f078035bf5ff8c9112093a6c7d99f8af99a3931d0c07f227cc72283ea","glsl-optimizer/src/mesa/program/symbol_table.h":"631dc35ac48d5e87962d45507461920f6575610960ffcc42a08cefeb43300cda","glsl-optimizer/src/mesa/vbo/vbo.h":"6eb1dcd9a08c92f276c5fe08da184ff9d455d1be421913b8ad732a7b65e858fb","glsl-optimizer/src/util/bitscan.h":"9e49e694e6b34fe035bc685f32588827eb8cbe7d82878963c7ab52843e1c16aa","glsl-optimizer/src/util/bitset.h":"c40f78515c6230fed18345c6751ce33833a49da7a27901c7e6d7340cbdcbc5e7","glsl-optimizer/src/util/blob.c":"8f729846f66efc9c15485cc5fc24c6ec861fc1fecb2f652573f2a237d481b791","glsl-optimizer/src/util/blob.h":"93e1eaac866b9a7cd6fc03b533c18fb2edf0e97f03395eff4f3a605c4fc14d0c","glsl-optimizer/src/util/compiler.h":"79e3bf40a5bab704e6c949f23a1352759607bb57d80e5d8df2ef159755f10b68","glsl-optimizer/src/util/crc32.c":"2f3467a046b3a76784ecb9aa55d527698c8607fd0b12c622f6691aaa77b58505","glsl-optimizer/src/util/crc32.h":"59bd81865e51042b73a86f8fb117c312418df095fed2d828c5c1d1c8b6fc6cd4","glsl-optimizer/src/util/debug.c":"c3d68e9752ccc19e66c669562cd113cf1d0ac83cbb30174789e7fb8d1df58f9c","glsl-optimizer/src/util/debug.h":"50068d745c4199ccbd33d68dd4c8a36d2b5179c7869a21e75906ddd0718ca456","glsl-optimizer/src/util/detect_os.h":"343a8790d17a3710c6dd015ee367f84e3902ff3f2e36faca2bf93f9d725d3574","glsl-optimizer/src/util/disk_cache.c":"f533937e5a4fffe76e2739ef4b6b1e1da097d96d63eb808e68ebbc7027641c23","glsl-optimizer/src/util/disk_cache.h":"e83314fb14134a8e079b15e470a6376ba5a8253701f048c890a62b7e55d64bc8","glsl-optimizer/src/util/fast_urem_by_const.h":"e108fce804616c47d071dfe4a04163eec1126e448ed1aa89abb6b3a6d772bd5b","glsl-optimizer/src/util/fnv1a.h":"ab2596f19c6adf431ae27618f62c5743e24ad23ef83bb359a4c4c218245ab459","glsl-optimizer/src/util/format/u_format.h":"4cdfc0c59cbc99a092e5ec5a396910f2d93b9643e5d8141050b011e66f11e45b","glsl-optimizer/src/util/futex.h":"26f7c9d86e9ffef4c0fa2761f1aaa1918337302e20bd6ca10e61dc3c47356deb","glsl-optimizer/src/util/half_float.c":"11bc2584493d5d9d46e8c8a619a0307cf150bf5ab5d0f96bb764b061dc37a00e","glsl-optimizer/src/util/half_float.h":"7f7c380f126da1400a91758cc0392f24bf967bce1672890b62be26fe9fbd922b","glsl-optimizer/src/util/hash_table.c":"0ca40352e35dedab0a84c64c903f1b16d47e950bb5f43b4d22bb57d499bfea6e","glsl-optimizer/src/util/hash_table.h":"217191bb360592e2232f187473c10287d2cda8ae6fa5c53d0ef74c8c206118b4","glsl-optimizer/src/util/list.h":"9fab03c6a78186bb5f173269f825f6ce976b409d931852e3d93bac632e07989a","glsl-optimizer/src/util/macros.h":"63faf65b51058c483b17f1f77da51d1c53c8beab52678cb6bd01f1228a63b6b0","glsl-optimizer/src/util/mesa-sha1.c":"00c692ec353ebc02c06c57c5a71de0ab7a119f86a4146f452e65ec87e4944417","glsl-optimizer/src/util/mesa-sha1.h":"bff4c29f4bf7cdbcefb30fa0c996a7604a380eba8976467c2a60e7cd328f7e26","glsl-optimizer/src/util/mesa-sha1_test.c":"25da89a59d51469f77b4c468ca23ffdce0a7a1166a70b6cc23026a6800b0143c","glsl-optimizer/src/util/os_memory.h":"64555faf1760ae6954f42c83727c38dfc4c278e9152115779ffaad58b42adacf","glsl-optimizer/src/util/os_memory_aligned.h":"12d86fa94be38c13f7eeebdf313795e1267dd5a7187d2f0072e0e896f41702f6","glsl-optimizer/src/util/os_memory_stdc.h":"07360363b88c927065e10df71bebf6c8a0cc3b9167c9dfce55f2d65f11e6f787","glsl-optimizer/src/util/os_misc.c":"a9936e613ec84803abd59ad47c192c8e3939993c950ac91973fdc4cec1801bb8","glsl-optimizer/src/util/os_misc.h":"cc68eb12e05b5e749c54298cb4a6f4cd20cc5af7db3403e70b3c27b56090c740","glsl-optimizer/src/util/os_time.h":"73e775f7335244ff5964c678c27eedf1aea6abea44c4169d327ea8c7ce4a3a88","glsl-optimizer/src/util/ralloc.c":"4b51189595ef67bcef52c40cbf654d969041dbd15e15d4a893ad494ac060aeca","glsl-optimizer/src/util/ralloc.h":"e573c45875ff1530f0dbee9a93ae55535fdac8d5cc88a79ebc327c688824bde5","glsl-optimizer/src/util/rounding.h":"0450722353caf83de07e67f335949dbe95fe53b534052d4ee9d28d2781387614","glsl-optimizer/src/util/set.c":"86f8c9a830bead5a5a79bc970b0ff97809312af07b3beb39ef9d90af04d40a1b","glsl-optimizer/src/util/set.h":"3e39ca161e7ed4ec7c436cc9c7919ed9a55ed1b71edbf2caf6f9bcfd9bc578ed","glsl-optimizer/src/util/sha1/README":"00af7419af05247081858acb2902efd99fcda2ce16e331079f701645bb3729c0","glsl-optimizer/src/util/sha1/sha1.c":"1403bbe0aad42ba3e6be7e09f7cad87a6a8c4ad5b63962f7b92b9f37d8133b04","glsl-optimizer/src/util/sha1/sha1.h":"68d9f240eab2918026ecdf22be36811abbd4f1389f6c36e31258041aeaedd247","glsl-optimizer/src/util/simple_mtx.h":"12c6c3c4b7db9168bc656d5b3c65912075084d2b388c415d5c3d3f5953a9d6c7","glsl-optimizer/src/util/softfloat.c":"a97e51a96fe5e6a052c02aa6bbec683fe73fb88a8c087d9c930503e2120d8a2e","glsl-optimizer/src/util/softfloat.h":"66664b0250e83bf5dd4cc743acd119d076efcea624a0eab3d6b60718e6ee8811","glsl-optimizer/src/util/string_buffer.c":"63a1d1b1e34926c88ea00159cafbcd56568b805c4f64d1e8c97169fe313921fc","glsl-optimizer/src/util/string_buffer.h":"7b88d1b1d9c6cfb8e93331813535c127289437c75f822029e9a3bca8ea6b52ee","glsl-optimizer/src/util/strndup.h":"0273c4fdb7482cd7746881a63d3998648c6d63415ba85af1d1860f0e0dc504c6","glsl-optimizer/src/util/strtod.c":"5cf610d8a37373cf37cfb7aae903525d943b2674b1f32594c70b0eb19a8c9697","glsl-optimizer/src/util/strtod.h":"237396def4e264d35ed4bedea00ef9a4ceab6d7a11a18c770d9747d22c69ed2d","glsl-optimizer/src/util/u_atomic.h":"c02e809526c6c09ba8fe51f50b2490d1b6c8e5c7f3c4031ae958250d098fc3bb","glsl-optimizer/src/util/u_debug.c":"8c060e379b816618f3dd22c9ea523c68b9425c76c36a7dfe5d6d375b337f5f4a","glsl-optimizer/src/util/u_debug.h":"e11e26edd9b9e4e6f8e6a435e69f4d9edda27e9a379f68f4c82ea2525aaaea68","glsl-optimizer/src/util/u_dynarray.h":"853d0fa6ff2261614488be624deb8a2b01e57c2c8eabc28578cbeed4ccc95694","glsl-optimizer/src/util/u_endian.h":"3ccea7e529740318d8a4b05c00db3adc9d1e292a52bdc56a05c9fae99209720f","glsl-optimizer/src/util/u_math.c":"c868a8c0886dc78f1b06b13404ba8b253090449045774dd56893ac9d75795184","glsl-optimizer/src/util/u_math.h":"a04e32e126db016413f9de0a2028a3e71737137463b1289eae576f884b06fcf1","glsl-optimizer/src/util/u_memory.h":"c5db17c724c70283ddbe04165722f6988d4e0eb9aa3602ae472feff016649af9","glsl-optimizer/src/util/u_queue.h":"92930ce236c0528a98b695f5cea8c5c6aa9683beaf71a2227bdc5d33d1b21506","glsl-optimizer/src/util/u_string.h":"c5a2f4ef576d1547bda12c4ea219179fefa54414977743ac094abcaf696ef6ca","glsl-optimizer/src/util/u_thread.h":"00b708459b27f9910d18db92c18cc65cfc618ac2b3cd144e45f8640057b10d58","glsl-optimizer/src/util/xxhash.h":"2f2aff2fc6c0c929f52cf6ae7314122124c5be026d41ad1c357608383c4a37ad","src/bindings.rs":"79993db2058bde39f99ef483d02560d33b1cb882f6a552319e8b86eb6f9021e1","src/lib.rs":"04be1554cd829eb40864b06d80b491dd48117a4e3a601c7d482117f7a0391e67","wrapper.hpp":"f3ea34cc496f7d90b9bfcada3250b37b314c3524dac693b2ece9517bc7d274ac"},"package":"913662ae8335df058d56e00f11340b20fa82e03e0276587797ef325ab01e50d4"} -\ No newline at end of file diff -up firefox-146.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h.build-c11-threads-avail firefox-146.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h --- firefox-146.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h.build-c11-threads-avail 2025-12-05 18:43:20.000000000 +0100 +++ firefox-146.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h 2025-12-11 13:30:50.463371937 +0100 @@ -34,3 +26,11 @@ diff -up firefox-146.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threa /*------------- 7.25.3 Condition variable functions -------------*/ // 7.25.3.1 +diff -up firefox-147.0/third_party/rust/glslopt/.cargo-checksum.json.backup firefox-147.0/third_party/rust/glslopt/.cargo-checksum.json +--- firefox-147.0/third_party/rust/glslopt/.cargo-checksum.json.backup 2026-01-07 12:48:27.390768071 +0100 ++++ firefox-147.0/third_party/rust/glslopt/.cargo-checksum.json 2026-01-07 12:48:29.538659136 +0100 +@@ -1 +1 @@ +-{"files":{"Cargo.lock":"f7970552595dc803ace9ef19b5f5d7b1fc784aac30cb27b2ebc3002d97122b9d","Cargo.toml":"7c53ee20d848f9913cacbfcb3ab2e89e30deee8d619d173c95130c7c5d065827","README.md":"4468e08c64c19977707d792bfab0080e35ff927b64990eab77873f8ba056ba1c","build.rs":"92e29699487c21389fc823c50b410cfbfc74cc774265d24958489909ee48a076","glsl-optimizer/CMakeLists.txt":"42ce94744e82ffa000da8b64d81fc140e293b9f5da7dd4cf6b49e7404a2448d9","glsl-optimizer/README.md":"b18eef11a92d267d88a937b1154f7670ee433c730b102fdf7e2da0b02722b146","glsl-optimizer/contrib/glslopt/Main.cpp":"14ba213210c62e234b8d9b0052105fed28eedd83d535ebe85acc10bda7322dd4","glsl-optimizer/contrib/glslopt/Readme":"65d2a6f1aa1dc61e903e090cdade027abad33e02e7c9c81e07dc80508acadec4","glsl-optimizer/generateParsers.sh":"878a97db5d3b69eb3b4c3a95780763b373cfcc0c02e0b28894f162dbbd1b8848","glsl-optimizer/include/GL/gl.h":"1989b51365b6d7d0c48ff6e8b181ef75e2cdf71bfb1626b1cc4362e2f54854a3","glsl-optimizer/include/GL/glext.h":"2ac3681045a35a2194a81a960cad395c04bef1c8a20ef46b799fb24af3ec5f70","glsl-optimizer/include/KHR/khrplatform.h":"1448141a0c054d7f46edfb63f4fe6c203acf9591974049481c32442fb03fd6ed","glsl-optimizer/include/c11/threads.h":"56e9e592b28df19f0db432125223cb3eb5c0c1f960c22db96a15692e14776337","glsl-optimizer/include/c11/threads_posix.h":"f8ad2b69fa472e332b50572c1b2dcc1c8a0fa783a1199aad245398d3df421b4b","glsl-optimizer/include/c11/threads_win32.h":"95bf19d7fc14d328a016889afd583e4c49c050a93bcfb114bd2e9130a4532488","glsl-optimizer/include/c11_compat.h":"103fedb48f658d36cb416c9c9e5ea4d70dff181aab551fcb1028107d098ffa3e","glsl-optimizer/include/c99_compat.h":"aafad02f1ea90a7857636913ea21617a0fcd6197256dcfc6dd97bb3410ba892e","glsl-optimizer/include/no_extern_c.h":"40069dbb6dd2843658d442f926e609c7799b9c296046a90b62b570774fd618f5","glsl-optimizer/license.txt":"e26a745226f4a46b3ca00ffbe8be18507362189a2863d04b4f563ba176a9a836","glsl-optimizer/src/compiler/builtin_type_macros.h":"5b4fc4d4da7b07f997b6eb569e37db79fa0735286575ef1fab08d419e76776ff","glsl-optimizer/src/compiler/glsl/README":"e7d408b621c1b605857c4cab63902f615edb06b530142b91ac040808df6e22f7","glsl-optimizer/src/compiler/glsl/TODO":"dd3b7a098e6f9c85ca8c99ce6dea49d65bb75d4cea243b917f29e4ad2c974603","glsl-optimizer/src/compiler/glsl/ast.h":"3e68ff374350c49211a9931f7f55a485d8d89fc4b21caaffbf6655009ad95bf8","glsl-optimizer/src/compiler/glsl/ast_array_index.cpp":"92b4d501f33e0544c00d14e4f8837753afd916c2b42e076ccc95c9e8fc37ba94","glsl-optimizer/src/compiler/glsl/ast_expr.cpp":"afd712a7b1beb2b633888f4a0911b0a8e4ae5eb5ab9c1e3f247d518cdaaa56d6","glsl-optimizer/src/compiler/glsl/ast_function.cpp":"74f4fbd490e366b37f4715168bb3465ecd9334d4130942f75dcc8e80e8e7f027","glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp":"d0f798eb09271d41d068b9e7b18220d37f1ed0083300ab51eba30989698fe23d","glsl-optimizer/src/compiler/glsl/ast_type.cpp":"8eb790b24b26dfb72bdc333744b566c26d8464c5d47d20eae659461f5c4899f7","glsl-optimizer/src/compiler/glsl/builtin_functions.cpp":"454189d643c220fcb49116ee5c8a34f7b349aa67564040deb8607f6a41a15e70","glsl-optimizer/src/compiler/glsl/builtin_functions.h":"a37cad7ed09b522c5b8bec7b80115a36846e7ba6e0874a2a858e32f7f202c665","glsl-optimizer/src/compiler/glsl/builtin_int64.h":"619def6f3aebf180da3944ef08f159ab12a58b24767e41d8b985ac37ded54d62","glsl-optimizer/src/compiler/glsl/builtin_types.cpp":"afec060b62d6f3b00bfbf94e9fa5f96341ce096c128d1eef322791e6ed9cea4d","glsl-optimizer/src/compiler/glsl/builtin_variables.cpp":"6563bfb1345cbca4c77e00eef09ad152f3e1dc271d246a08c5ce9e1f4ce4250a","glsl-optimizer/src/compiler/glsl/float64.glsl":"1072fd888be48c2a7a5117cd2d92a65f034965a66375f598bb856bff5d7be766","glsl-optimizer/src/compiler/glsl/generate_ir.cpp":"e5f0175370a0d07f93c48d3f0f1b8233d12c64a7b02de02dcc753ef7b398ef0f","glsl-optimizer/src/compiler/glsl/glcpp/README":"a0332a1b221d047e9cce5181a64d4ac4056046fd878360ec8ae3a7b1e062bcff","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.c":"2d179879b1ffe84f58875eee5b0c19b6bae9c973b0c48e6bcd99978f2f501c80","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.l":"e4c5744c837200dafd7c15a912d13f650308ea552454d4fa67271bc0a5bde118","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.c":"03494f9ce1cb82260506e2559e73a3eeb622c4bd51b65eaa0a2c3351862bd4c8","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.h":"264d9a18421cde255ce34a0a62b3d8e73465359f0d167e64aa3973062aae5bdd","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.y":"fafb66e3a8f149d19e085f18a4273ba6d4c11af9e9a01d665cc784dddf97b79f","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.c":"37ed294403c2abfd17fd999d1ae8d11b170e5e9c878979fefac74a31195c96b0","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.h":"85ac8b444bcbd0822b66448a1da407b6ae5467b649f5afaf5c58325bd7569468","glsl-optimizer/src/compiler/glsl/glcpp/pp.c":"a52d94f1bcb3fb2747a95709c4a77c25de7eea8354d2b83bb18efd96976a4473","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.c":"d11aeb3acfe966d1b78f1ee49804093f2434214c41391d139ffcb67b69dc9862","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.h":"abbf1f36ec5a92d035bfbb841b9452287d147616e56373cdbee1c0e55af46406","glsl-optimizer/src/compiler/glsl/glsl_lexer.cpp":"272b9fc1383d72b81bfc03fa11fdf82270ed91a294e523f9ce2b4554bd3effa9","glsl-optimizer/src/compiler/glsl/glsl_lexer.ll":"2b57d9f9eb830c3d7961d4533048a158ee6f458c8d05c65bea7b7cfbc36e4458","glsl-optimizer/src/compiler/glsl/glsl_optimizer.cpp":"f8095d20629d0af70be930b0612e169edb274551a1d25a3cd1bf9995a11ce2e8","glsl-optimizer/src/compiler/glsl/glsl_optimizer.h":"22e843b4ec53ba5f6cd85ca5f7bad33922dca8061b19fb512d46f1caca8d4757","glsl-optimizer/src/compiler/glsl/glsl_parser.cpp":"126baf368d525aba301854e3d91ba60b5aee32e1102376af71416f32cb95ec48","glsl-optimizer/src/compiler/glsl/glsl_parser.h":"2ea9a50716098a8f7bef782d2a030d757b68da73afb01b4d4940d3e8381d44e8","glsl-optimizer/src/compiler/glsl/glsl_parser.yy":"6b1fd1576b29fce005dff744a6dbd0219e4c695c361d61864e1f3a8d6fa6b764","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.cpp":"aad64b5b66467da650091430681e8c6a820cf3cadc4db3c160bf2f15875390ae","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.h":"71fd0e92bbdb193dfb067d7bfdb1200d77392be2fbd0cbfc9ca89d1bb4c7e741","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.cpp":"6660fb83c0ddddbbd64581d46ccfdb9c84bfaa99d13348c289e6442ab00df046","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.h":"24682b8304e0ea3f6318ddb8c859686bd1faee23cd0511d1760977ae975d41bf","glsl-optimizer/src/compiler/glsl/hir_field_selection.cpp":"72a039b0fcab4161788def9e4bedac7ac06a20d8e13146529c6d246bd5202afd","glsl-optimizer/src/compiler/glsl/int64.glsl":"303dbe95dde44b91aee3e38b115b92028400d6a92f9268975d607471984e13eb","glsl-optimizer/src/compiler/glsl/ir.cpp":"2b4741cce90b5d4abff5d719c7324e2693c67294d4d99736cb241554adb281bc","glsl-optimizer/src/compiler/glsl/ir.h":"990b1c74447c4eb4835353ccb0ed9aea644f97fc1129ef1739cd935075d85d2e","glsl-optimizer/src/compiler/glsl/ir_array_refcount.cpp":"8cdc1cffe01e42e0566fa2193a75f789628e8025ad1b82f0ee6f204451b7f9f7","glsl-optimizer/src/compiler/glsl/ir_array_refcount.h":"75f06ec81342b379096ca52e1dc0fd5f19a11ff8e9b58203c20628179d644c12","glsl-optimizer/src/compiler/glsl/ir_basic_block.cpp":"1e2920b1c0ecb08424c745c558f84d0d7e44b74585cf2cc2265dc4dfede3fa2f","glsl-optimizer/src/compiler/glsl/ir_basic_block.h":"81be7da0fc0ee547cd13ec60c1fcd7d3ce3d70d7e5e988f01a3b43a827acdf05","glsl-optimizer/src/compiler/glsl/ir_builder.cpp":"daba29c5a1efdd5a9754f420eb3e2ebdf73485273497f40d4863dadeddb23c0d","glsl-optimizer/src/compiler/glsl/ir_builder.h":"2822e74dd3f6e3df8b300af27d5b11ea2dd99d0e5e7ca809b7bbcce9833c483c","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.cpp":"8c6df5abf2fe313363f285f171c19ca6c8ee4f3bc2ed79d33c0c88cc8be45c48","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.h":"799852adc3a0e54d04080655e7cebfa0d3bf5b6ffed5d8414f141380665d4db7","glsl-optimizer/src/compiler/glsl/ir_clone.cpp":"d897a4e1f5bbec4a6a2f15044c1be9a4d13899c73be77335b041049a4589aa5d","glsl-optimizer/src/compiler/glsl/ir_constant_expression.cpp":"78bd87ddb09db67f6c499067728d72aef4f16aa02721a99a4b769d1e0cfa9010","glsl-optimizer/src/compiler/glsl/ir_equals.cpp":"bca28533a6310b0fc152b56d80872368f1510dc62ed6e8ac199b9ffa7fac02e7","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.cpp":"7e918d4e1f237eca01396004015865ce345afe32a876c9dbc6728576a1a7eae4","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.h":"f45b66aa9497520e7e08e612d24b308477c34477fbd963ee9320eac664957f16","glsl-optimizer/src/compiler/glsl/ir_expression_operation.h":"cc9f10727dbd26cac506804f51456302c702650f9eeb59054a7e1575d5cf6687","glsl-optimizer/src/compiler/glsl/ir_expression_operation.py":"7b86c96021b9fbe165957f4ecb0b612fefcde1c2cf3c6d75e3cdb22e369216ba","glsl-optimizer/src/compiler/glsl/ir_expression_operation_constant.h":"9ad3346416392e3efa11e12ecf2feca7453c5253d241eb96c91dfb85d4f2b971","glsl-optimizer/src/compiler/glsl/ir_expression_operation_strings.h":"a6826daf496a8b9e89885bc2a161ac3445d501b23c6e0ac33e2c01b506b273c8","glsl-optimizer/src/compiler/glsl/ir_function.cpp":"7537365fc0fbe4b37a26b9a2146cc64d3e9a774d60eab63b65002ad165ae8fc7","glsl-optimizer/src/compiler/glsl/ir_function_can_inline.cpp":"faddbf112187a048d502716a3fb82570a322299ba2a3abd79388382c82040bfc","glsl-optimizer/src/compiler/glsl/ir_function_detect_recursion.cpp":"9176973eaf5c0a984701f953bb7a80f37dca43d59b5bce50fc69b3f02f2902d7","glsl-optimizer/src/compiler/glsl/ir_function_inlining.h":"9739493f99c489987d650762fccdd3fb3d432f6481d67f6c799176685bd59632","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.cpp":"3725861fbe2b98e0617f52d3b14cf6d3b25fb5ec00f5ef5d308b03642f592767","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.h":"e0560210e966c0c31e4ca843e80ea154e64db5a444b8c2df845b6ba5b3a43fc1","glsl-optimizer/src/compiler/glsl/ir_hv_accept.cpp":"caf7ce2cd9494aadd3c58bcf77f29de58368dc9e347a362bbf37f8bda9509b80","glsl-optimizer/src/compiler/glsl/ir_optimization.h":"8b3dcfc7f9e96b21a8dd47a0040d90be483a9e67a2cdce3a697188fb758d4630","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.cpp":"f8e34a983452be0dcb5a695e9c8e895eead24f9e540992a8afe510ae85da4c4c","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.h":"1ad1bd3efd1ace39051c13f904c05fd80425d329444f9a8d47fd6d948faf46e0","glsl-optimizer/src/compiler/glsl/ir_print_visitor.cpp":"643f5a68aae3fb37267fd793f1216d1cfdeb2c09338c26b1f30e4c6deaef4de5","glsl-optimizer/src/compiler/glsl/ir_print_visitor.h":"4573eb93268a2654c14b505253dd651e2695d43dc745904d824da18305269b95","glsl-optimizer/src/compiler/glsl/ir_reader.cpp":"06bfba802c8354e5a8b2334b6d78d6297de18235bedd3f8fbb382c89870b02f2","glsl-optimizer/src/compiler/glsl/ir_reader.h":"63e3f7f1597936a7011d5b520e171b197bf82bee6c1560d822c3edf5aaa6f9e9","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.cpp":"84b5c5d746555adca85759c2912fe48010232b7c1c0bd2cf03bd04067a85e66f","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.h":"fd8c561b71085d3211fff85ed514fecb299d8ce19a04bc063419a55b6d840525","glsl-optimizer/src/compiler/glsl/ir_set_program_inouts.cpp":"ab9f115ce9e7f312d9c7978340ced0dc4ae6d13a80e08442ba9709d11d50cae5","glsl-optimizer/src/compiler/glsl/ir_uniform.h":"683ae6896b1a08470c090be5f822fc31cd434eab9216e954b9bba24a46975109","glsl-optimizer/src/compiler/glsl/ir_unused_structs.cpp":"9c1620c45f2fc071fe5ed828472040b14c5f42effe06aa0e3b8352c95ef78786","glsl-optimizer/src/compiler/glsl/ir_unused_structs.h":"13387b49c23093575276b25b9dfd31fedd8f131c5c4f3128ab04cf03e15b5295","glsl-optimizer/src/compiler/glsl/ir_validate.cpp":"6b232be5999a86ea278f4f15b2832d76843246509118d924243055a3b9b0299f","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.cpp":"2764a3cad937d53f36db7447c3a5b98b04bf153acf81074d971857fc5bca460d","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.h":"b0668e3eb1501ef65e38fe12830742ecb3d28e6039f30e366c8924efc29b4a39","glsl-optimizer/src/compiler/glsl/ir_visitor.h":"f21b3534c3d66d5fb707d1581fece7e1eb043523afbaedf89918cfb031c6df94","glsl-optimizer/src/compiler/glsl/link_atomics.cpp":"360f0209e11f367ba358223597b0a118bae095bff16337cf03f1fb89c5b80ca6","glsl-optimizer/src/compiler/glsl/link_functions.cpp":"de7895da8aa33a1e3c2c1eb2fdaf267ab5d1fbfdb79ae2e67f95211e946e294c","glsl-optimizer/src/compiler/glsl/link_interface_blocks.cpp":"1926cfa73810704eb19b916c1b2cdb9321155e2f98b2a0a57c7c3c6e960540cd","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.cpp":"1e14e06ca3b2c1089cfba2e8eaf0c1f373d9d6374b6082f320962dd71ae09611","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.h":"fd58c155af645295bb6aec08797889de586f4d919731de2bce57e8dce59bb048","glsl-optimizer/src/compiler/glsl/link_uniform_blocks.cpp":"09589f49776dce32e6c4044937de7e0c839a9754ad31960148f8f9e010658997","glsl-optimizer/src/compiler/glsl/link_uniform_initializers.cpp":"bf98e08c12db466acf9623cbeb8fa8e3b4002512722e7a6521287f558a099f37","glsl-optimizer/src/compiler/glsl/link_uniforms.cpp":"84bad5b1377362cecf259b05124239be5220b03ce1c0c61b59bd9a47e4379af2","glsl-optimizer/src/compiler/glsl/link_varyings.cpp":"a5f1a53e7c80d635515fe808ff223d89fef1767abb0f2b7aa28fa6773dca353f","glsl-optimizer/src/compiler/glsl/link_varyings.h":"b9dbe018f038df69763df2e928742ce81bbc6e3aaba26f50621e30a6d9aa6220","glsl-optimizer/src/compiler/glsl/linker.cpp":"40b1ecd5d4f6c7f13d5a87ce390561a51fdf6f3fcd9b2197b9c88b03a773ba94","glsl-optimizer/src/compiler/glsl/linker.h":"ecf94b4ad75ef461c27c557fda4bd25f34c91930822b8e1d729ec84520d4a049","glsl-optimizer/src/compiler/glsl/linker_util.cpp":"1663ad88e2a369305659aeeffaedb5bd752cf76340a2ba5797fc0bf600633cf9","glsl-optimizer/src/compiler/glsl/linker_util.h":"6db788daf9c8e87ae2764b61a8b37ebe419e69c1b82ddee01986e37c978c6993","glsl-optimizer/src/compiler/glsl/list.h":"b1f46ce0e552fe7c45b2a19408a9d97662e23e4b182ab335491c26f8cf25886f","glsl-optimizer/src/compiler/glsl/loop_analysis.cpp":"57ecd573477c68091c7cc99537faa7139a8f395935e3d4f10144cefdefb5a611","glsl-optimizer/src/compiler/glsl/loop_analysis.h":"a85f045a038ee5b5176063e85d7988865862c44ab0580f771b993a042d0b69cc","glsl-optimizer/src/compiler/glsl/loop_unroll.cpp":"bd4292ea2809f5a669bcb76ceaa1ac365772dcd638c579c3ed10275214901a54","glsl-optimizer/src/compiler/glsl/lower_blend_equation_advanced.cpp":"8cfbef140d9c4b4d2f57bfa05c9c374d31a121d0f87afce94333f049023b654a","glsl-optimizer/src/compiler/glsl/lower_buffer_access.cpp":"1ae221c3c7a95aeb867207e7a742be635f91b406c157747bfd6ddf10274d97fb","glsl-optimizer/src/compiler/glsl/lower_buffer_access.h":"807886953a576a323591798cbca5e2df24295ea893b28affd8ffb5926cebaa04","glsl-optimizer/src/compiler/glsl/lower_builtins.cpp":"4d81afc32cf58e1481fcb5e42888ab93dbe6820310a20ff7a9982b77b2152d9b","glsl-optimizer/src/compiler/glsl/lower_const_arrays_to_uniforms.cpp":"608403f0eeeedf21cfcd3014116e0f44e28cbdf6c4c32aac7e613e64e30205e1","glsl-optimizer/src/compiler/glsl/lower_cs_derived.cpp":"179905cd47a294122adeb5b0abfed6f2f67782dcde21b544d1ee2c1985154e66","glsl-optimizer/src/compiler/glsl/lower_discard.cpp":"3b361b2db0004d544d64611cb50d5a6e364cf6c5f2e60c449085d7d753dd7fb0","glsl-optimizer/src/compiler/glsl/lower_discard_flow.cpp":"f5c29b6a27690bb5c91f196d1a1cf9f6be4f1025292311fe2dac561ce6774dee","glsl-optimizer/src/compiler/glsl/lower_distance.cpp":"a118c85493d5d22b2c059a930c51a5854896d4b1dade76598eaa985e5a3dff8c","glsl-optimizer/src/compiler/glsl/lower_if_to_cond_assign.cpp":"469e617757fd1728709cce021aac5c8da05ee503bf5366977bdc4ef7a6d83950","glsl-optimizer/src/compiler/glsl/lower_instructions.cpp":"6ff5c396abe40d8a2145d571e99e2bbe9143393e15aafc28adc2803a01d821b6","glsl-optimizer/src/compiler/glsl/lower_int64.cpp":"d1ed41196880dd53c7b13e2782f9423f8442bf1d46186e8be92b1b66218a83ee","glsl-optimizer/src/compiler/glsl/lower_jumps.cpp":"34de7b493f281589fb0c2c0f6e885d0a0fabbe7a4e97a73de374dd714777a58c","glsl-optimizer/src/compiler/glsl/lower_mat_op_to_vec.cpp":"dff7a308edc4846c348ed4225c6699a9c75abac68d88f41f85954276552779f4","glsl-optimizer/src/compiler/glsl/lower_named_interface_blocks.cpp":"16063ac127bff75a68272070ab11c21c25101edbff62b4c68f4983b4cd941af0","glsl-optimizer/src/compiler/glsl/lower_offset_array.cpp":"3b00773399135aea85746a5a68b96ef000bc6841be1a2c8e6f25c516628b0949","glsl-optimizer/src/compiler/glsl/lower_output_reads.cpp":"a0fc9975d5aa1617e21fc6c353659a9802da9e83779a3eef4ec584f74b4dadc5","glsl-optimizer/src/compiler/glsl/lower_packed_varyings.cpp":"7550099d4ae123d71541c2fc88bc04fbfe9271ec75d7e210987d1c8cac3cf3ea","glsl-optimizer/src/compiler/glsl/lower_packing_builtins.cpp":"79a13d161fe505a410ab948d92769395708693ec888153630fa240e5b97e356f","glsl-optimizer/src/compiler/glsl/lower_precision.cpp":"f82a185b879872b977a1787d8061b9a80bc4cf8db1b970db6efba2ad9cc20fa2","glsl-optimizer/src/compiler/glsl/lower_shared_reference.cpp":"ea2dccf50a83bc19391bf6b7ab6aa53c0005f427af4066d25140340af9a4beef","glsl-optimizer/src/compiler/glsl/lower_subroutine.cpp":"f69fa53650eeb6f2944fce4d36a6e0a423e6705f3a3bd3389c7fadb83cfc8802","glsl-optimizer/src/compiler/glsl/lower_tess_level.cpp":"b196c9d424c0569f3e85d75c2d125af21566cb113d69036db87c0990703e0fa7","glsl-optimizer/src/compiler/glsl/lower_texture_projection.cpp":"4d247f244272adc8250fd888d8d932a140dd5de4d1efc7a58492c3c2b8291527","glsl-optimizer/src/compiler/glsl/lower_ubo_reference.cpp":"89bdbc6c1669230c644c0857db1ce2781ec61d349ecd08c7914146e1f4750a4a","glsl-optimizer/src/compiler/glsl/lower_variable_index_to_cond_assign.cpp":"fce930f29ac9405b297d1f749d68f59506b89c70b4ee1b1ab8cf49a34cc71ecf","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_cond_assign.cpp":"3c67d851a11a55fad1c49a550f3a0cfe50892d33a3f238ce266cd829eba510a8","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_swizzle.cpp":"f5ec666b73e1415cbab32519a53605ed385f3b03e889560373dbce69dda5000e","glsl-optimizer/src/compiler/glsl/lower_vector.cpp":"f7c13f5572ebe09b6a71553133b2cf003cd4b77b9657600672ee3b21bf890725","glsl-optimizer/src/compiler/glsl/lower_vector_derefs.cpp":"b05793da6dd620a531b43df5af8b2ecbc37b9db0c88910f5724ea10bcd057e19","glsl-optimizer/src/compiler/glsl/lower_vector_insert.cpp":"fee772ec17eea5e86a529bf9c5fa2ee0d29a5982bb75ebc6d68ed36cd19aa299","glsl-optimizer/src/compiler/glsl/lower_vertex_id.cpp":"690e8715182e03fead5cc5a35251fb4f41b357e4c71a1dfbc4bd7be19862b56d","glsl-optimizer/src/compiler/glsl/lower_xfb_varying.cpp":"58c0e8b270e4bbde54250be03cdb2f36966bcafb785372ad2e2b786835df7f9f","glsl-optimizer/src/compiler/glsl/main.cpp":"ae5e88abbbc8a12f769e1296bad938b9d7398cc6da0d3d0caeceeeb876536850","glsl-optimizer/src/compiler/glsl/opt_add_neg_to_sub.h":"f5054944bfd068810629080d0ea11df78b3f57a8f86df75e13ca50157ad1964d","glsl-optimizer/src/compiler/glsl/opt_algebraic.cpp":"25f45b20e1972ee8c789177a1aeda6e4286c25db2eae3a43ff83029ae64969c0","glsl-optimizer/src/compiler/glsl/opt_array_splitting.cpp":"19d3ce0e815438f4df9ab2890e767b03a4f3f191b53bb30c0217cf2ae6a95430","glsl-optimizer/src/compiler/glsl/opt_conditional_discard.cpp":"0e44e0e126711a3725c1f3a2aa65ff03c381fed08680ffc30101aae60f716c4e","glsl-optimizer/src/compiler/glsl/opt_constant_folding.cpp":"a088d04d9b45f9e55e235835648f614c89b7803c03a6d4f6a6d1a6bc1f0228bd","glsl-optimizer/src/compiler/glsl/opt_constant_propagation.cpp":"8a9440d77ecd6dcf13e683cbb99943aab6311c8fd4b5f6a9189a8d4f270746f4","glsl-optimizer/src/compiler/glsl/opt_constant_variable.cpp":"63d3ccd4dd09f19c9cf1a2f51592111bed41284504f29f3c0de4cadebc439a37","glsl-optimizer/src/compiler/glsl/opt_copy_propagation_elements.cpp":"ffa0f50863995e0d2e31f55a52e82319edc71e520987bebd7f7e561ea331c64b","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_variables.cpp":"84e8747b948232f01dd56b428b9315f96f9511f605f240119fc446fae28981a9","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_varyings.cpp":"761523e88f5b3ba785170f4d7205e94fa99acb7e74d29efbe40e1c010e1dbdb3","glsl-optimizer/src/compiler/glsl/opt_dead_code.cpp":"fd1ba2da7337d4e5dad17f5c2d73d9cc8880305f423e85d64cf94553588fa401","glsl-optimizer/src/compiler/glsl/opt_dead_code_local.cpp":"969a598b4df322baf222258a66cd64a326ea20e5b3125be9d8d1771f522c69e0","glsl-optimizer/src/compiler/glsl/opt_dead_functions.cpp":"774cae6536d02edf26e996a2a895e1f62d5098f16dc96b44798b4fc731a9a95f","glsl-optimizer/src/compiler/glsl/opt_flatten_nested_if_blocks.cpp":"3696a5c55f02e20056e085bc2714f73ac992f221b6f3387d655068e86b512046","glsl-optimizer/src/compiler/glsl/opt_flip_matrices.cpp":"44f0fe05b49329667671f88c96dc86ab3fe1459ff7b87f2b2d88de2d49829f9f","glsl-optimizer/src/compiler/glsl/opt_function_inlining.cpp":"fb56a33c90419a01676b57cbd91d0674a54cca40e6defaacc88dd33facebc131","glsl-optimizer/src/compiler/glsl/opt_if_simplification.cpp":"ac406eb35e379c357641d6c5749f50c65961455924d3dc884e2b90046fa92c5c","glsl-optimizer/src/compiler/glsl/opt_minmax.cpp":"8abd59d3b14ef60ff14a9c69660e6945f5cf10b97edb4afebe56be3f81d96316","glsl-optimizer/src/compiler/glsl/opt_rebalance_tree.cpp":"8bb6329dc0f299042368fc81934c2df019b45ab9f7aa0415d4e57b8d1ff98c9f","glsl-optimizer/src/compiler/glsl/opt_redundant_jumps.cpp":"222c73e2ac7a938ebb6428cc6c780c908ff6156d8ff935b04fed93a48fc10496","glsl-optimizer/src/compiler/glsl/opt_structure_splitting.cpp":"2edc79cc13f3177934e0443ad62f5976a1991f01f86ea303a803434849b13a47","glsl-optimizer/src/compiler/glsl/opt_swizzle.cpp":"015d0abddfe507f67c4b96c82988d861d018ededf7bf055e2bcbe9ea92da694e","glsl-optimizer/src/compiler/glsl/opt_tree_grafting.cpp":"46d28ac983ea244a4315bdc0e8892979ec4d1f9b9a96ac8a8a08006d9bc5e878","glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp":"d80ee43bb97d9f016fb9c5e1e06f5b2afa569811f368ba067be794ec11d085fb","glsl-optimizer/src/compiler/glsl/program.h":"2982447e2abd35371e273ad87951722782a8b21c08294f67c39d987da1e1c55f","glsl-optimizer/src/compiler/glsl/propagate_invariance.cpp":"080943e21baa32494723a2eefb185915d2daae1f46d6df420145c5ad6857e119","glsl-optimizer/src/compiler/glsl/s_expression.cpp":"1ced972bc6ecc8eab4116ea71fb0212ab9ae5bcc0be3b47aa5d9d903566b3af1","glsl-optimizer/src/compiler/glsl/s_expression.h":"65b847e30e22a809b57d0bc70243049c99d9c6318803c5b8d0826aba55dc217e","glsl-optimizer/src/compiler/glsl/serialize.cpp":"be0eb4251348a9d921acb839a5c48c6023a2e9d116d602bb0432787ab623655d","glsl-optimizer/src/compiler/glsl/serialize.h":"57425732eba1233d928e5f07f88b623ce65af46b3bb034bf147f0a4b7f94f9a1","glsl-optimizer/src/compiler/glsl/shader_cache.cpp":"e0c5c433f2df3fccdf1d61281bfcb0ee5633433339b97c697d64db99611cbaaf","glsl-optimizer/src/compiler/glsl/shader_cache.h":"9217164d8d7f54aca0fe5922c7187095a6ae0cb703b196b79805aeef07a7e697","glsl-optimizer/src/compiler/glsl/standalone.cpp":"8e6c416a14d631261917a5fe4cc91880c287b22b2dfd70eb22028289a8fa5364","glsl-optimizer/src/compiler/glsl/standalone.h":"a7c397d1dfdd1e7fb2cfe99db35cd9df93251e642059208533202b7f20497f83","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.cpp":"970d14b7a9d58e5270321f97bf5d57795558b1c570a56678e04a65b26c60bf4f","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.h":"d921a617ea82b9e49413314492a645c44356de503581b1be3f1b57de236e480d","glsl-optimizer/src/compiler/glsl/string_to_uint_map.cpp":"d824bf5b839bd39498dc9e457103cdbe3e5289ddf7564107c27b1505948dd31f","glsl-optimizer/src/compiler/glsl/string_to_uint_map.h":"e2f18e66359c9d620e085de7f4a334a47df9c66e65a5bfe8b734c627bec04104","glsl-optimizer/src/compiler/glsl/test_optpass.h":"b27b8f35f5387e7ce4982bb51c7b63ccf14f91757f3108a5d02ed006925bb8a0","glsl-optimizer/src/compiler/glsl/xxd.py":"376484142f27f45090ea8203ae2621abf73f06175cb0ee8d96f44a3b9327f4bd","glsl-optimizer/src/compiler/glsl_types.cpp":"044bb6754f45419a3151e7a25c39202a82009ae3c6bc54ff7f0bb4258a5deefe","glsl-optimizer/src/compiler/glsl_types.h":"fd899a42f34ddeb8601bc3cd6c5e3aed82fc8aef4042dde1b39b3c01e1dcc219","glsl-optimizer/src/compiler/shader_enums.c":"436bff5216b11b0980bdfada5885fc6ac9afa2037a3027fcd6eea2a8635597ac","glsl-optimizer/src/compiler/shader_enums.h":"13220442a5c02e83540cf2c0ad4f8417b2fbda5f2586dec4e92082544c937cdd","glsl-optimizer/src/compiler/shader_info.h":"4c5453e81197ca83593ee4f365074b23530f2ab21c78e1733b63dec6f344c12a","glsl-optimizer/src/gallium/auxiliary/util/u_half.h":"3c2b37bda3ccb64387e44b723d29cf9046decab1a893bf42d842e9603398bdee","glsl-optimizer/src/gallium/include/pipe/p_compiler.h":"c75620096ce8523dae90599e50aa2ef6468d3b0e368a77795edeb20dd1abfc0c","glsl-optimizer/src/gallium/include/pipe/p_config.h":"a27692fc35f9e55df3224b7529e66b3001e911e94e6bc5f8f569e493e1ee3fb7","glsl-optimizer/src/gallium/include/pipe/p_defines.h":"be26d68c0acc67c5e44788c6299716a9eee415fd81d7d747e3738a829e3b6b38","glsl-optimizer/src/gallium/include/pipe/p_format.h":"5674215fc41d27496f037cf837717daefbf23ebb38d40ace7c0c414bc08182b0","glsl-optimizer/src/gallium/include/pipe/p_state.h":"d600593aba5f5a17072a6c38f6baa81e01c7994b0174250f7e433bb41684b702","glsl-optimizer/src/mapi/glapi/glapi.h":"73632a625c0ddabc401205e8b5a81eb8af8506868efe4b170d7979ec3619e9c5","glsl-optimizer/src/mesa/main/config.h":"5800259373099e5405de2eb52619f9de242552a479902a3a642a333c8cb3c1e7","glsl-optimizer/src/mesa/main/context.c":"2f3208473d99c94f734b1137ba91889d4a1babb9e7534bf1dc85d851ee98274e","glsl-optimizer/src/mesa/main/context.h":"cc7e4194797db9d007f01884e23d786c453b3860821f7f2ddcdf0f1bf3f8ffb1","glsl-optimizer/src/mesa/main/dd.h":"6a964acd06b6c2d88700e69fb75fe3c6b3b3d45bbc41db24f3f897a29695fe0c","glsl-optimizer/src/mesa/main/debug_output.h":"7312422e90b8c0e34028ac27280e438139b5cba525c99deb3ac883cd3d87e452","glsl-optimizer/src/mesa/main/draw.h":"7eaef3a9e27a60ea6f7937109bf3a6190b831162fde0479abb12077ce27c353d","glsl-optimizer/src/mesa/main/enums.h":"87d562a6764f51c014a2274fa7c3aca17c04441537ddd56b2554f13c6fffea92","glsl-optimizer/src/mesa/main/errors.h":"c79444b5df289c90fbb22a33b2d0c23917d9fc4510960088f0b79e53bb56b1b2","glsl-optimizer/src/mesa/main/extensions.h":"a38b2f87cc93c513994281350d69e06c84ff8eded5313ec0a1be33f375e0ebbd","glsl-optimizer/src/mesa/main/extensions_table.c":"17642d1a8c9a0bf2bd61060052d33ff14a005d2b962e6cf91465797a50851e85","glsl-optimizer/src/mesa/main/extensions_table.h":"2c879571c238d2e14461031ac740372fd0f9ac3a34c0d5541bb9b7ed4c0376c8","glsl-optimizer/src/mesa/main/formats.h":"02e2f7ec3e39286cf9f27e2641043e6df8ecb1dfde9e643313210e214af2a929","glsl-optimizer/src/mesa/main/glheader.h":"58217b33eead6aa6b23cd4a291cefeaa6cb84e465f4960daffca97c44d6d1c35","glsl-optimizer/src/mesa/main/glthread.h":"51fb2711f77e7eafcfc52d29d5b844978832b24c930d88accd48d143a6eb9c6f","glsl-optimizer/src/mesa/main/hash.h":"7e7f782034c16a8e693de48e00c31d4a90b0129f4029fd074033d7d16ccbe718","glsl-optimizer/src/mesa/main/macros.h":"73d15ddfd64f2b57b9b2ffeeb993b9c2c0899a80563e9d6ff337b11ccbe6eee5","glsl-optimizer/src/mesa/main/menums.h":"5dfac0e2279d60b0cd0c7b9fc2a5021620d0f6282ed2e738c420214e3af152d3","glsl-optimizer/src/mesa/main/mesa_private.h":"edda678b93438944279a551f663b8858ad84814a9fc88ba9672ef195599c24ae","glsl-optimizer/src/mesa/main/mtypes.h":"6efddefa099e4d2e3fdd97f0055644f47aba21711385edfeabc2d9b0676f2eec","glsl-optimizer/src/mesa/main/shaderobj.h":"9f0dfe96d0c2154201adef942bd36053533ac7b2492fb3786acda5bea514c75e","glsl-optimizer/src/mesa/main/uniforms.h":"4e331e6ad6e9cbded978b4082dbe0a57c1f8f01327446bb6892bfc179976c38b","glsl-optimizer/src/mesa/main/version.h":"9d0a13a758099302dc55cf7d045791834a89b0f9d4cf17b2692259b369a8a9a1","glsl-optimizer/src/mesa/math/m_matrix.h":"a37b19f182e070db3df93b0ede43c22fb8be8c2906504133ee6dbd7db1185d8b","glsl-optimizer/src/mesa/program/dummy_errors.c":"1820e305515b4c5e041f5e1623266a48ec8f076a155310be7d60637101f593e4","glsl-optimizer/src/mesa/program/ir_to_mesa.h":"b47f58d22e3ca2ae42d52501ea769d15c4476834944fa97eeccd3a3439211d00","glsl-optimizer/src/mesa/program/prog_instruction.h":"ab3832152a7e144b59e5a2264b2c29db56d93be31e76bbd958527a56771b40eb","glsl-optimizer/src/mesa/program/prog_parameter.h":"ba18c743284eadbc837c2c364c73e5d372321a7637a76e589d8d39fe8b5de225","glsl-optimizer/src/mesa/program/prog_statevars.h":"fc413698f84bc52d45fdeae0471934ee9904bfb7eac1a2b5f70446e54bcbbdca","glsl-optimizer/src/mesa/program/program.h":"1f01026a4eff440a3f122fd9b519d03546fe7f7d8be60dca834e95a2f8fbbfd2","glsl-optimizer/src/mesa/program/symbol_table.c":"6611cb9f078035bf5ff8c9112093a6c7d99f8af99a3931d0c07f227cc72283ea","glsl-optimizer/src/mesa/program/symbol_table.h":"631dc35ac48d5e87962d45507461920f6575610960ffcc42a08cefeb43300cda","glsl-optimizer/src/mesa/vbo/vbo.h":"6eb1dcd9a08c92f276c5fe08da184ff9d455d1be421913b8ad732a7b65e858fb","glsl-optimizer/src/util/bitscan.h":"9e49e694e6b34fe035bc685f32588827eb8cbe7d82878963c7ab52843e1c16aa","glsl-optimizer/src/util/bitset.h":"c40f78515c6230fed18345c6751ce33833a49da7a27901c7e6d7340cbdcbc5e7","glsl-optimizer/src/util/blob.c":"8f729846f66efc9c15485cc5fc24c6ec861fc1fecb2f652573f2a237d481b791","glsl-optimizer/src/util/blob.h":"93e1eaac866b9a7cd6fc03b533c18fb2edf0e97f03395eff4f3a605c4fc14d0c","glsl-optimizer/src/util/compiler.h":"79e3bf40a5bab704e6c949f23a1352759607bb57d80e5d8df2ef159755f10b68","glsl-optimizer/src/util/crc32.c":"2f3467a046b3a76784ecb9aa55d527698c8607fd0b12c622f6691aaa77b58505","glsl-optimizer/src/util/crc32.h":"59bd81865e51042b73a86f8fb117c312418df095fed2d828c5c1d1c8b6fc6cd4","glsl-optimizer/src/util/debug.c":"c3d68e9752ccc19e66c669562cd113cf1d0ac83cbb30174789e7fb8d1df58f9c","glsl-optimizer/src/util/debug.h":"50068d745c4199ccbd33d68dd4c8a36d2b5179c7869a21e75906ddd0718ca456","glsl-optimizer/src/util/detect_os.h":"343a8790d17a3710c6dd015ee367f84e3902ff3f2e36faca2bf93f9d725d3574","glsl-optimizer/src/util/disk_cache.c":"f533937e5a4fffe76e2739ef4b6b1e1da097d96d63eb808e68ebbc7027641c23","glsl-optimizer/src/util/disk_cache.h":"e83314fb14134a8e079b15e470a6376ba5a8253701f048c890a62b7e55d64bc8","glsl-optimizer/src/util/fast_urem_by_const.h":"e108fce804616c47d071dfe4a04163eec1126e448ed1aa89abb6b3a6d772bd5b","glsl-optimizer/src/util/fnv1a.h":"ab2596f19c6adf431ae27618f62c5743e24ad23ef83bb359a4c4c218245ab459","glsl-optimizer/src/util/format/u_format.h":"4cdfc0c59cbc99a092e5ec5a396910f2d93b9643e5d8141050b011e66f11e45b","glsl-optimizer/src/util/futex.h":"26f7c9d86e9ffef4c0fa2761f1aaa1918337302e20bd6ca10e61dc3c47356deb","glsl-optimizer/src/util/half_float.c":"11bc2584493d5d9d46e8c8a619a0307cf150bf5ab5d0f96bb764b061dc37a00e","glsl-optimizer/src/util/half_float.h":"7f7c380f126da1400a91758cc0392f24bf967bce1672890b62be26fe9fbd922b","glsl-optimizer/src/util/hash_table.c":"0ca40352e35dedab0a84c64c903f1b16d47e950bb5f43b4d22bb57d499bfea6e","glsl-optimizer/src/util/hash_table.h":"217191bb360592e2232f187473c10287d2cda8ae6fa5c53d0ef74c8c206118b4","glsl-optimizer/src/util/list.h":"9fab03c6a78186bb5f173269f825f6ce976b409d931852e3d93bac632e07989a","glsl-optimizer/src/util/macros.h":"63faf65b51058c483b17f1f77da51d1c53c8beab52678cb6bd01f1228a63b6b0","glsl-optimizer/src/util/mesa-sha1.c":"00c692ec353ebc02c06c57c5a71de0ab7a119f86a4146f452e65ec87e4944417","glsl-optimizer/src/util/mesa-sha1.h":"bff4c29f4bf7cdbcefb30fa0c996a7604a380eba8976467c2a60e7cd328f7e26","glsl-optimizer/src/util/mesa-sha1_test.c":"25da89a59d51469f77b4c468ca23ffdce0a7a1166a70b6cc23026a6800b0143c","glsl-optimizer/src/util/os_memory.h":"64555faf1760ae6954f42c83727c38dfc4c278e9152115779ffaad58b42adacf","glsl-optimizer/src/util/os_memory_aligned.h":"12d86fa94be38c13f7eeebdf313795e1267dd5a7187d2f0072e0e896f41702f6","glsl-optimizer/src/util/os_memory_stdc.h":"07360363b88c927065e10df71bebf6c8a0cc3b9167c9dfce55f2d65f11e6f787","glsl-optimizer/src/util/os_misc.c":"a9936e613ec84803abd59ad47c192c8e3939993c950ac91973fdc4cec1801bb8","glsl-optimizer/src/util/os_misc.h":"cc68eb12e05b5e749c54298cb4a6f4cd20cc5af7db3403e70b3c27b56090c740","glsl-optimizer/src/util/os_time.h":"73e775f7335244ff5964c678c27eedf1aea6abea44c4169d327ea8c7ce4a3a88","glsl-optimizer/src/util/ralloc.c":"4b51189595ef67bcef52c40cbf654d969041dbd15e15d4a893ad494ac060aeca","glsl-optimizer/src/util/ralloc.h":"e573c45875ff1530f0dbee9a93ae55535fdac8d5cc88a79ebc327c688824bde5","glsl-optimizer/src/util/rounding.h":"0450722353caf83de07e67f335949dbe95fe53b534052d4ee9d28d2781387614","glsl-optimizer/src/util/set.c":"86f8c9a830bead5a5a79bc970b0ff97809312af07b3beb39ef9d90af04d40a1b","glsl-optimizer/src/util/set.h":"3e39ca161e7ed4ec7c436cc9c7919ed9a55ed1b71edbf2caf6f9bcfd9bc578ed","glsl-optimizer/src/util/sha1/README":"00af7419af05247081858acb2902efd99fcda2ce16e331079f701645bb3729c0","glsl-optimizer/src/util/sha1/sha1.c":"1403bbe0aad42ba3e6be7e09f7cad87a6a8c4ad5b63962f7b92b9f37d8133b04","glsl-optimizer/src/util/sha1/sha1.h":"68d9f240eab2918026ecdf22be36811abbd4f1389f6c36e31258041aeaedd247","glsl-optimizer/src/util/simple_mtx.h":"12c6c3c4b7db9168bc656d5b3c65912075084d2b388c415d5c3d3f5953a9d6c7","glsl-optimizer/src/util/softfloat.c":"a97e51a96fe5e6a052c02aa6bbec683fe73fb88a8c087d9c930503e2120d8a2e","glsl-optimizer/src/util/softfloat.h":"66664b0250e83bf5dd4cc743acd119d076efcea624a0eab3d6b60718e6ee8811","glsl-optimizer/src/util/string_buffer.c":"63a1d1b1e34926c88ea00159cafbcd56568b805c4f64d1e8c97169fe313921fc","glsl-optimizer/src/util/string_buffer.h":"7b88d1b1d9c6cfb8e93331813535c127289437c75f822029e9a3bca8ea6b52ee","glsl-optimizer/src/util/strndup.h":"0273c4fdb7482cd7746881a63d3998648c6d63415ba85af1d1860f0e0dc504c6","glsl-optimizer/src/util/strtod.c":"5cf610d8a37373cf37cfb7aae903525d943b2674b1f32594c70b0eb19a8c9697","glsl-optimizer/src/util/strtod.h":"237396def4e264d35ed4bedea00ef9a4ceab6d7a11a18c770d9747d22c69ed2d","glsl-optimizer/src/util/u_atomic.h":"c02e809526c6c09ba8fe51f50b2490d1b6c8e5c7f3c4031ae958250d098fc3bb","glsl-optimizer/src/util/u_debug.c":"8c060e379b816618f3dd22c9ea523c68b9425c76c36a7dfe5d6d375b337f5f4a","glsl-optimizer/src/util/u_debug.h":"e11e26edd9b9e4e6f8e6a435e69f4d9edda27e9a379f68f4c82ea2525aaaea68","glsl-optimizer/src/util/u_dynarray.h":"853d0fa6ff2261614488be624deb8a2b01e57c2c8eabc28578cbeed4ccc95694","glsl-optimizer/src/util/u_endian.h":"3ccea7e529740318d8a4b05c00db3adc9d1e292a52bdc56a05c9fae99209720f","glsl-optimizer/src/util/u_math.c":"c868a8c0886dc78f1b06b13404ba8b253090449045774dd56893ac9d75795184","glsl-optimizer/src/util/u_math.h":"a04e32e126db016413f9de0a2028a3e71737137463b1289eae576f884b06fcf1","glsl-optimizer/src/util/u_memory.h":"c5db17c724c70283ddbe04165722f6988d4e0eb9aa3602ae472feff016649af9","glsl-optimizer/src/util/u_queue.h":"92930ce236c0528a98b695f5cea8c5c6aa9683beaf71a2227bdc5d33d1b21506","glsl-optimizer/src/util/u_string.h":"c5a2f4ef576d1547bda12c4ea219179fefa54414977743ac094abcaf696ef6ca","glsl-optimizer/src/util/u_thread.h":"00b708459b27f9910d18db92c18cc65cfc618ac2b3cd144e45f8640057b10d58","glsl-optimizer/src/util/xxhash.h":"2f2aff2fc6c0c929f52cf6ae7314122124c5be026d41ad1c357608383c4a37ad","src/bindings.rs":"79993db2058bde39f99ef483d02560d33b1cb882f6a552319e8b86eb6f9021e1","src/lib.rs":"04be1554cd829eb40864b06d80b491dd48117a4e3a601c7d482117f7a0391e67","wrapper.hpp":"f3ea34cc496f7d90b9bfcada3250b37b314c3524dac693b2ece9517bc7d274ac"},"package":"8ba4741358604ca0848c27ecc069d68e62e11cde81e38aac1da3c54b79ab5adf"} +\ No newline at end of file ++{"files":{"Cargo.lock":"f7970552595dc803ace9ef19b5f5d7b1fc784aac30cb27b2ebc3002d97122b9d","Cargo.toml":"7c53ee20d848f9913cacbfcb3ab2e89e30deee8d619d173c95130c7c5d065827","README.md":"4468e08c64c19977707d792bfab0080e35ff927b64990eab77873f8ba056ba1c","build.rs":"92e29699487c21389fc823c50b410cfbfc74cc774265d24958489909ee48a076","glsl-optimizer/CMakeLists.txt":"42ce94744e82ffa000da8b64d81fc140e293b9f5da7dd4cf6b49e7404a2448d9","glsl-optimizer/README.md":"b18eef11a92d267d88a937b1154f7670ee433c730b102fdf7e2da0b02722b146","glsl-optimizer/contrib/glslopt/Main.cpp":"14ba213210c62e234b8d9b0052105fed28eedd83d535ebe85acc10bda7322dd4","glsl-optimizer/contrib/glslopt/Readme":"65d2a6f1aa1dc61e903e090cdade027abad33e02e7c9c81e07dc80508acadec4","glsl-optimizer/generateParsers.sh":"878a97db5d3b69eb3b4c3a95780763b373cfcc0c02e0b28894f162dbbd1b8848","glsl-optimizer/include/GL/gl.h":"1989b51365b6d7d0c48ff6e8b181ef75e2cdf71bfb1626b1cc4362e2f54854a3","glsl-optimizer/include/GL/glext.h":"2ac3681045a35a2194a81a960cad395c04bef1c8a20ef46b799fb24af3ec5f70","glsl-optimizer/include/KHR/khrplatform.h":"1448141a0c054d7f46edfb63f4fe6c203acf9591974049481c32442fb03fd6ed","glsl-optimizer/include/c11/threads.h":"56e9e592b28df19f0db432125223cb3eb5c0c1f960c22db96a15692e14776337","glsl-optimizer/include/c11/threads_posix.h":"f922e2c8613582a9340aa5ae37a4f7bd962dbc30e33a7a6ab14bed2d2995bc2b","glsl-optimizer/include/c11/threads_win32.h":"95bf19d7fc14d328a016889afd583e4c49c050a93bcfb114bd2e9130a4532488","glsl-optimizer/include/c11_compat.h":"103fedb48f658d36cb416c9c9e5ea4d70dff181aab551fcb1028107d098ffa3e","glsl-optimizer/include/c99_compat.h":"aafad02f1ea90a7857636913ea21617a0fcd6197256dcfc6dd97bb3410ba892e","glsl-optimizer/include/no_extern_c.h":"40069dbb6dd2843658d442f926e609c7799b9c296046a90b62b570774fd618f5","glsl-optimizer/license.txt":"e26a745226f4a46b3ca00ffbe8be18507362189a2863d04b4f563ba176a9a836","glsl-optimizer/src/compiler/builtin_type_macros.h":"5b4fc4d4da7b07f997b6eb569e37db79fa0735286575ef1fab08d419e76776ff","glsl-optimizer/src/compiler/glsl/README":"e7d408b621c1b605857c4cab63902f615edb06b530142b91ac040808df6e22f7","glsl-optimizer/src/compiler/glsl/TODO":"dd3b7a098e6f9c85ca8c99ce6dea49d65bb75d4cea243b917f29e4ad2c974603","glsl-optimizer/src/compiler/glsl/ast.h":"3e68ff374350c49211a9931f7f55a485d8d89fc4b21caaffbf6655009ad95bf8","glsl-optimizer/src/compiler/glsl/ast_array_index.cpp":"92b4d501f33e0544c00d14e4f8837753afd916c2b42e076ccc95c9e8fc37ba94","glsl-optimizer/src/compiler/glsl/ast_expr.cpp":"afd712a7b1beb2b633888f4a0911b0a8e4ae5eb5ab9c1e3f247d518cdaaa56d6","glsl-optimizer/src/compiler/glsl/ast_function.cpp":"74f4fbd490e366b37f4715168bb3465ecd9334d4130942f75dcc8e80e8e7f027","glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp":"d0f798eb09271d41d068b9e7b18220d37f1ed0083300ab51eba30989698fe23d","glsl-optimizer/src/compiler/glsl/ast_type.cpp":"8eb790b24b26dfb72bdc333744b566c26d8464c5d47d20eae659461f5c4899f7","glsl-optimizer/src/compiler/glsl/builtin_functions.cpp":"454189d643c220fcb49116ee5c8a34f7b349aa67564040deb8607f6a41a15e70","glsl-optimizer/src/compiler/glsl/builtin_functions.h":"a37cad7ed09b522c5b8bec7b80115a36846e7ba6e0874a2a858e32f7f202c665","glsl-optimizer/src/compiler/glsl/builtin_int64.h":"619def6f3aebf180da3944ef08f159ab12a58b24767e41d8b985ac37ded54d62","glsl-optimizer/src/compiler/glsl/builtin_types.cpp":"afec060b62d6f3b00bfbf94e9fa5f96341ce096c128d1eef322791e6ed9cea4d","glsl-optimizer/src/compiler/glsl/builtin_variables.cpp":"6563bfb1345cbca4c77e00eef09ad152f3e1dc271d246a08c5ce9e1f4ce4250a","glsl-optimizer/src/compiler/glsl/float64.glsl":"1072fd888be48c2a7a5117cd2d92a65f034965a66375f598bb856bff5d7be766","glsl-optimizer/src/compiler/glsl/generate_ir.cpp":"e5f0175370a0d07f93c48d3f0f1b8233d12c64a7b02de02dcc753ef7b398ef0f","glsl-optimizer/src/compiler/glsl/glcpp/README":"a0332a1b221d047e9cce5181a64d4ac4056046fd878360ec8ae3a7b1e062bcff","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.c":"2d179879b1ffe84f58875eee5b0c19b6bae9c973b0c48e6bcd99978f2f501c80","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.l":"e4c5744c837200dafd7c15a912d13f650308ea552454d4fa67271bc0a5bde118","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.c":"03494f9ce1cb82260506e2559e73a3eeb622c4bd51b65eaa0a2c3351862bd4c8","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.h":"264d9a18421cde255ce34a0a62b3d8e73465359f0d167e64aa3973062aae5bdd","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.y":"fafb66e3a8f149d19e085f18a4273ba6d4c11af9e9a01d665cc784dddf97b79f","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.c":"37ed294403c2abfd17fd999d1ae8d11b170e5e9c878979fefac74a31195c96b0","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.h":"85ac8b444bcbd0822b66448a1da407b6ae5467b649f5afaf5c58325bd7569468","glsl-optimizer/src/compiler/glsl/glcpp/pp.c":"a52d94f1bcb3fb2747a95709c4a77c25de7eea8354d2b83bb18efd96976a4473","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.c":"d11aeb3acfe966d1b78f1ee49804093f2434214c41391d139ffcb67b69dc9862","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.h":"abbf1f36ec5a92d035bfbb841b9452287d147616e56373cdbee1c0e55af46406","glsl-optimizer/src/compiler/glsl/glsl_lexer.cpp":"272b9fc1383d72b81bfc03fa11fdf82270ed91a294e523f9ce2b4554bd3effa9","glsl-optimizer/src/compiler/glsl/glsl_lexer.ll":"2b57d9f9eb830c3d7961d4533048a158ee6f458c8d05c65bea7b7cfbc36e4458","glsl-optimizer/src/compiler/glsl/glsl_optimizer.cpp":"f8095d20629d0af70be930b0612e169edb274551a1d25a3cd1bf9995a11ce2e8","glsl-optimizer/src/compiler/glsl/glsl_optimizer.h":"22e843b4ec53ba5f6cd85ca5f7bad33922dca8061b19fb512d46f1caca8d4757","glsl-optimizer/src/compiler/glsl/glsl_parser.cpp":"126baf368d525aba301854e3d91ba60b5aee32e1102376af71416f32cb95ec48","glsl-optimizer/src/compiler/glsl/glsl_parser.h":"2ea9a50716098a8f7bef782d2a030d757b68da73afb01b4d4940d3e8381d44e8","glsl-optimizer/src/compiler/glsl/glsl_parser.yy":"6b1fd1576b29fce005dff744a6dbd0219e4c695c361d61864e1f3a8d6fa6b764","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.cpp":"aad64b5b66467da650091430681e8c6a820cf3cadc4db3c160bf2f15875390ae","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.h":"71fd0e92bbdb193dfb067d7bfdb1200d77392be2fbd0cbfc9ca89d1bb4c7e741","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.cpp":"6660fb83c0ddddbbd64581d46ccfdb9c84bfaa99d13348c289e6442ab00df046","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.h":"24682b8304e0ea3f6318ddb8c859686bd1faee23cd0511d1760977ae975d41bf","glsl-optimizer/src/compiler/glsl/hir_field_selection.cpp":"72a039b0fcab4161788def9e4bedac7ac06a20d8e13146529c6d246bd5202afd","glsl-optimizer/src/compiler/glsl/int64.glsl":"303dbe95dde44b91aee3e38b115b92028400d6a92f9268975d607471984e13eb","glsl-optimizer/src/compiler/glsl/ir.cpp":"2b4741cce90b5d4abff5d719c7324e2693c67294d4d99736cb241554adb281bc","glsl-optimizer/src/compiler/glsl/ir.h":"990b1c74447c4eb4835353ccb0ed9aea644f97fc1129ef1739cd935075d85d2e","glsl-optimizer/src/compiler/glsl/ir_array_refcount.cpp":"8cdc1cffe01e42e0566fa2193a75f789628e8025ad1b82f0ee6f204451b7f9f7","glsl-optimizer/src/compiler/glsl/ir_array_refcount.h":"75f06ec81342b379096ca52e1dc0fd5f19a11ff8e9b58203c20628179d644c12","glsl-optimizer/src/compiler/glsl/ir_basic_block.cpp":"1e2920b1c0ecb08424c745c558f84d0d7e44b74585cf2cc2265dc4dfede3fa2f","glsl-optimizer/src/compiler/glsl/ir_basic_block.h":"81be7da0fc0ee547cd13ec60c1fcd7d3ce3d70d7e5e988f01a3b43a827acdf05","glsl-optimizer/src/compiler/glsl/ir_builder.cpp":"daba29c5a1efdd5a9754f420eb3e2ebdf73485273497f40d4863dadeddb23c0d","glsl-optimizer/src/compiler/glsl/ir_builder.h":"2822e74dd3f6e3df8b300af27d5b11ea2dd99d0e5e7ca809b7bbcce9833c483c","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.cpp":"8c6df5abf2fe313363f285f171c19ca6c8ee4f3bc2ed79d33c0c88cc8be45c48","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.h":"799852adc3a0e54d04080655e7cebfa0d3bf5b6ffed5d8414f141380665d4db7","glsl-optimizer/src/compiler/glsl/ir_clone.cpp":"d897a4e1f5bbec4a6a2f15044c1be9a4d13899c73be77335b041049a4589aa5d","glsl-optimizer/src/compiler/glsl/ir_constant_expression.cpp":"78bd87ddb09db67f6c499067728d72aef4f16aa02721a99a4b769d1e0cfa9010","glsl-optimizer/src/compiler/glsl/ir_equals.cpp":"bca28533a6310b0fc152b56d80872368f1510dc62ed6e8ac199b9ffa7fac02e7","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.cpp":"7e918d4e1f237eca01396004015865ce345afe32a876c9dbc6728576a1a7eae4","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.h":"f45b66aa9497520e7e08e612d24b308477c34477fbd963ee9320eac664957f16","glsl-optimizer/src/compiler/glsl/ir_expression_operation.h":"cc9f10727dbd26cac506804f51456302c702650f9eeb59054a7e1575d5cf6687","glsl-optimizer/src/compiler/glsl/ir_expression_operation.py":"7b86c96021b9fbe165957f4ecb0b612fefcde1c2cf3c6d75e3cdb22e369216ba","glsl-optimizer/src/compiler/glsl/ir_expression_operation_constant.h":"9ad3346416392e3efa11e12ecf2feca7453c5253d241eb96c91dfb85d4f2b971","glsl-optimizer/src/compiler/glsl/ir_expression_operation_strings.h":"a6826daf496a8b9e89885bc2a161ac3445d501b23c6e0ac33e2c01b506b273c8","glsl-optimizer/src/compiler/glsl/ir_function.cpp":"7537365fc0fbe4b37a26b9a2146cc64d3e9a774d60eab63b65002ad165ae8fc7","glsl-optimizer/src/compiler/glsl/ir_function_can_inline.cpp":"faddbf112187a048d502716a3fb82570a322299ba2a3abd79388382c82040bfc","glsl-optimizer/src/compiler/glsl/ir_function_detect_recursion.cpp":"9176973eaf5c0a984701f953bb7a80f37dca43d59b5bce50fc69b3f02f2902d7","glsl-optimizer/src/compiler/glsl/ir_function_inlining.h":"9739493f99c489987d650762fccdd3fb3d432f6481d67f6c799176685bd59632","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.cpp":"3725861fbe2b98e0617f52d3b14cf6d3b25fb5ec00f5ef5d308b03642f592767","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.h":"e0560210e966c0c31e4ca843e80ea154e64db5a444b8c2df845b6ba5b3a43fc1","glsl-optimizer/src/compiler/glsl/ir_hv_accept.cpp":"caf7ce2cd9494aadd3c58bcf77f29de58368dc9e347a362bbf37f8bda9509b80","glsl-optimizer/src/compiler/glsl/ir_optimization.h":"8b3dcfc7f9e96b21a8dd47a0040d90be483a9e67a2cdce3a697188fb758d4630","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.cpp":"f8e34a983452be0dcb5a695e9c8e895eead24f9e540992a8afe510ae85da4c4c","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.h":"1ad1bd3efd1ace39051c13f904c05fd80425d329444f9a8d47fd6d948faf46e0","glsl-optimizer/src/compiler/glsl/ir_print_visitor.cpp":"643f5a68aae3fb37267fd793f1216d1cfdeb2c09338c26b1f30e4c6deaef4de5","glsl-optimizer/src/compiler/glsl/ir_print_visitor.h":"4573eb93268a2654c14b505253dd651e2695d43dc745904d824da18305269b95","glsl-optimizer/src/compiler/glsl/ir_reader.cpp":"06bfba802c8354e5a8b2334b6d78d6297de18235bedd3f8fbb382c89870b02f2","glsl-optimizer/src/compiler/glsl/ir_reader.h":"63e3f7f1597936a7011d5b520e171b197bf82bee6c1560d822c3edf5aaa6f9e9","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.cpp":"84b5c5d746555adca85759c2912fe48010232b7c1c0bd2cf03bd04067a85e66f","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.h":"fd8c561b71085d3211fff85ed514fecb299d8ce19a04bc063419a55b6d840525","glsl-optimizer/src/compiler/glsl/ir_set_program_inouts.cpp":"ab9f115ce9e7f312d9c7978340ced0dc4ae6d13a80e08442ba9709d11d50cae5","glsl-optimizer/src/compiler/glsl/ir_uniform.h":"683ae6896b1a08470c090be5f822fc31cd434eab9216e954b9bba24a46975109","glsl-optimizer/src/compiler/glsl/ir_unused_structs.cpp":"9c1620c45f2fc071fe5ed828472040b14c5f42effe06aa0e3b8352c95ef78786","glsl-optimizer/src/compiler/glsl/ir_unused_structs.h":"13387b49c23093575276b25b9dfd31fedd8f131c5c4f3128ab04cf03e15b5295","glsl-optimizer/src/compiler/glsl/ir_validate.cpp":"6b232be5999a86ea278f4f15b2832d76843246509118d924243055a3b9b0299f","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.cpp":"2764a3cad937d53f36db7447c3a5b98b04bf153acf81074d971857fc5bca460d","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.h":"b0668e3eb1501ef65e38fe12830742ecb3d28e6039f30e366c8924efc29b4a39","glsl-optimizer/src/compiler/glsl/ir_visitor.h":"f21b3534c3d66d5fb707d1581fece7e1eb043523afbaedf89918cfb031c6df94","glsl-optimizer/src/compiler/glsl/link_atomics.cpp":"360f0209e11f367ba358223597b0a118bae095bff16337cf03f1fb89c5b80ca6","glsl-optimizer/src/compiler/glsl/link_functions.cpp":"de7895da8aa33a1e3c2c1eb2fdaf267ab5d1fbfdb79ae2e67f95211e946e294c","glsl-optimizer/src/compiler/glsl/link_interface_blocks.cpp":"1926cfa73810704eb19b916c1b2cdb9321155e2f98b2a0a57c7c3c6e960540cd","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.cpp":"1e14e06ca3b2c1089cfba2e8eaf0c1f373d9d6374b6082f320962dd71ae09611","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.h":"fd58c155af645295bb6aec08797889de586f4d919731de2bce57e8dce59bb048","glsl-optimizer/src/compiler/glsl/link_uniform_blocks.cpp":"09589f49776dce32e6c4044937de7e0c839a9754ad31960148f8f9e010658997","glsl-optimizer/src/compiler/glsl/link_uniform_initializers.cpp":"bf98e08c12db466acf9623cbeb8fa8e3b4002512722e7a6521287f558a099f37","glsl-optimizer/src/compiler/glsl/link_uniforms.cpp":"84bad5b1377362cecf259b05124239be5220b03ce1c0c61b59bd9a47e4379af2","glsl-optimizer/src/compiler/glsl/link_varyings.cpp":"a5f1a53e7c80d635515fe808ff223d89fef1767abb0f2b7aa28fa6773dca353f","glsl-optimizer/src/compiler/glsl/link_varyings.h":"b9dbe018f038df69763df2e928742ce81bbc6e3aaba26f50621e30a6d9aa6220","glsl-optimizer/src/compiler/glsl/linker.cpp":"40b1ecd5d4f6c7f13d5a87ce390561a51fdf6f3fcd9b2197b9c88b03a773ba94","glsl-optimizer/src/compiler/glsl/linker.h":"ecf94b4ad75ef461c27c557fda4bd25f34c91930822b8e1d729ec84520d4a049","glsl-optimizer/src/compiler/glsl/linker_util.cpp":"1663ad88e2a369305659aeeffaedb5bd752cf76340a2ba5797fc0bf600633cf9","glsl-optimizer/src/compiler/glsl/linker_util.h":"6db788daf9c8e87ae2764b61a8b37ebe419e69c1b82ddee01986e37c978c6993","glsl-optimizer/src/compiler/glsl/list.h":"b1f46ce0e552fe7c45b2a19408a9d97662e23e4b182ab335491c26f8cf25886f","glsl-optimizer/src/compiler/glsl/loop_analysis.cpp":"57ecd573477c68091c7cc99537faa7139a8f395935e3d4f10144cefdefb5a611","glsl-optimizer/src/compiler/glsl/loop_analysis.h":"a85f045a038ee5b5176063e85d7988865862c44ab0580f771b993a042d0b69cc","glsl-optimizer/src/compiler/glsl/loop_unroll.cpp":"bd4292ea2809f5a669bcb76ceaa1ac365772dcd638c579c3ed10275214901a54","glsl-optimizer/src/compiler/glsl/lower_blend_equation_advanced.cpp":"8cfbef140d9c4b4d2f57bfa05c9c374d31a121d0f87afce94333f049023b654a","glsl-optimizer/src/compiler/glsl/lower_buffer_access.cpp":"1ae221c3c7a95aeb867207e7a742be635f91b406c157747bfd6ddf10274d97fb","glsl-optimizer/src/compiler/glsl/lower_buffer_access.h":"807886953a576a323591798cbca5e2df24295ea893b28affd8ffb5926cebaa04","glsl-optimizer/src/compiler/glsl/lower_builtins.cpp":"4d81afc32cf58e1481fcb5e42888ab93dbe6820310a20ff7a9982b77b2152d9b","glsl-optimizer/src/compiler/glsl/lower_const_arrays_to_uniforms.cpp":"608403f0eeeedf21cfcd3014116e0f44e28cbdf6c4c32aac7e613e64e30205e1","glsl-optimizer/src/compiler/glsl/lower_cs_derived.cpp":"179905cd47a294122adeb5b0abfed6f2f67782dcde21b544d1ee2c1985154e66","glsl-optimizer/src/compiler/glsl/lower_discard.cpp":"3b361b2db0004d544d64611cb50d5a6e364cf6c5f2e60c449085d7d753dd7fb0","glsl-optimizer/src/compiler/glsl/lower_discard_flow.cpp":"f5c29b6a27690bb5c91f196d1a1cf9f6be4f1025292311fe2dac561ce6774dee","glsl-optimizer/src/compiler/glsl/lower_distance.cpp":"a118c85493d5d22b2c059a930c51a5854896d4b1dade76598eaa985e5a3dff8c","glsl-optimizer/src/compiler/glsl/lower_if_to_cond_assign.cpp":"469e617757fd1728709cce021aac5c8da05ee503bf5366977bdc4ef7a6d83950","glsl-optimizer/src/compiler/glsl/lower_instructions.cpp":"6ff5c396abe40d8a2145d571e99e2bbe9143393e15aafc28adc2803a01d821b6","glsl-optimizer/src/compiler/glsl/lower_int64.cpp":"d1ed41196880dd53c7b13e2782f9423f8442bf1d46186e8be92b1b66218a83ee","glsl-optimizer/src/compiler/glsl/lower_jumps.cpp":"34de7b493f281589fb0c2c0f6e885d0a0fabbe7a4e97a73de374dd714777a58c","glsl-optimizer/src/compiler/glsl/lower_mat_op_to_vec.cpp":"dff7a308edc4846c348ed4225c6699a9c75abac68d88f41f85954276552779f4","glsl-optimizer/src/compiler/glsl/lower_named_interface_blocks.cpp":"16063ac127bff75a68272070ab11c21c25101edbff62b4c68f4983b4cd941af0","glsl-optimizer/src/compiler/glsl/lower_offset_array.cpp":"3b00773399135aea85746a5a68b96ef000bc6841be1a2c8e6f25c516628b0949","glsl-optimizer/src/compiler/glsl/lower_output_reads.cpp":"a0fc9975d5aa1617e21fc6c353659a9802da9e83779a3eef4ec584f74b4dadc5","glsl-optimizer/src/compiler/glsl/lower_packed_varyings.cpp":"7550099d4ae123d71541c2fc88bc04fbfe9271ec75d7e210987d1c8cac3cf3ea","glsl-optimizer/src/compiler/glsl/lower_packing_builtins.cpp":"79a13d161fe505a410ab948d92769395708693ec888153630fa240e5b97e356f","glsl-optimizer/src/compiler/glsl/lower_precision.cpp":"f82a185b879872b977a1787d8061b9a80bc4cf8db1b970db6efba2ad9cc20fa2","glsl-optimizer/src/compiler/glsl/lower_shared_reference.cpp":"ea2dccf50a83bc19391bf6b7ab6aa53c0005f427af4066d25140340af9a4beef","glsl-optimizer/src/compiler/glsl/lower_subroutine.cpp":"f69fa53650eeb6f2944fce4d36a6e0a423e6705f3a3bd3389c7fadb83cfc8802","glsl-optimizer/src/compiler/glsl/lower_tess_level.cpp":"b196c9d424c0569f3e85d75c2d125af21566cb113d69036db87c0990703e0fa7","glsl-optimizer/src/compiler/glsl/lower_texture_projection.cpp":"4d247f244272adc8250fd888d8d932a140dd5de4d1efc7a58492c3c2b8291527","glsl-optimizer/src/compiler/glsl/lower_ubo_reference.cpp":"89bdbc6c1669230c644c0857db1ce2781ec61d349ecd08c7914146e1f4750a4a","glsl-optimizer/src/compiler/glsl/lower_variable_index_to_cond_assign.cpp":"fce930f29ac9405b297d1f749d68f59506b89c70b4ee1b1ab8cf49a34cc71ecf","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_cond_assign.cpp":"3c67d851a11a55fad1c49a550f3a0cfe50892d33a3f238ce266cd829eba510a8","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_swizzle.cpp":"f5ec666b73e1415cbab32519a53605ed385f3b03e889560373dbce69dda5000e","glsl-optimizer/src/compiler/glsl/lower_vector.cpp":"f7c13f5572ebe09b6a71553133b2cf003cd4b77b9657600672ee3b21bf890725","glsl-optimizer/src/compiler/glsl/lower_vector_derefs.cpp":"b05793da6dd620a531b43df5af8b2ecbc37b9db0c88910f5724ea10bcd057e19","glsl-optimizer/src/compiler/glsl/lower_vector_insert.cpp":"fee772ec17eea5e86a529bf9c5fa2ee0d29a5982bb75ebc6d68ed36cd19aa299","glsl-optimizer/src/compiler/glsl/lower_vertex_id.cpp":"690e8715182e03fead5cc5a35251fb4f41b357e4c71a1dfbc4bd7be19862b56d","glsl-optimizer/src/compiler/glsl/lower_xfb_varying.cpp":"58c0e8b270e4bbde54250be03cdb2f36966bcafb785372ad2e2b786835df7f9f","glsl-optimizer/src/compiler/glsl/main.cpp":"ae5e88abbbc8a12f769e1296bad938b9d7398cc6da0d3d0caeceeeb876536850","glsl-optimizer/src/compiler/glsl/opt_add_neg_to_sub.h":"f5054944bfd068810629080d0ea11df78b3f57a8f86df75e13ca50157ad1964d","glsl-optimizer/src/compiler/glsl/opt_algebraic.cpp":"25f45b20e1972ee8c789177a1aeda6e4286c25db2eae3a43ff83029ae64969c0","glsl-optimizer/src/compiler/glsl/opt_array_splitting.cpp":"19d3ce0e815438f4df9ab2890e767b03a4f3f191b53bb30c0217cf2ae6a95430","glsl-optimizer/src/compiler/glsl/opt_conditional_discard.cpp":"0e44e0e126711a3725c1f3a2aa65ff03c381fed08680ffc30101aae60f716c4e","glsl-optimizer/src/compiler/glsl/opt_constant_folding.cpp":"a088d04d9b45f9e55e235835648f614c89b7803c03a6d4f6a6d1a6bc1f0228bd","glsl-optimizer/src/compiler/glsl/opt_constant_propagation.cpp":"8a9440d77ecd6dcf13e683cbb99943aab6311c8fd4b5f6a9189a8d4f270746f4","glsl-optimizer/src/compiler/glsl/opt_constant_variable.cpp":"63d3ccd4dd09f19c9cf1a2f51592111bed41284504f29f3c0de4cadebc439a37","glsl-optimizer/src/compiler/glsl/opt_copy_propagation_elements.cpp":"ffa0f50863995e0d2e31f55a52e82319edc71e520987bebd7f7e561ea331c64b","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_variables.cpp":"84e8747b948232f01dd56b428b9315f96f9511f605f240119fc446fae28981a9","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_varyings.cpp":"761523e88f5b3ba785170f4d7205e94fa99acb7e74d29efbe40e1c010e1dbdb3","glsl-optimizer/src/compiler/glsl/opt_dead_code.cpp":"fd1ba2da7337d4e5dad17f5c2d73d9cc8880305f423e85d64cf94553588fa401","glsl-optimizer/src/compiler/glsl/opt_dead_code_local.cpp":"969a598b4df322baf222258a66cd64a326ea20e5b3125be9d8d1771f522c69e0","glsl-optimizer/src/compiler/glsl/opt_dead_functions.cpp":"774cae6536d02edf26e996a2a895e1f62d5098f16dc96b44798b4fc731a9a95f","glsl-optimizer/src/compiler/glsl/opt_flatten_nested_if_blocks.cpp":"3696a5c55f02e20056e085bc2714f73ac992f221b6f3387d655068e86b512046","glsl-optimizer/src/compiler/glsl/opt_flip_matrices.cpp":"44f0fe05b49329667671f88c96dc86ab3fe1459ff7b87f2b2d88de2d49829f9f","glsl-optimizer/src/compiler/glsl/opt_function_inlining.cpp":"fb56a33c90419a01676b57cbd91d0674a54cca40e6defaacc88dd33facebc131","glsl-optimizer/src/compiler/glsl/opt_if_simplification.cpp":"ac406eb35e379c357641d6c5749f50c65961455924d3dc884e2b90046fa92c5c","glsl-optimizer/src/compiler/glsl/opt_minmax.cpp":"8abd59d3b14ef60ff14a9c69660e6945f5cf10b97edb4afebe56be3f81d96316","glsl-optimizer/src/compiler/glsl/opt_rebalance_tree.cpp":"8bb6329dc0f299042368fc81934c2df019b45ab9f7aa0415d4e57b8d1ff98c9f","glsl-optimizer/src/compiler/glsl/opt_redundant_jumps.cpp":"222c73e2ac7a938ebb6428cc6c780c908ff6156d8ff935b04fed93a48fc10496","glsl-optimizer/src/compiler/glsl/opt_structure_splitting.cpp":"2edc79cc13f3177934e0443ad62f5976a1991f01f86ea303a803434849b13a47","glsl-optimizer/src/compiler/glsl/opt_swizzle.cpp":"015d0abddfe507f67c4b96c82988d861d018ededf7bf055e2bcbe9ea92da694e","glsl-optimizer/src/compiler/glsl/opt_tree_grafting.cpp":"46d28ac983ea244a4315bdc0e8892979ec4d1f9b9a96ac8a8a08006d9bc5e878","glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp":"d80ee43bb97d9f016fb9c5e1e06f5b2afa569811f368ba067be794ec11d085fb","glsl-optimizer/src/compiler/glsl/program.h":"2982447e2abd35371e273ad87951722782a8b21c08294f67c39d987da1e1c55f","glsl-optimizer/src/compiler/glsl/propagate_invariance.cpp":"080943e21baa32494723a2eefb185915d2daae1f46d6df420145c5ad6857e119","glsl-optimizer/src/compiler/glsl/s_expression.cpp":"1ced972bc6ecc8eab4116ea71fb0212ab9ae5bcc0be3b47aa5d9d903566b3af1","glsl-optimizer/src/compiler/glsl/s_expression.h":"65b847e30e22a809b57d0bc70243049c99d9c6318803c5b8d0826aba55dc217e","glsl-optimizer/src/compiler/glsl/serialize.cpp":"be0eb4251348a9d921acb839a5c48c6023a2e9d116d602bb0432787ab623655d","glsl-optimizer/src/compiler/glsl/serialize.h":"57425732eba1233d928e5f07f88b623ce65af46b3bb034bf147f0a4b7f94f9a1","glsl-optimizer/src/compiler/glsl/shader_cache.cpp":"e0c5c433f2df3fccdf1d61281bfcb0ee5633433339b97c697d64db99611cbaaf","glsl-optimizer/src/compiler/glsl/shader_cache.h":"9217164d8d7f54aca0fe5922c7187095a6ae0cb703b196b79805aeef07a7e697","glsl-optimizer/src/compiler/glsl/standalone.cpp":"8e6c416a14d631261917a5fe4cc91880c287b22b2dfd70eb22028289a8fa5364","glsl-optimizer/src/compiler/glsl/standalone.h":"a7c397d1dfdd1e7fb2cfe99db35cd9df93251e642059208533202b7f20497f83","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.cpp":"970d14b7a9d58e5270321f97bf5d57795558b1c570a56678e04a65b26c60bf4f","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.h":"d921a617ea82b9e49413314492a645c44356de503581b1be3f1b57de236e480d","glsl-optimizer/src/compiler/glsl/string_to_uint_map.cpp":"d824bf5b839bd39498dc9e457103cdbe3e5289ddf7564107c27b1505948dd31f","glsl-optimizer/src/compiler/glsl/string_to_uint_map.h":"e2f18e66359c9d620e085de7f4a334a47df9c66e65a5bfe8b734c627bec04104","glsl-optimizer/src/compiler/glsl/test_optpass.h":"b27b8f35f5387e7ce4982bb51c7b63ccf14f91757f3108a5d02ed006925bb8a0","glsl-optimizer/src/compiler/glsl/xxd.py":"376484142f27f45090ea8203ae2621abf73f06175cb0ee8d96f44a3b9327f4bd","glsl-optimizer/src/compiler/glsl_types.cpp":"044bb6754f45419a3151e7a25c39202a82009ae3c6bc54ff7f0bb4258a5deefe","glsl-optimizer/src/compiler/glsl_types.h":"fd899a42f34ddeb8601bc3cd6c5e3aed82fc8aef4042dde1b39b3c01e1dcc219","glsl-optimizer/src/compiler/shader_enums.c":"436bff5216b11b0980bdfada5885fc6ac9afa2037a3027fcd6eea2a8635597ac","glsl-optimizer/src/compiler/shader_enums.h":"13220442a5c02e83540cf2c0ad4f8417b2fbda5f2586dec4e92082544c937cdd","glsl-optimizer/src/compiler/shader_info.h":"4c5453e81197ca83593ee4f365074b23530f2ab21c78e1733b63dec6f344c12a","glsl-optimizer/src/gallium/auxiliary/util/u_half.h":"3c2b37bda3ccb64387e44b723d29cf9046decab1a893bf42d842e9603398bdee","glsl-optimizer/src/gallium/include/pipe/p_compiler.h":"c75620096ce8523dae90599e50aa2ef6468d3b0e368a77795edeb20dd1abfc0c","glsl-optimizer/src/gallium/include/pipe/p_config.h":"a27692fc35f9e55df3224b7529e66b3001e911e94e6bc5f8f569e493e1ee3fb7","glsl-optimizer/src/gallium/include/pipe/p_defines.h":"be26d68c0acc67c5e44788c6299716a9eee415fd81d7d747e3738a829e3b6b38","glsl-optimizer/src/gallium/include/pipe/p_format.h":"5674215fc41d27496f037cf837717daefbf23ebb38d40ace7c0c414bc08182b0","glsl-optimizer/src/gallium/include/pipe/p_state.h":"d600593aba5f5a17072a6c38f6baa81e01c7994b0174250f7e433bb41684b702","glsl-optimizer/src/mapi/glapi/glapi.h":"73632a625c0ddabc401205e8b5a81eb8af8506868efe4b170d7979ec3619e9c5","glsl-optimizer/src/mesa/main/config.h":"5800259373099e5405de2eb52619f9de242552a479902a3a642a333c8cb3c1e7","glsl-optimizer/src/mesa/main/context.c":"2f3208473d99c94f734b1137ba91889d4a1babb9e7534bf1dc85d851ee98274e","glsl-optimizer/src/mesa/main/context.h":"cc7e4194797db9d007f01884e23d786c453b3860821f7f2ddcdf0f1bf3f8ffb1","glsl-optimizer/src/mesa/main/dd.h":"6a964acd06b6c2d88700e69fb75fe3c6b3b3d45bbc41db24f3f897a29695fe0c","glsl-optimizer/src/mesa/main/debug_output.h":"7312422e90b8c0e34028ac27280e438139b5cba525c99deb3ac883cd3d87e452","glsl-optimizer/src/mesa/main/draw.h":"7eaef3a9e27a60ea6f7937109bf3a6190b831162fde0479abb12077ce27c353d","glsl-optimizer/src/mesa/main/enums.h":"87d562a6764f51c014a2274fa7c3aca17c04441537ddd56b2554f13c6fffea92","glsl-optimizer/src/mesa/main/errors.h":"c79444b5df289c90fbb22a33b2d0c23917d9fc4510960088f0b79e53bb56b1b2","glsl-optimizer/src/mesa/main/extensions.h":"a38b2f87cc93c513994281350d69e06c84ff8eded5313ec0a1be33f375e0ebbd","glsl-optimizer/src/mesa/main/extensions_table.c":"17642d1a8c9a0bf2bd61060052d33ff14a005d2b962e6cf91465797a50851e85","glsl-optimizer/src/mesa/main/extensions_table.h":"2c879571c238d2e14461031ac740372fd0f9ac3a34c0d5541bb9b7ed4c0376c8","glsl-optimizer/src/mesa/main/formats.h":"02e2f7ec3e39286cf9f27e2641043e6df8ecb1dfde9e643313210e214af2a929","glsl-optimizer/src/mesa/main/glheader.h":"58217b33eead6aa6b23cd4a291cefeaa6cb84e465f4960daffca97c44d6d1c35","glsl-optimizer/src/mesa/main/glthread.h":"51fb2711f77e7eafcfc52d29d5b844978832b24c930d88accd48d143a6eb9c6f","glsl-optimizer/src/mesa/main/hash.h":"7e7f782034c16a8e693de48e00c31d4a90b0129f4029fd074033d7d16ccbe718","glsl-optimizer/src/mesa/main/macros.h":"73d15ddfd64f2b57b9b2ffeeb993b9c2c0899a80563e9d6ff337b11ccbe6eee5","glsl-optimizer/src/mesa/main/menums.h":"5dfac0e2279d60b0cd0c7b9fc2a5021620d0f6282ed2e738c420214e3af152d3","glsl-optimizer/src/mesa/main/mesa_private.h":"edda678b93438944279a551f663b8858ad84814a9fc88ba9672ef195599c24ae","glsl-optimizer/src/mesa/main/mtypes.h":"6efddefa099e4d2e3fdd97f0055644f47aba21711385edfeabc2d9b0676f2eec","glsl-optimizer/src/mesa/main/shaderobj.h":"9f0dfe96d0c2154201adef942bd36053533ac7b2492fb3786acda5bea514c75e","glsl-optimizer/src/mesa/main/uniforms.h":"4e331e6ad6e9cbded978b4082dbe0a57c1f8f01327446bb6892bfc179976c38b","glsl-optimizer/src/mesa/main/version.h":"9d0a13a758099302dc55cf7d045791834a89b0f9d4cf17b2692259b369a8a9a1","glsl-optimizer/src/mesa/math/m_matrix.h":"a37b19f182e070db3df93b0ede43c22fb8be8c2906504133ee6dbd7db1185d8b","glsl-optimizer/src/mesa/program/dummy_errors.c":"1820e305515b4c5e041f5e1623266a48ec8f076a155310be7d60637101f593e4","glsl-optimizer/src/mesa/program/ir_to_mesa.h":"b47f58d22e3ca2ae42d52501ea769d15c4476834944fa97eeccd3a3439211d00","glsl-optimizer/src/mesa/program/prog_instruction.h":"ab3832152a7e144b59e5a2264b2c29db56d93be31e76bbd958527a56771b40eb","glsl-optimizer/src/mesa/program/prog_parameter.h":"ba18c743284eadbc837c2c364c73e5d372321a7637a76e589d8d39fe8b5de225","glsl-optimizer/src/mesa/program/prog_statevars.h":"fc413698f84bc52d45fdeae0471934ee9904bfb7eac1a2b5f70446e54bcbbdca","glsl-optimizer/src/mesa/program/program.h":"1f01026a4eff440a3f122fd9b519d03546fe7f7d8be60dca834e95a2f8fbbfd2","glsl-optimizer/src/mesa/program/symbol_table.c":"6611cb9f078035bf5ff8c9112093a6c7d99f8af99a3931d0c07f227cc72283ea","glsl-optimizer/src/mesa/program/symbol_table.h":"631dc35ac48d5e87962d45507461920f6575610960ffcc42a08cefeb43300cda","glsl-optimizer/src/mesa/vbo/vbo.h":"6eb1dcd9a08c92f276c5fe08da184ff9d455d1be421913b8ad732a7b65e858fb","glsl-optimizer/src/util/bitscan.h":"9e49e694e6b34fe035bc685f32588827eb8cbe7d82878963c7ab52843e1c16aa","glsl-optimizer/src/util/bitset.h":"c40f78515c6230fed18345c6751ce33833a49da7a27901c7e6d7340cbdcbc5e7","glsl-optimizer/src/util/blob.c":"8f729846f66efc9c15485cc5fc24c6ec861fc1fecb2f652573f2a237d481b791","glsl-optimizer/src/util/blob.h":"93e1eaac866b9a7cd6fc03b533c18fb2edf0e97f03395eff4f3a605c4fc14d0c","glsl-optimizer/src/util/compiler.h":"79e3bf40a5bab704e6c949f23a1352759607bb57d80e5d8df2ef159755f10b68","glsl-optimizer/src/util/crc32.c":"2f3467a046b3a76784ecb9aa55d527698c8607fd0b12c622f6691aaa77b58505","glsl-optimizer/src/util/crc32.h":"59bd81865e51042b73a86f8fb117c312418df095fed2d828c5c1d1c8b6fc6cd4","glsl-optimizer/src/util/debug.c":"c3d68e9752ccc19e66c669562cd113cf1d0ac83cbb30174789e7fb8d1df58f9c","glsl-optimizer/src/util/debug.h":"50068d745c4199ccbd33d68dd4c8a36d2b5179c7869a21e75906ddd0718ca456","glsl-optimizer/src/util/detect_os.h":"343a8790d17a3710c6dd015ee367f84e3902ff3f2e36faca2bf93f9d725d3574","glsl-optimizer/src/util/disk_cache.c":"f533937e5a4fffe76e2739ef4b6b1e1da097d96d63eb808e68ebbc7027641c23","glsl-optimizer/src/util/disk_cache.h":"e83314fb14134a8e079b15e470a6376ba5a8253701f048c890a62b7e55d64bc8","glsl-optimizer/src/util/fast_urem_by_const.h":"e108fce804616c47d071dfe4a04163eec1126e448ed1aa89abb6b3a6d772bd5b","glsl-optimizer/src/util/fnv1a.h":"ab2596f19c6adf431ae27618f62c5743e24ad23ef83bb359a4c4c218245ab459","glsl-optimizer/src/util/format/u_format.h":"4cdfc0c59cbc99a092e5ec5a396910f2d93b9643e5d8141050b011e66f11e45b","glsl-optimizer/src/util/futex.h":"26f7c9d86e9ffef4c0fa2761f1aaa1918337302e20bd6ca10e61dc3c47356deb","glsl-optimizer/src/util/half_float.c":"11bc2584493d5d9d46e8c8a619a0307cf150bf5ab5d0f96bb764b061dc37a00e","glsl-optimizer/src/util/half_float.h":"7f7c380f126da1400a91758cc0392f24bf967bce1672890b62be26fe9fbd922b","glsl-optimizer/src/util/hash_table.c":"0ca40352e35dedab0a84c64c903f1b16d47e950bb5f43b4d22bb57d499bfea6e","glsl-optimizer/src/util/hash_table.h":"217191bb360592e2232f187473c10287d2cda8ae6fa5c53d0ef74c8c206118b4","glsl-optimizer/src/util/list.h":"9fab03c6a78186bb5f173269f825f6ce976b409d931852e3d93bac632e07989a","glsl-optimizer/src/util/macros.h":"63faf65b51058c483b17f1f77da51d1c53c8beab52678cb6bd01f1228a63b6b0","glsl-optimizer/src/util/mesa-sha1.c":"00c692ec353ebc02c06c57c5a71de0ab7a119f86a4146f452e65ec87e4944417","glsl-optimizer/src/util/mesa-sha1.h":"bff4c29f4bf7cdbcefb30fa0c996a7604a380eba8976467c2a60e7cd328f7e26","glsl-optimizer/src/util/mesa-sha1_test.c":"25da89a59d51469f77b4c468ca23ffdce0a7a1166a70b6cc23026a6800b0143c","glsl-optimizer/src/util/os_memory.h":"64555faf1760ae6954f42c83727c38dfc4c278e9152115779ffaad58b42adacf","glsl-optimizer/src/util/os_memory_aligned.h":"12d86fa94be38c13f7eeebdf313795e1267dd5a7187d2f0072e0e896f41702f6","glsl-optimizer/src/util/os_memory_stdc.h":"07360363b88c927065e10df71bebf6c8a0cc3b9167c9dfce55f2d65f11e6f787","glsl-optimizer/src/util/os_misc.c":"a9936e613ec84803abd59ad47c192c8e3939993c950ac91973fdc4cec1801bb8","glsl-optimizer/src/util/os_misc.h":"cc68eb12e05b5e749c54298cb4a6f4cd20cc5af7db3403e70b3c27b56090c740","glsl-optimizer/src/util/os_time.h":"73e775f7335244ff5964c678c27eedf1aea6abea44c4169d327ea8c7ce4a3a88","glsl-optimizer/src/util/ralloc.c":"4b51189595ef67bcef52c40cbf654d969041dbd15e15d4a893ad494ac060aeca","glsl-optimizer/src/util/ralloc.h":"e573c45875ff1530f0dbee9a93ae55535fdac8d5cc88a79ebc327c688824bde5","glsl-optimizer/src/util/rounding.h":"0450722353caf83de07e67f335949dbe95fe53b534052d4ee9d28d2781387614","glsl-optimizer/src/util/set.c":"86f8c9a830bead5a5a79bc970b0ff97809312af07b3beb39ef9d90af04d40a1b","glsl-optimizer/src/util/set.h":"3e39ca161e7ed4ec7c436cc9c7919ed9a55ed1b71edbf2caf6f9bcfd9bc578ed","glsl-optimizer/src/util/sha1/README":"00af7419af05247081858acb2902efd99fcda2ce16e331079f701645bb3729c0","glsl-optimizer/src/util/sha1/sha1.c":"1403bbe0aad42ba3e6be7e09f7cad87a6a8c4ad5b63962f7b92b9f37d8133b04","glsl-optimizer/src/util/sha1/sha1.h":"68d9f240eab2918026ecdf22be36811abbd4f1389f6c36e31258041aeaedd247","glsl-optimizer/src/util/simple_mtx.h":"12c6c3c4b7db9168bc656d5b3c65912075084d2b388c415d5c3d3f5953a9d6c7","glsl-optimizer/src/util/softfloat.c":"a97e51a96fe5e6a052c02aa6bbec683fe73fb88a8c087d9c930503e2120d8a2e","glsl-optimizer/src/util/softfloat.h":"66664b0250e83bf5dd4cc743acd119d076efcea624a0eab3d6b60718e6ee8811","glsl-optimizer/src/util/string_buffer.c":"63a1d1b1e34926c88ea00159cafbcd56568b805c4f64d1e8c97169fe313921fc","glsl-optimizer/src/util/string_buffer.h":"7b88d1b1d9c6cfb8e93331813535c127289437c75f822029e9a3bca8ea6b52ee","glsl-optimizer/src/util/strndup.h":"0273c4fdb7482cd7746881a63d3998648c6d63415ba85af1d1860f0e0dc504c6","glsl-optimizer/src/util/strtod.c":"5cf610d8a37373cf37cfb7aae903525d943b2674b1f32594c70b0eb19a8c9697","glsl-optimizer/src/util/strtod.h":"237396def4e264d35ed4bedea00ef9a4ceab6d7a11a18c770d9747d22c69ed2d","glsl-optimizer/src/util/u_atomic.h":"c02e809526c6c09ba8fe51f50b2490d1b6c8e5c7f3c4031ae958250d098fc3bb","glsl-optimizer/src/util/u_debug.c":"8c060e379b816618f3dd22c9ea523c68b9425c76c36a7dfe5d6d375b337f5f4a","glsl-optimizer/src/util/u_debug.h":"e11e26edd9b9e4e6f8e6a435e69f4d9edda27e9a379f68f4c82ea2525aaaea68","glsl-optimizer/src/util/u_dynarray.h":"853d0fa6ff2261614488be624deb8a2b01e57c2c8eabc28578cbeed4ccc95694","glsl-optimizer/src/util/u_endian.h":"3ccea7e529740318d8a4b05c00db3adc9d1e292a52bdc56a05c9fae99209720f","glsl-optimizer/src/util/u_math.c":"c868a8c0886dc78f1b06b13404ba8b253090449045774dd56893ac9d75795184","glsl-optimizer/src/util/u_math.h":"a04e32e126db016413f9de0a2028a3e71737137463b1289eae576f884b06fcf1","glsl-optimizer/src/util/u_memory.h":"c5db17c724c70283ddbe04165722f6988d4e0eb9aa3602ae472feff016649af9","glsl-optimizer/src/util/u_queue.h":"92930ce236c0528a98b695f5cea8c5c6aa9683beaf71a2227bdc5d33d1b21506","glsl-optimizer/src/util/u_string.h":"c5a2f4ef576d1547bda12c4ea219179fefa54414977743ac094abcaf696ef6ca","glsl-optimizer/src/util/u_thread.h":"00b708459b27f9910d18db92c18cc65cfc618ac2b3cd144e45f8640057b10d58","glsl-optimizer/src/util/xxhash.h":"2f2aff2fc6c0c929f52cf6ae7314122124c5be026d41ad1c357608383c4a37ad","src/bindings.rs":"79993db2058bde39f99ef483d02560d33b1cb882f6a552319e8b86eb6f9021e1","src/lib.rs":"04be1554cd829eb40864b06d80b491dd48117a4e3a601c7d482117f7a0391e67","wrapper.hpp":"f3ea34cc496f7d90b9bfcada3250b37b314c3524dac693b2ece9517bc7d274ac"},"package":"8ba4741358604ca0848c27ecc069d68e62e11cde81e38aac1da3c54b79ab5adf"} +\ No newline at end of file diff --git a/fix-cargo-checksum b/fix-cargo-checksum new file mode 100755 index 0000000..bae2b2d --- /dev/null +++ b/fix-cargo-checksum @@ -0,0 +1,21 @@ +#!/bin/bash +if [ -z $1 ]; then + echo "Fixes .cargo-checksum.json by removing deleted files and recompute sha256sum" + echo "Usage: $0 .cargo-checksum.json" + exit +fi + +FILE=$1 +#set -x +cp $FILE $1.backup +for i in $(cat .cargo-checksum.json|jq -r '.files| keys[]'); do +if [ ! -f $i ]; then + #echo $i non exist + sed -ie "s|\"$i\":\"[^\"]*\",||" $FILE +else + SHA=`sha256sum $i | cut -d " " -f1` + sed -ie "s|\"$i\":\"[^\"]*\"|\"$i\":\"$SHA\"|" $FILE +fi + +#echo $i +done